From 51a2e5055d01a8b38fac3c65395325fcd3ce46c0 Mon Sep 17 00:00:00 2001 From: wanghao Date: Mon, 19 Jun 2023 18:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81=20v3.5.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/config/example.json | 11 +- .../thumbnail/thirdParty-ammo-convexBreak.gif | Bin 270571 -> 0 bytes .../thumbnail/thirdParty-ammo-convexBreak.jpg | Bin 26458 -> 0 bytes .../thirdParty-ammo-softbodyVolume.jpg | Bin 25289 -> 0 bytes .../thumbnail/thirdParty-ammo-turnCloth.jpg | Bin 28332 -> 0 bytes .../thumbnail/thirdParty-ammo-turnRope.jpg | Bin 30789 -> 0 bytes public/lib/Cesium/Cesium.js | 26188 ++++--- .../Workers/draco_decoder_nodejs.js | 2 +- .../ThirdParty/Workers/pako_deflate.min.js | 2 +- .../ThirdParty/Workers/pako_inflate.min.js | 2 +- .../ThirdParty/Workers/z-worker-pako.js | 2 +- .../lib/Cesium/ThirdParty/draco_decoder.wasm | Bin 280793 -> 285747 bytes ...db.js => AttributeCompression-0b8f7b7d.js} | 2 +- ....js => AxisAlignedBoundingBox-04c1a5e3.js} | 2 +- ...6d683.js => BoundingRectangle-4ef16803.js} | 2 +- ...ry-0a50f4ca.js => BoxGeometry-bbe159e0.js} | 2 +- public/lib/Cesium/Workers/Color-9ff9e611.js | 1 - public/lib/Cesium/Workers/Color-d89a2fad.js | 1 + ...oplanarPolygonGeometryLibrary-c5fc6f2f.js} | 2 +- ...js => CorridorGeometryLibrary-d09d785b.js} | 2 +- ...92df0d.js => CylinderGeometry-25b4eb3a.js} | 2 +- ...js => CylinderGeometryLibrary-4d7f606d.js} | 2 +- ...36ecd16.js => EllipseGeometry-e2d7986e.js} | 2 +- ....js => EllipseGeometryLibrary-d93d7f63.js} | 2 +- ....js => EllipseOutlineGeometry-3d88fb74.js} | 2 +- ...3ab86.js => EllipsoidGeodesic-20aaff03.js} | 2 +- ...1a196.js => EllipsoidGeometry-ad4c3540.js} | 2 +- ...s => EllipsoidOutlineGeometry-52005f3f.js} | 2 +- ...f028.js => EllipsoidRhumbLine-1289f7e8.js} | 2 +- ...f.js => EllipsoidTangentPlane-c3e9d965.js} | 2 +- ...017ab.js => EncodedCartesian3-abad5e8c.js} | 2 +- ...9a05ec3.js => FrustumGeometry-a659c64b.js} | 2 +- ...13b29.js => GeometryAttribute-9c1a6bab.js} | 2 +- ...18e0cd.js => GeometryInstance-c4920693.js} | 2 +- ...a557d0.js => GeometryPipeline-a9233ae3.js} | 2 +- ...-d3db4e7d.js => IndexDatatype-a9b1bc18.js} | 2 +- ...42431.js => IntersectionTests-f1b36d69.js} | 2 +- public/lib/Cesium/Workers/Math-2ce22ee9.js | 1 - public/lib/Cesium/Workers/Math-355606c6.js | 1 + ...atrix2-413c4048.js => Matrix2-7a8e9daf.js} | 2 +- ...atrix3-81054f0f.js => Matrix3-b2351961.js} | 2 +- ...826.js => OrientedBoundingBox-c083edd8.js} | 2 +- .../{Plane-6add0ae1.js => Plane-5931b53e.js} | 2 +- ....js => PolygonGeometryLibrary-b67529a6.js} | 2 +- .../Workers/PolygonPipeline-3fa47499.js | 1 + .../Workers/PolygonPipeline-87656bae.js | 1 - ...bea07f.js => PolylinePipeline-8df321dd.js} | 2 +- ...PolylineVolumeGeometryLibrary-5050cb1d.js} | 2 +- ...c135e.js => PrimitivePipeline-72a87ada.js} | 2 +- ...s => RectangleGeometryLibrary-6ad7ff7a.js} | 2 +- ...fbe99d6.js => TerrainEncoding-c5a10c4f.js} | 2 +- .../lib/Cesium/Workers/Transforms-b3716b06.js | 14 - .../lib/Cesium/Workers/Transforms-f17097e5.js | 40 + ...824.js => WallGeometryLibrary-12b21f08.js} | 2 +- ...6.js => WebMercatorProjection-db7467f4.js} | 2 +- ...0.js => arrayRemoveDuplicates-0d8dde26.js} | 2 +- .../Workers/cesiumWorkerBootstrapper.js | 2 +- public/lib/Cesium/Workers/combineGeometry.js | 2 +- .../lib/Cesium/Workers/createBoxGeometry.js | 2 +- .../Workers/createBoxOutlineGeometry.js | 2 +- .../Cesium/Workers/createCircleGeometry.js | 2 +- .../Workers/createCircleOutlineGeometry.js | 2 +- .../Workers/createCoplanarPolygonGeometry.js | 2 +- .../createCoplanarPolygonOutlineGeometry.js | 2 +- .../Cesium/Workers/createCorridorGeometry.js | 2 +- .../Workers/createCorridorOutlineGeometry.js | 2 +- .../Cesium/Workers/createCylinderGeometry.js | 2 +- .../Workers/createCylinderOutlineGeometry.js | 2 +- .../Cesium/Workers/createEllipseGeometry.js | 2 +- .../Workers/createEllipseOutlineGeometry.js | 2 +- .../Cesium/Workers/createEllipsoidGeometry.js | 2 +- .../Workers/createEllipsoidOutlineGeometry.js | 2 +- .../Cesium/Workers/createFrustumGeometry.js | 2 +- .../Workers/createFrustumOutlineGeometry.js | 2 +- public/lib/Cesium/Workers/createGeometry.js | 2 +- .../Workers/createGroundPolylineGeometry.js | 2 +- .../lib/Cesium/Workers/createPlaneGeometry.js | 2 +- .../Workers/createPlaneOutlineGeometry.js | 2 +- .../Cesium/Workers/createPolygonGeometry.js | 2 +- .../Workers/createPolygonOutlineGeometry.js | 2 +- .../Cesium/Workers/createPolylineGeometry.js | 2 +- .../Workers/createPolylineVolumeGeometry.js | 2 +- .../createPolylineVolumeOutlineGeometry.js | 2 +- .../Cesium/Workers/createRectangleGeometry.js | 2 +- .../Workers/createRectangleOutlineGeometry.js | 2 +- .../Workers/createSimplePolylineGeometry.js | 2 +- .../Cesium/Workers/createSphereGeometry.js | 2 +- .../Workers/createSphereOutlineGeometry.js | 2 +- .../createVectorTileClampedPolylines.js | 2 +- .../Workers/createVectorTileGeometries.js | 2 +- .../Cesium/Workers/createVectorTilePoints.js | 2 +- .../Workers/createVectorTilePolygons.js | 2 +- .../Workers/createVectorTilePolylines.js | 2 +- ...VerticesFromGoogleEarthEnterpriseBuffer.js | 2 +- .../Workers/createVerticesFromHeightmap.js | 4 +- .../createVerticesFromQuantizedTerrainMesh.js | 2 +- .../lib/Cesium/Workers/createWallGeometry.js | 2 +- .../Workers/createWallOutlineGeometry.js | 2 +- public/lib/Cesium/Workers/decodeDraco.js | 2 +- .../decodeGoogleEarthEnterprisePacket.js | 2 +- public/lib/Cesium/Workers/decodeI3S.js | 2 +- public/lib/Cesium/Workers/package.js | 2 +- .../Cesium/Workers/transferTypedArrayTest.js | 2 +- .../Workers/upsampleQuantizedTerrainMesh.js | 2 +- public/lib/Cesium/index.cjs | 26396 ++++--- public/lib/Cesium/index.js | 25818 ++++--- public/lib/ammo/ex/ConvexObjectBreaker.js | 489 - public/lib/ammo/ex/QuickHull.js | 1218 - .../lib/ammo/ex/geometries/ConvexGeometry.js | 90 - public/lib/includeLibs.js | 20 +- public/lib/mars3d/mars3d.css | 4 +- public/lib/mars3d/mars3d.d.ts | 95 +- public/lib/mars3d/mars3d.js | 6 +- .../mars3d/plugins/echarts/mars3d-echarts.js | 6 +- .../mars3d/plugins/heatmap/mars3d-heatmap.js | 6 +- public/lib/mars3d/plugins/mapv/mars3d-mapv.js | 6 +- .../lib/mars3d/plugins/space/mars3d-space.js | 6 +- public/lib/mars3d/plugins/tdt/mars3d-tdt.js | 2 +- public/lib/mars3d/plugins/wind/mars3d-wind.js | 6 +- .../meshVisualizer/CesiumMeshVisualizer.js | 22 +- .../thirdParty/meshVisualizer/README.md | 32 +- public/lib/three/README.md | 6 + public/lib/three/three.js | 59954 +++++++++------- public/lib/three/three.min.js | 878 +- .../mars-sample/graphic-layer-state.vue | 6 +- src/components/mars-ui/mars-gui/index.vue | 3 +- src/example/control/inside/popup/map.js | 24 + .../graphic/combine/flatBillboard/index.vue | 3 +- src/example/graphic/entity/model/map.js | 6 + .../Circle3WaveMaterialProperty.js | 69 + .../graphic/entity/polygon-sector/map.js | 24 + src/example/graphic/primitive/point/map.js | 5 +- .../graphic/primitive/tetrahedron/map.js | 11 - .../graphic/space/satellite-list/map.js | 4 +- .../layer-other/echarts/lines-fenbu/map.js | 2 +- .../layer-other/heatmap/heatLayer/index.vue | 13 +- .../mapv/polyline-fbundling/map.js | 5 +- .../mapv/polyline-intensity-animation/map.js | 5 +- .../mapv/polyline-intensity/map.js | 5 +- .../layer-other/mapv/polyline-simple/map.js | 5 +- src/example/layer-other/mapv/qianxi/map.js | 11 +- .../map/fun/setCameraViewList/index.vue | 6 +- src/example/map/other/networkPlug/map.js | 9 +- src/example/query/gaodePOI/map.js | 4 +- src/example/thing/terrain/slope/map.js | 4 +- src/example/thing/tileset/limitHeight/map.js | 19 +- .../thirdParty/ammo/convexBreak/map.js | 507 - .../thirdParty/ammo/softbodyVolume/map.js | 502 - .../thirdParty/threejs/demo/ThreeLayer.js | 128 +- src/example/thirdParty/threejs/demo/map.js | 98 +- 150 files changed, 73614 insertions(+), 69361 deletions(-) delete mode 100644 public/config/thumbnail/thirdParty-ammo-convexBreak.gif delete mode 100644 public/config/thumbnail/thirdParty-ammo-convexBreak.jpg delete mode 100644 public/config/thumbnail/thirdParty-ammo-softbodyVolume.jpg delete mode 100644 public/config/thumbnail/thirdParty-ammo-turnCloth.jpg delete mode 100644 public/config/thumbnail/thirdParty-ammo-turnRope.jpg rename public/lib/Cesium/Workers/{AttributeCompression-48e336db.js => AttributeCompression-0b8f7b7d.js} (95%) rename public/lib/Cesium/Workers/{AxisAlignedBoundingBox-e7b79110.js => AxisAlignedBoundingBox-04c1a5e3.js} (94%) rename public/lib/Cesium/Workers/{BoundingRectangle-9216d683.js => BoundingRectangle-4ef16803.js} (94%) rename public/lib/Cesium/Workers/{BoxGeometry-0a50f4ca.js => BoxGeometry-bbe159e0.js} (98%) delete mode 100644 public/lib/Cesium/Workers/Color-9ff9e611.js create mode 100644 public/lib/Cesium/Workers/Color-d89a2fad.js rename public/lib/Cesium/Workers/{CoplanarPolygonGeometryLibrary-21546fbd.js => CoplanarPolygonGeometryLibrary-c5fc6f2f.js} (91%) rename public/lib/Cesium/Workers/{CorridorGeometryLibrary-4521ac9a.js => CorridorGeometryLibrary-d09d785b.js} (96%) rename public/lib/Cesium/Workers/{CylinderGeometry-a492df0d.js => CylinderGeometry-25b4eb3a.js} (92%) rename public/lib/Cesium/Workers/{CylinderGeometryLibrary-f49f33a8.js => CylinderGeometryLibrary-4d7f606d.js} (86%) rename public/lib/Cesium/Workers/{EllipseGeometry-436ecd16.js => EllipseGeometry-e2d7986e.js} (97%) rename public/lib/Cesium/Workers/{EllipseGeometryLibrary-ce8bea87.js => EllipseGeometryLibrary-d93d7f63.js} (95%) rename public/lib/Cesium/Workers/{EllipseOutlineGeometry-14470848.js => EllipseOutlineGeometry-3d88fb74.js} (96%) rename public/lib/Cesium/Workers/{EllipsoidGeodesic-2723ab86.js => EllipsoidGeodesic-20aaff03.js} (96%) rename public/lib/Cesium/Workers/{EllipsoidGeometry-e261a196.js => EllipsoidGeometry-ad4c3540.js} (96%) rename public/lib/Cesium/Workers/{EllipsoidOutlineGeometry-1242f733.js => EllipsoidOutlineGeometry-52005f3f.js} (94%) rename public/lib/Cesium/Workers/{EllipsoidRhumbLine-77eff028.js => EllipsoidRhumbLine-1289f7e8.js} (97%) rename public/lib/Cesium/Workers/{EllipsoidTangentPlane-cf43ca0f.js => EllipsoidTangentPlane-c3e9d965.js} (91%) rename public/lib/Cesium/Workers/{EncodedCartesian3-5e2017ab.js => EncodedCartesian3-abad5e8c.js} (91%) rename public/lib/Cesium/Workers/{FrustumGeometry-99a05ec3.js => FrustumGeometry-a659c64b.js} (68%) rename public/lib/Cesium/Workers/{GeometryAttribute-12713b29.js => GeometryAttribute-9c1a6bab.js} (96%) rename public/lib/Cesium/Workers/{GeometryInstance-0318e0cd.js => GeometryInstance-c4920693.js} (85%) rename public/lib/Cesium/Workers/{GeometryPipeline-fea557d0.js => GeometryPipeline-a9233ae3.js} (98%) rename public/lib/Cesium/Workers/{IndexDatatype-d3db4e7d.js => IndexDatatype-a9b1bc18.js} (94%) rename public/lib/Cesium/Workers/{IntersectionTests-56142431.js => IntersectionTests-f1b36d69.js} (99%) delete mode 100644 public/lib/Cesium/Workers/Math-2ce22ee9.js create mode 100644 public/lib/Cesium/Workers/Math-355606c6.js rename public/lib/Cesium/Workers/{Matrix2-413c4048.js => Matrix2-7a8e9daf.js} (99%) rename public/lib/Cesium/Workers/{Matrix3-81054f0f.js => Matrix3-b2351961.js} (99%) rename public/lib/Cesium/Workers/{OrientedBoundingBox-8446a826.js => OrientedBoundingBox-c083edd8.js} (98%) rename public/lib/Cesium/Workers/{Plane-6add0ae1.js => Plane-5931b53e.js} (96%) rename public/lib/Cesium/Workers/{PolygonGeometryLibrary-f2ea6fbf.js => PolygonGeometryLibrary-b67529a6.js} (96%) create mode 100644 public/lib/Cesium/Workers/PolygonPipeline-3fa47499.js delete mode 100644 public/lib/Cesium/Workers/PolygonPipeline-87656bae.js rename public/lib/Cesium/Workers/{PolylinePipeline-bcbea07f.js => PolylinePipeline-8df321dd.js} (95%) rename public/lib/Cesium/Workers/{PolylineVolumeGeometryLibrary-01e8948c.js => PolylineVolumeGeometryLibrary-5050cb1d.js} (97%) rename public/lib/Cesium/Workers/{PrimitivePipeline-adac135e.js => PrimitivePipeline-72a87ada.js} (96%) rename public/lib/Cesium/Workers/{RectangleGeometryLibrary-c7310394.js => RectangleGeometryLibrary-6ad7ff7a.js} (94%) rename public/lib/Cesium/Workers/{TerrainEncoding-5fbe99d6.js => TerrainEncoding-c5a10c4f.js} (98%) delete mode 100644 public/lib/Cesium/Workers/Transforms-b3716b06.js create mode 100644 public/lib/Cesium/Workers/Transforms-f17097e5.js rename public/lib/Cesium/Workers/{WallGeometryLibrary-a8271824.js => WallGeometryLibrary-12b21f08.js} (90%) rename public/lib/Cesium/Workers/{WebMercatorProjection-943e2226.js => WebMercatorProjection-db7467f4.js} (89%) rename public/lib/Cesium/Workers/{arrayRemoveDuplicates-9b636830.js => arrayRemoveDuplicates-0d8dde26.js} (88%) delete mode 100644 public/lib/ammo/ex/ConvexObjectBreaker.js delete mode 100644 public/lib/ammo/ex/QuickHull.js delete mode 100644 public/lib/ammo/ex/geometries/ConvexGeometry.js create mode 100644 public/lib/three/README.md create mode 100644 src/example/graphic/entity/polygon-sector/Circle3WaveMaterialProperty.js delete mode 100644 src/example/thirdParty/ammo/convexBreak/map.js delete mode 100644 src/example/thirdParty/ammo/softbodyVolume/map.js diff --git a/public/config/example.json b/public/config/example.json index e3066ab4..dd883a3d 100644 --- a/public/config/example.json +++ b/public/config/example.json @@ -120,7 +120,7 @@ "thumbnail": "map-other-networkPlug.jpg", "main": "map/other/networkPlug", "libs": ["mars3d", "localforage", "cesium-networkPlug"], - "new":true + "new": true } ] } @@ -1040,7 +1040,8 @@ "name": "扇形", "thumbnail": "graphic-entity-polygon-sector.jpg", "main": "graphic/entity/polygon-sector", - "hasPannel": true + "hasPannel": true, + "resources": ["Circle3WaveMaterialProperty.js"] }, { "name": "军标", @@ -2901,12 +2902,6 @@ "thumbnail": "thirdParty-ammo-turnRope.gif", "main": "thirdParty/ammo/turnRope", "libs": ["mars3d", "cesium-meshVisualizer"] - }, - { - "name": "撞击(断裂体)", - "thumbnail": "thirdParty-ammo-convexBreak.gif", - "main": "thirdParty/ammo/convexBreak", - "libs": ["mars3d", "cesium-meshVisualizer"] } ] }, diff --git a/public/config/thumbnail/thirdParty-ammo-convexBreak.gif b/public/config/thumbnail/thirdParty-ammo-convexBreak.gif deleted file mode 100644 index a5f2a48158550fadb34c539ff1a3def6e8cde69d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 270571 zcmV(;K-<4ZNk%w1VI>2+0(SraA^!_bMO0HmK~P09E-(WD0000X`2+wD0000i00000 zB?G(yhY%1M7#JiTAsiesDj^;lBP1O=Di|gzB_}L1BsVQ6JUB8eDl|ANH9R*gK0-4+ zK`cQ#I6y8mMm#oAJuN{&G)G1`Oi?^jM?O+fKVVKmFB?lU99lRTNIED(JUCN4BWN}a zYC9BeJuON>E=5Q?Nl`plLMl~BH&#_VUtm9KKpSyF8)rr)W=%3@Q#f}@C45&RepE4P zV>(1kM?+3gL{>{jSyWO@M^#u!Q(RS4U13OIO-y4}PjFvbVM&hT554hYjIX`Ye#WyR(EwucX(K2Y-eO`aAtOD zX?k*TZD?|MYjt~c2?_r$F8_3Xfk#LGZf^fMt2_hx151%leSuqPfo*Gob#s7ib%uF% zkbG`}fOm?5dXj{Fk&u=>JiZ?ufm<<;XfCFBGK*zKg=pD*jJT{$^&ogfoYONr#79jF4WIhf0=(Sdoxk ziHT!^hJ1~YV~CJ^l8j@SiFcQmX`GyKo1tx-p>eU1PNIZrsEc%?mu;()da|8C$7cCw^uu&sWvuz$>uIN_c?<)J>xnN8HRRL!Yu;GaPBtVHd(ZT`(q^}>3Gi-U!Z zkcpFsh?$d-jfs+$iX!n(S~#KEkbz`c&b zx0lwmgTt?&$hN1>zOnt8nfJM<&7RH9pv1(x($1jM#kttlsNdeP@WzSc&adFz zui@UX_1CKQ+_&lFxXQ}O$IsEr(#p%z)7i|z*wo6>)6&t={oLc)+vDT!&(Gr5%H-SB z{>R7v-rnx!#^mGL_vgs=>)Q45#{KZ!?Ck94=>6>R=<4YOQtrB9VWg92^2b4<;dR8;=p!PG_#k2aX{_>poYl`1oFqS>0J>(MGy zPX2IOL*Pb%Pd`4LF{1$k0~C&xAw|McoMTyd# zHg@lZn9Sluj3iI6sG=n-*sou?X2E*JN|mZISg^2^B4nh~84?)!n+ zQ4}RONOY``qh!hACZ#C%>CgBTY7Kwbe^WfhXR2Q+0QwQ9kxK23TS_W!6Oro+S_oV0O?!T$4?f7hitC zAy{LEDHcsM+DM~KoY7zt4Kut{at9oCtuPq~Ae5;B3q~w~1uV3P2Fs$PnO2i(RIoNu z4r|3$gA!3B!rP|25%ODbY!PSNj5LxYgmO}Nchz&xMHiMx)tUcS1AGHraDjOrnOY=s zDupK%NWexV6;(l@Bpyib#Ydom7s`j?vm!Qo--FE7chH5^HcO$j+iWt2JRj@MFXyZxExm4x8{2nzEld2MxRT*4$WpEl-g4OFt!&bG@ zk^Sn#Qfq2efYE^nD!`(cA8-&tpn6%BW?*^{cFDq*ujuqj z2tjBMtt6B?yBWwr*J{?}CW0-$`3-OkS=@j!q(Q+U?pxzh*91?*9}CdH0wYXeLMnH; z%Vo|aoI6RX0!G7^-~@D~(;CEVqPia5X7LNa5_aoU2X*#vDoklXUJCB7x1;G2u z9T1bUN;D>USX7>1mdCs<0;Udv0pk|$PzN}~;03-56rrS`iqE+57qbveX&x1+`Q49F zupxocGNrzzL9GT-vjKA8N5}wjhko`WN&dw45waO)fZjP^3{OI&=8Uciy-J`B=C-Vi zW$b|%WDo>Z*pLBP(1LiANCzjRp;ZpD^*hBS<(s!m5Gf+^{mJpxY<1t_H{74V2@1KR=(5}OWiAW&$6 zgB~uy3pl-LF}FAw%jQYXdakUVRwT?k9b^AS?ENVOEjYrVf>Dfu7Naw84Bt&uW5+wz zpe=e_0w4Rxn?!iZ2VfdbaR|xLdKq##^K0EA%Ok8u63J|lJn2xpvqOJfDUCWLBNp(>EA0?U^M@g==-fD*R0bw(fQDEuzxk+8*;ZP2745GlD*YQ}CS zRS4jXc2&Rs`3fZZlT|rAW*IotVV&(nM>@3e&Rtj*p0~)XW;44B#qfd|%!r0!b`ejP zv20H<@F$=E>I6KzA{U=2hBA~2j#5v<=Htd_AeL)We>x{^~U(Fy~}mAVo^tf*IOK$7DrY z+I!-&O`&}gHtfXXN+fTK%xityxwNUdV7b%r*+6YQ^e7?7VVyFCi8S#6oB>u-1m+7}{$+jSL`+ zO<;mQt)MTDMNDWZ%Zzx!EQ@1Y6Jk31+0ZV=F@909^!%B|D5}X3wHO9A)S(V?6yq0J zMhz8egvS-lrZ!^U4f`Zu=4QSRt}&w85(0KVgNvlPEExlxc{TAVSqUlL{fMpl>}Q$+ zHI+COD&#^w5DOs{k$=33zUxh5`~0yd!Hr&gMsw*Ag2X;#89O#OZ9d zf#F0a3QM-e!Q1hgLP%NdC3z`FDf|fD=j4f|+fggztcZZ*UX!%-<+$0o(oL9iHNPC^ zUN`H{5#jsa*ZKb>Qw@{rp9JZb6Lr(8K=h|y^Cj0u|5`!?ECId_3)X}>*Ru2xtNY*T z`y)tO=V8n-9oDfW65vx15HA98D~VMewi1C6C|xDRcH(D0_X9{W#$+_6CX`?p6E);2EafVFRTLz465q8z zz4uA<5je?Ld~Ucd$H!=TBTB@_h7Un(;x{SO$9<&}L)jNB+{B0OM>?~nP0mJrGWR*= zhkk%4YcBt>6{Zo1te_-PcM^0}bsH8V_V*I4Qhw)$SpVmL(&bSU7KVv57He@kT%rI8 z;8QMA5E2-R<5U3?7=R$5c2J0Oc~w3dcuqKDCNSWEAlOceu^9Q(7%h`oZXze>AXz$w z4wOYFprsh4WkoTgcy=*kkQZ;*U=EgtdHQxorBZ~yB~eKja7!o~PH2G*^=mSeHB?w7 zkU|AZ&`f;AQZ+Nw4T1wK#UfmWw+#F_aQxz4MEW1zFJ` zCpjir%{V7s`ITTfCvSo$yzqkZWJP;0MuxX|k^urL5Cd?42k@2)!9WbNg>ON)WkTsu zSa3PxwsjXh*7ofAZLMsfRDBf+M3thC`AsXR}hYvwH)PhT}D8K5DqwOj%0x{7Z$-`PC5S* zC^1k6m4IXE@DA_*5A^U3= z(J%f2oxI{CkfcqrX#?X#kOkQ|GYJ7#GLZ*3h`16!Hr<<*Ll86|6(3VWJc@WPR zn@C!JMJj!fRslunNi71CFv6Uw2WJ%Y>V=H*@%toCvr?+9`_=h!ER3Y-!g& z-}wW8^Z_5UT1}=-gaLz?wK4!o2QX7cH1l_jaHrjdZf7Jt&_g{nhNp}H2WbC9ry)Qn zhQcHG$52(%T(I&`mI8VcN}*A3p;A+r_rjqaS_P@`C|t7|A_aCkDQ5!oFhKjXdTrdKvrzxt_1RX+xs<5J}39+5il@e6&s;vJIK0+fjT>*6o z^I?bB6g)slEo+E;)@QxCnVku8!Dyaad@Rl^R{4n04|xoASD~ z(e_BMDFrz|0v$7+7VEG6IT&T6WWG}-1?z!{@g|G<0*c#YeW51W)`FMt82&UUCU64D zRUYa}fXY#X=p(X#NoFRSp@P+Rq6&{!p(RyR{>PEQiW@;Cb(Pb zwPwn@co=<^ntk(UOjbG^SjtU2cW?-Ii6m7>Be4W38%MSp;~x=s@SVuGBz|j25685tso1tAiTuO z3dg&WPEtD~l@?S%Kz&FtA2ATpn=y@Zz17=>IZDRkl6}QFDhZ5m$SUWmRN%uh_fdo zKLEikFc<$MG8KGxiy9fgBd{k}GVJ6|hoL9gc25?}f?gR7yFdvGYq23fZ7z(V*+Gi5 zn}r`+juSPqJd8}YIUVBXb+Ce0HYuiG6Lza;l&$DVVaq?&2fW3rv&f4{T%4V-Xe%D! zyGOFcx~W88j38pHX!kL_)Qh8LEH1K=OlZbTYW8yRs}SeQrdkWflw+F`Nz8w|R?zoc zG899EY`e&eaDi(c%QVRJW5|fS&dmJlf{Lj6n&0N-`wfCM?L6b0Q5|sSRA24qg8#)071bDy(F(%mSl}p~V@{wo4ss zQI3Sr2s->nJv;+4GR)Jw4Y(O5&wkrgcWtiQ+H2*y&zMs$ zV9JLiHgQl*&}{6txKb+cc*qRR&_1FFn2i(95h+3Wt_B>#RvRq$>KcG-S8QWR5yOe6 zYBat0JDWQgrA#N(XrDnA(_bkKth|C`DR{gsf;DKdElj#IfCHJ+P||cqL;Y`|x2YEe z8|z4sObuN&!qS0ZvGcYDI z_SzBK!C$$8W4YUzrKd2XpER>4Nd_5x=LUcwGmsIwb8!MEa0A56p^Pom7ZI|{-MSYw zn4$vR(QPcHXuAfe%+mH5rU3E$u<-zWmt zab1Tav^WciVu+;LEbHF{Ouk^3Ygqp`&!H`Vft`9VM9g&@$?MGMp~@Pw+m6r`(ehfi zGrSxbUK1a#2qE6k9Uh6Mk=f621*j6~pRMR9UL%se&Zix5F78qx9^*pLiw@ftZEy#4 zP%!O_E_l5>|% z$o?LFk&1YUZYQC#%J^)Hdi`~8MpA#0A*nb4^t>8*a6)_>!i_Z38&c-@9 z9hB$yF@QA8aL6p!1>Lue?8eN+Tn@)kk`CEgXQ__pVOj}+dO;&R@yx~1zQ9Lnp)ZgZ-*KL7JT|MP;P0;78a(@x#3 zx6s$#TNeRbz1+G{P_kG~t~VF%Bi4!J6O^yvtzW!=Y%A}LB(y`jXX61M3E1Xc0`_HX z)}UkWLO^u|VdqquwCN1+Lp8?n6=)Dbn*DAeY20Q|ouwrXa|OLW97WiAZP;F#$1aJa zg%9x?kMZ`h1eD+LhshiwztD!|P@2S&Z^pRyusLG?R#`5Qg*4vmrD9Hmp; zt6op$VNbJQNVHvC0Y?8B@3eS}BBqGOf>?3?#lI@ocut3Tujka?H;886c;6tAKmYV^ zslGNtq{=EW?v4QNbMp@nHU!oXn8V;fgb5WU{PDw}!-EYaN?Ec*%0-MBscfWj<;q5n zSVWE_S<>W5ksd!%$tWeH$TEsl&7?U~(a0+pA?C1A!{-d3L4*1vD$wZBqdb%@CEC5W&sP5c;WcZ5HllK-YIVqG9yTsifG``vaS5y|Tp-9}YSpY%J`4GARJn54 zv}ZfG-rf6m@ZrUeCtu#Yati6yuV>%hy>|Et+|Q@KzC8Wo`SUO2-{1d#iT=W9qmjy> zi4|2?fd!VD$|z%`(?XLXzyPPCP9lXG@=GF%B=qn@(YE?Xr7KQyP!UB=L~%u%R&?=2 z6dyzh3ld2r3B?0n(Xpl!Q_=~co_-PvD5sDz(x|1BdTL4C0vzJWt)kqhiZL84gNllb zaG?bjR1ixoFxO&Bg}3H{p^Y}+P_vFZ?$Co0I4ik?5P;jKUwL3vD#gAS8{Y)OwoXy4PGQF234aW9?nz`k^;gqnpmC8oJAlRPN3bc35JI6;{3L>Qgp7+Ul!d*=50lc0NjX z%COpsK=hEM5UC(3rkPlIWx)k!nT6a|5S$4O2T7^|!fp%Y_ENw&Dp914X4H2^D`SGO zrUb>+abSX3Q5Rr@SKN0b7H86tT!?qH$;XSV4N}M%m^|{xBzai!DWxc#>dD_m?(M36 zuUx_iF1@rXOg`Z<6HPVgX!A`<Wp2s5kTX{|LXs#q<9Rp~h6)mKtud%#%AE4TdeXQ$OXJk2|w&jHXwcVIn? zDl*-4ZSB2xVU+x>XER4JJ5tatl6qco>_1 z9rgutkzRV*Us3lais1(GVvRTUexMpI5Py8;nhLpE3P;|mN-MF%!GyNVa_a>cVn`DX zo88P=PM&=ZT4-!&Lx4gPpf=EPzyT(W7rfX7&n_`1O5C9ic+ykUKoEkd8Nmn-=@9>+ zq%@%%07U{g@LJfy)`&;pAW{;@7~0adEqQI^BAp77+>LN|n&?#Kn>3GmpDYf`jL;qGakVVX}vrSl914Yh4g;$ zNJvUAc{Y(zPG)E=)qE^B-!oEE$oI+e`D7{8;?2pfQU%>n!7CpaOIzU5hC1YIXa9>v z(F~Xl0Uq!j?|?@-(t(Zy0d_7s)}v%f<~1P=8AOvl zIm!=$(@9N=PXeF}B~+p!6_Q1%iMlgb8PItG4qQ-XF{nc&co7W)0yBX^W5&;h2~45! zVrda%CY){&4S2vK8n@5`n&k2pzy`K0FB=O7u9<_>anm8*OiVb(NlyRCP{uMVoPiB; z&`!0zb2>@g7*Xm;xcuO=J3Q3QXNb^GzcG$F0vV2YY{kzqB$O5DN@x@tSDhk0G(Hg} zma{PWTi{}DJ^3LOM`uNwkFrOkIO-!Fc`Cf+%EWhj^yBeaVR%$tOBHFy!u3gszCnJ-me z^GTwd?>QWy68rk=Uxl*kN~;vhV7=rr5f63+7N*2qk-0QIOb|_Hx-c(@sf}dTfetZH zQ?YAC2Rb}WPlNSS3$Pg?3B`~lhsq2Nnm~v~yjU`ivW%qIi4h!!o3lrv=N3t;s;Qh7 zh+}}Fk+t%wd2aevRC;2Rr%dIAzWd5p_6`{(%4Pb1S>XQzPnJfy$H|F@u=-fQL3}*)z9pU9Pw2x*p*0f(v5sPcGogUpTT&X%l8^iCUDlBg5?) zxTdm~1$VgPxfA)?&~oC-4Z4S*?k2MP>1YsQl9j?~rp{aPXo#}GYP+e=;FjND3^>6} z|7G_ahs+CC76jDO@brjeq=w8m$6JIuE8$2%jg0>!cBl79kOM!vLtUPWas-Q6^tl)# z#|Fw(PV!KR%r`6Bx6#|8`8Yi#1TKX;xVv$^FiMYx8=a7NBaeF+k*Rx7duKmLR&sM6g250KAMOw-C-R! z>KEhNqnMkc7va81>q4Ca!HSWmOlytX2)d<8KTrxa#OV$GLN)o5KZUwJ2cd!=u)i-M zix7AvIAD`T(3x9UAYl?fc*q9^qz4Dgt9O7vbV!F{V!*Q7E3@L6Tc`z|NxKev8mY-3 zBk({pIz+_^A$1~w5x`mvDg{M>@z{NS^=V(?cuaLqGgOLR^t{DUd;Aw3)*>lOU0;NW@Gs z47s5jQ^5_QgG8q|A4)Ve&b!3NQD|kQ$W~c-S;=eR;695dFWV(Ykh?-`jnqicJ0>K?)JjoD}00uyeWn{+5 z2!kfTfoQZb9K$5Lnxcb1y62Xyy;m6>co^wHv2l)t|>!5s5g)lrw)?`h8#KSy{Bix&# z1Ccm}%%hPc$=rFP@`AKNWTXF_(mvUgBSW+blyonZtN@lAsO4ZhNK`*jx~iG%mrI1Y zQ%kMru!^qG3qNrg5O@JNxPwdBx}j;xrD2*`BBo=yg$U9$`w368l7@8HtG=p>7kEzx zo29*?gkfuosiB&R@RmKSG9Sc2!fU1w- zB=7mleIl8*$rXS)O!O0<k ztj>@M(3q08k)asm2@ZYL4pj=nBNz)DFi_g^)j8Ez}9T(%&+y<^8#0Z@kl`|*XQ~pZ&jCb zJtQV=Qn%$pn9$pkxC)&J5agt%d%X?%8q*2jSMtFxHMNS=+6r35M)YC7os3h2^^)%l z&xw^V1$z?!+y$U%tE%+M3k=1$xUjpT#aINUS$qd{$g5t0D?wFMN!36AtyGo3iA>d0 zxom(0P{#khd$F0N*~ze3!6S%Dxe$jqUKdo=Twztt$k3pTURdoI>K%yI8r^HfCRl5*-+E*Y69`iohfe$<`}~34!5Xxy8ciOEf>G+q(U(0zTwL zbCDUzT?TICqYA$O@fZkBzY4BoOa3J4rI1>s6zV;n5AKbwKmix<6BcL-SgM4ERUlnF ztD+Ga_Jo5NfSQ+)wfl)BI)T`m*`J*`MGAB~82I5o36u_0owF1XkI=gYKu`t!UAJW7 z8lbVkGdvGkFAUXUUdh$-5FZSH)e>zD)jOiR;l|x4TD$~b))HSdMnYv_R)>3I^}tMb zerG3aU(g|gVmzJjGYG!eXR9$=JqANXi#VB59z>q5k>XM+{m3um9p02uELEwLP>KJH z$QF%oWQ(Q{NscN|vgAsRL`n4IYDtohPLjx7BCdebgEiq5SlIDInzqtKT~wx~0mf>| zzYr^vGwD+Y;~$^t%95R3XXA@Xt%{Y1k|D+d!r;^dRRU0LltzeI7^{qDmPX~ptZS_1 zcsswQxEveoG4#U@jtXZU8s}1~RUA_?PDAI(EIrCxXLfGqc%}f3if7`oBIE)cooj+S z_5pr=3V!wrd=`xyy|adaDUodG?duVR=3B6LG1Z0Nu6tnJMIwG*%ym; z+(^!7tu9fRjLDAq>`pFi5I&g^9%VYc+>K?ckA;(_!IM~~CRfA2tD6g~tDpb(v>8g+ zWnN}a(TzJ&)(b(=Y`={c$wq2qWB>_RW^6lzLm&j|u5RmwYRI4rXoTiz3^#a+!K^+% zqy;V8FpsW=sxwwjdkU>^Zan4X;BmCo9W&?jmP}{?xMg{3^Ns7Po$EF(Gbohjc`mN? zpaQ)%9lq{sqTpvi=|I%!h>(C%mwJ($E5>8Sh-1!hD~PtcJF0j3@H=h@ZG!MMYV3%v z<7g`p2dOjknu&O2Bi%8w4juv^Xo%Ckai!P+#7w`DR$PomZ4ma1f+bqy7*=2zf5N7{>h9L+yiKKQ} z5?T!Fesk)E>foK($%s(yuIhIBZmb3$@%9cJ(vKh$kMkzC`ew=UZqDX7Uj6b_`R)wx zt#7KG7W2>?{oZf>Hn{Y~bO6r}3b5myiy! zh-|^>5?j5dGsL%{CFfP_s*c!i(YMMwm6iWL8II+i36HKGXIxQHt!Q+#KH5pwqAm&}7`=3u7cBQA zb)Khafh=*6f@s`Ti48xUBUpl3{|}}AkH2Q{248vr!B)Ej2@4gL;O?IV zLdBo?AJ7f_vvNwdv-hWoy9~T0Y~uNfMs)?|#2SbcB*pg~tWZ_xw$G z1mfjxQ=k%PnaFg_Kji`}DMx)TcXMJYyA<2I2zkwUr=Nr&|@CW}T!GWcE`iJ;+ ztdX|W$vuHS7`N@6fQiE-{d#3j7d*mAIm*r%e|zrT2xtcgDgvntDLCW@!h{MH8XPk4 zA(b%_Cr&J5@#4fPRUi(O@&gBs7A!`FC<%j3C0^3BNsAVZ88cqIcHOFZYnRNNG;i9x zb*U0iN|f~6DO#uK9X&$zG$Kj|PMa4iK$J9L;=~D%IeskZx7L!wfT!a3Bc3u6u=2_)u(ZqbBWz1+J78{K?P(wu;1kr9b zmO;@&MmmXPMM~P329;@`aix@HXe3rzIH3O^5=kYsamOXhV8c>N(a2QOPn8HY6jFCQ z1qW1Z!~nw!dA0$=3MGZGLY^?RF({#f=BYwS9DHyfNC@%w;gDlN^wC-jG=KtJgw(YO zUU@lF4XB{{ve#daBoc)ZHMAwcVTnPu&|*YR2I*sz{V-f+n}rrybfcYyT52}D)>=Zt z61xyWiyeuZZoBp78*r2fN8D)PK`(3g&1O_ zAeyL1imbRe3&kWDv~99S!(~}o{$hx2Asq(H}p`HSuQCNN6QYhn?y=hnZ}Mm zQ;CL>TaM_TmtZ3L=a`h-!b?qVIz{K8G32=d)_wX30@q!8{k5N2W4&}qT`QVk4*Py} zU&auD^#j2TSc-!ZbIkRZUZLtus$GygLP!)okg#eEThaGwvawPD8QViHh7hi!b;hk} zzg}RWYQ`R`kg`tB%q-8(ZW*l*!r4&VX4jfW-e=8G{yJ&lf?F=_wcDN@y0RO`T)gnk zNMnuf-Me3Z5GQP~g)?ZlVcK1VMb^b3su%sm@|Adne%UuZP>IxgAEZX_DG6W8_-+s4 zi7LVZ@-OY@;%>+#|7Z~wZcG0m#QiZZgxIaPrdFH&5ON!V^vq@$!CA%%c#)q~DQK;b zMJs~F3M<*Dd}8qkNWjE`vaKKna7YSKppvH-_^E7PJ0S{Fs6wig@G4p1ioR&oHuFg# zKr@gV32+dXN8l|ldJ9!D_y(B2H30`CNI(NBP&oY6hcS{-4BH?x5Ye^levz3LwP0sC zU^Ogr#)8%7+D1ju5#({PK^oU83wCb2j<;rayE)Raj^63ja(c(3c?Hib`05JM z7}hX{F)u@0q0d*w@*ee|h()k?U;85IK1oLMeeauvyI%An3987En*1avKPjV*se))g z3Q_sM5*b&~2RG?cpUD401`8dX%sm}h$RKk$gUwh-SG&^8<#K7E*Cb?s3e3_(5~x5< z%19Q@d}hd;89^DDQcE0R%tLC3gA*u?gD-$V461gu5`t}ODJ&s6SJ<_Zs9+>mxxvE} zvbOVeq;X`i0zR#v%^NZxhfkQpBQ9Z=y(B|#LDWmBOob{VB2kGsV4@YB=qkkw#4%GO zBfcKjzsPNCi@y>kZN6xm0Yb!c5E-LD9w!_$if4_iqre+udYm}2%Z@g^DNeby9QJUG zkA1|R6p9BD326m}_ko^?$}q1MVe%KmC_tL1f#BYwQKu=@r#l1=pyf_q7@ag70wAHsc4W9 zjCNGZGTaMa3c*anIJ2wCQns=c;Nl=zlPrf2a16*qAdxt`GtVkXM-O}^G-Ejn2nvu;3ZexGKM_S%!aP*ii*#(1J@V@{_b1F;8ONhr4%V<3BHAR~tfU1I0!ekV zKq{dYwW?L^G}CaAiUtrNjq48%jNk&1AWEIQ?QL%J6wWrl;VFBPO4yET+>+S#1n@Lm zbF(QB`IyCeX)zEEud68@4wSpqI4DAg2skC6paJCFimi~f-u!6qaFda!>EIh*`qp=l z_YHG?IolA}s`_(AJF~Qgvl#=QC&ArvFtU@aotV~9!i=O>joj1N3;%~<5Btwou22R= zcx?X`PBp7kgS=xNs{_R;Ua^Z`yyASMm>ufqYFfuiR%Luu$3JF=xnrzv8RNUhLXN9i z$!g@fwvVr@u*gO{QW*}-rr{AwjKvH%Bvnexe_y`%|3tbFokhf1O*(Ti^?OVoIk3&r z+|ir`k`RkGY_LB#Dh5w560)rjoq!6|pz%aP5CDqMNudN#qSlBy80rOg8Z@D-Hcobq zqy>(C7{xe(RN=|z(sJvk5}+WLP4VT2plU`hzWX;+k$?e6WEKBnwixYAW}>f7^$%h# zYmD31i}>Z7=L+H)jiZ^Q`z4*}P$z-aC18yZFgApht@y=jF$11R?{3QObq^KZsLE-{@oOCk&e8Z#$YO(CtE?uE1SSO#-~ z4-mJwfD#m)=ztWZC`BkhaZ^#C(x(@Euo6#WhD%%mwOb737L~Zf)6m3FgpdgNNjtFs zR>V`(J;c=6OAXb);2c0d8G+Vmia_N>L3!QYgxw=F0wF*FLmfZ^uu2W+4-~OossSJI zx!l{qmfQs&#@*WH;9cJ79YVZD!)TTOEsH^@)Nl}(c_hF9n8&vuUg9y{f~EhTGj=BZWbv6WcK+gv?W>S>`~{lX=EOjETFS%q6xvBSQ_ zUXRgOjR9O)5nTJ|UXm%W{*=!_V;^-Q$38Eq5U9RQb4CRdU1yJ8{#LYmS zl8nJXbYEsv771F2;Yi94+<*yizzKB_9O!{f@PbR=U;d?HOw2?j+(A^(pB|KnHq0U| zrin|e1UkHfioF9ms7WR00UboeRD{3>T*afI+5%2m6yk?k$c+TPh1T88CiFt6T*Ee8 zBQ{=RH8=wYh8GG*zyTZp63sy2JY2H0+LQUAY(z{8rdq=Rq6{L-lbHXR4aOZ0Y#9J0 z#*y@(51!F=6xd5OUK7?7655m!<_;YVn{n4ne{+Rzo(9gJeo3HdX`J0mi7I00V^M*_Hnz3o=nQxtd_9U~HgT zJEqzT2A^!)UC43Vh#15T{$yt9pgxWf;Q1rF0OWxQq(UBBL6*xwF5w*Yrm9&EO6)B}Y_W%}9wv0N9AYT~8)o+X+_i?UH2iN>qMdVp!gLNWnIdAJ>FU z8;~Mf_Tny7LLJnBp~1mXRKhMq13Gx+gc3zcL_<2TTRKRCS;8Mu{2wo1LtAPCFHiy; z2v^wCMblzYY9d#+|aikaUbJJdKYMEw?MvNTFG}(ycPk%~GY6Qz= z7}7!j$R93!3zQiTy0UW>pIf200C=YX@<3&A7Ho^Z5TZE$oV2Y+}0xnSFHb~|?5Gj!w z={S5tl5*e&lG+F`004wzl^W=Q%8-*q)MV+bZ=9*-v?i2H#FgY{ zZn&up{G&@1VV~j=o_0sN+*HaUp7#mrfcSt92#7EtNM%KUqwcJuM!>F+KnYw3rBVSI zSn7&op2*0^V#TY(AP$&a8LK5J2Ba#j2F#=)~D-)-HsG!Q(r| zAPWwJ_{>>Vej*E%L|T#wGoV9W-U3<%7y4u%BBC^K>?nS zq6B7wlw-Tr$GgJoL%>Z1G(b4!5EI<1zViR8zy2#_4lHIufedKo0VM1=K3t?Zmwq$` zSg`5DE>6Y1rw;ZVNy)0l?pFZ$9hqGT?}jXIRDqkqDFvJ?%D(KKt}J#4=j|A;LSkYG z1Z~Xb(t%)NXYlNz`fOz(h@kqw&{nF1F#^h^obTN#7G;rUOcrT;)WyN)`rcadvBnO> zul()+ZPMU~P*KJN*4V~O*>2f7`f8XKUwYw2Qu&pFTIJgU$|$ZS-$n!fnQI;Bfl`QT zG|VD8v;@>p!cR~_QE2d5qC+mi13kb4FM6d}aI#JGvMKDs7JP~66VdKy zk=AF0)|vi*ns(NG@~)Ni?(YJxfW4{7u8wsuZ$l#QcC?P|u(1(N2lYa4^iD7J?uyQ0 zFJ)=3Fo6X3CPY_|$Q2Z=MVy7o^(qXqXUvrEX`CbyQaLHjIJfu|*$<9XE`C1ak6uMH4`TL?T4=GIFu_4;opt zXh^aryRWJ#hJP7EtKQ%a#McC1B4&~F6}vQkoLAPKCX^{mPexfQuc=|e2Nkp}D6&(} z-N9N)Lpr>}Q}bb1q+%v%bXs`NaDTo&4<*lmIt7=H}J|I2Y*;XG1yv4HTR+0~ElNj$jEc1Utv@!?qHQA6f^w|=}Nn7-MO)~SbX6NYFNqw9q$6b6;7HIrZYe#l}W=LrQh}xat>V9c$ z{~p3zGCfs+f|9@oBy~w(jnBoRP2j{_uE{ToP@sHMc>fdEoBYGv{c7pS)vKKnkxyFA60xnV3y$8^|zLb4n@HA;3WVK zM?oUkHG@02UQ=c^SOdXAf#{aNW=fzs!_Yjrd18-p#5xgt!6`6d&c$vPXR-K+qxi?U zrhQVjiwm@82M2DNc6BK9jU!u*KUi-DxiAfRXkcf7=2D>|i`vADk~a(wtNk! zXQT_SP`Ph+(cQWK^sDxU$8BtJ^T13KM`(lx>x{Y7micyCI1dO|rXIwtI`>VG6>&km{{~A0i!-^{l!Gd}>a2Z|wIgL%!0(+aHG+;2I`}ur3L;l63OF#pC z7q0&KA26afZj}%Vm;i;WAbO!0;%oWKqX8A%N(CsufiFQ6*t}inLNEA2GED#U?}aDW zg(lF&ArQhG{Pj1ApgPaGyN2c{$9ZW=#(Tk6)c(?Cl`643;zeow?_PGQ89rwfyR-BL z;1%@Pr@gcTLP50x_{^z``?Xi%X)Arv)w)acI&BS)(IXu}2%sXSf^ z8FCf>t4*ynuey{P@&Zt#MTbsA=@f0+r%>7EV43rW5V>>ZzI5xBZQi_h-NN;oQ;3wA zRjB;HapFS=#VcOChyh1WEnd;IMPqjBQl(3`crmlQ>k_3qbne{IqlZ!@&e15dX3dM& zu3MNd?Skz&8n0TS>A-38VufPGELfO0K?0?XzAfhtAyNf;l`&(^oI!IP&6z4XB`A=9 zqe+-Wk|b@~q)S&XUAWepcdyCPqeqAc)rX=41&Ia{X5jcCms zFR0#XNw1FtA}XnYE=UO~s^Y?Gh{2?r4#epQqXH`hTbfELm#n&qis(WVF}f;-po<6p zwlKh`p$Zu4$RLY+{1M27c*OC?A&oo|NsyQli6Eg)a_YgqmH==oDz3PqN}OC$iG-oN z9BQmEk5X!>rqGHC#i}^uu*xdCI?)EOD)_Q2jLuREPYfHp>#vsHx+_AE+FGtp73V6D zrYf+YB8MAH-~faW7<&PRHtwM07Rsc_4KvklvF)--MDq;}I7&-xGuwE40+oU2BtF33nBB#8{N$bu-K$Rddc3R2^aJuWCuCMQzKhN=*4Q!7RL)yhN& z(He=)m?a1kD1nyL6U7t_T{B;l+k6vXfkl>i-i?0!HP58i+Ed*h_+m>f2ctAJumjtK z4vR&lIP3!s7NhjBJ1Uv1GEOf!yOzy%!}YfpV!c$evnvsmZO0nB`!PK(nM^m{d}}NO z5IE?7fd(qLGgup%Bi2RilI5-e5_||Rkwvb(9CP`y&9=TMxa|_9|6~%d<+#W#m#)<3 ziYs*pp>B6(cx9K@Cwgl@^Im-Qg>I&+6qG7Xl5DOQ%?*b@7{=%pmaAd^8y?0up^q)5 zSjdkvmY8GdwU;<&s8zaoU=@8vnemlrD*Xq6(^^t^qRA{1{M&QZkU5^mzh5S-POPy8 zk>~XCNJm4O(g=7vy*w>1d2$e7td=OOWvvVml%NC)!?mwD#!{4!Olz32D!I*#5_-TD z9AMzKSBdR|Af$t?KoF^~nQCmz0L`e{pew};Za)JYSYCKQ7p%l+I>;JAoFveI8cZ$> zm0QFTnOGkuK5=u`B82C<#h)6mBtccFT1`e2Aakh>jIB!_RQfj|2*?hN3P?)L>Se&G zu#RUX3R?f3H!}znO(bYqQH%D)xa9%QVbiPL_A0U?LPGB$8q41QAsM+5zckD#ObQ=! zc2_?9-4A_mQeVi}*GW&_40rT19-DUeB2%97l)TH|zvf6s*wsv90xaN11X#;i=A}@q zlZ#Ed_`nJNvJ6>ULJm&ws7Ns;25(ahGqkZO8O|m%AQaUtm{CpGpp7;l)B_w=2%Jil ziZrUBOl59S3AV)mI5+Ho2Xv^Xyr}MnAG%Hzgh0gaC?N_-Tw)=f*w6YPB6E+JBDZ?- zt^Z_li(K4_CB3M+papM2u}kCZ#?q7FU5H=>10(Q;_AWJ&WhwGAUa^t~9p5p}Mm@?= zBU#ELLn^XjE!9XOk+jN|@h>IMtAL=GBZS=nGlHtTWSh?a^_ThWfRmqOABNuegE)4m zMW~eOR70f7H+{vG5ryT)+L@?cX2Vv8h z+gK(V&YPFY}Jr~ttUCa-q_{%zuTD9Xy>Yk6>K>Uwi&FsNP@MDoQBFcYRq_)3t!{{3%} z16&vW`7gR%O^ZjO24q9=vV0Jh^#m(;0!Uf^xP>9e+XkhfjdZ*N9`r!$hc{)J64R|W zrb5kTU=s~#Y^tuZ*$fC%<0;TIqHgKb@j82K%R$qHO0gA@vTVSU8sHOJPPSGg%p-|N zNHGdNm_ZJyTr~sT`^t*Kf&{hPFNfwJfjV_pn8&Q!GMCAK4GOMN(g;%Hu1K~-_#;$q zBoGP^+yM@t?w&c`@$FIXVjU3?O<3u)O$zEQRAL;-&jrXxnh9s-6*78rGHJMkF^r_d zbf#rZ)%b$CziD8Fe~)ea%s+K|i=DkcWsEKRN)yQ@gya6cxIWnZ=! zXJV1N26H-h6cX`>NIV|$k(YdV+Htis0_5kcZ}2?E9KoZE~`#N)vizL6Y~apV8~r5ZW(`CM}Hr@SSh zBvd(h?ltzy*kd1r(#LFenD{u7nx`1{RP36Yy>rV+9x^R!k+?YA6ABrNVLz zI2>aE0mtiFhyyl&a2kLFbI73oq(D*1;5t-66caIx!ukeIObBkGD#Xk(Dnd|AxGZY+N~ZQ0C->wc2pY!D zoKSW&&bfw9dVqusiLW7!@Ay_~BYvriSjqXGPm8SLy0GiE!~&Ks+-MGMZ|d+b|3=N~gsM%<#U&=p zYg|ZDBCzWsaIGqAt#B>ZCMB8j?g2m06>)79*NOu^-~&2f1REd$4uAytV+L|SFt9)s zS^*YdVHTE=8DXInT(HRhj*JH9WIu2~3B*GOv+=Zga0!0UigLiGeg=##jW9+}K>*Hs zm<}T-qzS<=_KGH?$_qsTPU#5Z0)Q+FZ*O^oVE5>3W86^zkk28`5J^BT`3O>_(ohWr zGGaL5myFK3TxPN|MA9Hh3IE5Ao-h)NOAm`D$i!&807)+Z@goOO=eB}FT1R&-3)JRI z)J6>=S?Saw>WpY7mJBSXFhUOr$hXwwDjuxr+|Yc6YD5f!1az?!Yf&jJY%x?Z1XN%J zxK22_j#r*CIG}P;UV!U3fGc@L0Kf7Cj)Me9zynC|0L~H^8(r zQW%2a7nYF~(7?$5bfN~k!&#UB8?!O;oGcNdpc_F43w@?UaE>m}F;3KxBiM0`e8L@} zaCmyM=0wu{mMSV5EIM!xy@bFE|541u@E{SABMdU8$S@)na^og~5qpR9R6@JlX&$|2 zXqd2~c&j7D>(NT*Hczh6e6zAlvP0sisQhA&qH4c7@xEfx5ls*FX2%L8h7vDwB6jjj z8pP4+2P^h1D9d2WScVA8svMo>|7ze@#*#hBk{91|12o_RSil8jzzyybKN(N~8zU>h z20!J%4P+nybM zL_Jg)iXj;PW+5->>C1Y;7ymL09B&8J?Q#mU8w&~xFU?K%v2|PzG9$A)Xa^q6D9q%= zATTN_ezSEn(|a66{wD!s*r#{)~hv*rJDKPAm2iUlo^J_f_{Ars5C+AORM-2v#-Q zF-$bKNu^)`4`k-%zK^%5B~@bqN^HTbnEq=HLl_a2St33a}s# zvgQh^b_uSwSAF#?3xENJ@q1k%7m6Vr^5Gxm*B|yFAL!v(l|fpml{?-x0T`eJd_ZpL zHlQHyZt=D-xnrlW5R4vbBt?@gln%iJ*D2c7V?c=_8JAdW%GA)cGX*g;yD*UdbVOxk z=SvUCbE$`OSNJFfcK8-zbQ9J~CesR0H)2cIlLlsXl^1qV1TA*hV>u+eL^e^ik7oVF zM0g-1e%IhOl4ThQ=6-BAcjjZ2m(dc3!NM`NoR?>hP%Z$D=}2(#2%!##O!7l4jE00+KT6>MP`kX3%`*KC;;TI~`RQ~?XPBLNPX1QVbEO5hp^ z;YFM5@eWuL^0o;SnDZLggB2HoM|dD6m>^V5V5EmBeoUkAMYhljNk150RHq9^lZ2=A zgrlb*Qy3|HqzP58;X0RM5b_~n*a28rNNqT2UREAOR#DgM4?zM?;Q|Q%lqF=Zcuu_& zIZ^ig*6ffI0F8ndx(+qrg2gut=0=wX$O0v-C`&oD*h3&F%epv=a^Pn-6`vZ_kaRQ}d5|=x{?C7H*A>2+~&PJ~DJ z;tGyRX$pHlj&mUbDR7ynb9pQVGGHe{Ary9nYp0VCHI(8MPm0-?yEB)n+UBl0l@+&R zK^VNSDlB5>n#X!&hvbIU(}F3Y^@bCO!5L+Q_!6Po)xHnb)cJY;Y2w~Q(VclhE%Awr z=lNRf`JUBy7>UseuwZDA%9C07ACqSepW>j zz*(-5$pG8(K3d*P;>^0|fh}#$O0Qj4y7VMwBogP%Qpa3rIxmEWErI~2bJ}^N6qmj9 zG>3#@fVm-nnc<4M;98gslR6>0vy5%~7)H5U6h^vozQIFUr)&!~OuSj{gr^1boc6L0&<=%ta9m>{O%^{-y_jgfnB2$Y39?-bsUq7%tFRl`bd`Kr5RJV9i|@dQI%O4kfM}?iJG`i_)0B8 zxr5r4nY+1*0;!=py1Ddl;fFJqSz|5IOt-tL`P(mmfXvGr2#hMseG=Ae>O__}BgvXN zrW@mEl9x!LmOb#3fo0sI@To^075la-aaT5E=2cRM36Kvi-7_mSRRN)n7;TMRZ7&hD-(t*^U6~v>}L{*^-O5RU0bw2|5 zvs65D1oLh|-dfuXa&z6R_>0$NVHRis>S=-3v4b!!KF2ZQ)@`dEH-defU2$6(yqQao zYz8WP8;pVgxRKm)hkMBj7N#s$OujTBw4I{=svVKwUdm(7r;|E#MK^w^IuMihcD=mS zY}?(L8Q#Tj;W@<28^4(qzux!sIlGATLivBjjNjph&J(rtNWx-cHt->z3QQ^Cx#BAP z+~IS=Mg!z8(uILgCa>#auMJ$||9a8u`4JvH3Xb4tu!!WnD6dm~wM$8TN;;Tc7NTAlgh3g~AL?bH*U_Nr z(J}Fs5M=7SP?3blp_%st>Ea+DBc}}>Jb(BU0(6Mb zp+kWJ_4$LRQXV#Js?-`yn=VC)6^K?KL#cTE3N~z5qGXAR^*Sc)m@;hJx@9}2 z%2y#ioz}QeL4sbC3M}e{cp-4qs)VgFEesW>&YeAx8WmDj=vgXi$A}S2c86xoQ8i;l zI@v4T&p&dQ&hc4@6e*#ptbQ%UsOcIrNJuE5q)8M)k9zz54Lo>nOOFyoS%PE6j2bzX zNVx*tE9}=)u3#ynNENGBuyXzS6)YGrV#SCB`!#FUD^{w?V3EEWYYy5HNZ?SiTe$w- zk^1-Vy$Bgi_%K5Q4Mc@-q|u5jw9q1qFv={0A%?q?A)`*^*2)eF>%mDk_ClP>~Js7*i~N8&$w#kB|Krq`?$esX&%ma#@i{ z2dVV%!4t)}aLFbwY;Z(OV(cWy8jB1wMHGZdvrUVU`IDw(^{D2WZL;{LVv{n~*biHA zB^g+HF3ohFeNw@6WoZdYbs2FLI+}v()W ztOgd~+17Atu7>OXiZ~7uoSUuf8o2_ulGE09_j#z3;ef2MTS#$YEQm`1&sUe@{ zXKS))*Ho7hjkD26`}t>OZb_Y1)Bf|%zp7R3YNDx&T@=+d??C`;5|PyWus0*Lnom<01FARh!?^z3corXikh-IDpUat?t0yXXc3GGQHU0;NW+JWBBB{63S(gtpG!z~ zvf;hx0#)Jv3Hyu!KN~EsQ5gw|%tAK4m0byrkvdsbN){NCVUGtt>LZY7q%s`M5qyNC zqZe;PKJ$eseCfK>`!ZO!_XR0V^efsAD(ICwO-+FN1E42A`AJT~g@A^l3!)MQHb!|b zl?{Yb`XG3=36h0_V<8HtAQ`F+@`-P>9AR5XSi(a2Ero%r)el7{#NZ@i4n!=F1ZIGP z9MG_aQdj~~QiV-bedaWu*&!9))59MoQ$N0{L5UDV71aqriS0rIE8Yc9S#)R?`?_6- zviOh&aPg2Z$)g@o7PM9>sEj>1V;T*{#=f}mjfNaa$N1vBktGb4l;UF$&N#8)-6)|7 zEhHiT`58z>f{BqM8{7OODM8Y-uV*NIq%7@}$^5;=3^c82pehqJP~!A5p=pr*+Hy6l zW$l0nROQzg2pCsVw4y0B$}DL~g|gfdm!Hw)WC%4vUS3s%lVb}S+>%vct|o;}p%n^z z5V~c$ z3lks9L@QqLo@I^5=}-bGkd8!BlzK|gOd7$08nh}1?Ou{PLeehDagGg~=-DiKQ6c!T zj}jvS5%yLE+oB05LAYZ_nioEgE>yFLG~dQrVu68uR%n$>>0*h(GoQ3HQ<1^nCfQQ| z)9li;ll}9b7(Tftu$)P5UTLh<%3#7$8jwW@%n>Wa#$2WbsciLoE=-k(+Y8!KD^$%2 zdBsAgx9F`?P)vuU#zrDh828 zfh4tWq|$1;7g2;o@JAT!(GYHn+cBIWsDvT{j+pKVDLCYjRxVT42p=Mrwi_ zsIK~{tt=iyiY1LaUZs6^Eu8Fbc=_Zs@d{=32@7G^0+ zRo_cPxVN;VSJ0m#G$fDq->~qxY6d2uD5o`G1rw82CHP^tB3zs~JRvy-QVxbkJedt& zbFbN469mTG8AK>1wklRt(XpZov}}mXU{=0H+{$Jz2-=TDuL*J26dgYRBMo=}L})-58t^k{L>BjJ zMQczbKZK3xPV>40+3tjbOrn#Xx5TboZ$jN0-}pYmv}M~A4E&b0{2aLD4;~SPD_oCF zS)h+2-SUT9+~d%lIK?%U^ZV&pPlDbGRgc!QkQdCAjUhS4%{~{T*u_OF@8X;5F661i z@+WJfxzzY}^Zr_J)S@h5uBTbxp!02*vw6yc3DJmS7l*ARK-bclo?*FecnRc(+hcGI z?5g|guq5z76tu4Wu9xdvE02`AfD-K{*6v->uEG?ApaV8Q16s8Ib_igA1@QoGR{=Bt zcU2*GzO!7wcXuu2QdNdVq;+oSc3Ms5P|@=dA2WCy0X&6wc!{TFjHd=Em~W5QTS78< zDS>$+b9o>25}LPW*Hbo-LU(c2RG5SrrB`Tcf=i$_OZzodO0gM9n1pkJgt7-TpY;^A zS6(#77MsRsyH`~2l~hAxDIZ2jj6r45bgFcF?cXDI9x8Vc?+{ta7I5l zV{w~CdO}fWE;WRy=XxN=8M7x9OSmTI_+dqJXf&2z1+-o%r*gf=a;_vl%LRq$)EH)h zU!GJbLlK0ML>i&-Cv1pnud-|L17bcgO&T^eiqE1WXF0k;47-BE?QVbgc3m#&MQV@W0 zw~7VPb_xiKP4R$$CxY=-Y2uhR7rlPz=jJ4(Ff_?T`=ca1P{f3_j^0STF@csfr44 zfajus3s@LSnPl%4DRwt$b}5yk7gc-7j8$3x0UUJ@UI`_>$dxW5jBgfi^JZJP1);5C zTNfxK7V|RIQ%J$Mfi)xL7R7XOt zGEB09o4MISxT1ZD(1%6zOw5r3!}*ZZWSkKxVpHc!Sa2=b0!_N{oQC5c|1mD*k^t2i zlLa9GHLyC{NejOqFZR+7?Vu0*zz_Mb4)@}dq*w()nTiG2iV8RbNtt#MfuCRLaxX_; za%N?t7oq=YqC%i|%yX3ss+DZ1K!w!*5_wb=h6fb3WsJGiBSE5;sP#Mor!icas~pN^ zV5y(#3G|~eI+(6hqewx7J~)Sv8C9ckN_e3c3F=;% zbx54qgKI-$g2tCgs-#QmTuo|v{}QE_GNr4-Iq3&X=`~h%XcxIjIJanQ(e^qf@7K`UrPgi7;u21pzUv<1Q5Po##-f`GBbZ@DKT*4(JIC zR8)%n;-31%iU>%lGh&~unu!GUJ|EhTkAX=eid*3L7*)wV5QVD5vz4n#gD>G)RCbF- z@ke*0nGMscPL?IVNM^ozgC1J{Y352}I(2+yNM|7$ar+g7PAHgQ1FkV@QtWE2{;9Rb ziYDvDd(!iZ;;LEX+EgK0OW-(=A6BDl^0ho`dJGn?lr*KX`E&OwR!4D%TZ$jMF{jCt z2o&}!-B$rir--b1umwAZRVQq;(Eva6uig>~k|4UG`yb*`L@#Nv7;6JmPzLZ~ADjEs}wWxg`J7BBAR6p>bIl{W>(2E9W{+i z^0O`jfv#myNed+NRiWCmmP8AexVozv`m`dUdB7U1t6QW1G(g99x0})$WPzkl7#L(* zwr{2wIMZ=ov9_VPThb-}A~s@FDp6)Iax;eJRHJ%^>bkD%>Rf&)nGETLDl)it19T>o zrBF(dy2-dmXB%;$Gp35K%vEZnXN`UbBk}Zoa4pFH&24pctyqxMLWMddZswrWSWn8vzqk0%F z^0R|9yt?HSrkdZ zCU@~B^*F%MI*WD*s>RA_e5o}8tV(iQz+u;HP)QmnHNi@_1AYlV@}nG`+{uGc!Hj5N z7@V(l6+isC8@);YSc$;O0(&6BBAa{yl4gpznVUDUkpnB_oXO-Lz(HXwNu8;CAT}Tc zt@{fds}3Oh!y?NM=2;BCu%3{riu#1a2f&JLr)`xQyqhUsJ`=BS#*a5kq_bILT1+U- z+r`gFpavn04kgB8+?K!dCUe+8KZv!SB9MUGt%FR+(0WvVamclYtx5#Z{|m@%(zIL?$xkeN`{~VrD?gY#DjBrK zoU9xYp&XzboAtUksg}VSthoK^r4h!;kL$`K>`gfIkqK*@SZuFvS{pd9%R&UhzVXX5 zY>B<&r&XZ;3KRmnYxty0t`fKivD5)6;Rf^Yn1aT5-*k_CjD%xEx|)} zz*fBf(Rrz}=zP}$iZQ%6y%z(teeKt;jlFAlh;5pHlm5iim6crTR+DY|U0>$Dx9^12hnzbFT zFO5Liyc`rvr6We7zYW}Wbssw2!iLk+h+|lQh++68)R+4-(HCt00;le`(-2F#+8x3r z^2$_!nq{C0upp@4i6P`r4&<;5$FK~=@XWBV3PI_fWQ}du=DXXR7bY?=YhAaoqTgP~ z)?xV2*-F<{AmD1WcLm;+3J!QPaT1NKsTSd zLVlT(8`Dn_V)RNKv{{Eso&!qYJg2wdncf zx9L2f1j?(Djz}{@69r-EGV7{UoV-Ku@DjJQ6}nMgqo9kO;TA6us?PEX7Z(7;*`hh) zwMc>c9ouV-(t-@^Qo-UkF1#~(^G`Sty?5y;P4ifRqfUCFk_i<;4%5#LV!}E9hyYH? z5y?$Upc^Ts?c0vr$T1>;s2bpI!XQb`-bnQ$gv<27LR&vNrK1-y9h~%RMJqlX&lvLt z;fvns6mBt6E9yfFJ_pnCrT?|=vlKzE`ayrj^;5GsKYPLM^J9dMbSd=xw2xAO>;>7R z@~EXb;pfgyHd2q|A_So|WQT~D?H-Ici9@+o{(QuF7NI)sR?4usoYeTi_J)&ee^}&A z5t|ZY8ahD!<=^j63jWxHJx)&|4TtlGp5oKx7)j43d92xv@4R^N&hV`NfgCfn08v5U zK!ODg9;|QygAE%zcmxp=QOFRAM5BUHibR@J=~AXfoj!HSaOh8~G$~ZNHMTm;nzt$yzJ2|U8B<2^;ER5-0?lE==nTe< z89%j=^6w-+jJwlyY^=j6sO(%-7{s`0 z-n%n)_MMTllpi@}NSJ|R^y${koi8F3MM(__6>8UDc)RU(?%8ku=g@Ig$M?i-XP~`M z*X>lGclG|*IK;0Qz+=RS=}kZIVE%%~6z1p$#RM`*0Rs<2Fu?;+q6w{mTypTBl+IE} zDu^VC@3)MI*r=l*K4J?ggBm<*rk7$eX{HDb>ZwJZFu=emrpOX2CK}0-Yc9Ih!waa0 z;-iQ!AUTRiueXj`3alH;TCvHr(!*}MyY6BusOC!g0HRATdE2i)F{|k7u;LV} z;jtYflPoukHiHw3!aM`5D$z(I#5CvjRPD7ZV#|TH$bP7-H$xBAkj&nM!@{$~j+?=U z()es`5!Mn3BMKjCXuvw`$OFkSQAMSJ&G00uOd{>JW6VMSxrzcQ%Pq44Vxzw9tIxjs zc+*cz|Na9Is{ti|KtW>_WYEc$oP1Cwl@6+~p{phWk_Zlgyy`;`Lllu&6J0`)K?s|4 z(E=FHMK@g-mkhVvaBs{J%C%x0DytvmJJhcZ&1{b=G?N-AEC^_1wqS$Qit@@HXT_4L zyr%7FRxZ07(pKHV><S&JqCLHN)lp}lp=ztM3-2?nK@(!U@<5`Y zRf7|Pl3t-^_0nR#aINn?x8G*lSHR{Zk_Q_us6Yb$1qV1b!DJ(RsbHAeT~?rI9lG!; zY#|mxTYuTYpj(zmBYW@0c?w*AtQY#Q^ zP^us%$Hv|8vK4k%;`cBFQs;_?*BN8M&`5(7R?^s*KSe!0Gvu2mE3{=4rT=ndO{Mr`n0Jfr$W~dqGo)48h_{;yVladH0SpI$ zb;Tluqyi&EkO@zyfWPsuhbeTB3tt!$-7SPiLP=aig0RhPHf&oqh#cN3_sp4u3y2ZQ zN#}^TP8&=UMet(cQ>OGgGO|vJ!Sq%C8R|19D#Wf|UD4tWy*SW;Jdk(2lUO}jH^nI` z>XCf`5<~OI#x^qVjb%`j9P5G|s|ewa8M|m1IP<(Z0mXZHq8}zvGrrgq$7XFxU%nbS z)0q0DrjWE=6($KO`K45)D-A=_O3+ER>4~z zFmt6~F9Oq0Nu-3J*aB?o}n>h7ger8a3hc@0d1hJyAm;}@=Rm@^kZ4UI zn;@Iws4kT^)!9sWQ>frr&rvpj)X|dmQ`JQ0konV}QICq$8X^XPifL+umSnhurH-+U zedK5zDq4oRc3NT;Co;{7pl6NfC2R$-0|MtvxSmk1a}|j-4|>V~uw_)^gCHuMG-71*%z_#LLB;otJyGR6+VSw6ti<2tFf= zQ6U}1ZXr|MN6V1g-70Ulg8>?yRz{ld`E)hMJ?^DULxz@4riRotqoJhR$Ph>JeQ7G1 zcAc!!`w^`HjJXX>$qO<6KYndMD;i5d(j%3Ql99H3Vd&1rpgtS-lW`#=kbd{8fc_F# zB>_hC3Qw|MzseaY78a~s9Xt>e4SGR8bn8KI0%;6)+6G~HRflDqm*L&no{-(Km;giB zf5yd01alIHFZ<$n&a0{o%LYf;zY>%rlN61)3$VFCOvRR>9BzMfbKVVst z`2=OwEMk1iwK7eyj7Dus*Nhk0X(i=H2<{Rx3QsTs(LRa3nXdW1=f&=;l)Hw1En(*Onl9t;T|(G~JnSgeZm6k)9Idx_Hb*2b{m-LP$T7N zt0)X6b*XjDtJJ3dTGe|NQdNG8q$b^ni=mbgt!r&-yXJc2yb-yncgAbq^ajN%r(;#p zXWQH=`xUQ9HnTLuJ^j zL1do0HFsYH-ZdzgAQA#Ayx1A%rY7wpa}GOV_S={QvbcaLR{_ff*uaW*))$lVa8KtD zBon82fh=yIwn8)GI4Kp!HNOKV`tGVj@;NVmsa2Ez3g!J&`M)rmHw|m}NeSj$jOrqD zk6UTM9)=HybAIpjjS;Ip=NGY~l9i#~Rux8v1uTrr+oezPl|?aH)Wbjsl#a!#vH?ya?iwA($YbpdirGw?pYAVB06y zNxh>8nAS6_hFiSufDyQW3K!cbs(L}A=)BykzYf$5-+8b2;FlEJs5%0Q;v2H#GdiSO zHboGrMsYsIAOR96f#`z*sjI$0x;EK}2(9V0MuM1bGovrduJ0MYm5PnCJHPZps_`lk z_5-L_G7B6q1yc|NhEN@y>n9z=ir+({#gUycA}@b?kifIN9y+)P8@QTSiWQ{5$D_S1 zQW6LMd_aL4yn>j(L)^HK+r1jJ!QPOs6RWI$Q4$j*7P2@PwV=QlTocqe5>l)I&a*%} zLae!pteV_ zHrS}LtlKt5V!JZbI-E+vF!RDMEVFgPnRZJmEL^{J@(P2P0YPX(Q3wj>TAUqxm`W76 z%EC1(v!NjPJHqorXaYnBFsngyG^D6225T@xq`jJ$rHXsN0)#{h$UI5xw5ou|`unvh zy1POmj> zT!Ngr0-`IrW!o)P=*27eI+qGYPa4KzJVvBR#wdI;D66_DivnzOu2gy`alA5bgQTyc zB(WQ_pDHu!7!)z8@b!%Flqf3cE!K`MI$r#{R_ zf!IfWTqcDi8$-M%#Nj6L!XXgJkgCG{kdq4rRiAdxQ9dJnQh{*bL$yI}>2?B!m z_&oSBln-i;jpRtO7@-CNNl}!NZ`uwRJDppzK!y>D9f-MjT1h;cq8)2Vm>hz<*n!^! zPPo*Pnt4GSu*sX`i=4bIBEzlbJeiJ>4dM(&30Oj6G|Hn)N@Wxz)i^FmXi8}RWUi>J z!fBK#GYm^dax60WKJ21S@%zF@xE~ULnr~#KaQqD2Fwcnj7#1{&H&9DARD#$H3cQLf z*i0RItQf4|inBzD_;ZMQ+&{hazyB+^$~!c_>>GtlFy7gwX^F_jX|S&d#e!@W#|${Y z6bPJHC(5kMwzy2Z%gp-F7mDzbEwRLm+(Z)WLQC98ia# z%^^jY9#I=qGr5=KJK5m@;Iz`;#J#*gq>VDp1jb;j&SEsi zV?4$=$j+%tjpNz`ZRl%^!7(yl}j(02oDr$01XSP1#z+CAt;8hQ zXqu-Z_xMy1A(#gLouL}SOa3#}Q~eeU zjVr)xRnJPCA+Z)~!3b-)KODN7ErI}AMVP_TqH!`&LFCn5y)ZQDD&0Iih>8zmJ=Ryu z(Wl)}f$`B=8VIVAEh{Tmypq;w)e!^jR*RWP`_S6XRMI6?iV48m^!SNd!A;|-D7kS( zt)+;x<$-fWS1VQ5_XresW!%Q?Qace1jFZXbi}E4V2B=P>`B#ATTqsmV?mSrJ zG7a*1qG?H=-`FF5>KLv8RI$X*+hB|ar~xs1&oT=yc2mFmd{mJg*{cvMkf;Gl{m-?0 zgM&ColZZ3L+*AlU(0(C722$SYP|XKroSW^x$@>;Te8hzR5X`Cy+W4>t)B=`k(LtoG zoj@bomYp+Gq>`j1iKso6U9}0Sy|5U)+S1dftesI5vll1=zD*>}yzwMhE2#Ezn6OGx z;hnY3`Zy=D7?;G4Ii%Yv1y#Jo;0e&%pP;Q@OSQli+`)az!rj)xMO=iM6~}el?=Y#z zmE6hAMI^J=D>&1kp-z5vLeJG_D$^9SW_6&pZ5YK639)@ATdLU_iqH~mL`Fn7 z6jcaFLmc3#h#YIlDlp#lcfgG&8V*CG}e*oQkB3U^+=!^f#r@?jy_v|Rf_V+o+#*7rncfC$$mV;=P zX3;&^P4G@gn6i6~q>*YL)zTQ*54|UWWrrdb;W7Q4wz1HsEytTK* zD*P3LjQ|2Ar5#odi=lR9s<_r#PHHOu*{G!0WmTL>#f|EBy^VOC*XCq}qf_toRs^m- zJ0|p3v5wR2goH~t>-#n?Mo0uQpj<3qt>&4ixZcIx0&qF$jc{fq8!qS3;A?ISLxJen zwQD;p7TKVYX9mWbH~8Y>y=M|IFfs;3Ge)RW47KI9GF$l#j_@}`=IjTQiH3W)(8lA@ z#t8hS=nj!pfnuWNUL8ns$*)q-6(&Z#)NlRZoOqXGP|3YxB0Xuc8U4g||DSXOJ$=&Cga8%ETh+TD77bgv0 zY)cgc4@VGMqFzy^ySn2yOHNW*Io294IW+i>pb@Jncgz9c`eJ9*?={72vNMWc_T7X< zbA7RBNAZ#y4AyF+{RQ@eMq{uba&6!C3tNn-(R;_JB5~ifeUTlIS=JL&ubHk1<90V3 z%t84WEi(YuaFx-)y?4A(W2L|K+ABqNGRd0rOgZcgVIE?=Q1~)scw?T|?`nVpD1eDK zg0aK+j<1Gl$cAm0{cWKAZHWD9==hM|1k`8*nVHwB#-pCZ^hu|5;-707{^m_b@Nu5q z__19F|MQ*C&nxr!jsf0(|9@J=F8Vf%^;z#x$VT_5_^h#~!_%d)xFxaw{*PdX-#|MM zuJ3xYN|A$Myn?QwifNr@m;9k%Qh>N1utp6Y26_AtGGrkYDq|j&i5L-0nu-=JqA4?` zN|l8|e(%*d&8C(oWa8v+dqbRp5AMm_#W zs?^}k8Uiawh#Hk8RjE>AVl5dpYsm{UMIsa;R^id2W6zc?+VCOUF&E!f)cDY&L8k&G zP|cgyY6XE_2?7ob*yh2)h7BrBtavfwA8Lg{7TRP9<;s>XFS(-milWY*JD1sfWeJWM z4Hz6a&;W;$Igd8&|LRq(+O}=r#^KHlZdXWT{}mPK&5~OfA(zn@ZW#rz}a91jwMkDJ&G@XKK=Uj2_?rtqCtfjHgX6d z-gpBND1=Z0f@D)o1o?Hr8-kb;p@b7kD2N~=KyX!8gB@0wQer(uMOsD$RYhB4Ok~|f z8FeH?NF$MCQc4L7P-BfM;iv#h6u@)=1`6^JM1g3fMMZbrop_>%L%3L&T@Cs*lZRvt zVPsnpMF*EftW=cIMlHH{Q;a9&xKc}8!St1aBKg#&ncf|5zwPK_v;1mR+{BBvXFjrI(}`Ue%yrm)6uFLUVGuSdo!|3KV9eDks`! zpM|!W6hG+KzySp?K!OrcG_pxA&d|0EZuRhbkFU7Z=36J5JW?DK#~x?da?M?bowLqv z7wwT%1XW&nVp(h6c{${?o)7LNVxPF<#+L{oO(@Z7fBz*kq`N~VxTZ}E3WS3opHP@@ zgciObL05lCxv64fl@+Q`M<(g4bqhzg5tAV~t|$b`&kjipyzuxsiw;y*MVBW$NfJpCzfOAWm)qJp*8!&RLk9fyIcYo_y`h z=Twve|Jw7Q?v7aE$B8Pss9a+#ImAJbMmnip8k&6RU|<>6Sb-c@ZLq;okgDu*o0V}Y zs;ZJ^8fvhjutXw|?BYu`+2}fsuZRD-n>E$+vJ0`sI-!K*lP9%=6jeMMQM8+H?s3RM zWgEJ-Mp7X~4&0i?+I!)W+xmQoMA3u~H8jAV&^fg0Zc^{Y`J%k@KKY=&`hH>|4u7G& zd!djajCI19W67{}4!d|KR1+&eW5qYBgz-xk2r4AO3wd6C`ObUS^+E^1Sh81#IY!i4 zS329W%Ur@N7nn6`b@Ro4Hmzqg`B~6(5*V8(#zRXn%nr;Zn4~FfXDf;LQbPh9L?IEj8eHKJcer|tgEx$GT(RZ=1sPy*az4NT4sa)h=3s|&STNs_ za9BFgS*t`;5JC=YFarr3aaM$2o$FkOAJXin0TK|J4H7b^HvTR#zWbfeoMJBs4KH8( z0?Y2m(m^tQP-QDy7|gCCz3Xu8BQ~&0|7Ntk0pN%wJpvzC2xcTQdM=V6Qy*Qv=030N zK!GWvU*@!Qzn8^~S`QORjPQc9m0WOVK`V(*Fr^?tYU&^jj3Hnk7(oeAu!4Ju|4E<- zbC3^>?@(5vA9W<6O0E&bgii|FNmj^0l#K0#05e+#uQ{+9!U>)mtdbew7PsZ_@CtSF zA!sy11FVqTZ4b zXFX3NErM9me2Eh6ScEsTa_b@Ef7mb zni>f7RR@T`Y@_f9NZ9J2)~HQww(J|=5UW@bmFPrKfPxZm@dwKZqqJhY+_yE?xz%c8 zx7b77>XIuFVUQh^x9cxH0uLvF^~;aIyU7P3lDre*sUWJP-T{MfA{V)3D_U_sjL6r` zk*TfALYPlkL3inh$8X`5X$o+19bNr=2z9JjTJLMO3!}|qKWYV6| zk6u`6Q!Pa2dr10-(xe)raBNmj@HNLONi!5x_%%vVa25IqUD#Y0r4UxgosCVz6gG`T z%y~|VSO)UjbJ0L0gJR8)mgrG8LZTG1K9}+TvB7(rp%JwOFA<-dPk<35tYb zyc@)6-sWXgy`9kzH9!$f*=#|2%97>9{O+Zo$fEXR>V&m~#MP|Te;*_{S9TNy@^2l5FDeisQY8?2S!F7D#r z0bcppkXgK7oG1k#;o{nnVnSdZ#F^G+Xop7mlMq>45$&4{919Z`2N8PVbtQ*oG=#K7 zp%jV{9D>RfmPhHZksFx?7iydr%EuzClzyNDf0V?6$f6md+y$&08&1f}y+I3dOo`0l zd%;(PX`?i858~lPBuXMBR^rUzp#^ec z`aP4_lo*fE1O&ca)1jg&s$x(e1)Y#!25R6vcHjb<*a`CF31*fE8VyY;P-1izJw--5 z#a{_2hD^yzGAiRTGGjAt2Q-Qbw@5$_PFV>6AvPArA!y^qnadqj20m#=sEFefR$)0_ z;dhLb#m&ICB#}GT2RwqIc5N3i%?nOC-#{Q5KenNTKtbgF+|{IrmK@bc4jxmi9bzcN zP$XtUa*|VhQjHj$DAl52B@adlp4dqp3V9@y7=}@-TDI9AjTxXxCLZ5y$ha|5DPmsv zq#{fnCLTKGQq*K>(xP7WiB2{j|1824f-&9-atcri3$2`$29Jn5(FVvBEnaKC4O|{SelU-K_|Qg-y02I#>pjp=oxnPnHa8#GwEg_>f;*v zWrgt68zdzB5M^R*6N;o_CW2GcjU5aH40^HRV>ZQIObk?g5`UqS0%nEDXx4rX$a411 zMy6j?l*}Z8B-1$r*U03E=%Hf18fr$+RI#Sgv7}L=66e7rfO?K&CT4=Z#9zhdiSZ_h z`KFD^CzNo=P*Ny!63s6LUWi=ZvCB%Exsrff7uq|K*s`bi&(_P+_Wp4tkJO9Ce|Xj_IDwj&{*w1*{1Mz^7jN z2nHY;%hl)034#*zn0~fke?}TxFrt8-=D&;^V;bd>ASn7-7=!MYAm)e*O^}4TQ|=fF z`Egr=kP`%y%wc3?BaUc@l_*ax=BAj^k)k55O%i~92^q;KO&Xv}+~keQqHkK3Z}zCT zMJkX2q=kakz{ro)yx4rXnUao&+Z`u5x(k#>9MM!MKH;E7H5uq}sdNz^eMG_|Xo3+U zVG@>Wy4D9bN{&*XsoSV&M_uU@(rcTB40LUwNws5ocHHcIT%PV}p9Yo%5NyE`EE=NR zAthRU?#q4JVzI*N|FSl#CeD}%ZPFuFN}xn6>0}!*j@_p{6{b?AIgzY`La4YUWRbFs zsA8zM>BXs{D#s8WaUNqYUL>fxB=$Mo2%(ZkJgdk0p{K#3ulDBBND4Ili;w>3ryi>d zl3#N!E3;;mrdcRFA?4cClaO}G=*%k^WhwBvmc_}b>6z=fn(YymD}5M;jZ)w7~zK(Y)LE9?Db2fx%yxB7< z%)&fNa%G_#Re-k~$G*DbBESwF{cBeQE}!Nd;TEofC~V^Xr6BZ+YFbKWQi-;asJE4> zW&Op*O5lNX8pw*SME+8x6l;+pr;^gxt3l#Nc1Y~f?hF?vOJ*>O3fT3U&rvc7^p3|M z)x-rHsFMaSK@2bP7H`x1l>#!2@-8otHm~-6SkWYf{G{ck?J#ND-@8<7vO;chdhx(C z-Bdyg|96ycoa*aqwC~v};S%Bpy3nthF$WpnUbI+YsL*k2T1Oe1aXOkO@e!~W(q(qd zBhM`G;6fiEA=<)9Fr!__(RQj~oi2fF8|B{E(FRH*Wx zqi(TjmdvLOYci#U?9wpv-mvptUxRJUt#XtPQ*r?+h>5yH*a5Gd^wN%QU=qi~@iOtA zDD77enPzJ57CUJI&Co0dqroI+G>36E=M~Wy2vFoPn}J@%tw$QKF%q`1xR^^AfFTal z-f=nDcDR}71cmtS?{l!ib3g|sYL0in=^KshBJAxWtS2Fhp#a$c12=FY%ZtJasss~i z|G(rIrzUNr7R`WW;G}HDxG4|rrcdX3uCKXOu!0(f`3v%#u8W}$Dl?>F_GE|jfT6%L zaaJ2Gdkmx@>C8-Vo!Hcf?Tkk}t;Jd@n&6!=?_CG)g)%#CenN3kPAe;3Gu>&5%6>0M zV3YF(88*jq;|-^9($GB5ZU2Iv8%0G8_(1xG3nWNFIm0ix7)P0=nH7&CUY8sooD4+Hr*?vz;#U6$UMv0~bEgNCzEL0>xo3K+H_%;_Uo zLb;-Cx|XXY*imsPLFB+?xa<=oSOO=ILWHOGgipw7Tlj@zc!p~@hDXSRd-#TqdR(|6D4ft_%av7Mn4kt$jllAId<>nWf^(Y26v2Y)p^hElcQUD|6HOd45mMK z$6lzI95XVD&8+K%q_3O6f_bNd^q3RY1)I5)=j_yKF%geodmBcAz7lKhq1Fba-4Up9 z*Fc~@`m|GfwOjkOV|%u1`?g;=sJ0@jHaQ5N60R|#lhXO6_%c-V#gG2BK%VlmT3}2Q zXV#he4NbZB(JIJ@x=#c3mw)2_(0afJ<*nm-t{*XxBOT_ln32ZZ{|DJBbkE(uzqtTG zW~=%gkRHaQds<;3m=AFK$Af&xi~Puw{Kz-K4GXE!=%<0g9k~MqbDnz%#t4rQY1DQQ zs1yYdtT*k_dw4&uy$3h0={sq%teD`J*JKiH?sRG()ty+5tgt{bihQcHX%8c zdlREV-D6ffFOHkD180hAiZGkx((t6Tm;BnZecQYJ+lM?MEGt8V6VXubS3`^UF6DxN z{n91|!>2A$=sc;*bVd%h;om#gZN0M&`?eW9ujZH1Oa7*^giU=pP8xNvM!iJqI@0?3 zNduMQ3%zjHJttaxvWxxLr)Z${m6*S*F2a56%l_=se(i5K{~{y;8BhTkEP^HExt;?$ zjaz$%19~Rh`6SE~6gRb!cX3vGNYB^1&j_VnvG=F=o`bkz+@XA3=tcIO+!vlQvMI8vv(5?eAcM-_8o5kl!E2sF?r{R@hyoodWc(d>-ds=T+N?)3zoN3zPxBhZ&Ru!!)z@Ev z6)6fl_0+M(BGVHH+Mr6HtpUbZO4-)4*K(Y2KZA z?%8M5fKG`qi&Z`HNT5F09;kMXgk?nTlKRcFM zf@$AHd8cN921;#|RR))3v|uimQVZ*P5d#b$t@$s#&b`Y&p9wD2%cy)}J{s!2~THMZatRlPZKfuL`~9#0%Q4^CxN%T0Fknk zPP89#EZ8M4t#UH0^x!?s7)w@A4-Hhw=4ZYFM+NBeduLf9`A*d{9^A&54Rz>4cS9>f}KaAR1MvPE|Nd2xKE`dPN{+R5>B_ zDo3$tERcFfDkCJR{~LF=76P6or70QbTw2OWp7rpT{%I;Ed-$%K(o}*wU*$DNYaOPE$^TStDQ&p@B@@Q5z_}>Xps7qcdz>WxIY%;AWgeXjwxy^O1 zL!w~W(qWdX{MzhB0~?j=hSWQw_3n4A*PsWXR;`xAQd{3Dmm`_;wXnUd@;HW0;#~<# z;4F$V^+go7{8zYC_H zhHy+~bxVEX|2W*Ufa;ayH6im~f$^oZ-t* zd4ps$P=Ykm8Or4)#C01n6KA|Y)I7;#v!&~ODs*EZiSNapigN%jw;u7;HOxYLYM)^p zYxUVsnSrL5lBF`*sdyF9*;TX{t4u~=@AEQ|W(jCay1i7J#dtcy9S>*lq(x>`(=i3L zghZ|E|1OJ|xCmpKW)V01Ir9*Faya? z{~q$KUV3^TnZ-UaylLM@s`7UwIy`c5iXP zN(DDB$<80F)TgdA(06?Lgc;YiQDT4lPu2BZnL_yWxBva|pMU-Dpa1>$zwn9ASBy`B zWG?w!PP>>7gPiR7ysNA@isyQ+J|v(4(t|(bLi?O8dB~%1FkrAWFI#AAl7NfO$}ih2 zPW?WQzGN%|HLZ|VaOikQn0|%+{;vjY@CI=(2X$}<_b&i@Wmt?)JY2dMl&8T5)pCBN{uesCX`A9>9j~Ie5M$WqnUoh^Vp7;80P^aWg@D@ZDnQ%F1|LzuFuCxqs z8(TtUqD|}OV*5~H7{A64k766OaA!VnStgMg>&!}~0~+(?WC{t%R8F_T>PC{zI7E?Q zzL6X?awAWX>^|WmO)>T$hIDET?}RV`Q4%uz@cDAl9cu#oTmpBD?g9-dCHyfKUGieG zskaCcm6R@be(_$O$&@I{WQ-$OfS`gVaw5CP9OEP-=kVh|VJfK-6hc81OkomwP!zDT z?LcAnW{)eyaxA%W5=6l@(6TD0G89Zf6nd~N)e;m+p%h$WEK9)@N?|O~(lrjDFYjOu zq96*SU@)H`3g%!A?m!R}Q!zjC6TnjTVrbpc5f)Pt@WenKA&nkE{|Y8sA_tz$;N)c( z^=?(_4U9??taj2Ec}6=RshOxqK8))psI~#!z0@D!WpgiTk z2?8@c1yc%^UPSqu7C=z01N8#KCfUtYXUy`vp?Z;Iiw&5oPY!xpaWdM4V0id zzjHwuv_ZQw5yVpo>;MjAKn9#ZI-lSN{BuM5bCiDI4Hh#*9rH2Ij*kGz$kMT|q@Xf4 ziwxwk-oA=6S;8~rg&%EFH1`gS;7zF9@sU(>XEX~%TGOIR|3$B6vo@6sAaf+7wBx$6 z1C^fCM4a+!LhcQ$)JokTOSQBOxU>!AsR^0@DUmWJeQ^Rw00*Ws46HLd3!zQ5^Ew^$ zJ0Ua*mOu$`;7)TO2eza`g@8j@t~5`RCOC9Z2XiK*;0JPG1}5+T7ytzlG!f!7QX4c8 z!XOIllt3#0^76D#3AIxPlY&B2L`k$n_vl0?Dn;4NJrnRU3y4@>E0l|FdHJH1Gh`RRz^kH`Gw`bOsur z0T|#+onQ_iwOj@E5zy6AaR5_izy|cxUKw^Uqaailb5u!nkC16LQ8m!ovrw5&4E#_t zV-8l4(IxV9WJi`*PV!c(AXjs7S9!HpcgC{@tACc}rie93E$mofHb}inDJnAME^>xU zp<0EuT3Hq;u+>a)KsBl}T$%P;-4sqGbxxIYUE7sY;Zr;YbqE7>KO2@m@ikEiv|p9r z2?!xz2R3S>pb31SIU68T71nCImQW#_F~)9Jy#TG6Yx`cG0-OHPh}Cj zR`y~7_eXc;X2C{mAkrvu({GPeXLlAUdKT}d|8#4jb!a)a2|SA>dM+eg=g zs0s46d5vQUBzL>sGh_vAa0xeM5Ably|7A1*SV+S)&BhNW=HxYK1cjHuQ zaX?=iKzMUNfD8CNj~989H|^2~Ww8m*0i$lS_o%`X;>$l!#HplMVhq93N3nhI2~gG6+9SyJXjEdm~%HPD@uxf zb5~6v6o1Ec5zba>)wN{(6Ki1?j| zVHSQt7>Yp|mVq41!5q}#nAIU4lsO;%p_!fenV~tFrFojExtgu{nz1>XwON{%IUm}g z9gtZa$blS|K^fG6nOsf3u27Jb|8!Awb4lSb*O)92m9>y>^G2e8EpvIF%Ptf)x00!K zh+`B{BQH})w>m-jmAexX7@9j1!FQLSU0K48PZ?$B^`b$lqN@T6uz(5dM6_pf~cx>}<_ z8OGU|k(nLXp_`ZanbTpe>7lOap_{AOAN(O7?AorI`mX`on&&zl`ueW(!5{izn!DMq zk9n{I`L5{5R|IZY{;juM)vpKu7sksb>j;8d*@2dKpLwKugu?%Kmn2Gru zkolYO+OwB>AE45*fA62q8V1@R9b~(=efzh8JFx8`s3|+-Z2SI9K^%g6xtTk-&!H=v zi70=-e8D$-lMxGLwj>?Nx@e-in7O$%+a7BBxOtC~b6Z;5;Jd+lz1h3H13R*hx41=) zyz4Ky-TS`rdz%f8h*Yk$b@RF%Qh%^;d{t5^SRucgdc5g7_dda_bGr=?Ji;X$!G~M2 z<=eOy9Qf>e!Z|#@L7RshF(Sd*x@A^a1-#Y>Tmj3V!;xCSGu-wX{JeEry;;1*ZCtbA zdu}fr!(Y7jOraib|2)Wpn;hE4I)Z5B5IKkb*acn049`$Dt1-owgT{rNnp2_2eJ{q( zd$+5+%e@?%D?Gk;{Nu3P$ASFI(HyYzfm!(5C8UXh?D>ypHX7lg)E07BQC!MrA`Q}f zn#IAz%RKHJJh!8v&kg;{Ng;zLd&dKP_kR4)A^oVS;D#TADI9msqvJ)e?(_0u1*2Tg zsesB4y&eF)(cKQW&l(dVebs9`gEe@}ZNt>>@XT4g)~A^j+?=~N>rj}y$sev6J6#$- zUDt17#cSOkN?q1b9iS<})}0-{=fTxsoy=u@`0U}?vAvnq;VM$H3Y-Z>)C^aGy}lfA zJF4K>lik#p|GknAA=}-ZxpN$17oE|o-S$l3+TY#T#UP|O7Ru<{*TX&Q24f*-b2~&m z($l@s-$2G;zzy>K;bl9_b$r@mz20l@-XXr$XF(nbg$&uHGzfm!yCf-$-PupU;%m>m zw>;xn{;}gdROg-EQC{vazU3iZ9XKA`JzjGv*Ro#gHJ$4vL}a9KMven1mqHBOoz&&t?am&c+dv!YzVW5G>0uu3 z6F$)C|K9Ptd=~gUwIw6I;)CnaroMzC#G^?}lO^cg9oY}x?FRj<3*GWv-|a(G@+ZH{ zE8q2leA{dB-RQjYOAT$P!^i`l^h=-Q^L_TQeBFas)os7=A^+_qKlSU5>X$#rlRQaV z&X7b0PIPD4A$+M>*Q$T|X9ZIyQ(W6L9DqYI7X-QK!qe`7h z|FvpGbv&|a{lT>>S0MrmcI9EChS{?x%>p>5j<7viGbu_LQjAb1B3LC6=O7^{G( zc5_O&u;Gz!SSnU&C$QtkkRv}9<+C!<%a}7CJo)F%({$~2%^S9_?}PbB3wJ2al;`8fM+#cZ+|BUk(4*(9?DLc6>)4Yf-_Bhl zXzAd?%U4c-$v#FsE1>{UxX% zbd*uYQ+5zW7?gk%a`xSV7-sknIcs$&UwQMHWrIOOcqQ9;xYY$)Ui-CJP;eRo|K<;X z71r1kfd;bF20bzM=%Y8GC^B4j03Sk|EB ziumm(#-d&Bd6SrTMhZ%SXQtGKHjZYhA)GtW>FH*Xh8jwqnwC0K6@R7*Wfg+L_CpS? z-q(bSi!$0GjHbebk*JcMRB1}lz$+y>nud(s46XAQVbd^UR@Sc zYpq^BYtdlK+6juUzruitx9CRJppeP73sksvHk+=uPfF{jZ`FDwMYev4|3SvT0E@97 zuJb-r9K2(WTP{kJ6zuR+LBi>7y9kdd@58xLVeg;(@(VB-WrQqp86RK47b_S)^k2nD zCbqCkDaS0+x(*&Yv8OB_d5X;5awz4`^>+N*6+{C(^3g~GO!O6H5FGQ2Ior70!p`w* z^+XY~do!|8*SPc5!a4~w&=R<~bjeF!@iEeDw=FWtU_;t9cV_;IAlP^}M6-iib3M0! zU*}z_4Pygc#o<+8q4?rhu#NWGZbyD}-g5tqT-}wn;k4i~XI*pOpIRPZ;G8>JM&Um* z-nirNrZB!`W z+0<7CxCstw7d(su&twS=&dYw5sbG;(c$jXu5KQ^NKma56L89#^Z6G5b`>s|w8Y;zQ z<$~D_oi)Mx$#8~7B#aH0xFo`LkZmCB5)hmBJlz#Bipp6S3>rhlVZDh{KY1dN!041I zma#`@*x}KZCbSVYZ-`f;9UGN$yBt;Rjiy3lr_`vwJubzK|A5R;@x)gU9}3MNOH*GL zbr(HDlBACYx?3VMRV*~(kB~;PWJwUY$pu*vb&uprB-^G4R)Wucq7(@xnX{u(Itqq9 z0c9a$84^>3!h$=MLonSokbRo1W?6+RFer& zq9F~Qcx~oJ^Hxc;PA!RS#Sl@4WLC|f)jMkqEOc5bB@)2ZEKx-#F(Fygk>$0SA(JQl zV2RdQE{2SX6%Sd9TG&t?R;{6Zjxfh|mdO5~nC#pl3HO>eYIgRTXZmAmr8C$;mNqko z%?N6DOB%Pj)U`9EtO%FO+$(6+fAqZV!Zb)ZNjXS)iPOgW`A+42V1WCoE!I*qA_GIBMk2d-X(MI+xdI{3k8HAQ|$?3f&m?ZO2- zh=w=(U)q+guOR;EVnWJd$1r%lC)RF?{n6vce76EH7H~mkOylu(xQv|b>Q^6FPi4Yu!SJj54B(}$t_+&>@O|5h;6RtI*x(L#xXE$snZen_rnYZzFXrr+ zxL8WlhIO^C{Z4NW5637CF*X6I4s!VW-vAG|zz0rne;1<|=ny`mc*r>!ly z=1PTi*KJRH)1?sga|3zqL#evmZL;cWGmY-6GkuQz5aE;Z@!rd*XD;&8v2xgc8R4wz3@?<`id}I?vR)K>t`ai4p}zy zV2{4-Gw#eXyj`34259e5^6486fB40xNZeQE6^CP?I0 zejpfvG2tNLo_X@LAwV~g?Dyk zRC*?Na%%Vs#lUhE;SZ~4g^|~Taaa+}M~BhJfGdavCX<8&m3{TJeK62wY1eNB7mA`d za3xo66Y&m<$cV}UhmZIYR+ND6=XZFRhc6;l^tXxjXCR}eLE_enzW8h8wo%@2Zf^L7 z0oaN!fdy+JebZNj|02UU7>0=iC4sm|HBB1kYFx!hz_}Sxfc=VCXo|~ zg%wE==1>6{sgZeDkgi4rdq_on=uy-4g#JTrC)sqckdhFwk}L_5G{kN%`42KVGOAOP z)Y6furHSBFh9H%8LD_T}hcyv-l;*dT4?zX!SO!mNi8g5v?5J3`2u^>PBWM>vYL}HQ zhXo$F5U99l|6bXTVA&AlFqUQ6Y6clv)Cf+Tcz9?imrJKO6ETc2iKH5#DGlN7<4nrIbtQmt|R&ISEKec|n}`dm7Z4sKo>^yS0|_IbAatL1}oB0I(4ENqoO>j}I|g&>5XBsh$oYMEW(D)nt{6aVeZB zkA=9P{|qXgQt%5ybe9stpL8dk7Wxmc<4gj&Tbaq0M+cX{rj0lna3Z=84WOJ@V4@Mh zm?^5F!IeSN$xNBYc@ZX@@5702IXu4@rNkBh4iTO|DiNXiIV#Ge-D9MX`Fzc^d8!bj z#Koo3!-<{L}Z0c`2$`JP{5w=-UTUw+odZ9ljra{MI+R00txQn_Yk0$AmZwjZX zFhoSPr7PN1Ub>ey6{dQ6s4NDb29}G>5kZ5BoDqQl#h{XKGNG(zr+3N_w6}R=T3rNc zVDcG3vWaqq$`JYR0OU}VLt3YY)u>JR{F$q=}tvWuEjEqkPGldY3%)5ZpwxMeCn%JE~=wt~~~}f3vE`xwk3zqrX6&4*{+{fwftiVk%Xx?g?p# zJ2&!af!AY*gD9Jho1YD#uVn?er**l6t2$mAVH+z-?W!Zznm57LrnXy(4*Clv3ZV-T zvDl@usk^oRaGmW&vxL`^P%5R$OKb>RqPh#D4Kb&bTe(}7SeToKSU|Tz#k7{hiD!s6 zYihe~io4JI3qR^K_5-;62~NXRu5{G8Bj&43TP{zEHzXIjd+WSc>JYbyx+!M8qY6pd ziT%ECHxs6R(WxyeLO7{}bfE56r$R zCc#1LY!;j|c#FUZjGrn;Fp}F~{<~!*e5ZjKaj$DhiVLqTY`(dRa=dH0kLSP;wzX71 z!98ZYh9sW@>?j;8x+v$kDc2CbE5ajOO)4h5I5~OTYe=!1YqJYBJzTz0{0k|WkJHPD zjwZZF++*^4ya@KLS2M;QoO1Xov~()MYb?C4XSee!Ke|K5EcdVrA+dUlYJB{9DO@of z%fl^P$5DKJ-DJg!j4;iX$dgye@KTt8+QX1+zU=5Zlzhd!bjg@(bve98#91jCY&8hm z!OK~Ek~_+p94@AO$`Pl;Y{Z>8LbhP@%K011456=Stcv1@%k9?1|GT`xr31{vTE@iJ zw^>TdwY)63a*(?aIY`aNjLned$CmWPXyUn6Q@i4uqX$P0 z(CovyTYT$M%*M>3=!|IEEGh-tp<$dd%UjUGMh>6syt`Y-ziY+k+|PFQ&!Mt?9tt)F zebDlZ&>)Wr41OYF2_EXXV8!JYaK z-uTimom5dR)v2Y9^Te{L)<4|V zl;PE1U7B^S9!7Tm33=P+DZAo)I*lab@U=+{?GSCmB*g2hYjctlD zOv@lm+4@D(QAE*l{4jCJxKjMd3!xK$9oYU!+Epghr%lu<@x2&hwh8>n!SN2F0NIgk zNRv(5D@D~LjoT?vzq^gpp51ax?SYg$+Qv;>WW7hqjS@H;GrSGUD+detKnk%f+Ynsc zhkIBe*~$;&+&}zu>JZ$*ZP(0V-W81A3**Zv!`?~VxbGd`@*OYqJz|!fkk)wB&b`w4 z0N=t*-2tvxrfo!qy^weVx+eF`;e6pzkPoNe-wfX1|7>O3Mugcq;?52O&nJzePIGzeRo(eAB;^7bu;xG>5P!B|I5B7i$_}~vpzT`8p zkK54|M>0Y`kmCH`|IEn>_#-~#O^}S4&epf z-1^Pey4%+DQ|*&J?V&~IQ6%EI#@);A=;q72z;5VX1MYRb<&|>Q-qPK?{=@1%Jodou z71FHkZcF-JA={Vi!n*8!j@YJ>?~K~-fpzLBw0*h0=}4{9j_p4PpH%#=@QGyW7qrSb zqU!T<;IFPh;!Z;skMVD0?C--6*QfMfDZ?htIth$RrlQ)Qb{V+RFyO} zN>lTDp7DOau2d`LrX+aCviT`wZYAz+S*=;$Nq$Vc56fFz74Y97VchXoX`2`>-BjLY zdTq;lT=tUP0`2PM{)%Z5lk81=V-mP@UvH)_swbFN(gxl8^j%eku7ZwbA96+=Zd_*e zPEY7yj|+D1US}VybcFFHd7Fd0kM(!{z#ViQ9l{gxVMfdQ5I^-3Jva!=ot)E$c~6h8 zp0=JoCHy6f{rWuj@x016#~%Ic=GAr^@o-MqpY>^>lLQVg zUQO`?z+*E0UYgn#2tlI|ep8y>5sJWNvD!01lNgA`EQm>0odNBMCD2HO{lFaAmq__; zIFYY5dmxp;BDJirJbNgU!xxA`p+0vcmoIYKFt$8*tWeCx15d9it07;`$7!{{(x5*S zDIaD?p@H>fwAggMa$arnOrzO$f1*GGyM(9E;{GC#qk*>j=lj{hz4}tMNFPo=ijgLh zrgmp6#iT`s;-;bJDYLckLQCEEDJ?Jp}B%MI3t8|!VyC)@qeMNxPx4+qEd zpjqT~PjyyrSb6nq2N&Bnyy)<;6#qAG0A$2@>t(I`Wf!PE|8oq>t@NmLJtOarfx3yG zt4MYGC$lyJD5;##e5l!BGMx?_l1HFQw!9$?a zzmFMyg!(p}={vos{4F)p=-V`g?ZKSA4ELe>$OJib>}4r8v3$`u#^&1ysUrgBi43nN zb3cO!UBjJx!d2Lv$X^5mB!$2mzBwr@i3)0BStUOQ1t==1dnMKHmeEQ_929VDszQVf zY}FX=(DSMiwZ_Wo&Z{)4zvD6Em-MOX96NQrX^hlCX3qPiDhl3m%6WR}o|j9Oy_m_p zpE?{rVQj+CqRo2D*)D3??IeQ5sMChW4c9U)hfN)Ig2gXVT2dUr^`QNN%_u6-feL%*wqXQq4Lh2#yqF zQ>|9iqq-32%(9CPIH=0%oLa54u|iq0f9!Hg^AIW;FHU`d+Z~{ z!a*9$qh3}Q^GjnhoU{HKR%!Qe3s%?X8^aS}kC*;Lg2$jsX`S~d4@=v-$NnnH+cF(s ztRv4_2cK<~J^?5ri0eZU3XAtt7@E!n0m%r}zi>+z_SX|1YLILI8F?-oOEDj!@{|u< zfYLD(_2;av5hD~$IjApBh)UJ6!JK;Hd@hf}p|a0(ze_n+3?w zZT7( zD*Y?0E_zSUm~(wtSZZS0`!e77mkN#y^9)MN!=5pZbMPeji30ftxd|V1lf*lYVlLu6 zE2RfCdxP*fWl2KLfb5*4#cG-{Oe_!+cMz~35BUxcfAzz!c0D$p=q$}%2-%J zZNZO%V@vI@j;a3oLeBkT-8uF_?cw?&0SYr^uQVB~`-)--!xLEm_#fC$rBa3aVTG1q z(r|gDG7ZZRrDs-(M_Z+G11$>GK{w^vC_8Zz!&Bwa*2%_!#1hiL6O|rXmG*^%N)+Z* zt=pHy#0^C!BS;H9V_MY@T;&={q4F23*QIEp`xvi43qwTOWp4G^+H{6u703~_DfGEI zwm@?esn>~VtWWf5zbwrspBKWKl^c&7ie-)6!G*v1#^!xXrpFhhf(Pa1!MBQ+{FwP| zN|iJ-p-Q_<#LvpsRPm#lM*8c|Xo!`LzbBxM^uPW`oTKhpHp&NebT`4hqJ zlh)0Z0LjO7CBf<9fB+*2iJRna^3Cf{BGPv8%SW(0lD)$U7kWH7lE}2ise#u%wOsXY z`!8~kBf6CKPY~O|JPB&!Z9kYu7T%0T8I}ia3U5~{HI2D+A_u)fM6%v3n7+UAeen{9$z)$6-DJ)%=M+mAYr)Ybgj*r4jD3COjG#DB2>ar{RbxzIr+C7?0d7lNLWu`cJ zJQgYKSXMP>q%znlYM10#;s4uI<4|3|{i43ob3B7L`em`VaXj~(*W$NI(DblTqZaA9 zg~=%Nh<%h(LtX8$wuZ*4FuY@S)4OFJl-tx6<)h4m$C+JG8`Y??bDPYKh4Y{WX>*cu z2Y!#a`=Q2{?gi(+k?WUUb@*EkL62RhzbyS1-Di`fo7)63&x4B6H_@ygTWBtSDl?9T_)<{J~82X3~nd|Gs^r`oVL z(jYh*pLm)I9k&Jj`SiLgM%*}*`f(b^{ zIlN((o4r0Sq~cx@yWu4NmGB~e<45n|$1$(K+eOOH#_Gqc<9g7qSqtp9KbzVvBBO-Y zQBE&AgoKWRJZUGf&Uf=PmnIcD+S6K#9=Y8c&pgqDcV0hVk4_0(W*1YhN_1|w)vAp8 z|7wprCjZL3)plolBz&}Pe7l&>aNSH!z3qm*Ei94pU~arTb=>-z`U zPteD&3@^|r=-UHg7vgH&E?F019S>CdH-jH7&<*xPq;W-t(~39N|=@U&MTA@!}U z{P;xPH+#Y_m{9ReQ*e=1K*WN9H==I}Pf#4Gg0)?6B2GXGib3eCZ=8emJCsnbpP+ns zxfoY}e=SH*Nt0f{qJI#fo;{$y-AquOxty!LUp{~dey+b+Tu3K@P8mtK#Z5@RuS|w( zpt)Aa(1K3ELbwq^*aV|YFGILyM9>_API_#hMtq)J_)}c4N}COOTrBL(OQctzUh`SRk6zTDOEf@IG*DAC$YRK5 zjL9Q_iN{7XtXwp_T{L1$G;&QeYE2~cL^Q@h)On~YhF%OT79>cDC2ER!Fykb7h^0gf zJ0UUi#)zf2i)D<7Wv+>3orz_?4W~0VngYc0=*9nViRVj-7ifwX-VNGXh!;nQmt=^S zmV?C0+Qr?=d0o21E6>EM-o&esBx)=~LkT46xFqT&B^op(3Ibr`eoHh*NVH@~w3bWw z=Zm$CNp!49be@gYVTk`llI$js?4cja@DT5nln1Nlg=g&)3D6$)x5arRFuI68j_;JfxN)q?VaQ4G;sC+ojgVq}G{5 z`qrd2-=wxMq$-f4ciu$8*n{muk_}a1%+P{#a-h{sz`aDFnR)$bndAt$H}o>MT$4BS()SJ`p=%@elH#F!6RvVWrf5OBPl0Ma(5fcT%DT`ef*^k; zYDoGnh_iACnj8oyDOqSOSr|)MSS4AS5Lx)hsq=DK#Q6z=A>iejEXuhoeu^&w+%zh* z3>t&n=U;LdQgWDDa#)trj~>(ZNG#HS#-1dlU2`W*TV&LyCf^mIiQgxI6tZUlQ}7J( zWWQ!$rQ|7o$x~X&Q)NyeM#|GvOi@+L&~(hujmsk6%c5igQ7z@ZA%k-h2_J}93&9GiT%2t4V7P@cL6}}f^vedhfUqWPQsb!rkRh&H+PnqW_ z0~N&*RopvNJjPW#*B3nYy+~cWOue)q z*rlAgu9kJKmi?}l*{^1GuWW;2g1@n1jCXyB6F5p*B&4O{?4$l?nd3AUtwXtzc*i1E>0=4vh zwH#!vX+o{s^95_hI`e@)v$-7@^q}FPO)>_9()wL&_~ zI>HSNq1D>}wLPhgQ}P*iAz6fZ4F)MKf-WHO)!MhI1z{Ym^L6d4^@TJo2nx0pToVAi zizfci6miZPREO3$IDIcsw&PrLvO;ZYU;7nvUARka7J6|`2(*$v4h-djSQ=k<&s<-j z(1nuLg|?d6u+)W>R`SEt*rw1%;FjC{CG$AGH9oJ>fw_p3xp7>vK~b#6Keh1sOK*C9 zA?;n6*hUlG#0Noi3wtBaG#g{^r4HY44zG^=`4C*tadG= z0xq@ujx&MqF+Mn1KszBFM=hN-WCNaq-S+iWqQ+$wBLh|x{fx-n0j2eP20wel9U3Af z+K{;~A-^R$e;0S?OEvD$CvB74!A`}wdz4bZu!&>0fa zx$j@ar!@Q)q{Ek_!(XYRyrE|DzAWgqZ#!q{@KI>ya^?M3gB;SY;0+1X=i5#-pa?v=g*%%6%`fr_4V!T?Y+IdV`F1e zQ&VqmZ{XMbdqCAz4~dm^7>@b0J!a&4{>H}QFHtXXs616|w~<;*Y2W@WvECkLjm@m) zBZN&C${y(;NowZDOJ1oO=rr1|Uj}z<%Ey>Kc~r;GCDyjN*I=i;wQ{NbRh7FygaYa_ zx2QK$fVX^zR2Y#!h%9addQ_a>=a?|6gw)VDs$j|NL<`a^`E;>7FK_=$xe9ydT2~#V zMHVD8fxn5D*D<=dU|Sx`dX%jTBasCPQMMn!@~Ht zr73uq={g$zwy`j?vof=@vA4Ikb#-)gbAyKmVPS!AaY2-nAVx+I3kyg{2qY~H{^bMd z=zxrjKvq^DXJ-&=6$e)_59AA^OoY5hvV=gUh-k8;VxX$4kB4V~9|#Bp!NFY-5P;Cp zK_ny~R#uRpAV^yqWN7&B*B|8Z9OMffmC7Dhs-0A8oYd)^HkzEZ+FW$HUUYf*`T6;V z1O`Wifk#wATw-Ekd`ePMMjCje=VWE)=YhZDg3{u$va-tBn!38W#@6PxwziNEP;4wH zH5HVb3o0%K)z*SKIzXM>U7)nIf1U#Oi|O&Z8VtW4iM<(5xmzs1U#WfAXzlCk15c63 z>3_!Z^77CSXnGp7vH}8uA8l+r?({zG4L%)=J)g|IoUiWe>>M5)ot>TS?}LtxK%ld; z*PH#f`_qSqhx>aF=;7hx<^JR2sj~lfp?5pF*%K4Xq*V3>P0{dQ`WoaM1H`}~eSQy#jc-UHvd_#m{H+8-?l#BP}Vu{sw3#N@J zyYhPKdT+^)v8Zy9eW$X!WC(P?tu=LjcBDb{1>{us*s>K!1T~)3e0}$%Q(48c@cvq% zC6}*i@OEvaK7#sRbOZ<47l%*6p3}Z?!}EVcY$WQ$c0x!FqniTP}(OHc;@e5rSAWd$FRFCBI{==89#Zxx|>DBrByy5WS@j(2Nhy1afu30t+ZwSU01O&JENydMSQ zOr~lbS59?2%+aE@JxrZ}w2ON+CV&^WfkDZfB%DE)SF+WzX@gNwrCvLf(@Nef#r;Aj zaIfsL^X=jE@-G0E{;KO40s@XSsc{vx6hZ6?wi{K1{<;rC#N(?Kug6sP0D<$_^&m;` zS`92|gzn8Sby4}v2z_=$br0f?R-Yl}MT^^Uw!^pY!wglLJ^e+7=faY4fw^zOK1010ttYKYB z>3F^u59}Uj=F~$`ba6ymVwZ3AyHIJ}9WZ=JuKy|w?Fnu^RdQ+$^c`$Qnb0;q*NRMb zmv+CY#6oqmkbr9n@NzlIy+p>}xE7Tv@wi<1Nw=52G>foFDi?6NNB0k}bv9_qQ0Zjk=1E{WP!`gdrBK z)nG6ryI0T^yHw`;^?1G!j->$;LctHxLF_HmyebFeA{=&1Ou)@)~ z`+7F?9}c#Zt3a}YaurUdC@6U21bFlTir$7ms&K2b5Zqn3&&Va;ZJo+9Ki>|aF<+rk zDxc(DL728tqu!92^7i76=?0Mzbi)Z#^P`3E27E#K0+)jXfhsIEBA<4XP%K$MD}y^i z;u061)|XE~;|jx^Ar@O_@LMJ2YDoK~H0rP}6UIYqOb%!t+UPI;Jvp_=AnjA?$nQdC z&pk=-3hK0_wHT!C`(6vTcpfIfFZ?dg<96~Qp(wWb?2GIK4om_5XA#CGYtNF`L$_IF zxyD*q!JtX62g(fHn<8HLU4ftSe3_6^#Tp2BLf3S(Be?S3%-rRiB;jwrZC-!u{0e2Tu)R;d6CWVKcf*j zPDSNHaQq`EG$bb@t{9eYT|!E60+Wk3pPlt7OVP6!{gf2=X6RTufP^CLW2W;@dh;=U71v1H>(C=dM?rm;-3NyG`DVqkwHJ3m!D8_QflO znvdV~9A7wPAxExi5;}~J*HV|pYVGTe@{5gkX*eB(?d#8wv<+Uv)SX^Lz%$s=eB4!K z48)j-+B{xiQx}|cwI6o5?iF4Rguhabo|Fi^#eg0V+Ne5+b!;2Oy}1_(&J30+g1td{ z_7lugb(qT74i;h;fK)mAHw}RS|9~%maiS*5*+Lgm(8V!H3O^t@RG$d{d59L}8i7wj zZ*>J{P&BGG0T;;tnyIBvn$mzko@<}c{ke-xv5HguL)C@O2e}wMC-p7l^reBQpW&|WJH)#tW9FKf#U%{qRx;^}nND-& zQm|$^>}jhT(vQKekrpCyty)PBO0mlo7j9)K8+B1L;k4A$3?w7$UpUahR<80aEz>t1 zq+NoS*H0}e7C(8YS`nP-LK5Nd?|6t_OXs4-II6NexjtpQEDIrgEvRAubk96)IH%;_Q-V*wF5-9@p007d^@%L z^txUnO(SsR1H)0=mWgcR+1L|%ZI5sAk#4#B*m25fkK(J_h(9+VY)}q2gDAw+^7+1E^8NIywdGBOFAOVcdpmse z>)NT;V}WtZusz9}Y6ZdF0PDwv>)+heSzXxim$$n=#P7%Ut&hFHR?t-Ve(=0T*6aG? z2cSzPy^u$1j=@r}i=Fl6&>UpX{Y$xJe z*5kbq>~o~z{V+)A1?w`NOx4%qiO%MG-{dpb?Gn{QYs>3P$mWe<0>El^6&R#J9rC40 z@!1fuOR;sk6ruUr?Ed}88w1X-@4NeRus@8859g6DV2I$ah>uU4KZj}nm#R0dC;{c6 zk58@dx1#`IHverAdtX>;3KKuor+^LY!1^y<(XiBTfFM2Upji=rw`qqASa1NkD_V09 zoTx8c7yeVSo9hgWnMp7;jxW9l4y3BPYg~{cT!=-pyFLY;9SGaQhd)@QIE1O$-L)AH zd&t9c$veR%*e@hBGT1YCC^Qo%WMeTTCD(N~nJR86pdckMsTuDloTJH3aOhK5HJqn^ z3N~-Cx4wR0e{gt=1pJ|b;OK{cQOv1LP!LXU&!cC#9)(Wn<&=8VxS6B zaK1_8ag%3%Gq#axxHnwXBAe&$Cmfq4KNbGS_>ibP5ntd|kdm)=y$eOfQP@pNR80sj zTqH(V^*aYXbNzcsd)yW-f7 zVt@D&j8c~%WZXE?Ww$%FSOZ%(TO5jwr${<>HbnodP@?gO45BXHV~HrS~kgnJ<(7t@pnzkj407aah#`^qZ2NG zR}3AKJ!MTU0opZ%Avs0D6@%zFWtI;vlqNOAG}*@#lPWdQY&ex8Ii8B+XzJK>njAd1*>y&u>1P$w zjJ_`!BhR)yCF!DHymW_2I-k>L)vSA5)AW6l@IihV_RE?551F;D(bCD$NPbxdEg74~ zNy@Rwn6;Ts&soPoSLXDU}{Lh8yAJ(uxWN8@h%UJ+GJ|AsUA)3g_CgQkLL&r#x#Q>3VG^Fw0%?RI za3GYWdJa2Z`deAr3j_D z9OyQ~#APF89WR!D@yd9`vd@5JZD!?zCwiqLR$b~PKW+2Ra!cGe!1T{*R=h+E0o<7) z=Zvp-a-?FtRc~{|e14=97a@1bmF>K>@)*zV6roZqEZ0n&2=QChoqCm+bJY_90P!0- z#RxIvRuu@L8iukOk`u5D_vd~a_UWWLH@Ol^qk?e61h4zgeJ(Vfc@4IEIcZr9z()yR z&kkvra0Q`|l(V+@rIwPel1R@}0VGZc*;aBSUdx1E>rd^4#z8m%?g~FzM`2#O@PcL& z61O&8MfqC$jk8cTy>1%;T^&1qFSc3+u_2SAK@qWl=(`Vx7@@~igMxc8czv7LDjFht z!kjO(Xj_G*dx0r_lUNuPp{=jEHJ43%a~BtcYp z+G78jR&m-26=O_`UzK9pnkmuNFxuJ_-lk?$*B*|Ge%037)=JmXKBCdihh0C020hZ& zZr;*Tfa$N>O$zc z(APrI*X%JYy3?sT#`xf%a=HmEf(bpG|8lnC1LGylTZ>P-Xe=DQv-Q%hwWPM8)de@~ z@xj6A_WY#p{E6E~wAK>Ph9<_=SeV|vBGKop5-MH(*LD;rU07=+L4-HeCnp)e-O?ZU z*oK$b#oW|%25e$F>(}&fFhO$r8y>df+#EpDZ0_Ne$v()s)+7xR96L&6XE9i=lI*3~ z=Oj@F>D!5k-YbefWDW{;2;=IG*NC{$_##Qr6p7T0pfW6fR`+i11d<@Ku^I3kOAO;` z37|(s@Mtgd9TLLt?Jh3I%a$BYSsVF7&}5R<^@VG+G>S&Joys?*sz@G zZcnH^3*0K5P6CyiGi%lGtd2%OjIsWjVb-buMvkRF_8@DOGb3lS5{?Zw_8yy0f2o+* zaGFiEm=U#by49GIiJV5Fofl_7r(GS^&l`~^oCx~4uq8gPZ{hSTN%-TW)}UkFfUu05 z$_pohs_n(Z)B@MfmB6$Z1dslt@ug^~!au)?_%gd9VJ9<4SE}9( zt1OqSio* zC37vqa(x4onSkK=S*L?x=6(I(-7QCb4WG}R=G?>CbK}Z$ozN^A0?omZkZzxF^Ez{b zJ$H6>W&x&RbAxb$?fcyAOjj4(R@L|>J0D~j8>8>|3Ig|9jawO{-h3wH43K-f&~rtk zd$^2jfk1jYM}34mcVWe7j%;Jw(rt{&YqOtphpuzEt8|0N*SF=*Hazz({P_-5<69vR^vTK{>tWzKxW7)(>{Y8UqICLxbSzp$vThM9k$7xgg z5U$GE#K+kb(fJJb`JDE-*A~o8`I#4f6Rhs}#>e><(Z$XMY%TZcN>;h(Da>x?#o5Ni zPSp9b*99(q6V%qlgV*Jg_SwGG#f^0San>b(`04@W@@?(%(X8p7@e1MZ)mG;vjQ5pO z*##2MHO8lNBZA9MI)$$q*94o_Eks?78P|9`E$Elml#|z~+=rx-d2rr0j5^m)#5Z&x zP-dpa%~$VR2%R2J&Rgcc*KD9$ATcZiV1(<_Mm!zB7H}t?eaSC#Cv@qViLWogbN{$; z#|gT_FlmC&y;a=2Kef7NioQQ0Y!bb^H`=_=jlS0ZIz*}QU<`WLC4zmOxTLGP7yI<+ z0=f{WdN8+sbOk+bXFbp{JjByctK~rJSCcZ{z*wV_kM_gHY@Tgyz$ScpBKrD7yZIJ?zX`)w%uZQ$~y^3&@?6<{j+3F;6=D3ustvT# zH)wePw9FKg)Hlce~9^nNyW&z5b~4p@uvF^w0Uq zijvt1|154y-2#opiy3S=owfZ{=VK^njg~kH&84gDc%$iB!}f>s-Dd80=?6rzQpAze zQwS^%v}@z3+#&D&uJn z*ZJS`26#8PO8mj0nKDJvNz9NbeGS$!gp2H!h;n2e))THaj(5jmaUbLB@9vquhTBjk z_1`@94%A8yH$e|Vz!mpsAOs@w6)zN`Br*h?-3blJf1r~U&>koS6#H-bf`>;51~ByW z^xwaK=iuNF5D<`%kdT*`m($i(Q&Uqh(D~o#i=LU$|DrF3HWsF~mS*-g)-H}<0AmBb z^>lT0b45mugo0Xzf&zhI3?}A(U<@L0eGw}Zvj8Xj;jM4uWjIsSU zi~%Dx-;kid$gr^Ru+Z2jFpo({NQnCvkIBr;1oN1zfAN?<#RXs_Q(9VDR$W z`g}YKW;5H{+y7=W{{}N}w+C6 zzoRyUasEYL49LR4Q5*GeC2+Cv|AW4C2K=b~Cu&2;@3_aFWRg+WFAA6AAWH6!OB}6M z*kQ3;9wasb7`X^Y$A;vwU03J&1wbRBlk!Ykj8Ld8$I)>t^C0V^8pXs#Aab)HOq3Pg~nv1%8z)2hC8)NLZzAf?gSUsyv^~bXe z`vKbH9HhI8)dpXkxGsv&+P@_Sn$IW8&~RL&R1n;LJgO14QX=bl(SEv6C(cT;{=&078gWv|Rw|dct1Ps^ zT0Jb#2CH=+ARMF&o8q+Knv>;zqn4Lox`A~hYK2!yV+6FJq0)8uwo;rDm0)&KQe0Si zQd-`4a#B`635pBJr;y(-;zfVj79sY$>JG*;%l93?HPYmR1_CWg&kQq3#rrXhGJJ*c zx?V=Wq;{nBq6-J0^zLj^rG!*fX=$DKJMrbA7Tz2W8LV( zs%hO`DW`Qit;6bh(+efR1sqbeESQ$0*z~kg=jZew(ARH4;2H{YS~hrSo{BVvc8!>I zkZowlb{+&>0pTE+SF8Sl5CA=}UqXB!28k5Pf*L$^(<{2y(=6`Fr1RDc0@OvX%&U9T ztQRf` zjdBIxZY!e}&-+S~kqWMvbZSsva-*9*do6X8Y7?zHiNHy8%K@nCdY=1B2ImhVKiBVn zMgET3TzTH-d{lh#Mu$r$-R6Aiw^p+S*P%t^<6g&$;bNwA%#(@|4t^O@^Bsrs75l}U zYL=p1Dy#z&6L}Yx``l5ukmJdR@YWpltP}Y|pcv;nQPnL2$R%^O>HT^zl8gfBk;ace zd!Ktt0Pv*H%p@qtiCqATNlM`>J>Lk_zImir2k2!VqEhD$3aipk$ec|uh!KJy%njpj z-{GUaZwhIy3fG=f{EUqgN1lN8ON@8-_Z$wdujsLZ7=|9f_FNwTr;AdudDk^1N2L1- z&8+|*4ttwzh!v9wz?lI@fMJ?N!OZk68r(&rcxRwlDK0e7BTqD~OKgvMJKhJLVh<*- zg_rg^L7??Fpbsuis&R&m*_T4=H?Ekk&p=R9-+rJ&NmuO9cJhE+SwHl+7$|a*Zn!IEezXIzNw<~Ttf#Re?n_*d3|Vu0 z=80et`!FsnJGF5dd&xn9xG|gtWqkUZ9wjB3xZEC%qMO1rBoht%^ra{UptQVL^xi>k zRTO}fe0Ic?3h$#8bypxIZ*m7^7YJ>U@Q3z1QV?=Vo}=fkC~ubx7B-HOmfk0o{eD8) z6~V_E;=W`Te!l_%J@5}HOG&#Ltpc!GsMxK6C6`{GFT-XQO26TUI<${E+SPnx;r9gi z>n{1p)`I%d`2wr)({J10Gcc3H%8Z#4W#E=V2c8q3M_@iLYHlE~-l5U~)1qjuRJn-g zp_W9foEUZ{gzieQS~cuUdCA{!rG1n2Xn9v*Z8IOfc}%NF z`(9w-L%cE$jhIpo(`@aVUAlQn{#1#QWSzv6!E#Zl)bshH#B0_e@cMclpgUnRbLFAtL%6nf5 zs#xXAmBk^iZ)yGvV~R5S4ye_6JT9ZThfBBahuVHf8X2O2Br{0^g3a|e_Sp7Rw4M2G=PpHuH@c0G5kXWKT!4=jWnI;_2nQ`(L{oH4u0p<{5` zwqQP8wPQ-l1#Kp8p{aaNreVCG-AyO`G}-L`E5bagH*Q-F1PCRProTC`YXVSKv8C7= z#KttewG&CZjNKmxg(kn4nSgU-^EMO0I ztBaOCiY@0lQnA*bt*E#Uymbs>1qV*`ew-Habe!=ev`&1vajdReA4?$gY1<}xlup(p zH`C!?Yu*mv}ilcgN3AiKOrLOI@Ke7?ekg_&(`s5*N}1Bc+9HG91J_> zi#}Vs+;|!cHop<64cjm3eev#lq(sD*V9D2v!Uvn${tcG2;n0_INDB$aj}%Vj7Mm2$(U0=TjTX+vCeVxB z4^CqmQ|Aj7_?QHv3mDU9;aT!Go5r%y#@@~MX8yMoheh7H;ZoNWrUz(MDYf#kn}vt$b{zlP(EffV2kc4Nbh z?t)~Wf^o+Qam@6GO6B7~zVnerzf#e_wj#drDM1x|Vf=n<8&A@?= zzJg@Gf=piuO?-m;6$8n~8OHX?K>*t<9)L^LGmD8jEfgkvgXra3s4Ep)LtIHfprRWvvoC#>%& zlGY@wSTxFhC~Q0=%7Qw4dMHZ6C43$(T4N}DMKt=yQ_x08^cR_YjFB8;-Y0j--N5P!A4$6ixUJANCrO zAY>c`8cL8_4r7H+{7w}PE0)Mf6^$60NNF7XY51R&U7z8TFq|W>#gY&PBk)6$K!x!Z zB{tm8Ng&DuJ27iv_ISrsqwVGdS21(x&}7fh-zRK|zAdK8&tZXL=IW^_^#_R&u4el1 zDbb-iMl`AM&st`#sXhluX{koG%cD_h|!an!%|V{S7H&Y8p|`8O4~XGp_21 zYMEun!RDcvLH(&~rmES`nQkD8w4GFyPPHt{hUAjatl7S_vuCBD=PYfC^qXg;Mzw71 zg7hbNC2N<2*Jt^`p=1z^{FrJ6B&|G*SPHDTT)0ajBCY&#bK)m)IpOET&nsCuY)RNF zSw${M__UHI&6&h6Vt4F$Jr3EF2of);dD(N>r^9(McEJz`f9UsuVZ{H?lP9v3id3+r zbJFs~xuo-y^29Z#3xsjSJ>`iYkfs*rOQezPJmm|P=E$e9qNo?-{((dfD{%b-i8WGS z@F!Q7<0lbEVGL=Wkvb)JTA>tazC{|D@Jr#BoqRhyJO}k6KieXg)*_FUBCnSsAG~5e zj^Y6I;vl!;khJ13FiZih6i2-j$KaL3ag-#emn6BBq@WrwaFq9{mv_0T z4WyNiw3d&plux{rPvKR}a8%5xS1hD zv{r&6OfOz4ukfmFIR3#c4{lXYX;m++Rc|X*A1_q^{Avi!YAB6r824(p^lF5*YNXX_ zl-Fuh{2Fx58VrpZEcY6m^cuXj8iLgtqSqP{{8}(;A=jv-bg!jOucbY$2%f5?d#%+n zfn!1pa<{>81;xOM>0y|EgVDQ!*3N-e)%{l`iUeBL2a?SOl64A57z30}2V&R&8gxzp`lkS7*~V}9bwBWfeun=Osj3Hn(XIy9!l3y%p=H6# z2Ckq)Pk}^TK)kCayqpFt&gKA(X60~TNP07l4KQrAIh3wB5Wgjkvqj?-kmTNylHQUQ z-jcA|f?C~@W8PxG*=VTIieS^~h8pzaHIS*SF(kImxeLaC1V;A?S~CWkkF#E(x=H4$ z9=EGWloMJ(7FyW{TI~wrJ1XQ?pEgJHCfS%K(Xx7+F5uj0^MZTFQhLXVd55Y5@bgql z0*Dj1!`Zo~(RqN_dBoX#z}cC*+IjKXd4>P?2EX+WXKTSKpr{Pc+4lEs^{;e#X96PR zFd`&CvkNAp^EAC{-@WUktP5qVYb(9$ma`i}vm1-P_1^q%VHp5*tvgTxa##YAh^q(o ztm_k34`oIdIYA48M>peJ4`W6*lgHnuHgIwVvFQgKGzY~!{+eZUV#Tzh#S99J4eYk{sv!-c(+_^O7!1i6x@XjA z^+M`&CxG-^8?r(g+N2xe)*R5Z7`iSSLg@lzy$$COjO4uyixV{JYqWx0?tj#76mS88 z-U`?T$On)CgJEGYK7GOm4@}H27#Q^6S{eZXHMpEcM^8mZM@LJ?!o)=P>(|%sOy9pV zaj~%f{K?7A!O6_Q$%%={$IcE(XhB}{`hM2sff})bT zf|`<|rn(&nb(#>VnSCbDK0@>VuVb_PPW zzr}2T{zH#IdkFt@ZYx3RRc zvvIaFuywF@a|>$~W1>vs;|voLOi~h!Qxc76pyQ27e+ z7>yU0PLbnFBiD37k;RgxN8@CtXDd%{|&A$ zKDOvSwHrPCwRr57c}4|w|e`3HrEhKGm8#m8r4WPq*j(y}tJ z?_F2l{=by(#6(bjKB%Py)Y)lW z|F*tgH|pPZ{#hQ-(=$9UG&DXwJ~K18usFQB^3Q64g@vWX<)w{{>6Migum(Oi2Rd2q zI^P(+*c#i}nLpTHJwD!i-06Ee_{R)?KbgEeUVA-V0M{Vjuhw^WcTZ1u&(F^e4?$O# z#}8NF4&cY{H+%07XCF@&_x}vg+tVGm7zr++8N&Zp3GH73^FL{|p9j)JYx4TT|6M}+ zS6Z!8fKV;@uu7F|iK1yK1&w^J{zwLVDP^$?oBhceIIVUv`@hm^<+7u}CA5+He+1@# z(rOz@=gU;<%+^O5$`-41d%*&8WBGC&SYXx~ZLC;rve_NUlxVt8%8S5bscpM6F8rJN zO)pPSY$jhc7!{vM(In>2U<|Qmk0O>a6AFsCfZ%?spaxTlPAc9QBlyoxls2C zgl2I2_CSIl_KKpPZ;xinF8!&Z&ZJf2VmhfqjaGESX8^1VU$KcT2~eOOXzR(-<> zinjcaU|HEYeOACZcSpiTLkGYBW7h8MSoz(aKDn2P4 zRWi}TkmPlRfWtD`;ztpis~JqvbUHqDqaE;tsv(~WqeuAJQ({?{6UIT?@CK1gKr5qL zR#LXcPg4d(-h9=I?)>CymF!dArtL2L)a3_sSjiiWoS-@=lPj2x*ursVUQbjn#kj^Cc^@8rD%1r?!jS!;jqBGvC4wj)UJZN zK1RBVWG1f9)p^>Fd&ll0je<0VKe&I@6y2Og^-X<5{g@z>dKEUODZFf?hsUeLm~-(E zrNDE&lWh3ZXJ^gUpFn)SC}~pi>xNC-MgUZcP%7`GKY{3mTSJU++7Qp}F-o7LetV8z z@%FUy`|0iHjt-l~#@4I~iL+tW+RpQ4dD9=|L-+6hyqH(#`EfG!k?QrgHLs6;Ukgdz zb|t*`d-m%(>G9_uSDvYHzivOcST_zIQyfVDxKbw^I{TJH=<^GdoGTW68T#v5n;ooS zd5#oey`hSi{jQgXe!sL^ci|uaKXL?I0h%-+N__lA+JBSbmp>3^V{MN9ATu!YMh+#~ebmSH5picr0{OB}Q# z&x(r`sk^gI;$<_iZOIokm$em;xjeA(ia2`geZkWTBc+WUqL@9>?SNIsY?0m>zjH?>zUYDSvtaAi;JShH*3~ygRDgn!@Fg&+=tUQ;gha62HYTla#wi&8N;G zrsE0C`i)ZxHGuQq_|q&;UB@oB6SMM%)6?GehPfxtV>&(z`=qsR#L#&@R@bgP-|n0n z=sk_zTsw9aX-@IG|0;!sVD(9F+cxuke|FXnKOu&98>50>dU33p5O}}95Jo&Xkd?^8 zZ0hki=DrW3SsC?BZ%9hX3iqMkvVf<1en*_)@Zl*`QlHlH#@1O>gO{mEn-QIP=3@G5 zqU3RxJqaByrePX8opwPKWT`mnOr*8^vGtFgH0+ST_Hyi0y4Mn;7HK>weRP++ zcG@)7Bw20!IVZKpqI|O~C?k|7N$%+}m#&_O#P!&7%o-m1q3yF3s+`mYrQ9c#QGJ7x z_g?dCy`|&oSRwFjYQ3uRC6yXf6cG1}^>=q}fgOw`1kH9FoWHi)Gu5mlhnnh~>vNl{ zuP83h=j{-m;u9MyV(MMQ{qm|@9)2iA}A z>|qi*557+scw9cn>oQ)UU0od`xZJgn+6O7bzE6wk<(W4V^Mbc8T40_(*srtVjcTh$ z-huB-SD$hjp3Z&56KUXd5N%Pr-Y_7q>So@9TiaMssMf3{PO!VZHmMn=q&NbxVV!Uz z7hag=J|5uKYU^P5v4ev$^xkcylX(2Kc54g$tIcPrPX|2N+s)ykyNMrc(kT}D+q$dT zzE;95%wlKH7Hf6`V^{JGWABm;EA0|>Z6!n{^=o+f?(Pr=dg}S^pq0{22c5e6XPbf@ zKa1~zVx=l6?oeuc9GJcagC4s|Ktr0>`tzBc$)oh9jR|Q%u2%3j!+oFxOfhiJ-OG_K zp(FSE&1f}W2(gfPb4f4T@Tu-kYV?_agWgqfr<7(X z%u2j05Z~K)Bg{BS{!M$2ujO|&BZ@%kR%1UFF>t!yWQ(>g_G@WxV;@#A;$^R>OEsnC zH`yuPi8fYu*`A_cL5QW04g^N)9WiE6b(gCECG4;=dnp;_P@7h5IBQ6qy}5|vUVvcnX$ z!}hjYfkmiz8+TxaLX0AB+#_$iqQcO^@XDS#8)&74N3>!aV5tD9`BA^V6EdqrDTGA! zrNd7t>`lE*-nPPPRjhcH!!=9D_?Mtp_Rckqp)^;7uHU25DPx8mqSI1rPzbM475z_F zp>?6gN`?_~%ds~XvCox*q{59Cc_W`~1oQ5Po?S)Sw?ZFc1r%Aw-H?R`wg#%E+uh2? zrk0S!Q%1~VN2b|%>X*hh8HK*Z4zu5Ty6otn_QluEC_X*JatDM%B9@?Pm1u_@X1j~$ zhD^BW_rpiE8Mnz0=I}DnmXo!5Cb~I7H{Ec!4-!+{6Dg=(Z-Q`yot~?y#xF1vCY&Y9 zw7s78en!Ib`t5Si#RjgqJFc}@s;zOVy-%uRMyg}E_CZ=CZ*!y}X5dF`e_a{E2_)V~ zJl?PyZj&2sqZ@9G8*a55ZWV88c|7n*FGu25P2*N?;MT}M8+D*fa6F$8ya^)w85#Tq z9sHwdf|E0X&qRb@;t8)2gk^1n$fV3$%giG7%)B;&qv?$Kyo`c)vYzm$A7Qb&mYzus z1gL2O)ENPah!7PId@^b5#HP-0;)o2Mwi&t^8?D4c)qN70Te6X8_>=58hV}u16pxos zZGmN_Ib)3YlVU;JPN6Ryb4La64>FSWTcO2-zeYk7RwqItBF1}9xZlkFV-Ga{RJy& z6Mm~hO`x1v;=WpB;jDVSQGzH5V^_6wFe!zP7QxPnb;(L(Gn33BjL%t10{{t4v%SP^ zz9eik1Y_0sr3&Gj!?MiCB1k+aSX@5Q0Z5q)x$O1J8}te&MJk9F>Fk)*iM&H`;44JIc>-A>xe)-3W|!OXvo59hOA( z+f13Ok)WI=jCL8s=g~S6&f1GnIr^wqANMN=qw4E8Y8!8AX;8trcv&v0R}syyTK=qh z>@m5uj0V5e>JH0#*4u^vwT2vOyj~byA1_`%Z_^fxVB4(;NRl)$CHy(v1Q5%XG|krU zn^a}XIm>EQD;wQM8zH=4v$JM5nwA$5E$(9&=4Tj|@h!d`Ew7-MRyxgl-U(7i4bIRq zS56SRPK*0{jOZhb$M6;(8cZt~rZq377PRT1dXqs^lc^~oTq52+ywSlw7rcJB%CEfPSbi&0)@G? z_EZ-4ae{C-Wx+@F&~zx_SmQ)T(G(|$#I1UABqj&NW_2eM+LqPT+ulVfE<2Q2z1~(0 zyNW0i?)=ozHK+E3G`Vy*v&!XB!bE%5g!;Q3lg?|KvYT7O;DL7?a45*E6{OLCqL4|9 zbel6a68Ij=Uyg)wHQSP#41Q75rw1%=W&p%3f02KKk@N>G3{w(|+1c*$TJ55~U6m*It*~{_`6oxDi)_ z*5S6iPw}|yAuW=|9nX-fd%mnw`&GX=7wA$#wt;96Q@A5du~)@)(44jl7k%(LJm;ZV zse@#-VD^JijcCKn!U(51+3N zffYtJN}=y6MhduU!!_iRe?({?FbX?I6D3D9Sd*BtK$Tph*=r;EnI@EyV-9AcCFAZ4 zW9Hf2Tx2OYT;mVdy2NeAJBY@IkNc`SW#!b00?>x0I{TWkWym6pyI1g+I{P}! zJ9O@WKg=n-x*)GX z=yZyCruo~cQ%h?zUg+)jRvfvc#z;_ZvzF+7_p@@6NC}v_Mp>SyioQ0Xl#;mMopU&z zm7()`cbwlzN}$v=ApBEV_h1HnX-*}2zK|>hsW%@?yAWp^JX;!zoWs}d>N3JtSK5C& zHiyrBQy`!NY3wcERO4jkMbm{ln{F&*2iJaB?HLs)fIsp4`buRU8uc|j|5H%s$KuKG zF3Ctb46K#q4_}vkxmQNMF6+Cl#D3_|uU_f?x|};9l}EQaU$|^Ey;7tp5t36--nF9E zWgPTjHBB$H{$!P&@_m!0m|glxTlK0^xKG!F1RvGfJI4A0rM0(RtH_wOUd;AZ%{B5i zsQ<*;MCdClwGSgdL!)Cpw7-r`c{1@KsW0RnbbZYuwhVvW>}qX1XMN}7z3A)pHM+pg z59_-zuMT6@S~NdS;QM{8{z!i{d1Ed{-?|2VYLQ^Hp*|FX&9i~qy|MXWgW%}~56$K` zd_Q!H4V30)!nP3-9&pBN+_m8^m}*FUSL`1O?BC%U8DJN%2}l(b@+U$9&|3ur1OS4O zkWhw*$ly1}_~_9i0AjSVvihB_;p^-Bn@FUf_(wKGP*4z{%_aTO=72Frd;6ah1_1U0 zQW$>2en7~=($dnOcm)9A+u7MUIXMAPJ%G@=yhQ!?*gQ-WGMe`*rEn;7+KUla@wd}u z?&5SN0?JmAqbI)aw72d^=m$*gU+`~JItXZ|zS63#{A||jx2*r@E&(1cHac1;1~x7p z0pT50?|3a+!)Nwt%;=EJtn8dD?9_yWB!ed=JRI1$l~w3*1>Qx9)^e1T8C7k$*tH19 zqGwHL?fsQ`-S3|DkoOHtW`WVVhJ8jUsamF1ry)c03r+YGlo0UyJ@8EaM_pek3cNeJ zd;162$B#P~p$kjGDSe=r~ zsuvyibM*OmN7{W*iB`T^vGbiHgBmM=sMm-kSDPUwvwEksuLAHnr~)hK%y@gxy%dbs z+IF^hu!Q}1C{@!GhB;IlcY`PW+{-!c-7~CGRa(#EykQ)+$68fwFBiKo?2RTey*-X% z!A!^udV8ZUkZ(oH+43RXMMJUjBdN7!kujpDm~hb1g~$ln1IWSVQw+g_B6iOwM6*$-0TvlY zg-=ZVTue`OAt7caSk@_4HJgJZ9IhEGk?NVro0P7Cx`Ek*93%Ew_syU8kUAW;rX{Ke z;;@l6;MK{JJ!jx3e`~7i*s392R^Xa80$p(JRp%xMag42gERrVd#w9eu6Qxl&Dh?e}oYj)(M=ZozhvcmI zK36RH;OnB;S~p$*Zu4sWio@3KR5tdMS{C%r`HBZv9PA8o1cj25lLG-Ul#~qA)B=Bv zRX90;m>A$42V!CXN?A`&&(ze^*4FkC; z!mj_lUxkH&>vIMLhlGZOM??leq58mfC{mK-6p}mlGX6Sca^Gg@a&Z?GbCs5rmqt~E z5C-Al#m7serqboLwYSO2%DhAN^!D}3JQx}t;u#Aj2*T%-YtR>NPU%=)$>>`9u>Nsl z^P^1gH0QL&9L-|d>S^1+m-C*Hkujd#ph?X+s^iwrkQW>aaw)Rp)g#5b93XdatGB*1eTJ>gE z#Tri3-E4Sc9iyq&)BAT{oNd^Srg(YnzV<7V4a!J`xX@G)@dWk7IX{9_7*T8oE93CF zU8t}#BU5CFxx9HF8RtBwdS3Fd$$sDbt2MMT%#|vB{KitYgrxa{i}_X{ln@KOM$A!4 zEb!L{C(-9CO>ZdQG&7i+FOAC%)ObyWuR1sG)(4Ai4$$#DOJ)AULpSP$2fpP~N@57ojjGY=&^&UTmiL-$X20 zp4dJTjZo@pqmNicw6sEWM?=g4jdSt^`W+RWeDpi&I$zN5=v*95*CH{GbaK9~MU+Bi zieNh-9XLnF4b$Q~9~_++m}Ye$mv>H@*D!DCl^~M~C#^gF9aV{SiIqH!_eNF1wG`VB zr=3%n5xTl~!|I>A*FRyO3J{!go(alYS85ZXvHnnrKP8w=>V>F_6>AWE^(#Pm>t*VH z>1K_Lm>(p6v;SNP_R_T`b~i=xbA($&+4(4IDa%X2`?X{Bxxud<3AB~P&(b|PpHAIN zc8lnE+0s`fZdR#A?RC+rraW=+4p%xxu&$5Nk8lo?b6A_qGK|}^-Jl_D35Ts>8jc$( zO4N@-z?&xniIMz-gs{3fHNj3io0{pl$z+fl!4wvv5b7mbTU>m$4hR|t_S37KP@1!| zG1-D?5H4pC0<@c_9gEzBIduE%SUcE56b{-+dk3M8_rEm_z$Hg^?EfTm2jj_n zt4ZrR@%Zew$@utsc1ZRs^YlybD;PSXH$0M=$djIIbBBRaayH~x`jaU5>|t4NPaQ7^ zqyjnx=_g~YAwmUg=|K<~VSg%HUPUJ);Un+94KN4Xa&UDvM(+5&2#<(1 z`eHCGqutIAcV4sln)_wcsvGQ>H^YaLF8KaR4Dn>HhIgFn__J}@5w0SYeu}0g-k>>49Ig})Tc-$R$ zjq7OWbs7u2H5lc+7Vk!%*iqj-VUWUs!-34qJmsYHNu5z7gv%0x8#{3Ma!_Q6O71Zd zLZcnP%rCd`vTTOq5VjaT?}!2Ur&GuS><%^q@q$8rm*GD)AxTL|puGli+H`bufcDzj z+WJp>4OHKNfPmjE_3!doUS9rhL3Yc_%l-YRg#{GQJp&Fl%4fOv?VZ%hpL?Ry6 zQF5mhk@UHWr;Kjfwx?@VEIP^e15Ne@LiE_yesaIjw`|7MG;s#~a)!tTr!2)V+FO6^`%3}C#R-M`$moD7n7Gu-DdT0@6rQ} z_2JR+$>~N(2ONjs+vWGG>zmsj1ZMzqHGQOvu-tR2lBzzney_P(@<$}GBq7g0DQ7g z9RK11Q-6||i--i4lbKvBpq|DrodWA&S*V3T@DPX4gcX)Za$`h&Oh7OMj10uLM6Tp^ zywXvO=M*`8XzINJQ?t%b$i{lLH!CD8dJ@8@5RB|c7vWm~rK9fpwP|V@jp^}W$!t^} z)Z-BH21#>J3xu1NNN5IB`U*`hf-|4Q{#1cHeQ#xoW(1PByn|Ez#&j@-3Ldc3A@DTG z7zFy-Kb{4JOOIa6buBgwDROj+!B1*5K0_W$yZeA9+a9B}A3eD`-WkJ!YfHYKyCK>a zvCx8;lmb~&vixxPHec&w(D}soL{Sq_M|u!ea_R@J0AdFP|9Q87=JvM*PgYhIXl_kROn{ujKQ9)L zCkVV%fNc$cND2xHfVZltsR>97?CtFZn#_fT1>mg$qWylqQvZ4(#Xwn-v0GCyo0itN z9#t@~^KV)Ec-MTEyqgw9QliZC%eh$NdAUTa8g4mVx3zNOH0C*Y4@~W) zRNz-u5mHeSQdN~yloMA|lF(3>)Y6gC(UjKFl~t0KQxlX|l~&Pw@YGiFFHB599>B!p z)fMD5)zq})G&MD4b+t5fI2l+Lo@w{<|e>xO3TvB+)DkSmASFCu8EC>zO9v^vz4ixjj5BZxvQhSjk2}9 zmYuVfi=8}xk~ur7TRG_1Iq5n*(S72k=ltCKrHwp5lRbBodFi4D&}9BEWS_e~dg*24 z;bZLMrTglIskg78@9V#w?7x^YXFD4gCl_Z+7gty7=TBVRp4xjnckq7k&_~0K@8UtnBw?_200v>#>NNnKXbS`_~KVZ*~kgL4LDiz|i){NnI0Mhv*M0*u)27}1}Xhu^+k020{mTPpyC5gM;5{Ozk0W7l`Yi6(<_Q#-2A z7lsk@Q;yKC4A(I#GpP(`Q~9vOWD2tBSu0ovtHi?uttaEbXqZs)yP~dF+xuw%6y_oJ zf@}*ugBFj;U^ePb&#GpYw2zzqgIGrb_4Zr5l7GEXD{V0IdyuCOy6i!4R$gBmweR^|*lYH_%gxDmINl_J_D4PA8lA*0tc~phJI);LDs<~%3|D466M9C#@UHvkZf?$l zFrG|7?Y1Sb;;4?WH!_epkh_VMYs}mA!CV40CugOlxv` zVmKG^^8>Fw{3XsVHq6P1;k~Su*Z>*RV=k*8Y#g0%2=tD}a$o#)v0YIDFRhsT%Nwb% zt)zlFkctP_q);-W4mzKyckqH}x@?EjCJhEAmrM^P8G8n~ChPi6NtVtaJ8Lpm8Kq&0 zOz|fbn4;^ooh;OMWS1rNEMOhoPKlQo>eB3^hfAx#aZr@3q_&Fna*%yD()(BP2OT}+ zVBXsupV^V}oFA%X@Q?J`S&b>EfGn46N>zTuux%z7m_`*cNBZSH{-o<}F?eSJ1x zLsR5^ydOPhJ&OsUT`nWOaVX7$Hof(T%dxYX6W909N4?HaJl8e858CS!P3y@~+)h~O z4zXgrJ*z8o8}Do#TKh@$s&tsm6rQ8uE}9Ur@33J?`0Tz`ZWr5Yh0=JB1tmeg)E8$> zso^4;3t>cw>{2Mak=>&O9?R+@jmh z{uZGfJt_POXAXv)fI(sufTQXbNRkJ_pg-FP7V(~|avtb4`4)+BKYSA!3=3wJ3BD+RY<3>4K;n~n`hmTo?lBBdoGu|x>m#1amcI1N^v*}V9=?{{$3=i=5 zeu=W&DY%~)Fkr>B9qq_uL!OqdXjeoWV-;OUyQeZFzWOEBd%W=O_u(Pwn=f&2ydoHu z>aZO3d3?A=5d+1@u#)(BLVR=)6RYZon#p-$`gjqG$jFG6?|D)lUNM{UKT|CYM@9|W z&r=Z5cFgZp#!ObvQ(MQ2dAvr{&AN$WhGjx|L&Y>KDH|xdHbVG)@}vIRU_KpPB3P zMhI_kKAzE;96eEfIOlad83~?s3J~|l%S}%l$R>+ZrW3+qW`%8oU7-`EHqU2i$91Oa z{4mVzL0YC<$w>jbRar?eU3r)kIs2h*%jhHiaM^Mtw{mq|@FN=`6&*aVJSbo;eUq}O z(k+HlsS~!y$yZ(FUBGT~2dkw*^i#DFUyvo1`f@L|CnCD6l5sM0sZ(u1J0!n9=!Iny zW;&9CBH+kM#MDTb&A=_jZpP+keb)T03yR4UDDI2P3EpSC-uL)i?CJi-{Xy zIBre+@~VNoTPw;zW1GZKq?NCxF4pje^+18>p!7;zysWD=7%hWGUh6#M$@6VSM&l8k zUqg&q$2)Bb#v@$;}=FvI9t4onmD!* zMJY@QK5Z~MdF3G4kUnYk>1FoMV{2|y`dBavU)~YNzAUSFpRZ?mdd`o1qWdOQVM^}B zLbOh4!mBe`&2_1)ng=?MTjvZ%8%s1bH`PC1&%Lws2+5FiHX1TnB+ac)omq1Z9dqcha-X&YUTUy!&bP{Ae|6`YhI~Lrm+luf&f{Lli+pf-8x5vZgE?sV|DH+{x@lxN#T!T$U@og?eC?iC)qkC z-Vhvh+)91s^t_(XKK?MFMefsLN#P-3dcmL4O(giYErb4?{UVXqg6H&G zg^cEx#c6{+g?up`>hk@!yxsW;57M5e_uVYtQ+{9lG5OK&FZrbL2p9q<*`@ab}YKjv)+7P4Z0$KH01w){*~>J6MvfDwS(_8k@be5 z17x2R_sWy{6CwVvBO!J`<{n;HnAJC(fJDy#N>QI}4C{}EFRqrJmSADMjQ8iq3Zx(Q z4t(^6ISkHL=3@o-rND&C?*+co@d9n&`BPv@gRB=*-3j-DFhIecduZ}yR(D08@azYn z;)6XM9+F-K=d$`e6b(`H_MO>yL$MfuJ`^OS;sutm(%%oc@UmhCq9MyX9aOAvLBVdk zuc%7=QA(lj;2sc5D^*b}3~#H;C0k$YFbbs*>XIP+k}wa7Fn`oO-oBT!&v3Xq7Kn0? z5Q7(=>QjKAk(;Tv)%6DGlbaRUerPf!ermeacQ=UDet@qiJVnLo2d@=|P80?*l6)~V zav>s@GU^foG|wCI9E4BeXytun%&OvDH%$0oIqW+OL>+DwL}^+}83;l~%ann3&IoZ4 zXf!HTk(7=LMxir0pa&{mlha{GFc2qOgoAMG&b}8ef&c{riKe@}wF|Zt^_hZ!2=dUr z8$}X`#`dxXS7Y0pQN~3N1-oMVca}wmV1>_Eh75*B<6J|XTV8t@hFM^Tk_yLcW5!u8 zc_&lgyNFtCQp!?9B)BelGEw1sP)3lFJB?7j;#Kj2qr9y)S`u-cyzDK#$XVj=wI=2{ zc=5A`rVl158hf#pM;Z1eNwFt9F!s9Z6U|Yc>@}1?YwUFgGf^Ea#a|?aMAZw59s3kB zMM^BiQ#tz1qPvAT@@jyJP2{VB9zNWrx#7VPnCp%C&#J2rlCrkiBCdJho<3VSFNPEFTEZL&!QL2 zaxRZRS-yD}k=-bkJt9VsbDc7IoyeP!U3f)EizHMv1h z3*;4M=4BiZRGsDBUj~dDgw@FWFKh{!sy^2`croO79PI^Ms|7qa1-#USJ(l=)S99&- z3D-C9KOhQwrtzex@diLeauo&rz*2IzqJAAb01BI!E}B3TeuyvJ01<4$2)1MhjZ6r? zSrT3%2rX`k1ulypj~1J#5!x8Ot#ZO_FtWNhBYa{)h_WO^AqZa{0>O56QyV$=ed4^F zolS9aL|00^DpKK*UV(=$!R>Ede9KBu!l};e3A9f5(Ht%~YMFnzD-Uz@oG@1-%B#pT zI?4$EcV)&w&RwyJIL{<^uf(!U$BT?S{*{X0%N&TBSADxvV`g59i4$>Vc3pd=%VK5Q zXa!Queo3`J-?+-(GpB$Gf1s>tFtf~SDHd>7`nLNlI9EIR`mQ)vz41-^aA?;io;5{X zqk36U$)58G*RBaSX|t{7I5W@wtme$OCQr>L2XI%KR9scms$u%39oEW)CRtG-AeAv4tL_JqWJ+)sw;DY3*Y4Ff#@IYB&iMn8U<<)a$ zVfo}?`695EfR#V-_$zt%Dz^mhsWG8Zby~NLIy6lrQ0oz#@(W*tU~0ChPleHY>rW%e z=23{H^3-?K%}kd~&Cbon5;bGx%`Qh}?xi(PJFI&%YG3*_8>@O@`n52S2m6h+yv|B7 zgtpQfc$=xWQV-U$M6`NmRYr}r>StxgOIWX8w!w?$-S?;f_1eafj} zZKo(HFY#-y!ojyk`e}PTPJ5p_MTEJ{i)Fuo#u*Q?&kLmXZhbjcJGp^|#@pF%+S%s< zv8!zM!oo+l?3`5ZMBnJJ>PVfq?Oc=qiGx}_mq1G{U0_~N>WWLV%}Uq01jw_pnf3s0 z=e83}1Y$w9(5`?!c61NC?*_xVAQCBP)7=*motHGASCLKjApA+ocRz36oziqe@bJ%F zkULSxkCjL)7tATdJM7~wBHEsp>OJJIdIqz4PFx@)+3%(;A+R4kFj^$31`;Ouj(e?p zkEWSc6?EUMkC6*OD~2Vs*2{@(A-Tqr!0Wx@M0is46Rm+(O}(To`!TaS&HcO%r;!qC zAgv$$O4o#^umLJb5U>}`Ox5ZXgw>h_0>^_mH_$|I+b&jK-??lTId1+3fb+M0nG8+< z!$4gBLB9lM0}2WXfC2>!=K%@x_i!Gt2Lk9#aBwg%R|h0aU@!nkn195}xw$z&yaY^V zfOrWgm;c7m0Qx0k%orPANprR9Q8SxU>bA@KI)$TyliH3voUdPT>jlk3>>^rkwU>@avCa3NP9;+x|(ny z9}zAw5qjrvJ7yhs4c(^qq!OYwU7?UT(4S#JG40#v+jCJP&7-Qm%`0+6K z+rBRe=C`kqZ{KjZE)-xJaXIfmAWZlAIZ$uU>k|SNGZpM!c-SXzD+O#KVn+UJUgtGR zxE#`rgzS--n@s(^5l{~1M1k8TvnmKHbD{!~51)wHx5cb`^tJQ>=(9Vf*dq{J7X+!o z$sy(pntF>-q{Y0s)w>X;6U6cJd<%kxj*bH}%KOHY+Ds!ez)kXd%Ja8wnE+-1(*t(a z(BEcOK#wLSrUR%8GBVg7KPx>wH?X1yP%?RWdHMLIfJHsRBC>#c^*3duudi=rX7)#| z2ArUP4fKDP!vGAF|I;xEJSgFRMo8H?c>sj*Tki(cE#T`vA{W0+kYi*25U&8<;$Ja~ z-%l1WX}Y-hr%3g`GB)~u{4)S-0p=F?3$_TpL#7oS6U#sYh6aVF1d~O@X3{2TC8eg^ zxsw^InGKG9n-@whAYT-%oQ)P!Q7KTZg3wZEh{flZ?(LHn5s?X|5K!%qqM^aaBovTc zSd^9F4W<(4&=Q?$%*5yGAC$fyy3VwTXbu?-8ArtD6sdo14Q)qcUlysZH*s752N*Hu{32#CqrgZjEOj+u`yzECw+fB<4x~;v=C5xv?#5{E> zWin|dXC12M&V4hynzz!g5Os7fztzznP?PKoqdkTdcSS&&`A4rHn5V<67LjA)o4=ru z7^|^srW36f*#fBookjs98cfv}v+5{sIt*$B?r-z@5;55G`VQPp3t_Yq7fWg{H4&qi z>qlp$ExMeSj^KBd0s|FwKZNVLQ%=e!wkP9lRu(ig>ML2_n?`^9wUzzVLmZkTFm28m z%Rg!8x?Okz89jo`+t;X&;_eQe)aR%hld$EW?6A2BT7 zix>&*P!}s<(m}mzq*9q*cUzuvU40+ymbg0XLwhjOJ6G%S>)`0-_~%<|3{WjbIhg#I zs5WSY9>Lo6i1LhxYQ+@AX4tj88AEjEhtV?*BGI2#<8JR>E|1aH1vBI2W0I-lt%N_~ zQO4_mkm$hih~aST&eKP&mKr1sGJSV%5TVO`Rwa}P=$Jpw!iDC8iD-J{neKiOR(J0u z%Jx=(C?JVNJ3#_0G9Zqdcn~_#_R7iiw#St|$x% z6(LTVXQIu&63%0i1s5C_q9upR+vhw?Ccw7d5~LrI#RY*yT(dKXtJ0+#$g z^Oyg}W$Qovb3iTA3;YWl)Dwz`jEatl0N;;IjJ!h@7Q{f4nMIS98ofBSITv~`i3u+z` z(nwR9$es#Tl;4+^`-`0TEcZSLUr^@q`=yweTm*%XW}5%Sto~D-_P;i(DH!HW2T?;q zhE1G&xjx;ckN%R|0Nqs_Jub0hB)Xjr}2(2u4Jb+xFB#rwJ6mf~j83<#@X%y8)f*Y%`YY=@BPBA8^}n znNRI{f7ZS{fHUPOGk+)~eEgFs5YHgUaS@99tEYZCn9Lwu$KetCl_q^<)2v1CTQ|Xt zaCCCVL}^v#VN#Y=StA0X^9kj*LVHd|@`|CN#W=w*|3J$a-IS1=*n5}zBXKggdW)z? zz3?H`H$2h}28n7sy~(hn=e>mqX&S1#PQn(7!~R)hBfIqGuQN;oIfRzSa7vtxciMXz;z?Le=>)2>n|(#@;lnVC+t zdq2g5x`d$}e`^OboTWXzEXFc&4QBilc2E>-Ieb_aVI+c`k?W5eRo!yfi0vIH8h%(c zB{QQyz-Q4gEW~%ph%WR}{Dp)00Z#p1RT4iKCeDP5T_Yibt@~6u|FEbM7J7MjL{C1* zSu2OMPp3DSD55T9We7dGFY&##kif>)37epFO>4C3mB8#UxrP`>w>st*h$$D<@tK;W zB9o0@EkRMQs`PVruJ^UwP^pn!5bTy&@}Pe`-^`9dgzSC!SS|86W4vYF?hetaGsK~{ zHrwHazPK?ndI!x##8+1FkG(G+tKp21aWdX!2$xx)j`Kj(#BQXUCh+7Td3wImOG-CqmSu}p+qan ziM(1vhqi`&d!qcAlC3|0cpL4Z>iB&Iu5w)AO?g7eGlV=YPtmm8-z^0SmjfyB`TBg7 zqoa$wQ*oGB55^ZlqQ}KIK$fyD#F^gj%~MGtQ?n8+jcm{BEQqf92S;9wRTS-@5`k|X_80jaN~nKq&n(KQBz zh!iXn8Ht9VtR^9(?CI%7MzyBKyIKZqBpBw~z0}xa90pdikbpS_rjlVUNp~&MTF3kG zbvjX|<5uZKtw>(+US~&roiY48loQCOOfyrz{$SP>?5u8cz!-yDHF)HHea$V4#A8OgEU(>;`zvEuF|{ znR9Z76`^_c(N?y0>0G?>x}n68)m6oyN98PLlP^M&I+?%utM*c_#>ZGyz)1^`<9`jI zrf7o+-*_u2>d2rikCzCyjA%OHk_IpCl!y+Ah0E6C>P73Y2rjiv%JSAl>?f~to?K1n zwAM*l3R*GIxW`2&R#3uqJ zP>srw(W8+8A+xkH0Z#M;bXEWuzI70$*9K3Lq{CohKYro_!Zz4OS zoY9_XC$CpN$)|GYz~*nhY(^&nLAiqL03Baf0y({An(jKH3t${%{>}zF@(#oAm7%N4F*`!0PMB+@TdX)*oX2xROup@ESu%?r%Rko47KI(*nL)vs3YS!e0}()2mJ{d z{RVsRa?%m^bKgy|3c~HL?RGO~kdN_~5D;Bmp79JG_f_fnmA)l{{{a zvW_dEDZ>j^eMy8IK6A1D;)zJ71_<>BE0$hP0xeF3t~z`y_ijsD05|I`X1 z{*OExu|TeSax&0f{qb!4SDn>wSH}DI@BdXL_`9cC2YRaCOv`UG#{cJv!GGF%{rM)) zgDC(#Sg@=VM?@qCdrWLx3|nGSa!P74eo_V-4o(myVLl;kQE>@i-Y5yF5)!NxsH<;i zY-$$ZZ)jIf-kc!{{sAo2o|iqWyss$jvEnc2C9+C`QWXyU3+AW;GJ_}1uTpzQqq zY*$AU^U8ZRNd@_j`P<*ib_4l2qax!$Xt?OEt2Y{9y-sYHr|3}T1OeaZ>0?_HJ8w-q z7xUrp7;z)jpbC_cT6ViwA0Sf~yIC92p&zFTj8!aiespiK%JDwmvAF8pglDX%5q|YZ zPZyKgMB#jF{?A!vMK{MKnn&{_AH$VUiE}OWg&RH2+#?OL^flIxIOttseIiuwu+#Pq z4JW3FDu~8WJKS;aFrZ^Y1UDvp~1rHwF-Q6L$H119s zcY?dSyE_E8K%jAV5AK>kf~HrGG3K1>U9;A%U9~qqfG=o0&vBoZ#F95QHvJF2X~FK- zk^-=-1NvDRg$Q@k05lvHZ~z9~-Ax^9ZqB?=Y!|(Z$eEt|;V?-Ai((+hvBhpcDlS-e zTjK-sC>FAfXQg$nKZ+@ok=ugZ2@T7!J`zj-T}?Tc4SY=+vWh~<97=>>s%;_ktG;S! zf+x2zvSV=(RC#&})lj(;LeY6ixO+Dqtam!Hc6B&S5hLV+%6Fimp+%Zb7wZ5n<$DYqxc+fxA;8z@imIc?U9!772`>6+@ zMKL(hgO+^h=3xV9)qrmyl#iqf5|U8OCZRdf*oZDeG5G_Ysr-XD@bl7PJiBn>41;*l zYM?>TM;t(&`MYg+!7MGO7`fLKn5NT47S9g-{oZ~T zV9f0%C5q+Rpcd<4ngMC)k)HlAx8#Lx_U1mtP82&r69?VZro{sx)@ZoAa;E?N7MWSa zqy%A0VvT?W7cIk>Ew3illJFs&I@CDW3dbd(4DL^b{Di%Zd0uJV0WVwEuo-JAj;N!} zU6ewFgGO^&Mo>AclRihl!hCwGp*g3Ljig!NCtL<3TkJypW>Q9R_&dWgAve2O2}|6Z z!QNxOTA!(y49#3raT_i%lxgRQFUdvcwld3IQ0W_*8GVwLvW?@jsw@L=X!N#RJ_@qT zF|FCK9;>OD=SL61r(+K(aM7A(xMtl5U?!EOD-=+ zt06)mB_}MeA*3%uuLlsZR;K-=#cH9??*-uaM=?vtNJ=ZnNdH~BR8Uov&`^=oS5Z-y zR8m(_)>nZjW?6vdUy2!^tzxLJp(U-UqoAcPt7V|5Zy*COR8-f|fV3|)jQ{{6Lq#)f zRSW&UAhWrVhP@F0Vwug1v@OlF9ZU_Z%nkpt%ytH@Rz_~NrY0&D7SiUHDpq!?j#knT z)a>+03X;gQuvWLSQ?qf_cYstf?TsP2+09NC=%nT2Dho+ux_jvVBbt5P4Saod{QLms zR)2|Rb9*buGLD^-6+|>!0j(`v9n5_l?Omx_uAUC= zJ|6!in*Wo_gotMQ5O?oTzksMjTle`pC{Iwf`MB0P7 znu7&}R`TL@TLPL#`LlhzP%&;(sWj6b}o@o&h>zj~los?kxzb$i`%|DzuC)?pa z0nPRp#rA&(G)Lq3rji8~Gyk2=jF%coQy9(GS;>JRXfboNqwz^2uKxf2A#-f1dvH zx)EZQ3tR1|D~s|3JuXl6Z4oIYLtPLs+@;hpK(Wp!g3?))7KNhDc}T_c=7R~0mYe~K z>E}xf8l{ksr9$fQ2Oi^~UcIIu_&5sb6?sD`_xRLO`BX-k3Apj3NLt=~ zQCt|;S#lo>c$LBiOexJrGdQzloBj2_xT$EAImcwTXiB0IOJ>~jD7#lXl&ciW=AZA^ zEZ2ATXx!#FtYLn!U8V{q@oGr>>Up=n9lN!=dyI{)R2W6bKAPZrE{*{M8;V3>xa199 z*urVG$*C}`5u*jze0;|r!9U2qbb3+#F@ZCgCB4Q8y)(Xi(;4rwD2_8@7;+~lfY(f5 zs3Glb=;p@2hv+tKrMKozN~|+48)wxqg2mrTF^DSeT|Dxk%yDGhr>yRSg`dz9+!ApV zk*A5F@DIq;o1iqUHd@=;I|}CvQaxpKI}!TK2!wh3@Nh2y#Bx#>X&b#nVb8~6skLzK zlxVi1vIPd_bVN-Xj)|;ehJxM0f_RA|`s74I&-F}_r?*qBB!PRm^bqL{f?Z4yseBx* zKoh)KgogZ+G_HcYfK~bmc1CfAmuqxd!4iX~5xKLpEG#NrcGp5KTQ;9&E^9gXiSC1I zzbUbO&7hf0f#G$ux}g{hvTc#3ii|BHxGm{07|C^y-cVhh5I#{s%i*d`MZS98G{?EK zyizrYxW|1?P?&LC@<-xq_(l)1CvtOaJD8Y;Xr0iqqF-&t@yJ3Ap%|ir`c_x z#Cg)tw>NBJDMT{TWcn|$Ej*+yF6t8**fQ>yE~B!Bxx?*Se?WF5z2vkFjfcm@WYMhh zxA`#zt&i6^+`)9zIrpv_BLu=xNo);%&o7?_5X|5}3r|E_cm`5v4$Q?FTPaE$phMSK zT8suO4jfW8=Akvq)PN!M_aqXorXe1&kDMHq{~Fal9_pI_flzf**UkUD|}&q&1`f30uw zwqr?Q5LvoMMo#w;T2dE3f5SFC?Bn}haMt@%#gw#Jv!DM`C@JyrE^6K+PNs150G5l4 z*&yA592Q+mctMFHV-D)>@xaCk8qP$bNL0V7vY{Idv8#VhE})lHPht{P+ONvQc?khq z0tj7WUBoyCbt7DgRp2YBSqo3`38_Yav?=GLH-_*KgK{GjK}fQ1jI7QzvzC~nX{1h% zeP90MMG;n~^BZCnCX8jX_zS-p;%WdKHor978v(=;pEi0%Bd^JVB{|`G6n1GC%;urZ z4*7hy4~=i4XZ@c+!YHE9CWZ#m51mgyc{r^(Hh59+d4A@1lo9 zts@Knpixo6cMIVMd@GvZHq8;;`@%A33cO9mH2(uCFV|iwnRnP4C}5wsM6W^2;6D<` zwnElUXw642vOv3_AM&edE%?1;rS$TcH0&KMdXh5*LnAKEDZXF9Z&U^y?G;AE&t8Rj zgsbi&J&(FS=#o&1g!d{fAkL#K5!VFAQ4yo6Se2Szw{(uSxe9Ht^E0Ds>qw6D04wJ5 zqjSt)J^(X&taD;H*?JcSOL2eBdCv{2WHw?JLY z3|{moavbZE5O%0uC*!QB`>v>HczB$Y&AJN@(vq?UfcW5Dy^>4Eq=`D4V6nHfW3>FQ zc;cVm#q)xYI@`965a64Ka~3-gW5Q`kg$xO;!(mZVpf^O1Ij9NE5(Uc&-3kqKh5{S} z@$O74mjIgI1Ned`Ev;=tlablsW_rhz;(dR2bH|6U^xFs-G@qhsCqDDW*BF|(K=&3Q z)XP{p`zYbz)$NAMHyVpM}IvxJ?Cnn4Rb3v!na7(*Y_IxCyENSX5!*1@%Xz^^Vt?r6Bi2T5d+olPtn^|NZIn)lgp^5_W8LG=Np;j-9T04yEv@*5_@ZV+tnhsoC^=PEVSTM zD43NT=tqiNGbYchp@Qj~Krx}_zI;z@ZGpTGalV^7s*jZ4$gVdQJ|tz^!%n$JcH|xl zR&Mn@DvO#$?N3v{{0tQDHxIh0#y=OM2ZLuHg?DdkGUst}3Op+r=HWvpp)pa_JHHY2 z+kXjJ@$?94gCm$*p#eLqAQ^pR$S{tPkn(}1eBV`sr$tkj#TLQQI{>etDvIgd_dVL< zt|GX0!tp@(MDXU<1#j(az)bdXYi&Z;2u(0`O%3gZ-H%?4LHBF=qT>mzuDkyiB{BC!{bHSs^tbWU&hB77O!CftVTjGW7dfvKg~e`3~QuanqAB|RJr zg=nvt+YI@c{Um5BnT*UeOrC&RBo0R4PWqIVO8dLJBWQ(e_9b1@__2ycl$!3`T4`QJ zauP9MJnv?#<0Nf|_5IVgOcL_1irV!!PkZN8{j}sd>y&xq%-3X{pToj+atOmVC zFyrtCb4XLXiweH14DS2wYW~5WT}L|(iw5CWm>NB&N>j))A0gADpm$h!0=5k+wVAsv zk#&hL7d_LuO(=O~DBeKm3@<+UZm5n#m^f0TjBQxoJJ0l!;9(nNT~pX;UQ@eNIAI$^ z|6QN3PJdTx=cP<%bN&c_o1ilA9J2kci`u)ugVD&$l?XBVNZ{jplDX)DwP@oLXn8_6 za&I5lQKUXZpYdf55(&hH)0kk6sQXY;B%LS&Th^g4D%i28`pke0MB;o?1mj&;T8>Y6 zruZ41=Ej-PIZ?s7&@sh?@h0y)6_7q#c9_ryd2mYWkJ6fYB+>3>(Yj+1`baBH(&|jN zNo`2LEkr^?%Om)>1#n8D^gqTTjv-ec!M1qCktM}BMn!*;55s3q!l#HNhKgV4G?({| zEJq5dS&}tui?61JoySga*~Ri?kM(m;$WBjKzk{POr}E5{uFLf5(uwFA39y=Tz=aAN z)$?}fjDzk9gst|5>k32!Gx(VD0n7AaCYr)t%2ltIpjxyH$p$DtHDRMfm}Z2dn}sJp zPSspZ8JpW-qtcLzo4g)6(|NKSND)7UaCwJ&MLSnPb7%X(MyCplyS_z)E$hYjj3Ir) z*T0~aYV^)L7(?`Bhz$rbExOHQddT#<$M(cRggjWb5QnG7LdYqi%5RFQ3PS1aBq~lu zw!B43WJh4cLeLe52dKdt4!|o?z?GfBVrbIHrMU7msZ;%J_VXhXnCYMRQSx&Nmv7(ukQ+yAdyFo4>2-`dWc+V1YZw_q5nBLz{v zJ=Z2}RE6iDLh^?lO?8vcC>^&b4ZA4yO(?Bu^(z3>p(NDWjmj?5`V~gBZ?`Bj_B>sX zP$UJ~1Y<)zByHM+oJ)b61chv?hTwFIV2jn5k`&q8)Y!e=cyd?)JyGZY;TRrrRZ+hiqZ;*%|{($&Py|KG-pmJL?9Nawx=YvIbDnyIG>Zba_<)_2Pq)gikg+c)%hK2A6#O3{)3TesNxEjF}+5DMG zMd`(#UdexuudO?}$fy%rU#SHb8qvtX_ZYujivq#s8>4M*yZuX4vYxKgi5l$%Lg3$9 zFlnfW{!ne&pd?Qwe{H5hH`(`y4qukjb*fSr87NV#d&nz1ToU2n1PEm$AC%ICdXj~Z zvrye~HyiVr^0!jjO86|3{JsF25TM){Ibq?ngAnp4P+Cg5-{p#v(#2gv_xRw;w<>jI z`t@{eHbNN`ZSA|gfT_FnlzO|O_;?n3&+mFU?wk$9${fkcyjC{0kPHAN_X9bD0y&ZNIHeUTC0yP&Tpp>H;!Zw;W|G!5NhVLsmu zJ?~;lUSf*ZVcsoAH)Ym#z!oUM?AJh17Amjn1?&X2YoMt z{Yl3lTQD(T;o(Q|K?lRJ6Zf%L;qf%#(NO;$57hBoy7Ba_@d9R0JOtb``{%umS8R=E z#&!7!PiSgSRK89`lTK_*PAnczH2F^k=1r)*jJ5hxw8u>jkdC(0P4xASXA@72ZH;!L zwSgR`vT~;8n5Q89Nzm)$y#Mr{rYWD!iRmfkmAL6~;i;_6X+Qs|UH=)Wy6IuL>1D^6 zQ?!|Vw6<*JndHlv8~^EZVc_M~%&hydr(TVl4BbaMz-+)1s)zxWM%A`|U*;vN7@eE=iFk%D$yE|D~VI zONuPZ0b5IgZ%aGMOL}jka?{f+0m~*Vqk#A&I+YbG^ijFKS>*Z^2d5DmmKBSuWf!th zx%d@3r&X_j5u2-(Pt&UbMk78ds~%*_p)At`EKY`33+Xv)u6e6LWNT6A>#luk+S<$U z=&Kn<^RXi9X>SV|0V8Bi^AReGdHHKJeQWUn3n3yK>v8Llz-1!(rk4N8yX_5|w2grL zRo}kFUb59rk>UI%Of567T+eUQ!=GVTh^nk5qmd);~jd`cdnfmo*vMrOV&0#S5 z{1(gdO#PP5^p@Av=B&}qs?++++xD*0jzj#;Vf{`?{B~CS+%o#Y1N!Fa)y_@dj;rCY z?A8#ZR*4X}i)6eD`p@ZQiEB(X(IaEkL+!wk)A~IC#&?s~Biq1( zfZbK1>+cFq$C`DRcA_U-{m0hA$NI*{*ndV`RZrY75Hs`llpE$=j79_hoLGaIF`PtC zRj&8h0#9u*POY{M^kz<1j85Ir&TO4ew0n8bozF6_4+HAXY{@aL>JAC6j{W*hY_?9y zM2{qtL2p6lN_i)_=qDP?CmgH?jR`}%CIL>=3fmh=R``UGB!@KLF3RTdM=*-2;b;|kmi|A3ypPOgmTbTFNf&TmOpAWT|FVh=td*UzD zwvI3h4|tS8a|!Esn9EClMhFYpMO&^#r?g3)MA8#;?ZjOdYE-e#pFav){=l!z3c~Doy)7-iv@4GkJ zzPGNsxVb)pW*>HVe*|nof5QOLH{SaX*dfXKOE0p>aR8->bjp@*4(No^1n=f0B32e{r-ak!>KB@IWt*h+|I{w}u2kEd~ zbzJ|}e7zPBKIy~+g_|7Yh#hF6y%e&&D6`$$2p{HPKxy^9as@tefoGly#1f3Pk^GAkbX^E>Kv)!S{!am2`fESJyPy&I({dUmnoCHbijZqP?3mh}A zCIuyBKP1vTN(k1|il>_9rH<>-*PxJqhQ*`U3!4!$ z?8h{d#OVT#)weLF3QmxPD@EorlfCSbd=RcGOsC~1Qn0LjwVV9H?UZJ>NXMDm7X~M4 z(>Xraq@Q0)0xh+s#7L7YKQ2=oz}g75IryVd*-7#2Pd?SJe$k~h`X z*3kzY&Pj{pYj*(D5272LT#Zg82N~h(31LFsJhUBPk%IeF<5l8TEN^m~ir&48!LC25 zn&zE!gzXI5)U$dcSO=b%dum0L2&2x4Z}Jow>6jcP6e!|7tgxJt)^{|9ek+lm{?clI zfg1$9lh)(GcsDjvjb}_)EdRmZsrb*Mc0*RoCXag$1>c|hnM4C2B(8|(RGltN4UBfE zUr4-YjhV`oBKQHr1-Ol3WvT}2v%XO?YmO(CifZ>kc>&ol9>qv-H| zK4tp?psVex5xzPW@kEWSGB*a?tCQ(Umb_L1Mzydc5VEZ}#Ud!$rJZM24XjDWKYZ?@ zT6(ATgWEZY<}P18+dcWP+#+$CcthrEehF3bQh;cvuUCNtT_d#SaL za3>O>;iRZ9OFW+SC{q0%lP91<13rQn&QB*4@ZHwAJ8;|1@(1KB2h*c&2H;HEZs-V@>Z z(?s?ArDUE)2Gd~4MQHvOkvz9kHsY2eMiy5|5QahiXm{xSinroBdk;K}KVvlZ9Onbbqzssj6{I9hAwZXR0meHljsN^%h&kXG_c*~MFB zz>=NnMRC?+#{;c3jai1bqkeUW;kLOrvAB+lyzYHeI4(^J@1^!f^HmEgKz#ojh$s}- z+>0lpRf4;G0ymwi7H6$h3N#yK$BHiTyKeO7G+2;T@m+}byf4L=D1>G4qDvdms@S!Q zlzZsJ%FI|uOUbtT81S5uL-iv?&9MUh*5q0*NAAEQoUO^ra|)rR>!qFiEFuo$-B_R zS_G#=!Fbb^xKrKXKRiuAB#sQI4oP4U0jB0u+GTV6gOr$>tL8skj8-B&Nr8Ggv~1(d zE98@zA^|#WsMt=7~);vknYn{k&+uS|x2;rEZz4i;kuP_tk3fiy;Z% zJ=)%xD!=t_^UV}yf3q4{Jr0$lCOFC$Gc0QDY9t5yG2R|3yvoN)rUb=UN(XbWfZm8) zd2?9wxjAX0{HV~cYQ?YRdx_9sff}bx#N=vXs;u zNP(%(NMRIH{?^=;`dFbsuEuX42Kk(aCd@0`@~@On#15Y@gLb(nVAQR-FwL>TD5NR7 z_s~E2ACT;twhA9|V9L*0yieVciwe=3z)^Df=wREDnrLr%o6^?laxE1n62CysRMBM_ z|I_&6n1qFO_+z(htIO=b zcZ}ENo_<`DnUqonr3WIn4h5q zL!?I(hyq2>@ixLkM0@1GBp>wqY)+AJ)kdBrE5?WLCzo2Wj%Qi6E5mH@rVIKv!SEN( zU#Shm5#9L;gYyY$ZGONVE}s|KgKLSZ4gUa-S$ch`kyOW@WTL~KF1zqzj}@%Kqmips zQx`mUxLl&837ER?4TYV@OXG)W#GH?dLmzwxgMSvt(Vq?-C5-W-Gmmco%U z4C#s`13>-1_ROCx+lYVeAbzg5=Kpr*@b$I$92UFfCg3vW558iR0x`_iR4P~MhpFm;&p-%jl#Q?H@eJ_>x zo55E#h9(S4By4}YL?($BY7YE3u@amf0z)L&I3mUv38F22lDNd=$w7U$Iy|jG0_s6z zG^GDs?zDusjy|a9|KU1l-xJbNlJGM9%XKgaad9%!KwJl(pa2PpjG&MVizFYr6c4A& zU$jF+nj1np1mt;z6omiPqWh2TQ2Lkd5Y~`~&<=TCa%llNbrDJk?NHJZ)Rm&sH4w2@ zqH)$>G}qN1l5Lw6_v{?Q#8{}$<+O$J2cfb0e|Zb z1Awx*uA!Ndx~29%y2H@&-@3!`|DroAt&}bQwj5TDdVg6C2NQ_paJ7|nan|;C|355; zx4YrLEXUuAr~k1W_Kpt!SPqN-vK#^bZ8%YU2Bvq#C7zhC_;u&A+BRGLvS(UKdwU(;yOnD zb{#{x=3{jlf4PnlX^88XEVY}jaa(Hs3~?PNWfG7L)XNr`%d1|G-#u3U zC*<%5i;93i4oIo;Uy!4t0|GhH(*Ct_I^7TqfgIqR9B^?lxTj}ruwZMn`ft<`bvK#% zJf8s(9lH?GvC#T2(Q)u~e0&@tIu;<2y3v1$4lu-a?Ce0gbpN=HU*~HO*Ku}s2AN}c zy}JCLu4A#xMQTnZkKgr@KF#gcbdVPYz9#$BxD_pFK~s zT+!nkuUehmVj@rAXDShkq$#uB9MuRGwGCAPkuO5bJj8X7dz6$#X_5;9ce4hIYnIXV zzF31yp<%+b@tI8rf|iHkNQDyU)msk7Q|Z+!#`5=%=fajZA0n$N8gHEhdKGMdhwCtL5X@P!NFIvjngOWZ?bUpg$eje!w`Sndl@_`O;j5jfz?usoj1xswKV*<{H*MdzDuE*HyM^0uliI&r*Cj z$JbMG-8aH;(JG27h)H~Z5gix48^kY53L{`l*NU3i9So8{J2?GhFT+3^uKCyr(HEXC zaFx6Eh&7R>DJbF9mG+~_UMfLy`j~oAF60d?^MDJ#&IY`kd{$d=6Z_#7x}+v^Yu#jG z4Y>2+Z=o2FJu584wYo1{^i=hwIqd5724eQzE7%l~%&r}q-4FGK`w5%n9^Z(=S)0#S z_O_$hl-Z4A3wx1D``R|n3v!FYUBWS`A1^KnOL0iU2jPuqK#OlIQ%e9Dnn}kmIa?`{ z>_dko3RIMhw7g?ji>ANUZBCLx$0$-?r6*jGWC^>zg%AR#Y!b?-Vp*@jy*u z3d77~FmVadn+8UxmOm`QO;dIqB1$^JpX-@n1?ytBimg1=boBF%xlA=A$@$E&5=zWp^b6gf zD}-W4+`{NCL+KQ8?0h#35&nJYpoGD(@bN;VSKyVUcz0Sro17 z=tS5z24do-45cBm4Zs2hp;;jX|B^9fCJZV>T<{EA_Zh|#=Z5a)e^D+AS;#F&EE7)-ah$^-yO&2KlM=XAxiS+F zmn=aBI}O7Kpjg!$DuO0+T;!RKH2G?fwh9^o!YV#>rz=hs&nV&s5>_Y&-pv2BPS_&t6 z`IUK!s7Ry=?lSBtDN@eQZb}K%sq|#f-44*yNFf9hN!g0OE_FIlHs$~n63cpUapH{2 zi3J&XTqQ2?>zcHNggQJ?dr(MjVMig{#Yl#~<_r8=kI=lb!BQ(nMOh135#sQI%I0(n z7_M$(gBjV<^!yw$bB6{z_2UCdF!eyG#UQvF%{tL8<+Q-)Ed(W>NX%}t^iQwGpnZmq zDpNRx?2xzpJ_7Q@hZIGy(`Vx7DAF>Xa>ZyWB{%o&LA!f#B_c{ixkw+lNoX2kN!y|p zMi}7H6*2r$r1bFgp8Bc>ey0COvl21OQ6ldC#2j>K^XljuW_AwQGUc}Zh<}ze9EU7+ z1<@XKKyh~dePQ`FOPJqny~NU3HDvkrcm)I+d{e;~skvLyWfWCY*ox*%=^w~Gmm(u4 zwPk$Ps>Sd@YLUWgEdmKw$dN84u|2aHU8cm<(lLMrz=3qZg;=lzt=?Kp$cOaEL|)DP>pgf#C_>p5lq>WO?ho1^T$;HWAhj z4{E0MajfXCC_*DW9{74)4P4mqkE)Hbv<1FQG1HEo$GCaB-}X)~dY5*+YMxaHhyLW& z%^`bt<=8d^b5umj)XfGg@x+Ew4ij{Ag=^yaN`*&yn_Z$?7yqG7oyx0TrLVA*y^4>< zzc?Z~q8x0(-m?54;ln(oa5ZK7i!I2huHA|(20UQO)5LtHPk@Ln$KoV_5&kQVR&Wm5 zPnCQs^53U0bbFEYUDZ#ZLa9$m>|8d3U&vvP0H0< zXVu0Nk^CYU_IBUCY#*pmM;11r^-^&TLJU4=xJwV%`!mnst;;U!=$Ab#FD_wJM`yZe z0Sjz($Ac^1|Ii^EJB=;Uk?+YP)!&+t(b<)5F2CO zxhg;3Fn=o zR(eFGlo0&KO39DVx`QXau<-iMr#9}KOy0GYaJPOC`#E9qM@@c1@@j)vCn4d|z%6h2Q!3UPfsS1UW#j_Fo+4rou_s|$hhnI&nbo;v#3e_

S8*5a6D7PK0;{hqyuSqEwv8F`gZtj7nu?|e7QVT_ zmq1b^|1zl0u)ks9ZGh>&VJcg@1pFMfH&SCkvgH&W z3)SItXw^X?$L7O5b(fVljznZ4T?;mfGzen{@~8npk)QW}F*8(!@P|>bJcfYZh3as) zc-Vv{hB(`D&|pOvZMj-rTEBD0^1dhFYqdZWEyoIqFq7wZ)EV(pdh{cIL}veOrC|%5 z9tq1whyUI*TzfEFuPTcDG@KJG9}36s{;m?)2nWu#vx&J~}YSqBt?&F4qmD1Km+?pRa|KLuG*YJz`4DP5BS|%J0 z@&xu=j=F3h{`z-dS2*Mo`V&xu9(6LiL`KDULsR%b$BjW>o+gw=+E;u?Y~qgoLSyvV zT_^NVuxXJ1W!u=TggD~zs?PL3}l7y_hv?rNE5jH+S{5L$cDq3AcD@123 zg}8RQ;yFK@?9A=cFxW``G#j6N*;t*ukatb~6xrzjpOi{jxH^IeMj|Dz-x}s;a_mH6 zd`Scf193S-h~9JAvssAqNGK)QnhO*;@C=AfSO})K@H$B_Msvt=%YG0FvH_tWgUF_H zNb$GuOmpx$x4Ak&@OlGq(rS6)>>P3_G_dBdyg*pKAUJtbcwLG-Qz!%rc7z0Rua?`a z90&ygdeMo)P=m#xF?XRb)u3riVFsSyf{TI8pqc7Ty1E*HI2>(fya}uDm{HGy>lvk zyDR-S{_Q#@Dj5M)5x!MXIaM*;RdJAk(uC)#r0%LQ_UbgjYLFV5VQO_wcXi%IwP9#= z0dY-f7xlcRp%IAM z2$`&%L#Y)WRPrGtTD@QjgIy7@Q9iA6$+l(|0Y7x}@68vY7 zH-?r1IKsesE|d8e+m3YmFWJ`k@pcEL(h#~1aVBg>(+*fX*!%Jhon3fGDkcsMnP3u6 zTs0FltX6yWE=Y*3D!1D^shwfGljNeEozeDDqD385VfLPpo)RVSf;_m*wVMh~o&SA5 zNUhqSw=x&G?jpUxA++hGgi@%djjs!F5W$9ByxyEk(iGnE7P&;6tyk$w2ly%e2W77@ zp4Lch_xMHDq(dm#WL2n{?mS7yvR^zyW?=Lxjv)!K(=OS2Ql?*~JKCjxG`Cl_r@yAX zW~d1JwpK`;sZCkvD@8^Z#&}o7KpU?_r{B?6^UVPa|1g&UgfoYMt*6@6FAgxmR35w7 z5$|AGcVROJ`zoPOn~G3s=KMl%J137LOV+a;cd-}5(U(loSAgiNa~QI(7&k?jiglQO z=7#??4L{#v$ZlasD-Te;W_>*$2K0gqw?M{Qplhs=U+g0mb;A(mVT=Z{j2kw)#4v%l zjww)QQm<|tsGoS$J8#stchrAtR3#3R(s1-g7AVkgEW&>*>JrlpJk<@)JeDIf7EL-1 zSswkI*E?}BCWJ7a);pfpI~tqUejYoX?LV3i*&n?G1v!FBgadN?CmIYV3iH})9YgD1 zC)%0EtEak)g(nl0CpumylSwC&*T;INXxh-G#(GD)&?Z2_?xT5Ab7-UA3|prSU1mwA z*Lp#d%#+KG&Z~LTyTa44o6|MFrgurFH-)DT4QKlOXRhnUGW^Fc9H*{cXV&v(ygDX- z`lB5?&UU<_-YHLQZ_WOBow#G3eNmo+cba&>ntjfjgIJCM=9xOWIasoJ9H+@g;h7gl zQ%eQ6OfR)ItMbY{t)2kI=-ij{EqMOR93EG@O-%6k3itqF&B8z+A z^a@0A_-xHd8LfR*S&X_G4~<`>$zM%08V{Xbi=SRfj~@jFth#QmQ}O^=+oZT z@{KkkuGWg@sBHdW-{^?n98%eA zpWf`t-zs+68f4jutlw&cY?O*@&%SLmk!{|`ZRdigS2L%#YwOpCuP`^9wpXV&TI<)6 zS#}QcYmd-p8zGP*zV^sz>lCtDy1mifw|#xJDd)5`YP1H`0D@Q}`Mkf@Nzrz8Q37|9 zATRBWzIXVJVFd0G7VM!kjKYv_8yoGaFoQIO_i2px=>qp@REJlKM&I(kzrWt{79M6) z9hNlw+jSHi@C2gsCybIoWQcQZMBU%6Bk*8pV0}YmHx7OO&%l8k#C5O^D;TdTK@`UI zw)ZQB=FX8UE4s_p_dg( zx`>{*8lQaXJ+x3g{zN_+$a>-kz8$#~`A*YUO>%Mg2Y6~*aB4z|rn@sg6a+(C1f^pD z!^n>6S$D+2dS;AqYFvk^biFqzgo*N00XJuDbc&#z}u2PBU}mBi>g=rfma6ps5qjtIAV7@qIch& z=P7pXj4*xxE^l5)Z|T8oH}u~xTjOqx4X>C#9d^us-k|PYgwc4!?tdEJ@P7wgHT~4s z0sUbA@qz{;ZSr$3@ZQkzSn=bb_!j8ob_3jht}b>*aeJxt6{Pd|L7)IpyC3w{zs7|A zU?K)JAo>fz`ImG7qJ2Net6_pE|5DlnYM$k{D)XiL=L1LJZvgWT#H-~YAPg179XtgL zJ=A$||95}kM}a_uia$Rb8y|CgTZ3+fA*5shc${_f^9ucNChzVO=`$kxvyn4gS_4R> z@Ug1!*{^@J_y)87`;iUSi)!x!hS5v=$0uLrM_UXimEIQ(<32;jGia9AmAYp;(koK7 zBk0}XiO+{ilb|Xv`Rv^Lw+_rv)S254fp4n4P|Lu5>Ad@uB*c}upQ?Em8F?qoEWe)` z_F$So=(m5+cQ7Q-uvUKPEuPF4NvI&>vo3L8u1Q5<)2f!~&F{;^5wWc7LtMvb0-{U; z=~KhDLK?(%Xb}Y+!q_u58aaHJ-cSjly5q1UR66)rBoS^8r+-haP)23LnjgJ*rdh>j zlp<`3doG?wy?AGM3Ov2|+wtdB|S9JBam*|Mh^n*1|IwiYYAO&viFw;$i0#ZrI&=Sdykt()Y^u za}c)KLJS1<{Ykdq>%jxcvD)A>UZT)WwA=^AuyP_Q>%!heV|IBh8+GXRVqp{;?;M7tdLKj*(8M=eB z9bjym8H26XBQ$UsjpVH>m-=jqx4=M>+>$hkze-dA!iaQVK;o6(sAi?nmPRO~MTT1- zuE=r4VXvEsa;5QcufvgYH@v&+_S$evrR6_J!!0idqAVh%%v4`|ot5E>nOBVb-{xhG`4gEoUi!v zHUgui5lzVp1>BWq4R2kXcbb{O8wQhO*GWTX<2&@#n+mR5Zu-`CGDOttF-qcBipf&J z%Q(%Kgx|M&7Ws8Drm=w}Gex|P>uGGyhQ<#ye9v5Z${0zVG5*v{L@IS@Wc)#*f zpzV)JZLd?O-=hqTW&g|ee2Tf~+jRBkLoTFhm`B`O?O{Xq2@{wDcXWGhln=k|5Wz+} zzXzhn*ns!B`SRC@?@_-+^Bj(w-U%;$ISs<1hIKDERFoI|pbrdZwk)o5c1;Q!!=lDc zGkps=tV7)ii&UbSUFd8lp&Xf|*dm-nPmE$qqfd@DaNN^uw?Typ!SZ~JQhrnQ=3sSo zv0Je5SU8T*)!SXcTs7cQs9i_Q9Mia_@PM(8t~M$#Yya%RrAw28J*29xsz z0_@)m0a-(&hr6_#C3{Mi?9^F9(g>U>>dKaMn%R*1DX#qLDNAWCqNyTlo>H*OwC!yQ zX}9ngYw2K|1>>S^9W%00LuNIe>jbfKZ#fUpE6MMXx`1*ra>{ZAQwv6+@MX(J?1u}c zXBD+lK6g~fU#`PCGJn|ZgBaPfS`>y{5ufzw!$P%W4lud+CeBt)WMVcN=UzP5HN7&d zZ2rONs+7s<%p(nM{09+6`E{?tBEVNOkNmKlD!z;$drXb@SgVSE`;5YcP=WRQf^LGy zUQ^dMF*rq&M#QL+g=18!(z>lwE!^_s@*@L=y>=bOQH{Kdb;lb!wiYUhgMpBiPATzW zoefD8z~!4x$FVk#UiY41^GF2l@m;ttEwj}lqsEtXj3yX~%_fwWHE=TN|03=#|JryM zKHuY^5Fl7_x1z<17Wd##yroEK@lq&GakpZ{p+M2#4#6R~ySuv-E3)a&uIt*}`#$IF zJ~;Uc@?a*f$;^8`U;dH@dC2Bdt41oxSCzE8a$4%9)#t|FCWBaEVj6tKDE)l%@%yPY=Ir=U0DVKejn?(KK|9*F=bw2$XekzUB(C|B zLJ83w-V_;T@2smmg*?k*DeB~Nm}oGGx3+I^Uph*sXE)jya5>k1Jwbetm27#`HvFhD{^i(9JY*-(hyizNv zGjKosQX71^0F83#6r?=y?&d#$VA+__kxjgBi@(3K5C`aw_+dL@=6|;knRg{~O!y?S zH1H1DW~VVwiAO7Z1OT?sA5YnG%=@(hkPOnF$iA%16FvlpqexB`y>lu;ra@QGtR4$* z>iwbYxvz5UgP61BREju=@N&mz-0NDZ5S0tvnp&SM^j%dd6~+F@n5^e`S1$>*a*W)I zJa8cgi%3Y|Fmg#G2akLU7^y$SGK4ZoLWQ+=)b4>9h3K z+zpUA{m8!aB3hD-#M4T*wb(`#iu!Q!y4HKuF5pC6Uu4B;_k0<&eVvbN?Ctvo(46nI z$p(LhNi7InXQis{yb?TXf_`W|FMbZ=n@V>sGu+O4aOwHwJHMByvja$TY^2+q&R$of^|1qqPv-HMIDZfjn}4 z>EA?GQbF!ywSMj=aJO!=-I%d#i;!0&dqn=#-s|1|OwNYKv8M$Tap~dnx2phRl2<1X z=IpDk7wN}QkB!4jE$OktxBCExyJfy*mm#Ur&0Q?Us9K@D0bUa4vX}gun~aR?KUiZW$qiIp~s5iB3UQ;kF>?%iU&1qQf(Q198wt zT{L7vG;?`zb51l<;=s50B6l4Ep2WUa`(lrcO*AeItQzcmu^jy9VyBhjXYOL2g(B6N zfjnh_7zAx|Qq2ghLY16tRncg4)Xm+dZJ6MueXAI!6bU+A33Bqb`3~V2HO@UnVluX7 zYH3lT0dZt5$?6_I`T;0|nFtXt0wq+yr-%BcNRkFDO3c>YK3|54Ao=`2m39wnr4?Z*?Mvjz41D1)#R`^UB9G+hPg-&hB|VT7U4Zg-O6HW86U3EBY_v#9 zckp_&?LQN$!h1?e-zjI-C=c{TP3-Kmid5q502?+a1HA=vIxCrR^P&Tpwc6FS8Z-_% zniDA}+r^ln?K<>b8mSn4nO&=T?EC_qhW=efKq;KB)jTXxhUBto^D-)05&o4B#4zc1 z*0L77UH!3b$#b2ShV@oJ1U->VO6U`F0+_8wot=m995V+4OV=m=I>)%qX76?z$8Kj} zoeTUbo21+!2j-qy>*67t@k>fPC(!Cn&K|R;Hq574ysNVOtDm&|Yt5c+tDeVLD`|^3 zd5!Fz+76*0aPm@^Tm+CW(nHu&8siNljVIX0o4mJ#Rl!(LGs+YAxVMr95X}o?rCKONT~v5?K=W*K|sBEJ!D@<-FQZ+H)V!KmoUtP>NK6)i;EO7G$6zuraQl z;m*!9R%Hv1{#-E0nDih>M0t9lvua*EDH%L;F)$O}Svn4eu_-SMC_mnWwMp&`4&N!S zfJF-pBP2}}Ru&r89VH-PO2)JOTlBDPaFZt_tsbH>1071O>XCF)*}oWyL>Zo=8Ct87 zJ=5ye3(q;+P>D1cKDHi~uNa&^5V-MxavBb%x(+Xd58s)o_I+ph1y%I`jv$QmA|5h7 z-l@7tsrm2{BQdCc^ivxkP$`WW4)Gs3i&LAG9FbU8I{)pIW{Is3;C`H-*CV{Fx6>icJ&0^>YR_>XSU{z?MT{1W4%Ry|yv zLoD~tl!E>Ff94B{4wYy5%eVSRRg8+V4{}qmC9ONnnl=sw>rcp{;2LY2L@romr6(LdpALi4^)lA=&C*k7@ZS<`dU z1vnX%j3Uy+tkb3a-LXji9xb&&+jy}{mypFRc*3={;Em{1M!04wQjq*+P%8JU_f8UW zM$C4>C<>rLi@_yA0-QB}XVI@64DVoxVjPaG_jV%M7wonthb>E6>Zp(y>{q>}5z>1*@q zN<;rRbq>=?*NUAJ5;2%{Ssg<~~8f1wu{;r}VVy!2;(Z9La&&uI!CgN|^-M)u

+KL{CE@#6d2?N%d#G z2+rJi*y#9qSzZVU{At{{#JT<_<0h&o^q?c!|BkuI{1q|!hq-CPXEXkc z7#YBs8@yoj4|CHs*8D4C^xrWzb+~b}v-;gDf*Ut@ugKj|=6A2i@$X)dlm7qOD|&DH z?*EN(v$r#WCyPG0Ist*<=;)7xgpdF1u>M!oq6{YVLxvEI@#u)H#>=yB&KU!ceMRXz~Gr@lWICSjgRNKwu_Q3=X1qj<(X}MKt7l&G1ppG2Qlg= zh-sb*DU*y@9q}r%60u6|tA?E3q^$x?{wCc~!PTw^T9vVUW)ZD|{Ty(HWIRTPrFL;$ zz5Yn1LhMw9#dw1!S#9W>2KVEwE~W0H({R!ZDK@at+G-1#;9SUgVlWVkF3{|e3!jCj ze>lw|*RuDu_D-tE+XGI#&8(5E(s)I#Tj|de1vMYN=g~~`j5ATmh)u&mWO3Ta`t1tp zUH&jpA{~eRUG3>l}V$VB@6C1Txv~w~1bnu3DK>3<*XQmg1lNFd3>J3u4kZzBA#c zvA2ELW^#q8&3z~+A7#ok#c&%nki>R&gzSA!%$4=AES&k+nTEflye0M2#KYuuc+JvWdI@WqFO$mi_taFDuo6a4x!G$t zbkhXgc6J2f&35Druwa<$C4-BA?8($VHU{Djg$dpC-@;MqmTDMm4L6g2F*tRSR+p3? zPPHwDaDqXv!@jo$m!|S~zFJSY_rgPaDi%)7S>~G%T1J3D0r$~ z_^#^@;}$)xv5;0+Xz`K}55h&?7O?CMSV|g^n(vgs6M6zgZUgY76GRi;RKtxMc*uUT zw=llGOKpg=qZ0D%81WUc^olmhL72JM{`*)J2l7hRjjxnd09mz*hT|c3sSg53xW)*q zWIcO4Fr_Hw=x)l9i%`TN9!bkF1p4XlURtjtMYBB(JkzuMTV z2>>FXZX^I?{061d*XPRB*hW4v4L;-`CAFYRgY6@K^eE|1+$p|IP0iK5#Au8c2Yu$l zLu%M!jZ}6$koU6aNet>2UigVB?e}>lQ%+zevG*g675=ycNC*H#Mf4*|R_oN+x+WxI zT#0n{cndTakh+S0?j?Nio!ULPSrr}SDZ0|jzL6-1lmQM-Tfe22-?tzT z{lm`ZROzRzM`a$zWfN4bBY z4Zeq=_|*Gq@_o(qK{pwt<YrJk*>fr>&%!C@~ zCY4pDpXcRy?mfyg9L#zOU(%}J=6Nz?-)UNP0j*?o|JY~YfdORHDlabt2gaKP1AwyF z?q5w43Dn@m4e~Mm5RyPkxiY4=SMF)Dx-Pmp&HrYNH?JAErGmK&>Wu4sc@hIeW;BKy zxAuIw2zsRWZzyEqph6;w39V&GzQ~5R*pAVu8;slml5daH9(~3XH1|}L>9ZhZ3+wte z!BSBaYZ;FyxtyYK&j-%=5{Uct_+n3<=@IRfea4MHaRnzzjP8YQm<>dm?oZ=}mol+M z@KbxJu<8X~G!t-on)~hgF^Qt`%I2)ZO}1c8nku zUFxX^r*Fq=uCTBlECTo38oAUo^~nZDSp;9XwrjW}%MF)xNu~X+>x<2nEtL$>Tw5?+ zY&AOZ5jPaVjoZLe7lmgmX&`j`jngnfH3C$oI^()qAsoJ&G?qzOeSU;k+j>I-Iz=pK z`BJ#CCl7=pj&h^CIumT3o;*Uva@T=rs>+Fan2}_i0B+*vV&J7cl>z|jhCowgAYLrS z@pwqT(Qo5c8etc1DuYY>2pKAVMNR~5Km#zbTQkFr8{`k;ruq~ZhgrBflN{n@EB-9h z@w2)51V-)AA&}`zYq=>oP(z(MCAT-1FT^!jKKbGJ`wY0@9iLSM>Q;HI8!`$2HBZBy zYl!R)ys!UDP$~daRpOksYD4-_+D&N`-Ft*qB~G$mUdFijU3&<(AtHJ_2Nu@WI6Fnrr+u|&P_DYz?uPGtT z+MGl2mM;~H%|e;}dryM?3yQh>qsVRjB`AN1 zC!Ssj?+Vbx^O2{p;%mcFe7`h-ziv8KRzCtddN|q>yQ!>bg3R>!Kqo41fx7Nu%ZQ(h zk!ActFu|kKNI#Ehe=m02qM*)b^y*Swj`UROIZ7=T3c~&eZe(=ZPsCt@?Qlzi+xPMv zK(p5E&0pRN9qgxBs{ISeJ-!X!hAwi~=ez>qQlQyhwfi&fArbEs-0M8nN&&WG`XEWq zUbu1NHB`4;ZuNm1H{_7bL(vz@3tfw3jjBa!p@}j6=q7&{H!!wG&kyYRz54Hc*NmUt zj-A$)N;^+$k}oQm-oT9;rJ};vZ{y~gp~G;L&se(~m43x!CgL!NsGYGJO~eQ{Zt8h( z;}%ngjKrbU*{mwY+KhcU9PNv5Li|8M;!Ta6n9PF6GIA#P=vpiMcvB>0TxjOz?Ce-j zi!#N8s##{So@Jq3Mzo-VzVt#3UjIR3;Cq#)CcXJ$@0(YvGsZCy+@so~=(uts*j`%@ zl4O4Q6@+Me<(ql+h1}b+K-QZO4$DT6XG}a<#{EQt87la#@bUo;Qa-BA{+j_V6=Ob> zJ5GKw=!h1`$T}XEM7AR)WVYR(0c*aTJ72i3J&>Mxq69mKflw?Y=y4K^Rx7x11gw0S z>>Q+oKeuXPAigI~@NfTY4(;~0Z}(Dt_DQpj>~i{@;0dCRE}>DKui;FA*-zuX*nYT;b6mn`_q?}p`2x#Ox?tBgy3o{Ya`38C*lun&UO8dxMM(3c! zU?NZqky;peYuJf^TaJ#~IXZvawc>cS-20z$rRV%=)S!nMG^|G&z=(i6O1%+Uul`4B zRHhhOaFu^ktxI1*DEfuh+Y@U-&M%uY_BIKT!RUT8y{@!3z6>ETE3$qjbun%E=rHF@pZ470JjRwcQm}FB(-@4W)+!1sFuHh)4ax9$CN}Ss@xl z#~Zcl37RqdHscCAaW|WB{{#yG<9Gh3O)V4k7PF-_V-$pSvy0gRzcMDxMA*x~!@vURXEv{3 z-qdGe?q&RL7hz=ew0`ez{m$6;{g-PNlYSO`C~zz@i?c72=Kr=`^nYsHg!29WHg3M8 z*?${1(t_VhtNH~AZUv)dK)7*Bh8K`BsWbmHZiUnt`hOU=hC;~PU&bvz6!ZVexXl$W z-4?HqmaGYttR@%M*q3a$6_vXcLi#X|Zc7?KrKc>I4b+(BAk4BAjM}o&yHHG6E9MA> z&|P0C9O6}om!@}Mb{WGbYD)o_n58Ee=_^m7SI}LkL2t#;A`zan$zxWjVXlx=9CjA4 zVH9LA6I+*|l@a1vwW9fcM3Wgo{Yi+#?2WGTcmlo}Gq2UgZ*)bCYDH%sK{5iRzUGu* zHQ)rs5=1I^E;CoC6al$Ivz_7I&6!G~?XBfXg%;*>3?~H4m2`7sttuoL?4Kl@Ouih9 z?=F0**PLYkK3Lx%R;y29n&sN#K@2FUXarLbt+z45psbd7rQ`S~H#PgzPyq8fo2Un3b zl?&I$r8LquHu8m5G_#uP6;)f?qai(Bun6&>=!m0bs9`ktLWLW}S# zwN~|0R&MmH1-@@}7RaE>m<`Xmd0yhvv6nY zwzV`ML)(hbR@@_Uensb{V4w}uvDfHeddT?VHOjkytWVHu4gB!$!eDNq4VSHS8UV_V zF5D+bV#XxfMHrQwn8hO)O#Hls`*xgi$r-(9lr;{&hY*Kk3Oi#Km{1b z1UQhJ*WU>pND%3Z6Yl95Q0yBRn1J*^$ZJc;2T6GbCl?024hBAA4$g_NFB}YRg~O)F zYu61OH{r$&I7HDnWX?8lWH`KY(7(nud}uv92^?;FHhd0-+=-0rk`E);82=I(={y*o z_%?hC9>%a4LRI#h^%!|VFHp8tWWTkMNGg;Ma>@L`koUKX;bOplg1QN z@3E%iz!NfyQyYfUpPPCdil>XduoB^~j;EB{JItNRGh277R+rahILYooN@cqOn z)@;wC=iDgd$#leGEd|m%1!S=pHZD5f~?x!whI? z9sl+Ekm!b==puLIc#Sv$O$kzC+SJwI>WwE7H75cx0us~7oTBYCIDPGgVy=&K)5vI3 zbZF>J`qbO>EyTgaIFIhv9$k*Fw?BJryS(0ZDCzR2Shs!H+A->NeYxZRddJDD2mENe zsc*Aoae%FTw-Zgd8}o8E4trMBE9>Q6&g;Egj=edxy&n|o z%12vi&0Tqv`xP(ubG)#Y$=5@hcdSZa1uFZ^5BuuYaGkl)d%taqwHgPe`c{T7{d|9P5 z{fwpMj7@bTush?Q)-BWIUwRHe zS1pmS)7Ew8F9$qt4n4&7Rl{K~zs!;@U${PYPrbg*D*?0*b)kHj^@;jv+tNjebCX*F zm>cTCZkYmSY$f3wrGDA7KDjXnKecMQPBOav>2>?V3+-u3m&uo##OJ4>*2f5HSko%M zo*(yTtKLRDc0;2Onp+O!T2Jnyudl;@)r(y>E*~L`;PkW{ShU_LKEE4zq`H?Z?MZol zG--F=d%VBm4%;s2U2GZbTJC<9an?_XVCZq*{Lo}Ue)$~w;QQthK5wLf13Ey#HY3Vh zZu0_`;nL?TlQmk;UYLCfQX7XGH@;DgseiSLHWXs(v`Wlo9T+4Nxl9|f^~Sg0?-QeT zT8ncrHCo{^Z3*|NuB)3q``s?mDp1O2H&+SRja=1+=wZRk>?6KQeV(M1rJsAgq#mI% zSz_+ay=P#kwJDUdZx1(au5`8$A>!6cA*Q%lQej_B4LU=n+ap-M74kQIWspM=pR{|; z?~HrI;=xs5GV)!M`}3~Lp4o&etLmWhjqO&sdC*7MM|a%|n*|DmZ~PQIKkfP)4Aujb z`L{$J>$#V1Q|If~7B$>E{DI^@EfdkJth&hrOk|QSFvbhb_itSDM)g$kZ10665$0}b zP9l>nw%QTMLUPNOC70y5dm#7B4-(x&tKKN`r_V zaF7QUiZYhUt;Ddx?=nB~sT32eEa>MD(!@Lne-t*Qh17`B<-mpo@*0_068`O)5vXkIJ`If6nypYH4XI|CEGpjq~QdB}Ub5F~8oG0gpo}9Ccok(ejebFe2IU zs9H=$k$M@oO_oc1VZW#~u4Klf(I4S{)#ARUZZ=z=UR)vYp-E(~)9RypZpLfg)k`kB zFqEr0lYXb8bg!rCFUFP%t#n$Q-}dpayM8Lto+s2huz7QZv`_T?6AVk>h2`z4dXkf> z6mebaUP?`d3eWAuYUfUX41VY--=WD$Rs>eAE+U#>mH90f#c zRl&n!gJ$nOzT)OiEc|)BJ+gDSSr%$OHvRswsg=-DI*gn4+lLyHBe})zHbdVmdm#z= z{qDTCiB@^OjDiOmd5zK5Yn=OM%V9IG!l@i>!h~|`cPaZ1cu1!7?K+3PMTMWv|;2HUg{rRuXefuuPZy%he(n}4_LdPx# zZgW2$GvsXHAT9pd3Bb5|bC$A};(Sq`hpl<(GYQEEJP&)r-1SpR@=_T6>t0NYmlMXP zN8~3>^!(!G>N0ABp=s?f+6=F%aGz(Vq>uM|L=s8TIeORG21T$nn)DkxKZaQfF6-q)Wa=y#+eZoAJ`)rhSv=OYM^G2M-u2#6pCay(A^|t?^1vViV{ZqyLl{c za5WbfC}J5gQ5F;_Ef-^@aI zu|VZrXDrEZriEz1M^#JvSn@f41;HMP2#ZvnG`>nRL~SQE|5t^{8Cr?pgVCsr5PuGSCMG!-HFYOiIm)Nc<0F;X~avmpw zmrdfRo-;&%sfil;Ueh(E8zu=`&l{c`UCNItGdq!(8m-x0)e)%Mx-2#>EXC-kjQ{*# zB1}SjG_=$7%lzom<}a#S4#LmFnvk86Q=(<^yA2E5-tp`d9}=#W>$+;or{b|bpDWNz@^UCJo7R+i zd_#lxh~D?3#~K3tBT0wIk(|B4xh4o%yEC>vFhbMAjGRfZ7vO#LC2fG%d1ureFvXn^ z1=%EUPJ#w944PHCd2^@S44A(yu_nzw#gDk`z1$$W; z4>FfE-q)Pn^o0y@CnGPel*TX)(-xv-F?*WwJ|`W285o*UuC(>?3+cpn#`gSQrh7fw zuf_^rIfjxgX#O;O;b+pa5?Z5hn-uC;Ak3aXH99Lsc5Qt0Gp3fejQcKl)s(YQ5P!6^BTf^=ID=XeOY zb*Ivcq}?KwdkCy@kws>NHmZGV;7@K2nrGNjvnUy@CSQDd%-Cbv{Y2QX%&BC5YF|HH z@NLI~Sw+7VtFWqY=ydu<`s3v`dz%p52Xw{KX`?Y`v4*8Lp3-ek7I!`{i6nfVncCjd-#lJAK{%{PAeG`&Y4_4Qwle$!|hcXtX@)YJzGX zI4!JwT5$EqbEsT0_i^K;qx+?2;i}PH==@UoILK=wILc%88~H8a8_(B%s<$gfrnjTh zHAtrTZ5!p^7qA? zuUnfo{7Br=gC zn>69R^hF_S(P@c-mJIwKdGvW?kQxhEjav&B1gdenEmX6`loh3X1lFst5iENl{PN-ctU#M}E#|#Y1Q1&fYuB|s* z8-n3{C-O-|t~l*8$F$95P>#-bzJ>#q@074*KHn`cg5J;@DI! zQ)g1Me~}30KxH3KGd(!Gk0((YT(G7X_f`?Mz}yWb&IupL=I#%>QRtsw9*`y;TmUER z4S3#wN3;rBat6jk3afnwCcp&^mV;?$@v?<94b6 zcUSn!Un{SLODP7UfaQk-;{4?i0NWnzp27a|prBo#q-)ubYtIk`5C8{m6i~R_LOHE! z`)#%ahKW-B*UeP%tA^~ohcQzD`*DC<5Aly>L!LdVC@4Yl(I}77;_Es7h^VcbRsP84 z+&ghYs5WJL&>?_L*xYjvp*UT|>|LBE0_`a{Fs^)dQglLE_(nUw;B9Mj`A^TW;_E+Hy05Z@D@A zvE^p+*Or^5nG}4>&CX8J@`K`^{VzC-`n}@zUdG-=+x_Fem%r59o&H{NGc)~PvtR%H zgqs8W^U39-`zJ?FSC=miu5NB{8};<*|K3Jf`NDTZK7aOcbMtd@_4Duu_V{bv&4~xz z0xSQ*=VL7%=%MK6t_OEg@t)cxJ|ay4ynimbee==z|Ae9bDt`sZz%f+QS0y-x>ImhB zW2ng_;olf4>od!g1KU7r0ZxuCOeL4My zidt*x>FF678UBwgx5XZK@atx?_fHQ6*HCZ|1s`&|yV(9`$ZfjJM=E+H)z1-|B~|le zFgXY`E1xQlJJc@d%)M4$85ja0W&Nu{nuZt82#hDf;i$@_ z@edIXwwlOym8{Ai&6Y`_C*hV3!Y1dpu0xQB-wP_zEq54coty+<>&kW3eeICPV^SMa z{L1}ls3JRd5P$s|_Wdx^5R^w(DPD0+)I!u<)&E^)Fm~T8Yd3qSPY;#-^FML&U z8t5Lo|FegsNUf08wn@MAiDwVc z^KV2;;i00*O%q@!A_m|qO1rMS0ZhyBo3F1abm-S`?BJ@Dkq@ z7U1i=j{9L?@Y2lm!v}Vvce4ImZ*}E`9o1n>kv5OpTOl9&Trt8pYE}>}MDKgizIjTn z?u*;Y69hym)A!STSG*1e&ZgvoS3RvN^vnLgHqF3Yix$;`gZ?@8lY2whp*r3{gbId=23?F>!_tm9P4#Gtu=zjBC*8 z!l}9IeOFicDOpp(${cX3-Erm2({I{w-z+>1q=g6_&wnC)L+&$PB5=WCnJM3;qb}hi z;}tZnCd~FMRvWpXpS!^u*BIwR5XUXL&PO#wR06F`Apm)5#3lOE>ch`eRV_{25@F*; zwTnc>64D@!R6)Pw+0CL)O1?V$nrY8@y{|zpNd~Xg6@F=}Q4DQ<_mqv3E4H500rW0k zze!VRL&3`tlh`Y&wB?tryefx(T{cN~DqD-)k%q>r9~Y7&q)0&=_CCBm`7Yh#M8mh$ zP{X7kp7gK57xMTS&vc`xXFB{Y?^XbZHk}_5!gRmeiu+OjM8J#(p>e8pw?ECo_5=us zBVyPi{47^>B3wbBd=KAS7FffLL^r{CJbgh7y%_!?FRdr{{u1G<;i~r&EoyUXnLNWq z1#|`PcIh>qWDI@#55BX;05M&*AZ7MXDI+qR32iXhQ4_pvrHorfgbw09&cIKdG}yaD z((>0I$>vY!=)HBt?vnc1<-zpz9<_yx53QK*ITZ*@eQ88gyhO}kCqVUE3- zXrco3+_^G(%HN4W6@gsuM@;Y;%d*)RsQdMXzDDA!rBTzAW7%Ghee(v=)0`63sxq7< zB9c=h@5G}is5n@}(~q`r?D}kbqN!!yn(33uvH?w=hr6y&k`Fv$ZC5yZxH=m zraGa#12>e*a4i#EJ5%z5MjeSrYw}Fa4u6Y_s4#Ew2iP3$q+1m!qO$MPy__l5MLi9d zKJ_1hj*GJo#9(m@?%-b+Qin&GpeK8_&QJB$RMOD9GBJL>G2cM~>Dx~PGsb5v80u4` z>H~bWjvNLm^t)c_=RhR=(&!EgDaO0oF+5tWEy?tHKJUs^ar^pR&7&6*YgBcS{LpgJ z3>Lq+^_AlvC$L2_JTr06ihs2C1scuxJW1W2R$*}}z{9##q&YKCd7~8a==2E{APHwq5$PSh#`Ey+M98w z%}GE#6lYocyZ5IjOe6LIl!@YqhPDzwp-O_>a1!gxA&HpQDLRINB$)NPb9(+!U4a${ z{8(a;&j}D9I**7G+EZOZh`94whd47pWm0aa6RfKz_&vJD!J`|Y3X|9yk?0!1Lh=wo zD#a>aFjP}heXkB_cTJ=9oTyIL+814Sn{K@1%ZwdRkV$^=+O2X{f`)x!W^A4zOI})? z{lpsMfCVkEq9*!6%KqLz5@mkqvT*#yMlQq=5Aza>+}6|9G0$Mp2YV;R)p=)EBr}iV z!N8e-g;Fb#oDlX%XBk2=a{T2{Ui_vY^p&pMCv3+|WK<%GC!f;~ZC@A`t!_#B%y6I9 z>Um7tWf%0hvG0tnP1qJOPzTA3GH(8mS78E>Cp4WPvy){aKA=eeS@?5`2DT2~Z)5D+ ztDKCUE}#{8oevlNJQ0?n5%3&x&!B@`hy`608&{+Uh7|8i_wAkp58tMg8Gb1BTSPWt z`W0;!d)Zgow4yb7BZn;FtP|+|MB%+}XVN>s8Yt-4mNhqT21_jf6$EIr%7PMwUe9Ha zZ*tS1GWCtPAbS`gQz0Ox7-UmTX}>(QY7yMxd7hx{-gq9ph{6zU{B%@`21BYQ##gQM zR{RCUOyFenBR8g7T;!vYWxHmb*gh*GFjp ztW`8C!A#^CS~rzwZ;U!`99dzOaZh3*A9Wq^&QD(3-@I;M);ufLQA{4Qxz9>Ie&TyU zc3b6lNao~ES)T?w z5$D@6z5M_UPU;0%ck2AR2to%_8?u2aqEG6FH`7mUeIet&HzPg`r@;Gp|^q>a7R z0V@+x>ubue6VEB(U+4HkzpS8jaa6B>5VB#N}1GOvEPyR8>YN!eE!x zuht*YKQzdp#U~)5c_Wk(yXMzK(yM)8ypDVih`J*}vdgnyow5wc4_@6;LFbG`_kQVG zCDi*kiiU~!c8FLyDl-~7p~S@}FKH%biwuwucrJV*ohpuDj~=N;0w4AD8N76QyB*+$ z9zb38g-p%$_&SK?LsUUvRC8i*>oW~{bB$;58pbjqw)Np|pl{!<0TF87#BR{Dqrct6 zeG}V7k1!VV6bIPBC)}vfw4;%XN1jY0Vn_$$6_sK9sH5O%dtz$*B!L=@1p!T04b{LH z)o27&i5ewq7kMOxYJHuQH~ROA8)P@h2(Foo(calVp_Rd`If>bWgCVvX&%BYeGf}6!vHI#$2WC^@!JH{j+SCbfm=ielA+6;EbI=uQIy1HT1ataB+SnsW z+OS~y6exXa7qdAtb)h$H_$K{?B;#Zkcu0bE=$diZn+k7!UCyS%BVWHrGS37vQS>v> z-2Q(Xa^oP){A0-NKQPoC2^M_FZS*9=dLq}h0oVu1>x%|D6ao!mf&X*x>u(HI7ya+S zuYbc(iOGKjztV3D{=!iI1i$_bL;Vx{%D>I4DJ!bm%MaSigMuLKg_xa+kcv#q3J_*F z0%nOlCOr667Y&4}6}t3c4&Oq0ynz+=kOmN>CmPtp37NxqSz%P2Ug<PmqAFSf*htAO;MHkY*h$xhILn|?PR%5 zSal0BvOcU@8-zxKSJTI%V9tvFNmq+#L?`VOr6Z=+_M|QvKIFC!KdP!|Wl9}Vf>rlZ zHyt$X2rCPJXj=F(T54eU8jwiH*lDAnkX?(1g@I$q8l!&IDE3z+71f{YGHbfm5+&3E zR?#d^gx_&L7dJ+=IC=7;m2vg7GPWRebF~2%MXiFYKHjSSqkCgoQ0et9GwF0Aw=kgf zv9b2_)$^)as92-5QEMm`LR0v>+qiIJLQ2$(L8-SJ?xNBQu3t^oAZXTm)VHk>qD2@5 z_RSx>YxF-Orj*wSAl2idHz$HxSOr?1lN8A2HjdAeJC_06sjYbt;J=s1^ghr+PRz;? zjADD2JB_;D1UpxfZ?-D{?=q~#5v=7CtQ7?8;}h(&vX0wKoQIPRv4sv{AkMLU2gsud zZ^8a6MkjcoQ{}Ex4cK+c*>$PbrM>Wb!cA?VL)5xUSfuL|)MX+96A#A$SvM+(I4gl+ z)(bG(KZe{IK`rvBF#8(V$3KH#hA>cg{bxvL^jx<;Jot6j`H8%R(H27AEbApw4n-c0hoSnH;=gWjm$7^*kKy58HcuivS+fV|&Bq%R>1 zR&v*u!PegZ?Jfe=)y)+jvq zRRA8vUL37E$fu_0Cu47+XCGwr9LusEzJiXiE#`APQuHxnjo^q5^Lh5r4vuoCX$v)t z2Y8H&iH?V}OyFaUvlvaR-;K)K^e|Jjfs2P#?k7AK##6k5uDPg&Xwzw?}OvY9q3p0Hk=dOtXAN4YFrlD#6m-52KJq(R< z74PLLQppUa?edk;qBZ|I{6~J8kSqU=w`SsPPrk;vAziE+8xM_2nh%@CN9(Q-9P@`QPHc4eTh^G(>y{-O62NVH zj%^h%&?$2GP2{#1WZUitO*Iu0^HF6pqiKyzWyj2RN5vz7Gh(%aedl3i$E+Ffo?}-I zvUOLS?-{;p#(|>@#m4kng0k<}a_s4)uZV-U8?bhqOI8gQ);Nat_y#t(j`qY3whIq; zGt%=tpdEC-N7~jH9wDk{h?zcatKXz8hsgtuX@Vc3?PcaA!(^18$Pwh z?k>VU<2^#NIKnxJoMw9ba-K~A2?%()wREfk z+(szFvQt5kK0b+CIBzmKcOAGuS-CJPL5n`ZVR*ivReGU3aPbiR(*S3e{`tAqo1bD- z-K?rx2qzuyGB)8)CB?|kPs8?nRE|v!w)P&5B`6WZMXpqu0hT8n!f*PmhA-PWwve!o zs5!31p$JQA2QMHe-X~Z&winINYwYwhYmq}d4g_U##AK?~WAP5oqYjNXN9oJ!Hpi#Y zVrwzOopDra-%5Y-4cuOaU!Xm|{DO0>{Q4Ide9hAg;9A;Gd$=uIzP4k#v&ZRzQLWoX z-#tWMBk%lb8NO0_Jl^^E*m=u&&u4gF^ww$DJq$AQTk5>sKQyFT??xH>NWqRL#n`42n7Cm~+1|lQBU+YVC__STM zh$21n_|%P8aa>IEc&o9&NpYsF6b~^jhH0r68t?b>e*S-OcGgdAHu}B|5?lhs9g2IQ zP_(!^#ogWA-JKRF?(URA@dkHyx8g2E3N$x;-@W(QXPo2MlCs7opuT$?s*O2OkQ_g$jL_l0IrFp(20ygg< zs%k0{fbY|w0!KU-B#znzR4j4(=cAI=g`OK{fo%h3Y4Q}=UB*^o+`d6_Ew8aS8j4_? zYho(Wp3wp7RpJIR*=%?;=wWFVcF8WSD2Lpg%c=P*wsBa_F$zr4VZPca_y+PodgI3S z%`KeTjyI&TlXU#Ast58QKC}fTg(gp$cFIL-K@SzjqJ z>Dp2{tq4N)zACE!`r62V{xO-7=!Orso#e?HJ5%F>&y9Mi3D*$iYZ|_rg}Jn^=Y<9; zzi_qE!+^!L5l9jmt!nObHQJH6;R`gz_boMJ3JIOfUq~|g!nNP)ik+-xhuK$C^3m{V z@(O%5*L?4}jlMv`6=P~O6;KrG=nF>h(K18FaqH0@+bP9&Po-_51EevIv>E z>!|#M0#&8OwX5Aug3b3lI9(t2tWZC;7MP585?0f= z&qbM620^ugxzAs zqpSmG&V9535t<(D3#wUH?Ggfg7aj2TZV!Zu9uZ#`#o%o=7bC-zuOlWyOrEx0(laAO{uyU65*x9^m2ye)7kYGIjH@U~wBonV zhl7GPaFGWsMPgIV81GTAqvK`}!|z-vS@sb>k#tb|w-In%gsG+!QJc%I@JLyJ9Y0l> zm7slqFIOE4A6=a;|5hjuuE+U1jR+pnmUXH?UBnM+u*=rJJ=hf)bt9fV9p3RV1aVBhx%+&Ha9o-@WWc1kfY@*jC7vS{m!4z=FaVBi-wU`^oypN3!M$2nft)lYlS z@oMJJFSG@Z>vbNQPn%=#1O;KAPJB@XG#?R!^N}=$`D+#@5mWBF-Qt}9WWw9UTIro0 zCz1g_+l{|?cy&?K)|>S|F<#pc^fR1aMry}lo4y~aAsemtv-DHPt!gIT0S)pDh+t4p zLQKhSjW`7Fu73FYHS_ZaXhjC<%~L#agZ>qA(;hRzgQrAs{u6Q=4`=U7Im6pUGHfl^ z)?k4j@Us+f)CT$D^-(+vAc>|wjzzFTF+gyX6KHuznl|!d)~Ol2r)8b+Nki(M-3~Kd z+mMvv^~WrTTck>Q$DmEo*kAr}01Xha*KO<~O zjklPX{sOr;)jnSZnDepk`=8veC7r05avxPH2-cptJ=;nt)iZ|bO^v@5U=sPXDy-odMu%qNvb(d^H;>7)g1+P-^{{}ZUFFs^UWkYLV*^4m@y*7#-Z8M6 zs{@ni3f!%K>Dj2Y?crM2TchK&Nwr2kPB9uwN@MS6NV1Et$TJvEr6eD@TK@X8W1qGF z`j??sKbXl|2VO+t(~GkA`Gr~r#*=UQ&a?MfEuFdfSSQ_3Nq4#L2Pflqt~9T7j?T_o z2d16fGL!^2#Vz0Pky&H7Du)uO1!#{nIoOrvnHM_nw12D0^@vPbH|2EnO*^u^k-14l za)&g*ZqVV4o$0mdA)6}G)VgW&(DD~tVCv* zd+)xp!%cFfw1vH#C~We;i*G(m57-@QnuG2y0V;pL~(w?aH=H z!3a2Ih;GqHDd1?n{1B~Xlx*7a&@{LiFgi&oMqExPpc_<7(|VI`$cI$R->oX!9hpHf zVl9GCLPL;3LdD)qR7~>(mnldAOSC4UdMvVuOix)%3xp>^pZ@;ZE}r@}C&@;2>x+G-g0rWzY+K^Cq$6%9gpb03n2nxTu>oIK#p5bn*Sd{h>SRwjEsQze-}bj zPl4V*jRv z$m?mVs{cKWBcZ1I&jQ@Pv=IIO(n6pGxDPh^+Q$DZ!2NGd$iE73HpUhrhtk?Y2h@4;2<^RC#3ry_v2F_81mOpc#yh_Cja6r7(%U9ezt5J!D5 ze^`C@;BkRsceYWIc4KN~qv8|0+)f3ZPs8)fgls{d_+-2HbO zk4rj4?imXuE33|P#(t_SdI~42`G3SJAPKBr; zE8{}wC{Ctyg=%;uPQ@qs50&!Tl{n=b`jve_PTS$=R03g!ICpD5OMl(I2TK zye_AL;SkY4$^`-GvZ;)S=voX`Tf**r(C}Lly*GBrX$pfHMx}jkbB%bD&8zF|s!QYE zC?LZ~#xBAxh>%Pksatjblk`UxO~&`(l?}U}^~1*OV8o=b=rQqsQI8N>;p8hOF`CDi zN~%?;3pusK;8q=17+9b3P^B@au3B%C39L59pSQS$PIfY>uo-enxOKFE#G=wT@@3=g z>{PFYRTCQDMKBYJq7sV5r9&D<8#zuy(lG=3`-6)z1Pupre%}iVF?eSre5)Uta%0Vg@Nh;3I`94FEpFt7?IV9Zr>7*aE zEf}aiK7=5qZc`s9qI5$l^7Rq9sDW{cKNxp&L}r%e;{7I)#yBU3W~7t8qCdiGAF}XL zV@ruM*?*O0-bTrO5**D#Dbk(IP@khs;oc^`<~N?YtRG%vs*>&Cy2o%x0*-xG_svw}qaZ3R~Wg^60(GIh5jKq^>nC&v{yG! zPlw>?^t9{w{H)SPbJ-mI5##mcVRDat#Jk9yJxa{}Mx-fNyw^pP_DXE|vir2s-N+W0 zFi7k{FrfO*bNgD@2qa@9kwJWJ5+r|mcs-FhT1q50c#qpELsLa}TJ?%(B-yACv6f5t<`T}`xC+>CAr2#1lv?^w!U_8G;X7CZ-! z4ZVTOE%=>oI5Om}uz)g~D#JK{45eA?i6g0(4W$(si8Xl8#adusc+NTxd z?U}lwu@fPt`K8s8jrjG9H{WQFSob5VdY_#Eclq*ftJYrsM^Myz;_OL;=)V5cee7P2 zQdY7IhzPn#a)$Pg+#>&tU@ zQ}`owg``xLbUi^p$_}HVlhea4VHBm0Jp~#7Ig&aut0KvLU131 z7uwR^5E1MIZNudl;KbxZ)MMz-wJFnbiQu>@KjIjF)IEdEQd6~pMbkPAMs~wj7x1|) zikuy1iw_B_aX>R>9xs!-NB+=g^Tri-D@MoC=}m&d36gW_i5@OWRoe_rozFbd>PLVg zCM0>*oKqmxM7SWDWz4R@r+3(N-MdBisPap9oX$+9DiN{XPL&bO0u33V#McOo8mg&8 zyN^H1CAH0*-g6C+Dh%d30-aFk-7m*-bNs9=O#EGSYEZ?#cstijNO-#v52}O1r;52wnk?b|lcDRL2vx>1z2p9*)3wnJ ztTOReRvaR5B>A+IBE}}{xmv#G;-+L^f>tjSr@8c1oHWsU@KbddRq2cok${%=Zy7n_ z9qee^4~DlVB1)R`2axB*5X!1@OuXZ@H;634DVYb!)k z*u|AS8PAApH3R&O=d!2tB#PWi!lp@vgE);Ok{4%ZDk|Vhcu{tbBUV_sj;wik*P1L_ zV){43^kpE%R1m6PK8NGPtHfX+Gk?~vxl)S?=C{5^W*R0~Pcmut2;*jAuYWDXbg_FA zu_SZG#o9BVmVIU+S~4z!#|axM2l6PuXp9TbA@wHvm9mfzCj;g^yTn;;JL)O;cZ|Oz zi0Yu&pXl!LEiUSmE5AF9U}Qst#nN|Ns}xf_OW)ZjO(K;%SOr+{w@dztR#L0}k{RNf z4@a7R_d^= y@nUQ2VJVeCfwO<}XP@b2 z{tg^Z{_>-URzm4aX67mhQTCtkqL$;7&deh|2R94$T zo5l+B>nFD>C0{PnZ{8DF4tI@-LEtKjr(C+< zXQY?H%+8R*uw-fqw_U*tI5eWLwZ$OEO6JRY^5JViNBT^ABb(B93He%fu>cV;(T!|62~Ug*`!)ADQnS+1qGkVO%v`KblI$T=<~Pgb9Ao7DP-a?+%YuD{;GU$j z?JDfF7vlU=-xX*ba8FV&6QuUe%U~b*S{)9f-YcHYNWnSype$H=DL@4aR(>f=J_-)L z)MI4ut;hiqGzIry?EUG}8~E;!3ZSG>%Ln#!oy`&kt2vUUl29TJult2iV`y0I682>u zKm@?W9Wq7p43k+3R_+c%yN?V^_sDn`ZvW1iI-Qrx(&^nE@9U}XZOE$#1Dt3+prk4N z`^sKVG60PI4X_U1YefacPTDK{o0=8?o-xhWod?!aD@-yyn5YG&z6C}G2{r&J3LP>0 zbH07p(A(GPMzl##uq?9%r$au+oA3~2L?1nZ6d_<9t&&7C3L~_t>Aq}iEpTWafrwz5 z27{Oca3gRPPmipX_N%vYZP4w4imO&^% z|D>hh3P$h+n&?xZ@Ds!!F~qQ3`DgCCutx@ZMFmp`Czv3{_DjVc51FbEgoLG|MWh?y zQGEF5CIhRENV^>3m5*plfWpk6kk$9mh~T|r{hywiff0}q0tRMXlH`JeUMHhef7+zQZP;cO~LZN`03EuXmK9bqO@2KrjIzPfDP+ zY$eEtqJB$?ef15N!3h>RF+<2M0d+Izf?%19fQ$8?p@&8R!=L9t>GNA?6YOXa*6H0K zv;b@Lh5FB65L%>ldI({9pf~y_ZS-X8bT9zTcQ`#xJ0qVkvyd=zd@EyWE2I1}+H%guW6l;~?hb@E_lI`wzIX0nM(%NI?&)&w`CmfFHE-TO z3UC?!SjYMOmqx~t~_gI z7;ON+=L6`Cs&XbP%Wdy~vG4Bt5u)`k0EP6Nl$B%}(hIpBg< zY674b!HR%^uYR&p)4f|Twl=uK&M4K2YkKF=SIdxskbYTv^)B#+ud=|qPQ<`uOT-#6P(G`%CPbBj%5j%ivTY6J!&_&q7(%m8!fYs;OW5(olnl?lEuAY?2{_j8voX%TkJ)*o$>5PkFi zyLO@6`BaYyN$P|+bNI0G*(^J-j^xWr{vfF9NTws+@nUK zuMyX8bo%{+T$BD76w?n_#dYa0_fO~y2ru+mlMF&Y{bQAVP&vesdC;n3V3e=lv)af0_&ILayLwnc zei-*@I4FC#P@p$EuCX+3kS}vYq65`bexRm9yBuwlUVda;XS6o1sHJ)YU0@)0Y;+xO z(}@fD@%uRN-t+jm-6W)X;8CEd*KYz| ze`=q2>TGNhb$p7_Z|a@g_6tIzu?NUP`I{er$6T_IN>QcA5OZ|vbHGnvJ|U7 z9*@4DX1^4}yeyNm_)h=(nr>&I;7YOnN~z#VethTg>QXf6LX!WVgxeRvm8Vr`HFY_d z1#`B2wPSs?>tz)@zB-MHQKc|#DzMz5zr2sy*-P3v`Ls4gx;_JKzoBEyLPt{Z|9yr>~Wv zt+n-g`>uZB4KMo*J^T5Wc1%d;)?_E*Mb7++{Q^PF7FyR9hC|m^;f*l+Ew>s}M7?d) zT7>;9OhSxJ5{%)I&NYhjO{&_?6QebN-_8O0GSm5{2gMeV!!Sp{EZ6zwb$+Km>2}Kc z{IlG);KWAd3nop#IB~$vtBJL7{~wcC8&fqa)DAmPlY}9+bDnt3;P)O_aBXvIhh4G3 zC1;P+0o>TRZ^ycF!M?w2i{=!+rid}$hQ9BWdtg%A*#}q@&0Q0(?HXsm|+SB%He0gEz?5Es}txis!=yi$K5g zsr9CYiE|x;qa!B3=YVsY{PRJUvmae^uppQf_QS`7BM;E|N5zY?^X+5ZPS{IKtV?w7 z_gCLZI}5rH*V#vRC(fD9E|-a~?8&Z+Uoa+~IyRD!D_2iQ442zT0V~8;IOI2YkUI3K z`0K&i%UQdNed12mx=x_*%{K?csWTLeYE&M>i;>)}1$4l{)6KV9gee8oufo%fph~I4 z37N#M$PY?=BF!`yZ z@XJd35zgvkOWoS+I6z1dFy?^3;?VWe=;ce$%~=rIvC`!_1%S04y$S>5+vU$$w7)45 zcFf9R)^fSP`ELa{E}gJ6%na5fN-U}r%`ZRrQ=kPnv*npRey2Bx0gar>@yW@Eqg-}T zc7GM%EXMZV6c1(7{#nPFJDUB(Igj?$l=eW#L;!z;Xl4FnG4?TzY~EdcL+-2f>;OES zd%mzYudj9IEeN`fBU13_dY^o%-W+U+L94fPx!wE0@_bY#*5OM>GL7!o-37jOQV^Eo z{#r);PH>zQ-#)MHwe{TZ->p4*+?KkN4d$2#kQWxq_cMYj7ZY-4hJsQxT$8lttsWCT zt>3OKFu2JV{SZH$!GIDSyvY+1DrU+YGhCF@;GBjIw%LbcY(**0&&j zKPt_d_6ivj#bJ6H#75_R9_+=mM0Lirmo*!Di=(23&ZE!$_M(YEgn2B12(w4w8wt}b zI$xBYAD#4$sG2Ee*hkZHFg2#10~fmgGgBE|K?;jF=c%++4>M-p6!}8tvvVe%VW zG`+Jv>0}~na#{1QM^k|=aH${mo2v(LqxGnp=9X|8cPG^FLsHZ?*!yg#w5@A?);R9) zU1L9b?J4xn2l=}S8S{^xzZ=9;$7^C)cDoxrD%?A532Z64Tp9LziKN1ZT;1s+ZR*l% zyU>~5;k)ITJFWNB!l7q}#;CmASSPXf(3Oeo^(_4<>`OPR0Fyg5>w2>1K}~?!?A{Pc zqC0Qg(fq8w6Vfe^&TWDy8kMHc+cm1EC4z@Lk-SbdHl)9$PRMNW(m=n?BZZON;N#WG z%K?Sb^y}KD7}MPD9)v_}uF=cO8xY@A*6J+(7;mDwY&KCoi!78`3-W?*2y#Y6iOt_? z9KZvthF`{iqnK2b+~QDQDI89OO;s%^r}?KdZb{W~+Iwll$Ldp^~qxJC~7qEXg2Vf*Y>{ ziETpg-xKW+8g_VXheHIjz>~{@bZ&lh8&}FACbBH2voSV}VcPe zR%`34Di9<>~-OM(Vs1Jj4hIB!M`VbHyVpUx7QZMU-l;d|up zlFA{ko~8I75V6Nw&p6>2upvOf2a#*-BxWMB&%?rAqBsT;VN#Ua2jv`~fD+{h`o2M+ z`*cqa{Q%mVY-3CztzN91B(o*$bj)}j5sEKU_7K8CQdl=}dLs5{%4v#CGmUC`i#LI$ z1%<1nAF-FFh6Qz~p%XDk*y!glB=o$){1b&K90PCsEIYQb7t24E4yhzo-$bHUEj2q< zn=$xO|B!w@FnRBs@xFMMQFBIk#|kcMx5EPUYwI}943^zGh?aL-9{OQFbr>2nt=5l+m52R%>mEsF=f*FDIH56MjpSxZa!q6AW z-;@c<&m0%>hF3`TQersAnUef4Iu_U$!7QH%CI7G&sU#JWVP!2=B<_Bo2*(b1AEsVy zN@J@%?xXRwRK3RRtd|^crO`5=UK@l2uMzG(TjPS8Wq=+8Sooz0hHb_SJqsmAJBbu( z`B@W;6h;C6CJItS>t3PYZ=+T*g4v!{No+8G!t+QJG{l%%@x#eRtwdJ6>Ni|DMM;W= z=gP8e05^a`y5_}-u^R6Zx49Sku(8$s9%GYM&~|3$NVzh*8Nt?)0^OcywOPwCVQh7k zFHgS%tbZ20Z<^&QLhnQ#=Nb`i=Q%s}`ZlV6IX~kw;kM5oQMF!}iC;J)!A5RBWB{r7 z(Rs;I=jW|scnQ51&$QbUzU15Z{RT%`-6XUPnnI_YAjDKvLe>Uv2EUzbX|cZ74h>;~XuE;(rUNcE4)J@jyH)9?gD%(= ziGxoj6yyu=#A0}}q49QW#JgHUjI6k^d3HP0iSVTI4%ex^u|JrL;7AYHBY8`M*_ed9 zi?k8QyXLmc>qLW!>@*hJz8Z(6y(ffyE_VIaF^|p_M?Zc|1IT+iwR8-oog_)SDd@L+ z)5Am99pUk|u&BQ;I31=?0z=p#QW(HFw58#j?pjh6!A85GO}wsUswZoIe4%YmyHYQ< zY7`GnhVfxvU)rv5_Gh=BLzoh{b^k5djL7LnJJQd(Ipk1cXMsPptf2;1QbhVb&w7`0 zq06J1rPTgsN873<^1p>}-oy99@5NQsW!1DL)pX^wb;bWN>Y$_cL0?DPKuzawfN!d;Z!8Z5_^LMgy2c-L zP4x_|^wrIb)&Gs*>q2)OT&;}sG|esKOw3h{EOgARR86e)Y>ic+B;Uqf&)!MR&05OI zM%B|@%EeX9)lJ9KOT*n;$Hz_C+fCQk_k*vmu8Fy+v5DP3b{!ndph(~RUr67@+{V?; z;h$9B&fVGG+vN|{cQkhKvT^ls$H0jHzt1`7*@UJ^VC@0%w)mxeEHva|7s-pdOZEtWb)sTe{ZGvez6?d!r9+xf^z=R z(b0*Cng2lj$7=)sf%*>)4xsZ7*XMgrw}*eDel}ww9_3GEp?MgLw{O{1sU_p;g{`km zk+9eaI729V8%zf|DMWmJ@a)G9f1+2g>651Yk-^2joc(wmIuM13XTiP=do&}W2*-v@ zD(iMgt0?_Ra)-k_A_|U7w7UL{`0g;PeuUNfND~uQjfmZn)wGF33=R!dxjJe=%_;&q z-cZhJ{#h6{t=5mJZZV|f*FlMKKdkzsGkPQM={1;Bj6_0Fak<_4q!UwVaoB7~##&v6 zQ}RU`-H=`5$5^>Ff|Myt241lyv%kRWe5EffZb@df|25Z(M8wlpExw$}l)O8Xh>6@| zYNy>uBU-J0(%h!2V*fgYz90l>_+66E6T+-V(D2xsOvE2Sl0jK2ozf~^VCBqtz_~LV z_ZY{)dp%_sho>rUgr)+AQWc#fjvFK16D=xitg36;D){hU5zj99ExUQJF8N77epWMRKvkk*0eSBQg$>eBfAahd&}4 ziw=wF>D~3F-~pj{oz)v*B}(_jQ&o~BSdEB4h~%&vhLw3~OH>-mjM(AKxkoxekpTdU z!u5O^PC%Y;n3qb#fDi9F(G>JLmc`*+w;R?JHX7Bc`=F-b77*cwv!Ge!QK=}%T0Ha! z*^O9Ko^?2hI^mL%TtdyKHCc)^9P$=Bkm6Ta>SsfghZ!Qy`L`j6cr9RfytoH=_7!@o!3|V?@MzYNELK>V8^6dOhWsAk458>HKe8)+> z9k&xzy`>o_1w&oQT2z&y@)6h3v=`&v8JI$cOEl3i0XS9Cq|?8`^S*IppGd-8|B|qw zq)(c)O&a3XRUT$UJrGG}HwnjP(*m*N`k0uVH8I5(t6=d2?$snP5RLS-$fOg?Qykaw zGfZCZSoO@vbJm2Q{5*EL=z3O_KBlYm+cEP~Vc!-*=UM{0_Ahl2F%ek}5nYY7#2{D< z0LjwxZR?}g_QS-`)e0OK=^)!7uxv`YXMJ?6*?Qw-B?T=zW_F`B`D0gGjVM;BMzO8^ z6xd?LN}iFgQ5n!dd zC#`_--b}&itlyvQx$?m;54~K0M~aRO{m1CoNTO<3?aLC#C?7_0H0%5MXP+@JK+pP@ zJTroJxOL)=vGdUCLMSNv2;L?JeYjW(r*j)RW;&9qW|vRb!*Jlc<%=sdqfEs8bvuIn zjp0NTJN@u>luNOf1UqEnCyIDBm~Xye^936$PP?N7<75r~O)DG@QK>P64a)(W4Mx4w zGNx)Hp2jCSV<|4#f-(ew|GL4Vx0#UQ95BWlvjK+gQDF zPmqAD3`sMyz}f++oA^tCpEZTpgz^uukyInN^f5CEKtUhfPGU3=$(%mxP=@}v&Mln2 z?^x%Zu)3YIhoe_0p_(Xy0s1}~W*8iiXX_}}h`5jw^rxRU;>RD9hk$OBZL-Ixl%e7{ z#j4g1=wA7RuW)C0hPpG*hK0q5n+uYmkCDfgc`@?ecKldYqp$+aeY9<_QVMZO_~ooe zW@=O^FhfXTfOimN8G#VY20vutxx-PtW9;|@9kkz%5fAA>@n3>Z9 zvMDrOSRjxsW@k6jyq$?bvCf@CW=<>Me#9z@h}Kqpq(U_Vf9ukW_HOHBjU-o6CMZH# z6gwVZ^#R)Itu*0kRC;l+tcg*N3|aV0MQLvpv0KH-00>j353|wa7YxyIM5N;p)`e4F zwWH#2w$WPKX_k<2sySq)x9SH)+Olec@LI334_=CSBz|WANVYE{B8udMmGpYBp?xOi zO{a*n0Q`-q;U3Z z5y)p$g*R$@b{jX9SIO)$j)5q2R4GQ()Ft``lC8oEND@kdbR^ritOZC+?A<^-q-(WG z6ICjFLjTvp%M)%!MpJ^V@NbkaQ#Pfva)05Bx=(W$$ZzfWET0$%8cFeRoTA&-i{fT4 z;p2MfhcgOnBg<>p%zyJ z$Uwclg>)Z`nRW@}rqEpmedo*_#;+RSB^HLAAwaZ`+g&19smA4VQ#sEve3AW>ISg5j z`9}5aI<4+`E$2MDZIKjCyrpMdw2Ffw#O8B*J<;Y9tGrP}0DNBIx`mLLCji}$w58};UMu)3d(@QTl%3hFaW2V_YmNrfMcoSVQ5}(8`fQP6^LIk+6 z?WS6JYs7bb+MYgR)NkD~`Z~nfz+6O+V!otT&eJ8oNH)0u%_gej2VGr+VAL|v?9Z^; ztcgdoAz=jeD3M&S^3SRR?~`&R!GH)(`I)})1iYYbTO8x)rmXolF|;vM%}MYC9qWoT z>9VeUs^yb}5Z8Ac0WAVAp5R#$EY$(;H!)06!gK9bo0K6~@NnK-^~P_uFaseq{BisG zu3bk2Nx`UkpwNm}s}r694aWz0CDS3D>E>Uq23wS?*EY%SsXUR_G=Kp`03g5s>Ipk_zOABG;$me1&UI!fEgJi7cVPG-4rC91GdUNs!Jc$O)f?1{{?7iZpH}Ou>o| zhdnq*({}UUwZGQ^-5UM5PY_L^~Fj9N7EfS*7nUuQ*oinF&AlIRLjVD5# zrOxF%#eyUUd@^xneI)#A7iv!cBE4?+Vvsx!sUwzz$`1g>R@k)|OakQ4PsPI(&x&=9 z4(SaA1OFF)GjO>6VfdD22pMg}(~gj?a1i1*I3!Lx#1cDf9Biv3IdHFf`F%wH2hL8a zcb+(+xktuf;7>kybfyDhBE+65U!<%C zX2^a&#QJ*K+b{a|dxZ@}DMk?BPqZXWE&-;8qN4H5)p?@BEu+&3;7NxRpgi_qI(feU zl#_(~deK7@U?&?yXnJXJb{KO>kf=F`@a2J>#5k~Lj>q&HEE$AaWBx8t;0W1oDN?Zz zNlQ4Xzzu*3fWZQIS$ESrbtjD@#m5|m*}j39=ZWqM4-QU(U7v>a3r?2ccFU!53vwpN zxlDv@VWSy_@4f>vAd6Vtu-6edGw}v;%6y7`8;Rni!@v9qf)ocQf*d0p#BLOX=oLq~ zELI9qt6!wi11or1L-MPE%dVmQBl(PiQ3u8t$6C%8EO%! z(PbIT!g#8$a%Q60&P?EohV6AP;bn~Yh4K?B4iX$M6C5GDfmS#CaOSyMQqB$0u@+Jq z%}0qs)`ntHhLSCS!Sd7zDHw1CUOz*2!gAgqZ)!?Kc5y_o6m^DYK}Nu$%`L30Xc7vD zh_Ki?24yj)_b$f@l)EbvNXYn^tj%tW)}C)T@Z}*F5i1XV8|gaOFvu!JIyx_?EU$Yx z?=4EkEF}yS_4CMvf0WMecghH(!B+`OL1Glr+c&=#6~^)bi3X>YMa8UVd@M)IB__hQ za4OM6!6vPg96|`KPPcq(tTNgdN@ZFoM3}@715^UR33~*g=Hs!qIVA8Damg0h1{Woy zmnG6CFG%O(GB_gV1ID7FaJYr!cFil3Q1SsEEg{-5GWBrfhj7A91(p=KR-7i=N7zpd z6;H+pIyRCW)Rrpl?wrAJJdc1fb)b9irw*@D;Uj86JUHNE=_^nf!&cOjOc7dr6`FDp zR#2JGuP8O1WO$uuOj@OzG@)=lnCep4*uf&BtTGOQ<=~nQ;h43)x8dJVu)+yZAW|nWtp0%^vSK>NQGO#bBCceQ=(b>F@ z;T2{?3S0gllq&SI`7J8tN6U&V845T~*5oMJUlWAoGcLbd-F@!JL z9z2rBXWNyGv8C5CL4mVbpmgYt2TbBH02R_&#l2Fef)rgd)d)9g6sV&$^iy%fh7V=C z-XuLo1_bv;xklf{{j~>z7GINgOvPrK+^3|b+|;HW6htd_1Px`NS`s`F1u*uKC_%Xp zaT?j&y0HC$ELaA~YzPJ+(#htL%czl;7525XcrjKGY)~xh8$bnr61+SJsGbDWRz?zB zMX9@N?EQ%XeLI)J1og6D2!mkoE@d8EVF2R%eb-4=*A_q8!AaNc zNmtKP`)U>H9u)Pje*gXS9Y6wx6#&EQ{R8!*bb!&;z!=Y95J@-oU#K6?ubUvdo2a9k z-9A(%fQ9Fmbjfstapky5`uA)HDmv|k&6?mg6#j6y>=U-d?t z{YG1|q1z9m9c!aq&!gbDVUK5&K9aGx>>=pP(c&RXIsWM85FiIf^ zb){qc3qY&q+hb72B%=K~S!ff^tLV*pS&sR2{WL;-i&3Dm?&iC}D$NQVV=u$c6f;Z#A^ zxcM-FN$|w(%rNDqaOv<7>`0_jFsepQAErbJa#-Xb2tb&u$>;3Z4+|)@pw4GvpF%nZ z-D}AJkHGei?qhh^2KPX%Y2XPEftV$d%UB1_2tXh_b7VZj$1NyIpT0$_ptjBJfsF7j ze$u~k_L&(~aQ!>$C2XOTD#J8)D>f}*=-jm@f*%JD!}gpK={zpb3=#SXG{EaU6&dFl zYs4VA?JrxjEN?g$oPQvgueVr1;runq`_Audm#{`3u*6>GB>m@f@R_^?XBjCG0y>?O zX_sW!f#@bno{jPV9uT8!nD?^AGVFYL=O5H>!oDoHT9lSETc5PN*S>80dUld_!Htxu z?3=qr@H7F|d?!_@RUvH}U{zYgP>_d?2%;Jm{MOoV4=M>DfLZE$Yi0)&y0UZV#6U!N zALa@a0=+xu{7L6crhp`2uw+|rIFsOYz({FeTA7A<*lv59Hp*=U+&ig_cK?mO%#Eb1 zK?9OG+=9iX5a%1gz+-ojSyJrBoJ3O;4)eBHpu-m25WJla0QL6&rr6?T0D%q{6Aq&sjw9Y5UxALlBpfwS9AOz8r6mkEcAa!={0ZTJ zSx+8~PI}@`gnW;>b5BRQPRGtqz8amRIGm|wNEJ3#)$j-Cg zpH5AjJ;|T#DZUC}7z{7Kh=cp;4gk! zVBSnRoS4+z;X-chG4Gu6?p&1a+zjvEB;E<++|xP^`{msjlivqT8rcawU|igP3wS_p zzK?-ig$rE;CUc_BI*s?u*W_$E>e8^O)PuhG$$a^dhy3bbng<<$W9r#O#?^mVL zMV!)Oq~l`)+j;orLz&~#H^^Dz#jkS1;m*yAR?O#arQu$-r##60fRK4d-ZS)s;_Jo3 zB<9P=#6#P~FKGLw8}j?kQ|M(5^J&fStTpdth3)rl-SsHuuW`t)ioD+o2EWe&pFg2N z7871-Hh-@=LJACiZ()M^;W4PSrnW@Fka6)+=BKuMBO%m^#ah!l|J;6fJ?K{>oZ_Fo(hZ{6xvZ40gkLB4i=s}Au293_#;rAq7=ig>4Z_TIDq)HS^ zY_3XGKh|bD?2UkI`YMh47vy8ye@xU`=L7)x7tU7WHOFJrbU!n!es=nKo~q@+s?#2< zzGFYMc&Xd!3Sb&C(0imX)=uIgSFl^SJ{V1SmsrX`Sfw#l0W_gq=cBD@ zwN$UNfSj#(tS!B^oW=8B^^};^Vz{W)d%C|0%n^KrXiw7G=RaLET4b>P%l&k@MlLbn zO^fQ>7z=-3?fSF#?E)JkKI?DJ$KC6-@iN2B-_Y%cBhy{St9I4j z(fmJIN|5k}MNkpAXC^lgIkvx%q9R^Xq4M>y+moVD5OBz&DpCU_LFrYCtLN0cKlF-qT`ekjW^+IPYmGsUc`Q0!wjtI)iaEv-m(B#$UbcriC4kN(() zB@bb8?Nyy>Lh7uM6Vptg<0T+$vXxuR7fAXpO=;(p7igq6H`7ki6wmjfs?H?@SGO!B z{z+OLb#`H<@#n(vTI+tEkSVI#g5+k{hc5M4u4eT>>=)D}k#K*94~qOhQ@Z_(V&j)B zZo)q3kQo2O(yg^3MVD~kucmwF)Q;`RsXzJ?6uBg+;926%MLe^PzMTY%)xW=9X)tu& zzbL{}x^@3H5W>~OC5`Byj7Eo1%WfRrwXiGK=<96eavQW35@y420;bl5`eEhNcc zHY4c(LQH5-J6VApx?b(X<{T;nG&hDWd=MVGt*I`~Bv(qdj zZkyo8568T7+A&|=s)d#cl+D53`r52dc{Y(uomt(t@@khL?O?7 zZIEr7|CcN_tKok91fUE9gR(oUko9FJnxT(K_7q>K^B}p>YEwQwj%l~wwRc0RW{e7L zUI2$7AsfsZ!`B5I=dv)%rASoZ`|xl{$CCY(D)OV)(>+ zIVHYTYP{eQtZ+L}B>y}I=>3pLqcR>Gd#}B{_O5cuSWGO9q&9Nl+0|PA!4f^ z7yB@tT|<8C%U!-B12OBvsGTKxSlL13*&X_(FXy7^nE8N1i$JDF8+0oMGm;IU{}=XYgssOh!kR*;EG&aS5)0qvFn7qH?bhfX_5x6zCS+#m4j6B>Nw5 zw2zWQQo=bYkq*Qu9x(lsFEh9R`)5+E14qOf4wLtCqJSM*9OV<3jQt8`7W1KVuT=Ag zd%2eaD6IlV_Z}Cm%qM1^hh!S(@0m$F(K7OG(=$%d`8vuJp!N>2KVI{c;SzxTpHhQ- z?D8ocxC~?ok~98*Qv6#oR5424@pI%WyMya;DgtEutzvGAT4e~Y0WG#Ezgiyh>Ara0 zooGU*Y$-1)0Z!j3?MUEffEjM9bD`>g(~aa?8z7_th|i~ z8a|88AK6mZ{Nf|}3S73srh};^uPJnD(rYA@U1)x&gRtmZak2Tcb!9ga_8Jl9G!H6F zl7hB0;(w0R%6^wd0Pqu_pJTeyR3cMmG^^)`NR+Y-@GFgWtvE&?OW^k$^}kLSwUMQk zp^bW2)$|oR2-+lqdIafs$>&U#wCf8JOA2MK(=`k|?%Jt*9+Jh)J66A}7xX@PH?}j? z^9)Sr)~J?KaIJ-4%pV;z+&97otwq*m;#yMh7L{~1`zqa7lxN|6oNZq#C zgm~3EW|C;G9K1DQfh-J6I3!z1^mR12e?D`bthHDzb&RQSe4Esr@0~X9SYd7uKZ*W1 zR_{|<#7xh&Erbm%&F*UJ;<$xyCHz#4B!o76fg^n`33?tZ8kv!kq9R>IEeG%2=6?n?<~P$UMWgR`9QQVE7v z0sPqeVA;Z=5;T#c2ciJ_%an(LBa!t7;`bCW1uW)CLVs4rt?}b+zW*3AFR7K@Xw5Zy zPQ?s729KIaT2%d5dAEw+G#{uwCS8Wpcr78MtrZNemV3$3koIE@99G+rU8~{iedNs3 zY5JgNtOuN!4eN?V{n8hZV>ot^Hhh@S^c^MFatOn3oQJMuD;!f(T83xtH`#|er*j9J zZ*1cT{1H-x60YBX>&*nH9A8h~U!C)8oDleYu{lQ}S*@H%yAbw&@WXrNHIaPW8w)IUsj+E0wO6faRWA5f16Se-^ z-zQ7g?lL_jaGlHXz3`VNmmE^i;X97I2==_IvNN)^5F@NstrrK(LabvM$%nq0=49U5 z$sa4&52M+^crgMb?3!{k!S1vtb=k7VE`RfCb=hQ?m_*NbCLU|PekfA(&X*Q9c~V|F zzpkkdvSNE{~lqfyf}#0_nCkl4HXQS}OgK^5?Jr=RrawwS;n7p8w?5ydl=xHx^^ zuTtI+(;vr!yv1&zCu5ZN?!_T5=WpqWBNOP;Q3&)U8T!5&UYJM%j#UD_H9}ZIyc8@R z7$*7<(7%NX1Bi`))=8jtOTZMsqnE>Dlt&0*^}}{Y2=~K_j7K;^qR-aFem{x*CGES^ z>@R7oEB+;lR6hWN6pE`n@Y_Q2FN^rqH=zSkk*0grqdG|%vQQWzn04vikntWj4^-;m zY&$_Inr=x<(?K@UZ&MM4@bXg3f&HXpFa^@RlZHKPXJoX`Qb^sBP?G*ZthvE}@T|mC zF%GSvlWzmGp3->X(yG$MvKdd~xrKh}nl@APysEt$(s9~F2V3@v+{m;A$8Vn2!D>7^_%m-Kw*ccQ< z3>0L7H|0Y?MNY~>PtMIs$;(Maghx$F{%`a{$HPi5#Lvsm%r7j!EGEG!B`7Ar&L=Cv zCMhMLC@Z207SWIsQ~y_{Lq=X$87u-;;nmR-F)&_u8(TRmI~6-?83$`+M+cCDgOZhOy_}oFo8wXN_0_d>w6S!v`d47K=IIw1@V2z#A0Hl&9vy1T7-vc! zXD68GCYou-^vR92(37X!i@hpPpe2|)!T}WNrw|sbndYsK8mQg<58R1~HB3w~$&Oaa z4cALe{SX&t5gFt6G1ctfUMDNdw%|WB$FnwGu_8vVEf&4YWFVGrCRK1L=bu5Af65zU>2m)toqr9ojMiyRH|cLy zfL1zm|4ZuBx&I?|B#&#sXDy(EE}b{2bJL=5+p2leVs_eYd)DRp&lHR0@u2qer0VMo z_;-KMTYMubE-Er5JSsIlJnv&-YGguYd_qogRAEYbR$NYQPHb^{ePMJ}VQOnpXmxQ` z)90`^&C~lW<^KbE-Yygm^rXF+o{6rqvEeMp%%{28lEul+mBp(6tL)j{{IdJA=?(YX zZL}Zlx8ENA6Y-dxUt5`+o0}UShb}HcH+D9U*8b^u?62M(kKLWF-d+yBTx=d6|I7FM z{r&6l^6>x6yQt*|mY9#A5OA5Vbj%IMWiaWC7GPgH5H%%?rM&xgf4ZE@qf^e?v?CRT zg2SZIdaoXdjLR8#4?wZ3uAIpibeTm1M8{#%@O$zS3th*}mC2_wdr7s{{HOv|$Y)Ab zFyp7P>!qYflty9G^LoUS*QLj$5zvyQQ0)u?wMvC{CkvH)J}1_*UN#F#hKFzUg~B6> zxl#W?C3f>+ROu@Fi@}&eqx4Bxzj<#;_|V+hDBF1xHH1OJRHCc(*AFxbWj&QJ*8zNX z9CpWh&fVd70xk*~{1>=t@WDCeYhpzc%6TYsFj-voJ7|A zm~|;rg|@B9jJbXm&l!)LrLdtYvR!QUBJJhbsPz7OGNY8^YBCUxpOuXk`>QxdBWDBz zZ=K0!yK03pPql-}A#Ym}TSYPQ4CZ`6_TjeX9K4nIV?AyJt{V>9Z8V;fX6pd&aR9u?*4%kLCNYB0Xb zbUSD?i=hlA+6B;#>O`Q+@?uBfY3rGd%HTDv%vFWwn1S%Qms~#qFyvGAl0<9o_LR-h zq3)0A{pWi-@OGcz(=YmgT+wT$1coP7ub9yXhof?$zZ3m&o>mqod>Y@B*) zbVC^QOv6x;u5DJ#fb$^uuqc8qhN3vwlN=0Oj66b=>rzhksDrgCM%3a5KFP9=(RyIi zG!27a6}fq4(NuU3qntxFvCJSm6(X}*1;d@3uq2s_m6K#HpoYAvG`&>$JGn>Rn!-DL zE3GfR6hKG6*j|vMww_&ueX|L>l1>Y;hy#7zmipH#@MWj6}8amomY%_{e+w^AQ)6`RBKkbEG3PMxQoqGH$0?dqg!M=PbmV_bQ zJ$RKb#AVJ!2zLOsY2&X0(xB9@n|aKRuUq8^pRIOAoPJ7;DbRir#7*cEx>SkLgL^+I z@?hy^$gY={w!h2Gx|oDgkd89{8PpFkuF}=Qn$41jfv06;@e`KeNJ= z`FZtWBiQ}x-_-9Y;Kb5R7(!q|8x_#dO~OqO0{3oME!fm@w(g=zoVtQl0S@qe3WEq# zM+;#@^DNFZU5ae4AAx0(SKH$xBENUVGH8^>JGPY@#0lqQXIxPFW4$9R3d6|B6B$ZN zr!dsl-{@$txAw_W;+?-+Y;-zc_iuFdm(vFaUO5pJ9M}#SdJ4z*ec__P;_9#Qg*FM} zl4L{&N3|&%-?1KAA}8*3flzdaSPKgQez70|cZwOBQ+K>~&LHi3ol}MKmQ+AjtDIQZ zSn_3@4j=G+cA03{M;)pi+?9;+p8Awje@H*(5!1wv$jg{4T0{CD_)vbA4cjyruMNiU zw{Xn4ml@T{baq|KJ?*V&aann#m5)mTal~e>w2VoLDOV%L^uIA~5+*ppYWmD(0j?@t z@#*z&Ae*!uG~4@eVxv6O%-QKYU`9OPM_L#GU_fc}Y%ix>3XbO;z4v}Wp*log7kGMF}a=!XSx<6Jkc6h zhkGtAuxy;m;F^g?Yp0ai*5od2Z;oR1T{$&f*=rb*RfB*QJ9kWwJk6Yk_c&VPdquZRYW^v- zxsHClA_v}j)P55s(JOg{;Eey8VQ=b`WAK|U!AGBJ3H}CvQNSu0N0@hw%9}y=pZGb7@4<1w-Poyxyi<%z4Lv;{D!|=`u zRSK@N2AG!;RgB1%@OH{Dd{vJDUt@HMUx} zzTG$_^IPM3!8#W1BlmVFfY;PQ8vOmGvcAto4-R+MH~O>BIhsxXGJRT^OC{_2mRbez z^yup!5Tsx=xxTX!#gj)}-dzrPKQ*`-^<>{P1rE^@0>lk&0N(~mEI&S|6E>5G#Fqd_VX-t>ctT!Fyt}_XZe8!)3!kso z$J3OO!9E_9Xzm50ZLMuyR1uXha>DI%;C%|qkuyL~QADdz#vL9f1%@4e2P3*s=Ci2S zrAPJNMXb2oxaemGCHXO1xd` z531(!+2H~C0fXDheF&Ff-d?xET#;sB&?%45e=~%D1w-P$qB9&hM5lx(K)66)fcOQx z(gHvWCbU2<)H2qr2hM-VlWx>p&Tc?u^-yJf$!SwZ3zk-%HG+}2I?UNTfSl3xd^F%5 zphJKaxJM0tgTR;(X2;$U3q^={BR;X*NY=c^I*g_fVwT3MRT07+LB?LXyAirRW1M9g z!1fHd`gWMWWlhu6U=?3q^|$a+F-F22n$9?)Pa}XjB|)q)ffE9@#qqFM@gvd^=JbfR zB@z;7QPpq47p;(U8JDZobyLuxXALFN^7z<(L$AdX;9pG`TIn2gjOCHO`H}2=OXTk|5q!7pTpvh12MB zkWCSGhZbq$dk+(G3QoNqL)VTC2@Fl>%t;`Z(4B`%6e3ia*Gi=KOB)kpRl|`yG^44c zbEx)-QpN(X_1o7-!9_u_C1A=aH&)U`Ct`w*!}fCE!WpS-G^sw8B(bd|DX+$I3VNhP>nAe3ms=SQMWwf?CJa;V7mCSZCSOSZ zi6bIb6ShT^5iFSGvCXCt!4X%Ip*@#T`4B$sqp!h)RzH!ap`Uy!=pA+K0&aw#Y4M)K z4>x}BMuo`&#Bn0y#)sev>b9m3X2W3j!?HkOu0!ep%?3lG?h4mf|;fC8qZ zy%o3!z1XtOjH+KrHN=?>OlYH~Xbs3gjk$JOoW!yN;d5U3PaU>7NIs~L{0d1UJc*PX zxJbzrfin35!zLg23;W4Vx35bD^a6zox&DEsh?mj;iEa4MRRGtreyVoPTU5l^n{G7& zw7jH(K@fw{50ep>t|DD@^H4s&$41Cm@njZ|-=7=N9^eThG7*u%CtD2c3Vhp@t?w)z zO+mArEFQcFyg@2y`^A2umv1Vq!@ZDPo*D#fEE%MO)#L&;UdtTuV2AKPM3P zz(FVQeS}6J=cXWklP&aTD&ykvQw9ShFW@;jnYQeJB8q7U{J?Z={Ctm`I3_u%I{-= zxz>U1f4#;D8A&waL?cVk`hC`F8^}>$^RF609%T+9#PBrb99FX?e!+_kB8Ix+W=dEk zXd|1$a%Ui_Yrv?8J~nI_;9KfxA|UWo#n&zkMt`iK;9^SWov>FlkcN{YYJY5mfy-+j zE7ChDGPKW#abw7C4^LOmQ$^0S%qvEotZX7K`H0OCX&!q{U3H|=TXO6ohIC(aKa8*?$cYl1K|Pb+3RPZH0Rz57+#9RIh{ z)Pj%00hZ_KD?oyz&yPus`m?YSGp>iaSV93wKdi{0VBiI!OoAjf(MPPzRvp)tycXpb z1JeWI#vwR4wpPoG>9QEpU+h4X&P|*p?f7{a8}qLNqgKap}pL(hL+9 zDP5^k_A~<1ENx3Mdh4<5%puLCU1fIsljvV~CYU1QC;EkhE--VuF3GoW>n1~#K$kR^ zdX<*?ly4RUu0F5vL7Xz6%VuGX~VPR$= zD|pMnEYhnUu6Mo3#2>{?xiT&b8IV8oKYcl#YJFC$*O_}eVoyY1>HDqUr}#*?<_`N% z*O$!O)P2%tAe1prQ)DX~$Q#{1N|HZN_jM@W$Q@^Z&6+9|+c?a8fbs1KNEsjr93`)( zRm2(Ob?nga9AxS?jgQBTHATw2_%r)?d&RUo`bc`!fCf!7mXvb25sv zu_j{|>%Gyqpa>V$Bi1r0b|zi)!{QgwXOBvowvlvn&z^5lEMtUoF$v_ZPjSPu2;}RopIYmJ%qdY(DwDQhgK)yWfQR1; z6r18j0!$@vXP)Q&`i}|0j{h(cKx=B{M^%Cf^{}dRV40D^bojvtrU9WjJV7M{oZC2+ z`9iYI{*5R)F5DFgXidM-zH6>cTq)aj*?f01Rihra{pg+ac*q`rYEgt2Zomf_K%7F< z5Z-zOsHP;7>_TjnmwKNEgth^z1D)7&%HJ*Lh%0M3e$7#BOa~X>W(tMTeWcHlo3prB z2H2Wz4$Lo!%yGV8+hWD>Y?Nu3QV7BKN%^$t*L9_{jyw;}el~>F>WazZY*%2*xDB-J z&s?M#HwRQS7h-cvM3oGIj9^LNfu&2Q)vC%dQG6*~wv?5!0SpC-go*d0pl8OVurncsEGQkN;R zAk(wD*-`YVV4;}R%UODjZ`cU&FC4NYynrkFx?aN*k%A#mhTfEe+Z7&xyFSViZ^B{p zYYzkf0}JR~=Qv+7zh4?KgHJAm!(W)|&p;Yxn}?{^$o30uOf1hBZ%}e6mF0*aK`x)%bfZsRCz!&9XIf=y>V5OTdG%BWKSQYmCy&*Gw^Y*6(g zdNZ62o*79jfV`>X^^euOe&nJa=ln)wf2>1KD!8?pLS}l{wcG@93%!7C#3Tuns$$gc zV$>=Ll#G4_z_BS>TRt(t61OWHDzq1ZMg_YuFoRvf8SAvi;QThf z1{C=OAOr6QV+}`RA^V+82N@x!LMUd`0Sd)6?xRdGSjgF-DAmO%6|N}F!6;4O)23on z_gU1ge-oeC(~hLmHnG#@4=5Fo(>I0KrHay|dNz=B+V^_qse0z6iqiGzY~uBFt@r%r z>uF=?c}wW|Zqj)-=kGm=-zylXTh71FW`A!4qa2koOe%38=<4v6tFgEeVXEdivxOp+ zn{ji(#C@6)C_SH7J+A_zEcKqQ&Y~i#ozH(d?VfvyAs*D68m!n*ku1e zXjhowb)ELd==@R(@&`^30s4tp0P6x(6_y@+BOY?2S9D|0cVqPDO1|IA$?Bbq%hxCz z_{#dF?9uDTgKJHyD}Xy(^*E$qfX&$C&O7AJx9CpzJ0gT`RCSw(lJy-=3KkD1Ji+CF zFoaw!r8ne7L*Ta~r1iaN13V=wJl6$1Lh6Hm-$TLH!>8oCP)-vt6+#3Sa)#?;dH)%b z$?3r7zw@8ZhmtO8)R2=e9@;~mI*OjU`kuPCo_e8A{glsx;?Kh-&!ZvF<3-Ptea~-$ zEwj*P2<6NCo98ikSqgbsdGkDdFF&DMFKEmt5r(*L{W@jvq}pd?!TdCM{5|I|FD zG8n98@sNHTsuaBU`u#?Hj?{|zZP4k2@CaCS75=Gt*v*&8*qNglv{}uS$`v^uywyD3 z=3PdT=nR(}HPq}DKU=N85udh3Z&t&k`on;j^hP;f>N-7{NUVRZ z{IwWQrBkbXCTQ9n$>e*hd8}U9Ok{H@0gTtK?G|d@B~YNN-#Dx^Sru7BH`aC>e|CEP z!C+l(ci0?=!nK~9xOY{vEW>y~H)@zyovZMUJ&g;A?*Vl&Ep zB;nHF74>&lFENgD->T7Okvo#Kb2+Hh_Pr)EvrGkDnwG}V=Zs6^B9Jav;_6za{xk1# zA%(_M0Kr$ezHrSh4YbFgzQt4D$DmIP-HE}Y9XEx?O1pS>Ig~g*#bGQ@4UfnP z^OmQzfBvf?xOc{d^)8~nED2jyo;vPbMx&&%#L&V35+Z3LSQ;vWtL-VJc3do-JSnzl5r&`r1@L|)H8M+Kp+P+;6oV3%guE^ z1XK)8Nko8LC+Qts!vJcywxJRH@cK8ag7B~rak_Kmp#Xf#9_KI0-=O7G96(|@c8onQ z-d4?o=felt((dL?4BoarQ9g7KDlHP9%}$$-6)M;WC2|OwF<%Bm43J3{z8N2GPa^ z+vu>ELZha;NiBgACm7W`%FzN@r%5&1$f#hCf$UMk29SyRul=WfQkdhZ(|C#UlEfXwzRUhb8zO>36y#Fz zA}BHkiBxqYE8A)+DTBD5Oj`%oloQc34H{Fdfh>U&dL!#5&@>w)1$py$a5*&*;2jb> zAMD3I2?Xv^Y;?Ou>6AZ^7_qk~iuB1I`5&xuUR4BkDmZmqnZ#-8gLlbN*3Bug*D=B( z`k3G)>GT5H3h~FeH+R9EQDJGtV*H?}_crhH<+@y0i%Bu)I)buc!IF_se@Y+WiX!>h zh?Y=LK~ao8XUfu=r|?19R#r0)f;K`E0<~3!bW-O|7FY}PJiN`jXcoK@9nv%*4?782 z7o1w!2ygtFv46ZMKvlM}*z{8iJk%^Y5Lp%ZrLQ)0tXT|Ccg(x@(BSZx?g)c!D@pzc zj?GFdve0C_B{Il~wbm+w7qu;k*PnwJXK<3z*(of)pF0WTjits;vYL9@OO(-zq`W!D0(ee|i+JMxlb$g6%YGI=VeKjm^P^ z@Mg6=R;R5+`OH!URcqn1Ra=W!h2{IFHP;cH_SOS7hUEB#{@q)tE^Q^3kLzpeD7xyy zDhY0W4(r>@U!|sRB0cO9jD8(vbuJkzL9i4m=8RQDwM34fIXbi6I&79`LMxc3;7WgYrhRqBuH8c{S;R)@s`Gm=TZ_Z@ zL~C};uFp|otx+fS$8M9k12)0D2HusPXjk*0ReUdQE=Z#l#m{@knN=f>(pQS0lPZ0d1upLlWhh0gtqx%T|pGjj^) zquG3-xZ}W3NcOBFU4q8FHuXLPUD!XZQ`R%K_WV(CB|C-R!Od>R$B47RMGf3GXKx;6 z5_3zqD}zi0-+Uc-af=ifpuDo}7!{yc_ctOwU|L2TnmW78F7u|~E_&bBP>h*qhfC~Dl}sbLdBoT<Z>2C6hs@@7P*Z zxH9J)nWVt(dh$AO)?OK~@tp!)_ITw)*T$JN>&&6;Z60b4{5^fGpaCEA%f7n$htdeMbG z@B?-8(arE3GLk10vTm%pfo1t}+kyENKche3>tyh46S^d=km|Fm0P;h;b}wrVDO@L1 z@B~ujjqA@D^aC;P)>n`Fu3-Z}sNDBh@YNCN`Ge(^?mBQw?zjV@?!FsM_4gtf+FGHe z4l0Ry()@aA7?IP`{hHoRzapB9((k1gqaXV1`AXzmNdjmoQ8SNa;45JeD}h|zvryMR zg4(mx5-tSOk2(PiXpF%a?mVp%#TVuq$RB7!Ef;Twvy`vF>y8QTKr}GzBE%EZZxN=h z=kvZO6E}#?txYi+N7S4IVv=PNO4ls<`}56)Py!(4>k2}`3sm(l0&H}dcZ@K$goO7Fsj!r#N-f0Gs|X!kP( zf{TGBu2M3SQ8($*A%ZY=L|oE|(IOfAy5>MtTP#(13~sbxX?Ga!#v$R>aJ#y04LBgC z9q42Sz=SsW-E;kPnkj3)k=Hf&ly z@=85wJ}jv-h+yS7^5Gh^04J+~Gy2NiVeSYQMMJ06A&dF9$M^@E^O>xz)|Yc088^!c zFsGd8+ks8Sh{mO?538(5Ylp^3io>+5({sHSEnN^~?CpVQ#uc0MAplNXj8#1sCjZ!54_KVC6F< zMWAiCcdT+$`E*F6eC1SBW*PkV`k|+^=~o^VRTBC^%dUWn829Vxm(wqHA~JTU%FwJm zP?iX-EK%vRq4G=1bY!sa+4;D>Zxky5mu9^I&UTf zqcYk=1HL5VbY-27f1;tiQN1ART9=t#k5`9(mW}$UAmRxtW1uE_48A7kWpRLUYn*vJVHE=5i&(OxMjXE)iwXpW)GT|2$=;{^uhSG<$ zRIX!=_qBe(fqzbS^0R^88LLX~D>w?jJt^8)>l(BB+KPO08;M`gMnuhC$_y-{c*tit zJr{Ks>l7bw1hwGZaCL-YjHy)@6rG+Y`Mr+9VHSr&}7b@Z%s#I%=5L>H%I ze&C|2Yx;9NvVxylm&F_SrMqI(uyl8%mVz&I8Q(s)bpo%VJrf=Xbr3DrGSw4pgS=j9 zUTK0oln|SKECxt4;e1^D_)*X92^b^+Y?9Uqi5&!=FTxehX{boh^hg%h>A6#{dfY6+ zTFlxzzy)0Z-C+>R3V|jPYx<#5l_MxsUTba#wDQ9%X;wOdH!%%AChqqpG@21ZF4opP zrF_wcg2!V5$0zYyV-S@QJtYv`84b#AfSor{M%9MjDuCVR{Z$+5-4(!ZZR?#kz%pRW zSGo$f6vJ*d6r6MYOOgIn>b5FYrM4di4tr~_Cz1ij;~{k4J+;}Yo_}i5%wG)+VMxbx zW~_=HG*o8%G%fpCOlOSBvk?u{TP&316`5K}n8f(;Gm#Apwccj?jQV5wBLV_B=VpTe zZVzM?XY<%%86f;&6f_IkW;?8CKYXTXQsxX0+^}lU$}?^_Ddhh&{Q+rxa}_jeg5Gce zQc`vtyFA$R+t4{V7|Xv=VL6_~;Mv*)nXK)uyw;g0@2lefP~0zEePx@O3!25I**-R& z{uN{dpxB%wGreD2Qgjkq%bO3l5kG2c46fep=-S4*-&mdB4$CwpgEwo%+409`!@ZpX zeA>o-+P+%sGtOi4_SM;i-*(aFBH1*#gZ~hxQg*}kl}LEEw#(FK zn~j!CfOlA7c}A2n+PpH&WG?(?%a6f+_zewQWA}VTD5{0&g6JHC+JYN_KUmrVNptTv zXqF(lUf;sF74<`;!#MBZZn60isq>!MH{%^qS=1j}aH?BlgB$dp`7eXER<(Dh?RO2I z-;-%tjux6PHd{8}uPGx~=DYtmFg9V)6A{r;MT+>4o2h+6Zhq=zSunz-^LbBrv>w#< zL7t%8HnzziX^W4@a&F!XebLGeoj+5XYjsgmHk#FZRP@?0T!N(CME(%FOidAkjVIdd zF9^Y08iDsDoP8V4eKVX50_V8|$Es(;+5zViY~!0``E7=?K*D2!kD%V8Hu0Zr+V#Thn>%DXH z0tC`+nvDP2?fGKTzHKvHkOsG(lRX;m0RJ;(N>FJrIu#ojv;?QQ0$~B_OknbYoq=kY$?&gUPk|!wswYfHMtp#dirfCP4?&I&}Hb>1(xau>{B!>AzSt4 zIsB0e(B?PbGzt;3;X+o31?&n?yFfv7{q630ORy`v;DQnuJ_R{{XnCRD8ojeVRe*2Y?PiakS-(&sVjjl1V}63PEF`eb?4^F z$(}bVYT54wRdr(5y&yQ^I0efBt14HcohwqEl%egaCUc^+E3O1WI??b`oLcLnKsVEcF~$gnYyfl4obU9?<8Eyc!UIurb#CKgP zMV^QqSH|D3K4c4ZC3%T2-a(t~g9Y`mjn zPVLGZ>@IFy#J!}&o!#pBJ;d+S)O@Z2dYIYGeYS4E%Md@^ZU3s9fEa5B+}j|^>)`Lk z4ygBL->sZ@?i2s_wjVrf7>o}r*FPE<4+Hy61CzZYCuM!pz|8;Fz_c{~(!ex)tPKA{ zfmy^PMTFlffd8X`CH_kT>xxnQ3k1svtAIuHB&c+B{{w0|BnXNc+lz;%r%naq@gUZT6_4NK@ ze}n$7_BZ0c?XMYKtgXPC{mpe`{^ZG1?ZaLbz~2(g^;YbAgTLWH|G?j1{f1DX?nvIm z2>Ji9zlwPgy8pJn;gO!34#BA6u30npgvc%HCDFeqk31mVtWzz zO#@eCIR0A$_g1QPlxh8cK=5EJ-|QO*&i)Sw9!!!R%aEPQf9v-B3k1)W$o<;{Z`8@I zeAOBKpL*Y1rOjNe`%TLw>b{96WJPsCqNr9b{N>Gx)WcQzZZmulXEe{UxE>R0dN)Z`Rodi}pm z@c!!f!QSfK;pqMU0>MW|{{q2JSN{qA=^`1Glom@6vYRh7!tNub(}PPxk*|)vH=2(` z+mR8}W9Be|^T?Xihoa(faA>M@v4Q)@sIg>Xn&7`u(P)FbteTtC55SM#i!(2Y zRJwS7kr%zEksTlz*`LWqW?2lohl^UrB{<%k`F7`wh)chXq1x^1ia73tNo(5(8jO-4 z5lciuP^L^6Vz$S;YC=w@kx(Rn%H(Q9L}zna&9>TkV3vFp$0kM*%Kj}i71AVDDAabc zSl{fmxQuNIqRWzxDalwea2h!-w)_et~xGATX@ z269|57%|#AJ9}A~1YgM#~qe^WvQ;fPgU* zS5^L?$m9XN+DuQ))(S_Fu6krCBC(6^=nbk$lthJ^cP!{?$5k-J82B+t$I=)`gaJQB zRTH5k#`&*T3mZTT%sHc>w}j}-&Fy=&^<5_K2H9aXbmUxi`8lTxOnMqTmG+-PXL2xnq0F3SK&}Iqv8AtRv&=ELuPPXKF zUOr$##+R);R0IC!>jhhfEr}#(-Ld!X%UaXtZyM3=))}j7?t3Xp zk9yM_0QsvgSocP>X{fZtk0;3Y1fCEtS^d_x-;!)>ZHl_cnzU8%nv&fS*M6*cq5zB?d7n`F?U_EU31$$Ips42`eedmGi8utgQiy&)`oP1`rjDjhp9 z3BGV>?GU&8se7euUzg-Pj`tIp5$X*T>1kuc5RcFP=+S|ouKC;~`6r7)fDe2aa`$hq z>AXTuM??fMqbh2HOL@FJm`KhN5Ihq&YcV{AUNEtaewc-#D=8+OIjD-sViim86Cv=I z-#avOqzEi%5K$C7-H!MgDVA0#cbc?1dZ2el{{6O;7;;9jRQBBR7F;%<1>a4xP$S-o zR~A-lWe~f7rAQ4YJ*D+c88d3uFn+U~^PQ zd3lc&4$`n7mE>=RLE)71)XLoTwJcqsjp9{koZA_Wt9wCq7l32j2e{x?$S}{pN8%!x z7a@Yinv?An!2oS3IXk~*J^!}f_8-bS!;+Sk56{55nV`DukBVjdnAM0Dfmy*IlZX(J zMwEKM>ZCs$@DQi@?HcvZrw#&PG#(dEy8)-m-SD$0E^{NJO1(6gzTs9=+>+QRu!DMn zN^2PUpZyuwtC;@p+89=~O^f@Nww=W1FopOnsg#suf}zoVawiR*4A8tsqew2o6Z2*xW< zVH=g_>zYijrGIO>)8bl*l zqvph?>iTek&1snjMA64$rzO|T%1jAAX(a^Q6q;Hj-=Uys^b5>++a^@D5e=i@iWfN# zwl%x}98(|rEBL)?wQi=hZ8EuGgAZ%V^apWxt$tD{xuA_5{MyO-#{7k(7zUw#)g#+z zoDMYPHJeHilY~s;dHT1^%Jl8`7-XThckL&dFLuA5=TuZ@MLaJdNVGARbqfXGiVuC;dXOy#z$cO3&@? zGG+(`YGAZyen~tye+-*4-Xw+BS`Kv{D8b4u{*t>~fZ?t8wDwEBCHFJ{SphE`i+?U} zDRC*1G1BaNVDLd5>^V^T^ZdYvR27p=1kNy~$qJ(21afo#&0gd9R-;vjiH4Tl@H5_z z20nYzSyz>f4n22<*rtzi#w6q%B@2Ab9kseIKwW_>G%AK6qHe5HG3w|gJZMKHoNLf2 z^*KqGMbP`ksD=R=-iDQtUfTI2@a7dg%rr?g={t7Vk50Z8GiSDAqFJAkD-8o?)@LIN z97;dA5uPI*=)5gniVlBtUf4ii$|wTRaeYy)h;v`BAGqvE7hRD=N;wfwae}$%!|vXW z(}yKjO}sD&EJb&ckKhx2;nv}*bmtc2t7ZB8chsT#Lmj{K7z5N^j8dR8iRqFLRRRXC zu|OW)xAVAYJ(L{s(^jrd1My`Wku^&92n>_l95Ne<0b_<4?JLVW%bHX!@N%d6{Z?SJ zU`q-dgv6=vifQ>a_U>A^VVeB^*|a1~iceaej_@i!`}>XvfhVhRY74mPexYjiEk@2}bye95@z? zvJAT?!_1`_Jk(~v7aL;K5%PuJo#?>rMF7F15vT+vnglsKwve)n`E`tnW4V%|-n$#) zIby(uIgS`_-5BGSc&JJ1;xsx+=n6m((0}MSJv4frH^!{z6G8)x8?v^2d@J=9cn9)7`Nct`&k*Wx49gtnXL;%hxP;7GO?CN%#zh1sPG&kO;%_+sgL^>VeX1c= z;xLl_uza*thke8k3qm=T7J5~9`B2s>801)%rF$caPM|zAC0#x=1`7#$VZiwFatzg9 zI(6Jw@i$Eynj|Xe8GVet)oAT-o3Tz{;%*&yB^bxL0!!WqJE;M$x9pWWp8P79^}bs4 zXFAnE86)7mazHT#0;4nmcP1S#3G3s4 zPVlKYwHG0+PsVo`L2WEW2Oq=Cn`$i18#tS^fCnG&k(Yd} z2bp8MTLSzqR{LiQr_(bJ$A&7Y<#v1=z9dz0|3PTR{6qFF0wEf^e zBz|wER46}lv3p8;h{XBO;35?fQPdn zQUScJkw{kxHfuSpNqOm1VKRB@mx=NVc%NfL#-kC?`H4?ct@%Z6aAQ;j!dS&vM{${| zd6TIouN7quNGXpu#ICCnakX*{(I7*#OmU}LeV#+^4#QVZO#Mq}8!wQpStax|@Ogzr zG8}xkQtf|Rozj&&qZi2K7Z^1JbYoA+Wk9I3G3pxRZg0jf^ZOKU4im&%6jI|NZ3#nO zTEwwXoIqRGLRf5puAAbUmd;DaUCPEv5!^Uc{H~jDnwkL=XJ6deJYJiPmK*;gHP2^) z)SID!e3xXY7Ly1ch6Mu)*%IEjslh=P>&H6!&RZ=?$ZI~YFQcF&D;Ro5y7EF1+gQwIC|;4T_JvM=oU)dxpkW~XT9 zX{)B!Itp^i4hG8>*RtRdvqj}#GRKsZ^vjxo4-LmFjndsHD}Vo`gu3x6WQ zlwz41HWd6@oyPXf?^!^?RImU+Pm>*{PZ6RT)hV}l{sY>WB zP)g|$AgWo4_R5~p&3y`7k^Pio&v1#{-=PKr1^;N9ykFvKgRP57b5z2pP#uAy%5aX$fsDoa1^~^$G!}I9@=lZ1uGRAq3w|4Sx)>W?qcycf99bk% zhbe3MZ8yUCrBe>2sJftBrK9{V-&Va223}%RlURg1%dY9Pt8cWeARW_`sp(vOOv$tx zrGCuWU}kJaIP!tlvuEa`3Biy*IO!Z*y98@GP^~&g%fs3NE`#mRo%oT!k`*%KhA|vZ zOzkVs=&{bhVb{+42YnVv@LM~y{GFVPB|Ddc0fIn!>MeU%w89Ki03wQ=KYb5=Q`IO% zn9!4%2K{zBL@cO%% z4b03kfrh$4GEL(0i?H)=?1Bk?A9D{Ix6fxk)H^@Jc^}T;?LyZ_jB*Nd}x{>y#%yQFoJ<~ZOh>e3)i?vpiz*q0K9WU3pIx^M zy=`dxH$ugywn0GyLey0mzA~x60KB2_Q~>d$5Ge3SOJqsOOTy6X5VAP7y-)lukV!x> z^xbR8#dVsu2V*t!&3v52an*!;R#j#3oAn|k2j+PmCVkT^uPH(d`r6(L8HawaA^lQ5 zszlA!xS?AK1wTm}R>Shgbu$PF84e20$MwzKQl${Eo;p|<9Vi|GUnJ1^d=EFo3!KOf zm{-L_2rWu<&Gywrhb>`>N5K+RVci2p=FcH^Cz=%uAbPOwJF)`xYBCinGMRm7oK@g` znh-KlkZR_Tdz+AJOpr2DD6&F%r%(wLVA&84re#GMITF+G!ogHD!Vh-`fA&Q}Nu+lL zd-!B04-HAgG6|Z;1=V0)Y;Aw~v85|~99H47nIxbUAVF0KA2QCPJ0A2a! zK#*z&kgDFu4#bp@6O@plvt5bzCuu?_8A>O~ug3|E$6`T9RjemH1IQ9iNU@D4*{{c$ zMyFDZC(=$x60ax4Mkh`0&ps=ieAzi|+d1vHJnc<6>kK+;6hdzOdNw3<{-p>hmz>gW znh@`djp_?9GZe%+n`)-IX!J1eTc{^7#bbarA7)7K<^4%@<7tfxQvLgrPd||N8&9jz zPO{!#*1ld`zrTWlf4_{b?t`u#i>{ttFS=bexySU8>nTa@HtBZGG0(6MPCciNv1L>B zs?C5jDjOYp!deJN&q4p!8aN&8Vu-r3_izQGbxk-qk05-3^g+I ziiSVpAp2$X_S=N?-mL$|D?|w~0bEYrQ~VL+DF9*z5Dra)czF-wG4Mt%77pEdB+Q%y>Qtj#7*+w*_c zz@#7U`rf_VS^w7>xGCv{6!;K74x0OS4cy@jUVM8a_#ha}Tl4pyHSoK8ucm{szkkc4 zz;Yqr!++PngvIdvpI*u_UT^ zy84S=gFtOm>rijyT(`wm*bkOpt6s0e_3$e*@`$Z|JI%?zYhZbDZ~xj1yR-x2kyxA$ zS~e0*vdy&b*eeazZgu&S$rn=u{@hy6l|&!?S!ZXm9xjsnWVMxNUQuYG?3MJkyMFJu z`Ofo}LonasVsr5AmcnTB(e+?56H9u=gLZPQFSO3^Kj2@h^Uoh!&kv_Kd++80Ix|AC5T^k|YW3TW+9h;3Ze-_tG9W zpNK5#KS@)>bKJ^Mr3>6j_b1Gux2|PmxIx#zEom||&u*XlGOT)TPdwyO=ugDDnV@dD_xGhK|@p7By==Yl{r&WOJ3G9 zB2@}IbvTAHiB&8~F^OV=vj^Iq4c%+m{tul6vq=Mr;+S&H8rz`0C!N~<5u=xCBU5Tp6;S9cS6p;bSI}vzHP}&L=54L+^uQd4pMD*3Pz$zfxw{Z zg=ok7Ui9vt`=12nZs#Nd_M&n3yar*3ysmxVyM2`?4rrh5pRZ`SE`6^}$c2XB@Z=u( zVBq*ve3M%#y?x&?CxmocAjzqiUiKjV%teF5Cyv@I$QN_j@>yXt;#I+(U2tcaC6h!q zbUTTJVVkJrI`I2FY(4N_X7-?q-2?D1JM?q>eruOH{zaa=-2-}Z@IxP6*JNCKi z+hATF@LZ&m$8DMEd`ec=^6yf(9?^8u#|LpT!U!)$bO@M>tj&j-H53_}^l%eSw6o#L ziN#|T_75%(D&b`$89VWw9HbX6M$ssOb@w^}KEfmLBA$8EYQ78C z-N6Ol21u~?fWc|N6Nk8pCDjGs{yh#sa@dv5`ZA*&kRU=!@JBUUekT+~2QmpmaT5{) zeh(s=m_S%aj7wc2qAu(dm6t+Ek6koE)O!PfDKoCq)1UDOrE~k#^llT`EG&7G+Yq%J z66qO1KBdYfZ93>hW0u(07oO zUb{Hf{0;Eo%~x-JwJwzs=@1Y@sFhO6N|;_S114Jrd7`ZfCDFReIR6ifcR6Fji0l>g ziWl@CJR3Imp#nU~2TKIVk^MVs@X)563FwHE98tCjf>ZUNacb-0f}bFU%@f6=sE3vB zPgX`ng`rW5q=_7|BR-a-qG?J7?Y&drI5&6EaxTqD-ymng_b`j?YWsnu$ThseqVQ?= zbhw_>4yGr0iS2zHmA@d-1|*EyZ$m@kpYI{{g758hhMtB=pQ{}#KR)ZuMQOE^Q9Ih6 zFzEVttbBgHmKGLzUY#1kZmpzd7P{|>?F+*$4Bb*?S`yXYfz$37rgm~o^fx%b)x!4I zv~-&8)cu>a{(z|`&|JC~J{x za-hN{b};t1>(Wh}(Th10{L5`A>9|OY7U-v_I-V#itV?Tf*ds*#Gs%(gIpeSBx}SmW z3?bTWb3u>gf+vAw^W&|}@JA~iZl39JF?ZDE01B@3HX_%fyTECO`lA)zAa5?!B5D3u zAzHsacdnIOSVa!8?1{P3#E4R6#~;E(XY;&CEy?Rl>jDOPOR#+xG{n8Oww~+K6^X;u zhKZXB!|#?=v^Znn= z#AQx*COWnxYFNWeleC>ix3Y`Y?}R=Vw}tjPB6#MvSo(bF*eZ0e%-7#I4oc~gW(*VT z*5B;CZ|#Yfy7J4`0>8zqaJTMWTycPUMDKAM5Xe+r?C!cZ5#HK|2u7~w;>ecJx$g(* zja=h{fq1}goa5fit`5NhdgR7)6S9n9X8AA6*FvpR*`sc$$UP{US)J9?@165M6&$kk zKeYR^*yX_o+VFgf{JIh7A^B!-B5&=xXq@C+&B%A6j^{Vg5Ofu4EjYiz!ueg@&@(h1 zvS5~c_f6f&%W5}(*mj#|V-)2oc6dwIP1(Qhg5{_fWO(Ij&C9!BblcBJaK*{Z|8+X` zK8IFlGL%%Hh4`JXt^DhF{HFj$@k{-QaQ!>M%7C8_uYb0U3b)FxKK|Ht^2?fjIMuQ4 zO#prK=@{?pF?sjqf1#Yze#uzg_+Q$C#f%(G}ayr|;hGzJK$%r!)=%f`lKJk_D4}NgW@j|GfAr_dn%2 z2cL)Y&QA*qZ}k5u>;DECxDW5Fq7->X5_mo9*Q@T|D-(p5_z21vIDPJcz9jwV7I_L2 zxfT~WIvarX;6X3{@MpO9YrG&9xZ!-d@2C9WUDyCfK^U)I7My#DVL>DN}Dl< z0uk1OF_@(uFAwQthHjq>X`2>FxL>{g4wCqM{kkKAzQ3fA4@N>>M(8HS@7JY+Hl-q{ zIy@cf-b4*1L=u2u&?_p~W9l<~(dL3Zdg5tJlN>YRwmiZ~=Q4goV^}?ssY_zH1+qPI zvTlsh3IZ}7GeWj4-9D_c5EMCY5!n+)8ObGCvj|>I;t_)p8Ig>>Obb~LcUgRF@tpn6 z5%(!&4>&jWsj~C&LSpe*d%1>)5zCO_YJu_c7V$~`vCkP2vUHrEUgTm?rXybX?E+yXiR5IjK*=yhzJ0=uc5cmrfXhga(+ooB+QVD z%n+)rRg1rL9v1}Xrtgr_Rnajk&e58Lzw0_FK zTT1+FZOfEX3;%|IBI(4q?h-7tOb>We+-c$2ePOCo7+(-jvh}GBU?Mb}iw?eqH=K}N z9Z_gj5bzrLdam%*oPPYWoH01$D=CW7t;KZzvsC5g4BdnxdwkY?dEK>v!U@&4?g&0A zY&npmxPZqr-LV3nf7a`Z(&Mk86iUAC&5`;tS(IflZyiQkk*H7!VN2h+;74VX0u>lk z*|z6NkfAEOf{NLWcwa`VCC2Y=NA?QJ^SGz zx`aoScpBXmURAxX!Ojf!m7{gMHx0^DJ*OF`3smNE|WKP-?c1@ zaWHAitY}_n#=C3jj52{)HJkIbcm>0>Iha%jv?w!&md><>*P}53-|HE*+T38w2AJ&D zmMtw;96`O-j^8n>6@3N6{5Y8$EHyjy;cqa89M+&Q12CI?{jDUe<&;X!}zYAzN50aEsD_o>wWis5-g#KlPf45o#UYlE3q(TLB zBLSW`I#E#98L>6_62mB2>)mCvtXm?32jKI!wC|_af@Rb&cmV2x05lhgTy@nitJGtR*)5Y{K8L zREi=rW-r8fF7!W6tqG~>56?HU*ZTntPs*586nzzd0ni@j52j9T%n zI&BQ~Ik1K%68ga^c?+ZSeD%`Mze-9`HHPHYH41ebpFjJVfR61Z@rXB1U)D}5R)k07 zKDTOo;S@B4Fsj*vw_0x8RD3DpW$@*_U>{=S)JxN z*p!aC{^Ga(L`66@*Ur;u{WH$+1v@XEkP<%2_e#a(@xNaudUsJO8%UBwX>i&}+Y}ED z#qkDKk*ti=BsPNQmaQFRsg2Ak&O3)Bln+{U@O*T;7Jj_hA(~X|e^iU%ZmOT-(~wR= zHs2^zZ~hzo+j0Br-PU%m36&OSE!FmIg;5~Z_rJ4W`Cqpk9DgvNjRjupQFCpJX>E=s z0`X!@^zl{m{&V(&_b4?5%f!U*6LJNj|^_J@@*V`lV1+SVVu|#An6!J&O@$cV%@7+ z{nxL7=yp<#brcte(yxafvN~gXW$20)10P}C$>4k1B8}(l_2(k{UhQu>VE^Jf46!&2 z3pw0&z>fC88rnFFzrs$u!uHU>yR$|QF~Cn~IouAIh|v6W%Q81-7o$GcOMh8UC{P~; zvI4?CUcIo*PMPw!fAts9Nq)5mt>h}1y`avJfa(zD)#}lIE*#pkEVLIdGB{Nh;YNN~ z@$VSfZopY?UapfgSZguqwUs&gx++!KvFq_Ueb7JQkfuj-18|xK43T z&d@HE#GQxLuFloLcF0%40!E@1-Ton0GU-=CrOpciTrWqXyf~)KXU-uY=+!|Nhqe~r z)$os~@8Ab#G4ty#Oc!_DRs_5&y5nsmcpfBF`(`1o3Zbu`jSOr7H}&p%7!T(pm!^jN zH=VD;vxQ4#?yi1BH$QR3pSfI3g%pKGZi*INJ@#)fA zle4OwYx|Nq=vsnEZdB3r!1AX4?v}-0vo=X|WQ(&k?K}3BIJp(Scru&BJ9{4p7h0x7 zrN-Jpkp#O{w}5oJaiYz`2Iu@(9hg&gKdFXI`?8)$UObw^Jwan@tkHLd`|E54PA^Hn>ea7nunoBJ#D$aD#m=uqB(Bkm z<CV6zuoGled+#o-}e3osy2s{va4%`z@3)qA_K^Z=30c? zg(w;Ng6WNs&*rSZXWZXno#k?P@AcNa;SFlL|91PpoqT7Qf7kA@!``nsY479*Vu?3a zyGOfqY;z5o6EH0R(%blE2m9t^1KC%1U1{CZzkOB6-pkqcExPh8e)EOA^D8M1V`u`F z3Hy~R`!RNeW#T<$DTk9dd7ImN#tY3B6l+&~^K00CDl7(mDh4tj_%l?8m2y8Zb^w_M z!kD1T`=%)S4mgJxf8Ug7-|A=I9r&J~@R1;v>JP?tWquPQr*r_gj5nX~cGe)~2F{Lc zE0#;NPqi;JKGo@uC|X`~rQy$pKB{G|ys%O1{qDJCUey&1iuk?{!;f>9E@oufpO*yY zt@Y!^>y=plV)kDl7zbKB>b=d1-=m;;&*cTy)%zO8pE;6hTEv9m;fx4^1Jm~dMehH8 zy9KXj`8yRIS)6&fBXw zaxifvv+}Wjxs%tg?<$-gb;4i-3+W`8GOKHoj0hwg%=G&!@{t%!TD5wc8;Y?6LfWyX zgB!|;6bk7yCR?aJkk-s4_A5gQtbnnrvrun)XEow;>2-U4az{H?438?uXxBnFShfIu zZ_AUhK2(jEx?6Ae`*bvkzTNHO^!I^WUh&EZ)8aeE^%kOHOwH4K=FJYdvJS~3Gcq;{ z_zKxXLS^Qi0fN>bW{0=O>xm{N;rUo!Db|C5r31A_hc!CGvXRU8(5Fnd?Z{MV>8!{{ zj?+({?Sj@d;Ap58KG!MrIXt(`mrHWLqmp8}x|%}_on=W{_BcJ5l5ND@IB7-j8LP4% zas2yvplpEW-T7tj2hGzx-90_0R{@rlZ;}}VS3!HfAKl72M65izA6~YwURfSr`z1RI zxJ}$Tn~o;!eF2Zf0jOP`5`mKBUkZ`ERlg+j-<*H>7Di&lffh`c5lPCfrj3&fQ0uuTS6Sct^mG>7vZA+E(-}n{0$>4jGkuwr!u{5i z1!G>{*um$|+_ts=c5KPW3}I?jq+kr;U(bVXO`km&@d|gM823AX93d>dzgg-oyIjbz zuDWk1rt5lPkcp}L{&e9)_AfofpZ9?HUz(!f`aREvYFK7iM+oehibmuv{69ACg(Wz2 z66FW5S&%UHOS+CyBqy-Vd^E?Y8W~BLIhdGeWMKa$_^IMn74blTV^WAH@R!68(2;$f zm+~*if*gq1V-fEPg>!{XzJZNZ(-_5N#ngU=c@ER>!g<)NPS9&jy7}A_=+h|pFaX=m zjQUZ7dn;tq$`?D61l00Rhr+d(GF;cQHQMWMF zv^UeTx6!vWGqSQVurt?lu+?@k)poJbce5~bw>9>$H1=^cF;;|1=@wQBHg@XH|3T4h zq+A@-{X8Vy+%-Ksbv=D`eY{lsJq`W+HU0hd%q+}JEN#u~EG-;uZ5*xa9UZKlT+H15 zfzwTVt<3!$?A)wu-5u^>&z2%6 z#K1bl(LT)6Gt9;#%HJpcA3GhIO%!^v*Zd=;{}W6^1PcA+DUY$DL^|3NWN)BfyaLeiT_F>{@X|&OcEbUmxd-0EBWI88tH1Y&DvYFVyo>M z<0bafbpijz5bpn$5MsyB5~4-&XNT7Bdhy?% z7ea@o54A-J(Db3Qv;gX#|G&9I*I*AccUWnS+~`e%vgg15J8n3bZ9G}&`A^yKwA(ig z{mjj-{vTPx$@=is-nYZU^~Zw=Xx0El&VL^NgfN8<7f1 zXAO-d5^J)lLw7mxl-Cnp*PhBq1JOJOwy!Xn!& zmU5bwO2$Jo#HkC>?8{_Qk=s*PH82u3y%X>qp+q%n$zV8;5!YZfWq&*g8H%h&D`Ha# zndRgRm<)z~gNVnY^+H5J&Cp+?oQ`^}_RSc(WCew+T*T3B1YGqt&9zAAh*ml$YV?aT zX^g6V42WMkXL7?nU!$kGS1FT=L{l)!m3BYivF0(n(NnheEK$q3z05p?!6G&q_WDVp zmh=T8SWY)e-rzQFl6Y^mY8y#nA7^7b(sAXOMw1_rnI($i5|F18U`t}joX>^9qO-ED z1Ii+G)@?skj1k(`P`il0FyXq0*fr17?2C3zwxx*oC|ZUiky@}0;}}^iOuEweE~L55 zw*K0r%}sC}MIq3r3PTlREs1z{hUy7Y7xrAMP(KhXk0MkP%(V2^Cy^Y?`;!Ta3v%&l z8vwfQaSsO3J;LvV1mM^}jDuTKAtn(7_dDTHvUCKNS(1ZbOlg~m66+EIfLTmw;_-TH zffs{TJmho7fL+_H)sGr$d~6Icq}?2N5^IDv(_sX`SA;Z~34+{%Mp>5gnl-?5p;40mZ}DibXFgmSWlvJtk&~l3uywHKqXuTA-2dFcIdT7xvEBv zAjNtHQB>7mwFF{wtU&3uC=NB*uG?BR#RXe3rsfZuCN~6=Z1#7vGb=Ak7^_q0*IM>) z%)i=cV)$XeXd{TUg(wjFP{fzf9nx;_&{;M_=R+l@ISOu+^Y=eWJkdmdxo$pKu_2(q zRFq(-u-YQWSGa(XmJAfvhO^|>15EDCja9geTn*d5P@SyL~6(4*A?$^F{M#<%P0^R8`aZMj_hpjAmr&7 z-i!YlraNLBybcqGss|#vWa}72VY6|_s)1Zb;nkq34#2pp8O7v006IO9{N}I#fNJet zf}kj84$O%MY|OqJ@^~{m_RZb5W58$KWh9wQd`ww2-2S72a#?){&@+aUn%pHR_zko( z3(jE%0u^l#9k3RDEDgK}Trguuh`}=BN3LBr+MAz2i1}BmcM{Rn2-WmKYSlw?tnWCH z!cDg-xrYh(>QjI^AqhS_L^pq~Q;+s_##t~wW5^6hYXf32dXqKOK~$zD(q9g#=~nA0>|la`30Gk&(zHOpQtJOeVXjuH}$aV;i`jRt+HRc%C5ak zdR#)OeFGET#~R>I{0yy3iEMe#1p}ENn4CyWMzP*04{P2~NJELE)TL2`6V7CY&wyZ4 z)8AC}t0%tmu%D^Q1k=5N9CKMbO;PAzSHq-8t1*y%a3J)A@s0;!+$D`fh{5KI%u`XB zMo6>%fTas*5xmFXSSX;;IkF<`HgwOAvcQldfz(Dc!W4uqTEmXYD#@;x2FAN@?~{#7 zyb)7g7XJgf)qCTDXliCDOh0qfQ&HGLPu&#ITAXm+=HG>R@ha3GW0Uy3Qr%|DV)~l zJ=N!!yS{XsnkwO~6IU4u4Gfi3IV+iA)$Baw+f3RTfnhb_KpN~CrDgE0+?EJ=$8z|k zS}D%KqEQOEs@WUGU8~jdbg);x7Fhx-qN61vWJ88tmv=%xY#;5!px7!p{eKwacJC* zcsx$->2;goyx+^`GcUOaOkmE8zLTvPo~k39ZE2KzaFs9x&^Sv{DbdhVUkfPt_gqrfcd1o+-=3~5 z5@k)tmWucR5Dz1r^{K>>MxBOK0u2JkNmMR2&uJ9zGn%f43?y!>!dPPdtICNquuQ|L zzcbW?>u!|cyV3z6fVJyX)*B$k&pk6!X!3D7UL#s{=79l31X{fN)p zG?d66?~+hBhsT^tW!gOLQB3d<7$+k+9cZW3;_zVP?HzL_Js^LF;Ta?!Xor|~-?Gav zt?ST`_1UA^^EWw9<1iE6nv#zAfYkJ$A-4m^<-n}7kQY`G9*8KySRwGCq&%HTwOy70YDSOp7xOIs92FA8 z;OFTje`4Xp5|dxo{4#0-qe<2|HQM4%y}8oi^cd3C144F}u|2X|&m;KyWm_*}pUkRF zT2zSp(3XJ-7Ci(7h75q)JOInE4b#R5B>3U+iEQu8OFgv1BTV5Cu0J&01)qo)QkUO* z*;-7WNrv-8!+B!w0OZXzg0IpZIq`&qSN}=0E7t9`agx(Jv-&1ISH9(GOv)9EA8-`& zA@R&z?YUtsNSa4nu58B1=|UDIz-GuX4?RW%9A*`Y{K9+4788$w@PQn$w+HPr4DH)~ zs81io=Wo)NAiufo&L8($PLwM*FjzwNr}>BJr92kl#Awz}0;}Y|-B|4^a4p}wJoj(? zXSG=<-26MLtVYKCZK7}+umXl2Lh!i76hu_<)WnzuRDa(nOvAf5yL+RN1=@$<29E)q zc7bc{AgK^=vMT}`9qIyEc(jVo4lU*WxCJoOeJ>M`Lj@;W9&|Dql+J0Pd<%2s1%f_G z7HJ2wdj%`95h?epz}k3u_L+j(B%nf_{rX6g51H1G8}?j9fFjw zLryW_`9+)7t|JO0W@=UCV&4Jk9s@%u+>F5w1emNgyP*^6QSCgmbJk(jFfsJwVQx2J zL*_9t9f>g=F-bRpI}b6bHp;P*u_Vn(5*8%()w0BZ#FXNxzj6D^if~G)ELj zLzU0CKh_B)xOU}U%&$kr7cj`f=qUh1-oI(l#Gnt9>msE%-0JOt3sYz&hle&zT_P0e}D#Vr210k+DhD*l>C)E!$ z@5`a>&ZQ;Mq857+ozDA5!uXnMU^o31KjTq5*`3S|xC+(Y^=ij}>^sRyf0A2RQ;2Q- zZG338|5)PECG<(^w|Z)sYblt@W<{BVcXWQh>$IC*O@Mp^4EWM}NoS*S1TN}`F!JcR z4YCLLN-LwocGRRX+WK^m6NP-S4X^M~`-px7PfTGFTX?M_^oFA={8K_o4N=01H{(x) zD6gsmCsD18z|4X1#~oazCSW>QUYRdSI(jC#Os3+UNJEYNC)xaQ4}GKGnI<*(?k4&3 zzR>k+NsLRlds9Bp9L8~yD+{w=s569WFM7Euj3PJCf6dFjBDDQ5ut&6T*|zX|tVW6l z9JnNB-z(`SO_5}E>_t0ct_q?qfJyb%Nn@etZdL24!?H-XxQRwHZ6M?MPqIo4g4<9C zOc$;SJ13fy)wP+zphp6#UH->M$h+Eng3npIYNV~)0Kf5)_ei*845e%11w$Zf#SjPr zAFNMTX;ik~BOJ!gegwyZA^L83Jg@I)Gx1?(P+F7`(_3>ow<|B-N9x;Xk7pdq8Q+>5 zhGJPHdwHb1CP?u!FLJ^F0!z5dldC)~wKTkaSk5 zHxRubS1kLtYZ!w}sdH4Rs!GP#amCbWMc@-UXP9x6t~u8jx`PT1VTpNE9-@#{QH-8% zw-~Ra7q133NXUg+&#O_5OYf9V?^ewuNiR}C|GEgeOBgO|J)Tb0Q#Mq8c4Pj| z$*J}^OgUQ|h@)k*>X=Ul4 z+LEx*QQ3;1r1wdMuQvW#1U*A)Bt}%7vAq|oQg1p@pPxL6{PUJMz7qfztBt%Pua0o4 z1Wtso471*P3Fy!ba^i<~o$l-sZx1q8KHx4RXm&r)Vw3D>&s}W~A|m15B_9SF(~xn- z$ZOVe_7W16CY{yDJeODS*0ML@)=X)-zo~R}A=g>vwrbNXMC?#}Cp~ z$EVu3a+v!7i1+|-*IjMjIh4x6S~i;h0zU&8KYyC)Mt1!i5|vA)4y2Qq9^FPEV;c^|;dV zpO^zsR3>|gHa;1Q!U6p!#*bTd-r^BrR)+qfiBcIE&cN&86n&H9lIyYT zAIqwb?^i*Ys-6T`9`rWRa8lCaVUA?uV7JN;XSqYF)@eTO+Xy8~V}CJV>u{R}3nJkq z4AM3uW?sXJJP{!70IW>)nz1=Z>1KYD2aY801-^{42-GIb^-d6gv|eUBZ{eb>e_eiePFhRT4|etokxVJ=+iAfKIAQRg-R8Z;DX2rf zHS{nbIkaPyf%(mn1e%mUhI8!&(?yWE5c_yuQ5bTS7A!@Wah#bN(INc8c`^4HVv>|l zffPH&VXbq}?4-TkQzkxk6E9P^UfnE90zDobazWaEeJyMQDm2vDrqS4trCJpRHrKwr>h%!>XF$CmF-ps2&Hi^WLw zvkL~DD?+FL`QEN;#42W{i9Rmq%NRjhM?Y~_C7sdFQ-_oj3NQH93QJCO=j)%rjpFQI ziJEImxqkd0d%FwYwp|wZF$SMFmqMS*a64yT8YXEUC|z^_>^r~-8CvmfNo717hs;#Q z#%rNPo8ToFbwb+1cM}4=^xKGmg=Jc zz5>o)0WwN3N|z@LFE#LA=Mmp$mcc+!@uPb+Hz&Y!A1{uaVnRB6TtT5Cmv_c|a&RID9Z@+D7Ow`PQCdpoN5}|IGgqF#* z(vG5e)1zJD1R?KVTteVSgpYma0`pQ{Ht0|%Kb5*R!5PiL8koQmLtwK)lG>P%O6QJK z-tO9yb`T8aVDwC251e7OU0_8`K&QeW33W|i1@QV45bCfC41f-jVRZp;Cf5kRSddfS zp^t;#$K%*9h)R)gF>MYE?21Pt^LsRzMIz%#XD}7IE!TbjVm<43;&*5s{f<;b;nF5_ zC;~PI-IA{*gknsVMq#xHYQ7|qi$_FY-cDMfVr6_Z%VGU!I;2pIjz`S1;}Qmo#q3o8 z4g(`)&^c|+)UYqr&+)p8{3Dz?6VD%-S+!%m@uzp49OlY z12>?;dHX0XrFh#a+x~PGy*>*K@16Brihm7QP4938pUz;Yg)H537Kb*LRrhUpEKwQK z>Ha--n8tdcLa`7nn9#FQ9gD8T?KhGZ)7lrSpBvp7-#{OtwoAKv@#Nm(x7-+5O1Sft4ZogpXOEq9Cu%@?-CP#|e?SYRu({W*$d zq}R5L%r_`Q%{FFPQpwXC{$o?V-3#7La5wARO^Sx|Wqc#i;2#Vt|FS~3l7_A%yZs3g z1+)sO`cYzs-u%PQu`PKCR<-iZ@Ubo@8VY8Q16BePBliH$_yjXM}mq5Bc{c~46E=_f=)^` zPAOw%HgC6|`1F$tvP8Bc8K)#`lxl)Gl{vvIlw7D(O|&6~Gj@V&XYzB57d)d-_WLX) zaHN{-e_&4fdsV6cl|0F*8Udsj}&92FX`^CP|J7j_h@#-Nh>{g>h+hbjh@R3vo?3KSa=aeN9G zl#-)K76;4D+yzBBdDb zuS0NKOd=T(V5-b}PY7o0wAdBIN--Mfq_>{5I`lj+6HLG|iSWGlh1lT-m_Lc(rQru| zu^V`(#Z4#eRtkr9QN$oH2>2->Z$L5=kkqV%TK2j|t(8`7(X|8(ICPl+tO+Dj2}N~+ zL^Ky^w$^c;k*pBTcZ_MZ5fs`R#=Cz1wlz}jAF0ox*)=*a#(^46&7?aUqLY&c1D~iU z0z^*+VClH)M1NXUuVt} zvz@ajhv88X1&$n{?{`CxFN69XAzqcWjJR2*d^iU9cc<2>7 zc3>4F0Mg0cB!8mH^ zaEuYI!YSu#rS9zO;faf9&wiejZl#4zBa+Yn;8>3wC3h#n^HaPbje6^s%tx^d$+=C2 z{+$*bp}MR^mA%#?{F(GNn*iED*ahc(BLtt^)5O|c1ue-F=t!eGl@YVPJz2Nu~^ z2Jv(vnTUQ9$~(~9(ZI^>V+(njp_=V> zdJoVVUB?akttXK9^kQ{ifvf`#n1i1?AR8+RpnzBqxvvT#>1{D>;K}Oc!xSaa-B)4+ zVFifa%A?_}p_B6|eV3ndv+zU55hQTQ5!z>6neZ`xA@FxXa6qiU+jTGAd)q}fU|;&v zL&I;5qnzJHM4KZl8#BgYJfdueXAk|E~Xj z)A?fj_IJ7C&$6EXUvc)A_o2;g5!eBNKXHvv3O}JWN=)f`VB>qf-~MXS6Gd?75%v>B z0*hA3i^kLoe~4g2nGi+X7sYx3Ag5QLWA|WyDNzN1ST91``n{`mKs+WOe!S>M4Itrw zFwq2MPyPRh@M{ZD`Ug7n3y9K?Ad#P8(Abr8k*2j~Pk#RboW z`2?GV_CwI7;n+!DVqt6^%i?yl<90gDXS>8hMg>=Yw>A zBuzMl45_4WK1J$j3rZgLud*K*E1uI6$LQu2I6TTH3$5BSb;abbmOA z7}39xwnJW~dwn>JQwHLWEffRph;)$gZj_3jkm+2P*4>u@3CfJYj&|se#5T$}M+m1+ zvWEUm3?L<3=+qq)IKu zs)$BBQRIp`M@rMjV)aLa8s$U;N2(XbveQRP1Z9X9#^&{2kko(~w-&oT6GeFL1K^~T>qu8Ifk4d3lP@x}NA#P8uzEQ3REHV(UFq${fSKZp3 zKHlaq3Y!inI#ZZ_QJ6tdoP|^LU6E_r2Tt5cPjdD+*(ffbM}3V`T+LHltDgMoKe+@( z=oXx8QkYEb9D%?#D((;~?dB=Q!Xj*Hh;L~qCZSC21}GiJPsYek@fj$o3XZ@=Odf-$ zc3uDhg-X91hQCZGT{2CtO~9TyC^Qo*!v+9u1EyCdU}f}&udtQRIYoU#l%E0`_Zz30 zJC)zo0j~kd9NEf2{o@N3(@-QTw@fOV)yjY2l#VQBE<9%D@1`N?DzGIgmyIfa22>6` zq~3p=Xd6n;ohs8SE}4)JTOXVnyP~*%^mP?_>n*eAO>-Dnz9U z6wGQLt{l`xn-zV42xw$`uflJr&&3 z2UKttR|i7hudK=;c)I{BM#eSsRkUCEI9kJ=nMQ1S00A-xZH>}e3BL?86geuwo+B8o zR)m8`0A|cf28J^huWg(?&@$?C<|YV%6}(ngisq;ah5d>Oldx8=Jqb5Uv9};w#TmOr z^}Yx-KO9BU*EYc`&4o@nFL-T8$zz zH8MDGjWa`U@4P1oc|B=O&sjqHE?51>Yg_`^wl+Eu(2WFSob=Cmic4+*dhTRxwHAx01 zI*vw5X!Q(++GV%v(}CY(cu6RRcjg9j`TR*^>s{1CUQdEaf}>0DtL_JywkGS4zCjg> z5x_c*DmbCLFHdJbLoHx%X|t;}K-3T=0b$2+bXQV1tZQ>bLcai&FaA5IFMmTfercyv z<6F8gt>otZq@u&%vS1Id=aV7CA}ZJgbbTS2D54q~2YzP}C zcVwcB@5$>|q3$%*w06R80xq|4ghlX-HmjOik0wnZ@lnB7p!S>Xy!*9_jLEoLqo44` zn&57~5RLW$Q_9*&{5Q}ejy~ZV$iO7xPt#WEMHkZ00(#;k#v2IoS^qP zyqdjFN=T9HRpNkS&kV30reXF?^jys4BKJ1Z%*9IgIDNo11G`V9t=I(%dI7-8VtwQ( z4e_#8Os(%&LEEw>7Fr$_C*k{srRI}Ot<+B2QIRH!q=Ryj!pdHnRhmn42jg{$dr=1F zzhBkbUJ>1w9Y*xA*kCcyB-?Ic)9%z1O-mRP54Q4w~UmDO57M{r89l9`% z6)@Mml-8TF(0AG&gg12<3>A2zqd}9ry^YkMvf9tJs@yPg)!P3_eE_)JbK10+g$G|W z9R}CI_b+afNkyXI%=#;>zbaa}4XGej147VLot+F_-r5fDK@gv2rDx6kiIRoT?j<~_ z-QYS<(1Y@;zD-oK^&OUl@W%0a2`@E^wY0~!TKBO&i>;m0K~vzCgVQiqS?hP~0w?P=Vr#1hkeSB9rM{(V>0Xnhbuij)+2P48(E^;(X>bL6rkBL) z-^lOWr{kqos{sdkCWisXBiStWB?Xh4lK}mS)8N*{Z%+2~ORHLm%D>@eF%8as4xLdf z*{_{%dG*Z1mgzP-9fK#0wT6}g=|CR5fH5WV@%M%EDTm2ThbgHdi>Gr76NFjP3mdu% zo5FK<8IVUSuLs@5v=X@pu7hoX_T8fD0nQZO5U=SV2of*?2%G@~BRcIU4cQEW*5EZ) zh!oBZFZ-yJ3Kp#!EkG<%mV4%xVNH%lLrYyHyeD3#D*{_jF6ZY<$v-SYX*B2N2>iE0pp&J6H<~WUl8sUR{soPT zz2Mbs$L~HggWED*fU@&m+SMv}lVfxI1J6(fmynm%6%wQkO?v#qa|oTa3qyISYg6~6 z+69}*MaIB&&i-1tR1Sk_VxilC?Zi&^BY8Z^EJ&iR^UcN!EG)L z1b3v)KlB^_hYMwk6#XZmd+Ouci5m)#o4~mnWFmYre9{u1+MJg5mOFiYSzIS>a%U&t z0NLA}Bf=fy(-bbM^Fz1evBKfS=1q5?(1BEYA(rBql)_&x4T8sOqek$oz6a%?>Se?w z>99L7m=p}DuhqK*+o&g?{8Np1CJGgwI_z9>A3v8aFaO! z%d?fmCMykJ*k@0-_63u9%$#{xym;oqjqzqKI1r_WtF#`Ek2 z4`N<7x7}Vu0iNUQUhEfMBwz0@E}g6+x}=iqY(HrRK|KavjR?)a226VgZg~g&_6`pA zW>5598-NaG^$8d8iBR^5RDKdVh86MgfkY?y#5{(J)ICN%J_?OI32nnB9)%0LJb?gD zQi>02R8MgtzUj)o0n1Mbzn_voPa;pSqEHc{S5eMS2rf_{mz8JVY=GaBuirMH=m_8( z(M1Mu!Jl66^>*`WFECm(o7r_ecOXjh0ny$tTb}afY>EZJ$aowM$5;Py8t^d)YvKuc+|G~x z=`@5zSY1;MI5KG0JDl85Ph>M%XU3mfO^t>0_o-hx)u7P} zo-FTQsI6q-Ft`AM&VWp$dI2-uNpZ419EU58%?$haz^sF*}!&qW#GX z8fherB7y5q6NSNI1R`Y;e1J(&0ub3(jfYoFQ!z;vMg=Naod20hT#}G}F;Vsg5eiks zuJS-YT?(@JEklT%>w4iHU$F9t!HpD95$Thvo|_P904yOM6a8UZ547a{gpn zPI-Y73|sNn7&JtiLgqjdx}vD|nDB2IFs;hP?i)z9*{NuD^c8oeUn=DmefVv1%Yz6R zzON+6F{Dz zJG5hJtfG)(ZVA-=VBcJRv&!6NKAZFX%MRL_McW0kCrkCT*mz0DJtq9`rkkoSP#q6{ z1Tcyx-?8dWVY!xzUr6fMbv<+2A^lp2jDoI`Ke#9I2C(g!QU)jeniPK##Z9OT4+Ih4 zj8Fie|CbeD2PFWl^%{+5I6;af`W29e6m7Z zD#9#4AeW5fzx)BUfB6G)s)GNQKOict_#cHpNlr>pRa{#^?4QDb;kz)PuJ|8eKw4c- zN88X;>c1rc4QsuB_yCqBy0+%}?p8*=F7L#@**}SYdo`#3BL3ZNq+J{|--&;3AD#cj z_d8kHJJ|n!_J3lA$|K|H0J$?U)_`7@By1BWz`g?c;`uPOA`TF|)oArP1CU^yf zzT^J7y8oR{2>l1{Z}%_U-_JMpKe+$D`v~v2e`KImmXBC<2!BW9KjH}gll71J7wd2F zZ`MCO+v@+t{qqW)^1uBD`fvQ-(0^gR>%XA?7_O;Q-lhLQ|6;@G(&Ksm3;G9FO8*1; z|K{*7=>Plwfc_i)8~ShfpU}U>{{{U=#(*LdlHa-i=r3v6IXPJcMeo&vtZxN5B_%a^ z;pIi|uO(%*KPwvQ{~bGM?(X?#@1Uutt7C9*sVU-r(EnKn(?8zn|NEtidvMD;{XaG~ zHatE1E&z-zEd0X(n423Jfh;UQmUeg7_V>4rj!)Ky-c5kV{o#L@0N3vqjt-As4z8|F z@9r)ipDv%D->raumk#_9i^S?oGQ#yR{bYUWPYB1~|YjXI;r!x0n-*)<}z zeP+p{Qt3drx_Y)Tsq&d@+Gby5-4BcT6@6S(RG^??5HYEuXH+BNNiC-+-s+G3aE8t#fjAf=ML{GxLLF~8Zoy%U084YTM%x(u>!AQVk5VGm4 z=-JyRmu53mgT#(vs+Zj!S?k$pNXJaUTw%~5GMIrf1!XE7&5>EFgoD&oEj79H$cu;Z zHAASE;4$#GP2e!92Q&3~_mle#*buXpjRIfcS4>2)qwrCwGP89|5`<`0E%aPeS1ofk zfJ2t1E{6n?qR~=c5X*&<*X(M9p!6LYZRrf0I#H3eUp$Ke<Ue(0n46n7MDtNvU2l9BkT&Hq+U#9voIeO-Rl2jEj z3`E)TgJuI#Y*k5guH~6#bGHRm9P6>eJ@#_Sl*qD-s`m{>weV)P94f0}V`;7|v_OLkXQZ<$> zQ$n1xuDeDOm)VO&s*&hI72j!c<3w**I&Y@pkmOTW;(l}oFhD`~P|T3Q5e!oeVhdc+ zL5R17pTK)`T;s%P2)L5_Q2p?D;>p)#`TPWJhNX!HI#pun0dC(Jy`6T=L`(1+CRj2P z?X5cXtcs_2Pi>Z`2fLg1XC&53iROm6ZK>uv(@ey1)T9;f-L=Cj?-z8Hq-hArLQ%zK z&ocv?eQa}En)8#kzaJ@KYRmvPV2)DaH$kK*)6Yi@{fWi%5^IY&I6RlF;ntcxKV5KU z9J49|UI$mqb136Y)rQ)pM`N{`81he)vf2p`9IR^@C*erZ1;{58y_)(b9bCM7OQA!& z6&QOx!dj9K15SLXCPuQyH1p5yOsJ@lVB~PwNqq)m1P_a_*6Xuq30=s7NqnGDAuePQ ze~HZr=2Vb*GJViI^1_K$wxzhpno%q~ERm7xb>5n7M3e(jSP4hA;5h4ky*>Y6XUml_ zR~TY|A-u9o)K!hc_F*JktPVxH)5P$3Xh$j=g0At!t@n^_1nX=k%TSiMK=sI=_kmKV zbWE@C&HAE=B@|NQ*N}P4SkCff1#k*Oy*1`AiOLj}l4nRi^3TwdpB4fnuf#|bi{kZI z_6VkvqgcN7##=Il6O8c=h0Yv=<4tYHHHC(9*cU3WMg4>^2OEQ4@Y*?XO%q@oC}Wi1 zhG&09Cwev(^YRqK8%NUV2omCwLDP?Hn#{;X2~tte7LKedgrp?wlL$*DLu8#)ne9<$ zmuLnHM?<|Z4Q)I6nYrcm4&kO;$BXX2q`E870p=a{Ax7`e*U@WMDFpS)&V9!aNfY$hVKXM?$;(5@(k<5tdbTKdS^T|-vE}`-EOV&nT(?ekjXVs{=pXry6i=CMO zqS%v7bDPgFyVi6BcSxKmM;KQm7s!n{Z4S`czlTpU+>Xd7-JrN!>HJmOC&Tuww&MG% zYw0=V{szxR4460|mnri=GO`Q9K~X{wS!u=?Vvb}sQ1`^Nhx8L`tbxudnULaj2JqRg zV{&uF4(@e*nP2w3aKB(?E<9myZ!-GgG3&@bwbrqt-pT*I5VSkuhTg?pw<8ZytG`CxS&UvvLaQmr^fq7q`1bH{Bsc5=hu z?~-LQfgZE2x-$^=w?N(Ss4Dw;f9ZqEUn=--+A{?Kd$+JrFmI}YEF_)cbanj43%Ho^=g zQ346WZC~8u?4PRV57`ca3;~DN$-mb2;%Z@2LcM~i-3}Gm$=0-Ay~lNy`FmTsw`<4O z?&>8QBJO=AN%FduMJRgKxHcaW$8VE+XVFu=C?5r^x%dLCxZO$JZVp^3e;>M$$4e9Z zxFqbpdcyR6TkG>Vk|DoYd9=0kR@pB$-rRibK7rUMqw+6V<=@o>GM|nX1}(@xRer?~ zv+-J>G=`P+im4WIaSHY~cMo`U1rd5bKy?7or!p{%L->uimGzS02SDh%bKY}@Twy~b z#dmJg+CJEWuqj&5%w(`h)bQ}+@Kip5t9ZWYS{}DvrcLh7zOHtfd{AF1|$Q}T0 zpK$s6ppTCP?M?c^Hjq*+B;j;po^*QhU<)(h-ss!7|wqgb*H?E{vE|UKxsQ2b2{9eIGHMdM+YY5)(>T z3brVp3`aI=pZEW?^uj3O<50F9ishqSaE-+^;cxG2+&K?+d10x#Ml z-E-iWf)UeKlr1=LUmEx=THFl!cVooMuqnx*SEs3g!>q$(W{h!PK!r54Z&;BkO!GWb zZAx=+GY*c-9M81cYWvu zVweya{ME4!tqsPp7={TJ-Ucm44a6@ zURy<$ou1_u9}n!E#w$yq0K$8wZ2KwT!6>c7D_16C z%_Ng@XWU98NR2o%s_O;1!ty}D%`|&wKV_^8N76-TnXb4kM`a#I+t49lVc|FlUcoF_ z6Z^EJBxiZA!Z>@{X2t#tlLuL{>}3giW`E~0!3JgzXY28Wany0(%Rb}B>B1t&8YpE) zr{pBp%_a}rCu7j343*+hLqv%|J2}+ia1!WWzO9C!lY`3WGshkUzqJ}3t$c}Y&g8+) z-Ce@vG|AO;57SX|69@R(Xv9UPWI5gW%Fv6x9vBa=s&~>6sNmpFRdV#vYpn9*FRrF5 zw-TbvK#>vVq{-&|B3G6{EFc|n-nWH4B)~s@_G!Z8G7gCx8ZKy+#V`sZHX}$4T?ycWW@%;h2UgXNezAA*1EAngO z&}&x=O)08vDN2+DlC~3)t(BpYQMGCt%*!MY@#rbd=ddt@L(`Mwm4u8G!()aPe>qMu z!;G>dFjr(V=d${02Z{O05=xuAL|chHeOHoF^>^F(zJjQR;y92T$s``s51p2!n+hJTZS;Xso#mJ>K@ph^9^r}RyB+P7; zKX_{!vYC-wYb_wjwKN&EBu$mqc%@fkVO|(PVsXwuSIv9m@2c9&&ugX8Ig||URjK&j znJDWTV*}wwU7<(faRy9Nj+y#!t4lZvDBWQ{sr~GX{+T)JN#t+U7>Ph?Up&uWKX??g z`jf$nDeRf0?uVDl6QhBHt%-x(8QS<* z)mX6HNLP#}V^0WWZ>ON&^tH(Tn<`N!h)@ilQ)|?VzUmug|2IqfpDCfu71H_?o+y3T zYQ*vgTx$ky-;3u=Yfjam&3zDkzqj}gwh*nr?0oU&U<6HDHt>9J_)^u%DeD_K%bzEVk#AG|@ICvxy5d*XT+^RuQDy323~M6S<)W3g_Wr1ZrJHsp27IeH z(Z)ExmRywgVVYJ(1xI-V&UWu#@>!naa)bVzk2#%8*ELwXv6JLUD`Krj?HH$eT|z{7 zLMq7L(LZ#}eE3<1oPP!AJnTY4?`AP*%lzAxqwhI!lJ^a{9k8HhB1*~cu2k%YcPr1d zLjTQ`#^6+*xO_LKa_(2~^RF^*6j#R;8G z;2ZFmk_bC{83zc$*73P3VI$sC)@;Kb@gIU+V3<0USeV+Ra~t;=^Zxp!o2+r13ovqo zGg|g&A`V=fAG2UOJ zYe>lCRLKyXV0zaxZIbPDQtf(S`5Pk6L=}+{I!}hUV_*eUkXuEE2MiDcp}HmQHFw5| z9%9>cZ7Cq)(NU|768CYesf?B70Phg}Wlm9%PW{Svi;B!&v_a{kJe73(K)&y2HcGMX z@Mu{%0G@cPU0&aI27{!OdXu8Y7lct6Q{yclUZ-GG&y>5anj6a4x@sMnwbFRr!jU-pLAFm?mF+|U-VqG=S!K`ybGZxrhQB&zS zI}E!QHG>w~`}Nu&DT@zd1CI-RqTgWFJr6l}8z8aXHG$&UX4Aa@PJ81u9kZQmNuBep zn_`NdFfFc z3|rRw&xIgPS6X-Y1%lU5R^n0SZHC{!Vkj7s749xgU-q9Np@E*v>AU+urZZe5kablj zYQehf;$d->zPOqQE$$+c@rsd(24ahS8qh#Ypb6@FG&!NUA#$0@x<|lla0tv!R%5~A zIwdpsLwa)s&#FW2@<`1xbC)v>B^FJ{n!9)BMQ$vDo)I(81= z_{qFZfi=-Mxz!o+q2(1IN>o>2HIn8!>GpPlY6T7yIxV?e{%GZARt_fLWdO!`p{cA` zCA#Wr+EKc1B%4al=Z+Mjon``;Q%#SiA3A0prU!_G9+65yNRL6%?(XI#yoJX;e5G)3 zCksXwOWphFPV35-fIXh?Q3eNG4QDzmr^PITB`jm;%^EHR8d#Zp7{eYC@;gxpQ1u0e ze2aL^XmGj22qz4eZ{3qabObrD=YCdVQ1FJV2(T-s3m1Kk!EY*~-8Ruj;_l*7`1eNj zh7|k+2N@0*&qD8D*j8{4?3YA}j1cUdO z+$rY;7SWLJix)$)Fh7Oxu1oEWhZCHL4G#iqC^gd9+olDO z2cOGXz5SZ3fnzUbpkZ=ikt*4MQ z_F>~z^=+5tim-E|sB^j4R`w# zHdd%+EdS=cg$9prOq`UPWop3%PT&dUG`afQ1)cN3Uc{;I#xjfZBkR_(ja5A7sNN>0 zsfwj3?ig;w^ewE*Q}owAi}gGzk`h>-HPgz7Jp+>Bz zZ2yol5x>Xz%7|*Tbjc@X!r8vTO3@0XEJBR76a+a=-G)^1+re?|I@2bbO0|EK4y;FU zPeNg(;*e>5m}2S?Q>iT|rxaiT?+p z^C3xaN$_-%0ki&(+1Nu><47&U->i=F=>`+}K zNXzNEAwiSF`=CMR689j%qN>$Yt5LBErAs805njuts(izgXD!>0WxV&I7Dq7&N97)8 zzBm(QVf*M?qQC)xVXEWIMGR9M#BU&<%rKYO!K?pPzFSfhfU;S(+q4K(yETUrbqemt?muZ zw+k+fSQMR!nuH0M%ClZO8yDYXf9Tu7LaHtXwRy4gcb7-wJ=koiQNQHU%RnO}qJ_fE zDVc=Aqf0fNQj#n2Xwl?)%ypjioSOaa`t?W5yapd9z$Hm!NzNj*MUd}T+i828<>!1H z^i;`jI$GZJ!XUY2PZHnqRLIMVC*a^8X4lyV(V=tho()9USFdUs(Ylg6Mu zy=(?t^0Hu96SJQHn5-}WMyxb1+H1Xms3ut)hC#(NKo@Ep4~B>LUUF77!u^xJ%S^KhidG>oW>7^MIT(zKBU2!QfsVxC1tKwO_F-n$m6G0t0M=rREgSn`N#V#5 z87*P3PH7Q=7KhkV3u*KUs)!|TrttJ8cF4k4(5O~Du%srZ$Xa!3bfVw1n+3u%@qbvFFk7mx zq&~A9|AYK9R;w|y)X~vVf7K|u8LutF(OFs^W$VGKrE4*gCG5R)@YdX1e@sIj<2~@P zaWR}TTc5JcMEmZbh%p7scujY^Q0|6a_pCA6C7Mk)z@WtgYdB^;>8}4Yq}}~rr2~KC zm&2^?zHOTKUAp3B64}VUB1W%SZvaPiL&uuzws*oX+b1JudRn<^v%N)~irFfgn19MJakKIB_5A4KGQNhu9BqG>NU~sgX?k8qUVhi3H%t z00f9KR_?hQFIH=$W_>SXV*a`Q*7Q7ckv4TVz!^5`F0TfF*s5EW`HO{<(%^(dBjT40 zA`4z=y}2}mpA@*E0G90{j3P40a${A!! z=AHj$K$A7K?TV2b%5L5vz^mWE z!yTItSX!T6Mxsc2bLI6N^GWoF$=~P1sM}8Pt-bG7fbXZ>Da`RcT>Q-|C#RAvy5|;s ztWjWmxxvA#QbgO&N7q1*0VO4En?C*9?~EgZqg3JV<5}M>r9=$&w`ll!65iVLX$?=L zf(E<(65JlL{2jO|)~_dJy*dc&UJq_ya_@fZ?G;I8KTORy+5gfd8sRij^W?^}GFCL+YLKBNZ7+GHX zc}?U+zJB;xHj^QF(jZ7Cij*gcTrK*cQ}kT}Kn05;DZqbx5k*G=>Z@ghxn}R9l;{f&5o0+QV|@{0V*=85@_d?j-O@IJ# z-n?G+##Rna@x@j#ru|sF#(IJ1|0*4v_wjM^CN%V4^@!umi3?Lji#kY12S^YJ_Qu)s zi3>__dK9%&bbIX}%bZJK!1bsjN@`q55Q0Tv!8PdujCbmy6a(T+0}?tOhM%2yFeGjJM+Ql<*<1~%|OCMi?wA^p}!H-7J0gbaAZlOycKl4>uMkdlgCdy$%nyj)9A5PQ+8rKB|lHpewFfl?U7DszL zVzPCB?|_lT4i0)d(_%?01weMf7lnBZBGY`Cb}86QnrC zA)%+8F>+SAtl9UHMv`dJN=z&Xy?Gup^W0Bt8v?E}M}BHuakNv1+RvQyqBG{?60 zWA}MzxkB8SgW|HsWF?hC^1D|c5jg-Jn-FIl#_oIIjT;>phBQdX4~E7ek9-q%ftwZ_ zdBISO%F6>a=H>Jy;f92EGllg8C@vE#^a+xzohup4B#ZS#&f14Til7%C=y zw88{eC*ksDGU>rd&&08qDS=9e`&#qx-?wwJr%q8OatEeXO2$^tr@q5Y>&QsI*sB0) ze!Wsg@iR@|nI|>MDEAmB*SSn*>*e9wc$$`VP9O>jlfj$kv zHk`b-P-bd_c|VB4#~Gc;R#kHtuyjGNEsU~TL2%*)K|EvtUN-7ptpMIGP;j<7e~r38 zm%3ond`hUoxx-`~ROV;i@PW#Y1U}H{l1i%Rk@Br@-NzKKbPonL{tnJ>lapzY+3!=M9fGP8 zny~00q#0PMXmG6UQwj=o)B%yK_-9OpA80`$@3o@>b>b&=+?ZD`@^oTrR@eq2;}&&N znRWFNbgC4zlDHI-9mP|)bh8t51rKy$40SUdb>H9Pm#kZmp_^VRmn)=@H@TXBpQ(^%QPSblIPtuM}RN z6-S?L0KT3}zm;UU_Fkr`Nv}CjtR+Fet5mD;ek7n~y|7KcGjP3&8LXSX?gR&J!U5A! z8T1E&1uxcG6cV2~_+MOx zD8P*c!;J}Q!>LHaZ>ff)8is3uU`XYn7I@NdW3kuZcw^Xc!wT8Rn$T#MYqPJ(a9Pu6 z$8wX1$>?ZN{~vNLs=;Z^=2?RNF>~aP4WrA8O~S^_-^}ahfrd91D7Q_(JH@RERO1WB zEhIl6K-(oCHT(F2Ksls?KV?c{wW|RIq77QXN;IWDL}94i zWprAh+ca}A-L-x-i>BU&z~GwCkeS0US?9- z6)ZCozT8WY+(S;;#m3!Fp|)_FG-FOQm$ceR zhhQO(yI+oaVC!iik!h+fW!b%9p>(-VU9hL_b&wW$@V<$|QERDBqoWhFuSR1&d~u-D zW$rm?X;`plN@Jz%X<>q9Wocz)9A&ANX$ds4vTatkmO8Z9GmW_jS6hl{fb` zYY?KGj_p=7q7!W(F$FfUn;IZ18{6!8y(dd2G&7*laV(l`3h7C7!MvxGO@Nlo8ntbv z(@AO>$hg)j;yw83Wt&TC8@ys;Aa%k%b@Zj%wy?k^+{)UX#ylC#u4Gdqd(*a{+xV-| zhP%vZiEy~F(`kX0ZAGSCNp~0wwMmYY?H40MubI=r%&=NvtM6WR)wmn}WcG#JXNpSp zO=YH=mi8^(wyjcoiMV@pMjIW?wzb?AZ3SmIwf3_I3vq8}vBKdEwX3~KHtkDCfw(qf zwGJUx$L>1eLkMfb-4?|`N4{u|voxAR52sTP=jCV{qsa!O#3T@qieL292<{#LtBs2gtu$D~kjeJIk#YykJ;$Q;sL*rVTYARBs@um)l0DMSRn zLV)qME$r`&4@oxkK4A^r+a?u&;0nKk&o;U5-P+tx5DUi$?k1plXZpCPJ|^!i!K z0aW|@bL;i!A{NP4^@?+7qogdT`ssnZd3Pe;Rqa=p zd(XTR+hgV3t;a`0uW1kZ3IxF>c;78AC)RWBW*4=ru=s9uEjDlKkNZMsJ`<8&w#T6m z%bt0+39n$DZ8sU6c3f?^mW#K7_d5uS{-y5w``oAk5YOt6z+>Q6;GXGhBeSJJ&l@E$ z_~4-I!^Mq|wzZeeYQX;6*GKq4`iE;yi@Gn{W9;LWx`;1EkS?#aZ#nDYI*X?*Z#Y-0 zx+|M^>Lb8ifD z@VQa;yprgP(BVPrg{Rn8KVxmTkzj|WN07+X(#-Ik*N>Zd2;j@|!w65nMD!tK4CEh6 z<7Y+t%;y;?vi+wPV%2c*7j8Hpy7?iv)z3uwFSFL)V9~1IUe?`7fic42-sS2IJi{H% zTlqpS8Wln9+;8=gZ*N*}gj;WXHGkbdolijky}vGRvb@fdju~ej{es@6GT)S-qQyFW zN*Qdf$oeAwX$9>`9ak&O8IVQ8+osFsiNfw9WY5MMPnp(M9hL_XhTap{-E8T6Ig4#!62ZV6R#lGK;g_V2}4%Y8{tle+2JfsYdXz zij#hrAv2ObjqP~G$X^qMzk&U90fV|BGhmwIypsO&*Gf94@5kVFS3*jAt)HjceVCDpK-r9XL^M7wS1>>dJ&M`9~+j>4J?zE)Gw%P_^9~h+sQom z=<@^Go3PZ)zV#1RrIbba)g~S?ovv3{4aGb9ip;<#zNe(1y~$<;N9?xu!*7Bx%Y4Cn zs#daSDXypOKnw<+T+UooxU?wdhr3Nr?nqur3Ch%`{FuyxNDAX19E!p?;GD&_2x*WE zWh(NjkGbpOz7C!ho!lN#l$f4unkOP@4pkOBGh~#?UP+iQ%a?pZeAe-op)GYh1iV0< zR~dk0WuclNixW&P^tkuM9+Pi8*VT=WHs58{w_HOlEZrz05Sec_loyHLrs#=t>-@iv5mqMv(%!Gh?j(z|i3!J@q9bN5)>oVxp0G%8u#1e$c|) zLgcHjW<+7g{*KNz6HNR(wOe;`ozu8w?SXVNP9|bUVomWN5jE7Y_wv5Duy#G|$`9b^ z2e1zj*mqtJVky5|^`j7_UGV_);imeq^dZ&x-DfxJgaSt+f}bb3)&txpp_Fk-_1{GQ z+=Ra^h%588HlB0LkZibr6i^g+0bzoRxMSuC3LG6KY=I{YrUQ zrETBEEotEY%C$}~=)k?<`IUri&GQ>g5TY}l{!$E_;(T3$(C zA|ssGWY$g3y$T_;w*9o+bUZ62-AxvuZ0o6&!&rYK94p3zH@A~=d*MH)pe*mHvzH+j zfzwPL{l9Kx`MpY)CAm}ndcU5~It{y{Bm%C-m)r$!WavNoRyBn){>Yh?R}Q?FGW_vW zTF{_p^tkzzKk&&eVcL6QqWDw5_fu`i>BpxFaX6HH>+#^AgLChymy>Do7fRzJ8bHq- z61u_@Bbgc+9j`6ZUNANEav9-B2|#Ry4s(BpKI7WHi{wde%|D9| zV@K9jNPPs$zYX{#a7?%0>!qH5-gnM>YBDElmR9)W04cIdro!E4ntzfWMs&sk%cpZp zurVdY)kePL)iz3eD|0?1=QH5-+FC|(Ln{Kww+PI{EJ3iW7AL1ybyQg`#TkcHxNlYt z8&VD`cCfUnlvSLjUCHetlimrkUO^;ruX0K`WppK%?touQr3f{W%zWl3bE8VFf}+{a zr=PNmca+mui`Jx$S(CH#w9*rRB^k5>rEt@{z}wMm^>zqN{cViX zfV?4V&H4G;IlJ+uvQ8G03!>%x4l)YuLa@3M@~oZ#4WlvtM2?9rnlOSkh9Y98K91#` z9ZhCD9;Z00#UGSEP76II+`EHeNkxh`X8DENyD14M%||p)>7LOVV9RW+KV>r4o$2;* zOA9WsFd_OycrbLorPY0$yyHDbW=r6|%YVY_EYtn$b=y3Pvy4QeUr?cW8!aYUeY!?O{8{3!OgC(Jt-oz!y80}&(=<1=dq$QUq zM8cyV9XwOwLHF+N0h_b@kyGkU_c#uHC-pE!w;{FD0cSIP?l39j?LUy_I)GhmG7`He#}^Nf0=2i33O zjYAhYjfOu*1)?G>LZTI!B8N2yR?j6?r#F$j1mOr(#xGojfc+hvK?MT?``FSo0n-2v z{+pK(e?(^(sEOI=NjX^l;$@6%l$?yT{5%}ojGX*`=`nTzQARQTkMzucS}}eN86kBQ zVH2f)ax?O3|G!*J;@{$o@WoLsCssPD58xLr+0R|6`OWr=s~!Tt;2pKwrm5 zL)TFMgN{j|+jGd{^UmY3SzdJHE zKGt@AjyAq-ZeDi(rycW7M+f5MeD@0c%aiHp{jVpp332-HWbQyakI4VsZc$6d_fX!+w z+jSBpj^Al#(Py+2l~lXS1D<_C0hbgY6X0SpGL5`~ZmZ$&_>HvF*0(kemCE(zj`BV>m?p-46oIN)@~^Hk004zES;W5+O_Sh45P zhCn2Q%BbLFDi#reFWMyKPEI@umD;FgD$G1~e@NYiNT`o0iHwf8!(*DVG7OQ{;Rs8v zzehznrf`!dSA%Y4RAqV!l)~2@K+LZ`9BZk^)d;y@N8B~1FetP;7$%#x3BnBy8i{Pq z#6ylBUc=WBQhJkOD>!qr zsf$K2lmkRmT0aQ83#2*J$4d1o2}wp^l|Uoa(yPhNZWK{*py)a%m0+8pRh1+`x2Bin z(FxB_HjlQA#5Xknp|8Lq7!;47D+<-5rK_vatx~v9rC54fyZUYwikawD`iUN}Xysay zS5)M=gsMQmEso%Whj|`KpLZT)nvf$WN494d!H99uc4p%1?T3X*bIa(Kil$i?H`71V8e3f)AEL za|T}XT{v0YO)y;al<@j}4oSUYs2nt5AghFLk`!sGD!QskjUR(YCD%(o(%&Iw)r0G zn-1CXONQ0WQNA1lcWKbEAJtj5<65s zZ5`R4po_cygcuQ_CA$4zi=Vo#EGA*_REDBZM8;pbE9fZw^4ap6g`Hf)iA_!>ILZ%^ zEUCmpESiAelp!MRcSs({7IK#e5%^egO=5Me2hgUU!i8R&lLAr;Rxq&f#riMVh>1!l z?7c_KZpKv^s74Wuqx)oI9cf6>LVtu*3j%ynqlB(a(P*`}DRM%iB|V1GnVTRCcw_je zDES5$cE4{<03Gh!JWfc2bELlB8TR6(uaFCLKM9fG3V<)OTQn5w9gB^ao5*f_IAs&n8ugk<#9ms_IWvYs?v~ppPf{L-W++ zu+D7LfMBnwc)+fx$q&t*B9ct#tKJc=);bv#8LeSNIScObQ`D9|tC4wlv$pAQG;x;* zg27ifI!}(~SZv#5Z#6hZQ?jho1Y=RTkcd~Yvh1my`gHz0R4XM&0_*&X)6Hxg04`am zKwYM4>l)K*MkLVOwkeqCx`%7~dCs-+F8d0pi66E^IpNa8Wo_hK2ohH)BvL*25u!K{ z=QRQXF3zE}js>6BuTdDPwETX?rq|QCbPip#Qom-2HjrTTygfYK;~`p2Ts5}V3lZK& z1jgLuK5ja^CH+TelK-^^!3@g;$2bH8%wz5sqmG5Fx!6w|)0u)^psR%f81rndeXcFH zy_*RCxN~F(yKQ(3R~>lxc2-W8dz(2loa;LSwaviASuWH-=` z8!}wu!E2Y=NH$U*!vb*}<|OqP0>AA4jK+&W9#D#~_5yvWcy*hQ-@Z3%;p(uSbVu{f z1ElMQ{1#OA^>-ThQK(%9mKs6V1);8xVC7eZYpxnaS5m6aVdZ_mDRk_^g`9 z;zb9<;yR%eMT7AO5!Py!WPwHowIa~2(ik+gi9X3^#14$;Rn7NB*F9b71GA2*rNFhMvP;b^*eZby&x z7!Md0u}wxO2t1TKN74@dhg9D{F9W4&rk_w``ah_3X=$!uLYST-RyCb>pjpx*LnOsi zYtwD%hN$=_A`=fHoi`c2vCF65>5Q}pK(XU7C(}bbKroX*Ze}NhZ9*_iVeQx?tm6S# z@WK+a`Hq&|a3nHV~wjE+A$g-f_gA^QqPxnfjdh2?~v zppb&T&q1*7lTb$vc_0&QCPm7yVPYwzj}012ys3r^hH`gZjB!PSy?;qNR!w@eF*SCf zm=}WxDYZslj`e`bkmcck)J+a*)2EO0K!*3Mt9j9usIGci}vC&C~ z+49+DlGe3m$9>J_yMx@jlr}=kkpRhBr|TA;%35dpCS8PEmtWvRg5~;q<$9tk6I&Tv zFVjLza|UzBp+4m{!RNKs#I@;09;VsyR7Mth#go})4#KC-(pqR75Lmi%O)fEpc1Hx@ zr?JvOir(dewLZQ^@XhBhwuN|WZL$=z7Onz$%dUIPV< zIU418xymDrttMYFCJ0-o6aKTl+~=pQikOhkc_S3<_n$RY+Q8$Qq4FHIfIOHZZmJo0 zr=OC52+a>N?P}XGnEuW6B}s2^MYpTX(T~k$h&9zb<n>#=&FTs@2A6 zdr}SinDa(rzE89Y5~fbRw91P>L512ZafV3wx9xhD$h5a9@{6Lw(7;JH7xFY~@pqqX zl;MX1Vouuamt-cXJAO#>YqHl2j9MQ{eLC*RFp5?|i11_3a_;k?DkA`|AG7^1WYq-l zZRed3E8y#;Hc3)#k@}Ud=r#kn9G&eMfnz??a@{QFRVP^1Z}>7?+`hTJV1wr6q+gOO zw3xH%~Xv9&}wy&6qWz5Imm&1U}CeK@tGF#4pk zUU-R!1A^0i<5zvj=Y371SXe`%gmpOUas0_M;lHP3jyil*d^oBJ2MV#A>xO$88EC9% zF~iqF47ooWy$*nVf*1Zq07c%WX)@SzSbjv{LnY^PGdyTct^|rxxul9&U>I5??C00T zOTcfE=wizKGSmTCgLc=wwH=#3sllKN;qd06-`&%Oz|V>kNwPykwaD6a8Ny#z9PsAc z96ln#&;=-k2E>o2Mz$TORk<$>8nuk3P8Hm2HbLc2hO8!D(T>e)0j$~j(Okyh7Kc2` z#}pJ~GC&)o2dk4;Q&{Rqt+jQ-t-0gzFdsS#% zw0GxgE?jF&-Pd%n!Z6E^ug1>=jQ4ChIFr^7=;>wF5X^VW&tqrLhsjssoy?zkXx0%e zynaVTAapb@Z3zI))+O&+?;}(#5$M zM}fm{(N(P9IB<0<{QXvfj+1es5aNF}fJ+)7@k20yi}h2BN{+ZsZrS?BRn%$}*(13y z21{|SxOEf~YPivWHxEFAb^{@OgS98|Xh>vxia+8!4dV~RvEHEO z7B2ZDb?X5yNkM4p3R6SptY<^^&`4z33IDid;+zo%5r)3r2;Xe&&Vo2oH|`!y_Ry+o z+NwIZyq&6-jS$1tDXUFPGSWB>VSqZ`%g81|-%yoK$AMH&5>#B5Lo#+|y>as{R=)|> z0q$W!PPGQr+4j3jJ#Zh&4*|nr4;@oM0ud2I;fn#E1B;6;gy9&p+=n-!%i=JxEo9bfftIeGnCbkE!?s6=WS{R*8xm;B_oqftavS?aU zo;-7$-IE!f^H4e_{1xfzG`|+L&oFTe=edE$aKJ$Xjz>nSInNJ0u!F9#(~Go-)aa&s zJDKieoq~Jj8hW|p_)!ELPiI=vPoyh)k9q6nGrh$s-0JMEG$h=M0LvK!A|-moLEEr$jvcEoX_t=!+HI{F+O?_H+F5}?N#BG zl@TmmlvkCM*6XirVI6H1>JH6pYaX;5crOEmuXla*XaT{M)r9O=uNp%-*3C=RYm0&M2YR)4Xh-G zD+_rl4My}!hAon9!8K0f;ssbIO^VDefHRWJY(=TxV}AlVUVD&1HoYYf4A(}V`U08f z`K_71ON%&?1Ha>*h`t>qaQE40L+VT`MiH_Yt#^t+^RRyQW7uy5{mDbngF98=$|{N? zaqL2#CICu*Vo-T1Wqu7qyN?b!91dIwyj}tS{nHQ0y=6bfem}|!49yE_y+m9}291DP zP9Ym@*c1{99TllqhV@7?9*%$`zf@)}R}sgaV#WM#bbas*DRb>dFRCS47sCBgTZ%6xj%{)Z-=q<#R<=Of%r)D z4`o_8N(b&uHB$$!ZJBr?GjK?hJCdmOx-=%JjM+8~Z zdpCvNLSbo=Vg(ZQga@%jjT}%wr>z*1sz??BiIPpW$%Rcnv13zzFGWPR<=Pcz_Q$1r zne8-dKikDkHtM?VEu+N5o6YOQEJd^93v=^wEW>Ajj%dBa`VrT*V>5D7GR>VE7`VVM zGwsfKAjO|j%OY>r}%211eRt>KHw0@%Rv8N=@uAwK5eUMi`9EisBqJ%Brh6xO#j6TFM7yaiYPE3Mbs;Ct+101X!q|s& z4mh?00G0{yfN-!kC(TKx>{7_t#LdtcTf>i+zMtrS+k@Fd_`T2fD$gRVi0}Ieb3sIh z0<=u^_kos&w}rX)S>Q>a3|>;e5Crx?j_)kzr%?BWw_q$<1Sl0MDRyEDsxnxtkPD*) zf8uMip9CeV;3nFwhHTlc!`tNMWMx~1pcuWQ-Y_I)&2e*`x>RqjGe;?2#DGG1zm1_r zTY7UQc(JF(4RTn41MtCRLiGtU%)4Y$B=dv4{Y6Y{%LZ%9r4gjuTk)9Z0_s?2U&P;5 zTve3SBFsPCqqq2ug;`#m`O6p#!M#)3R_E;00^Nv_%FadLxyqUXp_TI5I)i3 zC)nt9O&%I1g=2^oK2WTOV2RoBHrOX3`bX7WO(jHny~QLjhD{M$Ie+2{+4Ba3MRp5e)s z!Zb?de9Bc)q~H;)m;8|kRg*X&0a{^Qyg2X;Nmp5v;^D$9M2jGu*`a71mCES4^Ip%< zhx-Vz$y2!TV^5)^2*^^aWY+tKBIc`)X+Vt94Oz0dLop%~$m^C`qDO>?F;TYQM%g50 zVFqfD$YfQUa7h`}KrXwHtcs!L!hI}=?Gjbw@T1($6u=LkML$$D6WmIW7yOzYp-@XX zIrYe=k56Bm!KbRS#VjYEll3ZuQudv1EoADpR(r6m-@8vMV#XrH9K^_M#`-v=)m|#* z3e#9{KT95%LMurpH^ByjnJ}hNE-k!8w(`=L!vK*n#FeckvW{#cYF@x)OwdO_aK^&n zI8}>AmfwP}Mri{{X+49l0V+w2u7-`V^=jk}o#8pqCN{72j(l0YiQr<;H!X$C&yH?z zYOhO7HkhZM9EVe=Cbv4RkdzKxis!P*etex$77kM+cvP*f%BdT)NR!ST()b+iSzpc- zqd)_#RViW)$AkXHGVVmh-tWPvB7Q7A+$BN1CJ(1V;et=QLlp3Vq!kWC8FDdTwxysAk@+Y_mtJK<-@t6|j^wc_Fs#J#N9jB?JD6S*4xky{~c zxEgpPIB5Qr-TGQhZ18z7x7tl{3b)?m*i~m)b`7I~@V@HW6KX;*Y6k?<=xsuA{M^^$ zyDn>n2mI=zyEnN%b|86?^j1;{^E^Co%ok~lVzvxAlWj!eE>`=~2E5K=b=gp7h zh?>rwT)!!!uTfOog%q;cc#xICZsr>1)Tec4}e@q zCMFzZffvVRP0^A++fubuer1fMoKC?RGTE27gkuF1PlH9WL6={nF~G8f*o-%1M)Bek zetHO2c|cPB&2wf+uU#45pla1trwh&YkmBZF5*4~`PjspK^;2Yq6`7_zmpqqozq(=! z%uTtNF~+6{_^nUZoui98IFb;DT$}-i?f15GL9m1&&AjBbFsUW@gx*$5 zcEUsSOZGNtD&76lo&q4vcT3hf#|kq{27_q1uI`WwR*78o5+JhL){h0Yoacb*2+OyQ z3=2o5Rd|y?8(jIoD>xaE5DHVyVd7RT!EnzL_`&$rUWU@C#7?Ka38e8Qh8jYFXhao6 zI0sw%_~*B*}92^1gG}A11S7>Hs1J5*}(QNchH+0S!>WPs5#sW)XGCpE?S}=q7$2pJjiC(~RoHXRVLm>V{d4h@PpNzKBBhpBh{v;c~t!U|;&|d`B3ByP? zT1xomk876b?_@5>I4sw98-nBCg50BcT?gSbEW>aFDnN1*FJpQoGmJd1FS=LDP(lZg zG@D@5ED(?!KuR7Uu?ski0(i+`(L8!CmJB#y6F8&<1XVPU_99G(tU#@a4~ZOF4G#)q zH4J$Q3~Lq)>8^ct2n=f{1eryI#sor$3`%@4TqOir2QShT4o1fYT9qYUXu999mz-#% z#Kb>&?-x0n2!Q%4k2-IL`L}k;`jHk&-ZS`)xKU1?7Wk`eyoW9LvsbnecX-3a2opFM z5(9A%*9R~280AnHWnUHL^MKa25jRDHA#s4#E*2+_ALR%T7kLyF{ynU9Ff1@T%55Ma zm0UE+Jb!W-t{Ye=VV`F(wrrvGc8L*Bn3CSgY=@p?*90T@+Qzl6q^GeWcdqpsb)IFxEiXDpNuY%*M7>gyF<6J`P`Uka-Z zP1XyzSG`Oe6@Ai2R)$EflyO4rr5NQHn0W_oI~%(7C6ovcxe^QL{0+E3KbYYltaHLs z=`l^{0{$oF<9tl(wmW=AnoME2Owl!-62wetfP7c{mw1VAiR>`u>@dj}DAmm`S_h+I z;SucdqZUMClKG>9*Yc`=iM(*nuQ6$DvaPe6D;Lx40ZnmZGTpNZb2}elQW>2t@K3sl zZEuY&9x=}P$Q4kdEITpycQyDviv7ct9gHdS^@`hliaQn(I*WpPNXUooD4@Kzj_LB* zbu0osOoGjLMS?B`vsuOSkLXOeeAxBeb{K1>jN-YBd@Q3<*62X7>O8@w&`Pw@1Ecbf z`pL^j%$hbO)a7}i1Nhr;4B}knYx2+yhsiqu*^cD=(p>HZwmh z6rEpVevOs&jX_!s)RhYu6F;`5< z*U)ktU#7EJSBlWGol6vY0Kec_Ut3IfRNNqE`Y>kz;TSDj#a`D01&1D6(T7v{OcjSPArrZPVs8eOt19*uwL6AvUPKUH}x8C^gjR5YuepX z?9)R$)dk)twh@c*|Cy_0{1|7;mNvoX2(C9Z==b*P_s!||@9GcS=nu|qtHT)#6B~>$ z8H@_<44;l6AV;Pv>bDu{cUX@98 zQMmsB?gbiMBp6*57>)kfMR0_;@-Ud1lXlS;qbWD&dK%f%)VpFb{vl}mxMuLJVv(+R zen(uNN+>woYOLJlKE<()_`^<_>~jcq_43tl&13k^V-Y;q$AJAvy&-juK$gIIkEIIq`7x zW=pNwR6W`B>1Mk*Ljo5YdQro04{A#&X8%`(@ur|Dm62(lIC2?r?4ThuZQ_we_7UA} zxW)yP(m}Z55S03b88g?eCftF(4m9(#nSN6QNU6z;R_K^L@`&L!T=5`W;Ues#g~WCt zvZgMG?!bw5Z7xYJDuM%3pRt8YtxG0kl1^-P#I)z)U&8HAE`u_E;IYjb9X9==`Mwu} zX$q(+CcxB{O78+ry@-go7{bp2q%*1LWI>#Y!PKsd`}`0lcmRf?0)!BNAi1zmqferq zIuSLCPI+Y3MfG9+8r7FxOTAM)bGQsASi*2dCboKgD4 zDx*L$9)RPJ6+y^^Ac>r2>z=mySbAsXtk+UQsV3uwoPAHJ1^l8mCgCx?J+GrYGmz1; zpotMTvH~cYKzmt5XkAc7TiL>dQ6+|f$VL&EHm#gUs9oj}UeGw9WkL{Dz^N}FIZe;K zg3c!ond!j<`|olF!H5D-^4T`6m#5i+pRHH%!$XwTv#!6A8J!Vtf`?086p>t&NL@rc zheFl!+TuVyW1uQ_*ceJtFu|RxV}SSH*-+{L-;$wHolbdpFR2;OU^n9is;#pCNi`p& zOv^rS&)TH%QYaHQUu&J1R<|f{jgZW)f6snk?;E<1UAdB7R0l6JT9_$$CLqSHZV2dt z(;}aj^urXY@pkat#~N%Y^H)vUjA{r9?KiTa^LDLo*_oGXVc&$5az(qKEfs;{w{yio zj+?jNh^zZc-|dI2W+>s5%xf+{OsWnpDAr8X5HDn*C@g8%ED&@uP*TOE&&}7L8{?Gq zL(zDW=K-O9LADb{-xzJ|jf3o0U__~p;W*k!@KZA_Cy^8kqi(!2~qBEeMOv=#YRkr@$kM*a1dYyZR z82dzi_Hq~g2?F9;g;(tbI{U;8`j}Mx^h6^XqD~0)2AdOG%C!V~)Uzr=erOrM%-rtIZZ;HPg<}>?M zfxHX%&&#!6EB1HwH>0W+UVVgLZwvj<>izcm{TfK$T$B7@fBMxy`qxeRwK%`op1&GP zy|rn-?O^+N4!)Vy=*;{H7<{d;-N zW8!mw68Bqc)bE|t-_xA|3q_tISsruy0rRAWGoXM~=AVnCflLg6OM-t^K>?H6{b|;L z<*tE?;}M`u<-pkm^X;U7ou3A~`+*BZe{$Xfmr>v6iGz+l|K6(#JXxSU#eF~f9B_Po ze!*RKY5aa=9nhcjxV7+pb8c|<{r#gpx%MUKk~Dbk3Hrz6+c)NbCvM_rXV6b!&?4@i zUsa%2X@j4za6u3s^SA%tWgpQQsBa0iHup#4hW`jN)T2uCS9E6Lcl!^z)oL|YwcnR3wCnYHIc_&sPZcXQW|OG}TPs)N#d;ep z*uS2bb{b8;EH~I^nQFG-Y(L!ia{vy8Oul0P6hJTad#dHX*{m2|SWnXSkklI)Ii1bg z6S#2`u6ge)zLZLDC}j9BpRbAww+6i>a9nR9pj&G>`dfV4F&Lh{y&-fz+8z?Dnl!WKKDLl^XQi|Ngx+cX_7aFaUDI0)w~o51N8Wo}JP zcV)ICjt-5K>kO~8g~OICSuEYvG=5Rw`mZYSpR~2K{0V%owB;#s2$!X?D352#VHkQB z=0Ox&i{&M;eDvjl&(=#hxmwdTCY=GVXdilukD;M`%a5V4y@e93Qmu9iudZR>YLR1{ zfFGG-n!cB@b&d~lu6bN+6t&Rzo!+7;q??aXd`jqzsq2uwSDC2_!jq}v>qt9OCqm2{ zpzq82N?rR!W9_Z}bw`{^-=A3h21)fTd#r(Pw{^*#@AR{bL+{7|&clY6{w|{M%mMd2 zXO*vaTIl|qtmBXc?yMh|7EBw5h(3ePn#agVIozfZ?OCU4=zom6eF5N(Da|5ki?;gG zZ7X2R8-!jz2nsU%b`KWs)Z|c?j>>Oa{=*iSyQtI)-L9q$dwZt&@pb9_+> z@wwFsY?tV(eNJGXRm?# zH2ufTPp<_2cOHclRKkWfht9y+Ohir{=kadK?(rs4N& zLxlQqbI_qwb}Mne*ZW-n7WH=e2ln9GJ$=P{&BK?@exLpYMC?GHfgj@SPxG3*O0gLOEg z=FlVXwnd4g(Jp!;8E9drhxFIql;WZ@?n7Z-^gpqxAj%IFs`#0rxZgnpk=L8-ro!+& z=aj(3`4dZrh@$#EmPP>b$&lz^YG%;UwFBg}ka4-GO;$fL+ZPew-sobv7f7yJRBOEH zDU9Y_&RAsNk%BMHs3tFqA?o$pC$ZI1diQg9(`u1#7*JB7*O0NQt5f)%Fnrt43rI6= z#?oiBXl#3|d=F)%UtVm4nSP_&sgiR2O} z%dES;9P*Vmx~3%Y zqpeP)UDtjtXvu??jo@_c88o}2Y>Mu;;IJf64-5IxsPyHVDR=H>*fe`NxuO=|IPE6w zgIK&D-k7EAv?A4(8%2sHz3@@WAdtk)_(8zZ5f->==jUa^XBI)ybG5eDVc$Fq+1R2M zw`L)S6Vz}z$y(8+dgk_}yECkD`hpJ4KaxE*o%5QmZCm{|Xg>d7ZA2JWZNqC%RUx$E z#813q4ucDE0Lu1)wN8Ja?ZF%~Z0Nh&)3?2MfCm|_q?M~<<;Nrvdw8d;DCL=OXyv_m z7^3FP1RA)i0+K=<6{sblQ6^lbUrg6q9dFQc)lYyu@Y|{5C-=+%-ca?;x-WN2HW4(T4+1!Lk;Bama(uS>eU6s zM$W@{@j;DqEq3&q0?BLxIU9ikWKk)!$!0d5WM3nnBdGOeJj6$vuZ12&LP{Ln)4Y=Q zG;vnJTCjIvoE|q%_$G%&DG&%>BH13}ZF8ajF3osT${5JG; z<3WRb>I<;HxYm63ju1Hy*%$iflBPHIZkaDG0k0P+@3Jj??5#?&9}E9RUM&I3Us9M} zEar^J+J$#-d{;fYKBM$yNZ(xly!W4nE|SiO{L`Y8w^her95lC|!WMrxvCQ|aEo<=g zf%JTq%QE;a4Mscek|bz2Ay`2VX@jKfbtz~r<91D$l(&duY=$^6`aQN~t6}f{dL`y* zAA5HOG*<}rfC7Fy^)74JsIoi0Y7Ev`^z~&mMzH`2#^}|s;E+jI{~qps8grksP&*+r z1*)(sTQp#95B4Fks=OEh7#IAs_i-yPt$z|}#_+nG?68>_X*oY8z_3Tv2zj0a?FdAM z5KHz*Y_3l89lGw85?RuETNUo;I?ERXaIm8pkCjrG{xuL*t zeMJ!)<)N78#T$K$m_=4Hh2z^txjjBq2*dwPISy4Wh;ov6QYK1(qU*Z=p>&ABSG19{ zf}H~neWf6|bu5`HBQIJ^U^w3@aZ;T>s^GiuCnFn8DjJ-iSgw%jNMTg&RY@N3RbEU+ zA<+UortJQb^2kM1@>e3Xn<9#l^lJYq$vEO^3I0*`F#7Vms+gi0y|j8I9x6o&k68*% z@d`-8a>>Bb?W7=CkbJ-Rq->K4Y#9acy8x*WAIA@CUj_j;qCkIyT6D(pjTZ7^=(sE! zJPx{m*@onnj--NG9vd&L*``RZWmJ3KeCjulwwuI^uf(jyq&_@Wt^-7U<0Ecqg@^8B z*>4M8vuPo{jKZ3a%6hSH1Jrxe95xq1!1X+^E>wOSmN~B}Hc=X_mZ`9aMB>R;hRluT zr@&H;m9sV?<_Q_)_6g(u4fJ>iGHX;ZUjP9IK(C__CXXubpie%LRX&NId?U}jjv&1B zs+bkdnMKaIIjs55%36ldDPt&2X5^Y}MD3nQf>S44pD~FvhZX1`Lvd_Eb3+}UtAKiu z0q-deGuS`^+R)rHpw@*AM>U;qj!1pJ0scjh9&Plxah!bW-Gk?t~Q(21J)CHlD1foHC(-4P~7w zRik)KL&I5PW>=kVb*ZFMqeE?VYD<@WHWvIq;X$X7U1+NqPnVK zL#LBHEEq#Opt@aa?kBBCXQ4efEm&71L$Ke~LsM9HDTv`?QLz`Juop(TZ^ph8LIig8 zTkPJqE4;9QQicyBSn|rSQbP|J0|th4Jpd76O~DvUU;l?T3<9fu6h~wjA_PvRKH}l( zimZBq>w3t^Vbsqd0$6_$T|bRcKVA5-qEpL6>51;=6R zs($Of9v_Nn+3C6-gK3w%l9kGFnawdckzv{fV-?16QqJ+as^glb9+JV$1P)lg-3|Nn zDX#(JYAwUpXObZ;(_$d;q24X%#J1oJc(FljdyYY}0YEZ}yj>3}y9C&5 zLl|7qUtB%UE_MJ``kiLS8n54z4um#to=HyDZ*QMTuHFHM(4X&cn8Y-l?mM)FsXuRh zo%!92yuVph&*B`fH8bBFCIBWzb|+q@f$;QTE%J{(M*8?k8S%mOz?#5eA)*Kg2}vmk z3F-ewA5%~fQ&Ro~kf}KS2FP3t-2V%Z1%yNZoRa^yL011?gDfG#ub?WRr6Xu;B5bD3 zZE3;pX(}KoC-vcuCA1Vi+_9#vjJm$o|HxvCzh$wh{9m%zLQmC3OWn>u*IY}_Lf_C% z`$HCMeaK=9lfPuKhn111i;0n}nX#Ism7Jxmmh<1SN;i9H7e`HRPg!ptZ8J-A6U+ZW z#I}wW_Kx-+h}g>0-qzR6-P_*X-}9gTZKzqq>Us+&~)<1R_7;FlHfB=1byNJk# zAnp(UD@_?0r5~ScoE0gTo~WIYViXf=9v1DJkYbjY?2?>lk(p_em+$%)87^`C93@>H ztyZ6-)D|V#nxNX7Cf`w{Qk>^d^8Yb)moafhi`s^f!F_Na+}+*XrMSDhTX8RL#ogV# zc+uig+#QNTfifTa?C&J!@BDd_NhX=BcU{l@zb(q5BB!!4&*oCQ#`>V9#;-&Flcrq# z-!$cLg2d0%|D-8bbH#^q&8Lgx$7(dDn{>CT#n(E%jFs7a)+r~OOc!e0{}&O9oz|#d zwn!g!{|6C2w8%ZR{C`CJ)MIfv^yPh0`C~@)dLZC=$TK`H;u8@^rNu;jPfN{=`<|Ws z>4?7-=46$8&nz#?Z>p;*NG>kRZK@CHY>V#iNh&ER`Rr9zwN_QMw>EXwwRdzxM}z+> zi~q}t>j(SVhI+cjM*HVy2K!Rh+QPxv+2H18a8J+Ak&L;S{K4_w`CmnA%N3tl%ZG{B zyQ$Q_^Z&_O?rt|6tT+9a9-kbxKc4m7&|=r z{d_$3eDV9~ZsZdnpI@Axoc{YSKn5Qj{kLrS`AhiJ$J+2%I>m*eIIJe)m13o`DN*PY z!i?(S(W3-h^6{V9N+#zH!C^7#wVd5%DF-BHH%db%D?WgNC(s1Mgwaq< z3cDPPJxZ)nDPoY&C{}{Z!i}*QS*g{EE#fj++8xf;M{C#`MvTZA~1|>#Afu77K4tkUoDW)p=By+-$o3wHQDUTk+z@0kyfd^0)^ZjjDO?M zG3xQXUzjTq@D}a!^E?4^@^mER@;{xHHsOMKMEe8o0MOc4247jpBw}vpw0d=*$8-|V z*@F#ge%5_WXSgbgA`m+qz<}q(cTLrnIW0|xs9&L7_wA>hMc=7WtC40A06ZInIrLBdA=?urX!G)6kbf z(TK^;D`hB~0GRrCUlby6Q8D+~6o|nZ)2uz0Zc|$Ntheal><`sOx_{ez&h*{V!=rG7 zDj}c}&@Y#@6S?2Q`15+@BzH!tBmP+AzoA&f!XDHnMTbu znfWU*RjbBU`G56$zn}d+c6Ay1YtYj=@4xNo4&-4S+=V=Eg#0=v10MerSDlCw<*k^6NRO&M0?{WRn$-*n%&dO1jFdAk`Nn@CC; zfj2}Q_7B4t1&pOCagt&Xx44jwzh0@@E`a-5>86+o+3X}y_-U7>IZLvu)udh9MrTFC zsKVyZCtOGYi17)dib z|8RBE<=W{jGWl-vk37ib?U>Z*E7UfV)5l-0FzqdAXb1?!dO-+QWfVWlE~BeRcyzVU z6KYvJ>3JG50y?DerxyNWE;MS@FwrSNs-E9eMP333dUGDlw1v9L?g;q#lJRi0IBlb0 zv~s`i*Ss1q09LHYa>#AqNKItQZ{OsU*HLUl3vo~D>Kwu5I(8u3+{X|&p08&Z@2n~1 zKbHR(o9XH7y=v01zOry=co4ZT(u^7z(~P1ns_|w$>!;G(#a4k8Rlr08OuQG* zWWzTOWjx1WVY`%M-ubj+eCM!!9lmuXSi#V{5?R8p^GHGO2PaUz z7@vPLDDc;U5z{Kb@~ONm(2NqQlrbRsn9?NptX35<*@3x8aktb6y%2wpj=UiTlMcm2 zg-DnQgTK{hAmjIEx# zk;sfX{){X^_vkT~>qse3Yyzf@JWZG%G*w+chK_S2xDr zT+8oPW+Sj+ki<#T<(jjsY8-O{aWbK23&KV4T z-?gC*xVk826kqKY*Gy#?Cpvkj7c<1z6GoCXH04@vwV=a^4bc5&UKhzWfo{da*f?#O z6J0Xu1PdT#*umq0)^H|RV{e!*=I}fpoxXH#+aPioJWW^nn8+B|dRO3euF)U5X)mR` zVj3&w58cbw$@9P5bcK{tS)gmJ1?^Qx=bemW42i;{$JU5-<;2eOGwZeTUhAQP~ zz)IYMgWMJp><7b@&PTZ8uhs7(@6$I>G0Txas2;eik)Id5z4NHmO#vPJvyHLo!byIF za0hb*_+jXUn2oMpF>nQikYztvH#ebU42&qOOVjaHr&3Thj4I_ETXLihT3FRBSuC#D zlGq4=b|#@1;lVM6!oiK-79m(wKmfCLtCddBkdHgRX!jA>vM+PV7 z9x|@q1kUqGFHX?H@Q_bY*^2B{zewb`yCC&$7Rm=#M#@r}6VzD4P5=+uRQ<-ZO(=~d z;Z3p?H6sGQ>{WP!!U{kJ^M`pRG0IoThjmAhi!fvW^a1tfc|8Q9tOzCo4N4m>p`yxo<;k?Z!7EX5AzKJpRryWa<61_n^T8~+8b%2s;Y+!Bmf?{W06otvbn z&(YqV`&6gnGSZQ^ZSI=TNFX#Q*x6gFzm2e<4lZUNH8-086o+vchn+{POZ9^+dYOz_#IAUStIodWq<4g+Lee81Ch zjd?i~-1-Ve&;Ypo4AlKZI;3hc{eZ3^R{MT_YNq2D*3CTrZ519HUWBb*sPXnRRog=G z4m5j;G_ZG_!ZZkjnn;AA0#FBSroM;~hGCSu@p5xuuyp?xNk=$xRKKM?TQViCI~C;%mdcAco>Y}EI>7`i1-Oh z=&%SCt>&wSf4F;$znK1k7PRuChgw_602?H%stgPz1Qcu7OmZNMYgi0Wmw{Uab3TB? z-HX4F|Gh|!7FwKZg)Rry3k!qP{5kv~1jD4mW(r#;3g8OR`goKFpRI zmh6r#eq@byY&={^$3pTJ`*fMy&YO-y9M_|XQ^`I2NG#GK1)vXRbz2?!=JN7wmp0)f z7@6*b(&yAZt0HQ6Ea5w(NdZQ*cDNKzx`|eb_PtM{R*7Fir#|DjAB&A6$r>?SObphO zi4?9B4ZJdvE_B^|66)V1AbRrSv3ARN81`Nmj4S@!s(Ewx=f;^ z5FGquN&I=azOVQyBM_@|C#s*}7jx-xTPDW6=-_3g^_j}w2cqN78Fw=oXJWm~({JR+$ zLIgZ+N<>vaz6Jn4L?yAyNDdR1wn>Y=5b{d<8<95-g(`rL5BcxUuiL!YyOn4V(a6K9 z!BR24KU%Y4LGH%o_(Zq%?&OK3aE|Pc+}0V)-7$%MRf!_N+;`d-6zP~y%nWguq^6_d z@(=<$O}#nTynvPr6nq}k72JmCu(;pKt!sIRZO-!*aT1+gL0wu699eW@v{4gmF$e`0 zazyAM6d{2CCPgLc~<$?%n0C#Xt^CdANT94aWamq`zemCK* z4j~*j`Le{~N0mI$5o#t?I+~dY5~HJ($gd4!526Fohee!KWic(~tMXcWSr_Mr*U^5F z)t}@~?J9^bg(Q5o)08M|b18rO`PH$r_HqE#L;|^D!Y!Q*(knJCyCZmhkWo`S=YAAw z5h33fn;_IKnpw3{XF@reKKGw&E($lKFY z$~c?K)9iY>_4KRPdUWn8%qQxT!5H^NhnH7^SNhm5s||7IRyv{DBH6UV@cgRl0gr05 z`(2qx{&cnS=BIL)54cSP&;?ljDO1+P@xFFbX0C)ADn!4vz8{xxi8i;k`q=U!(`F)d z1|xNuAhn35^_F80AQHm?O|sfr95FSfB^{Y}>kI+)n|k%y2)Z~mtrh~g@#pmQqGX0LMV!8R#GdqLP2-e3-7x}Y&Rue{WtL{QOk#A$k!O^4rx=;* z(C|JdaYViVdGcR%bZYbwaiT77-LUKjX}%hDCd(hh@|D6J?qw%GO5RH2)CVToU zG|~sEk^C)wcVmvxU`{K2md~oA2Ezy23@`9q4?LSH^EM{(JinuhkO3zZ!t1)BSwNV1 z#o^crqjWgKYlK4~>E6BTebwP`MBo_Qkd0wI>JSWFC~6aGYE{}MjGS_|*2xj~e1(t? z{d(CPfR5;ZPB07;=cKO7=#K;aq|-dLh0%0)YiXXIhUIQ)%fZf^9!4K%yWWffSAzPi zJX*fY5Xpi9&7XDx=0RNmRy8jeZOpI8<8kEUa{5MiaS?VQlzX&!cnQ#2dkKr%)Eo_`9y&V(D8`z3LYrj9rT}@_*(LTkgg6kT zSokWzl>EfQa^s5Zyqo+pH9rGt7uH7?f>4IV^&{h8BCDP%}PjA=Rl^8jXi*}o<@K7}*4 zEZlJI>xCKxr^V$op#+!}(8D$&VhBiPBJI5$w@6+r_UuA(Al6XV_%fvUmuMXmWdL1l zz07f4D|fxWtn%;j`U&I)=RU*CydefOA?c#xcu#gjAEL_yc`aE^V7P62@3(jn2i^G)ZTVhZ)SGRY zK1Jz`CCsbUe~im828UI>lRMBc7w2ID*h+w#Wq>koBOxnuwMatjM%t?qTK`dontYH4 zTptHgzsBA)cEmUX@Yt3vpz%0h7YBt9Ae5vk%-B9Zolo6GyU>?K=W8@WyI4I^sv1Ud ztpkN(iXqN=U;+s{=8Nc_m28OdSjF8;SFXL2ZqN}3ULrts?!#VQv}ZVJV5>d|u3wA$H+cnR4``=YY|rVn-AOk(492 z%-sZ%J2Ng4r!bo7w%dB9Gt78`=Dmq?=HeF=yNdqE&A zS%d4L#Be`3s0Yh;)JXGZx15UeOLUS!4#kat_znm55QqMrz_AqP3`*bv4N#_K@8~QO z@)>iVuz)c!%bR3C4g??wiFo#1rM-My;lfOo>>$Ftlh{&-rzoCzc!~o~GBzAy=S|s7 z^BCPpv8x;*6Q4I-jKY#6KCMgJYDtC8Qei_}fcxn?nz1RHPb9-s@F5Hr-~a^M4{)=B zNZ>>{yrREpMm1LC-W{=Q559uG)-Hct$IUSVs=vnTQ^t!5EPXwH)m5j$rhU^jeCFDP zN<~GN1E5msu*RT-!`m;p%+J9fVxbZ;m+H)u$6`>>EAG;g4ay{uNd;Me#GrmAP=BfC zoCqEqPe#=&F4c7xhsot*(ivY{JW(kWaYv=nYaPlEXt86m)U#j7V^YkbB!fDDLBIfk z9A*kl!%&Gug8?xb+zG@2{!8_iQ$LwV+kEC=5t^aLwjv~BFS*uMK^OxeOsMr3IxIUO z@>rkqL*y4wK>qP^Oa0$>M{Qo`DRYS8k_dQ`371qTpNwU=G)~7tjod~Bqlsrd7mO}I zfr!IMORd?dy6=q3<%33JvkwGBNcauT;T$rT{H{0$8m@Y#-4GA-?)KDL7TzJlB0$*Rdq75C`&WL}H1B zU>IUStYVLkKDlF$=M2S~Y5<^%jt7SmhZZ7pV6iPa!2P0zFa^x1Gl(~ySmd(C^ugO- zwZ)sII?`@P2h;Kl8H_Xa9S3d9@NOsR*UOMPYbbXhmkdV8;-EyRpEac=RoX#-3@b&s|1jnMd1=n+0}sA;Z+A95d;;`z*F0I(Dg#c z)fX^$(XFyWh+y{knIUdTMG#tyi&71Sf*_leI>!bhG_DAeBMU)+#?@GerT|k1@z=ZC z6;K3GiWbfiA>^ulnSt^|M69`Nm+@DCI>5AM8h$FFHGHD%dcfjL;AX6}YPujz!JU;l zre<)4=3DU$ZRuq%M>W;WMhjc5_@TUNBRuv6vc#t2@V~8HL=sVOm`;xv~ytnzbSIjFO#Uw~8iu#em%aOpR-%Tv9ZaiYZHd z^FT2BcB3!^-}3~`1uaIgI0)CYPJ(0%btT$bC-pk>65IVkl(oAFV!Yfpa{^^&>JRoyTd@ttEc|azD^15TU9$ zvwF)5W}jpGV{RM7-oC|Mz$_tiRN~Z06quxi2Tw6{pVERWxR-?T!{zV?EUGIchOD%4 zvch~UuXz{lXtYa?1W|?X^T1q_m8D(@O5x|Z6HP?<(uO@MsZ4I@ue|B0aHPJTfpAg;gP%|eGvs+aZE$u|%wDKC}wda++8Uo>O zN^0S@?<%no^mCg}jr~%L^yUiVIXkc%B5?F#^u{d(K={z2e|_@b;4o!JJ^&%(ijl!E zn~F!`0E%BTHttxzHG#r3*znELmW>!S2M*@9|NggvYEdf)M+i;(l{$taa*C&Vv;xu~B!M6aIc7Gysv{pxbmrGRcp1js4Yl34Z<=Hr~~%jkA$ z?hNAev1$W$oMc2&gXn4%{Gc;Ca`+|bC=P^dK|z{5#1 z4oDP-(R$J*N^+KoSxUY`IRSmGncVx8Sz?-^ijoVrTe{R+NzG!+GMfnqf3-pSL%YaN zgenv*5wd2BlPq&mjbN6mDKzs;#XtBEZUZeVJQo z=+4(s^LlmccmHILo@p+kWSRcdv?Uz*X_m8bnX;GJml{`M3u)P#XvHjY?DBB{**FLm zo{^`3SfKW*ns93;Sk-zEsO92f11%B+PKb(~ucx#nm;b~5T(q%pVf1%>HN5t&SK)ZZ zS20rut$#UDch~ZJM^bo=g~{hp5JcZNI}g+<6JDGRfHl+6n2!f$k3_Rya zB7;WVx)tV=o!cd9C0|gQHNyao#Z|XQ$wk{Ib~4CAAqPXCz&IP#T=L(U@l73Xx#6IO zCf&c^PuYBfcOIJ_X5WeNXH;*2M4YoC(oy{7-9N_F+Vsuc8G37j_L=Lt_e82v3eCpX z>KQ`mR9qsf^5qu~K0Yx+(wT||m`8mRJU}Od-cpvE%{=I=olCZdc)iE;G!dr~cq_Nb zn>@t8U{(jmX!oODXI3IXQab3uzD2$5_1ZMGX=N)BS@akhv<`Et*KN*o!8fXQm$8_` zaU`1~)P%p13{&iux^7#xAzTQBYyvTUx{K_u6P`C!=j56uaiNb3*F6<@B1L3|=EsU; zc-kCBj7NrGNLbw;cm9OP(G!DHhSi(P$q?T#L_ar5gKqklRaEUY4K9?4M zHhJY%?tBZr%^kt#h5d^MKh`nDK9ovC_$#oAXRp3rA*?Uw665mA7i^7~ z6E*2g(ep8ZHkr9jNjv6cd|FvE$X!tqHi@it=>GIDfnqzp#W$KPgYh)^coe zq{7XKS5_Ix^y=d`X=k zpZK3HM_mYa&TR$U~VM2-(poMJKQ(;dywJ0 z+&jAQdtzJ1b69#{ue9?zOz4LL1797FxRAKt!z0&%Hp%xtz9} zmIL~f@>0$eUd|jmK$SQk>f1Dyp$n~Swjti469y}J5Rs|q{e%<^UayrWxxhy!;`2M4 zvAUQ2SY3^-n85wD4N^LAce7E}rVZ+g-7}sqZe&*0|x%8`z7Ky_p#}8q8 z?q)ncmg!+h3Wcx}mVM%*u+=ne7Pe^?W?)t`nFjq-g=MQEud)an27u&hgQN^&<0S_d z5Ow)#&cR^!mHDXZ&%y9V%*`=WQ~7gK<3}G1s9qPBE~WCJrT3zbA{^jL>=%;Oc1s|A zfiJ}DUXKZeXGPo(P@{}fgFl1{w!js#ol<__CdMvo>#UM?0muw+Ty0K~F$uK9Ny#FJ z=;!v-04bBfvOx#bttrd)y=ucb44Y7VX1OchCxY57Hp2O z(yNV%D!`%$l_zQN)xpdUW0EWg#)2|B&KJo_s6>^5J&82Mw+b}~B*L0Ud~1bdmzW!; zW1w0~<%nZ(xD;j&ph_>bywsFcTopRQl|Sg?_)U3rW{=D_yF;0W|OP3R| zCW2eU@#is_MwtE*E`V$%OdazM__b2gQ`vmNIT*Cl4{q`K|@K}p8V zl}>Af%c349NxYmdj+lS{O)Khwt?5}e*}M+=C&}#y$b^kw-SJo|%*pd-VkqtmKH5bY zcwH5E?6`I%N4=LMeuQWm&kPTwACK2*#f;9c)`??Mr1o4uCj1`lsxtQ8m^d0XZqPO% z88gqPJNQK_gKIH&X#!19)3PKRwMm!v%S^+OuG?tzebVsfHyW;NY`Z$M{-You) zmz)(_EO)iUyy%CPOnt%0eWU8yWu2Xz!HmA->Sqkn7CgM`GLDwDavg;_P{#EEHn zV?$IhnSD(gf~k5Od?gBe#gcVQHf0-ed3ja6ItLm>kLjdrdZ_7LRlPevM73x){LPVX zQ~s;l@T;e;Xwr6u(B;Dl9^9cIRG1Y^JkWSYX{LDcZld7^@f;*rI0W(rNp5|4cc5w+ zc(h9cltxG0d!;lTfI&nO-NPzJ;GEtb3f$v%$S!YV&*AGzljx3roiV3dT@0y@b}A|l~Hp3>~Ri%%;M;9}94PpL;#@f%sZxtuJ1}&wd z6Io|z;HBeMZPKVC&IMb7XnQcsSVzlfMaTI)bZXi*rvw=vqg}ibGM(iZ{$^hz?h5v_vO5||z zP_Nq4H#+4L4Qj*(bTK`R1TE^&_QS@odjWkbov4pmz4~}?GrTUbDkOGr8nMX%HPx|R zz)&J*iG@|}SnWYXsuAXj`F7Q|J*o!M%Yo(AvDJ*+cnf76TdZm%%a4Ig3pGRFdaS1r zJRCiIQH1qTw{=PTiPWowEbMwEjG3$L;S$U#Jec5BpT@eevk->e`6$$j zZnbb-EncJcQ>rvblk2!W`-OsTQ}`C@1IJnBE7tCtW!Ds>!BiugtC+l9b92KpR^kw_ z#&1U_K{1@LKX(=={0wwWZ6|xC9`DtvW`@P)C%%HcMM@_`0_RGwXe08X6bFKczURA? zu{D-kMJ`*K)Co1hXk8p7sHkITm=}#JmQz`$uM!vFIh~$Mw%JS5**50r9ax!8{o;-~ zrsu_VWFXN4+*))4`MGAaWp<`se0i0{?6hLP;r+omE>V2w2JsBskScTaNr71Z$6RPg7e zx7qD$n?u-A4l}$qLinpD>LP;Hb_pl6?^h9H(CGOpr!!5!e5V1_%M0qu%kAqpiiqJE zxzXd!i8o#{-4JXSNPN~5YmY;W?)8A`Zx(5ga#oTd!Nz~7$-Fh)k~*DRn+*ynPk_04 z(_a#?rH<}pA*+2q8>+4EI@faUxefi~BC0pwX657#DRphHLzY#1%c< zAuRZA2q@xH2-2*u=?hjts z;BcNb5B3{~8-NOr!B*W(EK0BxBpWnuR+y-0xbi9B^DTn*DL_d!+-L%YqRCCxleqwg z?%50EJVR@1)@1h2)ex;RvD4WwqIF$&^PM>5_ z-xN6CWFDAA8sBu|zu`MC%B;YcXyf9%(j{G-O_19x*$)$3FQ4`pGad#qm8Wg}CmE0P z{J<-VLF|V)H@oM_29FTmo$%OI@A#+)Ws?`*#Fqf@b98}^_K8m;ntv0ie>01Ji->=# zihrB2zxLW~j7{{5l3&gf22I8xC4~qgN}E`BI#vZu3&9^U{MQj$Kl%nQW*V1ho7Zam zt2XC=pI-yU69Xm+0w%o!$VvGQ(b+|Mrw2OxM{Vw{8X)n}+op1T3!-%26ZG!-SgpT$ zjaZ{9d z=Sc&JPO1;JKTPoHh@)0>m7~w#;BlE%(LeR^t{5&i4!gtYoOB8$8Vz%}ftK*4mYViGuY8aGvazi`zOZFxaDfI;{}dm1vX4UvCd%Vs3!iG2E7@2mkR`p zP?!SR0B~{5P*W^TzvJbnJ|0h@;kovBW%d10$ECOtSaxdo+dQ9Y~VL`1EpjvRFVO*&>SHPk86aYaWTb7h|1kGF}7+846z< zmG4&L8Ifdz2Gk^tz}EBG({mNx?;97_>#F=hS*-z*$xDL zw8d0i_{&~7o}EcSp6kAX%E@f<)jTNX55J=;%D__=|!ZtLpJ=g8H^?J*9I9&HhX?)0{A zgbd#y?nMv=@$SbkD8GDjm7;py^f;S;XZ8@t;@K z^z&cT^?dMOmRGO~T(#twA<}hS^b7pyd&_^jYTY>HUC<)!l62<5?okzO) zj?+|Pw?VfY{ce+?*2WY2?n zoUup!_fag}cOQcm1S<%F!mJ#CVQ&mU4FCZsXa@l)Wpfs)cGWbKtIb4o*57m@*gbdgeEiG6K zu+%AeJ3S5Jxm14e=o}7@K@S$)+`~z#9A$EAiZk*k1lo>_@OJI`um%sp7L9X$H%*S! zddI^7KaKJ&G$nY2o8nnx!Hw^g*=O=m5YSbOamnAhIfavq@B4HKus0_s1eCrVT2t_2 zIZJ$RB1MAuE`sJ-AD&&a-#gANBxQ!0QZ9J(=7k&cMII{soWl49Y~@`dISv!1RlQ;O zD{Bn(wJ}o;kBW}X8$lg?D5A7;gmsYy0g64}()yM@fTVR2TOif|GD8LH02UxDYZ})$v%2G zXnGKtnJWxUi+&M=HwZ7V28rQTtwD~r$DtrQ1k6HTDq`NN(B=!p@Ty)aBiMrvzz|0W zND6^5DTFqi6O&P?UaoU%EA>*XLY-5ML<<;z6P_DHHE9GdwH>#@J9%E9-F;UH!fCDd z>Z=ji5smDl*EA>v5*(gJavE+Yg-JG^4z(uD=Y-V5Y2Vn$9)Wa|gIa57{@I~>6+#1D z+5uF-VkjBwd2QXE-wFk;PCj>x%Mgp&N|{16QdI$XX%GN(onT0;M#$Rr!RG#>YT|nI z@EK)KC=hyxwM5NQ2YW}CQ(&0EtsG*ndPg_x76bma3E~fF1wA)RMp#Jv@u8H=UfxGC zX>5elrGRmt4{uL&R!{QeM#>KzQ&SCe~Un$+y@7M zq!SFqE(%4OTh#H`cSCX`U;xCz1yH;&V&pQIoq(Cix?ftEV`~HuF73Pxdi)Gl0dJwW z(b~Nn{kPvn^^Nd1IV(|HG&oU2rC{v#iZPW|bbJ2z8%Z1OoA z0ICrLLL&j3P*PX_%N8WULNA0yi|+_x!hMc{!@kUB*D6dPz*vs0o&J6A|KY#!IXk(c#@wIQF?QR~!Z znXVYBvDgjZYJAjpbqwc|!3Fkzc#CT18Y;6c`N4|3oZG?0fixH7$GyBt9f)kc!VvtP zjchOeT-K1G;G6jEbZ7nN+ZiCNC-WDTcb9n%z=LOP5Cj@T4P~|Rfz~c-EboZAGIR>~ z`F&@;j$SB}+%o+%%Ow!vbkL;S(4UCq^3VNvcF+_Z=x~g)!@@4x@1vxLkcD7NBOwpc7f2HEXaATnnM2t|X-20z1n;6TlVNffVOp6WUuVMu_ww-fFsjk%=7uqy$Z)-iaLtUU zctO}uM05sZK)XHM^8e^#B-kRX1k<_idx(}~g#V+Dk-bP82FV5{$Z(3uNMMUWsKrNJ zWO=uyq_3vP%g|)p#T3=1Sl0yP)Wzh~7!<!%wE0}Q`r^MCKMw{@00nN zHH4VarjRqV7sI-lc@z~lRG9&i#YH;FnUD8BzVFXYn9(onL;o&jMx|i$BVn9OXZav! zE%BIDXm=VGVewxi%n*=Hj^;L$SYWme_L zC=oC-Gr)=>!bQwR(1^BrRfRhI~nC;dGt5rs7qJYE!hG8g+t0fRy*vA!pq zk0)N7B~GF$%3UhuXDYV8$SFE9Q!!kYnb?sSz8)E8Sel@go4pQyaVj-MT+&w-|Gctdv_Pd#U}d39 zZ8>SFd=B0-U-@F;Hf(i%^u=$-dfQSr_SmMJ%5de#7IstLYuK*b($?tMT)LcR`dGXD z*uMB!>$u!W%hHzL%K2kaU){t--O_&j*fE33jk-cTqud^+!j-=QC|;q&OygNx>S;!! z>Q!#-L}TGq;oV;90j%&T9&&{;^EI-t&$jY|TJmeJkd;627&{4AsF3QXanH93I;W9X zw+=`+(MlPjf~pj~I|&}L3L&8l-7g7dt_2otv9>!yDl1n_y(B-XEFZ*lOYTZ)v}kI_?BIUU*Hxd_$!pi2)0f`S!{rY*e9&V8E(*%4G6*hU z$?co#&oN$dl~HT-Vd-1#Kmv*v)rcW&lc091i+U#p*!{4MYWhxg`V6b{mTU&taxg=s z7DLH(rB6RYuU_H9Sye9%J!W`K%r}N6C%b;5!q4-gA!>)L{xiP!i|^|feRlSPucYZ( zwWHET!%&R;hz=rq7bDH20<^W`3734VwZmS$= zr-RO$BWY$<9J;n0rj8lQUd7{{9Dc4d&J`E5B3=~%>+lG!CaJGZJQ)^A&VTh6&A&P{ z$uqrv0_4}4F>d>MX{J?z-Bp6>X)m)ClB<=BtCOOO&(cJ9{{A|7-G-OZ=49PiJyRFS zk>>W*@zGTt;vn9fSuhSJFL?~o4_(rga*D!@mqpFTI3Dqk(bwA4VmnhjFP0xk_|lV zP(pKIkBFDI+t){3wGCQKn9G4Z9?RxxcQY+lPc+Bt%+= z9^Dwt?ixhGne(7r9wr>}FdB~@B|gNjwCu{y`EPQ?Z&)uGMbsLPs90fT%3%HL!R_^B zD-!frtjDI}l%nE4>eR2YS)nUjPQ6H|D6!CJutvD8HLI!Ln3>?>z)s(tw#6P@#A6)& z%Bi6-T`@=@|FM|>8Ey&RSNNS(YnR9>9QFA~t+Zc&>+yTw)>6gN2 zGwJDeuI`TA(wLb5E$pU4?D*z2jB|I{%@zB{cXVI>Oa(Qa{t7*wfMzvjYhQsDT4E<9 z1*z!?{7qLt?6})ymTL6{axi|&#<297%M!SCx;|)>r?wZuy$;Z z#ad{*TWOL)xbB-0x35V3S@V89@RqbP>gR)cLskeLrD~e;*h7flpoQKVSqU43RXpX} zDUQq@R_Q$f)?6e%-DIZ1G{f3tV%zppJeRW{ap9U%_#YeVTV?+2Df>H#a4=JgG#cs~ z(QLFB?zf5rwCSsqRzY1GBRQFPyHFS#VQ+XiZxXra`!~9grg;@mbNfM6Z9n@(J?BQcLuYi_m@9jCdS*G1J?EAUbdM& zVKvv0NKA&tMzrBC=6XJLx;xhWxf@q5xF2(dbi0pNu}=|kd3bD> zl7CZF_wNVtuK%)az3&ze73hua`Egt&s|CJ4bgS#0VzP-U?NRanZ6xsRfUW?IyD#TW zq`0SRyBl%mjNbZDYUNGQ?#~S3dm7<;&})wnz2KBrSNCkIzxX@9{QHPJiN8pXVh1JL zbLrR#!?RbwL5jb^6ZBZr0fNfq!`_>CNq|CqFIRg&|2}kePA~meL51pfwe^60;hn~d z_rwap85WAUik^Fne|h}9QY1pGh_^H3!wVdNdEML!;zCUF|3)aPr?UM7-l|)S+ve?W zXO6EQs4g3D>97(5^NhS@Bi|J#Z^s(??wBt(Na;6?-_;fZ2iN)666t;<^c2y1Z`upd zQj<+(v$qJiw9nG5Jo{JGw{#7?{}u-KKm4W~`q3uqTyvDkm9H1jLlHzZ}|DE~UJE7R^og5g@^?J~8Wd|~ebESydnviK%(h;Z2S zOv!u<{ctiYpa>Rdl@Q>Be&T@UpdF?y?(hA7gxytGolTb~d^YZE+}&a0?(P!Y-95Mk z2=4A4+!Nd-$VP()x8Uv?B-z8;Pxm|hebd*>>3vk!eNt6xt@`~(L^Dt%M6FCx(Dy3@ zC9uoBztoGpz9W<0AumFJca8ne^7lW##Qq+A|9kcQug~Wm7%+PX4BRf0L_{pE(b!6X z<9Tr7s^G;+o5Z}(ltiX;j7bk64(=Cd_3c>{^O z92RR0?w;@82tDm)>=m;9^V7_n*PqL z4}N&166uood!GEPY>x~iePv&DO<8;_)I}6M-5X7lnkET+nJpVj@qv*2^*viX8Qo;P z&j0m>(zgsx5gzj!Ryv{ZZb1krkuP6t+Ye6~pa$|j%~NA-vk8eVxO^!^3xKw!VsGt=2d--aFF`5kJ z3qb<&bj%5cVz6spd-m)M6sgZSW-wM}xY`)iu+`-l+mx_Jow-SRstO@T0QNNh%)qed z_sAW0DON9OkN%)Y5^S{@`ID#_$q+F8v^1{q{S@y^PWf~c-mIn)86!`>+V3~ibWI7Q zDVzlaLhA)}-h#5LXde2-G%3Yy)Wu#gp@Ky^4YOWtaVDjN`Eh(h&jciTHvlD@uWJ^vnz2cJN21D#MRx z1d&Mow7kx^QRBu3d#S?~jk~6fG{?J=7}mkJ)+3j4=SnIilGEUM6QUgpe7+XQRJwCcY(Uo#b~p|cvs-Pasd zJJnzJ8tGxz&TEAt4c`lBLjcSebSpXZm=!PqYk!nN`tE)Bu{84~5LP{Z7tgRA z%p8OnXRyCZkfS5RUZ@@^OS4Cm^FB`BhZ!k|MNND{z)CWJndHVTj(4^)>YBrm6f#-V zvv4dY6&gz#snGFHgJ}t@R=6V1IUET$SYLS4kAzV zoJs+fDp`HV>CXp1YmVgNiG0G#&!iHqYAIuT&F-wyB3bPkuJY6S6->6eNUc(nHHTZp zqQ-g)&q_;`EzKEZodj03uTeq>hU;Am)g!n*Iw}sv)-~EaFBfHM2WL_-FS_4Pa4W)S zL7Hg9ZT-kPjr$9BN#HfT>Wqh)6ze0aCoBDG5!|xeDO%gW{ndi0#k!JBkS)HML4mn< zeN6_)-u`sWFhr;Ap2j)K>6K%_hPVA;-^uxtBLig_Z^y#MMQ!YQeHJZm=iq^p$8&_% zu`FNq4;B`$nF!Q+i}w6(XBM9!xb>A#pO!URR=+gZwb>G%)U^YaPi|i5;RAf#w{ZRb zC&W~cyF&c$cuP8M~(ER=RBjWev_v&HSU05bjX32PyT%*&I3^g#28e$jvMu11$@SNAi7 zekr|#r`jjr%;7M1yxT;jR^jYS1oG@X$UD_&9Oz)yUDGtdI#rbQc4|AMyjE%MS|nl&=*$=cq|Epn>ilQVhts8cdSif8eGf9y6pxsdPl0zC-Y0dO}rezy7ssGJZzI& zM4P9l^0*z3?|d^nZ_k$Mq9+AcWhYa;e$yBxBXwD=XWg9s^P?t@A1g$5M-yK+ z;{5NDqI#%2u9z0GHgB`=-EO>kKh;->Bu%zg-1S<#$6D#XL|639UImSu^L>6b!t9$_ zfBPd8_2o6FzWMpV^KB@}^i;^|d+qF11{hy7@$O5|pKfT#){p_@Faa{p28EJ52HyZd zZGe)(_;dLIFjc>4H4PzSzY9)+ki|oL%>1dE0dT230@XltvoMQ^0L%s$h@9FjFZ-J` z5Uv^>c61lkko{8e8ctsg-c%Ki_!^$@3hu`sypP(BT?2w85HXMy+V~0~u3-bzfN=2v zshJf4lO5>`a3$B(qH6Xid=_~a1I5i1WhxZ0yJ4g68dRZ%dZCOm&W<|6zWg38F_nx~ z9gjL^fwl*npLa$713jP!4LF5dn}!@_mJEhdVIt-EagIV;nsgO|0)Ji^UgHr5iz-W+ikY2^d7kQz`WCVV zHD(O8$R&>0yaaImh%A-Ht(>xXnpzXffR%HPVV*Vvj_v`C*0#yS;dadci~d!H9>B`R zH1-))9x<^$h_#G!7VhOB50Zm@PNu7q}$5}?SWQMlV&omxQzG8;9R>VAd z%)A^-G?E(El!{gdV3DGs_=kYQ_!j|(0?>w<0iZ%h;bLIDD{v%~r2kuiBf_PjCglea ziExnr!@<$=ymN2@+{}#Jyv)2p{LG@_+`g=ZF@s7f|==_7iSvlGKTY++MvHg7~;N<21y0}0B zga0kRS$jqL{ab$flp6jnzXcmJ#@Gw|ZEAmq;M$Ut zH&5xY z-SOYQf8Pl>Q$!MZSBk_iM2t(lsxtE-T3~_Mz%CdGOp8uTwc6oY9FGrT7Z2Ws9!uf( zf2=YZZz}&G68*R$fJFn3g2x$3QGHy7l$Ic71r8p7hDAigAYp*ReBWeD$J%;-Jk9*- z3wS;rwnUgB;4o^=-*#0G30X}+rHF=-q*eXW{?W88;H=WcSlBx<{%i2SFbWAN%wCnc zt62hRIGjU&fA-B(a>Bd1CDD0{GLgdNxV51dW{Z}Nv;@_Y9CZ>`m6d&|N8NawSm6h2 zQdQb&F@jI0Y}en-cZG-_iZBDpZ@w8BOk*~kHtM)Mn#vIS@@>8S;S8-x%2c$#?_f3p zLI;r^V=qmO#_}`a{@(ZporKe!C+L6+Tn&qY`?4&$}03=Ur#8ZBV{%#wJlOP=gvKU~!^ z6xv@52~?TA&vT{#E(zIvyzF$XHGFipEfu-)b`!NFeYHo>CEe&jV{hLWfQyISqC}|S z8wm6m`y~vGWwd#O7}Z>$_!5Q~2gl&fFAjZ>yUizSeCZBb`yNl~7H15kCal3K5R&)l zau%odYR!hjW9Sf*6G4W?1rDI8Y6x|Lk0ZV3NcDe*0%qS5DS?<|_>kDjIOFTx=pF{L zTlSI$3er&@l{KP=szZ^XfGNF*)qa}=tyb5VIHPY!#4aPU^mjb;frg%{J?YqlJkv>h zUFMeEWp`}?XcSOSKXw1255hdcDqC?9ByB-gr2ybnMep2J%5XZOr0#7o5`+dZ$gt&+ zG`@v?UeALUh>n|~g&|t!&pBQwMz`~{maefZ_ywfu0G1sGyA>^el0DD9iC-isU7N&_^%99KBvJ75k*J?bh4Pf?=rhYG=m=W{Vw@WA+K*{CqTiEeX<)*~uP0c&-QsXG%92@xqqh<1 z8P_+}Xa~9gD6)h2GN^;eM!g($qxrzfU+4b0)1X#VJ_rPy;EpiOCK*4bq?E zg@rU_s_dH+Zg1%xn{>b78@1*y>*IS=C{}p&)fYIXe#sqEBst1HDRj*sHiGG&34ul} zf~H;>;ItU)$7P3&4PTMeE{V#4qJ#(fRvjWfv`_KusNwfUSh;b`Ps~r0(H9(VJ+^C@ zv<{bZS|E{Cv4<0c7Xg6B#*K+>usgUPD@T7bs;$l?dPAgPh(^ULSW?@=>F6>zJlq|) znW?qg9vf=lR{OP&PV!wWiX2VOn4Vb0E4jyiCfFXNc_cWh9QZ$VZyitTqkHwWv zCS8Q)wh*A`jx~V(Xn`yK)dA2Pp1%g2EgU$)6~MG$dAWq#``~PO3@dfnrUWzg=Nr!Y z#7K>^m!U;2nO;r>*jcLIv#fd!ZF4^qoyVzaF~UI8dVpBczYY^lgOLyF6>}AMHHjFY1f?N^xWU$F_zo)sR@qS^L z(Yoh!)fT&)rRKct>(uj66Qpqd^5w*ouBKnQY-FPXpeUjITt$_G8dPTP4+WsAAAmo8q@UYCLse4!!N_@AMWH^1)wQ$&I?K%sGx06<**4 z3T-&=qh0xq3-M_b_}Fntq;0Cb#B+z?ES`qgoD4f8%z*5IJbm z7?qLBov3BuxfRNzTSS!r)AVXr>R3m1oN*kFTvzA%fVTCt)5I$=-}&M0QG3Dq|w*8hUl{W3_K z{JnH41;y^=!9VUV)ljLh7B5h`UF*ve2rm6SHH}am>k}LT#SjwnD^lvi$J@Fld> zIZl8UPrz_H%qRk;P7$1Fl<>F@rsAGA&X{T)d|*OKV02R;Al!P1-n3(hfuh;*X~%8x z(3JgN4O7}3(L>B~L07|tOH>6V+X>*O z^O3rRa}#hOhdDQTz^dvwKie9-$7QKnYoeq?fGttvU|j$munG+@T-VSnKrFKksF5*Z zEcQr(S!ip1pzWBBYGq`J8)!i-9Bngj#HiDe?nFw??#FwP*20?0q&O2bk{S?+0wOe=Q!{KUN9~M2 z>6S^82gciGr}a=qP8_E}-^6q4B*L~ws_Ul9GTQ5f(rQ&EFw4{9`SPlE@>*s@!TRuM z3xw)+!qGDXM;vPJEs}crlEfV)T_AA60+J!vpJD7{1fr9X?BP)qY%!#rK)@927#rBm zEEsM-7d+EeNJV&z)#nd(LT<^_l-E#?rBE@9fuBQQKiQxp`=L$%(N1U4uP88{DKIXI z(5GB;x({F#`g8bKp+=((COYEbBywG&bxfmjr9Bc>_=&%+$`Q`x$|L2y*pR-pd5sV7 z>d|MK+9qyGW@zUS{TR(KKGFUep{jA0qlwp9QBaw z%?JY-D%d=D%0eh(BTC4!@XLiexSDbBbq(+?$Dw*}j1sHk9tCo&axrXQFd)eoS5QU6$zd-?fTPlvQ<>ih6XY$7J*aJOf{9 z7&_s}|0>qF5+Z0RGJ3OPOF_Y|WCl6Jup`BlVPLu`GLS!eeZ~wEa+@<9u*t?hs|82G zd}>1x$@ua%jxi?K0one-nuFpT+XRj-^5gtkeLzt1+;j);wJ6`LB3D}N*DPmA1Q$l6 z)8AZ`LYuDmt(L9@*-mGJ-^%L1Qkv$`)I1@!r9ZS51Zd_yAvgfmBz zvLpNz<8AxPgg7cpY!iRA3(9NP|&GpABQ?waTQ2+f88EkR8)DSQ_L!#AoG@5^-#5JCYl_K_R*y%k|RH&mEO6v+)kV->l? zpLHzUb`+RLd=(=2ZCL+8oZfZM_V@KW6zVr!$^Jd;7IT3XY2ucnwSII|6Mww~te(!W z(`IuTnJZ77JAb=`l2D%(9 zI}|O|&O+HhC7!x^*sG_8B9i~*MWLeb4gJc@a5%VwdsUihhZu<|(sA%}XZqJtN&=jK z%%EFO-S}arx?#h~;ga=|pD-iV@!u8}?JeHGs&X=49YLG1v?*&NX>{E!pS-C30n;9y za6bl$cLo9pYdZ1xDep3Am3v>zd$Qd#Qb53|nnACTe!38^V>WkO$N z^^jb*094LFL-TDAegy4UPE$?BeZIqbkF(>nN zbV8EDQq~@~dHJ(`&L8uYJIggGw8pJQZXhelKtME@P{6pgtT^a%0lN{gyhO4ZhUOxh z`U0XBwn9dMEYlZNV|Ra~s*K+YYJbW!NNs*9;jU#E z)yAFqV&<+ftoj+{{D~dGTr`&Djn!*hQ-9R8l0Q=w7g!@o*f|yr5u9pHN(|df>&NDP zoNv~hU)RgLJZhO}CZB03xL}C-cI?0A=OfF@+5G$%=&5!-u_uwf$iTkJ;;1;gx%$)@ zOGO;sNPrBoayL>r{%Uu~;GMV`6*M)u!P#w!BsS#L-4XZexnQ)nw)D~sm=z{oz8NN) z0K=O{9NPWu0Z0c4W$8 ziig=ROlzH|YU=OreMw^v%XL_8N}M{+CS?Xx00EN z%k`ak7_>SB#Tt3X>`?A1=!(px?#e{N2=p)eZ*BVb9fi*yu}wFJCc;c}Z$$>#$EaGa z_sK|$y3QUPUyz;<<%%>K4eVNzH07U=1&}SJBAM5etMs%{Ps1k0q*nS?f17Kb zI@Nn@<63m=A}t%#$Vxrh=_%Zp9IJLHv_Tm-oaD*{o2a~^4EUzO5PjL4Dmr-ef)+imIlIw{2cd z!F$aBC^>DEy?N(@WQx`3V^|a@Ju@ZyVa?Lu09w=L1k(!yoiTW6>eAZ|k}V z9%F{4Sp>BM(>oWKkLw%CS$$`}21J-7NoPH8miHcAKNsf{Uj$y>cwOz{%H4K5T?Bk4 z{cK7Py83;V+aDoDx|H5hZ4XK^@MeGnUEVrZkDJf!N)YKOJr7ae2aeVwy4_ncpK=Y{ zzmUn7d=ENCje+_##`!i@ZR&w-GA@P)WV526jJ6t;2uH$Y;;vE~L5XJ5Gb_?-EJ2B9 z1-*BJ8u!8zad_+2 z&$Jo|AG+-F+!2zpRRb(KJ#3eD^urqY-I{2su)>(aPzBt<(+46sJRi4)M!CqRbJ$Ep zIcek-34<{3q$PhoC@;YoV|zj_e32~2F!Z&|0Q>SJLd6jnzetYclL;s(#QXat&CVm{ z%1bkE*h}JKOjTPs%GF*HopT5TD=R@e#e7gVXbOamY>D&JT#0bBG$ z&`^BGj3|n83v;5Tir|`E6I$p4X9c^#%=&K&sj;7K-aHmrv}`r zm5*5RnAz z7Hc`5Nc;X5G5ypY(lhN~@IxFo-p8@+FgCgGQ<{r-y`1K$Zp>#}Bm#URagZ-ZatIi` zl#;Z9Dp5`4(21KVQHh7Qi0`mt5ACD0B;S^6tMXOaXYI~$deaDjuJGl-Z#Ea~(h5hM zKIr)s#jT5e$Ci|9W|EBuRxb{yRgr?w0&^G0cP&jpS&sg#BY~naLnFG?@fv%44d{#L zzT3bnJ!MUUMoY?Ypmf!Gbkv`#XVSMHyR*#$jLa$wT#9t#jrfO;7y_^m74j#&KmI!-QkAhB%W!5}vXPE0X;~poU z0ThFMYFvkO$n~Ub&#r!~*~Ac9rG;8wqI43hI8-QRRTN*(S3CZ)wXo^{TIxktHdldA z!krP_atbsBnG<5w;dJggi(X|#HL8gW#0<;^XK4>EXfvo$ss34OjyOc6@!~#ME>e;y zCM2ziQ@Z^w6#is!pr>x={(%faAX*sVLZTeMJO~56*i_{=em`pj0TwU7N_;~Fj^f>8 zXqt`q9#Z_k|C4GadIX(go-Er6hMP>)UYpZRdBdrk{~ptgOEy2+BQ;xr2=Glh-GeIZ zK9y%GkVDisU>3I&myV?=CX;?ZLl(8QlQH53u9BFVFzc~$so0Gmn{w;o{R8mBmbs-~nd;0JEG zj37yej5$Fgsa%-7AS_WDv$w&C_5wfslKDI1E)c_wpQ;3P3dOpNny%ZVAXgh+E|?0a z#LA^m9ZYX#&k~EF3_6$h+UU9bxB{3k$%{zxrCLJnyYCJ{ySx0e0=; zviTjziLI%F6K!@hKEWI)wXblN@%(o50b^ky{n8bDmLdI2EY1V3 z1q!y0#H&vxWH~02-u*U<`xXpr6|~a$Hkr<3i`V zjz?JJ+p%twWi+j5Qb)Vtz*4(-GRNJD zSFFUNwIcFtRGYbq^~3DDVW*WE+H%8fZ22CvCM<5+>aAlm!*7~44#{dF1vbLHW}y8( zgC((XE}+*k*XNR0hk9@RSSWrv7CaTJ?eYgfBo4$tirHJKj^+PgNv z&FQY(Kidb7?yI&DnX7`M;YGfkH?17)owYX29dK%(T&*ezyfT=1GL9td=N?jiq$?^x zyX1|sKN5NBR0=kM5&m>Ef&UP9bNOY{kQ44bwqkG4&+?HCtcg+uOX2J|@-*&xM);i5#!%Hh+G4PJ zWkuji$l0;p8uD!|-{78DC^>j8_DFX+?dss%^*kp_W!b(8&z^w_n$hNAVoQ)%iuZV4 zCz@_&YYS0gi?e&n(*SWh4OQ#C)n~mA`iW}}l$){if@AHI;^BKrqPQ*eqGqB8Iei8V zaP2v8$EBi}T@plK(XgMQ;nXxz79qqGgxAyw6s~|Shn!oX%sb6*I!ZCE(IN7);hJg@ z8V#_L1Yzt|P+YH^kEi?=X${Xmn^-)s13A*|=EM$Cx&CTqL&kpgJbAR$02{u!#m#y& zJ5cx1vcKDU)d)CA_B);V$)X@L46P2dC{2a;zl8+ffeXh2~?sw3GJQ%!pQ;U0e-TLzGTcyik~cJShVL| z0DLp_+dTfeS`Ip8PI{|2d4>ord0Fd#Fb+fjXQ)`J2ODBQ=RNVz5LJ?xXMACQC`&_V zkvIXUvEdgZ6trEeEf{1+jnh#j#kUtCbS|*67t#UM<}~=d007Q&WjWr1W+jmRXasFI z&n{yGF1KLWS3`&64_3Gj86J3#SC4eshX0r>|1n!0@-cYK=@_i$6h1i%6Kl>=iiN6e zG)&~#okBCND%7o?F7%;BNb`pbm11kJCC`9i$=y0m2?Y*=mTX}iEa;wJR9zs+u0FxN z=WU&em5Rb>E!i0~?lLKr{n{*}j|^R<2n~e~xbNYs31LJk;LaD%YLI2EmBT--VpmTJ z(28f-mTPnR(S9fEi9Hr#)n3CTpWz1urv^m{faY2Wliik%t{Za~M;HW6x@XHrpMzz^ z!$oFc2oy2D+oQd&kZ51FQd!}{`T&h|H0dgiqyga-%y$v?#ISoAn!0i5+?e0uIFfE* z^4ki9RwKadPEkM%YY*XQ_Xt;hrtc)Js>1|?$WsXvJn>g5x7-Y>wob8H00{dmoF7KW zf?QwU!n?v%)Lt~2$|>N4gB{QU-D>#beYpnPqwVoZG>9CbT7^I^OnK!og?ls+J6QAV zNT(`!Px&bSv6)XR9|r5jzyYv{;Jl67JTxJhc5LaB*M`ZB0j%*dmCz~!qZ|q&lAh); zegf!Djl|w=+E}5?_;e@*g{9{s?RS6;_5gkBzC3O!2crQx!4QD6-J#K}%?<2^-JeV3D-k zW^Ytw(E5#2g3wHi&?6Mlvd3G%Yoz$TVap_QR`=r^cHdJp=f)j-kKcrxmHP=~)PCfv zx7Vt}2-Xj2BJXdglWD6~jww>0CCz#u^~WvpH@8tQ4hd<_58aZ`lcF*l$SF~N03kx> zbj;s_;-wrzrD3oR%z}G*aDOC!;G|XN7WwHfjsV7qYwTDI%PGHSuTK_8FANM-2_CdcS5@W%7+8VK1J1oMI*di9LhgVz#Twz%s^r{FOKs* z&QZ+h3^tGGve5n@(UeU+s1$(;_;syhjyO5c6ZNKyP;~LZ#q1|k;7=EkHLUDj3qpQj zk>$(r#_JuL%jRx=c8M^~L{#HM^HqH2fo0^EHT>W~xj)NV409aY{Gw-Za~yi%7Xq!Y zGbXsI%LYjUKy6M~;v#PC*w%?S+B%BGoG@oYVc6A%aFp|wg48L_Oki4pynaT+ylKIF z7H<4tHe6`k59uL5T^N*21{l|WDJp$zki^)%V=Nx_+em<>i--ZPcq0lJ(8AGzVL4lA ztT1?^EFJ;X9X5X7I18apW@Ztlxg312wj08q=r$!RaP&*w$Ch(h84i@MpM)8jCK$B^ z2z>@4(G4LL|5ig`*6wXpgg;(CT-1YcmxGPpN3^rY7K+QCoV z5VTD*@^<%*oe5TIC#aor-S180lL|oSc*I7PEo-AKf(Evwz5IJ^)6sGhrA9cybPcnI z(eu~t%U;8mm7;4}D0qTj<+IH#zt?Y%^$3iAJ)py2!B}UJTNJq{l$Fn z%Uy5@vWeD%6AV#!+t`NsCdY3U?_`FsgxbRhvr$sBECXFput{-QcoD|n%|cG$$d5_4 zV8U(QHTWe(V~1g#%PtImIUSaOZteg#tObtlvd5f6N2m=JldKKS`1d{;ypH7kRFQ%p zFZjKB2(>S5LCXrXwYNy?C@;nw(Jv4mROw198hvPjLg^^_ZEVy(YjH&q4-!}7iIFox zrO{ES4bR}A$K~4UE>5Co8#H(av!(f%dV`KgP8S$D+@ zQ*uKA*c+vIV8@a-$v9N_o?Yh0qiMDp_mqteGB5;}Gqf%iMiA=atWj-#p&^JeWsUz- zZwN2^Zcip{cG()1n!VQ7C1>lh@B?F$gx|bDh57O5^{U3*Cc`F@ z`&7eJc|@WZzl+L`L}PnYruWm2X-D*I08(+Xpo=9cCXNm9n~tG2(hh>FW3=ysQ4jOp*y}ZOq!Tzf^Jm+GU4B<^Pz|(*Rww2ZyF$IJ9&M=hZjTqunETk?G zR=(m|iy`8h&DL#!RHxo?;lOA+uG^*aCDv8z^J`qToy(E;v4*jAZJpj}n@X$;^^nE; zB~N^A+zlZunGNQO+((_ZBPM5zww+GOf0F%J(7gnY<1yf>+P|1T`WBg1g(A7Jgei>% zfk^MwcI8^ar`!g!0vZc_Yt1IvpYiSjxNfO+XXSLKkT7Jiu9(Kcj`2(O!ur>K+xHgN zx+#g9Q!Tf#z34KaXY9e;$)mc|=Yx?!F{T%gTvmM&FOdAp{WfcEe6HN0T`qcof2et_KDE}iSopavb;*L>&;JVNbx zHm2wZA(sEDBjBs^{`i>A!416%(YY3ed>^CCIhG^OA*qo*QW~C0F$lNvL-|( zkn51veZPka+d1P|G&@YiV5cW*s^8O)-^jbkA zspq2pYxdPe99je`3KD20y}cUKz-^200CL)pqn8~H_mwU@8y&r4>JCW76k1F_6w+7J ztzI%sbKACGwr$xIag_xfS+Dr6Q%DGp1bx@++m9|E<`yk`FE*%-OhA`5h2IgCjG~uPc6bVv5|9q(x#zL$c>nnvd{?VRxL*q zgJEvFB!tlWBWNW2$qa55b4Z!-daNc|yK~f7vE*_(Emi7!ndwa0g&V$ZF{z}SCJj|; zl<>*aZs#=TCwI1z!l)tOs@Wm{EGmIfkKL)~&^w}0sqwXj8|FRu-a`7+fC+b{!D2Kq zf&1`Wzf|s>fMefbG0MYDcbMG{J&7aYp}9OhYp<8?^*OU>K!QA7uOoY#UT@yGA?=SP zTVD3h-Mg5#Iuo{B1bBw3pnB(=9{kvAksD9`s+Uu@&+XLj|IkY5T5Q3tD8JQ8X>@vT^)Q!~0BRHC~QfhW;b8jl1@> zjv*Ji0Kl*~A#>S;ucQL(P^Z9H?%1zALY&-g-?{F}3k7*9cO8!LBT4KZuiR2l<+s&W z!R>Gz0%~1@qsTYxmq$ZBfjp&w2L+X|x%Pr{u*EcliVVef1)d0{t^Bd%rEk^MU`#mz z02oPn(v9?kpFc90ly$m!II=X98xv3h7Epl733gpJ25EKR)Nz2J=Bg!8)vF1O6*yy} z1`=swXg(4MMIzHMD1{<&OwfilF;%(NV9KTgMoB^#c4O!p!MCyWc_6BdSk^AHyyTO$ zmKBpgkv3^r&91{eYgUGG);>w9)!@`J9(|icHC7JV0qwtddLP+bP9)t-1p|l%E&iUd zE2xyUACvx2cVNV%i584fMI;?Wq=roi;G~Y)hjgluh-dr5RDLoWU?7j;za6J9b{%AC zulgN7!Cdbv#62fN?Cd!!@jA)Xp6{x`4QlZ19-mgGC%vE34g2BQk>^Y7wICNK!n-Q_ z1-gx?Cb*Y(-MO;&kT#w`+Fq1=`s!W6>S~Crm#3wXAA|_i+}ZPlGYbQc|?4Uq9oTDkF7lw z^g;T8YuaQpy9uBrhv_lB?wV(5NVDgGIb7(OdWGppb9otW@y!N2p=VzXPQR+6RN zX`WTkyPo>Dq}4*#^URJLvP3ZcgMg#LTEs^nQgv}37$?TT{GAe4Y_B0=F{hlrJIL~K z=E46vq1Xj6k3`TlsvKa^KWj%vS;!XS5qiIJB%D)jy2Au|BFz8Y0&7VJYZLXJiYJ)mbnqAueeo zyhjEf`!Y`1Yc%JcztZM}Dhx%Xa9E6RZ)FbVlvq!Xz?(SGv4~krc{Mc`T!M&r528j~ z@UV3Zo1jE*7^k~BpfW8u=>_M0PlsT&6cq~(vK`SY(-+bq+}BkOawpGt9&mj@p+187 zp_lKQsl*2V=beB%9pD$AV^g-Ga3xz){Imr3#P8Fb1QuhCQ?gu|%nQKPv%2gpN~ zVMNz&nU6Mra>Gro&g7IE|A?Gi!L!MzRm!B@nDC==9bByVFsQ|%-BPj(&ezlzAgS1$ zsYuIbGWb~o`KjWnm51>_qW?sw+JJ=+ixp?GbTFhAec_K};#PAHa^waGgY2W1aqAbp)JGl`~6gw_eq9E;83;* zcWe9izvadx+h_WUvNvUsp%u8n%;jli_`S&}IQUeP5fF`zL8;O(R2JsOaH5XT1D=KS zU9Vr55H1+i?zv6iJaTVUx9f@R7xwzZVGd6-&V47`y5annD4gKzrBo?G*_Vbk8 z2HCevFQO_)oDOp+5 zJjmzizq}noESGL+-5ZCZ?KQ6C9S;|K0e*Fuu^>Q^4(S7UH7kjohL!e ziA#rNSF@hXtTxQa3xAKC5waUTFg5E7{`@1tS zfeFoT?w?J2a%rsF-*~6pQr7bnV}h>76inRVzx5o6LIh@${+xO};v8~RUX~oR-kGP; zfCcbxprcN*iZpvqCr0jQnpBZ$^8^=yR1Jkjy$XevcVqKcu`_BN%_@qTOYE z`f6E%6VBkn$gb|Askyrx^u2itCJ9LiSa==Y080tafhh52e(6>(y>(OQGpZSiQwE^` z?>xBp{Wv4Nd6xnxpv)ubD2kDK*JdMwXzLc6`yMP}!W-k^;slyk3q*Ne=B5gdnS@2C zg`r*6eXbF>xWSzD$P$S1$&3`|Oz6J8qW7ibe?DADV4w;Nl1S4sQEAn@$|1(oY{Pt! zVjQqIB-bjIrTY8OY)W&P0>G4n3c<*SLKTRCc@V=TyUh!ovF#PxMq@TkW81dv#s`C}H6!p`^Z^l2*iizENkvHRKx3QJ%Sq_H7eW>gGW; z_(7_GsI>4=sNf&FWWl;Ta_dxlt&tHr+4$AOO|T>+E}5*TjFM;&lpqAckz~cuuV5;8 z?-6j&hsozHRJ7)^s}ysOkZdo)PYPgIbdf!(+dD}Ahy!yBb3LhtZfxv-N7C?n&y8Gc z3u6r{+!%&)BKIf^p&6N&C5%Y6pyD)`SVP`>JqCHv7^VFe%0c0qR1pflOpPKOv|vyW zdN4kA5k|l`3C%uc^8nJsfF$tXjSCXT0UkGi;zAP&+QY<1cg#ARJSm(MKS3L3K2N%K z$E#}J$SvX9`ZOWp1PXkx@-jJVH5tZ2q_=BAS z9eYq&@&JQ-1f_F;5VTKCV8+ouj_py56GFk~F#$+`#CyZ(Dl`RFPXX&qVUM+CKfo{m zImslAAoxAWhdWc^x8i^Ck!+t$18(-6i9)5s#s_-!Q)Ne7b&5G0fPxCB9cL(drIP6@+T!z zsW);O2XlqD(wFS-;;?0|WMVZC@Cc?dlJZm`oyN#?6w)4tDimV8YDH9GR9Ye7bj4=0 z^Sh<~)HSNQxJ#*vDw)qs1zkafII_^ zkw*#dU8_WkiWCZKuT4O7zLgfibWFZJeO74tCjpm0pPf;aoll=rZtY_@%Az|rR)SLI*R=bN56_tR@>g~Uvq{aB$dAYmw`sV-)z&S|caF{CbxpmN2m z?p&ZRF=QyWsQ&y4d`fer8E`*cxDb8%<>B&thU)U_>WHcmAF9d-bNV=&vYhkk)#|$4 z>N<~V-hLa|sp`=MhI-hVM%0TUJ@Jft2H7`;Dk#P#?wS_in)LSbdJ0=UhKr8$5Fyc; zb_d3e{EB)HiZ+^>Hg3XpkD9Lhns)gb%?R7J1jd$h#_ln2P46*7bOv2dab*t+Vec&C zk3Wp%)r>g1jQz*9&FLW`FN{MpOa%cKW{6C5n3pTWwL{8Gqxtj$6otdWOd}MzgIcxY z0hh@jCMa>6F~j{am)en#+NpXb9|Fec0Gr8(gGmDY@#fl}yO*AZOk-oUle2bBD@?Pn zSK~2EP(w^}h_Q43YUf$%#?P6~iS6fT>KfbVmb93MFqzNsnU{T{mW6Xy0+@gB*U>uI z13c^-Rhiez?K@2E&y(#pa+qtfLpEox+GFapJDCAP_S=ihzqlE<5}0?p^LOiWw*S=a zA5`yb+U_A<@0IKAldv3>pZ}sbIRH5v=5HQK*B@JetEc$oh(71kmh1hVP zadu5`b58Ea$kgx{L4U`8^RVggsNC>p_VjGF{wW3K(V^j`pYHCy{vqP#rQC6Pm2oe? zF_P?tr?TNA<>ZW^{=L89YV79Y`bGrZ@ox7b*)CRUjvNMEgYc@yaFp+CfmP=`m*xI#{@Q{ zj@#e;Y{*DAh;vR5fov_iY}Xzv@8@hU_l;<9;2U`DMpQE=G`zdxw}!unO*h@Qm>kYW z32X>R?68)MIH~nmp0|H3?r>Ag*^l_yG0pDa3fKt<>v4SV@B*Et`q_W+ z-{DBG!>%Z?**RLc9XWVNTSVeQ zIJL>SGM!P39;!V!_$xR-TcNaxu3VYm7QTvV{yA5knr49?53J)Yf=e7Ctge*5T69{Q zg$r!BpIgMRB>2KOenYuo4?l?7+K7>IiXerE3pB$ZJxW;GNGi1QzlVrZg1F4wq>ZZi zo!mqO#CY`|r2=ndEp6m-Ifc~AI5{|l(OB3zT8sMuisP+jBqt1sEwYDh#mB?Sb1jMh zkP;lH0uon=MI{Fw7l(k@mmV9n+(s@Acje)GW=AgVwR^UjPz_3VO&&L4Gxy?rkX}Wb zN63=~+@(%xn^G=Uv5mX-n!7=uyN>U*eucQoG*>?V1BV0`2kBG6HJ1@u12)&IS!AeGVXoVkH|9McJq=m1?@lFhvIz%++Q!QlpH;B&RZ=VIpjO4tVsW8 z=C*$?_OOw0*Jo`tvE{Z)rB|K%W4!jqjDyqkggfV&+mX@L%+lUAv3(<>-6_-Bnf1ZB zqrs}-`jorFRm2lS863fB=hEYGsMX<~Nbh0U0SvPB^nKn7d0txt>?H7jCC{#NXmHP5K=VhB< zXf47j;+dBj>w&$;OEUmm&A1*avOdh9@pOLBxw$yFhWny!#>0Znt=kDD{1GbBDIQPz zl=6Iq=g0i5hbMxB%Y14m-OM}X$J4n5>yFQ0LM)$KB&7~EpO?jJM&eV>a~+Xu%UeOuTh>FD*IQ_9EWd2a z-EUO3UpWKhg0BUXkcF8ig3tn0OK*G9Y&!%H7<2-89Pe3~mVBb`*o%+nY63eXLHs)Q zCAI?WWWf!Qv|L_b-zwi*)==wT#{i@>fu($b!r^YOn2-)vZH6bE?A=rct5U0Geh(g<>58I@|2d;gf!y%?P%bw}C3Bm@Z zmr$|~pIy3kNa}FF&83jbnwc z)&evVX@?WLcjwrC%?$%SW|b~ z@IFQHa^D+HVH(s8XrD<2uZFilwf$`QmA-(<**HQkP>sCk)j= zz~i1#SrrKkVelq?2fCOie>>D_kIT3!n$G0|=f>i>Srz$YQ+QXXY3vQx=$e($-4>c} zv{0&F`w@1?x4XGK3+H|Yy7%RBDd_$Af0tFN>+^Wds$Bd~oUzvKFuX5yyvp3j-}u*O zal3yQjmui6{H?Syw4lQ?|Aq8$eeG;*P6yF1pv~^b>GLl&!TSjgM|!Gx1v#!~Y`ZI} z_2U*a@y*-!MDg$I_r*hq0Bon;MR|1^YTpd~B+22gVrN*#M6pSun;<{-a-_3h)gNFK zKJ3|HC^1R7!Vr0rh7mH#V!Hk@5<85^Mw-&($uyR{ipd*`uH<2&XfdeFv_ed?Ff{BJ z<1lO*jFg#(Vtu9}sue26DLU56a;2;CQkQ|UKh3TgX;G>{bHeW*5EG!uFh>%x#jjWk zNf~huQtc`e(F@zB*h#GYNuuqnzD&bux#3FM8VjehgxFWlmQ4RBzgr)nj4i zRCn9^E_KYM)IF+n?~}=cEZ>pIf}qQp*?Yd=4y|h2|5%w__;+2Wi0?d3jh6}b!Jb zUsJxiSoSf6!@zlzjkzQtl5F!6kH3*cX;=pM7T5Vq1k8mN{WZr4?uObY5Z&ipd@rR) zdZ%2`(){(&`$wC!WtsIg$AQJdTV`LXSmI<231|5y>jrn{RAo>2OA3orRPx`3VE922QAKIi9R^xIBU7>>Oaqg;UR<>TZ$F|FTJ zL7gu7>>^A8zC`ESu8Yk2+xlB(pudmz49w4@!RS^7S8FwTKx$3i3ZWtJoO^|}^G$wa z^z*Jv%Ob)kYL2PW z+k%Hw{M4*K0avC8vYv|6l^|v;2a3Ry4iJJai1=Yajp`f(2t{-rh2^P4)T}kdA;I2< zm-`qr5@Q8p6e|5V zmYp3AuSe%Q$(S>3IIOu zga8JmZ-m_>E|xB_y49k1?7P$(m7JV53wMFtZ$$#W?h|@Ide`zd zXBF*s-QuJ4#%zWZk7XpQ4k}p&b8ZQiGEe76o)%giIPt%#A&N6Ns3;8cWC_{3T?$M zg1FeIqEYJYmc}f`BbVl)UIzOlBWb{pqBVj|9Zy7kb`OReH2dV>W~pFZt|yoBLyjs$ z?T^-E@oMPF-E%`{7KJ?DmK!9w%3&@eubtSDT1?%uLuatGzn`xp1ZkGWs?(lL`DnFX ztJR^}*XZ-yqZCd((u`2l=svh;8=$(xoNO~1eM)0h{8PkpjJ5RCRmif2e@am_Y)l(A zG{-`qi2{FCTzzCoPK!4uRy|SHqT9}A1gui-qhC3=Rp@QqFGP1PPg@xD=!{MMY2qnj zIGys+Jrr(AOS?QV*Y%!T8}gtm;~lqC-3xDWI3~7m55Y>BH^BGHgxRmtEEt&%xe4g# z+2UeUw;YmQ(pqht(mdCjqgOe#DaC#&y#9Kak_f)TMIL~#fb=yh-g;qh?Ly(K^uN)M zR%>Oh5AK^0;KVUTLh>qO=DX$oL~xM7DTB{#N@1$#8~^@2577tULc`bYqfox&lA=~R z?sUsaYjuFIweAv-xQ(-Vb+RETU{yjljN$azhq}~}V!XG_m7Dg4MR&`Rq7}^=guU8_ zg<=!FZ+}xRs~IIozc-my|3-PJ{X?zILGR<@8;{8JI6cNgmMZ>X7RCJxzIC4POD&q$ z2mbsldTU{}>M1>u9%8gICpK{Bl(sPFhtTA5E`48>+o<=fTf_==re+%MFOIoq@1aUL z0~_@Mf|V*^E^O=_8|@zit4$eCwRm;s>Lp;&MvHxyGH-h}7|~ba9GXmLPW?2AFXRiA z4xHF_J9d^LgqsT_Ts78L=PCj^o3n=8B?kVN;v8o4A+Vf<@3m+I>FZ4P*H7KL6%faW z@A0EFQ_cE6?dh3H@PF!zH5v5TTUZkA&HeH0K>K^;Bw)53$nxCAc()b^Orq_v@NAHP z4b~mllK;*kukcuu;9eUV?KSd{tzeSygQ1J&JpX0H9X8lAF?(H6jMydST@wGIegY-q z+Nf=NHyxbkPNF_A8cysQkH;N-!+Tv(foFPp{M@is7CjX_dtcf0bxB&}+&ZyGvRq{D ztTDWMSb?Xp8t~T+ef=1N+Xg#FRZk4%%vGhXSuhBrwk?;B}i-ZSTz2(lx7 z(my)ADHGQpvTQm|7XsYfJ3FqVcdX7g99|kOSnh<{nt1=>`fMf&+f@8yO7b?+tuNtD z81y{5jXkR!CnbGl9`D4;ON{N55m{aaf4hrM{Ob<>dE<86ud7`!!ka^}yc*Z{H0>A= zQ=)Wr8}RSkQJMecME9Ry;s^ZLzx6toMYKboxmFij`hzGOag_37$3KYk=ZmNlyg#dF zd^PSGA(5rzv-Y9l$lj08vLG&DrLN82_Z1 zK&3Y>X0bu2q1P0$(cGIvEkkCWGq5(^1`Uxf2QmJUy@egT{W+on$vuO7!$LF!Nz}hj zs3(T5AB=;TjPtqvuPBD0v@b)jfI*6ZNvVoS%Z`b+fQ`O@u4{s>4~aflgl2t9YS)N* z)i^zpWH51C&W4Vyt?HS?h9KuWuE=h1S_{@$zRc+C8`9L7!#)#1jEUy5qH+@cSGF^ zW_}n|1FA$@$#QvjZ!=BC^9yDkw*#O_;)gq_uT4b1RSixT%<|ByZdFN<7DZf|Tt4n} zAr{Tp<{Ja%$S9jRChqL8@27#7_(rw3)G3sQP$cdP6tB>f64Jz72mqdDO7(jlb9O2j zOv`y2G)*;{*WbXu3)Cg$RGIWNmMOGLrVw{dgpME^okC=jGTKBC^E?JY`29I_%CIpE zb+Q_RCIz8w3U+og#dkH@A{U096dF1;f^>97ury<69Ah6Qv(W)%-QvHod&ljo0WuJC z8Hm&Y^L@M7rIDo{TDa z9P~=ujI^B3liYnSAo>SXPb{$EOmjdB0DaqLz5C%G`z!T&u$2j?b8`zEq~-n-{9bD1DjzVrcQ2)fe{7d7e=E67lUsth9*N-jZ@8+*eHNiZa6Kr_qKry zxu;8P^;$8M^*vJIbdyX?wxT$i-B@}WToj%~(=FrASxQg)bk9I648zRj3pCWwMepJ? z0^%2ubx{<>Kjxn8Jga1u-ndqd5-7_91R<+d%q64|xP%EA*1t?iBDCUiv~2tj2qHXe z8ro?$MNw8EYioN&$hwCqfVEZsfq<~*n){t(P(*n30UY-QLtnOK#fI*hKGt`s_e z7jP}RxE;qox#)JsJ`bx{Zl@k@>lI^bBs|*!EtFy{=dyO2yFbniTDGqqE@ilOte!U0 zTCQatP6CJsh=ptiY@8!5&sWxjpdzIIXpN@MJg>^LQR| zxtz6oE@|3Q^L!#6?y)>ZCV1Y5Pp+9fU!~T(hgaOZd3+o--D`OC67hVaHN895v@O?s z{hyo=c>Gjxe5UasawWPT3naI=E+49<4*BlS|4(+-K%@Mp}D+rbO{6i#@6QfF(S5|06330}#k z%rMpEz%RTK0G)7-)*yXe2`pd)d26s`rwHYG#8zsED=$B5R%DxcXdo}YfKHS?R#q`k= zT4yxMitkg4_|?g1tCLWM8F}$S=Lt--T#S6qqHS4E{FV|6$fo>}l|-!;ho(!BtCOq= ziXr5qt^uY9EXLF7QXHy6K}Bsrr0G zJop)P$;ppVbhC69Qe*Lfw)ok)>@M8xJ8HIrxcLE!mgA=hUu^eMQf}!R$+q?7S*(hq>2lztx}>{K^Qe;2qsk)V1K> zUBzh|`Ha=s57{(OP!Qy=&=8RS;WeKiG$1}8;~^sv;ZU(rF+PP&QVPQVBW#ir;80T# zax)P8-@GR1^FPVW$R)tb^#6m`l;R@&P+x-Ve}qk86KPUQ zMe0vv(^rSW+??OtnD@WJrj(X~w62DRyqu=4+<%2lX=7ytGwm-*In%GY|08Vb*g7fOI%~SxN;^4ddb-PddTE>eFJaTh%G<@+&gy@J zO*h2=idf1J$}h4uoKPiM0<GkKAp|B{(**u|8X{l|6gbGKgec${P;-5 z{LlRV@|w$&o&V)E@5W>9rqkZ$)An{7j@H{BS1O;jJ5G+;AJ6)yrl!W{7XE8%uCGn~ z-?rw#+QiNN%2`yr%Eto>=2v3N;MUvCc$e z(QqUh3Q68X*kme`ZoXA5@11c96@vFs&_Xc`G(3elyjaS3;&djP*_2;4Z9E1(wIzhy zeOSCSty0QoE{IYZ37w3LSEUeQFcg==>zH7*)}TL7=kL|D%-l}5^`zglDqQpiBG7PP0z<6`1sH`j+&Fm1W{Lu&kYU*nZ$3(4 z1=-fyb+w$#edmh8Wd=5(3_-*E(NSx95(|zXrnQ)nXuAp%Ad(n!G8qbk9S8;d5Y6K~ zJ)982Gn(z~dN`Sne$Q9#>wdaeXdx8Y4WeIy&DV?thrOsYy*@-uDwOKnnU2xc3j{#x zI>E{z(;7j0Z;jW3vtnNsGSPX(sG&c3&2(s05HK7Y8jY8X93FJ5p};n6cQ~u5_j?#e z(1_aglh+iy!voM&!wkZUX^6oYxc)s^{OWU+4u=s4!>waNF=;_!)_momE0=Flu4}<& zp0S;h9A6HZ(o&?AD_W;H32g_xu~%XZ6OE_l&@HvPeQK3vR4^R@?-A%<8&l;Lk=Kd#~8Y)Ncyf_TqWTTM+ z=&fRcA_+bUI+%F^T@wodmTMVVitnWmKsEw~2*YZ-bW!9uvs)(@y7g*P;xLKVT-CKI z8x@72Zq0&=`~C*`+1F|;290WY)@df8$Dp-o3S%F=ZXta(U>0F9w(;$-Sli);(o}AJ zw_)H;U1Et;#yaZbePd`}VzgZOAVwY-pLo;yA0b=bPn3Y2!6<;tj%y+NWvBV|s_5NO zY_cVvjU3%(emZIBOsGG#COVgb#&jt>RTA_mNJD^&{Xs@zW9Iy_Mc;~%W9tZUPFR1? z^|4{lqBRU1!zhM+8HB7lx?DE?7#XCA9tCO4Z1-NWs`kgYY^wn2P4_7x;2mlY$Xhk& zZMXK53%S_aL%8EHBzhh8<@#sGulZz0-MonBo7~(#3VHp|QtL&@mxSi!g(A*+785;^(ts9MFlWG}4%MJS`ue%a z;It6V8%9vDT1Fti6<*WvY0IpQI3A}>`^ zl@1y(Ibx_9okK|SQ{gN#dD4$6NCqzlz!?ZV)U757QU^1F0Zawv=Djc^mQppPP*Ir8 zdt91L80qcKh}%!gjV|;$s=PzY)Cg3f#VxNa<(TM zK|fgLsYd4GWjs?+{=Ue9W%>7$oqdl=+%U^&CVQ>b1jnP3zqf07K_qTL zh*Gnnl-o5V{zEj7`eH8ZB1;BV6aF@2-1eDDiSu1ZX}cmK9Xwdl;)Y zc)FEMxz7V0B3N(m=AJj|gF+s-eYZ{eW7+uQ?4}Ts$~a6y;zXRVd)^W`PXbMvcTDMV z2oLrPH1YicS}1P_^|$zv>Jd3PjM6G<3^92v%oW@ob9avVI%R>r^DTZvN}ob%=14ws zE!L6NZ^`umyF&-KJ+)Bk^&pchh}{Mo@7l#AY40W9RglsCj8#V5V7tI6*C>8Nlya*W z(z`G>E{&`>$mu(F_q+%z_xurwTi%(U_TzGP!QZgcK(Gg-tgY8@>Z({7^UujI3Q1(y z`e`Mws8!oq%K?e&Zel{hhVxME~?U~y+R!vK)fGQ_;4jKe$YRm`zUgw@)d(F9l zfBiMAIs^6Y`xoJspW1raVG7(C&Y0r;;C*$BN9lhHVLZ+}qUxeK>$iTSa>4OAUve$g zb}RSvk*M&gIT3bgmsY~_^>}dm?6?-*18BJf8?^vbX=z|m9eRUlGm3l@Mtn04eGSH; z$Dc`(OsN5xW{h5bxzZlw02`|g(vvk)e^EGlIF}Vmb=+~A5efR1C4X!Hz{k_pufkf< zSdPjhVBuNJFBn=|%KnQfJ3wqeS_J`bgDdeue!~)UdFt+w0DbWoHKnq|kf+`(A1$yhbmVacE{N%#N?E>q$`Iy_ELb~C2x zx}Y*QGpiFOhiACvGId?Dl<}jru@(NEl>PSwC@PEyqzRw=XYYpRxbh+{fev9y=tyx| z71t=0LyO3;2;pZcUw<78?M9fp6RE&;f}6!);H_&U9nD`CNN6X~80wKTXRCXRw3ZliX-uj#uzZCeVMr?@g$h z*VWogsI^FlI#Wt_j{tf>D~}xV8x$m_F+NKnkfky3xFljeN?3n5!XA7YaS;`?<`w@S zNxTIgvIFn)O9v?A6s#ql@LMNAA3e^9?hDC!&`LS6kxcZPRkWd{S$7+q<{~?cwnwcC z71Frc>9dmtuCsh+k{*IUqd6Y}MlvBsa)E@GY#1~U->U=oODP$Y zzy!4X0Duz$z@mcB&;^lzK!iD;0^EaQ%?7d~SXxV_7ItvuZDg;9ro!mRI8GQpSy@g( zvIS8&ik}7TTBYsF+R5Vw8nWdcpQb&Ssnm?eg~Af&n!{*0rDw~U|NVnb$t9*x$*wzT zL-7#ET1ZbTktdWGAa;XLQN@Jqe6B$j*Ot^aWx% z&^dTOxdkn$tS&&rXAsrPq~T_zDNLr-kw+Oz7z=k;;cg~ijOF4V=4v72jZ|Qent9I9 z11ZzL+w#$KkO8s>{dr~Kypurv5%M&_kXBvj5Si+8Pv2!@zJJB{u=^&cvf{ib6HW;M zsTfQ_w+Io`L`fNq)I(M)dv=jys841!M$DZ1^$S^_sr#I#kaG7zI+ z@aT)bdDa#KN26`2%l!&M75TeKts%aP$TK)a##M)Xm!7hbjnPBKNM@tUryUV%1$qUD z!Yxrip@~9h`jq*%$y1M)-ESZ-C!t>Mq248--3_3gL7nw}@|M^=a?yRddRFHtB`7OnEwI zV`RA1lr8FEUy!aonX8UL4EU7kyg?0@OZ{*{HUhtWyF*8N8$kQ`j|OUC9#f#?RTqz6 zn6d%o7z3Po5vlbSx_$KFkt-#4uD=}Q^X2zJxACPRsEkM@2Idq=$)V##RVqRhfB58L zW<(+WAzEc`gm0=Er;-i}0U{tJQ{iTUWkU-hoPJi(GY*oXJe!JED_XsN=Xz@*S4X!& z@KfT&%rph{YVoV%P%`D_BSN(7K>`F-YRBbKE|Xeb2U>KJ(XP?!CeW2%y)D)lj35xR zWqe6~y|pP%XV1T6tJe@{<~E#82*Ju0>(%6bC2R;7qjD*aL_u_aEU~YkZ3sqeST3sY zB~XJCV0X(68>_PZH<1{P)Ra?HQan-u3!V&Rm-ZLWNx~UVii$1O6iAjMi&gnu^8G-P z3zJegqG=bh#lH<&mn`e(ch}uOOR+$A*%tEitCZDd0eGW(J0|Y9D9+VJ+v8k%DOOpJ zqV0kLy`eMwHHKPOP3H2gVjwqu(@GXI$HGdD%+iTsxTEZ?kA92Zdmc}c%`3|^rXi;P%(wsIqS&>{sf(d27@d-H!9(5W$2o#0 zpNdPrsNvLR?MD!f=?B`Jd_gZ+E8I-h#uRp)!nf4Ba@0$2fNalZF@C8kcdY8*M(7~^ zHbHv#paT}o#mgWy!H~jG5Jq>~UoZuMOFP$?KJfLiRqolsCzWk{Py`xU>?;R*+QQ_D zIvs+(+CaxJ+E&%hMTcW>H7Vx^9KQ3~yNO&*zyBp2nX|Zxpge;F9{XVEC(-c3r|Y~* zku3@O-Ip=HhulPP3_O4~w~0J1S_gMokkJ8Q*ISpNiW#fxicU0`B1i{^NZsx`n4?Y| z7}r2VRQwdm8{;?8pR025F;JpvwOz|)A|R78Bg~tbvtLb=!sgZv??Y>gr$Lu)$2DphztZxL${F? zjDP%?nn8O@LK9V>SV5#?29rT%bd1^0P&qK+&vs^4EM&VN1#uwERs<8YC$o3k&IU8( zkoM+SahUv=4m@_Xx;$P=P-HzjFMN~KHZzUyfV29CjB$%S|9#LR4RWd=XE^WBS}4v5 zb4yPU@yE{xQwb({_CKAi)B(BJHBvD#1jL!~w#_642I{@jT6y`tRg@!sNDOtg(>X0k zSE$zz786cmZyQ1{`;}OK7NB=$J6EddirVd)(Px%P<4UgHdL}Ht2xj~-_}-nVy2Rj7TlSk z&m%_&TGkY199d3_ufXqN%zL1C?%~{F&!(=)`k^yh}jNGxc$LXl&NvO*ZD9iK6 zv%N^|PUVumnE(7SkuC@B!pn4@DA%&lk=QqvbH_g`FJuhFYWjo}h;;;XBgj!SA-mbm}5Wj{rT{xl=Nr(=XGDVYj^=DC?lj- zq;7ru@Yd>gMI)rSJ+eDHvri-FD)~Yzlm{1~zhlFI5)yH1Wn6?`e+(e?G$Qo|A+;F~ zL|Kz=AQPk|$9)spv(u8Uh~F!|k`6yuT8r+X2kz&M4TfybQV~@F10cPYd4}(1EwYNp z0tVf#sR3G+2H?6JhW-PrTN9WbbasaM@yczUI6kD@2C3E6oee#vg(DBKwPH!K!{KTy z&ZF<@M_svj6O)Z!RHl`%xav;jf1;bdr~G9*4P3 z+(+Mi4)>)z0A811R2Nt)4geP1ne0}rCK?U-@0OXXZrz{$Mi( z;BTR-MuQcFAv7cEE2yQcuWNR;V#FqU7p}>-=b(C^(+NVe8E$6ICM{8>JaTU`PYEE; zZi<)BV0Cx+g0ML2*BoMR%k$6sl<5-%*1e*4mjTp7BK16ecjR{$Ev_WaLl{M!o2u(|eYG5n*vbO+WWFE<+<*QZ`_N96d_4M0qqB@0LKeU&voY{YRabOA{fKPH9cgTW-*pI{W&o7oDuj0d zf0Hz{%Kv(2t@;zAKw1(*LKaBWZovNiHRQ&22*^PGkF;!t*l1~U{6zKX%o zJpre@NT0C~WUbg!4ZaY)P6LPgF+!=jLd@|D*!ersQIppRJ-ja(Nf*!qx6WL41ZxG! z#39f*412TKDP>Zq6tG#$*XQ?#sTHZjztSa7V#O(V!P`NKNuyJ_-M^6QE*{CH(L897 zhm=r8;6kI|hC!B$D&;YMy*$!&g+(EO4@dkx7z+C{hs$7lWPbTfy;3#TW}c0$3Z+)Z z)$aGE=J*m{76PN$lJN zIUI*jdi!MvdLo&U)uY-(LaA0D#({-kmBVsgpxIO@#|^O38-+w_xUJW8gyh)e)&+L2 zLBi|Q&7xBra)*rz9t?fw%%Zd!iUk%7X#O*287k&OM#KoAGS5$@Z>t!|AMZ{g0-53p z$}W6(KO!xCdDu|nW48ZU;0-@Aude>|HbGW3N<+_xwSucX3L()i@=mxEu9OI%e& zPDLr;@fm^&L+%o`YRP5^IAbCJ7x$$u;)AIU@us?Yf?l-L~n6FyZbH%mf z$!caoVmBIR)D&1Cx6c*W>JF;uo@UeHw>#i}WAfKmwkT7*0i~*XZb}KGdWDwWAB;r_ zfivXYbh2Pb$#L8 zqQBbLZD<)BcAIt>`orJ?fB=r5^?|r6_Hpd0gD769-YV9GIe|jem=#z-@}l zvda9A%;(OfryaAqdS$))7V)*_p}Cfx7W{4L zmQ72M#qrf#B)X4PA8m&00Z)`Zgj{J%hb!lgzc04IhY2FM1_n?HzF#&{RmYNk<9)q~ zfz!n?g177WyEd&;ay}RV=+BN^+UtW%z}3ZLxf7{gbSRwYA& zKaL_05qc!}B_&%Jiw;b21-ktr!bL8=GrXGi68kX9kLvHDRE6=YM7X2@>T=K{*O@2R zvDg$!O1%vcq}t@18QT<%n4P*}4H_F9`qJ_S?jJ)E(OVGRAj|+g>M;MZ7rw+^rg9Wa zCPB+3xL~NKaovO}*|!IUSbfk~1zGbWBrnmk2vls*fy6Udj=nQqD$Yo2r=sZ0<-g3( zHm79_U#VgiLZVcnAxtqhBw(g}flLv9A5y7c;&N;xDhT|%K9iY*T|}FoyF;EPj|`s>U6>d_jRR%PQLmuzhQ^u=Sf{OJGy@thSyuJYVKA_42M^4 zj%nm~^!?7zF)uLSz!bsntq}KR7DEqlg8q?`R_ebs`&U+6`sS833`V1*fMJ?9qK`e8 zv@5|(b4cXwbb(CpslbHqVTlyBLjMbS_3J$STpQ~14+ZL5OJzbKaDW}$qoSg%5Q4s< z>0GKB!YNv)&Q$1iMn|Narg-pH5HUuFM3Wt!cRNKGh;J}sx@>DZ?;Eyw_17SDR>1`Pwi@9hQnUHyh7=*D(f3Vjjb^O6Dcwo9$bHM&phmA)Jtg~ls|gC$ zoq1IrgPG*^XgjJTtXZ*gjP~V0=jc!78wDsYXbJVyJkmxi zHgd{@iBtBQ(u1SYWf0?WE*>ToGnzpv&+O)!`ma(g&8qLD1u5mfLq6yJ zdXYFb9UGhKqaN)In_mQ;w`;Q5sk&CCLaG10reP;|=)+vK;*lh?0ognvEzk|xCPgo4 zRtaO&{T#j7D}Mc(WgOw`J4?bH+=G>Y8gk8xRLML-OS0;$(oRuB_K;n{Ppp!V-BpU~ zSWvl1CPUpbznJl^pk__JpHMgaM$xknpYq;(X1*)vR#Oipc+@lM$icR};hpN`nRldMS0)b)yuLsf+Zl*TikgAtp1MU~6N?Z58z@8A#blUV+z zexA+T(B$)BFN8hF&QeZ;ki-f9>qGE`hv&@mz<0gg5FX6J?aK15R<{Wj>e_uI7cBVR z!X^?PE80%i)gg0b$z8*7*1SegYAi5q6a&fqqJ^AFfaX!(D$ASmPRVdrYGK6p9#Kq>dJ& z|54+84gn#gG&`Kr$0#&_Bj^W=w}=}Rh!<)GYRv{vDf+acN%jh3(jZe7Z1E{Dh}R!* zCtezxDR4_(sW6$uwjbiK)1tPLk#Lzh&h|6ZUoixkDx)88XtMb=?gxt5A9(3fSwRQ`Qxv`2aWu2@&?>SpTCy<8bkKZsp}Y5W^^;Try~EWld>jJ8 zC@SB9pWz(nZs(TRoTwO&_eK>({$SG)EaX_3I7xjIC|zeUF-n=mP*GM}?uw~kWyyYV zNl8^AsWUpM6Gn6}nZ~H^bck#XO!pK8vkR1tUvLLjk8+C?=Y*7jph*A2=#Pbh09&AM za9%56ZWlh`F;JT2QJkgsM?zsa-@%W6p-fp2qJ}MnBNU~VS$DvPOpqW_@FTKoOE6yEl;%E2 zji0F0ro;;hJ=7(oDNL3)ZGxqEqKPp|x~5;YC;Y3P;@C1EDXg$BMj%zOv-dqzN=I(y zgHZT|9cLK6nVyidNba~ex7isrN>;jfz0)F%vJhFmif9U7w0BwnWa}m|iyl(uCSP6} z=CmB!2f+fK%o^^NL~%V&ayOUBk&u1hqvENKmDy~FWKy77EFE?tsYdwhf0l{0Qs|6?Jkr0qgS^0kI2?EZ&*7$`^q&%y2u)cR++5M7gvv6o5PJ&F;oPmY zQ8T9U6)?*dycCh`w9;|enJy8hQ;JRlD1f0U)gm?0B|*|8Rnk}m$aw03X+cg6Q_fkb z(wuS7vAGhRk%(RqqAk^nE}eic1=BF?5Hh_tGj+x4;~WT300d~$AE+idz0+*S25#_% zcJ&5#^@erLhCAI;NFa$mu#@Uj#pP%*M4eEY^jDj7A4Me~)a0TiTg_)IL;t(f*v!;k zt4-cG!2g;^QBd7Y7o|$9qEVlVsL@!?rxUXgVpd%N*qw1s8{|^IC;*n#x~=mdBTX~W zd8ZyNPtRb;(LmPZ{Mi3e2qv-;b1@g(*qOKFO9m5CY(ghlX!KG3fDNvVYB*MFT*v4LBHjY&lsQIPSq z#fvP~1j^0P4~MlBHQbDb(4D@-f!w^<77a&otV0={id40l5JD=agDISGRl2Xv?h>AeT){aSb>TS>TAlA^nmO2y?M z8)NjI>!aIYU{uN`*bp;7Q2+9D?6dN_x%Ee0i~gETmT73gJx!-26oh_t(_>tp1?b7A^}DUFyZXKXM2>)X!J zqw)zbuNx%^9H{$cV-|(V-lV$z+EKSLW|HO3(EQAEp_e_j$rAz)AVn45@!Ua{;Ot4a zs}Ld76=w~`V_J2p(MZ-B_*hC73rp^v5@xPV=9x}TjZdZ#^LXK=U6>iB;s4=WLKS=J4-f94P!IHa4og7D3Pg1(|F8Crx!V}%w{0di<gk#&gTvKkH|}P~#lRg^>ad<_XAN3|#$26oOaB!#3%a1|tBy|3 zWmyK;>dNS>477nB$miNF&$A)xtY}@`I%}<%729rWOm=Iz1|RXM>))BERa+eN091)a zWq*sV3dmsvpa8<=#pT`TY|sXHg;)6|+c~}0CC0AEmh2MXD;X#cEwmTS&f>)D6UxzB z(6*_SXbBK4?GS}IWZSF_LXF${Y5W!HRY+W@l*%Z*%g-9t=Kk4oxe_eGg$UJT+l^KN z<{30*$EkeC;bws1E@T<(ISXzod}eMYEmoZEZYZS+>dt|*7K^oR>nlBrvr!ix_sxZ- zk#`C2^vJ$^GgDNCu^WaMsvUqfCG3&lJ4sO2d7W20ZETVtDgQK>JA$L^B)IJ6$ZXAK zR4`OcNF~G2rc_IH@c!^T2^Xs7xeV4`V+<$iGU#yVNopNmY7(vu6UT*KX!H}0YZWIm zr7~I8m9_r!MT`W!`^n}V&%&TL=Dxk01KGztQc~cxf!_7g76Kgh{~D`zG@;SKImd<%zQFNo#XAha5M* zYdBXjO!H#Cg|Gdjbw2dNR0pLXSL+ehf~U@R zTPfBa=<$G`(LNN?!2s{18ba&4>|mUnV6R&C22hg11Cw|J1YOBTNQqDT4pdACVkQ&= zvf^te@NDN|{PW4y9PMv6?QlOcaz`E34r+AIa6xxmq_$@aO^-V+S$a3r+8x?`{`ekW zwx)U_@!?8qg%M28bWK0%>s%5u9x#dZcvAOc)eFvm;(*Zzk=uD{&~(dLe>UW#OL8+K}>?AkJ)p`=o?f-+`OIn}gws~$+KeM{$i_evD<6nCo zN;Ysqt$uVmsEg#fuK=#X`>c?a5SR53Y1M$gYC7~o3|W}NPx-sjzU^!Lz+UeWsIDVO zI6Alk%8xvfy8JT92#81ypf55lo>Li-i&= zQmklEVi`GCzlcA-+h7p~3`&1;&yc%YXqwgcBxQoS0JT z!=^4@!nA4kuF|DV_jXOG0c-`og7-GPyZ`er;>3rMCbg?~@6*11CswFz`Eq568m@Bg z?D?~2Cr+M_F74!Mju|Z~Kw$7dM2R3rkkF}Z8xI~ox_9&L-8;`fBtnJ{PXfAg>Ey?k zGY6d{^^4UNWCWp|$2a!uzpD^@aS%d!KJ0}PZ^00Cs7mDXC8UE~*B3+gu$ zO*YM>6=Z^8u+{{D38n!D_~F&xPMytY6H|mq_+ojKd8iqE^)Z(Okx2-l-&{fz$=PV6 zWnmgl&&jY_Yp}^i8y&c5x212u3I7+wkvS;Y+!Cje=@}DgGVz3(ZMvCeXV1+LT?Hag zM;n)U@|H&xMBw0ELK4{r!v;N`cj!VHZPXs49Kkn|2o}9H=v4X9Ws`r35qJe-52Cmu zNF=y@4rke(cvG}@?0 z@RbqXc|1N_->olUnyF$);s5xlWM6qWX-g*ich!RsM&>d?XR+$)t3AKU;mfwlb*Zr? z!i3^hDuM;9u)`MJ1G32`8`;QJKRaH@FvWRvwOuc%uan$9;cX6d59V^v+v}p+ zTWtgdfddZKl8Nu#$pyGK-~F-)XTSruQ1HPCD=gfU4=WV$cpGd$@kJIpuIR>%zW1mI z4FKC>Tg*z8b$_3E+G}4fSJt76B-51>V>D-Vb7d9!Jp1giYMvPeZ;>1`e+}9=|IiNq!bIf_Vb0~lLW<=XQo zIh4V69GVqoK$f7X?59`}8J?Tl02T9yk{n(VfIjzP{1_Ph?#0M|z#El4Z zt6L6?W4-I`D^BV|4*UW%zcoftiaf}lbnZk4gaI%+0wIV&5VE-XH12T=WT4|{p)C4!I=d&v`C1rFZvSEqVSyFpiO>(q6+u9|GxIOMJeOax}j7FGO<=YapT7(ji)ed;l zjUv#c%y&IP5qYvr5YUPPux3H3e^5juL?H@Nc;d2`RRw%i5sO%4w!ZegFMjbm-}%DV zy_fZbC+;f?S!A{o?e*_|=bPUIZ`Qw@?L=k=JmCCNxWX3BY$^uK3RXzC!xN6Mhb6pW z5C5kk!y!H~ia%W8P*jU_lEF-ZUckE~GNGo7;o2uF659+eWQMk79d2897vbv2YRM`o zaEF|{TjC`rElsLw52N40pa?7ILi)ZFn#rVWd~Qe%w|3_n$xW2HM6$|=^ic3FqwF-B|XyNxDB$aaZZEeVrk4-!qKIN>PYiZacV zG2zXYzBHyYt?5m3y3?Lkb0kfbJgeOqsnr?Qd*I+J=b6e*>Gh9>BhE(T6CJ2a6K zt%F7Ly0|Dy43q;z>8pIY*v39KvXiasW!sksg02~8w*u3JauUj|iyo^k~dXsl(PSv*RuAdDFYz$EL%{Zn84v+OT@TeggE6l)r~) zTiXljWe$9OLz|F0*NIMek{z^ecDI{v?{f28#=FzYjniG$uT*4I@;5&_O+v(#mdd7!b^p9q-p(G zB70WXy-paRgS}|9My^M52oVjiz3_%VJmQZX(`Og=MhzEk-Rmq;-Mv8Xd;hrslKZ~s z-{BBxgEv&-LofQ#lb*^1JKGiKS9tpH~isGXIJwOA>O|~{`3FoJ2Y|Dx@CCz*}(as-;TAPv&fjaMV{5X zU;J6$_3d6-=$`~mAO)tGXEhO~+{N()paQmD^BLd)LdE-4pZOIW{E;BRQIbT+mi<+r z3%(!>&O#@|6kZ@7ktv|$#a>h}V2dda*Huj|y&ZmVg;!u-Ma3WzCja66&EU`sUvTjf zVOWhw0pausVFOwU^#$PPy%t!spb~x|7>*u`u|yUIpo8LnZIxldkb1w>$9BZi_VW}Fa^VHQda)<_MtY@+)VU#~HT(W#6Itx&3rqAlK{ zvJrtPTHy&IiPfD6M_r<$EeCGt*=ik2XtB@);36|NBc~z3E;3OA`eNJxqtUhERX|#> z3Dce-BQ1i3Glru$wiz8nV;iE>D)L+|7072C#@^sob7&>?2IEn z_G6XZ!5$J~^Ms!|{#r1424Y0n*vX?X)gwLLLQvczYk6Wsq>A?WBSvOqeK|rQW+Ddm z+Y&4!Xe{K|L777eMO8s$7X-+Sxx_anmPW>;KQbXCdSpt0B(S|>VjKra7GqKYMLnjZ zP_ASawB)L}mPKBqOfF@GrI=Gb<%uO;)YYU-l1gU)2$YfCa%>b!RopcF#7TywQA}h$ za$(N&9#p2KTCOEqwxwIXC0xekTW%O#(q)OA0$%2&UhXAd_T?#*7+oS>)Y&9Kq6t<8 z8)9H1jpgJv3dkCblf{wc&45yc$fadorYzKDUEZZ%cK@blekN#!rf7~PX_lsGo+fIZ z0w$~`Yqq9qz9wwOCTnKc;l&wYIuA(dL}TjYo+&1wUBPY!r?5GQOGbrRrbTKdr*itG zY&NHJJ|}cWr*uvybylZ!UMF^D=X0I{fgRp$j)>N*qi}ADHRa21jwfO!CRR{nMN(!1 zXeWHer+m&Qeb%Ra-Y0(2CwC&=cjAgn(b{;bXDgm3dRm-TmdfiGr|CQlLgc4|J}87n zsDw@^g*xYc9-i>^XL#n4ZtmuRnkQoxXch=)&m|~Qn$BfZsEV#Ai?*nXs_2CpUWRJu ze=cTYerR(LsECrMxOHMawkK@8sE`gRkrt_uzW-*779RNZXC#3}ngFLU9!0)r%8rhx zDv6Fv%*7||SOpxZmwqXjhADm0=Hc-llQ!vbJSj)nnz&u1J65TcvMGXQsg_2@Nnl1r zh^e0L>4WB_C0GKVvZiSQ=7uGnXHjJ)Zm42TDU?=eN0sMQNRob}U|dN=3ychW>g6SD zDyLooCTzkf9D;qG!X|*~YF@%}rYfnHDywFKtGenTWWpgBf*}-wAav@cVgjj-Dyib? zC76OK9D=ZxDzE};smkgh6oMfP!W|Gv8ju7fM5|v-E48jdv_h*KWF}p@W$4l5nWE{U zl8F_-X;I2)3Z00444fYpoUh_4CI~{TX8!`HCaWOSYZ@@js=bv6z(!XE0THCr9t5nw z4y?c$P9Fq^9gr1S6@mXWED{h&abVNeFiDw=jm5H$8A+_hYHXa$KoJ>?jHyhosJh zx@KF5I0PAx!5BR4(}KYlOzjsm2oVs$@ntQNJcY}gjrY(2!PbG;5^TUGjF%J@UCBUO zy@bZX1k9qzn-p!7z%1R`OTe&(0z5!${7=bZM>`dS0Wri2v=tB3?Z!621ktR`E^d2V z4t%h}3-at~eJf#(iTjLeaH>gjB>w@r3LMTo#0<=Z3XCr4mhR|2O>uq&c<5AhRDo^0 zu5Hu-!RkpLEDRo{?b^1j+rBK^#;r9OF5N~+TMY~ZyoL-EK^o9e-~NXG0IotbMCbyq z#>(uY6cXcJuSZN!D!|~XH6i6z?zOa{6*MZ}nCs?tZo0OW`mSxYn6CS(!1%Et*RqD4 z;J^@I3GBk|*p_XcoGlLEZs-=S#O^Nd_O9Gsh4dCM{-}lly+#li!5l5G-!jafum(fG zzzhg*0w;kJOb`TNF9_r8_P*d}eJ|w_2et$)HWCS)dSpzzujvxOCAx%bRmKQV$G_%p z{_d~Ya)%K7FJ0xX?gp=uLjNiPZ*Vq6NooiT1VDfs^??L;3F3GM|3I$>CouKGhxLLm z_ByV5z#tKruoxqW5U6mz6iEv!*G%9943};hF9+0=jd$b}4z#Wg@31y*(OdEWAGINZwEih2Xis@KFTN5C1!3iC!bhd&cck2 zu_)Jz87~Jmr7?K!ZfCSH>9W8KKLwSDOAg=h>&k8(_pj~pvD*6a5WnpT4{{1$)9?z; zF)gzBAP(^g3?w6Q7L$a=STYwQ5+&%Ws#dc#eqFn?DY!IT z$F*F~HC@-WNyD@XT*EYcwMKI^Jix<82lhy}17XvHVbgxf~c5H)maVNKOFE?(B_5?jMZ(s6A{I-4yH*;S% zc87FqXE%3uw|AqoZc}n}NAq-3w|oZocc-^)AGdn9w|f(}bBp(QcX4@}cc#|Ed*?S~ z$M$UNw}1b4U59t|&Nm3xw|!^lDd0DNFZfF1^))a!ghzNu$2WXbGJ)G{v>y0O1D>xqZ(iX*r^%s7MN^&Rjy zkaIVQ+yD5DUvDMkICh@Gjt9Aa<8>G?Ig}@Njgtgv7kRa+CX!pHl1F)dovp-<*bF z`ldg6nSXjdg}SKcIjR#krYl0MYkH@fIIB;qt3&6g*ZO+#m_aStH7yuJclbh#_PJquO`QfJY0W#jH|qaTRgp& zyycucCZxQ}v-HRR_{}po$;*7kpS&yVyi0%lwF~`!Tl~WNynE1m&>MY&kGs?Rx3*ur z(r*mSV?xtMJxYK47r43Bt2feDy}dL2*Khr}_j%c;_taOp*t5sgze3vI^|&v3+D(Kl8u7^8-Y^ ze**~?G#(`4ebRp_ony40#l3Ql$gGTy#oN%~GjTsa9=h@Bd_0N;SE5 z_4*a&P_bjlmJM3eYFf2Qn?7|KW^G)#a~+P%Y7!Gzy?gn#H2W8D;Gbye7B+maty_y< z4mWl@73B1Dl(vZc$>?6@ROF$eAF8>&9RERyG9PygGBGRnc-->GE^!L-NYpNwQL!)b z36m-*)m)R!Cet~lpd7W@lFn7U^zsxmal2%<{l4%`&!yZ+htNU|JrvPI6(zKpX42WE zAW?=RX}~%!ytB(Z13m4M^30oVQ>D^rl+K zI=*>TE9EJ;r4LR%`2&@^V;Mo0Yo;n@GTo~2=!bBA`qVSW9Zow-5cqjv0S>T4==g{} z(CDU@x=HD$j1;>esGmL)OOxP5K>(~37C-U~5 zy5*)@fDcl>Tc*6{3p?n!X2Le57u=cs~g9|7TE(65s$8 z)u>1L&Lx(RANDFyKl|MeIpO$k!AT1*ayI9wZ++}*)e~5=EOUi0 zdkNSf5AEbb@C0#oH}PBM&Llo1{)>r{nc^xcfr1Vo00A99K?A8c6DwX3iyXlT=6Ity z@%ihE0ka`Zob|YJw9$KS%nT6YSdcl^E`M*zBmc3IAeoWv<&S_2q#y%B$U+VTC)nCg z^OEO|MKV%Hd}&1_B{@k-a^{j6!AbedbG}Y~a#)R=lU`bZ4s?|AC8wlMD#y1!B3fi$ z=!2!OWOZpP3+D zLS&l1tO(7#m`!bFsVm+DCoIMplX98`73X{iPR8UQra8}@?=*=Mk%^Cg_=BGHwC6p^ zl23h7@FsjJ(*FXgs%^H0Ca^H*Kky+=g*ua=LUHIrR~S(`j;1vEt7xh&x@`er&a=pW`t>tKIUSi?RwoeuKf z-e4$0BwE#5kX2O}Q6$!Zh@ui9qXZkv3Rr_^mb0DxENEGXvC55#R4dJE16@mytQ?by zwmnEaHk(_Xcy_l0$w@z*0)P`-|F&eh2)qH9Qg zZm}W&IKXwKQ#tMuvl$DSnq-^l&Ht;USG_o4Z+kJx&y!9B0RNb;bh?PP`?e|x`Bg}O zklQ-t{x`ro88CsTdtenLSi$sFfgK(EU~Q&jAzA6Kc^v}a3~#u-I*Dq039{f3PgT1n zwy2d7LLq{7@4^vrae%);-~zAmDIgw*jpKSWuIl(0N#HR;diTCI23aFRR&SAwtP}oO zM9E9Ot}C17NhqHx2@O8TCq$&IN~&|Dh9VQY6e`4kp^neC9MOq!3niAeK84 z=iG*a&UPkKo|jyN!1)xGcqOJn{2|^!zu6;(<}9MStdm721OX^U8>GLOjwekzA>k!z z@d*79^kz6Grzl6Fbpl@mC;ucLEfBTX7HMiJL0BRCofYI-Jt0l2Ro1l5$$=S7kX-Lg ziN3xotNx4->{uAnM|m}@mtziPAMzrMKESvo&;n@xRN8796*1LZkTwgAyxB$ybGhB^ zZ{K9bw;l)p@_PUekeJs`BUGE-w2N9Cd>6aW=9J?kXlVIYEx4`sDZJfjw^n!GCkVhl z@(}<~ottCnR=2?qUh-NfT(zi@GL=p8uwqX|;@l<-hrK+b1Y1`H2SD)wNYLb(ZI@Ld zm(rt5Ui6b6Bjw$dutE0w;|sl@OGeH6{*Xd>i;oTG;a=IB>{|9Y)?*=qclkNvj4qR3E}UK+HMtE)O$H`k1kJs ziGlzi-~`rmvZ@Borcsgn@0mY4tIk`JwZo?HX{qAGZ&UT0*jh2!ZQ7~CPS;~#KJ&5P zJlYLXWjXLD^l7oj=w)7dx$DHkW((W~{T_ScBfM3wDhQh~nxfpRg%-Srb$Cn8v`PZ`h z^amJB7H=os3Z-!D>kh6Nwy*vc(B!@kRl)_lR*gIOFD?=a@rXj+oQfyD46fdf0YA{_ z9MD*pjwC*>EC1pRIQ(HHE-(Ohizlv5F}&_&jsXN~5cyaI0tdn_*v|KUBl>y>@mlb+ zUQnGVV$W9325V3RkaSFwhSOCoThViYKV+g7${{l92wEP+$lmGEDHVst`5& zZwh6O3?J$WQO_;dscE*53y;rZ2%>kKE}qg5HGc36r;pC+Y$tYQKUD8!;4ltj57h>O z&BSo8@Gv!`a1Yh553exzoWh8Xh7b!8@PJMHZm%z(@H5Qt5dkm~c_QD+1aO)L6BqCS zEs7v2%?`(KLG&;b)hn8$i6;oKOnB;OQnCIHac9KP6H&tvXVJN8v5Cqf4K zB_F!c_`dNNc&reRD;RS_1$!h2N0ISFORnTm_J-w5?4b~70tIbE7FVzz@9p$_t7+m< zApedY&x9Nf@~?UjMuw3gC(a*tViK_{AScr7hDBUpF-)ehBW3O*fp4P9j3i4^Sai^= z%F#a-awYlDAv38+u#aEdAtpo6BvmpW(}N>(5)yZkeBAG7fHEi>kRboT5sNZCR1zsg zQ7J8^9Y3ySoboAeuvPNG9?*{})#Dsx!y~gY8=qnuw)ngw)Dk&{) zC;!&cDc;d7;SwwZk6&;SEm<-vF`*q*;0QJ5Edi4r!>?M7vM_a0FL#0spF;BZ1^yg! zSaR@Jta38*vie+dW}0R*;gVRsa9hsOlth#LK+>N~6EJH*RcMo?_(dGRffit)6)b93wy zE7vo$Ht9Y8^R&S3UjlSkRC8})F2kA%KYJoEh2d9%>%N{KFmZ5mBs9P%)CGUyGXI@o zG4%w>lAuF5uW~?Cy+m{feC`xf@hSbE0)B%%JN$agiHSj08Q}}X4?}Up=Y0r6h6xN_?G;1ypkHjax zbfq}dNKqw!vNOZX^fmXg9o>*bfC@=DPRB^j0poN@LyAr-lnD2uMsK957PL=S)JoAt zP6KREN7N^XX00a~D3<>FlFF`Eo-3G>HYp9x;i6is=f9TvhJxD{XVwFTI9D*ClmPRlT2UeHn>@a%^r4+(m8Id=i8VkkbR4OKFhMU&@I)r-^O^*|LPGXaQU zNtS2zRW4Fi`&w4r5(SSqlvS4Qc4pSOYSv&qjW_mlWO-I<6UJxNVmXgN+A4O2N~Ks- z)H!ujc9b?9E6!$dqC`i`SPNodrVn3MQC>p}>MK7=trdgD-d}lqP=YH+shxfB#)q$C7S;AELAj<$8}~ z;x^cYUl@j6I0_<|hHKb{Zy1MjScfGzhI`nDEqEx{P<}yJd`;(mks^PIR8^vZfuDg2 zrXUI~c!sGUh8*~bX_$g5_=mTci+^~AcesXIxQk&pizm2-t+mnzj0^dN%lL~U7>yZNjiZ5$4cLtluMhn& zC=LvY>bQQfX9ki&j~^@vRK*|$SZnPCfU9xVK9(mhVu&%BaIr@LIGKd^I91eEYYD|( z*caKz_I>5mA`U=tSlN!V2W&l}lke-3*ENN;7LRY_bN{QcZz0zwl5viKnP(RW0+2XY zb%#_6h}tNxmJwxJnmHYxnR~kzM4*U{sd;f0Xqg*=daHNuwz;l`j#W%J{=QkOszq$u zcYA+SDDF&te_5TeMuY_5nnU89RYjiXd9frdHSzgS^m%p#Y5hj^3PB`z2Kr|Tnr_;8 zA!^|{6QyMZh(Wswq9Zz2oK^jh_ZWquR40N2Tv?;DhNBI-BZSsXNIHq2CJ9bDSdcbQ zR2l$T`WjstbI_S_W?Fb^+N0H$;1=a#Kj{fVy0K8JS|<99YBz|6f>>2Rew4bVO$S0D zf=P6`q=zZOR+esGHkM;HRIu8Lv|5G4LX+lLrvKGBtW9T=`4_nK*P<5m5)n=WS9nC= z+K1$Ng2bYHkovA!Ij@bFBm8=a_U-}e4_%vDLQtVcCs{1`r=~Iav4bbFCA*&EusI#& zS2P>evQ$g|xh=vPghM-fMw_&2Q}Z@Yo{^NWkHi(YEmEP`Cx|2j9y@hq`>QvC)Lz$w zr7ds&=M|onv$?t{7#p^O*|_EBpd%u=H}{xPWw-a{8=!kQCv`V`S+-mGy0d4mBcjjz zy1S#MkPZ*lXd$|d+N+Hlz0*5&l7J)N*_c7Okir|*3U-$}Ea$G-^kp~S&K#Or$~=)oN@ykRxmemR`9O&G){8Ol$iS$KTK ze>}*C{2w3y$=6xQ83(8#qQmtUv!k5MKf@-Ee9KLy%dzLl`LwnHyv*ZVNVHtRmwL?= z=Of-6{N$X^Z3NBl9MA<|y=hy|W4F%_-9P9&(AS*7A0o`pw{sC)(#PY^7hTCe;?Z9> z(kGqMokP(rUB8c*BQkw>JKfYN9n>}a%h_AcQDv-89oBQ>(^Flx+ngX;9aY9W)^}Yk z(t*|yJS1=(zImP4Pvh5(d(dyX$^SpR*qi+^THx42Th|T3!Cx1`ogLc`qtc_jptBp( zN&DKfUEJql*10`<6u{OCg4F+emdD-Q)nePtJ$TaHAi$m3-yPqnqTJ;@Zs@(Lf&cT|_(=>`G>z95!;T?yXdks=@V{nr&>+81Ko&#dAfUgHU3Va+|^r{dzF%+NQU z9)(X{wrL*T zaUJM|Ug=?;=s!E-ksIlkUg}|9<{#VW<09lu?B=JQ>p89#ur*t^)!-GtTfGvM+bEEIw>F)#I@Ihnnv#Ib8 zpYgRl?;9WT8^gbaYwIK5@@t;7)Bf@|zrjgc;W;1l5n|;N_wz&F^q+^cPha&RKJ{1M z_48b^UtjhK{d`M*_ATG@Z(sLyKJ$0q_v@9kNB;M3fAr7H_J=?4TOaw6U-_5+_ly6* z;@XNC{sZ^_4y^2+&Q>a`KX8j5_tk|(+OLje5u&mm(Y}>k3iZ*V{w{+{;y^Ggk zT(ooZ`uz(yu+^=5p*Bk=II-fzjB64utgzW(cljDyzKl6D#>a(&z4@1~vgXmGOKbia zRB}4XqCw}w*5sVD((aBu)0?>~UMHNbO4 zPwTG$fVw(>4*&o>x^H^{cyND3c7HJ39{>*z4i|4?1X#lnz{Pn2c<=-V_X*Bj4}cW_z`^?;@o@eV{=b6r0QVst zKEb^h#P<)>J-!zo7x!LhynBi7TmA0a0S}+xQ9OI`8lO`069Jnu)yu&6oJZ_$syeB) z#*rK%pIw3oiD+o)=ovVST>A!RH@(T)!ic6|%YU}D78k?HCx_f&2`UeJw zCMKt*XJ+T-;cJNXjm@p?o!vdu$?4ho#U=Xc`afJa0Nnot>%RVf#C1OiI1m1t1A_l> z;XLs85BQUZc+XzoQ@qwB_~cB<_A>Ah)tmU7s!l?75iKP3XP0pz8V=DlPSk(U{s-Cr zJ77WozmWZ(!2T~>Z~zG|&i&-!J^=s$NFdzjA^=^EJY6TNDlkQN_r4Upjy|?$uA7Wj zZjCcK_bU`2&(hh(^rx9X;AWDMpX1iaY50XnDj^W?Oof=#Ik}~jUp4h@9mcU`0~HqO z@vZNde_yN>c#Zs%d;*8#0uVu5WQF;JIPe&`x&tt%=CNU)+!|G$l7kl{5DX{S7bs1Z zQ1l%jMrtPPB>CI}vwjCyt8R6<1MquR_BP3huRu{n7ythF5U|#o{qwg0Man;IH6~>= zM)~#p_0%j1#J~%5*GLW8lAv&zL;fCEt?5!@OWQ2w^;hTQP(LfLxHBSWLp4T)JXM{n zb~ZJCI*e~q@^7dKiZea#$`dwA{TQp1Z(h8xM*bQ0bLVUVKn&hdK zB1F(BgBU(DAuY&(GJ_`AYK*nPF~pY_LAS|}Qt0yUgkeGF^fT~SAZ;5}l(|1*SW0>D z6+3q1N{7qaYeUAe!#q&X+FR4xt|p=;sbdv4|f09 z6kjKGL3`|JltRPKCOZM&&|M2F<&q{`3%DAG_9Q9nfmMjed$~SK@`tcc- zJ#iFWuR3{sC&&j-AJ#rk6mlI zin)1>F`9VjQHlch*z?7HmJo7TZt8uzE7g*w>OMK4498G;t z4q}9(msxI$v87FnVOjrG@<+b!nww@?#c-dbRj_@k>Y{j961!|D zX{XDpdXoj#k8Ynl%vnzlJG4gOuUvT5p>u5!OPc2yhacw^@?zd-Q@jO6KX&Q=1J>3) z+`_v@S(~nW4O% zm>({^?;cuG|1K_%hfSp{j%~3}qQg)(X4CD=)~w`WH$FGV%vK}CU{iFeY0C1XaG4)uwY%-~SCLzPpp|x{Q`CKe7WZb{5r(Fak(Y+FoUXkUK@2SxF z4a+_Q22V$hafpyn%u`W{1`}*(W|GW2Hyd9m;i7w2n<}9_>dSkh0hw;T0|a1jQTqLl zcL&#m!&x|_!a$_9-_goWi!82>VVbX|%*LS|Gry{L)qb_+3}l?*nhz?iC#WPBC8< zB&fR?+BbN1hKh!}N6bv{XQg^j)CLTwJWKxe{pv)SY>vvzhGln}7MH!#+Y&?R(~~VT zCFcJaEz;S{q@T_l+*@eFkl8gfdN9T|IG6Gb)F@& zZ~xTA&TvM!HQBvAPD=L86`+?g&Eu~&-`I#%w>aw%;C3^J_j%(+`SVeHv<(q$t+YkX;U{z{_`!RRtzg=mg6U(sHqTWG)9x&5usUSvRG((;=%rz;z|2jjB(>xGAmYhVJ;4AqG{faPX`J<)8p zCh6?83k#grZm?w#`{5wq0WQ2&9U3NWgUn|$3N@Ed>n3j46bOOLlzg8#HCpLHC5 zsGB2Pt+Ab7pA;0}%>D`#`1Y?h)~~*ZD?&_zOxuRPH7nt&{>M7KhRq9o$7=ta12742 zH5*u0+52Q=irk_D{svQT%%F^}!+s>Q}z(hMI#qEjwe#JLSybn^fsl~>?uN+}8+u6cXnsNhZU zc>fewRd-u19hg? zmGVPQjDI{4x4h|&8*0DA>7}Q!SB4Tqe4kBJ$BJ8ye17?Nl8~!(+`3Xw{`7b7g)1s9 zxPlf03S!W!%YBEF@gc>@GWv3~8#>Xv4L1F6>fvG0>yyh% zN^Wl9fBG+-xlb!BwIA2+7=-}Sy0CNU1*OQS)#Z4^SV&5*7%4%Yky&Z(LCjah#(L<8 zl2xL!#bPcyGr0}VsgLnsmMDdb^*4H?@I~3Z0r-ZlSyzseHAdV40%4T$be=Wq(9m;1 z;yxBx?7tgG)S6nJ4(k!F@N|+3ZIz|>GIwP@z6fbDCK#r+()*{upe4e-I4kw?6SB(w1-t&XiSK_7#Kv)Glo6S8=5`EpvU*U55Gtfa zs?v^UfEgeHm`7+`q>U-<8aNt(3JX7PdpY^OrUAJfk{d+F7E2vi(3E79qsV6xKDEJ| z8^G@++4itOb`nto8C!mdZbPtAVP2uYk%#S_tBfyJd;Zzw%@^;*=O{HaCcGr!!Fl+6 zKS(A$((TGYkN&2a2^84MjO^O(f|0rllkZ_gq7WRAr|)F7b3va(tl{nn{8Y_B3LW1* z13jXjj!MUCI6R&$E)*!p1Z$tuVhN!)5Z`CWJHP>K9XQ9h?jKz#ON{X2yVQ>BHshT> z+y7}Vre<7l`fynG-Mz=1brUQ8!#grrk78;lpT3JGN-nJD4uCX)&RJf7rTsfVfk0we za|DzOZLS*BH**K*l79HRi!C6IOFS7@rPiLanWDdfFh}&fDbFOADsFUaf%3ws84X2! zKGknQ8TUJW5{<;|Zvnn=Y?ZGI6Vr|r32Tkxs=19hXMMad==|IF-NbQ{rF;2O3!y*0 zECXcbgP^2`)Cl-OZ9!_X&Yx!9IB9^`)vDLUdo9FGsqkZ~Oxh*%&sP3JTW8yKV>LI6 z+XcUn$o09{>9Q{$HxhYFu)WJ{aOT!epPZlvhV{ym>9aqDDKb~8#d9c={V9ygeqI@t z8OP0(+euDEWVzpPgN-GQF&5VJz_YDIZ0#YJgdXW!ng3UEPI-S8L-+Mt(rTcQNh0T{ z#A2lXe9B@GD>BRAY+amGcktQGJDwv^$lo+GUuTOw;6LNj-1rOHxOzFX!N2iRahP&V+l$lz3M0UQZ~Lm{6P2 z$mCCui{qrlsW;;%S@Dye{sHv6?T#7b}zXkh1r=%c?0mCk=2SXW>aK{!u z5F@e>^W^v<8ATp0Ea=XkMeus!SL-M1qCI_5j?@>H&r&3>2$&v&G{Fs@Wj)tqh43@i zh?4n+c!&4~dF3YUFk12~TM50RnMTo+6K2Z)?g01kTMV!U7NS^@g97$4j73%?Ii$=< z*4BMH5-dy=&1zg{ zhC=>5R^8t_RbQAd>K|DM?imJhpH>c>X7i4n!ZWX8`P?nG;Hp?Pg?*%yxN&M{iD)k4 z#lFKM?<_*l{FA*V2+9lRABs1{3-YQ`(msQmL=%w0QojS&;?2&bk2X^fn*1 zTwTK7)=7SSvYm1H0SbYbqxI`T*D&g8d31Z4uumr`zqzup=edRuAJ$K(RRgCx2nGB<;^r>O2ieqe|ow?qtSGc&a zrpjH|BlFm7Mv5xxe96~+FSJs{_bxHy1Fi46K03J?cX{#$f^LY9ip1)-x9a9UW<#S(W6-hfrw)GKvx#-pDXmC$M_G^H@0}j7k)2nE zh@W$+6j)f@0a&q5_ZX&9t}7B9s$bufW+=t{{uKLsIF`t(VX7TQLXlQt><-J~xCoeBVEW!7N z{9@T!lxc8PX2JLUtJpD!8fZ4+)=%^wkeo`+>8HUUYWwW_y0= zh=f*6T`Zb|_S@K{WkWYMI9@03NIlwAS#`qQYGJfS`BOJbh`LpYDvz>MB}R5!DWgTL zp(*8j;Yb9BA`Vp=%5M7hLaJpfOkVI0o2l}f=2%{WK`C4-jIDnecaEU-H_cY$Oi{FW z^^CSTH#YSo*4&{XZNY-yB~_%%)oP{GKRSeO5?KmyF-Jm{-XC&ryLb>Ph`DGe>nK9`qykuRautXKd=38Z;#z zG+ZqnW9cFNE4AExQggntXtBzr4l3HV^o4vkaRqXlE`5#eSD zIXfQH%c_3o4qsVYgcAMXWt(!D&SDvroT+-hg zrOG@mZ6&Qx{m^9P39ah5rKXFY!eq{MZ28eezgm>Rf3JO3@54s_3p4bSl1_v=W7n+r zOpSvpetxA%TJ}pN!nYFjkiGHP&C*w{nOXjJ{_TFc=*6|Jb( z#|&xLCXP;;zCRf-7UZZfNZd~x@%{2iMbSk#eIEL&sIgt&UjCkB`;I%MYqm*Pr?RMH zIZJia0Y)&nE~M-G#28&?gHihkGT3U&8^T(D+=V?=`=Gk10s0(SRKxjLo&Rf3P>9yr zbuuhH_YN?q3)4ncQtZ20Chab)2HoGt8Y4y#^i)2!9o;SRglRVDNg00wu=xOBGca(W z(u=^W?zD(P&xM{u)7$h}{p>aQy{4|XF{Tgeq#=J}_~pLtjefX%u_$_TQf(?_p|D40 zOURW*k@Y=Ht!cJZHT?j~ub0No**e$S(f@~TR|S+5XXCKD%#E5!Ls+>x670cKvWgbs zmXEGr+1oqn5X135?$U+rlUxW{WSBzcou#EEEC;?K9?Z;5*=oF*U`b=xOuSDvq z)ntBTC9lTwXrWCGIIK5!f4WU$QJ$4KCaU;NhV8^KYGp%t^*9d5=u7Zm8IIvcUPjhh z=f{8aKM3daWY7M%f%!$n`2%p+0f@yBE3o+SWq#U&@G~bpS8}eD;!RZzXtR8_*tzqo z&Y!(XjwV*UT8Pbpu-0tkxxE^~Bi4O|1x?Vo&yrQV7sCfP7)szQ%XqBvL=y0Ltr491 z&^+=&(w470<;&Ecx+&WsT9Xqfe@e5}aqnluNP#z8%v#32(8fLg`0{5w%LmG=#TcOzgoKMti7x&+Utd4;z5bhG#(9dF zP`*VQ^6*Mor5_xYPu`~FHBmbl(bsX72)?#o^GPtnvcAX+OnJiu-8Gc1HljBj(r+~J z6gsba_xa!I&%VQk;lSW_kSxhIFhtDkpGz^nqBjJ#WmCv?$hcCiZ`tCDa~pz{!n|v) zN0}8P8_eYC8aR*BPuyy@sT*VG}FeGqOZtYSzO36~H##cXqGdn&s8_lf*) zXd{R|ecfC@mzF`;XJ;kn0@z{7e<6&v5MZG6rEWluR^h;fWL4}hB1}&QPr)*vb{bfk z>k;?5$yQ>qJ|nNFsUplMfmU2ec0a%wgfOzz}ypti0fW?&^3XE_NLSyglz^%Jxrj)A~w?DDa5pf z@W+DU7s@};i5G)^JQBv%R)UU%7bIi%kUw+fZ(eagBr6?aU-Lt*zbTezXO^8y3RC(T zpy$`C_4QCjyLx}0+q-qJ58MGfDL{orXS|HY556dTK$2Q!xb5w;_;C)=sdz$Yvs^Ji4H3JrP2LM1s=4_gSmQ;mh zc@a7He@!!GfFg}!dY^5R0qtItO?!UoNs$K z*reFN(VR7R zX5)9!>+|xvrl+e>Qy3`wHeXZ13TImESJa>)9Or2X)V|!{_EDcq{-kVHZ8DC7 z!kDSTrRXX{8O}<*(a?@gu2d0hQQ(=%`>+Yol3=k-|BK8=(LEV1vJUvUwOE*=5&Atz zpPzc(dsZj*%rAZKMYMAx(&o*3No+TDgb zfL%jNXXQeXZ)c^2U^&(sCZ5$kML{RR zk5wz$hxq7K(&|~5kfXm3{nx-0!{!jFr3-edx7SQ4y?U1D7DvQ>gizvJbe1{Zbe=Ei zy+5_3%X)NPSh7Q-kdKUwL!_o0uf>Iv6;dgaQ}=uoS2&l2;FpLbm}@ru-80g^(Ct(= zR~4@=UWizQiyRu=XneLC^SVuf0DN)KrG*Mb7){h+TeP6ljvKmmDfGSfBIS2XDQfI- ztJ0{XC8Gct0pUFpe%esbmN0v~c!Q-|^)}ohHMg0%q_j=8I+I^O18+oqAE1E+#)HVo z4(ZQ-WPVSZ5U0&$BfdV|-i^dsBFMxM%TLQWV|oX z1WPf_-!IlDn!(}|at0hfT7I6JUriV>C?go=aW|PyUst+$Zy$hBO%P(trwI3`O5wM& z^>7=DpCJ)7H%xY{{>wd~n~_kaAJ~F|nIjMin8dp4y{K-S#txX7`h=u^pje*dR1{e_&MV zspWno_M-|V7v6h^ZOP72a?$i=CSxt-VHlNzuQdWnv!~_h`c@)dZXt7cM^cJ+K@wDgGRkmj)a@i3RD|I3uFE{|qj>bcyX z_kJQHeh>2TYb_I!e%8a=Gkm1t%p#39NC(0XU)(zaCFzm>@*ghei7YGg)72&=Of$t( z2}v~l9`pZOkT5r58$t{IB+=js3dTl}Fy5ymSe=3U+GNFbjcJwl$((al9C;7#01o9F zD{AaqaA`+;j3g?qhd1}%;oqX7oV?i4&%a!uX~Ayiy>CSXSTxPFI`SnN6zH376 z^AV)R?KfIlk%#%%qIbQmpWX>B{8~>R>GR;_^dn=v=d*-+;$oX=;@vIRZo(^D1s2XS zoS!8};{{sHIb(qEP2s)= zz-V!(k=tAnXO_KaTk3k!rD+nB{XN5&nM$4xso%9i+t9NTjg|T5&TQ!=4GI%w$HtMw zbbMP#D0yUNEQ#AxwwQNjjHj&CJZ=R>E8Ga)uj^I6%+NPlQ?=#N>dFR9g%h#IX-|T5wFdm)D@o{)*qyO5fh^a}E z!|kVk9nhWdd3-sQ?=4j`mYE^9efBZzuvZT9_~gF{&;9a;9;8ApRa*Rq!mk;Zale={M}zc;P2jZ&M|;d#KvtzOO-lIKw} z2Gli7N}4Q?pZmszVfFb+E{-}{Fr;#yKZ*3%!!b6u2k=*28O3T}j2#fx(h@z;T4LzI zG2iDEKaD=~BZ7xBu34giswGCu_Df+sz{hoUV-W&dt;S-E_6wKR+1+KsBP=v_q0(Gsm2f0W@^iRoDR?S&8qFOg=_Rlg`pjPP z1T%gE4o&73_+7_)Oz-NOeeWoUAoOEf@!V?A$~~zx-ECE$k%>E+5%{pDm7(2;RE}IU zYo6+hgsBVA0|=bPrS%(-LRJ>Z^y&C)y~*IZngtqINkHE{$p6nf^CX|MioAz)!F!a( zPht%kYGf#$X(JssRN|*6yMYy}pbcXc7W48A5;fMhLxC7EAk<|KV?iUzBcj4V_YSZ* zZ~TS->~%+_D|t}YCs+t;R-Nc(5zwIqg1yTHzZ{zuS&U~r+?%w;1*rIFYK33MTUND;5F``wXVufZ_ zl(ovxG-zJrl>_BaYIYNm&Q0-o<$|@d$S6j(GPIOmKQEWwtF#oDzKCh|VjF54O+vH{ zE|uD4Wz8adKS7gl;x6J~cYqQYug3Nc(IFS-b0R=ho}qYgnc*(aONXQNV8CkD0d4U9 zh<#XaX?Td(j3zizq!MTmmU+YFhlkq6KC)dOpgA_YO@&AqE)4RnutXu4WpNXSc^Wmc z=e1{Ge|CDcb05h^2zOvV_G})x7iy7zTS53zqi(Q-H#c?|3KU)sm;(FIGwefMI6bT3 z#F}(SS-5|=?5FzmB}I=er@C@~h0$zUYTA;2r~y%XVr`fo(K3}pM`f0|&00YmH?E5% z@0jTv_1G!B zwESuHGYd@Th2QI76aypfMN12RM^(Om;UQQ|pM@*h^t#Pgt{wx-JRNlx5Q3nCadG9J zQ3>m(#mNSPR#tK5NQ=-wt8n;-Sj5{6^=@&$QxjdPjWf~6`hKbPv3byHYD^u??6K%g z49$u1ia@$a&XWu&j=qixmE&F=o2j6>*v8K#lSX@=7O;O|1Q>cRiSWZSQiUD~tHYPQ z#iQ*Su6>#hLeD!#tPi=h-Yma91($BCbHg=I6JKmDj0LXe_Q$CN;`xlaU} z_IT`Hq?AFJjr=oIO7SBF$rPN+x8g&O?f~spnrcqm6CbA>1s85?rd|b@k2Tqcog5oB z?%}FOD)I)aW*kaxW@&Hc>hyjESJ}S;QTN1F(GBqQI_d8!*fuK4WTh_TqU@Y1qs1}~ z-^f@zpmV4I55_GDIU5WsXjs}Z-2o!8bZFzAo<%EdrBuc$BIB41=<8jrf|(#aANFww z9<~cuPtao=F4)SCoY_(re{VPCu6g14>RbR5e@1o8brjzw%V|_ub#B>3j%M3DgmWJE zLnFp}x=bgm+v&gicK;iBdLP#XMEb@W)q7JRAIFwm*Q}8r7~Z_ZP+eiDk{=z;o*3?fJ9%-y-$;cbpNBwDYXX@fzE6;cTEG{hc(b_q>KaY5^ zBH#^Sni#6i9G34Z6DMMtmi~5i<&_%Kzvl86Sl6REzVNpY!OGw(jl6A5nSn1}_aZ+= z+CAp{&9pAa?=p7=(BDG?AMt5-O_isA7UZP4`dIlj6;jxN@O`z_+Z9Tb5;Naqd&y9} zW7NuEw4a)yv^+g9FE@6Sd?L+Og$FajG>~^UE%Os;T zr|R-;bFuLB0d*glNPoU(@nF9HQ2(DM^Zaw#qMcXVVk-HC&P#PwYCYFkhlQbzb|2dk zBpqeznj(yepX=c%kfCK~_3-lzRGp&JqZ>?Fiw7gV%grwsERWS)-i$sEUUVJcma}a+ z$h>{?0}tQ zISI4r-!A>N&t(t<_dB}e7@4YsJ?zA(Rx^JyDXVhB>9GR=9pU5thUKR|v*!hr#QM}6 z6$w~t8R0ZE^#r8gYcg#wc?5&`Fk)DH&6sd0$y$6?O>hJG(up&PY1|2+hrU07g`j3x^3~ajgE>4N50}msi}E+B=lS9QB;0 zaC4=Iu>Sn&PK9!3YWikMi~d}z#uppTfZh`ic<#(*qf9ln>2L1< z_I0=|q|oQgSDHrB%~oFS&pnG|R7{!5U}WWHOJ&d6jBS6wcuoc^&Ia}mgYbl{uG5-b zR7aR;J7FP4tfB4;KpJ$jX4#UV+Rd%RhhXtbT)Fzp;7F|`BZ}|ZO*_zf{XSC(1bL`{ zKsy754mlcZU07ie+Sl!N)ZrqL?c~Q-#8X(TG4t<=ZM`2WUEeCfV5E}Y*lCr(MF)&y zP4?)^W^gU@BRk8nN(tgXT)IP;QATTMM6mx51{EY$aV86={TTYQ7RsO4* z_ZxN0w|7Fmgvf6v#Jnqx7ZoM#?}_(%+R0b(h{UHEC%b2}$K|1D#e2R; zD^S-R7z?BR@=d7x7Wzv$guS^oZft|c$+37EBy2na)%9h)je&iI1-<4*l6M_SGycj^ zKi}}TN^856_qr_j9lxZJEbXnxQp}{uVaxEgq~v)?Zh%}#Ob8L6g9`75otfwUD^@B0 zPL-$k8)=c)hc;#pf;Afwdo-^YQd0A;0zhoaTr+N9M28?a4V@J;l=EYlJiH`FYwttL z%)VOgfh1oxpHz>{WN?z{RQfz?hDIexDE+$C1_3_z8#)NV1Pm&c+HLC#-GHhUO$R{<)`PL=z8KePs{9Z=-7AL+B?jvFtW@Hf4-ROw5CC>5L;*1uAgC1E^EQ9A;^_sBzoa-OX7kV7VKO4RFE%N ze(NSx8Sxt2UBaxu(`4EcXL1L~=09v@Prm~gZdPJiEJx7+83S70H^Un)*-R*!+%?k{8nLB!GdMzfn9Q+tdE8_!hz24rPG zEAfW$m4X@n5l{OZ)7h?Yt?b_|7OoE_ci7wImFrhW0-@fZ1-%Z>n)n}2Z znXGansj}B>$k_gL;=q>$`W3|;ZufC&xTH6y59>ZSb{X`AOZvn=83I=BHe)wbfB%hB zDd`i7j|yB%4OTwZTHMzpTl4PYj+skheTFdFH47EElvl0HD9=Ikx2g&d+r%CSrViQK zcJcO@*!3MhbKfMlwB*Q`<{H)cn9$9h=^}kI>tgevd2ZXfu;{~6Tv42T=%1DD5q*T^ zq44ir2IWXcQKhO-+ub@rIh_$EtMAlWi@bJ+OH-Dyw#Tiag{@AP~1dO_KR zW^m4V1B|hnl^ed~09?nMu58MD*cRaBye&h(mLB;^GQc}Fi#MPzRxV%l0r@fu%m~-@ zFXTC-A6jGCPetMT4*fdMbW!*Tc%kcQmdK*4C&#U;(oUbJw-{|}Tq;E5ev^^j916<5 zyzoai34T8Sr52!LNl|;r9YSCf1^Y%RWIi58BI3YSsM9*l{1TRvK`K*D}I3 zGq^$JUr|PR)^uF%?N88*Zt0rDUUtfviy`vUX3N4kW+RO4A~T}A5J6iB>8w;Z2X-on zT=a_&LsMp%PWkAF@fd}tyTA*}`_#b}n}|&4d-7dFRjr3`BmOLjF5o=vMK$`iSn#-8 z_4dkEy&Q;deL+e zQrW96(o;X2j{zg+r>T|LXUb5_2kf)#ICp?2=@_Dd2l)ht&yQ1^cOmuXKy?i`-geiE zG9&RCWKGY9{TVA_6{|dDF9&JN0OUeWQLA5xJe86bbhAXKA|>SUA);CHgI|>t-JS;?@eMY+_$p9 zzx5W9KHLQXBAXT6%`Ho;8DdHXA_ShTrEq`H2~d8M=f{8DUe3f~uAHD5^G?lJ%%`v} zt|Lc4gQl=~@hcSJtAD??Q{Be3Ghu|#Aa@jaZOGIh&pW2ogF(_B3D}4k0P)94ZiazZ#IpTc_%DBB*!A5JpQC{Tk%7;T;He zqo|sw=JO+u^x1w`I4j+`4Ec8~?!U7YlAVUxUA*?>0%P8r16tpc$EH<343ICIJ82vIr;N-oUZX#l^3#mbXe!wBmb5BU+`9`)y@ z@FO)-VE2(QXOo@NB6C%NcY2M^x(vQ-w#%BNzIo_g1zm zn-`TDZjOxmE-T|zv{yYqA;WK=)_$zS+Kry6ef~4kjQ2whp@!pcQ{NQ@0VQ_QkY9T< zMY+_|=klm~zYPNEX_rScBBZcFzM3s{4ef0cq~-NtIHw%-B&&(+w@Y($UEAf5?T$>^ zxPj7E2XPf0n<0KP<9(mY9f)DCiCXB0b(s*0aJ{p%FvwJl9@|^q> z+JIjV0*C-_N_;*%@Y1{kI5|%QEa9@*KMf3$8uQkB<)z$DJ{NVNb^AL9h-{F@x0259 zc*71eenHw5yr{x5Gd3%xZ#Cq`tAma|x$JR7KXdFVD%;LjwT%5bSzs;k+5$lb8K>aI zK4DwyZ=lXh%KnQePM!4boxAErRAMMkFN)E;BxB{6=czgqhm>yVm7!zs&vVi>Pp@WU zo2Y5hCAUK=RhDO!Y1cxkY9`-HsByLi=`E4$3=JQ=X3}vLVN|O+r-{4wli2-fFp6!c zuwH0PrDeggN$a{Aa)bV7iWGce=(*&WqF9T1cEa$QPZO)YFY#>v%mO%n)c2^B8d)&2 zcfq1mUO`@O(u75Q#nZV1G~-E7jShKwi(;vKj1(!9s`6|~e&OlT0erNps{hFrp&A@n zl86ROqxzZUcIeuqKj8dln*jGGR!RTP53*0&Id4ylfnE2$H^_pHaoxb z`|;?${SED7d6cp0A1Q{PsDs2n91@P^ZKEh&!GZf}PyOh;^^YM8D9Zkio2dxq5^b~N zOdsF4LC;xUPZOiwH}VIU=f|gVi5DGcT?8lwRudMEW%5*o6S~{KxsUs6^bWgn;yINz z;{f*fFfDZzR&v(wXoZXT|1{PHTElv9Ezj@S(m!q^-7zCr&QVnpU0(Y_wLG(i^lwLC zEMP;I1R0~&(JnTQ5wTsDGw<>a$&UAN`Dd_4`>jAUThX-lwJbDg`|0O^mjQ!(09of# z7ppzMw+42)KDiwunLzXR)90o%=k9{6TG6B{ft+46<>~$q!A%@}#h$pFUo>Cp*f@=tG$q$U58i0+O3y}!2~+rzqrrJ- zsfzOY7!6`YiD+FXRTnL`2V>c1AiDkW-Db0#qMaXRw)zv#Z8HY5aBEc9DMk{!E$MgoOG0r8LdyAS zi;ISgYh%3|%hWxUsJY-q9HV0wpKtRpA~zbIK6)s}?{3B!wxkj|wsa0c_;`c551V6u zxkw{g#HGsO)QNBgs7Q~y}(klhC7U(}MbjFd4T(QAhi!?^>7Y|vUTUk?FO0NWisn1t}p%iCv5m=T} z61eG{*CFC_!5$^HnoaquNn8b~x0JjknCq|gy7k^}%R=*BtUy1GnrH`zRNLBm=Nj00 z>x%YTC&fhw2c4}jc{&_g{+YI?K+L@L>$b(|pK>8@6uUJK?EBEa_AKJ}F@4_b7$&aM zS<-v%{o9>sy(H5#*Pd)jBrMwP_#lqP(|b(2_EZm416~lQI@V6MFMBi~M{cwKT-Nep zw4c8oevSuTzr<$voQIcTvxsXASWmZwKAbcpMD zn2Cs({;juQ$jDZ6io<@p|0xJ5jYwYJw7ee zaHTr;2Pca!MrU4M28>DwL4sgEvW1dL2UTSwuib&a*_8@w^nAz8c3fL#p-CG|FGC*& zo66LPmt8U}DEJo2pH-xhT|P9Y^or;_Qg&AAX{`4vy|cStDCycM6d z`t;WUo~QP+K+{$KHt?T&;*qI!US0oo=Y9R% zy9;LTKUZ>mQ8g_qCz2EG@-4#|g&A6!=3QT`eVAmO<%o17*jq0Bcx7 z?f@1ra!=zfEOBGxNw?lq1y|_N$pV&(OZP39w}5q@U8Y?JmmO-9Z4{qUsZd?Oj%!T# zs4F8z*QcdEA3nZh-11G0Y5KY{~^1IIP%R>m7)Pu5qB(H!wsPu}gxefbN$5d(Nz{C`uWu=PV`_c4Nf zX}({Ae))^9gXB@3Y09S+@7;m+!KGxV1Pm#U`ee@=wOkNNdELD%wV88XoK~w-uJ)i< z*3wpJhW%tc-=AsfS0#^}9ej2WI=)-mw4Q$l5DJ~#muEqlf*diN&1!o35S zvNN%M+czo6vIDk}>Mz@lsTTI;id14q5sW^$j^+<+`0(}oq}}70SbiSKho$et@uZrcpB8;~yexS%Q&A>1C}0N%x2y zi>>t|+%4Fd0DBz)^H|CO`JSz2WFtHc!X_E1rRoMxn7wYhq0{fy?j6r!sIpf#temNZbOnrJnx+pRcyXP> z!hIleZiqfCRiUy{XXC#$0>UVHHUjv%|G(Ao)nQHjZ~sG3kZ=-8GZ7F3>8_2C77$R7 zHs}uN7$F^_Q9v4L5E%lBOb{5|-7vaGj8Ws+=kxp4^Zi}VwLi|aYiH*==e+Oxb-(X; zy#mP&U{QR$e3yz#<&2vS97hh>ds7wyV8KQ&!q7b~rzK4FD4HM3#ksSD+MgC*icep> z284V1%Kd^FNBjNkQ#a>b4t^Ot{o5k8o@b$sJzXr)EB)L1z1^9-qtkZnNhc&m;VS3S z0Cgl5w>&db$>I2=d2IQRV_0L!w30SqC0oupbAi61XcwiYsk1Sdt!F^S@7TwXsGZjH zN$ohs+|s9DwK@b!1bz@Wm@N!jTKFR?%2y>&?d9q!pt@T?YyetA4x4CofV3G2W)uK3WS_AF;&w0YCp|f@Tk- z#cJD@+j)WQqUcRNJ{a&Z{Z=B;A5dP)+bL+c>Y;&Wel`E(&)kTA7U&$-U3#=^XZ&pr zp}4<4m5JeTj>sVYcIozO*k3QeQ&+o2t>Dj!VLd(Rie=}Dbzb#+gT|lBM@kV%9in=f zX8OrGfd`kq9p!7ZGo#kB(&Jl#G3=!}ohWpJQ z>#QU<-?c9vc;V(B*zHS1F;U1svAUZtmS>O|wqmxvP9<$5X~Y6ZNj$Wa98q;q!mzCx6B6iEZq2 z;?@0D=(MvjmH_?ze9F1k_r-M75t(?8lNJHHmomiLbNiKo|IchNBh{vMnlY#VL5}0x z08uwd-f7I6>*z(7rg6BaQ%SImX+O8O7?JgxGi8<)4Erx^SK)2a6R>82sp}gwFmWOw zQ!`7}$o)IlfY<&?2cup$CF@2Xp7A*v*Qz{N$K43jn>C2}?1D4Q(ZReb;hZ+N^%X|& z_6bgDS{qPEgUb=6N1UOE#Uv@s`ZmVQ{YVg1#>Jnz>RoR~&P z{>B<8goAb4Upl2ftq-iYU@~CQ`a;P~Q>n8zzrY^gda%6|5rj8zUkKSHZ)+=(v&Gf++E<@@(-4iGKTmE94)RFCDnAE}-wOEuZ32bfBm<&ufilse<$g0pNZ+r%})mk@hhnbFKsJEc+uvm^uUk@ueWC)@`3 zI!FPWo>J>08Jk1S1u`~085pn2iBhYO{{Yy(krl0tx?gAQh}t!J%;+D!i|~p)`i(O& z;P`ZugdH%tiiFrNQ2H~VWms6yH?pL+;b$D&d|71~v6}XpGw$`oQ7itn zlUI@l=J9Z6W~?WW(#E|2$qf?}w`iMORlNpCGL4tcp1|$aCMD?yR-gS<;jA2{>V%)A+`90aE7d}V7OyvmQ;>!@{Yd+rOi z!EqX8YkX24zG~NsGaU(-`Q}7%TsM)VqO`aW9Y~MsC@B3#X}hk6jd)@VIy+8fNh`OZecu< z^qb!e$Pd{4K5M+R@^ASh#$p)3&N81uat_1LTz##Bg#TD!xrJ6bYpCO5g{S#I#;a{U z=A79;!eBZreJ?Bq6p5qME+qE?W3bNcM%vMEzW{gTMm63lHu4W1dUL8f0p(5+C3b{~ z8UL};|5|tOYkZQ^2K{4Md`W$QbPsGPb-@=1!m<>`WhJc6c4fvci6MK2c?ej|rfb_p@rVrc%JZmIR5BX19%x zx{B~rdm7;Z-Yh7ApR!vWk+Q?BQk5e!?Z2}QIfL6Odjk(k7c7$Qr>w6 zT4Q0DFW6wTpXpC@drl1BlifY*H_lY*Tk3=fy#yUvYN*(^wKb^Gw!XfpY$zH$HL=W6 zA)tM3|2n6nM6w9|ad0|;KAQZ_hrx$+gUy1Oj*|Z0-yLbpX}OVr3+ju=HYFcep{ zClog@{1FRxJrti5-6NEy#K4)HiHkD|V3;sRdQ+AvAXU*FL*e~CHj@!Nk)6U=r9rK- zSZ+wYI1YiDxu=qAMwD>-Z^!?K|NrAa?)`Em(8V=28bCyd=M=kmuLUvD@XP;aWkty6 z0~cLl*KZa$AV$)YyL6<=JC~R}Gt+5UV&GvAvm627z=q(P@;5#t0H(l2(Gid)vwr@Z zljc-nKMG0!rn}Tin|OgXh+(IoS68FDyD+_jg3K)o6+f( z@06!khNZw~8CmVQf#nZ%AJQ~!Mwgp0R1X^g z?y%H>(oKA+>&@8iz`fH;m~x7@mrPl~;{g5I@x8tH8Ij}^#{IHGsr?9ZrpudX5e@sL z%GYEUR*!uO78J%$)AppwpJLy|9`>Xj+iet?#RWV#*%=TP?y7x~&+Q!@xbi*AD23rL zY3SVMqCgS3K=mFNF;Djc4T`Lyd=oD8QsZ^!Z)=dY-gI59n=Ol8`opH?BlHXgeN|nT zGhK|-v%&mG?piA6DOi0PabxQRCvcwu4fk4&<8<$ATQ)VEvWX{L8XV(ol6hO#(D34D zGC0VOw6FFiS9Tm)+}&S(tey$_Mf|AbA(T<@wEVH0JTfo$sb4CsU;=I9N$xG)3nLRH zFK0ouyhMwr!Nmf?1eLrzn>}?+_01e-T+70DVyB*Ey*y zU>`584{z)ER7kKnk6==90A29S)76W(2$OUCNxNzM ztst=v5Xb?-^57+Uh}#lpdP?vm1Io!(s2kh3f{T<>>*d_}`5^He;y~FPD`9}i9)j5H zli_-y-w|zWC@6{dh`y%qGqhD%v?%W*%-j1wA*J6Lw8;+MY}}@*68LLh1K2;*sL+8& z0b76J>#ZNoH#J-WN^a2a-Yo|&t8GYI*MV(~m94oR`x`TfcR=vPirY=bMb%LyfB`doEMRY9M1F2qG_v5bF zfxF^6N6-#X&d_;NdDAT(AN4>CL$O8W{)qE6fMCxbS!BoXsFuaykz7|xs1p)4S-SG> zq_Xs#&D(;DFV(f$%FQZ$>sh?n2P+d3C8D>g84~T@7yfV?ja%NInyM<iB=S9L!El;l>?SwF#QTaCxLiiN7Z zJPeXDM;QQ>co7E+L1ZOB`WgCG^-|wk3a>w>Fy{c<2T9XQz8!d1m0%l=`?xsEyc`&c zYc>C#S{(zo@#kHhNeNdCGVU~oeG^<%M;v#-Ksz~hbJE%KEO0w{bN6lR9$V7Q3{HLh z=Pz5j6I4vj^`wXk?#s2Sc5c`Z*!;6p{CBGKcLe{(j)*PW{mw|ebiCAZ5QG}KSiNxI z4vUtdMialf`UqLf(zV_9$}{_w9u>%GcRzpa=4UVV?-)ud!f)cYtj-jHDNNLIpd<(g z;=n&Wg84p@I}EkOGah-`aMHE42>Tu$X5UQ~M*EPWXEpiUVU86lgM-AMy1tx|_Svlh zM`8oG2q&S7Sx^9&GjJ49pWccHU7!$|;%Ej7)Qs_4$sZa{8TO|O53u6yk+H~5rFi86 zcerno-dOouc5AxX%sg8R%0YhmHEUlAK+b z7>w=h`d!8-w%%vqaGbzcTD@!&|GwUn!CwH|&RFbN6quao(=mef ze*ScfZ#f(8-%*)dvg1_x*&RC}N{`rY**wy>&ztvVYX#jq-lg980f`jJ?6FL3Dy@?y zT&F~m8-$)z5!IHNt?($TIjqvmH7)3E>$@+py#Ce9^SE8N49B4i4@f<4c&r4^vHyve zpn8-DerUJqruxgtb&qElBAC)=P<3K%^gPds?74JYbiV0Y~ezL}YsJsY0W6zuYHD!!DxY46_V z*suAmBfYT8l|S>YOtyXz{Da3h!+XrvatGpgB}MyO;hzT@-S3~N$Rq{}`xmJlpBD9A zHsi}>2=gNzf31u??a1@iR=_nt(+Od;&JAr78Xs4FIlEBAlSdUJ8`JpnMZF8f2hACp%PuM!bC0|Z1(kKepBfxD-T-EcbVYNEs24tj z=B{VCJ{x@QCj6g!od1k#pikxpp4zRB2FsvJs_3H*2Hw=RLo9#Cxqh|V*Bc7P#5P5q zgkR^2Ig0>LQHFrcmjtS)V7My`olBw0|4Z8rkXlWAdejcE^iJ9Vr@A%#K4i=~zX8Rc z{T6cYOp>n<@88~dDY(9T#RH@YAI<3n_jBT(gZPvz1-Fv`rIZ6nIq~txIw#_^ z6f^AfN#?t1Rz;Gkvi=;&#*QQ>)55aqZM~A~Un}n!Q{|uEMnCNBLK7Q$?0V1QUJ7|l z;yEP+bdjqI#dg7jb9`dO>vDI`inRU={T#|ArBeN-(;zFXpBj`gul6?fr%JY@NVnsw zN{>=_4tKRbN|u6Xzj64I5nH_s3k&4dwCh;&sVMSbh>OnhDW5{ge)bL3loqzT_n9_ zJ{0MD%)}TIl?6<2ATPgKwXRV@a;Cf7RUFW2~|V2M;ue`vW2jd zgdWlmAmm6^N(K-j1gi`1(_PR~PEa7xukjOJEgqj`xb3Hv2a(UckY2L){4#7!`ioRY z!lv-uW97g>Gxn=I886Nl(I_hon#6RCn#6uK1@~XUGM!UhU~F->_q}rUroD5f@Wd|z z?mmn=)5TTu;dwtPnekLr`C;AmH04Oj=qN4CEu+B=-ElCTK!^0Wv+iC9ovvh*O^e=m zamt=L0xVUxr>*tut!s80O*VRrEQ8;q9Er@HznG~~3I zjFSbw$jNw?QX9rd=5Il&svf@Y6|3ae_UI-7`Va(EJ^)|5Y^k zXVR1*%)Lu=$8V6h4|<>r#B!+Ye8SH$$za``7ZKBpt;6l*n|TA_mzD(r5qiU>5nz*# ztb+&7oJh0Y=K_(4*o6b@)7^lj92#xn-=OKxmh6Xv8PBHbqjs!ne?2`;?(TI67zGxK z5L6#%;K+}!ibVUY=piFqyKV)#*N{<~Ne<+QaOn37LttZTMCb5l`2Q^iVxKZ@!5ovlt?pc-vl!7RAui7k-O+ptxG-Ny@%t|^Xd-SrG2&eU%z)ZVHca-dY zLVkx~dh#g9Nb?KP_n|IECpNNpJJM$su2wtF2}J!0Yr%EyV+d>LG@&k5ahb=D>=$0S z)@V_*qQuR?YG59;!xCnf#}~WPYJhRZ*Pn}WZZ->TLTTRL^RWn*Ri@Ez3>QDM&=um) zehJCztc1NW-0>ovNr!wUy#HUtm%jmu$b+xQePTL@ft6GsmmGi7k?4-26V434bCSiJ zA^^Dy7a>oF8Sk(R^U`MBu9aquGWZpCj>l6DsB1%b=!GNYy>QyP2GBMc1RS7Rj54pH z#RctY)Al^SOBt!)I&s36D)FgmEMRe(*~SO{^@WP=UJuOK2qnliWWhNoMeFS3=3>(# zTOfb{HLYEwBKk?qFoTyYe2Or^bwreRL+1#wdk<}lQVDMsnfqY}_LzGX!tcuS%f^qQTWa64#&#-H z3DE`rmWg*C&f#GBbKc|t`c~bsAB_{hI=Ys5ha$zrg{msqT{~Okr&inKHn%!zvsme0 zA*UV<_+v|kVUZbM>1HtBiC_cg2GWCTrCg0!b7Px4t6``~-OC?K zB=qF-)$)6zxM%zizCJ)Fj>o+6uN2~fFS!e(CL(F7XvhC#bS+yQCL}16$Zk20KAA86 zhUV6PU&#a3P)%Zz_bGR}^trCQn(K2BfqYMbL< z)(YX@MG4HcDws|uC&gVY`jzh3J4&$>3^5A{z9)YXi;*q)k35PHp9%*bU2-1g5*-OB zq&VPlga=U;azn;yBzCxNe6KE> zvSqNC{!#!*CZfcXYC!J^&NBd)^LXg_6gbZiGuwB7SUNdE2FP%TzsL30yM|2RC)oF- zJ>>W0TVmSXlsXu5Zf!Cs7w+5+n{#idW$nq)4G0LZYfM}&vj40V^#y+Ckxfl<5MV8N zEG_W|=9HGRH&~6pjfA+!QYcbE)2V$*O`=mmX8iR4Ew=t32KA*L-TznozU}m;=I2Om z(B^cA*+Wf7SBAu2goGi&Ey#N#TIvF|e8S(q(1zgXann!=k3Q#iGYYikud1SD1z@Bo zXLGdezV=7Coo6O8BSX>0Ph@$sQo6$7k`s6Q8IhUv3H|Xx}`2*Zg=J)}XE4 zl3+v2YpeiP?p-2oU!RBgF)-A(@yBMfj8=)@Uv8vPY1+I(63xfd&h2>au?oF7(ZQ-5 z+Gbv^Zam?^aOH#=bWorWki|%YFP=ATH{w{gR#n~!zvvtmS^nT03!)7tg5LFT0qhEv zXlrUpzL|``-QRCtCIdw>w1B_p;~&oVJ!=Q;WCkdDfsRA77#l5U)l({Cn}z7R`yf1;vN}pntS*!-!)ee>J@5 zY0gy~0CX^dfLCAL&!K`YTH}YKoW762R#l=$+766WoS%GCO_zi`Oau7;(gbi_m4JEMbGN2X_IC-EvH4%){7WoT zUsf4+Q;E$>LIeOn6Q)LP30rW;$>i0RgXc=|3({f#sg^bnN2?{pf=EM|~yR zENf1|iquE%e?JOhAG`+GLZ=lC)7nQ+)=@hAX2K0~0qp^e5U+TkI$(SRVGE2lswx)o zM8MOdm9hjn2V727#Z@19w*p+`TK5LVg9MsHFJAaV(MoN!V&-&BM&FY!x9&Dzp>H0Wz)>OY2M(X7WTalTXVqtzj^{b?_h=3KoC>|^oXi(6aPqpv zOf155Cr<42(S+lE)8j=S8PlcxxF08jxRwaLSnVeyMTLnk zDx~Pd92A(Kk!?9q83rMB<}tq6$(ALmT^=Pq3tP`w-4?}!yf^1#=sQw4cvw=aFL}_} z!PT=<5F~_p){u{n}@`YKx9srs?ak2&|=n^R-STBn_g z3oaeUMaeGGZkJ8-?g+)`3(|{)#l=v!FrnzW+8--bhDixT3p9bsymO2XJnExG_hZj7 zpV%kF?;;sxp4FbYz)RR>Tbd81+v0@;6V=$qzu3hx8H?j+y`9a_*dZ%4aF@7rLubpE z+H8K-yuTb{pHLLb>H>cD=ILjRtk*hSG!jdj-+d|;?tvd6y+l00ka44%sUgDZiW0;G zHT!3}k6w&g;une>`xC9apnPbIJkQwu)L`2vE4ituBT%(t1cTmwIJKc` zKsBTJ70W2WcG@)nz3z-#!k@cAxL$qt8qmq&e0~f%*WmzoWe{H`l@DCp$9JBrbAe&a zlK5Xc@e+`v_$hEXJKf2nZRp)K8P03KgC5ugNii;(rT|TKDpCzyu>oPI;dr3YRD5X6 z60^8}#`S#xa~E<>_Odd%7)>V?v5<^w)V>B3Jyw{VH@}UvfgZA$pW~ocL@!3C=my?t znByB@>-ZDCK3(Y4jc)-4r{cxz5_WP<78lMbBppn&3Ka0)9n4R5LAV~Zy?2nP&&6So T6+D0DWDZeeBE}~Tx}N$UbQv)- diff --git a/public/config/thumbnail/thirdParty-ammo-softbodyVolume.jpg b/public/config/thumbnail/thirdParty-ammo-softbodyVolume.jpg deleted file mode 100644 index 24c5f52ec5f68eb32a82672b83015c2e5a9a3cdc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25289 zcmbTdcT^O?w+1*Qkt{hgC`q#9%$NWH0m&H@L^4QDLlBT0Br6~z5{5J&S#k!EFk~c$ zA;%dc3@{8k{@#20{@C4fcDMUT?O3JP*qn2;Njr`UgLJa z?Hb^biofGK06q6! z>y0D1C2TyyNk|zOnV4C4c=;ak3rI>y%gD;fKYOmCs`f%%L*KyA$k@cx%=WF_J9`I5 zCogXwUqAnVz=+6?QPDB6aj9wP8JSt1zhr+eC@d<5mXwy&)YjEEH2!RA?(XUB>mT?v z_Ftm-vkb?E~=-cj=y{1{m6Ng22$*LYC>RQr!+ z|L+tF|No`g|Ebvj>NO7_C&0t~JOXL}2yhvHo^eyAEap#(Xp8|%*{!!(c_+V0=}oTq z^@t3ZMZX`UZNfq5Fsk$A*ILI~y|P#f8#+yoyklt=xLI_#%F%0$b_FGPaHh1Xmr)Fq z&gSa*qzTUTw8oQMJ7Vm7@8;c~%1LgyY2hzD?>ex>^k+ri0-UWA3$hs59pkZtT~w`HC)I792}o5Kq;zeXxMDY@Ei1^o5F< zze4w{TMDRUx+jYD5F`1{D{6+4;V_*Ury=cE=N?$k<@jq8uspK!+P4h>vp2|MHYu8| ze4wXR=&_3RzJd8h%=KKxDGS{K!oRmABm%=ZXY%!=KU!L;eyrXDa%1ll2}}f5dnO{S zF?5LY$eCk(Eu`;<=8YdKLfNs8iK~XyK#4DRC$58%=VV}TFJv-?&Kc1dEm`Y|_yVfa z>P8G@+Zc(y9^XEbf6`sV#bCjD&jme;jpc+QnZ8>nwX zq<rViA|wR)batY|!OyVB#%+$uz`0Hv7+Z*&Y>S+sw054vOi9_PZzO zk&E`RJLmQ2rePd5!o1*@QMZ8ZLv$}w1WM2nZhL-t7waSPh|=*E@MsNnjCgwgIl8El zpO4L|<4n@?$r0Nm)<)BMo)!_QvC}~#Wo*Ct#a{R-txpq58KE6ItPvuQaq>$t#rT!9 zgSPWZ9{|UzHB%pk+yeemLJ**S^ZlJ;$hzCl-_bF4)6CJ^nyC!5dYLCuw&-hAAa@@$ z(dS{ToNw@}j5oUxrtm*D;8;jNy1ubvI>5B_v-dyW}U!bRL zSK+uGUkAZ($+JTvM8WC^YudeI4{jEY9H-D=iAsWBiysYi|B4ZC!CvaQZL5$z`l{^e z9+K2=J&-)_ex8YTMn?B^)ai6mEpRNXLwaEL*1?pnwy%&C**-^E<*Iq^b8fD0-_2Js zn6ioK;q5qTkQ^NN2uLn$em&kgQZEM^-88pLgiM66+(2#t_U3I$^)PGI@T1*{O`-|` z%%I}Q?}aysjA=<;VR+o6F$|@e$jx#!JK(XeQq%iOnlhW0s2(4Wa)0>8S=JBH*jlIjPF}% zSUD_IW^q`dmjuoG^)Py(qx&XzPW+$3wc-!29*`uwhrb_H`;GYYm@A?w3+7BJInkjv z4}EBwop}pjy#+Yj0?5G{sEerRLqSIr&EFm?VEvRNyIN1GWMJ^p#sTfYK~4-0w*nKv zY(D3V&wa)rT7KOk4oj*rLCBx$_1TYDb~IJ@N`u;A+PW*(I%86vps@7cu6F!7Y|n%g zb9aTbAJryfNaGP--tqRDLD$l8{I7q$YNgoaeX&PHoT9hGq>-U)yPCW(cz6tQT%j+5rFKqOWKfrX zVob9)Z|XyB4xJ{os>hGdWUaN6MrAS=RQh0lySP&&)Ct(X%eAYB4ym=i zW`{}~XrzVR0zTXV8r=`fSKS%W@x7rm-e067Tc?D4TpuV{lNL6$_Pc%a;3K>1>%q+V zHF_r5hB`xdBguUL)W~>{fe0m7M&HBGM{CI^RY|&*nC`s#;OL%_t&s7G!1b@$Yui!P zb0t~m!Iq3!+O*oU@5tH1v}+c}(0ig-ekeTpg2L0MGzhPfB@SyI z^+mBx$+q}CDZLzXHp;eZqY(IfQmMOgtarAenQu179L(jdhxGT0Ep_(qud0WrK0TgC zga@tapFhl8JyQ}i$2qO!kYTgj5Z>CRajur?SxHmQsIEHU@5?*#bcrOR3t--3iEwN5 zW4fC-euLuaxf9Voc#OPE@5(%_0V??;!r?SgvzK}Z+Ou&NkZ^YjDC}=>I7$q2)P@L( zLAYAfimjJ)+(Yk&+dxC!LuQ(%+>)hrmVq3NWzuwsojwmB0yK+J!8U6vju7`XEfo`J zwYDZ)tj01Yuh8&e%RN<&SG|0XCHnM?9)nzl@%R&xhMxVPd{I2_54O)|Dg}qBvlo;M zX{=t6nt9{<8>Y!}Cxp@iGX88v{#D8?arG0X^~tz z-$H;+BC8svk zf@zxZ>u&+EHrR=UG`83W`BwxJP1rVtLk~}N@s)^Mz+0WewikP}Rt_jL^CaD3mq);u zLR9O@TX5TGKUKsE6Idc-mV*Ix99`8aT_LkOB&jbcdkgRr~8K9KAE(jDWW3{IU%8FB?EMtO!^Kt#z%94qXR!g79~j zC99i|!CMjQ5DE*m^96QWouBV(O)bjS(&bO?US@=G#?4akF)7;?Q0|ubw#BqR0BfNA zQ1RztGq(V{AUK+DAV!(i(%;X@ni?#13y9=j^2OZ{2LEOEC}nY!S`QTmSQ=%9wo^389*Dr0 zu3i_2Kb6V4R_Y}Y2uR8FyWfr!!TUx32u4KzUL#v$IHU;0sy~ZWL_5DgZui^*=p2>r zAg2?1ES&Si+H94f-eWO{UU%+rN#H?l^`N_kz)uZG%i@=xDpuR0dE#jEB2$d)_-P{7 zx!nvrNf>Obv=ZN{t^n)HEQQ7nsnC%^#WqPOL*uy!jY`V{zUrp4$j9TYQBV!E%guu9 zAyM)JA0*=s@!?o%7@0-7j$B7#Zw&*eJMjUg0R0${Hk1BsQ?P(^0?Nk3n&;V}E`?XCt6CQbBFJ&EwJ>iWDcr{P|&#Oo5USHe_tO58=f z0UeARoQ$xh#5muyUWcMBNqD|>qjs7Vi!)~tvG*4_fbGQuIWP7!=5 z4Im`+Ajd4@@FTGHqUYvkDD57U{jmuSI+oAL?nR;~h%paCqlv3x&))1w4`AsoxpnG) z?z@MBC{J5{O1)@RFZnh0vW752pUqR^LtfpqjO+8gC6ncr)S#BEpCmnETz6pH87c9` zerz0p(W;yH z^%Yh#2S34!L*AG#R8S>(l*P0MCDB7mcAw*ekwSkf#+E6JNp`I4wNzdXX)IGvb)`ST zJm`-c&)BXa5DDp-&&y)FV(f{pqFNc?lWES#O>23$)8nxKpQy={7+w7~IdxV=wMUh| zJ3i;6ERrF@#gwW0I)#{H?eW0O&rK0~FN5zHbA9N6b+srLpTE%EPn89}hbap3buWTV z!?=x73gm>= z2QN!TJcp=wkD2L59N0snz@Y&$kdg)P6Fk5YLspO@7gc^r6CbLgElWCyH!hGt1Z;<5 z?KQG`YnE8`ah>_jkq>2UP`Ma4=_{xP&8EYsmeMGz^(ejbM)W8 ztGpLRV9EBQK9wQf7Ss!*4|%l1;)PDrL2mX#Y~Sa*L8G7AH8SszSBTv>n@sey^$q`y zMuf&-Bvx~loL`L#`8;!Xd7J1aQ`UE%E01bq=6gMh?}c_8<=^Vjq3g#XW6JlDZLN*U z_>GN|mH9Hh#=hs`k=b;z;z9*cDvC0SEPw41x+hA$@2SXqpZ1cOvu-*Nka=MT=?5mT zypw9_h+t^^`P^=*$~(SPb%y)?Vh^F%?w|7tL}K^U*8)Qs-)t?1>%a@DH}vK53ZVK6wB z1Zss0Hm~&F0_M5a2!YhCPu5FZEAy^`{E`$}MUQ?l1J1Xa`9y6+3@W|U&5UHL;vnR$ zj==c(4%WVM2kAh4r^$doy6k@Y&qs;}dxBG~Hp$YV%-a|89g$p9v)Ucu`&vz2e_J@6 z-!I3h$rj89eHXEGl<#Hen3o*vx71NgQxo*i4$`=}G&~W_oCO5(@q9%TF)!y6(Lan(<`fOX$bzqLjN+p7W&t z;*OVy(LFl*Eh!D{J_gs*7EeE=E`mwsB7TMj;eoXUo5Gty`v!g9B5mm@j^1hq>416n zoTP{$*-{^tKoTXA9F_V}mffUj+1__)CCiAddpntZh7^ktDIYdj*xd}j9ebJg)-H@kxk$mAOT9s+O$`x7eUm*gHAzqoVzznBT#MyC?b~kKf_7JhVj@| zKWMbI*d4G_~+QwBCt}x7)?5v zi#)E}quz)YlOGyE#~SGFnUJAR<)da2CDUNywcsGN=CR{?_|o#jyC;udegaxVz)uPw zDbcl-+Jbs$dgMj7#K29yPwD>o2yldPo?(!x;htUX8O(^cqG3$#L6Y-2ailWcf@-7s zYTY=yv5Uv0+BW+KUj)R=Y65m4k#3W)6GGjW?;oJ(iulUQs>Qs*FtM=IClZWD>TD?2 zR`kZR&&AF^VtwEv2JdZR5k^+xnZUZjQ2nLOPXv9vyjMDb`a7P$DdHz0-W?ti<=@vjj zwD?!5zb!PdtS4r!p32um~>SqbMN85wC%F6KPg`0W2eWod^PdA zp7NPlLB4{=Wp&`4R)zao;UR~w%!1>0hkNuha<-d%;755cT@9F2xp>>v7`yz* zL)>cFR2-XB!KegRhdHy^J;-X%c&|Ytw^7GTbdG=H0FaHkKLcfp;OS-bV?h4tv!&ln zJ1_zCR^XA+KW4)_LC`OJC`g%f^M7F};^@e(xO9cJhsOPu5TY>YVWcNfFLHCPn{VD~ zm@&WnniPGlft?7Yz$gUUqNw_PapuyhsL0Yh;G_}KcEo7wV#QwgTky@O7?T`=9x=UE zNe34Y_>nB^b$$7W!n20<6dw|?EonN>V7V&Z;lG=5Ub&I;?J2HMc7^_I?RaOlXt$k>h2(v$ zr@<5jx@P^B(Gkbq6b+|8~e%F~Y;jf$H%dC~N+BQkZx5DAHs;wpA(5G=5M z*!yU#j*ZCG%(+P3XWii+MWe$+QHcVslCkf=M4L@zo`HF~o+;L*=Py zgA|KlXqm$-3*8|7*9FbgJ9gITx`%0FatF@yCVMFhB*oc-{fjBIdY(;Aj^zn;)8E@5 z2Qz_@BCD&137Re%%Q6-t)*p5*A7qPo8$>- zW*=|bRHH3yH)~Jre1kLPB!!hFR=-KB(5Hj6)v;_h@4hBGWADYW;HOyULbJBs8sOsy z*~$RD_(jK2GZl-gfi)crE&Ti^de?&i>VdQhX6b*;ootPcE|t_hRGL^K@wzlHi<62X zqqkhK1)k$lmf>EZT`D2e=8G%-&fW8BG2Toz?^3TjOITEN&cDCs24*-Ct0bAopI#U% zE6lt>3Ab0cfK7QeVe4Y1uREy7gL})iQeav=ZN`Q(q z$S`&yI?6c4j>%gcg!?ZqS-YJX@Z|HRYvSIVpTVt1p#SPV2 zbuVxLW&|G183eq$!{9rf@_~%+GaeSXl45w~(Dus*Rt-SIP@=sv{i25txfkUZRenOR zOA|=lGGv`%(--5K)gq7TEj34`MR)`3IDf%h>q1&>cXjqf|lpOwv@?hW9Fexf3Ebr(#RU>`NkCSO^3)F-HQ0`kD7+$ zdYHOADvkO+7L@-B-wlccO7EWH>JbwsDY%NzvzFwTlQXE z#dQdI`Bksi0LEve)o|w8W?jCNd(+sRXnxqvHLfTMQz>zn2^1JA8Rm8u8EdtA9lr$( z;NDGo1e14F8Js()f-VLVU9rVY`sXaDFut@O- zUhnPMc~UJPQtPM0icn4~+v%W_YEx6sR?o*yd@2(JEa~W41&nZCCfV5_lVb}>)?Ims zx;DY6PN;9#5Xv$y<@>|Nac{DwA@6uC9$J)B^?=8`;Y@0?N4y!@!^463k;t;^s1j1H z$eDgvt#B7Bi7e`IQYLO`%bbqdb#;GW!xTh|DP6|jOq29JWqT3+@faZ_u{Cwr{fi}xKL`3)xe^@p&gq`03C$pK79+rZh0!-LA4!hk&J@jhWAVVQ?n(K zcecA9(k@?B)4Or>@0y%fMSzfM@cGd7mqvdM2YuJ_SU5xY>?*X&m7phaGt#+5^WH2u0L#B3q|@#!qvtjK^+$nrUW%IU(TP|9 z$>7Gu_SvzX>w6>bHxK0WsK}uys@<~i_*+2jKqq9L;3ak#J&w$IielkZHkh4p;!Vig z7g+1U=uDJq>%P-3&~RQ>8(3k#1*}F|6Jws(%y!fo_mY4G!4sJ*p)sx_hhOwD0>21j z;b1A}!>Xn}#RlP^1oQxc4?_z&pT5as38lu3zRkX^G-t7U`*{?xK1_?03ARtRRF%v7 zT%hW^Uhwj$-ickWE=9xjm6+_Krkl^pl8{5`4JzKF`|g}v)r9y0O%H41=d~2f`i)@g zqO2pH^T60MP5T6ZpO~7Cj5r4?0eCKGDIx zvrn*xSKT^4Ij4xAit20AoL%*zl|` zldSuy9m;q(ak`Oi)Pd!K9n{^=-jQ&qsGsjsHgO|{_EwWO_RfUj5fxX8Zo z(gOo04Ws8F5@<~rMgZlLd`PgiWLV|Bpy`@DKSK5S?g}l2iSaHU@#_T9SG5v*l$dv%FNZbQm>@%E?tZOJ z$n)%wIjJ;Pj(+;pEKoSf$em%Qog3M9+$kD1!q1W(9<*e0G8etT{DOxWKKw1r+=GeR z^;o^AMIwQV-)ky}qY2ruwp?9^7N1p_gw-p27K%>KlJ+Bw7wZ&4FUkp-+=!{qhATGL zI~$d3(&ry4%hbl}qsuFqeVFp!l&B}mgat?q1o+C^p(HX;pm5hS<2Q;C!vvd64YKs_ zJRfmo86qXWlWhHc@a}p-qvH`qUf<$`D<{1@YlegKbx6^@{qtv~agRfN$LmPUkULvjS7W1Sj$;>DjwOk>wgsDq z3#+Lk>Ew+d5+$zBtbSfUd=(laNO5?IpFeFpwo??*tF`hrSQqJxz54;#`1q3(kfWW? z+CSwSfBs!Gb4?@sy=A<@&117H(-qtHJZo(bt8xw6@LB;wjJ{9kiwk~2=ysZgV(&fi zb9@K${0(Z8z~8v~`)XsMX@SLHwIXF+qAsxw!Z($ht=ecqDeuwGzZ63Zz*{Kdq`W-a ze|+b~jsrmP>>D68FdN|QIY{fC_#5)dp@yu*`S-&~+^@$a6UM_?C(4`Y54*5RxZCjJ>5iVQqH5V^}z85MrMK+xn+TZ<*c z!<5BjX`&DAcz8d z7}Ir~HWX8Q*&#nKp_OQ!56mi6_iB=CiRFG0X|vYx)o^Xfw<+Io?a=8`*S_|rdJg1K z`&~>q>2!unLE}=@7Nvl|#?Do%AD_zDdX|2(PP_2Jg-76JYVb-YesK9heu{y=UF@)v zfMi~2$GT=?ZE?l?(ZY*8FbxtKAru8E+%@{q|6B2w zs|_iT{Y!Jlx-+qr{uo;>mNyXkq2hb;GZK#662d~FyGleVpH?q%6HKCU7x$F~oa5cB z{m#>Kt5?0uAJ~b4OPwwnkvCuJ9U}qYo!D?jj8jF-mO^sWG8eKzwjmo7b=t?& zJnimEG(FvUw6Fol?1`b#i&go10oxqzMi-6%n5Gz}?OJS)JsvvZJe>609LqgujS}A6TrC%k7bH8Sa{cYq7$AU2 z5)i7L4tRz4m6d$nmD~+-LfDynFddNhrX*AM$75 z{5|@nSiRUEu{I^0HmojR6`lOYtxM^J|G>!UYX^0%>|&M-t#Oo2KOD{3c9USta&d5s z(iV1l2ktBM?_^qV3k=T3(^G4vg1MFPRBulW@n#*(q5K9y|8$&xMN^f-8T&zz@(mfb zWFBSa<^eM=JC zk2hc8!S$^s1~!@5UxeCKxtfL!?WKUr_TZ^$?WG;QUe_t`htj`|L9~)VJX&09vysBx zYF~3WPY|zy!enney{x6IX=D40e8i;KwkvC9w3o~=uzXq-PWW{WDqfsx! z-}cvIB{6+=hDfWcRDb)YKT^*{shDZ@j9s3wF(e$_0zQpUoRoj7ZI3R{ycPnhA+=L* zq@g=?*PPJH3FYqCc>?{Mb8J9gM>Byo*7v7o@t-Ivlu2 zC5kwE`P?aD+f(%|jJWc8wX3dl@90ZyKE?pK3~`w8+@tOv|NTVk&wxfqe{fWt+;M{M zmCFk4*{@TbIvxHg?v<0*l#Z0@UTmi13N)AAPiNKT8VU&HAQZG?zgnDiyl;obHtKke0U4^fGc0AY zQ3LQ0@C`qV^nXtHsXcrI4MA7QfA=2)xpDsPb;oK6mK-O}yAZfD%%sn?6!QY*;yI5d z?(u9FUv*8r(jC1Y&3U5ii>DR{z%zI1eYgiGfm<^(>D@If_r7E zO6qXL@na(Vn%D2Ox0ugBYsadvIr1S?M?9EywS#=o*_uY`P(gd#ufl7jLj00Of=$TZ zCE8b!$dEfPY*w3!IA*x4%*4zyCv>R&Yp_D&+m_f8VR)`$@HHJq;0AgYtEj)a5=p!k zNh3nrFKyI4Y1pQKJv9REO^8dx@)E&c#ak8fZw44lRZAFdK{~&dR`HLRXTyCM-KF2i zTkH**Tuz>c;~G@}?1>y{y}*TZRmrFDd#sthQ^c{AEGv2$&9{K6`;lKxFI8+mZ<`#< zYwnATC#6Ih3*!t&l%P&di#@#s#q%n5Qxvc-d5#sAKkhcKI=BTShTKI_CMvvmu2o`2 zOIYZq≥vp8a}A<9eZZIayBpE|Cf!1Db(V=&ig;5~J=)_{KK%yKo~tkc;_=(#VZw zr#uJD?aFehM)1W?p;p_I?@~f%ERnh$NXXhP;3N1R(#b5i?)(atc3eLtye(%#g(B!G zO<%B87f!at@v3yePUu=3G^C#?Ld3#^Unjc>)9a58*bCfoD1?xzu- z#d{2m$*!zxb_Ody1JmZ)m_}I~Y@1?>omirx{cA0(EC)CaGK@K~s&$)CZW10C{23D7 zCrT!r`||4fEY;T6iC;a!ozUM`_$f!$jKZ!JSZ-%g!g40pr&_<;)HIMsqp_HGZV=C_ z?08oRm7h%z1;c{)=!?z`EPj}l)Z1iZw9Yj#b^^%ELKd%sH&pC6anjfvev`+k6yp9F zYjCsc;>yNjma`Kqh=gEC_*R4I-*lj1h%Y{5VGG$q>RQ#*JC-M*LV6wwrK|j+u@H5z zG@1hGx5m?$g}h!nOpFJ1c%m+A8Zjg%YHMozb1VjHHS!mJHsS-x%_O@W6h^J{>I}R z=5`r<1mo17j_tC=2#_c}B)D|GslxGJAqhBAlIS5pWyl1Gz5ato#lCoYeRX7tdy#2r zuhDz{>+0{T_T_A8GhvFq!UB_eL+AjhJ@nm7#fcUiW&58(Z^`gC42?ocvSrS)*LyvsXAT`czANgDx|Z5-eV&89l>`*%6HU17?i04KX9Z70w| zw{pnu`(In*>aAI8cBy3G3VaPRSKIR*9Tybv(l1YNsnIRZ!U~V>LVWO5^?pV0G>aHfE{^qeQJ&Zd)xB)9QJqJ%O^`8R){tp7;teUP~eFM zo0%1KV#PzdByoHicsxyeRWUl`Z?}AIRlDX2g;tFW=3}hl(Hu}8H(;%6KP(iMqNbs zh*GV%UUE*m%s;~J-2%L^-ue+~igW!Q85IH6y+OyZnPomo0$AR#gacDK4$N8QpNWKe ziOd0rOh25}vGD=_(QF>+udsxxndL4?mC9GmKdl*;TdyYh9Ru*G2X^%)i>o|2wx6s* z@EuMZ`VxCYkN>!e<;m+C&ePcMS0>{)B)LceboX`d3Io{PCx~Zi-L86qafp=ZZIti! z$!V3y@D)+kWP6R${#ql>V}aJ__;In>cBPSCD+80u@PR-fwi?`nnz8 zXZ@4w%>mJHG`D?2%*>T=)(0R+#fWJG$eb#ZIlmFw>WOWid2)D4xLJ)J`9@;TFw1u>bpYG+>Hmv zwm7^aH+iHOfU-3)oCbU5vEda>)!)N!%;5?-npmcHjcwfsGiR1McM(3AyIysya5_84ge$PK`-C3n1WL$nxreW{80I3?SFi_b0EK~LC&(xz=(%XD* zI9I976;~)SmzgbGh1)9XOP1jou0-fPj*(II+A&wyp-aX3WZkt1><~6<*H+*9RCe9^ zxgp@;IsIx&%kt4xBcJcemty#nOXW7lrD~s_26LRGujv3m*gDc*RKtE8b>sy&dYQj{ z|NQf2szk61)R{s5zPhlF=JPMiI_{roK=}MJ+;zOVkr{|9v=yN3xp-jC=a!$xtd6*uH0!ST?qN8zV_>X3&=10~W>;gZ>qC3gwFW-8)WKuS zoWh?sbLXinI`1KWd#d9IcC#A2ySDJsuqq1MGUdRAn>-vTmHqXL?Y+l9J%HmB z@Rs1${$u9(<+6tHcypT(q2YT%&P{`Sc!p{`v7Jm?8Hdv$jRY4#*t^2G(W-`Sx|a2q zx1P5@Pik#IHpaEO7JPS{F|&qOI#yZwmkc`o>nLc^*7E&O7D)^xsYT z?}Y#4m*l^dF_h^?oy3HX2sk&`yp^XSYz6zR2#_+p!HSL{Af#^&th4YiS+~|y{Cf4=mIUNUbSS>sq)UXag6N`BOJyQ9+Fxh<62E023LKZNIMW$apQ* zA77Hm+<4$D*<-rVny>!}C?As+cy#WMkrK|E<>8^ou%rRk^cVs3@+|->h%Woe)hhWluz}g`Qm?La`F#paCWc9#H@ZtvT#M)WQ!}k z=^aLMIw@;91KoT7tsb7*pR);{%B<=TfDy1FmXMnRJC!S ztR5t1u<4rwTX^1pZDC>NKVgbhO#S9&L;NQ0cfH9gsC?3)ik#W3bCyx-!cOy#1bhC6 z5Q&iG&<3?0_c_Fx)@U1wt5^PO^8DwXf}L#om9!EkiG)qV=!X$4ryTVdC7oT0^#K-- z#FrqF$tYSfRV@ue$I^Ox=c%o|!$O*lXBQAMjOfVEDus{a4XL>mxqDhx8M5s)<}!0` z@X_RGNS#hxhjSGbda^5z3pJbQeM74^(l+{mF;T=$t>!cJ<`;iYZORv&a$WS-){Maq zz*<9|i^>czA-0=oX00~{Jp97TsS{YW&Coi6*w*J)a<(;20g{h=9?9~Z+Gpp|Z-VGsAQq!|k{?kHl&$mIi8kBaJbb4SjotFbF>p;3T zVyORsJyCZ5)&!k@MGnbCoKn1y>9HixYwUK;LN(m^zIqnUa2*!T?G{KX`WghbOQ~ee z_7j4Cy;SnLkG;o+`~LWA5N4yjM&@JteNS^f&x893Plw?mIi)g}ny#kKE7 zQ}(A@a5lY>T#>Y$pPfFN%)cOgMqg8uD|UB+&Sd5hB|V^f^`eu07ZSBJf4F?L(((Cy zAk}Di_`f)oAo1qAvM?~L1FzK*RSK5zr~r~VczqVM38*wTi>@1ZQ(mMcr7`Z7n49aYKRKt( zahh=y|EpEDd&BgdamE&Urwg%A{uE~QVou%4;F8OC?ast@>an0~-cp0~ z%S`NnlXS*LW|EPWFDR>aQRd#pqH)sN;v_z@shGZLh$6&cx~K8T=6$VoUlC8ml)Het zYBDLVLDRr25$9JZ0|*0#X#IK3bY02vq}pVqwQF6&UT?Y!V(8Nk?#4=qym~b7o`pFf1wa%;4)kJ5jp;1qonPI9bnkVr${sP9H z+L)~zc=M^9#Q%7WO@4E`mx{{L(b$hskWe~H>_8|s^{t-29XGNkB1v!nksGY&)f2>e zGAP$?t-~Ad{(Yruhv&DI{IK5E3l<^@Rqk z-s+u8JG zo`1Y!qDSJ#wreU|D{bA#-idO41N&3^37Os_5(GGlD0;|_CFAvFQ@YD)b|c@}cco|8 zyVJN%UyHKG&?}sOkyhqwXs$tQ&^ZHwWB`aSCE|~XR z&EgU%YibMrE!cZTlN-)Wt;}p#r@cH!rk~Q6X{;J9zZSkO?e~uqB&Qb~RJn6qHSWyD zBRfcVdCGSEA?e_VLhzl<*2FLh7zNAHPjHX=wUX4}m4n zR7jcC`u?H-r286iG+0o%`cal)&Xb9PhM;1?l-6&|fZPvb2HkY4N8j5KW5cz%D{`+) zFwgf&1VsYmOnqmO2jJanQyj{cQ|9oWLe~yhQ6U#!F7y9nY;O3<{_|3#vu89X;1WI@ z+U%)T1kU5*>bJ{%q7x%7aMJVcUTTK?Zp%}3^VIjvdIg3-^|Wm{?E?r7>9-i`UQLod zQ(oypFQFRJN7}Ca-nLajZyLolGx{9$6!ySCoV=Tj2f>IhQi+zT<%N5*6m-U8mJ;&? z;Rbyo%QS}D7f~I;D9yx<869fJE&obj(Z_)|-}3~Cb%Q>~E-Y86X?kh}jc+#Z9R*j# z8DMNth%Pr41X~WZ&h;}9sN9KuO_hCNzIOA)WSrUB^1v7e$rwh$zRJuggaSqD%%aP^ zC-1zR-_fx0moO`(O+LfMv*(-CsiJAW6)DQdRE_!bIFwD;8&Z>ew5OXcRGe>DfZeNs zq+IF%(6Q@Up`?4;O|C4b)qmdY2t6y@Bptmf%UwQJQqupLla%}Gtb^Gdb0H9z_Tu`>hp|{i1MG6z{z#8tV80Q1o13)zR;n1yiTVnH{Xa z$X`WmkR&W&*!k~t?qZp?v1fV}Y^6$V()MH@OS-TQ6YXrEHo?vAN)GMcrO%)Ao^w-M zDE@Ln-Y-(jc}Hf$Pqu1flzgoA#k|FdzH3q2D_m zgXsMUdO~Q{zi599*#7+Ir(XHNakO{3H4M^UpEJ7BWYSz~KwN^EjL*w+{`=17`1Sog9G1^IDa=y zyB-?K0+b1q*o1vD4YN8uI(49?i)Pl0Ld4_JT@(l^pNG?*9Uhe*yOY-mxc-jS=gtSzi*0-gvujKgP|F zV?O3!e-7LNzL5f;|MMWF`r8<4)=x|nJ=I;mpnk7gtAb*VCVtta#7p?RljF_OH8tyg zB~$X>Uw(_A0|>ghly3O;vEX}}19`A>E7e-Z=hiV;!4No>xwg&n>8L5jaFsvm!4x;y zEdXfL89W%R7r_c|dyi_QeBTjkN>e9z@e?)C$pJFB&cz1j~ zgbqPu9OXRmkxR-b4DPDd*-+&z`6xx3;TgD z`yvBj-|w-AN2feMFzpYp&2C~JzIW4!`_&H3d!0$Zsx1>A*GB$Q_-HoYkdIj%V_rBp zb<@+eLgST3IJ$?nT<>R)eDB{hY7%%vHutpR>(rXAh?;77t?{%>^%X6W80YD6^qlB{ zJXW+?*^`o+4vR6KcE3k;6ofk;5d59w81~*{7B*`MaQ^RFoR>>WH}q1-1_=9 z(AL;`$ta!n|LEk)(gj{nr{d!CyAI3zB^{ie8B*gy1S)o%x(RV5<`c zs?G-F^!8vLS|7Gla`Csh-jxJH+6aTp#@IFbIJw)6A0Km1#97H}QDJAb<)UsblCeV4 zznE~3_v{A1x%OFtBvyuNW@`SQY6E3@^lywoqEjI@@lzBikR5@A1~c&>LJ6p<)GaIC z#{-D!Yv+46IyGNgzWA0OA(`bBwc6@FVwE!IG*=`aXzrbPVI9*J-|XyZleAJ%oi2c1 zdQhm_b2?HxoF^d`uWPPUw7s=iw`X*47SW=Ga6?Af)F8u~!DLkD{=(;GK9XbwNh5Uq zb9ZR#ShPR7URWtSR)z14R3+Fr5yF%QV91 zyK&Zh3cOT@WX87HS}W4&KXN~)Yh7-o3acFaNLXov_boST2!D<9GvWf8nX_F?@cai9W7eE6K;oQG-ZJhm_4KKN`}jszwHNOi>3_*;TP)-Nz!Y zHo$vtZi&o(YK`Tp>kCxBQAc@SBcFXd_y-!)EVzOo#=#ZHqxe|g`->br)@7HLP1>0 z8YKoldZ%~I1GpgyM7FSCLGn`squ)wf^?2sXC8Lr>o7A8=kIl|8`UQhiUq3IZCuzzV znIN-adR@;fQXRN&3qEo;bWdBs)%y;bdnY{EJh&(kivz7LXg)(VUnSqYob6Da$TBM? zCbenX$FXzO(pFFK>$)ZU-DhUEi^B!=K02eQ-0cfb-48+Mb&@S>MU6{(XtoRcR$@-y zV1a=ttG-ayW+6ZNSzJU{6z#HK`Gipg%dhXY-*jE}Ix+7b@?Pr}U}n(U#;TsxIM4c2 z4=BAg887WoaDu(Jm<@8@>3dI%6U=o!wzP1qhXw>9whu;joGJTI)o)dm zzV&PDFaBvrB(vl&T*tRQY+;#_Fyo_E&w_6vTHK&6Hm`%_sO43NF{p9YiVo2+#IDNO z>c(j`thmriO}EF(3oNB}`rQ{Tn&8uJ1|{0f{RNA=*#jp0`0r@ZEH7im0^w&mnIEQP zg07&dMhzF-LU`EP`+4AQ#FTKTqpSFD7?-v4&FWXut#%1F&a6A#l6BJY!KV6SeXbtth|4=&Q zjsw{EWHZh}fbtyP*xO+)*5EJFAW`2sbX3A-?OJ+5Ur0nzLOE&mvYR=~x`DL2y@w#n zKhn1#!@ug$f0)-lE8q+aeA`?(#?ih{XL2N_?z4KHBB&QlE70pd?Y-uI2x`wB+iatW zlIY?0h}SB7XMk}IAD)(x(^ZYY&WxUA)?X36z8nF?wxoe@50e(dBB+zLWs+h^Hn}0& z@U4fnkVLCe!$m#0jEm^CPeIB1gV`N=I{B4rF+n0bVWSXk>oGssozej@xT3GmE%W7O z>A^Ngc(HZ>OV>jAn>niGPwu`!H7{zgpK)%?uEiKC{16n6vk3o^+H`u>?`d8MSE=kBE~TKLWg#CA7qOd1V1UK4j%%gY-X^7PtP_qJgfpqYHSR_Y=$hq>mYFhX zrAZA*_kS59Bh?sZ1ARo7FSm=e=bF7{;CrFD}-XV?00XO(PbZO$&MvcyCc-er+F5oA8TUbM|kd9eg4otUJQ>SAzMD*nz<21pT{ zo5PyjirzS7v%iGvdm$A|RDdARE-!IzXvb1Tcc^sG#;ov!cZzu>wkZ$sJuLxSB~U`PBMp7UUGQPbW;Jc< zOPbX=hNx;3DJhIcxYmT?FTQ@?ua!3$`*YNa*{UV>j36AQ7>(Q2e}M%rLzf zqqQ1P7@?$#NAvhS>+gh|8(po^70`dBWn1L5D{@t;XvruN9H~EaVd-wZ!hpg1y~N*W zy~U2Xo2HE?#Z4`ZZWt6_o)i2G&+3?!-1x$WUBV806a2IO@aKj3lga`VbT0r{sk?`u zQFWR(-D?!0+YG%DgV+ZGA@9G%O#df>y0k@~_yZWQ6b@=^XO_$em5M3q?$7543bAUC z*svk0$uZD{bQ%1oDLft*5u3Rmrd2HCezAG!*{O9()AIC4^^4N%?Y(t!mf>vw*ysb| zNSQwgykkpJ;$m3 z?!$jKHV@ACM%kChaZ40V#)y4A1lfk_{BBytZ=TXFEN|Bs8xG4b3pg)qElr(aevseL4 z{s}uGdGOwk+J2Ly^xzq}Za$O#e))D>)(wj?>QMN;0NMFc*^hSP65~%mnK0vVLcJfQ{#(LMC7~jCe{20&*Qn0f)=A6t*!dn3 z3g*l;!J@w&5Fb}LnQbcmU>9lFOg1AS@aWFWW3aOn8PYxTx3?>#dBW?|BYw9&JZW1S zs*7R@>*Vqpe*CE6OYLXKE#U_R*(o;aHL&45mrcGtIWLYcZBl^td6?sAjj4oS z-MzdI3_>Uus&l?o!9K6{ZhDO_SLL4?`oBzP{M}0iryz))EF%^9zq3!ejmRoE-~QCN z=s51d4H+AY2~sX@?f1_=CH{(r-WRmHZd+m5d7C=__8ejgP$Kcg1@b6i@Z9g49e$6- zz^Y5m3neA}>)i`)FR@Q77cU)x3|CQP*+km8Ugw?PB%4>>6J~LVg%n7Zvfd2;^#rY3 zr}X0_Yrk|`ll!0UGsoRB`X!zWeI1-s*Kx^ODiArFt*BLdEDLR-PB= zc!9!Nn_tnuNp-mGAJ@@GcY*KjM$*NIxr5fhs~^09yh z_0d*d=x937UMO=B%|M=dWI97aMS|j%-(1@BJ*D3B4#{o8uwp5fQJ;Jzc#tijP)qDG zn041>3%TXia}6S>WWT6iIcs;9kWpIiN)#TxkN>*hE1M?-Uaw%-Y%W zqw(4a#jf@d9|zmj%n5BzMxqXssuRqm`yE0Trq{+VPM9T|J`*q#TMQ5D68>`hmO|!d zG=V-WOJvN%Nv2}u2W98MqAo_)B4u{1>Cv{;XC?cH8MKWXt%;+;DYe7^>w?;3Jo(=R zQ~qdz#la1V0JQ?bGEF&4#@M=hucVFyDyz4IPC3`I*g`NDLrFm=!Uih|r|3yslVp~P@%X_3G z1}E3%42MRO_&UAGaq#euebb@+_l7-=1XolOuf=Zl4)hMf_7Lf-P~FSh>fCkn||zaa8h3Z+s4M+KMqA zh+Xelnab*x0|f*yE;(XO@EsYMznh#K&^guzo4Sg}1}1?EcC{)NGN*}^J_u~ksf{r) zHqk%LpC*OnHa*kEJu{5C;UpNizGNkw^wHR;s82t`YB;en5jPcdx&LAV`27gNuelubo7qL??^7+eu4v8?s~PbH?lm z-cuyeySV!`f^=eB2Q~U}h`_TCgNj|m?ISz1TKi-;hygmk1}MmjujEvvyFY%mv}ac5 z2-uG~F8_HybK6_(_Nv zn>L%c0LJBDgV-~v9_)=5dogkfip0O#_bv9W7gv`QPnV#qtTT;CCrwND3gsmWO z>iRrfKb`o?*YGsd(|Dl(yZm6Ih~+~zZXuWp&Q8|J`Aw518P||@XCE6kA1A^`IRiRT z=R-c@axw>8UEg1Vd6N6q-c9O0H{5x9rLJkkClJU|1&z&{_%VMgE>a0pNO1jj`k=-w ze@Ey29xs}xv*SZer3q8G+@ex;QH~eZ@_eXKgU(;;$MR;ht|I*EV_04uYtPnRj(yVW zrMBe1?Y^0-KlHKAd})`Kt(r*9Z$3deM|Q$T7b7Er#gGP#L)(5XYd@c!w7a6koB+?` zQuN@3xy0*!Tk(E07T;o!}ZSKB`J;B=k%pPkTI! ztwO7Tw|GEMd?1|d5cIwSpWS5|O?d*8 zPQwXAC@mTsfgt{C(Zmdb$^iwan^}+`<x^ zKfa^6&Th5@++i((9oKA>#jl7N-zxof(xKK~s3*h=(`ovK0q!{`dB4@L9$T@6WL8q> zB*$lqN>s-(vTqj|8}FJtnJUKYK*b?Kz@`tOt`bqBFrT0USV0(lt@lvltuNzhtgLs# zdfq7a%WV2c?!{!qb<+;I;irkR0`GGbq*wYzyowD|YjEBvNk}^?06v;&#+?lY`%UN( zZ3zCeQ&JsS?CAQqaoG7{4VIlKF2cFymTJGqiy?F`FqqQstah(`T&=9Yv1HU%(9FAs z!VZ_jtPF~e&o6Hl-L=+UTc$4lerdx?qo1_U@UbHmwr;A3KHb?Us5)yV@R0F~{QMa& zo4c9V{#kDI57*}O&9%k~2X-z2b5GeAz{J|dBi6n`cfJezzq5aeCiw@i&jP##6Ptn= z&L4sV6Wi!(6uzqh{W%atI2+J1*E&n=W+?DEIwE?~=uGk?@CZ-rzZXJ9fyqCP0l&7% z;0F3Rwg|tgU~;A^W%vFu*)E%qIpEO25uO2#rqS6R{n|%jLt#}ybwZi5-3TAO4nev1 zK>(#^S&(E)UY@xyAl3G&p5_h8CN@JD7HK-*2+iN8Mjp)v2YKCLgebtzaIuh(ZQNpU zGDoDaQ@qK1IZ|*tVmH@(b=et;zY<#sh@T7yqM}Bp1oK+U9^y}NW$3aAW%)+2C1QBT zzgz9IHa!7BFE=wt2+e^bT5>C!3>TK8;(Pl-&Pg zw<7LD0nujMj8)L?W|J{?8G?0smc5Ie88zINnn3_f2ox!@ZVp^#AXsu~x4M~kaAqjC zK7n>+L-hI?DOb7UAsMWxrBwS*5Pq4+kd4?Y7tP5MgZ;+&YJvE&3CT^W<1y`#Ml^tNM`w-t~v;Lz#yJ=p2P5>6* zdR<)#KDLVRWnh(ne_c8o2dxy^U%r_@-@rAWrkn)(g>c`)Q@R%`Q4tVms$-DGohpM- z!IHPuZM4rBA-he&{*DyXnoy>%jUN@!YT#7g)R*m4n0oGVuEj6gh9_d(yFwdz$R-TW4c0ZFlU?kI5ap87RPJr+qN3j5ptYdb`%JP_R7DLVwg z8RhMPSC7_5QUq!=Xts7VGW+mVTF*g<9{77RP}+F;e1#UG3OuC(Sj8k{7WjJ@?d%F_ z{{-8?jQ-IdSrTcFg~^_zOgk(7I9P8LgNVU$|DMexFp)E9FJ(H|Gx#Uxv^c4Tpgfzp zR_R>CKe%S1S7ubLXng%`0JCQYa?YAp(kRIx!#Yc2hap^gW0HZ%K+k<4ZNb-Ls-|gb z%Uqy;qRspeBs$K56Uvx?Ad%a8Zymo!j#dP~vsqQ&Ul7ghilnNF`HD5}yN> zsz}<-=aKoa-i^c1UTtiOKDXh~6^=)f-v>toe;tMJk$hK^@QS^TTA8I{9Dx$I{O&kt zWi@U|++`^I^f2K_LeOgy6C)*=%{ zXPu3#A&y?+fUbwYl5M_q^s_D40JA(5y`c;2z_YuBvOA_;ZF}*7I>4~C-nZqyt(gzt z6_%|66OV`9Juc z*i+fApH+SrS(lQ(G3Dr_y(V2 z=}Co*fz?k4k%N#v<*Usby^B%p&yP<~Wa=c&$(caF^aRi2^}w>yO{MS_|g|AJ5m>LAuj-saGel93}+>B zQ=)NjXfCYnhHvrHV8#@K4T71NOGlmj+wwW6O4`#59Iz>%Bt7f=BaM#vNao+S6@*%& zF)|Gky9dnWORm2rL?G;v2JW9y6>BlMLum&RYpi~VTinmepVS-YB4l4?EzgI)|5A@EliSZnU7>Bs2WkuTQDkb|4Z$oFSWUm~W*ej#w z_AjM;Yu|uX((-XA^W(6PYn|-zZo6mU9c!+3n>e4*@RHdg=GafJ!ao=tP7oN>Syy0V zo+g{L?Av4eW0fxNpdqtdvvyDIZx)OQCb6GewRk$0GnF_PsrQH0lK`zvO>>J^q&x-hN3h4wLQ+oW6gNOyYt7^Rj`&;Nqbk+d>p9i3%Nig{#I)$+PYiN9;uJGF+nXzqc(tC66kn%^Zo~wYu3SrQS>{EJAqZk@47tX58a=LW+HUT;GMd zy>tP(rcO1Op!ybUjnxN>YV0L3v>mW<0&N@+VPb|tY*H(YHn?$SiETG>*Yvq>5ZuE<4QP|ld!$stIn?>J-L!nujCSzNfZ{s%ae+=a0J zAo_XaIZtweMAjILQgNQs*q&?dxkZ-NY^}8!GP?39Mtt<={%aD9X%1KY{mYpmGm1e> Sl8l5bdm8$A%_`z>?0*1umMK*L diff --git a/public/config/thumbnail/thirdParty-ammo-turnCloth.jpg b/public/config/thumbnail/thirdParty-ammo-turnCloth.jpg deleted file mode 100644 index fde43b71d86473d3d4483290062765139f99a170..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28332 zcmbTdcT`hP_&yj!q(~8wUKIi9U5Y?N1Ox=6cOp_lm5vaIO0SWw2t;~s(rc6|y@%dH z?+G)*Ik>4jH|L@CxgZ!_b z-XS6+BqAfeNBlpJ{C{e0{s5>+080b{gap)pJJbY()C4!30CoU?farhBBlyqw{|dn! z!n;KGh;PlffBQh~gIn_n32%)iy0!SWH}JL}aF?3s;bT$7do(&$#82EGiG7LBBH?^h z^_Nz66#Z2EgU44=GCFz&MkX$9o@cy#5|YoQq-A84UMs7pzEM-x(>E|QGBz=_wz0Ld zcK|zjdU^Z!`hD^b4hanlkBE#)NK8sjN&WsKEjuSSFTbF$sQ7nvO>JF$Lt|5WM`u@e z&%fTjvGIvX|3dbE0Q*02%>u{?32rBkkQx94TuhzCU*`vj``NF8BII81#Nv#6pf%h! zW@a-a2FGNf7qD9Y@>)Kq4VqJV(R@sL^hz6I-}C*lKIXG4Vp|ml4zz<=U0VVNoVO7* z_B|@~4>eZdkIa;(#CH{eZ;>9|x_F)cx;3Qsl`&dfb>=ujWH%I12E!C3`|Doa3+lM) zYSx}}LkWdH;KlSrvf*&)_O6^yJv#n~WXdF$W6MqymV90~v=lVzk9$k%vh}HzWwbm-0Omw9|f3}0N zu=4@rpCsK!DjW&YyteF+_&4mBF_ZTO@HO1h37I|1cxv#b>FxR3+`#8`{BL;wf|7J| zW>tl50JUpV;%!;p7(!5JhEHLzF|at32+TAIOiEUqGY!$a(s$JToQTuF@EQS|I86-o z*>G`A+HR6(O4I#$N=|>_HL5W!7G)XiN|>d{yV1_Ju|M?y4+?mm0zr=QB`I5xIz<$p z;>r{xg2vuG%IxVjy;8|xcI9%mKb9{F+ANCBu&EISBWi{B1y`EGCcF@AyGYf8mb1Qc z_jyR~(U=!l+o&=J^q|JMZ!$<8r-xDQOtA2~>Pj>xZ|?Voyx~L;D4X-XqU?X4;g~R* zMBGgU6IVw}w}~R3Qx5xYH=MEd7PsED9j-9DU^2w>UgyZEiuL$n*xyw?g&ak1-y7~s z)2eyWI$_RgRJ*^~h}^x;St`!XOkWBZdMKYQKR$SKRelL zghM(#9c2+w>kWxqE&V^f2CA)nC_;7&9u+b4NiIg@FEQhRd4HtXWG1GZtT>NheSu<* z+wCEf6`lrs@rLpD@gwYvnscgwtApF55rvp@Z6X8%6Y6R6-EFkw(;(V)|?*_7O}z3`!-SNAR%?4|~TX?c7DxIFs? z#K~RnmZ*%ei~XqQc_=vL(qe7GE}kCKnW#vFitS!} zi7w%Hxk%+Cmo=*Rx-!5f=8>gaS~SQ%`%$fSw1mx0Jfdn^maI6&QMuVtuo+x793Ld? z*K?LS26Q;Y+QYxj7DUNulz<$$r&PvWTl?trTze+cN_ro+;qYh9_Tb4qGaCA1f203=R?HX^u z!pYfiaramHUa#~<<7#A5Mw#cQf~%Xua1;Ms)Eg{!`QY2W=n2B(UTH}*NfAKU<(pi~f+ zI_ycNfIWKuJjxDzT}oQfclp)4dqrHZ>FWm-I|38ffS-9LpRMK5xsOB`n;^tO$oGut zyypfGilCO$Ty}#gh{tIvbu5y?I#Y^ruo;{688*cIb>CvBA9IxOkQaOv@3PV@E#-N| zXS6YYIlMx=CwQgXg|2RgKL9!i&sKD>lR*qHbWh!gvEn-QZLO*a@A4Uh%J2T=h>!j? zD@#X4>Krwsr5m>%z~l&4%akgGyu2<`Aj58UB8YDXpcr;RxsmTCn3&i7D1LJ`Mg7UW z_Yp?aD#`1c$Z8uE$HXjj;O$l(Kj$VD_8G7XNDiBQVX4Wf*Z7Kt>};esqi;Z-Z}n9L zP$F#D^k+95{T8e6$l<3QUyLB%)tkV!B z{TG^vd3~NY0Ls$}EKh2rH-g5ojeA^<+UYF1nfGMQLU(6*?vLq$O(w&as~uKT5orVA zj0GZ)K-NJVUlNQJ8wtMR=v|IZTq&~~lh<{zKz1)mD2KEoUZ~ifo|l^s@6(V&HhoANRVOjDh~>h;x@&g){MOrRfNW zX=Z_KZqUCfC5*80n0M=vnK~p@ zUc<8OcKNUyL=W|-r>ddDeijRyjqEfHWw>#5;lO8p_39CGIp2Onb5g#1IXIP;2~J5C z(rZUJX_G-7v`(G0>YaJFjB-WsyHzC)yM`$%lr@bkEHTbjfLz%M2&r|Yg z)*72v4rk_8>}s#Xj7_2TJ3dP^@J{!og(dSDb!WuyMZNnbHg5=JRZ863zxs-~ZpY+B zezkqpc}dug0Nem-)aYm)F$RT*^YTN^&#h>-qU;hioy+)l-0sqQLq z$gu4nRj=b#^yw43l7%+)-TkV>kXCh5#9y}vF^0AAmS@v?SIDRp7I;ui%9GernmnE= zZF8&(#wwnp3VppMlFwuyS|}VRj;y)tX7!@4E{*0#SD@qbV-z%~hoQ)(+lUTeWi$hfo)_j;?9f5?MroQp0{<**)TSg)wF+yLCXDo&~ zC0un8QwgKz8N=L|ioc{a`?iOW7t0#EP8>hxz%n1qG8I02lr^%D?KAt=?QS@-B57t} z_Etp-Na>17vNcJzpqi*G|91oxNt^Djp2$jlr_ujYI;nepZigsW7b<{kl3)1e%}H+; zH}wV^&6+$N3E}#s-Y3P_De!=*t7!^YT|8G^$#(>@nXJY3ue>O-t(s`L?gZ<={j zPyskCT~}!y{~olsZ{aQ9v3%ZTf@cjHn=R;~pjw&iF8SrS2pF#^Q~xVyW9(MC9_6?B zg)8Pk`L8wVzB=))KsfnI(FYO9!pY(+u4mG9`^AXGX1G))%IRGO*+{r-?d!?%z5ROY zDPcK-D-mq?ne$ZJeLv!kAThM&WPTAeKG5pPp|o_^kUf5PAamz z-A_FI{hCgT44OW=3eDH=T;aoqhf*lZ&GbmsW7Q2E!IFam`}L_ikc?Ge6dNm6>IOjc zd`v;KSE1zB*7Hl3>->T;2PT`e#140^ma5#cJMo)*1EVrA-*S0YK;J){b{Xss>~G%y z?p`YiCZrH4w|XId{%(G9ODADLQ*@xZgXU!*F+>WT-*mRfhFSk(LKQ9~@L@uty>6Fi zVw;mzEn4vJ`-WMPzZ;E1wY^#oT`d@WR}j&7RxDN5q5zf@<2r1JUdUzRt(%hLDIfkN zlvD7Q7O5I$D59>@yHICvm*BH|%-AMOM=yy>o#Mro9nKP4h3<1>@v~kbZcjo=E^w+h zrM{awoueT2+SQhFN{X86uMer3zX6EH$Nljw@N12z&?Squ|KgYW7eq0>0y>L}&BN~O zqU4ui*74ILi`_QksIdfFzs;!E{}SxXgERF%|4CHI&?9Lr6#o@@tk=j2BQ4~D8M?6yle%e#PZ*2Jt0j9~R zxt;q!zY6wkykNMt9bms@{OMa*U%~8a2>QSUYmFxzE_C#5K;pU06v<$%w2{uR^2=`H zkkI`nK21hA8lIKw1=LG8^U2wVKP0x5KHn0zkD2<6(=wEK$K;th@T9fG9nEhJBm#vf zK7445^B%SShf}*(l{BA+p~`$Nv&4Y!y#dfWb2!Z?uy03_eYHw4W9VPqVk@WC^@$fN zjo)PBKqI}ls} zn_pM;IJ`S@Hy|^N7fb(SGGzi$$K)qI-xZg@*-k#c++a=}^k7!y%f>%KgwvRql?HmUUuo6%lCt)BfGjAc$% z@bgq?QE9WvpL*%bWB6FUKBu6X>+k99+cyLTrQ5fAQ#1HsJ4feOU~*Jxkn^HrdE@7#!RAnB@2aDKlZ*RX2Z%v9zFmY-4WDA=Q|$^If;=5(YXzKgJcNebB3l|2I;MN>B7 zVl^CX`j^Z2H6yx8A@b;{AB-zCbCGn03Yo^kM`hQ!cI6o{`?MoVwTSV(n!9PcE5Z?i z&c8qjPMV5iBG84q>|=TAY6>RA2PvcU9ngnC_cVYr_K3+cZtJiwYYnr^*L!JURnOan!Dkb0CiIM|*;Vy708-Z28s*Gx-Va+! ze{x}ekgn;AW6buVs~LptZ9Lu$jWrDr944t=nfC0!1UW7RgbwjKx=UZEd7yga!S zW?NnJQ?;^ItcTo?`Z{+t`=ViC*dJ=-;j7hAAY_vb=?CH-85&QU%|Qf%Jvnr%7RB}$ zmT6)V%~ZZ>1Y~HF1`g45LTg|6bzkH*qYY}a*OveK4D{@1dUxlUIxW=V1~MrH5Ae$O zhht^sKFFLb-Noaq-P2tD;?v!YP9s$V%<>S_r7U_2xM5o?Ei@Z@{%2{f8a(w*x+Q@p zn(VLoYF3YyV{5Hyu}Cs$yC%CS4vIa#y6?aygOqS`3uSUyp^vHOo}~?k1T)u5akV*5 z2~WDq_a?yv8m^0=w)2}#-!6;{@ z3&_!(Tjo<#(Sf?$gI`P z+K}!3fa%>D;1@g~W_a017Arok_5qqBbzwXVnkCAkN# z1R;vU!rKNiR`WF~HRz*|@x(@WY0wBesRA=j4yKN_|69UN4gR)egruJDGnBD+%7(Ww z8$n))Ja1&Yh^=||6__`=9&^1%YYf0iMs-kZ~IQ!y6-dk5RHlcZGSgR*<2l$}v z#ZJ&YO&TK?sSck4?V53~IdK;<=|~1K&hmvBtDy}UxkSqpDuQn-?&Wz>gF;|^M9bvm z?oyK!et018YZ;%Wa!taRl*gRL(xww@efSN)5fpW+OG(W217S;4CodN0-+e`qobsEI zK&~1$LS8XwFl{=2kg$$l z$!3N6$$1QaP4NqMafmBD5M7Vct};+PTj=4$H!+>(^sN@5hD1H%drNx;uD5xnnS5S* zw5@Q2PP@L%X!X?_kui?+sGd27I1OHaV(76YDzMv2Cn*Pn;y>zgb2Yw`yX#Y|C)E z9`MdsKBSYd#&hb?fspPSuSrgF^J`vprRg6M*uTVm)=@+IktHd=Mr|Aa)s3%zy8-s(#6%SmI)QXN^k0o%kZwbnc(aE*P~Xie7eut zAPI4E`k7QK7W`DcK6`dMLzgW16&QyFb4H0JN++YS$Nic`>eed2z3yM`79x3CWb>VB zeg4&AyD0mvPoL|?P6Fg*jL|8EZ|o99Gc#l z3K@k4MLpIA%!2m@Z+*x%+W3MA??E1o6a{02;%wzhf` zE_r;EIwT1EPjyp~$ zs`bT&9jhFPSs$q|&g2aGZtYq66+|aAO!fv4QVJpTw1+}-dnt0`t>SH#W8m$L)*)rY z0rOkN|73E9letDDOQ@o%#kP&8dsYUCl#`yK8B|E0+Q&Cm$6;x=8W6U<^Lqw4%$oAC z!(l-3rEbH`ZUu?PaqmyHu}@4sXk2w$J6#R)0>~8A=o8d>89}Cfacr4Pbor$zt#Jb? z;?xoD=^G2RhKsu=;(HLnRcRxAteba92Q;rB99k31Jelk@=`Chsf6&yx;{Er4LVJ=| z1yK{@!t0h_(LdlhD5@1+l|J_st2eheIkyoge!KbI#&o6ttCRdqjlo75;4<^>YDagM zZ!w(Y{)G#lq3x~0C04+VC#5+;y`W3`3~to99OtTW1CSo4^|?ZJvd8Vx!6}=PB|KU< zPL==6xcABXx$uR#MYt#@xlT6SYht&>-kcu_Sx+l5BZ!os8%lfeM-}G_Gde3 znQZ2<)fF>@aYR6FW718M_lL@g$K0n=040Ass!BXCzU8AN!!*>69nkY+kalviZM^ei z?-$tH@mSN6edZ1!Eu%zPVM-h=7QFHkw$IE?DR9nv?&_A_*B4m4U?N^FZ7we_=mDaK zJjS}MrhL_=^|QPmUcbRjsShh+4N4Zu@u&3je>n4SI}?%kDD=InsKfn3$&pEq`0G9S$Youx$1aSC?FQCoZRD;eIeum>>zDbODzvJ-?x^Qr|Zp@9W*G^LxEB131Y9S6LYKv z8zoYIt2?H8fmYr%Q%P1W3Q5yeda<&w+2Nw94%dw~ME=y{sBMkKM?9(LVfRwQOS%fl zN`5pHmoq?tm^8qGrJ2&>5-+|&y{%ltn&EGgwol8zT)1r4e@E;zi@QvLf8m`?DX9T3 zSTYhKZFiT(TA5s*&vt8R6vclcZ%S8i%~+|8zX7zs#_@!+H7(8>sUMKAU%O|k1FeG8 z-8vuMlU*y8E*Kl99GD{L&vrM53rp98c`FYTx*OsAzFfU!(f$^t^+z3rz;KsUGK6pj zoAKrKGtVd$N)Nl3Cfe?5j<3woAs;-R1jnCr+3#}(_ORIvuA#lVzZ4WNOk0>K3NNKd zN1q;ck!5cf$~G<}5BZ$09DdzlLNS?SiMxfeTIsY+WFUxTO-SatozCm6~u7rkQ3vV zVKZsx8*5FbIPbU71a6dgowymlS?|lnM(xr(evtlnIoFQ|Lu;e?ufi=KYi+9b-ps_M zLuhPR`0XX~+t1)edi$NtJyJ}fDTZpVYUS2x>!J|{`^4sH|90tZx;GcYM$pZVOTB#g zv5x&I#z-tndch!}6dn|)J>?fbdzzk|XpwdW3#!CU7WF!K-Fm$aKJ{lu6!nC5Qo>n! z$&y&T-fg|2eUa*qsVW(17iHQWk~F62^que-&a->h*>(XHEI77tiG8)4KW&u}(*wWG z?+I|SU2sfon@g?=$IKHmbO;Y@>ZV=M0zc6;2b`zQk8XbOFfU=mse?b20Xa7hBbU&x z+$b03+6u0KIIo6>;s;S3oo}8-vwq}`aK#}J+0tg)t*{(Z3F%b+Xj4lsi@e=_L4^&- zf$-Pmspm{SrxO>|s2&^*=UE$8Q6SL~P9o%e#V~?6gN4~&>Av?C2;MXgh{7kVfO28M zIMW<5#;+Zdu6?wL!EV13&q0fjMd9#jXJ)sA-KGij?x2GFb4<;(-pi)C3j_oXztDLBq&8?SG-Tv1N?aZM(HpAes> zPk`h>eIP0?AG27GolU)uGO+hyB0<42w9(~jHLA99Z84zMq9s4*U;HC<4ZA&h;|tjC zm$jD;MQ5Nku*_!8O|M)6tmn`9#(y=H zk)H{NO$9!`^H~dJIhEd3|Ch>8V~s`pRba(T7FJ>e#CspG2pDOyK{;Qkz4)O`p<*iG zJ{~m4_F#N6|CZvwsj9h0f6rnO=cB0FvtoXIPpF;ZF5RciSfHIY>^woP2?~?gSC`9( zuh}Q)$tRh+oODpW5=pT&q$2mo7N$$NyA8D&p3 zxvPf>O8G@obxfewJ2lE?Zr!EcXT1q#J`k#NO#XkGMc{Q;ISu~btNV0I? zinZ^YrL8<}F)H{+R=-gHUJ=wep+UjV{7kiIRuR*)y!a*WV5CN)ppB4()hO6RfYt7l z*W>ltDLmE^h|z1J0DJY*NjsTw5q%FxG!u~h+L&J8$*Gdro0}jxwl`zvVfyyrP@tOp z_I|b4=6Q4qoE(L;4;Xwlr^XjkR`o6J1u9i6y7dOozqtnPJItE$F)(Hn$q5e-BT&H+b|V(GscJF+G6k9ZM?+FDO&59(!PM(Ke1ZF0*tB)$ZE?*CC?hU}oPo4J{Rt5N?Y;z^}YP95kQK-bd!8$cCYJ6Nj?_O8mvIdPMs0*-x9u{@kl zr>sGhx&C8 zSTA{)3g&KQXH$6CX=3H)ey)se{kR^$auiNnq<`0{xG(H^%&&29QTNbp;FvsCi*6$( z@kBO*ebp$s<}d}P1PNyJwWxpUp`eCxzzk zMCL=oE?d&L*V?-Z{{4Qb5b;rU6V!q}A3N?6h)zlIR$=(Z^GRK2Ed$ZT?t25^lACP- zel9BG>7PDYV#K#27;rMA&FH<^pk_8L-Gvxk>+7jMJX=n;=@km8nT+yj zV+xox9>9+Vg_FyFtWM;Z{&aMATr_3;@?}k(GT`1|AZ>n1KCke*9LpRsz%#(FJD>mO zLde4~NKnbf2!gkkU{udwJfuBmX{$oh ztQh_d0fs4;R9&6Xw7gXamcHgoTKf@F$zWF}LjgTgK)0TJT~)@^<+(laWN0vmSFQSc z7n!-pyAx-WJhmX7IR&%>MKmeL6y?r3q;;&W33ba*Ex%+hb7MlMTr%_vrw7ptLe$V8 z6fAr{?YI*}+-9Y+69~rfk~ds%AaUY}?P9FOpy%fZdTs z$bTIP*<0YAg1MwSeG`8=*RsB?VoD31BY!1XZf4)c2ZcMz%-*ExV2oloYZJJh&Y3+H z3u0WJl3Ta+&H*9ow-nxZ$-tShx4v0$tr|oeJ+9L*ar#5Wz%{im?5{SiwgK4wV^6FT z6Llq*7_u7ur)5g2cx$;LXI(4LuD(D~q18N1N24fxN21YiokFUoZkA`(bXX_Q$asR2 zdWY>Xg3BV@VU_);kHh~Np}dx+btgnIV)!u&Hyc|Ak>*vBb?uqQ&nvw^v+>$+b)l(% z6hXPiLiG=CGm_NGZCrH>A;oy_qu)Qno2`wCmaz0Ilvyksi#tTwRvG1rgPvL?m8;CH zCi_sz7M`4GzmI0z-x)}k(y#e}4t-}IWq>jM#O)MjJ+pf`-Ib<`{e`{XV?tKy*&TP9 z&6w43n{X#~Du|{-*tvSwekJ?UZ(qePMwte+b#1dEU2KbX#IM5y*$&jc^dx+v86Gh# zcC=8`^O#|Og>S!2lR|t^5GzAg**Wh?$}5D^B52c_EFt;nRMzGF$sIp< zWQ$a;L(sFf`nvJ=uXyaJ)`i}sZ?2d*Z!2YViaW@-RG~UY4%J-Eny>g542bD93bOy-2r`$=7}jl5B7PjX%*#?NeI_T+Oqr zrCNExI(4h@Io#?VGrzk~tk3UneFpS1%3m( zL;Ireq1_JkzD>84!`LON7R4%_3AS!K=TB0RHTKsl@mLIKDBa}57sDU+sJMfQMN_gu zp4VcoIl87zjjfA(iWCI(&TvUSc9mkX-Qohci7h(A2H2c1a&|Pdp`}|NzzrJ33GP8D zj++z`K`0t<8<1_e5rg(Kdz!Ff>Yr~Q|6dk#%~kGeP6CfS{9`@tUi*P z>V~4VV?AcoT;&K>8_IJG1X=3}=uRT=4AND6=;5)frSd3+IB3a&NF*F7SVos z_0v8+Vx=h0U+ij_3j@DZy)n^$_&2bre|)3q+|Q!9j>mVChWIZvLR;+79WfvwgC9yi zFC2sRcgM!-+QQ?_1baq|(p_8PB)_P=)gt?y{)i*^a%x8;gXx=Y%(!+bND{vqyck_= zNH|r9d!}{m${Z^4f9F0**>^80_v3mBe<_Zvy*r)vb$B;W!1v}-r!q6oMO$^`G=#Tg zn=X~(lwPF7{`k>F-h8S$jcM+CM<7uf(@qZ6io<)3b<^qZ7dS0Ztgd$+RkTxX%iP@M zj%Pn%a7tahXTSFiAY2ebY}knQ{X?P7?-XFdMq%G|8N=pMTM}0}M-VL6_8Xu>rK?SQ z`J9luPuhusyeIPg`t!yjE8%{=i~^G~@VNHg3oXmEOdB*=?z}_mi!&MT>&O=S73cEA zGYZ35RWWtLt=yxkodX-f0QQP?kYtAYbNf!|uE_5GMU50u_0a;hZy|Ojg*jz7bMAgar`!OYEtnGQXv7nX9 zgYTI2mhMQcNDr=e8{x44vdkdYaP{_gW;@PZj|`V{srl}FBKf6X_FR^ep~uD&y^(hf zLou@&%iOtNYuO4*?xTT3z3X6(*08$_^9 zy>nhCl%FzOF8IRe;&E_+VRR-_cFnKZprRQ(&jKio_kv9o^P%@K=8;j+*v8V`xGtw_ zf=f}m<8HL3Gok-Ti7lS71RvgS|L8iyTVYc)<>1pHXmmEuDO1Vf4{qVp!oIed1r0NV3z}g{ib0ZanU?`>Bs?ozI-#AjN8D|qHL+H9mw-?*2 zBmID3*b-u0nYf1;Mov7>%5AsyJtupsywE1eWXTI##qpj-qaFL)kRQv3SiYrwdbD-d zA$t6*0;}c%4YU?h^nLoq*^QI&{)Wq6HKPW;M{JE1tMgY|r}4;6*-wF=tTqEoH8M$o zwPS`L@hf`qTL~8%%vq9-E*C<-OG?t)3|@zcM>#D9ZwInjlX?SaQuesyH`|Ux8Rq2M_PbMWfC-ahiAHc;) zb_Hx0$Y@Zkyk-V73K&yEe`nk*<+Ww}5TvVTtZujuEet$TgN;xjT&4V(h{2 z?zV#P7A1`Km$K{B?~?_z<3IWo(tkIBJj6;u|4wOV@`D7mN+ z!Atw;_sfUHx|Eu!kUj*Df87(Gvg!yTl)UC@N2r5H8&cloMO6r}8nrl9cq=T9S^@)M z+-+*H+2ysWKb&N_n^&%K>?^j6>cr{VyFNLOR$bn?=XBmuA=6vk#8+++QDDisJ*Wnm z^=H%Hn#{v=WtRi~4J!o?tDjUrZ_{sz2woBa9s%C{UoJ{TJN}m8dGk*G2RUx`)?n&{ zgQEj0mUkRGLz@JuD48yo&~}t4w$Q2)owTDiqr!KTc%*@$0Ygn$?r7X5t=|zlTXGwb zBcDHH-mj&AklVb+Aw6kZUBOHvR1T2HrgWzFHXyy1p9VB_MT?{lVX+-HE%~A|4HBs+*%+YMoSE=Yo)hw zc@l!K2FoC7PA+6jWi>BzS^8r(RNBwz#$f?UwwxwIK0l)~E%e3sS|AWbS$o&zd%+=_>Wt9Z+wmqxN9Cuxo0U$$R5KLW&j$q|M98IMg$ z47@w+KX!T_N(~VhlPv5u;nas3*j{KK(c%sKe#8%l;xq@)f+hi~&n~)yj&L*Q(o9tq zp)t)YJYCVWKb7kdcvSH#u8_qwM^1Ul9c$jvGz9PrIC0>XiAg zazZjzM&wq~uh-+`JL$0YJt;T0qoRPBPe*u~-5z8(m&d`P8luDUGtHthq?;F1w3C-q z(k*{_tJ18v#WbCkif)UU{pF~M{qTI~yA9c$FAV|Yo|bu(VyL(IIH7SrwUs*#yQVp;Ys83u@F(?q?Bk zlmx2`m+z4>8=M_N3I%*}8p-XhzFMxN{VuCILJo)@*y4ZEbHVNj_k75G{wmiwFUDCg0Vfc;^? z?4ehy_F*P-ic;qf1-4r9w+dCyl!sW5HS<`#^C1F+S{z`=^ z)|(?N-<;4|kI}wyNB4HL@9)2__gaz~>eu)AaKtio|4_O}n6nT@^Q!(qax%#cz&M71 z8f&znSD+iRAj88bIDQUVwfiJQOS7)yyBh%QNMiyOX%px6m=nmU9H{A(VsC}k+y&*_O;Hc^1v{6d86@Qp{W(bfAm}p zJs?AU)Mi7Tvl3G#z|OuhQ?KOBs^0A&VvKfIpb8Zo&S9J)GnM?S3)P>z^IX3nZUkp^ zq(3#gXt(D?%+&OUu0tcg2|ey?f^OEm6GZHYh_~H}kh|TmA9HZV*De95W;Mz?Wy@SkERo?9rdwEw<2z z4^ZhPD=0WpR_%6PQueQ((Z;KyKseZJ{dHjd$uB$FTRzqWi<-2;-eXA%p-$NQ`sm$C zcANATr8XA(3m6jd1)nS*56W3)z`z+rk=qHJs3Peq|12s>qwL($W&-FSxXhqSZ;KYArm5>|4=oV|K7Vl@2S&`E*;0U2Cx%p zrqOS#Ub1DNzj`&HZII5M>lT$(dmR!4KT!N7OLumI^`f~K@FtJEY|nGb+7FPTEw)!c zHH?rj)|j1$Ck}PReM^f}KLFn<@zPW(=X$U*d%llJGEDRCt`BwNV!ailu%l?D?nQQt zYgUk#)7K-dVej{t?*|-E6cKYm>kIGiUJrVoNP4pDUcd>WET0Lchh0aVB>RJb$UTJRFJBhuqJdRr};F*{@=d z)u>``-LQJ-InKJf;y$g#7Y3FJ$>Gt~03YnZ_9^e8%*(^?S8lMDg&pe<`Al2(nRK&`CF3|8I_49y zmCKv!9G-*??O@FG?(`g%2Fb+ACa!BG{e0&WWn?NbSGB`Vf#-+*eI>_7l-fN!^J>+! zCM4dy7@R6HXHE@odDPauI&HMkVs)aj{C0{GV=nw%`~LItB15f@mgdL}P(T&N#E1b4 zOPxw#m+Zf8dB3-**)2Tjl{&~dxu+oJr(}d)A4DSD0$1{ZO(K4A)T9C`FUd;{ntV97 zLH+5Pw?W$$-l*WRkjudr+k8|RkjbRfjH!X^J8W<>+KDeP#{bArjfV^ptA(XSL zjX!9di4Jb15RASyJ=hN$-ls!7`^kAgZhHfu1~p;jm$e@*d(KNe*f@$~lgQ0uf<9W$ zAM^sIwb)~tL&bxbyU<9(%*RGBE_FEhlZrFT{q(7DgrkM-sC9H#CTrXZLC5^e^KPr% z8VuZ(|4Q;%{!c^g!-*S!JO)A?QdIu1Bzh~a7$m-R1NhuVgjVgA7aHzT5XW>fxx&35 z|7zs+GIxaL)?I0MuzD0drnrJ=xtA56JGBYE6ddx{OO?SB4xoxywPi}O7>CVI-GawJ z|Jx&j%)2>BsX;we*ore5EG=qKUb!H2PW?NFarsGaADZ}XoI$IHigp>~-hEg@4v~?` zaru}j1h%g(Q!Y+LQgZyXto+jV;FDA=bQzv0GTsYcxdFrodP{pAD;7~b(b;3TL$wX^ zOu^=SE-Z`9UEO5W){Xn50%fXN#f#paQULzZebXj{7Rs`VuTvPSqz}0|FpmkCT3Elp zYot9zH$>E3fdNjKtCktcs7qda<)U`PSz_jNn8vYq_ZQagZ#dlN4`gT)Z}PH{ zD9<(c7tfux<}hh(+D@T-?pp1Vro!5%9n^I zsb7NV9Nl+ya2nX!;<;S~{-bHr`!?J?%Att$2oM|8v#yqbdl!O_u-zwp5RG*sae4%&NO5vsl*80d>w8TFAp zm}`CrHw$h5--XDkOD4b$j`;?_5qtx%n7e#O#2yJf0y-|8o-K`i7AgEsvYb9d*lU{4 zU{R~;;40SBXznpTf$)zN8*X_jsw_R9c{fC2*TYNbgNnt>e_vP*W_GLUB{KHm$Lv9+ z#u7&LhBQL@)#aj7A1hYU?+N9Rom9O`)QyhTbjwjl_^6wY8m4RdQhJbE>ptKiw#xdY z3tBE?CmRP&(dils+JEy3eA)FJ7FI-0mZ06t*)1)(5b*60!4^B=0r5<&ndM6Mx1j9L zvfA`m5B3LJ9)Eg&=%~Go31dqlShu9Z_|z`5Q(u1{*sZDzRnxr(HX%464h!OeuwlCj zlvm&|1(K>s)HEIQlxFHXnDRFdRb+bLqzy$|Xc1yLjlJ5aQ-vwD10Lz?!+b$!R2*Y8 zV?1$Gve?<6+j?O%?}RnNle%YNg-#`@QT=9hu^s&Vi8Vni2A1poY~k#G%|Q1|_kvBT zhxW>Q-{j9ZGsUD79xp{I2+O{`J?#__>YNdy)2};E#f+_8(Y)W&M(^^%=%EC^S9zP+ za*oaMFzcX)wWy@Xw6F9F#|rD?Lz>@j=^vnnE4#TTY;sHY#%n7!{CuMk_WiAVNDJ+b zv>k17N8=9fqXyPWRoZ@*16a#0&+Z7`yb~**wkoP$Ipd-%qc$rFZ>})Nzl}Hy*9tQ0 zk3VRgOpm81AYbx=7gnee{&+8XeBGtYUF&3xlK%NwdOXC|d5%ao&G$UrjjdVD!VK9n z2`641ZXX0_(2-8a*Ssn{p`yS~n$}iP`!#or&Z`vq&YL`+p#;vj zC1vtc6)V@e?JP}QWPI$-;~HdMx?TD#ycJ$t=K`1W*o3gh-T}8!mp^G~egTSVvobEo zw-y%5>ES$|KK^J)94yWx@v(Nncu=Z*XV&EW0Lti>^+(2yz-~eW%ks9Qy+W$9 z6qQ)7d978+&jKJFX7RS#-*P%GY%ZDo-+KG5sHWO=-5?4Uil{UxQE4JgdM6?R0t!+j zQX_&=BE3T(NbiXBE;S%RRI0Q{@4ZBtKq%5lAV44??)-bLy~e-S)jH#hbFMOS@y(er z^Og5$?>zOM_J;o+A+=4}(k|yk&kS})y&>phjk{)zaj)*=Xm74uw^}0n#EFbkA3TN! zGq2<|zk_^SQ4$I+OzT$0Xf?126y2)W!HJ#N3si$L-Nt4eT&Fs;P`2upPtXK+Y@G%H zmZngB8hY9tS#uv@j+6OFJL8;gOHCbF$bQ?}93a$-i5DD@OB~Pdy~(BxYR#v=ePR9& zKHiK>9y`_o|f01EoYe zm(YPa0oFL55}h|5uo?Y@mv81?o=j84g=c)0eE(&>a-Z=*H%*IV$CFfZtslO*R6^g! z((aM*&nKJk3ND^p!bW^QkA~T2&+<%&Mw%-bvbPV9N#&&c);{f+&^l9)=sGdt4RQ_# z2Tlh>bk^CGzvH>YbILS+fW$Ai(#`+oW?gj9njben@cm}BBeSSTiX*na4)T?($!|@e zO#QQOKW6A&%t5DNVshm0_21-kf*0DXJN@C;`atDp)!6;!QtGtvCjD|k>Jp+pdyq5!bJ5`qs(hS4hbfq1 zmJXjuiAoh{SFFG(YgwW0$qh+G zap=tnafGi!d;p&q&Osj6}&+Q2>0lzLezHWdr^CQ%b_*4*>FwLTf_I%%pUeXOJ5 zp~6MT!k`$;igTK9dXAUFqGvppSVx$~>c9F1(AmtJko3xM84*<2AsLo1Y4w@@B#JXC z2rul@el$T4!B$#G0Apt2hQg&~JZc+d*6h4X+2_D1oan~3Kt^01P?JfNyQsY3l6-fD zptR6zin0PQ!ZEpFBL70hAtcYB7lG6+*jFhoo|CZS{eJtNVM1Dy8&~bZs zurZ?r?JYfh>m*4rn6~_SEAoi(lFlaKo|GZMn)#R)#S5=Y*Jh*-E>^9ux>(X^a)-;z zWRfORDq%;E6d^C}8$pxHUt?*6EFKh3|NQV{zF-TurI8Z4=UG6#+M=dyf2whoqHjCd z7ygR*x&HkZNnNz?Ayhidx=hfOg*%u~NH5apxZPNHoYxbmfZ-(MhVhTN7PYMHA+zSb zm%<+4oV)#Jk+dYbN#1doyd#epAp~>h5yRu99gj&RErDlFDwy~T>3G(NeW&wnh69Am z59KjA#hMqq_sgQ8OA*g?Fi8t)SX)bL{nL^ruQNQKmaYJg)|{%qy- zKB#jg*O<89&jTBK-2GuduLi~)(Ba#Cf?de5w8#+G#~RV<8EBgKAUua#|$}YCk&WaF1FDt|+Vm56D z%j1&k4t1^A&iCHTtO6;wdc2pUiPsN5FAg@`+JcP4wKdBi*<11RfwG_^`w1Uv>)h2JDK zDx502b}?R}GdAguj+q+q%4xzJ2SyyF(Jz;~(lT1Pt8+sfFYwn*E;x&JXTn<_k<<#H zN0tm}56~iFi-}IJwM3lM;vX(%`=NJ%kA#sDeYlf3SEJY3S`THi%{`y)1eW4_5SgOc zHkr0VmK->NC?zhx8AJ$7-M?r~fo�Wwk)K$SNgB?xlvN^jS*!s)??%`m=6*gz=?$ z_hQ+A-7K)_k&3+kpssO)gVxL`0x{=t%Gx#W*ZG0VX^5jI@qvVfOpnjrOw$0E!OGTK zwSKk`DlI&c*_2kJy+Fy{tRqJ)JX|pAChjSc|+9O91qw(?7 z`(06{$?jWWL?=4h#-8EPHfqz625=GKzMK?IhT&MFeEdTQB{i^;tcpzDLiRxcy^9~} zq@~CTdnZK|+?jd(CQ~43j8dP^=dSXU0i(;JIwsu9WPP>4Yf1inmd%%9pDSo*2Qq(^HOy?U==O$Q zIQPGlz5fJEunNTcc@#~hQvXz;hlti;KW%9xpY!Ms=HaOvKVU>lll=quDQhl}U+q2u zizzFE&yF5L)&q=nRAAS_j^1_<%50pP?$zm6!lFW~N0<_}EZ`bV`|RG4dRGk9BN2DS zp6`kEo-O5!{cde^%2fJ|MdGQ-C0BEo9#c*hx;YNWwVxIq)86dEAA4?4?a0oCjdrsO z+@QM9+`e%Py%$oQef91+#z+8e%H(gn(l5g--|%9u=MLe5#G;F-3$lDP!)Wp4O)3=cJh04Rw<)Qk=wZ zeBWDHJmGT=lSxjK3WUNt{s2He?&6(l676GgdTwr7#g)YL7D0*@1_etJG!4y)=fv$j zL*XB-TaobamiNA1qTJmo?F|O-{rxMMjLpjpcreJT%f@geslAW5v9$)v!g;sl-oe@? zcq%epU$2@5&2m@|gjuKEa;u1?kk^;VJ&TpMd*!ksu!s9iPlVJp$SX)WUv1#Ez$fH0 zY+uFACi=9I*rc+{_EMP*RsOSvnRd5dPv4p=EQnvw(j!dJ~_+GJSgV9cPr`=65@GEqiQ==YR$P-`@ z@aqB1SsICDv~^YNNS9eMJFa_;^fr-*2 z1iq?gIcf>U?aaJ4Qr7ba&@PQwww~>Aa6@Oa*I}CPT5QOkn%Ufs3mUEijiFMNKts9e zT_%AbpSI7=8$tpE?p>L@>UJ$(ZiTSu;N@(0$Yz$Y-&>fPu@}obhPW9)7P~xXd2ncK zkm?}7`&70|2inesiV}WAA5^e;J;i#r*^auR?tAS-Ma!tQC+FA1evN5ho^vt4-Usr+ zLIwVHK4euEC=GCQ;0BCJ*RmevtCDZg(gg93!l-RR88!IrH5< zdZ{COylpF)g-}*$4?VY;SiGWB-6EGnJ#vifw#V^X3G=Q`n)hj=;ZdZ)Y}-=dw2}tzAvhTWct6YvCuiwa`rM@--7&%Lns^G}A>815?}G1Pv9NGbmA~ z^$&o{r(C*ivN%^29LG{nlE#}^yI=d^(D*wM$mlbhvv{lQO?8To$Vy64vx4lV4{Ha- zIJr#Q{+K%e-sWa*TB0|LU$l+9yZHhs*bTbROq_D;nx=7W^XW_XYpU`n_P~4F?;L=P z(;{Ia9p<1Y9|cm?N=m*m@2sh>9nsErMK?CTu$^XEeh|*qTF2HWdNjR_Khr00n(3aw zqD>QXHCaX9y~Ki*bTf_U9&~+p4jF-i-FC z8N~3AdJz)t)WnW8YinU{i7c8j<-8)n+zJ-@z*s*l9cvJ40Ks;z``o?v;)SY*=5r&@ zf7eF25=KU7!HWwg=YglY6b9-p=`RtGX#59&tR*K?h5bWJrP*ueGGEWTDpjF2@H2eJ zK#klFD?v%);JlQiaJWhCHSx9NmuqR>K;J-3%X5ftT^bh0%Kn{RdA8^h4WMuY$UGK& z0)JN__L_Th=A>|kkJy1$YxgXNY|lIFwrO${)bntMlrE2)qE81~Pnvu}Lb2?jQqRlO zPo)dNduYQY+*PBm*J7hPuDZZYPao~Zvb4r)^{%{J9HDxby_{!>r}BP;K6GZ(fm3@j$$We2nduXbsAuGz76c(MnQEPz6IVE^kzX>0YTI;Udq%TD z7K>X1HTCkua^I!Sovf*APz2}Yf214S6LR8m4|#BXi>VA7_?i3u54&SqF84^bWnh?` zJ|e2(rnKm?2v?&F6XNEfau!&(ch+Af@F~G|S=jBdaFZ4yMa9*qzSe2A2M|9w*$L5{ z!GFa0UI+}V%+aGbC#h1=hhi$&%p&K=K8G^CBY{GT!|BTIe2W*qUJS*QnrSi3@y7NP zyD?n6g+54yrY!Ggek+VAzUOQ?`4Bh ztzAZw5_l_cVh74~OQ@Yr=|x^o`bg=!^Qztrctw(;U49xz zNLz~9mkTK>OKbM8af+u~6%J}1$KWY+*A&l(nf;Nc&Ps-+L+M~+h7bA2U2MR<+H9W7 z(Gty5WXmTfWnD%Nrr_8FSwb3-kHk($TKm=eF^)q&3Aiz1aANEIwu`1qrHR_o6NaQW zC4F7BMT8Ezrt7E^M=cn@i|FlyB}gb)FwJsGS{hx$SO5HLF4Q8*L2`m$7xL>n_QXQz zPKs6wlxL(Y)3|%GSX(G9Q~M9V_mGC|?i>XQ44a>#!vuWgy+K}~zJgs`DZxb_|Hm)- ze|VA%2SdK?bpT^sIx!q3ug37McW2AYVS}QK{L-|%!Qw*~;2=U3K6EjUKIh4|&z3@L zm_2QUyB1~(Ni7@myct`sPjm%XQoy@KewrP7beoyn<@9m$O(m}f?!l5WG#~t6_`cO$ z0ne%D^a8RE8|NgOtx@U(rw!TFuZNaHMuoQJ3P^&j^92HNiI)|41D`S?Ed;>Oo4=Ab z5DqR;9sQ-%S#U7_v9?$kBa$SJ{`3Yx1;w zdpM@^na>k7M4+>zFeimkQ6Td9JH(z#r}60oa53x>y6ny!#bGRL+xMvv^H%WRG5ZM8 zUFvEIdg;gk8D4QNlbz;Q?j5lC1JDL+yx;4H^cG@Z_XXwvp5Cz14X~qrI5s2H=v!gS zZu0SiEcNL7V8*3KpZa3ummAQ#lnyDj25yDAo_Ds#8V4iO57x+fyGhet4tP?tE56+&cy&mX+j`0b)=K1EjM!yjOu7m>8AI4 z0fS~G#V+&DRJG(d|B%GzRMGdOM~1>_HNfK;;y>P#z3DYs0Cp zDcCytV+h!YxKZe64tDhCer;ZIS*GY{V+04}gh^05i0wTcWNB>Nd`i{8tKg%@QMD=E z&%OnW`S}4Ih@ZKgQ{P-$X*V_~Ym7VF%N!*g;*~z7JK(Jc4e0qMML<1x=bz(UmJ(kG zu`~2(k(F7xjtZKoeJ1^Fk9pW=Z~Nt@$j3ho8n|^<{hU}KO%e?RV^W2PVi7zsg*Om8 zcN*UAxo-~2b{QvK&5Y&NaZS@tIn5;f0f;Yd>vD^hFqr=V%)=2GCoE=NKOGK@#9da% z$9frAMbLHw+)j8J;%X22d#XD5mV}Ekt@b{S{rneSejfH{<7DfC?FILZeWiW*G}gs0 zau(M2qI&W6{P=xktLW4>TyxpEH7Bx#>!`)NNw@i}fEURff1@w{`%L<$=nP-E3g2pk zYXb^#Vr0!7Gja<>Q=$1wai%bu+%Z_aqiCFS>xuPv0sn8EId3!T6xuTCdgN~idrQK! zKvcYM2}40)x(U?T%gb2XcuI`ew{d8p2NoTKzFZKl(HuEN?zm%5As5XEX}Vv6*S5>{ z2MA0*e(vREsr&?*lFz3FEBU{}MA&yU^VMb?# zB*-!m&7=Rm1n#ldh9E|bFj8h=!cxSjw@}Z98gmD|t|`cxwE&LaH>+FaV$AEZO}Qs~ zQ@cAyN9v&GO?}4v&y}VKVdyEEHt5G{y4{kCM~Z^0v3|4`FRJ3$Hbk(`Z7p@#53P0k zzaNcz?DYp!D=(t~Vt~xYyb3jC;92CjCB-;DD`*j?@l12!{^(RY(M+%i{I+| zdPE^h*N1Nuzm9*fuIkw1c5%i(+Q1yQ;;*b?p)V0p{Z!fm4_B5V4*%}QAR>w&k%4y_ zt5#H+eIDjDQDqQLU!mNV@~*l4v?{X_AMr?$DrBj#+|4~4{)*8n9C8f#p~n8+=xB5` z#$&Z;a%!~p14?I86-&f)Q@~Z|%|eGjD%{gwSwiQk9s)fi-c2t%CnvN^pFaBX-O@kI zP(SX`k?TA#;Wx6C^ zT<$zzJ9ISwcLH9U9%j(I6qD`Z=4R|PXi~W4Hgr4A@6s!4=RKfzU_T3)@h_L}_eWn} zK>aMpg$i0XaKfW?eILt=X=#5hq7Txzo_DU2G;##@weQC~RRQ}qH|8N-Hrp}ZDp;k= zbMOt*oGl1SVtI!kR^Zd{8$;XL18L6;Jt7-rzI=7`NW6Cj!7rhg-(3>`q4Sx~dEF-^ z>AACBA)4|@Yzz`nb}}6G>*`WHn*WGB;Ppe;Tz}RJnOfZ$Wa95%3IywAcm#uHG+r~D zF~ea0dW!(hXqw#VRY}N5wsKdtVh29?i}Z3}Vp263T4U0@}+c9}C7Ot&z%v5vVO z=Zi@lE)>Y9+#qo@k8MYEfNpg1HKF`x$|1qlPjMxUb;`%~~^>i|$QWNn7@yX#-zTeq%`@^9kPq2=V&9y*hQ-T=JQL}Nv zDgN)A#6M2X?ZEIL1r*I6K+ml|0JImSko>zLgznxyq8SYLX+~RnmWvgGta+1$bbSv? zk1O+@qbnLA{tTzIu$9AM)8ayuzS*;a-oN?zXnfCmeLR2f;*2ImbVN`HAvT|c_G{(# zH?uy`oD{$_;5=i&rUv$w!^KA`z_WbRVwQ?f09YS~YPAUPeALwNVQovT<#oKrn^)a^ zNxNTq<&0a8Ke>O1t2+c0_!xH4v3`wblnp6n+t^`kFBsc!fX##2E7aOY2PwCT%w_!k zwSkqsflGU|&^=zFXc_d(74jLY!e7fF*33Tp%g>yY)%8{vl7lm?&~_-YkTcc!WWO*> zijQbbQ;?0o%PA?bPu}Jgu5{xNP*x9!=ecgs46!%FP#P`kdl)_o+CeVABq zuC;DM4znXSuCey_#tAFulItN0kol=$PTdAv3?#XsV`2Ds3U64p;hl;;dJ=k)x-V3s z=rIJkN$O`b-O-Ibajq_)*xIRgMKrIgrKMA~pjCi{ryp5-}V+|6Ye-&Wv8QtH?sI%`qLOV;Y5<;$P`{>ym`k!??die*Cn{wI` zqkaZ!0Ma2HAAPj?H)AKQHC~Epk|0Y~r6o5~d`6c+*Zu%j0w+;hJE&rS)xWf_e;f7} z0t)cO4?9pBe`a?o?o}yy$D7n3PV)Xs*`!1wJiy^F)MgeBn*LhhLn8=2bipKBX1@u*9QWZkIKayfC0dr$3eeyZR@2oWmA zEn5)dme+8;yU)?RJ+pALMlzFP;^gOZ~1KeF^?fV1Bv`8q+d8l~n^EoSaP%yt z9BBKuQvRP6{l7lWDX;s#0NBvk;JfVS4=04JeSR{6 ziXPFwt_Q2bcon8k5Ja}5Vu+8w>k5oJFWr9OG1RqqFwT5LQg3a#f^o9URY(?6t+=N; z1M!;#@!;t+sChAOLDe5(Ct4=pLc1u#+OvdeGb9^%&MTQ+j;h!r_1C{X`SRs8P?kV}EP+63@jIYF;6enNz6#N%rij&=zVq;k)m zz7VF0t*9(!0`gV{J!Lx7q8%t{Hb*E8?sGn@2>QH8^aw1s9_^Qe^$S$&xTKgvobse@ zinW6PKK?%_F;Dtx3c50ZTg`MCa9oKDjh5^e7sy%ppySz#1j$qwf;x07UrlQ1fjv*W zPPlxW_%U=ej%O8Nos-3un+GK)0b))$Q{4(EIwgDT3Ab|yxA3fOBM2Kqh}TG+L`}zA zr^P5YM4y0@mcOBgQ=c0{_IDkt&wzSr_*D!oEw17V$vsHBCONP%Ogl$?dMNYw-f`-f zbrT48tm^m_CWe!I^c@@j?dLgqBPM6@A@Li{9LiNw$SWP`_Glw<3W19(YGK{D&6M~ceRI(Tguh>R)q>ffft+L*fsEk3N2wYF2ikb337Gdb&az= zCt^*{S^EUFZQd^sI4+2!q?T0Hb~E>#t&ch}5$ADu7S;~B@Asy(tnb%`+3Ynx<}Fm& zok_)uCHP(2WFkN@fl=;DT(49^BaDFS2ic1!hK$JxPnIj7VHhPThfngM+}wra*SlIL zk8xGQ7u=o8^rV(JpGdyF;ptXDAs=*wj6aRdOV!nE58-$2@*8uo!Q$DNc_z5STXJPH z*L3uT2Z1q9wX;`s?aKt9(r@zKY_cAYKYq_SwKFcY-{ISB+u?rxm=>+jY;f! z1HmEswt@GlTL^yu>|l~z6=OP6?)moz-IAr`H!0~^k2gqsO7=xdFYX_hrJN5TL_f{n zH6o-@1n{GZKLCj1nc%yBl6-$lO#JVq_V;fzx)--Kd8XnEbqAy2Eyd$d%iH0`T zyfMVlMks+W&A0Ku>+7}XBLh0=<_W7bmFX3rYjpSZ@b+cF2A}k@R=nTYe1i3D3>`77 z>Ow-Fxb)rUdYF=JGSpslqr}B}@i@MPL%xN;wQOv5Ux(re&{%_l{{Y^|%iEo`)Er#v z`FdjWegD%8oHxrAueVJW*b&F61rzqK&|_%Kh&v*2ZKZ9W$cK+%5@zmF$b9#Q1Y$lM zDiBKMUq@SBn|cBGvKd285dQ-xasTU|OPp$OAw3QEOrh%nfy>W!UY_x-`I-y|%YW;) z&34J2fh-iAZB^FlSvRrSm{6C20fj>6E*=i6L7v)cD~*8loQ6k8x(*%= z3ZB;u%u2qS?syzNPzC17Z|MYRe){GgAEEN{)-u;dMaPkf2tgM6<_}=GyG!q?{mgO4 zG)#QS@$%-fKF&L`QY<~|3YDS|+Z|E*j*dlPoqpSQ7J@SZLLn``%U}#=@hvw<4g~Md zB&}*f;HA2CNr&dCPB~{u=k0mF_p=(05ren%59IY`LXKXH1X2@( zo=uYEabW!^G5qYAiegU|_!Wy#Y0gAg4=*+X`OrO@W7K-uK+XEGp3!Whup*$YpzB1a+8@Bjzm59? z7;)>TnES^`b^!9s2&FBh{Qr!EJKDkVoRsYT56b?069B5M2AwjPz!y#7aRA_~De#O| z_#ang+^JwBhonLXEP2ZhXpg2SQCHP|G13)1+(+vFS2tuOhj>A@OBv+WDGmu0r0o$wuwj+<}S4>MJs-X9|2pYY{MkIxAhz3 zWR&z@7r1#n$7?utg@b|!ZUWRQ?d-a}8efUGc49n-Rfj~Hm}c}l&_8xGkOqSL(@E|c)BLtUH8 z5UdP~Q5lxAz8?<~?9h#~+qtVfC^jiNw7!_NM6Sb5ni3bCJBZ@W^;JIBkQS2)bKqiB z?|^Nkd?#$Y*PX6R;kyNtubO{0X5RvJ{V0JD&B@pOHJ&5k8-7cfMe%Yn6seHBy$srO zT(Q9J?FcOPN_$}89WQfPrwET1TfT#9(@(qaD?T2!4zYOQ#M@r>iEYN95Ip>%Zk2Cj zpVByt28Zo0&UUGl$h8fg?@Q9J0OBagIO42YQ-Z}vlnDmC4dhulhr6h9GQ0uNs2p>h zAX)sP@A7_XH*O3^CmvKHiSz_0cv4JS64y6+VRd=##PQrq7PtAL-{%j@pPP;r<}57< zT4*hN`AKPuF(`f8jAB)`t9btr1CS{=T{>Uiy4S7rrhF!0b81s#;Y(nc1O+qNT};2G zHGl5QoS!(2Zqs3>!1Jh)I>Sx9U@t##5Sh(h<#H{~hE=e5rs7MEs6O=$muv1l&Metj z-{%R*E%!+LIFtw*b|^ZM*XQzLWH5n=;5g^x2f?{br!=1qw|fW;?p(sO`U zNUJ5F2FKM%NcdrBK5gb>I_-RWyoL$@#SB;)%$u!F{{XnzQO9L1CB!%#`i~Z`-xelM zQQo(4Ai6AU)upkQRr-7D0SkUFBv6Rb08Ux=Snq0a+`IbNm{7;xE&yvOs+d23i{aIB zL}7SraL{!!6Bm>mKsnb?!9k3KN1n)&qZl&zG61y1G==&-BSs|L1yCp+O$sK>vqSAI zex&~YJwj0|G>`$C>{vF81GblYeY@gQy|<8)D4*;b|8PI>Nv!_}ONWPcVtG&_Ip z(kt`#iqB}7mMG4vOwV8CrG#0%+5nj=?8fNhDoKv8xX1f_7j7SOSDssrJ^o1VC=y85 z>R4&%;CG=~qIoAakgKM_KZB=Mj~}FLju6SnXqDgS!QW!3@gQ8d+nCkv<;B#+bN{E= zCX?m;-ukvVMgGe{js2PjEH5T#E)0#(AtSLc5ggsAZXVXTefa!-OqAF)6QIPsMc?o5 zmsoG@sMf!m7`36*Bg(>L2#%jDplLwXCaGiNTC7=?pmk!c8I2b>XOfdee?K_rn%jLj zsXgR-X%FN$Uc>?>NZ^6m&A?+x$|Zvc)l%uMe0M4E^<>opHhqnS_xy9Njqco!nZq26 zw%R{@TC=pZq?PDi^+_?KH8uJK!NgSI#}SDu@Eb73C9$2Qiokx!ZkhylTe^{T)^Mwv zAG-a@vRvsj7`y?roaih=v5v(;7)RZ)*X{Q8Hw5UGcO(W5e)9o!8W0rQS*?u}Dw+bBWhEXf)!*csvz5Q4 zLLoN1c~pK@QkoVPY^TN^^pJQy@6hu_I~yK2C%WgsTuJNfXaZ}S={LIp)bzVQfH97> N>tY`drKtW){};O!{ha^+ diff --git a/public/config/thumbnail/thirdParty-ammo-turnRope.jpg b/public/config/thumbnail/thirdParty-ammo-turnRope.jpg deleted file mode 100644 index 7cb3bcc57593d00d7c22f9f41acaa9651a2e108f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30789 zcmbTdcT`i|*De}FL_|PPIue!MML>!`UPQWpbg5C0-g|&RR0ISm(xr>^8tEOROYglV z^qx>cfFzu}zwbNW{pa2>?m0VStzFjId#t(ko^w6VoHN(6*QdI=$01^@sz&qj( zaE$;wRf5>t005er0Db@faGTgB3b;W$q9zs=VgdO2`U*Q++k1HnTe&&|t``7`fE&aI zkdXXa-}raCN&0V1cJn6b&0A!*ZvCf_Q{28qPCiQ3W_BLRNM39t(7I1@>gp`)#x(fgV07%IGGdz-i2mkLz za)b0H*)4M7Fer%~YVHw-PfAK0G#PQk#MVG!JK!cQ8Qo)1g!PCpz#~0$~AN(aGH0*15L|lAAVp8&tl+<52xq0~og+;}cRn;}Mb@dI69i3g> zJ-vVX`o||Gr>19S=jIW}we^k7t?iv%^zq5*8Ri^&arv)YBmmO?5{p>>zsg0N1d<#7 zz60`q)`%H_0B0-l9{`A%E|F|H-pYw;#NW&8}#t;1JVA(OY_q-C^JqM{uG4 z741Kg{r?l}^Z%7(|0CG{BiB6OE-4A|<&n|?K!AOi19&0z8h{9k;;F2|=hmccyPQ!x zzPA(Gd*5`Qlz)UjYgA`{16T=Rt4f}i)q8sl_#BLTmXW%pi)QSi;34o$bh!h?@WtgO zZ67SUuK}VrVC}{PR)`jTSm!e3Bz#>v@vtV)#dzKIYCR-pb}G3`|GgCcS5{=(YE?4J zQmQ?H2IV~+*A5HtmO#X&;ioL!_;Z3`c5v85bRcZC%;Gui?ak(f@6Mg5XDiVTt$8$? zG_Z?^iEBW+A>2f+YP&9;&3$9}*&*KUvfxJ^bIlQb7>?dVMTl*gvKe$hrP+opmM;<6 zWaLe5L+Lx~s!Hzoa}5fUvmP0@r5PyF3}C|eJu0*&2zN@*@{0$xCzh^9;t{aZCyv_I zs^2sNe;K!}mVsDPZ+!+aEGyLoud6ZTo%z!&|GscoK#ID8R`ad_^e$8Ru&)+;YL}m= zi$h=;AX~M-IBRWMTnCmBbBbMAbEOsj9K;7n?N>X0ror`>FL8^Uyv3eZCl0IT-lfc< zdRii~Acpxkey5kQyUb?2_!R5;4v-h! zSu9Yq&Espp+EIj8f%V--AmKfJu4^)b^AHu^^U)+U` zY%GhurZGFo%6pZgCd6rGZCcbM(lhe)8xv2@jMPro`ga&@YT^g5_+Zw3!f24dn2-TZ z5zVmuYS8`B_ap5;-t=$2%)=aY^GK+3+$lf~J9{rSV z$xPj&@Y|nN21~aGsi)8OU8gE^y0zlczG)|c@0L}|T{+1< z7s_JYmKWUNo$nLVT($~v7TC2b7@_YPP{R{)4X_@W|E4l_dKGhTUd5d_-Di9S;m+%} zO4ca^BWu36r>b{lY_jztrdawvM={#GgEF9D2QSciJ(pY2r{Ks&*yq!LhcNxGo z;<#&~@)aswqB?3WOrQE(v$xN!l7p#Fin@SDLd#`7ML#!(en9BF0Zx9PcjaX#&xW;s z*a8oAbtdqrRdp;Y!`iasu;L4|}q%-V&yt zn@C1O$zgdrjdjsDKBOZRxke>wxOnEdf8x>vf9Hm3!TGmjz1SX_ttfS9oW_s7vCZON znUR+zrucA}Q(7QHF9Q4(9XnE~I{DEwaQYj`5A`{<&9HQ{?e zu;K1haHWbsLH~X()cwla%mux1KD;6lE)oRpX<>FT;4}Yw3Y<%F#qwwn1{pAI)vp>I zAf10(L@K^E|7aQDbSMj@t&gfJX=PluklLb9Ru9^l(R#CS9+gFn?Ici)A%PJig^uzx zD2tRl#b01W`j*Kmd`fQ28_@*~4&Kf_uEy}&O6$+5Z`rGhv0(J1R>H@FI?46Wj@u^r z@izqR86w3^RZ|y-2c8J@w`X=HVLnWMLdtw&s;AB=}{T z?pUk2F643Q@|u24EQui`1zPn?Rn>`1YWp^_I_CUqQN>@JTqQn*xFDy?T3e%O^qRtu zN;sq|nYmD8jB5ecZ@rDd{#lT{jrA40`q74`!4WM}XTo_5*&Lz$QZhz7O4~x7a#9xb z6RSHe8F67cI4$DxcuBVIHoS#J8X}O)p98pytVqbWXID)lJes)%tfpMXbO{U@sf!}8$yfdA2f)3Wnnb#^1>OH<8$!N+g8H@B-S*J328Huj zu&)F!3#V|6&Ib)OH2?BV#}BpmofTtn1!7U=PJygNg#Jv9iS=Ux+_`PfdXtt)TMf`6 zyqmYbHxD9-@kDEf%0A&5h1&kK^9)XIX!1%D+vQwrz?H=1LG-ga9CD;`EI?$nvDq0a zNbPSp$ud)w0ge3naMOhwvIKC(JN(vR;>dkrV00UKwRoU_Ix1HNs*^4ltJd7VR2#XT zRR$`Vw)Xs^cIbq2l=Y9Fb--XE3WiOazUVynx8x0S3bgN*B9{)cM`VTgv*#-36;?E6 zzMMwyTG%|GttGD1a1eYlLrJ+=fMoLJa#&}hCa-%4|>^kScr7~9toO_&?P24f53SGN@T_044Q;Q4^@wd#ap@u>Hxp|K;qe>$89WFCl zYDd&F7yp5rNFKTto=RwXsHBy5$?UYyq|0*!jcTLxFyE*5U0d(2K(_v5@?!%egK+`5 zD&pTWOor8NmQJ73hCbDNkgZ;ElkTa0u*D&Vh@Ur${Cuf3f9#gKi8{+wU2D{Uw@a8Z zySf{6<#E;nsNWSk?kzs#bmbHHW-B{X8Eabtl|av;$-_=X9(2vu;ke;YUDlKj^$`yk zCc1Jybp@z+I7W@A_;|T21Z32GYUR5IbjlEMmP@;zFoFd^X$fh4eFe@eOu!YJV-doc>`LrWT(k@h@ikiM3u^qCsG4@@BElHB8>7 z_NM|Rj=YwPk<$}5ZJnfR7dG!Hn^YV6hZr%9r5+0gjbyO~-Ced*MELeN+w65p5*W~O zlb6r)3L)OE;zR2FU}?9~=?S%)5mimJV}EpFhu`M(4cy8bjWI-Lg#|r@>U{eHCa*SE z(LvRH!3lWZHQCI|7fO%`Sx~(Dj{@799tOGJTaLm=)1Lr+%>^CJf(I8hvNGV%EDEmx znlRcO0yQ>SZecM+UO>sc!0eBp)*7=0-Oo_4;L-9^&*M|s8mVe;>DtBg7$Yp@nmG+d ze+p`h)?3XA^FB~fM)h_H-8Vv67eth{jubjzlHz)fU1Q?P-Eh>mRLp2~5kop`XIxs| z@6u~P24}8V0ax68?QZ|pPgfrxG02UlAhzVP@=2L?>ALmBHzSU3}i&sTWR}AsltywL7 zcD{KoF{3F#mfii;r*!{R_8TS>6SjAPI(AL|KZsArdg%F+w)J?w$k0IgrKLlVnPj>HIi`3Ya1t857P z@ATyMu6uuOO1A@$^;DHbF9)J)ZnDu}dhnq-8@3b$p>MY9mV5nSi-Xbt-P?5yU@xkQ zb(yCNGSzsS#MC^OPC>A6mFAA5HlkVUVCrhKvA=0(CKj_xQqB7xK)qvem^jmrH};*9JpUsco}iPLRJD=S~u z*`2TJqG59Y(n8-Hc@|lGbb%ZDh?mMhivhroIZFYlMdlAga?$e+`Enc`$JOMAnryEj zXT|u@hQocSJ(+?q&lj~nMcAOf+r@HXU>GHkEyXU|nCTDS%qNp)0#$`WCChRM*R-MZ z&mj34^#^68N<&;lIR#+H-H5SWMkNgd8Zr=nTDr@x!zeyim}&uc=Z!l)MldqpQkIj? zuhb0*-%MdBT5Ex|KZko}?;dOwQaWDk3k>$&ZZlgY(C@7qE3xfK@@8>A z&t2&=or>q{fAMgu;{e<(Pm4(4<))03fpS(1R-WIUu$X3hukxZUn zDk~on7WYdDdb^SE5yn4M*kee+ZiN24*IUZ~b7&o>D*5XMcP?7vz%R}?b1`P8H|+aO zg=Pf3<)<7ye!9X=8OAdqt5=A)`C7l+e;Qu27&NkS+Xnk(-ukS&zgoTanN|twk<*9O zfEhBiq892#@eCCkzdD>`ZzRjnecX$QV`+WI3!2kxl{j15$??$+Z15F$m;J>=^S7fg z2A#&NB*@`P@P#3|xJdo)(CU5P&5Er$5Yt)Q#u_TB30iM!8vh+cUtW*g*PgV5AF;Qg z+P%T|AkSyaqK7$6D>lg-KdO#QH(Hs9Ma^|eUGdfXNCTr74p*3^ zvtoir)D}lp^n~w<&o!WxPyHWx0g1hew5_Ybsb}9AbXOdm42ai*9L)aMy~X;PHIbA# znH8Kztm+8=BW#SdecLptr{x>ESOsABGZZKGERojVxZNY-Sz9wI%Ze&@41lv?h0Wch z|2Br=en|S0^$wXC6qtZ1#bfyP+io_KXA@cR7uc;f+Y-FWTadWBiG9z@kJkWNPH6Dr z%*|rtV*yW=i7&-a(H9M%ciO7?yE;^JDLx=TSp3ZJcq6UF(LCHfTOfgnb0rr zlr=8zK;w^0^p~+6H>_CqNx#+@ciwwhb-B59fT3g=CS-u~!cSd$)!AZGP5e9w+3y>9 z;nDu&Z!AzR-herv$0Kr>GiVTe@9bNVYt0d@ebIvtzgt=x89kpKY;@c<0GVuua#Pr` zcSi!r<*DXO>8E8yN*r0@+2js$`5$n?0 z;m>edQ(o3=t-it^NcV_ZdT3Y~0`HpcROGcF3^}l4rtUZu zllJLN6XugUjqEwH#i^zPuB5`jy<{PCKVGx0hctOsH4eNbf{um3gZF z&LQV1TG;{JIlTtZ*b9|H=J(r~%no_%*nA0zcS>`IL)7_<(|Nwix>^g()nWsYLYhJx z9$d{0oY#PrmbU4}oL{fM9am*dH_Mgm8FlJaqN%zUkKc*?)mm*Oegf(f^Yc&QH;ta- z_*REr7)zdMx})qp(z?5?*K_X<3#T>|aLy>ibeE!Fzxj6PW`DROLF$5$l*`VV@uYR!*P5rv6(TphNaq$BM6Y1<+D zcF#eaAqw_|v3psv3N=)o#rzv}su55`VRd)K!TstJR(K2Nxc|E#=5>JW}oL1n&`3eTjyeD+`Ec*YY#0Sm}=Zy;0#B3g?0vKcR!1 z6VA6?!Jhnqo1{gQ!*V4_iHWb~TQUw-1_t*#ie&nGhY5W6{K#v--P5)&-=R-6QiM-6 zG-aqH3dCM-3gl%SI9(}*#wPsgVEWjwErVMo4K6}dF>lgW2Hb5|hwMsLQ&_WXduj$Tv$r3j zsEk%!c}6ew2rqD$kZzFYcmd>!&|at_U*mkK{mp{gJB-V_DJGe4({Z$|Q5vfI%nMBI z$TGR-nrnBw_ySs({SU$WSrJpT_y)&RD_c-ct2{crguAKa?asYt*8sMNL(p6Y+Dt;U zA4pM9C8sVj+tk6%HgPvKxUWzRX#6BT=^F5{Tp;xAW!!9=RllOu6$mHwRIYnzxxg;x zsC-c$Z&TWOUs8)!4vcZbhwc-2%yL(56X=GJYN@L|mpw&%0dL=W3voar0z*ym4MaU; z_z?Jl4z)EUtmx`B;K448M*cC@qOT^9?oxww1)H43FMV(IfTM84|FX0yY^}Lw93FV79Y{N?aR7Ai+P1=G_o5cUgH1ikKk^MoqA|o4VfZOCN#A_KvY`nlH zSfMiO5O6I2d9=xc+O|=sNYQimO$C2+15u(Qi4Y6sKm8U5YEN1+hARgMcl_v)e*Q=8 zOa;nUE4GscRo4KL52e-}>R>AHAGuFKpoL(J_6&yra^#Z{E#uYd_Vfu&5VAh6BpP2(%}peCMJp8_9QVKz;XlLLyuHz;CeRM5tPd z{=MW}K0Bw53x70S{?3}XSPctA8w*=$6U@g1HAngL9{)xHk5c^f0i7=I#6mK6BCw2P5 zj|P9vtZRQ|0gm8)HUL&*e}M)Ps9NyZLkkW;!7|r*l!p%d{wjfkPwkkRIR<5@AYWUNlBK^ z>0f%~>`C!n6!g~*9MMV@G)7>{$U$p&(9rL^VT)X}lcfC+XiVnJ)RkrR)kNxt1~FQI zC4p6z!ClK-$hie#62rEJ99i7rA2#^%I)Z3%-fPLGa*h^~KC7!rT%!Qm-4|2E;<3+C zW5qR!6kRLLBXU@SMxOTKPu^eJj`VvU6dTSv19jfB(8H&5KQA6Sf8xei`MwOC6 z-d7_xW1m+cHRa~%U(5{BJ(r78*LBj}$d6|2T7EIr%C#4#fEk%m-GDcrgWkon&|?U;pR)37j&tYg0PvE*F{oWNO5T z^IYK2$~eNBIbh*bj&!v*^vEmgW^W1DSthhedJ@hFL2XyYEOiAY$>r>72FTif%Q2F< z%)GBIrFwPSzY`mO4XBTAQc#dkKJxLY=&8kYmy-azG?xPR*3&Hs_iajt1-d}=;$Z5f zmYTtnt_{e0hSi|38s|G=aU4HZo4wHm$}@smVfi(Scdr3K8$9io^m0mGJ?X2Z!dBnM zoc2$Tl2{WG)3ee$tJBYs5y=~TFLJhFUqtQwRf0nn#gxyfn~Uo>B2G5YEJ9y{_#8lV z-XdT8dxHt=OsQ)InG8u3ruOfcT==g6eqa~(&m>ZL+KYuL6EAfN1gh3b9`bb8rM5-M zn*W5DNS%pL@~NIt+E<9XmHeoSO?M#y^he@)TJB6D3{$^MO;*dPLsH%s7f*gzlPGrl zC3y<|i~`s1MIs^Rp|ON0HX@OpC4RGQz1rk-^c?s_UU>XIA}QPxNh;k^|68Tr8x$DUSAUh! zAivoNlwP&8Y-uh9GKpVJVk?kO>h3+suyk%`+`Q_k+uZz=kazU=PXu{L^Yj!a*xI>< zE>b-**NfOKQbqRalp5N>_fg8#Usot z*hX!mIK#T+`3-9#URh;~DH3Y6q}%Vv?a{nfCU@es2J|YrYQXPcl)h`2J?b1YgO>gN_b&V62r6@Vvv+?#N)e4%!p!`Jgx@i?btL&n zGP1lBiqTQ)Q@AiHs0{%q=_NAB|3rS|s%vSkeerYBM)?|GY4hN)W53OM&6U}HaSrke z1H!yspX$jyLX#9YqhpYob-2MY9@mwB!Y=iq?7OH~K{4_YA1yJ{9b0nCRBeB!+e}LC z37ZCu&Zj<=w4kf8q(o)pQ zK{rzF7G!f=o)=QwJrgN0Q4dUG>GATIpVvwcTCJwuQzTB=cc^hq=K^6=uL9Uf47y$e zviVB651qS`yi9T72Dex4qwdTacs2)0r16ib6?VeK>^D@UxwOh;;1Wc6*c zd!uh5;p@sc?iGU(0p@1-T|ZDHXmye1<0ZbmVYJO|gn2gj{9We!yaD@)o8f4eI;AD3 zatFL*OM(PrpLc>MxEMjyAO`{a+pd`pT@^Tdad&ut{o$4kr(%A3TDvM)IBnwGs}d&W zMY?Dx2!kvl5jcUuWyp8!A_w23%8@(sJ4x2&&DVg01LHhCmbD^7cm+b{d%qjD{83{1 zZ`As)EF7T(aw39KK0bD4JM-9AjQb*IJiohwdJS6$=&Yp3!&+Mv2LF{2Zn}TK{v+NR z`owG?;G$&(J~;lCf50x?s0%ndgP9x?0^05`AffBDb07PQ zKc!RO@+U~t3B~a1d4E_R$hy}ow+3T_ddxJ7t^&jS^BamZN?-rpxpZjh8V5c-HkAK| z2z|!QDq@ zvt&L@!B@~~DD1&1S+fxO=vC88`B!b@Ttv>aqP|&g)g_)=^RXpIN}GY`wr6W|(x!gN zHFm$#1Vw&0=U~H)%LDJ3-y3-^By8(tCzUR7au5YGZRBg4*j!)vOu~BPB z3mUrBN#ba8)F_mRC)p$FM*AE`=2L1w{f_}jq`;w68-eaOlWZvUVM1V@HvbfziwKUk zI_QLjO0BVS;X@!X5vl#tLIk#OC0XzNs#V0h=c+l0J{l~)Pv55khFeitA>N#J-ayKo z8D9U=X`On|8zn}|4fALXFg_V(3#5N-i)Q>Ya>rcyCS$x}nD2J=;oydHLS6VDNIZce z_=+6zBjt={uC5dPSB+ak0>UcaeY;?YgYiqJM6nc{4%W^>TqTFhJGWU>!o_dx)TyHH zw!?S?c{d+#V0|n4_Eu1eu#Yl5S=WZmH8yJ+BL0Cj!x=fw^7E00Uw%LR z0%w4@b_21`wGnL*a8PwK2f95cdEja){zzW-*IxmD*eq)>2RJ1S8dGnM&?(sJ z;>x_rtBG4-tMEt*Qb#GmIz@q*sq2=M&tiAOS=syW0{V(RBeIC1=16l8;Wo#WyIqAu zykjd(J^Op>q=)98zXy`4#2TH|jBXj*aLaJVOv8d#s(k;%d{pxYqQUWxRa3a;o`@Wl z?oSe3rF6b(kI84Rl1V z%-vb*4qZy!>bM+g*%vH0%#kEA)ysRhlF7fjQdV(byGD;H5Eo9###@AD#Xj4EyE=j7 zP+2K3Pjx@iblVjzp^u%LtR`!2rK6I8+%rEewqm3a z*|-+dqiFwkNA{>2j8fB{P44C#aYP-Tt6HTC$CnJziPW3V4*BQ~yPp!q)ar?DHrVRd zwyKPSCSssU0?pdp=rxqZJK*`SgYW!qGr@a;jY$1#67(Z5ak5)oFq9&Y)}&XcHxy*| z&6xh#9(ztU{a@1T4?+I^Mz0_dAcr6PF-0LLE5hxNGDutRG9xk9g=9^W;|Cx_VewTFGB=!Qvwv5f-Or-@3Vc=6vgH5C=1{XI*MLzxmEM@V%1 z`tzoSUrYvVx2vmmPN7ICEW-xwSqe@t0B>0 zkv~#>{L1jN?cePMfxUVTkxomotn#({m$fX>Vs{`;&w2K|%dN%##oFjTt%p3-B(ls?01#QZfrVOOoM zZmQOqsj&Oia=FLn|Jb`f56J*b|51ZaJ48ibVjkuti6hC(C?x6p`IGGDjsG%=G$4Ed zj@$|j!uX)!pCoSMx>`{iqfsh;49~VX{MECm%^FRe^~A+-UYm3glIIDPkjx=Q%f z_DbvYU~v&8fOczz>oWOM&X8pGoF{F($XNqFY9ZaUFA1iND=$&}Ak%`OnvuV0 z#9Rcr8$ugXXDt&NVX=pg?i$B%#!qJX6NLSg=?dBeYR_Do0v7QyOpRzm?U&JYS4xm1 z)9IS2>KFFEVt_(T33_Mrm*jWdFkqD%6%TS8qUKi2WwR8q8avFXXl2jt_`VY4qT6?! zbUtO-3h025d}WZUR;M6A8se`<$U=l8fXm^DXk5uoUUKz{V9chy8!-;Iu@E!#c3T`c zPoprN0e*${smPa>^?Rnq4tn4~&(`q`KbaonG#*O+_1QULND_!rgHK|>A)so;?)ab1$S|L|%L8BPaVuiK67poDBj0~~zFxnvqlPhzxVyB3Ivo(R2=MrcfiZ1AS z&9642N7R}p!v&p0(EjEc5b5ubfF=*E4nVol$4P#H!?nb~8XqtJaTg*dOobMJUaegK zHIoA$OQlBtXqJ=74DUS__in@T+k8WqGdNxYm~jI2xBu!;g!wV;X0UqF5`p4s6<1rAw9&N?RW)7kSXTV3}tbvyz zJ&po=6n|p$BUCAf)G-ufvQv<@F~y#E7oVur>xXEIxdxEpjOqwPms6xXYZF(ie$3l2 zcb?ydPBX7XA?h(psjz2e)(^*~7ZyzyA0^FOC*J<+<@P70qgL^cYD!od3Kp; zfEI_OpQ3$w>Aw5!dVI#SG(Uov9E7ek2`fRu*z6zWvOFlmX>AIuA6MPuHpG*3!PJZn z(Oo(b?iG&4nxK$W-D`j$7DyA^WPlzr%*c%X;+4mc?B}UHmJ=sg67B)ERoa`p40?3a z0kB4Yacrn!^6>S4E9C#|Sn#kr0FP6k`oGxaKUZ%wPouO#m)}k$wi~H1lbL?zB}L_6 z!cl5icl1@yGO4LMoqZ5*Q}pdHRQC5uLKOHX!lAexGI^9eS}Sjhoy)r|>+W{k`}OFZ z%H{eyLQNFpc#6E@ipWxLcA{Nz!XPYn*hh=Yjjj6R4l#RQtu4;xpbu|xzXcFg{^}kj zS{g|0V=<475}0_9(yo7WOs->Ubg;x+_`bKmHx;!vk$xVP!Iwtphu-@o!|_)_1SdQL zQ>yIOPBi^e?l~c_X1uXlQ7{VZ+JP;VoHXZC7mf2>Bq&@ed`Jo9_{O)k{U%|jKf#LU z!Fogd+``{{6_=jYJoU7Bm6O3_f$GB+%e9M-oPiS;21-lY9CL)bL-f5Lg^c_~L)O)v zV=lsh!)^E09K4I%$u!PXQDV3IEVYV^*RGp50?&7L2eBlcYJxha%lw4WBa^kZoP_^;aZb7T9pvOokB6<^ z3h1&BTt&ZKoQ|}AzuoszIJ0$Z{@CJdehim_ZZ_@lKs4y(X~m_l!v*?>grnXPmrkpr zh}Jv!A3*8p+}%@>AK@Y2BzBHq@RKq0Xp%USw>V9PUUFs=3R}UNLhr4`$ z-qZXwramQQIlc})UL}7{h!pU_F;+*tmR%>%#2$AxiHQ=xbYP|ZJ19$9lqYI=Y&UvR_%B) z_%()i4J8%k;Qb5FVm+Dima3Fy&Di_Jql?7RGwC<(3aTdmqwXZ|8Prd55rxzLy;k4& zNc(XfQuG}dyMi);-Hf3Knyb5bDS?Ilo=M+m9pEfFc*-CVb)g;7 zW=BbJbKVAC^(d#4BOuzb={{WW+jdY9k?}RQ-GetPT|I_;`(redX$djyiRY@k28>7* zC?(M3dtT1;ZP7-$^QBBKVvR7zsC0R9e2qL8){>02E0aGJl0ymtW+w3w#l%?zKor40q>5AJXHnB-s9;!Fm>1E9&EVSK$M+g`Ea(vF! zAZTfv2)m~M?-9UyXDajS+cNvxUu4ZoAMG!oJNdW#d_WWtI&(by9QX{{pkM%Y znGJcjVdehk68hygaT-$aygG7Bs8Y~$T|yrNvH5JU!)qp2waM-n6O0g>;R$2GIRPE8!}z zwWx~v^}!C!MXMHAF<3=5hV&!KO6W~)d}{i_JnqE53bp)HAI+v>qBoN?fa0EL1wj?6 zS$VD=jz_n8*Xvyx9e55DifwRx%9c-(D23UZ8*ujIAWVITHdj5XQzCxgNpcg1v^Bam zv=m%z`^8qbu9dC%rNYevqf*tY+jyOKl~>afAhMCr1RzlvPFU zZ>u8VhPC^K^T&Iy8xxHllNLhSFMms%n#t)cXUJdTyE{Ek?yrSJCR>n8DoCV?Eq`0maBw=Nn`HWCC%u*=*@bjbnCe^jts^P$q3E~MW*Q2_0o%sUcUYnG(j;i zdtqdPbw{XS%uG#MTFpNHRtu5!XIWdNX6>s_`WoW#b^L*k_o!VG@p z#{Ii5-8Z+4G$kGFtQK)ke+v-8iqwAqiq*3}Nn_ws74o+>;7JfRvo+46quk4tyqK-U zrX8LPb@ZUyn{<=9!-a2C64Tq;Ikgak>heG8kIb$C?&Bo-DA0wLgBJ2%{ zlHP9^J~$Yhir3t(4oHM5ltDZVQTcffSftkvEH^e^b^DxIqRJtKmI_jqh)kG-xHjSyz^( zpjXtCC$@HbJEuivWd)m7+~e{7_5^El4sy*fs+h&d^y!^zKy}B`%%-2TckzengmK5% zL-8ZMH|i814raBp)}now zhYBBh;ubD_56Co1T`kqR2)% zhe!^P8Z0H*7CnH_{wBd(emcTBSCs1WF8SF5*(^-S)lp{<;~+$@6IaLEJ-%M@GA=SF zU|w^#yxPb1q?ZBW-a9L}T;~6SC7P-ZQtpc9-kd6j=Q)UmO`LsGYrkqW=#T_{8VdZD zKQU#}yXAen-$@Bv8BG_$jV6GHx2w_W!Q9W;uXs1&rS+Wc7;5t|n*!WcR~Lz_q&IIY z5)y~Lxk%Zk7$)RsX}VfXH`gf9itvBr$CKY^rAevtM5Zq;#P2%c#8F*DCqz^>)^h%l z#kt`p8rOuUJg2wnPwuLBtU737Y>Q$MJki6bSx8_}caS8WWPyK%=X&+iE!!O6|mYkZlC{HdJqd9?w^^VrY=H6HH_h6V^IUMlx!V)!mAQhD-FKG!}ljjJWiygtS@4kP^}4d{99F zWJI^739@c%7LrI|^g)U||IW;YLH)UShYd|?!iRXR0j=<}qtTON@VpKZPKA`uOWj~{ zGT<#y>P$@-cR2TH^sfp=i{S1{_8PW2_kL;R*)eL4`@J+Tdy~NNq^(jaV5h7jb2y1r zynlCGC&COBm()MwzKFXbKdnOyx^U|adh{nut}h|DILnV}qcXM8u9$b&c9hENFjMql zicOM{B+$05p{j*0G~V9Hig{b$@_y$E8x(|o@id8)qeR-0gHe)Mp<~pv=>W!YmPwDU z>s%J;l3`*w#(dY(R8NaaPMd;`fb2F%H>1L81V*Aoy;1fV|JCZl3-$iieeGH7zGv2Lbgmz&{KKGC;^@9j@kLCxMU&8M$Nqf zux@BP+7?+GUUwyc6t18ibk^}PR$27~51e{7AJH%s&Lm~pqH+dM^!GOlfRp>pFRrYi zFw{~PBPG&N-CMs$! zRJmHSRTK-(brAGBaS~>qUEBFvK+WIPPB>05IhJ?5k04N#jFqnK5me?tDAkeqcqM!p z%t3#2A4d|9tBuHDF*igSmm9wQaew1U^y;B>U#VCSM_%NBIlXpb)zm71q9_?nFKbp@ z#LJBV84CT7z0*0~%8MV~Dak(lZ_D%lVUGrI?@{Vd6|5-|bc6op9?Qd_U$$2xtYo0` zY5u}VFL&CkciPLKTjgF&WluH(N#DHIwim2TzO%9%73qvCIn_r<6}8 zIgS!d&5QB^vdve2T{#)bKTf*_JoHCbxVa=C6|vfjM_AtTNGKOEuffkXqE(FRQ!isap8BSJ)dwHN!Z3Z~)??QIdy#ubkv%gvC{+3lzKX`6;AMaJ z^oo-8-2C?{@N=uv+)^ude^>8HNVWGrx0gVJZFl`bW?2&JYbH-*?L3Oa7;d!8za6v| zK}^|Q6}qiZkC*W$pb}P>qk8TLUCwdvZ?zNHQ%tQZqW)f}en+V7Smd#D4B5+Z4OvgF zm$f&rKd#w7@Lnme#eEA~t;tP7t1*7%i8c(^2>beMi;Y0Ps@N^-eCN0TOvP+mlT+J! zu@iIoYST~4FX9jK8CL6m_4eLTO?~awXb=SpML>Fq3Ifsv=_NKmKtMW335bAz^cGs8 zAfQN5s?s7|YNSc;O?n6EB=nw811aA9d*5@;ch30ExPRSo|6*hfcJ|6D&tCI+=A8R} zq0ZeyX<;>OQ4;+VQaWQhn%8Nv=~jc}r!yO8e^Ioep`iR6WXb5vFLF8!zrBUJM5p^I zCnvS8eoB3uSk&3fC}G8?#B8B_Mel?maXiK8z}dD64_QW0&%>w&1&@D!E}r7+78E`p zaKgn>X za=Xr=hkW{!Tt)Ia63ORiy1B+^DX~cS0xrj2udPXD-2V#_Ly{9>V=s62K{q+#%Sal* zt{+|Y_FepcHKd4mGsxeNDvxpahJJCvyneAcNgo>Cwf>%{u`H_I5n%t$_D7GD)s}?$ z<(yWx3{?xt*%0U6!LsLlo>9iq^?^bLDNS`xtt zC>Zl$JVhI*PENkY)l_pwV(7R~$ zFv0wl#QawJum-|{7iJmt5zs!38z#d$-02yf$4W*f@yO^b&)-a&OjV#fOE)0Oi=-_(00 zKCt&f7F?*snS9bfHJn?7e5%}1Y1%yR1D}^2l|Cts%{HgYllXr_e4v)2@AU19vx;am z-hg0&-*2@!yb*AeoRn`5@qz4vNZP>*7xI6#K2jU`b4HKZVcN)0X>6{h3FC|00{iNN zV>?yV_#q9ivrpAeBFhjn`{XM|KNewXBkOfI*7iV`M{P`fO1O@=>&gdF!fOX7*y&2n zjos6XQ>wLbPnElE%g$O!*OMC-dd1Zi?Ml}%m)4Sf90g-7N9?N{pc#sN`tPaOTIYn1 zPUT1O;I=VH#lg;y=s+gB^*xCqcFVvjUa<__LlyJdDWdMuKGPP<0t*f}GAK7?N*0V& z$-nIG*QGGMN+$G4m{|q4*Jyt2R}w1FkLbSKXIHvGzCToceoeMxq(s|M-#m9dRfF(2 z$c;7p{1juAA1u?-L=cfpcV9B!iRvM$A@3LRjLO6wGrO}xI3 zNzc<8eldAADeAx%bvf@MS*=N(HEGSv32K@t2dz^PXGmWDiEY%>k4$;Q$T|}>I1-pR=G-qj&QaknBc6A9G&s^>@;?N zRl3Y4lwL)8So*Wv4wCw+cw<+gf%88&Ff*d{ z7Ubm+liFq`-r0PZ-~EwBzH?0P`K9o1M zFZ*MdeJ)?6v#J*-T6d>l8FeY>C3ff|QN7SHZd1X&-pvo8T)AUut2X~R$FrR>vM;KJ zAT}f?AkngvDQ#87-gY;)Au*-dD!T=%6DIOUO>Q@bmr>(TJ#GiZA7i z8Zxpf_4QL{p^-~EQhnc>%0kk!bI0Azz=c|gy&E$XDGQ_<)0U4Vo988Z^WBe^4xzFy zVuaqOIX%+*wb@w|G{an4^>{(v2J_U?W3GUCF#pOXRk7x3AP*FWGK*X87P;un2G zc0<-5T8{rX&|hPgc+`L7v8OHWbcyqFkllCjkve%DF z&*l1EnO-n+1q1pPVdPK(PA)~~Xl-f$nbVBbqz`*R-42S(Cq@&<%t(%=s|`9ZQ(g*qRR~B7Y+oa{ab+54WPp zTo z%{P?&1;u=J-u6_8foVLhP#Y(+!2O7Dp!H)(7%|e?Ww%4BY-}?&+szJqdtB!Qbu6^tLl)Jkzn7Wlh7*p?q z-^TXNY@ODLRpqpLpU9Ta_N=$W?Fz2g^6^ZZm)sRPGF&cnlsyG^d34&di^+KZ{1cgA zcLfrzA2ZaG-P?d5u)uqpnZ$F(iRM`7v%rG0l)a9shWF>IbW;0~glE~Y`1U*59CFVr zYI(~Y6~$(b)Q7Eu9xQWlofRxQ2$1#z4{LGzyCVcTq9C5hFLN70BVOffu5GW8KF6l9+%NoyS-dC+x zJks{tf(e8-F!-ZUOfQ_UP7*^jjC*#1kC&oMay#Jyc0|24)3j2Uqd}38uwsFFAhHw} z5i&jL75`Ggl*}7 z-i4xP1yyon7T+_*$9{J1gq!u@kJ61^S)kC9HO!h;v(xgqck1fKstpcBtjtqZtLC{Z z*~d~g1*=XS-5N%QIi8Al2)-B2v`>V!{=U#898=I+diDLnsRQ4cgGO~}QLq-Aa^l#9 z^>NJXv&qsMtsW9|aVs>Mb4!F2V(BlYYcHHUW18OEPuo*7fATC+m6v8g=6fv$aRW&P zE>ZzeaHKsLlS=Ekz<2etQ%b=4>m}NrP^&}{JJTX_+bxL(vs83kq?6tYzH_k%s6TK~ z&Unz(HxTqo;-!!S;R1FC#H7+$qL4$L%kyJ%GLC( z!J1HnM}VR?cG<vY+!4dcU9_0V{^-4}=qTiQU$zjtkC3!c zE?dr2%8Qhw1M|7>ag$r@CLtVGj3PF)oyT_@49d6Um(|dpxdNgl3QX%gGeikS_{A&{>dIq<0`-zo@=Z$66L>?TT(SIwJ#?? zd-Y3)Q4!CplF@Z}wC>Db&`BCr>6-KRAjb*f*WVYeb(xJXldu}#=wKDUCGpS(Rbzv$ zm7}zbgGhJBGtbK8xnR4Xh`Sw%y^$to-1ni?)m?qF)#D8|jyX<;bzyP-qETXozMOKX zo{Hwo{4m%V;-@hx{8v&`!USQ)lD-3WxG~$B=AYUpRq(M$4J8zoH5T2-K8E)@*%*~( z(E>9DDb++e+8IU{yN2?wDXP=>@V}5u9Z-hYa6>mdd&USdpxrV zQ@!^4r-k`m3K8pm#2f!;$T=YP04Y^)s56!hri)>z$T6S8ClhoA7p{%kN?1H8e$V@g zB7I&M7d51Sp-Gkd@w4XJL+{FF^-O|_Nh^`5GYAqv9%<1p5HpuqsznO>`56;+9=AfV zda*Om_Rpkb^YO}PA6{PaBV*2207oMp+}oTR#L{iFY>~`(C=}x(IBfxX6GY!eK1&@_4ALMB*|_MlAGq=*dS?*&gKeB86iU>l7K>od?~V$*g1bO-{}9 z7Bu{B!cMI;wS81$Hd4H*lNW+@V$;1^lgji>$FoGOQJR|bPRUsF5^RUD_@G$tLT9Se z?PGzTM2+Gyc6(uJ_6dM>A{#g@Ec}c70y+6roTWy9SvRG`Pjj}QYpz*(tbc4Wh#Rv{ zJ8%*l*ftaP&FX2&$O*EW4fUlDmLGl?>6Ay!sfp6{b=Hk{M4Bbw+^#u1H}aed7V6oA z4a!3K$B6WdxNYU+Xz@|SxVXx9A>Ft1DJ)Jlp#v6ySMfR$ot}NZDbA{e&xpy9?q8Dp zUPx!Z(Ixvuw9MXU*PfLBE&FemUz+vZ`+Yu%gccVHR%fpg0p1Og z{VV=qyXiterJaH&P&&<<`a_^{n?5zom=SIi?_epvl4-^$zx;}qS8f14{{b5>WtgoW zep|9mH!&}zZf1k*U6Q29d`E||PP-&1Rvhr2f&^JKS5+iyV!e~wX4IvWqY8JZsOXf1 zks?bm{JptGli5CYg>ilm6YQt^edQunqPAOsvT~hj1VzP)P9NwseD|c--zfByI+vxDqH&irhFr( zN#vAOem=Z+)afoxBPeydDw12lL^$8CHRzGI!ABSxMS*)cgy2*Gqhc)eq8{u$ht; zeWay|Ub%!&AkCnjDwY1(zV(&MLEb9y4>bqvTqst*> zvrYfd@>1s?aNNC`UwR^UN%|yUoR1voT!Rw(~^KQn;m^ zp*VGxFUt0s)jlJR#XJHXWG_W)mHwpQSFIhp<;<+WTClHM$2ToBQAe2iLzwx)`Zm49 zS>p+-zaZXopYjkzXPXZ zuL9ELS&ZzC!*aBcxtpXjtt>(9x8RC4B{lWIfX`~8a*_-Ukjs6FfA?ml`>pil5m}b1 zLj#`diwFfmU0L0iIu(Gq8|u;E#u80}y8W%H=oV$~5BcvAwLpfd%*4*4?scJe^qM`qw#G3xdJwGb;equ_BM?k)t=#k2D zRjsy`PNe0wdt6J@><4%u{mm)-(5Lp7o^w7=tAzBUaw>HcWvYjX6!Q8g0kyn>=CE0m zx2Kf^2}!1gZE3hFnPE|Cbt%whPtl-Sczrzch8_lfD|9Vf$mK66z+y3d=trx^B8T0s z7JW=XUdBB9SIr(d&k&M!0AeOFJ#xKabLI7@#_Sjlax=g48m~VP*sm# z7+}gY(YPTej34VzlggS)JPOPlta_uu<0IIYq#>J^t`yDfb>c=s5;g2UJ2hXq@A#;@ za)`S+Q9!3YAtrbm=lDpPZ+2^F#R44FB)C#jphcZJ8M)@7+Vna%xN&>K%ZiN@sX~nx zHm$+Yhh|N@;m`QfX0Y4z=Jhq#C59HFv%Jmsqi5$k+nbyib*9xy&z;rL5*;Rkx>%8g zq=~EvKuddEz>DZWb@(3q1^EbkKn+uxiSW93618Vn{7n(e5|Luk*n{Y*kpiElPDRvo z^D=GY_i@n%Y34bd3~OiSNsb2zEZ8YIcezc!D&;kRhf6yh5qG2;xwFi*SSiG#? z$zz;d29Ve!%i>HzU5Q&hpL=Wn?i_H1atcmJFy=mp7%5|a%cIuO8X6*tNTI6_ond)BDDn0yoQH3}AW7}W?+Vxe?`gQE26lXlf zeOy#PpHcJN2?(;hgDQMvfNxyY-RAr;zH^bH;ZfNWPjT;UFCWTSJw7vVSddrDFG!4( z7-*U1n{;GrPwAGJ*1ic*Z;eT};I)aHqwlGVRMAV*Jmau;+>zDtrAk)RqTTArOq$Zl zw%`e{NN#j%Ut+E530`Nmg<~!AhhtoDAucbD-QQ9EERcrGeCEdFPEBLddABR#Hsbd# z{tf&PourrOA*OD&e3q}^Rqj}yGci?K$JyiQ$@28@kS;MlLSBWbeNe(|fXC_QiDziu zOx@bAYL#SZY+aI2sOg)>favj?ML)J=PTVbk7bN6VeHB67!%Wgh#v|J%R(tgIa~7%- zyr+iBu(hbL2E9uIYS)Xi*@`;1y^qFp!V72`!laMC(%nTDFIwI{YnYUtA^fQ`}C?rX)1=2iKB}-{J}b;x0xRo%laWRrqv)@fYnjub-ll+ z+c0UnwLw(jtCFQjp?=80%ubcer(BDuK3jJAi_FUaj!d(LEk_=lkYa@NKN+7QrAcD& zs!u)TJC=9H3N&75CC+LqHS{gM_I*=E9dobK*QRD$Cg(3GSX5%(0L{wLuYb{Jfh=% z#@}SAi);y|3wnrA@X2k*r!Z&g`p5^$mQL1H5W4V>Pl`wx#Mj?On*?6G=r!k2E996y zj8*5Fs(QD~!`;~{nQM7h)I=tQZ{KUFCV!)IIrfSym%X-rj`!)0Dr1GlMX@5Ch+!+H zhEc%%VbX=tv~v9VlT7>abPJ}~2il0FARBY$7)+3>00T9(aq+6NqO(B7R_qBlR1$fN z2=$z+6(FSCUk)@kVh&btdTnt<^Q)K^GsK^tof<2B=$_0szNunduV}tjr4r+5baQi1 zNH3V9j_@tE0LI#yQmHE5ApWWqKlk&}8v=7@unJ{#4NBxk2AJDGCoVpYsGHCaV+yT! zs>xP-NdR7`K*CkU7D1L05mXJgmQr=uVC#>{Ugy`>R+shl)L)J?{c*H1b-e$sL92sH z4~U{>#pC0A*(`C|n|^^ovAt3;m(itk{h|r_?k8Wg7qrO^e?G7GvXf0w3rux#-Wv*E z|0{iV<9~;kpy;=fm!7>PnghA7NSFYb`7daa9k-TQ#(oY(axuW;df@S9U} ztBH+y7eu$bAEQ-NhkXdK;m|6U&}Ctb6spk%JDY&GuFj{A661LFA2~3c zn^)F`oDT}m+SA?`De4L~j0%OaO+DuRC~+@J@6`piW##8wTrq;opD!7)8BuNs@^pij zQSX|m$$aYfRh00SXp-3->i$3yzku%$6v_FH=vc4i)zvS_l`It+BTjoYd7t@gW_<|C z0;n({KapX?TNv;Mj;eg(%@?leuTE$3s;PdC%$T+^Ciz=vY8HlFOiMY$ee>nyb`a%I zYA6bYdGVc~C{ztjlA47Br2i0UNcD)N^5#o$t{}Z}I1jwlc*;s@WQXS|0xga6`57+! z@k`m-i+1+D_O8cI4XZEGa2zhT|9M^CYodQhkzJ$dp6WYe|KwfTeOz7 z$33JS-!i@gTm&h~{yM6?F_ich4EXo9U61A5+HX19g%!_d@krbE6iN3{m zU4Ao?c&LC~j4I#s(xO^PHkB4W+bkgLht8R_n^{4j^idsM3G4Sqvur5wd}WGduJ z&wU6JEVi9dbO;E{1&*a9i88F^k3+Y^-k4kp;$dP1FOEeeXCYD)901VANEiYl;VbbO zx09&x<5ZHA89p=c$7Y>NI>w znG7|L3v7$CF1yrQ`gFT(D!0{&X9C-O*Z+>wNQu5=yjNto->iDcR7O6PPg*ymv%%sv zCZ$~0JMc)jT;kitJ*XY0`Qw5AAvtkACJIvY4F~_H*5p569Oa=f`5I!$c(h3h2Ej;I z)iOBEa7{{SRD_C%*FIFKzk>RKK99`3GPX04t2jsOCS|@^{bUtM{^KI~$6nT|K!_`x zeLL#vv2fmc0m|T<130|i9KvaxsN=ns38|qXb;+SS8IBr+!Lp0C$Gs_di$^ORnkxB< zbI12aGvD0Iqj+$o3Q-3UqIeAl1J!_4zz;G%ip)v`V<9`d*nOz;eSC<(1o6$uD07mw z%FGkN1bHjBSomr_7vk94GmzAl&TeNgHmq5Ck~U0L|#87U{onZOGlv7#qs z2VG)rI8P3f{_3WhiwO@ux$fKNB9uYndCU9F$(wPV>jgY!d{Zg4Nxbyoonzi*5(e)R zQyisFmFailACkTx0AI}+KQufP=cR!+aBy?MlrYX3RWy#i3iLhLyKQC|o$sc0gv#i` z<~@#H^UR75JlKFcrs9>+lV0qB7FXXRXF@&Tb&hx*H%v30k2RDgYaiX+8LZQ5`1Stt ztznU#x2?bSEO^o!m{+V}tm1tYQ7Q`Q8ZQ#iD&_*%`kD3hW}Fy1KfM&dpDC;2?U7b7 zGs{a(kJ0J^ypu@Mn4YgYip=B8;p+9vOk}R$Tyn*vHgv$V;jvX)vH5{7;^T^O%d()A z^sPIqE_C$W#sSj%;i#^vycZUU)x0jN#hzTa7%uxJgU)BKB=_mOo&|(>h21r)Vi`}* zDxPV!irVTa#1z=yw|$iJeZM?jYfl?2zYQc^AuULTqQ>>NE-owXUNT7Dw#Q&=cZ3kY zaKO%)bg+pQSZ=mlFN5j%w%2h!>gxQYHTCjV`b-OA8BczUtb7);l65&yVl zl4YCGk<3#S+t;mjFaZ#Rc=)SPQQRvof_+)3YSMv=XJv-n>@$ zxAO8|)b0O8LjP3Vxd`#^OIFaA^Oi*8pPE5PO zYhoGe%iX(__OAC8IS+Y)Qj^u(RPC0JQ3V~H2YF8L8bm8CTyaB1gcQ=CxYT?dU)QT_ z(EcKQEtxy*R5Q;1E9Eb0p z(y6`vCn7*n-SEnRXy4{+_#em>m3zH0=dQI&TG5hJpk0j;v8bpkJ5Ou%A@eE;6!?_6 zG8J+HD1kx=aPrPE-Y{Fd`h%J;K8oIAnEF%zK=eQs+5r{BLke%Y9wdy@Vk&?k&`n=# z;HE1dvnxKD!mWpo=jd(zG>*d!-xPzG)m6cX7s?;MxSUSo#wIjx`1T?3Zs1g%ZNQ%U zf-)%$eu=1cXwVHfGXg?IdEejruNnRXmRqMp`N=pW4T*PD3rUW2HnR6)Vd@4ma$EPPHA-GeMZh4d@Y4`gfiU5bp> zdXuv1Hs#|XS6#ct0XXhnR(X75VGBwvE=NexHx7w;-^_ zi1(YTFy7_Zw*8OBGS(kTl#IS>=PW*Zi&dKSef_SB3XsM8XpCS&GoBbZjz>;w$N?0g zVNw!1@|{`lYM1pr)2nd=!$P$Zxn`{PUGvi27{qMfNiN>(f(3j8iq(nbGBeKvyG#UK zE1cQ>HB7hvONJ510KHv95uo>SP?2q#cU>{#$!OG)qi(wx&ES^wXWX4DO`ki|y!nXn zj$HuB;yYHB$c#8)!~H7G05{@$$!z24ZP)18H%&O6y#qK0sR>3y%P;gW&r%xBl&g7n z`2fV5%iGi6zScfR@`4`h&#@bTP zV|;k0R{0wXr3)qzbqRJGdvNEd7Tbf{Seu&nX2Fx$nrU~Sh^d6xD9ntwg= z{`Xwv_0NKom_@u0q?@379Y* z<&Y`;@ura+wPnVO*Q#<)XaWLhrd*-yU7yy3Ce`N=fOz;Ll$$ISq>roq_!7swJJi-l zHLA?1okI5e4BhIx>1Z`q2C0u$Yg5;6xq8OKo5V2rJSWaMkT0rGLpioFf|t)^ko_OJ z_5n4K#f^L=aA^oHl)U3pL}YAes2C$cbAS6lC}82R$DEu;;H_`vmm{r}s*h+mFaG#W zzhZEbPXg51j`V+uFeShvcyY!HEmMS6_UuJ3GiaEhC z;QPU!ZBcu>RSc{i0>c4uuPINik!gWf%!CHRMd71h_Db-qz)3sa4T0VdBj0F_eLj4o z?b_X!+G$eu8AmVlOmaq;+1^v;w~6&o{{!ly)f-MxuGnxFOw+uGqa%X<~tyq`sETlh<@hp(-_bwETO6PzBD{7(J|Cn0hgqRr_%7Vx)U;r`J@wO&P-~>e8LHcx90ag+Wgx^Gyr_X3SwS$KO8(xL|3)1JM{Xvw&ad*Y@@=P1LM3B!=9QoH)nOqIC zHdS!(pAf=-NW#?1`5zMQ61aR|wgtO=A9Anu1g+Ep28?#dKSL+ecwMPJf+8@qkEM&Y z`MSSk2I&slOnheeGuLIC41Q?9l`q#Wj4q4LEid4)J1sFAC#qrB6(Y^{=^pAjDBaP} zb0g0Mjnw>x-$%5XkeQ!MHZwq8HB$wtg-plnI<&yWSr~hpvPO3tes!HqW)0Cs^LMeA1NN+tKDDOA0 z8mu%&EKKbU<7t-P%B@F?CD|q$=QE$A%X^Ye9J5C;>33oWVxDg!6DP_cnn$jqDw-!; zgKCoWI!D5@dU2?SN5IMP|KMYaPNL655aK)WCQhsxTmLNnIgYk8UU-v5uR#3%lKTyM zOqct;DP|brB~Ic5N!u0MGw+A#IOnN5fv^RMV(96end-Iud1`HM0tT@CrcuYonC9p0 z7;NHQK?A40%#r?-av>;8VCl5ull-liF`ard!(!yCR2v^Y@K-TOTIU_?@qMA+Zjs&) zPU3T1Yy`x1@vTQOj{wg7AZRw|((qA&g|2T)@SOVR?3e(bQm!#>-AnI->f`T<864-I z1mT&MpwpMqy#Y+m?++)|$Te3=!|EkF%88>R;|>~0O()&a&3 zK=Jv4i$#2;*Hk2Exk-#jfoH`Xs%uj&`?aF3!Mb`y+k~M^uUSret}FXq(fh^p?sq51 zf9fq{=^GfU^A{90GlNfVft0bf?Mmsz=t^?_ZeX<^Rh$0(%04RL=24d*<-FbvA#?x@ zogl^d{~+!BQ}qV?CN48jKLIE5#|MOrm{9;5)4N+U@WPn2U`>nOZs&#aSAHzU)xY)~ z16|`fZzsmxy)OAv`GXRJX3qjiEiLr}lEKOW!8+$Yxp@;yqnKy^Fj9 zz;PqQ{Na*w=LEtYI?IXaZr^_IdFz)OBln9I8gGK=f(ba(W&w0xSqk<+WMDV~8{Z0|A1_yqqZa{dGWwuCohyZ%e> z51jibuHM?p4*k*zvV|43^3dQ0zKk{4p+%*PtAz|z3(WX_s}pIsIBLcV=))8F1dpOpQ#6UYt>OLT~>xkv@+^)+BwEI;ayZ53)R)P{DBV!9aUf!!^!Qg+gyk$)=;zgkV5`4b`gyhHm|HOlTI!Z<56$z4{_)V!&S^QR4R8psP$m;If%K!Eo z{^$SypHCG1#8&{nN(++>g#X=j@`nIt4=pt00-5p!dFUJ*;iLNj%JFAwZ1b}^YXp&& z0){mHHooTY4Kbn4LTUXMR7|L4AMm-qpV@ZiR;28O{*_GNfV3&o>3*EbVAJ+Q>ua0r z43fQHA6zf9&8h)aFd^gLdWGtrebJhpH5h~|%@QdcD*>ScX1-rx96Qe^!R(l+_Fh%K z&%v32e__QzxiCA}64c$nxuSXP}YxTya>Qd#R!4` z)pQ8Cr}@Z;6?jM`Lx`#%Fcu4)mL*4K0aS`gRg zKPC^jitnU6fMBaY>??mk_7>n(@C|^31hl5c{{^ucdjF=>s)Z1A-U2D)rSHgcYr-P) zjez((3*3%-`Ub_nCd`^0%uGE-kXb?8|4xBe`rcgbz=kiR(`6eI)6va8uLJ1;6Gcgi zH}$}26|?}~cNY7dG!N3B`U`SJ`~jBQ%$@b{D(J`A5}#{kqNOGTg;fo8{Tv5-^^1oO zz{2eWAw(bqGw{VB&dm0s2Oc`h39YFNeMv5B85Lob3?y`bP@E<4}3>< z?FH13hVlqIUHt7deZHQ;?W@1Hw$w6zAiwg^&!1$^^gBi089twSMymb`vP16RZN|uV z?nbh8IFsLbbdAJpri7ZC;vaXBFa4~WkWPQ0mBbjW!-s~oi+tNB|Nc&gAYT{!3)#qa+zZC{`RAK`+fWPG9^5eG=Q>tGf9~ zgaLEeC6R${Brena63Fd!Gu@lLV`oLjW2$?7K3tyS$vv0C{Rcp*epoVF>FP&mnYP{* z`1((Qg}3Z~L6>hJj+opC!0b-}OZB`0EkiFQxS_OawD)H z-l_iuJ(K}f4U`lBf}k(Nl0yIl2X8(<0wLNifk_u<$t1+_2C%u_Uxl1ssV1HO1#J%l zi{}5MTc*&;K(B53Np7BgOWHb_q)NnG%=$*57<{D*NEo~;z^9rujNKOpsRxW`6>jNi zdlZPghSJM^-L6E*1GEV__T>~%HF$;yLF3(ueW)cZoF?DRJk1txT^DKgVzZWb0P>c@ zyp{AWnm3+mpHktk!BJ(3OrA?;q`qu^O<|kz+-&bFv*N5*e0A8Fp(pjt>rP-cY3{3F z8E&Qdi>$uG*ETy+AF1Cy%X!baCQt2urZ#dgOsU>MYu+{WONGVVCF$BqxMTIcEL&9X z-W;H~y~rkKWJR(4fZKASA%kMn2g$H`z*jLdEgo0?M5aKpLy}_1HWCC_>vV7%Lueu4 zA}LQ@rPH1J$Rl%6*!%Hf7z*8QzAHj2Ej4Vj!bcHZ#f!L z*-eLErD%(8^uJGGyx#dDJT!l{cuJN@`7bDP&o09>*EH2B?Q-|;2hZr<`hBPQ0he>~ zXiBYaPf}B!^u?LW>0+Cu!;Tk25o+@*g~hpqxzE_$yby;_F|s&H@zNk0dUVA*=4d_U}dF4d)!u^GkB*} zqU%qO#b^2DcRkB|!;OAYxaQZ_UFOh8?l)$*x4d%U8I3h=Jm&8FyD{;1w|MVuJ)?qA j-PFx5VYRU>1PTw8E?mqLARZewndzgyAg9mZztjH@H7CnN diff --git a/public/lib/Cesium/Cesium.js b/public/lib/Cesium/Cesium.js index cf83367b..9b7d3257 100644 --- a/public/lib/Cesium/Cesium.js +++ b/public/lib/Cesium/Cesium.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * @@ -23,11 +23,11 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Cesium=(()=>{var wxe=Object.create;var l3=Object.defineProperty;var Dxe=Object.getOwnPropertyDescriptor;var Ixe=Object.getOwnPropertyNames;var Pxe=Object.getPrototypeOf,Oxe=Object.prototype.hasOwnProperty;var q_=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Ac=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rxe=(e,t)=>{for(var n in t)l3(e,n,{get:t[n],enumerable:!0})},jK=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ixe(t))!Oxe.call(e,r)&&r!==n&&l3(e,r,{get:()=>t[r],enumerable:!(i=Dxe(t,r))||i.enumerable});return e};var vr=(e,t,n)=>(n=e!=null?wxe(Pxe(e)):{},jK(t||!e||!e.__esModule?l3(n,"default",{value:e,enumerable:!0}):n,e)),Mxe=e=>jK(l3({},"__esModule",{value:!0}),e);var u3=Ac((_0t,qK)=>{var Gh=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Gh.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Gh.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Gh.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Gh.prototype.random_int31=function(){return this.random_int()>>>1};Gh.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Gh.prototype.random=function(){return this.random_int()*(1/4294967296)};Gh.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Gh.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};qK.exports=Gh});var dZ=Ac((QC,$C)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof QC=="object"&&QC&&!QC.nodeType&&QC,n=typeof $C=="object"&&$C&&!$C.nodeType&&$C,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",h=/^xn--/,A=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,E=Math.floor,S=String.fromCharCode,w;function D(V){throw new RangeError(C[V])}function R(V,G){for(var U=V.length,q=[];U--;)q[U]=G(V[U]);return q}function O(V,G){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(x,".");var Y=V.split("."),Q=R(Y,G).join(".");return q+Q}function L(V){for(var G=[],U=0,q=V.length,Y,Q;U=55296&&Y<=56319&&U65535&&(G-=65536,U+=S(G>>>10&1023|55296),G=56320|G&1023),U+=S(G),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function b(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function v(V,G,U){var q=0;for(V=U?E(V/f):V>>1,V+=E(V/G);V>T*c>>1;q+=s)V=E(V/T);return E(q+(T+1)*V/(V+u))}function I(V){var G=[],U=V.length,q,Y=0,Q=p,W=d,K,J,me,ye,se,_e,xe,De,Ee;for(K=V.lastIndexOf(g),K<0&&(K=0),J=0;J=128&&D("not-basic"),G.push(V.charCodeAt(J));for(me=K>0?K+1:0;me=U&&D("invalid-input"),xe=_(V.charCodeAt(me++)),(xe>=s||xe>E((o-Y)/se))&&D("overflow"),Y+=xe*se,De=_e<=W?a:_e>=W+c?c:_e-W,!(xeE(o/Ee)&&D("overflow"),se*=Ee;q=G.length+1,W=v(Y-ye,q,ye==0),E(Y/q)>o-Q&&D("overflow"),Q+=E(Y/q),Y%=q,G.splice(Y++,0,Q)}return N(G)}function M(V){var G,U,q,Y,Q,W,K,J,me,ye,se,_e=[],xe,De,Ee,Ne;for(V=L(V),xe=V.length,G=p,U=0,Q=d,W=0;W=G&&seE((o-U)/De)&&D("overflow"),U+=(K-G)*De,G=K,W=0;Wo&&D("overflow"),se==G){for(J=U,me=s;ye=me<=Q?a:me>=Q+c?c:me-Q,!(J{/*! +var Cesium=(()=>{var Gbe=Object.create;var h3=Object.defineProperty;var Wbe=Object.getOwnPropertyDescriptor;var jbe=Object.getOwnPropertyNames;var qbe=Object.getPrototypeOf,Ybe=Object.prototype.hasOwnProperty;var J_=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var tl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xbe=(e,t)=>{for(var n in t)h3(e,n,{get:t[n],enumerable:!0})},eJ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jbe(t))!Ybe.call(e,o)&&o!==n&&h3(e,o,{get:()=>t[o],enumerable:!(i=Wbe(t,o))||i.enumerable});return e};var Io=(e,t,n)=>(n=e!=null?Gbe(qbe(e)):{},eJ(t||!e||!e.__esModule?h3(n,"default",{value:e,enumerable:!0}):n,e)),Kbe=e=>eJ(h3({},"__esModule",{value:!0}),e);var p3=tl((q0t,nJ)=>{var Gh=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Gh.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Gh.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Gh.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Gh.prototype.random_int31=function(){return this.random_int()>>>1};Gh.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Gh.prototype.random=function(){return this.random_int()*(1/4294967296)};Gh.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Gh.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};nJ.exports=Gh});var BJ=tl((tT,nT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof tT=="object"&&tT&&!tT.nodeType&&tT,n=typeof nT=="object"&&nT&&!nT.nodeType&&nT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",h=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,A=Math.floor,S=String.fromCharCode,v;function I(U){throw new RangeError(C[U])}function O(U,G){for(var k=U.length,Y=[];k--;)Y[k]=G(U[k]);return Y}function R(U,G){var k=U.split("@"),Y="";k.length>1&&(Y=k[0]+"@",U=k[1]),U=U.replace(b,".");var j=U.split("."),$=O(j,G).join(".");return Y+$}function N(U){for(var G=[],k=0,Y=U.length,j,$;k=55296&&j<=56319&&k65535&&(G-=65536,k+=S(G>>>10&1023|55296),G=56320|G&1023),k+=S(G),k}).join("")}function _(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function E(U,G){return U+22+75*(U<26)-((G!=0)<<5)}function w(U,G,k){var Y=0;for(U=k?A(U/f):U>>1,U+=A(U/G);U>T*c>>1;Y+=s)U=A(U/T);return A(Y+(T+1)*U/(U+u))}function D(U){var G=[],k=U.length,Y,j=0,$=p,W=d,K,J,he,ge,se,_e,xe,Pe,ve;for(K=U.lastIndexOf(g),K<0&&(K=0),J=0;J=128&&I("not-basic"),G.push(U.charCodeAt(J));for(he=K>0?K+1:0;he=k&&I("invalid-input"),xe=_(U.charCodeAt(he++)),(xe>=s||xe>A((r-j)/se))&&I("overflow"),j+=xe*se,Pe=_e<=W?a:_e>=W+c?c:_e-W,!(xeA(r/ve)&&I("overflow"),se*=ve;Y=G.length+1,W=w(j-ge,Y,ge==0),A(j/Y)>r-$&&I("overflow"),$+=A(j/Y),j%=Y,G.splice(j++,0,$)}return F(G)}function M(U){var G,k,Y,j,$,W,K,J,he,ge,se,_e=[],xe,Pe,ve,we;for(U=N(U),xe=U.length,G=p,k=0,$=d,W=0;W=G&&seA((r-k)/Pe)&&I("overflow"),k+=(K-G)*Pe,G=K,W=0;Wr&&I("overflow"),se==G){for(J=k,he=s;ge=he<=$?a:he>=$+c?c:he-$,!(J{/*! * URI.js - Mutating URLs * IPv6 Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -35,11 +35,11 @@ var Cesium=(()=>{var wxe=Object.create;var l3=Object.defineProperty;var Dxe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof F3=="object"&&F3.exports?F3.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(mZ,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,A=0,x=-1,C=!1;for(d=0;dh&&(g=x,h=A)):s[d]==="0"&&(C=!0,x=d,A=1);A>h&&(g=x,h=A),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d{/*! + */(function(e,t){"use strict";typeof F3=="object"&&F3.exports?F3.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(kJ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,x=0,b=-1,C=!1;for(d=0;dh&&(g=b,h=x)):s[d]==="0"&&(C=!0,b=d,x=1);x>h&&(g=b,h=x),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -47,10 +47,10 @@ var Cesium=(()=>{var wxe=Object.create;var l3=Object.defineProperty;var Dxe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof U3=="object"&&U3.exports?U3.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(pZ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Hl=Ac((gZ,V3)=>{/*! + */(function(e,t){"use strict";typeof B3=="object"&&B3.exports?B3.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(VJ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Wl=tl((HJ,k3)=>{/*! * URI.js - Mutating URLs * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -58,10647 +58,9264 @@ var Cesium=(()=>{var wxe=Object.create;var l3=Object.defineProperty;var Dxe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof V3=="object"&&V3.exports?V3.exports=t(dZ(),hZ(),_Z()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(gZ,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(b,v){var I=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return I?M?new o(b,v):new o(b):new o;if(b===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(b),v!==void 0?this.absoluteTo(v):this}function s(b){return/^[0-9]+$/.test(b)}o.version="1.19.10";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function d(b){return f(b)==="Array"}function p(b,v){var I={},M,F;if(f(v)==="RegExp")I=null;else if(d(v))for(M=0,F=v.length;M]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(b){if(!(!b||!b.nodeName)){var v=b.nodeName.toLowerCase();if(!(v==="input"&&b.type!=="image"))return o.domAttributes[v]}};function x(b){return escape(b)}function C(b){return encodeURIComponent(b).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}o.encode=C,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=C,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(b,v){var I=o.encode(b+"");return v===void 0&&(v=o.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},o.decodeQuery=function(b,v){b+="",v===void 0&&(v=o.escapeQuerySpace);try{return o.decode(v?b.replace(/\+/g,"%20"):b)}catch{return b}};var T={encode:"encode",decode:"decode"},E,S=function(b,v){return function(I){try{return o[v](I+"").replace(o.characters[b][v].expression,function(M){return o.characters[b][v].map[M]})}catch{return I}}};for(E in T)o[E+"PathSegment"]=S("pathname",T[E]),o[E+"UrnPathSegment"]=S("urnpath",T[E]);var w=function(b,v,I){return function(M){var F;I?F=function(U){return o[v](o[I](U))}:F=o[v];for(var k=(M+"").split(b),V=0,G=k.length;V-1&&(v.fragment=b.substring(I+1)||null,b=b.substring(0,I)),I=b.indexOf("?"),I>-1&&(v.query=b.substring(I+1)||null,b=b.substring(0,I)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b.substring(0,2)==="//"?(v.protocol=null,b=b.substring(2),b=o.parseAuthority(b,v)):(I=b.indexOf(":"),I>-1&&(v.protocol=b.substring(0,I)||null,v.protocol&&!v.protocol.match(o.protocol_expression)?v.protocol=void 0:b.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(b=b.substring(I+3),b=o.parseAuthority(b,v)):(b=b.substring(I+1),v.urn=!0))),v.path=b,v},o.parseHost=function(b,v){b||(b=""),b=b.replace(/\\/g,"/");var I=b.indexOf("/"),M,F;if(I===-1&&(I=b.length),b.charAt(0)==="[")M=b.indexOf("]"),v.hostname=b.substring(1,M)||null,v.port=b.substring(M+2,I)||null,v.port==="/"&&(v.port=null);else{var k=b.indexOf(":"),V=b.indexOf("/"),G=b.indexOf(":",k+1);G!==-1&&(V===-1||G-1?F:b.length-1),V;return k>-1&&(F===-1||k-1?W=W.slice(0,K)+W.slice(K).replace(k,""):W=W.replace(k,""),!(W.length<=U[0].length)&&!(I.ignore&&I.ignore.test(W))){Q=q+W.length;var ye=v(W,q,Q,b);if(ye===void 0){M.lastIndex=Q;continue}ye=String(ye),b=b.slice(0,q)+ye+b.slice(Q),M.lastIndex=q+ye.length}}return M.lastIndex=0,b},o.ensureValidHostname=function(b,v){var I=!!b,M=!!v,F=!1;if(M&&(F=g(o.hostProtocols,v)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(b&&b.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(b){if(b){var v=Number(b);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},o.noConflict=function(b){if(b){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=r);return this},a.build=function(b){return b===!0?this._deferred_build=!0:(b===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(b){return function(v,I){return v===void 0?this._parts[b]||"":(this._parts[b]=v||null,this.build(!I),this)}}function R(b,v){return function(I,M){return I===void 0?this._parts[b]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[b]=I,this.build(!M),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=R("query","?"),a.fragment=R("fragment","#"),a.search=function(b,v){var I=this.query(b,v);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(b,v){var I=this.fragment(b,v);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(b,v){if(b===void 0||b===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?o.decodeUrnPath:o.decodePath)(I):I}else return this._parts.urn?this._parts.path=b?o.recodeUrnPath(b):"":this._parts.path=b?o.recodePath(b):"/",this.build(!v),this},a.path=a.pathname,a.href=function(b,v){var I;if(b===void 0)return this.toString();this._string="",this._parts=o._parts();var M=b instanceof o,F=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var k=o.getDomAttribute(b);b=b[k]||"",F=!1}if(!M&&F&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=o.parse(String(b),this._parts);else if(M||F){var V=M?b._parts:b;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},a.is=function(b){var v=!1,I=!1,M=!1,F=!1,k=!1,V=!1,G=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),v=I||M,F=!v,k=F&&n&&n.has(this._parts.hostname),V=F&&o.idn_expression.test(this._parts.hostname),G=F&&o.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return F;case"sld":return k;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return M;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var O=a.protocol,L=a.port,N=a.hostname;a.protocol=function(b,v){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(o.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,b,v)},a.scheme=a.protocol,a.port=function(b,v){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),o.ensureValidPort(b))),L.call(this,b,v))},a.hostname=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(b,I);if(M!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=I.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(b,this._parts.protocol)}return N.call(this,b,v)},a.origin=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=this.protocol(),M=this.authority();return M?(I?I+"://":"")+this.authority():""}else{var F=o(b);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var I=o.parseHost(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var I=o.parseAuthority(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=o.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),o.parseUserinfo(b,this._parts),this.build(!v),this},a.resource=function(b,v){var I;return b===void 0?this.path()+this.search()+this.hash():(I=o.parse(b),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},a.subdomain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),k=new RegExp("^"+u(F));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&o.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(k,b),this.build(!v),this}},a.domain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(v).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,b)}return this.build(!v),this}},a.tld=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var F;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b);else throw new TypeError('TLD "'+b+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return b?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,k=this._parts.path.substring(0,F),V=new RegExp("^"+u(k));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=o.recodePath(b),this._parts.path=this._parts.path.replace(V,b),this.build(!v),this}},a.filename=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(I+1);return b?o.decodePathSegment(M):M}else{var F=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(F=!0);var k=new RegExp(u(this.filename())+"$");return b=o.recodePath(b),this._parts.path=this._parts.path.replace(k,b),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),M=I.lastIndexOf("."),F,k;return M===-1?"":(F=I.substring(M+1),k=/^[a-z0-9%]+$/i.test(F)?F:"",b?o.decodePathSegment(k):k)}else{b.charAt(0)==="."&&(b=b.substring(1));var V=this.suffix(),G;if(V)b?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!b)return this;this._parts.path+="."+o.recodePath(b)}return G&&(b=o.recodePath(b),this._parts.path=this._parts.path.replace(G,b)),this.build(!v),this}},a.segment=function(b,v,I){var M=this._parts.urn?":":"/",F=this.path(),k=F.substring(0,1)==="/",V=F.split(M);if(b!==void 0&&typeof b!="number"&&(I=v,v=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(k&&V.shift(),b<0&&(b=Math.max(V.length+b,0)),v===void 0)return b===void 0?V:V[b];if(b===null||V[b]===void 0)if(d(v)){V=[];for(var G=0,U=v.length;G{/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */(function(e,t){typeof s5=="object"&&typeof a5<"u"?a5.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(s5,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:r}=Object,{freeze:o,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;c||(c=function(Re,dt,_t){return Re.apply(dt,_t)}),o||(o=function(Re){return Re}),s||(s=function(Re){return Re}),u||(u=function(Re,dt){return new Re(...dt)});let f=w(Array.prototype.forEach),d=w(Array.prototype.pop),p=w(Array.prototype.push),g=w(String.prototype.toLowerCase),h=w(String.prototype.toString),A=w(String.prototype.match),x=w(String.prototype.replace),C=w(String.prototype.indexOf),T=w(String.prototype.trim),E=w(RegExp.prototype.test),S=D(TypeError);function w(ke){return function(Re){for(var dt=arguments.length,_t=new Array(dt>1?dt-1:0),rt=1;rt/gm),Q=s(/\${[\w\W]*}/gm),W=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),J=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),me=s(/^(?:\w+script|data):/i),ye=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=s(/^html$/i);var _e=Object.freeze({__proto__:null,MUSTACHE_EXPR:q,ERB_EXPR:Y,TMPLIT_EXPR:Q,DATA_ATTR:W,ARIA_ATTR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:ye,DOCTYPE_NAME:se});let xe=()=>typeof window>"u"?null:window,De=function(Re,dt){if(typeof Re!="object"||typeof Re.createPolicy!="function")return null;let _t=null,rt="data-tt-policy-suffix";dt.currentScript&&dt.currentScript.hasAttribute(rt)&&(_t=dt.currentScript.getAttribute(rt));let hn="dompurify"+(_t?"#"+_t:"");try{return Re.createPolicy(hn,{createHTML(Rn){return Rn},createScriptURL(Rn){return Rn}})}catch{return console.warn("TrustedTypes policy "+hn+" could not be created."),null}};function Ee(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe(),Re=bn=>Ee(bn);if(Re.version="3.0.2",Re.removed=[],!ke||!ke.document||ke.document.nodeType!==9)return Re.isSupported=!1,Re;let dt=ke.document,{document:_t}=ke,{DocumentFragment:rt,HTMLTemplateElement:hn,Node:Rn,Element:Gt,NodeFilter:Ut,NamedNodeMap:Te=ke.NamedNodeMap||ke.MozNamedAttrMap,HTMLFormElement:Ae,DOMParser:ut,trustedTypes:ii}=ke,Je=Gt.prototype,ar=L(Je,"cloneNode"),ts=L(Je,"nextSibling"),Ba=L(Je,"childNodes"),No=L(Je,"parentNode");if(typeof hn=="function"){let bn=_t.createElement("template");bn.content&&bn.content.ownerDocument&&(_t=bn.content.ownerDocument)}let Mr=De(ii,dt),Ve=Mr?Mr.createHTML(""):"",{implementation:ot,createNodeIterator:je,createDocumentFragment:Qe,getElementsByTagName:pt}=_t,{importNode:zt}=dt,Jt={};Re.isSupported=typeof e=="function"&&typeof No=="function"&&ot&&typeof ot.createHTMLDocument<"u";let{MUSTACHE_EXPR:rr,ERB_EXPR:gr,TMPLIT_EXPR:ns,DATA_ATTR:Vs,ARIA_ATTR:lo,IS_SCRIPT_OR_DATA:Wi,ATTR_WHITESPACE:Yo}=_e,{IS_ALLOWED_URI:Vn}=_e,ln=null,Kn=R({},[...N,..._,...b,...I,...F]),wn=null,ks=R({},[...k,...V,...G,...U]),hi=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ma=null,zu=null,Qf=!0,zs=!0,JS=!1,Wr=!0,Br=!1,ha=!1,Cr=!1,Hs=!1,Lr=!1,$f=!1,gs=!1,Vh=!0,r3=!1,yxe="user-content-",zH=!0,ZS=!1,kC={},zC=null,OK=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),RK=null,MK=R({},["audio","video","img","source","image","track"]),HH=null,BK=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),o3="http://www.w3.org/1998/Math/MathML",s3="http://www.w3.org/2000/svg",kh="http://www.w3.org/1999/xhtml",HC=kh,GH=!1,WH=null,Axe=R({},[o3,s3,kh],h),_0,xxe=["application/xhtml+xml","text/html"],Cxe="text/html",Gs,GC=null,Txe=_t.createElement("form"),LK=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},jH=function(Ie){GC&&GC===Ie||((!Ie||typeof Ie!="object")&&(Ie={}),Ie=O(Ie),_0=xxe.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?_0=Cxe:_0=Ie.PARSER_MEDIA_TYPE,Gs=_0==="application/xhtml+xml"?h:g,ln="ALLOWED_TAGS"in Ie?R({},Ie.ALLOWED_TAGS,Gs):Kn,wn="ALLOWED_ATTR"in Ie?R({},Ie.ALLOWED_ATTR,Gs):ks,WH="ALLOWED_NAMESPACES"in Ie?R({},Ie.ALLOWED_NAMESPACES,h):Axe,HH="ADD_URI_SAFE_ATTR"in Ie?R(O(BK),Ie.ADD_URI_SAFE_ATTR,Gs):BK,RK="ADD_DATA_URI_TAGS"in Ie?R(O(MK),Ie.ADD_DATA_URI_TAGS,Gs):MK,zC="FORBID_CONTENTS"in Ie?R({},Ie.FORBID_CONTENTS,Gs):OK,ma="FORBID_TAGS"in Ie?R({},Ie.FORBID_TAGS,Gs):{},zu="FORBID_ATTR"in Ie?R({},Ie.FORBID_ATTR,Gs):{},kC="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,Qf=Ie.ALLOW_ARIA_ATTR!==!1,zs=Ie.ALLOW_DATA_ATTR!==!1,JS=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,Wr=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Br=Ie.SAFE_FOR_TEMPLATES||!1,ha=Ie.WHOLE_DOCUMENT||!1,Lr=Ie.RETURN_DOM||!1,$f=Ie.RETURN_DOM_FRAGMENT||!1,gs=Ie.RETURN_TRUSTED_TYPE||!1,Hs=Ie.FORCE_BODY||!1,Vh=Ie.SANITIZE_DOM!==!1,r3=Ie.SANITIZE_NAMED_PROPS||!1,zH=Ie.KEEP_CONTENT!==!1,ZS=Ie.IN_PLACE||!1,Vn=Ie.ALLOWED_URI_REGEXP||J,HC=Ie.NAMESPACE||kh,hi=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&LK(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(hi.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&LK(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(hi.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(hi.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Br&&(zs=!1),$f&&(Lr=!0),kC&&(ln=R({},[...F]),wn=[],kC.html===!0&&(R(ln,N),R(wn,k)),kC.svg===!0&&(R(ln,_),R(wn,V),R(wn,U)),kC.svgFilters===!0&&(R(ln,b),R(wn,V),R(wn,U)),kC.mathMl===!0&&(R(ln,I),R(wn,G),R(wn,U))),Ie.ADD_TAGS&&(ln===Kn&&(ln=O(ln)),R(ln,Ie.ADD_TAGS,Gs)),Ie.ADD_ATTR&&(wn===ks&&(wn=O(wn)),R(wn,Ie.ADD_ATTR,Gs)),Ie.ADD_URI_SAFE_ATTR&&R(HH,Ie.ADD_URI_SAFE_ATTR,Gs),Ie.FORBID_CONTENTS&&(zC===OK&&(zC=O(zC)),R(zC,Ie.FORBID_CONTENTS,Gs)),zH&&(ln["#text"]=!0),ha&&R(ln,["html","head","body"]),ln.table&&(R(ln,["tbody"]),delete ma.tbody),o&&o(Ie),GC=Ie)},NK=R({},["mi","mo","mn","ms","mtext"]),FK=R({},["foreignobject","desc","title","annotation-xml"]),Exe=R({},["title","style","font","a","script"]),a3=R({},_);R(a3,b),R(a3,v);let YH=R({},I);R(YH,M);let bxe=function(Ie){let Ct=No(Ie);(!Ct||!Ct.tagName)&&(Ct={namespaceURI:HC,tagName:"template"});let Kt=g(Ie.tagName),Sr=g(Ct.tagName);return WH[Ie.namespaceURI]?Ie.namespaceURI===s3?Ct.namespaceURI===kh?Kt==="svg":Ct.namespaceURI===o3?Kt==="svg"&&(Sr==="annotation-xml"||NK[Sr]):!!a3[Kt]:Ie.namespaceURI===o3?Ct.namespaceURI===kh?Kt==="math":Ct.namespaceURI===s3?Kt==="math"&&FK[Sr]:!!YH[Kt]:Ie.namespaceURI===kh?Ct.namespaceURI===s3&&!FK[Sr]||Ct.namespaceURI===o3&&!NK[Sr]?!1:!YH[Kt]&&(Exe[Kt]||!a3[Kt]):!!(_0==="application/xhtml+xml"&&WH[Ie.namespaceURI]):!1},g0=function(Ie){p(Re.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},qH=function(Ie,Ct){try{p(Re.removed,{attribute:Ct.getAttributeNode(Ie),from:Ct})}catch{p(Re.removed,{attribute:null,from:Ct})}if(Ct.removeAttribute(Ie),Ie==="is"&&!wn[Ie])if(Lr||$f)try{g0(Ct)}catch{}else try{Ct.setAttribute(Ie,"")}catch{}},UK=function(Ie){let Ct,Kt;if(Hs)Ie=""+Ie;else{let Hu=A(Ie,/^[\r\n\t ]+/);Kt=Hu&&Hu[0]}_0==="application/xhtml+xml"&&HC===kh&&(Ie=''+Ie+"");let Sr=Mr?Mr.createHTML(Ie):Ie;if(HC===kh)try{Ct=new ut().parseFromString(Sr,_0)}catch{}if(!Ct||!Ct.documentElement){Ct=ot.createDocument(HC,"template",null);try{Ct.documentElement.innerHTML=GH?Ve:Sr}catch{}}let Ws=Ct.body||Ct.documentElement;return Ie&&Kt&&Ws.insertBefore(_t.createTextNode(Kt),Ws.childNodes[0]||null),HC===kh?pt.call(Ct,ha?"html":"body")[0]:ha?Ct.documentElement:Ws},VK=function(Ie){return je.call(Ie.ownerDocument||Ie,Ie,Ut.SHOW_ELEMENT|Ut.SHOW_COMMENT|Ut.SHOW_TEXT,null,!1)},Sxe=function(Ie){return Ie instanceof Ae&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof Te)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},c3=function(Ie){return typeof Rn=="object"?Ie instanceof Rn:Ie&&typeof Ie=="object"&&typeof Ie.nodeType=="number"&&typeof Ie.nodeName=="string"},zh=function(Ie,Ct,Kt){Jt[Ie]&&f(Jt[Ie],Sr=>{Sr.call(Re,Ct,Kt,GC)})},kK=function(Ie){let Ct;if(zh("beforeSanitizeElements",Ie,null),Sxe(Ie))return g0(Ie),!0;let Kt=Gs(Ie.nodeName);if(zh("uponSanitizeElement",Ie,{tagName:Kt,allowedTags:ln}),Ie.hasChildNodes()&&!c3(Ie.firstElementChild)&&(!c3(Ie.content)||!c3(Ie.content.firstElementChild))&&E(/<[/\w]/g,Ie.innerHTML)&&E(/<[/\w]/g,Ie.textContent))return g0(Ie),!0;if(!ln[Kt]||ma[Kt]){if(!ma[Kt]&&HK(Kt)&&(hi.tagNameCheck instanceof RegExp&&E(hi.tagNameCheck,Kt)||hi.tagNameCheck instanceof Function&&hi.tagNameCheck(Kt)))return!1;if(zH&&!zC[Kt]){let Sr=No(Ie)||Ie.parentNode,Ws=Ba(Ie)||Ie.childNodes;if(Ws&&Sr){let Hu=Ws.length;for(let Ao=Hu-1;Ao>=0;--Ao)Sr.insertBefore(ar(Ws[Ao],!0),ts(Ie))}}return g0(Ie),!0}return Ie instanceof Gt&&!bxe(Ie)||(Kt==="noscript"||Kt==="noembed")&&E(/<\/no(script|embed)/i,Ie.innerHTML)?(g0(Ie),!0):(Br&&Ie.nodeType===3&&(Ct=Ie.textContent,Ct=x(Ct,rr," "),Ct=x(Ct,gr," "),Ct=x(Ct,ns," "),Ie.textContent!==Ct&&(p(Re.removed,{element:Ie.cloneNode()}),Ie.textContent=Ct)),zh("afterSanitizeElements",Ie,null),!1)},zK=function(Ie,Ct,Kt){if(Vh&&(Ct==="id"||Ct==="name")&&(Kt in _t||Kt in Txe))return!1;if(!(zs&&!zu[Ct]&&E(Vs,Ct))){if(!(Qf&&E(lo,Ct))){if(!wn[Ct]||zu[Ct]){if(!(HK(Ie)&&(hi.tagNameCheck instanceof RegExp&&E(hi.tagNameCheck,Ie)||hi.tagNameCheck instanceof Function&&hi.tagNameCheck(Ie))&&(hi.attributeNameCheck instanceof RegExp&&E(hi.attributeNameCheck,Ct)||hi.attributeNameCheck instanceof Function&&hi.attributeNameCheck(Ct))||Ct==="is"&&hi.allowCustomizedBuiltInElements&&(hi.tagNameCheck instanceof RegExp&&E(hi.tagNameCheck,Kt)||hi.tagNameCheck instanceof Function&&hi.tagNameCheck(Kt))))return!1}else if(!HH[Ct]){if(!E(Vn,x(Kt,Yo,""))){if(!((Ct==="src"||Ct==="xlink:href"||Ct==="href")&&Ie!=="script"&&C(Kt,"data:")===0&&RK[Ie])){if(!(JS&&!E(Wi,x(Kt,Yo,"")))){if(Kt)return!1}}}}}}return!0},HK=function(Ie){return Ie.indexOf("-")>0},GK=function(Ie){let Ct,Kt,Sr,Ws;zh("beforeSanitizeAttributes",Ie,null);let{attributes:Hu}=Ie;if(!Hu)return;let Ao={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:wn};for(Ws=Hu.length;Ws--;){Ct=Hu[Ws];let{name:Em,namespaceURI:XH}=Ct;if(Kt=Em==="value"?Ct.value:T(Ct.value),Sr=Gs(Em),Ao.attrName=Sr,Ao.attrValue=Kt,Ao.keepAttr=!0,Ao.forceKeepAttr=void 0,zh("uponSanitizeAttribute",Ie,Ao),Kt=Ao.attrValue,Ao.forceKeepAttr||(qH(Em,Ie),!Ao.keepAttr))continue;if(!Wr&&E(/\/>/i,Kt)){qH(Em,Ie);continue}Br&&(Kt=x(Kt,rr," "),Kt=x(Kt,gr," "),Kt=x(Kt,ns," "));let WK=Gs(Ie.nodeName);if(zK(WK,Sr,Kt)){if(r3&&(Sr==="id"||Sr==="name")&&(qH(Em,Ie),Kt=yxe+Kt),Mr&&typeof ii=="object"&&typeof ii.getAttributeType=="function"&&!XH)switch(ii.getAttributeType(WK,Sr)){case"TrustedHTML":Kt=Mr.createHTML(Kt);break;case"TrustedScriptURL":Kt=Mr.createScriptURL(Kt);break}try{XH?Ie.setAttributeNS(XH,Em,Kt):Ie.setAttribute(Em,Kt),d(Re.removed)}catch{}}}zh("afterSanitizeAttributes",Ie,null)},vxe=function bn(Ie){let Ct,Kt=VK(Ie);for(zh("beforeSanitizeShadowDOM",Ie,null);Ct=Kt.nextNode();)zh("uponSanitizeShadowNode",Ct,null),!kK(Ct)&&(Ct.content instanceof rt&&bn(Ct.content),GK(Ct));zh("afterSanitizeShadowDOM",Ie,null)};return Re.sanitize=function(bn){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ct,Kt,Sr,Ws;if(GH=!bn,GH&&(bn=""),typeof bn!="string"&&!c3(bn)){if(typeof bn.toString!="function")throw S("toString is not a function");if(bn=bn.toString(),typeof bn!="string")throw S("dirty is not a string, aborting")}if(!Re.isSupported)return bn;if(Cr||jH(Ie),Re.removed=[],typeof bn=="string"&&(ZS=!1),ZS){if(bn.nodeName){let Em=Gs(bn.nodeName);if(!ln[Em]||ma[Em])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(bn instanceof Rn)Ct=UK(""),Kt=Ct.ownerDocument.importNode(bn,!0),Kt.nodeType===1&&Kt.nodeName==="BODY"||Kt.nodeName==="HTML"?Ct=Kt:Ct.appendChild(Kt);else{if(!Lr&&!Br&&!ha&&bn.indexOf("<")===-1)return Mr&&gs?Mr.createHTML(bn):bn;if(Ct=UK(bn),!Ct)return Lr?null:gs?Ve:""}Ct&&Hs&&g0(Ct.firstChild);let Hu=VK(ZS?bn:Ct);for(;Sr=Hu.nextNode();)kK(Sr)||(Sr.content instanceof rt&&vxe(Sr.content),GK(Sr));if(ZS)return bn;if(Lr){if($f)for(Ws=Qe.call(Ct.ownerDocument);Ct.firstChild;)Ws.appendChild(Ct.firstChild);else Ws=Ct;return(wn.shadowroot||wn.shadowrootmod)&&(Ws=zt.call(dt,Ws,!0)),Ws}let Ao=ha?Ct.outerHTML:Ct.innerHTML;return ha&&ln["!doctype"]&&Ct.ownerDocument&&Ct.ownerDocument.doctype&&Ct.ownerDocument.doctype.name&&E(se,Ct.ownerDocument.doctype.name)&&(Ao=" -`+Ao),Br&&(Ao=x(Ao,rr," "),Ao=x(Ao,gr," "),Ao=x(Ao,ns," ")),Mr&&gs?Mr.createHTML(Ao):Ao},Re.setConfig=function(bn){jH(bn),Cr=!0},Re.clearConfig=function(){GC=null,Cr=!1},Re.isValidAttribute=function(bn,Ie,Ct){GC||jH({});let Kt=Gs(bn),Sr=Gs(Ie);return zK(Kt,Sr,Ct)},Re.addHook=function(bn,Ie){typeof Ie=="function"&&(Jt[bn]=Jt[bn]||[],p(Jt[bn],Ie))},Re.removeHook=function(bn){if(Jt[bn])return d(Jt[bn])},Re.removeHooks=function(bn){Jt[bn]&&(Jt[bn]=[])},Re.removeAllHooks=function(){Jt={}},Re}var Ne=Ee();return Ne})});var Soe=Ac((Tpn,boe)=>{boe.exports=PHe;function PHe(e,t,n){return tn?n:e:et?t:e}});var Ioe=Ac((Epn,Doe)=>{"use strict";var OHe=Soe();Doe.exports=RHe;var hR=1e20;function RHe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,h,A;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),h=0,A=u.length;h{function GHe(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,A=15,x=16,C=17,T=0,E=1,S=2,w=3,D=4;function R(_,b){return 55296<=_.charCodeAt(b)&&_.charCodeAt(b)<=56319&&56320<=_.charCodeAt(b+1)&&_.charCodeAt(b+1)<=57343}function O(_,b){b===void 0&&(b=0);var v=_.charCodeAt(b);if(55296<=v&&v<=56319&&b<_.length-1){var I=v,M=_.charCodeAt(b+1);return 56320<=M&&M<=57343?(I-55296)*1024+(M-56320)+65536:I}if(56320<=v&&v<=57343&&b>=1){var I=_.charCodeAt(b-1),M=v;return 55296<=I&&I<=56319?(I-55296)*1024+(M-56320)+65536:M}return v}function L(_,b,v){var I=[_].concat(b).concat([v]),M=I[I.length-2],F=v,k=I.lastIndexOf(h);if(k>1&&I.slice(1,k).every(function(U){return U==i})&&[i,g,C].indexOf(_)==-1)return S;var V=I.lastIndexOf(r);if(V>0&&I.slice(1,V).every(function(U){return U==r})&&[p,r].indexOf(M)==-1)return I.filter(function(U){return U==r}).length%2==1?w:D;if(M==e&&F==t)return T;if(M==n||M==e||M==t)return F==h&&b.every(function(U){return U==i})?S:E;if(F==n||F==e||F==t)return E;if(M==s&&(F==s||F==a||F==u||F==f))return T;if((M==u||M==a)&&(F==a||F==c))return T;if((M==f||M==c)&&F==c)return T;if(F==i||F==A)return T;if(F==o)return T;if(M==p)return T;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,C].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(U){return U==i})&&F==h||M==A&&[x,C].indexOf(F)!=-1?T:b.indexOf(r)!=-1?S:M==r&&F==r?T:E}this.nextBreak=function(_,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=_.length-1)return _.length;for(var v=N(O(_,b)),I=[],M=b+1;M<_.length;M++)if(!R(_,M-1)){var F=N(O(_,M));if(L(v,I,F))return M;I.push(F)}return _.length},this.splitGraphemes=function(_){for(var b=[],v=0,I;(I=this.nextBreak(_,v))<_.length;)b.push(_.slice(v,I)),v=I;return v<_.length&&b.push(_.slice(v)),b},this.iterateGraphemes=function(_){var b=0,v={next:function(){var I,M;return(M=this.nextBreak(_,b))<_.length?(I=_.slice(b,M),b=M,{value:I,done:!1}):b<_.length?(I=_.slice(b),b=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(_){for(var b=0,v=0,I;(I=this.nextBreak(_,v))<_.length;)v=I,b++;return v<_.length&&b++,b};function N(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?A:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?x:128102<=_&&_<=128105?C:d}return this}typeof hV<"u"&&hV.exports&&(hV.exports=GHe)});var _se=Ac((DAn,j6)=>{"use strict";j6.exports=CV;j6.exports.default=CV;function CV(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,o=mse(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;var a,c,u,f,d,p,g;if(i&&(o=q8e(e,t,o,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;hu&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return UR(o,s,n,a,c,g,0),s}function mse(e,t,n,i,r){var o,s;if(r===W6(e,t,n,i)>0)for(o=t;o=t;o-=i)s=dse(o,e[o],e[o+1],s);return s&&TV(s,s.next)&&(kR(s),s=s.next),s}function ZA(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(TV(n,n.next)||So(n.prev,n,n.next)===0)){if(kR(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function UR(e,t,n,i,r,o,s){if(e){!s&&o&&Q8e(e,i,r,o);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,o?W8e(e,i,r,o):G8e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),kR(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=j8e(ZA(e),t,n),UR(e,t,n,i,r,o,2)):s===2&&Y8e(e,t,n,i,r,o):UR(ZA(e),t,n,i,r,o,1);break}}}}function G8e(e){var t=e.prev,n=e,i=e.next;if(So(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=ro?r>s?r:s:o>s?o:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&hE(r,a,o,c,s,u,h.x,h.y)&&So(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function W8e(e,t,n,i){var r=e.prev,o=e,s=e.next;if(So(r,o,s)>=0)return!1;for(var a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=ac?a>u?a:u:c>u?c:u,x=f>d?f>p?f:p:d>p?d:p,C=H6(g,h,t,n,i),T=H6(A,x,t,n,i),E=e.prevZ,S=e.nextZ;E&&E.z>=C&&S&&S.z<=T;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&hE(a,f,c,d,u,p,E.x,E.y)&&So(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&hE(a,f,c,d,u,p,S.x,S.y)&&So(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=C;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&hE(a,f,c,d,u,p,E.x,E.y)&&So(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&hE(a,f,c,d,u,p,S.x,S.y)&&So(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function j8e(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!TV(r,o)&&hse(r,i,i.next,o)&&VR(r,o)&&VR(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),kR(i),kR(i.next),i=e=o),i=i.next}while(i!==e);return ZA(i)}function Y8e(e,t,n,i,r,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&t5e(s,a)){var c=pse(s,a);s=ZA(s,s.next),c=ZA(c,c.next),UR(s,t,n,i,r,o,0),UR(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function q8e(e,t,n,i){var r=[],o,s,a,c,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>o&&(o=a,s=n.x=n.x&&n.x>=u&&i!==n.x&&hE(rs.x||n.x===s.x&&Z8e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function Z8e(e,t){return So(e.prev,e,t.prev)<0&&So(t.next,e,e.next)<0}function Q8e(e,t,n,i){var r=e;do r.z===0&&(r.z=H6(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,$8e(r)}function $8e(e){var t,n,i,r,o,s,a,c,u=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1);return e}function H6(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function e5e(e){var t=e,n=e;do(t.x=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function t5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!n5e(e,t)&&(VR(e,t)&&VR(t,e)&&i5e(e,t)&&(So(e.prev,e,t.prev)||So(e,t.prev,t))||TV(e,t)&&So(e.prev,e,e.next)>0&&So(t.prev,t,t.next)>0)}function So(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function TV(e,t){return e.x===t.x&&e.y===t.y}function hse(e,t,n,i){var r=xV(So(e,t,n)),o=xV(So(e,t,i)),s=xV(So(n,i,e)),a=xV(So(n,i,t));return!!(r!==o&&s!==a||r===0&&AV(e,n,t)||o===0&&AV(e,i,t)||s===0&&AV(n,e,i)||a===0&&AV(n,t,i))}function AV(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function xV(e){return e>0?1:e<0?-1:0}function n5e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&hse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function VR(e,t){return So(e.prev,e,e.next)<0?So(e,t,e.next)>=0&&So(e,e.prev,t)>=0:So(e,t,e.prev)<0||So(e,e.next,t)<0}function i5e(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function pse(e,t){var n=new G6(e.i,e.x,e.y),i=new G6(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function dse(e,t,n,i){var r=new G6(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function kR(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function G6(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}CV.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(W6(e,0,o,n));if(r)for(var a=0,c=t.length;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}});var Lue=Ac((CW,TW)=>{(function(e,t){typeof CW=="object"&&typeof TW<"u"?TW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(CW,function(){"use strict";function e(x,C,T,E,S){(function w(D,R,O,L,N){for(;L>O;){if(L-O>600){var _=L-O+1,b=R-O+1,v=Math.log(_),I=.5*Math.exp(2*v/3),M=.5*Math.sqrt(v*I*(_-I)/_)*(b-_/2<0?-1:1),F=Math.max(O,Math.floor(R-b*I/_+M)),k=Math.min(L,Math.floor(R+(_-b)*I/_+M));w(D,R,F,k,N)}var V=D[R],G=O,U=L;for(t(D,O,R),N(D[L],V)>0&&t(D,O,L);G0;)U--}N(D[O],V)===0?t(D,O,U):t(D,++U,L),U<=R&&(O=U+1),R<=U&&(L=U-1)}})(x,C,T||0,E||x.length-1,S||n)}function t(x,C,T){var E=x[C];x[C]=x[T],x[T]=E}function n(x,C){return xC?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(x,C,T){if(!T)return C.indexOf(x);for(var E=0;E=x.minX&&C.maxY>=x.minY}function h(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(x,C,T,E,S){for(var w=[C,T];w.length;)if(!((T=w.pop())-(C=w.pop())<=E)){var D=C+Math.ceil((T-C)/E/2)*E;e(x,D,C,T,S),w.push(C,D,D,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var C=this.data,T=[];if(!g(x,C))return T;for(var E=this.toBBox,S=[];C;){for(var w=0;w=0&&S[C].children.length>this._maxEntries;)this._split(S,C),C--;this._adjustParentBBoxes(E,S,C)},i.prototype._split=function(x,C){var T=x[C],E=T.children.length,S=this._minEntries;this._chooseSplitAxis(T,S,E);var w=this._chooseSplitIndex(T,S,E),D=h(T.children.splice(w,T.children.length-w));D.height=T.height,D.leaf=T.leaf,o(T,this.toBBox),o(D,this.toBBox),C?x[C-1].children.push(D):this._splitRoot(T,D)},i.prototype._splitRoot=function(x,C){this.data=h([x,C]),this.data.height=x.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,C,T){for(var E,S,w,D,R,O,L,N=1/0,_=1/0,b=C;b<=T-C;b++){var v=s(x,0,b,this.toBBox),I=s(x,b,T,this.toBBox),M=(S=v,w=I,D=void 0,R=void 0,O=void 0,L=void 0,D=Math.max(S.minX,w.minX),R=Math.max(S.minY,w.minY),O=Math.min(S.maxX,w.maxX),L=Math.min(S.maxY,w.maxY),Math.max(0,O-D)*Math.max(0,L-R)),F=f(v)+f(I);M=C;N--){var _=x.children[N];a(D,x.leaf?S(_):_),R+=d(D)}return R},i.prototype._adjustParentBBoxes=function(x,C,T){for(var E=T;E>=0;E--)a(C[E],x)},i.prototype._condense=function(x){for(var C=x.length-1,T=void 0;C>=0;C--)x[C].children.length===0?C>0?(T=x[C-1].children).splice(T.indexOf(x[C]),1):this.clear():o(x[C],this.toBBox)},i})});var Vj=Ac((exports,module)=>{/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc + */(function(e,t){"use strict";typeof k3=="object"&&k3.exports?k3.exports=t(BJ(),UJ(),zJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(HJ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,w){var D=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof r))return D?M?new r(E,w):new r(E):new r;if(E===void 0){if(D)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&D)throw new TypeError("null is not a valid argument for URI");return this.href(E),w!==void 0?this.absoluteTo(w):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,w){var D={},M,B;if(f(w)==="RegExp")D=null;else if(d(w))for(M=0,B=w.length;M]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var w=E.nodeName.toLowerCase();if(!(w==="input"&&E.type!=="image"))return r.domAttributes[w]}};function b(E){return escape(E)}function C(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(E,w){var D=r.encode(E+"");return w===void 0&&(w=r.escapeQuerySpace),w?D.replace(/%20/g,"+"):D},r.decodeQuery=function(E,w){E+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?E.replace(/\+/g,"%20"):E)}catch{return E}};var T={encode:"encode",decode:"decode"},A,S=function(E,w){return function(D){try{return r[w](D+"").replace(r.characters[E][w].expression,function(M){return r.characters[E][w].map[M]})}catch{return D}}};for(A in T)r[A+"PathSegment"]=S("pathname",T[A]),r[A+"UrnPathSegment"]=S("urnpath",T[A]);var v=function(E,w,D){return function(M){var B;D?B=function(k){return r[w](r[D](k))}:B=r[w];for(var V=(M+"").split(E),U=0,G=V.length;U-1&&(w.fragment=E.substring(D+1)||null,E=E.substring(0,D)),D=E.indexOf("?"),D>-1&&(w.query=E.substring(D+1)||null,E=E.substring(0,D)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(w.protocol=null,E=E.substring(2),E=r.parseAuthority(E,w)):(D=E.indexOf(":"),D>-1&&(w.protocol=E.substring(0,D)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:E.substring(D+1,D+3).replace(/\\/g,"/")==="//"?(E=E.substring(D+3),E=r.parseAuthority(E,w)):(E=E.substring(D+1),w.urn=!0))),w.path=E,w},r.parseHost=function(E,w){E||(E=""),E=E.replace(/\\/g,"/");var D=E.indexOf("/"),M,B;if(D===-1&&(D=E.length),E.charAt(0)==="[")M=E.indexOf("]"),w.hostname=E.substring(1,M)||null,w.port=E.substring(M+2,D)||null,w.port==="/"&&(w.port=null);else{var V=E.indexOf(":"),U=E.indexOf("/"),G=E.indexOf(":",V+1);G!==-1&&(U===-1||G-1?B:E.length-1),U;return V>-1&&(B===-1||V-1?W=W.slice(0,K)+W.slice(K).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(D.ignore&&D.ignore.test(W))){$=Y+W.length;var ge=w(W,Y,$,E);if(ge===void 0){M.lastIndex=$;continue}ge=String(ge),E=E.slice(0,Y)+ge+E.slice($),M.lastIndex=Y+ge.length}}return M.lastIndex=0,E},r.ensureValidHostname=function(E,w){var D=!!E,M=!!w,B=!1;if(M&&(B=g(r.hostProtocols,w)),B&&!D)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var w=Number(E);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(E){return function(w,D){return w===void 0?this._parts[E]||"":(this._parts[E]=w||null,this.build(!D),this)}}function O(E,w){return function(D,M){return D===void 0?this._parts[E]||"":(D!==null&&(D=D+"",D.charAt(0)===w&&(D=D.substring(1))),this._parts[E]=D,this.build(!M),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(E,w){var D=this.query(E,w);return typeof D=="string"&&D.length?"?"+D:D},a.hash=function(E,w){var D=this.fragment(E,w);return typeof D=="string"&&D.length?"#"+D:D},a.pathname=function(E,w){if(E===void 0||E===!0){var D=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(D):D}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!w),this},a.path=a.pathname,a.href=function(E,w){var D;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var M=E instanceof r,B=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var V=r.getDomAttribute(E);E=E[V]||"",B=!1}if(!M&&B&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(M||B){var U=M?E._parts:E;for(D in U)D!=="query"&&c.call(this._parts,D)&&(this._parts[D]=U[D]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(E){var w=!1,D=!1,M=!1,B=!1,V=!1,U=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,D=r.ip4_expression.test(this._parts.hostname),M=r.ip6_expression.test(this._parts.hostname),w=D||M,B=!w,V=B&&n&&n.has(this._parts.hostname),U=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return D;case"ip6":case"ipv6":case"inet6":return M;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,N=a.port,F=a.hostname;a.protocol=function(E,w){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,E,w)},a.scheme=a.protocol,a.port=function(E,w){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),N.call(this,E,w))},a.hostname=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var D={preventInvalidHostname:this._parts.preventInvalidHostname},M=r.parseHost(E,D);if(M!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=D.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return F.call(this,E,w)},a.origin=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var D=this.protocol(),M=this.authority();return M?(D?D+"://":"")+this.authority():""}else{var B=r(E);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var D=r.parseHost(E,this._parts);if(D!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var D=r.parseAuthority(E,this._parts);if(D!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var D=r.buildUserinfo(this._parts);return D&&D.substring(0,D.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!w),this},a.resource=function(E,w){var D;return E===void 0?this.path()+this.search()+this.hash():(D=r.parse(E),this._parts.path=D.path,this._parts.query=D.query,this._parts.fragment=D.fragment,this.build(!w),this)},a.subdomain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,D)||""}else{var M=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(B));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,E),this.build(!w),this}},a.domain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.match(/\./g);if(D&&D.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,E)}return this.build(!w),this}},a.tld=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(D+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var B;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var D=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,D)||(this._parts.hostname?"/":"");return E?r.decodePath(M):M}else{var B=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,B),U=new RegExp("^"+u(V));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(U,E),this.build(!w),this}},a.filename=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var D=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(D+1);return E?r.decodePathSegment(M):M}else{var B=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(B=!0);var V=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(V,E),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var D=this.filename(),M=D.lastIndexOf("."),B,V;return M===-1?"":(B=D.substring(M+1),V=/^[a-z0-9%]+$/i.test(B)?B:"",E?r.decodePathSegment(V):V)}else{E.charAt(0)==="."&&(E=E.substring(1));var U=this.suffix(),G;if(U)E?G=new RegExp(u(U)+"$"):G=new RegExp(u("."+U)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return G&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(G,E)),this.build(!w),this}},a.segment=function(E,w,D){var M=this._parts.urn?":":"/",B=this.path(),V=B.substring(0,1)==="/",U=B.split(M);if(E!==void 0&&typeof E!="number"&&(D=w,w=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(V&&U.shift(),E<0&&(E=Math.max(U.length+E,0)),w===void 0)return E===void 0?U:U[E];if(E===null||U[E]===void 0)if(d(w)){U=[];for(var G=0,k=w.length;G{/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */(function(e,t){typeof s5=="object"&&typeof a5<"u"?a5.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(s5,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;c||(c=function(Re,dt,Tt){return Re.apply(dt,Tt)}),r||(r=function(Re){return Re}),s||(s=function(Re){return Re}),u||(u=function(Re,dt){return new Re(...dt)});let f=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),g=v(String.prototype.toLowerCase),h=v(String.prototype.toString),x=v(String.prototype.match),b=v(String.prototype.replace),C=v(String.prototype.indexOf),T=v(String.prototype.trim),A=v(RegExp.prototype.test),S=I(TypeError);function v(ze){return function(Re){for(var dt=arguments.length,Tt=new Array(dt>1?dt-1:0),ot=1;ot/gm),$=s(/\${[\w\W]*}/gm),W=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),J=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),he=s(/^(?:\w+script|data):/i),ge=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=s(/^html$/i);var _e=Object.freeze({__proto__:null,MUSTACHE_EXPR:Y,ERB_EXPR:j,TMPLIT_EXPR:$,DATA_ATTR:W,ARIA_ATTR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ge,DOCTYPE_NAME:se});let xe=()=>typeof window>"u"?null:window,Pe=function(Re,dt){if(typeof Re!="object"||typeof Re.createPolicy!="function")return null;let Tt=null,ot="data-tt-policy-suffix";dt&&dt.hasAttribute(ot)&&(Tt=dt.getAttribute(ot));let ln="dompurify"+(Tt?"#"+Tt:"");try{return Re.createPolicy(ln,{createHTML(Dn){return Dn},createScriptURL(Dn){return Dn}})}catch{return console.warn("TrustedTypes policy "+ln+" could not be created."),null}};function ve(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe(),Re=Sn=>ve(Sn);if(Re.version="3.0.3",Re.removed=[],!ze||!ze.document||ze.document.nodeType!==9)return Re.isSupported=!1,Re;let dt=ze.document,Tt=dt.currentScript,{document:ot}=ze,{DocumentFragment:ln,HTMLTemplateElement:Dn,Node:Ht,Element:kt,NodeFilter:be,NamedNodeMap:Ee=ze.NamedNodeMap||ze.MozNamedAttrMap,HTMLFormElement:at,DOMParser:Jt,trustedTypes:di}=ze,Ze=kt.prototype,jr=N(Ze,"cloneNode"),qr=N(Ze,"nextSibling"),ha=N(Ze,"childNodes"),ts=N(Ze,"parentNode");if(typeof Dn=="function"){let Sn=ot.createElement("template");Sn.content&&Sn.content.ownerDocument&&(ot=Sn.content.ownerDocument)}let Ne,rt="",{implementation:$e,createNodeIterator:We,createDocumentFragment:mt,getElementsByTagName:Vt}=ot,{importNode:Tn}=dt,Qn={};Re.isSupported=typeof e=="function"&&typeof ts=="function"&&$e&&$e.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Ao,ERB_EXPR:ns,TMPLIT_EXPR:is,DATA_ATTR:ur,ARIA_ATTR:ji,IS_SCRIPT_OR_DATA:os,ATTR_WHITESPACE:Kn}=_e,{IS_ALLOWED_URI:Fn}=_e,dn=null,bi=O({},[...F,..._,...E,...D,...B]),qi=null,rs=O({},[...V,...U,...G,...k]),lo=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pa=null,$f=null,Qf=!0,el=!0,X_=!1,fr=!0,No=!1,_a=!1,Yi=!1,dr=!1,Hs=!1,Uh=!1,Gs=!1,K_=!0,l3=!1,Lbe="user-content-",$H=!0,tv=!1,GC={},WC=null,VK=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),zK=null,HK=O({},["audio","video","img","source","image","track"]),QH=null,GK=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),u3="http://www.w3.org/1998/Math/MathML",f3="http://www.w3.org/2000/svg",Vh="http://www.w3.org/1999/xhtml",jC=Vh,eG=!1,tG=null,Nbe=O({},[u3,f3,Vh],h),y0,Fbe=["application/xhtml+xml","text/html"],Bbe="text/html",Ws,qC=null,kbe=ot.createElement("form"),WK=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},nG=function(Ie){if(!(qC&&qC===Ie)){if((!Ie||typeof Ie!="object")&&(Ie={}),Ie=R(Ie),y0=Fbe.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?y0=Bbe:y0=Ie.PARSER_MEDIA_TYPE,Ws=y0==="application/xhtml+xml"?h:g,dn="ALLOWED_TAGS"in Ie?O({},Ie.ALLOWED_TAGS,Ws):bi,qi="ALLOWED_ATTR"in Ie?O({},Ie.ALLOWED_ATTR,Ws):rs,tG="ALLOWED_NAMESPACES"in Ie?O({},Ie.ALLOWED_NAMESPACES,h):Nbe,QH="ADD_URI_SAFE_ATTR"in Ie?O(R(GK),Ie.ADD_URI_SAFE_ATTR,Ws):GK,zK="ADD_DATA_URI_TAGS"in Ie?O(R(HK),Ie.ADD_DATA_URI_TAGS,Ws):HK,WC="FORBID_CONTENTS"in Ie?O({},Ie.FORBID_CONTENTS,Ws):VK,pa="FORBID_TAGS"in Ie?O({},Ie.FORBID_TAGS,Ws):{},$f="FORBID_ATTR"in Ie?O({},Ie.FORBID_ATTR,Ws):{},GC="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,Qf=Ie.ALLOW_ARIA_ATTR!==!1,el=Ie.ALLOW_DATA_ATTR!==!1,X_=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,fr=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,No=Ie.SAFE_FOR_TEMPLATES||!1,_a=Ie.WHOLE_DOCUMENT||!1,Hs=Ie.RETURN_DOM||!1,Uh=Ie.RETURN_DOM_FRAGMENT||!1,Gs=Ie.RETURN_TRUSTED_TYPE||!1,dr=Ie.FORCE_BODY||!1,K_=Ie.SANITIZE_DOM!==!1,l3=Ie.SANITIZE_NAMED_PROPS||!1,$H=Ie.KEEP_CONTENT!==!1,tv=Ie.IN_PLACE||!1,Fn=Ie.ALLOWED_URI_REGEXP||J,jC=Ie.NAMESPACE||Vh,lo=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&WK(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(lo.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&WK(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(lo.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(lo.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),No&&(el=!1),Uh&&(Hs=!0),GC&&(dn=O({},[...B]),qi=[],GC.html===!0&&(O(dn,F),O(qi,V)),GC.svg===!0&&(O(dn,_),O(qi,U),O(qi,k)),GC.svgFilters===!0&&(O(dn,E),O(qi,U),O(qi,k)),GC.mathMl===!0&&(O(dn,D),O(qi,G),O(qi,k))),Ie.ADD_TAGS&&(dn===bi&&(dn=R(dn)),O(dn,Ie.ADD_TAGS,Ws)),Ie.ADD_ATTR&&(qi===rs&&(qi=R(qi)),O(qi,Ie.ADD_ATTR,Ws)),Ie.ADD_URI_SAFE_ATTR&&O(QH,Ie.ADD_URI_SAFE_ATTR,Ws),Ie.FORBID_CONTENTS&&(WC===VK&&(WC=R(WC)),O(WC,Ie.FORBID_CONTENTS,Ws)),$H&&(dn["#text"]=!0),_a&&O(dn,["html","head","body"]),dn.table&&(O(dn,["tbody"]),delete pa.tbody),Ie.TRUSTED_TYPES_POLICY){if(typeof Ie.TRUSTED_TYPES_POLICY.createHTML!="function")throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ie.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Ne=Ie.TRUSTED_TYPES_POLICY,rt=Ne.createHTML("")}else Ne===void 0&&(Ne=Pe(di,Tt)),Ne!==null&&typeof rt=="string"&&(rt=Ne.createHTML(""));r&&r(Ie),qC=Ie}},jK=O({},["mi","mo","mn","ms","mtext"]),qK=O({},["foreignobject","desc","title","annotation-xml"]),Ube=O({},["title","style","font","a","script"]),d3=O({},_);O(d3,E),O(d3,w);let iG=O({},D);O(iG,M);let Vbe=function(Ie){let bt=ts(Ie);(!bt||!bt.tagName)&&(bt={namespaceURI:jC,tagName:"template"});let Kt=g(Ie.tagName),wo=g(bt.tagName);return tG[Ie.namespaceURI]?Ie.namespaceURI===f3?bt.namespaceURI===Vh?Kt==="svg":bt.namespaceURI===u3?Kt==="svg"&&(wo==="annotation-xml"||jK[wo]):!!d3[Kt]:Ie.namespaceURI===u3?bt.namespaceURI===Vh?Kt==="math":bt.namespaceURI===f3?Kt==="math"&&qK[wo]:!!iG[Kt]:Ie.namespaceURI===Vh?bt.namespaceURI===f3&&!qK[wo]||bt.namespaceURI===u3&&!jK[wo]?!1:!iG[Kt]&&(Ube[Kt]||!d3[Kt]):!!(y0==="application/xhtml+xml"&&tG[Ie.namespaceURI]):!1},x0=function(Ie){p(Re.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},oG=function(Ie,bt){try{p(Re.removed,{attribute:bt.getAttributeNode(Ie),from:bt})}catch{p(Re.removed,{attribute:null,from:bt})}if(bt.removeAttribute(Ie),Ie==="is"&&!qi[Ie])if(Hs||Uh)try{x0(bt)}catch{}else try{bt.setAttribute(Ie,"")}catch{}},YK=function(Ie){let bt,Kt;if(dr)Ie=""+Ie;else{let Hu=x(Ie,/^[\r\n\t ]+/);Kt=Hu&&Hu[0]}y0==="application/xhtml+xml"&&jC===Vh&&(Ie=''+Ie+"");let wo=Ne?Ne.createHTML(Ie):Ie;if(jC===Vh)try{bt=new Jt().parseFromString(wo,y0)}catch{}if(!bt||!bt.documentElement){bt=$e.createDocument(jC,"template",null);try{bt.documentElement.innerHTML=eG?rt:wo}catch{}}let js=bt.body||bt.documentElement;return Ie&&Kt&&js.insertBefore(ot.createTextNode(Kt),js.childNodes[0]||null),jC===Vh?Vt.call(bt,_a?"html":"body")[0]:_a?bt.documentElement:js},XK=function(Ie){return We.call(Ie.ownerDocument||Ie,Ie,be.SHOW_ELEMENT|be.SHOW_COMMENT|be.SHOW_TEXT,null,!1)},zbe=function(Ie){return Ie instanceof at&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof Ee)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},m3=function(Ie){return typeof Ht=="object"?Ie instanceof Ht:Ie&&typeof Ie=="object"&&typeof Ie.nodeType=="number"&&typeof Ie.nodeName=="string"},zh=function(Ie,bt,Kt){Qn[Ie]&&f(Qn[Ie],wo=>{wo.call(Re,bt,Kt,qC)})},KK=function(Ie){let bt;if(zh("beforeSanitizeElements",Ie,null),zbe(Ie))return x0(Ie),!0;let Kt=Ws(Ie.nodeName);if(zh("uponSanitizeElement",Ie,{tagName:Kt,allowedTags:dn}),Ie.hasChildNodes()&&!m3(Ie.firstElementChild)&&(!m3(Ie.content)||!m3(Ie.content.firstElementChild))&&A(/<[/\w]/g,Ie.innerHTML)&&A(/<[/\w]/g,Ie.textContent))return x0(Ie),!0;if(!dn[Kt]||pa[Kt]){if(!pa[Kt]&&ZK(Kt)&&(lo.tagNameCheck instanceof RegExp&&A(lo.tagNameCheck,Kt)||lo.tagNameCheck instanceof Function&&lo.tagNameCheck(Kt)))return!1;if($H&&!WC[Kt]){let wo=ts(Ie)||Ie.parentNode,js=ha(Ie)||Ie.childNodes;if(js&&wo){let Hu=js.length;for(let br=Hu-1;br>=0;--br)wo.insertBefore(jr(js[br],!0),qr(Ie))}}return x0(Ie),!0}return Ie instanceof kt&&!Vbe(Ie)||(Kt==="noscript"||Kt==="noembed")&&A(/<\/no(script|embed)/i,Ie.innerHTML)?(x0(Ie),!0):(No&&Ie.nodeType===3&&(bt=Ie.textContent,bt=b(bt,Ao," "),bt=b(bt,ns," "),bt=b(bt,is," "),Ie.textContent!==bt&&(p(Re.removed,{element:Ie.cloneNode()}),Ie.textContent=bt)),zh("afterSanitizeElements",Ie,null),!1)},JK=function(Ie,bt,Kt){if(K_&&(bt==="id"||bt==="name")&&(Kt in ot||Kt in kbe))return!1;if(!(el&&!$f[bt]&&A(ur,bt))){if(!(Qf&&A(ji,bt))){if(!qi[bt]||$f[bt]){if(!(ZK(Ie)&&(lo.tagNameCheck instanceof RegExp&&A(lo.tagNameCheck,Ie)||lo.tagNameCheck instanceof Function&&lo.tagNameCheck(Ie))&&(lo.attributeNameCheck instanceof RegExp&&A(lo.attributeNameCheck,bt)||lo.attributeNameCheck instanceof Function&&lo.attributeNameCheck(bt))||bt==="is"&&lo.allowCustomizedBuiltInElements&&(lo.tagNameCheck instanceof RegExp&&A(lo.tagNameCheck,Kt)||lo.tagNameCheck instanceof Function&&lo.tagNameCheck(Kt))))return!1}else if(!QH[bt]){if(!A(Fn,b(Kt,Kn,""))){if(!((bt==="src"||bt==="xlink:href"||bt==="href")&&Ie!=="script"&&C(Kt,"data:")===0&&zK[Ie])){if(!(X_&&!A(os,b(Kt,Kn,"")))){if(Kt)return!1}}}}}}return!0},ZK=function(Ie){return Ie.indexOf("-")>0},$K=function(Ie){let bt,Kt,wo,js;zh("beforeSanitizeAttributes",Ie,null);let{attributes:Hu}=Ie;if(!Hu)return;let br={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:qi};for(js=Hu.length;js--;){bt=Hu[js];let{name:Am,namespaceURI:rG}=bt;if(Kt=Am==="value"?bt.value:T(bt.value),wo=Ws(Am),br.attrName=wo,br.attrValue=Kt,br.keepAttr=!0,br.forceKeepAttr=void 0,zh("uponSanitizeAttribute",Ie,br),Kt=br.attrValue,br.forceKeepAttr||(oG(Am,Ie),!br.keepAttr))continue;if(!fr&&A(/\/>/i,Kt)){oG(Am,Ie);continue}No&&(Kt=b(Kt,Ao," "),Kt=b(Kt,ns," "),Kt=b(Kt,is," "));let QK=Ws(Ie.nodeName);if(JK(QK,wo,Kt)){if(l3&&(wo==="id"||wo==="name")&&(oG(Am,Ie),Kt=Lbe+Kt),Ne&&typeof di=="object"&&typeof di.getAttributeType=="function"&&!rG)switch(di.getAttributeType(QK,wo)){case"TrustedHTML":{Kt=Ne.createHTML(Kt);break}case"TrustedScriptURL":{Kt=Ne.createScriptURL(Kt);break}}try{rG?Ie.setAttributeNS(rG,Am,Kt):Ie.setAttribute(Am,Kt),d(Re.removed)}catch{}}}zh("afterSanitizeAttributes",Ie,null)},Hbe=function Sn(Ie){let bt,Kt=XK(Ie);for(zh("beforeSanitizeShadowDOM",Ie,null);bt=Kt.nextNode();)zh("uponSanitizeShadowNode",bt,null),!KK(bt)&&(bt.content instanceof ln&&Sn(bt.content),$K(bt));zh("afterSanitizeShadowDOM",Ie,null)};return Re.sanitize=function(Sn){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bt,Kt,wo,js;if(eG=!Sn,eG&&(Sn=""),typeof Sn!="string"&&!m3(Sn))if(typeof Sn.toString=="function"){if(Sn=Sn.toString(),typeof Sn!="string")throw S("dirty is not a string, aborting")}else throw S("toString is not a function");if(!Re.isSupported)return Sn;if(Yi||nG(Ie),Re.removed=[],typeof Sn=="string"&&(tv=!1),tv){if(Sn.nodeName){let Am=Ws(Sn.nodeName);if(!dn[Am]||pa[Am])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(Sn instanceof Ht)bt=YK(""),Kt=bt.ownerDocument.importNode(Sn,!0),Kt.nodeType===1&&Kt.nodeName==="BODY"||Kt.nodeName==="HTML"?bt=Kt:bt.appendChild(Kt);else{if(!Hs&&!No&&!_a&&Sn.indexOf("<")===-1)return Ne&&Gs?Ne.createHTML(Sn):Sn;if(bt=YK(Sn),!bt)return Hs?null:Gs?rt:""}bt&&dr&&x0(bt.firstChild);let Hu=XK(tv?Sn:bt);for(;wo=Hu.nextNode();)KK(wo)||(wo.content instanceof ln&&Hbe(wo.content),$K(wo));if(tv)return Sn;if(Hs){if(Uh)for(js=mt.call(bt.ownerDocument);bt.firstChild;)js.appendChild(bt.firstChild);else js=bt;return(qi.shadowroot||qi.shadowrootmod)&&(js=Tn.call(dt,js,!0)),js}let br=_a?bt.outerHTML:bt.innerHTML;return _a&&dn["!doctype"]&&bt.ownerDocument&&bt.ownerDocument.doctype&&bt.ownerDocument.doctype.name&&A(se,bt.ownerDocument.doctype.name)&&(br=" +`+br),No&&(br=b(br,Ao," "),br=b(br,ns," "),br=b(br,is," ")),Ne&&Gs?Ne.createHTML(br):br},Re.setConfig=function(Sn){nG(Sn),Yi=!0},Re.clearConfig=function(){qC=null,Yi=!1},Re.isValidAttribute=function(Sn,Ie,bt){qC||nG({});let Kt=Ws(Sn),wo=Ws(Ie);return JK(Kt,wo,bt)},Re.addHook=function(Sn,Ie){typeof Ie=="function"&&(Qn[Sn]=Qn[Sn]||[],p(Qn[Sn],Ie))},Re.removeHook=function(Sn){if(Qn[Sn])return d(Qn[Sn])},Re.removeHooks=function(Sn){Qn[Sn]&&(Qn[Sn]=[])},Re.removeAllHooks=function(){Qn={}},Re}var we=ve();return we})});var cre=tl((ohn,are)=>{"use strict";are.exports=Qze;var lR=1e20;function Qze(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,g,h,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),h=0,x=Math.floor(u.length/f);h{function u4e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,x=15,b=16,C=17,T=0,A=1,S=2,v=3,I=4;function O(_,E){return 55296<=_.charCodeAt(E)&&_.charCodeAt(E)<=56319&&56320<=_.charCodeAt(E+1)&&_.charCodeAt(E+1)<=57343}function R(_,E){E===void 0&&(E=0);var w=_.charCodeAt(E);if(55296<=w&&w<=56319&&E<_.length-1){var D=w,M=_.charCodeAt(E+1);return 56320<=M&&M<=57343?(D-55296)*1024+(M-56320)+65536:D}if(56320<=w&&w<=57343&&E>=1){var D=_.charCodeAt(E-1),M=w;return 55296<=D&&D<=56319?(D-55296)*1024+(M-56320)+65536:M}return w}function N(_,E,w){var D=[_].concat(E).concat([w]),M=D[D.length-2],B=w,V=D.lastIndexOf(h);if(V>1&&D.slice(1,V).every(function(k){return k==i})&&[i,g,C].indexOf(_)==-1)return S;var U=D.lastIndexOf(o);if(U>0&&D.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(M)==-1)return D.filter(function(k){return k==o}).length%2==1?v:I;if(M==e&&B==t)return T;if(M==n||M==e||M==t)return B==h&&E.every(function(k){return k==i})?S:A;if(B==n||B==e||B==t)return A;if(M==s&&(B==s||B==a||B==u||B==f))return T;if((M==u||M==a)&&(B==a||B==c))return T;if((M==f||M==c)&&B==c)return T;if(B==i||B==x)return T;if(B==r)return T;if(M==p)return T;var G=D.indexOf(i)!=-1?D.lastIndexOf(i)-1:D.length-2;return[g,C].indexOf(D[G])!=-1&&D.slice(G+1,-1).every(function(k){return k==i})&&B==h||M==x&&[b,C].indexOf(B)!=-1?T:E.indexOf(o)!=-1?S:M==o&&B==o?T:A}this.nextBreak=function(_,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=_.length-1)return _.length;for(var w=F(R(_,E)),D=[],M=E+1;M<_.length;M++)if(!O(_,M-1)){var B=F(R(_,M));if(N(w,D,B))return M;D.push(B)}return _.length},this.splitGraphemes=function(_){for(var E=[],w=0,D;(D=this.nextBreak(_,w))<_.length;)E.push(_.slice(w,D)),w=D;return w<_.length&&E.push(_.slice(w)),E},this.iterateGraphemes=function(_){var E=0,w={next:function(){var D,M;return(M=this.nextBreak(_,E))<_.length?(D=_.slice(E,M),E=M,{value:D,done:!1}):E<_.length?(D=_.slice(E),E=_.length,{value:D,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var E=0,w=0,D;(D=this.nextBreak(_,w))<_.length;)w=D,E++;return w<_.length&&E++,E};function F(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?C:d}return this}typeof yU<"u"&&yU.exports&&(yU.exports=u4e)});var Kre=tl((l0n,K6)=>{"use strict";K6.exports=SU;K6.exports.default=SU;function SU(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=qre(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,u,f,d,p,g;if(i&&(r=hGe(e,t,r,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;hu&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return MR(r,s,n,a,c,g,0),s}function qre(e,t,n,i,o){var r,s;if(o===X6(e,t,n,i)>0)for(r=t;r=t;r-=i)s=jre(r,e[r],e[r+1],s);return s&&vU(s,s.next)&&(NR(s),s=s.next),s}function Zx(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(vU(n,n.next)||Sr(n.prev,n,n.next)===0)){if(NR(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function MR(e,t,n,i,o,r,s){if(e){!s&&r&&xGe(e,i,o,r);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,r?fGe(e,i,o,r):uGe(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),NR(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=dGe(Zx(e),t,n),MR(e,t,n,i,o,r,2)):s===2&&mGe(e,t,n,i,o,r):MR(Zx(e),t,n,i,o,r,1);break}}}}function uGe(e){var t=e.prev,n=e,i=e.next;if(Sr(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=or?o>s?o:s:r>s?r:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&pA(o,a,r,c,s,u,h.x,h.y)&&Sr(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function fGe(e,t,n,i){var o=e.prev,r=e,s=e.next;if(Sr(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,g=ac?a>u?a:u:c>u?c:u,b=f>d?f>p?f:p:d>p?d:p,C=q6(g,h,t,n,i),T=q6(x,b,t,n,i),A=e.prevZ,S=e.nextZ;A&&A.z>=C&&S&&S.z<=T;){if(A.x>=g&&A.x<=x&&A.y>=h&&A.y<=b&&A!==o&&A!==s&&pA(a,f,c,d,u,p,A.x,A.y)&&Sr(A.prev,A,A.next)>=0||(A=A.prevZ,S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==o&&S!==s&&pA(a,f,c,d,u,p,S.x,S.y)&&Sr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;A&&A.z>=C;){if(A.x>=g&&A.x<=x&&A.y>=h&&A.y<=b&&A!==o&&A!==s&&pA(a,f,c,d,u,p,A.x,A.y)&&Sr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==o&&S!==s&&pA(a,f,c,d,u,p,S.x,S.y)&&Sr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function dGe(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!vU(o,r)&&Yre(o,i,i.next,r)&&LR(o,r)&&LR(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),NR(i),NR(i.next),i=e=r),i=i.next}while(i!==e);return Zx(i)}function mGe(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&TGe(s,a)){var c=Xre(s,a);s=Zx(s,s.next),c=Zx(c,c.next),MR(s,t,n,i,o,r,0),MR(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function hGe(e,t,n,i){var o=[],r,s,a,c,u;for(r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x=n.x&&n.x>=u&&i!==n.x&&pA(os.x||n.x===s.x&&yGe(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function yGe(e,t){return Sr(e.prev,e,t.prev)<0&&Sr(t.next,e,e.next)<0}function xGe(e,t,n,i){var o=e;do o.z===0&&(o.z=q6(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,bGe(o)}function bGe(e){var t,n,i,o,r,s,a,c,u=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(s>1);return e}function q6(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function CGe(e){var t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function TGe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!AGe(e,t)&&(LR(e,t)&&LR(t,e)&&EGe(e,t)&&(Sr(e.prev,e,t.prev)||Sr(e,t.prev,t))||vU(e,t)&&Sr(e.prev,e,e.next)>0&&Sr(t.prev,t,t.next)>0)}function Sr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function vU(e,t){return e.x===t.x&&e.y===t.y}function Yre(e,t,n,i){var o=EU(Sr(e,t,n)),r=EU(Sr(e,t,i)),s=EU(Sr(n,i,e)),a=EU(Sr(n,i,t));return!!(o!==r&&s!==a||o===0&&AU(e,n,t)||r===0&&AU(e,i,t)||s===0&&AU(n,e,i)||a===0&&AU(n,t,i))}function AU(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function EU(e){return e>0?1:e<0?-1:0}function AGe(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Yre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function LR(e,t){return Sr(e.prev,e,e.next)<0?Sr(e,t,e.next)>=0&&Sr(e,e.prev,t)>=0:Sr(e,t,e.prev)<0||Sr(e,e.next,t)<0}function EGe(e,t){var n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Xre(e,t){var n=new Y6(e.i,e.x,e.y),i=new Y6(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function jre(e,t,n,i){var o=new Y6(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function NR(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Y6(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}SU.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(X6(e,0,r,n));if(o)for(var a=0,c=t.length;a0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var hue=tl((SW,vW)=>{(function(e,t){typeof SW=="object"&&typeof vW<"u"?vW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(SW,function(){"use strict";function e(b,C,T,A,S){(function v(I,O,R,N,F){for(;N>R;){if(N-R>600){var _=N-R+1,E=O-R+1,w=Math.log(_),D=.5*Math.exp(2*w/3),M=.5*Math.sqrt(w*D*(_-D)/_)*(E-_/2<0?-1:1),B=Math.max(R,Math.floor(O-E*D/_+M)),V=Math.min(N,Math.floor(O+(_-E)*D/_+M));v(I,O,B,V,F)}var U=I[O],G=R,k=N;for(t(I,R,O),F(I[N],U)>0&&t(I,R,N);G0;)k--}F(I[R],U)===0?t(I,R,k):t(I,++k,N),k<=O&&(R=k+1),O<=k&&(N=k-1)}})(b,C,T||0,A||b.length-1,S||n)}function t(b,C,T){var A=b[C];b[C]=b[T],b[T]=A}function n(b,C){return bC?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,C,T){if(!T)return C.indexOf(b);for(var A=0;A=b.minX&&C.maxY>=b.minY}function h(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(b,C,T,A,S){for(var v=[C,T];v.length;)if(!((T=v.pop())-(C=v.pop())<=A)){var I=C+Math.ceil((T-C)/A/2)*A;e(b,I,C,T,S),v.push(C,I,I,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var C=this.data,T=[];if(!g(b,C))return T;for(var A=this.toBBox,S=[];C;){for(var v=0;v=0&&S[C].children.length>this._maxEntries;)this._split(S,C),C--;this._adjustParentBBoxes(A,S,C)},i.prototype._split=function(b,C){var T=b[C],A=T.children.length,S=this._minEntries;this._chooseSplitAxis(T,S,A);var v=this._chooseSplitIndex(T,S,A),I=h(T.children.splice(v,T.children.length-v));I.height=T.height,I.leaf=T.leaf,r(T,this.toBBox),r(I,this.toBBox),C?b[C-1].children.push(I):this._splitRoot(T,I)},i.prototype._splitRoot=function(b,C){this.data=h([b,C]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,C,T){for(var A,S,v,I,O,R,N,F=1/0,_=1/0,E=C;E<=T-C;E++){var w=s(b,0,E,this.toBBox),D=s(b,E,T,this.toBBox),M=(S=w,v=D,I=void 0,O=void 0,R=void 0,N=void 0,I=Math.max(S.minX,v.minX),O=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),N=Math.min(S.maxY,v.maxY),Math.max(0,R-I)*Math.max(0,N-O)),B=f(w)+f(D);M=C;F--){var _=b.children[F];a(I,b.leaf?S(_):_),O+=d(I)}return O},i.prototype._adjustParentBBoxes=function(b,C,T){for(var A=T;A>=0;A--)a(C[A],b)},i.prototype._condense=function(b){for(var C=b.length-1,T=void 0;C>=0;C--)b[C].children.length===0?C>0?(T=b[C-1].children).splice(T.indexOf(b[C]),1):this.clear():r(b[C],this.toBBox)},i})});var Hj=tl((exports,module)=>{/*! + * protobuf.js v7.2.3 (c) 2016, daniel wirtz + * compiled mon, 27 mar 2023 18:08:22 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function r(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},r,a,a.exports),a.exports}var o=r(i[0]);o.util.global.protobuf=o,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(o.util.Long=s,o.configure()),o}),typeof module=="object"&&module&&module.exports&&(module.exports=o)})({1:[function(e,t,n){"use strict";t.exports=i;function i(r,o){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],h=0,A=0,x;f>2],x=(C&3)<<4,A=1;break;case 1:g[h++]=r[x|C>>4],x=(C&15)<<2,A=2;break;case 2:g[h++]=r[x|C>>6],g[h++]=r[C&63],A=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return A&&(g[h++]=r[x],g[h++]=61,A===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,A=0;A1)break;if((x=o[x])===undefined)throw Error(a);switch(g){case 0:h=x,g=1;break;case 1:f[d++]=h<<2|(x&48)>>4,h=x,g=2;break;case 2:f[d++]=(h&15)<<4|(x&60)>>2,h=x,g=3;break;case 3:f[d++]=(h&3)<<6|x,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(o,s,a){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(o,s){if(o===undefined)this._listeners={};else if(s===undefined)this._listeners[o]=[];else for(var a=this._listeners[o],c=0;c0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((A<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((A<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var x=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-x)*8388608)&8388607;d((A<<31|x+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,r),c.writeFloatBE=u.bind(null,o);function f(d,p,g){var h=d(p,g),A=(h>>31)*2+1,x=h>>>23&255,C=h&8388607;return x===255?C?NaN:A*(1/0):x===0?A*1401298464324817e-60*C:A*Math.pow(2,x-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(x,C,T){u[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(x,C,T){u[0]=x,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],f[4]=x[C+4],f[5]=x[C+5],f[6]=x[C+6],f[7]=x[C+7],u[0]}function A(x,C){return f[7]=x[C],f[6]=x[C+1],f[5]=x[C+2],f[4]=x[C+3],f[3]=x[C+4],f[2]=x[C+5],f[1]=x[C+6],f[0]=x[C+7],u[0]}c.readDoubleLE=d?h:A,c.readDoubleBE=d?A:h}():function(){function u(d,p,g,h,A,x){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,A,x+p),d(1/h>0?0:2147483648,A,x+g);else if(isNaN(h))d(0,A,x+p),d(2146959360,A,x+g);else if(h>17976931348623157e292)d(0,A,x+p),d((C<<31|2146435072)>>>0,A,x+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,A,x+p),d((C<<31|T/4294967296)>>>0,A,x+g);else{var E=Math.floor(Math.log(h)/Math.LN2);E===1024&&(E=1023),T=h*Math.pow(2,-E),d(T*4503599627370496>>>0,A,x+p),d((C<<31|E+1023<<20|T*1048576&1048575)>>>0,A,x+g)}}}c.writeDoubleLE=u.bind(null,r,0,4),c.writeDoubleBE=u.bind(null,o,4,0);function f(d,p,g,h,A){var x=d(h,A+p),C=d(h,A+g),T=(C>>31)*2+1,E=C>>>20&2047,S=4294967296*(C&1048575)+x;return E===2047?S?NaN:T*(1/0):E===0?T*5e-324*S:T*Math.pow(2,E-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function r(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function o(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(r,o,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return r(p);f+p>a&&(u=r(a),f=0);var g=o.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(o){for(var s=0,a=0,c=0;c191&&p<224?f[d++]=(p&31)<<6|o[s++]&63:p>239&&p<365?(p=((p&7)<<18|(o[s++]&63)<<12|(o[s++]&63)<<6|o[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(o[s++]&63)<<6|o[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(o,s,a){for(var c=a,u,f,d=0;d>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=o.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),r,o=i.LongBits,s=i.utf8;function a(h,A){return RangeError("index out of range: "+h.pos+" + "+(A||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(A){if(A instanceof Uint8Array||Array.isArray(A))return new c(A);throw Error("illegal buffer")}:function(A){if(Array.isArray(A))return new c(A);throw Error("illegal buffer")},f=function(){return i.Buffer?function(x){return(c.create=function(T){return i.Buffer.isBuffer(T)?new r(T):u(T)})(x)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var A=4294967295;return function(){if(A=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(A=(A|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return A;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return A}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var A=this.uint32();return A>>>1^-(A&1)|0};function d(){var h=new o(0,0),A=0;if(this.len-this.pos>4){for(;A<4;++A)if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;A=0}else{for(;A<3;++A){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<>>0,h}if(this.len-this.pos>4){for(;A<5;++A)if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}else for(;A<5;++A){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,A){return(h[A-4]|h[A-3]<<8|h[A-2]<<16|h[A-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var A=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,A},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var A=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,A},c.prototype.bytes=function(){var A=this.uint32(),x=this.pos,C=this.pos+A;if(C>this.len)throw a(this,A);return this.pos+=A,Array.isArray(this.buf)?this.buf.slice(x,C):x===C?new this.buf.constructor(0):this._slice.call(this.buf,x,C)},c.prototype.string=function(){var A=this.bytes();return s.read(A,0,A.length)},c.prototype.skip=function(A){if(typeof A=="number"){if(this.pos+A>this.len)throw a(this,A);this.pos+=A}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){r=h,c.create=f(),r._configure();var A=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[A](!1)},uint64:function(){return d.call(this)[A](!0)},sint64:function(){return d.call(this).zzDecode()[A](!1)},fixed64:function(){return g.call(this)[A](!0)},sfixed64:function(){return g.call(this)[A](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(s){i.call(this,s)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},o._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=r;var i=e(15);(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r;function r(o,s,a){if(typeof o!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!s,this.responseDelimited=!!a}r.prototype.rpcCall=function o(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(o,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(A){return d.emit("error",A,s),f(A)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=r;var i=e(15);function r(c,u){this.lo=c>>>0,this.hi=u>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return o;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new r(d,p)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):o},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;r.fromHash=function(u){return u===s?o:new r((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function r(s,a,c){for(var u=Object.keys(a),f=0;f-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u127;)S[w++]=E&127|128,E>>>=7;S[w]=E}function A(E,S){this.len=E,this.next=undefined,this.val=S}A.prototype=Object.create(c.prototype),A.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new A((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(x,10,o.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function x(E,S,w){for(;E.hi;)S[w++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[w++]=E.lo&127|128,E.lo=E.lo>>>7;S[w++]=E.lo}d.prototype.uint64=function(S){var w=o.from(S);return this._push(x,w.length(),w)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var w=o.from(S).zzEncode();return this._push(x,w.length(),w)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(E,S,w){S[w]=E&255,S[w+1]=E>>>8&255,S[w+2]=E>>>16&255,S[w+3]=E>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var w=o.from(S);return this._push(C,4,w.lo)._push(C,4,w.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,w,D){w.set(S,D)}:function(S,w,D){for(var R=0;R>>0;if(!w)return this._push(g,1,0);if(i.isString(S)){var D=d.alloc(w=s.length(S));s.decode(S,D,0),S=D}return this.uint32(w)._push(T,w,S)},d.prototype.string=function(S){var w=a.length(S);return w?this.uint32(w)._push(a.write,w,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,w=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=w,this.len+=D),this},d.prototype.finish=function(){for(var S=this.head.next,w=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,w,D),D+=S.len,S=S.next;return w},d._configure=function(E){r=E,d.create=p(),r._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=o;var i=e(16);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(){i.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d>>0;return this.uint32(u),u&&this._push(o.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?r.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}o.prototype.string=function(c){var u=r.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},o._configure()},{15:15,16:16}]},{},[8])})()});var Bye=Ac((Tyi,Uz)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,A=o(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),x={width:g.width,height:g.height,pixelData:A.resultPixels,minValue:A.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return A.resultMask&&(x.maskData=A.resultMask),d.returnEncodedMask&&g.mask&&(x.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(x.fileInfo=s(g),d.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(g))),x};var o=function(f,d,p,g,h){var A=0,x=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/x),E=Math.floor(f.height/C),S=2*f.maxZError,w=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var R,O;R=new d(f.width*f.height),h&&p&&(O=new Uint8Array(f.width*f.height));for(var L=new Float32Array(T*E),N,_,b=0;b<=C;b++){var v=b!==C?E:f.height%C;if(v!==0)for(var I=0;I<=x;I++){var M=I!==x?T:f.width%x;if(M!==0){var F=b*f.width*E+I*T,k=f.width-M,V=f.pixels.blocks[A],G,U,q;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),G=L),U=0):V.encoding===2?q=0:q=V.offset;var Y;if(p)for(_=0;_>3],Y<<=F&7),N=0;N>3]),Y&128?(O&&(O[F]=1),D=V.encoding<2?G[U++]:q,w=w>D?D:w,R[F++]=D):(O&&(O[F]=0),R[F++]=g),Y<<=1;F+=k}else if(V.encoding<2)for(_=0;_D?D:w,R[F++]=D;F+=k}else for(w=w>q?q:w,_=0;_0){var x=new Uint8Array(Math.ceil(g.width*g.height/8));A=new DataView(f,d,g.mask.numBytes);var C=A.getInt16(0,!0),T=2,E=0;do{if(C>0)for(;C--;)x[E++]=A.getUint8(T++);else{var S=A.getUint8(T++);for(C=-C;C--;)x[E++]=S}C=A.getInt16(T,!0),T+=2}while(T0?1:0),O=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(R*O);for(var L=0,N=0;N3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,I.offsetType=M,M===2)I.offset=A.getInt8(1),b++;else if(M===1)I.offset=A.getInt16(1,!0),b+=2;else if(M===0)I.offset=A.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(I.encoding===1)if(M=A.getUint8(b),b++,I.bitsPerPixel=M&63,M>>=6,I.numValidPixelsType=M,M===2)I.numValidPixels=A.getUint8(b),b++;else if(M===1)I.numValidPixels=A.getUint16(b,!0),b+=2;else if(M===0)I.numValidPixels=A.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(d+=b,I.encoding!==3){var F,k;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";F=new ArrayBuffer(V*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,V*4));var G=new Float32Array(F);I.rawData=G,d+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);F=new ArrayBuffer(q*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,U)),I.stuffedData=new Uint32Array(F),d+=U}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,A,x){var C=(1<=d)w=D>>>S-d&C,S-=d;else{var L=d-S;w=(D&C)<>>S}A[E]=w=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<>>E),u[T]=p[S];else for(R=Math.ceil((A-g)/h),T=0;T=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<>>E),u[T]=S=u?(E=S>>>T-u&h,T-=u):(C=u-T,E=(S&h)<>>T),w[x]=E=f?(w=D>>>S&x,E-=f,S+=f):(R=f-E,w=D>>>S&x,D=c[C++],E=32-R,w|=(D&(1<=f?(w=D>>>S&x,E-=f,S+=f):(R=f-E,w=D>>>S&x,D=c[C++],E=32-R,w|=(D&(1<=u?(E=w>>>S&h,T-=u,S+=u):(C=u-T,E=w>>>S&h,w=c[A++],T=32-C,E|=(w&(1<=f?(x=C>>>A-f&p,A-=f):(T=f-A,x=(C&p)<>>A),u[h]=x;return u},originalUnstuff2:function(c,u,f,d){var p=(1<=f?(C=T>>>x&p,A-=f,x+=f):(E=f-A,C=T>>>x&p,T=c[g++],A=32-E,C|=(T&(1<=359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var A,x;if(h>=3&&(x=h>=4?52:48,A=this.computeChecksumFletcher32(new Uint8Array(c,f-x,p.blobSize-14)),A!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var A,x=!0;for(A=0;A0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,A.numBytes);var T=h.getInt16(0,!0),E=2,S=0,w=0;do{if(T>0)for(;T--;)x[S++]=h.getUint8(E++);else for(w=h.getUint8(E++),T=-T;T--;)x[S++]=w;T=h.getInt16(E,!0),E+=2}while(E>3],D<<=R&7):D=x[R>>3],D&128&&(C[R]=1);u.pixels.resultMask=C,A.bitset=x,f+=A.numBytes}return u.ptr=f,u.mask=A,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,A=p.imageType,x=p.numValidPixel*o.getDataTypeSize(A)*g,C,T=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,x);else{var E=new ArrayBuffer(x),S=new Uint8Array(E);S.set(new Uint8Array(c,d,x)),C=new f(E)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var w=0,D=0,R=0,O=0;if(g>1)for(R=0;R=A)return!1;var x=new Uint32Array(A-h);o.decodeBits(c,u,x);var C=[],T,E,S,w;for(T=h;T0&&(C[E].second=b<<_>>>32-w,32-_>=w?(_+=w,_===32&&(_=0,v++,b=N[v])):(_+=w-32,v++,b=N[v],C[E].second|=b>>>32-_));var I=0,M=0,F=new s;for(T=0;T=f?M=f:M=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var k=[],V,G,U,q,Y,Q;for(T=h;T0)if(V=[w,E],w<=M)for(G=C[E].second<=0;q--)Y=G>>>q&1,Y?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),q===0&&!Q.val&&(Q.val=V[1]);return{decodeLut:k,numBitsLUTQick:M,numBitsLUT:I,tree:F,stuffedData:N,srcPtr:v,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,A=h*g,x=this.readHuffmanTree(c,u),C=x.decodeLut,T=x.tree,E=x.stuffedData,S=x.srcPtr,w=x.bitPos,D=x.numBitsLUTQick,R=x.numBitsLUT,O=u.headerInfo.imageType===0?128:0,L,N,_,b=u.pixels.resultMask,v,I,M,F,k,V,G,U=0;w>0&&(S++,w=0);var q=E[S],Y=u.encodeMode===1,Q=new f(A*p),W=Q,K;for(K=0;K1&&(W=new f(Q.buffer,A*K,A),U=0),u.headerInfo.numValidPixel===h*g)for(V=0,F=0;F>>32-D,I=v,32-w>>64-w-D,I=v),C[I])N=C[I][1],w+=C[I][0];else for(v=q<>>32-R,I=v,32-w>>64-w-R,I=v),L=T,G=0;G>>R-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,w=w+G+1;break}w>=32&&(w-=32,S++,q=E[S]),_=N-O,Y?(k>0?_+=U:F>0?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}else for(V=0,F=0;F>>32-D,I=v,32-w>>64-w-D,I=v),C[I])N=C[I][1],w+=C[I][0];else for(v=q<>>32-R,I=v,32-w>>64-w-R,I=v),L=T,G=0;G>>R-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,w=w+G+1;break}w>=32&&(w-=32,S++,q=E[S]),_=N-O,Y?(k>0&&b[V-1]?_+=U:F>0&&b[V-h]?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}u.ptr=u.ptr+(S+1)*4+(w>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,A=0,x=new DataView(c,u.ptr,5),C=x.getUint8(0);A++;var T=C>>6,E=T===0?4:3-T,S=(C&32)>0,w=C&31,D=0;if(E===1)D=x.getUint8(A),A++;else if(E===2)D=x.getUint16(A,!0),A+=2;else if(E===4)D=x.getUint32(A,!0),A+=4;else throw"Invalid valid pixel count type";var R=2*g.maxZError,O,L,N,_,b,v,I,M,F,k,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,M=x.getUint8(A),F=w,A++,_=Math.ceil((M-1)*w/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),u.ptr+=A,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,k=0;M-1>>>k;)k++;_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(L),u.ptr+=_,h>=3?v=r.unstuffLUT2(I,w,M-1,d,R,V):v=r.unstuffLUT(I,w,M-1,d,R,V),h>=3?r.unstuff2(O,f,k,D,v):r.unstuff(O,f,k,D,v)}else u.counter.bitstuffer++,k=w,u.ptr+=A,k>0&&(_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(L),u.ptr+=_,h>=3?d==null?r.originalUnstuff2(O,f,k,D):r.unstuff2(O,f,k,D,!1,d,R,V):d==null?r.originalUnstuff(O,f,k,D):r.unstuff(O,f,k,D,!1,d,R,V))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,A=d.imageType,x=o.getDataTypeSize(A),C=Math.ceil(p/h),T=Math.ceil(g/h);u.pixels.numBlocksY=T,u.pixels.numBlocksX=C,u.pixels.ptr=0;var E=0,S=0,w=0,D=0,R=0,O=0,L=0,N=0,_=0,b=0,v=0,I=0,M=0,F=0,k=0,V=0,G,U,q,Y,Q,W,K=new f(h*h),J=g%h||h,me=p%h||h,ye,se,_e=d.numDims,xe,De=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(w=0;w1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*xe*x,p*g)),L=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,L)),U={},V=0,N=G.getUint8(0),V++,_=N>>6&255,b=N>>2&15,b!==(D*h>>3&15))throw"integrity issue";if(W=N&3,W>3)throw u.ptr+=V,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=V;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=V,M=R*O*x,F=c.byteLength-u.ptr,M=M1)for(g=0;g=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,A=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var x=g.width*g.height;if(p.pixels.resultPixels=new A(x*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(h>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)o.readDataOneSweep(c,p,A);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=C.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||h<4&&E>1)throw"Invalid Huffman flag "+E;E?o.readHuffman(c,p,A):o.readTiles(c,p,A)}else o.readTiles(c,p,A)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var w={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var E,S,w;if(f>1&&h.length>1){for(w=C.width*C.height,C.bandMasks=h,x=new Uint8Array(w),x.set(h[0]),E=1;E{oxe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var cxe=Ac((Wqi,axe)=>{var{webm:Myt,mp4:Byt}=sxe(),CK=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,TK=()=>"wakeLock"in navigator,EK=class{constructor(){if(this.enabled=!1,TK()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else CK()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",Myt),this._addSourceToVideo(this.noSleepVideo,"mp4",Byt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return TK()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):CK()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],h=0,x=0,b;f>2],b=(C&3)<<4,x=1;break;case 1:g[h++]=o[b|C>>4],b=(C&15)<<2,x=2;break;case 2:g[h++]=o[b|C>>6],g[h++]=o[C&63],x=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return x&&(g[h++]=o[b],g[h++]=61,x===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,x=0;x1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:h=b,g=1;break;case 1:f[d++]=h<<2|(b&48)>>4,h=b,g=2;break;case 2:f[d++]=(h&15)<<4|(b&60)>>2,h=b,g=3;break;case 3:f[d++]=(h&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var b=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((x<<31|b+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,g){var h=d(p,g),x=(h>>31)*2+1,b=h>>>23&255,C=h&8388607;return b===255?C?NaN:x*(1/0):b===0?x*1401298464324817e-60*C:x*Math.pow(2,b-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,C,T){u[0]=b,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(b,C,T){u[0]=b,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(b,C){return f[0]=b[C],f[1]=b[C+1],f[2]=b[C+2],f[3]=b[C+3],f[4]=b[C+4],f[5]=b[C+5],f[6]=b[C+6],f[7]=b[C+7],u[0]}function x(b,C){return f[7]=b[C],f[6]=b[C+1],f[5]=b[C+2],f[4]=b[C+3],f[3]=b[C+4],f[2]=b[C+5],f[1]=b[C+6],f[0]=b[C+7],u[0]}c.readDoubleLE=d?h:x,c.readDoubleBE=d?x:h}():function(){function u(d,p,g,h,x,b){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,x,b+p),d(1/h>0?0:2147483648,x,b+g);else if(isNaN(h))d(0,x,b+p),d(2146959360,x,b+g);else if(h>17976931348623157e292)d(0,x,b+p),d((C<<31|2146435072)>>>0,x,b+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,x,b+p),d((C<<31|T/4294967296)>>>0,x,b+g);else{var A=Math.floor(Math.log(h)/Math.LN2);A===1024&&(A=1023),T=h*Math.pow(2,-A),d(T*4503599627370496>>>0,x,b+p),d((C<<31|A+1023<<20|T*1048576&1048575)>>>0,x,b+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,g,h,x){var b=d(h,x+p),C=d(h,x+g),T=(C>>31)*2+1,A=C>>>20&2047,S=4294967296*(C&1048575)+b;return A===2047?S?NaN:T*(1/0):A===0?T*5e-324*S:T*Math.pow(2,A-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c191&&p<224?f[d++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,x){return RangeError("index out of range: "+h.pos+" + "+(x||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):u(T)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var h=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<>>0,h}if(this.len-this.pos>4){for(;x<5;++x)if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,x){return(h[x-4]|h[x-3]<<8|h[x-2]<<16|h[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);return this.pos+=x,Array.isArray(this.buf)?this.buf.slice(b,C):b===C?new this.buf.constructor(0):this._slice.call(this.buf,b,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){o=h,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u127;)S[v++]=A&127|128,A>>>=7;S[v]=A}function x(A,S){this.len=A,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(A,S,v){for(;A.hi;)S[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)S[v++]=A.lo&127|128,A.lo=A.lo>>>7;S[v++]=A.lo}d.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(A,S,v){S[v]=A&255,S[v+1]=A>>>8&255,S[v+2]=A>>>16&255,S[v+3]=A>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var v=r.from(S);return this._push(C,4,v.lo)._push(C,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,v,I){v.set(S,I)}:function(S,v,I){for(var O=0;O>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var I=d.alloc(v=s.length(S));s.decode(S,I,0),S=I}return this.uint32(v)._push(T,v,S)},d.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,v=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=S.next,this.tail=v,this.len+=I),this},d.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),I=0;S;)S.fn(S.val,v,I),I+=S.len,S=S.next;return v},d._configure=function(A){o=A,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var Txe=tl((tIi,gH)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,x=r(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),b={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return x.resultMask&&(b.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(g),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,d,p,g,h){var x=0,b=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/b),A=Math.floor(f.height/C),S=2*f.maxZError,v=Number.MAX_VALUE,I;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new d(f.width*f.height),h&&p&&(R=new Uint8Array(f.width*f.height));for(var N=new Float32Array(T*A),F,_,E=0;E<=C;E++){var w=E!==C?A:f.height%C;if(w!==0)for(var D=0;D<=b;D++){var M=D!==b?T:f.width%b;if(M!==0){var B=E*f.width*A+D*T,V=f.width-M,U=f.pixels.blocks[x],G,k,Y;U.encoding<2?(U.encoding===0?G=U.rawData:(u(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,S,N,f.pixels.maxValue),G=N),k=0):U.encoding===2?Y=0:Y=U.offset;var j;if(p)for(_=0;_>3],j<<=B&7),F=0;F>3]),j&128?(R&&(R[B]=1),I=U.encoding<2?G[k++]:Y,v=v>I?I:v,O[B++]=I):(R&&(R[B]=0),O[B++]=g),j<<=1;B+=V}else if(U.encoding<2)for(_=0;_I?I:v,O[B++]=I;B+=V}else for(v=v>Y?Y:v,_=0;_0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var C=x.getInt16(0,!0),T=2,A=0;do{if(C>0)for(;C--;)b[A++]=x.getUint8(T++);else{var S=x.getUint8(T++);for(C=-C;C--;)b[A++]=S}C=x.getInt16(T,!0),T+=2}while(T0?1:0),R=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(O*R);for(var N=0,F=0;F3)throw"Invalid block encoding ("+D.encoding+")";if(D.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,D.offsetType=M,M===2)D.offset=x.getInt8(1),E++;else if(M===1)D.offset=x.getInt16(1,!0),E+=2;else if(M===0)D.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(D.encoding===1)if(M=x.getUint8(E),E++,D.bitsPerPixel=M&63,M>>=6,D.numValidPixelsType=M,M===2)D.numValidPixels=x.getUint8(E),E++;else if(M===1)D.numValidPixels=x.getUint16(E,!0),E+=2;else if(M===0)D.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,D.encoding!==3){var B,V;if(D.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";B=new ArrayBuffer(U*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,U*4));var G=new Float32Array(B);D.rawData=G,d+=U*4}else if(D.encoding===1){var k=Math.ceil(D.numValidPixels*D.bitsPerPixel/8),Y=Math.ceil(k/4);B=new ArrayBuffer(Y*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,k)),D.stuffedData=new Uint32Array(B),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,x,b){var C=(1<=d)v=I>>>S-d&C,S-=d;else{var N=d-S;v=(I&C)<>>S}x[A]=v=f?(S=v>>>A-f&b,A-=f):(I=f-A,S=(v&b)<>>A),u[T]=p[S];else for(O=Math.ceil((x-g)/h),T=0;T=f?(S=v>>>A-f&b,A-=f):(I=f-A,S=(v&b)<>>A),u[T]=S=u?(A=S>>>T-u&h,T-=u):(C=u-T,A=(S&h)<>>T),v[b]=A=f?(v=I>>>S&b,A-=f,S+=f):(O=f-A,v=I>>>S&b,I=c[C++],A=32-O,v|=(I&(1<=f?(v=I>>>S&b,A-=f,S+=f):(O=f-A,v=I>>>S&b,I=c[C++],A=32-O,v|=(I&(1<=u?(A=v>>>S&h,T-=u,S+=u):(C=u-T,A=v>>>S&h,v=c[x++],T=32-C,A|=(v&(1<=f?(b=C>>>x-f&p,x-=f):(T=f-x,b=(C&p)<>>x),u[h]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<=f?(C=T>>>b&p,x-=f,b+=f):(A=f-x,C=T>>>b&p,T=c[g++],x=32-A,C|=(T&(1<=359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(h>=3&&(b=h>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,b=!0;for(x=0;x0){b=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,x.numBytes);var T=h.getInt16(0,!0),A=2,S=0,v=0;do{if(T>0)for(;T--;)b[S++]=h.getUint8(A++);else for(v=h.getUint8(A++),T=-T;T--;)b[S++]=v;T=h.getInt16(A,!0),A+=2}while(A>3],I<<=O&7):I=b[O>>3],I&128&&(C[O]=1);u.pixels.resultMask=C,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*g,C,T=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,b);else{var A=new ArrayBuffer(b),S=new Uint8Array(A);S.set(new Uint8Array(c,d,b)),C=new f(A)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var v=0,I=0,O=0,R=0;if(g>1)for(O=0;O=x)return!1;var b=new Uint32Array(x-h);r.decodeBits(c,u,b);var C=[],T,A,S,v;for(T=h;T0&&(C[A].second=E<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,E=F[w])):(_+=v-32,w++,E=F[w],C[A].second|=E>>>32-_));var D=0,M=0,B=new s;for(T=0;T=f?M=f:M=D,D>=30&&console.log("WARning, large NUM LUT BITS IS "+D);var V=[],U,G,k,Y,j,$;for(T=h;T0)if(U=[v,A],v<=M)for(G=C[A].second<=0;Y--)j=G>>>Y&1,j?($.right||($.right=new s),$=$.right):($.left||($.left=new s),$=$.left),Y===0&&!$.val&&($.val=U[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:D,tree:B,stuffedData:F,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,x=h*g,b=this.readHuffmanTree(c,u),C=b.decodeLut,T=b.tree,A=b.stuffedData,S=b.srcPtr,v=b.bitPos,I=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,N,F,_,E=u.pixels.resultMask,w,D,M,B,V,U,G,k=0;v>0&&(S++,v=0);var Y=A[S],j=u.encodeMode===1,$=new f(x*p),W=$,K;for(K=0;K1&&(W=new f($.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===h*g)for(U=0,B=0;B>>32-I,D=w,32-v>>64-v-I,D=w),C[D])F=C[D][1],v+=C[D][0];else for(w=Y<>>32-O,D=w,32-v>>64-v-O,D=w),N=T,G=0;G>>O-G-1&1,N=M?N.right:N.left,!(N.left||N.right)){F=N.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=A[S]),_=F-R,j?(V>0?_+=k:B>0?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}else for(U=0,B=0;B>>32-I,D=w,32-v>>64-v-I,D=w),C[D])F=C[D][1],v+=C[D][0];else for(w=Y<>>32-O,D=w,32-v>>64-v-O,D=w),N=T,G=0;G>>O-G-1&1,N=M?N.right:N.left,!(N.left||N.right)){F=N.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=A[S]),_=F-R,j?(V>0&&E[U-1]?_+=k:B>0&&E[U-h]?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=$},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,x=0,b=new DataView(c,u.ptr,5),C=b.getUint8(0);x++;var T=C>>6,A=T===0?4:3-T,S=(C&32)>0,v=C&31,I=0;if(A===1)I=b.getUint8(x),x++;else if(A===2)I=b.getUint16(x,!0),x+=2;else if(A===4)I=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,R,N,F,_,E,w,D,M,B,V,U=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,M=b.getUint8(x),B=v,x++,_=Math.ceil((M-1)*v/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),u.ptr+=x,F.set(new Uint8Array(c,u.ptr,_)),D=new Uint32Array(N),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(I*V/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),F.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(N),u.ptr+=_,h>=3?w=o.unstuffLUT2(D,v,M-1,d,O,U):w=o.unstuffLUT(D,v,M-1,d,O,U),h>=3?o.unstuff2(R,f,V,I,w):o.unstuff(R,f,V,I,w)}else u.counter.bitstuffer++,V=v,u.ptr+=x,V>0&&(_=Math.ceil(I*V/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),F.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(N),u.ptr+=_,h>=3?d==null?o.originalUnstuff2(R,f,V,I):o.unstuff2(R,f,V,I,!1,d,O,U):d==null?o.originalUnstuff(R,f,V,I):o.unstuff(R,f,V,I,!1,d,O,U))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,x=d.imageType,b=r.getDataTypeSize(x),C=Math.ceil(p/h),T=Math.ceil(g/h);u.pixels.numBlocksY=T,u.pixels.numBlocksX=C,u.pixels.ptr=0;var A=0,S=0,v=0,I=0,O=0,R=0,N=0,F=0,_=0,E=0,w=0,D=0,M=0,B=0,V=0,U=0,G,k,Y,j,$,W,K=new f(h*h),J=g%h||h,he=p%h||h,ge,se,_e=d.numDims,xe,Pe=u.pixels.resultMask,ve=u.pixels.resultPixels;for(v=0;v1&&(ve=new f(u.pixels.resultPixels.buffer,p*g*xe*b,p*g)),N=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,N)),k={},U=0,F=G.getUint8(0),U++,_=F>>6&255,E=F>>2&15,E!==(I*h>>3&15))throw"integrity issue";if(W=F&3,W>3)throw u.ptr+=U,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=U;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=U,M=O*R*b,B=c.byteLength-u.ptr,M=M1)for(g=0;g=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new x(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,x);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var A=C.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||h<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var I=p.pixels.resultMask;for(d=0;d1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var A,S,v;if(f>1&&h.length>1){for(v=C.width*C.height,C.bandMasks=h,b=new Uint8Array(v),b.set(h[0]),A=1;A{Cbe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var Ebe=tl((_Xi,Abe)=>{var{webm:Yyt,mp4:Xyt}=Tbe(),PK=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,OK=()=>"wakeLock"in navigator,RK=class{constructor(){if(this.enabled=!1,OK()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else PK()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",Yyt),this._addSourceToVideo(this.noSleepVideo,"mp4",Xyt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return OK()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):PK()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. - `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){TK()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):CK()?this.noSleepTimer&&(console.warn(` + `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){OK()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):PK()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};axe.exports=EK});var o0t={};Rxe(o0t,{AlphaMode:()=>Gm,AlphaPipelineStage:()=>uO,Animation:()=>A2,AnimationViewModel:()=>x2,Appearance:()=>$i,ApproximateTerrainHeights:()=>si,ArcGISTiledElevationTerrainProvider:()=>Aj,ArcGisBaseMapType:()=>mm,ArcGisMapServerImageryProvider:()=>bh,ArcGisMapService:()=>Pu,ArcType:()=>Qt,ArticulationStageType:()=>$a,AssociativeArray:()=>Et,AttributeCompression:()=>Yn,AttributeType:()=>cn,AutoExposure:()=>_L,AutomaticUniforms:()=>Wh,Axis:()=>cr,AxisAlignedBoundingBox:()=>cg,B3dmLoader:()=>D1,B3dmParser:()=>S1,BaseLayerPicker:()=>T2,BaseLayerPickerViewModel:()=>C2,BatchTable:()=>H0,BatchTableHierarchy:()=>pA,BatchTexture:()=>Lc,BatchTexturePipelineStage:()=>fO,Billboard:()=>fr,BillboardCollection:()=>iu,BillboardGraphics:()=>Wa,BillboardVisualizer:()=>gI,BingMapsGeocoderService:()=>Cj,BingMapsImageryProvider:()=>eS,BingMapsStyle:()=>Qb,BlendEquation:()=>ya,BlendFunction:()=>Tr,BlendOption:()=>Er,BlendingState:()=>mn,BoundingRectangle:()=>Ke,BoundingSphere:()=>ae,BoundingSphereState:()=>lt,BoxEmitter:()=>RY,BoxGeometry:()=>sl,BoxGeometryUpdater:()=>BP,BoxGraphics:()=>tA,BoxOutlineGeometry:()=>ad,BrdfLutGenerator:()=>xL,Buffer:()=>mt,BufferLoader:()=>CA,BufferUsage:()=>Fe,CPUStylingPipelineStage:()=>pO,CallbackProperty:()=>pd,Camera:()=>sr,CameraEventAggregator:()=>zL,CameraEventType:()=>Oi,CameraFlightPath:()=>UL,Cartesian2:()=>H,Cartesian3:()=>m,Cartesian4:()=>oe,Cartographic:()=>he,CartographicGeocoderService:()=>ZB,CatmullRomSpline:()=>Ej,Cesium3DContentGroup:()=>hA,Cesium3DTile:()=>Af,Cesium3DTileBatchTable:()=>xp,Cesium3DTileColorBlendMode:()=>dl,Cesium3DTileContent:()=>GY,Cesium3DTileContentFactory:()=>XA,Cesium3DTileContentState:()=>zr,Cesium3DTileContentType:()=>cs,Cesium3DTileFeature:()=>Ts,Cesium3DTileFeatureTable:()=>wd,Cesium3DTileOptimizationHint:()=>mf,Cesium3DTileOptimizations:()=>jR,Cesium3DTilePass:()=>Or,Cesium3DTilePassState:()=>Vf,Cesium3DTilePointFeature:()=>Gp,Cesium3DTileRefine:()=>Ur,Cesium3DTileStyle:()=>B_,Cesium3DTileStyleEngine:()=>ZR,Cesium3DTilesInspector:()=>D2,Cesium3DTilesInspectorViewModel:()=>w2,Cesium3DTilesVoxelProvider:()=>qY,Cesium3DTileset:()=>va,Cesium3DTilesetBaseTraversal:()=>iM,Cesium3DTilesetCache:()=>XR,Cesium3DTilesetGraphics:()=>cA,Cesium3DTilesetHeatmap:()=>KR,Cesium3DTilesetMetadata:()=>iy,Cesium3DTilesetMostDetailedTraversal:()=>eM,Cesium3DTilesetSkipTraversal:()=>sM,Cesium3DTilesetStatistics:()=>o_,Cesium3DTilesetTraversal:()=>Ds,Cesium3DTilesetVisualizer:()=>aM,CesiumInspector:()=>O2,CesiumInspectorViewModel:()=>P2,CesiumTerrainProvider:()=>Gy,CesiumWidget:()=>u2,Check:()=>el,CheckerboardMaterialProperty:()=>DE,CircleEmitter:()=>qL,CircleGeometry:()=>Dj,CircleOutlineGeometry:()=>Ij,ClassificationModelDrawCommand:()=>W1,ClassificationPipelineStage:()=>dO,ClassificationPrimitive:()=>xT,ClassificationType:()=>Hn,ClearCommand:()=>ri,ClippingPlane:()=>RA,ClippingPlaneCollection:()=>ss,Clock:()=>Hd,ClockRange:()=>Ro,ClockStep:()=>dr,ClockViewModel:()=>p2,CloudCollection:()=>$Y,CloudType:()=>rS,Color:()=>z,ColorBlendMode:()=>Qa,ColorGeometryInstanceAttribute:()=>kt,ColorMaterialProperty:()=>Vt,Command:()=>cK,ComponentDatatype:()=>X,Composite3DTileContent:()=>zP,CompositeEntityCollection:()=>A9,CompositeMaterialProperty:()=>PE,CompositePositionProperty:()=>ta,CompositeProperty:()=>rc,CompressedTextureBuffer:()=>Av,ComputeCommand:()=>ju,ComputeEngine:()=>ov,ConditionsExpression:()=>HL,ConeEmitter:()=>nq,ConstantPositionProperty:()=>Pc,ConstantProperty:()=>$n,ConstantSpline:()=>R1,ContentMetadata:()=>BR,Context:()=>uI,ContextLimits:()=>Ht,CoplanarPolygonGeometry:()=>WM,CoplanarPolygonGeometryLibrary:()=>$p,CoplanarPolygonOutlineGeometry:()=>gf,CornerType:()=>Ii,CorridorGeometry:()=>ux,CorridorGeometryLibrary:()=>Ni,CorridorGeometryUpdater:()=>_M,CorridorGraphics:()=>iA,CorridorOutlineGeometry:()=>pM,Credit:()=>It,CreditDisplay:()=>iN,CubeMap:()=>Ha,CubeMapFace:()=>Om,CubicRealPolynomial:()=>k0,CullFace:()=>gi,CullingVolume:()=>Jo,CumulusCloud:()=>Ru,CustomDataSource:()=>CM,CustomHeightmapTerrainProvider:()=>Oj,CustomShader:()=>MC,CustomShaderMode:()=>zp,CustomShaderPipelineStage:()=>TO,CustomShaderTranslucencyMode:()=>zg,CylinderGeometry:()=>TM,CylinderGeometryLibrary:()=>dx,CylinderGeometryUpdater:()=>bM,CylinderGraphics:()=>rA,CylinderOutlineGeometry:()=>EM,CzmlDataSource:()=>BM,DataSource:()=>Po,DataSourceClock:()=>Gd,DataSourceCollection:()=>LM,DataSourceDisplay:()=>CB,DebugAppearance:()=>_q,DebugCameraPrimitive:()=>Dh,DebugInspector:()=>sN,DebugModelMatrixPrimitive:()=>aN,DefaultProxy:()=>Mj,DepthFunction:()=>ja,DepthPlane:()=>dN,DequantizationPipelineStage:()=>bO,DerivedCommand:()=>F_,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>hN,DirectionalLight:()=>yq,DiscardEmptyTileImagePolicy:()=>$b,DiscardMissingTileImagePolicy:()=>pL,DistanceDisplayCondition:()=>Dt,DistanceDisplayConditionGeometryInstanceAttribute:()=>zn,DoubleEndedPriorityQueue:()=>jx,DoublyLinkedList:()=>qR,DracoLoader:()=>Dp,DrawCommand:()=>nt,DynamicGeometryBatch:()=>xx,DynamicGeometryUpdater:()=>ai,EarthOrientationParameters:()=>gv,EarthOrientationParametersSample:()=>J_,EasingFunction:()=>Mo,EllipseGeometry:()=>Gc,EllipseGeometryLibrary:()=>Sl,EllipseGeometryUpdater:()=>FM,EllipseGraphics:()=>oA,EllipseOutlineGeometry:()=>du,Ellipsoid:()=>re,EllipsoidGeodesic:()=>$u,EllipsoidGeometry:()=>Os,EllipsoidGeometryUpdater:()=>VM,EllipsoidGraphics:()=>sA,EllipsoidOutlineGeometry:()=>ou,EllipsoidPrimitive:()=>pN,EllipsoidRhumbLine:()=>xa,EllipsoidSurfaceAppearance:()=>xq,EllipsoidTangentPlane:()=>Aa,EllipsoidTerrainProvider:()=>Yx,EllipsoidalOccluder:()=>f_,Empty3DTileContent:()=>mE,EncodedCartesian3:()=>jn,Entity:()=>Kr,EntityCluster:()=>su,EntityCollection:()=>Is,EntityView:()=>EB,Event:()=>pe,EventHelper:()=>wo,Expression:()=>tf,ExpressionNodeType:()=>yt,ExtrapolationType:()=>cu,FeatureDetection:()=>Wt,FeatureIdPipelineStage:()=>kg,Fog:()=>yN,ForEach:()=>Oe,FrameRateMonitor:()=>AN,FrameState:()=>xN,Framebuffer:()=>Ys,FramebufferManager:()=>di,FrustumCommands:()=>CN,FrustumGeometry:()=>Xx,FrustumOutlineGeometry:()=>nL,Fullscreen:()=>uo,FullscreenButton:()=>M2,FullscreenButtonViewModel:()=>R2,GeoJsonDataSource:()=>MB,GeoJsonLoader:()=>I1,GeocodeType:()=>jy,Geocoder:()=>F2,GeocoderService:()=>Yb,GeocoderViewModel:()=>N2,GeographicProjection:()=>Si,GeographicTilingScheme:()=>zi,Geometry:()=>ft,Geometry3DTileContent:()=>GP,GeometryAttribute:()=>we,GeometryAttributes:()=>pn,GeometryFactory:()=>Uj,GeometryInstance:()=>Tt,GeometryInstanceAttribute:()=>Ya,GeometryOffsetAttribute:()=>sn,GeometryPipeline:()=>Fn,GeometryPipelineStage:()=>DO,GeometryType:()=>Yu,GeometryUpdater:()=>ci,GeometryVisualizer:()=>cB,GetFeatureInfoFormat:()=>oC,Globe:()=>VN,GlobeDepth:()=>kN,GlobeSurfaceShaderSet:()=>SN,GlobeSurfaceTile:()=>zf,GlobeSurfaceTileProvider:()=>IN,GlobeTranslucency:()=>PN,GlobeTranslucencyFramebuffer:()=>zN,GlobeTranslucencyState:()=>HN,GltfBufferViewLoader:()=>MT,GltfDracoLoader:()=>BT,GltfImageLoader:()=>LT,GltfIndexBufferLoader:()=>NT,GltfJsonLoader:()=>UT,GltfLoader:()=>Wm,GltfLoaderUtil:()=>pl,GltfStructuralMetadataLoader:()=>C1,GltfTextureLoader:()=>VT,GltfVertexBufferLoader:()=>kT,GoogleEarthEnterpriseImageryProvider:()=>kq,GoogleEarthEnterpriseMapsProvider:()=>cS,GoogleEarthEnterpriseMetadata:()=>fm,GoogleEarthEnterpriseTerrainData:()=>qb,GoogleEarthEnterpriseTerrainProvider:()=>qj,GoogleEarthEnterpriseTileInformation:()=>rL,GpxDataSource:()=>FB,GregorianDate:()=>Kh,GridImageryProvider:()=>zq,GridMaterialProperty:()=>kE,GroundGeometryUpdater:()=>Xn,GroundPolylineGeometry:()=>Z0,GroundPolylinePrimitive:()=>fd,GroundPrimitive:()=>Dc,GroupMetadata:()=>SE,HeadingPitchRange:()=>pu,HeadingPitchRoll:()=>za,Heap:()=>mv,HeightReference:()=>qe,HeightmapEncoding:()=>Bf,HeightmapTerrainData:()=>Ia,HeightmapTessellator:()=>Fb,HermitePolynomialApproximation:()=>SM,HermiteSpline:()=>Fg,HilbertOrder:()=>IT,HomeButton:()=>L2,HomeButtonViewModel:()=>B2,HorizontalOrigin:()=>_i,I3SDataProvider:()=>hC,I3SFeature:()=>GN,I3SField:()=>WN,I3SGeometry:()=>vS,I3SLayer:()=>t0,I3SNode:()=>wS,I3dmLoader:()=>O1,I3dmParser:()=>P1,Iau2000Orientation:()=>sL,Iau2006XysData:()=>yv,Iau2006XysSample:()=>R0,IauOrientationAxes:()=>aL,IauOrientationParameters:()=>oL,ImageBasedLighting:()=>mA,ImageBasedLightingPipelineStage:()=>K1,ImageMaterialProperty:()=>mg,Imagery:()=>yS,ImageryLayer:()=>Us,ImageryLayerCollection:()=>ON,ImageryLayerFeatureInfo:()=>hm,ImageryProvider:()=>qc,ImageryState:()=>fi,Implicit3DTileContent:()=>HT,ImplicitAvailabilityBitstream:()=>OT,ImplicitMetadataView:()=>RT,ImplicitSubdivisionScheme:()=>zo,ImplicitSubtree:()=>PA,ImplicitSubtreeCache:()=>WL,ImplicitSubtreeMetadata:()=>WP,ImplicitTileCoordinates:()=>ax,ImplicitTileset:()=>ry,IndexDatatype:()=>Ue,InfoBox:()=>z2,InfoBoxViewModel:()=>k2,InspectorShared:()=>Ma,InstanceAttributeSemantic:()=>Ho,InstancingPipelineStage:()=>sO,InterpolationAlgorithm:()=>Kj,InterpolationType:()=>Sd,Intersect:()=>tn,IntersectionTests:()=>qi,Intersections2D:()=>I_,Interval:()=>Ec,InvertClassification:()=>DS,Ion:()=>gd,IonGeocoderService:()=>uL,IonImageryProvider:()=>kf,IonResource:()=>Zs,IonWorldImageryStyle:()=>ym,Iso8601:()=>Ge,JobScheduler:()=>YN,JobType:()=>Ta,JsonMetadataTable:()=>Op,JulianDate:()=>ee,KTX2Transcoder:()=>xv,KeyboardEventModifier:()=>ca,KeyframeNode:()=>Ki,KmlCamera:()=>UB,KmlDataSource:()=>qB,KmlLookAt:()=>VB,KmlTour:()=>kB,KmlTourFlyTo:()=>GB,KmlTourWait:()=>WB,Label:()=>qg,LabelCollection:()=>Zm,LabelGraphics:()=>dd,LabelStyle:()=>kr,LabelVisualizer:()=>lB,LagrangePolynomialApproximation:()=>vM,LeapSecond:()=>Vi,Light:()=>Wq,LightingModel:()=>Ym,LightingPipelineStage:()=>PO,LinearApproximation:()=>hx,LinearSpline:()=>Ng,ManagedArray:()=>Bc,MapMode2D:()=>Ml,MapProjection:()=>Qj,MapboxImageryProvider:()=>uS,MapboxStyleImageryProvider:()=>jq,Mars3DEx:()=>Hh,Material:()=>ki,MaterialAppearance:()=>or,MaterialPipelineStage:()=>RO,MaterialProperty:()=>Xr,Math:()=>P,Matrix2:()=>Zi,Matrix3:()=>Z,Matrix4:()=>B,Megatexture:()=>PS,MetadataClass:()=>Td,MetadataClassProperty:()=>Tg,MetadataComponentType:()=>on,MetadataEntity:()=>Un,MetadataEnum:()=>a1,MetadataEnumValue:()=>s1,MetadataPipelineStage:()=>of,MetadataSchema:()=>Ed,MetadataSchemaLoader:()=>zT,MetadataSemantic:()=>OA,MetadataTable:()=>ml,MetadataTableProperty:()=>YP,MetadataType:()=>Yt,MipmapHint:()=>Rm,Model:()=>Pd,Model3DTileContent:()=>Xm,ModelAlphaOptions:()=>XO,ModelAnimation:()=>N1,ModelAnimationChannel:()=>L1,ModelAnimationCollection:()=>F1,ModelAnimationLoop:()=>yl,ModelAnimationState:()=>Dd,ModelArticulation:()=>Z1,ModelArticulationStage:()=>J1,ModelClippingPlanesPipelineStage:()=>eO,ModelColorPipelineStage:()=>Vg,ModelComponents:()=>Nt,ModelDrawCommand:()=>j1,ModelFeature:()=>U1,ModelFeatureTable:()=>k1,ModelGraphics:()=>mp,ModelLightingOptions:()=>nR,ModelMatrixUpdateStage:()=>aO,ModelNode:()=>tO,ModelRenderResources:()=>KO,ModelRuntimeNode:()=>lO,ModelRuntimePrimitive:()=>YO,ModelSceneGraph:()=>rR,ModelSilhouettePipelineStage:()=>QO,ModelSkin:()=>qO,ModelSplitterPipelineStage:()=>eR,ModelStatistics:()=>oR,ModelType:()=>Fr,ModelUtility:()=>$t,ModelVisualizer:()=>fB,Moon:()=>XN,MorphTargetsPipelineStage:()=>BO,MorphWeightSpline:()=>nY,MortonOrder:()=>oy,Multiple3DTileContent:()=>FR,MultisampleFramebuffer:()=>fI,NavigationHelpButton:()=>V2,NavigationHelpButtonViewModel:()=>U2,NearFarScalar:()=>Lt,NeverTileDiscardPolicy:()=>qq,NodeRenderResources:()=>tR,NodeStatisticsPipelineStage:()=>cO,NodeTransformationProperty:()=>aA,OIT:()=>JN,Occluder:()=>fL,OctahedralProjectedCubeMap:()=>_d,OffsetGeometryInstanceAttribute:()=>Yi,OpenCageGeocoderService:()=>oY,OpenStreetMapImageryProvider:()=>pC,OrderedGroundPrimitiveCollection:()=>NM,OrientedBoundingBox:()=>Bn,OrthographicFrustum:()=>rn,OrthographicOffCenterFrustum:()=>To,Packable:()=>sY,PackableForInterpolation:()=>aY,Particle:()=>RS,ParticleBurst:()=>Qq,ParticleEmitter:()=>$q,ParticleSystem:()=>eX,Pass:()=>Se,PassState:()=>Ga,PathGraphics:()=>hp,PathVisualizer:()=>mB,PeliasGeocoderService:()=>lL,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>z_,PerformanceWatchdog:()=>j2,PerformanceWatchdogViewModel:()=>W2,PerspectiveFrustum:()=>bi,PerspectiveOffCenterFrustum:()=>Yc,PickDepth:()=>QN,PickDepthFramebuffer:()=>eF,PickFramebuffer:()=>iF,Picking:()=>aF,PickingPipelineStage:()=>LO,PinBuilder:()=>v_,PixelDatatype:()=>Ze,PixelFormat:()=>at,Plane:()=>fn,PlaneGeometry:()=>kM,PlaneGeometryUpdater:()=>HM,PlaneGraphics:()=>wP,PlaneOutlineGeometry:()=>zM,PntsLoader:()=>aE,PntsParser:()=>HA,PointCloud:()=>lF,PointCloudEyeDomeLighting:()=>Mp,PointCloudShading:()=>jm,PointCloudStylingPipelineStage:()=>FO,PointGraphics:()=>lA,PointPrimitive:()=>Ps,PointPrimitiveCollection:()=>LE,PointVisualizer:()=>pB,PolygonGeometry:()=>bx,PolygonGeometryLibrary:()=>qn,PolygonGeometryUpdater:()=>YM,PolygonGraphics:()=>md,PolygonHierarchy:()=>Oc,PolygonOutlineGeometry:()=>jM,PolygonPipeline:()=>ui,Polyline:()=>uf,PolylineArrowMaterialProperty:()=>HE,PolylineCollection:()=>Md,PolylineColorAppearance:()=>Uo,PolylineDashMaterialProperty:()=>WE,PolylineGeometry:()=>b_,PolylineGeometryUpdater:()=>yB,PolylineGlowMaterialProperty:()=>YE,PolylineGraphics:()=>qa,PolylineMaterialAppearance:()=>Ks,PolylineOutlineMaterialProperty:()=>my,PolylinePipeline:()=>Di,PolylineVisualizer:()=>xB,PolylineVolumeGeometry:()=>KM,PolylineVolumeGeometryLibrary:()=>Ud,PolylineVolumeGeometryUpdater:()=>$M,PolylineVolumeGraphics:()=>uA,PolylineVolumeOutlineGeometry:()=>QM,PositionProperty:()=>fp,PositionPropertyArray:()=>p_,PostProcessStage:()=>_r,PostProcessStageCollection:()=>OF,PostProcessStageComposite:()=>Kc,PostProcessStageLibrary:()=>jf,PostProcessStageSampleMode:()=>Fu,PostProcessStageTextureCache:()=>bC,Primitive:()=>vn,PrimitiveCollection:()=>bl,PrimitiveLoadPlan:()=>NA,PrimitiveOutlineGenerator:()=>LA,PrimitiveOutlinePipelineStage:()=>kO,PrimitivePipeline:()=>X0,PrimitiveRenderResources:()=>iR,PrimitiveState:()=>ho,PrimitiveStatisticsPipelineStage:()=>zO,PrimitiveType:()=>Be,ProjectionPicker:()=>G2,ProjectionPickerViewModel:()=>H2,Property:()=>j,PropertyArray:()=>XE,PropertyAttribute:()=>BA,PropertyAttributeProperty:()=>g1,PropertyBag:()=>ul,PropertyTable:()=>Nc,PropertyTexture:()=>MA,PropertyTextureProperty:()=>_1,ProviderViewModel:()=>_s,Proxy:()=>lY,QuadraticRealPolynomial:()=>Sc,QuadtreeOccluders:()=>RN,QuadtreePrimitive:()=>UN,QuadtreeTile:()=>MN,QuadtreeTileLoadState:()=>Fs,QuadtreeTileProvider:()=>gX,QuantizedMeshTerrainData:()=>Gx,QuarticRealPolynomial:()=>ZI,Quaternion:()=>Le,QuaternionSpline:()=>B1,Queue:()=>$g,Ray:()=>In,Rectangle:()=>ce,RectangleCollisionChecker:()=>Dx,RectangleGeometry:()=>vx,RectangleGeometryLibrary:()=>ls,RectangleGeometryUpdater:()=>eB,RectangleGraphics:()=>hd,RectangleOutlineGeometry:()=>QA,ReferenceFrame:()=>tr,ReferenceProperty:()=>__,RenderState:()=>ze,Renderbuffer:()=>Yl,RenderbufferFormat:()=>Cc,Request:()=>jr,RequestErrorEvent:()=>Dm,RequestScheduler:()=>Va,RequestState:()=>ei,RequestType:()=>Ko,Resource:()=>ve,ResourceCache:()=>Bi,ResourceCacheKey:()=>_l,ResourceCacheStatistics:()=>f1,ResourceLoader:()=>nr,ResourceLoaderState:()=>wt,Rotation:()=>bf,RuntimeError:()=>de,S2Cell:()=>bp,SDFSettings:()=>vs,SampledPositionProperty:()=>ia,SampledProperty:()=>uu,Sampler:()=>dn,ScaledPositionProperty:()=>uh,Scene:()=>zF,SceneFramebuffer:()=>gC,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>HO,SceneModePicker:()=>q2,SceneModePickerViewModel:()=>Y2,SceneTransforms:()=>Xi,SceneTransitioner:()=>MF,ScreenSpaceCameraController:()=>NF,ScreenSpaceEventHandler:()=>Iu,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>Hg,SelectionIndicator:()=>J2,SelectionIndicatorViewModel:()=>K2,ShaderBuilder:()=>N0,ShaderCache:()=>rI,ShaderDestination:()=>be,ShaderFunction:()=>pI,ShaderProgram:()=>Zt,ShaderSource:()=>He,ShaderStruct:()=>hI,ShadowMap:()=>G_,ShadowMapShader:()=>Rh,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>Jl,ShowGeometryInstanceAttribute:()=>An,Simon1994PlanetaryPositions:()=>rg,SimplePolylineGeometry:()=>yY,SingleTileImageryProvider:()=>fS,SkinningPipelineStage:()=>WO,SkyAtmosphere:()=>WF,SkyBox:()=>qF,SpatialNode:()=>KF,SphereEmitter:()=>HX,SphereGeometry:()=>AY,SphereOutlineGeometry:()=>t_,Spherical:()=>wM,Spline:()=>ir,SplitDirection:()=>Fc,Splitter:()=>LS,StaticGeometryColorBatch:()=>wf,StaticGeometryPerMaterialBatch:()=>Df,StaticGroundGeometryColorBatch:()=>_b,StaticGroundGeometryPerMaterialBatch:()=>tB,StaticGroundPolylinePerMaterialBatch:()=>AB,StaticOutlineGeometryBatch:()=>Ab,StencilConstants:()=>Ft,StencilFunction:()=>Gn,StencilOperation:()=>ht,SteppedSpline:()=>M1,StripeMaterialProperty:()=>JE,StripeOrientation:()=>jd,StructuralMetadata:()=>Ea,StyleCommandsNeeded:()=>Id,StyleExpression:()=>GX,Sun:()=>n2,SunLight:()=>np,SunPostProcess:()=>VF,SupportedImageFormats:()=>T1,SvgPathBindingHandler:()=>m2,TaskProcessor:()=>pi,Terrain:()=>i2,TerrainData:()=>am,TerrainEncoding:()=>uc,TerrainExaggeration:()=>vc,TerrainFillMesh:()=>TS,TerrainMesh:()=>Nf,TerrainOffsetProperty:()=>fA,TerrainProvider:()=>Go,TerrainQuantization:()=>Bs,TerrainState:()=>pr,Texture:()=>Bt,TextureAtlas:()=>Yg,TextureCache:()=>oI,TextureMagnificationFilter:()=>xi,TextureManager:()=>a2,TextureMinificationFilter:()=>un,TextureUniform:()=>nK,TextureWrap:()=>Dn,TileAvailability:()=>cm,TileBoundingRegion:()=>_f,TileBoundingS2Cell:()=>GR,TileBoundingSphere:()=>n_,TileBoundingVolume:()=>WX,TileCoordinatesImageryProvider:()=>o2,TileDiscardPolicy:()=>YX,TileEdge:()=>yn,TileImagery:()=>AS,TileMapServiceImageryProvider:()=>wh,TileMetadata:()=>LR,TileOrientedBoundingBox:()=>yf,TileProviderError:()=>Ai,TileReplacementQueue:()=>BN,TileSelectionResult:()=>Qn,TileState:()=>qX,Tileset3DTileContent:()=>cR,TilesetMetadata:()=>WR,TilesetPipelineStage:()=>q1,TilingScheme:()=>xY,TimeConstants:()=>Zn,TimeDynamicImagery:()=>sC,TimeDynamicPointCloud:()=>kS,TimeInterval:()=>Tn,TimeIntervalCollection:()=>Io,TimeIntervalCollectionPositionProperty:()=>g_,TimeIntervalCollectionProperty:()=>y_,TimeStandard:()=>Jn,Timeline:()=>$2,TimelineHighlightRange:()=>Z2,TimelineTrack:()=>Q2,Tipsify:()=>nP,ToggleButtonViewModel:()=>f0,Tonemapper:()=>a0,Transforms:()=>Mt,TranslationRotationScale:()=>hg,TranslucentTileClassification:()=>oF,TridiagonalSystemSolver:()=>JT,TrustedServers:()=>nT,TweenCollection:()=>wC,UniformState:()=>lI,UniformType:()=>HS,UrlTemplateImageryProvider:()=>Ns,VERSION:()=>r0t,VRButton:()=>t3,VRButtonViewModel:()=>e3,VRTheWorldTerrainProvider:()=>EY,VaryingType:()=>iK,Vector3DTileBatch:()=>km,Vector3DTileClampedPolylines:()=>OR,Vector3DTileContent:()=>MR,Vector3DTileGeometry:()=>Tp,Vector3DTilePoints:()=>bR,Vector3DTilePolygons:()=>SR,Vector3DTilePolylines:()=>qA,Vector3DTilePrimitive:()=>yA,VelocityOrientationProperty:()=>IM,VelocityVectorProperty:()=>yx,VertexArray:()=>oi,VertexArrayFacade:()=>rp,VertexAttributeSemantic:()=>bt,VertexFormat:()=>Pe,VerticalOrigin:()=>Mn,VideoSynchronizer:()=>CY,View:()=>xC,Viewer:()=>bK,ViewportQuad:()=>JX,Visibility:()=>co,Visualizer:()=>hj,VoxelBoxShape:()=>Sh,VoxelContent:()=>jL,VoxelCylinderShape:()=>vh,VoxelEllipsoidShape:()=>eC,VoxelInspector:()=>i3,VoxelInspectorViewModel:()=>n3,VoxelPrimitive:()=>WS,VoxelProvider:()=>eK,VoxelRenderResources:()=>BL,VoxelShape:()=>tK,VoxelShapeType:()=>Hi,VoxelTraversal:()=>zS,VulkanConstants:()=>bY,WallGeometry:()=>iB,WallGeometryLibrary:()=>Ix,WallGeometryUpdater:()=>sB,WallGraphics:()=>pp,WallOutlineGeometry:()=>oB,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>dS,WebMapTileServiceImageryProvider:()=>mS,WebMercatorProjection:()=>wi,WebMercatorTilingScheme:()=>Bo,WindingOrder:()=>Xo,WireframeIndexGenerator:()=>oE,WireframePipelineStage:()=>jO,_shadersAcesTonemappingStage:()=>uF,_shadersAdditiveBlend:()=>FF,_shadersAdjustTranslucentFS:()=>OS,_shadersAllMaterialAppearanceFS:()=>xI,_shadersAllMaterialAppearanceVS:()=>CI,_shadersAmbientOcclusionGenerate:()=>fF,_shadersAmbientOcclusionModulate:()=>dF,_shadersAspectRampMaterial:()=>vI,_shadersAtmosphereCommon:()=>U_,_shadersBasicMaterialAppearanceFS:()=>TI,_shadersBasicMaterialAppearanceVS:()=>EI,_shadersBillboardCollectionFS:()=>lR,_shadersBillboardCollectionVS:()=>uR,_shadersBlackAndWhite:()=>mF,_shadersBloomComposite:()=>hF,_shadersBrdfLutGeneratorFS:()=>yL,_shadersBrightPass:()=>UF,_shadersBrightness:()=>pF,_shadersBumpMapMaterial:()=>wI,_shadersCPUStylingStageFS:()=>hO,_shadersCPUStylingStageVS:()=>mO,_shadersCheckerboardMaterial:()=>DI,_shadersCloudCollectionFS:()=>XL,_shadersCloudCollectionVS:()=>KL,_shadersCloudNoiseFS:()=>JL,_shadersCloudNoiseVS:()=>ZL,_shadersCompareAndPackTranslucentDepth:()=>rF,_shadersCompositeOITFS:()=>KN,_shadersCompositeTranslucentClassification:()=>AC,_shadersContrastBias:()=>_F,_shadersCustomShaderStageFS:()=>gO,_shadersCustomShaderStageVS:()=>_O,_shadersCzmBuiltins:()=>M0,_shadersDepthOfField:()=>gF,_shadersDepthPlaneFS:()=>cN,_shadersDepthPlaneVS:()=>lN,_shadersDepthView:()=>yF,_shadersDepthViewPacked:()=>rK,_shadersDotMaterial:()=>II,_shadersEdgeDetection:()=>AF,_shadersElevationBandMaterial:()=>PI,_shadersElevationContourMaterial:()=>OI,_shadersElevationRampMaterial:()=>RI,_shadersEllipsoidFS:()=>hS,_shadersEllipsoidSurfaceAppearanceFS:()=>_N,_shadersEllipsoidSurfaceAppearanceVS:()=>gN,_shadersEllipsoidVS:()=>pS,_shadersFXAA:()=>CF,_shadersFXAA3_11:()=>wF,_shadersFadeMaterial:()=>MI,_shadersFeatureIdStageFS:()=>yO,_shadersFeatureIdStageVS:()=>AO,_shadersFilmicTonemapping:()=>xF,_shadersGaussianBlur1D:()=>s0,_shadersGeometryStageFS:()=>SO,_shadersGeometryStageVS:()=>vO,_shadersGlobeFS:()=>EN,_shadersGlobeVS:()=>bN,_shadersGridMaterial:()=>BI,_shadersGroundAtmosphere:()=>_S,_shadersHSBToRGB:()=>Yw,_shadersHSLToRGB:()=>qw,_shadersImageBasedLightingStageFS:()=>X1,_shadersInstancingStageCommon:()=>nO,_shadersInstancingStageVS:()=>iO,_shadersIntersectBox:()=>vL,_shadersIntersectClippingPlanes:()=>SL,_shadersIntersectCylinder:()=>wL,_shadersIntersectDepth:()=>bL,_shadersIntersectEllipsoid:()=>DL,_shadersIntersection:()=>$x,_shadersIntersectionUtils:()=>EL,_shadersLegacyInstancingStageVS:()=>rO,_shadersLensFlare:()=>TF,_shadersLightingStageFS:()=>IO,_shadersMaterialStageFS:()=>OO,_shadersMegatexture:()=>ML,_shadersMetadataStageFS:()=>xO,_shadersMetadataStageVS:()=>CO,_shadersModelClippingPlanesStageFS:()=>$1,_shadersModelColorStageFS:()=>Q1,_shadersModelFS:()=>z1,_shadersModelSilhouetteStageFS:()=>JO,_shadersModelSilhouetteStageVS:()=>ZO,_shadersModelSplitterStageFS:()=>$O,_shadersModelVS:()=>H1,_shadersModifiedReinhardTonemapping:()=>EF,_shadersMorphTargetsStageVS:()=>MO,_shadersNightVision:()=>bF,_shadersNormalMapMaterial:()=>LI,_shadersOctahedralProjectionAtlasFS:()=>LP,_shadersOctahedralProjectionFS:()=>NP,_shadersOctahedralProjectionVS:()=>FP,_shadersOctree:()=>RL,_shadersPassThrough:()=>kl,_shadersPassThroughDepth:()=>e0,_shadersPerInstanceColorAppearanceFS:()=>jI,_shadersPerInstanceColorAppearanceVS:()=>YI,_shadersPerInstanceFlatColorAppearanceFS:()=>V0,_shadersPerInstanceFlatColorAppearanceVS:()=>qI,_shadersPointCloudEyeDomeLighting:()=>E1,_shadersPointCloudStylingStageVS:()=>NO,_shadersPointPrimitiveCollectionFS:()=>dy,_shadersPointPrimitiveCollectionVS:()=>gM,_shadersPolylineArrowMaterial:()=>NI,_shadersPolylineColorAppearanceVS:()=>hP,_shadersPolylineCommon:()=>Zl,_shadersPolylineDashMaterial:()=>FI,_shadersPolylineFS:()=>$0,_shadersPolylineGlowMaterial:()=>UI,_shadersPolylineMaterialAppearanceVS:()=>pP,_shadersPolylineOutlineMaterial:()=>VI,_shadersPolylineShadowVolumeFS:()=>uP,_shadersPolylineShadowVolumeMorphFS:()=>fP,_shadersPolylineShadowVolumeMorphVS:()=>dP,_shadersPolylineShadowVolumeVS:()=>mP,_shadersPolylineVS:()=>yR,_shadersPrimitiveOutlineStageFS:()=>VO,_shadersPrimitiveOutlineStageVS:()=>UO,_shadersRGBToHSB:()=>AD,_shadersRGBToHSL:()=>xD,_shadersRGBToXYZ:()=>CD,_shadersReinhardTonemapping:()=>SF,_shadersReprojectWebMercatorFS:()=>vN,_shadersReprojectWebMercatorVS:()=>wN,_shadersRimLightingMaterial:()=>kI,_shadersSelectedFeatureIdStageCommon:()=>rE,_shadersShadowVolumeAppearanceFS:()=>yT,_shadersShadowVolumeAppearanceVS:()=>QI,_shadersShadowVolumeFS:()=>lg,_shadersSilhouette:()=>vF,_shadersSkinningStageVS:()=>GO,_shadersSkyAtmosphereCommon:()=>NS,_shadersSkyAtmosphereFS:()=>HF,_shadersSkyAtmosphereVS:()=>GF,_shadersSkyBoxFS:()=>jF,_shadersSkyBoxVS:()=>YF,_shadersSlopeRampMaterial:()=>zI,_shadersStripeMaterial:()=>HI,_shadersSunFS:()=>ZF,_shadersSunTextureFS:()=>QF,_shadersSunVS:()=>$F,_shadersTexturedMaterialAppearanceFS:()=>bI,_shadersTexturedMaterialAppearanceVS:()=>SI,_shadersVector3DTileClampedPolylinesFS:()=>IR,_shadersVector3DTileClampedPolylinesVS:()=>DR,_shadersVector3DTilePolylinesVS:()=>vR,_shadersVectorTileVS:()=>DT,_shadersViewportQuadFS:()=>s2,_shadersViewportQuadVS:()=>C0,_shadersVoxelFS:()=>CL,_shadersVoxelVS:()=>TL,_shadersWater:()=>GI,_shadersXYZToRGB:()=>jD,_shadersacesTonemapping:()=>_w,_shadersalphaWeight:()=>gw,_shadersantialias:()=>yw,_shadersapproximateSphericalCoordinates:()=>Aw,_shadersbackFacing:()=>xw,_shadersbranchFreeTernary:()=>Cw,_shaderscascadeColor:()=>Tw,_shaderscascadeDistance:()=>Ew,_shaderscascadeMatrix:()=>bw,_shaderscascadeWeights:()=>Sw,_shaderscolumbusViewMorph:()=>vw,_shaderscomputePosition:()=>ww,_shadersconvertUvToBox:()=>IL,_shadersconvertUvToCylinder:()=>PL,_shadersconvertUvToEllipsoid:()=>OL,_shaderscosineAndSine:()=>Dw,_shadersdecompressTextureCoordinates:()=>Iw,_shadersdefaultPbrMaterial:()=>Pw,_shadersdegreesPerRadian:()=>Ev,_shadersdepthClamp:()=>Ow,_shadersdepthRange:()=>bv,_shadersdepthRangeStruct:()=>aw,_shaderseastNorthUpToEyeCoordinates:()=>Rw,_shadersellipsoidContainsPoint:()=>Mw,_shadersellipsoidWgs84TextureCoordinates:()=>Bw,_shadersepsilon1:()=>Sv,_shadersepsilon2:()=>vv,_shadersepsilon3:()=>wv,_shadersepsilon4:()=>Dv,_shadersepsilon5:()=>Iv,_shadersepsilon6:()=>Pv,_shadersepsilon7:()=>Ov,_shadersequalsEpsilon:()=>Lw,_shaderseyeOffset:()=>Nw,_shaderseyeToWindowCoordinates:()=>Fw,_shadersfastApproximateAtan:()=>Uw,_shadersfog:()=>Vw,_shadersfromCartesian:()=>YD,_shadersgammaCorrect:()=>kw,_shadersgeodeticSurfaceNormal:()=>zw,_shadersgetDefaultMaterial:()=>Hw,_shadersgetFloodRect:()=>qD,_shadersgetIndexMat:()=>XD,_shadersgetLambertDiffuse:()=>Gw,_shadersgetMaxIndex:()=>KD,_shadersgetMaxIndexVal:()=>JD,_shadersgetSpecular:()=>Ww,_shadersgetWaterNoise:()=>jw,_shadershue:()=>Xw,_shadersinfinity:()=>Rv,_shadersinverseGamma:()=>Kw,_shadersisEmpty:()=>Jw,_shadersisFull:()=>Zw,_shadersisInEllipsoid:()=>ZD,_shadersisInObliq:()=>QD,_shaderslatitudeToWebMercatorFraction:()=>Qw,_shaderslineDistance:()=>eD,_shaderslinearToSrgb:()=>$w,_shadersluminance:()=>tD,_shadersmagnitude:()=>$D,_shadersmagnitudeSquared:()=>eI,_shadersmaterial:()=>cw,_shadersmaterialInput:()=>lw,_shadersmetersPerPixel:()=>nD,_shadersmodelMaterial:()=>uw,_shadersmodelToWindowCoordinates:()=>iD,_shadersmodelVertexOutput:()=>fw,_shadersmultiplyComponents:()=>tI,_shadersmultiplyWithColorBalance:()=>rD,_shadersnearFarScalar:()=>oD,_shadersoctDecode:()=>sD,_shadersoneOverPi:()=>Mv,_shadersoneOverTwoPi:()=>Bv,_shaderspackDepth:()=>aD,_shaderspassCesium3DTile:()=>Lv,_shaderspassCesium3DTileClassification:()=>Nv,_shaderspassCesium3DTileClassificationIgnoreShow:()=>Fv,_shaderspassClassification:()=>Uv,_shaderspassCompute:()=>Vv,_shaderspassEnvironment:()=>kv,_shaderspassGlobe:()=>zv,_shaderspassOpaque:()=>Hv,_shaderspassOverlay:()=>Gv,_shaderspassTerrainClassification:()=>Wv,_shaderspassTranslucent:()=>jv,_shaderspassVoxels:()=>Yv,_shaderspbrLighting:()=>cD,_shaderspbrMetallicRoughnessMaterial:()=>lD,_shaderspbrParameters:()=>dw,_shaderspbrSpecularGlossinessMaterial:()=>uD,_shadersphong:()=>fD,_shaderspi:()=>qv,_shaderspiOverFour:()=>Xv,_shaderspiOverSix:()=>Kv,_shaderspiOverThree:()=>Jv,_shaderspiOverTwo:()=>Zv,_shadersplaneDistance:()=>dD,_shaderspointAlongRay:()=>mD,_shadersradiansPerDegree:()=>Qv,_shadersray:()=>mw,_shadersrayEllipsoidIntersectionInterval:()=>hD,_shadersraySegment:()=>hw,_shadersraySphereIntersectionInterval:()=>pD,_shadersreadDepth:()=>_D,_shadersreadNonPerspective:()=>gD,_shadersreverseLogDepth:()=>yD,_shadersround:()=>TD,_shaderssampleOctahedralProjection:()=>ED,_shaderssaturation:()=>bD,_shadersscaleToGeodeticSurface:()=>nI,_shaderssceneMode2D:()=>$v,_shaderssceneMode3D:()=>ew,_shaderssceneModeColumbusView:()=>tw,_shaderssceneModeMorphing:()=>nw,_shadersshadowDepthCompare:()=>SD,_shadersshadowParameters:()=>pw,_shadersshadowVisibility:()=>vD,_shaderssignNotZero:()=>wD,_shaderssolarRadius:()=>iw,_shaderssphericalHarmonics:()=>DD,_shaderssrgbToLinear:()=>ID,_shaderstangentToEyeSpaceMatrix:()=>PD,_shaderstextureCube:()=>OD,_shadersthreePiOver2:()=>rw,_shaderstransformPlane:()=>RD,_shaderstranslateRelativeToEye:()=>MD,_shaderstranslucentPhong:()=>BD,_shaderstranspose:()=>LD,_shaderstwoPi:()=>ow,_shadersunpackDepth:()=>ND,_shadersunpackFloat:()=>FD,_shadersunpackUint:()=>UD,_shadersvalueTransform:()=>VD,_shadersvertexLogDepth:()=>kD,_shaderswebMercatorMaxLatitude:()=>sw,_shaderswindowToEyeCoordinates:()=>zD,_shaderswriteDepthClamp:()=>HD,_shaderswriteLogDepth:()=>GD,_shaderswriteNonPerspective:()=>WD,addBuffer:()=>t1,addDefaults:()=>qP,addExtensionsRequired:()=>QP,addExtensionsUsed:()=>nf,addPipelineExtras:()=>vg,addToArray:()=>os,appendForwardSlash:()=>lv,arrayRemoveDuplicates:()=>Ar,barycentricCoordinates:()=>G0,binarySearch:()=>wr,buildDrawCommand:()=>Y1,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>NL,clone:()=>Ye,combine:()=>gt,computeFlyToLocationForRectangle:()=>nC,createBillboardPointCallback:()=>GA,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>E2,createDefaultTerrainProviderViewModels:()=>b2,createElevationBandMaterial:()=>iq,createGuid:()=>Wn,createMaterialPropertyDescriptor:()=>Dr,createOsmBuildings:()=>rq,createOsmBuildingsAsync:()=>oq,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>ll,createTangentSpaceDebugPrimitive:()=>sq,createTaskProcessorWorker:()=>oK,createUniform:()=>nv,createUniformArray:()=>iv,createWorldImagery:()=>hq,createWorldImageryAsync:()=>N_,createWorldTerrain:()=>Pj,createWorldTerrainAsync:()=>Wx,decodeGoogleEarthEnterpriseData:()=>QB,decodeVectorPolylinePositions:()=>RR,defaultValue:()=>y,defer:()=>qs,defined:()=>l,demodernizeShader:()=>iI,deprecationWarning:()=>$,destroyObject:()=>ue,exportKml:()=>E7,findAccessorMinMax:()=>vA,findContentMetadata:()=>KA,findGroupMetadata:()=>JA,findTileMetadata:()=>NR,forEachTextureInMaterial:()=>FT,formatError:()=>xh,freezeRenderState:()=>mG,getAbsoluteUri:()=>Zh,getAccessorByteStride:()=>hl,getBaseUri:()=>uv,getBinaryAccessor:()=>$l,getClipAndStyleCode:()=>TN,getClippingFunction:()=>R_,getComponentReader:()=>Pp,getElement:()=>Pn,getExtensionFromUri:()=>E0,getFilenameFromUri:()=>m_,getImageFromTypedArray:()=>iL,getImagePixels:()=>id,getJsonFromTypedArray:()=>Ir,getMagic:()=>yd,getStringFromTypedArray:()=>fl,getTimestamp:()=>yi,hasExtension:()=>ti,heightReferenceOnEntityPropertyChanged:()=>_p,isBitSet:()=>dc,isBlobUri:()=>b0,isCrossOriginUrl:()=>S0,isDataUri:()=>Qh,isLeapYear:()=>Jh,knockout:()=>Ce,knockout_3_5_1:()=>NC,knockout_es5:()=>d2,loadAndExecuteScript:()=>v0,loadCubeMap:()=>mI,loadImageFromTypedArray:()=>EA,loadKTX2:()=>il,mergeSort:()=>O_,moveTechniqueRenderStates:()=>ZP,moveTechniquesToExtension:()=>$P,numberOfComponentsForType:()=>tu,objectToQuery:()=>w0,oneTimeWarning:()=>Rt,parseBatchTable:()=>Np,parseBoundingVolumeSemantics:()=>d1,parseFeatureMetadataLegacy:()=>x1,parseGlb:()=>KP,parseResponseHeaders:()=>fv,parseStructuralMetadata:()=>A1,pointInsideTriangle:()=>cY,preprocess3DTileContent:()=>eh,processVoxelProperties:()=>LL,queryToObject:()=>Gl,readAccessorPacked:()=>n1,removeExtension:()=>wA,removeExtensionsRequired:()=>XP,removeExtensionsUsed:()=>SA,removePipelineExtras:()=>JP,removeUnusedElements:()=>e1,resizeImageToNextPowerOfTwo:()=>Ig,sampleTerrain:()=>uB,sampleTerrainMostDetailed:()=>E_,scaleToGeodeticSurface:()=>x0,subdivideArray:()=>$I,subscribeAndEvaluate:()=>fa,updateAccessorComponentTypes:()=>i1,updateVersion:()=>r1,usesExtension:()=>_o,viewerCesium3DTilesInspectorMixin:()=>SK,viewerCesiumInspectorMixin:()=>vK,viewerDragDropMixin:()=>DK,viewerPerformanceWatchdogMixin:()=>IK,viewerVoxelInspectorMixin:()=>PK,webGLConstantToGlslType:()=>SY,wrapFunction:()=>hL,writeTextToCanvas:()=>jA});var WC={},Bxe={addCache:function(e,t){return WC[e]=t,t},removeCache:function(e){delete WC[e]},getCache:function(e){return WC[e]},getCacheOrAdd:function(e){return WC[e]||(WC[e]={}),WC[e]}},Hh=Bxe;function Lxe(e){return e!=null}var l=Lxe;function y0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(y0.prototype=Object.create(Error.prototype),y0.prototype.constructor=y0);y0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};y0.throwInstantiationError=function(){throw new y0("This function defines an interface and should not be called directly.")};var fe=y0;var is={};is.typeOf={};function Nxe(e){return`${e} is required, actual value was undefined`}function jC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}is.defined=function(e,t){if(!l(t))throw new fe(Nxe(e))};is.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(jC(typeof t,"function",e))};is.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(jC(typeof t,"string",e))};is.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(jC(typeof t,"number",e))};is.typeOf.number.lessThan=function(e,t,n){if(is.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};is.typeOf.number.lessThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};is.typeOf.number.greaterThan=function(e,t,n){if(is.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};is.typeOf.number.greaterThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t0?1:-1});ct.signNotZero=function(e){return e<0?-1:1};ct.toSNorm=function(e,t){return t=y(t,255),Math.round((ct.clamp(e,-1,1)*.5+.5)*t)};ct.fromSNorm=function(e,t){return t=y(t,255),ct.clamp(e,0,t)/t*2-1};ct.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ct.clamp((e-t)/n,0,1)};ct.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});ct.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});ct.lerp=function(e,t,n){return(1-n)*e+n*t};ct.PI=Math.PI;ct.ONE_OVER_PI=1/Math.PI;ct.PI_OVER_TWO=Math.PI/2;ct.PI_OVER_THREE=Math.PI/3;ct.PI_OVER_FOUR=Math.PI/4;ct.PI_OVER_SIX=Math.PI/6;ct.THREE_PI_OVER_TWO=3*Math.PI/2;ct.TWO_PI=2*Math.PI;ct.ONE_OVER_TWO_PI=1/(2*Math.PI);ct.RADIANS_PER_DEGREE=Math.PI/180;ct.DEGREES_PER_RADIAN=180/Math.PI;ct.RADIANS_PER_ARCSECOND=ct.RADIANS_PER_DEGREE/3600;ct.toRadians=function(e){return e*ct.RADIANS_PER_DEGREE};ct.toDegrees=function(e){return e*ct.DEGREES_PER_RADIAN};ct.convertLongitudeRange=function(e){let t=ct.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ct.clampToLatitudeRange=function(e){return ct.clamp(e,-1*ct.PI_OVER_TWO,ct.PI_OVER_TWO)};ct.negativePiToPi=function(e){return e>=-ct.PI&&e<=ct.PI?e:ct.zeroToTwoPi(e+ct.PI)-ct.PI};ct.zeroToTwoPi=function(e){if(e>=0&&e<=ct.TWO_PI)return e;let t=ct.mod(e,ct.TWO_PI);return Math.abs(t)ct.EPSILON14?ct.TWO_PI:t};ct.mod=function(e,t){return ct.sign(e)===ct.sign(t)&&Math.abs(e)n};ct.greaterThanOrEquals=function(e,t,n){return e-t>-n};var f3=[1];ct.factorial=function(e){let t=f3.length;if(e>=t){let n=f3[t-1];for(let i=t;i<=e;i++){let r=n*i;f3.push(r),n=r}}return f3[e]};ct.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};ct.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ct.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ct.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};ct.clamp=function(e,t,n){return en?n:e};var XK=new KH.default;ct.setRandomNumberSeed=function(e){XK=new KH.default(e)};ct.nextRandomNumber=function(){return XK.random()};ct.randomBetween=function(e,t){return ct.nextRandomNumber()*(t-e)+e};ct.acosClamped=function(e){return Math.acos(ct.clamp(e,-1,1))};ct.asinClamped=function(e){return Math.asin(ct.clamp(e,-1,1))};ct.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ct.logBase=function(e,t){return Math.log(e)/Math.log(t)};ct.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});ct.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});ct.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ct.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ct.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=ct.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?ct.PI_OVER_TWO-i:i,i=e<0?ct.PI-i:i,i=t<0?-i:i,i};var P=ct;function et(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,r=y(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t};et.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;ri&&(r=u,i=f)}let o=1,s=0,a=$H[r],c=eG[r];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=o,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var p3=new tt,$K=new tt;tt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,r=0,o=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*Yxe(a);for(;oc;)Xxe(a,p3),tt.transpose(p3,$K),tt.multiply(a,p3,a),tt.multiply($K,a,a),tt.multiply(s,p3,s),++r>2&&(++o,r=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(o*u-c*s)+r*(c*i-n*u)+a*(n*s-o*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*r-i*f,t[2]=i*a-s*r,t[3]=c*a-o*f,t[4]=n*f-c*r,t[5]=o*r-n*a,t[6]=o*u-c*s,t[7]=c*i-n*u,t[8]=n*s-o*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var Kxe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,Kxe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};Abe.exports=RK});var x0t={};Xbe(x0t,{AlphaMode:()=>Gm,AlphaPipelineStage:()=>iO,Animation:()=>IB,AnimationViewModel:()=>DB,Appearance:()=>no,ApproximateTerrainHeights:()=>oi,ArcGISTiledElevationTerrainProvider:()=>Cj,ArcGisBaseMapType:()=>hm,ArcGisMapServerImageryProvider:()=>Eh,ArcGisMapService:()=>Ou,ArcType:()=>$t,ArticulationStageType:()=>$a,AssociativeArray:()=>At,AttributeCompression:()=>qn,AttributeType:()=>cn,AutoExposure:()=>n2,AutomaticUniforms:()=>ep,Axis:()=>uo,AxisAlignedBoundingBox:()=>ag,B3dmLoader:()=>CP,B3dmParser:()=>yP,BaseLayerPicker:()=>AB,BaseLayerPickerViewModel:()=>TB,BatchTable:()=>V0,BatchTableHierarchy:()=>mx,BatchTexture:()=>Rc,BatchTexturePipelineStage:()=>oO,Billboard:()=>ho,BillboardCollection:()=>nu,BillboardGraphics:()=>Na,BillboardVisualizer:()=>rv,BingMapsGeocoderService:()=>Aj,BingMapsImageryProvider:()=>lS,BingMapsStyle:()=>aS,BlendEquation:()=>ya,BlendFunction:()=>Eo,BlendOption:()=>So,BlendingState:()=>mn,BoundingRectangle:()=>Ke,BoundingSphere:()=>ae,BoundingSphereState:()=>ut,BoxEmitter:()=>aX,BoxGeometry:()=>rl,BoxGeometryUpdater:()=>ED,BoxGraphics:()=>Q0,BoxOutlineGeometry:()=>od,BrdfLutGenerator:()=>uF,Buffer:()=>ht,BufferLoader:()=>xx,BufferUsage:()=>ke,CPUStylingPipelineStage:()=>cO,CallbackProperty:()=>md,Camera:()=>co,CameraEventAggregator:()=>l2,CameraEventType:()=>Ri,CameraFlightPath:()=>dF,Cartesian2:()=>H,Cartesian3:()=>m,Cartesian4:()=>re,Cartographic:()=>me,CartographicGeocoderService:()=>YL,CatmullRomSpline:()=>Sj,Cesium3DContentGroup:()=>dx,Cesium3DTile:()=>yf,Cesium3DTileBatchTable:()=>yp,Cesium3DTileColorBlendMode:()=>ml,Cesium3DTileContent:()=>cX,Cesium3DTileContentFactory:()=>Xx,Cesium3DTileContentState:()=>Ho,Cesium3DTileContentType:()=>fs,Cesium3DTileFeature:()=>As,Cesium3DTileFeatureTable:()=>vd,Cesium3DTileOptimizationHint:()=>df,Cesium3DTileOptimizations:()=>VR,Cesium3DTilePass:()=>Mo,Cesium3DTilePassState:()=>zf,Cesium3DTilePointFeature:()=>Hp,Cesium3DTileRefine:()=>Uo,Cesium3DTileStyle:()=>q_,Cesium3DTileStyleEngine:()=>qR,Cesium3DTilesInspector:()=>MB,Cesium3DTilesInspectorViewModel:()=>RB,Cesium3DTilesVoxelProvider:()=>dX,Cesium3DTileset:()=>Os,Cesium3DTilesetBaseTraversal:()=>$R,Cesium3DTilesetCache:()=>GR,Cesium3DTilesetGraphics:()=>sx,Cesium3DTilesetHeatmap:()=>WR,Cesium3DTilesetMetadata:()=>ry,Cesium3DTilesetMostDetailedTraversal:()=>KR,Cesium3DTilesetSkipTraversal:()=>tM,Cesium3DTilesetStatistics:()=>o_,Cesium3DTilesetTraversal:()=>Ps,Cesium3DTilesetVisualizer:()=>nM,CesiumInspector:()=>FB,CesiumInspectorViewModel:()=>NB,CesiumTerrainProvider:()=>jy,CesiumWidget:()=>S2,Check:()=>nl,CheckerboardMaterialProperty:()=>DA,CircleEmitter:()=>Y2,CircleGeometry:()=>Oj,CircleOutlineGeometry:()=>Rj,ClassificationModelDrawCommand:()=>BP,ClassificationPipelineStage:()=>rO,ClassificationPrimitive:()=>bT,ClassificationType:()=>Hn,ClearCommand:()=>ci,ClippingPlane:()=>Px,ClippingPlaneCollection:()=>cs,Clock:()=>zd,ClockRange:()=>Rr,ClockStep:()=>po,ClockViewModel:()=>bB,CloudCollection:()=>yX,CloudType:()=>FS,Color:()=>z,ColorBlendMode:()=>Za,ColorGeometryInstanceAttribute:()=>zt,ColorMaterialProperty:()=>Ut,Command:()=>gK,ComponentDatatype:()=>X,Composite3DTileContent:()=>RD,CompositeEntityCollection:()=>A9,CompositeMaterialProperty:()=>OA,CompositePositionProperty:()=>na,CompositeProperty:()=>ic,CompressedTextureBuffer:()=>wv,ComputeCommand:()=>Zu,ComputeEngine:()=>mN,ConditionsExpression:()=>H2,ConeEmitter:()=>CX,ConstantPositionProperty:()=>wc,ConstantProperty:()=>ei,ConstantSpline:()=>SP,ContentMetadata:()=>DR,Context:()=>yN,ContextLimits:()=>Gt,CoplanarPolygonGeometry:()=>UM,CoplanarPolygonGeometryLibrary:()=>$p,CoplanarPolygonOutlineGeometry:()=>_f,CornerType:()=>Pi,CorridorGeometry:()=>ub,CorridorGeometryLibrary:()=>Bi,CorridorGeometryUpdater:()=>fM,CorridorGraphics:()=>tx,CorridorOutlineGeometry:()=>uM,Credit:()=>wt,CreditDisplay:()=>_F,CubeMap:()=>Ha,CubeMapFace:()=>Dm,CubicRealPolynomial:()=>F0,CullFace:()=>_i,CullingVolume:()=>Zr,CumulusCloud:()=>Uu,CustomDataSource:()=>_M,CustomHeightmapTerrainProvider:()=>Lj,CustomShader:()=>BC,CustomShaderMode:()=>Up,CustomShaderPipelineStage:()=>pO,CustomShaderTranslucencyMode:()=>Gg,CylinderGeometry:()=>gM,CylinderGeometryLibrary:()=>db,CylinderGeometryUpdater:()=>xM,CylinderGraphics:()=>nx,CylinderOutlineGeometry:()=>yM,CzmlDataSource:()=>DM,DataSource:()=>Pr,DataSourceClock:()=>Hd,DataSourceCollection:()=>PM,DataSourceDisplay:()=>_L,DebugAppearance:()=>IX,DebugCameraPrimitive:()=>vh,DebugInspector:()=>g2,DebugModelMatrixPrimitive:()=>J2,DefaultProxy:()=>Fj,DepthFunction:()=>Wa,DepthPlane:()=>xF,DequantizationPipelineStage:()=>gO,DerivedCommand:()=>B_,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>CF,DirectionalLight:()=>DX,DiscardEmptyTileImagePolicy:()=>cS,DiscardMissingTileImagePolicy:()=>GN,DistanceDisplayCondition:()=>Dt,DistanceDisplayConditionGeometryInstanceAttribute:()=>zn,DoubleEndedPriorityQueue:()=>jb,DoublyLinkedList:()=>HR,DracoLoader:()=>vp,DrawCommand:()=>nt,DynamicGeometryBatch:()=>bb,DynamicGeometryUpdater:()=>si,EarthOrientationParameters:()=>gv,EarthOrientationParametersSample:()=>eg,EasingFunction:()=>Mr,EllipseGeometry:()=>Hc,EllipseGeometryLibrary:()=>wl,EllipseGeometryUpdater:()=>RM,EllipseGraphics:()=>ix,EllipseOutlineGeometry:()=>fu,Ellipsoid:()=>oe,EllipsoidGeodesic:()=>Ju,EllipsoidGeometry:()=>Ls,EllipsoidGeometryUpdater:()=>LM,EllipsoidGraphics:()=>ox,EllipsoidOutlineGeometry:()=>ou,EllipsoidPrimitive:()=>sF,EllipsoidRhumbLine:()=>Ca,EllipsoidSurfaceAppearance:()=>PX,EllipsoidTangentPlane:()=>ba,EllipsoidTerrainProvider:()=>qb,EllipsoidalOccluder:()=>u_,Empty3DTileContent:()=>hA,EncodedCartesian3:()=>jn,Entity:()=>Ko,EntityCluster:()=>ru,EntityCollection:()=>Rs,EntityView:()=>yL,Event:()=>pe,EventHelper:()=>wr,Expression:()=>ef,ExpressionNodeType:()=>gt,ExtrapolationType:()=>au,FeatureDetection:()=>Wt,FeatureIdPipelineStage:()=>Hg,Fog:()=>TF,ForEach:()=>Oe,FrameRateMonitor:()=>Q2,FrameState:()=>AF,Framebuffer:()=>ea,FramebufferManager:()=>mi,FrustumCommands:()=>wF,FrustumGeometry:()=>Xb,FrustumOutlineGeometry:()=>$L,Fullscreen:()=>mr,FullscreenButton:()=>kB,FullscreenButtonViewModel:()=>BB,GeoJsonDataSource:()=>DL,GeoJsonLoader:()=>TP,GeocodeType:()=>Yy,Geocoder:()=>VB,GeocoderService:()=>XE,GeocoderViewModel:()=>UB,GeographicProjection:()=>vi,GeographicTilingScheme:()=>Hi,Geometry:()=>ft,Geometry3DTileContent:()=>LD,GeometryAttribute:()=>De,GeometryAttributes:()=>pn,GeometryFactory:()=>zj,GeometryInstance:()=>Ct,GeometryInstanceAttribute:()=>ja,GeometryOffsetAttribute:()=>sn,GeometryPipeline:()=>kn,GeometryPipelineStage:()=>CO,GeometryType:()=>ju,GeometryUpdater:()=>ai,GeometryVisualizer:()=>iL,GetFeatureInfoFormat:()=>iC,Globe:()=>rF,GlobeDepth:()=>IF,GlobeSurfaceShaderSet:()=>HN,GlobeSurfaceTile:()=>kf,GlobeSurfaceTileProvider:()=>KN,GlobeTranslucency:()=>JN,GlobeTranslucencyFramebuffer:()=>DF,GlobeTranslucencyState:()=>EF,GltfBufferViewLoader:()=>MT,GltfDracoLoader:()=>LT,GltfImageLoader:()=>NT,GltfIndexBufferLoader:()=>FT,GltfJsonLoader:()=>kT,GltfLoader:()=>Wm,GltfLoaderUtil:()=>_l,GltfStructuralMetadataLoader:()=>dP,GltfTextureLoader:()=>UT,GltfVertexBufferLoader:()=>VT,GoogleEarthEnterpriseImageryProvider:()=>RX,GoogleEarthEnterpriseMapsProvider:()=>mS,GoogleEarthEnterpriseMetadata:()=>um,GoogleEarthEnterpriseTerrainData:()=>KE,GoogleEarthEnterpriseTerrainProvider:()=>Jj,GoogleEarthEnterpriseTileInformation:()=>eN,GoogleMaps:()=>Jb,GpxDataSource:()=>ML,GregorianDate:()=>Yh,GridImageryProvider:()=>MX,GridMaterialProperty:()=>zA,GroundGeometryUpdater:()=>Xn,GroundPolylineGeometry:()=>K0,GroundPolylinePrimitive:()=>ld,GroundPrimitive:()=>Sc,GroupMetadata:()=>vA,HeadingPitchRange:()=>hu,HeadingPitchRoll:()=>za,Heap:()=>mv,HeightReference:()=>qe,HeightmapEncoding:()=>Mf,HeightmapTerrainData:()=>Da,HeightmapTessellator:()=>UE,HermitePolynomialApproximation:()=>bM,HermiteSpline:()=>Ug,HilbertOrder:()=>DT,HomeButton:()=>HB,HomeButtonViewModel:()=>zB,HorizontalOrigin:()=>pi,I3SDataProvider:()=>OC,I3SFeature:()=>tB,I3SField:()=>nB,I3SGeometry:()=>kS,I3SLayer:()=>u0,I3SNode:()=>US,I3dmLoader:()=>EP,I3dmParser:()=>AP,Iau2000Orientation:()=>nN,Iau2006XysData:()=>yv,Iau2006XysSample:()=>M0,IauOrientationAxes:()=>iN,IauOrientationParameters:()=>tN,ImageBasedLighting:()=>fx,ImageBasedLightingPipelineStage:()=>HP,ImageMaterialProperty:()=>mg,Imagery:()=>bS,ImageryLayer:()=>Vs,ImageryLayerCollection:()=>ZN,ImageryLayerFeatureInfo:()=>mm,ImageryProvider:()=>Yc,ImageryState:()=>fi,Implicit3DTileContent:()=>HT,ImplicitAvailabilityBitstream:()=>OT,ImplicitMetadataView:()=>RT,ImplicitSubdivisionScheme:()=>Vr,ImplicitSubtree:()=>Ix,ImplicitSubtreeCache:()=>W2,ImplicitSubtreeMetadata:()=>ND,ImplicitTileCoordinates:()=>ab,ImplicitTileset:()=>sy,IndexDatatype:()=>Ue,InfoBox:()=>WB,InfoBoxViewModel:()=>GB,InspectorShared:()=>La,InstanceAttributeSemantic:()=>zr,InstancingPipelineStage:()=>QP,InterpolationAlgorithm:()=>$j,InterpolationType:()=>Ad,Intersect:()=>tn,IntersectionTests:()=>Ji,Intersections2D:()=>I_,Interval:()=>bc,InvertClassification:()=>IS,Ion:()=>pd,IonGeocoderService:()=>sN,IonImageryProvider:()=>Uf,IonResource:()=>Zs,IonWorldImageryStyle:()=>_m,Iso8601:()=>He,JobScheduler:()=>SF,JobType:()=>Aa,JsonMetadataTable:()=>Dp,JulianDate:()=>ee,KTX2Transcoder:()=>Iv,KeyboardEventModifier:()=>la,KeyframeNode:()=>$i,KmlCamera:()=>LL,KmlDataSource:()=>GL,KmlLookAt:()=>NL,KmlTour:()=>FL,KmlTourFlyTo:()=>UL,KmlTourWait:()=>VL,Label:()=>Kg,LabelCollection:()=>Zm,LabelGraphics:()=>ud,LabelStyle:()=>zo,LabelVisualizer:()=>oL,LagrangePolynomialApproximation:()=>CM,LeapSecond:()=>Vi,Light:()=>FX,LightingModel:()=>qm,LightingPipelineStage:()=>AO,LinearApproximation:()=>hb,LinearSpline:()=>kg,ManagedArray:()=>Oc,MapMode2D:()=>Fl,MapProjection:()=>tq,MapboxImageryProvider:()=>pS,MapboxStyleImageryProvider:()=>BX,Mars3DEx:()=>Hh,Material:()=>zi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>SO,MaterialProperty:()=>Xo,Math:()=>P,Matrix2:()=>eo,Matrix3:()=>Z,Matrix4:()=>L,Megatexture:()=>zS,MetadataClass:()=>bd,MetadataClassProperty:()=>Eg,MetadataComponentType:()=>rn,MetadataEntity:()=>Un,MetadataEnum:()=>$D,MetadataEnumValue:()=>ZD,MetadataPipelineStage:()=>of,MetadataSchema:()=>Cd,MetadataSchemaLoader:()=>zT,MetadataSemantic:()=>Dx,MetadataTable:()=>hl,MetadataTableProperty:()=>BD,MetadataType:()=>qt,MipmapHint:()=>Pm,Model:()=>Dd,Model3DTileContent:()=>Xm,ModelAlphaOptions:()=>zO,ModelAnimation:()=>DP,ModelAnimationChannel:()=>IP,ModelAnimationCollection:()=>PP,ModelAnimationLoop:()=>xl,ModelAnimationState:()=>wd,ModelArticulation:()=>WP,ModelArticulationStage:()=>GP,ModelClippingPlanesPipelineStage:()=>YP,ModelColorPipelineStage:()=>zg,ModelComponents:()=>Ft,ModelDrawCommand:()=>kP,ModelFeature:()=>OP,ModelFeatureTable:()=>MP,ModelGraphics:()=>fp,ModelLightingOptions:()=>ZO,ModelMatrixUpdateStage:()=>eO,ModelNode:()=>XP,ModelRenderResources:()=>WO,ModelRuntimeNode:()=>nO,ModelRuntimePrimitive:()=>UO,ModelSceneGraph:()=>QO,ModelSilhouettePipelineStage:()=>YO,ModelSkin:()=>VO,ModelSplitterPipelineStage:()=>KO,ModelStatistics:()=>eR,ModelType:()=>Bo,ModelUtility:()=>Qt,ModelVisualizer:()=>sL,Moon:()=>cF,MorphTargetsPipelineStage:()=>wO,MorphWeightSpline:()=>rq,MortonOrder:()=>ay,Multiple3DTileContent:()=>RR,MultisampleFramebuffer:()=>hP,NavigationHelpButton:()=>qB,NavigationHelpButtonViewModel:()=>jB,NearFarScalar:()=>Rt,NeverTileDiscardPolicy:()=>UX,NodeRenderResources:()=>JO,NodeStatisticsPipelineStage:()=>tO,NodeTransformationProperty:()=>rx,OIT:()=>PF,Occluder:()=>aN,OctahedralProjectedCubeMap:()=>hd,OffsetGeometryInstanceAttribute:()=>Ki,OpenCageGeocoderService:()=>cq,OpenStreetMapImageryProvider:()=>RC,OrderedGroundPrimitiveCollection:()=>OM,OrientedBoundingBox:()=>Ln,OrthographicFrustum:()=>on,OrthographicOffCenterFrustum:()=>Ar,Packable:()=>lq,PackableForInterpolation:()=>uq,Particle:()=>HS,ParticleBurst:()=>zX,ParticleEmitter:()=>HX,ParticleSystem:()=>GX,Pass:()=>Ae,PassState:()=>mc,PathGraphics:()=>dp,PathVisualizer:()=>cL,PeliasGeocoderService:()=>rN,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>k_,PerformanceWatchdog:()=>XB,PerformanceWatchdogViewModel:()=>YB,PerspectiveFrustum:()=>Si,PerspectiveOffCenterFrustum:()=>qc,PickDepth:()=>vF,PickDepthFramebuffer:()=>RF,PickFramebuffer:()=>NF,Picking:()=>kF,PickingPipelineStage:()=>IO,PinBuilder:()=>S_,PixelDatatype:()=>Je,PixelFormat:()=>ct,Plane:()=>fn,PlaneGeometry:()=>NM,PlaneGeometryUpdater:()=>BM,PlaneGraphics:()=>gD,PlaneOutlineGeometry:()=>FM,PntsLoader:()=>cA,PntsParser:()=>Hx,PointCloud:()=>sB,PointCloudEyeDomeLighting:()=>Op,PointCloudShading:()=>jm,PointCloudStylingPipelineStage:()=>PO,PointGraphics:()=>ax,PointPrimitive:()=>Ms,PointPrimitiveCollection:()=>FA,PointVisualizer:()=>uL,PolygonGeometry:()=>Eb,PolygonGeometryLibrary:()=>Yn,PolygonGeometryUpdater:()=>zM,PolygonGraphics:()=>fd,PolygonHierarchy:()=>Ic,PolygonOutlineGeometry:()=>VM,PolygonPipeline:()=>ui,Polyline:()=>lf,PolylineArrowMaterialProperty:()=>GA,PolylineCollection:()=>Rd,PolylineColorAppearance:()=>kr,PolylineDashMaterialProperty:()=>jA,PolylineGeometry:()=>A_,PolylineGeometryUpdater:()=>mL,PolylineGlowMaterialProperty:()=>YA,PolylineGraphics:()=>qa,PolylineMaterialAppearance:()=>Ks,PolylineOutlineMaterialProperty:()=>py,PolylinePipeline:()=>Di,PolylineVisualizer:()=>pL,PolylineVolumeGeometry:()=>WM,PolylineVolumeGeometryLibrary:()=>Bd,PolylineVolumeGeometryUpdater:()=>XM,PolylineVolumeGraphics:()=>cx,PolylineVolumeOutlineGeometry:()=>YM,PositionProperty:()=>lp,PositionPropertyArray:()=>h_,PostProcessStage:()=>xo,PostProcessStageCollection:()=>s2,PostProcessStageComposite:()=>Kc,PostProcessStageLibrary:()=>Gf,PostProcessStageSampleMode:()=>Nu,PostProcessStageTextureCache:()=>gC,Primitive:()=>In,PrimitiveCollection:()=>vl,PrimitiveLoadPlan:()=>Lx,PrimitiveOutlineGenerator:()=>Mx,PrimitiveOutlinePipelineStage:()=>MO,PrimitivePipeline:()=>q0,PrimitiveRenderResources:()=>$O,PrimitiveState:()=>_r,PrimitiveStatisticsPipelineStage:()=>LO,PrimitiveType:()=>Fe,ProjectionPicker:()=>JB,ProjectionPickerViewModel:()=>KB,Property:()=>q,PropertyArray:()=>KA,PropertyAttribute:()=>Rx,PropertyAttributeProperty:()=>cP,PropertyBag:()=>ul,PropertyTable:()=>Mc,PropertyTexture:()=>Ox,PropertyTextureProperty:()=>aP,ProviderViewModel:()=>xs,Proxy:()=>dq,QuadraticRealPolynomial:()=>Tc,QuadtreeOccluders:()=>$N,QuadtreePrimitive:()=>oF,QuadtreeTile:()=>QN,QuadtreeTileLoadState:()=>ks,QuadtreeTileProvider:()=>KX,QuantizedMeshTerrainData:()=>Gb,QuarticRealPolynomial:()=>iw,Quaternion:()=>Be,QuaternionSpline:()=>wP,Queue:()=>ty,Ray:()=>wn,Rectangle:()=>ce,RectangleCollisionChecker:()=>Ib,RectangleGeometry:()=>vb,RectangleGeometryLibrary:()=>ds,RectangleGeometryUpdater:()=>KM,RectangleGraphics:()=>dd,RectangleOutlineGeometry:()=>$x,ReferenceFrame:()=>oo,ReferenceProperty:()=>p_,RenderState:()=>Ve,Renderbuffer:()=>eu,RenderbufferFormat:()=>Lc,Request:()=>jo,RequestErrorEvent:()=>Sm,RequestScheduler:()=>Ua,RequestState:()=>ti,RequestType:()=>Xr,Resource:()=>Se,ResourceCache:()=>Ni,ResourceCacheKey:()=>gl,ResourceCacheStatistics:()=>nP,ResourceLoader:()=>ro,ResourceLoaderState:()=>It,Rotation:()=>Af,RuntimeError:()=>de,S2Cell:()=>Tp,SDFSettings:()=>Is,SampledPositionProperty:()=>oa,SampledProperty:()=>lu,Sampler:()=>hn,ScaledPositionProperty:()=>uh,Scene:()=>x2,SceneFramebuffer:()=>uC,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>NO,SceneModePicker:()=>$B,SceneModePickerViewModel:()=>ZB,SceneTransforms:()=>Zi,SceneTransitioner:()=>c2,ScreenSpaceCameraController:()=>d2,ScreenSpaceEventHandler:()=>Iu,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>Wg,SelectionIndicator:()=>t3,SelectionIndicatorViewModel:()=>e3,ShaderBuilder:()=>Vx,ShaderCache:()=>hN,ShaderDestination:()=>Te,ShaderFunction:()=>GO,ShaderProgram:()=>Zt,ShaderSource:()=>Ge,ShaderStruct:()=>HO,ShadowMap:()=>z_,ShadowMapShader:()=>Ph,ShadowMode:()=>bn,ShadowVolumeAppearance:()=>Xl,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>Jy,SimplePolylineGeometry:()=>Tq,SingleTileImageryProvider:()=>_S,SkinningPipelineStage:()=>BO,SkyAtmosphere:()=>b2,SkyBox:()=>C2,SpatialNode:()=>cB,SphereEmitter:()=>ZX,SphereGeometry:()=>Aq,SphereOutlineGeometry:()=>e_,Spherical:()=>TM,Spline:()=>so,SplitDirection:()=>Nc,Splitter:()=>GS,StaticGeometryColorBatch:()=>vf,StaticGeometryPerMaterialBatch:()=>wf,StaticGroundGeometryColorBatch:()=>gE,StaticGroundGeometryPerMaterialBatch:()=>JM,StaticGroundPolylinePerMaterialBatch:()=>hL,StaticOutlineGeometryBatch:()=>bE,StencilConstants:()=>Bt,StencilFunction:()=>Gn,StencilOperation:()=>pt,SteppedSpline:()=>vP,StripeMaterialProperty:()=>ZA,StripeOrientation:()=>Wd,StructuralMetadata:()=>Ea,StyleCommandsNeeded:()=>Id,StyleExpression:()=>$X,Sun:()=>E2,SunLight:()=>O_,SunPostProcess:()=>p2,SupportedImageFormats:()=>mP,SvgPathBindingHandler:()=>yB,TaskProcessor:()=>gi,Terrain:()=>uB,TerrainData:()=>sm,TerrainEncoding:()=>lc,TerrainExaggeration:()=>Ac,TerrainFillMesh:()=>ES,TerrainMesh:()=>Nf,TerrainOffsetProperty:()=>lx,TerrainProvider:()=>Hr,TerrainQuantization:()=>Bs,TerrainState:()=>yo,Texture:()=>Lt,TextureAtlas:()=>Xg,TextureCache:()=>pN,TextureMagnificationFilter:()=>Ci,TextureManager:()=>mB,TextureMinificationFilter:()=>un,TextureUniform:()=>dK,TextureWrap:()=>Pn,TileAvailability:()=>am,TileBoundingRegion:()=>pf,TileBoundingS2Cell:()=>kR,TileBoundingSphere:()=>t_,TileBoundingVolume:()=>QX,TileCoordinatesImageryProvider:()=>dB,TileDiscardPolicy:()=>tK,TileEdge:()=>yn,TileImagery:()=>CS,TileMapServiceImageryProvider:()=>Sh,TileMetadata:()=>PR,TileOrientedBoundingBox:()=>gf,TileProviderError:()=>xi,TileReplacementQueue:()=>eF,TileSelectionResult:()=>$n,TileState:()=>nK,Tileset3DTileContent:()=>iR,TilesetMetadata:()=>UR,TilesetPipelineStage:()=>VP,TilingScheme:()=>Eq,TimeConstants:()=>Zn,TimeDynamicImagery:()=>oC,TimeDynamicPointCloud:()=>qS,TimeInterval:()=>An,TimeIntervalCollection:()=>Dr,TimeIntervalCollectionPositionProperty:()=>__,TimeIntervalCollectionProperty:()=>g_,TimeStandard:()=>Jn,Timeline:()=>o3,TimelineHighlightRange:()=>n3,TimelineTrack:()=>i3,Tipsify:()=>q1,ToggleButtonViewModel:()=>m0,Tonemapper:()=>a0,Transforms:()=>Mt,TranslationRotationScale:()=>hg,TranslucentTileClassification:()=>FF,TridiagonalSystemSolver:()=>ZT,TrustedServers:()=>rT,TweenCollection:()=>bC,UniformState:()=>gN,UniformType:()=>XS,UrlTemplateImageryProvider:()=>Us,VERSION:()=>y0t,VRButton:()=>s3,VRButtonViewModel:()=>r3,VRTheWorldTerrainProvider:()=>wq,VaryingType:()=>mK,Vector3DTileBatch:()=>Vm,Vector3DTileClampedPolylines:()=>vR,Vector3DTileContent:()=>IR,Vector3DTileGeometry:()=>bp,Vector3DTilePoints:()=>xR,Vector3DTilePolygons:()=>bR,Vector3DTilePolylines:()=>Yx,Vector3DTilePrimitive:()=>_x,VelocityOrientationProperty:()=>EM,VelocityVectorProperty:()=>yb,VertexArray:()=>ri,VertexArrayFacade:()=>Vp,VertexAttributeSemantic:()=>Et,VertexFormat:()=>Me,VerticalOrigin:()=>Mn,VideoSynchronizer:()=>Sq,View:()=>mC,Viewer:()=>MK,ViewportQuad:()=>rK,Visibility:()=>lr,Visualizer:()=>_j,VoxelBoxShape:()=>Nh,VoxelContent:()=>j2,VoxelCylinderShape:()=>Fh,VoxelEllipsoidShape:()=>SC,VoxelInspector:()=>c3,VoxelInspectorViewModel:()=>a3,VoxelPrimitive:()=>JS,VoxelProvider:()=>lK,VoxelRenderResources:()=>U2,VoxelShape:()=>uK,VoxelShapeType:()=>Wi,VoxelTraversal:()=>YS,VulkanConstants:()=>Iq,WallGeometry:()=>$M,WallGeometryLibrary:()=>Db,WallGeometryUpdater:()=>tL,WallGraphics:()=>mp,WallOutlineGeometry:()=>eL,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>gS,WebMapTileServiceImageryProvider:()=>yS,WebMercatorProjection:()=>Ii,WebMercatorTilingScheme:()=>Lr,WindingOrder:()=>Jr,WireframeIndexGenerator:()=>sA,WireframePipelineStage:()=>kO,_shadersAcesTonemappingStage:()=>UF,_shadersAdditiveBlend:()=>m2,_shadersAdjustTranslucentFS:()=>eS,_shadersAllMaterialAppearanceFS:()=>Cv,_shadersAllMaterialAppearanceVS:()=>Tv,_shadersAmbientOcclusionGenerate:()=>VF,_shadersAmbientOcclusionModulate:()=>zF,_shadersAspectRampMaterial:()=>Ov,_shadersAtmosphereCommon:()=>R_,_shadersBasicMaterialAppearanceFS:()=>Av,_shadersBasicMaterialAppearanceVS:()=>Ev,_shadersBillboardCollectionFS:()=>oR,_shadersBillboardCollectionVS:()=>rR,_shadersBlackAndWhite:()=>HF,_shadersBloomComposite:()=>GF,_shadersBrdfLutGeneratorFS:()=>bN,_shadersBrightPass:()=>h2,_shadersBrightness:()=>WF,_shadersBumpMapMaterial:()=>Rv,_shadersCPUStylingStageFS:()=>aO,_shadersCPUStylingStageVS:()=>sO,_shadersCheckerboardMaterial:()=>Mv,_shadersCloudCollectionFS:()=>CN,_shadersCloudCollectionVS:()=>TN,_shadersCloudNoiseFS:()=>AN,_shadersCloudNoiseVS:()=>EN,_shadersCompareAndPackTranslucentDepth:()=>SN,_shadersCompositeOITFS:()=>vN,_shadersCompositeTranslucentClassification:()=>dC,_shadersContrastBias:()=>jF,_shadersCustomShaderStageFS:()=>uO,_shadersCustomShaderStageVS:()=>lO,_shadersCzmBuiltins:()=>U0,_shadersDepthOfField:()=>qF,_shadersDepthPlaneFS:()=>wN,_shadersDepthPlaneVS:()=>IN,_shadersDepthView:()=>YF,_shadersDepthViewPacked:()=>fK,_shadersDotMaterial:()=>Lv,_shadersEdgeDetection:()=>XF,_shadersElevationBandMaterial:()=>Nv,_shadersElevationContourMaterial:()=>Fv,_shadersElevationRampMaterial:()=>Bv,_shadersEllipsoidFS:()=>tS,_shadersEllipsoidSurfaceAppearanceFS:()=>Z2,_shadersEllipsoidSurfaceAppearanceVS:()=>$2,_shadersEllipsoidVS:()=>nS,_shadersFXAA:()=>JF,_shadersFXAA3_11:()=>DN,_shadersFadeMaterial:()=>kv,_shadersFeatureIdStageFS:()=>fO,_shadersFeatureIdStageVS:()=>dO,_shadersFilmicTonemapping:()=>KF,_shadersGaussianBlur1D:()=>s0,_shadersGeometryStageFS:()=>yO,_shadersGeometryStageVS:()=>xO,_shadersGlobeFS:()=>PN,_shadersGlobeVS:()=>ON,_shadersGridMaterial:()=>Uv,_shadersGroundAtmosphere:()=>iS,_shadersHSBToRGB:()=>PI,_shadersHSLToRGB:()=>OI,_shadersImageBasedLightingStageFS:()=>zP,_shadersInstancingStageCommon:()=>KP,_shadersInstancingStageVS:()=>JP,_shadersIntersectBox:()=>O2,_shadersIntersectClippingPlanes:()=>P2,_shadersIntersectCylinder:()=>R2,_shadersIntersectDepth:()=>D2,_shadersIntersectEllipsoid:()=>M2,_shadersIntersection:()=>EC,_shadersIntersectionUtils:()=>I2,_shadersLegacyInstancingStageVS:()=>ZP,_shadersLensFlare:()=>ZF,_shadersLightingStageFS:()=>TO,_shadersMaterialStageFS:()=>EO,_shadersMegatexture:()=>k2,_shadersMetadataStageFS:()=>mO,_shadersMetadataStageVS:()=>hO,_shadersModelClippingPlanesStageFS:()=>qP,_shadersModelColorStageFS:()=>jP,_shadersModelFS:()=>LP,_shadersModelSilhouetteStageFS:()=>jO,_shadersModelSilhouetteStageVS:()=>qO,_shadersModelSplitterStageFS:()=>XO,_shadersModelVS:()=>NP,_shadersModifiedReinhardTonemapping:()=>$F,_shadersMorphTargetsStageVS:()=>vO,_shadersNightVision:()=>QF,_shadersNormalMapMaterial:()=>Vv,_shadersOctahedralProjectionAtlasFS:()=>SD,_shadersOctahedralProjectionFS:()=>vD,_shadersOctahedralProjectionVS:()=>wD,_shadersOctree:()=>B2,_shadersPassThrough:()=>Bl,_shadersPassThroughDepth:()=>i0,_shadersPerInstanceColorAppearanceFS:()=>Jv,_shadersPerInstanceColorAppearanceVS:()=>Zv,_shadersPerInstanceFlatColorAppearanceFS:()=>N0,_shadersPerInstanceFlatColorAppearanceVS:()=>$v,_shadersPointCloudEyeDomeLighting:()=>_P,_shadersPointCloudStylingStageVS:()=>DO,_shadersPointPrimitiveCollectionFS:()=>hy,_shadersPointPrimitiveCollectionVS:()=>dM,_shadersPolylineArrowMaterial:()=>zv,_shadersPolylineColorAppearanceVS:()=>oD,_shadersPolylineCommon:()=>Kl,_shadersPolylineDashMaterial:()=>Hv,_shadersPolylineFS:()=>Z0,_shadersPolylineGlowMaterial:()=>Gv,_shadersPolylineMaterialAppearanceVS:()=>rD,_shadersPolylineOutlineMaterial:()=>Wv,_shadersPolylineShadowVolumeFS:()=>eD,_shadersPolylineShadowVolumeMorphFS:()=>tD,_shadersPolylineShadowVolumeMorphVS:()=>nD,_shadersPolylineShadowVolumeVS:()=>iD,_shadersPolylineVS:()=>mR,_shadersPrimitiveOutlineStageFS:()=>RO,_shadersPrimitiveOutlineStageVS:()=>OO,_shadersRGBToHSB:()=>i1,_shadersRGBToHSL:()=>o1,_shadersRGBToXYZ:()=>r1,_shadersReinhardTonemapping:()=>e2,_shadersReprojectWebMercatorFS:()=>RN,_shadersReprojectWebMercatorVS:()=>MN,_shadersRimLightingMaterial:()=>jv,_shadersSelectedFeatureIdStageCommon:()=>rA,_shadersShadowVolumeAppearanceFS:()=>yT,_shadersShadowVolumeAppearanceVS:()=>H1,_shadersShadowVolumeFS:()=>lg,_shadersSilhouette:()=>t2,_shadersSkinningStageVS:()=>FO,_shadersSkyAtmosphereCommon:()=>oS,_shadersSkyAtmosphereFS:()=>LN,_shadersSkyAtmosphereVS:()=>NN,_shadersSkyBoxFS:()=>FN,_shadersSkyBoxVS:()=>BN,_shadersSlopeRampMaterial:()=>qv,_shadersStripeMaterial:()=>Yv,_shadersSunFS:()=>kN,_shadersSunTextureFS:()=>UN,_shadersSunVS:()=>VN,_shadersTexturedMaterialAppearanceFS:()=>Sv,_shadersTexturedMaterialAppearanceVS:()=>vv,_shadersVector3DTileClampedPolylinesFS:()=>ER,_shadersVector3DTileClampedPolylinesVS:()=>AR,_shadersVector3DTilePolylinesVS:()=>CR,_shadersVectorTileVS:()=>IT,_shadersViewportQuadFS:()=>zN,_shadersViewportQuadVS:()=>Qb,_shadersVoxelFS:()=>v2,_shadersVoxelVS:()=>w2,_shadersWater:()=>Xv,_shadersXYZToRGB:()=>D1,_shadersacesTonemapping:()=>eI,_shadersalphaWeight:()=>tI,_shadersantialias:()=>nI,_shadersapproximateSphericalCoordinates:()=>iI,_shadersbackFacing:()=>oI,_shadersbranchFreeTernary:()=>rI,_shaderscascadeColor:()=>sI,_shaderscascadeDistance:()=>aI,_shaderscascadeMatrix:()=>cI,_shaderscascadeWeights:()=>lI,_shaderscolumbusViewMorph:()=>uI,_shaderscomputePosition:()=>fI,_shadersconvertUvToBox:()=>L2,_shadersconvertUvToCylinder:()=>N2,_shadersconvertUvToEllipsoid:()=>F2,_shaderscosineAndSine:()=>dI,_shadersdecompressTextureCoordinates:()=>mI,_shadersdefaultPbrMaterial:()=>hI,_shadersdegreesPerRadian:()=>aw,_shadersdepthClamp:()=>pI,_shadersdepthRange:()=>cw,_shadersdepthRangeStruct:()=>jw,_shaderseastNorthUpToEyeCoordinates:()=>_I,_shadersellipsoidContainsPoint:()=>gI,_shadersellipsoidWgs84TextureCoordinates:()=>yI,_shadersepsilon1:()=>lw,_shadersepsilon2:()=>uw,_shadersepsilon3:()=>fw,_shadersepsilon4:()=>dw,_shadersepsilon5:()=>mw,_shadersepsilon6:()=>hw,_shadersepsilon7:()=>pw,_shadersequalsEpsilon:()=>xI,_shaderseyeOffset:()=>bI,_shaderseyeToWindowCoordinates:()=>CI,_shadersfastApproximateAtan:()=>TI,_shadersfog:()=>AI,_shadersfromCartesian:()=>P1,_shadersgammaCorrect:()=>EI,_shadersgeodeticSurfaceNormal:()=>SI,_shadersgetDefaultMaterial:()=>vI,_shadersgetFloodRect:()=>O1,_shadersgetIndexMat:()=>R1,_shadersgetLambertDiffuse:()=>wI,_shadersgetMaxIndex:()=>M1,_shadersgetMaxIndexVal:()=>L1,_shadersgetSpecular:()=>II,_shadersgetWaterNoise:()=>DI,_shadershue:()=>RI,_shadersinfinity:()=>_w,_shadersinverseGamma:()=>MI,_shadersisEmpty:()=>LI,_shadersisFull:()=>NI,_shadersisInEllipsoid:()=>N1,_shadersisInObliq:()=>F1,_shaderslatitudeToWebMercatorFraction:()=>FI,_shaderslineDistance:()=>kI,_shaderslinearToSrgb:()=>BI,_shadersluminance:()=>UI,_shadersmagnitude:()=>B1,_shadersmagnitudeSquared:()=>k1,_shadersmaterial:()=>qw,_shadersmaterialInput:()=>Yw,_shadersmetersPerPixel:()=>VI,_shadersmodelMaterial:()=>Xw,_shadersmodelToWindowCoordinates:()=>zI,_shadersmodelVertexOutput:()=>Kw,_shadersmultiplyComponents:()=>U1,_shadersmultiplyWithColorBalance:()=>HI,_shadersnearFarScalar:()=>GI,_shadersoctDecode:()=>WI,_shadersoneOverPi:()=>gw,_shadersoneOverTwoPi:()=>yw,_shaderspackDepth:()=>jI,_shaderspassCesium3DTile:()=>xw,_shaderspassCesium3DTileClassification:()=>bw,_shaderspassCesium3DTileClassificationIgnoreShow:()=>Cw,_shaderspassClassification:()=>Tw,_shaderspassCompute:()=>Aw,_shaderspassEnvironment:()=>Ew,_shaderspassGlobe:()=>Sw,_shaderspassOpaque:()=>vw,_shaderspassOverlay:()=>ww,_shaderspassTerrainClassification:()=>Iw,_shaderspassTranslucent:()=>Dw,_shaderspassVoxels:()=>Pw,_shaderspbrLighting:()=>qI,_shaderspbrMetallicRoughnessMaterial:()=>YI,_shaderspbrParameters:()=>Jw,_shaderspbrSpecularGlossinessMaterial:()=>XI,_shadersphong:()=>KI,_shaderspi:()=>Ow,_shaderspiOverFour:()=>Rw,_shaderspiOverSix:()=>Mw,_shaderspiOverThree:()=>Lw,_shaderspiOverTwo:()=>Nw,_shadersplaneDistance:()=>JI,_shaderspointAlongRay:()=>ZI,_shadersradiansPerDegree:()=>Fw,_shadersray:()=>Zw,_shadersrayEllipsoidIntersectionInterval:()=>$I,_shadersraySegment:()=>$w,_shadersraySphereIntersectionInterval:()=>QI,_shadersreadDepth:()=>e1,_shadersreadNonPerspective:()=>t1,_shadersreverseLogDepth:()=>n1,_shadersround:()=>s1,_shaderssampleOctahedralProjection:()=>a1,_shaderssaturation:()=>c1,_shadersscaleToGeodeticSurface:()=>V1,_shaderssceneMode2D:()=>Bw,_shaderssceneMode3D:()=>kw,_shaderssceneModeColumbusView:()=>Uw,_shaderssceneModeMorphing:()=>Vw,_shadersshadowDepthCompare:()=>l1,_shadersshadowParameters:()=>Qw,_shadersshadowVisibility:()=>u1,_shaderssignNotZero:()=>f1,_shaderssolarRadius:()=>zw,_shaderssphericalHarmonics:()=>d1,_shaderssrgbToLinear:()=>m1,_shaderstangentToEyeSpaceMatrix:()=>h1,_shaderstextureCube:()=>p1,_shadersthreePiOver2:()=>Hw,_shaderstransformPlane:()=>_1,_shaderstranslateRelativeToEye:()=>g1,_shaderstranslucentPhong:()=>y1,_shaderstranspose:()=>x1,_shaderstwoPi:()=>Gw,_shadersunpackDepth:()=>b1,_shadersunpackFloat:()=>C1,_shadersunpackUint:()=>T1,_shadersvalueTransform:()=>A1,_shadersvertexLogDepth:()=>E1,_shaderswebMercatorMaxLatitude:()=>Ww,_shaderswindowToEyeCoordinates:()=>S1,_shaderswriteDepthClamp:()=>v1,_shaderswriteLogDepth:()=>w1,_shaderswriteNonPerspective:()=>I1,addBuffer:()=>qD,addDefaults:()=>kD,addExtensionsRequired:()=>GD,addExtensionsUsed:()=>tf,addPipelineExtras:()=>Ig,addToArray:()=>as,appendForwardSlash:()=>uv,arrayRemoveDuplicates:()=>Co,barycentricCoordinates:()=>z0,binarySearch:()=>Do,buildDrawCommand:()=>UP,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>z2,clone:()=>Ye,combine:()=>_t,computeFlyToLocationForRectangle:()=>wC,createBillboardPointCallback:()=>Gx,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>EB,createDefaultTerrainProviderViewModels:()=>SB,createElevationBandMaterial:()=>TX,createGooglePhotorealistic3DTileset:()=>AX,createGuid:()=>Wn,createMaterialPropertyDescriptor:()=>Po,createOsmBuildings:()=>EX,createOsmBuildingsAsync:()=>SX,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>ll,createTangentSpaceDebugPrimitive:()=>vX,createTaskProcessorWorker:()=>hK,createUniform:()=>rw,createUniformArray:()=>sw,createWorldImagery:()=>wX,createWorldImageryAsync:()=>N_,createWorldTerrain:()=>Mj,createWorldTerrainAsync:()=>Wb,decodeGoogleEarthEnterpriseData:()=>XL,decodeVectorPolylinePositions:()=>wR,defaultValue:()=>y,defer:()=>Ys,defined:()=>l,demodernizeShader:()=>z1,deprecationWarning:()=>Q,destroyObject:()=>ue,exportKml:()=>S7,findAccessorMinMax:()=>Ex,findContentMetadata:()=>Kx,findGroupMetadata:()=>Jx,findTileMetadata:()=>OR,forEachTextureInMaterial:()=>BT,formatError:()=>bh,freezeRenderState:()=>y8,getAbsoluteUri:()=>Kh,getAccessorByteStride:()=>pl,getBaseUri:()=>fv,getBinaryAccessor:()=>Zl,getClipAndStyleCode:()=>eB,getClippingFunction:()=>M_,getComponentReader:()=>Ip,getElement:()=>On,getExtensionFromUri:()=>E0,getFilenameFromUri:()=>d_,getImageFromTypedArray:()=>QL,getImagePixels:()=>id,getJsonFromTypedArray:()=>Oo,getMagic:()=>_d,getStringFromTypedArray:()=>dl,getTimestamp:()=>yi,hasExtension:()=>ni,heightReferenceOnEntityPropertyChanged:()=>hp,isBitSet:()=>fc,isBlobUri:()=>S0,isCrossOriginUrl:()=>v0,isDataUri:()=>Jh,isLeapYear:()=>Xh,knockout:()=>Ce,knockout_3_5_1:()=>UC,knockout_es5:()=>gB,loadAndExecuteScript:()=>w0,loadCubeMap:()=>xN,loadImageFromTypedArray:()=>Cx,loadKTX2:()=>sl,mergeSort:()=>P_,moveTechniqueRenderStates:()=>HD,moveTechniquesToExtension:()=>WD,numberOfComponentsForType:()=>Ql,objectToQuery:()=>I0,oneTimeWarning:()=>Nt,parseBatchTable:()=>Lp,parseBoundingVolumeSemantics:()=>iP,parseFeatureMetadataLegacy:()=>fP,parseGlb:()=>VD,parseResponseHeaders:()=>dv,parseStructuralMetadata:()=>uP,pointInsideTriangle:()=>fq,preprocess3DTileContent:()=>eh,processVoxelProperties:()=>V2,queryToObject:()=>jl,readAccessorPacked:()=>YD,removeExtension:()=>Sx,removeExtensionsRequired:()=>UD,removeExtensionsUsed:()=>Ax,removePipelineExtras:()=>zD,removeUnusedElements:()=>jD,resizeImageToNextPowerOfTwo:()=>Og,sampleTerrain:()=>rL,sampleTerrainMostDetailed:()=>T_,scaleToGeodeticSurface:()=>T0,subdivideArray:()=>G1,subscribeAndEvaluate:()=>da,updateAccessorComponentTypes:()=>XD,updateVersion:()=>KD,usesExtension:()=>or,viewerCesium3DTilesInspectorMixin:()=>LK,viewerCesiumInspectorMixin:()=>NK,viewerDragDropMixin:()=>BK,viewerPerformanceWatchdogMixin:()=>kK,viewerVoxelInspectorMixin:()=>UK,webGLConstantToGlslType:()=>Dq,wrapFunction:()=>fN,writeTextToCanvas:()=>jx});var YC={},Jbe={addCache:function(e,t){return YC[e]=t,t},removeCache:function(e){delete YC[e]},getCache:function(e){return YC[e]},getCacheOrAdd:function(e){return YC[e]||(YC[e]={}),YC[e]}},Hh=Jbe;function tJ(e,t){return e??t}tJ.EMPTY_OBJECT=Object.freeze({});var y=tJ;function Zbe(e){return e!=null}var l=Zbe;function b0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(b0.prototype=Object.create(Error.prototype),b0.prototype.constructor=b0);b0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};b0.throwInstantiationError=function(){throw new b0("This function defines an interface and should not be called directly.")};var fe=b0;var ss={};ss.typeOf={};function $be(e){return`${e} is required, actual value was undefined`}function XC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ss.defined=function(e,t){if(!l(t))throw new fe($be(e))};ss.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(XC(typeof t,"function",e))};ss.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(XC(typeof t,"string",e))};ss.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(XC(typeof t,"number",e))};ss.typeOf.number.lessThan=function(e,t,n){if(ss.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ss.typeOf.number.lessThanOrEquals=function(e,t,n){if(ss.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ss.typeOf.number.greaterThan=function(e,t,n){if(ss.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ss.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ss.typeOf.number(e,t),t0){for(o.sort(Qbe),e=0;e0&&(this._hash={},e.length=0)};var At=C0;var sG=Io(p3(),1);var lt={};lt.EPSILON1=.1;lt.EPSILON2=.01;lt.EPSILON3=.001;lt.EPSILON4=1e-4;lt.EPSILON5=1e-5;lt.EPSILON6=1e-6;lt.EPSILON7=1e-7;lt.EPSILON8=1e-8;lt.EPSILON9=1e-9;lt.EPSILON10=1e-10;lt.EPSILON11=1e-11;lt.EPSILON12=1e-12;lt.EPSILON13=1e-13;lt.EPSILON14=1e-14;lt.EPSILON15=1e-15;lt.EPSILON16=1e-16;lt.EPSILON17=1e-17;lt.EPSILON18=1e-18;lt.EPSILON19=1e-19;lt.EPSILON20=1e-20;lt.EPSILON21=1e-21;lt.GRAVITATIONALPARAMETER=3986004418e5;lt.SOLAR_RADIUS=6955e5;lt.LUNAR_RADIUS=1737400;lt.SIXTY_FOUR_KILOBYTES=64*1024;lt.FOUR_GIGABYTES=4*1024*1024*1024;lt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});lt.signNotZero=function(e){return e<0?-1:1};lt.toSNorm=function(e,t){return t=y(t,255),Math.round((lt.clamp(e,-1,1)*.5+.5)*t)};lt.fromSNorm=function(e,t){return t=y(t,255),lt.clamp(e,0,t)/t*2-1};lt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:lt.clamp((e-t)/n,0,1)};lt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});lt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});lt.lerp=function(e,t,n){return(1-n)*e+n*t};lt.PI=Math.PI;lt.ONE_OVER_PI=1/Math.PI;lt.PI_OVER_TWO=Math.PI/2;lt.PI_OVER_THREE=Math.PI/3;lt.PI_OVER_FOUR=Math.PI/4;lt.PI_OVER_SIX=Math.PI/6;lt.THREE_PI_OVER_TWO=3*Math.PI/2;lt.TWO_PI=2*Math.PI;lt.ONE_OVER_TWO_PI=1/(2*Math.PI);lt.RADIANS_PER_DEGREE=Math.PI/180;lt.DEGREES_PER_RADIAN=180/Math.PI;lt.RADIANS_PER_ARCSECOND=lt.RADIANS_PER_DEGREE/3600;lt.toRadians=function(e){return e*lt.RADIANS_PER_DEGREE};lt.toDegrees=function(e){return e*lt.DEGREES_PER_RADIAN};lt.convertLongitudeRange=function(e){let t=lt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};lt.clampToLatitudeRange=function(e){return lt.clamp(e,-1*lt.PI_OVER_TWO,lt.PI_OVER_TWO)};lt.negativePiToPi=function(e){return e>=-lt.PI&&e<=lt.PI?e:lt.zeroToTwoPi(e+lt.PI)-lt.PI};lt.zeroToTwoPi=function(e){if(e>=0&&e<=lt.TWO_PI)return e;let t=lt.mod(e,lt.TWO_PI);return Math.abs(t)lt.EPSILON14?lt.TWO_PI:t};lt.mod=function(e,t){return lt.sign(e)===lt.sign(t)&&Math.abs(e)n};lt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var _3=[1];lt.factorial=function(e){let t=_3.length;if(e>=t){let n=_3[t-1];for(let i=t;i<=e;i++){let o=n*i;_3.push(o),n=o}}return _3[e]};lt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};lt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};lt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};lt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};lt.clamp=function(e,t,n){return en?n:e};var iJ=new sG.default;lt.setRandomNumberSeed=function(e){iJ=new sG.default(e)};lt.nextRandomNumber=function(){return iJ.random()};lt.randomBetween=function(e,t){return lt.nextRandomNumber()*(t-e)+e};lt.acosClamped=function(e){return Math.acos(lt.clamp(e,-1,1))};lt.asinClamped=function(e){return Math.asin(lt.clamp(e,-1,1))};lt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};lt.logBase=function(e,t){return Math.log(e)/Math.log(t)};lt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});lt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});lt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};lt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};lt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=lt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?lt.PI_OVER_TWO-i:i,i=e<0?lt.PI-i:i,i=t<0?-i:i,i};var P=lt;function Ot(e,t){this.x=y(e,0),this.y=y(t,0)}Ot.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ot(e,t)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ot(e.x,e.y)};Ot.fromCartesian3=Ot.clone;Ot.fromCartesian4=Ot.clone;Ot.packedLength=2;Ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ot),n.x=e[t++],n.y=e[t],n};Ot.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oP.EPSILON12);return l(o)?(o.x=r*N,o.y=s*F,o.z=a*_,o):new m(r*N,s*F,a*_)}var T0=cCe;function Yr(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Yr.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Yr(e,t,n)};Yr.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Yr.fromRadians(e,t,n,i)};var lCe=new m,uCe=new m,fCe=new m,dCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),mCe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),hCe=P.EPSILON1;Yr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:dCe,o=l(t)?t.oneOverRadiiSquared:mCe,r=l(t)?t._centerToleranceSquared:hCe,s=T0(e,i,o,r,uCe);if(!l(s))return;let a=m.multiplyComponents(s,o,lCe);a=m.normalize(a,a);let c=m.subtract(e,s,fCe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Yr(u,f,d)};Yr.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Yr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Yr(e.longitude,e.latitude,e.height)};Yr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Yr.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Yr.ZERO=Object.freeze(new Yr(0,0,0));Yr.prototype.clone=function(e){return Yr.clone(this,e)};Yr.prototype.equals=function(e){return Yr.equals(this,e)};Yr.prototype.equalsEpsilon=function(e,t){return Yr.equalsEpsilon(this,e,t)};Yr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=Yr;function lJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Qi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,lJ(this,e,t,n)}Object.defineProperties(Qi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Qi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Qi(n.x,n.y,n.z)};Qi.fromCartesian3=function(e,t){return l(t)||(t=new Qi),l(e)&&lJ(t,e.x,e.y,e.z),t};Qi.WGS84=Object.freeze(new Qi(6378137,6378137,6356752314245179e-9));Qi.UNIT_SPHERE=Object.freeze(new Qi(1,1,1));Qi.MOON=Object.freeze(new Qi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Qi.prototype.clone=function(e){return Qi.clone(this,e)};Qi.packedLength=m.packedLength;Qi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};Qi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return Qi.fromCartesian3(i,n)};Qi.prototype.geocentricSurfaceNormal=m.normalize;Qi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};Qi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var pCe=new m,_Ce=new m;Qi.prototype.cartographicToCartesian=function(e,t){let n=pCe,i=_Ce;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};Qi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var bCe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],CCe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function cJ(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*bCe[s];r+=CCe[s]*(n(i+a)+n(i-a))}return r*=o,r}Qi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Vn(n,s,i,a)};Vn.fromCartesianArray=function(e,t,n){t=y(t,oe.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u=0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Vn(i,a,o,c)};Vn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Vn(e.west,e.south,e.east,e.north)};Vn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Vn.prototype.clone=function(e){return Vn.clone(this,e)};Vn.prototype.equals=function(e){return Vn.equals(this,e)};Vn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Vn.prototype.equalsEpsilon=function(e,t){return Vn.equalsEpsilon(this,e,t)};Vn.validate=function(e){};Vn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};Vn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};Vn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};Vn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};Vn.center=function(e,t){let n=e.east,i=e.west;n0?i+=P.TWO_PI:r0&&(r+=P.TWO_PI),i=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new Vn(a,u,c,f)};Vn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new Vn(i,o,r,s)};Vn.union=function(e,t,n){l(n)||(n=new Vn);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=P.TWO_PI:r0&&(r+=P.TWO_PI),io||P.equalsEpsilon(n,o,P.EPSILON14))&&(n=e.south&&i<=e.north};var ACe=new me;Vn.subsample=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=ACe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,Vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Vn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Vn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};Vn.MAX_VALUE=Object.freeze(new Vn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ce=Vn;function Cr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Cr.packedLength=4;Cr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Cr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Cr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Cr.fromPoints=function(e,t){if(l(t)||(t=new Cr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;an.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Cr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?tn.OUTSIDE:tn.INTERSECTING};Cr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Cr.prototype.clone=function(e){return Cr.clone(this,e)};Cr.prototype.intersect=function(e){return Cr.intersect(this,e)};Cr.prototype.equals=function(e){return Cr.equals(this,e)};var Ke=Cr;var $_,Tr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},il={};Object.defineProperties(il,{element:{get:function(){if(il.supportsFullscreen())return document[Tr.fullscreenElement]}},changeEventName:{get:function(){if(il.supportsFullscreen())return Tr.fullscreenchange}},errorEventName:{get:function(){if(il.supportsFullscreen())return Tr.fullscreenerror}},enabled:{get:function(){if(il.supportsFullscreen())return document[Tr.fullscreenEnabled]}},fullscreen:{get:function(){if(il.supportsFullscreen())return il.element!==null}}});il.supportsFullscreen=function(){if(l($_))return $_;$_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Tr.requestFullscreen="requestFullscreen",Tr.exitFullscreen="exitFullscreen",Tr.fullscreenEnabled="fullscreenEnabled",Tr.fullscreenElement="fullscreenElement",Tr.fullscreenchange="fullscreenchange",Tr.fullscreenerror="fullscreenerror",$_=!0,$_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){xc._result=t.width>0&&t.height>0,e(xc._result)},t.onerror=function(){xc._result=!1,e(xc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),xc._promise};Object.defineProperties(xc,{initialized:{get:function(){return l(xc._result)}}});var JC=[];typeof ArrayBuffer<"u"&&(JC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&JC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&JC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&JC.push(BigInt64Array),typeof BigUint64Array<"u"&&JC.push(BigUint64Array));var ed={isChrome:mG,chromeVersion:wCe,isSafari:dJ,safariVersion:ICe,isWebkit:mJ,webkitVersion:DCe,isInternetExplorer:hJ,internetExplorerVersion:PCe,isEdge:w3,edgeVersion:OCe,isFirefox:hG,firefoxVersion:LCe,isWindows:RCe,isIPadOrIOS:MCe,hardwareConcurrency:y(Fa.hardwareConcurrency,3),supportsPointerEvents:NCe,supportsImageRenderingPixelated:yJ,supportsWebP:xc,imageRenderingValue:FCe,typedArrayTypes:JC};ed.supportsBasis=function(e){return ed.supportsWebAssembly()&&e.context.supportsBasis};ed.supportsFullscreen=function(){return mr.supportsFullscreen()};ed.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ed.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ed.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ed.supportsBigInt=function(){return typeof BigInt<"u"};ed.supportsWebWorkers=function(){return typeof Worker<"u"};ed.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ed.supportsWebgl2=function(e){return e.context.webgl2};var Wt=ed;function pG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var _G,gG,Wh;Wt.supportsTypedArrays()&&(_G=new ArrayBuffer(4),gG=new Uint32Array(_G),Wh=new Uint8Array(_G));ie.fromRgba=function(e,t){return gG[0]=e,ie.fromBytes(Wh[0],Wh[1],Wh[2],Wh[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=pG(u,c,e+1/3),s=pG(u,c,e),a=pG(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var BCe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,kCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,UCe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,VCe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=BCe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=kCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=UCe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=VCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return Wh[0]=ie.floatToByte(this.red),Wh[1]=ie.floatToByte(this.green),Wh[2]=ie.floatToByte(this.blue),Wh[3]=ie.floatToByte(this.alpha),gG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function zCe(){return!0}function HCe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=zCe}var ue=HCe;function Gl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Gl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Gl.packedLength=2;Gl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Gl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Gl),n.near=e[t++],n.far=e[t],n};Gl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Gl.clone=function(e,t){if(l(e))return l(t)||(t=new Gl),t.near=e.near,t.far=e.far,t};Gl.prototype.clone=function(e){return Gl.clone(this,e)};Gl.prototype.equals=function(e){return Gl.equals(this,e)};var Dt=Gl;function Wu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Wu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Wu(e.near,e.nearValue,e.far,e.farValue)};Wu.packedLength=4;Wu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Wu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Wu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Wu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Wu.prototype.clone=function(e){return Wu.clone(this,e)};Wu.prototype.equals=function(e){return Wu.equals(this,e)};var Rt=Wu;var GCe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qe=Object.freeze(GCe);var WCe={CENTER:0,LEFT:1,RIGHT:-1},pi=Object.freeze(WCe);var jCe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Mn=Object.freeze(jCe);var qCe={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(qCe);function td(){fe.throwInstantiationError()}Object.defineProperties(td.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});td.prototype.getValue=fe.throwInstantiationError;td.prototype.equals=fe.throwInstantiationError;td.equals=function(e,t){return e===t||l(e)&&e.equals(t)};td.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new xJ(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new xJ(r)):(yG(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],yG(s.get(r.id),r,a),s.remove(r.id)};function yG(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var rv=Q_;function dTe(e,t){this.start=y(e,0),this.stop=y(t,0)}var bc=dTe;function tt(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}tt.packedLength=9;tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};tt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oi&&(o=u,i=f)}let r=1,s=0,a=bG[o],c=CG[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var I3=new tt,CJ=new tt;tt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*gTe(a);for(;rc;)xTe(a,I3),tt.transpose(I3,CJ),tt.multiply(a,I3,a),tt.multiply(CJ,a,a),tt.multiply(s,I3,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var bTe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,bTe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var Z=tt;function QS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(QS.prototype=Object.create(Error.prototype),QS.prototype.constructor=QS);QS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var de=QS;function $e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){this[0]=y(e,0),this[1]=y(r,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(o,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(A,0)}$e.packedLength=16;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ys.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ys.fromTypedArray=function(e){if(e instanceof Uint8Array)return ys.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ys.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ys.UNSIGNED_INT};var Ue=Object.freeze(ys);var _3={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===_3.STREAM_DRAW||e===_3.STATIC_DRAW||e===_3.DYNAMIC_DRAW}},Fe=Object.freeze(_3);function Wu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Wn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Wu.createVertexBuffer=function(e){return new Wu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Wu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),r=new Wu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Wu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Wu.prototype._getBuffer=function(){return this._buffer};Wu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Wu.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Wu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Wu.prototype.isDestroyed=function(){return!1};Wu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var mt=Wu;var X_,xo={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},tl={};Object.defineProperties(tl,{element:{get:function(){if(tl.supportsFullscreen())return document[xo.fullscreenElement]}},changeEventName:{get:function(){if(tl.supportsFullscreen())return xo.fullscreenchange}},errorEventName:{get:function(){if(tl.supportsFullscreen())return xo.fullscreenerror}},enabled:{get:function(){if(tl.supportsFullscreen())return document[xo.fullscreenEnabled]}},fullscreen:{get:function(){if(tl.supportsFullscreen())return tl.element!==null}}});tl.supportsFullscreen=function(){if(l(X_))return X_;X_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return xo.requestFullscreen="requestFullscreen",xo.exitFullscreen="exitFullscreen",xo.fullscreenEnabled="fullscreenEnabled",xo.fullscreenElement="fullscreenElement",xo.fullscreenchange="fullscreenchange",xo.fullscreenerror="fullscreenerror",X_=!0,X_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i{let t=new Image;t.onload=function(){xc._result=t.width>0&&t.height>0,e(xc._result)},t.onerror=function(){xc._result=!1,e(xc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),xc._promise};Object.defineProperties(xc,{initialized:{get:function(){return l(xc._result)}}});var KC=[];typeof ArrayBuffer<"u"&&(KC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&KC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&KC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&KC.push(BigInt64Array),typeof BigUint64Array<"u"&&KC.push(BigUint64Array));var ed={isChrome:aG,chromeVersion:fCe,isSafari:iJ,safariVersion:dCe,isWebkit:rJ,webkitVersion:mCe,isInternetExplorer:oJ,internetExplorerVersion:hCe,isEdge:E3,edgeVersion:pCe,isFirefox:cG,firefoxVersion:yCe,isWindows:_Ce,isIPadOrIOS:gCe,hardwareConcurrency:y(Na.hardwareConcurrency,3),supportsPointerEvents:ACe,supportsImageRenderingPixelated:lJ,supportsWebP:xc,imageRenderingValue:xCe,typedArrayTypes:KC};ed.supportsBasis=function(e){return ed.supportsWebAssembly()&&e.context.supportsBasis};ed.supportsFullscreen=function(){return uo.supportsFullscreen()};ed.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ed.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ed.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ed.supportsBigInt=function(){return typeof BigInt<"u"};ed.supportsWebWorkers=function(){return typeof Worker<"u"};ed.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ed.supportsWebgl2=function(e){return e.context.webgl2};var Wt=ed;function lG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,r){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var uG,fG,jh;Wt.supportsTypedArrays()&&(uG=new ArrayBuffer(4),fG=new Uint32Array(uG),jh=new Uint8Array(uG));ie.fromRgba=function(e,t){return fG[0]=e,ie.fromBytes(jh[0],jh[1],jh[2],jh[3],t)};ie.fromHsl=function(e,t,n,i,r){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let o=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;o=lG(u,c,e+1/3),s=lG(u,c,e),a=lG(u,c,e-1/3)}return l(r)?(r.red=o,r.green=s,r.blue=a,r.alpha=i,r):new ie(o,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let r=e.blue;if(!l(r)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);r=s+P.nextRandomNumber()*(a-s)}let o=e.alpha;if(!l(o)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);o=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new ie(n,i,r,o)};var CCe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,TCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,ECe=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,bCe=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.replace(/\s/g,"");let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=CCe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=TCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=ECe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=bCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),r=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]};ie.prototype.toRgba=function(){return jh[0]=ie.floatToByte(this.red),jh[1]=ie.floatToByte(this.green),jh[2]=ie.floatToByte(this.blue),jh[3]=ie.floatToByte(this.alpha),fG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function b3(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}b3.ALL=Object.freeze(new b3({color:new z(0,0,0,0),depth:1,stencil:0}));b3.prototype.execute=function(e,t){e.clear(this,t)};var ri=b3;var SCe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Se=Object.freeze(SCe);function uJ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Se.COMPUTE,this.owner=e.owner}uJ.prototype.execute=function(e){e.execute(this)};var ju=uJ;function Ot(e,t){this.x=y(e,0),this.y=y(t,0)}Ot.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ot(e,t)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ot(e.x,e.y)};Ot.fromCartesian3=Ot.clone;Ot.fromCartesian4=Ot.clone;Ot.packedLength=2;Ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ot),n.x=e[t++],n.y=e[t],n};Ot.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;rP.EPSILON12);return l(r)?(r.x=o*L,r.y=s*N,r.z=a*_,r):new m(o*L,s*N,a*_)}var x0=ICe;function qo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}qo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new qo(e,t,n)};qo.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),qo.fromRadians(e,t,n,i)};var PCe=new m,OCe=new m,RCe=new m,MCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),BCe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),LCe=P.EPSILON1;qo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:MCe,r=l(t)?t.oneOverRadiiSquared:BCe,o=l(t)?t._centerToleranceSquared:LCe,s=x0(e,i,r,o,OCe);if(!l(s))return;let a=m.multiplyComponents(s,r,PCe);a=m.normalize(a,a);let c=m.subtract(e,s,RCe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new qo(u,f,d)};qo.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};qo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new qo(e.longitude,e.latitude,e.height)};qo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};qo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};qo.ZERO=Object.freeze(new qo(0,0,0));qo.prototype.clone=function(e){return qo.clone(this,e)};qo.prototype.equals=function(e){return qo.equals(this,e)};qo.prototype.equalsEpsilon=function(e,t){return qo.equalsEpsilon(this,e,t)};qo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=qo;function pJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ji(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,pJ(this,e,t,n)}Object.defineProperties(Ji.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Ji.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ji(n.x,n.y,n.z)};Ji.fromCartesian3=function(e,t){return l(t)||(t=new Ji),l(e)&&pJ(t,e.x,e.y,e.z),t};Ji.WGS84=Object.freeze(new Ji(6378137,6378137,6356752314245179e-9));Ji.UNIT_SPHERE=Object.freeze(new Ji(1,1,1));Ji.MOON=Object.freeze(new Ji(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Ji.prototype.clone=function(e){return Ji.clone(this,e)};Ji.packedLength=m.packedLength;Ji.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};Ji.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return Ji.fromCartesian3(i,n)};Ji.prototype.geocentricSurfaceNormal=m.normalize;Ji.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),s=r*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=o,t.y=s,t.z=a,m.normalize(t,t)};Ji.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var NCe=new m,FCe=new m;Ji.prototype.cartographicToCartesian=function(e,t){let n=NCe,i=FCe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let r=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,r,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};Ji.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var zCe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],HCe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function hJ(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*zCe[s];o+=HCe[s]*(n(i+a)+n(i-a))}return o*=r,o}Ji.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,r=e.north;for(;n=0?f.longitude:f.longitude+P.TWO_PI;r=Math.min(r,d),o=Math.max(o,d)}return i-n>o-r&&(n=r,i=o,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new kn(n,s,i,a)};kn.fromCartesianArray=function(e,t,n){t=y(t,re.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new kn(i,a,r,c)};kn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new kn(e.west,e.south,e.east,e.north)};kn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};kn.prototype.clone=function(e){return kn.clone(this,e)};kn.prototype.equals=function(e){return kn.equals(this,e)};kn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};kn.prototype.equalsEpsilon=function(e,t){return kn.equalsEpsilon(this,e,t)};kn.validate=function(e){};kn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};kn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};kn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};kn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};kn.center=function(e,t){let n=e.east,i=e.west;n0?i+=P.TWO_PI:o0&&(o+=P.TWO_PI),i=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new kn(a,u,c,f)};kn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(r>=s||i>=o))return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new kn(i,r,o,s)};kn.union=function(e,t,n){l(n)||(n=new kn);let i=e.east,r=e.west,o=t.east,s=t.west;i0?i+=P.TWO_PI:o0&&(o+=P.TWO_PI),ir||P.equalsEpsilon(n,r,P.EPSILON14))&&(n=e.south&&i<=e.north};var WCe=new he;kn.subsample=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,0),l(i)||(i=[]);let r=0,o=e.north,s=e.south,a=e.east,c=e.west,u=WCe;u.height=n,u.longitude=c,u.latitude=o,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.latitude=s,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,o<0?u.latitude=o:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,kn.contains(e,u)&&(i[r]=t.cartographicToCartesian(u,i[r]),r++);return u.latitude===0&&(u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++),i.length=r,i};kn.subsection=function(e,t,n,i,r,o){if(l(o)||(o=new kn),e.west<=e.east){let a=e.east-e.west;o.west=e.west+t*a,o.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;o.west=P.negativePiToPi(e.west+t*a),o.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return o.south=e.south+n*s,o.north=e.south+r*s,t===1&&(o.west=e.east),i===1&&(o.east=e.east),n===1&&(o.south=e.north),r===1&&(o.north=e.north),o};kn.MAX_VALUE=Object.freeze(new kn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ce=kn;function Co(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Co.packedLength=4;Co.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Co.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Co),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Co.fromPoints=function(e,t){if(l(t)||(t=new Co),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;an.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Co.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.widtho+t.height?tn.OUTSIDE:tn.INTERSECTING};Co.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Co.prototype.clone=function(e){return Co.clone(this,e)};Co.prototype.intersect=function(e){return Co.intersect(this,e)};Co.prototype.equals=function(e){return Co.equals(this,e)};var Ke=Co;var pa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};pa.isLines=function(e){return e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP};pa.isTriangles=function(e){return e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};pa.validate=function(e){return e===pa.POINTS||e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP||e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};var Be=Object.freeze(pa);var C0=`in vec4 position; -in vec2 textureCoordinates; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var L=Qe;function gn(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var vG=new m,wG=new m,IG=new m,DG=new m,PG=new m,OG=new m,RG=new m,qs=new m,MG=new m,LG=new m,NG=new m,FG=new m,MTe=4/3*P.PI;gn.fromPoints=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],RG),i=m.clone(n,vG),o=m.clone(n,wG),r=m.clone(n,IG),s=m.clone(n,DG),a=m.clone(n,PG),c=m.clone(n,OG),u=e.length,f;for(f=1;fs.x&&m.clone(n,s),Na.y&&m.clone(n,a),Fc.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,qs)),p=m.magnitudeSquared(m.subtract(a,o,qs)),g=m.magnitudeSquared(m.subtract(c,r,qs)),h=i,x=s,b=d;p>b&&(b=p,h=o,x=a),g>b&&(b=g,h=r,x=c);let C=MG;C.x=(h.x+x.x)*.5,C.y=(h.y+x.y)*.5,C.z=(h.z+x.z)*.5;let T=m.magnitudeSquared(m.subtract(x,C,qs)),A=Math.sqrt(T),S=LG;S.x=i.x,S.y=o.y,S.z=r.z;let v=NG;v.x=s.x,v.y=a.y,v.z=c.z;let I=m.midpoint(S,v,FG),O=0;for(f=0;fO&&(O=R);let N=m.magnitudeSquared(m.subtract(n,C,qs));if(N>T){let F=Math.sqrt(N);A=(A+F)*.5,T=A*A;let _=F-A;C.x=(A*C.x+_*n.x)/F,C.y=(A*C.y+_*n.y)/F,C.z=(A*C.z+_*n.z)/F}}return Ac.x&&m.clone(o,c),_u.y&&m.clone(o,u),Ef.z&&m.clone(o,f)}let g=m.magnitudeSquared(m.subtract(c,r,qs)),h=m.magnitudeSquared(m.subtract(u,s,qs)),x=m.magnitudeSquared(m.subtract(f,a,qs)),b=r,C=c,T=g;h>T&&(T=h,b=s,C=u),x>T&&(T=x,b=a,C=f);let A=MG;A.x=(b.x+C.x)*.5,A.y=(b.y+C.y)*.5,A.z=(b.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,A,qs)),v=Math.sqrt(S),I=LG;I.x=r.x,I.y=s.y,I.z=a.z;let O=NG;O.x=c.x,O.y=u.y,O.z=f.z;let R=m.midpoint(I,O,FG),N=0;for(p=0;pN&&(N=F);let _=m.magnitudeSquared(m.subtract(o,A,qs));if(_>S){let E=Math.sqrt(_);v=(v+E)*.5,S=v*v;let w=E-v;A.x=(v*A.x+w*o.x)/E,A.y=(v*A.y+w*o.y)/E,A.z=(v*A.z+w*o.z)/E}}return va.x&&m.clone(i,a),Fc.y&&m.clone(i,c),_u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,o,qs)),g=m.magnitudeSquared(m.subtract(c,r,qs)),h=m.magnitudeSquared(m.subtract(u,s,qs)),x=o,b=a,C=p;g>C&&(C=g,x=r,b=c),h>C&&(C=h,x=s,b=u);let T=MG;T.x=(x.x+b.x)*.5,T.y=(x.y+b.y)*.5,T.z=(x.z+b.z)*.5;let A=m.magnitudeSquared(m.subtract(b,T,qs)),S=Math.sqrt(A),v=LG;v.x=o.x,v.y=r.y,v.z=s.z;let I=NG;I.x=a.x,I.y=c.y,I.z=u.z;let O=m.midpoint(v,I,FG),R=0;for(d=0;dR&&(R=N);let F=m.magnitudeSquared(m.subtract(i,T,qs));if(F>A){let _=Math.sqrt(F);S=(S+_)*.5,A=S*S;let E=_-S;T.x=(S*T.x+E*i.x)/_,T.y=(S*T.y+E*i.y)/_,T.z=(S*T.z+E*i.z)/_}}return S=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=m.multiplyByScalar(a,(-o+u)/c,jTe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var qTe=new m;gn.expand=function(e,t,n){n=gn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,qTe));return i>n.radius&&(n.radius=i),n};gn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?tn.OUTSIDE:r0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,o=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,r=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=aAe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(g,g)]-e[Z.getElementIndex(h,h)]+1);let x=cAe;x[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(h,g)]-e[Z.getElementIndex(g,h)])*n,x[g]=(e[Z.getElementIndex(g,p)]+e[Z.getElementIndex(p,g)])*n,x[h]=(e[Z.getElementIndex(h,p)]+e[Z.getElementIndex(p,h)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new it(i,o,r,s)};var DJ=new it,PJ=new it,BG=new it,OJ=new it;it.fromHeadingPitchRoll=function(e,t){return OJ=it.fromAxisAngle(m.UNIT_X,e.roll,DJ),BG=it.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=it.multiply(BG,OJ,BG),PJ=it.fromAxisAngle(m.UNIT_Z,-e.heading,DJ),it.multiply(PJ,t,t)};var P3=new m,kG=new m,nd=new it,RJ=new it,O3=new it;it.packedLength=4;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,O3),it.conjugate(O3,O3);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)jh[g]=(R3[g]*c-M3[g])*s,qh[g]=(R3[g]*u-M3[g])*s;let f=r*n*(1+jh[0]*(1+jh[1]*(1+jh[2]*(1+jh[3]*(1+jh[4]*(1+jh[5]*(1+jh[6]*(1+jh[7])))))))),d=a*(1+qh[0]*(1+qh[1]*(1+qh[2]*(1+qh[3]*(1+qh[4]*(1+qh[5]*(1+qh[6]*(1+qh[7])))))))),p=it.multiplyByScalar(e,d,fAe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,o,r){let s=it.fastSlerp(e,t,o,lv),a=it.fastSlerp(n,i,o,QC);return it.fastSlerp(s,a,2*o*(1-o),r)};it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Be=it;function dAe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Do=dAe;function mAe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var eg=mAe;function hAe(e,t,n,i,o,r,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a}var Yh=hAe;function pAe(e){return e%4===0&&e%100!==0||e%400===0}var Xh=pAe;function _Ae(e,t){this.julianDate=e,this.offset=t}var Vi=_Ae;var gAe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Zn=Object.freeze(gAe);var yAe={UTC:0,TAI:1},Jn=Object.freeze(yAe);var FJ=new Yh,HG=[31,28,31,30,31,30,31,31,30,31,30,31],GG=29;function WG(e,t){return vt.compare(e.julianDate,t.julianDate)}var eT=new Vi;function N3(e){eT.julianDate=e;let t=vt.leapSeconds,n=Do(t,eT,WG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function NJ(e,t){eT.julianDate=e;let n=vt.leapSeconds,i=Do(n,eT,WG);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let o=vt.secondsDifference(n[i].julianDate,e);if(o===0)return vt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return vt.addSeconds(e,-n[--i].offset,t)}function tg(e,t,n){let i=t/Zn.SECONDS_PER_DAY|0;return e+=i,t-=Zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function jG(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*Zn.SECONDS_PER_HOUR+o*Zn.SECONDS_PER_MINUTE+s*Zn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var xAe=/^(\d{4})$/,bAe=/^(\d{4})-(\d{2})$/,CAe=/^(\d{4})-?(\d{3})$/,TAe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,AAe=/^(\d{4})-?(\d{2})-?(\d{2})$/,qG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,EAe=/^(\d{2})(\.\d+)?/.source+qG.source,SAe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+qG.source,vAe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+qG.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Jn.UTC);let i=e|0;t=t+(e-i)*Zn.SECONDS_PER_DAY,tg(i,t,this),n===Jn.UTC&&N3(this)}vt.fromGregorianDate=function(e,t){let n=jG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(tg(n[0],n[1],t),N3(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromDate=function(e,t){let n=jG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(tg(n[0],n[1],t),N3(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(AAe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(bAe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(xAe),n!==null)i=+n[1];else{let C;if(n=f.match(CAe),n!==null)i=+n[1],C=+n[2],g=Xh(i);else if(n=f.match(TAe),n!==null){i=+n[1];let T=+n[2],A=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+A-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Xh(i);let h;if(l(d)){n=d.match(vAe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(SAe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(EAe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],A=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-A;break;case"-":s=s+T,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?GG:HG[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?GG:HG[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?GG:HG[o-1],r+=p;let b=jG(i,o,r,s,a,c,u);return l(t)?(tg(b[0],b[1],t),N3(t)):t=new vt(b[0],b[1],Jn.UTC),x&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var L3=new vt(0,0,Jn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=NJ(e,L3);l(i)||(vt.addSeconds(e,-1,L3),i=NJ(L3,L3),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=r/Zn.SECONDS_PER_HOUR|0,h=r-g*Zn.SECONDS_PER_HOUR,x=h/Zn.SECONDS_PER_MINUTE|0;h=h-x*Zn.SECONDS_PER_MINUTE;let b=h|0,C=(h-b)/Zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=b,t.millisecond=C,t.isLeapSecond=n,t):new Yh(p,d,f,g,x,b,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,FJ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,FJ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Jn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Zn.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Zn.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){eT.julianDate=e;let t=vt.leapSeconds,n=Do(t,eT,WG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return tg(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_MINUTE;return tg(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_HOUR;return tg(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return tg(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new Vi(new vt(2441317,43210,Jn.TAI),10),new Vi(new vt(2441499,43211,Jn.TAI),11),new Vi(new vt(2441683,43212,Jn.TAI),12),new Vi(new vt(2442048,43213,Jn.TAI),13),new Vi(new vt(2442413,43214,Jn.TAI),14),new Vi(new vt(2442778,43215,Jn.TAI),15),new Vi(new vt(2443144,43216,Jn.TAI),16),new Vi(new vt(2443509,43217,Jn.TAI),17),new Vi(new vt(2443874,43218,Jn.TAI),18),new Vi(new vt(2444239,43219,Jn.TAI),19),new Vi(new vt(2444786,43220,Jn.TAI),20),new Vi(new vt(2445151,43221,Jn.TAI),21),new Vi(new vt(2445516,43222,Jn.TAI),22),new Vi(new vt(2446247,43223,Jn.TAI),23),new Vi(new vt(2447161,43224,Jn.TAI),24),new Vi(new vt(2447892,43225,Jn.TAI),25),new Vi(new vt(2448257,43226,Jn.TAI),26),new Vi(new vt(2448804,43227,Jn.TAI),27),new Vi(new vt(2449169,43228,Jn.TAI),28),new Vi(new vt(2449534,43229,Jn.TAI),29),new Vi(new vt(2450083,43230,Jn.TAI),30),new Vi(new vt(2450630,43231,Jn.TAI),31),new Vi(new vt(2451179,43232,Jn.TAI),32),new Vi(new vt(2453736,43233,Jn.TAI),33),new Vi(new vt(2454832,43234,Jn.TAI),34),new Vi(new vt(2456109,43235,Jn.TAI),35),new Vi(new vt(2457204,43236,Jn.TAI),36),new Vi(new vt(2457754,43237,Jn.TAI),37)];var ee=vt;var nZ=Io(Wl(),1);function wAe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var uv=wAe;function GJ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=GJ(o,t)),n[i]=o}return n}var Ye=GJ;function WJ(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=WJ(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var _t=WJ;function IAe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Ys=IAe;var jJ=Io(Wl(),1);function YG(e,t){let n;return typeof document<"u"&&(n=document),YG._implementation(e,t,n)}YG._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new jJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Kh=YG;var qJ=Io(Wl(),1);function DAe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new qJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var fv=DAe;var YJ=Io(Wl(),1);function PAe(e){let t=new YJ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var E0=PAe;var XJ={};function OAe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=XJ[t];l(i)||(i={},XJ[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var id=OAe;var RAe=/^blob:/i;function MAe(e){return RAe.test(e)}var S0=MAe;var Em;function LAe(e){l(Em)||(Em=document.createElement("a")),Em.href=window.location.href;let t=Em.host,n=Em.protocol;return Em.href=e,Em.href=Em.href,n!==Em.protocol||t!==Em.host}var v0=LAe;var NAe=/^data:/i;function FAe(e){return NAe.test(e)}var Jh=FAe;function BAe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var w0=BAe;function kAe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var dv=HAe;function KJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=dv(this.responseHeaders))}KJ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sm=KJ;var V3=Io(Wl(),1);function D0(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(D0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e=0;--t)this.heapify(t)};D0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};D0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return XG(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var mv=D0;function GAe(e,t){return e.priority-t.priority}var to={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},iT=20,ka=new mv({comparator:GAe});ka.maximumLength=iT;ka.reserve(iT);var vm=[],Zh={},WAe=typeof document<"u"?new V3.default(document.location.href):new V3.default,z3=new pe;function qo(){}qo.maximumRequests=50;qo.maximumRequestsPerServer=6;qo.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18};qo.throttleRequests=!0;qo.debugShowStatistics=!1;qo.requestCompletedEvent=z3;Object.defineProperties(qo,{statistics:{get:function(){return to}},priorityHeapLength:{get:function(){return iT},set:function(e){if(ee;){let t=ka.pop();P0(t)}iT=e,ka.maximumLength=e,ka.reserve(e)}}});function JJ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}qo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(qo.requestsByServer[e],qo.maximumRequestsPerServer);return Zh[e]+t<=n};qo.heapHasOpenSlots=function(e){return ka.length+e<=iT};function ZJ(e){return e.state===ti.UNISSUED&&(e.state=ti.ISSUED,e.deferred=Ys()),e.deferred.promise}function jAe(e){return function(t){if(e.state===ti.CANCELLED)return;let n=e.deferred;--to.numberOfActiveRequests,--Zh[e.serverKey],z3.raiseEvent(),e.state=ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function qAe(e){return function(t){e.state!==ti.CANCELLED&&(++to.numberOfFailedRequests,--to.numberOfActiveRequests,--Zh[e.serverKey],z3.raiseEvent(t),e.state=ti.FAILED,e.deferred.reject(t))}}function $J(e){let t=ZJ(e);return e.state=ti.ACTIVE,vm.push(e),++to.numberOfActiveRequests,++to.numberOfActiveRequestsEver,++Zh[e.serverKey],e.requestFunction().then(jAe(e)).catch(qAe(e)),t}function P0(e){let t=e.state===ti.ACTIVE;if(e.state=ti.CANCELLED,++to.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--to.numberOfActiveRequests,--Zh[e.serverKey],++to.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}qo.update=function(){let e,t,n=0,i=vm.length;for(e=0;e0&&(vm[e-n]=t)}vm.length-=n;let o=ka.internalArray,r=ka.length;for(e=0;e0;){if(t=ka.pop(),t.cancelled){P0(t);continue}if(t.throttleByServer&&!qo.serverHasOpenSlots(t.serverKey)){P0(t);continue}$J(t),++a}YAe()};qo.getServerKey=function(e){let t=new V3.default(e);t.scheme()===""&&(t=t.absoluteTo(WAe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Zh[n];return l(i)||(Zh[n]=0),n};qo.request=function(e){if(Jh(e.url)||S0(e.url))return z3.raiseEvent(),e.state=ti.RECEIVED,e.requestFunction();if(++to.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=qo.getServerKey(e.url)),qo.throttleRequests&&e.throttleByServer&&!qo.serverHasOpenSlots(e.serverKey))return;if(!qo.throttleRequests||!e.throttle)return $J(e);if(vm.length>=qo.maximumRequests)return;JJ(e);let t=ka.insert(e);if(l(t)){if(t===e)return;P0(t)}return ZJ(e)};function YAe(){qo.debugShowStatistics&&(to.numberOfActiveRequests===0&&to.lastNumberOfActiveRequests>0&&(to.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${to.numberOfAttemptedRequests}`),to.numberOfAttemptedRequests=0),to.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${to.numberOfCancelledRequests}`),to.numberOfCancelledRequests=0),to.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${to.numberOfCancelledActiveRequests}`),to.numberOfCancelledActiveRequests=0),to.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${to.numberOfFailedRequests}`),to.numberOfFailedRequests=0)),to.lastNumberOfActiveRequests=to.numberOfActiveRequests)}qo.clearForSpecs=function(){for(;ka.length>0;){let t=ka.pop();P0(t)}let e=vm.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});St.prototype.toString=function(){return this.getUrlComponent(!0,!0)};St.prototype.parseUrl=function(e,t,n,i){let o=new nZ.default(e),r=KAe(o.query());this._queryParameters=t?G3(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Kh(i))),this._url=o.toString()};function KAe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:jl(e)}function G3(e,t,n){if(!n)return _t(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}St.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${JAe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function JAe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${I0(e)}`}St.prototype.setQueryParameters=function(e,t){t?this._queryParameters=G3(this._queryParameters,e,!1):this._queryParameters=G3(e,this._queryParameters,!1)};St.prototype.appendQueryParameters=function(e){this._queryParameters=G3(e,this._queryParameters,!0)};St.prototype.setTemplateValues=function(e,t){t?this._templateValues=_t(this._templateValues,e):this._templateValues=_t(e,this._templateValues)};St.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=_t(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=_t(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=_t(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};St.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};St.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new St({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};St.prototype.getBaseUri=function(e){return fv(this.getUrlComponent(e),e)};St.prototype.appendForwardSlash=function(){this._url=uv(this._url)};St.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};St.fetchArrayBuffer=function(e){return new St(e).fetchArrayBuffer()};St.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};St.fetchBlob=function(e){return new St(e).fetchBlob()};St.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(JG(this.request),!iZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return KG({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return St.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return St.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new St({url:d}),KG({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function KG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Ys();return St._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Ua.request(r);if(l(s))return s.catch(function(a){return r.state!==ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=ti.UNISSUED,r.deferred=void 0,KG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}St.fetchImage=function(e){return new St(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};St.prototype.fetchText=function(){return this.fetch({responseType:"text"})};St.fetchText=function(e){return new St(e).fetchText()};St.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};St.fetchJson=function(e){return new St(e).fetchJson()};St.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};St.fetchXML=function(e){return new St(e).fetchXML()};St.prototype.fetchJsonp=function(e){e=y(e,"callback"),JG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return oZ(this,e,t)};function oZ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Ys();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},St._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Ua.request(o);if(l(s))return s.catch(function(a){return o.state!==ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=ti.UNISSUED,o.deferred=void 0,oZ(e,t,n)):Promise.reject(a)})})}St.fetchJsonp=function(e){return new St(e).fetchJsonp(e.callbackParameterName)};St.prototype._makeRequest=function(e){let t=this;JG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=_t(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Ys(),d=St._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=Ua.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ti.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function JG(e){if(e.state===ti.ISSUED||e.state===ti.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ti.UNISSUED,e.deferred=void 0}var ZAe=/^data:(.*?)(;base64)?,(.*)$/;function H3(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function eZ(e,t){let n=H3(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r(a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:o};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){r.reject(new Sm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,x){h?r.reject(new de("Error decompressing response.")):r.resolve(tZ(x,t))}):r.resolve(tZ(g,t))})}).on("error",function(d){r.reject(new Sm)}).end()})}var eEe=typeof XMLHttpRequest>"u";St._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=ZAe.exec(e);if(a!==null){r.resolve($Ae(a,t));return}if(eEe){QAe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(rT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new Sm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(x){let b=x.split(": "),C=b.shift();h[C]=b.join(": ")}),r.resolve(h);return}if(c.status===204)r.resolve();else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new Sm)},c.send(i),c};St._Implementations.loadAndExecuteScript=function(e,t,n){return w0(e,t).catch(function(i){n.reject(i)})};St._DefaultImplementations={};St._DefaultImplementations.createImage=St._Implementations.createImage;St._DefaultImplementations.loadWithXhr=St._Implementations.loadWithXhr;St._DefaultImplementations.loadAndExecuteScript=St._Implementations.loadAndExecuteScript;St.DEFAULT=Object.freeze(new St({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Se=St;function _v(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?rZ(this,e.data):rZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_v.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new _v({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};_v.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new eg(0,0,0,0,0),t}});_v.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new eg(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,aZ(this,n,this._samples,e,o,r,t),t}let s=Do(n,e,ee.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return sZ(e,n,o,a,s),s;if(i.equals(u))return sZ(e,n,r,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=o*a,p=r*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],x=h-g;if(x>.5||x<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];b!==C&&(u.equals(i)?g=h:h-=C-b)}return s.xPoleWander=pv(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=pv(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=pv(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=pv(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=pv(f,g,h),s}var gv=_v;function Va(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Va.fromQuaternion=function(e,t){l(t)||(t=new Va);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};Va.fromDegrees=function(e,t,n,i){return l(i)||(i=new Va),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Va.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Va(e.heading,e.pitch,e.roll)};Va.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Va.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Va.prototype.clone=function(e){return Va.clone(this,e)};Va.prototype.equals=function(e){return Va.equals(this,e)};Va.prototype.equalsEpsilon=function(e,t,n){return Va.equalsEpsilon(this,e,t,n)};Va.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var za=Va;var cZ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function nEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(aT)||(aT=document.createElement("a")),aT.href=e,aT.href=aT.href,aT.href)}var O0;function uZ(){if(l(O0))return O0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(J_.toUrl)?e=Kh("..",R0("Core/buildModuleUrl.js")):e=nEe(),O0=new Se({url:lZ(e)}),O0.appendForwardSlash(),O0}function iEe(e){return lZ(J_.toUrl(`../${e}`))}function fZ(e){return uZ().getDerivedResource({url:e}).url}var W3;function R0(e){return l(W3)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(J_.toUrl)?W3=iEe:W3=fZ),W3(e)}R0._cesiumScriptRegex=cZ;R0._buildModuleUrlFromBaseUrl=fZ;R0._clearBaseResource=function(){O0=void 0};R0.setBaseUrl=function(e){O0=Se.DEFAULT.getDerivedResource({url:e})};R0.getCesiumBaseUrl=uZ;var nn=R0;function oEe(e,t,n){this.x=e,this.y=t,this.s=n}var M0=oEe;function QG(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Se.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var rEe=new ee(0,0,Jn.TAI);function ZG(e,t,n){let i=rEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}QG.prototype.preload=function(e,t,n,i){let o=ZG(this,e,t),r=ZG(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push($G(this,d));return Promise.all(f)};QG.prototype.computeXysRadians=function(e,t,n){let i=ZG(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||($G(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||($G(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new M0(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,x,b;for(x=0;x<=r;++x)d[x]=f-h[x];for(x=0;x<=r;++x){for(g[x]=1,b=0;b<=r;++b)b!==x&&(g[x]*=d[b]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*u[C++],n.y+=g[x]*u[C++],n.s+=g[x]*u[C]}return n};function $G(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Se({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u=43200?o=(r+.5)/Zn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Zn.DAYS_PER_JULIAN_CENTURY;let a=(_Ee+o*(gEe+o*(yEe+o*xEe)))*TEe%P.TWO_PI,c=CEe+bEe*(n-24515455e-1),u=(i+Zn.SECONDS_PER_DAY*.5)%Zn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};Xi.iau2006XysData=new yv;Xi.earthOrientationParameters=gv.NONE;var o8=32.184,AEe=2451545;Xi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+o8,i=e.stop.dayNumber,o=e.stop.secondsOfDay+o8;return Xi.iau2006XysData.preload(t,n,i,o)};Xi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=Xi.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var EEe=new M0(0,0,0),SEe=new eg(0,0,0,0,0,0),n8=new Z,i8=new Z;Xi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=Xi.earthOrientationParameters.compute(e,SEe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+o8,r=Xi.iau2006XysData.computeXysRadians(i,o,EEe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=n8;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-r.s,i8),d=Z.multiply(u,f,n8),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,x=g/Zn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(h+x);b=b%1*P.TWO_PI;let C=Z.fromRotationZ(b,i8),T=Z.multiply(d,C,n8),A=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),O=i-AEe+o/Zn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,N=Math.cos(R),F=Math.sin(R),_=i8;return _[0]=A*N,_[1]=A*F,_[2]=v,_[3]=-S*F+I*v*N,_[4]=S*N+I*v*F,_[5]=-I*A,_[6]=-I*F-S*v*N,_[7]=I*N-S*v*F,_[8]=S*A,Z.multiply(T,_,t)};var vEe=new re;Xi.pointToWindowCoordinates=function(e,t,n,i){return i=Xi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Xi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let o=vEe;return L.multiplyByVector(e,re.fromElements(n.x,n.y,n.z,1,o),o),re.multiplyByScalar(o,1/o.w,o),L.multiplyByVector(t,o,o),H.fromCartesian4(o,i)};var wEe=new m,IEe=new m,DEe=new m;Xi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,oe.WGS84).geodeticSurfaceNormal(e,wEe),r=m.cross(t,o,IEe);m.equalsEpsilon(r,m.ZERO,P.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,DEe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new Z),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var mZ=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),hZ=new me,pZ=new m,PEe=new m,OEe=new Z,r8=new L,_Z=new L;Xi.basisTo2D=function(e,t,n){let i=L.getTranslation(t,PEe),o=e.ellipsoid,r=o.cartesianToCartographic(i,hZ),s=e.project(r,pZ);m.fromElements(s.z,s.x,s.y,s);let a=Xi.eastNorthUpToFixedFrame(i,o,r8),c=L.inverseTransformation(a,_Z),u=L.getMatrix3(t,OEe),f=L.multiplyByMatrix3(c,u,n);return L.multiply(mZ,f,n),L.setTranslation(n,s,n),n};Xi.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Xi.eastNorthUpToFixedFrame(t,i,r8),r=L.inverseTransformation(o,_Z),s=i.cartesianToCartographic(t,hZ),a=e.project(s,pZ);m.fromElements(a.z,a.x,a.y,a);let c=L.fromTranslation(a,r8);return L.multiply(mZ,r,n),L.multiply(c,n,n),n};var Mt=Xi;function s8(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Fe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,ju.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}s8.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var REe=new me,MEe=new m,gZ=new L,LEe=[new me,new me,new me],NEe=[new H,new H,new H],FEe=[new H,new H,new H],BEe=new m,kEe=new Be,UEe=new L,VEe=new eo;s8._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,REe),s=me.toCartesian(r,n,MEe),a=Mt.eastNorthUpToFixedFrame(s,n,gZ),c=L.inverse(a,gZ),u=NEe,f=LEe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=BEe;for(o=0;o<3;o++)me.toCartesian(f[o],n,d),d=L.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Be.fromAxisAngle(m.UNIT_Z,-t,kEe),g=Z.fromQuaternion(p,UEe),h=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o0&&console.log(`${vm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${vm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${vm}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${vm}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${vm}Vertex shader compile log: ${c}`),console.error(`${vm} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${vm}Fragment shader compile log: ${c}`),console.error(`${vm} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${vm}${g} shader translation failed.`);return}console.error(`${vm}Translated ${g} shaderSource: -${h}`)}}function uTe(e,t,n){let i={};for(let r=0;r=0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let A=0;A0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,r=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,o=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=CTe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(g,g)]-e[Z.getElementIndex(h,h)]+1);let A=TTe;A[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(h,g)]-e[Z.getElementIndex(g,h)])*n,A[g]=(e[Z.getElementIndex(g,p)]+e[Z.getElementIndex(p,g)])*n,A[h]=(e[Z.getElementIndex(h,p)]+e[Z.getElementIndex(p,h)])*n,i=-A[0],r=-A[1],o=-A[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new it(i,r,o,s)};var rZ=new it,oZ=new it,_G=new it,sZ=new it;it.fromHeadingPitchRoll=function(e,t){return sZ=it.fromAxisAngle(m.UNIT_X,e.roll,rZ),_G=it.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=it.multiply(_G,sZ,_G),oZ=it.fromAxisAngle(m.UNIT_Z,-e.heading,rZ),it.multiply(oZ,t,t)};var O3=new m,gG=new m,nd=new it,aZ=new it,R3=new it;it.packedLength=4;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,R3),it.conjugate(R3,R3);for(let r=0,o=n-t+1;r=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)qh[g]=(M3[g]*c-B3[g])*s,Xh[g]=(M3[g]*u-B3[g])*s;let f=o*n*(1+qh[0]*(1+qh[1]*(1+qh[2]*(1+qh[3]*(1+qh[4]*(1+qh[5]*(1+qh[6]*(1+qh[7])))))))),d=a*(1+Xh[0]*(1+Xh[1]*(1+Xh[2]*(1+Xh[3]*(1+Xh[4]*(1+Xh[5]*(1+Xh[6]*(1+Xh[7])))))))),p=it.multiplyByScalar(e,d,STe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,r,o){let s=it.fastSlerp(e,t,r,cv),a=it.fastSlerp(n,i,r,JC);return it.fastSlerp(s,a,2*r*(1-r),o)};it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=it;function vTe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var wr=vTe;function wTe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var J_=wTe;function DTe(e,t,n,i,r,o,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a}var Kh=DTe;function ITe(e){return e%4===0&&e%100!==0||e%400===0}var Jh=ITe;function PTe(e,t){this.julianDate=e,this.offset=t}var Vi=PTe;var OTe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Zn=Object.freeze(OTe);var RTe={UTC:0,TAI:1},Jn=Object.freeze(RTe);var fZ=new Kh,CG=[31,28,31,30,31,30,31,31,30,31,30,31],TG=29;function EG(e,t){return vt.compare(e.julianDate,t.julianDate)}var ZC=new Vi;function N3(e){ZC.julianDate=e;let t=vt.leapSeconds,n=wr(t,ZC,EG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function uZ(e,t){ZC.julianDate=e;let n=vt.leapSeconds,i=wr(n,ZC,EG);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let r=vt.secondsDifference(n[i].julianDate,e);if(r===0)return vt.addSeconds(e,-n[i].offset,t);if(!(r<=1))return vt.addSeconds(e,-n[--i].offset,t)}function Z_(e,t,n){let i=t/Zn.SECONDS_PER_DAY|0;return e+=i,t-=Zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function bG(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Zn.SECONDS_PER_HOUR+r*Zn.SECONDS_PER_MINUTE+s*Zn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var MTe=/^(\d{4})$/,BTe=/^(\d{4})-(\d{2})$/,LTe=/^(\d{4})-?(\d{3})$/,NTe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,FTe=/^(\d{4})-?(\d{2})-?(\d{2})$/,SG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,UTe=/^(\d{2})(\.\d+)?/.source+SG.source,VTe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+SG.source,kTe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+SG.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Jn.UTC);let i=e|0;t=t+(e-i)*Zn.SECONDS_PER_DAY,Z_(i,t,this),n===Jn.UTC&&N3(this)}vt.fromGregorianDate=function(e,t){let n=bG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Z_(n[0],n[1],t),N3(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromDate=function(e,t){let n=bG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Z_(n[0],n[1],t),N3(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,r=1,o=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(FTe),n!==null)i=+n[1],r=+n[2],o=+n[3];else if(n=f.match(BTe),n!==null)i=+n[1],r=+n[2];else if(n=f.match(MTe),n!==null)i=+n[1];else{let C;if(n=f.match(LTe),n!==null)i=+n[1],C=+n[2],g=Jh(i);else if(n=f.match(NTe),n!==null){i=+n[1];let T=+n[2],E=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+E-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),r=p.getUTCMonth()+1,o=p.getUTCDate()}g=Jh(i);let h;if(l(d)){n=d.match(kTe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(VTe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(UTe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],E=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-E;break;case"-":s=s+T,a=a+E;break;case"Z":break;default:a=a+new Date(Date.UTC(i,r-1,o,s,a)).getTimezoneOffset();break}}let A=c===60;for(A&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,o++;for(p=g&&r===2?TG:CG[r-1];o>p;)o-=p,r++,r>12&&(r-=12,i++),p=g&&r===2?TG:CG[r-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,o--;for(;o<1;)r--,r<1&&(r+=12,i--),p=g&&r===2?TG:CG[r-1],o+=p;let x=bG(i,r,o,s,a,c,u);return l(t)?(Z_(x[0],x[1],t),N3(t)):t=new vt(x[0],x[1],Jn.UTC),A&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var L3=new vt(0,0,Jn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=uZ(e,L3);l(i)||(vt.addSeconds(e,-1,L3),i=uZ(L3,L3),n=!0);let r=i.dayNumber,o=i.secondsOfDay;o>=43200&&(r+=1);let s=r+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=o/Zn.SECONDS_PER_HOUR|0,h=o-g*Zn.SECONDS_PER_HOUR,A=h/Zn.SECONDS_PER_MINUTE|0;h=h-A*Zn.SECONDS_PER_MINUTE;let x=h|0,C=(h-x)/Zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(x+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=A,t.second=x,t.millisecond=C,t.isLeapSecond=n,t):new Kh(p,d,f,g,A,x,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,fZ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,fZ),i=n.year,r=n.month,o=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&r===1&&o===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,r=12,o=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Jn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Zn.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Zn.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){ZC.julianDate=e;let t=vt.leapSeconds,n=wr(t,ZC,EG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return Z_(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_MINUTE;return Z_(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_HOUR;return Z_(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return Z_(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new Vi(new vt(2441317,43210,Jn.TAI),10),new Vi(new vt(2441499,43211,Jn.TAI),11),new Vi(new vt(2441683,43212,Jn.TAI),12),new Vi(new vt(2442048,43213,Jn.TAI),13),new Vi(new vt(2442413,43214,Jn.TAI),14),new Vi(new vt(2442778,43215,Jn.TAI),15),new Vi(new vt(2443144,43216,Jn.TAI),16),new Vi(new vt(2443509,43217,Jn.TAI),17),new Vi(new vt(2443874,43218,Jn.TAI),18),new Vi(new vt(2444239,43219,Jn.TAI),19),new Vi(new vt(2444786,43220,Jn.TAI),20),new Vi(new vt(2445151,43221,Jn.TAI),21),new Vi(new vt(2445516,43222,Jn.TAI),22),new Vi(new vt(2446247,43223,Jn.TAI),23),new Vi(new vt(2447161,43224,Jn.TAI),24),new Vi(new vt(2447892,43225,Jn.TAI),25),new Vi(new vt(2448257,43226,Jn.TAI),26),new Vi(new vt(2448804,43227,Jn.TAI),27),new Vi(new vt(2449169,43228,Jn.TAI),28),new Vi(new vt(2449534,43229,Jn.TAI),29),new Vi(new vt(2450083,43230,Jn.TAI),30),new Vi(new vt(2450630,43231,Jn.TAI),31),new Vi(new vt(2451179,43232,Jn.TAI),32),new Vi(new vt(2453736,43233,Jn.TAI),33),new Vi(new vt(2454832,43234,Jn.TAI),34),new Vi(new vt(2456109,43235,Jn.TAI),35),new Vi(new vt(2457204,43236,Jn.TAI),36),new Vi(new vt(2457754,43237,Jn.TAI),37)];var ee=vt;var OZ=vr(Hl(),1);function zTe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var lv=zTe;function yZ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=yZ(r,t)),n[i]=r}return n}var Ye=yZ;function AZ(e,t,n){n=y(n,!1);let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=AZ(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var gt=AZ;function HTe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var qs=HTe;var xZ=vr(Hl(),1);function vG(e,t){let n;return typeof document<"u"&&(n=document),vG._implementation(e,t,n)}vG._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new xZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Zh=vG;var CZ=vr(Hl(),1);function GTe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new CZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var uv=GTe;var TZ=vr(Hl(),1);function WTe(e){let t=new TZ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var E0=WTe;var EZ={};function jTe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=EZ[t];l(i)||(i={},EZ[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var id=jTe;var YTe=/^blob:/i;function qTe(e){return YTe.test(e)}var b0=qTe;var wm;function XTe(e){l(wm)||(wm=document.createElement("a")),wm.href=window.location.href;let t=wm.host,n=wm.protocol;return wm.href=e,wm.href=wm.href,n!==wm.protocol||t!==wm.host}var S0=XTe;var KTe=/^data:/i;function JTe(e){return KTe.test(e)}var Qh=JTe;function ZTe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var v0=ZTe;function QTe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var fv=nEe;function bZ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=fv(this.responseHeaders))}bZ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Dm=bZ;var z3=vr(Hl(),1);function dv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(dv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});dv.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};dv.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,r=-1;for(let o=0;o0){for(r.sort(iEe),e=0;e=0;--t)this.heapify(t)};D0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(ri&&(o=t[i],this._length=i),o};D0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return wG(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var mv=D0;function rEe(e,t){return e.priority-t.priority}var Qi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},eT=20,Ua=new mv({comparator:rEe});Ua.maximumLength=eT;Ua.reserve(eT);var Im=[],$h={},oEe=typeof document<"u"?new z3.default(document.location.href):new z3.default,H3=new pe;function Yr(){}Yr.maximumRequests=50;Yr.maximumRequestsPerServer=6;Yr.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18};Yr.throttleRequests=!0;Yr.debugShowStatistics=!1;Yr.requestCompletedEvent=H3;Object.defineProperties(Yr,{statistics:{get:function(){return Qi}},priorityHeapLength:{get:function(){return eT},set:function(e){if(ee;){let t=Ua.pop();I0(t)}eT=e,Ua.maximumLength=e,Ua.reserve(e)}}});function SZ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Yr.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Yr.requestsByServer[e],Yr.maximumRequestsPerServer);return $h[e]+t<=n};Yr.heapHasOpenSlots=function(e){return Ua.length+e<=eT};function vZ(e){return e.state===ei.UNISSUED&&(e.state=ei.ISSUED,e.deferred=qs()),e.deferred.promise}function sEe(e){return function(t){if(e.state===ei.CANCELLED)return;let n=e.deferred;--Qi.numberOfActiveRequests,--$h[e.serverKey],H3.raiseEvent(),e.state=ei.RECEIVED,e.deferred=void 0,n.resolve(t)}}function aEe(e){return function(t){e.state!==ei.CANCELLED&&(++Qi.numberOfFailedRequests,--Qi.numberOfActiveRequests,--$h[e.serverKey],H3.raiseEvent(t),e.state=ei.FAILED,e.deferred.reject(t))}}function wZ(e){let t=vZ(e);return e.state=ei.ACTIVE,Im.push(e),++Qi.numberOfActiveRequests,++Qi.numberOfActiveRequestsEver,++$h[e.serverKey],e.requestFunction().then(sEe(e)).catch(aEe(e)),t}function I0(e){let t=e.state===ei.ACTIVE;if(e.state=ei.CANCELLED,++Qi.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Qi.numberOfActiveRequests,--$h[e.serverKey],++Qi.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Yr.update=function(){let e,t,n=0,i=Im.length;for(e=0;e0&&(Im[e-n]=t)}Im.length-=n;let r=Ua.internalArray,o=Ua.length;for(e=0;e0;){if(t=Ua.pop(),t.cancelled){I0(t);continue}if(t.throttleByServer&&!Yr.serverHasOpenSlots(t.serverKey)){I0(t);continue}wZ(t),++a}cEe()};Yr.getServerKey=function(e){let t=new z3.default(e);t.scheme()===""&&(t=t.absoluteTo(oEe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=$h[n];return l(i)||($h[n]=0),n};Yr.request=function(e){if(Qh(e.url)||b0(e.url))return H3.raiseEvent(),e.state=ei.RECEIVED,e.requestFunction();if(++Qi.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Yr.getServerKey(e.url)),Yr.throttleRequests&&e.throttleByServer&&!Yr.serverHasOpenSlots(e.serverKey))return;if(!Yr.throttleRequests||!e.throttle)return wZ(e);if(Im.length>=Yr.maximumRequests)return;SZ(e);let t=Ua.insert(e);if(l(t)){if(t===e)return;I0(t)}return vZ(e)};function cEe(){Yr.debugShowStatistics&&(Qi.numberOfActiveRequests===0&&Qi.lastNumberOfActiveRequests>0&&(Qi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Qi.numberOfAttemptedRequests}`),Qi.numberOfAttemptedRequests=0),Qi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Qi.numberOfCancelledRequests}`),Qi.numberOfCancelledRequests=0),Qi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Qi.numberOfCancelledActiveRequests}`),Qi.numberOfCancelledActiveRequests=0),Qi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Qi.numberOfFailedRequests}`),Qi.numberOfFailedRequests=0)),Qi.lastNumberOfActiveRequests=Qi.numberOfActiveRequests)}Yr.clearForSpecs=function(){for(;Ua.length>0;){let t=Ua.pop();I0(t)}let e=Im.length;for(let t=0;t0}}});St.prototype.toString=function(){return this.getUrlComponent(!0,!0)};St.prototype.parseUrl=function(e,t,n,i){let r=new OZ.default(e),o=uEe(r.query());this._queryParameters=t?W3(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Zh(i))),this._url=r.toString()};function uEe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Gl(e)}function W3(e,t,n){if(!n)return gt(e,t);let i=Ye(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}St.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${fEe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function fEe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${w0(e)}`}St.prototype.setQueryParameters=function(e,t){t?this._queryParameters=W3(this._queryParameters,e,!1):this._queryParameters=W3(e,this._queryParameters,!1)};St.prototype.appendQueryParameters=function(e){this._queryParameters=W3(e,this._queryParameters,!0)};St.prototype.setTemplateValues=function(e,t){t?this._templateValues=gt(this._templateValues,e):this._templateValues=gt(e,this._templateValues)};St.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=gt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=gt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=gt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};St.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};St.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new St({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1})};St.prototype.getBaseUri=function(e){return uv(this.getUrlComponent(e),e)};St.prototype.appendForwardSlash=function(){this._url=lv(this._url)};St.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};St.fetchArrayBuffer=function(e){return new St(e).fetchArrayBuffer()};St.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};St.fetchBlob=function(e){return new St(e).fetchBlob()};St.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1);if(IG(this.request),!RZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return DG({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return St.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return St.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new St({url:d}),DG({resource:c,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function DG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=qs();return St._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Va.request(o);if(l(s))return s.catch(function(a){return o.state!==ei.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=ei.UNISSUED,o.deferred=void 0,DG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})}St.fetchImage=function(e){return new St(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};St.prototype.fetchText=function(){return this.fetch({responseType:"text"})};St.fetchText=function(e){return new St(e).fetchText()};St.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};St.fetchJson=function(e){return new St(e).fetchJson()};St.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};St.fetchXML=function(e){return new St(e).fetchXML()};St.prototype.fetchJsonp=function(e){e=y(e,"callback"),IG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return MZ(this,e,t)};function MZ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=qs();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},St._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=Va.request(r);if(l(s))return s.catch(function(a){return r.state!==ei.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=ei.UNISSUED,r.deferred=void 0,MZ(e,t,n)):Promise.reject(a)})})}St.fetchJsonp=function(e){return new St(e).fetchJsonp(e.callbackParameterName)};St.prototype._makeRequest=function(e){let t=this;IG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=gt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=qs(),d=St._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=Va.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==ei.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=ei.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function IG(e){if(e.state===ei.ISSUED||e.state===ei.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ei.UNISSUED,e.deferred=void 0}var dEe=/^data:(.*?)(;base64)?,(.*)$/;function G3(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function IZ(e,t){let n=G3(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o(a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:r};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){o.reject(new Dm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,A){h?o.reject(new de("Error decompressing response.")):o.resolve(PZ(A,t))}):o.resolve(PZ(g,t))})}).on("error",function(d){o.reject(new Dm)}).end()})}var pEe=typeof XMLHttpRequest>"u";St._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=dEe.exec(e);if(a!==null){o.resolve(mEe(a,t));return}if(pEe){hEe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(nT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new Dm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(A){let x=A.split(": "),C=x.shift();h[C]=x.join(": ")}),o.resolve(h);return}if(c.status===204)o.resolve();else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new Dm)},c.send(i),c};St._Implementations.loadAndExecuteScript=function(e,t,n){return v0(e,t).catch(function(i){n.reject(i)})};St._DefaultImplementations={};St._DefaultImplementations.createImage=St._Implementations.createImage;St._DefaultImplementations.loadWithXhr=St._Implementations.loadWithXhr;St._DefaultImplementations.loadAndExecuteScript=St._Implementations.loadAndExecuteScript;St.DEFAULT=Object.freeze(new St({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=St;function _v(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?BZ(this,e.data):BZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_v.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new _v({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};_v.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new J_(0,0,0,0,0),t}});_v.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new J_(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r=0,o=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,NZ(this,n,this._samples,e,r,o,t),t}let s=wr(n,e,ee.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return LZ(e,n,r,a,s),s;if(i.equals(u))return LZ(e,n,o,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],A=h-g;if(A>.5||A<-.5){let x=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];x!==C&&(u.equals(i)?g=h:h-=C-x)}return s.xPoleWander=pv(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=pv(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=pv(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=pv(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=pv(f,g,h),s}var gv=_v;function ka(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}ka.fromQuaternion=function(e,t){l(t)||(t=new ka);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};ka.fromDegrees=function(e,t,n,i){return l(i)||(i=new ka),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};ka.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ka(e.heading,e.pitch,e.roll)};ka.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};ka.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};ka.prototype.clone=function(e){return ka.clone(this,e)};ka.prototype.equals=function(e){return ka.equals(this,e)};ka.prototype.equalsEpsilon=function(e,t,n){return ka.equalsEpsilon(this,e,t,n)};ka.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var za=ka;var FZ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function gEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(rT)||(rT=document.createElement("a")),rT.href=e,rT.href=rT.href,rT.href)}var P0;function VZ(){if(l(P0))return P0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(q_.toUrl)?e=Zh("..",O0("Core/buildModuleUrl.js")):e=gEe(),P0=new ve({url:UZ(e)}),P0.appendForwardSlash(),P0}function yEe(e){return UZ(q_.toUrl(`../${e}`))}function kZ(e){return VZ().getDerivedResource({url:e}).url}var j3;function O0(e){return l(j3)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(q_.toUrl)?j3=yEe:j3=kZ),j3(e)}O0._cesiumScriptRegex=FZ;O0._buildModuleUrlFromBaseUrl=kZ;O0._clearBaseResource=function(){P0=void 0};O0.setBaseUrl=function(e){P0=ve.DEFAULT.getDerivedResource({url:e})};O0.getCesiumBaseUrl=VZ;var nn=O0;function AEe(e,t,n){this.x=e,this.y=t,this.s=n}var R0=AEe;function RG(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var xEe=new ee(0,0,Jn.TAI);function PG(e,t,n){let i=xEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}RG.prototype.preload=function(e,t,n,i){let r=PG(this,e,t),o=PG(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(OG(this,d));return Promise.all(f)};RG.prototype.computeXysRadians=function(e,t,n){let i=PG(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(OG(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(OG(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new R0(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,A,x;for(A=0;A<=o;++A)d[A]=f-h[A];for(A=0;A<=o;++A){for(g[A]=1,x=0;x<=o;++x)x!==A&&(g[A]*=d[x]);g[A]*=p[A];let C=(s+A)*3;n.x+=g[A]*u[C++],n.y+=g[A]*u[C++],n.s+=g[A]*u[C]}return n};function OG(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ve({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=n.fetchJson().then(function(o){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=o.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u=43200?r=(o+.5)/Zn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Zn.DAYS_PER_JULIAN_CENTURY;let a=(OEe+r*(REe+r*(MEe+r*BEe)))*FEe%P.TWO_PI,c=NEe+LEe*(n-24515455e-1),u=(i+Zn.SECONDS_PER_DAY*.5)%Zn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};ji.iau2006XysData=new yv;ji.earthOrientationParameters=gv.NONE;var FG=32.184,UEe=2451545;ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+FG,i=e.stop.dayNumber,r=e.stop.secondsOfDay+FG;return ji.iau2006XysData.preload(t,n,i,r)};ji.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=ji.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var VEe=new R0(0,0,0),kEe=new J_(0,0,0,0,0,0),LG=new Z,NG=new Z;ji.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=ji.earthOrientationParameters.compute(e,kEe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+FG,o=ji.iau2006XysData.computeXysRadians(i,r,VEe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=LG;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-o.s,NG),d=Z.multiply(u,f,LG),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,A=g/Zn.SECONDS_PER_DAY,x=.779057273264+A+.00273781191135448*(h+A);x=x%1*P.TWO_PI;let C=Z.fromRotationZ(x,NG),T=Z.multiply(d,C,LG),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),R=i-UEe+r/Zn.SECONDS_PER_DAY;R/=36525;let O=-47e-6*R*P.RADIANS_PER_DEGREE/3600,L=Math.cos(O),N=Math.sin(O),_=NG;return _[0]=E*L,_[1]=E*N,_[2]=w,_[3]=-S*N+D*w*L,_[4]=S*L+D*w*N,_[5]=-D*E,_[6]=-D*N-S*w*L,_[7]=D*L-S*w*N,_[8]=S*E,Z.multiply(T,_,t)};var zEe=new oe;ji.pointToWindowCoordinates=function(e,t,n,i){return i=ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ji.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let r=zEe;return B.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,r),r),oe.multiplyByScalar(r,1/r.w,r),B.multiplyByVector(t,r,r),H.fromCartesian4(r,i)};var HEe=new m,GEe=new m,WEe=new m;ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=y(n,re.WGS84).geodeticSurfaceNormal(e,HEe),o=m.cross(t,r,GEe);m.equalsEpsilon(o,m.ZERO,P.EPSILON6)&&(o=m.clone(m.UNIT_X,o));let s=m.cross(o,t,WEe);return m.normalize(s,s),m.cross(t,s,o),m.negate(o,o),m.normalize(o,o),l(i)||(i=new Z),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var HZ=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),GZ=new he,WZ=new m,jEe=new m,YEe=new Z,UG=new B,jZ=new B;ji.basisTo2D=function(e,t,n){let i=B.getTranslation(t,jEe),r=e.ellipsoid,o=r.cartesianToCartographic(i,GZ),s=e.project(o,WZ);m.fromElements(s.z,s.x,s.y,s);let a=ji.eastNorthUpToFixedFrame(i,r,UG),c=B.inverseTransformation(a,jZ),u=B.getMatrix3(t,YEe),f=B.multiplyByMatrix3(c,u,n);return B.multiply(HZ,f,n),B.setTranslation(n,s,n),n};ji.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=ji.eastNorthUpToFixedFrame(t,i,UG),o=B.inverseTransformation(r,jZ),s=i.cartesianToCartographic(t,GZ),a=e.project(s,WZ);m.fromElements(a.z,a.x,a.y,a);let c=B.fromTranslation(a,UG);return B.multiply(HZ,o,n),B.multiply(c,n,n),n};var Mt=ji;function VG(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Be.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Yu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}VG.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var qEe=new he,XEe=new m,YZ=new B,KEe=[new he,new he,new he],JEe=[new H,new H,new H],ZEe=[new H,new H,new H],QEe=new m,$Ee=new Le,ebe=new B,tbe=new Zi;VG._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ce.center(i,qEe),s=he.toCartesian(o,n,XEe),a=Mt.eastNorthUpToFixedFrame(s,n,YZ),c=B.inverse(a,YZ),u=JEe,f=KEe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=QEe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=B.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(m.UNIT_Z,-t,$Ee),g=Z.fromQuaternion(p,ebe),h=e.length,A=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(r=0;r=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(XZ()).then(function(i){l(t)?i||(t.length=0):t=obe;let r=n._nextID++,o=qs();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise})};_a.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=ZZ(this));let t=qs(),n=this,i=this._worker;return rbe(this,e).then(function(r){return Promise.resolve(XZ()).then(function(o){let s,a=r.wasmBinary;l(a)&&o&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){KZ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:r},s)})}),t.promise};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};_a.taskCompletedEvent=zG;_a._defaultWorkerModulePrefix="Workers/";_a._workerModulePrefix=_a._defaultWorkerModulePrefix;_a._canTransferArrayBuffer=void 0;var pi=_a;function ep(){}ep._transcodeTaskProcessor=new pi("transcodeKTX2",Number.POSITIVE_INFINITY);ep._readyPromise=void 0;function sbe(){let e=ep._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return ep._transcodeTaskProcessor});ep._readyPromise=e}ep.transcode=function(e,t){return l(ep._readyPromise)||sbe(),ep._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]),o=r.length,s;for(s=0;s1/pi. - * - * @alias czm_oneOverPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverPi = ...; - * - * // Example - * float pi = 1.0 / czm_oneOverPi; - */ -const float czm_oneOverPi = 0.3183098861837907; -`;var Bv=`/** - * A built-in GLSL floating-point constant for 1/2pi. - * - * @alias czm_oneOverTwoPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_TWO_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverTwoPi = ...; - * - * // Example - * float pi = 2.0 * czm_oneOverTwoPi; - */ -const float czm_oneOverTwoPi = 0.15915494309189535; -`;var Lv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} - * - * @name czm_passCesium3DTile - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTile = 4.0; -`;var Nv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} - * - * @name czm_passCesium3DTileClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassification = 5.0; -`;var Fv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} - * - * @name czm_passCesium3DTileClassificationIgnoreShow - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var Uv=`/** - * The automatic GLSL constant for {@link Pass#CLASSIFICATION} - * - * @name czm_passClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passClassification = 7.0; -`;var Vv=`/** - * The automatic GLSL constant for {@link Pass#COMPUTE} - * - * @name czm_passCompute - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCompute = 1.0; -`;var kv=`/** - * The automatic GLSL constant for {@link Pass#ENVIRONMENT} - * - * @name czm_passEnvironment - * @glslConstant - * - * @see czm_pass - */ -const float czm_passEnvironment = 0.0; -`;var zv=`/** - * The automatic GLSL constant for {@link Pass#GLOBE} - * - * @name czm_passGlobe - * @glslConstant - * - * @see czm_pass - */ -const float czm_passGlobe = 2.0; -`;var Hv=`/** - * The automatic GLSL constant for {@link Pass#OPAQUE} - * - * @name czm_passOpaque - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOpaque = 7.0; -`;var Gv=`/** - * The automatic GLSL constant for {@link Pass#OVERLAY} - * - * @name czm_passOverlay - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOverlay = 10.0; -`;var Wv=`/** - * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} - * - * @name czm_passTerrainClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTerrainClassification = 3.0; -`;var jv=`/** - * The automatic GLSL constant for {@link Pass#TRANSLUCENT} - * - * @name czm_passTranslucent - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTranslucent = 8.0; -`;var Yv=`/** - * The automatic GLSL constant for {@link Pass#VOXELS} - * - * @name czm_passVoxels - * @glslConstant - * - * @see czm_pass - */ -const float czm_passVoxels = 9.0; -`;var qv=`/** - * A built-in GLSL floating-point constant for Math.PI. - * - * @alias czm_pi - * @glslConstant - * - * @see CesiumMath.PI - * - * @example - * // GLSL declaration - * const float czm_pi = ...; - * - * // Example - * float twoPi = 2.0 * czm_pi; - */ -const float czm_pi = 3.141592653589793; -`;var Xv=`/** - * A built-in GLSL floating-point constant for pi/4. - * - * @alias czm_piOverFour - * @glslConstant - * - * @see CesiumMath.PI_OVER_FOUR - * - * @example - * // GLSL declaration - * const float czm_piOverFour = ...; - * - * // Example - * float pi = 4.0 * czm_piOverFour; - */ -const float czm_piOverFour = 0.7853981633974483; -`;var Kv=`/** - * A built-in GLSL floating-point constant for pi/6. - * - * @alias czm_piOverSix - * @glslConstant - * - * @see CesiumMath.PI_OVER_SIX - * - * @example - * // GLSL declaration - * const float czm_piOverSix = ...; - * - * // Example - * float pi = 6.0 * czm_piOverSix; - */ -const float czm_piOverSix = 0.5235987755982988; -`;var Jv=`/** - * A built-in GLSL floating-point constant for pi/3. - * - * @alias czm_piOverThree - * @glslConstant - * - * @see CesiumMath.PI_OVER_THREE - * - * @example - * // GLSL declaration - * const float czm_piOverThree = ...; - * - * // Example - * float pi = 3.0 * czm_piOverThree; - */ -const float czm_piOverThree = 1.0471975511965976; -`;var Zv=`/** - * A built-in GLSL floating-point constant for pi/2. - * - * @alias czm_piOverTwo - * @glslConstant - * - * @see CesiumMath.PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_piOverTwo = ...; - * - * // Example - * float pi = 2.0 * czm_piOverTwo; - */ -const float czm_piOverTwo = 1.5707963267948966; -`;var Qv=`/** - * A built-in GLSL floating-point constant for converting degrees to radians. - * - * @alias czm_radiansPerDegree - * @glslConstant - * - * @see CesiumMath.RADIANS_PER_DEGREE - * - * @example - * // GLSL declaration - * const float czm_radiansPerDegree = ...; - * - * // Example - * float rad = czm_radiansPerDegree * deg; - */ -const float czm_radiansPerDegree = 0.017453292519943295; -`;var $v=`/** - * The constant identifier for the 2D {@link SceneMode} - * - * @name czm_sceneMode2D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode2D = 2.0; -`;var ew=`/** - * The constant identifier for the 3D {@link SceneMode} - * - * @name czm_sceneMode3D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode3D = 3.0; -`;var tw=`/** - * The constant identifier for the Columbus View {@link SceneMode} - * - * @name czm_sceneModeColumbusView - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneModeColumbusView = 1.0; -`;var nw=`/** - * The constant identifier for the Morphing {@link SceneMode} - * - * @name czm_sceneModeMorphing - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - */ -const float czm_sceneModeMorphing = 0.0; -`;var iw=`/** - * A built-in GLSL floating-point constant for one solar radius. - * - * @alias czm_solarRadius - * @glslConstant - * - * @see CesiumMath.SOLAR_RADIUS - * - * @example - * // GLSL declaration - * const float czm_solarRadius = ...; - */ -const float czm_solarRadius = 695500000.0; -`;var rw=`/** - * A built-in GLSL floating-point constant for 3pi/2. - * - * @alias czm_threePiOver2 - * @glslConstant - * - * @see CesiumMath.THREE_PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_threePiOver2 = ...; - * - * // Example - * float pi = (2.0 / 3.0) * czm_threePiOver2; - */ -const float czm_threePiOver2 = 4.71238898038469; -`;var ow=`/** - * A built-in GLSL floating-point constant for 2pi. - * - * @alias czm_twoPi - * @glslConstant - * - * @see CesiumMath.TWO_PI - * - * @example - * // GLSL declaration - * const float czm_twoPi = ...; - * - * // Example - * float pi = czm_twoPi / 2.0; - */ -const float czm_twoPi = 6.283185307179586; -`;var sw=`/** - * The maximum latitude, in radians, both North and South, supported by a Web Mercator - * (EPSG:3857) projection. Technically, the Mercator projection is defined - * for any latitude up to (but not including) 90 degrees, but it makes sense - * to cut it off sooner because it grows exponentially with increasing latitude. - * The logic behind this particular cutoff value, which is the one used by - * Google Maps, Bing Maps, and Esri, is that it makes the projection - * square. That is, the rectangle is equal in the X and Y directions. - * - * The constant value is computed as follows: - * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) - * - * @name czm_webMercatorMaxLatitude - * @glslConstant - */ -const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var aw=`/** - * @name czm_depthRangeStruct - * @glslStruct - */ -struct czm_depthRangeStruct +`;var Av=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() { - float near; - float far; -}; -`;var cw=`/** - * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} specular Intensity of incoming light reflecting in a single direction. - * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - */ -struct czm_material + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var Ev=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() { - vec3 diffuse; - float specular; - float shininess; - vec3 normal; - vec3 emission; - float alpha; -}; -`;var lw=`/** - * Used as input to every material's czm_getMaterial function. - * - * @name czm_materialInput - * @glslStruct - * - * @property {float} s 1D texture coordinates. - * @property {vec2} st 2D texture coordinates. - * @property {vec3} str 3D texture coordinates. - * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. - * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. - * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. - * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. - * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. - * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. - */ -struct czm_materialInput -{ - float s; - vec2 st; - vec3 str; - vec3 normalEC; - mat3 tangentToEyeMatrix; - vec3 positionToEyeEC; - float height; - float slope; - float aspect; -}; -`;var uw=`/** - * Struct for representing a material for a {@link Model}. The model - * rendering pipeline will pass this struct between material, custom shaders, - * and lighting stages. This is not to be confused with {@link czm_material} - * which is used by the older Fabric materials system, although they are similar. - *

- * All color values (diffuse, specular, emissive) are in linear color space. - *

- * - * @name czm_modelMaterial - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. - * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. - * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. - * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - */ -struct czm_modelMaterial { - vec3 diffuse; - float alpha; - vec3 specular; - float roughness; - vec3 normalEC; - float occlusion; - vec3 emissive; -}; -`;var fw=`/** - * Struct for representing the output of a custom vertex shader. - * - * @name czm_modelVertexOutput - * @glslStruct - * - * @see {@link CustomShader} - * @see {@link Model} - * - * @property {vec3} positionMC The position of the vertex in model coordinates - * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. - */ -struct czm_modelVertexOutput { - vec3 positionMC; - float pointSize; -}; -`;var dw=`/** - * Parameters for {@link czm_pbrLighting} - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation - * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. - * @property {vec3} f0 The reflectance of the material at normal incidence - */ -struct czm_pbrParameters -{ - vec3 diffuseColor; - float roughness; - vec3 f0; -}; -`;var mw=`/** - * DOC_TBA - * - * @name czm_ray - * @glslStruct - */ -struct czm_ray -{ - vec3 origin; - vec3 direction; -}; -`;var hw=`/** - * DOC_TBA - * - * @name czm_raySegment - * @glslStruct - */ -struct czm_raySegment -{ - float start; - float stop; -}; + vec4 p = czm_computePosition(); -/** - * DOC_TBA - * - * @name czm_emptyRaySegment - * @glslConstant - */ -const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates -/** - * DOC_TBA - * - * @name czm_fullRaySegment - * @glslConstant - */ -const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var pw=`struct czm_shadowParameters + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var Sv=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() { -#ifdef USE_CUBE_MAP_SHADOW - vec3 texCoords; -#else - vec2 texCoords; -#endif + vec3 positionToEyeEC = -v_positionEC; - float depthBias; - float depth; - float nDotL; - vec2 texelStepSize; - float normalShadingSmooth; - float darkness; -}; -`;var _w=`// See: -// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif -vec3 czm_acesTonemapping(vec3 color) { - float g = 0.985; - float a = 0.065; - float b = 0.0001; - float c = 0.433; - float d = 0.238; + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); - color = (color * (color + a) - b) / (color * (g * color + c) + d); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var vv=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; - color = clamp(color, 0.0, 1.0); +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; - return color; -} -`;var gw=`/** - * @private - */ -float czm_alphaWeight(float a) +void main() { - float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 p = czm_computePosition(); - // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: - // http://jcgt.org/published/0002/02/09/ - return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var yw=`/** - * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. - * - * @name czm_antialias - * @glslFunction - * - * @param {vec4} color1 The color on one side of the edge. - * @param {vec4} color2 The color on the other side of the edge. - * @param {vec4} currentcolor The current color, either color1 or color2. - * @param {float} dist The distance to the edge in texture coordinates. - * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. - * @returns {vec4} The anti-aliased color. - * - * @example - * // GLSL declarations - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); - * - * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space - * float dist = abs(textureCoordinates.t - 0.5); - * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); - * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); - */ -vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var KEe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},ya=Object.freeze(KEe);var JEe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},Eo=Object.freeze(JEe);var ZEe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE,functionDestinationAlpha:Eo.ONE})},mn=Object.freeze(ZEe);var $Ee={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},_i=Object.freeze($Ee);function fT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(fT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});fT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};fT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};fT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=mn.ALPHA_BLEND):t.depthMask=!0,t};fT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=mn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:_i.BACK}),l(n)&&(i=_t(n,i,!0)),i};var no=fT;function QEe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Wn=QEe;function dT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(dT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});dT.clone=function(e){if(l(e))return new dT(e._format,e._datatype,e._width,e._height,e._buffer)};dT.prototype.clone=function(){return dT.clone(this)};var wv=dT;var wZ=Io(Wl(),1);function IZ(){if(!l(xa._canTransferArrayBuffer)){let e=new Worker(PZ("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return xa._canTransferArrayBuffer=!1,xa._canTransferArrayBuffer}let i=Ys();e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i.resolve(s),e.terminate(),xa._canTransferArrayBuffer=s},xa._canTransferArrayBuffer=i.promise}return xa._canTransferArrayBuffer}var l8=new pe;function DZ(e,t){--e._activeTasks;let n=t.id;if(!l(n))return;let i=e._deferreds,o=i[n];if(l(t.error)){let r=t.error;r.name==="RuntimeError"?(r=new de(t.error.message),r.stack=t.error.stack):r.name==="DeveloperError"&&(r=new fe(t.error.message),r.stack=t.error.stack),l8.raiseEvent(r),o.reject(r)}else l8.raiseEvent(),o.resolve(t.result);delete i[n]}function PZ(e){let t=nn(e);if(v0(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var c8;function eSe(){return l(c8)||(c8=PZ("Workers/cesiumWorkerBootstrapper.js")),c8}function OZ(e){let t=new Worker(eSe());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:nn("Workers")},baseUrl:nn.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){DZ(e,i.data)},t}function tSe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Wt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=nn(t.modulePath),n.wasmBinaryFile=nn(t.wasmBinaryFile),Se.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function xa(e,t){let n=new wZ.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:xa._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var nSe=[];xa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=OZ(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(IZ()).then(function(i){l(t)?i||(t.length=0):t=nSe;let o=n._nextID++,r=Ys();return n._deferreds[o]=r,n._worker.postMessage({id:o,parameters:e,canTransferArrayBuffer:i},t),r.promise})};xa.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=OZ(this));let t=Ys(),n=this,i=this._worker;return tSe(this,e).then(function(o){return Promise.resolve(IZ()).then(function(r){let s,a=o.wasmBinary;l(a)&&r&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){DZ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:o},s)})}),t.promise};xa.prototype.isDestroyed=function(){return!1};xa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};xa.taskCompletedEvent=l8;xa._defaultWorkerModulePrefix="Workers/";xa._workerModulePrefix=xa._defaultWorkerModulePrefix;xa._canTransferArrayBuffer=void 0;var gi=xa;function $h(){}$h._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);$h._readyPromise=void 0;function iSe(){let e=$h._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return $h._transcodeTaskProcessor});$h._readyPromise=e}$h.transcode=function(e,t){return l($h._readyPromise)||iSe(),$h._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;strue if the fragment is back facing; otherwise, false. - */ -bool czm_backFacing() +`;var Mv=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. - return gl_FrontFacing == false; -} -`;var Cw=`/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a float expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {float} a Value to return if the comparison is true. - * @param {float} b Value to return if the comparison is false. - * - * @returns {float} equivalent of comparison ? a : b - */ -float czm_branchFreeTernary(bool comparison, float a, float b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + czm_material material = czm_getDefaultMaterial(materialInput); -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec2 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec2} a Value to return if the comparison is true. - * @param {vec2} b Value to return if the comparison is false. - * - * @returns {vec2} equivalent of comparison ? a : b - */ -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + vec2 st = materialInput.st; -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec3 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec4 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var Tw=` -vec4 czm_cascadeColor(vec4 weights) +`;var Lv=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + - vec4(0.0, 1.0, 0.0, 1.0) * weights.y + - vec4(0.0, 0.0, 1.0, 1.0) * weights.z + - vec4(1.0, 0.0, 1.0, 1.0) * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var Ew=` -uniform vec4 shadowMap_cascadeDistances; +`;var Nv=`uniform sampler2D heights; +uniform sampler2D colors; -float czm_cascadeDistance(vec4 weights) +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) { - return dot(shadowMap_cascadeDistances, weights); + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif } -`;var bw=` -uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +czm_material czm_getMaterial(czm_materialInput materialInput) { - return shadowMap_cascadeMatrices[0] * weights.x + - shadowMap_cascadeMatrices[1] * weights.y + - shadowMap_cascadeMatrices[2] * weights.z + - shadowMap_cascadeMatrices[3] * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; + } + + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var Sw=` -uniform vec4 shadowMap_cascadeSplits[2]; +`;var Fv=`uniform vec4 color; +uniform float spacing; +uniform float width; -vec4 czm_cascadeWeights(float depthEye) +czm_material czm_getMaterial(czm_materialInput materialInput) { - // One component is set to 1.0 and all others set to 0.0. - vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); - vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); - return near * far; + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } -`;var vw=`/** - * DOC_TBA - * - * @name czm_columbusViewMorph - * @glslFunction - */ -vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var Bv=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // Just linear for now. - vec3 p = mix(position2D.xyz, position3D.xyz, time); - return vec4(p, 1.0); -} -`;var ww=`/** - * Returns a position in model coordinates relative to eye taking into - * account the current scene mode: 3D, 2D, or Columbus view. - *

- * This uses standard position attributes, position3DHigh, - * position3DLow, position2DHigh, and position2DLow, - * and should be used when writing a vertex shader for an {@link Appearance}. - *

- * - * @name czm_computePosition - * @glslFunction - * - * @returns {vec4} The position relative to eye. - * - * @example - * vec4 p = czm_computePosition(); - * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * - * @see czm_translateRelativeToEye - */ -vec4 czm_computePosition(); -`;var Dw=`/** - * @private - */ -vec2 cordic(float angle) -{ -// Scale the vector by the appropriate factor for the 24 iterations to follow. - vec2 vector = vec2(6.0725293500888267e-1, 0.0); -// Iteration 1 - float sense = (angle < 0.0) ? -1.0 : 1.0; - // float factor = sense * 1.0; // 2^-0 - mat2 rotation = mat2(1.0, sense, -sense, 1.0); - vector = rotation * vector; - angle -= sense * 7.8539816339744828e-1; // atan(2^-0) -// Iteration 2 - sense = (angle < 0.0) ? -1.0 : 1.0; - float factor = sense * 5.0e-1; // 2^-1 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.6364760900080609e-1; // atan(2^-1) -// Iteration 3 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.5e-1; // 2^-2 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4497866312686414e-1; // atan(2^-2) -// Iteration 4 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.25e-1; // 2^-3 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2435499454676144e-1; // atan(2^-3) -// Iteration 5 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.25e-2; // 2^-4 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.2418809995957350e-2; // atan(2^-4) -// Iteration 6 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.125e-2; // 2^-5 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.1239833430268277e-2; // atan(2^-5) -// Iteration 7 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.5625e-2; // 2^-6 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5623728620476831e-2; // atan(2^-6) -// Iteration 8 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.8125e-3; // 2^-7 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.8123410601011111e-3; // atan(2^-7) -// Iteration 9 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.90625e-3; // 2^-8 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.9062301319669718e-3; // atan(2^-8) -// Iteration 10 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.953125e-3; // 2^-9 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9531225164788188e-3; // atan(2^-9) -// Iteration 11 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.765625e-4; // 2^-10 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.7656218955931946e-4; // atan(2^-10) -// Iteration 12 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.8828125e-4; // 2^-11 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.8828121119489829e-4; // atan(2^-11) -// Iteration 13 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.44140625e-4; // 2^-12 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4414062014936177e-4; // atan(2^-12) -// Iteration 14 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.220703125e-4; // 2^-13 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2207031189367021e-4; // atan(2^-13) -// Iteration 15 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.103515625e-5; // 2^-14 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.1035156174208773e-5; // atan(2^-14) -// Iteration 16 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.0517578125e-5; // 2^-15 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.0517578115526096e-5; // atan(2^-15) -// Iteration 17 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.52587890625e-5; // 2^-16 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5258789061315762e-5; // atan(2^-16) -// Iteration 18 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.62939453125e-6; // 2^-17 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.6293945311019700e-6; // atan(2^-17) -// Iteration 19 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.814697265625e-6; // 2^-18 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.8146972656064961e-6; // atan(2^-18) -// Iteration 20 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.9073486328125e-6; // 2^-19 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9073486328101870e-6; // atan(2^-19) -// Iteration 21 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.5367431640625e-7; // 2^-20 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.5367431640596084e-7; // atan(2^-20) -// Iteration 22 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.76837158203125e-7; // 2^-21 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.7683715820308884e-7; // atan(2^-21) -// Iteration 23 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.384185791015625e-7; // 2^-22 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.3841857910155797e-7; // atan(2^-22) -// Iteration 24 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.1920928955078125e-7; // 2^-23 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; -// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) - - return vector; + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } +`;var kv=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; -/** - * Computes the cosine and sine of the provided angle using the CORDIC algorithm. - * - * @name czm_cosineAndSine - * @glslFunction - * - * @param {float} angle The angle in radians. - * - * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). - * - * @example - * vec2 v = czm_cosineAndSine(czm_piOverSix); - * float cosine = v.x; - * float sine = v.y; - */ -vec2 czm_cosineAndSine(float angle) +float getTime(float t, float coord) { - if (angle < -czm_piOverTwo || angle > czm_piOverTwo) - { - if (angle < 0.0) - { - return -cordic(angle + czm_pi); - } - else - { - return -cordic(angle - czm_pi); - } - } - else + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) { - return cordic(angle); + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); } + return clamp(q, 0.0, 1.0); } -`;var Iw=`/** - * Decompresses texture coordinates that were packed into a single float. - * - * @name czm_decompressTextureCoordinates - * @glslFunction - * - * @param {float} encoded The compressed texture coordinates. - * @returns {vec2} The decompressed texture coordinates. - */ - vec2 czm_decompressTextureCoordinates(float encoded) - { - float temp = encoded / 4096.0; - float xZeroTo4095 = floor(temp); - float stx = xZeroTo4095 / 4095.0; - float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; - return vec2(stx, sty); - } -`;var Pw=`/** - * Get default parameters for physically based rendering. These defaults - * describe a rough dielectric (non-metal) surface (e.g. rough plastic). - * - * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} - */ -czm_pbrParameters czm_defaultPbrMaterial() + +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_pbrParameters results; - results.diffuseColor = vec3(1.0); - results.roughness = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - results.f0 = REFLECTANCE_DIELECTRIC; - return results; + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; } -`;var Ow=`// emulated noperspective -#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif +`;var Uv=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; -/** - * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. - * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, - * capping the shadow volume. More information here: - * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. - * - * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring - * no geometry gets clipped by setting the clip space z value to 0.0 and then - * sending the unaltered screen space z value (using emulated noperspective - * interpolation) to the frag shader where it is clamped to [0,1] and then - * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: - * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. - * - * When GL_EXT_frag_depth is not available, which is the case on some mobile - * devices, we must attempt to fix this only in the vertex shader. - * The approach is to clamp the z value to the far plane, which closes the - * shadow volume but also distorts the geometry, so there can still be artifacts - * on frustum seams. - * - * @name czm_depthClamp - * @glslFunction - * - * @param {vec4} coords The vertex in clip coordinates. - * @returns {vec4} The modified vertex. - * - * @example - * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); - * - * @see czm_writeDepthClamp - */ -vec4 czm_depthClamp(vec4 coords) +czm_material czm_getMaterial(czm_materialInput materialInput) { -#ifndef LOG_DEPTH -#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) - v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; - coords.z = 0.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); #else - coords.z = min(coords.z, coords.w); -#endif + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); #endif - return coords; -} -`;var Rw=`/** - * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system - * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the - * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. - *

- * The ellipsoid is assumed to be centered at the model coordinate's origin. - * - * @name czm_eastNorthUpToEyeCoordinates - * @glslFunction - * - * @param {vec3} positionMC The position on the ellipsoid in model coordinates. - * @param {vec3} normalEC The normalized ellipsoid surface normal, at positionMC, in eye coordinates. - * - * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. - * - * @example - * // Transform a vector defined in the east-north-up coordinate - * // system, (0, 0, 1) which is the surface normal, to eye - * // coordinates. - * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); - */ -mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) -{ - vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates - vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes - vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates - return mat3( - tangentEC.x, tangentEC.y, tangentEC.z, - bitangentEC.x, bitangentEC.y, bitangentEC.z, - normalEC.x, normalEC.y, normalEC.z); + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; } -`;var Mw=`/** - * DOC_TBA - * - * @name czm_ellipsoidContainsPoint - * @glslFunction - * - */ -bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var Vv=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; - return (dot(scaled, scaled) <= 1.0); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; } -`;var Bw=`/** - * DOC_TBA - * - * @name czm_ellipsoidWgs84TextureCoordinates - * @glslFunction - */ -vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +`;var zv=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) { - return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var Lw=`/** - * Compares left and right componentwise. Returns true - * if they are within epsilon and false otherwise. The inputs - * left and right can be floats, vec2s, - * vec3s, or vec4s. - * - * @name czm_equalsEpsilon - * @glslFunction - * - * @param {} left The first vector. - * @param {} right The second vector. - * @param {float} epsilon The epsilon to use for equality testing. - * @returns {bool} true if the components are within epsilon and false otherwise. - * - * @example - * // GLSL declarations - * bool czm_equalsEpsilon(float left, float right, float epsilon); - * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); - * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); - * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); - */ -bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec4(epsilon))); + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; } -bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec3(epsilon))); -} +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); -bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec2(epsilon))); -} + vec2 st = materialInput.st; -bool czm_equalsEpsilon(float left, float right, float epsilon) { - return (abs(left - right) <= epsilon); -} -`;var Nw=`/** - * DOC_TBA - * - * @name czm_eyeOffset - * @glslFunction - * - * @param {vec4} positionEC DOC_TBA. - * @param {vec3} eyeOffset DOC_TBA. - * - * @returns {vec4} DOC_TBA. - */ -vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) -{ - // This equation is approximate in x and y. - vec4 p = positionEC; - vec4 zEyeOffset = normalize(p) * eyeOffset.z; - p.xy += eyeOffset.xy + zEyeOffset.xy; - p.z += zEyeOffset.z; - return p; -} -`;var Fw=`/** - * Transforms a position from eye to window coordinates. The transformation - * from eye to clip coordinates is done using {@link czm_projection}. - * The transform from normalized device coordinates to window coordinates is - * done using {@link czm_viewportTransformation}, which assumes a depth range - * of near = 0 and far = 1. - *

- * This transform is useful when there is a need to manipulate window coordinates - * in a vertex shader as done by {@link BillboardCollection}. - * - * @name czm_eyeToWindowCoordinates - * @glslFunction - * - * @param {vec4} position The position in eye coordinates to transform. - * - * @returns {vec4} The transformed position in window coordinates. - * - * @see czm_modelToWindowCoordinates - * @see czm_projection - * @see czm_viewportTransformation - * @see BillboardCollection - * - * @example - * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - */ -vec4 czm_eyeToWindowCoordinates(vec4 positionEC) -{ - vec4 q = czm_projection * positionEC; // clip coordinates - q.xyz /= q.w; // normalized device coordinates - q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates - return q; +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; } -`;var Uw=`/** - * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. - * - * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on - * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. - * Adapted from ShaderFastLibs under MIT License. - * - * Chosen for the following characteristics over range [0, 1]: - * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) - * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) - * - * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); - * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between 0 and 1 inclusive. - * - * @returns {float} Approximation of atan(x) - */ -float czm_fastApproximateAtan(float x) { - return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +`;var Hv=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); } -/** - * Approximation of atan2. - * - * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html - * However, we replaced their atan curve with Michael Drobot's (see above). - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between -1 and 1 inclusive. - * @param {float} y Value between -1 and 1 inclusive. - * - * @returns {float} Approximation of atan2(x, y) - */ -float czm_fastApproximateAtan(float x, float y) { - // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. - // So range-reduce using abs and by flipping whether x or y is on top. - float t = abs(x); // t used as swap and atan result. - float opposite = abs(y); - float adjacent = max(t, opposite); - opposite = min(t, opposite); +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); - t = czm_fastApproximateAtan(opposite / adjacent); + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - // Undo range reduction - t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); - t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); - t = czm_branchFreeTernary(y < 0.0, -t, t); - return t; + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; } -`;var Vw=`/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var Gv=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-(scalar * scalar)); - return mix(color, fogColor, fog); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; } +`;var Wv=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; -/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * @param {float} fogModifierConstant A constant to modify the appearance of fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); - return mix(color, fogColor, fog); -} -`;var kw=`/** - * Converts a color from RGB space to linear space. - * - * @name czm_gammaCorrect - * @glslFunction - * - * @param {vec3} color The color in RGB space. - * @returns {vec3} The color in linear space. - */ -vec3 czm_gammaCorrect(vec3 color) { -#ifdef HDR - color = pow(color, vec3(czm_gamma)); -#endif - return color; + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } +`;var jv=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; -vec4 czm_gammaCorrect(vec4 color) { -#ifdef HDR - color.rgb = pow(color.rgb, vec3(czm_gamma)); -#endif - return color; -} -`;var zw=`/** - * DOC_TBA - * - * @name czm_geodeticSurfaceNormal - * @glslFunction - * - * @param {vec3} positionOnEllipsoid DOC_TBA - * @param {vec3} ellipsoidCenter DOC_TBA - * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA - * - * @returns {vec3} DOC_TBA. - */ -vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) -{ - return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); -} -`;var Hw=`/** - * An czm_material with default values. Every material's czm_getMaterial - * should use this default material as a base for the material it returns. - * The default normal value is given by materialInput.normalEC. - * - * @name czm_getDefaultMaterial - * @glslFunction - * - * @param {czm_materialInput} input The input used to construct the default material. - * - * @returns {czm_material} The default material. - * - * @see czm_materialInput - * @see czm_material - * @see czm_getMaterial - */ -czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_material material; - material.diffuse = vec3(0.0); - material.specular = 0.0; - material.shininess = 1.0; - material.normal = materialInput.normalEC; - material.emission = vec3(0.0); - material.alpha = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + return material; } -`;var Gw=`/** - * Calculates the intensity of diffusely reflected light. - * - * @name czm_getLambertDiffuse - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * - * @returns {float} The intensity of the diffuse reflection. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var qv=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return max(dot(lightDirectionEC, normalEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } -`;var Ww=`/** - * Calculates the specular intensity of reflected light. - * - * @name czm_getSpecular - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * - * @returns {float} The intensity of the specular highlight. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var Yv=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); - float specular = max(dot(toReflectedLight, toEyeEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); - // pow has undefined behavior if both parameters <= 0. - // Prevent this by making sure shininess is at least czm_epsilon2. - return pow(specular, max(shininess, czm_epsilon2)); + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var jw=`/** - * @private - */ -vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var Xv=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float cosAngle = cos(angleInRadians); - float sinAngle = sin(angleInRadians); + czm_material material = czm_getDefaultMaterial(materialInput); - // time dependent sampling directions - vec2 s0 = vec2(1.0/17.0, 0.0); - vec2 s1 = vec2(-1.0/29.0, 0.0); - vec2 s2 = vec2(1.0/101.0, 1.0/59.0); - vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); + float time = czm_frameNumber * animationSpeed; - // rotate sampling direction by specified angle - s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); - s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); - s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); - s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - vec2 uv0 = (uv/103.0) + (time * s0); - vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); - vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); - vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); + float specularMapValue = texture(specularMap, materialInput.st).r; - uv0 = fract(uv0); - uv1 = fract(uv1); - uv2 = fract(uv2); - uv3 = fract(uv3); - vec4 noise = (texture(normalMap, uv0)) + - (texture(normalMap, uv1)) + - (texture(normalMap, uv2)) + - (texture(normalMap, uv3)); + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - // average and scale to between -1 and 1 - return ((noise / 4.0) - 0.5) * 2.0; -} -`;var Yw=`/** - * Converts an HSB color (hue, saturation, brightness) to RGB - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} - * - * @name czm_HSBToRGB - * @glslFunction - * - * @param {vec3} hsb The color in HSB. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); - */ + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; -const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); -vec3 czm_HSBToRGB(vec3 hsb) + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function Xe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,un.LINEAR),this._magnificationFilter=y(e.magnificationFilter,Ci.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,oSe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Xe._uniformList[this.type])||(Xe._uniformList[this.type]=Object.keys(this._uniforms))}Xe._uniformList={};Xe.fromType=function(e,t){let n=new Xe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Xe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i-1)return!0;return!1}function uSe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); - return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&lSe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${o} = ${t[o]}; +`}e.shaderSource+=`return material; } -`;var qw=`/** - * Converts an HSL color (hue, saturation, lightness) to RGB - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} - * - * @name czm_HSLToRGB - * @glslFunction - * - * @param {vec3} rgb The color in HSL. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); - */ +`}}var NZ={mat2:eo,mat3:Z,mat4:L},fSe=/\.ktx2$/i;function dSe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Xe.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new hn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Lt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Lt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof Se;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:Se.createIfNeeded(r),g;fSe.test(p.url)?g=sl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function mSe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ha){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Xe.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Se.createIfNeeded(i.positiveX).fetchImage(),Se.createIfNeeded(i.negativeX).fetchImage(),Se.createIfNeeded(i.positiveY).fetchImage(),Se.createIfNeeded(i.negativeY).fetchImage(),Se.createIfNeeded(i.positiveZ).fetchImage(),Se.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function hSe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&FZ(e,n)}function FZ(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=pSe(o),s;if(r==="channels")s=Kv(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;gSe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},FZ(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=Kv(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(dSe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(mSe(t));else if(r.indexOf("mat")!==-1){let u=new NZ[r];e._uniforms[c]=function(){return NZ[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function pSe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Xe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function _Se(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Xe({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=_t(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;Kv(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=Kv(e,i,a)}}function Kv(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function gSe(e,t,n){return Kv(e,t,t,n)}Xe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Xe.DefaultImageId="czm_defaultImage";Xe.DefaultCubeMapId="czm_defaultCubeMap";Xe.ColorType="Color";Xe._materialCache.addMaterial(Xe.ColorType,{fabric:{type:Xe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.ImageType="Image";Xe._materialCache.addMaterial(Xe.ImageType,{fabric:{type:Xe.ImageType,uniforms:{image:Xe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.DiffuseMapType="DiffuseMap";Xe._materialCache.addMaterial(Xe.DiffuseMapType,{fabric:{type:Xe.DiffuseMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.AlphaMapType="AlphaMap";Xe._materialCache.addMaterial(Xe.AlphaMapType,{fabric:{type:Xe.AlphaMapType,uniforms:{image:Xe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Xe.SpecularMapType="SpecularMap";Xe._materialCache.addMaterial(Xe.SpecularMapType,{fabric:{type:Xe.SpecularMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Xe.EmissionMapType="EmissionMap";Xe._materialCache.addMaterial(Xe.EmissionMapType,{fabric:{type:Xe.EmissionMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.BumpMapType="BumpMap";Xe._materialCache.addMaterial(Xe.BumpMapType,{fabric:{type:Xe.BumpMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:Rv},translucent:!1});Xe.NormalMapType="NormalMap";Xe._materialCache.addMaterial(Xe.NormalMapType,{fabric:{type:Xe.NormalMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:Vv},translucent:!1});Xe.GridType="Grid";Xe._materialCache.addMaterial(Xe.GridType,{fabric:{type:Xe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:Uv},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Xe.StripeType="Stripe";Xe._materialCache.addMaterial(Xe.StripeType,{fabric:{type:Xe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:Yv},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Xe.CheckerboardType="Checkerboard";Xe._materialCache.addMaterial(Xe.CheckerboardType,{fabric:{type:Xe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:Mv},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.DotType="Dot";Xe._materialCache.addMaterial(Xe.DotType,{fabric:{type:Xe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:Lv},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.WaterType="Water";Xe._materialCache.addMaterial(Xe.WaterType,{fabric:{type:Xe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Xe.DefaultImageId,normalMap:Xe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:Xv},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Xe.RimLightingType="RimLighting";Xe._materialCache.addMaterial(Xe.RimLightingType,{fabric:{type:Xe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:jv},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Xe.FadeType="Fade";Xe._materialCache.addMaterial(Xe.FadeType,{fabric:{type:Xe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:kv},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Xe.PolylineArrowType="PolylineArrow";Xe._materialCache.addMaterial(Xe.PolylineArrowType,{fabric:{type:Xe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:zv},translucent:!0});Xe.PolylineDashType="PolylineDash";Xe._materialCache.addMaterial(Xe.PolylineDashType,{fabric:{type:Xe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:Hv},translucent:!0});Xe.PolylineGlowType="PolylineGlow";Xe._materialCache.addMaterial(Xe.PolylineGlowType,{fabric:{type:Xe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:Gv},translucent:!0});Xe.PolylineOutlineType="PolylineOutline";Xe._materialCache.addMaterial(Xe.PolylineOutlineType,{fabric:{type:Xe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:Wv},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Xe.ElevationContourType="ElevationContour";Xe._materialCache.addMaterial(Xe.ElevationContourType,{fabric:{type:Xe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:Fv},translucent:!1});Xe.ElevationRampType="ElevationRamp";Xe._materialCache.addMaterial(Xe.ElevationRampType,{fabric:{type:Xe.ElevationRampType,uniforms:{image:Xe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:Bv},translucent:!1});Xe.SlopeRampMaterialType="SlopeRamp";Xe._materialCache.addMaterial(Xe.SlopeRampMaterialType,{fabric:{type:Xe.SlopeRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:qv},translucent:!1});Xe.AspectRampMaterialType="AspectRamp";Xe._materialCache.addMaterial(Xe.AspectRampMaterialType,{fabric:{type:Xe.AspectRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:Ov},translucent:!1});Xe.ElevationBandType="ElevationBand";Xe._materialCache.addMaterial(Xe.ElevationBandType,{fabric:{type:Xe.ElevationBandType,uniforms:{heights:Xe.DefaultImageId,colors:Xe.DefaultImageId},source:Nv},translucent:!0});var zi=Xe;function L0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,L0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(L0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});L0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;L0.prototype.isTranslucent=no.prototype.isTranslucent;L0.prototype.getRenderState=no.prototype.getRenderState;L0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Me.POSITION_AND_NORMAL,vertexShaderSource:Ev,fragmentShaderSource:Av}),TEXTURED:Object.freeze({vertexFormat:Me.POSITION_NORMAL_AND_ST,vertexShaderSource:vv,fragmentShaderSource:Sv}),ALL:Object.freeze({vertexFormat:Me.ALL,vertexShaderSource:Tv,fragmentShaderSource:Cv})};var ao=L0;var Jv=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; -vec3 hueToRGB(float hue) +void main() { - float r = abs(hue * 6.0 - 3.0) - 1.0; - float g = 2.0 - abs(hue * 6.0 - 2.0); - float b = 2.0 - abs(hue * 6.0 - 4.0); - return clamp(vec3(r, g, b), 0.0, 1.0); + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); } +`;var Zv=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; -vec3 czm_HSLToRGB(vec3 hsl) +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() { - vec3 rgb = hueToRGB(hsl.x); - float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; - return (rgb - 0.5) * c + hsl.z; + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var Xw=`/** - * Adjusts the hue of a color. - * - * @name czm_hue - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the hue of the color in radians. - * - * @returns {float} The color with the hue adjusted. - * - * @example - * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) - */ -vec3 czm_hue(vec3 rgb, float adjustment) +`;var N0=`in vec4 v_color; + +void main() { - const mat3 toYIQ = mat3(0.299, 0.587, 0.114, - 0.595716, -0.274453, -0.321263, - 0.211456, -0.522591, 0.311135); - const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, - 1.0, -0.2721, -0.6474, - 1.0, -1.107, 1.7046); - - vec3 yiq = toYIQ * rgb; - float hue = atan(yiq.z, yiq.y) + adjustment; - float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); - - vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); - return toRGB * color; + out_FragColor = czm_gammaCorrect(v_color); } -`;var Kw=`/** - * Converts a color in linear space to RGB space. +`;var $v=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Qh(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?$v:Zv,r=i?N0:Jv,s=i?Qh.FLAT_VERTEX_FORMAT:Qh.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Qh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Qh.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;Qh.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;Qh.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Qh.prototype.isTranslucent=no.prototype.isTranslucent;Qh.prototype.getRenderState=no.prototype.getRenderState;var an=Qh;function mT(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(mT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});mT.prototype.getType=function(e){return"Color"};mT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};mT.prototype.equals=function(e){return this===e||e instanceof mT&&q.equals(this._color,e._color)};var Ut=mT;function sg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new vi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(sg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});sg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var Hi=sg;var BZ=new m,kZ=new m,UZ=new me,f8=new m,ySe=new m,VZ=new ae,xSe=new Hi,Qv=[new me,new me,new me,new me],ew=new H,Br={};Br.initialize=function(){let e=Br._initPromise;return l(e)||(e=Se.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Br._terrainHeights=t}),Br._initPromise=e),e};Br.getMinimumMaximumHeights=function(e,t){t=y(t,oe.WGS84);let n=zZ(e),i=Br._defaultMinTerrainHeight,o=Br._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Br._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,UZ),BZ),t.cartographicToCartesian(ce.southwest(e,UZ),kZ),m.midpoint(kZ,BZ,f8);let a=t.scaleToGeodeticSurface(f8,ySe);if(l(a)){let c=m.distance(f8,a);i=Math.min(i,-c)}else i=Br._defaultMinTerrainHeight}return i=Math.max(Br._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Br.getBoundingSphere=function(e,t){t=y(t,oe.WGS84);let n=zZ(e),i=Br._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Br._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,VZ),ae.union(o,VZ,o)};function zZ(e){me.fromRadians(e.east,e.north,0,Qv[0]),me.fromRadians(e.west,e.north,0,Qv[1]),me.fromRadians(e.east,e.south,0,Qv[2]),me.fromRadians(e.west,e.south,0,Qv[3]);let t=0,n=0,i=0,o=0,r=Br._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=Qv[c];if(xSe.positionToTileXY(u,s,ew),c===0)i=ew.x,o=ew.y;else if(i!==ew.x||o!==ew.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Br._terrainHeightsMaxLevel=6;Br._defaultMaxTerrainHeight=9e3;Br._defaultMinTerrainHeight=-1e5;Br._terrainHeights=void 0;Br._initPromise=void 0;Object.defineProperties(Br,{initialized:{get:function(){return l(Br._terrainHeights)}}});var oi=Br;var HZ={};function tw(e,t){l(HZ[e])||(HZ[e]=!0,console.warn(y(t,e)))}tw.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";tw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";tw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";tw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Nt=tw;function bSe(e,t){Nt(e,t)}var Q=bSe;function Cc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Cc.fromCorners=function(e,t,n){return l(n)||(n=new Cc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Cc.fromPoints=function(e,t){if(l(t)||(t=new Cc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d0?tn.INSIDE:r+o<0?tn.OUTSIDE:tn.INTERSECTING};Cc.prototype.clone=function(e){return Cc.clone(this,e)};Cc.prototype.intersectPlane=function(e){return Cc.intersectPlane(this,e)};Cc.prototype.equals=function(e){return Cc.equals(this,e)};var ag=Cc;var d8={};d8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function GZ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))u&&u/c0?[a/e,n/a]:[n/a,a/e]};var Tc=d8;var h8={};h8.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function m8(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,g=o*a-r*s,h=r*a-d,x=4*p*h-g*g,b,C;if(x<0){let Y,j,$;f*u>=c*d?(Y=o,j=p,$=-2*r*p+o*g):(Y=a,j=h,$=-a*g+2*s*h);let K=-($<0?-1:1)*Math.abs(Y)*Math.sqrt(-x);C=-$+K;let J=C/2,he=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),ge=C===K?-he:-j/he;return b=j<=0?he+ge:-$/(he*he+ge*ge+j),f*u>=c*d?[(b-r)/o]:[-a/(b+s)]}let T=p,A=-2*r*p+o*g,S=h,v=-a*g+2*s*h,I=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*I,-A)/3);b=2*Math.sqrt(-T);let N=Math.cos(R);C=b*N;let F=b*(-N/2-O*Math.sin(R)),_=C+F>2*r?C-r:F-r,E=o,w=_/E;R=Math.abs(Math.atan2(a*I,-v)/3),b=2*Math.sqrt(-S),N=Math.cos(R),C=b*N,F=b*(-N/2-O*Math.sin(R));let D=-a,M=C+F<2*s?C+s:F+s,B=D/M,V=E*M,U=-_*M-E*D,G=_*D,k=(s*U-r*G)/(-r*U+s*V);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}h8.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Tc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Tc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return m8(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):m8(e,t,0,i);if(i===0)return o=Tc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return m8(e,t,n,i)};var F0=h8;var p8={};p8.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,h=g*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*h+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function sd(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=F0.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)=0&&g>=0){let x=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,g=(r+f+s/d)/2,h=Tc.computeRealRoots(1,d,p),x=Tc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,h[1]<=x[0]?[h[0],h[1],x[0],x[1]]:x[1]<=h[0]?[x[0],x[1],h[0],h[1]]:h[0]>=x[0]&&h[1]<=x[1]?[x[0],h[0],h[1],x[1]]:x[0]>=h[0]&&x[1]<=h[1]?[h[0],x[0],x[1],h[1]]:h[0]>x[0]&&h[0]0){let d=f[0],p=t-d,g=p*p,h=e/2,x=p/2,b=g-4*i,C=g+4*Math.abs(i),T=s-4*d,A=s+4*Math.abs(d),S,v;if(d<0||b*A=_[0]&&F[1]<=_[1]?[_[0],F[0],F[1],_[1]]:_[0]>=F[0]&&_[1]<=F[1]?[F[0],_[0],_[1],F[1]]:F[0]>_[0]&&F[0]<_[1]?[_[0],F[0],_[1],F[1]]:[F[0],_[0],F[1],_[1]]:F;if(_.length!==0)return _}return[]}p8.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)f)||(p=m.cross(d,a,jZ),h=m.dot(s,p),h<0||g+h>f))return;x=m.dot(c,p)/f}else{if(Math.abs(f)1||(p=m.cross(d,a,jZ),h=m.dot(s,p)*b,h<0||g+h>1))return;x=m.dot(c,p)*b}return x};ir.rayTriangle=function(e,t,n,i,o,r){let s=ir.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var ASe=new wn;ir.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=ASe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=ir.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function ESe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var wSe=new m,ISe=new m;ir.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,wSe),o=m.multiplyComponents(n,e.direction,ISe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),u=c*a,pu){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,x=a/d;return h0?g.push(new m(i,o*N,o*-E)):E!==0?(g.push(new m(i,o*N,o*-E)),g.push(new m(i,o*N,o*E)),++R):g.push(new m(i,o*N,o*E))}return g}var _8=new m,qZ=new m,YZ=new m,Q3=new m,PSe=new m,OSe=new Z,RSe=new Z,MSe=new Z,LSe=new Z,NSe=new Z,XZ=new Z,KZ=new Z,JZ=new m,FSe=new m,BSe=new me;ir.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,_8);if(m.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,_8),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,Q3),c=m.normalize(m.cross(a,s,qZ),qZ),u=m.normalize(m.cross(s,c,YZ),YZ),f=OSe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,RSe),p=Z.fromScale(t.radii,MSe),g=Z.fromScale(t.oneOverRadii,LSe),h=NSe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let x=Z.multiply(Z.multiply(d,g,XZ),h,XZ),b=Z.multiply(Z.multiply(x,p,KZ),f,KZ),C=Z.multiplyByVector(x,n,PSe),T=DSe(b,m.negate(C,_8),0,0,1),A,S,v=T.length;if(v>0){let I=m.clone(m.ZERO,FSe),O=Number.NEGATIVE_INFINITY;for(let N=0;NO&&(O=_,I=m.clone(A,I))}let R=t.cartesianToCartographic(I,BSe);return O=P.clamp(O,0,1),S=m.magnitude(m.subtract(I,n,Q3))*Math.sqrt(1-O*O),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new m)}};var kSe=new m;ir.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,kSe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};ir.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return ir.lineSegmentPlane(e,t,i,f),ir.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return ir.lineSegmentPlane(t,n,i,f),ir.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return ir.lineSegmentPlane(n,e,i,f),ir.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return ir.lineSegmentPlane(e,n,i,f),ir.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return ir.lineSegmentPlane(n,t,i,f),ir.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return ir.lineSegmentPlane(t,e,i,f),ir.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var Ji=ir;function bs(e,t){this.normal=m.clone(e),this.distance=t}bs.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new bs(t,i)};var USe=new m;bs.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,USe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new bs(n,i)};bs.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var VSe=new m;bs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=bs.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,VSe);return m.subtract(t,o,n)};var zSe=new L,HSe=new re,GSe=new m;bs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=L.inverseTranspose(t,zSe),s=re.fromElements(i.x,i.y,i.z,o,HSe);s=L.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,GSe);return s=re.divideByScalar(s,m.magnitude(a),s),bs.fromCartesian4(s,n)};bs.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new bs(e.normal,e.distance)};bs.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};bs.ORIGIN_XY_PLANE=Object.freeze(new bs(m.UNIT_Z,0));bs.ORIGIN_YZ_PLANE=Object.freeze(new bs(m.UNIT_X,0));bs.ORIGIN_ZX_PLANE=Object.freeze(new bs(m.UNIT_Y,0));var fn=bs;var g8=new re;function Om(e,t){t=y(t,oe.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(L.getColumn(n,0,g8)),this._yAxis=m.fromCartesian4(L.getColumn(n,1,g8));let i=m.fromCartesian4(L.getColumn(n,2,g8));this._plane=fn.fromPointNormal(e,i)}Object.defineProperties(Om.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var WSe=new ag;Om.fromPoints=function(e,t){let n=ag.fromPoints(e,WSe);return new Om(n.center,t)};var QZ=new wn,ek=new m;Om.prototype.projectPointOntoPlane=function(e,t){let n=QZ;n.origin=e,m.normalize(e,n.direction);let i=Ji.rayPlane(n,this._plane,ek);if(l(i)||(m.negate(n.direction,n.direction),i=Ji.rayPlane(n,this._plane,ek)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new H(r,s)}};Om.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:O.latitude,E=me.fromRadians(F,e.north,n,nve),w=me.fromRadians(e.west,e.north,n,ive),D=me.fromRadians(e.west,_,n,ove),M=me.fromRadians(e.west,e.south,n,rve),B=me.fromRadians(F,e.south,n,sve),V=i.cartographicToCartesian(E,ave),U=i.cartographicToCartesian(w,n$),G=i.cartographicToCartesian(D,cve),k=i.cartographicToCartesian(M,i$),Y=i.cartographicToCartesian(B,lve),j=N.projectPointToNearestOnPlane(V,uve),$=N.projectPointToNearestOnPlane(U,fve),W=N.projectPointToNearestOnPlane(G,dve),K=N.projectPointToNearestOnPlane(k,mve),J=N.projectPointToNearestOnPlane(Y,hve);return r=Math.min($.x,W.x,K.x),s=-r,c=Math.max($.y,j.y),a=Math.min(K.y,J.y),w.height=M.height=t,U=i.cartographicToCartesian(w,n$),k=i.cartographicToCartesian(M,i$),u=Math.min(fn.getPointDistance(d,U),fn.getPointDistance(d,k)),f=n,e$(N.origin,N.xAxis,N.yAxis,N.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,x=ce.center(e,t$).longitude,b=m.fromRadians(x,h,n,i,pve);b.z=0;let T=Math.abs(b.x)=c?tn.INSIDE:tn.INTERSECTING};var s$=new m,a$=new m,c$=new m,Eve=new m,o$=new m,Sve=new m;Li.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,r$),i=e.halfAxes,o=Z.getColumn(i,0,s$),r=Z.getColumn(i,1,a$),s=Z.getColumn(i,2,c$),a=m.magnitude(o),c=m.magnitude(r),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(o,a,o):f=!1,c>0?m.divideByScalar(r,c,r):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,x,b;if(g===1){let S=o;h=r,x=s,d?p||(S=s,x=o):(S=r,h=o),b=m.cross(h,x,o$),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){h=o,d?h=r:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),x=m.cross(h,S,Eve),m.normalize(x,x),b=m.cross(h,x,o$),m.normalize(b,b),h===o?(r=x,s=b):h===r?(s=x,o=b):h===s&&(o=x,r=b)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=Sve;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let T=0,A;return C.x<-a?(A=C.x+a,T+=A*A):C.x>a&&(A=C.x-a,T+=A*A),C.y<-c?(A=C.y+c,T+=A*A):C.y>c&&(A=C.y-c,T+=A*A),C.z<-u?(A=C.z+u,T+=A*A):C.z>u&&(A=C.z-u,T+=A*A),T};var vve=new m,wve=new m;Li.computePlaneDistances=function(e,t,n,i){l(i)||(i=new bc);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,s$),u=Z.getColumn(a,1,a$),f=Z.getColumn(a,2,c$),d=m.add(c,u,vve);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,wve),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var Ive=new m,Dve=new m,Pve=new m;Li.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=Z.getColumn(i,0,Ive),r=Z.getColumn(i,1,Dve),s=Z.getColumn(i,2,Pve);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var Ove=new Z;Li.computeTransformation=function(e,t){l(t)||(t=new L);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,Ove);return L.fromRotationTranslation(i,n,t)};var Rve=new ae;Li.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,Rve);return!t.isBoundingSphereVisible(n)};Li.prototype.intersectPlane=function(e){return Li.intersectPlane(this,e)};Li.prototype.distanceSquaredTo=function(e){return Li.distanceSquaredTo(this,e)};Li.prototype.computePlaneDistances=function(e,t,n){return Li.computePlaneDistances(this,e,t,n)};Li.prototype.computeCorners=function(e){return Li.computeCorners(this,e)};Li.prototype.computeTransformation=function(e){return Li.computeTransformation(this,e)};Li.prototype.isOccluded=function(e){return Li.isOccluded(this,e)};Li.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Li.prototype.clone=function(e){return Li.clone(this,e)};Li.prototype.equals=function(e){return Li.equals(this,e)};var Ln=Li;var tk={};tk.getHeight=function(e,t,n){return(e-n)*t+n};var Mve=new m;tk.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Mve),s=tk.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Ac=tk;var pr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function ow(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Fe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ga(e,t){return(e._flags&t)===t}function cg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(ow.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ga(this,pr.CULL)},set:function(e){Ga(this,pr.CULL)!==e&&(cg(this,pr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ga(this,pr.OCCLUDE)},set:function(e){Ga(this,pr.OCCLUDE)!==e&&(cg(this,pr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ga(this,pr.CAST_SHADOWS)},set:function(e){Ga(this,pr.CAST_SHADOWS)!==e&&(cg(this,pr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ga(this,pr.RECEIVE_SHADOWS)},set:function(e){Ga(this,pr.RECEIVE_SHADOWS)!==e&&(cg(this,pr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ga(this,pr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ga(this,pr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(cg(this,pr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ga(this,pr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ga(this,pr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(cg(this,pr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Ga(this,pr.PICK_ONLY)},set:function(e){Ga(this,pr.PICK_ONLY)!==e&&(cg(this,pr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ga(this,pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ga(this,pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(cg(this,pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});ow.shallowClone=function(e,t){if(l(e))return l(t)||(t=new ow),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};ow.prototype.execute=function(e,t){e.draw(this,t)};var nt=ow;var Lve={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ae=Object.freeze(Lve);var nk={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};nk.validate=function(e){return e===nk.CLOCKWISE||e===nk.COUNTER_CLOCKWISE};var Jr=Object.freeze(nk);function l$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i0&&console.log(`${Lm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Lm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Lm}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Lm}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Lm}Vertex shader compile log: ${c}`),console.error(`${Lm} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Lm}Fragment shader compile log: ${c}`),console.error(`${Lm} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${Lm}${g} shader translation failed.`);return}console.error(`${Lm}Translated ${g} shaderSource: +${h}`)}}function Kve(e,t,n){let i={};for(let o=0;o=0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x - * This function only handles the lighting calculations. Metallic/roughness - * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} - *

+const float czm_passGlobe = 2.0; +`;var vw=`/** + * The automatic GLSL constant for {@link Pass#OPAQUE} * - * @name czm_pbrlighting - * @glslFunction + * @name czm_passOpaque + * @glslConstant * - * @param {vec3} positionEC The position of the fragment in eye coordinates - * @param {vec3} normalEC The surface normal in eye coordinates - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. - * @param {czm_pbrParameters} The computed PBR parameters. - * @return {vec3} The computed HDR color + * @see czm_pass + */ +const float czm_passOpaque = 7.0; +`;var ww=`/** + * The automatic GLSL constant for {@link Pass#OVERLAY} * - * @example - * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( - * baseColor, - * metallic, - * roughness - * ); - * vec3 color = czm_pbrlighting( - * positionEC, - * normalEC, - * lightDirectionEC, - * lightColorHdr, - * pbrParameters); + * @name czm_passOverlay + * @glslConstant + * + * @see czm_pass */ -vec3 czm_pbrLighting( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) -{ - vec3 v = -normalize(positionEC); - vec3 l = normalize(lightDirectionEC); - vec3 h = normalize(v + l); - vec3 n = normalEC; - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = abs(dot(n, v)) + 0.001; - float NdotH = clamp(dot(n, h), 0.0, 1.0); - float LdotH = clamp(dot(l, h), 0.0, 1.0); - float VdotH = clamp(dot(v, h), 0.0, 1.0); - - vec3 f0 = pbrParameters.f0; - float reflectance = max(max(f0.r, f0.g), f0.b); - vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(f0, f90, VdotH); - - float alpha = pbrParameters.roughness; - float G = smithVisibilityGGX(alpha, NdotL, NdotV); - float D = GGX(alpha, NdotH); - vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - - vec3 diffuseColor = pbrParameters.diffuseColor; - // F here represents the specular contribution - vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - - // Lo = (diffuse + specular) * Li * NdotL - return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; -} -`;var lD=`/** - * Compute parameters for physically based rendering using the - * metallic/roughness workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passOverlay = 10.0; +`;var Iw=`/** + * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * - * @name czm_pbrMetallicRoughnessMaterial - * @glslFunction + * @name czm_passTerrainClassification + * @glslConstant * - * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) - * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); - * @param {float} roughness A value between 0.0 and 1.0 - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrMetallicRoughnessMaterial( - vec3 baseColor, - float metallic, - float roughness -) -{ - czm_pbrParameters results; - - // roughness is authored as perceptual roughness - // square it to get material roughness - roughness = clamp(roughness, 0.0, 1.0); - results.roughness = roughness * roughness; - - // dielectrics use f0 = 0.04, metals use albedo as f0 - metallic = clamp(metallic, 0.0, 1.0); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); - results.f0 = f0; - - // diffuse only applies to dielectrics. - results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); - - return results; -} -`;var uD=`/** - * Compute parameters for physically based rendering using the - * specular/glossy workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passTerrainClassification = 3.0; +`;var Dw=`/** + * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * - * @name czm_pbrSpecularGlossinessMaterial - * @glslFunction + * @name czm_passTranslucent + * @glslConstant * - * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) - * @param {vec3} specular The reflectance at normal incidence (f0) - * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrSpecularGlossinessMaterial( - vec3 diffuse, - vec3 specular, - float glossiness -) -{ - czm_pbrParameters results; - - // glossiness is the opposite of roughness, but easier for artists to use. - float roughness = 1.0 - glossiness; - results.roughness = roughness * roughness; - - results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); - results.f0 = specular; - - return results; -} -`;var fD=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) -{ - return czm_getLambertDiffuse(lightDirectionEC, material.normal); -} - -float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) -{ - return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); -} - -/** - * Computes a color using the Phong lighting model. +const float czm_passTranslucent = 8.0; +`;var Pw=`/** + * The automatic GLSL constant for {@link Pass#VOXELS} * - * @name czm_phong - * @glslFunction + * @name czm_passVoxels + * @glslConstant * - * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. - * @param {czm_material} material The fragment's material. + * @see czm_pass + */ +const float czm_passVoxels = 9.0; +`;var Ow=`/** + * A built-in GLSL floating-point constant for Math.PI. * - * @returns {vec4} The computed color. + * @alias czm_pi + * @glslConstant + * + * @see CesiumMath.PI * * @example - * vec3 positionToEyeEC = // ... - * czm_material material = // ... - * vec3 lightDirectionEC = // ... - * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * // GLSL declaration + * const float czm_pi = ...; * - * @see czm_getMaterial + * // Example + * float twoPi = 2.0 * czm_pi; */ -vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - // Diffuse from directional light sources at eye (for top-down) - float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); - } - - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; - - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} - -vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - vec3 ambient = vec3(0.0); - vec3 color = ambient + material.emission; - color += material.diffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} -`;var dD=`/** - * Computes distance from a point to a plane. +const float czm_pi = 3.141592653589793; +`;var Rw=`/** + * A built-in GLSL floating-point constant for pi/4. * - * @name czm_planeDistance - * @glslFunction + * @alias czm_piOverFour + * @glslConstant * - * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. - */ -float czm_planeDistance(vec4 plane, vec3 point) { - return (dot(plane.xyz, point) + plane.w); -} - -/** - * Computes distance from a point to a plane. + * @see CesiumMath.PI_OVER_FOUR * - * @name czm_planeDistance - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverFour = ...; * - * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js - * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. + * // Example + * float pi = 4.0 * czm_piOverFour; */ -float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { - return (dot(planeNormal, point) + planeDistance); -} -`;var mD=`/** - * Computes the point along a ray at the given time. time can be positive, negative, or zero. +const float czm_piOverFour = 0.7853981633974483; +`;var Mw=`/** + * A built-in GLSL floating-point constant for pi/6. * - * @name czm_pointAlongRay - * @glslFunction + * @alias czm_piOverSix + * @glslConstant + * + * @see CesiumMath.PI_OVER_SIX * - * @param {czm_ray} ray The ray to compute the point along. - * @param {float} time The time along the ray. - * - * @returns {vec3} The point along the ray at the given time. - * * @example - * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction - * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) - */ -vec3 czm_pointAlongRay(czm_ray ray, float time) -{ - return ray.origin + (time * ray.direction); -} -`;var hD=`/** - * DOC_TBA + * // GLSL declaration + * const float czm_piOverSix = ...; * - * @name czm_rayEllipsoidIntersectionInterval - * @glslFunction + * // Example + * float pi = 6.0 * czm_piOverSix; */ -czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) -{ - // ray and ellipsoid center in eye coordinates. radii in model coordinates. - vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; - vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - - q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - - float q2 = dot(q, q); - float qw = dot(q, w); - - if (q2 > 1.0) // Outside ellipsoid. - { - if (qw >= 0.0) // Looking outward or tangent (0 intersections). - { - return czm_emptyRaySegment; - } - else // qw < 0.0. - { - float qw2 = qw * qw; - float difference = q2 - 1.0; // Positively valued. - float w2 = dot(w, w); - float product = w2 * difference; - - if (qw2 < product) // Imaginary roots (0 intersections). - { - return czm_emptyRaySegment; - } - else if (qw2 > product) // Distinct roots (2 intersections). - { - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Avoid cancellation. - float root0 = temp / w2; - float root1 = difference / temp; - if (root0 < root1) - { - czm_raySegment i = czm_raySegment(root0, root1); - return i; - } - else - { - czm_raySegment i = czm_raySegment(root1, root0); - return i; - } - } - else // qw2 == product. Repeated roots (2 intersections). - { - float root = sqrt(difference / w2); - czm_raySegment i = czm_raySegment(root, root); - return i; - } - } - } - else if (q2 < 1.0) // Inside ellipsoid (2 intersections). - { - float difference = q2 - 1.0; // Negatively valued. - float w2 = dot(w, w); - float product = w2 * difference; // Negatively valued. - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Positively valued. - czm_raySegment i = czm_raySegment(0.0, temp / w2); - return i; - } - else // q2 == 1.0. On ellipsoid. - { - if (qw < 0.0) // Looking inward. - { - float w2 = dot(w, w); - czm_raySegment i = czm_raySegment(0.0, -qw / w2); - return i; - } - else // qw >= 0.0. Looking outward or tangent. - { - return czm_emptyRaySegment; - } - } -} -`;var pD=`/** - * Compute the intersection interval of a ray with a sphere. +const float czm_piOverSix = 0.5235987755982988; +`;var Lw=`/** + * A built-in GLSL floating-point constant for pi/3. * - * @name czm_raySphereIntersectionInterval - * @glslFunction + * @alias czm_piOverThree + * @glslConstant * - * @param {czm_ray} ray The ray. - * @param {vec3} center The center of the sphere. - * @param {float} radius The radius of the sphere. - * @return {czm_raySegment} The intersection interval of the ray with the sphere. - */ -czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) -{ - vec3 o = ray.origin; - vec3 d = ray.direction; - - vec3 oc = o - center; - - float a = dot(d, d); - float b = 2.0 * dot(d, oc); - float c = dot(oc, oc) - (radius * radius); - - float det = (b * b) - (4.0 * a * c); - - if (det < 0.0) { - return czm_emptyRaySegment; - } - - float sqrtDet = sqrt(det); - - float t0 = (-b - sqrtDet) / (2.0 * a); - float t1 = (-b + sqrtDet) / (2.0 * a); - - czm_raySegment result = czm_raySegment(t0, t1); - return result; -} -`;var _D=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) -{ - return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var gD=`/** - * Reads a value previously transformed with {@link czm_writeNonPerspective} - * by dividing it by \`w\`, the value used in the perspective divide. - * This function is intended to be called in a fragment shader to access a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The value should have been - * previously written in the vertex shader with a call to - * {@link czm_writeNonPerspective}. + * @see CesiumMath.PI_OVER_THREE * - * @name czm_readNonPerspective - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverThree = ...; * - * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. - * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. - * @returns {float|vec2|vec3|vec4} The usable value. + * // Example + * float pi = 3.0 * czm_piOverThree; */ -float czm_readNonPerspective(float value, float oneOverW) { - return value * oneOverW; -} - -vec2 czm_readNonPerspective(vec2 value, float oneOverW) { - return value * oneOverW; -} - -vec3 czm_readNonPerspective(vec3 value, float oneOverW) { - return value * oneOverW; -} - -vec4 czm_readNonPerspective(vec4 value, float oneOverW) { - return value * oneOverW; -} -`;var yD=`float czm_reverseLogDepth(float logZ) -{ -#ifdef LOG_DEPTH - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - return far * (1.0 - near / (depthFromNear + near)) / (far - near); -#endif - return logZ; -} -`;var AD=`/** - * Converts an RGB color to HSB (hue, saturation, brightness) - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} +const float czm_piOverThree = 1.0471975511965976; +`;var Nw=`/** + * A built-in GLSL floating-point constant for pi/2. * - * @name czm_RGBToHSB - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * @alias czm_piOverTwo + * @glslConstant * - * @returns {vec3} The color in HSB. + * @see CesiumMath.PI_OVER_TWO * * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); + * // GLSL declaration + * const float czm_piOverTwo = ...; + * + * // Example + * float pi = 2.0 * czm_piOverTwo; */ - -const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - -vec3 czm_RGBToHSB(vec3 rgb) -{ - vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); - vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); - - float d = q.x - min(q.w, q.y); - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); -} -`;var xD=`/** - * Converts an RGB color to HSL (hue, saturation, lightness) - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} +const float czm_piOverTwo = 1.5707963267948966; +`;var Fw=`/** + * A built-in GLSL floating-point constant for converting degrees to radians. * - * @name czm_RGBToHSL - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * @alias czm_radiansPerDegree + * @glslConstant * - * @returns {vec3} The color in HSL. + * @see CesiumMath.RADIANS_PER_DEGREE * * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); + * // GLSL declaration + * const float czm_radiansPerDegree = ...; + * + * // Example + * float rad = czm_radiansPerDegree * deg; */ - -vec3 RGBtoHCV(vec3 rgb) -{ - // Based on work by Sam Hocevar and Emil Persson - vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); - vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); - float c = q.x - min(q.w, q.y); - float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); - return vec3(h, c, q.x); -} - -vec3 czm_RGBToHSL(vec3 rgb) -{ - vec3 hcv = RGBtoHCV(rgb); - float l = hcv.z - hcv.y * 0.5; - float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); - return vec3(hcv.x, s, l); -} -`;var CD=`/** - * Converts an RGB color to CIE Yxy. - *

The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - *

- * - * @name czm_RGBToXYZ - * @glslFunction - * - * @param {vec3} rgb The color in RGB. +const float czm_radiansPerDegree = 0.017453292519943295; +`;var Bw=`/** + * The constant identifier for the 2D {@link SceneMode} * - * @returns {vec3} The color in CIE Yxy. + * @name czm_sceneMode2D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing + */ +const float czm_sceneMode2D = 2.0; +`;var kw=`/** + * The constant identifier for the 3D {@link SceneMode} * - * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * @name czm_sceneMode3D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneModeMorphing */ -vec3 czm_RGBToXYZ(vec3 rgb) -{ - const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, - 0.3576, 0.7152, 0.1192, - 0.1805, 0.0722, 0.9505); - vec3 xyz = RGB2XYZ * rgb; - vec3 Yxy; - Yxy.r = xyz.g; - float temp = dot(vec3(1.0), xyz); - Yxy.gb = xyz.rg / temp; - return Yxy; -} -`;var TD=`/** - * Round a floating point value. This function exists because round() doesn't - * exist in GLSL 1.00. +const float czm_sceneMode3D = 3.0; +`;var Uw=`/** + * The constant identifier for the Columbus View {@link SceneMode} * - * @param {float|vec2|vec3|vec4} value The value to round - * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + * @name czm_sceneModeColumbusView + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing */ -float czm_round(float value) { - return floor(value + 0.5); -} - -vec2 czm_round(vec2 value) { - return floor(value + 0.5); -} - -vec3 czm_round(vec3 value) { - return floor(value + 0.5); -} - -vec4 czm_round(vec4 value) { - return floor(value + 0.5); -} -`;var ED=`/** - * Samples the 4 neighboring pixels and return the weighted average. +const float czm_sceneModeColumbusView = 1.0; +`;var Vw=`/** + * The constant identifier for the Morphing {@link SceneMode} * - * @private + * @name czm_sceneModeMorphing + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D */ -vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) -{ - direction /= dot(vec3(1.0), abs(direction)); - vec2 rev = abs(direction.zx) - vec2(1.0); - vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, - direction.z < 0.0 ? rev.y : -rev.y); - vec2 uv = direction.y < 0.0 ? neg : direction.xz; - vec2 coord = 0.5 * uv + vec2(0.5); - vec2 pixel = 1.0 / textureSize; - - if (lod > 0.0) - { - // Each subseqeuent mip level is half the size - float scale = 1.0 / pow(2.0, lod); - float offset = ((textureSize.y + 1.0) / textureSize.x); - - coord.x *= offset; - coord *= scale; - - coord.x += offset + pixel.x; - coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; - } - else - { - coord.x *= (textureSize.y / textureSize.x); - } - - // Do bilinear filtering - #ifndef OES_texture_float_linear - vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; - vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; - vec3 color3 = texture(projectedMap, coord + pixel).rgb; - vec3 color4 = texture(projectedMap, coord).rgb; - - vec2 texturePosition = coord * textureSize; - - float fu = fract(texturePosition.x); - float fv = fract(texturePosition.y); - - vec3 average1 = mix(color4, color2, fu); - vec3 average2 = mix(color1, color3, fu); - - vec3 color = mix(average1, average2, fv); - #else - vec3 color = texture(projectedMap, coord).rgb; - #endif - - return color; -} - - -/** - * Samples from a cube map that has been projected using an octahedral projection from the given direction. +const float czm_sceneModeMorphing = 0.0; +`;var zw=`/** + * A built-in GLSL floating-point constant for one solar radius. * - * @name czm_sampleOctahedralProjection - * @glslFunction + * @alias czm_solarRadius + * @glslConstant * - * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. - * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. - * @param {vec3} direction The normalized direction used to sample the cube map. - * @param {float} lod The level of detail to sample. - * @param {float} maxLod The maximum level of detail. - * @returns {vec3} The color of the cube map at the direction. + * @see CesiumMath.SOLAR_RADIUS + * + * @example + * // GLSL declaration + * const float czm_solarRadius = ...; */ -vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { - float currentLod = floor(lod + 0.5); - float nextLod = min(currentLod + 1.0, maxLod); - - vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); - vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); - - return mix(colorNextLod, colorCurrentLod, nextLod - lod); -} -`;var bD=`/** - * Adjusts the saturation of a color. - * - * @name czm_saturation - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the saturation of the color. +const float czm_solarRadius = 695500000.0; +`;var Hw=`/** + * A built-in GLSL floating-point constant for 3pi/2. * - * @returns {float} The color with the saturation adjusted. + * @alias czm_threePiOver2 + * @glslConstant + * + * @see CesiumMath.THREE_PI_OVER_TWO * * @example - * vec3 greyScale = czm_saturation(color, 0.0); - * vec3 doubleSaturation = czm_saturation(color, 2.0); + * // GLSL declaration + * const float czm_threePiOver2 = ...; + * + * // Example + * float pi = (2.0 / 3.0) * czm_threePiOver2; */ -vec3 czm_saturation(vec3 rgb, float adjustment) -{ - // Algorithm from Chapter 16 of OpenGL Shading Language - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - vec3 intensity = vec3(dot(rgb, W)); - return mix(intensity, rgb, adjustment); -} -`;var SD=` -float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) -{ - return czm_unpackDepth(czm_textureCube(shadowMap, d)); -} - -float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) -{ -#ifdef USE_SHADOW_DEPTH_TEXTURE - return texture(shadowMap, uv).r; -#else - return czm_unpackDepth(texture(shadowMap, uv)); -#endif -} - -float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} - -float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} -`;var vD=` -float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) -{ -#ifdef USE_NORMAL_SHADING -#ifdef USE_NORMAL_SHADING_SMOOTH - float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); -#else - float strength = step(0.0, nDotL); -#endif - visibility *= strength; -#endif - - visibility = max(visibility, darkness); - return visibility; -} - -#ifdef USE_CUBE_MAP_SHADOW -float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec3 uvw = shadowParameters.texCoords; - - depth -= depthBias; - float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#else -float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec2 uv = shadowParameters.texCoords; - - depth -= depthBias; -#ifdef USE_SOFT_SHADOWS - vec2 texelStepSize = shadowParameters.texelStepSize; - float radius = 1.0; - float dx0 = -texelStepSize.x * radius; - float dy0 = -texelStepSize.y * radius; - float dx1 = texelStepSize.x * radius; - float dy1 = texelStepSize.y * radius; - float visibility = ( - czm_shadowDepthCompare(shadowMap, uv, depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) - ) * (1.0 / 9.0); -#else - float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); -#endif - - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#endif -`;var wD=`/** - * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL - * built-in function sign except that returns 1.0 instead of 0.0 when the input value is 0.0. - * - * @name czm_signNotZero - * @glslFunction +const float czm_threePiOver2 = 4.71238898038469; +`;var Gw=`/** + * A built-in GLSL floating-point constant for 2pi. * - * @param {} value The value for which to determine the sign. - * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. - */ -float czm_signNotZero(float value) -{ - return value >= 0.0 ? 1.0 : -1.0; -} - -vec2 czm_signNotZero(vec2 value) -{ - return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); -} - -vec3 czm_signNotZero(vec3 value) -{ - return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); -} - -vec4 czm_signNotZero(vec4 value) -{ - return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); -} -`;var DD=`/** - * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. - *

- * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. - *

+ * @alias czm_twoPi + * @glslConstant * - * @name czm_sphericalHarmonics - * @glslFunction + * @see CesiumMath.TWO_PI * - * @param {vec3} normal The normalized direction. - * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. - * @returns {vec3} The color at the direction. + * @example + * // GLSL declaration + * const float czm_twoPi = ...; * - * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + * // Example + * float pi = czm_twoPi / 2.0; */ -vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) -{ - vec3 L00 = coefficients[0]; - vec3 L1_1 = coefficients[1]; - vec3 L10 = coefficients[2]; - vec3 L11 = coefficients[3]; - vec3 L2_2 = coefficients[4]; - vec3 L2_1 = coefficients[5]; - vec3 L20 = coefficients[6]; - vec3 L21 = coefficients[7]; - vec3 L22 = coefficients[8]; - - float x = normal.x; - float y = normal.y; - float z = normal.z; - - return - L00 - + L1_1 * y - + L10 * z - + L11 * x - + L2_2 * (y * x) - + L2_1 * (y * z) - + L20 * (3.0 * z * z - 1.0) - + L21 * (z * x) - + L22 * (x * x - y * y); -} -`;var ID=`/** - * Converts an sRGB color to a linear RGB color. +const float czm_twoPi = 6.283185307179586; +`;var Ww=`/** + * The maximum latitude, in radians, both North and South, supported by a Web Mercator + * (EPSG:3857) projection. Technically, the Mercator projection is defined + * for any latitude up to (but not including) 90 degrees, but it makes sense + * to cut it off sooner because it grows exponentially with increasing latitude. + * The logic behind this particular cutoff value, which is the one used by + * Google Maps, Bing Maps, and Esri, is that it makes the projection + * square. That is, the rectangle is equal in the X and Y directions. * - * @param {vec3|vec4} srgbIn The color in sRGB space - * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + * The constant value is computed as follows: + * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) + * + * @name czm_webMercatorMaxLatitude + * @glslConstant */ -vec3 czm_srgbToLinear(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -vec4 czm_srgbToLinear(vec4 srgbIn) +const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var jw=`/** + * @name czm_depthRangeStruct + * @glslStruct + */ +struct czm_depthRangeStruct { - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} -`;var PD=`/** - * Creates a matrix that transforms vectors from tangent space to eye space. - * - * @name czm_tangentToEyeSpaceMatrix - * @glslFunction - * - * @param {vec3} normalEC The normal vector in eye coordinates. - * @param {vec3} tangentEC The tangent vector in eye coordinates. - * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + float near; + float far; +}; +`;var qw=`/** + * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * - * @returns {mat3} The matrix that transforms from tangent space to eye space. + * @name czm_material + * @glslStruct * - * @example - * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); - * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} specular Intensity of incoming light reflecting in a single direction. + * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. */ -mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +struct czm_material { - vec3 normal = normalize(normalEC); - vec3 tangent = normalize(tangentEC); - vec3 bitangent = normalize(bitangentEC); - return mat3(tangent.x , tangent.y , tangent.z, - bitangent.x, bitangent.y, bitangent.z, - normal.x , normal.y , normal.z); -} -`;var OD=`/** - * A wrapper around the texture (WebGL2) / textureCube (WebGL1) - * function to allow for WebGL 1 support. - * - * @name czm_textureCube - * @glslFunction + vec3 diffuse; + float specular; + float shininess; + vec3 normal; + vec3 emission; + float alpha; +}; +`;var Yw=`/** + * Used as input to every material's czm_getMaterial function. * - * @param {samplerCube} sampler The sampler. - * @param {vec3} p The coordinates to sample the texture at. - */ -vec4 czm_textureCube(samplerCube sampler, vec3 p) { -#if __VERSION__ == 300 - return texture(sampler, p); -#else - return textureCube(sampler, p); -#endif -}`;var RD=`/** - * Transforms a plane. - * - * @name czm_transformPlane - * @glslFunction + * @name czm_materialInput + * @glslStruct * - * @param {vec4} plane The plane in Hessian Normal Form. - * @param {mat4} transform The inverse-transpose of a transformation matrix. + * @property {float} s 1D texture coordinates. + * @property {vec2} st 2D texture coordinates. + * @property {vec3} str 3D texture coordinates. + * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. + * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. + * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. + * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. + * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. + * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. */ -vec4 czm_transformPlane(vec4 plane, mat4 transform) { - vec4 transformedPlane = transform * plane; - // Convert the transformed plane to Hessian Normal Form - float normalMagnitude = length(transformedPlane.xyz); - return transformedPlane / normalMagnitude; -} -`;var MD=`/** - * Translates a position (or any vec3) that was encoded with {@link EncodedCartesian3}, - * and then provided to the shader as separate high and low bits to - * be relative to the eye. As shown in the example, the position can then be transformed in eye - * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, - * respectively. +struct czm_materialInput +{ + float s; + vec2 st; + vec3 str; + vec3 normalEC; + mat3 tangentToEyeMatrix; + vec3 positionToEyeEC; + float height; + float slope; + float aspect; +}; +`;var Xw=`/** + * Struct for representing a material for a {@link Model}. The model + * rendering pipeline will pass this struct between material, custom shaders, + * and lighting stages. This is not to be confused with {@link czm_material} + * which is used by the older Fabric materials system, although they are similar. *

- * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as - * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + * All color values (diffuse, specular, emissive) are in linear color space. *

* - * @name czm_translateRelativeToEye - * @glslFunction + * @name czm_modelMaterial + * @glslStruct * - * @param {vec3} high The position's high bits. - * @param {vec3} low The position's low bits. - * @returns {vec3} The position translated to be relative to the camera's position. + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. + * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. + * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. + * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. + * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + */ +struct czm_modelMaterial { + vec3 diffuse; + float alpha; + vec3 specular; + float roughness; + vec3 normalEC; + float occlusion; + vec3 emissive; +}; +`;var Kw=`/** + * Struct for representing the output of a custom vertex shader. + * + * @name czm_modelVertexOutput + * @glslStruct * - * @example - * in vec3 positionHigh; - * in vec3 positionLow; + * @see {@link CustomShader} + * @see {@link Model} * - * void main() - * { - * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * } + * @property {vec3} positionMC The position of the vertex in model coordinates + * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. + */ +struct czm_modelVertexOutput { + vec3 positionMC; + float pointSize; +}; +`;var Jw=`/** + * Parameters for {@link czm_pbrLighting} * - * @see czm_modelViewRelativeToEye - * @see czm_modelViewProjectionRelativeToEye - * @see czm_computePosition - * @see EncodedCartesian3 + * @name czm_material + * @glslStruct + * + * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation + * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. + * @property {vec3} f0 The reflectance of the material at normal incidence */ -vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +struct czm_pbrParameters { - vec3 highDifference = high - czm_encodedCameraPositionMCHigh; - vec3 lowDifference = low - czm_encodedCameraPositionMCLow; + vec3 diffuseColor; + float roughness; + vec3 f0; +}; +`;var Zw=`/** + * DOC_TBA + * + * @name czm_ray + * @glslStruct + */ +struct czm_ray +{ + vec3 origin; + vec3 direction; +}; +`;var $w=`/** + * DOC_TBA + * + * @name czm_raySegment + * @glslStruct + */ +struct czm_raySegment +{ + float start; + float stop; +}; - return vec4(highDifference + lowDifference, 1.0); -} -`;var BD=`/** - * @private +/** + * DOC_TBA + * + * @name czm_emptyRaySegment + * @glslConstant */ -vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + +/** + * DOC_TBA + * + * @name czm_fullRaySegment + * @glslConstant + */ +const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); +`;var Qw=`struct czm_shadowParameters { - // Diffuse from directional light sources at eye (for top-down and horizon views) - float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +#ifdef USE_CUBE_MAP_SHADOW + vec3 texCoords; +#else + vec2 texCoords; +#endif - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); - } + float depthBias; + float depth; + float nDotL; + vec2 texelStepSize; + float normalShadingSmooth; + float darkness; +}; +`;var eI=`// See: +// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ - diffuse = clamp(diffuse, 0.0, 1.0); +vec3 czm_acesTonemapping(vec3 color) { + float g = 0.985; + float a = 0.065; + float b = 0.0001; + float c = 0.433; + float d = 0.238; - float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); + color = (color * (color + a) - b) / (color * (g * color + c) + d); - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; + color = clamp(color, 0.0, 1.0); - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; + return color; +} +`;var tI=`/** + * @private + */ +float czm_alphaWeight(float a) +{ + float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - return vec4(color, material.alpha); + // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: + // http://jcgt.org/published/0002/02/09/ + return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } -`;var LD=`/** - * Returns the transpose of the matrix. The input matrix can be - * a mat2, mat3, or mat4. +`;var nI=`/** + * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * - * @name czm_transpose + * @name czm_antialias * @glslFunction * - * @param {} matrix The matrix to transpose. - * - * @returns {} The transposed matrix. + * @param {vec4} color1 The color on one side of the edge. + * @param {vec4} color2 The color on the other side of the edge. + * @param {vec4} currentcolor The current color, either color1 or color2. + * @param {float} dist The distance to the edge in texture coordinates. + * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. + * @returns {vec4} The anti-aliased color. * * @example * // GLSL declarations - * mat2 czm_transpose(mat2 matrix); - * mat3 czm_transpose(mat3 matrix); - * mat4 czm_transpose(mat4 matrix); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); * - * // Transpose a 3x3 rotation matrix to find its inverse. - * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( - * positionMC, normalEC); - * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space + * float dist = abs(textureCoordinates.t - 0.5); + * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); + * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); */ -mat2 czm_transpose(mat2 matrix) -{ - return mat2( - matrix[0][0], matrix[1][0], - matrix[0][1], matrix[1][1]); -} - -mat3 czm_transpose(mat3 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { - return mat3( - matrix[0][0], matrix[1][0], matrix[2][0], - matrix[0][1], matrix[1][1], matrix[2][1], - matrix[0][2], matrix[1][2], matrix[2][2]); + float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); + float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); + val1 = val1 * (1.0 - val2); + val1 = val1 * val1 * (3.0 - (2.0 * val1)); + val1 = pow(val1, 0.5); //makes the transition nicer + + vec4 midColor = (color1 + color2) * 0.5; + return mix(midColor, currentColor, val1); } -mat4 czm_transpose(mat4 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { - return mat4( - matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], - matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], - matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], - matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); + return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var ND=`/** - * Unpacks a vec4 depth value to a float in [0, 1) range. +`;var iI=`/** + * Approximately computes spherical coordinates given a normal. + * Uses approximate inverse trigonometry for speed and consistency, + * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. * - * @name czm_unpackDepth + * @name czm_approximateSphericalCoordinates * @glslFunction * - * @param {vec4} packedDepth The packed depth. + * @param {vec3} normal arbitrary-length normal. * - * @returns {float} The floating-point depth in [0, 1) range. + * @returns {vec2} Approximate latitude and longitude spherical coordinates. */ - float czm_unpackDepth(vec4 packedDepth) - { - // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); - } -`;var FD=`/** - * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. +vec2 czm_approximateSphericalCoordinates(vec3 normal) { + // Project into plane with vertical for latitude + float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); + float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); + return vec2(latitudeApproximation, longitudeApproximation); +} +`;var oI=`/** + * Determines if the fragment is back facing * - * @name czm_unpackFloat - * @glslFunction - * - * @param {vec4} packedFloat The packed float. - * - * @returns {float} The floating-point depth in arbitrary range. + * @name czm_backFacing + * @glslFunction + * + * @returns {bool} true if the fragment is back facing; otherwise, false. */ -float czm_unpackFloat(vec4 packedFloat) +bool czm_backFacing() { - // Convert to [0.0, 255.0] and round to integer - packedFloat = floor(packedFloat * 255.0 + 0.5); - float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; - float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; - if (exponent == -127.0) - { - return 0.0; - } - float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); - float result = sign * exp2(exponent - 23.0) * mantissa; - return result; + // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. + return gl_FrontFacing == false; } -`;var UD=`/** - * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, - * so the return value is an int. - *

- * There are also precision limitations in WebGL 1. highp int is still limited - * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. - *

+`;var rI=`/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a float expression. * - * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * @name czm_branchFreeTernary + * @glslFunction * - * @return {int} The unpacked value. - */ - int czm_unpackUint(float packedValue) { - float rounded = czm_round(packedValue * 255.0); - return int(rounded); - } - - int czm_unpackUint(vec2 packedValue) { - vec2 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec2(1.0, 256.0))); - } - - int czm_unpackUint(vec3 packedValue) { - vec3 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); - } - - int czm_unpackUint(vec4 packedValue) { - vec4 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); - } -`;var VD=`/** - * Transform metadata values following the EXT_structural_metadata spec - * by multiplying by scale and adding the offset. Operations are always - * performed component-wise, even for matrices. - * - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * @param {bool} comparison A comparison statement + * @param {float} a Value to return if the comparison is true. + * @param {float} b Value to return if the comparison is false. * - * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + * @returns {float} equivalent of comparison ? a : b */ -float czm_valueTransform(float offset, float scale, float value) { - return scale * value + offset; +float czm_branchFreeTernary(bool comparison, float a, float b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec2 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec2} a Value to return if the comparison is true. + * @param {vec2} b Value to return if the comparison is false. + * + * @returns {vec2} equivalent of comparison ? a : b + */ +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec3 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec4 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } - -mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { - return matrixCompMult(scale, value) + offset; +`;var sI=` +vec4 czm_cascadeColor(vec4 weights) +{ + return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + + vec4(0.0, 1.0, 0.0, 1.0) * weights.y + + vec4(0.0, 0.0, 1.0, 1.0) * weights.z + + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } +`;var aI=` +uniform vec4 shadowMap_cascadeDistances; -mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { - return matrixCompMult(scale, value) + offset; +float czm_cascadeDistance(vec4 weights) +{ + return dot(shadowMap_cascadeDistances, weights); } +`;var cI=` +uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { - return matrixCompMult(scale, value) + offset; +mat4 czm_cascadeMatrix(vec4 weights) +{ + return shadowMap_cascadeMatrices[0] * weights.x + + shadowMap_cascadeMatrices[1] * weights.y + + shadowMap_cascadeMatrices[2] * weights.z + + shadowMap_cascadeMatrices[3] * weights.w; } -`;var kD=`#ifdef LOG_DEPTH -// 1.0 at the near plane, increasing linearly from there. -out float v_depthFromNearPlusOne; -#ifdef SHADOW_MAP -out vec3 v_logPositionEC; -#endif -#endif - -vec4 czm_updatePositionDepth(vec4 coords) { -#if defined(LOG_DEPTH) - -#ifdef SHADOW_MAP - vec3 logPositionEC = (czm_inverseProjection * coords).xyz; - v_logPositionEC = logPositionEC; -#endif - - // With the very high far/near ratios used with the logarithmic depth - // buffer, floating point rounding errors can cause linear depth values - // to end up on the wrong side of the far plane, even for vertices that - // are really nowhere near it. Since we always write a correct logarithmic - // depth value in the fragment shader anyway, we just need to make sure - // such errors don't cause the primitive to be clipped entirely before - // we even get to the fragment shader. - coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; -#endif +`;var lI=` +uniform vec4 shadowMap_cascadeSplits[2]; - return coords; +vec4 czm_cascadeWeights(float depthEye) +{ + // One component is set to 1.0 and all others set to 0.0. + vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); + vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); + return near * far; } - -/** - * Writes the logarithmic depth to gl_Position using the already computed gl_Position. +`;var uI=`/** + * DOC_TBA * - * @name czm_vertexLogDepth + * @name czm_columbusViewMorph * @glslFunction */ -void czm_vertexLogDepth() +vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; - gl_Position = czm_updatePositionDepth(gl_Position); -#endif + // Just linear for now. + vec3 p = mix(position2D.xyz, position3D.xyz, time); + return vec4(p, 1.0); } - -/** - * Writes the logarithmic depth to gl_Position using the provided clip coordinates. +`;var fI=`/** + * Returns a position in model coordinates relative to eye taking into + * account the current scene mode: 3D, 2D, or Columbus view. *

- * An example use case for this function would be moving the vertex in window coordinates - * before converting back to clip coordinates. Use the original vertex clip coordinates. + * This uses standard position attributes, position3DHigh, + * position3DLow, position2DHigh, and position2DLow, + * and should be used when writing a vertex shader for an {@link Appearance}. *

- * @name czm_vertexLogDepth + * + * @name czm_computePosition * @glslFunction * - * @param {vec4} clipCoords The vertex in clip coordinates. + * @returns {vec4} The position relative to eye. * * @example - * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + * vec4 p = czm_computePosition(); + * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * + * @see czm_translateRelativeToEye */ -void czm_vertexLogDepth(vec4 clipCoords) -{ -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; - czm_updatePositionDepth(clipCoords); -#endif -} -`;var zD=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +vec4 czm_computePosition(); +`;var dI=`/** + * @private + */ +vec2 cordic(float angle) { - // Reconstruct NDC coordinates - float x = 2.0 * screenCoordinate.x - 1.0; - float y = 2.0 * screenCoordinate.y - 1.0; - float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - vec4 q = vec4(x, y, z, 1.0); - - // Reverse the perspective division to obtain clip coordinates. - q /= screenCoordinate.w; - - // Reverse the projection transformation to obtain eye coordinates. - if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s - { - q = czm_inverseProjection * q; - } - else - { - float top = czm_frustumPlanes.x; - float bottom = czm_frustumPlanes.y; - float left = czm_frustumPlanes.z; - float right = czm_frustumPlanes.w; - - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - - q.x = (q.x * (right - left) + left + right) * 0.5; - q.y = (q.y * (top - bottom) + bottom + top) * 0.5; - q.z = (q.z * (near - far) - near - far) * 0.5; - q.w = 1.0; - } +// Scale the vector by the appropriate factor for the 24 iterations to follow. + vec2 vector = vec2(6.0725293500888267e-1, 0.0); +// Iteration 1 + float sense = (angle < 0.0) ? -1.0 : 1.0; + // float factor = sense * 1.0; // 2^-0 + mat2 rotation = mat2(1.0, sense, -sense, 1.0); + vector = rotation * vector; + angle -= sense * 7.8539816339744828e-1; // atan(2^-0) +// Iteration 2 + sense = (angle < 0.0) ? -1.0 : 1.0; + float factor = sense * 5.0e-1; // 2^-1 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.6364760900080609e-1; // atan(2^-1) +// Iteration 3 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.5e-1; // 2^-2 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4497866312686414e-1; // atan(2^-2) +// Iteration 4 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.25e-1; // 2^-3 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2435499454676144e-1; // atan(2^-3) +// Iteration 5 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.25e-2; // 2^-4 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.2418809995957350e-2; // atan(2^-4) +// Iteration 6 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.125e-2; // 2^-5 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.1239833430268277e-2; // atan(2^-5) +// Iteration 7 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.5625e-2; // 2^-6 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5623728620476831e-2; // atan(2^-6) +// Iteration 8 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.8125e-3; // 2^-7 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.8123410601011111e-3; // atan(2^-7) +// Iteration 9 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.90625e-3; // 2^-8 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.9062301319669718e-3; // atan(2^-8) +// Iteration 10 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.953125e-3; // 2^-9 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9531225164788188e-3; // atan(2^-9) +// Iteration 11 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.765625e-4; // 2^-10 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.7656218955931946e-4; // atan(2^-10) +// Iteration 12 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.8828125e-4; // 2^-11 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.8828121119489829e-4; // atan(2^-11) +// Iteration 13 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.44140625e-4; // 2^-12 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4414062014936177e-4; // atan(2^-12) +// Iteration 14 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.220703125e-4; // 2^-13 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2207031189367021e-4; // atan(2^-13) +// Iteration 15 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.103515625e-5; // 2^-14 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.1035156174208773e-5; // atan(2^-14) +// Iteration 16 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.0517578125e-5; // 2^-15 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.0517578115526096e-5; // atan(2^-15) +// Iteration 17 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.52587890625e-5; // 2^-16 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5258789061315762e-5; // atan(2^-16) +// Iteration 18 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.62939453125e-6; // 2^-17 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.6293945311019700e-6; // atan(2^-17) +// Iteration 19 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.814697265625e-6; // 2^-18 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.8146972656064961e-6; // atan(2^-18) +// Iteration 20 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.9073486328125e-6; // 2^-19 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9073486328101870e-6; // atan(2^-19) +// Iteration 21 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.5367431640625e-7; // 2^-20 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.5367431640596084e-7; // atan(2^-20) +// Iteration 22 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.76837158203125e-7; // 2^-21 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.7683715820308884e-7; // atan(2^-21) +// Iteration 23 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.384185791015625e-7; // 2^-22 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.3841857910155797e-7; // atan(2^-22) +// Iteration 24 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.1920928955078125e-7; // 2^-23 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; +// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) - return q; + return vector; } /** - * Transforms a position from window to eye coordinates. - * The transform from window to normalized device coordinates is done using components - * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating - * the inverse of czm_viewportTransformation. The transformation from - * normalized device coordinates to clip coordinates is done using fragmentCoordinate.w, - * which is expected to be the scalar used in the perspective divide. The transformation - * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * Computes the cosine and sine of the provided angle using the CORDIC algorithm. * - * @name czm_windowToEyeCoordinates + * @name czm_cosineAndSine * @glslFunction * - * @param {vec4} fragmentCoordinate The position in window coordinates to transform. - * - * @returns {vec4} The transformed position in eye coordinates. + * @param {float} angle The angle in radians. * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation + * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). * * @example - * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + * vec2 v = czm_cosineAndSine(czm_piOverSix); + * float cosine = v.x; + * float sine = v.y; */ -vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) -{ - vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); -} - -vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +vec2 czm_cosineAndSine(float angle) { - // See reverseLogDepth.glsl. This is separate to re-use the pow. -#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - float depthFromCamera = depthFromNear + near; - vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); - eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision - return eyeCoordinate; -#else - vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); -#endif - return eyeCoordinate; + if (angle < -czm_piOverTwo || angle > czm_piOverTwo) + { + if (angle < 0.0) + { + return -cordic(angle + czm_pi); + } + else + { + return -cordic(angle - czm_pi); + } + } + else + { + return cordic(angle); + } } - -/** - * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. - * This function produces more accurate results for window positions with log depth than - * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version - * of czm_windowToEyeCoordinates. +`;var mI=`/** + * Decompresses texture coordinates that were packed into a single float. * - * @name czm_windowToEyeCoordinates + * @name czm_decompressTextureCoordinates * @glslFunction * - * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. - * @param {float} depthOrLogDepth A depth or log depth for the fragment. - * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation - * - * @returns {vec4} The transformed position in eye coordinates. + * @param {float} encoded The compressed texture coordinates. + * @returns {vec2} The decompressed texture coordinates. */ -vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) + vec2 czm_decompressTextureCoordinates(float encoded) + { + float temp = encoded / 4096.0; + float xZeroTo4095 = floor(temp); + float stx = xZeroTo4095 / 4095.0; + float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; + return vec2(stx, sty); + } +`;var hI=`/** + * Get default parameters for physically based rendering. These defaults + * describe a rough dielectric (non-metal) surface (e.g. rough plastic). + * + * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} + */ +czm_pbrParameters czm_defaultPbrMaterial() { - vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); + czm_pbrParameters results; + results.diffuseColor = vec3(1.0); + results.roughness = 1.0; + + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + results.f0 = REFLECTANCE_DIELECTRIC; + return results; } -`;var HD=`// emulated noperspective -#if !defined(LOG_DEPTH) -in float v_WindowZ; +`;var pI=`// emulated noperspective +#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; #endif /** - * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane - * by writing the fragment's depth. See czm_depthClamp for more details. + * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. + * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, + * capping the shadow volume. More information here: + * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. * - * @name czm_writeDepthClamp + * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring + * no geometry gets clipped by setting the clip space z value to 0.0 and then + * sending the unaltered screen space z value (using emulated noperspective + * interpolation) to the frag shader where it is clamped to [0,1] and then + * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: + * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. + * + * When GL_EXT_frag_depth is not available, which is the case on some mobile + * devices, we must attempt to fix this only in the vertex shader. + * The approach is to clamp the z value to the far plane, which closes the + * shadow volume but also distorts the geometry, so there can still be artifacts + * on frustum seams. + * + * @name czm_depthClamp * @glslFunction * + * @param {vec4} coords The vertex in clip coordinates. + * @returns {vec4} The modified vertex. + * * @example - * out_FragColor = color; - * czm_writeDepthClamp(); + * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); * - * @see czm_depthClamp + * @see czm_writeDepthClamp */ -void czm_writeDepthClamp() +vec4 czm_depthClamp(vec4 coords) { -#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); -#endif -} -`;var GD=`#ifdef LOG_DEPTH -in float v_depthFromNearPlusOne; - -#ifdef POLYGON_OFFSET -uniform vec2 u_polygonOffset; -#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) + v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; + coords.z = 0.0; +#else + coords.z = min(coords.z, coords.w); #endif - #endif - -/** - * Writes the fragment depth to the logarithmic depth buffer. - *

- * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when - * ray-casting geometry using a full screen quad. - *

- * @name czm_writeLogDepth + return coords; +} +`;var _I=`/** + * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system + * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the + * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. + *

+ * The ellipsoid is assumed to be centered at the model coordinate's origin. + * + * @name czm_eastNorthUpToEyeCoordinates * @glslFunction * - * @param {float} depth The depth coordinate, where 1.0 is on the near plane and - * depth increases in eye-space units from there + * @param {vec3} positionMC The position on the ellipsoid in model coordinates. + * @param {vec3} normalEC The normalized ellipsoid surface normal, at positionMC, in eye coordinates. + * + * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. * * @example - * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + * // Transform a vector defined in the east-north-up coordinate + * // system, (0, 0, 1) which is the surface normal, to eye + * // coordinates. + * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); */ -void czm_writeLogDepth(float depth) +mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { -#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - // Discard the vertex if it's not between the near and far planes. - // We allow a bit of epsilon on the near plane comparison because a 1.0 - // from the vertex shader (indicating the vertex should be _on_ the near - // plane) will not necessarily come here as exactly 1.0. - if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { - discard; - } - -#ifdef POLYGON_OFFSET - // Polygon offset: m * factor + r * units - float factor = u_polygonOffset[0]; - float units = u_polygonOffset[1]; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // This factor doesn't work in IE 10 - if (factor != 0.0) { - // m = sqrt(dZdX^2 + dZdY^2); - float x = dFdx(depth); - float y = dFdy(depth); - float m = sqrt(x * x + y * y); - - // Apply the factor before computing the log depth. - depth += m * factor; - } -#endif - -#endif - - gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; - -#ifdef POLYGON_OFFSET - // Apply the units after the log depth. - gl_FragDepth += czm_epsilon7 * units; -#endif + vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates + vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes + vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates -#endif + return mat3( + tangentEC.x, tangentEC.y, tangentEC.z, + bitangentEC.x, bitangentEC.y, bitangentEC.z, + normalEC.x, normalEC.y, normalEC.z); } - -/** - * Writes the fragment depth to the logarithmic depth buffer. - *

- * Use this when the vertex shader calls {@link czm_vertexlogDepth}. - *

+`;var gI=`/** + * DOC_TBA * - * @name czm_writeLogDepth + * @name czm_ellipsoidContainsPoint * @glslFunction + * */ -void czm_writeLogDepth() { -#ifdef LOG_DEPTH - czm_writeLogDepth(v_depthFromNearPlusOne); -#endif +bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +{ + vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; + return (dot(scaled, scaled) <= 1.0); } -`;var WD=`/** - * Transforms a value for non-perspective interpolation by multiplying - * it by w, the value used in the perspective divide. This function is - * intended to be called in a vertex shader to compute the value of a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The fragment shader - * must call {@link czm_readNonPerspective} to retrieve the final - * non-perspective value. +`;var yI=`/** + * DOC_TBA * - * @name czm_writeNonPerspective + * @name czm_ellipsoidWgs84TextureCoordinates * @glslFunction + */ +vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +{ + return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); +} +`;var xI=`/** + * Compares left and right componentwise. Returns true + * if they are within epsilon and false otherwise. The inputs + * left and right can be floats, vec2s, + * vec3s, or vec4s. * - * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. - * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. - * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the - * fragment shader with {@link czm_readNonPerspective}. + * @name czm_equalsEpsilon + * @glslFunction + * + * @param {} left The first vector. + * @param {} right The second vector. + * @param {float} epsilon The epsilon to use for equality testing. + * @returns {bool} true if the components are within epsilon and false otherwise. + * + * @example + * // GLSL declarations + * bool czm_equalsEpsilon(float left, float right, float epsilon); + * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); + * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); + * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); */ -float czm_writeNonPerspective(float value, float w) { - return value * w; +bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec4(epsilon))); } -vec2 czm_writeNonPerspective(vec2 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec3(epsilon))); } -vec3 czm_writeNonPerspective(vec3 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec2(epsilon))); } -vec4 czm_writeNonPerspective(vec4 value, float w) { - return value * w; +bool czm_equalsEpsilon(float left, float right, float epsilon) { + return (abs(left - right) <= epsilon); } -`;var jD=`/** - * Converts a CIE Yxy color to RGB. - *

The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - *

- * - * @name czm_XYZToRGB +`;var bI=`/** + * DOC_TBA + * + * @name czm_eyeOffset * @glslFunction - * - * @param {vec3} Yxy The color in CIE Yxy. * - * @returns {vec3} The color in RGB. + * @param {vec4} positionEC DOC_TBA. + * @param {vec3} eyeOffset DOC_TBA. * - * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * @returns {vec4} DOC_TBA. */ -vec3 czm_XYZToRGB(vec3 Yxy) +vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { - const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, - -1.5371, 1.8760, -0.2040, - -0.4985, 0.0416, 1.0572); - vec3 xyz; - xyz.r = Yxy.r * Yxy.g / Yxy.b; - xyz.g = Yxy.r; - xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; - - return XYZ2RGB * xyz; -} -`;var YD=`vec3 czm_fromCartesian(vec3 position) { - vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); - vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); - float centerToleranceSquared = 0.1; - - vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); - - vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); - n = normalize(n); - - vec3 h = p - position; - - float longitude = atan(n.y, n.x); - float latitude = asin(n.z); - - float dotNum = dot(h, position); - // float height = MathSign(dotNum)*czm_magnitude(h); - float height = czm_magnitude(h); + // This equation is approximate in x and y. + vec4 p = positionEC; + vec4 zEyeOffset = normalize(p) * eyeOffset.z; + p.xy += eyeOffset.xy + zEyeOffset.xy; + p.z += zEyeOffset.z; + return p; +} +`;var CI=`/** + * Transforms a position from eye to window coordinates. The transformation + * from eye to clip coordinates is done using {@link czm_projection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of near = 0 and far = 1. + *

+ * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * + * @name czm_eyeToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in eye coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_projection + * @see czm_viewportTransformation + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + */ +vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +{ + vec4 q = czm_projection * positionEC; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var TI=`/** + * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. + * + * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on + * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + * Adapted from ShaderFastLibs under MIT License. + * + * Chosen for the following characteristics over range [0, 1]: + * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) + * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) + * + * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); + * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between 0 and 1 inclusive. + * + * @returns {float} Approximation of atan(x) + */ +float czm_fastApproximateAtan(float x) { + return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +} - vec3 result; - result.x = longitude; - result.y = latitude; - result.z = height; - return result; -}`;var qD=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ - for(int i=0;i<=16;i++){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ - if(xyxy[0][0]maxx){ - maxx = xyxy[0][0]; - } +/** + * Approximation of atan2. + * + * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html + * However, we replaced their atan curve with Michael Drobot's (see above). + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between -1 and 1 inclusive. + * @param {float} y Value between -1 and 1 inclusive. + * + * @returns {float} Approximation of atan2(x, y) + */ +float czm_fastApproximateAtan(float x, float y) { + // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. + // So range-reduce using abs and by flipping whether x or y is on top. + float t = abs(x); // t used as swap and atan result. + float opposite = abs(y); + float adjacent = max(t, opposite); + opposite = min(t, opposite); - if(xyxy[0][1]maxy){ - maxy = xyxy[0][1]; - } + t = czm_fastApproximateAtan(opposite / adjacent); - if(xyxy[0][2]maxz){ - maxz = xyxy[0][2]; - } - } - } - return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); + // Undo range reduction + t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); + t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); + t = czm_branchFreeTernary(y < 0.0, -t, t); + return t; +} +`;var AI=`/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-(scalar * scalar)); + return mix(color, fogColor, fog); } +/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * @param {float} fogModifierConstant A constant to modify the appearance of fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); + return mix(color, fogColor, fog); +} +`;var EI=`/** + * Converts a color from RGB space to linear space. + * + * @name czm_gammaCorrect + * @glslFunction + * + * @param {vec3} color The color in RGB space. + * @returns {vec3} The color in linear space. + */ +vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR + color = pow(color, vec3(czm_gamma)); +#endif + return color; +} +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR + color.rgb = pow(color.rgb, vec3(czm_gamma)); +#endif + return color; +} +`;var SI=`/** + * DOC_TBA + * + * @name czm_geodeticSurfaceNormal + * @glslFunction + * + * @param {vec3} positionOnEllipsoid DOC_TBA + * @param {vec3} ellipsoidCenter DOC_TBA + * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA + * + * @returns {vec3} DOC_TBA. + */ +vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) +{ + return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); +} +`;var vI=`/** + * An czm_material with default values. Every material's czm_getMaterial + * should use this default material as a base for the material it returns. + * The default normal value is given by materialInput.normalEC. + * + * @name czm_getDefaultMaterial + * @glslFunction + * + * @param {czm_materialInput} input The input used to construct the default material. + * + * @returns {czm_material} The default material. + * + * @see czm_materialInput + * @see czm_material + * @see czm_getMaterial + */ +czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +{ + czm_material material; + material.diffuse = vec3(0.0); + material.specular = 0.0; + material.shininess = 1.0; + material.normal = materialInput.normalEC; + material.emission = vec3(0.0); + material.alpha = 1.0; + return material; +} +`;var wI=`/** + * Calculates the intensity of diffusely reflected light. + * + * @name czm_getLambertDiffuse + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * + * @returns {float} The intensity of the diffuse reflection. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +{ + return max(dot(lightDirectionEC, normalEC), 0.0); +} +`;var II=`/** + * Calculates the specular intensity of reflected light. + * + * @name czm_getSpecular + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * + * @returns {float} The intensity of the specular highlight. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +{ + vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); + float specular = max(dot(toReflectedLight, toEyeEC), 0.0); -`;var XD=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); - if(index==0){ - return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); - } - if(index==1){ - return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); - } - if(index==2){ - return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); - } - if(index==3){ - return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); - } - if(index==4){ - return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); - } - if(index==5){ - return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); - } - if(index==6){ - return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); - } - if(index==7){ - return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); - } - if(index==8){ - return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); - } - if(index==9){ - return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); - } - if(index==10){ - return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); - } - if(index==11){ - return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); - } - if(index==12){ - return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); - } - if(index==13){ - return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); - } - if(index==14){ - return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); - } - if(index==15){ - return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); - } -}`;var KD=`int czm_getMaxIndex(mat4 yp_mat_x){ - if(yp_mat_x[3][3]!=0.0){ - return 16; - } - if(yp_mat_x[3][2]!=0.0){ - return 15; - } - if(yp_mat_x[3][1]!=0.0){ - return 14; - } - if(yp_mat_x[3][0]!=0.0){ - return 15; - } - if(yp_mat_x[2][3]!=0.0){ - return 12; - } - if(yp_mat_x[2][2]!=0.0){ - return 11; - } - if(yp_mat_x[2][1]!=0.0){ - return 10; - } - if(yp_mat_x[2][0]!=0.0){ - return 9; - } - if(yp_mat_x[1][3]!=0.0){ - return 8; - } - if(yp_mat_x[1][2]!=0.0){ - return 7; - } - if(yp_mat_x[1][1]!=0.0){ - return 6; - } - if(yp_mat_x[1][0]!=0.0){ - return 5; - } - if(yp_mat_x[0][3]!=0.0){ - return 4; - } - if(yp_mat_x[0][2]!=0.0){ - return 3; - } - if(yp_mat_x[0][1]!=0.0){ - return 2; - } - if(yp_mat_x[0][0]!=0.0){ - return 1; - } -}`;var JD=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - if(yp_max_index==0){ - return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); - } - if(yp_max_index==1){ - return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); - } - if(yp_max_index==2){ - return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); - } - if(yp_max_index==3){ - return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); - } - if(yp_max_index==4){ - return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); - } - if(yp_max_index==5){ - return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); - } - if(yp_max_index==6){ - return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); - } - if(yp_max_index==7){ - return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); - } - if(yp_max_index==8){ - return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); - } - if(yp_max_index==9){ - return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); - } - if(yp_max_index==10){ - return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); - } - if(yp_max_index==11){ - return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); - } - if(yp_max_index==12){ - return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); - } - if(yp_max_index==13){ - return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); - } - if(yp_max_index==14){ - return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); - } - if(yp_max_index==15){ - return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); - } -}`;var ZD=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - float pz = position.z; - if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ - vec3 lonlat = czm_fromCartesian(position); - px = lonlat.x; - py = lonlat.y; - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); - vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); - vec3 llh1 = czm_fromCartesian(pos1); - vec3 llh2 = czm_fromCartesian(pos2); - float sx = llh1.x; - float sy = llh1.y; - float tx = llh2.x; - float ty = llh2.y; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - return isIn ? true : false; -}`;var QD=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - if(currVal.x!=0.0&&currVal.y!=0.0){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - float sx = xyxy[0][0]; - float sy = xyxy[0][1]; - float tx = xyxy[1][0]; - float ty = xyxy[1][1]; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - } - return isIn ? true : false; -}`;var $D=`float czm_magnitude(vec3 cartesian3) { - return sqrt(czm_magnitudeSquared(cartesian3)); -}`;var eI=`float czm_magnitudeSquared (vec3 cartesian4) { - return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; -}`;var tI=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { - vec3 result; - result.x = left.x * right.x; - result.y = left.y * right.y; - result.z = left.z * right.z; - return result; -}`;var nI=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { - - float positionX = cartesian1.x; - float positionY = cartesian1.y; - float positionZ = cartesian1.z; - - float oneOverRadiiX = oneOverRadii.x; - float oneOverRadiiY = oneOverRadii.y; - float oneOverRadiiZ = oneOverRadii.z; + // pow has undefined behavior if both parameters <= 0. + // Prevent this by making sure shininess is at least czm_epsilon2. + return pow(specular, max(shininess, czm_epsilon2)); +} +`;var DI=`/** + * @private + */ +vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +{ + float cosAngle = cos(angleInRadians); + float sinAngle = sin(angleInRadians); - float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; - float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; - float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; - - // Compute the squared ellipsoid norm. - float squaredNorm = x2 + y2 + z2; - float ratio = sqrt(1.0 / squaredNorm); - - // As an initial approximation, assume that the radial intersection is the projection point. - vec3 intersection = cartesian1*ratio; - - - float oneOverRadiiSquaredX = oneOverRadiiSquared.x; - float oneOverRadiiSquaredY = oneOverRadiiSquared.y; - float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; - - // Use the gradient at the intersection point in place of the true unit normal. - // The difference in magnitude will be absorbed in the multiplier. - vec3 gradient; - gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; - gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; - gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - - // Compute the initial guess at the normal vector multiplier, lambda. - float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); - float correction = 0.0; - - float func; - float denominator; - float xMultiplier; - float yMultiplier; - float zMultiplier; - float xMultiplier2; - float yMultiplier2; - float zMultiplier2; - float xMultiplier3; - float yMultiplier3; - float zMultiplier3; - func = 1.0; - for(int i=0;i<9;i++){ - if(abs(func) > 0.000000000001){ - lambda -= correction; - - xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); - yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); - zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); - - xMultiplier2 = xMultiplier * xMultiplier; - yMultiplier2 = yMultiplier * yMultiplier; - zMultiplier2 = zMultiplier * zMultiplier; - - xMultiplier3 = xMultiplier2 * xMultiplier; - yMultiplier3 = yMultiplier2 * yMultiplier; - zMultiplier3 = zMultiplier2 * zMultiplier; - - func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - - // "denominator" here refers to the use of this expression in the velocity and acceleration - // computations in the sections to follow. - denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - - float derivative = -2.0 * denominator; - - correction = func / derivative; - - }else{ - break; - } - } - - vec3 result; - result.x = positionX * xMultiplier; - result.y = positionY * yMultiplier; - result.z = positionZ * zMultiplier; - return result; -}`;var M0={czm_degreesPerRadian:Ev,czm_depthRange:bv,czm_epsilon1:Sv,czm_epsilon2:vv,czm_epsilon3:wv,czm_epsilon4:Dv,czm_epsilon5:Iv,czm_epsilon6:Pv,czm_epsilon7:Ov,czm_infinity:Rv,czm_oneOverPi:Mv,czm_oneOverTwoPi:Bv,czm_passCesium3DTile:Lv,czm_passCesium3DTileClassification:Nv,czm_passCesium3DTileClassificationIgnoreShow:Fv,czm_passClassification:Uv,czm_passCompute:Vv,czm_passEnvironment:kv,czm_passGlobe:zv,czm_passOpaque:Hv,czm_passOverlay:Gv,czm_passTerrainClassification:Wv,czm_passTranslucent:jv,czm_passVoxels:Yv,czm_pi:qv,czm_piOverFour:Xv,czm_piOverSix:Kv,czm_piOverThree:Jv,czm_piOverTwo:Zv,czm_radiansPerDegree:Qv,czm_sceneMode2D:$v,czm_sceneMode3D:ew,czm_sceneModeColumbusView:tw,czm_sceneModeMorphing:nw,czm_solarRadius:iw,czm_threePiOver2:rw,czm_twoPi:ow,czm_webMercatorMaxLatitude:sw,czm_depthRangeStruct:aw,czm_material:cw,czm_materialInput:lw,czm_modelMaterial:uw,czm_modelVertexOutput:fw,czm_pbrParameters:dw,czm_ray:mw,czm_raySegment:hw,czm_shadowParameters:pw,czm_acesTonemapping:_w,czm_alphaWeight:gw,czm_antialias:yw,czm_approximateSphericalCoordinates:Aw,czm_backFacing:xw,czm_branchFreeTernary:Cw,czm_cascadeColor:Tw,czm_cascadeDistance:Ew,czm_cascadeMatrix:bw,czm_cascadeWeights:Sw,czm_columbusViewMorph:vw,czm_computePosition:ww,czm_cosineAndSine:Dw,czm_decompressTextureCoordinates:Iw,czm_defaultPbrMaterial:Pw,czm_depthClamp:Ow,czm_eastNorthUpToEyeCoordinates:Rw,czm_ellipsoidContainsPoint:Mw,czm_ellipsoidWgs84TextureCoordinates:Bw,czm_equalsEpsilon:Lw,czm_eyeOffset:Nw,czm_eyeToWindowCoordinates:Fw,czm_fastApproximateAtan:Uw,czm_fog:Vw,czm_gammaCorrect:kw,czm_geodeticSurfaceNormal:zw,czm_getDefaultMaterial:Hw,czm_getLambertDiffuse:Gw,czm_getSpecular:Ww,czm_getWaterNoise:jw,czm_HSBToRGB:Yw,czm_HSLToRGB:qw,czm_hue:Xw,czm_inverseGamma:Kw,czm_isEmpty:Jw,czm_isFull:Zw,czm_latitudeToWebMercatorFraction:Qw,czm_linearToSrgb:$w,czm_lineDistance:eD,czm_luminance:tD,czm_metersPerPixel:nD,czm_modelToWindowCoordinates:iD,czm_multiplyWithColorBalance:rD,czm_nearFarScalar:oD,czm_octDecode:sD,czm_packDepth:aD,czm_pbrLighting:cD,czm_pbrMetallicRoughnessMaterial:lD,czm_pbrSpecularGlossinessMaterial:uD,czm_phong:fD,czm_planeDistance:dD,czm_pointAlongRay:mD,czm_rayEllipsoidIntersectionInterval:hD,czm_raySphereIntersectionInterval:pD,czm_readDepth:_D,czm_readNonPerspective:gD,czm_reverseLogDepth:yD,czm_RGBToHSB:AD,czm_RGBToHSL:xD,czm_RGBToXYZ:CD,czm_round:TD,czm_sampleOctahedralProjection:ED,czm_saturation:bD,czm_shadowDepthCompare:SD,czm_shadowVisibility:vD,czm_signNotZero:wD,czm_sphericalHarmonics:DD,czm_srgbToLinear:ID,czm_tangentToEyeSpaceMatrix:PD,czm_textureCube:OD,czm_transformPlane:RD,czm_translateRelativeToEye:MD,czm_translucentPhong:BD,czm_transpose:LD,czm_unpackDepth:ND,czm_unpackFloat:FD,czm_unpackUint:UD,czm_valueTransform:VD,czm_vertexLogDepth:kD,czm_windowToEyeCoordinates:zD,czm_writeDepthClamp:HD,czm_writeLogDepth:GD,czm_writeNonPerspective:WD,czm_XYZToRGB:jD,czm_fromCartesian:YD,czm_getFloodRect:qD,czm_getIndexMat:XD,czm_getMaxIndex:KD,czm_getMaxIndexVal:JD,czm_isInEllipsoid:ZD,czm_isInObliq:QD,czm_magnitude:$D,czm_magnitudeSquared:eI,czm_multiplyComponents:tI,czm_scaleToGeodeticSurface:nI};function cbe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable -${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable -${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT"))):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var iI=cbe;function eQ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o=0;--r)i=`${i+t[r].glslSource} -`;return i.replace(n.glslSource,"")}function iQ(e,t,n){let i,r,o="",s=e.sources;if(l(s))for(i=0,r=s.length;i-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};rd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};rd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new He({sources:[o]})),typeof s=="string"&&(s=new He({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Zt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function HG(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var tp={high:0,low:0};Mm.fromCartesian=function(e,t){l(t)||(t=new Mm);let n=t.high,i=t.low;return Mm.encode(e.x,tp),n.x=tp.high,i.x=tp.low,Mm.encode(e.y,tp),n.y=tp.high,i.y=tp.low,Mm.encode(e.z,tp),n.z=tp.high,i.z=tp.low,t};var GG=new Mm;Mm.writeElements=function(e,t,n){Mm.fromCartesian(e,GG);let i=GG.high,r=GG.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var jn=Mm;function xs(e,t){this.normal=m.clone(e),this.distance=t}xs.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new xs(t,i)};var pbe=new m;xs.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,pbe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new xs(n,i)};xs.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var _be=new m;xs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=xs.getPointDistance(e,t),r=m.multiplyByScalar(e.normal,i,_be);return m.subtract(t,r,n)};var gbe=new B,ybe=new oe,Abe=new m;xs.transform=function(e,t,n){let i=e.normal,r=e.distance,o=B.inverseTranspose(t,gbe),s=oe.fromElements(i.x,i.y,i.z,r,ybe);s=B.multiplyByVector(o,s,s);let a=m.fromCartesian4(s,Abe);return s=oe.divideByScalar(s,m.magnitude(a),s),xs.fromCartesian4(s,n)};xs.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new xs(e.normal,e.distance)};xs.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};xs.ORIGIN_XY_PLANE=Object.freeze(new xs(m.UNIT_Z,0));xs.ORIGIN_YZ_PLANE=Object.freeze(new xs(m.UNIT_X,0));xs.ORIGIN_ZX_PLANE=Object.freeze(new xs(m.UNIT_Y,0));var fn=xs;function qu(e){this.planes=y(e,[])}var sI=[new m,new m,new m];m.clone(m.UNIT_X,sI[0]);m.clone(m.UNIT_Y,sI[1]);m.clone(m.UNIT_Z,sI[2]);var ng=new m,xbe=new m,sQ=new fn(new m(1,0,0),0);qu.fromBoundingSphere=function(e,t){l(t)||(t=new qu);let n=sI.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;aObe;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function Mbe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function Bbe(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var Lbe=1.0000010178*ga,Nbe=100.46645683*Xu,Fbe=129597742283429e-5*Wl,lQ=16002,uQ=21863,fQ=32004,dQ=10931,mQ=14529,hQ=16368,pQ=15318,_Q=32794,Ube=64*1e-7*ga,Vbe=-152*1e-7*ga,kbe=62*1e-7*ga,zbe=-8*1e-7*ga,Hbe=32*1e-7*ga,Gbe=-41*1e-7*ga,Wbe=19*1e-7*ga,jbe=-11*1e-7*ga,Ybe=-150*1e-7*ga,qbe=-46*1e-7*ga,Xbe=68*1e-7*ga,Kbe=54*1e-7*ga,Jbe=14*1e-7*ga,Zbe=24*1e-7*ga,Qbe=-28*1e-7*ga,$be=22*1e-7*ga,gQ=10,yQ=16002,AQ=21863,xQ=10931,CQ=1473,TQ=32004,EQ=4387,bQ=73,eSe=-325*1e-7,tSe=-322*1e-7,nSe=-79*1e-7,iSe=232*1e-7,rSe=-52*1e-7,oSe=97*1e-7,sSe=55*1e-7,aSe=-41*1e-7,cSe=-105*1e-7,lSe=-137*1e-7,uSe=258*1e-7,fSe=35*1e-7,dSe=-116*1e-7,mSe=-88*1e-7,hSe=-112*1e-7,pSe=-80*1e-7,aT=new ee(0,0,Jn.TAI);function _Se(e,t){vQ(e,aT);let i=(aT.dayNumber-Z3.dayNumber+(aT.secondsOfDay-Z3.secondsOfDay)/Zn.SECONDS_PER_DAY)/(Zn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=Lbe+Ube*Math.cos(lQ*r)+Ybe*Math.sin(lQ*r)+Vbe*Math.cos(uQ*r)+qbe*Math.sin(uQ*r)+kbe*Math.cos(fQ*r)+Xbe*Math.sin(fQ*r)+zbe*Math.cos(dQ*r)+Kbe*Math.sin(dQ*r)+Hbe*Math.cos(mQ*r)+Jbe*Math.sin(mQ*r)+Gbe*Math.cos(hQ*r)+Zbe*Math.sin(hQ*r)+Wbe*Math.cos(pQ*r)+Qbe*Math.sin(pQ*r)+jbe*Math.cos(_Q*r)+$be*Math.sin(_Q*r),s=Nbe+Fbe*i+eSe*Math.cos(gQ*r)+cSe*Math.sin(gQ*r)+tSe*Math.cos(yQ*r)+lSe*Math.sin(yQ*r)+nSe*Math.cos(AQ*r)+uSe*Math.sin(AQ*r)+iSe*Math.cos(xQ*r)+fSe*Math.sin(xQ*r)+rSe*Math.cos(CQ*r)+dSe*Math.sin(CQ*r)+oSe*Math.cos(TQ*r)+mSe*Math.sin(TQ*r)+sSe*Math.cos(EQ*r)+hSe*Math.sin(EQ*r)+aSe*Math.cos(bQ*r)+pSe*Math.sin(bQ*r),a=.0167086342-.0004203654*i,c=102.93734808*Xu+11612.3529*Wl*i,u=469.97289*Wl*i,f=174.87317577*Xu-8679.27034*Wl*i;return wQ(o,a,u,c,f,s,t)}function DQ(e,t){vQ(e,aT);let i=(aT.dayNumber-Z3.dayNumber+(aT.secondsOfDay-Z3.secondsOfDay)/Zn.SECONDS_PER_DAY)/Zn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Xu,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Xu,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Xu,h=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,A=218.31664563*Xu,x=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,C=297.85019547*Xu+Wl*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),T=93.27209062*Xu+Wl*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),E=134.96340251*Xu+Wl*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),S=357.52910918*Xu+Wl*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),w=310.17137918*Xu-Wl*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),D=2*C,R=4*C,O=6*C,L=2*E,N=3*E,_=4*E,b=2*T;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-E)-235.6*Math.cos(E)+218.1*Math.cos(D-S)+181*Math.cos(D+E),c+=.014216*Math.cos(D-E)+.008551*Math.cos(D-L)-.001383*Math.cos(E)+.001356*Math.cos(D+E)-.001147*Math.cos(R-N)-914e-6*Math.cos(R-L)+869e-6*Math.cos(D-S-E)-627e-6*Math.cos(D)-394e-6*Math.cos(R-_)+282e-6*Math.cos(D-S-L)-279e-6*Math.cos(C-E)-236e-6*Math.cos(L)+231e-6*Math.cos(R)+229e-6*Math.cos(O-_)-201e-6*Math.cos(L-b),f+=486.26*Math.cos(D-b)-40.13*Math.cos(D)+37.51*Math.cos(b)+25.73*Math.cos(L-b)+19.97*Math.cos(D-S-b),p+=-55609*Math.sin(D-E)-34711*Math.sin(D-L)-9792*Math.sin(E)+9385*Math.sin(R-N)+7505*Math.sin(R-L)+5318*Math.sin(D+E)+3484*Math.sin(R-_)-3417*Math.sin(D-S-E)-2530*Math.sin(O-_)-2376*Math.sin(D)-2075*Math.sin(D-N)-1883*Math.sin(L)-1736*Math.sin(O-5*E)+1626*Math.sin(S)-1370*Math.sin(O-N),h+=-5392*Math.sin(D-b)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(b)-288*Math.sin(L-b),x+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(D-S);let v=2*w,I=3*w;f+=46.997*Math.cos(w)*i-.614*Math.cos(D-b+w)*i+.614*Math.cos(D-b-w)*i-.0297*Math.cos(v)*r-.0335*Math.cos(w)*r+.0012*Math.cos(D-b+v)*r-16e-5*Math.cos(w)*o+4e-5*Math.cos(I)*o+4e-5*Math.cos(v)*o;let M=2.116*Math.sin(w)*i-.111*Math.sin(D-b-w)*i-.0015*Math.sin(w)*r;p+=M,x+=M,h+=-520.77*Math.sin(w)*i+13.66*Math.sin(D-b+w)*i+1.12*Math.sin(D-w)*i-1.06*Math.sin(b-w)*i+.66*Math.sin(v)*r+.371*Math.sin(w)*r-.035*Math.sin(D-b+v)*r-.015*Math.sin(D-b+w)*r+.0014*Math.sin(w)*o-.0011*Math.sin(I)*o-9e-4*Math.sin(v)*o,a*=wbe;let F=u+f*Wl,k=d+p*Wl,V=A+x*Wl,G=g+h*Wl;return wQ(a,c,F,k,G,V,t)}var SQ=.012300034,gSe=SQ/(SQ+1)*-1;function ySe(e,t){return t=DQ(e,t),m.multiplyByScalar(t,gSe,t)}var IQ=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),aI=new m;jG.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),aI=_Se(e,aI),t=m.negate(aI,t),ySe(e,aI),m.subtract(t,aI,t),Z.multiplyByVector(IQ,t,t),t};jG.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=DQ(e,t),Z.multiplyByVector(IQ,t,t),t};var rg=jG;var Q3={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Q3.getMorphTime=function(e){return e===Q3.SCENE3D?1:e===Q3.MORPHING?void 0:0};var ne=Object.freeze(Q3);function ASe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var np=ASe;function cT(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=B.clone(B.IDENTITY),this._viewportTransformation=B.clone(B.IDENTITY),this._model=B.clone(B.IDENTITY),this._view=B.clone(B.IDENTITY),this._inverseView=B.clone(B.IDENTITY),this._projection=B.clone(B.IDENTITY),this._infiniteProjection=B.clone(B.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.clone(B.IDENTITY),this._view3DDirty=!0,this._view3D=new B,this._inverseView3DDirty=!0,this._inverseView3D=new B,this._inverseModelDirty=!0,this._inverseModel=new B,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,this._inverseProjectionDirty=!0,this._inverseProjection=new B,this._modelViewDirty=!0,this._modelView=new B,this._modelView3DDirty=!0,this._modelView3D=new B,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new B,this._inverseModelViewDirty=!0,this._inverseModelView=new B,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new B,this._viewProjectionDirty=!0,this._viewProjection=new B,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new B,this._modelViewProjectionDirty=!0,this._modelViewProjection=new B,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new B,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new B,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new B,this._normalDirty=!0,this._normal=new Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new jn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(cT.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return PQ(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return PQ(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){B.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,B.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,B.getMatrix3(this.inverseModel,e),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return YG(this),this._view3D}},viewRotation:{get:function(){return YG(this),this._viewRotation}},viewRotation3D:{get:function(){return YG(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return MQ(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return MQ(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return ISe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return PSe(this),this._modelView}},modelView3D:{get:function(){return OSe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return FSe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return RSe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return MSe(this),this._inverseModelView3D}},viewProjection:{get:function(){return BSe(this),this._viewProjection}},inverseViewProjection:{get:function(){return LSe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return NSe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return USe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return VSe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return kSe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return zSe(this),this._normal}},normal3D:{get:function(){return HSe(this),this._normal3D}},inverseNormal:{get:function(){return GSe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return WSe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return RQ(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return RQ(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,re.WGS84)}}});function xSe(e,t){B.clone(t,e._view),B.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function CSe(e,t){B.clone(t,e._inverseView),B.getMatrix3(t,e._inverseViewRotation)}function TSe(e,t){B.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function ESe(e,t){B.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function bSe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var cI=new Z,SSe=new he;function vSe(e,t){l(Mt.computeIcrfToFixedMatrix(t.time,cI))||(cI=Mt.computeTemeToPseudoFixedMatrix(t.time,cI));let n=rg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(cI,n,n),m.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=rg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(cI,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,SSe);i.project(o,e._sunPositionColumbusView)}cT.prototype.updateCamera=function(e){xSe(this,e.viewMatrix),CSe(this,e.inverseViewMatrix),bSe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof rn};cT.prototype.updateFrustum=function(e){TSe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&ESe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};cT.prototype.updatePass=function(e){this._pass=e};var wSe=[],DSe=new np;cT.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),vSe(this,e);let n=y(e.light,DSe);n instanceof np?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=m.multiplyByScalar(r,n.intensity,r);let o=m.maximumComponent(r);o>1?m.divideByScalar(r,o,this._lightColor):m.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,wSe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function PQ(e){if(e._viewportDirty){let t=e._viewport;B.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),B.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function ISe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?B.inverse(e._projection,e._inverseProjection):B.clone(B.ZERO,e._inverseProjection))}function PSe(e){e._modelViewDirty&&(e._modelViewDirty=!1,B.multiplyTransformation(e._view,e._model,e._modelView))}function OSe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,B.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function RSe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,B.inverse(e.modelView,e._inverseModelView))}function MSe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,B.inverse(e.modelView3D,e._inverseModelView3D))}function BSe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,B.multiply(e._projection,e._view,e._viewProjection))}function LSe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,B.inverse(e.viewProjection,e._inverseViewProjection))}function NSe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,B.multiply(e._projection,e.modelView,e._modelViewProjection))}function FSe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function USe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,B.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function VSe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,B.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function kSe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,B.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function zSe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;B.getMatrix3(e.inverseModelView,t),Z.getRotation(t,t),Z.transpose(t,t)}}function HSe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;B.getMatrix3(e.inverseModelView3D,t),Z.getRotation(t,t),Z.transpose(t,t)}}function GSe(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,B.getMatrix3(e.inverseModelView,e._inverseNormal),Z.getRotation(e._inverseNormal,e._inverseNormal))}function WSe(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,B.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Z.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var OQ=new m;function RQ(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,B.multiplyByPoint(e.inverseModel,e._cameraPosition,OQ),jn.fromCartesian(OQ,e._encodedCameraPositionMC))}var jSe=new m,YSe=new m,qSe=new m,XSe=new m,KSe=new he,JSe=new m,ZSe=new B;function QSe(e,t,n,i,r,o,s,a){let c=jSe;c.x=e.y,c.y=e.z,c.z=e.x;let u=YSe;u.x=n.y,u.y=n.z,u.z=n.x;let f=qSe;f.x=i.y,f.y=i.z,f.z=i.x;let d=XSe;d.x=t.y,d.y=t.z,d.z=t.x,o===ne.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,KSe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,JSe),A=Mt.eastNorthUpToFixedFrame(h,g,ZSe);return B.multiplyByPointAsVector(A,u,u),B.multiplyByPointAsVector(A,f,f),B.multiplyByPointAsVector(A,d,d),l(a)||(a=new B),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function YG(e){e._view3DDirty&&(e._mode===ne.SCENE3D?B.clone(e._view,e._view3D):QSe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),B.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function MQ(e){e._inverseView3DDirty&&(B.inverseTransformation(e.view3D,e._inverseView3D),B.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var lI=cT;function $Se(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function LQ(e,t,n){for(let i=0;i0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),LQ(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function BQ(e){return e.values.length/e.componentsPerAttribute}function eve(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function tve(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=BQ(e[r[0]]),t=1;t0){let u=X.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new ip({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(ip.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});ip.prototype.getAttribute=function(e){return this._attributes[e]};function nve(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ht.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function ive(e,t){let n=e._attributes,i=n.length;for(let r=0;r"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new de("The browser supports WebGL, but initialization failed.");return o}function ove(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function sve(e,t,n,i){let r=`${ove(e,i)}: ${t.name}(`;for(let o=0;o=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=lve(this._originalGLContext,e?ave:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Bt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Bt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Bt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ha({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return uve}}});function NQ(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,r,t,o,n,i)}var qG;typeof WebGLRenderingContext<"u"&&(qG=[te.BACK]);function XG(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=qG;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var fve=new ri;jl.prototype.clear=function(e,t){e=y(e,fve),t=y(t,this._defaultPassState);let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);NQ(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);XG(this,c),n.clear(i)};function dve(e,t,n,i,r){XG(e,t),NQ(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function mve(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,B.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(a=y(a,o.numberOfVertices),c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}jl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let r=y(e._framebuffer,t.framebuffer),o=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),dve(this,r,t,n,o),mve(this,e,n,i)};jl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=qG;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let c=at.createTypedArray(at.RGBA,a,r,o);return XG(this,s),t.readPixels(n,i,r,o,at.RGBA,Ze.toWebGLConstant(a,this),c),c};var FQ={position:0,textureCoordinates:1};jl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ft({attributes:{position:new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Be.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:FQ,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};jl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Be.TRIANGLES,renderState:t.renderState,shaderProgram:Zt.fromCache({context:this,vertexShaderSource:C0,fragmentShaderSource:e,attributeLocations:FQ}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};jl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function KG(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(KG.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});KG.prototype.destroy=function(){delete this._pickObjects[this.key]};jl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new KG(this._pickObjects,t,z.fromRgba(t))};jl.prototype.isDestroyed=function(){return!1};jl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};jl._deprecationWarning=$;var uI=jl;function lT(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let r=e.colorRenderbuffers,o=e.colorTextures;if(l(r)!==l(o))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Ys({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new Ys({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}lT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};lT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};lT.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};lT.prototype.isDestroyed=function(){return!1};lT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var fI=lT;var ol={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===ol.RGBA4||e===ol.RGBA8||e===ol.RGBA16F||e===ol.RGBA32F||e===ol.RGB5_A1||e===ol.RGB565||e===ol.DEPTH_COMPONENT16||e===ol.STENCIL_INDEX8||e===ol.DEPTH_STENCIL||e===ol.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?ol.RGBA32F:e===te.HALF_FLOAT_OES?ol.RGBA16F:ol.RGBA8}},Cc=Object.freeze(ol);function dI(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ht.maximumRenderbufferSize,r=y(e.format,Cc.RGBA4),o=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(dI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});dI.prototype._getRenderbuffer=function(){return this._renderbuffer};dI.prototype.isDestroyed=function(){return!1};dI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Yl=dI;function rs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(rs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});rs.prototype.isDirty=function(e,t,n,i,r){n=y(n,1);let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};rs.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?y(i,1):1,r=y(r,this._color?y(this._pixelDatatype,Ze.UNSIGNED_BYTE):void 0),o=y(o,this._color?y(this._pixelFormat,at.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Cc.getColorFormat(r);this._colorRenderbuffers[s]=new Yl({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Bt({context:e,width:t,height:n,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ze.UNSIGNED_INT_24_8,sampler:dn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Yl({context:e,width:t,height:n,format:Cc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Yl({context:e,width:t,height:n,format:Cc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Bt({context:e,width:t,height:n,pixelFormat:at.DEPTH_COMPONENT,pixelDatatype:Ze.UNSIGNED_INT,sampler:dn.NEAREST}):this._depthRenderbuffer=new Yl({context:e,width:t,height:n,format:Cc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new fI({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Ys({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};rs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};rs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};rs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};rs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};rs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};rs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};rs.prototype.getDepthTexture=function(){return this._depthTexture};rs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};rs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};rs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};rs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};rs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};rs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};rs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};rs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};rs.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e0?X.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Cs._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Cs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t0&&(this._hash={},e.length=0)};var Et=F0;function ql(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(ql.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});ql.packedLength=2;ql.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};ql.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ql),n.near=e[t++],n.far=e[t],n};ql.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};ql.clone=function(e,t){if(l(e))return l(t)||(t=new ql),t.near=e.near,t.far=e.far,t};ql.prototype.clone=function(e){return ql.clone(this,e)};ql.prototype.equals=function(e){return ql.equals(this,e)};var Dt=ql;function Ku(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Ku.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Ku(e.near,e.nearValue,e.far,e.farValue)};Ku.packedLength=4;Ku.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Ku.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ku),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Ku.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Ku.prototype.clone=function(e){return Ku.clone(this,e)};Ku.prototype.equals=function(e){return Ku.equals(this,e)};var Lt=Ku;var bve={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qe=Object.freeze(bve);var Sve={CENTER:0,LEFT:1,RIGHT:-1},_i=Object.freeze(Sve);var vve={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Mn=Object.freeze(vve);var wve={DONE:0,PENDING:1,FAILED:2},lt=Object.freeze(wve);function sd(){fe.throwInstantiationError()}Object.defineProperties(sd.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});sd.prototype.getValue=fe.throwInstantiationError;sd.prototype.equals=fe.throwInstantiationError;sd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};sd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new UQ(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new UQ(o)):($G(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],$G(s.get(o.id),o,a),s.remove(o.id)};function $G(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var gI=sg;function qve(e,t){this.start=y(e,0),this.stop=y(t,0)}var Ec=qve;function gn(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var n8=new m,i8=new m,r8=new m,o8=new m,s8=new m,a8=new m,c8=new m,Xs=new m,l8=new m,u8=new m,f8=new m,d8=new m,Xve=4/3*P.PI;gn.fromPoints=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],c8),i=m.clone(n,n8),r=m.clone(n,i8),o=m.clone(n,r8),s=m.clone(n,o8),a=m.clone(n,s8),c=m.clone(n,a8),u=e.length,f;for(f=1;fs.x&&m.clone(n,s),La.y&&m.clone(n,a),Nc.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,Xs)),p=m.magnitudeSquared(m.subtract(a,r,Xs)),g=m.magnitudeSquared(m.subtract(c,o,Xs)),h=i,A=s,x=d;p>x&&(x=p,h=r,A=a),g>x&&(x=g,h=o,A=c);let C=l8;C.x=(h.x+A.x)*.5,C.y=(h.y+A.y)*.5,C.z=(h.z+A.z)*.5;let T=m.magnitudeSquared(m.subtract(A,C,Xs)),E=Math.sqrt(T),S=u8;S.x=i.x,S.y=r.y,S.z=o.z;let w=f8;w.x=s.x,w.y=a.y,w.z=c.z;let D=m.midpoint(S,w,d8),R=0;for(f=0;fR&&(R=O);let L=m.magnitudeSquared(m.subtract(n,C,Xs));if(L>T){let N=Math.sqrt(L);E=(E+N)*.5,T=E*E;let _=N-E;C.x=(E*C.x+_*n.x)/N,C.y=(E*C.y+_*n.y)/N,C.z=(E*C.z+_*n.z)/N}}return Ec.x&&m.clone(r,c),_u.y&&m.clone(r,u),bf.z&&m.clone(r,f)}let g=m.magnitudeSquared(m.subtract(c,o,Xs)),h=m.magnitudeSquared(m.subtract(u,s,Xs)),A=m.magnitudeSquared(m.subtract(f,a,Xs)),x=o,C=c,T=g;h>T&&(T=h,x=s,C=u),A>T&&(T=A,x=a,C=f);let E=l8;E.x=(x.x+C.x)*.5,E.y=(x.y+C.y)*.5,E.z=(x.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,E,Xs)),w=Math.sqrt(S),D=u8;D.x=o.x,D.y=s.y,D.z=a.z;let R=f8;R.x=c.x,R.y=u.y,R.z=f.z;let O=m.midpoint(D,R,d8),L=0;for(p=0;pL&&(L=N);let _=m.magnitudeSquared(m.subtract(r,E,Xs));if(_>S){let b=Math.sqrt(_);w=(w+b)*.5,S=w*w;let v=b-w;E.x=(w*E.x+v*r.x)/b,E.y=(w*E.y+v*r.y)/b,E.z=(w*E.z+v*r.z)/b}}return wa.x&&m.clone(i,a),Nc.y&&m.clone(i,c),_u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,r,Xs)),g=m.magnitudeSquared(m.subtract(c,o,Xs)),h=m.magnitudeSquared(m.subtract(u,s,Xs)),A=r,x=a,C=p;g>C&&(C=g,A=o,x=c),h>C&&(C=h,A=s,x=u);let T=l8;T.x=(A.x+x.x)*.5,T.y=(A.y+x.y)*.5,T.z=(A.z+x.z)*.5;let E=m.magnitudeSquared(m.subtract(x,T,Xs)),S=Math.sqrt(E),w=u8;w.x=r.x,w.y=o.y,w.z=s.z;let D=f8;D.x=a.x,D.y=c.y,D.z=u.z;let R=m.midpoint(w,D,d8),O=0;for(d=0;dO&&(O=L);let N=m.magnitudeSquared(m.subtract(i,T,Xs));if(N>E){let _=Math.sqrt(N);S=(S+_)*.5,E=S*S;let b=_-S;T.x=(S*T.x+b*i.x)/_,T.y=(S*T.y+b*i.y)/_,T.z=(S*T.z+b*i.z)/_}}return S=c+s)return e.clone(n),n;if(s>=c+r)return t.clone(n),n;let u=(r+c+s)*.5,f=m.multiplyByScalar(a,(-r+u)/c,swe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var awe=new m;gn.expand=function(e,t,n){n=gn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,awe));return i>n.radius&&(n.radius=i),n};gn.intersectPlane=function(e,t){let n=e.center,i=e.radius,r=t.normal,o=m.dot(r,n)+t.distance;return o<-i?tn.OUTSIDE:o RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_HSBToRGB + * @glslFunction + * + * @param {vec3} hsb The color in HSB. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; +const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -void main() +vec3 czm_HSBToRGB(vec3 hsb) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); + return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); } -`;var TI=`in vec3 v_positionEC; -in vec3 v_normalEC; +`;var OI=`/** + * Converts an HSL color (hue, saturation, lightness) to RGB + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_HSLToRGB + * @glslFunction + * + * @param {vec3} rgb The color in HSL. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ -void main() +vec3 hueToRGB(float hue) { - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + float r = abs(hue * 6.0 - 3.0) - 1.0; + float g = 2.0 - abs(hue * 6.0 - 2.0); + float b = 2.0 - abs(hue * 6.0 - 4.0); + return clamp(vec3(r, g, b), 0.0, 1.0); } -`;var EI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -void main() +vec3 czm_HSLToRGB(vec3 hsl) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + vec3 rgb = hueToRGB(hsl.x); + float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; + return (rgb - 0.5) * c + hsl.z; } -`;var bI=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var SI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() +`;var RI=`/** + * Adjusts the hue of a color. + * + * @name czm_hue + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the hue of the color in radians. + * + * @returns {float} The color with the hue adjusted. + * + * @example + * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) + */ +vec3 czm_hue(vec3 rgb, float adjustment) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + const mat3 toYIQ = mat3(0.299, 0.587, 0.114, + 0.595716, -0.274453, -0.321263, + 0.211456, -0.522591, 0.311135); + const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, + 1.0, -0.2721, -0.6474, + 1.0, -1.107, 1.7046); + + vec3 yiq = toYIQ * rgb; + float hue = atan(yiq.z, yiq.y) + adjustment; + float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); + + vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); + return toRGB * color; } -`;var Ewe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},ya=Object.freeze(Ewe);var bwe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},Tr=Object.freeze(bwe);var Swe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.SOURCE_ALPHA,functionSourceAlpha:Tr.ONE,functionDestinationRgb:Tr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Tr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.ONE,functionSourceAlpha:Tr.ONE,functionDestinationRgb:Tr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Tr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.SOURCE_ALPHA,functionSourceAlpha:Tr.ONE,functionDestinationRgb:Tr.ONE,functionDestinationAlpha:Tr.ONE})},mn=Object.freeze(Swe);var vwe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},gi=Object.freeze(vwe);function dT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(dT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});dT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};dT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};dT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=mn.ALPHA_BLEND):t.depthMask=!0,t};dT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=mn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:gi.BACK}),l(n)&&(i=gt(n,i,!0)),i};var $i=dT;var vI=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var MI=`/** + * Converts a color in linear space to RGB space. + * + * @name czm_inverseGamma + * @glslFunction + * + * @param {vec3} color The color in linear space. + * @returns {vec3} The color in RGB space. + */ +vec3 czm_inverseGamma(vec3 color) { + return pow(color, vec3(1.0 / czm_gamma)); +} +`;var LI=`/** + * Determines if a time interval is empty. + * + * @name czm_isEmpty + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} true if the time interval is empty; otherwise, false. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isEmpty(czm_raySegment interval) { - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + return (interval.stop < 0.0); } -`;var wI=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var NI=`/** + * Determines if a time interval is empty. + * + * @name czm_isFull + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} true if the time interval is empty; otherwise, false. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isFull(czm_raySegment interval) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; + return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var DI=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var FI=`/** + * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. + * + * @name czm_latitudeToWebMercatorFraction + * @glslFunction + * + * @param {float} latitude The geodetic latitude, in radians. + * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. + * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * + * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern + * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return + * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. + */ +float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; + float sinLatitude = sin(latitude); + float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); + + return (mercatorY - southMercatorY) * oneOverMercatorHeight; } -`;var II=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var BI=`/** + * Converts a linear RGB color to an sRGB color. + * + * @param {vec3|vec4} linearIn The color in linear color space. + * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + */ +vec3 czm_linearToSrgb(vec3 linearIn) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; + return pow(linearIn, vec3(1.0/2.2)); } -`;var PI=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. -float getHeight(int idx, float invTexSize) +vec4 czm_linearToSrgb(vec4 linearIn) { - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif + vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); + return vec4(srgbOut, linearIn.a); } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var kI=`/** + * Computes distance from an point in 2D to a line in 2D. + * + * @name czm_lineDistance + * @glslFunction + * + * param {vec2} point1 A point along the line. + * param {vec2} point2 A point along the line. + * param {vec2} point A point that may or may not be on the line. + * returns {float} The distance from the point to the line. + */ +float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { + return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); +} +`;var UI=`/** + * Computes the luminance of a color. + * + * @name czm_luminance + * @glslFunction + * + * @param {vec3} rgb The color. + * + * @returns {float} The luminance. + * + * @example + * float light = czm_luminance(vec3(0.0)); // 0.0 + * float dark = czm_luminance(vec3(1.0)); // ~1.0 + */ +float czm_luminance(vec3 rgb) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); +} +`;var VI=`/** + * Computes the size of a pixel in meters at a distance from the eye. + *

+ * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. + *

+ * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +{ + float width = czm_viewport.z; + float height = czm_viewport.w; + float pixelWidth; + float pixelHeight; - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } + if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) + { + float frustumWidth = right - left; + float frustumHeight = top - bottom; + pixelWidth = frustumWidth / width; + pixelHeight = frustumHeight / height; } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) + else { - color.rgb /= color.a; + float distanceToPixel = -positionEC.z; + float inverseNear = 1.0 / czm_currentFrustum.x; + float tanTheta = top * inverseNear; + pixelHeight = 2.0 * distanceToPixel * tanTheta / height; + tanTheta = right * inverseNear; + pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } - - color.rgb = czm_gammaCorrect(color.rgb); - material.diffuse = color.rgb; - material.alpha = color.a; - return material; + return max(pixelWidth, pixelHeight) * pixelRatio; } -`;var OI=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif - -uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Computes the size of a pixel in meters at a distance from the eye. + *

+ * Use this version when scaling by pixel ratio. + *

+ * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; + return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var RI=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var zI=`/** + * Transforms a position from model to window coordinates. The transformation + * from model to clip coordinates is done using {@link czm_modelViewProjection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of near = 0 and far = 1. + *

+ * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + *

+ * This function should not be confused with {@link czm_viewportOrthographic}, + * which is an orthographic projection matrix that transforms from window + * coordinates to clip coordinates. + * + * @name czm_modelToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in model coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_eyeToWindowCoordinates + * @see czm_modelViewProjection + * @see czm_viewportTransformation + * @see czm_viewportOrthographic + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + */ +vec4 czm_modelToWindowCoordinates(vec4 position) { - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + vec4 q = czm_modelViewProjection * position; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; } -`;var MI=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) +`;var HI=`/** + * DOC_TBA + * + * @name czm_multiplyWithColorBalance + * @glslFunction + */ +vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + + vec3 target = left * right; + float leftLuminance = dot(left, W); + float rightLuminance = dot(right, W); + float targetLuminance = dot(target, W); + + return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var GI=`/** + * Computes a value that scales with distance. The scaling is clamped at the near and + * far distances, and does not extrapolate. This function works with the + * {@link NearFarScalar} JavaScript class. + * + * @name czm_nearFarScalar + * @glslFunction + * + * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). + * @param {float} cameraDistSq The square of the current distance from the camera. + * + * @returns {float} The value at this distance. + */ +float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; + float valueAtMin = nearFarScalar.y; + float valueAtMax = nearFarScalar.w; + float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; + float farDistanceSq = nearFarScalar.z * nearFarScalar.z; - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); + float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; + t = pow(clamp(t, 0.0, 1.0), 0.2); - return material; + return mix(valueAtMin, valueAtMax, t); } -`;var BI=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif +`;var WI=` /** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded, float range) + { + if (encoded.x == 0.0 && encoded.y == 0.0) { + return vec3(0.0, 0.0, 0.0); + } -uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; + encoded = encoded / range * 2.0 - 1.0; + vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); + if (v.z < 0.0) + { + v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); + } -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); + return normalize(v); + } - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; +/** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded) + { + return czm_octDecode(encoded, 255.0); + } - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + /** + * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {float} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(float encoded) + { + float temp = encoded / 256.0; + float x = floor(temp); + float y = (temp - x) * 256.0; + return czm_octDecode(vec2(x, y)); + } - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; +/** + * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The packed oct-encoded, unit-length vectors. + * @param {vec3} vector1 One decoded and normalized vector. + * @param {vec3} vector2 One decoded and normalized vector. + * @param {vec3} vector3 One decoded and normalized vector. + */ + void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) + { + float temp = encoded.x / 65536.0; + float x = floor(temp); + float encodedFloat1 = (temp - x) * 65536.0; - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif + temp = encoded.y / 65536.0; + float y = floor(temp); + float encodedFloat2 = (temp - y) * 65536.0; - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); + vector1 = czm_octDecode(encodedFloat1); + vector2 = czm_octDecode(encodedFloat2); + vector3 = czm_octDecode(vec2(x, y)); + } - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; +`;var jI=`/** + * Packs a depth value into a vec3 that can be represented by unsigned bytes. + * + * @name czm_packDepth + * @glslFunction + * + * @param {float} depth The floating-point depth. + * @returns {vec3} The packed depth. + */ +vec4 czm_packDepth(float depth) +{ + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; + enc = fract(enc); + enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + return enc; +} +`;var qI=`vec3 lambertianDiffuse(vec3 diffuseColor) +{ + return diffuseColor / czm_pi; +} - return material; +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +{ + return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); } -`;var LI=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +float smithVisibilityG1(float NdotV, float roughness) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; + // this is the k value for direct lighting. + // for image based lighting it will be roughness^2 / 2 + float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; + return NdotV / (NdotV * (1.0 - k) + k); } -`;var NI=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -uniform vec4 color; +float smithVisibilityGGX(float roughness, float NdotL, float NdotV) +{ + return ( + smithVisibilityG1(NdotL, roughness) * + smithVisibilityG1(NdotV, roughness) + ); +} -float getPointOnLine(vec2 p0, vec2 p1, float x) +float GGX(float roughness, float NdotH) { - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; + float roughnessSquared = roughness * roughness; + float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; + return roughnessSquared / (czm_pi * f * f); } -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Compute the diffuse and specular contributions using physically based + * rendering. This function only handles direct lighting. + *

+ * This function only handles the lighting calculations. Metallic/roughness + * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} + *

+ * + * @name czm_pbrlighting + * @glslFunction + * + * @param {vec3} positionEC The position of the fragment in eye coordinates + * @param {vec3} normalEC The surface normal in eye coordinates + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. + * @param {czm_pbrParameters} The computed PBR parameters. + * @return {vec3} The computed HDR color + * + * @example + * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( + * baseColor, + * metallic, + * roughness + * ); + * vec3 color = czm_pbrlighting( + * positionEC, + * normalEC, + * lightDirectionEC, + * lightColorHdr, + * pbrParameters); + */ +vec3 czm_pbrLighting( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { - czm_material material = czm_getDefaultMaterial(materialInput); + vec3 v = -normalize(positionEC); + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); + vec3 n = normalEC; + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; + float NdotH = clamp(dot(n, h), 0.0, 1.0); + float LdotH = clamp(dot(l, h), 0.0, 1.0); + float VdotH = clamp(dot(v, h), 0.0, 1.0); - vec2 st = materialInput.st; + vec3 f0 = pbrParameters.f0; + float reflectance = max(max(f0.r, f0.g), f0.b); + vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(f0, f90, VdotH); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif + float alpha = pbrParameters.roughness; + float G = smithVisibilityGGX(alpha, NdotL, NdotV); + float D = GGX(alpha, NdotH); + vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + vec3 diffuseColor = pbrParameters.diffuseColor; + // F here represents the specular contribution + vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); + // Lo = (diffuse + specular) * Li * NdotL + return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; +} +`;var YI=`/** + * Compute parameters for physically based rendering using the + * metallic/roughness workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrMetallicRoughnessMaterial + * @glslFunction + * + * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) + * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); + * @param {float} roughness A value between 0.0 and 1.0 + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrMetallicRoughnessMaterial( + vec3 baseColor, + float metallic, + float roughness +) +{ + czm_pbrParameters results; - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); + // roughness is authored as perceptual roughness + // square it to get material roughness + roughness = clamp(roughness, 0.0, 1.0); + results.roughness = roughness * roughness; - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var FI=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; + // dielectrics use f0 = 0.04, metals use albedo as f0 + metallic = clamp(metallic, 0.0, 1.0); + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); + results.f0 = f0; -const float maskLength = 16.0; + // diffuse only applies to dielectrics. + results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); + return results; } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var XI=`/** + * Compute parameters for physically based rendering using the + * specular/glossy workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrSpecularGlossinessMaterial + * @glslFunction + * + * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) + * @param {vec3} specular The reflectance at normal incidence (f0) + * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrSpecularGlossinessMaterial( + vec3 diffuse, + vec3 specular, + float glossiness +) { - czm_material material = czm_getDefaultMaterial(materialInput); + czm_pbrParameters results; - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + // glossiness is the opposite of roughness, but easier for artists to use. + float roughness = 1.0 - glossiness; + results.roughness = roughness * roughness; - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } + results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); + results.f0 = specular; - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; + return results; } -`;var UI=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var KI=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; + return czm_getLambertDiffuse(lightDirectionEC, material.normal); } -`;var VI=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) { - czm_material material = czm_getDefaultMaterial(materialInput); + return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +} - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); +/** + * Computes a color using the Phong lighting model. + * + * @name czm_phong + * @glslFunction + * + * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. + * @param {czm_material} material The fragment's material. + * + * @returns {vec4} The computed color. + * + * @example + * vec3 positionToEyeEC = // ... + * czm_material material = // ... + * vec3 lightDirectionEC = // ... + * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * + * @see czm_getMaterial + */ +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down) + float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); + } - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; - material.diffuse = outColor.rgb; - material.alpha = outColor.a; + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - return material; + return vec4(color, material.alpha); } -`;var kI=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); + float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); + vec3 ambient = vec3(0.0); + vec3 color = ambient + material.emission; + color += material.diffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - return material; + return vec4(color, material.alpha); +} +`;var JI=`/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec4 plane, vec3 point) { + return (dot(plane.xyz, point) + plane.w); } -`;var zI=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js + * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { + return (dot(planeNormal, point) + planeDistance); +} +`;var ZI=`/** + * Computes the point along a ray at the given time. time can be positive, negative, or zero. + * + * @name czm_pointAlongRay + * @glslFunction + * + * @param {czm_ray} ray The ray to compute the point along. + * @param {float} time The time along the ray. + * + * @returns {vec3} The point along the ray at the given time. + * + * @example + * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction + * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) + */ +vec3 czm_pointAlongRay(czm_ray ray, float time) { - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + return ray.origin + (time * ray.direction); } -`;var HI=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var $I=`/** + * DOC_TBA + * + * @name czm_rayEllipsoidIntersectionInterval + * @glslFunction + */ +czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); + // ray and ellipsoid center in eye coordinates. radii in model coordinates. + vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; + vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - material.diffuse = color.rgb; - material.alpha = color.a; + q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - return material; -} -`;var GI=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + float q2 = dot(q, q); + float qw = dot(q, w); -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; + if (q2 > 1.0) // Outside ellipsoid. + { + if (qw >= 0.0) // Looking outward or tangent (0 intersections). + { + return czm_emptyRaySegment; + } + else // qw < 0.0. + { + float qw2 = qw * qw; + float difference = q2 - 1.0; // Positively valued. + float w2 = dot(w, w); + float product = w2 * difference; -czm_material czm_getMaterial(czm_materialInput materialInput) + if (qw2 < product) // Imaginary roots (0 intersections). + { + return czm_emptyRaySegment; + } + else if (qw2 > product) // Distinct roots (2 intersections). + { + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Avoid cancellation. + float root0 = temp / w2; + float root1 = difference / temp; + if (root0 < root1) + { + czm_raySegment i = czm_raySegment(root0, root1); + return i; + } + else + { + czm_raySegment i = czm_raySegment(root1, root0); + return i; + } + } + else // qw2 == product. Repeated roots (2 intersections). + { + float root = sqrt(difference / w2); + czm_raySegment i = czm_raySegment(root, root); + return i; + } + } + } + else if (q2 < 1.0) // Inside ellipsoid (2 intersections). + { + float difference = q2 - 1.0; // Negatively valued. + float w2 = dot(w, w); + float product = w2 * difference; // Negatively valued. + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Positively valued. + czm_raySegment i = czm_raySegment(0.0, temp / w2); + return i; + } + else // q2 == 1.0. On ellipsoid. + { + if (qw < 0.0) // Looking inward. + { + float w2 = dot(w, w); + czm_raySegment i = czm_raySegment(0.0, -qw / w2); + return i; + } + else // qw >= 0.0. Looking outward or tangent. + { + return czm_emptyRaySegment; + } + } +} +`;var QI=`/** + * Compute the intersection interval of a ray with a sphere. + * + * @name czm_raySphereIntersectionInterval + * @glslFunction + * + * @param {czm_ray} ray The ray. + * @param {vec3} center The center of the sphere. + * @param {float} radius The radius of the sphere. + * @return {czm_raySegment} The intersection interval of the ray with the sphere. + */ +czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + vec3 o = ray.origin; + vec3 d = ray.direction; - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + vec3 oc = o - center; - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + float a = dot(d, d); + float b = 2.0 * dot(d, oc); + float c = dot(oc, oc) - (radius * radius); - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); + float det = (b * b) - (4.0 * a * c); - material.diffuse = material.diffuse; + if (det < 0.0) { + return czm_emptyRaySegment; + } - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + float sqrtDet = sqrt(det); - material.specular = specularIntensity; - material.shininess = 10.0; + float t0 = (-b - sqrtDet) / (2.0 * a); + float t1 = (-b + sqrtDet) / (2.0 * a); - return material; + czm_raySegment result = czm_raySegment(t0, t1); + return result; } -`;function Xe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,un.LINEAR),this._magnificationFilter=y(e.magnificationFilter,xi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,wwe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Xe._uniformList[this.type])||(Xe._uniformList[this.type]=Object.keys(this._uniforms))}Xe._uniformList={};Xe.fromType=function(e,t){let n=new Xe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Xe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i-1)return!0;return!1}function Mwe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +`;var e1=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&Rwe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; -`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${r} = ${t[r]}; -`}e.shaderSource+=`return material; + return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`}}var ZQ={mat2:Zi,mat3:Z,mat4:B},Bwe=/\.ktx2$/i;function Lwe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===Xe.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new dn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Bt({context:i,source:o,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Bt&&o!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),a)return;let d=o instanceof ve;if(!l(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if(typeof o=="string"||d){let p=d?o:ve.createIfNeeded(o),g;Bwe.test(p.url)?g=il(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}function Nwe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ha){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Xe.DefaultCubeMapId)return;let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){let o=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(o).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=r}}}function Fwe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&QQ(e,n)}function QQ(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=Uwe(r),s;if(o==="channels")s=WI(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;kwe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},QQ(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=WI(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Lwe(t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Nwe(t));else if(o.indexOf("mat")!==-1){let u=new ZQ[o];e._uniforms[c]=function(){return ZQ[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Uwe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Xe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function Vwe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new Xe({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=gt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;WI(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=WI(e,i,a)}}function WI(e,t,n,i){i=y(i,!0);let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function kwe(e,t,n){return WI(e,t,t,n)}Xe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Xe.DefaultImageId="czm_defaultImage";Xe.DefaultCubeMapId="czm_defaultCubeMap";Xe.ColorType="Color";Xe._materialCache.addMaterial(Xe.ColorType,{fabric:{type:Xe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.ImageType="Image";Xe._materialCache.addMaterial(Xe.ImageType,{fabric:{type:Xe.ImageType,uniforms:{image:Xe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.DiffuseMapType="DiffuseMap";Xe._materialCache.addMaterial(Xe.DiffuseMapType,{fabric:{type:Xe.DiffuseMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.AlphaMapType="AlphaMap";Xe._materialCache.addMaterial(Xe.AlphaMapType,{fabric:{type:Xe.AlphaMapType,uniforms:{image:Xe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Xe.SpecularMapType="SpecularMap";Xe._materialCache.addMaterial(Xe.SpecularMapType,{fabric:{type:Xe.SpecularMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Xe.EmissionMapType="EmissionMap";Xe._materialCache.addMaterial(Xe.EmissionMapType,{fabric:{type:Xe.EmissionMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.BumpMapType="BumpMap";Xe._materialCache.addMaterial(Xe.BumpMapType,{fabric:{type:Xe.BumpMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:wI},translucent:!1});Xe.NormalMapType="NormalMap";Xe._materialCache.addMaterial(Xe.NormalMapType,{fabric:{type:Xe.NormalMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:LI},translucent:!1});Xe.GridType="Grid";Xe._materialCache.addMaterial(Xe.GridType,{fabric:{type:Xe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:BI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Xe.StripeType="Stripe";Xe._materialCache.addMaterial(Xe.StripeType,{fabric:{type:Xe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:HI},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Xe.CheckerboardType="Checkerboard";Xe._materialCache.addMaterial(Xe.CheckerboardType,{fabric:{type:Xe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:DI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.DotType="Dot";Xe._materialCache.addMaterial(Xe.DotType,{fabric:{type:Xe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:II},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.WaterType="Water";Xe._materialCache.addMaterial(Xe.WaterType,{fabric:{type:Xe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Xe.DefaultImageId,normalMap:Xe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:GI},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Xe.RimLightingType="RimLighting";Xe._materialCache.addMaterial(Xe.RimLightingType,{fabric:{type:Xe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:kI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Xe.FadeType="Fade";Xe._materialCache.addMaterial(Xe.FadeType,{fabric:{type:Xe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:MI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Xe.PolylineArrowType="PolylineArrow";Xe._materialCache.addMaterial(Xe.PolylineArrowType,{fabric:{type:Xe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:NI},translucent:!0});Xe.PolylineDashType="PolylineDash";Xe._materialCache.addMaterial(Xe.PolylineDashType,{fabric:{type:Xe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:FI},translucent:!0});Xe.PolylineGlowType="PolylineGlow";Xe._materialCache.addMaterial(Xe.PolylineGlowType,{fabric:{type:Xe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:UI},translucent:!0});Xe.PolylineOutlineType="PolylineOutline";Xe._materialCache.addMaterial(Xe.PolylineOutlineType,{fabric:{type:Xe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:VI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Xe.ElevationContourType="ElevationContour";Xe._materialCache.addMaterial(Xe.ElevationContourType,{fabric:{type:Xe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:OI},translucent:!1});Xe.ElevationRampType="ElevationRamp";Xe._materialCache.addMaterial(Xe.ElevationRampType,{fabric:{type:Xe.ElevationRampType,uniforms:{image:Xe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:RI},translucent:!1});Xe.SlopeRampMaterialType="SlopeRamp";Xe._materialCache.addMaterial(Xe.SlopeRampMaterialType,{fabric:{type:Xe.SlopeRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:zI},translucent:!1});Xe.AspectRampMaterialType="AspectRamp";Xe._materialCache.addMaterial(Xe.AspectRampMaterialType,{fabric:{type:Xe.AspectRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:vI},translucent:!1});Xe.ElevationBandType="ElevationBand";Xe._materialCache.addMaterial(Xe.ElevationBandType,{fabric:{type:Xe.ElevationBandType,uniforms:{heights:Xe.DefaultImageId,colors:Xe.DefaultImageId},source:PI},translucent:!0});var ki=Xe;function U0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,U0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=$i.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(U0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});U0.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;U0.prototype.isTranslucent=$i.prototype.isTranslucent;U0.prototype.getRenderState=$i.prototype.getRenderState;U0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:EI,fragmentShaderSource:TI}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:SI,fragmentShaderSource:bI}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:CI,fragmentShaderSource:xI})};var or=U0;var jI=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +`;var t1=`/** + * Reads a value previously transformed with {@link czm_writeNonPerspective} + * by dividing it by \`w\`, the value used in the perspective divide. + * This function is intended to be called in a fragment shader to access a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The value should have been + * previously written in the vertex shader with a call to + * {@link czm_writeNonPerspective}. + * + * @name czm_readNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. + * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. + * @returns {float|vec2|vec3|vec4} The usable value. + */ +float czm_readNonPerspective(float value, float oneOverW) { + return value * oneOverW; } -`;var YI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { + return value * oneOverW; +} - gl_Position = czm_modelViewProjectionRelativeToEye * p; +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { + return value * oneOverW; } -`;var V0=`in vec4 v_color; -void main() +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { + return value * oneOverW; +} +`;var n1=`float czm_reverseLogDepth(float logZ) { - out_FragColor = czm_gammaCorrect(v_color); +#ifdef LOG_DEPTH + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + return far * (1.0 - near / (depthFromNear + near)) / (far - near); +#endif + return logZ; } -`;var qI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; +`;var i1=`/** + * Converts an RGB color to HSB (hue, saturation, brightness) + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_RGBToHSB + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -out vec4 v_color; +const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -void main() +vec3 czm_RGBToHSB(vec3 rgb) { - vec4 p = czm_computePosition(); - - v_color = color; + vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); + vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); - gl_Position = czm_modelViewProjectionRelativeToEye * p; + float d = q.x - min(q.w, q.y); + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); +} +`;var o1=`/** + * Converts an RGB color to HSL (hue, saturation, lightness) + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_RGBToHSL + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSL. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ + +vec3 RGBtoHCV(vec3 rgb) +{ + // Based on work by Sam Hocevar and Emil Persson + vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); + vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); + float c = q.x - min(q.w, q.y); + float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); + return vec3(h, c, q.x); } -`;function op(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),r=i?qI:YI,o=i?V0:jI,s=i?op.FLAT_VERTEX_FORMAT:op.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,r),this._fragmentShaderSource=y(e.fragmentShaderSource,o),this._renderState=$i.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(op.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});op.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;op.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;op.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;op.prototype.isTranslucent=$i.prototype.isTranslucent;op.prototype.getRenderState=$i.prototype.getRenderState;var an=op;function mT(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(mT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});mT.prototype.getType=function(e){return"Color"};mT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};mT.prototype.equals=function(e){return this===e||e instanceof mT&&j.equals(this._color,e._color)};var Vt=mT;function ag(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Si(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(ag.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});ag.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=r&&(u=r-1);let f=(i.north-e.latitude)/a|0;return f>=o&&(f=o-1),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var zi=ag;var $Q=new m,e$=new m,t$=new he,p8=new m,zwe=new m,n$=new ae,Hwe=new zi,XI=[new he,new he,new he,new he],KI=new H,Fo={};Fo.initialize=function(){let e=Fo._initPromise;return l(e)||(e=ve.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Fo._terrainHeights=t}),Fo._initPromise=e),e};Fo.getMinimumMaximumHeights=function(e,t){t=y(t,re.WGS84);let n=i$(e),i=Fo._defaultMinTerrainHeight,r=Fo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Fo._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ce.northeast(e,t$),$Q),t.cartographicToCartesian(ce.southwest(e,t$),e$),m.midpoint(e$,$Q,p8);let a=t.scaleToGeodeticSurface(p8,zwe);if(l(a)){let c=m.distance(p8,a);i=Math.min(i,-c)}else i=Fo._defaultMinTerrainHeight}return i=Math.max(Fo._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Fo.getBoundingSphere=function(e,t){t=y(t,re.WGS84);let n=i$(e),i=Fo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Fo._terrainHeights[o];l(s)&&(i=s[1])}let r=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,n$),ae.union(r,n$,r)};function i$(e){he.fromRadians(e.east,e.north,0,XI[0]),he.fromRadians(e.west,e.north,0,XI[1]),he.fromRadians(e.east,e.south,0,XI[2]),he.fromRadians(e.west,e.south,0,XI[3]);let t=0,n=0,i=0,r=0,o=Fo._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=XI[c];if(Hwe.positionToTileXY(u,s,KI),c===0)i=KI.x,r=KI.y;else if(i!==KI.x||r!==KI.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Fo._terrainHeightsMaxLevel=6;Fo._defaultMaxTerrainHeight=9e3;Fo._defaultMinTerrainHeight=-1e5;Fo._terrainHeights=void 0;Fo._initPromise=void 0;Object.defineProperties(Fo,{initialized:{get:function(){return l(Fo._terrainHeights)}}});var si=Fo;function bc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}bc.fromCorners=function(e,t,n){return l(n)||(n=new bc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};bc.fromPoints=function(e,t){if(l(t)||(t=new bc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d0?tn.INSIDE:o+r<0?tn.OUTSIDE:tn.INTERSECTING};bc.prototype.clone=function(e){return bc.clone(this,e)};bc.prototype.intersectPlane=function(e){return bc.intersectPlane(this,e)};bc.prototype.equals=function(e){return bc.equals(this,e)};var cg=bc;var _8={};_8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function r$(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))u&&u/c0?[a/e,n/a]:[n/a,a/e]};var Sc=_8;var y8={};y8.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function g8(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,h=o*a-d,A=4*p*h-g*g,x,C;if(A<0){let q,Y,Q;f*u>=c*d?(q=r,Y=p,Q=-2*o*p+r*g):(q=a,Y=h,Q=-a*g+2*s*h);let K=-(Q<0?-1:1)*Math.abs(q)*Math.sqrt(-A);C=-Q+K;let J=C/2,me=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),ye=C===K?-me:-Y/me;return x=Y<=0?me+ye:-Q/(me*me+ye*ye+Y),f*u>=c*d?[(x-o)/r]:[-a/(x+s)]}let T=p,E=-2*o*p+r*g,S=h,w=-a*g+2*s*h,D=Math.sqrt(A),R=Math.sqrt(3)/2,O=Math.abs(Math.atan2(r*D,-E)/3);x=2*Math.sqrt(-T);let L=Math.cos(O);C=x*L;let N=x*(-L/2-R*Math.sin(O)),_=C+N>2*o?C-o:N-o,b=r,v=_/b;O=Math.abs(Math.atan2(a*D,-w)/3),x=2*Math.sqrt(-S),L=Math.cos(O),C=x*L,N=x*(-L/2-R*Math.sin(O));let I=-a,M=C+N<2*s?C+s:N+s,F=I/M,k=b*M,V=-_*M-b*I,G=_*I,U=(s*V-o*G)/(-o*V+s*k);return v<=U?v<=F?U<=F?[v,U,F]:[v,F,U]:[F,v,U]:v<=F?[U,v,F]:U<=F?[U,F,v]:[F,U,v]}y8.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Sc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Sc.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return g8(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):g8(e,t,0,i);if(i===0)return r=Sc.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return g8(e,t,n,i)};var k0=y8;var A8={};A8.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,h=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*h+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function cd(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=k0.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)=0&&g>=0){let A=Math.sqrt(p),x=Math.sqrt(g);return[u-x,u-A,u+A,u+x]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,h=Sc.computeRealRoots(1,d,p),A=Sc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,A.length!==0?(A[0]+=u,A[1]+=u,h[1]<=A[0]?[h[0],h[1],A[0],A[1]]:A[1]<=h[0]?[A[0],A[1],h[0],h[1]]:h[0]>=A[0]&&h[1]<=A[1]?[A[0],h[0],h[1],A[1]]:A[0]>=h[0]&&A[1]<=h[1]?[h[0],A[0],A[1],h[1]]:h[0]>A[0]&&h[0]0){let d=f[0],p=t-d,g=p*p,h=e/2,A=p/2,x=g-4*i,C=g+4*Math.abs(i),T=s-4*d,E=s+4*Math.abs(d),S,w;if(d<0||x*E=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}A8.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)f)||(p=m.cross(d,a,s$),h=m.dot(s,p),h<0||g+h>f))return;A=m.dot(c,p)/f}else{if(Math.abs(f)1||(p=m.cross(d,a,s$),h=m.dot(s,p)*x,h<0||g+h>1))return;A=m.dot(c,p)*x}return A};io.rayTriangle=function(e,t,n,i,r,o){let s=io.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new m),m.multiplyByScalar(e.direction,s,o),m.add(e.origin,o,o)};var jwe=new In;io.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=jwe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=io.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function Ywe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var Kwe=new m,Jwe=new m;io.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,Kwe),r=m.multiplyComponents(n,e.direction,Jwe),o=m.magnitudeSquared(i),s=m.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=m.magnitudeSquared(r),u=c*a,pu){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,A=a/d;return h0?g.push(new m(i,r*L,r*-b)):b!==0?(g.push(new m(i,r*L,r*-b)),g.push(new m(i,r*L,r*b)),++O):g.push(new m(i,r*L,r*b))}return g}var x8=new m,a$=new m,c$=new m,nU=new m,Qwe=new m,$we=new Z,eDe=new Z,tDe=new Z,nDe=new Z,iDe=new Z,l$=new Z,u$=new Z,f$=new m,rDe=new m,oDe=new he;io.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let D=t.geodeticSurfaceNormal(n,x8);if(m.dot(i,D)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,x8),s=m.normalize(o,o),a=m.mostOrthogonalAxis(o,nU),c=m.normalize(m.cross(a,s,a$),a$),u=m.normalize(m.cross(s,c,c$),c$),f=$we;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,eDe),p=Z.fromScale(t.radii,tDe),g=Z.fromScale(t.oneOverRadii,nDe),h=iDe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let A=Z.multiply(Z.multiply(d,g,l$),h,l$),x=Z.multiply(Z.multiply(A,p,u$),f,u$),C=Z.multiplyByVector(A,n,Qwe),T=Zwe(x,m.negate(C,x8),0,0,1),E,S,w=T.length;if(w>0){let D=m.clone(m.ZERO,rDe),R=Number.NEGATIVE_INFINITY;for(let L=0;LR&&(R=_,D=m.clone(E,D))}let O=t.cartesianToCartographic(D,oDe);return R=P.clamp(R,0,1),S=m.magnitude(m.subtract(D,n,nU))*Math.sqrt(1-R*R),S=r?-S:S,O.height=S,t.cartographicToCartesian(O,new m)}};var sDe=new m;io.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let r=m.subtract(t,e,sDe),o=n.normal,s=m.dot(o,r);if(Math.abs(s)1))return m.multiplyByScalar(r,c,i),m.add(e,i,i),i};io.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=m.dot(r,e)+o<0,a=m.dot(r,t)+o<0,c=m.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return io.lineSegmentPlane(e,t,i,f),io.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return io.lineSegmentPlane(t,n,i,f),io.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return io.lineSegmentPlane(n,e,i,f),io.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return io.lineSegmentPlane(e,n,i,f),io.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return io.lineSegmentPlane(n,t,i,f),io.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return io.lineSegmentPlane(t,e,i,f),io.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var qi=io;var C8=new oe;function Nm(e,t){t=y(t,re.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(B.getColumn(n,0,C8)),this._yAxis=m.fromCartesian4(B.getColumn(n,1,C8));let i=m.fromCartesian4(B.getColumn(n,2,C8));this._plane=fn.fromPointNormal(e,i)}Object.defineProperties(Nm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var aDe=new cg;Nm.fromPoints=function(e,t){let n=cg.fromPoints(e,aDe);return new Nm(n.center,t)};var h$=new In,iU=new m;Nm.prototype.projectPointOntoPlane=function(e,t){let n=h$;n.origin=e,m.normalize(e,n.direction);let i=qi.rayPlane(n,this._plane,iU);if(l(i)||(m.negate(n.direction,n.direction),i=qi.rayPlane(n,this._plane,iU)),l(i)){let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new H(o,s)}};Nm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r0?0:R.latitude,b=he.fromRadians(N,e.north,n,ADe),v=he.fromRadians(e.west,e.north,n,xDe),I=he.fromRadians(e.west,_,n,CDe),M=he.fromRadians(e.west,e.south,n,TDe),F=he.fromRadians(N,e.south,n,EDe),k=i.cartographicToCartesian(b,bDe),V=i.cartographicToCartesian(v,g$),G=i.cartographicToCartesian(I,SDe),U=i.cartographicToCartesian(M,y$),q=i.cartographicToCartesian(F,vDe),Y=L.projectPointToNearestOnPlane(k,wDe),Q=L.projectPointToNearestOnPlane(V,DDe),W=L.projectPointToNearestOnPlane(G,IDe),K=L.projectPointToNearestOnPlane(U,PDe),J=L.projectPointToNearestOnPlane(q,ODe);return o=Math.min(Q.x,W.x,K.x),s=-o,c=Math.max(Q.y,Y.y),a=Math.min(K.y,J.y),v.height=M.height=t,V=i.cartographicToCartesian(v,g$),U=i.cartographicToCartesian(M,y$),u=Math.min(fn.getPointDistance(d,V),fn.getPointDistance(d,U)),f=n,p$(L.origin,L.xAxis,L.yAxis,L.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,A=ce.center(e,_$).longitude,x=m.fromRadians(A,h,n,i,RDe);x.z=0;let T=Math.abs(x.x)=c?tn.INSIDE:tn.INTERSECTING};var C$=new m,T$=new m,E$=new m,zDe=new m,A$=new m,HDe=new m;Mi.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,x$),i=e.halfAxes,r=Z.getColumn(i,0,C$),o=Z.getColumn(i,1,T$),s=Z.getColumn(i,2,E$),a=m.magnitude(r),c=m.magnitude(o),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(r,a,r):f=!1,c>0?m.divideByScalar(o,c,o):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,A,x;if(g===1){let S=r;h=o,A=s,d?p||(S=s,A=r):(S=o,h=r),x=m.cross(h,A,A$),S===r?r=x:S===o?o=x:S===s&&(s=x)}else if(g===2){h=r,d?h=o:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),A=m.cross(h,S,zDe),m.normalize(A,A),x=m.cross(h,A,A$),m.normalize(x,x),h===r?(o=A,s=x):h===o?(s=A,r=x):h===s&&(r=A,o=x)}else g===3&&(r=m.UNIT_X,o=m.UNIT_Y,s=m.UNIT_Z);let C=HDe;C.x=m.dot(n,r),C.y=m.dot(n,o),C.z=m.dot(n,s);let T=0,E;return C.x<-a?(E=C.x+a,T+=E*E):C.x>a&&(E=C.x-a,T+=E*E),C.y<-c?(E=C.y+c,T+=E*E):C.y>c&&(E=C.y-c,T+=E*E),C.z<-u?(E=C.z+u,T+=E*E):C.z>u&&(E=C.z-u,T+=E*E),T};var GDe=new m,WDe=new m;Mi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ec);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,C$),u=Z.getColumn(a,1,T$),f=Z.getColumn(a,2,E$),d=m.add(c,u,GDe);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,WDe),g=m.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var jDe=new m,YDe=new m,qDe=new m;Mi.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,r=Z.getColumn(i,0,jDe),o=Z.getColumn(i,1,YDe),s=Z.getColumn(i,2,qDe);return m.clone(n,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],r,t[1]),m.subtract(t[1],o,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],r,t[2]),m.add(t[2],o,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],r,t[3]),m.add(t[3],o,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],r,t[4]),m.subtract(t[4],o,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],r,t[5]),m.subtract(t[5],o,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],r,t[6]),m.add(t[6],o,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],r,t[7]),m.add(t[7],o,t[7]),m.add(t[7],s,t[7]),t};var XDe=new Z;Mi.computeTransformation=function(e,t){l(t)||(t=new B);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,XDe);return B.fromRotationTranslation(i,n,t)};var KDe=new ae;Mi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,KDe);return!t.isBoundingSphereVisible(n)};Mi.prototype.intersectPlane=function(e){return Mi.intersectPlane(this,e)};Mi.prototype.distanceSquaredTo=function(e){return Mi.distanceSquaredTo(this,e)};Mi.prototype.computePlaneDistances=function(e,t,n){return Mi.computePlaneDistances(this,e,t,n)};Mi.prototype.computeCorners=function(e){return Mi.computeCorners(this,e)};Mi.prototype.computeTransformation=function(e){return Mi.computeTransformation(this,e)};Mi.prototype.isOccluded=function(e){return Mi.isOccluded(this,e)};Mi.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Mi.prototype.clone=function(e){return Mi.clone(this,e)};Mi.prototype.equals=function(e){return Mi.equals(this,e)};var Bn=Mi;var rU={};rU.getHeight=function(e,t,n){return(e-n)*t+n};var JDe=new m;rU.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,JDe),s=rU.getHeight(o.height,n,i);return m.fromRadians(o.longitude,o.latitude,s,t,r)};var vc=rU;var QI=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY +vec3 czm_RGBToHSL(vec3 rgb) +{ + vec3 hcv = RGBtoHCV(rgb); + float l = hcv.z - hcv.y * 0.5; + float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); + return vec3(hcv.x, s, l); +} +`;var r1=`/** + * Converts an RGB color to CIE Yxy. + *

The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + *

+ * + * @name czm_RGBToXYZ + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in CIE Yxy. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_RGBToXYZ(vec3 rgb) +{ + const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, + 0.3576, 0.7152, 0.1192, + 0.1805, 0.0722, 0.9505); + vec3 xyz = RGB2XYZ * rgb; + vec3 Yxy; + Yxy.r = xyz.g; + float temp = dot(vec3(1.0), xyz); + Yxy.gb = xyz.rg / temp; + return Yxy; +} +`;var s1=`/** + * Round a floating point value. This function exists because round() doesn't + * exist in GLSL 1.00. + * + * @param {float|vec2|vec3|vec4} value The value to round + * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + */ +float czm_round(float value) { + return floor(value + 0.5); +} -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR +vec2 czm_round(vec2 value) { + return floor(value + 0.5); +} -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES +vec3 czm_round(vec3 value) { + return floor(value + 0.5); +} -void main() +vec4 czm_round(vec4 value) { + return floor(value + 0.5); +} +`;var a1=`/** + * Samples the 4 neighboring pixels and return the weighted average. + * + * @private + */ +vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) { - vec4 position = czm_computePosition(); + direction /= dot(vec3(1.0), abs(direction)); + vec2 rev = abs(direction.zx) - vec2(1.0); + vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, + direction.z < 0.0 ? rev.y : -rev.y); + vec2 uv = direction.y < 0.0 ? neg : direction.xz; + vec2 coord = 0.5 * uv + vec2(0.5); + vec2 pixel = 1.0 / textureSize; -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + if (lod > 0.0) + { + // Each subseqeuent mip level is half the size + float scale = 1.0 / pow(2.0, lod); + float offset = ((textureSize.y + 1.0) / textureSize.x); - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif + coord.x *= offset; + coord *= scale; -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + coord.x += offset + pixel.x; + coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; + } + else + { + coord.x *= (textureSize.y / textureSize.x); + } - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + // Do bilinear filtering + #ifndef OES_texture_float_linear + vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; + vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; + vec3 color3 = texture(projectedMap, coord + pixel).rgb; + vec3 color4 = texture(projectedMap, coord).rgb; - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + vec2 texturePosition = coord * textureSize; - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D + float fu = fract(texturePosition.x); + float fv = fract(texturePosition.y); - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; + vec3 average1 = mix(color4, color2, fu); + vec3 average2 = mix(color1, color3, fu); - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; + vec3 color = mix(average1, average2, fv); + #else + vec3 color = texture(projectedMap, coord).rgb; + #endif - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + return color; +} - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif +/** + * Samples from a cube map that has been projected using an octahedral projection from the given direction. + * + * @name czm_sampleOctahedralProjection + * @glslFunction + * + * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. + * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. + * @param {vec3} direction The normalized direction used to sample the cube map. + * @param {float} lod The level of detail to sample. + * @param {float} maxLod The maximum level of detail. + * @returns {vec3} The color of the cube map at the direction. + */ +vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { + float currentLod = floor(lod + 0.5); + float nextLod = min(currentLod + 1.0, maxLod); - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var lg=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif + vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); + vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); + return mix(colorNextLod, colorCurrentLod, nextLod - lod); } -`;var b$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};b$.NUMBER_OF_CLASSIFICATION_TYPES=3;var Hn=Object.freeze(b$);var ZDe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},ja=Object.freeze(ZDe);function QDe(e,t){let n=[],i=e.length,r=0;for(;r>1^-(e&1)}yr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var Yn=yr;var P$=new m,O$=new m,R$=new m;function dIe(e,t,n,i,r){l(r)||(r=new m);let o,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=m.subtract(n,t,P$),s=m.subtract(i,t,O$),a=m.subtract(e,t,R$),c=m.dot(o,o),u=m.dot(o,s),f=m.dot(o,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=H.subtract(n,t,P$),s=H.subtract(i,t,O$),a=H.subtract(e,t,R$),c=H.dot(o,o),u=H.dot(o,s),f=H.dot(o,a),d=H.dot(s,s),p=H.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var G0=dIe;var b8={};b8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let o=[];for(let a=0;ai&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};b8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r;function o(_,b,v,I){for(;b.length>=1;){let M=b[b.length-1];if(b.splice(b.length-1,1),_[M].numLiveTriangles>0)return M}for(;r0)return++r,r-1;++r}return-1}function s(_,b,v,I,M,F,k){let V=-1,G,U=-1,q=0;for(;qU||U===-1)&&(U=G,V=Y)),++q}return V===-1?o(I,F,_,k):V}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;uc&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;gi&&(E.timeStamp=x,++x),++u}A=s(t,i,C,p,x,T,c)}return D};var nP=b8;var wc={};function dU(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function mIe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),r=0;for(let o=0;o=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);dU(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),r=e[0],o=0;for(let s=1;sr&&(r=n[o]);e.indices=nP.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function M$(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new we({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function _Ie(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=M$(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Be.TRIANGLES?u=3:e.primitiveType===Be.LINES?u=2:e.primitiveType===Be.POINTS&&(u=1);for(let f=0;f=P.SIXTY_FOUR_KILOBYTES&&(t.push(new ft({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=M$(e.attributes))}r.length!==0&&t.push(new ft({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var B$=new m,gIe=new he;wc.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Si;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;fx&&(x=T)}return new ft({attributes:f,indices:h,primitiveType:u,boundingSphere:l(A)?new ae(A,x):void 0})}wc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o0&&r.push(D8(t,"geometry")),n.length>0&&(r.push(D8(n,"westHemisphereGeometry")),r.push(D8(n,"eastHemisphereGeometry"))),r};var Ju=new m,iP=new m,hT=new m,pT=new m;wc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u0){for(f=0;f3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;rr?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;ug(e,a),ug(t,a),ug(n,a)}var U$=new m;function Zu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,U$),e.y/(e.y-t.y),U$),n),m.clone(n,i),ug(n,!0),ug(i,!1)}var W0=new m,j0=new m,Y0=new m,q0=new m,I8={positions:new Array(7),indices:new Array(3*3)};function PIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;IIe(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=I8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Zu(e,t,W0,Y0),Zu(e,n,j0,q0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Zu(t,n,W0,Y0),Zu(t,e,j0,q0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Zu(n,e,W0,Y0),Zu(n,t,j0,q0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Zu(n,e,W0,Y0),Zu(n,t,j0,q0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Zu(t,n,W0,Y0),Zu(t,e,j0,q0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Zu(e,t,W0,Y0),Zu(e,n,j0,q0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=I8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=W0,c[4]=j0,c[5]=Y0,c[6]=q0,c.length=7),I8}function V$(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=X.createTypedArray(o.componentDatatype,o.values)}let i=ft.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function gT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new we({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new ft({attributes:n,indices:[],primitiveType:e.primitiveType})}function M8(e,t,n){let i=l(e.geometry.boundingSphere);t=V$(t,i),n=V$(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function B8(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),h=e.fromArray(u,s*t,i),A=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(A,c.z,A);let x=e.add(g,h,g);e.add(x,A,x),p&&e.normalize(x,x),e.pack(x,f,d*t)}}var OIe=B8(oe,4),fU=B8(m,3),j$=B8(H,2),RIe=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>P.EPSILON6?1:0},oP=new m,P8=new m,O8=new m,MIe=new m;function lU(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let x=m.fromArray(r,e*3,oP),C=m.fromArray(r,t*3,P8),T=m.fromArray(r,n*3,O8),E=G0(i,x,C,T,MIe);if(l(E)){if(l(o)&&fU(e,t,n,E,o,d.normal.values,A,!0),l(u)){let S=m.fromArray(u,e*3,oP),w=m.fromArray(u,t*3,P8),D=m.fromArray(u,n*3,O8);m.multiplyByScalar(S,E.x,S),m.multiplyByScalar(w,E.y,w),m.multiplyByScalar(D,E.z,D);let R;!m.equals(S,m.ZERO)||!m.equals(w,m.ZERO)||!m.equals(D,m.ZERO)?(R=m.add(S,w,S),m.add(R,D,R),m.normalize(R,R)):(R=oP,R.x=0,R.y=0,R.z=0),m.pack(R,d.extrudeDirection.values,A*3)}if(l(f)&&RIe(e,t,n,E,f,d.applyOffset.values,A),l(s)&&fU(e,t,n,E,s,d.tangent.values,A,!0),l(a)&&fU(e,t,n,E,a,d.bitangent.values,A,!0),l(c)&&j$(e,t,n,E,c,d.st.values,A),g>0)for(let S=0;S3){let I=v.positions,M=v.indices,F=M.length;for(let k=0;k0)continue;let c=m.unpack(i,s,X$);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(r,s,R8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+30||ae.intersectPlane(n,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING))return e;if(t.geometryType!==Yu.NONE)switch(t.geometryType){case Yu.POLYLINES:GIe(e);break;case Yu.TRIANGLES:k$(e);break;case Yu.LINES:z$(e);break}else DIe(t),t.primitiveType===Be.TRIANGLES?k$(e):t.primitiveType===Be.LINES&&z$(e);return e};var Fn=wc;function al(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(al.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});al.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};al.geodeticLatitudeToMercatorAngle=function(e){e>al.MaximumLatitude?e=al.MaximumLatitude:e<-al.MaximumLatitude&&(e=-al.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};al.MaximumLatitude=al.mercatorAngleToGeodeticLatitude(Math.PI);al.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=al.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};al.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=al.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new he(i,r,o)};var wi=al;function WIe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;uo&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function qIe(e,t){let n=[];return N8(e,"geometry",t,n),N8(e,"westHemisphereGeometry",t,n),N8(e,"eastHemisphereGeometry",t,n),n}var ap={};ap.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=YIe(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=qIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};ap.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s0){let w=x.length/C;for(S=Ue.createTypedArray(w,A),i=0;i{t._completeLoad=(r,o,s)=>{this._error=s,this._state=o,r.afterRender.push(function(){if(t._ready=t._state===ho.COMPLETE||t._state===ho.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(po.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function ePe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${r}`};function $$(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); -`}n&&r&&o?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),r&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),o&&(f+=`vec3 bitangent; -`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,g].join(` -`)}function cPe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function lPe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) +{ + return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`,t}function eee(e,t){let n=e.vertexAttributes}function uPe(e,t){return function(){return e[t]}}var F8=Math.max(Wt.hardwareConcurrency-1,1),mU,fPe=new pi("combineGeometry");function dPe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===ho.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r0){let A=new Float64Array(d);for(h=[A.buffer],o=0;o0?(e._recomputeBoundingSpheres=!0,e._state=ho.COMBINED):aP(e,t,ho.FAILED,void 0)}).catch(function(d){aP(e,t,ho.FAILED,d)})}}function mPe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=ho.COMBINED):aP(e,t,ho.FAILED,void 0)}function hPe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||ae.intersectPlane(A,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING?c.push(A):(u.push(A),f.push(A))}let d=c[0],p=f[0],g=u[0];for(i=1;i0){if(Ht.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==ho.COMPLETE&&this._state!==ho.COMBINED&&(this.asynchronous?dPe(this,e):mPe(this,e)),this._state===ho.COMBINED&&(pPe(this,e),nee(this,e),gPe(this,e)),!this.show||this._state!==ho.COMPLETE)return;this._batchTableOffsetsUpdated||nee(this,e),this._recomputeBoundingSpheres&&hPe(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&y(this._createRenderStatesFunction,yPe)(this,t,n,u),o&&y(this._createShaderProgramFunction,APe)(this,e,n),(r||o)&&y(this._createCommandsFunction,xPe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,CPe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var TPe=new ae,EPe=new ae;function uee(e,t,n){if(n===sn.TOP){let i=ae.clone(e,TPe),r=ae.clone(e,EPe);r.center=m.add(r.center,t,r.center),e=ae.union(i,r,e)}else n===sn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function bPe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=X.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function SPe(e,t,n,i,r){return function(o){let s=see(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var vPe=new m;function wPe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&uee(i,m.fromArray(o.get(),0,vPe),e._offsetInstanceExtend[n]),l(r)&&(i=ae.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function DPe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}po.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC +#ifdef USE_CUBE_MAP_SHADOW +float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +{ + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec3 uvw = shadowParameters.texCoords; -void main(void) + depth -= depthBias; + float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +} +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) { -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec2 uv = shadowParameters.texCoords; + + depth -= depthBias; +#ifdef USE_SOFT_SHADOWS + vec2 texelStepSize = shadowParameters.texelStepSize; + float radius = 1.0; + float dx0 = -texelStepSize.x * radius; + float dy0 = -texelStepSize.y * radius; + float dx1 = texelStepSize.x * radius; + float dy1 = texelStepSize.y * radius; + float visibility = ( + czm_shadowDepthCompare(shadowMap, uv, depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) + ) * (1.0 / 9.0); +#else + float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +} #endif +`;var f1=`/** + * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL + * built-in function sign except that returns 1.0 instead of 0.0 when the input value is 0.0. + * + * @name czm_signNotZero + * @glslFunction + * + * @param {} value The value for which to determine the sign. + * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. + */ +float czm_signNotZero(float value) +{ + return value >= 0.0 ? 1.0 : -1.0; +} -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } -#endif - -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif - - -#ifdef PER_INSTANCE_COLOR - - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; +vec2 czm_signNotZero(vec2 value) +{ + return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); +} -#else // PER_INSTANCE_COLOR +vec3 czm_signNotZero(vec3 value) +{ + return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +} - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. +vec4 czm_signNotZero(vec4 value) +{ + return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +} +`;var d1=`/** + * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. + *

+ * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. + *

+ * + * @name czm_sphericalHarmonics + * @glslFunction + * + * @param {vec3} normal The normalized direction. + * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. + * @returns {vec3} The color at the direction. + * + * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + */ +vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ + vec3 L00 = coefficients[0]; + vec3 L1_1 = coefficients[1]; + vec3 L10 = coefficients[2]; + vec3 L11 = coefficients[3]; + vec3 L2_2 = coefficients[4]; + vec3 L2_1 = coefficients[5]; + vec3 L20 = coefficients[6]; + vec3 L21 = coefficients[7]; + vec3 L22 = coefficients[8]; - czm_materialInput materialInput; + float x = normal.x; + float y = normal.y; + float z = normal.z; -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif + return + L00 + + L1_1 * y + + L10 * z + + L11 * x + + L2_2 * (y * x) + + L2_1 * (y * z) + + L20 * (3.0 * z * z - 1.0) + + L21 * (z * x) + + L22 * (x * x - y * y); +} +`;var m1=`/** + * Converts an sRGB color to a linear RGB color. + * + * @param {vec3|vec4} srgbIn The color in sRGB space + * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + */ +vec3 czm_srgbToLinear(vec3 srgbIn) +{ + return pow(srgbIn, vec3(2.2)); +} -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; +vec4 czm_srgbToLinear(vec4 srgbIn) +{ + vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); + return vec4(linearOut, srgbIn.a); +} +`;var h1=`/** + * Creates a matrix that transforms vectors from tangent space to eye space. + * + * @name czm_tangentToEyeSpaceMatrix + * @glslFunction + * + * @param {vec3} normalEC The normal vector in eye coordinates. + * @param {vec3} tangentEC The tangent vector in eye coordinates. + * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + * + * @returns {mat3} The matrix that transforms from tangent space to eye space. + * + * @example + * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); + * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + */ +mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ + vec3 normal = normalize(normalEC); + vec3 tangent = normalize(tangentEC); + vec3 bitangent = normalize(bitangentEC); + return mat3(tangent.x , tangent.y , tangent.z, + bitangent.x, bitangent.y, bitangent.z, + normal.x , normal.y , normal.z); +} +`;var p1=`/** + * A wrapper around the texture (WebGL2) / textureCube (WebGL1) + * function to allow for WebGL 1 support. + * + * @name czm_textureCube + * @glslFunction + * + * @param {samplerCube} sampler The sampler. + * @param {vec3} p The coordinates to sample the texture at. + */ +vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 + return texture(sampler, p); +#else + return textureCube(sampler, p); #endif +}`;var _1=`/** + * Transforms a plane. + * + * @name czm_transformPlane + * @glslFunction + * + * @param {vec4} plane The plane in Hessian Normal Form. + * @param {mat4} transform The inverse-transpose of a transformation matrix. + */ +vec4 czm_transformPlane(vec4 plane, mat4 transform) { + vec4 transformedPlane = transform * plane; + // Convert the transformed plane to Hessian Normal Form + float normalMagnitude = length(transformedPlane.xyz); + return transformedPlane / normalMagnitude; +} +`;var g1=`/** + * Translates a position (or any vec3) that was encoded with {@link EncodedCartesian3}, + * and then provided to the shader as separate high and low bits to + * be relative to the eye. As shown in the example, the position can then be transformed in eye + * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, + * respectively. + *

+ * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as + * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + *

+ * + * @name czm_translateRelativeToEye + * @glslFunction + * + * @param {vec3} high The position's high bits. + * @param {vec3} low The position's low bits. + * @returns {vec3} The position translated to be relative to the camera's position. + * + * @example + * in vec3 positionHigh; + * in vec3 positionLow; + * + * void main() + * { + * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * } + * + * @see czm_modelViewRelativeToEye + * @see czm_modelViewProjectionRelativeToEye + * @see czm_computePosition + * @see EncodedCartesian3 + */ +vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +{ + vec3 highDifference = high - czm_encodedCameraPositionMCHigh; + vec3 lowDifference = low - czm_encodedCameraPositionMCLow; -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif + return vec4(highDifference + lowDifference, 1.0); +} +`;var y1=`/** + * @private + */ +vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down and horizon views) + float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); + } - czm_material material = czm_getMaterial(materialInput); + diffuse = clamp(diffuse, 0.0, 1.0); -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT + float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK -} -`;function Qu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new V8;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new V8;if(r.requiresTextureCoordinates=e,n instanceof an)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Qu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof an&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof an||(r=t.material.shaderSource),new He({defines:i,sources:[r,yT]})};Qu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new He({defines:n,sources:[yT],pickColorQualifier:"in"})};Qu.prototype.createVertexShader=function(e,t,n,i){return yee(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Qu.prototype.createPickVertexShader=function(e,t,n,i){return yee(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var fee=new m,dee=new he,mee={high:0,low:0};function yee(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=dee;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,fee),d=jn.encode(f.x,mee);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=dee;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,fee);d=jn.encode(g.x,mee),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof an&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new He({defines:c,sources:[r]})}function V8(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(V8.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function hee(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var PPe=[new H,new H,new H,new H];function Aee(e,t){let n=PPe,i=H.unpack(t,0,n[0]),r=H.unpack(t,2,n[1]),o=H.unpack(t,4,n[2]);e.uMaxVmax=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/hee(i,r,o),a=1/hee(i,o,r);e.uvMinAndExtents=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var xee=new he,Cee=new m,OPe=new m,RPe=new m,hU={high:0,low:0};function Tee(e,t,n){let i=xee;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,Cee);i.latitude=e.north;let o=t.project(i,OPe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,RPe),a=[0,0,0,0],c=[0,0,0,0],u=jn.encode(r.x,hU);a[0]=u.high,c[0]=u.low,u=jn.encode(r.y,hU),a[1]=u.high,c[1]=u.low,u=jn.encode(o.y,hU),a[2]=u.high,c[2]=u.low,u=jn.encode(s.x,hU),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var MPe=new B,BPe=new B,pee=new m,LPe=new he,NPe=[new he,new he,new he,new he,new he,new he,new he,new he];function FPe(e,t,n,i,r,o){let s=ce.center(e,LPe);s.height=n;let a=he.toCartesian(s,t,pee),c=Mt.eastNorthUpToFixedFrame(a,t,MPe),u=B.inverse(c,BPe),f=e.west,d=e.east,p=e.north,g=e.south,h=NPe;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let A=(f+d)*.5,x=(p+g)*.5;h[4].latitude=g,h[4].longitude=A,h[5].latitude=p,h[5].longitude=A,h[6].latitude=x,h[6].longitude=f,h[7].latitude=x,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let O=0;O<8;O++){h[O].height=n;let L=he.toCartesian(h[O],t,pee);B.multiplyByPoint(u,L,L),L.z=0,C=Math.min(C,L.x),T=Math.max(T,L.x),E=Math.min(E,L.y),S=Math.max(S,L.y)}let w=i;w.x=C,w.y=E,w.z=0,B.multiplyByPoint(c,w,w);let D=r;D.x=T,D.y=E,D.z=0,B.multiplyByPoint(c,D,D),m.subtract(D,w,r);let R=o;R.x=C,R.y=S,R.z=0,B.multiplyByPoint(c,R,R),m.subtract(R,w,o)}var UPe=new m,VPe=new m,kPe=new jn;Qu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=Cee,s=UPe,a=VPe;FPe(e,n,y(r,0),o,s,a);let c={};Aee(c,t);let u=jn.fromCartesian(o,kPe);return c.southWest_HIGH=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),Tee(e,i,c),c};var zPe=new m;function _ee(e,t,n,i){let r=xee;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,zPe),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var gee=new H;Qu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=_ee(e.south,e.west,n,gee),o=r.x,s=r.y,a=_ee(e.north,e.east,n,gee),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Aee(g,t),Tee(e,i,g),g};Qu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Qu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function HPe(e){return Math.max(e.width,e.height)>Qu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Qu.shouldUseSphericalCoordinates=function(e){return HPe(e)};Qu.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Jl=Qu;var GPe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Gn=Object.freeze(GPe);var WPe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ht=Object.freeze(WPe);var pU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};pU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Gn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Gn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:pU.CESIUM_3D_TILE_MASK,mask:pU.CESIUM_3D_TILE_MASK}};var Ft=Object.freeze(pU);function K0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(K0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});K0.isSupported=function(e){return e.context.stencilBuffer};function AT(e,t){let n=t?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},depthMask:!1}}function z8(e){return{stencilTest:{enabled:e,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var jPe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function YPe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(AT(r,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(AT(r,!0)),e._rsColorPass=ze.fromCache(z8(r,!1)),e._rsPickPass=ze.fromCache(jPe)}function qPe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; -`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=He.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function XPe(e,t){let n=t.context,i=e._primitive,r=QI;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=vn._appendDistanceDisplayConditionToShader(i,r),r=vn._modifyShaderPosition(e,r,t.scene3DOnly),r=vn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=qPe(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new He({defines:[a],sources:[r]}),u=new He({sources:[lg]}),f=e._primitive._attributeLocations,d=new Jl(s,o,e.appearance);if(e._spStencil=Zt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=He.createPickVertexShaderSource(r);h=vn._appendShowToShader(i,h),h=vn._updatePickColorAttribute(h);let A=d.createPickFragmentShader(!1),x=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Zt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let T=d.createPickFragmentShader(!0),E=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Zt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=vn._appendShowToShader(i,r),c=new He({defines:[a],sources:[r]}),e._sp=Zt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Zt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let A=d.createFragmentShader(!0),x=d.createVertexShader([a],r,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f})}e._spColor2D=h}}function KPe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r0&&(c=r[0].attributes,p=Jl.hasAttributesForSphericalExtents(c),g=Jl.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};K0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var xT=K0;var $Pe={u_globeMinimumAltitude:function(){return 55e3}};function cl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):o(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=si._defaultMaxTerrainHeight,this._minTerrainHeight=si._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let r=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:r,_extruded:!0,_uniformMap:$Pe}}Object.defineProperties(cl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});cl.isSupported=xT.isSupported;function See(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function vee(e){return function(t,n){return e._minHeight}}var e1e=new m,t1e=new m,n1e=new m,i1e=new he,r1e=new ce;function _U(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};cl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};cl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};cl.prototype.isDestroyed=function(){return!1};cl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};cl._supportsMaterials=function(e){return e.depthTexture};cl.supportsMaterials=function(e){return cl._supportsMaterials(e.frameState.context)};var Dc=cl;function CT(){fe.throwInstantiationError()}Object.defineProperties(CT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});CT.prototype.getType=fe.throwInstantiationError;CT.prototype.getValue=fe.throwInstantiationError;CT.prototype.equals=fe.throwInstantiationError;CT.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ki.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ki.ColorType)&&(n=ki.fromType(ki.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Xr=CT;function J0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}J0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};J0.prototype._setOptions=fe.throwInstantiationError;J0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Vt,d,p=t._getIsClosed(c);if(f)d=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Xr.getValue(e,u,this._material);this._material=g,d=new or({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=an.VERTEX_FORMAT,this._primitive=r.add(new Dc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new vn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=j.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new vn({geometryInstances:u,appearance:new an({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};J0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),lt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),lt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?lt.PENDING:lt.FAILED};J0.prototype.isDestroyed=function(){return!1};J0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ai=J0;var c1e={NONE:0,GEODESIC:1,RHUMB:2},Qt=Object.freeze(c1e);var Dee=P.EPSILON10;function l1e(e,t,n,i){if(!l(e))return;n=y(n,!1);let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;sP.EPSILON12);let b=N*(t*t-n*n)/(n*n),v=1+b*(4096+b*(b*(320-175*b)-768))/16384,I=b*(256+b*(b*(74-47*b)-128))/1024,M=_*_,F=I*L*(_+I*(O*(2*M-1)-I*_*(4*L*L-3)*(4*M-3)/6)/4),k=n*v*(R-F),V=Math.atan2(g*D,x-T*w),G=Math.atan2(d*D,x*w-T);e._distance=k,e._startHeading=V,e._endHeading=G,e._uSquared=b}var m1e=new m,W8=new m;function Pee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,W8),m1e),o=m.normalize(i.cartographicToCartesian(n,W8),W8);d1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,u1e(e)}function cP(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Pee(this,e,t,i)}Object.defineProperties(cP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});cP.prototype.setEndPoints=function(e,t){Pee(this,e,t,this._ellipsoid)};cP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};cP.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,A=n.u6Over64,x=n.u4Over16,C=2*p*g*r/3+i*(1-h+7*x/4-15*A/4+579*g/64-(x-15*A/4+187*g/16)*r-(5*A/4-115*g/16)*o-29*g*s/16)+(h/2-x+71*A/32-85*g/16)*a+(5*x/16-5*A/4+383*g/96)*c-d*((A-11*g/2)*a+5*g*c/2)+(29*A/96-29*g/16)*u+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),w=Math.sin(C),D=Math.cos(C),R=n.cosineU*D,O=n.sineU*w,N=Math.atan2(w*n.sineHeading,R-O*n.cosineHeading)-Iee(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,w,D,S);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=E,t.height=0,t):new he(this._start.longitude+N,E,0)};var $u=cP;function Y8(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),A=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*A)}function h1e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),A=Math.cos(2*i),x=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),w=Math.cos(8*i),D=Math.sin(10*i),R=Math.cos(10*i),O=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*A+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*w+8011*i*g/1048576*R+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*x+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*S+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*O}function TT(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function p1e(e,t,n,i,r){let o=TT(e._ellipticity,n),s=TT(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function _1e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=Y8(e._ellipticity,t,r);u=(Y8(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var g1e=new m,j8=new m;function Oee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,j8),g1e),o=m.normalize(i.cartographicToCartesian(n,j8),j8),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=p1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=_1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Ree(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=Y8(r,i,e.latitude),d=n*Math.cos(t),p=f+d;c=h1e(p,r,i);let g=TT(r,e.latitude),h=TT(r,c);u=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function cp(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Oee(this,e,t,i)}Object.defineProperties(cp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});cp.fromStartHeadingDistance=function(e,t,n,i,r){let o=y(i,re.WGS84),s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Ree(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new cp(e,d,o):(r.setEndPoints(e,d),r)};cp.prototype.setEndPoints=function(e,t){Oee(this,e,t,this._ellipsoid)};cp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};cp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Ree(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};cp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};cp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=TT(n,r.latitude),s=TT(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var xa=cp;var e5=[Si,wi],y1e=e5.length,Qee=Math.cos(P.toRadians(30)),Mee=Math.cos(P.toRadians(150)),$ee=0,ete=1e3;function dg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Qt.GEODESIC),this._ellipsoid=re.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(dg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});dg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iQee||oP.PI_OVER_TWO&&(a=!0,s=m.subtract(o,n,zee),u=c.cartesianToCartographic(s,kee)),u.height=0;let f=e.project(u,r);return r=m.subtract(f,i,r),r.z=0,r=m.normalize(r,r),a&&m.negate(r,r),r}var U1e=new m,Hee=new m;function Gee(e,t,n,i,r,o){let s=m.subtract(t,e,U1e);m.normalize(s,s);let a=n-$ee,c=m.multiplyByScalar(s,a,Hee);m.add(e,c,r);let u=i-ete;c=m.multiplyByScalar(s,u,Hee),m.add(t,c,o)}var V1e=new m;function AU(e,t){let n=fn.getPointDistance(xU,e),i=fn.getPointDistance(xU,t),r=V1e;P.equalsEpsilon(n,0,P.EPSILON2)?(r=lp(t,e,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=lp(e,t,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(t,r,t))}function k1e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var nte=new he,ite=new he,Wee=new m,J8=new m,jee=new m,Yee=new m,z1e=new m,qee=new m,H1e=[nte,ite],G1e=new ce,W1e=new m,j1e=new m,Y1e=new m,q1e=new m,X1e=new m,K1e=new m,Z8=new m,Q8=new m,J1e=new m,Z1e=new m,Q1e=new m,Xee=new m,$1e=new m,eOe=new m,tOe=new jn,nOe=new jn,Kee=new m,iOe=new m,Jee=new m,rOe=[new ae,new ae],rte=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Zee=rte.length;function oOe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),A=new Float64Array(d*3),x=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),w,D,R,O;s&&(w=new Float32Array(p),D=new Float32Array(p),R=new Float32Array(p),O=new Float32Array(d*2));let L=o.length/2,N=0,_=nte;_.height=0;let b=ite;b.height=0;let v=Wee,I=J8;if(s)for(c=0,a=1;aQee?(_t=lP(t,_,ke,Re,Z8),rt=lP(t,b,K,dt,Q8)):Wi===1?(rt=lP(t,b,K,dt,Q8),_t.x=0,_t.y=P.sign(_.longitude-Math.abs(b.longitude)),_t.z=0):(_t=lP(t,_,ke,Re,Z8),rt.x=0,rt.y=P.sign(_.longitude-b.longitude),rt.z=0)}let hn=m.distance(Ne,W),Rn=jn.fromCartesian(Ee,tOe),Gt=m.subtract(Q,Ee,J1e),Ut=m.normalize(Gt,Xee),Te=m.subtract(Ne,Ee,Z1e);Te=m.normalize(Te,Te);let Ae=m.cross(Ut,Te,Xee);Ae=m.normalize(Ae,Ae);let ut=m.cross(Te,ke,$1e);ut=m.normalize(ut,ut);let ii=m.subtract(W,Q,Q1e);ii=m.normalize(ii,ii);let Je=m.cross(K,ii,eOe);Je=m.normalize(Je,Je);let ar=hn/F,ts=J/F,Ba=0,No,Mr,Ve,ot=0,je=0;if(s){Ba=m.distance(Re,dt),No=jn.fromCartesian(Re,nOe),Mr=m.subtract(dt,Re,Kee),Ve=m.normalize(Mr,iOe);let Wi=Ve.x;Ve.x=Ve.y,Ve.y=-Wi,ot=Ba/N,je=me/N}for(k=0;k<8;k++){let Wi=q+k*4,Yo=G+k*2,Vn=Wi+3,ln=k<4?1:-1,Kn=k===2||k===3||k===6||k===7?1:-1;m.pack(Rn.high,x,Wi),x[Vn]=Gt.x,m.pack(Rn.low,C,Wi),C[Vn]=Gt.y,m.pack(ut,T,Wi),T[Vn]=Gt.z,m.pack(Je,E,Wi),E[Vn]=ar*ln,m.pack(Ae,S,Wi);let wn=ts*Kn;wn===0&&Kn<0&&(wn=9),S[Vn]=wn,s&&(w[Wi]=No.high.x,w[Wi+1]=No.high.y,w[Wi+2]=No.low.x,w[Wi+3]=No.low.y,R[Wi]=-_t.y,R[Wi+1]=_t.x,R[Wi+2]=rt.y,R[Wi+3]=-rt.x,D[Wi]=Mr.x,D[Wi+1]=Mr.y,D[Wi+2]=Ve.x,D[Wi+3]=Ve.y,O[Yo]=ot*ln,wn=je*Kn,wn===0&&Kn<0&&(wn=9),O[Yo+1]=wn)}let Qe=Y1e,pt=q1e,zt=W1e,Jt=j1e,rr=ce.fromCartographicArray(H1e,G1e),gr=si.getMinimumMaximumHeights(rr,u),ns=gr.minimumTerrainHeight,Vs=gr.maximumTerrainHeight;ye+=ns,ye+=Vs,Gee(Ee,Ne,ns,Vs,Qe,zt),Gee(Q,W,ns,Vs,pt,Jt);let lo=m.multiplyByScalar(Ae,P.EPSILON5,Jee);m.add(Qe,lo,Qe),m.add(pt,lo,pt),m.add(zt,lo,zt),m.add(Jt,lo,Jt),AU(Qe,pt),AU(zt,Jt),m.pack(Qe,A,U),m.pack(pt,A,U+3),m.pack(Jt,A,U+6),m.pack(zt,A,U+9),lo=m.multiplyByScalar(Ae,-2*P.EPSILON5,Jee),m.add(Qe,lo,Qe),m.add(pt,lo,pt),m.add(zt,lo,zt),m.add(Jt,lo,Jt),AU(Qe,pt),AU(zt,Jt),m.pack(Qe,A,U+12),m.pack(pt,A,U+15),m.pack(Jt,A,U+18),m.pack(zt,A,U+21),V+=2,c+=3,G+=16,U+=24,q+=32,J+=hn,me+=Ba}c=0;let se=0;for(a=0;amatrix can be + * a mat2, mat3, or mat4. + * + * @name czm_transpose + * @glslFunction + * + * @param {} matrix The matrix to transpose. + * + * @returns {} The transposed matrix. + * + * @example + * // GLSL declarations + * mat2 czm_transpose(mat2 matrix); + * mat3 czm_transpose(mat3 matrix); + * mat4 czm_transpose(mat4 matrix); + * + * // Transpose a 3x3 rotation matrix to find its inverse. + * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( + * positionMC, normalEC); + * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + */ +mat2 czm_transpose(mat2 matrix) +{ + return mat2( + matrix[0][0], matrix[1][0], + matrix[0][1], matrix[1][1]); +} -void main(void) +mat3 czm_transpose(mat3 matrix) { - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); + return mat3( + matrix[0][0], matrix[1][0], matrix[2][0], + matrix[0][1], matrix[1][1], matrix[2][1], + matrix[0][2], matrix[1][2], matrix[2][2]); +} - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME +mat4 czm_transpose(mat4 matrix) +{ + return mat4( + matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], + matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], + matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], + matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); +} +`;var b1=`/** + * Unpacks a vec4 depth value to a float in [0, 1) range. + * + * @name czm_unpackDepth + * @glslFunction + * + * @param {vec4} packedDepth The packed depth. + * + * @returns {float} The floating-point depth in [0, 1) range. + */ + float czm_unpackDepth(vec4 packedDepth) + { + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); + } +`;var C1=`/** + * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. + * + * @name czm_unpackFloat + * @glslFunction + * + * @param {vec4} packedFloat The packed float. + * + * @returns {float} The floating-point depth in arbitrary range. + */ +float czm_unpackFloat(vec4 packedFloat) +{ + // Convert to [0.0, 255.0] and round to integer + packedFloat = floor(packedFloat * 255.0 + 0.5); + float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; + float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; + if (exponent == -127.0) + { + return 0.0; } + float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); + float result = sign * exp2(exponent - 23.0) * mantissa; + return result; +} +`;var T1=`/** + * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, + * so the return value is an int. + *

+ * There are also precision limitations in WebGL 1. highp int is still limited + * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. + *

+ * + * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * + * @return {int} The unpacked value. + */ + int czm_unpackUint(float packedValue) { + float rounded = czm_round(packedValue * 255.0); + return int(rounded); + } - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } + int czm_unpackUint(vec2 packedValue) { + vec2 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec2(1.0, 256.0))); + } - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + int czm_unpackUint(vec3 packedValue) { + vec3 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); + } - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; + int czm_unpackUint(vec4 packedValue) { + vec4 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); + } +`;var A1=`/** + * Transform metadata values following the EXT_structural_metadata spec + * by multiplying by scale and adding the offset. Operations are always + * performed component-wise, even for matrices. + * + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * + * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + */ +float czm_valueTransform(float offset, float scale, float value) { + return scale * value + offset; +} - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { + return scale * value + offset; +} - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { + return scale * value + offset; +} -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); +vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { + return scale * value + offset; +} - czm_materialInput materialInput; +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { + return matrixCompMult(scale, value) + offset; +} - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { + return matrixCompMult(scale, value) + offset; +} - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { + return matrixCompMult(scale, value) + offset; +} +`;var E1=`#ifdef LOG_DEPTH +// 1.0 at the near plane, increasing linearly from there. +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; +#endif +#endif - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) - czm_writeDepthClamp(); -} -`;var fP=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; +#ifdef SHADOW_MAP + vec3 logPositionEC = (czm_inverseProjection * coords).xyz; + v_logPositionEC = logPositionEC; +#endif -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; + // With the very high far/near ratios used with the logarithmic depth + // buffer, floating point rounding errors can cause linear depth values + // to end up on the wrong side of the far plane, even for vertices that + // are really nowhere near it. Since we always write a correct logarithmic + // depth value in the fragment shader anyway, we just need to make sure + // such errors don't cause the primitive to be clipped entirely before + // we even get to the fragment shader. + coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); + return coords; } -void main(void) +/** + * Writes the logarithmic depth to gl_Position using the already computed gl_Position. + * + * @name czm_vertexLogDepth + * @glslFunction + */ +void czm_vertexLogDepth() { - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; + gl_Position = czm_updatePositionDepth(gl_Position); +#endif +} -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); +/** + * Writes the logarithmic depth to gl_Position using the provided clip coordinates. + *

+ * An example use case for this function would be moving the vertex in window coordinates + * before converting back to clip coordinates. Use the original vertex clip coordinates. + *

+ * @name czm_vertexLogDepth + * @glslFunction + * + * @param {vec4} clipCoords The vertex in clip coordinates. + * + * @example + * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + */ +void czm_vertexLogDepth(vec4 clipCoords) +{ +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; + czm_updatePositionDepth(clipCoords); +#endif +} +`;var S1=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +{ + // Reconstruct NDC coordinates + float x = 2.0 * screenCoordinate.x - 1.0; + float y = 2.0 * screenCoordinate.y - 1.0; + float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 q = vec4(x, y, z, 1.0); - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); + // Reverse the perspective division to obtain clip coordinates. + q /= screenCoordinate.w; - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + // Reverse the projection transformation to obtain eye coordinates. + if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s + { + q = czm_inverseProjection * q; + } + else + { + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; - czm_materialInput materialInput; + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); + q.x = (q.x * (right - left) + left + right) * 0.5; + q.y = (q.y * (top - bottom) + bottom + top) * 0.5; + q.z = (q.z * (near - far) - near - far) * 0.5; + q.w = 1.0; + } - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR + return q; } -`;var dP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; +/** + * Transforms a position from window to eye coordinates. + * The transform from window to normalized device coordinates is done using components + * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating + * the inverse of czm_viewportTransformation. The transformation from + * normalized device coordinates to clip coordinates is done using fragmentCoordinate.w, + * which is expected to be the scalar used in the perspective divide. The transformation + * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec4} fragmentCoordinate The position in window coordinates to transform. + * + * @returns {vec4} The transformed position in eye coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @example + * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + */ +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +{ + vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); +} -in float batchId; +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +{ + // See reverseLogDepth.glsl. This is separate to re-use the pow. +#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + float depthFromCamera = depthFromNear + near; + vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); + eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision + return eyeCoordinate; +#else + vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +#endif + return eyeCoordinate; +} -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; +/** + * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. + * This function produces more accurate results for window positions with log depth than + * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version + * of czm_windowToEyeCoordinates. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. + * @param {float} depthOrLogDepth A depth or log depth for the fragment. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @returns {vec4} The transformed position in eye coordinates. + */ +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +{ + vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +} +`;var v1=`// emulated noperspective +#if !defined(LOG_DEPTH) +in float v_WindowZ; +#endif -// For materials -#ifdef WIDTH_VARYING -out float v_width; +/** + * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane + * by writing the fragment's depth. See czm_depthClamp for more details. + * + * @name czm_writeDepthClamp + * @glslFunction + * + * @example + * out_FragColor = color; + * czm_writeDepthClamp(); + * + * @see czm_depthClamp + */ +void czm_writeDepthClamp() +{ +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; +} +`;var w1=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; + +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; #endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; #endif -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() +/** + * Writes the fragment depth to the logarithmic depth buffer. + *

+ * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when + * ray-casting geometry using a full screen quad. + *

+ * @name czm_writeLogDepth + * @glslFunction + * + * @param {float} depth The depth coordinate, where 1.0 is on the near plane and + * depth increases in eye-space units from there + * + * @example + * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + */ +void czm_writeLogDepth(float depth) { - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + // Discard the vertex if it's not between the near and far planes. + // We allow a bit of epsilon on the near plane comparison because a 1.0 + // from the vertex shader (indicating the vertex should be _on_ the near + // plane) will not necessarily come here as exactly 1.0. + if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { + discard; + } - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); +#ifdef POLYGON_OFFSET + // Polygon offset: m * factor + r * units + float factor = u_polygonOffset[0]; + float units = u_polygonOffset[1]; - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // This factor doesn't work in IE 10 + if (factor != 0.0) { + // m = sqrt(dZdX^2 + dZdY^2); + float x = dFdx(depth); + float y = dFdy(depth); + float m = sqrt(x * x + y * y); - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); + // Apply the factor before computing the log depth. + depth += m * factor; + } +#endif - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); +#endif - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates +#ifdef POLYGON_OFFSET + // Apply the units after the log depth. + gl_FragDepth += czm_epsilon7 * units; +#endif - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR +#endif +} -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; +/** + * Writes the fragment depth to the logarithmic depth buffer. + *

+ * Use this when the vertex shader calls {@link czm_vertexlogDepth}. + *

+ * + * @name czm_writeLogDepth + * @glslFunction + */ +void czm_writeLogDepth() { +#ifdef LOG_DEPTH + czm_writeLogDepth(v_depthFromNearPlusOne); #endif +} +`;var I1=`/** + * Transforms a value for non-perspective interpolation by multiplying + * it by w, the value used in the perspective divide. This function is + * intended to be called in a vertex shader to compute the value of a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The fragment shader + * must call {@link czm_readNonPerspective} to retrieve the final + * non-perspective value. + * + * @name czm_writeNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. + * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. + * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the + * fragment shader with {@link czm_readNonPerspective}. + */ +float czm_writeNonPerspective(float value, float w) { + return value * w; +} - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. +vec2 czm_writeNonPerspective(vec2 value, float w) { + return value * w; +} - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. +vec3 czm_writeNonPerspective(vec3 value, float w) { + return value * w; +} - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; +vec4 czm_writeNonPerspective(vec4 value, float w) { + return value * w; +} +`;var D1=`/** + * Converts a CIE Yxy color to RGB. + *

The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + *

+ * + * @name czm_XYZToRGB + * @glslFunction + * + * @param {vec3} Yxy The color in CIE Yxy. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_XYZToRGB(vec3 Yxy) +{ + const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, + -1.5371, 1.8760, -0.2040, + -0.4985, 0.0416, 1.0572); + vec3 xyz; + xyz.r = Yxy.r * Yxy.g / Yxy.b; + xyz.g = Yxy.r; + xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; + + return XYZ2RGB * xyz; +} +`;var P1=`vec3 czm_fromCartesian(vec3 position) { + vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); + vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); + float centerToleranceSquared = 0.1; - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); + n = normalize(n); - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + vec3 h = p - position; - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; + float longitude = atan(n.y, n.x); + float latitude = asin(n.z); - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif + float dotNum = dot(h, position); + // float height = MathSign(dotNum)*czm_magnitude(h); + float height = czm_magnitude(h); - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + vec3 result; + result.x = longitude; + result.y = latitude; + result.z = height; + return result; +}`;var O1=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ + for(int i=0;i<=16;i++){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ + if(xyxy[0][0]maxx){ + maxx = xyxy[0][0]; + } - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + if(xyxy[0][1]maxy){ + maxy = xyxy[0][1]; + } -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif + if(xyxy[0][2]maxz){ + maxz = xyxy[0][2]; + } + } + } + return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); } -`;var mP=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif - -in float batchId; - -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); +`;var R1=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); + if(index==0){ + return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); + } + if(index==1){ + return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); + } + if(index==2){ + return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); + } + if(index==3){ + return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); + } + if(index==4){ + return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); + } + if(index==5){ + return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); + } + if(index==6){ + return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); + } + if(index==7){ + return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); + } + if(index==8){ + return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); + } + if(index==9){ + return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); + } + if(index==10){ + return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); + } + if(index==11){ + return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); + } + if(index==12){ + return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); + } + if(index==13){ + return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); + } + if(index==14){ + return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); + } + if(index==15){ + return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); + } +}`;var M1=`int czm_getMaxIndex(mat4 yp_mat_x){ + if(yp_mat_x[3][3]!=0.0){ + return 16; + } + if(yp_mat_x[3][2]!=0.0){ + return 15; + } + if(yp_mat_x[3][1]!=0.0){ + return 14; + } + if(yp_mat_x[3][0]!=0.0){ + return 15; + } + if(yp_mat_x[2][3]!=0.0){ + return 12; + } + if(yp_mat_x[2][2]!=0.0){ + return 11; + } + if(yp_mat_x[2][1]!=0.0){ + return 10; + } + if(yp_mat_x[2][0]!=0.0){ + return 9; + } + if(yp_mat_x[1][3]!=0.0){ + return 8; + } + if(yp_mat_x[1][2]!=0.0){ + return 7; + } + if(yp_mat_x[1][1]!=0.0){ + return 6; + } + if(yp_mat_x[1][0]!=0.0){ + return 5; + } + if(yp_mat_x[0][3]!=0.0){ + return 4; + } + if(yp_mat_x[0][2]!=0.0){ + return 3; + } + if(yp_mat_x[0][1]!=0.0){ + return 2; + } + if(yp_mat_x[0][0]!=0.0){ + return 1; + } +}`;var L1=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + if(yp_max_index==0){ + return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); + } + if(yp_max_index==1){ + return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); + } + if(yp_max_index==2){ + return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); + } + if(yp_max_index==3){ + return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); + } + if(yp_max_index==4){ + return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); + } + if(yp_max_index==5){ + return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); + } + if(yp_max_index==6){ + return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); + } + if(yp_max_index==7){ + return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); + } + if(yp_max_index==8){ + return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); + } + if(yp_max_index==9){ + return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); + } + if(yp_max_index==10){ + return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); + } + if(yp_max_index==11){ + return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); + } + if(yp_max_index==12){ + return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); + } + if(yp_max_index==13){ + return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); + } + if(yp_max_index==14){ + return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); + } + if(yp_max_index==15){ + return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); + } +}`;var N1=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + float pz = position.z; + if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ + vec3 lonlat = czm_fromCartesian(position); + px = lonlat.x; + py = lonlat.y; + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); + vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); + vec3 llh1 = czm_fromCartesian(pos1); + vec3 llh2 = czm_fromCartesian(pos2); + float sx = llh1.x; + float sy = llh1.y; + float tx = llh2.x; + float ty = llh2.y; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } + } + } + } + return isIn ? true : false; +}`;var F1=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + if(currVal.x!=0.0&&currVal.y!=0.0){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + float sx = xyxy[0][0]; + float sy = xyxy[0][1]; + float tx = xyxy[1][0]; + float ty = xyxy[1][1]; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } + } + } + } + } + return isIn ? true : false; +}`;var B1=`float czm_magnitude(vec3 cartesian3) { + return sqrt(czm_magnitudeSquared(cartesian3)); +}`;var k1=`float czm_magnitudeSquared (vec3 cartesian4) { + return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; +}`;var U1=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { + vec3 result; + result.x = left.x * right.x; + result.y = left.y * right.y; + result.z = left.z * right.z; + return result; +}`;var V1=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + float positionX = cartesian1.x; + float positionY = cartesian1.y; + float positionZ = cartesian1.z; - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + float oneOverRadiiX = oneOverRadii.x; + float oneOverRadiiY = oneOverRadii.y; + float oneOverRadiiZ = oneOverRadii.z; - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; + float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; + float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; + // Compute the squared ellipsoid norm. + float squaredNorm = x2 + y2 + z2; + float ratio = sqrt(1.0 / squaredNorm); -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; + // As an initial approximation, assume that the radial intersection is the projection point. + vec3 intersection = cartesian1*ratio; - vec3 forwardDirectionEC = normalize(offset); - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + float oneOverRadiiSquaredX = oneOverRadiiSquared.x; + float oneOverRadiiSquaredY = oneOverRadiiSquared.y; + float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + // Use the gradient at the intersection point in place of the true unit normal. + // The difference in magnitude will be absorbed in the multiplier. + vec3 gradient; + gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; + gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; + gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + // Compute the initial guess at the normal vector multiplier, lambda. + float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); + float correction = 0.0; - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + float func; + float denominator; + float xMultiplier; + float yMultiplier; + float zMultiplier; + float xMultiplier2; + float yMultiplier2; + float zMultiplier2; + float xMultiplier3; + float yMultiplier3; + float zMultiplier3; + func = 1.0; + for(int i=0;i<9;i++){ + if(abs(func) > 0.000000000001){ + lambda -= correction; -#endif // COLUMBUS_VIEW_2D + xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); + yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); + zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + xMultiplier2 = xMultiplier * xMultiplier; + yMultiplier2 = yMultiplier * yMultiplier; + zMultiplier2 = zMultiplier * zMultiplier; -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR + xMultiplier3 = xMultiplier2 * xMultiplier; + yMultiplier3 = yMultiplier2 * yMultiplier; + zMultiplier3 = zMultiplier2 * zMultiplier; - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); + func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + // "denominator" here refers to the use of this expression in the velocity and acceleration + // computations in the sections to follow. + denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; + float derivative = -2.0 * denominator; - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + correction = func / derivative; + + }else{ + break; + } + } - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; + vec3 result; + result.x = positionX * xMultiplier; + result.y = positionY * yMultiplier; + result.z = positionZ * zMultiplier; + return result; +}`;var U0={czm_degreesPerRadian:aw,czm_depthRange:cw,czm_epsilon1:lw,czm_epsilon2:uw,czm_epsilon3:fw,czm_epsilon4:dw,czm_epsilon5:mw,czm_epsilon6:hw,czm_epsilon7:pw,czm_infinity:_w,czm_oneOverPi:gw,czm_oneOverTwoPi:yw,czm_passCesium3DTile:xw,czm_passCesium3DTileClassification:bw,czm_passCesium3DTileClassificationIgnoreShow:Cw,czm_passClassification:Tw,czm_passCompute:Aw,czm_passEnvironment:Ew,czm_passGlobe:Sw,czm_passOpaque:vw,czm_passOverlay:ww,czm_passTerrainClassification:Iw,czm_passTranslucent:Dw,czm_passVoxels:Pw,czm_pi:Ow,czm_piOverFour:Rw,czm_piOverSix:Mw,czm_piOverThree:Lw,czm_piOverTwo:Nw,czm_radiansPerDegree:Fw,czm_sceneMode2D:Bw,czm_sceneMode3D:kw,czm_sceneModeColumbusView:Uw,czm_sceneModeMorphing:Vw,czm_solarRadius:zw,czm_threePiOver2:Hw,czm_twoPi:Gw,czm_webMercatorMaxLatitude:Ww,czm_depthRangeStruct:jw,czm_material:qw,czm_materialInput:Yw,czm_modelMaterial:Xw,czm_modelVertexOutput:Kw,czm_pbrParameters:Jw,czm_ray:Zw,czm_raySegment:$w,czm_shadowParameters:Qw,czm_acesTonemapping:eI,czm_alphaWeight:tI,czm_antialias:nI,czm_approximateSphericalCoordinates:iI,czm_backFacing:oI,czm_branchFreeTernary:rI,czm_cascadeColor:sI,czm_cascadeDistance:aI,czm_cascadeMatrix:cI,czm_cascadeWeights:lI,czm_columbusViewMorph:uI,czm_computePosition:fI,czm_cosineAndSine:dI,czm_decompressTextureCoordinates:mI,czm_defaultPbrMaterial:hI,czm_depthClamp:pI,czm_eastNorthUpToEyeCoordinates:_I,czm_ellipsoidContainsPoint:gI,czm_ellipsoidWgs84TextureCoordinates:yI,czm_equalsEpsilon:xI,czm_eyeOffset:bI,czm_eyeToWindowCoordinates:CI,czm_fastApproximateAtan:TI,czm_fog:AI,czm_gammaCorrect:EI,czm_geodeticSurfaceNormal:SI,czm_getDefaultMaterial:vI,czm_getLambertDiffuse:wI,czm_getSpecular:II,czm_getWaterNoise:DI,czm_HSBToRGB:PI,czm_HSLToRGB:OI,czm_hue:RI,czm_inverseGamma:MI,czm_isEmpty:LI,czm_isFull:NI,czm_latitudeToWebMercatorFraction:FI,czm_linearToSrgb:BI,czm_lineDistance:kI,czm_luminance:UI,czm_metersPerPixel:VI,czm_modelToWindowCoordinates:zI,czm_multiplyWithColorBalance:HI,czm_nearFarScalar:GI,czm_octDecode:WI,czm_packDepth:jI,czm_pbrLighting:qI,czm_pbrMetallicRoughnessMaterial:YI,czm_pbrSpecularGlossinessMaterial:XI,czm_phong:KI,czm_planeDistance:JI,czm_pointAlongRay:ZI,czm_rayEllipsoidIntersectionInterval:$I,czm_raySphereIntersectionInterval:QI,czm_readDepth:e1,czm_readNonPerspective:t1,czm_reverseLogDepth:n1,czm_RGBToHSB:i1,czm_RGBToHSL:o1,czm_RGBToXYZ:r1,czm_round:s1,czm_sampleOctahedralProjection:a1,czm_saturation:c1,czm_shadowDepthCompare:l1,czm_shadowVisibility:u1,czm_signNotZero:f1,czm_sphericalHarmonics:d1,czm_srgbToLinear:m1,czm_tangentToEyeSpaceMatrix:h1,czm_textureCube:p1,czm_transformPlane:_1,czm_translateRelativeToEye:g1,czm_translucentPhong:y1,czm_transpose:x1,czm_unpackDepth:b1,czm_unpackFloat:C1,czm_unpackUint:T1,czm_valueTransform:A1,czm_vertexLogDepth:E1,czm_windowToEyeCoordinates:S1,czm_writeDepthClamp:v1,czm_writeLogDepth:w1,czm_writeNonPerspective:I1,czm_XYZToRGB:D1,czm_fromCartesian:P1,czm_getFloodRect:O1,czm_getIndexMat:R1,czm_getMaxIndex:M1,czm_getMaxIndexVal:L1,czm_isInEllipsoid:N1,czm_isInObliq:F1,czm_magnitude:B1,czm_magnitudeSquared:k1,czm_multiplyComponents:U1,czm_scaleToGeodeticSurface:V1};function Qve(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable +${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable +${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable #endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); +${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 +${n}`,n}var z1=Qve;function X$(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r=0;--o)i=`${i+t[o].glslSource} +`;return i.replace(n.glslSource,"")}function Z$(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - clipped = true; - } - } + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); #endif - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var lg=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); +void main(void) +{ +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); +#endif + czm_writeDepthClamp(); +} +`;var eQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};eQ.NUMBER_OF_CLASSIFICATION_TYPES=3;var Hn=Object.freeze(eQ);var rwe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Wa=Object.freeze(rwe);function Nm(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}Nm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var np={high:0,low:0};Nm.fromCartesian=function(e,t){l(t)||(t=new Nm);let n=t.high,i=t.low;return Nm.encode(e.x,np),n.x=np.high,i.x=np.low,Nm.encode(e.y,np),n.y=np.high,i.y=np.low,Nm.encode(e.z,np),n.z=np.high,i.z=np.low,t};var C8=new Nm;Nm.writeElements=function(e,t,n){Nm.fromCartesian(e,C8);let i=C8.high,o=C8.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var jn=Nm;function swe(e,t){let n=[],i=e.length,o=0;for(;o=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ts.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ts.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ts.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ts.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ts.UNSIGNED_INT};var Ue=Object.freeze(Ts);function qu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Wn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}qu.createVertexBuffer=function(e){return new qu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};qu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new qu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(qu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});qu.prototype._getBuffer=function(){return this._buffer};qu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};qu.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};qu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};qu.prototype.isDestroyed=function(){return!1};qu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var ht=qu;function awe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function nQ(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),nQ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function tQ(e){return e.values.length/e.componentsPerAttribute}function cwe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function lwe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=tQ(e[o[0]]),t=1;t0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),g={};for(t=0;t=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ht.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=ht.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new ip({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(ip.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});ip.prototype.getAttribute=function(e){return this._attributes[e]};function uwe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Gt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function fwe(e,t){let n=e._attributes,i=n.length;for(let o=0;o>1^-(e&1)}bo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var qn=bo;var cQ=new m,lQ=new m,uQ=new m;function Swe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,cQ),s=m.subtract(i,t,lQ),a=m.subtract(e,t,uQ),c=m.dot(r,r),u=m.dot(r,s),f=m.dot(r,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=H.subtract(n,t,cQ),s=H.subtract(i,t,lQ),a=H.subtract(e,t,uQ),c=H.dot(r,r),u=H.dot(r,s),f=H.dot(r,a),d=H.dot(s,s),p=H.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var z0=Swe;var E8={};E8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};E8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(_,E,w,D){for(;E.length>=1;){let M=E[E.length-1];if(E.splice(E.length-1,1),_[M].numLiveTriangles>0)return M}for(;o0)return++o,o-1;++o}return-1}function s(_,E,w,D,M,B,V){let U=-1,G,k=-1,Y=0;for(;Yk||k===-1)&&(k=G,U=j)),++Y}return U===-1?r(D,B,_,V):U}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;uc&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;gi&&(A.timeStamp=b,++b),++u}x=s(t,i,C,p,b,T,c)}return I};var q1=E8;var Ec={};function dk(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function vwe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);dk(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=q1.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function fQ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new De({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function Dwe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=fQ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Fe.TRIANGLES?u=3:e.primitiveType===Fe.LINES?u=2:e.primitiveType===Fe.POINTS&&(u=1);for(let f=0;f=P.SIXTY_FOUR_KILOBYTES&&(t.push(new ft({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=fQ(e.attributes))}o.length!==0&&t.push(new ft({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var dQ=new m,Pwe=new me;Ec.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new vi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;fb&&(b=T)}return new ft({attributes:f,indices:h,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}Ec.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(I8(t,"geometry")),n.length>0&&(o.push(I8(n,"westHemisphereGeometry")),o.push(I8(n,"eastHemisphereGeometry"))),o};var Yu=new m,Y1=new m,hT=new m,pT=new m;Ec.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u0){for(f=0;f3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;ug(e,a),ug(t,a),ug(n,a)}var _Q=new m;function Xu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,_Q),e.y/(e.y-t.y),_Q),n),m.clone(n,i),ug(n,!0),ug(i,!1)}var H0=new m,G0=new m,W0=new m,j0=new m,D8={positions:new Array(7),indices:new Array(3*3)};function Gwe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;Hwe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=D8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Xu(e,t,H0,W0),Xu(e,n,G0,j0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Xu(t,n,H0,W0),Xu(t,e,G0,j0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Xu(n,e,H0,W0),Xu(n,t,G0,j0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Xu(n,e,H0,W0),Xu(n,t,G0,j0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Xu(t,n,H0,W0),Xu(t,e,G0,j0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Xu(e,t,H0,W0),Xu(e,n,G0,j0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=D8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=H0,c[4]=G0,c[5]=W0,c[6]=j0,c.length=7),D8}function gQ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=ft.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function gT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new De({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ft({attributes:n,indices:[],primitiveType:e.primitiveType})}function M8(e,t,n){let i=l(e.geometry.boundingSphere);t=gQ(t,i),n=gQ(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function L8(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let g=e.fromArray(u,r*t,n),h=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(x,c.z,x);let b=e.add(g,h,g);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var Wwe=L8(re,4),fk=L8(m,3),AQ=L8(H,2),jwe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},K1=new m,P8=new m,O8=new m,qwe=new m;function lk(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let b=m.fromArray(o,e*3,K1),C=m.fromArray(o,t*3,P8),T=m.fromArray(o,n*3,O8),A=z0(i,b,C,T,qwe);if(l(A)){if(l(r)&&fk(e,t,n,A,r,d.normal.values,x,!0),l(u)){let S=m.fromArray(u,e*3,K1),v=m.fromArray(u,t*3,P8),I=m.fromArray(u,n*3,O8);m.multiplyByScalar(S,A.x,S),m.multiplyByScalar(v,A.y,v),m.multiplyByScalar(I,A.z,I);let O;!m.equals(S,m.ZERO)||!m.equals(v,m.ZERO)||!m.equals(I,m.ZERO)?(O=m.add(S,v,S),m.add(O,I,O),m.normalize(O,O)):(O=K1,O.x=0,O.y=0,O.z=0),m.pack(O,d.extrudeDirection.values,x*3)}if(l(f)&&jwe(e,t,n,A,f,d.applyOffset.values,x),l(s)&&fk(e,t,n,A,s,d.tangent.values,x,!0),l(a)&&fk(e,t,n,A,a,d.bitangent.values,x,!0),l(c)&&AQ(e,t,n,A,c,d.st.values,x),g>0)for(let S=0;S3){let D=w.positions,M=w.indices,B=M.length;for(let V=0;V0)continue;let c=m.unpack(i,s,vQ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(o,s,R8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+30||ae.intersectPlane(n,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING))return e;if(t.geometryType!==ju.NONE)switch(t.geometryType){case ju.POLYLINES:nIe(e);break;case ju.TRIANGLES:yQ(e);break;case ju.LINES:xQ(e);break}else zwe(t),t.primitiveType===Fe.TRIANGLES?yQ(e):t.primitiveType===Fe.LINES&&xQ(e);return e};var kn=Ec;function al(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(al.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});al.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};al.geodeticLatitudeToMercatorAngle=function(e){e>al.MaximumLatitude?e=al.MaximumLatitude:e<-al.MaximumLatitude&&(e=-al.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};al.MaximumLatitude=al.mercatorAngleToGeodeticLatitude(Math.PI);al.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=al.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};al.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=al.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var Ii=al;function iIe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;ur&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function sIe(e,t){let n=[];return F8(e,"geometry",t,n),F8(e,"westHemisphereGeometry",t,n),F8(e,"eastHemisphereGeometry",t,n),n}var rp={};rp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=rIe(e),t.length>0&&(n=kn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=sIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};rp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let v=b.length/C;for(S=Ue.createTypedArray(v,x),i=0;i{t._completeLoad=(o,r,s)=>{this._error=s,this._state=r,o.afterRender.push(function(){if(t._ready=t._state===_r.COMPLETE||t._state===_r.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(gr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function mIe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function OQ(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); +`}n&&o&&r?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(f+=`vec3 bitangent; +`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Ge.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function CIe(e){let t=Ge.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function TIe(e){let t=Ge.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif +} +`,t}function RQ(e,t){let n=e.vertexAttributes}function AIe(e,t){return function(){return e[t]}}var B8=Math.max(Wt.hardwareConcurrency-1,1),hk,EIe=new gi("combineGeometry");function SIe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===_r.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o0){let x=new Float64Array(d);for(h=[x.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=_r.COMBINED):Z1(e,t,_r.FAILED,void 0)}).catch(function(d){Z1(e,t,_r.FAILED,d)})}}function vIe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=_r.COMBINED):Z1(e,t,_r.FAILED,void 0)}function wIe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||ae.intersectPlane(x,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i0){if(Gt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==_r.COMPLETE&&this._state!==_r.COMBINED&&(this.asynchronous?SIe(this,e):vIe(this,e)),this._state===_r.COMBINED&&(IIe(this,e),LQ(this,e),PIe(this,e)),!this.show||this._state!==_r.COMPLETE)return;this._batchTableOffsetsUpdated||LQ(this,e),this._recomputeBoundingSpheres&&wIe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,OIe)(this,t,n,u),r&&y(this._createShaderProgramFunction,RIe)(this,e,n),(o||r)&&y(this._createCommandsFunction,MIe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,LIe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var NIe=new ae,FIe=new ae;function HQ(e,t,n){if(n===sn.TOP){let i=ae.clone(e,NIe),o=ae.clone(e,FIe);o.center=m.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===sn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function BIe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function kIe(e,t,n,i,o){return function(r){let s=kQ(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var UIe=new m;function VIe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&HQ(i,m.fromArray(r.get(),0,UIe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function zIe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}gr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } +#endif // NORMAL_EC -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +void main(void) { - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var t5=`${Zl} -${hP}`,sOe=V0;Wt.isInternetExplorer()||(t5=`#define CLIP_POLYLINE -${t5}`);function Q0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Q0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,t5),this._fragmentShaderSource=y(e.fragmentShaderSource,sOe),this._renderState=$i.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Q0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Q0.VERTEX_FORMAT=Pe.POSITION_ONLY;Q0.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;Q0.prototype.isTranslucent=$i.prototype.isTranslucent;Q0.prototype.getRenderState=$i.prototype.getRenderState;var Uo=Q0;var pP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } +#endif - v_width = width; - v_st.s = st.s; - v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); - v_polylineAngle = angle; -} -`;var $0=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); #endif -in vec2 v_st; -void main() -{ +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; +#else // PER_INSTANCE_COLOR + + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. + + czm_materialInput materialInput; + +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; #endif - czm_writeLogDepth(); -} -`;var n5=`${Zl} -${pP}`,aOe=$0;Wt.isInternetExplorer()||(n5=`#define CLIP_POLYLINE -${n5}`);function eA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=eA.VERTEX_FORMAT;this.material=l(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,n5),this._fragmentShaderSource=y(e.fragmentShaderSource,aOe),this._renderState=$i.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(eA.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});eA.VERTEX_FORMAT=Pe.POSITION_AND_ST;eA.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;eA.prototype.isTranslucent=$i.prototype.isTranslucent;eA.prototype.getRenderState=$i.prototype.getRenderState;var Ks=eA;function up(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ks),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=ote(!1),this._renderState3DTiles=ote(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(up.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});up.initializeTerrainHeights=function(){return si.initialize()};function cOe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(mP);s=vn._appendShowToShader(r,s),s=vn._appendDistanceDisplayConditionToShader(r,s),s=vn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(dP);a=vn._appendShowToShader(r,a),a=vn._appendDistanceDisplayConditionToShader(r,a),a=vn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(uP),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[s]}),h=new He({defines:p,sources:[d,c]});e._sp=Zt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:o});let A=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(A)){let C=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:o})}e._sp2D=A;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(x)){let C=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${si._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(fP);let T=new He({defines:p,sources:[d,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:o})}e._spMorph=x}function ote(e){return ze.fromCache({cull:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function lOe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Uo?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};up.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};up.isSupported=function(e){return e.frameState.context.depthTexture};up.prototype.isDestroyed=function(){return!1};up.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var fd=up;var fOe=new H(1,1),dOe=!1,mOe=z.WHITE;function ET(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(ET.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});ET.prototype.getType=function(e){return"Image"};ET.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,fOe,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,mOe,t.color),j.getValueOrDefault(this._transparent,e,dOe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};ET.prototype.equals=function(e){return this===e||e instanceof ET&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var mg=ET;function hOe(e){if(e instanceof z)return new Vt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new mg;return t.image=e,t}}function pOe(e,t){return le(e,t,hOe)}var Dr=pOe;function _P(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(_P.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Dr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});_P.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new _P(this)};_P.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var tA=_P;var _Oe={FIXED:0,INERTIAL:1},tr=Object.freeze(_Oe);function bT(){fe.throwInstantiationError()}Object.defineProperties(bT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});bT.prototype.getValue=fe.throwInstantiationError;bT.prototype.getValueInReferenceFrame=fe.throwInstantiationError;bT.prototype.equals=fe.throwInstantiationError;var i5=new Z;bT.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new m),n===i)return m.clone(t,r);let o=Mt.computeIcrfToFixedMatrix(e,i5);if(l(o)||(o=Mt.computeTemeToPseudoFixedMatrix(e,i5)),n===tr.INERTIAL)return Z.multiplyByVector(o,t,r);if(n===tr.FIXED)return Z.multiplyByVector(Z.transpose(o,i5),t,r)};var fp=bT;function nA(e,t){this._definitionChanged=new pe,this._value=m.clone(e),this._referenceFrame=y(t,tr.FIXED)}Object.defineProperties(nA.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===tr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});nA.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,tr.FIXED,t)};nA.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};nA.prototype.getValueInReferenceFrame=function(e,t,n){return fp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};nA.prototype.equals=function(e){return this===e||e instanceof nA&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Pc=nA;function gP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(gP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Dr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});gP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new gP(this)};gP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var iA=gP;function gOe(e){return e}function yOe(e,t){return le(e,t,gOe)}var ll=yOe;function yP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(yP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Dr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});yP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new yP(this)};yP.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var rA=yP;function AP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(AP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Dr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});AP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new AP(this)};AP.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var oA=AP;function xP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(xP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Dr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});xP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new xP(this)};xP.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var sA=xP;function CP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(CP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});CP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new CP(this)};CP.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var dd=CP;var AOe=new m(1,1,1),xOe=m.ZERO,COe=Le.IDENTITY;function ate(e,t,n){this.translation=m.clone(y(e,xOe)),this.rotation=Le.clone(y(t,COe)),this.scale=m.clone(y(n,AOe))}ate.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var hg=ate;var r5=new hg;function TP(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(TP.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});TP.prototype.getValue=function(e,t){return l(t)||(t=new hg),t.translation=j.getValueOrClonedDefault(this._translation,e,r5.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,r5.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,r5.scale,t.scale),t};TP.prototype.equals=function(e){return this===e||e instanceof TP&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var aA=TP;function dp(e,t){this._propertyNames=[],this._definitionChanged=new pe,l(e)&&this.merge(e,t)}Object.defineProperties(dp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t (textureSize.y / textureSize.x)) - { - mipLevel = 1.0; - if (uv.y - pixel.y > yMipLevel1) - { - mipLevel = 2.0; - if (uv.y - pixel.y * 3.0 > yMipLevel2) - { - mipLevel = 3.0; - if (uv.y - pixel.y * 5.0 > yMipLevel3) - { - mipLevel = 4.0; - if (uv.y - pixel.y * 7.0 > yMipLevel4) - { - mipLevel = 5.0; - } - } - } - } - } + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - if (mipLevel > 0.0) - { - float scale = pow(2.0, mipLevel); +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function Ku(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new U8;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new U8;if(o.requiresTextureCoordinates=e,n instanceof an)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Ku.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof an&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof an||(o=t.material.shaderSource),new Ge({defines:i,sources:[o,yT]})};Ku.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ge({defines:n,sources:[yT],pickColorQualifier:"in"})};Ku.prototype.createVertexShader=function(e,t,n,i){return JQ(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Ku.prototype.createPickVertexShader=function(e,t,n,i){return JQ(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var GQ=new m,WQ=new me,jQ={high:0,low:0};function JQ(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=WQ;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,GQ),d=jn.encode(f.x,jQ);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=WQ;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,GQ);d=jn.encode(g.x,jQ),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof an&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ge({defines:c,sources:[o]})}function U8(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(U8.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function qQ(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var GIe=[new H,new H,new H,new H];function ZQ(e,t){let n=GIe,i=H.unpack(t,0,n[0]),o=H.unpack(t,2,n[1]),r=H.unpack(t,4,n[2]);e.uMaxVmax=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/qQ(i,o,r),a=1/qQ(i,r,o);e.uvMinAndExtents=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var $Q=new me,QQ=new m,WIe=new m,jIe=new m,pk={high:0,low:0};function eee(e,t,n){let i=$Q;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,QQ);i.latitude=e.north;let r=t.project(i,WIe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,jIe),a=[0,0,0,0],c=[0,0,0,0],u=jn.encode(o.x,pk);a[0]=u.high,c[0]=u.low,u=jn.encode(o.y,pk),a[1]=u.high,c[1]=u.low,u=jn.encode(r.y,pk),a[2]=u.high,c[2]=u.low,u=jn.encode(s.x,pk),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var qIe=new L,YIe=new L,YQ=new m,XIe=new me,KIe=[new me,new me,new me,new me,new me,new me,new me,new me];function JIe(e,t,n,i,o,r){let s=ce.center(e,XIe);s.height=n;let a=me.toCartesian(s,t,YQ),c=Mt.eastNorthUpToFixedFrame(a,t,qIe),u=L.inverse(c,YIe),f=e.west,d=e.east,p=e.north,g=e.south,h=KIe;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let x=(f+d)*.5,b=(p+g)*.5;h[4].latitude=g,h[4].longitude=x,h[5].latitude=p,h[5].longitude=x,h[6].latitude=b,h[6].longitude=f,h[7].latitude=b,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){h[R].height=n;let N=me.toCartesian(h[R],t,YQ);L.multiplyByPoint(u,N,N),N.z=0,C=Math.min(C,N.x),T=Math.max(T,N.x),A=Math.min(A,N.y),S=Math.max(S,N.y)}let v=i;v.x=C,v.y=A,v.z=0,L.multiplyByPoint(c,v,v);let I=o;I.x=T,I.y=A,I.z=0,L.multiplyByPoint(c,I,I),m.subtract(I,v,o);let O=r;O.x=C,O.y=S,O.z=0,L.multiplyByPoint(c,O,O),m.subtract(O,v,r)}var ZIe=new m,$Ie=new m,QIe=new jn;Ku.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=QQ,s=ZIe,a=$Ie;JIe(e,n,y(o,0),r,s,a);let c={};ZQ(c,t);let u=jn.fromCartesian(r,QIe);return c.southWest_HIGH=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),eee(e,i,c),c};var e1e=new m;function XQ(e,t,n,i){let o=$Q;o.latitude=e,o.longitude=t,o.height=0;let r=me.toCartesian(o,n,e1e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var KQ=new H;Ku.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=XQ(e.south,e.west,n,KQ),r=o.x,s=o.y,a=XQ(e.north,e.east,n,KQ),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),g={sphericalExtents:new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new ja({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return ZQ(g,t),eee(e,i,g),g};Ku.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Ku.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function t1e(e){return Math.max(e.width,e.height)>Ku.MAX_WIDTH_FOR_PLANAR_EXTENTS}Ku.shouldUseSphericalCoordinates=function(e){return t1e(e)};Ku.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Xl=Ku;var n1e={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Gn=Object.freeze(n1e);var i1e={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},pt=Object.freeze(i1e);var _k={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};_k.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Gn.ALWAYS,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},backFunction:Gn.ALWAYS,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},reference:_k.CESIUM_3D_TILE_MASK,mask:_k.CESIUM_3D_TILE_MASK}};var Bt=Object.freeze(_k);function Y0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,o)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Y0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Y0.isSupported=function(e){return e.context.stencilBuffer};function xT(e,t){let n=t?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:n,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}function z8(e){return{stencilTest:{enabled:e,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var o1e={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function r1e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(xT(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(xT(o,!0)),e._rsColorPass=Ve.fromCache(z8(o,!1)),e._rsPickPass=Ve.fromCache(o1e)}function s1e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ge.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function a1e(e,t){let n=t.context,i=e._primitive,o=H1;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=s1e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ge({defines:[a],sources:[o]}),u=new Ge({sources:[lg]}),f=e._primitive._attributeLocations,d=new Xl(s,r,e.appearance);if(e._spStencil=Zt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=Ge.createPickVertexShaderSource(o);h=In._appendShowToShader(i,h),h=In._updatePickColorAttribute(h);let x=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Zt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let T=d.createPickFragmentShader(!0),A=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Zt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=In._appendShowToShader(i,o),c=new Ge({defines:[a],sources:[o]}),e._sp=Zt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Zt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let x=d.createFragmentShader(!0),b=d.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=h}}function c1e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=Xl.hasAttributesForSphericalExtents(c),g=Xl.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};Y0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Y0.prototype.isDestroyed=function(){return!1};Y0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var bT=Y0;var d1e={u_globeMinimumAltitude:function(){return 55e3}};function cl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],s=r.length;for(let a=0;a{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):r(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=oi._defaultMaxTerrainHeight,this._minTerrainHeight=oi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let o=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:o,_extruded:!0,_uniformMap:d1e}}Object.defineProperties(cl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});cl.isSupported=bT.isSupported;function iee(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function oee(e){return function(t,n){return e._minHeight}}var m1e=new m,h1e=new m,p1e=new m,_1e=new me,g1e=new ce;function gk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};cl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};cl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};cl.prototype.isDestroyed=function(){return!1};cl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};cl._supportsMaterials=function(e){return e.depthTexture};cl.supportsMaterials=function(e){return cl._supportsMaterials(e.frameState.context)};var Sc=cl;function CT(){fe.throwInstantiationError()}Object.defineProperties(CT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});CT.prototype.getType=fe.throwInstantiationError;CT.prototype.getValue=fe.throwInstantiationError;CT.prototype.equals=fe.throwInstantiationError;CT.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=zi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==zi.ColorType)&&(n=zi.fromType(zi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Xo=CT;function X0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}X0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};X0.prototype._setOptions=fe.throwInstantiationError;X0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,d,p=t._getIsClosed(c);if(f)d=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Xo.getValue(e,u,this._material);this._material=g,d=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=an.VERTEX_FORMAT,this._primitive=o.add(new Sc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new an({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};X0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var si=X0;var C1e={NONE:0,GEODESIC:1,RHUMB:2},$t=Object.freeze(C1e);var see=P.EPSILON10;function T1e(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;sP.EPSILON12);let E=F*(t*t-n*n)/(n*n),w=1+E*(4096+E*(E*(320-175*E)-768))/16384,D=E*(256+E*(E*(74-47*E)-128))/1024,M=_*_,B=D*N*(_+D*(R*(2*M-1)-D*_*(4*N*N-3)*(4*M-3)/6)/4),V=n*w*(O-B),U=Math.atan2(g*I,b-T*v),G=Math.atan2(d*I,b*v-T);e._distance=V,e._startHeading=U,e._endHeading=G,e._uSquared=E}var v1e=new m,W8=new m;function cee(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,W8),v1e),r=m.normalize(i.cartographicToCartesian(n,W8),W8);S1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,A1e(e)}function $1(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&cee(this,e,t,i)}Object.defineProperties($1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});$1.prototype.setEndPoints=function(e,t){cee(this,e,t,this._ellipsoid)};$1.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};$1.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,x=n.u6Over64,b=n.u4Over16,C=2*p*g*o/3+i*(1-h+7*b/4-15*x/4+579*g/64-(b-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(h/2-b+71*x/32-85*g/16)*a+(5*b/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),v=Math.sin(C),I=Math.cos(C),O=n.cosineU*I,R=n.sineU*v,F=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-aee(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,v,I,S);return l(t)?(t.longitude=this._start.longitude+F,t.latitude=A,t.height=0,t):new me(this._start.longitude+F,A,0)};var Ju=$1;function q8(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*x)}function w1e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),A=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),I=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*A+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*R}function TT(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function I1e(e,t,n,i,o){let r=TT(e._ellipticity,n),s=TT(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function D1e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=q8(e._ellipticity,t,o);u=(q8(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var P1e=new m,j8=new m;function lee(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,j8),P1e),r=m.normalize(i.cartographicToCartesian(n,j8),j8),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=I1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=D1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function uee(e,t,n,i,o,r){if(n===0)return me.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=q8(o,i,e.latitude),d=n*Math.cos(t),p=f+d;c=w1e(p,o,i);let g=TT(o,e.latitude),h=TT(o,c);u=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new me(a,c,0)}function sp(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&lee(this,e,t,i)}Object.defineProperties(sp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});sp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,oe.WGS84),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=uee(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new sp(e,d,r):(o.setEndPoints(e,d),o)};sp.prototype.setEndPoints=function(e,t){lee(this,e,t,this._ellipsoid)};sp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};sp.prototype.interpolateUsingSurfaceDistance=function(e,t){return uee(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};sp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new me),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};sp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=TT(n,o.latitude),s=TT(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var Ca=sp;var e5=[vi,Ii],O1e=e5.length,Pee=Math.cos(P.toRadians(30)),fee=Math.cos(P.toRadians(150)),Oee=0,Ree=1e3;function dg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,$t.GEODESIC),this._ellipsoid=oe.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(dg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+oe.packedLength+1+1}}});dg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iPee||rP.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,xee),u=c.cartesianToCartographic(s,yee)),u.height=0;let f=e.project(u,o);return o=m.subtract(f,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var Z1e=new m,bee=new m;function Cee(e,t,n,i,o,r){let s=m.subtract(t,e,Z1e);m.normalize(s,s);let a=n-Oee,c=m.multiplyByScalar(s,a,bee);m.add(e,c,o);let u=i-Ree;c=m.multiplyByScalar(s,u,bee),m.add(t,c,r)}var $1e=new m;function bk(e,t){let n=fn.getPointDistance(Ck,e),i=fn.getPointDistance(Ck,t),o=$1e;P.equalsEpsilon(n,0,P.EPSILON2)?(o=ap(t,e,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=ap(e,t,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(t,o,t))}function Q1e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var Lee=new me,Nee=new me,Tee=new m,J8=new m,Aee=new m,Eee=new m,eDe=new m,See=new m,tDe=[Lee,Nee],nDe=new ce,iDe=new m,oDe=new m,rDe=new m,sDe=new m,aDe=new m,cDe=new m,Z8=new m,$8=new m,lDe=new m,uDe=new m,fDe=new m,vee=new m,dDe=new m,mDe=new m,hDe=new jn,pDe=new jn,wee=new m,_De=new m,Iee=new m,gDe=[new ae,new ae],Fee=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Dee=Fee.length;function yDe(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),b=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),A=new Float32Array(p),S=new Float32Array(p),v,I,O,R;s&&(v=new Float32Array(p),I=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(d*2));let N=r.length/2,F=0,_=Lee;_.height=0;let E=Nee;E.height=0;let w=Tee,D=J8;if(s)for(c=0,a=1;aPee?(Tt=Q1(t,_,ze,Re,Z8),ot=Q1(t,E,K,dt,$8)):ji===1?(ot=Q1(t,E,K,dt,$8),Tt.x=0,Tt.y=P.sign(_.longitude-Math.abs(E.longitude)),Tt.z=0):(Tt=Q1(t,_,ze,Re,Z8),ot.x=0,ot.y=P.sign(_.longitude-E.longitude),ot.z=0)}let ln=m.distance(we,W),Dn=jn.fromCartesian(ve,hDe),Ht=m.subtract($,ve,lDe),kt=m.normalize(Ht,vee),be=m.subtract(we,ve,uDe);be=m.normalize(be,be);let Ee=m.cross(kt,be,vee);Ee=m.normalize(Ee,Ee);let at=m.cross(be,ze,dDe);at=m.normalize(at,at);let Jt=m.subtract(W,$,fDe);Jt=m.normalize(Jt,Jt);let di=m.cross(K,Jt,mDe);di=m.normalize(di,di);let Ze=ln/B,jr=J/B,qr=0,ha,ts,Ne,rt=0,$e=0;if(s){qr=m.distance(Re,dt),ha=jn.fromCartesian(Re,pDe),ts=m.subtract(dt,Re,wee),Ne=m.normalize(ts,_De);let ji=Ne.x;Ne.x=Ne.y,Ne.y=-ji,rt=qr/F,$e=he/F}for(V=0;V<8;V++){let ji=Y+V*4,os=G+V*2,Kn=ji+3,Fn=V<4?1:-1,dn=V===2||V===3||V===6||V===7?1:-1;m.pack(Dn.high,b,ji),b[Kn]=Ht.x,m.pack(Dn.low,C,ji),C[Kn]=Ht.y,m.pack(at,T,ji),T[Kn]=Ht.z,m.pack(di,A,ji),A[Kn]=Ze*Fn,m.pack(Ee,S,ji);let bi=jr*dn;bi===0&&dn<0&&(bi=9),S[Kn]=bi,s&&(v[ji]=ha.high.x,v[ji+1]=ha.high.y,v[ji+2]=ha.low.x,v[ji+3]=ha.low.y,O[ji]=-Tt.y,O[ji+1]=Tt.x,O[ji+2]=ot.y,O[ji+3]=-ot.x,I[ji]=ts.x,I[ji+1]=ts.y,I[ji+2]=Ne.x,I[ji+3]=Ne.y,R[os]=rt*Fn,bi=$e*dn,bi===0&&dn<0&&(bi=9),R[os+1]=bi)}let We=rDe,mt=sDe,Vt=iDe,Tn=oDe,Qn=ce.fromCartographicArray(tDe,nDe),Ao=oi.getMinimumMaximumHeights(Qn,u),ns=Ao.minimumTerrainHeight,is=Ao.maximumTerrainHeight;ge+=ns,ge+=is,Cee(ve,we,ns,is,We,Vt),Cee($,W,ns,is,mt,Tn);let ur=m.multiplyByScalar(Ee,P.EPSILON5,Iee);m.add(We,ur,We),m.add(mt,ur,mt),m.add(Vt,ur,Vt),m.add(Tn,ur,Tn),bk(We,mt),bk(Vt,Tn),m.pack(We,x,k),m.pack(mt,x,k+3),m.pack(Tn,x,k+6),m.pack(Vt,x,k+9),ur=m.multiplyByScalar(Ee,-2*P.EPSILON5,Iee),m.add(We,ur,We),m.add(mt,ur,mt),m.add(Vt,ur,Vt),m.add(Tn,ur,Tn),bk(We,mt),bk(Vt,Tn),m.pack(We,x,k+12),m.pack(mt,x,k+15),m.pack(Tn,x,k+18),m.pack(Vt,x,k+21),U+=2,c+=3,G+=16,k+=24,Y+=32,J+=ln,he+=qr}c=0;let se=0;for(a=0;a0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function QOe(e,t){if(_d.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new _d(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}UP.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(QOe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};UP.prototype.isDestroyed=function(){return!1};UP.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var mA=UP;var f5=vr(Hl(),1);var u5,Ete="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU",TU={};TU.defaultAccessToken=Ete;TU.defaultServer=new ve({url:"https://api.cesium.com/"});TU.getDefaultTokenCredit=function(e){if(e===Ete){if(!l(u5)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at
https://cesium.com.`;u5=new It(t,!0)}return u5}};var gd=TU;function Mc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:$Oe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new f5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}l(Object.create)&&(Mc.prototype=Object.create(ve.prototype),Mc.prototype.constructor=Mc);Mc.fromAssetId=function(e,t){let n=Mc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Mc(i,n)})};Object.defineProperties(Mc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Mc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Mc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=gd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Mc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Mc(t._ionEndpoint,t._ionEndpointResource)),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Mc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};Mc.prototype._makeRequest=function(e){return this._isExternal||new f5.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),ve.prototype._makeRequest.call(this,e))};Mc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,gd.defaultServer),i=y(t.accessToken,gd.defaultAccessToken);n=ve.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};function $Oe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){return n._ionEndpoint=o,o}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Zs=Mc;function Vm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Vm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Vm.prototype.get=function(e){return this._array[e]};Vm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Vm.prototype.peek=function(){return this._array[this._length-1]};Vm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Vm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Vm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Vm.prototype.resize=function(e){this.length=e};Vm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Bc=Vm;var yp={X:0,Y:1,Z:2};yp.Y_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));yp.Z_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));yp.X_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));yp.Z_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));yp.X_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));yp.Y_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));yp.fromName=function(e){return yp[e]};var cr=Object.freeze(yp);function bte(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(bte.prototype,{metadata:{get:function(){return this._metadata}}});var hA=bte;function pg(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),pg.decode(e)}pg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};pg.decodeWithFromCharCode=function(e){let t="",n=eRe(e),i=n.length;for(let r=0;r>10)+55296,(o&1023)+56320))}return t};function VP(e,t,n){return t<=e&&e<=n}function eRe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c{this._resolveContent=r})}Object.defineProperties(Ad.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n0){let r=Math.min(t,Ht.maximumTextureSize),o=Math.ceil(t/Ht.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new H(r,o),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Xa.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Xa.DEFAULT_COLOR_VALUE=z.WHITE;Xa.DEFAULT_SHOW_VALUE=!0;function Ste(e){let t=e._textureDimensions;return t.x*t.y*4}function vte(e){if(!l(e._batchValues)){let t=Ste(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function wte(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Xa.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=wte(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=vte(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Xa.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,r=Ste(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let h=0;h0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${vRe(i)}${s}`}};function Ite(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function wRe(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};lr.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=He.replaceMain(e,"tile_main"),Ht.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function DRe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===dl.HIGHLIGHT)return 0;if(n===dl.REPLACE)return 1;if(n===dl.MIX)return P.clamp(i,P.EPSILON4,1)}lr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return gt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return DRe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};lr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var _g={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};lr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=IRe(this);for(let u=t;u>>Ft.SKIP_LOD_BIT_SHIFT}function FRe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function URe(e){let t=Ye(e,!0);return t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,ze.fromCache(t)}lr.prototype.update=function(e,t){this._batchTexture.update(e,t)};lr.prototype.isDestroyed=function(){return!1};lr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var xp=lr;function VRe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var km=VRe;var DT=`in vec3 position; -in float a_batchId; + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); -uniform mat4 u_modifiedModelViewProjection; + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;function ef(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(ef.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});ef.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ef.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ef.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ef.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let r=e.metadata;if(l(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}let o=e.tile,s=o.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(o.implicitSubtree)&&(a=o.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};ef.prototype.getPropertyInherited=function(e){return ef.getPropertyInherited(this._content,this._batchId,e)};ef.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ef.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ef.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ef.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ts=ef;var h5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},p5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},We=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+We.version}static addUnaryOp(t){return We.max_unop_len=Math.max(t.length,We.max_unop_len),We.unary_ops[t]=1,We}static addBinaryOp(t,n,i){return We.max_binop_len=Math.max(t.length,We.max_binop_len),We.binary_ops[t]=n,i?We.right_associative.add(t):We.right_associative.delete(t),We}static addIdentifierChar(t){return We.additional_identifier_chars.add(t),We}static addLiteral(t,n){return We.literals[t]=n,We}static removeUnaryOp(t){return delete We.unary_ops[t],t.length===We.max_unop_len&&(We.max_unop_len=We.getMaxKeyLen(We.unary_ops)),We}static removeAllUnaryOps(){return We.unary_ops={},We.max_unop_len=0,We}static removeIdentifierChar(t){return We.additional_identifier_chars.delete(t),We}static removeBinaryOp(t){return delete We.binary_ops[t],t.length===We.max_binop_len&&(We.max_binop_len=We.getMaxKeyLen(We.binary_ops)),We.right_associative.delete(t),We}static removeAllBinaryOps(){return We.binary_ops={},We.max_binop_len=0,We}static removeLiteral(t){return delete We.literals[t],We}static removeAllLiterals(){return We.literals={},We}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new We(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return We.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!We.binary_ops[String.fromCharCode(t)]||We.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return We.isIdentifierStart(t)||We.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(We.hooks[t]){let i={context:this,node:n};return We.hooks.run(t,i),i.node}return n}searchHook(t){if(We.hooks[t]){let n={context:this};return We.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===We.SPACE_CODE||t===We.TAB_CODE||t===We.LF_CODE||t===We.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:We.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index0;){if(We.binary_ops.hasOwnProperty(t)&&(!We.isIdentifierStart(this.code)||this.index+t.lengtho.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:We.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:We.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,We.isDecimalDigit(t)||t===We.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===We.SQUOTE_CODE||t===We.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===We.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,We.max_unop_len),i=n.length;i>0;){if(We.unary_ops.hasOwnProperty(n)&&(!We.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===We.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===We.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===We.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});We.max_unop_len=We.getMaxKeyLen(We.unary_ops);We.max_binop_len=We.getMaxKeyLen(We.binary_ops);var gg=e=>new We(e).parse(),zRe=Object.getOwnPropertyNames(We);zRe.forEach(e=>{gg[e]===void 0&&e!=="prototype"&&(gg[e]=We[e])});gg.Jsep=We;var HRe="ConditionalExpression",GRe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:HRe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};gg.plugins.register(GRe);var WRe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},yt=Object.freeze(WRe);function xd(e,t){this._expression=e,e=iMe(e,t),e=oMe(rMe(e)),gg.addBinaryOp("=~",0),gg.addBinaryOp("!~",0);let n;try{n=gg(e)}catch(i){throw new de(i)}this._runtimeAst=Ci(this,n)}Object.defineProperties(xd.prototype,{expression:{get:function(){return this._expression}}});var Ln={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};xd.prototype.evaluate=function(e,t){Ln.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof oe?n.clone(t):n};xd.prototype.evaluateColor=function(e,t){Ln.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};xd.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} -{ - return ${r}; -} -`,r};xd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};xd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var jRe=["!","-","+"],Rte=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],SU=/\${(.*?)}/g,YRe=/\\/g,qRe="@#%",XRe=/@#%/g,vU=new z,wU={abs:Es(Math.abs),sqrt:Es(Math.sqrt),cos:Es(Math.cos),sin:Es(Math.sin),tan:Es(Math.tan),acos:Es(Math.acos),asin:Es(Math.asin),atan:Es(Math.atan),radians:Es(P.toRadians),degrees:Es(P.toDegrees),sign:Es(P.sign),floor:Es(Math.floor),ceil:Es(Math.ceil),round:Es(Math.round),exp:Es(Math.exp),exp2:Es(JRe),log:Es(Math.log),log2:Es(ZRe),fract:Es(KRe),length:QRe,normalize:$Re},DU={atan2:EU(Math.atan2,!1),pow:EU(Math.pow,!1),min:EU(Math.min,!0),max:EU(Math.max,!0),distance:eMe,dot:tMe,cross:nMe},y5={clamp:Mte(P.clamp,!0),mix:Mte(P.lerp,!0)};function KRe(e){return e-Math.floor(e)}function JRe(e){return Math.pow(2,e)}function ZRe(e){return P.log2(e)}function Es(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Ln.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Ln.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Ln.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function EU(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof H)return H.fromElements(e(i.x,r),e(i.y,r),Ln.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Ln.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Ln.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x),e(i.y,r.y),Ln.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Ln.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Ln.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function Mte(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Ln.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Ln.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Ln.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof H&&r instanceof H&&o instanceof H)return H.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Ln.getCartesian2());if(i instanceof m&&r instanceof m&&o instanceof m)return m.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Ln.getCartesian3());if(i instanceof oe&&r instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Ln.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function QRe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function $Re(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Ln.getCartesian2());if(t instanceof m)return m.normalize(t,Ln.getCartesian3());if(t instanceof oe)return oe.normalize(t,Ln.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function eMe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function tMe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function nMe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Ln.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,pMe(this)}function iMe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function rMe(e){return e.replace(YRe,qRe)}function g5(e){return e.replace(XRe,"\\")}function oMe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r=0&&o=0?new xt(yt.VARIABLE_IN_STRING,e.value):new xt(yt.LITERAL_STRING,g5(e.value))}function aMe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${r} is not a function.`);return i===0?r==="test"?new xt(yt.LITERAL_BOOLEAN,!1):new xt(yt.LITERAL_NULL,null):(s=Ci(e,c),a=Ci(e,n[0]),new xt(yt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ci(e,c),new xt(yt.FUNCTION_CALL,r,o);throw new de(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new xt(yt.LITERAL_COLOR,r);if(o=Ci(e,n[0]),l(n[1])){let c=Ci(e,n[1]);return new xt(yt.LITERAL_COLOR,r,[o,c])}return new xt(yt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new de(`${r} requires three arguments.`);return o=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2])],new xt(yt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new de(`${r} requires four arguments.`);return o=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2]),Ci(e,n[3])],new xt(yt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c1)throw new de(`${r} requires exactly one argument.`);return o=Ci(e,n[0]),new xt(yt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new de(`${r} does not take any argument.`);return new xt(yt.UNARY,r)}else if(l(wU[r])){if(i!==1)throw new de(`${r} requires exactly one argument.`);return o=Ci(e,n[0]),new xt(yt.UNARY,r,o)}else if(l(DU[r])){if(i!==2)throw new de(`${r} requires exactly two arguments.`);return s=Ci(e,n[0]),a=Ci(e,n[1]),new xt(yt.BINARY,r,s,a)}else if(l(y5[r])){if(i!==3)throw new de(`${r} requires exactly three arguments.`);s=Ci(e,n[0]),a=Ci(e,n[1]);let c=Ci(e,n[2]);return new xt(yt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new xt(yt.LITERAL_BOOLEAN,!1):(o=Ci(e,n[0]),new xt(yt.UNARY,r,o));if(r==="Number")return i===0?new xt(yt.LITERAL_NUMBER,0):(o=Ci(e,n[0]),new xt(yt.UNARY,r,o));if(r==="String")return i===0?new xt(yt.LITERAL_STRING,""):(o=Ci(e,n[0]),new xt(yt.UNARY,r,o));if(r==="regExp")return cMe(e,t)}}throw new de(`Unexpected function call "${r}".`)}function cMe(e,t){let n=t.arguments;if(n.length===0)return new xt(yt.LITERAL_REGEX,new RegExp);let i=Ci(e,n[0]),r;if(n.length>1){let o=Ci(e,n[1]);if(_5(i)&&_5(o)){try{r=new RegExp(g5(String(i._value)),o._value)}catch(s){throw new de(s)}return new xt(yt.LITERAL_REGEX,r)}return new xt(yt.REGEX,i,o)}if(_5(i)){try{r=new RegExp(g5(String(i._value)))}catch(o){throw new de(o)}return new xt(yt.LITERAL_REGEX,r)}return new xt(yt.REGEX,i)}function lMe(e){if(mMe(e.name)){let t=hMe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(yt.BUILTIN_VARIABLE,t):new xt(yt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(yt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(yt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(yt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function uMe(e){let t=e.property.name;if(t==="PI")return new xt(yt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(yt.LITERAL_NUMBER,Math.E)}function fMe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(yt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function dMe(e,t){if(t.object.name==="Math")return uMe(t);if(t.object.name==="Number")return fMe(t);let n,i=Ci(e,t.object);return t.computed?(n=Ci(e,t.property),new xt(yt.MEMBER,"brackets",i,n)):(n=new xt(yt.LITERAL_STRING,t.property.name),new xt(yt.MEMBER,"dot",i,n))}function _5(e){return e._type>=yt.LITERAL_NULL}function mMe(e){return e.substr(0,4)==="czm_"}function hMe(e){return e.substr(4)}function Ci(e,t){let n,i,r,o;if(t.type==="Literal")n=sMe(t);else if(t.type==="CallExpression")n=aMe(e,t);else if(t.type==="Identifier")n=lMe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ci(e,t.argument);if(jRe.indexOf(i)>-1)n=new xt(yt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Ci(e,t.left),o=Ci(e,t.right),Rte.indexOf(i)>-1)n=new xt(yt.BINARY,i,r,o);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Ci(e,t.left),o=Ci(e,t.right),Rte.indexOf(i)>-1&&(n=new xt(yt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ci(e,t.test);r=Ci(e,t.consequent),o=Ci(e,t.alternate),n=new xt(yt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=dMe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(DU[e._value])&&(e.evaluate=yMe(e._value)):e._type===yt.TERNARY?e.evaluate=AMe(e._value):e._type===yt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===yt.ARRAY?e.evaluate=e._evaluateArray:e._type===yt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===yt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===yt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===yt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===yt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===yt.REGEX?e.evaluate=e._evaluateRegExp:e._type===yt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=_Me):e.evaluate=e._evaluateLiteral}function _Me(e){return l(e)?e.content.tileset.timeSinceLoad:0}function gMe(e){let t=wU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function yMe(e){let t=DU[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function AMe(e){let t=y5[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function IU(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=vU,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Ln.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=Ln.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Ln.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Ln.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Ln.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=SU.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=IU(e,r);l(o)||(o=""),t=t.replace(i,o),n=SU.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return IU(e,this._value)};function _A(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(_A(this._left))return IU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(_A(this._left))return IU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Ln.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Ln.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Ln.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Ln.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Ln.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Ln.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Ln.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Ln.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Ln.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Ln.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Ln.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Ln.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Ln.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Ln.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Ln.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Ln.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Ln.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Ln.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Ln.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Ln.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Ln.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Ln.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Ln.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Ln.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new de(r)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof oe)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function Bte(e){let t=e._left,n=t.length;for(let a=0;a1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Lte(this),l(i)?bU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Lte(this),l(i)?bU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Bte(this),l(i)?bU(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Bte(this),l(i)?(i.alpha!==1&&(t.translucent=!0),bU(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case yt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p0;){let f=t.pop();if(z.equals(f.color,a.color))u=A5(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=A5(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function x5(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u0;){let d=t.pop();if(z.equals(d.color,o.color))u=x5(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=x5(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function PMe(e,t){return t.color.toRgba()-e.color.toRgba()}function OMe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s=A&&s{e.isDestroyed()||(e._error=h)}):void 0}}function qMe(e){l(e._primitive)||(e._primitive=new yA({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}eu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};eu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};eu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};eu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};eu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=YMe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};eu.prototype.isDestroyed=function(){return!1};eu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Tp=eu;function Ep(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),JMe(this,i,r)}Object.defineProperties(Ep.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function XMe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function KMe(e,t){let n,i,r,o,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(r=new Uint16Array(u),s=0;s0)for(o=new Uint16Array(f),s=0;s0&&(g=Ir(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let A=y(d.BOXES_LENGTH,0),x=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),E=A+x+C+T,S=new xp(e,E,g,h,XMe(e));if(e._batchTable=S,E===0)return;let w=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=m.unpack(d.RTC_CENTER),B.multiplyByPoint(w,D,D));let R=KMe(d,p);if(A>0||x>0||C>0||T>0){let O,L,N,_;if(A>0){let b=p.byteOffset+d.BOXES.byteOffset;O=new Float32Array(p.buffer,b,Tp.packedBoxLength*A)}if(x>0){let b=p.byteOffset+d.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,b,Tp.packedCylinderLength*x)}if(C>0){let b=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,b,Tp.packedEllipsoidLength*C)}if(T>0){let b=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,b,Tp.packedSphereLength*T)}return e._geometries=new Tp({boxes:O,boxBatchIds:R.boxes,cylinders:L,cylinderBatchIds:R.cylinders,ellipsoids:N,ellipsoidBatchIds:R.ellipsoids,spheres:_,sphereBatchIds:R.spheres,center:D,modelMatrix:w,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function zte(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Ep.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Ep.prototype.getFeature=function(e){return zte(this),this._features[e]};Ep.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Ep.prototype.applyStyle=function(e){zte(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Ep.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var GP=Ep;var C5={};C5.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),Hte(i,r,o,s);return c};C5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s>>0,T5=2*xA+1,Ag=4,jte=[],Yte=[],$Me=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],xg=1,PT=2,PU=[xg,0,0,xg|PT];function Vo(e){if(!Wt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Vo.getLevel(e)}Vo.fromToken=function(e){return new Vo(Vo.getIdFromToken(e))};Vo.isValidId=function(e){return!(e<=0||e>>BigInt(T5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Vo.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Vo.isValidId(Vo.getIdFromToken(e)):!1};Vo.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Vo.getTokenFromId=function(e){let t=Math.floor(lBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Vo.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return xA-(t>>1)};Vo.prototype.getChild=function(e){let t=Kte(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Vo(n)};Vo.prototype.getParent=function(){let e=Kte(this._cellId)<>1&1;return Xte(i[0],r[0][o^n&1],r[1][o])}function nBe(e,t){let n=qte(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function qte(e){jte.length===0&&sBe();let t=Number(e>>BigInt(T5)),n=t&xg,i=(1<=0;s--){let c=(1<<2*(s===7?xA-7*Ag:Ag))-1;n+=Number(e>>BigInt(s*2*Ag+1)&BigInt(c))<<2,n=Yte[n];let u=s*Ag;r+=n>>Ag+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Gte(e){return 1/QMe*e}function rBe(e,t){let n=[[],[]],i=oBe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=OU(Wte(o)),n[r][1]=OU(Wte(s))}return n}function oBe(e){return 1<>>0}function Wte(e){return 1/ZMe*e}function Cg(e,t,n,i,r,o){if(e===Ag){let s=(t<>1),n+(s[0]&1),i,r,o^PU[0]),Cg(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^PU[1]),Cg(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^PU[2]),Cg(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^PU[3])}}function sBe(){Cg(0,0,0,0,0,0),Cg(0,0,0,xg,0,xg),Cg(0,0,0,PT,0,PT),Cg(0,0,0,xg|PT,0,xg|PT)}function Kte(e){return e&~e+BigInt(1)}function aBe(e){return BigInt(1)<>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(E5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});E5.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var OT=E5;function Sp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(Sp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Sp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Sp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Sp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Sp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Sp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Sp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Sp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var RT=Sp;var RU={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};RU.getBranchingFactor=function(e){switch(e){case RU.OCTREE:return 8;case RU.QUADTREE:return 4}};var zo=Object.freeze(RU);function Qs(){}Object.defineProperties(Qs.prototype,{class:{get:function(){fe.throwInstantiationError()}}});Qs.prototype.hasProperty=function(e){fe.throwInstantiationError()};Qs.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};Qs.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};Qs.prototype.getProperty=function(e){fe.throwInstantiationError()};Qs.prototype.setProperty=function(e,t){fe.throwInstantiationError()};Qs.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};Qs.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};Qs.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};Qs.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Qs.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};Qs.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};Qs.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;l(o)&&(r=o[e]);let s=!0;return l(r)&&(t=r.packVectorAndMatrixTypes(t,s),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};Qs.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Qs.getProperty(r.id,t,n)};Qs.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Qs.setProperty(o.id,t,n,i):!1};var Un=Qs;function vp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(vp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});vp.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};vp.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};vp.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};vp.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};vp.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};vp.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};vp.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var WP=vp;var Pt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Pt.getMinimum=function(e){switch(e){case Pt.INT8:return-128;case Pt.UINT8:return 0;case Pt.INT16:return-32768;case Pt.UINT16:return 0;case Pt.INT32:return-2147483648;case Pt.UINT32:return 0;case Pt.INT64:return Wt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Pt.UINT64:return Wt.supportsBigInt()?BigInt(0):0;case Pt.FLOAT32:return-34028234663852886e22;case Pt.FLOAT64:return-Number.MAX_VALUE}};Pt.getMaximum=function(e){switch(e){case Pt.INT8:return 127;case Pt.UINT8:return 255;case Pt.INT16:return 32767;case Pt.UINT16:return 65535;case Pt.INT32:return 2147483647;case Pt.UINT32:return 4294967295;case Pt.INT64:return Wt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Pt.UINT64:return Wt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Pt.FLOAT32:return 34028234663852886e22;case Pt.FLOAT64:return Number.MAX_VALUE}};Pt.isIntegerType=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.INT64:case Pt.UINT64:return!0;default:return!1}};Pt.isUnsignedIntegerType=function(e){switch(e){case Pt.UINT8:case Pt.UINT16:case Pt.UINT32:case Pt.UINT64:return!0;default:return!1}};Pt.isVectorCompatible=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.FLOAT32:case Pt.FLOAT64:return!0;default:return!1}};Pt.normalize=function(e,t){return Math.max(Number(e)/Number(Pt.getMaximum(t)),-1)};Pt.unnormalize=function(e,t){let n=Pt.getMaximum(t),i=Pt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Pt.INT64||t===Pt.UINT64)&&Wt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};Ca.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!$te(e,t))return e};function $te(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ca.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Yt.getMathType(this._type),i=this._isArray,r=Yt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ca.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?hBe(this,e):ene(this,e)};function hBe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;ir?Jte(e,t,n):void 0}if(eon.getMaximum(t))return Jte(e,t,n)}function Qte(e,t){return`value ${e} of type ${t} must be finite`}function b5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function SBe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function wBe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h0&&h<=256),o(h%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,A,p,g,h)},encodeIndexBuffer:function(p,g,h){o(h==2||h==4),o(g%3==0);var A=f(p,h),x=n.exports.meshopt_encodeIndexBufferBound(g,u(A)+1);return c(n.exports.meshopt_encodeIndexBuffer,x,A,g,4)},encodeIndexSequence:function(p,g,h){o(h==2||h==4);var A=f(p,h),x=n.exports.meshopt_encodeIndexSequenceBound(g,u(A)+1);return c(n.exports.meshopt_encodeIndexSequence,x,A,g,4)},encodeGltfBuffer:function(p,g,h,A){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](p,g,h)},encodeFilterOct:function(p,g,h,A){return o(h==4||h==8),o(A>=1&&A<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,A,16)},encodeFilterQuat:function(p,g,h,A){return o(h==8),o(A>=4&&A<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,A,16)},encodeFilterExp:function(p,g,h,A){return o(h>0&&h%4==0),o(A>=1&&A<=24),d(n.exports.meshopt_encodeFilterExp,p,g,h,A,h)}}}();var one=function(){"use strict";var e="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+p8yQDBK/3SEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAQAE9PMEAdAEAQ9rAQAdFAE6eGKCSFGOCL4CIFCD4HXDNDNDNDNAOC9wgGMtMBCBHpCEHSAWCJDFHZALHhINARAh9rAX6MIDNARAhAXFGL9rCk6MBCZHOINAWCJ/CBFAOGIFGOC9wFHoDNDNDNDNDNAhAIC9wFGaCO4FrBBAaCI4COg4CIgpLBEDIBKAo9CB83IBAoCWF9CB83IBXIKAoALrBLALrBBGaCO4GcAcCIsGce86BBAOCgFALCLFAcFGorBBAaCL4CIgGcAcCIsGce86BBAOCvFAoAcFGorBBAaCD4CIgGcAcCIsGce86BBAOC7FAoAcFGorBBAaCIgGaAaCIsGae86BBAOCTFAoAaFGarBBALrBEGoCO4GcAcCIsGce86BBAOC91FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC4FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC93FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC94FAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOC95FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC96FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC97FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC98FAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOC99FAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOC9+FAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCUFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAoALrBWALrBBGaCL4GcAcCSsGce86BBAOCgFALCWFAcFGorBBAaCSgGaAaCSsGae86BBAOCvFAoAaFGorBBALrBEGaCL4GcAcCSsGce86BBAOC7FAoAcFGorBBAaCSgGaAaCSsGae86BBAOCTFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOC91FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC4FAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOC93FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC94FAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOC95FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC96FAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOC97FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC98FAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOC99FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC9+FAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCUFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAoAL8pBB83BBAoCWFALCWF8pBB83BBALCZFHLKDNAIAM9PMBAICZFHOARAL9rCl0MEKKAIAM6MIALtMIDNAKtMBAWApFrBBHoCBHOAZHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKKAZCEFHZApCEFGpAD6HSALHhApAD9HMEXVKKCBHLASCEgMDXIKALAXAD2FHcDNAKtMBCBHhCEHSAWCJDFHMINARAL9rAX6MIALtMDALAXFHLAWAhFrBBHoCBHOAMHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKAMCEFHMAhCEFGhAD6HSAhAD9HMBKAcHLXIKCBHOCEHSINARAL9rAX6MDALtMEALAXFHLAOCEFGOAD6HSADAO9HMBKAcHLXDKCBHLASCEgtMEKC9+HOXIKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aAKAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK/YZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBB/+9CAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI86BBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD86BBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjB/+fsAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI87EBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD87EBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK9MBDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCE91CJJJ/8IFCJJJ98g++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",t="B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBRl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBWL79iv9rBdQ/T9TQLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK/H8jLhUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHWCBHdINAdAE9PMEAWAEAd9rAdAWFAE6eGQCSFGOC9wgGKCI2HXAKCETHMAOCL4CIFCD4HpABAdAD2FHSCBHZDNINCEHhALHoCBHaDNINARAo9rAp6MIAVCJ/CBFAaAK2FHcAoApFHLCBHIDNAKC/AB6MBARAL9rC/gB6MBCBHOINAcAOFHIDNDNDNDNDNAoAOCO4FrBBGxCIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLBXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLBALCZFHLKDNDNDNDNDNAxCD4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLZXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLZALCZFHLKDNDNDNDNDNAxCL4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLAXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLAALCZFHLKDNDNDNDNDNAxCO4pLBEDIBKAIPXBBBBBBBBBBBBBBBBPKL8wXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCLFAyPqBFAxC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCWFAyPqBFAxC+Q+YJJBFrBBFHLXEKAIALPBBBPKL8wALCZFHLKAOC/ABFHIAOCJEFAK0MEAIHOARAL9rC/fB0MBKKDNDNAIAK9PMBAICI4HOINARAL9rCk6MDAcAIFHxDNDNDNDNDNAoAICO4FrBBAOCOg4CIgpLBEDIBKAxPXBBBBBBBBBBBBBBBBPKLBXIKAxALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAxALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAxALPBBBPKLBALCZFHLKAOCDFHOAICZFGIAK6MBKKALtMBAaCI6HhALHoAaCEFGOHaAOCLsMDXEKKCBHLAhCEgMDKDNAKtMBAVCJDFAZFHIAVAZFPBDBHyCBHxINAIAVCJ/CBFAxFGOPBLBGlCEP9tAlPXEEEEEEEEEEEEEEEEGqP9OP9hP9RGlAOAKFPBLBG8aCEP9tA8aAqP9OP9hP9RG8aPMBZEhDoIaLcVxOqRlGeAOAMFPBLBG3CEP9tA3AqP9OP9hP9RG3AOAXFPBLBG5CEP9tA5AqP9OP9hP9RG5PMBZEhDoIaLcVxOqRlG8ePMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIAyP9uGyP9aDBBAIADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAeA8ePMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWkdyQ8aKeX3M5p8eS8fGlA3A5PMWkdyQ8aKeX3M5p8eS8fG8aPMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFHIAxCZFGxAK6MBKKAZCLFGZAD6MBKASAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBAQAdFHdC9+HOALMEXIKKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK/UZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+epLIUO97EUE978jJJJJBCA9rHIDNDNADCL9HMBDNAEC98gGLtMBCBHVABHDINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKLBKALAIAD/8QBBSKDNAEC98gGXtMBCBHVABHDINADCZFGLALPBBBGOPXBBBBBBffBBBBBBffGKP9OADPBBBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKBBADAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKBBADCAFHDAVCLFGVAX6MBKKAXAE9PMBAIAECIgGVCITGDFCBCAAD9r/8KBAIABAXCITFGLAD/8QBBDNAVtMBAIAIPBLZGOPXBBBBBBffBBBBBBffGKP9OAIPBLBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKLZAIAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKLBKALAIAD/8QBBKK/4WLLUE97EUV978jJJJJBC8w9rHIDNAEC98gGLtMBCBHVABHOINAIAOPBBBGRAOCZFGWPBBBGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLBAOPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLBPeB+t+J83IBAOCWFARP5EAIPBLBPeE+t+J83IBAWAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLBPeD+t+J83IBAOCkFAKP5EAIPBLBPeI+t+J83IBAOCAFHOAVCLFGVAL6MBKKDNALAE9PMBAIAECIgGVCITGOFCBCAAO9r/8KBAIABALCITFGWAO/8QBBDNAVtMBAIAIPBLBGRAIPBLZGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLAAIPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLAPeB+t+J83IBAIARP5EAIPBLAPeE+t+J83IWAIAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLAPeD+t+J83IZAIAKP5EAIPBLAPeI+t+J83IkKAWAIAO/8QBBKK+pDDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=e;WebAssembly.validate(n)&&(r=t);var o,s=WebAssembly.instantiate(a(r),{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function a(d){for(var p=new Uint8Array(d.length),g=0;g96?h-71:h>64?h-65:h>47?h+4:h>46?63:62}for(var A=0,g=0;g96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h=3),o(A%3==0);for(var T=0,E=0;E<(C?C.length:0);++E)T|=d[C[E]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),w=u(n.exports.meshopt_simplify,S,p.length,g,g.length,h*4,A,x,T);return w[0]=p instanceof Uint32Array?w[0]:new p.constructor(w[0]),w},getScale:function(p,g){return o(p instanceof Float32Array),o(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length,g*4)}}}();function TA(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,h,A;if(ti(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,A=y(C.filter,"NONE")}let x=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=A,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=x,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(TA.prototype=Object.create(nr.prototype),TA.prototype.constructor=TA);Object.defineProperties(TA.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function UBe(e){try{let t=VBe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);one.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=wt.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}TA.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=UBe(this),this._promise)};function VBe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}TA.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var MT=TA;function Ka(){}Ka._maxDecodingConcurrency=Math.max(Wt.hardwareConcurrency-1,1);Ka._decoderTaskProcessor=void 0;Ka._taskProcessorReady=!1;Ka._getDecoderTaskProcessor=function(){if(!l(Ka._decoderTaskProcessor)){let e=new pi("decodeDraco",Ka._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Ka._taskProcessorReady=!0}),Ka._decoderTaskProcessor=e}return Ka._decoderTaskProcessor};Ka.decodePointCloud=function(e){let t=Ka._getDecoderTaskProcessor();if(Ka._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ka.decodeBufferView=function(e){let t=Ka._getDecoderTaskProcessor();if(Ka._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Dp=Ka;function bg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=wt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(bg.prototype=Object.create(nr.prototype),bg.prototype.constructor=bg);Object.defineProperties(bg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function kBe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=wt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;sne(e,n)}}bg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=kBe(this),this._promise)};function sne(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function zBe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=wt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}bg.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.PROCESSING||(l(this._dracoError)&&sne(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,r=t.bufferView,o=i[r],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:o,compressedAttributes:s,dequantizeInShader:!0},c=Dp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=zBe(this,c)};bg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var BT=bg;function HBe(e){let t=e.uint8Array,n=e.format,i=e.request,r=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new ve({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var EA=HBe;function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ip.prototype=Object.create(nr.prototype),Ip.prototype.constructor=Ip);Object.defineProperties(Ip.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Ip.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=GBe(this),this._promise):(this._promise=WBe(this),this._promise)};function ane(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function GBe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await YBe(i);if(e.isDestroyed())return;let o=ane(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(n){return e.isDestroyed()?void 0:cne(e,n,"Failed to load embedded image")}}async function WBe(e){e._state=wt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await XBe(i);if(e.isDestroyed())return;let o=ane(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(r){return e.isDestroyed()?void 0:cne(e,r,`Failed to load image: ${n}`)}}function cne(e,t,n){return e.unload(),e._state=wt.FAILED,Promise.reject(e.getError(n,t))}function jBe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function YBe(e){let t=jBe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return il(n)}return Ip._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var qBe=/(^data:image\/ktx2)|(\.ktx2$)/i;function XBe(e){let t=e.getUrlComponent(!1,!0);return qBe.test(t)?il(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Ip.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Ip._loadImageFromTypedArray=EA;var LT=Ip;var KBe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ta=Object.freeze(KBe);function Sg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Sg.prototype=Object.create(nr.prototype),Sg.prototype.constructor=Sg);Object.defineProperties(Sg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var JBe=new w5;Sg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=ZBe(this),this._promise):(this._promise=QBe(this),this._promise)};async function ZBe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=wt.LOADED,e)}catch(n){if(e.isDestroyed())return;v5(e,n)}}async function QBe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=wt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=$Be(e,a),e._state=wt.PROCESSING,e}catch(s){if(e.isDestroyed())return;v5(e,s)}}function $Be(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=Ue.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,$("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function v5(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function w5(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}w5.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};w5.prototype.execute=function(){this.buffer=lne(this.typedArray,this.indexDatatype,this.context)};function lne(e,t,n){let i=mt.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Sg.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(r){v5(this,r)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let r=JBe;if(r.set(t,n,e.context),!e.jobScheduler.execute(r,Ta.BUFFER))return!1;i=r.buffer}else this._loadBuffer&&(i=lne(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=wt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Sg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var NT=Sg;function eLe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var os=eLe;function tLe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var _o=tLe;function qt(){}qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return X.getSizeInBytes(t.componentType)*tu(t.type)}var hl=iLe;function rLe(e){Oe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=os(e.materials,r)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=y(i.normalized,!1),l(r)){let o=e.bufferViews[r];o.byteStride=hl(e,i),o.target=te.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),r.transparent=y(r.transparent,!1),r.doubleSided=y(r.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let o=i.KHR_techniques_webgl;l(o)&&Oe.materialValue(n,function(c){l(c.index)&&bA(c)}),bA(n.emissiveTexture),bA(n.normalTexture),bA(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),bA(s.baseColorTexture),bA(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),bA(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=oLe(e);return Oe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Oe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function oLe(e){let t={};return Oe.animation(e,function(n){Oe.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function bA(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var qP=rLe;function sLe(e){return Oe.shader(e,function(t){BU(t)}),Oe.buffer(e,function(t){BU(t)}),Oe.image(e,function(t){BU(t)}),BU(e),e}function BU(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var vg=sLe;function aLe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var XP=aLe;function cLe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),XP(e,t),n.length===0&&delete e.extensionsUsed}}var SA=cLe;var lLe=4;function uLe(e){if(yd(e)!=="glTF")throw new de("File is not valid binary glTF");let n=une(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?fLe(e,n):dLe(e,n)}function une(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return SA(c,"KHR_binary_glTF"),c}function dLe(e,t){let n=t[2],i=12,r,o;for(;i0){let a=s[0];a.extras._pipeline.source=o}}return r}var KP=uLe;function mLe(e){return Oe.shader(e,function(t){LU(t)}),Oe.buffer(e,function(t){LU(t)}),Oe.image(e,function(t){LU(t)}),LU(e),e}function LU(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var JP=mLe;function hLe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),os(n,t,!0)}var nf=hLe;function pLe(e){switch(e){case X.BYTE:return function(t,n,i,r,o){for(let s=0;s-1:!1}var ALe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function xLe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(ALe.indexOf(e[n])===-1)return t;return e}function CLe(e){let t={},n={},i=e.techniques;return l(i)&&(Oe.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(fne(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:y(c.blendEquationSeparate,gLe),blendFactors:xLe(c.blendFuncSeparate,yLe)})}fne(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),nf(e,"KHR_blend")),Oe.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Oe.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var ZP=CLe;function TLe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),os(n,t,!0),nf(e,t)}var QP=TLe;function ELe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=os(o.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=os(o.shaders,h,!0),u.program=os(o.programs,p),r[a.program]=u.program}i[c]=os(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,nf(e,"KHR_techniques_webgl"),QP(e,"KHR_techniques_webgl"))}return Oe.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Oe.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var $P=ELe;function bLe(e,t){el.typeOf.object("material",e),el.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,o=t(r.index,r);if(l(o))return o}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,o=t(r.index,r);if(l(o))return o}}if(l(e.extensions)){let r=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let s=r.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(r.specularGlossinessTexture)){let s=r.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let o=e.extensions.KHR_materials_common;if(l(o)&&l(o.values)){let s=o.values.diffuse,a=o.values.ambient,c=o.values.emission,u=o.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Oe.materialValue(e,function(r){if(l(r.index)){let o=t(r.index,r);if(l(o))return o}});if(l(i))return i;if(l(e.emissiveTexture)){let r=e.emissiveTexture,o=t(r.index,r);if(l(o))return o}if(l(e.normalTexture)){let r=e.normalTexture,o=t(r.index,r);if(l(o))return o}if(l(e.occlusionTexture)){let r=e.occlusionTexture,o=t(r.index,r);if(l(o))return o}}var FT=bLe;var dne=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function SLe(e,t){return t=y(t,dne),dne.forEach(function(n){t.indexOf(n)>-1&&wLe(e,n)}),e}var vLe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function wLe(e,t){let n=vLe[t],i=e[n];if(l(i)){let r=0,o=Hm[t](e),s=i.length;for(let a=0;at&&r.attributes[a]--}),Oe.meshPrimitiveTarget(r,function(s){Oe.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let o=r.indices;l(o)&&o>t&&r.indices--})}),Oe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};zm.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};zm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),_o(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),_o(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(_o(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;st&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};zm.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};zm.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};zm.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Oe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};zm.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};zm.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};zm.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){FT(i,function(r,o){o.index>t&&--o.index})}),_o(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;dt&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(_o(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;ut&&--f.texture.index}}}})}),_o(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;st&&--f.index}}}}};function Hm(){}Hm.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Oe.meshPrimitiveTarget(i,function(o){Oe.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Oe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),_o(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),t};Hm.buffer=function(e){let t={};return Oe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Hm.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),_o(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),_o(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(_o(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o0&&(t[n.mesh]=!0)}}),t};function mne(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!mne(e,r,n)}).length===0}Hm.node=function(e){let t={};return Oe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){mne(e,i,t)||(t[i]=!0)}),t};Hm.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Hm.texture=function(e){let t={};if(Oe.material(e,function(n){FT(n,function(i){t[i]=!0})}),_o(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=JLe[a];l(f)?(u=f+c,t[o]=u):l(KLe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function QLe(e){Oe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function I5(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:hl(e,t)}function $Le(e){Oe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=I5(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(y(i.byteLength,0),o)}})}function eNe(e){let t,n,i,r=e.bufferViews,o={};Oe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Oe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Oe.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),_ne(n)&&gne(e,i))}}),delete e.nodes[t]}function nNe(e){return Oe.node(e,function(t,n){_ne(t)&&gne(e,n)}),e}function iNe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=vA(e,i);i.min=r.min,i.max=r.max}})})}function rNe(e){Oe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=vA(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function oNe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",pne(e),VLe(e),nNe(e),kLe(e),zLe(e),GLe(e),jLe(e),$Le(e),eNe(e),tNe(e),iNe(e),rNe(e),YLe(e),qLe(e),XLe(e),ZLe(e),i1(e),QLe(e),ZP(e),$P(e),HLe(e)}var sNe=["u_tex","u_diffuse","u_emission"],aNe=["u_diffuse"];function P5(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function UU(e){return l(e.index)}function VU(e){return Array.isArray(e)&&e.length===4}function yne(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function cNe(e){Oe.material(e,function(t){Oe.materialValue(t,function(n,i){sNe.indexOf(i)!==-1&&UU(n)?(P5(t),t.pbrMetallicRoughness.baseColorTexture=n):aNe.indexOf(i)!==-1&&VU(n)&&(P5(t),t.pbrMetallicRoughness.baseColorFactor=yne(n))})}),wA(e,"KHR_techniques_webgl"),wA(e,"KHR_blend")}function lNe(e){Oe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(nf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let r=l(n.values)?n.values:{},o=r.ambient,s=r.diffuse,a=r.emission,c=r.transparency,u=n.doubleSided,f=n.transparent;P5(t),l(o)&&(VU(o)?t.emissiveFactor=o.slice(0,3):UU(o)&&(t.emissiveTexture=o)),l(s)&&(VU(s)?t.pbrMetallicRoughness.baseColorFactor=yne(s):UU(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(VU(a)?t.emissiveFactor=a.slice(0,3):UU(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),wA(e,"KHR_materials_common")}var r1=MLe;var li={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function uNe(e){switch(e){case li.POSITION:return"positionMC";case li.NORMAL:return"normalMC";case li.TANGENT:return"tangentMC";case li.TEXCOORD:return"texCoord";case li.COLOR:return"color";case li.JOINTS:return"joints";case li.WEIGHTS:return"weights";case li.FEATURE_ID:return"featureId"}}li.hasSetIndex=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return!1;case li.TEXCOORD:case li.COLOR:case li.JOINTS:case li.WEIGHTS:case li.FEATURE_ID:return!0}};li.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return li.POSITION;case"NORMAL":return li.NORMAL;case"TANGENT":return li.TANGENT;case"TEXCOORD":return li.TEXCOORD;case"COLOR":return li.COLOR;case"JOINTS":return li.JOINTS;case"WEIGHTS":return li.WEIGHTS;case"_FEATURE_ID":return li.FEATURE_ID}};li.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return li.POSITION;case"RGBA":case"RGB":case"RGB565":return li.COLOR;case"NORMAL":case"NORMAL_OCT16P":return li.NORMAL;case"BATCH_ID":return li.FEATURE_ID}};li.getGlslType=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return"vec3";case li.TEXCOORD:return"vec2";case li.COLOR:return"vec4";case li.JOINTS:return"ivec4";case li.WEIGHTS:return"vec4";case li.FEATURE_ID:return"int"}};li.getVariableName=function(e,t){let n=uNe(e);return l(t)&&(n+=`_${t}`),n};var bt=Object.freeze(li);function Ja(){}Ja.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let r=new de(i);return l(n)&&(r.stack=`Original stack: -${n.stack} -Handler stack: -${r.stack}`),r};Ja.getNodeTransform=function(e){return l(e.matrix)?e.matrix:B.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:m.ONE)};Ja.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o>t};$s.fromSubtreeJson=async function(e,t,n,i,r){let o=new $s(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=eFe(n);let a=s.json;o._subtreeJson=a;let c;if(ti(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let E=0;E0;f=f||d;for(let p=0;p>BigInt(61)),u=c%2===0?IT.encode2D(i,r,o):IT.encode2D(i,o,r),f=bp.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:bp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var EFe=new m,bFe=new m,U5=new m,SFe=new Z;function Nne(e,t,n,i,r){if(t===0)return e;let o=m.unpack(e,0,bFe),s=Z.unpack(e,3,SFe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,EFe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=m.fromElements(c,u,f,U5);p=Z.multiplyByVector(s,p,U5),p=m.add(p,o,U5);let g=Z.clone(s);g=Z.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),Z.pack(g,h,3),h}var vFe=new ce;function Fne(e,t,n,i,r){if(t===0)return e.slice();let o=ce.unpack(e,0,vFe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=P.negativePiToPi(o.west+n*u),d=P.negativePiToPi(f+u),p=c*o.height,g=P.negativePiToPi(o.south+i*p),h=P.negativePiToPi(g+p),A=s,x=a;if(l(r)){let C=c*(a-s);A+=r*C,x=A+C}return[f,g,d,h,A,x]}function wFe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=Bne(i,r,n,!1,t),s=Mne(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Une(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Une(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}gl.prototype.hasProperty=function(e,t){return!1};gl.prototype.getFeature=function(e){};gl.prototype.applyDebugSettings=function(e,t){};gl.prototype.applyStyle=function(e){};gl.prototype.update=function(e,t){};gl.prototype.isDestroyed=function(){return!1};gl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};gl._deriveBoundingBox=Nne;gl._deriveBoundingRegion=Fne;gl._deriveBoundingVolumeS2=Lne;var HT=gl;var DFe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},yl=Object.freeze(DFe);function GT(e,t){this._distance=t,this._normal=new Vne(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(GT.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});GT.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new GT(e.normal,e.distance),t};GT.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new GT(e.normal,e.distance)};function Vne(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Vne.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var RA=GT;function Za(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Wne:jne,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r0&&(o=tn.OUTSIDE);for(let s=0;s=o;)C=r[C-o];r.push(C),s[A]=x}x>t2e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>n2e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),A===c?(c=x,t[a]=x):A===u?(u=x,t[a+1]=x):(f=x,t[a+2]=x),A=Zne(i,c,u,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Zne(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=G5(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,h=G5(e,n,d,p,g);if(h===0)return n;let A=s?1:0,x=0,C=o?1:0,T=G5(e,i,A,x,C);if(T===0)return i;let E=f&h&T,S,w,D;if(E&1<<0)S=0,w=1,D=2;else if(E&1<<1)S=0,D=1,w=2;else if(E&1<<2)w=0,S=1,D=2;else if(E&1<<3)w=0,D=1,S=2;else if(E&1<<4)D=0,S=1,w=2;else if(E&1<<5)D=0,w=1,S=2;else{let N=W5(f),_=W5(h),b=W5(T);return N<_&&N>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}YU.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a1;)i>>=1,o.push(Qne(i));let s=new Bt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:at.LUMINANCE,sampler:new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR_MIPMAP_LINEAR,magnificationFilter:xi.LINEAR})});return t.outlineTexture=s,s};function Qne(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function $ne(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=Pr.FAILED;let r=this._processError;this._processError=void 0,XU(this,r)}let t=this._textureErrors.pop();if(l(t)){let r=this.getError("Failed to load glTF texture",t);throw r.name="TextureError",r}if(this._state===Pr.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(r){this._state=Pr.FAILED,XU(this,r)}let i=!1;try{i=this._processTextures(e)}catch(r){this._textureState=Pr.FAILED,XU(this,r)}return this._incrementallyLoadTextures?n:n&&i};function N2e(e,t,n,i,r,o,s,a){let u=t.accessors[n].bufferView;return Bi.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:s})}function F2e(e,t,n,i,r,o,s){return Bi.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function U2e(e,t,n){let i=Bi.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function rie(e,t,n){let i=t.byteOffset,r=hl(e,t),o=t.count,s=tu(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=Pp(t.componentType);i=n.byteOffset+i;for(let A=0;A{l(r)&&l(r.attributes)&&l(r.attributes[f])?J2e(A,x,o,s):Z2e(t,c,A,x,o,s)},A}function aie(e,t,n,i,r,o,s,a){let c=i.modelSemantic,u=c===bt.POSITION,f=c===bt.FEATURE_ID,d=u&&!o&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,A=g||d||p,T=sie(e,t,n,i,r,s?!1:h,s?!0:A,a),E=new NA.AttributeLoadPlan(T);return E.loadBuffer=h,E.loadTypedArray=A,E}function Q2e(e,t,n,i,r,o){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=j5(e,Ho,r),u=c.modelSemantic,f=u===Ho.TRANSLATION||u===Ho.ROTATION||u===Ho.SCALE,d=u===Ho.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!o.scene3DOnly;return sie(e,t,n,c,void 0,g,p||d&&(!a||h),o)}function $2e(e,t,n,i,r,o,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new d2e;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&r,h=!f,A=f||d||p,T=F2e(e,t,n,i,o?!1:h,o?!0:A,s),E=e._geometryLoaders.length;e._geometryLoaders.push(T);let S=T.load();e._loaderPromises.push(S),e._geometryCallbacks[E]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let w=new NA.IndicesLoadPlan(u);return w.loadBuffer=h,w.loadTypedArray=A,w}function Rp(e,t,n,i,r,o){let s=pl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=Bi.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:r,asynchronous:e._asynchronous}),c=pl.createModelTextureReader({textureInfo:n}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Pr.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{c.texture=a.texture,l(o)&&(c.texture.sampler=o)},c}function e3e(e,t,n,i,r){let o=new P2e,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(o.unlit=l(s.KHR_materials_unlit),l(a)){let u=new I2e;o.specularGlossiness=u,l(a.diffuseTexture)&&(u.diffuseTexture=Rp(e,t,a.diffuseTexture,i,r)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(u.specularGlossinessTexture=Rp(e,t,a.specularGlossinessTexture,i,r)),u.diffuseFactor=rf(oe,a.diffuseFactor),u.specularFactor=rf(m,a.specularFactor),u.glossinessFactor=a.glossinessFactor,o.pbrSpecularGlossiness=a}else if(l(c)){let u=new D2e;l(c.baseColorTexture)&&(u.baseColorTexture=Rp(e,t,c.baseColorTexture,i,r)),l(c.metallicRoughnessTexture)&&(u.metallicRoughnessTexture=Rp(e,t,c.metallicRoughnessTexture,i,r)),u.baseColorFactor=rf(oe,c.baseColorFactor),u.metallicFactor=c.metallicFactor,u.roughnessFactor=c.roughnessFactor,o.metallicRoughness=u}return l(n.emissiveTexture)&&(o.emissiveTexture=Rp(e,t,n.emissiveTexture,i,r)),l(n.normalTexture)&&!e._loadForClassification&&(o.normalTexture=Rp(e,t,n.normalTexture,i,r)),l(n.occlusionTexture)&&(o.occlusionTexture=Rp(e,t,n.occlusionTexture,i,r)),o.emissiveFactor=rf(m,n.emissiveFactor),o.alphaMode=n.alphaMode,o.alphaCutoff=n.alphaCutoff,o.doubleSided=n.doubleSided,o}function cie(e,t){let n=new tie;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function lie(e,t,n,i){let r=new tie,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=oie(o.attribute),r.positionalLabel=i,r}function uie(e,t){let n=new iie;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function fie(e,t,n,i){let r=new iie,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=y(o.constant,0);let s=y(o.divisor,0);return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function t3e(e,t,n,i,r,o){let s=new nie;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=o;let a=n.texture;s.textureReader=Rp(e,t,a,i,r,dn.NEAREST);let u=(l(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=u,s}function n3e(e,t,n,i,r,o,s,a){let c=new nie,u=n.featureIds,f=u.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Rp(e,t,f,r,o,dn.NEAREST),c.textureReader.channels=u.channels,c.positionalLabel=a,c}function i3e(e,t,n,i,r,o){let s=new m2e,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=j5(e,bt,u),p=aie(e,t,f,d,a,c,i,o);s.attributes.push(p.attribute),r.attributePlans.push(p)}return s}function r3e(e,t,n,i,r,o){let s=new h2e,a=new NA(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=e3e(e,t,t.materials[c],r,o));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=o3e(e,t,d,a));let p=e._loadForClassification,g=u.KHR_draco_mesh_compression,h=!1,A=n.attributes;if(l(A)){for(let R in A)if(A.hasOwnProperty(R)){let O=A[R],L=j5(e,bt,R),N=L.modelSemantic;if(p&&!K2e(N))continue;N===bt.FEATURE_ID&&(h=!0);let _=aie(e,t,O,L,g,i,f,o);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let x=n.targets;if(l(x)&&!p){let R=x.length;for(let O=0;O=s.clientWidth)u=!0;else{if(E.x>s.clientWidth*.5){a.width=E.x,c.frustum.right=p.x-C,tc=b1(o,n,c,tc),ba.clipToGLWindowCoordinates(a,tc,q5),a.x+=E.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,tc=b1(o,n,c,tc),ba.clipToGLWindowCoordinates(a,tc,X5)}else{a.x+=E.x,a.width-=E.x,c.frustum.left=-p.x-C,tc=b1(o,n,c,tc),ba.clipToGLWindowCoordinates(a,tc,q5),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,tc=b1(o,n,c,tc),ba.clipToGLWindowCoordinates(a,tc,X5)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(q5,i),(i.x<0||i.x>s.clientWidth)&&(i.x=X5.x)}}if(r.mode!==ne.SCENE2D||u){if(tc=b1(o,n,c,tc),tc.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof To))return;i=ba.clipToGLWindowCoordinates(a,tc,i)}return i.y=s.clientHeight-i.y,i};ba.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=ba.wgs84ToWindowCoordinates(e,t,n),!!l(n))return ba.transformWindowToDrawingBuffer(e,n,n)};var Bp=new m,G3e=new he;ba.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,G3e);if(!l(o))return;if(r.project(o,Bp),i===ne.COLUMBUS_VIEW)return m.fromElements(Bp.z,Bp.x,Bp.y,n);if(i===ne.SCENE2D)return m.fromElements(0,Bp.x,Bp.y,n);let s=e.morphTime;return m.fromElements(P.lerp(Bp.z,t.x,s),P.lerp(Bp.x,t.y,s),P.lerp(Bp.y,t.z,s),n)};var gie=new m,yie=new m,Aie=new B;ba.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,gie),B.computeViewportTransformation(e,0,1,Aie),B.multiplyByPoint(Aie,gie,yie),H.fromCartesian3(yie,n)};ba.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*r,t.y*o,n)};var W3e=new oe,xie=new oe;ba.drawingBufferToWgs84Coordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,W3e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=B.multiplyByVector(o.inverseViewProjection,f,xie);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=xie,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=B.multiplyByVector(o.inverseView,d,d)}return m.fromCartesian4(d,i)};var Xi=ba;var j3e={LEFT:-1,NONE:0,RIGHT:1},Fc=Object.freeze(j3e);var YT={};YT._deprecationWarning=$;var Lp=Uint32Array.BYTES_PER_ELEMENT;YT.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Lp;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Lp;let s=r.getUint32(t,!0);t+=Lp;let a=r.getUint32(t,!0);t+=Lp;let c=r.getUint32(t,!0);t+=Lp;let u=r.getUint32(t,!0);t+=Lp;let f=r.getUint32(t,!0);t+=Lp;let d;u>=570425344?(t-=Lp*2,d=a,u=c,f=0,a=0,c=0,YT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Lp,d=u,u=a,f=c,a=0,c=0,YT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Ir(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,A;u>0&&(h=Ir(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(YT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var S1=YT;function v1(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Cie(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function Y3e(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=X.createTypedArray(n,i),r[t]=o),o}v1.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),Cie(this,e,t,n,1,i.byteOffset)):i};v1.prototype.hasProperty=function(e){return l(this.json[e])};v1.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),Cie(this,e,t,n,this.featuresLength,i.byteOffset)):Y3e(this,e,t,i)};v1.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(h=Ir(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(ZU._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var P1=ZU;var Fp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},QU=Nt.Attribute,mUe=Nt.FeatureIdAttribute,wie=Nt.Instances;function Up(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,cr.Y),u=y(e.forwardAxis,cr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=Fp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Up.prototype=Object.create(nr.prototype),Up.prototype.constructor=Up);Object.defineProperties(Up.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Up.prototype.load=function(){if(l(this._promise))return this._promise;let e=P1.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,s=new wd(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=B.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(o===0){let d=fl(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Wm(u);return this._gltfLoader=f,this._state=Fp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Fp.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw hUe(this,d)}),this._promise};function hUe(e,t){e.unload(),e._state=Fp.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}Up.prototype.process=function(e){if(this._state===Fp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Fp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=B.multiplyTransformation(this._transform,i.transform,i.transform),gUe(this,i,e),pUe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Fp.READY,!0};function pUe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Np({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Nc({name:Td.BATCH_TABLE_CLASS_NAME,count:i});r=new Ea({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var $U=new m,Z5=new Array(4),_Ue=new B;function gUe(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=AUe(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),h=m.unpackArray(f),A=new m,x=new m,C=new m,T=new m,E=new Z,S=new Le,w=new Array(4),D=new m,R=new Array(3),O=new B;if(!l(s)){let V=ae.fromPoints(h);for(i=0;i0&&(V.instances=k?yUe(L):L,k=!0)}}function yUe(e){let t=new wie;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r=n[r]&&e=0&&!(e>=n[r]&&en&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};qT.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var ir=qT;function XT(e){this._value=e,this._valueType=ir.getPointType(e)}Object.defineProperties(XT.prototype,{value:{get:function(){return this._value}}});XT.prototype.findTimeInterval=function(e){};XT.prototype.wrapTime=function(e){return 0};XT.prototype.clampTime=function(e){return 0};XT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var R1=XT;function KT(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=ir.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(KT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});KT.prototype.findTimeInterval=ir.prototype.findTimeInterval;KT.prototype.wrapTime=ir.prototype.wrapTime;KT.prototype.clampTime=ir.prototype.clampTime;KT.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new m),m.lerp(n[r],n[r+1],o,t))};var Ng=KT;var Die={};Die.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=m.subtract(o[a],m.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var JT=Die;var Iie=[],Pie=[],Oie=[],Rie=[];function bUe(e,t,n){let i=Iie,r=Oie,o=Pie,s=Rie;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===yl.REPEAT)g=g-Math.floor(g);else if(a.loop===yl.MIRRORED_REPEAT){let C=Math.floor(g),T=g-C;g=C%2===1?1-T:T}a.reverse&&(g=1-g);let x=g*u*a.multiplier;x=P.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,A||(a._state=Dd.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&eV.push(a))}}n=eV.length;for(let s=0;s 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); -void main() -{ - // Initialize the attributes struct with all - // attributes except quantized ones. - ProcessedAttributes attributes; - initializeAttributes(attributes); + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - // Dequantize the quantized ones and add them to the - // attributes struct. - #ifdef USE_DEQUANTIZATION - dequantizationStage(attributes); - #endif +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates - #ifdef HAS_MORPH_TARGETS - morphTargetsStage(attributes); - #endif + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR - #ifdef HAS_SKINNING - skinningStage(attributes); - #endif +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(); - #endif + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. - // Compute the bitangent according to the formula in the glTF spec. - // Normal and tangents can be affected by morphing and skinning, so - // the bitangent should not be computed until their values are finalized. - #ifdef HAS_BITANGENTS - attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); - #endif + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - FeatureIds featureIds; - featureIdStage(featureIds, attributes); + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; - #ifdef HAS_SELECTED_FEATURE_ID - SelectedFeature feature; - selectedFeatureIdStage(feature, featureIds); - // Handle any show properties that come from the style. - cpuStylingStage(attributes.positionMC, feature); - #endif + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - // The scene mode 2D pipeline stage and instancing stage add a different - // model view matrix to accurately project the model to 2D. However, the - // output positions and normals should be transformed by the 3D matrices - // to keep the data the same for the fragment shader. - mat4 modelView = czm_modelView3D; - mat3 normal = czm_normal3D; - #else - // These are used for individual model projection because they will - // automatically change based on the scene mode. - mat4 modelView = czm_modelView; - mat3 normal = czm_normal; - #endif + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - // Update the position for this instance in place - #ifdef HAS_INSTANCING + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - // The legacy instance stage is used when rendering i3dm models that - // encode instances transforms in world space, as opposed to glTF models - // that use EXT_mesh_gpu_instancing, where instance transforms are encoded - // in object space. - #ifdef USE_LEGACY_INSTANCING - mat4 instanceModelView; - mat3 instanceModelViewInverseTranspose; - - legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; - modelView = instanceModelView; - normal = instanceModelViewInverseTranspose; - #else - instancingStage(attributes); - #endif + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif - #ifdef USE_PICKING - v_pickColor = a_pickColor; - #endif + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - #endif + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var iD=`in vec3 position3DHigh; +in vec3 position3DLow; - #ifdef HAS_CUSTOM_VERTEX_SHADER - czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); - customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif - // Compute the final position in each coordinate system needed. - // This returns the value that will be assigned to gl_Position. - vec4 positionClip = geometryStage(attributes, modelView, normal); +in float batchId; - #ifdef HAS_SILHOUETTE - silhouetteStage(attributes, positionClip); - #endif +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - float show = pointCloudShowStylingStage(attributes, metadata); - #else - float show = 1.0; - #endif +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif - #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING - show *= pointCloudBackFaceCullingStage(); - #endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); - #endif +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); - gl_PointSize *= show; - #endif + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - gl_Position = show * positionClip; -} -`;function i6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Hn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Hn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],UUe(this)}function LUe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},depthMask:!1}}var NUe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},FUe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Nie=[];function UUe(e){let t=e._command,n=Nie;if(e._useDebugWireframe){t.pass=Se.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=G1(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;as||r<-s&&o>-s}function eE(e,t){if(!l(t))return;let n=kp.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function YUe(e){eE(e,e._originalCommand),eE(e,e._translucentCommand),eE(e,e._skipLodBackfaceCommand),eE(e,e._skipLodStencilCommand),eE(e,e._silhouetteModelCommand),eE(e,e._silhouetteColorCommand)}function qUe(e){let t=nt.shallowClone(e);t.pass=Se.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=mn.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function XUe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(r),i}function KUe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(e.renderState,!0);r.cull.enabled=!1,(e.pass===Se.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Se.TRANSLUCENT,r.depthMask=!1,r.blending=mn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function JUe(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=ZUe(r);if(o!==s){let a=QUe(o),c=Ye(r.renderState,!0);c.stencilTest.reference=a,r.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function ZUe(e){return(e.renderState.stencilTest.reference&Ft.SKIP_LOD_MASK)>>>Ft.SKIP_LOD_BIT_SHIFT}function QUe(e){return Ft.CESIUM_3D_TILE_MASK|e< 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; - #ifdef SPECULAR_IBL - vec3 r0 = specularColor.rgb; - float reflectance = max(max(r0.r, r0.g), r0.b); - vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(r0, r90, VdotH); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - #ifdef CUSTOM_SPECULAR_IBL - vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); - #else - vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); - #endif - specularIBL *= F * brdfLut.x + brdfLut.y; - #else - vec3 specularIBL = vec3(0.0); - #endif + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - return diffuseColor * diffuseIrradiance + specularColor * specularIBL; -} + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; #endif -vec3 imageBasedLightingStage( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) { - #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) - // Environment maps were provided, use them for IBL - return textureIBL( - positionEC, - normalEC, - lightDirectionEC, - pbrParameters - ); - #else - // Use the procedural IBL if there are no environment maps - return proceduralIBL( - positionEC, - normalEC, - lightDirectionEC, - lightColorHdr, - pbrParameters - ); - #endif -}`;var Vie={name:"ImageBasedLightingPipelineStage"};Vie.process=function(e,t,n){let i=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,be.FRAGMENT),r.addUniform("vec2","model_iblFactor",be.FRAGMENT),_d.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",be.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,be.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",be.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,be.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",be.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",be.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",be.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT)),l(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,be.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",be.FRAGMENT)),r.addFragmentLines(X1);let o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=gt(o,e.uniformMap)};var K1=Vie;var iVe=P.EPSILON16;function o6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(o6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,iVe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var rVe=new m,r6=new Z;o6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=rVe,r;switch(t){case $a.XROTATE:r=Z.fromRotationX(P.toRadians(n),r6),e=B.multiplyByMatrix3(e,r,e);break;case $a.YROTATE:r=Z.fromRotationY(P.toRadians(n),r6),e=B.multiplyByMatrix3(e,r,e);break;case $a.ZROTATE:r=Z.fromRotationZ(P.toRadians(n),r6),e=B.multiplyByMatrix3(e,r,e);break;case $a.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case $a.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case $a.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=B.multiplyByTranslation(e,i,e);break;case $a.XSCALE:i.x=n,i.y=1,i.z=1,e=B.multiplyByScale(e,i,e);break;case $a.YSCALE:i.x=1,i.y=n,i.z=1,e=B.multiplyByScale(e,i,e);break;case $a.ZSCALE:i.x=1,i.y=1,i.z=n,e=B.multiplyByScale(e,i,e);break;case $a.UNIFORMSCALE:e=B.multiplyByUniformScale(e,n,e);break;default:break}return e};var J1=o6;function nV(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,oVe(this)}Object.defineProperties(nV.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function oVe(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } -} -`;var kie={name:"ModelClippingPlanesPipelineStage"},cVe=new H;kie.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,be.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,be.FRAGMENT),ss.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,be.FRAGMENT);let s=ss.getTextureResolution(i,r,cVe);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,be.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",be.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",be.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",be.FRAGMENT),o.addFragmentLines($1);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=gt(a,e.uniformMap)};var eO=kie;function zie(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(zie.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var tO=zie;var nO=`mat4 getInstancingTransform() -{ - mat4 instancingTransform; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif - - return instancingTransform; -} +out vec4 v_color; -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() +void main() { - mat4 instancingTransform2D; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; - return instancingTransform2D; + v_color = color; } -#endif -`;var iO=`void instancingStage(inout ProcessedAttributes attributes) +`;var Kl=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) { - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; + culledByNearPlane = false; + clipped = false; - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var rO=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var iV=new B,lVe=new B,uVe=new B,Gie={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Xie,_transformsToTypedArray:a6};Gie.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(nO);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];SVe(e,n,i,f,u),DVe(e,n,i,f);let d={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",be.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",be.VERTEX),d.u_instance_modifiedModelView=function(){let p=B.multiplyTransformation(s.modelMatrix,a.components.transform,iV);return u?B.multiplyTransformation(n.context.uniformState.view3D,p,iV):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,iV)),B.multiplyTransformation(n.context.uniformState.view,p,iV))},d.u_instance_nodeTransform=function(){return B.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,lVe)},o.addVertexLines(rO)):o.addVertexLines(iO),u){o.addDefine("USE_2D_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_modelView2D",be.VERTEX);let p=n.context,g=B.fromTranslation(c.instancingReferencePoint2D,new B);d.u_modelView2D=function(){return B.multiplyTransformation(p.uniformState.view,g,uVe)}}e.uniformMap=gt(d,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,f)};var oO=new B,fVe=new m;function dVe(e,t,n,i,r){let o=B.multiplyTransformation(t,e,oO);return o=B.multiplyTransformation(o,n,oO),r=Mt.basisTo2D(i.mapProjection,o,r),r}function mVe(e,t,n,i,r){let o=B.fromTranslation(e,oO),s=B.multiplyTransformation(t,o,oO);s=B.multiplyTransformation(s,n,oO);let a=B.getTranslation(s,fVe);return r=Xi.computeActualWgs84Position(i,a,r),r}function Wie(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=B.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=B.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=B.clone(r.computedModelMatrix,t),t=B.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=B.clone(B.IDENTITY,n))}var jie=new B,Yie=new B,hVe=new B,pVe=new m;function _Ve(e,t,n,i){let r=jie,o=Yie;Wie(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:cn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var sO=Gie;var l6={};l6.name="ModelMatrixUpdateStage";l6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;Kie(e,t,r,e.transformToRoot),e._transformDirty=!1}};function Kie(e,t,n,i){let r;i=B.multiplyTransformation(i,e.transform,new B),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=gt(r,e.uniformMap)};var fO=ere;var tre={name:"ClassificationPipelineStage"};tre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,be.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||PVe(t,r)};function PVe(e,t){let n=$t.getAttributeBySemantic(e,bt.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=$t.getAttributeBySemantic(e,bt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let A=1;A 0.0 && abs(denominator) < czm_epsilon7) { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - positionMC *= float(model_silhouettePass); - #else - positionMC *= 0.0; - #endif + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) + else if (endPoint0Distance > 0.0) { - positionMC *= 0.0; - } -} + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ - float show = ceil(feature.color.a); - positionMC *= show; + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; - #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) - filterByPassType(positionMC, feature.color); - #endif -} -`;var hO=`void filterByPassType(vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - if(!model_silhouettePass) { - discard; + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; } - #else - discard; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - discard; } + + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) { - vec4 featureColor = feature.color; - if (featureColor.a == 0.0) - { - discard; + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. - // So, we only apply in in the fragment shader if the feature ID texture is used. - #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) - filterByPassType(featureColor); - #endif + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif - featureColor = czm_gammaCorrect(featureColor); + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - // Classification models compute the diffuse differently. - #ifdef HAS_CLASSIFICATION - material.diffuse = featureColor.rgb * featureColor.a; - #else - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); - #endif - - material.alpha *= featureColor.a; -} -`;var nre={name:"CPUStylingPipelineStage"};nre.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(mO),r.addFragmentLines(hO),r.addDefine("USE_CPU_STYLING",void 0,be.BOTH),l(i.color)||(r.addUniform("float",Vg.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),e.uniformMap[Vg.COLOR_BLEND_UNIFORM_NAME]=function(){return Qa.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",be.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Se.TRANSLUCENT}};var pO=nre;var ire={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};ire.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var zp=Object.freeze(ire);var _O=`void customShaderStage( - inout czm_modelVertexOutput vsOutput, - inout ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // VertexInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - VertexInput vsInput; - initializeInputStruct(vsInput, attributes); - vsInput.featureIds = featureIds; - vsInput.metadata = metadata; - vsInput.metadataClass = metadataClass; - vsInput.metadataStatistics = metadataStatistics; - vertexMain(vsInput, vsOutput); - attributes.positionMC = vsOutput.positionMC; -} -`;var gO=`void customShaderStage( - inout czm_modelMaterial material, - ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // FragmentInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - FragmentInput fsInput; - initializeInputStruct(fsInput, attributes); - fsInput.featureIds = featureIds; - fsInput.metadata = metadata; - fsInput.metadataClass = metadataClass; - fsInput.metadataStatistics = metadataStatistics; - fragmentMain(fsInput, material); -} -`;var yO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var AO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Li={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Li.process=function(e,t,n){let i=e.shaderBuilder;OVe(i);let r=e.runtimeNode.node.instances;l(r)&&RVe(e,r,n),MVe(e,t,n),i.addVertexLines(AO),i.addFragmentLines(yO)};function OVe(e){e.addStruct(Li.STRUCT_ID_FEATURE_IDS_VS,Li.STRUCT_NAME_FEATURE_IDS,be.VERTEX),e.addStruct(Li.STRUCT_ID_FEATURE_IDS_FS,Li.STRUCT_NAME_FEATURE_IDS,be.FRAGMENT),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.VERTEX),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.FRAGMENT),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.VERTEX),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.FRAGMENT),e.addFunction(Li.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Li.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,be.VERTEX)}function RVe(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;okVe(i,t,n)):[]}function kVe(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=$t,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;fHVe(n,t)):[]}function HVe(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(o.length);for(let a=0;af),n.addStructField(Ti.STRUCT_ID_METADATA_FS,o,r);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),A=lre({valueExpression:h,renderResources:e,glslType:o,metadataVariable:r,shaderDestination:be.FRAGMENT,property:s}),x=`metadata.${r} = ${A};`;n.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,[x])}function sre(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=cre(Ti.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Ti.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,s),be.includesVertexShader(o)&&(e.addStructField(Ti.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function are(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===Yt.ENUM)return;let s=Ti.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=cre(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Ti.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,c),be.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ti.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function cre(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function lre(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}var of=Ti;var ZVe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},zg=Object.freeze(ZVe);var Qo={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Rt};Qo.process=function(e,t,n){let i=e.model.customShader;if(i&&Qo.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let r=Hh.getCache(e.model._marsOptions.customShaders);for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&Qo.process_original(e,t,n,r[o])}};Qo.process_original=function(e,t,n,i){let r=e.shaderBuilder;l(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let o=e.alphaOptions;i.translucencyMode===zg.TRANSLUCENT?o.pass=Se.TRANSLUCENT:i.translucencyMode===zg.OPAQUE&&(o.pass=void 0);let s=oke(i,t);if(!s.customShaderEnabled)return;if(lke(r,i,s),s.shouldComputePositionWC&&r.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,be.BOTH),l(i.vertexShaderText)&&r.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,be.VERTEX),l(i.fragmentShaderText)){r.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,be.FRAGMENT);let u=zp.getDefineName(i.mode);r.addDefine(u,void 0,be.FRAGMENT)}let a=i.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];r.addUniform(f.type,u)}let c=i.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];r.addVarying(f,u)}e.uniformMap=gt(e.uniformMap,i.uniformMap)};function QVe(e){let t={};for(let n=0;n1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,_ke(e,d,h,p,s,a)}Ske(i,t.attributes),t.primitiveType===Be.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(vO),i.addFragmentLines(SO)};function _ke(e,t,n,i,r,o){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),c=r&&!o;i>1?Ake(e,t,n,i):yke(e,t,n,c),Cke(s,a,c),xke(s,a),l(t.semantic)&&gke(s,t),Tke(s,a,r),Eke(s,a,c),bke(s,a)}function gke(e,t){let n=t.semantic,i=t.setIndex;switch(n){case bt.NORMAL:e.addDefine("HAS_NORMALS");break;case bt.TANGENT:e.addDefine("HAS_TANGENTS");break;case bt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case bt.TEXCOORD:case bt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function yke(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===bt.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===bt.POSITION,f=u?0:n,d=cn.getNumberOfComponents(o),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function Ake(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.normalized,u=cn.getNumberOfComponents(o)/i,f=X.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Bee(!1),this._renderState3DTiles=Bee(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(cp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});cp.initializeTerrainHeights=function(){return oi.initialize()};function CDe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(iD);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(nD);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(eD),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ge({defines:u,sources:[s]}),h=new Ge({defines:p,sources:[d,c]});e._sp=Zt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new Ge({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let C=new Ge({defines:u.concat([`MAX_TERRAIN_HEIGHT ${oi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(tD);let T=new Ge({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=b}function Bee(e){return Ve.fromCache({cull:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})}function TDe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof kr?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};cp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};cp.isSupported=function(e){return e.frameState.context.depthTexture};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var ld=cp;var EDe=new H(1,1),SDe=!1,vDe=z.WHITE;function AT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(AT.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});AT.prototype.getType=function(e){return"Image"};AT.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,EDe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,vDe,t.color),q.getValueOrDefault(this._transparent,e,SDe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};AT.prototype.equals=function(e){return this===e||e instanceof AT&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var mg=AT;function wDe(e){if(e instanceof z)return new Ut(e);if(typeof e=="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new mg;return t.image=e,t}}function IDe(e,t){return le(e,t,wDe)}var Po=IDe;function sD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Po("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});sD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new sD(this)};sD.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Q0=sD;var DDe={FIXED:0,INERTIAL:1},oo=Object.freeze(DDe);function ET(){fe.throwInstantiationError()}Object.defineProperties(ET.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});ET.prototype.getValue=fe.throwInstantiationError;ET.prototype.getValueInReferenceFrame=fe.throwInstantiationError;ET.prototype.equals=fe.throwInstantiationError;var i5=new Z;ET.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Mt.computeIcrfToFixedMatrix(e,i5);if(l(r)||(r=Mt.computeTemeToPseudoFixedMatrix(e,i5)),n===oo.INERTIAL)return Z.multiplyByVector(r,t,o);if(n===oo.FIXED)return Z.multiplyByVector(Z.transpose(r,i5),t,o)};var lp=ET;function ex(e,t){this._definitionChanged=new pe,this._value=m.clone(e),this._referenceFrame=y(t,oo.FIXED)}Object.defineProperties(ex.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===oo.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});ex.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};ex.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};ex.prototype.getValueInReferenceFrame=function(e,t,n){return lp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};ex.prototype.equals=function(e){return this===e||e instanceof ex&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var wc=ex;function aD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(aD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Po("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});aD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new aD(this)};aD.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var tx=aD;function PDe(e){return e}function ODe(e,t){return le(e,t,PDe)}var ll=ODe;function cD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(cD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Po("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});cD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new cD(this)};cD.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var nx=cD;function lD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(lD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Po("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});lD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new lD(this)};lD.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var ix=lD;function uD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(uD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Po("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});uD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new uD(this)};uD.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ox=uD;function fD(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(fD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});fD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new fD(this)};fD.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var ud=fD;var RDe=new m(1,1,1),MDe=m.ZERO,LDe=Be.IDENTITY;function Uee(e,t,n){this.translation=m.clone(y(e,MDe)),this.rotation=Be.clone(y(t,LDe)),this.scale=m.clone(y(n,RDe))}Uee.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Be.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var hg=Uee;var o5=new hg;function dD(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(dD.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});dD.prototype.getValue=function(e,t){return l(t)||(t=new hg),t.translation=q.getValueOrClonedDefault(this._translation,e,o5.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,o5.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,o5.scale,t.scale),t};dD.prototype.equals=function(e){return this===e||e instanceof dD&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var rx=dD;function up(e,t){this._propertyNames=[],this._definitionChanged=new pe,l(e)&&this.merge(e,t)}Object.defineProperties(up.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t (textureSize.y / textureSize.x)) + { + mipLevel = 1.0; + if (uv.y - pixel.y > yMipLevel1) + { + mipLevel = 2.0; + if (uv.y - pixel.y * 3.0 > yMipLevel2) + { + mipLevel = 3.0; + if (uv.y - pixel.y * 5.0 > yMipLevel3) + { + mipLevel = 4.0; + if (uv.y - pixel.y * 7.0 > yMipLevel4) + { + mipLevel = 5.0; + } + } + } + } + } - vec3 normal = ng; - #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) - vec2 normalTexCoords = TEXCOORD_NORMAL; - #ifdef HAS_NORMAL_TEXTURE_TRANSFORM - normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform); - #endif + if (mipLevel > 0.0) + { + float scale = pow(2.0, mipLevel); - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // If derivatives are available (not IE 10), compute tangents - vec3 positionEC = attributes.positionEC; - vec3 pos_dx = dFdx(positionEC); - vec3 pos_dy = dFdy(positionEC); - vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0)); - vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0)); - vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); - t = normalize(t - ng * dot(ng, t)); - vec3 b = normalize(cross(ng, t)); - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #endif - #endif + uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); + uv.x *= ((textureSize.x - 2.0) / textureSize.y); - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - normal = -normal; + uv.x -= 1.0 + pixel.x; + uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); + uv *= scale; + } + else + { + uv.x *= (textureSize.x / textureSize.y); } - #endif - return normal; + if(mipLevel == 0.0) + { + out_FragColor = texture(texture0, uv); + } + else if(mipLevel == 1.0) + { + out_FragColor = texture(texture1, uv); + } + else if(mipLevel == 2.0) + { + out_FragColor = texture(texture2, uv); + } + else if(mipLevel == 3.0) + { + out_FragColor = texture(texture3, uv); + } + else if(mipLevel == 4.0) + { + out_FragColor = texture(texture4, uv); + } + else if(mipLevel == 5.0) + { + out_FragColor = texture(texture5, uv); + } + else + { + out_FragColor = vec4(0.0); + } } -#endif +`;var vD=`in vec3 v_cubeMapCoordinates; +uniform samplerCube cubeMap; -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +void main() { - #ifdef HAS_NORMALS - material.normalEC = computeNormal(attributes); - #endif - - vec4 baseColorWithAlpha = vec4(1.0); - // Regardless of whether we use PBR, set a base color - #ifdef HAS_BASE_COLOR_TEXTURE - vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - - #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM - baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); - #endif - - baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); - - #ifdef HAS_BASE_COLOR_FACTOR - baseColorWithAlpha *= u_baseColorFactor; - #endif - #elif defined(HAS_BASE_COLOR_FACTOR) - baseColorWithAlpha = u_baseColorFactor; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - baseColorWithAlpha = v_pointCloudColor; - #elif defined(HAS_COLOR_0) - vec4 color = attributes.color_0; - // .pnts files store colors in the sRGB color space - #ifdef HAS_SRGB_COLOR - color = czm_srgbToLinear(color); - #endif - baseColorWithAlpha *= color; + vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); + #ifdef RGBA_NORMALIZED + out_FragColor = vec4(rgba.rgb, 1.0); + #else + float m = rgba.a * 16.0; + vec3 r = rgba.rgb * m; + out_FragColor = vec4(r * r, 1.0); #endif +} +`;var wD=`in vec4 position; +in vec3 cubeMapCoordinates; - material.diffuse = baseColorWithAlpha.rgb; - material.alpha = baseColorWithAlpha.a; +out vec3 v_cubeMapCoordinates; - #ifdef USE_CPU_STYLING - material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); - #endif +void main() +{ + gl_Position = position; + v_cubeMapCoordinates = cubeMapCoordinates; +} +`;function ux(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new pe}Object.defineProperties(ux.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});ux.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var iPe=new m(1,0,0),oPe=new m(0,0,1),rPe=new m(-1,0,0),sPe=new m(0,0,-1),Tk=new m(0,1,0),aPe=new m(0,-1,0),Qee=[Tk,rPe,oPe,aPe,iPe,Tk,sPe,Tk,Tk],ete=Qee.length,tte=new Float32Array(ete*3),Zee=0;for(let e=0;e0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function fPe(e,t){if(hd.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new hd(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}ID.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(fPe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};ID.prototype.isDestroyed=function(){return!1};ID.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var fx=ID;var u5=Io(Wl(),1);var Ak,nte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYmE2YWEzOS1lZDUyLTQ0YWMtOTlkNS0wN2VhZWI3NTc4MmEiLCJpZCI6MjU5LCJpYXQiOjE2ODU2MzQ0Njl9.AswCMxsN03WYwuZL-r183OZicN64Ks9aPExWhA3fuLY",Ek={};Ek.defaultAccessToken=nte;Ek.defaultServer=new Se({url:"https://api.cesium.com/"});Ek.getDefaultTokenCredit=function(e){if(e===nte){if(!l(Ak)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;Ak=new wt(t,!0),Ak._isDefaultToken=!0}return Ak}};var pd=Ek;function Pc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:dPe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Se.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new u5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Pc.prototype=Object.create(Se.prototype),Pc.prototype.constructor=Pc);Pc.fromAssetId=function(e,t){let n=Pc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Pc(i,n)})};Object.defineProperties(Pc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Pc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Pc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(wt.getIonCredit),i=pd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(wt.clone(i)),n};Pc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Pc(t._ionEndpoint,t._ionEndpointResource)),e=Se.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Pc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Se.prototype.fetchImage.call(this,e)};Pc.prototype._makeRequest=function(e){return this._isExternal||new u5.default(this.url).authority()!==this._ionEndpointDomain?Se.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Se.prototype._makeRequest.call(this,e))};Pc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,pd.defaultServer),i=y(t.accessToken,pd.defaultAccessToken);n=Se.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function dPe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Zs=Pc;function km(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(km.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});km.prototype.get=function(e){return this._array[e]};km.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};km.prototype.peek=function(){return this._array[this._length-1]};km.prototype.push=function(e){let t=this.length++;this._array[t]=e};km.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};km.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};km.prototype.resize=function(e){this.length=e};km.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Oc=km;function Sk(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}Sk.ALL=Object.freeze(new Sk({color:new z(0,0,0,0),depth:1,stencil:0}));Sk.prototype.execute=function(e,t){e.clear(this,t)};var ci=Sk;var _p={X:0,Y:1,Z:2};_p.Y_UP_TO_Z_UP=L.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));_p.Z_UP_TO_Y_UP=L.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));_p.X_UP_TO_Z_UP=L.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));_p.Z_UP_TO_X_UP=L.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));_p.X_UP_TO_Y_UP=L.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));_p.Y_UP_TO_X_UP=L.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));_p.fromName=function(e){return _p[e]};var uo=Object.freeze(_p);function $u(e){this.planes=y(e,[])}var DD=[new m,new m,new m];m.clone(m.UNIT_X,DD[0]);m.clone(m.UNIT_Y,DD[1]);m.clone(m.UNIT_Z,DD[2]);var pg=new m,mPe=new m,ite=new fn(new m(1,0,0),0);$u.fromBoundingSphere=function(e,t){l(t)||(t=new $u);let n=DD.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a>10)+55296,(r&1023)+56320))}return t};function PD(e,t,n){return t<=e&&e<=n}function gPe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c{this._resolveContent=o})}Object.defineProperties(gd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n0){let o=Math.min(t,Gt.maximumTextureSize),r=Math.ceil(t/Gt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new H(o,r),i=new re(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Ya.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Ya.DEFAULT_COLOR_VALUE=z.WHITE;Ya.DEFAULT_SHOW_VALUE=!0;function ste(e){let t=e._textureDimensions;return t.x*t.y*4}function ate(e){if(!l(e._batchValues)){let t=ste(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function cte(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Ya.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=cte(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=ate(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Ya.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=ste(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=s[t];for(let h=0;h0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${GPe(i)}${s}`}};function ute(e,t){return e=Ge.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function WPe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};fo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Ge.replaceMain(e,"tile_main"),Gt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function jPe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===ml.HIGHLIGHT)return 0;if(n===ml.REPLACE)return 1;if(n===ml.MIX)return P.clamp(i,P.EPSILON4,1)}fo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return _t(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return jPe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};fo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var yg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};fo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=qPe(this);for(let u=t;u>>Bt.SKIP_LOD_BIT_SHIFT}function eOe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=Bt.setCesium3DTileBit(),t.stencilMask=Bt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function tOe(e){let t=Ye(e,!0);return t.stencilTest=Bt.setCesium3DTileBit(),t.stencilMask=Bt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}fo.prototype.update=function(e,t){this._batchTexture.update(e,t)};fo.prototype.isDestroyed=function(){return!1};fo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var yp=fo;function nOe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Vm=nOe;var IT=`in vec3 position; +in float a_batchId; - #ifdef HAS_OCCLUSION_TEXTURE - vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; - #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM - occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); - #endif - material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; - #endif +uniform mat4 u_modifiedModelViewProjection; - #ifdef HAS_EMISSIVE_TEXTURE - vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; - #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM - emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); - #endif +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); +} +`;function Qu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Qu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Qu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Qu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Qu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Qu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Qu.prototype.getPropertyInherited=function(e){return Qu.getPropertyInherited(this._content,this._batchId,e)};Qu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Qu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Qu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Qu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var As=Qu;var h5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},p5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},je=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+je.version}static addUnaryOp(t){return je.max_unop_len=Math.max(t.length,je.max_unop_len),je.unary_ops[t]=1,je}static addBinaryOp(t,n,i){return je.max_binop_len=Math.max(t.length,je.max_binop_len),je.binary_ops[t]=n,i?je.right_associative.add(t):je.right_associative.delete(t),je}static addIdentifierChar(t){return je.additional_identifier_chars.add(t),je}static addLiteral(t,n){return je.literals[t]=n,je}static removeUnaryOp(t){return delete je.unary_ops[t],t.length===je.max_unop_len&&(je.max_unop_len=je.getMaxKeyLen(je.unary_ops)),je}static removeAllUnaryOps(){return je.unary_ops={},je.max_unop_len=0,je}static removeIdentifierChar(t){return je.additional_identifier_chars.delete(t),je}static removeBinaryOp(t){return delete je.binary_ops[t],t.length===je.max_binop_len&&(je.max_binop_len=je.getMaxKeyLen(je.binary_ops)),je.right_associative.delete(t),je}static removeAllBinaryOps(){return je.binary_ops={},je.max_binop_len=0,je}static removeLiteral(t){return delete je.literals[t],je}static removeAllLiterals(){return je.literals={},je}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new je(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return je.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!je.binary_ops[String.fromCharCode(t)]||je.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return je.isIdentifierStart(t)||je.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(je.hooks[t]){let i={context:this,node:n};return je.hooks.run(t,i),i.node}return n}searchHook(t){if(je.hooks[t]){let n={context:this};return je.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===je.SPACE_CODE||t===je.TAB_CODE||t===je.LF_CODE||t===je.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:je.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index0;){if(je.binary_ops.hasOwnProperty(t)&&(!je.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:je.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:je.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,je.isDecimalDigit(t)||t===je.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===je.SQUOTE_CODE||t===je.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===je.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,je.max_unop_len),i=n.length;i>0;){if(je.unary_ops.hasOwnProperty(n)&&(!je.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===je.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===je.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===je.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});je.max_unop_len=je.getMaxKeyLen(je.unary_ops);je.max_binop_len=je.getMaxKeyLen(je.binary_ops);var xg=e=>new je(e).parse(),oOe=Object.getOwnPropertyNames(je);oOe.forEach(e=>{xg[e]===void 0&&e!=="prototype"&&(xg[e]=je[e])});xg.Jsep=je;var rOe="ConditionalExpression",sOe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:rOe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};xg.plugins.register(sOe);var aOe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(aOe);function yd(e,t){this._expression=e,e=bOe(e,t),e=TOe(COe(e)),xg.addBinaryOp("=~",0),xg.addBinaryOp("!~",0);let n;try{n=xg(e)}catch(i){throw new de(i)}this._runtimeAst=Ti(this,n)}Object.defineProperties(yd.prototype,{expression:{get:function(){return this._expression}}});var Nn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new re],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new re),this.cartesian4Array[this.cartesian4Index++]}};yd.prototype.evaluate=function(e,t){Nn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof re?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof re?n.clone(t):n};yd.prototype.evaluateColor=function(e,t){Nn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};yd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +{ + return ${o}; +} +`,o};yd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};yd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var cOe=["!","-","+"],mte=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],Ik=/\${(.*?)}/g,lOe=/\\/g,uOe="@#%",fOe=/@#%/g,Dk=new z,Pk={abs:Es(Math.abs),sqrt:Es(Math.sqrt),cos:Es(Math.cos),sin:Es(Math.sin),tan:Es(Math.tan),acos:Es(Math.acos),asin:Es(Math.asin),atan:Es(Math.atan),radians:Es(P.toRadians),degrees:Es(P.toDegrees),sign:Es(P.sign),floor:Es(Math.floor),ceil:Es(Math.ceil),round:Es(Math.round),exp:Es(Math.exp),exp2:Es(mOe),log:Es(Math.log),log2:Es(hOe),fract:Es(dOe),length:pOe,normalize:_Oe},Ok={atan2:vk(Math.atan2,!1),pow:vk(Math.pow,!1),min:vk(Math.min,!0),max:vk(Math.max,!0),distance:gOe,dot:yOe,cross:xOe},y5={clamp:hte(P.clamp,!0),mix:hte(P.lerp,!0)};function dOe(e){return e-Math.floor(e)}function mOe(e){return Math.pow(2,e)}function hOe(e){return P.log2(e)}function Es(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Nn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Nn.getCartesian3());if(n instanceof re)return re.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Nn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function vk(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof H)return H.fromElements(e(i.x,o),e(i.y,o),Nn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Nn.getCartesian3());if(i instanceof re)return re.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Nn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x),e(i.y,o.y),Nn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Nn.getCartesian3());if(i instanceof re&&o instanceof re)return re.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Nn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function hte(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Nn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Nn.getCartesian3());if(i instanceof re&&o instanceof re)return re.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Nn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof H&&o instanceof H&&r instanceof H)return H.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Nn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Nn.getCartesian3());if(i instanceof re&&o instanceof re&&r instanceof re)return re.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Nn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function pOe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof re)return re.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function _Oe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Nn.getCartesian2());if(t instanceof m)return m.normalize(t,Nn.getCartesian3());if(t instanceof re)return re.normalize(t,Nn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function gOe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof re&&n instanceof re)return re.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function yOe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof re&&n instanceof re)return re.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function xOe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Nn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,ROe(this)}function bOe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function COe(e){return e.replace(lOe,uOe)}function g5(e){return e.replace(fOe,"\\")}function TOe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new xt(gt.VARIABLE_IN_STRING,e.value):new xt(gt.LITERAL_STRING,g5(e.value))}function EOe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${o} is not a function.`);return i===0?o==="test"?new xt(gt.LITERAL_BOOLEAN,!1):new xt(gt.LITERAL_NULL,null):(s=Ti(e,c),a=Ti(e,n[0]),new xt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ti(e,c),new xt(gt.FUNCTION_CALL,o,r);throw new de(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new xt(gt.LITERAL_COLOR,o);if(r=Ti(e,n[0]),l(n[1])){let c=Ti(e,n[1]);return new xt(gt.LITERAL_COLOR,o,[r,c])}return new xt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new de(`${o} requires three arguments.`);return r=[Ti(e,n[0]),Ti(e,n[1]),Ti(e,n[2])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new de(`${o} requires four arguments.`);return r=[Ti(e,n[0]),Ti(e,n[1]),Ti(e,n[2]),Ti(e,n[3])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new de(`${o} requires exactly one argument.`);return r=Ti(e,n[0]),new xt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new de(`${o} does not take any argument.`);return new xt(gt.UNARY,o)}else if(l(Pk[o])){if(i!==1)throw new de(`${o} requires exactly one argument.`);return r=Ti(e,n[0]),new xt(gt.UNARY,o,r)}else if(l(Ok[o])){if(i!==2)throw new de(`${o} requires exactly two arguments.`);return s=Ti(e,n[0]),a=Ti(e,n[1]),new xt(gt.BINARY,o,s,a)}else if(l(y5[o])){if(i!==3)throw new de(`${o} requires exactly three arguments.`);s=Ti(e,n[0]),a=Ti(e,n[1]);let c=Ti(e,n[2]);return new xt(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new xt(gt.LITERAL_BOOLEAN,!1):(r=Ti(e,n[0]),new xt(gt.UNARY,o,r));if(o==="Number")return i===0?new xt(gt.LITERAL_NUMBER,0):(r=Ti(e,n[0]),new xt(gt.UNARY,o,r));if(o==="String")return i===0?new xt(gt.LITERAL_STRING,""):(r=Ti(e,n[0]),new xt(gt.UNARY,o,r));if(o==="regExp")return SOe(e,t)}}throw new de(`Unexpected function call "${o}".`)}function SOe(e,t){let n=t.arguments;if(n.length===0)return new xt(gt.LITERAL_REGEX,new RegExp);let i=Ti(e,n[0]),o;if(n.length>1){let r=Ti(e,n[1]);if(_5(i)&&_5(r)){try{o=new RegExp(g5(String(i._value)),r._value)}catch(s){throw new de(s)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i,r)}if(_5(i)){try{o=new RegExp(g5(String(i._value)))}catch(r){throw new de(r)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i)}function vOe(e){if(POe(e.name)){let t=OOe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(gt.BUILTIN_VARIABLE,t):new xt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(gt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function wOe(e){let t=e.property.name;if(t==="PI")return new xt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(gt.LITERAL_NUMBER,Math.E)}function IOe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function DOe(e,t){if(t.object.name==="Math")return wOe(t);if(t.object.name==="Number")return IOe(t);let n,i=Ti(e,t.object);return t.computed?(n=Ti(e,t.property),new xt(gt.MEMBER,"brackets",i,n)):(n=new xt(gt.LITERAL_STRING,t.property.name),new xt(gt.MEMBER,"dot",i,n))}function _5(e){return e._type>=gt.LITERAL_NULL}function POe(e){return e.substr(0,4)==="czm_"}function OOe(e){return e.substr(4)}function Ti(e,t){let n,i,o,r;if(t.type==="Literal")n=AOe(t);else if(t.type==="CallExpression")n=EOe(e,t);else if(t.type==="Identifier")n=vOe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ti(e,t.argument);if(cOe.indexOf(i)>-1)n=new xt(gt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ti(e,t.left),r=Ti(e,t.right),mte.indexOf(i)>-1)n=new xt(gt.BINARY,i,o,r);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ti(e,t.left),r=Ti(e,t.right),mte.indexOf(i)>-1&&(n=new xt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ti(e,t.test);o=Ti(e,t.consequent),r=Ti(e,t.alternate),n=new xt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=DOe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(Ok[e._value])&&(e.evaluate=NOe(e._value)):e._type===gt.TERNARY?e.evaluate=FOe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=MOe):e.evaluate=e._evaluateLiteral}function MOe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function LOe(e){let t=Pk[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function NOe(e){let t=Ok[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function FOe(e){let t=y5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function Rk(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=Dk,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return re.fromColor(t,Nn.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=Nn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Nn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Nn.getCartesian3());if(n==="vec4")return re.fromArray(t,0,Nn.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=Ik.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=Rk(e,o);l(r)||(r=""),t=t.replace(i,r),n=Ik.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return Rk(e,this._value)};function hx(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(hx(this._left))return Rk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(hx(this._left))return Rk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Nn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Nn.getCartesian3());if(n instanceof re&&t instanceof re)return re.add(t,n,Nn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Nn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Nn.getCartesian3());if(n instanceof re&&t instanceof re)return re.subtract(t,n,Nn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Nn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Nn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Nn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Nn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Nn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Nn.getCartesian3());if(n instanceof re&&t instanceof re)return re.multiplyComponents(t,n,Nn.getCartesian4());if(n instanceof re&&typeof t=="number")return re.multiplyByScalar(n,t,Nn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.multiplyByScalar(t,n,Nn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Nn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Nn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Nn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Nn.getCartesian3());if(n instanceof re&&t instanceof re)return re.divideComponents(t,n,Nn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.divideByScalar(t,n,Nn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Nn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Nn.getCartesian3());if(n instanceof re&&t instanceof re)return re.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Nn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new de(o)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof re)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function pte(e){let t=e._left,n=t.length;for(let a=0;a1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=_te(this),l(i)?wk(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=_te(this),l(i)?wk(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=pte(this),l(i)?wk(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=pte(this),l(i)?(i.alpha!==1&&(t.translucent=!0),wk(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case gt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p0;){let f=t.pop();if(z.equals(f.color,a.color))u=x5(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=x5(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function b5(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u0;){let d=t.pop();if(z.equals(d.color,r.color))u=b5(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=b5(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function YOe(e,t){return t.color.toRgba()-e.color.toRgba()}function XOe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=x&&s{e.isDestroyed()||(e._error=h)}):void 0}}function uRe(e){l(e._primitive)||(e._primitive=new _x({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}$l.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};$l.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};$l.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};$l.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};$l.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=lRe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};$l.prototype.isDestroyed=function(){return!1};$l.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var bp=$l;function Cp(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r}),mRe(this,i,o)}Object.defineProperties(Cp.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function fRe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function dRe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(u),s=0;s0)for(r=new Uint16Array(f),s=0;s0&&(g=Oo(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let x=y(d.BOXES_LENGTH,0),b=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),A=x+b+C+T,S=new yp(e,A,g,h,fRe(e));if(e._batchTable=S,A===0)return;let v=e.tile.computedTransform,I;l(d.RTC_CENTER)&&(I=m.unpack(d.RTC_CENTER),L.multiplyByPoint(v,I,I));let O=dRe(d,p);if(x>0||b>0||C>0||T>0){let R,N,F,_;if(x>0){let E=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,E,bp.packedBoxLength*x)}if(b>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;N=new Float32Array(p.buffer,E,bp.packedCylinderLength*b)}if(C>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,E,bp.packedEllipsoidLength*C)}if(T>0){let E=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,E,bp.packedSphereLength*T)}return e._geometries=new bp({boxes:R,boxBatchIds:O.boxes,cylinders:N,cylinderBatchIds:O.cylinders,ellipsoids:F,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:I,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Tte(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Cp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Cp.prototype.getFeature=function(e){return Tte(this),this._features[e]};Cp.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Cp.prototype.applyStyle=function(e){Tte(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Cp.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var LD=Cp;var C5={};C5.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),Ate(i,o,r,s);return c};C5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,T5=2*yx+1,Cg=4,vte=[],wte=[],_Re=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Tg=1,PT=2,Mk=[Tg,0,0,Tg|PT];function Ur(e){if(!Wt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Ur.getLevel(e)}Ur.fromToken=function(e){return new Ur(Ur.getIdFromToken(e))};Ur.isValidId=function(e){return!(e<=0||e>>BigInt(T5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ur.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ur.isValidId(Ur.getIdFromToken(e)):!1};Ur.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ur.getTokenFromId=function(e){let t=Math.floor(vRe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ur.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return yx-(t>>1)};Ur.prototype.getChild=function(e){let t=Pte(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ur(n)};Ur.prototype.getParent=function(){let e=Pte(this._cellId)<>1&1;return Dte(i[0],o[0][r^n&1],o[1][r])}function xRe(e,t){let n=Ite(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function Ite(e){vte.length===0&&ARe();let t=Number(e>>BigInt(T5)),n=t&Tg,i=(1<=0;s--){let c=(1<<2*(s===7?yx-7*Cg:Cg))-1;n+=Number(e>>BigInt(s*2*Cg+1)&BigInt(c))<<2,n=wte[n];let u=s*Cg;o+=n>>Cg+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Ete(e){return 1/pRe*e}function CRe(e,t){let n=[[],[]],i=TRe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=Lk(Ste(r)),n[o][1]=Lk(Ste(s))}return n}function TRe(e){return 1<>>0}function Ste(e){return 1/hRe*e}function Ag(e,t,n,i,o,r){if(e===Cg){let s=(t<>1),n+(s[0]&1),i,o,r^Mk[0]),Ag(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^Mk[1]),Ag(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^Mk[2]),Ag(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^Mk[3])}}function ARe(){Ag(0,0,0,0,0,0),Ag(0,0,0,Tg,0,Tg),Ag(0,0,0,PT,0,PT),Ag(0,0,0,Tg|PT,0,Tg|PT)}function Pte(e){return e&~e+BigInt(1)}function ERe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(A5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});A5.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var OT=A5;function Ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Ap.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ap.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Ap.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Ap.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Ap.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Ap.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Ap.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Ap.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var RT=Ap;var Nk={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};Nk.getBranchingFactor=function(e){switch(e){case Nk.OCTREE:return 8;case Nk.QUADTREE:return 4}};var Vr=Object.freeze(Nk);function $s(){}Object.defineProperties($s.prototype,{class:{get:function(){fe.throwInstantiationError()}}});$s.prototype.hasProperty=function(e){fe.throwInstantiationError()};$s.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};$s.prototype.getProperty=function(e){fe.throwInstantiationError()};$s.prototype.setProperty=function(e,t){fe.throwInstantiationError()};$s.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};$s.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};$s.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};$s.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};$s.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};$s.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;l(r)&&(o=r[e]);let s=!0;return l(o)&&(t=o.packVectorAndMatrixTypes(t,s),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};$s.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return $s.getProperty(o.id,t,n)};$s.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?$s.setProperty(r.id,t,n,i):!1};var Un=$s;function Ep(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ep.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ep.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};Ep.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};Ep.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};Ep.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};Ep.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var ND=Ep;var Pt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Pt.getMinimum=function(e){switch(e){case Pt.INT8:return-128;case Pt.UINT8:return 0;case Pt.INT16:return-32768;case Pt.UINT16:return 0;case Pt.INT32:return-2147483648;case Pt.UINT32:return 0;case Pt.INT64:return Wt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Pt.UINT64:return Wt.supportsBigInt()?BigInt(0):0;case Pt.FLOAT32:return-34028234663852886e22;case Pt.FLOAT64:return-Number.MAX_VALUE}};Pt.getMaximum=function(e){switch(e){case Pt.INT8:return 127;case Pt.UINT8:return 255;case Pt.INT16:return 32767;case Pt.UINT16:return 65535;case Pt.INT32:return 2147483647;case Pt.UINT32:return 4294967295;case Pt.INT64:return Wt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Pt.UINT64:return Wt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Pt.FLOAT32:return 34028234663852886e22;case Pt.FLOAT64:return Number.MAX_VALUE}};Pt.isIntegerType=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.INT64:case Pt.UINT64:return!0;default:return!1}};Pt.isUnsignedIntegerType=function(e){switch(e){case Pt.UINT8:case Pt.UINT16:case Pt.UINT32:case Pt.UINT64:return!0;default:return!1}};Pt.isVectorCompatible=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.FLOAT32:case Pt.FLOAT64:return!0;default:return!1}};Pt.normalize=function(e,t){return Math.max(Number(e)/Number(Pt.getMaximum(t)),-1)};Pt.unnormalize=function(e,t){let n=Pt.getMaximum(t),i=Pt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Pt.INT64||t===Pt.UINT64)&&Wt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Ta.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Lte(e,t))return e};function Lte(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ta.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,o=qt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ta.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?ORe(this,e):Nte(this,e)};function ORe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;io?Ote(e,t,n):void 0}if(ern.getMaximum(t))return Ote(e,t,n)}function Mte(e,t){return`value ${e} of type ${t} must be finite`}function E5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function HRe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function WRe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h0&&h<=256),r(h%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,x,p,g,h)},encodeIndexBuffer:function(p,g,h){r(h==2||h==4),r(g%3==0);var x=f(p,h),b=n.exports.meshopt_encodeIndexBufferBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexBuffer,b,x,g,4)},encodeIndexSequence:function(p,g,h){r(h==2||h==4);var x=f(p,h),b=n.exports.meshopt_encodeIndexSequenceBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexSequence,b,x,g,4)},encodeGltfBuffer:function(p,g,h,x){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(b[x]),b[x](p,g,h)},encodeFilterOct:function(p,g,h,x){return r(h==4||h==8),r(x>=1&&x<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,x,16)},encodeFilterQuat:function(p,g,h,x){return r(h==8),r(x>=4&&x<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,x,16)},encodeFilterExp:function(p,g,h,x,b){r(h>0&&h%4==0),r(x>=1&&x<=24);var C={Separate:0,SharedVector:1,SharedComponent:2};return d(n.exports.meshopt_encodeFilterExp,p,g,h,x,h,b?C[b]:1)}}}();var Vte=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?t:e,r,s=WebAssembly.instantiate(a(o),{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var T=new Uint8Array(C.length),A=0;A96?S-97:S>64?S-39:S+4}for(var v=0,A=0;A0?x(C,T,A,f[S],u[v]):s.then(function(){var I=new Uint8Array(C*T);return c(r.exports[f[S]],I,C,T,A,r.exports[u[v]]),I})}}}();var QWt=function(){"use strict";var e="b9H79TebbbecD9Geueu9Geub9Gbb9Gquuuuuuu99uueu9Gvuuuuub9Gluuuue999Giuuue999Gluuuueu9Giuuueuimxdilvorbwwbewlve9Weiiviebeoweuecj;jekr7oo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95beX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbla9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbvl79IV9RboDwebcekdDqq:XJxdbkp8WiKuP99Hu8Jjjjjbcj;bb9Rgq8KjjjjbaqcKfcbc;Kbz1jjjb8AaqcualcdtgkalcFFFFi0Egxcbyd;S1jjbHjjjjbbgmBdKaqceBd94aqamBdwaqaxcbyd;S1jjbHjjjjbbgPBd3aqcdBd94aqaPBdxaqcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbgsBdaaqciBd94aqasBdzaqcwfaeadalcbz:cjjjbaqaxcbyd;S1jjbHjjjjbbgzBd8KaqclBd94aqaxcbyd;S1jjbHjjjjbbgHBdyaqcvBd94alcd4alfhOcehAinaAgCcethAaCaO6mbkcbhXaqcuaCcdtgAaCcFFFFi0Ecbyd;S1jjbHjjjjbbgOBd8SaqcoBd94aOcFeaAz1jjjbhQdnalTmbavcd4hLaCcufhKinaiaXaL2cdtfgYydlgCcH4aC7c:F:b:DD2aYydbgCcH4aC7c;D;O:B8J27aYydwgCcH4aC7c:3F;N8N27hOcbhCdndninaQaOaKGgOcdtfg8AydbgAcuSmeaiaAaL2cdtfaYcxz:ljjjbTmdaCcefgCaOfhOaCaK9nmbxdkka8AaXBdbaXhAkazaXcdtfaABdbaXcefgXal9hmbkcbhCaHhAinaAaCBdbaAclfhAalaCcefgC9hmbkcbhCazhAaHhOindnaCaAydbgKSmbaOaHaKcdtfgKydbBdbaKaCBdbkaAclfhAaOclfhOalaCcefgC9hmbkkcbhOaqalcbyd;S1jjbHjjjjbbgYBd8WaqcrBd94aqaxcbyd;S1jjbHjjjjbbgCBd80aqcwBd94aqaxcbyd;S1jjbHjjjjbbgABdUaqcDBd94aCcFeakz1jjjbhEaAcFeakz1jjjbh3dnalTmbascwfh5indnamaOcdtgCfydbg8ETmbasaPaCfydbcitfh8Fa3aCfhaaEaCfhXcbhLindndna8FaLcitfydbgQaO9hmbaXaOBdbaaaOBdbxekdnamaQcdtgkfydbghTmbasaPakfydbcitgCfydbaOSmeahcufh8Aa5aCfhAcbhCina8AaCSmeaCcefhCaAydbhKaAcwfhAaKaO9hmbkaCah6meka3akfgCaOaQaCydbcuSEBdbaXaQaOaXydbcuSEBdbkaLcefgLa8E9hmbkkaOcefgOal9hmbkazhAaHhOa3hKaEhLcbhCindndnaCaAydbg8A9hmbdnaCaOydbg8A9hmbaLydbh8AdnaKydbgQcu9hmba8Acu9hmbaYaCfcb86bbxikaYaCfhXdnaCaQSmbaCa8ASmbaXce86bbxikaXcl86bbxdkdnaCaHa8AcdtgQfydb9hmbdnaKydbgXcuSmbaCaXSmbaLydbgkcuSmbaCakSmba3aQfydbg8EcuSmba8Ea8ASmbaEaQfydbgQcuSmbaQa8ASmbdnazaXcdtfydbazaQcdtfydb9hmbazakcdtfydbaza8Ecdtfydb9hmbaYaCfcd86bbxlkaYaCfcl86bbxikaYaCfcl86bbxdkaYaCfcl86bbxekaYaCfaYa8AfRbb86bbkaAclfhAaOclfhOaKclfhKaLclfhLalaCcefgC9hmbkawceGTmbaYhCalhAindnaCRbbce9hmbaCcl86bbkaCcefhCaAcufgAmbkkcbhLcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhmaqcKfaqyd94gCcdtfamBdbaqaCcefgABd94amaialavz:djjjb8AaqcKfaAcdtfcualc8S2gAalc;D;O;f8U0Ecbyd;S1jjbHjjjjbbgOBdbaqaCcdfBd94aOcbaAz1jjjbhsdnadTmbaehAindnamaAclfydbg8Acx2fgCIdbamaAydbgQcx2fgOIdbgg:tg8JamaAcwfydbgXcx2fgKIdlaOIdlg8K:tg8LNaKIdbag:tg8MaCIdla8K:tg8NN:tgyayNa8NaKIdwaOIdwg8P:tgINa8LaCIdwa8P:tg8NN:tg8La8LNa8Na8MNaIa8JN:tg8Ja8JNMM:rg8MJbbbb9ETmbaya8M:vhya8Ja8M:vh8Ja8La8M:vh8LkasazaQcdtfydbc8S2fgCa8La8M:rg8Ma8LNNg8NaCIdbMUdbaCa8Ja8Ma8JNg8RNgIaCIdlMUdlaCaya8MayNg8SNgRaCIdwMUdwaCa8Ra8LNg8RaCIdxMUdxaCa8Sa8LNg8UaCIdzMUdzaCa8Sa8JNg8SaCIdCMUdCaCa8La8Maya8PNa8LagNa8Ka8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCayagNgyaCIdaMUdaaCaga8KNggaCId8KMUd8KaCa8MaCIdyMUdyasaza8Acdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyasazaXcdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyaAcxfhAaLcifgLad6mbkcbh8AaehXincbhAinaYaeaAc:81jjbfydbgQa8AfcdtfydbgOfRbbhCdndnaYaXaAfydbgKfRbbgLc99fcFeGcpe0mbaCceSmbaCcd9hmekdnaLcufcFeGce0mbaEaKcdtfydbaO9hmekdnaCcufcFeGce0mba3aOcdtfydbaK9hmekdnaLcv2aCfc:G1jjbfRbbTmbazaOcdtfydbazaKcdtfydb0mekJbbacJbbjZaCceSEh8MaLceShkamaeaQcdtc:81jjbfydba8Afcdtfydbcx2fhCdnamaOcx2fgLIdwamaKcx2fgQIdwg8K:tg8La8LNaLIdbaQIdbg8P:tg8Ja8JNaLIdlaQIdlg8N:tgyayNMM:rggJbbbb9ETmba8Lag:vh8Layag:vhya8Jag:vh8JkJbbaca8MakEh8SdnaCIdwa8K:tg8Ma8La8Ma8LNaCIdba8P:tgRa8JNayaCIdla8N:tg8RNMMgIN:tg8Ma8MNaRa8JaIN:tg8La8LNa8RayaIN:tg8Ja8JNMM:rgyJbbbb9ETmba8May:vh8Ma8Jay:vh8Ja8Lay:vh8LkasazaKcdtfydbc8S2fgCa8La8SagNgya8LNNgIaCIdbMUdbaCa8Jaya8JNg8SNgRaCIdlMUdlaCa8Maya8MNggNg8RaCIdwMUdwaCa8Sa8LNg8SaCIdxMUdxaCaga8LNg8UaCIdzMUdzaCaga8JNg8VaCIdCMUdCaCa8Laya8Ma8KNa8La8PNa8Na8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCa8MagNg8MaCIdaMUdaaCaga8KNggaCId8KMUd8KaCayaCIdyMUdyasazaOcdtfydbc8S2fgCaIaCIdbMUdbaCaRaCIdlMUdlaCa8RaCIdwMUdwaCa8SaCIdxMUdxaCa8UaCIdzMUdzaCa8VaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCa8MaCIdaMUdaaCagaCId8KMUd8KaCayaCIdyMUdykaAclfgAcx9hmbkaXcxfhXa8Acifg8Aad6mbkkdnabaeSmbabaeadcdtz:hjjjb8Akcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaaqcKfaqyd94gCcdtfaaBdbaqaCcefgABd94aqcKfaAcdtfcuadcdtadcFFFFi0Ecbyd;S1jjbHjjjjbbg5BdbaqaCcdfgABd94aqcKfaAcdtfaxcbyd;S1jjbHjjjjbbgiBdbaqaCcifgABd94aqcKfaAcdtfalcbyd;S1jjbHjjjjbbg8WBdbaqaCclfBd94JbbbbhRdnadao9nmbararNh8Saacwfh8Xaqydwh8Yaqydxh8Zaqydzh80JbbbbhRinaqcwfabadgPalazz:cjjjbcbhhabhXcbhkincbhCindnazaXaCfydbgOcdtgefydbgLazabaCc:81jjbfydbakfcdtfydbgAcdtfydbg8ASmbaYaAfRbbgQcv2aYaOfRbbgKfc;q1jjbfRbbg8FaKcv2aQfg8Ec;q1jjbfRbbgdVcFeGTmbdna8Ec:G1jjbfRbbTmba8AaL0mekdnaKaQ9hmbaKcufcFeGce0mbaEaefydbaA9hmekaaahcx2fgKaAaOadcFeGgLEBdlaKaOaAaLEBdbaKaLa8FGcb9hBdwahcefhhkaCclfgCcx9hmbkaXcxfhXakcifgkaP6mbkdndnahTmbaahAahh8AinaAcwfgQJbbbbJbbjZasazaAydbgOcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaAclfgeydbgKcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNgyJbbbbJbbjZasazaKaOaQydbgLEgQcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaOaKaLEgXcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNg8Laya8L9FgCEUdbaeaKaXaCEBdbaAaOaQaCEBdbaAcxfhAa8Acufg8Ambkaqcjefcbcj;abz1jjjb8Aa8XhCahhAinaqcjefaCydbcO4c;8ZGfgOaOydbcefBdbaCcxfhCaAcufgAmbkcbhCcbhAinaqcjefaCfgOydbhKaOaABdbaKaAfhAaCclfgCcj;ab9hmbkcbhCa8XhAinaqcjefaAydbcO4c;8ZGfgOaOydbgOcefBdba5aOcdtfaCBdbaAcxfhAahaCcefgC9hmbkaPao9RgOci9Uh81dnalTmbcbhCaihAinaAaCBdbaAclfhAalaCcefgC9hmbkkcbhBa8Wcbalz1jjjbh83aOcO9UhUa81ce4h85cbh86cbhkdninaaa5akcdtfydbcx2fgXIdwg8Ja8S9Emea86a819pmeJFFuuh8Ldna85ah9pmbaaa5a85cdtfydbcx2fIdwJbb;aZNh8Lkdna8Ja8L9ETmba86aU0mdkdna83azaXydlg87cdtg88fydbgOfg89Rbba83azaXydbgecdtg8:fydbgZfgnRbbVmbdna8YaZcdtgCfydbgKTmba80a8ZaCfydbcitfhCamaOcx2fg8Ecwfhda8EclfhxamaZcx2fg8Fcwfhva8FclfhwcbhAcehQdnindnaiaCydbcdtfydbgLaOSmbaiaCclfydbcdtfydbg8AaOSmbama8Acx2fg8AIdbamaLcx2fgLIdbg8M:tg8LawIdbaLIdlgy:tggNa8FIdba8M:tg8Ka8AIdlay:tg8JN:ta8LaxIdbay:tg8PNa8EIdba8M:tg8Na8JN:tNa8JavIdbaLIdwgy:tgINaga8AIdway:tg8MN:ta8JadIdbay:tgyNa8Pa8MN:tNa8Ma8KNaIa8LN:ta8Ma8NNaya8LN:tNMMJbbbb9DmdkaCcwfhCaAcefgAaK6hQaKaA9hmbkkaQceGTmba85cefh85xekaXcwfhKasaOc8S2fgCasaZc8S2fgAIdbaCIdbMUdbaCaAIdlaCIdlMUdlaCaAIdwaCIdwMUdwaCaAIdxaCIdxMUdxaCaAIdzaCIdzMUdzaCaAIdCaCIdCMUdCaCaAIdKaCIdKMUdKaCaAId3aCId3MUd3aCaAIdaaCIdaMUdaaCaAId8KaCId8KMUd8KaCaAIdyaCIdyMUdydndndndnaYaefgARbbc9:fPdebdkaehCinaiaCcdtgCfaOBdbaHaCfydbgCae9hmbxikkaHa88fydbhCaHa8:fydbheaia8:fa87BdbaCh87kaiaecdtfa87Bdbkance86bba89ce86bbaKIdbg8LaRaRa8L9DEhRaBcefhBcecdaARbbceSEa86fh86kakcefgkah9hmbkkaBTmbdnalTmbcbhAaEhCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmbaEaKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkcbhAa3hCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmba3aKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkkcbhdabhCcbhLindnaiaCydbcdtfydbgAaiaCclfydbcdtfydbgOSmbaAaiaCcwfydbcdtfydbgKSmbaOaKSmbabadcdtfg8AaABdba8AclfaOBdba8AcwfaKBdbadcifhdkaCcxfhCaLcifgLaP9pmdxbkkaPhdxdkadao0mbkkdnaDTmbaDaR:rUdbkaqyd94gCcdtaqcKffc98fhzdninaCTmeazydbcbyd;W1jjbH:bjjjbbazc98fhzaCcufhCxbkkaqcj;bbf8Kjjjjbadk;pleouabydbcbaicdtz1jjjb8Aadci9UhvdnadTmbabydbhodnalTmbaehradhwinaoalarydbcdtfydbcdtfgDaDydbcefBdbarclfhrawcufgwmbxdkkaehradhwinaoarydbcdtfgDaDydbcefBdbarclfhrawcufgwmbkkdnaiTmbabydbhrabydlhwcbhDaihoinawaDBdbawclfhwarydbaDfhDarclfhraocufgombkkdnadci6mbavceavce0EhqabydlhvabydwhrinaecwfydbhwaeclfydbhDaeydbhodnalTmbalawcdtfydbhwalaDcdtfydbhDalaocdtfydbhokaravaocdtfgdydbcitfaDBdbaradydbcitfawBdladadydbcefBdbaravaDcdtfgdydbcitfawBdbaradydbcitfaoBdladadydbcefBdbaravawcdtfgwydbcitfaoBdbarawydbcitfaDBdlawawydbcefBdbaecxfheaqcufgqmbkkdnaiTmbabydlhrabydbhwinararydbawydb9RBdbawclfhwarclfhraicufgimbkkk:3ldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkaPk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz1jjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;01jjbgeabcifc98GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;01jjbgeabcrfc94GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;01jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;01jjbfgdBd;01jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:cedbcjwk9PFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbc;Swkxebbbdbbbj9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function o(p){for(var g=new Uint8Array(p.length),h=0;h96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h=3),r(x%3==0),r(b>=0&&b<=1);for(var T=0,A=0;A<(C?C.length:0);++A)T|=d[C[A]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),v=u(n.exports.meshopt_simplify,S,p.length,g,g.length/h,h*4,x,b,T);return v[0]=p instanceof Uint32Array?v[0]:new p.constructor(v[0]),v},getScale:function(p,g){return r(p instanceof Float32Array),r(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length/g,g*4)}}}();function bx(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,h,x;if(ni(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,x=y(C.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(bx.prototype=Object.create(ro.prototype),bx.prototype.constructor=bx);Object.defineProperties(bx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function tMe(e){try{let t=nMe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);Vte.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=It.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=It.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}bx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=tMe(this),this._promise)};function nMe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}bx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var MT=bx;function Xa(){}Xa._maxDecodingConcurrency=Math.max(Wt.hardwareConcurrency-1,1);Xa._decoderTaskProcessor=void 0;Xa._taskProcessorReady=!1;Xa._getDecoderTaskProcessor=function(){if(!l(Xa._decoderTaskProcessor)){let e=new gi("decodeDraco",Xa._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Xa._taskProcessorReady=!0}),Xa._decoderTaskProcessor=e}return Xa._decoderTaskProcessor};Xa.decodePointCloud=function(e){let t=Xa._getDecoderTaskProcessor();if(Xa._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Xa.decodeBufferView=function(e){let t=Xa._getDecoderTaskProcessor();if(Xa._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var vp=Xa;function vg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=It.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(vg.prototype=Object.create(ro.prototype),vg.prototype.constructor=vg);Object.defineProperties(vg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function iMe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=It.PROCESSING,e)}catch(n){if(e.isDestroyed())return;zte(e,n)}}vg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=iMe(this),this._promise)};function zte(e,t){e.unload(),e._state=It.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function oMe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=It.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}vg.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.PROCESSING||(l(this._dracoError)&&zte(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=vp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=oMe(this,c)};vg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var LT=vg;function rMe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Se.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Se.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Se({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Cx=rMe;function wp(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(wp.prototype=Object.create(ro.prototype),wp.prototype.constructor=wp);Object.defineProperties(wp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});wp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=sMe(this),this._promise):(this._promise=aMe(this),this._promise)};function Hte(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function sMe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await lMe(i);if(e.isDestroyed())return;let r=Hte(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(n){return e.isDestroyed()?void 0:Gte(e,n,"Failed to load embedded image")}}async function aMe(e){e._state=It.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await fMe(i);if(e.isDestroyed())return;let r=Hte(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(o){return e.isDestroyed()?void 0:Gte(e,o,`Failed to load image: ${n}`)}}function Gte(e,t,n){return e.unload(),e._state=It.FAILED,Promise.reject(e.getError(n,t))}function cMe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function lMe(e){let t=cMe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return sl(n)}return wp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var uMe=/(^data:image\/ktx2)|(\.ktx2$)/i;function fMe(e){let t=e.getUrlComponent(!1,!0);return uMe.test(t)?sl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}wp.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};wp._loadImageFromTypedArray=Cx;var NT=wp;var dMe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Aa=Object.freeze(dMe);function wg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(wg.prototype=Object.create(ro.prototype),wg.prototype.constructor=wg);Object.defineProperties(wg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var mMe=new w5;wg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=hMe(this),this._promise):(this._promise=pMe(this),this._promise)};async function hMe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=It.LOADED,e)}catch(n){if(e.isDestroyed())return;v5(e,n)}}async function pMe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=It.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=_Me(e,a),e._state=It.PROCESSING,e}catch(s){if(e.isDestroyed())return;v5(e,s)}}function _Me(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ue.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Q("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function v5(e,t){e.unload(),e._state=It.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function w5(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}w5.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};w5.prototype.execute=function(){this.buffer=Wte(this.typedArray,this.indexDatatype,this.context)};function Wte(e,t,n){let i=ht.createIndexBuffer({typedArray:e,context:n,usage:ke.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}wg.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){v5(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=mMe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Aa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Wte(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=It.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};wg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var FT=wg;function gMe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var as=gMe;function yMe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var or=yMe;function Yt(){}Yt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Yt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return X.getSizeInBytes(t.componentType)*Ql(t.type)}var pl=bMe;function CMe(e){Oe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=as(e.materials,o)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=pl(e,i),r.target=te.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Oe.materialValue(n,function(c){l(c.index)&&Tx(c)}),Tx(n.emissiveTexture),Tx(n.normalTexture),Tx(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),Tx(s.baseColorTexture),Tx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),Tx(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=TMe(e);return Oe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Oe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function TMe(e){let t={};return Oe.animation(e,function(n){Oe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function Tx(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var kD=CMe;function AMe(e){return Oe.shader(e,function(t){Bk(t)}),Oe.buffer(e,function(t){Bk(t)}),Oe.image(e,function(t){Bk(t)}),Bk(e),e}function Bk(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Ig=AMe;function EMe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var UD=EMe;function SMe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),UD(e,t),n.length===0&&delete e.extensionsUsed}}var Ax=SMe;var vMe=4;function wMe(e){if(_d(e)!=="glTF")throw new de("File is not valid binary glTF");let n=jte(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?IMe(e,n):DMe(e,n)}function jte(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return Ax(c,"KHR_binary_glTF"),c}function DMe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var VD=wMe;function PMe(e){return Oe.shader(e,function(t){kk(t)}),Oe.buffer(e,function(t){kk(t)}),Oe.image(e,function(t){kk(t)}),kk(e),e}function kk(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var zD=PMe;function OMe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),as(n,t,!0)}var tf=OMe;function RMe(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var FMe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function BMe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(FMe.indexOf(e[n])===-1)return t;return e}function kMe(e){let t={},n={},i=e.techniques;return l(i)&&(Oe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(qte(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,LMe),blendFactors:BMe(c.blendFuncSeparate,NMe)})}qte(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),tf(e,"KHR_blend")),Oe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Oe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var HD=kMe;function UMe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),as(n,t,!0),tf(e,t)}var GD=UMe;function VMe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=as(r.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=as(r.shaders,h,!0),u.program=as(r.programs,p),o[a.program]=u.program}i[c]=as(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,tf(e,"KHR_techniques_webgl"),GD(e,"KHR_techniques_webgl"))}return Oe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Oe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var WD=VMe;function zMe(e,t){nl.typeOf.object("material",e),nl.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,u=r.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Oe.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var BT=zMe;var Yte=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function HMe(e,t){return t=y(t,Yte),Yte.forEach(function(n){t.indexOf(n)>-1&&WMe(e,n)}),e}var GMe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function WMe(e,t){let n=GMe[t],i=e[n];if(l(i)){let o=0,r=Hm[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),Oe.meshPrimitiveTarget(o,function(a){Oe.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Oe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};zm.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};zm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),or(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),or(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};zm.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};zm.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};zm.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Oe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};zm.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};zm.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};zm.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){BT(i,function(o,r){r.index>t&&--r.index})}),or(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;dt&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(or(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;ut&&--f.texture.index}}}})}),or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--f.index}}}}};function Hm(){}Hm.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Oe.meshPrimitiveTarget(i,function(r){Oe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Oe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),or(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),or(e,"CESIUM_primitive_outline")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Hm.buffer=function(e){let t={};return Oe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Hm.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),or(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),or(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(or(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function Xte(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Xte(e,o,n)}).length===0}Hm.node=function(e){let t={};return Oe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){Xte(e,i,t)||(t[i]=!0)}),t};Hm.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Hm.texture=function(e){let t={};if(Oe.material(e,function(n){BT(n,function(i){t[i]=!0})}),or(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=mLe[a];l(f)?(u=f+c,t[r]=u):l(dLe[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function pLe(e){Oe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function D5(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:pl(e,t)}function _Le(e){Oe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=D5(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function gLe(e){let t,n,i,o=e.bufferViews,r={};Oe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Oe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Oe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Zte(n)&&$te(e,i))}}),delete e.nodes[t]}function xLe(e){return Oe.node(e,function(t,n){Zte(t)&&$te(e,n)}),e}function bLe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=Ex(e,i);i.min=o.min,i.max=o.max}})})}function CLe(e){Oe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Ex(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function TLe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Jte(e),nLe(e),xLe(e),iLe(e),oLe(e),sLe(e),cLe(e),_Le(e),gLe(e),yLe(e),bLe(e),CLe(e),lLe(e),uLe(e),fLe(e),hLe(e),XD(e),pLe(e),HD(e),WD(e),rLe(e)}var ALe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],ELe=["u_diffuse","u_diffuse_mat"];function P5(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function zk(e){return l(e.index)}function Hk(e){return Array.isArray(e)&&e.length===4}function Qte(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function SLe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,ALe),i=y(t.baseColorFactorNames,ELe);Oe.material(e,function(o){Oe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&zk(r)?(P5(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&Hk(r)&&(P5(o),o.pbrMetallicRoughness.baseColorFactor=Qte(r))})}),Sx(e,"KHR_techniques_webgl"),Sx(e,"KHR_blend")}function vLe(e){Oe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(tf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,u=n.doubleSided,f=n.transparent;P5(t),l(r)&&(Hk(r)?t.emissiveFactor=r.slice(0,3):zk(r)&&(t.emissiveTexture=r)),l(s)&&(Hk(s)?t.pbrMetallicRoughness.baseColorFactor=Qte(s):zk(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(Hk(a)?t.emissiveFactor=a.slice(0,3):zk(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),Sx(e,"KHR_materials_common")}var KD=JMe;var li={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function wLe(e){switch(e){case li.POSITION:return"positionMC";case li.NORMAL:return"normalMC";case li.TANGENT:return"tangentMC";case li.TEXCOORD:return"texCoord";case li.COLOR:return"color";case li.JOINTS:return"joints";case li.WEIGHTS:return"weights";case li.FEATURE_ID:return"featureId"}}li.hasSetIndex=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return!1;case li.TEXCOORD:case li.COLOR:case li.JOINTS:case li.WEIGHTS:case li.FEATURE_ID:return!0}};li.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return li.POSITION;case"NORMAL":return li.NORMAL;case"TANGENT":return li.TANGENT;case"TEXCOORD":return li.TEXCOORD;case"COLOR":return li.COLOR;case"JOINTS":return li.JOINTS;case"WEIGHTS":return li.WEIGHTS;case"_FEATURE_ID":return li.FEATURE_ID}};li.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return li.POSITION;case"RGBA":case"RGB":case"RGB565":return li.COLOR;case"NORMAL":case"NORMAL_OCT16P":return li.NORMAL;case"BATCH_ID":return li.FEATURE_ID}};li.getGlslType=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return"vec3";case li.TEXCOORD:return"vec2";case li.COLOR:return"vec4";case li.JOINTS:return"ivec4";case li.WEIGHTS:return"vec4";case li.FEATURE_ID:return"int"}};li.getVariableName=function(e,t){let n=wLe(e);return l(t)&&(n+=`_${t}`),n};var Et=Object.freeze(li);function Ka(){}Ka.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let o=new de(i);return l(n)&&(o.stack=`Original stack: +${n.stack} +Handler stack: +${o.stack}`),o};Ka.getNodeTransform=function(e){return l(e.matrix)?e.matrix:L.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Be.IDENTITY,l(e.scale)?e.scale:m.ONE)};Ka.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r>t};Qs.fromSubtreeJson=async function(e,t,n,i,o){let r=new Qs(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=gNe(n);let a=s.json;r._subtreeJson=a;let c;if(ni(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let A=0;A0;f=f||d;for(let p=0;p>BigInt(61)),u=c%2===0?DT.encode2D(i,o,r):DT.encode2D(i,r,o),f=Tp.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Tp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var VNe=new m,zNe=new m,k5=new m,HNe=new Z;function gne(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,zNe),s=Z.unpack(e,3,HNe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,VNe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=m.fromElements(c,u,f,k5);p=Z.multiplyByVector(s,p,k5),p=m.add(p,r,k5);let g=Z.clone(s);g=Z.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),Z.pack(g,h,3),h}var GNe=new ce;function yne(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,GNe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),d=P.negativePiToPi(f+u),p=c*r.height,g=P.negativePiToPi(r.south+i*p),h=P.negativePiToPi(g+p),x=s,b=a;if(l(o)){let C=c*(a-s);x+=o*C,b=x+C}return[f,g,d,h,x,b]}function WNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=pne(i,o,n,!1,t),s=hne(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=xne(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function xne(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}yl.prototype.hasProperty=function(e,t){return!1};yl.prototype.getFeature=function(e){};yl.prototype.applyDebugSettings=function(e,t){};yl.prototype.applyStyle=function(e){};yl.prototype.update=function(e,t){};yl.prototype.isDestroyed=function(){return!1};yl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};yl._deriveBoundingBox=gne;yl._deriveBoundingRegion=yne;yl._deriveBoundingVolumeS2=_ne;var HT=yl;var jNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},xl=Object.freeze(jNe);function GT(e,t){this._distance=t,this._normal=new bne(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(GT.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});GT.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new GT(e.normal,e.distance),t};GT.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new GT(e.normal,e.distance)};function bne(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(bne.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var Px=GT;function Ja(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Sne:vne,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o0&&(r=tn.OUTSIDE);for(let s=0;s=r;)C=o[C-r];o.push(C),s[x]=b}b>yFe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>xFe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=Rne(i,c,u,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Rne(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=G5(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,g=r?1:0,h=G5(e,n,d,p,g);if(h===0)return n;let x=s?1:0,b=0,C=r?1:0,T=G5(e,i,x,b,C);if(T===0)return i;let A=f&h&T,S,v,I;if(A&1)S=0,v=1,I=2;else if(A&2)S=0,I=1,v=2;else if(A&4)v=0,S=1,I=2;else if(A&8)v=0,I=1,S=2;else if(A&16)I=0,S=1,v=2;else if(A&32)I=0,v=1,S=2;else{let F=W5(f),_=W5(h),E=W5(T);return F<_&&F>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}Kk.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(Mne(i));let s=new Lt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ct.LUMINANCE,sampler:new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR_MIPMAP_LINEAR,magnificationFilter:Ci.LINEAR})});return t.outlineTexture=s,s};function Mne(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Lne(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Ro.FAILED;let o=this._processError;this._processError=void 0,Zk(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Ro.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Ro.FAILED,Zk(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Ro.FAILED,Zk(this,o)}return this._incrementallyLoadTextures?n:n&&i};function QFe(e,t,n,i,o,r,s,a){let u=t.accessors[n].bufferView;return Ni.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,draco:o,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function e2e(e,t,n,i,o,r,s){return Ni.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function t2e(e,t,n){let i=Ni.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function Une(e,t,n){let i=t.byteOffset,o=pl(e,t),r=t.count,s=Ql(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=Ip(t.componentType);i=n.byteOffset+i;for(let x=0;x{l(o)&&l(o.attributes)&&l(o.attributes[f])?m2e(x,b,r,s):h2e(t,c,x,b,r,s)},x}function Hne(e,t,n,i,o,r,s,a){let c=i.modelSemantic,u=c===Et.POSITION,f=c===Et.FEATURE_ID,d=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,x=g||d||p,T=zne(e,t,n,i,o,s?!1:h,s?!0:x,a),A=new Lx.AttributeLoadPlan(T);return A.loadBuffer=h,A.loadTypedArray=x,A}function p2e(e,t,n,i,o,r){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=j5(e,zr,o),u=c.modelSemantic,f=u===zr.TRANSLATION||u===zr.ROTATION||u===zr.SCALE,d=u===zr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!r.scene3DOnly;return zne(e,t,n,c,void 0,g,p||d&&(!a||h),r)}function _2e(e,t,n,i,o,r,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new DFe;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&o,h=!f,x=f||d||p,T=e2e(e,t,n,i,r?!1:h,r?!0:x,s),A=e._geometryLoaders.length;e._geometryLoaders.push(T);let S=T.load();e._loaderPromises.push(S),e._geometryCallbacks[A]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let v=new Lx.IndicesLoadPlan(u);return v.loadBuffer=h,v.loadTypedArray=x,v}function Pp(e,t,n,i,o,r){let s=_l.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=Ni.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:o,asynchronous:e._asynchronous}),c=_l.createModelTextureReader({textureInfo:n}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Ro.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{c.texture=a.texture,l(r)&&(c.texture.sampler=r)},c}function g2e(e,t,n,i,o){let r=new YFe,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(r.unlit=l(s.KHR_materials_unlit),l(a)){let u=new qFe;r.specularGlossiness=u,l(a.diffuseTexture)&&(u.diffuseTexture=Pp(e,t,a.diffuseTexture,i,o)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(u.specularGlossinessTexture=Pp(e,t,a.specularGlossinessTexture,i,o)),u.diffuseFactor=nf(re,a.diffuseFactor),u.specularFactor=nf(m,a.specularFactor),u.glossinessFactor=a.glossinessFactor,r.pbrSpecularGlossiness=a}else if(l(c)){let u=new jFe;l(c.baseColorTexture)&&(u.baseColorTexture=Pp(e,t,c.baseColorTexture,i,o)),l(c.metallicRoughnessTexture)&&(u.metallicRoughnessTexture=Pp(e,t,c.metallicRoughnessTexture,i,o)),u.baseColorFactor=nf(re,c.baseColorFactor),u.metallicFactor=c.metallicFactor,u.roughnessFactor=c.roughnessFactor,r.metallicRoughness=u}return l(n.emissiveTexture)&&(r.emissiveTexture=Pp(e,t,n.emissiveTexture,i,o)),l(n.normalTexture)&&!e._loadForClassification&&(r.normalTexture=Pp(e,t,n.normalTexture,i,o)),l(n.occlusionTexture)&&(r.occlusionTexture=Pp(e,t,n.occlusionTexture,i,o)),r.emissiveFactor=nf(m,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}function Gne(e,t){let n=new Fne;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Wne(e,t,n,i){let o=new Fne,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Vne(r.attribute),o.positionalLabel=i,o}function jne(e,t){let n=new kne;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function qne(e,t,n,i){let o=new kne,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function y2e(e,t,n,i,o,r){let s=new Bne;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=r;let a=n.texture;s.textureReader=Pp(e,t,a,i,o,hn.NEAREST);let u=(l(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=u,s}function x2e(e,t,n,i,o,r,s,a){let c=new Bne,u=n.featureIds,f=u.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Pp(e,t,f,o,r,hn.NEAREST),c.textureReader.channels=u.channels,c.positionalLabel=a,c}function b2e(e,t,n,i,o,r){let s=new PFe,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=j5(e,Et,u),p=Hne(e,t,f,d,a,c,i,r);s.attributes.push(p.attribute),o.attributePlans.push(p)}return s}function C2e(e,t,n,i,o,r){let s=new OFe,a=new Lx(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=g2e(e,t,t.materials[c],o,r));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=T2e(e,t,d,a));let p=e._loadForClassification,g=u.KHR_draco_mesh_compression,h=!1,x=n.attributes;if(l(x)){for(let O in x)if(x.hasOwnProperty(O)){let R=x[O],N=j5(e,Et,O),F=N.modelSemantic;if(p&&!d2e(F))continue;F===Et.FEATURE_ID&&(h=!0);let _=Hne(e,t,R,N,g,i,f,r);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let b=n.targets;if(l(b)&&!p){let O=b.length;for(let R=0;R0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};jT.prototype.isDestroyed=function(){return!1};jT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var hP=jT;var bl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===bl.RGBA4||e===bl.RGBA8||e===bl.RGBA16F||e===bl.RGBA32F||e===bl.RGB5_A1||e===bl.RGB565||e===bl.DEPTH_COMPONENT16||e===bl.STENCIL_INDEX8||e===bl.DEPTH_STENCIL||e===bl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?bl.RGBA32F:e===te.HALF_FLOAT_OES?bl.RGBA16F:bl.RGBA8}},Lc=Object.freeze(bl);function pP(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Gt.maximumRenderbufferSize,o=y(e.format,Lc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(pP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});pP.prototype._getRenderbuffer=function(){return this._renderbuffer};pP.prototype.isDestroyed=function(){return!1};pP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var eu=pP;function ls(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ls.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});ls.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};ls.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,ct.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Lc.getColorFormat(o);this._colorRenderbuffers[s]=new eu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Lt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new eu({context:e,width:t,height:n,format:Lc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new eu({context:e,width:t,height:n,format:Lc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Lt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_COMPONENT,pixelDatatype:Je.UNSIGNED_INT,sampler:hn.NEAREST}):this._depthRenderbuffer=new eu({context:e,width:t,height:n,format:Lc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new hP({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new ea({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ls.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};ls.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ls.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};ls.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ls.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ls.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ls.prototype.getDepthTexture=function(){return this._depthTexture};ls.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ls.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ls.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ls.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ls.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ls.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ls.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ls.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ls.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-C,ec=gP(r,n,c,ec),Sa.clipToGLWindowCoordinates(a,ec,X5),a.x+=A.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,ec=gP(r,n,c,ec),Sa.clipToGLWindowCoordinates(a,ec,K5)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-C,ec=gP(r,n,c,ec),Sa.clipToGLWindowCoordinates(a,ec,X5),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,ec=gP(r,n,c,ec),Sa.clipToGLWindowCoordinates(a,ec,K5)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(X5,i),(i.x<0||i.x>s.clientWidth)&&(i.x=K5.x)}}if(o.mode!==ne.SCENE2D||u){if(ec=gP(r,n,c,ec),ec.z<0&&!(c.frustum instanceof on)&&!(c.frustum instanceof Ar))return;i=Sa.clipToGLWindowCoordinates(a,ec,i)}return i.y=s.clientHeight-i.y,i};Sa.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=Sa.wgs84ToWindowCoordinates(e,t,n),!!l(n))return Sa.transformWindowToDrawingBuffer(e,n,n)};var Rp=new m,sBe=new me;Sa.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,sBe);if(!l(r))return;if(o.project(r,Rp),i===ne.COLUMBUS_VIEW)return m.fromElements(Rp.z,Rp.x,Rp.y,n);if(i===ne.SCENE2D)return m.fromElements(0,Rp.x,Rp.y,n);let s=e.morphTime;return m.fromElements(P.lerp(Rp.z,t.x,s),P.lerp(Rp.x,t.y,s),P.lerp(Rp.y,t.z,s),n)};var $ne=new m,Qne=new m,eie=new L;Sa.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,$ne),L.computeViewportTransformation(e,0,1,eie),L.multiplyByPoint(eie,$ne,Qne),H.fromCartesian3(Qne,n)};Sa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*o,t.y*r,n)};var aBe=new re,tie=new re;Sa.drawingBufferToWgs84Coordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,f=re.clone(re.UNIT_W,aBe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=L.multiplyByVector(r.inverseViewProjection,f,tie);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=tie,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=L.multiplyByVector(r.inverseView,d,d)}return m.fromCartesian4(d,i)};var Zi=Sa;var cBe={LEFT:-1,NONE:0,RIGHT:1},Nc=Object.freeze(cBe);var YT={};YT._deprecationWarning=Q;var Mp=Uint32Array.BYTES_PER_ELEMENT;YT.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Mp;let r=o.getUint32(t,!0);if(r!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Mp;let s=o.getUint32(t,!0);t+=Mp;let a=o.getUint32(t,!0);t+=Mp;let c=o.getUint32(t,!0);t+=Mp;let u=o.getUint32(t,!0);t+=Mp;let f=o.getUint32(t,!0);t+=Mp;let d;u>=570425344?(t-=Mp*2,d=a,u=c,f=0,a=0,c=0,YT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Mp,d=u,u=a,f=c,a=0,c=0,YT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Oo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Oo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(YT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var yP=YT;function xP(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function nie(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function lBe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}xP.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),nie(this,e,t,n,1,i.byteOffset)):i};xP.prototype.hasProperty=function(e){return l(this.json[e])};xP.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),nie(this,e,t,n,this.featuresLength,i.byteOffset)):lBe(this,e,t,i)};xP.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(h=Oo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(tU._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var AP=tU;var Np={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},nU=Ft.Attribute,PBe=Ft.FeatureIdAttribute,cie=Ft.Instances;function Fp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,uo.Y),u=y(e.forwardAxis,uo.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=Np.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=L.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Fp.prototype=Object.create(ro.prototype),Fp.prototype.constructor=Fp);Object.defineProperties(Fp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Fp.prototype.load=function(){if(l(this._promise))return this._promise;let e=AP.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new vd(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=L.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=dl(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Wm(u);return this._gltfLoader=f,this._state=Np.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Np.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw OBe(this,d)}),this._promise};function OBe(e,t){e.unload(),e._state=Np.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}Fp.prototype.process=function(e){if(this._state===Np.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Np.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=L.multiplyTransformation(this._transform,i.transform,i.transform),LBe(this,i,e),RBe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Np.READY,!0};function RBe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Lp({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Mc({name:bd.BATCH_TABLE_CLASS_NAME,count:i});o=new Ea({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var iU=new m,$5=new Array(4),MBe=new L;function LBe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=FBe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),h=m.unpackArray(f),x=new m,b=new m,C=new m,T=new m,A=new Z,S=new Be,v=new Array(4),I=new m,O=new Array(3),R=new L;if(!l(s)){let U=ae.fromPoints(h);for(i=0;i0&&(U.instances=V?NBe(N):N,V=!0)}}function NBe(e){let t=new cie;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};XT.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var so=XT;function KT(e){this._value=e,this._valueType=so.getPointType(e)}Object.defineProperties(KT.prototype,{value:{get:function(){return this._value}}});KT.prototype.findTimeInterval=function(e){};KT.prototype.wrapTime=function(e){return 0};KT.prototype.clampTime=function(e){return 0};KT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var SP=KT;function JT(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=so.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(JT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});JT.prototype.findTimeInterval=so.prototype.findTimeInterval;JT.prototype.wrapTime=so.prototype.wrapTime;JT.prototype.clampTime=so.prototype.clampTime;JT.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var kg=JT;var lie={};lie.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var ZT=lie;var uie=[],fie=[],die=[],mie=[];function zBe(e,t,n){let i=uie,o=die,r=fie,s=mie;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===xl.REPEAT)g=g-Math.floor(g);else if(a.loop===xl.MIRRORED_REPEAT){let C=Math.floor(g),T=g-C;g=C%2===1?1-T:T}a.reverse&&(g=1-g);let b=g*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=wd.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&oU.push(a))}}n=oU.length;for(let s=0;s0,u=!l(a)&&c;if(l(o)&&!u){let A=jke(a),x=Yke(o,A);qke(i,x);let T=Xke(x).indexOf("normalMC")>=0,E=$t.getAttributeBySemantic(t,bt.NORMAL);if(T&&!E)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,be.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Se.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,be.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,be.VERTEX);let d,p,g;Fr.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Ur.ADD),i.addUniform("vec4","model_pointCloudParameters",be.VERTEX),i.addVertexLines(NO);let h=e.uniformMap;h.model_pointCloudParameters=function(){let A=zke,x=1;p&&(x=g?5:d.tileset.maximumScreenSpaceError),A.x=y(f.maximumAttenuation,x),A.x*=n.pixelRatio;let C=Hke(e,t,f,d);A.y=C*f.geometricErrorScale;let T=n.context,E=n.camera.frustum,S;return n.mode===ne.SCENE2D||E instanceof rn?S=Number.POSITIVE_INFINITY:S=T.drawingBufferHeight/n.camera.frustum.sseDenominator,A.z=S,p&&(A.w=d.tileset.timeSinceLoad),A}};var xre=new m;function Hke(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=$t.getAttributeBySemantic(t,bt.POSITION),o=r.count,s=e.runtimeNode.transform,a=m.subtract(r.max,r.min,xre);a=B.multiplyByPointAsVector(s,a,xre);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var Gke={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Wke={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function jke(e){let t=Ye(Wke);if(!l(e))return t;for(let n=0;n0,d=l(i.skin),p=l(o),h=!(p&&l(o.fragmentShaderText))||o.mode!==zp.REPLACE_MATERIAL,A=$t.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Be.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),C=r.pointCloudShading,T=l(C)&&C.attenuation,E=l(C)&&C.backFaceCulling,S=n.primitiveType===Be.POINTS&&(l(s)||T||E),w=r._enableShowOutline&&l(n.outlineCoordinates),D=p4e(r,i,n),R=l(r.classificationType);u&&t.push(HO),t.push(DO),x&&t.push(jO),R&&t.push(dO),f&&t.push(BO),d&&t.push(WO),S&&t.push(FO),A&&t.push(bO),h&&t.push(RO),t.push(kg),t.push(of),D.hasPropertyTable&&(t.push(Hg),t.push(fO),t.push(pO)),p&&t.push(TO),t.push(PO),r.allowPicking&&t.push(LO),w&&t.push(kO),t.push(uO),t.push(zO)};function p4e(e,t,n){let i;return l(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var YO=Mre;function _6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],_4e(this)}Object.defineProperties(_6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function _4e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var oV={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};oV.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,be.FRAGMENT),i.addFragmentLines($O);let r={};i.addUniform("float",oV.SPLIT_DIRECTION_UNIFORM_NAME,be.FRAGMENT),r[oV.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=gt(r,e.uniformMap)};var eR=oV;function A4e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var tR=A4e;function x4e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Ym.UNLIT)}var nR=x4e;function C4e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new nR,this.pickId=void 0}var iR=C4e;function nu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=B.clone(B.IDENTITY),this._computedModelMatrix2D=B.clone(B.IDENTITY),this._axisCorrectionMatrix=$t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new B),this._runtimeArticulations={},T4e(this)}Object.defineProperties(nu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function T4e(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;Lre(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let T=0;T0&&(d=Ir(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new wd(u,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!l(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let A=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(A)&&(A=m.unpack(A));let x=F4e(g,d);if(x.rtcCenter=A,x.pointsLength=h,!x.hasPositions){let C=U4e(g);x.positions=C,x.hasPositions=x.hasPositions||l(C)}if(!x.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let C=k4e(g);x.normals=C,x.hasNormals=x.hasNormals||l(C)}if(!x.hasColors){let C=V4e(g);x.colors=C,x.hasColors=x.hasColors||l(C),x.hasConstantColor=l(x.constantColor),x.isTranslucent=l(C)&&C.isTranslucent}if(!x.hasBatchIds){let C=z4e(g);x.batchIds=C,x.hasBatchIds=x.hasBatchIds||l(C)}if(x.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=C}return l(p)&&(p=new Uint8Array(p),x.batchTableJson=d,x.batchTableBinary=p),x};function F4e(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let h=s.byteOffset,A=s.byteLength;if(!l(r)||!l(h)||!l(A))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+A),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:gt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function U4e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:bt.POSITION,semantic:bt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=(1<<16)-1,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(o))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:bt.POSITION,semantic:bt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:cn.VEC3,quantizedRange:r,quantizedVolumeOffset:m.unpack(o),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:cn.VEC3}}}function V4e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:bt.COLOR,semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:cn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:bt.COLOR,semantic:bt.COLOR,setIndex:0,constantColor:o,componentDatatype:X.FLOAT,type:cn.VEC4,isQuantized:!1,isTranslucent:s}}}function k4e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:bt.NORMAL,semantic:bt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:bt.NORMAL,semantic:bt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<0&&lze(e,a,d,t),l(n.rtcCenter)&&(f.transform=B.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=B.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function lze(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(u(f),!1)}),this._loader instanceof aE?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,u)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(u(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!l(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad($t.getError("model",this._resource,c)))})),this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function cV(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function uze(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return jre(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Fr.GLTF&&Rt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(ss.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});ur.prototype.getNode=function(e){return this._nodesByName[e]};ur.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};ur.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};ur.prototype.makeStyleDirty=function(){this._styleDirty=!0};ur.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var dze=new B,mze=new Z,hze=new B;ur.prototype.update=function(e){let t=!1;try{t=pze(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")cV(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=$t.getError("model",this._resource,n);cV(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=$t.getError("model",this._resource,n);cV(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(gze(this,e),_ze(this,e),yze(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let o=$t.getError("model",this._resource,new de("Failed to load model."));cV(o),this._rejectLoad=this._rejectLoad&&this._rejectLoad(o)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&uze(this,i);let r=new rR({model:this,modelComponents:n});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(Aze(this),xze(this),Cze(this,e),Tze(this),Eze(this,e),bze(this,e),Sze(this,e),vze(this,e),this._defaultTexture=e.context.defaultTexture,wze(this,e),Dze(this,e),Ize(this),Pze(this,e),Mze(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),Rze(this),Bze(this,e),Lze(this),Nze(this,e)}};function pze(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function _ze(e,t){l(e._customShader)&&e._customShader.update(t)}function gze(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=Hh.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function yze(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Aze(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=fze(t,e),e._styleDirty=!0,e.resetDrawCommands())}function xze(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Cze(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o=i&&o<=r}function kze(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCreditToNextFrame(i);let r=e._resourceCredits,o=r.length;for(let c=0;c0&&e.alpha<1};ur.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Yre(e){return e.context.stencilBuffer}ur.prototype.hasSilhouette=function(e){return Yre(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};ur.prototype.hasSkipLevelOfDetail=function(e){if(!Fr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ur.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};ur.prototype.isDestroyed=function(){return!1};ur.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let r=0;r0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Wre(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function cE(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Pd=ur;function Ss(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Ss.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ss.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Ss.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Ss.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Ss.prototype.applyStyle=function(e){this._model.style=e};Ss.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),l(r)&&l(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:yl.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Ss.prototype.isDestroyed=function(){return!1};Ss.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Ss.fromGltf=async function(e,t,n,i){let r=new Ss(e,t,n),s=aR(e,t,r,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Pd.fromGltfAsync(s);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};Ss.fromB3dm=async function(e,t,n,i,r){let o=new Ss(e,t,n),a=aR(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Pd.fromB3dm(a);return o._model=u,o._readyPromise=new Promise(f=>{o._resolveContent=f}),o};Ss.fromI3dm=async function(e,t,n,i,r){let o=new Ss(e,t,n),a=aR(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Pd.fromI3dm(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Ss.fromPnts=async function(e,t,n,i,r){let o=new Ss(e,t,n),a=aR(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Pd.fromPnts(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Ss.fromGeoJson=async function(e,t,n,i){let r=new Ss(e,t,n),s=aR(e,t,r,{geoJson:i,resource:n}),a=await Pd.fromGeoJson(s);return r._model=a,r._readyPromise=new Promise(c=>{r._resolveContent=c}),r};function aR(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Se.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return gt(i,r)}var Xm=Ss;function Od(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties(Od.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Od.fromJson=function(e,t,n,i){let r=new Od(e,t,n);return r._tileset.loadTileset(r._resource,i,r._tile),r._ready=!0,r};Od.prototype.hasProperty=function(e,t){return!1};Od.prototype.getFeature=function(e){};Od.prototype.applyDebugSettings=function(e,t){};Od.prototype.applyStyle=function(e){};Od.prototype.update=function(e,t){};Od.prototype.isDestroyed=function(){return!1};Od.prototype.destroy=function(){return ue(this)};var cR=Od;var lR=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -uniform sampler2D u_atlas; + lightingStage(material, attributes); -#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif + #ifdef HAS_SELECTED_FEATURE_ID + cpuStylingStage(material, selectedFeature); + #endif -in vec2 v_textureCoordinates; -in vec4 v_pickColor; -in vec4 v_color; + #ifdef HAS_MODEL_COLOR + modelColorStage(material); + #endif -#ifdef SDF -in vec4 v_outlineColor; -in float v_outlineWidth; -#endif + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(material); + #endif -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates -in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) -in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -in mat2 v_rotationMatrix; + vec4 color = handleAlpha(material.diffuse, material.alpha); -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT1 = 2.0; + #ifdef HAS_CLIPPING_PLANES + modelClippingPlanesStage(color); + #endif -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; + #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) + silhouetteStage(color); + #endif -float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) -{ - vec2 lookupVector = imageSize * (depthLookupST - adjustedST); - lookupVector = v_rotationMatrix * lookupVector; - vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal + out_FragColor = color; +} +`;var NP=`precision highp float; - vec2 translation = v_originTextureCoordinateAndTranslate.zw; +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { + czm_modelVertexOutput vsOutput; + vsOutput.positionMC = positionMC; + vsOutput.pointSize = 1.0; + return vsOutput; +} - if (applyTranslate) - { - // this is only needed for labels where the horizontal origin is not LEFT - // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT - translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); - } - - vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); +void main() +{ + // Initialize the attributes struct with all + // attributes except quantized ones. + ProcessedAttributes attributes; + initializeAttributes(attributes); - if (logDepthOrDepth == 0.0) - { - return 0.0; // not on the globe - } + // Dequantize the quantized ones and add them to the + // attributes struct. + #ifdef USE_DEQUANTIZATION + dequantizationStage(attributes); + #endif - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - return eyeCoordinate.z / eyeCoordinate.w; -} -#endif + #ifdef HAS_MORPH_TARGETS + morphTargetsStage(attributes); + #endif + #ifdef HAS_SKINNING + skinningStage(attributes); + #endif -#ifdef SDF + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(); + #endif -// Get the distance from the edge of a glyph at a given position sampling an SDF texture. -float getDistance(vec2 position) -{ - return texture(u_atlas, position).r; -} + // Compute the bitangent according to the formula in the glTF spec. + // Normal and tangents can be affected by morphing and skinning, so + // the bitangent should not be computed until their values are finalized. + #ifdef HAS_BITANGENTS + attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); + #endif -// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. -vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) -{ - float distance = getDistance(position); + FeatureIds featureIds; + featureIdStage(featureIds, attributes); - if (outlineWidth > 0.0) - { - // Don't get the outline edge exceed the SDF_EDGE - float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); - float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); - float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); - return vec4(sdfColor.rgb, sdfColor.a * alpha); - } - else - { - float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - return vec4(v_color.rgb, v_color.a * alpha); - } -} -#endif + #ifdef HAS_SELECTED_FEATURE_ID + SelectedFeature feature; + selectedFeatureIdStage(feature, featureIds); + // Handle any show properties that come from the style. + cpuStylingStage(attributes.positionMC, feature); + #endif -void main() -{ - vec4 color = texture(u_atlas, v_textureCoordinates); + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + // The scene mode 2D pipeline stage and instancing stage add a different + // model view matrix to accurately project the model to 2D. However, the + // output positions and normals should be transformed by the 3D matrices + // to keep the data the same for the fragment shader. + mat4 modelView = czm_modelView3D; + mat3 normal = czm_normal3D; + #else + // These are used for individual model projection because they will + // automatically change based on the scene mode. + mat4 modelView = czm_modelView; + mat3 normal = czm_normal; + #endif -#ifdef SDF - float outlineWidth = v_outlineWidth; - vec4 outlineColor = v_outlineColor; + // Update the position for this instance in place + #ifdef HAS_INSTANCING - // Get the current distance - float distance = getDistance(v_textureCoordinates); + // The legacy instance stage is used when rendering i3dm models that + // encode instances transforms in world space, as opposed to glTF models + // that use EXT_mesh_gpu_instancing, where instance transforms are encoded + // in object space. + #ifdef USE_LEGACY_INSTANCING + mat4 instanceModelView; + mat3 instanceModelViewInverseTranspose; + + legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float smoothing = fwidth(distance); - // Get an offset that is approximately half the distance to the neighbor pixels - // 0.354 is approximately half of 1/sqrt(2) - vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); + modelView = instanceModelView; + normal = instanceModelViewInverseTranspose; + #else + instancingStage(attributes); + #endif - // Sample the center point - vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); + #ifdef USE_PICKING + v_pickColor = a_pickColor; + #endif - // Sample the 4 neighbors - vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + #endif - // Equally weight the center sample and the 4 neighboring samples - color = (center + color1 + color2 + color3 + color4)/5.0; -#else - // If no derivatives available (IE 10?), just do a single sample - float smoothing = 1.0/32.0; - color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); - color = czm_gammaCorrect(color); -#else - color = czm_gammaCorrect(color); - color *= czm_gammaCorrect(v_color); -#endif + #ifdef HAS_CUSTOM_VERTEX_SHADER + czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); + customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif + // Compute the final position in each coordinate system needed. + // This returns the value that will be assigned to gl_Position. + vec4 positionClip = geometryStage(attributes, modelView, normal); -#ifdef VECTOR_TILE - color *= u_highlightColor; -#endif - out_FragColor = color; + #ifdef HAS_SILHOUETTE + silhouetteStage(attributes, positionClip); + #endif -#ifdef LOG_DEPTH - czm_writeLogDepth(); -#endif + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + float show = pointCloudShowStylingStage(attributes, metadata); + #else + float show = 1.0; + #endif -#ifdef FRAGMENT_DEPTH_CHECK - float temp = v_compressed.y; + #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING + show *= pointCloudBackFaceCullingStage(); + #endif - temp = temp * SHIFT_RIGHT1; + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); + #endif - float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; - bool enableDepthTest = temp2 != 0.0; - bool applyTranslate = floor(temp) != 0.0; + #ifdef PRIMITIVE_TYPE_POINTS + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); + #else + gl_PointSize = 1.0; + #endif - if (enableDepthTest) { - temp = v_compressed.z; - temp = temp * SHIFT_RIGHT12; + gl_PointSize *= show; + #endif - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); + gl_Position = show * positionClip; +} +`;function o6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Hn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Hn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],t3e(this)}function $Be(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:e,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}var QBe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},e3e={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},gie=[];function t3e(e){let t=e._command,n=gie;if(e._useDebugWireframe){t.pass=Ae.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=FP(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;as||o<-s&&r>-s}function tA(e,t){if(!l(t))return;let n=kp.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function l3e(e){tA(e,e._originalCommand),tA(e,e._translucentCommand),tA(e,e._skipLodBackfaceCommand),tA(e,e._skipLodStencilCommand),tA(e,e._silhouetteModelCommand),tA(e,e._silhouetteColorCommand)}function u3e(e){let t=nt.shallowClone(e);t.pass=Ae.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=mn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function f3e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function d3e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ae.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ae.TRANSLUCENT,o.depthMask=!1,o.blending=mn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function m3e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=h3e(o);if(r!==s){let a=p3e(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function h3e(e){return(e.renderState.stencilTest.reference&Bt.SKIP_LOD_MASK)>>>Bt.SKIP_LOD_BIT_SHIFT}function p3e(e){return Bt.CESIUM_3D_TILE_MASK|e< epsilonEyeDepth) - { - float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner - if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) - { - float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner - if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) - { - discard; - } - } - } - } -#endif - -} -`;var uR=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) -in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width -in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free -in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale -in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions -in vec2 sdf; // sdf outline color (rgb) and width (w) -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) -in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates -#endif -#ifdef VECTOR_TILE -in float a_batchId; -#endif + float atmosphereHeight = 0.05; + float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); + float blendRegionOffset = roughness * -1.0; + float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); + float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); + float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); + float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); + vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); + vec3 nadirColor = belowHorizonColor * 0.5; + vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); + vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); + vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); + vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); + float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; + float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); + vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); + float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); + vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); + specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); + specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -out vec2 v_textureCoordinates; -#ifdef FRAGMENT_DEPTH_CHECK -out vec4 v_textureCoordinateBounds; -out vec4 v_originTextureCoordinateAndTranslate; -out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -out mat2 v_rotationMatrix; -#endif + // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf + #ifdef USE_SUN_LUMINANCE + // Angle between sun and zenith + float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); + float S = acos(LdotZenith); + // Angle between zenith and current pixel + float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); + // Angle between sun and current pixel + float gamma = acos(NdotL); + float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); + float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); + float luminance = model_luminanceAtZenith * (numerator / denominator); + #endif -out vec4 v_pickColor; -out vec4 v_color; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; -#endif + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); + float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); + vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); + iblColor *= lightColor; -const float UPPER_BOUND = 32768.0; + #ifdef USE_SUN_LUMINANCE + iblColor *= luminance; + #endif -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; + return iblColor; +} -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + czm_pbrParameters pbrParameters +) { + vec3 diffuseColor = pbrParameters.diffuseColor; + float roughness = pbrParameters.roughness; + vec3 specularColor = pbrParameters.f0; -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) -{ - // Note the halfSize cannot be computed in JavaScript because it is sent via - // compressed vertex attributes that coerce it to an integer. - vec2 halfSize = imageSize * scale * 0.5; - halfSize *= ((direction * 2.0) - 1.0); + vec3 v = -positionEC; + vec3 n = normalEC; + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); - vec2 originTranslate = origin * abs(halfSize); + float NdotV = abs(dot(n, v)) + 0.001; + float VdotH = clamp(dot(v, h), 0.0, 1.0); -#if defined(ROTATION) || defined(ALIGNED_AXIS) - if (validAlignedAxis || rotation != 0.0) - { - float angle = rotation; - if (validAlignedAxis) - { - vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); - angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / - (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); - } + const mat3 yUpToZUp = mat3( + -1.0, 0.0, 0.0, + 0.0, 0.0, -1.0, + 0.0, 1.0, 0.0 + ); + vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); - float cosTheta = cos(angle); - float sinTheta = sin(angle); - rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); - halfSize = rotationMatrix * halfSize; - } - else - { - rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); - } -#endif + #ifdef DIFFUSE_IBL + #ifdef CUSTOM_SPHERICAL_HARMONICS + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif + #else + vec3 diffuseIrradiance = vec3(0.0); + #endif - mpp = czm_metersPerPixel(positionEC); - positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); - positionEC.xy += (translate + pixelOffset) * mpp; + #ifdef SPECULAR_IBL + vec3 r0 = specularColor.rgb; + float reflectance = max(max(r0.r, r0.g), r0.b); + vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(r0, r90, VdotH); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + #ifdef CUSTOM_SPECULAR_IBL + vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); + #else + vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); + #endif + specularIBL *= F * brdfLut.x + brdfLut.y; + #else + vec3 specularIBL = vec3(0.0); + #endif - return positionEC; + return diffuseColor * diffuseIrradiance + specularColor * specularIBL; } +#endif -#ifdef VERTEX_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) +vec3 imageBasedLightingStage( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { + #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) + // Environment maps were provided, use them for IBL + return textureIBL( + positionEC, + normalEC, + lightDirectionEC, + pbrParameters + ); + #else + // Use the procedural IBL if there are no environment maps + return proceduralIBL( + positionEC, + normalEC, + lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif +}`;var bie={name:"ImageBasedLightingPipelineStage"};bie.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,Te.FRAGMENT),o.addUniform("vec2","model_iblFactor",Te.FRAGMENT),hd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",Te.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Te.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Te.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(o.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,Te.FRAGMENT),o.addUniform("sampler2D","model_specularEnvironmentMaps",Te.FRAGMENT),o.addUniform("vec2","model_specularEnvironmentMapsSize",Te.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Te.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT)),l(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,Te.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",Te.FRAGMENT)),o.addFragmentLines(zP);let r={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=_t(r,e.uniformMap)};var HP=bie;var b3e=P.EPSILON16;function s6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(s6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,b3e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var C3e=new m,r6=new Z;s6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=C3e,o;switch(t){case $a.XROTATE:o=Z.fromRotationX(P.toRadians(n),r6),e=L.multiplyByMatrix3(e,o,e);break;case $a.YROTATE:o=Z.fromRotationY(P.toRadians(n),r6),e=L.multiplyByMatrix3(e,o,e);break;case $a.ZROTATE:o=Z.fromRotationZ(P.toRadians(n),r6),e=L.multiplyByMatrix3(e,o,e);break;case $a.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case $a.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case $a.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=L.multiplyByTranslation(e,i,e);break;case $a.XSCALE:i.x=n,i.y=1,i.z=1,e=L.multiplyByScale(e,i,e);break;case $a.YSCALE:i.x=1,i.y=n,i.z=1,e=L.multiplyByScale(e,i,e);break;case $a.ZSCALE:i.x=1,i.y=1,i.z=n,e=L.multiplyByScale(e,i,e);break;case $a.UNIFORMSCALE:e=L.multiplyByUniformScale(e,n,e);break;default:break}return e};var GP=s6;function sU(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,T3e(this)}Object.defineProperties(sU.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function T3e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; + } +} +`;var Cie={name:"ModelClippingPlanesPipelineStage"},S3e=new H;Cie.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,Te.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,Te.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,Te.FRAGMENT),cs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Te.FRAGMENT);let s=cs.getTextureResolution(i,o,S3e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Te.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Te.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",Te.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",Te.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",Te.FRAGMENT),r.addFragmentLines(qP);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=_t(a,e.uniformMap)};var YP=Cie;function Tie(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Tie.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var XP=Tie;var KP=`mat4 getInstancingTransform() +{ + mat4 instancingTransform; - vec2 translate; - translate.y = (temp - floor(temp)) * SHIFT_LEFT16; + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif - temp = compressedAttribute0.z * SHIFT_RIGHT8; - translate.x = floor(temp) - UPPER_BOUND; + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif - translate.y += (temp - floor(temp)) * SHIFT_LEFT8; - translate.y -= UPPER_BOUND; + return instancingTransform; +} - temp = compressedAttribute1.x * SHIFT_RIGHT8; - float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ + mat4 instancingTransform2D; - vec2 imageSize = vec2(floor(temp), temp2); + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif -#ifdef FRAGMENT_DEPTH_CHECK - float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); - float applyTranslate = 0.0; - if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false - { - applyTranslate = 1.0; - labelHorizontalOrigin -= 2.0; - depthOrigin.x = labelHorizontalOrigin + 1.0; - } + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif - depthOrigin = vec2(1.0) - (depthOrigin * 0.5); + return instancingTransform2D; +} #endif +`;var JP=`void instancingStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; - - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var ZP=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) +{ + vec3 positionMC = attributes.positionMC; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) - temp = compressedAttribute3.w; - temp = temp * SHIFT_RIGHT12; + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); -#endif + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var aU=new L,v3e=new L,w3e=new L,Eie={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Die,_transformsToTypedArray:c6};Eie.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(KP);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];H3e(e,n,i,f,u),j3e(e,n,i,f);let d={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,Te.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",Te.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",Te.VERTEX),d.u_instance_modifiedModelView=function(){let p=L.multiplyTransformation(s.modelMatrix,a.components.transform,aU);return u?L.multiplyTransformation(n.context.uniformState.view3D,p,aU):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,aU)),L.multiplyTransformation(n.context.uniformState.view,p,aU))},d.u_instance_nodeTransform=function(){return L.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,v3e)},r.addVertexLines(ZP)):r.addVertexLines(JP),u){r.addDefine("USE_2D_INSTANCING",void 0,Te.VERTEX),r.addUniform("mat4","u_modelView2D",Te.VERTEX);let p=n.context,g=L.fromTranslation(c.instancingReferencePoint2D,new L);d.u_modelView2D=function(){return L.multiplyTransformation(p.uniformState.view,g,w3e)}}e.uniformMap=_t(d,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,f)};var $P=new L,I3e=new m;function D3e(e,t,n,i,o){let r=L.multiplyTransformation(t,e,$P);return r=L.multiplyTransformation(r,n,$P),o=Mt.basisTo2D(i.mapProjection,r,o),o}function P3e(e,t,n,i,o){let r=L.fromTranslation(e,$P),s=L.multiplyTransformation(t,r,$P);s=L.multiplyTransformation(s,n,$P);let a=L.getTranslation(s,I3e);return o=Zi.computeActualWgs84Position(i,a,o),o}function Sie(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=L.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=L.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=L.clone(o.computedModelMatrix,t),t=L.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=L.clone(L.IDENTITY,n))}var vie=new L,wie=new L,O3e=new L,R3e=new m;function M3e(e,t,n,i){let o=vie,r=wie;Sie(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:cn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var QP=Eie;var u6={};u6.name="ModelMatrixUpdateStage";u6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Pie(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Pie(e,t,n,i){let o;i=L.multiplyTransformation(i,e.transform,new L),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=_t(o,e.uniformMap)};var oO=Nie;var Fie={name:"ClassificationPipelineStage"};Fie.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,Te.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Y3e(t,o)};function Y3e(e,t){let n=Qt.getAttributeBySemantic(e,Et.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Qt.getAttributeBySemantic(e,Et.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],g=0;for(let x=1;x 0.0; -#else - vec3 alignedAxis = vec3(0.0); - bool validAlignedAxis = false; -#endif +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ + float show = ceil(feature.color.a); + positionMC *= show; - vec4 pickColor; - vec4 color; - - temp = compressedAttribute2.y; - temp = temp * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); - - temp = compressedAttribute2.x; - temp = temp * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); - - temp = compressedAttribute2.z * SHIFT_RIGHT8; - bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; - temp = floor(temp) * SHIFT_RIGHT8; - - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor /= 255.0; - - color.a = floor(temp); - color /= 255.0; - - /////////////////////////////////////////////////////////////////////////// - - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - -#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) - float eyeDepth = positionEC.z; -#endif - - positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); - positionEC.xyz *= show; - - /////////////////////////////////////////////////////////////////////////// - -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else - { - lengthSq = dot(positionEC.xyz, positionEC.xyz); + #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) + filterByPassType(positionMC, feature.color); + #endif +} +`;var aO=`void filterByPassType(vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + if(!model_silhouettePass) { + discard; + } + #else + discard; + #endif } -#endif - -#ifdef EYE_DISTANCE_SCALING - float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); - scale *= distanceScale; - translate *= distanceScale; - // push vertex behind near plane for clipping - if (scale == 0.0) + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) { - positionEC.xyz = vec3(0.0); + discard; } -#endif +} - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency == 0.0) +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ + vec4 featureColor = feature.color; + if (featureColor.a == 0.0) { - positionEC.xyz = vec3(0.0); + discard; } -#endif -#ifdef EYE_DISTANCE_PIXEL_OFFSET - float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); - pixelOffset *= pixelOffsetScale; -#endif + // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. + // So, we only apply in in the fragment shader if the feature ID texture is used. + #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) + filterByPassType(featureColor); + #endif -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = compressedAttribute3.x; - float farSq = compressedAttribute3.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - positionEC.xyz = vec3(0.0); - } -#endif + featureColor = czm_gammaCorrect(featureColor); - mat2 rotationMatrix; - float mpp; + // Classification models compute the diffuse differently. + #ifdef HAS_CLASSIFICATION + material.diffuse = featureColor.rgb * featureColor.a; + #else + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + #endif + + material.alpha *= featureColor.a; +} +`;var Bie={name:"CPUStylingPipelineStage"};Bie.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(sO),o.addFragmentLines(aO),o.addDefine("USE_CPU_STYLING",void 0,Te.BOTH),l(i.color)||(o.addUniform("float",zg.COLOR_BLEND_UNIFORM_NAME,Te.FRAGMENT),e.uniformMap[zg.COLOR_BLEND_UNIFORM_NAME]=function(){return Za.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",Te.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ae.TRANSLUCENT}};var cO=Bie;var kie={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};kie.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Up=Object.freeze(kie);var lO=`void customShaderStage( + inout czm_modelVertexOutput vsOutput, + inout ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // VertexInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + VertexInput vsInput; + initializeInputStruct(vsInput, attributes); + vsInput.featureIds = featureIds; + vsInput.metadata = metadata; + vsInput.metadataClass = metadataClass; + vsInput.metadataStatistics = metadataStatistics; + vertexMain(vsInput, vsOutput); + attributes.positionMC = vsOutput.positionMC; +} +`;var uO=`void customShaderStage( + inout czm_modelMaterial material, + ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // FragmentInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + FragmentInput fsInput; + initializeInputStruct(fsInput, attributes); + fsInput.featureIds = featureIds; + fsInput.metadata = metadata; + fsInput.metadataClass = metadataClass; + fsInput.metadataStatistics = metadataStatistics; + fragmentMain(fsInput, material); +} +`;var fO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); +} +`;var dO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); + setFeatureIdVaryings(); +} +`;var Fi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Fi.process=function(e,t,n){let i=e.shaderBuilder;X3e(i);let o=e.runtimeNode.node.instances;l(o)&&K3e(e,o,n),J3e(e,t,n),i.addVertexLines(dO),i.addFragmentLines(fO)};function X3e(e){e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_VS,Fi.STRUCT_NAME_FEATURE_IDS,Te.VERTEX),e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_FS,Fi.STRUCT_NAME_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Fi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Te.VERTEX)}function K3e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;rike(i,t,n)):[]}function ike(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;frke(n,t)):[]}function rke(e,t){let{sanitizeGlslIdentifier:n}=Qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;af),n.addStructField(Ai.STRUCT_ID_METADATA_FS,r,o);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),x=Wie({valueExpression:h,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:Te.FRAGMENT,property:s}),b=`metadata.${o} = ${x};`;n.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,[b])}function zie(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Gie(Ai.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ai.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,s),Te.includesVertexShader(r)&&(e.addStructField(Ai.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Hie(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===qt.ENUM)return;let s=Ai.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Gie(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ai.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,c),Te.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ai.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Gie(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Wie(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var of=Ai;var hke={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Gg=Object.freeze(hke);var $r={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Nt};$r.process=function(e,t,n){let i=e.model.customShader;if(i&&$r.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=Hh.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&$r.process_original(e,t,n,o[r])}};$r.process_original=function(e,t,n,i){let o=e.shaderBuilder;l(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let r=e.alphaOptions;i.translucencyMode===Gg.TRANSLUCENT?r.pass=Ae.TRANSLUCENT:i.translucencyMode===Gg.OPAQUE&&(r.pass=void 0);let s=Tke(i,t);if(!s.customShaderEnabled)return;if(vke(o,i,s),s.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Te.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Te.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Te.FRAGMENT);let u=Up.getDefineName(i.mode);o.addDefine(u,void 0,Te.FRAGMENT)}let a=i.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];o.addUniform(f.type,u)}let c=i.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];o.addVarying(f,u)}e.uniformMap=_t(e.uniformMap,i.uniformMap)};function pke(e){let t={};for(let n=0;n 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = 1.0; -#endif - } - } -#endif - -#ifdef FRAGMENT_DEPTH_CHECK - if (sizeInMeters) { - translate /= mpp; - dimensions /= mpp; - imageSize /= mpp; - } - -#if defined(ROTATION) || defined(ALIGNED_AXIS) - v_rotationMatrix = rotationMatrix; -#else - v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); -#endif - - float enableDepthCheck = 0.0; - if (lengthSq < disableDepthTestDistance) - { - enableDepthCheck = 1.0; - } - - float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); - float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); - - float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); - float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); - - v_compressed.x = eyeDepth; - v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; - v_compressed.z = dw * SHIFT_LEFT12 + dh; - v_compressed.w = iw * SHIFT_LEFT12 + ih; - v_originTextureCoordinateAndTranslate.xy = depthOrigin; - v_originTextureCoordinateAndTranslate.zw = translate; - v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; - -#endif - -#ifdef SDF - vec4 outlineColor; - float outlineWidth; - - temp = sdf.x; - temp = temp * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); + #ifdef HAS_NORMALS + v_normalEC = normalize(normal * attributes.normalMC); + #endif - temp = sdf.y; - temp = temp * SHIFT_RIGHT8; - float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.a = floor(temp); - outlineColor /= 255.0; + #ifdef HAS_TANGENTS + v_tangentEC = normalize(normal * attributes.tangentMC); + #endif - v_outlineWidth = outlineWidth / 255.0; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency; -#endif + #ifdef HAS_BITANGENTS + v_bitangentEC = normalize(normal * attributes.bitangentMC); + #endif - v_pickColor = pickColor; + // All other varyings need to be dynamically generated in + // GeometryPipelineStage + setDynamicVaryings(attributes); + + return computedPosition; +} +`;var rA=`vec2 computeSt(float featureId) +{ + float stepX = model_textureStep.x; + float centerX = model_textureStep.y; - v_color = color; - v_color.a *= translucency; + #ifdef MULTILINE_BATCH_TEXTURE + float stepY = model_textureStep.z; + float centerY = model_textureStep.w; + float xId = mod(featureId, model_textureDimensions.x); + float yId = floor(featureId / model_textureDimensions.x); + + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); + #else + return vec2(centerX + (featureId * stepX), 0.5); + #endif } -`;function Ei(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Lt.clone(n)),l(i)&&(i=Lt.clone(i)),l(r)&&(r=Lt.clone(r)),l(o)&&(o=Dt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Mn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,_i.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Wn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var qre=Ei.SHOW_INDEX=0,fV=Ei.POSITION_INDEX=1,Qre=Ei.PIXEL_OFFSET_INDEX=2,zze=Ei.EYE_OFFSET_INDEX=3,Hze=Ei.HORIZONTAL_ORIGIN_INDEX=4,Gze=Ei.VERTICAL_ORIGIN_INDEX=5,Wze=Ei.SCALE_INDEX=6,dV=Ei.IMAGE_INDEX_INDEX=7,Xre=Ei.COLOR_INDEX=8,jze=Ei.ROTATION_INDEX=9,Yze=Ei.ALIGNED_AXIS_INDEX=10,qze=Ei.SCALE_BY_DISTANCE_INDEX=11,Xze=Ei.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Kze=Ei.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Jze=Ei.DISTANCE_DISPLAY_CONDITION=14,Zze=Ei.DISABLE_DEPTH_DISTANCE=15;Ei.TEXTURE_COORDINATE_BOUNDS=16;var Kre=Ei.SDF_INDEX=17;Ei.NUMBER_OF_PROPERTIES=18;function Vr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ei.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Vr(this,qre))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),Vr(this,fV))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Vr(this,fV))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),Vr(this,Qre))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Lt.equals(t,e)||(this._scaleByDistance=Lt.clone(e,t),Vr(this,qze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Lt.equals(t,e)||(this._translucencyByDistance=Lt.clone(e,t),Vr(this,Xze))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Lt.equals(t,e)||(this._pixelOffsetScaleByDistance=Lt.clone(e,t),Vr(this,Kze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),Vr(this,zze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Vr(this,Hze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Vr(this,Gze))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Vr(this,Wze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Vr(this,Xre))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Vr(this,jze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),Vr(this,Yze))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Vr(this,dV))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Vr(this,dV))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Vr(this,Xre))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Vr(this,Jze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Vr(this,Zze))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof ve?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Wn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Vr(this,dV))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),Vr(this,fV)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Vr(this,qre))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Vr(this,Kre))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Vr(this,Kre))}}});Ei.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ei.prototype._updateClamping=function(){Ei._updateClamping(this._billboardCollection,this)};var fR=new he,Jre=new m;Ei._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,r=i.ellipsoid,o=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===qe.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!l(t._position))return;let c=r.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===qe.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=r.cartesianToCartographic(d,fR);p.height+=c.height,r.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=o.updateHeight(c,u),he.clone(c,fR);let f=i.getHeight(c);l(f)&&(fR.height=f),r.cartographicToCartesian(fR,Jre),u(Jre)};Ei.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,r,o=this;function s(a){if(o._imageId!==t||o._image!==n||!Ke.equals(o._imageSubRegion,i))return;let c=e.textureCoordinates[a];o._imageWidth=e.texture.width*c.width,o._imageHeight=e.texture.height*c.height,o._imageIndex=a,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,Vr(o,dV)}if(l(n)){let a=e.getImageIndex(t);if(l(a)){s(a);return}r=e.addImage(t,n)}l(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,l(r)&&r.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),o._imageIndexPromise=void 0})};Ei.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ei.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ei.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),Vr(this,Qre))};Ei.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ei.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),Vr(this,fV)};var Zre=new oe;Ei._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(B.multiplyByPoint(i,t,Zre),Xi.computeActualWgs84Position(n,Zre))};var $re=new m;Ei._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=B.multiplyByPoint(e,t,$re),a=Xi.wgs84WithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return H.add(a,i,a),a};var uV=new H(0,0);Ei.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new H),H.clone(this._pixelOffset,uV),H.add(uV,this._translate,uV);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,fR);r=a.cartographicToCartesian(c,$re),i=B.IDENTITY}return Ei._computeScreenSpacePosition(i,r,this._eyeOffset,uV,e,t)};Ei.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===_i.RIGHT?s-=i:e.horizontalOrigin===_i.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?a-=r:e.verticalOrigin===Mn.CENTER&&(a-=r*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=r,n};Ei.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Lt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Ei.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var fr=Ei;var Qze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Er=Object.freeze(Qze);var $ze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},vs=Object.freeze($ze);function Hp(e,t,n,i,r){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}var eHe=new H(16,16);function jg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,eHe);this._context=e.context,this._pixelFormat=y(e.pixelFormat,at.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Wn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(jg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Bt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function tHe(e,t){let n=e._context,i=e.numberOfImages,r=2,o=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=r*(s+t.width+o),u=r*(a+t.height+o),f=s/c,d=a/u,p=new Hp(new H(s+o,o),new H(c,a)),g=new Hp(new H,new H(c,a),e._root,p),h=new Hp(new H(o,a+o),new H(c,u)),A=new Hp(new H,new H(c,u),g,h);for(let T=0;Ts){t.childNode1=new Hp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(r._labelDimensions))g=r._labelDimensions.x,p=r._labelDimensions.y;else{let C=0,T=0,E=r._imageIndex;if(E!==-1){let w=n[E];C=w.height,T=w.width}p=Math.round(y(r.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(r.width,S*T))}let h=Math.floor(P.clamp(g,0,C6)),A=Math.floor(P.clamp(p,0,C6)),x=h*C6+A;e._instanced?(o=r._index,s(o,a,c,f,x)):(o=r._index*4,s(o+0,a,c,f,x),s(o+1,a,c,f,x),s(o+2,a,c,f,x),s(o+3,a,c,f,x))}function Toe(e,t,n,i,r){if(r.heightReference===qe.CLAMP_TO_GROUND){let h=e._scene,A=t.context,x=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=A.depthTexture&&!x&&C}let o,s=i[xr.textureCoordinateBoundsOrLabelTranslate];if(Ht.maximumVertexTextureImageUnits>0){let h=0,A=0;l(r._labelTranslate)&&(h=r._labelTranslate.x,A=r._labelTranslate.y),e._instanced?(o=r._index,s(o,h,A,0,0)):(o=r._index*4,s(o+0,h,A,0,0),s(o+1,h,A,0,0),s(o+2,h,A,0,0),s(o+3,h,A,0,0));return}let a=0,c=0,u=0,f=0,d=r._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,u=h.width,f=h.height}let p=a+u,g=c+f;e._instanced?(o=r._index,s(o,a,c,p,g)):(o=r._index*4,s(o+0,a,c,p,g),s(o+1,a,c,p,g),s(o+2,a,c,p,g),s(o+3,a,c,p,g))}function xHe(e,t,n,i,r){if(!l(e._batchTable))return;let o=i[xr.a_batchId],s=r._batchIndex,a;e._instanced?(a=r._index,o(a,s)):(a=r._index*4,o(a+0,s),o(a+1,s),o(a+2,s),o(a+3,s))}function Eoe(e,t,n,i,r){if(!e._sdf)return;let o,s=i[xr.sdf],a=r.outlineColor,c=r.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*lE+f*Km+d,g=c/vs.RADIUS,h=z.floatToByte(a.alpha)*lE+z.floatToByte(g)*Km;e._instanced?(o=r._index,s(o,p,h)):(o=r._index*4,s(o+0,p+moe,h),s(o+1,p+hoe,h),s(o+2,p+poe,h),s(o+3,p+_oe,h))}function CHe(e,t,n,i,r){foe(e,t,n,i,r),goe(e,t,n,i,r),yoe(e,t,n,i,r),E6(e,t,n,i,r),b6(e,t,n,i,r),Aoe(e,t,n,i,r),xoe(e,t,n,i,r),Coe(e,t,n,i,r),Toe(e,t,n,i,r),xHe(e,t,n,i,r),Eoe(e,t,n,i,r)}function T6(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=pHe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let O=0;O0){let O=SHe;O.length=0,(c[mR]||c[sHe]||c[oHe])&&O.push(foe),(c[dR]||c[noe]||c[iHe]||c[rHe]||c[nHe])&&(O.push(goe),this._instanced&&O.push(b6)),(c[dR]||c[aHe]||c[soe])&&(O.push(yoe),O.push(E6)),(c[dR]||c[roe])&&O.push(E6),c[ioe]&&O.push(b6),c[ooe]&&O.push(Aoe),c[aoe]&&O.push(xoe),(c[coe]||c[cHe]||c[dR]||c[mR])&&O.push(Coe),(c[dR]||c[mR])&&O.push(Toe),c[loe]&&O.push(Eoe);let L=O.length;if(d=this._vaf.writers,a/n>.1){for(let N=0;Nn*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,A=B.IDENTITY;e.mode===ne.SCENE3D?(A=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),EHe(this,e,h);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===Er.OPAQUE||this._blendOption===Er.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let O=this._blendOption===Er.TRANSLUCENT;this._blendOption===Er.TRANSLUCENT||this._blendOption===Er.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:O?te.LEQUAL:te.LESS},depthMask:O,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,T,E,S,w,D=Ht.maximumVertexTextureImageUnits>0;if(x||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=uR,T=lR,w=[],l(this._batchTable)&&(w.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),E=new He({defines:w,sources:[C]}),this._instanced&&E.defines.push("INSTANCED"),this._shaderRotation&&E.defines.push("ROTATION"),this._shaderAlignedAxis&&E.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&E.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&E.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&E.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&E.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&E.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK"));let O=1-vs.CUTOFF;this._sdf&&E.defines.push("SDF");let L=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Er.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Zt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:xr}),S=new He({defines:["TRANSLUCENT",L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Zt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:xr})),this._blendOption===Er.OPAQUE&&(S=new He({defines:[L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Zt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:xr})),this._blendOption===Er.TRANSLUCENT&&(S=new He({defines:[L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Zt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:xr})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let R=e.commandList;if(p.render||p.pick){let O=this._colorCommands,L=this._blendOption===Er.OPAQUE,N=this._blendOption===Er.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,b=_.length,v=this._uniforms,I;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),I=this._batchTable.getPickId()):I="v_pickColor",O.length=b;let M=N?b*2:b;for(let F=0;F0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,wHe);i.height=i.height-t+e;let r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&uE(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ea.defaultColor=z.WHITE;ea.defaultPointOutlineColor=z.BLACK;ea.defaultPointOutlineWidth=0;ea.defaultPointSize=8;function uE(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ea.defaultColor),i=y(e._pointOutlineColor,ea.defaultPointOutlineColor),r=y(e._pointOutlineWidth,ea.defaultPointOutlineWidth),o=y(e._pointSize,ea.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,GA(f,d,p,r,o))}ea.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ea.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ea.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ea.prototype.getPropertyInherited=function(e){return Ts.getPropertyInherited(this._content,this._batchId,e)};ea.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ea.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ea.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ea.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Gp=ea;function DHe(e,t,n,i,r){let o=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=o.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),r&&(g.fillStyle="black",g.fillText(t,u/2,p));let h=g.getImageData(0,0,f,d).data,A=h.length,x=f*4,C,T,E,S;for(C=0;C=0;--C)if(h[C]!==255){S=C/x|0;break}let w=-1;for(C=0;C]/,r=[],o="",s=$o.LTR,a="",c=e.length;for(let u=0;u";case">":return"<"}}var kHe="\u05D0-\u05EA",zHe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Roe=new RegExp(`[${kHe}${zHe}]`);function HHe(e){let t=e.split(` -`),n="";for(let i=0;iu+1?s[u+1].Type===$o.RTL?(c=d+c,a=0):(c=gR(c,a,f.Word),a+=f.Word.length):c=gR(c,0,d)):f.Type===$o.RTL?c=gR(c,a,d):f.Type===$o.LTR?(c+=f.Word,a=c.length):(f.Type===$o.WEAK||f.Type===$o.BRACKETS)&&(u>0&&s[u-1].Type===$o.RTL?s.length>u+1?s[u+1].Type===$o.RTL?c=gR(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:Uoe,imageSubRegion:qHe}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=_i.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u0&&E.height>0){let S=(0,Noe.default)(E,{cutoff:vs.CUTOFF,radius:vs.RADIUS}),w=E.getContext("2d"),D=E.width,R=E.height,O=w.getImageData(0,0,D,R);for(let L=0;L0?T=E.pop():(T=e._billboardCollection.add({collection:e}),T._labelDimensions=new H,T._labelTranslate=new H),a.billboard=T),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=_i.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.image=x,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===kr.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===kr.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===kr.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Loe(e,t,n){return t===_i.CENTER?-e/2:t===_i.RIGHT?-(e+n.x):n.x}var ro=new H,$He=new H;function eGe(e){let t=e._glyphs,n=e._renderedText,i,r,o=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(l(g)?e._backgroundPadding:H.ZERO,$He);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d0&&(C===_i.CENTER?w=-s/2-h.x:C===_i.RIGHT?w=-(s+h.x*2):w=0,ro.x=w*x,T===Mn.TOP?ro.y=A-u-c:T===Mn.CENTER?ro.y=(A-u)/2-c:T===Mn.BASELINE?ro.y=-h.y-c:ro.y=0,ro.y=ro.y*x,g.width=O,g.height=L,g._setTranslate(ro),g._labelTranslate=H.clone(ro,g._labelTranslate)),e.heightReference===qe.CLAMP_TO_GROUND)for(d=0;d0?Er.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Jm.prototype.isDestroyed=function(){return!1};Jm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var Zm=Jm;var yR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; - -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +{ + int featureId = featureIds.SELECTED_FEATURE_ID; - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; - if (width < 1.0) + if (featureId < model_featuresLength) { - show = 0.0; - } - - vec4 pickColor = batchTable_getPickColor(batchTableIndex); + vec2 featureSt = computeSt(float(featureId)); - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); + feature.id = featureId; + feature.st = featureSt; + feature.color = texture(model_batchTexture, featureSt); } + // Floating point comparisons can be unreliable in GLSL, so we + // increment the feature ID to make sure it's always greater + // then the model_featuresLength - a condition we check for in the + // pick ID, to avoid sampling the pick texture if the feature ID is + // greater than the number of features. else { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); + feature.id = model_featuresLength + 1; + feature.st = vec2(0.0); + feature.color = vec4(1.0); } - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); + #ifdef HAS_NULL_FEATURE_ID + if (featureId == model_nullFeatureId) { + feature.id = featureId; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + #endif +} +`;var bO={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};bO.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=Oke(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),Rke(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===Te.BOTH&&i.addVertexLines(rA),i.addFragmentLines(rA)};function Xie(e){return e instanceof Ft.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Kie(e){return e instanceof Ft.FeatureIdTexture?Te.FRAGMENT:Te.BOTH}function Oke(e,t,n){let i,o;return l(t.instances)&&(o=Qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Kie(o),featureIdDefine:Xie(o)}):(o=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Kie(o),featureIdDefine:Xie(o)})}function Rke(e){e.addStructField(bO.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(bO.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(bO.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Wg=bO;var Ss={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ss.process=function(e,t,n){let i=e.shaderBuilder,o=e.model;i.addStruct(Ss.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Te.VERTEX),i.addStruct(Ss.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Te.FRAGMENT),i.addStruct(Wg.STRUCT_ID_SELECTED_FEATURE,Wg.STRUCT_NAME_SELECTED_FEATURE,Te.BOTH),i.addFunction(Ss.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ss.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Te.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ss.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ss.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ss.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ss.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.VERTEX),i.addFunction(Ss.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ss.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.FRAGMENT),o.type===Bo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Te.FRAGMENT);let s=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,u=t.attributes.length;for(let f=0;f1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,Mke(e,d,h,p,s,a)}Hke(i,t.attributes),t.primitiveType===Fe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(xO),i.addFragmentLines(yO)};function Mke(e,t,n,i,o,r){let s=e.shaderBuilder,a=Qt.getAttributeInfo(t),c=o&&!r;i>1?Fke(e,t,n,i):Nke(e,t,n,c),kke(s,a,c),Bke(s,a),l(t.semantic)&&Lke(s,t),Uke(s,a,o),Vke(s,a,c),zke(s,a)}function Lke(e,t){let n=t.semantic,i=t.setIndex;switch(n){case Et.NORMAL:e.addDefine("HAS_NORMALS");break;case Et.TANGENT:e.addDefine("HAS_TANGENTS");break;case Et.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Et.TEXCOORD:case Et.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Nke(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===Et.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===Et.POSITION,f=u?0:n,d=cn.getNumberOfComponents(r),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function Fke(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.normalized,u=cn.getNumberOfComponents(r)/i,f=X.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g farSq) - { - show = 0.0; - } + #ifdef USE_IBL_LIGHTING + color += imageBasedLightingStage( + attributes.positionEC, + inputMaterial.normalEC, + czm_lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif #endif - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; + color *= inputMaterial.occlusion; + color += inputMaterial.emissive; - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + // In HDR mode, the frame buffer is in linear color space. The + // post-processing stages (see PostProcessStageCollection) will handle + // tonemapping. However, if HDR is not enabled, we must tonemap else large + // values may be clamped to 1.0 + #ifndef HDR + color = czm_acesTonemapping(color); + #endif - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; + return color; } -`;var Uc={};Uc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};Uc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var tGe=new he;Uc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r0){t=y(t,B.IDENTITY);let r=B.inverseTransformation(t,nGe),o=B.multiplyByPoint(r,m.ZERO,iGe),s=m.normalize(B.multiplyByPointAsVector(r,m.UNIT_Y,koe),koe),a=fn.fromPointNormal(o,s,rGe),c=m.normalize(B.multiplyByPointAsVector(r,m.UNIT_X,zoe),zoe),u=fn.fromPointNormal(o,c,oGe),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=B.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Di.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(joe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Woe=ru.POSITION_INDEX=0,dGe=ru.SHOW_INDEX=1,mGe=ru.WIDTH_INDEX=2,hGe=ru.MATERIAL_INDEX=3,xR=ru.POSITION_SIZE_INDEX=4,pGe=ru.DISTANCE_DISPLAY_CONDITION=5,joe=ru.NUMBER_OF_PROPERTIES=6;function jp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(ru.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,jp(this,dGe))}},positions:{get:function(){return this._positions},set:function(e){let t=Ar(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&jp(this,xR),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),jp(this,Woe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,jp(this,hGe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,jp(this,mGe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,jp(this,xR)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),jp(this,pGe))}}});ru.prototype.update=function(){let e=B.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Woe]>0||this._propertiesChanged[xR]>0;if((!B.equals(e,this._modelMatrix)||i)&&(this._segments=Di.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=B.clone(e,this._modelMatrix),this._segments.positions.length!==t)jp(this,xR);else{let r=n.length;for(let o=0;o2){if(r[M6]||r[Yoe]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,A=jn.fromCartesian(h.center,ese),x=oe.fromElements(A.low.x,A.low.y,A.low.z,h.radius,tse);this._batchTable.setBatchedAttribute(i._index,2,A.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(r[AGe]){let h=nse;h.x=0,h.y=Number.MAX_VALUE;let A=i.distanceDisplayCondition;l(A)&&(h.x=A.near,h.y=A.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<$oe;++c)r[c]=0;let o=B.IDENTITY;e.mode===ne.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:mn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;CGe(this,e,c,o)}};var CR=new ae,qoe=new ae;function CGe(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let h=0;h0){let G=L.isTranslucent();a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,b=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(CR,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?Se.TRANSLUCENT:Se.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=N,_.offset=S,S+=N,N=0,c=!0,o.push(_)}L=I._material,L.update(r),O=M}let F=I._locatorBuckets,k=F.length;for(let G=0;G0&&(a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,b=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(CR,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?Se.TRANSLUCENT:Se.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=N,_.offset=S,c=!0,o.push(_)),O=void 0}}n.length=a}Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){return ise(this),L6(this),rse(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function TGe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[M6]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var Xoe=[0,0,0];function Koe(e,t,n){e._createVertexArray=!1,L6(e),ise(e),SGe(e);let i=[[]],r=i[0],o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,A=new Float32Array(6*f*3),x=new Float32Array(f*4),C,T=0,E=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(A,x,T,E,S,o,t,n),h===ne.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,T));let b=g.lengthOfPositions;T+=6*b*3,E+=b*4,S+=b*4,c=g.updateIndices(i,a,u,c)}let w=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=mt.createVertexBuffer({context:t,typedArray:A,usage:w});let R;l(C)&&(R=mt.createVertexBuffer({context:t,typedArray:C,usage:w})),e._texCoordExpandAndBatchIndexBuffer=mt.createVertexBuffer({context:t,typedArray:x,usage:D});let O=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let b=0;b<_;++b)if(r=i[b],r.length>0){let v=new Uint16Array(r),I=mt.createIndexBuffer({context:t,typedArray:v,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});N+=a[b];let M=6*(b*(O*P.SIXTY_FOUR_KILOBYTES)-N*O),F=O+M,k=O+F,V=O+k,G=O+V,U=O+G,q=b*(L*P.SIXTY_FOUR_KILOBYTES)-N*L,Y=[{index:xl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:xl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:xl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:xl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:xl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:xl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:xl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:xl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:xl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:xl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:xl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:xl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:xl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],Q,W,K,J;h===ne.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",K=Xoe,J="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(W=Xoe,Q="value",K=e._positionBuffer,J="vertexBuffer"):(W=R,Q="vertexBuffer",K=e._positionBuffer,J="vertexBuffer"),Y[0][Q]=W,Y[1][Q]=W,Y[2][J]=K,Y[3][J]=K,Y[4][Q]=W,Y[5][Q]=W,Y[6][J]=K,Y[7][J]=K,Y[8][Q]=W,Y[9][Q]=W,Y[10][J]=K,Y[11][J]=K;let me=new oi({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[b]})}}}function EGe(e,t){return t instanceof Bt?t.id:t}var gV=[];function bGe(e){let t=ki._uniformList[e.type],n=t.length;gV.length=2*n;let i=0;for(let r=0;r1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Qm(c,t,n)),u.addPolyline(a)}}}function vGe(e,t){let n=t.mode;(e._mode!==n||!B.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=B.clone(e.modelMatrix),e._createVertexArray=!0)}function B6(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s0,x=g._index,C=this.getSegments(g,a),T=C.positions,E=C.lengths,S=T.length,w=g.getPickId(s).color,D=0,R=0,O;for(let k=0;k0||as.x>0&&ff.x<0)&&m.clone(as,ff),(as.x<0&&df.x>0||as.x>0&&df.x<0)&&m.clone(as,df));let q=G?2:0,Y=U?2:4;for(let Q=q;Q2&&(o.setBatchedAttribute(x,2,v),o.setBatchedAttribute(x,3,I),o.setBatchedAttribute(x,4,M))}};var IGe=new m,PGe=new m,OGe=new m,Joe=new m;Qm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d0)g[0]=A;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let A=0;for(let x=0;xP.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:A}),A=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new R6(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),A+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:A}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new R6(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};Qm.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r0){e._boundingVolume2D=ae.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(u.z,u.x,u.y)}return fE.positions=r,fE.lengths=e._segments.lengths,fE};var Qoe;Qm.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Qoe,c=6*s*3;!l(a)||a.lengthc&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,h=0,A;s=f.length;for(let x=0;x0||as.x>0&&ff.x<0)&&m.clone(as,ff),(as.x<0&&df.x>0||as.x>0&&df.x<0)&&m.clone(as,df));let S=T?2:0,w=E?2:4;for(let D=S;D{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g{e.isDestroyed()||(e._error=a)})}Kg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),A=h[0];qGe(e,h),e._indices=Ue.getSizeInBytes(A)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),ZGe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function ZGe(e){l(e._primitive)||(e._primitive=new yA({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Yp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Yp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Yp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Yp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Yp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=JGe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Yp.prototype.isDestroyed=function(){return!1};Yp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var SR=Yp;var vR=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; +#endif -void main() +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) { - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; + // Even though the lighting will only set the diffuse color, + // pass all other properties so further stages have access to them. + vec3 color = vec3(0.0); - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; + #ifdef LIGHTING_PBR + color = computePbrLighting(material, attributes); + #else // unlit + color = material.diffuse; + #endif - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + // The colors resulting from point cloud styles are adjusted differently. + color = czm_gammaCorrect(color); + #elif !defined(HDR) + // If HDR is not enabled, the frame buffer stores sRGB colors rather than + // linear colors so the linear value must be converted. + color = czm_linearToSrgb(color); + #endif + + material.diffuse = color; } -`;function Bd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Bd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function QGe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var $Ge=new pi("createVectorTilePolylines",5),dE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function e8e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=QGe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=$Ge.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),t8e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function t8e(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=mt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=mt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),d=mt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),h=mt.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),A=[{index:dE.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:dE.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:dE.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:dE.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:dE.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:A,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var wR=new B,sse=new m;function n8e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,wR),B.multiplyByPoint(wR,e._center,sse),B.setTranslation(wR,sse,wR),wR},u_highlightColor:function(){return e._highlightColor}})}function i8e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:mn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var r8e=`uniform vec4 u_highlightColor; -void main() +`;var Gke={UNLIT:0,PBR:1},qm=Object.freeze(Gke);var Jie={name:"LightingPipelineStage"};Jie.process=function(e,t){let n=e.model,i=e.lightingOptions,o=e.shaderBuilder;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Te.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",Te.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===qm.PBR?o.addDefine("LIGHTING_PBR",void 0,Te.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,Te.FRAGMENT),o.addFragmentLines(TO)};var AO=Jie;var EO=`// If the style color is white, it implies the feature has not been styled. +bool isDefaultStyleColor(vec3 color) { - out_FragColor = u_highlightColor; + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } -`;function o8e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(vR),r=n.getFragmentShaderCallback(!1,void 0,!1)(r8e),o=new He({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Zl,i]}),s=new He({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:dE})}function s8e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Se.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Bd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); + vec4 baseColorWithAlpha = vec4(1.0); + // Regardless of whether we use PBR, set a base color + #ifdef HAS_BASE_COLOR_TEXTURE + vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); + #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM + baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); + #endif - gl_Position = czm_depthClamp(czm_projection * position); + baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); + #ifdef HAS_BASE_COLOR_FACTOR + baseColorWithAlpha *= u_baseColorFactor; + #endif + #elif defined(HAS_BASE_COLOR_FACTOR) + baseColorWithAlpha = u_baseColorFactor; + #endif - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; -} -`;var IR=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + baseColorWithAlpha = v_pointCloudColor; + #elif defined(HAS_COLOR_0) + vec4 color = attributes.color_0; + // .pnts files store colors in the sRGB color space + #ifdef HAS_SRGB_COLOR + color = czm_srgbToLinear(color); + #endif + baseColorWithAlpha *= color; + #endif -uniform vec4 u_highlightColor; -void main() -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + material.diffuse = baseColorWithAlpha.rgb; + material.alpha = baseColorWithAlpha.a; - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } + #ifdef USE_CPU_STYLING + material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); + #endif - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; + #ifdef HAS_OCCLUSION_TEXTURE + vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; + #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM + occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + #endif + material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; + #endif - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); + #ifdef HAS_EMISSIVE_TEXTURE + vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; + #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM + emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #endif - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); + #ifdef HAS_EMISSIVE_FACTOR + emissive *= u_emissiveFactor; + #endif + material.emissive = emissive; + #elif defined(HAS_EMISSIVE_FACTOR) + material.emissive = u_emissiveFactor; + #endif - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE + vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM + specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); + #endif - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); + vec3 specular = specularGlossiness.rgb; + float glossiness = specularGlossiness.a; + #ifdef HAS_SPECULAR_FACTOR + specular *= u_specularFactor; + #endif - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; - - czm_writeDepthClamp(); -} -`;function qp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight),this._boundingVolume=Bn.fromRectangle(e.rectangle,si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function f8e(e,t,n){let i=si.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;Bn.fromRectangle(c,r,o,n,a)}function d8e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var m8e=new pi("createVectorTileClampedPolylines"),Jg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function h8e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=d8e(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=m8e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),p8e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function p8e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=mt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),h=mt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),A=mt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),x=mt.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),C=mt.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),T=mt.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),E=[{index:Jg.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Jg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Jg.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Jg.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Jg.startFaceNormalAndVertexCorner,vertexBuffer:A,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Jg.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Jg.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:E,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var PR=new B,ase=new m;function _8e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,PR),B.multiplyByPoint(PR,e._center,ase),B.setTranslation(PR,ase,PR),PR},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function cse(e){return ze.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function g8e(e){l(e._rs)||(e._rs=cse(!1),e._rs3DTiles=cse(!0))}function y8e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(DR),r=n.getFragmentShaderCallback(!1,void 0,!0)(IR),o=new He({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Zl,i]}),s=new He({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Jg})}function A8e(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Se.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=nt.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Hn.TERRAIN||i===Hn.BOTH)&&t.commandList.push(n),(i===Hn.CESIUM_3D_TILE||i===Hn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}qp.prototype.getPositions=function(e){return qA.getPolylinePositions(this,e)};qp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r{e.isDestroyed()||(e._error=t)})}qp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=b8e(this).then(h8e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}_8e(this,t),y8e(this,t),g8e(this);let n=e.passes;(n.render||n.pick)&&A8e(this,e)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var OR=qp;var F6=32767,S8e=new he,v8e=new m;function w8e(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);Yn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f{this._resolveContent=o}),R8e(this,i,r)}Object.defineProperties($m.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function D8e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function I8e(e,t){let n,i,r,o,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o0)for(i=new Uint16Array(a),o=0;o0)for(r=new Uint16Array(c),o=0;o0&&(C=Ir(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let E=y(A.POLYGONS_LENGTH,0),S=y(A.POLYLINES_LENGTH,0),w=y(A.POINTS_LENGTH,0),D=E+S+w,R=new xp(e,D,C,T,D8e(e));if(e._batchTable=R,D===0)return;let O=new wd(A,x),L=O.getGlobalProperty("REGION");if(!l(L))throw new de("Feature table global property: REGION must be defined");let N=ce.unpack(L),_=L[4],b=L[5],v=e._tile.computedTransform,I=O.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=m.unpack(I),B.multiplyByPoint(v,I,I)):(I=ce.center(N),I.height=P.lerp(_,b,.5),I=re.WGS84.cartographicToCartesian(I));let M=I8e(A,x);if(n+=(4-n%4)%4,E>0){O.featuresLength=E;let F=y(O.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(F))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=y(O.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(k))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=F.reduce(function(W,K){return W+K*2},0),G=k.reduce(function(W,K){return W+K},0),U=new Uint32Array(t,n,G);n+=d;let q=new Uint16Array(t,n,V);n+=p;let Y,Q;l(A.POLYGON_MINIMUM_HEIGHTS)&&l(A.POLYGON_MAXIMUM_HEIGHTS)&&(Y=O.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),Q=O.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new SR({positions:q,counts:F,indexCounts:k,indices:U,minimumHeight:_,maximumHeight:b,polygonMinimumHeights:Y,polygonMaximumHeights:Q,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,batchIds:M.polygons,modelMatrix:v})}if(S>0){O.featuresLength=S;let F=y(O.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(F))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=O.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(k)){k=new Uint16Array(S);for(let Q=0;Q0){let F=new Uint16Array(t,n,w*3);n+=h,e._points=new bR({positions:F,batchIds:M.points,minimumHeight:_,maximumHeight:b,rectangle:N,batchTable:R})}}function U6(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}$m.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};$m.prototype.getFeature=function(e){return l(this._features)||U6(this),this._features[e]};$m.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};$m.prototype.applyStyle=function(e){l(this._features)||U6(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};$m.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||U6(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};$m.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};$m.prototype.isDestroyed=function(){return!1};$m.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function M8e(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c=0?i[o]:void 0}var JA=N8e;function Zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Zp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Zp.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};Zp.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};Zp.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};Zp.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};Zp.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var LR=Zp;function k6(e,t){let n=ti(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){k6._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new LR({tile:n,class:r})}}k6._oneTimeWarning=Rt;var NR=k6;function F8e(e){let t=new Uint8Array(e),n=yd(t);if(n==="glTF"&&(n="glb"),cs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=U8e(t);if(l(i.root))return{contentType:cs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:cs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:cs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:cs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:cs.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function U8e(e){let t;try{t=Ir(e)}catch{throw new de("Invalid tile content.")}return t}var eh=F8e;function Fd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let r=l(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let s=0;sH8e(e,o,s)),r=await Promise.all(i);return e._contentsCreated=!0,e._contents=r.filter(l),r}async function H8e(e,t,n){if(l(t))try{let i=eh(t);if(i.contentType===cs.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===cs.GEOMETRY||i.contentType===cs.VECTOR;let r=e._tileset,o=e._innerContentResources[n],s=e._tile,a,c=XA[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=KA(r,u));let f=JA(r,u);return l(f)&&(a.group=new hA({metadata:f})),a}catch(i){fse(e,n,i)}}function fse(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}Fd.prototype.cancelRequests=function(){for(let e=0;e0?Xo.COUNTER_CLOCKWISE:Xo.CLOCKWISE};Zg.triangulate=function(e,t){let n=H.packArray(e);return(0,xse.default)(n,t,2)};var Cse=new m,Tse=new m,Ese=new m,gse=new m,yse=new m,Ase=new m,Qp=new m,bse=new H,Sse=new H,vse=new H,pE=new H;Zg.computeSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a0;){let E=s.pop(),S=s.pop(),w=s.pop(),D=m.fromArray(u,w*3,Cse),R=m.fromArray(u,S*3,Tse),O=m.fromArray(u,E*3,Ese),L,N,_;o&&(L=H.fromArray(f,w*2,bse),N=H.fromArray(f,S*2,Sse),_=H.fromArray(f,E*2,vse));let b=m.multiplyByScalar(m.normalize(D,gse),A,gse),v=m.multiplyByScalar(m.normalize(R,yse),A,yse),I=m.multiplyByScalar(m.normalize(O,Ase),A,Ase),M=m.magnitudeSquared(m.subtract(b,v,Qp)),F=m.magnitudeSquared(m.subtract(v,I,Qp)),k=m.magnitudeSquared(m.subtract(I,b,Qp)),V=Math.max(M,F,k),G,U,q;V>C?M===V?(G=`${Math.min(w,S)} ${Math.max(w,S)}`,a=h[G],l(a)||(U=m.add(D,R,Qp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(L,N,pE),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(w,a,E),s.push(a,S,E)):F===V?(G=`${Math.min(S,E)} ${Math.max(S,E)}`,a=h[G],l(a)||(U=m.add(R,O,Qp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(N,_,pE),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,w),s.push(a,E,w)):k===V&&(G=`${Math.min(E,w)} ${Math.max(E,w)}`,a=h[G],l(a)||(U=m.add(O,D,Qp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(_,L,pE),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(E,a,S),s.push(a,w,S)):(g.push(w),g.push(S),g.push(E))}let T={attributes:{position:new we({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Be.TRIANGLES};return o&&(T.attributes.st=new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(T)};var s5e=new he,a5e=new he,c5e=new he,Y6=new he;Zg.computeRhumbLineSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a0;){let w=s.pop(),D=s.pop(),R=s.pop(),O=m.fromArray(u,R*3,Cse),L=m.fromArray(u,D*3,Tse),N=m.fromArray(u,w*3,Ese),_,b,v;o&&(_=H.fromArray(f,R*2,bse),b=H.fromArray(f,D*2,Sse),v=H.fromArray(f,w*2,vse));let I=e.cartesianToCartographic(O,s5e),M=e.cartesianToCartographic(L,a5e),F=e.cartesianToCartographic(N,c5e);C.setEndPoints(I,M);let k=C.surfaceDistance;T.setEndPoints(M,F);let V=T.surfaceDistance;E.setEndPoints(F,I);let G=E.surfaceDistance,U=Math.max(k,V,G),q,Y,Q,W,K;U>x?k===U?(q=`${Math.min(R,D)} ${Math.max(R,D)}`,a=h[q],l(a)||(Y=C.interpolateUsingFraction(.5,Y6),Q=(I.height+M.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Qp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(_,b,pE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(R,a,w),s.push(a,D,w)):V===U?(q=`${Math.min(D,w)} ${Math.max(D,w)}`,a=h[q],l(a)||(Y=T.interpolateUsingFraction(.5,Y6),Q=(M.height+F.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Qp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(b,v,pE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,R),s.push(a,w,R)):G===U&&(q=`${Math.min(w,R)} ${Math.max(w,R)}`,a=h[q],l(a)||(Y=E.interpolateUsingFraction(.5,Y6),Q=(F.height+I.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Qp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(v,_,pE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(w,a,D),s.push(a,R,D)):(g.push(R),g.push(D),g.push(w))}let S={attributes:{position:new we({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Be.TRIANGLES};return o&&(S.attributes.st=new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(S)};Zg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,re.WGS84);let r=r5e,o=o5e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;aa?g=P.TWO_PI-c+a:g=a-c;let A=Math.ceil(g/t)+1,x=Math.ceil(h/t)+1,C=g/(A-1),T=h/(x-1),E=ce.northwest(e,o),S=ce.center(e,f5e);(n!==0||i!==0)&&(S.longitude=0;h--)ls.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(h=0,g=i-2;g>0;g--)ls.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;let x=d.length/3*2,C=Ue.createTypedArray(d.length/3,x),T=0;for(let S=0;S0){pf.longitude=(t.west+t.east)*.5,pf.latitude=u;let A=n.cartographicToCartesian(pf,yE.origin);m.clone(c,yE.direction);let x=fn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Lse);qi.rayPlane(yE,x,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(A,bV)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),bV);let d=m.cross(f,a,Bse);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){pf.longitude=(t.west+t.east)*.5,pf.latitude=p;let A=n.cartographicToCartesian(pf,yE.origin);m.negate(c,yE.direction);let x=fn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Lse);qi.rayPlane(yE,x,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(A,bV)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),bV);let h=m.cross(a,g,Bse);m.normalize(h,e.northNormal)}var E5e=new m,b5e=new m,S5e=new m(0,-1,0),v5e=new m(0,0,-1),Nse=new m;function w5e(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ce.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),E5e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),b5e),f.z=f.y,f.y=f.x,f.x=0,d=S5e,g=m.UNIT_Y,p=v5e,h=m.UNIT_Z);let A=m.subtract(i,u,Nse),x=m.dot(A,d),C=m.dot(A,p),T=m.subtract(i,f,Nse),E=m.dot(T,g),S=m.dot(T,h);x>0?o+=x*x:E>0&&(o+=E*E),C>0?o+=C*C:S>0&&(o+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};Qg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};Qg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};Qg.prototype.clear=function(){this._array.length=this._offset=this._length=0};Qg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var $g=Qg;var oo={};oo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u0?new Array(r):void 0;for(let a=0;a0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):fn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,fn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=s9(fn.projectPointOntoPlane(c,t,o9),i[0],c,r),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=qse(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=s9(fn.projectPointOntoPlane(c,t,o9),i[o],c,this._edgeNormals[n[o]]),d=m.distanceSquared(a,t),d3)return a=s9(fn.projectPointOntoPlane(this._boundingPlanes[1],t,o9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+u)%4]):m.distance(t,this._vertices[4+(n[1]-2+u)%4])};var i6e=new m,r6e=new m;function qse(e,t,n){let i=m.subtract(n,t,i6e),r=m.subtract(e,t,r6e),o=m.dot(i,r);if(o<=0)return t;let s=m.dot(i,i);return o>=s?n:(o=o/s,new m((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var o6e=new fn(m.UNIT_X,0);function s9(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c0&&(h=!0,d+=u),s1||ti(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?B.unpack(n.transform):B.clone(B.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=B.multiply(a,this.transform,new B),u=l(i)?i._initialTransform:B.IDENTITY;this._initialTransform=B.multiply(u,this.transform,new B),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Zr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Ur.REPLACE:Ur.ADD):l(i)?p=i.refine:p=Ur.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,A,x,C;if(t=ve.createIfNeeded(t),o)A=zr.UNLOADED,x=t.clone();else if(l(s)){let w=s.uri;l(s.url)&&(Zr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),w=s.url),w===""?(Zr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new mE(e,this),h=!0,A=zr.READY):(A=zr.UNLOADED,x=t.getDerivedResource({url:w}),C=Va.getServerKey(x.getUrlComponent()))}else g=new mE(e,this),h=!0,A=zr.READY;this._content=g,this._contentResource=x,this._contentState=A,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=NR(e,n),this.cacheNode=void 0;let T=n.expire,E,S;l(T)&&(E=T.duration,l(T.date)&&(S=ee.fromIso8601(T.date))),this.expireDuration=E,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=mf.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zr._deprecationWarning=$;Object.defineProperties(Zr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===zr.READY}},contentUnloaded:{get:function(){return this._contentState===zr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===zr.EXPIRED}},contentFailed:{get:function(){return this._contentState===zr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ny=new m;function d6e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,ny),c=m.add(s.positionWC,a,ny),u=m.subtract(c,o,ny);if(m.magnitude(u)>r){let S=m.normalize(u,ny),w=m.multiplyByScalar(S,r,ny),D=m.add(o,w,ny),R=m.subtract(D,s.positionWC,ny),O=m.normalize(R,ny);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,O))}else e._foveatedFactor=0;let p=e.refine===Ur.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Or.PRELOAD_FLIGHT||n._pass===Or.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),A=n.foveatedConeSize*h;if(e._foveatedFactor<=A)return!1;let x=h-A,C=P.clamp((e._foveatedFactor-A)/x,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),E=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-T<=E}var $se=new ee;Zr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=y(n,1),o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===ne.SCENE2D||u instanceof rn){let g=u.offCenterFrustum;l(g)&&(u=g);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),h=u.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let A=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,C=P.fog(g,A)*x;p-=C}}return p/=e.pixelRatio,p};function m6e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,s=l(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function h6e(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}Zr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:Jo.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==Jo.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=h6e(n,this),this._priorityProgressiveResolution=m6e(n,this),this.priorityDeferred=d6e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now($se);ee.lessThan(this.expireDate,e)&&(this._contentState=zr.EXPIRED,this._expiredContent=this._content)}};function p6e(e){if(!l(e.expireDuration))return;let t=ee.now($se);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function _6e(e){return function(){return e._priority}}Zr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?g6e(this):A6e(this)};function g6e(e){let t=e._content,n=e._tileset;if(!l(t)){let r=ti(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new FR(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=zr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=zr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=zr.FAILED,r})}async function y6e(e,t,n,i,r){let o=e._contentState;e._contentState=zr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ei.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=zr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ei.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await x6e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=zr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=zr.FAILED,a}}function A6e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new jr({throttle:!0,throttleByServer:!0,type:Ko.TILES3D,priorityFunction:_6e(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return y6e(e,r,i,n,o)}async function x6e(e,t){let n=eh(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===cs.GEOMETRY||n.contentType===cs.VECTOR,(n.contentType===cs.IMPLICIT_SUBTREE||n.contentType===cs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===cs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r,o=XA[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?r=await Promise.resolve(o(i,e,e._contentResource,n.binaryPayload.buffer,0)):r=await Promise.resolve(o(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=KA(i,s));let a=JA(i,s);return l(a)&&(r.group=new hA({metadata:a})),r}Zr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=zr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var eae=new ae;function l9(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,eae);e._boundingVolume2D=new n_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function C6e(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,eae);e._contentBoundingVolume2D=new n_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=l9(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==tn.INSIDE,s===tn.OUTSIDE)return Jo.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return tn.INSIDE;if(this._visibilityPlaneMask===Jo.MASK_INSIDE)return tn.INSIDE;let t=e.cullingVolume,n=C6e(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let o=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=o!==tn.INSIDE,o===tn.OUTSIDE)return tn.OUTSIDE}return t.computeVisibility(n)};Zr.prototype.distanceToTile=function(e){return l9(this,e).distanceToCamera(e)};var T6e=new m;Zr.prototype.distanceToTileCenter=function(e){let n=l9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,T6e);return m.dot(e.camera.directionWC,i)};Zr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var tae=new Z,nae=new m,E6e=new Z,iae=new m,rae=new ce,b6e=new Bn,c9=new B;function S6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],iae),r=Z.fromArray(e,3,E6e);i=B.multiplyByPoint(t,i,i);let o=B.getMatrix3(t,tae);return r=Z.multiply(o,r,r),l(n)?(n.update(i,r),n):new yf(i,r)}function v6e(e,t,n,i){let r=ce.unpack(e,0,rae),o=e[4],s=e[5],a=Bn.fromRectangle(r,o,s,re.WGS84,b6e),c=a.center,u=a.halfAxes;t=B.multiplyTransformation(t,B.inverseTransformation(n,c9),c9),c=B.multiplyByPoint(t,c,c);let f=B.getMatrix3(t,tae);return u=Z.multiply(f,u,u),l(i)&&i instanceof yf?(i.update(c,u),i):new yf(c,u)}function w6e(e,t,n,i){if(!B.equalsEpsilon(t,n,P.EPSILON8))return v6e(e,t,n,i);if(l(i))return i;let r=ce.unpack(e,0,rae);return new _f({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function D6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],iae),r=e[3];i=B.multiplyByPoint(t,i,i);let o=B.getScale(t,nae),s=m.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new n_(i,r)}Zr.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new de("boundingVolume must be defined");if(ti(e,"3DTILES_bounding_volume_S2"))return new GR(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:r,sphere:o}=e;if(l(i))return S6e(i,t,n);if(l(r))return w6e(r,t,this._initialTransform,n);if(l(o))return D6e(o,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};Zr.prototype.updateTransform=function(e){e=y(e,B.IDENTITY);let t=B.multiplyTransformation(e,this.transform,c9);if(!!B.equals(t,this.computedTransform))return;B.clone(t,this.computedTransform);let i=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zr.prototype.updateGeometricErrorScale=function(){let e=B.getScale(this.computedTransform,nae),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function I6e(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=kt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function P6e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=zr.FAILED,r}}function O6e(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Zr.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;O6e(this,e),I6e(this,e,t,n),P6e(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;sr||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};sx.prototype.trim=function(){this._trimTiles=!0};var XR=sx;function IV(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function f9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}IV.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=f9(e,n),this._referenceMaximum[n]=f9(t,n)};function B6e(e,t){let n=e.tilePropertyName;if(l(n)){let i=f9(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var u9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];IV.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=B6e(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,u=u9.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=u9[d],A=u9[p],x=z.clone(z.WHITE);x.red=P.lerp(h.red,A.red,g),x.green=P.lerp(h.green,A.green,g),x.blue=P.lerp(h.blue,A.blue,g),e._debugColor=x};IV.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var KR=IV;function vE(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}vE.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function PV(e,t,n,i){let r=t.innerContents,o=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-s:s),l(r)){let d=r.length;for(let p=0;p>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function m9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}QR.encode2D=function(e,t){return(cae(e)|cae(t)<<1)>>>0};QR.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=lae(e),t[1]=lae(e>>1),t};QR.encode3D=function(e,t,n){return d9(e)|d9(t)<<1|d9(n)<<2};QR.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=m9(e),t[1]=m9(e>>1),t[2]=m9(e>>2),t};var oy=QR;function Hr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===zo.OCTREE&&(this.z=e.z)}Object.defineProperties(Hr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===zo.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===zo.OCTREE?oy.encode3D(this.x,this.y,this.z):oy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===zo.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Hr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===zo.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};Hr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===zo.OCTREE?this.z===e.z:!0)};Hr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Hr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Hr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Hr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===zo.OCTREE&&(e.z=this.z),e};var uae=[0,0,0];Hr.fromMortonIndex=function(e,t,n,i){let r;return e===zo.OCTREE?(r=oy.decode3D(i,uae),new Hr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=oy.decode2D(i,uae),new Hr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};Hr.fromTileIndex=function(e,t,n){let i,r,o;return e===zo.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),Hr.fromMortonIndex(e,t,i,o)};var ax=Hr;function s_(){}s_.selectTiles=function(e,t){fe.throwInstantiationError()};s_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};s_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};s_.selectTile=function(e,t){if(e.contentVisibility(t)===tn.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];fae(o,t),e._visible=o._visible;return}if(V6e(e,t)){e._visible=!1;return}let i=e.refine===Ur.REPLACE,r=e._optimChildrenWithinParent===mf.USE_OPTIMIZATION;if(i&&r&&n&&!k6e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function V6e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Ur.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function k6e(e,t){let n=!1,i=e.children;for(let r=0;r0;){$R.stackMaximumLength=Math.max($R.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Ur.ADD,u=a.refine===Ur.REPLACE,f=H6e(a);f&&G6e(a,s,t),(c||u&&!f)&&(W6e(e,a),r(a,t),j6e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return $R.stack.trim($R.stackMaximumLength),n};function H6e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function G6e(e,t,n){let{children:i}=e;for(let r=0;r0;){tM.stackMaximumLength=Math.max(tM.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Y6e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Ur.ADD?(h9(c,t),r(c,t)):c.refine===Ur.REPLACE&&(r(c,t),d&&h9(c,t)):(n._emptyTiles.push(c),r(c,t),d&&h9(c,t)),o(c,t),s(c,t)}}function X6e(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Ds,s=!0,a=nM.stack;for(a.push(e);a.length>0;){nM.stackMaximumLength=Math.max(nM.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(r(c,t),o(c,t)),d)for(let g=0;g0;){oM.stackMaximumLength=Math.max(oM.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;cn._depth+e.skipLevels)}function $6e(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Ds;for(let u=0;ut:e._screenSpaceError>t:!0}function t9e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Ds,c=rM.stack;for(c.push(e);c.length>0;){rM.stackMaximumLength=Math.max(rM.stackMaximumLength,c.length);let u=c.pop();Z6e(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?$6e(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Ur.ADD?(OV(u,t),o(u,t)):u.refine===Ur.REPLACE&&(e9e(u,i)?(o(u,t),p&&OV(u,t)):p?(OV(u,t),o(u,t)):Q6e(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&OV(u,t)),s(u,t),a(u,t)}}function n9e(e,t){let{selectTile:n,canTraverse:i}=Ds,{stack:r,ancestorStack:o}=a_,s;for(r.push(e);r.length>0||o.length>0;){if(a_.stackMaximumLength=Math.max(a_.stackMaximumLength,r.length),a_.ancestorStackMaximumLength=Math.max(a_.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Ur.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f(i._metadataExtension=s,o))}).then(function(o){if(i.isDestroyed())return;i._geometricError=o.geometricError,i._scaledGeometricError=o.geometricError,i._root=i.loadTileset(r,o);let s=l(o.asset.gltfUpAxis)?cr.fromName(o.asset.gltfUpAxis):cr.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,cr.X),u=o.asset;i._asset=u,i._properties=o.properties,i._extensionsUsed=o.extensionsUsed,i._extensions=o.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=o.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let h=f.cesium.credits,A=i._credits;l(A)||(A=[],i._credits=A);for(let x=0;xsi._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=B.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(go.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return $("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),l(this._root)}},readyPromise:{get:function(){return $("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return $("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(B.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):B.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});go.fromIonAssetId=async function(e,t){let n=await Zs.fromAssetId(e);return go.fromUrl(n,t)};go.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await go.loadJson(n),o=await yae(n,r),s=new go(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras;let c=n.credits;l(c)||(c=[]);let u=a.extras;if(l(u)&&l(u.cesium)&&l(u.cesium.credits)){let x=u.cesium.credits;for(let C=0;Csi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=B.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};go.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};go.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};go.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&go.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=pae(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Ur.ADD;let u=c._header.children;if(l(u))for(let f=0;fx.minimumRadius){let E=he.fromCartesian(T,x,i9e);n=m.normalize(a.positionWC,_ae),i=a.directionWC,r=a.positionCartographic.height,o=0,s=E.height*2}else{let E=B.multiplyByPoint(A,a.positionWC,s9e);if(n=m.UNIT_Z,i=B.multiplyByPointAsVector(A,a.directionWC,a9e),i=m.normalize(i,i),r=E.z,u instanceof yf){let S=c._header.boundingVolume.box[11];o=T.z-S,s=T.z+S}else if(u instanceof n_){let S=C.radius;o=T.z-S,s=T.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function l9e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{Aae(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?y9e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function u9e(e,t){return e._priority-t._priority}go.prototype.postPassesUpdate=function(e){l(this._root)&&(f9e(this,e),x9e(this,e),this._cache.unloadTiles(this,Cae),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};go.prototype.prePassesUpdate=function(e){if(!l(this._root))return;h9e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&c9e(this,e),e.newFrame&&this._cache.reset()};function f9e(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r=1;if(o._contentState!==zr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function d9e(e){let t=e._requestedTiles;t.sort(u9e);for(let n=0;n0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`))}function m9e(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=r)}t.length-=n}function h9e(e,t){m9e(e);let n=e._processingQueue,i=e._statistics,r;for(let o=0;o0&&(i+=` -Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,r++),i+=` -Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${gae(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${gae(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ri({stencil:0,pass:Se.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Ft.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let h=0;h=0;--x)i[d+A+x]=i[d+x];for(let x=0;x0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Zm),_9e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var xae=[];function y9e(e,t){let n=t,i=xae;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o-1:!1};go.prototype.isDestroyed=function(){return!1};go.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=xae;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i-1;i--)g9(this,e[i],t,n);return ue(this)};sy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};sy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(g9(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],g9(this,o,a,c),s.remove(o.id)};function g9(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function S9e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await va.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var aM=sy;var v9e=z.WHITE,w9e=z.BLACK,D9e=new H(2,2);function wE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(wE.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});wE.prototype.getType=function(e){return"Checkerboard"};wE.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,v9e,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,w9e,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,D9e),t};wE.prototype.equals=function(e){return this===e||e instanceof wE&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var DE=wE;var Tae={id:void 0};function cM(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function nc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=Wn(),this._show=!0,this._firing=!1,this._refire=!1}nc.prototype.suspendEvents=function(){this._suspendCount++};nc.prototype.resumeEvents=function(){this._suspendCount--,cM(this)};Object.defineProperties(nc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t-1;c--)s=a[c],bae(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(vo.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Eae(e,p,g,s);let A=d.getById(s.id);l(A)||(A=f.getById(s.id),l(A)?y9(A):(MV.id=s.id,A=new Kr(MV)),d.add(A)),A.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(o=0;o=0;a--)c=i[a].getById(A),l(c)&&(l(u)||(u=o.getById(A),y9(u)),u.merge(c));l(u)||o.removeById(A),u=void 0}let g=t.length;for(s=0;s=0;a--)c=i[a].getById(A),l(c)&&(l(u)||(u=o.getById(A),l(u)?y9(u):(MV.id=A,u=new Kr(MV),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};vo.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let h=g[t];if(l(h)){if(d)if(d=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var A9=vo;function x9(){this._removalFunctions=[]}x9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};x9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Do.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Do.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Do.prototype.contains=function(e){return this.indexOf(e)>=0};var C9=new Tn;Do.prototype.indexOf=function(e){let t=this._intervals;C9.start=e,C9.stop=e;let n=wr(t,C9,E9);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(r=ee.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Tn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Tn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=ee.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Tn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Tn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Tn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Tn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Do.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=wr(t,e,E9);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Tn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Tn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),lM[2]=Jh(u)?29:28;a>lM[c]||c>=13;)a>lM[c]&&(a-=lM[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),lM[2]=Jh(u)?29:28;return ic.millisecond=i,ic.second=r,ic.minute=o,ic.hour=s,ic.day=a,ic.month=c,ic.year=u,ee.fromGregorianDate(ic,n)}var I9e=new ee,P9e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function vae(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(P9e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,I9e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var uM=new Kh;Do.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=[];if(!vae(n[2],uM))o.push(i,r);else{let s=ee.clone(i);for(o.push(s);ee.compare(s,r)<0;)s=T9(s,uM),ee.compare(r,s)<=0&&ee.clone(r,s),o.push(s)}return Do.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Do.fromIso8601DateArray=function(e,t){return Do.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Do.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=y(e.relativeToPrevious,!1),o=[],s,a,c=i.length;for(let u=0;u=0?-a:a}var W9e=new m(-1,0,0),lx=new B,j9e=new B,v9=new Z,Y9e=Z.IDENTITY.clone(),q9e=new m,X9e=new oe,wae=new m;function c_(e,t,n,i,r,o,s,a){let c=q9e,u=X9e;lx=Mt.eastNorthUpToFixedFrame(e,r,lx),c=B.multiplyByPointAsVector(lx,W9e,c),c=m.normalize(c,c);let f=G9e(c,t,e,r);v9=Z.fromRotationZ(f,v9),wae.z=o,lx=B.multiplyTransformation(lx,B.fromRotationTranslation(v9,wae,j9e),lx);let d=Y9e;d[0]=s;for(let p=0;p0){let A=u?2:1;for(let x=0;x=0};var Z9e=new m,Q9e=new m;fM.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=H9e(e,o),a=i._granularity,c=i._cornerType,u=r?J9e(t,n):Dae(t,n),f=r?Dae(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],A=r?[]:void 0,x=M9e,C=B9e,T=L9e,E=N9e,S=F9e,w=U9e,D=V9e,R=k9e,O=z9e,L=e[0],N=e[1];E=o.geodeticSurfaceNormal(L,E),x=m.subtract(N,L,x),x=m.normalize(x,x),R=m.cross(E,x,R),R=m.normalize(R,R);let _=s[0],b=s[1];r&&(A=c_(L,R,f,A,o,_+d,1,1)),O=m.clone(L,O),L=N,C=m.negate(x,C);let v,I;for(let k=1;kDe;p--)xe=P.PI_OVER_TWO-p*_e,J[se++]=1-me*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=De;p>0;p--)xe=P.PI_OVER_TWO-_e*p,J[se++]=1-ye*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=f-x;p>0;p--)J[se++]=p*ye,J[se++]=1;for(p=1;p0;p--)J[se++]=(p-1)*ye,J[se++]=1}c.st=new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new we({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new we({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new we({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function fWe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Gae,h=Wae,A=VV,x=kV,C=uWe,T=jae,E=c;for(u=0;u-t?(r=yWe,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),R9(e,r,i)};nh.prototype.computeHorizonCullingPoint=function(e,t,n){return cce(this._ellipsoid,e,t,n)};var sce=re.clone(re.UNIT_SPHERE);nh.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=ace(this._ellipsoid,n,sce);return cce(r,e,t,i)};nh.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return lce(this._ellipsoid,e,t,n,i,r)};nh.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=ace(this._ellipsoid,r,sce);return lce(s,e,t,n,i,o)};var AWe=[];nh.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,AWe),r=ae.fromPoints(i);if(!(m.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var xWe=new m;function ace(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,xWe);e=re.fromCartesian3(i,n)}return e}function cce(e,t,n,i){l(i)||(i=new m);let r=dce(e,t),o=0;for(let s=0,a=n.length;s0:s>r&&s*s/m.magnitudeSquared(o)>r)}var CWe=new m,TWe=new m;function uce(e,t,n){let i=e.transformPositionToScaledSpace(t,CWe),r=m.magnitudeSquared(i),o=Math.sqrt(r),s=m.divideByScalar(i,o,TWe);r=Math.max(1,r),o=Math.max(1,o);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function fce(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var O9=new m;function dce(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,O9),m.normalize(O9,O9))}var f_=nh;function Oo(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Lt.clone(n)),l(i)&&(i=Lt.clone(i)),l(r)&&(r=Dt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var mce=Oo.SHOW_INDEX=0,_ce=Oo.POSITION_INDEX=1,EWe=Oo.COLOR_INDEX=2,bWe=Oo.OUTLINE_COLOR_INDEX=3,SWe=Oo.OUTLINE_WIDTH_INDEX=4,vWe=Oo.PIXEL_SIZE_INDEX=5,wWe=Oo.SCALE_BY_DISTANCE_INDEX=6,DWe=Oo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,IWe=Oo.DISTANCE_DISPLAY_CONDITION_INDEX=8,PWe=Oo.DISABLE_DEPTH_DISTANCE_INDEX=9;Oo.NUMBER_OF_PROPERTIES=10;function Tf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Oo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Tf(this,mce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Tf(this,_ce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Lt.equals(t,e)||(this._scaleByDistance=Lt.clone(e,t),Tf(this,wWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Lt.equals(t,e)||(this._translucencyByDistance=Lt.clone(e,t),Tf(this,DWe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Tf(this,vWe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Tf(this,EWe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Tf(this,bWe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Tf(this,SWe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Tf(this,IWe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Tf(this,PWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Tf(this,mce))}}});Oo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Oo.prototype._getActualPosition=function(){return this._actualPosition};Oo.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Tf(this,_ce)};var hce=new oe;Oo._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(B.multiplyByPoint(n,e,hce),Xi.computeActualWgs84Position(t,hce))};var pce=new oe;Oo._computeScreenSpacePosition=function(e,t,n,i){let r=B.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,pce),pce);return Xi.wgs84ToWindowCoordinates(n,r,i)};Oo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new H);let i=n.modelMatrix,r=Oo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};Oo.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new Ke),n.x=o,n.y=s,n.width=a,n.height=c,n};Oo.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Lt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Oo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ps=Oo;var dy=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; - -void main() -{ - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; + #ifdef HAS_GLOSSINESS_FACTOR + glossiness *= u_glossinessFactor; + #endif + #else + #ifdef HAS_SPECULAR_FACTOR + vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); + #else + vec3 specular = vec3(1.0); + #endif -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif + #ifdef HAS_GLOSSINESS_FACTOR + float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); + #else + float glossiness = 1.0; + #endif + #endif - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); -} -`;var gM=`uniform float u_maxTotalPointSize; + #ifdef HAS_DIFFUSE_TEXTURE + vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; + #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM + diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); + #endif -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance + vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); + #ifdef HAS_DIFFUSE_FACTOR + diffuse *= u_diffuseFactor; + #endif + #elif defined(HAS_DIFFUSE_FACTOR) + vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); + #else + vec4 diffuse = vec4(1.0); + #endif + czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial( + diffuse.rgb, + specular, + glossiness + ); + material.diffuse = parameters.diffuseColor; + // the specular glossiness extension's alpha overrides anything set + // by the base material. + material.alpha = diffuse.a; + material.specular = parameters.f0; + material.roughness = parameters.roughness; + #elif defined(LIGHTING_PBR) + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE + vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM + metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); + #endif -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; + vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; + float metalness = clamp(metallicRoughness.b, 0.0, 1.0); + float roughness = clamp(metallicRoughness.g, 0.04, 1.0); + #ifdef HAS_METALLIC_FACTOR + metalness *= u_metallicFactor; + #endif -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; + #ifdef HAS_ROUGHNESS_FACTOR + roughness *= u_roughnessFactor; + #endif + #else + #ifdef HAS_METALLIC_FACTOR + float metalness = clamp(u_metallicFactor, 0.0, 1.0); + #else + float metalness = 1.0; + #endif -void main() + #ifdef HAS_ROUGHNESS_FACTOR + float roughness = clamp(u_roughnessFactor, 0.04, 1.0); + #else + float roughness = 1.0; + #endif + #endif + czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial( + material.diffuse, + metalness, + roughness + ); + material.diffuse = parameters.diffuseColor; + material.specular = parameters.f0; + material.roughness = parameters.roughness; + #endif +} +`;var Wke=Ft.Material,d6=Ft.MetallicRoughness,m6=Ft.SpecularGlossiness,Zie={name:"MaterialPipelineStage",_processTexture:jg,_processTextureTransform:$ie};Zie.process=function(e,t,n){let i=t.material,o=e.model,r=l(o.classificationType),s=r,a=e.uniformMap,c=e.shaderBuilder,u=n.context.defaultTexture,f=n.context.defaultNormalTexture,d=n.context.defaultEmissiveTexture;jke(i,a,c,u,f,d,s),l(i.specularGlossiness)?qke(i,a,c,u,s):Yke(i,a,c,u,s);let p=Qt.getAttributeBySemantic(t,Et.NORMAL),g=e.lightingOptions;i.unlit||!p||r?g.lightingModel=qm.UNLIT:g.lightingModel=qm.PBR;let h=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let x=e.alphaOptions;i.alphaMode===Gm.BLEND?x.pass=Ae.TRANSLUCENT:i.alphaMode===Gm.MASK&&(x.alphaCutoff=i.alphaCutoff),c.addFragmentLines(EO),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Te.BOTH)};function $ie(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,Te.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Te.FRAGMENT),t[s]=function(){return n.transform}}function jg(e,t,n,i,o,r){e.addUniform("sampler2D",i,Te.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,Te.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,Te.FRAGMENT);let f=n.transform;l(f)&&!Z.equals(f,Z.IDENTITY)&&$ie(e,t,n,i,o)}function jke(e,t,n,i,o,r,s){let a=e.emissiveFactor;if(l(a)&&!m.equals(a,Wke.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",Te.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Te.FRAGMENT);let f=e.emissiveTexture;l(f)&&!s&&jg(n,t,f,"u_emissiveTexture","EMISSIVE",r)}let c=e.normalTexture;l(c)&&!s&&jg(n,t,c,"u_normalTexture","NORMAL",o);let u=e.occlusionTexture;l(u)&&!s&&jg(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function qke(e,t,n,i,o){let r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Te.FRAGMENT);let s=r.diffuseTexture;l(s)&&!o&&jg(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=r.diffuseFactor;l(a)&&!re.equals(a,m6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Te.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Te.FRAGMENT));let c=r.specularGlossinessTexture;l(c)&&!o&&jg(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let u=r.specularFactor;l(u)&&!m.equals(u,m6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Te.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Te.FRAGMENT));let f=r.glossinessFactor;l(f)&&f!==m6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Te.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Te.FRAGMENT))}function Yke(e,t,n,i,o){let r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Te.FRAGMENT);let s=r.baseColorTexture;l(s)&&!o&&jg(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=r.baseColorFactor;l(a)&&!re.equals(a,d6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Te.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Te.FRAGMENT));let c=r.metallicRoughnessTexture;l(c)&&!o&&jg(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=r.metallicFactor;l(u)&&u!==d6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Te.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Te.FRAGMENT));let f=r.roughnessFactor;l(f)&&f!==d6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Te.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Te.FRAGMENT))}var SO=Zie;var vO=`void morphTargetsStage(inout ProcessedAttributes attributes) { - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; + vec3 positionMC = attributes.positionMC; + attributes.positionMC = getMorphedPosition(positionMC); - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = getMorphedNormal(normalMC); + #endif -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = getMorphedTangent(tangentMC); + #endif +}`;var va={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};va.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Te.VERTEX),Qke(n);let i=t.morphTargets.length;for(let a=0;a pickColor.rgb +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + return getPointSizeFromAttenuation(v_positionEC); +} +#endif - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { + #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) + // This needs to be computed in eye coordinates so we can't use attributes.normalMC + return step(-v_normalEC.z, 0.0); + #else + return 1.0; + #endif +} +#endif`;var oUe=new re,noe={name:"PointCloudStylingPipelineStage"};noe.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=cUe(a),b=lUe(r,x);uUe(i,b);let T=fUe(b).indexOf("normalMC")>=0,A=Qt.getAttributeBySemantic(t,Et.NORMAL);if(T&&!A)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Te.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=Ae.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Te.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,Te.VERTEX);let d,p,g;Bo.is3DTiles(o.type)&&(p=!0,d=o.content,g=d.tile.refine===Uo.ADD),i.addUniform("vec4","model_pointCloudParameters",Te.VERTEX),i.addVertexLines(DO);let h=e.uniformMap;h.model_pointCloudParameters=function(){let x=oUe,b=1;p&&(b=g?5:d.tileset.maximumScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let C=rUe(e,t,f,d);x.y=C*f.geometricErrorScale;let T=n.context,A=n.camera.frustum,S;return n.mode===ne.SCENE2D||A instanceof on?S=Number.POSITIVE_INFINITY:S=T.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=d.tileset.timeSinceLoad),x}};var toe=new m;function rUe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Qt.getAttributeBySemantic(t,Et.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,toe);a=L.multiplyByPointAsVector(s,a,toe);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var sUe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},aUe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function cUe(e){let t=Ye(aUe);if(!l(e))return t;for(let n=0;n color.rgb + float outlineX = + texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; + float outlineY = + texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; + float outlineZ = + texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; + float outlineness = max(outlineX, max(outlineY, outlineZ)); - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); + material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} - // compressedAttribute0.y => outlineColor.rgb +`;var ioe={name:"PrimitiveOutlinePipelineStage"};ioe.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Te.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:cn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Te.FRAGMENT);let a=Mx.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Te.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Te.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(OO),i.addFragmentLines(RO)};var MO=ioe;var ooe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:roe,_count2DPositions:soe,_countMorphTargetAttributes:aoe,_countMaterialTextures:coe,_countFeatureIdTextures:loe,_countBinaryMetadata:uoe};ooe.process=function(e,t,n){let i=e.model,o=i.statistics;roe(o,t),soe(o,e.runtimePrimitive),aoe(o,t),coe(o,t.material),loe(o,t.featureIds),uoe(o,i)};function roe(e,t){let n=l(t.indices)?t.indices.count:Qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Fe.POINTS?e.pointsLength+=n:Fe.isTriangles(i)&&(e.trianglesLength+=dUe(i,n));let o=t.attributes,r=o.length;for(let c=0;c color.a, outlineColor.a, pickColor.a + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = skinningMatrixMat3 * normalMC; + #endif - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; - - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; - - /////////////////////////////////////////////////////////////////////////// - - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - - /////////////////////////////////////////////////////////////////////////// - -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = skinningMatrixMat3 * tangentMC; + #endif +}`;var Ux={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Ux.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Te.VERTEX),EUe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,Te.VERTEX),n.addVertexLines(FO);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=_t(r,e.uniformMap)};function AUe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o0,d=l(i.skin),p=l(r),h=!(p&&l(r.fragmentShaderText))||r.mode!==Up.REPLACE_MATERIAL,x=Qt.hasQuantizedAttributes(n.attributes),b=o.debugWireframe&&Fe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,T=l(C)&&C.attenuation,A=l(C)&&C.backFaceCulling,S=n.primitiveType===Fe.POINTS&&(l(s)||T||A),v=o._enableShowOutline&&l(n.outlineCoordinates),I=RUe(o,i,n),O=l(o.classificationType);u&&t.push(NO),t.push(CO),b&&t.push(kO),O&&t.push(rO),f&&t.push(wO),d&&t.push(BO),S&&t.push(PO),x&&t.push(gO),h&&t.push(SO),t.push(Hg),t.push(of),I.hasPropertyTable&&(t.push(Wg),t.push(oO),t.push(cO)),p&&t.push(pO),t.push(AO),o.allowPicking&&t.push(IO),v&&t.push(MO),t.push(iO),t.push(LO)};function RUe(e,t,n){let i;return l(t.instances)&&(i=Qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var UO=hoe;function g6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],MUe(this)}Object.defineProperties(g6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function MUe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif +} +`;var lU={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};lU.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Te.FRAGMENT),i.addFragmentLines(XO);let o={};i.addUniform("float",lU.SPLIT_DIRECTION_UNIFORM_NAME,Te.FRAGMENT),o[lU.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=_t(o,e.uniformMap)};var KO=lU;function UUe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var JO=UUe;function VUe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,qm.UNLIT)}var ZO=VUe;function zUe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new ZO,this.pickId=void 0}var $O=zUe;function tu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=L.clone(L.IDENTITY),this._computedModelMatrix2D=L.clone(L.IDENTITY),this._axisCorrectionMatrix=Qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new L),this._runtimeArticulations={},HUe(this)}Object.defineProperties(tu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function HUe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;_oe(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let T=0;T0&&(d=Oo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new vd(u,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!l(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=m.unpack(x));let b=iVe(g,d);if(b.rtcCenter=x,b.pointsLength=h,!b.hasPositions){let C=oVe(g);b.positions=C,b.hasPositions=b.hasPositions||l(C)}if(!b.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let C=sVe(g);b.normals=C,b.hasNormals=b.hasNormals||l(C)}if(!b.hasColors){let C=rVe(g);b.colors=C,b.hasColors=b.hasColors||l(C),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(C)&&C.isTranslucent}if(!b.hasBatchIds){let C=aVe(g);b.batchIds=C,b.hasBatchIds=b.hasBatchIds||l(C)}if(b.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=C}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function iVe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let h=s.byteOffset,x=s.byteLength;if(!l(o)||!l(h)||!l(x))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:_t(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function oVe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65536-1,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:cn.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:cn.VEC3}}}function rVe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:cn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=z.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:cn.VEC4,isQuantized:!1,isTranslucent:s}}}function sVe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<0&&DVe(e,a,d,t),l(n.rtcCenter)&&(f.transform=L.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=L.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function DVe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(u(f),!1)}),this._loader instanceof cA?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,u)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(u(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!l(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad(Qt.getError("model",this._resource,c)))})),this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function dU(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function PVe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return voe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Bo.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(cs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});mo.prototype.getNode=function(e){return this._nodesByName[e]};mo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};mo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};mo.prototype.makeStyleDirty=function(){this._styleDirty=!0};mo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var RVe=new L,MVe=new Z,LVe=new L;mo.prototype.update=function(e){let t=!1;try{t=NVe(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")dU(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=Qt.getError("model",this._resource,n);dU(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=Qt.getError("model",this._resource,n);dU(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(BVe(this,e),FVe(this,e),kVe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Qt.getError("model",this._resource,new de("Failed to load model."));dU(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&PVe(this,i);let o=new QO({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(UVe(this),VVe(this),zVe(this,e),HVe(this),GVe(this,e),WVe(this,e),jVe(this,e),qVe(this,e),this._defaultTexture=e.context.defaultTexture,YVe(this,e),XVe(this,e),KVe(this),JVe(this,e),QVe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),$Ve(this),eze(this,e),tze(this),nze(this,e)}};function NVe(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function FVe(e,t){l(e._customShader)&&e._customShader.update(t)}function BVe(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=Hh.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function kVe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function UVe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=OVe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function VVe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function zVe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r=i&&r<=o}function sze(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCreditToNextFrame(i);let o=e._resourceCredits,r=o.length;for(let c=0;c0&&e.alpha<1};mo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function woe(e){return e.context.stencilBuffer}mo.prototype.hasSilhouette=function(e){return woe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};mo.prototype.hasSkipLevelOfDetail=function(e){if(!Bo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};mo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};mo.prototype.isDestroyed=function(){return!1};mo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let o=0;o0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Soe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function lA(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Dd=mo;function vs(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(vs.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});vs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};vs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};vs.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};vs.prototype.applyStyle=function(e){this._model.style=e};vs.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:xl.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};vs.prototype.isDestroyed=function(){return!1};vs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};vs.fromGltf=async function(e,t,n,i){let o=new vs(e,t,n),s=nR(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Dd.fromGltfAsync(s);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};vs.fromB3dm=async function(e,t,n,i,o){let r=new vs(e,t,n),a=nR(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Dd.fromB3dm(a);return r._model=u,r._readyPromise=new Promise(f=>{r._resolveContent=f}),r};vs.fromI3dm=async function(e,t,n,i,o){let r=new vs(e,t,n),a=nR(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Dd.fromI3dm(a);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};vs.fromPnts=async function(e,t,n,i,o){let r=new vs(e,t,n),a=nR(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Dd.fromPnts(a);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};vs.fromGeoJson=async function(e,t,n,i){let o=new vs(e,t,n),s=nR(e,t,o,{geoJson:i,resource:n}),a=await Dd.fromGeoJson(s);return o._model=a,o._readyPromise=new Promise(c=>{o._resolveContent=c}),o};function nR(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ae.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return _t(i,o)}var Xm=vs;function Pd(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties(Pd.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Pd.fromJson=function(e,t,n,i){let o=new Pd(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Pd.prototype.hasProperty=function(e,t){return!1};Pd.prototype.getFeature=function(e){};Pd.prototype.applyDebugSettings=function(e,t){};Pd.prototype.applyStyle=function(e){};Pd.prototype.update=function(e,t){};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return ue(this)};var iR=Pd;function ws(e,t,n,i){let o=ws._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let d=0;d0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};ws._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}ws.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; - } - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) - { - positionEC.xyz = vec3(0.0); - totalSize = 1.0; - } +in vec2 v_textureCoordinates; +in vec4 v_pickColor; +in vec4 v_color; - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency < 0.004) - { - positionEC.xyz = vec3(0.0); - } +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; #endif -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepth.x; - float farSq = distanceDisplayConditionAndDisableDepth.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); - } -#endif +#ifdef FRAGMENT_DEPTH_CHECK +in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates +in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) +in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +in mat2 v_rotationMatrix; - gl_Position = czm_projection * positionEC; - czm_vertexLogDepth(); +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT1 = 2.0; -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; + +float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) +{ + vec2 lookupVector = imageSize * (depthLookupST - adjustedST); + lookupVector = v_rotationMatrix * lookupVector; + vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal + + vec2 translation = v_originTextureCoordinateAndTranslate.zw; + + if (applyTranslate) { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; + // this is only needed for labels where the horizontal origin is not LEFT + // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT + translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); } - if (disableDepthTestDistance != 0.0) + vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + + if (logDepthOrDepth == 0.0) { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif - } + return 0.0; // not on the globe } + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + return eyeCoordinate.z / eyeCoordinate.w; +} #endif - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; +#ifdef SDF - v_pickColor = pickColor; +// Get the distance from the edge of a glyph at a given position sampling an SDF texture. +float getDistance(vec2 position) +{ + return texture(u_atlas, position).r; } -`;var OWe=Ps.SHOW_INDEX,L9=Ps.POSITION_INDEX,gce=Ps.COLOR_INDEX,RWe=Ps.OUTLINE_COLOR_INDEX,MWe=Ps.OUTLINE_WIDTH_INDEX,BWe=Ps.PIXEL_SIZE_INDEX,yce=Ps.SCALE_BY_DISTANCE_INDEX,Ace=Ps.TRANSLUCENCY_BY_DISTANCE_INDEX,xce=Ps.DISTANCE_DISPLAY_CONDITION_INDEX,LWe=Ps.DISABLE_DEPTH_DISTANCE_INDEX,N9=Ps.NUMBER_OF_PROPERTIES,oc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Ef(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(N9),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Er.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Ef.prototype,{length:{get:function(){return F9(this),this._pointPrimitives.length}}});function Cce(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(r,s,a,u)}function FWe(e,t,n,i){Tce(e,t,n,i),Ece(e,t,n,i),bce(e,t,n,i),Sce(e,t,n,i),vce(e,t,n,i)}function B9(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=NWe(c,n,this._buffersUsage),a=this._vaf.writers;for(let w=0;w0){let w=kWe;w.length=0,(o[L9]||o[MWe]||o[BWe])&&w.push(Tce),(o[gce]||o[RWe])&&w.push(Ece),(o[OWe]||o[Ace])&&w.push(bce),o[yce]&&w.push(Sce),(o[xce]||o[LWe])&&w.push(vce);let D=w.length;if(a=this._vaf.writers,r/n>.1){for(let R=0;Rn*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=B.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),VWe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Er.OPAQUE||this._blendOption===Er.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Er.TRANSLUCENT||this._blendOption===Er.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,A;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new He({sources:[gM]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Er.OPAQUE_AND_TRANSLUCENT&&(A=new He({defines:["OPAQUE"],sources:[dy]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:oc}),A=new He({defines:["TRANSLUCENT"],sources:[dy]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:oc})),this._blendOption===Er.OPAQUE&&(A=new He({sources:[dy]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:oc})),this._blendOption===Er.TRANSLUCENT&&(A=new He({sources:[dy]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:oc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,C,T,E,S=e.commandList;if(u.render||f){let w=this._colorCommands,D=this._blendOption===Er.OPAQUE,R=this._blendOption===Er.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,C=x.length,w.length=C;let O=R?C*2:C;for(E=0;E>4;if(r!==U9)throw new Error(`Got v${r} data when expected v${U9}.`);let o=wce[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new fx(a,s,o,t)}constructor(t,n=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=wce.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,AM,t),this.coords=new this.ArrayType(this.data,AM+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(AM+s+a+c),this.ids=new this.IndexArrayType(this.data,AM,t),this.coords=new this.ArrayType(this.data,AM+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(U9<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return k9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let x=p;x<=d;x++){let C=s[2*x],T=s[2*x+1];C>=t&&C<=i&&T>=n&&T<=r&&u.push(o[x])}continue}let g=p+d>>1,h=s[2*g],A=s[2*g+1];h>=t&&h<=i&&A>=n&&A<=r&&u.push(o[g]),(f===0?t<=h:n<=A)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:r>=A)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let x=p;x<=d;x++)Dce(o[2*x],o[2*x+1],t,n)<=u&&c.push(r[x]);continue}let g=p+d>>1,h=o[2*g],A=o[2*g+1];Dce(h,A,t,n)<=u&&c.push(r[g]),(f===0?t-i<=h:n-i<=A)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=A)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function k9(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;Ice(e,t,s,i,r,o),k9(e,t,n,i,s-1,1-o),k9(e,t,n,s+1,r,1-o)}function Ice(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/u+g)),A=Math.min(r,Math.floor(n+(u-f)*p/u+g));Ice(e,t,n,h,A,o)}let s=t[2*n+o],a=i,c=r;for(xM(e,t,i,n),t[2*r+o]>s&&xM(e,t,i,r);as;)c--}t[2*i+o]===s?xM(e,t,i,c):(c++,xM(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function xM(e,t,n,i){V9(e,n,i),V9(t,2*n,2*i),V9(t,2*n+1,2*i+1)}function V9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Dce(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function zd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new pe,this.show=y(e.show,!0)}function Pce(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var zWe=new Ke;function Oce(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=qg.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=fr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ps.getScreenSpaceBoundingBox(e,t,r)),Pce(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Mce(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=qg.getScreenSpaceBoundingBox(s,t,zWe);Pce(a,n),r=Ke.union(r,a,r)}return r}function HWe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Mce(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Rce(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function Mce(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function z9(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s0){let M=new fx(T.length,64,Uint32Array);for(let F=0;F=f)for(Rce(F.position,b,_,e),p.push(F),S=0;S=f){let U=m.multiplyByScalar(G,1/b,G);for(Rce(U,b,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S0?(a=u.pop(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function W9(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}zd.prototype.getLabel=G9("_labelCollection",Zm,"_unusedLabelIndices","labelIndex");zd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,W9(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};zd.prototype.getBillboard=G9("_billboardCollection",iu,"_unusedBillboardIndices","billboardIndex");zd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,W9(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};zd.prototype.getPoint=G9("_pointCollection",LE,"_unusedPointIndices","pointIndex");zd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,W9(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function H9(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,qWe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};zd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var su=zd;function j9(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new Is(this),this._entityCluster=new su}Object.defineProperties(j9.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Po.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});j9.prototype.update=function(e){return!0};var CM=j9;var Bce={};Bce.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,h=r?(a+i)*3:i*3;for(f=0;f0){let A=Math.min(o,r);u=Math.round(r/A),c+=A}let f=Ue.createTypedArray(s,c*2),d=0,p;for(p=0;p0)for(p=0;p0){for(c=0;c=t;i--)e[i]=e[a--]}for(i=0;i=0||l(d)&&ee.compare(f,d)>=0));){for(eW[p++]=f,o=o+1,s=0;s0&&(tW.length=g,zce(n,u,tW),eW.length=p,zce(t,c,eW))}else{for(s=0;sr)return;if(this._backwardExtrapolationType===cu.HOLD)return o.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cu.NONE||r!==0&&ee.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===cu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,A=i-1;if(A-h+1>=g+1){let S=a-(g/2|0)-1;SA&&(w=A,S=w-g,S0){n=new Array(t);for(let i=0;ic&&e!==Object}let h=typeof e.unpack=="function"&&e!==bf;if(!g&&!p){d?t[n]=new $n(h?e.unpack(u,0):u):t[n]=Xce(e,s,i);return}let A=t[n],x,C=i.epoch;if(l(C)&&(x=ee.fromIso8601(C)),g&&!p){A instanceof uu||(t[n]=A=new uu(e)),A.addSamplesPackedArray(u,x),qV(i,A);return}let T;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(u,0):u:a.data=Xce(e,s,i),l(A)||(t[n]=A=d?new y_:new rc),d&&A instanceof y_?A.intervals.addInterval(a):A instanceof rc?(d&&(a.data=new $n(a.data)),A.intervals.addInterval(a)):(t[n]=A=ele(A),d&&(a.data=new $n(a.data)),A.intervals.addInterval(a));return}l(A)||(t[n]=A=new rc),A instanceof rc||(t[n]=A=ele(A));let E=A.intervals;T=E.findInterval(a),(!l(T)||!(T.data instanceof uu))&&(T=a.clone(),T.data=new uu(e),E.addInterval(T)),T.data.addSamplesPackedArray(u,x),qV(i,T.data)}function dle(e,t){if(e instanceof uu){e.removeSamples(t);return}else if(e instanceof y_){e.intervals.removeInterval(t);return}else if(e instanceof rc){let n=e.intervals;for(let i=0;ic),!h&&!p){d?e[t]=new Pc(m.unpack(u),g):e[t]=PM(o,n.reference);return}let A=e[t],x,C=n.epoch;if(l(C)&&(x=ee.fromIso8601(C)),h&&!p){(!(A instanceof ia)||l(g)&&A.referenceFrame!==g)&&(e[t]=A=new ia(g,a)),A.addSamplesPackedArray(u,x),qV(n,A);return}let T;if(!h&&p){s=s.clone(),d?s.data=m.unpack(u):s.data=PM(o,n.reference),l(A)||(d?A=new g_(g):A=new ta(g),e[t]=A),d&&A instanceof g_&&l(g)&&A.referenceFrame===g?A.intervals.addInterval(s):A instanceof ta?(d&&(s.data=new Pc(s.data,g)),A.intervals.addInterval(s)):(e[t]=A=tle(A),d&&(s.data=new Pc(s.data,g)),A.intervals.addInterval(s));return}l(A)?A instanceof ta||(e[t]=A=tle(A)):e[t]=A=new ta(g);let E=A.intervals;T=E.findInterval(s),(!l(T)||!(T.data instanceof ia)||l(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new ia(g,a),E.addInterval(T)),T.data.addSamplesPackedArray(u,x),qV(n,T.data)}function mle(e,t){if(e instanceof ia){e.removeSamples(t);return}else if(e instanceof g_){e.intervals.removeInterval(t);return}else if(e instanceof ta){let n=e.intervals;for(let i=0;i. version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=y(r.interval,o.interval),o.currentTime=y(r.currentTime,o.currentTime),o.range=y(r.range,o.range),o.step=y(r.step,o.step),o.multiplier=y(r.multiplier,o.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function sje(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=so(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new oA),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),ge(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(qe,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(bf,s,"rotation",r.rotation,o,i,n),ge(bf,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function aje(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=so(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new sA),ge(Boolean,s,"show",r.show,o,i,n),ge(m,s,"radii",r.radii,o,i,n),ge(m,s,"innerRadii",r.innerRadii,o,i,n),ge(Number,s,"minimumClock",r.minimumClock,o,i,n),ge(Number,s,"maximumClock",r.maximumClock,o,i,n),ge(Number,s,"minimumCone",r.minimumCone,o,i,n),ge(Number,s,"maximumCone",r.maximumCone,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"stackPartitions",r.stackPartitions,o,i,n),ge(Number,s,"slicePartitions",r.slicePartitions,o,i,n),ge(Number,s,"subdivisions",r.subdivisions,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function cje(e,t,n,i){let r=t.label;if(!l(r))return;let o=so(r.interval),s=e.label;l(s)||(e.label=s=new dd),ge(Boolean,s,"show",r.show,o,i,n),ge(String,s,"text",r.text,o,i,n),ge(String,s,"font",r.font,o,i,n),ge(kr,s,"style",r.style,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Boolean,s,"showBackground",r.showBackground,o,i,n),ge(z,s,"backgroundColor",r.backgroundColor,o,i,n),ge(H,s,"backgroundPadding",r.backgroundPadding,o,i,n),ge(H,s,"pixelOffset",r.pixelOffset,o,i,n),ge(m,s,"eyeOffset",r.eyeOffset,o,i,n),ge(_i,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ge(Mn,s,"verticalOrigin",r.verticalOrigin,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"fillColor",r.fillColor,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Lt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Lt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ge(Lt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function lje(e,t,n,i){let r=t.model;if(!l(r))return;let o=so(r.interval),s=e.model;l(s)||(e.model=s=new mp),ge(Boolean,s,"show",r.show,o,i,n),ge(RM.default,s,"uri",r.gltf,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),ge(Number,s,"maximumScale",r.maximumScale,o,i,n),ge(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),ge(Boolean,s,"runAnimations",r.runAnimations,o,i,n),ge(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),ge(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(Qa,s,"colorBlendMode",r.colorBlendMode,o,i,n),ge(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a-1;c--)n[c](s,e,t,i)}iW=void 0}function Aje(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(Ge.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=ee.secondsDifference(s,o),c=Math.round(a/120);return t=new Gd,t.startTime=ee.clone(o),t.stopTime=ee.clone(s),t.clockRange=Ro.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(o),t.clockStep=dr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Gd,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=Ro.LOOP_STOP,t.clockStep=dr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=so(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Ro[n.range],Ro.LOOP_STOP)),l(n.step)&&(t.clockStep=y(dr[n.step],dr.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function ple(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),o=y(o,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f1;--_){if(C=P.PI_OVER_TWO-(_-1)*x,w=$E(-C,o,h,g,c,f,u,d,p,w),D=$E(C+Math.PI,o,h,g,c,f,u,d,p,D),t){for(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,v=2*(_-1)+2,b=1;b1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;aP.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function oh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Pe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Pe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}oh.packedLength=m.packedLength+re.packedLength+Pe.packedLength+9;oh.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Ble=new m,Lle=new re,Nle=new Pe,rh={center:Ble,ellipsoid:Lle,vertexFormat:Nle,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};oh.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Ble);t+=m.packedLength;let r=re.unpack(e,t,Lle);t+=re.packedLength;let o=Pe.unpack(e,t,Nle);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(rh.height=f,rh.extrudedHeight=p,rh.granularity=d,rh.stRotation=u,rh.rotation=c,rh.semiMajorAxis=s,rh.semiMinorAxis=a,rh.shadowVolume=g,rh.offsetAttribute=h===-1?void 0:h,new oh(rh))};oh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,re.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Mle(n,r,o,a,s,i,t)};oh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=Ije(r);else if(o=vje(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new we({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ft({attributes:o.attributes,indices:o.indices,primitiveType:Be.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};oh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new oh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};function Pje(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Sl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c0){let h=Math.min(u,c);g=Math.round(c/h);let A=Math.min(g*u,c);for(p=0;p0&&(S=!0,C+=c-1),s0&&f!==A-1&&d!==0&&d!==x-1&&(N[Y]=!0),Y++;p=0;let Q,W;for(f=1;f=rt&&fAy.eastOverIDL-Ay.westOverIDL&&(r.west=Ay.westOverIDL,r.east=Ay.eastOverIDL,r.east>P.PI&&(r.east=r.east-P.TWO_PI),r.west>P.PI&&(r.west=r.west-P.TWO_PI)),r}var MYe=new he;function eue(e,t,n,i){let r=e.surfaceDistance,o=Math.ceil(r*t),s=o>0?r/(o-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c=0?f:f+P.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var tue=[];function BYe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let T=qn.createGeometryFromPositions(e,t,n,i,o,c,u),E=T.attributes.position.values,S=T.indices,w,D;if(s&&a){let R=E.concat(E);w=R.length/3,D=Ue.createTypedArray(w,S.length*2),D.set(S);let O=S.length,L=w/2;for(d=0;d1||w>1))for(let b=0;b0;f-=u)xe=f*3,q=ub(q,J,xe,p,x),J+=6,r.st&&(W=fb(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);if(v){let rt=_e;for(xe=rt*3,f=0;f<2;f++)q=ub(q,J,xe,p,x),J+=6,r.st&&(W=fb(W,me,rt*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1)}else for(f=u-1;f>=0;f--)xe=f*3,q=ub(q,J,xe,p,x),J+=6,r.st&&(W=fb(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);let De=tqe(q,r,a);r.st&&(De.attributes.st=new we({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:W})),n&&(De.attributes.extrudeDirection=new we({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Y})),O&&(De.attributes.applyOffset=new we({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Ee=Ue.createTypedArray(U,k*6),Ne,ke,Re,dt;g=q.length/3;let _t=0;for(f=0;f0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new vn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}mb.prototype.remove=function(e){Oue(this._solidItems,e)||Oue(this._translucentItems,e)};function Rue(e,t,n){let i=!1,r=t.length;for(let o=0;o0)for(o=0;o=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new vn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};hb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Dc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};pb.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xr.getValue(e,this.materialProperty,this.material),n=new Dc({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};gb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new vn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o0)for(d=!0,t=0;t0)for(d=!0,t=0;t0)for(s=new Array(r),i=0;i0)for(a=new Array(r),i=0;i0)for(s=new Array(r),i=0;i0)for(a=new Array(r),i=0;i-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(A){d._removeUpdater(A),d._insertUpdaterIntoBatch(e,A)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new aB(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(A){d._insertUpdaterIntoBatch(e,A)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Pf._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var cB=Pf;var Zqe=1,Qqe="30px sans-serif",$qe=kr.FILL,eXe=z.WHITE,tXe=z.BLACK,nXe=1,iXe=!1,rXe=new z(.165,.165,.165,.8),oXe=new H(7,5),sXe=H.ZERO,aXe=m.ZERO,cXe=qe.NONE,lXe=_i.CENTER,uXe=Mn.CENTER,fXe=new m,dXe=new z,mXe=new z,hXe=new z,pXe=new H,_Xe=new m,gXe=new H,yXe=new Lt,AXe=new Lt,xXe=new Lt,CXe=new Dt;function Yue(e){this.entity=e,this.label=void 0,this.index=void 0}function Cy(e,t){t.collectionChanged.addEventListener(Cy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Cy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new Yue(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Yue(o)):(bW(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],bW(s.get(o.id),o,a),s.remove(o.id)};function bW(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var lB=Cy;async function TXe(e,t,n){return await e._readyPromise,SXe(e,t,n)}function EXe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let r=i.then(vXe(n)).catch(wXe(n));return e.shift(),t.push(r),!0}function bXe(e){return new Promise(function(t){setTimeout(t,e)})}function SW(e,t){return e.length?EXe(e,t)?SW(e,t):bXe(100).then(()=>SW(e,t)):Promise.resolve()}function SXe(e,t,n){let i=e.tilingScheme,r,o=[],s={};for(r=0;r0&&await Xue(e,s),t}var E_=Xue;var DXe=1,IXe=0,PXe=!0,OXe=!0,RXe=xn.ENABLED,MXe=qe.NONE,BXe=z.RED,LXe=0,NXe=z.WHITE,FXe=Qa.HIGHLIGHT,UXe=.5,VXe=new H(1,1),kXe=new B,zXe=new B,Kue=new z,Jue=new Array(4),HXe=new m;function lh(e,t){t.collectionChanged.addEventListener(lh.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function GXe(e,t,n,i){let r=e._primitives,o=e._modelHash;try{let s=await Pd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(o[t.id]))return;s.id=t,r.add(s),o[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(o[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(o[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(o[t.id]))return;console.log(s),o[t.id].loadFailed=!0}}lh.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r-1;i--)wW(this,e[i],t,n);return ue(this)};lh._sampleTerrainMostDetailed=E_;var Cb=new m,Zue=new he;lh.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene.globe,s=l(o)?o.terrainProvider:void 0,a=i.heightReference!==qe.NONE;if(l(o)&&a){let c=o.ellipsoid;if(!s._ready)return lt.PENDING;let u=i.modelMatrix;Cb.x=u[12],Cb.y=u[13],Cb.z=u[14];let f=c.cartesianToCartographic(Cb);if(!l(s.availability)){i.heightReference===qe.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,lt.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,lt.FAILED):l(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,lt.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(he.clone(f,Zue),this._modelHash[e.id].awaitingSampleTerrain=!0,lh._sampleTerrainMostDetailed(s,[Zue]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let A=h[0];i.heightReference===qe.RELATIVE_TO_GROUND&&(A.height+=f.height),c.cartographicToCartesian(A,Cb),ae.clone(i.boundingSphere,d),d.center=Cb,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),lt.PENDING)}return ae.clone(i.boundingSphere,t),lt.DONE};lh.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(WXe(o,a),s.set(o.id,o)):(wW(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],wW(this,o,a,c),s.remove(o.id)};function wW(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function WXe(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var fB=lh;function Ty(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Ty.prototype,{isConstant:{get:function(){return j.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:tr.FIXED}}});Ty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,tr.FIXED,t)};Ty.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Ty.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?re.WGS84.scaleToGeodeticSurface(n,n):void 0};Ty.prototype.equals=function(e){return this===e||e instanceof Ty&&this._value===e._value};Ty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uh=Ty;var jXe=60,YXe=1,efe=new Tn,DW=new Tn,IW=new Tn;function Que(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function qXe(e,t,n,i,r,o,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,o,c[u]),l(f)&&(c[u++]=f);let d=!l(r)||ee.lessThanOrEquals(r,t)||ee.greaterThanOrEquals(r,n),p=0,g=i.length,h=i[p],A=n,x=!1,C,T,E;for(;p0&&!x){let S=i[p+1],w=ee.secondsDifference(S,h);x=w>s,x&&(C=Math.ceil(w/s),T=0,E=w/Math.max(C,2),C=Math.max(C-1,1))}if(x&&T0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=j.getValueOrDefault(i._resolution,e,jXe);c.show=!0,c.positions=nfe(r,o,s,e,this._referenceFrame,f,c.positions.slice()),c.material=Xr.getValue(e,i._material,c.material),c.width=j.getValueOrDefault(i._width,e,YXe),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};dB.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};dB.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Ey(e,t){t.collectionChanged.addEventListener(Ey.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Ey.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new Que(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new Que(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};Ey._subSample=nfe;var mB=Ey;var ife=z.WHITE,rfe=z.BLACK,ofe=0,sfe=1,afe=0,cfe=new z,QXe=new m,lfe=new z,ufe=new Lt,ffe=new Lt,dfe=new Dt;function mfe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function by(e,t){t.collectionChanged.addEventListener(by.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}by.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i0?(u.scale=1,g=g||C!==o.outlineWidth||T!==o.pixelSize||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)):(u.scale=T/50,T=50,g=g||C!==o.outlineWidth||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)),g){o.color=z.clone(A,o.color),o.outlineColor=z.clone(x,o.outlineColor),o.pixelSize=T,o.outlineWidth=C;let E=A.alpha,S=A.toCssColorString(),w=x.toCssColorString(),D=JSON.stringify([S,T,w,C]);u.setImage(D,GA(E,S,w,C,T))}h&&u._updateClamping()}}return!0};by.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return lt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return lt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};by.prototype.isDestroyed=function(){return!1};by.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(by.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new mfe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new mfe(o)):(hB(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],hB(s.get(o.id),o,a),s.remove(o.id)};function hB(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var pB=by;var yfe=[];function $Xe(e,t,n,i,r){let o=yfe;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s0?new Array(r):void 0;for(i=0;i0){let M=0,F=d[0];i=i.filter(function(k,V){let G=!1;return r?G=V===F||V===0&&F===1:G=V+1===F,G?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===Qt.GEODESIC||o===Qt.RHUMB){let M,F;o===Qt.GEODESIC?(M=P.chordLength(s,a.maximumRadius),F=Di.numberOfPoints):(M=s,F=Di.numberOfPointsRhumbLine);let k=Di.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c0)return ae.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};gB.prototype.isDestroyed=function(){return!1};gB.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=dk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete dk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var yB=Qd;var cKe=new z,lKe=new Dt,uKe=new Dt;function $d(e,t,n,i,r){let o;n instanceof Vt?o=Uo:o=Ks,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener($d.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=r}$d.prototype.onMaterialChanged=function(){this.invalidated=!0};$d.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};$d.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};$d.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};$d.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new fd({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ks&&(this.material=Xr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ks&&(this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};Eb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Efe(this,f),bfe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),Efe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new yB(c,this._scene),this._updaters.set(u,f),bfe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(fh._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var xB=fh;function Of(e){Dc.initializeTerrainHeights(),fd.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new wo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Of.defaultVisualizersCallback);let i=!1,r=new bl,o=new bl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;ugKe*s.maximumRadius?(d=Dfe,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,OW),p=m.cross(g,d,mk),m.magnitude(p)>P.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,OW),m.normalize(g,g),u=!0)):m.equalsEpsilon(c,T,P.EPSILON7)||(g=Dfe,m.normalize(D,g),m.normalize(R,R),p=m.cross(g,R,OW),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,P.EPSILON7)||(d=m.cross(p,g,mk),Z.multiplyByVector(w,d,d),Z.multiplyByVector(w,p,p),Z.multiplyByVector(w,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,A,x;i&&(h=m.clone(t.position,RW),A=m.clone(t.direction,Ife),x=m.clone(t.up,Pfe));let C=_Ke;u?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(A,t.direction),m.clone(x,t.up),m.cross(A,x,t.right))}if(n){let u=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function TB(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,re.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(TB,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});TB.defaultOffset3D=new m(-14e3,3500,3500);var hk=new pu,AKe=new m;TB.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===ne.MORPHING)return;let o=this.entity,s=o.position;if(!l(s))return;let a=o!==this._lastEntity,c=r!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=o.viewFrom,g=l(p);if(!g&&l(t)){hk.pitch=-P.PI_OVER_FOUR,hk.range=0;let h=s.getValue(e,AKe);if(l(h)){let A=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);hk.pitch*=A}u.viewBoundingSphere(t,hk),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&m.clone(TB._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(u.position,this._offset3D);this._lastEntity=o,this._mode=r,yKe(this,u,f,d,s,e,i)};var EB=TB;function Ck(e){return Tk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function Tk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?Tk(n):n),[])}var Ofe=[0,1,2,3].concat(...Ck([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ao(){let e=this;function t(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,h,A,x=0;for(g=0;g<=15;g++)r.bl_count[g]=0;for(o[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<573;f++)d=r.heap[f],g=o[o[d*2+1]*2+1]+1,g>u&&(g=u,x++),o[d*2+1]=g,!(d>e.max_code)&&(r.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),A=o[d*2],r.opt_len+=A*(g+h),s&&(r.static_len+=A*(s[d*2+1]+h)));if(x!==0){do{for(g=u-1;r.bl_count[g]===0;)g--;r.bl_count[g]--,r.bl_count[g+1]+=2,r.bl_count[u]--,x-=2}while(x>0);for(g=u;g!==0;g--)for(d=r.bl_count[g];d!==0;)p=r.heap[--f],!(p>e.max_code)&&(o[p*2+1]!=g&&(r.opt_len+=(g-o[p*2+1])*o[p*2],o[p*2+1]=g),d--)}}function n(r,o){let s=0;do s|=r&1,r>>>=1,s<<=1;while(--o>0);return s>>>1}function i(r,o,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=o;f++)d=r[f*2+1],d!==0&&(r[f*2]=n(a[d]++,d))}e.build_tree=function(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(r.heap_len=0,r.heap_max=573,c=0;c=1;c--)r.pqdownheap(o,c);d=a;do c=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),u=r.heap[1],r.heap[--r.heap_max]=c,r.heap[--r.heap_max]=u,o[d*2]=o[c*2]+o[u*2],r.depth[d]=Math.max(r.depth[c],r.depth[u])+1,o[c*2+1]=o[u*2+1]=d,r.heap[1]=d++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],t(r),i(o,e.max_code,r.bl_count)}}ao._length_code=[0,1,2,3,4,5,6,7].concat(...Ck([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ao.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ao.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ao.d_code=function(e){return e<256?Ofe[e]:Ofe[256+(e>>>7)]};ao.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ao.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ao.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ao.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wa(e,t,n,i,r){let o=this;o.static_tree=e,o.extra_bits=t,o.extra_base=n,o.elems=i,o.max_length=r}var xKe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],CKe=Ck([[144,8],[112,9],[24,7],[8,8]]);wa.static_ltree=Tk(xKe.map((e,t)=>[e,CKe[t]]));var TKe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],EKe=Ck([[30,5]]);wa.static_dtree=Tk(TKe.map((e,t)=>[e,EKe[t]]));wa.static_l_desc=new wa(wa.static_ltree,ao.extra_lbits,256+1,286,15);wa.static_d_desc=new wa(wa.static_dtree,ao.extra_dbits,0,30,15);wa.static_bl_desc=new wa(null,ao.extra_blbits,0,19,7);var bKe=9,SKe=8;function dh(e,t,n,i,r){let o=this;o.good_length=e,o.max_lazy=t,o.nice_length=n,o.max_chain=i,o.func=r}var Mfe=0,Ak=1,Mx=2,em=[new dh(0,0,0,0,Mfe),new dh(4,4,8,4,Ak),new dh(4,5,16,8,Ak),new dh(4,6,32,32,Ak),new dh(4,4,16,16,Mx),new dh(8,16,32,32,Mx),new dh(8,16,128,128,Mx),new dh(8,32,128,256,Mx),new dh(32,128,258,1024,Mx),new dh(32,258,258,4096,Mx)],pk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Rf=0,_k=1,bB=2,gk=3,vKe=32,MW=42,yk=113,SB=666,BW=8,wKe=0,LW=1,DKe=2,yo=3,xk=258,_u=xk+yo+1;function Rfe(e,t,n,i){let r=e[t*2],o=e[n*2];return r=3&&k[ao.bl_order[Ve]*2+1]===0;Ve--);return e.opt_len+=3*(Ve+1)+5+5+4,Ve}function De(Ve){e.pending_buf[e.pending++]=Ve}function Ee(Ve){De(Ve&255),De(Ve>>>8&255)}function Ne(Ve){De(Ve>>8&255),De(Ve&255&255)}function ke(Ve,ot){let je,Qe=ot;J>16-Qe?(je=Ve,K|=je<>>16-J,J+=Qe-16):(K|=Ve<=8&&(De(K&255),K>>>=8,J-=8)}function hn(){ke(LW<<1,3),Re(256,wa.static_ltree),rt(),1+W+10-J<9&&(ke(LW<<1,3),Re(256,wa.static_ltree),rt()),W=7}function Rn(Ve,ot){let je,Qe,pt;if(e.dist_buf[Y]=Ve,e.lc_buf[Y]=ot&255,Y++,Ve===0?M[ot*2]++:(Q++,Ve--,M[(ao._length_code[ot]+256+1)*2]++,F[ao.d_code(Ve)*2]++),!(Y&8191)&&_>2){for(je=Y*8,Qe=w-C,pt=0;pt<30;pt++)je+=F[pt*2]*(5+ao.extra_dbits[pt]);if(je>>>=3,Q8?Ee(K):J>0&&De(K&255),K=0,J=0}function Te(Ve,ot,je){Ut(),W=8,je&&(Ee(ot),Ee(~ot)),e.pending_buf.set(c.subarray(Ve,Ve+ot),e.pending),e.pending+=ot}function Ae(Ve,ot,je){ke((wKe<<1)+(je?1:0),3),Te(Ve,ot,!0)}function ut(Ve,ot,je){let Qe,pt,zt=0;_>0?(V.build_tree(e),G.build_tree(e),zt=xe(),Qe=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Qe&&(Qe=pt)):Qe=pt=ot+5,ot+4<=Qe&&Ve!=-1?Ae(Ve,ot,je):pt==Qe?(ke((LW<<1)+(je?1:0),3),Gt(wa.static_ltree,wa.static_dtree)):(ke((DKe<<1)+(je?1:0),3),_t(V.max_code+1,G.max_code+1,zt+1),Gt(M,F)),ye(),je&&Ut()}function ii(Ve){ut(C>=0?C:-1,w-C,Ve),C=w,t.flush_pending()}function Je(){let Ve,ot,je,Qe;do{if(Qe=u-R-w,Qe===0&&w===0&&R===0)Qe=o;else if(Qe==-1)Qe--;else if(w>=o+o-_u){c.set(c.subarray(o,o+o),0),D-=o,w-=o,C-=o,Ve=g,je=Ve;do ot=d[--je]&65535,d[je]=ot>=o?ot-o:0;while(--Ve!==0);Ve=o,je=Ve;do ot=f[--je]&65535,f[je]=ot>=o?ot-o:0;while(--Ve!==0);Qe+=o}if(t.avail_in===0)return;Ve=t.read_buf(c,w+R,Qe),R+=Ve,R>=yo&&(p=c[w]&255,p=(p<i-5&&(ot=i-5);;){if(R<=1){if(Je(),R===0&&Ve==0)return Rf;if(R===0)break}if(w+=R,R=0,je=C+ot,(w===0||w>=je)&&(R=w-je,w=je,ii(!1),t.avail_out===0)||w-C>=o-_u&&(ii(!1),t.avail_out===0))return Rf}return ii(Ve==4),t.avail_out===0?Ve==4?bB:Rf:Ve==4?gk:_k}function ts(Ve){let ot=L,je=w,Qe,pt,zt=O,Jt=w>o-_u?w-(o-_u):0,rr=I,gr=a,ns=w+xk,Vs=c[je+zt-1],lo=c[je+zt];O>=v&&(ot>>=2),rr>R&&(rr=R);do if(Qe=Ve,!(c[Qe+zt]!=lo||c[Qe+zt-1]!=Vs||c[Qe]!=c[je]||c[++Qe]!=c[je+1])){je+=2,Qe++;do;while(c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&c[++je]==c[++Qe]&&jezt){if(D=Ve,zt=pt,pt>=rr)break;Vs=c[je+zt-1],lo=c[je+zt]}}while((Ve=f[Ve&gr]&65535)>Jt&&--ot!==0);return zt<=R?zt:R}function Ba(Ve){let ot=0,je;for(;;){if(R<_u){if(Je(),R<_u&&Ve==0)return Rf;if(R===0)break}if(R>=yo&&(p=(p<=yo)if(je=Rn(w-D,T-yo),R-=T,T<=N&&R>=yo){T--;do w++,p=(p<=yo&&(p=(p<4096)&&(T=yo-1)),O>=yo&&T<=O){Qe=w+R-yo,je=Rn(w-1-E,O-yo),R-=O-1,O-=2;do++w<=Qe&&(p=(p<bKe||Qe!=BW||je<9||je>15||ot<0||ot>9||zt<0||zt>2?-2:(Ve.dstate=e,s=je,o=1<9||je<0||je>2?-2:(em[_].func!=em[ot].func&&Ve.total_in!==0&&(Qe=Ve.deflate(1)),_!=ot&&(_=ot,N=em[_].max_lazy,v=em[_].good_length,I=em[_].nice_length,L=em[_].max_chain),b=je,Qe)},e.deflateSetDictionary=function(Ve,ot,je){let Qe=je,pt,zt=0;if(!ot||n!=MW)return-2;if(Qeo-_u&&(Qe=o-_u,zt=je-Qe),c.set(ot.subarray(zt,zt+Qe),0),w=Qe,C=Qe,p=c[0]&255,p=(p<4||ot<0)return-2;if(!Ve.next_out||!Ve.next_in&&Ve.avail_in!==0||n==SB&&ot!=4)return Ve.msg=pk[2- -2],-2;if(Ve.avail_out===0)return Ve.msg=pk[2- -5],-5;if(t=Ve,zt=r,r=ot,n==MW&&(Qe=BW+(s-8<<4)<<8,pt=(_-1&255)>>1,pt>3&&(pt=3),Qe|=pt<<6,w!==0&&(Qe|=vKe),Qe+=31-Qe%31,n=yk,Ne(Qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return r=-1,0}else if(t.avail_in===0&&ot<=zt&&ot!=4)return t.msg=pk[2- -5],-5;if(n==SB&&t.avail_in!==0)return Ve.msg=pk[2- -5],-5;if(t.avail_in!==0||R!==0||ot!=0&&n!=SB){switch(Jt=-1,em[_].func){case Mfe:Jt=ar(ot);break;case Ak:Jt=Ba(ot);break;case Mx:Jt=No(ot);break;default:}if((Jt==bB||Jt==gk)&&(n=SB),Jt==Rf||Jt==bB)return t.avail_out===0&&(r=-1),0;if(Jt==_k){if(ot==1)hn();else if(Ae(0,0,!1),ot==3)for(je=0;jen&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function PKe(e){let t=this,n=new Bfe,i=OKe(e&&e.chunkSize?e.chunkSize:64*1024),r=0,o=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=o,t.append=function(a,c){let u,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(r),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(o)):h.push(o.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(A){f.set(A,p),p+=A.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(o.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function OKe(e){return e+5*(Math.floor(e/16383)+1)}var Lfe=PKe;var gu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],tde=1440,RKe=0,MKe=4,BKe=9,LKe=5,NKe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],FKe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],UKe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],VKe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],kKe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],zKe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Sy=15;function VW(){let e=this,t,n,i,r,o,s;function a(u,f,d,p,g,h,A,x,C,T,E){let S,w,D,R,O,L,N,_,b,v,I,M,F,k,V;v=0,O=d;do i[u[f+v]]++,v++,O--;while(O!==0);if(i[0]==d)return A[0]=-1,x[0]=0,0;for(_=x[0],L=1;L<=Sy&&i[L]===0;L++);for(N=L,_O&&(_=O),x[0]=_,k=1<M+_;){if(R++,M+=_,V=D-M,V=V>_?_:V,(w=1<<(L=N-M))>S+1&&(w-=S+1,F=N,Ltde)return-3;o[R]=I=T[0],T[0]+=V,R!==0?(s[R]=O,r[0]=L,r[1]=_,L=O>>>M-_,r[2]=I-o[R-1]-L,C.set(r,(o[R-1]+L)*3)):A[0]=I}for(r[1]=N-M,v>=d?r[0]=128+64:E[v]>>M;L>>=1)O^=L;for(O^=L,b=(1<257?(T==-3?C.msg="oversubscribed distance tree":T==-5?(C.msg="incomplete distance tree",T=-3):T!=-4&&(C.msg="empty distance tree with lengths",T=-3),T):0)}}VW.inflate_trees_fixed=function(e,t,n,i){return e[0]=BKe,t[0]=LKe,n[0]=NKe,i[0]=FKe,0};var Ek=0,Nfe=1,Ffe=2,Ufe=3,Vfe=4,kfe=5,zfe=6,NW=7,Hfe=8,bk=9;function HKe(){let e=this,t,n=0,i,r=0,o=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,h=0;function A(x,C,T,E,S,w,D,R){let O,L,N,_,b,v,I,M,F,k,V,G,U,q,Y,Q;I=R.next_in_index,M=R.avail_in,b=D.bitb,v=D.bitk,F=D.write,k=F>=L[Q+1],v-=L[Q+1],D.win[F++]=L[Q+2],k--;continue}do{if(b>>=L[Q+1],v-=L[Q+1],_&16){for(_&=15,U=L[Q+2]+(b&gu[_]),b>>=_,v-=_;v<15;)M--,b|=(R.read_byte(I++)&255)<>=L[Q+1],v-=L[Q+1],_&16){for(_&=15;v<_;)M--,b|=(R.read_byte(I++)&255)<>=_,v-=_,k-=U,F>=q)Y=F-q,F-Y>0&&2>F-Y?(D.win[F++]=D.win[Y++],D.win[F++]=D.win[Y++],U-=2):(D.win.set(D.win.subarray(Y,Y+2),F),F+=2,Y+=2,U-=2);else{Y=F-q;do Y+=D.end;while(Y<0);if(_=D.end-Y,U>_){if(U-=_,F-Y>0&&_>F-Y)do D.win[F++]=D.win[Y++];while(--_!==0);else D.win.set(D.win.subarray(Y,Y+_),F),F+=_,Y+=_,_=0;Y=0}}if(F-Y>0&&U>F-Y)do D.win[F++]=D.win[Y++];while(--U!==0);else D.win.set(D.win.subarray(Y,Y+U),F),F+=U,Y+=U,U=0;break}else if(!(_&64))O+=L[Q+2],O+=b&gu[_],Q=(N+O)*3,_=L[Q];else return R.msg="invalid distance code",U=R.avail_in-M,U=v>>3>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,-3;while(!0);break}if(_&64)return _&32?(U=R.avail_in-M,U=v>>3>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,1):(R.msg="invalid literal/length code",U=R.avail_in-M,U=v>>3>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,-3);if(O+=L[Q+2],O+=b&gu[_],Q=(N+O)*3,(_=L[Q])===0){b>>=L[Q+1],v-=L[Q+1],D.win[F++]=L[Q+2],k--;break}}while(!0)}while(k>=258&&M>=10);return U=R.avail_in-M,U=v>>3>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,0}e.init=function(x,C,T,E,S,w){t=Ek,u=x,f=C,d=T,p=E,g=S,h=w,i=null},e.proc=function(x,C,T){let E,S,w,D=0,R=0,O=0,L,N,_,b;for(O=C.next_in_index,L=C.avail_in,D=x.bitb,R=x.bitk,N=x.write,_=N=258&&L>=10&&(x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,T=A(u,f,d,p,g,h,x,C),O=C.next_in_index,L=C.avail_in,D=x.bitb,R=x.bitk,N=x.write,_=N>>=i[S+1],R-=i[S+1],w=i[S],w===0){s=i[S+2],t=zfe;break}if(w&16){a=w&15,n=i[S+2],t=Ffe;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}if(w&32){t=NW;break}return t=bk,C.msg="invalid literal/length code",T=-3,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);case Ffe:for(E=a;R>=E,R-=E,o=f,i=g,r=h,t=Ufe;case Ufe:for(E=o;R>=i[S+1],R-=i[S+1],w=i[S],w&16){a=w&15,c=i[S+2],t=Vfe;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}return t=bk,C.msg="invalid distance code",T=-3,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);case Vfe:for(E=a;R>=E,R-=E,t=kfe;case kfe:for(b=N-c;b<0;)b+=x.end;for(;n!==0;){if(_===0&&(N==x.end&&x.read!==0&&(N=0,_=N7&&(R-=8,L++,O--),x.write=N,T=x.inflate_flush(C,T),N=x.write,_=NA.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C,E==n.end&&(E=0,n.write==n.end&&(n.write=0),C=n.write-E,C>A.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C),A.next_out_index=T,n.read=E,x},n.proc=function(A,x){let C,T,E,S,w,D,R,O;for(S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,R=D>>1){case 0:T>>>=3,E-=3,C=E&7,T>>>=C,E-=C,i=FW;break;case 1:L=[],N=[],_=[[]],b=[[]],VW.inflate_trees_fixed(L,N,_,b),f.init(L[0],N[0],_[0],0,b[0],0),T>>>=3,E-=3,i=Sk;break;case 2:T>>>=3,E-=3,i=jfe;break;case 3:return T>>>=3,E-=3,i=Bx,A.msg="invalid block type",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x)}break;case FW:for(;E<32;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<>>16&65535)!=(T&65535))return i=Bx,A.msg="invalid stored block lengths",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);r=T&65535,T=E=0,i=r!==0?Wfe:d!==0?vk:Sb;break;case Wfe:if(w===0||R===0&&(D==n.end&&n.read!==0&&(D=0,R=Dw&&(C=w),C>R&&(C=R),n.win.set(A.read_buf(S,C),D),S+=C,w-=C,D+=C,R-=C,(r-=C)!==0)break;i=d!==0?vk:Sb;break;case jfe:for(;E<14;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<29||(C>>5&31)>29)return i=Bx,A.msg="too many length or distance symbols",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);if(C=258+(C&31)+(C>>5&31),!a||a.length>>=14,E-=14,s=0,i=Yfe;case Yfe:for(;s<4+(o>>>10);){for(;E<3;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<>>=3,E-=3}for(;s<19;)a[Gfe[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,A),C!=0)return x=C,x==-3&&(a=null,i=Bx),n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);s=0,i=qfe;case qfe:for(;C=o,!(s>=258+(C&31)+(C>>5&31));){let k,V;for(C=c[0];E>>=C,E-=C,a[s++]=V;else{for(O=V==18?7:V-14,k=V==18?11:3;E>>=C,E-=C,k+=T&gu[O],T>>>=O,E-=O,O=s,C=o,O+k>258+(C&31)+(C>>5&31)||V==16&&O<1)return a=null,i=Bx,A.msg="invalid bit length repeat",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);V=V==16?a[O-1]:0;do a[O++]=V;while(--k!==0);s=O}}if(u[0]=-1,v=[],I=[],M=[],F=[],v[0]=9,I[0]=6,C=o,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,v,I,M,F,p,A),C!=0)return C==-3&&(a=null,i=Bx),x=C,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);f.init(v[0],I[0],p,M[0],p,F[0]),i=Sk;case Sk:if(n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,(x=f.proc(n,A,x))!=1)return n.inflate_flush(A,x);if(x=0,f.free(A),S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,R=D15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new GKe(n,1<>4)+8>s.wbits){s.mode=vy,n.msg="invalid win size",s.marker=5;break}s.mode=Kfe;case Kfe:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,o=n.read_byte(n.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=vy,n.msg="incorrect header check",s.marker=5;break}if(!(o&WKe)){s.mode=vB;break}s.mode=Jfe;case Jfe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Zfe;case Zfe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Qfe;case Qfe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=$fe;case $fe:return n.avail_in===0?r:(r=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=UW,2);case UW:return s.mode=vy,n.msg="need dictionary",s.marker=0,-2;case vB:if(r=s.blocks.proc(n,r),r==-3){s.mode=vy,s.marker=0;break}if(r==0&&(r=i),r!=1)return r;r=i,s.blocks.reset(n,s.was),s.mode=ede;case ede:return n.avail_in=0,1;case vy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,r){let o=0,s=r;if(!n||!n.istate||n.istate.mode!=UW)return-2;let a=n.istate;return s>=1<0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(h),u.forEach(function(A){d.set(A,g),g+=A.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var ide=KKe;var JKe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},vl=Object.assign({},JKe);function wk(){return vl}function vb(e){if(e.baseURL!==void 0&&(vl.baseURL=e.baseURL),e.chunkSize!==void 0&&(vl.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(vl.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(vl.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(vl.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(vl.Deflate=e.Deflate),e.Inflate!==void 0&&(vl.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");vl.workerScripts||(vl.workerScripts={}),vl.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");vl.workerScripts||(vl.workerScripts={}),vl.workerScripts.inflate=e.workerScripts.inflate}}}var rde=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;rde[e]=t}var kW=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,r=t.length|0;i>>8^rde[(n^t[i])&255];this.crc=n}get(){return~this.crc}},wy=kW;var wB=ZKe;function ZKe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=wl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=wl.getPartial(r);return i.push(wl.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},zW={bytes:{fromBits(e){let n=wl.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=wl.concat(t,[wl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var GW={};GW.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],A=4,x,C,T;for(let E=0;E>>24]^a[p>>16&255]^c[g>>8&255]^u[h&255]^n[A],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^u[d&255]^n[A+1],T=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^u[p&255]^n[A+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[A+3],A+=4,d=x,p=C,g=T;for(let E=0;E<4;E++)r[t?3&-E:E]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[A++],x=d,d=p,p=g,g=h,h=x;return r}};var WW={};WW.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=wl.bitLength(t);for(let o=0;or&&(e=n.hash(e));for(let o=0;oe.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function yu(e,t,n){return e.subarray(t,n)}var Ib=12,Pk=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),pde(i,t)}append(t){let n=this;if(n.password){let i=dde(n,t.subarray(0,Ib));if(n.password=null,i[Ib-1]!=n.passwordVerification)throw new Error(Db);t=t.subarray(Ib)}return dde(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},Ok=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),pde(i,t)}append(t){let n=this,i,r;if(n.password){n.password=null;let o=crypto.getRandomValues(new Uint8Array(Ib));o[Ib-1]=n.passwordVerification,i=new Uint8Array(t.length+o.length),i.set(mde(n,o),0),r=Ib}else i=new Uint8Array(t.length),r=0;return i.set(mde(n,t),r),i}flush(){return{data:new Uint8Array(0)}}};function dde(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),e.keys[2]=~e.crcKey2.get()}function _de(e){let t=e.keys[2]|2;return gde(Math.imul(t,t^1)>>>8)}function gde(e){return e&255}function hde(e){return e&4294967295}var Mk="deflate",Bk="inflate",Rk="Invalid signature",XW=class{constructor(t,{signature:n,password:i,signed:r,compressed:o,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:r,compressed:o,inflate:o&&new t({chunkSize:u}),crc32:r&&new wy,zipCrypto:s,decrypt:f&&s?new Pk(i,a):new Dk(i,r,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let r=t.decrypt.flush();if(!r.valid)throw new Error(Rk);i=r.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let r=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),r.setUint32(0,n),t.signature!=r.getUint32(0,!1))throw new Error(Rk)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},KW=class{constructor(t,{encrypted:n,signed:i,compressed:r,level:o,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:r,deflate:r&&new t({level:o||5,chunkSize:f}),crc32:i&&new wy,zipCrypto:s,encrypt:n&&s?new Ok(a,c):new Ik(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let r=t.encrypt.flush();n=r.signature;let o=new Uint8Array(i.length+r.data.length);o.set(i,0),o.set(r.data,i.length),i=o}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function yde(e,t,n){if(t.codecType.startsWith(Mk))return new KW(e,t,n);if(t.codecType.startsWith(Bk))return new XW(e,t,n)}var Ade="init",xde="append",JW="flush",aJe="message",Cde=!0,Lk=(e,t,n,i,r,o,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,r(e)}}),o?lJe(e,i):cJe(e,i));function cJe(e,t){let n=yde(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(r){throw e.onTaskFinished(),r}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function lJe(e,t){let n,i={type:"module"};if(!e.interface){if(!Cde)e.worker=r(i,t.baseURL);else try{e.worker=r({},t.baseURL)}catch{Cde=!1,e.worker=r(i,t.baseURL)}e.worker.addEventListener(aJe,a,!1),e.interface={append(c){return o({type:xde,data:c})},flush(){return o({type:JW})},abort(){e.onTaskFinished()}}}return e.interface;function r(c,u){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,u)}catch{d=f}return new Worker(d,c)}async function o(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:Ade,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==Ade||d==JW||d==xde){let p=u.data;d==JW?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var Lx=[],ZW=[];function Nk(e,t,n){let r=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),o=r&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Lx.length!c.busy);return a?(Tde(a),Lk(a,e,t,n,s,r,o)):new Promise(c=>ZW.push({resolve:c,codecConstructor:e,options:t,webWorker:r,scripts:o}))}function s(a){if(ZW.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=ZW.splice(0,1);c(Lk(a,u,f,n,s,d,p))}else a.worker?(Tde(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{Lx=Lx.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):Lx=Lx.filter(c=>c!=a)}}function Tde(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var bde="Abort error";async function Fk(e,t,n,i,r,o,s){let a=Math.max(o.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal;if(u{t.onload=r=>n(r.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var Hk=class extends PB{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}async writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,r=this.pending.length;for(this.pending="",n=0;n2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},Nx=class extends Vk{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(new Uint8Array(s.target.result)),i.onerror=()=>o(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},Pb=class extends PB{constructor(t){super(),this.contentType=t,this.arrayBuffers=[]}async writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.blob=new Blob(this.arrayBuffers,{type:this.contentType})),this.blob}};var Ob="/",e7=new Date(2107,11,31),t7=new Date(1980,0,1);var uJe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Sde=e=>{let t="";for(let n=0;n"u"){let n=new FileReader;return new Promise((i,r)=>{n.onload=o=>i(o.target.result),n.onerror=()=>r(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var dJe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],S_=class{constructor(t){dJe.forEach(n=>this[n]=t[n])}};var r7="File format is not recognized",_Je="End of central directory not found",gJe="End of Zip64 central directory not found",yJe="End of Zip64 central directory locator not found",AJe="Central directory header not found",xJe="Local file header not found",CJe="Zip64 extra field not found",TJe="File contains encrypted entry",EJe="Encryption method not supported",vde="Compression method not supported",wde="utf-8",Dde="cp437",Ide=["uncompressedSize","compressedSize","offset"],Qk=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:wk()})}async getEntries(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(r7);let r=await DJe(i,101010256,i.size,22,65535*16);if(!r)throw new Error(_Je);let o=cc(r),s=oa(o,12),a=oa(o,16),c=Au(o,8),u=0;if(a==4294967295||s==4294967295||c==65535){let h=await Iy(i,r.offset-20,20),A=cc(h);if(oa(A,0)!=117853008)throw new Error(gJe);a=Wk(A,8);let x=await Iy(i,a,56),C=cc(x),T=r.offset-20-56;if(oa(C,0)!=101075792&&a!=T){let E=a;a=T,u=a-E,x=await Iy(i,a,56),C=cc(x)}if(oa(C,0)!=101075792)throw new Error(yJe);c=Wk(C,32),s=Wk(C,40),a-=s}if(a<0||a>=i.size)throw new Error(r7);let f=0,d=await Iy(i,a,s),p=cc(d);if(s){let h=r.offset-s;if(oa(p,f)!=33639248&&a!=h){let A=a;a=h,u=a-A,d=await Iy(i,a,s),p=cc(d)}}if(a<0||a>=i.size)throw new Error(r7);let g=[];for(let h=0;hA.getData(b,_,v),g.push(_),f=D,t.onprogress)try{t.onprogress(h+1,c,new S_(A))}catch{}}return g}async close(){}};var s7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let r=this,{reader:o,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=r,h=r.localDirectory={};o.initialized||await o.init();let A=await Iy(o,s,30),x=cc(A),C=Rb(r,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(vde);if(c!=0&&c!=8)throw new Error(vde);if(oa(x,0)!=67324752)throw new Error(xJe);Ode(h,x,4),A=await Iy(o,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=A.subarray(30+h.filenameLength),await Rde(r,h,x,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let T=r.encrypted&&h.encrypted,E=T&&!a;if(T){if(!E&&a.strength===void 0)throw new Error(EJe);if(!C)throw new Error(TJe)}let S=await Nk(u.Inflate,{codecType:Bk,password:C,zipCrypto:E,encryptionStrength:a&&a.strength,signed:Rb(r,i,"checkSignature"),passwordVerification:E&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:T,useWebWorkers:Rb(r,i,"useWebWorkers")},u);t.initialized||await t.init();let w=Rb(r,i,"signal"),D=s+30+h.filenameLength+h.extraFieldLength;return await Fk(S,o,t,D,g,u,{onprogress:i.onprogress,signal:w}),t.getData()}};function Ode(e,t,n){let i=e.rawBitFlag=Au(t,n+2),r=(i&1)==1,o=oa(t,n+6);Object.assign(e,{encrypted:r,version:Au(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:IJe(o),filenameLength:Au(t,n+22),extraFieldLength:Au(t,n+24)})}async function Rde(e,t,n,i){let r=t.rawExtraField,o=t.extraField=new Map,s=cc(new Uint8Array(r)),a=0;try{for(;at[r]==4294967295);for(let r=0;r{if(t[r]==4294967295)if(e[r]!==void 0)t[r]=e[r];else throw new Error(CJe)})}async function Pde(e,t,n,i,r){let o=cc(e.data);e.version=Mb(o,0),e.signature=oa(o,1);let s=new wy;s.append(r[n]);let a=cc(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await Gk(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==oa(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function SJe(e,t,n){let i=cc(e.data);e.vendorVersion=Mb(i,0),e.vendorId=Mb(i,2);let r=Mb(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Au(i,5)}function vJe(e,t){let n=cc(e.data),i=4,r;try{for(;i{if(e.data.length>=s+4){let u=oa(n,s);t[a]=e[a]=new Date(u*1e3);let f=o[c];e[f]=u}s+=4})}async function DJe(e,t,n,i,r){let o=new Uint8Array(4),s=cc(o);PJe(s,0,t);let a=i+r;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Iy(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==o[0]&&d[p+1]==o[1]&&d[p+2]==o[2]&&d[p+3]==o[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function Rb(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function IJe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function o7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Mb(e,t){return e.getUint8(t)}function Au(e,t){return e.getUint16(t,!0)}function oa(e,t){return e.getUint32(t,!0)}function Wk(e,t){return Number(e.getBigUint64(t,!0))}function PJe(e,t,n){e.setUint32(t,n,!0)}function cc(e){return new DataView(e.buffer)}function Iy(e,t,n){return e.readUint8Array(t,n)}var LJe="File already exists",NJe="Zip file comment exceeds 64KB",FJe="File entry comment exceeds 64KB",UJe="File entry name exceeds 64KB",Lde="Version exceeds 65535",VJe="The strength must equal 1, 2, or 3",kJe="Extra field type exceeds 65535",zJe="Extra field data exceeds 64KB",y7="Zip64 is not supported",Nde=new Uint8Array([7,0,2,0,65,69,3,0,0]),Fde=24,_7=0,t4=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:wk(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[]})}async add(t="",n,i={}){let r=this;if(_7r.pendingEntries.push({name:t,reader:n,options:i,resolve:o,reject:s}))}async close(t=new Uint8Array(0),n={}){return await jJe(this,t,n),this.writer.getData()}};async function HJe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(Ob)?t+=Ob:i.directory=t.endsWith(Ob),e.files.has(t))throw new Error(LJe);let r=wB(t);if(r.length>65535)throw new Error(UJe);let o=i.comment||"",s=wB(o);if(s.length>65535)throw new Error(FJe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(Lde);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(Lde);let u=Da(e,i,"lastModDate")||new Date,f=Da(e,i,"lastAccessDate"),d=Da(e,i,"creationDate"),p=Da(e,i,"password"),g=Da(e,i,"encryptionStrength")||3,h=Da(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(VJe);let A=new Uint8Array(0),x=i.extraField;if(x){let F=0,k=0;x.forEach(V=>F+=4+V.length),A=new Uint8Array(F),x.forEach((V,G)=>{if(G>65535)throw new Error(kJe);if(V.length>65535)throw new Error(zJe);aa(A,new Uint16Array([G]),k),aa(A,new Uint16Array([V.length]),k+2),aa(A,V,k+4),k+=4+V.length})}let C=Da(e,i,"extendedTimestamp");C===void 0&&(C=!0);let T=0,E=Da(e,i,"keepOrder");E===void 0&&(E=!0);let S=0,w=Da(e,i,"msDosCompatible");w===void 0&&(w=!0);let D=Da(e,i,"internalFileAttribute")||0,R=Da(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,T=qJe(S));let O=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||T>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!E)throw new Error(y7);O=!0}e.pendingCompressedSize+=T,await Promise.resolve();let L=Da(e,i,"level"),N=Da(e,i,"useWebWorkers"),_=Da(e,i,"bufferedWrite"),b=Da(e,i,"dataDescriptor"),v=Da(e,i,"dataDescriptorSignature"),I=Da(e,i,"signal");b===void 0&&(b=!0),b&&v===void 0&&(v=!0);let M=await GJe(e,t,n,Object.assign({},i,{rawFilename:r,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:A,zip64:O,password:p,level:L,useWebWorkers:N,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:E,dataDescriptor:b,dataDescriptorSignature:v,signal:I,msDosCompatible:w,internalFileAttribute:D,externalFileAttribute:R}));return T&&(e.pendingCompressedSize-=T),Object.assign(M,{name:t,comment:o,extraField:x}),new S_(M)}async function GJe(e,t,n,i){let r=e.files,o=e.writer,s=Array.from(r.values()).pop(),a={},c,u,f;r.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new Pb,p.init(),c=!0):(e.lockWrite=new Promise(h=>u=h),o.initialized||await o.init(),p=o),a=await WJe(n,p,e.config,i),a.lock=g,r.set(t,a),a.filename=t,c){let h=0,A=p.getData();await Promise.all([e.lockWrite,d]);let x;do x=Array.from(r.values()).find(C=>C.writingBufferedData),x&&await x.lock;while(x&&x.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let T=await Ude(A,0,26),E=new DataView(T);(!a.encrypted||i.zipCrypto)&&mr(E,14,a.signature),a.zip64?(mr(E,18,4294967295),mr(E,22,4294967295)):(mr(E,18,a.compressedSize),mr(E,22,a.uncompressedSize)),await o.writeUint8Array(new Uint8Array(T)),h=26}await YJe(o,A,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=tm(a.rawExtraFieldZip64);Dl(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(y7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),r.delete(t),d}finally{f(),u&&u()}}async function WJe(e,t,n,i){let{rawFilename:r,lastAccessDate:o,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:A,rawComment:x,rawExtraField:C,useWebWorkers:T,onprogress:E,signal:S,encryptionStrength:w,extendedTimestamp:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L}=i,N=!!(a&&a.length),_=c!==0&&!g,b;if(N&&!f){b=new Uint8Array(Nde.length+2);let Ne=tm(b);Qr(Ne,0,39169),aa(b,Nde,2),n4(Ne,8,w)}else b=new Uint8Array(0);let v,I;if(D){I=new Uint8Array(9+(o?4:0)+(s?4:0));let Ne=tm(I);Qr(Ne,0,21589),Qr(Ne,2,I.length-4);let ke=1+(o?2:0)+(s?4:0);n4(Ne,4,ke),mr(Ne,5,Math.floor(i.lastModDate.getTime()/1e3)),o&&mr(Ne,9,Math.floor(o.getTime()/1e3)),s&&mr(Ne,13,Math.floor(s.getTime()/1e3));try{v=new Uint8Array(36);let Re=tm(v),dt=g7(i.lastModDate);Qr(Re,0,10),Qr(Re,2,32),Qr(Re,8,1),Qr(Re,10,24),Dl(Re,12,dt),Dl(Re,20,g7(o)||dt),Dl(Re,28,g7(s)||dt)}catch{v=new Uint8Array(0)}}else v=I=new Uint8Array(0);let M={version:h||20,versionMadeBy:A,zip64:u,directory:!!g,filenameUTF8:!0,rawFilename:r,commentUTF8:!0,rawComment:x,rawExtraFieldZip64:u?new Uint8Array(Fde+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:v,rawExtraFieldAES:b,rawExtraField:C,extendedTimestamp:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L},F=M.uncompressedSize=0,k=2048;d&&(k=k|8);let V=0;_&&(V=8),u&&(M.version=M.version>45?M.version:45),N&&(k=k|1,f||(M.version=M.version>51?M.version:51,V=99,_&&(M.rawExtraFieldAES[9]=8))),M.compressionMethod=V;let G=M.headerArray=new Uint8Array(26),U=tm(G);Qr(U,0,M.version),Qr(U,2,k),Qr(U,4,V);let q=new Uint32Array(1),Y=tm(q),Q;i.lastModDatee7?Q=e7:Q=i.lastModDate,Qr(Y,0,(Q.getHours()<<6|Q.getMinutes())<<5|Q.getSeconds()/2),Qr(Y,2,(Q.getFullYear()-1980<<4|Q.getMonth()+1)<<5|Q.getDate());let W=q[0];mr(U,6,W),Qr(U,22,r.length);let K=b.length+I.length+v.length+M.rawExtraField.length;Qr(U,24,K);let J=new Uint8Array(30+r.length+K),me=tm(J);mr(me,0,67324752),aa(J,G,4),aa(J,r,30),aa(J,b,30+r.length),aa(J,I,30+r.length+b.length),aa(J,v,30+r.length+b.length+I.length),aa(J,M.rawExtraField,30+r.length+b.length+I.length+v.length);let ye,se=0;if(e){F=M.uncompressedSize=e.size;let Ne=await Nk(n.Deflate,{codecType:Mk,level:c,password:a,encryptionStrength:w,zipCrypto:N&&f,passwordVerification:N&&f&&W>>8&255,signed:!0,compressed:_,encrypted:N,useWebWorkers:T},n);await t.writeUint8Array(J),M.dataWritten=!0,ye=await Fk(Ne,e,t,0,F,n,{onprogress:E,signal:S}),se=ye.length}else await t.writeUint8Array(J),M.dataWritten=!0;let _e=new Uint8Array(0),xe,De=0;if(d&&(_e=new Uint8Array(u?p?24:20:p?16:12),xe=tm(_e),p&&(De=4,mr(xe,0,134695760))),e){let Ne=ye.signature;if((!N||f)&&Ne!==void 0&&(mr(U,10,Ne),M.signature=Ne,d&&mr(xe,De,Ne)),u){let ke=tm(M.rawExtraFieldZip64);Qr(ke,0,1),Qr(ke,2,Fde),mr(U,14,4294967295),Dl(ke,12,BigInt(se)),mr(U,18,4294967295),Dl(ke,4,BigInt(F)),d&&(Dl(xe,De+4,BigInt(se)),Dl(xe,De+12,BigInt(F)))}else mr(U,14,se),mr(U,18,F),d&&(mr(xe,De+4,se),mr(xe,De+8,F))}d&&await t.writeUint8Array(_e);let Ee=J.length+se+_e.length;return Object.assign(M,{compressedSize:se,lastModDate:Q,rawLastModDate:W,creationDate:s,lastAccessDate:o,encrypted:N,length:Ee}),M}async function jJe(e,t,n){let i=e.writer,r=e.files,o=0,s=0,a=e.offset,c=r.size;for(let[,p]of r)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(y7);u=!0}let f=new Uint8Array(s+(u?98:22)),d=tm(f);if(t&&t.length)if(t.length<=65535)Qr(d,o+20,t.length);else throw new Error(NJe);for(let[p,g]of Array.from(r.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:A,rawExtraFieldAES:x,rawExtraField:C,rawComment:T,versionMadeBy:E,headerArray:S,directory:w,zip64:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L}=g,N,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,N=new Uint8Array(9);let v=tm(N);Qr(v,0,21589),Qr(v,2,N.length-4),n4(v,4,1),mr(v,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=N=new Uint8Array(0);let b=A.length+x.length+N.length+_.length+C.length;if(mr(d,o,33639248),Qr(d,o+4,E),aa(f,S,o+6),Qr(d,o+30,b),Qr(d,o+32,T.length),mr(d,o+34,O),L?mr(d,o+38,L):w&&R&&n4(d,o+38,16),D?mr(d,o+42,4294967295):mr(d,o+42,g.offset),aa(f,h,o+46),aa(f,A,o+46+h.length),aa(f,x,o+46+h.length+A.length),aa(f,N,o+46+h.length+A.length+x.length),aa(f,_,o+46+h.length+A.length+x.length+N.length),aa(f,C,o+46+h.length+A.length+x.length+N.length+_.length),aa(f,T,o+46+h.length+b),o+=46+h.length+b+T.length,n.onprogress)try{n.onprogress(p+1,r.size,new S_(g))}catch{}}u&&(mr(d,o,101075792),Dl(d,o+4,BigInt(44)),Qr(d,o+12,45),Qr(d,o+14,45),Dl(d,o+24,BigInt(c)),Dl(d,o+32,BigInt(c)),Dl(d,o+40,BigInt(s)),Dl(d,o+48,BigInt(a)),mr(d,o+56,117853008),Dl(d,o+64,BigInt(a)+BigInt(s)),mr(d,o+72,1),c=65535,a=4294967295,s=4294967295,o+=76),mr(d,o,101010256),Qr(d,o+8,c),Qr(d,o+10,c),mr(d,o+12,s),mr(d,o+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function Ude(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(s.target.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function YJe(e,t,n=0){await r();async function r(){if(n{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function ZJe(e,t){return function(n){e._files[t]=n}}i4.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(ZJe(this,o))}return r};Object.defineProperties(i4.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function r4(e){this._time=e}r4.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};r4.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Ux(n)};r4.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function x7(){this._ids={},this._styles={},this._count=0}x7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};x7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Hde(){this._ids={}}Hde.prototype.get=function(e){if(!l(e))return this.get(Wn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function C7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=C7._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(KJe,"xmlns:gx",im);let a=o.createElement("Document");s.appendChild(a),Wde(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?QJe(f,c.files):{kml:f,externalFiles:c.files}})}function QJe(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");vb({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Pb,r=new t4(i);return r.add("doc.kml",new kk(e)).then(function(){let o=Object.keys(t);return Gde(r,o,t,0)}).then(function(){return r.close()}).then(function(o){return{kmz:o}})}function Gde(e,t,n,i){if(t.length===i)return;let r=t[i];return e.add(r,new Nx(n[r])).then(function(){return Gde(e,t,n,i+1)})}C7._createState=function(e){let t=e.entities,n=new x7,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);o.start===Ge.MINIMUM_VALUE?o.stop===Ge.MAXIMUM_VALUE?o=new Tn:ee.addSeconds(o.stop,-10*s,o.start):o.stop===Ge.MAXIMUM_VALUE&&ee.addSeconds(o.start,10*s,o.stop);let a=new i4(e.modelCallback);return{kmlDoc:document.implementation.createDocument(XJe,"kml"),ellipsoid:y(e.ellipsoid,re.WGS84),idManager:new Hde,styleCache:n,externalFileHandler:a,time:r,valueGetter:new r4(r),sampleDuration:s,defaultAvailability:new Io([o])}};function Wde(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let T=p.name,E=p.label;if(l(E)){let w=i.createElement("LabelStyle"),D=o.get(E.text);T=l(D)&&D.length>0?D:T;let R=o.getColor(E.fillColor);l(R)&&(w.appendChild(_n(i,"color",R)),w.appendChild(_n(i,"colorMode","normal")));let O=o.get(E.scale);l(O)&&w.appendChild(_n(i,"scale",O)),f.push(w)}C.appendChild(_n(i,"name",T)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let w=i.createElement("Style");for(let D=0;D1){let w=i.createElement("MultiGeometry");for(let D=0;D0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(_n(i,"name",p.name)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),t.appendChild(C),Wde(e,C,x)}}}var Il=new m,Wc=new he,nm=new ee;function $Je(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){jde(e,t,a,n,i);return}s.get(c,void 0,Il);let u=_n(r,"coordinates",Fx(Il,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(Vx(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Wa?qde(e,a):Yde(e,a);i.push(p)}function jde(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof ta?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof mp,p,g,h,A=[];for(p=0;p1){let C=o.createElementNS(im,"MultiTrack");for(p=0;p0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,Wc),c.push(`${P.toDegrees(Wc.longitude)},${P.toDegrees(Wc.latitude)},${o}`);let f=_n(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function kde(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(kde(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let h=0;h0&&c.appendChild(_n(o,"extrude",!0));let f=a?tZe(e,t,u):nZe(e,t,u),d=f.length;for(let x=0;x=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var E7=C7;function RB(){this._cache={}}RB.prototype.fromColor=function(e,t){return o4(void 0,void 0,e,t,this._cache)};RB.prototype.fromUrl=function(e,t,n){return o4(e,void 0,t,n,this._cache)};RB.prototype.fromMakiIconId=function(e,t,n){return o4(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};RB.prototype.fromText=function(e,t,n){return o4(void 0,e,t,n,this._cache)};var oZe=new z;function sZe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,oZe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Kde(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width${i}${eme(r)}`:n+=`${i}${r}`)}return n.length>0&&(n=`${n}
`),n}function mZe(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function hZe(e,t){return new pd(mZe(eme,e,t),!0)}function c4(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Wn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new $n(c):n(o,s))}return r}function L7(e,t){let n=new Array(e.length);for(let i=0;i2?u.perPositionHeight=new $n(!0):r.clampToGround||(u.height=0);let p=c4(t,e._entityCollection,r.describe);p.polygon=u}function dme(e,t,n,i,r){fme(e,t,i,n.coordinates,r)}function mme(e,t,n,i,r){let o=n.coordinates;for(let s=0;st&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Gr(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Oy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Ry(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var My=/[A-Za-z]/,Rs=/[\d]/;var Cu=/\s/,l4=/['"]/,Ame=/[\x00-\x1F\x7F]/,xme=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,AZe=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,xZe=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,CZe=xme+AZe+xZe,Cme=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,k9n=new RegExp("[".concat(xme+Cme,"]")),N7=CZe+Cme,rm=new RegExp("[".concat(N7,"]"));var u4=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Cu):[],r=t.split(Cu),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Cu):[],r=t.split(Cu),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function Tme(e,t,n){var i,r;n==null?(n="…",r=3,i=8):(r=n.length,i=n.length);var o=function(T){var E={},S=T,w=S.match(/^([a-z]+):\/\//i);return w&&(E.scheme=w[1],S=S.substr(w[0].length)),w=S.match(/^(.*?)(?=(\?|#|\/|$))/i),w&&(E.host=w[1],S=S.substr(w[0].length)),w=S.match(/^\/(.*?)(?=(\?|#|$))/i),w&&(E.path=w[1],S=S.substr(w[0].length)),w=S.match(/^\?(.*?)(?=(#|$))/i),w&&(E.query=w[1],S=S.substr(w[0].length)),w=S.match(/^#(.*?)$/i),w&&(E.fragment=w[1]),E},s=function(T){var E="";return T.scheme&&T.host&&(E+=T.scheme+"://"),T.host&&(E+=T.host),T.path&&(E+="/"+T.path),T.query&&(E+="?"+T.query),T.fragment&&(E+="#"+T.fragment),E},a=function(T,E){var S=E/2,w=Math.ceil(S),D=-1*Math.floor(S),R="";return D<0&&(R=T.substr(D)),T.substr(0,w)+n+R};if(e.length<=t)return e;var c=t-r,u=o(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-r)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var h="#"+u.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var A=c-d.length;return(d+a(h,A)).substr(0,c+i)}else d+=h}if(u.scheme&&u.host){var x=u.scheme+"://";if((d+x).length0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}function Eme(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}function bme(e,t,n){return yme(e,t,n)}var Sme=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new u4({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=0;g--){var h=f[g];switch(h.state){case 11:D(h,p);break;case 12:R(h,p);break;case 0:C(h,p);break;case 1:T(h,p);break;case 2:E(h,p);break;case 3:S(h,p);break;case 4:w(h,p);break;case 5:O(h,p);break;case 6:L(h,p);break;case 7:N(h,p);break;case 13:_(h,p);break;case 14:b(h,p);break;case 8:v(h,p);break;case 9:I(h,p);break;case 10:M(h,p);break;case 15:F(h,p);break;case 16:k(h,p);break;case 17:V(h,p);break;case 18:G(h,p);break;case 19:U(h,p);break;case 20:q(h,p);break;case 21:Y(h,p);break;case 22:Q(h,p);break;case 23:W(h,p);break;case 24:K(h,p);break;case 25:J(h,p);break;case 26:me(h,p);break;case 27:ye(h,p);break;case 28:se(h,p);break;case 29:_e(h,p);break;case 30:xe(h,p);break;case 31:De(h,p);break;case 32:Ne(h,p);break;case 33:ke(h,p);break;case 34:Re(h,p);break;case 35:dt(h,p);break;case 36:_t(h,p);break;case 37:Ee(h,p);break;case 38:rt(h,p);break;case 39:hn(h,p);break;case 40:Rn(h,p);break;case 41:Gt(h,p);break;default:Ry(h.state)}}}for(var A=f.length-1;A>=0;A--)f.forEach(function(Te){return Ut(Te)});return c;function x(Te){if(Te==="#")f.push(JZe(d,28));else if(Te==="@")f.push(ZZe(d,30));else if(Te==="/")f.push(Y7(d,11));else if(Te==="+")f.push(q7(d,37));else if(Te==="(")f.push(q7(d,32));else{if(Rs.test(Te)&&(f.push(q7(d,38)),f.push(XZe(d,13))),Lme(Te)){var Ae=Te.toLowerCase()==="m"?15:22;f.push(KZe(d,Ae))}f4(Te)&&f.push(j7(d,0)),rm.test(Te)&&f.push(Y7(d,5))}}function C(Te,Ae){Ae===":"?Te.state=2:Ae==="-"?Te.state=1:V7(Ae)||Gr(f,Te)}function T(Te,Ae){Ae==="-"||(Ae==="/"?(Gr(f,Te),f.push(Y7(d,11))):V7(Ae)?Te.state=0:Gr(f,Te))}function E(Te,Ae){Ae==="/"?Te.state=3:Ae==="."?Gr(f,Te):w_(Ae)?(Te.state=5,f4(Ae)&&f.push(j7(d,0))):Gr(f,Te)}function S(Te,Ae){Ae==="/"?Te.state=4:k7(Ae)?(Te.state=10,Te.acceptStateReached=!0):Ut(Te)}function w(Te,Ae){Ae==="/"?Te.state=10:w_(Ae)?(Te.state=5,Te.acceptStateReached=!0):Gr(f,Te)}function D(Te,Ae){Ae==="/"?Te.state=12:Gr(f,Te)}function R(Te,Ae){w_(Ae)?Te.state=5:Gr(f,Te)}function O(Te,Ae){Ae==="."?Te.state=7:Ae==="-"?Te.state=6:Ae===":"?Te.state=8:m4(Ae)?Te.state=10:d4(Ae)||Ut(Te)}function L(Te,Ae){Ae==="-"||(Ae==="."?Ut(Te):w_(Ae)?Te.state=5:Ut(Te))}function N(Te,Ae){Ae==="."?Ut(Te):w_(Ae)?(Te.state=5,Te.acceptStateReached=!0):Ut(Te)}function _(Te,Ae){Ae==="."?Te.state=14:Ae===":"?Te.state=8:Rs.test(Ae)||(m4(Ae)?Te.state=10:rm.test(Ae)?Gr(f,Te):Ut(Te))}function b(Te,Ae){Rs.test(Ae)?(Te.octetsEncountered++,Te.octetsEncountered===4&&(Te.acceptStateReached=!0),Te.state=13):Ut(Te)}function v(Te,Ae){Rs.test(Ae)?Te.state=9:Ut(Te)}function I(Te,Ae){Rs.test(Ae)||(m4(Ae)?Te.state=10:Ut(Te))}function M(Te,Ae){k7(Ae)||Ut(Te)}function F(Te,Ae){Ae.toLowerCase()==="a"?Te.state=16:Q(Te,Ae)}function k(Te,Ae){Ae.toLowerCase()==="i"?Te.state=17:Q(Te,Ae)}function V(Te,Ae){Ae.toLowerCase()==="l"?Te.state=18:Q(Te,Ae)}function G(Te,Ae){Ae.toLowerCase()==="t"?Te.state=19:Q(Te,Ae)}function U(Te,Ae){Ae.toLowerCase()==="o"?Te.state=20:Q(Te,Ae)}function q(Te,Ae){Ae.toLowerCase()===":"?Te.state=21:Q(Te,Ae)}function Y(Te,Ae){h4(Ae)?Te.state=22:Gr(f,Te)}function Q(Te,Ae){Ae==="."?Te.state=23:Ae==="@"?Te.state=24:h4(Ae)?Te.state=22:Gr(f,Te)}function W(Te,Ae){Ae==="."?Gr(f,Te):Ae==="@"?Gr(f,Te):h4(Ae)?Te.state=22:Gr(f,Te)}function K(Te,Ae){w_(Ae)?Te.state=25:Gr(f,Te)}function J(Te,Ae){Ae==="."?Te.state=27:Ae==="-"?Te.state=26:d4(Ae)||Ut(Te)}function me(Te,Ae){Ae==="-"||Ae==="."?Ut(Te):d4(Ae)?Te.state=25:Ut(Te)}function ye(Te,Ae){Ae==="."||Ae==="-"?Ut(Te):w_(Ae)?(Te.state=25,Te.acceptStateReached=!0):Ut(Te)}function se(Te,Ae){H7(Ae)?(Te.state=29,Te.acceptStateReached=!0):Gr(f,Te)}function _e(Te,Ae){H7(Ae)||Ut(Te)}function xe(Te,Ae){G7(Ae)?(Te.state=31,Te.acceptStateReached=!0):Gr(f,Te)}function De(Te,Ae){G7(Ae)||(rm.test(Ae)?Gr(f,Te):Ut(Te))}function Ee(Te,Ae){Rs.test(Ae)?Te.state=38:(Gr(f,Te),x(Ae))}function Ne(Te,Ae){Rs.test(Ae)?Te.state=33:Gr(f,Te),x(Ae)}function ke(Te,Ae){Rs.test(Ae)?Te.state=34:Gr(f,Te)}function Re(Te,Ae){Rs.test(Ae)?Te.state=35:Gr(f,Te)}function dt(Te,Ae){Ae===")"?Te.state=36:Gr(f,Te)}function _t(Te,Ae){Rs.test(Ae)?Te.state=38:W7(Ae)?Te.state=39:Gr(f,Te)}function rt(Te,Ae){Te.acceptStateReached=!0,p4(Ae)?Te.state=40:Ae==="#"?Te.state=41:Rs.test(Ae)||(Ae==="("?Te.state=32:W7(Ae)?Te.state=39:(Ut(Te),f4(Ae)&&f.push(j7(d,0))))}function hn(Te,Ae){Rs.test(Ae)?Te.state=38:Ae==="("?Te.state=32:(Ut(Te),x(Ae))}function Rn(Te,Ae){p4(Ae)||(Ae==="#"?Te.state=41:Rs.test(Ae)?Te.state=38:Ut(Te))}function Gt(Te,Ae){p4(Ae)?Te.state=40:Rs.test(Ae)?Gr(f,Te):Ut(Te)}function Ut(Te){if(Gr(f,Te),!!Te.acceptStateReached){var Ae=Te.startIdx,ut=e.slice(Te.startIdx,d);if(ut=qZe(ut),Te.type==="url"){var ii=e.charAt(Te.startIdx-1);if(ii==="@")return;var Je=Te.matchType;if(Je==="scheme"){var ar=U7.exec(ut);if(ar&&(Ae=Ae+ar.index,ut=ut.slice(ar.index)),!Pme(ut))return}else if(Je==="tld"){if(!Ome(ut))return}else if(Je==="ipV4"){if(!Rme(ut))return}else Ry(Je);c.push(new Mme({tagBuilder:n,matchedText:ut,offset:Ae,urlMatchType:Je,url:ut,protocolRelativeMatch:ut.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:r,decodePercentEncoding:o}))}else if(Te.type==="email")Nme(ut)&&c.push(new Fme({tagBuilder:n,matchedText:ut,offset:Ae,email:ut.replace(Bme,"")}));else if(Te.type==="hashtag")Ume(ut)&&c.push(new kme({tagBuilder:n,matchedText:ut,offset:Ae,serviceName:s,hashtag:ut.slice(1)}));else if(Te.type==="mention")zme(ut,a)&&c.push(new Gme({tagBuilder:n,matchedText:ut,offset:Ae,serviceName:a,mention:ut.slice(1)}));else if(Te.type==="phone"){if(ut=ut.replace(/ +$/g,""),Wme(ut)){var ts=ut.replace(/[^0-9,;#]/g,"");c.push(new jme({tagBuilder:n,matchedText:ut,offset:Ae,number:ts,plusSign:ut.charAt(0)==="+"}))}}else Ry(Te)}}}var YZe=/[\(\{\[]/,Yme=/[\)\}\]]/,qme={")":"(","}":"{","]":"["};function qZe(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(o=e.charAt(r),Yme.test(o)){var s=qme[o];if(t[s]<0)t[s]++,r--;else break}else if(Ime.test(o))r--;else break;return e.slice(0,r+1)}function j7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Y7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function XZe(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function KZe(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function JZe(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function ZZe(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function q7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Kme(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,r=t.onText,o=t.onComment,s=t.onDoctype,a=new _h,c=0,u=e.length,f=0,d=0,p=a;c"?(p=new _h(Ms(Ms({},p),{name:Q()})),q()):!My.test(K)&&!Rs.test(K)&&K!==":"&&G()}function C(K){K===">"?G():My.test(K)?f=3:G()}function T(K){Cu.test(K)||(K==="/"?f=12:K===">"?q():K==="<"?U():K==="="||l4.test(K)||Ame.test(K)?G():f=5)}function E(K){Cu.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?q():K==="<"?U():l4.test(K)&&G()}function S(K){Cu.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?q():K==="<"?U():l4.test(K)?G():f=5)}function w(K){Cu.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?U():f=10)}function D(K){K==='"'&&(f=11)}function R(K){K==="'"&&(f=11)}function O(K){Cu.test(K)?f=4:K===">"?q():K==="<"&&U()}function L(K){Cu.test(K)?f=4:K==="/"?f=12:K===">"?q():K==="<"?U():(f=4,W())}function N(K){K===">"?(p=new _h(Ms(Ms({},p),{isClosing:!0})),q()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new _h(Ms(Ms({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new _h(Ms(Ms({},p),{type:"doctype"})),f=20):G()}function b(K){K==="-"?f=15:K===">"?G():f=16}function v(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function F(K){K===">"?q():K==="!"?f=19:K==="-"||(f=16)}function k(K){K==="-"?f=17:K===">"?q():f=16}function V(K){K===">"?q():K==="<"&&U()}function G(){f=0,p=a}function U(){f=1,p=new _h({idx:c})}function q(){var K=e.slice(d,p.idx);K&&r(K,d),p.type==="comment"?o(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function Y(){var K=e.slice(d,c);r(K,d),d=c+1}function Q(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}var _h=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var QZe=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=$Ze(t.urls),this.email=xu(t.email)?t.email:this.email,this.phone=xu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=xu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=eQe(t.stripPrefix),this.stripTrailingSlash=xu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=xu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Hme.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Vme.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=tQe(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return Kme(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;no?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],r=0,o=0,s=n.length;o{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function X7(e,t){let n=NB(e,"id");return n=l(n)?n:Wn(),t.getOrCreateEntity(n)}function K7(e){let t=the(e,"lon"),n=the(e,"lat"),i=BB(e,"ele",br.gpx);return m.fromDegrees(t,n,i)}function the(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function NB(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function By(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o${d.text}: ${d.value}

`)}if(!l(i)||i==="")return;i=nQe.link(i),LB.innerHTML=i;let s=LB.querySelectorAll("a");for(n=0;n',u+=`${LB.innerHTML}`,LB.innerHTML="",u}function che(e,t,n,i){let r=K7(t),o=X7(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,g4);o.billboard=she(s);let a=Pl(t,"name",br.gpx);o.name=a,o.label=oQe(),o.label.text=a,o.description=Z7(t,o),i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND,o.label.heightReference=qe.CLAMP_TO_GROUND)}function sQe(e,t,n,i){let r=X7(t,n);r.description=Z7(t,r);let o=J7(t,"rtept",br.gpx),s=new Array(o.length);for(let a=0;a0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,g4);r.billboard=she(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND),r.availability=new Io,r.availability.addInterval(new Tn({start:a[0],stop:a[a.length-1]}))}r.polyline=ahe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function cQe(e){let t={positions:[],times:[]},n=J7(e,"trkpt",br.gpx),i;for(let r=0;r=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function AQe(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,fhe.call(this,e,t,n)}}var kB=y4;var Ui={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Ui.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Ui.Bounce.In(e*2)*.5:Ui.Bounce.Out(e*2-1)*.5+.5}}},zB;typeof self>"u"&&typeof process<"u"&&process.hrtime?zB=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?zB=self.performance.now.bind(self.performance):Date.now!==void 0?zB=Date.now:zB=function(){return new Date().getTime()};var Lb=zB,xQe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=Lb()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=HB.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=HB.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},dhe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),mhe=new xQe,hhe=function(){function e(t,n){n===void 0&&(n=mhe),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ui.Linear.None,this._interpolationFunction=HB.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=dhe.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?Lb()+parseFloat(t):t:Lb(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,r){for(var o in i){var s=t[o],a=Array.isArray(s),c=a?"array":typeof s,u=!a&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(u){var f=i[o];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[o]=[s].concat(f)}if((c==="object"||a)&&s&&!u){n[o]=a?[]:{};for(var d in s)n[o][d]=s[d];r[o]=a?[]:{},this._setupProperties(s,n[o],i[o],r[o])}else typeof n[o]>"u"&&(n[o]=s),a||(n[o]*=1),u?r[o]=i[o].slice().reverse():r[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=Lb()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=Lb()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;to)return!1;n&&this.start(t)}if(this._goToEnd=!1,t1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;athis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function bQe(e){let t=e.slice(0,Math.min(4,e.size)),n=qs(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function SQe(e){let t=qs(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function She(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("",t),i,r,o;for(;t!==-1&&t0?(Ol.maximumRed=o,Ol.red=void 0):(Ol.maximumRed=void 0,Ol.red=0),r>0?(Ol.maximumGreen=r,Ol.green=void 0):(Ol.maximumGreen=void 0,Ol.green=0),i>0?(Ol.maximumBlue=i,Ol.blue=void 0):(Ol.maximumBlue=void 0,Ol.blue=0),Ol.alpha=n,z.fromRandom(Ol)):new z(o,r,i,n)}function kx(e,t,n){let i=On(e,t,n);if(l(i))return ij(i,On(e,"colorMode",n)==="random")}function wQe(e){let t=Pi(e,"TimeStamp",Me.kmlgx),n=On(t,"when",Me.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),r=new Io;return r.addInterval(new Tn({start:i,stop:Ge.MAXIMUM_VALUE})),r}function DQe(e){let t=Pi(e,"TimeSpan",Me.kmlgx);if(!l(t))return;let n,i=Pi(t,"begin",Me.kmlgx),r=l(i)?ee.fromIso8601(i.textContent):void 0,o=Pi(t,"end",Me.kmlgx),s=l(o)?ee.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(ee.lessThan(s,r)){let a=r;r=s,s=a}n=new Io,n.addInterval(new Tn({start:r,stop:s}))}else l(r)?(n=new Io,n.addInterval(new Tn({start:r,stop:Ge.MAXIMUM_VALUE}))):l(s)&&(n=new Io,n.addInterval(new Tn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function Dhe(){let e=new Wa;return e.width=Ly,e.height=Ly,e.scaleByDistance=new Lt(phe,_he,ghe,yhe),e.pixelOffsetScaleByDistance=new Lt(phe,_he,ghe,yhe),e}function cj(){let e=new md;return e.outline=!0,e.outlineColor=z.WHITE,e}function Ihe(){let e=new dd;return e.translucencyByDistance=new Lt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=kr.FILL_AND_OUTLINE,e}function lj(e,t,n,i,r){let o=On(e,"href",Me.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=y(ni(e,"x",Me.gx),0),u=y(ni(e,"y",Me.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=aj(o,n,i);if(r){let a=On(e,"refreshMode",Me.kml),c=On(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?Rt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Rt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(On(e,"viewBoundScale",Me.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(On(e,"viewFormat",Me.kml),f),p=On(e,"httpQuery",Me.kml);l(d)&&s.setQueryParameters(Gl(T4(d))),l(p)&&s.setQueryParameters(Gl(T4(p)));let g=t._ellipsoid;return fj(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function IQe(e,t,n,i,r){let o=ni(t,"scale",Me.kml),s=ni(t,"heading",Me.kml),a=kx(t,"color",Me.kml),c=Pi(t,"Icon",Me.kml),u=lj(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=ni(c,"x",Me.gx),d=ni(c,"y",Me.gx),p=ni(c,"w",Me.gx),g=ni(c,"h",Me.gx),h=Pi(t,"hotSpot",Me.kml),A=Ny(h,"x"),x=Ny(h,"y"),C=fs(h,"xunits"),T=fs(h,"yunits"),E=n.billboard;l(E)||(E=Dhe(),n.billboard=E),E.image=u,E.scale=o,E.color=a,(l(f)||l(d)||l(p)||l(g))&&(E.imageSubRegion=new Ke(f,d,p,g)),l(s)&&s!==0&&(E.rotation=P.toRadians(-s),E.alignedAxis=m.UNIT_Z),o=y(o,1);let S,w;l(A)&&(C==="pixels"?S=-A*o:C==="insetPixels"?S=(A-Ly)*o:C==="fraction"&&(S=-A*Ly*o),S+=Ly*.5*o),l(x)&&(T==="pixels"?w=x*o:T==="insetPixels"?w=(-x+Ly)*o:T==="fraction"&&(w=x*Ly*o),w-=Ly*.5*o),(l(S)||l(w))&&(E.pixelOffset=new H(S,w))}function C4(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o:clampToSeaFloor is currently not supported, using :clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Rt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),qe.RELATIVE_TO_GROUND):(l(e)?Rt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):Rt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function RQe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new uh(e))}function MQe(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let r=e.length;for(let o=0;o0&&Rt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),h=[],A=[];for(let C=0;C0&&i.availability.addInterval(new Tn({start:A[0],stop:A[A.length-1]})),d&&f&&uj(t,i,r),!0}function Ehe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new ia;d.addSamples(e,t),n.intervals.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:RQe(d,s,a)})),i.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function FQe(e,t,n,i,r){let o=sm(n,"interpolate",Me.gx),s=om(n,"Track",Me.gx),a,c,u,f=!1,d=new y_,p=new Io,g=new ta,h=e._ellipsoid;for(let A=0,x=s.length;A0)){for(h='',o=0;o`;h+="
${y(A.displayName,s)}${y(A.value,"")}
"}if(!l(h))return;h=TQe.link(h),hr.innerHTML=h;let x=hr.querySelectorAll("a");for(o=0;o1&&(Tu(hr,"a","href",i),Tu(hr,"link","href",i),Tu(hr,"area","href",i),Tu(hr,"img","src",i),Tu(hr,"iframe","src",i),Tu(hr,"video","src",i),Tu(hr,"audio","src",i),Tu(hr,"source","src",i),Tu(hr,"track","src",i),Tu(hr,"input","src",i),Tu(hr,"embed","src",i),Tu(hr,"script","src",i),Tu(hr,"video","poster",i)),Eu(hr,"a","href",r),Eu(hr,"link","href",r),Eu(hr,"area","href",r),Eu(hr,"img","src",r),Eu(hr,"iframe","src",r),Eu(hr,"video","src",r),Eu(hr,"audio","src",r),Eu(hr,"source","src",r),Eu(hr,"track","src",r),Eu(hr,"input","src",r),Eu(hr,"embed","src",r),Eu(hr,"script","src",r),Eu(hr,"video","poster",r);let C='
',C+=`${hr.innerHTML}
`,hr.innerHTML="",t.description=C}function S4(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=whe(t,i,n.context),c=a.kml,u=PQe(e,t,n.styleCollection,o,s),f=On(t,"name",Me.kml);a.name=f,a.parent=r;let d=DQe(t);l(d)||(d=wQe(t)),a.availability=d,mj(a);function p(E){return E?E.show&&p(E.parent):!0}let g=sm(t,"visibility",Me.kml);a.show=p(r)&&y(g,!0);let h=Pi(t,"author",Me.atom),A=c.author;A.name=On(h,"name",Me.atom),A.uri=On(h,"uri",Me.atom),A.email=On(h,"email",Me.atom);let x=Pi(t,"link",Me.atom),C=c.link;C.href=fs(x,"href"),C.hreflang=fs(x,"hreflang"),C.rel=fs(x,"rel"),C.type=fs(x,"type"),C.title=fs(x,"title"),C.length=fs(x,"length"),c.address=On(t,"address",Me.kml),c.phoneNumber=On(t,"phoneNumber",Me.kml),c.snippet=On(t,"Snippet",Me.kml),kQe(t,a),zQe(t,a,u,s,o);let T=e._ellipsoid;return Nhe(t,a,T),Lhe(t,a,T),l(Pi(t,"Region",Me.kml))&&Rt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function Bhe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function HQe(e,t,n,i){let r=S4(e,t,n),o=Ye(n);o.parentEntity=r.entity,Bhe(e,t,o,i)}function GQe(e,t,n,i){let r=S4(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;uP.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=w0(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(r=y(r,JQe),l(n)&&(tj.x=n.clientWidth*.5,tj.y=n.clientHeight*.5,u=t.pickEllipsoid(tj,o,ZQe)),l(u)?f=o.cartesianToCartographic(u,Nb):(f=ce.center(r,Nb),u=o.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let C=r.width*i*.5,T=r.height*i*.5;r=new ce(a(f.longitude-C),s(f.latitude-T),a(f.longitude+C),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,Nb),c=c.replace("[cameraLon]",P.toDegrees(Nb.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(Nb.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(Nb.height).toString());let g=t.frustum,h=g.aspectRatio,A="",x="";if(l(h)){let C=P.toDegrees(g.fov);h>1?(A=C,x=C/h):(x=C,A=C*h)}c=c.replace("[horizFov]",A.toString()),c=c.replace("[vertFov]",x.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Gl(c))}function QQe(e,t,n,i){let o=S4(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Pi(t,"Link",Me.kml);if(l(c)||(c=Pi(t,"Url",Me.kml)),l(c)){let u=On(c,"href",Me.kml),f,d;if(l(u)){let p=u;if(u=aj(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=On(c,"viewRefreshMode",Me.kml),f==="onRegion"){Rt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(On(c,"viewBoundScale",Me.kml),1);let x=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(On(c,"viewFormat",Me.kml),x),T=On(c,"httpQuery",Me.kml);l(C)&&u.setQueryParameters(Gl(T4(C))),l(T)&&u.setQueryParameters(Gl(T4(T)));let E=e._ellipsoid;fj(u,e.camera,e.canvas,d,e._lastCameraView.bbox,E)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},h=new Is,A=dj(e,h,u,g).then(function(x){let C=e._entityCollection,T=h.values;C.suspendEvents();for(let w=0;w0||E==="onExpire"||f==="onStop"){let w=Pi(x,"NetworkLinkControl",Me.kml),D=l(w),R=ee.now(),O={id:Wn(),href:u,cookie:{},lastUpdated:R,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:R},L=0;if(D&&(O.cookie=Gl(y(On(w,"cookie",Me.kml),"")),L=y(ni(w,"minRefreshPeriod",Me.kml),0)),E==="onInterval")D&&(S=Math.max(L,S)),O.refreshMode=Fy.INTERVAL,O.time=S;else if(E==="onExpire"){let N;if(D&&(N=On(w,"expires",Me.kml)),l(N))try{let _=ee.fromIso8601(N),b=ee.secondsDifference(_,R);b>0&&b0;)this._screenOverlays.pop().remove()};function mj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function t$e(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Pi(o,"NetworkLinkControl",Me.kml),c=l(a),u=0;if(c){if(l(Pi(a,"Update",Me.kml))){Rt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Gl(y(On(a,"cookie",Me.kml),"")),u=y(ni(a,"minRefreshPeriod",Me.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===Fy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Fy.EXPIRE){let R;if(l(a)&&(R=On(a,"expires",Me.kml)),l(R))try{let O=ee.fromIso8601(R),L=ee.secondsDifference(O,f);L>0&&Lf.time&&(p=!0):f.refreshMode===Fy.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Fy.STOP&&(o&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){r(d),f.updating=!0;let g=new Is,h=f.href.clone();h.setQueryParameters(f.cookie);let A=y(i._ellipsoid,re.WGS84);fj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,A),dj(i,g,h,{context:d.id}).then(t$e(i,f,g,c,h)).catch(function(x){let C=`NetworkLink ${f.href} refresh failed: ${x}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function n$e(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}bu._DeferredLoading=yh;bu._getTimestamp=yi;var qB=bu;function XB(){fe.throwInstantiationError()}XB.prototype.update=fe.throwInstantiationError;XB.prototype.getBoundingSphere=fe.throwInstantiationError;XB.prototype.isDestroyed=fe.throwInstantiationError;XB.prototype.destroy=fe.throwInstantiationError;var hj=XB;var i$e={NONE:0,LERC:1},Bf=Object.freeze(i$e);var r$e={NONE:0,BITS12:1},Bs=Object.freeze(r$e);var zx=new m,o$e=new m,Lf=new H,v4=new B,s$e=new B,a$e=Math.pow(2,12);function lc(e,t,n,i,r,o,s,a,c,u){let f=Bs.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,h=t.maximum,A=m.subtract(h,g,o$e),x=i-n;Math.max(m.maximumComponent(A),x)0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,re.WGS84),A=1/h.maximumRadius,x=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),T,E,S,w;l(C)?(T=C.west,E=C.south,S=C.east,w=C.north):g?(T=a(x.west),E=a(x.south),S=a(x.east),w=a(x.north)):(T=x.west*A,E=s-2*r(o(-x.south*A)),S=x.east*A,w=s-2*r(o(-x.north*A)));let D=e.relativeToCenter,R=l(D);D=R?D:m.ZERO;let O=y(e.includeWebMercatorT,!1),L=y(e.exaggeration,1),N=y(e.exaggerationRelativeHeight,0),b=L!==1,v=y(e.structure,Ah.DEFAULT_STRUCTURE),I=y(v.heightScale,Ah.DEFAULT_STRUCTURE.heightScale),M=y(v.heightOffset,Ah.DEFAULT_STRUCTURE.heightOffset),F=y(v.elementsPerHeight,Ah.DEFAULT_STRUCTURE.elementsPerHeight),k=y(v.stride,Ah.DEFAULT_STRUCTURE.stride),V=y(v.elementMultiplier,Ah.DEFAULT_STRUCTURE.elementMultiplier),G=y(v.isBigEndian,Ah.DEFAULT_STRUCTURE.isBigEndian),U=ce.computeWidth(x),q=ce.computeHeight(x),Y=U/(u-1),Q=q/(f-1);g||(U*=A,q*=A);let W=h.radiiSquared,K=W.x,J=W.y,me=W.z,ye=65536,se=-65536,_e=Mt.eastNorthUpToFixedFrame(D,h),xe=B.inverseTransformation(_e,l$e),De,Ee;O&&(De=wi.geodeticLatitudeToMercatorAngle(E),Ee=1/(wi.geodeticLatitudeToMercatorAngle(w)-De));let Ne=u$e;Ne.x=Number.POSITIVE_INFINITY,Ne.y=Number.POSITIVE_INFINITY,Ne.z=Number.POSITIVE_INFINITY;let ke=f$e;ke.x=Number.NEGATIVE_INFINITY,ke.y=Number.NEGATIVE_INFINITY,ke.z=Number.NEGATIVE_INFINITY;let Re=Number.POSITIVE_INFINITY,dt=u*f,_t=d>0?u*2+f*2:0,rt=dt+_t,hn=new Array(rt),Rn=new Array(rt),Gt=new Array(rt),Ut=O?new Array(rt):[],Te=b?new Array(rt):[],Ae=0,ut=f,ii=0,Je=u;p&&(--Ae,++ut,--ii,++Je);let ar=1e-5;for(let Qe=Ae;Qe=f&&(pt=f-1);let zt=x.north-Q*pt;g?zt=a(zt):zt=s-2*r(o(-zt*A));let Jt=(zt-E)/(w-E);Jt=P.clamp(Jt,0,1);let rr=Qe===Ae,gr=Qe===ut-1;d>0&&(rr?zt+=ar*q:gr&&(zt-=ar*q));let ns=t(zt),Vs=n(zt),lo=me*Vs,Wi;O&&(Wi=(wi.geodeticLatitudeToMercatorAngle(zt)-De)*Ee);for(let Yo=ii;Yo=u&&(Vn=u-1);let ln=pt*(u*k)+Vn*k,Kn;if(F===1)Kn=c[ln];else{Kn=0;let Lr;if(G)for(Lr=0;Lr=0;--Lr)Kn=Kn*V+c[ln+Lr]}Kn=Kn*I+M,se=Math.max(se,Kn),ye=Math.min(ye,Kn);let wn=x.west+Y*Vn;g?wn=a(wn):wn=wn*A;let ks=(wn-T)/(S-T);ks=P.clamp(ks,0,1);let hi=pt*u+Vn;if(d>0){let Lr=Yo===ii,$f=Yo===Je-1,gs=rr||gr||Lr||$f;if((rr||gr)&&(Lr||$f))continue;gs&&(Kn-=d,Lr?(hi=dt+(f-pt-1),wn-=ar*U):gr?hi=dt+f+(u-Vn-1):$f?(hi=dt+f+u+pt,wn+=ar*U):rr&&(hi=dt+f+u+f+Vn))}let ma=ns*t(wn),zu=ns*n(wn),Qf=K*ma,zs=J*zu,Wr=1/i(Qf*ma+zs*zu+lo*Vs),Br=Qf*Wr,ha=zs*Wr,Cr=lo*Wr,Hs=new m;Hs.x=Br+ma*Kn,Hs.y=ha+zu*Kn,Hs.z=Cr+Vs*Kn,B.multiplyByPoint(xe,Hs,pj),m.minimumByComponent(pj,Ne,Ne),m.maximumByComponent(pj,ke,ke),Re=Math.min(Re,Kn),hn[hi]=Hs,Gt[hi]=new H(ks,Jt),Rn[hi]=Kn,O&&(Ut[hi]=Wi),b&&(Te[hi]=h.geodeticSurfaceNormal(Hs))}}let ts=ae.fromPoints(hn),Ba;l(C)&&(Ba=Bn.fromRectangle(C,ye,se,h));let No;R&&(No=new f_(h).computeHorizonCullingPointPossiblyUnderEllipsoid(D,hn,ye));let Mr=new cg(Ne,ke,D),Ve=new uc(D,Mr,Re,se,_e,!1,O,b,L,N),ot=new Float32Array(rt*Ve.stride),je=0;for(let Qe=0;Qe0?E=Go.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):E=Go.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let S=T.gridWidth*T.gridHeight;return C._mesh=new Nf(d,new Float32Array(T.vertices),E.indices,E.indexCountWithoutSkirts,S,T.minimumHeight,T.maximumHeight,ae.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Bn.clone(T.orientedBoundingBox),uc.clone(T.encoding),E.westIndicesSouthToNorth,E.southIndicesEastToWest,E.eastIndicesNorthToSouth,E.northIndicesWestToEast),C._buffer=void 0,C._mesh})};D_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ce.center(u)),d=this._structure,g=Go.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?A=Go.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):A=Go.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=h.gridWidth*h.gridHeight;return this._mesh=new Nf(f,h.vertices,A.indices,A.indexCountWithoutSkirts,x,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),this._mesh};D_.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===Bf.LERC;if(!p&&g)return;let A;if(p){let x=this._mesh.vertices,C=this._mesh.encoding;A=jhe(x,C,f,d,e,i,r,t,n)}else A=p$e(this._buffer,a,c,s,u,e,i,r,t,n),A=A*d+f;return A};D_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,h=a.encoding,A=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(r,o,s),C=f.heightOffset,T=f.heightScale,E=f.elementsPerHeight,S=f.elementMultiplier,w=f.isBigEndian,D=Math.pow(S,E-1);for(let R=0;Rf.highestEncodedHeight?f.highestEncodedHeight:_,_$e(p,E,S,D,d,w,R*c+L,_)}}return Promise.resolve(new D_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};D_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<=s&&(g=s-1,p=s-2);let h=d|0,A=h+1;A>=a&&(A=a-1,h=a-2);let x=f-p,C=d-h;h=a-1-h,A=a-1-A;let T=P4(e,t,n,i,r,h*s+p),E=P4(e,t,n,i,r,h*s+g),S=P4(e,t,n,i,r,A*s+p),w=P4(e,t,n,i,r,A*s+g);return Yhe(x,C,T,E,S,w)}function jhe(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let A=u-d,x=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*o+d)-n)/i,T=(t.decodeHeight(e,g*o+p)-n)/i,E=(t.decodeHeight(e,h*o+d)-n)/i,S=(t.decodeHeight(e,h*o+p)-n)/i;return Yhe(A,x,C,T,E,S)}function Yhe(e,t,n,i,r,o){return t=0;--a)s=s*n+e[o+a];return s}function _$e(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Ia=D_;function kb(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Hx=new ce;function g$e(e,t,n,i){let r=i.length;for(let o=0;o=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var qhe=new he;kb.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Hx);return ce.center(i,qhe),this.computeMaximumLevelAtPosition(qhe)>=e};kb.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function Ub(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(Ub.prototype,{nw:{get:function(){return this._nw||(this._nw=new Ub(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Ub(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Ub(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Ub(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function T$e(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function _j(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Vb(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function KB(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&Vb(t._nw.extent,n),s=t._ne&&Vb(t._ne.extent,n),a=t._sw&&Vb(t._sw.extent,n),c=t._se&&Vb(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,KB(t,t._nw,n))),s&&(i=Math.max(i,KB(t,t._ne,n))),a&&(i=Math.max(i,KB(t,t._sw,n))),c&&(i=Math.max(i,KB(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];Vb(a,n)&&(i=a.level)}t=t.parent}return i}function JB(e,t,n){if(!t)return;let i,r=!1;for(i=0;it.east&&n.push(new ce(t.east,r.south,r.east,r.north)),r.southt.north&&n.push(new ce(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var cm=kb;function v$e(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` -${r}`),t}var xh=v$e;function R4(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=y(o,0),this.retry=!1,this.error=s}R4.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new R4(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${xh(i)}`),c};R4.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Ai=R4;function Vy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new wi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Vy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Vy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=r&&(h=r-1);let A=g/u|0;return A>=o&&(A=o-1),l(n)?(n.x=h,n.y=A,n):new H(h,A)};var Bo=Vy;var w$e=15;function gj(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}gj.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function D$e(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=y(i.latestWkid,i.wkid),o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ce.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new zi(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(o.xmin,o.ymin),s.rectangleNortheastInMeters=new H(o.xmax,o.ymax),e.tilingScheme=new Bo(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Bf.LERC:Bf.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new cm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new cm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Go.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Xhe(e,t,n){try{let i=await t.fetchJson();D$e(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function ky(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new pe,l(e.url)){$("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new gj(e);this._readyPromise=Promise.resolve(e.url).then(async function(r){let o=ve.createIfNeeded(r);o.appendForwardSlash(),l(t)&&(o=o.getDerivedResource({queryParameters:{token:t}})),n._resource=o;let s=o.getDerivedResource({queryParameters:{f:"pjson"}});return await Xhe(i,s,n),i.build(n),!0})}}Object.defineProperties(ky.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});ky.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new gj(t);await Xhe(r,i);let o=new ky(t);return r.build(o),o._resource=n,o};ky.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(yj(this,n+1,e*2,t*2))){let d=Khe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Ia({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):w$e,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===ei.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ei.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function yj(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}ky.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0;){let c=a.pop(),u=I$e(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function Khe(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<',!1)}Object.defineProperties(xj.prototype,{url:{get:function(){return Jhe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});xj.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ce.fromDegrees(a,s,u,c)}})})};var Cj=xj;function Tj(){}Object.defineProperties(Tj.prototype,{credit:{get:function(){}}});Tj.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s2&&(l(i)||(i=M$e,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=B$e,m.multiplyByScalar(t[o-1],2,r),m.subtract(t[o],r,r),m.add(r,t[o-2],r),m.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(r),this._evaluateFunction=R$e(this),this._lastTimeIndex=0}Object.defineProperties(zy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});zy.catmullRomCoefficientMatrix=new B(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);zy.prototype.findTimeInterval=ir.prototype.findTimeInterval;zy.prototype.wrapTime=ir.prototype.wrapTime;zy.prototype.clampTime=ir.prototype.clampTime;zy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Ej=zy;var M4={};M4.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=ne,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,h,A;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(h=(e-r)/(n-r),A=(e-r)/(i-r),o.push(0),o.push(1),A!==1&&(o.push(-1),o.push(2),o.push(1),o.push(A)),h!==1&&(o.push(-1),o.push(2),o.push(0),o.push(h))):u===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(h)):!a&&i!==e?(A=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(A),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};M4.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),h=t-a,A=e-s,x=(d*A+f*h)*g,C=(-p*A+u*h)*g,T=1-x-C;return l(c)?(c.x=x,c.y=C,c.z=T,c):new m(x,C,T)};M4.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var I_=M4;function Hy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=L4(e.westIndices,r,t),this._southIndices=L4(e.southIndices,o,t),this._eastIndices=L4(e.eastIndices,r,t),this._northIndices=L4(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Hy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var B4=[];function L4(e,t,n){B4.length=e.length;let i=!1;for(let r=0,o=e.length;r0&&t(e[r-1],e[r])>0;return i?(B4.sort(t),Ue.createTypedArray(n,B4)):e}var Qhe="createVerticesFromQuantizedTerrainMesh",L$e=new pi(Qhe),N$e=new pi(Qhe,am.maximumAsynchronousTasks);Hy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?N$e:L$e).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,A=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Ue.createTypedArray(A,g.indices),C=new Float32Array(g.vertices),T=g.center,E=g.minimumHeight,S=g.maximumHeight,w=p._boundingSphere,D=p._orientedBoundingBox,R=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),O=g.vertexStride,L=uc.clone(g.encoding);return p._mesh=new Nf(T,C,x,g.indexCountWithoutSkirts,h,E,S,w,R,O,D,L,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var F$e=new pi("upsampleQuantizedTerrainMesh",am.maximumAsynchronousTasks);Hy.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=F$e.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,A=u?g*.5:this._southSkirtHeight,x=c?this._eastSkirtHeight:g*.5,C=u?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(E){let S=new Uint16Array(E.vertices),w=Ue.createTypedArray(S.length/3,E.indices),D;return l(E.encodedNormals)&&(D=new Uint8Array(E.encodedNormals)),new Hy({quantizedVertices:S,indices:w,encodedNormals:D,minimumHeight:E.minimumHeight,maximumHeight:E.maximumHeight,boundingSphere:ae.clone(E.boundingSphere),orientedBoundingBox:Bn.clone(E.orientedBoundingBox),horizonOcclusionPoint:m.clone(E.horizonOcclusionPoint),westIndices:E.westIndices,southIndices:E.southIndices,eastIndices:E.eastIndices,northIndices:E.northIndices,westSkirtHeight:h,southSkirtHeight:A,eastSkirtHeight:x,northSkirtHeight:C,childTileMask:0,credits:T,createdByUpsampling:!0})})};var bj=32767,$he=new m;Hy.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=bj;let r=P.clamp((n-e.south)/e.height,0,1);return r*=bj,l(this._mesh)?z$e(this,i,r):H$e(this,i,r)};function epe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var U$e=new H,V$e=new H,k$e=new H;function z$e(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,u),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}}function H$e(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let E=T.x*o[u]+T.y*o[f]+T.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,E/bj)}}}}Hy.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new G$e({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await N4(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function W$e(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return N4(e,n);throw new de(i)}async function j$e(e,t,n){await npe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new cm(e.tilingScheme,e.overallMaxZoom);for(let o=0;o0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function N4(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=j$e(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return l(n)&&n.statusCode===404?(await npe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),W$e(e,n,t))}}function Su(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),l(e.url)&&($("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=Su._initializeReadyPromise(e,this))}Su._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new wj(e),r=ve.createIfNeeded(n);return r.appendForwardSlash(),i.lastResource=r,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await N4(i,t),i.build(t),!0};var Sj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function tpe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Y$e(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Ia({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function q$e(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,A=Uint16Array.BYTES_PER_ELEMENT,x=A*h,C=new DataView(t),T=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let E=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let w=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let D=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=new Uint16Array(t,a,R*3);a+=R*g,R>64*1024&&(A=Uint32Array.BYTES_PER_ELEMENT,x=A*h);let L=O.subarray(0,R),N=O.subarray(R,2*R),_=O.subarray(R*2,3*R);Yn.zigZagDeltaDecode(L,N,_),a%A!==0&&(a+=A-a%A);let b=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=Ue.createTypedArrayFromArrayBuffer(R,t,a,b*h);a+=b*x;let I=0,M=v.length;for(let se=0;se0){let Ee=Ir(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Ee))for(let Ne=0;Nethis._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;othis._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o=u&&(d=(d+8)%24,f=d);se;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});lm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new lm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o=2&&(this._array[0]=this._array[e-1],ape(this,0)),this._array[e-1]=void 0,t};lm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Bj(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&ape(this,n)}return this._array[e-1]=void 0,t};lm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};lm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Bj(this,1,2)?1:2]};function F4(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function $B(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Bj(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function spe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=$B(e,t,i);for(r!==n&&(F4(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if($B(e,t,o)!==r)break;F4(e,t,o),t=o}}function ape(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function wu(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),l(e)){$("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=ppe(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(r){let o=`An error occurred while accessing ${Gj(i,"",1).url}.`;return Promise.reject(new de(o))})}}Object.defineProperties(wu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});wu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new wu;i._resource=n;try{await ppe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Gj(i,"",1).url}: ${r}`;throw new de(o)}return i};wu.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<=0;--r){let o=1<1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var hpe=new pi("decodeGoogleEarthEnterprisePacket");wu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let r=Gj(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return hpe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let h=u[e];f=o[e],f._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,A){return h.length-A.length});let g=p.length;for(let h=0;h1){let E=o[A.substring(0,A.length-1)];C.setParent(E)}o[A]=C}else o[A]=null}})})};wu.prototype.populateSubtree=function(e,t,n,i){let r=wu.tileXYToQuadKey(e,t,n);return Hj(this,r,i)};function Hj(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new jr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Hj(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new jr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Hj(e,t,s)}).finally(function(){delete a[r]})}wu.prototype.getTileInformation=function(e,t,n){let i=wu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};wu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Gj(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var kj,zj;function ppe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(zj)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;zj=v0(n).then(function(){kj=window.cesiumGoogleEarthDbRootParser(Iet),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return zj.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=kj.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return hpe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=kj.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let r=e.providers,o=y(i.providerInfo,[]),s=o.length;for(let a=0;a=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,u),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}var Vet=Uint16Array.BYTES_PER_ELEMENT,gpe=Uint32Array.BYTES_PER_ELEMENT,jj=Int32Array.BYTES_PER_ELEMENT,ket=Float32Array.BYTES_PER_ELEMENT,Yj=Float64Array.BYTES_PER_ELEMENT;function zet(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let w=0;w=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*T[w]+I.y*T[D]+I.z*T[R]}}var qb=Kx;var Ff={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},k4=new ee;function z4(){this._terrainCache={},this._lastTidy=ee.now()}z4.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};z4.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};z4.prototype.tidy=function(){if(ee.now(k4),ee.secondsDifference(k4,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i10&&delete e[r]}ee.clone(k4,this._lastTidy)}};function Yy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new z4,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe,this._ready=!1,l(e.url)){$("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=ve.createIfNeeded(e.url),i=this,r;this._readyPromise=fm.fromUrl(n).then(o=>{if(!o.terrainPresent){let s=new de(`The server ${o.url} doesn't have terrain`);return Promise.reject(s)}return Ai.reportSuccess(r),i._metadata=o,i._ready=!0,!0}).catch(o=>{throw r=Ai.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),o})}else if(l(e.metadata)){$("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(Yy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Yy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new Yy(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var Het=new pi("decodeGoogleEarthEnterprisePacket");function xpe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Ff.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var qj=Yy;function Wet(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var oL=Wet;var Bpe={},jet=32.184,Yet=2451545,Cpe=-.0529921,Tpe=-.1059842,Epe=13.0120009,bpe=13.3407154,Spe=.9856003,vpe=26.4057084,wpe=13.064993,Dpe=.3287146,Ipe=1.7484877,Ppe=-.1589763,Ope=.0036096,Rpe=.1643573,Mpe=12.9590088,Xj=new ee;Bpe.ComputeMoon=function(e,t){l(e)||(e=ee.now()),Xj=ee.addSeconds(e,jet,Xj);let n=ee.totalDays(Xj)-Yet,i=n/Zn.DAYS_PER_JULIAN_CENTURY,r=(125.045+Cpe*n)*P.RADIANS_PER_DEGREE,o=(250.089+Tpe*n)*P.RADIANS_PER_DEGREE,s=(260.008+Epe*n)*P.RADIANS_PER_DEGREE,a=(176.625+bpe*n)*P.RADIANS_PER_DEGREE,c=(357.529+Spe*n)*P.RADIANS_PER_DEGREE,u=(311.589+vpe*n)*P.RADIANS_PER_DEGREE,f=(134.963+wpe*n)*P.RADIANS_PER_DEGREE,d=(276.617+Dpe*n)*P.RADIANS_PER_DEGREE,p=(34.226+Ipe*n)*P.RADIANS_PER_DEGREE,g=(15.134+Ppe*n)*P.RADIANS_PER_DEGREE,h=(119.743+Ope*n)*P.RADIANS_PER_DEGREE,A=(239.961+Rpe*n)*P.RADIANS_PER_DEGREE,x=(25.053+Mpe*n)*P.RADIANS_PER_DEGREE,C=Math.sin(r),T=Math.sin(o),E=Math.sin(s),S=Math.sin(a),w=Math.sin(c),D=Math.sin(u),R=Math.sin(f),O=Math.sin(d),L=Math.sin(p),N=Math.sin(g),_=Math.sin(h),b=Math.sin(A),v=Math.sin(x),I=Math.cos(r),M=Math.cos(o),F=Math.cos(s),k=Math.cos(a),V=Math.cos(c),G=Math.cos(u),U=Math.cos(f),q=Math.cos(d),Y=Math.cos(p),Q=Math.cos(g),W=Math.cos(h),K=Math.cos(A),J=Math.cos(x),me=(269.9949+.0031*i-3.8787*C-.1204*T+.07*E-.0172*S+.0072*D-.0052*N+.0043*v)*P.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*I+.0239*M-.0278*F+.0068*k-.0029*G+9e-4*U+8e-4*Q-9e-4*J)*P.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*T-.0642*E+.0158*S+.0252*w-.0066*D-.0047*R-.0046*O+.0028*L+.0052*N+.004*_+.0019*b-.0044*v)*P.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*I*Cpe+.1208*M*Tpe-.0642*F*Epe+.0158*k*bpe+.0252*V*Spe-.0066*G*vpe-.0047*U*wpe-.0046*q*Dpe+.0028*Y*Ipe+.0052*Q*Ppe+.004*W*Ope+.0019*K*Rpe-.0044*J*Mpe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new oL),t.rightAscension=me,t.declination=ye,t.rotation=se,t.rotationRate=_e,t};var sL=Bpe;function Lpe(e){(!l(e)||typeof e!="function")&&(e=sL.ComputeMoon),this._computeFunction=e}var qet=new m,Xet=new m,Ket=new m;function Jet(e,t,n){let i=qet;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=Ket;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=m.cross(o,i,Xet);return l(n)||(n=new Z),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var Zet=new Z,Qet=new Le;Lpe.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=Jet(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(m.UNIT_Z,r,Qet),s=Z.fromQuaternion(Le.conjugate(o,o),Zet);return Z.multiply(s,i,i)};var aL=Lpe;var cL={};cL.type=void 0;cL.getRequiredDataPoints=fe.throwInstantiationError;cL.interpolateOrderZero=fe.throwInstantiationError;cL.interpolate=fe.throwInstantiationError;var Kj=cL;function Jj(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Jj.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Jj.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===jy.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=m.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var lL=Jj;function Zj(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,gd.defaultAccessToken),n=ve.createIfNeeded(y(e.server,gd.defaultServer));n.appendForwardSlash();let i=gd.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(i));let r=n.getDerivedResource({url:"v1/geocode"});l(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new lL(r)}Object.defineProperties(Zj.prototype,{credit:{get:function(){}}});Zj.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var uL=Zj;var $et={SHIFT:0,CTRL:1,ALT:2},ca=Object.freeze($et);function H4(){fe.throwInstantiationError()}Object.defineProperties(H4.prototype,{ellipsoid:{get:fe.throwInstantiationError}});H4.prototype.project=fe.throwInstantiationError;H4.prototype.unproject=fe.throwInstantiationError;var Qj=H4;var $j=[],eY=[];function ett(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=$j,u=eY,f,d;for(f=0;f=a||t(g,h,n)<=0)?(e[p]=g,++f):d=r)return;let o=Math.floor((i+r)*.5);tY(e,t,n,i,o),tY(e,t,n,o+1,r),ett(e,t,n,i,o,r)}function ttt(e,t,n){let i=e.length,r=Math.ceil(i*.5);$j.length=r,eY.length=r,tY(e,t,n,0,i-1),$j.length=0,eY.length=0}var O_=ttt;function Xb(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(Xb.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});Xb.prototype.findTimeInterval=ir.prototype.findTimeInterval;Xb.prototype.wrapTime=ir.prototype.wrapTime;Xb.prototype.clampTime=ir.prototype.clampTime;Xb.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;si){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=m.multiplyByScalar(t,n,G4);let a=r*r*n;s=m.add(e,m.multiplyByScalar(o,a,G4),G4)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});mc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new mc(e,t)};var Fpe=new m;mc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Fpe),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var itt=new m;mc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,itt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Fpe),r=this._occluderRadius-n;if(r=m.magnitudeSquared(i)-r*r,n0?(r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),r*r+n*n>m.magnitudeSquared(i)):!1;if(r>0){i=m.subtract(t,this._cameraPosition,i);let o=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var rtt=new m;mc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return co.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,rtt),r=this._occluderRadius-n,o=m.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return r*r+n*n0?(r=Math.sqrt(r)+this._horizonDistance,s-n?co.PARTIAL:co.FULL))}}return co.NONE};var W4=new m;mc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),r=m.clone(e.center),o=e.radius,s=n.length,a=m.normalize(m.subtract(i,r,W4),W4),c=-m.dot(a,r),u=mc._anyRotationVector(r,a,c),f=mc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;gi.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new m,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,o),i),e,i),i)};var att=new m;mc._rotationVector=function(e,t,n,i,r){let o=m.subtract(i,e,att);if(o=m.normalize(o,o),m.dot(t,o)<.9999999847691291){let s=m.cross(t,o,o);if(m.magnitude(s)>P.EPSILON13)return m.normalize(s,new m)}return r};var iY=new m,ctt=new m,j4=new m,Npe=new m;mc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=m.clone(r,iY),s=m.clone(e.center,ctt),a=e.radius,c=m.subtract(s,o,j4),u=m.magnitudeSquared(c),f=a*a;if(uOpenStreetMap contributors',!1)}Object.defineProperties(rY.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});rY.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:gt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ce.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;r=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var oY=rY;var ltt={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},sY=ltt;var utt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},aY=utt;var ftt=new m;function dtt(e,t,n,i){let r=G0(e,t,n,i,ftt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var cY=dtt;function Upe(){fe.throwInstantiationError()}Upe.prototype.getURL=fe.throwInstantiationError;var lY=Upe;var mtt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(mtt);function qy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=(t.clientX-r.left)*(i.offsetWidth/r.width),n.y=(t.clientY-r.top)*(i.offsetHeight/r.height),n}function pY(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Jx(e){if(e.shiftKey)return ca.SHIFT;if(e.ctrlKey)return ca.CTRL;if(e.altKey)return ca.ALT}var ds={LEFT:0,MIDDLE:1,RIGHT:2};function Du(e,t,n,i){function r(o){i(e,o)}Wt.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function htt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Wt.supportsPointerEvents()?(Du(e,"pointerdown",t,xtt),Du(e,"pointerup",t,Xpe),Du(e,"pointermove",t,Ctt),Du(e,"pointercancel",t,Xpe)):(Du(e,"mousedown",t,Kpe),Du(e,"mouseup",n,Jpe),Du(e,"mousemove",n,Zpe),Du(e,"touchstart",t,ytt),Du(e,"touchend",n,Gpe),Du(e,"touchmove",n,Att),Du(e,"touchcancel",n,Gpe)),Du(e,"dblclick",t,_tt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Du(e,i,t,gtt)}function ptt(e){let t=e._removalFunctions;for(let n=0;ndm.mouseEmulationIgnoreMilliseconds}function hY(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Jx(t),r=e.getInputAction(Cn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function ytt(e,t){_Y(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i0?new Array(r):void 0;for(i=0;i0&&(m.pack(D,d,S),S+=3,h=n[u-1],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha)),c&&u===f-1)break;m.pack(D,d,S),S+=3,l(n)&&(h=n[u],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha))}}let x=new pn;x.position=new we({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(x.color=new we({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,T=Ue.createTypedArray(p,C),E=0;for(u=0;ua?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function vtt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var CY=Zx;function wtt(e,t){this.rectangle=e,this.maxLevel=t}function TY(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}TY.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function Dtt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new zi({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Go.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o(i.build(n),!0))}}Object.defineProperties(Jy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Jy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new TY(t),i=ve.createIfNeeded(e);await $pe(n,i);let r=new Jy(t);return n.build(r),r._resource=i,r};Jy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Ia({buffer:id(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Ptt(a,e,t,n),structure:a._terrainDataStructure})})};Jy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}wY.prototype.isReady=function(){return this._isReady};wY.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=id(e),r=e.width;for(let o=0,s=t.length;o1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};DY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=``:i+=``)}return i+="
${r}${t(o)}
${r}${o}
",i}this.description=t(e)};var hm=DY;function Zb(){fe.throwInstantiationError()}Object.defineProperties(Zb.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});Zb.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};Zb.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};Zb.prototype.pickFeatures=function(e,t,n,i,r){fe.throwInstantiationError()};var Ltt=/\.ktx2$/i;Zb.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Ltt.test(n.url)?il(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var qc=Zb;function IY(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new zi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}IY.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new pL({missingImageUrl:i_e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Ntt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Bo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new zi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new wi,r=e.fullExtent,o=i.unproject(new m(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function Ftt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function n_e(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let r=await i.fetchJson();Ntt(r,t)}catch(r){Ftt(e,r,n)}}function Eh(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new It(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new pe,this._ready=!1,l(e.url)){$("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=ve.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,l(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new IY(e);i.useTiles?this._readyPromise=n_e(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}Eh.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,r;switch(e){case mm.SATELLITE:{n=y(t.token,Pu.defaultAccessToken),i=ve.createIfNeeded(y(t.url,Pu.defaultWorldImageryServer)),i.appendForwardSlash();let o=Pu.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case mm.OCEANS:{n=y(t.token,Pu.defaultAccessToken),i=ve.createIfNeeded(y(t.url,Pu.defaultWorldOceanServer)),i.appendForwardSlash();let o=Pu.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case mm.HILLSHADE:{n=y(t.token,Pu.defaultAccessToken),i=ve.createIfNeeded(y(t.url,Pu.defaultWorldHillshadeServer)),i.appendForwardSlash();let o=Pu.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Eh.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function i_e(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Si?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(Eh.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Eh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Eh(t);i._resource=n;let r=new IY(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await n_e(n,r),r.build(i),i._readyPromise=Promise.resolve(!0),i};Eh.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Eh.prototype.requestImage=function(e,t,n,i){return qc.loadImage(this,i_e(this,e,t,n,i))};Eh.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Si)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!l(h))return g;for(let A=0;A 1.0 || offset.y < 0.0 || offset.y > 1.0) { - continue; - } - color += sampleTexture(offset); - ++count; - } - } - if (count > 0) { - color /= float(count); - } -`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); - color = previous + (color - previous) / (60.0 * 1.5); - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); -`),n+=` out_FragColor = vec4(color); -} -`,n}function ztt(e,t){o_e(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o`),this._tilingScheme=new Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new pe,this._ready=!1,l(e.url)){$("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;l(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=ve.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),r=new PY(e);this._readyPromise=s_e(i,r,this).then(()=>(r.build(this),!0))}}Object.defineProperties(ms.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ms.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,Qb.AERIAL),r=ve.createIfNeeded(e);r.appendForwardSlash();let o=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new ms(t);s._resource=r;let a=new PY(t);return await s_e(o,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var jtt=new ce;ms.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,jtt);return Xtt(this._attributionList,n,i)};ms.prototype.requestImage=function(e,t,n,i){let r=qc.loadImage(this,Ytt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?$b.EMPTY_IMAGE:Promise.reject(o)})};ms.prototype.pickFeatures=function(e,t,n,i,r){};ms.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<=0;--r){let o=1<=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,qtt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ms._metadataCache={};var eS=ms;var Ktt=new m(1,1,1);function OY(e){e=y(e,Ktt),this._dimensions=m.clone(e)}Object.defineProperties(OY.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var Jtt=new m;OY.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,Jtt),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=m.fromElements(i,r,o,e.position),e.velocity=m.normalize(e.position,e.velocity)};var RY=OY;var yL=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; - -float vdcRadicalInverse(int i) +// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) + float distance = getDistance(position); + + if (outlineWidth > 0.0) { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); + // Don't get the outline edge exceed the SDF_EDGE + float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); + float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); + float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); + return vec4(sdfColor.rgb, sdfColor.a * alpha); + } + else + { + float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + return vec4(v_color.rgb, v_color.a * alpha); } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); } +#endif -vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) +void main() { - float a = roughness * roughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} + vec4 color = texture(u_atlas, v_textureCoordinates); -float G1_Smith(float NdotV, float k) -{ - return NdotV / (NdotV * (1.0 - k) + k); -} +#ifdef SDF + float outlineWidth = v_outlineWidth; + vec4 outlineColor = v_outlineColor; -float G_Smith(float roughness, float NdotV, float NdotL) -{ - float k = roughness * roughness / 2.0; - return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); -} + // Get the current distance + float distance = getDistance(v_textureCoordinates); -vec2 integrateBrdf(float roughness, float NdotV) -{ - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - for (int i = 0; i < NumSamples; i++) - { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = G_Smith(roughness, NdotV, NdotL); - float G_Vis = G * VdotH / (NdotH * NdotV); - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } - } - return vec2(A, B) / float(NumSamples); -} +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float smoothing = fwidth(distance); + // Get an offset that is approximately half the distance to the neighbor pixels + // 0.354 is approximately half of 1/sqrt(2) + vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;function AL(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(AL.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Ztt(e,t,n){let i=t.createViewportQuadCommand(yL,{framebuffer:n,renderState:ze.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}AL.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Bt({context:t,width:256,height:256,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,sampler:dn.NEAREST});this._colorTexture=n;let i=new Ys({context:t,colorTextures:[n],destroyAttachments:!1});Ztt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};AL.prototype.isDestroyed=function(){return!1};AL.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var xL=AL;var Qtt=new H;function $tt(e,t){let n=e.unionClippingRegions,i=e.length,r=ss.useFloatTexture(t),o=ss.getTextureResolution(e,t,Qtt),s=o.x,a=o.y,c=r?nnt(s,a):int(s,a);return c+=` -`,c+=n?ent(i):tnt(i),c}function ent(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount; - float pixelWidth = czm_metersPerPixel(position); - bool breakAndDiscard = false; - for (int i = 0; i < ${e}; ++i) + // Sample the center point + vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); + + // Sample the 4 neighbors + vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + + // Equally weight the center sample and the 4 neighboring samples + color = (center + color1 + color2 + color3 + color4)/5.0; +#else + // If no derivatives available (IE 10?), just do a single sample + float smoothing = 1.0/32.0; + color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +#endif + + color = czm_gammaCorrect(color); +#else + color = czm_gammaCorrect(color); + color *= czm_gammaCorrect(v_color); +#endif + +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) - { - breakAndDiscard = true; - break; - } - } - if (breakAndDiscard) { discard; } - return clipAmount; -} -`}function tnt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - bool clipped = true; - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount = 0.0; - float pixelWidth = czm_metersPerPixel(position); - for (int i = 0; i < ${e}; ++i) +#else +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); + discard; } - if (clipped) +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 { discard; } - return clipAmount; -} -`}function nnt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) -{ - int pixY = clippingPlaneNumber / ${e}; - int pixX = clippingPlaneNumber - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -`}function int(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) -{ - int clippingPlaneStartIndex = clippingPlaneNumber * 2; - int pixY = clippingPlaneStartIndex / ${e}; - int pixX = clippingPlaneStartIndex - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); - return czm_transformPlane(plane, transform); -} -`}var R_=$tt;var CL=`// See Intersection.glsl for the definition of intersectScene -// See IntersectionUtils.glsl for the definition of nextIntersection -// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl -// for the definition of convertUvToShapeUvSpace. The appropriate function is -// selected based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See Octree.glsl for the definitions of TraversalData, SampleData, -// traverseOctreeFromBeginning, and traverseOctreeFromExisting -// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture - -#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops -#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 - -uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; -uniform float u_stepSize; - -#if defined(PICKING) - uniform vec4 u_pickColor; +#endif #endif -#if defined(JITTER) -float hash(vec2 p) -{ - vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale - p3 += dot(p3, p3.yzx + 19.19); - return fract((p3.x + p3.y) * p3.z); -} +#ifdef VECTOR_TILE + color *= u_highlightColor; #endif + out_FragColor = color; -vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { -#if defined(SHAPE_BOX) - Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); - RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); - vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; - float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); - float dt = (exit - entry.w) * RAY_SCALE; - return vec4(normalize(entry.xyz), dt); -#else - float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); - return vec4(viewRay.dir, u_stepSize / dimAtLevel); +#ifdef LOG_DEPTH + czm_writeLogDepth(); #endif -} -void main() -{ - vec4 fragCoord = gl_FragCoord; - vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] - vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); - vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case - vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case - vec3 viewPosUv = u_cameraPositionUv; - #if defined(SHAPE_BOX) - vec3 dInv = 1.0 / viewDirUv; - Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); - #else - Ray viewRayUv = Ray(viewPosUv, viewDirUv); - #endif +#ifdef FRAGMENT_DEPTH_CHECK + float temp = v_compressed.y; - Intersections ix; - RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); + temp = temp * SHIFT_RIGHT1; - // Exit early if the scene was completely missed. - if (shapeIntersection.entry.w == NO_HIT) { - discard; - } + float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; + bool enableDepthTest = temp2 != 0.0; + bool applyTranslate = floor(temp) != 0.0; - float currT = shapeIntersection.entry.w * RAY_SCALE; - float endT = shapeIntersection.exit.w; - vec3 positionUv = viewPosUv + currT * viewDirUv; - vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + if (enableDepthTest) { + temp = v_compressed.z; + temp = temp * SHIFT_RIGHT12; - // Traverse the tree from the start position - TraversalData traversalData; - SampleData sampleDatas[SAMPLE_COUNT]; - traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); - vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); - #if defined(JITTER) - float noise = hash(screenCoord); // [0,1] - currT += noise * step.w; - positionUv += noise * step.w * viewDirUv; - #endif + temp = v_compressed.w; + temp = temp * SHIFT_RIGHT12; - FragmentInput fragmentInput; - #if defined(STATISTICS) - setStatistics(fragmentInput.metadata.statistics); - #endif + vec2 imageSize; + imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; + imageSize.x = floor(temp); - vec4 colorAccum =vec4(0.0); + vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; + adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); - for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { - // Read properties from the megatexture based on the traversal state - Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); + float epsilonEyeDepth = v_compressed.x + czm_epsilon1; + float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); - // Prepare the custom shader inputs - copyPropertiesToMetadata(properties, fragmentInput.metadata); - fragmentInput.voxel.positionUv = positionUv; - fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; - fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; - fragmentInput.voxel.viewDirUv = viewDirUv; - fragmentInput.voxel.viewDirWorld = viewDirWorld; - fragmentInput.voxel.surfaceNormal = step.xyz; - fragmentInput.voxel.travelDistance = step.w; + // negative values go into the screen + if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) + { + float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner + if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) + { + float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner + if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) + { + discard; + } + } + } + } +#endif - // Run the custom shader - czm_modelMaterial materialOutput; - fragmentMain(fragmentInput, materialOutput); +} +`;var rR=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) +in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width +in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free +in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale +in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions +in vec2 sdf; // sdf outline color (rgb) and width (w) +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates +#endif +#ifdef VECTOR_TILE +in float a_batchId; +#endif - // Sanitize the custom shader output - vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); - color.rgb = max(color.rgb, vec3(0.0)); - color.a = clamp(color.a, 0.0, 1.0); +out vec2 v_textureCoordinates; +#ifdef FRAGMENT_DEPTH_CHECK +out vec4 v_textureCoordinateBounds; +out vec4 v_originTextureCoordinateAndTranslate; +out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +out mat2 v_rotationMatrix; +#endif - // Pre-multiplied alpha blend - colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); +out vec4 v_pickColor; +out vec4 v_color; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif - // Stop traversing if the alpha has been fully saturated - if (colorAccum.a > ALPHA_ACCUM_MAX) { - colorAccum.a = ALPHA_ACCUM_MAX; - break; - } +const float UPPER_BOUND = 32768.0; - if (step.w == 0.0) { - // Shape is infinitely thin. The ray may have hit the edge of a - // foreground voxel. Step ahead slightly to check for more voxels - step.w == 0.00001; - } +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; - // Keep raymarching - currT += step.w; - positionUv += step.w * viewDirUv; +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; - // Check if there's more intersections. - if (currT > endT) { - #if (INTERSECTION_COUNT == 1) - break; - #else - shapeIntersection = nextIntersection(ix); - if (shapeIntersection.entry.w == NO_HIT) { - break; - } else { - // Found another intersection. Resume raymarching there - currT = shapeIntersection.entry.w * RAY_SCALE; - endT = shapeIntersection.exit.w; - positionUv = viewPosUv + currT * viewDirUv; - } - #endif +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +{ + // Note the halfSize cannot be computed in JavaScript because it is sent via + // compressed vertex attributes that coerce it to an integer. + vec2 halfSize = imageSize * scale * 0.5; + halfSize *= ((direction * 2.0) - 1.0); + + vec2 originTranslate = origin * abs(halfSize); + +#if defined(ROTATION) || defined(ALIGNED_AXIS) + if (validAlignedAxis || rotation != 0.0) + { + float angle = rotation; + if (validAlignedAxis) + { + vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); + angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / + (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } - // Traverse the tree from the current ray position. - // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. - positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); - traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); - step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + float cosTheta = cos(angle); + float sinTheta = sin(angle); + rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); + halfSize = rotationMatrix * halfSize; + } + else + { + rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } +#endif - // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] - colorAccum.a /= ALPHA_ACCUM_MAX; + mpp = czm_metersPerPixel(positionEC); + positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); + positionEC.xy += (translate + pixelOffset) * mpp; - #if defined(PICKING) - // If alpha is 0.0 there is nothing to pick - if (colorAccum.a == 0.0) { - discard; - } - out_FragColor = u_pickColor; - #else - out_FragColor = colorAccum; - #endif + return positionEC; } -`;var TL=`in vec2 position; -uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; +#ifdef VERTEX_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) +{ + vec4 posWC = czm_eyeToWindowCoordinates(positionEC); -void main() { - vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; - vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; - vec2 translation = 0.5 * (aabbMax + aabbMin); - vec2 scale = 0.5 * (aabbMax - aabbMin); - gl_Position = vec4(position * scale + translation, 0.0, 1.0); + float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); + + if (globeDepth == 0.0) + { + return 0.0; // not on the globe + } + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); + return eyeCoordinate.z / eyeCoordinate.w; } -`;var EL=`/* Intersection defines -#define INTERSECTION_COUNT ### -*/ +#endif +void main() +{ + // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition -#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -#define RAY_SHIFT (0.000003163) -#define RAY_SCALE (1.003163) + // unpack attributes + vec3 positionHigh = positionHighAndScale.xyz; + vec3 positionLow = positionLowAndRotation.xyz; + float scale = positionHighAndScale.w; -struct Ray { - vec3 pos; - vec3 dir; -#if defined(SHAPE_BOX) - vec3 dInv; +#if defined(ROTATION) || defined(ALIGNED_AXIS) + float rotation = positionLowAndRotation.w; +#else + float rotation = 0.0; #endif -}; -struct RayShapeIntersection { - vec4 entry; - vec4 exit; -}; + float compressed = compressedAttribute0.x; -struct Intersections { - // Don't access these member variables directly - call the functions instead. + vec2 pixelOffset; + pixelOffset.x = floor(compressed * SHIFT_RIGHT7); + compressed -= pixelOffset.x * SHIFT_LEFT7; + pixelOffset.x -= UPPER_BOUND; - // Store an array of ray-surface intersections. Each intersection is composed of: - // .xyz for the surface normal at the intersection point - // .w for the T value - // The scale of the normal encodes the shape intersection type: - // length(intersection.xyz) = 1: positive shape entry - // length(intersection.xyz) = 2: positive shape exit - // length(intersection.xyz) = 3: negative shape entry - // length(intersection.xyz) = 4: negative shape exit - // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, - // so we need twice as many to track ray-*surface* intersections - vec4 intersections[INTERSECTION_COUNT * 2]; + vec2 origin; + origin.x = floor(compressed * SHIFT_RIGHT5); + compressed -= origin.x * SHIFT_LEFT5; - #if (INTERSECTION_COUNT > 1) - // Maintain state for future nextIntersection calls - int index; - int surroundCount; - bool surroundIsPositive; - #endif -}; + origin.y = floor(compressed * SHIFT_RIGHT3); + compressed -= origin.y * SHIFT_LEFT3; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ - return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); -} +#ifdef FRAGMENT_DEPTH_CHECK + vec2 depthOrigin = origin.xy; +#endif + origin -= vec2(1.0); -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) -{ - float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; - return vec4(intersection.xyz * scale, intersection.w); -} + float show = floor(compressed * SHIFT_RIGHT2); + compressed -= show * SHIFT_LEFT2; -// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. -#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) -#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) -#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; -#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) +#ifdef INSTANCED + vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); + vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); + vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +#else + vec2 direction; + direction.x = floor(compressed * SHIFT_RIGHT1); + direction.y = compressed - direction.x * SHIFT_LEFT1; -#if (INTERSECTION_COUNT > 1) -void initializeIntersections(inout Intersections ix) { - // Sort the intersections from min T to max T with bubble sort. - // Note: If this sorting function changes, some of the intersection test may - // need to be updated. Search for "bubble sort" to find those areas. - const int sortPasses = INTERSECTION_COUNT * 2 - 1; - for (int n = sortPasses; n > 0; --n) { - for (int i = 0; i < sortPasses; ++i) { - // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= n) { break; } + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); +#endif - vec4 intersect0 = ix.intersections[i + 0]; - vec4 intersect1 = ix.intersections[i + 1]; + float temp = compressedAttribute0.y * SHIFT_RIGHT8; + pixelOffset.y = -(floor(temp) - UPPER_BOUND); - bool inOrder = intersect0.w <= intersect1.w; + vec2 translate; + translate.y = (temp - floor(temp)) * SHIFT_LEFT16; - ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; - ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; - } + temp = compressedAttribute0.z * SHIFT_RIGHT8; + translate.x = floor(temp) - UPPER_BOUND; + + translate.y += (temp - floor(temp)) * SHIFT_LEFT8; + translate.y -= UPPER_BOUND; + + temp = compressedAttribute1.x * SHIFT_RIGHT8; + float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); + + vec2 imageSize = vec2(floor(temp), temp2); + +#ifdef FRAGMENT_DEPTH_CHECK + float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); + float applyTranslate = 0.0; + if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false + { + applyTranslate = 1.0; + labelHorizontalOrigin -= 2.0; + depthOrigin.x = labelHorizontalOrigin + 1.0; } - // Prepare initial state for nextIntersection - ix.index = 0; - ix.surroundCount = 0; - ix.surroundIsPositive = false; -} + depthOrigin = vec2(1.0) - (depthOrigin * 0.5); #endif -#if (INTERSECTION_COUNT > 1) -RayShapeIntersection nextIntersection(inout Intersections ix) { - vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); - RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; - const int passCount = INTERSECTION_COUNT * 2; + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - if (ix.index == passCount) { - return shapeIntersection; - } + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif - for (int i = 0; i < passCount; ++i) { - // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to continue instead. - if (i < ix.index) { - continue; - } +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) + temp = compressedAttribute3.w; + temp = temp * SHIFT_RIGHT12; - ix.index = i + 1; + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); +#endif - surfaceIntersection = ix.intersections[i]; - int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); - bool currShapeIsPositive = intersectionType < 2; - bool enter = intMod(intersectionType, 2) == 0; +#ifdef ALIGNED_AXIS + vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); + temp = compressedAttribute2.z * SHIFT_RIGHT5; + bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; +#else + vec3 alignedAxis = vec3(0.0); + bool validAlignedAxis = false; +#endif - ix.surroundCount += enter ? +1 : -1; - ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; + vec4 pickColor; + vec4 color; - // entering positive or exiting negative - if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { - shapeIntersection.entry = surfaceIntersection; - } + temp = compressedAttribute2.y; + temp = temp * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); - // exiting positive or entering negative after being inside positive - bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; - bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; - if (exitPositive || enterNegativeFromPositive) { - shapeIntersection.exit = surfaceIntersection; + temp = compressedAttribute2.x; + temp = temp * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); - // entry and exit have been found, so the loop can stop - if (exitPositive) { - // After exiting positive shape there is nothing left to intersect, so jump to the end index. - ix.index = passCount; - } - break; - } - } + temp = compressedAttribute2.z * SHIFT_RIGHT8; + bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; + temp = floor(temp) * SHIFT_RIGHT8; - return shapeIntersection; -} + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor /= 255.0; + + color.a = floor(temp); + color /= 255.0; + + /////////////////////////////////////////////////////////////////////////// + + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + +#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) + float eyeDepth = positionEC.z; #endif -// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var bL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersectionPair, INF_HIT, NO_HIT + positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); + positionEC.xyz *= show; -/* intersectDepth defines (set in Scene/VoxelRenderResources.js) -#define DEPTH_INTERSECTION_INDEX ### -*/ + /////////////////////////////////////////////////////////////////////////// -uniform mat4 u_transformPositionViewToUv; +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif -void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); - if (logDepthOrDepth != 0.0) { - // Calculate how far the ray must travel before it hits the depth buffer. - vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); - eyeCoordinateDepth /= eyeCoordinateDepth.w; - vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); - float t = dot(depthPositionUv - ray.pos, ray.dir); - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); - } else { - // There's no depth at this location. - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); +#ifdef EYE_DISTANCE_SCALING + float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); + scale *= distanceScale; + translate *= distanceScale; + // push vertex behind near plane for clipping + if (scale == 0.0) + { + positionEC.xyz = vec3(0.0); } -} -`;var SL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, -// NO_HIT, setIntersectionPair +#endif -/* Clipping plane defines (set in Scene/VoxelRenderResources.js) -#define CLIPPING_PLANES_UNION -#define CLIPPING_PLANES_COUNT -#define CLIPPING_PLANES_INTERSECTION_INDEX -*/ + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency == 0.0) + { + positionEC.xyz = vec3(0.0); + } +#endif -uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; +#ifdef EYE_DISTANCE_PIXEL_OFFSET + float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); + pixelOffset *= pixelOffsetScale; +#endif -// Plane is in Hessian Normal Form -vec4 intersectPlane(in Ray ray, in vec4 plane) { - vec3 n = plane.xyz; // normal - float w = plane.w; // -dot(pointOnPlane, normal) +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = compressedAttribute3.x; + float farSq = compressedAttribute3.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + positionEC.xyz = vec3(0.0); + } +#endif - float a = dot(ray.pos, n); - float b = dot(ray.dir, n); - float t = -(w + a) / b; + mat2 rotationMatrix; + float mpp; - return vec4(n, t); -} +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = compressedAttribute3.z; +#endif -void intersectClippingPlanes(in Ray ray, inout Intersections ix) { - vec4 backSide = vec4(-ray.dir, -INF_HIT); - vec4 farSide = vec4(ray.dir, +INF_HIT); - RayShapeIntersection clippingVolume; +#ifdef VERTEX_DEPTH_CHECK +if (lengthSq < disableDepthTestDistance) { + float depthsilon = 10.0; - #if (CLIPPING_PLANES_COUNT == 1) - // Union and intersection are the same when there's one clipping plane, and the code - // is more simplified. - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - bool reflects = dot(ray.dir, intersection.xyz) < 0.0; - clippingVolume.entry = reflects ? backSide : intersection; - clippingVolume.exit = reflects ? intersection : farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #elif defined(CLIPPING_PLANES_UNION) - vec4 firstTransmission = vec4(ray.dir, +INF_HIT); - vec4 lastReflection = vec4(-ray.dir, -INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; - } else { - lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; + vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; + vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth1 = getGlobeDepth(pEC1); + + if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) + { + vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth2 = getGlobeDepth(pEC2); + + if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) + { + vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth3 = getGlobeDepth(pEC3); + if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) + { + positionEC.xyz = vec3(0.0); } } - clippingVolume.entry = backSide; - clippingVolume.exit = lastReflection; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); - clippingVolume.entry = firstTransmission; - clippingVolume.exit = farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); - #else // intersection - vec4 lastTransmission = vec4(ray.dir, -INF_HIT); - vec4 firstReflection = vec4(-ray.dir, +INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; - } else { - firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; - } - } - if (lastTransmission.w < firstReflection.w) { - clippingVolume.entry = lastTransmission; - clippingVolume.exit = firstReflection; - } else { - clippingVolume.entry = vec4(-ray.dir, NO_HIT); - clippingVolume.exit = vec4(ray.dir, NO_HIT); - } - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #endif + } } -`;var vL=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT -// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace - -/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_INTERSECTION_INDEX ### // always 0 -*/ - -uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; - -struct Box { - vec3 p0; - vec3 p1; -}; +#endif -Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) -{ - // Find the min/max cornerpoints of the voxel in tile coordinates - vec3 tileOrigin = vec3(octreeCoords.xyz); - vec3 numSamples = vec3(u_dimensions); - vec3 voxelSize = 1.0 / numSamples; - vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; - vec3 coordP1 = coordP0 + voxelSize; + positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + gl_Position = czm_projection * positionEC; + v_textureCoordinates = textureCoordinates; - // Transform to the UV coordinates of the scaled tileset - float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); - vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); - vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); +#ifdef LOG_DEPTH + czm_vertexLogDepth(); +#endif - return Box(p0, p1); -} +#ifdef DISABLE_DEPTH_DISTANCE + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; + } -vec3 getBoxNormal(in Box box, in Ray ray, in float t) -{ - vec3 hitPoint = ray.pos + t * ray.dir; - vec3 lower = step(hitPoint, box.p0); - vec3 upper = step(box.p1, hitPoint); - return normalize(upper - lower); -} + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = 1.0; +#endif + } + } +#endif -// Find the distances along a ray at which the ray intersects an axis-aligned box -// See https://tavianator.com/2011/ray_box.html -RayShapeIntersection intersectBox(in Ray ray, in Box box) -{ - // Consider the box as the intersection of the space between 3 pairs of parallel planes - // Compute the distance along the ray to each plane - vec3 t0 = (box.p0 - ray.pos) * ray.dInv; - vec3 t1 = (box.p1 - ray.pos) * ray.dInv; +#ifdef FRAGMENT_DEPTH_CHECK + if (sizeInMeters) { + translate /= mpp; + dimensions /= mpp; + imageSize /= mpp; + } - // Identify candidate entries/exits based on distance from ray.pos - vec3 entries = min(t0, t1); - vec3 exits = max(t0, t1); +#if defined(ROTATION) || defined(ALIGNED_AXIS) + v_rotationMatrix = rotationMatrix; +#else + v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); +#endif - // The actual box intersection points are the furthest entry and the closest exit - float entryT = max(max(entries.x, entries.y), entries.z); - float exitT = min(min(exits.x, exits.y), exits.z); + float enableDepthCheck = 0.0; + if (lengthSq < disableDepthTestDistance) + { + enableDepthCheck = 1.0; + } - vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); - vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); + float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); + float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); - if (entryT > exitT) { - entryT = NO_HIT; - exitT = NO_HIT; - } + float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); + float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); - return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); -} + v_compressed.x = eyeDepth; + v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; + v_compressed.z = dw * SHIFT_LEFT12 + dh; + v_compressed.w = iw * SHIFT_LEFT12 + ih; + v_originTextureCoordinateAndTranslate.xy = depthOrigin; + v_originTextureCoordinateAndTranslate.zw = translate; + v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; -void intersectShape(in Ray ray, inout Intersections ix) -{ - RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); - setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); -} -`;var wL=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, -// setIntersectionPair +#endif -/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#ifdef SDF + vec4 outlineColor; + float outlineWidth; -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED + temp = sdf.x; + temp = temp * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN -#define CYLINDER_INTERSECTION_INDEX_ANGLE -*/ + temp = sdf.y; + temp = temp * SHIFT_RIGHT8; + float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.a = floor(temp); + outlineColor /= 255.0; -// Cylinder uniforms -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - uniform vec3 u_cylinderUvToRenderBoundsScale; - uniform vec3 u_cylinderUvToRenderBoundsTranslate; -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - uniform float u_cylinderUvToRenderRadiusMin; -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) - uniform vec2 u_cylinderRenderAngleMinMax; + v_outlineWidth = outlineWidth / 255.0; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency; #endif -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); - - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; + v_pickColor = pickColor; - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + v_color = color; + v_color.a *= translucency; - return vec4(-INF_HIT, t, t, +INF_HIT); } +`;function Ei(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Rt.clone(n)),l(i)&&(i=Rt.clone(i)),l(o)&&(o=Rt.clone(o)),l(r)&&(r=Dt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Mn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,pi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Wn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var Ioe=Ei.SHOW_INDEX=0,pU=Ei.POSITION_INDEX=1,Moe=Ei.PIXEL_OFFSET_INDEX=2,uze=Ei.EYE_OFFSET_INDEX=3,fze=Ei.HORIZONTAL_ORIGIN_INDEX=4,dze=Ei.VERTICAL_ORIGIN_INDEX=5,mze=Ei.SCALE_INDEX=6,_U=Ei.IMAGE_INDEX_INDEX=7,Doe=Ei.COLOR_INDEX=8,hze=Ei.ROTATION_INDEX=9,pze=Ei.ALIGNED_AXIS_INDEX=10,_ze=Ei.SCALE_BY_DISTANCE_INDEX=11,gze=Ei.TRANSLUCENCY_BY_DISTANCE_INDEX=12,yze=Ei.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,xze=Ei.DISTANCE_DISPLAY_CONDITION=14,bze=Ei.DISABLE_DEPTH_DISTANCE=15;Ei.TEXTURE_COORDINATE_BOUNDS=16;var Poe=Ei.SDF_INDEX=17;Ei.NUMBER_OF_PROPERTIES=18;function Vo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ei.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Vo(this,Ioe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),Vo(this,pU))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Vo(this,pU))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),Vo(this,Moe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Rt.equals(t,e)||(this._scaleByDistance=Rt.clone(e,t),Vo(this,_ze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Rt.equals(t,e)||(this._translucencyByDistance=Rt.clone(e,t),Vo(this,gze))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Rt.equals(t,e)||(this._pixelOffsetScaleByDistance=Rt.clone(e,t),Vo(this,yze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),Vo(this,uze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Vo(this,fze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Vo(this,dze))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Vo(this,mze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Vo(this,Doe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Vo(this,hze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),Vo(this,pze))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Vo(this,_U))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Vo(this,_U))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Vo(this,Doe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Vo(this,xze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Vo(this,bze))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Se?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Wn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Vo(this,_U))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),Vo(this,pU)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Vo(this,Ioe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Vo(this,Poe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Vo(this,Poe))}}});Ei.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ei.prototype._updateClamping=function(){Ei._updateClamping(this._billboardCollection,this)};var sR=new me,Ooe=new m;Ei._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,o=i.ellipsoid,r=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===qe.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!l(t._position))return;let c=o.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===qe.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=o.cartesianToCartographic(d,sR);p.height+=c.height,o.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=r.updateHeight(c,u),me.clone(c,sR);let f=i.getHeight(c);l(f)&&(sR.height=f),o.cartographicToCartesian(sR,Ooe),u(Ooe)};Ei.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(a){if(r._imageId!==t||r._image!==n||!Ke.equals(r._imageSubRegion,i))return;let c=e.textureCoordinates[a];r._imageWidth=e.texture.width*c.width,r._imageHeight=e.texture.height*c.height,r._imageIndex=a,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Vo(r,_U)}l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,l(o)&&o.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),r._imageIndexPromise=void 0})};Ei.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ei.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ei.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),Vo(this,Moe))};Ei.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ei.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),Vo(this,pU)};var Roe=new re;Ei._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(L.multiplyByPoint(i,t,Roe),Zi.computeActualWgs84Position(n,Roe))};var Loe=new m;Ei._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=L.multiplyByPoint(e,t,Loe),a=Zi.wgs84WithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return H.add(a,i,a),a};var hU=new H(0,0);Ei.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new H),H.clone(this._pixelOffset,hU),H.add(hU,this._translate,hU);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,sR);o=a.cartographicToCartesian(c,Loe),i=L.IDENTITY}return Ei._computeScreenSpacePosition(i,o,this._eyeOffset,hU,e,t)};Ei.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===pi.RIGHT?s-=i:e.horizontalOrigin===pi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?a-=o:e.verticalOrigin===Mn.CENTER&&(a-=o*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};Ei.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Rt.equals(this._scaleByDistance,e._scaleByDistance)&&Rt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Rt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Ei.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var ho=Ei;var Cze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},So=Object.freeze(Cze);var Tze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Is=Object.freeze(Tze);function zp(e,t,n,i,o){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var Aze=new H(16,16);function Yg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,Aze);this._context=e.context,this._pixelFormat=y(e.pixelFormat,ct.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Wn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Yg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Lt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function Eze(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,d=a/u,p=new zp(new H(s+r,r),new H(c,a)),g=new zp(new H,new H(c,a),e._root,p),h=new zp(new H(r,a+r),new H(c,u)),x=new zp(new H,new H(c,u),g,h);for(let T=0;Ts){t.childNode1=new zp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,T=0,A=o._imageIndex;if(A!==-1){let v=n[A];C=v.height,T=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(o.width,S*T))}let h=Math.floor(P.clamp(g,0,S6)),x=Math.floor(P.clamp(p,0,S6)),b=h*S6+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function ire(e,t,n,i,o){if(o.heightReference===qe.CLAMP_TO_GROUND){let h=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&C}let r,s=i[To.textureCoordinateBoundsOrLabelTranslate];if(Gt.maximumVertexTextureImageUnits>0){let h=0,x=0;l(o._labelTranslate)&&(h=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,h,x,0,0)):(r=o._index*4,s(r+0,h,x,0,0),s(r+1,h,x,0,0),s(r+2,h,x,0,0),s(r+3,h,x,0,0));return}let a=0,c=0,u=0,f=0,d=o._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,u=h.width,f=h.height}let p=a+u,g=c+f;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function Gze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[To.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function ore(e,t,n,i,o){if(!e._sdf)return;let r,s=i[To.sdf],a=o.outlineColor,c=o.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*uA+f*Km+d,g=c/Is.RADIUS,h=z.floatToByte(a.alpha)*uA+z.floatToByte(g)*Km;e._instanced?(r=o._index,s(r,p,h)):(r=o._index*4,s(r+0,p+Xoe,h),s(r+1,p+Koe,h),s(r+2,p+Joe,h),s(r+3,p+Zoe,h))}function Wze(e,t,n,i,o){qoe(e,t,n,i,o),$oe(e,t,n,i,o),Qoe(e,t,n,i,o),w6(e,t,n,i,o),I6(e,t,n,i,o),ere(e,t,n,i,o),tre(e,t,n,i,o),nre(e,t,n,i,o),ire(e,t,n,i,o),Gze(e,t,n,i,o),ore(e,t,n,i,o)}function v6(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=kze(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let R=0;R0){let R=Xze;R.length=0,(c[cR]||c[Dze]||c[Ize])&&R.push(qoe),(c[aR]||c[Boe]||c[vze]||c[wze]||c[Sze])&&(R.push($oe),this._instanced&&R.push(I6)),(c[aR]||c[Pze]||c[zoe])&&(R.push(Qoe),R.push(w6)),(c[aR]||c[Uoe])&&R.push(w6),c[koe]&&R.push(I6),c[Voe]&&R.push(ere),c[Hoe]&&R.push(tre),(c[Goe]||c[Oze]||c[aR]||c[cR])&&R.push(nre),(c[aR]||c[cR])&&R.push(ire),c[Woe]&&R.push(ore);let N=R.length;if(d=this._vaf.writers,a/n>.1){for(let F=0;Fn*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,x=L.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),qze(this,e,h);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===So.OPAQUE||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===So.TRANSLUCENT;this._blendOption===So.TRANSLUCENT||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,T,A,S,v,I=Gt.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=rR,T=oR,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),A=new Ge({defines:v,sources:[C]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Is.CUTOFF;this._sdf&&A.defines.push("SDF");let N=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===So.OPAQUE_AND_TRANSLUCENT&&(S=new Ge({defines:["OPAQUE",N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Zt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:To}),S=new Ge({defines:["TRANSLUCENT",N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Zt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:To})),this._blendOption===So.OPAQUE&&(S=new Ge({defines:[N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Zt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:To})),this._blendOption===So.TRANSLUCENT&&(S=new Ge({defines:[N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Zt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:To})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,N=this._blendOption===So.OPAQUE,F=this._blendOption===So.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,E=_.length,w=this._uniforms,D;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),D=this._batchTable.getPickId()):D="v_pickColor",R.length=E;let M=F?E*2:E;for(let B=0;B0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Jze);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&fA(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ta.defaultColor=z.WHITE;ta.defaultPointOutlineColor=z.BLACK;ta.defaultPointOutlineWidth=0;ta.defaultPointSize=8;function fA(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ta.defaultColor),i=y(e._pointOutlineColor,ta.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ta.defaultPointOutlineWidth),r=y(e._pointSize,ta.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&o===c&&r===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,r,p,o]);t.setImage(g,Gx(f,d,p,o,r))}ta.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ta.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ta.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ta.prototype.getPropertyInherited=function(e){return As.getPropertyInherited(this._content,this._batchId,e)};ta.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ta.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ta.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ta.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Hp=ta;function Zze(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let h=g.getImageData(0,0,f,d).data,x=h.length,b=f*4,C,T,A,S;for(C=0;C=0;--C)if(h[C]!==255){S=C/b|0;break}let v=-1;for(C=0;C]/,o=[],r="",s=Qr.LTR,a="",c=e.length;for(let u=0;u";case">":return"<"}}var a4e="\u05D0-\u05EA",c4e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",fre=new RegExp(`[${a4e}${c4e}]`);function l4e(e){let t=e.split(` +`),n="";for(let i=0;iu+1?s[u+1].Type===Qr.RTL?(c=d+c,a=0):(c=dR(c,a,f.Word),a+=f.Word.length):c=dR(c,0,d)):f.Type===Qr.RTL?c=dR(c,a,d):f.Type===Qr.LTR?(c+=f.Word,a=c.length):(f.Type===Qr.WEAK||f.Type===Qr.BRACKETS)&&(u>0&&s[u-1].Type===Qr.RTL?s.length>u+1?s[u+1].Type===Qr.RTL?c=dR(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:gre,imageSubRegion:h4e}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=pi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u0&&A.height>0){let S=(0,pre.default)(A,{cutoff:Is.CUTOFF,radius:Is.RADIUS}),v=A.getContext("2d"),I=A.width,O=A.height,R=v.getImageData(0,0,I,O);for(let N=0;N0?T=A.pop():(T=e._billboardCollection.add({collection:e}),T._labelDimensions=new H,T._labelTranslate=new H),a.billboard=T),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=pi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.image=b,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===zo.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===zo.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===zo.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function hre(e,t,n){return t===pi.CENTER?-e/2:t===pi.RIGHT?-(e+n.x):n.x}var rr=new H,b4e=new H;function C4e(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(l(g)?e._backgroundPadding:H.ZERO,b4e);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d0&&(C===pi.CENTER?v=-s/2-h.x:C===pi.RIGHT?v=-(s+h.x*2):v=0,rr.x=v*b,T===Mn.TOP?rr.y=x-u-c:T===Mn.CENTER?rr.y=(x-u)/2-c:T===Mn.BASELINE?rr.y=-h.y-c:rr.y=0,rr.y=rr.y*b,g.width=R,g.height=N,g._setTranslate(rr),g._labelTranslate=H.clone(rr,g._labelTranslate)),e.heightReference===qe.CLAMP_TO_GROUND)for(d=0;d0?So.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Jm.prototype.isDestroyed=function(){return!1};Jm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var Zm=Jm;var mR=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; -#define POSITIVE_HIT vec2(t, +INF_HIT); -#define NEGATIVE_HIT vec2(-INF_HIT, t); +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; -vec2 intersectHalfSpace(Ray ray, float angle) +void main() { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; - // Half space cuts right through the camera, pick the side to intersect - if (a == 0.0) { - if (b >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; - } + if (width < 1.0) + { + show = 0.0; } - if (t >= 0.0 != s >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; + vec4 pickColor = batchTable_getPickColor(batchTableIndex); + + vec4 p, prev, next; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); } -} -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } + #endif - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; } +`;var Bc={};Bc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};Bc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var T4e=new me;Bc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=y(t,L.IDENTITY);let o=L.inverseTransformation(t,A4e),r=L.multiplyByPoint(o,m.ZERO,E4e),s=m.normalize(L.multiplyByPointAsVector(o,m.UNIT_Y,xre),xre),a=fn.fromPointNormal(r,s,S4e),c=m.normalize(L.multiplyByPointAsVector(o,m.UNIT_X,bre),bre),u=fn.fromPointNormal(r,c,v4e),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=L.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Di.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Ere),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Are=iu.POSITION_INDEX=0,M4e=iu.SHOW_INDEX=1,L4e=iu.WIDTH_INDEX=2,N4e=iu.MATERIAL_INDEX=3,pR=iu.POSITION_SIZE_INDEX=4,F4e=iu.DISTANCE_DISPLAY_CONDITION=5,Ere=iu.NUMBER_OF_PROPERTIES=6;function Wp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(iu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Wp(this,M4e))}},positions:{get:function(){return this._positions},set:function(e){let t=Co(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Wp(this,pR),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Wp(this,Are),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Wp(this,N4e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Wp(this,L4e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Wp(this,pR)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Wp(this,F4e))}}});iu.prototype.update=function(){let e=L.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Are]>0||this._propertiesChanged[pR]>0;if((!L.equals(e,this._modelMatrix)||i)&&(this._segments=Di.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=L.clone(e,this._modelMatrix),this._segments.positions.length!==t)Wp(this,pR);else{let o=n.length;for(let r=0;r2){if(o[B6]||o[Sre]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=jn.fromCartesian(h.center,Mre),b=re.fromElements(x.low.x,x.low.y,x.low.z,h.radius,Lre);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[V4e]){let h=Nre;h.x=0,h.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(h.x=x.near,h.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c0){let G=N.isTranslucent();a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,E=_t(p(N._uniforms),e._uniformMap),_.boundingVolume=ae.clone(_R,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?Ae.TRANSLUCENT:Ae.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=F,_.offset=S,S+=F,F=0,c=!0,r.push(_)}N=D._material,N.update(o),R=M}let B=D._locatorBuckets,V=B.length;for(let G=0;G0&&(a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,E=_t(p(N._uniforms),e._uniformMap),_.boundingVolume=ae.clone(_R,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=N.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=N.isTranslucent()?Ae.TRANSLUCENT:Ae.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=F,_.offset=S,c=!0,r.push(_)),R=void 0}}n.length=a}Od.prototype.isDestroyed=function(){return!1};Od.prototype.destroy=function(){return Fre(this),U6(this),Bre(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function G4e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[B6]?(i.bufferUsage!==ke.STREAM_DRAW&&(t=!0,i.bufferUsage=ke.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==ke.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=ke.STATIC_DRAW):i.frameCount--),t}var wre=[0,0,0];function Ire(e,t,n){e._createVertexArray=!1,U6(e),Fre(e),q4e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),C,T=0,A=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,b,T,A,S,r,t,n),h===ne.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,T));let E=g.lengthOfPositions;T+=6*E*3,A+=E*4,S+=E*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,I=ke.STATIC_DRAW;e._positionBuffer=ht.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(C)&&(O=ht.createVertexBuffer({context:t,typedArray:C,usage:v})),e._texCoordExpandAndBatchIndexBuffer=ht.createVertexBuffer({context:t,typedArray:b,usage:I});let R=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,F=0,_=i.length;for(let E=0;E<_;++E)if(o=i[E],o.length>0){let w=new Uint16Array(o),D=ht.createIndexBuffer({context:t,typedArray:w,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});F+=a[E];let M=6*(E*(R*P.SIXTY_FOUR_KILOBYTES)-F*R),B=R+M,V=R+B,U=R+V,G=R+U,k=R+G,Y=E*(N*P.SIXTY_FOUR_KILOBYTES)-F*N,j=[{index:Tl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Tl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Tl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Tl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Tl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Tl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Tl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Tl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Tl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Tl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Tl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Tl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Tl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:Y}],$,W,K,J;h===ne.SCENE3D?(W=e._positionBuffer,$="vertexBuffer",K=wre,J="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(W=wre,$="value",K=e._positionBuffer,J="vertexBuffer"):(W=O,$="vertexBuffer",K=e._positionBuffer,J="vertexBuffer"),j[0][$]=W,j[1][$]=W,j[2][J]=K,j[3][J]=K,j[4][$]=W,j[5][$]=W,j[6][J]=K,j[7][J]=K,j[8][$]=W,j[9][$]=W,j[10][J]=K,j[11][J]=K;let he=new ri({context:t,attributes:j,indexBuffer:D});e._vertexArrays.push({va:he,buckets:u[E]})}}}function W4e(e,t){return t instanceof Lt?t.id:t}var CU=[];function j4e(e){let t=zi._uniformList[e.type],n=t.length;CU.length=2*n;let i=0;for(let o=0;o1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new $m(c,t,n)),u.addPolyline(a)}}}function Y4e(e,t){let n=t.mode;(e._mode!==n||!L.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=L.clone(e.modelMatrix),e._createVertexArray=!0)}function k6(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s0,b=g._index,C=this.getSegments(g,a),T=C.positions,A=C.lengths,S=T.length,v=g.getPickId(s).color,I=0,O=0,R;for(let V=0;V0||us.x>0&&uf.x<0)&&m.clone(us,uf),(us.x<0&&ff.x>0||us.x>0&&ff.x<0)&&m.clone(us,ff));let Y=G?2:0,j=k?2:4;for(let $=Y;$2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,D),r.setBatchedAttribute(b,4,M))}};var J4e=new m,Z4e=new m,$4e=new m,Dre=new m;$m.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d0)g[0]=x;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let x=0;for(let b=0;bP.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new F6(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new F6(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};$m.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(u.z,u.x,u.y)}return dA.positions=o,dA.lengths=e._segments.lengths,dA};var Ore;$m.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Ore,c=6*s*3;!l(a)||a.lengthc&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,h=0,x;s=f.length;for(let b=0;b0||us.x>0&&uf.x<0)&&m.clone(us,uf),(us.x<0&&ff.x>0||us.x>0&&ff.x<0)&&m.clone(us,ff));let S=T?2:0,v=A?2:4;for(let I=S;I{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g{e.isDestroyed()||(e._error=a)})}Zg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),x=h[0];hHe(e,h),e._indices=Ue.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),yHe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function yHe(e){l(e._primitive)||(e._primitive=new _x({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}jp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};jp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};jp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};jp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};jp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=gHe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var bR=jp;var CR=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); -} +uniform mat4 u_modifiedModelView; -vec2 intersectUnitCylinder(Ray ray) +void main() { - vec3 o = ray.pos; - vec3 d = ray.dir; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; - if (det < 0.0) { - return vec2(NO_HIT); - } + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; +} +`;function Md(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Md.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function xHe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+oe.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,oe.pack(o,a,c),c+=oe.packedLength,m.pack(r,a,c),a}var bHe=new gi("createVectorTilePolylines",5),mA={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function CHe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=xHe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=bHe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),THe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function THe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=ht.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),f=ht.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),d=ht.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),h=ht.createIndexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),x=[{index:mA.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:mA.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:mA.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:mA.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:mA.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ri({context:t,attributes:x,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var TR=new L,Ure=new m;function AHe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,TR),L.multiplyByPoint(TR,e._center,Ure),L.setTranslation(TR,Ure,TR),TR},u_highlightColor:function(){return e._highlightColor}})}function EHe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:mn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var SHe=`uniform vec4 u_highlightColor; +void main() +{ + out_FragColor = u_highlightColor; +} +`;function vHe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(CR),o=n.getFragmentShaderCallback(!1,void 0,!1)(SHe),r=new Ge({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Kl,i]}),s=new Ge({defines:["VECTOR_TILE"],sources:[o]});e._sp=Zt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:mA})}function wHe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ae.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Md.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r= 1.0) - { - float tCap = (sign(z1) - o.z) / d.z; - t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; - } +void main() +{ + // vertex corner IDs + // 3-----------7 + // /| left /| + // / | 1 / | + // 2-----------6 5 end + // | / | / + // start |/ right |/ + // 0-----------4 + // + float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end + float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - if (abs(z2) >= 1.0) - { - float tCap = (sign(z2) - o.z) / d.z; - t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; - } + vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; + vec3 right = normalize(cross(forward, startEllipsoidNormal)); - return vec2(t1, t2); -} + vec4 position = vec4(startPositionAndHeight.xyz, 1.0); + position.xyz += forward * isEnd; -vec2 intersectUnitCircle(Ray ray) { - vec3 o = ray.pos; - vec3 d = ray.dir; + v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - float t = -o.z / d.z; - vec2 zPlanePos = o.xy + d.xy * t; - float distSqr = dot(zPlanePos, zPlanePos); + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - if (distSqr > 1.0) { - return vec2(NO_HIT); - } + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; - return vec2(t, t); -} + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; -vec2 intersectInfiniteUnitCylinder(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - if (det < 0.0) { - return vec2(NO_HIT); - } + gl_Position = czm_depthClamp(czm_projection * position); - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - return vec2(tmin, tmax); + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; } +`;var ER=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; -void intersectShape(Ray ray, inout Intersections ix) +uniform vec4 u_highlightColor; +void main() { - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; - ray.dir *= u_cylinderUvToRenderBoundsScale; - #else - // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. - // Direction is scaled as well to be in sync with position. - ray.pos = ray.pos * 2.0 - 1.0; - ray.dir *= 2.0; - #endif - - #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - vec2 outerIntersect = intersectUnitCircle(ray); - #else - vec2 outerIntersect = intersectUnitCylinder(ray); - #endif - - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - if (outerIntersect.x == NO_HIT) { + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - // When the cylinder is perfectly thin it's necessary to sandwich the - // inner cylinder intersection inside the outer cylinder intersection. + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the cylinder to be invisible because it will think the ray - // is still inside the inner (negative) cylinder after exiting the - // outer (positive) cylinder. + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) - Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); - vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); - #endif + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #endif + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + out_FragColor = u_highlightColor; + + czm_writeDepthClamp(); } -`;var DL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersection, setIntersectionPair, INF_HIT, NO_HIT +`;function qp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(oi._defaultMinTerrainHeight,oi._defaultMaxTerrainHeight),this._boundingVolume=Ln.fromRectangle(e.rectangle,oi._defaultMinTerrainHeight,oi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function RHe(e,t,n){let i=oi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Ln.fromRectangle(c,o,r,n,a)}function MHe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+oe.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,oe.pack(o,a,c),c+=oe.packedLength,m.pack(r,a,c),a}var LHe=new gi("createVectorTileClampedPolylines"),$g={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function NHe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=MHe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=LHe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),FHe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function FHe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=ht.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),h=ht.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),x=ht.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),b=ht.createVertexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW}),C=ht.createVertexBuffer({context:t,typedArray:c,usage:ke.STATIC_DRAW}),T=ht.createIndexBuffer({context:t,typedArray:u,usage:ke.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),A=[{index:$g.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:$g.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:$g.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:$g.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:$g.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:$g.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:$g.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ri({context:t,attributes:A,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var SR=new L,Vre=new m;function BHe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,SR),L.multiplyByPoint(SR,e._center,Vre),L.setTranslation(SR,Vre,SR),SR},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function zre(e){return Ve.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})}function kHe(e){l(e._rs)||(e._rs=zre(!1),e._rs3DTiles=zre(!0))}function UHe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(AR),o=n.getFragmentShaderCallback(!1,void 0,!0)(ER),r=new Ge({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Kl,i]}),s=new Ge({defines:["VECTOR_TILE"],sources:[o]});e._sp=Zt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:$g})}function VHe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ae.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Hn.TERRAIN||i===Hn.BOTH)&&t.commandList.push(n),(i===Hn.CESIUM_3D_TILE||i===Hn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}qp.prototype.getPositions=function(e){return Yx.getPolylinePositions(this,e)};qp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o{e.isDestroyed()||(e._error=t)})}qp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=jHe(this).then(NHe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}BHe(this,t),UHe(this,t),kHe(this);let n=e.passes;(n.render||n.pick)&&VHe(this,e)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var vR=qp;var z6=32767,qHe=new me,YHe=new m;function XHe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);qn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f{this._resolveContent=r}),QHe(this,i,o)}Object.defineProperties(Qm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function KHe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function JHe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(c),r=0;r0&&(C=Oo(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let A=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),I=A+S+v,O=new yp(e,I,C,T,KHe(e));if(e._batchTable=O,I===0)return;let R=new vd(x,b),N=R.getGlobalProperty("REGION");if(!l(N))throw new de("Feature table global property: REGION must be defined");let F=ce.unpack(N),_=N[4],E=N[5],w=e._tile.computedTransform,D=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(D)?(D=m.unpack(D),L.multiplyByPoint(w,D,D)):(D=ce.center(F),D.height=P.lerp(_,E,.5),D=oe.WGS84.cartographicToCartesian(D));let M=JHe(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(V))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=B.reduce(function(W,K){return W+K*2},0),G=V.reduce(function(W,K){return W+K},0),k=new Uint32Array(t,n,G);n+=d;let Y=new Uint16Array(t,n,U);n+=p;let j,$;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(j=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),$=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new bR({positions:Y,counts:B,indexCounts:V,indices:k,minimumHeight:_,maximumHeight:E,polygonMinimumHeights:j,polygonMaximumHeights:$,center:D,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:M.polygons,modelMatrix:w})}if(S>0){R.featuresLength=S;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(S);for(let $=0;$0){let B=new Uint16Array(t,n,v*3);n+=h,e._points=new xR({positions:B,batchIds:M.points,minimumHeight:_,maximumHeight:E,rectangle:F,batchTable:O})}}function H6(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Qm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Qm.prototype.getFeature=function(e){return l(this._features)||H6(this),this._features[e]};Qm.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Qm.prototype.applyStyle=function(e){l(this._features)||H6(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Qm.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||H6(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Qm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Qm.prototype.isDestroyed=function(){return!1};Qm.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function eGe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c=0?i[r]:void 0}var Jx=iGe;function Jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};Jp.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};Jp.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};Jp.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};Jp.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var PR=Jp;function W6(e,t){let n=ni(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){W6._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new PR({tile:n,class:o})}}W6._oneTimeWarning=Nt;var OR=W6;function oGe(e){let t=new Uint8Array(e),n=_d(t);if(n==="glTF"&&(n="glb"),fs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=rGe(t);if(l(i.root))return{contentType:fs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:fs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:fs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:fs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:fs.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function rGe(e){let t;try{t=Oo(e)}catch{throw new de("Invalid tile content.")}return t}var eh=oGe;function Fd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;slGe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function lGe(e,t,n){if(l(t))try{let i=eh(t);if(i.contentType===fs.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===fs.GEOMETRY||i.contentType===fs.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=Xx[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Kx(o,u));let f=Jx(o,u);return l(f)&&(a.group=new dx({metadata:f})),a}catch(i){Wre(e,n,i)}}function Wre(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Fd.prototype.cancelRequests=function(){for(let e=0;e0?Jr.COUNTER_CLOCKWISE:Jr.CLOCKWISE};Qg.triangulate=function(e,t){let n=H.packArray(e);return(0,Qre.default)(n,t,2)};var ese=new m,tse=new m,nse=new m,Jre=new m,Zre=new m,$re=new m,Zp=new m,ise=new H,ose=new H,rse=new H,_A=new H;Qg.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a0;){let A=s.pop(),S=s.pop(),v=s.pop(),I=m.fromArray(u,v*3,ese),O=m.fromArray(u,S*3,tse),R=m.fromArray(u,A*3,nse),N,F,_;r&&(N=H.fromArray(f,v*2,ise),F=H.fromArray(f,S*2,ose),_=H.fromArray(f,A*2,rse));let E=m.multiplyByScalar(m.normalize(I,Jre),x,Jre),w=m.multiplyByScalar(m.normalize(O,Zre),x,Zre),D=m.multiplyByScalar(m.normalize(R,$re),x,$re),M=m.magnitudeSquared(m.subtract(E,w,Zp)),B=m.magnitudeSquared(m.subtract(w,D,Zp)),V=m.magnitudeSquared(m.subtract(D,E,Zp)),U=Math.max(M,B,V),G,k,Y;U>C?M===U?(G=`${Math.min(v,S)} ${Math.max(v,S)}`,a=h[G],l(a)||(k=m.add(I,O,Zp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(N,F,_A),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(v,a,A),s.push(a,S,A)):B===U?(G=`${Math.min(S,A)} ${Math.max(S,A)}`,a=h[G],l(a)||(k=m.add(O,R,Zp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(F,_,_A),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(S,a,v),s.push(a,A,v)):V===U&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=h[G],l(a)||(k=m.add(R,I,Zp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(_,N,_A),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(A,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(A))}let T={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(T.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(T)};var wGe=new me,IGe=new me,DGe=new me,J6=new me;Qg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a0;){let v=s.pop(),I=s.pop(),O=s.pop(),R=m.fromArray(u,O*3,ese),N=m.fromArray(u,I*3,tse),F=m.fromArray(u,v*3,nse),_,E,w;r&&(_=H.fromArray(f,O*2,ise),E=H.fromArray(f,I*2,ose),w=H.fromArray(f,v*2,rse));let D=e.cartesianToCartographic(R,wGe),M=e.cartesianToCartographic(N,IGe),B=e.cartesianToCartographic(F,DGe);C.setEndPoints(D,M);let V=C.surfaceDistance;T.setEndPoints(M,B);let U=T.surfaceDistance;A.setEndPoints(B,D);let G=A.surfaceDistance,k=Math.max(V,U,G),Y,j,$,W,K;k>b?V===k?(Y=`${Math.min(O,I)} ${Math.max(O,I)}`,a=h[Y],l(a)||(j=C.interpolateUsingFraction(.5,J6),$=(D.height+M.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Zp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(_,E,_A),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,I,v)):U===k?(Y=`${Math.min(I,v)} ${Math.max(I,v)}`,a=h[Y],l(a)||(j=T.interpolateUsingFraction(.5,J6),$=(M.height+B.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Zp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(E,w,_A),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(I,a,O),s.push(a,v,O)):G===k&&(Y=`${Math.min(v,O)} ${Math.max(v,O)}`,a=h[Y],l(a)||(j=A.interpolateUsingFraction(.5,J6),$=(B.height+D.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Zp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(w,_,_A),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,I),s.push(a,O,I)):(g.push(O),g.push(I),g.push(v))}let S={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(S.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(S)};Qg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,oe.WGS84);let o=SGe,r=vGe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;aa?g=P.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,b=Math.ceil(h/t)+1,C=g/(x-1),T=h/(b-1),A=ce.northwest(e,r),S=ce.center(e,RGe);(n!==0||i!==0)&&(S.longitude=0;h--)ds.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(h=0,g=i-2;g>0;g--)ds.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let b=d.length/3*2,C=Ue.createTypedArray(d.length/3,b),T=0;for(let S=0;S0){hf.longitude=(t.west+t.east)*.5,hf.latitude=u;let x=n.cartographicToCartesian(hf,xA.origin);m.clone(c,xA.direction);let b=fn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,hse);Ji.rayPlane(xA,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,IU)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),IU);let d=m.cross(f,a,mse);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){hf.longitude=(t.west+t.east)*.5,hf.latitude=p;let x=n.cartographicToCartesian(hf,xA.origin);m.negate(c,xA.direction);let b=fn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,hse);Ji.rayPlane(xA,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,IU)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),IU);let h=m.cross(a,g,mse);m.normalize(h,e.northNormal)}var WGe=new m,jGe=new m,qGe=new m(0,-1,0),YGe=new m(0,0,-1),pse=new m;function XGe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),WGe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),jGe),f.z=f.y,f.y=f.x,f.x=0,d=qGe,g=m.UNIT_Y,p=YGe,h=m.UNIT_Z);let x=m.subtract(i,u,pse),b=m.dot(x,d),C=m.dot(x,p),T=m.subtract(i,f,pse),A=m.dot(T,g),S=m.dot(T,h);b>0?r+=b*b:A>0&&(r+=A*A),C>0?r+=C*C:S>0&&(r+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ey.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ey.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ey.prototype.clear=function(){this._array.length=this._offset=this._length=0};ey.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ty=ey;var sr={};sr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u0?new Array(o):void 0;for(let a=0;a0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):fn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,fn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=u9(fn.projectPointOntoPlane(c,t,l9),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=vse(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=u9(fn.projectPointOntoPlane(c,t,l9),i[r],c,this._edgeNormals[n[r]]),d=m.distanceSquared(a,t),d3)return a=u9(fn.projectPointOntoPlane(this._boundingPlanes[1],t,l9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+u)%4]):m.distance(t,this._vertices[4+(n[1]-2+u)%4])};var E8e=new m,S8e=new m;function vse(e,t,n){let i=m.subtract(n,t,E8e),o=m.subtract(e,t,S8e),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var v8e=new fn(m.UNIT_X,0);function u9(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c0&&(h=!0,d+=u),s1||ni(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?L.unpack(n.transform):L.clone(L.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=L.multiply(a,this.transform,new L),u=l(i)?i._initialTransform:L.IDENTITY;this._initialTransform=L.multiply(u,this.transform,new L),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Uo.REPLACE:Uo.ADD):l(i)?p=i.refine:p=Uo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,x,b,C;if(t=Se.createIfNeeded(t),r)x=Ho.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(Zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new hA(e,this),h=!0,x=Ho.READY):(x=Ho.UNLOADED,b=t.getDerivedResource({url:v}),C=Ua.getServerKey(b.getUrlComponent()))}else g=new hA(e,this),h=!0,x=Ho.READY;this._content=g,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.metadata=OR(e,n),this.cacheNode=void 0;let T=n.expire,A,S;l(T)&&(A=T.duration,l(T.date)&&(S=ee.fromIso8601(T.date))),this.expireDuration=A,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=df.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zo._deprecationWarning=Q;Object.defineProperties(Zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Ho.READY}},contentUnloaded:{get:function(){return this._contentState===Ho.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Ho.EXPIRED}},contentFailed:{get:function(){return this._contentState===Ho.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var oy=new m;function M8e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,oy),c=m.add(s.positionWC,a,oy),u=m.subtract(c,r,oy);if(m.magnitude(u)>o){let S=m.normalize(u,oy),v=m.multiplyByScalar(S,o,oy),I=m.add(r,v,oy),O=m.subtract(I,s.positionWC,oy),R=m.normalize(O,oy);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Uo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Mo.PRELOAD_FLIGHT||n._pass===Mo.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*h;if(e._foveatedFactor<=x)return!1;let b=h-x,C=P.clamp((e._foveatedFactor-x)/b,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-T<=A}var Rse=new ee;Zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof on){let g=u.offCenterFrustum;l(g)&&(u=g);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),h=u.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,C=P.fog(g,x)*b;p-=C}}return p/=e.pixelRatio,p};function L8e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,o=e._maximumScreenSpaceError,r=t._screenSpaceErrorProgressiveResolution<=o,s=l(i)&&i._screenSpaceErrorProgressiveResolution>o;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function N8e(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:Zr.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==Zr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=N8e(n,this),this._priorityProgressiveResolution=L8e(n,this),this.priorityDeferred=M8e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(Rse);ee.lessThan(this.expireDate,e)&&(this._contentState=Ho.EXPIRED,this._expiredContent=this._content)}};function F8e(e){if(!l(e.expireDuration))return;let t=ee.now(Rse);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function B8e(e){return function(){return e._priority}}Zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?k8e(this):V8e(this)};function k8e(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ni(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new RR(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Ho.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Ho.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Ho.FAILED,o})}async function U8e(e,t,n,i,o){let r=e._contentState;e._contentState=Ho.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ti.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Ho.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ti.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await z8e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Ho.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Ho.FAILED,a}}function V8e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new jo({throttle:!0,throttleByServer:!0,type:Xr.TILES3D,priorityFunction:B8e(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return U8e(e,o,i,n,r)}async function z8e(e,t){let n=eh(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===fs.GEOMETRY||n.contentType===fs.VECTOR,(n.contentType===fs.IMPLICIT_SUBTREE||n.contentType===fs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===fs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=Xx[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Kx(i,s));let a=Jx(i,s);return l(a)&&(o.group=new dx({metadata:a})),o}Zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Ho.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Mse=new ae;function m9(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Mse);e._boundingVolume2D=new t_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function H8e(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Mse);e._contentBoundingVolume2D=new t_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=m9(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==tn.INSIDE,s===tn.OUTSIDE)return Zr.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return tn.INSIDE;if(this._visibilityPlaneMask===Zr.MASK_INSIDE)return tn.INSIDE;let t=e.cullingVolume,n=H8e(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let r=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=r!==tn.INSIDE,r===tn.OUTSIDE)return tn.OUTSIDE}return t.computeVisibility(n)};Zo.prototype.distanceToTile=function(e){return m9(this,e).distanceToCamera(e)};var G8e=new m;Zo.prototype.distanceToTileCenter=function(e){let n=m9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,G8e);return m.dot(e.camera.directionWC,i)};Zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Lse=new Z,Nse=new m,W8e=new Z,Fse=new m,Bse=new ce,j8e=new Ln,d9=new L;function q8e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],Fse),o=Z.fromArray(e,3,W8e);i=L.multiplyByPoint(t,i,i);let r=L.getMatrix3(t,Lse);return o=Z.multiply(r,o,o),l(n)?(n.update(i,o),n):new gf(i,o)}function Y8e(e,t,n,i){let o=ce.unpack(e,0,Bse),r=e[4],s=e[5],a=Ln.fromRectangle(o,r,s,oe.WGS84,j8e),c=a.center,u=a.halfAxes;t=L.multiplyTransformation(t,L.inverseTransformation(n,d9),d9),c=L.multiplyByPoint(t,c,c);let f=L.getMatrix3(t,Lse);return u=Z.multiply(f,u,u),l(i)&&i instanceof gf?(i.update(c,u),i):new gf(c,u)}function X8e(e,t,n,i){if(!L.equalsEpsilon(t,n,P.EPSILON8))return Y8e(e,t,n,i);if(l(i))return i;let o=ce.unpack(e,0,Bse);return new pf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function K8e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],Fse),o=e[3];i=L.multiplyByPoint(t,i,i);let r=L.getScale(t,Nse),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new t_(i,o)}Zo.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new de("boundingVolume must be defined");if(ni(e,"3DTILES_bounding_volume_S2"))return new kR(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:o,sphere:r}=e;if(l(i))return q8e(i,t,n);if(l(o))return X8e(o,t,this._initialTransform,n);if(l(r))return K8e(r,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};Zo.prototype.updateTransform=function(e){e=y(e,L.IDENTITY);let t=L.multiplyTransformation(e,this.transform,d9);if(!!L.equals(t,this.computedTransform))return;L.clone(t,this.computedTransform);let i=this._header,o=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zo.prototype.updateGeometricErrorScale=function(){let e=L.getScale(this.computedTransform,Nse),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function J8e(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=zt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Z8e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Ho.FAILED,o}}function $8e(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;$8e(this,e),J8e(this,e,t,n),Z8e(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;so||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};sb.prototype.trim=function(){this._trimTiles=!0};var GR=sb;function MU(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function p9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}MU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=p9(e,n),this._referenceMaximum[n]=p9(t,n)};function t5e(e,t){let n=e.tilePropertyName;if(l(n)){let i=p9(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var h9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];MU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=t5e(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=h9.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=h9[d],x=h9[p],b=z.clone(z.WHITE);b.red=P.lerp(h.red,x.red,g),b.green=P.lerp(h.green,x.green,g),b.blue=P.lerp(h.blue,x.blue,g),e._debugColor=b};MU.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var WR=MU;function wA(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}wA.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function LU(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),l(o)){let d=o.length;for(let p=0;p>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function g9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}YR.encode2D=function(e,t){return(zse(e)|zse(t)<<1)>>>0};YR.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Hse(e),t[1]=Hse(e>>1),t};YR.encode3D=function(e,t,n){return _9(e)|_9(t)<<1|_9(n)<<2};YR.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=g9(e),t[1]=g9(e>>1),t[2]=g9(e>>2),t};var ay=YR;function Go(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Vr.OCTREE&&(this.z=e.z)}Object.defineProperties(Go.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Vr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Vr.OCTREE?ay.encode3D(this.x,this.y,this.z):ay.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Vr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Go.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Vr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Go.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Vr.OCTREE?this.z===e.z:!0)};Go.prototype.isImplicitTilesetRoot=function(){return this.level===0};Go.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Go.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Go.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Vr.OCTREE&&(e.z=this.z),e};var Gse=[0,0,0];Go.fromMortonIndex=function(e,t,n,i){let o;return e===Vr.OCTREE?(o=ay.decode3D(i,Gse),new Go({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=ay.decode2D(i,Gse),new Go({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Go.fromTileIndex=function(e,t,n){let i,o,r;return e===Vr.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Go.fromMortonIndex(e,t,i,r)};var ab=Go;function r_(){}r_.selectTiles=function(e,t){fe.throwInstantiationError()};r_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};r_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};r_.selectTile=function(e,t){if(e.contentVisibility(t)===tn.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];Wse(r,t),e._visible=r._visible;return}if(s5e(e,t)){e._visible=!1;return}let i=e.refine===Uo.REPLACE,o=e._optimChildrenWithinParent===df.USE_OPTIMIZATION;if(i&&o&&n&&!a5e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function s5e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Uo.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function a5e(e,t){let n=!1,i=e.children;for(let o=0;o0;){XR.stackMaximumLength=Math.max(XR.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Uo.ADD,u=a.refine===Uo.REPLACE,f=l5e(a);f&&u5e(a,s,t),(c||u&&!f)&&(f5e(e,a),o(a,t),d5e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return XR.stack.trim(XR.stackMaximumLength),n};function l5e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function u5e(e,t,n){let{children:i}=e;for(let o=0;o0;){JR.stackMaximumLength=Math.max(JR.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?m5e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Uo.ADD?(y9(c,t),o(c,t)):c.refine===Uo.REPLACE&&(o(c,t),d&&y9(c,t)):(n._emptyTiles.push(c),o(c,t),d&&y9(c,t)),r(c,t),s(c,t)}}function p5e(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ps,s=!0,a=ZR.stack;for(a.push(e);a.length>0;){ZR.stackMaximumLength=Math.max(ZR.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let g=0;g0;){eM.stackMaximumLength=Math.max(eM.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;cn._depth+e.skipLevels)}function b5e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ps;for(let u=0;ut:e._screenSpaceError>t:!0}function T5e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Ps,c=QR.stack;for(c.push(e);c.length>0;){QR.stackMaximumLength=Math.max(QR.stackMaximumLength,c.length);let u=c.pop();y5e(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?b5e(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Uo.ADD?(NU(u,t),r(u,t)):u.refine===Uo.REPLACE&&(C5e(u,i)?(r(u,t),p&&NU(u,t)):p?(NU(u,t),r(u,t)):x5e(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&NU(u,t)),s(u,t),a(u,t)}}function A5e(e,t){let{selectTile:n,canTraverse:i}=Ps,{stack:o,ancestorStack:r}=s_,s;for(o.push(e);o.length>0||r.length>0;){if(s_.stackMaximumLength=Math.max(s_.stackMaximumLength,o.length),s_.ancestorStackMaximumLength=Math.max(s_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Uo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f(i._metadataExtension=s,r))}).then(function(r){if(i.isDestroyed())return;i._geometricError=r.geometricError,i._scaledGeometricError=r.geometricError,i._root=i.loadTileset(o,r);let s=l(r.asset.gltfUpAxis)?uo.fromName(r.asset.gltfUpAxis):uo.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,uo.X),u=r.asset;i._asset=u,i._properties=r.properties,i._extensionsUsed=r.extensionsUsed,i._extensions=r.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=r.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let h=f.cesium.credits,x=i._credits;l(x)||(x=[],i._credits=x);for(let b=0;boi._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=L.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(yr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return Q("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),l(this._root)}},readyPromise:{get:function(){return Q("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Q("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(L.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):L.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});yr.fromIonAssetId=async function(e,t){let n=await Zs.fromAssetId(e);return yr.fromUrl(n,t)};yr.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await yr.loadJson(n),r=await Zse(n,o),s=new yr(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras;let c=n.credits;l(c)||(c=[]);let u=a.extras;if(l(u)&&l(u.cesium)&&l(u.cesium.credits)){let b=u.cesium.credits;for(let C=0;Coi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=L.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};yr.loadJson=function(e){return Se.createIfNeeded(e).fetchJson()};yr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};yr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&yr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Xse(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Uo.ADD;let u=c._header.children;if(l(u))for(let f=0;fb.minimumRadius){let A=me.fromCartesian(T,b,E5e);n=m.normalize(a.positionWC,Kse),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=L.multiplyByPoint(x,a.positionWC,w5e);if(n=m.UNIT_Z,i=L.multiplyByPointAsVector(x,a.directionWC,I5e),i=m.normalize(i,i),o=A.z,u instanceof gf){let S=c._header.boundingVolume.box[11];r=T.z-S,s=T.z+S}else if(u instanceof t_){let S=C.radius;r=T.z-S,s=T.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,g=P.clamp((o-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function P5e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{$se(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?U5e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function O5e(e,t){return e._priority-t._priority}yr.prototype.postPassesUpdate=function(e){l(this._root)&&(R5e(this,e),z5e(this,e),this._cache.unloadTiles(this,eae),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};yr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;N5e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&D5e(this,e),e.newFrame&&this._cache.reset()};function R5e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o=1;if(r._contentState!==Ho.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function M5e(e){let t=e._requestedTiles;t.sort(O5e);for(let n=0;n0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`))}function L5e(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=o)}t.length-=n}function N5e(e,t){L5e(e);let n=e._processingQueue,i=e._statistics,o;for(let r=0;r0&&(i+=` +Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,o++),i+=` +Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${Jse(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${Jse(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ci({stencil:0,pass:Ae.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Bt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let h=0;h=0;--b)i[d+x+b]=i[d+b];for(let b=0;b0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Zm),B5e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Qse=[];function U5e(e,t){let n=t,i=Qse;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r-1:!1};yr.prototype.isDestroyed=function(){return!1};yr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=Qse;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i-1;i--)C9(this,e[i],t,n);return ue(this)};cy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};cy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(C9(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],C9(this,r,a,c),s.remove(r.id)};function C9(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function q5e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Os.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var nM=cy;var Y5e=z.WHITE,X5e=z.BLACK,K5e=new H(2,2);function IA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(IA.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});IA.prototype.getType=function(e){return"Checkerboard"};IA.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,Y5e,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,X5e,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,K5e),t};IA.prototype.equals=function(e){return this===e||e instanceof IA&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var DA=IA;var tae={id:void 0};function iM(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function tc(e){this._owner=e,this._entities=new At,this._addedEntities=new At,this._removedEntities=new At,this._changedEntities=new At,this._suspendCount=0,this._collectionChanged=new pe,this._id=Wn(),this._show=!0,this._firing=!1,this._refire=!1}tc.prototype.suspendEvents=function(){this._suspendCount++};tc.prototype.resumeEvents=function(){this._suspendCount--,iM(this)};Object.defineProperties(tc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t-1;c--)s=a[c],iae(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(vr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],nae(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?T9(x):(BU.id=s.id,x=new Ko(BU)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(r=0;r=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),T9(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let g=t.length;for(s=0;s=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?T9(u):(BU.id=x,u=new Ko(BU),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};vr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let h=g[t];if(l(h)){if(d)if(d=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var A9=vr;function E9(){this._removalFunctions=[]}E9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};E9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ir.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ir.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ir.prototype.contains=function(e){return this.indexOf(e)>=0};var S9=new An;Ir.prototype.indexOf=function(e){let t=this._intervals;S9.start=e,S9.stop=e;let n=Do(t,S9,w9);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(o=ee.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new An({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new An({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=ee.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new An({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new An({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new An({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new An({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ir.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Do(t,e,w9);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new An({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new An({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),oM[2]=Xh(u)?29:28;a>oM[c]||c>=13;)a>oM[c]&&(a-=oM[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),oM[2]=Xh(u)?29:28;return nc.millisecond=i,nc.second=o,nc.minute=r,nc.hour=s,nc.day=a,nc.month=c,nc.year=u,ee.fromGregorianDate(nc,n)}var J5e=new ee,Z5e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function rae(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(Z5e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,J5e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var rM=new Yh;Ir.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=[];if(!rae(n[2],rM))r.push(i,o);else{let s=ee.clone(i);for(r.push(s);ee.compare(s,o)<0;)s=v9(s,rM),ee.compare(o,s)<=0&&ee.clone(o,s),r.push(s)}return Ir.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ir.fromIso8601DateArray=function(e,t){return Ir.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ir.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u=0?-a:a}var f6e=new m(-1,0,0),lb=new L,d6e=new L,P9=new Z,m6e=Z.IDENTITY.clone(),h6e=new m,p6e=new re,sae=new m;function a_(e,t,n,i,o,r,s,a){let c=h6e,u=p6e;lb=Mt.eastNorthUpToFixedFrame(e,o,lb),c=L.multiplyByPointAsVector(lb,f6e,c),c=m.normalize(c,c);let f=u6e(c,t,e,o);P9=Z.fromRotationZ(f,P9),sae.z=r,lb=L.multiplyTransformation(lb,L.fromRotationTranslation(P9,sae,d6e),lb);let d=m6e;d[0]=s;for(let p=0;p0){let x=u?2:1;for(let b=0;b=0};var y6e=new m,x6e=new m;sM.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=l6e(e,r),a=i._granularity,c=i._cornerType,u=o?g6e(t,n):aae(t,n),f=o?aae(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],x=o?[]:void 0,b=e6e,C=t6e,T=n6e,A=i6e,S=o6e,v=r6e,I=s6e,O=a6e,R=c6e,N=e[0],F=e[1];A=r.geodeticSurfaceNormal(N,A),b=m.subtract(F,N,b),b=m.normalize(b,b),O=m.cross(A,b,O),O=m.normalize(O,O);let _=s[0],E=s[1];o&&(x=a_(N,O,f,x,r,_+d,1,1)),R=m.clone(N,R),N=F,C=m.negate(b,C);let w,D;for(let V=1;VPe;p--)xe=P.PI_OVER_TWO-p*_e,J[se++]=1-he*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=Pe;p>0;p--)xe=P.PI_OVER_TWO-_e*p,J[se++]=1-ge*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)J[se++]=p*ge,J[se++]=1;for(p=1;p0;p--)J[se++]=(p-1)*ge,J[se++]=1}c.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function R6e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Tae,h=Aae,x=GU,b=WU,C=O6e,T=Eae,A=c;for(u=0;u-t?(o=U6e,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),F9(e,o,i)};nh.prototype.computeHorizonCullingPoint=function(e,t,n){return zae(this._ellipsoid,e,t,n)};var Uae=oe.clone(oe.UNIT_SPHERE);nh.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Vae(this._ellipsoid,n,Uae);return zae(o,e,t,i)};nh.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Hae(this._ellipsoid,e,t,n,i,o)};nh.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Vae(this._ellipsoid,o,Uae);return Hae(s,e,t,n,i,r)};var V6e=[];nh.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,V6e),o=ae.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var z6e=new m;function Vae(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,z6e);e=oe.fromCartesian3(i,n)}return e}function zae(e,t,n,i){l(i)||(i=new m);let o=jae(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/m.magnitudeSquared(r)>o)}var H6e=new m,G6e=new m;function Gae(e,t,n){let i=e.transformPositionToScaledSpace(t,H6e),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,G6e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function Wae(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var N9=new m;function jae(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,N9),m.normalize(N9,N9))}var u_=nh;function Or(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Rt.clone(n)),l(i)&&(i=Rt.clone(i)),l(o)&&(o=Dt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var qae=Or.SHOW_INDEX=0,Kae=Or.POSITION_INDEX=1,W6e=Or.COLOR_INDEX=2,j6e=Or.OUTLINE_COLOR_INDEX=3,q6e=Or.OUTLINE_WIDTH_INDEX=4,Y6e=Or.PIXEL_SIZE_INDEX=5,X6e=Or.SCALE_BY_DISTANCE_INDEX=6,K6e=Or.TRANSLUCENCY_BY_DISTANCE_INDEX=7,J6e=Or.DISTANCE_DISPLAY_CONDITION_INDEX=8,Z6e=Or.DISABLE_DEPTH_DISTANCE_INDEX=9;Or.NUMBER_OF_PROPERTIES=10;function Cf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Or.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Cf(this,qae))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Cf(this,Kae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Rt.equals(t,e)||(this._scaleByDistance=Rt.clone(e,t),Cf(this,X6e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Rt.equals(t,e)||(this._translucencyByDistance=Rt.clone(e,t),Cf(this,K6e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Cf(this,Y6e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Cf(this,W6e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Cf(this,j6e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Cf(this,q6e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Cf(this,J6e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Cf(this,Z6e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Cf(this,qae))}}});Or.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Or.prototype._getActualPosition=function(){return this._actualPosition};Or.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Cf(this,Kae)};var Yae=new re;Or._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(L.multiplyByPoint(n,e,Yae),Zi.computeActualWgs84Position(t,Yae))};var Xae=new re;Or._computeScreenSpacePosition=function(e,t,n,i){let o=L.multiplyByVector(e,re.fromElements(t.x,t.y,t.z,1,Xae),Xae);return Zi.wgs84ToWindowCoordinates(n,o,i)};Or.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new H);let i=n.modelMatrix,o=Or._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Or.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=c,n};Or.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Rt.equals(this._scaleByDistance,e._scaleByDistance)&&Rt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Or.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ms=Or;var hy=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; -/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN -*/ +void main() +{ + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidRenderLongitudeMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) - uniform float u_ellipsoidInverseOuterScaleUv; + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; + +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 + { + discard; + } +#else +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } #endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - uniform float u_ellipsoidInverseInnerScaleUv; #endif -vec2 intersectZPlane(Ray ray) -{ - float o = ray.pos.z; - float d = ray.dir.z; - float t = -o / d; - float s = sign(o); - - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } +`;var dM=`uniform float u_maxTotalPointSize; -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); - - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; - return vec4(-INF_HIT, t, t, +INF_HIT); -} +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; -vec2 intersectHalfSpace(Ray ray, float angle) +void main() { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); -} + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; + /////////////////////////////////////////////////////////////////////////// - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; + vec4 color; + vec4 outlineColor; + vec4 pickColor; - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); -} + // compressedAttribute0.z => pickColor.rgb -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); -} - -vec2 intersectUnitSphere(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - c; + // compressedAttribute0.x => color.rgb - if (det < 0.0) { - return vec2(NO_HIT); - } + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); - det = sqrt(det); - float t1 = -b - det; - float t2 = -b + det; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + // compressedAttribute0.y => outlineColor.rgb - return vec2(tmin, tmax); -} + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); -vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a - float a = dot(d, d); - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - a * c; + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; - if (det < 0.0) { - return vec2(NO_HIT); - } + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + /////////////////////////////////////////////////////////////////////////// - return vec2(tmin, tmax); -} + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; -vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; - float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; - float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; - float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; - float det = b * b - a * c; + /////////////////////////////////////////////////////////////////////////// - if (det < 0.0) { - return vec2(NO_HIT); +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); } +#endif - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - return vec2(tmin, tmax); -} +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } -vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) + { + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } - if (intersect.x == NO_HIT) { - return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); } +#endif - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepth.x; + float farSq = distanceDisplayConditionAndDisableDepth.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif - // One interval - if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); - else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); - // Two intervals - else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); -} + gl_Position = czm_projection * positionEC; + czm_vertexLogDepth(); -vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; + } - if (intersect.x == NO_HIT) { - return vec2(NO_HIT); + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); +#endif + } } +#endif - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; - if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); - else if (zmin < 0.0) return vec2(tmax, +INF_HIT); - else if (zmax < 0.0) return vec2(-INF_HIT, tmin); - else return vec2(tmin, tmax); + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; + + v_pickColor = pickColor; } +`;var $6e=Ms.SHOW_INDEX,U9=Ms.POSITION_INDEX,Jae=Ms.COLOR_INDEX,Q6e=Ms.OUTLINE_COLOR_INDEX,e9e=Ms.OUTLINE_WIDTH_INDEX,t9e=Ms.PIXEL_SIZE_INDEX,Zae=Ms.SCALE_BY_DISTANCE_INDEX,$ae=Ms.TRANSLUCENCY_BY_DISTANCE_INDEX,Qae=Ms.DISTANCE_DISPLAY_CONDITION_INDEX,n9e=Ms.DISABLE_DEPTH_DISTANCE_INDEX,V9=Ms.NUMBER_OF_PROPERTIES,oc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Tf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(V9),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,So.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Tf.prototype,{length:{get:function(){return z9(this),this._pointPrimitives.length}}});function ece(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),r(o,s,a,u)}function o9e(e,t,n,i){tce(e,t,n,i),nce(e,t,n,i),ice(e,t,n,i),oce(e,t,n,i),rce(e,t,n,i)}function k9(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=i9e(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v0){let v=a9e;v.length=0,(r[U9]||r[e9e]||r[t9e])&&v.push(tce),(r[Jae]||r[Q6e])&&v.push(nce),(r[$6e]||r[$ae])&&v.push(ice),r[Zae]&&v.push(oce),(r[Qae]||r[n9e])&&v.push(rce);let I=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;On*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=L.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),s9e(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===So.OPAQUE||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===So.TRANSLUCENT||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new Ge({sources:[dM]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===So.OPAQUE_AND_TRANSLUCENT&&(x=new Ge({defines:["OPAQUE"],sources:[hy]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:oc}),x=new Ge({defines:["TRANSLUCENT"],sources:[hy]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:oc})),this._blendOption===So.OPAQUE&&(x=new Ge({sources:[hy]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:oc})),this._blendOption===So.TRANSLUCENT&&(x=new Ge({sources:[hy]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:oc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,C,T,A,S=e.commandList;if(u.render||f){let v=this._colorCommands,I=this._blendOption===So.OPAQUE,O=this._blendOption===So.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,C=b.length,v.length=C;let R=O?C*2:C;for(A=0;A>4;if(o!==H9)throw new Error(`Got v${o} data when expected v${H9}.`);let r=sce[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new fb(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=sce.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,hM,t),this.coords=new this.ArrayType(this.data,hM+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(hM+s+a+c),this.ids=new this.IndexArrayType(this.data,hM,t),this.coords=new this.ArrayType(this.data,hM+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(H9<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return W9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let C=s[2*b],T=s[2*b+1];C>=t&&C<=i&&T>=n&&T<=o&&u.push(r[b])}continue}let g=p+d>>1,h=s[2*g],x=s[2*g+1];h>=t&&h<=i&&x>=n&&x<=o&&u.push(r[g]),(f===0?t<=h:n<=x)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:o>=x)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)ace(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let g=p+d>>1,h=r[2*g],x=r[2*g+1];ace(h,x,t,n)<=u&&c.push(o[g]),(f===0?t-i<=h:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=x)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function W9(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;cce(e,t,s,i,o,r),W9(e,t,n,i,s-1,1-r),W9(e,t,n,s+1,o,1-r)}function cce(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/u+g)),x=Math.min(o,Math.floor(n+(u-f)*p/u+g));cce(e,t,n,h,x,r)}let s=t[2*n+r],a=i,c=o;for(pM(e,t,i,n),t[2*o+r]>s&&pM(e,t,i,o);as;)c--}t[2*i+r]===s?pM(e,t,i,c):(c++,pM(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function pM(e,t,n,i){G9(e,n,i),G9(t,2*n,2*i),G9(t,2*n+1,2*i+1)}function G9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function ace(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Vd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new pe,this.show=y(e.show,!0)}function lce(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var c9e=new Ke;function uce(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Kg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=ho.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ms.getScreenSpaceBoundingBox(e,t,o)),lce(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&dce(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Kg.getScreenSpaceBoundingBox(s,t,c9e);lce(a,n),o=Ke.union(o,a,o)}return o}function l9e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&dce(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function fce(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function dce(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function j9(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s0){let M=new fb(T.length,64,Uint32Array);for(let B=0;B=f)for(fce(B.position,E,_,e),p.push(B),S=0;S=f){let k=m.multiplyByScalar(G,1/E,G);for(fce(k,E,_,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),S=0;S0?(a=u.pop(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function X9(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Vd.prototype.getLabel=Y9("_labelCollection",Zm,"_unusedLabelIndices","labelIndex");Vd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,X9(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Vd.prototype.getBillboard=Y9("_billboardCollection",nu,"_unusedBillboardIndices","billboardIndex");Vd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,X9(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Vd.prototype.getPoint=Y9("_pointCollection",FA,"_unusedPointIndices","pointIndex");Vd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,X9(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function q9(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,h9e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Vd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var ru=Vd;function K9(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new Rs(this),this._entityCluster=new ru}Object.defineProperties(K9.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Pr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});K9.prototype.update=function(e){return!0};var _M=K9;var mce={};mce.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=o?a*3:0,h=o?(a+i)*3:i*3;for(f=0;f0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ue.createTypedArray(s,c*2),d=0,p;for(p=0;p0)for(p=0;p0){for(c=0;c=t;i--)e[i]=e[a--]}for(i=0;i=0||l(d)&&ee.compare(f,d)>=0));){for(oW[p++]=f,r=r+1,s=0;s0&&(rW.length=g,bce(n,u,rW),oW.length=p,bce(t,c,oW))}else{for(s=0;so)return;if(this._backwardExtrapolationType===au.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===au.NONE||o!==0&&ee.secondsDifference(e,S)>o)return;if(this._forwardExtrapolationType===au.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,x=i-1;if(x-h+1>=g+1){let S=a-(g/2|0)-1;Sx&&(v=x,S=v-g,S0){n=new Array(t);for(let i=0;ic&&e!==Object}let h=typeof e.unpack=="function"&&e!==Af;if(!g&&!p){d?t[n]=new ei(h?e.unpack(u,0):u):t[n]=wce(e,s,i);return}let x=t[n],b,C=i.epoch;if(l(C)&&(b=ee.fromIso8601(C)),g&&!p){x instanceof lu||(t[n]=x=new lu(e)),x.addSamplesPackedArray(u,b),ZU(i,x);return}let T;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(u,0):u:a.data=wce(e,s,i),l(x)||(t[n]=x=d?new g_:new ic),d&&x instanceof g_?x.intervals.addInterval(a):x instanceof ic?(d&&(a.data=new ei(a.data)),x.intervals.addInterval(a)):(t[n]=x=Mce(x),d&&(a.data=new ei(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new ic),x instanceof ic||(t[n]=x=Mce(x));let A=x.intervals;T=A.findInterval(a),(!l(T)||!(T.data instanceof lu))&&(T=a.clone(),T.data=new lu(e),A.addInterval(T)),T.data.addSamplesPackedArray(u,b),ZU(i,T.data)}function jce(e,t){if(e instanceof lu){e.removeSamples(t);return}else if(e instanceof g_){e.intervals.removeInterval(t);return}else if(e instanceof ic){let n=e.intervals;for(let i=0;ic),!h&&!p){d?e[t]=new wc(m.unpack(u),g):e[t]=SM(r,n.reference);return}let x=e[t],b,C=n.epoch;if(l(C)&&(b=ee.fromIso8601(C)),h&&!p){(!(x instanceof oa)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new oa(g,a)),x.addSamplesPackedArray(u,b),ZU(n,x);return}let T;if(!h&&p){s=s.clone(),d?s.data=m.unpack(u):s.data=SM(r,n.reference),l(x)||(d?x=new __(g):x=new na(g),e[t]=x),d&&x instanceof __&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof na?(d&&(s.data=new wc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Lce(x),d&&(s.data=new wc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof na||(e[t]=x=Lce(x)):e[t]=x=new na(g);let A=x.intervals;T=A.findInterval(s),(!l(T)||!(T.data instanceof oa)||l(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new oa(g,a),A.addInterval(T)),T.data.addSamplesPackedArray(u,b),ZU(n,T.data)}function qce(e,t){if(e instanceof oa){e.removeSamples(t);return}else if(e instanceof __){e.intervals.removeInterval(t);return}else if(e instanceof na){let n=e.intervals;for(let i=0;i. version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function wWe(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=ar(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new ix),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ye(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Af,s,"rotation",o.rotation,r,i,n),ye(Af,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),uu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(bn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function IWe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=ar(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new ox),ye(Boolean,s,"show",o.show,r,i,n),ye(m,s,"radii",o.radii,r,i,n),ye(m,s,"innerRadii",o.innerRadii,r,i,n),ye(Number,s,"minimumClock",o.minimumClock,r,i,n),ye(Number,s,"maximumClock",o.maximumClock,r,i,n),ye(Number,s,"minimumCone",o.minimumCone,r,i,n),ye(Number,s,"maximumCone",o.maximumCone,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),uu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ye(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ye(Number,s,"subdivisions",o.subdivisions,r,i,n),ye(bn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function DWe(e,t,n,i){let o=t.label;if(!l(o))return;let r=ar(o.interval),s=e.label;l(s)||(e.label=s=new ud),ye(Boolean,s,"show",o.show,r,i,n),ye(String,s,"text",o.text,r,i,n),ye(String,s,"font",o.font,r,i,n),ye(zo,s,"style",o.style,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Boolean,s,"showBackground",o.showBackground,r,i,n),ye(z,s,"backgroundColor",o.backgroundColor,r,i,n),ye(H,s,"backgroundPadding",o.backgroundPadding,r,i,n),ye(H,s,"pixelOffset",o.pixelOffset,r,i,n),ye(m,s,"eyeOffset",o.eyeOffset,r,i,n),ye(pi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"fillColor",o.fillColor,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Rt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Rt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(Rt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function PWe(e,t,n,i){let o=t.model;if(!l(o))return;let r=ar(o.interval),s=e.model;l(s)||(e.model=s=new fp),ye(Boolean,s,"show",o.show,r,i,n),ye(wM.default,s,"uri",o.gltf,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ye(Number,s,"maximumScale",o.maximumScale,r,i,n),ye(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ye(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ye(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ye(bn,s,"shadows",o.shadows,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"silhouetteColor",o.silhouetteColor,r,i,n),ye(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(Za,s,"colorBlendMode",o.colorBlendMode,r,i,n),ye(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a-1;c--)n[c](s,e,t,i)}aW=void 0}function VWe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(He.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=ee.secondsDifference(s,r),c=Math.round(a/120);return t=new Hd,t.startTime=ee.clone(r),t.stopTime=ee.clone(s),t.clockRange=Rr.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(r),t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Hd,t.startTime=He.MINIMUM_VALUE.clone(),t.stopTime=He.MAXIMUM_VALUE.clone(),t.currentTime=He.MINIMUM_VALUE.clone(),t.clockRange=Rr.LOOP_STOP,t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ar(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Rr[n.range],Rr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(po[n.step],po.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Xce(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new wt(s)),e._credit=s,typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f1;--_){if(C=P.PI_OVER_TWO-(_-1)*b,v=eE(-C,r,h,g,c,f,u,d,p,v),I=eE(C+Math.PI,r,h,g,c,f,u,d,p,I),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*(_-1)+2,E=1;E1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aP.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function rh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Me.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=oe.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Me.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}rh.packedLength=m.packedLength+oe.packedLength+Me.packedLength+9;rh.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var mle=new m,hle=new oe,ple=new Me,oh={center:mle,ellipsoid:hle,vertexFormat:ple,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};rh.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,mle);t+=m.packedLength;let o=oe.unpack(e,t,hle);t+=oe.packedLength;let r=Me.unpack(e,t,ple);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(oh.height=f,oh.extrudedHeight=p,oh.granularity=d,oh.stRotation=u,oh.rotation=c,oh.semiMajorAxis=s,oh.semiMinorAxis=a,oh.shadowVolume=g,oh.offsetAttribute=h===-1?void 0:h,new rh(oh))};rh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,oe.WGS84),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return dle(n,o,r,a,s,i,t)};rh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=JWe(o);else if(r=YWe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ft({attributes:r.attributes,indices:r.indices,primitiveType:Fe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};rh.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new rh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};function ZWe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=wl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c0){let h=Math.min(u,c);g=Math.round(c/h);let x=Math.min(g*u,c);for(p=0;p0&&(S=!0,C+=c-1),s0&&f!==x-1&&d!==0&&d!==b-1&&(F[j]=!0),j++;p=0;let $,W;for(f=1;f=ot&&fCy.eastOverIDL-Cy.westOverIDL&&(o.west=Cy.westOverIDL,o.east=Cy.eastOverIDL,o.east>P.PI&&(o.east=o.east-P.TWO_PI),o.west>P.PI&&(o.west=o.west-P.TWO_PI)),o}var eje=new me;function Mle(e,t,n,i){let o=e.surfaceDistance,r=Math.ceil(o*t),s=r>0?o/(r-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c=0?f:f+P.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var Lle=[];function tje(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let T=Yn.createGeometryFromPositions(e,t,n,i,r,c,u),A=T.attributes.position.values,S=T.indices,v,I;if(s&&a){let O=A.concat(A);v=O.length/3,I=Ue.createTypedArray(v,S.length*2),I.set(S);let R=S.length,N=v/2;for(d=0;d1||v>1))for(let E=0;E0;f-=u)xe=f*3,Y=fE(Y,J,xe,p,b),J+=6,o.st&&(W=dE(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);if(w){let ot=_e;for(xe=ot*3,f=0;f<2;f++)Y=fE(Y,J,xe,p,b),J+=6,o.st&&(W=dE(W,he,ot*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1)}else for(f=u-1;f>=0;f--)xe=f*3,Y=fE(Y,J,xe,p,b),J+=6,o.st&&(W=dE(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);let Pe=Tje(Y,o,a);o.st&&(Pe.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:W})),n&&(Pe.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:j})),R&&(Pe.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:$}));let ve=Ue.createTypedArray(k,V*6),we,ze,Re,dt;g=Y.length/3;let Tt=0;for(f=0;f0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=Xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}hE.prototype.remove=function(e){uue(this._solidItems,e)||uue(this._translucentItems,e)};function fue(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=Xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};pE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Sc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};_E.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xo.getValue(e,this.materialProperty,this.material),n=new Sc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};yE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r0)for(d=!0,t=0;t0)for(d=!0,t=0;t0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new nL(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Df._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var iL=Df;var yqe=1,xqe="30px sans-serif",bqe=zo.FILL,Cqe=z.WHITE,Tqe=z.BLACK,Aqe=1,Eqe=!1,Sqe=new z(.165,.165,.165,.8),vqe=new H(7,5),wqe=H.ZERO,Iqe=m.ZERO,Dqe=qe.NONE,Pqe=pi.CENTER,Oqe=Mn.CENTER,Rqe=new m,Mqe=new z,Lqe=new z,Nqe=new z,Fqe=new H,Bqe=new m,kqe=new H,Uqe=new Rt,Vqe=new Rt,zqe=new Rt,Hqe=new Dt;function Sue(e){this.entity=e,this.label=void 0,this.index=void 0}function Ay(e,t){t.collectionChanged.addEventListener(Ay.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}Ay.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Sue(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Sue(r)):(IW(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],IW(s.get(r.id),r,a),s.remove(r.id)};function IW(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var oL=Ay;async function Gqe(e,t,n){return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,qqe(e,t,n)}function Wqe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let o=i.then(Yqe(n)).catch(Xqe(n));return e.shift(),t.push(o),!0}function jqe(e){return new Promise(function(t){setTimeout(t,e)})}function DW(e,t){return e.length?Wqe(e,t)?DW(e,t):jqe(100).then(()=>DW(e,t)):Promise.resolve()}function qqe(e,t,n){let i=e.tilingScheme,o,r=[],s={};for(o=0;o0&&await wue(e,s),t}var T_=wue;var Kqe=1,Jqe=0,Zqe=!0,$qe=!0,Qqe=bn.ENABLED,eYe=qe.NONE,tYe=z.RED,nYe=0,iYe=z.WHITE,oYe=Za.HIGHLIGHT,rYe=.5,sYe=new H(1,1),aYe=new L,cYe=new L,Iue=new z,Due=new Array(4),lYe=new m;function lh(e,t){t.collectionChanged.addEventListener(lh.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new At,this._onCollectionChanged(t,t.values,[],[])}async function uYe(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await Dd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}lh.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o-1;i--)OW(this,e[i],t,n);return ue(this)};lh._sampleTerrainMostDetailed=T_;var TE=new m,Pue=new me;lh.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let r=this._scene.globe,s=l(r)?r.terrainProvider:void 0,a=i.heightReference!==qe.NONE;if(l(r)&&a){let c=r.ellipsoid;if(l(s)&&(l(s._ready)?!s._ready:l(s.ready)&&!s.ready))return ut.PENDING;let u=i.modelMatrix;TE.x=u[12],TE.y=u[13],TE.z=u[14];let f=c.cartesianToCartographic(TE);if(!l(s.availability)){i.heightReference===qe.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,ut.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,ut.FAILED):l(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,ut.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(me.clone(f,Pue),this._modelHash[e.id].awaitingSampleTerrain=!0,lh._sampleTerrainMostDetailed(s,[Pue]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let x=h[0];i.heightReference===qe.RELATIVE_TO_GROUND&&(x.height+=f.height),c.cartographicToCartesian(x,TE),ae.clone(i.boundingSphere,d),d.center=TE,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),ut.PENDING)}return ae.clone(i.boundingSphere,t),ut.DONE};lh.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(fYe(r,a),s.set(r.id,r)):(OW(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],OW(this,r,a,c),s.remove(r.id)};function OW(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function fYe(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var sL=lh;function Ey(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Ey.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:oo.FIXED}}});Ey.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};Ey.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Ey.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?oe.WGS84.scaleToGeodeticSurface(n,n):void 0};Ey.prototype.equals=function(e){return this===e||e instanceof Ey&&this._value===e._value};Ey.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uh=Ey;var dYe=60,mYe=1,Mue=new An,RW=new An,MW=new An;function Oue(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function hYe(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||ee.lessThanOrEquals(o,t)||ee.greaterThanOrEquals(o,n),p=0,g=i.length,h=i[p],x=n,b=!1,C,T,A;for(;p0&&!b){let S=i[p+1],v=ee.secondsDifference(S,h);b=v>s,b&&(C=Math.ceil(v/s),T=0,A=v/Math.max(C,2),C=Math.max(C-1,1))}if(b&&T0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,dYe);c.show=!0,c.positions=Nue(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=Xo.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,mYe),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};aL.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};aL.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Sy(e,t){t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Oue(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Oue(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Sy._subSample=Nue;var cL=Sy;var Fue=z.WHITE,Bue=z.BLACK,kue=0,Uue=1,Vue=0,zue=new z,xYe=new m,Hue=new z,Gue=new Rt,Wue=new Rt,jue=new Dt;function que(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function vy(e,t){t.collectionChanged.addEventListener(vy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}vy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i0?(u.scale=1,g=g||C!==r.outlineWidth||T!==r.pixelSize||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)):(u.scale=T/50,T=50,g=g||C!==r.outlineWidth||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)),g){r.color=z.clone(x,r.color),r.outlineColor=z.clone(b,r.outlineColor),r.pixelSize=T,r.outlineWidth=C;let A=x.alpha,S=x.toCssColorString(),v=b.toCssColorString(),I=JSON.stringify([S,T,v,C]);u.setImage(I,Gx(A,S,v,C,T))}h&&u._updateClamping()}}return!0};vy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ut.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};vy.prototype.isDestroyed=function(){return!1};vy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new que(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new que(r)):(lL(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],lL(s.get(r.id),r,a),s.remove(r.id)};function lL(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var uL=vy;var Zue=[];function bYe(e,t,n,i,o){let r=Zue;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s0?new Array(o):void 0;for(i=0;i0){let M=0,B=d[0];i=i.filter(function(V,U){let G=!1;return o?G=U===B||U===0&&B===1:G=U+1===B,G?(M++,B=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===$t.GEODESIC||r===$t.RHUMB){let M,B;r===$t.GEODESIC?(M=P.chordLength(s,a.maximumRadius),B=Di.numberOfPoints):(M=s,B=Di.numberOfPointsRhumbLine);let V=Di.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c0)return ae.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};dL.prototype.isDestroyed=function(){return!1};dL.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=_V[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete _V[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var mL=Zd;var DYe=new z,PYe=new Dt,OYe=new Dt;function $d(e,t,n,i,o){let r;n instanceof Ut?r=kr:r=Ks,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new At,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.material=void 0,this.updatersWithAttributes=new At,this.attributes=new At,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener($d.prototype.onMaterialChanged,this),this.subscriptions=new At,this.showsUpdated=new At,this.zIndex=i,this._asynchronous=o}$d.prototype.onMaterialChanged=function(){this.invalidated=!0};$d.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};$d.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};$d.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};$d.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new ld({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ks&&(this.material=Xo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ks&&(this.material=Xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};EE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(nfe(this,f),ife(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),nfe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new mL(c,this._scene),this._updaters.set(u,f),ife(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(fh._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var pL=fh;function Pf(e){Sc.initializeTerrainHeights(),ld.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new wr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Pf.defaultVisualizersCallback);let i=!1,o=new vl,r=new vl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;ukYe*s.maximumRadius?(d=afe,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,NW),p=m.cross(g,d,gV),m.magnitude(p)>P.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,NW),m.normalize(g,g),u=!0)):m.equalsEpsilon(c,T,P.EPSILON7)||(g=afe,m.normalize(I,g),m.normalize(O,O),p=m.cross(g,O,NW),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,P.EPSILON7)||(d=m.cross(p,g,gV),Z.multiplyByVector(v,d,d),Z.multiplyByVector(v,p,p),Z.multiplyByVector(v,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,x,b;i&&(h=m.clone(t.position,FW),x=m.clone(t.direction,cfe),b=m.clone(t.up,lfe));let C=BYe;u?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(x,t.direction),m.clone(b,t.up),m.cross(x,b,t.right))}if(n){let u=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function gL(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,oe.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(gL,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});gL.defaultOffset3D=new m(-14e3,3500,3500);var yV=new hu,VYe=new m;gL.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.position;if(!l(s))return;let a=r!==this._lastEntity,c=o!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=r.viewFrom,g=l(p);if(!g&&l(t)){yV.pitch=-P.PI_OVER_FOUR,yV.range=0;let h=s.getValue(e,VYe);if(l(h)){let x=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);yV.pitch*=x}u.viewBoundingSphere(t,yV),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&m.clone(gL._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(u.position,this._offset3D);this._lastEntity=r,this._mode=o,UYe(this,u,f,d,s,e,i)};var yL=gL;function SV(e){return vV(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function vV(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?vV(n):n),[])}var ufe=[0,1,2,3].concat(...SV([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function cr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,h,x,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],g=r[r[d*2+1]*2+1]+1,g>u&&(g=u,b++),r[d*2+1]=g,!(d>e.max_code)&&(o.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),x=r[d*2],o.opt_len+=x*(g+h),s&&(o.static_len+=x*(s[d*2+1]+h)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(d=o.bl_count[g];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),d--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}cr._length_code=[0,1,2,3,4,5,6,7].concat(...SV([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));cr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];cr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];cr.d_code=function(e){return e<256?ufe[e]:ufe[256+(e>>>7)]};cr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];cr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];cr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];cr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wa(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var zYe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],HYe=SV([[144,8],[112,9],[24,7],[8,8]]);wa.static_ltree=vV(zYe.map((e,t)=>[e,HYe[t]]));var GYe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],WYe=SV([[30,5]]);wa.static_dtree=vV(GYe.map((e,t)=>[e,WYe[t]]));wa.static_l_desc=new wa(wa.static_ltree,cr.extra_lbits,256+1,286,15);wa.static_d_desc=new wa(wa.static_dtree,cr.extra_dbits,0,30,15);wa.static_bl_desc=new wa(null,cr.extra_blbits,0,19,7);var jYe=9,qYe=8;function dh(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var dfe=0,AV=1,Mb=2,Qd=[new dh(0,0,0,0,dfe),new dh(4,4,8,4,AV),new dh(4,5,16,8,AV),new dh(4,6,32,32,AV),new dh(4,4,16,16,Mb),new dh(8,16,32,32,Mb),new dh(8,16,128,128,Mb),new dh(8,32,128,256,Mb),new dh(32,128,258,1024,Mb),new dh(32,258,258,4096,Mb)],xV=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Of=0,bV=1,xL=2,CV=3,YYe=32,BW=42,TV=113,bL=666,kW=8,XYe=0,UW=1,KYe=2,xr=3,EV=258,pu=EV+xr+1;function ffe(e,t,n,i){let o=e[t*2],r=e[n*2];return o=3&&V[cr.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Pe(Ne){e.pending_buf[e.pending++]=Ne}function ve(Ne){Pe(Ne&255),Pe(Ne>>>8&255)}function we(Ne){Pe(Ne>>8&255),Pe(Ne&255&255)}function ze(Ne,rt){let $e,We=rt;J>16-We?($e=Ne,K|=$e<>>16-J,J+=We-16):(K|=Ne<=8&&(Pe(K&255),K>>>=8,J-=8)}function ln(){ze(UW<<1,3),Re(256,wa.static_ltree),ot(),1+W+10-J<9&&(ze(UW<<1,3),Re(256,wa.static_ltree),ot()),W=7}function Dn(Ne,rt){let $e,We,mt;if(e.dist_buf[j]=Ne,e.lc_buf[j]=rt&255,j++,Ne===0?M[rt*2]++:($++,Ne--,M[(cr._length_code[rt]+256+1)*2]++,B[cr.d_code(Ne)*2]++),!(j&8191)&&_>2){for($e=j*8,We=v-C,mt=0;mt<30;mt++)$e+=B[mt*2]*(5+cr.extra_dbits[mt]);if($e>>>=3,$8?ve(K):J>0&&Pe(K&255),K=0,J=0}function be(Ne,rt,$e){kt(),W=8,$e&&(ve(rt),ve(~rt)),e.pending_buf.set(c.subarray(Ne,Ne+rt),e.pending),e.pending+=rt}function Ee(Ne,rt,$e){ze((XYe<<1)+($e?1:0),3),be(Ne,rt,!0)}function at(Ne,rt,$e){let We,mt,Vt=0;_>0?(U.build_tree(e),G.build_tree(e),Vt=xe(),We=e.opt_len+3+7>>>3,mt=e.static_len+3+7>>>3,mt<=We&&(We=mt)):We=mt=rt+5,rt+4<=We&&Ne!=-1?Ee(Ne,rt,$e):mt==We?(ze((UW<<1)+($e?1:0),3),Ht(wa.static_ltree,wa.static_dtree)):(ze((KYe<<1)+($e?1:0),3),Tt(U.max_code+1,G.max_code+1,Vt+1),Ht(M,B)),ge(),$e&&kt()}function Jt(Ne){at(C>=0?C:-1,v-C,Ne),C=v,t.flush_pending()}function di(){let Ne,rt,$e,We;do{if(We=u-O-v,We===0&&v===0&&O===0)We=r;else if(We==-1)We--;else if(v>=r+r-pu){c.set(c.subarray(r,r+r),0),I-=r,v-=r,C-=r,Ne=g,$e=Ne;do rt=d[--$e]&65535,d[$e]=rt>=r?rt-r:0;while(--Ne!==0);Ne=r,$e=Ne;do rt=f[--$e]&65535,f[$e]=rt>=r?rt-r:0;while(--Ne!==0);We+=r}if(t.avail_in===0)return;Ne=t.read_buf(c,v+O,We),O+=Ne,O>=xr&&(p=c[v]&255,p=(p<i-5&&(rt=i-5);;){if(O<=1){if(di(),O===0&&Ne==0)return Of;if(O===0)break}if(v+=O,O=0,$e=C+rt,(v===0||v>=$e)&&(O=v-$e,v=$e,Jt(!1),t.avail_out===0)||v-C>=r-pu&&(Jt(!1),t.avail_out===0))return Of}return Jt(Ne==4),t.avail_out===0?Ne==4?xL:Of:Ne==4?CV:bV}function jr(Ne){let rt=N,$e=v,We,mt,Vt=R,Tn=v>r-pu?v-(r-pu):0,Qn=D,Ao=a,ns=v+EV,is=c[$e+Vt-1],ur=c[$e+Vt];R>=w&&(rt>>=2),Qn>O&&(Qn=O);do if(We=Ne,!(c[We+Vt]!=ur||c[We+Vt-1]!=is||c[We]!=c[$e]||c[++We]!=c[$e+1])){$e+=2,We++;do;while(c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&c[++$e]==c[++We]&&$eVt){if(I=Ne,Vt=mt,mt>=Qn)break;is=c[$e+Vt-1],ur=c[$e+Vt]}}while((Ne=f[Ne&Ao]&65535)>Tn&&--rt!==0);return Vt<=O?Vt:O}function qr(Ne){let rt=0,$e;for(;;){if(O=xr&&(p=(p<=xr)if($e=Dn(v-I,T-xr),O-=T,T<=F&&O>=xr){T--;do v++,p=(p<=xr&&(p=(p<4096)&&(T=xr-1)),R>=xr&&T<=R){We=v+O-xr,$e=Dn(v-1-A,R-xr),O-=R-1,R-=2;do++v<=We&&(p=(p<jYe||We!=kW||$e<9||$e>15||rt<0||rt>9||Vt<0||Vt>2?-2:(Ne.dstate=e,s=$e,r=1<9||$e<0||$e>2?-2:(Qd[_].func!=Qd[rt].func&&Ne.total_in!==0&&(We=Ne.deflate(1)),_!=rt&&(_=rt,F=Qd[_].max_lazy,w=Qd[_].good_length,D=Qd[_].nice_length,N=Qd[_].max_chain),E=$e,We)},e.deflateSetDictionary=function(Ne,rt,$e){let We=$e,mt,Vt=0;if(!rt||n!=BW)return-2;if(Wer-pu&&(We=r-pu,Vt=$e-We),c.set(rt.subarray(Vt,Vt+We),0),v=We,C=We,p=c[0]&255,p=(p<4||rt<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==bL&&rt!=4)return Ne.msg=xV[2- -2],-2;if(Ne.avail_out===0)return Ne.msg=xV[2- -5],-5;if(t=Ne,Vt=o,o=rt,n==BW&&(We=kW+(s-8<<4)<<8,mt=(_-1&255)>>1,mt>3&&(mt=3),We|=mt<<6,v!==0&&(We|=YYe),We+=31-We%31,n=TV,we(We)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&rt<=Vt&&rt!=4)return t.msg=xV[2- -5],-5;if(n==bL&&t.avail_in!==0)return Ne.msg=xV[2- -5],-5;if(t.avail_in!==0||O!==0||rt!=0&&n!=bL){switch(Tn=-1,Qd[_].func){case dfe:Tn=Ze(rt);break;case AV:Tn=qr(rt);break;case Mb:Tn=ha(rt);break;default:}if((Tn==xL||Tn==CV)&&(n=bL),Tn==Of||Tn==xL)return t.avail_out===0&&(o=-1),0;if(Tn==bV){if(rt==1)ln();else if(Ee(0,0,!1),rt==3)for($e=0;$en&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function ZYe(e){let t=this,n=new mfe,i=$Ye(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(r)):h.push(r.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(x){f.set(x,p),p+=x.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function $Ye(e){return e+5*(Math.floor(e/16383)+1)}var hfe=ZYe;var _u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Lfe=1440,QYe=0,eXe=4,tXe=9,nXe=5,iXe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],oXe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],rXe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],sXe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],aXe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],cXe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wy=15;function GW(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,g,h,x,b,C,T,A){let S,v,I,O,R,N,F,_,E,w,D,M,B,V,U;w=0,R=d;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==d)return x[0]=-1,b[0]=0,0;for(_=b[0],N=1;N<=wy&&i[N]===0;N++);for(F=N,_R&&(_=R),b[0]=_,V=1<M+_;){if(O++,M+=_,U=I-M,U=U>_?_:U,(v=1<<(N=F-M))>S+1&&(v-=S+1,B=F,NLfe)return-3;r[O]=D=T[0],T[0]+=U,O!==0?(s[O]=R,o[0]=N,o[1]=_,N=R>>>M-_,o[2]=D-r[O-1]-N,C.set(o,(r[O-1]+N)*3)):x[0]=D}for(o[1]=F-M,w>=d?o[0]=128+64:A[w]>>M;N>>=1)R^=N;for(R^=N,E=(1<257?(T==-3?C.msg="oversubscribed distance tree":T==-5?(C.msg="incomplete distance tree",T=-3):T!=-4&&(C.msg="empty distance tree with lengths",T=-3),T):0)}}GW.inflate_trees_fixed=function(e,t,n,i){return e[0]=tXe,t[0]=nXe,n[0]=iXe,i[0]=oXe,0};var wV=0,pfe=1,_fe=2,gfe=3,yfe=4,xfe=5,bfe=6,VW=7,Cfe=8,IV=9;function lXe(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,h=0;function x(b,C,T,A,S,v,I,O){let R,N,F,_,E,w,D,M,B,V,U,G,k,Y,j,$;D=O.next_in_index,M=O.avail_in,E=I.bitb,w=I.bitk,B=I.write,V=B>=N[$+1],w-=N[$+1],I.win[B++]=N[$+2],V--;continue}do{if(E>>=N[$+1],w-=N[$+1],_&16){for(_&=15,k=N[$+2]+(E&_u[_]),E>>=_,w-=_;w<15;)M--,E|=(O.read_byte(D++)&255)<>=N[$+1],w-=N[$+1],_&16){for(_&=15;w<_;)M--,E|=(O.read_byte(D++)&255)<>=_,w-=_,V-=k,B>=Y)j=B-Y,B-j>0&&2>B-j?(I.win[B++]=I.win[j++],I.win[B++]=I.win[j++],k-=2):(I.win.set(I.win.subarray(j,j+2),B),B+=2,j+=2,k-=2);else{j=B-Y;do j+=I.end;while(j<0);if(_=I.end-j,k>_){if(k-=_,B-j>0&&_>B-j)do I.win[B++]=I.win[j++];while(--_!==0);else I.win.set(I.win.subarray(j,j+_),B),B+=_,j+=_,_=0;j=0}}if(B-j>0&&k>B-j)do I.win[B++]=I.win[j++];while(--k!==0);else I.win.set(I.win.subarray(j,j+k),B),B+=k,j+=k,k=0;break}else if(!(_&64))R+=N[$+2],R+=E&_u[_],$=(F+R)*3,_=N[$];else return O.msg="invalid distance code",k=O.avail_in-M,k=w>>3>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,-3;while(!0);break}if(_&64)return _&32?(k=O.avail_in-M,k=w>>3>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-M,k=w>>3>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,-3);if(R+=N[$+2],R+=E&_u[_],$=(F+R)*3,(_=N[$])===0){E>>=N[$+1],w-=N[$+1],I.win[B++]=N[$+2],V--;break}}while(!0)}while(V>=258&&M>=10);return k=O.avail_in-M,k=w>>3>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,0}e.init=function(b,C,T,A,S,v){t=wV,u=b,f=C,d=T,p=A,g=S,h=v,i=null},e.proc=function(b,C,T){let A,S,v,I=0,O=0,R=0,N,F,_,E;for(R=C.next_in_index,N=C.avail_in,I=b.bitb,O=b.bitk,F=b.write,_=F=258&&N>=10&&(b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,T=x(u,f,d,p,g,h,b,C),R=C.next_in_index,N=C.avail_in,I=b.bitb,O=b.bitk,F=b.write,_=F>>=i[S+1],O-=i[S+1],v=i[S],v===0){s=i[S+2],t=bfe;break}if(v&16){a=v&15,n=i[S+2],t=_fe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=VW;break}return t=IV,C.msg="invalid literal/length code",T=-3,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);case _fe:for(A=a;O>=A,O-=A,r=f,i=g,o=h,t=gfe;case gfe:for(A=r;O>=i[S+1],O-=i[S+1],v=i[S],v&16){a=v&15,c=i[S+2],t=yfe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=IV,C.msg="invalid distance code",T=-3,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);case yfe:for(A=a;O>=A,O-=A,t=xfe;case xfe:for(E=F-c;E<0;)E+=b.end;for(;n!==0;){if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F7&&(O-=8,N++,R--),b.write=F,T=b.inflate_flush(C,T),F=b.write,_=Fx.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(A,A+C),T),T+=C,A+=C,A==n.end&&(A=0,n.write==n.end&&(n.write=0),C=n.write-A,C>x.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(A,A+C),T),T+=C,A+=C),x.next_out_index=T,n.read=A,b},n.proc=function(x,b){let C,T,A,S,v,I,O,R;for(S=x.next_in_index,v=x.avail_in,T=n.bitb,A=n.bitk,I=n.write,O=I>>1){case 0:T>>>=3,A-=3,C=A&7,T>>>=C,A-=C,i=zW;break;case 1:N=[],F=[],_=[[]],E=[[]],GW.inflate_trees_fixed(N,F,_,E),f.init(N[0],F[0],_[0],0,E[0],0),T>>>=3,A-=3,i=DV;break;case 2:T>>>=3,A-=3,i=Efe;break;case 3:return T>>>=3,A-=3,i=Lb,x.msg="invalid block type",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b)}break;case zW:for(;A<32;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<>>16&65535)!=(T&65535))return i=Lb,x.msg="invalid stored block lengths",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);o=T&65535,T=A=0,i=o!==0?Afe:d!==0?PV:vE;break;case Afe:if(v===0||O===0&&(I==n.end&&n.read!==0&&(I=0,O=Iv&&(C=v),C>O&&(C=O),n.win.set(x.read_buf(S,C),I),S+=C,v-=C,I+=C,O-=C,(o-=C)!==0)break;i=d!==0?PV:vE;break;case Efe:for(;A<14;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<29||(C>>5&31)>29)return i=Lb,x.msg="too many length or distance symbols",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);if(C=258+(C&31)+(C>>5&31),!a||a.length>>=14,A-=14,s=0,i=Sfe;case Sfe:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<>>=3,A-=3}for(;s<19;)a[Tfe[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,x),C!=0)return b=C,b==-3&&(a=null,i=Lb),n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);s=0,i=vfe;case vfe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let V,U;for(C=c[0];A>>=C,A-=C,a[s++]=U;else{for(R=U==18?7:U-14,V=U==18?11:3;A>>=C,A-=C,V+=T&_u[R],T>>>=R,A-=R,R=s,C=r,R+V>258+(C&31)+(C>>5&31)||U==16&&R<1)return a=null,i=Lb,x.msg="invalid bit length repeat",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);U=U==16?a[R-1]:0;do a[R++]=U;while(--V!==0);s=R}}if(u[0]=-1,w=[],D=[],M=[],B=[],w[0]=9,D[0]=6,C=r,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,w,D,M,B,p,x),C!=0)return C==-3&&(a=null,i=Lb),b=C,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);f.init(w[0],D[0],p,M[0],p,B[0]),i=DV;case DV:if(n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),S=x.next_in_index,v=x.avail_in,T=n.bitb,A=n.bitk,I=n.write,O=I15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new uXe(n,1<>4)+8>s.wbits){s.mode=Iy,n.msg="invalid win size",s.marker=5;break}s.mode=Ife;case Ife:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Iy,n.msg="incorrect header check",s.marker=5;break}if(!(r&fXe)){s.mode=CL;break}s.mode=Dfe;case Dfe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Pfe;case Pfe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Ofe;case Ofe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Rfe;case Rfe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=HW,2);case HW:return s.mode=Iy,n.msg="need dictionary",s.marker=0,-2;case CL:if(o=s.blocks.proc(n,o),o==-3){s.mode=Iy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Mfe;case Mfe:return n.avail_in=0,1;case Iy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=HW)return-2;let a=n.istate;return s>=1<0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(h),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var Ffe=_Xe;var gXe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},Il=Object.assign({},gXe);function OV(){return Il}function wE(e){if(e.baseURL!==void 0&&(Il.baseURL=e.baseURL),e.chunkSize!==void 0&&(Il.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(Il.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(Il.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(Il.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(Il.Deflate=e.Deflate),e.Inflate!==void 0&&(Il.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");Il.workerScripts||(Il.workerScripts={}),Il.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");Il.workerScripts||(Il.workerScripts={}),Il.workerScripts.inflate=e.workerScripts.inflate}}}var Bfe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Bfe[e]=t}var WW=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i>>8^Bfe[(n^t[i])&255];this.crc=n}get(){return~this.crc}},Dy=WW;var TL=yXe;function yXe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=Gc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Gc.getPartial(o);return i.push(Gc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},AL={bytes:{fromBits(e){let n=Gc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=Gc.concat(t,[Gc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var qW={};qW.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=o[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],x=4,b,C,T;for(let A=0;A>>24]^a[p>>16&255]^c[g>>8&255]^u[h&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^u[d&255]^n[x+1],T=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=b,p=C,g=T;for(let A=0;A<4;A++)o[t?3&-A:A]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[x++],b=d,d=p,p=g,g=h,h=b;return o}};var kfe={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=Gc.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,g=Gc;for(t=AL.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;ao&&(e=n.hash(e));for(let r=0;re.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function gu(e,t,n){return e.subarray(t,n)}var OE=12,NV=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Zfe(i,t)}append(t){let n=this;if(n.password){let i=Xfe(n,t.subarray(0,OE));if(n.password=null,i[OE-1]!=n.passwordVerification)throw new Error(PE);t=t.subarray(OE)}return Xfe(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},FV=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Zfe(i,t)}append(t){let n=this,i,o;if(n.password){n.password=null;let r=crypto.getRandomValues(new Uint8Array(OE));r[OE-1]=n.passwordVerification,i=new Uint8Array(t.length+r.length),i.set(Kfe(n,r),0),o=OE}else i=new Uint8Array(t.length),o=0;return i.set(Kfe(n,t),o),i}flush(){return{data:new Uint8Array(0)}}};function Xfe(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),e.keys[2]=~e.crcKey2.get()}function $fe(e){let t=e.keys[2]|2;return Qfe(Math.imul(t,t^1)>>>8)}function Qfe(e){return e&255}function Jfe(e){return e&4294967295}var kV="deflate",UV="inflate",BV="Invalid signature",JW=class{constructor(t,{signature:n,password:i,signed:o,compressed:r,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:o,compressed:r,inflate:r&&new t({chunkSize:u}),crc32:o&&new Dy,zipCrypto:s,decrypt:f&&s?new NV(i,a):new RV(i,o,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let o=t.decrypt.flush();if(!o.valid)throw new Error(BV);i=o.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let o=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),o.setUint32(0,n),t.signature!=o.getUint32(0,!1))throw new Error(BV)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},ZW=class{constructor(t,{encrypted:n,signed:i,compressed:o,level:r,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:o,deflate:o&&new t({level:r||5,chunkSize:f}),crc32:i&&new Dy,zipCrypto:s,encrypt:n&&s?new FV(a,c):new MV(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let o=t.encrypt.flush();n=o.signature;let r=new Uint8Array(i.length+o.data.length);r.set(i,0),r.set(o.data,i.length),i=r}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function ede(e,t,n){if(t.codecType.startsWith(kV))return new ZW(e,t,n);if(t.codecType.startsWith(UV))return new JW(e,t,n)}var tde="init",nde="append",$W="flush",PXe="message",ide=!0,VV=(e,t,n,i,o,r,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,o(e)}}),r?RXe(e,i):OXe(e,i));function OXe(e,t){let n=ede(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(o){throw e.onTaskFinished(),o}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function RXe(e,t){let n,i={type:"module"};if(!e.interface){if(!ide)e.worker=o(i,t.baseURL);else try{e.worker=o({},t.baseURL)}catch{ide=!1,e.worker=o(i,t.baseURL)}e.worker.addEventListener(PXe,a,!1),e.interface={append(c){return r({type:nde,data:c})},flush(){return r({type:$W})},abort(){e.onTaskFinished()}}}return e.interface;function o(c,u){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,u)}catch{d=f}return new Worker(d,c)}async function r(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:tde,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==tde||d==$W||d==nde){let p=u.data;d==$W?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var Nb=[],QW=[];function zV(e,t,n){let o=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),r=o&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Nb.length!c.busy);return a?(ode(a),VV(a,e,t,n,s,o,r)):new Promise(c=>QW.push({resolve:c,codecConstructor:e,options:t,webWorker:o,scripts:r}))}function s(a){if(QW.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=QW.splice(0,1);c(VV(a,u,f,n,s,d,p))}else a.worker?(ode(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{Nb=Nb.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):Nb=Nb.filter(c=>c!=a)}}function ode(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var sde="Abort error";async function HV(e,t,n,i,o,r,s){let a=Math.max(r.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal,p=o();if(u{t.onload=o=>n(o.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var YV=class extends vL{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,o=this.pending.length;for(this.pending="",n=0;n2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},Fb=class extends WV{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(new Uint8Array(s.target.result)),i.onerror=()=>r(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},RE=class extends vL{constructor(t){super(),this.contentType=t,this.arrayBuffersMaxlength=8,ade(this)}writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.length==this.arrayBuffersMaxlength&&cde(this),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&cde(this),this.blob=this.pendingBlob,ade(this)),this.blob}};function ade(e){e.pendingBlob=new Blob([],{type:e.contentType}),e.arrayBuffers=[]}function cde(e){e.pendingBlob=new Blob([e.pendingBlob,...e.arrayBuffers],{type:e.contentType}),e.arrayBuffers=[]}var ME="/",n7=new Date(2107,11,31),i7=new Date(1980,0,1);var MXe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),lde=e=>{let t="";for(let n=0;n"u"){let n=new FileReader;return new Promise((i,o)=>{n.onload=r=>i(r.target.result),n.onerror=()=>o(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var NXe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],E_=class{constructor(t){NXe.forEach(n=>this[n]=t[n])}};var s7="File format is not recognized",UXe="End of central directory not found",VXe="End of Zip64 central directory not found",zXe="End of Zip64 central directory locator not found",HXe="Central directory header not found",GXe="Local file header not found",WXe="Zip64 extra field not found",jXe="File contains encrypted entry",qXe="Encryption method not supported",ude="Compression method not supported",fde="utf-8",dde="cp437",mde=["uncompressedSize","compressedSize","offset"],iz=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:OV()})}async*getEntriesGenerator(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(s7);let o=await ZXe(i,101010256,i.size,22,65535*16);if(!o)throw new Error(UXe);let r=ac(o),s=sa(r,12),a=sa(r,16),c=yu(r,8),u=0;if(a==4294967295||s==4294967295||c==65535){let g=await Oy(i,o.offset-20,20),h=ac(g);if(sa(h,0)!=117853008)throw new Error(VXe);a=KV(h,8);let x=await Oy(i,a,56),b=ac(x),C=o.offset-20-56;if(sa(b,0)!=101075792&&a!=C){let T=a;a=C,u=a-T,x=await Oy(i,a,56),b=ac(x)}if(sa(b,0)!=101075792)throw new Error(zXe);c=KV(b,32),s=KV(b,40),a-=s}if(a<0||a>=i.size)throw new Error(s7);let f=0,d=await Oy(i,a,s),p=ac(d);if(s){let g=o.offset-s;if(sa(p,f)!=33639248&&a!=g){let h=a;a=g,u=a-h,d=await Oy(i,a,s),p=ac(d)}}if(a<0||a>=i.size)throw new Error(s7);for(let g=0;gh.getData(_,F,E),f=v,t.onprogress)try{t.onprogress(g+1,c,new E_(h))}catch{}yield F}return!0}async getEntries(t={}){let n=[],i=this.getEntriesGenerator(t),o=i.next();for(;!(await o).done;)n.push((await o).value),o=i.next();return n}async close(){}};var c7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=o,h=o.localDirectory={};r.initialized||await r.init();let x=await Oy(r,s,30),b=ac(x),C=LE(o,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(ude);if(c!=0&&c!=8)throw new Error(ude);if(sa(b,0)!=67324752)throw new Error(GXe);pde(h,b,4),x=await Oy(r,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=x.subarray(30+h.filenameLength),await _de(o,h,b,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let T=o.encrypted&&h.encrypted,A=T&&!a;if(T){if(!A&&a.strength===void 0)throw new Error(qXe);if(!C)throw new Error(jXe)}let S=await zV(u.Inflate,{codecType:UV,password:C,zipCrypto:A,encryptionStrength:a&&a.strength,signed:LE(o,i,"checkSignature"),passwordVerification:A&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:T,useWebWorkers:LE(o,i,"useWebWorkers")},u);t.initialized||await t.init();let v=LE(o,i,"signal"),I=s+30+h.filenameLength+h.extraFieldLength;return await HV(S,r,t,I,()=>g,u,{onprogress:i.onprogress,signal:v}),t.getData()}};function pde(e,t,n){let i=e.rawBitFlag=yu(t,n+2),o=(i&1)==1,r=sa(t,n+6);Object.assign(e,{encrypted:o,version:yu(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:$Xe(r),filenameLength:yu(t,n+22),extraFieldLength:yu(t,n+24)})}async function _de(e,t,n,i){let o=t.rawExtraField,r=t.extraField=new Map,s=ac(new Uint8Array(o)),a=0;try{for(;at[o]==4294967295);for(let o=0;o{if(t[o]==4294967295)if(e[o]!==void 0)t[o]=e[o];else throw new Error(WXe)})}async function hde(e,t,n,i,o){let r=ac(e.data);e.version=NE(r,0),e.signature=sa(r,1);let s=new Dy;s.append(o[n]);let a=ac(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await XV(e.data.subarray(5)),e.valid=!o.bitFlag.languageEncodingFlag&&e.signature==sa(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function XXe(e,t,n){let i=ac(e.data);e.vendorVersion=NE(i,0),e.vendorId=NE(i,2);let o=NE(i,4);e.strength=o,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=yu(i,5)}function KXe(e,t){let n=ac(e.data),i=4,o;try{for(;i{if(e.data.length>=s+4){let u=sa(n,s);t[a]=e[a]=new Date(u*1e3);let f=r[c];e[f]=u}s+=4})}async function ZXe(e,t,n,i,o){let r=new Uint8Array(4),s=ac(r);QXe(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Oy(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function LE(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function $Xe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function a7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function NE(e,t){return e.getUint8(t)}function yu(e,t){return e.getUint16(t,!0)}function sa(e,t){return e.getUint32(t,!0)}function KV(e,t){return Number(e.getBigUint64(t,!0))}function QXe(e,t,n){e.setUint32(t,n,!0)}function ac(e){return new DataView(e.buffer)}function Oy(e,t,n){return e.readUint8Array(t,n)}var oKe="File already exists",rKe="Zip file comment exceeds 64KB",sKe="File entry comment exceeds 64KB",aKe="File entry name exceeds 64KB",xde="Version exceeds 65535",cKe="The strength must equal 1, 2, or 3",lKe="Extra field type exceeds 65535",uKe="Extra field data exceeds 64KB",b7="Zip64 is not supported",bde=new Uint8Array([7,0,2,0,65,69,3,0,0]),Cde=24,y7=0,sz=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:OV(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[],pendingAddFileCalls:new Set})}async add(t="",n,i={}){let o=this;if(y7o.pendingEntries.push({name:t,reader:n,options:i,resolve:r,reject:s}))}async close(t=new Uint8Array(0),n={}){for(;this.pendingAddFileCalls.size;)await Promise.all(Array.from(this.pendingAddFileCalls));return await hKe(this,t,n),this.writer.getData()}};async function fKe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(ME)?t+=ME:i.directory=t.endsWith(ME),e.files.has(t))throw new Error(oKe);let o=TL(t);if(o.length>65535)throw new Error(aKe);let r=i.comment||"",s=TL(r);if(s.length>65535)throw new Error(sKe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(xde);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(xde);let u=Ia(e,i,"lastModDate")||new Date,f=Ia(e,i,"lastAccessDate"),d=Ia(e,i,"creationDate"),p=Ia(e,i,"password"),g=Ia(e,i,"encryptionStrength")||3,h=Ia(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(cKe);let x=new Uint8Array(0),b=i.extraField;if(b){let B=0,V=0;b.forEach(U=>B+=4+U.length),x=new Uint8Array(B),b.forEach((U,G)=>{if(G>65535)throw new Error(lKe);if(U.length>65535)throw new Error(uKe);ca(x,new Uint16Array([G]),V),ca(x,new Uint16Array([U.length]),V+2),ca(x,U,V+4),V+=4+U.length})}let C=Ia(e,i,"extendedTimestamp");C===void 0&&(C=!0);let T=0,A=Ia(e,i,"keepOrder");A===void 0&&(A=!0);let S=0,v=Ia(e,i,"msDosCompatible");v===void 0&&(v=!0);let I=Ia(e,i,"internalFileAttribute")||0,O=Ia(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,T=_Ke(S));let R=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||T>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!A)throw new Error(b7);R=!0}e.pendingCompressedSize+=T,await Promise.resolve();let N=Ia(e,i,"level"),F=Ia(e,i,"useWebWorkers"),_=Ia(e,i,"bufferedWrite"),E=Ia(e,i,"dataDescriptor"),w=Ia(e,i,"dataDescriptorSignature"),D=Ia(e,i,"signal");E===void 0&&(E=!0),E&&w===void 0&&(w=!1);let M=await dKe(e,t,n,Object.assign({},i,{rawFilename:o,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:x,zip64:R,password:p,level:N,useWebWorkers:F,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:A,dataDescriptor:E,dataDescriptorSignature:w,signal:D,msDosCompatible:v,internalFileAttribute:I,externalFileAttribute:O}));return T&&(e.pendingCompressedSize-=T),Object.assign(M,{name:t,comment:r,extraField:b}),new E_(M)}async function dKe(e,t,n,i){let o=e.files,r=e.writer,s=Array.from(o.values()).pop(),a={},c,u,f;o.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new RE,p.init(),c=!0):(e.lockWrite=new Promise(h=>u=h),r.initialized||await r.init(),p=r),a=await mKe(n,p,e.config,i),a.lock=g,o.set(t,a),a.filename=t,c){let h=0,x=p.getData();await Promise.all([e.lockWrite,d]);let b;do b=Array.from(o.values()).find(C=>C.writingBufferedData),b&&await b.lock;while(b&&b.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let T=await Tde(x,0,26),A=new DataView(T);(!a.encrypted||i.zipCrypto)&&_o(A,14,a.signature),a.zip64?(_o(A,18,4294967295),_o(A,22,4294967295)):(_o(A,18,a.compressedSize),_o(A,22,a.uncompressedSize)),await r.writeUint8Array(new Uint8Array(T)),h=26}await pKe(r,x,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=em(a.rawExtraFieldZip64);Dl(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(b7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),o.delete(t),d}finally{f(),u&&u()}}async function mKe(e,t,n,i){let{rawFilename:o,lastAccessDate:r,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:x,rawComment:b,rawExtraField:C,useWebWorkers:T,onprogress:A,signal:S,encryptionStrength:v,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N}=i,F=!!(a&&a.length),_=c!==0&&!g,E;if(F&&!f){E=new Uint8Array(bde.length+2);let we=em(E);$o(we,0,39169),ca(E,bde,2),az(we,8,v)}else E=new Uint8Array(0);let w,D;if(I){D=new Uint8Array(9+(r?4:0)+(s?4:0));let we=em(D);$o(we,0,21589),$o(we,2,D.length-4);let ze=1+(r?2:0)+(s?4:0);az(we,4,ze),_o(we,5,Math.floor(i.lastModDate.getTime()/1e3)),r&&_o(we,9,Math.floor(r.getTime()/1e3)),s&&_o(we,13,Math.floor(s.getTime()/1e3));try{w=new Uint8Array(36);let Re=em(w),dt=x7(i.lastModDate);$o(Re,0,10),$o(Re,2,32),$o(Re,8,1),$o(Re,10,24),Dl(Re,12,dt),Dl(Re,20,x7(r)||dt),Dl(Re,28,x7(s)||dt)}catch{w=new Uint8Array(0)}}else w=D=new Uint8Array(0);let M={version:h||20,versionMadeBy:x,zip64:u,directory:!!g,filenameUTF8:!0,rawFilename:o,commentUTF8:!0,rawComment:b,rawExtraFieldZip64:u?new Uint8Array(Cde+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:D,rawExtraFieldNTFS:w,rawExtraFieldAES:E,rawExtraField:C,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N},B=M.uncompressedSize=0,V=2048;d&&(V=V|8);let U=0;_&&(U=8),u&&(M.version=M.version>45?M.version:45),F&&(V=V|1,f||(M.version=M.version>51?M.version:51,U=99,_&&(M.rawExtraFieldAES[9]=8))),M.compressionMethod=U;let G=M.headerArray=new Uint8Array(26),k=em(G);$o(k,0,M.version),$o(k,2,V),$o(k,4,U);let Y=new Uint32Array(1),j=em(Y),$;i.lastModDaten7?$=n7:$=i.lastModDate,$o(j,0,($.getHours()<<6|$.getMinutes())<<5|$.getSeconds()/2),$o(j,2,($.getFullYear()-1980<<4|$.getMonth()+1)<<5|$.getDate());let W=Y[0];_o(k,6,W),$o(k,22,o.length);let K=E.length+D.length+w.length+M.rawExtraField.length;$o(k,24,K);let J=new Uint8Array(30+o.length+K),he=em(J);_o(he,0,67324752),ca(J,G,4),ca(J,o,30),ca(J,E,30+o.length),ca(J,D,30+o.length+E.length),ca(J,w,30+o.length+E.length+D.length),ca(J,M.rawExtraField,30+o.length+E.length+D.length+w.length);let ge,se=0;if(e){let we=await zV(n.Deflate,{codecType:kV,level:c,password:a,encryptionStrength:v,zipCrypto:F&&f,passwordVerification:F&&f&&W>>8&255,signed:!0,compressed:_,encrypted:F,useWebWorkers:T},n);await t.writeUint8Array(J),M.dataWritten=!0,ge=await HV(we,e,t,0,()=>e.size,n,{onprogress:A,signal:S}),B=M.uncompressedSize=e.size,se=ge.length}else await t.writeUint8Array(J),M.dataWritten=!0;let _e=new Uint8Array(0),xe,Pe=0;if(d&&(_e=new Uint8Array(u?p?24:20:p?16:12),xe=em(_e),p&&(Pe=4,_o(xe,0,134695760))),e){let we=ge.signature;if((!F||f)&&we!==void 0&&(_o(k,10,we),M.signature=we,d&&_o(xe,Pe,we)),u){let ze=em(M.rawExtraFieldZip64);$o(ze,0,1),$o(ze,2,Cde),_o(k,14,4294967295),Dl(ze,12,BigInt(se)),_o(k,18,4294967295),Dl(ze,4,BigInt(B)),d&&(Dl(xe,Pe+4,BigInt(se)),Dl(xe,Pe+12,BigInt(B)))}else _o(k,14,se),_o(k,18,B),d&&(_o(xe,Pe+4,se),_o(xe,Pe+8,B))}d&&await t.writeUint8Array(_e);let ve=J.length+se+_e.length;return Object.assign(M,{compressedSize:se,lastModDate:$,rawLastModDate:W,creationDate:s,lastAccessDate:r,encrypted:F,length:ve}),M}async function hKe(e,t,n){let i=e.writer,o=e.files,r=0,s=0,a=e.offset,c=o.size;for(let[,p]of o)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(b7);u=!0}let f=new Uint8Array(s+(u?98:22)),d=em(f);if(t&&t.length)if(t.length<=65535)$o(d,r+20,t.length);else throw new Error(rKe);for(let[p,g]of Array.from(o.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:x,rawExtraFieldAES:b,rawExtraField:C,rawComment:T,versionMadeBy:A,headerArray:S,directory:v,zip64:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N}=g,F,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,F=new Uint8Array(9);let w=em(F);$o(w,0,21589),$o(w,2,F.length-4),az(w,4,1),_o(w,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=F=new Uint8Array(0);let E=x.length+b.length+F.length+_.length+C.length;if(_o(d,r,33639248),$o(d,r+4,A),ca(f,S,r+6),$o(d,r+30,E),$o(d,r+32,T.length),_o(d,r+34,R),N?_o(d,r+38,N):v&&O&&az(d,r+38,16),I?_o(d,r+42,4294967295):_o(d,r+42,g.offset),ca(f,h,r+46),ca(f,x,r+46+h.length),ca(f,b,r+46+h.length+x.length),ca(f,F,r+46+h.length+x.length+b.length),ca(f,_,r+46+h.length+x.length+b.length+F.length),ca(f,C,r+46+h.length+x.length+b.length+F.length+_.length),ca(f,T,r+46+h.length+E),r+=46+h.length+E+T.length,n.onprogress)try{n.onprogress(p+1,o.size,new E_(g))}catch{}}u&&(_o(d,r,101075792),Dl(d,r+4,BigInt(44)),$o(d,r+12,45),$o(d,r+14,45),Dl(d,r+24,BigInt(c)),Dl(d,r+32,BigInt(c)),Dl(d,r+40,BigInt(s)),Dl(d,r+48,BigInt(a)),_o(d,r+56,117853008),Dl(d,r+64,BigInt(a)+BigInt(s)),_o(d,r+72,1),c=65535,a=4294967295,s=4294967295,r+=76),_o(d,r,101010256),$o(d,r+8,c),$o(d,r+10,c),_o(d,r+12,s),_o(d,r+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function Tde(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(s.target.result),i.onerror=()=>r(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function pKe(e,t,n=0){await o();async function o(){if(n{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function bKe(e,t){return function(n){e._files[t]=n}}cz.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(bKe(this,r))}return o};Object.defineProperties(cz.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function lz(e){this._time=e}lz.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};lz.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return kb(n)};lz.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function T7(){this._ids={},this._styles={},this._count=0}T7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};T7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function vde(){this._ids={}}vde.prototype.get=function(e){if(!l(e))return this.get(Wn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function A7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=A7._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(yKe,"xmlns:gx",nm);let a=r.createElement("Document");s.appendChild(a),Ide(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?CKe(f,c.files):{kml:f,externalFiles:c.files}})}function CKe(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");wE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new RE,o=new sz(i);return o.add("doc.kml",new jV(e)).then(function(){let r=Object.keys(t);return wde(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function wde(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new Fb(n[o])).then(function(){return wde(e,t,n,i+1)})}A7._createState=function(e){let t=e.entities,n=new T7,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===He.MINIMUM_VALUE?r.stop===He.MAXIMUM_VALUE?r=new An:ee.addSeconds(r.stop,-10*s,r.start):r.stop===He.MAXIMUM_VALUE&&ee.addSeconds(r.start,10*s,r.stop);let a=new cz(e.modelCallback);return{kmlDoc:document.implementation.createDocument(gKe,"kml"),ellipsoid:y(e.ellipsoid,oe.WGS84),idManager:new vde,styleCache:n,externalFileHandler:a,time:o,valueGetter:new lz(o),sampleDuration:s,defaultAvailability:new Dr([r])}};function Ide(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let T=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),I=r.get(A.text);T=l(I)&&I.length>0?I:T;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(_n(i,"color",O)),v.appendChild(_n(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(_n(i,"scale",R)),f.push(v)}C.appendChild(_n(i,"name",T)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let v=i.createElement("Style");for(let I=0;I1){let v=i.createElement("MultiGeometry");for(let I=0;I0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(_n(i,"name",p.name)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),t.appendChild(C),Ide(e,C,b)}}}var Pl=new m,Wc=new me,tm=new ee;function TKe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){Dde(e,t,a,n,i);return}s.get(c,void 0,Pl);let u=_n(o,"coordinates",Bb(Pl,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(Ub(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Na?Ode(e,a):Pde(e,a);i.push(p)}function Dde(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof na?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof fp,p,g,h,x=[];for(p=0;p1){let C=r.createElementNS(nm,"MultiTrack");for(p=0;p0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,Wc),c.push(`${P.toDegrees(Wc.longitude)},${P.toDegrees(Wc.latitude)},${r}`);let f=_n(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Ede(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Ede(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let h=0;h0&&c.appendChild(_n(r,"extrude",!0));let f=a?EKe(e,t,u):SKe(e,t,u),d=f.length;for(let b=0;b=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var S7=A7;function IL(){this._cache={}}IL.prototype.fromColor=function(e,t){return uz(void 0,void 0,e,t,this._cache)};IL.prototype.fromUrl=function(e,t,n){return uz(e,void 0,t,n,this._cache)};IL.prototype.fromMakiIconId=function(e,t,n){return uz(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};IL.prototype.fromText=function(e,t,n){return uz(void 0,e,t,n,this._cache)};var IKe=new z;function DKe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,IKe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Mde(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width${i}${kde(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),n}function FKe(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function BKe(e,t){return new md(FKe(kde,e,t),!0)}function mz(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Wn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new ei(c):n(r,s))}return o}function B7(e,t){let n=new Array(e.length);for(let i=0;i2?u.perPositionHeight=new ei(!0):o.clampToGround||(u.height=0);let p=mz(t,e._entityCollection,o.describe);p.polygon=u}function Jde(e,t,n,i,o){Kde(e,t,i,n.coordinates,o)}function Zde(e,t,n,i,o){let r=n.coordinates;for(let s=0;st&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Wo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function My(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Ly(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Ny=/[A-Za-z]/,Ns=/[\d]/;var bu=/\s/,hz=/['"]/,ime=/[\x00-\x1F\x7F]/,ome=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,HKe=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,GKe=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,WKe=ome+HKe+GKe,rme=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,C6n=new RegExp("[".concat(ome+rme,"]")),k7=WKe+rme,im=new RegExp("[".concat(k7,"]"));var pz=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(bu):[],o=t.split(bu),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(bu):[],o=t.split(bu),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function sme(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(T){var A={},S=T,v=S.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(T){var A="";return T.scheme&&T.host&&(A+=T.scheme+"://"),T.host&&(A+=T.host),T.path&&(A+="/"+T.path),T.query&&(A+="?"+T.query),T.fragment&&(A+="#"+T.fragment),A},a=function(T,A){var S=A/2,v=Math.ceil(S),I=-1*Math.floor(S),O="";return I<0&&(O=T.substr(I)),T.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var h="#"+u.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var x=c-d.length;return(d+a(h,x)).substr(0,c+i)}else d+=h}if(u.scheme&&u.host){var b=u.scheme+"://";if((d+b).length0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}function ame(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}function cme(e,t,n){return nme(e,t,n)}var lme=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new pz({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=0;g--){var h=f[g];switch(h.state){case 11:I(h,p);break;case 12:O(h,p);break;case 0:C(h,p);break;case 1:T(h,p);break;case 2:A(h,p);break;case 3:S(h,p);break;case 4:v(h,p);break;case 5:R(h,p);break;case 6:N(h,p);break;case 7:F(h,p);break;case 13:_(h,p);break;case 14:E(h,p);break;case 8:w(h,p);break;case 9:D(h,p);break;case 10:M(h,p);break;case 15:B(h,p);break;case 16:V(h,p);break;case 17:U(h,p);break;case 18:G(h,p);break;case 19:k(h,p);break;case 20:Y(h,p);break;case 21:j(h,p);break;case 22:$(h,p);break;case 23:W(h,p);break;case 24:K(h,p);break;case 25:J(h,p);break;case 26:he(h,p);break;case 27:ge(h,p);break;case 28:se(h,p);break;case 29:_e(h,p);break;case 30:xe(h,p);break;case 31:Pe(h,p);break;case 32:we(h,p);break;case 33:ze(h,p);break;case 34:Re(h,p);break;case 35:dt(h,p);break;case 36:Tt(h,p);break;case 37:ve(h,p);break;case 38:ot(h,p);break;case 39:ln(h,p);break;case 40:Dn(h,p);break;case 41:Ht(h,p);break;default:Ly(h.state)}}}for(var x=f.length-1;x>=0;x--)f.forEach(function(be){return kt(be)});return c;function b(be){if(be==="#")f.push(xJe(d,28));else if(be==="@")f.push(bJe(d,30));else if(be==="/")f.push(X7(d,11));else if(be==="+")f.push(K7(d,37));else if(be==="(")f.push(K7(d,32));else{if(Ns.test(be)&&(f.push(K7(d,38)),f.push(gJe(d,13))),xme(be)){var Ee=be.toLowerCase()==="m"?15:22;f.push(yJe(d,Ee))}_z(be)&&f.push(Y7(d,0)),im.test(be)&&f.push(X7(d,5))}}function C(be,Ee){Ee===":"?be.state=2:Ee==="-"?be.state=1:z7(Ee)||Wo(f,be)}function T(be,Ee){Ee==="-"||(Ee==="/"?(Wo(f,be),f.push(X7(d,11))):z7(Ee)?be.state=0:Wo(f,be))}function A(be,Ee){Ee==="/"?be.state=3:Ee==="."?Wo(f,be):v_(Ee)?(be.state=5,_z(Ee)&&f.push(Y7(d,0))):Wo(f,be)}function S(be,Ee){Ee==="/"?be.state=4:H7(Ee)?(be.state=10,be.acceptStateReached=!0):kt(be)}function v(be,Ee){Ee==="/"?be.state=10:v_(Ee)?(be.state=5,be.acceptStateReached=!0):Wo(f,be)}function I(be,Ee){Ee==="/"?be.state=12:Wo(f,be)}function O(be,Ee){v_(Ee)?be.state=5:Wo(f,be)}function R(be,Ee){Ee==="."?be.state=7:Ee==="-"?be.state=6:Ee===":"?be.state=8:yz(Ee)?be.state=10:gz(Ee)||kt(be)}function N(be,Ee){Ee==="-"||(Ee==="."?kt(be):v_(Ee)?be.state=5:kt(be))}function F(be,Ee){Ee==="."?kt(be):v_(Ee)?(be.state=5,be.acceptStateReached=!0):kt(be)}function _(be,Ee){Ee==="."?be.state=14:Ee===":"?be.state=8:Ns.test(Ee)||(yz(Ee)?be.state=10:im.test(Ee)?Wo(f,be):kt(be))}function E(be,Ee){Ns.test(Ee)?(be.octetsEncountered++,be.octetsEncountered===4&&(be.acceptStateReached=!0),be.state=13):kt(be)}function w(be,Ee){Ns.test(Ee)?be.state=9:kt(be)}function D(be,Ee){Ns.test(Ee)||(yz(Ee)?be.state=10:kt(be))}function M(be,Ee){H7(Ee)||kt(be)}function B(be,Ee){Ee.toLowerCase()==="a"?be.state=16:$(be,Ee)}function V(be,Ee){Ee.toLowerCase()==="i"?be.state=17:$(be,Ee)}function U(be,Ee){Ee.toLowerCase()==="l"?be.state=18:$(be,Ee)}function G(be,Ee){Ee.toLowerCase()==="t"?be.state=19:$(be,Ee)}function k(be,Ee){Ee.toLowerCase()==="o"?be.state=20:$(be,Ee)}function Y(be,Ee){Ee.toLowerCase()===":"?be.state=21:$(be,Ee)}function j(be,Ee){xz(Ee)?be.state=22:Wo(f,be)}function $(be,Ee){Ee==="."?be.state=23:Ee==="@"?be.state=24:xz(Ee)?be.state=22:Wo(f,be)}function W(be,Ee){Ee==="."?Wo(f,be):Ee==="@"?Wo(f,be):xz(Ee)?be.state=22:Wo(f,be)}function K(be,Ee){v_(Ee)?be.state=25:Wo(f,be)}function J(be,Ee){Ee==="."?be.state=27:Ee==="-"?be.state=26:gz(Ee)||kt(be)}function he(be,Ee){Ee==="-"||Ee==="."?kt(be):gz(Ee)?be.state=25:kt(be)}function ge(be,Ee){Ee==="."||Ee==="-"?kt(be):v_(Ee)?(be.state=25,be.acceptStateReached=!0):kt(be)}function se(be,Ee){W7(Ee)?(be.state=29,be.acceptStateReached=!0):Wo(f,be)}function _e(be,Ee){W7(Ee)||kt(be)}function xe(be,Ee){j7(Ee)?(be.state=31,be.acceptStateReached=!0):Wo(f,be)}function Pe(be,Ee){j7(Ee)||(im.test(Ee)?Wo(f,be):kt(be))}function ve(be,Ee){Ns.test(Ee)?be.state=38:(Wo(f,be),b(Ee))}function we(be,Ee){Ns.test(Ee)?be.state=33:Wo(f,be),b(Ee)}function ze(be,Ee){Ns.test(Ee)?be.state=34:Wo(f,be)}function Re(be,Ee){Ns.test(Ee)?be.state=35:Wo(f,be)}function dt(be,Ee){Ee===")"?be.state=36:Wo(f,be)}function Tt(be,Ee){Ns.test(Ee)?be.state=38:q7(Ee)?be.state=39:Wo(f,be)}function ot(be,Ee){be.acceptStateReached=!0,bz(Ee)?be.state=40:Ee==="#"?be.state=41:Ns.test(Ee)||(Ee==="("?be.state=32:q7(Ee)?be.state=39:(kt(be),_z(Ee)&&f.push(Y7(d,0))))}function ln(be,Ee){Ns.test(Ee)?be.state=38:Ee==="("?be.state=32:(kt(be),b(Ee))}function Dn(be,Ee){bz(Ee)||(Ee==="#"?be.state=41:Ns.test(Ee)?be.state=38:kt(be))}function Ht(be,Ee){bz(Ee)?be.state=40:Ns.test(Ee)?Wo(f,be):kt(be)}function kt(be){if(Wo(f,be),!!be.acceptStateReached){var Ee=be.startIdx,at=e.slice(be.startIdx,d);if(at=_Je(at),be.type==="url"){var Jt=e.charAt(be.startIdx-1);if(Jt==="@")return;var di=be.matchType;if(di==="scheme"){var Ze=V7.exec(at);if(Ze&&(Ee=Ee+Ze.index,at=at.slice(Ze.index)),!hme(at))return}else if(di==="tld"){if(!pme(at))return}else if(di==="ipV4"){if(!_me(at))return}else Ly(di);c.push(new gme({tagBuilder:n,matchedText:at,offset:Ee,urlMatchType:di,url:at,protocolRelativeMatch:at.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(be.type==="email")bme(at)&&c.push(new Cme({tagBuilder:n,matchedText:at,offset:Ee,email:at.replace(yme,"")}));else if(be.type==="hashtag")Tme(at)&&c.push(new Eme({tagBuilder:n,matchedText:at,offset:Ee,serviceName:s,hashtag:at.slice(1)}));else if(be.type==="mention")Sme(at,a)&&c.push(new wme({tagBuilder:n,matchedText:at,offset:Ee,serviceName:a,mention:at.slice(1)}));else if(be.type==="phone"){if(at=at.replace(/ +$/g,""),Ime(at)){var jr=at.replace(/[^0-9,;#]/g,"");c.push(new Dme({tagBuilder:n,matchedText:at,offset:Ee,number:jr,plusSign:at.charAt(0)==="+"}))}}else Ly(be)}}}var pJe=/[\(\{\[]/,Pme=/[\)\}\]]/,Ome={")":"(","}":"{","]":"["};function _Je(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(r=e.charAt(o),Pme.test(r)){var s=Ome[r];if(t[s]<0)t[s]++,o--;else break}else if(mme.test(r))o--;else break;return e.slice(0,o+1)}function Y7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function X7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function gJe(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function yJe(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function xJe(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function bJe(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function K7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Mme(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new _h,c=0,u=e.length,f=0,d=0,p=a;c"?(p=new _h(Fs(Fs({},p),{name:$()})),Y()):!Ny.test(K)&&!Ns.test(K)&&K!==":"&&G()}function C(K){K===">"?G():Ny.test(K)?f=3:G()}function T(K){bu.test(K)||(K==="/"?f=12:K===">"?Y():K==="<"?k():K==="="||hz.test(K)||ime.test(K)?G():f=5)}function A(K){bu.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():hz.test(K)&&G()}function S(K){bu.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():hz.test(K)?G():f=5)}function v(K){bu.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function I(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){bu.test(K)?f=4:K===">"?Y():K==="<"&&k()}function N(K){bu.test(K)?f=4:K==="/"?f=12:K===">"?Y():K==="<"?k():(f=4,W())}function F(K){K===">"?(p=new _h(Fs(Fs({},p),{isClosing:!0})),Y()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new _h(Fs(Fs({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new _h(Fs(Fs({},p),{type:"doctype"})),f=20):G()}function E(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function D(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function B(K){K===">"?Y():K==="!"?f=19:K==="-"||(f=16)}function V(K){K==="-"?f=17:K===">"?Y():f=16}function U(K){K===">"?Y():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new _h({idx:c})}function Y(){var K=e.slice(d,p.idx);K&&o(K,d),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function j(){var K=e.slice(d,c);o(K,d),d=c+1}function $(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}var _h=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var CJe=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=TJe(t.urls),this.email=xu(t.email)?t.email:this.email,this.phone=xu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=xu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=AJe(t.stripPrefix),this.stripTrailingSlash=xu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=xu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&vme.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Ame.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=EJe(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return Mme(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);r.push.apply(r,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function J7(e,t){let n=RL(e,"id");return n=l(n)?n:Wn(),t.getOrCreateEntity(n)}function Z7(e){let t=Ume(e,"lon"),n=Ume(e,"lat"),i=PL(e,"ele",vo.gpx);return m.fromDegrees(t,n,i)}function Ume(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function RL(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Fy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r${d.text}: ${d.value}

`)}if(!l(i)||i==="")return;i=SJe.link(i),OL.innerHTML=i;let s=OL.querySelectorAll("a");for(n=0;n',u+=`${OL.innerHTML}`,OL.innerHTML="",u}function qme(e,t,n,i){let o=Z7(t),r=J7(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Tz);r.billboard=Wme(s);let a=Ol(t,"name",vo.gpx);r.name=a,r.label=IJe(),r.label.text=a,r.description=Q7(t,r),i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND,r.label.heightReference=qe.CLAMP_TO_GROUND)}function DJe(e,t,n,i){let o=J7(t,n);o.description=Q7(t,o);let r=$7(t,"rtept",vo.gpx),s=new Array(r.length);for(let a=0;a0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Tz);o.billboard=Wme(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND),o.availability=new Dr,o.availability.addInterval(new An({start:a[0],stop:a[a.length-1]}))}o.polyline=jme(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function OJe(e){let t={positions:[],times:[]},n=$7(e,"trkpt",vo.gpx),i;for(let o=0;o=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function HJe(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Kme.call(this,e,t,n)}}var FL=Az;var Ui={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Ui.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Ui.Bounce.In(e*2)*.5:Ui.Bounce.Out(e*2-1)*.5+.5}}},BL;typeof self>"u"&&typeof process<"u"&&process.hrtime?BL=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?BL=self.performance.now.bind(self.performance):Date.now!==void 0?BL=Date.now:BL=function(){return new Date().getTime()};var BE=BL,GJe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=BE()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=kL.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=kL.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},Jme=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Zme=new GJe,$me=function(){function e(t,n){n===void 0&&(n=Zme),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ui.Linear.None,this._interpolationFunction=kL.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Jme.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?BE()+parseFloat(t):t:BE(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,o){for(var r in i){var s=t[r],a=Array.isArray(s),c=a?"array":typeof s,u=!a&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(u){var f=i[r];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[r]=[s].concat(f)}if((c==="object"||a)&&s&&!u){n[r]=a?[]:{};for(var d in s)n[r][d]=s[d];o[r]=a?[]:{},this._setupProperties(s,n[r],i[r],o[r])}else typeof n[r]>"u"&&(n[r]=s),a||(n[r]*=1),u?o[r]=i[r].slice().reverse():o[r]=n[r]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=BE()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=BE()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;tr)return!1;n&&this.start(t)}if(this._goToEnd=!1,t1?1:o;var s=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),o===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;athis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function YJe(e){let t=e.slice(0,Math.min(4,e.size)),n=Ys(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function XJe(e){let t=Ys(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function lhe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("",t),i,o,r;for(;t!==-1&&t0?(Rl.maximumRed=r,Rl.red=void 0):(Rl.maximumRed=void 0,Rl.red=0),o>0?(Rl.maximumGreen=o,Rl.green=void 0):(Rl.maximumGreen=void 0,Rl.green=0),i>0?(Rl.maximumBlue=i,Rl.blue=void 0):(Rl.maximumBlue=void 0,Rl.blue=0),Rl.alpha=n,z.fromRandom(Rl)):new z(r,o,i,n)}function Vb(e,t,n){let i=Rn(e,t,n);if(l(i))return rj(i,Rn(e,"colorMode",n)==="random")}function JJe(e){let t=Oi(e,"TimeStamp",Le.kmlgx),n=Rn(t,"when",Le.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),o=new Dr;return o.addInterval(new An({start:i,stop:He.MAXIMUM_VALUE})),o}function ZJe(e){let t=Oi(e,"TimeSpan",Le.kmlgx);if(!l(t))return;let n,i=Oi(t,"begin",Le.kmlgx),o=l(i)?ee.fromIso8601(i.textContent):void 0,r=Oi(t,"end",Le.kmlgx),s=l(r)?ee.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(ee.lessThan(s,o)){let a=o;o=s,s=a}n=new Dr,n.addInterval(new An({start:o,stop:s}))}else l(o)?(n=new Dr,n.addInterval(new An({start:o,stop:He.MAXIMUM_VALUE}))):l(s)&&(n=new Dr,n.addInterval(new An({start:He.MINIMUM_VALUE,stop:s})));return n}function dhe(){let e=new Na;return e.width=By,e.height=By,e.scaleByDistance=new Rt(Qme,ehe,the,nhe),e.pixelOffsetScaleByDistance=new Rt(Qme,ehe,the,nhe),e}function uj(){let e=new fd;return e.outline=!0,e.outlineColor=z.WHITE,e}function mhe(){let e=new ud;return e.translucencyByDistance=new Rt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=pi.LEFT,e.font="16px sans-serif",e.style=zo.FILL_AND_OUTLINE,e}function fj(e,t,n,i,o){let r=Rn(e,"href",Le.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(ii(e,"x",Le.gx),0),u=y(ii(e,"y",Le.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=lj(r,n,i);if(o){let a=Rn(e,"refreshMode",Le.kml),c=Rn(e,"viewRefreshMode",Le.kml);a==="onInterval"||a==="onExpire"?Nt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Nt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Rn(e,"viewBoundScale",Le.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Rn(e,"viewFormat",Le.kml),f),p=Rn(e,"httpQuery",Le.kml);l(d)&&s.setQueryParameters(jl(wz(d))),l(p)&&s.setQueryParameters(jl(wz(p)));let g=t._ellipsoid;return mj(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function $Je(e,t,n,i,o){let r=ii(t,"scale",Le.kml),s=ii(t,"heading",Le.kml),a=Vb(t,"color",Le.kml),c=Oi(t,"Icon",Le.kml),u=fj(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=ii(c,"x",Le.gx),d=ii(c,"y",Le.gx),p=ii(c,"w",Le.gx),g=ii(c,"h",Le.gx),h=Oi(t,"hotSpot",Le.kml),x=ky(h,"x"),b=ky(h,"y"),C=hs(h,"xunits"),T=hs(h,"yunits"),A=n.billboard;l(A)||(A=dhe(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(d)||l(p)||l(g))&&(A.imageSubRegion=new Ke(f,d,p,g)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=m.UNIT_Z),r=y(r,1);let S,v;l(x)&&(C==="pixels"?S=-x*r:C==="insetPixels"?S=(x-By)*r:C==="fraction"&&(S=-x*By*r),S+=By*.5*r),l(b)&&(T==="pixels"?v=b*r:T==="insetPixels"?v=(-b+By)*r:T==="fraction"&&(v=b*By*r),v-=By*.5*r),(l(S)||l(v))&&(A.pixelOffset=new H(S,v))}function vz(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r:clampToSeaFloor is currently not supported, using :clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Nt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),qe.RELATIVE_TO_GROUND):(l(e)?Nt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):Nt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function tZe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new uh(e))}function nZe(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r0&&Nt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),h=[],x=[];for(let C=0;C0&&i.availability.addInterval(new An({start:x[0],stop:x[x.length-1]})),d&&f&&dj(t,i,o),!0}function ahe(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new oa;d.addSamples(e,t),n.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:tZe(d,s,a)})),i.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function sZe(e,t,n,i,o){let r=rm(n,"interpolate",Le.gx),s=om(n,"Track",Le.gx),a,c,u,f=!1,d=new g_,p=new Dr,g=new na,h=e._ellipsoid;for(let x=0,b=s.length;x0)){for(h='',r=0;r`;h+="
${y(x.displayName,s)}${y(x.value,"")}
"}if(!l(h))return;h=jJe.link(h),go.innerHTML=h;let b=go.querySelectorAll("a");for(r=0;r1&&(Cu(go,"a","href",i),Cu(go,"link","href",i),Cu(go,"area","href",i),Cu(go,"img","src",i),Cu(go,"iframe","src",i),Cu(go,"video","src",i),Cu(go,"audio","src",i),Cu(go,"source","src",i),Cu(go,"track","src",i),Cu(go,"input","src",i),Cu(go,"embed","src",i),Cu(go,"script","src",i),Cu(go,"video","poster",i)),Tu(go,"a","href",o),Tu(go,"link","href",o),Tu(go,"area","href",o),Tu(go,"img","src",o),Tu(go,"iframe","src",o),Tu(go,"video","src",o),Tu(go,"audio","src",o),Tu(go,"source","src",o),Tu(go,"track","src",o),Tu(go,"input","src",o),Tu(go,"embed","src",o),Tu(go,"script","src",o),Tu(go,"video","poster",o);let C='
',C+=`${go.innerHTML}
`,go.innerHTML="",t.description=C}function Pz(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=fhe(t,i,n.context),c=a.kml,u=QJe(e,t,n.styleCollection,r,s),f=Rn(t,"name",Le.kml);a.name=f,a.parent=o;let d=ZJe(t);l(d)||(d=JJe(t)),a.availability=d,pj(a);function p(A){return A?A.show&&p(A.parent):!0}let g=rm(t,"visibility",Le.kml);a.show=p(o)&&y(g,!0);let h=Oi(t,"author",Le.atom),x=c.author;x.name=Rn(h,"name",Le.atom),x.uri=Rn(h,"uri",Le.atom),x.email=Rn(h,"email",Le.atom);let b=Oi(t,"link",Le.atom),C=c.link;C.href=hs(b,"href"),C.hreflang=hs(b,"hreflang"),C.rel=hs(b,"rel"),C.type=hs(b,"type"),C.title=hs(b,"title"),C.length=hs(b,"length"),c.address=Rn(t,"address",Le.kml),c.phoneNumber=Rn(t,"phoneNumber",Le.kml),c.snippet=Rn(t,"Snippet",Le.kml),lZe(t,a),uZe(t,a,u,s,r);let T=e._ellipsoid;return bhe(t,a,T),xhe(t,a,T),l(Oi(t,"Region",Le.kml))&&Nt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function yhe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function fZe(e,t,n,i){let o=Pz(e,t,n),r=Ye(n);r.parentEntity=o.entity,yhe(e,t,r,i)}function dZe(e,t,n,i){let o=Pz(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;uP.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=I0(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,xZe),l(n)&&(ij.x=n.clientWidth*.5,ij.y=n.clientHeight*.5,u=t.pickEllipsoid(ij,r,bZe)),l(u)?f=r.cartesianToCartographic(u,kE):(f=ce.center(o,kE),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let C=o.width*i*.5,T=o.height*i*.5;o=new ce(a(f.longitude-C),s(f.latitude-T),a(f.longitude+C),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,kE),c=c.replace("[cameraLon]",P.toDegrees(kE.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(kE.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(kE.height).toString());let g=t.frustum,h=g.aspectRatio,x="",b="";if(l(h)){let C=P.toDegrees(g.fov);h>1?(x=C,b=C/h):(b=C,x=C*h)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(jl(c))}function CZe(e,t,n,i){let r=Pz(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Oi(t,"Link",Le.kml);if(l(c)||(c=Oi(t,"Url",Le.kml)),l(c)){let u=Rn(c,"href",Le.kml),f,d;if(l(u)){let p=u;if(u=lj(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Rn(c,"viewRefreshMode",Le.kml),f==="onRegion"){Nt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Rn(c,"viewBoundScale",Le.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Rn(c,"viewFormat",Le.kml),b),T=Rn(c,"httpQuery",Le.kml);l(C)&&u.setQueryParameters(jl(wz(C))),l(T)&&u.setQueryParameters(jl(wz(T)));let A=e._ellipsoid;mj(u,e.camera,e.canvas,d,e._lastCameraView.bbox,A)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},h=new Rs,x=hj(e,h,u,g).then(function(b){let C=e._entityCollection,T=h.values;C.suspendEvents();for(let v=0;v0||A==="onExpire"||f==="onStop"){let v=Oi(b,"NetworkLinkControl",Le.kml),I=l(v),O=ee.now(),R={id:Wn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:O},N=0;if(I&&(R.cookie=jl(y(Rn(v,"cookie",Le.kml),"")),N=y(ii(v,"minRefreshPeriod",Le.kml),0)),A==="onInterval")I&&(S=Math.max(N,S)),R.refreshMode=Uy.INTERVAL,R.time=S;else if(A==="onExpire"){let F;if(I&&(F=Rn(v,"expires",Le.kml)),l(F))try{let _=ee.fromIso8601(F),E=ee.secondsDifference(_,O);E>0&&E0;)this._screenOverlays.pop().remove()};function pj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function EZe(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Oi(r,"NetworkLinkControl",Le.kml),c=l(a),u=0;if(c){if(l(Oi(a,"Update",Le.kml))){Nt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=jl(y(Rn(a,"cookie",Le.kml),"")),u=y(ii(a,"minRefreshPeriod",Le.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===Uy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Uy.EXPIRE){let O;if(l(a)&&(O=Rn(a,"expires",Le.kml)),l(O))try{let R=ee.fromIso8601(O),N=ee.secondsDifference(R,f);N>0&&Nf.time&&(p=!0):f.refreshMode===Uy.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Uy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let g=new Rs,h=f.href.clone();h.setQueryParameters(f.cookie);let x=y(i._ellipsoid,oe.WGS84);mj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),hj(i,g,h,{context:d.id}).then(EZe(i,f,g,c,h)).catch(function(b){let C=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function SZe(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Au._DeferredLoading=yh;Au._getTimestamp=yi;var GL=Au;function WL(){fe.throwInstantiationError()}WL.prototype.update=fe.throwInstantiationError;WL.prototype.getBoundingSphere=fe.throwInstantiationError;WL.prototype.isDestroyed=fe.throwInstantiationError;WL.prototype.destroy=fe.throwInstantiationError;var _j=WL;var vZe={NONE:0,LERC:1},Mf=Object.freeze(vZe);var wZe={NONE:0,BITS12:1},Bs=Object.freeze(wZe);var zb=new m,IZe=new m,Lf=new H,Oz=new L,DZe=new L,PZe=Math.pow(2,12);function cc(e,t,n,i,o,r,s,a,c,u){let f=Bs.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,h=t.maximum,x=m.subtract(h,g,IZe),b=i-n;Math.max(m.maximumComponent(x),b)0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,oe.WGS84),x=1/h.maximumRadius,b=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),T,A,S,v;l(C)?(T=C.west,A=C.south,S=C.east,v=C.north):g?(T=a(b.west),A=a(b.south),S=a(b.east),v=a(b.north)):(T=b.west*x,A=s-2*o(r(-b.south*x)),S=b.east*x,v=s-2*o(r(-b.north*x)));let I=e.relativeToCenter,O=l(I);I=O?I:m.ZERO;let R=y(e.includeWebMercatorT,!1),N=y(e.exaggeration,1),F=y(e.exaggerationRelativeHeight,0),E=N!==1,w=y(e.structure,xh.DEFAULT_STRUCTURE),D=y(w.heightScale,xh.DEFAULT_STRUCTURE.heightScale),M=y(w.heightOffset,xh.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,xh.DEFAULT_STRUCTURE.elementsPerHeight),V=y(w.stride,xh.DEFAULT_STRUCTURE.stride),U=y(w.elementMultiplier,xh.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,xh.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(b),Y=ce.computeHeight(b),j=k/(u-1),$=Y/(f-1);g||(k*=x,Y*=x);let W=h.radiiSquared,K=W.x,J=W.y,he=W.z,ge=65536,se=-65536,_e=Mt.eastNorthUpToFixedFrame(I,h),xe=L.inverseTransformation(_e,RZe),Pe,ve;R&&(Pe=Ii.geodeticLatitudeToMercatorAngle(A),ve=1/(Ii.geodeticLatitudeToMercatorAngle(v)-Pe));let we=MZe;we.x=Number.POSITIVE_INFINITY,we.y=Number.POSITIVE_INFINITY,we.z=Number.POSITIVE_INFINITY;let ze=LZe;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let Re=Number.POSITIVE_INFINITY,dt=u*f,Tt=d>0?u*2+f*2:0,ot=dt+Tt,ln=new Array(ot),Dn=new Array(ot),Ht=new Array(ot),kt=R?new Array(ot):[],be=E?new Array(ot):[],Ee=0,at=f,Jt=0,di=u;p&&(--Ee,++at,--Jt,++di);let Ze=1e-5;for(let We=Ee;We=f&&(mt=f-1);let Vt=b.north-$*mt;g?Vt=a(Vt):Vt=s-2*o(r(-Vt*x));let Tn=(Vt-A)/(v-A);Tn=P.clamp(Tn,0,1);let Qn=We===Ee,Ao=We===at-1;d>0&&(Qn?Vt+=Ze*Y:Ao&&(Vt-=Ze*Y));let ns=t(Vt),is=n(Vt),ur=he*is,ji;R&&(ji=(Ii.geodeticLatitudeToMercatorAngle(Vt)-Pe)*ve);for(let os=Jt;os=u&&(Kn=u-1);let Fn=mt*(u*V)+Kn*V,dn;if(B===1)dn=c[Fn];else{dn=0;let dr;if(G)for(dr=0;dr=0;--dr)dn=dn*U+c[Fn+dr]}dn=dn*D+M,se=Math.max(se,dn),ge=Math.min(ge,dn);let bi=b.west+j*Kn;g?bi=a(bi):bi=bi*x;let qi=(bi-T)/(S-T);qi=P.clamp(qi,0,1);let rs=mt*u+Kn;if(d>0){let dr=os===Jt,Hs=os===di-1,Uh=Qn||Ao||dr||Hs;if((Qn||Ao)&&(dr||Hs))continue;Uh&&(dn-=d,dr?(rs=dt+(f-mt-1),bi-=Ze*k):Ao?rs=dt+f+(u-Kn-1):Hs?(rs=dt+f+u+mt,bi+=Ze*k):Qn&&(rs=dt+f+u+f+Kn))}let lo=ns*t(bi),pa=ns*n(bi),$f=K*lo,Qf=J*pa,X_=1/i($f*lo+Qf*pa+ur*is),fr=$f*X_,No=Qf*X_,_a=ur*X_,Yi=new m;Yi.x=fr+lo*dn,Yi.y=No+pa*dn,Yi.z=_a+is*dn,L.multiplyByPoint(xe,Yi,gj),m.minimumByComponent(gj,we,we),m.maximumByComponent(gj,ze,ze),Re=Math.min(Re,dn),ln[rs]=Yi,Ht[rs]=new H(qi,Tn),Dn[rs]=dn,R&&(kt[rs]=ji),E&&(be[rs]=h.geodeticSurfaceNormal(Yi))}}let jr=ae.fromPoints(ln),qr;l(C)&&(qr=Ln.fromRectangle(C,ge,se,h));let ha;O&&(ha=new u_(h).computeHorizonCullingPointPossiblyUnderEllipsoid(I,ln,ge));let ts=new ag(we,ze,I),Ne=new lc(I,ts,Re,se,_e,!1,R,E,N,F),rt=new Float32Array(ot*Ne.stride),$e=0;for(let We=0;We0?A=Hr.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):A=Hr.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let S=T.gridWidth*T.gridHeight;return C._mesh=new Nf(d,new Float32Array(T.vertices),A.indices,A.indexCountWithoutSkirts,S,T.minimumHeight,T.maximumHeight,ae.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Ln.clone(T.orientedBoundingBox),lc.clone(T.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),C._buffer=void 0,C._mesh})};w_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),d=this._structure,g=Hr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?x=Hr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=Hr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=h.gridWidth*h.gridHeight;return this._mesh=new Nf(f,h.vertices,x.indices,x.indexCountWithoutSkirts,b,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};w_.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),g=this._encoding===Mf.LERC;if(!p&&g)return;let x;if(p){let b=this._mesh.vertices,C=this._mesh.encoding;x=Dhe(b,C,f,d,e,i,o,t,n)}else x=kZe(this._buffer,a,c,s,u,e,i,o,t,n),x=x*d+f;return x};w_.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,h=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),C=f.heightOffset,T=f.heightScale,A=f.elementsPerHeight,S=f.elementMultiplier,v=f.isBigEndian,I=Math.pow(S,A-1);for(let O=0;Of.highestEncodedHeight?f.highestEncodedHeight:_,UZe(p,A,S,I,d,v,O*c+N,_)}}return Promise.resolve(new w_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};w_.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<=s&&(g=s-1,p=s-2);let h=d|0,x=h+1;x>=a&&(x=a-1,h=a-2);let b=f-p,C=d-h;h=a-1-h,x=a-1-x;let T=Nz(e,t,n,i,o,h*s+p),A=Nz(e,t,n,i,o,h*s+g),S=Nz(e,t,n,i,o,x*s+p),v=Nz(e,t,n,i,o,x*s+g);return Phe(b,C,T,A,S,v)}function Dhe(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let x=u-d,b=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*r+d)-n)/i,T=(t.decodeHeight(e,g*r+p)-n)/i,A=(t.decodeHeight(e,h*r+d)-n)/i,S=(t.decodeHeight(e,h*r+p)-n)/i;return Phe(x,b,C,T,A,S)}function Phe(e,t,n,i,o,r){return t=0;--a)s=s*n+e[r+a];return s}function UZe(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Da=w_;function HE(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Hb=new ce;function VZe(e,t,n,i){let o=i.length;for(let r=0;r=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Ohe=new me;HE.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Hb);return ce.center(i,Ohe),this.computeMaximumLevelAtPosition(Ohe)>=e};HE.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function VE(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(VE.prototype,{nw:{get:function(){return this._nw||(this._nw=new VE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new VE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new VE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new VE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function jZe(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function yj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function zE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function jL(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&zE(t._nw.extent,n),s=t._ne&&zE(t._ne.extent,n),a=t._sw&&zE(t._sw.extent,n),c=t._se&&zE(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,jL(t,t._nw,n))),s&&(i=Math.max(i,jL(t,t._ne,n))),a&&(i=Math.max(i,jL(t,t._sw,n))),c&&(i=Math.max(i,jL(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];zE(a,n)&&(i=a.level)}t=t.parent}return i}function qL(e,t,n){if(!t)return;let i,o=!1;for(i=0;it.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.southt.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var am=HE;function KZe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` +${o}`),t}var bh=KZe;function Bz(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}Bz.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new Bz(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${bh(i)}`),c};Bz.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var xi=Bz;function zy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Ii(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(zy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});zy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(h=o-1);let x=g/u|0;return x>=r&&(x=r-1),l(n)?(n.x=h,n.y=x,n):new H(h,x)};var Lr=zy;var JZe=15;function xj(e){this.ellipsoid=y(e.ellipsoid,oe.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}xj.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function ZZe(e,t){let n=t.copyrightText;l(n)&&(e.credit=new wt(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Hi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(r.xmin,r.ymin),s.rectangleNortheastInMeters=new H(r.xmax,r.ymax),e.tilingScheme=new Lr(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Mf.LERC:Mf.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new am(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new am(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Hr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Rhe(e,t,n){try{let i=await t.fetchJson();ZZe(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw xi.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function Hy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new pe,l(e.url)){Q("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new xj(e);this._readyPromise=Promise.resolve(e.url).then(async function(o){let r=Se.createIfNeeded(o);r.appendForwardSlash(),l(t)&&(r=r.getDerivedResource({queryParameters:{token:t}})),n._resource=r;let s=r.getDerivedResource({queryParameters:{f:"pjson"}});return await Rhe(i,s,n),i.build(n),!0})}}Object.defineProperties(Hy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Hy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new xj(t);await Rhe(o,i);let r=new Hy(t);return o.build(r),r._resource=n,r};Hy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(bj(this,n+1,e*2,t*2))){let d=Mhe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Da({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):JZe,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===ti.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ti.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function bj(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Hy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0;){let c=a.pop(),u=$Ze(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function Mhe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<',!1)}Object.defineProperties(Tj.prototype,{url:{get:function(){return Lhe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Tj.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,c)}})})};var Aj=Tj;function Ej(){}Object.defineProperties(Ej.prototype,{credit:{get:function(){}}});Ej.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s2&&(l(i)||(i=n$e,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=i$e,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=t$e(this),this._lastTimeIndex=0}Object.defineProperties(Gy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Gy.catmullRomCoefficientMatrix=new L(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Gy.prototype.findTimeInterval=so.prototype.findTimeInterval;Gy.prototype.wrapTime=so.prototype.wrapTime;Gy.prototype.clampTime=so.prototype.clampTime;Gy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Sj=Gy;var kz={};kz.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=ne,a=i>e,c=o>e);let u=s+a+c,f,d,p,g,h,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(h=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),h!==1&&(r.push(-1),r.push(2),r.push(0),r.push(h))):u===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(h)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};kz.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,g=1/(d*u+f*p),h=t-a,x=e-s,b=(d*x+f*h)*g,C=(-p*x+u*h)*g,T=1-b-C;return l(c)?(c.x=b,c.y=C,c.z=T,c):new m(b,C,T)};kz.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var I_=kz;function Wy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=Vz(e.westIndices,o,t),this._southIndices=Vz(e.southIndices,r,t),this._eastIndices=Vz(e.eastIndices,o,t),this._northIndices=Vz(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Wy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var Uz=[];function Vz(e,t,n){Uz.length=e.length;let i=!1;for(let o=0,r=e.length;o0&&t(e[o-1],e[o])>0;return i?(Uz.sort(t),Ue.createTypedArray(n,Uz)):e}var Fhe="createVerticesFromQuantizedTerrainMesh",o$e=new gi(Fhe),r$e=new gi(Fhe,sm.maximumAsynchronousTasks);Wy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?r$e:o$e).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,x=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ue.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),T=g.center,A=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,I=p._orientedBoundingBox,O=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=g.vertexStride,N=lc.clone(g.encoding);return p._mesh=new Nf(T,C,b,g.indexCountWithoutSkirts,h,A,S,v,O,R,I,N,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var s$e=new gi("upsampleQuantizedTerrainMesh",sm.maximumAsynchronousTasks);Wy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=s$e.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:g*.5,C=u?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(A){let S=new Uint16Array(A.vertices),v=Ue.createTypedArray(S.length/3,A.indices),I;return l(A.encodedNormals)&&(I=new Uint8Array(A.encodedNormals)),new Wy({quantizedVertices:S,indices:v,encodedNormals:I,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:Ln.clone(A.orientedBoundingBox),horizonOcclusionPoint:m.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:h,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:C,childTileMask:0,credits:T,createdByUpsampling:!0})})};var vj=32767,Bhe=new m;Wy.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=vj;let o=P.clamp((n-e.south)/e.height,0,1);return o*=vj,l(this._mesh)?u$e(this,i,o):f$e(this,i,o)};function khe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var a$e=new H,c$e=new H,l$e=new H;function u$e(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),C=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return x.x*b+x.y*C+x.z*T}}}}function f$e(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let A=T.x*r[u]+T.y*r[f]+T.z*r[d];return P.lerp(e._minimumHeight,e._maximumHeight,A/vj)}}}}Wy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new d$e({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await zz(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function m$e(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=xi.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return zz(e,n);throw new de(i)}async function h$e(e,t,n){await Vhe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new am(e.tilingScheme,e.overallMaxZoom);for(let r=0;r0){let o=new wt(e.attribution);e.tileCredits.push(o)}return!0}async function zz(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=h$e(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return l(n)&&n.statusCode===404?(await Vhe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),m$e(e,n,t))}}function Eu(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),l(e.url)&&(Q("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=Eu._initializeReadyPromise(e,this))}Eu._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new Dj(e),o=Se.createIfNeeded(n);return o.appendForwardSlash(),i.lastResource=o,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await zz(i,t),i.build(t),!0};var wj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Uhe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function p$e(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Da({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function _$e(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*h,C=new DataView(t),T=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let A=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let O=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*g,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*h);let N=R.subarray(0,O),F=R.subarray(O,2*O),_=R.subarray(O*2,3*O);qn.zigZagDeltaDecode(N,F,_),a%x!==0&&(a+=x-a%x);let E=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ue.createTypedArrayFromArrayBuffer(O,t,a,E*h);a+=E*b;let D=0,M=w.length;for(let se=0;se0){let ve=Oo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(ve))for(let we=0;wed.promise))}return!l(r)&&a?c.then(()=>this.requestTileGeometry(e,t,n,i)):zhe(this,e,t,n,r,i)};function zhe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new de("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Uhe(void 0)):u=Uhe(c);let g=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(h){return l(h)?l(e._heightmapStructure)?p$e(e,h,i,t,n):_$e(e,h,i,t,n,o):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(Eu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Eu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;rthis._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r=u&&(d=(d+8)%24,f=d);se;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});cm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new cm({comparator:t,maximumLength:e});o._length=i;for(let r=0;r=2&&(this._array[0]=this._array[e-1],Whe(this,0)),this._array[e-1]=void 0,t};cm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Bj(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Whe(this,n)}return this._array[e-1]=void 0,t};cm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};cm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Bj(this,1,2)?1:2]};function Hz(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function KL(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Bj(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Ghe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=KL(e,t,i);for(o!==n&&(Hz(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(KL(e,t,r)!==o)break;Hz(e,t,r),t=r}}function Whe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function vu(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),l(e)){Q("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=$he(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(o){let r=`An error occurred while accessing ${qj(i,"",1).url}.`;return Promise.reject(new de(r))})}}Object.defineProperties(vu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});vu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash();let i=new vu;i._resource=n;try{await $he(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${qj(i,"",1).url}: ${o}`;throw new de(r)}return i};vu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Zhe=new gi("decodeGoogleEarthEnterprisePacket");vu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=qj(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Zhe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let h=u[e];f=r[e],f._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,x){return h.length-x.length});let g=p.length;for(let h=0;h1){let A=r[x.substring(0,x.length-1)];C.setParent(A)}r[x]=C}else r[x]=null}})})};vu.prototype.populateSubtree=function(e,t,n,i){let o=vu.tileXYToQuadKey(e,t,n);return jj(this,o,i)};function jj(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),jj(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),jj(e,t,s)}).finally(function(){delete a[o]})}vu.prototype.getTileInformation=function(e,t,n){let i=vu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};vu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function qj(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Gj,Wj;function $he(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Wj)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Wj=w0(n).then(function(){Gj=window.cesiumGoogleEarthDbRootParser(J$e),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Wj.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Gj.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return Zhe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Gj.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),C=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return x.x*b+x.y*C+x.z*T}}}var sQe=Uint16Array.BYTES_PER_ELEMENT,epe=Uint32Array.BYTES_PER_ELEMENT,Xj=Int32Array.BYTES_PER_ELEMENT,aQe=Float32Array.BYTES_PER_ELEMENT,Kj=Float64Array.BYTES_PER_ELEMENT;function cQe(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15)return D.x*T[v]+D.y*T[I]+D.z*T[O]}}var KE=Kb;var Ff={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},jz=new ee;function qz(){this._terrainCache={},this._lastTidy=ee.now()}qz.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};qz.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};qz.prototype.tidy=function(){if(ee.now(jz),ee.secondsDifference(jz,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i10&&delete e[o]}ee.clone(jz,this._lastTidy)}};function Xy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new wt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new qz,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe,this._ready=!1,l(e.url)){Q("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=Se.createIfNeeded(e.url),i=this,o;this._readyPromise=um.fromUrl(n).then(r=>{if(!r.terrainPresent){let s=new de(`The server ${r.url} doesn't have terrain`);return Promise.reject(s)}return xi.reportSuccess(o),i._metadata=r,i._ready=!0,!0}).catch(r=>{throw o=xi.reportError(o,i,i._errorEvent,r.message,void 0,void 0,void 0,r),r})}else if(l(e.metadata)){Q("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(Xy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Xy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new Xy(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var lQe=new gi("decodeGoogleEarthEnterprisePacket");function ipe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Ff.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Jj=Xy;var Yz,ope="AIzaSyBqCv5lozjjhtIQ_pZuj2obyAL9bTJdY28",Xz={};Xz.defaultApiKey=ope;Xz.mapTilesApiEndpoint=new Se({url:"https://tile.googleapis.com/v1/"});Xz.getDefaultApiKeyCredit=function(e){if(e===ope){if(!l(Yz)){let t=` This application is using CesiumJS's default Google Maps API key. Please assign Cesium.GoogleMaps.defaultApiKey with your API key for the Google Maps Platform.`;Yz=new wt(t,!0),Yz._isDefaultToken=!0}return Yz}};var Jb=Xz;function fQe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var tN=fQe;var ype={},dQe=32.184,mQe=2451545,rpe=-.0529921,spe=-.1059842,ape=13.0120009,cpe=13.3407154,lpe=.9856003,upe=26.4057084,fpe=13.064993,dpe=.3287146,mpe=1.7484877,hpe=-.1589763,ppe=.0036096,_pe=.1643573,gpe=12.9590088,Zj=new ee;ype.ComputeMoon=function(e,t){l(e)||(e=ee.now()),Zj=ee.addSeconds(e,dQe,Zj);let n=ee.totalDays(Zj)-mQe,i=n/Zn.DAYS_PER_JULIAN_CENTURY,o=(125.045+rpe*n)*P.RADIANS_PER_DEGREE,r=(250.089+spe*n)*P.RADIANS_PER_DEGREE,s=(260.008+ape*n)*P.RADIANS_PER_DEGREE,a=(176.625+cpe*n)*P.RADIANS_PER_DEGREE,c=(357.529+lpe*n)*P.RADIANS_PER_DEGREE,u=(311.589+upe*n)*P.RADIANS_PER_DEGREE,f=(134.963+fpe*n)*P.RADIANS_PER_DEGREE,d=(276.617+dpe*n)*P.RADIANS_PER_DEGREE,p=(34.226+mpe*n)*P.RADIANS_PER_DEGREE,g=(15.134+hpe*n)*P.RADIANS_PER_DEGREE,h=(119.743+ppe*n)*P.RADIANS_PER_DEGREE,x=(239.961+_pe*n)*P.RADIANS_PER_DEGREE,b=(25.053+gpe*n)*P.RADIANS_PER_DEGREE,C=Math.sin(o),T=Math.sin(r),A=Math.sin(s),S=Math.sin(a),v=Math.sin(c),I=Math.sin(u),O=Math.sin(f),R=Math.sin(d),N=Math.sin(p),F=Math.sin(g),_=Math.sin(h),E=Math.sin(x),w=Math.sin(b),D=Math.cos(o),M=Math.cos(r),B=Math.cos(s),V=Math.cos(a),U=Math.cos(c),G=Math.cos(u),k=Math.cos(f),Y=Math.cos(d),j=Math.cos(p),$=Math.cos(g),W=Math.cos(h),K=Math.cos(x),J=Math.cos(b),he=(269.9949+.0031*i-3.8787*C-.1204*T+.07*A-.0172*S+.0072*I-.0052*F+.0043*w)*P.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*D+.0239*M-.0278*B+.0068*V-.0029*G+9e-4*k+8e-4*$-9e-4*J)*P.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*T-.0642*A+.0158*S+.0252*v-.0066*I-.0047*O-.0046*R+.0028*N+.0052*F+.004*_+.0019*E-.0044*w)*P.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*D*rpe+.1208*M*spe-.0642*B*ape+.0158*V*cpe+.0252*U*lpe-.0066*G*upe-.0047*k*fpe-.0046*Y*dpe+.0028*j*mpe+.0052*$*hpe+.004*W*ppe+.0019*K*_pe-.0044*J*gpe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new tN),t.rightAscension=he,t.declination=ge,t.rotation=se,t.rotationRate=_e,t};var nN=ype;function xpe(e){(!l(e)||typeof e!="function")&&(e=nN.ComputeMoon),this._computeFunction=e}var hQe=new m,pQe=new m,_Qe=new m;function gQe(e,t,n){let i=hQe;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=_Qe;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,pQe);return l(n)||(n=new Z),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var yQe=new Z,xQe=new Be;xpe.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=gQe(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Be.fromAxisAngle(m.UNIT_Z,o,xQe),s=Z.fromQuaternion(Be.conjugate(r,r),yQe);return Z.multiply(s,i,i)};var iN=xpe;var oN={};oN.type=void 0;oN.getRequiredDataPoints=fe.throwInstantiationError;oN.interpolateOrderZero=fe.throwInstantiationError;oN.interpolate=fe.throwInstantiationError;var $j=oN;function Qj(e){this._url=Se.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Qj.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Qj.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Yy.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var rN=Qj;function eq(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,pd.defaultAccessToken),n=Se.createIfNeeded(y(e.server,pd.defaultServer));n.appendForwardSlash();let i=pd.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(wt.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});l(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new rN(o)}Object.defineProperties(eq.prototype,{credit:{get:function(){}}});eq.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var sN=eq;var bQe={SHIFT:0,CTRL:1,ALT:2},la=Object.freeze(bQe);function Kz(){fe.throwInstantiationError()}Object.defineProperties(Kz.prototype,{ellipsoid:{get:fe.throwInstantiationError}});Kz.prototype.project=fe.throwInstantiationError;Kz.prototype.unproject=fe.throwInstantiationError;var tq=Kz;var nq=[],iq=[];function CQe(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=nq,u=iq,f,d;for(f=0;f=a||t(g,h,n)<=0)?(e[p]=g,++f):d=o)return;let r=Math.floor((i+o)*.5);oq(e,t,n,i,r),oq(e,t,n,r+1,o),CQe(e,t,n,i,r,o)}function TQe(e,t,n){let i=e.length,o=Math.ceil(i*.5);nq.length=o,iq.length=o,oq(e,t,n,0,i-1),nq.length=0,iq.length=0}var P_=TQe;function JE(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(JE.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});JE.prototype.findTimeInterval=so.prototype.findTimeInterval;JE.prototype.wrapTime=so.prototype.wrapTime;JE.prototype.clampTime=so.prototype.clampTime;JE.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;si){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,Jz);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,Jz),Jz)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});dc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new dc(e,t)};var Cpe=new m;dc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Cpe),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var EQe=new m;dc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,EQe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Cpe),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var SQe=new m;dc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return lr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,SQe),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n0?(o=Math.sqrt(o)+this._horizonDistance,s-n?lr.PARTIAL:lr.FULL))}}return lr.NONE};var Zz=new m;dc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,Zz),Zz),c=-m.dot(a,o),u=dc._anyRotationVector(o,a,c),f=dc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;gi.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var IQe=new m;dc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,IQe);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>P.EPSILON13)return m.normalize(s,new m)}return o};var sq=new m,DQe=new m,$z=new m,bpe=new m;dc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,sq),s=m.clone(e.center,DQe),a=e.radius,c=m.subtract(s,r,$z),u=m.magnitudeSquared(c),f=a*a;if(uOpenStreetMap contributors',!1)}Object.defineProperties(aq.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});aq.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:_t(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var cq=aq;var PQe={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},lq=PQe;var OQe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},uq=OQe;var RQe=new m;function MQe(e,t,n,i){let o=z0(e,t,n,i,RQe);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var fq=MQe;function Tpe(){fe.throwInstantiationError()}Tpe.prototype.getURL=fe.throwInstantiationError;var dq=Tpe;var LQe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(LQe);function Ky(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=(t.clientX-o.left)*(i.offsetWidth/o.width),n.y=(t.clientY-o.top)*(i.offsetHeight/o.height),n}function yq(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Zb(e){if(e.shiftKey)return la.SHIFT;if(e.ctrlKey)return la.CTRL;if(e.altKey)return la.ALT}var ps={LEFT:0,MIDDLE:1,RIGHT:2};function wu(e,t,n,i){function o(r){i(e,r)}Wt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function NQe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Wt.supportsPointerEvents()?(wu(e,"pointerdown",t,zQe),wu(e,"pointerup",t,Rpe),wu(e,"pointermove",t,HQe),wu(e,"pointercancel",t,Rpe)):(wu(e,"mousedown",t,Mpe),wu(e,"mouseup",n,Lpe),wu(e,"mousemove",n,Npe),wu(e,"touchstart",t,UQe),wu(e,"touchend",n,wpe),wu(e,"touchmove",n,VQe),wu(e,"touchcancel",n,wpe)),wu(e,"dblclick",t,BQe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",wu(e,i,t,kQe)}function FQe(e){let t=e._removalFunctions;for(let n=0;nfm.mouseEmulationIgnoreMilliseconds}function gq(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Zb(t),o=e.getInputAction(Cn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function UQe(e,t){xq(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;iJQe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function $Qe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function QQe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var eet=1.0000010178*Pa,tet=100.46645683*Bf,net=129597742283429e-5*Du,kpe=16002,Upe=21863,Vpe=32004,zpe=10931,Hpe=14529,Gpe=16368,Wpe=15318,jpe=32794,iet=64*1e-7*Pa,oet=-152*1e-7*Pa,ret=62*1e-7*Pa,set=-8*1e-7*Pa,aet=32*1e-7*Pa,cet=-41*1e-7*Pa,uet=19*1e-7*Pa,fet=-11*1e-7*Pa,det=-150*1e-7*Pa,met=-46*1e-7*Pa,het=68*1e-7*Pa,pet=54*1e-7*Pa,_et=14*1e-7*Pa,get=24*1e-7*Pa,yet=-28*1e-7*Pa,xet=22*1e-7*Pa,qpe=10,Ype=16002,Xpe=21863,Kpe=10931,Jpe=1473,Zpe=32004,$pe=4387,Qpe=73,bet=-325*1e-7,Cet=-322*1e-7,Tet=-79*1e-7,Aet=232*1e-7,Eet=-52*1e-7,vet=97*1e-7,wet=55*1e-7,Iet=-41*1e-7,Det=-105*1e-7,Pet=-137*1e-7,Oet=258*1e-7,Ret=35*1e-7,Met=-116*1e-7,Let=-88*1e-7,Net=-112*1e-7,Fet=-80*1e-7,ZE=new ee(0,0,Jn.TAI);function Bet(e,t){t_e(e,ZE);let i=(ZE.dayNumber-e4.dayNumber+(ZE.secondsOfDay-e4.secondsOfDay)/Zn.SECONDS_PER_DAY)/(Zn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=eet+iet*Math.cos(kpe*o)+det*Math.sin(kpe*o)+oet*Math.cos(Upe*o)+met*Math.sin(Upe*o)+ret*Math.cos(Vpe*o)+het*Math.sin(Vpe*o)+set*Math.cos(zpe*o)+pet*Math.sin(zpe*o)+aet*Math.cos(Hpe*o)+_et*Math.sin(Hpe*o)+cet*Math.cos(Gpe*o)+get*Math.sin(Gpe*o)+uet*Math.cos(Wpe*o)+yet*Math.sin(Wpe*o)+fet*Math.cos(jpe*o)+xet*Math.sin(jpe*o),s=tet+net*i+bet*Math.cos(qpe*o)+Det*Math.sin(qpe*o)+Cet*Math.cos(Ype*o)+Pet*Math.sin(Ype*o)+Tet*Math.cos(Xpe*o)+Oet*Math.sin(Xpe*o)+Aet*Math.cos(Kpe*o)+Ret*Math.sin(Kpe*o)+Eet*Math.cos(Jpe*o)+Met*Math.sin(Jpe*o)+vet*Math.cos(Zpe*o)+Let*Math.sin(Zpe*o)+wet*Math.cos($pe*o)+Net*Math.sin($pe*o)+Iet*Math.cos(Qpe*o)+Fet*Math.sin(Qpe*o),a=.0167086342-.0004203654*i,c=102.93734808*Bf+11612.3529*Du*i,u=469.97289*Du*i,f=174.87317577*Bf-8679.27034*Du*i;return n_e(r,a,u,c,f,s,t)}function i_e(e,t){t_e(e,ZE);let i=(ZE.dayNumber-e4.dayNumber+(ZE.secondsOfDay-e4.secondsOfDay)/Zn.SECONDS_PER_DAY)/Zn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Bf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Bf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Bf,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Bf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Bf+Du*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*Bf+Du*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*Bf+Du*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Bf+Du*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Bf-Du*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,O=4*C,R=6*C,N=2*A,F=3*A,_=4*A,E=2*T;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-A)-235.6*Math.cos(A)+218.1*Math.cos(I-S)+181*Math.cos(I+A),c+=.014216*Math.cos(I-A)+.008551*Math.cos(I-N)-.001383*Math.cos(A)+.001356*Math.cos(I+A)-.001147*Math.cos(O-F)-914e-6*Math.cos(O-N)+869e-6*Math.cos(I-S-A)-627e-6*Math.cos(I)-394e-6*Math.cos(O-_)+282e-6*Math.cos(I-S-N)-279e-6*Math.cos(C-A)-236e-6*Math.cos(N)+231e-6*Math.cos(O)+229e-6*Math.cos(R-_)-201e-6*Math.cos(N-E),f+=486.26*Math.cos(I-E)-40.13*Math.cos(I)+37.51*Math.cos(E)+25.73*Math.cos(N-E)+19.97*Math.cos(I-S-E),p+=-55609*Math.sin(I-A)-34711*Math.sin(I-N)-9792*Math.sin(A)+9385*Math.sin(O-F)+7505*Math.sin(O-N)+5318*Math.sin(I+A)+3484*Math.sin(O-_)-3417*Math.sin(I-S-A)-2530*Math.sin(R-_)-2376*Math.sin(I)-2075*Math.sin(I-F)-1883*Math.sin(N)-1736*Math.sin(R-5*A)+1626*Math.sin(S)-1370*Math.sin(R-F),h+=-5392*Math.sin(I-E)-540*Math.sin(S)-441*Math.sin(I)+423*Math.sin(E)-288*Math.sin(N-E),b+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-A)-662.5*Math.sin(S)+396.3*Math.sin(A)-218*Math.sin(I-S);let w=2*v,D=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(I-E+v)*i+.614*Math.cos(I-E-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(I-E+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(D)*r+4e-5*Math.cos(w)*r;let M=2.116*Math.sin(v)*i-.111*Math.sin(I-E-v)*i-.0015*Math.sin(v)*o;p+=M,b+=M,h+=-520.77*Math.sin(v)*i+13.66*Math.sin(I-E+v)*i+1.12*Math.sin(I-v)*i-1.06*Math.sin(E-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(I-E+w)*o-.015*Math.sin(I-E+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(D)*r-9e-4*Math.sin(w)*r,a*=qQe;let B=u+f*Du,V=d+p*Du,U=x+b*Du,G=g+h*Du;return n_e(a,c,B,V,G,U,t)}var e_e=.012300034,ket=e_e/(e_e+1)*-1;function Uet(e,t){return t=i_e(e,t),m.multiplyByScalar(t,ket,t)}var o_e=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),lN=new m;Cq.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),lN=Bet(e,lN),t=m.negate(lN,t),Uet(e,lN),m.subtract(t,lN,t),Z.multiplyByVector(o_e,t,t),t};Cq.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=i_e(e,t),Z.multiplyByVector(o_e,t,t),t};var Jy=Cq;function Vet(e,t,n,i,o,r,s){let a=Di.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,h=i.green,x=i.blue,b=i.alpha;if(z.equals(n,i)){for(c=0;c0?new Array(o):void 0;for(i=0;i0&&(m.pack(I,d,S),S+=3,h=n[u-1],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha)),c&&u===f-1)break;m.pack(I,d,S),S+=3,l(n)&&(h=n[u],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha))}}let b=new pn;b.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,T=Ue.createTypedArray(p,C),A=0;for(u=0;ua?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Wet(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Sq=$b;function jet(e,t){this.rectangle=e,this.maxLevel=t}function vq(e){this.ellipsoid=y(e.ellipsoid,oe.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}vq.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function qet(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Hi({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Hr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r(i.build(n),!0))}}Object.defineProperties(Qy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Qy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new vq(t),i=Se.createIfNeeded(e);await r_e(n,i);let o=new Qy(t);return n.build(o),o._resource=i,o};Qy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Da({buffer:id(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Xet(a,e,t,n),structure:a._terrainDataStructure})})};Qy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};dm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};dm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Ge({sources:[r]})),typeof s=="string"&&(s=new Ge({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Zt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function Pq(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,mtt),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function a_e(e){if(e._viewportDirty){let t=e._viewport;L.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),L.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function ptt(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?L.inverse(e._projection,e._inverseProjection):L.clone(L.ZERO,e._inverseProjection))}function _tt(e){e._modelViewDirty&&(e._modelViewDirty=!1,L.multiplyTransformation(e._view,e._model,e._modelView))}function gtt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,L.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function ytt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,L.inverse(e.modelView,e._inverseModelView))}function xtt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,L.inverse(e.modelView3D,e._inverseModelView3D))}function btt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,L.multiply(e._projection,e._view,e._viewProjection))}function Ctt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,L.inverse(e.viewProjection,e._inverseViewProjection))}function Ttt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,L.multiply(e._projection,e.modelView,e._modelViewProjection))}function Att(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function Ett(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,L.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Stt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,L.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function vtt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,L.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function wtt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;L.getMatrix3(e.inverseModelView,t),Z.getRotation(t,t),Z.transpose(t,t)}}function Itt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;L.getMatrix3(e.inverseModelView3D,t),Z.getRotation(t,t),Z.transpose(t,t)}}function Dtt(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,L.getMatrix3(e.inverseModelView,e._inverseNormal),Z.getRotation(e._inverseNormal,e._inverseNormal))}function Ptt(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,L.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Z.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var c_e=new m;function l_e(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,L.multiplyByPoint(e.inverseModel,e._cameraPosition,c_e),jn.fromCartesian(c_e,e._encodedCameraPositionMC))}var Ott=new m,Rtt=new m,Mtt=new m,Ltt=new m,Ntt=new me,Ftt=new m,Btt=new L;function ktt(e,t,n,i,o,r,s,a){let c=Ott;c.x=e.y,c.y=e.z,c.z=e.x;let u=Rtt;u.x=n.y,u.y=n.z,u.z=n.x;let f=Mtt;f.x=i.y,f.y=i.z,f.z=i.x;let d=Ltt;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,Ntt);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,Ftt),x=Mt.eastNorthUpToFixedFrame(h,g,Btt);return L.multiplyByPointAsVector(x,u,u),L.multiplyByPointAsVector(x,f,f),L.multiplyByPointAsVector(x,d,d),l(a)||(a=new L),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function Oq(e){e._view3DDirty&&(e._mode===ne.SCENE3D?L.clone(e._view,e._view3D):ktt(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),L.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function u_e(e){e._inverseView3DDirty&&(L.inverseTransformation(e.view3D,e._inverseView3D),L.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var gN=QE;function Pu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):Utt(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Wn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new hN(this),this._textureCache=new pN;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Gt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Gt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Gt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Gt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Gt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Gt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Gt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Gt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Gt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Gt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Gt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Gt._minimumAliasedLineWidth=f[0],Gt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Gt._minimumAliasedPointSize=d[0],Gt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Gt._maximumViewportWidth=p[0],Gt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Gt._highpFloatSupported=g.precision!==0;let h=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Gt._highpIntSupported=h.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Nr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Nr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Nr(u,["OES_element_index_uint"]),this._depthTexture=!!Nr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Nr(u,["EXT_frag_depth"]),this._debugShaders=Nr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Nr(u,["OES_texture_float"]),this._textureHalfFloat=!!Nr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Nr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Nr(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Nr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Nr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Nr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Nr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Nr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Nr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Nr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Nr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Nr(u,["EXT_texture_compression_bptc"]),sl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?Nr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Gt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,C,T,A,S,v,I,O,R,N;if(c){let w=this;b=function(){return w._gl.createVertexArray()},C=function(D){w._gl.bindVertexArray(D)},T=function(D){w._gl.deleteVertexArray(D)},A=function(D,M,B,V,U){u.drawElementsInstanced(D,M,B,V,U)},S=function(D,M,B,V){u.drawArraysInstanced(D,M,B,V)},v=function(D,M){u.vertexAttribDivisor(D,M)},I=function(D){u.drawBuffers(D)}}else O=Nr(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},C=function(w){O.bindVertexArrayOES(w)},T=function(w){O.deleteVertexArrayOES(w)}),R=Nr(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,D,M,B,V){R.drawElementsInstancedANGLE(w,D,M,B,V)},S=function(w,D,M,B){R.drawArraysInstancedANGLE(w,D,M,B)},v=function(w,D){R.vertexAttribDivisorANGLE(w,D)}),N=Nr(u,["WEBGL_draw_buffers"]),l(N)&&(I=function(w){N.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=C,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=I,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!N,Gt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Gt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new gN,_=new mc(this),E=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=E,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new de("The browser supports WebGL, but initialization failed.");return r}function Vtt(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function ztt(e,t,n,i){let o=`${Vtt(e,i)}: ${t.name}(`;for(let r=0;r=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Wtt(this._originalGLContext,e?Htt:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Lt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Lt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Lt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ha({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return jtt}}});function f_e(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var Rq;typeof WebGLRenderingContext<"u"&&(Rq=[te.BACK]);function Mq(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Rq;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var qtt=new ci;Pu.prototype.clear=function(e,t){e=y(e,qtt),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);f_e(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);Mq(this,c),n.clear(i)};function Ytt(e,t,n,i,o){Mq(e,t),f_e(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Xtt(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,L.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(a=y(a,r.numberOfVertices),c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Pu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),Ytt(this,o,t,n,r),Xtt(this,e,n,i)};Pu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Rq;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let c=ct.createTypedArray(ct.RGBA,a,o,r);return Mq(this,s),t.readPixels(n,i,o,r,ct.RGBA,Je.toWebGLConstant(a,this),c),c};var d_e={position:0,textureCoordinates:1};Pu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ft({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fe.TRIANGLES});e=ri.fromGeometry({context:this,geometry:t,attributeLocations:d_e,bufferUsage:ke.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Pu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fe.TRIANGLES,renderState:t.renderState,shaderProgram:Zt.fromCache({context:this,vertexShaderSource:Qb,fragmentShaderSource:e,attributeLocations:d_e}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Pu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function Lq(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(Lq.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});Lq.prototype.destroy=function(){delete this._pickObjects[this.key]};Pu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Lq(this._pickObjects,t,z.fromRgba(t))};Pu.prototype.isDestroyed=function(){return!1};Pu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Pu._deprecationWarning=Q;var yN=Pu;function Ktt(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Se.createIfNeeded(t.positiveX).fetchImage(i),Se.createIfNeeded(t.negativeX).fetchImage(i),Se.createIfNeeded(t.positiveY).fetchImage(i),Se.createIfNeeded(t.negativeY).fetchImage(i),Se.createIfNeeded(t.positiveZ).fetchImage(i),Se.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Ha({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var xN=Ktt;var eS=`#ifdef MRT +layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1; +#else +layout (location = 0) out vec4 out_FragColor; +#endif - // Outer ellipsoid - vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); +uniform vec4 u_bgColor; +uniform sampler2D u_depthTexture; - // Exit early if the outer ellipsoid was missed. - if (outerIntersect.x == NO_HIT) { +in vec2 v_textureCoordinates; + +void main() +{ + if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) + { +#ifdef MRT + out_FragData_0 = u_bgColor; + out_FragData_1 = vec4(u_bgColor.a); +#else + out_FragColor = u_bgColor; +#endif return; } + + discard; +} +`;var R_=`uniform vec3 u_radiiAndDynamicAtmosphereColor; - // Inner ellipsoid - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - // When the ellipsoid is perfectly thin it's necessary to sandwich the - // inner ellipsoid intersection inside the outer ellipsoid intersection. - - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the ellipsoid to be invisible because it will think the ray - // is still inside the inner (negative) ellipsoid after exiting the - // outer (positive) ellipsoid. +uniform float u_atmosphereLightIntensity; +uniform float u_atmosphereRayleighScaleHeight; +uniform float u_atmosphereMieScaleHeight; +uniform float u_atmosphereMieAnisotropy; +uniform vec3 u_atmosphereRayleighCoefficient; +uniform vec3 u_atmosphereMieCoefficient; - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. +const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. +const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. +const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); - vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); +/** + * Rational approximation to tanh(x) +*/ +float approximateTanh(float x) { + float x2 = x * x; + return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); +} - if (innerIntersect == vec2(NO_HIT)) { - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); - } else { - // When the ellipsoid is very large and thin it's possible for floating - // point math to cause the ray to intersect the inner ellipsoid before - // the outer ellipsoid. To prevent this from happening, clamp innerIntersect - // to outerIntersect and sandwhich the intersections like described above. - // - // In theory a similar fix is needed for cylinders, however it's more - // complicated to implement because the inner shape is allowed to be - // intersected first. - innerIntersect.x = max(innerIntersect.x, outerIntersect.x); - innerIntersect.y = min(innerIntersect.y, outerIntersect.y); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - } - #endif +/** + * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as + * the transmittance value for the ray. + * + * @param {czm_ray} primaryRay The ray from the camera to the position. + * @param {float} primaryRayLength The length of the primary ray. + * @param {vec3} lightDirection The direction of the light to calculate the scattering from. + * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. + * @param {vec3} mieColor The variable the Mie scattering will be written to. + * @param {float} opacity The variable the transmittance will be written to. + * @glslFunction + */ +void computeScattering( + czm_ray primaryRay, + float primaryRayLength, + vec3 lightDirection, + float atmosphereInnerRadius, + out vec3 rayleighColor, + out vec3 mieColor, + out float opacity +) { - // Flip the ray because the intersection function expects a cone growing towards +Z. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - Ray flippedRay = outerRay; - flippedRay.dir.z *= -1.0; - flippedRay.pos.z *= -1.0; - #endif + // Initialize the default scattering amounts to 0. + rayleighColor = vec3(0.0); + mieColor = vec3(0.0); + opacity = 0.0; - // Bottom cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) - vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) - vec2 bottomConeIntersection = intersectZPlane(flippedRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) - vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); - #endif + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - // Top cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) - vec2 topConeIntersection = intersectZPlane(ray); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #endif + vec3 origin = vec3(0.0); - // Wedge - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #endif -} -`;var $x=`// Main intersection function for Voxel scenes. -// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl -// for the definition of intersectShape. The appropriate function is selected -// based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. -// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, -// getFirstIntersection, initializeIntersections, nextIntersection. + // Calculate intersection from the camera to the outer ring of the atmosphere. + czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); -/* Intersection defines (set in Scene/VoxelRenderResources.js) -#define INTERSECTION_COUNT ### -*/ + // Return empty colors if no intersection with the atmosphere geometry. + if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { + return; + } -RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { - // Do a ray-shape intersection to find the exact starting and ending points. - intersectShape(ray, ix); + // To deal with smaller values of PRIMARY_STEPS (e.g. 4) + // we implement a split strategy: sky or horizon. + // For performance reasons, instead of a if/else branch + // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 + float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); + // Value close to 0.0: close to the horizon + // Value close to 1.0: above in the sky + float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); + + // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. + float start_0 = primaryRayAtmosphereIntersect.start; + primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); + // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. + primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); - // Exit early if the positive shape was completely missed or behind the ray. - RayShapeIntersection intersection = getFirstIntersection(ix); - if (intersection.entry.w == NO_HIT) { - // Positive shape was completely missed - so exit early. - return intersection; - } + // For the number of ray steps, distinguish inside or outside atmosphere (outer space) + // (1) from outer space we have to use more ray steps to get a realistic rendering + // (2) within atmosphere we need fewer steps for faster rendering + float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters + float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); + int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. + int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - // Clipping planes - #if defined(CLIPPING_PLANES) - intersectClippingPlanes(ray, ix); - #endif + // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. + float rayPositionLength = primaryRayAtmosphereIntersect.start; + // (1) Outside the atmosphere: constant rayStepLength + // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps + float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; + float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); + float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); - // Depth - #if defined(DEPTH_TEST) - intersectDepth(screenCoord, ray, ix); - #endif + vec3 rayleighAccumulation = vec3(0.0); + vec3 mieAccumulation = vec3(0.0); + vec2 opticalDepth = vec2(0.0); + vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); - // Find the first intersection that's in front of the ray - #if (INTERSECTION_COUNT > 1) - initializeIntersections(ix); - for (int i = 0; i < INTERSECTION_COUNT; ++i) { - intersection = nextIntersection(ix); - if (intersection.exit.w > 0.0) { - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - break; - } + // Sample positions on the primary ray. + for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { + + // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= PRIMARY_STEPS) { + break; } - #else - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - #endif - return intersection; -} -`;var IL=`/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_HAS_SHAPE_BOUNDS -*/ + // Calculate sample position along viewpoint ray. + vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); -#if defined(BOX_HAS_SHAPE_BOUNDS) - uniform vec3 u_boxUvToShapeUvScale; - uniform vec3 u_boxUvToShapeUvTranslate; -#endif + // Calculate height of sample position above ellipsoid. + float sampleHeight = length(samplePosition) - atmosphereInnerRadius; -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else - return positionUv; -#endif -} + // Calculate and accumulate density of particles at the sample position. + vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; + opticalDepth += sampleDensity; -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else - return shapeUv; -#endif -} -`;var PL=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED -*/ + // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. + czm_ray lightRay = czm_ray(samplePosition, lightDirection); + czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - uniform vec2 u_cylinderShapeUvAngleMinMax; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - uniform float u_cylinderShapeUvAngleRangeZeroMid; -#endif + float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); + float lightPositionLength = 0.0; -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] + vec2 lightOpticalDepth = vec2(0.0); - // Compute radius - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) - float radius = 1.0; - #else - float radius = length(positionLocal.xy); // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset - #endif - #endif + // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. + for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { - // Compute height - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - float height = 1.0; - #else - float height = positionUv.z; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset - #endif - #endif + // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (j >= LIGHT_STEPS) { + break; + } - // Compute angle - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - float angle = 1.0; - #else - float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. - angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); - #endif + // Calculate sample position along light ray. + vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) - angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; - #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; - #endif + // Calculate height of the light sample position above ellipsoid. + float lightHeight = length(lightPosition) - atmosphereInnerRadius; - angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset - #endif - #endif + // Calculate density of photons at the light sample position. + lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; - return vec3(radius, height, angle); -} -`;var OL=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_IS_SPHERE -*/ + // Increment distance on light ray. + lightPositionLength += lightStepLength; + } -uniform vec3 u_ellipsoidRadiiUv; // [0,1] -#if !defined(ELLIPSOID_IS_SPHERE) - uniform vec3 u_ellipsoidInverseRadiiSquaredUv; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - uniform float u_ellipsoidInverseHeightDifferenceUv; - uniform vec2 u_ellipseInnerRadiiUv; // [0,1] -#endif + // Compute attenuation via the primary ray and the light ray. + vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -// robust iterative solution without trig functions -// https://github.com/0xfaded/ellipse_demo/issues/1 -// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse -// Pro: Good when radii.x ~= radii.y -// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse -// Con: Inaccurate with exterior points and thin ellipses -float ellipseDistanceIterative (vec2 pos, vec2 radii) { - vec2 p = abs(pos); - vec2 invRadii = 1.0 / radii; - vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; - vec2 t = vec2(0.70710678118); // sqrt(2) / 2 - vec2 v = radii * t; + // Accumulate the scattering. + rayleighAccumulation += sampleDensity.x * attenuation; + mieAccumulation += sampleDensity.y * attenuation; - const int iterations = 3; - for (int i = 0; i < iterations; ++i) { - vec2 e = a * pow(t, vec2(3.0)); - vec2 q = normalize(p - e) * length(v - e); - t = normalize((q + e) * invRadii); - v = radii * t; + // Increment distance on primary ray. + rayPositionLength += (rayStepLength += rayStepLengthIncrease); } - return length(v * sign(pos) - pos) * sign(p.y - v.y); -} -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - // Compute position and normal. - // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). - // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. - vec3 positionLocal = positionUv * 2.0 - 1.0; - #if defined(ELLIPSOID_IS_SPHERE) - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; - vec3 normal = normalize(posEllipsoid); - #else - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; - vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal - #endif + // Compute the scattering amount. + rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; + mieColor = u_atmosphereMieCoefficient * mieAccumulation; - // Compute longitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - float longitude = 1.0; - #else - float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; + // Compute the transmittance i.e. how much light is passing through the atmosphere. + opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); +} - // Correct the angle when max < min - // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); - #endif +vec4 computeAtmosphereColor( + vec3 positionWC, + vec3 lightDirection, + vec3 rayleighColor, + vec3 mieColor, + float opacity +) { + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) - longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; - #endif - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) - longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; - #endif + float cosAngle = dot(cameraToPositionWCDirection, lightDirection); + float cosAngleSq = cosAngle * cosAngle; - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; - #endif - #endif + float G = u_atmosphereMieAnisotropy; + float GSq = G * G; - // Compute latitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) - float latitude = 1.0; - #else - float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; - #endif - #endif + // The Rayleigh phase function. + float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); + // The Mie phase function. + float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); - // Compute height - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - // TODO: This breaks down when minBounds == maxBounds. To fix it, this - // function would have to know if ray is intersecting the front or back of the shape - // and set the shape space position to 1 (front) or 0 (back) accordingly. - float height = 1.0; - #else - #if defined(ELLIPSOID_IS_SPHERE) - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; - #else - float height = length(posEllipsoid); - #endif - #else - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). - // This is an optimization so that math can be done with ellipses instead of ellipsoids. - vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); - float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; - #else - // TODO: this is probably not correct - float height = length(posEllipsoid); - #endif - #endif - #endif + // The final color is generated by combining the effects of the Rayleigh and Mie scattering. + vec3 rayleigh = rayleighPhase * rayleighColor; + vec3 mie = miePhase * mieColor; - return vec3(longitude, latitude, height); + vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; + + return vec4(color, opacity); } -`;var RL=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js -#define OCTREE_FLAG_INTERNAL 0 -#define OCTREE_FLAG_LEAF 1 -#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 +`;var bN=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; -#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} -uniform sampler2D u_octreeInternalNodeTexture; -uniform vec2 u_octreeInternalNodeTexelSizeUv; -uniform int u_octreeInternalNodeTilesPerRow; -#if (SAMPLE_COUNT > 1) -uniform sampler2D u_octreeLeafNodeTexture; -uniform vec2 u_octreeLeafNodeTexelSizeUv; -uniform int u_octreeLeafNodeTilesPerRow; -#endif +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} -struct OctreeNodeData { - int data; - int flag; -}; - -struct TraversalData { - ivec4 octreeCoords; - int parentOctreeIndex; -}; - -struct SampleData { - int megatextureIndex; - ivec4 tileCoords; - vec3 tileUv; - #if (SAMPLE_COUNT > 1) - float weight; - #endif -}; - -// Integer mod: For WebGL1 only -int intMod(in int a, in int b) { - return a - (b * (a / b)); -} -int normU8_toInt(in float value) { - return int(value * 255.0); -} -int normU8x2_toInt(in vec2 value) { - return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { - return float(normU8x2_toInt(value)) / 65535.0; +vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) +{ + float a = roughness * roughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; } -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { - vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); +float G1_Smith(float NdotV, float k) +{ + return NdotV / (NdotV * (1.0 - k) + k); +} - OctreeNodeData data; - data.data = normU8x2_toInt(texData.xy); - data.flag = normU8x2_toInt(texData.zw); - return data; +float G_Smith(float roughness, float NdotV, float NdotL) +{ + float k = roughness * roughness / 2.0; + return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); } -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { - int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; - int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; - int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - return getOctreeNodeData(octreeUv); +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = G_Smith(roughness, NdotV, NdotL); + float G_Vis = G * VdotH / (NdotH * NdotV); + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + return vec2(A, B) / float(NumSamples); } -int getOctreeParentIndex(in int octreeIndex) { - int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; - int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); - int parentOctreeIndex = normU8x2_toInt(parentData.xy); - return parentOctreeIndex; +void main() +{ + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } +`;var CN=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; -/** -* Convert a position in the uv-space of the tileset bounding shape -* into the uv-space of a tile within the tileset -*/ -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { - // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) - float dimAtLevel = pow(2.0, float(octreeCoords.w)); - return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); } -void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { - sampleData.megatextureIndex = data.data; - sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); } -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { - int leafIndex = data.data; - int leafNodeTexelCount = 2; - // Adding 0.5 moves to the center of the texel - float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; - float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - // Get an interpolation weight and a flag to determine whether to read the parent texture - vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); - vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); - float lerp = normU8x2_toFloat(leafData0.xy); - sampleDatas[0].weight = 1.0 - lerp; - sampleDatas[1].weight = lerp; - // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT - sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; - sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - // Get megatexture indices for both samples - vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); - vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); - sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); - sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; } -#endif -OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { - float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); - vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; - vec3 end = start + vec3(sizeAtLevel); - OctreeNodeData childData; +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - // Find out which octree child contains the position - // 0 if before center, 1 if after - vec3 center = 0.5 * (start + end); - vec3 childCoord = step(center, shapePosition); +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); - // Get octree coords for the next level down - ivec4 octreeCoords = traversalData.octreeCoords; - traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); +} - if (childData.flag != OCTREE_FLAG_INTERNAL) { - // leaf tile - stop traversing - break; - } +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; - // interior tile - keep going deeper - start = mix(start, center, childCoord); - end = mix(center, end, childCoord); - traversalData.parentOctreeIndex = childData.data; + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } } - return childData; + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; } -/** -* Transform a given position to an octree tile coordinate and a position within that tile, -* and find the corresponding megatexture index and texture coordinates -*/ -void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { - traversalData.octreeCoords = ivec4(0); - traversalData.parentOctreeIndex = 0; +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } - OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); - if (nodeData.flag != OCTREE_FLAG_LEAF) { - nodeData = traverseOctreeDownwards(shapePosition, traversalData); + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; } + return intersected; +} - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); - #endif +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); } -bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { - return clamp(v, minVal, maxVal) == v; +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); } -bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { - vec3 tileUv = getTileUv(shapePosition, octreeCoords); - bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); - // Assume (!) the position is always inside the root tile. - return inside || octreeCoords.w == 0; -} +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; -void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { - if (insideTile(shapePosition, traversalData.octreeCoords)) { - for (int i = 0; i < SAMPLE_COUNT; i++) { - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - } - return; +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); } + return k * sum.x * sum.y; +} - // Go up tree until we find a parent tile containing shapePosition - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - traversalData.octreeCoords.xyz /= 2; - traversalData.octreeCoords.w -= 1; +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection - if (insideTile(shapePosition, traversalData.octreeCoords)) { - break; - } +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} - traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); } - // Go down tree - OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); - #endif -} -`;var ML=`// See Octree.glsl for the definitions of SampleData and intMod + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; -/* Megatexture defines (set in Scene/VoxelRenderResources.js) -#define SAMPLE_COUNT ### -#define NEAREST_SAMPLING -#define PADDING -*/ + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. -uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions -uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; -uniform ivec3 u_dimensions; // does not include padding -#if defined(PADDING) - uniform ivec3 u_paddingBefore; - uniform ivec3 u_paddingAfter; -#endif + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; -// Integer min, max, clamp: For WebGL1 only -int intMin(int a, int b) { - return a <= b ? a : b; -} -int intMax(int a, int b) { - return a >= b ? a : b; -} -int intClamp(int v, int minVal, int maxVal) { - return intMin(intMax(v, minVal), maxVal); -} + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. -vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) -{ - int indexX = intMod(index, dimensions.x); - int indexY = index / dimensions.x; - return vec2(indexX, indexY) * uvScale; -} + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); -/* - How is 3D data stored in a 2D megatexture? + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; - In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). - The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and - the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). - Note that there could be empty space in the megatexture because it's a power of two. + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - 0 1 2 3 - +---+---+---+---+ - | | | | | 3 - +---+---+---+---+ - | | | | | 2 - +-------+-------+ - |010|110|011|111| 1 - |--- ---|--- ---| - |000|100|001|101| 0 - +-------+-------+ + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); - When doing linear interpolation the megatexture needs to be sampled twice: once for - the Z slice above the voxel coordinate and once for the slice below. The two slices - are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is - halfway between two Z slices so the interpolation factor is 0.5. Below is a side view - of the 3D voxel grid with voxel coordinates on the left side. + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +} - 2 +---+ - |001| - 1 +-z-+ - |000| - 0 +---+ +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; - When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. -*/ + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); -Properties getPropertiesFromMegatexture(in SampleData sampleData) { - vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? - int tileIndex = sampleData.megatextureIndex; - vec3 voxelCoord = tileUv * vec3(u_dimensions); - ivec3 voxelDimensions = u_dimensions; + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } +#else +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; + } + out_FragColor = cloud; +#endif +#endif +} +`;var TN=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; - #if defined(PADDING) - voxelDimensions += u_paddingBefore + u_paddingAfter; - voxelCoord += vec3(u_paddingBefore); - #endif +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; - #if defined(NEAREST_SAMPLING) - // Round to the center of the nearest voxel - voxelCoord = floor(voxelCoord) + vec3(0.5); - #endif +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - // Tile location - vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); - - // Slice location - float slice = voxelCoord.z - 0.5; - int sliceIndex = int(floor(slice)); - int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); - vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); - - // Voxel location - vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; - - // Final location in the megatexture - vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; - #if defined(NEAREST_SAMPLING) - return getPropertiesFromMegatextureAtUv(uv0); - #else - float sliceLerp = fract(slice); - int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); - vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); - vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; - Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); - Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); - return mixProperties(properties0, properties1, sliceLerp); - #endif -} +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif -// Convert an array of sample datas to a final weighted properties. -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { - #if (SAMPLE_COUNT == 1) - return getPropertiesFromMegatexture(sampleDatas[0]); - #else - // When more than one sample is taken the accumulator needs to start at 0 - Properties properties = clearProperties(); - for (int i = 0; i < SAMPLE_COUNT; ++i) { - float weight = sampleDatas[i].weight; + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; - // Avoid reading the megatexture when the weight is 0 as it can be costly. - if (weight > 0.0) { - Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); - tempProperties = scaleProperties(tempProperties, weight); - properties = sumProperties(properties, tempProperties); - } - } - return properties; - #endif -} -`;function rnt(e){let t=new N0;this.shaderBuilder=t;let n=e._customShader,i=gt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let p in r)if(r.hasOwnProperty(p)){let g=r[p];t.addUniform(g.type,p,be.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",be.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s,t.addVertexLines([TL]),t.addFragmentLines([n.fragmentShaderText,"#line 0",RL,EL,ML]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,be.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,be.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,be.FRAGMENT),t.addFragmentLines([SL])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,be.FRAGMENT),t.addFragmentLines([bL]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,be.FRAGMENT),t.addFragmentLines([IL,vL,$x])):a==="CYLINDER"?t.addFragmentLines([wL,$x,PL]):a==="ELLIPSOID"&&t.addFragmentLines([DL,$x,OL]),t.addFragmentLines([CL]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,be.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,be.FRAGMENT),s===1?f+=1:o.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,be.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,be.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,be.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,be.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,be.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,be.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,be.FRAGMENT)}var BL=rnt;function ont(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,be.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,be.FRAGMENT);for(let O=0;O0){let h="getClippingPlane",A=R_(r,t),x=0,C=A.indexOf(")")+1,T=A.indexOf("{",C)+1,E=A.indexOf("}",T),S=A.slice(x,C),w=A.slice(T,E);i.addFunction(h,S,be.FRAGMENT),i.addFunctionLines(h,[w])}let s=i.clone();s.addDefine("PICKING",void 0,be.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),u=ze.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new nt({vertexArray:f,primitiveType:Be.TRIANGLES,renderState:u,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Se.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=nt.shallowClone(p,new nt);if(g.shaderProgram=c,g.pickOnly=!0,l(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(l(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var NL=lnt;var f_e={};function unt(e,t,n){let i,r,o;if(e instanceof bi){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Yc)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var fnt=new m,c_e=new m;function d_e(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function BY(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,fnt),g=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),c_e)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),c_e));o=Math.min(unt(d,g,h)*.2,1e9)}if(se+Math.PI?e+=P.TWO_PI:tP.PI&&(t.longitude+=P.TWO_PI)}var pnt=new he,_nt=new he;function gnt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,pnt),h=f.pitch,A=FL(f.heading,i),x=FL(f.roll,o),C=p.cartesianToCartographic(n,_nt);g.longitude=P.zeroToTwoPi(g.longitude),C.longitude=P.zeroToTwoPi(C.longitude);let T=!1;if(l(a)){let D=P.zeroToTwoPi(a),R=Math.min(g.longitude,C.longitude),O=Math.max(g.longitude,C.longitude),L=D>=R&&D<=O;if(l(c)){let N=Math.abs(g.longitude-C.longitude),_=P.TWO_PI-N;(L?N:_)<(L?_:N)*c&&!L&&(T=!0)}else L||(T=!0)}T?mnt(g,C):hnt(g,C);let E=BY(f,n,g.height,C.height,s),S=d_e(h,r,E,u);function w(){let D=g.longitude,R=C.longitude,O=g.latitude,L=C.latitude;return function(_){let b=_.time/t,v=m.fromRadians(P.lerp(D,R,b),P.lerp(O,L,b),E(b),p);f.setView({destination:v,orientation:{heading:P.lerp(A,i,b),pitch:S(b),roll:P.lerp(x,o,b)}})}}return w()}function ynt(e,t,n,i,r,o,s){let a=e.camera,c=m.clone(a.position,m_e),u=FL(a.heading,i),f=a.frustum.right-a.frustum.left,d=BY(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,h)}}),H.lerp(c,n,h,a.position);let A=d(h),x=a.frustum,C=x.top/x.right,T=(A-(x.right-x.left))*.5;x.right+=T,x.left-=T,x.top=C*x.right,x.bottom=-x.top}return p}var l_e=new he,Ant=new m;function MY(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function u_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}f_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return MY();let r=y(t.convert,!0),o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,l_e),n=o.project(l_e,Ant));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let h=t.duration;l(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let A=y(t.heading,0),x=y(t.pitch,-P.PI_OVER_TWO),C=y(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let E=u_e(T,t.complete),S=u_e(T,t.cancel),w=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&H.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(w.right-w.left,w.top-w.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(C),P.negativePiToPi(p.roll),P.EPSILON10),D)return MY(E,S);let R=new Array(4);if(R[ne.SCENE2D]=ynt,R[ne.SCENE3D]=gnt,R[ne.COLUMBUS_VIEW]=dnt,h<=0)return MY(function(){R[i](e,1,n,A,x,C,a,c,u,f)({time:1}),typeof E=="function"&&E()},S);let O=R[i](e,h,n,A,x,C,a,c,u,f);if(!l(d)){let L=p.positionCartographic.height,N=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>N&&L>11500?d=Mo.CUBIC_OUT:d=Mo.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:O,complete:E,cancel:S}};var UL=f_e;var xnt={ROTATE:0,INFINITE_SCROLL:1},Ml=Object.freeze(xnt);function en(e){this._scene=e,this._transform=B.clone(B.IDENTITY),this._invTransform=B.clone(B.IDENTITY),this._actualTransform=B.clone(B.IDENTITY),this._actualInvTransform=B.clone(B.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new bi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new pe,this._moveEnd=new pe,this._changed=new pe,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new B,this._invViewMatrix=new B,C_e(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,M_e(this,en.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*en.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}en.TRANSFORM_2D=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);en.TRANSFORM_2D_INVERSE=B.inverseTransformation(en.TRANSFORM_2D,new B);en.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);en.DEFAULT_VIEW_FACTOR=.5;en.DEFAULT_OFFSET=new pu(0,-P.PI_OVER_FOUR,0);function C_e(e){B.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),B.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),B.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Cnt(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=yi()):e.timeSinceMoved=Math.max(yi()-e._lastMovedTimestamp,0)/1e3}}en.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};en.prototype._updateCameraChanged=function(){let e=this;if(Cnt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,h=u.x+d.right,A=f.x+p.left,x=f.x+p.right,C=u.y+d.bottom,T=u.y+d.top,E=f.y+p.bottom,S=f.y+p.top,w=Math.max(g,A),D=Math.min(h,x),R=Math.max(C,E),O=Math.min(T,S),L;if(w>=D||R>=T)L=1;else{let N=p;gx&&CS&&(N=d),L=1-(D-w)*(O-R)/((N.right-N.left)*(N.top-N.bottom))}L>t&&(e._changed.raiseEvent(L),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let o=P.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=o/(e.frustum.fovy*.5):s=o;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Tnt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Ent=new he,bnt=new m,Q4=new m,Snt=new oe,vnt=new oe,wnt=new oe,Dnt=new oe,Int=new oe;function Pnt(e){let t=e._projection,n=t.ellipsoid,i=B.getColumn(e._transform,3,Snt),r=n.cartesianToCartographic(i,Ent),o=t.project(r,bnt),s=vnt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=oe.clone(oe.UNIT_X,Int),c=oe.add(B.getColumn(e._transform,0,Q4),i,Q4);n.cartesianToCartographic(c,r),t.project(r,o);let u=wnt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,m.subtract(u,s,u),u.x=0;let f=Dnt;if(m.magnitudeSquared(u)>P.EPSILON10)m.cross(a,u,f);else{let d=oe.add(B.getColumn(e._transform,1,Q4),i,Q4);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)P.EPSILON2){let A=1/m.magnitudeSquared(c),x=m.dot(c,s)*A,C=m.multiplyByScalar(s,x,LY);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=B.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=B.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=B.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&C_e(e)}function T_e(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function E_e(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function b_e(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var tz=new B,nz=new B;Object.defineProperties(en.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return pc(this),this._invTransform}},viewMatrix:{get:function(){return pc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return pc(this),this._invViewMatrix}},positionCartographic:{get:function(){return pc(this),this._positionCartographic}},positionWC:{get:function(){return pc(this),this._positionWC}},directionWC:{get:function(){return pc(this),this._directionWC}},upWC:{get:function(){return pc(this),this._upWC}},rightWC:{get:function(){return pc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,nz);this._setTransform(n);let i=T_e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,nz);this._setTransform(n);let i=E_e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,nz);this._setTransform(n);let i=b_e(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});en.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&D_e(this,this.position)};var Ont=new m,Rnt=new m,Mnt=new m;en.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Ont),n=m.clone(this.upWC,Rnt),i=m.clone(this.directionWC,Mnt);B.clone(e,this._transform),this._transformChanged=!0,pc(this);let r=this._actualInvTransform;B.multiplyByPoint(r,t,this.position),B.multiplyByPointAsVector(r,i,this.direction),B.multiplyByPointAsVector(r,n,this.up),m.cross(this.direction,this.up,this.right),pc(this)};var Bnt=new H,Lnt=new In,Nnt=new m,Fnt=new m;function S_e(e){if(!B.equals(B.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Bnt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let r;if(l(n)){let a=e.getPickRay(i,Lnt);r=n.pickWorldCoordinates(a,t,!0,Nnt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,Fnt));let s;if(l(r)||l(o)){let a=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}en.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=S_e(this)))};var iz=new m,kY=new B,Unt=new B,zY=new Le,HY=new Z,v_e=new he;function Vnt(e,t,n){let i=B.clone(e.transform,kY),r=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Unt);e._setTransform(r),m.clone(m.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,zY),s=Z.fromQuaternion(o,HY);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function knt(e,t,n,i){let r=B.clone(e.transform,kY);if(e._setTransform(B.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,v_e);t=a.project(c,iz)}m.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,zY),s=Z.fromQuaternion(o,HY);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function znt(e,t,n,i){let r=B.clone(e.transform,kY);if(e._setTransform(B.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,v_e);t=c.project(u,iz)}H.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ml.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,zY),s=Z.fromQuaternion(o,HY);Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(r)}var Hnt=new m,Gnt=new m,Wnt=new m;function w_e(e,t,n,i){let r=m.clone(n.direction,Hnt),o=m.clone(n.up,Gnt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,tz),u=B.inverseTransformation(c,nz);B.multiplyByPointAsVector(u,r,r),B.multiplyByPointAsVector(u,o,o)}let s=m.cross(r,o,Wnt);return i.heading=T_e(r,o),i.pitch=E_e(r),i.roll=b_e(r,o,s),i}var VY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},tS=new za;en.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),r=y(e.destination,m.clone(this.positionWC,iz));l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,iz),i=!1),l(t.direction)&&(t=w_e(this,r,t,VY.orientation)),tS.heading=y(t.heading,0),tS.pitch=y(t.pitch,-P.PI_OVER_TWO),tS.roll=y(t.roll,0),n===ne.SCENE3D?Vnt(this,r,tS):n===ne.SCENE2D?znt(this,r,tS,i):knt(this,r,tS,i)};var jnt=new m;en.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:en.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:B.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(en.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*en.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:B.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,jnt).z),roll:0},endTransform:B.IDENTITY,convert:!1})}};en.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),pc(this),B.multiplyByVector(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),pc(this),B.multiplyByPoint(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),pc(this),B.multiplyByPointAsVector(this._actualInvTransform,e,t)};en.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),pc(this),B.multiplyByVector(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),pc(this),B.multiplyByPoint(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),pc(this),B.multiplyByPointAsVector(this._actualTransform,e,t)};function D_e(e,t){let n=e._scene.mapMode2D===Ml.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var h_e=new m;en.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,h_e),m.add(n,h_e,n),this._mode===ne.SCENE2D&&D_e(this,n),this._adjustOrthographicFrustum(!0)};en.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?rz(this,e):this.move(this.direction,e)};en.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?rz(this,-e):this.move(this.direction,-e)};en.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};en.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};en.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};en.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};en.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};en.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};en.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};en.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Ynt=new Le,qnt=new Z;en.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Le.fromAxisAngle(e,-n,Ynt),r=Z.fromQuaternion(i,qnt),o=this.direction,s=this.up,a=this.right;Z.multiplyByVector(r,o,o),Z.multiplyByVector(r,s,s),Z.multiplyByVector(r,a,a)};en.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};en.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Xnt=new Le,Knt=new Z;en.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Le.fromAxisAngle(e,-n,Xnt),r=Z.fromQuaternion(i,Knt);Z.multiplyByVector(r,this.position,this.position),Z.multiplyByVector(r,this.direction,this.direction),Z.multiplyByVector(r,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};en.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),I_e(this,e)};en.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),I_e(this,-e)};var Jnt=new m,Znt=new m,Qnt=new m,p_e=new m;function I_e(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,P.EPSILON2)){let i=m.normalize(n,Jnt),r=m.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=m.equalsEpsilon(i,m.negate(e.constrainedAxis,p_e),P.EPSILON2);if(!r&&!o){let s=m.normalize(e.constrainedAxis,Znt),a=m.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=m.dot(i,m.negate(s,p_e)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=m.cross(s,i,Qnt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}en.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),P_e(this,-e)};en.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),P_e(this,e)};function P_e(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function rz(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ml.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ml.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function O_e(e,t){e.move(e.direction,t)}en.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?rz(this,e):O_e(this,e)};en.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?rz(this,-e):O_e(this,-e)};en.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var $nt=new B;en.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,re.WGS84,$nt);this.lookAtTransform(n,t)};var eit=new m,tit=new Le,nit=new Le,iit=new Z;function R_e(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Le.fromAxisAngle(m.UNIT_Y,-t,tit),r=Le.fromAxisAngle(m.UNIT_Z,-e,nit),o=Le.multiply(r,i,r),s=Z.fromQuaternion(o,iit),a=m.clone(m.UNIT_X,eit);return Z.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}en.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=R_e(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)c&&(c+=P.TWO_PI);let f=(u+c)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let L=VL;L.longitude=f,L.latitude=s,L.height=0;let N=rit;N.longitude=f,N.latitude=a,N.height=0;let _=__e;(!l(_)||_.ellipsoid!==r)&&(__e=_=new $u(void 0,void 0,r)),_.setEndPoints(L,N),d=_.interpolateUsingFraction(.5,VL).latitude}let p=VL;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,fit),h=VL;h.longitude=c,h.latitude=s;let A=r.cartographicToCartesian(h,oit);h.longitude=u;let x=r.cartographicToCartesian(h,ait);h.longitude=f;let C=r.cartographicToCartesian(h,lit);h.latitude=a;let T=r.cartographicToCartesian(h,uit);h.longitude=c;let E=r.cartographicToCartesian(h,cit);h.longitude=u;let S=r.cartographicToCartesian(h,sit);m.subtract(x,g,x),m.subtract(E,g,E),m.subtract(A,g,A),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(T,g,T);let w=r.geodeticSurfaceNormal(g,o.direction);m.negate(w,w);let D=m.cross(w,m.UNIT_Z,o.right);m.normalize(D,D);let R=m.cross(D,w,o.up),O;if(e.frustum instanceof rn){let L=Math.max(m.distance(A,x),m.distance(E,S)),N=Math.max(m.distance(A,E),m.distance(x,S)),_,b,v=e.frustum._offCenterFrustum,I=v.right/v.top,M=N*I;L>M?(_=L,b=_/I):(b=N,_=M),O=Math.max(_,b)}else{let L=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*L;if(O=Math.max(hc(w,R,x,L),hc(w,R,E,L),hc(w,R,A,L),hc(w,R,S,L),hc(w,R,C,L),hc(w,R,T,L),hc(w,D,x,N),hc(w,D,E,N),hc(w,D,A,N),hc(w,D,S,N),hc(w,D,C,N),hc(w,D,T,N)),a<0&&s>0){let _=VL;_.longitude=u,_.latitude=0,_.height=0;let b=r.cartographicToCartesian(_,NY);m.subtract(b,g,b),O=Math.max(O,hc(w,R,b,L),hc(w,D,b,N)),_.longitude=c,b=r.cartographicToCartesian(_,NY),m.subtract(b,g,b),O=Math.max(O,hc(w,R,b,L),hc(w,D,b,N))}}return m.add(g,m.multiplyByScalar(w,-O,NY),n)}var mit=new he,hit=new m,pit=new m;function _it(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=mit;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,hit);B.multiplyByPoint(r,a,a),B.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,pit);if(B.multiplyByPoint(r,c,c),B.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var git=new he,yit=new m,Ait=new m;function xit(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Ml.INFINITE_SCROLL?r+=P.TWO_PI:(t=ce.MAX_VALUE,r=t.east));let o=git;o.longitude=r,o.latitude=t.north;let s=i.project(o,yit);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,Ait),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}en.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===ne.SCENE3D)return M_e(this,e,t);if(n===ne.COLUMBUS_VIEW)return _it(this,e,t);if(n===ne.SCENE2D)return xit(this,e,t)};var Cit=new In;function Tit(e,t,n,i){n=y(n,re.WGS84);let r=e.getPickRay(t,Cit),o=qi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return In.getPoint(r,s,i)}var Eit=new In;function bit(e,t,n,i){let o=e.getPickRay(t,Eit).origin;o=m.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Sit=new In;function vit(e,t,n,i){let r=e.getPickRay(t,Sit),o=-r.origin.x/r.direction.x;In.getPoint(r,o,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}en.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,re.WGS84),this._mode===ne.SCENE3D)n=Tit(this,e,t,n);else if(this._mode===ne.SCENE2D)n=bit(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=vit(this,e,this._projection,n);else return;return n}};var wit=new m,Dit=new m,Iit=new m;function Pit(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,wit);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,u*c*a,Dit),h=m.multiplyByScalar(e.upWC,f*c*s,Iit),A=m.add(p,g,n.direction);return m.add(A,h,A),m.subtract(A,d,A),m.normalize(A,A),n}var $4=new m;function Oit(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,$4),m.add($4,f,f),m.multiplyByScalar(e.up,u,$4),m.add($4,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}en.prototype.getPickRay=function(e,t){l(t)||(t=new In);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Pit(this,e,t):Oit(this,e,t)};var Rit=new m,Mit=new m;en.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Rit),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Mit);return Math.max(0,m.magnitude(n)-e.radius)};var Bit=new H;en.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Bit);return Math.max(r.x,r.y)};function Lit(e,t,n,i,r,o){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Mo.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Nit=new m,g_e=new m,Fit=new m,Uit=new m;function Vit(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(m.UNIT_X,Nit),o=-m.dot(r,n)/m.dot(r,i),s=m.add(n,m.multiplyByScalar(i,o,g_e),g_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Fit);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=m.magnitude(m.subtract(n,s,Uit)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),A=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-A||n.y>A){let x=s.y<-h||s.y>h,C=s.z<-A||s.z>A;if(x||C)return Lit(e,n,s,h,A,t)}}en.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Vit(this,e)};var kit=new m,Ls={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};en.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};en.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ls.destination,e.orientation.heading=Ls.heading,e.orientation.pitch=Ls.pitch,e.orientation.roll=Ls.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};en.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,kit));let r=y(e.orientation,y.EMPTY_OBJECT);if(l(r.direction)&&(r=w_e(this,t,r,VY.orientation)),l(e.duration)&&e.duration<=0){let f=VY;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Ls.destination=t,Ls.heading=r.heading,Ls.pitch=r.pitch,Ls.roll=r.roll,Ls.duration=e.duration,Ls.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Ls.cancel=e.cancel,Ls.endTransform=e.endTransform,Ls.convert=i?!1:e.convert,Ls.maximumHeight=e.maximumHeight,Ls.pitchAdjustHeight=e.pitchAdjustHeight,Ls.flyOverLongitude=e.flyOverLongitude,Ls.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ls.easingFunction=e.easingFunction;let a=this._scene,c=UL.createTween(a,Ls);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=en.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function zit(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function Hit(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var Git=100;function B_e(e,t,n){n=pu.clone(l(n)?n:en.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=Git:e.frustum instanceof rn||e._mode===ne.SCENE2D?n.range=Hit(e,s):n.range=zit(e,s),n.range=P.clamp(n.range,i,r)}return n}en.prototype.viewBoundingSphere=function(e,t){t=B_e(this,e,t),this.lookAt(e.center,t)};var Wit=new B,jit=new m,Yit=new m,qit=new m,Xit=new m,Kit=new oe,Jit=new Le,Zit=new Z;en.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(B.IDENTITY);let i=B_e(this,e,t.offset),r;n?r=m.multiplyByScalar(m.UNIT_Z,i.range,jit):r=R_e(i.heading,i.pitch,i.range);let o=Mt.eastNorthUpToFixedFrame(e.center,re.WGS84,Wit);B.multiplyByPoint(o,r,r);let s,a;if(!n){if(s=m.subtract(e.center,r,Yit),m.normalize(s,s),a=B.multiplyByPointAsVector(o,m.UNIT_Z,qit),1-Math.abs(m.dot(s,a))P.PI?f+=P.TWO_PI-h:f+=h,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,Zy[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};en.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof bi)return;let e=this._scene;this.frustum=new bi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};en.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof rn)return;let e=S_e(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};en.clone=function(e,t){return l(t)||(t=new en(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),B.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var sr=en;var ert={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Oi=Object.freeze(ert);function _c(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function trt(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function L_e(e,t,n){let i=_c(Oi.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new H;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(trt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d0||e}}});Uf.prototype.isMoving=function(e,t){let n=_c(e,t);return!this._update[n]};Uf.prototype.getMovement=function(e,t){let n=_c(e,t);return this._movement[n]};Uf.prototype.getLastMovement=function(e,t){let n=_c(e,t),i=this._lastMovement[n];if(i.valid)return i};Uf.prototype.isButtonDown=function(e,t){let n=_c(e,t);return this._isDown[n]};Uf.prototype.getStartMousePosition=function(e,t){if(e===Oi.WHEEL)return this._currentMousePosition;let n=_c(e,t);return this._eventStartPosition[n]};Uf.prototype.getButtonPressTime=function(e,t){let n=_c(e,t);return this._pressTime[n]};Uf.prototype.getButtonReleaseTime=function(e,t){let n=_c(e,t);return this._releaseTime[n]};Uf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Uf.prototype.isDestroyed=function(){return!1};Uf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var zL=Uf;function M_(){this.featurePropertiesDirty=!1}Object.defineProperties(M_.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});M_.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};M_.prototype.getFeature=function(e){fe.throwInstantiationError()};M_.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};M_.prototype.applyStyle=function(e){fe.throwInstantiationError()};M_.prototype.update=function(e,t){fe.throwInstantiationError()};M_.prototype.isDestroyed=function(){fe.throwInstantiationError()};M_.prototype.destroy=function(){fe.throwInstantiationError()};var GY=M_;function nrt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Vf=nrt;function iS(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,rrt(this,t)}Object.defineProperties(iS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function irt(e,t){this.condition=e,this.expression=t}function rrt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};GL.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;rc.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>r.x||i.y>r.y||i.z>r.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=k_e(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,o)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=B.multiplyByPoint(V_e,a,f.renderMinBounds),f.renderMaxBounds=B.multiplyByPoint(V_e,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,A=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===A.x?1:A.x-h.x),2/(h.y===A.y?1:A.y-h.y),2/(h.z===A.z?1:A.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var mrt=new m,hrt=new m;Bl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),mrt),u=m.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),hrt);return k_e(c,u,this.shapeTransform,r)};Bl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};Bl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));Bl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function k_e(e,t,n,i){let r=Bl.DefaultMinBounds,o=Bl.DefaultMaxBounds;if(m.equals(e,r)&&m.equals(t,o))i.center=B.getTranslation(n,i.center),i.halfAxes=B.getMatrix3(n,i.halfAxes);else{let a=B.getScale(n,WY),c=m.midpoint(e,t,art);i.center=B.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),WY);let u=B.getRotation(n,crt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var Sh=Bl;function oz(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(oz.prototype,{metadataTable:{get:function(){return this._metadataTable}}});oz.fromJson=async function(e,t,n,i){let r;l(t)?r={json:t,binary:void 0}:r=_rt(n);let o=await prt(e,r.json,r.binary),s={},a=r.json.bufferViews.length;for(let d=0;dw||N>_||P.equalsEpsilon(V.x,0,void 0,g)||P.equalsEpsilon(V.y,0,void 0,g)||P.equalsEpsilon(V.z,0,void 0,g))return!1;this._minimumRadius=x,this._maximumRadius=C,this._minimumHeight=D,this._maximumHeight=R,this._minimumAngle=b,this._maximumAngle=v,this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=YY(S,w,N,_,F,k,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let q=x===o&&C===s,Y=D===a&&R===c,Q=vp+A&&WA&&W=p-A&&W<=p+A,ye=W<=A,se=K||J||me||ye,_e=P.equalsEpsilon(b,u,void 0,h),xe=P.equalsEpsilon(v,f,void 0,h),De=w===s,Ee=S===o,Ne=N===a&&_===c,ke=kp+A&&ReA&&Re=p-A&&Re<=p+A,hn=Re<=A,Rn=dt||_t||rt||hn,Gt=this.shaderUniforms,Ut=this.shaderDefines;for(let Ae in Ut)Ut.hasOwnProperty(Ae)&&(Ut[Ae]=void 0);let Te=0;if(Ut.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Te,Te+=1,Ee||(Ut.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Ut.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Te,Te+=1,Gt.cylinderUvToRenderRadiusMin=w/S),De||(Ut.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===w&&(Ut.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Ne||(Ut.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),N===_&&(Ut.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),D===R&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),x===C&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!q){Ut.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ae=1/(C-x),ut=x/(x-C);Gt.cylinderUvToShapeUvRadius=H.fromElements(Ae,ut,Gt.cylinderUvToShapeUvRadius)}if(!Y){Ut.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ae=2/(R-D),ut=(D+1)/(D-R);Gt.cylinderUvToShapeUvHeight=H.fromElements(Ae,ut,Gt.cylinderUvToShapeUvHeight)}if(!De||!Ne){let Ae=.5*(_-N),ut=m.fromElements(1/w,1/w,1/(Ae===0?1:Ae),yrt),ii=m.fromElements(0,0,-ut.z*.5*(N+_),grt),Je=B.fromRotationTranslation(Z.fromScale(ut,Art),ii,xrt),ar=B.multiplyTransformation(Je,Trt,Crt);Gt.cylinderUvToRenderBoundsScale=B.getScale(ar,Gt.cylinderUvToRenderBoundsScale),Gt.cylinderUvToRenderBoundsTranslate=B.getTranslation(ar,Gt.cylinderUvToRenderBoundsTranslate)}if(Q&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Rn&&(Ut.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Ut.CYLINDER_INTERSECTION_INDEX_ANGLE=Te,dt?(Ut.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Te+=1):_t?(Ut.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Te+=2):rt?(Ut.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,Te+=1):hn&&(Ut.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Te+=2),Gt.cylinderRenderAngleMinMax=H.fromElements(F,k,Gt.cylinderAngleMinMax)),se){Ut.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ye&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),_e&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(Ut.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ae=(b-u)/d,ut=(v-u)/d,ii=1-W/d;Gt.cylinderShapeUvAngleMinMax=H.fromElements(Ae,ut,Gt.cylinderShapeUvAngleMinMax),Gt.cylinderShapeUvAngleRangeZeroMid=(ut+.5*ii)%1;let Je=d/W,ar=-(b-u)/W;Gt.cylinderUvToShapeUvAngle=H.fromElements(Je,ar,Gt.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=Te,!0};Wo.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(o,s,t*d),g=P.lerp(o,s,(t+1)*d),h=P.lerp(a,c,n*d),A=P.lerp(a,c,(n+1)*d),x=P.lerp(u,f,i*d),C=P.lerp(u,f,(i+1)*d);return YY(p,g,h,A,x,C,this.shapeTransform,r)};var Ert=new Bn,brt=new m,Srt=new m,vrt=new m;Wo.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,r=this._minimumHeight,o=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,u=1-1/e.y,f=1-1/e.z,d=P.lerp(n,i,c),p=P.lerp(r,o,u),g=P.lerp(s,a,f),C=YY(d,i,p,o,g,a,t,Ert),T=Z.getScale(C.halfAxes,brt),E=B.getScale(t,Srt),S=m.divideComponents(T,E,vrt);return m.minimumComponent(S)};Wo.DefaultMinBounds=Object.freeze(new m(0,-1,-P.PI));Wo.DefaultMaxBounds=Object.freeze(new m(1,1,+P.PI));var wrt=5,Drt=new Array(wrt),Irt=new m,Prt=new Z,Ort=new B,Rrt=new B,Mrt=new B,jY=new B,Brt=new m,Lrt=new m,Nrt=new m,G_e=new Array(8);for(let e=0;e<8;e++)G_e[e]=new m;function z_e(e,t,n){return Math.abs(oe.dot(e,t))P.PI&&(E[S++]=T-P.PI_OVER_TWO,E[S++]=T+P.PI_OVER_TWO);let w=1,D=1,R=-1,O=-1;for(let Q=0;Qb||_===f||b===u||U>q||P.equalsEpsilon(J,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,R,T,O),this._translation=B.getTranslation(e,this._translation),this._rotation=B.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(v,this._ellipsoid),this._minimumHeight=F,this._maximumHeight=k;let me=ce.fromRadians(w,_,D,b,zrt);this.orientedBoundingBox=X_e(me,U,q,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=B.fromRotationTranslation(Z.setScale(this._rotation,Q,krt),this._translation,this.shapeTransform),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ye=Dc+h&&se=c-h&&se<=c+h,Ee=se>h&&sec+h&&Re=c-h&&Re<=c+h,hn=Re>h&&Re=-x&&b<=+x,Te=b>+x&&bu+A&&_<-x,ii=_>=-x&&_<=+x,Je=_>+x,ar=ut||ii||Je,ts=Ae||ar,Ba=O-R,No=O<-x,Mr=O>=-x&&O<=+x,Ve=O>+x&&Ou+A&&R<-x,Qe=R>=-x&&R<=+x,pt=R>+x,Jt=ot||(je||Qe||pt),rr=!m.equals(K,m.ZERO),gr=!m.equals(J,m.ZERO),ns=rr||gr,Vs=q-U,lo=!m.equals(Y,m.ZERO),Wi=!m.equals(Q,m.ZERO),Yo=lo||Wi,Vn=this.shaderUniforms,ln=this.shaderDefines;for(let wn in ln)ln.hasOwnProperty(wn)&&(ln[wn]=void 0);Vn.ellipsoidRadiiUv=m.divideByScalar(Q,W,Vn.ellipsoidRadiiUv),Vn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Vn.ellipsoidRadiiUv,Vn.ellipsoidRadiiUv,Vn.ellipsoidInverseRadiiSquaredUv),Vn.ellipsoidInverseRadiiSquaredUv);let Kn=0;if(ln.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Kn,Kn+=1,ns&&(Vs===0&&(ln.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),rr&&(ln.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,ln.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Kn,Kn+=1,Vn.ellipsoidInverseInnerScaleUv=W/(W-(k-U))),gr&&(ln.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Vn.ellipsoidInverseOuterScaleUv=W/(W-(k-q)))),Yo){if(lo){ln.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let wn=(k-F)/W;Vn.ellipsoidInverseHeightDifferenceUv=1/wn,Vn.ellipseInnerRadiiUv=H.fromElements(Vn.ellipsoidRadiiUv.x*(1-wn),Vn.ellipsoidRadiiUv.z*(1-wn),Vn.ellipseInnerRadiiUv)}F===k&&(ln.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Ne&&(ln.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,ln.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Kn,xe?(ln.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Kn+=1):Ee?(ln.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Kn+=2):De?(ln.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,Kn+=1):_e&&(ln.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Kn+=2),Vn.ellipsoidRenderLongitudeMinMax=H.fromElements(w,D,Vn.ellipsoidRenderLongitudeMinMax)),Rn){ln.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,T{let{type:g,componentType:h}=p,A=o?.properties[d].min,x=o?.properties[d].max,C=Yt.getComponentCount(g),T=K_e(A,C),E=K_e(x,C);return{id:d,type:g,componentType:h,minValue:T,maxValue:E}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function K_e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function Yrt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),r=await i.fetchArrayBuffer(),o=eh(r);return await jL.fromJson(i,o.jsonPayload,o.binaryPayload,e.metadataSchema)}async function qrt(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=eh(a);return r=await PA.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}YL.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),r=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new ax({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return qrt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?Yrt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var qY=YL;function XY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(XY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});XY.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=m.fromElements(i,r,o,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var qL=XY;var KY={CUMULUS:0};KY.validate=function(e){return e===KY.CUMULUS};var rS=Object.freeze(KY);var XL=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; +`;var AN=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; +uniform vec3 u_noiseOffset; +in vec2 v_position; float wrap(float value, float rangeLength) { if(value < 0.0) { @@ -10715,571 +9332,246 @@ vec3 wrapVec(vec3 value, float rangeLength) { wrap(value.z, rangeLength)); } -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} - -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); } -vec4 sampleNoiseTexture(vec3 position) { +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); - - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; } -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); + + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } } } - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; + return shortestDistance; } -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } +const float MAX_FBM_ITERATIONS = 10.0; - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } + + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; } - return intersected; + return noise; } -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); } +`;var EN=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; +out vec2 v_position; -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; +void main() +{ + gl_Position = vec4(position, 0.1, 1.0); + + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; } +`;var SN=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection +in vec2 v_textureCoordinates; -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +void main() +{ + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); } +`;var vN=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } +in vec2 v_textureCoordinates; - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); +void main() +{ + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); +#else + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); +#endif - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; + if (opaque != czm_backgroundColor) + { + out_FragColor.a = 1.0; + } +} +`;var wN=`in vec4 positionEC; - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; +void main() +{ + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. + czm_ray ray = czm_ray(position, direction); - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); + vec3 ellipsoid_center = czm_view[3].xyz; - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) + { + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + } + else + { + discard; + } - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); + czm_writeLogDepth(); +} +`;var IN=`in vec4 position; - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); +out vec4 positionEC; - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +void main() +{ + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; + + czm_vertexLogDepth(); } +`;var tS=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; +in vec3 v_positionEC; - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } + vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; + + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); #else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; -#endif + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var KL=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; - -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; -#endif + float t1 = -1.0; + float t2 = -1.0; - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var JL=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; + } -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} - -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; -} - -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; - - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); - - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } - - return shortestDistance; -} - -const float MAX_FBM_ITERATIONS = 10.0; - -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } - - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; -} - -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var ZL=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; - -out vec2 v_position; - -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); - - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;function pm(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var Xrt=pm.SHOW_INDEX=0,Krt=pm.POSITION_INDEX=1,Jrt=pm.SCALE_INDEX=2,Zrt=pm.MAXIMUM_SIZE_INDEX=3,Qrt=pm.SLICE_INDEX=4,$rt=pm.BRIGHTNESS_INDEX=5,eot=pm.COLOR_INDEX=6;pm.NUMBER_OF_PROPERTIES=7;function tC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(pm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,tC(this,Xrt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),tC(this,Krt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),tC(this,Jrt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),tC(this,Zrt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),tC(this,eot))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,tC(this,Qrt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,tC(this,$rt))}}});pm.prototype._destroy=function(){this._cloudCollection=void 0};var Ru=pm;var Mu,sz=new m,tot={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},not={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},iot=Ru.SHOW_INDEX,rot=Ru.POSITION_INDEX,oot=Ru.SCALE_INDEX,sot=Ru.MAXIMUM_SIZE_INDEX,aot=Ru.SLICE_INDEX,cot=Ru.BRIGHTNESS_INDEX,lot=Ru.NUMBER_OF_PROPERTIES,uot=Ru.COLOR_INDEX;function _m(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(lot),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:tge(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function tge(e){return function(){return sz.x=e._textureSliceWidth,sz.y=e._noiseTextureRows,sz.z=1/e._noiseTextureRows,sz}}Object.defineProperties(_m.prototype,{length:{get:function(){return ZY(this),this._clouds.length}}});function nge(e){let t=e.length;for(let n=0;n0){n._vaf=got(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a.1){for(p=0;p0&&Tot(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Eot(this,e,KL,XL),bot(this,e))};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),nge(this._clouds),ue(this)};var $Y=_m;async function eq(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;await n._readyPromise;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return o;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await eq._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,h){return l(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}eq._sampleTerrainMostDetailed=E_;var nC=eq;var Sot=P.toRadians(30);function tq(e){this._angle=y(e,Sot)}Object.defineProperties(tq.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});tq.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=m.fromElements(r,o,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var nq=tq;var vot=new z,wot=new z,Dot=new z,Iot=new z,age=new oe,QL=new Uint8Array(4);function cge(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function az(e,t){return{height:e,color:z.clone(t)}}function lge(e){return e=e.filter(function(t,n,i){let r=n>0,o=n0,o=n0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function Pot(e){let t,n,i=[],r=e.length;for(t=0;t=h.height}f?c=c.reverse():u||O_(c,function(g,h){return P.sign(g.height-h.height)});let d=y(o.extendDownwards,!1),p=y(o.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,az(Nl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,az(Nl._maximumHeight,c[c.length-1].color)),c=lge(c),i.push(c)}return i}function Oot(e){let t=Pot(e),n=[],i=[],r;function o(u,f){n.push(az(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Iot);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r0?u[f-1]:void 0,x=f0?i[d-1]:void 0,E=d0)return new vn({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var sq=Bot;var uge=/{[^}]+}/g,lq={x:Fot,y:Vot,z:Hot,s:Got,reverseX:Uot,reverseY:kot,reverseZ:zot,westDegrees:Wot,southDegrees:jot,eastDegrees:Yot,northDegrees:qot,westProjected:Xot,southProjected:Kot,eastProjected:Jot,northProjected:Zot,width:Qot,height:$ot},fge=gt(lq,{i:est,j:tst,reverseI:nst,reverseJ:ist,longitudeDegrees:ost,latitudeDegrees:sst,longitudeProjected:ast,latitudeProjected:cst,format:ust});function iC(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe,l(e.then)){this._reinitialize(e);return}let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Bo({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let o=e.customTags,s=gt(lq,o),a=gt(fge,o);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(iC.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready&&l(this._resource)}},readyPromise:{get:function(){return $("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});iC.prototype.reinitialize=function(e){return $("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._reinitialize(e)};iC.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,r=gt(lq,i),o=gt(fge,i),s=ve.createIfNeeded(n.url),a=ve.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new Bo({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new It(c)),t._credit=c,t._resource=s,t._tags=r,t._pickFeaturesResource=a,t._pickFeaturesTags=o,t._ready=!0,!0})};iC.prototype.getTileCredits=function(e,t,n){};iC.prototype.requestImage=function(e,t,n,i){return qc.loadImage(this,Lot(this,e,t,n,i))};iC.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=Not(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var cz=!1,Bu=new ce,lz=!1,$L=new ce;function Lot(e,t,n,i,r){cz=!1,lz=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(uge);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var aq=!1,sS=new H,cq=!1;function Not(e,t,n,i,r,o,s){cz=!1,lz=!1,aq=!1,cq=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(uge);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function aS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Fot(e,t,n,i){return aS(e,"{x}",t)}function Uot(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return aS(e,"{reverseX}",r)}function Vot(e,t,n,i){return aS(e,"{y}",n)}function kot(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return aS(e,"{reverseY}",r)}function zot(e,t,n,i){let r=e.maximumLevel,o=l(r)&&iPromise.reject(r));Ns.call(this,i),this._promise=i}}Lu._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Lu._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof Dm)return Lu._metadataFailure(e,t);throw r}};Lu.fromUrl=async function(e,t){let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let o=await Lu._requestMetadata(t,i,r),s=new Lu;return Ns.call(s,o),s};l(Object.create)&&(Lu.prototype=Object.create(Ns.prototype),Lu.prototype.constructor=Lu);function dge(e,t){return e.westt.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function mge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),r=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Lu._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let O=0;O`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe,l(e.url)||l(e.channel)){$("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=ve.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=new fq(e);this._readyPromise=hge(r,o,this).then(()=>(o.build(this),this._ready=!0,!0))}}Object.defineProperties(Fl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Fl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),r=ve.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new fq(n);s.channel=t,await hge(o,s);let a=new Fl(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=r,a._url=e,a._path=i,a};Fl.prototype.getTileCredits=function(e,t,n){};Fl.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return qc.loadImage(this,r)};Fl.prototype.pickFeatures=function(e,t,n,i,r){};Fl._logoUrl=void 0;Object.defineProperties(Fl,{logoUrl:{get:function(){return l(Fl._logoUrl)||(Fl._logoUrl=nn("Assets/Images/google_earth_credit.png")),Fl._logoUrl},set:function(e){Fl._logoUrl=e}}});var cS=Fl;var mst=/\/$/,pge=new It('© Mapbox © OpenStreetMap Improve this map');function lS(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=y(e.format,"png");/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();mst.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=pge,this._resource=i,this._imageryProvider=new Ns({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(lS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});lS.prototype.getTileCredits=function(e,t,n){};lS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};lS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};lS._defaultCredit=pge;var uS=lS;function rC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new zi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new pe,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=ve.createIfNeeded(e.url);if(this._resource=r,l(e.tileWidth)||l(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}$("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=mz(r,this).then(o=>(Ai.reportSuccess(this._errorEvent),this._image=o,this._tileWidth=o.width,this._tileHeight=o.height,this._ready=!0,!0))}Object.defineProperties(rC.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function hst(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Ai.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return mz(e,n,o);throw l(n)&&(n._hasError=!0),new de(r)}async function mz(e,t,n){try{return await qc.loadImage(null,e)}catch(i){return hst(e,i,t,n)}}rC.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await mz(n);t=y(t,y.EMPTY_OBJECT);let r=new rC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};rC.prototype.getTileCredits=function(e,t,n){};rC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await mz(this._resource,this);return this._image=r,Ai.reportSuccess(this._errorEvent),r}return this._image};rC.prototype.pickFeatures=function(e,t,n,i,r){};var fS=rC;function pst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=_st:e==="xml"?n=xst:(e==="html"||e==="text")&&(n=_ge)),this.callback=n}function _st(e){let t=[],n=e.features;for(let i=0;i0)for(let o=0;o\s*<\/body>/im,wst=//im,Dst=/([\s\S]*)<\/title>/im;function _ge(e){if(vst.test(e)||wst.test(e))return;let t,n=Dst.exec(e);n&&n.length>1&&(t=n[1]);let i=new hm;return i.name=t,i.description=e,i.data=e,[i]}var oC=pst;function eN(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(eN.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});eN.prototype.getFromCache=function(e,t,n,i){let r=gge(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};eN.prototype.checkApproachingInterval=function(e,t,n,i){let r=gge(e,t,n),o=this._tilesRequestedForInterval,s=yge(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!Age(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};eN.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=yge(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Age(this,c,o),a||s.push(c)}}};function gge(e,t,n){return`${e}-${t}-${n}`}function Ist(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function yge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function Age(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=Ist(s),c=new jr({throttle:!1,throttleByServer:!0,type:Ko.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var sC=eN;var Pst=[3034,3035,3042,3043,3044],Ost=[4471,4559];function gm(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(gm.DefaultParameters,!0),n.setQueryParameters(gm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(xge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(xge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new sC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Cge(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof wi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Ost.includes(a)||Pst.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof wi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ns({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,gm.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function Cge(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Rst(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(gm.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return $("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return $("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});gm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};gm.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Cge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};gm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Rst(this,e,t,n,i,r,s)};gm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});gm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});gm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new oC("json","application/json")),Object.freeze(new oC("xml","text/xml")),Object.freeze(new oC("text","text/html"))]);function xge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var dS=gm;var Mst=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function tN(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=ve.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!l(o)||o.length===1&&/{s}/.test(r))t.setQueryParameters(Mst),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Bo({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new sC({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,A){return Tge(s,d,p,g,h,A)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new It(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Tge(e,t,n,i,r,o){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(o)?o.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=gt(g,u)),l(f)&&(g=gt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:r}),d.setTemplateValues(p)}return qc.loadImage(e,d)}Object.defineProperties(tN.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return $("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});tN.prototype.getTileCredits=function(e,t,n){};tN.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Tge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};tN.prototype.pickFeatures=function(e,t,n,i,r){};var mS=tN;function L_(e){return function(t){return new e(t)}}var Bst={ARCGIS_MAPSERVER:L_(bh),BING:L_(eS),GOOGLE_EARTH:L_(cS),MAPBOX:L_(uS),SINGLE_TILE:L_(fS),TMS:L_(wh),URL_TEMPLATE:L_(Ns),WMS:L_(dS),WMTS:L_(mS)},Lst={ARCGIS_MAPSERVER:bh.fromUrl,BING:async(e,t)=>eS.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,cS.fromUrl(e,n,t)},MAPBOX:(e,t)=>new uS({url:e,...t}),SINGLE_TILE:fS.fromUrl,TMS:wh.fromUrl,URL_TEMPLATE:(e,t)=>new Ns({url:e,...t}),WMS:(e,t)=>new dS({url:e,...t}),WMTS:(e,t)=>new mS({url:e,...t})};function Ul(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new pe;let t=e.assetId;l(t)&&($("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),Ul._initialize(this,t,e))}Object.defineProperties(Ul.prototype,{ready:{get:function(){return $("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return $("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return $("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ul._initialize=function(e,t,n){let i=Zs._createEndpointResource(t,n),r=t.toString()+n.accessToken+n.server,o=Ul._endpointCache[r];l(o)||(o=i.fetchJson(),Ul._endpointCache[r]=o),e._readyPromise=o.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new wh({url:new Zs(s,i)});else{let u=Bst[c];if(!l(u))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return e._tileCredits=Zs.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=e,e._errorEvent.raiseEvent(u)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};Ul.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Zs._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Ul._endpointCache[i];l(r)||(r=n.fetchJson(),Ul._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=o.externalType;if(!l(a))s=await wh.fromUrl(new Zs(o,n));else{let u=Lst[a];if(!l(u))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...o.options},d=f.url;delete f.url,s=await u(d,f)}let c=new Ul(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Zs.getCreditsFromEndpoint(o,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};Ul.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Ul.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Ul.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Ul._endpointCache={};var kf=Ul;var Nst={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},ym=Object.freeze(Nst);function Fst(e){$("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,ym.AERIAL),n=new kf;return kf._initialize(n,t,e),n}var hq=Fst;function Ust(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,ym.AERIAL);return kf.fromAssetId(t)}var N_=Ust;var wge=vr(Hl(),1),Ege=576,Vst=100,nN="#ffffff",pq="#48b";function Dge(e,t){this.credit=e,this.count=y(t,1)}function Ige(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function kst(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Pge="cesium-credit-delimiter";function bge(e){let t=document.createElement("span");return t.textContent=e,t.className=Pge,t}function Sge(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function vge(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(bge(n));else{let f=r[u];f.className!==Pge&&e.replaceChild(bge(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(Sge(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(Sge(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function zst(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Ege?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Ege&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function gc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } -`,n}function Hst(e){let t="";t+=gc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=gc(".cesium-credit-lightbox",{"background-color":"#303336",color:nN,position:"relative","min-height":`${Vst}px`,margin:"auto"}),t+=gc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:nN}),t+=gc(".cesium-credit-lightbox > ul > li a:hover",{color:pq}),t+=gc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=gc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=gc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=gc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:nN}),t+=gc(".cesium-credit-lightbox-close:hover",{color:pq}),t+=gc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=gc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=gc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=gc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:nN}),t+=gc(".cesium-credit-expand-link:hover",{color:pq}),t+=gc(".cesium-credit-text",{color:nN}),t+=gc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Rr(e,t,n){let i=this;n=y(n,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function s(h){o.contains(h.target)||i.hideLightbox()}r.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",o.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let u=document.createElement("ul");o.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Hst(e);let g=It.clone(Rr.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=r,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Oge(e,t,n,i){i=y(i,1);let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new Dge(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Rr.prototype.addCredit=function(e){$("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};Rr.prototype.addCreditToNextFrame=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=It.clone(Rge())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Oge(this,t,e)};Rr.prototype.addDefaultCredit=function(e){$("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;Ige(t,e)||(e.showOnScreen=!0,t.push(e))};Rr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Ige(t,e)||t.push(e)};Rr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Rr.prototype.removeDefaultCredit=function(e){$("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};Rr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Rr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Rr.prototype.update=function(){this._expanded&&zst(this)};Rr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o._isIon&&It.equals(Rr.cesiumCredit,this._cesiumCredit)||Oge(this,s,o,Number.MAX_VALUE)}It.equals(Rr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Rr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Rr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;vge(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",vge(this._creditList,t,void 0,"li"),kst(this)};Rr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Rr.prototype.isDestroyed=function(){return!1};Rr._cesiumCredit=void 0;Rr._cesiumCreditInitialized=!1;var pz;function Rge(){if(!l(pz)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new wge.default(e).path()),pz=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return Rr._cesiumCreditInitialized||(Rr._cesiumCredit=pz,Rr._cesiumCreditInitialized=!0),pz}Object.defineProperties(Rr,{cesiumCredit:{get:function(){return Rge(),Rr._cesiumCredit},set:function(e){Rr._cesiumCredit=e,Rr._cesiumCreditInitialized=!0}}});Rr.CreditDisplayElement=Dge;var iN=Rr;function rN(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } -`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } -`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } -`;break;case"vec4":o=`vec4 getColor() { return ${r}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${r}; -${o} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=$i.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(rN.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});rN.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;rN.prototype.isTranslucent=$i.prototype.isTranslucent;rN.prototype.getRenderState=$i.prototype.getRenderState;var _q=rN;function _z(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Gst=new m,Wst=new Z,jst=new Le,Yst=new bi,qst=new Yc,Xst=new rn,Kst=new To,Jst=new z,Zst=[1,1e5];_z.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof bi?a=Yst:s instanceof Yc?a=qst:s instanceof rn?a=Xst:a=Kst,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Zst,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=m.negate(g,Gst);let h=Wst;Z.setColumn(h,0,g,h),Z.setColumn(h,1,p,h),Z.setColumn(h,2,d,h);let A=Le.fromRotationMatrix(h,jst);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new vn({geometryInstances:new Tt({geometry:new Xx({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:kt.fromColor(z.fromAlpha(this._color,.1,Jst))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new vn({geometryInstances:new Tt({geometry:new nL({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:kt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};_z.prototype.isDestroyed=function(){return!1};_z.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var Dh=_z;function Mge(){this._cachedShowFrustumsShaders={}}function Qst(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function $st(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",r.sources.push(a);let u=Qst(i);return Zt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var oN=new z;function eat(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(oN.red=t.debugOverlappingFrustums&1<<0?1:0,oN.green=t.debugOverlappingFrustums&1<<1?1:0,oN.blue=t.debugOverlappingFrustums&1<<2?1:0,oN.alpha=1,oN):z.WHITE}),n}var tat=new nt;Mge.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=$st(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=nt.shallowClone(t,tat);o.shaderProgram=r,o.uniformMap=eat(e,t),o.execute(e.context,n)};var sN=Mge;function gz(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=new B,this.id=e.id,this._id=void 0,this._primitive=void 0}gz.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!B.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=B.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Tt({geometry:new b_({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:Uo.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),n=new Tt({geometry:new b_({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:Uo.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),i=new Tt({geometry:new b_({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:Uo.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this});this._primitive=new vn({geometryInstances:[t,n,i],appearance:new Uo,asynchronous:!1})}this._primitive.update(e)}};gz.prototype.isDestroyed=function(){return!1};gz.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var aN=gz;var cN=`in vec4 positionEC; - -void main() -{ - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) - { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); - } - - czm_ray ray = czm_ray(position, direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) - { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); - } - else - { - discard; - } - - czm_writeLogDepth(); -} -`;var lN=`in vec4 position; - -out vec4 positionEC; - -void main() -{ - positionEC = czm_modelView * position; - gl_Position = czm_projection * positionEC; - - czm_vertexLogDepth(); -} -`;function fN(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var uN=Wt.supportsTypedArrays()?new Float32Array(12):[],Bge=new m,Lge=new m,gq=new m,Nge=new m,yz=new m;function nat(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof rn)r=m.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,Bge),g=m.normalize(p,Lge),h=m.normalize(m.cross(m.UNIT_Z,p,gq),gq),A=m.normalize(m.cross(g,h,Nge),Nge),x=m.magnitude(p),C=Math.sqrt(x*x-1);r=m.multiplyByScalar(g,1/x,Bge);let T=C/x;o=m.multiplyByScalar(h,T,Lge),s=m.multiplyByScalar(A,T,gq)}let a=m.add(r,s,yz);m.subtract(a,o,a),m.multiplyComponents(n,a,a),m.pack(a,uN,0);let c=m.subtract(r,s,yz);m.subtract(c,o,c),m.multiplyComponents(n,c,c),m.pack(c,uN,3);let u=m.add(r,s,yz);m.add(u,o,u),m.multiplyComponents(n,u,u),m.pack(u,uN,6);let f=m.subtract(r,s,yz);return m.add(f,o,f),m.multiplyComponents(n,f,f),m.pack(f,uN,9),uN}fN.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:Se.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new He({sources:[lN]}),a=new He({sources:[cN]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=nat(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new ft({attributes:{position:new we({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Be.TRIANGLES});this._va=oi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};fN.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};fN.prototype.isDestroyed=function(){return!1};fN.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var dN=fN;function mN(){}var iat=/\bgl_FragDepth\b/,rat=/\bdiscard\b/;function oat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource,o,s=!1,a=r.sources,c=a.length;for(o=0;o<c;++o)if(iat.test(a[o])||rat.test(a[o])){s=!0;break}let u=!1,f=r.defines;for(c=f.length,o=0;o<c;++o)if(f[o]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main() -{ - out_FragColor = vec4(1.0); -} -`,r=new He({sources:[d]})):!s&&u&&(d=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`,r=new He({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}function sat(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let r=ze.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=ze.fromCache(r),n[t.id]=i}return i}mN.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=oat(n,t.shaderProgram),i.depthOnlyCommand.renderState=sat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var aat=/\s+czm_writeLogDepth\(/,cat=/\s+czm_vertexLogDepth\(/;function lat(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,u=!1,f=o.sources,d=f.length;for(a=0;a<d;++a)if(cat.test(f[a])){u=!0;break}if(!u){for(a=0;a<d;++a)f[a]=He.replaceMain(f[a],"czm_log_depth_main");c=` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`,f.push(c)}for(f=s.sources,d=f.length,u=!1,a=0;a<d;++a)aat.test(f[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<d;a++)f[a]=He.replaceMain(f[a],"czm_log_depth_main");p+=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}return i}mN.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=lat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function uat(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let r=t._attributeLocations,o=t.fragmentShaderSource,s=o.sources,a=s.length,c=`void main() -{ - czm_non_pick_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = ${n}; -} -`,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=He.replaceMain(s[f],"czm_non_pick_main");u[a]=c,o=new He({sources:u,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}function fat(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let r=ze.getState(t);r.blending.enabled=!1,r.depthMask=!0,i=ze.fromCache(r),n[t.id]=i}return i}mN.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=uat(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=fat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};function dat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}mN.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=dat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var F_=mN;function Az(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var mat=new Le,Fge=new Le,hat=new Z;function pat(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,Fge),c=Le.fromAxisAngle(o,i,mat),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,Fge);Le.multiply(f,u,u);let d=Z.fromQuaternion(u,hat);Z.multiplyByVector(d,o,o),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,r,r)}Az.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;pat(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Az.prototype.isDestroyed=function(){return!1};Az.prototype.destroy=function(){return this._removeListener(),ue(this)};var hN=Az;function _at(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var yq=_at;var hS=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; - -in vec3 v_positionEC; - -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes - - vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; - - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} - -void main() -{ - // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii - // in the vertex shader. Only when it is larger than some constant, march along the ray. - // Otherwise perform one intersection test which will be the common case. - - // Test if the ray intersects a sphere with the ellipsoid's maximum radius. - // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test - // may cause false negatives. This will discard fragments before marching the ray forward. - float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; - vec3 direction = normalize(v_positionEC); - vec3 ellipsoidCenter = czm_modelView[3].xyz; - - float t1 = -1.0; - float t2 = -1.0; - - float b = -2.0 * dot(direction, ellipsoidCenter); - float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; - - float discriminant = b * b - 4.0 * c; - if (discriminant >= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; - } - - if (t1 < 0.0 && t2 < 0.0) { - discard; + if (t1 < 0.0 && t2 < 0.0) { + discard; } float t = min(t1, t2); @@ -11324,7 +9616,7 @@ void main() #endif #endif } -`;var pS=`in vec3 position; +`;var nS=`in vec3 position; uniform vec3 u_radii; @@ -11352,2974 +9644,320 @@ void main() czm_vertexLogDepth(); } -`;var Aq={position:0};function xz(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=new B,this._computedModelMatrix=new B,this.show=y(e.show,!0),this.material=y(e.material,ki.fromType(ki.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:y(e._owner,this)}),this._pickCommand=new nt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function gat(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=sl.createGeometry(sl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Pe.POSITION_ONLY}));return t=oi.fromGeometry({context:e,geometry:n,attributeLocations:Aq,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}xz.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?mn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=gat(t));let r=!1,o=this.radii;if(!m.equals(this._radii,o)){m.clone(o,this._radii);let A=this._oneOverEllipsoidRadiiSquared;A.x=1/(o.x*o.x),A.y=1/(o.y*o.y),A.z=1/(o.z*o.z),r=!0}(!B.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(B.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),B.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(o),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new He({sources:[pS]}),p=new He({sources:[this.material.shaderSource,hS]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Aq}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=gt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Se.TRANSLUCENT:Se.OPAQUE,g.push(f)),h.pick){let A=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new He({sources:[pS]}),p=new He({sources:[this.material.shaderSource,hS],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Zt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Aq}),A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._pickSP,A.uniformMap=gt(gt(this._uniforms,this._pickUniforms),this.material._uniforms),A.executeInClosestFrustum=n),A.boundingVolume=this._boundingSphere,A.modelMatrix=this._computedModelMatrix,A.pass=n?Se.TRANSLUCENT:Se.OPAQUE,g.push(A)}};xz.prototype.isDestroyed=function(){return!1};xz.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var pN=xz;var _N=`in vec3 v_positionMC; -in vec3 v_positionEC; -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - materialInput.s = v_st.s; - materialInput.st = v_st; - materialInput.str = vec3(v_st, 0.0); - - // Convert tangent space material normal to eye space - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); - - // Convert view vector to world space - vec3 positionToEyeEC = -v_positionEC; - materialInput.positionToEyeEC = positionToEyeEC; - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var gN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec2 st; -in float batchId; - -out vec3 v_positionMC; -out vec3 v_positionEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); +`;/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */var DN=`/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ - v_positionMC = position3DHigh + position3DLow; // position in model coordinates - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_st = st; +// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples +// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function aC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,gN),this._fragmentShaderSource=y(e.fragmentShaderSource,_N),this._renderState=$i.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(aC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return aC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});aC.VERTEX_FORMAT=Pe.POSITION_AND_ST;aC.prototype.getFragmentShaderSource=$i.prototype.getFragmentShaderSource;aC.prototype.isTranslucent=$i.prototype.isTranslucent;aC.prototype.getRenderState=$i.prototype.getRenderState;var xq=aC;function Uge(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var Cz=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],Ih=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<Ih.length;++e)Ih[e]*=1e6;var Vge=Ih[1],Cq=Ih[Ih.length-1];for(let e=0;e<Ih.length;++e)Ih[e]=(Ih[e]-Cq)/(Vge-Cq);var la=0;function yat(e){let t=Cz,n=t.length;if(e<t[0])return la=0,la;if(e>t[n-1])return la=n-2,la;if(e>=t[la]){if(la+1<n&&e<t[la+1])return la;if(la+2<n&&e<t[la+2])return++la,la}else if(la-1>=0&&e>=t[la-1])return--la,la;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return la=i,la}var Aat=new m;Uge.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let r=i.height,o=yat(r),s=P.clamp((r-Cz[o])/(Cz[o+1]-Cz[o]),0,1),a=P.lerp(Ih[o],Ih[o+1],s),c=this.density*1e6,u=c/Vge*Cq;a=a*(c-u)*1e-6;let f=m.normalize(n.positionWC,Aat),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var yN=Uge;function Vl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Vl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Vl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Vl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Vl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Vl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new pe,this._nominalFrameRate=new pe,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){xat(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){Cat(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Vl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Vl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Vl({scene:e})),e._frameRateMonitor};Object.defineProperties(Vl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Vl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Vl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Vl.prototype.isDestroyed=function(){return!1};Vl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function xat(e,t){if(e._pauseCount>0)return;let n=yi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Zn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function Cat(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var AN=Vl;function Tat(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var xN=Tat;function Eat(e,t){this.near=y(e,0),this.far=y(t,0);let n=Se.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var CN=Eat;function bat(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = ${n}.rgb; - float clippingPlanesEdgeWidth = ${n}.a; - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) - { - out_FragColor = clippingPlanesEdgeColor; - } -`}var TN=bat;var EN=`uniform vec4 u_initialColor; +// Steps used to integrate into Cesium: +// * The following defines are set: +// #define FXAA_PC 1 +// #define FXAA_WEBGL_1 1 +// #define FXAA_GREEN_AS_LUMA 1 +// #define FXAA_EARLY_EXIT 1 +// #define FXAA_GLSL_120 1 +// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. +// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace +// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. +// * There are no implicit conversions from ivec* to vec* so replace: +// #define FxaaInt2 ivec2 +// with +// #define FxaaInt2 vec2 +// * The texture2DLod function is only available in vertex shaders so replace: +// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +// with +// #define FxaaTexTop(t, p) texture(t, p) +// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) +// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. +// * The following parameters to FxaaPixelShader are unused and can be removed: +// fxaaConsolePosPos +// fxaaConsoleRcpFrameOpt +// fxaaConsoleRcpFrameOpt2 +// fxaaConsole360RcpFrameOpt2 +// fxaaConsoleEdgeSharpness +// fxaaConsoleEdgeThreshold +// fxaaConsoleEdgeThresholdMi +// fxaaConsole360ConstDir -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP -uniform sampler2D u_mars_clip_area; -uniform bool u_mars_clip_enabled; -uniform bool u_mars_clip_only; -uniform mat4 u_mars_clip_inverMatrix; -uniform vec4 u_mars_clip_rect; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +//#define FXAA_QUALITY_PRESET 12 -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 10) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 3.0 + #define FXAA_QUALITY_P2 12.0 #endif - -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 11) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 3.0 + #define FXAA_QUALITY_P3 12.0 #endif - -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 12) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 4.0 + #define FXAA_QUALITY_P4 12.0 #endif - -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 13) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 4.0 + #define FXAA_QUALITY_P5 12.0 #endif - -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 14) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 4.0 + #define FXAA_QUALITY_P6 12.0 #endif - -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 15) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 12.0 #endif - -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 20) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 2.0 + #define FXAA_QUALITY_P2 8.0 #endif - -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 21) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 8.0 #endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D -uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; +#if (FXAA_QUALITY_PRESET == 22) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 8.0 #endif - -#ifdef APPLY_FILTER_COLOR_MARS3D -uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif - -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif - -#ifdef SHOW_REFLECTIVE_OCEAN -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif - -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif - -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif - -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif - -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif - -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; // Hue, saturation, brightness +#if (FXAA_QUALITY_PRESET == 23) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 8.0 #endif - -#ifdef HIGHLIGHT_FILL_TILE -uniform vec4 u_fillHighlightColor; +#if (FXAA_QUALITY_PRESET == 24) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 3.0 + #define FXAA_QUALITY_P6 8.0 #endif - -#ifdef TRANSLUCENT -uniform vec4 u_frontFaceAlphaByDistance; -uniform vec4 u_backFaceAlphaByDistance; -uniform vec4 u_translucencyRectangle; +#if (FXAA_QUALITY_PRESET == 25) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 8.0 #endif - -#ifdef UNDERGROUND_COLOR -uniform vec4 u_undergroundColor; -uniform vec4 u_undergroundColorAlphaByDistance; +#if (FXAA_QUALITY_PRESET == 26) + #define FXAA_QUALITY_PS 9 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 4.0 + #define FXAA_QUALITY_P8 8.0 #endif - -#ifdef ENABLE_VERTEX_LIGHTING -uniform float u_lambertDiffuseMultiplier; -uniform float u_vertexShadowDarkness; +#if (FXAA_QUALITY_PRESET == 27) + #define FXAA_QUALITY_PS 10 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 4.0 + #define FXAA_QUALITY_P9 8.0 #endif - -in vec3 v_positionMC; -in vec3 v_positionEC; -in vec3 v_textureCoordinates; -in vec3 v_normalMC; -in vec3 v_normalEC; - -#ifdef APPLY_MATERIAL -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -uniform bool u_mars_flood_globe; - -uniform sampler2D u_mars_flood_area; -uniform bool u_mars_flood_emabled; -uniform bool u_showFloodOnly; -uniform mat4 u_mars_flood_inverMatrix; -uniform vec4 u_mars_flood_rect; -uniform bool u_mars_flood_showElse; -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - -in float v_height; -in float v_slope; -in float v_aspect; +#if (FXAA_QUALITY_PRESET == 28) + #define FXAA_QUALITY_PS 11 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 4.0 + #define FXAA_QUALITY_P10 8.0 #endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; +#if (FXAA_QUALITY_PRESET == 29) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 #endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; +#if (FXAA_QUALITY_PRESET == 39) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.0 + #define FXAA_QUALITY_P2 1.0 + #define FXAA_QUALITY_P3 1.0 + #define FXAA_QUALITY_P4 1.0 + #define FXAA_QUALITY_P5 1.5 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 #endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT -uniform int u_mars_uplift_RectangleWidth; -uniform int u_mars_uplift_RectangleHeight; -uniform highp sampler2D u_mars_uplift_RampRectangle; -uniform float u_mars_inverseTileWidth; -uniform vec2 u_mars_cartographicTileRectangle; -uniform bool u_mars_uplift_enabled; -uniform bool u_mars_uplift_hideInsideOrOutside; - -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); - float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); - vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, 0.0); -} - -bool inSlopeRampRectangle() { - for(int h = 0; h < 100000; h++) { - if(h >= u_mars_uplift_RectangleWidth) - break; - - vec4 first = getRegions(0, h); - float currentLength = first.z; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++) { - if(float(w) >= currentLength) - break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { - if(v_textureCoordinates.y <= max(p1.y, p2.y)) { - if(p1.x != p2.x) { - xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { - counter += 1.0; - } - } - } - } +#define FxaaBool bool +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 vec2 +#define FxaaTex sampler2D - } - if((mod(counter, 2.0) != 0.0)) { - return true; - } - } +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTexTop(t, p) texture(t, p) +#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - return false; -} -#endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); -} -#endif - -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ - return - v_textureCoordinates.x > u_translucencyRectangle.x && - v_textureCoordinates.x < u_translucencyRectangle.z && - v_textureCoordinates.y > u_translucencyRectangle.y && - v_textureCoordinates.y < u_translucencyRectangle.w; -} -#endif - -vec4 sampleAndBlend( - vec4 previousColor, - sampler2D textureToSample, - vec2 tileTextureCoordinates, - vec4 textureCoordinateRectangle, - vec4 textureCoordinateTranslationAndScale, - float textureAlpha, - float textureNightAlpha, - float textureDayAlpha, - float textureBrightness, - float textureContrast, - float textureHue, - float textureSaturation, - float textureOneOverGamma, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - bool textureInvertColor, - vec3 texturefilterColor, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - float split, - vec4 colorToAlpha, - float nightBlend) -{ - // This crazy step stuff sets the alpha to 0.0 if this following condition is true: - // tileTextureCoordinates.s < textureCoordinateRectangle.s || - // tileTextureCoordinates.s > textureCoordinateRectangle.p || - // tileTextureCoordinates.t < textureCoordinateRectangle.t || - // tileTextureCoordinates.t > textureCoordinateRectangle.q - // In other words, the alpha is zero if the fragment is outside the rectangle - // covered by this texture. Would an actual 'if' yield better performance? - vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - - alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif - - vec2 translation = textureCoordinateTranslationAndScale.xy; - vec2 scale = textureCoordinateTranslationAndScale.zw; - vec2 textureCoordinates = tileTextureCoordinates * scale + translation; - vec4 value = texture(textureToSample, textureCoordinates); - vec3 color = value.rgb; - float alpha = value.a; - -#ifdef APPLY_COLOR_TO_ALPHA - vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); - colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); - alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif - -#if !defined(APPLY_GAMMA) - vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); - color = tempColor.rgb; - alpha = tempColor.a; -#else - color = pow(color, vec3(textureOneOverGamma)); -#endif - -#ifdef APPLY_SPLIT - float splitPosition = czm_splitPosition; - // Split to the left - if (split < 0.0 && gl_FragCoord.x > splitPosition) { - alpha = 0.0; - } - // Split to the right - else if (split > 0.0 && gl_FragCoord.x < splitPosition) { - alpha = 0.0; - } -#endif - -#ifdef APPLY_BRIGHTNESS - color = mix(vec3(0.0), color, textureBrightness); -#endif - -#ifdef APPLY_CONTRAST - color = mix(vec3(0.5), color, textureContrast); -#endif - -#ifdef APPLY_HUE - color = czm_hue(color, textureHue); -#endif - -#ifdef APPLY_SATURATION - color = czm_saturation(color, textureSaturation); -#endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D - if(textureInvertColor) { - color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); - } -#endif - -#ifdef APPLY_FILTER_COLOR_MARS3D - if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { - color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - - float sourceAlpha = alpha * textureAlpha; - float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); - outAlpha += sign(outAlpha) - 1.0; - - vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; - - // When rendering imagery for a tile in multiple passes, - // some GPU/WebGL implementation combinations will not blend fragments in - // additional passes correctly if their computation includes an unmasked - // divide-by-zero operation, - // even if it's not in the output or if the output has alpha zero. +FxaaFloat4 FxaaPixelShader( // - // For example, without sanitization for outAlpha, - // this renders without artifacts: - // if (outAlpha == 0.0) { outColor = vec3(0.0); } + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, // - // but using czm_branchFreeTernary will cause portions of the tile that are - // alpha-zero in the additional pass to render as black instead of blending - // with the previous pass: - // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); - // - // So instead, sanitize against divide-by-zero, - // store this state on the sign of outAlpha, and correct on return. - - return vec4(outColor, max(outAlpha, 0.0)); -} - -vec3 colorCorrect(vec3 rgb) { -#ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - rgb = czm_HSBToRGB(hsb); -#endif - return rgb; -} - -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); - -const float fExposure = 2.0; - -vec3 computeEllipsoidPosition() -{ - float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); - vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); - xy *= czm_viewport.zw * mpp * 0.5; - - vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); - czm_ray ray = czm_ray(vec3(0.0), direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - - vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); - return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; -} - -void main() -{ -#ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) - { - discard; - } -#endif - -#ifdef ENABLE_CLIPPING_PLANES - float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif - -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) - vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates - vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes -#endif - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); -#else - float nightBlend = 0.0; -#endif - - // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 - // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the - // fragments on the edges of tiles even though the vertex shader is outputting - // coordinates strictly in the 0-1 range. - vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); - -#ifdef SHOW_TILE_BOUNDARIES - if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || - v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) - { - color = vec4(1.0, 0.0, 0.0, 1.0); - } -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) - float cameraDist; - if (czm_sceneMode == czm_sceneMode2D) - { - cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; - } - else if (czm_sceneMode == czm_sceneModeColumbusView) - { - cameraDist = -czm_view[3].z; - } - else - { - cameraDist = length(czm_view[3]); - } - float fadeOutDist = u_lightingFadeDistance.x; - float fadeInDist = u_lightingFadeDistance.y; - if (czm_sceneMode != czm_sceneMode3D) { - vec3 radii = czm_ellipsoidRadii; - float maxRadii = max(radii.x, max(radii.y, radii.z)); - fadeOutDist -= maxRadii; - fadeInDist -= maxRadii; - } - float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else - float fade = 0.0; -#endif - -#ifdef SHOW_REFLECTIVE_OCEAN - vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; - vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; - vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; - waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; - - float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; - - if (mask > 0.0) - { - mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); - - vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); - vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); - - vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); - - color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); - } -#endif - -#ifdef APPLY_MATERIAL - czm_materialInput materialInput; - materialInput.st = v_textureCoordinates.st; - materialInput.normalEC = normalize(v_normalEC); - materialInput.positionToEyeEC = -v_positionEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); - materialInput.slope = v_slope; - materialInput.height = v_height; - materialInput.aspect = v_aspect; - czm_material material = czm_getMaterial(materialInput); - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 - - vec4 materialColor = vec4(material.diffuse, material.alpha); - if(u_mars_flood_emabled) { - if(u_mars_flood_globe) { - vec4 materialColor = vec4(material.diffuse, material.alpha); - color = alphaBlend(materialColor, color); - } else { - vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); - vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; - vec4 ymColor = texture(u_mars_flood_area, newuv); - if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { - color.xyz = mix(color.xyz, material.diffuse, material.alpha); - } else { - if(!u_mars_flood_showElse) { - discard; - } - } - } - } - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#endif - -#ifdef ENABLE_VERTEX_LIGHTING - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); - diffuseIntensity = mix(1.0, diffuseIntensity, fade); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else - vec4 finalColor = color; -#endif - -#ifdef ENABLE_CLIPPING_PLANES - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; - - if (clipDistance < clippingPlanesEdgeWidth) - { - finalColor = clippingPlanesEdgeColor; - } -#endif - -#ifdef HIGHLIGHT_FILL_TILE - finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); -#endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) - if (!czm_backFacing()) - { - bool dynamicLighting = false; - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. - // Otherwise, the scattering is computed in the vertex shader. - #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE - positionWC = computeEllipsoidPosition(); - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - computeAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - #else - positionWC = v_positionMC; - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - #endif - - rayleighColor = colorCorrect(rayleighColor); - mieColor = colorCorrect(mieColor); - - vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - // Fog is applied to tiles selected for fog, close to the Earth. - #ifdef FOG - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is lighting, apply that to the fog. - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); - fogColor *= darken; - #endif - - #ifndef HDR - fogColor.rgb = czm_acesTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - const float modifier = 0.15; - finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); - - #else - // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. - // This value is larger near the "circumference", as it is further away from the camera. We use it to - // brighten up that area of the ground atmosphere. - const float transmittanceModifier = 0.5; - float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); - - vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float fadeInDist = u_nightFadeDistance.x; - float fadeOutDist = u_nightFadeDistance.y; - - float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); - float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); - vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); - - finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); - #endif - - #ifndef HDR - finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); - #else - finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); - #endif - - finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); - #endif - } -#endif - -#ifdef UNDERGROUND_COLOR - if (czm_backFacing()) - { - float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); - float distance = max(v_distance - distanceFromEllipsoid, 0.0); - float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); - vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); - finalColor = alphaBlend(undergroundColor, finalColor); - } -#endif - -#ifdef TRANSLUCENT - if (inTranslucencyRectangle()) - { - vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; - finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); - } -#endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP - if(u_mars_clip_enabled) { - vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); - vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; - vec4 tColor = texture(u_mars_clip_area, tuv); - if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { - if(u_mars_clip_only) { - discard; - } - } else { - if(!u_mars_clip_only) { - discard; - } - } - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT - if(u_mars_uplift_enabled) { - bool isInSlopeRampRectangle = inSlopeRampRectangle(); - if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { - discard; - } - } -#endif - - out_FragColor = finalColor; -} - - -#ifdef SHOW_REFLECTIVE_OCEAN - -float waveFade(float edge0, float edge1, float x) -{ - float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return pow(1.0 - y, 5.0); -} - -float linearFade(float edge0, float edge1, float x) -{ - return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} - -// Based on water rendering by Jonas Wagner: -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -// low altitude wave settings -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; - -// high altitude wave settings -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; - -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ - vec3 positionToEyeEC = -positionEyeCoordinates; - float positionToEyeECLength = length(positionToEyeEC); - - // The double normalize below works around a bug in Firefox on Android devices. - vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); - - // Fade out the waves as the camera moves far from the surface. - float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); - -#ifdef SHOW_OCEAN_WAVES - // high altitude waves - float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; - vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); - vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); - - // low altitude waves - time = czm_frameNumber * oceanAnimationSpeedLowAltitude; - noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); - vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); - - // blend the 2 wave layers based on distance to surface - float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); - float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); - vec3 normalTangentSpace = - (highAltitudeFade * normalTangentSpaceHighAltitude) + - (lowAltitudeFade * normalTangentSpaceLowAltitude); - normalTangentSpace = normalize(normalTangentSpace); - - // fade out the normal perturbation as we move farther from the water surface - normalTangentSpace.xy *= waveIntensity; - normalTangentSpace = normalize(normalTangentSpace); -#else - vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif - - vec3 normalEC = enuToEye * normalTangentSpace; - - const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); - - // Use diffuse light to highlight the waves - float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; - vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); - -#ifdef SHOW_OCEAN_WAVES - // Where diffuse light is low or non-existent, use wave highlights based solely on - // the wave bumpiness and no particular light direction. - float tsPerturbationRatio = normalTangentSpace.z; - vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else - vec3 nonDiffuseHighlight = vec3(0.0); -#endif - - // Add specular highlights in 3D, and in all modes when zoomed in. - float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); - float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); - float specular = specularIntensity * surfaceReflectance; - -#ifdef HDR - specular *= 1.4; - - float e = 0.2; - float d = 3.3; - float c = 1.7; - - vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); -#else - vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; -#endif - - return vec4(color, imageryColor.a); -} - -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var bN=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; -#else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; -#endif - -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; -#endif - -#ifdef EXAGGERATION -uniform vec2 u_terrainExaggerationAndRelativeHeight; -#endif - -uniform vec3 u_center3D; -uniform mat4 u_modifiedModelView; -uniform mat4 u_modifiedModelViewProjection; -uniform vec4 u_tileRectangle; - -// Uniforms for 2D Mercator projection -uniform vec2 u_southAndNorthLatitude; -uniform vec2 u_southMercatorYAndOneOverHeight; - -out vec3 v_positionMC; -out vec3 v_positionEC; - -out vec3 v_textureCoordinates; -out vec3 v_normalMC; -out vec3 v_normalEC; - -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT -uniform bool u_mars_flat_enabled; -uniform int u_mars_flat_AreaWidth; -uniform int u_mars_flat_AreaHeight; -uniform highp float u_mars_inverseTileWidth; -uniform highp vec2 u_mars_cartographicTileRectangle; -uniform highp sampler2D u_mars_flat_AreaTexture; -const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C - -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); - float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); - vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, point.w); -} - -float inRectangle(vec2 textureCoordinates) { - for(int h = 0; h < 100000; h++){ - if(h >= u_mars_flat_AreaWidth) break; - - vec4 first = getRegions(0, h); - float currentLength = first.z; - float height = first.w; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++){ - if(float(w) >= currentLength) break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ - if (textureCoordinates.y <= max(p1.y, p2.y)){ - if (p1.x != p2.x){ - xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if (p1.y == p2.y || textureCoordinates.y <= xinters) - { - counter += 1.0; - } - } - } - } - - } - if((mod(counter, 2.0) != 0.0)) { - return height; - } - } - - return invalidValue; -} -#endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 - -#ifdef APPLY_MATERIAL -out float v_slope; -out float v_aspect; -out float v_height; -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; -#endif - -// These functions are generated at runtime. -vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); -float get2DYPositionFraction(vec2 textureCoordinates); - -vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return u_modifiedModelViewProjection * vec4(position, 1.0); -} - -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ - // The width of a tile at level 11, in radians and assuming a single root tile, is - // 2.0 * czm_pi / pow(2.0, 11.0) - // We want to just linearly interpolate the 2D position from the texture coordinates - // when we're at this level or higher. The constant below is the expression - // above evaluated and then rounded up at the 4th significant digit. - const float maxTileWidth = 0.003068; - float positionFraction = textureCoordinates.y; - float southLatitude = u_southAndNorthLatitude.x; - float northLatitude = u_southAndNorthLatitude.y; - if (northLatitude - southLatitude > maxTileWidth) - { - float southMercatorY = u_southMercatorYAndOneOverHeight.x; - float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; - - float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); - currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); - positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); - } - return positionFraction; -} - -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ - return textureCoordinates.y; -} - -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) -{ - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - return u_modifiedModelViewProjection * rtcPosition2D; -} - -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, 0.0, textureCoordinates); -} - -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, height, textureCoordinates); -} - -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ - // We do not do RTC while morphing, so there is potential for jitter. - // This is unlikely to be noticeable, though. - vec3 position3DWC = position + u_center3D; - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); - return czm_modelViewProjection * morphPosition; -} - -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; -#endif - -void main() -{ -#ifdef QUANTIZATION_BITS12 - vec2 xy = czm_decompressTextureCoordinates(compressed0.x); - vec2 zh = czm_decompressTextureCoordinates(compressed0.y); - vec3 position = vec3(xy, zh.x); - float height = zh.y; - vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); - - height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; - position = (u_scaleAndBias * vec4(position, 1.0)).xyz; - -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = compressed1; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = 0.0; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = compressed0.w; -#else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; -#endif - -#else - // A single float per element - vec3 position = position3DAndHeight.xyz; - float height = position3DAndHeight.w; - vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; - -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = textureCoordAndEncodedNormals.w; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = textureCoordAndEncodedNormals.z; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = 0.0; -#else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; -#endif - -#endif - - vec3 position3DWC = position + u_center3D; - -#ifdef GEODETIC_SURFACE_NORMALS - vec3 ellipsoidNormal = geodeticSurfaceNormal; -#else - vec3 ellipsoidNormal = normalize(position3DWC); -#endif - -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - float exaggeration = u_terrainExaggerationAndRelativeHeight.x; - float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; - float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; - - // stop from going through center of earth - float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); - newHeight = max(newHeight, -minRadius); - - vec3 offset = ellipsoidNormal * (newHeight - height); - position += offset; - position3DWC += offset; - height = newHeight; -#endif - - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT - if(u_mars_flat_enabled){ - float isInside = inRectangle(textureCoordinates); - if(isInside != invalidValue){ - vec3 offset = (isInside - height) * ellipsoidNormal; - position += offset; - position3DWC += offset; - height = isInside; - // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; - } - } -#endif - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 - - gl_Position = getPosition(position, height, textureCoordinates); - - v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; - v_positionMC = position3DWC; // position in model coordinates - - v_textureCoordinates = vec3(textureCoordinates, webMercatorT); - -#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - vec3 normalMC = czm_octDecode(encodedNormal); - -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; - vec3 rejection = normalMC - projection; - normalMC = normalize(projection + rejection * exaggeration); -#endif - - v_normalMC = normalMC; - v_normalEC = czm_normal3D * v_normalMC; -#endif - -#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) - - bool dynamicLighting = false; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - - vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); - - computeAtmosphereScattering( - position3DWC, - lightDirection, - v_atmosphereRayleighColor, - v_atmosphereMieColor, - v_atmosphereOpacity - ); -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) - v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); -#endif - -#ifdef APPLY_MATERIAL - float northPoleZ = czm_ellipsoidRadii.z; - vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); - vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); - float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); - v_slope = acos(dotProd); - vec3 normalRejected = ellipsoidNormal * dotProd; - vec3 normalProjected = v_normalMC - normalRejected; - vec3 aspectVector = normalize(normalProjected); - v_aspect = acos(dot(aspectVector, vectorEastMC)); - float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); - v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); - v_height = height; -#endif -} -`;var U_=`uniform vec3 u_radiiAndDynamicAtmosphereColor; - -uniform float u_atmosphereLightIntensity; -uniform float u_atmosphereRayleighScaleHeight; -uniform float u_atmosphereMieScaleHeight; -uniform float u_atmosphereMieAnisotropy; -uniform vec3 u_atmosphereRayleighCoefficient; -uniform vec3 u_atmosphereMieCoefficient; - -const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. -const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. -const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - -/** - * Rational approximation to tanh(x) -*/ -float approximateTanh(float x) { - float x2 = x * x; - return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); -} - -/** - * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as - * the transmittance value for the ray. - * - * @param {czm_ray} primaryRay The ray from the camera to the position. - * @param {float} primaryRayLength The length of the primary ray. - * @param {vec3} lightDirection The direction of the light to calculate the scattering from. - * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. - * @param {vec3} mieColor The variable the Mie scattering will be written to. - * @param {float} opacity The variable the transmittance will be written to. - * @glslFunction - */ -void computeScattering( - czm_ray primaryRay, - float primaryRayLength, - vec3 lightDirection, - float atmosphereInnerRadius, - out vec3 rayleighColor, - out vec3 mieColor, - out float opacity -) { - - // Initialize the default scattering amounts to 0. - rayleighColor = vec3(0.0); - mieColor = vec3(0.0); - opacity = 0.0; - - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - - vec3 origin = vec3(0.0); - - // Calculate intersection from the camera to the outer ring of the atmosphere. - czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); - - // Return empty colors if no intersection with the atmosphere geometry. - if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { - return; - } - - // To deal with smaller values of PRIMARY_STEPS (e.g. 4) - // we implement a split strategy: sky or horizon. - // For performance reasons, instead of a if/else branch - // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 - float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); - // Value close to 0.0: close to the horizon - // Value close to 1.0: above in the sky - float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); - - // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. - float start_0 = primaryRayAtmosphereIntersect.start; - primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); - // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. - primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); - - // For the number of ray steps, distinguish inside or outside atmosphere (outer space) - // (1) from outer space we have to use more ray steps to get a realistic rendering - // (2) within atmosphere we need fewer steps for faster rendering - float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters - float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); - int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. - int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - - // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. - float rayPositionLength = primaryRayAtmosphereIntersect.start; - // (1) Outside the atmosphere: constant rayStepLength - // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps - float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; - float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); - float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); - - vec3 rayleighAccumulation = vec3(0.0); - vec3 mieAccumulation = vec3(0.0); - vec2 opticalDepth = vec2(0.0); - vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); - - // Sample positions on the primary ray. - for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { - - // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= PRIMARY_STEPS) { - break; - } - - // Calculate sample position along viewpoint ray. - vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); - - // Calculate height of sample position above ellipsoid. - float sampleHeight = length(samplePosition) - atmosphereInnerRadius; - - // Calculate and accumulate density of particles at the sample position. - vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; - opticalDepth += sampleDensity; - - // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. - czm_ray lightRay = czm_ray(samplePosition, lightDirection); - czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); - - float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); - float lightPositionLength = 0.0; - - vec2 lightOpticalDepth = vec2(0.0); - - // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. - for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { - - // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (j >= LIGHT_STEPS) { - break; - } - - // Calculate sample position along light ray. - vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); - - // Calculate height of the light sample position above ellipsoid. - float lightHeight = length(lightPosition) - atmosphereInnerRadius; - - // Calculate density of photons at the light sample position. - lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; - - // Increment distance on light ray. - lightPositionLength += lightStepLength; - } - - // Compute attenuation via the primary ray and the light ray. - vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); - - // Accumulate the scattering. - rayleighAccumulation += sampleDensity.x * attenuation; - mieAccumulation += sampleDensity.y * attenuation; - - // Increment distance on primary ray. - rayPositionLength += (rayStepLength += rayStepLengthIncrease); - } - - // Compute the scattering amount. - rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; - mieColor = u_atmosphereMieCoefficient * mieAccumulation; - - // Compute the transmittance i.e. how much light is passing through the atmosphere. - opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); -} - -vec4 computeAtmosphereColor( - vec3 positionWC, - vec3 lightDirection, - vec3 rayleighColor, - vec3 mieColor, - float opacity -) { - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - - float cosAngle = dot(cameraToPositionWCDirection, lightDirection); - float cosAngleSq = cosAngle * cosAngle; - - float G = u_atmosphereMieAnisotropy; - float GSq = G * G; - - // The Rayleigh phase function. - float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); - // The Mie phase function. - float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); - - // The final color is generated by combining the effects of the Rayleigh and Mie scattering. - vec3 rayleigh = rayleighPhase * rayleighColor; - vec3 mie = miePhase * mieColor; - - vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; - - return vec4(color, opacity); -} -`;var _S=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { - - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - float atmosphereInnerRadius = length(positionWC); - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); -} -`;function Sat(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function Tq(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function vat(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case ne.SCENE3D:r=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:r=n;break;case ne.MORPHING:r=i;break}return r}function wat(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}Tq.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,A=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,D=e.enableClippingPlanes,R=e.clippingPlanes,O=e.clippedByBoundaries,L=e.hasImageryLayerCutout,N=e.colorCorrect,_=e.highlightFillTile,b=e.colorToAlpha,v=e.hasGeodeticSurfaceNormals,I=e.hasExaggeration,M=e.showUndergroundColor,F=e.translucent,k=e.marsOptions||{},V=0,G="",q=n.renderedMesh.encoding;q.quantization===Bs.BITS12&&(V=1,G="QUANTIZATION_BITS12");let Q=0,W="";O&&(Q=1,W="TILE_LIMIT_RECTANGLE");let K=0,J="";L&&(K=1,J="APPLY_IMAGERY_CUTOUT");let me=t.mode,ye=me|r<<2|o<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|h<<10|A<<11|x<<12|C<<13|T<<14|E<<15|S<<16|w<<17|V<<18|d<<19|D<<20|Q<<21|K<<22|N<<23|_<<24|b<<25|v<<26|I<<27|M<<28|F<<29|f<<30,se=0;l(R)&&R.length>0&&(se=D?R.clippingPlanesState:0);let _e=n.surfaceShader;if(l(_e)&&_e.numberOfDayTextures===i&&_e.flags===ye&&_e.material===this.material&&_e.clippingShaderState===se)return _e.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(l(xe)||(xe=this._shadersByTexturesFlags[i]=[]),_e=xe[ye],k.enableClip||!l(_e)||_e.material!==this.material||_e.clippingShaderState!==se){let De=this.baseVertexShaderSource.clone(),Ee=this.baseFragmentShaderSource.clone();se!==0&&Ee.sources.unshift(R_(R,t.context)),k.enableClip&&Ee.defines.push("APPLY_MARS3D_CLIP"),k.enableUplift&&Ee.defines.push("APPLY_MARS3D_UPLIFT"),k.enableFlat&&De.defines.push("APPLY_MARS3D_FLAT"),De.defines.push(G),Ee.defines.push(`TEXTURE_UNITS ${i}`,W,J),r&&Ee.defines.push("APPLY_BRIGHTNESS"),o&&Ee.defines.push("APPLY_CONTRAST"),s&&Ee.defines.push("APPLY_HUE"),a&&Ee.defines.push("APPLY_SATURATION"),c&&Ee.defines.push("APPLY_GAMMA"),k.invertColor&&Ee.defines.push("APPLY_INVERT_COLOR_MARS3D"),k.filterColor&&Ee.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Ee.defines.push("APPLY_ALPHA"),f&&Ee.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Ee.defines.push("SHOW_REFLECTIVE_OCEAN"),De.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&Ee.defines.push("SHOW_OCEAN_WAVES"),b&&Ee.defines.push("APPLY_COLOR_TO_ALPHA"),M&&(De.defines.push("UNDERGROUND_COLOR"),Ee.defines.push("UNDERGROUND_COLOR")),F&&(De.defines.push("TRANSLUCENT"),Ee.defines.push("TRANSLUCENT")),h&&(E?(De.defines.push("ENABLE_VERTEX_LIGHTING"),Ee.defines.push("ENABLE_VERTEX_LIGHTING")):(De.defines.push("ENABLE_DAYNIGHT_SHADING"),Ee.defines.push("ENABLE_DAYNIGHT_SHADING"))),A&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ee.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ee.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(De.defines.push("GROUND_ATMOSPHERE"),Ee.defines.push("GROUND_ATMOSPHERE"),T&&(De.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ee.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),De.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ee.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(De.defines.push("FOG"),Ee.defines.push("FOG")),d&&Ee.defines.push("APPLY_SPLIT"),D&&Ee.defines.push("ENABLE_CLIPPING_PLANES"),N&&Ee.defines.push("COLOR_CORRECT"),_&&Ee.defines.push("HIGHLIGHT_FILL_TILE"),v&&De.defines.push("GEODETIC_SURFACE_NORMALS"),I&&De.defines.push("EXAGGERATION");let Ne=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;L&&(Ne+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let Re=0;Re<i;++Re)L?Ne+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Re}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Ne+=` color = sampleAndBlend( -`,Ne+=` color, - u_dayTextures[${Re}], - u_dayTextureUseWebMercatorT[${Re}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${Re}], - u_dayTextureTranslationAndScale[${Re}], - ${u?`u_dayTextureAlpha[${Re}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${Re}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${Re}]`:"1.0"}, -${r?`u_dayTextureBrightness[${Re}]`:"0.0"}, - ${o?`u_dayTextureContrast[${Re}]`:"0.0"}, - ${s?`u_dayTextureHue[${Re}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${Re}]`:"0.0"}, - ${c?`u_dayTextureOneOverGamma[${Re}]`:"0.0"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${k.invertColor?`u_mars3dTextureInvertColor[${Re}]`:"false"}, - ${k.filterColor?`u_mars3dTextureFilterColor[${Re}]`:"vec3(1.0)"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${d?`u_dayTextureSplit[${Re}]`:"0.0"}, - ${b?`u_colorsToAlpha[${Re}]`:"vec4(0.0)"}, - nightBlend ); -`,L&&(Ne+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Ne+=` return color; - }`,Ee.sources.push(Ne),De.sources.push(vat(me)),De.sources.push(wat(S));let ke=Zt.fromCache({context:t.context,vertexShaderSource:De,fragmentShaderSource:Ee,attributeLocations:q.getAttributeLocations()});_e=xe[ye]=new Sat(i,ye,this.material,ke,se)}return n.surfaceShader=_e,_e.shaderProgram};Tq.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];if(!l(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var SN=Tq;var Dat={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},fi=Object.freeze(Dat);var Iat={START:0,LOADING:1,DONE:2,FAILED:3},Fs=Object.freeze(Iat);var Pat={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},pr=Object.freeze(Pat);function to(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=pr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(to.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===pr.RECEIVING||e===pr.TRANSFORMING),i=this.imagery;for(let r=0,o=i.length;n&&r<o;++r){let s=i[r];n=!l(s.loadingImagery)||s.loadingImagery.state!==fi.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Oat=new he;function Eq(e,t,n,i,r,o){let s=e.getExaggeratedPosition(i,r,o);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Oat);s=n.project(c,o),s=m.fromElements(s.z,s.x,s.y,o)}return s}var Rat=new m,Mat=new m,Bat=new m;to.prototype.pick=function(e,t,n,i,r){let o=this.renderedMesh;if(!l(o))return;let s=o.vertices,a=o.indices,c=o.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],h=a[d+2],A=Eq(c,t,n,s,p,Rat),x=Eq(c,t,n,s,g,Mat),C=Eq(c,t,n,s,h,Bat),T=qi.rayTriangleParametric(e,A,x,C,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?In.getPoint(e,f,r):void 0};to.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=pr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};to.prototype.freeVertexArray=function(){to._freeVertexArray(this.vertexArray),this.vertexArray=void 0,to._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};to.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new to),e.state===Fs.START&&(Lat(e,t,n),e.state=Fs.LOADING)};to.processStateMachine=function(e,t,n,i,r,o,s){to.initialize(e,n,i);let a=e.data;if(e.state===Fs.LOADING&&Nat(e,t,n,i,r,o),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===pr.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=Fs.DONE}c&&(e.renderable=!0)};to.prototype.processImagery=function(e,t,n,i){let r=e.data,o=e.upsampledFromParent,s=!1,a=!0,c=r.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){o=!1;continue}if(d.loadingImagery.state===fi.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready&&g.imageryProvider._ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else o=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),o=o&&l(d.loadingImagery)&&(d.loadingImagery.state===fi.FAILED||d.loadingImagery.state===fi.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(s||a),a};function kge(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=uc.clone(s);c.hasGeodeticSurfaceNormals=t,c=uc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(to._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=to._createVertexArrayForMesh(i.context,r)):(to._freeVertexArray(e.vertexArray),e.vertexArray=to._createVertexArrayForMesh(i.context,r)),to._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}to.prototype.addGeodeticSurfaceNormals=function(e,t){kge(this,!0,e,t)};to.prototype.removeGeodeticSurfaceNormals=function(e){kge(this,!1,void 0,e)};to.prototype.updateExaggeration=function(e,t,n){let i=this,r=i.renderedMesh;if(r===void 0)return;let o=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=o!==1,c=r.encoding,u=c.exaggeration!==o,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function Lat(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let r=e.parent,o=r.data;l(o)&&l(o.terrainData)&&(i=o.terrainData.isChildAvailable(r.x,r.y,e.x,e.y))}i===!1&&(e.data.terrainState=pr.FAILED);for(let r=0,o=n.length;r<o;++r){let s=n.get(r);s.show&&s._createTileImagerySkeletons(e,t)}}function Nat(e,t,n,i,r,o){let s=e.data,a=e.parent;if(s.terrainState===pr.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||to.processStateMachine(a,t,n,i,r,o,!0)),s.terrainState===pr.FAILED&&Fat(s,e,t,n,e.x,e.y,e.level),s.terrainState===pr.UNLOADED&&Uat(s,n,e.x,e.y,e.level),s.terrainState===pr.RECEIVED&&kat(s,t,n,e.x,e.y,e.level),s.terrainState===pr.TRANSFORMED&&(zat(s,t.context,n,e.x,e.y,e.level,o),s.updateExaggeration(e,t,r)),s.terrainState>=pr.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Gat(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Fat(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Fs.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,r,o,s);l(p)&&(e.terrainState=pr.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=pr.RECEIVED}).catch(function(){e.terrainState=pr.FAILED}))}function Uat(e,t,n,i,r){function o(c){e.terrainData=c,e.terrainState=pr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ei.CANCELLED){e.terrainData=void 0,e.terrainState=pr.UNLOADED,e.request=void 0;return}e.terrainState=pr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Ai.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new jr({throttle:!1,throttleByServer:!0,type:Ko.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=pr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=pr.UNLOADED,e.request=void 0)}a()}var Vat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function kat(e,t,n,i,r,o){let s=n.tilingScheme,a=Vat;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=pr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=pr.TRANSFORMED}).catch(function(){e.terrainState=pr.FAILED}))}to._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=mt.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{},s=o[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=mt.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,o[e.id]=s,t.indices.indexBuffers=o}else++s.referenceCount;return new oi({context:e,attributes:r,indexBuffer:s})};to._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function zat(e,t,n,i,r,o,s){e.vertexArray=to._createVertexArrayForMesh(t,e.mesh),e.terrainState=pr.READY,e.fill=e.fill&&e.fill.destroy(s)}function Hat(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Bt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:Ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:xi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Gat(e,t){let n=t.terrainData.waterMask,i=Hat(e),r,o=n.length;if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Bt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:Ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}to.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};to.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,r=e.rectangle,o=r.width,s=r.height,a=o/i.width,c=s/i.height;return n.x=a*(r.west-i.west)/o,n.y=c*(r.south-i.south)/s,n.z=a,n.w=c,n};var zf=to;var vN=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var wN=`in vec4 position; -in float webMercatorT; - -uniform vec2 u_textureDimensions; - -out vec2 v_textureCoordinates; - -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;function gS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=fi.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&e.imageryProvider._ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}gS.createPlaceholder=function(e){let t=new gS(e,0,0,0);return t.addReference(),t.state=fi.PLACEHOLDER,t};gS.prototype.addReference=function(){++this.referenceCount};gS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};gS.prototype.processStateMachine=function(e,t,n){this.state===fi.UNLOADED&&!n&&(this.state=fi.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===fi.RECEIVED&&(this.state=fi.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===fi.READY&&t&&!this.texture;(this.state===fi.TEXTURE_LOADED||i)&&(this.state=fi.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var yS=gS;function bq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}bq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};bq.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===fi.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==fi.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==fi.FAILED&&o.state!==fi.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===fi.FAILED||i.state===fi.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var AS=bq;function mi(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,mi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,mi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,mi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,mi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,mi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,mi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,mi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,mi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new AS(yS.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,mi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(mi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});mi.DEFAULT_BRIGHTNESS=1;mi.DEFAULT_CONTRAST=1;mi.DEFAULT_HUE=0;mi.DEFAULT_SATURATION=1;mi.DEFAULT_GAMMA=1;mi.DEFAULT_SPLIT=Fc.NONE;mi.DEFAULT_MINIFICATION_FILTER=un.LINEAR;mi.DEFAULT_MAGNIFICATION_FILTER=xi.LINEAR;mi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;mi.fromProviderAsync=function(e,t){let n=new mi(void 0,t);return Xat(n,Promise.resolve(e)),n};mi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),mi.fromProviderAsync(N_({style:e.style}),e)};mi.prototype.isBaseLayer=function(){return this._isBaseLayer};mi.prototype.isDestroyed=function(){return!1};mi.prototype.destroy=function(){return ue(this)};var Gge=new ce,zge=new ce,Sq=new ce,Wge=new ce;mi.prototype.getViewableRectangle=async function(){$("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return await e._readyPromise,ce.intersection(e.rectangle,t)};mi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};mi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready||!r._ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof wi&&e.rectangle.north<wi.MaximumLatitude&&e.rectangle.south>-wi.MaximumLatitude,s=ce.intersection(r.rectangle,this._rectangle,Gge),a=ce.intersection(e.rectangle,s,zge);if(!l(a)){if(!this.isBaseLayer())return!1;let v=s,I=e.rectangle;a=zge,I.south>=v.north?a.north=a.south=v.north:I.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(I.south,v.south),a.north=Math.min(I.north,v.north)),I.west>=v.east?a.west=a.east=v.east:I.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(I.west,v.west),a.east=Math.min(I.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Yat(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let v=r.minimumLevel;d<v&&(d=v)}let g=r.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),A=g.positionToTileXY(ce.southeast(a),d),x=e.rectangle.width/512,C=e.rectangle.height/512,T=g.tileXYToRectangle(h.x,h.y,d);Math.abs(T.south-e.rectangle.north)<C&&h.y<A.y&&++h.y,Math.abs(T.east-e.rectangle.west)<x&&h.x<A.x&&++h.x;let E=g.tileXYToRectangle(A.x,A.y,d);Math.abs(E.north-e.rectangle.south)<C&&A.y>h.y&&--A.y,Math.abs(E.west-e.rectangle.east)<x&&A.x>h.x&&--A.x;let S=ce.clone(e.rectangle,Wge),w=g.tileXYToRectangle(h.x,h.y,d),D=ce.intersection(w,s,Sq),R;o?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),R=g.tileXYToNativeRectangle.bind(g),x=S.width/512,C=S.height/512):R=g.tileXYToRectangle.bind(g);let O,L=0,N=1,_;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=x&&(L=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=C&&(N=Math.max(0,(D.north-S.south)/S.height));let b=N;for(let v=h.x;v<=A.x;v++)if(O=L,w=R(v,h.y,d),D=ce.simpleIntersection(w,s,Sq),!!l(D)){L=Math.min(1,(D.east-S.west)/S.width),v===A.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<x)&&(L=1),N=b;for(let I=h.y;I<=A.y;I++){if(_=N,w=R(v,I,d),D=ce.simpleIntersection(w,s,Sq),!l(D))continue;N=Math.max(0,(D.south-S.south)/S.height),I===A.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<C)&&(N=0);let M=new oe(O,N,L,_),F=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new AS(F,M,o)),++n}}return!0};mi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Gge),i=c.rectangleToNativeRectangle(i,Wge)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new oe(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};mi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=fi.RECEIVED,e.request=void 0,Ai.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function r(s){if(e.request.state===ei.CANCELLED){e.state=fi.UNLOADED,e.request=void 0;return}e.state=fi.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Ai.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function o(){let s=new jr({throttle:!1,throttleByServer:!0,type:Ko.IMAGERY});e.request=s,e.state=fi.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=fi.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){r(c)}):i(a)}o()};mi.prototype._createTextureWebGL=function(e,t){let n=new dn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Bt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Bt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?at.RGBA:at.RGB,sampler:n})};mi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=fi.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=fi.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof wi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=fi.TEXTURE_LOADED};function Hge(e,t,n){return`${e}:${t}:${n}`}mi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===un.LINEAR&&i===xi.LINEAR&&!at.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=un.LINEAR_MIPMAP_LINEAR;let o=Ht.maximumTextureFilterAnisotropy,s=Math.min(o,y(this._maximumAnisotropy,o)),a=Hge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Rm.NICEST),t.sampler=u}else{let o=Hge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};mi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Si)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new ju({persists:!0,owner:this,preExecute:function(c){jat(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=fi.READY,t.releaseReference()},canceled:function(){t.state=fi.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=fi.READY};mi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};mi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};mi.prototype.getImageryFromCache=function(e,t,n,i){let r=jge(e,t,n),o=this._imageryCache[r];return l(o)||(o=new yS(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};mi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=jge(e.x,e.y,e.level);delete this._imageryCache[t]};function jge(e,t,n){return JSON.stringify([e,t,n])}var Tz={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},Wat=Wt.supportsTypedArrays()?new Float32Array(2*64):void 0;function jat(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let x=new Float32Array(2*64*2),C=0;for(let D=0;D<64;++D){let R=D/63;x[C++]=0,x[C++]=R,x[C++]=1,x[C++]=R}let T={position:0,webMercatorT:1},E=Go.getRegularGridIndices(2,64),S=mt.createIndexBuffer({context:t,typedArray:E,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});r.vertexArray=new oi({context:t,attributes:[{index:T.position,vertexBuffer:mt.createVertexBuffer({context:t,typedArray:x,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:mt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let w=new He({sources:[wN]});r.shaderProgram=Zt.fromCache({context:t,vertexShaderSource:w,fragmentShaderSource:vN,attributeLocations:T}),r.sampler=new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:xi.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;Tz.textureDimensions.x=o,Tz.textureDimensions.y=s,Tz.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Bt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(Rm.NICEST);let p=i.south,g=i.north,h=Wat,A=0;for(let x=0;x<64;++x){let C=x/63,T=P.lerp(p,g,C);a=Math.sin(T);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[A++]=S,h[A++]=S}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=Tz,e.vertexArray=r.vertexArray}function Yat(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Si?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function qat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Xat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){qat(e._errorEvent,i)}}var Us=mi;var Yge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Yge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Qn=Yge;function CS(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}CS.prototype.update=function(e,t,n){this.changedThisFrame&&($ge(e,t,this.tile,n),this.changedThisFrame=!1)};CS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};CS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):zf._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Kat=new $g;CS.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=Kat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);hs(e,n,c,u,s,yn.EAST,!1,a,i),hs(e,n,c,f,s,yn.NORTH,!1,a,i),hs(e,n,c,d,s,yn.WEST,!1,a,i),hs(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),h=u.findTileToSouth(o),A=d.findTileToNorth(o),x=d.findTileToSouth(o);hs(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),hs(e,n,c,A,s,yn.SOUTHWEST,!1,a,i),hs(e,n,c,h,s,yn.NORTHEAST,!1,a,i),hs(e,n,c,x,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function hs(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||Qn.wasKicked(u._lastSelectionResult)||Qn.originalResult(u._lastSelectionResult)===Qn.CULLED);){if(s)return;let f=u.parent;if(o>=yn.NORTHWEST&&f!==void 0)switch(o){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Qn.RENDERED){if(l(u.data.vertexArray))return;Jat(e,t,n,u,o,r,a,c);return}if(Qn.originalResult(i._lastSelectionResult)!==Qn.CULLED)switch(o){case yn.WEST:hs(e,t,n,i.northwestChild,r,o,!0,a,c),hs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.EAST:hs(e,t,n,i.southeastChild,r,o,!0,a,c),hs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTH:hs(e,t,n,i.southwestChild,r,o,!0,a,c),hs(e,t,n,i.southeastChild,r,o,!0,a,c);break;case yn.NORTH:hs(e,t,n,i.northeastChild,r,o,!0,a,c),hs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHWEST:hs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHEAST:hs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTHWEST:hs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.SOUTHEAST:hs(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new fe("Invalid edge")}}}function Jat(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new CS(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Zat(e,t,n,i,r,a)}function Zat(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&($ge(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,h,A=n.rectangle,x,C=i.rectangle;switch(r){case yn.WEST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.north,h.south,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.south,h.north,x));++p);break;case yn.SOUTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.west,h.east,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.east,h.west,x));++p);break;case yn.EAST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.south,h.north,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.north,h.south,x));++p);break;case yn.NORTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.east,h.west,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.west,h.east,x));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var cC=new he,Qat=new he,xS=new m,Iq=new m,vq=new H,wq=new H,Nu=new H;function Iz(){this.height=0,this.encodedNormal=new H}function Ez(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return eye(e,t,n,i,u,c),c}var $at={minimumHeight:0,maximumHeight:0},ect=new m,qge=new Iz,Xge=new Iz,Kge=new Iz,Jge=new Iz,tct=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,nct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function $ge(e,t,n,i){zf.initialize(n,e.terrainProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=Sz(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,Kge),p=Sz(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,qge),g=Sz(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,Xge),h=Sz(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Jge);d=Ez(o,f,0,1,d,p,h,g,Kge),p=Ez(o,f,0,0,p,d,g,h,qge),g=Ez(o,f,1,1,g,p,h,d,Xge),h=Ez(o,f,1,1,h,g,d,p,Jge);let A=p.height,x=g.height,C=d.height,T=h.height,E=Math.min(A,x,C,T),S=Math.max(A,x,C,T),w=(E+S)*.5,D,R,O=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-O,N=Math.acos(L/f.maximumRadius)*4;if(N*=1.5,s.width>N&&S-E<=O){let v=new Ia({width:9,height:9,buffer:tct,structure:{heightOffset:S}}),I=nct;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,o.mesh=v._createMeshSync(I)}else{let v=u,I=ce.center(s,Qat);I.height=w;let M=f.cartographicToCartesian(I,ect),F=new uc(M,void 0,void 0,void 0,void 0,!0,!0,v,a,c),k=5,V;for(V=o.westMeshes,D=0,R=V.length;D<R;++D)k+=V[D].eastIndicesNorthToSouth.length;for(V=o.southMeshes,D=0,R=V.length;D<R;++D)k+=V[D].northIndicesWestToEast.length;for(V=o.eastMeshes,D=0,R=V.length;D<R;++D)k+=V[D].westIndicesSouthToNorth.length;for(V=o.northMeshes,D=0,R=V.length;D<R;++D)k+=V[D].southIndicesEastToWest.length;let G=$at;G.minimumHeight=E,G.maximumHeight=S;let U=F.stride,q=new Float32Array(k*U),Y=0,Q=Y;Y=bz(f,s,F,q,Y,0,1,d.height,d.encodedNormal,1,G),Y=wz(o,f,F,q,Y,o.westTiles,o.westMeshes,yn.EAST,G);let W=Y;Y=bz(f,s,F,q,Y,0,0,p.height,p.encodedNormal,0,G),Y=wz(o,f,F,q,Y,o.southTiles,o.southMeshes,yn.NORTH,G);let K=Y;Y=bz(f,s,F,q,Y,1,0,g.height,g.encodedNormal,0,G),Y=wz(o,f,F,q,Y,o.eastTiles,o.eastMeshes,yn.WEST,G);let J=Y;Y=bz(f,s,F,q,Y,1,1,h.height,h.encodedNormal,1,G),Y=wz(o,f,F,q,Y,o.northTiles,o.northMeshes,yn.SOUTH,G),E=G.minimumHeight,S=G.maximumHeight;let me=Bn.fromRectangle(s,E,S,n.tilingScheme.ellipsoid),ye=wi.geodeticLatitudeToMercatorAngle(s.south),se=1/(wi.geodeticLatitudeToMercatorAngle(s.north)-ye),_e=(wi.geodeticLatitudeToMercatorAngle(I.latitude)-ye)*se,xe=f.geodeticSurfaceNormalCartographic(cC,Iq),De=Yn.octEncode(xe,vq),Ee=Y;F.encode(q,Y*U,me.center,H.fromElements(.5,.5,Nu),w,De,_e,xe),++Y;let Ne=Y,ke=Ne<256?1:2,Re=(Ne-1)*3,dt=Re*ke,_t=(q.length-Ne*U)*Float32Array.BYTES_PER_ELEMENT,rt;if(_t>=dt){let Ae=Ne*U*Float32Array.BYTES_PER_ELEMENT;rt=Ne<256?new Uint8Array(q.buffer,Ae,Re):new Uint16Array(q.buffer,Ae,Re)}else rt=Ne<256?new Uint8Array(Re):new Uint16Array(Re);q=new Float32Array(q.buffer,0,Ne*U);let hn=0;for(D=0;D<Ne-2;++D)rt[hn++]=Ee,rt[hn++]=D,rt[hn++]=D+1;rt[hn++]=Ee,rt[hn++]=D,rt[hn++]=0;let Rn=[];for(D=W;D>=Q;--D)Rn.push(D);let Gt=[];for(D=K;D>=W;--D)Gt.push(D);let Ut=[];for(D=J;D>=K;--D)Ut.push(D);let Te=[];for(Te.push(0),D=Ee-1;D>=J;--D)Te.push(D);o.mesh=new Nf(F.center,q,rt,Re,Ne,E,S,ae.fromOrientedBoundingBox(me),lct(e,me.center,s,E,S),F.stride,me,F,Rn,Gt,Ut,Te)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=zf._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let b=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=r._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(o.waterMaskTexture=v.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,v,o.waterMaskTranslationAndScale))}l(b)&&(--b.referenceCount,b.referenceCount===0&&b.destroy())}function bz(e,t,n,i,r,o,s,a,c,u,f){let d=cC;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,xS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,Iq));let h=wq;return h.x=o,h.y=s,n.encode(i,r*n.stride,p,h,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var Dz=new ce;function DN(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ce.clone(e.rectangle,Dz),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ce.clone(e.rectangle,Dz),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var ict=new H;function Dq(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var rct=new H,oct=new m;function sct(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=DN(t,n,f.decodeTextureCoordinates(d,r,Nu),Nu),g=DN(t,n,f.decodeTextureCoordinates(d,o,wq),wq),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let A=f.decodeHeight(d,r),x=f.decodeHeight(d,o),C=n.rectangle;cC.longitude=P.lerp(C.west,C.east,s),cC.latitude=P.lerp(C.south,C.north,a),u.height=cC.height=P.lerp(A,x,h);let T;if(f.hasVertexNormals){let E=f.getOctEncodedNormal(d,r,ict),S=f.getOctEncodedNormal(d,o,rct),w=Yn.octDecode(E.x,E.y,xS),D=Yn.octDecode(S.x,S.y,oct);T=m.lerp(w,D,h,xS),m.normalize(T,T),Yn.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(cC,xS),Yn.octEncode(T,u.encodedNormal)}function eye(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(cC,xS);Yn.octEncode(s,o.encodedNormal)}function Sz(e,t,n,i,r,o,s,a,c,u,f){if(Qge(e,t,a,s,!1,n,i,f)||Qge(e,t,u,c,!0,n,i,f))return f;let p;if(Pq(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],Dq(o,p,n,i,f),f;let g;if(n===0?i===0?g=vz(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=vz(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=vz(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=vz(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return eye(e,t,n,i,g,f),f}function vz(e,t,n,i,r,o,s,a){let c=Zge(e,t,!1,n,s,a),u=Zge(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function wz(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=act(e,t,n,i,r,o[u],s[u],a,c);return r}function act(e,t,n,i,r,o,s,a,c){let u=o.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(o.rectangle,Dz),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===yn.WEST&&o.x===0&&(u=ce.clone(o.rectangle,Dz),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Nu),d=Nu.x,p=Nu.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let A=o,x=e.tile,C=s.encoding,T=s.vertices,E=n.stride,S,w;C.hasWebMercatorT&&(S=wi.geodeticLatitudeToMercatorAngle(f.south),w=1/(wi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<g.length;++D){let R=g[D],O=C.decodeTextureCoordinates(T,R,Nu);DN(A,x,O,O);let L=O.x,N=O.y,_=h?L:N;if(_<0||_>1||Math.abs(L-d)<P.EPSILON5&&Math.abs(N-p)<P.EPSILON5)continue;let b=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5,v=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5;if(b&&v)continue;let I=C.decodePosition(T,R,xS),M=C.decodeHeight(T,R),F;C.hasVertexNormals?F=C.getOctEncodedNormal(T,R,vq):(F=vq,F.x=0,F.y=0);let k=N;if(C.hasWebMercatorT){let G=P.lerp(f.south,f.north,N);k=(wi.geodeticLatitudeToMercatorAngle(G)-S)*w}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,Iq)),n.encode(i,r*E,I,O,M,F,k,V),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function Zge(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!Pq(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function Pq(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Qge(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],h=n[r?0:n.length-1];if(Pq(g,h)&&(o===0?s===0?(c=r?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=r,f=r):(c=r?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!r,f=!0):(c=r?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,Nu);let A=DN(g,e.tile,Nu,Nu);if(A.x===o&&A.y===s)return Dq(h,p,o,s,a),!0;if(d=wr(c,u?o:s,function(x,C){h.encoding.decodeTextureCoordinates(h.vertices,x,Nu);let T=DN(g,e.tile,Nu,Nu);return f?u?T.x-o:T.y-s:u?o-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return sct(t,g,e.tile,h,c[d-1],c[d],o,s,u,a),!0}else return Dq(h,c[d],o,s,a),!0}return!1}var cct=[new m,new m,new m,new m];function lct(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=cct;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var TS=CS;function no(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(no.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(no.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(no.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(no.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(no.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return l(this._terrainProvider)&&this._terrainProvider._ready&&(this._imageryLayers.length===0||this._imageryLayers.get(0).ready&&this._imageryLayers.get(0).imageryProvider._ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}}});function uct(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}no.prototype.update=function(e){this._imageryLayers._update()};function fct(e,t){let n=t.creditDisplay;l(e._terrainProvider)&&e._terrainProvider._ready&&l(e._terrainProvider.credit)&&n.addCreditToNextFrame(e._terrainProvider.credit);let i=e._imageryLayers;for(let r=0,o=i.length;r<o;++r){let s=i.get(r);s.ready&&s.imageryProvider._ready&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}no.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(uct)})),fct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)zf._freeVertexArray(t[i]);t.length=0};no.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,r=t.length;i<r;++i){let o=t[i];l(o)&&(o.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};no.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ja.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},blending:mn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TS.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let o=this._tilesToRenderByTextureCount;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;oye(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){oye(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function sye(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}no.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)sye(t[n],e)};no.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};no.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};no.prototype.loadTile=function(e,t){let n=t.data,i=!0,r;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Qn.CULLED_BUT_NEEDED,r=n.terrainState),zf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&r!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==co.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,zf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var dct=new ae,aye=new ce,mct=new ce,hct=new he;function Oz(e,t){if(t.west<t.east)return t;let n=ce.clone(t,mct);return ce.center(e,hct).longitude>0?n.east=P.PI:n.west=-P.PI,n}function cye(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}no.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let r=cye(this,t);if(t.fog.enabled&&!r&&P.fog(i,t.fog.density)>=1)return co.NONE;let o=e.data,s=o.tileBoundingRegion;if(o.boundingVolumeSourceTile===void 0)return co.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),o.clippedByBoundaries=!1;let u=Oz(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,aye);if(!l(f))return co.NONE;if(ce.equals(f,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=dct,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(o.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return co.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let A=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=A!==tn.INSIDE,A===tn.OUTSIDE)return co.NONE}let p,g=a.computeVisibility(c);if(g===tn.OUTSIDE?p=co.NONE:g===tn.INTERSECTING?p=co.PARTIAL:g===tn.INSIDE&&(p=co.FULL),p===co.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===ne.SCENE3D&&!h&&l(n)&&!r){let A=o.occludeePointInScaledSpace;return!l(A)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(A,s.minimumHeight)?p:co.NONE}return p};no.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var pct=[],_ct=[];no.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=pct;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===pr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===fi.FAILED||p.state===fi.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,f=_ct;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Qn.NONE;if(p===Qn.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===pr.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let A=h[a],x=A.loadingImagery,C=!l(x)||x.state===fi.FAILED||x.state===fi.INVALID,T=(A.loadingImagery||A.readyImagery).imageryLayer._layerIndex;if(C&&!i[T])return!1}}else p===Qn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var gct=new m;no.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,s=m.subtract(i.center,r,gct),a=m.magnitude(s);return a<P.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,o))*e._distance)};var tye=new B,Pz=new B,yct=new oe,Act=new oe,xct=new oe,Cct=new m,nye=new m,Tct=new m,Ect=new m;no.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let r=this._tilesToRenderByTextureCount[n];l(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);let o=e.data;l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var bct=[new m,new m,new m,new m];function iye(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=bct;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}no.prototype.computeDistanceToTile=function(e,t){Sct(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let r=n.tileBoundingRegion,o=r.minimumHeight,s=r.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-o),f=Math.abs(c-s);u>f?(r.minimumHeight=o,r.maximumHeight=o):(r.minimumHeight=s,r.maximumHeight=s)}let a=r.distanceToCamera(t);return r.minimumHeight=o,r.maximumHeight=s,a};function Sct(e,t,n){let i=e.data;i===void 0&&(i=e.data=new zf);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new _f({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let x=0;x<d.rectangles.length;x++)if(ce.intersection(e.rectangle,d.rectangles[x])){f=d.heights[x];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let x=0;x<p.rectangles.length;x++)if(ce.intersection(o.rectangle,p.rectangles[x])){g=p.height;break}}let h=i.mesh,A=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)o.minimumHeight=h.minimumHeight,o.maximumHeight=h.maximumHeight,c=!0;else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0)o.minimumHeight=A._minimumHeight,o.maximumHeight=A._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let x=e.parent;for(;x!==void 0;){let C=x.data;if(C!==void 0){let T=C.mesh,E=C.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0){o.minimumHeight=T.minimumHeight,o.maximumHeight=T.maximumHeight;break}else if(E!==void 0&&E._minimumHeight!==void 0&&E._maximumHeight!==void 0){o.minimumHeight=E._minimumHeight,o.maximumHeight=E._maximumHeight;break}}x=x.parent}u=x}if(o.maximumHeight+=g,o.maximumHeight<f&&(o.maximumHeight=f),o.minimumHeight>f&&(o.minimumHeight=f),u!==void 0){let x=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((x!==1||f!==0)&&(c=!1,o.minimumHeight=vc.getHeight(o.minimumHeight,x,C),o.maximumHeight=vc.getHeight(o.maximumHeight,x,C)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=Bn.clone(h.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ae.clone(h.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=iye(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let E=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||E)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=iye(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}no.prototype.isDestroyed=function(){return!1};no.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function vct(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=y(r.readyImagery,r.loadingImagery),o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?y(r.readyImagery,r.loadingImagery):void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}no.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,r=this._imageryLayersUpdatedEvent,o=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=vct(d,e,n),s.state=Fs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=o}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Fs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Qn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}};no.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,r=-1,o=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)r===-1&&(r=s),c.freeResources(),++o;else if(r!==-1)break}r!==-1&&i.splice(r,o)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};no.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};no.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var wct=new B,Dct=new B;function rye(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=B.multiplyByPoint(i,this.properties.rtc,nye);return B.setTranslation(i,r,tye),tye},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=B.multiplyByPoint(i,this.properties.rtc,nye);return B.setTranslation(i,o,Pz),B.multiply(r,Pz,Pz),Pz},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?B.multiply(e.context.uniformState.view,i.modelMatrix,wct):B.IDENTITY;return B.inverseTranspose(r,Dct)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return l(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return l(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new B,tileRectangle:new oe,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new H,scaleAndBias:new B,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=gt(n,i)}return l(t.materialUniformMap)?gt(n,t.materialUniformMap):n}function Ict(e,t,n){let i=n.data,r,o;if(l(i.vertexArray)?(r=i.mesh,o=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),!(!l(r)||!l(o))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Pct(e,o,r),i.wireframeVertexArray.mesh=r}}function Pct(e,t,n){let r={indices:n.indices,primitiveType:Be.TRIANGLES};Fn.toWireframe(r);let o=r.indices,s=mt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new oi({context:e,attributes:t._attributes,indexBuffer:s})}var lye,uye,Rz;(function(){let e=new Tt({geometry:ad.fromDimensions({dimensions:new m(2,2,2)})}),t=new Tt({geometry:new t_({radius:1})}),n=new B,i,r;function o(s){return new vn({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}lye=function(s,a){return s===i||(Rz(),i=s,n=B.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=kt.fromColor(a),r=o(e)),r},uye=function(s,a){return s===i||(Rz(),i=s,n=B.fromTranslation(s.center,n),n=B.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=kt.fromColor(a),r=o(t)),r},Rz=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Oct=new oe(0,0,0,0),Rct={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Mct=z.TRANSPARENT,Bct=new Lt;function oye(e,t,n,i){let r=t.data;l(r.vertexArray)||(r.fill===void 0&&(r.fill=new TS(t)),r.fill.update(e,n));let o=n.creditDisplay,s=r.terrainData;if(l(s)&&l(s.credits)){let Ae=s.credits;for(let ut=0,ii=Ae.length;ut<ii;++ut)o.addCreditToNextFrame(Ae[ut])}let a=Ht.maximumTextureImageUnits,c=r.waterMaskTexture,u=r.waterMaskTranslationAndScale;!l(c)&&l(r.fill)&&(c=r.fill.waterMaskTexture,u=r.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,A=d.rectangle,x=y(e.undergroundColor,Mct),C=y(e.undergroundColorAlphaByDistance,Bct),T=cye(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(C.nearValue>0||C.farValue>0),E=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,w=e.hasWaterMask&&l(c),D=e.oceanNormalMap,R=w&&l(D),O=l(e.terrainProvider)&&e.terrainProvider._ready&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!f,N=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,_=xn.castShadows(e.shadows)&&!p,b=xn.receiveShadows(e.shadows)&&!p,v=e.hueShift,I=e.saturationShift,M=e.brightnessShift,F=!(P.equalsEpsilon(v,0,P.EPSILON7)&&P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(M,0,P.EPSILON7)),k=!1;if(N){let Ae=m.magnitude(n.camera.positionWC),ut=e.nightFadeOutDistance;k=Ae>ut}w&&--a,R&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let V=r.renderedMesh,G=V.center,U=V.encoding,q=r.tileBoundingRegion,Y=n.terrainExaggeration,Q=n.terrainExaggerationRelativeHeight,W=e.marsOptions?.uplift;i&&W&&(Q=n.terrainExaggerationRelativeHeight-W.height/(Y-1));let K=Y!==1,J=U.hasGeodeticSurfaceNormals,me=yct,ye=0,se=0,_e=0,xe=0,De=!1;if(n.mode!==ne.SCENE3D){let Ae=n.mapProjection,ut=Ae.project(ce.southwest(t.rectangle),Tct),ii=Ae.project(ce.northeast(t.rectangle),Ect);if(me.x=ut.x,me.y=ut.y,me.z=ii.x,me.w=ii.y,n.mode!==ne.MORPHING&&(G=Cct,G.x=0,G.y=(me.z+me.x)*.5,G.z=(me.w+me.y)*.5,me.x-=G.y,me.y-=G.z,me.z-=G.y,me.w-=G.z),n.mode===ne.SCENE2D&&U.quantization===Bs.BITS12){let Je=1/(Math.pow(2,12)-1)*.5,ar=(me.z-me.x)*Je,ts=(me.w-me.y)*Je;me.x-=ar,me.y-=ts,me.z+=ar,me.w+=ts}Ae instanceof wi&&(ye=t.rectangle.south,se=t.rectangle.north,_e=wi.geodeticLatitudeToMercatorAngle(ye),xe=1/(wi.geodeticLatitudeToMercatorAngle(se)-_e),De=!0)}let Ee=Rct;Ee.frameState=n,Ee.surfaceTile=r,Ee.showReflectiveOcean=w,Ee.showOceanWaves=R,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=N,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=k,Ee.hasVertexNormals=O,Ee.useWebMercatorProjection=De,Ee.clippedByBoundaries=r.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=J,Ee.hasExaggeration=K;let Ne=r.imagery,ke=0,Re=Ne.length,dt=e.showSkirts&&!f&&!p,_t=e.backFaceCulling&&!f&&!p,rt=_t?e._renderState:e._disableCullingRenderState,hn=_t?e._blendRenderState:e._disableCullingBlendRenderState,Rn=rt,Gt=e._firstPassInitialColor,Ut=n.context;if(l(e._debug.boundingSphereTile)||Rz(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ae=e._drawCommands.length;for(let ut=0;ut<Ae;++ut)e._uniformMaps[ut]=rye(n,e)}do{let Ae=0,ut,ii;if(e._drawCommands.length<=e._usedDrawCommands?(ut=new nt,ut.owner=t,ut.cull=!1,ut.boundingVolume=new ae,ut.orientedBoundingBox=void 0,ii=rye(n,e),e._drawCommands.push(ut),e._uniformMaps.push(ii)):(ut=e._drawCommands[e._usedDrawCommands],ii=e._uniformMaps[e._usedDrawCommands]),ut.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Wr=q.boundingVolume,Br=q.boundingSphere;l(Wr)?lye(Wr,z.RED).update(n):l(Br)&&uye(Br,z.RED).update(n)}let Je=ii.properties;oe.clone(Gt,Je.initialColor),Je.oceanNormalMap=D,Je.lightingFadeDistance.x=e.lightingFadeOutDistance,Je.lightingFadeDistance.y=e.lightingFadeInDistance,Je.nightFadeDistance.x=e.nightFadeOutDistance,Je.nightFadeDistance.y=e.nightFadeInDistance,Je.atmosphereLightIntensity=e.atmosphereLightIntensity,Je.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Je.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Je.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Je.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Je.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Je.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ar=f?h:g,ts=f?g:h;l(ar)&&(oe.fromElements(ar.near,ar.nearValue,ar.far,ar.farValue,Je.frontFaceAlphaByDistance),oe.fromElements(ts.near,ts.nearValue,ts.far,ts.farValue,Je.backFaceAlphaByDistance)),oe.fromElements(C.near,C.nearValue,C.far,C.farValue,Je.undergroundColorAlphaByDistance),z.clone(x,Je.undergroundColor),Je.lambertDiffuseMultiplier=E,Je.vertexShadowDarkness=S;let Ba=!l(r.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ba&&z.clone(e.fillHighlightColor,Je.fillHighlightColor),Je.terrainExaggerationAndRelativeHeight.x=Y,Je.terrainExaggerationAndRelativeHeight.y=Q,Je.center3D=V.center,m.clone(G,Je.rtc),oe.clone(me,Je.tileRectangle),Je.southAndNorthLatitude.x=ye,Je.southAndNorthLatitude.y=se,Je.southMercatorYAndOneOverHeight.x=_e,Je.southMercatorYAndOneOverHeight.y=xe;let No=Act,Mr=Oz(t.rectangle,e.cartographicLimitRectangle),Ve=xct,ot=Oz(t.rectangle,A);m.fromElements(v,I,M,Je.hsbShift);let je=t.rectangle,Qe=1/je.width,pt=1/je.height;No.x=(Mr.west-je.west)*Qe,No.y=(Mr.south-je.south)*pt,No.z=(Mr.east-je.west)*Qe,No.w=(Mr.north-je.south)*pt,oe.clone(No,Je.localizedCartographicLimitRectangle),Ve.x=(ot.west-je.west)*Qe,Ve.y=(ot.south-je.south)*pt,Ve.z=(ot.east-je.west)*Qe,Ve.w=(ot.north-je.south)*pt;let zt=e.marsOptions?.flat;if(zt){let Wr=zt.areas,Br=0;Wr?(Wr.forEach(ha=>{Br<ha.length&&(Br=ha.length)}),Je.mars_flat_AreaWidth=Wr.length):Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=Br,Je.mars_flat_AreaTexture=zt.texture,Je.mars_flat_enabled=zt.enabled}else Je.mars_flat_enabled=!1,Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=0,Je.mars_flat_AreaTexture=void 0;Je.inverseTileWidth=Qe,Je.cartographicTileRectangle=new H(je.west,je.south);let Jt=e.marsOptions?.uplift;if(Jt){let Wr=Jt.areas,Br=0;Wr?(Wr.forEach(ha=>{Br<ha.length&&(Br=ha.length)}),Je.mars_uplift_RectangleWidth=Wr.length):Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=Br,Je.mars_uplift_RampRectangle=Jt.texture,Je.mars_uplift_enabled=(!Jt.showUp||Jt.enabled&&e._topographicUpliftHeight!==0)&&l(Jt.rectangles)&&Jt.rectangles.length>0,Je.mars_uplift_hideInsideOrOutside=!i}else Je.mars_uplift_enabled=!1,Je.mars_uplift_hideInsideOrOutside=!1,Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=0,Je.mars_uplift_RampRectangle=void 0;oe.clone(Ve,Je.localizedTranslucencyRectangle);let rr=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;F=F&&(rr||N);let gr=!1,ns=!1,Vs=!1,lo=!1,Wi=!1,Yo=!1,Vn=!1,ln=!1,Kn=!1,wn=!1,ks=!1,hi=!1;for(;Ae<a&&ke<Re;){let Wr=Ne[ke],Br=Wr.readyImagery;if(++ke,!l(Br)||Br.imageryLayer.alpha===0)continue;let ha=Wr.useWebMercatorT?Br.textureWebMercator:Br.texture,Cr=Br.imageryLayer;l(Wr.textureTranslationAndScale)||(Wr.textureTranslationAndScale=Cr._calculateTextureTranslationAndScale(t,Wr)),Je.dayTextures[Ae]=ha,Je.dayTextureTranslationAndScale[Ae]=Wr.textureTranslationAndScale,Je.dayTextureTexCoordsRectangle[Ae]=Wr.textureCoordinateRectangle,Je.dayTextureUseWebMercatorT[Ae]=Wr.useWebMercatorT,Je.dayTextureAlpha[Ae]=Cr.alpha,Yo=Yo||Je.dayTextureAlpha[Ae]!==1,Je.dayTextureNightAlpha[Ae]=Cr.nightAlpha,Vn=Vn||Je.dayTextureNightAlpha[Ae]!==1,Je.dayTextureDayAlpha[Ae]=Cr.dayAlpha,Vn=Vn||Je.dayTextureDayAlpha[Ae]!==1,Je.dayTextureBrightness[Ae]=Cr.brightness,gr=gr||Je.dayTextureBrightness[Ae]!==Us.DEFAULT_BRIGHTNESS,Je.dayTextureContrast[Ae]=Cr.contrast,ns=ns||Je.dayTextureContrast[Ae]!==Us.DEFAULT_CONTRAST,Je.dayTextureHue[Ae]=Cr.hue,Vs=Vs||Je.dayTextureHue[Ae]!==Us.DEFAULT_HUE,Je.dayTextureSaturation[Ae]=Cr.saturation,lo=lo||Je.dayTextureSaturation[Ae]!==Us.DEFAULT_SATURATION,Je.dayTextureOneOverGamma[Ae]=1/Cr.gamma,Wi=Wi||Je.dayTextureOneOverGamma[Ae]!==1/Us.DEFAULT_GAMMA,Je.dayTextureSplit[Ae]=Cr.splitDirection,ln=ln||Je.dayTextureSplit[Ae]!==0,ks=ks||!!Cr.invertColor,Je.mars3dTextureInvertColor[Ae]=!!Cr.invertColor,hi=hi||!!Cr.filterColor,Cr.filterColor?Je.mars3dTextureFilterColor[Ae]=new m(Cr.filterColor.red,Cr.filterColor.green,Cr.filterColor.blue):Je.mars3dTextureFilterColor[Ae]=new m(1,1,1);let Hs=Je.dayTextureCutoutRectangles[Ae];if(l(Hs)||(Hs=Je.dayTextureCutoutRectangles[Ae]=new oe),oe.clone(oe.ZERO,Hs),l(Cr.cutoutRectangle)){let gs=Oz(je,Cr.cutoutRectangle),Vh=ce.simpleIntersection(gs,je,aye);Kn=l(Vh)||Kn,Hs.x=(gs.west-je.west)*Qe,Hs.y=(gs.south-je.south)*pt,Hs.z=(gs.east-je.west)*Qe,Hs.w=(gs.north-je.south)*pt}let Lr=Je.colorsToAlpha[Ae];l(Lr)||(Lr=Je.colorsToAlpha[Ae]=new oe);let $f=l(Cr.colorToAlpha)&&Cr.colorToAlphaThreshold>0;if(wn=wn||$f,$f){let gs=Cr.colorToAlpha;Lr.x=gs.red,Lr.y=gs.green,Lr.z=gs.blue,Lr.w=Cr.colorToAlphaThreshold}else Lr.w=-1;if(l(Br.credits)){let gs=Br.credits;for(let Vh=0,r3=gs.length;Vh<r3;++Vh)o.addCreditToNextFrame(gs[Vh])}++Ae}Je.dayTextures.length=Ae,Je.waterMask=c,oe.clone(u,Je.waterMaskTranslationAndScale),Je.minMaxHeight.x=U.minimumHeight,Je.minMaxHeight.y=U.maximumHeight,B.clone(U.matrix,Je.scaleAndBias);let ma=e._clippingPlanes,zu=l(ma)&&ma.enabled&&t.isClipped;zu&&(Je.clippingPlanesEdgeColor=z.clone(ma.edgeColor,Je.clippingPlanesEdgeColor),Je.clippingPlanesEdgeWidth=ma.edgeWidth),Ee.numberOfDayTextures=Ae,Ee.applyBrightness=gr,Ee.applyContrast=ns,Ee.applyHue=Vs,Ee.applySaturation=lo,Ee.applyGamma=Wi,Ee.applyAlpha=Yo,Ee.applyDayNightAlpha=Vn,Ee.applySplit=ln,Ee.enableFog=rr,Ee.enableClippingPlanes=zu,Ee.clippingPlanes=ma,Ee.hasImageryLayerCutout=Kn,Ee.colorCorrect=F,Ee.highlightFillTile=Ba,Ee.colorToAlpha=wn,Ee.showUndergroundColor=T,Ee.translucent=p,Ee.marsOptions={invertColor:ks,filterColor:hi,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let Qf=r.renderedMesh.indices.length;dt||(Qf=r.renderedMesh.indexCountWithoutSkirts),ut.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),ut.castShadows=_,ut.receiveShadows=b,ut.renderState=Rn,ut.primitiveType=Be.TRIANGLES,ut.vertexArray=r.vertexArray||r.fill.vertexArray,ut.count=Qf,ut.uniformMap=ii,ut.pass=Se.GLOBE,e._debug.wireframe&&(Ict(Ut,e,t),l(r.wireframeVertexArray)&&(ut.vertexArray=r.wireframeVertexArray,ut.primitiveType=Be.LINES,ut.count=Qf*2));let zs=ut.boundingVolume,JS=ut.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,zs),m.fromElements(zs.center.z,zs.center.x,zs.center.y,zs.center),n.mode===ne.MORPHING&&(zs=ae.union(q.boundingSphere,zs,zs))):(ut.boundingVolume=ae.clone(q.boundingSphere,zs),ut.orientedBoundingBox=Bn.clone(q.boundingVolume,JS)),ut.dirty=!0,p&&d.updateDerivedCommands(ut,n),sye(ut,n),Rn=hn,Gt=Oct}while(ke<Re)}var IN=no;function fye(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(fye.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Lt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Lt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var PN=fye;function ps(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(ps.prototype,{length:{get:function(){return this._layers.length}}});ps.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ps.prototype.addImageryProvider=function(e,t){let n=new Us(e);return this.add(n,t),n};ps.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ps.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};ps.prototype.contains=function(e){return this.indexOf(e)!==-1};ps.prototype.indexOf=function(e){return this._layers.indexOf(e)};ps.prototype.get=function(e){return this._layers[e]};function Mz(e,t){return e.indexOf(t)}function dye(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}ps.prototype.raise=function(e){let t=Mz(this._layers,e);dye(this,t,t+1)};ps.prototype.lower=function(e){let t=Mz(this._layers,e);dye(this,t,t-1)};ps.prototype.raiseToTop=function(e){let t=Mz(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};ps.prototype.lowerToBottom=function(e){let t=Mz(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Lct=new ce;function mye(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ce.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let d=Lct,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(u)}}ps.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];if(mye(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};ps.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];if(mye(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(r.push(c),o.push(s.imageryLayer))}),r.length!==0)return Promise.all(r).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=o[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};ps.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ps.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ps.prototype.isDestroyed=function(){return!1};ps.prototype.destroy=function(){return this.removeAll(!0),ue(this)};ps.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var ON=ps;function hye(e){this._ellipsoid=new f_(e.ellipsoid,m.ZERO)}Object.defineProperties(hye.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var RN=hye;function Xc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Qn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Fs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Xc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),r=0;for(let o=0;o<n;++o)for(let s=0;s<t;++s)i[r++]=new Xc({tilingScheme:e,x:s,y:o,level:0});return i};Xc.prototype._updateCustomData=function(e,t,n){let i=this.customData,r,o,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,r=0;r<t.length;++r)o=t[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(r=0;r<c.length;++r)o=c[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Xc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Fs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Xc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(r){return r.x===t&&r.y===n})[0]};Xc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Xc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Xc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Xc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Xc.prototype.freeResources=function(){this.state=Fs.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),Bz(this._southwestChild),this._southwestChild=void 0,Bz(this._southeastChild),this._southeastChild=void 0,Bz(this._northwestChild),this._northwestChild=void 0,Bz(this._northeastChild),this._northeastChild=void 0};function Bz(e){l(e)&&e.freeResources()}var MN=Xc;function Lz(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}Lz.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};Lz.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),pye(this,t)),t=i}};function pye(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}Lz.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&pye(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var BN=Lz;function Hf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new BN,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new RN({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Hf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Hf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Nct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,gye(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData,s=o.length;for(let a=0;a<s;++a){let c=o[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Hf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Fs.START&&e(t),t=t.replacementNext};Hf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Hf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let s=0;s<o;++s)if(r[s]===i){r.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Hf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function gye(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Hf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Nct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),gye(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Hf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),kct(this,e),Jct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Fct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=pe.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Hf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Yct(this,e),Kct(this,e),Fct(this,e))};Hf.prototype.isDestroyed=function(){return!1};Hf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var NN,_ye=new he;function Uct(e,t){let n=ce.center(e.rectangle,_ye),i=n.longitude-NN.longitude,r=n.latitude-NN.latitude;n=ce.center(t.rectangle,_ye);let o=n.longitude-NN.longitude,s=n.latitude-NN.latitude;return i*i+r*r-(o*o+s*s)}var Vct=new m,LN=[];function kct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r,o=e._tileProvider;if(!l(e._levelZeroTiles))if(o.ready){let A=o.tilingScheme;e._levelZeroTiles=MN.createLevelZeroTiles(A);let x=e._levelZeroTiles.length;if(LN.length<x)for(LN=new Array(x),r=0;r<x;++r)LN[r]===void 0&&(LN[r]=new FN)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;NN=t.camera.positionCartographic,a.sort(Uct);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(r=0,p=a.length;r<p;++r)s=a[r],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=B.getTranslation(g.transform,Vct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),r=0,p=a.length;r<p;++r)s=a[r],e._tileReplacementQueue.markTileRendered(s),s.renderable?Pa(e,s,o,t,c,!1,LN[r]):(V_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function V_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function FN(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function yye(){this.southwest=new FN,this.southeast=new FN,this.northwest=new FN,this.northeast=new FN}yye.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var Mq=new Array(31);for(let e=0;e<Mq.length;++e)Mq[e]=new yye;function zct(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=Wct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Qn.NONE,g=e.tileProvider;if(s||i){let h=Qn.originalResult(p)===Qn.RENDERED,A=Qn.originalResult(p)===Qn.CULLED||p===Qn.NONE,x=n.state===Fs.DONE,C=h||A||x;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&V_(e,e._tileLoadQueueMedium,n,t),Nz(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&V_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){Nz(e,n),V_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.REFINED;let A=e._tilesToRender.length,x=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,E=e._tileToUpdateHeights.length;if(Hct(e,a,c,u,f,t,i,r),A!==e._tilesToRender.length){let S=r.allAreRenderable,w=r.anyWereRenderedLastFrame,D=r.notYetRenderableCount,R=!1;if(!S&&!w){let O=e._tilesToRender;for(let N=A;N<O.length;++N){let _=O[N];for(;_!==void 0&&_._lastSelectionResult!==Qn.KICKED&&_!==n;)_._lastSelectionResult=Qn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=A,e._tileToUpdateHeights.length=E,Nz(e,n),n._lastSelectionResult=Qn.RENDERED;let L=p===Qn.RENDERED;!L&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=T,V_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,R=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!R&&V_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,Nz(e,n),V_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function Hct(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Mq[t.level],p=d.southwest,g=d.southeast,h=d.northwest,A=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Pa(e,t,u,o,f,s,p),Pa(e,n,u,o,f,s,g),Pa(e,i,u,o,f,s,h),Pa(e,r,u,o,f,s,A)):(Pa(e,i,u,o,f,s,h),Pa(e,t,u,o,f,s,p),Pa(e,r,u,o,f,s,A),Pa(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Pa(e,n,u,o,f,s,g),Pa(e,t,u,o,f,s,p),Pa(e,r,u,o,f,s,A),Pa(e,i,u,o,f,s,h)):(Pa(e,r,u,o,f,s,A),Pa(e,i,u,o,f,s,h),Pa(e,n,u,o,f,s,g),Pa(e,t,u,o,f,s,p)),d.combine(a)}function Gct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Pa(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==co.NONE)return zct(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Gct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&V_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Qn.NONE;c!==Qn.CULLED_BUT_NEEDED&&c!==Qn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Qn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(V_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Qn.CULLED):t._lastSelectionResult=Qn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Wct(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof To)return jct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function jct(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function Nz(e,t){e._tilesToRender.push(t)}function Yct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=yi()+e._loadQueueTimeSlice,s=e._tileProvider,a=Oq(e,t,s,o,n,!1);a=Oq(e,t,s,o,i,a),Oq(e,t,s,o,r,a)}function qct(e,t){return e._loadPriority-t._loadPriority}function Oq(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(qct);for(let s=0,a=r.length;s<a&&(yi()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var ES=new In,Rq=new he,$y=new m,Xct=[];function Kct(e,t){if(!e.tileProvider.ready)return;let n=Xct;n.length=0;let i=e._tileToUpdateHeights,r=yi(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Qn.NONE;(A===Qn.RENDERED||A===Qn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let A=p[f],x=d.data.terrainData,C=l(x)&&x.wasCreatedByUpsampling();if(d.level>A.level&&!C){if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=m.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let E=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,ES.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,ES.origin);if(!l(S)){let w=0;l(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(w,-11500),R=m.multiplyByScalar(E,Math.abs(D)+1,$y);m.subtract(A.positionOnEllipsoidSurface,R,ES.origin)}}else he.clone(A.positionCartographic,Rq),Rq.height=-11500,c.project(Rq,$y),m.fromElements($y.z,$y.x,$y.y,$y),m.clone($y,ES.origin),m.clone(m.UNIT_X,ES.direction);let T=d.data.pick(ES,a,c,!1,$y);l(T)&&(l(A.callback)&&A.callback(T),A.level=d.level)}if(yi()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Jct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var UN=Hf;function Am(e){e=y(e,re.WGS84);let t=new Yx({ellipsoid:e}),n=new ON;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new SN,this._material=void 0,this._surface=new UN({tileProvider:new IN({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Lt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new PN,Lq(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Am.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&Lq(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Lq(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Lt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Lq(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[U_,_S];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(EN),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[U_,_S,bN],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Zct(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),r=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var Qct=[],$ct={start:0,stop:0};Am.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let r=t.mode,o=t.mapProjection,s=Qct;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(r!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,o,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=qi.raySphere(e,g,$ct);l(h)&&s.push(p)}s.sort(Zct(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var elt=new he;Am.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,elt);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var tlt=new m,Aye=new m,nlt=new he,ilt=new In;function Bq(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}Am.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=Bq(n._southwestChild,e)||Bq(n._southeastChild,e)||Bq(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,tlt),u=ilt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),A=m.multiplyByScalar(f,Math.abs(h)+1,Aye);m.subtract(c,A,u.origin)}let p=n.data.pick(u,void 0,s,!1,Aye);if(l(p))return a.cartesianToCartographic(p,nlt).height};Am.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Am.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=this.showWaterEffect&&l(i)&&i.hasWaterMask&&i._ready&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Bt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Am.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Am.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var VN=Am;var kl=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var e0=`uniform highp sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function Ph(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new di({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new di({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new di,this._tempCopyDepthFramebuffer=new di,this._updateDepthFramebuffer=new di({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Ph.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function rlt(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function xye(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ke.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ke.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ke.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ke.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Gn.NEVER,reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(e0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(kl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(e0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(kl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ri({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Ph.prototype.update=function(e,t,n,i,r,o){let s=n.width,a=n.height,c=r?e.halfFloatingPointTexture?Ze.HALF_FLOAT:Ze.FLOAT:Ze.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),xye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o};Ph.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Ph.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Ph.prototype.executeUpdateDepth=function(e,t,n,i){let r=l(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,o,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,o,s),xye(this,e,o,s,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Ph.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Ph.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Ph.prototype.isDestroyed=function(){return!1};Ph.prototype.destroy=function(){return rlt(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var kN=Ph;function lC(){this._framebuffer=new di({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new di,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(lC.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function olt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function slt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?Ze.HALF_FLOAT:Ze.FLOAT:Ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function alt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ke.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ke.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ke.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(e0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ri({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}lC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;slt(this,n,r,o,e),alt(this,n,r,o,i),this._useHdr=e};lC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};lC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};lC.prototype.isDestroyed=function(){return!1};lC.prototype.destroy=function(){return olt(this),ue(this)};var zN=lC;var ua={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},uC=ua.DERIVED_COMMANDS_MAXIMUM_LENGTH,Pye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function fC(){this._frontFaceAlphaByDistance=new Lt(0,1,0,1),this._backFaceAlphaByDistance=new Lt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(uC),this._derivedBlendCommandTypes=new Array(uC),this._derivedPickCommandTypes=new Array(uC),this._derivedCommandTypesToUpdate=new Array(uC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(fC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});fC.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Cye(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Cye(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Tye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Tye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=flt(this,e,t),this._sunVisibleThroughGlobe=clt(this,e),this._environmentVisible=llt(this,e),this._useDepthPlane=ult(this,e),this._numberOfTextureUniforms=dlt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),mlt(this,e)};function Cye(e,t,n,i){return e?l(n)?(Lt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function Tye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function clt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function llt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function ult(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function flt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function dlt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function mlt(e,t){e._derivedCommandsLength=Nq(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Nq(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Nq(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<uC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Dlt())}function Nq(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ua.PICK_FRONT_FACE:u?ua.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ua.TRANSLUCENT_FRONT_FACE,d=i?ua.PICK_BACK_FACE:u?ua.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ua.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(r[o++]=ua.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=ua.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=ua.DEPTH_ONLY_BACK_FACE),r[o++]=ua.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=ua.DEPTH_ONLY_FRONT_FACE),r[o++]=ua.OPAQUE_BACK_FACE,r[o++]=f),o)}function Gf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Eye(e,t){return e.indexOf(t)>-1}function hlt(e,t){Gf(e.defines,"TRANSLUCENT"),Gf(t.defines,"TRANSLUCENT")}function plt(e,t){Gf(e.defines,"GROUND_ATMOSPHERE"),Gf(t.defines,"GROUND_ATMOSPHERE"),Gf(e.defines,"FOG"),Gf(t.defines,"FOG"),Gf(e.defines,"TRANSLUCENT"),Gf(t.defines,"TRANSLUCENT")}function Fq(e,t){if(Eye(t.defines,"TILE_LIMIT_RECTANGLE")||Eye(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function Uq(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=He.replaceMain(n[o],"czm_globe_translucency_main");let r=` - -uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; -#ifdef MANUAL_DEPTH_TEST - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - if (logDepthOrDepth != 0.0) - { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } - } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) - { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; - } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`;n.push(r)}function Oye(e,t){Uq(e,t),Gf(e.defines,"GROUND_ATMOSPHERE"),Gf(t.defines,"GROUND_ATMOSPHERE"),Gf(e.defines,"FOG"),Gf(t.defines,"FOG")}function _lt(e,t){Uq(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function glt(e,t){Oye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function bye(e,t){let n=`uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; - vec4 pickColor = texture(u_classificationTexture, st); - if (pickColor == vec4(0.0)) - { - discard; - } - out_FragColor = pickColor; -} -`;t.sources=[n]}function ylt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Alt(e){e.cull.face=gi.BACK,e.cull.enabled=!0}function xlt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0}function Clt(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Tlt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Elt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Sye(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function vye(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function blt(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Slt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function vlt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=ze.getState(e);i(s),o=ze.fromCache(s),r[e.id]=o}return o}function bS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function wlt(e,t,n,i,r){return l(r)?!i&&l(n)?n:gt(t,r(e),!1):t}function xm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Dlt(){return[new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:hlt,getRenderStateFunction:Alt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:plt,getRenderStateFunction:xlt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:Fq,getRenderStateFunction:Clt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:Fq,getRenderStateFunction:Tlt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:Fq,getRenderStateFunction:Elt,getUniformMapFunction:void 0}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Uq,getRenderStateFunction:Sye,getUniformMapFunction:bS}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Oye,getRenderStateFunction:vye,getUniformMapFunction:bS}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:_lt,getRenderStateFunction:Sye,getUniformMapFunction:bS}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:glt,getRenderStateFunction:vye,getUniformMapFunction:bS}),new xm({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bye,getRenderStateFunction:blt,getUniformMapFunction:bS}),new xm({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bye,getRenderStateFunction:Slt,getUniformMapFunction:bS})]}var wye=new Array(uC),Dye=new Array(uC);fC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)Dye[r]=this._derivedCommandPacks[n[r]],wye[r]=Pye[n[r]];Ilt(this,e,i,n,wye,Dye,t)}};function Ilt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,A=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),A&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let C=o[x],T=i[x],E=r[x],S=a[E],w,D,R;l(S)?(w=S.uniformMap,D=S.shaderProgram,R=S.renderState):(w=void 0,D=void 0,R=void 0),S=nt.shallowClone(t,S),a[E]=S;let O=y(S.derivedCommands.uniformMapDirtyFrame,0),L=y(S.derivedCommands.shaderProgramDirtyFrame,0),N=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||O<f,b=h||L<d,v=A||N<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),b&&(S.derivedCommands.shaderProgramDirtyFrame=u),v&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=T,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=wlt(e,t.uniformMap,w,_,C.getUniformMapFunction),S.shaderProgram=ylt(s.context,t.shaderProgram,D,b,C.getShaderProgramFunction,E),S.renderState=vlt(t.renderState,R,v,C.getRenderStateFunction,C.renderStateCache)}}}fC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=Pye[r[a]];n.commandList.push(s[c])}};function Rye(e,t,n,i,r,o,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,r,o)}}function Iye(e,t,n,i,r,o){for(let s=0;s<t;++s)n(e[s],i,r,o)}var Plt=[ua.OPAQUE_FRONT_FACE,ua.OPAQUE_BACK_FACE],Olt=[ua.DEPTH_ONLY_FRONT_FACE,ua.DEPTH_ONLY_BACK_FACE,ua.DEPTH_ONLY_FRONT_AND_BACK_FACE];fC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),Rye(s,a,t,i,o,r,Plt))};fC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE],c=e.commands[Se.TERRAIN_CLASSIFICATION],u=e.indices[Se.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&Iye(c,u,t,i,o,r),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=o.uniformState.globeDepthTexture,g=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,Rye(s,a,t,i,o,r,Olt),o.depthTexture){let h=n.packDepth(o,r);o.uniformState.globeDepthTexture=h}Iye(c,u,t,i,o,r),o.uniformState.globeDepthTexture=p,r.framebuffer=g};var HN=fC;var Mye=vr(Vj(),1);function Vq(){this._image=new Image}Vq.prototype.isReady=function(){return!0};Vq.prototype.shouldDiscardImage=function(e){return e===this._image};function dC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Vq),this._errorEvent=new pe,this._ready=!1;let n=this,i,r;if(l(e.url)){$("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let o=ve.createIfNeeded(e.url);r=new fm(o)}l(e.metadata)&&($("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),r=e.metadata),this._metadata=r,l(r)&&(this._readyPromise=r.readyPromise.then(function(o){if(!r.imageryPresent){let s=new de(`The server ${r.url} doesn't have imagery`);return i=Ai.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return Ai.reportSuccess(i),n._ready=o,o}).catch(function(o){return i=Ai.reportError(i,n,n._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)}))}Object.defineProperties(dC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});dC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new dC(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};dC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};dC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=fm.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new jr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=Rlt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){QB(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Mlt(f)),!l(d)&&(!l(p)||p)){let g=Blt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:EA({uint8Array:f,format:d,flipY:!0})})};dC.prototype.pickFeatures=function(e,t,n,i,r){};function Rlt(e,t,n,i,r,o){let s=fm.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function Mlt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Blt(e){let t=Mye.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var kq=dC;var Llt=new z(1,1,1,.4),Nlt=new z(0,1,0,.05),Flt=new z(0,.5,0,.2);function mC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,Llt),this._glowColor=y(e.glowColor,Nlt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,Flt),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(mC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});mC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};mC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};mC.prototype.getTileCredits=function(e,t,n){};mC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};mC.prototype.pickFeatures=function(e,t,n,i,r){};var zq=mC;function Hq(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(Hq.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Hq.prototype.load=async function(){return this._data=await hC.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var GN=Hq;function SS(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(SS.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Ult(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}SS.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let r=e._parseHeader(n),o=Ult(e._storageInfo.attributeValues.valueType);o>0&&(r=Math.ceil(r/o)*o),e._parseBody(n,r)}})};SS.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};SS.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};SS.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=this._storageInfo[i];if(l(r)){this._values[i]=[];for(let o=0;o<this._header.count;++o)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[o],a="";for(let c=0;c<s;++c){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(a+=u.value),t=u.offset}this._values[i].push(a)}}}};var WN=SS;function jN(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(jN.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});jN.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Vlt=new m,klt=new m,zlt=new m,Hlt=new m,Glt=new m;function Gq(e,t,n,i){let r=m.subtract(i,n,Vlt),o=m.cross(r,m.subtract(e,n,klt),Hlt),s=m.cross(r,m.subtract(t,n,zlt),Glt);return m.dot(o,s)>=0}var Wlt=new m,jlt=new m,Ylt=new m,qlt=new m,Xlt=new m,Klt=new m,Jlt=new m,Zlt=new m,Qlt=new m,$lt=new m;jN.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,h,A;l(f)?(g=f[p],h=f[p+1],A=f[p+2]):(g=p*3,h=p*3+1,A=p*3+2);let x=m.fromElements(u[g*3],u[g*3+1],u[g*3+2],Wlt),C=m.fromElements(u[h*3],u[h*3+1],u[h*3+2],jlt),T=new m(u[A*3],u[A*3+1],u[A*3+2],Ylt);if(!Gq(i,x,C,T)||!Gq(i,C,x,T)||!Gq(i,T,x,C))continue;let E=m.subtract(C,x,qlt),S=m.subtract(T,x,Xlt),w=m.cross(E,S,Klt);if(m.magnitude(w)===0)continue;let D=m.normalize(w,Jlt),R=m.subtract(i,x,Zlt),O=Math.abs(m.dot(R,D));if(O<r){r=O,o=p;let L=m.magnitudeSquared(m.subtract(i,x,R)),N=m.magnitudeSquared(m.subtract(i,C,Qlt)),_=m.magnitudeSquared(m.subtract(i,T,$lt));L<N&&L<_?(a=g,c=x,s=L):N<_?(a=h,c=C,s=N):(a=A,c=T,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};jN.prototype._generateGltf=function(e,t,n,i,r,o){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,u="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[A],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let T=this._layer._data.textureSetDefinitions[C];for(let E=0;E<T.formats.length;E++){let S=T.formats[E];if(S.format==="jpg"){x=S.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(u=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${x}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,u=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:u}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var vS=jN;function zl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(zl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});zl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Af(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await hC.loadJson(this._resource,this._dataProvider._traceFetches);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};zl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(r,o){let s=new WN(t,r[o]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let r=0;r<e.length;r++)i.push(n(e,r));return Promise.all(i)};zl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};zl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};zl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new zl(e,y(i.href,i),!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};zl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new vS(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new vS(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};zl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new GN(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};zl.prototype._clearGeometryData=function(){this._geometryData=[]};zl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let T=this._dataProvider._geoidDataList[C],E=T.projection.project(n);if(E.x>T.nativeExtent.west&&E.x<T.nativeExtent.east&&E.y>T.nativeExtent.south&&E.y<T.nativeExtent.north){n.height+=tut(E.x,E.y,T);break}}let i={},r,o=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=re.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=o/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new za(0,0,0),u=Mt.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new B(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=B.inverse(p,new B),h=B.clone(p);l(this._parent._globalTransform)&&B.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let A=[];for(let C=0;C<this._children.length;C++)A.push(this._children[C]._create3DTileDefinition());return{children:A,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};zl.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,r=0,o=0,s=0;l(n.obb)?(r=n.obb.center[0],o=n.obb.center[1],s=n.obb.center[2]):l(n.mbs)&&(r=n.mbs[0],o=n.mbs[1],s=n.mbs[2]);let a=Z.fromRotationX(-P.PI_OVER_TWO),c=new Z;Z.multiply(a,i,c);let u=he.fromDegrees(r,o,s),f=re.WGS84.cartographicToCartesian(u),d={binaryData:t.geometryData._data,featureData:l(t.featureData)&&l(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:u,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};zl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let r=Promise.resolve();if(l(i._geometryData)&&i._geometryData.length>0){let o={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,o);if(!l(s))return;r=s.then(function(a){e=o.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return r.then(function(){let o=i._dataProvider._binarizeGltf(e),s=new Blob([o],{type:"application/binary"});return URL.createObjectURL(s)})})};Af.prototype._hookedRequestContent=Af.prototype.requestContent;Af.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new ve({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function eut(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function Fz(e,t,n,i){let r=e+t*n;return i[r]}function tut(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=Fz(s,a,n.width,n.buffer),d=Fz(c,a,n.width,n.buffer),p=Fz(s,u,n.width,n.buffer),g=Fz(c,u,n.width,n.buffer),h=eut(r,o,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(Af.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var wS=zl;function Wf(e,t,n){this._dataProvider=e,l(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),r="";i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new ve({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Wf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Wf.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Wf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Wf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}return 0};Wf.prototype._loadRootNode=function(){if(l(this._data.nodePages)){let e=0;l(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new wS(this,e,!0)}else this._rootNode=new wS(this,this._data.store.rootNode,!0);return this._rootNode.load()};Wf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};Wf._fetchJson=function(e){return e.fetchJson()};Wf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Wf._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Wf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Wf.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(l(this._dataProvider._cesium3dTilesetOptions))for(let r in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(r)&&(i[r]=this._dataProvider._cesium3dTilesetOptions[r]);this._tileset=await va.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};var t0=Wf;var Lye=vr(Bye(),1);function es(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,l(e.url)&&($("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=ve.createIfNeeded(e.url),this._load())}Object.defineProperties(es.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return $("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return $("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});es.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};es.prototype.isDestroyed=function(){return!1};es.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};es.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};es.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};es.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};es.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i=await es.loadJson(n),r=new es(t);if(r._resource=n,r._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new t0(r,i.layers[s],s);r._layers.push(a)}else{let s=new t0(r,i,i.id);r._layers.push(s)}r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load());return await Promise.all(o),r._ready=!0,r._readyPromise=Promise.resolve(r),r};es.prototype._load=function(){let e=this;return this._readyPromise=es.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,l(t.layers))for(let i=0;i<t.layers.length;i++){let r=new t0(e,t.layers[i],i);e._layers.push(r)}else{let i=new t0(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};es._fetchJson=function(e){return e.fetchJson()};es.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await es._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};es.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};es.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]="g".charCodeAt(),r.magic[1]="l".charCodeAt(),r.magic[2]="T".charCodeAt(),r.magic[3]="F".charCodeAt(),r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};es.prototype.getDecoderTaskProcessor=function(){if(l(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!l(this._decoderTaskProcessor)){let e=new pi("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function nut(e,t){return rut(e,t)}var iut=new H;function rut(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=H.fromElements(d,p,iut),h=g.toString();if(!r.hasOwnProperty(h)){let A={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[h]=A,i.push(A)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},A=d[g],x="Geographic";n._projection instanceof wi&&(x="WebMercator");let C={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:A._height,width:A._width,scale:A._structure.heightScale,offset:A._structure.heightOffset};if(A._encoding===Bf.LERC){let T=Lye.default.decode(A._buffer);C.buffer=T.pixels[0]}else C.buffer=A._buffer;p.push(C)}return p})}async function out(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await nut(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}es.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=out(this),this._geoidDataPromise)};es.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var hC=es;function Oh(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new di({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new di({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ri({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ri({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Oh.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Oh.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var sut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Gn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},aut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Gn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},cut={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ft.setCesium3DTileBit(),stencilMask:Ft.CESIUM_3D_TILE_MASK,blending:mn.ALPHA_BLEND},lut=`uniform sampler2D colorTexture; -uniform sampler2D depthTexture; -uniform sampler2D classifiedTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) - { - discard; - } - bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); -#ifdef UNCLASSIFIED - vec4 highlightColor = czm_invertClassificationColor; - if (isClassified) - { - discard; - } -#else - vec4 highlightColor = vec4(1.0); - if (!isClassified) - { - discard; - } -#endif - out_FragColor = color * highlightColor; - gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; -} -`,uut=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) - { - discard; - } -#ifdef UNCLASSIFIED - out_FragColor = color * czm_invertClassificationColor; -#else - out_FragColor = color; -#endif -} -`;Oh.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Bt({context:e,width:s,height:a,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Yl({context:e,width:s,height:a,format:Cc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(sut),this._rsClassified=ze.fromCache(aut),this._rsDefault=ze.fromCache(cut)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?uut:lut,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),d=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(kl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Oh.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Oh.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Oh.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Oh.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Oh.prototype.isDestroyed=function(){return!1};Oh.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var DS=Oh;function Vz(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(Vz.prototype,{total:{get:function(){return this._total}}});function n0(e){let t=new Array(Ta.NUMBER_OF_JOB_TYPES);t[Ta.TEXTURE]=new Vz(l(e)?e[Ta.TEXTURE]:10),t[Ta.PROGRAM]=new Vz(l(e)?e[Ta.PROGRAM]:10),t[Ta.BUFFER]=new Vz(l(e)?e[Ta.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}n0.getTimestamp=yi;Object.defineProperties(n0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});n0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};n0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};n0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=n0.getTimestamp();e.execute();let a=n0.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var YN=n0;var Nye=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function kz(e,t){this.spatialNode=e,this.keyframe=t,this.state=Nye.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}kz.priorityComparator=function(e,t){return e.priority-t.priority};kz.searchComparator=function(e,t){return e.keyframe-t.keyframe};kz.LoadState=Nye;var Ki=kz;function Fye(){}Object.defineProperties(Fye.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var Wq=Fye;var fut=/\/$/,Uye=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function IS(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let r=y(e.tilesize,512);this._tilesize=r;let o=y(e.username,"mapbox");this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();fut.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=Uye,this._resource=i,this._imageryProvider=new Ns({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(IS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});IS.prototype.getTileCredits=function(e,t,n){};IS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};IS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};IS._defaultCredit=Uye;var jq=IS;function i0(e,t,n,i,r){i===on.UNSIGNED_SHORT&&(i=on.FLOAT32);let o=e.floatingPointTexture;if(i===on.FLOAT32&&!o)throw new de("Floating point texture not supported");let s;i===on.FLOAT32||i===on.FLOAT64?s=Ze.FLOAT:i===on.UINT8&&(s=Ze.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?at.RED:at.LUMINANCE:n===2?a=e.webgl2?at.RG:at.LUMINANCE_ALPHA:n===3?a=at.RGB:n===4&&(a=at.RGBA);let c=512*1024*1024,u=128*1024*1024;r=Math.min(y(r,u),c);let f=Ht.maximumTextureSize,d=on.getSizeInBytes(i),p=Math.floor(r/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),A=Math.ceil(t.z/h),x=h*t.x,C=A*t.y,T=Math.floor(g/x),E=Math.floor(g/C);if(T===0||E===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=T*E,this.regionCountPerMegatexture=new H(T,E),this.voxelCountPerRegion=new H(x,C),this.sliceCountPerRegion=new H(h,A),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(x/g,C/g),this.texture=new Bt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:xi.LINEAR})});let S=on.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,x*C*n),this.nodes=new Array(this.maximumTileCount);for(let w=0;w<this.maximumTileCount;w++)this.nodes[w]=new dut(w);for(let w=0;w<this.maximumTileCount;w++){let D=this.nodes[w];D.previousNode=w>0?this.nodes[w-1]:void 0,D.nextNode=w<this.maximumTileCount-1?this.nodes[w+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function dut(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}i0.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};i0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};i0.prototype.isFull=function(){return this.emptyList===void 0};i0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===on.UNSIGNED_SHORT&&(i=on.FLOAT32);let r=on.getSizeInBytes(i),o=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(o)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*r};i0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,r=this.sliceCountPerRegion,o=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let A=0;A<i.z;A++){let x=A%r.x*i.x,C=Math.floor(A/r.x)*i.y;for(let T=0;T<i.y;T++)for(let E=0;E<i.x;E++){let S=A*i.y*i.x+T*i.x+E,w=(C+T)*o.x+(x+E);for(let D=0;D<s;D++)a[w*s+D]=n[S*s+D]}}let c=this.regionCountPerMegatexture,u=o.x,f=o.y,d=e%c.x*o.x,p=Math.floor(e/c.x)*o.y,h={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var PS=i0;function qN(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,re.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new pN({radii:this.ellipsoid.radii,material:ki.fromType(ki.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new aL}Object.defineProperties(qN.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var zz=new Z,mut=new Z,hut=new m,Hz=[];qN.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,zz))||Mt.computeTemeToPseudoFixedMatrix(n,zz);let i=this._axes.evaluate(n,mut);Z.transpose(i,i),Z.multiply(zz,i,i);let r=rg.computeMoonPositionInEarthInertialFrame(n,hut);Z.multiplyByVector(zz,r,r),B.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=Hz,Hz.length=0,t.update(e),e.commandList=o,Hz.length===1?Hz[0]:void 0};qN.prototype.isDestroyed=function(){return!1};qN.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var XN=qN;function Yq(e){}Yq.prototype.isReady=function(){return!0};Yq.prototype.shouldDiscardImage=function(e){return!1};var qq=Yq;var OS=`#ifdef MRT -layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1; -#else -layout (location = 0) out vec4 out_FragColor; -#endif - -uniform vec4 u_bgColor; -uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) - { -#ifdef MRT - out_FragData_0 = u_bgColor; - out_FragData_1 = vec4(u_bgColor.a); -#else - out_FragColor = u_bgColor; -#endif - return; - } - - discard; -} -`;var KN=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ - -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; - -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif - - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;function k_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new di({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new di({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new di({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new di({createColorAttachments:!1}),this._opaqueClearCommand=new ri({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ri({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ri({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ri({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Vye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Xq(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function kye(e){Vye(e),Xq(e)}function put(e,t,n,i){Vye(e),e._accumulationTexture=new Bt({context:t,width:n,height:i,pixelFormat:at.RGBA,pixelDatatype:Ze.FLOAT});let r=new Float32Array(n*i*4);e._revealageTexture=new Bt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ze.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}function _ut(e,t){Xq(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Xq(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(kye(e),e._translucentMultipassSupport=!1,i=!1)}return i}k_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,put(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!_ut(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new He({sources:[KN]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new He({defines:["MRT"],sources:[OS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new He({sources:[OS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var gut={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.ONE,functionDestinationRgb:Tr.ONE,functionSourceAlpha:Tr.ZERO,functionDestinationAlpha:Tr.ONE_MINUS_SOURCE_ALPHA},yut={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.ONE,functionDestinationRgb:Tr.ONE,functionSourceAlpha:Tr.ONE,functionDestinationAlpha:Tr.ONE},Aut={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Tr.ZERO,functionDestinationRgb:Tr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Tr.ZERO,functionDestinationAlpha:Tr.ONE_MINUS_SOURCE_ALPHA};function Kq(e,t,n,i){let r=n[i.id];if(!l(r)){let o=ze.getState(i);o.depthMask=!1,o.blending=t,r=ze.fromCache(o),n[i.id]=r}return r}function xut(e,t,n){return Kq(t,gut,e._translucentRenderStateCache,n)}function Cut(e,t,n){return Kq(t,yut,e._translucentRenderStateCache,n)}function Tut(e,t,n){return Kq(t,Aut,e._alphaRenderStateCache,n)}var Eut=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragData_0 = vec4(Ci * wzi, ai); - out_FragData_1 = vec4(ai * wzi); -`,but=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragColor = vec4(Ci, ai) * wzi; -`,Sut=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function Jq(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; -bool czm_discard = false; -`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; -${u}`}return a.sources.push(u),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; - } -${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function vut(e,t){return Jq(e,t,"translucentMRT",Eut)}function wut(e,t){return Jq(e,t,"translucentMultipass",but)}function Dut(e,t){return Jq(e,t,"alphaMultipass",Sut)}k_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=vut(t,e.shaderProgram),n.translucentCommand.renderState=xut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=wut(t,e.shaderProgram),n.translucentCommand.renderState=Cut(this,t,e.renderState),n.alphaCommand.shaderProgram=Dut(t,e.shaderProgram),n.alphaCommand.renderState=Tut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function Iut(e,t,n,i,r,o){let s,a,c,{context:u,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,A=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let x=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x);for(l(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x);l(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x)),i.framebuffer=h}function Put(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,A;for(let x=0;x<r.length;++x)h=r[x],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g);l(o)&&(h=o.unclassifiedCommand,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g)),i.framebuffer=d}k_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){Put(this,e,t,n,i,r);return}Iut(this,e,t,n,i,r)};k_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};k_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};k_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};k_.prototype.isDestroyed=function(){return!1};k_.prototype.destroy=function(){return kye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var JN=k_;var Out=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function Gz(e){e=y(e,y.EMPTY_OBJECT);let t=ve.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new Bo({ellipsoid:e.ellipsoid}),i=256,r=256,o=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),o),u=n.positionToTileXY(ce.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,Out);typeof d=="string"&&(d=new It(d)),Ns.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(Gz.prototype=Object.create(Ns.prototype),Gz.prototype.constructor=Gz);var pC=Gz;var Rut=new H(1,1);function Zq(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,Rut)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Zq.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var zye=new m;Zq.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,zye),m.add(this.position,zye,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var RS=Zq;function Hye(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(Hye.prototype,{complete:{get:function(){return this._complete}}});var Qq=Hye;function Gye(e){}Gye.prototype.emit=function(e){fe.throwInstantiationError()};var $q=Gye;var Wye=new H(1,1);function ZN(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new qL(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._emitterModelMatrix=B.clone(y(e.emitterModelMatrix,B.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new B,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,Wye))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,Wye))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(ZN.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!B.equals(this._modelMatrix,e),B.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!B.equals(this._emitterModelMatrix,e),B.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function Mut(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new RS;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function But(e){let t=e._particlePool.pop();return l(t)||(t=new RS),t}function Lut(e,t){e._particlePool.push(t)}function Nut(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function Fut(e){l(e._billboard)&&(e._billboard.show=!1)}function jye(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function Uut(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Vut(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var Wz=new m;ZN.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new iu),this._updateParticlePool&&(Mut(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?jye(this,s):(Fut(s),Lut(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=Vut(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=B.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=But(this),this._emitter.emit(s),m.add(s.position,s.velocity,Wz),B.multiplyByPoint(u,Wz,Wz),s.position=B.multiplyByPoint(u,s.position,s.position),m.subtract(Wz,s.position,s.velocity),m.normalize(s.velocity,s.velocity),Uut(this,s),jye(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&Nut(this)};ZN.prototype.isDestroyed=function(){return!1};ZN.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var eX=ZN;function jz(e){e=y(e,y.EMPTY_OBJECT);let t=Pn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=yi(),this._lastMsSampleTime=yi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(jz.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});jz.prototype.update=function(e){let t=yi(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};jz.prototype.destroy=function(){return ue(this)};var z_=jz;function _C(){this._framebuffer=new di,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(_C.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function kut(e,t,n){let i=n.width,r=n.height;e._framebuffer.update(t,i,r)}function zut(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); -} -`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:ze.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}_C.prototype.update=function(e,t){kut(this,e,t),zut(this,e,t)};var Hut=new oe,Gut=new oe(1,1/255,1/65025,1/16581375);_C.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=oe.unpack(i,0,Hut);return oe.divideByScalar(r,255,r),oe.dot(r,Gut)};_C.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var QN=_C;function $N(){this._framebuffer=new di({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties($N.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Wut(e){e._framebuffer.destroy()}function jut(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Ga(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Ke},r.viewport=new Ke,e._passState=r}$N.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&jut(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};$N.prototype.isDestroyed=function(){return!1};$N.prototype.destroy=function(){return Wut(this),ue(this)};var eF=$N;function nF(e){let t=new Ga(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new di({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}nF.prototype.begin=function(e,t){let n=this._context,i=t.width,r=t.height;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};var tF=new z;nF.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),s=o*o,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+u+a);tF.red=z.byteToFloat(r[h]),tF.green=z.byteToFloat(r[h+1]),tF.blue=z.byteToFloat(r[h+2]),tF.alpha=z.byteToFloat(r[h+3]);let A=i.getObjectByPickColor(tF);if(l(A))return A}if(u===f||u<0&&-u===f||u>0&&u===1-f){let h=d;d=-p,p=h}u+=d,f+=p}};nF.prototype.isDestroyed=function(){return!1};nF.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var iF=nF;function H_(){this._numSamples=1,this._colorFramebuffer=new di({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new di({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ri({color:new z(0,0,0,0),depth:1,owner:this})}function Yut(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(H_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});H_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?Ze.HALF_FLOAT:Ze.FLOAT:Ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};H_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};H_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};H_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};H_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};H_.prototype.isDestroyed=function(){return!1};H_.prototype.destroy=function(){return Yut(this),ue(this)};var gC=H_;function yC(){}yC.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};yC.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=He.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=He.replaceMain(r[u],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`;r.push(c)}return new He({defines:i,sources:r})};yC.createShadowCastFragmentShader=function(e,t,n,i){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=o.length;for(let f=0;f<c;++f)o[f]=He.replaceMain(o[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,o.push(u),new He({defines:r,sources:o})};yC.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};yC.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new He({defines:i,sources:r})};yC.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=He.findNormalVarying(e),s=!i&&l(o)||i&&r,a=He.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,A=t.softShadows,x=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),T=e.sources.slice(0),E=T.length;for(let D=0;D<E;++D)T[D]=He.replaceMain(T[D],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),A&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; -`:S+=`uniform sampler2D shadowMap_texture; -`;let w;return c?w=` return vec4(${a}, 1.0); -`:w=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,S+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${w}} -vec3 getNormalEC() -{ -${s?` return normalize(${o}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${x.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,S+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,S+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; - float distance = length(directionEC); - directionEC = normalize(directionEC); - float radius = shadowMap_lightPositionEC.w; - // Stop early if the fragment is beyond the point light radius - if (distance > radius) - { - return; - } - vec3 directionWC = czm_inverseViewRotation * directionEC; - shadowParameters.depth = distance / radius; - shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - shadowParameters.texCoords = directionWC; - float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); -`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${h?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,S+=` out_FragColor.rgb *= visibility; -} -`,T.push(S),new He({defines:C,sources:T})};var Rh=yC;function Mh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Wt.isInternetExplorer()||Wt.isEdge()||(Wt.isChrome()||Wt.isFirefox())&&Wt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new B,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new Yz,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new To:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new B,new B,new B,new B],this._cascadeDistances=new oe;let r;this._isPointLight?r=6:this._cascadesEnabled?r=this._numberOfCascades:r=1,this._passes=new Array(r);for(let o=0;o<r;++o)this._passes[o]=new qut(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,nX(this),this._clearCommand=new ri({depth:1,color:new z}),this._clearPassState=new Ga(t),this._size=y(e.size,2048),this.size=this._size}Mh.MAXIMUM_DISTANCE=2e4;function qut(e){this.camera=new Yz,this.passState=new Ga(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function tX(e,t){return ze.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function nX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=tX(t,e._primitiveBias),e._terrainRenderState=tX(t,e._terrainBias),e._pointRenderState=tX(t,e._pointBias)}Mh.prototype.debugCreateRenderStates=function(){nX(this)};Object.defineProperties(Mh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){$ut(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function iX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Xut(e,t){let n=new Yl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Cc.DEPTH_COMPONENT16}),i=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,sampler:dn.NEAREST}),r=new Ys({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Kut(e,t){let n=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ze.UNSIGNED_INT_24_8,sampler:dn.NEAREST}),i=new Ys({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Jut(e,t){let n=new Yl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Cc.DEPTH_COMPONENT16}),i=new Ha({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,sampler:dn.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new Ys({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Xye(e,t){e._isPointLight?Jut(e,t):e._usesDepthTexture?Kut(e,t):Xut(e,t)}function Zut(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,nX(e),iX(e),Xye(e,t))}function Qut(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(iX(e),Xye(e,t),Zut(e,t),Kye(e,t))}function Kye(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function $ut(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ht.maximumCubeMapSize>=t?t:Ht.maximumCubeMapSize,r.x=t,r.y=t;let o=new Ke(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ht.maximumTextureSize>=t?t:Ht.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Ht.maximumTextureSize>=t*2?t:Ht.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new B(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var eft=new Ke;function tft(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; -in vec2 v_textureCoordinates; -void main() -{ - vec2 uv = v_textureCoordinates; - vec3 dir; - - if (uv.y < 0.5) - { - if (uv.x < 0.333) - { - dir.x = -1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 1.0; - } - else if (uv.x < 0.666) - { - dir.y = -1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 1.0; - } - else - { - dir.z = -1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 1.0; - } - } - else - { - if (uv.x < 0.333) - { - dir.x = 1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 3.0; - } - else if (uv.x < 0.666) - { - dir.y = 1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 3.0; - } - else - { - dir.z = 1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 3.0; - } - } - - float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); - out_FragColor = vec4(vec3(shadow), 1.0); -} -`:n=`uniform sampler2D shadowMap_texture; -in vec2 v_textureCoordinates; -void main() -{ -${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; -`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); -`} out_FragColor = vec4(vec3(shadow), 1.0); -} -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Se.OVERLAY,i}function nft(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=eft;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=tft(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Bh=new Array(8);Bh[0]=new oe(-1,-1,-1,1);Bh[1]=new oe(1,-1,-1,1);Bh[2]=new oe(1,1,-1,1);Bh[3]=new oe(-1,1,-1,1);Bh[4]=new oe(-1,-1,1,1);Bh[5]=new oe(1,-1,1,1);Bh[6]=new oe(1,1,1,1);Bh[7]=new oe(-1,1,1,1);var r0=new B,rX=new Array(8);for(let e=0;e<8;++e)rX[e]=new oe;function ift(e,t){let n=new Tt({geometry:new ad({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:kt.fromColor(t)}}),i=new Tt({geometry:new t_({radius:.5}),attributes:{color:kt.fromColor(t)}});return new vn({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var rft=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],oft=new m;function sft(e,t){nft(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Dh({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Dh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Dh({camera:e._passes[i].camera,color:rft[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=m.fromElements(o,o,o,oft),a=B.fromTranslationQuaternionRotationScale(i,r,s,r0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ift(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Dh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function Yz(){this.viewMatrix=new B,this.inverseViewMatrix=new B,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new B}Yz.prototype.clone=function(e){B.clone(e.viewMatrix,this.viewMatrix),B.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var aft=new B(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Yz.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return B.multiply(t,e,this.viewProjectionMatrix),B.multiply(aft,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var cft=new Array(5),lft=new bi,uft=new Array(4),Jye=new m,Zye=new m;function fft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=uft,g=cft;for(g[0]=r,g[s]=o,a=0;a<s;++a){let N=(a+1)/s,_=r*Math.pow(u,N),b=r+c*N,v=P.lerp(b,_,f);g[a+1]=v,p[a]=v-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let h=n.frustum,A=h.left,x=h.right,C=h.bottom,T=h.top,E=h.near,S=h.far,w=n.positionWC,D=n.directionWC,R=n.upWC,O=i.frustum.clone(lft),L=n.getViewProjection();for(a=0;a<s;++a){O.near=g[a],O.far=g[a+1];let N=B.multiply(O.projectionMatrix,i.viewMatrix,r0),_=B.inverse(N,r0),b=B.multiply(L,_,r0),v=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Jye),I=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Zye);for(let G=0;G<8;++G){let U=oe.clone(Bh[G],rX[G]);B.multiplyByVector(b,U,U),m.divideByScalar(U,U.w,U),m.minimumByComponent(U,v,v),m.maximumByComponent(U,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let M=e._passes[a],F=M.camera;F.clone(n);let k=F.frustum;k.left=A+v.x*(x-A),k.right=A+I.x*(x-A),k.bottom=C+v.y*(T-C),k.top=C+I.y*(T-C),k.near=E+v.z*(S-E),k.far=E+I.z*(S-E),M.cullingVolume=F.frustum.computeCullingVolume(w,D,R);let V=e._cascadeMatrices[a];B.multiply(F.getViewProjection(),i.inverseViewMatrix,V),B.multiply(M.textureOffsets,V,V)}}var dft=new B,mft=new m,hft=new m,Yye=new m;function pft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=B.multiply(i.frustum.projectionMatrix,i.viewMatrix,r0),o=B.inverse(r,r0),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,mft);a=m.cross(c,s,hft),m.normalize(a,a),m.normalize(c,c);let u=m.fromElements(0,0,0,Yye),f=B.computeView(u,s,a,c,dft),d=B.multiply(f,o,r0),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Jye),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Zye);for(let S=0;S<8;++S){let w=oe.clone(Bh[S],rX[S]);B.multiplyByVector(d,w,w),m.divideByScalar(w,w.w,w),m.minimumByComponent(w,p,p),m.maximumByComponent(w,g,g)}g.z+=1e3,p.z-=10;let h=Yye;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let A=B.fromTranslation(h,r0);f=B.multiply(A,f,f);let x=.5*(g.x-p.x),C=.5*(g.y-p.y),T=g.z-p.z,E=n.frustum;E.left=-x,E.right=x,E.bottom=-C,E.top=C,E.near=.01,E.far=T,B.clone(f,n.viewMatrix),B.inverse(f,n.inverseViewMatrix),B.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var _ft=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],gft=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],yft=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Aft(e,t){let n=new bi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=_ft[i],r.upWC=gft[i],r.rightWC=yft[i],B.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),B.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var xft=new m,Cft=new m,Qye=new ae,qye=Qye.center;function Tft(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=Qye;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,xft),s=m.negate(i.directionWC,Cft),a=m.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,o,qye),qye);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere)}}function Eft(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,o.directionWC):e._isPointLight?m.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;B.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),m.normalize(s,s),m.negate(s,s),B.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=sr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Tft(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Mh.prototype.update=function(e){if(Eft(this,e),this._needsUpdate)if(Qut(this,e.context),this._isPointLight&&Aft(this,e),this._cascadesEnabled&&(pft(this,e),this._numberOfCascades>1&&fft(this,e)),this._isPointLight)this._shadowMapCullingVolume=Jo.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;B.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&sft(this,e)};Mh.prototype.updatePass=function(e,t){Kye(this,e,t)};var bft=new H;function $ye(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=bft;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,oe.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return gt(t,r,!1)}function Sft(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=nt.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Se.GLOBE,d=n.pass!==Se.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Rh.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let x=u.vertexShaderSource,C=u.fragmentShaderSource,T=Rh.createShadowCastVertexShader(x,p,f),E=Rh.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=$ye(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}Mh.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Se.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=nt.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,h=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||h||n||g){let A=Rh.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,A),!l(d)){let x=Rh.createShadowReceiveVertexShader(a,u,f),C=Rh.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,A,{vertexShaderSource:x,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=$ye(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};Mh.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=Sft(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){iX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var G_=Mh;var rF=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); -} -`;var AC=`uniform sampler2D colorTexture; - -#ifdef DEBUG_SHOW_DEPTH -uniform sampler2D u_packedTranslucentDepth; -#endif - -in vec2 v_textureCoordinates; - -void main() -{ -#ifdef DEBUG_SHOW_DEPTH - if (v_textureCoordinates.x < 0.5) - { - out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); - out_FragColor.a = 1.0; - } -#else - vec4 color = texture(colorTexture, v_textureCoordinates); - -#ifdef PICK - if (color == vec4(0.0)) - { - discard; - } -#else - // Reverse premultiplication process to get the correct composited result of the classification primitives - color.rgb /= color.a; -#endif - out_FragColor = color; -#endif -} -`;var vft=!1;function o0(e){this._drawClassificationFBO=new di({createDepthAttachments:!1}),this._accumulationFBO=new di({createDepthAttachments:!1}),this._packFBO=new di,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ri({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ri({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(o0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function e0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function t0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function wft(e,t,n,i){e0e(e),e._translucentDepthStencilTexture=new Bt({context:t,width:n,height:i,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ze.UNSIGNED_INT_24_8,sampler:dn.NEAREST})}function Dft(e,t,n,i){t0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Ift(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(wft(e,t,r,o),Dft(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new He({sources:[rF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new He({sources:[AC]}),a={colorTexture:function(){return e._textureToComposite}},vft&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=nt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new He({sources:[AC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new He({sources:[AC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!Ke.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,reference:Ft.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}o0.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<o;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(Ift(this,u,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<o;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};o0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Se.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,r,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};o0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Pft(this,e,t)};function Pft(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}o0.prototype.isSupported=function(){return this._supported};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){return e0e(this),t0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var oF=o0;function Oft(){this.command=void 0,this.near=void 0,this.far=void 0}function qz(e,t,n){let i=e.context,r;i.depthTexture&&(r=new kN);let o;e._useOIT&&i.depthTexture&&(o=new JN(i));let s=new Ga(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=sr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new iF(i),this.pickDepthFramebuffer=new eF,this.sceneFramebuffer=new gC,this.globeDepth=r,this.globeTranslucencyFramebuffer=new zN,this.oit=o,this.translucentTileClassification=new oF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var n0e=new m,i0e=new m;function Rft(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}function Mft(e,t,n){let i=1/Math.max(1,Rft(e.position,t.position));return m.multiplyByScalar(e.position,i,n0e),m.multiplyByScalar(t.position,i,i0e),m.equalsEpsilon(n0e,i0e,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&B.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}qz.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Mft(t,n,P.EPSILON15)?(this._cameraStartFired&&yi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=yi(),sr.clone(t,n),!0)};function Bft(e,t,n,i){let r=t.frameState,o=r.camera,s=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),isNaN(n)&&(n=o.frustum.near),isNaN(i)&&(i=o.frustum.far);let u;a?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];l(h)?(h.near=p,h.far=g):h=f[d]=new CN(p,g)}}function Lft(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let o=e.frustumCommandsList,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.near,f=c.far;if(i>f)continue;if(r<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var r0e=new Jo,Nft=new Ec;qz.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Se.NUMBER_OF_PASSES;for(let b=0;b<u;++b)for(let v=0;v<f;++v)c[b].indices[v]=0;o.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,A=-Number.MAX_VALUE,x=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,T=-Number.MAX_VALUE,E=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,w=t.cullingVolume,D=r0e.planes;for(let b=0;b<5;++b)D[b]=w.planes[b];w=r0e;let R=a.length;for(let b=0;b<R;++b){let v=a[b],I=v.pass;if(I===Se.COMPUTE)o.push(v);else if(I===Se.OVERLAY)s.push(v);else{let M,F,k=v.boundingVolume;if(l(k)){if(!e.isVisible(v,w,S))continue;let G=k.computePlaneDistances(r,i,Nft);if(M=G.start,F=G.stop,h=Math.min(h,M),A=Math.max(A,F),x&&v.receiveShadows&&M<G_.MAXIMUM_DISTANCE&&!(I===Se.GLOBE&&M<-100&&F>100)){let U=F-M;I!==Se.GLOBE&&M<100&&(E=Math.min(E,U)),C=Math.min(C,M),T=Math.max(T,F)}}else v instanceof ri?(M=n.frustum.near,F=n.frustum.far):(M=n.frustum.near,F=n.frustum.far,h=Math.min(h,M),A=Math.max(A,F));let V=d[g];l(V)||(V=d[g]=new Oft),V.command=v,V.near=M,V.far=F,g++}}x&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),T=Math.max(Math.min(T,n.frustum.far),C)),x&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=T,t.shadowState.closestObjectSize=E),Bft(this,e,h,A);let O,L;for(O=0;O<g;O++)L=d[O],Lft(this,e,L.command,L.near,L.far);if(g<p)for(O=g;O<p&&(L=d[O],!!l(L.command));O++)L.command=void 0;let N=c.length,_=t.frustumSplits;_.length=N+1;for(let b=0;b<N;++b)_[b]=c[b].near,b===N-1&&(_[b+1]=c[b].far)};qz.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var xC=qz;var s0e=.1,Fft=new Vf({pass:Or.MOST_DETAILED_PRELOAD}),Uft=new Vf({pass:Or.MOST_DETAILED_PICK}),oX=new Vf({pass:Or.PICK});function Oa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new sr(e);n.frustum=new rn({width:s0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new xC(e,n,t)}Oa.prototype.update=function(){this._pickPositionCacheDirty=!0};Oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new QN,n[t]=i),i};var Vft=new To,kft=new m,Xz=new m,zft=new H,Hft=new B;function Gft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=B.clone(o.transform,Hft);o._setTransform(B.IDENTITY);let d=m.clone(o.position,kft);m.multiplyByScalar(o.right,c,Xz),m.add(Xz,d,d),m.multiplyByScalar(o.up,u,Xz),m.add(Xz,d,d),o._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,zft),g=Vft;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var Wft=new Yc,jft=new H;function Yft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,h=s.getPixelDimensions(r.width,r.height,1,1,jft),A=h.x*n*.5,x=h.y*i*.5,C=Wft;return C.top=g+x,C.bottom=g-x,C.right=p+A,C.left=p-A,C.near=a,C.far=s.far,C.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function a0e(e,t,n,i,r){let o=e.camera.frustum;return o instanceof rn||o instanceof To?Gft(e,t,n,i,r):Yft(e,t,n,i,r)}var MS=3,sF=3,Lh=new Ke(0,0,MS,sF),c0e=new H,sX=new z(0,0,0,0);Oa.prototype.pick=function(e,t,n,i){MS=y(n,3),sF=y(i,MS);let r=e.context,o=r.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let u=a.passState;u.viewport=Ke.clone(c,u.viewport);let f=Xi.transformWindowToDrawingBuffer(e,t,c0e);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=a0e(e,f,MS,sF,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=oX,o.update(s),e.updateEnvironment(),Lh.x=f.x-(MS-1)*.5,Lh.y=e.drawingBufferHeight-f.y-(sF-1)*.5,Lh.width=MS,Lh.height=sF,u=a.pickFramebuffer.begin(Lh,a.viewport),e.updateAndExecuteCommands(u,sX),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(Lh);return r.endFrame(),d};function qft(e,t){let n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=o.passState;a.viewport=Ke.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=a0e(e,t,1,1,s),i.tilesetPassState=oX,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,a=o.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,sX),e.resolveFramebuffers(a),n.endFrame()}var Xft=new bi,Kft=new Yc,Jft=new rn,Zft=new To;Oa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let r=e.frameState,o=e.context,s=o.uniformState,a=e.defaultView;e.view=a;let c=Xi.transformWindowToDrawingBuffer(e,t,c0e);e.pickTranslucentDepth?qft(e,c):(e.updateFrameState(),s.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(Xft):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(Kft):l(u.frustum.width)?f=u.frustum.clone(Jft):f=u.frustum.clone(Zft);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let A=this.getPickDepth(e,g).getDepth(o,c.x,c.y);if(l(A)&&A>0&&A<1){let x=d[g],C;return e.mode===ne.SCENE2D?(C=u.position.z,u.position.z=C-x.near+1,f.far=Math.max(1,x.far-x.near),f.near=1,s.update(r),s.updateFrustum(f)):(f.near=x.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=x.far,s.updateFrustum(f)),n=Xi.drawingBufferToWgs84Coordinates(e,c,A,n),e.mode===ne.SCENE2D&&(u.position.z=C,s.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Qft=new he;Oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,Qft);r.cartographicToCartesian(o,n)}return n};function l0e(e,t){let n,i,r=[],o=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){r.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(r.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=An.toValue(!1,i.show),s.push(i))),u instanceof Ts&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,o.push(p)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=An.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return r}Oa.prototype.drillPick=function(e,t,n,i,r){let o=this;return l0e(n,function(){let c=o.pick(e,t,i,r);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var o0e=new m,$ft=new m;function edt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function u0e(e,t,n,i){let r=t.direction,o=m.mostOrthogonalAxis(r,o0e),s=m.cross(r,o,o0e),a=m.cross(r,s,$ft);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=y(n,s0e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function tdt(e,t,n){let i=t.frameState,r=n.ray,o=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=u0e(e,r,o,a),u=Fft;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)tdt(this,e,t[n])&&t.splice(n--,1)};function f0e(e,t,n){let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof bl&&f0e(o,t,n))}}function Kz(e,t,n,i,r,o){let s=[];if(f0e(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new edt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function ndt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function idt(e,t,n,i,r,o,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,u0e(e,n,r,f.camera),Lh=Ke.clone(f.viewport,Lh);let d=f.pickFramebuffer.begin(Lh,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=Uft:u.tilesetPassState=oX,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,sX),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(Lh);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let A=0;A<h;++A){let C=e.getPickDepth(t,A).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let T=f.frustumCommandsList[A],E=T.near*(A!==0?t.opaqueFrustumNearOffset:1),S=T.far,w=E+C*(S-E);p=In.getPoint(n,w);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&o||ndt(g,i)}}function d0e(e,t,n,i,r,o,s,a){return l0e(i,function(){return idt(e,t,n,r,o,s,a)})}function BS(e,t,n,i,r,o,s){let a=d0e(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function m0e(e,t,n,i,r,o,s,a){return d0e(e,t,n,i,r,o,s,a)}function Jz(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Oa.prototype.pickFromRay=function(e,t,n,i){return BS(this,e,t,n,i,!1,!1)};Oa.prototype.drillPickFromRay=function(e,t,n,i,r){return m0e(this,e,t,n,i,r,!1,!1)};Oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=In.clone(t),n=l(n)?n.slice():n,Jz(e,Kz(r,e,t,n,i,function(){return BS(r,e,t,n,i,!1,!0)}))};Oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=In.clone(t),i=l(i)?i.slice():i,Jz(e,Kz(o,e,t,i,r,function(){return m0e(o,e,t,n,i,r,!1,!0)}))};var rdt=new m,odt=new m,sdt=new In,h0e=new he;function aX(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=si._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,odt),s=he.toCartesian(t,i,rdt),a=sdt;a.origin=s,a.direction=o;let c=new In;return In.getPoint(a,r,c.origin),m.negate(o,c.direction),c}function p0e(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=he.fromCartesian(t,i,h0e);return aX(e,r)}function _0e(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return he.fromCartesian(t,i,h0e).height}function adt(e,t,n,i,r){let o=aX(t,n);return Kz(e,t,o,i,r,function(){let s=BS(e,t,o,i,r,!0,!0);if(l(s))return _0e(t,s.position)})}function cdt(e,t,n,i,r,o){let s=p0e(t,n);return Kz(e,t,s,i,r,function(){let a=BS(e,t,s,i,r,!0,!0);if(l(a))return m.clone(a.position,o)})}Oa.prototype.sampleHeight=function(e,t,n,i){let r=aX(e,t),o=BS(this,e,r,n,i,!0,!1);if(l(o))return _0e(e,o.position)};Oa.prototype.clampToHeight=function(e,t,n,i,r){let o=p0e(e,t),s=BS(this,e,o,n,i,!0,!1);if(l(s))return m.clone(s.position,r)};Oa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=adt(this,e,t[s],n,i);return Jz(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Oa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=cdt(this,e,t[s],n,i,t[s]);return Jz(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var aF=Oa;var A0e=vr(u3(),1);var ldt={modifyFragmentShader:function(t){return t=He.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},LS=ldt;var CC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function cF(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=CC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Se.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=B.clone(B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Fc.NONE),this._splittingEnabled=!1,this._error=void 0,udt(this,e)}Object.defineProperties(cF.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function udt(e,t){let n=HA.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=xp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=CC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var fdt=new m,ddt=new m,mdt=new m,g0e,Zz;function hdt(e){if(!l(Zz)){g0e=new A0e.default(0),Zz=new Array(e);for(let t=0;t<e;++t)Zz[t]=g0e.random()}return Zz}function pdt(e){let n=e.length/3,i=Math.min(n,20),r=hdt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(o,o,o,fdt),c=m.fromElements(s,s,s,ddt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=m.unpack(e,d*3,mdt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function y0e(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Rt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var _dt=new oe,gdt=new oe,ydt=new z,x0e=0,Qz=1,dX=2,C0e=3,Adt=4,cX=new B,xdt=new B;function Cdt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,A=e._quantizedRange,x=e._octEncodedRange,C=e._isRGB565,T=e._isTranslucent,E=e._hasColors,S=e._hasNormals,w=e._hasBatchIds,D,R,O=[],L={};if(e._styleableShaderAttributes=L,f){let V=Adt;for(let G in u)if(u.hasOwnProperty(G)){let U=u[G],q=y0e(U.typedArray,G);D=U.componentCount,R=X.fromTypedArray(q);let Y=mt.createVertexBuffer({context:n,typedArray:q,usage:Fe.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let Q={index:V,vertexBuffer:Y,componentsPerAttribute:D,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0};O.push(Q),L[G]={location:V,componentCount:D},++V}}let N=mt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;E&&(_=mt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let b;S&&(b=mt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let v;w&&(c.typedArray=y0e(c.typedArray,"batchIds"),v=mt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?R=X.UNSIGNED_SHORT:p?R=A<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:R=X.FLOAT,I.push({index:x0e,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=pdt(o.typedArray)),E)if(C)I.push({index:Qz,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=T?4:3;I.push({index:Qz,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(D=2,R=X.UNSIGNED_BYTE):h?(D=2,R=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,R=X.FLOAT),I.push({index:dX,vertexBuffer:b,componentsPerAttribute:D,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0})),w&&I.push({index:C0e,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(O));let M=new oi({context:n,attributes:I}),F={depthTest:{enabled:!0}},k={depthTest:{enabled:!0},depthMask:!1,blending:mn.ALPHA_BLEND};e._opaquePass===Se.CESIUM_3D_TILE&&(F.stencilTest=Ft.setCesium3DTileBit(),F.stencilMask=Ft.CESIUM_3D_TILE_MASK,k.stencilTest=Ft.setCesium3DTileBit(),k.stencilMask=Ft.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(F),e._translucentRenderState=ze.fromCache(k),e._drawCommand=new nt({boundingVolume:new ae,cull:e._cull,modelMatrix:new B,primitiveType:Be.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Se.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function Tdt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=_dt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof rn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,ydt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return B.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);B.multiply(n.uniformState.view3D,c,cX);let u=B.multiply(cX,a.modelMatrix,cX);return B.inverseTranspose(u,xdt)}};LS.addUniforms(e,s),(i||r||o)&&(s=gt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=gdt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function lX(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function uX(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function fX(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Edt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function bdt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,A=e._hasNormals,x=e._hasBatchIds,C=e._backFaceCulling,T=e._normalShading,E=e._drawCommand.vertexArray,S=e.clippingPlanes,w=e._attenuation,D,R,O,L=g,N=Ye(Edt),_={},b=e._styleableShaderAttributes;for(r in b)b.hasOwnProperty(r)&&(o=b[r],N[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let se={translucent:!1},_e="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${_e}`,N,se),R=n.getShowShaderFunction(`getShowFromStyle${_e}`,N,se),O=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,N,se),l(D)&&se.translucent&&(L=!0)}e._styleTranslucent=L;let v=l(D),I=l(R),M=l(O),F=e.isClipped,k=[],V=[];v&&(lX(D,k),uX(D,V)),I&&(lX(R,k),uX(R,V)),M&&(lX(O,k),uX(O,V));let G=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!A)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(r in b)if(b.hasOwnProperty(r)){o=b[r];let se=k.indexOf(o.location)>=0,_e=fX(E,o.location);_e.enabled=se}let q=h&&(!v||G);if(h){let se=fX(E,Qz);se.enabled=q}let Y=A&&(T||C||U);if(A){let se=fX(E,dX);se.enabled=Y}let Q={a_position:x0e};q&&(Q.a_color=Qz),Y&&(Q.a_normal=dX),x&&(Q.a_batchId=C0e);let W="",K=k.length;for(i=0;i<K;++i){let se=k[i];o=_[se];let _e=o.componentCount,xe=`czm_3dtiles_property_${se}`,De;_e===1?De="float":De=`vec${_e}`,W+=`in ${De} ${xe}; -`,Q[xe]=o.location}Tdt(e,t);let J=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;J+=`float u_pointSize; -float tiles3d_tileset_time; -`,w&&(J+=`float u_geometricError; -float u_depthMultiplier; -`),J+=W,q&&(g?J+=`in vec4 a_color; -`:p?J+=`in float a_color; -const float SHIFT_RIGHT_11 = 1.0 / 2048.0; -const float SHIFT_RIGHT_5 = 1.0 / 32.0; -const float SHIFT_LEFT_11 = 2048.0; -const float SHIFT_LEFT_5 = 32.0; -const float NORMALIZE_6 = 1.0 / 64.0; -const float NORMALIZE_5 = 1.0 / 32.0; -`:J+=`in vec3 a_color; -`),Y&&(f||d?J+=`in vec2 a_normal; -`:J+=`in vec3 a_normal; -`),x&&(J+=`in float a_batchId; -`),(c||u||d)&&(J+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),v&&(J+=D),I&&(J+=R),M&&(J+=O),J+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,w&&(J+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),q?g?J+=` vec4 color = a_color; -`:p?J+=` float compressed = a_color; - float r = floor(compressed * SHIFT_RIGHT_11); - compressed -= r * SHIFT_LEFT_11; - float g = floor(compressed * SHIFT_RIGHT_5); - compressed -= g * SHIFT_LEFT_5; - float b = compressed; - vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); - vec4 color = vec4(rgb, 1.0); -`:J+=` vec4 color = vec4(a_color, 1.0); -`:J+=` vec4 color = u_constantColor; -`,c||u?J+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:J+=` vec3 position = a_position; -`,J+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,Y?(f?J+=` vec3 normal = czm_octDecode(a_normal); -`:d?J+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:J+=` vec3 normal = a_normal; -`,J+=` vec3 normalEC = czm_normal * normal; -`):J+=` vec3 normal = vec3(1.0); -`,v&&(J+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(J+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),M?J+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:w?J+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:J+=` gl_PointSize = u_pointSize; -`,J+=` color = color * u_highlightColor; -`,Y&&T&&(J+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),J+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,Y&&C&&(J+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(J+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),J+=`} -`;let me=`in vec4 v_color; -`;F&&(me+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,me+=` -`,me+=R_(S,s),me+=` -`),me+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,F&&(me+=TN("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} -`,e.splitDirection!==Fc.NONE&&(me=LS.modifyFragmentShader(me)),l(e._vertexShaderLoaded)&&(J=e._vertexShaderLoaded(J)),l(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let ye=e._drawCommand;l(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=Zt.fromCache({context:s,vertexShaderSource:J,fragmentShaderSource:me,attributeLocations:Q});try{ye.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Sdt(e,t){if(e._decodingState===CC.READY)return!1;if(e._decodingState===CC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Dp.decodePointCloud(i,t);l(r)&&(e._decodingState=CC.DECODING,r.then(function(o){e._decodingState=CC.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let x=o.POSITION.data.quantization,C=x.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let x in h)if(h.hasOwnProperty(x)){let C=o[x];l(g)||(g={}),g[x]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let A=y(c,a);l(A)&&(n.colors={typedArray:A}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=CC.FAILED,e._error=o}))}return!0}var vdt=new oe,wdt=new m;cF.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(Sdt(this,t))return;let i=!1,r=!B.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(Cdt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){B.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(B.clone(this._modelMatrix,u),l(this._rtcCenter)&&B.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&B.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=B.getColumn(u,3,vdt);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;B.multiplyByPoint(u,d,d);let p=B.getScale(u,wdt);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==Fc.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&bdt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Se.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};cF.prototype.isDestroyed=function(){return!1};cF.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var lF=cF;var Ddt={NEAREST:0,LINEAR:1},Fu=Ddt;function TC(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,at.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,Fu.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Ze.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new Ga;r.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=r,this._ready=!1;let o=e.name;l(o)||(o=Wn()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(TC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Idt=/uniform\s+sampler2D\s+depthTexture/g;TC.prototype._isSupported=function(e){return!Idt.test(this._fragmentShader)||e.depthTexture};function Pdt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Bt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Bt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function Odt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Rdt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Mdt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i)if(i.hasOwnProperty(o)){typeof i[o]!="function"?(t[o]=Odt(e,o),n[o]=Pdt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Bt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=Rdt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=gt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Bdt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE -uniform sampler2D czm_idTexture; -uniform sampler2D czm_selectedIdTexture; -uniform float czm_selectedIdTextureStep; -in vec2 v_textureCoordinates; -bool czm_selected(vec2 offset) -{ - bool selected = false; - vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); - for (int i = 0; i < ${r}; ++i) - { - vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); - if (all(equal(id, selectedId))) - { - return true; - } - } - return false; -} - -bool czm_selected() -{ - return czm_selected(vec2(0.0)); -} - -${n}`}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Ldt(e){let t=e._sampleMode,n,i;t===Fu.LINEAR?(n=un.LINEAR,i=xi.LINEAR):(n=un.NEAREST,i=xi.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new dn({wrapS:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Ndt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Fdt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Udt(e,t){let n,i,r,o=e._texturesToRelease,s=o.length;for(n=0;n<s;++n)i=o[n],i=i&&i.destroy();o.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];r=d.name;let p=d.source;e._actualUniforms[r]=new Bt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){r=c[n];let d=u[r],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[r]=Fdt(e,d);else if(typeof d=="string"){let g=new ve({url:d});f.push(g.fetchImage().then(Ndt(e,r)))}else e._texturesToCreate.push({name:r,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function T0e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i)i.hasOwnProperty(r)&&i[r]instanceof Bt&&(l(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}function Vdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function kdt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,r,o=0,s=n.length;for(i=0;i<s;++i)r=n[i],l(r.pickIds)?o+=r.pickIds.length:l(r.pickId)&&++o;if(s===0||o===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Bt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:dn.NEAREST});return}let a,c=0,u=new Uint8Array(o*4);for(i=0;i<s;++i)if(r=n[i],l(r.pickIds)){let f=r.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(r.pickId)&&(a=r.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Bt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,source:{arrayBufferView:u,width:o,height:1},sampler:dn.NEAREST})}TC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&T0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Vdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,kdt(this,e),Mdt(this),Udt(this,e),Bdt(this,e),Ldt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=r};TC.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,dn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){return T0e(this),ue(this)};var _r=TC;var uF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; - -#ifdef AUTO_EXPOSURE - color /= texture(autoExposure, vec2(0.5)).r; -#endif - color = czm_acesTonemapping(color); - color = czm_inverseGamma(color); - - out_FragColor = vec4(color, fragmentColor.a); -} -`;var fF=`uniform sampler2D randomTexture; -uniform sampler2D depthTexture; -uniform float intensity; -uniform float bias; -uniform float lengthCap; -uniform float stepSize; -uniform float frustumLength; - -in vec2 v_textureCoordinates; - -vec4 clipToEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); - posEC = posEC / posEC.w; - return posEC; -} - -//Reconstruct Normal Without Edge Removation -vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) -{ - vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); - vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); - vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); - vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); - - vec3 up = posInCamera.xyz - posInCameraUp.xyz; - vec3 down = posInCameraDown.xyz - posInCamera.xyz; - vec3 left = posInCamera.xyz - posInCameraLeft.xyz; - vec3 right = posInCameraRight.xyz - posInCamera.xyz; - - vec3 DX = length(left) < length(right) ? left : right; - vec3 DY = length(up) < length(down) ? up : down; - - return normalize(cross(DY, DX)); -} - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = clipToEye(v_textureCoordinates, depth); - - if (posInCamera.z > frustumLength) - { - out_FragColor = vec4(1.0); - return; - } - - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); - float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); - float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); - float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); - vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); - - float ao = 0.0; - vec2 sampleDirection = vec2(1.0, 0.0); - float gapAngle = 90.0 * czm_radiansPerDegree; - - // RandomNoise - float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; - - //Loop for each direction - for (int i = 0; i < 4; i++) - { - float newGapAngle = gapAngle * (float(i) + randomVal); - float cosVal = cos(newGapAngle); - float sinVal = sin(newGapAngle); - - //Rotate Sampling Direction - vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); - float localAO = 0.0; - float localStepSize = stepSize; - - //Loop for each step - for (int j = 0; j < 6; j++) - { - vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; - - //Exception Handling - if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) - { - break; - } - - float stepDepthInfo = czm_readDepth(depthTexture, newCoords); - vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); - vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; - float len = length(diffVec); - - if (len > lengthCap) - { - break; - } - - float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); - float weight = len / lengthCap; - weight = 1.0 - weight * weight; - - if (dotVal < bias) - { - dotVal = 0.0; - } - - localAO = max(localAO, dotVal * weight); - localStepSize += stepSize; - } - ao += localAO; - } - - ao /= 4.0; - ao = 1.0 - clamp(ao, 0.0, 1.0); - ao = pow(ao, intensity); - out_FragColor = vec4(vec3(ao), 1.0); -} -`;var dF=`uniform sampler2D colorTexture; -uniform sampler2D ambientOcclusionTexture; -uniform bool ambientOcclusionOnly; -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); - out_FragColor = ambientOcclusionOnly ? ao : ao * color; -} -`;var mF=`uniform sampler2D colorTexture; -uniform float gradations; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = vec4(rgb, 1.0); - return; - } -#endif - float luminance = czm_luminance(rgb); - float darkness = luminance * gradations; - darkness = (darkness - fract(darkness)) / gradations; - out_FragColor = vec4(vec3(darkness), 1.0); -} -`;var hF=`uniform sampler2D colorTexture; -uniform sampler2D bloomTexture; -uniform bool glowOnly; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = color; - return; - } -#endif - - vec4 bloom = texture(bloomTexture, v_textureCoordinates); - out_FragColor = glowOnly ? bloom : bloom + color; -} -`;var pF=`uniform sampler2D colorTexture; -uniform float brightness; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 target = vec3(0.0); - out_FragColor = vec4(mix(target, rgb, brightness), 1.0); -} -`;var _F=`uniform sampler2D colorTexture; -uniform float contrast; -uniform float brightness; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; - sceneColor = czm_RGBToHSB(sceneColor); - sceneColor.z += brightness; - sceneColor = czm_HSBToRGB(sceneColor); - - float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); - sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); - out_FragColor = vec4(sceneColor, 1.0); -} -`;var gF=`uniform sampler2D colorTexture; -uniform sampler2D blurTexture; -uniform sampler2D depthTexture; -uniform float focalDistance; - -in vec2 v_textureCoordinates; - -vec4 toEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); - posInCamera = posInCamera / posInCamera.w; - return posInCamera; -} - -float computeDepthBlur(float depth) -{ - float f; - if (depth < focalDistance) - { - f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); - } - else - { - f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); - f = pow(f, 0.1); - } - f *= f; - f = clamp(f, 0.0, 1.0); - return pow(f, 0.5); -} - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = toEye(v_textureCoordinates, depth); - float d = computeDepthBlur(-posInCamera.z); - out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); -} -`;var yF=`uniform sampler2D depthTexture; - -in vec2 v_textureCoordinates; - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - out_FragColor = vec4(vec3(depth), 1.0); -} -`;var AF=`uniform sampler2D depthTexture; -uniform float length; -uniform vec4 color; - -in vec2 v_textureCoordinates; - -void main(void) -{ - float directions[3]; - directions[0] = -1.0; - directions[1] = 0.0; - directions[2] = 1.0; - - float scalars[3]; - scalars[0] = 3.0; - scalars[1] = 10.0; - scalars[2] = 3.0; - - float padx = czm_pixelRatio / czm_viewport.z; - float pady = czm_pixelRatio / czm_viewport.w; - -#ifdef CZM_SELECTED_FEATURE - bool selected = false; - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - selected = selected || czm_selected(vec2(-padx, dir * pady)); - selected = selected || czm_selected(vec2(padx, dir * pady)); - selected = selected || czm_selected(vec2(dir * padx, -pady)); - selected = selected || czm_selected(vec2(dir * padx, pady)); - if (selected) - { - break; - } - } - if (!selected) - { - out_FragColor = vec4(color.rgb, 0.0); - return; - } -#endif - - float horizEdge = 0.0; - float vertEdge = 0.0; - - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - float scale = scalars[i]; - - horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; - horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; - - vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; - vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; - } - - float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); - out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); -} -`;var xF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See slides 142 and 143: -// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; - -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - - const float A = 0.22; // shoulder strength - const float B = 0.30; // linear strength - const float C = 0.10; // linear angle - const float D = 0.20; // toe strength - const float E = 0.01; // toe numerator - const float F = 0.30; // toe denominator - - const float white = 11.2; // linear white point value - - vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; - float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; - - c = czm_inverseGamma(c / w); - out_FragColor = vec4(c, fragmentColor.a); -} -`;var CF=`in vec2 v_textureCoordinates; - -uniform sampler2D colorTexture; - -const float fxaaQualitySubpix = 0.5; -const float fxaaQualityEdgeThreshold = 0.125; -const float fxaaQualityEdgeThresholdMin = 0.0833; - -void main() -{ - vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; - vec4 color = FxaaPixelShader( - v_textureCoordinates, - colorTexture, - fxaaQualityRcpFrame, - fxaaQualitySubpix, - fxaaQualityEdgeThreshold, - fxaaQualityEdgeThresholdMin); - float alpha = texture(colorTexture, v_textureCoordinates).a; - out_FragColor = vec4(color.rgb, alpha); -} -`;var s0=`#define SAMPLES 8 - -uniform float delta; -uniform float sigma; -uniform float direction; // 0.0 for x direction, 1.0 for y direction - -uniform sampler2D colorTexture; - -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif - -in vec2 v_textureCoordinates; - -// Incremental Computation of the Gaussian: -// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html - -void main() -{ - vec2 st = v_textureCoordinates; - vec2 dir = vec2(1.0 - direction, direction); - -#ifdef USE_STEP_SIZE - vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); -#else - vec2 step = step; -#endif - - vec3 g; - g.x = 1.0 / (sqrt(czm_twoPi) * sigma); - g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); - g.z = g.y * g.y; - - vec4 result = texture(colorTexture, st) * g.x; - for (int i = 1; i < SAMPLES; ++i) - { - g.xy *= g.yz; - - vec2 offset = float(i) * dir * step; - result += texture(colorTexture, st - offset) * g.x; - result += texture(colorTexture, st + offset) * g.x; - } - - out_FragColor = result; -} -`;var TF=`uniform sampler2D colorTexture; -uniform sampler2D dirtTexture; -uniform sampler2D starTexture; -uniform vec2 dirtTextureDimensions; -uniform float distortion; -uniform float ghostDispersal; -uniform float haloWidth; -uniform float dirtAmount; -uniform float earthRadius; -uniform float intensity; - -in vec2 v_textureCoordinates; - -// whether it is in space or not -// 6500000.0 is empirical value -#define DISTANCE_TO_SPACE 6500000.0 - -// return ndc from world coordinate biased earthRadius -vec4 getNDCFromWC(vec3 WC, float earthRadius) -{ - vec4 positionEC = czm_view * vec4(WC, 1.0); - positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); -} - -// Check if current pixel is included Earth -// if then mask it gradually -float isInEarth(vec2 texcoord, vec2 sceneSize) -{ - vec2 NDC = texcoord * 2.0 - 1.0; - vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); - vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); - NDC.xy -= earthPosSC.xy; - - float X = abs(NDC.x) * sceneSize.x; - float Y = abs(NDC.y) * sceneSize.y; - - return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); -} - -// For Chromatic effect -vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) -{ - vec2 sceneSize = czm_viewport.zw; - vec3 color; - if(isSpace) - { - color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; - color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; - color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; - } - else - { - color.r = texture(tex, texcoord + direction * distortion.r).r; - color.g = texture(tex, texcoord + direction * distortion.g).g; - color.b = texture(tex, texcoord + direction * distortion.b).b; - } - return vec4(clamp(color, 0.0, 1.0), 0.0); -} - -void main(void) -{ - vec4 originalColor = texture(colorTexture, v_textureCoordinates); - vec3 rgb = originalColor.rgb; - bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; - - // Sun position - vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); - vec4 sunPositionEC = czm_view * sunPos; - vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); - sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); - - // If sun is not in the screen space, use original color. - if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) - { - // Lens flare is disabled when not in space until #5932 is fixed. - // https://github.com/CesiumGS/cesium/issues/5932 - out_FragColor = originalColor; - return; - } - - vec2 texcoord = vec2(1.0) - v_textureCoordinates; - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - vec2 invPixelSize = 1.0 / pixelSize; - vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); - - // ghost vector to image centre: - vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; - vec3 direction = normalize(vec3(ghostVec, 0.0)); - - // sample ghosts: - vec4 result = vec4(0.0); - vec4 ghost = vec4(0.0); - for (int i = 0; i < 4; ++i) - { - vec2 offset = fract(texcoord + ghostVec * float(i)); - // Only bright spots from the centre of the source image - ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); - } - result += ghost; - - // sample halo - vec2 haloVec = normalize(ghostVec) * haloWidth; - float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); - weightForHalo = pow(1.0 - weightForHalo, 5.0); - - result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; - - // dirt on lens - vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; - if (dirtTexCoords.x > 1.0) - { - dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); - } - if (dirtTexCoords.y > 1.0) - { - dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); - } - result += dirtAmount * texture(dirtTexture, dirtTexCoords); - - // Rotating starburst texture's coordinate - // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) - float camrot = czm_view[0].z + czm_view[1].y; - float cosValue = cos(camrot); - float sinValue = sin(camrot); - mat3 rotation = mat3( - cosValue, -sinValue, 0.0, - sinValue, cosValue, 0.0, - 0.0, 0.0, 1.0 - ); - - vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); - vec3 st2 = vec3((rotation * st1).xy, 1.0); - vec3 st3 = st2 * 0.5 + vec3(0.5); - vec2 lensStarTexcoord = st3.xy; - float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); - float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); - - if (!isSpace) - { - result *= oneMinusWeightForLensFlare * intensity * 0.2; - } - else - { - result *= oneMinusWeightForLensFlare * intensity; - result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; - } - - result += texture(colorTexture, v_textureCoordinates); - - out_FragColor = result; -} -`;var EF=`uniform sampler2D colorTexture; -uniform vec3 white; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See equation 4: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = (color * (1.0 + color / white)) / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var bF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 green = vec3(0.0, 1.0, 0.0); - out_FragColor = vec4((noiseValue + rgb) * green, 1.0); -} -`;var SF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See equation 3: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = color / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var vF=`uniform sampler2D colorTexture; -uniform sampler2D silhouetteTexture; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); - vec4 color = texture(colorTexture, v_textureCoordinates); - out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); -} -`;/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var wF=`/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples -// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - -// Steps used to integrate into Cesium: -// * The following defines are set: -// #define FXAA_PC 1 -// #define FXAA_WEBGL_1 1 -// #define FXAA_GREEN_AS_LUMA 1 -// #define FXAA_EARLY_EXIT 1 -// #define FXAA_GLSL_120 1 -// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. -// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace -// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. -// * There are no implicit conversions from ivec* to vec* so replace: -// #define FxaaInt2 ivec2 -// with -// #define FxaaInt2 vec2 -// * The texture2DLod function is only available in vertex shaders so replace: -// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) -// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) -// with -// #define FxaaTexTop(t, p) texture(t, p) -// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. -// * The following parameters to FxaaPixelShader are unused and can be removed: -// fxaaConsolePosPos -// fxaaConsoleRcpFrameOpt -// fxaaConsoleRcpFrameOpt2 -// fxaaConsole360RcpFrameOpt2 -// fxaaConsoleEdgeSharpness -// fxaaConsoleEdgeThreshold -// fxaaConsoleEdgeThresholdMi -// fxaaConsole360ConstDir - -// -// Choose the quality preset. -// This needs to be compiled into the shader as it effects code. -// Best option to include multiple presets is to -// in each shader define the preset, then include this file. -// -// OPTIONS -// ----------------------------------------------------------------------- -// 10 to 15 - default medium dither (10=fastest, 15=highest quality) -// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) -// 39 - no dither, very expensive -// -// NOTES -// ----------------------------------------------------------------------- -// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) -// 13 = about same speed as FXAA 3.9 and better than 12 -// 23 = closest to FXAA 3.9 visually and performance wise -// _ = the lowest digit is directly related to performance -// _ = the highest digit is directly related to style -// -//#define FXAA_QUALITY_PRESET 12 - - -#if (FXAA_QUALITY_PRESET == 10) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 3.0 - #define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 3.0 - #define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 4.0 - #define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 4.0 - #define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 4.0 - #define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 2.0 - #define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 3.0 - #define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) - #define FXAA_QUALITY_PS 9 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 4.0 - #define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) - #define FXAA_QUALITY_PS 10 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 4.0 - #define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) - #define FXAA_QUALITY_PS 11 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 4.0 - #define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.0 - #define FXAA_QUALITY_P2 1.0 - #define FXAA_QUALITY_P3 1.0 - #define FXAA_QUALITY_P4 1.0 - #define FXAA_QUALITY_P5 1.5 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif - -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D - -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - -FxaaFloat4 FxaaPixelShader( - // - // Use noperspective interpolation here (turn off perspective interpolation). - // {xy} = center of pixel - FxaaFloat2 pos, - // - // Input color texture. - // {rgb_} = color in linear or perceptual color space - // if (FXAA_GREEN_AS_LUMA == 0) - // {___a} = luma in perceptual color space (not linear) - FxaaTex tex, + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, // // Only used on FXAA Quality. // This must be from a constant/uniform. @@ -14627,449 +10265,4773 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; /*--------------------------------------------------------------------------*/ } - #endif -/*--------------------------------------------------------------------------*/ + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;var PN=`uniform vec4 u_initialColor; + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP +uniform sampler2D u_mars_clip_area; +uniform bool u_mars_clip_enabled; +uniform bool u_mars_clip_only; +uniform mat4 u_mars_clip_inverMatrix; +uniform vec4 u_mars_clip_rect; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +#if TEXTURE_UNITS > 0 +uniform sampler2D u_dayTextures[TEXTURE_UNITS]; +uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; +uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; + +#ifdef APPLY_ALPHA +uniform float u_dayTextureAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_DAY_NIGHT_ALPHA +uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; +uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_CONTRAST +uniform float u_dayTextureContrast[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_HUE +uniform float u_dayTextureHue[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SATURATION +uniform float u_dayTextureSaturation[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D +uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D +uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; +#endif + +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN +uniform sampler2D u_waterMask; +uniform vec4 u_waterMaskTranslationAndScale; +uniform float u_zoomedOutOceanSpecularIntensity; +#endif + +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; +#endif + +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; +#endif + +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; +#endif + +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; +#endif + +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; // Hue, saturation, brightness +#endif + +#ifdef HIGHLIGHT_FILL_TILE +uniform vec4 u_fillHighlightColor; +#endif + +#ifdef TRANSLUCENT +uniform vec4 u_frontFaceAlphaByDistance; +uniform vec4 u_backFaceAlphaByDistance; +uniform vec4 u_translucencyRectangle; +#endif + +#ifdef UNDERGROUND_COLOR +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; +#endif + +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; +#endif + +in vec3 v_positionMC; +in vec3 v_positionEC; +in vec3 v_textureCoordinates; +in vec3 v_normalMC; +in vec3 v_normalEC; + +#ifdef APPLY_MATERIAL +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +uniform bool u_mars_flood_globe; + +uniform sampler2D u_mars_flood_area; +uniform bool u_mars_flood_emabled; +uniform bool u_showFloodOnly; +uniform mat4 u_mars_flood_inverMatrix; +uniform vec4 u_mars_flood_rect; +uniform bool u_mars_flood_showElse; +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +in float v_height; +in float v_slope; +in float v_aspect; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +in float v_distance; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +in vec3 v_atmosphereRayleighColor; +in vec3 v_atmosphereMieColor; +in float v_atmosphereOpacity; +#endif + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT +uniform int u_mars_uplift_RectangleWidth; +uniform int u_mars_uplift_RectangleHeight; +uniform highp sampler2D u_mars_uplift_RampRectangle; +uniform float u_mars_inverseTileWidth; +uniform vec2 u_mars_cartographicTileRectangle; +uniform bool u_mars_uplift_enabled; +uniform bool u_mars_uplift_hideInsideOrOutside; + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); + float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); + vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, 0.0); +} + +bool inSlopeRampRectangle() { + for(int h = 0; h < 100000; h++) { + if(h >= u_mars_uplift_RectangleWidth) + break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++) { + if(float(w) >= currentLength) + break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { + if(v_textureCoordinates.y <= max(p1.y, p2.y)) { + if(p1.x != p2.x) { + xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { + counter += 1.0; + } + } + } + } + + } + if((mod(counter, 2.0) != 0.0)) { + return true; + } + } + + return false; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} +#endif + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +{ + return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); +} +#endif + +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() +{ + return + v_textureCoordinates.x > u_translucencyRectangle.x && + v_textureCoordinates.x < u_translucencyRectangle.z && + v_textureCoordinates.y > u_translucencyRectangle.y && + v_textureCoordinates.y < u_translucencyRectangle.w; +} +#endif + +vec4 sampleAndBlend( + vec4 previousColor, + sampler2D textureToSample, + vec2 tileTextureCoordinates, + vec4 textureCoordinateRectangle, + vec4 textureCoordinateTranslationAndScale, + float textureAlpha, + float textureNightAlpha, + float textureDayAlpha, + float textureBrightness, + float textureContrast, + float textureHue, + float textureSaturation, + float textureOneOverGamma, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + bool textureInvertColor, + vec3 texturefilterColor, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + float split, + vec4 colorToAlpha, + float nightBlend) +{ + // This crazy step stuff sets the alpha to 0.0 if this following condition is true: + // tileTextureCoordinates.s < textureCoordinateRectangle.s || + // tileTextureCoordinates.s > textureCoordinateRectangle.p || + // tileTextureCoordinates.t < textureCoordinateRectangle.t || + // tileTextureCoordinates.t > textureCoordinateRectangle.q + // In other words, the alpha is zero if the fragment is outside the rectangle + // covered by this texture. Would an actual 'if' yield better performance? + vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + + alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); +#endif + + vec2 translation = textureCoordinateTranslationAndScale.xy; + vec2 scale = textureCoordinateTranslationAndScale.zw; + vec2 textureCoordinates = tileTextureCoordinates * scale + translation; + vec4 value = texture(textureToSample, textureCoordinates); + vec3 color = value.rgb; + float alpha = value.a; + +#ifdef APPLY_COLOR_TO_ALPHA + vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); + colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); + alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); +#endif + +#if !defined(APPLY_GAMMA) + vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); + color = tempColor.rgb; + alpha = tempColor.a; +#else + color = pow(color, vec3(textureOneOverGamma)); +#endif + +#ifdef APPLY_SPLIT + float splitPosition = czm_splitPosition; + // Split to the left + if (split < 0.0 && gl_FragCoord.x > splitPosition) { + alpha = 0.0; + } + // Split to the right + else if (split > 0.0 && gl_FragCoord.x < splitPosition) { + alpha = 0.0; + } +#endif + +#ifdef APPLY_BRIGHTNESS + color = mix(vec3(0.0), color, textureBrightness); +#endif + +#ifdef APPLY_CONTRAST + color = mix(vec3(0.5), color, textureContrast); +#endif + +#ifdef APPLY_HUE + color = czm_hue(color, textureHue); +#endif + +#ifdef APPLY_SATURATION + color = czm_saturation(color, textureSaturation); +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D + if(textureInvertColor) { + color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); + } +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D + if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { + color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + + float sourceAlpha = alpha * textureAlpha; + float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); + outAlpha += sign(outAlpha) - 1.0; + + vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; + + // When rendering imagery for a tile in multiple passes, + // some GPU/WebGL implementation combinations will not blend fragments in + // additional passes correctly if their computation includes an unmasked + // divide-by-zero operation, + // even if it's not in the output or if the output has alpha zero. + // + // For example, without sanitization for outAlpha, + // this renders without artifacts: + // if (outAlpha == 0.0) { outColor = vec3(0.0); } + // + // but using czm_branchFreeTernary will cause portions of the tile that are + // alpha-zero in the additional pass to render as black instead of blending + // with the previous pass: + // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); + // + // So instead, sanitize against divide-by-zero, + // store this state on the sign of outAlpha, and correct on return. + + return vec4(outColor, max(outAlpha, 0.0)); +} + +vec3 colorCorrect(vec3 rgb) { +#ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + rgb = czm_HSBToRGB(hsb); +#endif + return rgb; +} + +vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); + +const float fExposure = 2.0; + +vec3 computeEllipsoidPosition() +{ + float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); + vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); + xy *= czm_viewport.zw * mpp * 0.5; + + vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); + czm_ray ray = czm_ray(vec3(0.0), direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + + vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); + return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; +} + +void main() +{ +#ifdef TILE_LIMIT_RECTANGLE + if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || + v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) + { + discard; + } +#endif + +#ifdef ENABLE_CLIPPING_PLANES + float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); +#endif + +#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) + vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates + vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes +#endif + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); +#else + float nightBlend = 0.0; +#endif + + // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 + // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the + // fragments on the edges of tiles even though the vertex shader is outputting + // coordinates strictly in the 0-1 range. + vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); + +#ifdef SHOW_TILE_BOUNDARIES + if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || + v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) + { + color = vec4(1.0, 0.0, 0.0, 1.0); + } +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) + float cameraDist; + if (czm_sceneMode == czm_sceneMode2D) + { + cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; + } + else if (czm_sceneMode == czm_sceneModeColumbusView) + { + cameraDist = -czm_view[3].z; + } + else + { + cameraDist = length(czm_view[3]); + } + float fadeOutDist = u_lightingFadeDistance.x; + float fadeInDist = u_lightingFadeDistance.y; + if (czm_sceneMode != czm_sceneMode3D) { + vec3 radii = czm_ellipsoidRadii; + float maxRadii = max(radii.x, max(radii.y, radii.z)); + fadeOutDist -= maxRadii; + fadeInDist -= maxRadii; + } + float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else + float fade = 0.0; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN + vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; + vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; + vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; + waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; + + float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; + + if (mask > 0.0) + { + mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); + + vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); + vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); + + vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); + + color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); + } +#endif + +#ifdef APPLY_MATERIAL + czm_materialInput materialInput; + materialInput.st = v_textureCoordinates.st; + materialInput.normalEC = normalize(v_normalEC); + materialInput.positionToEyeEC = -v_positionEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); + materialInput.slope = v_slope; + materialInput.height = v_height; + materialInput.aspect = v_aspect; + czm_material material = czm_getMaterial(materialInput); + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 + + vec4 materialColor = vec4(material.diffuse, material.alpha); + if(u_mars_flood_emabled) { + if(u_mars_flood_globe) { + vec4 materialColor = vec4(material.diffuse, material.alpha); + color = alphaBlend(materialColor, color); + } else { + vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); + vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; + vec4 ymColor = texture(u_mars_flood_area, newuv); + if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { + color.xyz = mix(color.xyz, material.diffuse, material.alpha); + } else { + if(!u_mars_flood_showElse) { + discard; + } + } + } + } + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#endif + +#ifdef ENABLE_VERTEX_LIGHTING + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#elif defined(ENABLE_DAYNIGHT_SHADING) + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); + diffuseIntensity = mix(1.0, diffuseIntensity, fade); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#else + vec4 finalColor = color; +#endif + +#ifdef ENABLE_CLIPPING_PLANES + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; + + if (clipDistance < clippingPlanesEdgeWidth) + { + finalColor = clippingPlanesEdgeColor; + } +#endif + +#ifdef HIGHLIGHT_FILL_TILE + finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +#endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) + if (!czm_backFacing()) + { + bool dynamicLighting = false; + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + + vec3 rayleighColor; + vec3 mieColor; + float opacity; + + vec3 positionWC; + vec3 lightDirection; + + // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. + // Otherwise, the scattering is computed in the vertex shader. + #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE + positionWC = computeEllipsoidPosition(); + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + computeAtmosphereScattering( + positionWC, + lightDirection, + rayleighColor, + mieColor, + opacity + ); + #else + positionWC = v_positionMC; + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + rayleighColor = v_atmosphereRayleighColor; + mieColor = v_atmosphereMieColor; + opacity = v_atmosphereOpacity; + #endif + + rayleighColor = colorCorrect(rayleighColor); + mieColor = colorCorrect(mieColor); + + vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + + // Fog is applied to tiles selected for fog, close to the Earth. + #ifdef FOG + vec3 fogColor = groundAtmosphereColor.rgb; + + // If there is lighting, apply that to the fog. + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); + fogColor *= darken; + #endif + + #ifndef HDR + fogColor.rgb = czm_acesTonemapping(fogColor.rgb); + fogColor.rgb = czm_inverseGamma(fogColor.rgb); + #endif + + const float modifier = 0.15; + finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); + + #else + // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. + // This value is larger near the "circumference", as it is further away from the camera. We use it to + // brighten up that area of the ground atmosphere. + const float transmittanceModifier = 0.5; + float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); + + vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float fadeInDist = u_nightFadeDistance.x; + float fadeOutDist = u_nightFadeDistance.y; + + float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); + float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); + vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); + + finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); + #endif + + #ifndef HDR + finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); + #else + finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); + #endif + + finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); + #endif + } +#endif + +#ifdef UNDERGROUND_COLOR + if (czm_backFacing()) + { + float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); + float distance = max(v_distance - distanceFromEllipsoid, 0.0); + float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); + vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); + finalColor = alphaBlend(undergroundColor, finalColor); + } +#endif + +#ifdef TRANSLUCENT + if (inTranslucencyRectangle()) + { + vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; + finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); + } +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP + if(u_mars_clip_enabled) { + vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); + vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; + vec4 tColor = texture(u_mars_clip_area, tuv); + if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { + if(u_mars_clip_only) { + discard; + } + } else { + if(!u_mars_clip_only) { + discard; + } + } + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT + if(u_mars_uplift_enabled) { + bool isInSlopeRampRectangle = inSlopeRampRectangle(); + if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { + discard; + } + } +#endif + + out_FragColor = finalColor; +} + + +#ifdef SHOW_REFLECTIVE_OCEAN + +float waveFade(float edge0, float edge1, float x) +{ + float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return pow(1.0 - y, 5.0); +} + +float linearFade(float edge0, float edge1, float x) +{ + return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} + +// Based on water rendering by Jonas Wagner: +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +// low altitude wave settings +const float oceanFrequencyLowAltitude = 825000.0; +const float oceanAnimationSpeedLowAltitude = 0.004; +const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; +const float oceanSpecularIntensity = 0.5; + +// high altitude wave settings +const float oceanFrequencyHighAltitude = 125000.0; +const float oceanAnimationSpeedHighAltitude = 0.008; +const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; + +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) +{ + vec3 positionToEyeEC = -positionEyeCoordinates; + float positionToEyeECLength = length(positionToEyeEC); + + // The double normalize below works around a bug in Firefox on Android devices. + vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); + + // Fade out the waves as the camera moves far from the surface. + float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); + +#ifdef SHOW_OCEAN_WAVES + // high altitude waves + float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; + vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); + vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); + + // low altitude waves + time = czm_frameNumber * oceanAnimationSpeedLowAltitude; + noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); + vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); + + // blend the 2 wave layers based on distance to surface + float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); + float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); + vec3 normalTangentSpace = + (highAltitudeFade * normalTangentSpaceHighAltitude) + + (lowAltitudeFade * normalTangentSpaceLowAltitude); + normalTangentSpace = normalize(normalTangentSpace); + + // fade out the normal perturbation as we move farther from the water surface + normalTangentSpace.xy *= waveIntensity; + normalTangentSpace = normalize(normalTangentSpace); +#else + vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); +#endif + + vec3 normalEC = enuToEye * normalTangentSpace; + + const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); + + // Use diffuse light to highlight the waves + float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; + vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); + +#ifdef SHOW_OCEAN_WAVES + // Where diffuse light is low or non-existent, use wave highlights based solely on + // the wave bumpiness and no particular light direction. + float tsPerturbationRatio = normalTangentSpace.z; + vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); +#else + vec3 nonDiffuseHighlight = vec3(0.0); +#endif + + // Add specular highlights in 3D, and in all modes when zoomed in. + float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); + float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); + float specular = specularIntensity * surfaceReflectance; + +#ifdef HDR + specular *= 1.4; + + float e = 0.2; + float d = 3.3; + float c = 1.7; + + vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); +#else + vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; +#endif + + return vec4(color, imageryColor.a); +} + +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var ON=`#ifdef QUANTIZATION_BITS12 +in vec4 compressed0; +in float compressed1; +#else +in vec4 position3DAndHeight; +in vec4 textureCoordAndEncodedNormals; +#endif + +#ifdef GEODETIC_SURFACE_NORMALS +in vec3 geodeticSurfaceNormal; +#endif + +#ifdef EXAGGERATION +uniform vec2 u_terrainExaggerationAndRelativeHeight; +#endif + +uniform vec3 u_center3D; +uniform mat4 u_modifiedModelView; +uniform mat4 u_modifiedModelViewProjection; +uniform vec4 u_tileRectangle; + +// Uniforms for 2D Mercator projection +uniform vec2 u_southAndNorthLatitude; +uniform vec2 u_southMercatorYAndOneOverHeight; + +out vec3 v_positionMC; +out vec3 v_positionEC; + +out vec3 v_textureCoordinates; +out vec3 v_normalMC; +out vec3 v_normalEC; + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT +uniform bool u_mars_flat_enabled; +uniform int u_mars_flat_AreaWidth; +uniform int u_mars_flat_AreaHeight; +uniform highp float u_mars_inverseTileWidth; +uniform highp vec2 u_mars_cartographicTileRectangle; +uniform highp sampler2D u_mars_flat_AreaTexture; +const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); + float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); + vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, point.w); +} + +float inRectangle(vec2 textureCoordinates) { + for(int h = 0; h < 100000; h++){ + if(h >= u_mars_flat_AreaWidth) break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float height = first.w; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++){ + if(float(w) >= currentLength) break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ + if (textureCoordinates.y <= max(p1.y, p2.y)){ + if (p1.x != p2.x){ + xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if (p1.y == p2.y || textureCoordinates.y <= xinters) + { + counter += 1.0; + } + } + } + } + + } + if((mod(counter, 2.0) != 0.0)) { + return height; + } + } + + return invalidValue; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + +#ifdef APPLY_MATERIAL +out float v_slope; +out float v_aspect; +out float v_height; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +out float v_distance; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) +out vec3 v_atmosphereRayleighColor; +out vec3 v_atmosphereMieColor; +out float v_atmosphereOpacity; +#endif + +// These functions are generated at runtime. +vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); +float get2DYPositionFraction(vec2 textureCoordinates); + +vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return u_modifiedModelViewProjection * vec4(position, 1.0); +} + +float get2DMercatorYPositionFraction(vec2 textureCoordinates) +{ + // The width of a tile at level 11, in radians and assuming a single root tile, is + // 2.0 * czm_pi / pow(2.0, 11.0) + // We want to just linearly interpolate the 2D position from the texture coordinates + // when we're at this level or higher. The constant below is the expression + // above evaluated and then rounded up at the 4th significant digit. + const float maxTileWidth = 0.003068; + float positionFraction = textureCoordinates.y; + float southLatitude = u_southAndNorthLatitude.x; + float northLatitude = u_southAndNorthLatitude.y; + if (northLatitude - southLatitude > maxTileWidth) + { + float southMercatorY = u_southMercatorYAndOneOverHeight.x; + float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; + + float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); + currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); + positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); + } + return positionFraction; +} + +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ + return textureCoordinates.y; +} + +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + return u_modifiedModelViewProjection * rtcPosition2D; +} + +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} + +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, height, textureCoordinates); +} + +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ + // We do not do RTC while morphing, so there is potential for jitter. + // This is unlikely to be noticeable, though. + vec3 position3DWC = position + u_center3D; + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); + return czm_modelViewProjection * morphPosition; +} + +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif + +void main() +{ +#ifdef QUANTIZATION_BITS12 + vec2 xy = czm_decompressTextureCoordinates(compressed0.x); + vec2 zh = czm_decompressTextureCoordinates(compressed0.y); + vec3 position = vec3(xy, zh.x); + float height = zh.y; + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); + + height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; + position = (u_scaleAndBias * vec4(position, 1.0)).xyz; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = compressed0.w; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#else + // A single float per element + vec3 position = position3DAndHeight.xyz; + float height = position3DAndHeight.w; + vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = textureCoordAndEncodedNormals.w; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = textureCoordAndEncodedNormals.z; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = 0.0; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#endif + + vec3 position3DWC = position + u_center3D; + +#ifdef GEODETIC_SURFACE_NORMALS + vec3 ellipsoidNormal = geodeticSurfaceNormal; +#else + vec3 ellipsoidNormal = normalize(position3DWC); +#endif + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + float exaggeration = u_terrainExaggerationAndRelativeHeight.x; + float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; + float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; + + // stop from going through center of earth + float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); + newHeight = max(newHeight, -minRadius); + + vec3 offset = ellipsoidNormal * (newHeight - height); + position += offset; + position3DWC += offset; + height = newHeight; +#endif + + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT + if(u_mars_flat_enabled){ + float isInside = inRectangle(textureCoordinates); + if(isInside != invalidValue){ + vec3 offset = (isInside - height) * ellipsoidNormal; + position += offset; + position3DWC += offset; + height = isInside; + // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; + } + } +#endif + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + + gl_Position = getPosition(position, height, textureCoordinates); + + v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; + v_positionMC = position3DWC; // position in model coordinates + + v_textureCoordinates = vec3(textureCoordinates, webMercatorT); + +#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + vec3 normalMC = czm_octDecode(encodedNormal); + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; + vec3 rejection = normalMC - projection; + normalMC = normalize(projection + rejection * exaggeration); +#endif + + v_normalMC = normalMC; + v_normalEC = czm_normal3D * v_normalMC; +#endif + +#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) + + bool dynamicLighting = false; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + + vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); + + computeAtmosphereScattering( + position3DWC, + lightDirection, + v_atmosphereRayleighColor, + v_atmosphereMieColor, + v_atmosphereOpacity + ); +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) + v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif + +#ifdef APPLY_MATERIAL + float northPoleZ = czm_ellipsoidRadii.z; + vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); + vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); + float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); + v_slope = acos(dotProd); + vec3 normalRejected = ellipsoidNormal * dotProd; + vec3 normalProjected = v_normalMC - normalRejected; + vec3 aspectVector = normalize(normalProjected); + v_aspect = acos(dot(aspectVector, vectorEastMC)); + float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); + v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); + v_height = height; +#endif +} +`;var iS=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { + + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + float atmosphereInnerRadius = length(positionWC); + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); +} +`;var RN=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var MN=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;var oS=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +vec3 getLightDirection(vec3 positionWC) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = + positionWC * float(lightEnum == 0.0) + + czm_lightDirectionWC * float(lightEnum == 1.0) + + czm_sunDirectionWC * float(lightEnum == 2.0); + return normalize(lightDirection); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var LN=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + vec3 lightDirection = getLightDirection(v_outerPositionWC); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_acesTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(color.rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + color.rgb = czm_HSBToRGB(hsb); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var NN=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + vec3 lightDirection = getLightDirection(positionWC.xyz); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;var FN=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var BN=`in vec3 position; + +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;var kN=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var UN=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var VN=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;var zN=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;var Jtt=new H;function Ztt(e,t){let n=e.unionClippingRegions,i=e.length,o=cs.useFloatTexture(t),r=cs.getTextureResolution(e,t,Jtt),s=r.x,a=r.y,c=o?ent(s,a):tnt(s,a);return c+=` +`,c+=n?$tt(i):Qtt(i),c}function $tt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount; + float pixelWidth = czm_metersPerPixel(position); + bool breakAndDiscard = false; + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) + { + breakAndDiscard = true; + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; +} +`}function Qtt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + bool clipped = true; + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount = 0.0; + float pixelWidth = czm_metersPerPixel(position); + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + } + if (clipped) + { + discard; + } + return clipAmount; +} +`}function ent(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${r}; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +`}function tnt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${r}; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v))); + return czm_transformPlane(plane, transform); +} +`}var M_=Ztt;function nnt(e,t,n,i,o){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o}function Nq(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function int(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function ont(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}Nq.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,x=e.dynamicAtmosphereLighting,b=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,A=e.hasVertexNormals,S=e.useWebMercatorProjection,v=e.enableFog,I=e.enableClippingPlanes,O=e.clippingPlanes,R=e.clippedByBoundaries,N=e.hasImageryLayerCutout,F=e.colorCorrect,_=e.highlightFillTile,E=e.colorToAlpha,w=e.hasGeodeticSurfaceNormals,D=e.hasExaggeration,M=e.showUndergroundColor,B=e.translucent,V=e.marsOptions||{},U=0,G="",Y=n.renderedMesh.encoding;Y.quantization===Bs.BITS12&&(U=1,G="QUANTIZATION_BITS12");let $=0,W="";R&&($=1,W="TILE_LIMIT_RECTANGLE");let K=0,J="";N&&(K=1,J="APPLY_IMAGERY_CUTOUT");let he=t.mode,ge=he|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|h<<10|x<<11|b<<12|C<<13|T<<14|A<<15|S<<16|v<<17|U<<18|d<<19|I<<20|$<<21|K<<22|F<<23|_<<24|E<<25|w<<26|D<<27|M<<28|B<<29|f<<30,se=0;l(O)&&O.length>0&&(se=I?O.clippingPlanesState:0);let _e=n.surfaceShader;if(l(_e)&&_e.numberOfDayTextures===i&&_e.flags===ge&&_e.material===this.material&&_e.clippingShaderState===se)return _e.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(l(xe)||(xe=this._shadersByTexturesFlags[i]=[]),_e=xe[ge],V.enableClip||!l(_e)||_e.material!==this.material||_e.clippingShaderState!==se){let Pe=this.baseVertexShaderSource.clone(),ve=this.baseFragmentShaderSource.clone();se!==0&&ve.sources.unshift(M_(O,t.context)),V.enableClip&&ve.defines.push("APPLY_MARS3D_CLIP"),V.enableUplift&&ve.defines.push("APPLY_MARS3D_UPLIFT"),V.enableFlat&&Pe.defines.push("APPLY_MARS3D_FLAT"),Pe.defines.push(G),ve.defines.push(`TEXTURE_UNITS ${i}`,W,J),o&&ve.defines.push("APPLY_BRIGHTNESS"),r&&ve.defines.push("APPLY_CONTRAST"),s&&ve.defines.push("APPLY_HUE"),a&&ve.defines.push("APPLY_SATURATION"),c&&ve.defines.push("APPLY_GAMMA"),V.invertColor&&ve.defines.push("APPLY_INVERT_COLOR_MARS3D"),V.filterColor&&ve.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&ve.defines.push("APPLY_ALPHA"),f&&ve.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(ve.defines.push("SHOW_REFLECTIVE_OCEAN"),Pe.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&ve.defines.push("SHOW_OCEAN_WAVES"),E&&ve.defines.push("APPLY_COLOR_TO_ALPHA"),M&&(Pe.defines.push("UNDERGROUND_COLOR"),ve.defines.push("UNDERGROUND_COLOR")),B&&(Pe.defines.push("TRANSLUCENT"),ve.defines.push("TRANSLUCENT")),h&&(A?(Pe.defines.push("ENABLE_VERTEX_LIGHTING"),ve.defines.push("ENABLE_VERTEX_LIGHTING")):(Pe.defines.push("ENABLE_DAYNIGHT_SHADING"),ve.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Pe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),b&&(Pe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(Pe.defines.push("GROUND_ATMOSPHERE"),ve.defines.push("GROUND_ATMOSPHERE"),T&&(Pe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),ve.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Pe.defines.push("INCLUDE_WEB_MERCATOR_Y"),ve.defines.push("INCLUDE_WEB_MERCATOR_Y"),v&&(Pe.defines.push("FOG"),ve.defines.push("FOG")),d&&ve.defines.push("APPLY_SPLIT"),I&&ve.defines.push("ENABLE_CLIPPING_PLANES"),F&&ve.defines.push("COLOR_CORRECT"),_&&ve.defines.push("HIGHLIGHT_FILL_TILE"),w&&Pe.defines.push("GEODETIC_SURFACE_NORMALS"),D&&Pe.defines.push("EXAGGERATION");let we=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;N&&(we+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let Re=0;Re<i;++Re)N?we+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Re}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:we+=` color = sampleAndBlend( +`,we+=` color, + u_dayTextures[${Re}], + u_dayTextureUseWebMercatorT[${Re}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${Re}], + u_dayTextureTranslationAndScale[${Re}], + ${u?`u_dayTextureAlpha[${Re}]`:"1.0"}, + ${f?`u_dayTextureNightAlpha[${Re}]`:"1.0"}, +${f?`u_dayTextureDayAlpha[${Re}]`:"1.0"}, +${o?`u_dayTextureBrightness[${Re}]`:"0.0"}, + ${r?`u_dayTextureContrast[${Re}]`:"0.0"}, + ${s?`u_dayTextureHue[${Re}]`:"0.0"}, + ${a?`u_dayTextureSaturation[${Re}]`:"0.0"}, + ${c?`u_dayTextureOneOverGamma[${Re}]`:"0.0"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${V.invertColor?`u_mars3dTextureInvertColor[${Re}]`:"false"}, + ${V.filterColor?`u_mars3dTextureFilterColor[${Re}]`:"vec3(1.0)"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${d?`u_dayTextureSplit[${Re}]`:"0.0"}, + ${E?`u_colorsToAlpha[${Re}]`:"vec4(0.0)"}, + nightBlend ); +`,N&&(we+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);we+=` return color; + }`,ve.sources.push(we),Pe.sources.push(int(he)),Pe.sources.push(ont(S));let ze=Zt.fromCache({context:t.context,vertexShaderSource:Pe,fragmentShaderSource:ve,attributeLocations:Y.getAttributeLocations()});_e=xe[ge]=new nnt(i,ge,this.material,ze,se)}return n.surfaceShader=_e,_e.shaderProgram};Nq.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var HN=Nq;var rnt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},fi=Object.freeze(rnt);var snt={START:0,LOADING:1,DONE:2,FAILED:3},ks=Object.freeze(snt);var ant={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},yo=Object.freeze(ant);function Qo(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new re(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=yo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Qo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===yo.RECEIVING||e===yo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==fi.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var cnt=new me;function Fq(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,cnt);s=n.project(c,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var lnt=new m,unt=new m,fnt=new m;Qo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],h=a[d+2],x=Fq(c,t,n,s,p,lnt),b=Fq(c,t,n,s,g,unt),C=Fq(c,t,n,s,h,fnt),T=Ji.rayTriangleParametric(e,x,b,C,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?wn.getPoint(e,f,o):void 0};Qo.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=yo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Qo.prototype.freeVertexArray=function(){Qo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Qo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Qo.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Qo),e.state===ks.START&&(dnt(e,t,n),e.state=ks.LOADING)};Qo.processStateMachine=function(e,t,n,i,o,r,s){Qo.initialize(e,n,i);let a=e.data;if(e.state===ks.LOADING&&mnt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===yo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ks.DONE}c&&(e.renderable=!0)};Qo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===fi.PLACEHOLDER){let g=d.loadingImagery.imageryLayer,h=g.imageryProvider;if(g.ready&&(l(h._ready)?h._ready:!l(h.ready)||h.ready)){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===fi.FAILED||d.loadingImagery.state===fi.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function m_e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=lc.clone(s);c.hasGeodeticSurfaceNormals=t,c=lc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Qo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Qo._createVertexArrayForMesh(i.context,o)):(Qo._freeVertexArray(e.vertexArray),e.vertexArray=Qo._createVertexArrayForMesh(i.context,o)),Qo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Qo.prototype.addGeodeticSurfaceNormals=function(e,t){m_e(this,!0,e,t)};Qo.prototype.removeGeodeticSurfaceNormals=function(e){m_e(this,!1,void 0,e)};Qo.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function dnt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=yo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function mnt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===yo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Qo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===yo.FAILED&&hnt(s,e,t,n,e.x,e.y,e.level),s.terrainState===yo.UNLOADED&&pnt(s,n,e.x,e.y,e.level),s.terrainState===yo.RECEIVED&&gnt(s,t,n,e.x,e.y,e.level),s.terrainState===yo.TRANSFORMED&&(ynt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=yo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)bnt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function hnt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ks.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=yo.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=yo.RECEIVED}).catch(function(){e.terrainState=yo.FAILED}))}function pnt(e,t,n,i,o){function r(c){e.terrainData=c,e.terrainState=yo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ti.CANCELLED){e.terrainData=void 0,e.terrainState=yo.UNLOADED,e.request=void 0;return}e.terrainState=yo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=xi.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new jo({throttle:!1,throttleByServer:!0,type:Xr.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=yo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=yo.UNLOADED,e.request=void 0)}a()}var _nt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function gnt(e,t,n,i,o,r){let s=n.tilingScheme,a=_nt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=yo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=yo.TRANSFORMED}).catch(function(){e.terrainState=yo.FAILED}))}Qo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ht.createVertexBuffer({context:e,typedArray:n,usage:ke.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=ht.createIndexBuffer({context:e,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ri({context:e,attributes:o,indexBuffer:s})};Qo._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function ynt(e,t,n,i,o,r,s){e.vertexArray=Qo._createVertexArrayForMesh(t,e.mesh),e.terrainState=yo.READY,e.fill=e.fill&&e.fill.destroy(s)}function xnt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Lt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Ci.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function bnt(e,t){let n=t.terrainData.waterMask,i=xnt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Lt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,re.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Qo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Qo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var kf=Qo;var r4,h_e="AAPKac82a6d80f1340a4aa9587f789d07e96a_Jj1a4fbA59cggYHArDizxxA2U4QDofLUm36VivpUsSRyK7O1JjRPwy916Y-7ld",rS={};rS.defaultAccessToken=h_e;rS.defaultWorldImageryServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});rS.defaultWorldHillshadeServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});rS.defaultWorldOceanServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});rS.getDefaultTokenCredit=function(e){if(e===h_e){if(!l(r4)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';r4=new wt(t,!0),r4._isDefaultToken=!0}return r4}};var Ou=rS;function Bq(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Se.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=id(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}Bq.prototype.isReady=function(){return this._isReady};Bq.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=id(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var GN=Bq;function kq(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}kq.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};kq.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var mm=kq;function sS(){fe.throwInstantiationError()}Object.defineProperties(sS.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});sS.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};sS.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};sS.prototype.pickFeatures=function(e,t,n,i,o){fe.throwInstantiationError()};var Cnt=/\.ktx2$/i;sS.loadImage=function(e,t){let n=Se.createIfNeeded(t);return Cnt.test(n.url)?sl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Yc=sS;var Tnt={SATELLITE:1,OCEANS:2,HILLSHADE:3},hm=Object.freeze(Tnt);function Uq(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Hi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new wt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Uq.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new GN({missingImageUrl:__e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Ant(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Lr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Hi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ii,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new wt(e.copyrightText)]:t.credit=new wt(e.copyrightText))}function Ent(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),xi.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function p_e(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let o=await i.fetchJson();Ant(o,t)}catch(o){Ent(e,o,n)}}function Ah(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Hi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new wt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new pe,this._ready=!1,l(e.url)){Q("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=Se.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,l(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new Uq(e);i.useTiles?this._readyPromise=p_e(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}Ah.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case hm.SATELLITE:{n=y(t.token,Ou.defaultAccessToken),i=Se.createIfNeeded(y(t.url,Ou.defaultWorldImageryServer)),i.appendForwardSlash();let r=Ou.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;case hm.OCEANS:{n=y(t.token,Ou.defaultAccessToken),i=Se.createIfNeeded(y(t.url,Ou.defaultWorldOceanServer)),i.appendForwardSlash();let r=Ou.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;case hm.HILLSHADE:{n=y(t.token,Ou.defaultAccessToken),i=Se.createIfNeeded(y(t.url,Ou.defaultWorldHillshadeServer)),i.appendForwardSlash();let r=Ou.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;default:}return Ah.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function __e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof vi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Ah.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ah.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Ah(t);i._resource=n;let o=new Uq(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await p_e(n,o),o.build(i),i._readyPromise=Promise.resolve(!0),i};Ah.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Ah.prototype.requestImage=function(e,t,n,i){return Yc.loadImage(this,__e(this,e,t,n,i))};Ah.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof vi)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!l(h))return g;for(let x=0;x<h.length;++x){let b=h[x],C=new mm;if(C.data=b,C.name=b.value,C.properties=b.attributes,C.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let T=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)C.position=me.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(T===102100||T===900913||T===3857){let A=new Ii;C.position=A.unproject(new m(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(C)}return g})};Ah._metadataCache={};var Eh=Ah;var Snt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},aS=Object.freeze(Snt);function WN(e){}WN.prototype.isReady=function(){return!0};WN.prototype.shouldDiscardImage=function(e){return WN.EMPTY_IMAGE===e};var s4;Object.defineProperties(WN,{EMPTY_IMAGE:{get:function(){return l(s4)||(s4=new Image,s4.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),s4}}});var cS=WN;function Vq(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Vq.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof wt)break;o.credit=new wt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new ce(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}e._ready=!0};function vnt(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function wnt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),xi.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function g_e(e,t,n){let i=e.url,o=_s._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),_s._metadataCache[i]=o);try{let r=await o;return vnt(r,t)}catch(r){wnt(e,r,n)}}function _s(e){if(e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,aS.AERIAL),this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new cS),this._proxy=e.proxy,this._credit=new wt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${_s.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Lr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new pe,this._ready=!1,l(e.url)){Q("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;l(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=Se.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),o=new Vq(e);this._readyPromise=g_e(i,o,this).then(()=>(o.build(this),!0))}}Object.defineProperties(_s.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});_s.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,aS.AERIAL),o=Se.createIfNeeded(e);o.appendForwardSlash();let r=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new _s(t);s._resource=o;let a=new Vq(t);return await g_e(r,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var Int=new ce;_s.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Int);return Ont(this._attributionList,n,i)};_s.prototype.requestImage=function(e,t,n,i){let o=Yc.loadImage(this,Dnt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?cS.EMPTY_IMAGE:Promise.reject(r)})};_s.prototype.pickFeatures=function(e,t,n,i,o){};_s.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};_s.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};_s._logoUrl=void 0;Object.defineProperties(_s,{logoUrl:{get:function(){return l(_s._logoUrl)||(_s._logoUrl=nn("Assets/Images/bing_maps_credit.png")),_s._logoUrl},set:function(e){_s._logoUrl=e}}});function Dnt(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:_s.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Pnt=new ce;function Ont(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,Pnt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}_s._metadataCache={};var lS=_s;var y_e=/{[^}]+}/g,Gq={x:Lnt,y:Fnt,z:Unt,s:Vnt,reverseX:Nnt,reverseY:Bnt,reverseZ:knt,westDegrees:znt,southDegrees:Hnt,eastDegrees:Gnt,northDegrees:Wnt,westProjected:jnt,southProjected:qnt,eastProjected:Ynt,northProjected:Xnt,width:Knt,height:Jnt},x_e=_t(Gq,{i:Znt,j:$nt,reverseI:Qnt,reverseJ:eit,longitudeDegrees:nit,latitudeDegrees:iit,longitudeProjected:oit,latitudeProjected:rit,format:ait});function tC(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe,l(e.then)){this._reinitialize(e);return}let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Lr({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new wt(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=_t(Gq,r),a=_t(x_e,r);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(tC.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready&&l(this._resource)}},readyPromise:{get:function(){return Q("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});tC.prototype.reinitialize=function(e){return Q("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._reinitialize(e)};tC.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,o=_t(Gq,i),r=_t(x_e,i),s=Se.createIfNeeded(n.url),a=Se.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new Lr({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new wt(c)),t._credit=c,t._resource=s,t._tags=o,t._pickFeaturesResource=a,t._pickFeaturesTags=r,t._ready=!0,!0})};tC.prototype.getTileCredits=function(e,t,n){};tC.prototype.requestImage=function(e,t,n,i){return Yc.loadImage(this,Rnt(this,e,t,n,i))};tC.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Mnt(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var a4=!1,Ru=new ce,c4=!1,jN=new ce;function Rnt(e,t,n,i,o){a4=!1,c4=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(y_e);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var zq=!1,fS=new H,Hq=!1;function Mnt(e,t,n,i,o,r,s){a4=!1,c4=!1,zq=!1,Hq=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(y_e);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function dS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Lnt(e,t,n,i){return dS(e,"{x}",t)}function Nnt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return dS(e,"{reverseX}",o)}function Fnt(e,t,n,i){return dS(e,"{y}",n)}function Bnt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return dS(e,"{reverseY}",o)}function knt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return dS(e,"{reverseZ}",r)}function Unt(e,t,n,i){return dS(e,"{z}",i)}function Vnt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function l4(e,t,n,i){a4||(e.tilingScheme.tileXYToRectangle(t,n,i,Ru),Ru.west=P.toDegrees(Ru.west),Ru.south=P.toDegrees(Ru.south),Ru.east=P.toDegrees(Ru.east),Ru.north=P.toDegrees(Ru.north),a4=!0)}function znt(e,t,n,i){return l4(e,t,n,i),Ru.west}function Hnt(e,t,n,i){return l4(e,t,n,i),Ru.south}function Gnt(e,t,n,i){return l4(e,t,n,i),Ru.east}function Wnt(e,t,n,i){return l4(e,t,n,i),Ru.north}function u4(e,t,n,i){c4||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,jN),c4=!0)}function jnt(e,t,n,i){return u4(e,t,n,i),jN.west}function qnt(e,t,n,i){return u4(e,t,n,i),jN.south}function Ynt(e,t,n,i){return u4(e,t,n,i),jN.east}function Xnt(e,t,n,i){return u4(e,t,n,i),jN.north}function Knt(e,t,n,i){return e.tileWidth}function Jnt(e,t,n,i){return e.tileHeight}function Znt(e,t,n,i,o,r,s){return f4(e,t,n,i,o,r),fS.x}function $nt(e,t,n,i,o,r,s){return f4(e,t,n,i,o,r),fS.y}function Qnt(e,t,n,i,o,r,s){return f4(e,t,n,i,o,r),e.tileWidth-fS.x-1}function eit(e,t,n,i,o,r,s){return f4(e,t,n,i,o,r),e.tileHeight-fS.y-1}var tit=new ce,uS=new m;function f4(e,t,n,i,o,r,s){if(zq)return;Wq(e,t,n,i,o,r);let a=uS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,tit);fS.x=e.tileWidth*(a.x-c.west)/c.width|0,fS.y=e.tileHeight*(c.north-a.y)/c.height|0,zq=!0}function nit(e,t,n,i,o,r,s){return P.toDegrees(o)}function iit(e,t,n,i,o,r,s){return P.toDegrees(r)}function oit(e,t,n,i,o,r,s){return Wq(e,t,n,i,o,r),uS.x}function rit(e,t,n,i,o,r,s){return Wq(e,t,n,i,o,r),uS.y}var sit=new me;function Wq(e,t,n,i,o,r,s){if(!Hq){if(e.tilingScheme.projection instanceof vi)uS.x=P.toDegrees(o),uS.y=P.toDegrees(r);else{let a=sit;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,uS)}Hq=!0}}function ait(e,t,n,i,o,r,s){return s}var Us=tC;function Mu(e){if(e=y(e,y.EMPTY_OBJECT),l(e.url)){Q("TileMapServiceImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use TileMapServiceImageryProvider.fromUrl instead."),this._metadataError=void 0,this._ready=!1;let t,n=this,i=Promise.resolve(e.url).then(function(o){return t=Se.createIfNeeded(o),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),Mu._requestMetadata(e,n._tmsResource,n._xmlResource,n)}).catch(o=>Promise.reject(o));Us.call(this,i),this._promise=i}}Mu._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Mu._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Sm)return Mu._metadataFailure(e,t);throw o}};Mu.fromUrl=async function(e,t){let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await Mu._requestMetadata(t,i,o),s=new Mu;return Us.call(s,r),s};l(Object.create)&&(Mu.prototype=Object.create(Us.prototype),Mu.prototype.constructor=Mu);function b_e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function C_e(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Mu._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let N=g.item(R).childNodes;for(let F=0;F<N.length;F++)s.test(N.item(F).nodeName)&&p.push(N.item(F))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let h;if(!l(d)||!l(f))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&xi.reportError(void 0,o,o.errorEvent,h),new de(h);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),T=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(S==="geodetic"||S==="global-geodetic")v=new Hi({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new Lr({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(o)&&xi.reportError(void 0,o,o.errorEvent,h),new de(h);let I=ce.clone(t.rectangle);if(!l(I)){let R,N,F,_;y(t.flipXY,!1)?(F=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(F=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=S==="geodetic"||S==="mercator";if(v.projection instanceof vi||w)R=me.fromDegrees(F.x,F.y),N=me.fromDegrees(_.x,_.y);else{let D=v.projection;R=D.unproject(F),N=D.unproject(_)}I=new ce(R.longitude,R.latitude,N.longitude,N.latitude)}return I=b_e(I,v),T=C_e(v,I,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:I,tileWidth:b,tileHeight:C,minimumLevel:T,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Mu._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Lr({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=b_e(a,s);let c=C_e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Sh=Mu;function jq(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}jq.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function cit(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new de(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Lr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new de(o)}return!0}function lit(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),xi.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function T_e(e,t,n){try{let i=await e.fetchText();cit(i,t)}catch(i){lit(i,e,n)}}function Ll(e){if(e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new wt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Ll.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe,l(e.url)||l(e.channel)){Q("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=Se.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let o=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),r=new jq(e);this._readyPromise=T_e(o,r,this).then(()=>(r.build(this),this._ready=!0,!0))}}Object.defineProperties(Ll.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ll.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Se.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new jq(n);s.channel=t,await T_e(r,s);let a=new Ll(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=o,a._url=e,a._path=i,a};Ll.prototype.getTileCredits=function(e,t,n){};Ll.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Yc.loadImage(this,o)};Ll.prototype.pickFeatures=function(e,t,n,i,o){};Ll._logoUrl=void 0;Object.defineProperties(Ll,{logoUrl:{get:function(){return l(Ll._logoUrl)||(Ll._logoUrl=nn("Assets/Images/google_earth_credit.png")),Ll._logoUrl},set:function(e){Ll._logoUrl=e}}});var mS=Ll;var uit=/\/$/,A_e=new wt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function hS(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();uit.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new wt(s))):s=A_e,this._resource=i,this._imageryProvider=new Us({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(hS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});hS.prototype.getTileCredits=function(e,t,n){};hS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hS._defaultCredit=A_e;var pS=hS;function nC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new Hi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new pe,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new wt(i)),this._credit=i;let o=Se.createIfNeeded(e.url);if(this._resource=o,l(e.tileWidth)||l(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}Q("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=d4(o,this).then(r=>(xi.reportSuccess(this._errorEvent),this._image=r,this._tileWidth=r.width,this._tileHeight=r.height,this._ready=!0,!0))}Object.defineProperties(nC.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function fit(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=xi.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return d4(e,n,r);throw l(n)&&(n._hasError=!0),new de(o)}async function d4(e,t,n){try{return await Yc.loadImage(null,e)}catch(i){return fit(e,i,t,n)}}nC.fromUrl=async function(e,t){let n=Se.createIfNeeded(e),i=await d4(n);t=y(t,y.EMPTY_OBJECT);let o=new nC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};nC.prototype.getTileCredits=function(e,t,n){};nC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await d4(this._resource,this);return this._image=o,xi.reportSuccess(this._errorEvent),o}return this._image};nC.prototype.pickFeatures=function(e,t,n,i,o){};var _S=nC;function dit(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=mit:e==="xml"?n=git:(e==="html"||e==="text")&&(n=E_e)),this.callback=n}function mit(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new mm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=me.fromDegrees(s,a)}t.push(r)}return t}var qq="http://www.mapinfo.com/mxp",hit="http://www.esri.com/wms",pit="http://www.opengis.net/wfs",_it="http://www.opengis.net/gml";function git(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===qq)return yit(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===hit)return xit(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===pit)return bit(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Cit(e):Tit(e)}function yit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(qq,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(qq,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new mm;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function xit(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(m4(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(m4(a,i))}}return n}function bit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(_it,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};Yq(r,s),t.push(m4(r,s))}return t}function Cit(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new de("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};Yq(s,a),t.push(m4(s,a))}}return t}function Yq(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&Yq(o,t)&&(t[o.localName]=o.textContent)}return n}function m4(e,t){let n=new mm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Tit(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new mm;return o.data=e,o.description=n.innerHTML,[o]}var Ait=/<body>\s*<\/body>/im,Eit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Sit=/<title>([\s\S]*)<\/title>/im;function E_e(e){if(Ait.test(e)||Eit.test(e))return;let t,n=Sit.exec(e);n&&n.length>1&&(t=n[1]);let i=new mm;return i.name=t,i.description=e,i.data=e,[i]}var iC=dit;function qN(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(qN.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});qN.prototype.getFromCache=function(e,t,n,i){let o=S_e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};qN.prototype.checkApproachingInterval=function(e,t,n,i){let o=S_e(e,t,n),r=this._tilesRequestedForInterval,s=v_e(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!w_e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};qN.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=v_e(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=w_e(this,c,r),a||s.push(c)}}};function S_e(e,t,n){return`${e}-${t}-${n}`}function vit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function v_e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function w_e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=vit(s),c=new jo({throttle:!1,throttleByServer:!0,type:Xr.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var oC=qN;var wit=[3034,3035,3042,3043,3044],Iit=[4471,4559];function pm(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(pm.DefaultParameters,!0),n.setQueryParameters(pm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(I_e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(I_e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new oC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return D_e(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Ii?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Iit.includes(a)||wit.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Ii?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Us({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Hi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,pm.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function D_e(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Dit(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(pm.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return Q("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return Q("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});pm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};pm.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=D_e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};pm.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Dit(this,e,t,n,i,o,s)};pm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});pm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});pm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new iC("json","application/json")),Object.freeze(new iC("xml","text/xml")),Object.freeze(new iC("text","text/html"))]);function I_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var gS=pm;var Pit=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function YN(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Se.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Pit),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Lr({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new oC({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,x){return P_e(s,d,p,g,h,x)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new wt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function P_e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=_t(g,u)),l(f)&&(g=_t(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:o}),d.setTemplateValues(p)}return Yc.loadImage(e,d)}Object.defineProperties(YN.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return Q("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});YN.prototype.getTileCredits=function(e,t,n){};YN.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=P_e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};YN.prototype.pickFeatures=function(e,t,n,i,o){};var yS=YN;function L_(e){return function(t){return new e(t)}}var Oit={ARCGIS_MAPSERVER:L_(Eh),BING:L_(lS),GOOGLE_EARTH:L_(mS),MAPBOX:L_(pS),SINGLE_TILE:L_(_S),TMS:L_(Sh),URL_TEMPLATE:L_(Us),WMS:L_(gS),WMTS:L_(yS)},Rit={ARCGIS_MAPSERVER:Eh.fromUrl,BING:async(e,t)=>lS.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,mS.fromUrl(e,n,t)},MAPBOX:(e,t)=>new pS({url:e,...t}),SINGLE_TILE:_S.fromUrl,TMS:Sh.fromUrl,URL_TEMPLATE:(e,t)=>new Us({url:e,...t}),WMS:(e,t)=>new gS({url:e,...t}),WMTS:(e,t)=>new yS({url:e,...t})};function Nl(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new pe;let t=e.assetId;l(t)&&(Q("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),Nl._initialize(this,t,e))}Object.defineProperties(Nl.prototype,{ready:{get:function(){return Q("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return Q("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Nl._initialize=function(e,t,n){let i=Zs._createEndpointResource(t,n),o=t.toString()+n.accessToken+n.server,r=Nl._endpointCache[o];l(r)||(r=i.fetchJson(),Nl._endpointCache[o]=r),e._readyPromise=r.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new Sh({url:new Zs(s,i)});else{let u=Oit[c];if(!l(u))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return e._tileCredits=Zs.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=e,e._errorEvent.raiseEvent(u)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};Nl.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Zs._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Nl._endpointCache[i];l(o)||(o=n.fetchJson(),Nl._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Sh.fromUrl(new Zs(r,n));else{let u=Rit[a];if(!l(u))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new Nl(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Zs.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};Nl.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Nl.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Nl.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Nl._endpointCache={};var Uf=Nl;var Mit={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},_m=Object.freeze(Mit);function Lit(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,_m.AERIAL);return Uf.fromAssetId(t)}var N_=Lit;function xS(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let s=t/2|0,a=n/2|0,c=i-1;this.parent=e.getImageryFromCache(s,a,c)}this.state=fi.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0;let r=e.imageryProvider;!l(o)&&e.ready&&(l(r._ready)?r._ready:!l(r.ready)||r.ready)&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}xS.createPlaceholder=function(e){let t=new xS(e,0,0,0);return t.addReference(),t.state=fi.PLACEHOLDER,t};xS.prototype.addReference=function(){++this.referenceCount};xS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};xS.prototype.processStateMachine=function(e,t,n){this.state===fi.UNLOADED&&!n&&(this.state=fi.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===fi.RECEIVED&&(this.state=fi.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===fi.READY&&t&&!this.texture;(this.state===fi.TEXTURE_LOADED||i)&&(this.state=fi.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var bS=xS;function Xq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}Xq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};Xq.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===fi.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==fi.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==fi.FAILED&&r.state!==fi.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===fi.FAILED||i.state===fi.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var CS=Xq;function hi(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,hi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,hi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,hi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,hi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,hi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,hi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,hi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,hi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new CS(bS.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(hi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});hi.DEFAULT_BRIGHTNESS=1;hi.DEFAULT_CONTRAST=1;hi.DEFAULT_HUE=0;hi.DEFAULT_SATURATION=1;hi.DEFAULT_GAMMA=1;hi.DEFAULT_SPLIT=Nc.NONE;hi.DEFAULT_MINIFICATION_FILTER=un.LINEAR;hi.DEFAULT_MAGNIFICATION_FILTER=Ci.LINEAR;hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;hi.fromProviderAsync=function(e,t){let n=new hi(void 0,t);return Uit(n,Promise.resolve(e)),n};hi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),hi.fromProviderAsync(N_({style:e.style}),e)};hi.prototype.isBaseLayer=function(){return this._isBaseLayer};hi.prototype.isDestroyed=function(){return!1};hi.prototype.destroy=function(){return ue(this)};var M_e=new ce,O_e=new ce,Kq=new ce,L_e=new ce;hi.prototype.getViewableRectangle=async function(){Q("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,ce.intersection(e.rectangle,t)};hi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};hi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready||(l(o._ready)?!o._ready:l(o.ready)&&!o.ready))return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Ii&&e.rectangle.north<Ii.MaximumLatitude&&e.rectangle.south>-Ii.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,M_e),a=ce.intersection(e.rectangle,s,O_e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=O_e,D.south>=w.north?a.north=a.south=w.north:D.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(D.south,w.south),a.north=Math.min(D.north,w.north)),D.west>=w.east?a.west=a.east=w.east:D.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(D.west,w.west),a.east=Math.min(D.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Bit(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let w=o.minimumLevel;d<w&&(d=w)}let g=o.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),x=g.positionToTileXY(ce.southeast(a),d),b=e.rectangle.width/512,C=e.rectangle.height/512,T=g.tileXYToRectangle(h.x,h.y,d);Math.abs(T.south-e.rectangle.north)<C&&h.y<x.y&&++h.y,Math.abs(T.east-e.rectangle.west)<b&&h.x<x.x&&++h.x;let A=g.tileXYToRectangle(x.x,x.y,d);Math.abs(A.north-e.rectangle.south)<C&&x.y>h.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>h.x&&--x.x;let S=ce.clone(e.rectangle,L_e),v=g.tileXYToRectangle(h.x,h.y,d),I=ce.intersection(v,s,Kq),O;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),O=g.tileXYToNativeRectangle.bind(g),b=S.width/512,C=S.height/512):O=g.tileXYToRectangle.bind(g);let R,N=0,F=1,_;!this.isBaseLayer()&&Math.abs(I.west-S.west)>=b&&(N=Math.min(1,(I.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(I.north-S.north)>=C&&(F=Math.max(0,(I.north-S.south)/S.height));let E=F;for(let w=h.x;w<=x.x;w++)if(R=N,v=O(w,h.y,d),I=ce.simpleIntersection(v,s,Kq),!!l(I)){N=Math.min(1,(I.east-S.west)/S.width),w===x.x&&(this.isBaseLayer()||Math.abs(I.east-S.east)<b)&&(N=1),F=E;for(let D=h.y;D<=x.y;D++){if(_=F,v=O(w,D,d),I=ce.simpleIntersection(v,s,Kq),!l(I))continue;F=Math.max(0,(I.south-S.south)/S.height),D===x.y&&(this.isBaseLayer()||Math.abs(I.south-S.south)<C)&&(F=0);let M=new re(R,F,N,_),B=this.getImageryFromCache(w,D,d);i.imagery.splice(n,0,new CS(B,M,r)),++n}}return!0};hi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,M_e),i=c.rectangleToNativeRectangle(i,L_e)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new re(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};hi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=fi.RECEIVED,e.request=void 0,xi.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(s){if(e.request.state===ti.CANCELLED){e.state=fi.UNLOADED,e.request=void 0;return}e.state=fi.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=xi.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let s=new jo({throttle:!1,throttleByServer:!0,type:Xr.IMAGERY});e.request=s,e.state=fi.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=fi.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){o(c)}):i(a)}r()};hi.prototype._createTextureWebGL=function(e,t){let n=new hn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Lt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Lt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ct.RGBA:ct.RGB,sampler:n})};hi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=fi.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=fi.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ii?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=fi.TEXTURE_LOADED};function R_e(e,t,n){return`${e}:${t}:${n}`}hi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===un.LINEAR&&i===Ci.LINEAR&&!ct.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=un.LINEAR_MIPMAP_LINEAR;let r=Gt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=R_e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Pm.NICEST),t.sampler=u}else{let r=R_e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};hi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof vi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Zu({persists:!0,owner:this,preExecute:function(c){Fit(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=fi.READY,t.releaseReference()},canceled:function(){t.state=fi.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=fi.READY};hi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};hi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};hi.prototype.getImageryFromCache=function(e,t,n,i){let o=N_e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new bS(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};hi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=N_e(e.x,e.y,e.level);delete this._imageryCache[t]};function N_e(e,t,n){return JSON.stringify([e,t,n])}var h4={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},Nit=Wt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Fit(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let O=I/63;b[C++]=0,b[C++]=O,b[C++]=1,b[C++]=O}let T={position:0,webMercatorT:1},A=Hr.getRegularGridIndices(2,64),S=ht.createIndexBuffer({context:t,typedArray:A,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new ri({context:t,attributes:[{index:T.position,vertexBuffer:ht.createVertexBuffer({context:t,typedArray:b,usage:ke.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:ht.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:ke.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new Ge({sources:[MN]});o.shaderProgram=Zt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:RN,attributeLocations:T}),o.sampler=new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Ci.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;h4.textureDimensions.x=r,h4.textureDimensions.y=s,h4.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Lt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&d.generateMipmap(Pm.NICEST);let p=i.south,g=i.north,h=Nit,x=0;for(let b=0;b<64;++b){let C=b/63,T=P.lerp(p,g,C);a=Math.sin(T);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[x++]=S,h[x++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=h4,e.vertexArray=o.vertexArray}function Bit(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof vi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function kit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Uit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){kit(e._errorEvent,i)}}var Vs=hi;var F_e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=F_e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},$n=F_e;function AS(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new re}AS.prototype.update=function(e,t,n){this.changedThisFrame&&(G_e(e,t,this.tile,n),this.changedThisFrame=!1)};AS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};AS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):kf._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Vit=new ty;AS.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Vit;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);gs(e,n,c,u,s,yn.EAST,!1,a,i),gs(e,n,c,f,s,yn.NORTH,!1,a,i),gs(e,n,c,d,s,yn.WEST,!1,a,i),gs(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),h=u.findTileToSouth(r),x=d.findTileToNorth(r),b=d.findTileToSouth(r);gs(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),gs(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),gs(e,n,c,h,s,yn.NORTHEAST,!1,a,i),gs(e,n,c,b,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function gs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||$n.wasKicked(u._lastSelectionResult)||$n.originalResult(u._lastSelectionResult)===$n.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===$n.RENDERED){if(l(u.data.vertexArray))return;zit(e,t,n,u,r,o,a,c);return}if($n.originalResult(i._lastSelectionResult)!==$n.CULLED)switch(r){case yn.WEST:gs(e,t,n,i.northwestChild,o,r,!0,a,c),gs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:gs(e,t,n,i.southeastChild,o,r,!0,a,c),gs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:gs(e,t,n,i.southwestChild,o,r,!0,a,c),gs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:gs(e,t,n,i.northeastChild,o,r,!0,a,c),gs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:gs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:gs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:gs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:gs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new fe("Invalid edge")}}}function zit(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new AS(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Hit(e,t,n,i,o,a)}function Hit(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(G_e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,h,x=n.rectangle,b,C=i.rectangle;switch(o){case yn.WEST:for(b=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(x.north,h.south,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(x.south,h.north,b));++p);break;case yn.SOUTH:for(b=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(x.west,h.east,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(x.east,h.west,b));++p);break;case yn.EAST:for(b=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(x.south,h.north,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(x.north,h.south,b));++p);break;case yn.NORTH:for(b=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(x.east,h.west,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(x.west,h.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var rC=new me,Git=new me,TS=new m,Qq=new m,Jq=new H,Zq=new H,Lu=new H;function C4(){this.height=0,this.encodedNormal=new H}function p4(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return W_e(e,t,n,i,u,c),c}var Wit={minimumHeight:0,maximumHeight:0},jit=new m,B_e=new C4,k_e=new C4,U_e=new C4,V_e=new C4,qit=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Yit={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function G_e(e,t,n,i){kf.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=g4(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,U_e),p=g4(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,B_e),g=g4(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,k_e),h=g4(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,V_e);d=p4(r,f,0,1,d,p,h,g,U_e),p=p4(r,f,0,0,p,d,g,h,B_e),g=p4(r,f,1,1,g,p,h,d,k_e),h=p4(r,f,1,1,h,g,d,p,V_e);let x=p.height,b=g.height,C=d.height,T=h.height,A=Math.min(x,b,C,T),S=Math.max(x,b,C,T),v=(A+S)*.5,I,O,R=e.getLevelMaximumGeometricError(n.level),N=f.maximumRadius-R,F=Math.acos(N/f.maximumRadius)*4;if(F*=1.5,s.width>F&&S-A<=R){let w=new Da({width:9,height:9,buffer:qit,structure:{heightOffset:S}}),D=Yit;D.tilingScheme=n.tilingScheme,D.x=n.x,D.y=n.y,D.level=n.level,D.exaggeration=a,D.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(D)}else{let w=u,D=ce.center(s,Git);D.height=v;let M=f.cartographicToCartesian(D,jit),B=new lc(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,U;for(U=r.westMeshes,I=0,O=U.length;I<O;++I)V+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,O=U.length;I<O;++I)V+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,O=U.length;I<O;++I)V+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,O=U.length;I<O;++I)V+=U[I].southIndicesEastToWest.length;let G=Wit;G.minimumHeight=A,G.maximumHeight=S;let k=B.stride,Y=new Float32Array(V*k),j=0,$=j;j=_4(f,s,B,Y,j,0,1,d.height,d.encodedNormal,1,G),j=x4(r,f,B,Y,j,r.westTiles,r.westMeshes,yn.EAST,G);let W=j;j=_4(f,s,B,Y,j,0,0,p.height,p.encodedNormal,0,G),j=x4(r,f,B,Y,j,r.southTiles,r.southMeshes,yn.NORTH,G);let K=j;j=_4(f,s,B,Y,j,1,0,g.height,g.encodedNormal,0,G),j=x4(r,f,B,Y,j,r.eastTiles,r.eastMeshes,yn.WEST,G);let J=j;j=_4(f,s,B,Y,j,1,1,h.height,h.encodedNormal,1,G),j=x4(r,f,B,Y,j,r.northTiles,r.northMeshes,yn.SOUTH,G),A=G.minimumHeight,S=G.maximumHeight;let he=Ln.fromRectangle(s,A,S,n.tilingScheme.ellipsoid),ge=Ii.geodeticLatitudeToMercatorAngle(s.south),se=1/(Ii.geodeticLatitudeToMercatorAngle(s.north)-ge),_e=(Ii.geodeticLatitudeToMercatorAngle(D.latitude)-ge)*se,xe=f.geodeticSurfaceNormalCartographic(rC,Qq),Pe=qn.octEncode(xe,Jq),ve=j;B.encode(Y,j*k,he.center,H.fromElements(.5,.5,Lu),v,Pe,_e,xe),++j;let we=j,ze=we<256?1:2,Re=(we-1)*3,dt=Re*ze,Tt=(Y.length-we*k)*Float32Array.BYTES_PER_ELEMENT,ot;if(Tt>=dt){let Ee=we*k*Float32Array.BYTES_PER_ELEMENT;ot=we<256?new Uint8Array(Y.buffer,Ee,Re):new Uint16Array(Y.buffer,Ee,Re)}else ot=we<256?new Uint8Array(Re):new Uint16Array(Re);Y=new Float32Array(Y.buffer,0,we*k);let ln=0;for(I=0;I<we-2;++I)ot[ln++]=ve,ot[ln++]=I,ot[ln++]=I+1;ot[ln++]=ve,ot[ln++]=I,ot[ln++]=0;let Dn=[];for(I=W;I>=$;--I)Dn.push(I);let Ht=[];for(I=K;I>=W;--I)Ht.push(I);let kt=[];for(I=J;I>=K;--I)kt.push(I);let be=[];for(be.push(0),I=ve-1;I>=J;--I)be.push(I);r.mesh=new Nf(B.center,Y,ot,Re,we,A,S,ae.fromOrientedBoundingBox(he),eot(e,he.center,s,A,S),B.stride,he,B,Dn,Ht,kt,be)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=kf._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function _4(e,t,n,i,o,r,s,a,c,u,f){let d=rC;d.longitude=P.lerp(t.west,t.east,r),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,TS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,Qq));let h=Zq;return h.x=r,h.y=s,n.encode(i,o*n.stride,p,h,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var b4=new ce;function XN(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,b4),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,b4),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Xit=new H;function $q(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Kit=new H,Jit=new m;function Zit(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=XN(t,n,f.decodeTextureCoordinates(d,o,Lu),Lu),g=XN(t,n,f.decodeTextureCoordinates(d,r,Zq),Zq),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,o),b=f.decodeHeight(d,r),C=n.rectangle;rC.longitude=P.lerp(C.west,C.east,s),rC.latitude=P.lerp(C.south,C.north,a),u.height=rC.height=P.lerp(x,b,h);let T;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(d,o,Xit),S=f.getOctEncodedNormal(d,r,Kit),v=qn.octDecode(A.x,A.y,TS),I=qn.octDecode(S.x,S.y,Jit);T=m.lerp(v,I,h,TS),m.normalize(T,T),qn.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(rC,TS),qn.octEncode(T,u.encodedNormal)}function W_e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(rC,TS);qn.octEncode(s,r.encodedNormal)}function g4(e,t,n,i,o,r,s,a,c,u,f){if(H_e(e,t,a,s,!1,n,i,f)||H_e(e,t,u,c,!0,n,i,f))return f;let p;if(eY(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],$q(r,p,n,i,f),f;let g;if(n===0?i===0?g=y4(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=y4(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=y4(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=y4(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return W_e(e,t,n,i,g,f),f}function y4(e,t,n,i,o,r,s,a){let c=z_e(e,t,!1,n,s,a),u=z_e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function x4(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=$it(e,t,n,i,o,r[u],s[u],a,c);return o}function $it(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,b4),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,b4),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Lu),d=Lu.x,p=Lu.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let x=r,b=e.tile,C=s.encoding,T=s.vertices,A=n.stride,S,v;C.hasWebMercatorT&&(S=Ii.geodeticLatitudeToMercatorAngle(f.south),v=1/(Ii.geodeticLatitudeToMercatorAngle(f.north)-S));for(let I=0;I<g.length;++I){let O=g[I],R=C.decodeTextureCoordinates(T,O,Lu);XN(x,b,R,R);let N=R.x,F=R.y,_=h?N:F;if(_<0||_>1||Math.abs(N-d)<P.EPSILON5&&Math.abs(F-p)<P.EPSILON5)continue;let E=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5,w=Math.abs(F)<P.EPSILON5||Math.abs(F-1)<P.EPSILON5;if(E&&w)continue;let D=C.decodePosition(T,O,TS),M=C.decodeHeight(T,O),B;C.hasVertexNormals?B=C.getOctEncodedNormal(T,O,Jq):(B=Jq,B.x=0,B.y=0);let V=F;if(C.hasWebMercatorT){let G=P.lerp(f.south,f.north,F);V=(Ii.geodeticLatitudeToMercatorAngle(G)-S)*v}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(D,Qq)),n.encode(i,o*A,D,R,M,B,V,U),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++o}return o}function z_e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!eY(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function eY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function H_e(e,t,n,i,o,r,s,a){let c,u,f,d,p,g=i[o?0:n.length-1],h=n[o?0:n.length-1];if(eY(g,h)&&(r===0?s===0?(c=o?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=o,f=o):(c=o?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!o,f=!0):(c=o?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,Lu);let x=XN(g,e.tile,Lu,Lu);if(x.x===r&&x.y===s)return $q(h,p,r,s,a),!0;if(d=Do(c,u?r:s,function(b,C){h.encoding.decodeTextureCoordinates(h.vertices,b,Lu);let T=XN(g,e.tile,Lu,Lu);return f?u?T.x-r:T.y-s:u?r-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return Zit(t,g,e.tile,h,c[d-1],c[d],r,s,u,a),!0}else return $q(h,c[d],r,s,a),!0}return!1}var Qit=[new m,new m,new m,new m];function eot(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Qit;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var ES=AS;function er(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=bn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(er.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(er.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(er.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(er.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(er.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=re.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){let e=this._terrainProvider;if(!l(e)||(l(e._ready)?!e._ready:l(e.ready)&&!e.ready))return!1;if(this._imageryLayers.length===0)return!0;let t=this._imageryLayers.get(0);if(!t.ready)return!1;let n=t.imageryProvider;return l(n._ready)?n._ready:!l(n.ready)||n.ready}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}}});function tot(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}er.prototype.update=function(e){this._imageryLayers._update()};function not(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);if(a.ready){let c=a.imageryProvider;(l(c._ready)?c._ready:!l(c.ready)||c.ready)&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}}er.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(tot)})),not(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)kf._freeVertexArray(t[i]);t.length=0};er.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,o=t.length;i<o;++i){let r=t[i];l(r)&&(r.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};er.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},blending:mn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&ES.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,o=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;K_e(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){K_e(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function J_e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}er.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)J_e(t[n],e)};er.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};er.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};er.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===$n.CULLED_BUT_NEEDED,o=n.terrainState),kf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==lr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,kf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var iot=new ae,Z_e=new ce,oot=new ce,rot=new me;function A4(e,t){if(t.west<t.east)return t;let n=ce.clone(t,oot);return ce.center(e,rot).longitude>0?n.east=P.PI:n.west=-P.PI,n}function $_e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}er.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=$_e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return lr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return lr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=A4(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Z_e);if(!l(f))return lr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=iot,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return lr.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let x=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==tn.INSIDE,x===tn.OUTSIDE)return lr.NONE}let p,g=a.computeVisibility(c);if(g===tn.OUTSIDE?p=lr.NONE:g===tn.INTERSECTING?p=lr.PARTIAL:g===tn.INSIDE&&(p=lr.FULL),p===lr.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===ne.SCENE3D&&!h&&l(n)&&!o){let x=r.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:lr.NONE}return p};er.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var sot=[],aot=[];er.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=sot;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===yo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===fi.FAILED||p.state===fi.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,f=aot;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:$n.NONE;if(p===$n.RENDERED){let g=d.data;if(!l(g))continue;if(!o&&d.data.terrainState===yo.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let x=h[a],b=x.loadingImagery,C=!l(b)||b.state===fi.FAILED||b.state===fi.INVALID,T=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[T])return!1}}else p===$n.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var cot=new m;er.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,cot),a=m.magnitude(s);return a<P.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var j_e=new L,T4=new L,lot=new re,uot=new re,fot=new re,dot=new m,q_e=new m,mot=new m,hot=new m;er.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var pot=[new m,new m,new m,new m];function Y_e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=pot;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}er.prototype.computeDistanceToTile=function(e,t){_ot(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function _ot(e,t,n){let i=e.data;i===void 0&&(i=e.data=new kf);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new pf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let b=0;b<d.rectangles.length;b++)if(ce.intersection(e.rectangle,d.rectangles[b])){f=d.heights[b];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let b=0;b<p.rectangles.length;b++)if(ce.intersection(r.rectangle,p.rectangles[b])){g=p.height;break}}let h=i.mesh,x=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)r.minimumHeight=h.minimumHeight,r.maximumHeight=h.maximumHeight,c=!0;else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0)r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let b=e.parent;for(;b!==void 0;){let C=b.data;if(C!==void 0){let T=C.mesh,A=C.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0){r.minimumHeight=T.minimumHeight,r.maximumHeight=T.maximumHeight;break}else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0){r.minimumHeight=A._minimumHeight,r.maximumHeight=A._maximumHeight;break}}b=b.parent}u=b}if(r.maximumHeight+=g,r.maximumHeight<f&&(r.maximumHeight=f),r.minimumHeight>f&&(r.minimumHeight=f),u!==void 0){let b=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((b!==1||f!==0)&&(c=!1,r.minimumHeight=Ac.getHeight(r.minimumHeight,b,C),r.maximumHeight=Ac.getHeight(r.maximumHeight,b,C)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Ln.clone(h.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(h.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Y_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let A=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||A)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Y_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}er.prototype.isDestroyed=function(){return!1};er.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function got(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}er.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=got(d,e,n),s.state=ks.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ks.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==$n.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};er.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var yot=new L,xot=new L;function X_e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=L.multiplyByPoint(i,this.properties.rtc,q_e);return L.setTranslation(i,o,j_e),j_e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=L.multiplyByPoint(i,this.properties.rtc,q_e);return L.setTranslation(i,r,T4),L.multiply(o,T4,T4),T4},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?L.multiply(e.context.uniformState.view,i.modelMatrix,yot):L.IDENTITY;return L.inverseTranspose(o,xot)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return l(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return l(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new re(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new L,tileRectangle:new re,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new re,minMaxHeight:new H,scaleAndBias:new L,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new re,frontFaceAlphaByDistance:new re,backFaceAlphaByDistance:new re,localizedTranslucencyRectangle:new re,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new re,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=_t(n,i)}return l(t.materialUniformMap)?_t(n,t.materialUniformMap):n}function bot(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Cot(e,r,o),i.wireframeVertexArray.mesh=o}}function Cot(e,t,n){let o={indices:n.indices,primitiveType:Fe.TRIANGLES};kn.toWireframe(o);let r=o.indices,s=ht.createIndexBuffer({context:e,typedArray:r,usage:ke.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ri({context:e,attributes:t._attributes,indexBuffer:s})}var Q_e,ege,E4;(function(){let e=new Ct({geometry:od.fromDimensions({dimensions:new m(2,2,2)})}),t=new Ct({geometry:new e_({radius:1})}),n=new L,i,o;function r(s){return new In({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}Q_e=function(s,a){return s===i||(E4(),i=s,n=L.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=zt.fromColor(a),o=r(e)),o},ege=function(s,a){return s===i||(E4(),i=s,n=L.fromTranslation(s.center,n),n=L.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=zt.fromColor(a),o=r(t)),o},E4=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Tot=new re(0,0,0,0),Aot={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Eot=z.TRANSPARENT,Sot=new Rt;function K_e(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new ES(t)),o.fill.update(e,n));let r=n.creditDisplay,s=o.terrainData;if(l(s)&&l(s.credits)){let at=s.credits;for(let Jt=0,di=at.length;Jt<di;++Jt)r.addCreditToNextFrame(at[Jt])}let a=Gt.maximumTextureImageUnits,c=o.waterMaskTexture,u=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,u=o.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,x=d.rectangle,b=y(e.undergroundColor,Eot),C=y(e.undergroundColorAlphaByDistance,Sot),T=$_e(e,n)&&n.mode===ne.SCENE3D&&b.alpha>0&&(C.nearValue>0||C.farValue>0),A=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,v=e.hasWaterMask&&l(c),I=e.oceanNormalMap,O=v&&l(I),R=e.terrainProvider,N=l(R)&&(l(R._ready)?R._ready:!l(R.ready)||R.ready)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!f,_=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=bn.castShadows(e.shadows)&&!p,w=bn.receiveShadows(e.shadows)&&!p,D=e.hueShift,M=e.saturationShift,B=e.brightnessShift,V=!(P.equalsEpsilon(D,0,P.EPSILON7)&&P.equalsEpsilon(M,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),U=!1;if(_){let at=m.magnitude(n.camera.positionWC),Jt=e.nightFadeOutDistance;U=at>Jt}v&&--a,O&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let G=o.renderedMesh,k=G.center,Y=G.encoding,j=o.tileBoundingRegion,$=n.terrainExaggeration,W=n.terrainExaggerationRelativeHeight,K=e.marsOptions?.uplift;i&&K&&(W=n.terrainExaggerationRelativeHeight-K.height/($-1));let J=$!==1,he=Y.hasGeodeticSurfaceNormals,ge=lot,se=0,_e=0,xe=0,Pe=0,ve=!1;if(n.mode!==ne.SCENE3D){let at=n.mapProjection,Jt=at.project(ce.southwest(t.rectangle),mot),di=at.project(ce.northeast(t.rectangle),hot);if(ge.x=Jt.x,ge.y=Jt.y,ge.z=di.x,ge.w=di.y,n.mode!==ne.MORPHING&&(k=dot,k.x=0,k.y=(ge.z+ge.x)*.5,k.z=(ge.w+ge.y)*.5,ge.x-=k.y,ge.y-=k.z,ge.z-=k.y,ge.w-=k.z),n.mode===ne.SCENE2D&&Y.quantization===Bs.BITS12){let Ze=1/(Math.pow(2,12)-1)*.5,jr=(ge.z-ge.x)*Ze,qr=(ge.w-ge.y)*Ze;ge.x-=jr,ge.y-=qr,ge.z+=jr,ge.w+=qr}at instanceof Ii&&(se=t.rectangle.south,_e=t.rectangle.north,xe=Ii.geodeticLatitudeToMercatorAngle(se),Pe=1/(Ii.geodeticLatitudeToMercatorAngle(_e)-xe),ve=!0)}let we=Aot;we.frameState=n,we.surfaceTile=o,we.showReflectiveOcean=v,we.showOceanWaves=O,we.enableLighting=e.enableLighting,we.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,we.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,we.showGroundAtmosphere=_,we.atmosphereLightIntensity=e.atmosphereLightIntensity,we.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,we.atmosphereMieCoefficient=e.atmosphereMieCoefficient,we.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,we.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,we.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,we.perFragmentGroundAtmosphere=U,we.hasVertexNormals=N,we.useWebMercatorProjection=ve,we.clippedByBoundaries=o.clippedByBoundaries,we.hasGeodeticSurfaceNormals=he,we.hasExaggeration=J;let ze=o.imagery,Re=0,dt=ze.length,Tt=e.showSkirts&&!f&&!p,ot=e.backFaceCulling&&!f&&!p,ln=ot?e._renderState:e._disableCullingRenderState,Dn=ot?e._blendRenderState:e._disableCullingBlendRenderState,Ht=ln,kt=e._firstPassInitialColor,be=n.context;if(l(e._debug.boundingSphereTile)||E4(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let at=e._drawCommands.length;for(let Jt=0;Jt<at;++Jt)e._uniformMaps[Jt]=X_e(n,e)}do{let at=0,Jt,di;if(e._drawCommands.length<=e._usedDrawCommands?(Jt=new nt,Jt.owner=t,Jt.cull=!1,Jt.boundingVolume=new ae,Jt.orientedBoundingBox=void 0,di=X_e(n,e),e._drawCommands.push(Jt),e._uniformMaps.push(di)):(Jt=e._drawCommands[e._usedDrawCommands],di=e._uniformMaps[e._usedDrawCommands]),Jt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let fr=j.boundingVolume,No=j.boundingSphere;l(fr)?Q_e(fr,z.RED).update(n):l(No)&&ege(No,z.RED).update(n)}let Ze=di.properties;re.clone(kt,Ze.initialColor),Ze.oceanNormalMap=I,Ze.lightingFadeDistance.x=e.lightingFadeOutDistance,Ze.lightingFadeDistance.y=e.lightingFadeInDistance,Ze.nightFadeDistance.x=e.nightFadeOutDistance,Ze.nightFadeDistance.y=e.nightFadeInDistance,Ze.atmosphereLightIntensity=e.atmosphereLightIntensity,Ze.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ze.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ze.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ze.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ze.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ze.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let jr=f?h:g,qr=f?g:h;l(jr)&&(re.fromElements(jr.near,jr.nearValue,jr.far,jr.farValue,Ze.frontFaceAlphaByDistance),re.fromElements(qr.near,qr.nearValue,qr.far,qr.farValue,Ze.backFaceAlphaByDistance)),re.fromElements(C.near,C.nearValue,C.far,C.farValue,Ze.undergroundColorAlphaByDistance),z.clone(b,Ze.undergroundColor),Ze.lambertDiffuseMultiplier=A,Ze.vertexShadowDarkness=S;let ha=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ha&&z.clone(e.fillHighlightColor,Ze.fillHighlightColor),Ze.terrainExaggerationAndRelativeHeight.x=$,Ze.terrainExaggerationAndRelativeHeight.y=W,Ze.center3D=G.center,m.clone(k,Ze.rtc),re.clone(ge,Ze.tileRectangle),Ze.southAndNorthLatitude.x=se,Ze.southAndNorthLatitude.y=_e,Ze.southMercatorYAndOneOverHeight.x=xe,Ze.southMercatorYAndOneOverHeight.y=Pe;let ts=uot,Ne=A4(t.rectangle,e.cartographicLimitRectangle),rt=fot,$e=A4(t.rectangle,x);m.fromElements(D,M,B,Ze.hsbShift);let We=t.rectangle,mt=1/We.width,Vt=1/We.height;ts.x=(Ne.west-We.west)*mt,ts.y=(Ne.south-We.south)*Vt,ts.z=(Ne.east-We.west)*mt,ts.w=(Ne.north-We.south)*Vt,re.clone(ts,Ze.localizedCartographicLimitRectangle),rt.x=($e.west-We.west)*mt,rt.y=($e.south-We.south)*Vt,rt.z=($e.east-We.west)*mt,rt.w=($e.north-We.south)*Vt;let Tn=e.marsOptions?.flat;if(Tn){let fr=Tn.areas,No=0;fr?(fr.forEach(_a=>{No<_a.length&&(No=_a.length)}),Ze.mars_flat_AreaWidth=fr.length):Ze.mars_flat_AreaWidth=0,Ze.mars_flat_AreaHeight=No,Ze.mars_flat_AreaTexture=Tn.texture,Ze.mars_flat_enabled=Tn.enabled}else Ze.mars_flat_enabled=!1,Ze.mars_flat_AreaWidth=0,Ze.mars_flat_AreaHeight=0,Ze.mars_flat_AreaTexture=void 0;Ze.inverseTileWidth=mt,Ze.cartographicTileRectangle=new H(We.west,We.south);let Qn=e.marsOptions?.uplift;if(Qn){let fr=Qn.areas,No=0;fr?(fr.forEach(_a=>{No<_a.length&&(No=_a.length)}),Ze.mars_uplift_RectangleWidth=fr.length):Ze.mars_uplift_RectangleWidth=0,Ze.mars_uplift_RectangleHeight=No,Ze.mars_uplift_RampRectangle=Qn.texture,Ze.mars_uplift_enabled=(!Qn.showUp||Qn.enabled&&e._topographicUpliftHeight!==0)&&l(Qn.rectangles)&&Qn.rectangles.length>0,Ze.mars_uplift_hideInsideOrOutside=!i}else Ze.mars_uplift_enabled=!1,Ze.mars_uplift_hideInsideOrOutside=!1,Ze.mars_uplift_RectangleWidth=0,Ze.mars_uplift_RectangleHeight=0,Ze.mars_uplift_RampRectangle=void 0;re.clone(rt,Ze.localizedTranslucencyRectangle);let Ao=F&&P.fog(t._distance,n.fog.density)>P.EPSILON3;V=V&&(Ao||_);let ns=!1,is=!1,ur=!1,ji=!1,os=!1,Kn=!1,Fn=!1,dn=!1,bi=!1,qi=!1,rs=!1,lo=!1;for(;at<a&&Re<dt;){let fr=ze[Re],No=fr.readyImagery;if(++Re,!l(No)||No.imageryLayer.alpha===0)continue;let _a=fr.useWebMercatorT?No.textureWebMercator:No.texture,Yi=No.imageryLayer;l(fr.textureTranslationAndScale)||(fr.textureTranslationAndScale=Yi._calculateTextureTranslationAndScale(t,fr)),Ze.dayTextures[at]=_a,Ze.dayTextureTranslationAndScale[at]=fr.textureTranslationAndScale,Ze.dayTextureTexCoordsRectangle[at]=fr.textureCoordinateRectangle,Ze.dayTextureUseWebMercatorT[at]=fr.useWebMercatorT,Ze.dayTextureAlpha[at]=Yi.alpha,Kn=Kn||Ze.dayTextureAlpha[at]!==1,Ze.dayTextureNightAlpha[at]=Yi.nightAlpha,Fn=Fn||Ze.dayTextureNightAlpha[at]!==1,Ze.dayTextureDayAlpha[at]=Yi.dayAlpha,Fn=Fn||Ze.dayTextureDayAlpha[at]!==1,Ze.dayTextureBrightness[at]=Yi.brightness,ns=ns||Ze.dayTextureBrightness[at]!==Vs.DEFAULT_BRIGHTNESS,Ze.dayTextureContrast[at]=Yi.contrast,is=is||Ze.dayTextureContrast[at]!==Vs.DEFAULT_CONTRAST,Ze.dayTextureHue[at]=Yi.hue,ur=ur||Ze.dayTextureHue[at]!==Vs.DEFAULT_HUE,Ze.dayTextureSaturation[at]=Yi.saturation,ji=ji||Ze.dayTextureSaturation[at]!==Vs.DEFAULT_SATURATION,Ze.dayTextureOneOverGamma[at]=1/Yi.gamma,os=os||Ze.dayTextureOneOverGamma[at]!==1/Vs.DEFAULT_GAMMA,Ze.dayTextureSplit[at]=Yi.splitDirection,dn=dn||Ze.dayTextureSplit[at]!==0,rs=rs||!!Yi.invertColor,Ze.mars3dTextureInvertColor[at]=!!Yi.invertColor,lo=lo||!!Yi.filterColor,Yi.filterColor?Ze.mars3dTextureFilterColor[at]=new m(Yi.filterColor.red,Yi.filterColor.green,Yi.filterColor.blue):Ze.mars3dTextureFilterColor[at]=new m(1,1,1);let dr=Ze.dayTextureCutoutRectangles[at];if(l(dr)||(dr=Ze.dayTextureCutoutRectangles[at]=new re),re.clone(re.ZERO,dr),l(Yi.cutoutRectangle)){let Gs=A4(We,Yi.cutoutRectangle),K_=ce.simpleIntersection(Gs,We,Z_e);bi=l(K_)||bi,dr.x=(Gs.west-We.west)*mt,dr.y=(Gs.south-We.south)*Vt,dr.z=(Gs.east-We.west)*mt,dr.w=(Gs.north-We.south)*Vt}let Hs=Ze.colorsToAlpha[at];l(Hs)||(Hs=Ze.colorsToAlpha[at]=new re);let Uh=l(Yi.colorToAlpha)&&Yi.colorToAlphaThreshold>0;if(qi=qi||Uh,Uh){let Gs=Yi.colorToAlpha;Hs.x=Gs.red,Hs.y=Gs.green,Hs.z=Gs.blue,Hs.w=Yi.colorToAlphaThreshold}else Hs.w=-1;if(l(No.credits)){let Gs=No.credits;for(let K_=0,l3=Gs.length;K_<l3;++K_)r.addCreditToNextFrame(Gs[K_])}++at}Ze.dayTextures.length=at,Ze.waterMask=c,re.clone(u,Ze.waterMaskTranslationAndScale),Ze.minMaxHeight.x=Y.minimumHeight,Ze.minMaxHeight.y=Y.maximumHeight,L.clone(Y.matrix,Ze.scaleAndBias);let pa=e._clippingPlanes,$f=l(pa)&&pa.enabled&&t.isClipped;$f&&(Ze.clippingPlanesEdgeColor=z.clone(pa.edgeColor,Ze.clippingPlanesEdgeColor),Ze.clippingPlanesEdgeWidth=pa.edgeWidth),we.numberOfDayTextures=at,we.applyBrightness=ns,we.applyContrast=is,we.applyHue=ur,we.applySaturation=ji,we.applyGamma=os,we.applyAlpha=Kn,we.applyDayNightAlpha=Fn,we.applySplit=dn,we.enableFog=Ao,we.enableClippingPlanes=$f,we.clippingPlanes=pa,we.hasImageryLayerCutout=bi,we.colorCorrect=V,we.highlightFillTile=ha,we.colorToAlpha=qi,we.showUndergroundColor=T,we.translucent=p,we.marsOptions={invertColor:rs,filterColor:lo,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let Qf=o.renderedMesh.indices.length;Tt||(Qf=o.renderedMesh.indexCountWithoutSkirts),Jt.shaderProgram=e._surfaceShaderSet.getShaderProgram(we),Jt.castShadows=E,Jt.receiveShadows=w,Jt.renderState=Ht,Jt.primitiveType=Fe.TRIANGLES,Jt.vertexArray=o.vertexArray||o.fill.vertexArray,Jt.count=Qf,Jt.uniformMap=di,Jt.pass=Ae.GLOBE,e._debug.wireframe&&(bot(be,e,t),l(o.wireframeVertexArray)&&(Jt.vertexArray=o.wireframeVertexArray,Jt.primitiveType=Fe.LINES,Jt.count=Qf*2));let el=Jt.boundingVolume,X_=Jt.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,j.minimumHeight,j.maximumHeight,el),m.fromElements(el.center.z,el.center.x,el.center.y,el.center),n.mode===ne.MORPHING&&(el=ae.union(j.boundingSphere,el,el))):(Jt.boundingVolume=ae.clone(j.boundingSphere,el),Jt.orientedBoundingBox=Ln.clone(j.boundingVolume,X_)),Jt.dirty=!0,p&&d.updateDerivedCommands(Jt,n),J_e(Jt,n),Ht=Dn,kt=Tot}while(Re<dt)}var KN=er;function tge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(tge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Rt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Rt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var JN=tge;function ys(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(ys.prototype,{length:{get:function(){return this._layers.length}}});ys.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ys.prototype.addImageryProvider=function(e,t){let n=new Vs(e);return this.add(n,t),n};ys.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ys.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};ys.prototype.contains=function(e){return this.indexOf(e)!==-1};ys.prototype.indexOf=function(e){return this._layers.indexOf(e)};ys.prototype.get=function(e){return this._layers[e]};function S4(e,t){return e.indexOf(t)}function nge(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}ys.prototype.raise=function(e){let t=S4(this._layers,e);nge(this,t,t+1)};ys.prototype.lower=function(e){let t=S4(this._layers,e);nge(this,t,t-1)};ys.prototype.raiseToTop=function(e){let t=S4(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};ys.prototype.lowerToBottom=function(e){let t=S4(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var vot=new ce;function ige(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let d=vot,p=1/1024;d.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(u)}}ys.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[];if(ige(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};ys.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(ige(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};ys.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ys.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ys.prototype.isDestroyed=function(){return!1};ys.prototype.destroy=function(){return this.removeAll(!0),ue(this)};ys.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var ZN=ys;function oge(e){this._ellipsoid=new u_(e.ellipsoid,m.ZERO)}Object.defineProperties(oge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var $N=oge;function Xc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=$n.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ks.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Xc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Xc({tilingScheme:e,x:s,y:r,level:0});return i};Xc.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Xc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Xc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ks.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Xc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Xc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Xc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Xc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Xc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Xc.prototype.freeResources=function(){this.state=ks.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),v4(this._southwestChild),this._southwestChild=void 0,v4(this._southeastChild),this._southeastChild=void 0,v4(this._northwestChild),this._northwestChild=void 0,v4(this._northeastChild),this._northeastChild=void 0};function v4(e){l(e)&&e.freeResources()}var QN=Xc;function w4(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}w4.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};w4.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),rge(this,t)),t=i}};function rge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}w4.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&rge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var eF=w4;function Vf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new eF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new $N({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Vf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Vf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function wot(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,age(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Vf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ks.START&&e(t),t=t.replacementNext};Vf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Vf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Vf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function age(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Vf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(wot(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),age(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Vf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Oot(this,e),zot(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Iot(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Vf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Bot(this,e),Vot(this,e),Iot(this,e))};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var nF,sge=new me;function Dot(e,t){let n=ce.center(e.rectangle,sge),i=n.longitude-nF.longitude,o=n.latitude-nF.latitude;n=ce.center(t.rectangle,sge);let r=n.longitude-nF.longitude,s=n.latitude-nF.latitude;return i*i+o*o-(r*r+s*s)}var Pot=new m,tF=[];function Oot(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles))if(r.ready){let x=r.tilingScheme;e._levelZeroTiles=QN.createLevelZeroTiles(x);let b=e._levelZeroTiles.length;if(tF.length<b)for(tF=new Array(b),o=0;o<b;++o)tF[o]===void 0&&(tF[o]=new iF)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;nF=t.camera.positionCartographic,a.sort(Dot);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=L.getTranslation(g.transform,Pot);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Oa(e,s,r,t,c,!1,tF[o]):(F_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function F_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function iF(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function cge(){this.southwest=new iF,this.southeast=new iF,this.northwest=new iF,this.northeast=new iF}cge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var iY=new Array(31);for(let e=0;e<iY.length;++e)iY[e]=new cge;function Rot(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Not(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:$n.NONE,g=e.tileProvider;if(s||i){let h=$n.originalResult(p)===$n.RENDERED,x=$n.originalResult(p)===$n.CULLED||p===$n.NONE,b=n.state===ks.DONE,C=h||x||b;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&F_(e,e._tileLoadQueueMedium,n,t),I4(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&F_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){I4(e,n),F_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(Mot(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,O=!1;if(!S&&!v){let R=e._tilesToRender;for(let F=x;F<R.length;++F){let _=R[F];for(;_!==void 0&&_._lastSelectionResult!==$n.KICKED&&_!==n;)_._lastSelectionResult=$n.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,I4(e,n),n._lastSelectionResult=$n.RENDERED;let N=p===$n.RENDERED;!N&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=T,F_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=N,N||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&F_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,I4(e,n),F_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Mot(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=iY[t.level],p=d.southwest,g=d.southeast,h=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Oa(e,t,u,r,f,s,p),Oa(e,n,u,r,f,s,g),Oa(e,i,u,r,f,s,h),Oa(e,o,u,r,f,s,x)):(Oa(e,i,u,r,f,s,h),Oa(e,t,u,r,f,s,p),Oa(e,o,u,r,f,s,x),Oa(e,n,u,r,f,s,g)):c.latitude<t.rectangle.north?(Oa(e,n,u,r,f,s,g),Oa(e,t,u,r,f,s,p),Oa(e,o,u,r,f,s,x),Oa(e,i,u,r,f,s,h)):(Oa(e,o,u,r,f,s,x),Oa(e,i,u,r,f,s,h),Oa(e,n,u,r,f,s,g),Oa(e,t,u,r,f,s,p)),d.combine(a)}function Lot(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Oa(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==lr.NONE)return Rot(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Lot(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&F_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:$n.NONE;c!==$n.CULLED_BUT_NEEDED&&c!==$n.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=$n.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(F_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=$n.CULLED):t._lastSelectionResult=$n.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Not(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof Ar)return Fot(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Fot(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function I4(e,t){e._tilesToRender.push(t)}function Bot(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=yi()+e._loadQueueTimeSlice,s=e._tileProvider,a=tY(e,t,s,r,n,!1);a=tY(e,t,s,r,i,a),tY(e,t,s,r,o,a)}function kot(e,t){return e._loadPriority-t._loadPriority}function tY(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(kot);for(let s=0,a=o.length;s<a&&(yi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var SS=new wn,nY=new me,e0=new m,Uot=[];function Vot(e,t){if(!e.tileProvider.ready)return;let n=Uot;n.length=0;let i=e._tileToUpdateHeights,o=yi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:$n.NONE;(x===$n.RENDERED||x===$n.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],b=d.data.terrainData,C=l(b)&&b.wasCreatedByUpsampling();if(d.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,SS.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,SS.origin);if(!l(S)){let v=0;l(d.data.tileBoundingRegion)&&(v=d.data.tileBoundingRegion.minimumHeight);let I=Math.min(v,-11500),O=m.multiplyByScalar(A,Math.abs(I)+1,e0);m.subtract(x.positionOnEllipsoidSurface,O,SS.origin)}}else me.clone(x.positionCartographic,nY),nY.height=-11500,c.project(nY,e0),m.fromElements(e0.z,e0.x,e0.y,e0),m.clone(e0,SS.origin),m.clone(m.UNIT_X,SS.direction);let T=d.data.pick(SS,a,c,!1,e0);l(T)&&(l(x.callback)&&x.callback(T),x.level=d.level)}if(yi()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function zot(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var oF=Vf;function gm(e){e=y(e,oe.WGS84);let t=new qb({ellipsoid:e}),n=new ZN;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new HN,this._material=void 0,this._surface=new oF({tileProvider:new KN({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Rt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new JN,rY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Se({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=bn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(gm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&rY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,rY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Rt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function rY(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[R_,iS];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(PN),e._surfaceShaderSet.baseVertexShaderSource=new Ge({sources:[R_,iS,ON],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ge({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Hot(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Got=[],Wot={start:0,stop:0};gm.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=Got;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=Ji.raySphere(e,g,Wot);l(h)&&s.push(p)}s.sort(Hot(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var jot=new me;gm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,jot);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var qot=new m,lge=new m,Yot=new me,Xot=new wn;function oY(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}gm.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=oY(n._southwestChild,e)||oY(n._southeastChild,e)||oY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,qot),u=Xot,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),x=m.multiplyByScalar(f,Math.abs(h)+1,lge);m.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,lge);if(l(p))return a.cartesianToCartographic(p,Yot).height};gm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};gm.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready),r=this.showWaterEffect&&o&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let c=this._oceanNormalMapResource,u=c.url;if(l(u)){let f=this;c.fetchImage().then(function(d){u===f._oceanNormalMapResource.url&&(f._oceanNormalMap=f._oceanNormalMap&&f._oceanNormalMap.destroy(),f._oceanNormalMap=new Lt({context:e.context,source:d}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let s=e.passes,a=e.mode;s.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=a===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};gm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};gm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var rF=gm;var sY={position:0};function D4(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=new L,this._computedModelMatrix=new L,this.show=y(e.show,!0),this.material=y(e.material,zi.fromType(zi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:y(e._owner,this)}),this._pickCommand=new nt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Kot(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=rl.createGeometry(rl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Me.POSITION_ONLY}));return t=ri.fromGeometry({context:e,geometry:n,attributeLocations:sY,bufferUsage:ke.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}D4.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?mn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Kot(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!L.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(L.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),L.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ge({sources:[nS]}),p=new Ge({sources:[this.material.shaderSource,tS]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:sY}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=_t(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ae.TRANSLUCENT:Ae.OPAQUE,g.push(f)),h.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Ge({sources:[nS]}),p=new Ge({sources:[this.material.shaderSource,tS],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Zt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:sY}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=_t(_t(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ae.TRANSLUCENT:Ae.OPAQUE,g.push(x)}};D4.prototype.isDestroyed=function(){return!1};D4.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var sF=D4;function aF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,oe.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new sF({radii:this.ellipsoid.radii,material:zi.fromType(zi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new iN}Object.defineProperties(aF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var P4=new Z,Jot=new Z,Zot=new m,O4=[];aF.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,P4))||Mt.computeTemeToPseudoFixedMatrix(n,P4);let i=this._axes.evaluate(n,Jot);Z.transpose(i,i),Z.multiply(P4,i,i);let o=Jy.computeMoonPositionInEarthInertialFrame(n,Zot);Z.multiplyByVector(P4,o,o),L.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=O4,O4.length=0,t.update(e),e.commandList=r,O4.length===1?O4[0]:void 0};aF.prototype.isDestroyed=function(){return!1};aF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var cF=aF;function lF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(lF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function $ot(e,t,n){let i=t.createViewportQuadCommand(bN,{framebuffer:n,renderState:Ve.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}lF.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Lt({context:t,width:256,height:256,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST});this._colorTexture=n;let i=new ea({context:t,colorTextures:[n],destroyAttachments:!1});$ot(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};lF.prototype.isDestroyed=function(){return!1};lF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var uF=lF;var mge={};function Qot(e,t,n){let i,o,r;if(e instanceof Si){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof qc)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var ert=new m,uge=new m;function hge(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(o){return P.lerp(e,t,o)}}function cY(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,ert),g=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),uge)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),uge));r=Math.min(Qot(d,g,h)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function fF(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var pge=new m;function trt(e,t,n,i,o,r,s,a){let c=e.camera,u=m.clone(c.position,pge),f=c.pitch,d=fF(c.heading,i),p=fF(c.roll,r),g=cY(c,n,u.z,n.z,s),h=hge(f,o,g,a);function x(b){let C=b.time/t;c.setView({orientation:{heading:P.lerp(d,i,C),pitch:h(C),roll:P.lerp(p,r,C)}}),H.lerp(u,n,C,c.position),c.position.z=g(C)}return x}function nrt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function irt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var ort=new me,rrt=new me;function srt(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=me.clone(f.positionCartographic,ort),h=f.pitch,x=fF(f.heading,i),b=fF(f.roll,r),C=p.cartesianToCartographic(n,rrt);g.longitude=P.zeroToTwoPi(g.longitude),C.longitude=P.zeroToTwoPi(C.longitude);let T=!1;if(l(a)){let I=P.zeroToTwoPi(a),O=Math.min(g.longitude,C.longitude),R=Math.max(g.longitude,C.longitude),N=I>=O&&I<=R;if(l(c)){let F=Math.abs(g.longitude-C.longitude),_=P.TWO_PI-F;(N?F:_)<(N?_:F)*c&&!N&&(T=!0)}else N||(T=!0)}T?nrt(g,C):irt(g,C);let A=cY(f,n,g.height,C.height,s),S=hge(h,o,A,u);function v(){let I=g.longitude,O=C.longitude,R=g.latitude,N=C.latitude;return function(_){let E=_.time/t,w=m.fromRadians(P.lerp(I,O,E),P.lerp(R,N,E),A(E),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,E),pitch:S(E),roll:P.lerp(b,r,E)}})}}return v()}function art(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,pge),u=fF(a.heading,i),f=a.frustum.right-a.frustum.left,d=cY(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,h)}}),H.lerp(c,n,h,a.position);let x=d(h),b=a.frustum,C=b.top/b.right,T=(x-(b.right-b.left))*.5;b.right+=T,b.left-=T,b.top=C*b.right,b.bottom=-b.top}return p}var fge=new me,crt=new m;function aY(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function dge(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}mge.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return aY();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,fge),n=r.project(fge,crt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let h=t.duration;l(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),C=y(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let A=dge(T,t.complete),S=dge(T,t.cancel),v=p.frustum,I=e.mode===ne.SCENE2D;if(I=I&&H.equalsEpsilon(p.position,n,P.EPSILON6),I=I&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),I=I||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,P.EPSILON10),I=I&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(C),P.negativePiToPi(p.roll),P.EPSILON10),I)return aY(A,S);let O=new Array(4);if(O[ne.SCENE2D]=art,O[ne.SCENE3D]=srt,O[ne.COLUMBUS_VIEW]=trt,h<=0)return aY(function(){O[i](e,1,n,x,b,C,a,c,u,f)({time:1}),typeof A=="function"&&A()},S);let R=O[i](e,h,n,x,b,C,a,c,u,f);if(!l(d)){let N=p.positionCartographic.height,F=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;N>F&&N>11500?d=Mr.CUBIC_OUT:d=Mr.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:R,complete:A,cancel:S}};var dF=mge;var lrt={ROTATE:0,INFINITE_SCROLL:1},Fl=Object.freeze(lrt);function en(e){this._scene=e,this._transform=L.clone(L.IDENTITY),this._invTransform=L.clone(L.IDENTITY),this._actualTransform=L.clone(L.IDENTITY),this._actualInvTransform=L.clone(L.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Si,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new pe,this._moveEnd=new pe,this._changed=new pe,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new L,this._invViewMatrix=new L,Age(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,Nge(this,en.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*en.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}en.TRANSFORM_2D=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);en.TRANSFORM_2D_INVERSE=L.inverseTransformation(en.TRANSFORM_2D,new L);en.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);en.DEFAULT_VIEW_FACTOR=.5;en.DEFAULT_OFFSET=new hu(0,-P.PI_OVER_FOUR,0);function Age(e){L.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),L.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),L.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function urt(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=yi()):e.timeSinceMoved=Math.max(yi()-e._lastMovedTimestamp,0)/1e3}}en.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};en.prototype._updateCameraChanged=function(){let e=this;if(urt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;if(o>t&&(e._changed.raiseEvent(o),e._changedHeading=n),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,h=u.x+d.right,x=f.x+p.left,b=f.x+p.right,C=u.y+d.bottom,T=u.y+d.top,A=f.y+p.bottom,S=f.y+p.top,v=Math.max(g,x),I=Math.min(h,b),O=Math.max(C,A),R=Math.min(T,S),N;if(v>=I||O>=T)N=1;else{let F=p;g<x&&h>b&&C<A&&T>S&&(F=d),N=1-(I-v)*(R-O)/((F.right-F.left)*(F.top-F.bottom))}N>t&&(e._changed.raiseEvent(N),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let r=P.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=r/(e.frustum.fovy*.5):s=r;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function frt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var drt=new me,mrt=new m,R4=new m,hrt=new re,prt=new re,_rt=new re,grt=new re,yrt=new re;function xrt(e){let t=e._projection,n=t.ellipsoid,i=L.getColumn(e._transform,3,hrt),o=n.cartesianToCartographic(i,drt),r=t.project(o,mrt),s=prt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=re.clone(re.UNIT_X,yrt),c=re.add(L.getColumn(e._transform,0,R4),i,R4);n.cartesianToCartographic(c,o),t.project(o,r);let u=_rt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0;let f=grt;if(m.magnitudeSquared(u)>P.EPSILON10)m.cross(a,u,f);else{let d=re.add(L.getColumn(e._transform,1,R4),i,R4);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)<P.EPSILON10&&(re.clone(re.UNIT_Y,u),re.clone(re.UNIT_Z,f))}m.cross(f,a,u),m.normalize(u,u),m.cross(a,u,f),m.normalize(f,f),L.setColumn(e._actualTransform,0,u,e._actualTransform),L.setColumn(e._actualTransform,1,f,e._actualTransform),L.setColumn(e._actualTransform,2,a,e._actualTransform),L.setColumn(e._actualTransform,3,s,e._actualTransform)}var lY=new m;function pc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,u=!m.equals(c,e.up);u&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let f=e._right,d=!m.equals(f,e.right);d&&(m.normalize(e.right,e.right),f=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(L.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?L.equals(L.IDENTITY,e._transform)?L.clone(en.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?frt(e):xrt(e):L.clone(e._transform,e._actualTransform),L.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=L.multiplyByPoint(g,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=lY;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===ne.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||u||d){let h=m.dot(s,m.cross(c,f,lY));if(Math.abs(1-h)>P.EPSILON2){let x=1/m.magnitudeSquared(c),b=m.dot(c,s)*x,C=m.multiplyByScalar(s,b,lY);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=L.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=L.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=L.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&Age(e)}function Ege(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function Sge(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function vge(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var N4=new L,F4=new L;Object.defineProperties(en.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return pc(this),this._invTransform}},viewMatrix:{get:function(){return pc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return pc(this),this._invViewMatrix}},positionCartographic:{get:function(){return pc(this),this._positionCartographic}},positionWC:{get:function(){return pc(this),this._positionWC}},directionWC:{get:function(){return pc(this),this._directionWC}},upWC:{get:function(){return pc(this),this._upWC}},rightWC:{get:function(){return pc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,N4),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,F4);this._setTransform(n);let i=Ege(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,N4),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,F4);this._setTransform(n);let i=Sge(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,N4),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,F4);this._setTransform(n);let i=vge(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});en.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&Pge(this,this.position)};var brt=new m,Crt=new m,Trt=new m;en.prototype._setTransform=function(e){let t=m.clone(this.positionWC,brt),n=m.clone(this.upWC,Crt),i=m.clone(this.directionWC,Trt);L.clone(e,this._transform),this._transformChanged=!0,pc(this);let o=this._actualInvTransform;L.multiplyByPoint(o,t,this.position),L.multiplyByPointAsVector(o,i,this.direction),L.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),pc(this)};var Art=new H,Ert=new wn,Srt=new m,vrt=new m;function wge(e){if(!L.equals(L.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Art;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,Ert);o=n.pickWorldCoordinates(a,t,!0,Srt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,vrt));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}en.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=wge(this)))};var B4=new m,hY=new L,wrt=new L,pY=new Be,_Y=new Z,Ige=new me;function Irt(e,t,n){let i=L.clone(e.transform,hY),o=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,wrt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Be.fromHeadingPitchRoll(n,pY),s=Z.fromQuaternion(r,_Y);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Drt(e,t,n,i){let o=L.clone(e.transform,hY);if(e._setTransform(L.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Ige);t=a.project(c,B4)}m.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Be.fromHeadingPitchRoll(n,pY),s=Z.fromQuaternion(r,_Y);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Prt(e,t,n,i){let o=L.clone(e.transform,hY);if(e._setTransform(L.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Ige);t=c.project(u,B4)}H.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Fl.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Be.fromHeadingPitchRoll(n,pY),s=Z.fromQuaternion(r,_Y);Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Ort=new m,Rrt=new m,Mrt=new m;function Dge(e,t,n,i){let o=m.clone(n.direction,Ort),r=m.clone(n.up,Rrt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,N4),u=L.inverseTransformation(c,F4);L.multiplyByPointAsVector(u,o,o),L.multiplyByPointAsVector(u,r,r)}let s=m.cross(o,r,Mrt);return i.heading=Ege(o,r),i.pitch=Sge(o),i.roll=vge(o,r,s),i}var mY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},vS=new za;en.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,m.clone(this.positionWC,B4));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,B4),i=!1),l(t.direction)&&(t=Dge(this,o,t,mY.orientation)),vS.heading=y(t.heading,0),vS.pitch=y(t.pitch,-P.PI_OVER_TWO),vS.roll=y(t.roll,0),n===ne.SCENE3D?Irt(this,o,vS):n===ne.SCENE2D?Prt(this,o,vS,i):Drt(this,o,vS,i)};var Lrt=new m;en.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:en.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:L.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(en.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*en.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:L.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Lrt).z),roll:0},endTransform:L.IDENTITY,convert:!1})}};en.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new re),pc(this),L.multiplyByVector(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),pc(this),L.multiplyByPoint(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),pc(this),L.multiplyByPointAsVector(this._actualInvTransform,e,t)};en.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new re),pc(this),L.multiplyByVector(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),pc(this),L.multiplyByPoint(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),pc(this),L.multiplyByPointAsVector(this._actualTransform,e,t)};function Pge(e,t){let n=e._scene.mapMode2D===Fl.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var _ge=new m;en.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,_ge),m.add(n,_ge,n),this._mode===ne.SCENE2D&&Pge(this,n),this._adjustOrthographicFrustum(!0)};en.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?k4(this,e):this.move(this.direction,e)};en.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?k4(this,-e):this.move(this.direction,-e)};en.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};en.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};en.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};en.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};en.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};en.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};en.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};en.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Nrt=new Be,Frt=new Z;en.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Be.fromAxisAngle(e,-n,Nrt),o=Z.fromQuaternion(i,Frt),r=this.direction,s=this.up,a=this.right;Z.multiplyByVector(o,r,r),Z.multiplyByVector(o,s,s),Z.multiplyByVector(o,a,a)};en.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};en.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Brt=new Be,krt=new Z;en.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Be.fromAxisAngle(e,-n,Brt),o=Z.fromQuaternion(i,krt);Z.multiplyByVector(o,this.position,this.position),Z.multiplyByVector(o,this.direction,this.direction),Z.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};en.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Oge(this,e)};en.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Oge(this,-e)};var Urt=new m,Vrt=new m,zrt=new m,gge=new m;function Oge(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,P.EPSILON2)){let i=m.normalize(n,Urt),o=m.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,gge),P.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,Vrt),a=m.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=m.dot(i,m.negate(s,gge)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=m.cross(s,i,zrt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}en.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Rge(this,-e)};en.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Rge(this,e)};function Rge(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function k4(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Fl.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Fl.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Mge(e,t){e.move(e.direction,t)}en.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?k4(this,e):Mge(this,e)};en.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?k4(this,-e):Mge(this,-e)};en.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Hrt=new L;en.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,oe.WGS84,Hrt);this.lookAtTransform(n,t)};var Grt=new m,Wrt=new Be,jrt=new Be,qrt=new Z;function Lge(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Be.fromAxisAngle(m.UNIT_Y,-t,Wrt),o=Be.fromAxisAngle(m.UNIT_Z,-e,jrt),r=Be.multiply(o,i,o),s=Z.fromQuaternion(r,qrt),a=m.clone(m.UNIT_X,Grt);return Z.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}en.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Lge(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<P.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(L.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<P.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var mF=new me,Yrt=new me,Xrt=new m,Krt=new m,Jrt=new m,Zrt=new m,$rt=new m,Qrt=new m,est=new m,uY=new m,tst={direction:new m,right:new m,up:new m},yge;function hc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Nge(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:tst,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=P.TWO_PI);let f=(u+c)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let N=mF;N.longitude=f,N.latitude=s,N.height=0;let F=Yrt;F.longitude=f,F.latitude=a,F.height=0;let _=yge;(!l(_)||_.ellipsoid!==o)&&(yge=_=new Ju(void 0,void 0,o)),_.setEndPoints(N,F),d=_.interpolateUsingFraction(.5,mF).latitude}let p=mF;p.longitude=f,p.latitude=d,p.height=0;let g=o.cartographicToCartesian(p,est),h=mF;h.longitude=c,h.latitude=s;let x=o.cartographicToCartesian(h,Xrt);h.longitude=u;let b=o.cartographicToCartesian(h,Jrt);h.longitude=f;let C=o.cartographicToCartesian(h,$rt);h.latitude=a;let T=o.cartographicToCartesian(h,Qrt);h.longitude=c;let A=o.cartographicToCartesian(h,Zrt);h.longitude=u;let S=o.cartographicToCartesian(h,Krt);m.subtract(b,g,b),m.subtract(A,g,A),m.subtract(x,g,x),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(T,g,T);let v=o.geodeticSurfaceNormal(g,r.direction);m.negate(v,v);let I=m.cross(v,m.UNIT_Z,r.right);m.normalize(I,I);let O=m.cross(I,v,r.up),R;if(e.frustum instanceof on){let N=Math.max(m.distance(x,b),m.distance(A,S)),F=Math.max(m.distance(x,A),m.distance(b,S)),_,E,w=e.frustum._offCenterFrustum,D=w.right/w.top,M=F*D;N>M?(_=N,E=_/D):(E=F,_=M),R=Math.max(_,E)}else{let N=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*N;if(R=Math.max(hc(v,O,b,N),hc(v,O,A,N),hc(v,O,x,N),hc(v,O,S,N),hc(v,O,C,N),hc(v,O,T,N),hc(v,I,b,F),hc(v,I,A,F),hc(v,I,x,F),hc(v,I,S,F),hc(v,I,C,F),hc(v,I,T,F)),a<0&&s>0){let _=mF;_.longitude=u,_.latitude=0,_.height=0;let E=o.cartographicToCartesian(_,uY);m.subtract(E,g,E),R=Math.max(R,hc(v,O,E,N),hc(v,I,E,F)),_.longitude=c,E=o.cartographicToCartesian(_,uY),m.subtract(E,g,E),R=Math.max(R,hc(v,O,E,N),hc(v,I,E,F))}}return m.add(g,m.multiplyByScalar(v,-R,uY),n)}var nst=new me,ist=new m,ost=new m;function rst(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=nst;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,ist);L.multiplyByPoint(o,a,a),L.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,ost);if(L.multiplyByPoint(o,c,c),L.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var sst=new me,ast=new m,cst=new m;function lst(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Fl.INFINITE_SCROLL?o+=P.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=sst;r.longitude=o,r.latitude=t.north;let s=i.project(r,ast);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,cst),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}en.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===ne.SCENE3D)return Nge(this,e,t);if(n===ne.COLUMBUS_VIEW)return rst(this,e,t);if(n===ne.SCENE2D)return lst(this,e,t)};var ust=new wn;function fst(e,t,n,i){n=y(n,oe.WGS84);let o=e.getPickRay(t,ust),r=Ji.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return wn.getPoint(o,s,i)}var dst=new wn;function mst(e,t,n,i){let r=e.getPickRay(t,dst).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var hst=new wn;function pst(e,t,n,i){let o=e.getPickRay(t,hst),r=-o.origin.x/o.direction.x;wn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}en.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,oe.WGS84),this._mode===ne.SCENE3D)n=fst(this,e,t,n);else if(this._mode===ne.SCENE2D)n=mst(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=pst(this,e,this._projection,n);else return;return n}};var _st=new m,gst=new m,yst=new m;function xst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,_st);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,u*c*a,gst),h=m.multiplyByScalar(e.upWC,f*c*s,yst),x=m.add(p,g,n.direction);return m.add(x,h,x),m.subtract(x,d,x),m.normalize(x,x),n}var M4=new m;function bst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,M4),m.add(M4,f,f),m.multiplyByScalar(e.up,u,M4),m.add(M4,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}en.prototype.getPickRay=function(e,t){l(t)||(t=new wn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?xst(this,e,t):bst(this,e,t)};var Cst=new m,Tst=new m;en.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Cst),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Tst);return Math.max(0,m.magnitude(n)-e.radius)};var Ast=new H;en.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Ast);return Math.max(o.x,o.y)};function Est(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Mr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Sst=new m,xge=new m,vst=new m,wst=new m;function Ist(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,Sst),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,xge),xge);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,vst);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=m.magnitude(m.subtract(n,s,wst)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-x||n.y>x){let b=s.y<-h||s.y>h,C=s.z<-x||s.z>x;if(b||C)return Est(e,n,s,h,x,t)}}en.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Ist(this,e)};var Dst=new m,zs={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};en.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};en.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=zs.destination,e.orientation.heading=zs.heading,e.orientation.pitch=zs.pitch,e.orientation.roll=zs.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};en.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Dst));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Dge(this,t,o,mY.orientation)),l(e.duration)&&e.duration<=0){let f=mY;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;zs.destination=t,zs.heading=o.heading,zs.pitch=o.pitch,zs.roll=o.roll,zs.duration=e.duration,zs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},zs.cancel=e.cancel,zs.endTransform=e.endTransform,zs.convert=i?!1:e.convert,zs.maximumHeight=e.maximumHeight,zs.pitchAdjustHeight=e.pitchAdjustHeight,zs.flyOverLongitude=e.flyOverLongitude,zs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,zs.easingFunction=e.easingFunction;let a=this._scene,c=dF.createTween(a,zs);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=en.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Pst(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Ost(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Rst=100;function Fge(e,t,n){n=hu.clone(l(n)?n:en.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Rst:e.frustum instanceof on||e._mode===ne.SCENE2D?n.range=Ost(e,s):n.range=Pst(e,s),n.range=P.clamp(n.range,i,o)}return n}en.prototype.viewBoundingSphere=function(e,t){t=Fge(this,e,t),this.lookAt(e.center,t)};var Mst=new L,Lst=new m,Nst=new m,Fst=new m,Bst=new m,kst=new re,Ust=new Be,Vst=new Z;en.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(L.IDENTITY);let i=Fge(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,Lst):o=Lge(i.heading,i.pitch,i.range);let r=Mt.eastNorthUpToFixedFrame(e.center,oe.WGS84,Mst);L.multiplyByPoint(r,o,o);let s,a;if(!n){if(s=m.subtract(e.center,o,Nst),m.normalize(s,s),a=L.multiplyByPointAsVector(r,m.UNIT_Z,Fst),1-Math.abs(m.dot(s,a))<P.EPSILON6){let u=Be.fromAxisAngle(s,i.heading,Ust),f=Z.fromQuaternion(u,Vst);m.fromCartesian4(L.getColumn(r,1,kst),a),Z.multiplyByVector(f,a,a)}let c=m.cross(s,a,Bst);m.cross(c,s,a),m.normalize(a,a)}this.flyTo({destination:o,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var bge=new m,Cge=new m,fY=new m,Tge=new m,hF=[new m,new m,new m,new m];function zst(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,bge),r=m.magnitude(o),s=m.normalize(o,Cge),a,c;m.equalsEpsilon(s,m.UNIT_Z,P.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,fY),fY),c=m.normalize(m.cross(s,a,Tge),Tge));let u=Math.sqrt(m.magnitudeSquared(o)-1),f=m.multiplyByScalar(s,1/r,bge),d=u/r,p=m.multiplyByScalar(a,d,Cge),g=m.multiplyByScalar(c,d,fY),h=m.add(f,g,hF[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let x=m.subtract(f,g,hF[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let b=m.subtract(f,g,hF[2]);m.add(b,p,b),m.multiplyComponents(n,b,b);let C=m.add(f,g,hF[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),hF}var dY=new H,Hst=new m,t0=[new me,new me,new me,new me];function L4(e,t,n,i,o,r){dY.x=e,dY.y=t;let s=i.pickEllipsoid(dY,o,Hst);return l(s)?(t0[n]=o.cartesianToCartographic(s,t0[n]),1):(t0[n]=o.cartesianToCartographic(r[n],t0[n]),0)}en.prototype.computeViewRectangle=function(e,t){e=y(e,oe.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===tn.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=zst(this,e);if(c+=L4(0,0,0,this,e,u),c+=L4(0,a,1,this,e,u),c+=L4(s,a,2,this,e,u),c+=L4(s,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(t0,t);let f=0,d=t0[3].longitude;for(let p=0;p<4;++p){let g=t0[p].longitude,h=Math.abs(g-d);h>P.PI?f+=P.TWO_PI-h:f+=h,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,t0[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};en.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Si)return;let e=this._scene;this.frustum=new Si,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};en.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof on)return;let e=wge(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};en.clone=function(e,t){return l(t)||(t=new en(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),L.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var co=en;function Gst(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var zf=Gst;var zge=Io(Wl(),1),Bge=576,Wst=100,pF="#ffffff",gY="#48b";function Hge(e,t){this.credit=e,this.count=y(t,1)}function Gge(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(wt.equals(o,t))return!0}return!1}function jst(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;wt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Wge="cesium-credit-delimiter";function kge(e){let t=document.createElement("span");return t.textContent=e,t.className=Wge,t}function Uge(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Vge(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(kge(n));else{let f=o[u];f.className!==Wge&&e.replaceChild(kge(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(Uge(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Uge(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function qst(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Bge?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Bge&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function _c(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } +`,n}function Yst(e){let t="";t+=_c(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=_c(".cesium-credit-lightbox",{"background-color":"#303336",color:pF,position:"relative","min-height":`${Wst}px`,margin:"auto"}),t+=_c(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:pF}),t+=_c(".cesium-credit-lightbox > ul > li a:hover",{color:gY}),t+=_c(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=_c(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=_c(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=_c(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:pF}),t+=_c(".cesium-credit-lightbox-close:hover",{color:gY}),t+=_c(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=_c(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=_c(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=_c(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:pF}),t+=_c(".cesium-credit-expand-link:hover",{color:gY}),t+=_c(".cesium-credit-text",{color:pF}),t+=_c(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Lo(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(h){r.contains(h.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Yst(e);let g=wt.clone(Lo.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new At,lightboxCredits:new At},this._defaultCredit=void 0,this.viewport=n,this.container=e}function jge(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Hge(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Lo.prototype.addCredit=function(e){Q("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};Lo.prototype.addCreditToNextFrame=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=wt.clone(qge())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,jge(this,t,e)};Lo.prototype.addDefaultCredit=function(e){Q("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;Gge(t,e)||(e.showOnScreen=!0,t.push(e))};Lo.prototype.addStaticCredit=function(e){let t=this._staticCredits;Gge(t,e)||t.push(e)};Lo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Lo.prototype.removeDefaultCredit=function(e){Q("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};Lo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Lo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Lo.prototype.update=function(){this._expanded&&qst(this)};Lo.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r._isIon&&wt.equals(Lo.cesiumCredit,this._cesiumCredit)||jge(this,s,r,Number.MAX_VALUE)}wt.equals(Lo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=wt.clone(Lo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Lo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Vge(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Vge(this._creditList,t,void 0,"li"),jst(this)};Lo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Lo.prototype.isDestroyed=function(){return!1};Lo._cesiumCredit=void 0;Lo._cesiumCreditInitialized=!1;var U4;function qge(){if(!l(U4)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new zge.default(e).path()),U4=new wt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return Lo._cesiumCreditInitialized||(Lo._cesiumCredit=U4,Lo._cesiumCreditInitialized=!0),U4}Object.defineProperties(Lo,{cesiumCredit:{get:function(){return qge(),Lo._cesiumCredit},set:function(e){Lo._cesiumCredit=e,Lo._cesiumCreditInitialized=!0}}});Lo.CreditDisplayElement=Hge;var _F=Lo;function V4(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Xst=new m,Kst=new Z,Jst=new Be,Zst=new Si,$st=new qc,Qst=new on,eat=new Ar,tat=new z,nat=[1,1e5];V4.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Si?a=Zst:s instanceof qc?a=$st:s instanceof on?a=Qst:a=eat,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=nat,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,Xst);let h=Kst;Z.setColumn(h,0,g,h),Z.setColumn(h,1,p,h),Z.setColumn(h,2,d,h);let x=Be.fromRotationMatrix(h,Jst);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new Ct({geometry:new Xb({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(z.fromAlpha(this._color,.1,tat))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Ct({geometry:new $L({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};V4.prototype.isDestroyed=function(){return!1};V4.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var vh=V4;function yF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var gF=Wt.supportsTypedArrays()?new Float32Array(12):[],Yge=new m,Xge=new m,yY=new m,Kge=new m,z4=new m;function iat(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,Yge),g=m.normalize(p,Xge),h=m.normalize(m.cross(m.UNIT_Z,p,yY),yY),x=m.normalize(m.cross(g,h,Kge),Kge),b=m.magnitude(p),C=Math.sqrt(b*b-1);o=m.multiplyByScalar(g,1/b,Yge);let T=C/b;r=m.multiplyByScalar(h,T,Xge),s=m.multiplyByScalar(x,T,yY)}let a=m.add(o,s,z4);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,gF,0);let c=m.subtract(o,s,z4);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,gF,3);let u=m.add(o,s,z4);m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,gF,6);let f=m.subtract(o,s,z4);return m.add(f,r,f),m.multiplyComponents(n,f,f),m.pack(f,gF,9),gF}yF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new oe(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:Ae.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Ge({sources:[IN]}),a=new Ge({sources:[wN]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=iat(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ft({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Fe.TRIANGLES});this._va=ri.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:ke.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};yF.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};yF.prototype.isDestroyed=function(){return!1};yF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var xF=yF;function bF(){}var oat=/\bgl_FragDepth\b/,rat=/\bdiscard\b/;function sat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource,r,s=!1,a=o.sources,c=a.length;for(r=0;r<c;++r)if(oat.test(a[r])||rat.test(a[r])){s=!0;break}let u=!1,f=o.defines;for(c=f.length,r=0;r<c;++r)if(f[r]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main() +{ + out_FragColor = vec4(1.0); +} +`,o=new Ge({sources:[d]})):!s&&u&&(d=`void main() +{ + out_FragColor = vec4(1.0); + czm_writeLogDepth(); +} +`,o=new Ge({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}function aat(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ve.fromCache(o),n[t.id]=i}return i}bF.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.depthOnlyCommand)&&(o=i.depthOnlyCommand.shaderProgram,r=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=sat(n,t.shaderProgram),i.depthOnlyCommand.renderState=aat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var cat=/\s+czm_writeLogDepth\(/,lat=/\s+czm_vertexLogDepth\(/;function uat(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,u=!1,f=r.sources,d=f.length;for(a=0;a<d;++a)if(lat.test(f[a])){u=!0;break}if(!u){for(a=0;a<d;++a)f[a]=Ge.replaceMain(f[a],"czm_log_depth_main");c=` + +void main() +{ + czm_log_depth_main(); + czm_vertexLogDepth(); +} +`,f.push(c)}for(f=s.sources,d=f.length,u=!1,a=0;a<d;++a)cat.test(f[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<d;a++)f[a]=Ge.replaceMain(f[a],"czm_log_depth_main");p+=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); +} +`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}return i}bF.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=uat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function fat(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let o=t._attributeLocations,r=t.fragmentShaderSource,s=r.sources,a=s.length;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${z.floatToByte(n.color.red)}, ${z.floatToByte(n.color.green)}, ${z.floatToByte(n.color.blue)}, ${z.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let c=`void main() +{ + czm_non_pick_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = ${n}; +} +`,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=Ge.replaceMain(s[f],"czm_non_pick_main");u[a]=c,r=new Ge({sources:u,defines:r.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:o})}return i}function dat(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=Ve.fromCache(o),n[t.id]=i}return i}bF.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.pickCommand)&&(o=i.pickCommand.shaderProgram,r=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=fat(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=dat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function mat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}return n}bF.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=mat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var B_=bF;function H4(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var hat=new Be,Jge=new Be,pat=new Z;function _at(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Be.fromAxisAngle(o,n,Jge),c=Be.fromAxisAngle(r,i,hat),u=Be.multiply(c,a,c),f=Be.fromAxisAngle(s,t,Jge);Be.multiply(f,u,u);let d=Z.fromQuaternion(u,pat);Z.multiplyByVector(d,r,r),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,o,o)}H4.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;_at(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};H4.prototype.isDestroyed=function(){return!1};H4.prototype.destroy=function(){return this._removeListener(),ue(this)};var CF=H4;function Zge(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var G4=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],wh=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<wh.length;++e)wh[e]*=1e6;var $ge=wh[1],xY=wh[wh.length-1];for(let e=0;e<wh.length;++e)wh[e]=(wh[e]-xY)/($ge-xY);var ua=0;function gat(e){let t=G4,n=t.length;if(e<t[0])return ua=0,ua;if(e>t[n-1])return ua=n-2,ua;if(e>=t[ua]){if(ua+1<n&&e<t[ua+1])return ua;if(ua+2<n&&e<t[ua+2])return++ua,ua}else if(ua-1>=0&&e>=t[ua-1])return--ua,ua;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ua=i,ua}var yat=new m;Zge.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let o=i.height,r=gat(o),s=P.clamp((o-G4[r])/(G4[r+1]-G4[r]),0,1),a=P.lerp(wh[r],wh[r+1],s),c=this.density*1e6,u=c/$ge*xY;a=a*(c-u)*1e-6;let f=m.normalize(n.positionWC,yat),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var TF=Zge;function xat(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var AF=xat;var fa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},sC=fa.DERIVED_COMMANDS_MAXIMUM_LENGTH,cye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function aC(){this._frontFaceAlphaByDistance=new Rt(0,1,0,1),this._backFaceAlphaByDistance=new Rt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(sC),this._derivedBlendCommandTypes=new Array(sC),this._derivedPickCommandTypes=new Array(sC),this._derivedCommandTypesToUpdate=new Array(sC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(aC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});aC.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Qge(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Qge(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=eye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=eye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Aat(this,e,t),this._sunVisibleThroughGlobe=bat(this,e),this._environmentVisible=Cat(this,e),this._useDepthPlane=Tat(this,e),this._numberOfTextureUniforms=Eat(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Sat(this,e)};function Qge(e,t,n,i){return e?l(n)?(Rt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function eye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function bat(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Cat(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Tat(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Aat(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function Eat(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Sat(e,t){e._derivedCommandsLength=bY(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=bY(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=bY(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<sC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Vat())}function bY(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?fa.PICK_FRONT_FACE:u?fa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_FRONT_FACE,d=i?fa.PICK_BACK_FACE:u?fa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=fa.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=fa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=fa.DEPTH_ONLY_BACK_FACE),o[r++]=fa.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=fa.DEPTH_ONLY_FRONT_FACE),o[r++]=fa.OPAQUE_BACK_FACE,o[r++]=f),r)}function Hf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function tye(e,t){return e.indexOf(t)>-1}function vat(e,t){Hf(e.defines,"TRANSLUCENT"),Hf(t.defines,"TRANSLUCENT")}function wat(e,t){Hf(e.defines,"GROUND_ATMOSPHERE"),Hf(t.defines,"GROUND_ATMOSPHERE"),Hf(e.defines,"FOG"),Hf(t.defines,"FOG"),Hf(e.defines,"TRANSLUCENT"),Hf(t.defines,"TRANSLUCENT")}function CY(e,t){if(tye(t.defines,"TILE_LIMIT_RECTANGLE")||tye(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function TY(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Ge.replaceMain(n[r],"czm_globe_translucency_main");let o=` + +uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; +#ifdef MANUAL_DEPTH_TEST + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + if (logDepthOrDepth != 0.0) + { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + float depthEC = eyeCoordinate.z / eyeCoordinate.w; + if (v_positionEC.z < depthEC) + { + discard; + } + } +#endif + czm_globe_translucency_main(); + vec4 classificationColor = texture(u_classificationTexture, st); + if (classificationColor.a > 0.0) + { + // Reverse premultiplication process to get the correct composited result of the classification primitives + classificationColor.rgb /= classificationColor.a; + } + out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); +} +`;n.push(o)}function lye(e,t){TY(e,t),Hf(e.defines,"GROUND_ATMOSPHERE"),Hf(t.defines,"GROUND_ATMOSPHERE"),Hf(e.defines,"FOG"),Hf(t.defines,"FOG")}function Iat(e,t){TY(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Dat(e,t){lye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function nye(e,t){let n=`uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; + vec4 pickColor = texture(u_classificationTexture, st); + if (pickColor == vec4(0.0)) + { + discard; + } + out_FragColor = pickColor; +} +`;t.sources=[n]}function Pat(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Oat(e){e.cull.face=_i.BACK,e.cull.enabled=!0}function Rat(e){e.cull.face=_i.FRONT,e.cull.enabled=!0}function Mat(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Lat(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Nat(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function iye(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function oye(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function Fat(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Bat(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function kat(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function wS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Uat(e,t,n,i,o){return l(o)?!i&&l(n)?n:_t(t,o(e),!1):t}function ym(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Vat(){return[new ym({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:vat,getRenderStateFunction:Oat,getUniformMapFunction:void 0}),new ym({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:wat,getRenderStateFunction:Rat,getUniformMapFunction:void 0}),new ym({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:CY,getRenderStateFunction:Mat,getUniformMapFunction:void 0}),new ym({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:CY,getRenderStateFunction:Lat,getUniformMapFunction:void 0}),new ym({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:CY,getRenderStateFunction:Nat,getUniformMapFunction:void 0}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:TY,getRenderStateFunction:iye,getUniformMapFunction:wS}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:lye,getRenderStateFunction:oye,getUniformMapFunction:wS}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Iat,getRenderStateFunction:iye,getUniformMapFunction:wS}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Dat,getRenderStateFunction:oye,getUniformMapFunction:wS}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:nye,getRenderStateFunction:Fat,getUniformMapFunction:wS}),new ym({pass:Ae.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:nye,getRenderStateFunction:Bat,getUniformMapFunction:wS})]}var rye=new Array(sC),sye=new Array(sC);aC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)sye[o]=this._derivedCommandPacks[n[o]],rye[o]=cye[n[o]];zat(this,e,i,n,rye,sye,t)}};function zat(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let C=r[b],T=i[b],A=o[b],S=a[A],v,I,O;l(S)?(v=S.uniformMap,I=S.shaderProgram,O=S.renderState):(v=void 0,I=void 0,O=void 0),S=nt.shallowClone(t,S),a[A]=S;let R=y(S.derivedCommands.uniformMapDirtyFrame,0),N=y(S.derivedCommands.shaderProgramDirtyFrame,0),F=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||R<f,E=h||N<d,w=x||F<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),w&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=T,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=Uat(e,t.uniformMap,v,_,C.getUniformMapFunction),S.shaderProgram=Pat(s.context,t.shaderProgram,I,E,C.getShaderProgramFunction,A),S.renderState=kat(t.renderState,O,w,C.getRenderStateFunction,C.renderStateCache)}}}aC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=cye[o[a]];n.commandList.push(s[c])}};function uye(e,t,n,i,o,r,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,o,r)}}function aye(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var Hat=[fa.OPAQUE_FRONT_FACE,fa.OPAQUE_BACK_FACE],Gat=[fa.DEPTH_ONLY_FRONT_FACE,fa.DEPTH_ONLY_BACK_FACE,fa.DEPTH_ONLY_FRONT_AND_BACK_FACE];aC.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ae.GLOBE],a=e.indices[Ae.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),uye(s,a,t,i,r,o,Hat))};aC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ae.GLOBE],a=e.indices[Ae.GLOBE],c=e.commands[Ae.TERRAIN_CLASSIFICATION],u=e.indices[Ae.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&aye(c,u,t,i,r,o),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,g=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,uye(s,a,t,i,r,o,Gat),r.depthTexture){let h=n.packDepth(r,o);r.uniformState.globeDepthTexture=h}aye(c,u,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=g};var EF=aC;var Bl=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;function Ih(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new mi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new mi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ci({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ci({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Ih.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Ih.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Wat={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:Bt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},jat={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:Bt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},qat={depthMask:!0,depthTest:{enabled:!0},stencilTest:Bt.setCesium3DTileBit(),stencilMask:Bt.CESIUM_3D_TILE_MASK,blending:mn.ALPHA_BLEND},Yat=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } + bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); +#ifdef UNCLASSIFIED + vec4 highlightColor = czm_invertClassificationColor; + if (isClassified) + { + discard; + } +#else + vec4 highlightColor = vec4(1.0); + if (!isClassified) + { + discard; + } +#endif + out_FragColor = color * highlightColor; + gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; +} +`,Xat=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } +#ifdef UNCLASSIFIED + out_FragColor = color * czm_invertClassificationColor; +#else + out_FragColor = color; +#endif +} +`;Ih.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Lt({context:e,width:s,height:a,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new eu({context:e,width:s,height:a,format:Lc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(Wat),this._rsClassified=Ve.fromCache(jat),this._rsDefault=Ve.fromCache(qat)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Xat:Yat,f=new Ge({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ge({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Bl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Ih.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Ih.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Ih.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Ih.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var IS=Ih;function W4(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(W4.prototype,{total:{get:function(){return this._total}}});function n0(e){let t=new Array(Aa.NUMBER_OF_JOB_TYPES);t[Aa.TEXTURE]=new W4(l(e)?e[Aa.TEXTURE]:10),t[Aa.PROGRAM]=new W4(l(e)?e[Aa.PROGRAM]:10),t[Aa.BUFFER]=new W4(l(e)?e[Aa.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}n0.getTimestamp=yi;Object.defineProperties(n0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});n0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};n0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};n0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=n0.getTimestamp();e.execute();let a=n0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var SF=n0;function j4(e){e=y(e,y.EMPTY_OBJECT);let t=On(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=yi(),this._lastMsSampleTime=yi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(j4.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});j4.prototype.update=function(e){let t=yi(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};j4.prototype.destroy=function(){return ue(this)};var k_=j4;function cC(){this._framebuffer=new mi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(cC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Kat(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Jat(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ + out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); +} +`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:Ve.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}cC.prototype.update=function(e,t){Kat(this,e,t),Jat(this,e,t)};var Zat=new re,$at=new re(1,1/255,1/65025,1/16581375);cC.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=re.unpack(i,0,Zat);return re.divideByScalar(o,255,o),re.dot(o,$at)};cC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var vF=cC;function Qat(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ae.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var wF=Qat;var i0=`uniform highp sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); +} +`;function Dh(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new mi,this._tempCopyDepthFramebuffer=new mi,this._updateDepthFramebuffer=new mi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Dh.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function ect(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function fye(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ke.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Bl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Bl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ci({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Dh.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),fye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};Dh.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Dh.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Dh.prototype.executeUpdateDepth=function(e,t,n,i){let o=l(i)?i:t.framebuffer.depthStencilTexture;if(n||o!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==o||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,r,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(o),this._updateDepthFramebuffer.update(e,r,s),fye(this,e,r,s,t)}this._tempCopyDepthTexture=o,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Dh.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Dh.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Dh.prototype.isDestroyed=function(){return!1};Dh.prototype.destroy=function(){return ect(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var IF=Dh;function lC(){this._framebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new mi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(lC.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function tct(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function nct(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function ict(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ci({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}lC.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;nct(this,n,o,r,e),ict(this,n,o,r,i),this._useHdr=e};lC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};lC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};lC.prototype.isDestroyed=function(){return!1};lC.prototype.destroy=function(){return tct(this),ue(this)};var DF=lC;function U_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new mi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new mi({createColorAttachments:!1}),this._opaqueClearCommand=new ci({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ci({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ci({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ci({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function dye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function AY(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function mye(e){dye(e),AY(e)}function oct(e,t,n,i){dye(e),e._accumulationTexture=new Lt({context:t,width:n,height:i,pixelFormat:ct.RGBA,pixelDatatype:Je.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Je.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function rct(e,t){AY(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(AY(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(mye(e),e._translucentMultipassSupport=!1,i=!1)}return i}U_.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,oct(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!rct(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ge({sources:[vN]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ge({defines:["MRT"],sources:[eS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ge({sources:[eS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var sct={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA},act={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationAlpha:Eo.ONE},cct={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:Eo.ZERO,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA};function EY(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function lct(e,t,n){return EY(t,sct,e._translucentRenderStateCache,n)}function uct(e,t,n){return EY(t,act,e._translucentRenderStateCache,n)}function fct(e,t,n){return EY(t,cct,e._alphaRenderStateCache,n)}var dct=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragData_0 = vec4(Ci * wzi, ai); + out_FragData_1 = vec4(ai * wzi); +`,mct=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragColor = vec4(Ci, ai) * wzi; +`,hct=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function SY(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ge.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +bool czm_discard = false; +`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; +${u}`}return a.sources.push(u),a.sources.push(`void main() +{ + czm_translucent_main(); + if (czm_discard) + { + discard; + } +${i}} +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function pct(e,t){return SY(e,t,"translucentMRT",dct)}function _ct(e,t){return SY(e,t,"translucentMultipass",mct)}function gct(e,t){return SY(e,t,"alphaMultipass",hct)}U_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=pct(t,e.shaderProgram),n.translucentCommand.renderState=lct(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=_ct(t,e.shaderProgram),n.translucentCommand.renderState=uct(this,t,e.renderState),n.alphaCommand.shaderProgram=gct(t,e.shaderProgram),n.alphaCommand.renderState=fct(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function yct(e,t,n,i,o,r){let s,a,c,{context:u,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let b=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b);for(l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b);l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b)),i.framebuffer=h}function xct(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,x;for(let b=0;b<o.length;++b)h=o[b],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g);l(r)&&(h=r.unclassifiedCommand,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g)),i.framebuffer=d}U_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){xct(this,e,t,n,i,o);return}yct(this,e,t,n,i,o)};U_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};U_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};U_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};U_.prototype.isDestroyed=function(){return!1};U_.prototype.destroy=function(){return mye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var PF=U_;function OF(){this._framebuffer=new mi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(OF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function bct(e){e._framebuffer.destroy()}function Cct(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new mc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}OF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Cct(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};OF.prototype.isDestroyed=function(){return!1};OF.prototype.destroy=function(){return bct(this),ue(this)};var RF=OF;function LF(e){let t=new mc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new mi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}LF.prototype.begin=function(e,t){let n=this._context,i=t.width,o=t.height;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var MF=new z;LF.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+u+a);MF.red=z.byteToFloat(o[h]),MF.green=z.byteToFloat(o[h+1]),MF.blue=z.byteToFloat(o[h+2]),MF.alpha=z.byteToFloat(o[h+3]);let x=i.getObjectByPickColor(MF);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let h=d;d=-p,p=h}u+=d,f+=p}};LF.prototype.isDestroyed=function(){return!1};LF.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var NF=LF;function V_(){this._numSamples=1,this._colorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ci({color:new z(0,0,0,0),depth:1,owner:this})}function Tct(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(V_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});V_.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};V_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};V_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};V_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};V_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};V_.prototype.isDestroyed=function(){return!1};V_.prototype.destroy=function(){return Tct(this),ue(this)};var uC=V_;function fC(){}fC.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};fC.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Ge.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Ge.replaceMain(o[u],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; +void main() +{ + czm_shadow_cast_main(); + v_positionEC = (czm_inverseProjection * gl_Position).xyz; +}`;o.push(c)}return new Ge({defines:i,sources:o})};fC.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Ge.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=Ge.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; +`),u+=`uniform vec4 shadowMap_lightPositionEC; +`),i?u+=`void main() +{ +`:u+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) + { + discard; + } +`,t?u+=` float distance = length(${s}); + if (distance >= shadowMap_lightPositionEC.w) + { + discard; + } + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?u+=` out_FragColor = vec4(1.0); +`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,u+=`} +`,r.push(u),new Ge({defines:o,sources:r})};fC.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${f}${t}${n}${i}`};fC.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Ge({defines:i,sources:o})};fC.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Ge.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Ge.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,x=t.softShadows,b=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),T=e.sources.slice(0),A=T.length;for(let I=0;I<A;++I)T[I]=Ge.replaceMain(T[I],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; +`:S+=`uniform sampler2D shadowMap_texture; +`;let v;return c?v=` return vec4(${a}, 1.0); +`:v=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,S+=`uniform mat4 shadowMap_matrix; +uniform vec3 shadowMap_lightDirectionEC; +uniform vec4 shadowMap_lightPositionEC; +uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; +uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; +#ifdef LOG_DEPTH +in vec3 v_logPositionEC; +#endif +vec4 getPositionEC() +{ +${v}} +vec3 getNormalEC() +{ +${s?` return normalize(${r}); +`:` return vec3(1.0); +`}} +void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) +{ +${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; + float normalOffsetScale = 1.0 - nDotL; + vec3 offset = normalOffset * normalOffsetScale * normalEC; + positionEC.xyz += offset; +`:""}} +`,S+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,S+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; + float distance = length(directionEC); + directionEC = normalize(directionEC); + float radius = shadowMap_lightPositionEC.w; + // Stop early if the fragment is beyond the point light radius + if (distance > radius) + { + return; + } + vec3 directionWC = czm_inverseViewRotation * directionEC; + shadowParameters.depth = distance / radius; + shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + shadowParameters.texCoords = directionWC; + float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); +`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); + float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Spot light uses a perspective projection, so perform the perspective divide + shadowPosition /= shadowPosition.w; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; + // Stop early if the eye depth exceeds the last cascade + if (depth > maxDepth) + { + return; + } + // Get the cascade based on the eye-space depth + vec4 weights = czm_cascadeWeights(depth); + // Apply normal offset + float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + // Transform position into the cascade + vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; + // Get visibility + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); + // Fade out shadows that are far away + float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; + float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); + visibility = mix(visibility, 1.0, fade); +${h?` // Draw cascade colors for debugging + out_FragColor *= czm_cascadeColor(weights); +`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`,S+=` out_FragColor.rgb *= visibility; +} +`,T.push(S),new Ge({defines:C,sources:T})};var Ph=fC;function Oh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Wt.isInternetExplorer()||Wt.isEdge()||(Wt.isChrome()||Wt.isFirefox())&&Wt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new L,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new re,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new q4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Ar:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new re,new re],this._cascadeMatrices=[new L,new L,new L,new L],this._cascadeDistances=new re;let o;this._isPointLight?o=6:this._cascadesEnabled?o=this._numberOfCascades:o=1,this._passes=new Array(o);for(let r=0;r<o;++r)this._passes[r]=new Act(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,wY(this),this._clearCommand=new ci({depth:1,color:new z}),this._clearPassState=new mc(t),this._size=y(e.size,2048),this.size=this._size}Oh.MAXIMUM_DISTANCE=2e4;function Act(e){this.camera=new q4,this.passState=new mc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function vY(e,t){return Ve.fromCache({cull:{enabled:!0,face:_i.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function wY(e){let t=!e._usesDepthTexture;e._primitiveRenderState=vY(t,e._primitiveBias),e._terrainRenderState=vY(t,e._terrainBias),e._pointRenderState=vY(t,e._pointBias)}Oh.prototype.debugCreateRenderStates=function(){wY(this)};Object.defineProperties(Oh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Dct(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function IY(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Ect(e,t){let n=new eu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Lc.DEPTH_COMPONENT16}),i=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=new ea({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Sct(e,t){let n=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),i=new ea({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function vct(e,t){let n=new eu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Lc.DEPTH_COMPONENT16}),i=new Ha({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new ea({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function _ye(e,t){e._isPointLight?vct(e,t):e._usesDepthTexture?Sct(e,t):Ect(e,t)}function wct(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,wY(e),IY(e),_ye(e,t))}function Ict(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(IY(e),_ye(e,t),wct(e,t),gye(e,t))}function gye(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Dct(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Gt.maximumCubeMapSize>=t?t:Gt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Gt.maximumTextureSize>=t?t:Gt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Gt.maximumTextureSize>=t*2?t:Gt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new L(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Pct=new Ke;function Oct(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +in vec2 v_textureCoordinates; +void main() +{ + vec2 uv = v_textureCoordinates; + vec3 dir; + + if (uv.y < 0.5) + { + if (uv.x < 0.333) + { + dir.x = -1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 1.0; + } + else if (uv.x < 0.666) + { + dir.y = -1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 1.0; + } + else + { + dir.z = -1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 1.0; + } + } + else + { + if (uv.x < 0.333) + { + dir.x = 1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 3.0; + } + else if (uv.x < 0.666) + { + dir.y = 1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 3.0; + } + else + { + dir.z = 1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 3.0; + } + } + + float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); + out_FragColor = vec4(vec3(shadow), 1.0); +} +`:n=`uniform sampler2D shadowMap_texture; +in vec2 v_textureCoordinates; +void main() +{ +${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; +`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); +`} out_FragColor = vec4(vec3(shadow), 1.0); +} +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ae.OVERLAY,i}function Rct(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Pct;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Oct(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Rh=new Array(8);Rh[0]=new re(-1,-1,-1,1);Rh[1]=new re(1,-1,-1,1);Rh[2]=new re(1,1,-1,1);Rh[3]=new re(-1,1,-1,1);Rh[4]=new re(-1,-1,1,1);Rh[5]=new re(1,-1,1,1);Rh[6]=new re(1,1,1,1);Rh[7]=new re(-1,1,1,1);var o0=new L,DY=new Array(8);for(let e=0;e<8;++e)DY[e]=new re;function Mct(e,t){let n=new Ct({geometry:new od({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:zt.fromColor(t)}}),i=new Ct({geometry:new e_({radius:.5}),attributes:{color:zt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Lct=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Nct=new m;function Fct(e,t){Rct(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new vh({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new vh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new vh({camera:e._passes[i].camera,color:Lct[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Be.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,Nct),a=L.fromTranslationQuaternionRotationScale(i,o,s,o0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Mct(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new vh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function q4(){this.viewMatrix=new L,this.inverseViewMatrix=new L,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new L}q4.prototype.clone=function(e){L.clone(e.viewMatrix,this.viewMatrix),L.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var Bct=new L(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);q4.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return L.multiply(t,e,this.viewProjectionMatrix),L.multiply(Bct,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var kct=new Array(5),Uct=new Si,Vct=new Array(4),yye=new m,xye=new m;function zct(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=Vct,g=kct;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,_=o*Math.pow(u,F),E=o+c*F,w=P.lerp(E,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}re.unpack(g,0,e._cascadeSplits[0]),re.unpack(g,1,e._cascadeSplits[1]),re.unpack(p,0,e._cascadeDistances);let h=n.frustum,x=h.left,b=h.right,C=h.bottom,T=h.top,A=h.near,S=h.far,v=n.positionWC,I=n.directionWC,O=n.upWC,R=i.frustum.clone(Uct),N=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let F=L.multiply(R.projectionMatrix,i.viewMatrix,o0),_=L.inverse(F,o0),E=L.multiply(N,_,o0),w=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,yye),D=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,xye);for(let G=0;G<8;++G){let k=re.clone(Rh[G],DY[G]);L.multiplyByVector(E,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,w,w),m.maximumByComponent(k,D,D)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,D.x=Math.min(D.x,1),D.y=Math.min(D.y,1),D.z=Math.min(D.z,1);let M=e._passes[a],B=M.camera;B.clone(n);let V=B.frustum;V.left=x+w.x*(b-x),V.right=x+D.x*(b-x),V.bottom=C+w.y*(T-C),V.top=C+D.y*(T-C),V.near=A+w.z*(S-A),V.far=A+D.z*(S-A),M.cullingVolume=B.frustum.computeCullingVolume(v,I,O);let U=e._cascadeMatrices[a];L.multiply(B.getViewProjection(),i.inverseViewMatrix,U),L.multiply(M.textureOffsets,U,U)}}var Hct=new L,Gct=new m,Wct=new m,hye=new m;function jct(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=L.multiply(i.frustum.projectionMatrix,i.viewMatrix,o0),r=L.inverse(o,o0),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,Gct);a=m.cross(c,s,Wct),m.normalize(a,a),m.normalize(c,c);let u=m.fromElements(0,0,0,hye),f=L.computeView(u,s,a,c,Hct),d=L.multiply(f,r,o0),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,yye),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,xye);for(let S=0;S<8;++S){let v=re.clone(Rh[S],DY[S]);L.multiplyByVector(d,v,v),m.divideByScalar(v,v.w,v),m.minimumByComponent(v,p,p),m.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let h=hye;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let x=L.fromTranslation(h,o0);f=L.multiply(x,f,f);let b=.5*(g.x-p.x),C=.5*(g.y-p.y),T=g.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-C,A.top=C,A.near=.01,A.far=T,L.clone(f,n.viewMatrix),L.inverse(f,n.inverseViewMatrix),L.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var qct=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],Yct=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],Xct=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Kct(e,t){let n=new Si;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=qct[i],o.upWC=Yct[i],o.rightWC=Xct[i],L.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),L.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Jct=new m,Zct=new m,bye=new ae,pye=bye.center;function $ct(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=bye;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Jct),s=m.negate(i.directionWC,Zct),a=m.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,pye),pye);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function Qct(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;L.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),L.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=co.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,$ct(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Oh.prototype.update=function(e){if(Qct(this,e),this._needsUpdate)if(Ict(this,e.context),this._isPointLight&&Kct(this,e),this._cascadesEnabled&&(jct(this,e),this._numberOfCascades>1&&zct(this,e)),this._isPointLight)this._shadowMapCullingVolume=Zr.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;L.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Fct(this,e)};Oh.prototype.updatePass=function(e,t){gye(this,e,t)};var elt=new H;function Cye(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=elt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,re.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return re.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new re,combinedUniforms2:new re};return _t(t,o,!1)}function tlt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ae.GLOBE,d=n.pass!==Ae.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Ph.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let b=u.vertexShaderSource,C=u.fragmentShaderSource,T=Ph.createShadowCastVertexShader(b,p,f),A=Ph.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:T,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=Cye(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Oh.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ae.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,h=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||h||n||g){let x=Ph.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let b=Ph.createShadowReceiveVertexShader(a,u,f),C=Ph.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Cye(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Oh.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=tlt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Oh.prototype.isDestroyed=function(){return!1};Oh.prototype.destroy=function(){IY(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var z_=Oh;var dC=`uniform sampler2D colorTexture; + +#ifdef DEBUG_SHOW_DEPTH +uniform sampler2D u_packedTranslucentDepth; +#endif + +in vec2 v_textureCoordinates; + +void main() +{ +#ifdef DEBUG_SHOW_DEPTH + if (v_textureCoordinates.x < 0.5) + { + out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); + out_FragColor.a = 1.0; + } +#else + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef PICK + if (color == vec4(0.0)) + { + discard; + } +#else + // Reverse premultiplication process to get the correct composited result of the classification primitives + color.rgb /= color.a; +#endif + out_FragColor = color; +#endif +} +`;var nlt=!1;function r0(e){this._drawClassificationFBO=new mi({createDepthAttachments:!1}),this._accumulationFBO=new mi({createDepthAttachments:!1}),this._packFBO=new mi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ci({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ci({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(r0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Tye(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Aye(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function ilt(e,t,n,i){Tye(e),e._translucentDepthStencilTexture=new Lt({context:t,width:n,height:i,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST})}function olt(e,t,n,i){Aye(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function rlt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(ilt(e,t,o,r),olt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Ge({sources:[SN]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ge({sources:[dC]}),a={colorTexture:function(){return e._textureToComposite}},nlt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ge({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=nt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ge({sources:[dC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ge({sources:[dC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Ke.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,reference:Bt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}r0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<r;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(rlt(this,u,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<r;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};r0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(o,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,o,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};r0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),slt(this,e,t)};function slt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}r0.prototype.isSupported=function(){return this._supported};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){return Tye(this),Aye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var FF=r0;function alt(){this.command=void 0,this.near=void 0,this.far=void 0}function Y4(e,t,n){let i=e.context,o;i.depthTexture&&(o=new IF);let r;e._useOIT&&i.depthTexture&&(r=new PF(i));let s=new mc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=co.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new NF(i),this.pickDepthFramebuffer=new RF,this.sceneFramebuffer=new uC,this.globeDepth=o,this.globeTranslucencyFramebuffer=new DF,this.oit=r,this.translucentTileClassification=new FF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Eye=new m,Sye=new m;function clt(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),o=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),o)}function llt(e,t,n){let i=1/Math.max(1,clt(e.position,t.position));return m.multiplyByScalar(e.position,i,Eye),m.multiplyByScalar(t.position,i,Sye),m.equalsEpsilon(Eye,Sye,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&L.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Y4.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return llt(t,n,P.EPSILON15)?(this._cameraStartFired&&yi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=yi(),co.clone(t,n),!0)};function ult(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n),isNaN(n)&&(n=r.frustum.near),isNaN(i)&&(i=r.frustum.far);let u;a?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];l(h)?(h.near=p,h.far=g):h=f[d]=new wF(p,g)}}function flt(e,t,n,i,o){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let r=e.frustumCommandsList,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.near,f=c.far;if(i>f)continue;if(o<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var vye=new Zr,dlt=new bc;Y4.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,o=n.positionWC,r=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Ae.NUMBER_OF_PASSES;for(let E=0;E<u;++E)for(let w=0;w<f;++w)c[E].indices[w]=0;r.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,x=-Number.MAX_VALUE,b=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,T=-Number.MAX_VALUE,A=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,v=t.cullingVolume,I=vye.planes;for(let E=0;E<5;++E)I[E]=v.planes[E];v=vye;let O=a.length;for(let E=0;E<O;++E){let w=a[E],D=w.pass;if(D===Ae.COMPUTE)r.push(w);else if(D===Ae.OVERLAY)s.push(w);else{let M,B,V=w.boundingVolume;if(l(V)){if(!e.isVisible(w,v,S))continue;let G=V.computePlaneDistances(o,i,dlt);if(M=G.start,B=G.stop,h=Math.min(h,M),x=Math.max(x,B),b&&w.receiveShadows&&M<z_.MAXIMUM_DISTANCE&&!(D===Ae.GLOBE&&M<-100&&B>100)){let k=B-M;D!==Ae.GLOBE&&M<100&&(A=Math.min(A,k)),C=Math.min(C,M),T=Math.max(T,B)}}else w instanceof ci?(M=n.frustum.near,B=n.frustum.far):(M=n.frustum.near,B=n.frustum.far,h=Math.min(h,M),x=Math.max(x,B));let U=d[g];l(U)||(U=d[g]=new alt),U.command=w,U.near=M,U.far=B,g++}}b&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),T=Math.max(Math.min(T,n.frustum.far),C)),b&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=T,t.shadowState.closestObjectSize=A),ult(this,e,h,x);let R,N;for(R=0;R<g;R++)N=d[R],flt(this,e,N.command,N.near,N.far);if(g<p)for(R=g;R<p&&(N=d[R],!!l(N.command));R++)N.command=void 0;let F=c.length,_=t.frustumSplits;_.length=F+1;for(let E=0;E<F;++E)_[E]=c[E].near,E===F-1&&(_[E+1]=c[E].far)};Y4.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var mC=Y4;var Iye=.1,mlt=new zf({pass:Mo.MOST_DETAILED_PRELOAD}),hlt=new zf({pass:Mo.MOST_DETAILED_PICK}),PY=new zf({pass:Mo.PICK});function Ra(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new co(e);n.frustum=new on({width:Iye,aspectRatio:1,near:.1}),this._pickOffscreenView=new mC(e,n,t)}Ra.prototype.update=function(){this._pickPositionCacheDirty=!0};Ra.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new vF,n[t]=i),i};var plt=new Ar,_lt=new m,X4=new m,glt=new H,ylt=new L;function xlt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=L.clone(r.transform,ylt);r._setTransform(L.IDENTITY);let d=m.clone(r.position,_lt);m.multiplyByScalar(r.right,c,X4),m.add(X4,d,d),m.multiplyByScalar(r.up,u,X4),m.add(X4,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,glt),g=plt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,r.directionWC,r.upWC)}var blt=new qc,Clt=new H;function Tlt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=d*a*c,h=s.getPixelDimensions(o.width,o.height,1,1,Clt),x=h.x*n*.5,b=h.y*i*.5,C=blt;return C.top=g+b,C.bottom=g-b,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Dye(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof Ar?xlt(e,t,n,i,o):Tlt(e,t,n,i,o)}var DS=3,BF=3,Mh=new Ke(0,0,DS,BF),Pye=new H,OY=new z(0,0,0,0);Ra.prototype.pick=function(e,t,n,i){DS=y(n,3),BF=y(i,DS);let o=e.context,r=o.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=o.drawingBufferWidth,c.height=o.drawingBufferHeight;let u=a.passState;u.viewport=Ke.clone(c,u.viewport);let f=Zi.transformWindowToDrawingBuffer(e,t,Pye);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=Dye(e,f,DS,BF,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=PY,r.update(s),e.updateEnvironment(),Mh.x=f.x-(DS-1)*.5,Mh.y=e.drawingBufferHeight-f.y-(BF-1)*.5,Mh.width=DS,Mh.height=BF,u=a.pickFramebuffer.begin(Mh,a.viewport),e.updateAndExecuteCommands(u,OY),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(Mh);return o.endFrame(),d};function Alt(e,t){let n=e.context,i=e.frameState,o=e.environmentState,r=e.defaultView;e.view=r;let s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=r.passState;a.viewport=Ke.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=Dye(e,t,1,1,s),i.tilesetPassState=PY,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,a=r.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,OY),e.resolveFramebuffers(a),n.endFrame()}var Elt=new Si,Slt=new qc,vlt=new on,wlt=new Ar;Ra.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let o=e.frameState,r=e.context,s=r.uniformState,a=e.defaultView;e.view=a;let c=Zi.transformWindowToDrawingBuffer(e,t,Pye);e.pickTranslucentDepth?Alt(e,c):(e.updateFrameState(),s.update(o),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(Elt):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(Slt):l(u.frustum.width)?f=u.frustum.clone(vlt):f=u.frustum.clone(wlt);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(r,c.x,c.y);if(l(x)&&x>0&&x<1){let b=d[g],C;return e.mode===ne.SCENE2D?(C=u.position.z,u.position.z=C-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,s.update(o),s.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,s.updateFrustum(f)),n=Zi.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===ne.SCENE2D&&(u.position.z=C,s.update(o)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Ilt=new me;Ra.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Ilt);o.cartographicToCartesian(r,n)}return n};function Oye(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),u instanceof As&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Ra.prototype.drillPick=function(e,t,n,i,o){let r=this;return Oye(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var wye=new m,Dlt=new m;function Plt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Rye(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,wye),s=m.cross(o,r,wye),a=m.cross(o,s,Dlt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Iye),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Olt(e,t,n){let i=t.frameState,o=n.ray,r=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=Rye(e,o,r,a),u=mlt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ra.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Olt(this,e,t[n])&&t.splice(n--,1)};function Mye(e,t,n){let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof vl&&Mye(r,t,n))}}function K4(e,t,n,i,o,r){let s=[];if(Mye(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Plt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Rlt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Mlt(e,t,n,i,o,r,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,Rye(e,n,o,f.camera),Mh=Ke.clone(f.viewport,Mh);let d=f.pickFramebuffer.begin(Mh,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=hlt:u.tilesetPassState=PY,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,OY),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(Mh);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let x=0;x<h;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let T=f.frustumCommandsList[x],A=T.near*(x!==0?t.opaqueFrustumNearOffset:1),S=T.far,v=A+C*(S-A);p=wn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&r||Rlt(g,i)}}function Lye(e,t,n,i,o,r,s,a){return Oye(i,function(){return Mlt(e,t,n,o,r,s,a)})}function PS(e,t,n,i,o,r,s){let a=Lye(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function Nye(e,t,n,i,o,r,s,a){return Lye(e,t,n,i,o,r,s,a)}function J4(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}Ra.prototype.pickFromRay=function(e,t,n,i){return PS(this,e,t,n,i,!1,!1)};Ra.prototype.drillPickFromRay=function(e,t,n,i,o){return Nye(this,e,t,n,i,o,!1,!1)};Ra.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=wn.clone(t),n=l(n)?n.slice():n,J4(e,K4(o,e,t,n,i,function(){return PS(o,e,t,n,i,!1,!0)}))};Ra.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=wn.clone(t),i=l(i)?i.slice():i,J4(e,K4(r,e,t,i,o,function(){return Nye(r,e,t,n,i,o,!1,!0)}))};var Llt=new m,Nlt=new m,Flt=new wn,Fye=new me;function RY(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=oi._defaultMaxTerrainHeight,r=i.geodeticSurfaceNormalCartographic(t,Nlt),s=me.toCartesian(t,i,Llt),a=Flt;a.origin=s,a.direction=r;let c=new wn;return wn.getPoint(a,o,c.origin),m.negate(r,c.direction),c}function Bye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=me.fromCartesian(t,i,Fye);return RY(e,o)}function kye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return me.fromCartesian(t,i,Fye).height}function Blt(e,t,n,i,o){let r=RY(t,n);return K4(e,t,r,i,o,function(){let s=PS(e,t,r,i,o,!0,!0);if(l(s))return kye(t,s.position)})}function klt(e,t,n,i,o,r){let s=Bye(t,n);return K4(e,t,s,i,o,function(){let a=PS(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}Ra.prototype.sampleHeight=function(e,t,n,i){let o=RY(e,t),r=PS(this,e,o,n,i,!0,!1);if(l(r))return kye(e,r.position)};Ra.prototype.clampToHeight=function(e,t,n,i,o){let r=Bye(e,t),s=PS(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};Ra.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Blt(this,e,t[s],n,i);return J4(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ra.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=klt(this,e,t[s],n,i,t[s]);return J4(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ra.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var kF=Ra;var UF=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + color /= texture(autoExposure, vec2(0.5)).r; +#endif + color = czm_acesTonemapping(color); + color = czm_inverseGamma(color); + + out_FragColor = vec4(color, fragmentColor.a); +} +`;var VF=`uniform sampler2D randomTexture; +uniform sampler2D depthTexture; +uniform float intensity; +uniform float bias; +uniform float lengthCap; +uniform float stepSize; +uniform float frustumLength; + +in vec2 v_textureCoordinates; + +vec4 clipToEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); + posEC = posEC / posEC.w; + return posEC; +} + +//Reconstruct Normal Without Edge Removation +vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) +{ + vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); + vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); + vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); + vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); + + vec3 up = posInCamera.xyz - posInCameraUp.xyz; + vec3 down = posInCameraDown.xyz - posInCamera.xyz; + vec3 left = posInCamera.xyz - posInCameraLeft.xyz; + vec3 right = posInCameraRight.xyz - posInCamera.xyz; + + vec3 DX = length(left) < length(right) ? left : right; + vec3 DY = length(up) < length(down) ? up : down; + + return normalize(cross(DY, DX)); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = clipToEye(v_textureCoordinates, depth); + + if (posInCamera.z > frustumLength) + { + out_FragColor = vec4(1.0); + return; + } + + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); + float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); + float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); + float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); + vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); + + float ao = 0.0; + vec2 sampleDirection = vec2(1.0, 0.0); + float gapAngle = 90.0 * czm_radiansPerDegree; + + // RandomNoise + float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; + + //Loop for each direction + for (int i = 0; i < 4; i++) + { + float newGapAngle = gapAngle * (float(i) + randomVal); + float cosVal = cos(newGapAngle); + float sinVal = sin(newGapAngle); + + //Rotate Sampling Direction + vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); + float localAO = 0.0; + float localStepSize = stepSize; + + //Loop for each step + for (int j = 0; j < 6; j++) + { + vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; + + //Exception Handling + if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) + { + break; + } + + float stepDepthInfo = czm_readDepth(depthTexture, newCoords); + vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); + vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; + float len = length(diffVec); + + if (len > lengthCap) + { + break; + } + + float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); + float weight = len / lengthCap; + weight = 1.0 - weight * weight; + + if (dotVal < bias) + { + dotVal = 0.0; + } + + localAO = max(localAO, dotVal * weight); + localStepSize += stepSize; + } + ao += localAO; + } + + ao /= 4.0; + ao = 1.0 - clamp(ao, 0.0, 1.0); + ao = pow(ao, intensity); + out_FragColor = vec4(vec3(ao), 1.0); +} +`;var zF=`uniform sampler2D colorTexture; +uniform sampler2D ambientOcclusionTexture; +uniform bool ambientOcclusionOnly; +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); + out_FragColor = ambientOcclusionOnly ? ao : ao * color; +} +`;var HF=`uniform sampler2D colorTexture; +uniform float gradations; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = vec4(rgb, 1.0); + return; + } +#endif + float luminance = czm_luminance(rgb); + float darkness = luminance * gradations; + darkness = (darkness - fract(darkness)) / gradations; + out_FragColor = vec4(vec3(darkness), 1.0); +} +`;var GF=`uniform sampler2D colorTexture; +uniform sampler2D bloomTexture; +uniform bool glowOnly; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = color; + return; + } +#endif + + vec4 bloom = texture(bloomTexture, v_textureCoordinates); + out_FragColor = glowOnly ? bloom : bloom + color; +} +`;var WF=`uniform sampler2D colorTexture; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 target = vec3(0.0); + out_FragColor = vec4(mix(target, rgb, brightness), 1.0); +} +`;var jF=`uniform sampler2D colorTexture; +uniform float contrast; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; + sceneColor = czm_RGBToHSB(sceneColor); + sceneColor.z += brightness; + sceneColor = czm_HSBToRGB(sceneColor); + + float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); + sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); + out_FragColor = vec4(sceneColor, 1.0); +} +`;var qF=`uniform sampler2D colorTexture; +uniform sampler2D blurTexture; +uniform sampler2D depthTexture; +uniform float focalDistance; + +in vec2 v_textureCoordinates; + +vec4 toEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); + posInCamera = posInCamera / posInCamera.w; + return posInCamera; +} + +float computeDepthBlur(float depth) +{ + float f; + if (depth < focalDistance) + { + f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); + } + else + { + f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); + f = pow(f, 0.1); + } + f *= f; + f = clamp(f, 0.0, 1.0); + return pow(f, 0.5); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = toEye(v_textureCoordinates, depth); + float d = computeDepthBlur(-posInCamera.z); + out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); +} +`;var YF=`uniform sampler2D depthTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + out_FragColor = vec4(vec3(depth), 1.0); +} +`;var XF=`uniform sampler2D depthTexture; +uniform float length; +uniform vec4 color; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float directions[3]; + directions[0] = -1.0; + directions[1] = 0.0; + directions[2] = 1.0; + + float scalars[3]; + scalars[0] = 3.0; + scalars[1] = 10.0; + scalars[2] = 3.0; + + float padx = czm_pixelRatio / czm_viewport.z; + float pady = czm_pixelRatio / czm_viewport.w; + +#ifdef CZM_SELECTED_FEATURE + bool selected = false; + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + selected = selected || czm_selected(vec2(-padx, dir * pady)); + selected = selected || czm_selected(vec2(padx, dir * pady)); + selected = selected || czm_selected(vec2(dir * padx, -pady)); + selected = selected || czm_selected(vec2(dir * padx, pady)); + if (selected) + { + break; + } + } + if (!selected) + { + out_FragColor = vec4(color.rgb, 0.0); + return; + } +#endif + + float horizEdge = 0.0; + float vertEdge = 0.0; + + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + float scale = scalars[i]; + + horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; + horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; + + vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; + vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; + } + + float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); + out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); +} +`;var KF=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See slides 142 and 143: +// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + + const float A = 0.22; // shoulder strength + const float B = 0.30; // linear strength + const float C = 0.10; // linear angle + const float D = 0.20; // toe strength + const float E = 0.01; // toe numerator + const float F = 0.30; // toe denominator + + const float white = 11.2; // linear white point value + + vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; + float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; + + c = czm_inverseGamma(c / w); + out_FragColor = vec4(c, fragmentColor.a); +} +`;var JF=`in vec2 v_textureCoordinates; + +uniform sampler2D colorTexture; + +const float fxaaQualitySubpix = 0.5; +const float fxaaQualityEdgeThreshold = 0.125; +const float fxaaQualityEdgeThresholdMin = 0.0833; + +void main() +{ + vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; + vec4 color = FxaaPixelShader( + v_textureCoordinates, + colorTexture, + fxaaQualityRcpFrame, + fxaaQualitySubpix, + fxaaQualityEdgeThreshold, + fxaaQualityEdgeThresholdMin); + float alpha = texture(colorTexture, v_textureCoordinates).a; + out_FragColor = vec4(color.rgb, alpha); +} +`;var s0=`#define SAMPLES 8 + +uniform float delta; +uniform float sigma; +uniform float direction; // 0.0 for x direction, 1.0 for y direction + +uniform sampler2D colorTexture; + +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif + +in vec2 v_textureCoordinates; + +// Incremental Computation of the Gaussian: +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html + +void main() +{ + vec2 st = v_textureCoordinates; + vec2 dir = vec2(1.0 - direction, direction); + +#ifdef USE_STEP_SIZE + vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); +#else + vec2 step = step; +#endif + + vec3 g; + g.x = 1.0 / (sqrt(czm_twoPi) * sigma); + g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); + g.z = g.y * g.y; + + vec4 result = texture(colorTexture, st) * g.x; + for (int i = 1; i < SAMPLES; ++i) + { + g.xy *= g.yz; + + vec2 offset = float(i) * dir * step; + result += texture(colorTexture, st - offset) * g.x; + result += texture(colorTexture, st + offset) * g.x; + } + + out_FragColor = result; +} +`;var ZF=`uniform sampler2D colorTexture; +uniform sampler2D dirtTexture; +uniform sampler2D starTexture; +uniform vec2 dirtTextureDimensions; +uniform float distortion; +uniform float ghostDispersal; +uniform float haloWidth; +uniform float dirtAmount; +uniform float earthRadius; +uniform float intensity; + +in vec2 v_textureCoordinates; + +// whether it is in space or not +// 6500000.0 is empirical value +#define DISTANCE_TO_SPACE 6500000.0 + +// return ndc from world coordinate biased earthRadius +vec4 getNDCFromWC(vec3 WC, float earthRadius) +{ + vec4 positionEC = czm_view * vec4(WC, 1.0); + positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); +} + +// Check if current pixel is included Earth +// if then mask it gradually +float isInEarth(vec2 texcoord, vec2 sceneSize) +{ + vec2 NDC = texcoord * 2.0 - 1.0; + vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); + vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); + NDC.xy -= earthPosSC.xy; + + float X = abs(NDC.x) * sceneSize.x; + float Y = abs(NDC.y) * sceneSize.y; + + return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); +} + +// For Chromatic effect +vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) +{ + vec2 sceneSize = czm_viewport.zw; + vec3 color; + if(isSpace) + { + color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; + color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; + color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; + } + else + { + color.r = texture(tex, texcoord + direction * distortion.r).r; + color.g = texture(tex, texcoord + direction * distortion.g).g; + color.b = texture(tex, texcoord + direction * distortion.b).b; + } + return vec4(clamp(color, 0.0, 1.0), 0.0); +} + +void main(void) +{ + vec4 originalColor = texture(colorTexture, v_textureCoordinates); + vec3 rgb = originalColor.rgb; + bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; + + // Sun position + vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); + vec4 sunPositionEC = czm_view * sunPos; + vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); + sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); + + // If sun is not in the screen space, use original color. + if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) + { + // Lens flare is disabled when not in space until #5932 is fixed. + // https://github.com/CesiumGS/cesium/issues/5932 + out_FragColor = originalColor; + return; + } + + vec2 texcoord = vec2(1.0) - v_textureCoordinates; + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + vec2 invPixelSize = 1.0 / pixelSize; + vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); + + // ghost vector to image centre: + vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; + vec3 direction = normalize(vec3(ghostVec, 0.0)); + + // sample ghosts: + vec4 result = vec4(0.0); + vec4 ghost = vec4(0.0); + for (int i = 0; i < 4; ++i) + { + vec2 offset = fract(texcoord + ghostVec * float(i)); + // Only bright spots from the centre of the source image + ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); + } + result += ghost; + + // sample halo + vec2 haloVec = normalize(ghostVec) * haloWidth; + float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); + weightForHalo = pow(1.0 - weightForHalo, 5.0); + + result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; + + // dirt on lens + vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; + if (dirtTexCoords.x > 1.0) + { + dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); + } + if (dirtTexCoords.y > 1.0) + { + dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); + } + result += dirtAmount * texture(dirtTexture, dirtTexCoords); + + // Rotating starburst texture's coordinate + // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) + float camrot = czm_view[0].z + czm_view[1].y; + float cosValue = cos(camrot); + float sinValue = sin(camrot); + mat3 rotation = mat3( + cosValue, -sinValue, 0.0, + sinValue, cosValue, 0.0, + 0.0, 0.0, 1.0 + ); + + vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); + vec3 st2 = vec3((rotation * st1).xy, 1.0); + vec3 st3 = st2 * 0.5 + vec3(0.5); + vec2 lensStarTexcoord = st3.xy; + float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); + float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); + + if (!isSpace) + { + result *= oneMinusWeightForLensFlare * intensity * 0.2; + } + else + { + result *= oneMinusWeightForLensFlare * intensity; + result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; + } + + result += texture(colorTexture, v_textureCoordinates); + + out_FragColor = result; +} +`;var $F=`uniform sampler2D colorTexture; +uniform vec3 white; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 4: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = (color * (1.0 + color / white)) / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var QF=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 green = vec3(0.0, 1.0, 0.0); + out_FragColor = vec4((noiseValue + rgb) * green, 1.0); +} +`;var e2=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 3: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = color / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var t2=`uniform sampler2D colorTexture; +uniform sampler2D silhouetteTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); + vec4 color = texture(colorTexture, v_textureCoordinates); + out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); +} +`;function hC(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new mi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(hC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Uye(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Ult(e,t){Uye(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new mi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Vye(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Vlt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function zlt(e,t){let n=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +float sampleTexture(vec2 offset) { +`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); + return czm_luminance(color.rgb); +`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r; +`,n+=`} + +`,n+=`uniform vec2 colorTextureDimensions; +uniform vec2 minMaxLuminance; +uniform sampler2D previousLuminance; +void main() { + float color = 0.0; + float xStep = 1.0 / colorTextureDimensions.x; + float yStep = 1.0 / colorTextureDimensions.y; + int count = 0; + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + vec2 offset; + offset.x = -xStep + float(i) * xStep; + offset.y = -yStep + float(j) * yStep; + if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { + continue; + } + color += sampleTexture(offset); + ++count; + } + } + if (count > 0) { + color /= float(count); + } +`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); + color = previous + (color - previous) / (60.0 * 1.5); + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); +`),n+=` out_FragColor = vec4(color); +} +`,n}function Hlt(e,t){Vye(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(zlt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Vlt(e,r)});e._commands=o}hC.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ci({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};hC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Ult(this,e),Hlt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};hC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};hC.prototype.isDestroyed=function(){return!1};hC.prototype.destroy=function(){return Uye(this),Vye(this),ue(this)};var n2=hC;var Glt={NEAREST:0,LINEAR:1},Nu=Glt;function pC(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,ct.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,Nu.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Je.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let o=new mc;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=Wn()),this._name=r,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(pC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Wlt=/uniform\s+sampler2D\s+depthTexture/g;pC.prototype._isSupported=function(e){return!Wlt.test(this._fragmentShader)||e.depthTexture};function jlt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Lt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Lt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function qlt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Ylt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Xlt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i)if(i.hasOwnProperty(r)){typeof i[r]!="function"?(t[r]=qlt(e,r),n[r]=jlt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Lt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Ylt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=_t(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Klt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE +uniform sampler2D czm_idTexture; +uniform sampler2D czm_selectedIdTexture; +uniform float czm_selectedIdTextureStep; +in vec2 v_textureCoordinates; +bool czm_selected(vec2 offset) +{ + bool selected = false; + vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); + for (int i = 0; i < ${o}; ++i) + { + vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); + if (all(equal(id, selectedId))) + { + return true; + } + } + return false; +} + +bool czm_selected() +{ + return czm_selected(vec2(0.0)); +} + +${n}`}let i=new Ge({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Jlt(e){let t=e._sampleMode,n,i;t===Nu.LINEAR?(n=un.LINEAR,i=Ci.LINEAR):(n=un.NEAREST,i=Ci.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Zlt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function $lt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Qlt(e,t){let n,i,o,r=e._texturesToRelease,s=r.length;for(n=0;n<s;++n)i=r[n],i=i&&i.destroy();r.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];o=d.name;let p=d.source;e._actualUniforms[o]=new Lt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){o=c[n];let d=u[o],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[o]=$lt(e,d);else if(typeof d=="string"){let g=new Se({url:d});f.push(g.fetchImage().then(Zlt(e,o)))}else e._texturesToCreate.push({name:o,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function zye(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i)i.hasOwnProperty(o)&&i[o]instanceof Lt&&(l(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function eut(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function tut(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,o,r=0,s=n.length;for(i=0;i<s;++i)o=n[i],l(o.pickIds)?r+=o.pickIds.length:l(o.pickId)&&++r;if(s===0||r===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:hn.NEAREST});return}let a,c=0,u=new Uint8Array(r*4);for(i=0;i<s;++i)if(o=n[i],l(o.pickIds)){let f=o.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(o.pickId)&&(a=o.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:u,width:r,height:1},sampler:hn.NEAREST})}pC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&zye(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=eut(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,tut(this,e),Xlt(this),Qlt(this,e),Klt(this,e),Jlt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};pC.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,hn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return zye(this),ue(this)};var xo=pC;function _C(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Wn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(_C.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});_C.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};_C.prototype.get=function(e){return this._stages[e]};function nut(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}_C.prototype.update=function(e,t){this._selectedDirty=nut(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Kc=_C;var Fr={};function Z4(e){let o=`#define USE_STEP_SIZE +${s0}`,r=new xo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Nu.LINEAR}),s=new xo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Nu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Kc({name:e,stages:[r,s],uniforms:a})}Fr.createBlurStage=function(){return Z4("czm_blur")};Fr.createDepthOfFieldStage=function(){let e=Z4("czm_depth_of_field_blur"),t=new xo({name:"czm_depth_of_field_composite",fragmentShader:qF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Kc({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Fr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Fr.createEdgeDetectionStage=function(){let e=Wn();return new xo({name:`czm_edge_detection_${e}`,fragmentShader:XF,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Fr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function iut(e){if(!l(e))return Fr.createEdgeDetectionStage();let t=new Kc({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +`,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); + if (edge${a}.a > 0.0) + { + color = edge${a}; + break; + } +`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; +void main() { + vec4 color = vec4(0.0); + for (int i = 0; i < ${e.length}; i++) + { +${o} } + out_FragColor = color; +} +`,s=new xo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Kc({name:"czm_edge_detection_composite",stages:[t,s]})}Fr.createSilhouetteStage=function(e){let t=iut(e),n=new xo({name:"czm_silhouette_color_edges",fragmentShader:t2,uniforms:{silhouetteTexture:t.name}});return new Kc({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Fr.isSilhouetteSupported=function(e){return e.context.depthTexture};Fr.createBloomStage=function(){let e=new xo({name:"czm_bloom_contrast_bias",fragmentShader:jF,uniforms:{contrast:128,brightness:-.3}}),t=Z4("czm_bloom_blur"),n=new Kc({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new xo({name:"czm_bloom_generate_composite",fragmentShader:GF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Kc({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Fr.createAmbientOcclusionStage=function(){let e=new xo({name:"czm_ambient_occlusion_generate",fragmentShader:VF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=Z4("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Kc({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new xo({name:"czm_ambient_occlusion_composite",fragmentShader:zF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new Kc({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Fr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var out=`#define FXAA_QUALITY_PRESET 39 +${DN} +${JF}`;Fr.createFXAAStage=function(){return new xo({name:"czm_FXAA",fragmentShader:out,sampleMode:Nu.LINEAR})};Fr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=UF,new xo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=KF,new xo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=e2,new xo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=$F,new xo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Fr.createAutoExposureStage=function(){return new n2};Fr.createBlackAndWhiteStage=function(){return new xo({name:"czm_black_and_white",fragmentShader:HF,uniforms:{gradations:5}})};Fr.createBrightnessStage=function(){return new xo({name:"czm_brightness",fragmentShader:WF,uniforms:{brightness:.5}})};Fr.createNightVisionStage=function(){return new xo({name:"czm_night_vision",fragmentShader:QF})};Fr.createDepthViewStage=function(){return new xo({name:"czm_depth_view",fragmentShader:YF})};Fr.createLensFlareStage=function(){return new xo({name:"czm_lens_flare",fragmentShader:ZF,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:oe.WGS84.maximumRadius}})};var Gf=Fr;function H_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function o2(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function MY(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[o2(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[o2(d)]=!0)}}}return i.name}function i2(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=i2(e,t,n,p,o):a=MY(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=o2(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=o2(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[o2(i.get(p))]=!0}return a}function rut(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=i2(e,t,n,i,void 0);a=i2(e,t,n,o,a),a=MY(e,t,n,r,a),a=i2(e,t,n,e,a),MY(e,t,n,s,a)}else i2(e,t,n,e,void 0);return n}function sut(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let h=d.stages,x=h.length,b=!1;for(let C=0;C<x;++C)if(n[h[C]]){b=!0;break}if(!b)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new mi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function aut(e,t){let n=rut(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=sut(e,i,n[i]))}function LY(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function cut(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new ci({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}H_.prototype.updateDependencies=function(){this._updateDependencies=!0};H_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(LY(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&aut(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,LY(this),cut(this,e))};H_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};H_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};H_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};H_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};H_.prototype.isDestroyed=function(){return!1};H_.prototype.destroy=function(){return LY(this),ue(this)};var gC=H_;var r2={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===r2.REINHARD||e===r2.MODIFIED_REINHARD||e===r2.FILMIC||e===r2.ACES}},a0=Object.freeze(r2);var NY=[];function Jc(){let e=Gf.createFXAAStage(),t=Gf.createAmbientOcclusionStage(),n=Gf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Gf.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=a0.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new gC(this),r={},s=NY;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Jc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return FY(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case a0.REINHARD:n=Gf.createReinhardTonemappingStage(t);break;case a0.MODIFIED_REINHARD:n=Gf.createModifiedReinhardTonemappingStage(t);break;case a0.FILMIC:n=Gf.createFilmicTonemappingStage(t);break;default:n=Gf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function FY(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._stages=t}Jc.prototype.add=function(e){let t=this._stageNames,n=NY;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Jc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=NY;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Jc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Jc.prototype.get=function(e){return FY(this),this._stages[e]};Jc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jc.prototype.getStageByName=function(e){return this._stageNames[e]};Jc.prototype.update=function(e,t,n){FY(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages,s=o.length=r.length,a,c,u=0;for(a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&(o[u++]=c);o.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(o[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,x=this._fxaa;h.enabled=n;let b=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),T=h.enabled&&h._isSupported(e),A=x.enabled&&x._isSupported(e);if((f||this._textureCacheDirty||b!==this._aoEnabled||C!==this._bloomEnabled||T!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=C,this._tonemappingEnabled=T,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Lt({context:e,pixelFormat:ct.RGB,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new hn({wrapS:Pn.REPEAT,wrapT:Pn.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:Ci.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=r.length,a=0;a<s;++a)r[a].update(e,t);for(u=0,a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==o.length,f&&this.update(e,t,n)};Jc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function yC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Jc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return yC(t)};function Lh(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}let r=e.length,s;if(e.inputPreviousStageTexture)for(Lh(e.get(0),t,n,i,o),s=1;s<r;++s)Lh(e.get(s),t,yC(e.get(s-1)),i,o);else for(s=0;s<r;++s)Lh(e.get(s),t,n,i,o)}Jc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!h&&r===0)return;let b=t;d&&a.ready&&(Lh(a,e,b,n,i),b=yC(a)),p&&c.ready&&(Lh(c,e,b,n,i),b=yC(c)),g&&u.ready&&Lh(u,e,b,n,i),h&&f.ready&&(Lh(f,e,b,n,i),b=yC(f));let C=b;if(r>0){Lh(o[0],e,b,n,i);for(let T=1;T<r;++T)Lh(o[T],e,yC(o[T-1]),n,i);C=yC(o[r-1])}x&&s.ready&&Lh(s,e,C,n,i)};Jc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Bl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var s2=Jc;function xC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}xC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};xC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(L.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?zut(this,e):Xut(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var lut=new m,uut=new m,fut=new m,dut=new m,mut=new m,hut=new m,put=new m,_ut=new me,gut=new L,yut=new Si,xut=new on,but={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};xC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(L.IDENTITY);let i=lut,o=uut,r=fut;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(u.positionWC,i),m.clone(u.directionWC,o),m.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,put),d=Mt.eastNorthUpToFixedFrame(f,t,gut);L.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,_ut),i),L.multiplyByPointAsVector(d,o,o),L.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=xut,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=yut,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=but;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Jut(a);a2(this,c),this._previousMode===ne.SCENE2D?Kut(this,e,a,c):(a.position2D=L.multiplyByPoint(co.TRANSFORM_2D,i,dut),a.direction2D=L.multiplyByPointAsVector(co.TRANSFORM_2D,o,mut),a.up2D=L.multiplyByPointAsVector(co.TRANSFORM_2D,r,hut),n._mode=ne.MORPHING,$ye(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var UY={position:new m,direction:new m,up:new m,frustum:void 0},Gye=new Si;xC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(L.IDENTITY),this._previousMode===ne.SCENE2D)Out(this,e,t);else{let i;e>0?(i=UY,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=Wye(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=Gye,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=e0e(i);a2(this,s),kY(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};xC.prototype.isDestroyed=function(){return!1};xC.prototype.destroy=function(){return $4(this),ue(this)};function a2(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Iu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function $4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Cut=new me,Tut=new m,Aut=new L;function Wye(e,t){let n=e._scene,i=n.camera,o=UY,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Cut);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,Tut),f=Mt.eastNorthUpToFixedFrame(u,t,Aut);return L.multiplyByPointAsVector(f,i.direction,s),L.multiplyByPointAsVector(f,i.up,a),o}var Eut=new m,Sut=new m,vut=new m,wut=new m,Iut=new m,Dut=new m;function kY(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,Eut),a=m.clone(r.direction,Sut),c=m.clone(r.up,vut),u=L.multiplyByPoint(co.TRANSFORM_2D_INVERSE,n.position,wut),f=L.multiplyByPointAsVector(co.TRANSFORM_2D_INVERSE,n.direction,Iut),d=L.multiplyByPointAsVector(co.TRANSFORM_2D_INVERSE,n.up,Dut);function p(h){Wf(s,u,h.time,r.position),Wf(a,f,h.time,r.direction),Wf(c,d,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Qye(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Put=new on,jye=new m,qye=new m,Yye=new m,VY=new m,Xye=new m,Kye=new m;function Out(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=UY,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=Wye(e,n));let s;e._morphToOrthographic?(s=Put,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=Gye,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=e0e(r);a2(e,a);let c;e._morphToOrthographic?c=function(){kY(e,t,r,a)}:c=function(){Zye(e,t,r,function(){kY(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,VY),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Wf(e,t,n,i){return m.lerp(e,t,n,i)}function Jye(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=r.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var Rut=new m,Mut=new m,Lut=new m,BY=new m,Nut=new m,Fut=new m,But=new Ar,kut=new wn,Uut=new m,Vut={position:void 0,direction:void 0,up:void 0,frustum:void 0};function zut(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,Rut),r=m.clone(i.direction,Mut),s=m.clone(i.up,Lut),a=m.negate(m.UNIT_Z,Nut),c=m.clone(m.UNIT_Y,Fut),u=BY;if(t>0)m.clone(m.ZERO,BY),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(o,BY);let b=kut;L.multiplyByPoint(co.TRANSFORM_2D,o,b.origin),L.multiplyByPointAsVector(co.TRANSFORM_2D,r,b.direction);let C=n.globe;if(l(C)){let T=C.pickWorldCoordinates(b,n,!0,Uut);l(T)&&(L.multiplyByPoint(co.TRANSFORM_2D_INVERSE,T,u),u.z+=m.distance(o,u))}}let f=But;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=Vut;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=t0e(d);a2(e,p);function g(b){Wf(o,u,b.time,i.position),Wf(r,a,b.time,i.direction),Wf(s,c,b.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(b,C){b.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){Jye(e,t,d,h,p)}});e._currentTweens.push(x)}var Hye=new me,Hut={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Ar},Gut={position:new m,direction:new m,up:new m,frustum:void 0},Wut=new m,jut=new wn,qut=new L,Yut=new m;function Xut(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Hut;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,Hye),i.mapProjection.project(Hye,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let d=jut;m.clone(r.position2D,d.origin);let p=m.clone(o.directionWC,d.direction),g=n.scaleToGeodeticSurface(o.positionWC,Yut),h=Mt.eastNorthUpToFixedFrame(g,n,qut);L.inverseTransformation(h,h),L.multiplyByPointAsVector(h,p,p),L.multiplyByPointAsVector(co.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(d,i,!0,Wut);if(l(b)){let C=m.distance(r.position2D,b);b.x+=C,m.clone(b,r.position2D)}}}function s(d,p){d.position.x=p}L.multiplyByPoint(co.TRANSFORM_2D,r.position,r.position2D),L.multiplyByPointAsVector(co.TRANSFORM_2D,r.direction,r.direction2D),L.multiplyByPointAsVector(co.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Gut;L.multiplyByPoint(co.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let u=t0e(c);a2(e,u);function f(){Jye(e,t,r,s,u)}$ye(e,t,r,f)}function Zye(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Kut(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,VY),a=m.clone(n.direction,Xye),c=m.clone(n.up,Kye);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=m.clone(r.position,jye),d=m.clone(r.direction,qye),p=m.clone(r.up,Yye);f.z=s.z;function g(x){Wf(f,s,x.time,r.position),Wf(d,a,x.time,r.direction),Wf(p,c,x.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let h=o.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():Zye(e,0,n,u)}function $ye(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,jye),a=m.clone(r.direction,qye),c=m.clone(r.up,Yye),u=m.clone(n.position2D,VY),f=m.clone(n.direction2D,Xye),d=m.clone(n.up2D,Kye);function p(h){Wf(s,u,h.time,r.position),Wf(a,f,h.time,r.direction),Wf(c,d,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Mr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Qye(e,o,1,0,t,i)}});e._currentTweens.push(g)}function Qye(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Mr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function e0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),$4(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function t0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),$4(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function Jut(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),$4(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var c2=xC;var Zut={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ri=Object.freeze(Zut);function gc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function $ut(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function n0e(e,t,n){let i=gc(Ri.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new H;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?($ut(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function i0e(e,t){let n=gc(Ri.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Cn.WHEEL,t)}function OS(e,t,n){let i=gc(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;o[i]=!1,r[i]=new H;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let u,f;n===Ri.LEFT_DRAG?(u=Cn.LEFT_DOWN,f=Cn.LEFT_UP):n===Ri.RIGHT_DRAG?(u=Cn.RIGHT_DOWN,f=Cn.RIGHT_UP):n===Ri.MIDDLE_DRAG&&(u=Cn.MIDDLE_DOWN,f=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,o[i]=!0,s[i]=new Date,H.clone(d.position,r[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,a[i]=new Date},f,t)}function o0e(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function r0e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Ri)if(Ri.hasOwnProperty(s)){let a=Ri[s];if(l(a)){let c=gc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new H,endPosition:new H,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Ri)if(Ri.hasOwnProperty(a)){let c=Ri[a];if(l(c)){let u=gc(c,t);r[u]&&(n[u]?(o0e(i[u],o[u]),o[u].valid=!0,o0e(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function jf(e){this._eventHandler=new Iu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,i0e(this,void 0),n0e(this,void 0,e),OS(this,void 0,Ri.LEFT_DRAG),OS(this,void 0,Ri.RIGHT_DRAG),OS(this,void 0,Ri.MIDDLE_DRAG),r0e(this,void 0);for(let t in la)if(la.hasOwnProperty(t)){let n=la[t];l(n)&&(i0e(this,n),n0e(this,n,e),OS(this,n,Ri.LEFT_DRAG),OS(this,n,Ri.RIGHT_DRAG),OS(this,n,Ri.MIDDLE_DRAG),r0e(this,n))}}Object.defineProperties(jf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[gc(Ri.WHEEL)]||!this._update[gc(Ri.WHEEL,la.SHIFT)]||!this._update[gc(Ri.WHEEL,la.CTRL)]||!this._update[gc(Ri.WHEEL,la.ALT)];return this._buttonsDown>0||e}}});jf.prototype.isMoving=function(e,t){let n=gc(e,t);return!this._update[n]};jf.prototype.getMovement=function(e,t){let n=gc(e,t);return this._movement[n]};jf.prototype.getLastMovement=function(e,t){let n=gc(e,t),i=this._lastMovement[n];if(i.valid)return i};jf.prototype.isButtonDown=function(e,t){let n=gc(e,t);return this._isDown[n]};jf.prototype.getStartMousePosition=function(e,t){if(e===Ri.WHEEL)return this._currentMousePosition;let n=gc(e,t);return this._eventStartPosition[n]};jf.prototype.getButtonPressTime=function(e,t){let n=gc(e,t);return this._pressTime[n]};jf.prototype.getButtonReleaseTime=function(e,t){let n=gc(e,t);return this._releaseTime[n]};jf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};jf.prototype.isDestroyed=function(){return!1};jf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var l2=jf;function Q4(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(Q4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});Q4.prototype.cancelTween=function(){this._tweens.remove(this)};function xm(){this._tweens=[]}Object.defineProperties(xm.prototype,{length:{get:function(){return this._tweens.length}}});xm.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new Q4(this);let t=e.duration/Zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Zn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Mr.LINEAR_NONE),r=e.startObject,s=new $me(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new Q4(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};xm.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};xm.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};xm.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};xm.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};xm.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};xm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};xm.prototype.get=function(e){return this._tweens[e]};xm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Zn.SECONDS_PER_MILLISECOND:yi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var bC=xm;function f2(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Ri.LEFT_DRAG,this.zoomEventTypes=[Ri.RIGHT_DRAG,Ri.WHEEL,Ri.PINCH],this.rotateEventTypes=Ri.LEFT_DRAG,this.tiltEventTypes=[Ri.MIDDLE_DRAG,Ri.PINCH,{eventType:Ri.LEFT_DRAG,modifier:la.CTRL},{eventType:Ri.RIGHT_DRAG,modifier:la.CTRL}],this.lookEventTypes={eventType:Ri.LEFT_DRAG,modifier:la.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new l2(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new bC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new H,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new me(Math.PI,P.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Qut(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function eft(e){return H.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var tft=.4;function nft(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<tft){let g=Qut(p,i),h=e.getLastMovement(t,n);if(!l(h)||eft(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function ift(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var s0e=[];function Zc(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(s0e[0]=n,n=s0e);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),ift(e,r)):o<1&&nft(s,f,d,o,i,e,r))}}var eH=new wn,oft=new m,rft=new H,sft=new m,aft=new H,cft=new m,lft=new m,uft=new m,fft=new m,y0e=new m,dft=new m,mft=new m,hft=new m,pft=new m,_ft=new m,gft=new m,yft=new m,xft=new m,bft=new m,Cft=new m,CC=new m,a0e=new m,c0e=new m,zY={orientation:new za};function KY(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(o-u)<1||h<0&&Math.abs(o-f)<1)return;o-h<u?h=o-u-1:o-h>f&&(h=o-f)}let x=e._scene,b=x.camera,C=x.mode,T=zY.orientation;if(T.heading=b.heading,T.pitch=b.pitch,T.roll=b.roll,b.frustum instanceof on){Math.abs(h)>0&&(b.zoomIn(h),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,v=e._rotatingZoom,I;if(A||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),l(e._globe)&&C===ne.SCENE2D?(I=b.getPickRay(t,eH).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=G_(e,t,oft)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(h);return}let O=C===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(C===ne.SCENE2D){let R=e._zoomWorldPosition,N=b.position;if(!m.equals(R,N)&&b.positionCartographic.height<e._maxCoord.x*2){let F=b.position.x,_=m.subtract(R,N,sft);m.normalize(_,_);let E=m.distance(R,N)*h/(b.getMagnitude()*.5);b.move(_,E*.5),(b.position.x<0&&F>0||b.position.x>0&&F<0)&&(I=b.getPickRay(t,eH).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let R=m.normalize(b.position,y0e);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(m.dot(b.direction,R))<.6)O=!0;else{let N=x.canvas,F=aft;F.x=N.clientWidth/2,F.y=N.clientHeight/2;let _=G_(e,F,cft);if(!l(_))O=!0;else if(b.positionCartographic.height<1e6)if(m.dot(b.direction,R)>=-.5)O=!0;else{let E=mft;m.clone(b.position,E);let w=e._zoomWorldPosition,D=dft;if(D=m.normalize(w,D),m.dot(D,R)<0)return;let M=Cft,B=_ft;m.clone(b.direction,B),m.add(E,m.multiplyByScalar(B,1e3,CC),M);let V=gft,U=yft;m.subtract(w,E,V),m.normalize(V,U);let G=m.dot(R,U);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),Y=m.magnitude(E),j=m.magnitude(w),$=Y-h,W=m.magnitude(V),K=Math.asin(P.clamp(W/j*Math.sin(k),-1,1)),J=Math.asin(P.clamp($/j*Math.sin(k),-1,1)),he=K-J+k,ge=hft;m.normalize(E,ge);let se=pft;se=m.cross(U,ge,se),se=m.normalize(se,se),m.normalize(m.cross(ge,se,CC),B),m.multiplyByScalar(m.normalize(M,CC),m.magnitude(M)-h,M),m.normalize(E,E),m.multiplyByScalar(E,$,E);let _e=xft;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,a0e),m.multiplyByScalar(B,Math.sin(he),c0e),CC),$,_e),m.add(E,_e,E),m.normalize(M,ge),m.normalize(m.cross(ge,se,CC),B);let xe=bft;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,a0e),m.multiplyByScalar(B,Math.sin(he),c0e),CC),m.magnitude(M),xe),m.add(M,xe,M),m.clone(E,b.position),m.normalize(m.subtract(M,E,CC),b.direction),m.clone(b.direction,b.direction),m.cross(b.direction,b.up,b.right),m.cross(b.right,b.direction,b.up),b.setView(zY);return}else{let E=m.normalize(_,lft),w=m.normalize(e._zoomWorldPosition,uft),D=m.dot(w,E);if(D>0&&D<1){let M=P.acosClamped(D),B=m.cross(w,E,fft),V=Math.abs(M)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-h,U=h/V;b.rotate(B,M*U)}}}}e._rotatingZoom=!O}if(!A&&O||S){let R,N=Zi.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,rft);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&l(N)?R=b.getPickRay(N,eH):R=b.getPickRay(t,eH);let F=R.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(F.y,F.z,F.x,F),b.move(F,h),e._zoomingOnVector=!0}else b.zoomIn(h);e._cameraUnderground||b.setView(zY)}var Tft=new wn,Aft=new wn,Eft=new m;function Sft(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Tft).origin,s=o.getPickRay(n.endPosition,Aft).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,Eft),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function l0e(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;KY(e,t,n,e._zoomFactor,o.getMagnitude())}var vft=new H,wft=new H;function u0e(e,t,n){if(l(n.angleAndHeight)){Ift(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=vft;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let u=wft;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;o.twistRight(p)}function Ift(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Dft(e){let t=e._scene.mapMode2D===Fl.ROTATE;L.equals(L.IDENTITY,e._scene.camera.transform)?(Zc(e,e.enableTranslate,e.translateEventTypes,Sft,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,l0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Zc(e,e.enableRotate,e.tiltEventTypes,u0e,e.inertiaSpin,"_lastInertiaTiltMovement")):(Zc(e,e.enableZoom,e.zoomEventTypes,l0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Zc(e,e.enableRotate,e.translateEventTypes,u0e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var x0e=new wn,Pft=new m,Oft=new m;function G_(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Pft)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,x0e),u=o.pickWorldCoordinates(c,i,a,Oft),f=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?m.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(s,n):m.clone(u,n)}var Rft=new me;function aH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,Rft);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var Mft=new m;function b0e(e,t){let n=t.origin,i=t.direction,o=aH(e),r=m.normalize(n,Mft),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function C0e(e,t,n,i){let o=m.distance(t.origin,n),r=aH(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),wn.getPoint(t,o,i)}function T0e(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=aH(e))):o=aH(e),wn.getPoint(t,o,i)}var Lft=new H;function A0e(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,Lft),o=e._strafeEndMousePosition;H.add(o,i,o),t.endPosition=o,JY(e,t,e._strafeStartPosition),t.endPosition=n}var f0e=new wn,Nft=new wn,HY=new m,Fft=new m,Bft=new m,kft=new m,Uft=new fn(m.UNIT_X,0),Vft=new H,zft=new H;function Hft(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Bu(e,t,n);return}if(e._strafing){A0e(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=H.clone(n.startPosition,Vft),a=H.clone(n.endPosition,zft),c=o.getPickRay(s,f0e),u=m.clone(m.ZERO,kft),f=m.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=G_(e,s,HY),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let A=d;r&&(A=T0e(e,c,d,HY)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(A,e._strafeStartPosition),e._strafing=!0,JY(e,n,e._strafeStartPosition);return}let p=fn.fromPointNormal(u,f,Uft);c=o.getPickRay(s,f0e);let g=Ji.rayPlane(c,p,HY),h=o.getPickRay(a,Nft),x=Ji.rayPlane(h,p,Fft);if(!l(g)||!l(x)){e._looking=!0,Bu(e,t,n),H.clone(t,e._translateMousePosition);return}let b=m.subtract(g,x,Bft),C=b.x;b.x=b.y,b.y=b.z,b.z=C;let T=m.magnitude(b);T>P.EPSILON6&&(m.normalize(b,b),o.move(b,T))}var E0e=new H,iH=new wn,oH=new m,Gft=new m,S0e=new L,Wft=new L,jft=new m,qft=new fn(m.UNIT_X,0),GY=new m,qY=new me,v0e=new L,Yft=new Be,Xft=new Z,rH=new m;function Kft(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Bu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Jft(e,t,n)):Zft(e,t,n)}function Jft(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=E0e;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,iH),c=m.UNIT_X,u=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-m.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Bu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,oH);m.add(u,g,g);let h=i.mapProjection,x=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let b=h.unproject(g,qY);x.cartographicToCartesian(b,g);let C=Mt.eastNorthUpToFixedFrame(g,x,S0e),T=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=L.clone(o.transform,v0e);o._setTransform(C),Fu(e,t,n,m.UNIT_Z),o._setTransform(S),e._globe=T,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function Zft(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,oH);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=G_(e,t,oH)),!l(s)){a=o.getPickRay(t,iH);let _=a.origin,E=a.direction,w,D=m.dot(c,E);if(Math.abs(D)>P.EPSILON6&&(w=-m.dot(c,_)/D),!l(w)||w<=0){e._looking=!0,Bu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(E,w,oH),m.add(_,s,s)}r&&(l(a)||(a=o.getPickRay(t,iH)),C0e(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let u=i.canvas,f=E0e;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,iH);let d=m.clone(m.ZERO,jft);d.x=s.x;let p=fn.fromPointNormal(d,c,qft),g=Ji.rayPlane(a,p,Gft),h=o._projection,x=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let b=h.unproject(s,qY);x.cartographicToCartesian(b,s);let C=Mt.eastNorthUpToFixedFrame(s,x,S0e),T;l(g)?(m.fromElements(g.y,g.z,g.x,g),b=h.unproject(g,qY),x.cartographicToCartesian(b,g),T=Mt.eastNorthUpToFixedFrame(g,x,Wft)):T=C;let A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=L.clone(o.transform,v0e);o._setTransform(C);let O=m.cross(m.UNIT_Z,m.normalize(o.position,GY),GY),R=m.dot(o.right,O);if(Fu(e,t,n,v,!1,!0),o._setTransform(T),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Fu(e,t,n,v,!0,!1),o.constrainedAxis=E}else Fu(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,rH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=A,e._ellipsoid=S;let N=S.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let F=m.clone(o.positionWC,GY);if(e.enableCollisionDetection&&QY(e),!m.equals(o.positionWC,F)){o._setTransform(T),o.worldToCameraCoordinatesPoint(F,F);let _=m.magnitudeSquared(F);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let E=m.angleBetween(F,o.position),w=m.cross(F,o.position,F);m.normalize(w,w);let D=Be.fromAxisAngle(w,E,Yft),M=Z.fromQuaternion(D,Xft);Z.multiplyByVector(M,o.direction,o.direction),Z.multiplyByVector(M,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var w0e=new H,I0e=new wn,D0e=new m;function $ft(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=w0e,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,I0e),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=G_(e,a,D0e));let g;if(l(p)&&(g=m.distance(u,p)),s){let h=b0e(e,c,d);l(g)?g=Math.min(g,h):g=h}if(!l(g)){let h=m.UNIT_X;g=-m.dot(h,u)/m.dot(h,f)}KY(e,t,n,e._zoomFactor,g)}function Qft(e){let n=e._scene.camera;if(!L.equals(L.IDENTITY,n.transform))Zc(e,e.enableRotate,e.rotateEventTypes,Fu,e.inertiaSpin,"_lastInertiaSpinMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,O0e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Zc(e,e.enableTilt,e.tiltEventTypes,Kft,e.inertiaSpin,"_lastInertiaTiltMovement"),Zc(e,e.enableTranslate,e.translateEventTypes,Hft,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,$ft,e.inertiaZoom,"_lastInertiaZoomMovement"),Zc(e,e.enableLook,e.lookEventTypes,Bu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var edt=new wn,tdt=new fn(m.UNIT_X,0),ndt=new m,idt=new m;function JY(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,edt),s=m.clone(o.direction,idt);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=fn.fromPointNormal(n,s,tdt),c=Ji.rayPlane(r,a,ndt);l(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var d0e=new m,P0e=new me,YY=new m,XY=new oe,odt=new m,rdt=new m,sdt=new m;function adt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!L.equals(o.transform,L.IDENTITY)){Fu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,odt);if(H.equals(t,e._rotateMousePosition)){if(e._looking)Bu(e,t,n,u);else if(e._rotating)Fu(e,t,n);else if(e._strafing)A0e(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=YY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,XY),jY(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,P0e).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=G_(e,n.startPosition,sdt);if(l(p)){let g=!1,h=o.getPickRay(n.startPosition,x0e);if(r)g=!0,T0e(e,h,p,p);else{let x=s.geodeticSurfaceNormal(p,rdt);Math.abs(m.dot(h.direction,x))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,JY(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=YY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,XY),jY(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Bu(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,d0e))?(jY(e,t,n,e._ellipsoid),m.clone(d0e,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Fu(e,t,n)):(e._looking=!0,Bu(e,t,n,u));H.clone(t,e._rotateMousePosition)}function Fu(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,x=d*g*Math.PI;o||a.rotateRight(h),r||a.rotateUp(x),a.constrainedAxis=u}var WY=re.clone(re.UNIT_W),m0e=re.clone(re.UNIT_W),tH=new m,RS=new m,nH=new m,h0e=new m,cdt=new H,ldt=new H,udt=new H,fdt=new H,ddt=new wn;function jY(e,t,n,i){let o=e._scene,r=o.camera,s=H.clone(n.startPosition,cdt),a=H.clone(n.endPosition,ldt),c=i.cartesianToCartographic(r.positionWC,P0e).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=m.clone(e._panLastWorldPosition,WY),!l(e._globe)&&!H.equalsEpsilon(s,e._panLastMousePosition)&&(u=G_(e,s,WY)),!l(e._globe)&&l(u))){let d=m.subtract(u,r.positionWC,RS),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,d),RS),g=m.magnitude(p),h=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,fdt),x=H.subtract(a,s,udt),b=m.multiplyByScalar(r.rightWC,x.x*h.x,RS),C=m.normalize(r.positionWC,y0e),T=r.getPickRay(a,ddt).direction,A=m.subtract(T,m.projectVector(T,r.rightWC,nH),nH),S=m.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let I=Math.abs(m.dot(r.directionWC,C)),O=-x.y*h.y*2/Math.sqrt(v)*(1-I),R=m.multiplyByScalar(T,O,nH);I=Math.abs(m.dot(r.upWC,C));let N=m.multiplyByScalar(r.upWC,-x.y*(1-I)*h.y,h0e);f=m.add(u,b,m0e),f=m.add(f,R,f),f=m.add(f,N,f),m.clone(f,e._panLastWorldPosition),H.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,WY),f=r.pickEllipsoid(a,i,m0e)),!l(u)||!l(f)){e._rotating=!0,Fu(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=m.mostOrthogonalAxis(d,tH);m.cross(p,d,p),m.normalize(p,p);let g=m.cross(d,p,RS),h=m.magnitude(u),x=m.dot(d,u),b=Math.acos(x/h),C=m.multiplyByScalar(d,x,nH);m.subtract(u,C,C),m.normalize(C,C);let T=m.magnitude(f),A=m.dot(d,f),S=Math.acos(A/T),v=m.multiplyByScalar(d,A,h0e);m.subtract(f,v,v),m.normalize(v,v);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=P.TWO_PI-I);let O=Math.acos(m.dot(v,p));m.dot(v,g)<0&&(O=P.TWO_PI-O);let R=I-O,N;m.equalsEpsilon(d,r.position,P.EPSILON2)?N=r.right:N=m.cross(d,r.position,tH);let F=m.cross(d,N,tH),_=m.dot(F,m.subtract(u,d,RS)),E=m.dot(F,m.subtract(f,d,RS)),w;_>0&&E>0?w=S-b:_>0&&E<=0?m.dot(r.position,d)>0?w=-b-S:w=b+S:w=b-S,r.rotateRight(R),r.rotateUp(w)}else{m.normalize(u,u),m.normalize(f,f);let d=m.dot(u,f),p=m.cross(u,f,tH);if(d<1&&!m.equalsEpsilon(p,m.ZERO,P.EPSILON14)){let g=Math.acos(d);r.rotate(p,g)}}}var mdt=new m,hdt=new me,p0e=0;function O0e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=w0e,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,I0e),d,p=o.cartesianToCartographic(s.position,hdt).height,g=Math.abs(p0e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=G_(e,u,D0e));let x;if(l(d)&&(x=m.distance(f.origin,d),p0e=x),c){let C=b0e(e,f,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let b=m.normalize(s.position,mdt);KY(e,t,n,e._zoomFactor,x,m.dot(b,s.direction))}var R0e=new H,sH=new wn,u2=new m,pdt=new m,M0e=new L,_dt=new L,L0e=new L,gdt=new Be,ydt=new Z,ZY=new me,$Y=new m;function xdt(e,t,n){let o=e._scene.camera;if(!L.equals(o.transform,L.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,$Y);Bu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,ZY);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Cdt(e,t,n)):Tdt(e,t,n)}var bdt=new me;function Cdt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,bdt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=R0e;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,sH),d,p=Ji.rayEllipsoid(f,i);if(l(p))d=wn.getPoint(f,p.start,u2);else if(a>e._minimumTrackBallHeight){let T=Ji.grazingAltitudeLocation(f,i);if(!l(T))return;let A=i.cartesianToCartographic(T,ZY);A.height=0,d=i.cartographicToCartesian(A,u2)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(r.position,$Y);Bu(e,t,n,T),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,M0e),h=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=L.clone(r.transform,L0e);r._setTransform(g),Fu(e,t,n,m.UNIT_Z),r._setTransform(b),e._globe=h,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Tdt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,u2);else{if(a=G_(e,t,u2),!l(a)){if(c=r.getPickRay(t,sH),u=Ji.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,ZY).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,$Y);Bu(e,t,n,E),H.clone(t,e._tiltCenterMousePosition)}return}a=wn.getPoint(c,u.start,u2)}s&&(l(c)||(c=r.getPickRay(t,sH)),C0e(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=o.canvas,d=R0e;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,sH);let p=m.magnitude(a),g=m.fromElements(p,p,p,YY),h=oe.fromCartesian3(g,XY);if(u=Ji.rayEllipsoid(c,h),!l(u))return;let x=m.magnitude(c.origin)>p?u.start:u.stop,b=wn.getPoint(c,x,pdt),C=Mt.eastNorthUpToFixedFrame(a,i,M0e),T=Mt.eastNorthUpToFixedFrame(b,h,_dt),A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=L.clone(r.transform,L0e);r._setTransform(T);let O=m.cross(b,r.positionWC,rH);if(m.dot(r.rightWC,O)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Fu(e,t,n,v,!0,!1),r.constrainedAxis=E}else Fu(e,t,n,v,!0,!1);if(r._setTransform(C),Fu(e,t,n,v,!1,!0),l(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,rH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=A,e._ellipsoid=S;let N=S.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let F=m.clone(r.positionWC,rH);if(e.enableCollisionDetection&&QY(e),!m.equals(r.positionWC,F)){r._setTransform(T),r.worldToCameraCoordinatesPoint(F,F);let _=m.magnitudeSquared(F);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let E=m.angleBetween(F,r.position),w=m.cross(F,r.position,F);m.normalize(w,w);let D=Be.fromAxisAngle(w,E,gdt),M=Z.fromQuaternion(D,ydt);Z.multiplyByVector(M,r.direction,r.direction),Z.multiplyByVector(M,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Adt=new H,Edt=new H,_0e=new wn,g0e=new wn,Sdt=new m,vdt=new m;function Bu(e,t,n,i){let r=e._scene.camera,s=Adt;s.x=n.startPosition.x,s.y=0;let a=Edt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,_0e),u=r.getPickRay(a,g0e),f=0,d,p;r.frustum instanceof on?(d=c.origin,p=u.origin,m.add(r.direction,d,d),m.add(r.direction,p,p),m.subtract(d,r.position,d),m.subtract(p,r.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(h)?r.look(h,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,_0e),u=r.getPickRay(a,g0e),f=0,r.frustum instanceof on?(d=c.origin,p=u.origin,m.add(r.direction,d,d),m.add(r.direction,p,p),m.subtract(d,r.position,d),m.subtract(p,r.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),l(i)){let x=r.direction,b=m.negate(i,Sdt),C=m.equalsEpsilon(x,i,P.EPSILON2),T=m.equalsEpsilon(x,b,P.EPSILON2);if(!C&&!T){g=m.dot(x,i);let A=P.acosClamped(g);f>0&&f>A&&(f=A-P.EPSILON4),g=m.dot(x,b),A=P.acosClamped(g),f<0&&-f>A&&(f=-A+P.EPSILON4);let S=m.cross(i,x,vdt);r.look(S,f)}else(C&&f<0||T&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function wdt(e){Zc(e,e.enableRotate,e.rotateEventTypes,adt,e.inertiaSpin,"_lastInertiaSpinMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,O0e,e.inertiaZoom,"_lastInertiaZoomMovement"),Zc(e,e.enableTilt,e.tiltEventTypes,xdt,e.inertiaSpin,"_lastInertiaTiltMovement"),Zc(e,e.enableLook,e.lookEventTypes,Bu)}var Idt=new L,Ddt=new me;function QY(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let o=t.camera,r=i.ellipsoid,s=t.mapProjection,a,c;L.equals(o.transform,L.IDENTITY)||(a=L.clone(o.transform,Idt),c=m.magnitude(o.position),o._setTransform(L.IDENTITY));let u=Ddt;n===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0)}}l(a)&&(o._setTransform(a),f&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}f2.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Pdt=new m,Odt=new m;f2.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;L.equals(t.transform,L.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=oe.UNIT_SPHERE);let o=l(this._globe)?this._globe.terrainExaggeration:1,r=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=Ac.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Ac.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Ac.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,Pdt),c=m.clone(t.directionWC,Odt);i===ne.SCENE2D?Dft(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Qft(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,wdt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&QY(this),this._aggregator.reset()};f2.prototype.isDestroyed=function(){return!1};f2.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var d2=f2;var m2=`uniform sampler2D colorTexture; +uniform sampler2D colorTexture2; + +uniform vec2 center; +uniform float radius; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color0 = texture(colorTexture, v_textureCoordinates); + vec4 color1 = texture(colorTexture2, v_textureCoordinates); + + float x = length(gl_FragCoord.xy - center) / radius; + float t = smoothstep(0.5, 0.8, x); + out_FragColor = mix(color0 + color1, color1, t); +} +`;var h2=`uniform sampler2D colorTexture; + +uniform float avgLuminance; +uniform float threshold; +uniform float offset; + +in vec2 v_textureCoordinates; + +float key(float avg) +{ + float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); + return max(0.0, guess) + 0.1; +} + +// See section 9. "The bright-pass filter" of Realtime HDR Rendering +// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf + +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec3 xyz = czm_RGBToXYZ(color.rgb); + float luminance = xyz.r; + + float scaledLum = key(avgLuminance) * luminance / avgLuminance; + float brightLum = max(scaledLum - threshold, 0.0); + float brightness = brightLum / (offset + brightLum); + + xyz.r = brightness; + out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); +} +`;function W_(){this._sceneFramebuffer=new uC;let e=.125,t=new Array(6);t[0]=new xo({fragmentShader:Bl,textureScale:e,forcePowerOfTwo:!0,sampleMode:Nu.LINEAR});let n=t[1]=new xo({fragmentShader:h2,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new xo({fragmentShader:s0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new xo({fragmentShader:s0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new xo({fragmentShader:Bl,sampleMode:Nu.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new xo({fragmentShader:m2,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Kc({stages:t});let o=new gC(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}W_.prototype.get=function(e){return this._stages.get(e)};W_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Rdt=new re,N0e=new H,Mdt=new H,F0e=new L;function Ldt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=L.computeViewportTransformation(n,0,1,F0e),u=L.multiplyByPoint(r,o,Rdt),f=Mt.pointToGLWindowCoordinates(s,c,o,N0e);u.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=H.magnitude(H.subtract(d,f,d))*30*2,g=Mdt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,C=b.get(0),T=C.outputTexture.width,A=C.outputTexture.height,S=new Ke;S.width=T,S.height=A,c=L.computeViewportTransformation(S,0,1,F0e),f=Mt.pointToGLWindowCoordinates(s,c,o,N0e),g.x*=T/h,g.y*=A/x;let v=C.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,h),v.height=Math.min(g.y,x);for(let I=1;I<4;++I)Ke.clone(v,b.get(I).scissorRectangle)}W_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};W_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Ldt(this,t,n),o};W_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};W_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Bl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};W_.prototype.isDestroyed=function(){return!1};W_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var p2=W_;function B0e(){this._cachedShowFrustumsShaders={}}function Ndt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Fdt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Ge.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`,a+=`uniform vec3 debugShowFrustumsColor; +`,a+=`void main() +{ + czm_Debug_main(); +`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor; +`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; +`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; +`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; +`;a+="}",o.sources.push(a);let u=Ndt(i);return Zt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var _2=new z;function Bdt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(_2.red=t.debugOverlappingFrustums&1?1:0,_2.green=t.debugOverlappingFrustums&2?1:0,_2.blue=t.debugOverlappingFrustums&4?1:0,_2.alpha=1,_2):z.WHITE}),n}var kdt=new nt;B0e.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Fdt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,kdt);r.shaderProgram=o,r.uniformMap=Bdt(e,t),r.execute(e.context,n)};var g2=B0e;var lH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Gi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new yN(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Wn(),this._jobScheduler=new SF,this._frameState=new AF(s,new _F(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new mN(s),this._globe=void 0,this._globeTranslucencyState=new EF,this._primitives=new vl,this._groundPrimitives=new vl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new bC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new xF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ci({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ci({depth:1,owner:this}),this._stencilClearCommand=new ci({stencil:0}),this._classificationStencilClearCommand=new ci({stencil:0,renderState:Ve.fromCache({stencilMask:Bt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new c2(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new g2,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new vi,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new TF,this._shadowMapCamera=new co(this),this.shadowMap=new z_({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new IS,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new s2,this._brdfLutGenerator=new uF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new d2(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Fl.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Ua.requestCompletedEvent.addEventListener(lH(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(lH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new co(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new co(this),this.preloadFlightCullingVolume=void 0,this._picking=new kF(this),this._defaultView=new mC(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new O_,z0e(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function Udt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(lH(e))),n.push(t.terrainProviderChanged.addEventListener(lH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Gi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Gt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Gt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return hd.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Udt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new co(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new CF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Gt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Gi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function k0e(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=B_.createPickDerivedCommand(e,t,o,c.picking)),t.pickOnly||(c.depth=B_.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=B_.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=z_.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ae.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}Gi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,o=t.shadowState.lastDirtyTime;e.lastDirtyTime!==o&&(e.lastDirtyTime=o,e.dirty=!0,i=!0);let r=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=r&&!c,p=s&&!u,g=(!r||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=z_.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=B_.createLogDepthCommand(e,n,a.logDepth),k0e(this,a.logDepth.command,i)),(f||g)&&k0e(this,e,i)}};var Vdt=new zf({pass:Mo.RENDER}),eX=new zf({pass:Mo.PRELOAD}),tX=new zf({pass:Mo.PRELOAD_FLIGHT}),zdt=new zf({pass:Mo.REQUEST_RENDER_MODE_DEFER_CHECK}),U0e=new ae,nX;function Hdt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return U0e.radius=n.minimumRadius+i,nX=aN.fromBoundingSphere(U0e,e.camera.positionWC,nX),nX}}Gi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function z0e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Gi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Hdt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof Ar),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),IS.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Gi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==tn.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var cH=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);cH=L.inverseTransformation(cH,cH);function Gdt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(o.mode!==ne.SCENE3D){c=L.multiplyByPoint(cH,c,c);let p=o.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=kn.toWireframe(Ls.createGeometry(new Ls({radii:new m(p,p,p),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new In({geometryInstances:new Ct({geometry:a,modelMatrix:L.fromTranslation(c),attributes:{color:new zt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=kn.toWireframe(rl.createGeometry(rl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new In({geometryInstances:new Ct({geometry:a,modelMatrix:L.fromRotationTranslation(p,c,new L),attributes:{color:new zt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}let u=o.commandList,f=o.commandList=[];t._debugVolume.update(o),e=f[0],o.useLogDepth&&(e=B_.createLogDepthCommand(e,r).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(d)&&(n.framebuffer=d),o.commandList=u}function Ma(e,t,n,i,o){let r=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ci){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Gdt(e,t,i,o),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function y2(e,t,n,i){let o=t._frameState,r=e.derivedCommands;l(r)&&(o.useLogDepth&&l(r.logDepth)&&(e=r.logDepth.command),r=e.derivedCommands,l(r.picking)?(e=r.picking.pickCommand,e.execute(n,i)):l(r.depth)&&(e=r.depth.depthOnlyCommand,e.execute(n,i)))}function H0e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Wdt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function jdt(e,t,n,i,o){let r=e.context;P_(i,H0e,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function qdt(e,t,n,i,o){let r=e.context;P_(i,Wdt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Ydt(e,t,n,i){let o=e.context;P_(i,H0e,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var Xdt=new Si,Kdt=new qc,Jdt=new on,Zdt=new Ar;function iX(e,t){let n=e.camera,i=e.context,o=e.frameState,r=i.uniformState;r.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(Xdt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Kdt):l(n.frustum.width)?s=n.frustum.clone(Jdt):s=n.frustum.clone(Zdt),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Ae.ENVIRONMENT);let a=o.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let E=u.skyBoxCommand;if(l(E)&&Ma(E,e,i,t),u.isSkyAtmosphereVisible&&Ma(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let w;u.useGlobeDepthFramebuffer?w=f.globeDepth.framebuffer:u.usePostProcess?w=f.sceneFramebuffer.framebuffer:w=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,w),t.framebuffer=w}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(E,w,D,M,B){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(E,w,D,M,B)}),g=e._executeOITFunction):a.render?g=jdt:g=qdt;let h=f.frustumCommandsList,x=h.length,b=u.clearGlobeDepth,C=u.useDepthPlane,T=e._globeTranslucencyState,A=T.translucent,S=e._view.globeTranslucencyFramebuffer,v=e._depthClearCommand,I=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,N=u.usePostProcessSelected,F=n.position.z,_;for(let E=0;E<x;++E){let w=x-E-1,D=h[w];e.mode===ne.SCENE2D?(n.position.z=F-D.near+1,s.far=Math.max(1,D.far-D.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&I.execute(i,t),r.updatePass(Ae.GLOBE);let M=D.commands[Ae.GLOBE],B=D.indices[Ae.GLOBE];if(A)T.executeGlobeCommands(D,Ma,S,e,t);else for(_=0;_<B;++_)Ma(M[_],e,i,t);let V=f.globeDepth;if(l(V)&&u.useGlobeDepthFramebuffer&&V.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(r.updatePass(Ae.TERRAIN_CLASSIFICATION),M=D.commands[Ae.TERRAIN_CLASSIFICATION],B=D.indices[Ae.TERRAIN_CLASSIFICATION],A)T.executeGlobeClassificationCommands(D,Ma,S,e,t);else for(_=0;_<B;++_)Ma(M[_],e,i,t);if(b&&(v.execute(i,t),C&&R.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)Ma(M[_],e,i,t);if(B>0&&(l(V)&&u.useGlobeDepthFramebuffer&&(V.prepareColorTextures(i,b),V.executeUpdateDepth(i,t,b,V.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)Ma(M[_],e,i,t)}else{e._invertClassification.clear(i,t);let Y=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)Ma(M[_],e,i,t);for(l(V)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),V.executeUpdateDepth(i,t,b,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<B;++_)Ma(M[_],e,i,t);for(t.framebuffer=Y,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),B>0&&i.stencilBuffer&&O.execute(i,t),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)Ma(M[_],e,i,t)}for(B>0&&i.stencilBuffer&&I.execute(i,t),r.updatePass(Ae.VOXELS),M=D.commands[Ae.VOXELS],B=D.indices[Ae.VOXELS],M.length=B,Ydt(e,Ma,t,M),r.updatePass(Ae.OPAQUE),M=D.commands[Ae.OPAQUE],B=D.indices[Ae.OPAQUE],_=0;_<B;++_)Ma(M[_],e,i,t);w!==0&&e.mode!==ne.SCENE2D&&(s.near=D.near,r.updateFrustum(s));let U;if(!c&&u.useInvertClassification&&o.invertClassificationColor.alpha<1&&(U=e._invertClassification),r.updatePass(Ae.TRANSLUCENT),M=D.commands[Ae.TRANSLUCENT],M.length=D.indices[Ae.TRANSLUCENT],g(e,Ma,t,M,U),D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,Ma,t,M,V.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,Ma,t,D)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let Y=V.depthStencilTexture,j=e._picking.getPickDepth(e,w);j.update(i,Y),j.executeCopyDepth(i,t)}if(c||!N)continue;let k=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,r.updateFrustum(s),r.updatePass(Ae.GLOBE),M=D.commands[Ae.GLOBE],B=D.indices[Ae.GLOBE],A)T.executeGlobeCommands(D,y2,S,e,t);else for(_=0;_<B;++_)y2(M[_],e,i,t);for(b&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),b&&C&&R.execute(i,t),r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)y2(M[_],e,i,t);for(r.updatePass(Ae.OPAQUE),M=D.commands[Ae.OPAQUE],B=D.indices[Ae.OPAQUE],_=0;_<B;++_)y2(M[_],e,i,t);for(r.updatePass(Ae.TRANSLUCENT),M=D.commands[Ae.TRANSLUCENT],B=D.indices[Ae.TRANSLUCENT],_=0;_<B;++_)y2(M[_],e,i,t);t.framebuffer=k}}function G0e(e){e.context.uniformState.updatePass(Ae.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,o=i.length;for(let r=0;r<o;++r)i[r].execute(e._computeEngine)}function $dt(e,t){e.context.uniformState.updatePass(Ae.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function Qdt(e,t,n){let i=n.shadowMapCullingVolume,o=n.isPointLight,r=n.passes,s=r.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Ae.GLOBE||u.pass===Ae.CESIUM_3D_TILE||u.pass===Ae.OPAQUE||u.pass===Ae.TRANSLUCENT)&&e.isVisible(u,i))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(u,p))r[d].commandList.push(u),f=!0;else if(f)break}}}}function W0e(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let o=e.context,r=o.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;Qdt(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];r.updateCamera(p.camera),a.updatePass(o,d);let g=p.commandList.length;for(let h=0;h<g;++h){let x=p.commandList[h];r.updatePass(x.pass),Ma(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var emt=new m;Gi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?tmt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===Fl.ROTATE?(nmt(this,e),c0(!0,this,e,t)):(oX(this,e,t),fmt(this,e))};function tmt(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;oX(e,t,n),j0e(e),i.createPotentiallyVisibleSet(e),G0e(e),s||W0e(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=co.clone(o,e._cameraVR);c.frustum=o.frustum;let u=o.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,emt);o.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;m.add(c.position,p,o.position),o.frustum.xOffset=g,iX(e,t),a.x=a.width,m.subtract(c.position,p,o.position),o.frustum.xOffset=-g,iX(e,t),co.clone(c,o)}function nmt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var imt=new me(Math.PI,P.PI_OVER_TWO),omt=new m,rmt=new m,smt=new L,amt=new L,cmt=new m,lmt=new m,umt=new Ke;function fmt(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=Ke.clone(r,umt);t.viewport=s;let a=imt,c=omt;e.mapProjection.project(a,c);let f=m.clone(o.position,rmt),d=L.clone(o.transform,amt),p=o.frustum.clone();o._setTransform(L.IDENTITY);let g=L.computeViewportTransformation(s,0,1,smt),h=o.frustum.projectionMatrix,x=o.positionWC.y,b=m.fromElements(P.sign(x)*c.x-x,0,-o.positionWC.x,cmt),C=Mt.pointToGLWindowCoordinates(h,g,b,lmt);C.x=Math.floor(C.x);let T=s.x,A=s.width;if(x===0||C.x<=T||C.x>=T+A)c0(!0,e,t);else if(Math.abs(T+A*.5-C.x)<1)s.width=C.x-s.x,o.position.x*=P.sign(o.position.x),o.frustum.right=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!0,e,t),s.x=C.x,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!1,e,t);else if(C.x>T+A*.5){s.width=C.x-T;let S=o.frustum.right;o.frustum.right=c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!0,e,t),s.x=C.x,s.width=T+A-C.x,o.position.x=-o.position.x,o.frustum.left=-o.frustum.right,o.frustum.right=S-o.frustum.right*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!1,e,t)}else{s.x=C.x,s.width=T+A-C.x;let S=o.frustum.left;o.frustum.left=-c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!0,e,t),s.x=T,s.width=C.x-T,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=S-o.frustum.left*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),c0(!1,e,t)}o._setTransform(d),m.clone(f,o.position),o.frustum=p.clone(),t.viewport=r}function c0(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),j0e(t),r.createPotentiallyVisibleSet(t),e&&(l(i)&&oX(t,n,i),G0e(t),s||W0e(t)),iX(t,n)}var V0e=new Zr;Gi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof on||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(r)?(l(s)&&(r.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=r.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(x)?x.drawCommand:void 0,n.sunComputeCommand=l(x)?x.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=V0e.planes;for(let x=0;x<5;++x)p[x]=d.planes[x];d=V0e,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;l(g)&&(!l(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new hd(g)):!l(g)&&l(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function dmt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new vh({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function mmt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(o!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=o),t.shadowState.lightShadowsEnabled=!1,!!o){for(let r=0;r<i;++r)if(n[r]!==t.shadowState.shadowMaps[r]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let r=0;r<i;++r){let s=n[r];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function j0e(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),dmt(e),mmt(e),e._globe&&e._globe.render(t)}function oX(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new p2:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let h=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,o.useLogDepth,e._hdr),h.clear(i),x=r.usePostProcess=h.ready,r.usePostProcessSelected=x&&h.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&r.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,A=T.derivedCommands;A.oit=p.createDerivedCommands(T,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Gi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,o=i.globeDepth;l(o)&&o.prepareColorTextures(t);let r=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?o.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;r&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!r&&(g=u);let h=this.postProcessStages,x=g.getColorTexture(0),b=d.getColorTexture(0),C=y(u,f).getDepthStencilTexture();h.execute(t,x,C,b),h.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function hmt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function pmt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function _mt(e){let t=e.camera,n=e._mode,i=e.globe,o=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!o.onMap()&&r.height<0)return!0;if(!l(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return l(s)&&r.height<s}Gi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=pmt(this),this._cameraUnderground=_mt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function gmt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new k_({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function ymt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function xmt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),Ua.update()}var bmt=new z;function Cmt(e){let t=e._frameState,n=e.context,i=n.uniformState,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Vdt;let r=y(e.backgroundColor,z.BLACK);e._hdr&&(r=z.clone(r,bmt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof O_?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,$dt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function TC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Tmt(e){return e._picking.updateMostDetailedRayPicks(e)}Gi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);z0e(this,o,e),t.newFrame=!0}TC(this,ymt),this.primitives.show&&(TC(this,Tmt),TC(this,Amt),TC(this,Emt),i||TC(this,Smt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),TC(this,Cmt)),gmt(this,i),TC(this,xmt),hmt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Gi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Gi.prototype.requestRender=function(){this._renderRequested=!0};Gi.prototype.clampLineWidth=function(e){return Math.max(Gt.minimumAliasedLineWidth,Math.min(e,Gt.maximumAliasedLineWidth))};Gi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Gi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Gi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Gi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Amt(e){let t=e._frameState;eX.camera=t.camera,eX.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,eX)}function Emt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;tX.camera=e.preloadFlightCamera,tX.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,tX)}function Smt(e){e.primitives.updateForPass(e._frameState,zdt)}Gi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Gi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Gi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Gi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Gi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Gi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Gi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Gi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Gi.prototype.cartesianToCanvasCoordinates=function(e,t){return Zi.wgs84ToWindowCoordinates(this,e,t)};Gi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Gi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Gi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Gi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function vmt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Gi.prototype.setTerrain=function(e){return vmt(this,e),e};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var x2=Gi;function MS(e){e=y(e,oe.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=L.fromScale(n),this._modelMatrix=new L,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(MS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});MS.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var rX=new L;MS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=L.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,rX),o=L.multiplyTransformation(i,uo.Y_UP_TO_Z_UP,rX),r=L.multiply(this._scaleMatrix,o,rX);L.clone(r,this._modelMatrix);let s=e.context,a=wmt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Ls.createGeometry(new Ls({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Me.POSITION_ONLY}));f.vertexArray=ri.fromGeometry({context:s,geometry:p,attributeLocations:kn.createAttributeLocations(p),bufferUsage:ke.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:mn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ge({defines:p,sources:[R_,oS,NN]}),h=new Ge({defines:p,sources:[R_,oS,LN]});this._spSkyAtmosphere=Zt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function wmt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}MS.prototype.isDestroyed=function(){return!1};MS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var b2=MS;function uH(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new nt({modelMatrix:L.clone(L.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}uH.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let r=this.sources;typeof r.positiveX=="string"?xN(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ha({context:i,source:r}))}let o=this._command;if(!l(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return n._cubeMap}};let r=rl.createGeometry(rl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Me.POSITION_ONLY})),s=this._attributeLocations=kn.createAttributeLocations(r);o.vertexArray=ri.fromGeometry({context:i,geometry:r,attributeLocations:s,bufferUsage:ke.STATIC_DRAW}),o.renderState=Ve.fromCache({blending:mn.ALPHA_BLEND})}if(!l(o.shaderProgram)||this._useHdr!==t){let r=new Ge({defines:[t?"HDR":""],sources:[FN]});o.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:BN,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return o};uH.prototype.isDestroyed=function(){return!1};uH.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var C2=uH;function A2(){this.show=!0,this._drawCommand=new nt({primitiveType:Fe.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(A2.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Imt=new H,Dmt=new H,Pmt=new re,T2=new re;A2.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._texture=new Lt({context:o,width:S,height:S,pixelFormat:ct.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,O={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new Zu({fragmentShaderSource:UN,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let I=ht.createVertexBuffer({context:o,typedArray:v,usage:ke.STATIC_DRAW}),O=[{index:S.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=ht.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});a.vertexArray=new ri({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=Zt.fromCache({context:o,vertexShaderSource:VN,fragmentShaderSource:kN,attributeLocations:S}),a.renderState=Ve.fromCache({blending:mn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=Zi.computeActualWgs84Position(e,c,T2),g=m.magnitude(m.subtract(p,e.camera.position,T2)),h=o.uniformState.projection,x=Pmt;x.x=0,x.y=0,x.z=-g,x.w=1;let b=L.multiplyByVector(h,x,T2),C=Zi.clipToGLWindowCoordinates(t.viewport,b,Imt);x.x=P.SOLAR_RADIUS;let T=L.multiplyByVector(h,x,T2),A=Zi.clipToGLWindowCoordinates(t.viewport,T,Dmt);return this._size=H.magnitude(H.subtract(A,C,T2)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};A2.prototype.isDestroyed=function(){return!1};A2.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var E2=A2;function LS(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Omt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let r="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(r,void 0,o)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function q0e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Y0e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=q0e(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function X0e(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function AC(e,t){e=On(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Wt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Wt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?On(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?On(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new zd,Y0e(this);try{let p=new x2({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,q0e(this),X0e(this);let g=y(p.mapProjection.ellipsoid,oe.WGS84),h=t.globe;l(h)||(h=new rF(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,bn.RECEIVE_ONLY));let x=t.skyBox;l(x)||(x=new C2({sources:{positiveX:LS("px"),negativeX:LS("mx"),positiveY:LS("py"),negativeY:LS("my"),positiveZ:LS("pz"),negativeZ:LS("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new E2,p.moon=new cF);let b=t.skyAtmosphere;l(b)||(b=new b2(g)),b!==!1&&(p.skyAtmosphere=b),l(t.imageryProvider)&&Q("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(l(t.imageryProvider)&&!l(C)&&(C=new Vs(t.imageryProvider)),l(C)||(C=Vs.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new Iu(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(A,S){if(T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors){let v="An error occurred while rendering. Rendering has stopped.";T.showErrorPanel(v,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(AC.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Omt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});AC.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=bh(n);u||(typeof n=="string"&&(n=new Error(n)),t=bh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${h}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(C){x.removeChild(b),x.appendChild(document.createTextNode(h)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},d.appendChild(p),i.appendChild(o)};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};AC.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Y0e(this),X0e(this),this._scene.requestRender())};AC.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var S2=AC;var Rmt=new m(1,1,1);function sX(e){e=y(e,Rmt),this._dimensions=m.clone(e)}Object.defineProperties(sX.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var Mmt=new m;sX.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,Mmt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var aX=sX;var v2=`// See Intersection.glsl for the definition of intersectScene +// See IntersectionUtils.glsl for the definition of nextIntersection +// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl +// for the definition of convertUvToShapeUvSpace. The appropriate function is +// selected based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See Octree.glsl for the definitions of TraversalData, SampleData, +// traverseOctreeFromBeginning, and traverseOctreeFromExisting +// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture + +#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 + +uniform mat3 u_transformDirectionViewToLocal; +uniform vec3 u_cameraPositionUv; +uniform float u_stepSize; + +#if defined(PICKING) + uniform vec4 u_pickColor; +#endif + +#if defined(JITTER) +float hash(vec2 p) +{ + vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); +} +#endif + +vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { +#if defined(SHAPE_BOX) + Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); + RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); + vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; + float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); + float dt = (exit - entry.w) * RAY_SCALE; + return vec4(normalize(entry.xyz), dt); +#else + float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); + return vec4(viewRay.dir, u_stepSize / dimAtLevel); +#endif +} + +void main() +{ + vec4 fragCoord = gl_FragCoord; + vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] + vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); + vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case + vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case + vec3 viewPosUv = u_cameraPositionUv; + #if defined(SHAPE_BOX) + vec3 dInv = 1.0 / viewDirUv; + Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); + #else + Ray viewRayUv = Ray(viewPosUv, viewDirUv); + #endif + + Intersections ix; + RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); + + // Exit early if the scene was completely missed. + if (shapeIntersection.entry.w == NO_HIT) { + discard; + } + + float currT = shapeIntersection.entry.w * RAY_SCALE; + float endT = shapeIntersection.exit.w; + vec3 positionUv = viewPosUv + currT * viewDirUv; + vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + + // Traverse the tree from the start position + TraversalData traversalData; + SampleData sampleDatas[SAMPLE_COUNT]; + traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); + vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + + #if defined(JITTER) + float noise = hash(screenCoord); // [0,1] + currT += noise * step.w; + positionUv += noise * step.w * viewDirUv; + #endif + + FragmentInput fragmentInput; + #if defined(STATISTICS) + setStatistics(fragmentInput.metadata.statistics); + #endif + + vec4 colorAccum =vec4(0.0); + + for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { + // Read properties from the megatexture based on the traversal state + Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); + + // Prepare the custom shader inputs + copyPropertiesToMetadata(properties, fragmentInput.metadata); + fragmentInput.voxel.positionUv = positionUv; + fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; + fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; + fragmentInput.voxel.viewDirUv = viewDirUv; + fragmentInput.voxel.viewDirWorld = viewDirWorld; + fragmentInput.voxel.surfaceNormal = step.xyz; + fragmentInput.voxel.travelDistance = step.w; + + // Run the custom shader + czm_modelMaterial materialOutput; + fragmentMain(fragmentInput, materialOutput); + + // Sanitize the custom shader output + vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); + color.rgb = max(color.rgb, vec3(0.0)); + color.a = clamp(color.a, 0.0, 1.0); + + // Pre-multiplied alpha blend + colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); + + // Stop traversing if the alpha has been fully saturated + if (colorAccum.a > ALPHA_ACCUM_MAX) { + colorAccum.a = ALPHA_ACCUM_MAX; + break; + } + + if (step.w == 0.0) { + // Shape is infinitely thin. The ray may have hit the edge of a + // foreground voxel. Step ahead slightly to check for more voxels + step.w == 0.00001; + } + + // Keep raymarching + currT += step.w; + positionUv += step.w * viewDirUv; + + // Check if there's more intersections. + if (currT > endT) { + #if (INTERSECTION_COUNT == 1) + break; + #else + shapeIntersection = nextIntersection(ix); + if (shapeIntersection.entry.w == NO_HIT) { + break; + } else { + // Found another intersection. Resume raymarching there + currT = shapeIntersection.entry.w * RAY_SCALE; + endT = shapeIntersection.exit.w; + positionUv = viewPosUv + currT * viewDirUv; } - #endif -/*--------------------------------------------------------------------------*/ + #endif + } + + // Traverse the tree from the current ray position. + // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. + positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); + step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + } + + // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] + colorAccum.a /= ALPHA_ACCUM_MAX; + + #if defined(PICKING) + // If alpha is 0.0 there is nothing to pick + if (colorAccum.a == 0.0) { + discard; + } + out_FragColor = u_pickColor; + #else + out_FragColor = colorAccum; + #endif +} +`;var w2=`in vec2 position; + +uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; + +void main() { + vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; + vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; + vec2 translation = 0.5 * (aabbMax + aabbMin); + vec2 scale = 0.5 * (aabbMax - aabbMin); + gl_Position = vec4(position * scale + translation, 0.0, 1.0); +} +`;var I2=`/* Intersection defines +#define INTERSECTION_COUNT ### +*/ + +#define NO_HIT (-czm_infinity) +#define INF_HIT (czm_infinity * 0.5) +#define RAY_SHIFT (0.000003163) +#define RAY_SCALE (1.003163) + +struct Ray { + vec3 pos; + vec3 dir; +#if defined(SHAPE_BOX) + vec3 dInv; +#endif +}; + +struct RayShapeIntersection { + vec4 entry; + vec4 exit; +}; + +struct Intersections { + // Don't access these member variables directly - call the functions instead. + + // Store an array of ray-surface intersections. Each intersection is composed of: + // .xyz for the surface normal at the intersection point + // .w for the T value + // The scale of the normal encodes the shape intersection type: + // length(intersection.xyz) = 1: positive shape entry + // length(intersection.xyz) = 2: positive shape exit + // length(intersection.xyz) = 3: negative shape entry + // length(intersection.xyz) = 4: negative shape exit + // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, + // so we need twice as many to track ray-*surface* intersections + vec4 intersections[INTERSECTION_COUNT * 2]; + + #if (INTERSECTION_COUNT > 1) + // Maintain state for future nextIntersection calls + int index; + int surroundCount; + bool surroundIsPositive; + #endif +}; + +RayShapeIntersection getFirstIntersection(in Intersections ix) +{ + return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +} + +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +{ + float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; + return vec4(intersection.xyz * scale, intersection.w); +} + +// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. +#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) +#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) +#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; +#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) + +#if (INTERSECTION_COUNT > 1) +void initializeIntersections(inout Intersections ix) { + // Sort the intersections from min T to max T with bubble sort. + // Note: If this sorting function changes, some of the intersection test may + // need to be updated. Search for "bubble sort" to find those areas. + const int sortPasses = INTERSECTION_COUNT * 2 - 1; + for (int n = sortPasses; n > 0; --n) { + for (int i = 0; i < sortPasses; ++i) { + // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= n) { break; } + + vec4 intersect0 = ix.intersections[i + 0]; + vec4 intersect1 = ix.intersections[i + 1]; + + bool inOrder = intersect0.w <= intersect1.w; + + ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; + ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; + } + } + + // Prepare initial state for nextIntersection + ix.index = 0; + ix.surroundCount = 0; + ix.surroundIsPositive = false; +} +#endif + +#if (INTERSECTION_COUNT > 1) +RayShapeIntersection nextIntersection(inout Intersections ix) { + vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); + RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); + + const int passCount = INTERSECTION_COUNT * 2; + + if (ix.index == passCount) { + return shapeIntersection; + } + + for (int i = 0; i < passCount; ++i) { + // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to continue instead. + if (i < ix.index) { + continue; + } + + ix.index = i + 1; + + surfaceIntersection = ix.intersections[i]; + int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); + bool currShapeIsPositive = intersectionType < 2; + bool enter = intMod(intersectionType, 2) == 0; + + ix.surroundCount += enter ? +1 : -1; + ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; + + // entering positive or exiting negative + if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { + shapeIntersection.entry = surfaceIntersection; + } + + // exiting positive or entering negative after being inside positive + bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; + bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; + if (exitPositive || enterNegativeFromPositive) { + shapeIntersection.exit = surfaceIntersection; + + // entry and exit have been found, so the loop can stop + if (exitPositive) { + // After exiting positive shape there is nothing left to intersect, so jump to the end index. + ix.index = passCount; + } + break; + } + } + + return shapeIntersection; +} +#endif + +// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 +`;var D2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersectionPair, INF_HIT, NO_HIT + +/* intersectDepth defines (set in Scene/VoxelRenderResources.js) +#define DEPTH_INTERSECTION_INDEX ### +*/ + +uniform mat4 u_transformPositionViewToUv; + +void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); + if (logDepthOrDepth != 0.0) { + // Calculate how far the ray must travel before it hits the depth buffer. + vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); + eyeCoordinateDepth /= eyeCoordinateDepth.w; + vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); + float t = dot(depthPositionUv - ray.pos, ray.dir); + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); + } else { + // There's no depth at this location. + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); + } +} +`;var P2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +// NO_HIT, setIntersectionPair + +/* Clipping plane defines (set in Scene/VoxelRenderResources.js) +#define CLIPPING_PLANES_UNION +#define CLIPPING_PLANES_COUNT +#define CLIPPING_PLANES_INTERSECTION_INDEX +*/ + +uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; + +// Plane is in Hessian Normal Form +vec4 intersectPlane(in Ray ray, in vec4 plane) { + vec3 n = plane.xyz; // normal + float w = plane.w; // -dot(pointOnPlane, normal) + + float a = dot(ray.pos, n); + float b = dot(ray.dir, n); + float t = -(w + a) / b; + + return vec4(n, t); +} + +void intersectClippingPlanes(in Ray ray, inout Intersections ix) { + vec4 backSide = vec4(-ray.dir, -INF_HIT); + vec4 farSide = vec4(ray.dir, +INF_HIT); + RayShapeIntersection clippingVolume; + + #if (CLIPPING_PLANES_COUNT == 1) + // Union and intersection are the same when there's one clipping plane, and the code + // is more simplified. + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + bool reflects = dot(ray.dir, intersection.xyz) < 0.0; + clippingVolume.entry = reflects ? backSide : intersection; + clippingVolume.exit = reflects ? intersection : farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #elif defined(CLIPPING_PLANES_UNION) + vec4 firstTransmission = vec4(ray.dir, +INF_HIT); + vec4 lastReflection = vec4(-ray.dir, -INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; + } else { + lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; + } + } + clippingVolume.entry = backSide; + clippingVolume.exit = lastReflection; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); + clippingVolume.entry = firstTransmission; + clippingVolume.exit = farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); + #else // intersection + vec4 lastTransmission = vec4(ray.dir, -INF_HIT); + vec4 firstReflection = vec4(-ray.dir, +INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; + } else { + firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; + } + } + if (lastTransmission.w < firstReflection.w) { + clippingVolume.entry = lastTransmission; + clippingVolume.exit = firstReflection; + } else { + clippingVolume.entry = vec4(-ray.dir, NO_HIT); + clippingVolume.exit = vec4(ray.dir, NO_HIT); + } + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #endif +} +`;var O2=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT +// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace + +/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_INTERSECTION_INDEX ### // always 0 +*/ + +uniform vec3 u_renderMinBounds; +uniform vec3 u_renderMaxBounds; + +struct Box { + vec3 p0; + vec3 p1; +}; + +Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) +{ + // Find the min/max cornerpoints of the voxel in tile coordinates + vec3 tileOrigin = vec3(octreeCoords.xyz); + vec3 numSamples = vec3(u_dimensions); + vec3 voxelSize = 1.0 / numSamples; + vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; + vec3 coordP1 = coordP0 + voxelSize; + + // Transform to the UV coordinates of the scaled tileset + float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); + vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); + vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); + + return Box(p0, p1); +} + +vec3 getBoxNormal(in Box box, in Ray ray, in float t) +{ + vec3 hitPoint = ray.pos + t * ray.dir; + vec3 lower = step(hitPoint, box.p0); + vec3 upper = step(box.p1, hitPoint); + return normalize(upper - lower); +} + +// Find the distances along a ray at which the ray intersects an axis-aligned box +// See https://tavianator.com/2011/ray_box.html +RayShapeIntersection intersectBox(in Ray ray, in Box box) +{ + // Consider the box as the intersection of the space between 3 pairs of parallel planes + // Compute the distance along the ray to each plane + vec3 t0 = (box.p0 - ray.pos) * ray.dInv; + vec3 t1 = (box.p1 - ray.pos) * ray.dInv; + + // Identify candidate entries/exits based on distance from ray.pos + vec3 entries = min(t0, t1); + vec3 exits = max(t0, t1); + + // The actual box intersection points are the furthest entry and the closest exit + float entryT = max(max(entries.x, entries.y), entries.z); + float exitT = min(min(exits.x, exits.y), exits.z); + + vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); + vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); + + if (entryT > exitT) { + entryT = NO_HIT; + exitT = NO_HIT; + } + + return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); +} + +void intersectShape(in Ray ray, inout Intersections ix) +{ + RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); + setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +} +`;var R2=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, +// setIntersectionPair + +/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO + +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED + +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN +#define CYLINDER_INTERSECTION_INDEX_ANGLE +*/ + +// Cylinder uniforms +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + uniform vec3 u_cylinderUvToRenderBoundsScale; + uniform vec3 u_cylinderUvToRenderBoundsTranslate; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + uniform float u_cylinderUvToRenderRadiusMin; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) + uniform vec2 u_cylinderRenderAngleMinMax; +#endif + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +#define POSITIVE_HIT vec2(t, +INF_HIT); +#define NEGATIVE_HIT vec2(-INF_HIT, t); + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + // Half space cuts right through the camera, pick the side to intersect + if (a == 0.0) { + if (b >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } + } + + if (t >= 0.0 != s >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float ta = (-b - det) / a; + float tb = (-b + det) / a; + float t1 = min(ta, tb); + float t2 = max(ta, tb); + + float z1 = o.z + t1 * d.z; + float z2 = o.z + t2 * d.z; + + if (abs(z1) >= 1.0) + { + float tCap = (sign(z1) - o.z) / d.z; + t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + if (abs(z2) >= 1.0) + { + float tCap = (sign(z2) - o.z) / d.z; + t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + return vec2(t1, t2); +} + +vec2 intersectUnitCircle(Ray ray) { + vec3 o = ray.pos; + vec3 d = ray.dir; + + float t = -o.z / d.z; + vec2 zPlanePos = o.xy + d.xy * t; + float distSqr = dot(zPlanePos, zPlanePos); + + if (distSqr > 1.0) { + return vec2(NO_HIT); + } + + return vec2(t, t); +} + +vec2 intersectInfiniteUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +void intersectShape(Ray ray, inout Intersections ix) +{ + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; + ray.dir *= u_cylinderUvToRenderBoundsScale; + #else + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + vec2 outerIntersect = intersectUnitCircle(ray); + #else + vec2 outerIntersect = intersectUnitCylinder(ray); + #endif + + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + + if (outerIntersect.x == NO_HIT) { + return; + } + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + // When the cylinder is perfectly thin it's necessary to sandwich the + // inner cylinder intersection inside the outer cylinder intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the cylinder to be invisible because it will think the ray + // is still inside the inner (negative) cylinder after exiting the + // outer (positive) cylinder. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) + Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); + vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #endif +} +`;var M2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersection, setIntersectionPair, INF_HIT, NO_HIT + +/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN +*/ + +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidRenderLongitudeMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + uniform float u_ellipsoidInverseOuterScaleUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + uniform float u_ellipsoidInverseInnerScaleUv; +#endif + +vec2 intersectZPlane(Ray ray) +{ + float o = ray.pos.z; + float d = ray.dir.z; + float t = -o / d; + float s = sign(o); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitSphere(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = -b - det; + float t2 = -b + det; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d, d); + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; + float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; + float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + return vec2(tmin, tmax); +} + +vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + // One interval + if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); + else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); + // Two intervals + else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); +} + +vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec2(NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); + else if (zmin < 0.0) return vec2(tmax, +INF_HIT); + else if (zmax < 0.0) return vec2(-INF_HIT, tmin); + else return vec2(tmin, tmax); +} + +void intersectShape(in Ray ray, inout Intersections ix) { + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); + #else + Ray outerRay = ray; + #endif + + // Outer ellipsoid + vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); + + // Exit early if the outer ellipsoid was missed. + if (outerIntersect.x == NO_HIT) { + return; + } + + // Inner ellipsoid + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + // When the ellipsoid is perfectly thin it's necessary to sandwich the + // inner ellipsoid intersection inside the outer ellipsoid intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the ellipsoid to be invisible because it will think the ray + // is still inside the inner (negative) ellipsoid after exiting the + // outer (positive) ellipsoid. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); + vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); + + if (innerIntersect == vec2(NO_HIT)) { + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); + } else { + // When the ellipsoid is very large and thin it's possible for floating + // point math to cause the ray to intersect the inner ellipsoid before + // the outer ellipsoid. To prevent this from happening, clamp innerIntersect + // to outerIntersect and sandwhich the intersections like described above. + // + // In theory a similar fix is needed for cylinders, however it's more + // complicated to implement because the inner shape is allowed to be + // intersected first. + innerIntersect.x = max(innerIntersect.x, outerIntersect.x); + innerIntersect.y = min(innerIntersect.y, outerIntersect.y); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + } + #endif + + // Flip the ray because the intersection function expects a cone growing towards +Z. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + Ray flippedRay = outerRay; + flippedRay.dir.z *= -1.0; + flippedRay.pos.z *= -1.0; + #endif + + // Bottom cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) + vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) + vec2 bottomConeIntersection = intersectZPlane(flippedRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) + vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); + #endif + + // Top cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) + vec2 topConeIntersection = intersectZPlane(ray); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #endif + + // Wedge + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #endif +} +`;var EC=`// Main intersection function for Voxel scenes. +// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl +// for the definition of intersectShape. The appropriate function is selected +// based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. +// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, +// getFirstIntersection, initializeIntersections, nextIntersection. + +/* Intersection defines (set in Scene/VoxelRenderResources.js) +#define INTERSECTION_COUNT ### +*/ + +RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { + // Do a ray-shape intersection to find the exact starting and ending points. + intersectShape(ray, ix); + + // Exit early if the positive shape was completely missed or behind the ray. + RayShapeIntersection intersection = getFirstIntersection(ix); + if (intersection.entry.w == NO_HIT) { + // Positive shape was completely missed - so exit early. + return intersection; + } + + // Clipping planes + #if defined(CLIPPING_PLANES) + intersectClippingPlanes(ray, ix); + #endif + + // Depth + #if defined(DEPTH_TEST) + intersectDepth(screenCoord, ray, ix); + #endif + + // Find the first intersection that's in front of the ray + #if (INTERSECTION_COUNT > 1) + initializeIntersections(ix); + for (int i = 0; i < INTERSECTION_COUNT; ++i) { + intersection = nextIntersection(ix); + if (intersection.exit.w > 0.0) { + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + break; } + } + #else + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + #endif + + return intersection; +} +`;var L2=`/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_HAS_SHAPE_BOUNDS +*/ + +#if defined(BOX_HAS_SHAPE_BOUNDS) + uniform vec3 u_boxUvToShapeUvScale; + uniform vec3 u_boxUvToShapeUvTranslate; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; +#else + return positionUv; +#endif +} + +vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; +#else + return shapeUv; +#endif +} +`;var N2=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED +*/ + +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + uniform vec2 u_cylinderShapeUvAngleMinMax; +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + uniform float u_cylinderShapeUvAngleRangeZeroMid; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] + + // Compute radius + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) + float radius = 1.0; + #else + float radius = length(positionLocal.xy); // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset + #endif + #endif + + // Compute height + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + float height = 1.0; + #else + float height = positionUv.z; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset + #endif + #endif + + // Compute angle + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + float angle = 1.0; + #else + float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. + angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) + angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; + #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; + #endif + + angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset + #endif + #endif + + return vec3(radius, height, angle); +} +`;var F2=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_IS_SPHERE +*/ + +uniform vec3 u_ellipsoidRadiiUv; // [0,1] +#if !defined(ELLIPSOID_IS_SPHERE) + uniform vec3 u_ellipsoidInverseRadiiSquaredUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + uniform float u_ellipsoidInverseHeightDifferenceUv; + uniform vec2 u_ellipseInnerRadiiUv; // [0,1] +#endif + +// robust iterative solution without trig functions +// https://github.com/0xfaded/ellipse_demo/issues/1 +// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse +// Pro: Good when radii.x ~= radii.y +// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse +// Con: Inaccurate with exterior points and thin ellipses +float ellipseDistanceIterative (vec2 pos, vec2 radii) { + vec2 p = abs(pos); + vec2 invRadii = 1.0 / radii; + vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; + vec2 t = vec2(0.70710678118); // sqrt(2) / 2 + vec2 v = radii * t; + + const int iterations = 3; + for (int i = 0; i < iterations; ++i) { + vec2 e = a * pow(t, vec2(3.0)); + vec2 q = normalize(p - e) * length(v - e); + t = normalize((q + e) * invRadii); + v = radii * t; + } + return length(v * sign(pos) - pos) * sign(p.y - v.y); +} + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + // Compute position and normal. + // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). + // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. + vec3 positionLocal = positionUv * 2.0 - 1.0; + #if defined(ELLIPSOID_IS_SPHERE) + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; + vec3 normal = normalize(posEllipsoid); + #else + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; + vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal + #endif + + // Compute longitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + float longitude = 1.0; + #else + float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; + + // Correct the angle when max < min + // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) + longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; + #endif + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) + longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; + #endif + + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; + #endif + #endif + + // Compute latitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) + float latitude = 1.0; + #else + float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; + #endif + #endif + + // Compute height + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + // TODO: This breaks down when minBounds == maxBounds. To fix it, this + // function would have to know if ray is intersecting the front or back of the shape + // and set the shape space position to 1 (front) or 0 (back) accordingly. + float height = 1.0; + #else + #if defined(ELLIPSOID_IS_SPHERE) + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; + #else + float height = length(posEllipsoid); #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } + #else + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). + // This is an optimization so that math can be done with ellipses instead of ellipsoids. + vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); + float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; + #else + // TODO: this is probably not correct + float height = length(posEllipsoid); #endif -/*--------------------------------------------------------------------------*/ - } #endif -/*--------------------------------------------------------------------------*/ - } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); -} -`;function EC(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Wn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(EC.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});EC.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};EC.prototype.get=function(e){return this._stages[e]};function zdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}EC.prototype.update=function(e,t){this._selectedDirty=zdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};EC.prototype.isDestroyed=function(){return!1};EC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Kc=EC;var Lo={};function $z(e){let r=`#define USE_STEP_SIZE -${s0}`,o=new _r({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Fu.LINEAR}),s=new _r({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Fu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Kc({name:e,stages:[o,s],uniforms:a})}Lo.createBlurStage=function(){return $z("czm_blur")};Lo.createDepthOfFieldStage=function(){let e=$z("czm_depth_of_field_blur"),t=new _r({name:"czm_depth_of_field_composite",fragmentShader:gF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Kc({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Lo.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Lo.createEdgeDetectionStage=function(){let e=Wn();return new _r({name:`czm_edge_detection_${e}`,fragmentShader:AF,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Lo.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Hdt(e){if(!l(e))return Lo.createEdgeDetectionStage();let t=new Kc({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; -`,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); - if (edge${a}.a > 0.0) - { - color = edge${a}; - break; - } -`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; -void main() { - vec4 color = vec4(0.0); - for (int i = 0; i < ${e.length}; i++) - { -${r} } - out_FragColor = color; -} -`,s=new _r({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new Kc({name:"czm_edge_detection_composite",stages:[t,s]})}Lo.createSilhouetteStage=function(e){let t=Hdt(e),n=new _r({name:"czm_silhouette_color_edges",fragmentShader:vF,uniforms:{silhouetteTexture:t.name}});return new Kc({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Lo.isSilhouetteSupported=function(e){return e.context.depthTexture};Lo.createBloomStage=function(){let e=new _r({name:"czm_bloom_contrast_bias",fragmentShader:_F,uniforms:{contrast:128,brightness:-.3}}),t=$z("czm_bloom_blur"),n=new Kc({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new _r({name:"czm_bloom_generate_composite",fragmentShader:hF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new Kc({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Lo.createAmbientOcclusionStage=function(){let e=new _r({name:"czm_ambient_occlusion_generate",fragmentShader:fF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=$z("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Kc({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new _r({name:"czm_ambient_occlusion_composite",fragmentShader:dF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(o){e.uniforms.intensity=o}},bias:{get:function(){return e.uniforms.bias},set:function(o){e.uniforms.bias=o}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(o){e.uniforms.lengthCap=o}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(o){e.uniforms.stepSize=o}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(o){e.uniforms.frustumLength=o}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(o){e.uniforms.randomTexture=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(o){i.uniforms.ambientOcclusionOnly=o}}}),new Kc({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Lo.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Gdt=`#define FXAA_QUALITY_PRESET 39 -${wF} -${CF}`;Lo.createFXAAStage=function(){return new _r({name:"czm_FXAA",fragmentShader:Gdt,sampleMode:Fu.LINEAR})};Lo.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=uF,new _r({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Lo.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=xF,new _r({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Lo.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=SF,new _r({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Lo.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=EF,new _r({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Lo.createAutoExposureStage=function(){return new _L};Lo.createBlackAndWhiteStage=function(){return new _r({name:"czm_black_and_white",fragmentShader:mF,uniforms:{gradations:5}})};Lo.createBrightnessStage=function(){return new _r({name:"czm_brightness",fragmentShader:pF,uniforms:{brightness:.5}})};Lo.createNightVisionStage=function(){return new _r({name:"czm_night_vision",fragmentShader:bF})};Lo.createDepthViewStage=function(){return new _r({name:"czm_depth_view",fragmentShader:yF})};Lo.createLensFlareStage=function(){return new _r({name:"czm_lens_flare",fragmentShader:TF,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var jf=Lo;function W_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function IF(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function mX(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[IF(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[IF(d)]=!0)}}}return i.name}function DF(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=DF(e,t,n,p,r):a=mX(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=IF(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=IF(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[IF(i.get(p))]=!0}return a}function Wdt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=DF(e,t,n,i,void 0);a=DF(e,t,n,r,a),a=mX(e,t,n,o,a),a=DF(e,t,n,e,a),mX(e,t,n,s,a)}else DF(e,t,n,e,void 0);return n}function jdt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let h=d.stages,A=h.length,x=!1;for(let C=0;C<A;++C)if(n[h[C]]){x=!0;break}if(!x)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new di({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function Ydt(e,t){let n=Wdt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=jdt(e,i,n[i]))}function hX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function qdt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new ri({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}W_.prototype.updateDependencies=function(){this._updateDependencies=!0};W_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(hX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Ydt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,hX(this),qdt(this,e))};W_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};W_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};W_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};W_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};W_.prototype.isDestroyed=function(){return!1};W_.prototype.destroy=function(){return hX(this),ue(this)};var bC=W_;var PF={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===PF.REINHARD||e===PF.MODIFIED_REINHARD||e===PF.FILMIC||e===PF.ACES}},a0=Object.freeze(PF);var pX=[];function Jc(){let e=jf.createFXAAStage(),t=jf.createAmbientOcclusionStage(),n=jf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=jf.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=a0.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new bC(this),o={},s=pX;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(Jc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return _X(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case a0.REINHARD:n=jf.createReinhardTonemappingStage(t);break;case a0.MODIFIED_REINHARD:n=jf.createModifiedReinhardTonemappingStage(t);break;case a0.FILMIC:n=jf.createFilmicTonemappingStage(t);break;default:n=jf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function _X(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._stages=t}Jc.prototype.add=function(e){let t=this._stageNames,n=pX;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Jc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=pX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Jc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Jc.prototype.get=function(e){return _X(this),this._stages[e]};Jc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jc.prototype.getStageByName=function(e){return this._stageNames[e]};Jc.prototype.update=function(e,t,n){_X(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages,s=r.length=o.length,a,c,u=0;for(a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&(r[u++]=c);r.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(r[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,A=this._fxaa;h.enabled=n;let x=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),T=h.enabled&&h._isSupported(e),E=A.enabled&&A._isSupported(e);if((f||this._textureCacheDirty||x!==this._aoEnabled||C!==this._bloomEnabled||T!==this._tonemappingEnabled||E!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=x,this._bloomEnabled=C,this._tonemappingEnabled=T,this._fxaaEnabled=E,this._textureCacheDirty=!1),l(this._randomTexture)&&!x&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&x){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Bt({context:e,pixelFormat:at.RGB,pixelDatatype:Ze.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new dn({wrapS:Dn.REPEAT,wrapT:Dn.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:xi.NEAREST})})}for(this._textureCache.update(e),A.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=o.length,a=0;a<s;++a)o[a].update(e,t);for(u=0,a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==r.length,f&&this.update(e,t,n)};Jc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function SC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Jc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return SC(t)};function Nh(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}let o=e.length,s;if(e.inputPreviousStageTexture)for(Nh(e.get(0),t,n,i,r),s=1;s<o;++s)Nh(e.get(s),t,SC(e.get(s-1)),i,r);else for(s=0;s<o;++s)Nh(e.get(s),t,n,i,r)}Jc.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),A=s.enabled&&s._isSupported(e);if(!A&&!d&&!p&&!h&&o===0)return;let x=t;d&&a.ready&&(Nh(a,e,x,n,i),x=SC(a)),p&&c.ready&&(Nh(c,e,x,n,i),x=SC(c)),g&&u.ready&&Nh(u,e,x,n,i),h&&f.ready&&(Nh(f,e,x,n,i),x=SC(f));let C=x;if(o>0){Nh(r[0],e,x,n,i);for(let T=1;T<o;++T)Nh(r[T],e,SC(r[T-1]),n,i);C=SC(r[o-1])}A&&s.ready&&Nh(s,e,C,n,i)};Jc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(kl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var OF=Jc;function Uu(){fe.throwInstantiationError()}Uu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Uu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Uu.prototype.update=fe.throwInstantiationError;Uu.prototype.beginUpdate=fe.throwInstantiationError;Uu.prototype.endUpdate=fe.throwInstantiationError;Uu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Uu.prototype.loadTile=fe.throwInstantiationError;Uu.prototype.computeTileVisibility=fe.throwInstantiationError;Uu.prototype.showTileThisFrame=fe.throwInstantiationError;Uu.prototype.computeDistanceToTile=fe.throwInstantiationError;Uu.prototype.isDestroyed=fe.throwInstantiationError;Uu.prototype.destroy=fe.throwInstantiationError;var gX=Uu;function vC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}vC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};vC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(B.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?vmt(this,e):Mmt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Xdt=new m,Kdt=new m,Jdt=new m,Zdt=new m,Qdt=new m,$dt=new m,emt=new m,tmt=new he,nmt=new B,imt=new bi,rmt=new rn,omt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};vC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(B.IDENTITY);let i=Xdt,r=Kdt,o=Jdt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,r),r),m.cross(m.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,m.negate(m.UNIT_Z,r),m.clone(m.UNIT_Y,o);else{m.clone(u.positionWC,i),m.clone(u.directionWC,r),m.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,emt),d=Mt.eastNorthUpToFixedFrame(f,t,nmt);B.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,tmt),i),B.multiplyByPointAsVector(d,r,r),B.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=rmt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=imt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=omt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=Lmt(a);RF(this,c),this._previousMode===ne.SCENE2D?Bmt(this,e,a,c):(a.position2D=B.multiplyByPoint(sr.TRANSFORM_2D,i,Zdt),a.direction2D=B.multiplyByPointAsVector(sr.TRANSFORM_2D,r,Qdt),a.up2D=B.multiplyByPointAsVector(sr.TRANSFORM_2D,o,$dt),n._mode=ne.MORPHING,M0e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var xX={position:new m,direction:new m,up:new m,frustum:void 0},b0e=new bi;vC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(B.IDENTITY),this._previousMode===ne.SCENE2D)_mt(this,e,t);else{let i;e>0?(i=xX,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=S0e(this,t);let r,o=n.camera;o.frustum instanceof rn?r=o.frustum.clone():(r=b0e,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=L0e(i);RF(this,s),AX(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return eH(this),ue(this)};function RF(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Iu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function eH(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var smt=new he,amt=new m,cmt=new B;function S0e(e,t){let n=e._scene,i=n.camera,r=xX,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,smt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,amt),f=Mt.eastNorthUpToFixedFrame(u,t,cmt);return B.multiplyByPointAsVector(f,i.direction,s),B.multiplyByPointAsVector(f,i.up,a),r}var lmt=new m,umt=new m,fmt=new m,dmt=new m,mmt=new m,hmt=new m;function AX(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(o.position,lmt),a=m.clone(o.direction,umt),c=m.clone(o.up,fmt),u=B.multiplyByPoint(sr.TRANSFORM_2D_INVERSE,n.position,dmt),f=B.multiplyByPointAsVector(sr.TRANSFORM_2D_INVERSE,n.direction,mmt),d=B.multiplyByPointAsVector(sr.TRANSFORM_2D_INVERSE,n.up,hmt);function p(h){Yf(s,u,h.time,o.position),Yf(a,f,h.time,o.direction),Yf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){B0e(e,r,0,1,t,i)}});e._currentTweens.push(g)}var pmt=new rn,v0e=new m,w0e=new m,D0e=new m,CX=new m,I0e=new m,P0e=new m;function _mt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=xX,m.fromDegrees(0,0,5*n.maximumRadius,n,o.position),m.negate(o.position,o.direction),m.normalize(o.direction,o.direction),m.clone(m.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=S0e(e,n));let s;e._morphToOrthographic?(s=pmt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=b0e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=L0e(o);RF(e,a);let c;e._morphToOrthographic?c=function(){AX(e,t,o,a)}:c=function(){R0e(e,t,o,function(){AX(e,t,o,a)})},t>0?(i._mode=ne.SCENE2D,r.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,CX),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Yf(e,t,n,i){return m.lerp(e,t,n,i)}function O0e(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var gmt=new m,ymt=new m,Amt=new m,yX=new m,xmt=new m,Cmt=new m,Tmt=new To,Emt=new In,bmt=new m,Smt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function vmt(e,t){t*=.5;let n=e._scene,i=n.camera,r=m.clone(i.position,gmt),o=m.clone(i.direction,ymt),s=m.clone(i.up,Amt),a=m.negate(m.UNIT_Z,xmt),c=m.clone(m.UNIT_Y,Cmt),u=yX;if(t>0)m.clone(m.ZERO,yX),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(r,yX);let x=Emt;B.multiplyByPoint(sr.TRANSFORM_2D,r,x.origin),B.multiplyByPointAsVector(sr.TRANSFORM_2D,o,x.direction);let C=n.globe;if(l(C)){let T=C.pickWorldCoordinates(x,n,!0,bmt);l(T)&&(B.multiplyByPoint(sr.TRANSFORM_2D_INVERSE,T,u),u.z+=m.distance(r,u))}}let f=Tmt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=Smt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=N0e(d);RF(e,p);function g(x){Yf(r,u,x.time,i.position),Yf(o,a,x.time,i.direction),Yf(s,c,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(x,C){x.position.z=C}let A=n.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){O0e(e,t,d,h,p)}});e._currentTweens.push(A)}var E0e=new he,wmt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new To},Dmt={position:new m,direction:new m,up:new m,frustum:void 0},Imt=new m,Pmt=new In,Omt=new B,Rmt=new m;function Mmt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=wmt;if(t>0)m.clone(m.ZERO,o.position),o.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,E0e),i.mapProjection.project(E0e,o.position),m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);let d=Pmt;m.clone(o.position2D,d.origin);let p=m.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,Rmt),h=Mt.eastNorthUpToFixedFrame(g,n,Omt);B.inverseTransformation(h,h),B.multiplyByPointAsVector(h,p,p),B.multiplyByPointAsVector(sr.TRANSFORM_2D,p,p);let A=i.globe;if(l(A)){let x=A.pickWorldCoordinates(d,i,!0,Imt);if(l(x)){let C=m.distance(o.position2D,x);x.x+=C,m.clone(x,o.position2D)}}}function s(d,p){d.position.x=p}B.multiplyByPoint(sr.TRANSFORM_2D,o.position,o.position2D),B.multiplyByPointAsVector(sr.TRANSFORM_2D,o.direction,o.direction2D),B.multiplyByPointAsVector(sr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Dmt;B.multiplyByPoint(sr.TRANSFORM_2D_INVERSE,o.position2D,c.position),m.clone(o.direction,c.direction),m.clone(o.up,c.up),c.frustum=a;let u=N0e(c);RF(e,u);function f(){O0e(e,t,o,s,u)}M0e(e,t,o,f)}function R0e(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Bmt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(n.position,CX),a=m.clone(n.direction,I0e),c=m.clone(n.up,P0e);r._mode=ne.MORPHING;function u(){o.frustum=n.frustum.clone();let f=m.clone(o.position,v0e),d=m.clone(o.direction,w0e),p=m.clone(o.up,D0e);f.z=s.z;function g(A){Yf(f,s,A.time,o.position),Yf(d,a,A.time,o.direction),Yf(p,c,A.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let h=r.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():R0e(e,0,n,u)}function M0e(e,t,n,i){let r=e._scene,o=r.camera,s=m.clone(o.position,v0e),a=m.clone(o.direction,w0e),c=m.clone(o.up,D0e),u=m.clone(n.position2D,CX),f=m.clone(n.direction2D,I0e),d=m.clone(n.up2D,P0e);function p(h){Yf(s,u,h.time,o.position),Yf(a,f,h.time,o.direction),Yf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Mo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){B0e(e,r,1,0,t,i)}});e._currentTweens.push(g)}function B0e(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Mo.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function L0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),eH(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,o)}}function N0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),eH(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,r)}}function Lmt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),eH(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,o)}}var MF=vC;function tH(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(tH.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});tH.prototype.cancelTween=function(){this._tweens.remove(this)};function Cm(){this._tweens=[]}Object.defineProperties(Cm.prototype,{length:{get:function(){return this._tweens.length}}});Cm.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new tH(this);let t=e.duration/Zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Zn.SECONDS_PER_MILLISECOND,r=y(e.easingFunction,Mo.LINEAR_NONE),o=e.startObject,s=new hhe(o);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new tH(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Cm.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Cm.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Cm.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Cm.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Cm.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Cm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Cm.prototype.get=function(e){return this._tweens[e]};Cm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Zn.SECONDS_PER_MILLISECOND:yi();n<t.length;){let i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var wC=Cm;function LF(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Oi.LEFT_DRAG,this.zoomEventTypes=[Oi.RIGHT_DRAG,Oi.WHEEL,Oi.PINCH],this.rotateEventTypes=Oi.LEFT_DRAG,this.tiltEventTypes=[Oi.MIDDLE_DRAG,Oi.PINCH,{eventType:Oi.LEFT_DRAG,modifier:ca.CTRL},{eventType:Oi.RIGHT_DRAG,modifier:ca.CTRL}],this.lookEventTypes={eventType:Oi.LEFT_DRAG,modifier:ca.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new zL(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new wC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Nmt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Fmt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Umt=.4;function Vmt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Umt){let g=Nmt(p,i),h=e.getLastMovement(t,n);if(!l(h)||Fmt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let A=e.getStartMousePosition(t,n);r(o,A,a)}}}function kmt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var F0e=[];function Zc(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(F0e[0]=n,n=F0e);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),kmt(e,o)):r<1&&Vmt(s,f,d,r,i,e,o))}}var nH=new In,zmt=new m,Hmt=new H,Gmt=new m,Wmt=new H,jmt=new m,Ymt=new m,qmt=new m,Xmt=new m,Kmt=new m,Jmt=new m,Zmt=new m,Qmt=new m,$mt=new m,eht=new m,tht=new m,nht=new m,iht=new m,rht=new m,oht=new m,DC=new m,U0e=new m,V0e=new m,TX={orientation:new za};function PX(e,t,n,i,r,o){let s=1;l(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(r-u)<1||h<0&&Math.abs(r-f)<1)return;r-h<u?h=r-u-1:r-h>f&&(h=r-f)}let A=e._scene,x=A.camera,C=A.mode,T=TX.orientation;if(T.heading=x.heading,T.pitch=x.pitch,T.roll=x.roll,x.frustum instanceof rn){Math.abs(h)>0&&(x.zoomIn(h),x._adjustOrthographicFrustum(!0));return}let E=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,w=e._rotatingZoom,D;if(E||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),l(e._globe)&&(C===ne.SCENE2D?(D=x.getPickRay(t,nH).origin,D=m.fromElements(D.y,D.z,D.x)):D=c0(e,t,zmt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,w=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(h);return}let R=C===ne.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(w=!0),!E||w){if(C===ne.SCENE2D){let O=e._zoomWorldPosition,L=x.position;if(!m.equals(O,L)&&x.positionCartographic.height<e._maxCoord.x*2){let N=x.position.x,_=m.subtract(O,L,Gmt);m.normalize(_,_);let b=m.distance(O,L)*h/(x.getMagnitude()*.5);x.move(_,b*.5),(x.position.x<0&&N>0||x.position.x>0&&N<0)&&(D=x.getPickRay(t,nH).origin,D=m.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let O=m.normalize(x.position,Kmt);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,O))<.6)R=!0;else{let L=A.canvas,N=Wmt;N.x=L.clientWidth/2,N.y=L.clientHeight/2;let _=c0(e,N,jmt);if(!l(_))R=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,O)>=-.5)R=!0;else{let b=Zmt;m.clone(x.position,b);let v=e._zoomWorldPosition,I=Jmt;if(I=m.normalize(v,I),m.dot(I,O)<0)return;let M=oht,F=eht;m.clone(x.direction,F),m.add(b,m.multiplyByScalar(F,1e3,DC),M);let k=tht,V=nht;m.subtract(v,b,k),m.normalize(k,V);let G=m.dot(O,V);if(G>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-G),q=m.magnitude(b),Y=m.magnitude(v),Q=q-h,W=m.magnitude(k),K=Math.asin(P.clamp(W/Y*Math.sin(U),-1,1)),J=Math.asin(P.clamp(Q/Y*Math.sin(U),-1,1)),me=K-J+U,ye=Qmt;m.normalize(b,ye);let se=$mt;se=m.cross(V,ye,se),se=m.normalize(se,se),m.normalize(m.cross(ye,se,DC),F),m.multiplyByScalar(m.normalize(M,DC),m.magnitude(M)-h,M),m.normalize(b,b),m.multiplyByScalar(b,Q,b);let _e=iht;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,U0e),m.multiplyByScalar(F,Math.sin(me),V0e),DC),Q,_e),m.add(b,_e,b),m.normalize(M,ye),m.normalize(m.cross(ye,se,DC),F);let xe=rht;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,U0e),m.multiplyByScalar(F,Math.sin(me),V0e),DC),m.magnitude(M),xe),m.add(M,xe,M),m.clone(b,x.position),m.normalize(m.subtract(M,b,DC),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(TX);return}else{let b=m.normalize(_,Ymt),v=m.normalize(e._zoomWorldPosition,qmt),I=m.dot(v,b);if(I>0&&I<1){let M=P.acosClamped(I),F=m.cross(v,b,Xmt),k=Math.abs(M)>P.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-h,V=h/k;x.rotate(F,M*V)}}}}e._rotatingZoom=!R}if(!E&&R||S){let O,L=Xi.wgs84ToWindowCoordinates(A,e._zoomWorldPosition,Hmt);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&l(L)?O=x.getPickRay(L,nH):O=x.getPickRay(t,nH);let N=O.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),x.move(N,h),e._zoomingOnVector=!0}else x.zoomIn(h);e._cameraUnderground||x.setView(TX)}var sht=new In,aht=new In,cht=new m;function lht(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,sht).origin,s=r.getPickRay(n.endPosition,aht).origin;o=m.fromElements(o.y,o.z,o.x,o),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(o,s,cht),c=m.magnitude(a);c>0&&(m.normalize(a,a),r.move(a,c))}function k0e(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;PX(e,t,n,e._zoomFactor,r.getMagnitude())}var uht=new H,fht=new H;function z0e(e,t,n){if(l(n.angleAndHeight)){dht(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=uht;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let u=fht;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function dht(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function mht(e){let t=e._scene.mapMode2D===Ml.ROTATE;B.equals(B.IDENTITY,e._scene.camera.transform)?(Zc(e,e.enableTranslate,e.translateEventTypes,lht,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,k0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Zc(e,e.enableRotate,e.tiltEventTypes,z0e,e.inertiaSpin,"_lastInertiaTiltMovement")):(Zc(e,e.enableZoom,e.zoomEventTypes,k0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Zc(e,e.enableRotate,e.translateEventTypes,z0e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var q0e=new In,hht=new m,pht=new m;function c0(e,t,n){let i=e._scene,r=e._globe,o=i.camera;if(!l(r))return;let s=!e._cameraUnderground,a;i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,hht));let c=o.getPickRay(t,q0e),u=r.pickWorldCoordinates(c,i,s,pht),f=l(a)?m.distance(a,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?m.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(a,n):m.clone(u,n)}var _ht=new he;function cH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,_ht);l(c)&&(o=c.height)}else o=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-o)}var ght=new m;function X0e(e,t){let n=t.origin,i=t.direction,r=cH(e),o=m.normalize(n,ght),s=Math.abs(m.dot(o,i));return s=Math.max(s,.5)*2,r*s}function K0e(e,t,n,i){let r=m.distance(t.origin,n),o=cH(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),In.getPoint(t,r,i)}function J0e(e,t,n,i){let r;return l(n)?(r=m.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=cH(e))):r=cH(e),In.getPoint(t,r,i)}var yht=new H;function Z0e(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,yht),r=e._strafeEndMousePosition;H.add(r,i,r),t.endPosition=r,OX(e,t,e._strafeStartPosition),t.endPosition=n}var H0e=new In,Aht=new In,EX=new m,xht=new m,Cht=new m,Tht=new m,Eht=new fn(m.UNIT_X,0),bht=new H,Sht=new H;function vht(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){ku(e,t,n);return}if(e._strafing){Z0e(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=H.clone(n.startPosition,bht),a=H.clone(n.endPosition,Sht),c=r.getPickRay(s,H0e),u=m.clone(m.ZERO,Tht),f=m.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=c0(e,s,EX),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let E=d;o&&(E=J0e(e,c,d,EX)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(E,e._strafeStartPosition),e._strafing=!0,OX(e,n,e._strafeStartPosition);return}let p=fn.fromPointNormal(u,f,Eht);c=r.getPickRay(s,H0e);let g=qi.rayPlane(c,p,EX),h=r.getPickRay(a,Aht),A=qi.rayPlane(h,p,xht);if(!l(g)||!l(A)){e._looking=!0,ku(e,t,n),H.clone(t,e._translateMousePosition);return}let x=m.subtract(g,A,Cht),C=x.x;x.x=x.y,x.y=x.z,x.z=C;let T=m.magnitude(x);T>P.EPSILON6&&(m.normalize(x,x),r.move(x,T))}var Q0e=new H,rH=new In,oH=new m,wht=new m,$0e=new B,Dht=new B,Iht=new m,Pht=new fn(m.UNIT_X,0),bX=new m,wX=new he,eAe=new B,Oht=new Le,Rht=new Z,sH=new m;function Mht(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){ku(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Bht(e,t,n)):Lht(e,t,n)}function Bht(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=Q0e;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,rH),c=m.UNIT_X,u=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-m.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,ku(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,oH);m.add(u,g,g);let h=i.mapProjection,A=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let x=h.unproject(g,wX);A.cartographicToCartesian(x,g);let C=Mt.eastNorthUpToFixedFrame(g,A,$0e),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=B.clone(r.transform,eAe);r._setTransform(C),Vu(e,t,n,m.UNIT_Z),r._setTransform(S),e._globe=T,e._ellipsoid=E;let w=E.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w}function Lht(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,oH);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=c0(e,t,oH)),!l(s)){a=r.getPickRay(t,rH);let _=a.origin,b=a.direction,v,I=m.dot(c,b);if(Math.abs(I)>P.EPSILON6&&(v=-m.dot(c,_)/I),!l(v)||v<=0){e._looking=!0,ku(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(b,v,oH),m.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,rH)),K0e(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let u=i.canvas,f=Q0e;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,rH);let d=m.clone(m.ZERO,Iht);d.x=s.x;let p=fn.fromPointNormal(d,c,Pht),g=qi.rayPlane(a,p,wht),h=r._projection,A=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=h.unproject(s,wX);A.cartographicToCartesian(x,s);let C=Mt.eastNorthUpToFixedFrame(s,A,$0e),T;l(g)?(m.fromElements(g.y,g.z,g.x,g),x=h.unproject(g,wX),A.cartographicToCartesian(x,g),T=Mt.eastNorthUpToFixedFrame(g,A,Dht)):T=C;let E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=B.clone(r.transform,eAe);r._setTransform(C);let R=m.cross(m.UNIT_Z,m.normalize(r.position,bX),bX),O=m.dot(r.right,R);if(Vu(e,t,n,w,!1,!0),r._setTransform(T),O<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(w=void 0);let b=r.constrainedAxis;r.constrainedAxis=void 0,Vu(e,t,n,w,!0,!1),r.constrainedAxis=b}else Vu(e,t,n,w,!0,!1);if(l(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,sH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(D),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(r.positionWC,bX);if(e.enableCollisionDetection&&BX(e),!m.equals(r.positionWC,N)){r._setTransform(T),r.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let b=m.angleBetween(N,r.position),v=m.cross(N,r.position,N);m.normalize(v,v);let I=Le.fromAxisAngle(v,b,Oht),M=Z.fromQuaternion(I,Rht);Z.multiplyByVector(M,r.direction,r.direction),Z.multiplyByVector(M,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(D)}}var tAe=new H,nAe=new In,iAe=new m;function Nht(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=tAe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,nAe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=c0(e,a,iAe));let g;if(l(p)&&(g=m.distance(u,p)),s){let h=X0e(e,c,d);l(g)?g=Math.min(g,h):g=h}if(!l(g)){let h=m.UNIT_X;g=-m.dot(h,u)/m.dot(h,f)}PX(e,t,n,e._zoomFactor,g)}function Fht(e){let n=e._scene.camera;if(!B.equals(B.IDENTITY,n.transform))Zc(e,e.enableRotate,e.rotateEventTypes,Vu,e.inertiaSpin,"_lastInertiaSpinMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,rAe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Zc(e,e.enableTilt,e.tiltEventTypes,Mht,e.inertiaSpin,"_lastInertiaTiltMovement"),Zc(e,e.enableTranslate,e.translateEventTypes,vht,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,Nht,e.inertiaZoom,"_lastInertiaZoomMovement"),Zc(e,e.enableLook,e.lookEventTypes,ku),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var Uht=new In,Vht=new fn(m.UNIT_X,0),kht=new m,zht=new m,Hht=new m;function OX(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,Uht),s=m.clone(r.direction,zht);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=fn.fromPointNormal(n,s,Vht),c=qi.rayPlane(o,a,kht);l(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(r.position,s,r.position))}var G0e=new m,Ght=new he,DX=new m,IX=new re,Wht=new m,jht=new m;function Yht(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!B.equals(r.transform,B.IDENTITY)){Vu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,Wht);if(H.equals(t,e._rotateMousePosition)){if(e._looking)ku(e,t,n,u);else if(e._rotating)Vu(e,t,n);else if(e._strafing)Z0e(e,n);else{if(m.magnitude(r.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=DX,c.x=c.y=c.z=a,s=re.fromCartesian3(c,IX),vX(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,Ght).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=c0(e,n.startPosition,Hht);if(l(p)){let g=!1,h=r.getPickRay(n.startPosition,q0e);if(o)g=!0,J0e(e,h,p,p);else{let A=s.geodeticSurfaceNormal(p,jht);Math.abs(m.dot(h.direction,A))<.05?g=!0:g=m.magnitude(r.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,OX(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=DX,c.x=c.y=c.z=a,s=re.fromCartesian3(c,IX),vX(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,ku(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,G0e))?(vX(e,t,n,e._ellipsoid),m.clone(G0e,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Vu(e,t,n)):(e._looking=!0,ku(e,t,n,u));H.clone(t,e._rotateMousePosition)}function Vu(e,t,n,i,r,o){r=y(r,!1),o=y(o,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,A=d*g*Math.PI;r||a.rotateRight(h),o||a.rotateUp(A),a.constrainedAxis=u}var qht=oe.clone(oe.UNIT_W),Xht=oe.clone(oe.UNIT_W),iH=new m,SX=new m,Kht=new m,Jht=new m,Zht=new H,Qht=new H;function vX(e,t,n,i){let o=e._scene.camera,s=H.clone(n.startPosition,Zht),a=H.clone(n.endPosition,Qht),c=o.pickEllipsoid(s,i,qht),u=o.pickEllipsoid(a,i,Xht);if(!l(c)||!l(u)){e._rotating=!0,Vu(e,t,n);return}if(c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),l(o.constrainedAxis)){let f=o.constrainedAxis,d=m.mostOrthogonalAxis(f,iH);m.cross(d,f,d),m.normalize(d,d);let p=m.cross(f,d,SX),g=m.magnitude(c),h=m.dot(f,c),A=Math.acos(h/g),x=m.multiplyByScalar(f,h,Kht);m.subtract(c,x,x),m.normalize(x,x);let C=m.magnitude(u),T=m.dot(f,u),E=Math.acos(T/C),S=m.multiplyByScalar(f,T,Jht);m.subtract(u,S,S),m.normalize(S,S);let w=Math.acos(m.dot(x,d));m.dot(x,p)<0&&(w=P.TWO_PI-w);let D=Math.acos(m.dot(S,d));m.dot(S,p)<0&&(D=P.TWO_PI-D);let R=w-D,O;m.equalsEpsilon(f,o.position,P.EPSILON2)?O=o.right:O=m.cross(f,o.position,iH);let L=m.cross(f,O,iH),N=m.dot(L,m.subtract(c,f,SX)),_=m.dot(L,m.subtract(u,f,SX)),b;N>0&&_>0?b=E-A:N>0&&_<=0?m.dot(o.position,f)>0?b=-A-E:b=A+E:b=A-E,o.rotateRight(R),o.rotateUp(b)}else{m.normalize(c,c),m.normalize(u,u);let f=m.dot(c,u),d=m.cross(c,u,iH);if(f<1&&!m.equalsEpsilon(d,m.ZERO,P.EPSILON14)){let p=Math.acos(f);o.rotate(d,p)}}}var $ht=new m,ept=new he,W0e=0;function rAe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=tAe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,nAe),d,p=r.cartesianToCartographic(s.position,ept).height,g=Math.abs(W0e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=c0(e,u,iAe));let A;if(l(d)&&(A=m.distance(f.origin,d),W0e=A),c){let C=X0e(e,f,p);l(A)?A=Math.min(A,C):A=C}l(A)||(A=p);let x=m.normalize(s.position,$ht);PX(e,t,n,e._zoomFactor,A,m.dot(x,s.direction))}var oAe=new H,aH=new In,BF=new m,tpt=new m,sAe=new B,npt=new B,aAe=new B,ipt=new Le,rpt=new Z,RX=new he,MX=new m;function opt(e,t,n){let r=e._scene.camera;if(!B.equals(r.transform,B.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,MX);ku(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,RX);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,apt(e,t,n)):cpt(e,t,n)}var spt=new he;function apt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,spt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=oAe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,aH),d,p=qi.rayEllipsoid(f,i);if(l(p))d=In.getPoint(f,p.start,BF);else if(a>e._minimumTrackBallHeight){let T=qi.grazingAltitudeLocation(f,i);if(!l(T))return;let E=i.cartesianToCartographic(T,RX);E.height=0,d=i.cartographicToCartesian(E,BF)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(o.position,MX);ku(e,t,n,T),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,sAe),h=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=B.clone(o.transform,aAe);o._setTransform(g),Vu(e,t,n,m.UNIT_Z),o._setTransform(x),e._globe=h,e._ellipsoid=A;let C=A.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function cpt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,BF);else{if(a=c0(e,t,BF),!l(a)){if(c=o.getPickRay(t,aH),u=qi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,RX).height<=e._minimumTrackBallHeight){e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(o.position,MX);ku(e,t,n,b),H.clone(t,e._tiltCenterMousePosition)}return}a=In.getPoint(c,u.start,BF)}s&&(l(c)||(c=o.getPickRay(t,aH)),K0e(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=r.canvas,d=oAe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,aH);let p=m.magnitude(a),g=m.fromElements(p,p,p,DX),h=re.fromCartesian3(g,IX);if(u=qi.rayEllipsoid(c,h),!l(u))return;let A=m.magnitude(c.origin)>p?u.start:u.stop,x=In.getPoint(c,A,tpt),C=Mt.eastNorthUpToFixedFrame(a,i,sAe),T=Mt.eastNorthUpToFixedFrame(x,h,npt),E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=B.clone(o.transform,aAe);o._setTransform(T);let R=m.cross(x,o.positionWC,sH);if(m.dot(o.rightWC,R)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(w=void 0);let b=o.constrainedAxis;o.constrainedAxis=void 0,Vu(e,t,n,w,!0,!1),o.constrainedAxis=b}else Vu(e,t,n,w,!0,!1);if(o._setTransform(C),Vu(e,t,n,w,!1,!0),l(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,sH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(D),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(o.positionWC,sH);if(e.enableCollisionDetection&&BX(e),!m.equals(o.positionWC,N)){o._setTransform(T),o.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let b=m.angleBetween(N,o.position),v=m.cross(N,o.position,N);m.normalize(v,v);let I=Le.fromAxisAngle(v,b,ipt),M=Z.fromQuaternion(I,rpt);Z.multiplyByVector(M,o.direction,o.direction),Z.multiplyByVector(M,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(D)}}var lpt=new H,upt=new H,j0e=new In,Y0e=new In,fpt=new m,dpt=new m;function ku(e,t,n,i){let o=e._scene.camera,s=lpt;s.x=n.startPosition.x,s.y=0;let a=upt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,j0e),u=o.getPickRay(a,Y0e),f=0,d,p;o.frustum instanceof rn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(h)?o.look(h,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,j0e),u=o.getPickRay(a,Y0e),f=0,o.frustum instanceof rn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),l(i)){let A=o.direction,x=m.negate(i,fpt),C=m.equalsEpsilon(A,i,P.EPSILON2),T=m.equalsEpsilon(A,x,P.EPSILON2);if(!C&&!T){g=m.dot(A,i);let E=P.acosClamped(g);f>0&&f>E&&(f=E-P.EPSILON4),g=m.dot(A,x),E=P.acosClamped(g),f<0&&-f>E&&(f=-E+P.EPSILON4);let S=m.cross(i,A,dpt);o.look(S,f)}else(C&&f<0||T&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function mpt(e){Zc(e,e.enableRotate,e.rotateEventTypes,Yht,e.inertiaSpin,"_lastInertiaSpinMovement"),Zc(e,e.enableZoom,e.zoomEventTypes,rAe,e.inertiaZoom,"_lastInertiaZoomMovement"),Zc(e,e.enableTilt,e.tiltEventTypes,opt,e.inertiaSpin,"_lastInertiaTiltMovement"),Zc(e,e.enableLook,e.lookEventTypes,ku)}var hpt=new B,ppt=new he;function BX(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let r=t.camera,o=i.ellipsoid,s=t.mapProjection,a,c;B.equals(r.transform,B.IDENTITY)||(a=B.clone(r.transform,hpt),c=m.magnitude(r.position),r._setTransform(B.IDENTITY));let u=ppt;n===ne.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===ne.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0)}}l(a)&&(r._setTransform(a),f&&(m.normalize(r.position,r.position),m.negate(r.position,r.direction),m.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),m.normalize(r.direction,r.direction),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up)))}LF.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var _pt=new m,gpt=new m;LF.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;B.equals(t.transform,B.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let r=l(this._globe)?this._globe.terrainExaggeration:1,o=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=vc.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=vc.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=vc.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,_pt),c=m.clone(t.directionWC,gpt);i===ne.SCENE2D?mht(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Fht(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,mpt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&BX(this),this._aggregator.reset()};LF.prototype.isDestroyed=function(){return!1};LF.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var NF=LF;var FF=`uniform sampler2D colorTexture; -uniform sampler2D colorTexture2; + #endif -uniform vec2 center; -uniform float radius; + return vec3(longitude, latitude, height); +} +`;var B2=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +#define OCTREE_FLAG_INTERNAL 0 +#define OCTREE_FLAG_LEAF 1 +#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 -in vec2 v_textureCoordinates; +#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops -void main() -{ - vec4 color0 = texture(colorTexture, v_textureCoordinates); - vec4 color1 = texture(colorTexture2, v_textureCoordinates); +uniform sampler2D u_octreeInternalNodeTexture; +uniform vec2 u_octreeInternalNodeTexelSizeUv; +uniform int u_octreeInternalNodeTilesPerRow; +#if (SAMPLE_COUNT > 1) +uniform sampler2D u_octreeLeafNodeTexture; +uniform vec2 u_octreeLeafNodeTexelSizeUv; +uniform int u_octreeLeafNodeTilesPerRow; +#endif - float x = length(gl_FragCoord.xy - center) / radius; - float t = smoothstep(0.5, 0.8, x); - out_FragColor = mix(color0 + color1, color1, t); -} -`;var UF=`uniform sampler2D colorTexture; +struct OctreeNodeData { + int data; + int flag; +}; -uniform float avgLuminance; -uniform float threshold; -uniform float offset; +struct TraversalData { + ivec4 octreeCoords; + int parentOctreeIndex; +}; -in vec2 v_textureCoordinates; +struct SampleData { + int megatextureIndex; + ivec4 tileCoords; + vec3 tileUv; + #if (SAMPLE_COUNT > 1) + float weight; + #endif +}; -float key(float avg) -{ - float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); - return max(0.0, guess) + 0.1; +// Integer mod: For WebGL1 only +int intMod(in int a, in int b) { + return a - (b * (a / b)); +} +int normU8_toInt(in float value) { + return int(value * 255.0); +} +int normU8x2_toInt(in vec2 value) { + return int(value.x * 255.0) + 256 * int(value.y * 255.0); +} +float normU8x2_toFloat(in vec2 value) { + return float(normU8x2_toInt(value)) / 65535.0; } -// See section 9. "The bright-pass filter" of Realtime HDR Rendering -// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf +OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { + vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec3 xyz = czm_RGBToXYZ(color.rgb); - float luminance = xyz.r; + OctreeNodeData data; + data.data = normU8x2_toInt(texData.xy); + data.flag = normU8x2_toInt(texData.zw); + return data; +} - float scaledLum = key(avgLuminance) * luminance / avgLuminance; - float brightLum = max(scaledLum - threshold, 0.0); - float brightness = brightLum / (offset + brightLum); +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { + int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; + int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; + int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + return getOctreeNodeData(octreeUv); +} - xyz.r = brightness; - out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); +int getOctreeParentIndex(in int octreeIndex) { + int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; + int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); + int parentOctreeIndex = normU8x2_toInt(parentData.xy); + return parentOctreeIndex; } -`;function j_(){this._sceneFramebuffer=new gC;let e=.125,t=new Array(6);t[0]=new _r({fragmentShader:kl,textureScale:e,forcePowerOfTwo:!0,sampleMode:Fu.LINEAR});let n=t[1]=new _r({fragmentShader:UF,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new _r({fragmentShader:s0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new _r({fragmentShader:s0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new _r({fragmentShader:kl,sampleMode:Fu.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new _r({fragmentShader:FF,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Kc({stages:t});let r=new bC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}j_.prototype.get=function(e){return this._stages.get(e)};j_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var ypt=new oe,cAe=new H,Apt=new H,lAe=new B;function xpt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=B.computeViewportTransformation(n,0,1,lAe),u=B.multiplyByPoint(o,r,ypt),f=Mt.pointToGLWindowCoordinates(s,c,r,cAe);u.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=H.magnitude(H.subtract(d,f,d))*30*2,g=Apt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,A=t.drawingBufferHeight,x=e._stages,C=x.get(0),T=C.outputTexture.width,E=C.outputTexture.height,S=new Ke;S.width=T,S.height=E,c=B.computeViewportTransformation(S,0,1,lAe),f=Mt.pointToGLWindowCoordinates(s,c,r,cAe),g.x*=T/h,g.y*=E/A;let w=C.scissorRectangle;w.x=Math.max(f.x-g.x*.5,0),w.y=Math.max(f.y-g.y*.5,0),w.width=Math.min(g.x,h),w.height=Math.min(g.y,A);for(let D=1;D<4;++D)Ke.clone(w,x.get(D).scissorRectangle)}j_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};j_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),xpt(this,t,n),r};j_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};j_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(kl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};j_.prototype.isDestroyed=function(){return!1};j_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var VF=j_;var uH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Gi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=Ye(e.contextOptions),o=l(n),s=new uI(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Wn(),this._jobScheduler=new YN,this._frameState=new xN(s,new iN(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new ov(s),this._globe=void 0,this._globeTranslucencyState=new HN,this._primitives=new bl,this._groundPrimitives=new bl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new wC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new dN(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ri({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ri({depth:1,owner:this}),this._stencilClearCommand=new ri({stencil:0}),this._classificationStencilClearCommand=new ri({stencil:0,renderState:ze.fromCache({stencilMask:Ft.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new MF(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new sN,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Si,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new yN,this._shadowMapCamera=new sr(this),this.shadowMap=new G_({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new DS,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new OF,this._brdfLutGenerator=new xL,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new NF(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Ml.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Va.requestCompletedEvent.addEventListener(uH(this)),this._removeTaskProcessorListenerCallback=pi.taskCompletedEvent.addEventListener(uH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new sr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new sr(this),this.preloadFlightCullingVolume=void 0,this._picking=new aF(this),this._defaultView=new xC(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new np,mAe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function Cpt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(uH(e))),n.push(t.terrainProviderChanged.addEventListener(uH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Gi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ht.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ht.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return _d.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Cpt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new sr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new hN(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ht.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Gi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function uAe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=F_.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=F_.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=F_.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=G_.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Se.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Gi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);let o=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=o&&!c,p=s&&!u,g=(!o||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=G_.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=F_.createLogDepthCommand(e,n,a.logDepth),uAe(this,a.logDepth.command,i)),(f||g)&&uAe(this,e,i)}};var Tpt=new Vf({pass:Or.RENDER}),LX=new Vf({pass:Or.PRELOAD}),NX=new Vf({pass:Or.PRELOAD_FLIGHT}),Ept=new Vf({pass:Or.REQUEST_RENDER_MODE_DEFER_CHECK}),fAe=new ae,FX;function bpt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return fAe.radius=n.minimumRadius+i,FX=fL.fromBoundingSphere(fAe,e.camera.positionWC,FX),FX}}Gi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function mAe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Gi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=bpt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof To),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),DS.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Gi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==tn.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var lH=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);lH=B.inverseTransformation(lH,lH);function Spt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(r.mode!==ne.SCENE3D){c=B.multiplyByPoint(lH,c,c);let p=r.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=Fn.toWireframe(Os.createGeometry(new Os({radii:new m(p,p,p),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new vn({geometryInstances:new Tt({geometry:a,modelMatrix:B.fromTranslation(c),attributes:{color:new kt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Fn.toWireframe(sl.createGeometry(sl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new vn({geometryInstances:new Tt({geometry:a,modelMatrix:B.fromRotationTranslation(p,c,new B),attributes:{color:new kt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}let u=r.commandList,f=r.commandList=[];t._debugVolume.update(r),e=f[0],r.useLogDepth&&(e=F_.createLogDepthCommand(e,o).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(d)&&(n.framebuffer=d),r.commandList=u}function Ra(e,t,n,i,r){let o=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ri){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Spt(e,t,i,r),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function kF(e,t,n,i){let r=t._frameState,o=e.derivedCommands;l(o)&&(r.useLogDepth&&l(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,l(o.picking)?(e=o.picking.pickCommand,e.execute(n,i)):l(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(n,i)))}function hAe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function vpt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function wpt(e,t,n,i,r){let o=e.context;O_(i,hAe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function Dpt(e,t,n,i,r){let o=e.context;O_(i,vpt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function Ipt(e,t,n,i){let r=e.context;O_(i,hAe,e.camera.positionWC);let o=i.length;for(let s=0;s<o;++s)t(i[s],e,r,n)}var Ppt=new bi,Opt=new Yc,Rpt=new rn,Mpt=new To;function UX(e,t){let n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;o.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(Ppt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Opt):l(n.frustum.width)?s=n.frustum.clone(Rpt):s=n.frustum.clone(Mpt),s.near=n.frustum.near,s.far=n.frustum.far,o.updateFrustum(s),o.updatePass(Se.ENVIRONMENT);let a=r.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let b=u.skyBoxCommand;if(l(b)&&Ra(b,e,i,t),u.isSkyAtmosphereVisible&&Ra(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let v;u.useGlobeDepthFramebuffer?v=f.globeDepth.framebuffer:u.usePostProcess?v=f.sceneFramebuffer.framebuffer:v=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,v),t.framebuffer=v}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(b,v,I,M,F){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(b,v,I,M,F)}),g=e._executeOITFunction):a.render?g=wpt:g=Dpt;let h=f.frustumCommandsList,A=h.length,x=u.clearGlobeDepth,C=u.useDepthPlane,T=e._globeTranslucencyState,E=T.translucent,S=e._view.globeTranslucencyFramebuffer,w=e._depthClearCommand,D=e._stencilClearCommand,R=e._classificationStencilClearCommand,O=e._depthPlane,L=u.usePostProcessSelected,N=n.position.z,_;for(let b=0;b<A;++b){let v=A-b-1,I=h[v];e.mode===ne.SCENE2D?(n.position.z=N-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s)),w.execute(i,t),i.stencilBuffer&&D.execute(i,t),o.updatePass(Se.GLOBE);let M=I.commands[Se.GLOBE],F=I.indices[Se.GLOBE];if(E)T.executeGlobeCommands(I,Ra,S,e,t);else for(_=0;_<F;++_)Ra(M[_],e,i,t);let k=f.globeDepth;if(l(k)&&u.useGlobeDepthFramebuffer&&k.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(o.updatePass(Se.TERRAIN_CLASSIFICATION),M=I.commands[Se.TERRAIN_CLASSIFICATION],F=I.indices[Se.TERRAIN_CLASSIFICATION],E)T.executeGlobeClassificationCommands(I,Ra,S,e,t);else for(_=0;_<F;++_)Ra(M[_],e,i,t);if(x&&(w.execute(i,t),C&&O.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)Ra(M[_],e,i,t);if(F>0&&(l(k)&&u.useGlobeDepthFramebuffer&&(k.prepareColorTextures(i,x),k.executeUpdateDepth(i,t,x,k.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)Ra(M[_],e,i,t)}else{e._invertClassification.clear(i,t);let q=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)Ra(M[_],e,i,t);for(l(k)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),k.executeUpdateDepth(i,t,x,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<F;++_)Ra(M[_],e,i,t);for(t.framebuffer=q,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),F>0&&i.stencilBuffer&&R.execute(i,t),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)Ra(M[_],e,i,t)}for(F>0&&i.stencilBuffer&&D.execute(i,t),o.updatePass(Se.VOXELS),M=I.commands[Se.VOXELS],F=I.indices[Se.VOXELS],M.length=F,Ipt(e,Ra,t,M),o.updatePass(Se.OPAQUE),M=I.commands[Se.OPAQUE],F=I.indices[Se.OPAQUE],_=0;_<F;++_)Ra(M[_],e,i,t);v!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,o.updateFrustum(s));let V;if(!c&&u.useInvertClassification&&r.invertClassificationColor.alpha<1&&(V=e._invertClassification),o.updatePass(Se.TRANSLUCENT),M=I.commands[Se.TRANSLUCENT],M.length=I.indices[Se.TRANSLUCENT],g(e,Ra,t,M,V),I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,Ra,t,M,k.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,Ra,t,I)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let q=k.depthStencilTexture,Y=e._picking.getPickDepth(e,v);Y.update(i,q),Y.executeCopyDepth(i,t)}if(c||!L)continue;let U=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s),o.updatePass(Se.GLOBE),M=I.commands[Se.GLOBE],F=I.indices[Se.GLOBE],E)T.executeGlobeCommands(I,kF,S,e,t);else for(_=0;_<F;++_)kF(M[_],e,i,t);for(x&&(w.framebuffer=t.framebuffer,w.execute(i,t),w.framebuffer=void 0),x&&C&&O.execute(i,t),o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)kF(M[_],e,i,t);for(o.updatePass(Se.OPAQUE),M=I.commands[Se.OPAQUE],F=I.indices[Se.OPAQUE],_=0;_<F;++_)kF(M[_],e,i,t);for(o.updatePass(Se.TRANSLUCENT),M=I.commands[Se.TRANSLUCENT],F=I.indices[Se.TRANSLUCENT],_=0;_<F;++_)kF(M[_],e,i,t);t.framebuffer=U}}function pAe(e){e.context.uniformState.updatePass(Se.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,r=i.length;for(let o=0;o<r;++o)i[o].execute(e._computeEngine)}function Bpt(e,t){e.context.uniformState.updatePass(Se.OVERLAY);let i=e.context,r=e._overlayCommandList,o=r.length;for(let s=0;s<o;++s)r[s].execute(i,t)}function Lpt(e,t,n){let i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,s=o.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Se.GLOBE||u.pass===Se.CESIUM_3D_TILE||u.pass===Se.OPAQUE||u.pass===Se.TRANSLUCENT)&&e.isVisible(u,i))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(u,p))o[d].commandList.push(u),f=!0;else if(f)break}}}}function _Ae(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;Lpt(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];o.updateCamera(p.camera),a.updatePass(r,d);let g=p.commandList.length;for(let h=0;h<g;++h){let A=p.commandList[h];o.updatePass(A.pass),Ra(A.derivedCommands.shadows.castCommands[s],e,r,p.passState)}}}}var Npt=new m;Gi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?Fpt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===Ml.ROTATE?(Upt(this,e),l0(!0,this,e,t)):(VX(this,e,t),qpt(this,e))};function Fpt(e,t,n){let i=e._view,r=i.camera,s=e._environmentState.renderTranslucentDepthForPick;VX(e,t,n),gAe(e),i.createPotentiallyVisibleSet(e),pAe(e),s||_Ae(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=sr.clone(r,e._cameraVR);c.frustum=r.frustum;let u=r.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,Npt);r.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;m.add(c.position,p,r.position),r.frustum.xOffset=g,UX(e,t),a.x=a.width,m.subtract(c.position,p,r.position),r.frustum.xOffset=-g,UX(e,t),sr.clone(c,r)}function Upt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var Vpt=new he(Math.PI,P.PI_OVER_TWO),kpt=new m,zpt=new m,Hpt=new B,Gpt=new B,Wpt=new m,jpt=new m,Ypt=new Ke;function qpt(e,t){let n=e.context,i=e.frameState,r=e.camera,o=t.viewport,s=Ke.clone(o,Ypt);t.viewport=s;let a=Vpt,c=kpt;e.mapProjection.project(a,c);let f=m.clone(r.position,zpt),d=B.clone(r.transform,Gpt),p=r.frustum.clone();r._setTransform(B.IDENTITY);let g=B.computeViewportTransformation(s,0,1,Hpt),h=r.frustum.projectionMatrix,A=r.positionWC.y,x=m.fromElements(P.sign(A)*c.x-A,0,-r.positionWC.x,Wpt),C=Mt.pointToGLWindowCoordinates(h,g,x,jpt);C.x=Math.floor(C.x);let T=s.x,E=s.width;if(A===0||C.x<=T||C.x>=T+E)l0(!0,e,t);else if(Math.abs(T+E*.5-C.x)<1)s.width=C.x-s.x,r.position.x*=P.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!0,e,t),s.x=C.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!1,e,t);else if(C.x>T+E*.5){s.width=C.x-T;let S=r.frustum.right;r.frustum.right=c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!0,e,t),s.x=C.x,s.width=T+E-C.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=S-r.frustum.right*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!1,e,t)}else{s.x=C.x,s.width=T+E-C.x;let S=r.frustum.left;r.frustum.left=-c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!0,e,t),s.x=T,s.width=C.x-T,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=S-r.frustum.left*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),l0(!1,e,t)}r._setTransform(d),m.clone(f,r.position),r.frustum=p.clone(),t.viewport=o}function l0(e,t,n,i){let r=t._environmentState,o=t._view,s=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),gAe(t),o.createPotentiallyVisibleSet(t),e&&(l(i)&&VX(t,n,i),pAe(t),s||_Ae(t)),UX(t,n)}var dAe=new Jo;Gi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof rn||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(o)?(l(s)&&(o.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!r;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=dAe.planes;for(let A=0;A<5;++A)p[A]=d.planes[A];d=dAe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;l(g)&&(!l(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new _d(g)):!l(g)&&l(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function Xpt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Dh({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Kpt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,!!r){for(let o=0;o<i;++o)if(n[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let o=0;o<i;++o){let s=n[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function gAe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Xpt(e),Kpt(e),e._globe&&e._globe.render(t)}function VX(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new VF:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let h=e.postProcessStages,A=o.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(o.usePostProcessSelected=!1,A&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,r.useLogDepth,e._hdr),h.clear(i),A=o.usePostProcess=h.ready,o.usePostProcessSelected=A&&h.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:A&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&o.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,E=T.derivedCommands;E.oit=p.createDerivedCommands(T,i,E.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Gi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;l(r)&&r.prepareColorTextures(t);let o=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?r.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!o&&(g=u);let h=this.postProcessStages,A=g.getColorTexture(0),x=d.getColorTexture(0),C=y(u,f).getDepthStencilTexture();h.execute(t,A,C,x),h.copy(t,c)}!o&&!a&&s&&(e.framebuffer=c,r.executeCopyColor(t,e))};function Jpt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function Zpt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function Qpt(e){let t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!l(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return l(s)&&o.height<s}Gi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=Zpt(this),this._cameraUnderground=Qpt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function $pt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new z_({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function e_t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function t_t(e){let t=e._frameState;e.primitives.postPassesUpdate(t),Va.update()}var n_t=new z;function i_t(e){let t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Tpt;let o=y(e.backgroundColor,z.BLACK);e._hdr&&(o=z.clone(o,n_t),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof np?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,Bpt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function IC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function r_t(e){return e._picking.updateMostDetailedRayPicks(e)}Gi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,15e6,1);mAe(this,r,e),t.newFrame=!0}IC(this,e_t),this.primitives.show&&(IC(this,r_t),IC(this,o_t),IC(this,s_t),i||IC(this,a_t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),IC(this,i_t)),$pt(this,i),IC(this,t_t),Jpt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Gi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Gi.prototype.requestRender=function(){this._renderRequested=!0};Gi.prototype.clampLineWidth=function(e){return Math.max(Ht.minimumAliasedLineWidth,Math.min(e,Ht.maximumAliasedLineWidth))};Gi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Gi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Gi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Gi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function o_t(e){let t=e._frameState;LX.camera=t.camera,LX.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,LX)}function s_t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;NX.camera=e.preloadFlightCamera,NX.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,NX)}function a_t(e){e.primitives.updateForPass(e._frameState,Ept)}Gi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Gi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Gi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Gi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Gi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Gi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Gi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Gi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Gi.prototype.cartesianToCanvasCoordinates=function(e,t){return Xi.wgs84ToWindowCoordinates(this,e,t)};Gi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Gi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Gi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Gi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function c_t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Gi.prototype.setTerrain=function(e){return c_t(this,e),e};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var zF=Gi;var NS=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); + +/** +* Convert a position in the uv-space of the tileset bounding shape +* into the uv-space of a tile within the tileset +*/ +vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { + // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) + float dimAtLevel = pow(2.0, float(octreeCoords.w)); + return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); } -vec3 getLightDirection(vec3 positionWC) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = - positionWC * float(lightEnum == 0.0) + - czm_lightDirectionWC * float(lightEnum == 1.0) + - czm_sunDirectionWC * float(lightEnum == 2.0); - return normalize(lightDirection); +void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { + sampleData.megatextureIndex = data.data; + sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; } -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; +#if (SAMPLE_COUNT > 1) +void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { + int leafIndex = data.data; + int leafNodeTexelCount = 2; + // Adding 0.5 moves to the center of the texel + float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; + float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; + + // Get an interpolation weight and a flag to determine whether to read the parent texture + vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); + vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); + float lerp = normU8x2_toFloat(leafData0.xy); + sampleDatas[0].weight = 1.0 - lerp; + sampleDatas[1].weight = lerp; + // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT + sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; + sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; + + // Get megatexture indices for both samples + vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); + vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); + sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); + sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); +} +#endif + +OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { + float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); + vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; + vec3 end = start + vec3(sizeAtLevel); + OctreeNodeData childData; + + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + // Find out which octree child contains the position + // 0 if before center, 1 if after + vec3 center = 0.5 * (start + end); + vec3 childCoord = step(center, shapePosition); + + // Get octree coords for the next level down + ivec4 octreeCoords = traversalData.octreeCoords; + traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); + + childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); + + if (childData.flag != OCTREE_FLAG_INTERNAL) { + // leaf tile - stop traversing + break; + } + + // interior tile - keep going deeper + start = mix(start, center, childCoord); + end = mix(center, end, childCoord); + traversalData.parentOctreeIndex = childData.data; + } - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + return childData; +} - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; +/** +* Transform a given position to an octree tile coordinate and a position within that tile, +* and find the corresponding megatexture index and texture coordinates +*/ +void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { + traversalData.octreeCoords = ivec4(0); + traversalData.parentOctreeIndex = 0; - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); + if (nodeData.flag != OCTREE_FLAG_LEAF) { + nodeData = traverseOctreeDownwards(shapePosition, traversalData); + } - underTranslucentGlobe = 0.0; + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + #else + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); + #endif +} - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) +bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { + return clamp(v, minVal, maxVal) == v; +} - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); +bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { + vec3 tileUv = getTileUv(shapePosition, octreeCoords); + bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); + // Assume (!) the position is always inside the root tile. + return inside || octreeCoords.w == 0; +} - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); +void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { + if (insideTile(shapePosition, traversalData.octreeCoords)) { + for (int i = 0; i < SAMPLE_COUNT; i++) { + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + } + return; + } - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); + // Go up tree until we find a parent tile containing shapePosition + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + traversalData.octreeCoords.xyz /= 2; + traversalData.octreeCoords.w -= 1; - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; + if (insideTile(shapePosition, traversalData.octreeCoords)) { + break; } - #endif - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); + traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); + } - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + // Go down tree + OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + #else + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); + #endif } -`;var HF=`in vec3 v_outerPositionWC; +`;var k2=`// See Octree.glsl for the definitions of SampleData and intMod -uniform vec3 u_hsbShift; +/* Megatexture defines (set in Scene/VoxelRenderResources.js) +#define SAMPLE_COUNT ### +#define NEAREST_SAMPLING +#define PADDING +*/ -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif +uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions +uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions +uniform vec2 u_megatextureVoxelSizeUv; +uniform vec2 u_megatextureSliceSizeUv; +uniform vec2 u_megatextureTileSizeUv; -void main (void) -{ - vec3 lightDirection = getLightDirection(v_outerPositionWC); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; +uniform ivec3 u_dimensions; // does not include padding +#if defined(PADDING) + uniform ivec3 u_paddingBefore; + uniform ivec3 u_paddingAfter; +#endif - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); - #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; - #endif +// Integer min, max, clamp: For WebGL1 only +int intMin(int a, int b) { + return a <= b ? a : b; +} +int intMax(int a, int b) { + return a >= b ? a : b; +} +int intClamp(int v, int minVal, int maxVal) { + return intMin(intMax(v, minVal), maxVal); +} - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); +vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) +{ + int indexX = intMod(index, dimensions.x); + int indexY = index / dimensions.x; + return vec2(indexX, indexY) * uvScale; +} - #ifndef HDR - color.rgb = czm_acesTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif +/* + How is 3D data stored in a 2D megatexture? - #ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(color.rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - color.rgb = czm_HSBToRGB(hsb); - #endif + In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). + The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and + the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). + Note that there could be empty space in the megatexture because it's a power of two. - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); - } + 0 1 2 3 + +---+---+---+---+ + | | | | | 3 + +---+---+---+---+ + | | | | | 2 + +-------+-------+ + |010|110|011|111| 1 + |--- ---|--- ---| + |000|100|001|101| 0 + +-------+-------+ - out_FragColor = color; -} -`;var GF=`in vec4 position; + When doing linear interpolation the megatexture needs to be sampled twice: once for + the Z slice above the voxel coordinate and once for the slice below. The two slices + are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is + halfway between two Z slices so the interpolation factor is 0.5. Below is a side view + of the 3D voxel grid with voxel coordinates on the left side. -out vec3 v_outerPositionWC; + 2 +---+ + |001| + 1 +-z-+ + |000| + 0 +---+ -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif + When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. +*/ -void main(void) -{ - vec4 positionWC = czm_model * position; - vec3 lightDirection = getLightDirection(positionWC.xyz); +Properties getPropertiesFromMegatexture(in SampleData sampleData) { + vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? + int tileIndex = sampleData.megatextureIndex; + vec3 voxelCoord = tileUv * vec3(u_dimensions); + ivec3 voxelDimensions = u_dimensions; - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); + #if defined(PADDING) + voxelDimensions += u_paddingBefore + u_paddingAfter; + voxelCoord += vec3(u_paddingBefore); #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; -} -`;function FS(e){e=y(e,re.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=B.fromScale(n),this._modelMatrix=new B,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(FS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});FS.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var kX=new B;FS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=B.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,kX),r=B.multiplyTransformation(i,cr.Y_UP_TO_Z_UP,kX),o=B.multiply(this._scaleMatrix,r,kX);B.clone(o,this._modelMatrix);let s=e.context,a=l_t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Os.createGeometry(new Os({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Pe.POSITION_ONLY}));f.vertexArray=oi.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:mn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[U_,NS,GF]}),h=new He({defines:p,sources:[U_,NS,HF]});this._spSkyAtmosphere=Zt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function l_t(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}FS.prototype.isDestroyed=function(){return!1};FS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var WF=FS;var jF=`uniform samplerCube u_cubeMap; -in vec3 v_texCoord; + #if defined(NEAREST_SAMPLING) + // Round to the center of the nearest voxel + voxelCoord = floor(voxelCoord) + vec3(0.5); + #endif -void main() -{ - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var YF=`in vec3 position; + // Tile location + vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -out vec3 v_texCoord; + // Slice location + float slice = voxelCoord.z - 0.5; + int sliceIndex = int(floor(slice)); + int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); + vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;function fH(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new nt({modelMatrix:B.clone(B.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}fH.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let o=this.sources;typeof o.positiveX=="string"?mI(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ha({context:i,source:o}))}let r=this._command;if(!l(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};let o=sl.createGeometry(sl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Pe.POSITION_ONLY})),s=this._attributeLocations=Fn.createAttributeLocations(o);r.vertexArray=oi.fromGeometry({context:i,geometry:o,attributeLocations:s,bufferUsage:Fe.STATIC_DRAW}),r.renderState=ze.fromCache({blending:mn.ALPHA_BLEND})}if(!l(r.shaderProgram)||this._useHdr!==t){let o=new He({defines:[t?"HDR":""],sources:[jF]});r.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:YF,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return r};fH.prototype.isDestroyed=function(){return!1};fH.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var qF=fH;function qf(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Bn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o,s)}var u_t=new m;qf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=Z.getScale(this.orientedBoundingBox.halfAxes,u_t),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};qf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:r,z:o}=this,s=i*2,a=r*2,c=o*2,u=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,u,c],[p,f,u,c],[p,s,a,d],[p,f,a,d],[p,s,u,d],[p,f,u,d]];this.children=g.map(([h,A,x,C])=>new qf(h,A,x,C,this,e,t))};qf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};qf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var yAe={keyframe:0};function XF(e,t){return yAe.keyframe=e,wr(t,yAe,Ki.searchComparator)}qf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=f_t(i,d),g=d[p],h=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),A=d[h],x=i-g.keyframe,C=AAe(n-t.level,x);C<a&&(a=C,o=g);let T=A.keyframe-r,E=AAe(n-t.level,T);if(E<c&&(c=E,s=A),x===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function f_t(e,t){let n=XF(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function AAe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}qf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};qf.prototype.createKeyframeNode=function(e){let t=XF(e,this.keyframeNodes);if(t<0){t=~t;let n=new Ki(this,e);this.keyframeNodes.splice(t,0,n)}};qf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=XF(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=XF(n,this.renderableKeyframeNodes);if(r<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.spatialNode=void 0,e.state=Ki.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};qf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==Ki.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let r=0;r<t.length;r++){let o=t[r];e.megatextureIndex=o.add(e.metadatas[r]),e.metadatas[r]=void 0}e.state=Ki.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=XF(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};qf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var KF=qf;function zX(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(zX.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});zX.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(r,o,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var HX=zX;function JF(){}JF.prototype.evaluate=function(e,t){fe.throwInstantiationError()};JF.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};JF.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};JF.prototype.getVariables=function(){fe.throwInstantiationError()};var GX=JF;var ZF=`uniform sampler2D u_texture; + // Voxel location + vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -in vec2 v_textureCoordinates; + // Final location in the megatexture + vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); + #if defined(NEAREST_SAMPLING) + return getPropertiesFromMegatextureAtUv(uv0); + #else + float sliceLerp = fract(slice); + int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); + vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); + vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; + Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); + Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); + return mixProperties(properties0, properties1, sliceLerp); + #endif } -`;var QF=`uniform float u_radiusTS; -in vec2 v_textureCoordinates; +// Convert an array of sample datas to a final weighted properties. +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { + #if (SAMPLE_COUNT == 1) + return getPropertiesFromMegatexture(sampleDatas[0]); + #else + // When more than one sample is taken the accumulator needs to start at 0 + Properties properties = clearProperties(); + for (int i = 0; i < SAMPLE_COUNT; ++i) { + float weight = sampleDatas[i].weight; -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); + // Avoid reading the megatexture when the weight is 0 as it can be costly. + if (weight > 0.0) { + Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); + tempProperties = scaleProperties(tempProperties, weight); + properties = sumProperties(properties, tempProperties); + } + } + return properties; + #endif } - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +`;function Lmt(e){let t=new Vx;this.shaderBuilder=t;let n=e._customShader,i=_t(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,Te.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",Te.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([w2]),t.addFragmentLines([n.fragmentShaderText,"#line 0",B2,I2,k2]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,Te.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,Te.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,Te.FRAGMENT),t.addFragmentLines([P2])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,Te.FRAGMENT),t.addFragmentLines([D2]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,Te.FRAGMENT),t.addFragmentLines([L2,O2,EC])):a==="CYLINDER"?t.addFragmentLines([R2,EC,N2]):a==="ELLIPSOID"&&t.addFragmentLines([M2,EC,F2]),t.addFragmentLines([v2]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,Te.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,Te.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,Te.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,Te.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,Te.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,Te.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,Te.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,Te.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,Te.FRAGMENT)}var U2=Lmt;function Nmt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,Te.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=`PropertyStatistics_${N}`,E=`PropertyStatistics_${N}`;n.addStruct(_,E,Te.FRAGMENT);let w=fH(F);n.addStructField(_,w,"min"),n.addStructField(_,w,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=`PropertyStatistics_${N}`,_=N;n.addStructField(f,F,_)}let g="Metadata",h="Metadata",x="metadata";n.addStruct(g,h,Te.FRAGMENT),n.addStructField(g,d,p);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=fH(F);n.addStructField(g,_,N)}for(let R=0;R<c;R++){let N=i[R],F=o[R],_=Bmt(F),E=`VoxelProperty_${N}`,w=`VoxelProperty_${N}`;n.addStruct(E,w,Te.FRAGMENT),n.addStructField(E,_,"partialDerivativeLocal"),n.addStructField(E,_,"partialDerivativeWorld"),n.addStructField(E,_,"partialDerivativeView"),n.addStructField(E,_,"partialDerivativeValid")}let b="Voxel",C="Voxel",T="voxel";n.addStruct(b,C,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=`VoxelProperty_${N}`;n.addStructField(b,F,N)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance");let A="FragmentInput",S="FragmentInput";n.addStruct(A,S,Te.FRAGMENT),n.addStructField(A,h,x),n.addStructField(A,C,T);let v="Properties",I="Properties",O="properties";n.addStruct(v,I,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=fH(F);n.addStructField(v,_,N)}{let R="clearProperties";n.addFunction(R,`${I} clearProperties()`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=r[N],w=fH(_,E);n.addFunctionLines(R,[`${O}.${F} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${O}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${I} scaleProperties(${I} ${O}, float scale)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} scaledProperties = ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${O}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${I} ${O}, inout ${h} ${x})`,Te.FRAGMENT);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${x}.${F} = ${O}.${F};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${d} ${p})`,Te.FRAGMENT);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=qt.getComponentCount(_);for(let w=0;w<E;w++){let D=kmt(_,w),M=s[N][w],B=a[N][w];n.addFunctionLines(R,[`${p}.${F}.min${D} = ${K0e(M)};`,`${p}.${F}.max${D} = ${K0e(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=r[N],w=Fmt(_,E);n.addFunctionLines(R,[`properties.${F} = texture(u_megatextureTextures[${N}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function fH(e){if(e===qt.SCALAR)return"float";if(e===qt.VEC2)return"vec2";if(e===qt.VEC3)return"vec3";if(e===qt.VEC4)return"vec4"}function Fmt(e){if(e===qt.SCALAR)return".r";if(e===qt.VEC2)return".ra";if(e===qt.VEC3)return".rgb";if(e===qt.VEC4)return""}function Bmt(e){if(e===qt.SCALAR)return"vec3";if(e===qt.VEC2)return"mat2";if(e===qt.VEC3)return"mat3";if(e===qt.VEC4)return"mat4"}function K0e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function kmt(e,t){return e===qt.SCALAR?"":`[${t}]`}var V2=Nmt;function Umt(e,t){let n=new U2(e);V2(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let h="getClippingPlane",x=M_(o,t),b=0,C=x.indexOf(")")+1,T=x.indexOf("{",C)+1,A=x.indexOf("}",T),S=x.slice(b,C),v=x.slice(T,A);i.addFunction(h,S,Te.FRAGMENT),i.addFunctionLines(h,[v])}let s=i.clone();s.addDefine("PICKING",void 0,Te.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),u=Ve.fromCache({cull:{enabled:!0,face:_i.BACK},depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new nt({vertexArray:f,primitiveType:Fe.TRIANGLES,renderState:u,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ae.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=nt.shallowClone(p,new nt);if(g.shaderProgram=c,g.pickOnly=!0,l(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(l(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var z2=Umt;function j_(){this.featurePropertiesDirty=!1}Object.defineProperties(j_.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});j_.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};j_.prototype.getFeature=function(e){fe.throwInstantiationError()};j_.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};j_.prototype.applyStyle=function(e){fe.throwInstantiationError()};j_.prototype.update=function(e,t){fe.throwInstantiationError()};j_.prototype.isDestroyed=function(){fe.throwInstantiationError()};j_.prototype.destroy=function(){fe.throwInstantiationError()};var cX=j_;function NS(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,zmt(this,t)}Object.defineProperties(NS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Vmt(e,t){this.condition=e,this.expression=t}function zmt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new Vmt(new ef(a,t),new ef(c,t)))}e._runtimeConditions=n}NS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};NS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};NS.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) + { + return ${f}; + } +`}return r=`${i} ${e} { - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); +${r} return ${i}(1.0); } - +`,r};NS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var H2=NS;function l0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,Hmt(this,e)}function Hmt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new ef(o[r],i))}e._meta=n,e._ready=!0}function tr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new ef(String(t));if(typeof t=="string")return new ef(t,n);if(l(t.conditions))return new H2(t,n)}else return;return t}function nr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(l0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=tr(this,e),this._style.show=nr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=tr(this,e),this._style.color=nr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=tr(this,e),this._style.pointSize=nr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=tr(this,e),this._style.pointOutlineColor=nr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=tr(this,e),this._style.pointOutlineWidth=nr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=tr(this,e),this._style.labelColor=nr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=tr(this,e),this._style.labelOutlineColor=nr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=tr(this,e),this._style.labelOutlineWidth=nr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=tr(this,e),this._style.font=nr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=tr(this,e),this._style.labelStyle=nr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=tr(this,e),this._style.labelText=nr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=tr(this,e),this._style.backgroundColor=nr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=tr(this,e),this._style.backgroundPadding=nr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=tr(this,e),this._style.backgroundEnabled=nr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=tr(this,e),this._style.scaleByDistance=nr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=tr(this,e),this._style.translucencyByDistance=nr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=tr(this,e),this._style.distanceDisplayCondition=nr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=tr(this,e),this._style.heightOffset=nr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=tr(this,e),this._style.anchorLineEnabled=nr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=tr(this,e),this._style.anchorLineColor=nr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=tr(this,e),this._style.image=nr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=tr(this,e),this._style.disableDepthTestDistance=nr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=tr(this,e),this._style.horizontalOrigin=nr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=tr(this,e),this._style.verticalOrigin=nr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=tr(this,e),this._style.labelHorizontalOrigin=nr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=tr(this,e),this._style.labelVerticalOrigin=nr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});l0.fromUrl=function(e){return Se.createIfNeeded(e).fetchJson(e).then(function(n){return new l0(n)})};l0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};l0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};l0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};l0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var q_=l0;function G2(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new jb({comparator:G2.comparator})}G2.prototype.addSubtree=function(e){let t=new Gmt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};G2.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};G2.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function Gmt(e,t){this.subtree=e,this.stamp=t}var W2=G2;function kl(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._minBounds=m.clone(kl.DefaultMinBounds,new m),this._maxBounds=m.clone(kl.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Wmt=new m,lX=new m,jmt=new Z,qmt=new m,Ymt=new m,Xmt=new m,Kmt=new m,J0e=L.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new L);kl.prototype.update=function(e,t,n,i,o){i=y(i,kl.DefaultMinBounds),o=y(o,kl.DefaultMaxBounds);let r=kl.DefaultMinBounds,s=kl.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,qmt),o=m.clamp(o,r,s,Ymt);let a=m.clamp(t,i,o,Xmt),c=m.clamp(n,i,o,Kmt),u=L.getScale(e,lX);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=L.clone(e,this.shapeTransform),this.orientedBoundingBox=Z0e(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=L.multiplyByPoint(J0e,a,f.renderMinBounds),f.renderMaxBounds=L.multiplyByPoint(J0e,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,x=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===x.x?1:x.x-h.x),2/(h.y===x.y?1:x.y-h.y),2/(h.z===x.z?1:x.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var Jmt=new m,Zmt=new m;kl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),Jmt),u=m.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),Zmt);return Z0e(c,u,this.shapeTransform,o)};kl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};kl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));kl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function Z0e(e,t,n,i){let o=kl.DefaultMinBounds,r=kl.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=L.getTranslation(n,i.center),i.halfAxes=L.getMatrix3(n,i.halfAxes);else{let a=L.getScale(n,lX),c=m.midpoint(e,t,Wmt);i.center=L.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),lX);let u=L.getRotation(n,jmt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var Nh=kl;function dH(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(dH.prototype,{metadataTable:{get:function(){return this._metadataTable}}});dH.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=Qmt(n);let r=await $mt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let d=0;d<a;++d){let p=o.json.bufferViews[d],g=p.byteOffset,h=g+p.byteLength,b=r[p.buffer].subarray(g,h);s[d]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new dH(e);return f._metadataTable=new hl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function $mt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function Qmt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Oo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var j2=dH;function Gr(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._minimumRadius=Gr.DefaultMinBounds.x,this._maximumRadius=Gr.DefaultMaxBounds.x,this._minimumHeight=Gr.DefaultMinBounds.y,this._maximumHeight=Gr.DefaultMaxBounds.y,this._minimumAngle=Gr.DefaultMinBounds.z,this._maximumAngle=Gr.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new m,cylinderUvToRenderBoundsTranslate:new m,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvHeight:new H,cylinderUvToShapeUvAngle:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var Q0e=new m,eht=new m,tht=new m,nht=new Z,iht=new L,oht=new L,rht=L.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new L);Gr.prototype.update=function(e,t,n,i,o){i=y(i,Gr.DefaultMinBounds),o=y(o,Gr.DefaultMaxBounds);let r=Gr.DefaultMinBounds.x,s=Gr.DefaultMaxBounds.x,a=Gr.DefaultMinBounds.y,c=Gr.DefaultMaxBounds.y,u=Gr.DefaultMinBounds.z,f=Gr.DefaultMaxBounds.z,d=f-u,p=.5*d,g=P.EPSILON10,h=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),C=P.clamp(n.x,r,s),T=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),S=Math.max(b,T),v=Math.min(C,A),I=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),N=P.clamp(o.y,a,c),F=Math.max(I,R),_=Math.min(O,N),E=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),D=P.negativePiToPi(i.z),M=P.negativePiToPi(o.z),B=Math.max(E,D),V=Math.min(w,M),U=L.getScale(e,Q0e);if(v===0||S>v||F>_||P.equalsEpsilon(U.x,0,void 0,g)||P.equalsEpsilon(U.y,0,void 0,g)||P.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=b,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=O,this._minimumAngle=E,this._maximumAngle=w,this.shapeTransform=L.clone(e,this.shapeTransform),this.orientedBoundingBox=fX(S,v,F,_,B,V,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Y=b===r&&C===s,j=I===a&&O===c,$=w<E,W=w-E+$*d,K=W>p+x&&W<d-x,J=W>x&&W<p-x,he=W>=p-x&&W<=p+x,ge=W<=x,se=K||J||he||ge,_e=P.equalsEpsilon(E,u,void 0,h),xe=P.equalsEpsilon(w,f,void 0,h),Pe=v===s,ve=S===r,we=F===a&&_===c,ze=V<B,Re=V-B+ze*d,dt=Re>p+x&&Re<d-x,Tt=Re>x&&Re<p-x,ot=Re>=p-x&&Re<=p+x,ln=Re<=x,Dn=dt||Tt||ot||ln,Ht=this.shaderUniforms,kt=this.shaderDefines;for(let Ee in kt)kt.hasOwnProperty(Ee)&&(kt[Ee]=void 0);let be=0;if(kt.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=be,be+=1,ve||(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,kt.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=be,be+=1,Ht.cylinderUvToRenderRadiusMin=v/S),Pe||(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===v&&(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),we||(kt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),F===_&&(kt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),I===O&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),b===C&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!Y){kt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ee=1/(C-b),at=b/(b-C);Ht.cylinderUvToShapeUvRadius=H.fromElements(Ee,at,Ht.cylinderUvToShapeUvRadius)}if(!j){kt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ee=2/(O-I),at=(I+1)/(I-O);Ht.cylinderUvToShapeUvHeight=H.fromElements(Ee,at,Ht.cylinderUvToShapeUvHeight)}if(!Pe||!we){let Ee=.5*(_-F),at=m.fromElements(1/v,1/v,1/(Ee===0?1:Ee),tht),Jt=m.fromElements(0,0,-at.z*.5*(F+_),eht),di=L.fromRotationTranslation(Z.fromScale(at,nht),Jt,iht),Ze=L.multiplyTransformation(di,rht,oht);Ht.cylinderUvToRenderBoundsScale=L.getScale(Ze,Ht.cylinderUvToRenderBoundsScale),Ht.cylinderUvToRenderBoundsTranslate=L.getTranslation(Ze,Ht.cylinderUvToRenderBoundsTranslate)}if($&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Dn&&(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,kt.CYLINDER_INTERSECTION_INDEX_ANGLE=be,dt?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,be+=1):Tt?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,be+=2):ot?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,be+=1):ln&&(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,be+=2),Ht.cylinderRenderAngleMinMax=H.fromElements(B,V,Ht.cylinderAngleMinMax)),se){kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ge&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),_e&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ee=(E-u)/d,at=(w-u)/d,Jt=1-W/d;Ht.cylinderShapeUvAngleMinMax=H.fromElements(Ee,at,Ht.cylinderShapeUvAngleMinMax),Ht.cylinderShapeUvAngleRangeZeroMid=(at+.5*Jt)%1;let di=d/W,Ze=-(E-u)/W;Ht.cylinderUvToShapeUvAngle=H.fromElements(di,Ze,Ht.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=be,!0};Gr.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(r,s,t*d),g=P.lerp(r,s,(t+1)*d),h=P.lerp(a,c,n*d),x=P.lerp(a,c,(n+1)*d),b=P.lerp(u,f,i*d),C=P.lerp(u,f,(i+1)*d);return fX(p,g,h,x,b,C,this.shapeTransform,o)};var sht=new Ln,aht=new m,cht=new m,lht=new m;Gr.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,o=this._minimumHeight,r=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,u=1-1/e.y,f=1-1/e.z,d=P.lerp(n,i,c),p=P.lerp(o,r,u),g=P.lerp(s,a,f),C=fX(d,i,p,r,g,a,t,sht),T=Z.getScale(C.halfAxes,aht),A=L.getScale(t,cht),S=m.divideComponents(T,A,lht);return m.minimumComponent(S)};Gr.DefaultMinBounds=Object.freeze(new m(0,-1,-P.PI));Gr.DefaultMaxBounds=Object.freeze(new m(1,1,+P.PI));var uht=5,fht=new Array(uht),dht=new m,mht=new Z,hht=new L,pht=new L,_ht=new L,uX=new L,ght=new m,yht=new m,xht=new m,exe=new Array(8);for(let e=0;e<8;e++)exe[e]=new m;function $0e(e,t,n){return Math.abs(re.dot(e,t))<n}function bht(e){let t=L.getColumn(e,0,ght),n=L.getColumn(e,1,yht),i=L.getColumn(e,2,xht),o=P.EPSILON4;return $0e(t,n,o)&&$0e(n,i,o)}function Cht(e,t){let n=exe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)L.multiplyByPoint(e,n[i],n[i]);return Ln.fromPoints(n,t)}function fX(e,t,n,i,o,r,s,a){let c=Gr.DefaultMinBounds,u=Gr.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,h=c.z,x=u.z;if(e===f&&t===d&&n===p&&i===g&&o===h&&r===x)return a.center=L.getTranslation(s,a.center),a.halfAxes=L.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let C=r-o,T=o+C*.5,A=fht,S=0;A[S++]=o,A[S++]=r,A[S++]=T,C>P.PI&&(A[S++]=T-P.PI_OVER_TWO,A[S++]=T+P.PI_OVER_TWO);let v=1,I=1,O=-1,R=-1;for(let $=0;$<S;++$){let W=A[$]-T,K=Math.cos(W),J=Math.sin(W),he=K*e,ge=J*e,se=K*t,_e=J*t;v=Math.min(v,he),I=Math.min(I,ge),v=Math.min(v,se),I=Math.min(I,_e),O=Math.max(O,he),R=Math.max(R,ge),O=Math.max(O,se),R=Math.max(R,_e)}let N=O-v,F=R-I,_=i-n,E=(v+O)*.5,w=(I+R)*.5,D=(n+i)*.5,M=m.fromElements(E,w,D,dht),B=Z.fromRotationZ(T,mht),V=m.fromElements(N,F,_,Q0e),U=L.fromScale(V,_ht),G=L.fromRotation(B,pht),k=L.fromTranslation(M,hht),Y=L.multiplyTransformation(G,L.multiplyTransformation(k,U,uX),uX),j=L.multiplyTransformation(s,Y,uX);return bht(j)?Ln.fromTransformation(j,a):Cht(j,a)}var Fh=Gr;function Ul(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._rectangle=new ce,this._minimumHeight=Ul.DefaultMinBounds.z,this._maximumHeight=Ul.DefaultMaxBounds.z,this._ellipsoid=new oe,this._translation=new m,this._rotation=new Z,this.shaderUniforms={ellipsoidRadiiUv:new m,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeCosSqrHalfMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new H,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Tht=new m,Aht=new Z,txe=new m,nxe=new m,ixe=new m,oxe=new m,Eht=new ce;Ul.prototype.update=function(e,t,n,i,o){i=y(i,Ul.DefaultMinBounds),o=y(o,Ul.DefaultMaxBounds);let r=Ul.DefaultMinBounds.x,s=Ul.DefaultMaxBounds.x,a=s-r,c=.5*a,u=Ul.DefaultMinBounds.y,f=Ul.DefaultMaxBounds.y,d=f-u,p=P.EPSILON10,g=P.EPSILON3,h=P.EPSILON10,x=P.EPSILON10,b=P.EPSILON3,C=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),A=P.clamp(i.x,r,s),S=P.clamp(o.x,r,s),v=Math.max(C,A),I=Math.min(T,S),O=P.clamp(t.y,u,f),R=P.clamp(n.y,u,f),N=P.clamp(i.y,u,f),F=P.clamp(o.y,u,f),_=Math.max(O,N),E=Math.min(R,F),w=L.getScale(e,Tht),D=w.x===w.y&&w.y===w.z,M=m.minimumComponent(w),B=Math.max(t.z,-M),V=Math.max(n.z,-M),U=Math.max(i.z,-M),G=Math.max(o.z,-M),k=Math.max(B,U),Y=Math.min(V,G),j=m.add(w,m.fromElements(B,B,B,nxe),nxe),$=m.add(w,m.fromElements(V,V,V,txe),txe),W=m.maximumComponent($),K=m.add(w,m.fromElements(k,k,k,oxe),oxe),J=m.add(w,m.fromElements(Y,Y,Y,ixe),ixe);if(_>E||_===f||E===u||k>Y||P.equalsEpsilon(J,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,O,T,R),this._translation=L.getTranslation(e,this._translation),this._rotation=L.getRotation(e,this._rotation),this._ellipsoid=oe.fromCartesian3(w,this._ellipsoid),this._minimumHeight=B,this._maximumHeight=V;let he=ce.fromRadians(v,_,I,E,Eht);this.orientedBoundingBox=rxe(he,k,Y,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=L.fromRotationTranslation(Z.setScale(this._rotation,$,Aht),this._translation,this.shapeTransform),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ge=I<v,se=I-v+ge*a,_e=se<=h,xe=se>c+h&&se<a-h,Pe=se>=c-h&&se<=c+h,ve=se>h&&se<c-h,we=_e||xe||Pe||ve,ze=T<C,Re=T-C+ze*a,dt=Re<=h,Tt=Re>c+h&&Re<a-h,ot=Re>=c-h&&Re<=c+h,ln=Re>h&&Re<c-h,Dn=dt||Tt||ot||ln,Ht=E<-b,kt=E>=-b&&E<=+b,be=E>+b&&E<f-x,Ee=Ht||kt||be,at=_>u+x&&_<-b,Jt=_>=-b&&_<=+b,di=_>+b,Ze=at||Jt||di,jr=Ee||Ze,qr=R-O,ha=R<-b,ts=R>=-b&&R<=+b,Ne=R>+b&&R<f-x,rt=ha||ts||Ne,$e=O>u+x&&O<-b,We=O>=-b&&O<=+b,mt=O>+b,Tn=rt||($e||We||mt),Qn=!m.equals(K,m.ZERO),Ao=!m.equals(J,m.ZERO),ns=Qn||Ao,is=Y-k,ur=!m.equals(j,m.ZERO),ji=!m.equals($,m.ZERO),os=ur||ji,Kn=this.shaderUniforms,Fn=this.shaderDefines;for(let bi in Fn)Fn.hasOwnProperty(bi)&&(Fn[bi]=void 0);Kn.ellipsoidRadiiUv=m.divideByScalar($,W,Kn.ellipsoidRadiiUv),Kn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Kn.ellipsoidRadiiUv,Kn.ellipsoidRadiiUv,Kn.ellipsoidInverseRadiiSquaredUv),Kn.ellipsoidInverseRadiiSquaredUv);let dn=0;if(Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=dn,dn+=1,ns&&(is===0&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),Qn&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=dn,dn+=1,Kn.ellipsoidInverseInnerScaleUv=W/(W-(V-k))),Ao&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Kn.ellipsoidInverseOuterScaleUv=W/(W-(V-Y)))),os){if(ur){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let bi=(V-B)/W;Kn.ellipsoidInverseHeightDifferenceUv=1/bi,Kn.ellipseInnerRadiiUv=H.fromElements(Kn.ellipsoidRadiiUv.x*(1-bi),Kn.ellipsoidRadiiUv.z*(1-bi),Kn.ellipseInnerRadiiUv)}B===V&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(we&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=dn,xe?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,dn+=1):ve?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,dn+=2):Pe?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,dn+=1):_e&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,dn+=2),Kn.ellipsoidRenderLongitudeMinMax=H.fromElements(v,I,Kn.ellipsoidRenderLongitudeMinMax)),Dn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,T<C&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let qi=a/Re,rs=-(C-r)/Re;Kn.ellipsoidUvToShapeUvLongitude=H.fromElements(qi,rs,Kn.ellipsoidUvToShapeUvLongitude)}if(we){let bi=P.equalsEpsilon(v,r,void 0,g),qi=P.equalsEpsilon(I,s,void 0,g);bi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),qi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let rs=(C-r)/a,lo=(T-r)/a,pa=(I-r)/a,$f=1-se/a,Qf=(pa+.5*$f)%1;Kn.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(rs,lo,Qf,Kn.ellipsoidShapeUvLongitudeMinMaxMid)}if(jr){Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,Ze&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=dn,at?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,dn+=1):Jt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,dn+=1):di&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,dn+=2)),Ee&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=dn,Ht?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,dn+=2):kt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,dn+=1):be&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,dn+=1)),_===E&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let bi=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(_)),2),qi=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(E)),2);Kn.ellipsoidRenderLatitudeCosSqrHalfMinMax=H.fromElements(bi,qi,Kn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(Tn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,O===R&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let bi=d/qr,qi=(u-O)/qr;Kn.ellipsoidUvToShapeUvLatitude=H.fromElements(bi,qi,Kn.ellipsoidUvToShapeUvLatitude)}return D&&(Fn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=dn,!0};var Sht=new ce;Ul.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=ce.subsection(this._rectangle,s,c,a,u,Sht),g=P.lerp(this._minimumHeight,this._maximumHeight,f),h=P.lerp(this._minimumHeight,this._maximumHeight,d);return rxe(p,g,h,this._ellipsoid,this._translation,this._rotation,o)};Ul.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,o=this._maximumHeight;return .5*((o-i)/(n+o))/e.z};function rxe(e,t,n,i,o,r,s){return s=Ln.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=Z.multiply(s.halfAxes,r,s.halfAxes),s}Ul.DefaultMinBounds=Object.freeze(new m(-P.PI,-P.PI_OVER_TWO,-Number.MAX_VALUE));Ul.DefaultMaxBounds=Object.freeze(new m(+P.PI,+P.PI_OVER_TWO,+Number.MAX_VALUE));var SC=Ul;var ku={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};ku.getMinBounds=function(e){switch(e){case ku.BOX:return Nh.DefaultMinBounds;case ku.ELLIPSOID:return SC.DefaultMinBounds;case ku.CYLINDER:return Fh.DefaultMinBounds}};ku.getMaxBounds=function(e){switch(e){case ku.BOX:return Nh.DefaultMaxBounds;case ku.ELLIPSOID:return SC.DefaultMaxBounds;case ku.CYLINDER:return Fh.DefaultMaxBounds}};ku.getShapeConstructor=function(e){switch(e){case ku.BOX:return Nh;case ku.ELLIPSOID:return SC;case ku.CYLINDER:return Fh}};var Wi=Object.freeze(ku);function q2(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new W2;let t=this,n;l(e.url)&&(Q("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(e.url).then(function(i){let o=Se.createIfNeeded(i);return o.fetchJson().then(function(r){return n=r,cxe(n),uxe(n,o).load()}).then(function(r){let s=n.root,a=s.content.extensions["3DTILES_content_voxels"],c=a.class,u=ni(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,f=r.schema,d=new ry({metadataJson:u,schema:f});fxe(t,d,c);let p=new sy(o,s,f),{shape:g,minBounds:h,maxBounds:x,shapeTransform:b,globalTransform:C}=lxe(s);t.shape=g,t.minBounds=h,t.maxBounds=x,t.dimensions=m.unpack(a.dimensions),t.shapeTransform=b,t.globalTransform=C,t.maximumTileCount=axe(d);let T,A;return l(a.padding)&&(T=m.unpack(a.padding.before),A=m.unpack(a.padding.after)),t.paddingBefore=T,t.paddingAfter=A,t._implicitTileset=p,Ni.unload(r),t._ready=!0,t})}))}Object.defineProperties(q2.prototype,{readyPromise:{get:function(){return Q("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});q2.fromUrl=async function(e){let t=Se.createIfNeeded(e),n=await t.fetchJson();cxe(n);let i=uxe(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ni(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new ry({metadataJson:a,schema:c}),f=new q2;fxe(f,u,s);let d=new sy(t,o,c),{shape:p,minBounds:g,maxBounds:h,shapeTransform:x,globalTransform:b}=lxe(o);f.shape=p,f.minBounds=g,f.maxBounds=h,f.dimensions=m.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=axe(u);let C,T;return l(r.padding)&&(C=m.unpack(r.padding.before),T=m.unpack(r.padding.after)),f.paddingBefore=C,f.paddingAfter=T,f._implicitTileset=d,Ni.unload(i),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function axe(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Dx.TILESET_TILE_COUNT)}function cxe(e){let t=e.root;if(!l(t.content))throw new de("Root must have content");if(!ni(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!ni(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ni(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function lxe(e){let t=e.boundingVolume,n;if(l(e.transform)?n=L.unpack(e.transform):n=L.clone(L.IDENTITY),l(t.box))return wht(t.box,n);if(l(t.region))return vht(t.region);if(ni(t,"3DTILES_bounding_volume_cylinder"))return Iht(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function vht(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=L.fromScale(oe.WGS84.radii),c=t,u=i,f=n,d=o,p=r,g=s,h=new m(c,f,p),x=new m(u,d,g);return{shape:Wi.ELLIPSOID,minBounds:h,maxBounds:x,shapeTransform:a,globalTransform:L.clone(L.IDENTITY)}}function wht(e,t){let n=Ln.unpack(e),i=L.fromRotationTranslation(n.halfAxes,n.center);return{shape:Wi.BOX,minBounds:m.clone(Nh.DefaultMinBounds),maxBounds:m.clone(Nh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Iht(e,t){let n=Ln.unpack(e),i=L.fromRotationTranslation(n.halfAxes,n.center);return{shape:Wi.CYLINDER,minBounds:m.clone(Fh.DefaultMinBounds),maxBounds:m.clone(Fh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function uxe(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ni.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ni.getSchemaLoader({schema:i})}function fxe(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:h}=p,x=r?.properties[d].min,b=r?.properties[d].max,C=qt.getComponentCount(g),T=sxe(x,C),A=sxe(b,C);return{id:d,type:g,componentType:h,minValue:T,maxValue:A}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function sxe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function Dht(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=eh(o);return await j2.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function Pht(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=eh(a);return o=await Ix.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}q2.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new ab({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return Pht(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?Dht(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var dX=q2;function mX(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(mX.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});mX.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var Y2=mX;var hX={CUMULUS:0};hX.validate=function(e){return e===hX.CUMULUS};var FS=Object.freeze(hX);function bm(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var Oht=bm.SHOW_INDEX=0,Rht=bm.POSITION_INDEX=1,Mht=bm.SCALE_INDEX=2,Lht=bm.MAXIMUM_SIZE_INDEX=3,Nht=bm.SLICE_INDEX=4,Fht=bm.BRIGHTNESS_INDEX=5,Bht=bm.COLOR_INDEX=6;bm.NUMBER_OF_PROPERTIES=7;function vC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(bm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,vC(this,Oht))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),vC(this,Rht))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),vC(this,Mht))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),vC(this,Lht))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),vC(this,Bht))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,vC(this,Nht))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,vC(this,Fht))}}});bm.prototype._destroy=function(){this._cloudCollection=void 0};var Uu=bm;var Vu,mH=new m,kht={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},Uht={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},Vht=Uu.SHOW_INDEX,zht=Uu.POSITION_INDEX,Hht=Uu.SCALE_INDEX,Ght=Uu.MAXIMUM_SIZE_INDEX,Wht=Uu.SLICE_INDEX,jht=Uu.BRIGHTNESS_INDEX,qht=Uu.NUMBER_OF_PROPERTIES,Yht=Uu.COLOR_INDEX;function Cm(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(qht),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:dxe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function dxe(e){return function(){return mH.x=e._textureSliceWidth,mH.y=e._noiseTextureRows,mH.z=1/e._noiseTextureRows,mH}}Object.defineProperties(Cm.prototype,{length:{get:function(){return _X(this),this._clouds.length}}});function mxe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Cm.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,FS.CUMULUS),n;return t===FS.CUMULUS&&(n=new Uu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Cm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Cm.prototype.removeAll=function(){mxe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function _X(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Cm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Cm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Cm.prototype.get=function(e){return _X(this),this._clouds[e]};var Xht=new Float32Array([-1,-1,1,-1,1,1,-1,1]),Kht=new Uint16Array([0,1,2,0,2,3]);function Jht(e){let t=ht.createVertexBuffer({context:e,typedArray:Xht,usage:ke.STATIC_DRAW}),n=ht.createIndexBuffer({context:e,typedArray:Kht,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ri({context:e,attributes:i,indexBuffer:n})}var gX;function Zht(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=ht.createIndexBuffer({context:e,typedArray:o,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function $ht(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ht.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function Qht(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ht.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:ke.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function ept(e,t,n){let i=[{index:Vu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Vu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Vu.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Vu.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Vu.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:ke.STATIC_DRAW}];n&&i.push({index:Vu.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Qht(e)});let o=n?t:4*t;return new Vp(e,i,o,n)}var pX=new jn;function hxe(e,t,n,i){let o,r=n[Vu.positionHighAndScaleX],s=n[Vu.positionLowAndScaleY],a=i.position;jn.fromCartesian(a,pX);let c=i.scale,u=pX.high,f=pX.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function pxe(e,t,n,i){let o,r=n[Vu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function _xe(e,t,n,i){let o,r=n[Vu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function gxe(e,t,n,i){let o,r=n[Vu.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function tpt(e,t,n,i){hxe(e,t,n,i),pxe(e,t,n,i),_xe(e,t,n,i),gxe(e,t,n,i)}function npt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=Jht(a),o._spNoise=Zt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Lt({context:a,width:r*r/s,height:r*s,pixelDatatype:Je.UNSIGNED_BYTE,pixelFormat:ct.RGBA,sampler:new hn({wrapS:Pn.REPEAT,wrapT:Pn.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:Ci.NEAREST})});let f=new Zu({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:dxe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function ipt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=ept(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];tpt(e,t,s,c)}n._vaf.commit(gX(i))}}var opt=[];function rpt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=opt;u.length=0,(c[zht]||c[Hht])&&u.push(hxe),(c[Vht]||c[jht])&&u.push(pxe),(c[Ght]||c[Wht])&&u.push(_xe),c[Yht]&&u.push(gxe);let f=u.length,d=i._vaf.writers,p,g,h;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._vaf.commit(gX(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function spt(e,t,n,i){let o=t.context,r=e,s=new Ge({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Ge({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Zt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Vu}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:mn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function apt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new nt),f.pass=Ae.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Cm.prototype.update=function(e){if(_X(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&npt(this,e,EN,AN),this._instanced=e.context.instancedArrays,Vu=this._instanced?Uht:kht,gX=this._instanced?$ht:Zht;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?ipt(this,e):r>0&&rpt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&spt(this,e,TN,CN),apt(this,e))};Cm.prototype.isDestroyed=function(){return!1};Cm.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),mxe(this._clouds),ue(this)};var yX=Cm;async function xX(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;l(n._readyPromise)?await n._readyPromise:l(n.readyPromise)&&await n.readyPromise;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await xX._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,h){return l(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}xX._sampleTerrainMostDetailed=T_;var wC=xX;var cpt=P.toRadians(30);function bX(e){this._angle=y(e,cpt)}Object.defineProperties(bX.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});bX.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var CX=bX;var lpt=new z,upt=new z,fpt=new z,dpt=new z,yxe=new re,X2=new Uint8Array(4);function xxe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,o,i)}function hH(e,t){return{height:e,color:z.clone(t)}}function bxe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?z.equals(t.color,i[n-1].color):!1,a=r?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?z.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function mpt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],h=P.clamp(g.height,Vl._minimumHeight,Vl._maximumHeight),x=z.clone(g.color,lpt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(hH(h,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],h=c[n+1];u=u&&g.height<=h.height,f=f&&g.height>=h.height}f?c=c.reverse():u||P_(c,function(g,h){return P.sign(g.height-h.height)});let d=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,hH(Vl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,hH(Vl._maximumHeight,c[c.length-1].color)),c=bxe(c),i.push(c)}return i}function hpt(e){let t=mpt(e),n=[],i=[],o;function r(u,f){n.push(hH(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,dpt);p=z.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let h=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,C=d<g?i[d]:void 0,T=d>0?i[d-1]:void 0,A=d<g-1?i[d+1]:void 0;if(l(h)&&l(C)&&h.height===C.height){let S=l(A)&&C.height===A.height,v=!l(T),I=!l(A),O=l(b)&&h.height===b.height,R=!l(x),N=!l(b);S?O?(s(h.height,h.color,C.color),s(h.height,b.color,A.color)):R?(r(h.height,C.color),s(h.height,h.color,A.color)):N?(s(h.height,h.color,C.color),r(h.height,A.color)):(s(h.height,h.color,C.color),s(h.height,h.color,A.color)):v?O?(r(h.height,h.color),s(h.height,b.color,C.color)):N?(r(h.height,h.color),r(h.height,C.color)):(R||r(h.height,h.color),s(h.height,h.color,C.color)):I?O?(s(h.height,h.color,C.color),r(h.height,b.color)):R?(r(h.height,C.color),r(h.height,h.color)):N?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),r(h.height,h.color)):O?(s(h.height,h.color,C.color),s(h.height,b.color,C.color)):R?(r(h.height,C.color),s(h.height,h.color,C.color)):N?(s(h.height,h.color,C.color),r(h.height,C.color)):s(h.height,h.color,C.color),f+=O?2:1,d+=S?2:1}else if(l(h)&&l(C)&&l(T)&&h.height<C.height){let S=xxe(h.height,T,C,fpt);l(x)?l(b)?s(h.height,h.color,S):(s(h.height,h.color,S),r(h.height,S)):(r(h.height,S),s(h.height,h.color,S)),f++}else if(l(C)&&l(h)&&l(x)&&C.height<h.height){let S=xxe(C.height,x,h,upt);l(T)?l(A)?s(C.height,S,C.color):(s(C.height,S,C.color),r(C.height,S)):(r(C.height,S),s(C.height,S,C.color)),d++}else l(h)&&(!l(C)||h.height<C.height)?(l(C)&&!l(T)&&!l(b)?(r(h.height,h.color),r(h.height,Vl._emptyColor),r(C.height,Vl._emptyColor)):(!l(C)&&l(T)&&!l(x)&&(r(T.height,Vl._emptyColor),r(h.height,Vl._emptyColor)),r(h.height,h.color)),f++):l(C)&&(!l(h)||C.height<h.height)&&(r(C.height,C.color),d++)}}return bxe(n)}function Vl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=hpt(n),r=o.length,s,a,c;if(!Vl._useFloatTexture(i)){a=Je.UNSIGNED_BYTE,c=ct.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)re.packFloat(o[g].height,yxe),re.pack(yxe,s,g*4)}else{a=Je.FLOAT,c=i.webgl2?ct.RED:ct.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Lt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.NEAREST,magnificationFilter:Ci.NEAREST})}),d=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(X2),d[g*4+0]=X2[0],d[g*4+1]=X2[1],d[g*4+2]=X2[2],d[g*4+3]=X2[3];let p=Lt.create({context:i,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Ci.LINEAR})});return zi.fromType("ElevationBand",{heights:f,colors:p})}Vl._useFloatTexture=function(e){return e.floatingPointTexture};Vl._maximumHeight=5906376425472;Vl._minimumHeight=-5906376425472;Vl._emptyColor=new z(0,0,0,0);var TX=Vl;async function ppt(e,t){e=y(e,Jb.defaultApiKey);let n,i=Jb.getDefaultApiKeyCredit(e);l(i)&&(n=[i]),t=y(t,{}),t.showCreditsOnScreen=!0;let o=new Se({url:`${Jb.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return Os.fromUrl(o,t)}var AX=ppt;function _pt(e){Q("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),e=_t(e,{url:Zs.fromAssetId(96188)});let t=new Os(e),n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new q_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var EX=_pt;async function gpt(e){let t=await Os.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new q_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var SX=gpt;function ypt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=L.clone(y(e.modelMatrix,L.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Ct({geometry:kn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new zt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Ct({geometry:kn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new zt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Ct({geometry:kn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new zt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var vX=ypt;function xpt(e){Q("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,_m.AERIAL),n=new Uf;return Uf._initialize(n,t,e),n}var wX=xpt;function K2(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } +`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } +`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } +`;break;case"vec4":r=`vec4 getColor() { return ${o}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${o}; void main() { - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${o} = czm_batchTable_${t}(batchId); +`:`${o} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${o}; +${r} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(K2.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});K2.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;K2.prototype.isTranslucent=no.prototype.isTranslucent;K2.prototype.getRenderState=no.prototype.getRenderState;var IX=K2;function pH(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=new L,this.id=e.id,this._id=void 0,this._primitive=void 0}pH.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!L.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=L.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Ct({geometry:new A_({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:kr.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:$t.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),n=new Ct({geometry:new A_({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:kr.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:$t.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),i=new Ct({geometry:new A_({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:kr.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:$t.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new kr,asynchronous:!1})}this._primitive.update(e)}};pH.prototype.isDestroyed=function(){return!1};pH.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var J2=pH;function bpt(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var DX=bpt;var Z2=`in vec3 v_positionMC; +in vec3 v_positionEC; +in vec2 v_st; - vec4 burst = vec4(0.0); +void main() +{ + czm_materialInput materialInput; - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} + vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + materialInput.s = v_st.s; + materialInput.st = v_st; + materialInput.str = vec3(v_st, 0.0); - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + // Convert tangent space material normal to eye space + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); - // End of manual loop unrolling. + // Convert view vector to world space + vec3 positionToEyeEC = -v_positionEC; + materialInput.positionToEyeEC = positionToEyeEC; - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + czm_material material = czm_getMaterial(materialInput); - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif } -`;var $F=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; +`;var $2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec2 st; +in float batchId; -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;function t2(){this.show=!0,this._drawCommand=new nt({primitiveType:Be.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(t2.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var d_t=new H,m_t=new H,h_t=new oe,e2=new oe;t2.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(o,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let w=n?r.halfFloatingPointTexture?Ze.HALF_FLOAT:Ze.FLOAT:Ze.UNSIGNED_BYTE;this._texture=new Bt({context:r,width:S,height:S,pixelFormat:at.RGBA,pixelDatatype:w}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,R={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new ju({fragmentShaderSource:QF,outputTexture:this._texture,uniformMap:R,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},w=new Uint8Array(4*2);w[0]=0,w[1]=0,w[2]=255,w[3]=0,w[4]=255,w[5]=255,w[6]=0,w[7]=255;let D=mt.createVertexBuffer({context:r,typedArray:w,usage:Fe.STATIC_DRAW}),R=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],O=mt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});a.vertexArray=new oi({context:r,attributes:R,indexBuffer:O}),a.shaderProgram=Zt.fromCache({context:r,vertexShaderSource:$F,fragmentShaderSource:ZF,attributeLocations:S}),a.renderState=ze.fromCache({blending:mn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=Xi.computeActualWgs84Position(e,c,e2),g=m.magnitude(m.subtract(p,e.camera.position,e2)),h=r.uniformState.projection,A=h_t;A.x=0,A.y=0,A.z=-g,A.w=1;let x=B.multiplyByVector(h,A,e2),C=Xi.clipToGLWindowCoordinates(t.viewport,x,d_t);A.x=P.SOLAR_RADIUS;let T=B.multiplyByVector(h,A,e2),E=Xi.clipToGLWindowCoordinates(t.viewport,T,m_t);return this._size=H.magnitude(H.subtract(E,C,e2)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};t2.prototype.isDestroyed=function(){return!1};t2.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var n2=t2;function dH(e){this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,__t(this,e)}Object.defineProperties(dH.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});dH.fromWorldTerrain=function(e){return new dH(Wx(e))};function p_t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function __t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){p_t(e._errorEvent,i)}}var i2=dH;function US(){}US.prototype.boundingVolume=void 0;US.prototype.boundingSphere=void 0;US.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};US.prototype.intersectPlane=function(e){fe.throwInstantiationError()};US.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var WX=US;function r2(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(r2.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});r2.prototype.getTileCredits=function(e,t,n){};r2.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};r2.prototype.pickFeatures=function(e,t,n,i,r){};var o2=r2;function jX(e){fe.throwInstantiationError()}jX.prototype.isReady=fe.throwInstantiationError;jX.prototype.shouldDiscardImage=fe.throwInstantiationError;var YX=jX;var g_t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},qX=Object.freeze(g_t);function OC(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.shadows=y(e.shadows,xn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new jm(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Mp,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(OC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return $("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function y_t(e){return`uniform vec4 czm_pickColor; -${e}`}function A_t(e){return function(t){return gt(t,{czm_pickColor:function(){return e._pickId.color}})}}function x_t(){return"czm_pickColor"}OC.prototype.makeStyleDirty=function(){this._styleDirty=!0};OC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var C_t=new ee;function KX(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function PC(e,t){return e._intervals.indexOf(t.start)}function T_t(e,t){let n=e._intervals,i=e._clock,r=KX(e);if(r===0)return;let o=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,o*r,C_t),a=n.indexOf(s),c=PC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function E_t(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function b_t(e,t,n){let i=KX(e),r=PC(e,t),o=PC(e,n);return i>=0?r>=o:r<=o}function CAe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function S_t(e,t,n){let i=PC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?B.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:yi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,ve.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new lF({arrayBuffer:u,cull:!0,fragmentShaderLoaded:y_t,uniformMapLoaded:A_t(e),pickIdLoaded:x_t})}).catch(CAe(e,c))}return o}function v_t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function w_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(TAe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(yi()-t.timestamp)/1e3;v_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var D_t=new B;function I_t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function P_t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var O_t=new jm;function TAe(e,t,n,i){let r=y(e.shading,O_t),o=t.pointCloud,s=y(t.transform,B.IDENTITY);o.modelMatrix=B.multiplyTransformation(e.modelMatrix,s,D_t),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=I_t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=P_t(e);try{o.update(i)}catch(a){CAe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function XX(e,t,n,i){let r=S_t(e,t,i);w_t(e,r,n,i)}function R_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function EAe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function M_t(e,t){let n=PC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function xAe(e,t,n,i,r){return l(n)?n.ready?!0:(XX(e,t,i,r),n.ready):!1}function B_t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=PC(e,n),d=PC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],xAe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],xAe(e,s,a,i,r))return s;return t}function L_t(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var VS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};OC.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&L_t(this,r,s),VS.timeSinceLoad=t,VS.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=E_t(this);if(!l(g))return;let h=!1,A=KX(this),x=A===0;A!==this._clockMultiplier&&(h=!0,this._clockMultiplier=A),(!l(d)||x)&&(d=g),(!l(p)||h||b_t(this,g,p))&&(p=T_t(this,g)),d=B_t(this,d,g,VS,e);let C=M_t(this,d);l(C)||(XX(this,d,VS,e),C=this._lastRenderedFrame),l(C)&&TAe(this,C,VS,e),l(p)&&XX(this,p,VS,e);let T=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return T._resolveReadyPromise(T),!0}),l(C)&&C!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let E=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;E>S&&EAe(this,R_t(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};OC.prototype.isDestroyed=function(){return!1};OC.prototype.destroy=function(){return EAe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var kS=OC;var s2=` -in vec2 v_textureCoordinates; +out vec3 v_positionMC; +out vec3 v_positionEC; +out vec2 v_st; void main() { - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); + vec4 p = czm_computePosition(); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); + v_positionMC = position3DHigh + position3DLow; // position in model coordinates + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function mH(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=ki.fromType(ki.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}mH.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:mn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new He({sources:[this._material.shaderSource,s2]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Se.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};mH.prototype.isDestroyed=function(){return!1};mH.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var JX=mH;function u0(e,t,n,i,r,o,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let A=0;A<a;A++){let x=i[A],C=Yt.getComponentCount(x),T=r[A];this.megatextures[A]=new PS(t,n,C,T,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let u=e._shape;this.rootNode=new KF(0,0,0,0,void 0,u,n),this._priorityQueue=new jx({maximumLength:c,comparator:Ki.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=o,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(o);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[o-1]=0,ZX(f,1,o-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Bt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new dn({minificationFilter:un.NEAREST,magnificationFilter:xi.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function ZX(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,ZX(e,t,r-1,i+1),ZX(e,r+1,n,i+1)}u0.simultaneousRequestCountMaximum=50;u0.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Bt({context:o,pixelFormat:at.RGBA,pixelDatatype:Ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new dn({minificationFilter:un.NEAREST,magnificationFilter:xi.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&bAe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=yi();U_t(this,e);let h=yi();k_t(this,d,c);let A=yi();if(this._debugPrint){let x=h-g,C=A-h,T=A-g;V_t(this,x,C,T)}};u0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function bAe(e,t){let n=e._primitive,i=n._shape,r=n._provider.dimensions;if(t.computeBoundingVolumes(i,r),l(t.children))for(let o=0;o<8;o++){let s=t.children[o];bAe(e,s)}}function N_t(e,t){if(e._simultaneousRequestCount>=u0.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function r(u){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!l(u))t.state=Ki.LoadState.UNAVAILABLE;else if(u===Ki.LoadState.FAILED)t.state=Ki.LoadState.FAILED;else if(!Array.isArray(u)||u.length!==f)t.state=Ki.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x:A,y:x,z:C}=g,T=A*x*C,E=u[p],S=T*h;if(E.length===S)t.metadatas[p]=E,t.state=Ki.LoadState.RECEIVED;else{t.state=Ki.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=Ki.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=Ki.LoadState.RECEIVING,c.then(r).catch(o)):t.state=Ki.LoadState.FAILED}function F_t(e){return e/(1+e)}function U_t(e,t){let n=e._frameNumber,i=e._primitive,r=i._shape,{dimensions:o}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,u=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:A}=d,C=p.drawingBufferHeight/g/A.sseDenominator;function T(b,v,I){let M=Math.min(Math.abs(v-b),Math.abs(v-I)),F=Math.max(b,u-I-1,1),k=Math.pow(1-M/F,4),V=Math.exp(-e._binaryTreeKeyframeWeighting[v]);return P.lerp(V,k,.15+.85*k)}function E(b,v){if(b.computeScreenSpaceError(h,C),v=b.visibility(t,v),v===Jo.MASK_OUTSIDE)return;b.visitedFrameNumber=n;let I=P.clamp(Math.floor(c),0,u-2),M=I+1;if(u===1)b.createKeyframeNode(0);else if(b.keyframeNodes.length!==u)for(let U=0;U<u;U++)b.createKeyframeNode(U);let F=F_t(b.screenSpaceError),k=!1,V=b.keyframeNodes;for(let U=0;U<V.length;U++){let q=V[U];q.priority=10*F+T(I,q.keyframe,M),q.state!==Ki.LoadState.UNAVAILABLE&&q.state!==Ki.LoadState.FAILED&&q.priority!==-Number.MAX_VALUE&&a.insert(q),q.state===Ki.LoadState.LOADED&&(k=!0)}if(b.screenSpaceError<s||!k){b.children=void 0;return}l(b.children)||b.constructChildNodes(r,o);for(let U=0;U<8;U++){let q=b.children[U];E(q,v)}}a.reset(),E(f,Jo.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,w=0,D;for(;a.length>0;)D=a.removeMaximum(),D.highPriorityFrameNumber=n,S[w]=D,w++;let R=e._keyframeNodesInMegatexture,O=e.megatextures[0],L=O.occupiedCount;R.length=L,R.sort(function(b,v){return b.highPriorityFrameNumber===v.highPriorityFrameNumber?v.priority-b.priority:v.highPriorityFrameNumber-b.highPriorityFrameNumber});let N=0,_=0;for(let b=0;b<w;b++)if(D=S[b],!(D.state===Ki.LoadState.LOADED||D.spatialNode===void 0)&&(D.state===Ki.LoadState.UNLOADED&&N_t(e,D),D.state===Ki.LoadState.RECEIVED)){let v=0;if(O.isFull()){v=L-1-N,N++;let I=R[v];I.spatialNode.destroyKeyframeNode(I,e.megatextures)}else v=L+_,_++;D.spatialNode.addKeyframeNodeToMegatextures(D,e.megatextures),R[v]=D}}function V_t(e,t,n,i){let r=e._keyframeCount,o=e.rootNode,s=Object.keys(Ki.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let T=new Array(r);a[C]=T;for(let E=0;E<r;E++)T[E]=0;c[C]=0}function f(C){let T=C.keyframeNodes;for(let E=0;E<T.length;E++){let S=T[E],w=S.keyframe,D=S.state;a[D][w]+=1,c[D]+=1,u++}if(l(C.children))for(let E=0;E<8;E++){let S=C.children[E];f(S)}}f(o);let d=`KEYFRAMES: ${a[Ki.LoadState.LOADED]}`,p=`UNLOADED: ${c[Ki.LoadState.UNLOADED]} | RECEIVING: ${c[Ki.LoadState.RECEIVING]} | RECEIVED: ${c[Ki.LoadState.RECEIVED]} | LOADED: ${c[Ki.LoadState.LOADED]} | FAILED: ${c[Ki.LoadState.FAILED]} | UNAVAILABLE: ${c[Ki.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,A=Math.round(i*100)/100,x=`LOAD: ${g} | OCT: ${h} | ALL: ${A}`;console.log(`${d} || ${p} || ${x}`)}var hH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function k_t(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,h,A,x,C){let T=!1;if(l(g.children))for(let E=0;E<8;E++){let S=g.children[E];S.computeSurroundingRenderableKeyframeNodes(r),S.isRenderable(o)&&(T=!0)}if(T){u[C]=hH.INTERNAL<<16|h,u[A]=x,a++,x=h,C=x*9+1;for(let E=0;E<8;E++){let S=g.children[E];h=a,A=h*9+0,d(S,h,A,x,C+E)}}else{if(s){let E=c*5,S=g.renderableKeyframeNodePrevious,w=g.level-S.spatialNode.level,D=S.spatialNode.parent,R=l(D)?D.renderableKeyframeNodePrevious:S,O=z_t(g,i,n),L=w,N=1,_=S.megatextureIndex,b=R.megatextureIndex;f[E+0]=O,f[E+1]=L,f[E+2]=N,f[E+3]=_,f[E+4]=b,u[C]=hH.LEAF<<16|c}else{let E=g.renderableKeyframeNodePrevious,w=g.level-E.spatialNode.level===0?hH.LEAF:hH.PACKED_LEAF_FROM_PARENT;u[C]=w<<16|E.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),H_t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&G_t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function z_t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function H_t(e,t,n,i){let r=at.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let h=0;h<r;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function G_t(e,t,n,i){let r=at.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],h=e[p*o+1],A=e[p*o+2],x=e[p*o+3],C=e[p*o+4],T=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=h&255,u[p*8+3]=A&255,u[p*8+4]=x>>>0&255,u[p*8+5]=x>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}u0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let r=0,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=i[s],u=Yt.getComponentCount(a);r+=PS.getApproximateTextureMemoryByteLength(e,t,u,c)}return r};var zS=u0;var W_t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},HS=Object.freeze(W_t);function GS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}GS.prototype.getTexture=function(e){return this._textures[e]};function j_t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}GS.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):j_t(this,e,t)};function Y_t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?pH(r,o,n):q_t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function pH(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?vAe(e,n):new Bt({context:n,source:t,sampler:r});return SAe(r)&&o.generateMipmap(),o}function q_t(e,t,n){let{typedArray:i,sampler:r}=e,o=SAe(r),s=r.wrapS===Dn.REPEAT||r.wrapS===Dn.MIRRORED_REPEAT||r.wrapT===Dn.REPEAT||r.wrapT===Dn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===Ze.UNSIGNED_BYTE){let d=iL(i,a,c),p=Ig(d);return pH({sampler:r},p,n)}}else{let d=Ig(t);return pH(e,d,n)}else return pH(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),vAe(e,n)}function SAe(e){return[un.NEAREST_MIPMAP_NEAREST,un.NEAREST_MIPMAP_LINEAR,un.LINEAR_MIPMAP_NEAREST,un.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function vAe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Bt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}GS.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];Y_t(this,r,t)}n.length=0};GS.prototype.isDestroyed=function(){return!1};GS.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var a2=GS;function c2(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,zp.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,zg.INHERIT),this._textureManager=new a2,this._defaultTexture=void 0,this.uniformMap=X_t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Z_t(this),Q_t(this)}function X_t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===HS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=K_t(e,i)):n[i]=J_t(e,i)}return n}function K_t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function J_t(e,t){return function(){return e.uniforms[t].value}}function RC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function Z_t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,RC(o,t,r),r=e.usedVariablesVertex.featureIdSet,RC(o,n,r),r=e.usedVariablesVertex.metadataSet,RC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,RC(s,t,r),r=e.usedVariablesFragment.featureIdSet,RC(s,n,r),r=e.usedVariablesFragment.metadataSet,RC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;RC(s,a,c)}}function wAe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function yc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${wAe(t)} is not available in the ${i} shader. Did you mean ${wAe(n)} instead?`;throw new fe(r)}}function Q_t(e){let t=e.usedVariablesVertex.attributeSet;yc(t,"position","positionMC","vertex"),yc(t,"normal","normalMC","vertex"),yc(t,"tangent","tangentMC","vertex"),yc(t,"bitangent","bitangentMC","vertex"),yc(t,"positionWC","positionMC","vertex"),yc(t,"positionEC","positionMC","vertex"),yc(t,"normalEC","normalMC","vertex"),yc(t,"tangentEC","tangentMC","vertex"),yc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;yc(n,"position","positionEC","fragment"),yc(n,"normal","normalEC","fragment"),yc(n,"tangent","tangentEC","fragment"),yc(n,"bitangent","bitangentEC","fragment"),yc(n,"normalMC","normalEC","fragment"),yc(n,"tangentMC","tangentEC","fragment"),yc(n,"bitangentMC","bitangentEC","fragment")}c2.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===HS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};c2.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};c2.prototype.isDestroyed=function(){return!1};c2.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var MC=c2;function Fh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Fh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._compoundModelMatrix=new B,this._compoundModelMatrixOld=new B,this._customShader=y(e.customShader,Fh.DefaultCustomShader),this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new B,this._transformPositionUvToWorld=new B,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Md,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new B,transformPositionUvToView:new B,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new B,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let r in t)if(t.hasOwnProperty(r)){let o=`u_${r}`;n[o]=function(){return t[r]}}let i=this._provider;this._completeLoad=function(r,o){},this._readyPromise=$_t(this,i)}async function $_t(e,t){let n=new Promise(function(a){e._completeLoad=function(c,u){u.afterRender.push(function(){return c._ready=!0,a(c),!0})}});l(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:r=Hi.getMinBounds(i),maxBounds:o=Hi.getMaxBounds(i)}=t;e.minBounds=r,e.maxBounds=o,e.minClippingBounds=Hi.getMinBounds(i),e.maxClippingBounds=Hi.getMaxBounds(i),IAe(e,t);let s=Hi.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=PAe(e,e._shape,t),n}Object.defineProperties(Fh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];l(e)?this._customShader=e:this._customShader=Fh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var egt=new m,tgt=new oe,ngt=new oe,igt=new m,rgt=new m,ogt=new Z,sgt=new Z,agt=new B,cgt=new B,lgt=new B,ugt=B.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new B),fgt=B.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new B);Fh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),l(t._ready)&&!t._ready||!l(this._shape))return;let n=e.context;if(!this._ready){dgt(this,t,n),this._completeLoad(this,e);return}let i=IAe(this,t),r=this._shape;if(i&&(this._shapeVisible=PAe(this,r,t),pgt(this,r)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let o=_gt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,o,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&bgt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),ggt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(NL(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=r.orientedBoundingBox,g=xgt(p,d,ngt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let A=n.uniformState.inverseView;f.transformPositionViewToUv=B.multiplyTransformation(this._transformPositionWorldToUv,A,f.transformPositionViewToUv);let x=n.uniformState.view;f.transformPositionUvToView=B.multiplyTransformation(x,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=B.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let E=e.passes.pick?this._drawCommandPick:this._drawCommand;E.boundingVolume=r.boundingSphere,e.commandList.push(E)};function dgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:r,shaderUniforms:o}=e._shape;e._shapeDefinesOld=Ye(r,!0);let s=e._uniformMap;for(let a in o)if(o.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return o[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=mgt(e,t,n),hgt(e._traversal,i)}function IAe(e,t){let n=y(t.shapeTransform,B.IDENTITY),i=y(t.globalTransform,B.IDENTITY);return B.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),B.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),l2(e,"_compoundModelMatrix","_compoundModelMatrixOld")+l2(e,"_minBounds","_minBoundsOld")+l2(e,"_maxBounds","_maxBoundsOld")+l2(e,"_minClippingBounds","_minClippingBoundsOld")+l2(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function l2(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}function PAe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let r=t.shapeTransform,o=B.inverse(r,agt),s=B.getRotation(r,ogt),a=B.getScale(r,igt),c=m.maximumComponent(a),u=m.divideByScalar(a,c,rgt),f=Z.multiplyByScale(s,u,sgt),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=B.multiplyTransformation(ugt,o,e._transformPositionWorldToUv),e._transformPositionUvToWorld=B.multiplyTransformation(r,fgt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=B.getMatrix3(o,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function mgt(e,t,n){let i=m.clone(t.dimensions,egt);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let r=t.maximumTileCount,o=l(r)?zS.getApproximateTextureMemoryByteLength(r,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new zS(e,n,i,t.types,t.componentTypes,s,o)}function hgt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],r=n.length;t.megatextureTextures=new Array(r);for(let o=0;o<r;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function pgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(r=>n[r]!==e._shapeDefinesOld[r]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function _gt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/o;return r+a}function ggt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=B.transpose(B.multiplyTransformation(B.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionUvToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}Fh.prototype.isDestroyed=function(){return!1};Fh.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var DAe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),ygt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Agt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function xgt(e,t,n){let i=B.fromRotationTranslation(e.halfAxes,e.center,cgt),r=B.multiply(t,i,lgt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Agt,d=DAe.length;for(u=0;u<d;u++)B.multiplyByVector(r,DAe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=ygt[u*3+g],A=f[h];if(A.z>=-A.w){let x=p.z+p.w,C=A.z+A.w,T=x/(x-C),E=oe.lerp(p,A,T,tgt),S=E.x/E.w,w=E.y/E.w;o=Math.min(o,S),s=Math.max(s,S),a=Math.min(a,w),c=Math.max(c,w)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(o,a,s,c,n),n}var QX=3e7,Cgt=new m(QX,0,0),Tgt=new m(0,QX,0),Egt=new m(0,0,QX);function bgt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:ki.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(m.ZERO,Cgt,z.RED,a),r(m.ZERO,Tgt,z.LIME,a),r(m.ZERO,Egt,z.BLUE,a),i.update(t)}Fh.DefaultCustomShader=new MC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function IC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,$2),this._fragmentShaderSource=y(e.fragmentShaderSource,Z2),this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(IC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return IC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});IC.VERTEX_FORMAT=Me.POSITION_AND_ST;IC.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;IC.prototype.isTranslucent=no.prototype.isTranslucent;IC.prototype.getRenderState=no.prototype.getRenderState;var PX=IC;function zl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,zl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,zl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,zl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,zl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,zl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new pe,this._nominalFrameRate=new pe,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){Cpt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){Tpt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}zl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};zl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new zl({scene:e})),e._frameRateMonitor};Object.defineProperties(zl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});zl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};zl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};zl.prototype.isDestroyed=function(){return!1};zl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function Cpt(e,t){if(e._pauseCount>0)return;let n=yi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Zn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function Tpt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var Q2=zl;function Apt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = ${n}.rgb; + float clippingPlanesEdgeWidth = ${n}.a; + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) + { + out_FragColor = clippingPlanesEdgeColor; + } +`}var eB=Apt;var Cxe=Io(Hj(),1);function OX(){this._image=new Image}OX.prototype.isReady=function(){return!0};OX.prototype.shouldDiscardImage=function(e){return e===this._image};function DC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new OX),this._errorEvent=new pe,this._ready=!1;let n=this,i,o;if(l(e.url)){Q("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let r=Se.createIfNeeded(e.url);o=new um(r)}l(e.metadata)&&(Q("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),o=e.metadata),this._metadata=o,l(o)&&(this._readyPromise=o.readyPromise.then(function(r){if(!o.imageryPresent){let s=new de(`The server ${o.url} doesn't have imagery`);return i=xi.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return xi.reportSuccess(i),n._ready=r,r}).catch(function(r){return i=xi.reportError(i,n,n._errorEvent,r.message,void 0,void 0,void 0,r),Promise.reject(r)}))}Object.defineProperties(DC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});DC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new DC(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};DC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};DC.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=um.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new jo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=Ept(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){XL(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=Spt(f)),!l(d)&&(!l(p)||p)){let g=vpt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?o:Cx({uint8Array:f,format:d,flipY:!0})})};DC.prototype.pickFeatures=function(e,t,n,i,o){};function Ept(e,t,n,i,o,r){let s=um.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function Spt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function vpt(e){let t=Cxe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var RX=DC;var wpt=new z(1,1,1,.4),Ipt=new z(0,1,0,.05),Dpt=new z(0,.5,0,.2);function PC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Hi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,wpt),this._glowColor=y(e.glowColor,Ipt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,Dpt),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(PC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});PC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};PC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};PC.prototype.getTileCredits=function(e,t,n){};PC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};PC.prototype.pickFeatures=function(e,t,n,i,o){};var MX=PC;function LX(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(LX.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});LX.prototype.load=async function(){return this._data=await OC.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var tB=LX;function BS(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(BS.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Ppt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}BS.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let o=e._parseHeader(n),r=Ppt(e._storageInfo.attributeValues.valueType);r>0&&(o=Math.ceil(o/r)*r),e._parseBody(n,o)}})};BS.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};BS.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};BS.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=this._storageInfo[i];if(l(o)){this._values[i]=[];for(let r=0;r<this._header.count;++r)if(o.valueType!=="String"){let s=this._parseValue(e,o.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[r],a="";for(let c=0;c<s;++c){let u=this._parseValue(e,o.valueType,t);u.value.charCodeAt(0)!==0&&(a+=u.value),t=u.offset}this._values[i].push(a)}}}};var nB=BS;function iB(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(iB.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});iB.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Opt=new m,Rpt=new m,Mpt=new m,Lpt=new m,Npt=new m;function NX(e,t,n,i){let o=m.subtract(i,n,Opt),r=m.cross(o,m.subtract(e,n,Rpt),Lpt),s=m.cross(o,m.subtract(t,n,Mpt),Npt);return m.dot(r,s)>=0}var Fpt=new m,Bpt=new m,kpt=new m,Upt=new m,Vpt=new m,zpt=new m,Hpt=new m,Gpt=new m,Wpt=new m,jpt=new m;iB.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,h,x;l(f)?(g=f[p],h=f[p+1],x=f[p+2]):(g=p*3,h=p*3+1,x=p*3+2);let b=m.fromElements(u[g*3],u[g*3+1],u[g*3+2],Fpt),C=m.fromElements(u[h*3],u[h*3+1],u[h*3+2],Bpt),T=new m(u[x*3],u[x*3+1],u[x*3+2],kpt);if(!NX(i,b,C,T)||!NX(i,C,b,T)||!NX(i,T,b,C))continue;let A=m.subtract(C,b,Upt),S=m.subtract(T,b,Vpt),v=m.cross(A,S,zpt);if(m.magnitude(v)===0)continue;let I=m.normalize(v,Hpt),O=m.subtract(i,b,Gpt),R=Math.abs(m.dot(O,I));if(R<o){o=R,r=p;let N=m.magnitudeSquared(m.subtract(i,b,O)),F=m.magnitudeSquared(m.subtract(i,C,Wpt)),_=m.magnitudeSquared(m.subtract(i,T,jpt));N<F&&N<_?(a=g,c=b,s=N):F<_?(a=h,c=C,s=F):(a=x,c=T,s=_)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};iB.prototype._generateGltf=function(e,t,n,i,o,r){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,u="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let x=this._parent._data.mesh.material.definition;if(x>=0&&x<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[x],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let b="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let T=this._layer._data.textureSetDefinitions[C];for(let A=0;A<T.formats.length;A++){let S=T.formats[A];if(S.format==="jpg"){b=S.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(u=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${b}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,u=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:u}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var kS=iB;function Hl(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(Hl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Hl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new yf(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await OC.loadJson(this._resource,this._dataProvider._traceFetches);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};Hl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(o,r){let s=new nB(t,o[r]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let o=0;o<e.length;o++)i.push(n(e,o));return Promise.all(i)};Hl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Hl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Hl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Hl(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Hl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new kS(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new kS(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Hl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new tB(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Hl.prototype._clearGeometryData=function(){this._geometryData=[]};Hl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=me.fromDegrees(e.center[0],e.center[1],e.center[2]):n=me.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let T=this._dataProvider._geoidDataList[C],A=T.projection.project(n);if(A.x>T.nativeExtent.west&&A.x<T.nativeExtent.east&&A.y>T.nativeExtent.south&&A.y<T.nativeExtent.north){n.height+=Ypt(A.x,A.y,T);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=oe.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=oe.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new za(0,0,0),u=Mt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Be(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new L(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=L.inverse(p,new L),h=L.clone(p);l(this._parent._globalTransform)&&L.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Hl.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,o=0,r=0,s=0;l(n.obb)?(o=n.obb.center[0],r=n.obb.center[1],s=n.obb.center[2]):l(n.mbs)&&(o=n.mbs[0],r=n.mbs[1],s=n.mbs[2]);let a=Z.fromRotationX(-P.PI_OVER_TWO),c=new Z;Z.multiply(a,i,c);let u=me.fromDegrees(o,r,s),f=oe.WGS84.cartographicToCartesian(u),d={binaryData:t.geometryData._data,featureData:l(t.featureData)&&l(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:oe.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:u,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};Hl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let o=Promise.resolve();if(l(i._geometryData)&&i._geometryData.length>0){let r={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,r);if(!l(s))return;o=s.then(function(a){e=r.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return o.then(function(){let r=i._dataProvider._binarizeGltf(e),s=new Blob([r],{type:"application/binary"});return URL.createObjectURL(s)})})};yf.prototype._hookedRequestContent=yf.prototype.requestContent;yf.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new Se({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function qpt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function _H(e,t,n,i){let o=e+t*n;return i[o]}function Ypt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=_H(s,a,n.width,n.buffer),d=_H(c,a,n.width,n.buffer),p=_H(s,u,n.width,n.buffer),g=_H(c,u,n.width,n.buffer),h=qpt(o,r,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(yf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var US=Hl;function qf(e,t,n){this._dataProvider=e,l(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Se({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(qf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});qf.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};qf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};qf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}return 0};qf.prototype._loadRootNode=function(){if(l(this._data.nodePages)){let e=0;l(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new US(this,e,!0)}else this._rootNode=new US(this,this._data.store.rootNode,!0);return this._rootNode.load()};qf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};qf._fetchJson=function(e){return e.fetchJson()};qf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=qf._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};qf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};qf.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(l(this._dataProvider._cesium3dTilesetOptions))for(let o in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(o)&&(i[o]=this._dataProvider._cesium3dTilesetOptions[o]);this._tileset=await Os.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};var u0=qf;var Axe=Io(Txe(),1);function es(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,l(e.url)&&(Q("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=Se.createIfNeeded(e.url),this._load())}Object.defineProperties(es.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return Q("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});es.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};es.prototype.isDestroyed=function(){return!1};es.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};es.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};es.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};es.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};es.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i=await es.loadJson(n),o=new es(t);if(o._resource=n,o._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new u0(o,i.layers[s],s);o._layers.push(a)}else{let s=new u0(o,i,i.id);o._layers.push(s)}o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load());return await Promise.all(r),o._ready=!0,o._readyPromise=Promise.resolve(o),o};es.prototype._load=function(){let e=this;return this._readyPromise=es.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,l(t.layers))for(let i=0;i<t.layers.length;i++){let o=new u0(e,t.layers[i],i);e._layers.push(o)}else{let i=new u0(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};es._fetchJson=function(e){return e.fetchJson()};es.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await es._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};es.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};es.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]="g".charCodeAt(),o.magic[1]="l".charCodeAt(),o.magic[2]="T".charCodeAt(),o.magic[3]="F".charCodeAt(),o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};es.prototype.getDecoderTaskProcessor=function(){if(l(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!l(this._decoderTaskProcessor)){let e=new gi("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function Xpt(e,t){return Jpt(e,t)}var Kpt=new H;function Jpt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=me.fromRadians(t.west,t.north),a=me.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=H.fromElements(d,p,Kpt),h=g.toString();if(!o.hasOwnProperty(h)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[h]=x,i.push(x)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=d[g],b="Geographic";n._projection instanceof Ii&&(b="WebMercator");let C={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===Mf.LERC){let T=Axe.default.decode(x._buffer);C.buffer=T.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function Zpt(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await Xpt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}es.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Zpt(this),this._geoidDataPromise)};es.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var OC=es;var Exe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function yH(e,t){this.spatialNode=e,this.keyframe=t,this.state=Exe.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}yH.priorityComparator=function(e,t){return e.priority-t.priority};yH.searchComparator=function(e,t){return e.keyframe-t.keyframe};yH.LoadState=Exe;var $i=yH;function Sxe(){}Object.defineProperties(Sxe.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var FX=Sxe;var $pt=/\/$/,vxe=new wt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function VS(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();$pt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new wt(c))):c=vxe,this._resource=i,this._imageryProvider=new Us({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(VS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});VS.prototype.getTileCredits=function(e,t,n){};VS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};VS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};VS._defaultCredit=vxe;var BX=VS;function f0(e,t,n,i,o){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let r=e.floatingPointTexture;if(i===rn.FLOAT32&&!r)throw new de("Floating point texture not supported");let s;i===rn.FLOAT32||i===rn.FLOAT64?s=Je.FLOAT:i===rn.UINT8&&(s=Je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?ct.RED:ct.LUMINANCE:n===2?a=e.webgl2?ct.RG:ct.LUMINANCE_ALPHA:n===3?a=ct.RGB:n===4&&(a=ct.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Gt.maximumTextureSize,d=rn.getSizeInBytes(i),p=Math.floor(o/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/h),b=h*t.x,C=x*t.y,T=Math.floor(g/b),A=Math.floor(g/C);if(T===0||A===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=T*A,this.regionCountPerMegatexture=new H(T,A),this.voxelCountPerRegion=new H(b,C),this.sliceCountPerRegion=new H(h,x),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(b/g,C/g),this.texture=new Lt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new hn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Ci.LINEAR})});let S=rn.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,b*C*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new Qpt(v);for(let v=0;v<this.maximumTileCount;v++){let I=this.nodes[v];I.previousNode=v>0?this.nodes[v-1]:void 0,I.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Qpt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}f0.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};f0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};f0.prototype.isFull=function(){return this.emptyList===void 0};f0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let o=rn.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};f0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let T=0;T<i.y;T++)for(let A=0;A<i.x;A++){let S=x*i.y*i.x+T*i.x+A,v=(C+T)*r.x+(b+A);for(let I=0;I<s;I++)a[v*s+I]=n[S*s+I]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,d=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,h={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var zS=f0;function kX(e){}kX.prototype.isReady=function(){return!0};kX.prototype.shouldDiscardImage=function(e){return!1};var UX=kX;var e_t=new wt("MapQuest, Open Street Map and contributors, CC-BY-SA");function xH(e){e=y(e,y.EMPTY_OBJECT);let t=Se.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new Lr({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,e_t);typeof d=="string"&&(d=new wt(d)),Us.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(xH.prototype=Object.create(Us.prototype),xH.prototype.constructor=xH);var RC=xH;var t_t=new H(1,1);function VX(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,t_t)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(VX.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var wxe=new m;VX.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,wxe),m.add(this.position,wxe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var HS=VX;function Ixe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(Ixe.prototype,{complete:{get:function(){return this._complete}}});var zX=Ixe;function Dxe(e){}Dxe.prototype.emit=function(e){fe.throwInstantiationError()};var HX=Dxe;var Pxe=new H(1,1);function oB(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new Y2(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._emitterModelMatrix=L.clone(y(e.emitterModelMatrix,L.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new L,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,Pxe))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,Pxe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(oB.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!L.equals(this._modelMatrix,e),L.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!L.equals(this._emitterModelMatrix,e),L.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function n_t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new HS;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function i_t(e){let t=e._particlePool.pop();return l(t)||(t=new HS),t}function o_t(e,t){e._particlePool.push(t)}function r_t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function s_t(e){l(e._billboard)&&(e._billboard.show=!1)}function Oxe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function a_t(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function c_t(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var bH=new m;oB.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new nu),this._updateParticlePool&&(n_t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?Oxe(this,s):(s_t(s),o_t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=c_t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=L.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=i_t(this),this._emitter.emit(s),m.add(s.position,s.velocity,bH),L.multiplyByPoint(u,bH,bH),s.position=L.multiplyByPoint(u,s.position,s.position),m.subtract(bH,s.position,s.velocity),m.normalize(s.velocity,s.velocity),a_t(this,s),Oxe(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&r_t(this)};oB.prototype.isDestroyed=function(){return!1};oB.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var GX=oB;var Lxe=Io(p3(),1);var l_t={modifyFragmentShader:function(t){return t=Ge.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +void main() +{ +#ifndef SHADOW_MAP + if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},GS=l_t;var MC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function rB(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=MC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ae.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=L.clone(L.IDENTITY),this._modelMatrix=L.clone(L.IDENTITY),this.time=0,this.shadows=bn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Nc.NONE),this._splittingEnabled=!1,this._error=void 0,u_t(this,e)}Object.defineProperties(rB.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function u_t(e,t){let n=Hx.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=yp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=MC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=z.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var f_t=new m,d_t=new m,m_t=new m,Rxe,CH;function h_t(e){if(!l(CH)){Rxe=new Lxe.default(0),CH=new Array(e);for(let t=0;t<e;++t)CH[t]=Rxe.random()}return CH}function p_t(e){let n=e.length/3,i=Math.min(n,20),o=h_t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,f_t),c=m.fromElements(s,s,s,d_t);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=m.unpack(e,d*3,m_t);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function Mxe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Nt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var __t=new re,g_t=new re,y_t=new z,Nxe=0,TH=1,XX=2,Fxe=3,x_t=4,WX=new L,b_t=new L;function C_t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,C=e._isRGB565,T=e._isTranslucent,A=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,I,O,R=[],N={};if(e._styleableShaderAttributes=N,f){let U=x_t;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],Y=Mxe(k.typedArray,G);I=k.componentCount,O=X.fromTypedArray(Y);let j=ht.createVertexBuffer({context:n,typedArray:Y,usage:ke.STATIC_DRAW});e._geometryByteLength+=j.sizeInBytes;let $={index:U,vertexBuffer:j,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push($),N[G]={location:U,componentCount:I},++U}}let F=ht.createVertexBuffer({context:n,typedArray:r.typedArray,usage:ke.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let _;A&&(_=ht.createVertexBuffer({context:n,typedArray:s.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let E;S&&(E=ht.createVertexBuffer({context:n,typedArray:a.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let w;v&&(c.typedArray=Mxe(c.typedArray,"batchIds"),w=ht.createVertexBuffer({context:n,typedArray:c.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D=[];if(d?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,D.push({index:Nxe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=p_t(r.typedArray)),A)if(C)D.push({index:TH,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=T?4:3;D.push({index:TH,vertexBuffer:_,componentsPerAttribute:U,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(I=2,O=X.UNSIGNED_BYTE):h?(I=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(I=3,O=X.FLOAT),D.push({index:XX,vertexBuffer:E,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:Fxe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(D=D.concat(R));let M=new ri({context:n,attributes:D}),B={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:mn.ALPHA_BLEND};e._opaquePass===Ae.CESIUM_3D_TILE&&(B.stencilTest=Bt.setCesium3DTileBit(),B.stencilMask=Bt.CESIUM_3D_TILE_MASK,V.stencilTest=Bt.setCesium3DTileBit(),V.stencilMask=Bt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(V),e._drawCommand=new nt({boundingVolume:new ae,cull:e._cull,modelMatrix:new L,primitiveType:Fe.POINTS,vertexArray:M,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Ae.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function T_t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=__t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,y_t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return L.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);L.multiply(n.uniformState.view3D,c,WX);let u=L.multiply(WX,a.modelMatrix,WX);return L.inverseTranspose(u,b_t)}};GS.addUniforms(e,s),(i||o||r)&&(s=_t(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=g_t;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function jX(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function qX(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function YX(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var A_t={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function E_t(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,C=e._backFaceCulling,T=e._normalShading,A=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,I,O,R,N=g,F=Ye(A_t),_={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],F[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let se={translucent:!1},_e="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${_e}`,F,se),O=n.getShowShaderFunction(`getShowFromStyle${_e}`,F,se),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,F,se),l(I)&&se.translucent&&(N=!0)}e._styleTranslucent=N;let w=l(I),D=l(O),M=l(R),B=e.isClipped,V=[],U=[];w&&(jX(I,V),qX(I,U)),D&&(jX(O,V),qX(O,U)),M&&(jX(R,V),qX(R,U));let G=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let se=V.indexOf(r.location)>=0,_e=YX(A,r.location);_e.enabled=se}let Y=h&&(!w||G);if(h){let se=YX(A,TH);se.enabled=Y}let j=x&&(T||C||k);if(x){let se=YX(A,XX);se.enabled=j}let $={a_position:Nxe};Y&&($.a_color=TH),j&&($.a_normal=XX),b&&($.a_batchId=Fxe);let W="",K=V.length;for(i=0;i<K;++i){let se=V[i];r=_[se];let _e=r.componentCount,xe=`czm_3dtiles_property_${se}`,Pe;_e===1?Pe="float":Pe=`vec${_e}`,W+=`in ${Pe} ${xe}; +`,$[xe]=r.location}T_t(e,t);let J=`in vec3 a_position; +out vec4 v_color; +uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; +uniform vec4 u_constantColor; +uniform vec4 u_highlightColor; +`;J+=`float u_pointSize; +float tiles3d_tileset_time; +`,v&&(J+=`float u_geometricError; +float u_depthMultiplier; +`),J+=W,Y&&(g?J+=`in vec4 a_color; +`:p?J+=`in float a_color; +const float SHIFT_RIGHT_11 = 1.0 / 2048.0; +const float SHIFT_RIGHT_5 = 1.0 / 32.0; +const float SHIFT_LEFT_11 = 2048.0; +const float SHIFT_LEFT_5 = 32.0; +const float NORMALIZE_6 = 1.0 / 64.0; +const float NORMALIZE_5 = 1.0 / 32.0; +`:J+=`in vec3 a_color; +`),j&&(f||d?J+=`in vec2 a_normal; +`:J+=`in vec3 a_normal; +`),b&&(J+=`in float a_batchId; +`),(c||u||d)&&(J+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),w&&(J+=I),D&&(J+=O),M&&(J+=R),J+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,v&&(J+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),Y?g?J+=` vec4 color = a_color; +`:p?J+=` float compressed = a_color; + float r = floor(compressed * SHIFT_RIGHT_11); + compressed -= r * SHIFT_LEFT_11; + float g = floor(compressed * SHIFT_RIGHT_5); + compressed -= g * SHIFT_LEFT_5; + float b = compressed; + vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); + vec4 color = vec4(rgb, 1.0); +`:J+=` vec4 color = vec4(a_color, 1.0); +`:J+=` vec4 color = u_constantColor; +`,c||u?J+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; +`:J+=` vec3 position = a_position; +`,J+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); +`,j?(f?J+=` vec3 normal = czm_octDecode(a_normal); +`:d?J+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; +`:J+=` vec3 normal = a_normal; +`,J+=` vec3 normalEC = czm_normal * normal; +`):J+=` vec3 normal = vec3(1.0); +`,w&&(J+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),D&&(J+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),M?J+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:v?J+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); + float depth = -positionEC.z; + gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); +`:J+=` gl_PointSize = u_pointSize; +`,J+=` color = color * u_highlightColor; +`,j&&T&&(J+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); + diffuseStrength = max(diffuseStrength, 0.4); + color.xyz *= diffuseStrength * czm_lightColor; +`),J+=` v_color = color; + gl_Position = czm_modelViewProjection * vec4(position, 1.0); +`,j&&C&&(J+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),D&&(J+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),J+=`} +`;let he=`in vec4 v_color; +`;B&&(he+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,he+=` +`,he+=M_(S,s),he+=` +`),he+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,B&&(he+=eB("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),he+=`} +`,e.splitDirection!==Nc.NONE&&(he=GS.modifyFragmentShader(he)),l(e._vertexShaderLoaded)&&(J=e._vertexShaderLoaded(J)),l(e._fragmentShaderLoaded)&&(he=e._fragmentShaderLoaded(he));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=Zt.fromCache({context:s,vertexShaderSource:J,fragmentShaderSource:he,attributeLocations:$});try{ge.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function S_t(e,t){if(e._decodingState===MC.READY)return!1;if(e._decodingState===MC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=vp.decodePointCloud(i,t);l(o)&&(e._decodingState=MC.DECODING,o.then(function(r){e._decodingState=MC.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let b=r.POSITION.data.quantization,C=b.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let b in h)if(h.hasOwnProperty(b)){let C=r[b];l(g)||(g={}),g[b]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=MC.FAILED,e._error=r}))}return!0}var v_t=new re,w_t=new m;rB.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(S_t(this,t))return;let i=!1,o=!L.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(C_t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){L.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(L.clone(this._modelMatrix,u),l(this._rtcCenter)&&L.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&L.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=L.getColumn(u,3,v_t);re.equals(p,re.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;L.multiplyByPoint(u,d,d);let p=L.getScale(u,w_t);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Nc.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&E_t(this,e,this._style),this._drawCommand.castShadows=bn.castShadows(this.shadows),this._drawCommand.receiveShadows=bn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ae.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};rB.prototype.isDestroyed=function(){return!1};rB.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var sB=rB;function zu(){fe.throwInstantiationError()}zu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(zu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});zu.prototype.update=fe.throwInstantiationError;zu.prototype.beginUpdate=fe.throwInstantiationError;zu.prototype.endUpdate=fe.throwInstantiationError;zu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;zu.prototype.loadTile=fe.throwInstantiationError;zu.prototype.computeTileVisibility=fe.throwInstantiationError;zu.prototype.showTileThisFrame=fe.throwInstantiationError;zu.prototype.computeDistanceToTile=fe.throwInstantiationError;zu.prototype.isDestroyed=fe.throwInstantiationError;zu.prototype.destroy=fe.throwInstantiationError;var KX=zu;function Yf(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Ln,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r,s)}var I_t=new m;Yf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=Z.getScale(this.orientedBoundingBox.halfAxes,I_t),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};Yf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:o,z:r}=this,s=i*2,a=o*2,c=r*2,u=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,u,c],[p,f,u,c],[p,s,a,d],[p,f,a,d],[p,s,u,d],[p,f,u,d]];this.children=g.map(([h,x,b,C])=>new Yf(h,x,b,C,this,e,t))};Yf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Yf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var Bxe={keyframe:0};function aB(e,t){return Bxe.keyframe=e,Do(t,Bxe,$i.searchComparator)}Yf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=D_t(i,d),g=d[p],h=o===i||i<g.keyframe?p:Math.min(p+1,d.length-1),x=d[h],b=i-g.keyframe,C=kxe(n-t.level,b);C<a&&(a=C,r=g);let T=x.keyframe-o,A=kxe(n-t.level,T);if(A<c&&(c=A,s=x),b===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function D_t(e,t){let n=aB(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function kxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Yf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Yf.prototype.createKeyframeNode=function(e){let t=aB(e,this.keyframeNodes);if(t<0){t=~t;let n=new $i(this,e);this.keyframeNodes.splice(t,0,n)}};Yf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=aB(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=aB(n,this.renderableKeyframeNodes);if(o<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=$i.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Yf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==$i.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadatas[o]),e.metadatas[o]=void 0}e.state=$i.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=aB(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};Yf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var cB=Yf;function JX(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(JX.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});JX.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var ZX=JX;function lB(){}lB.prototype.evaluate=function(e,t){fe.throwInstantiationError()};lB.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};lB.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};lB.prototype.getVariables=function(){fe.throwInstantiationError()};var $X=lB;function AH(e){this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,O_t(this,e)}Object.defineProperties(AH.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});AH.fromWorldTerrain=function(e){return new AH(Wb(e))};function P_t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function O_t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){P_t(e._errorEvent,i)}}var uB=AH;function WS(){}WS.prototype.boundingVolume=void 0;WS.prototype.boundingSphere=void 0;WS.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};WS.prototype.intersectPlane=function(e){fe.throwInstantiationError()};WS.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var QX=WS;function fB(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Hi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(fB.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});fB.prototype.getTileCredits=function(e,t,n){};fB.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};fB.prototype.pickFeatures=function(e,t,n,i,o){};var dB=fB;function eK(e){fe.throwInstantiationError()}eK.prototype.isReady=fe.throwInstantiationError;eK.prototype.shouldDiscardImage=fe.throwInstantiationError;var tK=eK;var R_t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},nK=Object.freeze(R_t);function NC(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.shadows=y(e.shadows,bn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new jm(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Op,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(NC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return Q("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function M_t(e){return`uniform vec4 czm_pickColor; +${e}`}function L_t(e){return function(t){return _t(t,{czm_pickColor:function(){return e._pickId.color}})}}function N_t(){return"czm_pickColor"}NC.prototype.makeStyleDirty=function(){this._styleDirty=!0};NC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var F_t=new ee;function oK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function LC(e,t){return e._intervals.indexOf(t.start)}function B_t(e,t){let n=e._intervals,i=e._clock,o=oK(e);if(o===0)return;let r=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,r*o,F_t),a=n.indexOf(s),c=LC(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function k_t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function U_t(e,t,n){let i=oK(e),o=LC(e,t),r=LC(e,n);return i>=0?o>=r:o<=r}function Vxe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function V_t(e,t,n){let i=LC(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?L.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:yi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Se.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new sB({arrayBuffer:u,cull:!0,fragmentShaderLoaded:M_t,uniformMapLoaded:L_t(e),pickIdLoaded:N_t})}).catch(Vxe(e,c))}return r}function z_t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function H_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(zxe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(yi()-t.timestamp)/1e3;z_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var G_t=new L;function W_t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function j_t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var q_t=new jm;function zxe(e,t,n,i){let o=y(e.shading,q_t),r=t.pointCloud,s=y(t.transform,L.IDENTITY);r.modelMatrix=L.multiplyTransformation(e.modelMatrix,s,G_t),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=W_t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=j_t(e);try{r.update(i)}catch(a){Vxe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function iK(e,t,n,i){let o=V_t(e,t,i);H_t(e,o,n,i)}function Y_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Hxe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function X_t(e,t){let n=LC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function Uxe(e,t,n,i,o){return l(n)?n.ready?!0:(iK(e,t,i,o),n.ready):!1}function K_t(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=LC(e,n),d=LC(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],Uxe(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],Uxe(e,s,a,i,o))return s;return t}function J_t(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var jS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};NC.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&J_t(this,o,s),jS.timeSinceLoad=t,jS.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=k_t(this);if(!l(g))return;let h=!1,x=oK(this),b=x===0;x!==this._clockMultiplier&&(h=!0,this._clockMultiplier=x),(!l(d)||b)&&(d=g),(!l(p)||h||U_t(this,g,p))&&(p=B_t(this,g)),d=K_t(this,d,g,jS,e);let C=X_t(this,d);l(C)||(iK(this,d,jS,e),C=this._lastRenderedFrame),l(C)&&zxe(this,C,jS,e),l(p)&&iK(this,p,jS,e);let T=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return T._resolveReadyPromise(T),!0}),l(C)&&C!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let A=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;A>S&&Hxe(this,Y_t(e));let I=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,f,a,this.boundingSphere)};NC.prototype.isDestroyed=function(){return!1};NC.prototype.destroy=function(){return Hxe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var qS=NC;function EH(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=zi.fromType(zi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}EH.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:mn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Ge({sources:[this._material.shaderSource,zN]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ae.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};EH.prototype.isDestroyed=function(){return!1};EH.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var rK=EH;function d0(e,t,n,i,o,r,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let x=0;x<a;x++){let b=i[x],C=qt.getComponentCount(b),T=o[x];this.megatextures[x]=new zS(t,n,C,T,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let u=e._shape;this.rootNode=new cB(0,0,0,0,void 0,u,n),this._priorityQueue=new jb({maximumLength:c,comparator:$i.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[r-1]=0,sK(f,1,r-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new hn({minificationFilter:un.NEAREST,magnificationFilter:Ci.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function sK(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,sK(e,t,o-1,i+1),sK(e,o+1,n,i+1)}d0.simultaneousRequestCountMaximum=50;d0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),A=Math.ceil(s/T);this.leafNodeTexture=new Lt({context:r,pixelFormat:ct.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new hn({minificationFilter:un.NEAREST,magnificationFilter:Ci.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&Gxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=yi();Q_t(this,e);let h=yi();tgt(this,d,c);let x=yi();if(this._debugPrint){let b=h-g,C=x-h,T=x-g;egt(this,b,C,T)}};d0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function Gxe(e,t){let n=e._primitive,i=n._shape,o=n._provider.dimensions;if(t.computeBoundingVolumes(i,o),l(t.children))for(let r=0;r<8;r++){let s=t.children[r];Gxe(e,s)}}function Z_t(e,t){if(e._simultaneousRequestCount>=d0.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function o(u){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!l(u))t.state=$i.LoadState.UNAVAILABLE;else if(u===$i.LoadState.FAILED)t.state=$i.LoadState.FAILED;else if(!Array.isArray(u)||u.length!==f)t.state=$i.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x,y:b,z:C}=g,T=x*b*C,A=u[p],S=T*h;if(A.length===S)t.metadatas[p]=A,t.state=$i.LoadState.RECEIVED;else{t.state=$i.LoadState.FAILED;break}}}}function r(){e._simultaneousRequestCount--,t.state=$i.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=$i.LoadState.RECEIVING,c.then(o).catch(r)):t.state=$i.LoadState.FAILED}function $_t(e){return e/(1+e)}function Q_t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,{dimensions:r}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,u=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:x}=d,C=p.drawingBufferHeight/g/x.sseDenominator;function T(E,w,D){let M=Math.min(Math.abs(w-E),Math.abs(w-D)),B=Math.max(E,u-D-1,1),V=Math.pow(1-M/B,4),U=Math.exp(-e._binaryTreeKeyframeWeighting[w]);return P.lerp(U,V,.15+.85*V)}function A(E,w){if(E.computeScreenSpaceError(h,C),w=E.visibility(t,w),w===Zr.MASK_OUTSIDE)return;E.visitedFrameNumber=n;let D=P.clamp(Math.floor(c),0,u-2),M=D+1;if(u===1)E.createKeyframeNode(0);else if(E.keyframeNodes.length!==u)for(let k=0;k<u;k++)E.createKeyframeNode(k);let B=$_t(E.screenSpaceError),V=!1,U=E.keyframeNodes;for(let k=0;k<U.length;k++){let Y=U[k];Y.priority=10*B+T(D,Y.keyframe,M),Y.state!==$i.LoadState.UNAVAILABLE&&Y.state!==$i.LoadState.FAILED&&Y.priority!==-Number.MAX_VALUE&&a.insert(Y),Y.state===$i.LoadState.LOADED&&(V=!0)}if(E.screenSpaceError<s||!V){E.children=void 0;return}l(E.children)||E.constructChildNodes(o,r);for(let k=0;k<8;k++){let Y=E.children[k];A(Y,w)}}a.reset(),A(f,Zr.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,v=0,I;for(;a.length>0;)I=a.removeMaximum(),I.highPriorityFrameNumber=n,S[v]=I,v++;let O=e._keyframeNodesInMegatexture,R=e.megatextures[0],N=R.occupiedCount;O.length=N,O.sort(function(E,w){return E.highPriorityFrameNumber===w.highPriorityFrameNumber?w.priority-E.priority:w.highPriorityFrameNumber-E.highPriorityFrameNumber});let F=0,_=0;for(let E=0;E<v;E++)if(I=S[E],!(I.state===$i.LoadState.LOADED||I.spatialNode===void 0)&&(I.state===$i.LoadState.UNLOADED&&Z_t(e,I),I.state===$i.LoadState.RECEIVED)){let w=0;if(R.isFull()){w=N-1-F,F++;let D=O[w];D.spatialNode.destroyKeyframeNode(D,e.megatextures)}else w=N+_,_++;I.spatialNode.addKeyframeNodeToMegatextures(I,e.megatextures),O[w]=I}}function egt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys($i.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let T=new Array(o);a[C]=T;for(let A=0;A<o;A++)T[A]=0;c[C]=0}function f(C){let T=C.keyframeNodes;for(let A=0;A<T.length;A++){let S=T[A],v=S.keyframe,I=S.state;a[I][v]+=1,c[I]+=1,u++}if(l(C.children))for(let A=0;A<8;A++){let S=C.children[A];f(S)}}f(r);let d=`KEYFRAMES: ${a[$i.LoadState.LOADED]}`,p=`UNLOADED: ${c[$i.LoadState.UNLOADED]} | RECEIVING: ${c[$i.LoadState.RECEIVING]} | RECEIVED: ${c[$i.LoadState.RECEIVED]} | LOADED: ${c[$i.LoadState.LOADED]} | FAILED: ${c[$i.LoadState.FAILED]} | UNAVAILABLE: ${c[$i.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${g} | OCT: ${h} | ALL: ${x}`;console.log(`${d} || ${p} || ${b}`)}var SH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function tgt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,h,x,b,C){let T=!1;if(l(g.children))for(let A=0;A<8;A++){let S=g.children[A];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(T=!0)}if(T){u[C]=SH.INTERNAL<<16|h,u[x]=b,a++,b=h,C=b*9+1;for(let A=0;A<8;A++){let S=g.children[A];h=a,x=h*9+0,d(S,h,x,b,C+A)}}else{if(s){let A=c*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,I=S.spatialNode.parent,O=l(I)?I.renderableKeyframeNodePrevious:S,R=ngt(g,i,n),N=v,F=1,_=S.megatextureIndex,E=O.megatextureIndex;f[A+0]=R,f[A+1]=N,f[A+2]=F,f[A+3]=_,f[A+4]=E,u[C]=SH.LEAF<<16|c}else{let A=g.renderableKeyframeNodePrevious,v=g.level-A.spatialNode.level===0?SH.LEAF:SH.PACKED_LEAF_FROM_PARENT;u[C]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),igt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&ogt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function ngt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function igt(e,t,n,i){let o=ct.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],g=d*o;for(let h=0;h<o;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function ogt(e,t,n,i){let o=ct.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],h=e[p*r+1],x=e[p*r+2],b=e[p*r+3],C=e[p*r+4],T=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=h&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}d0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=qt.getComponentCount(a);o+=zS.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var YS=d0;var rgt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},XS=Object.freeze(rgt);function KS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}KS.prototype.getTexture=function(e){return this._textures[e]};function sgt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}KS.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):sgt(this,e,t)};function agt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?vH(o,r,n):cgt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function vH(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?jxe(e,n):new Lt({context:n,source:t,sampler:o});return Wxe(o)&&r.generateMipmap(),r}function cgt(e,t,n){let{typedArray:i,sampler:o}=e,r=Wxe(o),s=o.wrapS===Pn.REPEAT||o.wrapS===Pn.MIRRORED_REPEAT||o.wrapT===Pn.REPEAT||o.wrapT===Pn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Je.UNSIGNED_BYTE){let d=QL(i,a,c),p=Og(d);return vH({sampler:o},p,n)}}else{let d=Og(t);return vH(e,d,n)}else return vH(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),jxe(e,n)}function Wxe(e){return[un.NEAREST_MIPMAP_NEAREST,un.NEAREST_MIPMAP_LINEAR,un.LINEAR_MIPMAP_NEAREST,un.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function jxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Lt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}KS.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];agt(this,o,t)}n.length=0};KS.prototype.isDestroyed=function(){return!1};KS.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var mB=KS;function hB(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Up.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Gg.INHERIT),this._textureManager=new mB,this._defaultTexture=void 0,this.uniformMap=lgt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},dgt(this),mgt(this)}function lgt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===XS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=ugt(e,i)):n[i]=fgt(e,i)}return n}function ugt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function fgt(e,t){return function(){return e.uniforms[t].value}}function FC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function dgt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,FC(r,t,o),o=e.usedVariablesVertex.featureIdSet,FC(r,n,o),o=e.usedVariablesVertex.metadataSet,FC(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,FC(s,t,o),o=e.usedVariablesFragment.featureIdSet,FC(s,n,o),o=e.usedVariablesFragment.metadataSet,FC(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;FC(s,a,c)}}function qxe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function yc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${qxe(t)} is not available in the ${i} shader. Did you mean ${qxe(n)} instead?`;throw new fe(o)}}function mgt(e){let t=e.usedVariablesVertex.attributeSet;yc(t,"position","positionMC","vertex"),yc(t,"normal","normalMC","vertex"),yc(t,"tangent","tangentMC","vertex"),yc(t,"bitangent","bitangentMC","vertex"),yc(t,"positionWC","positionMC","vertex"),yc(t,"positionEC","positionMC","vertex"),yc(t,"normalEC","normalMC","vertex"),yc(t,"tangentEC","tangentMC","vertex"),yc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;yc(n,"position","positionEC","fragment"),yc(n,"normal","normalEC","fragment"),yc(n,"tangent","tangentEC","fragment"),yc(n,"bitangent","bitangentEC","fragment"),yc(n,"normalMC","normalEC","fragment"),yc(n,"tangentMC","tangentEC","fragment"),yc(n,"bitangentMC","bitangentEC","fragment")}hB.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===XS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};hB.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};hB.prototype.isDestroyed=function(){return!1};hB.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var BC=hB;function Bh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Bh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._compoundModelMatrix=new L,this._compoundModelMatrixOld=new L,this._customShader=y(e.customShader,Bh.DefaultCustomShader),this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new L,this._transformPositionUvToWorld=new L,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Rd,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new L,transformPositionUvToView:new L,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new re,clippingPlanesTexture:void 0,clippingPlanesMatrix:new L,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;this._completeLoad=function(o,r){},this._readyPromise=hgt(this,i)}async function hgt(e,t){let n=new Promise(function(a){e._completeLoad=function(c,u){u.afterRender.push(function(){return c._ready=!0,a(c),!0})}});l(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:o=Wi.getMinBounds(i),maxBounds:r=Wi.getMaxBounds(i)}=t;e.minBounds=o,e.maxBounds=r,e.minClippingBounds=Wi.getMinBounds(i),e.maxClippingBounds=Wi.getMaxBounds(i),Xxe(e,t);let s=Wi.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=Kxe(e,e._shape,t),n}Object.defineProperties(Bh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=Bh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var pgt=new m,_gt=new re,ggt=new re,ygt=new m,xgt=new m,bgt=new Z,Cgt=new Z,Tgt=new L,Agt=new L,Egt=new L,Sgt=L.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new L),vgt=L.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new L);Bh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),l(t._ready)&&!t._ready||!l(this._shape))return;let n=e.context;if(!this._ready){wgt(this,t,n),this._completeLoad(this,e);return}let i=Xxe(this,t),o=this._shape;if(i&&(this._shapeVisible=Kxe(this,o,t),Pgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Ogt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Ugt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Rgt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(z2(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=Ngt(p,d,ggt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=re.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=L.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=L.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=L.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};function wgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=Igt(e,t,n),Dgt(e._traversal,i)}function Xxe(e,t){let n=y(t.shapeTransform,L.IDENTITY),i=y(t.globalTransform,L.IDENTITY);return L.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),L.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),pB(e,"_compoundModelMatrix","_compoundModelMatrixOld")+pB(e,"_minBounds","_minBoundsOld")+pB(e,"_maxBounds","_maxBoundsOld")+pB(e,"_minClippingBounds","_minClippingBoundsOld")+pB(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function pB(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Kxe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=L.inverse(o,Tgt),s=L.getRotation(o,bgt),a=L.getScale(o,ygt),c=m.maximumComponent(a),u=m.divideByScalar(a,c,xgt),f=Z.multiplyByScale(s,u,Cgt),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=L.multiplyTransformation(Sgt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=L.multiplyTransformation(o,vgt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=L.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Igt(e,t,n){let i=m.clone(t.dimensions,pgt);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?YS.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new YS(e,n,i,t.types,t.componentTypes,s,r)}function Dgt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Pgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Ogt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/r;return o+a}function Rgt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=L.transpose(L.multiplyTransformation(L.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Bh.prototype.isDestroyed=function(){return!1};Bh.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var Yxe=new Array(new re(-1,-1,-1,1),new re(1,-1,-1,1),new re(-1,1,-1,1),new re(1,1,-1,1),new re(-1,-1,1,1),new re(1,-1,1,1),new re(-1,1,1,1),new re(1,1,1,1)),Mgt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Lgt=new Array(new re,new re,new re,new re,new re,new re,new re,new re);function Ngt(e,t,n){let i=L.fromRotationTranslation(e.halfAxes,e.center,Agt),o=L.multiply(t,i,Egt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Lgt,d=Yxe.length;for(u=0;u<d;u++)L.multiplyByVector(o,Yxe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=Mgt[u*3+g],x=f[h];if(x.z>=-x.w){let b=p.z+p.w,C=x.z+x.w,T=b/(b-C),A=re.lerp(p,x,T,_gt),S=A.x/A.w,v=A.y/A.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=re.fromElements(r,a,s,c,n),n}var aK=3e7,Fgt=new m(aK,0,0),Bgt=new m(0,aK,0),kgt=new m(0,0,aK);function Ugt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:zi.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(r(c.orientedBoundingBox,g,d),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}r(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Fgt,z.RED,a),o(m.ZERO,Bgt,z.LIME,a),o(m.ZERO,kgt,z.BLUE,a),i.update(t)}Bh.DefaultCustomShader=new BC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function OAe(){this.ready=!0,this.shape=Hi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[Yt.SCALAR],this.componentTypes=[on.FLOAT32],this.maximumTileCount=1}OAe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Fh.DefaultProvider=new OAe;var WS=Fh;function $X(){fe.throwInstantiationError()}Object.defineProperties($X.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});$X.prototype.requestData=fe.throwInstantiationError;var eK=$X;function BC(){fe.throwInstantiationError()}Object.defineProperties(BC.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});BC.prototype.update=fe.throwInstantiationError;BC.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;BC.prototype.computeApproximateStepSize=fe.throwInstantiationError;BC.DefaultMinBounds=fe.throwInstantiationError;BC.DefaultMaxBounds=fe.throwInstantiationError;var tK=BC;function jS(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Sgt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let o="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(o,void 0,r)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function RAe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function MAe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=RAe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function BAe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function LC(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=Wt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=Wt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Pn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Pn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new Hd,MAe(this);try{let p=new zF({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,RAe(this),BAe(this);let g=y(p.mapProjection.ellipsoid,re.WGS84),h=t.globe;l(h)||(h=new VN(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,xn.RECEIVE_ONLY));let A=t.skyBox;l(A)||(A=new qF({sources:{positiveX:jS("px"),negativeX:jS("mx"),positiveY:jS("py"),negativeY:jS("my"),positiveZ:jS("pz"),negativeZ:jS("mz")}})),A!==!1&&(p.skyBox=A,p.sun=new n2,p.moon=new XN);let x=t.skyAtmosphere;l(x)||(x=new WF(g)),x!==!1&&(p.skyAtmosphere=x),l(t.imageryProvider)&&$("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(l(t.imageryProvider)&&!l(C)&&(C=new Us(t.imageryProvider)),l(C)||(C=Us.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new Iu(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(E,S){if(T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors){let w="An error occurred while rendering. Rendering has stopped.";T.showErrorPanel(w,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(LC.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Sgt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});LC.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=xh(n);u||(typeof n=="string"&&(n=new Error(n)),t=xh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${h}`);let A=document.createElement("div");A.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),A.appendChild(x),A.onclick=function(C){A.removeChild(x),A.appendChild(document.createTextNode(h)),A.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",A.onclick=void 0},a.appendChild(A)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};LC.prototype.isDestroyed=function(){return!1};LC.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};LC.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,MAe(this),BAe(this),this._scene.requestRender())};LC.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var u2=LC;function vgt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,at.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ze.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Dn.REPEAT:Dn.CLAMP_TO_EDGE;this.sampler=new dn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var nK=vgt;var wgt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},iK=Object.freeze(wgt);var rK=`uniform sampler2D u_depthTexture; +}`});function Jxe(){this.ready=!0,this.shape=Wi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[qt.SCALAR],this.componentTypes=[rn.FLOAT32],this.maximumTileCount=1}Jxe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Bh.DefaultProvider=new Jxe;var JS=Bh;function cK(){fe.throwInstantiationError()}Object.defineProperties(cK.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});cK.prototype.requestData=fe.throwInstantiationError;var lK=cK;function kC(){fe.throwInstantiationError()}Object.defineProperties(kC.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});kC.prototype.update=fe.throwInstantiationError;kC.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;kC.prototype.computeApproximateStepSize=fe.throwInstantiationError;kC.DefaultMinBounds=fe.throwInstantiationError;kC.DefaultMaxBounds=fe.throwInstantiationError;var uK=kC;var fK=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15083,38 +15045,38 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;function Dgt(e,t,n){let i;try{return i=e(t,n),i}catch(r){return Promise.reject(r)}}function Igt(e){let t;return function(n){let i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(Dgt(e,i.parameters,r)).then(function(s){o.result=s}).catch(function(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${xh(s)} - with responseMessage: ${JSON.stringify(o)}`,t(o)}})}}var oK=Igt;globalThis.CESIUM_VERSION="1.105";var f2;typeof ko<"u"&&(f2=ko);(function(){/*! +`;function Vgt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,ct.RGBA),this.pixelDatatype=y(e.pixelDatatype,Je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Se.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Pn.REPEAT:Pn.CLAMP_TO_EDGE;this.sampler=new hn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var dK=Vgt;var zgt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},mK=Object.freeze(zgt);function Hgt(e,t,n){let i;try{return i=e(t,n),i}catch(o){return Promise.reject(o)}}function Ggt(e){let t;return function(n){let i=n.data,o=[],r={id:i.id,result:void 0,error:void 0};return Promise.resolve(Hgt(e,i.parameters,o)).then(function(s){r.result=s}).catch(function(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(o.length=0);try{t(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${bh(s)} + with responseMessage: ${JSON.stringify(r)}`,t(r)}})}}var hK=Ggt;globalThis.CESIUM_VERSION="1.106.1";var _B;typeof ko<"u"&&(_B=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,b){return _===null||typeof _ in A?_===b:!1}function u(_,b){var v;return function(){v||(v=h.a.setTimeout(function(){v=e,_()},b))}}function f(_,b){var v;return function(){clearTimeout(v),v=h.a.setTimeout(_,b)}}function d(_,b){b&&b!=="change"?b==="beforeChange"?this.pc(_):this.gb(_,b):this.qc(_)}function p(_,b){b!==null&&b.s&&b.s()}function g(_,b){var v=this.qd,I=v[S];I.ra||(this.Qb&&this.mb[b]?(v.uc(b,_,this.mb[b]),this.mb[b]=null,--this.Qb):I.I[b]||v.uc(b,_,I.J?{da:_}:v.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,b){for(var v=_.split("."),I=h,M=0;M<v.length-1;M++)I=I[v[M]];I[v[v.length-1]]=b},h.L=function(_,b,v){_[b]=v},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(W,K){for(var J in W)M.call(W,J)&&K(J,W[J])}function b(W,K){if(K)for(var J in K)M.call(K,J)&&(W[J]=K[J]);return W}function v(W,K){return W.__proto__=K,W}function I(W,K,J,me){var ye=W[K].match(Y)||[];h.a.D(J.match(Y),function(se){h.a.Na(ye,se,me)}),W[K]=ye.join(" ")}var M=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,k=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(W,K){if(K.length)for(var J=0,me=K.length;J<me;J++)G[K[J]]=W});var U={propertychange:!0},q=n&&function(){for(var W=3,K=n.createElement("div"),J=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",J[0];);return 4<W?W:e}(),Y=/\S+/g,Q;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,J){for(var me=0,ye=W.length;me<ye;me++)K.call(J,W[me],me,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var J=0,me=W.length;J<me;J++)if(W[J]===K)return J;return-1},Lb:function(W,K,J){for(var me=0,ye=W.length;me<ye;me++)if(K.call(J,W[me],me,W))return W[me];return e},Pa:function(W,K){var J=h.a.A(W,K);0<J?W.splice(J,1):J===0&&W.shift()},wc:function(W){var K=[];return W&&h.a.D(W,function(J){0>h.a.A(K,J)&&K.push(J)}),K},Mb:function(W,K,J){var me=[];if(W)for(var ye=0,se=W.length;ye<se;ye++)me.push(K.call(J,W[ye],ye));return me},jb:function(W,K,J){var me=[];if(W)for(var ye=0,se=W.length;ye<se;ye++)K.call(J,W[ye],ye)&&me.push(W[ye]);return me},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var J=0,me=K.length;J<me;J++)W.push(K[J]);return W},Na:function(W,K,J){var me=h.a.A(h.a.bc(W),K);0>me?J&&W.push(K):J||W.splice(me,1)},Ba:F,extend:b,setPrototypeOf:v,Ab:F?v:b,P:_,Ga:function(W,K,J){if(!W)return W;var me={},ye;for(ye in W)M.call(W,ye)&&(me[ye]=K.call(J,W[ye],ye,W));return me},Tb:function(W){for(;W.firstChild;)h.removeNode(W.firstChild)},Yb:function(W){W=h.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),J=0,me=W.length;J<me;J++)K.appendChild(h.oa(W[J]));return K},Ca:function(W,K){for(var J=0,me=W.length,ye=[];J<me;J++){var se=W[J].cloneNode(!0);ye.push(K?h.oa(se):se)}return ye},va:function(W,K){if(h.a.Tb(W),K)for(var J=0,me=K.length;J<me;J++)W.appendChild(K[J])},Xc:function(W,K){var J=W.nodeType?[W]:W;if(0<J.length){for(var me=J[0],ye=me.parentNode,se=0,_e=K.length;se<_e;se++)ye.insertBefore(K[se],me);for(se=0,_e=J.length;se<_e;se++)h.removeNode(J[se])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var J=W[0],me=W[W.length-1];for(W.length=0;J!==me;)W.push(J),J=J.nextSibling;W.push(me)}}return W},Zc:function(W,K){7>q?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return h.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!h.a.Lb(W,h.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return h.onError?function(){try{return W.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(h.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw h.onError&&h.onError(W),W},0)},B:function(W,K,J){var me=h.a.Ac(J);if(J=U[K],h.options.useOnlyNativeEvents||J||!r)if(J||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ye=function(_e){me.call(W,_e)},se="on"+K;W.attachEvent(se,ye),h.a.K.za(W,function(){W.detachEvent(se,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,me,!1);else Q||(Q=typeof r(W).on=="function"?"on":"bind"),r(W)[Q](K,me)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var J;if(h.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(J=W.type,J=J=="checkbox"||J=="radio"):J=!1,h.options.useOnlyNativeEvents||!r||J)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")J=n.createEvent(G[K]||"HTMLEvents"),J.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(J);else throw Error("The supplied element doesn't support dispatchEvent");else if(J&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else r(W).trigger(K)},f:function(W){return h.O(W)?W():W},bc:function(W){return h.O(W)?W.v():W},Eb:function(W,K,J){var me;K&&(typeof W.classList=="object"?(me=W.classList[J?"add":"remove"],h.a.D(K.match(Y),function(ye){me.call(W.classList,ye)})):typeof W.className.baseVal=="string"?I(W.className,"baseVal",K,J):I(W,"className",K,J))},Bb:function(W,K){var J=h.a.f(K);(J===null||J===e)&&(J="");var me=h.h.firstChild(W);!me||me.nodeType!=3||h.h.nextSibling(me)?h.h.va(W,[W.ownerDocument.createTextNode(J)]):me.data=J,h.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=q)try{var J=W.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+J+"'/>"),!1)}catch{}},Ad:function(W){9<=q&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(q){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=h.a.f(W),K=h.a.f(K);for(var J=[],me=W;me<=K;me++)J.push(me);return J},la:function(W){for(var K=[],J=0,me=W.length;J<me;J++)K.push(W[J]);return K},Da:function(W){return k?Symbol(W):W},Zd:q===6,$d:q===7,W:q,Lc:function(W,K){for(var J=h.a.la(W.getElementsByTagName("input")).concat(h.a.la(W.getElementsByTagName("textarea"))),me=typeof K=="string"?function(_e){return _e.name===K}:function(_e){return K.test(_e.name)},ye=[],se=J.length-1;0<=se;se--)me(J[se])&&ye.push(J[se]);return ye},Nd:function(W){return typeof W=="string"&&(W=h.a.Db(W))?o&&o.parse?o.parse(W):new Function("return "+W)():null},hc:function(W,K,J){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(h.a.f(W),K,J)},Od:function(W,K,J){J=J||{};var me=J.params||{},ye=J.includeFields||this.Jc,se=W;if(typeof W=="object"&&h.a.R(W)==="form")for(var se=W.action,_e=ye.length-1;0<=_e;_e--)for(var xe=h.a.Lc(W,ye[_e]),De=xe.length-1;0<=De;De--)me[xe[De].name]=xe[De].value;K=h.a.f(K);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=se,Ee.method="post";for(var Ne in K)W=n.createElement("input"),W.type="hidden",W.name=Ne,W.value=h.a.hc(h.a.f(K[Ne])),Ee.appendChild(W);_(me,function(ke,Re){var dt=n.createElement("input");dt.type="hidden",dt.name=ke,dt.value=Re,Ee.appendChild(dt)}),n.body.appendChild(Ee),J.submitter?J.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var b=this;if(arguments.length===1)return function(){return b.apply(_,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),b.apply(_,I)}}),h.a.g=new function(){var _=0,b="__ko__"+new Date().getTime(),v={},I,M;return h.a.W?(I=function(F,k){var V=F[b];if(!V||V==="null"||!v[V]){if(!k)return e;V=F[b]="ko"+_++,v[V]={}}return v[V]},M=function(F){var k=F[b];return k?(delete v[k],F[b]=null,!0):!1}):(I=function(F,k){var V=F[b];return!V&&k&&(V=F[b]={}),V},M=function(F){return F[b]?(delete F[b],!0):!1}),{get:function(F,k){var V=I(F,!1);return V&&V[k]},set:function(F,k,V){(F=I(F,V!==e))&&(F[k]=V)},Ub:function(F,k,V){return F=I(F,!0),F[k]||(F[k]=V)},clear:M,Z:function(){return _+++b}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(k,V){var G=h.a.g.get(k,I);return G===e&&V&&(G=[],h.a.g.set(k,I,G)),G}function b(k){var V=_(k,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](k);h.a.g.clear(k),h.a.K.cleanExternalData(k),F[k.nodeType]&&v(k.childNodes,!0)}function v(k,V){for(var G=[],U,q=0;q<k.length;q++)if((!V||k[q].nodeType===8)&&(b(G[G.length]=U=k[q]),k[q]!==U))for(;q--&&h.a.A(G,k[q])==-1;);}var I=h.a.g.Z(),M={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(k,V){if(typeof V!="function")throw Error("Callback must be a function");_(k,!0).push(V)},yb:function(k,V){var G=_(k,!1);G&&(h.a.Pa(G,V),G.length==0&&h.a.g.set(k,I,e))},oa:function(k){return h.u.G(function(){M[k.nodeType]&&(b(k),F[k.nodeType]&&v(k.getElementsByTagName("*")))}),k},removeNode:function(k){h.oa(k),k.parentNode&&k.parentNode.removeChild(k)},cleanExternalData:function(k){r&&typeof r.cleanData=="function"&&r.cleanData([k])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],b=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],M={thead:b,tbody:b,tfoot:b,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},F=8>=h.a.W;h.a.ua=function(k,V){var G;if(r){if(r.parseHTML)G=r.parseHTML(k,V)||[];else if((G=r.clean([k],V))&&G[0]){for(var U=G[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(G=V)||(G=n);var U=G.parentWindow||G.defaultView||t,q=h.a.Db(k).toLowerCase(),Y=G.createElement("div"),Q;for(Q=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[q[1]]||_,q=Q[0],Q="ignored<div>"+Q[1]+k+Q[2]+"</div>",typeof U.innerShiv=="function"?Y.appendChild(U.innerShiv(Q)):(F&&G.body.appendChild(Y),Y.innerHTML=Q,F&&Y.parentNode.removeChild(Y));q--;)Y=Y.lastChild;G=h.a.la(Y.lastChild.childNodes)}return G},h.a.Md=function(k,V){var G=h.a.ua(k,V);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(k,V){if(h.a.Tb(k),V=h.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),r)r(k).html(V);else for(var G=h.a.ua(V,k.ownerDocument),U=0;U<G.length;U++)k.appendChild(G[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(v,I){if(v){if(v.nodeType==8){var M=h.aa.Uc(v.nodeValue);M!=null&&I.push({ud:v,Kd:M})}else if(v.nodeType==1)for(var M=0,F=v.childNodes,k=F.length;M<k;M++)_(F[M],I)}}var b={};return{Xb:function(v){if(typeof v!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return b[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var M=b[v];if(M===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return M.apply(null,I||[]),!0}finally{delete b[v]}},cd:function(v,I){var M=[];_(v,M);for(var F=0,k=M.length;F<k;F++){var V=M[F].ud,G=[V];I&&h.a.Nb(G,I),h.aa.bd(M[F].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(M){for(var V=M,G=0,U;k<M;)if(U=I[k++]){if(k>V){if(5e3<=++G){k=M,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=M}try{U()}catch(q){h.a.Gc(q)}}}}function b(){_(),k=M=I.length=0}var v,I=[],M=0,F=1,k=0;return t.MutationObserver?v=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(b):v=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:v,zb:function(V){return M||h.na.scheduler(b),I[M++]=V,F++},cancel:function(V){V=V-(F-M),V>=k&&V<M&&(I[V]=null)},resetForTesting:function(){var V=M-k;return k=M=I.length=0,V},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,b){_.throttleEvaluation=b;var v=null;return h.$({read:_,write:function(I){clearTimeout(v),v=h.a.setTimeout(function(){_(I)},b)}})},rateLimit:function(_,b){var v,I,M;typeof b=="number"?v=b:(v=b.timeout,I=b.method),_.Hb=!1,M=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(F){return M(F,v,b)})},deferred:function(_,b){if(b!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(v){var I,M=!1;return function(){if(!M){h.na.cancel(I),I=h.na.zb(v);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,b){_.equalityComparer=b=="always"?null:c}};var A={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,b,v){this.da=_,this.lc=b,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,x),x.qb(this)};var x={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,b,v){var I=this;v=v||"change";var M=new h.ic(I,b?_.bind(b):_,function(){h.a.Pa(I.U[v],M),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(M),M},notifySubscribers:function(_,b){if(b=b||"change",b==="change"&&this.Gb(),this.Wa(b)){var v=b==="change"&&this.ed||this.U[b].slice(0);try{h.u.xc();for(var I=0,M;M=v[I];++I)M.Ib||M.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var b=this,v=h.O(b),I,M,F,k,V;b.gb||(b.gb=b.notifySubscribers,b.notifySubscribers=d);var G=_(function(){b.Ja=!1,v&&k===b&&(k=b.nc?b.nc():b());var U=M||V&&b.sb(F,k);V=M=I=!1,U&&b.gb(F=k)});b.qc=function(U,q){q&&b.Ja||(V=!q),b.ed=b.U.change.slice(0),b.Ja=I=!0,k=U,G()},b.pc=function(U){I||(F=U,b.gb(U,"beforeChange"))},b.rc=function(){V=!0},b.gd=function(){b.sb(F,b.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var b=0;return h.a.P(this.U,function(v,I){v!=="dirty"&&(b+=I.length)}),b},sb:function(_,b){return!this.equalityComparer||!this.equalityComparer(_,b)},toString:function(){return"[object Object]"},extend:function(_){var b=this;return _&&h.a.P(_,function(v,I){var M=h.Ta[v];typeof M=="function"&&(b=M(b,I)||b)}),b}};h.L(x,"init",x.qb),h.L(x,"subscribe",x.subscribe),h.L(x,"extend",x.extend),h.L(x,"getSubscriptionsCount",x.Bd),h.a.Ba&&h.a.setPrototypeOf(x,Function.prototype),h.T.fn=x,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(F){v.push(I),I=F}function b(){I=v.pop()}var v=[],I,M=0;return{xc:_,end:b,cc:function(F){if(I){if(!h.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++M))}},G:function(F,k,V){try{return _(),F.apply(k,V||[])}finally{b()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function b(){return 0<arguments.length?(b.sb(b[C],arguments[0])&&(b.ya(),b[C]=arguments[0],b.xa()),this):(h.u.cc(b),b[C])}return b[C]=_,h.a.Ba||h.a.extend(b,h.T.fn),h.T.fn.qb(b),h.a.Ab(b,T),h.options.deferUpdates&&h.Ta.deferred(b,!0),b};var T={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(T,h.T.fn);var E=h.ta.Ma="__ko_proto__";T[E]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[E])&&_!==T[E]&&_!==h.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[E]===T[E]||_[E]===h.o.fn[E]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",T),h.L(T,"peek",T.v),h.L(T,"valueHasMutated",T.xa),h.L(T,"valueWillMutate",T.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var b=this.v(),v=[],I=typeof _!="function"||h.O(_)?function(k){return k===_}:_,M=0;M<b.length;M++){var F=b[M];if(I(F)){if(v.length===0&&this.ya(),b[M]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),b.splice(M,1),M--}}return v.length&&this.xa(),v},removeAll:function(_){if(_===e){var b=this.v(),v=b.slice(0);return this.ya(),b.splice(0,b.length),this.xa(),v}return _?this.remove(function(I){return 0<=h.a.A(_,I)}):[]},destroy:function(_){var b=this.v(),v=typeof _!="function"||h.O(_)?function(F){return F===_}:_;this.ya();for(var I=b.length-1;0<=I;I--){var M=b[I];v(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(b){return 0<=h.a.A(_,b)}):[]},indexOf:function(_){var b=this();return h.a.A(b,_)},replace:function(_,b){var v=this.indexOf(_);0<=v&&(this.ya(),this.v()[v]=b,this.xa())},sorted:function(_){var b=this().slice(0);return _?b.sort(_):b.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var b=this.v();this.ya(),this.zc(b,_,arguments);var v=b[_].apply(b,arguments);return this.xa(),v===b?this:v}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var b=this();return b[_].apply(b,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,b){function v(){function Y(){if(V){var Q=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<V)&&(M=h.a.Pb(G,Q,_.Ob)),W=M),G=Q,M=null,V=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}I?Y():(I=!0,k=_.subscribe(function(){++V},null,"spectate"),G=[].concat(_.v()||[]),M=null,F=_.subscribe(Y))}if(_.Ob={},b&&typeof b=="object"&&h.a.extend(_.Ob,b),_.Ob.sparse=!0,!_.zc){var I=!1,M=null,F,k,V=0,G,U=_.Qa,q=_.hb;_.Qa=function(Y){U&&U.call(_,Y),Y==="arrayChange"&&v()},_.hb=function(Y){q&&q.call(_,Y),Y!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),k&&k.s(),k=F=null,I=!1,G=e)},_.zc=function(Y,Q,W){function K(Ee,Ne,ke){return J[J.length]={status:Ee,value:Ne,index:ke}}if(I&&!V){var J=[],me=Y.length,ye=W.length,se=0;switch(Q){case"push":se=me;case"unshift":for(Q=0;Q<ye;Q++)K("added",W[Q],se+Q);break;case"pop":se=me-1;case"shift":me&&K("deleted",Y[se],se);break;case"splice":Q=Math.min(Math.max(0,0>W[0]?me+W[0]:W[0]),me);for(var me=ye===1?me:Math.min(Q+(W[1]||0),me),ye=Q+ye-2,se=Math.max(me,ye),_e=[],xe=[],De=2;Q<se;++Q,++De)Q<me&&xe.push(K("deleted",Y[Q],Q)),Q<ye&&_e.push(K("added",W[De],Q));h.a.Kc(xe,_e);break;default:return}M=J}}}};var S=h.a.Da("_state");h.o=h.$=function(_,b,v){function I(){if(0<arguments.length){if(typeof M=="function")M.apply(F.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return F.ra||h.u.cc(I),(F.ka||F.J&&I.Xa())&&I.ha(),F.X}if(typeof _=="object"?v=_:(v=v||{},_&&(v.read=_)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:b||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=F,I.Nc=typeof M=="function",h.a.Ba||h.a.extend(I,h.T.fn),h.T.fn.qb(I),h.a.Ab(I,w),v.pure?(F.wb=!0,F.J=!0,h.a.extend(I,D)):v.deferEvaluation&&h.a.extend(I,R),h.options.deferUpdates&&h.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||I.ha(),F.l&&I.ja()&&h.a.K.za(F.l,F.Rb=function(){I.s()}),I};var w={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(b,v){_[v.Ka]=v.da}),_},Vb:function(_){if(!this[S].V)return!1;var b=this.Va();return h.a.A(b,_)!==-1?!0:!!h.a.Lb(b,function(v){return v.Vb&&v.Vb(_)})},uc:function(_,b,v){if(this[S].wb&&b===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=v,v.Ka=this[S].V++,v.La=b.ob()},Xa:function(){var _,b,v=this[S].I;for(_ in v)if(Object.prototype.hasOwnProperty.call(v,_)&&(b=v[_],this.Ia&&b.da.Ja||b.da.Dd(b.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var b=_.subscribe(this.Jd,this,"dirty"),v=_.subscribe(this.Rd,this);return{da:_,s:function(){b.s(),v.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,b=_.throttleEvaluation;b&&0<=b?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},b)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var b=this[S],v=b.Sa,I=!1;if(!b.rb&&!b.ra){if(b.l&&!h.a.Sb(b.l)||v&&v()){if(!b.jc){this.s();return}}else b.jc=!1;b.rb=!0;try{I=this.zd(_)}finally{b.rb=!1}return I}},zd:function(_){var b=this[S],I=!1,v=b.wb?e:!b.V,I={qd:this,mb:b.I,Qb:b.V};h.u.xc({pd:I,od:g,o:this,Ya:v}),b.I={},b.V=0;var M=this.yd(b,I);return b.V?I=this.sb(b.X,M):(this.s(),I=!0),I&&(b.J?this.Gb():this.notifySubscribers(b.X,"beforeChange"),b.X=M,this.notifySubscribers(b.X,"spectate"),!b.J&&_&&this.notifySubscribers(b.X),this.rc&&this.rc()),v&&this.notifySubscribers(b.X,"awake"),I},yd:function(_,b){try{var v=_.Wc;return _.nb?v.call(_.nb):v()}finally{h.u.end(),b.Qb&&!_.J&&h.a.P(b.mb,p),_.sa=_.ka=!1}},v:function(_){var b=this[S];return(b.ka&&(_||!b.V)||b.J&&this.Xa())&&this.ha(),b.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(b){this.pc(this[S].X),this[S].ka=!0,b&&(this[S].sa=!0),this.qc(this,!b)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(b,v){v.s&&v.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var b=this,v=b[S];if(!v.ra&&v.J&&_=="change"){if(v.J=!1,v.sa||b.Xa())v.I=null,v.V=0,b.ha()&&b.Gb();else{var I=[];h.a.P(v.I,function(M,F){I[F.Ka]=M}),h.a.D(I,function(M,F){var k=v.I[M],V=b.$c(k.da);V.Ka=F,V.La=k.La,v.I[M]=V}),b.Xa()&&b.ha()&&b.Gb()}v.ra||b.notifySubscribers(v.X,"awake")}},hb:function(_){var b=this[S];b.ra||_!="change"||this.Wa("change")||(h.a.P(b.I,function(v,I){I.s&&(b.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),b.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},R={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(w,h.T.fn);var O=h.ta.Ma;w[O]=h.o,h.Oc=function(_){return typeof _=="function"&&_[O]===w[O]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",w),h.L(w,"peek",w.v),h.L(w,"dispose",w.s),h.L(w,"isActive",w.ja),h.L(w,"getDependenciesCount",w.qa),h.L(w,"getDependencies",w.Va),h.xb=function(_,b){return typeof _=="function"?h.o(_,b,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,b))},h.b("pureComputed",h.xb),function(){function _(I,M,F){if(F=F||new v,I=M(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var k=I instanceof Array?[]:{};return F.save(I,k),b(I,function(V){var G=M(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":k[V]=G;break;case"object":case"undefined":var U=F.get(G);k[V]=U!==e?U:_(G,M,F)}}),k}function b(I,M){if(I instanceof Array){for(var F=0;F<I.length;F++)M(F);typeof I.toJSON=="function"&&M("toJSON")}else for(F in I)M(F)}function v(){this.keys=[],this.values=[]}h.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(M){for(var F=0;h.O(M)&&10>F;F++)M=M();return M})},h.toJSON=function(I,M,F){return I=h.ad(I),h.a.hc(I,M,F)},v.prototype={constructor:v,save:function(I,M){var F=h.a.A(this.keys,I);0<=F?this.values[F]=M:(this.keys.push(I),this.values.push(M))},get:function(I){return I=h.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,b,v){function I(M){var F=h.xb(_,v).extend({ma:"always"}),k=F.subscribe(function(V){V&&(k.s(),M(V))});return F.notifySubscribers(F.v()),k}return typeof Promise!="function"||b?I(b.bind(v)):new Promise(I)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,b,v){switch(h.a.R(_)){case"option":typeof b=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=b):(h.a.g.set(_,h.c.options.$b,b),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof b=="number"?b:"");break;case"select":(b===""||b===null)&&(b=e);for(var I=-1,M=0,F=_.options.length,k;M<F;++M)if(k=h.w.M(_.options[M]),k==b||k===""&&b===e){I=M;break}(v||0<=I||b===e&&1<_.size)&&(_.selectedIndex=I,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(b===null||b===e)&&(b=""),_.value=b}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(V){V=h.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var G=[],U=V.match(I),q,Y=[],Q=0;if(1<U.length){for(var W=0,K;K=U[W];++W){var J=K.charCodeAt(0);if(J===44){if(0>=Q){G.push(q&&Y.length?{key:q,value:Y.join("")}:{unknown:q||Y.join("")}),q=Q=0,Y=[];continue}}else if(J===58){if(!Q&&!q&&Y.length===1){q=Y.pop();continue}}else{if(J===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;J===47&&W&&1<K.length?(J=U[W-1].match(M))&&!F[J[0]]&&(V=V.substr(V.indexOf(K)+1),U=V.match(I),W=-1,K="/"):J===40||J===123||J===91?++Q:J===41||J===125||J===93?--Q:q||Y.length||J!==34&&J!==39||(K=K.slice(1,-1))}Y.push(K)}if(0<Q)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var b=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},k={};return{Ra:[],wa:k,ac:_,vb:function(V,G){function U(J,me){var ye;if(!W){var se=h.getBindingHandler(J);if(se&&se.preprocess&&!(me=se.preprocess(me,J,U)))return;(se=k[J])&&(ye=me,0<=h.a.A(b,ye)?ye=!1:(se=ye.match(v),ye=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ye),se=ye),se&&Y.push("'"+(typeof k[J]=="string"?k[J]:J)+"':function(_z){"+ye+"=_z}")}Q&&(me="function(){return "+me+" }"),q.push("'"+J+"':"+me)}G=G||{};var q=[],Y=[],Q=G.valueAccessors,W=G.bindingParams,K=typeof V=="string"?_(V):V;return h.a.D(K,function(J){U(J.key||J.unknown,J.value)}),Y.length&&U("_ko_property_writers","{"+Y.join(",")+" }"),q.join(",")},Id:function(V,G){for(var U=0;U<V.length;U++)if(V[U].key==G)return!0;return!1},eb:function(V,G,U,q,Y){V&&h.O(V)?!h.Za(V)||Y&&V.v()===q||V(q):(V=G.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(U){return U.nodeType==8&&F.test(M?U.text:U.nodeValue)}function b(U){return U.nodeType==8&&k.test(M?U.text:U.nodeValue)}function v(U,q){for(var Y=U,Q=1,W=[];Y=Y.nextSibling;){if(b(Y)&&(h.a.g.set(Y,G,!0),Q--,Q===0))return W;W.push(Y),_(Y)&&Q++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var Y=v(U,q);return Y?0<Y.length?Y[Y.length-1].nextSibling:U.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",F=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return _(U)?v(U):U.childNodes},Ea:function(U){if(_(U)){U=h.h.childNodes(U);for(var q=0,Y=U.length;q<Y;q++)h.removeNode(U[q])}else h.a.Tb(U)},va:function(U,q){if(_(U)){h.h.Ea(U);for(var Y=U.nextSibling,Q=0,W=q.length;Q<W;Q++)Y.parentNode.insertBefore(q[Q],Y)}else h.a.va(U,q)},Vc:function(U,q){var Y;_(U)?(Y=U.nextSibling,U=U.parentNode):Y=U.firstChild,Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)},Wb:function(U,q,Y){Y?(Y=Y.nextSibling,_(U)&&(U=U.parentNode),Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)):h.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||b(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&b(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&b(U.nextSibling)){var q=U.nextSibling;if(b(q)&&!h.a.g.get(q,G))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(M?U.text:U.nodeValue).match(F))?U[1]:null},Sc:function(U){if(V[h.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var Y;Y=q.firstChild;var Q=null;if(Y)do if(Q)Q.push(Y);else if(_(Y)){var W=I(Y,!0);W?Y=W:Q=[Y]}else b(Y)&&(Q=[Y]);while(Y=Y.nextSibling);if(Y=Q)for(Q=q.nextSibling,W=0;W<Y.length;W++)Q?U.insertBefore(Y[W],Q):U.appendChild(Y[W])}while(q=q.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_):null;return h.j.tc(v,_,b,!1)},getBindingAccessors:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_,{valueAccessors:!0}):null;return h.j.tc(v,_,b,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,b,v,I){try{var M=this.nd,F=_+(I&&I.valueAccessors||""),k;if(!(k=M[F])){var V,G="with($context){with($data||{}){return{"+h.m.vb(_,I)+"}}}";V=new Function("$context","$element",G),k=M[F]=V}return k(b,v)}catch(U){throw U.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,E){return _===null||typeof _ in x?_===E:!1}function u(_,E){var w;return function(){w||(w=h.a.setTimeout(function(){w=e,_()},E))}}function f(_,E){var w;return function(){clearTimeout(w),w=h.a.setTimeout(_,E)}}function d(_,E){E&&E!=="change"?E==="beforeChange"?this.pc(_):this.gb(_,E):this.qc(_)}function p(_,E){E!==null&&E.s&&E.s()}function g(_,E){var w=this.qd,D=w[S];D.ra||(this.Qb&&this.mb[E]?(w.uc(E,_,this.mb[E]),this.mb[E]=null,--this.Qb):D.I[E]||w.uc(E,_,D.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,E){for(var w=_.split("."),D=h,M=0;M<w.length-1;M++)D=D[w[M]];D[w[w.length-1]]=E},h.L=function(_,E,w){_[E]=w},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(W,K){for(var J in W)M.call(W,J)&&K(J,W[J])}function E(W,K){if(K)for(var J in K)M.call(K,J)&&(W[J]=K[J]);return W}function w(W,K){return W.__proto__=K,W}function D(W,K,J,he){var ge=W[K].match(j)||[];h.a.D(J.match(j),function(se){h.a.Na(ge,se,he)}),W[K]=ge.join(" ")}var M=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,V=typeof Symbol=="function",U={},G={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(U,function(W,K){if(K.length)for(var J=0,he=K.length;J<he;J++)G[K[J]]=W});var k={propertychange:!0},Y=n&&function(){for(var W=3,K=n.createElement("div"),J=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",J[0];);return 4<W?W:e}(),j=/\S+/g,$;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,J){for(var he=0,ge=W.length;he<ge;he++)K.call(J,W[he],he,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var J=0,he=W.length;J<he;J++)if(W[J]===K)return J;return-1},Lb:function(W,K,J){for(var he=0,ge=W.length;he<ge;he++)if(K.call(J,W[he],he,W))return W[he];return e},Pa:function(W,K){var J=h.a.A(W,K);0<J?W.splice(J,1):J===0&&W.shift()},wc:function(W){var K=[];return W&&h.a.D(W,function(J){0>h.a.A(K,J)&&K.push(J)}),K},Mb:function(W,K,J){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)he.push(K.call(J,W[ge],ge));return he},jb:function(W,K,J){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)K.call(J,W[ge],ge)&&he.push(W[ge]);return he},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var J=0,he=K.length;J<he;J++)W.push(K[J]);return W},Na:function(W,K,J){var he=h.a.A(h.a.bc(W),K);0>he?J&&W.push(K):J||W.splice(he,1)},Ba:B,extend:E,setPrototypeOf:w,Ab:B?w:E,P:_,Ga:function(W,K,J){if(!W)return W;var he={},ge;for(ge in W)M.call(W,ge)&&(he[ge]=K.call(J,W[ge],ge,W));return he},Tb:function(W){for(;W.firstChild;)h.removeNode(W.firstChild)},Yb:function(W){W=h.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),J=0,he=W.length;J<he;J++)K.appendChild(h.oa(W[J]));return K},Ca:function(W,K){for(var J=0,he=W.length,ge=[];J<he;J++){var se=W[J].cloneNode(!0);ge.push(K?h.oa(se):se)}return ge},va:function(W,K){if(h.a.Tb(W),K)for(var J=0,he=K.length;J<he;J++)W.appendChild(K[J])},Xc:function(W,K){var J=W.nodeType?[W]:W;if(0<J.length){for(var he=J[0],ge=he.parentNode,se=0,_e=K.length;se<_e;se++)ge.insertBefore(K[se],he);for(se=0,_e=J.length;se<_e;se++)h.removeNode(J[se])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var J=W[0],he=W[W.length-1];for(W.length=0;J!==he;)W.push(J),J=J.nextSibling;W.push(he)}}return W},Zc:function(W,K){7>Y?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return h.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!h.a.Lb(W,h.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return h.onError?function(){try{return W.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(h.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw h.onError&&h.onError(W),W},0)},B:function(W,K,J){var he=h.a.Ac(J);if(J=k[K],h.options.useOnlyNativeEvents||J||!o)if(J||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ge=function(_e){he.call(W,_e)},se="on"+K;W.attachEvent(se,ge),h.a.K.za(W,function(){W.detachEvent(se,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,he,!1);else $||($=typeof o(W).on=="function"?"on":"bind"),o(W)[$](K,he)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var J;if(h.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(J=W.type,J=J=="checkbox"||J=="radio"):J=!1,h.options.useOnlyNativeEvents||!o||J)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")J=n.createEvent(G[K]||"HTMLEvents"),J.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(J);else throw Error("The supplied element doesn't support dispatchEvent");else if(J&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(W).trigger(K)},f:function(W){return h.O(W)?W():W},bc:function(W){return h.O(W)?W.v():W},Eb:function(W,K,J){var he;K&&(typeof W.classList=="object"?(he=W.classList[J?"add":"remove"],h.a.D(K.match(j),function(ge){he.call(W.classList,ge)})):typeof W.className.baseVal=="string"?D(W.className,"baseVal",K,J):D(W,"className",K,J))},Bb:function(W,K){var J=h.a.f(K);(J===null||J===e)&&(J="");var he=h.h.firstChild(W);!he||he.nodeType!=3||h.h.nextSibling(he)?h.h.va(W,[W.ownerDocument.createTextNode(J)]):he.data=J,h.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=Y)try{var J=W.name.replace(/[&<>'"]/g,function(he){return"&#"+he.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+J+"'/>"),!1)}catch{}},Ad:function(W){9<=Y&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(Y){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=h.a.f(W),K=h.a.f(K);for(var J=[],he=W;he<=K;he++)J.push(he);return J},la:function(W){for(var K=[],J=0,he=W.length;J<he;J++)K.push(W[J]);return K},Da:function(W){return V?Symbol(W):W},Zd:Y===6,$d:Y===7,W:Y,Lc:function(W,K){for(var J=h.a.la(W.getElementsByTagName("input")).concat(h.a.la(W.getElementsByTagName("textarea"))),he=typeof K=="string"?function(_e){return _e.name===K}:function(_e){return K.test(_e.name)},ge=[],se=J.length-1;0<=se;se--)he(J[se])&&ge.push(J[se]);return ge},Nd:function(W){return typeof W=="string"&&(W=h.a.Db(W))?r&&r.parse?r.parse(W):new Function("return "+W)():null},hc:function(W,K,J){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(h.a.f(W),K,J)},Od:function(W,K,J){J=J||{};var he=J.params||{},ge=J.includeFields||this.Jc,se=W;if(typeof W=="object"&&h.a.R(W)==="form")for(var se=W.action,_e=ge.length-1;0<=_e;_e--)for(var xe=h.a.Lc(W,ge[_e]),Pe=xe.length-1;0<=Pe;Pe--)he[xe[Pe].name]=xe[Pe].value;K=h.a.f(K);var ve=n.createElement("form");ve.style.display="none",ve.action=se,ve.method="post";for(var we in K)W=n.createElement("input"),W.type="hidden",W.name=we,W.value=h.a.hc(h.a.f(K[we])),ve.appendChild(W);_(he,function(ze,Re){var dt=n.createElement("input");dt.type="hidden",dt.name=ze,dt.value=Re,ve.appendChild(dt)}),n.body.appendChild(ve),J.submitter?J.submitter(ve):ve.submit(),setTimeout(function(){ve.parentNode.removeChild(ve)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var E=this;if(arguments.length===1)return function(){return E.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var D=w.slice(0);return D.push.apply(D,arguments),E.apply(_,D)}}),h.a.g=new function(){var _=0,E="__ko__"+new Date().getTime(),w={},D,M;return h.a.W?(D=function(B,V){var U=B[E];if(!U||U==="null"||!w[U]){if(!V)return e;U=B[E]="ko"+_++,w[U]={}}return w[U]},M=function(B){var V=B[E];return V?(delete w[V],B[E]=null,!0):!1}):(D=function(B,V){var U=B[E];return!U&&V&&(U=B[E]={}),U},M=function(B){return B[E]?(delete B[E],!0):!1}),{get:function(B,V){var U=D(B,!1);return U&&U[V]},set:function(B,V,U){(B=D(B,U!==e))&&(B[V]=U)},Ub:function(B,V,U){return B=D(B,!0),B[V]||(B[V]=U)},clear:M,Z:function(){return _+++E}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(V,U){var G=h.a.g.get(V,D);return G===e&&U&&(G=[],h.a.g.set(V,D,G)),G}function E(V){var U=_(V,!1);if(U)for(var U=U.slice(0),G=0;G<U.length;G++)U[G](V);h.a.g.clear(V),h.a.K.cleanExternalData(V),B[V.nodeType]&&w(V.childNodes,!0)}function w(V,U){for(var G=[],k,Y=0;Y<V.length;Y++)if((!U||V[Y].nodeType===8)&&(E(G[G.length]=k=V[Y]),V[Y]!==k))for(;Y--&&h.a.A(G,V[Y])==-1;);}var D=h.a.g.Z(),M={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(V,U){if(typeof U!="function")throw Error("Callback must be a function");_(V,!0).push(U)},yb:function(V,U){var G=_(V,!1);G&&(h.a.Pa(G,U),G.length==0&&h.a.g.set(V,D,e))},oa:function(V){return h.u.G(function(){M[V.nodeType]&&(E(V),B[V.nodeType]&&w(V.getElementsByTagName("*")))}),V},removeNode:function(V){h.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){o&&typeof o.cleanData=="function"&&o.cleanData([V])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],E=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],D=[1,"<select multiple='multiple'>","</select>"],M={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:D,optgroup:D},B=8>=h.a.W;h.a.ua=function(V,U){var G;if(o){if(o.parseHTML)G=o.parseHTML(V,U)||[];else if((G=o.clean([V],U))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=U)||(G=n);var k=G.parentWindow||G.defaultView||t,Y=h.a.Db(V).toLowerCase(),j=G.createElement("div"),$;for($=(Y=Y.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[Y[1]]||_,Y=$[0],$="ignored<div>"+$[1]+V+$[2]+"</div>",typeof k.innerShiv=="function"?j.appendChild(k.innerShiv($)):(B&&G.body.appendChild(j),j.innerHTML=$,B&&j.parentNode.removeChild(j));Y--;)j=j.lastChild;G=h.a.la(j.lastChild.childNodes)}return G},h.a.Md=function(V,U){var G=h.a.ua(V,U);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(V,U){if(h.a.Tb(V),U=h.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(V).html(U);else for(var G=h.a.ua(U,V.ownerDocument),k=0;k<G.length;k++)V.appendChild(G[k])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(w,D){if(w){if(w.nodeType==8){var M=h.aa.Uc(w.nodeValue);M!=null&&D.push({ud:w,Kd:M})}else if(w.nodeType==1)for(var M=0,B=w.childNodes,V=B.length;M<V;M++)_(B[M],D)}}var E={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var D=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[D]=w,"<!--[ko_memo:"+D+"]-->"},bd:function(w,D){var M=E[w];if(M===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return M.apply(null,D||[]),!0}finally{delete E[w]}},cd:function(w,D){var M=[];_(w,M);for(var B=0,V=M.length;B<V;B++){var U=M[B].ud,G=[U];D&&h.a.Nb(G,D),h.aa.bd(M[B].Kd,G),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(M){for(var U=M,G=0,k;V<M;)if(k=D[V++]){if(V>U){if(5e3<=++G){V=M,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}U=M}try{k()}catch(Y){h.a.Gc(Y)}}}}function E(){_(),V=M=D.length=0}var w,D=[],M=0,B=1,V=0;return t.MutationObserver?w=function(U){var G=n.createElement("div");return new MutationObserver(U).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(E):w=n&&"onreadystatechange"in n.createElement("script")?function(U){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,U()},n.documentElement.appendChild(G)}:function(U){setTimeout(U,0)},{scheduler:w,zb:function(U){return M||h.na.scheduler(E),D[M++]=U,B++},cancel:function(U){U=U-(B-M),U>=V&&U<M&&(D[U]=null)},resetForTesting:function(){var U=M-V;return V=M=D.length=0,U},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,E){_.throttleEvaluation=E;var w=null;return h.$({read:_,write:function(D){clearTimeout(w),w=h.a.setTimeout(function(){_(D)},E)}})},rateLimit:function(_,E){var w,D,M;typeof E=="number"?w=E:(w=E.timeout,D=E.method),_.Hb=!1,M=typeof D=="function"?D:D=="notifyWhenChangesStop"?f:u,_.ub(function(B){return M(B,w,E)})},deferred:function(_,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var D,M=!1;return function(){if(!M){h.na.cancel(D),D=h.na.zb(w);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,E){_.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,E,w){this.da=_,this.lc=E,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,E,w){var D=this;w=w||"change";var M=new h.ic(D,E?_.bind(E):_,function(){h.a.Pa(D.U[w],M),D.hb&&D.hb(w)});return D.Qa&&D.Qa(w),D.U[w]||(D.U[w]=[]),D.U[w].push(M),M},notifySubscribers:function(_,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var w=E==="change"&&this.ed||this.U[E].slice(0);try{h.u.xc();for(var D=0,M;M=w[D];++D)M.Ib||M.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var E=this,w=h.O(E),D,M,B,V,U;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var G=_(function(){E.Ja=!1,w&&V===E&&(V=E.nc?E.nc():E());var k=M||U&&E.sb(B,V);U=M=D=!1,k&&E.gb(B=V)});E.qc=function(k,Y){Y&&E.Ja||(U=!Y),E.ed=E.U.change.slice(0),E.Ja=D=!0,V=k,G()},E.pc=function(k){D||(B=k,E.gb(k,"beforeChange"))},E.rc=function(){U=!0},E.gd=function(){E.sb(B,E.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var E=0;return h.a.P(this.U,function(w,D){w!=="dirty"&&(E+=D.length)}),E},sb:function(_,E){return!this.equalityComparer||!this.equalityComparer(_,E)},toString:function(){return"[object Object]"},extend:function(_){var E=this;return _&&h.a.P(_,function(w,D){var M=h.Ta[w];typeof M=="function"&&(E=M(E,D)||E)}),E}};h.L(b,"init",b.qb),h.L(b,"subscribe",b.subscribe),h.L(b,"extend",b.extend),h.L(b,"getSubscriptionsCount",b.Bd),h.a.Ba&&h.a.setPrototypeOf(b,Function.prototype),h.T.fn=b,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(B){w.push(D),D=B}function E(){D=w.pop()}var w=[],D,M=0;return{xc:_,end:E,cc:function(B){if(D){if(!h.Qc(B))throw Error("Only subscribable things can act as dependencies");D.od.call(D.pd,B,B.fd||(B.fd=++M))}},G:function(B,V,U){try{return _(),B.apply(V,U||[])}finally{E()}},qa:function(){if(D)return D.o.qa()},Va:function(){if(D)return D.o.Va()},Ya:function(){if(D)return D.Ya},o:function(){if(D)return D.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function E(){return 0<arguments.length?(E.sb(E[C],arguments[0])&&(E.ya(),E[C]=arguments[0],E.xa()),this):(h.u.cc(E),E[C])}return E[C]=_,h.a.Ba||h.a.extend(E,h.T.fn),h.T.fn.qb(E),h.a.Ab(E,T),h.options.deferUpdates&&h.Ta.deferred(E,!0),E};var T={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(T,h.T.fn);var A=h.ta.Ma="__ko_proto__";T[A]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[A])&&_!==T[A]&&_!==h.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[A]===T[A]||_[A]===h.o.fn[A]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",T),h.L(T,"peek",T.v),h.L(T,"valueHasMutated",T.xa),h.L(T,"valueWillMutate",T.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var E=this.v(),w=[],D=typeof _!="function"||h.O(_)?function(V){return V===_}:_,M=0;M<E.length;M++){var B=E[M];if(D(B)){if(w.length===0&&this.ya(),E[M]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),E.splice(M,1),M--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var E=this.v(),w=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),w}return _?this.remove(function(D){return 0<=h.a.A(_,D)}):[]},destroy:function(_){var E=this.v(),w=typeof _!="function"||h.O(_)?function(B){return B===_}:_;this.ya();for(var D=E.length-1;0<=D;D--){var M=E[D];w(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(E){return 0<=h.a.A(_,E)}):[]},indexOf:function(_){var E=this();return h.a.A(E,_)},replace:function(_,E){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=E,this.xa())},sorted:function(_){var E=this().slice(0);return _?E.sort(_):E.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var E=this.v();this.ya(),this.zc(E,_,arguments);var w=E[_].apply(E,arguments);return this.xa(),w===E?this:w}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var E=this();return E[_].apply(E,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,E){function w(){function j(){if(U){var $=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<U)&&(M=h.a.Pb(G,$,_.Ob)),W=M),G=$,M=null,U=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}D?j():(D=!0,V=_.subscribe(function(){++U},null,"spectate"),G=[].concat(_.v()||[]),M=null,B=_.subscribe(j))}if(_.Ob={},E&&typeof E=="object"&&h.a.extend(_.Ob,E),_.Ob.sparse=!0,!_.zc){var D=!1,M=null,B,V,U=0,G,k=_.Qa,Y=_.hb;_.Qa=function(j){k&&k.call(_,j),j==="arrayChange"&&w()},_.hb=function(j){Y&&Y.call(_,j),j!=="arrayChange"||_.Wa("arrayChange")||(B&&B.s(),V&&V.s(),V=B=null,D=!1,G=e)},_.zc=function(j,$,W){function K(ve,we,ze){return J[J.length]={status:ve,value:we,index:ze}}if(D&&!U){var J=[],he=j.length,ge=W.length,se=0;switch($){case"push":se=he;case"unshift":for($=0;$<ge;$++)K("added",W[$],se+$);break;case"pop":se=he-1;case"shift":he&&K("deleted",j[se],se);break;case"splice":$=Math.min(Math.max(0,0>W[0]?he+W[0]:W[0]),he);for(var he=ge===1?he:Math.min($+(W[1]||0),he),ge=$+ge-2,se=Math.max(he,ge),_e=[],xe=[],Pe=2;$<se;++$,++Pe)$<he&&xe.push(K("deleted",j[$],$)),$<ge&&_e.push(K("added",W[Pe],$));h.a.Kc(xe,_e);break;default:return}M=J}}}};var S=h.a.Da("_state");h.o=h.$=function(_,E,w){function D(){if(0<arguments.length){if(typeof M=="function")M.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||h.u.cc(D),(B.ka||B.J&&D.Xa())&&D.ha(),B.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:E||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return D[S]=B,D.Nc=typeof M=="function",h.a.Ba||h.a.extend(D,h.T.fn),h.T.fn.qb(D),h.a.Ab(D,v),w.pure?(B.wb=!0,B.J=!0,h.a.extend(D,I)):w.deferEvaluation&&h.a.extend(D,O),h.options.deferUpdates&&h.Ta.deferred(D,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||D.ha(),B.l&&D.ja()&&h.a.K.za(B.l,B.Rb=function(){D.s()}),D};var v={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(E,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[S].V)return!1;var E=this.Va();return h.a.A(E,_)!==-1?!0:!!h.a.Lb(E,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,E,w){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=w,w.Ka=this[S].V++,w.La=E.ob()},Xa:function(){var _,E,w=this[S].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(E=w[_],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var E=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){E.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,E=_.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},E)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var E=this[S],w=E.Sa,D=!1;if(!E.rb&&!E.ra){if(E.l&&!h.a.Sb(E.l)||w&&w()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{D=this.zd(_)}finally{E.rb=!1}return D}},zd:function(_){var E=this[S],D=!1,w=E.wb?e:!E.V,D={qd:this,mb:E.I,Qb:E.V};h.u.xc({pd:D,od:g,o:this,Ya:w}),E.I={},E.V=0;var M=this.yd(E,D);return E.V?D=this.sb(E.X,M):(this.s(),D=!0),D&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=M,this.notifySubscribers(E.X,"spectate"),!E.J&&_&&this.notifySubscribers(E.X),this.rc&&this.rc()),w&&this.notifySubscribers(E.X,"awake"),D},yd:function(_,E){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{h.u.end(),E.Qb&&!_.J&&h.a.P(E.mb,p),_.sa=_.ka=!1}},v:function(_){var E=this[S];return(E.ka&&(_||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(E,w){w.s&&w.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},I={Qa:function(_){var E=this,w=E[S];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||E.Xa())w.I=null,w.V=0,E.ha()&&E.Gb();else{var D=[];h.a.P(w.I,function(M,B){D[B.Ka]=M}),h.a.D(D,function(M,B){var V=w.I[M],U=E.$c(V.da);U.Ka=B,U.La=V.La,w.I[M]=U}),E.Xa()&&E.ha()&&E.Gb()}w.ra||E.notifySubscribers(w.X,"awake")}},hb:function(_){var E=this[S];E.ra||_!="change"||this.Wa("change")||(h.a.P(E.I,function(w,D){D.s&&(E.I[w]={da:D.da,Ka:D.Ka,La:D.La},D.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},O={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(v,h.T.fn);var R=h.ta.Ma;v[R]=h.o,h.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",v),h.L(v,"peek",v.v),h.L(v,"dispose",v.s),h.L(v,"isActive",v.ja),h.L(v,"getDependenciesCount",v.qa),h.L(v,"getDependencies",v.Va),h.xb=function(_,E){return typeof _=="function"?h.o(_,E,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,E))},h.b("pureComputed",h.xb),function(){function _(D,M,B){if(B=B||new w,D=M(D),typeof D!="object"||D===null||D===e||D instanceof RegExp||D instanceof Date||D instanceof String||D instanceof Number||D instanceof Boolean)return D;var V=D instanceof Array?[]:{};return B.save(D,V),E(D,function(U){var G=M(D[U]);switch(typeof G){case"boolean":case"number":case"string":case"function":V[U]=G;break;case"object":case"undefined":var k=B.get(G);V[U]=k!==e?k:_(G,M,B)}}),V}function E(D,M){if(D instanceof Array){for(var B=0;B<D.length;B++)M(B);typeof D.toJSON=="function"&&M("toJSON")}else for(B in D)M(B)}function w(){this.keys=[],this.values=[]}h.ad=function(D){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(D,function(M){for(var B=0;h.O(M)&&10>B;B++)M=M();return M})},h.toJSON=function(D,M,B){return D=h.ad(D),h.a.hc(D,M,B)},w.prototype={constructor:w,save:function(D,M){var B=h.a.A(this.keys,D);0<=B?this.values[B]=M:(this.keys.push(D),this.values.push(M))},get:function(D){return D=h.a.A(this.keys,D),0<=D?this.values[D]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,E,w){function D(M){var B=h.xb(_,w).extend({ma:"always"}),V=B.subscribe(function(U){U&&(V.s(),M(U))});return B.notifySubscribers(B.v()),V}return typeof Promise!="function"||E?D(E.bind(w)):new Promise(D)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,E,w){switch(h.a.R(_)){case"option":typeof E=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=E):(h.a.g.set(_,h.c.options.$b,E),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var D=-1,M=0,B=_.options.length,V;M<B;++M)if(V=h.w.M(_.options[M]),V==E||V===""&&E===e){D=M;break}(w||0<=D||E===e&&1<_.size)&&(_.selectedIndex=D,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=D},0));break;default:(E===null||E===e)&&(E=""),_.value=E}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(U){U=h.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=` +,`;var G=[],k=U.match(D),Y,j=[],$=0;if(1<k.length){for(var W=0,K;K=k[W];++W){var J=K.charCodeAt(0);if(J===44){if(0>=$){G.push(Y&&j.length?{key:Y,value:j.join("")}:{unknown:Y||j.join("")}),Y=$=0,j=[];continue}}else if(J===58){if(!$&&!Y&&j.length===1){Y=j.pop();continue}}else{if(J===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;J===47&&W&&1<K.length?(J=k[W-1].match(M))&&!B[J[0]]&&(U=U.substr(U.indexOf(K)+1),k=U.match(D),W=-1,K="/"):J===40||J===123||J===91?++$:J===41||J===125||J===93?--$:Y||j.length||J!==34&&J!==39||(K=K.slice(1,-1))}j.push(K)}if(0<$)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var E=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,D=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(U,G){function k(J,he){var ge;if(!W){var se=h.getBindingHandler(J);if(se&&se.preprocess&&!(he=se.preprocess(he,J,k)))return;(se=V[J])&&(ge=he,0<=h.a.A(E,ge)?ge=!1:(se=ge.match(w),ge=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ge),se=ge),se&&j.push("'"+(typeof V[J]=="string"?V[J]:J)+"':function(_z){"+ge+"=_z}")}$&&(he="function(){return "+he+" }"),Y.push("'"+J+"':"+he)}G=G||{};var Y=[],j=[],$=G.valueAccessors,W=G.bindingParams,K=typeof U=="string"?_(U):U;return h.a.D(K,function(J){k(J.key||J.unknown,J.value)}),j.length&&k("_ko_property_writers","{"+j.join(",")+" }"),Y.join(",")},Id:function(U,G){for(var k=0;k<U.length;k++)if(U[k].key==G)return!0;return!1},eb:function(U,G,k,Y,j){U&&h.O(U)?!h.Za(U)||j&&U.v()===Y||U(Y):(U=G.get("_ko_property_writers"))&&U[k]&&U[k](Y)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(k){return k.nodeType==8&&B.test(M?k.text:k.nodeValue)}function E(k){return k.nodeType==8&&V.test(M?k.text:k.nodeValue)}function w(k,Y){for(var j=k,$=1,W=[];j=j.nextSibling;){if(E(j)&&(h.a.g.set(j,G,!0),$--,$===0))return W;W.push(j),_(j)&&$++}if(!Y)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function D(k,Y){var j=w(k,Y);return j?0<j.length?j[j.length-1].nextSibling:k.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",B=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=h.h.childNodes(k);for(var Y=0,j=k.length;Y<j;Y++)h.removeNode(k[Y])}else h.a.Tb(k)},va:function(k,Y){if(_(k)){h.h.Ea(k);for(var j=k.nextSibling,$=0,W=Y.length;$<W;$++)j.parentNode.insertBefore(Y[$],j)}else h.a.va(k,Y)},Vc:function(k,Y){var j;_(k)?(j=k.nextSibling,k=k.parentNode):j=k.firstChild,j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)},Wb:function(k,Y,j){j?(j=j.nextSibling,_(k)&&(k=k.parentNode),j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)):h.h.Vc(k,Y)},firstChild:function(k){if(_(k))return!k.nextSibling||E(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&E(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=D(k)),k.nextSibling&&E(k.nextSibling)){var Y=k.nextSibling;if(E(Y)&&!h.a.g.get(Y,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(M?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(U[h.a.R(k)]){var Y=k.firstChild;if(Y)do if(Y.nodeType===1){var j;j=Y.firstChild;var $=null;if(j)do if($)$.push(j);else if(_(j)){var W=D(j,!0);W?j=W:$=[j]}else E(j)&&($=[j]);while(j=j.nextSibling);if(j=$)for($=Y.nextSibling,W=0;W<j.length;W++)$?k.insertBefore(j[W],$):k.appendChild(j[W])}while(Y=Y.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_):null;return h.j.tc(w,_,E,!1)},getBindingAccessors:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_,{valueAccessors:!0}):null;return h.j.tc(w,_,E,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,E,w,D){try{var M=this.nd,B=_+(D&&D.valueAccessors||""),V;if(!(V=M[B])){var U,G="with($context){with($data||{}){return{"+h.m.vb(_,D)+"}}}";U=new Function("$context","$element",G),V=M[B]=U}return V(E,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var _e=(se=h.a.g.get(se,ye))&&se.N;_e&&(se.N=null,_e.Tc())}function b(se,_e,xe){this.node=se,this.yc=_e,this.kb=[],this.H=!1,_e.N||h.a.K.za(se,_),xe&&xe.N&&(xe.N.kb.push(se),this.Kb=xe)}function v(se){return function(){return se}}function I(se){return se()}function M(se){return h.a.Ga(h.u.G(se),function(_e,xe){return function(){return se()[xe]}})}function F(se,_e,xe){return typeof se=="function"?M(se.bind(null,_e,xe)):h.a.Ga(se,v)}function k(se,_e){return M(this.getBindings.bind(this,se,_e))}function V(se,_e){var xe=h.h.firstChild(_e);if(xe){var De,Ee=h.ga.instance,Ne=Ee.preprocessNode;if(Ne){for(;De=xe;)xe=h.h.nextSibling(De),Ne.call(Ee,De);xe=h.h.firstChild(_e)}for(;De=xe;)xe=h.h.nextSibling(De),G(se,De)}h.i.ma(_e,h.i.H)}function G(se,_e){var xe=se,De=_e.nodeType===1;De&&h.h.Sc(_e),(De||h.ga.instance.nodeHasBindings(_e))&&(xe=q(_e,null,se).bindingContextForDescendants),xe&&!J[h.a.R(_e)]&&V(xe,_e)}function U(se){var _e=[],xe={},De=[];return h.a.P(se,function Ee(Ne){if(!xe[Ne]){var ke=h.getBindingHandler(Ne);ke&&(ke.after&&(De.push(Ne),h.a.D(ke.after,function(Re){if(se[Re]){if(h.a.A(De,Re)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ee(Re)}}),De.length--),_e.push({key:Ne,Mc:ke})),xe[Ne]=!0}}),_e}function q(se,_e,xe){var De=h.a.g.Ub(se,ye,{}),Ee=De.hd;if(!_e){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ee||(De.context=xe),De.Zb||(De.Zb={});var Ne;if(_e&&typeof _e!="function")Ne=_e;else{var ke=h.ga.instance,Re=ke.getBindingAccessors||k,dt=h.$(function(){return(Ne=_e?_e(xe,se):Re.call(ke,se,xe))&&(xe[Q]&&xe[Q](),xe[K]&&xe[K]()),Ne},null,{l:se});Ne&&dt.ja()||(dt=null)}var _t=xe,rt;if(Ne){var hn=function(){return h.a.Ga(dt?dt():Ne,I)},Rn=dt?function(Gt){return function(){return I(dt()[Gt])}}:function(Gt){return Ne[Gt]};hn.get=function(Gt){return Ne[Gt]&&I(Rn(Gt))},hn.has=function(Gt){return Gt in Ne},h.i.H in Ne&&h.i.subscribe(se,h.i.H,function(){var Gt=(0,Ne[h.i.H])();if(Gt){var Ut=h.h.childNodes(se);Ut.length&&Gt(Ut,h.Ec(Ut[0]))}}),h.i.pa in Ne&&(_t=h.i.Cb(se,xe),h.i.subscribe(se,h.i.pa,function(){var Gt=(0,Ne[h.i.pa])();Gt&&h.h.firstChild(se)&&Gt(se)})),De=U(Ne),h.a.D(De,function(Gt){var Ut=Gt.Mc.init,Te=Gt.Mc.update,Ae=Gt.key;if(se.nodeType===8&&!h.h.ea[Ae])throw Error("The binding '"+Ae+"' cannot be used with virtual elements");try{typeof Ut=="function"&&h.u.G(function(){var ut=Ut(se,Rn(Ae),hn,_t.$data,_t);if(ut&&ut.controlsDescendantBindings){if(rt!==e)throw Error("Multiple bindings ("+rt+" and "+Ae+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");rt=Ae}}),typeof Te=="function"&&h.$(function(){Te(se,Rn(Ae),hn,_t.$data,_t)},null,{l:se})}catch(ut){throw ut.message='Unable to process binding "'+Ae+": "+Ne[Ae]+`" -Message: `+ut.message,ut}})}return De=rt===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&_t}}function Y(se,_e){return se&&se instanceof h.fa?se:new h.fa(se,e,e,_e)}var Q=h.a.Da("_subscribable"),W=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var J={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var me={};h.fa=function(se,_e,xe,De,Ee){function Ne(){var Rn=_t?dt():dt,Gt=h.a.f(Rn);return _e?(h.a.extend(ke,_e),W in _e&&(ke[W]=_e[W])):(ke.$parents=[],ke.$root=Gt,ke.ko=h),ke[Q]=rt,Re?Gt=ke.$data:(ke.$rawData=Rn,ke.$data=Gt),xe&&(ke[xe]=Gt),De&&De(ke,_e,Gt),_e&&_e[Q]&&!h.S.o().Vb(_e[Q])&&_e[Q](),hn&&(ke[K]=hn),ke.$data}var ke=this,Re=se===me,dt=Re?e:se,_t=typeof dt=="function"&&!h.O(dt),rt,hn=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?Ne():(rt=h.xb(Ne),rt.v(),rt.ja()?rt.equalityComparer=null:ke[Q]=e)},h.fa.prototype.createChildContext=function(se,_e,xe,De){if(!De&&_e&&typeof _e=="object"&&(De=_e,_e=De.as,xe=De.extend),_e&&De&&De.noChildContext){var Ee=typeof se=="function"&&!h.O(se);return new h.fa(me,this,null,function(Ne){xe&&xe(Ne),Ne[_e]=Ee?se():se},De)}return new h.fa(se,this,_e,function(Ne,ke){Ne.$parentContext=ke,Ne.$parent=ke.$data,Ne.$parents=(ke.$parents||[]).slice(0),Ne.$parents.unshift(Ne.$parent),xe&&xe(Ne)},De)},h.fa.prototype.extend=function(se,_e){return new h.fa(me,this,null,function(xe){h.a.extend(xe,typeof se=="function"?se(xe):se)},_e)};var ye=h.a.g.Z();b.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},b.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},b.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,_e,xe,De,Ee){var Ne=h.a.g.Ub(se,ye,{});return Ne.Fa||(Ne.Fa=new h.T),Ee&&Ee.notifyImmediately&&Ne.Zb[_e]&&h.u.G(xe,De,[se]),Ne.Fa.subscribe(xe,De,_e)},ma:function(se,_e){var xe=h.a.g.get(se,ye);if(xe&&(xe.Zb[_e]=!0,xe.Fa&&xe.Fa.notifySubscribers(se,_e),_e==h.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,_e){var xe=h.a.g.Ub(se,ye,{});return xe.N||(xe.N=new b(se,xe,_e[W])),_e[W]==xe?_e:_e.extend(function(De){De[W]=xe})}},h.Td=function(se){return(se=h.a.g.get(se,ye))&&se.context},h.ib=function(se,_e,xe){return se.nodeType===1&&h.h.Sc(se),q(se,_e,Y(xe))},h.ld=function(se,_e,xe){return xe=Y(xe),h.ib(se,F(_e,xe,se),xe)},h.Oa=function(se,_e){_e.nodeType!==1&&_e.nodeType!==8||V(Y(se),_e)},h.vc=function(se,_e,xe){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(Y(se,xe),_e)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function b(k,V){var G=Object.prototype.hasOwnProperty.call(M,k)?M[k]:_,U;G?G.subscribe(V):(G=M[k]=new h.T,G.subscribe(V),v(k,function(q,Y){var Q=!(!Y||!Y.synchronous);F[k]={definition:q,Gd:Q},delete M[k],U||Q?G.notifySubscribers(q):h.na.zb(function(){G.notifySubscribers(q)})}),U=!0)}function v(k,V){I("getConfig",[k],function(G){G?I("loadComponent",[k,G],function(U){V(U,G)}):V(null,null)})}function I(k,V,G,U){U||(U=h.j.loaders.slice(0));var q=U.shift();if(q){var Y=q[k];if(Y){var Q=!1;if(Y.apply(q,V.concat(function(W){Q?G(null):W!==null?G(W):I(k,V,G,U)}))!==_&&(Q=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(k,V,G,U)}else G(null)}var M={},F={};h.j={get:function(k,V){var G=Object.prototype.hasOwnProperty.call(F,k)?F[k]:_;G?G.Gd?h.u.G(function(){V(G.definition)}):h.na.zb(function(){V(G.definition)}):b(k,V)},Bc:function(k){delete F[k]},oc:I},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,U,q,Y){function Q(){--K===0&&Y(W)}var W={},K=2,J=q.template;q=q.viewModel,J?M(U,J,function(me){h.j.oc("loadTemplate",[G,me],function(ye){W.template=ye,Q()})}):Q(),q?M(U,q,function(me){h.j.oc("loadViewModel",[G,me],function(ye){W[V]=ye,Q()})}):Q()}function b(G,U,q){if(typeof U=="function")q(function(Q){return new U(Q)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var Y=U.instance;q(function(){return Y})}else"viewModel"in U?b(G,U.viewModel,q):G("Unknown viewModel value: "+U)}function v(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(I(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function M(G,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),q(Y)}):G("Uses require, but no AMD loader is present"):q(U)}function F(G){return function(U){throw Error("Component '"+G+"': "+U)}}var k={};h.j.register=function(G,U){if(!U)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");k[G]=U},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(k,G)},h.j.unregister=function(G){delete k[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,U){U(h.j.tb(G)?k[G]:null)},loadComponent:function(G,U,q){var Y=F(G);M(Y,U,function(Q){_(G,Y,Q,q)})},loadTemplate:function(G,U,q){if(G=F(G),typeof U=="string")q(h.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(v(U));else if(typeof U=="string"){var Y=n.getElementById(U);Y?q(v(Y)):G("Cannot find element with ID "+U)}else G("Unknown element type: "+U);else G("Unknown template value: "+U)},loadViewModel:function(G,U,q){b(F(G),U,q)}};var V="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=k}(),function(){function _(v,I){var M=v.getAttribute("params");if(M){var M=b.parseBindingsString(M,I,v,{valueAccessors:!0,bindingParams:!0}),M=h.a.Ga(M,function(V){return h.o(V,null,{l:v})}),F=h.a.Ga(M,function(V){var G=V.v();return V.ja()?h.o({read:function(){return h.a.f(V())},write:h.Za(G)&&function(U){V()(U)},l:v}):G});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}h.j.getComponentNameForNode=function(v){var I=h.a.R(v);if(h.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=h.a.W&&v.tagName===I))return I},h.j.tc=function(v,I,M,F){if(I.nodeType===1){var k=h.j.getComponentNameForNode(I);if(k){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:k,params:_(I,M)};v.component=F?function(){return V}:V}}return v};var b=new h.ga;9>h.a.W&&(h.j.register=function(v){return function(I){return v.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(v){return function(){var I=v(),M=h.j.dd,F;for(F in M);return I}}(n.createDocumentFragment))}(),function(){function _(I,M,F){if(M=M.template,!M)throw Error("Component '"+I+"' has no template");I=h.a.Ca(M),h.h.va(F,I)}function b(I,M,F){var k=I.createViewModel;return k?k.call(I,M,F):M}var v=0;h.c.component={init:function(I,M,F,k,V){function G(){var W=U&&U.dispose;typeof W=="function"&&W.call(U),Y&&Y.s(),q=U=Y=null}var U,q,Y,Q=h.a.la(h.h.childNodes(I));return h.h.Ea(I),h.a.K.za(I,G),h.o(function(){var W=h.a.f(M()),K,J;if(typeof W=="string"?K=W:(K=h.a.f(W.name),J=h.a.f(W.params)),!K)throw Error("No component name specified");var me=h.i.Cb(I,V),ye=q=++v;h.j.get(K,function(se){if(q===ye){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,I);var _e=b(se,J,{element:I,templateNodes:Q});se=me.createChildContext(_e,{extend:function(xe){xe.$component=_e,xe.$componentTemplateNodes=Q}}),_e&&_e.koDescendantsComplete&&(Y=h.i.subscribe(I,h.i.pa,_e.koDescendantsComplete,_e)),U=_e,h.Oa(se,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};h.c.attr={update:function(_,b){var v=h.a.f(b())||{};h.a.P(v,function(I,M){M=h.a.f(M);var F=I.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(I.substr(0,F)),k=M===!1||M===null||M===e;k?F?_.removeAttributeNS(F,I):_.removeAttribute(I):M=M.toString(),8>=h.a.W&&I in L?(I=L[I],k?_.removeAttribute(I):_[I]=M):k||(F?_.setAttributeNS(F,I,M):_.setAttribute(I,M)),I==="name"&&h.a.Yc(_,k?"":M)})}},function(){h.c.checked={after:["value","attr"],init:function(_,b,v){function I(){var W=_.checked,K=F();if(!h.S.Ya()&&(W||!V&&!h.S.qa())){var J=h.u.G(b);if(U){var me=q?J.v():J,ye=Q;Q=K,ye!==K?W&&(h.a.Na(me,K,!0),h.a.Na(me,ye,!1)):h.a.Na(me,K,W),q&&h.Za(J)&&J(me)}else k&&(K===e?K=W:W||(K=e)),h.m.eb(J,v,"checked",K,!0)}}function M(){var W=h.a.f(b()),K=F();U?(_.checked=0<=h.a.A(W,K),Q=K):_.checked=k&&K===e?!!W:F()===W}var F=h.xb(function(){if(v.has("checkedValue"))return h.a.f(v.get("checkedValue"));if(Y)return v.has("value")?h.a.f(v.get("value")):_.value}),k=_.type=="checkbox",V=_.type=="radio";if(k||V){var G=b(),U=k&&h.a.f(G)instanceof Array,q=!(U&&G.push&&G.splice),Y=V||U,Q=U?F():e;V&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(I,null,{l:_}),h.a.B(_,"click",I),h.o(M,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,b){_.value=h.a.f(b())}}}(),h.c.class={update:function(_,b){var v=h.a.Db(h.a.f(b()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=v,h.a.Eb(_,v,!0)}},h.c.css={update:function(_,b){var v=h.a.f(b());v!==null&&typeof v=="object"?h.a.P(v,function(I,M){M=h.a.f(M),h.a.Eb(_,I,M)}):h.c.class.update(_,b)}},h.c.enable={update:function(_,b){var v=h.a.f(b());v&&_.disabled?_.removeAttribute("disabled"):v||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,b){h.c.enable.update(_,function(){return!h.a.f(b())})}},h.c.event={init:function(_,b,v,I,M){var F=b()||{};h.a.P(F,function(k){typeof k=="string"&&h.a.B(_,k,function(V){var G,U=b()[k];if(U){try{var q=h.a.la(arguments);I=M.$data,q.unshift(I),G=U.apply(I,q)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}v.get(k+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var b=_(),v=h.a.bc(b);return!v||typeof v.length=="number"?{foreach:b,templateEngine:h.ba.Ma}:(h.a.f(b),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:h.ba.Ma})}},init:function(_,b){return h.c.template.init(_,h.c.foreach.Rc(b))},update:function(_,b,v,I,M){return h.c.template.update(_,h.c.foreach.Rc(b),v,I,M)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,b,v){function I(k){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}k=G===_}V=b(),h.m.eb(V,v,"hasfocus",k,!0),_.__ko_hasfocusLastValue=k,_.__ko_hasfocusUpdating=!1}var M=I.bind(null,!0),F=I.bind(null,!1);h.a.B(_,"focus",M),h.a.B(_,"focusin",M),h.a.B(_,"blur",F),h.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,b){var v=!!h.a.f(b());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===v||(v?_.focus():_.blur(),!v&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,v?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.fc(_,b())}},function(){function _(b,v,I){h.c[b]={init:function(M,F,k,V,G){var U,q,Y={},Q,W,K;if(v){V=k.get("as");var J=k.get("noChildContext");K=!(V&&J),Y={as:V,noChildContext:J,exportDependencies:K}}return W=(Q=k.get("completeOn")=="render")||k.has(h.i.pa),h.o(function(){var me=h.a.f(F()),ye=!I!=!me,se=!q,_e;(K||ye!==U)&&(W&&(G=h.i.Cb(M,G)),ye&&((!v||K)&&(Y.dataDependency=h.S.o()),_e=v?G.createChildContext(typeof me=="function"?me:F,Y):h.S.qa()?G.extend(null,Y):G),se&&h.S.qa()&&(q=h.a.Ca(h.h.childNodes(M),!0)),ye?(se||h.h.va(M,h.a.Ca(q)),h.Oa(_e,M)):(h.h.Ea(M),Q||h.i.ma(M,h.i.H)),U=ye)},null,{l:M}),{controlsDescendantBindings:!0}}},h.m.Ra[b]=!1,h.h.ea[b]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,b,v,I,M){return b=M.extend(b),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var N={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,b,v){function I(){return h.a.jb(_.options,function(J){return J.selected})}function M(J,me,ye){var se=typeof me;return se=="function"?me(J):se=="string"?J[me]:ye}function F(J,me){if(W&&U)h.i.ma(_,h.i.H);else if(Q.length){var ye=0<=h.a.A(Q,h.w.M(me[0]));h.a.Zc(me[0],ye),W&&!ye&&h.u.G(h.a.Fb,null,[_,"change"])}}var k=_.multiple,V=_.length!=0&&k?_.scrollTop:null,G=h.a.f(b()),U=v.get("valueAllowUnset")&&v.has("value"),q=v.get("optionsIncludeDestroyed");b={};var Y,Q=[];U||(k?Q=h.a.Mb(I(),h.w.M):0<=_.selectedIndex&&Q.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),Y=h.a.jb(G,function(J){return q||J===e||J===null||!h.a.f(J._destroy)}),v.has("optionsCaption")&&(G=h.a.f(v.get("optionsCaption")),G!==null&&G!==e&&Y.unshift(N)));var W=!1;if(b.beforeRemove=function(J){_.removeChild(J)},G=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(G=function(J,me){F(0,me),h.u.G(v.get("optionsAfterRender"),null,[me[0],J!==N?J:e])}),h.a.ec(_,Y,function(J,me,ye){return ye.length&&(Q=!U&&ye[0].selected?[h.w.M(ye[0])]:[],W=!0),me=_.ownerDocument.createElement("option"),J===N?(h.a.Bb(me,v.get("optionsCaption")),h.w.cb(me,e)):(ye=M(J,v.get("optionsValue"),J),h.w.cb(me,h.a.f(ye)),J=M(J,v.get("optionsText"),ye),h.a.Bb(me,J)),[me]},b,G),!U){var K;k?K=Q.length&&I().length<Q.length:K=Q.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(U||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,b,v){function I(){var k=b(),V=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&V.push(h.w.M(G))}),h.m.eb(k,v,"selectedOptions",V)}function M(){var k=h.a.f(b()),V=_.scrollTop;k&&typeof k.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var U=0<=h.a.A(k,h.w.M(G));G.selected!=U&&h.a.Zc(G,U)}),_.scrollTop=V}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;h.i.subscribe(_,h.i.H,function(){F?I():(h.a.B(_,"change",I),F=h.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,b){var v=h.a.f(b()||{});h.a.P(v,function(I,M){if(M=h.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(I,M);else if(/^--/.test(I))_.style.setProperty(I,M);else{I=I.replace(/-(\w)/g,function(k,V){return V.toUpperCase()});var F=_.style[I];_.style[I]=M,M===F||_.style[I]!=F||isNaN(M)||(_.style[I]=M+"px")}})}},h.c.submit={init:function(_,b,v,I,M){if(typeof b()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(F){var k,V=b();try{k=V.call(M.$data,_)}finally{k!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.Bb(_,b())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(Y){if(Y)return parseFloat(Y[1])},b=t.navigator.userAgent,v,I,M,F,k;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(k=_(b.match(/Edge\/([^ ]+)$/)))||_(b.match(/Chrome\/([^ ]+)/))||(I=_(b.match(/Version\/([^ ]+) Safari/)))||(M=_(b.match(/Firefox\/([^ ]+)/)))||(F=h.a.W||_(b.match(/MSIE ([^ ]+)/)))||(F=_(b.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var V=h.a.g.Z(),G=h.a.g.Z(),U=function(Y){var Q=this.activeElement;(Q=Q&&h.a.g.get(Q,G))&&Q(Y)},q=function(Y,Q){var W=Y.ownerDocument;h.a.g.get(W,V)||(h.a.g.set(W,V,!0),h.a.B(W,"selectionchange",U)),h.a.g.set(Y,G,Q)};h.c.textInput={init:function(Y,Q,W){function K(Ne,ke){h.a.B(Y,Ne,ke)}function J(){var Ne=h.a.f(Q());(Ne===null||Ne===e)&&(Ne=""),xe!==e&&Ne===xe?h.a.setTimeout(J,4):Y.value!==Ne&&(Ee=!0,Y.value=Ne,Ee=!1,se=Y.value)}function me(){_e||(xe=Y.value,_e=h.a.setTimeout(ye,4))}function ye(){clearTimeout(_e),xe=_e=e;var Ne=Y.value;se!==Ne&&(se=Ne,h.m.eb(Q(),W,"textInput",Ne))}var se=Y.value,_e,xe,De=h.a.W==9?me:ye,Ee=!1;F&&K("keypress",ye),11>F&&K("propertychange",function(Ne){Ee||Ne.propertyName!=="value"||De(Ne)}),F==8&&(K("keyup",ye),K("keydown",ye)),q&&(q(Y,De),K("dragend",me)),(!F||9<=F)&&K("input",De),5>I&&h.a.R(Y)==="textarea"?(K("keydown",me),K("paste",me),K("cut",me)):11>v?K("keydown",me):4>M?(K("DOMAutoComplete",ye),K("dragdrop",ye),K("drop",ye)):k&&Y.type==="number"&&K("keydown",me),K("change",ye),K("blur",ye),h.o(J,null,{l:Y})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(Y,Q,W){W("textInput",Y)}}}(),h.c.uniqueName={init:function(_,b){if(b()){var v="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,v)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,b,v,I,M){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),b=M.createChildContext(b,F),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,b,v){var I=h.a.R(_),M=I=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],k=v.get("valueUpdate"),V=!1,G=null;k&&(typeof k=="string"?F=[k]:F=h.a.wc(k),h.a.Pa(F,"change"));var U=function(){G=null,V=!1;var Q=b(),W=h.w.M(_);h.m.eb(Q,v,"value",W)};!h.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(F,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){V=!0}),h.a.B(_,"focus",function(){V=!1}),h.a.B(_,"blur",function(){V&&U()})),h.a.D(F,function(Q){var W=U;h.a.Ud(Q,"after")&&(W=function(){G=h.w.M(_),h.a.setTimeout(U,0)},Q=Q.substring(5)),h.a.B(_,Q,W)});var q;if(q=M&&_.type=="file"?function(){var Q=h.a.f(b());Q===null||Q===e||Q===""?_.value="":h.u.G(U)}:function(){var Q=h.a.f(b()),W=h.w.M(_);G!==null&&Q===G?h.a.setTimeout(q,0):(Q!==W||W===e)&&(I==="select"?(W=v.get("valueAllowUnset"),h.w.cb(_,Q,W),W||Q===h.w.M(_)||h.u.G(U)):h.w.cb(_,Q))},I==="select"){var Y;h.i.subscribe(_,h.i.H,function(){Y?v.get("valueAllowUnset")?q():U():(h.a.B(_,"change",U),Y=h.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",U),h.o(q,null,{l:_})}else h.ib(_,{checkedValue:b})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,b){var v=h.a.f(b()),I=_.style.display!="none";v&&!I?_.style.display="":!v&&I&&(_.style.display="none")}},h.c.hidden={update:function(_,b){h.c.visible.update(_,function(){return!h.a.f(b())})}},function(_){h.c[_]={init:function(b,v,I,M,F){return h.c.event.init.call(this,b,function(){var k={};return k[_]=v(),k},I,M,F)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,b){if(typeof _=="string"){b=b||n;var v=b.getElementById(_);if(!v)throw Error("Cannot find template with ID "+_);return new h.C.F(v)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,b,v,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,b,v,I)},h.ca.prototype.isTemplateRewritten=function(_,b){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,b).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,b,v){_=this.makeTemplateSource(_,v),b=b(_.text()),_.text(b),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(I,M,F,k){I=h.m.ac(I);for(var V=h.m.Ra,G=0;G<I.length;G++){var U=I[G].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[G].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",k.createJavaScriptEvaluatorBlock(F)+M}var b=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,M,F){M.isTemplateRewritten(I,F)||M.rewriteTemplate(I,function(k){return h.kc.Ld(k,M)},F)},Ld:function(I,M){return I.replace(b,function(F,k,V,G,U){return _(U,k,V,M)}).replace(v,function(F,k){return _(k,"<!-- ko -->","#comment",M)})},md:function(I,M){return h.aa.Xb(function(F,k){var V=F.nextSibling;V&&V.nodeName.toLowerCase()===M&&h.ib(V,I,k)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(v){if(this.F=v){var I=h.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?h.a.fc(this.F,I):this.F[v]=I};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(v){if(arguments.length===1)return h.a.g.get(this.F,_+v);h.a.g.set(this.F,_+v,arguments[1])};var b=h.a.g.Z();h.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=h.a.g.get(v,b)||{},M=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!M||I.jd){var F=this.text();F&&F!==I.bb&&(M=h.a.Md(F,v.ownerDocument),h.a.g.set(v,b,{lb:M,bb:F,jd:!0}))}return M}I=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(v,b,{lb:I})},h.C.ia=function(v){this.F=v},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var v=h.a.g.get(this.F,b)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}h.a.g.set(this.F,b,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,U,q){var Y;for(U=h.h.nextSibling(U);G&&(Y=G)!==U;)G=h.h.nextSibling(Y),q(Y,G)}function b(G,U){if(G.length){var q=G[0],Y=G[G.length-1],Q=q.parentNode,W=h.ga.instance,K=W.preprocessNode;if(K){if(_(q,Y,function(J,me){var ye=J.previousSibling,se=K.call(W,J);se&&(J===q&&(q=se[0]||me),J===Y&&(Y=se[se.length-1]||ye))}),G.length=0,!q)return;q===Y?G.push(q):(G.push(q,Y),h.a.Ua(G,Q))}_(q,Y,function(J){J.nodeType!==1&&J.nodeType!==8||h.vc(U,J)}),_(q,Y,function(J){J.nodeType!==1&&J.nodeType!==8||h.aa.cd(J,[U])}),h.a.Ua(G,Q)}}function v(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,U,q,Y,Q){Q=Q||{};var W=(G&&v(G)||q||{}).ownerDocument,K=Q.templateEngine||F;if(h.kc.xd(q,K,W),q=K.renderTemplate(q,Y,Q,W),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,U){case"replaceChildren":h.h.va(G,q),W=!0;break;case"replaceNode":h.a.Xc(G,q),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return W&&(b(q,Y),Q.afterRender&&h.u.G(Q.afterRender,null,[q,Y[Q.as||"$data"]]),U=="replaceChildren"&&h.i.ma(G,h.i.H)),q}function M(G,U,q){return h.O(G)?G():typeof G=="function"?G(U,q):G}var F;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=G},h.dc=function(G,U,q,Y,Q){if(q=q||{},(q.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",Y){var W=v(Y);return h.$(function(){var J=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),K=M(G,J.$data,J),J=I(Y,Q,K,J,q);Q=="replaceNode"&&(Y=J,W=v(Y))},null,{Sa:function(){return!W||!h.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return h.aa.Xb(function(K){h.dc(G,U,q,K,"replaceNode")})},h.Qd=function(G,U,q,Y,Q){function W(xe,De){h.u.G(h.a.ec,null,[Y,xe,J,q,K,De]),h.i.ma(Y,h.i.H)}function K(xe,De){b(De,me),q.afterRender&&q.afterRender(De,xe),me=null}function J(xe,De){me=Q.createChildContext(xe,{as:ye,noChildContext:q.noChildContext,extend:function(Ne){Ne.$index=De,ye&&(Ne[ye+"Index"]=De)}});var Ee=M(G,xe,me);return I(Y,"ignoreTargetNode",Ee,me,q)}var me,ye=q.as,se=q.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!q.includeDestroyed;if(se||q.beforeRemove||!h.Pc(U))return h.$(function(){var xe=h.a.f(U)||[];typeof xe.length>"u"&&(xe=[xe]),se&&(xe=h.a.jb(xe,function(De){return De===e||De===null||!h.a.f(De._destroy)})),W(xe)},null,{l:Y});W(U.v());var _e=U.subscribe(function(xe){W(U(),xe)},null,"arrayChange");return _e.l(Y),_e};var k=h.a.g.Z(),V=h.a.g.Z();h.c.template={init:function(G,U){var q=h.a.f(U());if(typeof q=="string"||"name"in q)h.h.Ea(G);else if("nodes"in q){if(q=q.nodes||[],h.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=q[0]&&q[0].parentNode;Y&&h.a.g.get(Y,V)||(Y=h.a.Yb(q),h.a.g.set(Y,V,!0)),new h.C.ia(G).nodes(Y)}else if(q=h.h.childNodes(G),0<q.length)Y=h.a.Yb(q),new h.C.ia(G).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,U,q,Y,Q){var W=U();U=h.a.f(W),q=!0,Y=null,typeof U=="string"?U={}:(W="name"in U?U.name:G,"if"in U&&(q=h.a.f(U.if)),q&&"ifnot"in U&&(q=!h.a.f(U.ifnot)),q&&!W&&(q=!1)),"foreach"in U?Y=h.Qd(W,q&&U.foreach||[],U,G,Q):q?(q=Q,"data"in U&&(q=Q.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Y=h.dc(W,q,U,G)):h.h.Ea(G),Q=Y,(U=h.a.g.get(G,k))&&typeof U.s=="function"&&U.s(),h.a.g.set(G,k,!Q||Q.ja&&!Q.ja()?e:Q)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,b,v){if(_.length&&b.length){var I,M,F,k,V;for(I=M=0;(!v||I<v)&&(k=_[M]);++M){for(F=0;V=b[F];++F)if(k.value===V.value){k.moved=V.index,V.moved=k.index,b.splice(F,1),I=F=0;break}I+=F}}},h.a.Pb=function(){function _(b,v,I,M,F){var k=Math.min,V=Math.max,G=[],U,q=b.length,Y,Q=v.length,W=Q-q||1,K=q+Q+1,J,me,ye;for(U=0;U<=q;U++)for(me=J,G.push(J=[]),ye=k(Q,U+W),Y=V(0,U-1);Y<=ye;Y++)J[Y]=Y?U?b[U-1]===v[Y-1]?me[Y-1]:k(me[Y]||K,J[Y-1]||K)+1:Y+1:U+1;for(k=[],V=[],W=[],U=q,Y=Q;U||Y;)Q=G[U][Y]-1,Y&&Q===G[U][Y-1]?V.push(k[k.length]={status:I,value:v[--Y],index:Y}):U&&Q===G[U-1][Y]?W.push(k[k.length]={status:M,value:b[--U],index:U}):(--Y,--U,F.sparse||k.push({status:"retained",value:v[Y]}));return h.a.Kc(W,V,!F.dontLimitMoves&&10*q),k.reverse()}return function(b,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},b=b||[],v=v||[],b.length<v.length?_(b,v,"added","deleted",I):_(v,b,"deleted","added",I)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(I,M,F,k,V){var G=[],U=h.$(function(){var q=M(F,V,h.a.Ua(G,I))||[];0<G.length&&(h.a.Xc(G,q),k&&h.u.G(k,null,[F,q,V])),G.length=0,h.a.Nb(G,q)},null,{l:I,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:U.ja()?U:e}}var b=h.a.g.Z(),v=h.a.g.Z();h.a.ec=function(I,M,F,k,V,G){function U(Gt){Ee={Aa:Gt,pb:h.ta(me++)},K.push(Ee),W||De.push(Ee)}function q(Gt){Ee=Q[Gt],me!==Ee.pb.v()&&xe.push(Ee),Ee.pb(me++),h.a.Ua(Ee.Y,I),K.push(Ee)}function Y(Gt,Ut){if(Gt)for(var Te=0,Ae=Ut.length;Te<Ae;Te++)h.a.D(Ut[Te].Y,function(ut){Gt(ut,Te,Ut[Te].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),k=k||{};var Q=h.a.g.get(I,b),W=!Q,K=[],J=0,me=0,ye=[],se=[],_e=[],xe=[],De=[],Ee,Ne=0;if(W)h.a.D(M,U);else{if(!G||Q&&Q._countWaitingForRemove){var ke=h.a.Mb(Q,function(Gt){return Gt.Aa});G=h.a.Pb(ke,M,{dontLimitMoves:k.dontLimitMoves,sparse:!0})}for(var ke=0,Re,dt,_t;Re=G[ke];ke++)switch(dt=Re.moved,_t=Re.index,Re.status){case"deleted":for(;J<_t;)q(J++);dt===e&&(Ee=Q[J],Ee.$&&(Ee.$.s(),Ee.$=e),h.a.Ua(Ee.Y,I).length&&(k.beforeRemove&&(K.push(Ee),Ne++,Ee.Aa===v?Ee=null:_e.push(Ee)),Ee&&ye.push.apply(ye,Ee.Y))),J++;break;case"added":for(;me<_t;)q(J++);dt!==e?(se.push(K.length),q(dt)):U(Re.value)}for(;me<M.length;)q(J++);K._countWaitingForRemove=Ne}h.a.g.set(I,b,K),Y(k.beforeMove,xe),h.a.D(ye,k.beforeRemove?h.oa:h.removeNode);var rt,hn,Rn;try{Rn=I.ownerDocument.activeElement}catch{}if(se.length)for(;(ke=se.shift())!=e;){for(Ee=K[ke],rt=e;ke;)if((hn=K[--ke].Y)&&hn.length){rt=hn[hn.length-1];break}for(M=0;J=Ee.Y[M];rt=J,M++)h.h.Wb(I,J,rt)}for(ke=0;Ee=K[ke];ke++){for(Ee.Y||h.a.extend(Ee,_(I,F,Ee.Aa,V,Ee.pb)),M=0;J=Ee.Y[M];rt=J,M++)h.h.Wb(I,J,rt);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,rt=Ee.Y[Ee.Y.length-1])}for(Rn&&I.ownerDocument.activeElement!=Rn&&Rn.focus(),Y(k.beforeRemove,_e),ke=0;ke<_e.length;++ke)_e[ke].Aa=v;Y(k.afterMove,xe),Y(k.afterAdd,De)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,b,v,I){return(b=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(b.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,I))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var b=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(v,I,M,F){if(F=F||n,M=M||{},2>b)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var k=v.data("precompiled");return k||(k=v.text()||"",k=r.template(null,"{{ko_with $item.koBindingContext}}"+k+"{{/ko_with}}"),v.data("precompiled",k)),v=[I.$data],I=r.extend({koBindingContext:I},M.templateOptions),I=r.tmpl(k,v,I),I.appendTo(F.createElement("div")),r.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"<\/script>")},0<b&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var Pgt=ko;typeof window<"u"?(ko=window.ko,typeof f2<"u"?window.ko=f2:delete window.ko):(ko=global.ko,typeof f2<"u"?global.ko=f2:delete global.ko);var NC=Pgt;/** +Message: `+k.message,k}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var _e=(se=h.a.g.get(se,ge))&&se.N;_e&&(se.N=null,_e.Tc())}function E(se,_e,xe){this.node=se,this.yc=_e,this.kb=[],this.H=!1,_e.N||h.a.K.za(se,_),xe&&xe.N&&(xe.N.kb.push(se),this.Kb=xe)}function w(se){return function(){return se}}function D(se){return se()}function M(se){return h.a.Ga(h.u.G(se),function(_e,xe){return function(){return se()[xe]}})}function B(se,_e,xe){return typeof se=="function"?M(se.bind(null,_e,xe)):h.a.Ga(se,w)}function V(se,_e){return M(this.getBindings.bind(this,se,_e))}function U(se,_e){var xe=h.h.firstChild(_e);if(xe){var Pe,ve=h.ga.instance,we=ve.preprocessNode;if(we){for(;Pe=xe;)xe=h.h.nextSibling(Pe),we.call(ve,Pe);xe=h.h.firstChild(_e)}for(;Pe=xe;)xe=h.h.nextSibling(Pe),G(se,Pe)}h.i.ma(_e,h.i.H)}function G(se,_e){var xe=se,Pe=_e.nodeType===1;Pe&&h.h.Sc(_e),(Pe||h.ga.instance.nodeHasBindings(_e))&&(xe=Y(_e,null,se).bindingContextForDescendants),xe&&!J[h.a.R(_e)]&&U(xe,_e)}function k(se){var _e=[],xe={},Pe=[];return h.a.P(se,function ve(we){if(!xe[we]){var ze=h.getBindingHandler(we);ze&&(ze.after&&(Pe.push(we),h.a.D(ze.after,function(Re){if(se[Re]){if(h.a.A(Pe,Re)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));ve(Re)}}),Pe.length--),_e.push({key:we,Mc:ze})),xe[we]=!0}}),_e}function Y(se,_e,xe){var Pe=h.a.g.Ub(se,ge,{}),ve=Pe.hd;if(!_e){if(ve)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}ve||(Pe.context=xe),Pe.Zb||(Pe.Zb={});var we;if(_e&&typeof _e!="function")we=_e;else{var ze=h.ga.instance,Re=ze.getBindingAccessors||V,dt=h.$(function(){return(we=_e?_e(xe,se):Re.call(ze,se,xe))&&(xe[$]&&xe[$](),xe[K]&&xe[K]()),we},null,{l:se});we&&dt.ja()||(dt=null)}var Tt=xe,ot;if(we){var ln=function(){return h.a.Ga(dt?dt():we,D)},Dn=dt?function(Ht){return function(){return D(dt()[Ht])}}:function(Ht){return we[Ht]};ln.get=function(Ht){return we[Ht]&&D(Dn(Ht))},ln.has=function(Ht){return Ht in we},h.i.H in we&&h.i.subscribe(se,h.i.H,function(){var Ht=(0,we[h.i.H])();if(Ht){var kt=h.h.childNodes(se);kt.length&&Ht(kt,h.Ec(kt[0]))}}),h.i.pa in we&&(Tt=h.i.Cb(se,xe),h.i.subscribe(se,h.i.pa,function(){var Ht=(0,we[h.i.pa])();Ht&&h.h.firstChild(se)&&Ht(se)})),Pe=k(we),h.a.D(Pe,function(Ht){var kt=Ht.Mc.init,be=Ht.Mc.update,Ee=Ht.key;if(se.nodeType===8&&!h.h.ea[Ee])throw Error("The binding '"+Ee+"' cannot be used with virtual elements");try{typeof kt=="function"&&h.u.G(function(){var at=kt(se,Dn(Ee),ln,Tt.$data,Tt);if(at&&at.controlsDescendantBindings){if(ot!==e)throw Error("Multiple bindings ("+ot+" and "+Ee+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");ot=Ee}}),typeof be=="function"&&h.$(function(){be(se,Dn(Ee),ln,Tt.$data,Tt)},null,{l:se})}catch(at){throw at.message='Unable to process binding "'+Ee+": "+we[Ee]+`" +Message: `+at.message,at}})}return Pe=ot===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&Tt}}function j(se,_e){return se&&se instanceof h.fa?se:new h.fa(se,e,e,_e)}var $=h.a.Da("_subscribable"),W=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var J={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var he={};h.fa=function(se,_e,xe,Pe,ve){function we(){var Dn=Tt?dt():dt,Ht=h.a.f(Dn);return _e?(h.a.extend(ze,_e),W in _e&&(ze[W]=_e[W])):(ze.$parents=[],ze.$root=Ht,ze.ko=h),ze[$]=ot,Re?Ht=ze.$data:(ze.$rawData=Dn,ze.$data=Ht),xe&&(ze[xe]=Ht),Pe&&Pe(ze,_e,Ht),_e&&_e[$]&&!h.S.o().Vb(_e[$])&&_e[$](),ln&&(ze[K]=ln),ze.$data}var ze=this,Re=se===he,dt=Re?e:se,Tt=typeof dt=="function"&&!h.O(dt),ot,ln=ve&&ve.dataDependency;ve&&ve.exportDependencies?we():(ot=h.xb(we),ot.v(),ot.ja()?ot.equalityComparer=null:ze[$]=e)},h.fa.prototype.createChildContext=function(se,_e,xe,Pe){if(!Pe&&_e&&typeof _e=="object"&&(Pe=_e,_e=Pe.as,xe=Pe.extend),_e&&Pe&&Pe.noChildContext){var ve=typeof se=="function"&&!h.O(se);return new h.fa(he,this,null,function(we){xe&&xe(we),we[_e]=ve?se():se},Pe)}return new h.fa(se,this,_e,function(we,ze){we.$parentContext=ze,we.$parent=ze.$data,we.$parents=(ze.$parents||[]).slice(0),we.$parents.unshift(we.$parent),xe&&xe(we)},Pe)},h.fa.prototype.extend=function(se,_e){return new h.fa(he,this,null,function(xe){h.a.extend(xe,typeof se=="function"?se(xe):se)},_e)};var ge=h.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,_e,xe,Pe,ve){var we=h.a.g.Ub(se,ge,{});return we.Fa||(we.Fa=new h.T),ve&&ve.notifyImmediately&&we.Zb[_e]&&h.u.G(xe,Pe,[se]),we.Fa.subscribe(xe,Pe,_e)},ma:function(se,_e){var xe=h.a.g.get(se,ge);if(xe&&(xe.Zb[_e]=!0,xe.Fa&&xe.Fa.notifySubscribers(se,_e),_e==h.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,_e){var xe=h.a.g.Ub(se,ge,{});return xe.N||(xe.N=new E(se,xe,_e[W])),_e[W]==xe?_e:_e.extend(function(Pe){Pe[W]=xe})}},h.Td=function(se){return(se=h.a.g.get(se,ge))&&se.context},h.ib=function(se,_e,xe){return se.nodeType===1&&h.h.Sc(se),Y(se,_e,j(xe))},h.ld=function(se,_e,xe){return xe=j(xe),h.ib(se,B(_e,xe,se),xe)},h.Oa=function(se,_e){_e.nodeType!==1&&_e.nodeType!==8||U(j(se),_e)},h.vc=function(se,_e,xe){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(j(se,xe),_e)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function E(V,U){var G=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;G?G.subscribe(U):(G=M[V]=new h.T,G.subscribe(U),w(V,function(Y,j){var $=!(!j||!j.synchronous);B[V]={definition:Y,Gd:$},delete M[V],k||$?G.notifySubscribers(Y):h.na.zb(function(){G.notifySubscribers(Y)})}),k=!0)}function w(V,U){D("getConfig",[V],function(G){G?D("loadComponent",[V,G],function(k){U(k,G)}):U(null,null)})}function D(V,U,G,k){k||(k=h.j.loaders.slice(0));var Y=k.shift();if(Y){var j=Y[V];if(j){var $=!1;if(j.apply(Y,U.concat(function(W){$?G(null):W!==null?G(W):D(V,U,G,k)}))!==_&&($=!0,!Y.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else D(V,U,G,k)}else G(null)}var M={},B={};h.j={get:function(V,U){var G=Object.prototype.hasOwnProperty.call(B,V)?B[V]:_;G?G.Gd?h.u.G(function(){U(G.definition)}):h.na.zb(function(){U(G.definition)}):E(V,U)},Bc:function(V){delete B[V]},oc:D},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,k,Y,j){function $(){--K===0&&j(W)}var W={},K=2,J=Y.template;Y=Y.viewModel,J?M(k,J,function(he){h.j.oc("loadTemplate",[G,he],function(ge){W.template=ge,$()})}):$(),Y?M(k,Y,function(he){h.j.oc("loadViewModel",[G,he],function(ge){W[U]=ge,$()})}):$()}function E(G,k,Y){if(typeof k=="function")Y(function($){return new k($)});else if(typeof k[U]=="function")Y(k[U]);else if("instance"in k){var j=k.instance;Y(function(){return j})}else"viewModel"in k?E(G,k.viewModel,Y):G("Unknown viewModel value: "+k)}function w(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(D(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function D(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function M(G,k,Y){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(j){j&&typeof j=="object"&&j.Xd&&j.default&&(j=j.default),Y(j)}):G("Uses require, but no AMD loader is present"):Y(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var V={};h.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");V[G]=k},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(V,G)},h.j.unregister=function(G){delete V[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,k){k(h.j.tb(G)?V[G]:null)},loadComponent:function(G,k,Y){var j=B(G);M(j,k,function($){_(G,j,$,Y)})},loadTemplate:function(G,k,Y){if(G=B(G),typeof k=="string")Y(h.a.ua(k));else if(k instanceof Array)Y(k);else if(D(k))Y(h.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)Y(w(k));else if(typeof k=="string"){var j=n.getElementById(k);j?Y(w(j)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,Y){E(B(G),k,Y)}};var U="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=V}(),function(){function _(w,D){var M=w.getAttribute("params");if(M){var M=E.parseBindingsString(M,D,w,{valueAccessors:!0,bindingParams:!0}),M=h.a.Ga(M,function(U){return h.o(U,null,{l:w})}),B=h.a.Ga(M,function(U){var G=U.v();return U.ja()?h.o({read:function(){return h.a.f(U())},write:h.Za(G)&&function(k){U()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=M),B}return{$raw:{}}}h.j.getComponentNameForNode=function(w){var D=h.a.R(w);if(h.j.tb(D)&&(D.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=h.a.W&&w.tagName===D))return D},h.j.tc=function(w,D,M,B){if(D.nodeType===1){var V=h.j.getComponentNameForNode(D);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:V,params:_(D,M)};w.component=B?function(){return U}:U}}return w};var E=new h.ga;9>h.a.W&&(h.j.register=function(w){return function(D){return w.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(w){return function(){var D=w(),M=h.j.dd,B;for(B in M);return D}}(n.createDocumentFragment))}(),function(){function _(D,M,B){if(M=M.template,!M)throw Error("Component '"+D+"' has no template");D=h.a.Ca(M),h.h.va(B,D)}function E(D,M,B){var V=D.createViewModel;return V?V.call(D,M,B):M}var w=0;h.c.component={init:function(D,M,B,V,U){function G(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),j&&j.s(),Y=k=j=null}var k,Y,j,$=h.a.la(h.h.childNodes(D));return h.h.Ea(D),h.a.K.za(D,G),h.o(function(){var W=h.a.f(M()),K,J;if(typeof W=="string"?K=W:(K=h.a.f(W.name),J=h.a.f(W.params)),!K)throw Error("No component name specified");var he=h.i.Cb(D,U),ge=Y=++w;h.j.get(K,function(se){if(Y===ge){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,D);var _e=E(se,J,{element:D,templateNodes:$});se=he.createChildContext(_e,{extend:function(xe){xe.$component=_e,xe.$componentTemplateNodes=$}}),_e&&_e.koDescendantsComplete&&(j=h.i.subscribe(D,h.i.pa,_e.koDescendantsComplete,_e)),k=_e,h.Oa(se,D)}})},null,{l:D}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var N={class:"className",for:"htmlFor"};h.c.attr={update:function(_,E){var w=h.a.f(E())||{};h.a.P(w,function(D,M){M=h.a.f(M);var B=D.indexOf(":"),B="lookupNamespaceURI"in _&&0<B&&_.lookupNamespaceURI(D.substr(0,B)),V=M===!1||M===null||M===e;V?B?_.removeAttributeNS(B,D):_.removeAttribute(D):M=M.toString(),8>=h.a.W&&D in N?(D=N[D],V?_.removeAttribute(D):_[D]=M):V||(B?_.setAttributeNS(B,D,M):_.setAttribute(D,M)),D==="name"&&h.a.Yc(_,V?"":M)})}},function(){h.c.checked={after:["value","attr"],init:function(_,E,w){function D(){var W=_.checked,K=B();if(!h.S.Ya()&&(W||!U&&!h.S.qa())){var J=h.u.G(E);if(k){var he=Y?J.v():J,ge=$;$=K,ge!==K?W&&(h.a.Na(he,K,!0),h.a.Na(he,ge,!1)):h.a.Na(he,K,W),Y&&h.Za(J)&&J(he)}else V&&(K===e?K=W:W||(K=e)),h.m.eb(J,w,"checked",K,!0)}}function M(){var W=h.a.f(E()),K=B();k?(_.checked=0<=h.a.A(W,K),$=K):_.checked=V&&K===e?!!W:B()===W}var B=h.xb(function(){if(w.has("checkedValue"))return h.a.f(w.get("checkedValue"));if(j)return w.has("value")?h.a.f(w.get("value")):_.value}),V=_.type=="checkbox",U=_.type=="radio";if(V||U){var G=E(),k=V&&h.a.f(G)instanceof Array,Y=!(k&&G.push&&G.splice),j=U||k,$=k?B():e;U&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(D,null,{l:_}),h.a.B(_,"click",D),h.o(M,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,E){_.value=h.a.f(E())}}}(),h.c.class={update:function(_,E){var w=h.a.Db(h.a.f(E()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,h.a.Eb(_,w,!0)}},h.c.css={update:function(_,E){var w=h.a.f(E());w!==null&&typeof w=="object"?h.a.P(w,function(D,M){M=h.a.f(M),h.a.Eb(_,D,M)}):h.c.class.update(_,E)}},h.c.enable={update:function(_,E){var w=h.a.f(E());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,E){h.c.enable.update(_,function(){return!h.a.f(E())})}},h.c.event={init:function(_,E,w,D,M){var B=E()||{};h.a.P(B,function(V){typeof V=="string"&&h.a.B(_,V,function(U){var G,k=E()[V];if(k){try{var Y=h.a.la(arguments);D=M.$data,Y.unshift(D),G=k.apply(D,Y)}finally{G!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}w.get(V+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var E=_(),w=h.a.bc(E);return!w||typeof w.length=="number"?{foreach:E,templateEngine:h.ba.Ma}:(h.a.f(E),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:h.ba.Ma})}},init:function(_,E){return h.c.template.init(_,h.c.foreach.Rc(E))},update:function(_,E,w,D,M){return h.c.template.update(_,h.c.foreach.Rc(E),w,D,M)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,E,w){function D(V){_.__ko_hasfocusUpdating=!0;var U=_.ownerDocument;if("activeElement"in U){var G;try{G=U.activeElement}catch{G=U.body}V=G===_}U=E(),h.m.eb(U,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=D.bind(null,!0),B=D.bind(null,!1);h.a.B(_,"focus",M),h.a.B(_,"focusin",M),h.a.B(_,"blur",B),h.a.B(_,"focusout",B),_.__ko_hasfocusLastValue=!1},update:function(_,E){var w=!!h.a.f(E());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,w?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.fc(_,E())}},function(){function _(E,w,D){h.c[E]={init:function(M,B,V,U,G){var k,Y,j={},$,W,K;if(w){U=V.get("as");var J=V.get("noChildContext");K=!(U&&J),j={as:U,noChildContext:J,exportDependencies:K}}return W=($=V.get("completeOn")=="render")||V.has(h.i.pa),h.o(function(){var he=h.a.f(B()),ge=!D!=!he,se=!Y,_e;(K||ge!==k)&&(W&&(G=h.i.Cb(M,G)),ge&&((!w||K)&&(j.dataDependency=h.S.o()),_e=w?G.createChildContext(typeof he=="function"?he:B,j):h.S.qa()?G.extend(null,j):G),se&&h.S.qa()&&(Y=h.a.Ca(h.h.childNodes(M),!0)),ge?(se||h.h.va(M,h.a.Ca(Y)),h.Oa(_e,M)):(h.h.Ea(M),$||h.i.ma(M,h.i.H)),k=ge)},null,{l:M}),{controlsDescendantBindings:!0}}},h.m.Ra[E]=!1,h.h.ea[E]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,E,w,D,M){return E=M.extend(E),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var F={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,E,w){function D(){return h.a.jb(_.options,function(J){return J.selected})}function M(J,he,ge){var se=typeof he;return se=="function"?he(J):se=="string"?J[he]:ge}function B(J,he){if(W&&k)h.i.ma(_,h.i.H);else if($.length){var ge=0<=h.a.A($,h.w.M(he[0]));h.a.Zc(he[0],ge),W&&!ge&&h.u.G(h.a.Fb,null,[_,"change"])}}var V=_.multiple,U=_.length!=0&&V?_.scrollTop:null,G=h.a.f(E()),k=w.get("valueAllowUnset")&&w.has("value"),Y=w.get("optionsIncludeDestroyed");E={};var j,$=[];k||(V?$=h.a.Mb(D(),h.w.M):0<=_.selectedIndex&&$.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),j=h.a.jb(G,function(J){return Y||J===e||J===null||!h.a.f(J._destroy)}),w.has("optionsCaption")&&(G=h.a.f(w.get("optionsCaption")),G!==null&&G!==e&&j.unshift(F)));var W=!1;if(E.beforeRemove=function(J){_.removeChild(J)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(J,he){B(0,he),h.u.G(w.get("optionsAfterRender"),null,[he[0],J!==F?J:e])}),h.a.ec(_,j,function(J,he,ge){return ge.length&&($=!k&&ge[0].selected?[h.w.M(ge[0])]:[],W=!0),he=_.ownerDocument.createElement("option"),J===F?(h.a.Bb(he,w.get("optionsCaption")),h.w.cb(he,e)):(ge=M(J,w.get("optionsValue"),J),h.w.cb(he,h.a.f(ge)),J=M(J,w.get("optionsText"),ge),h.a.Bb(he,J)),[he]},E,G),!k){var K;V?K=$.length&&D().length<$.length:K=$.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==$[0]:$.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(k||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),U&&20<Math.abs(U-_.scrollTop)&&(_.scrollTop=U)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,E,w){function D(){var V=E(),U=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&U.push(h.w.M(G))}),h.m.eb(V,w,"selectedOptions",U)}function M(){var V=h.a.f(E()),U=_.scrollTop;V&&typeof V.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var k=0<=h.a.A(V,h.w.M(G));G.selected!=k&&h.a.Zc(G,k)}),_.scrollTop=U}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;h.i.subscribe(_,h.i.H,function(){B?D():(h.a.B(_,"change",D),B=h.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,E){var w=h.a.f(E()||{});h.a.P(w,function(D,M){if(M=h.a.f(M),(M===null||M===e||M===!1)&&(M=""),o)o(_).css(D,M);else if(/^--/.test(D))_.style.setProperty(D,M);else{D=D.replace(/-(\w)/g,function(V,U){return U.toUpperCase()});var B=_.style[D];_.style[D]=M,M===B||_.style[D]!=B||isNaN(M)||(_.style[D]=M+"px")}})}},h.c.submit={init:function(_,E,w,D,M){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(B){var V,U=E();try{V=U.call(M.$data,_)}finally{V!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.Bb(_,E())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(j){if(j)return parseFloat(j[1])},E=t.navigator.userAgent,w,D,M,B,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(E.match(/Edge\/([^ ]+)$/)))||_(E.match(/Chrome\/([^ ]+)/))||(D=_(E.match(/Version\/([^ ]+) Safari/)))||(M=_(E.match(/Firefox\/([^ ]+)/)))||(B=h.a.W||_(E.match(/MSIE ([^ ]+)/)))||(B=_(E.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var U=h.a.g.Z(),G=h.a.g.Z(),k=function(j){var $=this.activeElement;($=$&&h.a.g.get($,G))&&$(j)},Y=function(j,$){var W=j.ownerDocument;h.a.g.get(W,U)||(h.a.g.set(W,U,!0),h.a.B(W,"selectionchange",k)),h.a.g.set(j,G,$)};h.c.textInput={init:function(j,$,W){function K(we,ze){h.a.B(j,we,ze)}function J(){var we=h.a.f($());(we===null||we===e)&&(we=""),xe!==e&&we===xe?h.a.setTimeout(J,4):j.value!==we&&(ve=!0,j.value=we,ve=!1,se=j.value)}function he(){_e||(xe=j.value,_e=h.a.setTimeout(ge,4))}function ge(){clearTimeout(_e),xe=_e=e;var we=j.value;se!==we&&(se=we,h.m.eb($(),W,"textInput",we))}var se=j.value,_e,xe,Pe=h.a.W==9?he:ge,ve=!1;B&&K("keypress",ge),11>B&&K("propertychange",function(we){ve||we.propertyName!=="value"||Pe(we)}),B==8&&(K("keyup",ge),K("keydown",ge)),Y&&(Y(j,Pe),K("dragend",he)),(!B||9<=B)&&K("input",Pe),5>D&&h.a.R(j)==="textarea"?(K("keydown",he),K("paste",he),K("cut",he)):11>w?K("keydown",he):4>M?(K("DOMAutoComplete",ge),K("dragdrop",ge),K("drop",ge)):V&&j.type==="number"&&K("keydown",he),K("change",ge),K("blur",ge),h.o(J,null,{l:j})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(j,$,W){W("textInput",j)}}}(),h.c.uniqueName={init:function(_,E){if(E()){var w="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,w)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,E,w,D,M){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),E=M.createChildContext(E,B),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,E,w){var D=h.a.R(_),M=D=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var B=[],V=w.get("valueUpdate"),U=!1,G=null;V&&(typeof V=="string"?B=[V]:B=h.a.wc(V),h.a.Pa(B,"change"));var k=function(){G=null,U=!1;var $=E(),W=h.w.M(_);h.m.eb($,w,"value",W)};!h.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(B,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){U=!0}),h.a.B(_,"focus",function(){U=!1}),h.a.B(_,"blur",function(){U&&k()})),h.a.D(B,function($){var W=k;h.a.Ud($,"after")&&(W=function(){G=h.w.M(_),h.a.setTimeout(k,0)},$=$.substring(5)),h.a.B(_,$,W)});var Y;if(Y=M&&_.type=="file"?function(){var $=h.a.f(E());$===null||$===e||$===""?_.value="":h.u.G(k)}:function(){var $=h.a.f(E()),W=h.w.M(_);G!==null&&$===G?h.a.setTimeout(Y,0):($!==W||W===e)&&(D==="select"?(W=w.get("valueAllowUnset"),h.w.cb(_,$,W),W||$===h.w.M(_)||h.u.G(k)):h.w.cb(_,$))},D==="select"){var j;h.i.subscribe(_,h.i.H,function(){j?w.get("valueAllowUnset")?Y():k():(h.a.B(_,"change",k),j=h.o(Y,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",k),h.o(Y,null,{l:_})}else h.ib(_,{checkedValue:E})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,E){var w=h.a.f(E()),D=_.style.display!="none";w&&!D?_.style.display="":!w&&D&&(_.style.display="none")}},h.c.hidden={update:function(_,E){h.c.visible.update(_,function(){return!h.a.f(E())})}},function(_){h.c[_]={init:function(E,w,D,M,B){return h.c.event.init.call(this,E,function(){var V={};return V[_]=w(),V},D,M,B)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,E){if(typeof _=="string"){E=E||n;var w=E.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new h.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,E,w,D){return _=this.makeTemplateSource(_,D),this.renderTemplateSource(_,E,w,D)},h.ca.prototype.isTemplateRewritten=function(_,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,E).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,E,w){_=this.makeTemplateSource(_,w),E=E(_.text()),_.text(E),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(D,M,B,V){D=h.m.ac(D);for(var U=h.m.Ra,G=0;G<D.length;G++){var k=D[G].key;if(Object.prototype.hasOwnProperty.call(U,k)){var Y=U[k];if(typeof Y=="function"){if(k=Y(D[G].value))throw Error(k)}else if(!Y)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(D,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(B)+M}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(D,M,B){M.isTemplateRewritten(D,B)||M.rewriteTemplate(D,function(V){return h.kc.Ld(V,M)},B)},Ld:function(D,M){return D.replace(E,function(B,V,U,G,k){return _(k,V,U,M)}).replace(w,function(B,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(D,M){return h.aa.Xb(function(B,V){var U=B.nextSibling;U&&U.nodeName.toLowerCase()===M&&h.ib(U,D,V)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(w){if(this.F=w){var D=h.a.R(w);this.ab=D==="script"?1:D==="textarea"?2:D=="template"&&w.content&&w.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var D=arguments[0];w==="innerHTML"?h.a.fc(this.F,D):this.F[w]=D};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(w){if(arguments.length===1)return h.a.g.get(this.F,_+w);h.a.g.set(this.F,_+w,arguments[1])};var E=h.a.g.Z();h.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var D=h.a.g.get(w,E)||{},M=D.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||D.jd){var B=this.text();B&&B!==D.bb&&(M=h.a.Md(B,w.ownerDocument),h.a.g.set(w,E,{lb:M,bb:B,jd:!0}))}return M}D=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(w,E,{lb:D})},h.C.ia=function(w){this.F=w},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var w=h.a.g.get(this.F,E)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}h.a.g.set(this.F,E,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,k,Y){var j;for(k=h.h.nextSibling(k);G&&(j=G)!==k;)G=h.h.nextSibling(j),Y(j,G)}function E(G,k){if(G.length){var Y=G[0],j=G[G.length-1],$=Y.parentNode,W=h.ga.instance,K=W.preprocessNode;if(K){if(_(Y,j,function(J,he){var ge=J.previousSibling,se=K.call(W,J);se&&(J===Y&&(Y=se[0]||he),J===j&&(j=se[se.length-1]||ge))}),G.length=0,!Y)return;Y===j?G.push(Y):(G.push(Y,j),h.a.Ua(G,$))}_(Y,j,function(J){J.nodeType!==1&&J.nodeType!==8||h.vc(k,J)}),_(Y,j,function(J){J.nodeType!==1&&J.nodeType!==8||h.aa.cd(J,[k])}),h.a.Ua(G,$)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function D(G,k,Y,j,$){$=$||{};var W=(G&&w(G)||Y||{}).ownerDocument,K=$.templateEngine||B;if(h.kc.xd(Y,K,W),Y=K.renderTemplate(Y,j,$,W),typeof Y.length!="number"||0<Y.length&&typeof Y[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":h.h.va(G,Y),W=!0;break;case"replaceNode":h.a.Xc(G,Y),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(E(Y,j),$.afterRender&&h.u.G($.afterRender,null,[Y,j[$.as||"$data"]]),k=="replaceChildren"&&h.i.ma(G,h.i.H)),Y}function M(G,k,Y){return h.O(G)?G():typeof G=="function"?G(k,Y):G}var B;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},h.dc=function(G,k,Y,j,$){if(Y=Y||{},(Y.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if($=$||"replaceChildren",j){var W=w(j);return h.$(function(){var J=k&&k instanceof h.fa?k:new h.fa(k,null,null,null,{exportDependencies:!0}),K=M(G,J.$data,J),J=D(j,$,K,J,Y);$=="replaceNode"&&(j=J,W=w(j))},null,{Sa:function(){return!W||!h.a.Sb(W)},l:W&&$=="replaceNode"?W.parentNode:W})}return h.aa.Xb(function(K){h.dc(G,k,Y,K,"replaceNode")})},h.Qd=function(G,k,Y,j,$){function W(xe,Pe){h.u.G(h.a.ec,null,[j,xe,J,Y,K,Pe]),h.i.ma(j,h.i.H)}function K(xe,Pe){E(Pe,he),Y.afterRender&&Y.afterRender(Pe,xe),he=null}function J(xe,Pe){he=$.createChildContext(xe,{as:ge,noChildContext:Y.noChildContext,extend:function(we){we.$index=Pe,ge&&(we[ge+"Index"]=Pe)}});var ve=M(G,xe,he);return D(j,"ignoreTargetNode",ve,he,Y)}var he,ge=Y.as,se=Y.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!Y.includeDestroyed;if(se||Y.beforeRemove||!h.Pc(k))return h.$(function(){var xe=h.a.f(k)||[];typeof xe.length>"u"&&(xe=[xe]),se&&(xe=h.a.jb(xe,function(Pe){return Pe===e||Pe===null||!h.a.f(Pe._destroy)})),W(xe)},null,{l:j});W(k.v());var _e=k.subscribe(function(xe){W(k(),xe)},null,"arrayChange");return _e.l(j),_e};var V=h.a.g.Z(),U=h.a.g.Z();h.c.template={init:function(G,k){var Y=h.a.f(k());if(typeof Y=="string"||"name"in Y)h.h.Ea(G);else if("nodes"in Y){if(Y=Y.nodes||[],h.O(Y))throw Error('The "nodes" option must be a plain, non-observable array.');var j=Y[0]&&Y[0].parentNode;j&&h.a.g.get(j,U)||(j=h.a.Yb(Y),h.a.g.set(j,U,!0)),new h.C.ia(G).nodes(j)}else if(Y=h.h.childNodes(G),0<Y.length)j=h.a.Yb(Y),new h.C.ia(G).nodes(j);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,Y,j,$){var W=k();k=h.a.f(W),Y=!0,j=null,typeof k=="string"?k={}:(W="name"in k?k.name:G,"if"in k&&(Y=h.a.f(k.if)),Y&&"ifnot"in k&&(Y=!h.a.f(k.ifnot)),Y&&!W&&(Y=!1)),"foreach"in k?j=h.Qd(W,Y&&k.foreach||[],k,G,$):Y?(Y=$,"data"in k&&(Y=$.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),j=h.dc(W,Y,k,G)):h.h.Ea(G),$=j,(k=h.a.g.get(G,V))&&typeof k.s=="function"&&k.s(),h.a.g.set(G,V,!$||$.ja&&!$.ja()?e:$)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,E,w){if(_.length&&E.length){var D,M,B,V,U;for(D=M=0;(!w||D<w)&&(V=_[M]);++M){for(B=0;U=E[B];++B)if(V.value===U.value){V.moved=U.index,U.moved=V.index,E.splice(B,1),D=B=0;break}D+=B}}},h.a.Pb=function(){function _(E,w,D,M,B){var V=Math.min,U=Math.max,G=[],k,Y=E.length,j,$=w.length,W=$-Y||1,K=Y+$+1,J,he,ge;for(k=0;k<=Y;k++)for(he=J,G.push(J=[]),ge=V($,k+W),j=U(0,k-1);j<=ge;j++)J[j]=j?k?E[k-1]===w[j-1]?he[j-1]:V(he[j]||K,J[j-1]||K)+1:j+1:k+1;for(V=[],U=[],W=[],k=Y,j=$;k||j;)$=G[k][j]-1,j&&$===G[k][j-1]?U.push(V[V.length]={status:D,value:w[--j],index:j}):k&&$===G[k-1][j]?W.push(V[V.length]={status:M,value:E[--k],index:k}):(--j,--k,B.sparse||V.push({status:"retained",value:w[j]}));return h.a.Kc(W,U,!B.dontLimitMoves&&10*Y),V.reverse()}return function(E,w,D){return D=typeof D=="boolean"?{dontLimitMoves:D}:D||{},E=E||[],w=w||[],E.length<w.length?_(E,w,"added","deleted",D):_(w,E,"deleted","added",D)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(D,M,B,V,U){var G=[],k=h.$(function(){var Y=M(B,U,h.a.Ua(G,D))||[];0<G.length&&(h.a.Xc(G,Y),V&&h.u.G(V,null,[B,Y,U])),G.length=0,h.a.Nb(G,Y)},null,{l:D,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var E=h.a.g.Z(),w=h.a.g.Z();h.a.ec=function(D,M,B,V,U,G){function k(Ht){ve={Aa:Ht,pb:h.ta(he++)},K.push(ve),W||Pe.push(ve)}function Y(Ht){ve=$[Ht],he!==ve.pb.v()&&xe.push(ve),ve.pb(he++),h.a.Ua(ve.Y,D),K.push(ve)}function j(Ht,kt){if(Ht)for(var be=0,Ee=kt.length;be<Ee;be++)h.a.D(kt[be].Y,function(at){Ht(at,be,kt[be].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var $=h.a.g.get(D,E),W=!$,K=[],J=0,he=0,ge=[],se=[],_e=[],xe=[],Pe=[],ve,we=0;if(W)h.a.D(M,k);else{if(!G||$&&$._countWaitingForRemove){var ze=h.a.Mb($,function(Ht){return Ht.Aa});G=h.a.Pb(ze,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var ze=0,Re,dt,Tt;Re=G[ze];ze++)switch(dt=Re.moved,Tt=Re.index,Re.status){case"deleted":for(;J<Tt;)Y(J++);dt===e&&(ve=$[J],ve.$&&(ve.$.s(),ve.$=e),h.a.Ua(ve.Y,D).length&&(V.beforeRemove&&(K.push(ve),we++,ve.Aa===w?ve=null:_e.push(ve)),ve&&ge.push.apply(ge,ve.Y))),J++;break;case"added":for(;he<Tt;)Y(J++);dt!==e?(se.push(K.length),Y(dt)):k(Re.value)}for(;he<M.length;)Y(J++);K._countWaitingForRemove=we}h.a.g.set(D,E,K),j(V.beforeMove,xe),h.a.D(ge,V.beforeRemove?h.oa:h.removeNode);var ot,ln,Dn;try{Dn=D.ownerDocument.activeElement}catch{}if(se.length)for(;(ze=se.shift())!=e;){for(ve=K[ze],ot=e;ze;)if((ln=K[--ze].Y)&&ln.length){ot=ln[ln.length-1];break}for(M=0;J=ve.Y[M];ot=J,M++)h.h.Wb(D,J,ot)}for(ze=0;ve=K[ze];ze++){for(ve.Y||h.a.extend(ve,_(D,B,ve.Aa,U,ve.pb)),M=0;J=ve.Y[M];ot=J,M++)h.h.Wb(D,J,ot);!ve.Ed&&U&&(U(ve.Aa,ve.Y,ve.pb),ve.Ed=!0,ot=ve.Y[ve.Y.length-1])}for(Dn&&D.ownerDocument.activeElement!=Dn&&Dn.focus(),j(V.beforeRemove,_e),ze=0;ze<_e.length;++ze)_e[ze].Aa=w;j(V.afterMove,xe),j(V.afterAdd,Pe)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,E,w,D){return(E=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(E.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,D))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var E=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,D,M,B){if(B=B||n,M=M||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=o.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[D.$data],D=o.extend({koBindingContext:D},M.templateOptions),D=o.tmpl(V,w,D),D.appendTo(B.createElement("div")),o.fragments={},D},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,D){n.write("<script type='text/html' id='"+w+"'>"+D+"<\/script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var Wgt=ko;typeof window<"u"?(ko=window.ko,typeof _B<"u"?window.ko=_B:delete window.ko):(ko=global.ko,typeof _B<"u"?global.ko=_B:delete global.ko);var UC=Wgt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var sK="__knockoutObservables",aK="__knockoutSubscribable";function LAe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=NAe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===sK||r===aK)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&Rgt(n,a)}}),e}function NAe(e,t){var n=e[sK];return!n&&t&&(n={},Object.defineProperty(e,sK,{value:n})),n}function Ogt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),LAe.call(i,e,[t]),e}function Rgt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Mgt(e,t,i))})}function Mgt(e,t,n){var i=Bgt(e,n);return i.subscribe(t)}function Bgt(e,t){var n=t[aK];if(!n){n=new e.subscribable,Object.defineProperty(t,aK,{value:n});var i={};Lgt(t,n,i),Ngt(e,t,n,i)}return n}function Lgt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function Ngt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function FAe(e,t){if(!e)return null;var n=NAe(e,!1);return n&&n[t]||null}function Fgt(e,t){var n=FAe(e,t);n&&n.valueHasMutated()}function Ugt(e){e.track=LAe,e.getObservable=FAe,e.valueHasMutated=Fgt,e.defineProperty=Ogt}var d2={attachToKo:Ugt};var UAe="http://www.w3.org/2000/svg",VAe="cesium-svgPath-svg",Vgt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(UAe,"svg:svg");i.setAttribute("class",VAe);let r=document.createElementNS(UAe,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${VAe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},m2=Vgt;d2.attachToKo(NC);m2.register(NC);var Ce=NC;function h2(e){l(e)||(e=new Hd),this._clock=e,this._eventHelper=new wo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(h2.prototype,{clock:{get:function(){return this._clock}}});h2.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};h2.prototype.isDestroyed=function(){return!1};h2.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var p2=h2;function kgt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var cK=kgt;function zgt(e,t){t=y(t,!0);let n=new pe,i=new pe;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Ce.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var En=zgt;var _2={};_2.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};_2.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};_2.createRangeInput=function(e,t,n,i,r,o){o=y(o,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(r,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};_2.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Ma=_2;function Hgt(e,t,n,i,r){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,r)}var fa=Hgt;function kAe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(kAe.prototype,{command:{get:function(){return this._command}}});var f0=kAe;var FC="http://www.w3.org/2000/svg",GAe="http://www.w3.org/1999/xlink",_H,g2=z.fromCssColorString("rgba(247,250,255,0.384)"),gH=z.fromCssColorString("rgba(143,191,255,0.216)"),lK=z.fromCssColorString("rgba(153,197,255,0.098)"),yH=z.fromCssColorString("rgba(255,255,255,0.086)"),Ggt=z.fromCssColorString("rgba(255,255,255,0.267)"),Wgt=z.fromCssColorString("rgba(255,255,255,0)"),zAe=z.fromCssColorString("rgba(66,67,68,0.3)"),HAe=z.fromCssColorString("rgba(0,0,0,0.5)");function d0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var y2={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Tm(e){let t=document.createElementNS(FC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Tm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(GAe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function uK(e,t,n){let i=document.createElementNS(FC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(FC,"tspan");return r.textContent=n,i.appendChild(r),i}function jgt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var AH=new z;function jo(e,t){let n=t.alpha,i=1-n;return AH.red=e.red*i+t.red*n,AH.green=e.green*i+t.green*n,AH.blue=e.blue*i+t.blue*n,AH.toCssColorString()}function fK(e,t,n){let i=y2[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Tm(r)}function Ygt(e,t,n){let i=y2[n],r=y2.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Tm(o)}function qgt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&_H!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(_H=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===_H&&(_H=void 0),n.shuttleRingDragging=!1}function Y_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[fa(t,"toggled",this.setToggled,this),fa(t,"tooltip",this.setTooltip,this),fa(t.command,"canExecute",this.setEnabled,this)]}Y_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Y_.prototype.isDestroyed=function(){return!1};Y_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Y_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Y_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function YS(e,t){e=Pn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(FC,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",GAe);let s=document.createElementNS(FC,"g");this._topG=s,this._realtimeSVG=new Y_(Ygt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Y_(fK(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Y_(fK(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Y_(fK(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(FC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Tm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=y2.animation_pathSwooshFX,f=y2.animation_pathPointer,d=Tm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Tm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Tm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Tm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=Tm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=uK(0,-24,""),this._knobTime=uK(0,-7,""),this._knobStatus=uK(0,-41,"");let A=Tm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(FC,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(A),o.appendChild(s),e.appendChild(o);let C=this;function T(R){qgt(C,R)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let E=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],w=this._knobStatus.childNodes[0],D;this._subscriptions=[fa(t.pauseViewModel,"toggled",function(R){D!==R&&(D=R,D?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),fa(t,"shuttleRingAngle",function(R){jgt(C._shuttleRingPointer,C._knobOuter,R)}),fa(t,"dateLabel",function(R){S.textContent!==R&&(S.textContent=R)}),fa(t,"timeLabel",function(R){E.textContent!==R&&(E.textContent=R)}),fa(t,"multiplierLabel",function(R){w.textContent!==R&&(w.textContent=R)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(YS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YS.prototype.isDestroyed=function(){return!1};YS.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,r=n.length;i<r;i++)n[i].dispose();return ue(this)};YS.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};YS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=d0(this._themeNormal),n=d0(this._themeHover),i=d0(this._themeSelect),r=d0(this._themeDisabled),o=d0(this._themeKnob),s=d0(this._themePointer),a=d0(this._themeSwoosh),c=d0(this._themeSwooshHover),u=Tm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jo(t,g2)},{tagName:"stop",offset:"12%","stop-color":jo(t,gH)},{tagName:"stop",offset:"46%","stop-color":jo(t,lK)},{tagName:"stop",offset:"81%","stop-color":jo(t,yH)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jo(n,g2)},{tagName:"stop",offset:"12%","stop-color":jo(n,gH)},{tagName:"stop",offset:"46%","stop-color":jo(n,lK)},{tagName:"stop",offset:"81%","stop-color":jo(n,yH)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jo(i,g2)},{tagName:"stop",offset:"12%","stop-color":jo(i,gH)},{tagName:"stop",offset:"46%","stop-color":jo(i,lK)},{tagName:"stop",offset:"81%","stop-color":jo(i,yH)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jo(r,Ggt)},{tagName:"stop",offset:"75%","stop-color":jo(r,Wgt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":jo(s,HAe)},{tagName:"stop",offset:"100%","stop-color":jo(s,HAe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":jo(o,g2)},{tagName:"stop",offset:"60%","stop-color":jo(o,zAe)},{tagName:"stop",offset:"85%","stop-color":jo(o,gH)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":jo(o,zAe)},{tagName:"stop",offset:"60%","stop-color":jo(o,g2)},{tagName:"stop",offset:"85%","stop-color":jo(o,yH)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var A2=YS;var Xgt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m0=15,qS=105;function WAe(e,t){return e-t}function dK(e,t){let n=wr(t,e,WAe);return n<0?~n:n}function Kgt(e,t){if(Math.abs(e)<=m0)return e/m0;let n=m0,i=qS,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function Jgt(e,t,n){if(n.clockStep===dr.SYSTEM_CLOCK)return m0;if(Math.abs(e)<=1)return e*m0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=m0,o=qS,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Xf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Xf.defaultDateFormatter,this._timeFormatter=Xf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Xf.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===dr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return Jgt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,qS),-qS);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=dr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===qS){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=Kgt(s,a);if(t.snapToTicks)u=a[dK(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>m0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Ro.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===Ro.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Ro.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new f0(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new f0(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new f0(r,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==dr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=En(function(){t._clockViewModel.clockStep=dr.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new f0(o,{toggled:Ce.computed(function(){return e.clockStep===dr.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=dK(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=dK(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Xf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${Xgt[n.month-1]} ${n.day} ${n.year}`};Xf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Xf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Xf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Xf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(WAe);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,o),this._allShuttleRingTicks=s};Object.defineProperties(Xf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Xf._maxShuttleRingAngle=qS;Xf._realtimeShuttleRingAngle=m0;var x2=Xf;function jAe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Ce.getObservable(this,"imageryProviderViewModels"),o=Ce.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;l(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._imageryProviders=o;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;l(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,h=l(p)?p.name:void 0;return l(g)&&l(h)?`${g} -${h}`:l(g)?g:h}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,A=this._globe.imageryLayers,x=!1;for(p=0;p<h;p++){let C=A.length;for(let T=0;T<C;T++){let E=A.get(T);if(E===g[p]){A.remove(E),x=!0;break}}}if(l(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let T=C.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let E=Us.fromProviderAsync(C[p]);A.add(E,0),this._currentImageryLayers.push(E)}}else{this._currentImageryLayers=[];let T=Us.fromProviderAsync(C);if(T.name=d.name,x)A.add(T,0);else{let E=A.get(0);l(E)&&A.remove(E),A.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),x=new i2(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,x()}});u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(jAe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var C2=jAe;function xH(e,t){e=Pn(e);let n=new C2(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",o.appendChild(h);let A=document.createElement("div");A.className="cesium-baseLayerPicker-section",A.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(A);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",A.appendChild(x);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),x.appendChild(C);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),x.appendChild(T);let E=document.createElement("div");E.className="cesium-baseLayerPicker-item",E.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(E);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),E.appendChild(S);let w=document.createElement("div");w.className="cesium-baseLayerPicker-itemLabel",w.setAttribute("data-bind","text: name"),E.appendChild(w),Ce.applyBindings(n,i),Ce.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(D){i.contains(D.target)||o.contains(D.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(xH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});xH.prototype.isDestroyed=function(){return!1};xH.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var T2=xH;function YAe(e){let t=e.creationFunction;l(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(YAe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var _s=YAe;function Zgt(){let e=[];return e.push(new _s({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:ym.AERIAL})}})),e.push(new _s({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:ym.AERIAL_WITH_LABELS})}})),e.push(new _s({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:ym.ROAD})}})),e.push(new _s({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return bh.fromBasemapType(mm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new _s({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return bh.fromBasemapType(mm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new _s({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return bh.fromBasemapType(mm.OCEANS,{enablePickFeatures:!1})}})),e.push(new _s({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new pC({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new _s({name:"Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new pC({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new _s({name:"Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new pC({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new _s({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return kf.fromAssetId(3954)}})),e.push(new _s({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return kf.fromAssetId(3845)}})),e.push(new _s({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return kf.fromAssetId(3812)}})),e.push(new _s({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return wh.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var E2=Zgt;function Qgt(){let e=[];return e.push(new _s({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Yx}})),e.push(new _s({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return Wx({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var b2=Qgt;function $gt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof va&&(e.tileset=n.primitive),e.pickActive=!1}}function XAe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof va&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var eyt={maximumFractionDigits:3};function S2(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,eyt):Math.round(t).toLocaleString()}function v2(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Or.PICK]:e._statisticsPerPass[Or.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${S2(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${S2(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${S2(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function KAe(){let e=Bi.statistics;return` + */var pK="__knockoutObservables",_K="__knockoutSubscribable";function Zxe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=$xe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===pK||o===_K)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&qgt(n,a)}}),e}function $xe(e,t){var n=e[pK];return!n&&t&&(n={},Object.defineProperty(e,pK,{value:n})),n}function jgt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),Zxe.call(i,e,[t]),e}function qgt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Ygt(e,t,i))})}function Ygt(e,t,n){var i=Xgt(e,n);return i.subscribe(t)}function Xgt(e,t){var n=t[_K];if(!n){n=new e.subscribable,Object.defineProperty(t,_K,{value:n});var i={};Kgt(t,n,i),Jgt(e,t,n,i)}return n}function Kgt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function Jgt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function Qxe(e,t){if(!e)return null;var n=$xe(e,!1);return n&&n[t]||null}function Zgt(e,t){var n=Qxe(e,t);n&&n.valueHasMutated()}function $gt(e){e.track=Zxe,e.getObservable=Qxe,e.valueHasMutated=Zgt,e.defineProperty=jgt}var gB={attachToKo:$gt};var ebe="http://www.w3.org/2000/svg",tbe="cesium-svgPath-svg",Qgt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(ebe,"svg:svg");i.setAttribute("class",tbe);let o=document.createElementNS(ebe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${tbe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},yB=Qgt;gB.attachToKo(UC);yB.register(UC);var Ce=UC;function xB(e){l(e)||(e=new zd),this._clock=e,this._eventHelper=new wr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(xB.prototype,{clock:{get:function(){return this._clock}}});xB.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};xB.prototype.isDestroyed=function(){return!1};xB.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var bB=xB;function eyt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var gK=eyt;function tyt(e,t){t=y(t,!0);let n=new pe,i=new pe;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ce.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var En=tyt;var CB={};CB.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};CB.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};CB.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};CB.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var La=CB;function nyt(e,t,n,i,o){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,o)}var da=nyt;function nbe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(nbe.prototype,{command:{get:function(){return this._command}}});var m0=nbe;function ibe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ce.getObservable(this,"imageryProviderViewModels"),r=Ce.pureComputed(function(){let d=o(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,h=l(p)?p.name:void 0;return l(g)&&l(h)?`${g} +${h}`:l(g)?g:h}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<h;p++){let C=x.length;for(let T=0;T<C;T++){let A=x.get(T);if(A===g[p]){x.remove(A),b=!0;break}}}if(l(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let T=C.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let A=Vs.fromProviderAsync(C[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let T=Vs.fromProviderAsync(C);if(T.name=d.name,b)x.add(T,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),b=new uB(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,b()}});u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(ibe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var TB=ibe;function wH(e,t){e=On(e);let n=new TB(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",r.appendChild(h);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),b.appendChild(C);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),b.appendChild(T);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(A);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),A.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),Ce.applyBindings(n,i),Ce.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(wH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wH.prototype.isDestroyed=function(){return!1};wH.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var AB=wH;function obe(e){let t=e.creationFunction;l(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(obe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var xs=obe;function iyt(){let e=[];return e.push(new xs({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:_m.AERIAL})}})),e.push(new xs({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:_m.AERIAL_WITH_LABELS})}})),e.push(new xs({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return N_({style:_m.ROAD})}})),e.push(new xs({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Eh.fromBasemapType(hm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new xs({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Eh.fromBasemapType(hm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new xs({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Eh.fromBasemapType(hm.OCEANS,{enablePickFeatures:!1})}})),e.push(new xs({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new RC({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new xs({name:"Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new RC({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new xs({name:"Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new RC({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new xs({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Uf.fromAssetId(3954)}})),e.push(new xs({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Uf.fromAssetId(3845)}})),e.push(new xs({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Uf.fromAssetId(3812)}})),e.push(new xs({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Sh.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var EB=iyt;function oyt(){let e=[];return e.push(new xs({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new qb}})),e.push(new xs({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return Wb({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var SB=oyt;var VC="http://www.w3.org/2000/svg",abe="http://www.w3.org/1999/xlink",IH,vB=z.fromCssColorString("rgba(247,250,255,0.384)"),DH=z.fromCssColorString("rgba(143,191,255,0.216)"),yK=z.fromCssColorString("rgba(153,197,255,0.098)"),PH=z.fromCssColorString("rgba(255,255,255,0.086)"),ryt=z.fromCssColorString("rgba(255,255,255,0.267)"),syt=z.fromCssColorString("rgba(255,255,255,0)"),rbe=z.fromCssColorString("rgba(66,67,68,0.3)"),sbe=z.fromCssColorString("rgba(0,0,0,0.5)");function h0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var wB={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Tm(e){let t=document.createElementNS(VC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(Tm(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(abe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function xK(e,t,n){let i=document.createElementNS(VC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(VC,"tspan");return o.textContent=n,i.appendChild(o),i}function ayt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var OH=new z;function Wr(e,t){let n=t.alpha,i=1-n;return OH.red=e.red*i+t.red*n,OH.green=e.green*i+t.green*n,OH.blue=e.blue*i+t.blue*n,OH.toCssColorString()}function bK(e,t,n){let i=wB[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Tm(o)}function cyt(e,t,n){let i=wB[n],o=wB.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Tm(r)}function lyt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&IH!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(IH=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===IH&&(IH=void 0),n.shuttleRingDragging=!1}function Y_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[da(t,"toggled",this.setToggled,this),da(t,"tooltip",this.setTooltip,this),da(t.command,"canExecute",this.setEnabled,this)]}Y_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Y_.prototype.isDestroyed=function(){return!1};Y_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Y_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Y_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function ZS(e,t){e=On(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(VC,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",abe);let s=document.createElementNS(VC,"g");this._topG=s,this._realtimeSVG=new Y_(cyt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Y_(bK(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Y_(bK(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Y_(bK(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(VC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Tm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=wB.animation_pathSwooshFX,f=wB.animation_pathPointer,d=Tm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Tm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Tm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Tm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=Tm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=xK(0,-24,""),this._knobTime=xK(0,-7,""),this._knobStatus=xK(0,-41,"");let x=Tm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(VC,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function T(O){lyt(C,O)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let A=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],I;this._subscriptions=[da(t.pauseViewModel,"toggled",function(O){I!==O&&(I=O,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),da(t,"shuttleRingAngle",function(O){ayt(C._shuttleRingPointer,C._knobOuter,O)}),da(t,"dateLabel",function(O){S.textContent!==O&&(S.textContent=O)}),da(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),da(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(ZS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZS.prototype.isDestroyed=function(){return!1};ZS.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};ZS.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};ZS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=h0(this._themeNormal),n=h0(this._themeHover),i=h0(this._themeSelect),o=h0(this._themeDisabled),r=h0(this._themeKnob),s=h0(this._themePointer),a=h0(this._themeSwoosh),c=h0(this._themeSwooshHover),u=Tm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Wr(t,vB)},{tagName:"stop",offset:"12%","stop-color":Wr(t,DH)},{tagName:"stop",offset:"46%","stop-color":Wr(t,yK)},{tagName:"stop",offset:"81%","stop-color":Wr(t,PH)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Wr(n,vB)},{tagName:"stop",offset:"12%","stop-color":Wr(n,DH)},{tagName:"stop",offset:"46%","stop-color":Wr(n,yK)},{tagName:"stop",offset:"81%","stop-color":Wr(n,PH)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Wr(i,vB)},{tagName:"stop",offset:"12%","stop-color":Wr(i,DH)},{tagName:"stop",offset:"46%","stop-color":Wr(i,yK)},{tagName:"stop",offset:"81%","stop-color":Wr(i,PH)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Wr(o,ryt)},{tagName:"stop",offset:"75%","stop-color":Wr(o,syt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Wr(s,sbe)},{tagName:"stop",offset:"100%","stop-color":Wr(s,sbe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Wr(r,vB)},{tagName:"stop",offset:"60%","stop-color":Wr(r,rbe)},{tagName:"stop",offset:"85%","stop-color":Wr(r,DH)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Wr(r,rbe)},{tagName:"stop",offset:"60%","stop-color":Wr(r,vB)},{tagName:"stop",offset:"85%","stop-color":Wr(r,PH)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var IB=ZS;var uyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p0=15,$S=105;function cbe(e,t){return e-t}function CK(e,t){let n=Do(t,e,cbe);return n<0?~n:n}function fyt(e,t){if(Math.abs(e)<=p0)return e/p0;let n=p0,i=$S,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function dyt(e,t,n){if(n.clockStep===po.SYSTEM_CLOCK)return p0;if(Math.abs(e)<=1)return e*p0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=p0,r=$S,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function Xf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Xf.defaultDateFormatter,this._timeFormatter=Xf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Xf.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===po.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return dyt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,$S),-$S);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===$S){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=fyt(s,a);if(t.snapToTicks)u=a[CK(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>p0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Rr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===Rr.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Rr.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new m0(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new m0(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new m0(o,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==po.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=En(function(){t._clockViewModel.clockStep=po.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new m0(r,{toggled:Ce.computed(function(){return e.clockStep===po.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=CK(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=CK(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Xf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${uyt[n.month-1]} ${n.day} ${n.year}`};Xf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Xf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Xf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Xf.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(cbe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Xf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Xf._maxShuttleRingAngle=$S;Xf._realtimeShuttleRingAngle=p0;var DB=Xf;function myt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Os&&(e.tileset=n.primitive),e.pickActive=!1}}function ube(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Os&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var hyt={maximumFractionDigits:3};function PB(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,hyt):Math.round(t).toLocaleString()}function OB(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Mo.PICK]:e._statisticsPerPass[Mo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${PB(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${PB(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${PB(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function fbe(){let e=Ni.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${S2(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${S2(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${PB(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${PB(e.texturesByteLength)}</li> </ul> - `}var tyt=[{text:"Highlight",value:dl.HIGHLIGHT},{text:"Replace",value:dl.REPLACE},{text:"Mix",value:dl.MIX}],qAe=new z(1,1,0,.4),nyt=new z,CH=new z;function da(e,t){let n=this,i=e.canvas;this._eventHandler=new Iu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new z_({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let U=[],q=n._properties();for(let Y in q)q.hasOwnProperty(Y)&&U.push(Y);return U});let r=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(U){r(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let o=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(U){o(U),l(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=dl.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let Y=e.pick(q.endPosition);if(Y instanceof Ts?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(Y)&&l(Y.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(q.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),l(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),l(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(U){d(U),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),l(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),l(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let A=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return A()},set:function(U){A(U),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(U){x(U),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),l(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let T=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(U){U=Number(U),isNaN(U)||(T(U),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let E=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(E(),1/6)},set:function(U){E(Math.pow(U,6))}});let S=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=4;let w=$gt(this),D=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return D()},set:function(U){D(U),U?n._eventHandler.setInputAction(w,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let R=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return R()},set:function(U){R(U),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let O=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(U){U=Number(U),isNaN(U)||(O(U),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let N=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let b=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return b()},set:function(U){U=Number(U),isNaN(U)||(b(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let v=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(U){U=Number(U),isNaN(U)||(v(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),l(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let M=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(U){U=Number(U),isNaN(U)||(M(U),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let F=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),l(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let k=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),l(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(U){G(U),l(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||XAe(this,!0)}Object.defineProperties(da.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return tyt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e._readyPromise.then(function(o){t.isDestroyed()||t._properties(o.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let o=0;o<i;++o){let s=n[o];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=v2(e,!1),this._pickStatisticsText=v2(e,!0),this._resourceCacheStatisticsText=KAe(),XAe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,nyt):z.WHITE:t.color=CH,this._scene.requestRender()),l(e)&&(z.clone(e.color,CH),e.color=qAe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!mK(t.content)&&(t.color=CH,this._scene.requestRender()),l(e)&&!mK(e.content)&&(z.clone(e.color,CH),e.color=qAe,this._scene.requestRender()),this._tile=e}}});function mK(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!mK(t[i]))return!1;return!0}return!1}da.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};da.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};da.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};da.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};da.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};da.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};da.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};da.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};da.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};da.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};da.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new B_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};da.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};da.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=v2(e,!1),this._pickStatisticsText=v2(e,!0),this._resourceCacheStatisticsText=KAe())};da.prototype.isDestroyed=function(){return!1};da.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};da.getStatistics=v2;var w2=da;function TH(e,t){e=Pn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new w2(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ma.createSection,c=Ma.createCheckbox,u=Ma.createRangeInput,f=Ma.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),A=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let E=document.createElement("label");E.className="field-label",E.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),T.appendChild(E),T.appendChild(S),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let w=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",w.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let R=document.createElement("div");R.setAttribute("data-bind","visible: pointCloudShading"),R.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),R.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),R.appendChild(u("Base Resolution","baseResolution",0,1,.01)),R.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(R);let O=document.createElement("div");O.setAttribute("data-bind","visible: eyeDomeLighting"),O.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),O.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),R.appendChild(O),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(N),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(b),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(v);let I=document.createElement("div");x.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let k=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(k);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),A.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),A.appendChild(c("Geometric Error","showGeometricError")),A.appendChild(c("Rendering Statistics","showRenderingStatistics")),A.appendChild(c("Memory Usage (MB)","showMemoryUsage")),A.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(q),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(r,n)}Object.defineProperties(TH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TH.prototype.isDestroyed=function(){return!1};TH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var D2=TH;function iyt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function hK(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var ryt=new In,oyt=new m;function I2(e,t){let n=this,i=e.canvas,r=new Iu(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new z_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new aN({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let u=n.depthFrustum+1;return n.depthFrustum=hK(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let u=n.depthFrustum-1;return n.depthFrustum=hK(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new o2({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,ryt),g=o.pick(p,n._scene,oyt);if(l(g)){let h=d.cartesianToCartographic(g),A=o._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!f&&x<A.length;++x){let C=A[x];if(l(C))for(let T=0;!f&&T<C.length;++T){let E=C[T];ce.contains(E.rectangle,h)&&(f=E)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(I2.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});I2.prototype._update=function(){this.frustums&&(this.frustumStatisticText=iyt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=hK(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};I2.prototype.isDestroyed=function(){return!1};I2.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var P2=I2;function EH(e,t){e=Pn(e);let n=document.createElement("div"),i=new P2(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Ma.createSection,c=Ma.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(A);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(x);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",T.appendChild(E);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let w=document.createElement("div");w.className="cesium-cesiumInspector-center",w.appendChild(S),E.appendChild(w),E.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),E.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),E.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",D.appendChild(R);let O=document.createElement("input");O.type="button",O.value="Pick a tile",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),w=document.createElement("div"),w.appendChild(O),w.className="cesium-cesiumInspector-center",R.appendChild(w);let L=document.createElement("div");R.appendChild(L);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let b=document.createElement("input");b.type="button",b.value="NE",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(M),L.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",L.appendChild(F);let k=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),U=document.createElement("td");U.appendChild(N);let q=document.createElement("td");q.appendChild(_);let Y=document.createElement("td");Y.appendChild(b),V.appendChild(U),V.appendChild(q),V.appendChild(Y);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(v);let K=document.createElement("td");K.appendChild(I),G.appendChild(Q),G.appendChild(W),G.appendChild(K),k.appendChild(V),k.appendChild(G),L.appendChild(k),R.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),R.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(EH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EH.prototype.isDestroyed=function(){return!1};EH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var O2=EH;function bH(e,t){l(t)||(t=document.body),t=Pn(t);let n=this,i=Ce.observable(uo.fullscreen),r=Ce.observable(uo.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&uo.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){uo.fullscreen?uo.exitFullscreen():uo.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Pn(e),o.body),this._callback=function(){i(uo.fullscreen)},o.addEventListener(uo.changeEventName,this._callback)}Object.defineProperties(bH.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});bH.prototype.isDestroyed=function(){return!1};bH.prototype.destroy=function(){document.removeEventListener(uo.changeEventName,this._callback),ue(this)};var R2=bH;var syt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",ayt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function SH(e,t){e=Pn(e);let n=new R2(t,e);n._exitFullScreenPath=ayt,n._enterFullScreenPath=syt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(SH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SH.prototype.isDestroyed=function(){return!1};SH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var M2=SH;function JAe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(JAe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var B2=JAe;function vH(e,t,n){e=Pn(e);let i=new B2(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Ce.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(vH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vH.prototype.isDestroyed=function(){return!1};vH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var L2=vH;var ZAe=1e3;function Kf(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new ZB,new uL({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=$Ae,this._handleArrowUp=QAe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let r=Ce.getObservable(t,"_suggestions")().length>0,o=Ce.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=En(function(i){if(i=y(i,jy.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)myt(t);else return fyt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?QAe(t):o?$Ae(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;nxe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Kf.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Kf._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Kf.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Kf.prototype.destroy=function(){this._suggestionSubscription.dispose()};function QAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Kf._adjustSuggestionsScroll(e,n)}function $Ae(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Kf._adjustSuggestionsScroll(e,i)}function cyt(e,t){let n=l(t)?t.availability:void 0;return l(n)?E_(t,[e]).then(function(i){return e=i[0],e.height+=ZAe,e}):(e.height+=ZAe,Promise.resolve(e))}function lyt(e,t){let n=e._scene,r=n.mapProjection.ellipsoid,o=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ce.center(t):c=nC(t,n):t=r.cartesianToCartographic(t),l(c)||(c=cyt(t,s)),c.then(function(u){a=r.cartographicToCartesian(u)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:B.IDENTITY})})}async function uyt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function fyt(e,t,n){let i=e._searchText;if(txe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await uyt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,_K(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=exe(e,Yb.getCreditsFromResult(s[0]));l(a)||pK(e,t[r].credit);return}e._searchText=`${i} (not found)`}function pK(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function exe(e,t){return l(t)&&t.forEach(n=>pK(e,n)),t}function _K(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function dyt(e,t){let n=Pn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function myt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function txe(e){return/^\s*$/.test(e)}function nxe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function hyt(e){if(!e.autoComplete)return;let t=e._searchText;if(nxe(e),_K(e),!txe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,jy.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=Yb.getCreditsFromResult(o);r=r&&!l(s),exe(e,s)}),r&&pK(e,n.credit)}if(e._suggestions.length>=5)return}}Kf.flyToDestination=lyt;Kf._updateSearchSuggestions=hyt;Kf._adjustSuggestionsScroll=dyt;Kf.prototype.isDestroyed=function(){return!1};Kf.prototype.destroy=function(){return _K(this),ue(this)};var N2=Kf;var pyt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",_yt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function wH(e){let t=Pn(e.container),n=new N2(e);n._startSearchPath=pyt,n._stopSearchPath=_yt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Wt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(wH.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});wH.prototype.isDestroyed=function(){return!1};wH.prototype.destroy=function(){let e=this._container;return Wt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var F2=wH;function ixe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(ixe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var U2=ixe;function DH(e){let t=Pn(e.container),n=new U2,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ce.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(DH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DH.prototype.isDestroyed=function(){return!1};DH.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var V2=DH;var gyt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",yyt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function gK(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?yyt:gyt}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}gK.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(gK.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var k2=gK;function IH(e){e=Pn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let s=new k2;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=o,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;o.addEventListener("load",function(){let c=o.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=fa(s,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let A=window.getComputedStyle(g);if(A!==null){let x=A["background-color"],C=z.fromCssColorString(x);l(C)&&C.alpha!==0&&(p=A["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;o.style.height=`${h}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties(IH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});IH.prototype.isDestroyed=function(){return!1};IH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var z2=IH;function PH(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new wo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===ne.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(PH.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});PH.prototype.isDestroyed=function(){return!1};PH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var H2=PH;var Ayt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",xyt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function OH(e,t){e=Pn(e);let n=new H2(t);n._perspectivePath=Ayt,n._orthographicPath=xyt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(OH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OH.prototype.isDestroyed=function(){return!1};OH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var G2=OH;function yK(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=AN.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(yK.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});yK.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var W2=yK;function RH(e){let t=Pn(e.container),n=new W2(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(RH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});RH.prototype.isDestroyed=function(){return!1};RH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j2=RH;function MH(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new wo,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===ne.SCENE2D?n.tooltip2D:r===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(MH.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});MH.prototype.isDestroyed=function(){return!1};MH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var Y2=MH;var Cyt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Tyt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Eyt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function BH(e,t,n){e=Pn(e);let i=new Y2(t,n);i._globePath=Cyt,i._flatMapPath=Tyt,i._columbusViewPath=Eyt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),Ce.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(BH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BH.prototype.isDestroyed=function(){return!1};BH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var q2=BH;var byt=new H,LH="-1000px";function X2(e,t,n){this._scene=e,this._screenPositionX=LH,this._screenPositionY=LH,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return Xi.wgs84ToWindowCoordinates(e,i,r)}}X2.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,byt);if(!l(e))this._screenPositionX=LH,this._screenPositionY=LH;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};X2.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Mo.EXPONENTIAL_OUT})};X2.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Mo.EXPONENTIAL_OUT})};Object.defineProperties(X2.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var K2=X2;function NH(e,t){e=Pn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new K2(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(NH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NH.prototype.isDestroyed=function(){return!1};NH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),ue(this)};var J2=NH;function UC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}UC.prototype.getHeight=function(){return this._height};UC.prototype.getBase=function(){return this._base};UC.prototype.getStartTime=function(){return this._start};UC.prototype.getStopTime=function(){return this._stop};UC.prototype.setRange=function(e,t){this._start=e,this._stop=t};UC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=ee.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var Z2=UC;function rxe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}rxe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,r)&&ee.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,o)&&ee.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var Q2=rxe;var AK=1e12,Jf={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Qc={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},h0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Syt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $c(e,t){e=Pn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Jf.none,this._touchMode=Qc.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=vyt(this),this._onMouseUp=wyt(this),this._onMouseMove=Dyt(this),this._onMouseWheel=Iyt(this),this._onTouchStart=Pyt(this),this._onTouchMove=Ryt(this),this._onTouchEnd=Oyt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}$c.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};$c.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};$c.prototype.addHighlightRange=function(e,t,n){let i=new Z2(e,t,n);return this._highlightRanges.push(i),this.resize(),i};$c.prototype.addTrack=function(e,t,n,i){let r=new Q2(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};$c.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Ro.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=ee.secondsDifference(r,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=r,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};$c.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function xK(e){return e<10?`0${e.toString()}`:e.toString()}$c.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Syt[t.month-1]} ${t.day} ${t.year} ${xK(t.hour)}:${xK(t.minute)}:${xK(t.second)}${i}`};$c.prototype.smallestTicInPixels=7;$c.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),A,x=ee.toGregorianDate(g);d>31536e4?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):d>31536e3?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):d>86400?A=ee.fromDate(new Date(Date.UTC(x.year,0))):A=ee.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(A,h,new ee)),T=C+d;this._epochJulian=A;function E(U){return Math.floor(C/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function w(U){return(U-C)/d}function D(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let R=this._rulerEle.offsetWidth+20;R<30&&(R=180);let O=f;f-=u;let L={startTime:C,startJulian:g,epochJulian:A,duration:d,timeBarWidth:p,getAlpha:w};this._highlightRanges.forEach(function(U){s+=U.render(L)});let N=0,_=0,b=0,v=R/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,M=-1,F=h0.length,k;for(k=0;k<F;++k){let U=h0[k];if(++I,N=U,U>v&&U>f)break;M<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(N,h0[I]))<1e-5){h0[I]>=f&&(_=h0[I]);break}if(M>=0)for(;M<I;){if(Math.abs(D(_,h0[M]))<1e-5&&h0[M]>=f){b=h0[M];break}++M}}f=O,f>u&&b<1e-5&&Math.abs(f-N)>u&&(b=f,f<=N+u&&(_=0));let V=-999999,G;if(p*(b/this._timeBarSecondsSpan)>=3)for(r=E(b);r<=T;r=S(r,b))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=E(_);r<=T;r=S(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,T+=N,r=E(N);let U=ee.computeTaiMinusUtc(A);for(;r<=T;){let q=ee.addSeconds(g,r-C,new ee);if(N>2.1){let K=ee.computeTaiMinusUtc(q);Math.abs(K-U)>.1&&(r+=K-U,q=ee.addSeconds(g,r-C,new ee))}let Y=Math.round(p*w(r)),Q=this.makeLabel(q);this._rulerEle.innerHTML=Q,G=this._rulerEle.offsetWidth,G<10&&(G=R);let W=Y-(G/2-1);W>V?(V=W+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,r=S(r,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),L.y=0,this._trackList.forEach(function(U){U.render(o._context,L),L.y+=U.height})};$c.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};$c.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function vyt(e){return function(t){e._mouseMode!==Jf.touchOnly&&(t.button===0?(e._mouseMode=Jf.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Jf.zoom:e._mouseMode=Jf.slide)),t.preventDefault()}}function wyt(e){return function(t){e._mouseMode=Jf.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Dyt(e){return function(t){let n;if(e._mouseMode===Jf.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Jf.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Jf.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Iyt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;AK=Math.max(Math.min(Math.abs(n),AK),1),n/=AK,e.zoomFrom(Math.pow(1.05,-n))}}function Pyt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Jf.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Qc.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Qc.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Qc.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Qc.ignore}}function Oyt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Qc.singleTap?(e._touchMode=Qc.scrub,e._onTouchMove(t)):e._touchMode===Qc.scrub&&e._onTouchMove(t),e._mouseMode=Jf.touchOnly,n!==1?e._touchMode=n>0?Qc.ignore:Qc.none:e._touchMode===Qc.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function Ryt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Qc.singleTap&&(e._touchMode=Qc.slideZoom),e._mouseMode=Jf.touchOnly,e._touchMode===Qc.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Qc.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-o,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=o,e._touchState.spanX=s))}}$c.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var $2=$c;var lxe=vr(cxe(),1);function Lyt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function uxe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Nyt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(uxe(),e._locked=!1),e._noSleep.disable(),uo.exitFullscreen(),n(!1)):(uo.fullscreen||uo.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Lyt("landscape")),t.useWebVR=!0,n(!0)))}function FH(e,t){let n=this,i=Ce.observable(uo.enabled),r=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&uo.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new wo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new lxe.default,this._command=En(function(){Nyt(n,e,r,o)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(Pn(t),document.body),this._callback=function(){!uo.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(uxe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(uo.changeEventName,this._callback)}Object.defineProperties(FH.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});FH.prototype.isDestroyed=function(){return!1};FH.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(uo.changeEventName,this._callback),ue(this)};var e3=FH;var Fyt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",Uyt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function UH(e,t,n){e=Pn(e);let i=new e3(t,n);i._exitVRPath=Uyt,i._enterVRPath=Fyt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),Ce.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(UH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UH.prototype.isDestroyed=function(){return!1};UH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var t3=UH;var p0=new ae;function mxe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Vyt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function kyt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function fxe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof Kr)return i;if(n instanceof Ts)return new Kr({name:kyt(n),description:Vyt(n),feature:n})}if(l(e.scene.globe))return Gyt(e,t.position)}var zyt=new ee;function hxe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let r=i.startTime,o=i.stopTime;ee.equals(r,o)&&(o=ee.addSeconds(r,P.EPSILON2,zyt)),e.updateFromClock(),e.zoomTo(r,o)}}}var Hyt=new m;function Gyt(e,t){let n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(r))return;let o=new Kr({id:"Loading...",description:"Loading feature information..."});return r.then(function(s){if(e.selectedEntity!==o)return;if(!l(s)||s.length===0){e.selectedEntity=dxe();return}let a=s[0],c=new Kr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,Hyt);c.position=new Pc(u)}e.selectedEntity=c},function(){e.selectedEntity===o&&(e.selectedEntity=dxe())}),o}function dxe(){return new Kr({id:"None",description:"No features found."})}function Wyt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ri(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Hd,u=new p2(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new u2(o,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new LM,g=!0);let h=d.scene,A=new CB({scene:h,dataSourceCollection:p}),x=new wo;x.add(c.onTick,Ri.prototype._onTick,this),x.add(h.morphStart,Ri.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(Y),C=new J2(Y,h)}let T;if(!l(t.infoBox)||t.infoBox!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-infoBoxContainer",r.appendChild(Y),T=new z2(Y);let Q=T.viewModel;x.add(Q.cameraClicked,Ri.prototype._onInfoBoxCameraClicked,this),x.add(Q.closeClicked,Ri.prototype._onInfoBoxClockClicked,this)}let E=document.createElement("div");E.className="cesium-viewer-toolbar",r.appendChild(E);let S;if(!l(t.geocoder)||t.geocoder!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-geocoderContainer",E.appendChild(Y);let Q;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new F2({container:Y,geocoderServices:Q,scene:h}),x.add(S.viewModel.search.beforeExecute,Ri.prototype._clearObjects,this)}let w;(!l(t.homeButton)||t.homeButton!==!1)&&(w=new L2(E,h),l(S)&&x.add(w.viewModel.command.afterExecute,function(){let Y=S.viewModel;Y.searchText="",Y.isSearchInProgress&&Y.search()}),x.add(w.viewModel.command.beforeExecute,Ri.prototype._clearTrackedObject,this));let D;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(D=new q2(E,h));let R;t.projectionPicker&&(R=new G2(E,h));let O,L;if(n){let Y=y(t.imageryProviderViewModels,E2()),Q=y(t.terrainProviderViewModels,b2());O=new T2(E,{globe:h.globe,imageryProviderViewModels:Y,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),L=E.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&($("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(O.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(O.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let N;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let Y=!0;try{if(l(window.localStorage)){let Q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Q)&&Q?Y=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}N=new V2({container:E,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,Y)})}let _;if(!l(t.animation)||t.animation!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-animationContainer",r.appendChild(Y),_=new A2(Y,new x2(u))}let b;if(!l(t.timeline)||t.timeline!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-timelineContainer",r.appendChild(Y),b=new $2(Y,c),b.addEventListener("settime",mxe,!1),b.zoomTo(c.startTime,c.stopTime)}let v,I,M;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",r.appendChild(M),v=new M2(M,t.fullscreenElement),I=fa(v.viewModel,"isFullscreenEnabled",function(Y){M.style.display=Y?"block":"none",l(b)&&(b.container.style.right=`${M.clientWidth}px`,b.resize())}));let F,k,V;if(t.vrButton){let Y=document.createElement("div");Y.className="cesium-viewer-vrContainer",r.appendChild(Y),F=new t3(Y,h,t.fullScreenElement),k=fa(F.viewModel,"isVREnabled",function(Q){Y.style.display=Q?"block":"none",l(v)&&(Y.style.right=`${M.clientWidth}px`),l(b)&&(b.container.style.right=`${Y.clientWidth}px`,b.resize())}),V=fa(F.viewModel,"isVRMode",function(Q){Wyt(i,Q)})}this._baseLayerPickerDropDown=L,this._fullscreenSubscription=I,this._vrSubscription=k,this._vrModeSubscription=V,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=T,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=A,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=E,this._homeButton=w,this._sceneModePicker=D,this._projectionPicker=R,this._baseLayerPicker=O,this._navigationHelpButton=N,this._animation=_,this._timeline=b,this._fullscreenButton=v,this._vrButton=F,this._geocoder=S,this._eventHelper=x,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(T)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new pe,this._trackedEntityChanged=new pe,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),x.add(p.dataSourceAdded,Ri.prototype._onDataSourceAdded,this),x.add(p.dataSourceRemoved,Ri.prototype._onDataSourceRemoved,this),x.add(h.postUpdate,Ri.prototype.resize,this),x.add(h.postRender,Ri.prototype._postRender,this);let G=p.length;for(let Y=0;Y<G;Y++)this._dataSourceAdded(p,p.get(Y));this._dataSourceAdded(void 0,A.defaultDataSource),x.add(p.dataSourceAdded,Ri.prototype._dataSourceAdded,this),x.add(p.dataSourceRemoved,Ri.prototype._dataSourceRemoved,this);function U(Y){let Q=fxe(i,Y);l(Q)?j.getValueOrUndefined(Q.position,i.clock.currentTime)?i.trackedEntity=Q:i.zoomTo(Q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function q(Y){i.selectedEntity=fxe(i,Y)}d.screenSpaceEventHandler.setInputAction(q,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(U,Cn.LEFT_DOUBLE_CLICK)}Object.defineProperties(Ri.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,VH(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(B.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,hxe(this._timeline,this.clock,e))}}});Ri.prototype.extend=function(e,t){e(this,t)};Ri.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,A=c.container,x=A.style;p=A.clientHeight+3,x.left=`${f}px`;let C=0;l(g)&&(C+=g.container.clientWidth),l(h)&&(C+=h.container.clientWidth),x.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Ri.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ri.prototype.render=function(){this._cesiumWidget.render()};Ri.prototype.isDestroyed=function(){return!1};Ri.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",mxe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ri.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ri.prototype._onEntityCollectionChanged,this)};Ri.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ri.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ri.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,p0)===lt.DONE&&i.update(t,p0)}let r,o=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,p0)!==lt.FAILED?r=p0.center:l(s.position)&&(r=s.position.getValue(t,r)),o=l(r));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=m.clone(r,c.position),c.showSelection=a&&o,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=o,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=j.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Ri.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}};Ri.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ri.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ri.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ri.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ri.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&hxe(this.timeline,this.clock,e)};Ri.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ri.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ri.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Ri.prototype.zoomTo=function(e,t){return pxe(this,e,{offset:t},!1)};Ri.prototype.flyTo=function(e,t){return pxe(this,e,t,!0)};function pxe(e,t,n,i){VH(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Us){let s;l(o.imageryProvider)?s=o.imageryProvider._readyPromise.then(()=>o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return nC(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof va||o instanceof kS||o instanceof WS){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=y(o.values,o),l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function XS(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function VH(e){let t=e._zoomPromise;l(t)&&(XS(e),e._completeZoom(!1))}Ri.prototype._postRender=function(){jyt(this),Yyt(this)};function jyt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,r=y(e._zoomOptions,{}),o;if(t instanceof va||t instanceof WS)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new pu(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),XS(e)}).catch(()=>{VH(e)});if(t instanceof kS)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new pu(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),XS(e)});if(t instanceof he){o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),XS(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,p0);if(d===lt.PENDING)return;d!==lt.FAILED&&a.push(ae.clone(p0))}if(a.length===0){VH(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(XS(e),i.flyToBoundingSphere(c,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(c,r.offset),i.lookAtTransform(B.IDENTITY),XS(e),e._completeZoom(!0))}function Yyt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=j.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,p0);if(o===lt.PENDING)return;let s=r.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==lt.FAILED?p0:void 0;e._entityView=new EB(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var bK=Ri;function qyt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new D2(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var SK=qyt;function Xyt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new O2(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var vK=Xyt;function Kyt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),r=new pe,o=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Pn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){_xe(s,u),s=f,wK(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?wK(s,u):_xe(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){VC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],A=new FileReader;A.onload=Jyt(e,h,c,a),A.onerror=Zyt(e,h),A.readAsText(h)}}wK(s,u),e.destroy=hL(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function VC(e){e.stopPropagation(),e.preventDefault()}function _xe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",VC,!1),n.removeEventListener("dragover",VC,!1),n.removeEventListener("dragexit",VC,!1))}function wK(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",VC,!1),e.addEventListener("dragover",VC,!1),e.addEventListener("dragexit",VC,!1)}function Jyt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=BM.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=MB.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=qB.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=FB.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function Zyt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var DK=Kyt;function Qyt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new j2({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var IK=Qyt;function gxe(e){let t=e.split(` -`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function Zf(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ce.observable();return Ce.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=gxe(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Hi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Hi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Hi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.translationX=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.translationY=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.translationZ=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.scaleX=B.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.scaleY=B.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)},getPrimitiveFunction:function(){t.scaleZ=B.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uh(t)}})}var $yt=new m,e0t=new m,t0t=new za,n0t=new Z;function Uh(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,$yt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,e0t),i=t0t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=Z.fromHeadingPitchRoll(i,n0t),o=Z.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=B.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Zf.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=gxe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Uh(t)})}}}});Zf.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Zf.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Zf.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Zf.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Zf.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Zf.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Zf.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new MC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Zf.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Zf.prototype.isDestroyed=function(){return!1};Zf.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};var n3=Zf;function kH(e,t){e=Pn(e);let n=document.createElement("div"),i=new n3(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let s=Ma.createSection,a=Ma.createCheckbox,c=Ma.createRangeInput,u=Ma.createButton,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Bounds","boundsVisible","toggleBounds"),g=s(o,"Clipping","clippingVisible","toggleClipping"),h=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let A=10,x=10,C=P.PI;d.appendChild(c("Translation X","translationX",-A,+A)),d.appendChild(c("Translation Y","translationY",-A,+A)),d.appendChild(c("Translation Z","translationZ",-A,+A)),d.appendChild(c("Scale X","scaleX",0,+x)),d.appendChild(c("Scale Y","scaleY",0,+x)),d.appendChild(c("Scale Z","scaleZ",0,+x)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let T=Hi.getMinBounds(Hi.BOX),E=Hi.getMaxBounds(Hi.BOX),S=m.fromElements(Hi.getMinBounds(Hi.ELLIPSOID).x,Hi.getMinBounds(Hi.ELLIPSOID).y,-re.WGS84.maximumRadius,new m),w=m.fromElements(Hi.getMaxBounds(Hi.ELLIPSOID).x,Hi.getMaxBounds(Hi.ELLIPSOID).y,1e7,new m),D=Hi.getMinBounds(Hi.CYLINDER),R=Hi.getMaxBounds(Hi.CYLINDER);KS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",T,E,"shapeIsBox",p),KS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,w,"shapeIsEllipsoid",p),KS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,R,"shapeIsCylinder",p),KS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",T,E,"shapeIsBox",g),KS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,w,"shapeIsEllipsoid",g),KS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,R,"shapeIsCylinder",g);let O=document.createElement("div");h.appendChild(O);let L=document.createElement("textarea");L.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),O.className="cesium-cesiumInspector-styleEditor",O.appendChild(L);let N=u("Compile (Ctrl+Enter)","compileShader");O.appendChild(N);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),O.appendChild(_),Ce.applyBindings(i,n)}Object.defineProperties(kH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kH.prototype.isDestroyed=function(){return!1};kH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function KS(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){let x=Ma.createRangeInput,C=p,T=g,E=A.appendChild(document.createElement("div"));E.setAttribute("data-bind",`if: ${h}`),E.appendChild(x(e,s,C.x,T.x)),E.appendChild(x(t,a,C.x,T.x)),E.appendChild(x(n,c,C.y,T.y)),E.appendChild(x(i,u,C.y,T.y)),E.appendChild(x(r,f,C.z,T.z)),E.appendChild(x(o,d,C.z,T.z))}var i3=kH;function i0t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new i3(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var PK=i0t;globalThis.CESIUM_VERSION="1.105";var r0t="1.105";return Mxe(o0t);})(); + `}var pyt=[{text:"Highlight",value:ml.HIGHLIGHT},{text:"Replace",value:ml.REPLACE},{text:"Mix",value:ml.MIX}],lbe=new z(1,1,0,.4),_yt=new z,RH=new z;function ma(e,t){let n=this,i=e.canvas;this._eventHandler=new Iu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new k_({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let k=[],Y=n._properties();for(let j in Y)Y.hasOwnProperty(j)&&k.push(j);return k});let o=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=ml.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(Y){let j=e.pick(Y.endPosition);if(j instanceof As?(n.feature=j,n.tile=j.content.tile):l(j)&&l(j.content)?(n.feature=void 0,n.tile=j.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(j)&&l(j.content)){let $;e.pickPositionSupported&&($=e.pickPosition(Y.endPosition),l($)&&(n._tileset.debugPickPosition=$)),n._tileset.debugPickedTile=j.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let T=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){A(Math.pow(k,6))}});let S=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=4;let v=myt(this),I=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(v,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let O=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let N=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let F=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let E=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let D=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(k){D(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||ube(this,!0)}Object.defineProperties(ma.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return pyt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e._readyPromise.then(function(r){t.isDestroyed()||t._properties(r.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let r=0;r<i;++r){let s=n[r];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation?o.maximumAttenuation:0,this.baseResolution=o.baseResolution?o.baseResolution:0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=OB(e,!1),this._pickStatisticsText=OB(e,!0),this._resourceCacheStatisticsText=fbe(),ube(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,_yt):z.WHITE:t.color=RH,this._scene.requestRender()),l(e)&&(z.clone(e.color,RH),e.color=lbe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!TK(t.content)&&(t.color=RH,this._scene.requestRender()),l(e)&&!TK(e.content)&&(z.clone(e.color,RH),e.color=lbe,this._scene.requestRender()),this._tile=e}}});function TK(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!TK(t[i]))return!1;return!0}return!1}ma.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ma.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ma.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ma.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ma.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ma.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ma.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ma.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ma.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ma.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ma.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new q_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ma.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ma.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=OB(e,!1),this._pickStatisticsText=OB(e,!0),this._resourceCacheStatisticsText=fbe())};ma.prototype.isDestroyed=function(){return!1};ma.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};ma.getStatistics=OB;var RB=ma;function MH(e,t){e=On(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new RB(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=La.createSection,c=La.createCheckbox,u=La.createRangeInput,f=La.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),T.appendChild(A),T.appendChild(S),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let N=document.createElement("div");N.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(N);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(F),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(E),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(w);let D=document.createElement("div");b.appendChild(D),D.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),D.appendChild(M);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),D.className="cesium-cesiumInspector-styleEditor",D.appendChild(B);let V=f("Compile (Ctrl+Enter)","compileStyle");D.appendChild(V);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),D.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let Y=document.createElement("div");Y.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(Y),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(o,n)}Object.defineProperties(MH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MH.prototype.isDestroyed=function(){return!1};MH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var MB=MH;function gyt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function AK(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var yyt=new wn,xyt=new m;function LB(e,t){let n=this,i=e.canvas,o=new Iu(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new k_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new J2({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let u=n.depthFrustum+1;return n.depthFrustum=AK(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let u=n.depthFrustum-1;return n.depthFrustum=AK(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new dB({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,yyt),g=r.pick(p,n._scene,xyt);if(l(g)){let h=d.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let C=x[b];if(l(C))for(let T=0;!f&&T<C.length;++T){let A=C[T];ce.contains(A.rectangle,h)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(LB.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});LB.prototype._update=function(){this.frustums&&(this.frustumStatisticText=gyt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=AK(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};LB.prototype.isDestroyed=function(){return!1};LB.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var NB=LB;function LH(e,t){e=On(e);let n=document.createElement("div"),i=new NB(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=La.createSection,c=La.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",T.appendChild(A);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",I.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let N=document.createElement("div");O.appendChild(N);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",N.className="cesium-cesiumInspector-frustumStatistics",N.appendChild(M),N.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",N.appendChild(B);let V=document.createElement("table"),U=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(F);let Y=document.createElement("td");Y.appendChild(_);let j=document.createElement("td");j.appendChild(E),U.appendChild(k),U.appendChild(Y),U.appendChild(j);let $=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let K=document.createElement("td");K.appendChild(D),G.appendChild($),G.appendChild(W),G.appendChild(K),V.appendChild(U),V.appendChild(G),N.appendChild(V),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(LH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LH.prototype.isDestroyed=function(){return!1};LH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var FB=LH;function NH(e,t){l(t)||(t=document.body),t=On(t);let n=this,i=Ce.observable(mr.fullscreen),o=Ce.observable(mr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&mr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){mr.fullscreen?mr.exitFullscreen():mr.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(On(e),r.body),this._callback=function(){i(mr.fullscreen)},r.addEventListener(mr.changeEventName,this._callback)}Object.defineProperties(NH.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});NH.prototype.isDestroyed=function(){return!1};NH.prototype.destroy=function(){document.removeEventListener(mr.changeEventName,this._callback),ue(this)};var BB=NH;var byt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",Cyt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function FH(e,t){e=On(e);let n=new BB(t,e);n._exitFullScreenPath=Cyt,n._enterFullScreenPath=byt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(FH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FH.prototype.isDestroyed=function(){return!1};FH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var kB=FH;var dbe=1e3;function Kf(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new YL,new sN({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=hbe,this._handleArrowUp=mbe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let o=Ce.getObservable(t,"_suggestions")().length>0,r=Ce.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=En(function(i){if(i=y(i,Yy.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)wyt(t);else return Syt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?mbe(t):r?hbe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;gbe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Kf.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Kf._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Kf.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Kf.prototype.destroy=function(){this._suggestionSubscription.dispose()};function mbe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Kf._adjustSuggestionsScroll(e,n)}function hbe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Kf._adjustSuggestionsScroll(e,i)}function Tyt(e,t){let n=l(t)?t.availability:void 0;return l(n)?T_(t,[e]).then(function(i){return e=i[0],e.height+=dbe,e}):(e.height+=dbe,Promise.resolve(e))}function Ayt(e,t){let n=e._scene,o=n.mapProjection.ellipsoid,r=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ce.center(t):c=wC(t,n):t=o.cartesianToCartographic(t),l(c)||(c=Tyt(t,s)),c.then(function(u){a=o.cartographicToCartesian(u)}).finally(function(){r.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:L.IDENTITY})})}async function Eyt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function Syt(e,t,n){let i=e._searchText;if(_be(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await Eyt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,SK(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=pbe(e,XE.getCreditsFromResult(s[0]));l(a)||EK(e,t[o].credit);return}e._searchText=`${i} (not found)`}function EK(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function pbe(e,t){return l(t)&&t.forEach(n=>EK(e,n)),t}function SK(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function vyt(e,t){let n=On(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function wyt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function _be(e){return/^\s*$/.test(e)}function gbe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function Iyt(e){if(!e.autoComplete)return;let t=e._searchText;if(gbe(e),SK(e),!_be(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Yy.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=XE.getCreditsFromResult(r);o=o&&!l(s),pbe(e,s)}),o&&EK(e,n.credit)}if(e._suggestions.length>=5)return}}Kf.flyToDestination=Ayt;Kf._updateSearchSuggestions=Iyt;Kf._adjustSuggestionsScroll=vyt;Kf.prototype.isDestroyed=function(){return!1};Kf.prototype.destroy=function(){return SK(this),ue(this)};var UB=Kf;var Dyt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",Pyt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function BH(e){let t=On(e.container),n=new UB(e);n._startSearchPath=Dyt,n._stopSearchPath=Pyt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Wt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(BH.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});BH.prototype.isDestroyed=function(){return!1};BH.prototype.destroy=function(){let e=this._container;return Wt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var VB=BH;function ybe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(ybe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var zB=ybe;function kH(e,t,n){e=On(e);let i=new zB(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(kH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kH.prototype.isDestroyed=function(){return!1};kH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var HB=kH;var Oyt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",Ryt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function vK(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?Ryt:Oyt}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}vK.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(vK.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var GB=vK;function UH(e){e=On(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new GB;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=da(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let b=x["background-color"],C=z.fromCssColorString(b);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;r.style.height=`${h}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(UH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});UH.prototype.isDestroyed=function(){return!1};UH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var WB=UH;function xbe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(xbe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var jB=xbe;function VH(e){let t=On(e.container),n=new jB,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ce.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(VH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VH.prototype.isDestroyed=function(){return!1};VH.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var qB=VH;function wK(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=Q2.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(wK.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});wK.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var YB=wK;function zH(e){let t=On(e.container),n=new YB(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(zH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zH.prototype.isDestroyed=function(){return!1};zH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var XB=zH;function HH(e){this._scene=e,this._orthographic=e.camera.frustum instanceof on,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new wr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(HH.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});HH.prototype.isDestroyed=function(){return!1};HH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var KB=HH;var Myt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Lyt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function GH(e,t){e=On(e);let n=new KB(t);n._perspectivePath=Myt,n._orthographicPath=Lyt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(GH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GH.prototype.isDestroyed=function(){return!1};GH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var JB=GH;function WH(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new wr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(WH.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});WH.prototype.isDestroyed=function(){return!1};WH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var ZB=WH;var Nyt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Fyt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Byt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function jH(e,t,n){e=On(e);let i=new ZB(t,n);i._globePath=Nyt,i._flatMapPath=Fyt,i._columbusViewPath=Byt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Ce.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(jH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jH.prototype.isDestroyed=function(){return!1};jH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var $B=jH;var kyt=new H,qH="-1000px";function QB(e,t,n){this._scene=e,this._screenPositionX=qH,this._screenPositionY=qH,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Zi.wgs84ToWindowCoordinates(e,i,o)}}QB.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,kyt);if(!l(e))this._screenPositionX=qH,this._screenPositionY=qH;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};QB.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Mr.EXPONENTIAL_OUT})};QB.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Mr.EXPONENTIAL_OUT})};Object.defineProperties(QB.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var e3=QB;function YH(e,t){e=On(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new e3(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(YH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YH.prototype.isDestroyed=function(){return!1};YH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),ue(this)};var t3=YH;function zC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}zC.prototype.getHeight=function(){return this._height};zC.prototype.getBase=function(){return this._base};zC.prototype.getStartTime=function(){return this._start};zC.prototype.getStopTime=function(){return this._stop};zC.prototype.setRange=function(e,t){this._start=e,this._stop=t};zC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=ee.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var n3=zC;function bbe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}bbe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,o)&&ee.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,r)&&ee.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var i3=bbe;var IK=1e12,Jf={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},$c={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},_0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Uyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Qc(e,t){e=On(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Jf.none,this._touchMode=$c.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=Vyt(this),this._onMouseUp=zyt(this),this._onMouseMove=Hyt(this),this._onMouseWheel=Gyt(this),this._onTouchStart=Wyt(this),this._onTouchMove=qyt(this),this._onTouchEnd=jyt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Qc.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Qc.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Qc.prototype.isDestroyed=function(){return!1};Qc.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Qc.prototype.addHighlightRange=function(e,t,n){let i=new n3(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Qc.prototype.addTrack=function(e,t,n,i){let o=new i3(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Qc.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Rr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=ee.secondsDifference(o,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=o,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Qc.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function DK(e){return e<10?`0${e.toString()}`:e.toString()}Qc.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Uyt[t.month-1]} ${t.day} ${t.year} ${DK(t.hour)}:${DK(t.minute)}:${DK(t.second)}${i}`};Qc.prototype.smallestTicInPixels=7;Qc.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),x,b=ee.toGregorianDate(g);d>31536e4?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?x=ee.fromDate(new Date(Date.UTC(b.year,0))):x=ee.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(x,h,new ee)),T=C+d;this._epochJulian=x;function A(k){return Math.floor(C/k)*k}function S(k,Y){return Math.ceil(k/Y+.5)*Y}function v(k){return(k-C)/d}function I(k,Y){return k-Y*Math.round(k/Y)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let N={startTime:C,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(N)});let F=0,_=0,E=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let D=-1,M=-1,B=_0.length,V;for(V=0;V<B;++V){let k=_0[V];if(++D,F=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=D)}if(D>0){for(;D>0;)if(--D,Math.abs(I(F,_0[D]))<1e-5){_0[D]>=f&&(_=_0[D]);break}if(M>=0)for(;M<D;){if(Math.abs(I(_,_0[M]))<1e-5&&_0[M]>=f){E=_0[M];break}++M}}f=R,f>u&&E<1e-5&&Math.abs(f-F)>u&&(E=f,f<=F+u&&(_=0));let U=-999999,G;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=A(E);o<=T;o=S(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=A(_);o<=T;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,T+=F,o=A(F);let k=ee.computeTaiMinusUtc(x);for(;o<=T;){let Y=ee.addSeconds(g,o-C,new ee);if(F>2.1){let K=ee.computeTaiMinusUtc(Y);Math.abs(K-k)>.1&&(o+=K-k,Y=ee.addSeconds(g,o-C,new ee))}let j=Math.round(p*v(o)),$=this.makeLabel(Y);this._rulerEle.innerHTML=$,G=this._rulerEle.offsetWidth,G<10&&(G=O);let W=j-(G/2-1);W>U?(U=W+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${j.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${$}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${j.toString()}px;"></span>`,o=S(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),N.y=0,this._trackList.forEach(function(k){k.render(r._context,N),N.y+=k.height})};Qc.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};Qc.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Vyt(e){return function(t){e._mouseMode!==Jf.touchOnly&&(t.button===0?(e._mouseMode=Jf.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Jf.zoom:e._mouseMode=Jf.slide)),t.preventDefault()}}function zyt(e){return function(t){e._mouseMode=Jf.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Hyt(e){return function(t){let n;if(e._mouseMode===Jf.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Jf.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Jf.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Gyt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;IK=Math.max(Math.min(Math.abs(n),IK),1),n/=IK,e.zoomFrom(Math.pow(1.05,-n))}}function Wyt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Jf.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=$c.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=$c.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=$c.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=$c.ignore}}function jyt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===$c.singleTap?(e._touchMode=$c.scrub,e._onTouchMove(t)):e._touchMode===$c.scrub&&e._onTouchMove(t),e._mouseMode=Jf.touchOnly,n!==1?e._touchMode=n>0?$c.ignore:$c.none:e._touchMode===$c.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function qyt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===$c.singleTap&&(e._touchMode=$c.slideZoom),e._mouseMode=Jf.touchOnly,e._touchMode===$c.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===$c.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-r,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=r,e._touchState.spanX=s))}}Qc.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var o3=Qc;var Sbe=Io(Ebe(),1);function Kyt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function vbe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Jyt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(vbe(),e._locked=!1),e._noSleep.disable(),mr.exitFullscreen(),n(!1)):(mr.fullscreen||mr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Kyt("landscape")),t.useWebVR=!0,n(!0)))}function XH(e,t){let n=this,i=Ce.observable(mr.enabled),o=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&mr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new wr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new Sbe.default,this._command=En(function(){Jyt(n,e,o,r)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(On(t),document.body),this._callback=function(){!mr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(vbe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(mr.changeEventName,this._callback)}Object.defineProperties(XH.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});XH.prototype.isDestroyed=function(){return!1};XH.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(mr.changeEventName,this._callback),ue(this)};var r3=XH;var Zyt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",$yt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function KH(e,t,n){e=On(e);let i=new r3(t,n);i._exitVRPath=$yt,i._enterVRPath=Zyt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(KH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KH.prototype.isDestroyed=function(){return!1};KH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var s3=KH;var g0=new ae;function Dbe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Qyt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function e0t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function wbe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof Ko)return i;if(n instanceof As)return new Ko({name:e0t(n),description:Qyt(n),feature:n})}if(l(e.scene.globe))return i0t(e,t.position)}var t0t=new ee;function Pbe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let o=i.startTime,r=i.stopTime;ee.equals(o,r)&&(r=ee.addSeconds(o,P.EPSILON2,t0t)),e.updateFromClock(),e.zoomTo(o,r)}}}var n0t=new m;function i0t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new Ko({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=Ibe();return}let a=s[0],c=new Ko({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,n0t);c.position=new wc(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=Ibe())}),r}function Ibe(){return new Ko({id:"None",description:"No features found."})}function o0t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Mi(e,t){e=On(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new zd,u=new bB(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new S2(r,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new PM,g=!0);let h=d.scene,x=new _L({scene:h,dataSourceCollection:p}),b=new wr;b.add(c.onTick,Mi.prototype._onTick,this),b.add(h.morphStart,Mi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(j),C=new t3(j,h)}let T;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",o.appendChild(j),T=new WB(j);let $=T.viewModel;b.add($.cameraClicked,Mi.prototype._onInfoBoxCameraClicked,this),b.add($.closeClicked,Mi.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",o.appendChild(A);let S;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",A.appendChild(j);let $;l(t.geocoder)&&typeof t.geocoder!="boolean"&&($=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new VB({container:j,geocoderServices:$,scene:h}),b.add(S.viewModel.search.beforeExecute,Mi.prototype._clearObjects,this)}let v;(!l(t.homeButton)||t.homeButton!==!1)&&(v=new HB(A,h),l(S)&&b.add(v.viewModel.command.afterExecute,function(){let j=S.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),b.add(v.viewModel.command.beforeExecute,Mi.prototype._clearTrackedObject,this));let I;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new $B(A,h));let O;t.projectionPicker&&(O=new JB(A,h));let R,N;if(n){let j=y(t.imageryProviderViewModels,EB()),$=y(t.terrainProviderViewModels,SB());R=new AB(A,{globe:h.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:$,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),N=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&(Q("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(R.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(R.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let F;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let $=window.localStorage.getItem("cesium-hasSeenNavHelp");l($)&&$?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}F=new qB({container:A,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,j)})}let _;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",o.appendChild(j),_=new IB(j,new DB(u))}let E;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",o.appendChild(j),E=new o3(j,c),E.addEventListener("settime",Dbe,!1),E.zoomTo(c.startTime,c.stopTime)}let w,D,M;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",o.appendChild(M),w=new kB(M,t.fullscreenElement),D=da(w.viewModel,"isFullscreenEnabled",function(j){M.style.display=j?"block":"none",l(E)&&(E.container.style.right=`${M.clientWidth}px`,E.resize())}));let B,V,U;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",o.appendChild(j),B=new s3(j,h,t.fullScreenElement),V=da(B.viewModel,"isVREnabled",function($){j.style.display=$?"block":"none",l(w)&&(j.style.right=`${M.clientWidth}px`),l(E)&&(E.container.style.right=`${j.clientWidth}px`,E.resize())}),U=da(B.viewModel,"isVRMode",function($){o0t(i,$)})}this._baseLayerPickerDropDown=N,this._fullscreenSubscription=D,this._vrSubscription=V,this._vrModeSubscription=U,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=T,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=v,this._sceneModePicker=I,this._projectionPicker=O,this._baseLayerPicker=R,this._navigationHelpButton=F,this._animation=_,this._timeline=E,this._fullscreenButton=w,this._vrButton=B,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(T)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new pe,this._trackedEntityChanged=new pe,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),b.add(p.dataSourceAdded,Mi.prototype._onDataSourceAdded,this),b.add(p.dataSourceRemoved,Mi.prototype._onDataSourceRemoved,this),b.add(h.postUpdate,Mi.prototype.resize,this),b.add(h.postRender,Mi.prototype._postRender,this);let G=p.length;for(let j=0;j<G;j++)this._dataSourceAdded(p,p.get(j));this._dataSourceAdded(void 0,x.defaultDataSource),b.add(p.dataSourceAdded,Mi.prototype._dataSourceAdded,this),b.add(p.dataSourceRemoved,Mi.prototype._dataSourceRemoved,this);function k(j){let $=wbe(i,j);l($)?q.getValueOrUndefined($.position,i.clock.currentTime)?i.trackedEntity=$:i.zoomTo($):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function Y(j){i.selectedEntity=wbe(i,j)}d.screenSpaceEventHandler.setInputAction(Y,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(k,Cn.LEFT_DOUBLE_CLICK)}Object.defineProperties(Mi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,JH(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(L.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Pbe(this._timeline,this.clock,e))}}});Mi.prototype.extend=function(e,t){e(this,t)};Mi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,x=c.container,b=x.style;p=x.clientHeight+3,b.left=`${f}px`;let C=0;l(g)&&(C+=g.container.clientWidth),l(h)&&(C+=h.container.clientWidth),b.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Mi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Mi.prototype.render=function(){this._cesiumWidget.render()};Mi.prototype.isDestroyed=function(){return!1};Mi.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",Dbe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Mi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Mi.prototype._onEntityCollectionChanged,this)};Mi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Mi.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Mi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,g0)===ut.DONE&&i.update(t,g0)}let o,r=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,g0)!==ut.FAILED?o=g0.center:l(s.position)&&(o=s.position.getValue(t,o)),r=l(o));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=m.clone(o,c.position),c.showSelection=a&&r,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=r,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=q.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Mi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0),this.selectedEntity===r&&(this.selectedEntity=void 0)}};Mi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Mi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Mi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Mi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Mi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Pbe(this.timeline,this.clock,e)};Mi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Mi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Mi.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Mi.prototype.zoomTo=function(e,t){return Obe(this,e,{offset:t},!1)};Mi.prototype.flyTo=function(e,t){return Obe(this,e,t,!0)};function Obe(e,t,n,i){JH(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Vs){let s;if(l(r.imageryProvider)){let a=Promise.resolve();l(r.imageryProvider._readyPromise)?a=r.imageryProvider._readyPromise:l(r.imageryProvider.readyPromise)&&(a=r.imageryProvider.readyPromise),s=a.then(()=>r.getImageryRectangle())}else s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})});s.then(function(a){return wC(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Os||r instanceof qS||r instanceof JS){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=y(r.values,r),l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function QS(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function JH(e){let t=e._zoomPromise;l(t)&&(QS(e),e._completeZoom(!1))}Mi.prototype._postRender=function(){r0t(this),s0t(this)};function r0t(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=y(e._zoomOptions,{}),r;if(t instanceof Os||t instanceof JS)return t._readyPromise.then(function(){let u=t.boundingSphere;l(o.offset)||(o.offset=new hu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(L.IDENTITY),e._completeZoom(!0)),QS(e)}).catch(()=>{JH(e)});if(t instanceof qS)return t._readyPromise.then(function(){let u=t.boundingSphere;l(o.offset)||(o.offset=new hu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(L.IDENTITY),e._completeZoom(!0)),QS(e)});if(t instanceof me){r={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),QS(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,g0);if(d===ut.PENDING)return;d!==ut.FAILED&&a.push(ae.clone(g0))}if(a.length===0){JH(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(QS(e),i.flyToBoundingSphere(c,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(c,o.offset),i.lookAtTransform(L.IDENTITY),QS(e),e._completeZoom(!0))}function s0t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,g0);if(r===ut.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?g0:void 0;e._entityView=new yL(t,o,o.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var MK=Mi;function a0t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new MB(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var LK=a0t;function c0t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new FB(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var NK=c0t;function l0t(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new pe,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=On(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){Rbe(s,u),s=f,FK(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?FK(s,u):Rbe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){HC(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],x=new FileReader;x.onload=u0t(e,h,c,a),x.onerror=f0t(e,h),x.readAsText(h)}}FK(s,u),e.destroy=fN(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function HC(e){e.stopPropagation(),e.preventDefault()}function Rbe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",HC,!1),n.removeEventListener("dragover",HC,!1),n.removeEventListener("dragexit",HC,!1))}function FK(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",HC,!1),e.addEventListener("dragover",HC,!1),e.addEventListener("dragexit",HC,!1)}function u0t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=DM.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=DL.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=GL.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=ML.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function f0t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var BK=l0t;function d0t(e,t){t=y(t,y.EMPTY_OBJECT);let n=new XB({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var kK=d0t;function Mbe(e){let t=e.split(` +`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} +`}return i}function Zf(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ce.observable();return Ce.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Mbe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Wi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Wi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Wi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.translationX=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.translationY=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.translationZ=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.scaleX=L.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.scaleY=L.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)},getPrimitiveFunction:function(){t.scaleZ=L.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&kh(t)}})}var m0t=new m,h0t=new m,p0t=new za,_0t=new Z;function kh(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,m0t),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,h0t),i=p0t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=Z.fromHeadingPitchRoll(i,_0t),r=Z.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=L.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Zf.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Mbe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,kh(t)})}}}});Zf.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Zf.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Zf.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Zf.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Zf.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Zf.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Zf.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new BC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Zf.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Zf.prototype.isDestroyed=function(){return!1};Zf.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};var a3=Zf;function ZH(e,t){e=On(e);let n=document.createElement("div"),i=new a3(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=La.createSection,a=La.createCheckbox,c=La.createRangeInput,u=La.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),h=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,C=P.PI;d.appendChild(c("Translation X","translationX",-x,+x)),d.appendChild(c("Translation Y","translationY",-x,+x)),d.appendChild(c("Translation Z","translationZ",-x,+x)),d.appendChild(c("Scale X","scaleX",0,+b)),d.appendChild(c("Scale Y","scaleY",0,+b)),d.appendChild(c("Scale Z","scaleZ",0,+b)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let T=Wi.getMinBounds(Wi.BOX),A=Wi.getMaxBounds(Wi.BOX),S=m.fromElements(Wi.getMinBounds(Wi.ELLIPSOID).x,Wi.getMinBounds(Wi.ELLIPSOID).y,-oe.WGS84.maximumRadius,new m),v=m.fromElements(Wi.getMaxBounds(Wi.ELLIPSOID).x,Wi.getMaxBounds(Wi.ELLIPSOID).y,1e7,new m),I=Wi.getMinBounds(Wi.CYLINDER),O=Wi.getMaxBounds(Wi.CYLINDER);ev("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",T,A,"shapeIsBox",p),ev("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,v,"shapeIsEllipsoid",p),ev("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,O,"shapeIsCylinder",p),ev("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",T,A,"shapeIsBox",g),ev("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,v,"shapeIsEllipsoid",g),ev("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,O,"shapeIsCylinder",g);let R=document.createElement("div");h.appendChild(R);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(N);let F=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(F);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(_),Ce.applyBindings(i,n)}Object.defineProperties(ZH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZH.prototype.isDestroyed=function(){return!1};ZH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function ev(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){let b=La.createRangeInput,C=p,T=g,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${h}`),A.appendChild(b(e,s,C.x,T.x)),A.appendChild(b(t,a,C.x,T.x)),A.appendChild(b(n,c,C.y,T.y)),A.appendChild(b(i,u,C.y,T.y)),A.appendChild(b(o,f,C.z,T.z)),A.appendChild(b(r,d,C.z,T.z))}var c3=ZH;function g0t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new c3(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var UK=g0t;globalThis.CESIUM_VERSION="1.106.1";var y0t="1.106.1";return Kbe(x0t);})(); diff --git a/public/lib/Cesium/ThirdParty/Workers/draco_decoder_nodejs.js b/public/lib/Cesium/ThirdParty/Workers/draco_decoder_nodejs.js index a083ac08..5d9981fc 100644 --- a/public/lib/Cesium/ThirdParty/Workers/draco_decoder_nodejs.js +++ b/public/lib/Cesium/ThirdParty/Workers/draco_decoder_nodejs.js @@ -1 +1 @@ -var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.owns=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.ISOLATE_POLYFILLS=!1,$jscomp.FORCE_POLYFILL_PROMISE=!1,$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(a,s,p){return a==Array.prototype||a==Object.prototype||(a[s]=p.value),a},$jscomp.getGlobal=function(a){a=[typeof globalThis=="object"&&globalThis,a,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var s=0;s<a.length;++s){var p=a[s];if(p&&p.Math==Math)return p}throw Error("Cannot find global object")},$jscomp.global=$jscomp.getGlobal(this),$jscomp.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol",$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE,$jscomp.polyfills={},$jscomp.propertyToPolyfillSymbol={},$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,s){var p=$jscomp.propertyToPolyfillSymbol[s];return p==null?a[s]:(p=a[p],p!==void 0?p:a[s])};$jscomp.polyfill=function(a,s,p,c){s&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,s,p,c):$jscomp.polyfillUnisolated(a,s,p,c))},$jscomp.polyfillUnisolated=function(a,s,p,c){for(p=$jscomp.global,a=a.split("."),c=0;c<a.length-1;c++){var i=a[c];if(!(i in p))return;p=p[i]}a=a[a.length-1],c=p[a],s=s(c),s!=c&&s!=null&&$jscomp.defineProperty(p,a,{configurable:!0,writable:!0,value:s})},$jscomp.polyfillIsolated=function(a,s,p,c){var i=a.split(".");a=i.length===1,c=i[0],c=!a&&c in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var I=0;I<i.length-1;I++){var _=i[I];if(!(_ in c))return;c=c[_]}i=i[i.length-1],p=$jscomp.IS_SYMBOL_NATIVE&&p==="es6"?c[i]:null,s=s(p),s!=null&&(a?$jscomp.defineProperty($jscomp.polyfills,i,{configurable:!0,writable:!0,value:s}):s!==p&&($jscomp.propertyToPolyfillSymbol[i]===void 0&&(p=1e9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[i]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(i):$jscomp.POLYFILL_PREFIX+p+"$"+i),$jscomp.defineProperty(c,$jscomp.propertyToPolyfillSymbol[i],{configurable:!0,writable:!0,value:s})))},$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(a,s){for(var p=1;p<arguments.length;p++){var c=arguments[p];if(c)for(var i in c)$jscomp.owns(c,i)&&(a[i]=c[i])}return a},$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3"),$jscomp.arrayIteratorImpl=function(a){var s=0;return function(){return s<a.length?{done:!1,value:a[s++]}:{done:!0}}},$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}},$jscomp.makeIterator=function(a){var s=typeof Symbol<"u"&&Symbol.iterator&&a[Symbol.iterator];return s?s.call(a):$jscomp.arrayIterator(a)},$jscomp.polyfill("Promise",function(a){function s(){this.batch_=null}function p(_){return _ instanceof i?_:new i(function(y,b){y(_)})}if(a&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof $jscomp.global.PromiseRejectionEvent>"u")||!$jscomp.global.Promise||$jscomp.global.Promise.toString().indexOf("[native code]")===-1))return a;s.prototype.asyncExecute=function(_){if(this.batch_==null){this.batch_=[];var y=this;this.asyncExecuteFunction(function(){y.executeBatch_()})}this.batch_.push(_)};var c=$jscomp.global.setTimeout;s.prototype.asyncExecuteFunction=function(_){c(_,0)},s.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var _=this.batch_;this.batch_=[];for(var y=0;y<_.length;++y){var b=_[y];_[y]=null;try{b()}catch(D){this.asyncThrow_(D)}}}this.batch_=null},s.prototype.asyncThrow_=function(_){this.asyncExecuteFunction(function(){throw _})};var i=function(_){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var y=this.createResolveAndReject_();try{_(y.resolve,y.reject)}catch(b){y.reject(b)}};i.prototype.createResolveAndReject_=function(){function _(D){return function(O){b||(b=!0,D.call(y,O))}}var y=this,b=!1;return{resolve:_(this.resolveTo_),reject:_(this.reject_)}},i.prototype.resolveTo_=function(_){if(_===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(_ instanceof i)this.settleSameAsPromise_(_);else{t:switch(typeof _){case"object":var y=_!=null;break t;case"function":y=!0;break t;default:y=!1}y?this.resolveToNonPromiseObj_(_):this.fulfill_(_)}},i.prototype.resolveToNonPromiseObj_=function(_){var y=void 0;try{y=_.then}catch(b){this.reject_(b);return}typeof y=="function"?this.settleSameAsThenable_(y,_):this.fulfill_(_)},i.prototype.reject_=function(_){this.settle_(2,_)},i.prototype.fulfill_=function(_){this.settle_(1,_)},i.prototype.settle_=function(_,y){if(this.state_!=0)throw Error("Cannot settle("+_+", "+y+"): Promise already settled in state"+this.state_);this.state_=_,this.result_=y,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},i.prototype.scheduleUnhandledRejectionCheck_=function(){var _=this;c(function(){if(_.notifyUnhandledRejection_()){var y=$jscomp.global.console;typeof y<"u"&&y.error(_.result_)}},1)},i.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var _=$jscomp.global.CustomEvent,y=$jscomp.global.Event,b=$jscomp.global.dispatchEvent;return typeof b>"u"?!0:(typeof _=="function"?_=new _("unhandledrejection",{cancelable:!0}):typeof y=="function"?_=new y("unhandledrejection",{cancelable:!0}):(_=$jscomp.global.document.createEvent("CustomEvent"),_.initCustomEvent("unhandledrejection",!1,!0,_)),_.promise=this,_.reason=this.result_,b(_))},i.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var _=0;_<this.onSettledCallbacks_.length;++_)I.asyncExecute(this.onSettledCallbacks_[_]);this.onSettledCallbacks_=null}};var I=new s;return i.prototype.settleSameAsPromise_=function(_){var y=this.createResolveAndReject_();_.callWhenSettled_(y.resolve,y.reject)},i.prototype.settleSameAsThenable_=function(_,y){var b=this.createResolveAndReject_();try{_.call(y,b.resolve,b.reject)}catch(D){b.reject(D)}},i.prototype.then=function(_,y){function b(L,m){return typeof L=="function"?function(A){try{D(L(A))}catch(E){O(E)}}:m}var D,O,$=new i(function(L,m){D=L,O=m});return this.callWhenSettled_(b(_,D),b(y,O)),$},i.prototype.catch=function(_){return this.then(void 0,_)},i.prototype.callWhenSettled_=function(_,y){function b(){switch(D.state_){case 1:_(D.result_);break;case 2:y(D.result_);break;default:throw Error("Unexpected state: "+D.state_)}}var D=this;this.onSettledCallbacks_==null?I.asyncExecute(b):this.onSettledCallbacks_.push(b),this.isRejectionHandled_=!0},i.resolve=p,i.reject=function(_){return new i(function(y,b){b(_)})},i.race=function(_){return new i(function(y,b){for(var D=$jscomp.makeIterator(_),O=D.next();!O.done;O=D.next())p(O.value).callWhenSettled_(y,b)})},i.all=function(_){var y=$jscomp.makeIterator(_),b=y.next();return b.done?p([]):new i(function(D,O){function $(A){return function(E){L[A]=E,m--,m==0&&D(L)}}var L=[],m=0;do L.push(void 0),m++,p(b.value).callWhenSettled_($(L.length-1),O),b=y.next();while(!b.done)})},i},"es6","es3"),$jscomp.checkStringArgs=function(a,s,p){if(a==null)throw new TypeError("The 'this' value for String.prototype."+p+" must not be null or undefined");if(s instanceof RegExp)throw new TypeError("First argument to String.prototype."+p+" must not be a regular expression");return a+""},$jscomp.polyfill("String.prototype.startsWith",function(a){return a||function(s,p){var c=$jscomp.checkStringArgs(this,s,"startsWith");s+="";var i=c.length,I=s.length;p=Math.max(0,Math.min(p|0,c.length));for(var _=0;_<I&&p<i;)if(c[p++]!=s[_++])return!1;return _>=I}},"es6","es3"),$jscomp.polyfill("Array.prototype.copyWithin",function(a){function s(p){return p=Number(p),p===1/0||p===-1/0?p:p|0}return a||function(p,c,i){var I=this.length;if(p=s(p),c=s(c),i=i===void 0?I:s(i),p=0>p?Math.max(I+p,0):Math.min(p,I),c=0>c?Math.max(I+c,0):Math.min(c,I),i=0>i?Math.max(I+i,0):Math.min(i,I),p<c)for(;c<i;)c in this?this[p++]=this[c++]:(delete this[p++],c++);else for(i=Math.min(i,I+c-p),p+=i-c;i>c;)--i in this?this[--p]=this[i]:delete this[--p];return this}},"es6","es3"),$jscomp.typedArrayCopyWithin=function(a){return a||Array.prototype.copyWithin},$jscomp.polyfill("Int8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint8ClampedArray.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Int16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Int32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Float32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Float64Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");var DracoDecoderModule=function(){var a=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(a=a||__filename),function(s){function p(e){return t.locateFile?t.locateFile(e,Q):Q+e}function c(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.subarray&&Et)return Et.decode(e.subarray(r,n));for(o="";r<n;){var l=e[r++];if(l&128){var d=e[r++]&63;if((l&224)==192)o+=String.fromCharCode((l&31)<<6|d);else{var q=e[r++]&63;l=(l&240)==224?(l&15)<<12|d<<6|q:(l&7)<<18|d<<12|q<<6|e[r++]&63,65536>l?o+=String.fromCharCode(l):(l-=65536,o+=String.fromCharCode(55296|l>>10,56320|l&1023))}}else o+=String.fromCharCode(l)}return o}function i(e,r){return e?c(tt,e,r):""}function I(e){Gt=e,t.HEAP8=H=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=z=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function _(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",K(e),vt=!0,e=new WebAssembly.RuntimeError(e+". Build with -s ASSERTIONS=1 for more info."),pt(e),e}function y(e){try{if(e==V&&Z)return new Uint8Array(Z);if(st)return st(e);throw"both async and sync fetching of the wasm failed"}catch(r){_(r)}}function b(){if(!Z&&(Dt||J)){if(typeof fetch=="function"&&!V.startsWith("file://"))return fetch(V,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()}).catch(function(){return y(V)});if(ct)return new Promise(function(e,r){ct(V,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return y(V)})}function D(e){for(;0<e.length;){var r=e.shift();if(typeof r=="function")r(t);else{var n=r.func;typeof n=="number"?r.arg===void 0?O(n)():O(n)(r.arg):n(r.arg===void 0?null:r.arg)}}}function O(e){var r=ot[e];return r||(e>=ot.length&&(ot.length=e+1),ot[e]=r=Ot.get(e)),r}function $(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(r){z[this.ptr+4>>2]=r},this.get_type=function(){return z[this.ptr+4>>2]},this.set_destructor=function(r){z[this.ptr+8>>2]=r},this.get_destructor=function(){return z[this.ptr+8>>2]},this.set_refcount=function(r){z[this.ptr>>2]=r},this.set_caught=function(r){H[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return H[this.ptr+12>>0]!=0},this.set_rethrown=function(r){H[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return H[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){z[this.ptr>>2]+=1},this.release_ref=function(){var r=z[this.ptr>>2];return z[this.ptr>>2]=r-1,r===1}}function L(e){function r(){if(!it&&(it=!0,t.calledRun=!0,!vt)){if(Rt=!0,D(yt),bt(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());D(Pt)}}if(!(0<X)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());D(jt),0<X||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),r()},1)):r())}}function m(){}function A(e){return(e||m).__cache__}function E(e,r){var n=A(r),o=n[e];return o||(o=Object.create((r||m).prototype),o.ptr=e,n[e]=o)}function k(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);55296<=o&&57343>=o&&(o=65536+((o&1023)<<10)|e.charCodeAt(++n)&1023),127>=o?++r:r=2047>=o?r+2:65535>=o?r+3:r+4}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var l=0;l<e.length;++l){var d=e.charCodeAt(l);if(55296<=d&&57343>=d){var q=e.charCodeAt(++l);d=65536+((d&1023)<<10)|q&1023}if(127>=d){if(n>=o)break;r[n++]=d}else{if(2047>=d){if(n+1>=o)break;r[n++]=192|d>>6}else{if(65535>=d){if(n+2>=o)break;r[n++]=224|d>>12}else{if(n+3>=o)break;r[n++]=240|d>>18,r[n++]=128|d>>12&63}r[n++]=128|d>>6&63}r[n++]=128|d&63}}r[n]=0}return e=f.alloc(r,H),f.copy(r,H,e),e}return e}function at(e){if(typeof e=="object"){var r=f.alloc(e,H);return f.copy(e,H,r),r}return e}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),A(B)[this.ptr]=this}function w(){this.ptr=Ft(),A(w)[this.ptr]=this}function x(){this.ptr=wt(),A(x)[this.ptr]=this}function h(){this.ptr=Vt(),A(h)[this.ptr]=this}function v(){this.ptr=$t(),A(v)[this.ptr]=this}function j(){this.ptr=ne(),A(j)[this.ptr]=this}function P(){this.ptr=ae(),A(P)[this.ptr]=this}function G(){this.ptr=ce(),A(G)[this.ptr]=this}function W(){this.ptr=de(),A(W)[this.ptr]=this}function g(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),A(R)[this.ptr]=this}function S(){this.ptr=Ge(),A(S)[this.ptr]=this}function M(){this.ptr=Re(),A(M)[this.ptr]=this}function N(){this.ptr=Ue(),A(N)[this.ptr]=this}function U(){this.ptr=we(),A(U)[this.ptr]=this}function F(){this.ptr=We(),A(F)[this.ptr]=this}function C(){this.ptr=He(),A(C)[this.ptr]=this}function T(){this.ptr=Ke(),A(T)[this.ptr]=this}function u(){this.ptr=_r(),A(u)[this.ptr]=this}s=s||{};var t=typeof s<"u"?s:{},dt=Object.assign,bt,pt;t.ready=new Promise(function(e,r){bt=e,pt=r});var ht=!1,At=!1;t.onRuntimeInitialized=function(){ht=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){At=!0,ht&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Tt=dt({},t),Dt=typeof window=="object",J=typeof importScripts=="function",Q="",ut,rt;if(typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"){Q=J?require("path").dirname(Q)+"/":__dirname+"/";var It=function(){rt||(ut=require("fs"),rt=require("path"))},gt=function(e,r){return It(),e=rt.normalize(e),ut.readFileSync(e,r?null:"utf8")},st=function(e){return e=gt(e,!0),e.buffer||(e=new Uint8Array(e)),e},ct=function(e,r,n){It(),e=rt.normalize(e),ut.readFile(e,function(o,l){o?n(o):r(l.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(Dt||J)&&(J?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),a&&(Q=a),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",gt=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},J&&(st=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ct=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var mn=t.print||console.log.bind(console),K=t.printErr||console.warn.bind(console);dt(t,Tt),Tt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&_("no native wasm support detected");var nt,vt=!1,Et=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Gt,H,tt,z,Ot,jt=[],yt=[],Pt=[],Rt=!1,X=0,lt=null,et=null;t.preloadedImages={},t.preloadedAudios={};var V="draco_decoder.wasm";V.startsWith("data:application/octet-stream;base64,")||(V=p(V));var ot=[],fn=0,_t={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var n=_t.buffers[e];r===0||r===10?((e===1?mn:K)(c(n,0)),n.length=0):n.push(r)},varargs:void 0,get:function(){return _t.varargs+=4,z[_t.varargs-4>>2]},getStr:function(e){return i(e)},get64:function(e,r){return e}},dn={h:function(e){return ln(e+16)+16},g:function(e,r,n){throw new $(e).init(r,n),fn++,e},a:function(){_("")},f:function(e,r,n){tt.copyWithin(e,r,r+n)},d:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var l=Math,d=l.min;o=Math.max(e,o),0<o%65536&&(o+=65536-o%65536),l=d.call(l,2147483648,o);t:{try{nt.grow(l-Gt.byteLength+65535>>>16),I(nt.buffer);var q=1;break t}catch{}q=void 0}if(q)return!0}return!1},e:function(e){return 0},c:function(e,r,n,o,l){},b:function(e,r,n,o){for(var l=0,d=0;d<n;d++){var q=z[r>>2],mt=z[r+4>>2];r+=8;for(var ft=0;ft<mt;ft++)_t.printChar(e,tt[q+ft]);l+=mt}return z[o>>2]=l,0}};(function(){function e(l,d){t.asm=l.exports,nt=t.asm.i,I(nt.buffer),Ot=t.asm.k,yt.unshift(t.asm.j),X--,t.monitorRunDependencies&&t.monitorRunDependencies(X),X==0&&(lt!==null&&(clearInterval(lt),lt=null),et&&(l=et,et=null,l()))}function r(l){e(l.instance)}function n(l){return b().then(function(d){return WebAssembly.instantiate(d,o)}).then(function(d){return d}).then(l,function(d){K("failed to asynchronously prepare wasm: "+d),_(d)})}var o={a:dn};if(X++,t.monitorRunDependencies&&t.monitorRunDependencies(X),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(l){return K("Module.instantiateWasm callback failed with error: "+l),!1}return function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||V.startsWith("data:application/octet-stream;base64,")||V.startsWith("file://")||typeof fetch!="function"?n(r):fetch(V,{credentials:"same-origin"}).then(function(l){return WebAssembly.instantiateStreaming(l,o).then(r,function(d){return K("wasm streaming compile failed: "+d),K("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(pt),{}})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.j).apply(null,arguments)};var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.l).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.m).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.n).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.o).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Ct=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.q).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Lt=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.r).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.s).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.t).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.u).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.v).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.w).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.x).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.y).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.z).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.A).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.B).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.C).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.D).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.F).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.G).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.H).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.I).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.J).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.K).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.L).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.M).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.N).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.O).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.P).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.Q).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.R).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.S).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.T).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.U).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.V).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.W).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.X).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.Y).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Z).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm._).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm.$).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.aa).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.ba).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ca).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.da).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.ea).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.fa).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.ga).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ha).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ia).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ja).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ka).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.la).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.ma).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.na).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.oa).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Ce=t._emscripten_bind_DracoInt16Array_size_0=t.asm.qa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Le=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.ra).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.sa).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.ta).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ua).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.va).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.wa).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.xa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.ya).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.za).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.Aa).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Ba).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ca).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Da).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Fa).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Ga).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ha).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ia).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ja).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ka).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.La).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.Ma).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Na).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Oa).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Pa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Qa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Ra).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Sa).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Ta).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ua).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Va).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Wa).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Xa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Ya).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Za).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm._a).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm.$a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.ab).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.bb).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.db).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.fb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.hb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.ib).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.jb).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.kb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.lb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.mb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.nb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.ob).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.qb).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.rb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.sb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.tb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.ub).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.vb).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.wb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.xb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.yb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.zb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.Ab).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Bb).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Cb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Db).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return($r=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Fb).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_INT32=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Gb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Hb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Ib).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Jb).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Kb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Lb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Mb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Nb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Ob).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Pb).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Qb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Rb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Sb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Tb).apply(null,arguments)},ln=t._malloc=function(){return(ln=t._malloc=t.asm.Ub).apply(null,arguments)};t._free=function(){return(t._free=t.asm.Vb).apply(null,arguments)};var it;if(et=function e(){it||L(),it||(et=e)},t.run=L,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();L(),m.prototype=Object.create(m.prototype),m.prototype.constructor=m,m.prototype.__class__=m,m.__cache__={},t.WrapperObject=m,t.getCache=A,t.wrapPointer=E,t.castObject=function(e,r){return E(e.ptr,r)},t.NULL=E(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete A(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var f={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(f.needed){for(var e=0;e<f.temps.length;e++)t._free(f.temps[e]);f.temps.length=0,t._free(f.buffer),f.buffer=0,f.size+=f.needed,f.needed=0}f.buffer||(f.size+=128,f.buffer=t._malloc(f.size),f.buffer||_(void 0)),f.pos=0},alloc:function(e,r){return f.buffer||_(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,f.pos+e>=f.size?(0<e||_(void 0),f.needed+=e,r=t._malloc(e),f.temps.push(r)):(r=f.buffer+f.pos,f.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return Y.prototype=Object.create(m.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.VoidPtr=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(m.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;f.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(m.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Ct(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Lt(this.ptr)},x.prototype=Object.create(m.prototype),x.prototype.constructor=x,x.prototype.__class__=x,x.__cache__={},t.GeometryAttribute=x,x.prototype.__destroy__=x.prototype.__destroy__=function(){zt(this.ptr)},h.prototype=Object.create(m.prototype),h.prototype.constructor=h,h.prototype.__class__=h,h.__cache__={},t.PointAttribute=h,h.prototype.size=h.prototype.size=function(){return Bt(this.ptr)},h.prototype.GetAttributeTransformData=h.prototype.GetAttributeTransformData=function(){return E(Wt(this.ptr),w)},h.prototype.attribute_type=h.prototype.attribute_type=function(){return Qt(this.ptr)},h.prototype.data_type=h.prototype.data_type=function(){return xt(this.ptr)},h.prototype.num_components=h.prototype.num_components=function(){return Yt(this.ptr)},h.prototype.normalized=h.prototype.normalized=function(){return!!Ht(this.ptr)},h.prototype.byte_stride=h.prototype.byte_stride=function(){return qt(this.ptr)},h.prototype.byte_offset=h.prototype.byte_offset=function(){return kt(this.ptr)},h.prototype.unique_id=h.prototype.unique_id=function(){return Xt(this.ptr)},h.prototype.__destroy__=h.prototype.__destroy__=function(){Kt(this.ptr)},v.prototype=Object.create(m.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.AttributeQuantizationTransform=v,v.prototype.InitFromAttribute=v.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!Jt(r,e)},v.prototype.quantization_bits=v.prototype.quantization_bits=function(){return Zt(this.ptr)},v.prototype.min_value=v.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},v.prototype.range=v.prototype.range=function(){return ee(this.ptr)},v.prototype.__destroy__=v.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(m.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(m.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},G.prototype=Object.create(m.prototype),G.prototype.constructor=G,G.prototype.__class__=G,G.__cache__={},t.Mesh=G,G.prototype.num_faces=G.prototype.num_faces=function(){return ye(this.ptr)},G.prototype.num_attributes=G.prototype.num_attributes=function(){return le(this.ptr)},G.prototype.num_points=G.prototype.num_points=function(){return me(this.ptr)},G.prototype.__destroy__=G.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(m.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},g.prototype=Object.create(m.prototype),g.prototype.constructor=g,g.prototype.__class__=g,g.__cache__={},t.Status=g,g.prototype.code=g.prototype.code=function(){return he(this.ptr)},g.prototype.ok=g.prototype.ok=function(){return!!Ae(this.ptr)},g.prototype.error_msg=g.prototype.error_msg=function(){return i(Te(this.ptr))},g.prototype.__destroy__=g.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(m.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(m.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(m.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(m.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Ce(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Le(this.ptr)},U.prototype=Object.create(m.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(m.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},C.prototype=Object.create(m.prototype),C.prototype.constructor=C,C.prototype.__class__=C,C.__cache__={},t.DracoUInt32Array=C,C.prototype.GetValue=C.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},C.prototype.size=C.prototype.size=function(){return ke(this.ptr)},C.prototype.__destroy__=C.prototype.__destroy__=function(){Xe(this.ptr)},T.prototype=Object.create(m.prototype),T.prototype.constructor=T,T.prototype.__class__=T,T.__cache__={},t.MetadataQuerier=T,T.prototype.HasEntry=T.prototype.HasEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),!!$e(n,e,r)},T.prototype.GetIntEntry=T.prototype.GetIntEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),Je(n,e,r)},T.prototype.GetIntEntryArray=T.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},T.prototype.GetDoubleEntry=T.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),tr(n,e,r)},T.prototype.GetStringEntry=T.prototype.GetStringEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),i(er(n,e,r))},T.prototype.NumEntries=T.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},T.prototype.GetEntryName=T.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),i(nr(n,e,r))},T.prototype.__destroy__=T.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(m.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return f.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),E(ir(o,e,r,n),g)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return f.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),E(ar(o,e,r,n),g)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:k(r),n=n&&typeof n=="object"?n.ptr:k(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(cr(n,e,r),h)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(yr(n,e,r),h)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),E(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,l){var d=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),l&&typeof l=="object"&&(l=l.ptr),!!jr(d,e,r,n,o,l)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(Sr(n,e,r),g)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(Mr(n,e,r),g)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Cr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Lr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=$r(),t.DT_INT32=Jr(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():yt.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},s.ready}}();typeof exports=="object"&&typeof module=="object"?module.exports=DracoDecoderModule:typeof define=="function"&&define.amd?define([],function(){return DracoDecoderModule}):typeof exports=="object"&&(exports.DracoDecoderModule=DracoDecoderModule); +var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.arrayIteratorImpl=function(p){var s=0;return function(){return s<p.length?{done:!1,value:p[s++]}:{done:!0}}},$jscomp.arrayIterator=function(p){return{next:$jscomp.arrayIteratorImpl(p)}},$jscomp.makeIterator=function(p){var s=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return s?s.call(p):$jscomp.arrayIterator(p)},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.ISOLATE_POLYFILLS=!1,$jscomp.FORCE_POLYFILL_PROMISE=!1,$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,$jscomp.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var s=0;s<p.length;++s){var a=p[s];if(a&&a.Math==Math)return a}throw Error("Cannot find global object")},$jscomp.global=$jscomp.getGlobal(this),$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,s,a){return p==Array.prototype||p==Object.prototype||(p[s]=a.value),p},$jscomp.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol",$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE,$jscomp.polyfills={},$jscomp.propertyToPolyfillSymbol={},$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(p,s){var a=$jscomp.propertyToPolyfillSymbol[s];return a==null?p[s]:(a=p[a],a!==void 0?a:p[s])};$jscomp.polyfill=function(p,s,a,c){s&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(p,s,a,c):$jscomp.polyfillUnisolated(p,s,a,c))},$jscomp.polyfillUnisolated=function(p,s,a,c){for(a=$jscomp.global,p=p.split("."),c=0;c<p.length-1;c++){var i=p[c];if(!(i in a))return;a=a[i]}p=p[p.length-1],c=a[p],s=s(c),s!=c&&s!=null&&$jscomp.defineProperty(a,p,{configurable:!0,writable:!0,value:s})},$jscomp.polyfillIsolated=function(p,s,a,c){var i=p.split(".");p=i.length===1,c=i[0],c=!p&&c in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var I=0;I<i.length-1;I++){var _=i[I];if(!(_ in c))return;c=c[_]}i=i[i.length-1],a=$jscomp.IS_SYMBOL_NATIVE&&a==="es6"?c[i]:null,s=s(a),s!=null&&(p?$jscomp.defineProperty($jscomp.polyfills,i,{configurable:!0,writable:!0,value:s}):s!==a&&($jscomp.propertyToPolyfillSymbol[i]===void 0&&(a=1e9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[i]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(i):$jscomp.POLYFILL_PREFIX+a+"$"+i),$jscomp.defineProperty(c,$jscomp.propertyToPolyfillSymbol[i],{configurable:!0,writable:!0,value:s})))},$jscomp.polyfill("Promise",function(p){function s(){this.batch_=null}function a(_){return _ instanceof i?_:new i(function(y,b){y(_)})}if(p&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof $jscomp.global.PromiseRejectionEvent>"u")||!$jscomp.global.Promise||$jscomp.global.Promise.toString().indexOf("[native code]")===-1))return p;s.prototype.asyncExecute=function(_){if(this.batch_==null){this.batch_=[];var y=this;this.asyncExecuteFunction(function(){y.executeBatch_()})}this.batch_.push(_)};var c=$jscomp.global.setTimeout;s.prototype.asyncExecuteFunction=function(_){c(_,0)},s.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var _=this.batch_;this.batch_=[];for(var y=0;y<_.length;++y){var b=_[y];_[y]=null;try{b()}catch(D){this.asyncThrow_(D)}}}this.batch_=null},s.prototype.asyncThrow_=function(_){this.asyncExecuteFunction(function(){throw _})};var i=function(_){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var y=this.createResolveAndReject_();try{_(y.resolve,y.reject)}catch(b){y.reject(b)}};i.prototype.createResolveAndReject_=function(){function _(D){return function(L){b||(b=!0,D.call(y,L))}}var y=this,b=!1;return{resolve:_(this.resolveTo_),reject:_(this.reject_)}},i.prototype.resolveTo_=function(_){if(_===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(_ instanceof i)this.settleSameAsPromise_(_);else{t:switch(typeof _){case"object":var y=_!=null;break t;case"function":y=!0;break t;default:y=!1}y?this.resolveToNonPromiseObj_(_):this.fulfill_(_)}},i.prototype.resolveToNonPromiseObj_=function(_){var y=void 0;try{y=_.then}catch(b){this.reject_(b);return}typeof y=="function"?this.settleSameAsThenable_(y,_):this.fulfill_(_)},i.prototype.reject_=function(_){this.settle_(2,_)},i.prototype.fulfill_=function(_){this.settle_(1,_)},i.prototype.settle_=function(_,y){if(this.state_!=0)throw Error("Cannot settle("+_+", "+y+"): Promise already settled in state"+this.state_);this.state_=_,this.result_=y,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},i.prototype.scheduleUnhandledRejectionCheck_=function(){var _=this;c(function(){if(_.notifyUnhandledRejection_()){var y=$jscomp.global.console;typeof y<"u"&&y.error(_.result_)}},1)},i.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var _=$jscomp.global.CustomEvent,y=$jscomp.global.Event,b=$jscomp.global.dispatchEvent;return typeof b>"u"?!0:(typeof _=="function"?_=new _("unhandledrejection",{cancelable:!0}):typeof y=="function"?_=new y("unhandledrejection",{cancelable:!0}):(_=$jscomp.global.document.createEvent("CustomEvent"),_.initCustomEvent("unhandledrejection",!1,!0,_)),_.promise=this,_.reason=this.result_,b(_))},i.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var _=0;_<this.onSettledCallbacks_.length;++_)I.asyncExecute(this.onSettledCallbacks_[_]);this.onSettledCallbacks_=null}};var I=new s;return i.prototype.settleSameAsPromise_=function(_){var y=this.createResolveAndReject_();_.callWhenSettled_(y.resolve,y.reject)},i.prototype.settleSameAsThenable_=function(_,y){var b=this.createResolveAndReject_();try{_.call(y,b.resolve,b.reject)}catch(D){b.reject(D)}},i.prototype.then=function(_,y){function b(m,A){return typeof m=="function"?function(E){try{D(m(E))}catch(z){L(z)}}:A}var D,L,X=new i(function(m,A){D=m,L=A});return this.callWhenSettled_(b(_,D),b(y,L)),X},i.prototype.catch=function(_){return this.then(void 0,_)},i.prototype.callWhenSettled_=function(_,y){function b(){switch(D.state_){case 1:_(D.result_);break;case 2:y(D.result_);break;default:throw Error("Unexpected state: "+D.state_)}}var D=this;this.onSettledCallbacks_==null?I.asyncExecute(b):this.onSettledCallbacks_.push(b),this.isRejectionHandled_=!0},i.resolve=a,i.reject=function(_){return new i(function(y,b){b(_)})},i.race=function(_){return new i(function(y,b){for(var D=$jscomp.makeIterator(_),L=D.next();!L.done;L=D.next())a(L.value).callWhenSettled_(y,b)})},i.all=function(_){var y=$jscomp.makeIterator(_),b=y.next();return b.done?a([]):new i(function(D,L){function X(E){return function(z){m[E]=z,A--,A==0&&D(m)}}var m=[],A=0;do m.push(void 0),A++,a(b.value).callWhenSettled_(X(m.length-1),L),b=y.next();while(!b.done)})},i},"es6","es3"),$jscomp.owns=function(p,s){return Object.prototype.hasOwnProperty.call(p,s)},$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,s){for(var a=1;a<arguments.length;a++){var c=arguments[a];if(c)for(var i in c)$jscomp.owns(c,i)&&(p[i]=c[i])}return p},$jscomp.polyfill("Object.assign",function(p){return p||$jscomp.assign},"es6","es3"),$jscomp.checkStringArgs=function(p,s,a){if(p==null)throw new TypeError("The 'this' value for String.prototype."+a+" must not be null or undefined");if(s instanceof RegExp)throw new TypeError("First argument to String.prototype."+a+" must not be a regular expression");return p+""},$jscomp.polyfill("String.prototype.startsWith",function(p){return p||function(s,a){var c=$jscomp.checkStringArgs(this,s,"startsWith");s+="";var i=c.length,I=s.length;a=Math.max(0,Math.min(a|0,c.length));for(var _=0;_<I&&a<i;)if(c[a++]!=s[_++])return!1;return _>=I}},"es6","es3"),$jscomp.polyfill("Array.prototype.copyWithin",function(p){function s(a){return a=Number(a),a===1/0||a===-1/0?a:a|0}return p||function(a,c,i){var I=this.length;if(a=s(a),c=s(c),i=i===void 0?I:s(i),a=0>a?Math.max(I+a,0):Math.min(a,I),c=0>c?Math.max(I+c,0):Math.min(c,I),i=0>i?Math.max(I+i,0):Math.min(i,I),a<c)for(;c<i;)c in this?this[a++]=this[c++]:(delete this[a++],c++);else for(i=Math.min(i,I+c-a),a+=i-c;i>c;)--i in this?this[--a]=this[i]:delete this[--a];return this}},"es6","es3"),$jscomp.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin},$jscomp.polyfill("Int8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint8Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint8ClampedArray.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Int16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint16Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Int32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Uint32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Float32Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5"),$jscomp.polyfill("Float64Array.prototype.copyWithin",$jscomp.typedArrayCopyWithin,"es6","es5");var DracoDecoderModule=function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(s){function a(e){return t.locateFile?t.locateFile(e,W):W+e}function c(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&>)return gt.decode(e.subarray(r,n));for(o="";r<n;){var l=e[r++];if(l&128){var d=e[r++]&63;if((l&224)==192)o+=String.fromCharCode((l&31)<<6|d);else{var k=e[r++]&63;l=(l&240)==224?(l&15)<<12|d<<6|k:(l&7)<<18|d<<12|k<<6|e[r++]&63,65536>l?o+=String.fromCharCode(l):(l-=65536,o+=String.fromCharCode(55296|l>>10,56320|l&1023))}}else o+=String.fromCharCode(l)}return o}function i(e,r){return e?c(Z,e,r):""}function I(){var e=nt.buffer;t.HEAP8=H=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=tt=new Int32Array(e),t.HEAPU8=Z=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function _(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",K(e),It=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),rt(e),e}function y(e){try{if(e==w&&$)return new Uint8Array($);if(pt)return pt(e);throw"both async and sync fetching of the wasm failed"}catch(r){_(r)}}function b(){if(!$&&(ht||J)){if(typeof fetch=="function"&&!w.startsWith("file://"))return fetch(w,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+w+"'";return e.arrayBuffer()}).catch(function(){return y(w)});if(at)return new Promise(function(e,r){at(w,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return y(w)})}function D(e){for(;0<e.length;)e.shift()(t)}function L(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){tt[this.ptr>>2]=r},this.set_caught=function(r){H[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return H[this.ptr+12>>0]!=0},this.set_rethrown=function(r){H[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return H[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){tt[this.ptr>>2]+=1},this.release_ref=function(){var r=tt[this.ptr>>2];return tt[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(un(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function X(){function e(){if(!ot&&(ot=!0,t.calledRun=!0,!It)){if(Gt=!0,D(ut),mt(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Et.unshift(t.postRun.shift());D(Et)}}if(!(0<q)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)vt.unshift(t.preRun.shift());D(vt),0<q||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function m(){}function A(e){return(e||m).__cache__}function E(e,r){var n=A(r),o=n[e];return o||(o=Object.create((r||m).prototype),o.ptr=e,n[e]=o)}function z(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var l=0;l<e.length;++l){var d=e.charCodeAt(l);if(55296<=d&&57343>=d){var k=e.charCodeAt(++l);d=65536+((d&1023)<<10)|k&1023}if(127>=d){if(n>=o)break;r[n++]=d}else{if(2047>=d){if(n+1>=o)break;r[n++]=192|d>>6}else{if(65535>=d){if(n+2>=o)break;r[n++]=224|d>>12}else{if(n+3>=o)break;r[n++]=240|d>>18,r[n++]=128|d>>12&63}r[n++]=128|d>>6&63}r[n++]=128|d&63}}r[n]=0}return e=f.alloc(r,H),f.copy(r,H,e),e}return e}function _t(e){if(typeof e=="object"){var r=f.alloc(e,H);return f.copy(e,H,r),r}return e}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL"}function V(){this.ptr=jt(),A(V)[this.ptr]=this}function C(){this.ptr=St(),A(C)[this.ptr]=this}function Q(){this.ptr=Ut(),A(Q)[this.ptr]=this}function h(){this.ptr=Lt(),A(h)[this.ptr]=this}function v(){this.ptr=qt(),A(v)[this.ptr]=this}function O(){this.ptr=Zt(),A(O)[this.ptr]=this}function j(){this.ptr=ne(),A(j)[this.ptr]=this}function G(){this.ptr=pe(),A(G)[this.ptr]=this}function B(){this.ptr=ye(),A(B)[this.ptr]=this}function g(){throw"cannot construct a Status, no constructor in IDL"}function P(){this.ptr=he(),A(P)[this.ptr]=this}function R(){this.ptr=Ie(),A(R)[this.ptr]=this}function S(){this.ptr=Ge(),A(S)[this.ptr]=this}function M(){this.ptr=Re(),A(M)[this.ptr]=this}function N(){this.ptr=Ue(),A(N)[this.ptr]=this}function U(){this.ptr=we(),A(U)[this.ptr]=this}function F(){this.ptr=We(),A(F)[this.ptr]=this}function T(){this.ptr=He(),A(T)[this.ptr]=this}function u(){this.ptr=er(),A(u)[this.ptr]=this}s=s===void 0?{}:s;var t=typeof s<"u"?s:{},mt,rt;t.ready=new Promise(function(e,r){mt=e,rt=r});var ft=!1,dt=!1;t.onRuntimeInitialized=function(){ft=!0,dt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){dt=!0,ft&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var bt=Object.assign({},t),ht=typeof window=="object",J=typeof importScripts=="function",At=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",W="";if(At){var Tt=require("fs"),it=require("path");W=J?it.dirname(W)+"/":__dirname+"/";var Dt=function(e,r){return e=e.startsWith("file://")?new URL(e):it.normalize(e),Tt.readFileSync(e,r?void 0:"utf8")},pt=function(e){return e=Dt(e,!0),e.buffer||(e=new Uint8Array(e)),e},at=function(e,r,n){e=e.startsWith("file://")?new URL(e):it.normalize(e),Tt.readFile(e,function(o,l){o?n(o):r(l.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(ht||J)&&(J?W=self.location.href:typeof document<"u"&&document.currentScript&&(W=document.currentScript.src),p&&(W=p),W=W.indexOf("blob:")!==0?W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Dt=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},J&&(pt=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),at=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var cn=t.print||console.log.bind(console),K=t.printErr||console.warn.bind(console);Object.assign(t,bt),bt=null;var $;t.wasmBinary&&($=t.wasmBinary),typeof WebAssembly!="object"&&_("no native wasm support detected");var nt,It=!1,gt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,H,Z,tt,x,vt=[],ut=[],Et=[],Gt=!1,q=0,st=null,et=null,w="draco_decoder.wasm";w.startsWith("data:application/octet-stream;base64,")||(w=a(w));var yn=0,ln=[null,[],[]],mn={b:function(e,r,n){throw new L(e).init(r,n),yn++,e},a:function(){_("")},g:function(e,r,n){Z.copyWithin(e,r,r+n)},e:function(e){var r=Z.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var l=Math;o=Math.max(e,o),l=l.min.call(l,2147483648,o+(65536-o%65536)%65536);t:{o=nt.buffer;try{nt.grow(l-o.byteLength+65535>>>16),I();var d=1;break t}catch{}d=void 0}if(d)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,l){return 70},c:function(e,r,n,o){for(var l=0,d=0;d<n;d++){var k=x[r>>2],sn=x[r+4>>2];r+=8;for(var ct=0;ct<sn;ct++){var yt=Z[k+ct],lt=ln[e];yt===0||yt===10?((e===1?cn:K)(c(lt,0)),lt.length=0):lt.push(yt)}l+=sn}return x[o>>2]=l,0}};(function(){function e(l,d){t.asm=l.exports,nt=t.asm.h,I(),ut.unshift(t.asm.i),q--,t.monitorRunDependencies&&t.monitorRunDependencies(q),q==0&&(st!==null&&(clearInterval(st),st=null),et&&(l=et,et=null,l()))}function r(l){e(l.instance)}function n(l){return b().then(function(d){return WebAssembly.instantiate(d,o)}).then(function(d){return d}).then(l,function(d){K("failed to asynchronously prepare wasm: "+d),_(d)})}var o={a:mn};if(q++,t.monitorRunDependencies&&t.monitorRunDependencies(q),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(l){K("Module.instantiateWasm callback failed with error: "+l),rt(l)}return function(){return $||typeof WebAssembly.instantiateStreaming!="function"||w.startsWith("data:application/octet-stream;base64,")||w.startsWith("file://")||At||typeof fetch!="function"?n(r):fetch(w,{credentials:"same-origin"}).then(function(l){return WebAssembly.instantiateStreaming(l,o).then(r,function(d){return K("wasm streaming compile failed: "+d),K("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(rt),{}})();var Ot=t._emscripten_bind_VoidPtr___destroy___0=function(){return(Ot=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},jt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(jt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Pt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Pt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Rt=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Rt=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},St=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(St=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Mt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Mt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Nt=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Nt=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},Ut=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(Ut=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},Ft=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(Ft=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Lt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Lt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Ct=t._emscripten_bind_PointAttribute_size_0=function(){return(Ct=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},zt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(zt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(Vt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Bt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Wt=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(xt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(Qt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Yt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Ht=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},qt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(qt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},kt=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return(kt=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Xt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Xt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},Kt=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(Kt=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},Zt=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(Zt=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},te=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(te=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},ee=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(ee=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},re=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ne=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ne=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},oe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(oe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},_e=t._emscripten_bind_PointCloud_num_points_0=function(){return(_e=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},ie=t._emscripten_bind_PointCloud___destroy___0=function(){return(ie=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},pe=t._emscripten_bind_Mesh_Mesh_0=function(){return(pe=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ae=t._emscripten_bind_Mesh_num_faces_0=function(){return(ae=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},ue=t._emscripten_bind_Mesh_num_attributes_0=function(){return(ue=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},se=t._emscripten_bind_Mesh_num_points_0=function(){return(se=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},ce=t._emscripten_bind_Mesh___destroy___0=function(){return(ce=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},ye=t._emscripten_bind_Metadata_Metadata_0=function(){return(ye=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},le=t._emscripten_bind_Metadata___destroy___0=function(){return(le=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},me=t._emscripten_bind_Status_code_0=function(){return(me=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},fe=t._emscripten_bind_Status_ok_0=function(){return(fe=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},de=t._emscripten_bind_Status_error_msg_0=function(){return(de=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},be=t._emscripten_bind_Status___destroy___0=function(){return(be=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},he=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(he=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},Ae=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(Ae=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},Te=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(Te=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},De=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(De=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ie=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ie=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},ge=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},ve=t._emscripten_bind_DracoInt8Array_size_0=function(){return(ve=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Ee=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Ge=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Oe=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},je=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Pe=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Re=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Re=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Se=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Me=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Me=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ne=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},Ue=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},Fe=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Le=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Ce=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},we=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(we=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},ze=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},Ve=t._emscripten_bind_DracoInt32Array_size_0=function(){return(Ve=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Be=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},We=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(We=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},xe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(xe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},Qe=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(Qe=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Ye=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},He=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(He=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},qe=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(qe=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},ke=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return(ke=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Xe=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Xe=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(Ke=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return($e=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(tr=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},er=t._emscripten_bind_Decoder_Decoder_0=function(){return(er=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},rr=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(rr=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},nr=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(nr=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},or=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(or=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},_r=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(_r=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},ir=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(ir=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},ar=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(ar=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(ur=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(cr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(yr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(lr=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(mr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(fr=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(dr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(br=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(hr=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Er=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Er=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Gr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Or=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(jr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder___destroy___0=function(){return(Pr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Rr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Rr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Sr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Sr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Mr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Mr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Nr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Nr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},Ur=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(Ur=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},Fr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(Fr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Lr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Lr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Cr=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Cr=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},Vr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(Vr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Br=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Br=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Wr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Wr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},xr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(xr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},Qr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(Qr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Yr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Yr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Hr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Hr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(qr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT32=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(tn=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(en=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},rn=t._emscripten_enum_draco_StatusCode_OK=function(){return(rn=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},nn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(nn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},on=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(on=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},_n=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(_n=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(pn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(an=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var un=function(){return(un=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var ot;if(et=function e(){ot||X(),ot||(et=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();X(),m.prototype=Object.create(m.prototype),m.prototype.constructor=m,m.prototype.__class__=m,m.__cache__={},t.WrapperObject=m,t.getCache=A,t.wrapPointer=E,t.castObject=function(e,r){return E(e.ptr,r)},t.NULL=E(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete A(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var f={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(f.needed){for(var e=0;e<f.temps.length;e++)t._free(f.temps[e]);f.temps.length=0,t._free(f.buffer),f.buffer=0,f.size+=f.needed,f.needed=0}f.buffer||(f.size+=128,f.buffer=t._malloc(f.size),f.buffer||_(void 0)),f.pos=0},alloc:function(e,r){return f.buffer||_(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,f.pos+e>=f.size?(0<e||_(void 0),f.needed+=e,r=t._malloc(e),f.temps.push(r)):(r=f.buffer+f.pos,f.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return Y.prototype=Object.create(m.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.VoidPtr=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){Ot(this.ptr)},V.prototype=Object.create(m.prototype),V.prototype.constructor=V,V.prototype.__class__=V,V.__cache__={},t.DecoderBuffer=V,V.prototype.Init=V.prototype.Init=function(e,r){var n=this.ptr;f.prepare(),typeof e=="object"&&(e=_t(e)),r&&typeof r=="object"&&(r=r.ptr),Pt(n,e,r)},V.prototype.__destroy__=V.prototype.__destroy__=function(){Rt(this.ptr)},C.prototype=Object.create(m.prototype),C.prototype.constructor=C,C.prototype.__class__=C,C.__cache__={},t.AttributeTransformData=C,C.prototype.transform_type=C.prototype.transform_type=function(){return Mt(this.ptr)},C.prototype.__destroy__=C.prototype.__destroy__=function(){Nt(this.ptr)},Q.prototype=Object.create(m.prototype),Q.prototype.constructor=Q,Q.prototype.__class__=Q,Q.__cache__={},t.GeometryAttribute=Q,Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Ft(this.ptr)},h.prototype=Object.create(m.prototype),h.prototype.constructor=h,h.prototype.__class__=h,h.__cache__={},t.PointAttribute=h,h.prototype.size=h.prototype.size=function(){return Ct(this.ptr)},h.prototype.GetAttributeTransformData=h.prototype.GetAttributeTransformData=function(){return E(wt(this.ptr),C)},h.prototype.attribute_type=h.prototype.attribute_type=function(){return zt(this.ptr)},h.prototype.data_type=h.prototype.data_type=function(){return Vt(this.ptr)},h.prototype.num_components=h.prototype.num_components=function(){return Bt(this.ptr)},h.prototype.normalized=h.prototype.normalized=function(){return!!Wt(this.ptr)},h.prototype.byte_stride=h.prototype.byte_stride=function(){return xt(this.ptr)},h.prototype.byte_offset=h.prototype.byte_offset=function(){return Qt(this.ptr)},h.prototype.unique_id=h.prototype.unique_id=function(){return Yt(this.ptr)},h.prototype.__destroy__=h.prototype.__destroy__=function(){Ht(this.ptr)},v.prototype=Object.create(m.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.AttributeQuantizationTransform=v,v.prototype.InitFromAttribute=v.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!kt(r,e)},v.prototype.quantization_bits=v.prototype.quantization_bits=function(){return Xt(this.ptr)},v.prototype.min_value=v.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Kt(r,e)},v.prototype.range=v.prototype.range=function(){return Jt(this.ptr)},v.prototype.__destroy__=v.prototype.__destroy__=function(){$t(this.ptr)},O.prototype=Object.create(m.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.AttributeOctahedronTransform=O,O.prototype.InitFromAttribute=O.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!te(r,e)},O.prototype.quantization_bits=O.prototype.quantization_bits=function(){return ee(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(m.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.PointCloud=j,j.prototype.num_attributes=j.prototype.num_attributes=function(){return oe(this.ptr)},j.prototype.num_points=j.prototype.num_points=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},G.prototype=Object.create(m.prototype),G.prototype.constructor=G,G.prototype.__class__=G,G.__cache__={},t.Mesh=G,G.prototype.num_faces=G.prototype.num_faces=function(){return ae(this.ptr)},G.prototype.num_attributes=G.prototype.num_attributes=function(){return ue(this.ptr)},G.prototype.num_points=G.prototype.num_points=function(){return se(this.ptr)},G.prototype.__destroy__=G.prototype.__destroy__=function(){ce(this.ptr)},B.prototype=Object.create(m.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.Metadata=B,B.prototype.__destroy__=B.prototype.__destroy__=function(){le(this.ptr)},g.prototype=Object.create(m.prototype),g.prototype.constructor=g,g.prototype.__class__=g,g.__cache__={},t.Status=g,g.prototype.code=g.prototype.code=function(){return me(this.ptr)},g.prototype.ok=g.prototype.ok=function(){return!!fe(this.ptr)},g.prototype.error_msg=g.prototype.error_msg=function(){return i(de(this.ptr))},g.prototype.__destroy__=g.prototype.__destroy__=function(){be(this.ptr)},P.prototype=Object.create(m.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.DracoFloat32Array=P,P.prototype.GetValue=P.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Ae(r,e)},P.prototype.size=P.prototype.size=function(){return Te(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(m.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoInt8Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(m.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoUInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(m.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoInt16Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(m.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoUInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(m.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoInt32Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(m.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoUInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),xe(r,e)},F.prototype.size=F.prototype.size=function(){return Qe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},T.prototype=Object.create(m.prototype),T.prototype.constructor=T,T.prototype.__class__=T,T.__cache__={},t.MetadataQuerier=T,T.prototype.HasEntry=T.prototype.HasEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),!!qe(n,e,r)},T.prototype.GetIntEntry=T.prototype.GetIntEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),ke(n,e,r)},T.prototype.GetIntEntryArray=T.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),n&&typeof n=="object"&&(n=n.ptr),Xe(o,e,r,n)},T.prototype.GetDoubleEntry=T.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),Ke(n,e,r)},T.prototype.GetStringEntry=T.prototype.GetStringEntry=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),i(Je(n,e,r))},T.prototype.NumEntries=T.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),$e(r,e)},T.prototype.GetEntryName=T.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),i(Ze(n,e,r))},T.prototype.__destroy__=T.prototype.__destroy__=function(){tr(this.ptr)},u.prototype=Object.create(m.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return f.prepare(),typeof e=="object"&&(e=_t(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),E(rr(o,e,r,n),g)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return f.prepare(),typeof e=="object"&&(e=_t(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),E(nr(o,e,r,n),g)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),or(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),_r(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return f.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:z(r),n=n&&typeof n=="object"?n.ptr:z(n),ir(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(pr(n,e,r),h)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(ar(n,e,r),h)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),E(ur(r,e),B)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(sr(n,e,r),B)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!cr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),yr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!lr(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!mr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!dr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,l){var d=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),l&&typeof l=="object"&&(l=l.ptr),!!vr(d,e,r,n,o,l)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Er(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Gr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(Or(n,e,r),g)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),E(jr(n,e,r),g)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Pr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Rr(),t.ATTRIBUTE_NO_TRANSFORM=Sr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Mr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Nr(),t.INVALID=Ur(),t.POSITION=Fr(),t.NORMAL=Lr(),t.COLOR=Cr(),t.TEX_COORD=wr(),t.GENERIC=zr(),t.INVALID_GEOMETRY_TYPE=Vr(),t.POINT_CLOUD=Br(),t.TRIANGULAR_MESH=Wr(),t.DT_INVALID=xr(),t.DT_INT8=Qr(),t.DT_UINT8=Yr(),t.DT_INT16=Hr(),t.DT_UINT16=qr(),t.DT_INT32=kr(),t.DT_UINT32=Xr(),t.DT_INT64=Kr(),t.DT_UINT64=Jr(),t.DT_FLOAT32=$r(),t.DT_FLOAT64=Zr(),t.DT_BOOL=tn(),t.DT_TYPES_COUNT=en(),t.OK=rn(),t.DRACO_ERROR=nn(),t.IO_ERROR=on(),t.INVALID_PARAMETER=_n(),t.UNSUPPORTED_VERSION=pn(),t.UNKNOWN_VERSION=an()}Gt?e():ut.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},s.ready}}();typeof exports=="object"&&typeof module=="object"?module.exports=DracoDecoderModule:typeof define=="function"&&define.amd?define([],function(){return DracoDecoderModule}):typeof exports=="object"&&(exports.DracoDecoderModule=DracoDecoderModule); diff --git a/public/lib/Cesium/ThirdParty/Workers/pako_deflate.min.js b/public/lib/Cesium/ThirdParty/Workers/pako_deflate.min.js index eefd048e..71416d2a 100644 --- a/public/lib/Cesium/ThirdParty/Workers/pako_deflate.min.js +++ b/public/lib/Cesium/ThirdParty/Workers/pako_deflate.min.js @@ -1 +1 @@ -/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(y,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((y=typeof globalThis<"u"?globalThis:y||self).pako={})})(this,function(y){"use strict";function z(e){let n=e.length;for(;--n>=0;)e[n]=0}const he=256,ze=286,H=30,M=15,oe=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ea=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ke=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),E=new Array(576);z(E);const P=new Array(60);z(P);const j=new Array(512);z(j);const K=new Array(256);z(K);const de=new Array(29);z(de);const ee=new Array(H);function ue(e,n,r,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=r,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let xe,Ae,Ee;function fe(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}z(ee);const Ze=e=>e<256?j[e]:j[256+(e>>>7)],Y=(e,n)=>{e.pending_buf[e.pending++]=255&n,e.pending_buf[e.pending++]=n>>>8&255},w=(e,n,r)=>{e.bi_valid>16-r?(e.bi_buf|=n<<e.bi_valid&65535,Y(e,e.bi_buf),e.bi_buf=n>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=r)},k=(e,n,r)=>{w(e,r[2*n],r[2*n+1])},Re=(e,n)=>{let r=0;do r|=1&e,e>>>=1,r<<=1;while(--n>0);return r>>>1},Ue=(e,n,r)=>{const i=new Array(16);let a,_,t=0;for(a=1;a<=M;a++)i[a]=t=t+r[a-1]<<1;for(_=0;_<=n;_++){let s=e[2*_+1];s!==0&&(e[2*_]=Re(i[s]++,s))}},Se=e=>{let n;for(n=0;n<ze;n++)e.dyn_ltree[2*n]=0;for(n=0;n<H;n++)e.dyn_dtree[2*n]=0;for(n=0;n<19;n++)e.bl_tree[2*n]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Te=e=>{e.bi_valid>8?Y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Le=(e,n,r,i)=>{const a=2*n,_=2*r;return e[a]<e[_]||e[a]===e[_]&&i[n]<=i[r]},ce=(e,n,r)=>{const i=e.heap[r];let a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&Le(n,e.heap[a+1],e.heap[a],e.depth)&&a++,!Le(n,i,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=i},Fe=(e,n,r)=>{let i,a,_,t,s=0;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],a=e.pending_buf[e.l_buf+s],s++,i===0?k(e,a,n):(_=K[a],k(e,_+he+1,n),t=oe[_],t!==0&&(a-=de[_],w(e,a,t)),i--,_=Ze(i),k(e,_,r),t=$[_],t!==0&&(i-=ee[_],w(e,i,t)));while(s<e.last_lit);k(e,256,n)},pe=(e,n)=>{const r=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,_=n.stat_desc.elems;let t,s,h,l=-1;for(e.heap_len=0,e.heap_max=573,t=0;t<_;t++)r[2*t]!==0?(e.heap[++e.heap_len]=l=t,e.depth[t]=0):r[2*t+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,r[2*h]=1,e.depth[h]=0,e.opt_len--,a&&(e.static_len-=i[2*h+1]);for(n.max_code=l,t=e.heap_len>>1;t>=1;t--)ce(e,r,t);h=_;do t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ce(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=s,r[2*h]=r[2*t]+r[2*s],e.depth[h]=(e.depth[t]>=e.depth[s]?e.depth[t]:e.depth[s])+1,r[2*t+1]=r[2*s+1]=h,e.heap[1]=h++,ce(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((o,u)=>{const g=u.dyn_tree,c=u.max_code,te=u.stat_desc.static_tree,La=u.stat_desc.has_stree,Fa=u.stat_desc.extra_bits,$e=u.stat_desc.extra_base,Q=u.stat_desc.max_length;let V,v,B,f,_e,ye,le=0;for(f=0;f<=M;f++)o.bl_count[f]=0;for(g[2*o.heap[o.heap_max]+1]=0,V=o.heap_max+1;V<573;V++)v=o.heap[V],f=g[2*g[2*v+1]+1]+1,f>Q&&(f=Q,le++),g[2*v+1]=f,v>c||(o.bl_count[f]++,_e=0,v>=$e&&(_e=Fa[v-$e]),ye=g[2*v],o.opt_len+=ye*(f+_e),La&&(o.static_len+=ye*(te[2*v+1]+_e)));if(le!==0){do{for(f=Q-1;o.bl_count[f]===0;)f--;o.bl_count[f]--,o.bl_count[f+1]+=2,o.bl_count[Q]--,le-=2}while(le>0);for(f=Q;f!==0;f--)for(v=o.bl_count[f];v!==0;)B=o.heap[--V],B>c||(g[2*B+1]!==f&&(o.opt_len+=(f-g[2*B+1])*g[2*B],g[2*B+1]=f),v--)}})(e,n),Ue(r,l,e.bl_count)},Oe=(e,n,r)=>{let i,a,_=-1,t=n[1],s=0,h=7,l=4;for(t===0&&(h=138,l=3),n[2*(r+1)+1]=65535,i=0;i<=r;i++)a=t,t=n[2*(i+1)+1],++s<h&&a===t||(s<l?e.bl_tree[2*a]+=s:a!==0?(a!==_&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,_=a,t===0?(h=138,l=3):a===t?(h=6,l=3):(h=7,l=4))},De=(e,n,r)=>{let i,a,_=-1,t=n[1],s=0,h=7,l=4;for(t===0&&(h=138,l=3),i=0;i<=r;i++)if(a=t,t=n[2*(i+1)+1],!(++s<h&&a===t)){if(s<l)do k(e,a,e.bl_tree);while(--s!=0);else a!==0?(a!==_&&(k(e,a,e.bl_tree),s--),k(e,16,e.bl_tree),w(e,s-3,2)):s<=10?(k(e,17,e.bl_tree),w(e,s-3,3)):(k(e,18,e.bl_tree),w(e,s-11,7));s=0,_=a,t===0?(h=138,l=3):a===t?(h=6,l=3):(h=7,l=4)}};let Ne=!1;const Ie=(e,n,r,i)=>{w(e,0+(i?1:0),3),((a,_,t,s)=>{Te(a),s&&(Y(a,t),Y(a,~t)),a.pending_buf.set(a.window.subarray(_,_+t),a.pending),a.pending+=t})(e,n,r,!0)};var aa={_tr_init:e=>{Ne||((()=>{let n,r,i,a,_;const t=new Array(16);for(i=0,a=0;a<28;a++)for(de[a]=i,n=0;n<1<<oe[a];n++)K[i++]=a;for(K[i-1]=a,_=0,a=0;a<16;a++)for(ee[a]=_,n=0;n<1<<$[a];n++)j[_++]=a;for(_>>=7;a<H;a++)for(ee[a]=_<<7,n=0;n<1<<$[a]-7;n++)j[256+_++]=a;for(r=0;r<=M;r++)t[r]=0;for(n=0;n<=143;)E[2*n+1]=8,n++,t[8]++;for(;n<=255;)E[2*n+1]=9,n++,t[9]++;for(;n<=279;)E[2*n+1]=7,n++,t[7]++;for(;n<=287;)E[2*n+1]=8,n++,t[8]++;for(Ue(E,287,t),n=0;n<H;n++)P[2*n+1]=5,P[2*n]=Re(n,5);xe=new ue(E,oe,257,ze,M),Ae=new ue(P,$,0,H,M),Ee=new ue(new Array(0),ea,0,19,7)})(),Ne=!0),e.l_desc=new fe(e.dyn_ltree,xe),e.d_desc=new fe(e.dyn_dtree,Ae),e.bl_desc=new fe(e.bl_tree,Ee),e.bi_buf=0,e.bi_valid=0,Se(e)},_tr_stored_block:Ie,_tr_flush_block:(e,n,r,i)=>{let a,_,t=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(s=>{let h,l=4093624447;for(h=0;h<=31;h++,l>>>=1)if(1&l&&s.dyn_ltree[2*h]!==0)return 0;if(s.dyn_ltree[18]!==0||s.dyn_ltree[20]!==0||s.dyn_ltree[26]!==0)return 1;for(h=32;h<he;h++)if(s.dyn_ltree[2*h]!==0)return 1;return 0})(e)),pe(e,e.l_desc),pe(e,e.d_desc),t=(s=>{let h;for(Oe(s,s.dyn_ltree,s.l_desc.max_code),Oe(s,s.dyn_dtree,s.d_desc.max_code),pe(s,s.bl_desc),h=18;h>=3&&s.bl_tree[2*ke[h]+1]===0;h--);return s.opt_len+=3*(h+1)+5+5+4,h})(e),a=e.opt_len+3+7>>>3,_=e.static_len+3+7>>>3,_<=a&&(a=_)):a=_=r+5,r+4<=a&&n!==-1?Ie(e,n,r,i):e.strategy===4||_===a?(w(e,2+(i?1:0),3),Fe(e,E,P)):(w(e,4+(i?1:0),3),((s,h,l,o)=>{let u;for(w(s,h-257,5),w(s,l-1,5),w(s,o-4,4),u=0;u<o;u++)w(s,s.bl_tree[2*ke[u]+1],3);De(s,s.dyn_ltree,h-1),De(s,s.dyn_dtree,l-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,t+1),Fe(e,e.dyn_ltree,e.dyn_dtree)),Se(e),i&&Te(e)},_tr_tally:(e,n,r)=>(e.pending_buf[e.d_buf+2*e.last_lit]=n>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&n,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,n===0?e.dyn_ltree[2*r]++:(e.matches++,n--,e.dyn_ltree[2*(K[r]+he+1)]++,e.dyn_dtree[2*Ze(n)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{w(e,2,3),k(e,256,E),(n=>{n.bi_valid===16?(Y(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=255&n.bi_buf,n.bi_buf>>=8,n.bi_valid-=8)})(e)}},Ce=(e,n,r,i)=>{let a=65535&e|0,_=e>>>16&65535|0,t=0;for(;r!==0;){t=r>2e3?2e3:r,r-=t;do a=a+n[i++]|0,_=_+a|0;while(--t);a%=65521,_%=65521}return a|_<<16|0};const na=new Uint32Array((()=>{let e,n=[];for(var r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;n[r]=e}return n})());var Z=(e,n,r,i)=>{const a=na,_=i+r;e^=-1;for(let t=i;t<_;t++)e=e>>>8^a[255&(e^n[t])];return-1^e},ae={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ge={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ra,_tr_stored_block:ia,_tr_flush_block:sa,_tr_tally:R,_tr_align:ta}=aa,{Z_NO_FLUSH:O,Z_PARTIAL_FLUSH:_a,Z_FULL_FLUSH:la,Z_FINISH:U,Z_BLOCK:Be,Z_OK:x,Z_STREAM_END:He,Z_STREAM_ERROR:b,Z_DATA_ERROR:ha,Z_BUF_ERROR:we,Z_DEFAULT_COMPRESSION:oa,Z_FILTERED:da,Z_HUFFMAN_ONLY:ne,Z_RLE:ua,Z_FIXED:fa,Z_DEFAULT_STRATEGY:ca,Z_UNKNOWN:pa,Z_DEFLATED:re}=ge,D=258,m=262,ie=103,N=113,G=666,S=(e,n)=>(e.msg=ae[n],n),Me=e=>(e<<1)-(e>4?9:0),T=e=>{let n=e.length;for(;--n>=0;)e[n]=0};let L=(e,n,r)=>(n<<e.hash_shift^r)&e.hash_mask;const F=e=>{const n=e.state;let r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+r),e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))},p=(e,n)=>{sa(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,F(e.strm)},d=(e,n)=>{e.pending_buf[e.pending++]=n},X=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=255&n},ga=(e,n,r,i)=>{let a=e.avail_in;return a>i&&(a=i),a===0?0:(e.avail_in-=a,n.set(e.input.subarray(e.next_in,e.next_in+a),r),e.state.wrap===1?e.adler=Ce(e.adler,n,a,r):e.state.wrap===2&&(e.adler=Z(e.adler,n,a,r)),e.next_in+=a,e.total_in+=a,a)},Pe=(e,n)=>{let r,i,a=e.max_chain_length,_=e.strstart,t=e.prev_length,s=e.nice_match;const h=e.strstart>e.w_size-m?e.strstart-(e.w_size-m):0,l=e.window,o=e.w_mask,u=e.prev,g=e.strstart+D;let c=l[_+t-1],te=l[_+t];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do if(r=n,l[r+t]===te&&l[r+t-1]===c&&l[r]===l[_]&&l[++r]===l[_+1]){_+=2,r++;do;while(l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&l[++_]===l[++r]&&_<g);if(i=D-(g-_),_=g-D,i>t){if(e.match_start=n,t=i,i>=s)break;c=l[_+t-1],te=l[_+t]}}while((n=u[n&o])>h&&--a!=0);return t<=e.lookahead?t:e.lookahead},I=e=>{const n=e.w_size;let r,i,a,_,t;do{if(_=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-m)){e.window.set(e.window.subarray(n,n+n),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);_+=n}if(e.strm.avail_in===0)break;if(i=ga(e.strm,e.window,e.strstart+e.lookahead,_),e.lookahead+=i,e.lookahead+e.insert>=3)for(t=e.strstart-e.insert,e.ins_h=e.window[t],e.ins_h=L(e,e.ins_h,e.window[t+1]);e.insert&&(e.ins_h=L(e,e.ins_h,e.window[t+3-1]),e.prev[t&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=t,t++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<m&&e.strm.avail_in!==0)},be=(e,n)=>{let r,i;for(;;){if(e.lookahead<m){if(I(e),e.lookahead<m&&n===O)return 1;if(e.lookahead===0)break}if(r=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-m&&(e.match_length=Pe(e,r)),e.match_length>=3)if(i=R(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L(e,e.ins_h,e.window[e.strstart+1]);else i=R(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(p(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,n===U?(p(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(p(e,!1),e.strm.avail_out===0)?1:2},C=(e,n)=>{let r,i,a;for(;;){if(e.lookahead<m){if(I(e),e.lookahead<m&&n===O)return 1;if(e.lookahead===0)break}if(r=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-m&&(e.match_length=Pe(e,r),e.match_length<=5&&(e.strategy===da||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,i=R(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(p(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(i=R(e,0,e.window[e.strstart-1]),i&&p(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=R(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,n===U?(p(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(p(e,!1),e.strm.avail_out===0)?1:2};function A(e,n,r,i,a){this.good_length=e,this.max_lazy=n,this.nice_length=r,this.max_chain=i,this.func=a}const W=[new A(0,0,0,0,(e,n)=>{let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(I(e),e.lookahead===0&&n===O)return 1;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,p(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-m&&(p(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,n===U?(p(e,!0),e.strm.avail_out===0?3:4):(e.strstart>e.block_start&&(p(e,!1),e.strm.avail_out),1)}),new A(4,4,8,4,be),new A(4,5,16,8,be),new A(4,6,32,32,be),new A(4,4,16,16,C),new A(8,16,32,32,C),new A(8,16,128,128,C),new A(8,32,128,256,C),new A(32,128,258,1024,C),new A(32,258,258,4096,C)];function wa(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=re,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const je=e=>{if(!e||!e.state)return S(e,b);e.total_in=e.total_out=0,e.data_type=pa;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?42:N,e.adler=n.wrap===2?0:1,n.last_flush=O,ra(n),x},Ke=e=>{const n=je(e);var r;return n===x&&((r=e.state).window_size=2*r.w_size,T(r.head),r.max_lazy_match=W[r.level].max_lazy,r.good_match=W[r.level].good_length,r.nice_match=W[r.level].nice_length,r.max_chain_length=W[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),n},Ye=(e,n,r,i,a,_)=>{if(!e)return b;let t=1;if(n===oa&&(n=6),i<0?(t=0,i=-i):i>15&&(t=2,i-=16),a<1||a>9||r!==re||i<8||i>15||n<0||n>9||_<0||_>fa)return S(e,b);i===8&&(i=9);const s=new wa;return e.state=s,s.strm=e,s.wrap=t,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=a+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<a+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=n,s.strategy=_,s.method=r,Ke(e)};var q={deflateInit:(e,n)=>Ye(e,n,re,15,8,ca),deflateInit2:Ye,deflateReset:Ke,deflateResetKeep:je,deflateSetHeader:(e,n)=>e&&e.state?e.state.wrap!==2?b:(e.state.gzhead=n,x):b,deflate:(e,n)=>{let r,i;if(!e||!e.state||n>Be||n<0)return e?S(e,b):b;const a=e.state;if(!e.output||!e.input&&e.avail_in!==0||a.status===G&&n!==U)return S(e,e.avail_out===0?we:b);a.strm=e;const _=a.last_flush;if(a.last_flush=n,a.status===42)if(a.wrap===2)e.adler=0,d(a,31),d(a,139),d(a,8),a.gzhead?(d(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),d(a,255&a.gzhead.time),d(a,a.gzhead.time>>8&255),d(a,a.gzhead.time>>16&255),d(a,a.gzhead.time>>24&255),d(a,a.level===9?2:a.strategy>=ne||a.level<2?4:0),d(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(d(a,255&a.gzhead.extra.length),d(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=Z(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69):(d(a,0),d(a,0),d(a,0),d(a,0),d(a,0),d(a,a.level===9?2:a.strategy>=ne||a.level<2?4:0),d(a,3),a.status=N);else{let t=re+(a.w_bits-8<<4)<<8,s=-1;s=a.strategy>=ne||a.level<2?0:a.level<6?1:a.level===6?2:3,t|=s<<6,a.strstart!==0&&(t|=32),t+=31-t%31,a.status=N,X(a,t),a.strstart!==0&&(X(a,e.adler>>>16),X(a,65535&e.adler)),e.adler=1}if(a.status===69)if(a.gzhead.extra){for(r=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),F(e),r=a.pending,a.pending!==a.pending_buf_size));)d(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=73)}else a.status=73;if(a.status===73)if(a.gzhead.name){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),F(e),r=a.pending,a.pending===a.pending_buf_size)){i=1;break}i=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,d(a,i)}while(i!==0);a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),i===0&&(a.gzindex=0,a.status=91)}else a.status=91;if(a.status===91)if(a.gzhead.comment){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),F(e),r=a.pending,a.pending===a.pending_buf_size)){i=1;break}i=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,d(a,i)}while(i!==0);a.gzhead.hcrc&&a.pending>r&&(e.adler=Z(e.adler,a.pending_buf,a.pending-r,r)),i===0&&(a.status=ie)}else a.status=ie;if(a.status===ie&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&F(e),a.pending+2<=a.pending_buf_size&&(d(a,255&e.adler),d(a,e.adler>>8&255),e.adler=0,a.status=N)):a.status=N),a.pending!==0){if(F(e),e.avail_out===0)return a.last_flush=-1,x}else if(e.avail_in===0&&Me(n)<=Me(_)&&n!==U)return S(e,we);if(a.status===G&&e.avail_in!==0)return S(e,we);if(e.avail_in!==0||a.lookahead!==0||n!==O&&a.status!==G){let t=a.strategy===ne?((s,h)=>{let l;for(;;){if(s.lookahead===0&&(I(s),s.lookahead===0)){if(h===O)return 1;break}if(s.match_length=0,l=R(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,l&&(p(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,h===U?(p(s,!0),s.strm.avail_out===0?3:4):s.last_lit&&(p(s,!1),s.strm.avail_out===0)?1:2})(a,n):a.strategy===ua?((s,h)=>{let l,o,u,g;const c=s.window;for(;;){if(s.lookahead<=D){if(I(s),s.lookahead<=D&&h===O)return 1;if(s.lookahead===0)break}if(s.match_length=0,s.lookahead>=3&&s.strstart>0&&(u=s.strstart-1,o=c[u],o===c[++u]&&o===c[++u]&&o===c[++u])){g=s.strstart+D;do;while(o===c[++u]&&o===c[++u]&&o===c[++u]&&o===c[++u]&&o===c[++u]&&o===c[++u]&&o===c[++u]&&o===c[++u]&&u<g);s.match_length=D-(g-u),s.match_length>s.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=3?(l=R(s,1,s.match_length-3),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(l=R(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),l&&(p(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,h===U?(p(s,!0),s.strm.avail_out===0?3:4):s.last_lit&&(p(s,!1),s.strm.avail_out===0)?1:2})(a,n):W[a.level].func(a,n);if(t!==3&&t!==4||(a.status=G),t===1||t===3)return e.avail_out===0&&(a.last_flush=-1),x;if(t===2&&(n===_a?ta(a):n!==Be&&(ia(a,0,0,!1),n===la&&(T(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),F(e),e.avail_out===0))return a.last_flush=-1,x}return n!==U?x:a.wrap<=0?He:(a.wrap===2?(d(a,255&e.adler),d(a,e.adler>>8&255),d(a,e.adler>>16&255),d(a,e.adler>>24&255),d(a,255&e.total_in),d(a,e.total_in>>8&255),d(a,e.total_in>>16&255),d(a,e.total_in>>24&255)):(X(a,e.adler>>>16),X(a,65535&e.adler)),F(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?x:He)},deflateEnd:e=>{if(!e||!e.state)return b;const n=e.state.status;return n!==42&&n!==69&&n!==73&&n!==91&&n!==ie&&n!==N&&n!==G?S(e,b):(e.state=null,n===N?S(e,ha):x)},deflateSetDictionary:(e,n)=>{let r=n.length;if(!e||!e.state)return b;const i=e.state,a=i.wrap;if(a===2||a===1&&i.status!==42||i.lookahead)return b;if(a===1&&(e.adler=Ce(e.adler,n,r,0)),i.wrap=0,r>=i.w_size){a===0&&(T(i.head),i.strstart=0,i.block_start=0,i.insert=0);let h=new Uint8Array(i.w_size);h.set(n.subarray(r-i.w_size,r),0),n=h,r=i.w_size}const _=e.avail_in,t=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=n,I(i);i.lookahead>=3;){let h=i.strstart,l=i.lookahead-2;do i.ins_h=L(i,i.ins_h,i.window[h+3-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++;while(--l);i.strstart=h,i.lookahead=2,I(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=t,e.input=s,e.avail_in=_,i.wrap=a,x},deflateInfo:"pako deflate (from Nodeca project)"};const ba=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var ma=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const r=n.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const i in r)ba(r,i)&&(e[i]=r[i])}}return e},va=e=>{let n=0;for(let i=0,a=e.length;i<a;i++)n+=e[i].length;const r=new Uint8Array(n);for(let i=0,a=0,_=e.length;i<_;i++){let t=e[i];r.set(t,a),a+=t.length}return r};let ya=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ya=!1}const me=new Uint8Array(256);for(let e=0;e<256;e++)me[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;me[254]=me[254]=1;var Ge=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,r,i,a,_,t=e.length,s=0;for(a=0;a<t;a++)r=e.charCodeAt(a),(64512&r)==55296&&a+1<t&&(i=e.charCodeAt(a+1),(64512&i)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(n=new Uint8Array(s),_=0,a=0;_<s;a++)r=e.charCodeAt(a),(64512&r)==55296&&a+1<t&&(i=e.charCodeAt(a+1),(64512&i)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[_++]=r:r<2048?(n[_++]=192|r>>>6,n[_++]=128|63&r):r<65536?(n[_++]=224|r>>>12,n[_++]=128|r>>>6&63,n[_++]=128|63&r):(n[_++]=240|r>>>18,n[_++]=128|r>>>12&63,n[_++]=128|r>>>6&63,n[_++]=128|63&r);return n},za=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Xe=Object.prototype.toString,{Z_NO_FLUSH:ka,Z_SYNC_FLUSH:xa,Z_FULL_FLUSH:Aa,Z_FINISH:Ea,Z_OK:se,Z_STREAM_END:Za,Z_DEFAULT_COMPRESSION:Ra,Z_DEFAULT_STRATEGY:Ua,Z_DEFLATED:Sa}=ge;function J(e){this.options=ma({level:Ra,method:Sa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ua},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new za,this.strm.avail_out=0;let r=q.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(r!==se)throw new Error(ae[r]);if(n.header&&q.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(i=typeof n.dictionary=="string"?Ge(n.dictionary):Xe.call(n.dictionary)==="[object ArrayBuffer]"?new Uint8Array(n.dictionary):n.dictionary,r=q.deflateSetDictionary(this.strm,i),r!==se)throw new Error(ae[r]);this._dict_set=!0}}function ve(e,n){const r=new J(n);if(r.push(e,!0),r.err)throw r.msg||ae[r.err];return r.result}J.prototype.push=function(e,n){const r=this.strm,i=this.options.chunkSize;let a,_;if(this.ended)return!1;for(_=n===~~n?n:n===!0?Ea:ka,typeof e=="string"?r.input=Ge(e):Xe.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(_===xa||_===Aa)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(a=q.deflate(r,_),a===Za)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=q.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===se;if(r.avail_out!==0){if(_>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(r.avail_in===0)break}else this.onData(r.output)}return!0},J.prototype.onData=function(e){this.chunks.push(e)},J.prototype.onEnd=function(e){e===se&&(this.result=va(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var We=J,qe=ve,Je=function(e,n){return(n=n||{}).raw=!0,ve(e,n)},Qe=function(e,n){return(n=n||{}).gzip=!0,ve(e,n)},Ve=ge,Ta={Deflate:We,deflate:qe,deflateRaw:Je,gzip:Qe,constants:Ve};y.Deflate=We,y.constants=Ve,y.default=Ta,y.deflate=qe,y.deflateRaw=Je,y.gzip=Qe,Object.defineProperty(y,"__esModule",{value:!0})}); +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(v,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((v=typeof globalThis<"u"?globalThis:v||self).pako={})})(this,function(v){"use strict";function z(e){let s=e.length;for(;--s>=0;)e[s]=0}const oe=256,Ae=286,H=30,M=15,de=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ae=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ra=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=new Array(576);z(Z);const P=new Array(60);z(P);const j=new Array(512);z(j);const K=new Array(256);z(K);const ue=new Array(29);z(ue);const se=new Array(H);function fe(e,s,a,r,n){this.static_tree=e,this.extra_bits=s,this.extra_base=a,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let Ze,Ue,Re;function ce(e,s){this.dyn_tree=e,this.max_code=0,this.stat_desc=s}z(se);const Se=e=>e<256?j[e]:j[256+(e>>>7)],Y=(e,s)=>{e.pending_buf[e.pending++]=255&s,e.pending_buf[e.pending++]=s>>>8&255},p=(e,s,a)=>{e.bi_valid>16-a?(e.bi_buf|=s<<e.bi_valid&65535,Y(e,e.bi_buf),e.bi_buf=s>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=s<<e.bi_valid&65535,e.bi_valid+=a)},k=(e,s,a)=>{p(e,a[2*s],a[2*s+1])},Te=(e,s)=>{let a=0;do a|=1&e,e>>>=1,a<<=1;while(--s>0);return a>>>1},Le=(e,s,a)=>{const r=new Array(16);let n,i,_=0;for(n=1;n<=M;n++)_=_+a[n-1]<<1,r[n]=_;for(i=0;i<=s;i++){let t=e[2*i+1];t!==0&&(e[2*i]=Te(r[t]++,t))}},Fe=e=>{let s;for(s=0;s<Ae;s++)e.dyn_ltree[2*s]=0;for(s=0;s<H;s++)e.dyn_dtree[2*s]=0;for(s=0;s<19;s++)e.bl_tree[2*s]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Oe=e=>{e.bi_valid>8?Y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},De=(e,s,a,r)=>{const n=2*s,i=2*a;return e[n]<e[i]||e[n]===e[i]&&r[s]<=r[a]},pe=(e,s,a)=>{const r=e.heap[a];let n=a<<1;for(;n<=e.heap_len&&(n<e.heap_len&&De(s,e.heap[n+1],e.heap[n],e.depth)&&n++,!De(s,r,e.heap[n],e.depth));)e.heap[a]=e.heap[n],a=n,n<<=1;e.heap[a]=r},Ne=(e,s,a)=>{let r,n,i,_,t=0;if(e.sym_next!==0)do r=255&e.pending_buf[e.sym_buf+t++],r+=(255&e.pending_buf[e.sym_buf+t++])<<8,n=e.pending_buf[e.sym_buf+t++],r===0?k(e,n,s):(i=K[n],k(e,i+oe+1,s),_=de[i],_!==0&&(n-=ue[i],p(e,n,_)),r--,i=Se(r),k(e,i,a),_=ae[i],_!==0&&(r-=se[i],p(e,r,_)));while(t<e.sym_next);k(e,256,s)},ge=(e,s)=>{const a=s.dyn_tree,r=s.stat_desc.static_tree,n=s.stat_desc.has_stree,i=s.stat_desc.elems;let _,t,h,l=-1;for(e.heap_len=0,e.heap_max=573,_=0;_<i;_++)a[2*_]!==0?(e.heap[++e.heap_len]=l=_,e.depth[_]=0):a[2*_+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,a[2*h]=1,e.depth[h]=0,e.opt_len--,n&&(e.static_len-=r[2*h+1]);for(s.max_code=l,_=e.heap_len>>1;_>=1;_--)pe(e,a,_);h=i;do _=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pe(e,a,1),t=e.heap[1],e.heap[--e.heap_max]=_,e.heap[--e.heap_max]=t,a[2*h]=a[2*_]+a[2*t],e.depth[h]=(e.depth[_]>=e.depth[t]?e.depth[_]:e.depth[t])+1,a[2*_+1]=a[2*t+1]=h,e.heap[1]=h++,pe(e,a,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((u,d)=>{const m=d.dyn_tree,V=d.max_code,_e=d.stat_desc.static_tree,Na=d.stat_desc.has_stree,Ia=d.stat_desc.extra_bits,na=d.stat_desc.extra_base,$=d.stat_desc.max_length;let ee,y,B,f,le,xe,he=0;for(f=0;f<=M;f++)u.bl_count[f]=0;for(m[2*u.heap[u.heap_max]+1]=0,ee=u.heap_max+1;ee<573;ee++)y=u.heap[ee],f=m[2*m[2*y+1]+1]+1,f>$&&(f=$,he++),m[2*y+1]=f,y>V||(u.bl_count[f]++,le=0,y>=na&&(le=Ia[y-na]),xe=m[2*y],u.opt_len+=xe*(f+le),Na&&(u.static_len+=xe*(_e[2*y+1]+le)));if(he!==0){do{for(f=$-1;u.bl_count[f]===0;)f--;u.bl_count[f]--,u.bl_count[f+1]+=2,u.bl_count[$]--,he-=2}while(he>0);for(f=$;f!==0;f--)for(y=u.bl_count[f];y!==0;)B=u.heap[--ee],B>V||(m[2*B+1]!==f&&(u.opt_len+=(f-m[2*B+1])*m[2*B],m[2*B+1]=f),y--)}})(e,s),Le(a,l,e.bl_count)},Ie=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),s[2*(a+1)+1]=65535,r=0;r<=a;r++)n=_,_=s[2*(r+1)+1],++t<h&&n===_||(t<l?e.bl_tree[2*n]+=t:n!==0?(n!==i&&e.bl_tree[2*n]++,e.bl_tree[32]++):t<=10?e.bl_tree[34]++:e.bl_tree[36]++,t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4))},Ce=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),r=0;r<=a;r++)if(n=_,_=s[2*(r+1)+1],!(++t<h&&n===_)){if(t<l)do k(e,n,e.bl_tree);while(--t!=0);else n!==0?(n!==i&&(k(e,n,e.bl_tree),t--),k(e,16,e.bl_tree),p(e,t-3,2)):t<=10?(k(e,17,e.bl_tree),p(e,t-3,3)):(k(e,18,e.bl_tree),p(e,t-11,7));t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4)}};let Be=!1;const He=(e,s,a,r)=>{p(e,0+(r?1:0),3),Oe(e),Y(e,a),Y(e,~a),a&&e.pending_buf.set(e.window.subarray(s,s+a),e.pending),e.pending+=a};var ia=(e,s,a,r)=>{let n,i,_=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(t=>{let h,l=4093624447;for(h=0;h<=31;h++,l>>>=1)if(1&l&&t.dyn_ltree[2*h]!==0)return 0;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return 1;for(h=32;h<oe;h++)if(t.dyn_ltree[2*h]!==0)return 1;return 0})(e)),ge(e,e.l_desc),ge(e,e.d_desc),_=(t=>{let h;for(Ie(t,t.dyn_ltree,t.l_desc.max_code),Ie(t,t.dyn_dtree,t.d_desc.max_code),ge(t,t.bl_desc),h=18;h>=3&&t.bl_tree[2*Ee[h]+1]===0;h--);return t.opt_len+=3*(h+1)+5+5+4,h})(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=a+5,a+4<=n&&s!==-1?He(e,s,a,r):e.strategy===4||i===n?(p(e,2+(r?1:0),3),Ne(e,Z,P)):(p(e,4+(r?1:0),3),((t,h,l,u)=>{let d;for(p(t,h-257,5),p(t,l-1,5),p(t,u-4,4),d=0;d<u;d++)p(t,t.bl_tree[2*Ee[d]+1],3);Ce(t,t.dyn_ltree,h-1),Ce(t,t.dyn_dtree,l-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,_+1),Ne(e,e.dyn_ltree,e.dyn_dtree)),Fe(e),r&&Oe(e)},ta={_tr_init:e=>{Be||((()=>{let s,a,r,n,i;const _=new Array(16);for(r=0,n=0;n<28;n++)for(ue[n]=r,s=0;s<1<<de[n];s++)K[r++]=n;for(K[r-1]=n,i=0,n=0;n<16;n++)for(se[n]=i,s=0;s<1<<ae[n];s++)j[i++]=n;for(i>>=7;n<H;n++)for(se[n]=i<<7,s=0;s<1<<ae[n]-7;s++)j[256+i++]=n;for(a=0;a<=M;a++)_[a]=0;for(s=0;s<=143;)Z[2*s+1]=8,s++,_[8]++;for(;s<=255;)Z[2*s+1]=9,s++,_[9]++;for(;s<=279;)Z[2*s+1]=7,s++,_[7]++;for(;s<=287;)Z[2*s+1]=8,s++,_[8]++;for(Le(Z,287,_),s=0;s<H;s++)P[2*s+1]=5,P[2*s]=Te(s,5);Ze=new fe(Z,de,257,Ae,M),Ue=new fe(P,ae,0,H,M),Re=new fe(new Array(0),ra,0,19,7)})(),Be=!0),e.l_desc=new ce(e.dyn_ltree,Ze),e.d_desc=new ce(e.dyn_dtree,Ue),e.bl_desc=new ce(e.bl_tree,Re),e.bi_buf=0,e.bi_valid=0,Fe(e)},_tr_stored_block:He,_tr_flush_block:ia,_tr_tally:(e,s,a)=>(e.pending_buf[e.sym_buf+e.sym_next++]=s,e.pending_buf[e.sym_buf+e.sym_next++]=s>>8,e.pending_buf[e.sym_buf+e.sym_next++]=a,s===0?e.dyn_ltree[2*a]++:(e.matches++,s--,e.dyn_ltree[2*(K[a]+oe+1)]++,e.dyn_dtree[2*Se(s)]++),e.sym_next===e.sym_end),_tr_align:e=>{p(e,2,3),k(e,256,Z),(s=>{s.bi_valid===16?(Y(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)})(e)}},Me=(e,s,a,r)=>{let n=65535&e|0,i=e>>>16&65535|0,_=0;for(;a!==0;){_=a>2e3?2e3:a,a-=_;do n=n+s[r++]|0,i=i+n|0;while(--_);n%=65521,i%=65521}return n|i<<16|0};const _a=new Uint32Array((()=>{let e,s=[];for(var a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;s[a]=e}return s})());var U=(e,s,a,r)=>{const n=_a,i=r+a;e^=-1;for(let _=r;_<i;_++)e=e>>>8^n[255&(e^s[_])];return-1^e},ne={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},we={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:la,_tr_stored_block:me,_tr_flush_block:ha,_tr_tally:R,_tr_align:oa}=ta,{Z_NO_FLUSH:S,Z_PARTIAL_FLUSH:da,Z_FULL_FLUSH:ua,Z_FINISH:b,Z_BLOCK:Pe,Z_OK:c,Z_STREAM_END:je,Z_STREAM_ERROR:x,Z_DATA_ERROR:fa,Z_BUF_ERROR:be,Z_DEFAULT_COMPRESSION:ca,Z_FILTERED:pa,Z_HUFFMAN_ONLY:re,Z_RLE:ga,Z_FIXED:wa,Z_DEFAULT_STRATEGY:ma,Z_UNKNOWN:ba,Z_DEFLATED:ie}=we,F=258,A=262,N=42,O=113,G=666,D=(e,s)=>(e.msg=ne[s],s),Ke=e=>2*e-(e>4?9:0),T=e=>{let s=e.length;for(;--s>=0;)e[s]=0},ya=e=>{let s,a,r,n=e.w_size;s=e.hash_size,r=s;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--s);s=n,r=s;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--s)};let L=(e,s,a)=>(s<<e.hash_shift^a)&e.hash_mask;const g=e=>{const s=e.state;let a=s.pending;a>e.avail_out&&(a=e.avail_out),a!==0&&(e.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+a),e.next_out),e.next_out+=a,s.pending_out+=a,e.total_out+=a,e.avail_out-=a,s.pending-=a,s.pending===0&&(s.pending_out=0))},w=(e,s)=>{ha(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,s),e.block_start=e.strstart,g(e.strm)},o=(e,s)=>{e.pending_buf[e.pending++]=s},X=(e,s)=>{e.pending_buf[e.pending++]=s>>>8&255,e.pending_buf[e.pending++]=255&s},ye=(e,s,a,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,s.set(e.input.subarray(e.next_in,e.next_in+n),a),e.state.wrap===1?e.adler=Me(e.adler,s,n,a):e.state.wrap===2&&(e.adler=U(e.adler,s,n,a)),e.next_in+=n,e.total_in+=n,n)},Ye=(e,s)=>{let a,r,n=e.max_chain_length,i=e.strstart,_=e.prev_length,t=e.nice_match;const h=e.strstart>e.w_size-A?e.strstart-(e.w_size-A):0,l=e.window,u=e.w_mask,d=e.prev,m=e.strstart+F;let V=l[i+_-1],_e=l[i+_];e.prev_length>=e.good_match&&(n>>=2),t>e.lookahead&&(t=e.lookahead);do if(a=s,l[a+_]===_e&&l[a+_-1]===V&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do;while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<m);if(r=F-(m-i),i=m-F,r>_){if(e.match_start=s,_=r,r>=t)break;V=l[i+_-1],_e=l[i+_]}}while((s=d[s&u])>h&&--n!=0);return _<=e.lookahead?_:e.lookahead},I=e=>{const s=e.w_size;let a,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-A)&&(e.window.set(e.window.subarray(s,s+s-r),0),e.match_start-=s,e.strstart-=s,e.block_start-=s,e.insert>e.strstart&&(e.insert=e.strstart),ya(e),r+=s),e.strm.avail_in===0)break;if(a=ye(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=a,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=L(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=L(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<A&&e.strm.avail_in!==0)},Ge=(e,s)=>{let a,r,n,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,_=0,t=e.strm.avail_in;do{if(a=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n||(n=e.strm.avail_out-n,r=e.strstart-e.block_start,a>r+e.strm.avail_in&&(a=r+e.strm.avail_in),a>n&&(a=n),a<i&&(a===0&&s!==b||s===S||a!==r+e.strm.avail_in)))break;_=s===b&&a===r+e.strm.avail_in?1:0,me(e,0,0,_),e.pending_buf[e.pending-4]=a,e.pending_buf[e.pending-3]=a>>8,e.pending_buf[e.pending-2]=~a,e.pending_buf[e.pending-1]=~a>>8,g(e.strm),r&&(r>a&&(r=a),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,a-=r),a&&(ye(e.strm,e.strm.output,e.strm.next_out,a),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a)}while(_===0);return t-=e.strm.avail_in,t&&(t>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=t&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-t,e.strm.next_in),e.strstart),e.strstart+=t,e.insert+=t>e.w_size-e.insert?e.w_size-e.insert:t),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),_?4:s!==S&&s!==b&&e.strm.avail_in===0&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(ye(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,i=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=i||(r||s===b)&&s!==S&&e.strm.avail_in===0&&r<=n)&&(a=r>n?n:r,_=s===b&&e.strm.avail_in===0&&a===r?1:0,me(e,e.block_start,a,_),e.block_start+=a,g(e.strm)),_?3:1)},ve=(e,s)=>{let a,r;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),a!==0&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a)),e.match_length>=3)if(r=R(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L(e,e.ins_h,e.window[e.strstart+1]);else r=R(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(w(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2},C=(e,s)=>{let a,r,n;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,a!==0&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a),e.match_length<=5&&(e.strategy===pa||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=R(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(w(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=R(e,0,e.window[e.strstart-1]),r&&w(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=R(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2};function E(e,s,a,r,n){this.good_length=e,this.max_lazy=s,this.nice_length=a,this.max_chain=r,this.func=n}const W=[new E(0,0,0,0,Ge),new E(4,4,8,4,ve),new E(4,5,16,8,ve),new E(4,6,32,32,ve),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)];function va(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ie,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const q=e=>{if(!e)return 1;const s=e.state;return!s||s.strm!==e||s.status!==N&&s.status!==57&&s.status!==69&&s.status!==73&&s.status!==91&&s.status!==103&&s.status!==O&&s.status!==G?1:0},Xe=e=>{if(q(e))return D(e,x);e.total_in=e.total_out=0,e.data_type=ba;const s=e.state;return s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap===2?57:s.wrap?N:O,e.adler=s.wrap===2?0:1,s.last_flush=-2,la(s),c},We=e=>{const s=Xe(e);var a;return s===c&&((a=e.state).window_size=2*a.w_size,T(a.head),a.max_lazy_match=W[a.level].max_lazy,a.good_match=W[a.level].good_length,a.nice_match=W[a.level].nice_length,a.max_chain_length=W[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),s},qe=(e,s,a,r,n,i)=>{if(!e)return x;let _=1;if(s===ca&&(s=6),r<0?(_=0,r=-r):r>15&&(_=2,r-=16),n<1||n>9||a!==ie||r<8||r>15||s<0||s>9||i<0||i>wa||r===8&&_!==1)return D(e,x);r===8&&(r=9);const t=new va;return e.state=t,t.strm=e,t.status=N,t.wrap=_,t.gzhead=null,t.w_bits=r,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=n+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+3-1)/3),t.window=new Uint8Array(2*t.w_size),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<n+6,t.pending_buf_size=4*t.lit_bufsize,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=3*(t.lit_bufsize-1),t.level=s,t.strategy=i,t.method=a,We(e)};var J={deflateInit:(e,s)=>qe(e,s,ie,15,8,ma),deflateInit2:qe,deflateReset:We,deflateResetKeep:Xe,deflateSetHeader:(e,s)=>q(e)||e.state.wrap!==2?x:(e.state.gzhead=s,c),deflate:(e,s)=>{if(q(e)||s>Pe||s<0)return e?D(e,x):x;const a=e.state;if(!e.output||e.avail_in!==0&&!e.input||a.status===G&&s!==b)return D(e,e.avail_out===0?be:x);const r=a.last_flush;if(a.last_flush=s,a.pending!==0){if(g(e),e.avail_out===0)return a.last_flush=-1,c}else if(e.avail_in===0&&Ke(s)<=Ke(r)&&s!==b)return D(e,be);if(a.status===G&&e.avail_in!==0)return D(e,be);if(a.status===N&&a.wrap===0&&(a.status=O),a.status===N){let n=ie+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=re||a.level<2?0:a.level<6?1:a.level===6?2:3,n|=i<<6,a.strstart!==0&&(n|=32),n+=31-n%31,X(a,n),a.strstart!==0&&(X(a,e.adler>>>16),X(a,65535&e.adler)),e.adler=1,a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===57){if(e.adler=0,o(a,31),o(a,139),o(a,8),a.gzhead)o(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),o(a,255&a.gzhead.time),o(a,a.gzhead.time>>8&255),o(a,a.gzhead.time>>16&255),o(a,a.gzhead.time>>24&255),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(o(a,255&a.gzhead.extra.length),o(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=U(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(o(a,0),o(a,0),o(a,0),o(a,0),o(a,0),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,3),a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===69){if(a.gzhead.extra){let n=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let t=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+t),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex+=t,g(e),a.pending!==0)return a.last_flush=-1,c;n=0,i-=t}let _=new Uint8Array(a.gzhead.extra);a.pending_buf.set(_.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex=0}a.status=73}if(a.status===73){if(a.gzhead.name){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(a.status===91){if(a.gzhead.comment){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(a.status===103){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(g(e),a.pending!==0))return a.last_flush=-1,c;o(a,255&e.adler),o(a,e.adler>>8&255),e.adler=0}if(a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(e.avail_in!==0||a.lookahead!==0||s!==S&&a.status!==G){let n=a.level===0?Ge(a,s):a.strategy===re?((i,_)=>{let t;for(;;){if(i.lookahead===0&&(I(i),i.lookahead===0)){if(_===S)return 1;break}if(i.match_length=0,t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):a.strategy===ga?((i,_)=>{let t,h,l,u;const d=i.window;for(;;){if(i.lookahead<=F){if(I(i),i.lookahead<=F&&_===S)return 1;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=3&&i.strstart>0&&(l=i.strstart-1,h=d[l],h===d[++l]&&h===d[++l]&&h===d[++l])){u=i.strstart+F;do;while(h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&l<u);i.match_length=F-(u-l),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=3?(t=R(i,1,i.match_length-3),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):W[a.level].func(a,s);if(n!==3&&n!==4||(a.status=G),n===1||n===3)return e.avail_out===0&&(a.last_flush=-1),c;if(n===2&&(s===da?oa(a):s!==Pe&&(me(a,0,0,!1),s===ua&&(T(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),g(e),e.avail_out===0))return a.last_flush=-1,c}return s!==b?c:a.wrap<=0?je:(a.wrap===2?(o(a,255&e.adler),o(a,e.adler>>8&255),o(a,e.adler>>16&255),o(a,e.adler>>24&255),o(a,255&e.total_in),o(a,e.total_in>>8&255),o(a,e.total_in>>16&255),o(a,e.total_in>>24&255)):(X(a,e.adler>>>16),X(a,65535&e.adler)),g(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?c:je)},deflateEnd:e=>{if(q(e))return x;const s=e.state.status;return e.state=null,s===O?D(e,fa):c},deflateSetDictionary:(e,s)=>{let a=s.length;if(q(e))return x;const r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==N||r.lookahead)return x;if(n===1&&(e.adler=Me(e.adler,s,a,0)),r.wrap=0,a>=r.w_size){n===0&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let h=new Uint8Array(r.w_size);h.set(s.subarray(a-r.w_size,a),0),s=h,a=r.w_size}const i=e.avail_in,_=e.next_in,t=e.input;for(e.avail_in=a,e.next_in=0,e.input=s,I(r);r.lookahead>=3;){let h=r.strstart,l=r.lookahead-2;do r.ins_h=L(r,r.ins_h,r.window[h+3-1]),r.prev[h&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=h,h++;while(--l);r.strstart=h,r.lookahead=2,I(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=_,e.input=t,e.avail_in=i,r.wrap=n,c},deflateInfo:"pako deflate (from Nodeca project)"};const za=(e,s)=>Object.prototype.hasOwnProperty.call(e,s);var ka=function(e){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const a=s.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(const r in a)za(a,r)&&(e[r]=a[r])}}return e},xa=e=>{let s=0;for(let r=0,n=e.length;r<n;r++)s+=e[r].length;const a=new Uint8Array(s);for(let r=0,n=0,i=e.length;r<i;r++){let _=e[r];a.set(_,n),n+=_.length}return a};let Aa=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Aa=!1}const ze=new Uint8Array(256);for(let e=0;e<256;e++)ze[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ze[254]=ze[254]=1;var Je=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let s,a,r,n,i,_=e.length,t=0;for(n=0;n<_;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),t+=a<128?1:a<2048?2:a<65536?3:4;for(s=new Uint8Array(t),i=0,n=0;i<t;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),a<128?s[i++]=a:a<2048?(s[i++]=192|a>>>6,s[i++]=128|63&a):a<65536?(s[i++]=224|a>>>12,s[i++]=128|a>>>6&63,s[i++]=128|63&a):(s[i++]=240|a>>>18,s[i++]=128|a>>>12&63,s[i++]=128|a>>>6&63,s[i++]=128|63&a);return s},Ea=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Qe=Object.prototype.toString,{Z_NO_FLUSH:Za,Z_SYNC_FLUSH:Ua,Z_FULL_FLUSH:Ra,Z_FINISH:Sa,Z_OK:te,Z_STREAM_END:Ta,Z_DEFAULT_COMPRESSION:La,Z_DEFAULT_STRATEGY:Fa,Z_DEFLATED:Oa}=we;function Q(e){this.options=ka({level:La,method:Oa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fa},e||{});let s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ea,this.strm.avail_out=0;let a=J.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(a!==te)throw new Error(ne[a]);if(s.header&&J.deflateSetHeader(this.strm,s.header),s.dictionary){let r;if(r=typeof s.dictionary=="string"?Je(s.dictionary):Qe.call(s.dictionary)==="[object ArrayBuffer]"?new Uint8Array(s.dictionary):s.dictionary,a=J.deflateSetDictionary(this.strm,r),a!==te)throw new Error(ne[a]);this._dict_set=!0}}function ke(e,s){const a=new Q(s);if(a.push(e,!0),a.err)throw a.msg||ne[a.err];return a.result}Q.prototype.push=function(e,s){const a=this.strm,r=this.options.chunkSize;let n,i;if(this.ended)return!1;for(i=s===~~s?s:s===!0?Sa:Za,typeof e=="string"?a.input=Je(e):Qe.call(e)==="[object ArrayBuffer]"?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;)if(a.avail_out===0&&(a.output=new Uint8Array(r),a.next_out=0,a.avail_out=r),(i===Ua||i===Ra)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=J.deflate(a,i),n===Ta)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=J.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===te;if(a.avail_out!==0){if(i>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(a.avail_in===0)break}else this.onData(a.output)}return!0},Q.prototype.onData=function(e){this.chunks.push(e)},Q.prototype.onEnd=function(e){e===te&&(this.result=xa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ve=Q,$e=ke,ea=function(e,s){return(s=s||{}).raw=!0,ke(e,s)},aa=function(e,s){return(s=s||{}).gzip=!0,ke(e,s)},sa=we,Da={Deflate:Ve,deflate:$e,deflateRaw:ea,gzip:aa,constants:sa};v.Deflate=Ve,v.constants=sa,v.default=Da,v.deflate=$e,v.deflateRaw=ea,v.gzip=aa,Object.defineProperty(v,"__esModule",{value:!0})}); diff --git a/public/lib/Cesium/ThirdParty/Workers/pako_inflate.min.js b/public/lib/Cesium/ThirdParty/Workers/pako_inflate.min.js index e3f97f6e..420318f1 100644 --- a/public/lib/Cesium/ThirdParty/Workers/pako_inflate.min.js +++ b/public/lib/Cesium/ThirdParty/Workers/pako_inflate.min.js @@ -1 +1 @@ -/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(O,B){typeof exports=="object"&&typeof module<"u"?B(exports):typeof define=="function"&&define.amd?define(["exports"],B):B((O=typeof globalThis<"u"?globalThis:O||self).pako={})})(this,function(O){"use strict";var B=(e,i,t,o)=>{let s=65535&e|0,r=e>>>16&65535|0,h=0;for(;t!==0;){h=t>2e3?2e3:t,t-=h;do s=s+i[o++]|0,r=r+s|0;while(--h);s%=65521,r%=65521}return s|r<<16|0};const pt=new Uint32Array((()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}return i})());var U=(e,i,t,o)=>{const s=pt,r=o+t;e^=-1;for(let h=o;h<r;h++)e=e>>>8^s[255&(e^i[h])];return-1^e},vt=function(e,i){let t,o,s,r,h,l,g,n,a,Z,w,d,S,p,u,y,k,f,_,E,c,x,m,b;const v=e.state;t=e.next_in,m=e.input,o=t+(e.avail_in-5),s=e.next_out,b=e.output,r=s-(i-e.avail_out),h=s+(e.avail_out-257),l=v.dmax,g=v.wsize,n=v.whave,a=v.wnext,Z=v.window,w=v.hold,d=v.bits,S=v.lencode,p=v.distcode,u=(1<<v.lenbits)-1,y=(1<<v.distbits)-1;t:do{d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=S[w&u];e:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,f===0)b[s++]=65535&k;else{if(!(16&f)){if(!(64&f)){k=S[(65535&k)+(w&(1<<f)-1)];continue e}if(32&f){v.mode=12;break t}e.msg="invalid literal/length code",v.mode=30;break t}_=65535&k,f&=15,f&&(d<f&&(w+=m[t++]<<d,d+=8),_+=w&(1<<f)-1,w>>>=f,d-=f),d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=p[w&y];i:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,!(16&f)){if(!(64&f)){k=p[(65535&k)+(w&(1<<f)-1)];continue i}e.msg="invalid distance code",v.mode=30;break t}if(E=65535&k,f&=15,d<f&&(w+=m[t++]<<d,d+=8,d<f&&(w+=m[t++]<<d,d+=8)),E+=w&(1<<f)-1,E>l){e.msg="invalid distance too far back",v.mode=30;break t}if(w>>>=f,d-=f,f=s-r,E>f){if(f=E-f,f>n&&v.sane){e.msg="invalid distance too far back",v.mode=30;break t}if(c=0,x=Z,a===0){if(c+=g-f,f<_){_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}}else if(a<f){if(c+=g+a-f,f-=a,f<_){_-=f;do b[s++]=Z[c++];while(--f);if(c=0,a<_){f=a,_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}}}else if(c+=a-f,f<_){_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}for(;_>2;)b[s++]=x[c++],b[s++]=x[c++],b[s++]=x[c++],_-=3;_&&(b[s++]=x[c++],_>1&&(b[s++]=x[c++]))}else{c=s-E;do b[s++]=b[c++],b[s++]=b[c++],b[s++]=b[c++],_-=3;while(_>2);_&&(b[s++]=b[c++],_>1&&(b[s++]=b[c++]))}break}}break}}while(t<o&&s<h);_=d>>3,t-=_,d-=_<<3,w&=(1<<d)-1,e.next_in=t,e.next_out=s,e.avail_in=t<o?o-t+5:5-(t-o),e.avail_out=s<h?h-s+257:257-(s-h),v.hold=w,v.bits=d};const H=15,xt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),yt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Et=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Rt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var z=(e,i,t,o,s,r,h,l)=>{const g=l.bits;let n,a,Z,w,d,S,p=0,u=0,y=0,k=0,f=0,_=0,E=0,c=0,x=0,m=0,b=null,v=0;const A=new Uint16Array(16),N=new Uint16Array(16);let _t,K,P,Y=null,gt=0;for(p=0;p<=H;p++)A[p]=0;for(u=0;u<o;u++)A[i[t+u]]++;for(f=g,k=H;k>=1&&A[k]===0;k--);if(f>k&&(f=k),k===0)return s[r++]=20971520,s[r++]=20971520,l.bits=1,0;for(y=1;y<k&&A[y]===0;y++);for(f<y&&(f=y),c=1,p=1;p<=H;p++)if(c<<=1,c-=A[p],c<0)return-1;if(c>0&&(e===0||k!==1))return-1;for(N[1]=0,p=1;p<H;p++)N[p+1]=N[p]+A[p];for(u=0;u<o;u++)i[t+u]!==0&&(h[N[i[t+u]]++]=u);if(e===0?(b=Y=h,S=19):e===1?(b=xt,v-=257,Y=yt,gt-=257,S=256):(b=Et,Y=Rt,S=-1),m=0,u=0,p=y,d=r,_=f,E=0,Z=-1,x=1<<f,w=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){_t=p-E,h[u]<S?(K=0,P=h[u]):h[u]>S?(K=Y[gt+h[u]],P=b[v+h[u]]):(K=96,P=0),n=1<<p-E,a=1<<_,y=a;do a-=n,s[d+(m>>E)+a]=_t<<24|K<<16|P|0;while(a!==0);for(n=1<<p-1;m&n;)n>>=1;if(n!==0?(m&=n-1,m+=n):m=0,u++,--A[p]==0){if(p===k)break;p=i[t+h[u]]}if(p>f&&(m&w)!==Z){for(E===0&&(E=f),d+=y,_=p-E,c=1<<_;_+E<k&&(c-=A[_+E],!(c<=0));)_++,c<<=1;if(x+=1<<_,e===1&&x>852||e===2&&x>592)return 1;Z=m&w,s[Z]=f<<24|_<<16|d-r|0}}return m!==0&&(s[d+m]=p-E<<24|64<<16|0),l.bits=f,0},G={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:$,Z_BLOCK:At,Z_TREES:j,Z_OK:C,Z_STREAM_END:Zt,Z_NEED_DICT:St,Z_STREAM_ERROR:T,Z_DATA_ERROR:tt,Z_MEM_ERROR:et,Z_BUF_ERROR:Tt,Z_DEFLATED:it}=G,D=12,R=30,nt=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Ot(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const at=e=>{if(!e||!e.state)return T;const i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=1,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(852),i.distcode=i.distdyn=new Int32Array(592),i.sane=1,i.back=-1,C},rt=e=>{if(!e||!e.state)return T;const i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,at(e)},ot=(e,i)=>{let t;if(!e||!e.state)return T;const o=e.state;return i<0?(t=0,i=-i):(t=1+(i>>4),i<48&&(i&=15)),i&&(i<8||i>15)?T:(o.window!==null&&o.wbits!==i&&(o.window=null),o.wrap=t,o.wbits=i,rt(e))},st=(e,i)=>{if(!e)return T;const t=new Ot;e.state=t,t.window=null;const o=ot(e,i);return o!==C&&(e.state=null),o};let X,W,lt=!0;const Ut=e=>{if(lt){X=new Int32Array(512),W=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(z(1,e.lens,0,288,X,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;z(2,e.lens,0,32,W,0,e.work,{bits:5}),lt=!1}e.lencode=X,e.lenbits=9,e.distcode=W,e.distbits=5},dt=(e,i,t,o)=>{let s;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),o>=r.wsize?(r.window.set(i.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>o&&(s=o),r.window.set(i.subarray(t-o,t-o+s),r.wnext),(o-=s)?(r.window.set(i.subarray(t-o,t),0),r.wnext=o,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var I={inflateReset:rt,inflateReset2:ot,inflateResetKeep:at,inflateInit:e=>st(e,15),inflateInit2:st,inflate:(e,i)=>{let t,o,s,r,h,l,g,n,a,Z,w,d,S,p,u,y,k,f,_,E,c,x,m=0;const b=new Uint8Array(4);let v,A;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return T;t=e.state,t.mode===D&&(t.mode=13),h=e.next_out,s=e.output,g=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,Z=l,w=g,x=C;t:for(;;)switch(t.mode){case 1:if(t.wrap===0){t.mode=13;break}for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(2&t.wrap&&n===35615){t.check=0,b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0),n=0,a=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&n)<<8)+(n>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((15&n)!==it){e.msg="unknown compression method",t.mode=R;break}if(n>>>=4,a-=4,c=8+(15&n),t.wbits===0)t.wbits=c;else if(c>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,e.adler=t.check=1,t.mode=512&n?10:D,n=0,a=0;break;case 2:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.flags=n,(255&t.flags)!==it){e.msg="unknown compression method",t.mode=R;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=n>>8&1),512&t.flags&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=3;case 3:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.time=n),512&t.flags&&(b[0]=255&n,b[1]=n>>>8&255,b[2]=n>>>16&255,b[3]=n>>>24&255,t.check=U(t.check,b,4,0)),n=0,a=0,t.mode=4;case 4:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.xflags=255&n,t.head.os=n>>8),512&t.flags&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=5;case 5:if(1024&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length=n,t.head&&(t.head.extra_len=n),512&t.flags&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&(d=t.length,d>l&&(d=l),d&&(t.head&&(c=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(o.subarray(r,r+d),c)),512&t.flags&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,t.length-=d),t.length))break t;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.name+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.name=null);t.length=0,t.mode=8;case 8:if(4096&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.comment+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.comment=null);t.mode=9;case 9:if(512&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n!==(65535&t.check)){e.msg="header crc mismatch",t.mode=R;break}n=0,a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=D;break;case 10:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}e.adler=t.check=nt(n),n=0,a=0,t.mode=11;case 11:if(t.havedict===0)return e.next_out=h,e.avail_out=g,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,St;e.adler=t.check=1,t.mode=D;case D:if(i===At||i===j)break t;case 13:if(t.last){n>>>=7&a,a-=7&a,t.mode=27;break}for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}switch(t.last=1&n,n>>>=1,a-=1,3&n){case 0:t.mode=14;break;case 1:if(Ut(t),t.mode=20,i===j){n>>>=2,a-=2;break t}break;case 2:t.mode=17;break;case 3:e.msg="invalid block type",t.mode=R}n>>>=2,a-=2;break;case 14:for(n>>>=7&a,a-=7&a;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if((65535&n)!=(n>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=65535&n,n=0,a=0,t.mode=15,i===j)break t;case 15:t.mode=16;case 16:if(d=t.length,d){if(d>l&&(d=l),d>g&&(d=g),d===0)break t;s.set(o.subarray(r,r+d),h),l-=d,r+=d,g-=d,h+=d,t.length-=d;break}t.mode=D;break;case 17:for(;a<14;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.nlen=257+(31&n),n>>>=5,a-=5,t.ndist=1+(31&n),n>>>=5,a-=5,t.ncode=4+(15&n),n>>>=4,a-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=18;case 18:for(;t.have<t.ncode;){for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.lens[N[t.have++]]=7&n,n>>>=3,a-=3}for(;t.have<19;)t.lens[N[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,v={bits:t.lenbits},x=z(0,t.lens,0,19,t.lencode,0,t.work,v),t.lenbits=v.bits,x){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=19;case 19:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(k<16)n>>>=u,a-=u,t.lens[t.have++]=k;else{if(k===16){for(A=u+2;a<A;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n>>>=u,a-=u,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}c=t.lens[t.have-1],d=3+(3&n),n>>>=2,a-=2}else if(k===17){for(A=u+3;a<A;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=3+(7&n),n>>>=3,a-=3}else{for(A=u+7;a<A;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=11+(127&n),n>>>=7,a-=7}if(t.have+d>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;d--;)t.lens[t.have++]=c}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,v={bits:t.lenbits},x=z(1,t.lens,0,t.nlen,t.lencode,0,t.work,v),t.lenbits=v.bits,x){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,v={bits:t.distbits},x=z(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,v),t.distbits=v.bits,x){e.msg="invalid distances set",t.mode=R;break}if(t.mode=20,i===j)break t;case 20:t.mode=21;case 21:if(l>=6&&g>=258){e.next_out=h,e.avail_out=g,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,vt(e,w),h=e.next_out,s=e.output,g=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,t.mode===D&&(t.back=-1);break}for(t.back=0;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(y&&!(240&y)){for(f=u,_=y,E=k;m=t.lencode[E+((n&(1<<f+_)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,t.length=k,y===0){t.mode=26;break}if(32&y){t.back=-1,t.mode=D;break}if(64&y){e.msg="invalid literal/length code",t.mode=R;break}t.extra=15&y,t.mode=22;case 22:if(t.extra){for(A=t.extra;a<A;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;m=t.distcode[n&(1<<t.distbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(!(240&y)){for(f=u,_=y,E=k;m=t.distcode[E+((n&(1<<f+_)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,64&y){e.msg="invalid distance code",t.mode=R;break}t.offset=k,t.extra=15&y,t.mode=24;case 24:if(t.extra){for(A=t.extra;a<A;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.offset+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=25;case 25:if(g===0)break t;if(d=w-g,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}d>t.wnext?(d-=t.wnext,S=t.wsize-d):S=t.wnext-d,d>t.length&&(d=t.length),p=t.window}else p=s,S=h-t.offset,d=t.length;d>g&&(d=g),g-=d,t.length-=d;do s[h++]=p[S++];while(--d);t.length===0&&(t.mode=21);break;case 26:if(g===0)break t;s[h++]=t.length,g--,t.mode=21;break;case 27:if(t.wrap){for(;a<32;){if(l===0)break t;l--,n|=o[r++]<<a,a+=8}if(w-=g,e.total_out+=w,t.total+=w,w&&(e.adler=t.check=t.flags?U(t.check,s,w,h-w):B(t.check,s,w,h-w)),w=g,(t.flags?n:nt(n))!==t.check){e.msg="incorrect data check",t.mode=R;break}n=0,a=0}t.mode=28;case 28:if(t.wrap&&t.flags){for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=R;break}n=0,a=0}t.mode=29;case 29:x=Zt;break t;case R:x=tt;break t;case 31:return et;case 32:default:return T}return e.next_out=h,e.avail_out=g,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,(t.wsize||w!==e.avail_out&&t.mode<R&&(t.mode<27||i!==$))&&dt(e,e.output,e.next_out,w-e.avail_out),Z-=e.avail_in,w-=e.avail_out,e.total_in+=Z,e.total_out+=w,t.total+=w,t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,e.next_out-w):B(t.check,s,w,e.next_out-w)),e.data_type=t.bits+(t.last?64:0)+(t.mode===D?128:0)+(t.mode===20||t.mode===15?256:0),(Z===0&&w===0||i===$)&&x===C&&(x=Tt),x},inflateEnd:e=>{if(!e||!e.state)return T;let i=e.state;return i.window&&(i.window=null),e.state=null,C},inflateGetHeader:(e,i)=>{if(!e||!e.state)return T;const t=e.state;return 2&t.wrap?(t.head=i,i.done=!1,C):T},inflateSetDictionary:(e,i)=>{const t=i.length;let o,s,r;return e&&e.state?(o=e.state,o.wrap!==0&&o.mode!==11?T:o.mode===11&&(s=1,s=B(s,i,t,0),s!==o.check)?tt:(r=dt(e,i,t,t),r?(o.mode=31,et):(o.havedict=1,C))):T},inflateInfo:"pako inflate (from Nodeca project)"};const Dt=(e,i)=>Object.prototype.hasOwnProperty.call(e,i);var It=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const o in t)Dt(t,o)&&(e[o]=t[o])}}return e},Bt=e=>{let i=0;for(let o=0,s=e.length;o<s;o++)i+=e[o].length;const t=new Uint8Array(i);for(let o=0,s=0,r=e.length;o<r;o++){let h=e[o];t.set(h,s),s+=h.length}return t};let ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ft=!1}const F=new Uint8Array(256);for(let e=0;e<256;e++)F[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;F[254]=F[254]=1;var Ct=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,o,s,r,h=e.length,l=0;for(s=0;s<h;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(l),r=0,s=0;r<l;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),t<128?i[r++]=t:t<2048?(i[r++]=192|t>>>6,i[r++]=128|63&t):t<65536?(i[r++]=224|t>>>12,i[r++]=128|t>>>6&63,i[r++]=128|63&t):(i[r++]=240|t>>>18,i[r++]=128|t>>>12&63,i[r++]=128|t>>>6&63,i[r++]=128|63&t);return i},Nt=(e,i)=>{const t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let o,s;const r=new Array(2*t);for(s=0,o=0;o<t;){let h=e[o++];if(h<128){r[s++]=h;continue}let l=F[h];if(l>4)r[s++]=65533,o+=l-1;else{for(h&=l===2?31:l===3?15:7;l>1&&o<t;)h=h<<6|63&e[o++],l--;l>1?r[s++]=65533:h<65536?r[s++]=h:(h-=65536,r[s++]=55296|h>>10&1023,r[s++]=56320|1023&h)}}return((h,l)=>{if(l<65534&&h.subarray&&ft)return String.fromCharCode.apply(null,h.length===l?h:h.subarray(0,l));let g="";for(let n=0;n<l;n++)g+=String.fromCharCode(h[n]);return g})(r,s)},zt=(e,i)=>{(i=i||e.length)>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?i:t+F[e[t]]>i?t:i},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Lt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_FINISH:Ht,Z_OK:L,Z_STREAM_END:J,Z_NEED_DICT:Q,Z_STREAM_ERROR:jt,Z_DATA_ERROR:ct,Z_MEM_ERROR:Kt}=G;function M(e){this.options=It({chunkSize:65536,windowBits:15,to:""},e||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),!(i.windowBits>=0&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&!(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ft,this.strm.avail_out=0;let t=I.inflateInit2(this.strm,i.windowBits);if(t!==L)throw new Error(q[t]);if(this.header=new Lt,I.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=Ct(i.dictionary):ht.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=I.inflateSetDictionary(this.strm,i.dictionary),t!==L)))throw new Error(q[t])}function V(e,i){const t=new M(i);if(t.push(e),t.err)throw t.msg||q[t.err];return t.result}M.prototype.push=function(e,i){const t=this.strm,o=this.options.chunkSize,s=this.options.dictionary;let r,h,l;if(this.ended)return!1;for(h=i===~~i?i:i===!0?Ht:Mt,ht.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(o),t.next_out=0,t.avail_out=o),r=I.inflate(t,h),r===Q&&s&&(r=I.inflateSetDictionary(t,s),r===L?r=I.inflate(t,h):r===ct&&(r=Q));t.avail_in>0&&r===J&&t.state.wrap>0&&e[t.next_in]!==0;)I.inflateReset(t),r=I.inflate(t,h);switch(r){case jt:case ct:case Q:case Kt:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===J))if(this.options.to==="string"){let g=zt(t.output,t.next_out),n=t.next_out-g,a=Nt(t.output,g);t.next_out=n,t.avail_out=o-n,n&&t.output.set(t.output.subarray(g,g+n),0),this.onData(a)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(r!==L||l!==0){if(r===J)return r=I.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},M.prototype.onData=function(e){this.chunks.push(e)},M.prototype.onEnd=function(e){e===L&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Bt(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ut=M,wt=V,bt=function(e,i){return(i=i||{}).raw=!0,V(e,i)},mt=V,kt=G,Pt={Inflate:ut,inflate:wt,inflateRaw:bt,ungzip:mt,constants:kt};O.Inflate=ut,O.constants=kt,O.default=Pt,O.inflate=wt,O.inflateRaw=bt,O.ungzip=mt,Object.defineProperty(O,"__esModule",{value:!0})}); +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(O,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):I((O=typeof globalThis<"u"?globalThis:O||self).pako={})})(this,function(O){"use strict";var I=(e,i,t,o)=>{let s=65535&e|0,r=e>>>16&65535|0,h=0;for(;t!==0;){h=t>2e3?2e3:t,t-=h;do s=s+i[o++]|0,r=r+s|0;while(--h);s%=65521,r%=65521}return s|r<<16|0};const Zt=new Uint32Array((()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}return i})());var U=(e,i,t,o)=>{const s=Zt,r=o+t;e^=-1;for(let h=o;h<r;h++)e=e>>>8^s[255&(e^i[h])];return-1^e};const j=16209;var St=function(e,i){let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m,b;const _=e.state;t=e.next_in,m=e.input,o=t+(e.avail_in-5),s=e.next_out,b=e.output,r=s-(i-e.avail_out),h=s+(e.avail_out-257),l=_.dmax,p=_.wsize,n=_.whave,a=_.wnext,A=_.window,w=_.hold,d=_.bits,Z=_.lencode,v=_.distcode,u=(1<<_.lenbits)-1,y=(1<<_.distbits)-1;t:do{d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=Z[w&u];e:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,f===0)b[s++]=65535&k;else{if(!(16&f)){if(!(64&f)){k=Z[(65535&k)+(w&(1<<f)-1)];continue e}if(32&f){_.mode=16191;break t}e.msg="invalid literal/length code",_.mode=j;break t}g=65535&k,f&=15,f&&(d<f&&(w+=m[t++]<<d,d+=8),g+=w&(1<<f)-1,w>>>=f,d-=f),d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=v[w&y];i:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,!(16&f)){if(!(64&f)){k=v[(65535&k)+(w&(1<<f)-1)];continue i}e.msg="invalid distance code",_.mode=j;break t}if(E=65535&k,f&=15,d<f&&(w+=m[t++]<<d,d+=8,d<f&&(w+=m[t++]<<d,d+=8)),E+=w&(1<<f)-1,E>l){e.msg="invalid distance too far back",_.mode=j;break t}if(w>>>=f,d-=f,f=s-r,E>f){if(f=E-f,f>n&&_.sane){e.msg="invalid distance too far back",_.mode=j;break t}if(c=0,x=A,a===0){if(c+=p-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}else if(a<f){if(c+=p+a-f,f-=a,f<g){g-=f;do b[s++]=A[c++];while(--f);if(c=0,a<g){f=a,g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}}else if(c+=a-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}for(;g>2;)b[s++]=x[c++],b[s++]=x[c++],b[s++]=x[c++],g-=3;g&&(b[s++]=x[c++],g>1&&(b[s++]=x[c++]))}else{c=s-E;do b[s++]=b[c++],b[s++]=b[c++],b[s++]=b[c++],g-=3;while(g>2);g&&(b[s++]=b[c++],g>1&&(b[s++]=b[c++]))}break}}break}}while(t<o&&s<h);g=d>>3,t-=g,d-=g<<3,w&=(1<<d)-1,e.next_in=t,e.next_out=s,e.avail_in=t<o?o-t+5:5-(t-o),e.avail_out=s<h?h-s+257:257-(s-h),_.hold=w,_.bits=d};const K=15,Tt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ot=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ut=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Dt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var z=(e,i,t,o,s,r,h,l)=>{const p=l.bits;let n,a,A,w,d,Z,v=0,u=0,y=0,k=0,f=0,g=0,E=0,c=0,x=0,m=0,b=null;const _=new Uint16Array(16),S=new Uint16Array(16);let H,q,J,Q=null;for(v=0;v<=K;v++)_[v]=0;for(u=0;u<o;u++)_[i[t+u]]++;for(f=p,k=K;k>=1&&_[k]===0;k--);if(f>k&&(f=k),k===0)return s[r++]=20971520,s[r++]=20971520,l.bits=1,0;for(y=1;y<k&&_[y]===0;y++);for(f<y&&(f=y),c=1,v=1;v<=K;v++)if(c<<=1,c-=_[v],c<0)return-1;if(c>0&&(e===0||k!==1))return-1;for(S[1]=0,v=1;v<K;v++)S[v+1]=S[v]+_[v];for(u=0;u<o;u++)i[t+u]!==0&&(h[S[i[t+u]]++]=u);if(e===0?(b=Q=h,Z=20):e===1?(b=Tt,Q=Ot,Z=257):(b=Ut,Q=Dt,Z=0),m=0,u=0,v=y,d=r,g=f,E=0,A=-1,x=1<<f,w=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){H=v-E,h[u]+1<Z?(q=0,J=h[u]):h[u]>=Z?(q=Q[h[u]-Z],J=b[h[u]-Z]):(q=96,J=0),n=1<<v-E,a=1<<g,y=a;do a-=n,s[d+(m>>E)+a]=H<<24|q<<16|J|0;while(a!==0);for(n=1<<v-1;m&n;)n>>=1;if(n!==0?(m&=n-1,m+=n):m=0,u++,--_[v]==0){if(v===k)break;v=i[t+h[u]]}if(v>f&&(m&w)!==A){for(E===0&&(E=f),d+=y,g=v-E,c=1<<g;g+E<k&&(c-=_[g+E],!(c<=0));)g++,c<<=1;if(x+=1<<g,e===1&&x>852||e===2&&x>592)return 1;A=m&w,s[A]=f<<24|g<<16|d-r|0}}return m!==0&&(s[d+m]=v-E<<24|64<<16|0),l.bits=f,0},V={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:lt,Z_BLOCK:Bt,Z_TREES:P,Z_OK:C,Z_STREAM_END:It,Z_NEED_DICT:Ct,Z_STREAM_ERROR:T,Z_DATA_ERROR:dt,Z_MEM_ERROR:ft,Z_BUF_ERROR:Nt,Z_DEFLATED:ht}=V,Y=16180,G=16190,D=16191,$=16192,tt=16194,X=16199,W=16200,et=16206,R=16209,ct=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function zt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const N=e=>{if(!e)return 1;const i=e.state;return!i||i.strm!==e||i.mode<Y||i.mode>16211?1:0},ut=e=>{if(N(e))return T;const i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=Y,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(852),i.distcode=i.distdyn=new Int32Array(592),i.sane=1,i.back=-1,C},wt=e=>{if(N(e))return T;const i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,ut(e)},bt=(e,i)=>{let t;if(N(e))return T;const o=e.state;return i<0?(t=0,i=-i):(t=5+(i>>4),i<48&&(i&=15)),i&&(i<8||i>15)?T:(o.window!==null&&o.wbits!==i&&(o.window=null),o.wrap=t,o.wbits=i,wt(e))},mt=(e,i)=>{if(!e)return T;const t=new zt;e.state=t,t.strm=e,t.window=null,t.mode=Y;const o=bt(e,i);return o!==C&&(e.state=null),o};let it,nt,kt=!0;const Ft=e=>{if(kt){it=new Int32Array(512),nt=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(z(1,e.lens,0,288,it,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;z(2,e.lens,0,32,nt,0,e.work,{bits:5}),kt=!1}e.lencode=it,e.lenbits=9,e.distcode=nt,e.distbits=5},_t=(e,i,t,o)=>{let s;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),o>=r.wsize?(r.window.set(i.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>o&&(s=o),r.window.set(i.subarray(t-o,t-o+s),r.wnext),(o-=s)?(r.window.set(i.subarray(t-o,t),0),r.wnext=o,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var B={inflateReset:wt,inflateReset2:bt,inflateResetKeep:ut,inflateInit:e=>mt(e,15),inflateInit2:mt,inflate:(e,i)=>{let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m=0;const b=new Uint8Array(4);let _,S;const H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(N(e)||!e.output||!e.input&&e.avail_in!==0)return T;t=e.state,t.mode===D&&(t.mode=$),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,A=l,w=p,x=C;t:for(;;)switch(t.mode){case Y:if(t.wrap===0){t.mode=$;break}for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(2&t.wrap&&n===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0),n=0,a=0,t.mode=16181;break}if(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&n)<<8)+(n>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((15&n)!==ht){e.msg="unknown compression method",t.mode=R;break}if(n>>>=4,a-=4,c=8+(15&n),t.wbits===0&&(t.wbits=c),c>15||c>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&n?16189:D,n=0,a=0;break;case 16181:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.flags=n,(255&t.flags)!==ht){e.msg="unknown compression method",t.mode=R;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=n>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16182;case 16182:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.time=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,b[2]=n>>>16&255,b[3]=n>>>24&255,t.check=U(t.check,b,4,0)),n=0,a=0,t.mode=16183;case 16183:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.xflags=255&n,t.head.os=n>>8),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16184;case 16184:if(1024&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length=n,t.head&&(t.head.extra_len=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&(d=t.length,d>l&&(d=l),d&&(t.head&&(c=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(o.subarray(r,r+d),c)),512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,t.length-=d),t.length))break t;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.name+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.comment+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(65535&t.check)){e.msg="header crc mismatch",t.mode=R;break}n=0,a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=D;break;case 16189:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}e.adler=t.check=ct(n),n=0,a=0,t.mode=G;case G:if(t.havedict===0)return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,Ct;e.adler=t.check=1,t.mode=D;case D:if(i===Bt||i===P)break t;case $:if(t.last){n>>>=7&a,a-=7&a,t.mode=et;break}for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}switch(t.last=1&n,n>>>=1,a-=1,3&n){case 0:t.mode=16193;break;case 1:if(Ft(t),t.mode=X,i===P){n>>>=2,a-=2;break t}break;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=R}n>>>=2,a-=2;break;case 16193:for(n>>>=7&a,a-=7&a;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if((65535&n)!=(n>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=65535&n,n=0,a=0,t.mode=tt,i===P)break t;case tt:t.mode=16195;case 16195:if(d=t.length,d){if(d>l&&(d=l),d>p&&(d=p),d===0)break t;s.set(o.subarray(r,r+d),h),l-=d,r+=d,p-=d,h+=d,t.length-=d;break}t.mode=D;break;case 16196:for(;a<14;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.nlen=257+(31&n),n>>>=5,a-=5,t.ndist=1+(31&n),n>>>=5,a-=5,t.ncode=4+(15&n),n>>>=4,a-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.lens[H[t.have++]]=7&n,n>>>=3,a-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,_={bits:t.lenbits},x=z(0,t.lens,0,19,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(k<16)n>>>=u,a-=u,t.lens[t.have++]=k;else{if(k===16){for(S=u+2;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n>>>=u,a-=u,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}c=t.lens[t.have-1],d=3+(3&n),n>>>=2,a-=2}else if(k===17){for(S=u+3;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=3+(7&n),n>>>=3,a-=3}else{for(S=u+7;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=11+(127&n),n>>>=7,a-=7}if(t.have+d>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;d--;)t.lens[t.have++]=c}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,_={bits:t.lenbits},x=z(1,t.lens,0,t.nlen,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,_={bits:t.distbits},x=z(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,_),t.distbits=_.bits,x){e.msg="invalid distances set",t.mode=R;break}if(t.mode=X,i===P)break t;case X:t.mode=W;case W:if(l>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,St(e,w),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,t.mode===D&&(t.back=-1);break}for(t.back=0;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(y&&!(240&y)){for(f=u,g=y,E=k;m=t.lencode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,t.length=k,y===0){t.mode=16205;break}if(32&y){t.back=-1,t.mode=D;break}if(64&y){e.msg="invalid literal/length code",t.mode=R;break}t.extra=15&y,t.mode=16201;case 16201:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;m=t.distcode[n&(1<<t.distbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(!(240&y)){for(f=u,g=y,E=k;m=t.distcode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,64&y){e.msg="invalid distance code",t.mode=R;break}t.offset=k,t.extra=15&y,t.mode=16203;case 16203:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.offset+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=16204;case 16204:if(p===0)break t;if(d=w-p,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}d>t.wnext?(d-=t.wnext,Z=t.wsize-d):Z=t.wnext-d,d>t.length&&(d=t.length),v=t.window}else v=s,Z=h-t.offset,d=t.length;d>p&&(d=p),p-=d,t.length-=d;do s[h++]=v[Z++];while(--d);t.length===0&&(t.mode=W);break;case 16205:if(p===0)break t;s[h++]=t.length,p--,t.mode=W;break;case et:if(t.wrap){for(;a<32;){if(l===0)break t;l--,n|=o[r++]<<a,a+=8}if(w-=p,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,h-w):I(t.check,s,w,h-w)),w=p,4&t.wrap&&(t.flags?n:ct(n))!==t.check){e.msg="incorrect data check",t.mode=R;break}n=0,a=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=R;break}n=0,a=0}t.mode=16208;case 16208:x=It;break t;case R:x=dt;break t;case 16210:return ft;default:return T}return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,(t.wsize||w!==e.avail_out&&t.mode<R&&(t.mode<et||i!==lt))&&_t(e,e.output,e.next_out,w-e.avail_out),A-=e.avail_in,w-=e.avail_out,e.total_in+=A,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,e.next_out-w):I(t.check,s,w,e.next_out-w)),e.data_type=t.bits+(t.last?64:0)+(t.mode===D?128:0)+(t.mode===X||t.mode===tt?256:0),(A===0&&w===0||i===lt)&&x===C&&(x=Nt),x},inflateEnd:e=>{if(N(e))return T;let i=e.state;return i.window&&(i.window=null),e.state=null,C},inflateGetHeader:(e,i)=>{if(N(e))return T;const t=e.state;return 2&t.wrap?(t.head=i,i.done=!1,C):T},inflateSetDictionary:(e,i)=>{const t=i.length;let o,s,r;return N(e)?T:(o=e.state,o.wrap!==0&&o.mode!==G?T:o.mode===G&&(s=1,s=I(s,i,t,0),s!==o.check)?dt:(r=_t(e,i,t,t),r?(o.mode=16210,ft):(o.havedict=1,C)))},inflateInfo:"pako inflate (from Nodeca project)"};const Lt=(e,i)=>Object.prototype.hasOwnProperty.call(e,i);var Mt=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const o in t)Lt(t,o)&&(e[o]=t[o])}}return e},Ht=e=>{let i=0;for(let o=0,s=e.length;o<s;o++)i+=e[o].length;const t=new Uint8Array(i);for(let o=0,s=0,r=e.length;o<r;o++){let h=e[o];t.set(h,s),s+=h.length}return t};let gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}const F=new Uint8Array(256);for(let e=0;e<256;e++)F[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;F[254]=F[254]=1;var jt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,o,s,r,h=e.length,l=0;for(s=0;s<h;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(l),r=0,s=0;r<l;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),t<128?i[r++]=t:t<2048?(i[r++]=192|t>>>6,i[r++]=128|63&t):t<65536?(i[r++]=224|t>>>12,i[r++]=128|t>>>6&63,i[r++]=128|63&t):(i[r++]=240|t>>>18,i[r++]=128|t>>>12&63,i[r++]=128|t>>>6&63,i[r++]=128|63&t);return i},Kt=(e,i)=>{const t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let o,s;const r=new Array(2*t);for(s=0,o=0;o<t;){let h=e[o++];if(h<128){r[s++]=h;continue}let l=F[h];if(l>4)r[s++]=65533,o+=l-1;else{for(h&=l===2?31:l===3?15:7;l>1&&o<t;)h=h<<6|63&e[o++],l--;l>1?r[s++]=65533:h<65536?r[s++]=h:(h-=65536,r[s++]=55296|h>>10&1023,r[s++]=56320|1023&h)}}return((h,l)=>{if(l<65534&&h.subarray&>)return String.fromCharCode.apply(null,h.length===l?h:h.subarray(0,l));let p="";for(let n=0;n<l;n++)p+=String.fromCharCode(h[n]);return p})(r,s)},Pt=(e,i)=>{(i=i||e.length)>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?i:t+F[e[t]]>i?t:i},at={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Gt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_FINISH:Wt,Z_OK:L,Z_STREAM_END:rt,Z_NEED_DICT:ot,Z_STREAM_ERROR:qt,Z_DATA_ERROR:vt,Z_MEM_ERROR:Jt}=V;function M(e){this.options=Mt({chunkSize:65536,windowBits:15,to:""},e||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),!(i.windowBits>=0&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&!(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let t=B.inflateInit2(this.strm,i.windowBits);if(t!==L)throw new Error(at[t]);if(this.header=new Gt,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=jt(i.dictionary):pt.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=B.inflateSetDictionary(this.strm,i.dictionary),t!==L)))throw new Error(at[t])}function st(e,i){const t=new M(i);if(t.push(e),t.err)throw t.msg||at[t.err];return t.result}M.prototype.push=function(e,i){const t=this.strm,o=this.options.chunkSize,s=this.options.dictionary;let r,h,l;if(this.ended)return!1;for(h=i===~~i?i:i===!0?Wt:Xt,pt.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(o),t.next_out=0,t.avail_out=o),r=B.inflate(t,h),r===ot&&s&&(r=B.inflateSetDictionary(t,s),r===L?r=B.inflate(t,h):r===vt&&(r=ot));t.avail_in>0&&r===rt&&t.state.wrap>0&&e[t.next_in]!==0;)B.inflateReset(t),r=B.inflate(t,h);switch(r){case qt:case vt:case ot:case Jt:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===rt))if(this.options.to==="string"){let p=Pt(t.output,t.next_out),n=t.next_out-p,a=Kt(t.output,p);t.next_out=n,t.avail_out=o-n,n&&t.output.set(t.output.subarray(p,p+n),0),this.onData(a)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(r!==L||l!==0){if(r===rt)return r=B.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},M.prototype.onData=function(e){this.chunks.push(e)},M.prototype.onEnd=function(e){e===L&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var xt=M,yt=st,Et=function(e,i){return(i=i||{}).raw=!0,st(e,i)},Rt=st,At=V,Qt={Inflate:xt,inflate:yt,inflateRaw:Et,ungzip:Rt,constants:At};O.Inflate=xt,O.constants=At,O.default=Qt,O.inflate=yt,O.inflateRaw=Et,O.ungzip=Rt,Object.defineProperty(O,"__esModule",{value:!0})}); diff --git a/public/lib/Cesium/ThirdParty/Workers/z-worker-pako.js b/public/lib/Cesium/ThirdParty/Workers/z-worker-pako.js index 0ecb9e26..da960cf2 100644 --- a/public/lib/Cesium/ThirdParty/Workers/z-worker-pako.js +++ b/public/lib/Cesium/ThirdParty/Workers/z-worker-pako.js @@ -1 +1 @@ -(function(){"use strict";const{Array:T,Object:w,Math:v,Error:z,Uint8Array:p,Uint16Array:_e,Uint32Array:ie,Int32Array:me,DataView:ce,TextEncoder:P,crypto:A,postMessage:K}=globalThis,R=[];for(let n=0;256>n;n++){let e=n;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;R[n]=e}class W{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let s=0,r=0|e.length;r>s;s++)t=t>>>8^R[255&(t^e[s])];this.crc=t}get(){return~this.crc}}const d={concat(n,e){if(n.length===0||e.length===0)return n.concat(e);const t=n[n.length-1],s=d.getPartial(t);return s===32?n.concat(e):d._shiftRight(e,s,0|t,n.slice(0,n.length-1))},bitLength(n){const e=n.length;if(e===0)return 0;const t=n[e-1];return 32*(e-1)+d.getPartial(t)},clamp(n,e){if(32*n.length<e)return n;const t=(n=n.slice(0,v.ceil(e/32))).length;return e&=31,t>0&&e&&(n[t-1]=d.partial(e,n[t-1]&2147483648>>e-1,1)),n},partial:(n,e,t)=>n===32?e:(t?0|e:e<<32-n)+1099511627776*n,getPartial:n=>v.round(n/1099511627776)||32,_shiftRight(n,e,t,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(t),t=0;if(e===0)return s.concat(n);for(let i=0;i<n.length;i++)s.push(t|n[i]>>>e),t=n[i]<<32-e;const r=n.length?n[n.length-1]:0,a=d.getPartial(r);return s.push(d.partial(e+a&31,e+a>32?t:s.pop(),1)),s}},E={bytes:{fromBits(n){const e=d.bitLength(n)/8,t=new p(e);let s;for(let r=0;e>r;r++)!(3&r)&&(s=n[r/4]),t[r]=s>>>24,s<<=8;return t},toBits(n){const e=[];let t,s=0;for(t=0;t<n.length;t++)s=s<<8|n[t],(3&t)==3&&(e.push(s),s=0);return 3&t&&e.push(d.partial(8*(3&t),s)),e}}},M={sha1:function(n){n?(this._h=n._h.slice(0),this._buffer=n._buffer.slice(0),this._length=n._length):this.reset()}};M.sha1.prototype={blockSize:512,reset:function(){const n=this;return n._h=this._init.slice(0),n._buffer=[],n._length=0,n},update:function(n){const e=this;typeof n=="string"&&(n=E.utf8String.toBits(n));const t=e._buffer=d.concat(e._buffer,n),s=e._length,r=e._length=s+d.bitLength(n);if(r>9007199254740991)throw new z("Cannot hash more than 2^53 - 1 bits");const a=new ie(t);let i=0;for(let o=e.blockSize+s-(e.blockSize+s&e.blockSize-1);r>=o;o+=e.blockSize)e._block(a.subarray(16*i,16*(i+1))),i+=1;return t.splice(0,16*i),e},finalize:function(){const n=this;let e=n._buffer;const t=n._h;e=d.concat(e,[d.partial(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(v.floor(n._length/4294967296)),e.push(0|n._length);e.length;)n._block(e.splice(0,16));return n.reset(),t},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(n,e,t,s)=>n>19?n>39?n>59?n>79?void 0:e^t^s:e&t|e&s|t&s:e^t^s:e&t|~e&s,_S:(n,e)=>e<<n|e>>>32-n,_block:function(n){const e=this,t=e._h,s=T(80);for(let c=0;16>c;c++)s[c]=n[c];let r=t[0],a=t[1],i=t[2],o=t[3],l=t[4];for(let c=0;79>=c;c++){16>c||(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const h=e._S(5,r)+e._f(c,a,i,o)+l+s[c]+e._key[v.floor(c/20)]|0;l=o,o=i,i=e._S(30,a),a=r,r=h}t[0]=t[0]+r|0,t[1]=t[1]+a|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+l|0}};const j="Invalid pasword",I=16,x={name:"PBKDF2"},oe=w.assign({hash:{name:"HMAC"}},x),le=w.assign({iterations:1e3,hash:{name:"SHA-1"}},x),he=["deriveBits"],H=[8,12,16],V=[16,24,32],_=10,F=[0,0,0,0],y=E.bytes,O=class{constructor(n){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],s=e._tables[1],r=n.length;let a,i,o,l=1;if(r!==4&&r!==6&&r!==8)throw new z("invalid aes key size");for(e._key=[i=n.slice(0),o=[]],a=r;4*r+28>a;a++){let c=i[a-1];(a%r==0||r===8&&a%r==4)&&(c=t[c>>>24]<<24^t[c>>16&255]<<16^t[c>>8&255]<<8^t[255&c],a%r==0&&(c=c<<8^c>>>24^l<<24,l=l<<1^283*(l>>7))),i[a]=i[a-r]^c}for(let c=0;a;c++,a--){const h=i[3&c?a:a-4];o[c]=4>=a||4>c?h:s[0][t[h>>>24]]^s[1][t[h>>16&255]]^s[2][t[h>>8&255]]^s[3][t[255&h]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],e=this._tables[1],t=n[4],s=e[4],r=[],a=[];let i,o,l,c;for(let h=0;256>h;h++)a[(r[h]=h<<1^283*(h>>7))^h]=h;for(let h=i=0;!t[h];h^=o||1,i=a[i]||1){let f=i^i<<1^i<<2^i<<3^i<<4;f=f>>8^255&f^99,t[h]=f,s[f]=h,c=r[l=r[o=r[h]]];let S=16843009*c^65537*l^257*o^16843008*h,D=257*r[f]^16843008*f;for(let g=0;4>g;g++)n[g][h]=D=D<<24^D>>>8,e[g][f]=S=S<<24^S>>>8}for(let h=0;5>h;h++)n[h]=n[h].slice(0),e[h]=e[h].slice(0)}_crypt(n,e){if(n.length!==4)throw new z("invalid aes block size");const t=this._key[e],s=t.length/4-2,r=[0,0,0,0],a=this._tables[e],i=a[0],o=a[1],l=a[2],c=a[3],h=a[4];let f,S,D,g=n[0]^t[0],m=n[e?3:1]^t[1],b=n[2]^t[2],k=n[e?1:3]^t[3],B=4;for(let C=0;s>C;C++)f=i[g>>>24]^o[m>>16&255]^l[b>>8&255]^c[255&k]^t[B],S=i[m>>>24]^o[b>>16&255]^l[k>>8&255]^c[255&g]^t[B+1],D=i[b>>>24]^o[k>>16&255]^l[g>>8&255]^c[255&m]^t[B+2],k=i[k>>>24]^o[g>>16&255]^l[m>>8&255]^c[255&b]^t[B+3],B+=4,g=f,m=S,b=D;for(let C=0;4>C;C++)r[e?3&-C:C]=h[g>>>24]<<24^h[m>>16&255]<<16^h[b>>8&255]<<8^h[255&k]^t[B++],f=g,g=m,m=b,b=k,k=f;return r}},q=class{constructor(n,e){this._prf=n,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)==255){let e=n>>16&255,t=n>>8&255,s=255&n;e===255?(e=0,t===255?(t=0,s===255?s=0:++s):++t):++e,n=0,n+=e<<16,n+=t<<8,n+=s}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,e,t){let s;if(!(s=e.length))return[];const r=d.bitLength(e);for(let a=0;s>a;a+=4){this.incCounter(t);const i=n.encrypt(t);e[a]^=i[0],e[a+1]^=i[1],e[a+2]^=i[2],e[a+3]^=i[3]}return d.clamp(e,r)}},J=class{constructor(n){const e=this,t=e._hash=M.sha1,s=[[],[]],r=t.prototype.blockSize/32;e._baseHash=[new t,new t],n.length>r&&(n=t.hash(n));for(let a=0;r>a;a++)s[0][a]=909522486^n[a],s[1][a]=1549556828^n[a];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new t(e._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){this._updated=!0,this._resultHash.update(n)}digest(){const n=this,e=n._resultHash.finalize(),t=new n._hash(n._baseHash[1]).update(e).finalize();return n.reset(),t}};class pe{constructor(e,t,s){w.assign(this,{password:e,signed:t,strength:s-1,pendingInput:new p(0)})}async append(e){const t=this;if(t.password){const s=u(e,0,H[t.strength]+2);await(async(r,a,i)=>{await Q(r,i,u(a,0,H[r.strength]));const o=u(a,H[r.strength]),l=r.keys.passwordVerification;if(l[0]!=o[0]||l[1]!=o[1])throw new z(j)})(t,s,t.password),t.password=null,t.aesCtrGladman=new q(new O(t.keys.key),T.from(F)),t.hmac=new J(t.keys.authentication),e=u(e,H[t.strength]+2)}return N(t,e,new p(e.length-_-(e.length-_)%I),0,_,!0)}flush(){const e=this,t=e.pendingInput,s=u(t,0,t.length-_),r=u(t,t.length-_);let a=new p(0);if(s.length){const o=y.toBits(s);e.hmac.update(o);const l=e.aesCtrGladman.update(o);a=y.fromBits(l)}let i=!0;if(e.signed){const o=u(y.fromBits(e.hmac.digest()),0,_);for(let l=0;_>l;l++)o[l]!=r[l]&&(i=!1)}return{valid:i,data:a}}}class de{constructor(e,t){w.assign(this,{password:e,strength:t-1,pendingInput:new p(0)})}async append(e){const t=this;let s=new p(0);t.password&&(s=await(async(a,i)=>{const o=A.getRandomValues(new p(H[a.strength]));return await Q(a,i,o),U(o,a.keys.passwordVerification)})(t,t.password),t.password=null,t.aesCtrGladman=new q(new O(t.keys.key),T.from(F)),t.hmac=new J(t.keys.authentication));const r=new p(s.length+e.length-e.length%I);return r.set(s,0),N(t,e,r,s.length,0)}flush(){const e=this;let t=new p(0);if(e.pendingInput.length){const r=e.aesCtrGladman.update(y.toBits(e.pendingInput));e.hmac.update(r),t=y.fromBits(r)}const s=u(y.fromBits(e.hmac.digest()),0,_);return{data:U(t,s),signature:s}}}function N(n,e,t,s,r,a){const i=e.length-r;let o;for(n.pendingInput.length&&(e=U(n.pendingInput,e),t=((l,c)=>{if(c&&c>l.length){const h=l;(l=new p(c)).set(h,0)}return l})(t,i-i%I)),o=0;i-I>=o;o+=I){const l=y.toBits(u(e,o,o+I));a&&n.hmac.update(l);const c=n.aesCtrGladman.update(l);a||n.hmac.update(c),t.set(y.fromBits(c),o+s)}return n.pendingInput=u(e,o),t}async function Q(n,e,t){const s=(o=>{if(P===void 0){const l=new p((o=unescape(encodeURIComponent(o))).length);for(let c=0;c<l.length;c++)l[c]=o.charCodeAt(c);return l}return new P().encode(o)})(e),r=await A.subtle.importKey("raw",s,oe,!1,he),a=await A.subtle.deriveBits(w.assign({salt:t},le),r,8*(2*V[n.strength]+2)),i=new p(a);n.keys={key:y.toBits(u(i,0,V[n.strength])),authentication:y.toBits(u(i,V[n.strength],2*V[n.strength])),passwordVerification:u(i,2*V[n.strength])}}function U(n,e){let t=n;return n.length+e.length&&(t=new p(n.length+e.length),t.set(n,0),t.set(e,n.length)),t}function u(n,e,t){return n.subarray(e,t)}class ue{constructor(e,t){w.assign(this,{password:e,passwordVerification:t}),Z(this,e)}append(e){const t=this;if(t.password){const s=X(t,e.subarray(0,12));if(t.password=null,s[11]!=t.passwordVerification)throw new z(j);e=e.subarray(12)}return X(t,e)}flush(){return{valid:!0,data:new p(0)}}}class fe{constructor(e,t){w.assign(this,{password:e,passwordVerification:t}),Z(this,e)}append(e){const t=this;let s,r;if(t.password){t.password=null;const a=A.getRandomValues(new p(12));a[11]=t.passwordVerification,s=new p(e.length+a.length),s.set(Y(t,a),0),r=12}else s=new p(e.length),r=0;return s.set(Y(t,e),r),s}flush(){return{data:new p(0)}}}function X(n,e){const t=new p(e.length);for(let s=0;s<e.length;s++)t[s]=$(n)^e[s],G(n,t[s]);return t}function Y(n,e){const t=new p(e.length);for(let s=0;s<e.length;s++)t[s]=$(n)^e[s],G(n,e[s]);return t}function Z(n,e){n.keys=[305419896,591751049,878082192],n.crcKey0=new W(n.keys[0]),n.crcKey2=new W(n.keys[2]);for(let t=0;t<e.length;t++)G(n,e.charCodeAt(t))}function G(n,e){n.crcKey0.append([e]),n.keys[0]=~n.crcKey0.get(),n.keys[1]=te(n.keys[1]+ee(n.keys[0])),n.keys[1]=te(v.imul(n.keys[1],134775813)+1),n.crcKey2.append([n.keys[1]>>>24]),n.keys[2]=~n.crcKey2.get()}function $(n){const e=2|n.keys[2];return ee(v.imul(e,1^e)>>>8)}function ee(n){return 255&n}function te(n){return 4294967295&n}const ne="deflate",se="inflate",re="Invalid signature";class ge{constructor(e,{signature:t,password:s,signed:r,compressed:a,zipCrypto:i,passwordVerification:o,encryptionStrength:l},{chunkSize:c}){const h=!!s;w.assign(this,{signature:t,encrypted:h,signed:r,compressed:a,inflate:a&&new e({chunkSize:c}),crc32:r&&new W,zipCrypto:i,decrypt:h&&i?new ue(s,o):new pe(s,r,l)})}async append(e){const t=this;return t.encrypted&&e.length&&(e=await t.decrypt.append(e)),t.compressed&&e.length&&(e=await t.inflate.append(e)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),e}async flush(){const e=this;let t,s=new p(0);if(e.encrypted){const r=e.decrypt.flush();if(!r.valid)throw new z(re);s=r.data}if((!e.encrypted||e.zipCrypto)&&e.signed){const r=new ce(new p(4).buffer);if(t=e.crc32.get(),r.setUint32(0,t),e.signature!=r.getUint32(0,!1))throw new z(re)}return e.compressed&&(s=await e.inflate.append(s)||new p(0),await e.inflate.flush()),{data:s,signature:t}}}class we{constructor(e,{encrypted:t,signed:s,compressed:r,level:a,zipCrypto:i,password:o,passwordVerification:l,encryptionStrength:c},{chunkSize:h}){w.assign(this,{encrypted:t,signed:s,compressed:r,deflate:r&&new e({level:a||5,chunkSize:h}),crc32:s&&new W,zipCrypto:i,encrypt:t&&i?new fe(o,l):new de(o,c)})}async append(e){const t=this;let s=e;return t.compressed&&e.length&&(s=await t.deflate.append(e)),t.encrypted&&s.length&&(s=await t.encrypt.append(s)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),s}async flush(){const e=this;let t,s=new p(0);if(e.compressed&&(s=await e.deflate.flush()||new p(0)),e.encrypted){s=await e.encrypt.append(s);const r=e.encrypt.flush();t=r.signature;const a=new p(s.length+r.data.length);a.set(s,0),a.set(r.data,s.length),s=a}return e.encrypted&&!e.zipCrypto||!e.signed||(t=e.crc32.get()),{data:s,signature:t}}}const ye={init(n){n.scripts&&n.scripts.length&&importScripts.apply(void 0,n.scripts);const e=n.options;let t;self.initCodec&&self.initCodec(),e.codecType.startsWith(ne)?t=self.Deflate:e.codecType.startsWith(se)&&(t=self.Inflate),L=((s,r,a)=>r.codecType.startsWith(ne)?new we(s,r,a):r.codecType.startsWith(se)?new ge(s,r,a):void 0)(t,e,n.config)},append:async n=>({data:await L.append(n.data)}),flush:()=>L.flush()};let L;function ae(n,e,t){return class{constructor(r){const a=this;a.codec=new n(w.assign({},e,r)),t(a.codec,i=>{if(a.pendingData){const o=a.pendingData;a.pendingData=new p(o.length+i.length),a.pendingData.set(o,0),a.pendingData.set(i,o.length)}else a.pendingData=new p(i)})}async append(r){return this.codec.push(r),s(this)}async flush(){return this.codec.push(new p(0),!0),s(this)}};function s(r){if(r.pendingData){const a=r.pendingData;return r.pendingData=null,a}return new p(0)}}addEventListener("message",async n=>{const e=n.data,t=e.type,s=ye[t];if(s)try{e.data&&(e.data=new p(e.data));const r=await s(e)||{};if(r.type=t,r.data)try{r.data=r.data.buffer,K(r,[r.data])}catch{K(r)}else K(r)}catch(r){K({type:t,error:{message:r.message,stack:r.stack}})}}),self.initCodec=()=>{const{Deflate:n,Inflate:e}=((t,s={},r)=>({Deflate:ae(t.Deflate,s.deflate,r),Inflate:ae(t.Inflate,s.inflate,r)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},(t,s)=>t.onData=s);self.Deflate=n,self.Inflate=e}})(); +(function(){"use strict";const{Array:G,Object:y,Math:k,Error:m,Uint8Array:p,Uint16Array:ve,Uint32Array:M,Int32Array:ze,DataView:j,TextEncoder:x,crypto:b,postMessage:A}=globalThis,F=[];for(let n=0;256>n;n++){let e=n;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;F[n]=e}class R{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let s=0,a=0|e.length;a>s;s++)t=t>>>8^F[255&(t^e[s])];this.crc=t}get(){return~this.crc}}const u={concat(n,e){if(n.length===0||e.length===0)return n.concat(e);const t=n[n.length-1],s=u.getPartial(t);return s===32?n.concat(e):u._shiftRight(e,s,0|t,n.slice(0,n.length-1))},bitLength(n){const e=n.length;if(e===0)return 0;const t=n[e-1];return 32*(e-1)+u.getPartial(t)},clamp(n,e){if(32*n.length<e)return n;const t=(n=n.slice(0,k.ceil(e/32))).length;return e&=31,t>0&&e&&(n[t-1]=u.partial(e,n[t-1]&2147483648>>e-1,1)),n},partial:(n,e,t)=>n===32?e:(t?0|e:e<<32-n)+1099511627776*n,getPartial:n=>k.round(n/1099511627776)||32,_shiftRight(n,e,t,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(t),t=0;if(e===0)return s.concat(n);for(let i=0;i<n.length;i++)s.push(t|n[i]>>>e),t=n[i]<<32-e;const a=n.length?n[n.length-1]:0,r=u.getPartial(a);return s.push(u.partial(e+r&31,e+r>32?t:s.pop(),1)),s}},W={bytes:{fromBits(n){const e=u.bitLength(n)/8,t=new p(e);let s;for(let a=0;e>a;a++)!(3&a)&&(s=n[a/4]),t[a]=s>>>24,s<<=8;return t},toBits(n){const e=[];let t,s=0;for(t=0;t<n.length;t++)s=s<<8|n[t],(3&t)==3&&(e.push(s),s=0);return 3&t&&e.push(u.partial(8*(3&t),s)),e}}},O={sha1:function(n){n?(this._h=n._h.slice(0),this._buffer=n._buffer.slice(0),this._length=n._length):this.reset()}};O.sha1.prototype={blockSize:512,reset:function(){const n=this;return n._h=this._init.slice(0),n._buffer=[],n._length=0,n},update:function(n){const e=this;typeof n=="string"&&(n=W.utf8String.toBits(n));const t=e._buffer=u.concat(e._buffer,n),s=e._length,a=e._length=s+u.bitLength(n);if(a>9007199254740991)throw new m("Cannot hash more than 2^53 - 1 bits");const r=new M(t);let i=0;for(let c=e.blockSize+s-(e.blockSize+s&e.blockSize-1);a>=c;c+=e.blockSize)e._block(r.subarray(16*i,16*(i+1))),i+=1;return t.splice(0,16*i),e},finalize:function(){const n=this;let e=n._buffer;const t=n._h;e=u.concat(e,[u.partial(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(k.floor(n._length/4294967296)),e.push(0|n._length);e.length;)n._block(e.splice(0,16));return n.reset(),t},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(n,e,t,s)=>n>19?n>39?n>59?n>79?void 0:e^t^s:e&t|e&s|t&s:e^t^s:e&t|~e&s,_S:(n,e)=>e<<n|e>>>32-n,_block:function(n){const e=this,t=e._h,s=G(80);for(let o=0;16>o;o++)s[o]=n[o];let a=t[0],r=t[1],i=t[2],c=t[3],l=t[4];for(let o=0;79>=o;o++){16>o||(s[o]=e._S(1,s[o-3]^s[o-8]^s[o-14]^s[o-16]));const h=e._S(5,a)+e._f(o,r,i,c)+l+s[o]+e._key[k.floor(o/20)]|0;l=c,c=i,i=e._S(30,r),r=a,a=h}t[0]=t[0]+a|0,t[1]=t[1]+r|0,t[2]=t[2]+i|0,t[3]=t[3]+c|0,t[4]=t[4]+l|0}};const de={getRandomValues(n){const e=new M(n.buffer),t=s=>{let a=987654321;const r=4294967295;return()=>(a=36969*(65535&a)+(a>>16)&r,(((a<<16)+(s=18e3*(65535&s)+(s>>16)&r)&r)/4294967296+.5)*(k.random()>.5?1:-1))};for(let s,a=0;a<n.length;a+=4){const r=t(4294967296*(s||k.random()));s=987654071*r(),e[a/4]=4294967296*r()|0}return n}},T={importKey:n=>new T.hmacSha1(W.bytes.toBits(n)),pbkdf2(n,e,t,s){if(t=t||1e4,0>s||0>t)throw new m("invalid params to pbkdf2");const a=1+(s>>5)<<2;let r,i,c,l,o;const h=new ArrayBuffer(a),d=new j(h);let w=0;const z=u;for(e=W.bytes.toBits(e),o=1;(a||1)>w;o++){for(r=i=n.encrypt(z.concat(e,[o])),c=1;t>c;c++)for(i=n.encrypt(i),l=0;l<i.length;l++)r[l]^=i[l];for(c=0;(a||1)>w&&c<r.length;c++)d.setInt32(w,r[c]),w+=4}return h.slice(0,s/8)},hmacSha1:class{constructor(n){const e=this,t=e._hash=O.sha1,s=[[],[]],a=t.prototype.blockSize/32;e._baseHash=[new t,new t],n.length>a&&(n=t.hash(n));for(let r=0;a>r;r++)s[0][r]=909522486^n[r],s[1][r]=1549556828^n[r];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new t(e._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){this._updated=!0,this._resultHash.update(n)}digest(){const n=this,e=n._resultHash.finalize(),t=new n._hash(n._baseHash[1]).update(e).finalize();return n.reset(),t}encrypt(n){if(this._updated)throw new m("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}}},q="Invalid pasword",D=16,J={name:"PBKDF2"},ue=y.assign({hash:{name:"HMAC"}},J),N=y.assign({iterations:1e3,hash:{name:"SHA-1"}},J),fe=["deriveBits"],H=[8,12,16],K=[16,24,32],v=10,Q=[0,0,0,0],U=b!==void 0,X=U&&b.subtle!==void 0,_=W.bytes,Y=class{constructor(n){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],s=e._tables[1],a=n.length;let r,i,c,l=1;if(a!==4&&a!==6&&a!==8)throw new m("invalid aes key size");for(e._key=[i=n.slice(0),c=[]],r=a;4*a+28>r;r++){let o=i[r-1];(r%a==0||a===8&&r%a==4)&&(o=t[o>>>24]<<24^t[o>>16&255]<<16^t[o>>8&255]<<8^t[255&o],r%a==0&&(o=o<<8^o>>>24^l<<24,l=l<<1^283*(l>>7))),i[r]=i[r-a]^o}for(let o=0;r;o++,r--){const h=i[3&o?r:r-4];c[o]=4>=r||4>o?h:s[0][t[h>>>24]]^s[1][t[h>>16&255]]^s[2][t[h>>8&255]]^s[3][t[255&h]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],e=this._tables[1],t=n[4],s=e[4],a=[],r=[];let i,c,l,o;for(let h=0;256>h;h++)r[(a[h]=h<<1^283*(h>>7))^h]=h;for(let h=i=0;!t[h];h^=c||1,i=r[i]||1){let d=i^i<<1^i<<2^i<<3^i<<4;d=d>>8^255&d^99,t[h]=d,s[d]=h,o=a[l=a[c=a[h]]];let w=16843009*o^65537*l^257*c^16843008*h,z=257*a[d]^16843008*d;for(let g=0;4>g;g++)n[g][h]=z=z<<24^z>>>8,e[g][d]=w=w<<24^w>>>8}for(let h=0;5>h;h++)n[h]=n[h].slice(0),e[h]=e[h].slice(0)}_crypt(n,e){if(n.length!==4)throw new m("invalid aes block size");const t=this._key[e],s=t.length/4-2,a=[0,0,0,0],r=this._tables[e],i=r[0],c=r[1],l=r[2],o=r[3],h=r[4];let d,w,z,g=n[0]^t[0],C=n[e?3:1]^t[1],S=n[2]^t[2],B=n[e?1:3]^t[3],V=4;for(let I=0;s>I;I++)d=i[g>>>24]^c[C>>16&255]^l[S>>8&255]^o[255&B]^t[V],w=i[C>>>24]^c[S>>16&255]^l[B>>8&255]^o[255&g]^t[V+1],z=i[S>>>24]^c[B>>16&255]^l[g>>8&255]^o[255&C]^t[V+2],B=i[B>>>24]^c[g>>16&255]^l[C>>8&255]^o[255&S]^t[V+3],V+=4,g=d,C=w,S=z;for(let I=0;4>I;I++)a[e?3&-I:I]=h[g>>>24]<<24^h[C>>16&255]<<16^h[S>>8&255]<<8^h[255&B]^t[V++],d=g,g=C,C=S,S=B,B=d;return a}},Z=class{constructor(n,e){this._prf=n,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)==255){let e=n>>16&255,t=n>>8&255,s=255&n;e===255?(e=0,t===255?(t=0,s===255?s=0:++s):++t):++e,n=0,n+=e<<16,n+=t<<8,n+=s}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,e,t){let s;if(!(s=e.length))return[];const a=u.bitLength(e);for(let r=0;s>r;r+=4){this.incCounter(t);const i=n.encrypt(t);e[r]^=i[0],e[r+1]^=i[1],e[r+2]^=i[2],e[r+3]^=i[3]}return u.clamp(e,a)}},$=T.hmacSha1;class ge{constructor(e,t,s){y.assign(this,{password:e,signed:t,strength:s-1,pendingInput:new p(0)})}async append(e){const t=this;if(t.password){const s=f(e,0,H[t.strength]+2);await(async(a,r,i)=>{await te(a,i,f(r,0,H[a.strength]));const c=f(r,H[a.strength]),l=a.keys.passwordVerification;if(l[0]!=c[0]||l[1]!=c[1])throw new m(q)})(t,s,t.password),t.password=null,t.aesCtrGladman=new Z(new Y(t.keys.key),G.from(Q)),t.hmac=new $(t.keys.authentication),e=f(e,H[t.strength]+2)}return ee(t,e,new p(e.length-v-(e.length-v)%D),0,v,!0)}flush(){const e=this,t=e.pendingInput,s=f(t,0,t.length-v),a=f(t,t.length-v);let r=new p(0);if(s.length){const c=_.toBits(s);e.hmac.update(c);const l=e.aesCtrGladman.update(c);r=_.fromBits(l)}let i=!0;if(e.signed){const c=f(_.fromBits(e.hmac.digest()),0,v);for(let l=0;v>l;l++)c[l]!=a[l]&&(i=!1)}return{valid:i,data:r}}}class we{constructor(e,t){y.assign(this,{password:e,strength:t-1,pendingInput:new p(0)})}async append(e){const t=this;let s=new p(0);t.password&&(s=await(async(r,i)=>{const c=(l=new p(H[r.strength]),U&&typeof b.getRandomValues=="function"?b.getRandomValues(l):de.getRandomValues(l));var l;return await te(r,i,c),L(c,r.keys.passwordVerification)})(t,t.password),t.password=null,t.aesCtrGladman=new Z(new Y(t.keys.key),G.from(Q)),t.hmac=new $(t.keys.authentication));const a=new p(s.length+e.length-e.length%D);return a.set(s,0),ee(t,e,a,s.length,0)}flush(){const e=this;let t=new p(0);if(e.pendingInput.length){const a=e.aesCtrGladman.update(_.toBits(e.pendingInput));e.hmac.update(a),t=_.fromBits(a)}const s=f(_.fromBits(e.hmac.digest()),0,v);return{data:L(t,s),signature:s}}}function ee(n,e,t,s,a,r){const i=e.length-a;let c;for(n.pendingInput.length&&(e=L(n.pendingInput,e),t=((l,o)=>{if(o&&o>l.length){const h=l;(l=new p(o)).set(h,0)}return l})(t,i-i%D)),c=0;i-D>=c;c+=D){const l=_.toBits(f(e,c,c+D));r&&n.hmac.update(l);const o=n.aesCtrGladman.update(l);r||n.hmac.update(o),t.set(_.fromBits(o),c+s)}return n.pendingInput=f(e,c),t}async function te(n,e,t){const s=(c=>{if(x===void 0){const l=new p((c=unescape(encodeURIComponent(c))).length);for(let o=0;o<l.length;o++)l[o]=c.charCodeAt(o);return l}return new x().encode(c)})(e),a=await((c,l,o,h,d)=>U&&X&&typeof b.subtle.importKey=="function"?b.subtle.importKey("raw",l,o,!1,d):T.importKey(l))(0,s,ue,0,fe),r=await(async(c,l,o)=>U&&X&&typeof b.subtle.deriveBits=="function"?await b.subtle.deriveBits(c,l,o):T.pbkdf2(l,c.salt,N.iterations,o))(y.assign({salt:t},N),a,8*(2*K[n.strength]+2)),i=new p(r);n.keys={key:_.toBits(f(i,0,K[n.strength])),authentication:_.toBits(f(i,K[n.strength],2*K[n.strength])),passwordVerification:f(i,2*K[n.strength])}}function L(n,e){let t=n;return n.length+e.length&&(t=new p(n.length+e.length),t.set(n,0),t.set(e,n.length)),t}function f(n,e,t){return n.subarray(e,t)}class ye{constructor(e,t){y.assign(this,{password:e,passwordVerification:t}),ae(this,e)}append(e){const t=this;if(t.password){const s=ne(t,e.subarray(0,12));if(t.password=null,s[11]!=t.passwordVerification)throw new m(q);e=e.subarray(12)}return ne(t,e)}flush(){return{valid:!0,data:new p(0)}}}class _e{constructor(e,t){y.assign(this,{password:e,passwordVerification:t}),ae(this,e)}append(e){const t=this;let s,a;if(t.password){t.password=null;const r=b.getRandomValues(new p(12));r[11]=t.passwordVerification,s=new p(e.length+r.length),s.set(se(t,r),0),a=12}else s=new p(e.length),a=0;return s.set(se(t,e),a),s}flush(){return{data:new p(0)}}}function ne(n,e){const t=new p(e.length);for(let s=0;s<e.length;s++)t[s]=re(n)^e[s],P(n,t[s]);return t}function se(n,e){const t=new p(e.length);for(let s=0;s<e.length;s++)t[s]=re(n)^e[s],P(n,e[s]);return t}function ae(n,e){n.keys=[305419896,591751049,878082192],n.crcKey0=new R(n.keys[0]),n.crcKey2=new R(n.keys[2]);for(let t=0;t<e.length;t++)P(n,e.charCodeAt(t))}function P(n,e){n.crcKey0.append([e]),n.keys[0]=~n.crcKey0.get(),n.keys[1]=ce(n.keys[1]+ie(n.keys[0])),n.keys[1]=ce(k.imul(n.keys[1],134775813)+1),n.crcKey2.append([n.keys[1]>>>24]),n.keys[2]=~n.crcKey2.get()}function re(n){const e=2|n.keys[2];return ie(k.imul(e,1^e)>>>8)}function ie(n){return 255&n}function ce(n){return 4294967295&n}const oe="deflate",le="inflate",he="Invalid signature";class me{constructor(e,{signature:t,password:s,signed:a,compressed:r,zipCrypto:i,passwordVerification:c,encryptionStrength:l},{chunkSize:o}){const h=!!s;y.assign(this,{signature:t,encrypted:h,signed:a,compressed:r,inflate:r&&new e({chunkSize:o}),crc32:a&&new R,zipCrypto:i,decrypt:h&&i?new ye(s,c):new ge(s,a,l)})}async append(e){const t=this;return t.encrypted&&e.length&&(e=await t.decrypt.append(e)),t.compressed&&e.length&&(e=await t.inflate.append(e)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),e}async flush(){const e=this;let t,s=new p(0);if(e.encrypted){const a=e.decrypt.flush();if(!a.valid)throw new m(he);s=a.data}if((!e.encrypted||e.zipCrypto)&&e.signed){const a=new j(new p(4).buffer);if(t=e.crc32.get(),a.setUint32(0,t),e.signature!=a.getUint32(0,!1))throw new m(he)}return e.compressed&&(s=await e.inflate.append(s)||new p(0),await e.inflate.flush()),{data:s,signature:t}}}class be{constructor(e,{encrypted:t,signed:s,compressed:a,level:r,zipCrypto:i,password:c,passwordVerification:l,encryptionStrength:o},{chunkSize:h}){y.assign(this,{encrypted:t,signed:s,compressed:a,deflate:a&&new e({level:r||5,chunkSize:h}),crc32:s&&new R,zipCrypto:i,encrypt:t&&i?new _e(c,l):new we(c,o)})}async append(e){const t=this;let s=e;return t.compressed&&e.length&&(s=await t.deflate.append(e)),t.encrypted&&s.length&&(s=await t.encrypt.append(s)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),s}async flush(){const e=this;let t,s=new p(0);if(e.compressed&&(s=await e.deflate.flush()||new p(0)),e.encrypted){s=await e.encrypt.append(s);const a=e.encrypt.flush();t=a.signature;const r=new p(s.length+a.data.length);r.set(s,0),r.set(a.data,s.length),s=r}return e.encrypted&&!e.zipCrypto||!e.signed||(t=e.crc32.get()),{data:s,signature:t}}}const ke={init(n){n.scripts&&n.scripts.length&&importScripts.apply(void 0,n.scripts);const e=n.options;let t;self.initCodec&&self.initCodec(),e.codecType.startsWith(oe)?t=self.Deflate:e.codecType.startsWith(le)&&(t=self.Inflate),E=((s,a,r)=>a.codecType.startsWith(oe)?new be(s,a,r):a.codecType.startsWith(le)?new me(s,a,r):void 0)(t,e,n.config)},append:async n=>({data:await E.append(n.data)}),flush:()=>E.flush()};let E;function pe(n,e,t){return class{constructor(a){const r=this;r.codec=new n(y.assign({},e,a)),t(r.codec,i=>{if(r.pendingData){const c=r.pendingData;r.pendingData=new p(c.length+i.length),r.pendingData.set(c,0),r.pendingData.set(i,c.length)}else r.pendingData=new p(i)})}append(a){return this.codec.push(a),s(this)}flush(){return this.codec.push(new p(0),!0),s(this)}};function s(a){if(a.pendingData){const r=a.pendingData;return a.pendingData=null,r}return new p(0)}}addEventListener("message",async n=>{const e=n.data,t=e.type,s=ke[t];if(s)try{e.data&&(e.data=new p(e.data));const a=await s(e)||{};if(a.type=t,a.data)try{a.data=a.data.buffer,A(a,[a.data])}catch{A(a)}else A(a)}catch(a){A({type:t,error:{message:a.message,stack:a.stack}})}}),self.initCodec=()=>{const{Deflate:n,Inflate:e}=((t,s={},a)=>({Deflate:pe(t.Deflate,s.deflate,a),Inflate:pe(t.Inflate,s.inflate,a)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},(t,s)=>t.onData=s);self.Deflate=n,self.Inflate=e}})(); diff --git a/public/lib/Cesium/ThirdParty/draco_decoder.wasm b/public/lib/Cesium/ThirdParty/draco_decoder.wasm index 5d31f0b41189ee768f6ba8fe7be581eaa95f695c..e5a5e06eb51fb061a94a9682cc7e338038fae25c 100644 GIT binary patch literal 285747 zcmeFa3!q+CS?9gh+VAze=Ok}2(=YTyy5HA`skB2rh@oGHp=XEECbXp;DNtt0n1l*= zP76694aF}_4$zhY6;WYE9LA|Pia-?wl^GeWBMLe?c1DYJ1|?olRFtZysMvnL|MRT< zUQSMKO}Kn&FK6#}?R9z9b6?N8g*~slIffA8TjROA<B@n|cRHfK@krQR9I;mt!tMs| zN>^Ig9e8Ug#nS8>iD7rsl0yBhPOx%^kHo`P`EC3?T<77XZG}`Vl^@P+#6yDSw)CWS z+!ObN8UF4KE&jeZH2HgDnB(s^0{5Qy68rno&?@d|ysnW#QOv|x%%n!E6=wLALW(5M zv|5cuH?*1!CB;NiNJY_Wq;`yrMk~ZtOfj{nr&WZa+fZU`h0ty^LTYqdR2SOq)U<zM z|D4!Lt!_6`dngir8X**|MrgE(M!Qi^c~r|OG^iE;8j*jR0mx#}04%R3G`p=>JT6jz zw&o&m02B>VX`_g--EPtZ6pGYbd_~V{fnE)Oihvr()9n`gr4dp9M;PFze((>!BER`5 zGKbmOUXT1UMO?S82msegp-n6GKe0{ovC%Q;g8mjwRnQc`e2c{fS_5M-t~Ug>!Abj{ zt#7Mx{sBSlR-3l@hu(r``lG+JC9H=)gNc6xsX*kfvZ{kgU81d`(@7wzlL9ZK@gfkE z?5R}K(f>-&f9j<r@Rxoz+Hqg}*5X@>CUCB#m6g=$z)aOWZ*2D3?`gd)#+OmiH-#UJ zagqE>;oD-oDZHtOH-|SC@#XsYitvUa?hC&i<8rvGi2K9qi}*@?I1uhE;w|AVF&+$e z6!BHz_9EUIo*G{rURT6#4zDd@6<$-s9bu)2&kT>Icv*OSd{%fQ#mmDdV!R?eCGHG= zpW?3Y`4pcWUK+0qf0yD_`gS$no<qtt;crvCHvCqM|4QwAJxR|Ef0N>M;d3cIPwCHB z`U^<EKKylxFART~;=dNG-w-~V;^y!dDec)4{ye3<d%`8@#e2e^rF7$-@U1a@<DT&U zq?ai5rF+7|DZOk@_|2HUNvVrUUD^{qlhRF=db3hruGClT34fZ>zCGdp#I&r`{Yri1 zp719r9kA3}lzLF9ui6v-cTBfhYp+)7H!HQW)E$=kOr>77Cww}kXYC1poYLic!XKq{ z#h&noDec@7K9$n0J>d^hdiI|1`zc+yCwwxctM-K7OX=!8;dfJd&Yti)DP6NC{B}y$ z?g>Xz`d53xCsO+QJ>j=fdM?1Hblslt@syqia49{X##4I1p70wfUB4$hl+p|LgkMkT zU+)PYOX(Z-ga=dFyeIq`Slb&OifQlO@V`=e@!s%1LEGN&KuX`ZH~dOUFR`yL-5dS~ zh}#=}Ii+vf8-6LJ#l7Lbr?j*;{358^8-5|BoA-u~ru6c?;U(!6d&3LUzP;fa)AHVM zcTD@0_(~-nP~t6?cyMp{^_X6@H+&4#DZ{Ik;hUAA(%TNbJ=3yYW?7$QSufukJ_6$Q zhMxm*d&7r8+}`lBAZ~B?Zy;`O_!$tlH{1{6_J*GZajNSY)qm~Y@Kc~|Z}_jEZEyGx zXxkh93uxOLUKi8z_J($P{@(Bdsr&k73{~vCx%lz;#3$VFhQ`kp-%<Qz{GN2^yNWy0 z-xW{%vEoOIbAP}1_2PdNe;@BJ{xaT~-dFr;+V)rJ<MHRyPo^JBPu+B1`nh=Seet`~ z52t(5e@fq({(X8+{Ez7!=|Aw{yVBd!Thh0tf0y2t-kjc=z9W5m`nL4O^ak>LOS(I~ zE50eczHwLM_Qs3OeaiJ0-5WPubncyvI~v=zz37JPU)OkT<28-fr|VZ5j~0&<e_y;a z{=esL`sU9Ue_Q-b@wwuTq+hqEzb^i&_{-u2uS@4{dTn}5`fTyUCp_<|&)@c<bFcr4 zLe>0v@n^-u1=W0}_|xJ~icjZi{<!#~;tz{YjjH*B;*-VijjQ=xtLD0GFS_X5-zfy} zZx^2^juyXJ-0)k)$BX|{yx=Lfp1bK)=icyW{NLW-L&e967bxw~_@I}4;u9`9S6%vz z;@65_E&f+s<el-6_&>eOuN1%RWgdyY<YjV^2a5k*e7N{;#V-~gEq<Z+Nb&Q<&lNva zY&-YdpDx~l<~#SIO`HC6@xkIl#eXgSOYsxMj~5>(ezN$J_(R3_$M1{Z8^0&Mzc}|P z-x)t0?;EB3h^72-eD5gbhb`qV;(LnE#&;J#SiH0Nf#Um%?<?*tzPET+@jb;o#djC~ zv3N)EABz7}yuJ9&;@=nlu6SGVw)h9}tpNM&#kUpPE;{#Z@mq>FTjJfte@-7vKaqYs zz4!y^m*X$R_op9CKawtbUwYybej)xsd~bSZdRKZ+dcwWw2h+RL6TUA!;d|2)zCRs) z%HhK^fAM4e*EQZS8{0?HLK&Vl7s^m|mWGK(V`)nY!&u$AJPeD2Cf{Qfm&p;UV)<Ef zu}o#M9AvLPcxU8&7pZ(-9E9pamQbcE8Y=f_yqYK3JHv*`AEe&mK=r_#aq;r=%7(to z4vWhh3)Q>sjQXF-s>5Y`)$;ZfW{VzKitTB(EXv0A)R|2^mDo6F0hB>8JB(_`8Ys%B ztWhO8v$3Z<)rQ4kL%<fmpQ`@&R}}`4OvOUk7_`d*xF)kkvJQZFOX{m=uWVNVh<arU z1gPRIY16P#r32MNcg4kFK@(-78vqIrpkgjo@1;ll?>%aadeo}=)rPV~&6Jp5%=w=+ zN8e)E+MYJ5a#|Js)Rn&1xzW15VOWR)_F+T*KrhPXmedexm#gB6xlq0D&R7cGvI)`; zgG(?CW#fLm0qLTBT~C!|^BORdi$};C=v}PR^0T1H{Z7lK=)-%NsIvM1-Qs`sI4lmW zm2urE)BlROLO>YOlw>dKdo_1hjU;=G%E<p~*Ek8Sc#=j34x{rHpdW{~_;Lc?0^QTR z<ydsyY6>Hnx2%DpX7uwM>C<f1oZ_A4*<mwvlD3awGvV%JY)0oM*sM9pW^^;N8I`Ze zW~3XN!Nuagn$5&4$FLAG<pO^N3}15{e04&;>rsyrFF;UJ27{Q6Wbq#sRU|`k@W3z_ z7orv5*#h1LA~8Fh(&-HZ9t_zLKTGbDi$6e;2&<is{L;>&kG7?PLiI%c?;L#TFfJWL zox$Vrz*6-Lq+A_CyKE}cj_@?ZZ6wx%c3RNCS&9v?#(^PHf;=GE0N_xyjgP6Ojra<} zP(7Y%;=!dV@I3#D`2zschQS9Bg%hPO8pg|)&(U`El?Mk=`IQR=QZ<$rhi$ls0>fz9 zM-8AaL=P!~y2t9j+M~YCFyo=n#}0%659ksV5psl;UiDE#jsK~*ic7;#9Vx>+c<uGJ z#mKubKQHkD%FusZr1e;R=NpxO7^RTTnF+Ml>jzX}?5#9nafFsu8rKNL;3M^0Wq|&` zvN$M`CB9N-qp_eL{#J%T64Z&*`kf@&goYP|a7m!53Tr}rJg_pg-6?i~4Jr1bI<$=b zy&ua%Q{Zl4aoD_aE_fY)D`ufK@a)P@JY#54+HB?*1i;Zs+6HmDmDuQbBW;s$g-Vp$ zQ|VtfZ%>>3ZOitw#osR6o-Xvat=rR9f7`Y_ZS%K_x2KE!?djXo)9Km5lJ#ss=C*mY zdc^0(HFI$adf31*&;SEvLp?WASB+g0Xaf_CrD5aBiKJDSG@Qmu0>~70(<K4+(OYpz zFlL)<rG}=UjpNg!l#v1I&|_4T2t+`UWIjYmL!kuq*hDzYe?mWz38JcPdmuSgkv|tz z8f9#cG8Wdex`M8yS5&eDGYmnAKz}qYSFd^P?VX#3W_02Fvaw{GA*N|itJt7XS!oK0 z0qlV}#M|-DshS;Se7u^m92@<Sm0z~O$WhfF727a++c<jLR97YFm#dBYhfpU~rRt6M z?Rd?~%1Zz6ph@K-E*Oqw^J&FKfAsy)@dpK}(rHtwj`Lw}!+AGUcX#_MNbTE;)IL%i z{;B{}!^Y;2sPBTJKkVw!d7<MRVJN%zE}C4)Y<Z3y@z8MQX+>W}o*bW8y`~{8sba%k z+1=4RH0(YX-3050a^~K}Edc?gaF-%*VI_4ni|^9^d^CTARtMhd0K1BW4KP9JzTr$s zZMQuSNKzH9ngVFpgg9vd075!~!AR0bEfgP+4m;JQrnTh|p*cyaE?uT!a(Aj03VdlD zg{8Wyv}>*?RexF<qU)qVo3O`4Ay%CO)ygAbx#UOK->X*2ML57Tk2o?~sRG<)uSn&B zmn(TfYs#;DJ}&Rq&#)hT=~bY}9{t3nSI(isKuI}s2&`0bAa@n5y%`qjeIz0n#bI)y ziu$w^q(keL&_DFVu-($5KWy%392z#BD>f0zn`4wWsNAJXdQh0WZ`dqbWh0|C>t6bQ zuz!x#Iq*7V*~nHl52;$U?{zosT|`fJ&jWTf&3Cmh1t{=&e~R9x5~dkoDSWx0;|1YH z%!G1GsFMlh((jtyk5czi{a!}8O0H}e6msXs7NC$bPbxBi>M*+pj;B@s5<G_*kuFis zrT?f^u6%<8*HF)zYYHSWkCYAoCg*ji;HAVQ1&WQ9lu-f+=aLPKn3<>w7cJmOIg`~k zSyxi?;_137TFT|KqDJ5`dAWg!D%CETbLZ3@a*fR!&}6xOGA6ic^j9K$_Kv?c&_eau zzsfIn)hVC*>rk!h$I!cDeVjdl?4uo8lKn*g<kH3J!IbSWZ%f90Haq~{f!rklY^>-d zI>V@fvo>ObOmMX^D<Wx@2Ca&nTB_15z+N4`nNbf4m^5&>G>rXq4E!W{s+xigR2u?C zHB}@F1>-GxUOtb(M*ra~Ah2?>hDE<KWbCzw>S&X42)CzUUIR5dv#9~n2Qz>Q*h|A6 zY%Va`%fnf@4-Ff|RWOoXK{Z83bcG;5>2}olsGN1n)hK5~hF-M^%{*1g%A3<*Z{{@E zn>h{kW=?~>nbTlz<}}!wI}K9ZYP(znyS2G2yK+2WOh=Zr667=@@G_sxep?vqNRt#L zO@mNNpbJ@Z>9a=ZM$jenWV&UDpR3UdT9BR(n@jkP=@yX==@C&|)#uOet0QSa|CWq~ zRZFyDPIZw>USxy1c~FZy3K`U6NFP>{o^Hsjsx*VM<B%TJ>7=JsV<00v1nNNgV5AR& z2Ec*CY0`I<DALc2N#AqNQKJD!PqQZ^J)Sj;Rra#eQg$`8pZVgDzTu4;HD|$6MixRX zl{Za#QAJ9-q3D27->}*lQNO?5mC%Twut%%vEcV}Pv?K!XPa<CY|6aryLE&352tj|g zr95$HP@dhf1hvX;tv+$0I#_x0dEh1jOSn=}uBMV_P4Z29Hp(uni1!qpEtMcv9I129 z>l(Y`>YC6Lnm5aAB0n)9SJ=kERvur?TU2OI%G-vTS&5;IrC&N|!N#B|eKsR~MnPF0 zxEpU5F+|+aKxkm`aW<Y}XIF6&9tpz+LUf9lp)GjKqPZm@_|Zwiuh(p}Xbm;$4cRc* zlq~`!!ISEh8dPtxRa8}`foBDodV^<cI#VxYWVErUu8|$vFCCrwZ3S0K+`RQY3FIf4 zRXjp&fq|CcffALq%$`w0Bjn)t3;h{XBw+WD|MhZate-fB*l?-xw%Jn0I~rW!i$|f9 z46Wh`LsPV6XV*N``@CWs*UVd_uo#ny;naaXxKYe99l)op8;|`NVN0%d+3K&uiBwj) zW<G&iZG9H@lB@?krHj2_-Fz_O2TqJM1bfvp2SJwSqJV!*SS9Vh1d?I3l<;U+=9f%M zsy-uVahU-eLeoOkyT(w{U##{mQw0VZ2cAdo^7&>pgZHr5-)m!u^T^Jaq9gvIX2Z1g zmuR5I8iu9zG6ACOf^__APLR_r{)4Gh=M_L8C!MY_fc>cyTM!6J51S$Y!e=e%5#;7N z9gVzrHspfMg}~CXcdncVk8uh9#KjTgh^5>8b?3?V?%1##hCmjuqt58K15~Y^j64$? z&ZgQt!JF`g`dqf5j@}zo%x`{_4fzNfRM1z&t9Zv<NDIIdb`tt^jsckmVMe+Ctt;n2 z>WEotMiC-K|6v15oDmDBjo1OPJYq;|VtWw*Np0wNjeQGeU$Mrk6#;_S2of+D?iiPA ztg0VKLOtvQ_w`7N?z@u?2091!o9x1*#gYc}L*b=!@FuWq1AKSZ`MS6S#OcbR0#@|B z=fmK;7zQ_pTlH>Eg$E)+r9e=bG^%RpVFO_~g=Ncz!3Y8LV*spS5BzvPln*=UE!Eh- zp#OhqOxqOunv-9(59~*&(rI#-Z`ON_q#-TPWd;=4+1{_=Ml1{qbb<!2&<GmD4I*{( z04g~$j3Gt?4x53{=u-XFqoMF_9v%oFD<ss-MaCcE<Hi!v&CvU1ASi<vV@tZ;T7W68 zFD*<b7M2LZc2aw$v!WCic`vg_9sq7nI~l-x;zC^kWmFE}#}$AtW%Ine^}a3`?-h_i zoS1**F=Xj{xl!N#MSP+jmxRp_>^mYEt0Q%Oc-a`3{1t(rP5x_xKW6>0#UES!aj`!Z z{Be~(uJgwYFo$rgPFb}t^J;JOU;F%Vt3Otthh*ojDBcOZ&qOH!=T|*C5@bjR77SXE z%_UI;R}OQt5g#-*G^z(SV~uU{C+S1}P}XDlYrtotVGyR#lr{X<gIA@mrCsWFZA3Yt zIruFN={%HSlUnidqlA4zpG#Mm@k6828?5q#GH-z_621xHrAM0V%fo50AfsSoKucBK zuyllJjgKWq!=gI!O8TVG+tPBi!t++m94TX>6iiDE)MS8x>m>>610J*blSHE<I|7kF zF@8T_5J?Jp7zJpfd0^PgHk2%~A`RDj4QN*cU_{}8LL~JOnaQiAu&Neb3ZKqjtadNU z#Ffn}F(=ZB?Oy*GMmw|lniUjral?(q($b0~Nc*Zz!yl|*iLyS@I+l(NmLpJ@OjON- zs*cJANH={3*Rd*1C7{j#2x~lpHHg5Y5DMM1M6{_DtBzEq;9Xuis2L7*b5!1QP8Fxn z@rpwf&6?IhC^y~T)rg&ucVd7xMpi8Ws(Qkhn>HCyx6BiR!!mA+0U5f8#qpY)(c}m! zdWoS!rMtaZt`xY1{1at!EgI%{eezxWO#>l+Q()EK6lwK0g<kz_6J2EhjmoQeTqe-` zCYT!_hiw}c%4`E-({0;?6qbC?rVs@#R-ne(6q;Dn<`6j&r8<Ky0ZaTlNn)$U3+8va zZ<2)(UNUg*A|HbnIAOYM?%UbKi^3-}{dEKJmN^N=#$pwjvFziu;mr1w7PyS>B=Q$j z_P@$s8ocm()6h6s(?+G~iZWgp=4B@r^to@$&!67EnW|)SUCCyv1erieHH%_~N+Dy& z*6%ADFKSDA=y-L%X?>%4B;A${*$jiE&W*0r#q__bZ4>Oct`}k|8qHR_)18^c-dz+n z;s+)3EQ|$q&8y4e9ch3vTu@+LE-1DTo<Dr(UYTmrSrP!zaOAF;n}Zu$tXaS_*c!6l zLBTPHDyhI-^cHg6NC7q)PP=B#OtlKaDb_xQdv@k*fF$wBApPH`1=0)!iJVS@1jC;> zmekn{(o<r_5;K4&$5MAKkUD1rBy~1}^wiS=NqXuSEXhqeV_s5cGf3M~#*$gplkrk} zEs$Dg10;1egY<Q$1(HV)R`C*p&NIi7I-5bdpvYM2oC+`5wAyO+X6Se3Afej<WjMDZ zJa<kVckt%i3ppj&r0$PlDjT=01)Z!i=_T_bs}$5Qj+9pen=BoMJ%0`vQCy46{Ftg4 zuw2PPqOGsxd-qL)nX>!L5W+X?X12uMKJg;GmE9Y7%<yUD$iLxDegGs*hb=99!;8?B z-5<gy*`Y{~{d1(}y+-)~ii-rn`?9@jo*8T~!#I(VuN2{|#WGQajOvf=eA1xxgq<%= zwex_zX6K&-&3bPi%$B{&=sf=%edbHR)acjGzF5D?-d-NFIm^RG_V8<rh&uh~GhYlc zdha_uWOT;Ju*Ga3g8=)n$WZv|jMa<KoCW9f>;i7;F(7GyO;N#yFoZl%MoNs~e%Rbe z%x7my+6}K2FUP-{y-8C7MOEBHxa5GQ)doy8h)-t~0$@E+10RlujjJpa&Y*+>HmCxj zWVY|-&oPL(g<z+Q>uP__LSQotbXw)iR0ynv>z{KA!E)dF9UE1__~y$sd^)8e&rLe7 z?ZFs+6Il}|IEnzSp@2S`8Amd#DvOCURRM-w4i*tZctOq-L-IO6<_?K^y+)TAhEI2S zb%)Kz9(94phek9Ig)k28DF1ek-(gXG)Zs4fx|~;>9<^y57R#MlhqLReu?}Iv$qq{; zsmI<y(H31nL;B6+7tCRA(2dCTIBfX&b*ZI|Cs6o{>An$}Kz$Cng}k^<?ZpXP+}QA= zL#ez+cDxM&cjqq#_#ALKz8$V2A-)N}j;hX<U$+`ockc{V#*^<iSdTpOF~RB%-zr$o z#Nk^FtNVQh>pzc<*GC?`d=l1^c!6WQx+k~_)-&-0SHtQKp~3p(=y-kf$Q6$XR(BCs z!Fnbx;%ZpkQ#4r7O3trg>su%I^(21d7_aU-u7dSUe8<(Wx(ivu>ioL$<i`Z7JC&<o zJrk#LHLUJi8mu^UA28Vp<s_^p@#e;Ob#HSOtY_kFu7=ee%^KDpGgw#7e@w8t_qhsI zEysDRK1ZiktipmtOUj6=>8kXUS=0T(RbXjZ&>4fJ4rj1%0)O1$I%U$ji?#}`GjY*I z=yDg0n&om|DwjN1r1W%+kb7*?5RN^z9CB>;zPmwS+k>se<{%HHjM+nBYRZ0NzB_nY z1Y3#OvRY@Tm8LTOgez<o$0MRmB9xk3MH>-PDh^r{EiN-GQ^d0Hz-%!Qm{m{HI568% zU{-Nu56ni|O1mZlvpD<moM={&c56uMB;`y-z)s8~F&`T8%3+0FHP*2}D`2|^q**r& zL73HQX~4*$$>ltap%9maTGP@&V)leeRY<;SX)}kKv{YMCHlqnToKo{_0F2fw-NI|| zR)(=tr(1Z~((#<+D=FY!HZ+ms6EO}z$&L{Pe3{Rc$3#C_**iZBO9z*8_*Q947F?AW zDVR%F<;QtfD~ie4Q%IROH9=*Cl%pk1g_K!#PDnXdDjLCP04-YO*-vKg&gP`q*Pe9J z?10vo`=W0!ssLf*a$hs34JMISB@GotH<}wm6#N?c2Bk9Mm!o*d5TPz#qP~dEHsw(0 z0Uy~)MJ<)(rS~<yupQ67Pl9Ny#lk{74}4f0c};BjM9}YaVq<c0!t(^@?f`egE-bbs zB<=5d1dU`!N}i;LB@wt@owW7XBrO78Rq%muY__9oq&>Vw+6u#_)%Cq)jkJ5#NPFKJ zY4@*@_P`oxN7qPuc#X6b)@U9B-x_K6tdaJ<HPY^1Bkh4T(vGf?_V5~ME5#b{t&w)m z8fouaBkle*(jHhN?dTe550f^{XU2hVfp^7YZ}Vrmho>0yefjsh^78{Z{loe9hw}5I zIsKvh`+@xX_ww(L>-T3Hi?-_5#3K*G=c0zXK6Co1T<BrxAQ~qU1x!V#%p4$F(!pBZ z$rw@<Dn7sj&Gtkq2_06Tz#MF9ux_bFsoSG^=8~3Hmn7r3q;h^*^K?0<RB4^j_P%%v z4A>;=5%b38x1Ov^e}@Onv?!V4`fM|KQ{6DNpmOvg*6Sk_V)IVm@zMv@(`XB$S^z86 zN>fpgQT@UkC9HWf1*Uchp*#}NF;YY;O<%f$SvBK#d($>EqTnK15{8-r8*1SP%ORFL z>cH9$meLFXLjek}V<3M?{kR>Qt?$(QS>i1eEb5v+$I3vDcbt07pKXk4{v5c?HGhhl zsF}_i{_EufAD>7*O0O+<_0h&+|3WbHf&9Ej&)#p;lkH(>3f`OwR!(Ut5e@>q_Gp48 zoWb5&tE8HW4i(2lheoTU<mD6bn2MMbHan~kChL#ExQwWWh#(<9;LeH0#Z6ix1*-MU zR-BM6`zGo=EG>ZP={VT&=4i%72-=da8e{6(8Y2t7wYJ9KWjTFI+B(j>ZIrlioVaO} zI6F>c^-3m-@6Ix+)Y#`suWbgek)NA-MF_oDB_`8s*1wt=t&=IH*U1$3E)pft^18Cf z>tveu4Ty;n7$&NwIY1=c*UEgImJ1X+9u2Rv82OI&owu7uxZ~0II)#d>XiHkps;ja6 zq^`y*AOwEz3Vv2oj<0&6?I$d~xWA!I6xyK3Y9pm<ig<-5e|8Pyyrep^z8E=_tGkl= zyX>2?JsN%Cj>;GPUF>t@`{L%%yFb}9yLlHl)SynT%z#y4Bx%vTzTnIvC-N@Qi(+>i zS8*2ejHV_$M5)lTmVY|uTXu!`tJ#}9DjKSfz5Bs;N6m6Ss2956UlZFgG$F~qT62;r zzCIXOAednN<fX*=Y<RjUv%VIR61^Ro<^@Uz#8ydC4PdAvwjfg2kXC}n^cah&`YGu7 zK)<{@qeahh(Wzgl=1Xf>X5uZqCT%vBo#BM&9EY7ZlBJqO9gjRQvpk{qtJ-Xn4kuvT zk``D5SIY9pAhC1C&6E8?W|hd&B(lNJ{N7F>U(O*4Nu-el^~W@xSq5cB-Sf~4^DtF2 zT4|Ed3)NfxC};@Ltd5{}8MNN?-XZdL-{Jo6vBy(VVlBxC@@7lYp2ngn)}(C&vFe2; zpG$W5Y~jI1FuADcmTU3Sdv8iwR~i(sZl#4pWnv%mgoS<R!V;U_u(%(A9H#lqasq#z zuC+A%Lm@iJ@>u}~AC$>5H|(`6t{k@KhaG{*oIEY{7t6*xoZaa&XU^s(c89XFwJdhc zON1k^HF8_L0~ZNtUTD)oAHKI(xKEQn$1++qNT)M&yb9e^WhTwU1NEgQ6Kh#%u&Lct z<Y0-Y_Sv9jo}(1{LDk1wWLq4w$hKhDaDV0mi)@RjMYa+{i?ze$r7f~e(~E3Br-egP zi)@pd4`xO3BHLoL$d<;}T4c+Nni~+!Qn{=k_aG0{PaBYrbYoX~i!D8EsV%SxZ92Fw zWz;@>Tk-_q;X{UnvVw9^0EDf_Vw{bvAwwoMh;Dg>Geap)ob@cW-$I<E!LfkR%2g(E zMk9J4a|jX}+1lE*tcgY*vurJ~P0Y+l@RL=etd7QRQa=>e);$yf3(%1j<}H?ZiA%3! z>*GAiR9UpM+Tm7)!8P-;tO6J2vCqt1ji9i-AT5pGS!wG_BH2HP!lW+zKDZ9<#H-U_ znxF*}w9Jw4|IYbgi@`J-V>HB9_@L})WiXs2Nn%O`25&7+wWM-v$%W6V@@C1Af)tl( z377PhtqbzVLK8x0Ly|$_ZiChX*YE%eo6GrbO|$aa#MD}sNo0wU?<dAt)5dI+rFI;% zCrCTHi73qS0EL=6!};Tzmf?U%p5$PfMP@)4M>q(EC}|ez^61#MEy~Go<#cOOWMY=r z&;@uZ0okA@Q3?Z>9hyvY32Wd_tC>3r8kEHWi$~Omjv!i-VPJNd5}2r^1N_D~EgjU~ zUGs)wbVbRGr$P@JWUD`2NIj;iZxf>-EoZll2smmra19SvP%mI^q9R)m=Qx>Vks2t3 zbW0EjMFuvYr#Nn-^b}j?JJuiKF?8%XU_l&U6F|bx(Az1ywqhK6N{Jd|>Tv@FBuo>M zqim^Z6v9+HRD9``a1iwi2(}>-V^HOmX1iPK-q?&Che(vIXB$6Kt1*T1Er2$SN5??G zfs$qLMvsIyc>$~OrrsO((L2y#Zq^umI@dsq$3ndtaiW3vj;A`Kg^v7WNga}nUXf}* z#NjT<hba)u07yWcSUTI=q#sZvSP*qIr!(ItH9|T&mlf<XKeTNXyG8%NSy*;xUOs*H z$yg~mP4YuIX%U+r{gN#^>}X$r1`Il<!NwG|9nru8?q>e_AUvmmNSj56-O-{$n>h9& zvLjmZi~43+7;-3mIBddAwivT(E-2<4LQUweJVmL^Jg}c(rKxovQ&{<eE;`HvK~#K9 zsSN_)!l%+Ru=;2KvU}V*nJu8lO{ECY%M#KlAMlegvfgjOcuirz>tHSTjxDXmWF+Vb zLUw{A9+w$6u)O>_3ZdGKDxi-H`g0iuOLVf+5n}aWb}m|`yC2uTH1o5|5F<i(7;(*m zy`4yjx2{H@qngyNL;+*XR>)2v`(PmgM*gS;seAQHbIBM*l`$Y?C)tnb=%9k$eFcuJ zx{2J(sz>H}jowQJR(1N;iT8!2aXK-=@ehK7;~zu?$3IpyNUQ65%jA!HCV#wd^2hy? zKOUI;adh&>!;?Q41WmLv`Qx6+A4KrR+3uhGLCkLa<>=%OqIBagE5*c*w@m)HXYvP; zxN({LCw~xo8-F=E`GaWN_{$2;EqEK?h^F2hwnZrTI6_W)3g(%4Y|I8@TKOcx&)!sr zi!6#IZV+P;H5%J>R)>f!!muT`rodbB5tSbM80IZ902N!Bw#S{@$?~Z-8*m1iL?XM{ zDuY7Gg@F#*9q)!_IwoYTK_a8^UuH*5B%t;&mwC5<a!a+dbmy4W)p<xZ-I4--4;G`? zxI9C^mZh3Pi!t)B$iVRkKFZM&VgbI@LwyW(lx3SIUgp1^?vI_Gc)kC+)_>jTzi!~y zXTymDlP~iU`{=J>D$$aH5W=W1ox_rlgWA9YNI@Chi1y;wC@8tl8>BL+s@=*7qA8@5 zy3oFfLdtfNOsr=^NsY1*8m;R#4^TQIha)x0+~Lfi(V|)C9F9zr;9EFSlV_9RNPdg4 zXm}zV=`GOJN}@keznC>U0%ojJ9gh6$C>-fS)&e8XP;E=PJ)VBha3xA)KoQ|cST0AW zhy>I6sN!2szup6*YHuCY`m%8#>?VZOBcC^n6L;st>Z8HKklXxGDhT=Or^3u)QXC>t z0tVJEA_sbG_Cy$1zX);aaj_@D!1}e|kE=WpUQ^<A{tG73FW9R3+)3E^CNFW|<m_xr zn%VhfW0o`M4|s!ACO$=)YCcs;&CYmNHJ@5GM5xa8Wx&q2pCUW|UCqw0?-bYF6;Ge- zZXdJrU1N5>b-Ln1r(f@_BX&MCVrMJ|LSkBV--w-ej}vdK+4+|;J74VVyxAXparG?4 zp<3wwP&%*o_3RI<9{M{ZnQ$6x)Lztyjx5It2~_~8$$a&^ypK!qKMvSd)xIXIdn)B& zI_6}nqn{5I$67Jo?rkLbq7bT5=XvF(ZjY=DJ)85$&pv5z_vcS_&o13o^g>SGu#Kt& zH@3^}mZ3(v^@>Qjie@Qot)$d5MuDJ)JFs~dFRr?KyEu9|dk!dQRzOwP{w}&tTXutn z@_PC5-Mh=l&3P`s{Od3}2TIJrzFGa@guopg4iHM`iLvN;$>hKVzU#zt_4!QT68l<V zW{vxPm+IgOc#eIYSyz@I#EN^J_u`9a^eD|@O%=D@i}yl+wbxr9C;D;K?$Rw(N2p|z z*D6J<A>jI_73f{%Mp5grl^M3P$&JrBDL3BT;}EWNo0)M%`hDJ1e5Z9FX`yU>llJy2 zoTT#sn)XsQ_gPF;2(?|CybN{zkfLT++b&}B5lLb^sk$4(77Qq_P|;_i9Q$~MyRMic zHp_QHI^w{}PE8d@GoB=N)X_0{j4N~f@+(QU?M-z9IF5A#5)a}ZSFn$Hx=yIuw=kok zHT<XXm+Yd2D&&D!I17J6iF6tcvKTMNNG-m9$TEwsWfVu-?|<vRMdeh<!g~ZrfMvM~ zSMXBo+OMAn_77X^Yo0B8Z~K;E@0lU2T=Sw*&k%NV;#1lCLE|*y-WV>XIfg}L=Th-g zbxAK313%5Ce?L=C5^kM80Uf}-wv&nkbWbg^XPwXyF|qd>fG2K|F?PdfOW+5ZR+<VD zwW`u0oi8OK2AOxw%hPPpwu7kEJ>DXu84$ShV18N<K*OnMfa0_k4X_bx5bPGRF%4o< zzvMutP=`hYw(Z;o291JF%Qxf%HfZB9ReL4y(AYoyyR+)|Z2dc{v%G;LPvNxL7_5jr zEf`PP0NH3Pd@G&`&7}Tvelo%2I?sz)YYVp;`pdS-z%KZ^$)-A}z+;~lTUo6Z`N(}0 zqcR~w3{HYj&@e$1V}B73{@gcciJEY~jh~#@w&rWbyFXO8Q;g7+3Pxdp$=0ALy5L;% zEsvLY;}j_V<|G5f5^|)>HrGIH+sLA?beG_-6{q^V0hr$njyBU#Ah|aX2Ua9Xi`-53 z3J~;dz`Atnf<+v=#JG>w6@qhtrcMWL^^>LQ6FsNjRAc8DD`X^Oy66q<U`_<7v+QVO z?nizArx2+YV#Lx?#;b-L(<J#kWeYSLl}8&V&>2z%0ISALy+BF4Nbx{n9hSfk8!o10 zgLC544osvqhdlP_bOme57|lOh1;V;=(t_};OwuiAAWX(3p;6MHK5<M*L$Q@8YlBVj zfVZMR$vhlJynIVb{d3eZZwmdWZ4IuduJ7HY9I9McOA6l9voCr1fK~3hrt^ple%D+n zU8in43x@zLN>S%;Np=(>Lz*YIndqa(gyfXdnmG(SY&<_YYsTZL?_HN>k2La0kKN57 zE%?8Jv2jt@jI1z`b!31D$Y!t8X@cwZ-gzDbaJ^8jvqJ@SXb%dx#B`d~rcf0%53G=f zoqU1(%nsUyh}=qBQ7X<Ik#x%z8F7UeHUM48zA-`Z<hXg5IL`wc&^frD04;}6zgA{1 zfdOlQb6>25jwU2JgS09UgeV%JZ%mKRY05Y)4Ky1<^;?Kt@VHPmkc`Njo16f`m}7== zTT~LbMOVuUI65zmd2@@IHbyhxdET7V1DGbQBAR8syfvCH_cI!DU<ctD&zEybkj<B~ zG+Pkh8;a9gWv@DLvp&#pkA2u8CKW41C&S82ID`Z}?f6)s(?-WxdusQ*>;vS(iwga# z&eIMfF%Gnq=p;kJnmG28J0)mT&?F<Gp*_z$N(jP{>r5@c-<nM7NcE;Hb$Ifc>;ipg zaQaiipM{py;>>ay0Mm=h($I8sQTzF9T9#&jP{nA(n@}M|meha@YocCi8do5`m!y_> zgj*Op&ln0Z*cXLP^$2S)K*BP|26gxXB*cqdE@(*ZV>Fg7<JYBfNBhu@;x2PHeczQZ zq$5k2N*=NOIohHLFetpt@n%WSk&D<b*Ws=X*ZVHcbNrA^Ex?d4l<Uj>3vGMndOs%y zq>;aC=fu#3<$>&u@nSLJ#iB&}h*cr1q~G+e`oEebt%$MYtXNVg!9rvvD>6%xdSEyQ z0h;9;ELn_LvWd?(%H8F4w1k8G=^3AE0K#EtW6qp~Go>e~f6SRRpr(B`mm{?!^Q*m! z#+e+6AhVZ6(YUaXr1K|BI{ncB9LG~ZPLP@$!fVz(RIwr#R;sI#7OHgwn^UDDFbA-l z;ciXle=Uk4RXA1r-_B~rVz($Vt3qce=^SqnY@6$li(QAH1_RhoT$H1lM_Oa6v<9Y| zF`_UqI;({a@{jpD2k~U3HF}V!Ihxs-I@v`*ztI9SEUApkkU2ANQwpkSCvcfX)%nn9 z1_y*U%)!=UDPh(^js~$<{ZEf)od2iwy%Rx)tx5=LoJ-J!^R+NRd&k8DE-4cz#tZeV zm7k^}7t{_Uvx#Fc(H>!9YBwf++87g#7O<*5s!a_XI4x_)@osK^g$a$rb$T`?XBrb( zKV-W}_xhSS>v|}221|(#Ce++)=h}EzPsNM}v;H~>3vgt0Sh}jUe?BqHS1gmnn>T?y z5)!w~70IYo{(|rRbN!{k3tJ7phWI_-__9e6%Hy1&@kpCZk{wz1qk*=4cDAoMW{se4 z03_PI-XGWT0D0HaI~E$qZ-lcqxO=O}gmuM+d%&x886<*k>BE*Rw)s1V7FMes7z*=z zr#%XAJdEbqs28X4GWfgxh$L!&y%V4omh^^})8k?!0ng{cz_~3IL8-3>0_ipZvPAh} z-#p@Zq*DBvcR5PPqnv`W#V}B7jA(WfCXsb_$CT7Sf?=$RdWN*v15gyksO!-V7Pgr= z@s7g_i&^i%yqUtl!UpTTxdvMQQ0J^WXa!iGmwQja%SL%LR=3V>^~V-}lyC;Md)J98 ze>L5mge#fFW5y7fuHiByZy1i@vRO-;KoV8JWzKn8aDjW#g5z}bkVPB8#qpqDU9x6F z0UiEaJe;|Wfg*2o;(}sf*t=~wd-yiJ_e<XC=mkYtl4<?nLpUUJc#ove@e7Kb!@1jr z{lka!zOm%JTdqHR+hDF-hi&guNw=J(&^j1_3CjMf<@sN)^)NE%WLmf5($^2WcW@&3 zpljh9snkcqphqin`Zjw<ISV)w-|iT!htp?Rcxp@nThiw9=aL;ruulzgQaRn5QSsg# z)`LSk$~*beo2=&f9H6=5HS*v2r_|Br-5vk(F0?+iTa95=U2A~ye7rVmuxB-;>vU&J zZ^u{O)f;x@dV{JXh72C-q~m9v0Yy_e_Y8P2mFu1X9~6i<%P-Iz{|sG~|36n!Yd7Wa zLW~PVQKenIxAju<NVirCjan_>WVl*@#8M0PxQ+)t9BP3Mfp!)Q*Bocob5al3tT+o6 zgi`JEwy_pWT63J6+hH?H0=na}Q65=jTk5|PC~7@m2^XuTvMFI`)Oz5EOsxquDopAC zXAyOPluW4uQ~}E#)=&jgrS#(%RnSr=kT4w;l_fvA<ZIMv!~J35l5gEY21b}!)!!+} zuWK9icdK`Mi$5g!ROFpC$*;jMJ0@*=JTOepJZ3OJt_!+7B<LeBOwfsWNYMFn@vwW_ z(B6Pqf{sY{kWt?I67LzkmB`|79Wo1FOD9Uu`LlDl-UXfajV14$avg#`3yaT~pm)k1 zh2~@<boL;RYi)#&?YKcBKK~a?AF;!n&3|wXV3FTG9W84gppjUAywJ&hYvh5b@o|9> z-H2SSNEqFr{Na0fY_R^ZRof|u(m4qC5!QwQ+;zFZ^AHZ166Z?R{85Qkk5x&luK<a# zHNQ^;)_MN@7|7_S*{{{M3gl=UbAyZN^;+9%___}GCVOI_I$FN?P=Yd$Iiaja8o6^v z*|}}dnNX!Dy4iAeLfuY$yJN6U`gB5D!#HDY4c8okl~|Cd;xl&`8=AIe>^E5r+PX8X ztve%aZ8gesoUAKr{;4`(A<Hx~p{-|3TX&8)zaKG<<`;)`VGvwf&$_loY0H~fLtArX zWUKe2yo864ga-3S|JMB6mY)|B*B-#5`HabLPpoZHzJ`xN>N6%UNK6IeQ_4qV45`q8 z$1|pOzTmpmgT@@k(1J5x|BsW%Nr~_mzQfd@aVn0%($evuQ957i{?Q$|ecp2W8WAGW z%tWBP(aikDClyeveIMo4jDw(6HW_z176$M(o{lwyzpSocpwM?YAc)jWFL!=xL#M|^ z<-2^y#Wb^t9Ja+%z-R^7tlzd~lMxnYwDVEPChe|3Gc-~zipr7$HgL!@OeWiar*M_L ztuR!eR*f-~2FC_Gt$+#+cBLa~(Fn=MD`Xl3JdjyjQS?zRgG=f`eMR>GGYCSyb!dk* zr9dTZEYJq_nDZ+bQDj`{SvOI56N*_XhX)S?)Oz(}vSa3=c*ktuT6YXk*bd+zK9)Yo zB^mX};;yT@V<;9~eZ#EAI9MC&6MdWP6CoP15zjQVIR>2O*jx%o>FK^0u~lwF=(${I zGbHju_R``$+KHQbUv1k#s*gV2(5X<?XnK5eo(X3_^%u5Bf|9~)cHk{wtGNPbXZtjG z0@tzI0@4DQw&6e?8fnaeO!zog@+I#SZ%fN=ak<zx4v`u6B4j5!eH*%Kg*9A6$qWEn z1E|5`#F&456F#(SA|YnPA$-r@K(b~y^c9tk$dQ~m&7?;tZLtFDHw?)yi#}25<u-BR zQD-r$AaJr6UPM$XIEQ$7Np7LN4lHOEgWM2pRJlbh;A4tPe0#sx(8d%SCbK+^h3Lkz zlO$ljV%wHrvrZiE+}|~v9kj#>+8#x5?qTpbO@@IW0KGxvP#3@`C~9LosDTS-Tv0<q zAnMt3EK2~r>cwz|rgTzNP<yeQVQz(hfC#7KdS(>LK|3l`%m1vz&A|(HbXZ8O-U4VR zr_mIZuxE*o1W=PE4}&9u2%It5NcAWHh*Y1n$&ydU6FAKA0mOqzC2E-gQyv}=BLIL- zB4q}Gj?$&vQN>jV$)UiditWraVIL|=QPD4OA&?XgBrp(`NDX$jxY$OBhgCR=m%|R4 z$sk|SF|IcG6>ScOAQ76~@Qb`pH;X9hpx)fN3m^Dt!};rVl<!0V6-C$Ku;|UM5VJSC zLd@P8nuD>o<|RSKh<vR}g3!)e`;q`TG$Y7Q9+*I1Mf_^SoUjMiR}uA~3rU-+B)Y6K zIqre-d<Nqj<X%YguIFcBp6#Nr9_Eo(7%H|9RB(n>!YSV1kvyo45AoH{Kj<BtKF*%c z;$Y_-j-$`RBcYF?uAaTohBpf0SYS8Ns1UhCHH<b`t0eiFYSs^(?=jR%Or%3cuhnEN z^nN?a5_0d)AG??`<Qglyomt^+Nf(b3xkyeCCEB@goVazAxQ4z|FleMi3Et=8?2Qn{ zHBkoe^<t*6I-=LEJIny|A8!_|w)uYXf>acmJXdInNkw2{YL5Ny5KVMYY+&eud<1>; zWg7%KEpdxKN`GwhhcD@nCi0P{imHa4{<sz#Qqj|?8<Syf){))@(wu?DI<EIC=Wvc} zJQQ!!IkIWNk0Rsc*nfqGW6qIf(iBd5Z0E>o(Jp%9nmIWLHa66#(TJ>}%Ycm^l75D< z-hxC2FV0qrS8*UE#&QLYvOOCx!2C4~r~-2xP928s8693b!UK`08U{`ba~MwfjIhq^ z8693$(_-RuElvVEO&Hp<XLKl84TB;8nIGU(hrt$Vp9(*;W+nP(%#-qG9y1Kh*)uvs zti}UoRY$9Ou#U*y_|&VOMqsv#<kW<uF?&WQh1CGz1Wo}YU&WDhx&Rd%fNJ_?ic$<o z%Ep!R8oHot*ovk<#K5Nyq8_3fFrKm^ES1rLKvYr^mdB!N$7bU>bExG(1nL$CZ~5V1 z*X(AhOh+4r@FKmHGdJk*CQ@|1tDIN4!mOb8GhbO+<+*KX)l6PmRqF+L<e9}BWNlc= z%Y(FFLx*3Eq0zMPG0+eK&Cu{BXn54n__viy|1F6VaQ)<EAsoeh`%Lw{yy>5#m)`S^ zVK@JHxO#C}zlZP=EeY$sM^T)h>pAEi$}}DWw-|_3noMmQ++>$(g$`T`NaHpYP{~D5 zFy0SWYRjv|R@5l46U5Ix?Q}$~`r}=G2{an_?#235cK7P>_PYNZPdiD+I`?D4i|A=b z)SiHzt0Ba1&#;8>V#Uz~A&*H2$9W#U^u{Urj{AC+$ve@FQzY*+X|v&VSIDJuwM@!d zOCoJ2ju~}vZdRbDZ&0T=&km!Q;=W0~ocfBZ^GP{0=}`J7hvp3M|4$B$JD2}(92!|i z#>5uwYiQ@(*unA02u9!(J?^vX-OSl^W#^E^r>C483p0PooSZoWsQr99`rQ@T=>qh{ zbaHxc8qAhGc@*a9*xRqj(_tD`p3dwVj*im8H9E+?_b&Mfn*Y7^M83kQ`ZzTltZP#f zz@Zgxz`^5984&;GK91$WFPrpsdh&Me$J_bDDsQJYrbnw6%fos1DM9{a?&Z9lnIoBh z@9(6mbM$8>T%DQYcsh0ZX`$qF9Gn`ivGXFhPR+rYc8SLB?6|+v?#^ST?>{Ox=g}{H z+@>}u#B3DF-<jh$k?Em^yt020eb8}=X638~as))g?>tQy&W_(xBZeT3BgO+eh8PFv zOB2;Gq!86PO&HFa6O^3~CXTMOCG1*d4zD;kr|f>5wE)i~IPMKS7I4n4H>6lkQAc_N zPVZlu6rJ+<+-E=112`V%c`V?3F<l_yDO_4`Dsdiqa^g5otv1$(mz=5(R6}z*ah?p9 zJRgNUKC>`w8Efl*{5a1E;6AAbMB{awCw@udJl^F==SNYL6UBKPU$ujAf;i6!@NznC zPz~YO4LZFz&m_EG0P>#D0a}y1XD!Y{?T^LYdYmVNR!4Hi+-Gr~wZ0PP`P(m>IFI!m zC#Yt!e{}xN+}OW~r|({zor$Ysd@i5J5^b`Bamqf|+4gr<R?;Gq=U-+{4|}w~T$~<- zfRX}0Q=ZS<m(=r7_$N+!KBo)L7t`~pgFoCaCHKd|DIYm*@CTW|`&m2qQ|quZaC~Up z;K;!r;5eP&j{|4HAB96cvC0KHesJIfkbjxGK6UWN`#b6X9KC<S|EYsKx`olFxg1w@ z`mw>E6QJbuydKfvB?|Xs4^(hH*5Ho=?KPc6`u?NxeSTpb>zBV!i*}fEUt@N!SSX`S z$}`EwPHCS^n2!8lX|+W0EUw)-E+|?Z03apDVA#SPcRo+E^^*mAPNnskQXUUc9vy#g zZqNt|r|fT>%mF$TI5@^&42QWsrw_-;{GL;R!<K>9_^@?6BRI}lfag@;U>ykAGF{Bi zIej=z7TGx!IPwx6c5vWK*!rEta^~qKC1)+9b1HD;l{*fHg>z0H4)<uLhm3jE2NN+a zlE+aU6Y|PhQ!UErG7WU(nY(31G(}{SKP;Ef6j66PMZ^@gpJ}NTKAP>(<Ppna*uU;U zl5q4D(;h-+B1lrdYcY(@s_MK)ORTL9miKtOyZI8zZeHKx8e|Pl&HWs&JsdBPsiP*G zkjd#X%&|@_i<w?KaVn%@hU7`Ce96GmKY0Y>uE--`kFHj}bZT#?b_s+mH7``vCA7+f zvuhkJtFSfDTKwZ6OjYF7LynbG=2trn;|!5tt4AJ_R=1FX(Im$cMs#5@)2ejB2*2s3 z^b50G<W$IQi(em8Pfs>sa@^KWV92vIJzYb7R!!+jwBhpdmyb;iSI&Jo*i=Ide#V!D zT?Hp!db`@&u@VU!jBRW0OJ`e|x(PX8z_iV2!f|$O>zlNk08{zMj*)@=Sq;Opfz`rO zEqZk&>o;B<V_&mX9$VV`zhRZ7t*s9OPqVJ?mUXp7t=GKBjOxUqk}p5QN_Qp=>uwur zKW4*<2lL{wnO%h{GqV%el4+e-w(<|zyzavxv_<1O6UE*xwqr?^w$-nA;%$rH^2A&D zw4(HU8|^YG<?HM44lCOkoqT$|?Q>yJs$DM}yrM_An(Zzh(-nHYI#~<EeFGqu9k78X z-s^jpe0!c8R&MuYS+nn|YB2fL?sLMHwyTMg3oU6#dA}UXqiv(3ZV^-PMYo7C=;NP) z{c@a+Lpo7jtAg7bOFJoygK}^a^F}y?EpLRgjjbGj%0Zj`d?Z_;#n$p%v~5mTCTaw} z(e9Vq=v(EUN|N>lDH~f5eTxt$60i-<k%!4HRfU}cTe1&rWAC-Lb1L@FAExSIK-Km& zLrtoBcG_9Be!mulb27UY(bHpF0ml6<>?^8|>#_}A>V_YU#!B!@Y#$`U+oIG-oE-VX zCMNC5WA`5}FnAM3v)T}<^?syh_m8oWZL1&OQ&jK#RJb69r^P3d^&Z{}C|L6To%vmd z<-8@ob0||<5EC%4)G=nw9nC|}MSiqXjea$}U#z~jd=2kcBlnBzDYc1@h{U*G5MM~d z7t|&!>sP)l1_a9cG3URaoSpYf4mHI!TwS`xLVoL7b=U}@C6iQjA=~k6k0tNwjL|4> z0v02YELTi>hWn4JvqOEQ)(oK0YT3M(O`TiVeFXYw|Dpg$!mD~tzlU}UTB<(Xt(yIf z#9(xln}Ku=kUi96xyvO%H-|mYyMR-O11PIL>aSuR4u;S}M}Sr500?{1v?I_)hMgDw z1IDT0g>E_?W5(k@l74GzuJO-5vVLnL(DC~1+GBYT5r;`hX7}MplIz1C(6+vv-zC}P zls}T>oE=G4>S{?gu0sS33iKBEZ^@7W6uX{x6t2d;@SwErU3{|UrioNKLXsWYD1#|A zuZQ$rwRO>sUP5KRA=&{0b~FrX!R*cTqb;mE#~Wp@8YONUCtf^C+%itQaFoccZFQaH zC~?*j>rJv@7?g!Av%MdR+E4E{x0&_h(0!B`$69dB6{k+x5l5V1ZN^;o2twEv6t<5a zu!FQYoA7*{My-3{%*L|mot^Je{zOF<p%Q)X9N4c@9_;mC*}6%m8L0kYcM*%gNso(M z*;jV$Qb?WhfVFGy$Mg~E=ImOwdr4iRUVHCsaY-RRbliowqR%G$Vf#KEx<wM(-*F=D zyB&-tjG8{{JmPkBJ{M-a5)XrVxgak8SiEL93m)2beqA<iGBZ`=%(%!ws+=&Ooo;c^ z<%md*kt2z#DdAII$4NSeKo=Jrsn|BpJ15SSU3sKT0hPU*hMXEeqwxSiC4O<x0$^}3 zVcEHf>W8iQ#VXzG_@a;G<!HkLWtV;k+Wgu24v6M>2~@gg*O<zM!p$*2wFR+h@OIb_ z$FT%<<ad{?lGYnCJ)5ruP3U!=!wQ<(=12FNB6@R4WpLLhmUOJ0QIw9^C&Fxe){)7c z2MqP7fwLs<D_g?9kWP~w9U)?vhs0)cF}XU1(8xvQcDl3mbLlzo3t6EFd-GLJ7F?In zaR|b*DS}5y!qOngj3(M`kBi_PB^A*{UMU|-GKh|vsv-Op6zDF&XB>kL8?7rsOhtx1 zQbs-~Svckw6R&PNWcG_h14#T4t$jzixglUvOo4r?`J;d#I1EAOM%4T<P9oQcKlDB? zmq~})(#xB4dW3TaJ1vbn3P2WGjXMhC4(bjP1rB*f8gvjtfpaXr(b<5M=P2>}D8t`O zh~5v_9eAf9C&(b2SBu7KIq89iwd4d@Uo9t`ueMrFJn2|DVd(2}f;ddbiA00*B3%H` zA%=<0q?~|`T1wIq9q(|0vWb!Jv_bB5e1>ro_tW9JIxDgZ6ZR5k9m9;RF=y4xi1@C_ zgcDh7CKP%S=ZomL92#rXYy!>T38?34L_EPMTdUc`lgKq<6TQz5AhVrPFXR+sHj(z^ z(orc)B;Sw|olV3`a3*KtG8z+JA}6D+W|P(=n|w8f2!Ii@izSQfxUF>LNy$5>p8`GJ zb?QCSbD{fJpEISCGi4LX{M?+MTk`WNjzSwCys`JGWQR;(>gktRk%ES0XpVDa8_-wk z#Hu6PW|iz$N`N<=vxbj>=iQNx0BjAnri;p)<g9ki8I5xcmYo529w4Xzkq;FykfPy; zwWK52EXU|bHtw3Jo6SY71b_T&P!;K^XBxoFI{r9L2@0t>9k=FCYWCtWowhdJ@8cZ! zMpt{iugx?S3Dzd;(`&*$bwt>wXM&ylK(R}75j(d?>&zn_+|lwpp--xw+gUL8U;zb} zuWknf8*el0dv5Qa)12_Zor)B(Ph8fVPwwEPr#cbolyAa~LZScTk<mWCe!>p^F>i`d zuUwVdxAI?hAh^O2bXi9#arVxJn@#i)d5)_w*@Rrb{Py?%ey{^p2oBH(yIxejg(4t2 zAZCNkO}E-Of8PucHzW|r<7AOy0eaTQknu)ORL;^ma`s}i!Om6UL0LOx29t;nC3v|# zM#!MYTv#D5LoZ7}IpmEKI5`!F3oiz!NtqywgdC}=P#mFYSMZV81Oz})LpnhX0HoQt z`A;UJ;9epB826v}dpgPY;&|VIii4fh$9(fpzG<`FSeSy0V>|mg_ZP^}e`WJZ89m7+ zCG!~*`JnZr(|!#<NDb1FEGPu3IH|^rW8&m0FpTOpl6zReFo{=497w0XC=|lc%ldzW zYoVMkz4d`4oe29n#_eIT_lFI6kQ~4x<<qO$2h~0@YWhPdoY~VGCXP$;vw>QhX$&vH z*)tb0Hm(osflSS6re}wUp0G}xzolUl#9E^Mlv`-h0?v}cU!PGBiB}?Ks{!=Wg?iXl zobj@#{y?FzT{@bbAMt=Xt7&IN!-7NJpkAH546SAt?P8K$gsuH7AR^UVy=)h#TTF+O zDv82W`?zq0H=J%gdY8|uW00-skoEd|twua^DsFHs6UgJbRUL?=A<m2rjMBBLKxn2I z-0NT?iw<$tK4tPDM>zyG{%Q$LJ53u(D6j=D90v#7dp$^_lbdK4ox5JbN$ZG#pNk}R z!?lB<z`7K>0PHgc1GaYmr^JUU1{&InWy{NOd5&e__=Q#MQDeXGX7eSKswR0gP?Z}P za?{Cb>Fq$(pNPwJqQ(Q={#}e~R%guZ_3pbM_VOWBz0D!PGt>XV+n=@TH{NxpE51tF zv8U_S^yC5{l*++j(9Pfl2UaAo#Hn2za#{x2INcgwJ#Z&R6E3eF;zjC{s!)w+&5CNl z2@3yJ+}CbE5yv#a5`h`y*!E$Q5Y<J6c6l{u(NP%G12ZW_=l3+L_c@SlE}0Us(n6KW zpi+qY(*82?gY&ZZ6_%E{Vo^0ByMm5<Bk065)6m6NagEIgKH`tM8p`1l_d86y=@@*g z75yb~Gtl4%-S0<n-Fty!dF!&Zi5C8l!HX5)(yL0NyW$}CN$Lg}LkuHV`bKf-4&e+P zKqqKl6NniMRKB3ms8-5}N&cXE?e-2K#99VD)q5Q|Gm2Z!fP)!ufX`7qbe9uFLtc@U zaT=A&8i|-F+I;4kj@SwoDwaC)oX|iJ6}yIUUZZya;RR&chzSYfCJh_K@iIG<SyB=Q zMOGg)Xm%;o4r+8$iA=7JK*B^qTd|3q^+tX{z-kF`J<eVMRA?!!4H{*{6_I{H967^+ z>>ANCNEOLC8cn0ps-HfhFoKwu=5OWtj~XK#d=v1YerM)CqMy|Y_b-I=s`Gi3+NAV( zygpG#KKN1&tkY4x{D=pZs%I?rhTJAFMy4Vj*i&(|9+Z2$h7<>vsF`8V74zKsStGc{ zB@+{NS2NnLr3;NH2y&^zA{$_219KE|%2V}~2dl<1qJ*b&`8+6W&C>>&h+0d9GfYA5 zcNjPTrfiGR#rFGkX_{fve^0T%K;}&pE*8vWWg5d=yTB|D5m!{kL6`?h_&}}}*3RNL z8+wL#rV`}r6<Hd=t9k`pHe#Gm`*s+cIDxlSoRC@CH~}R;L14O)Nh?lpT01A;{R}5q zhNhfP%zbiBKog4-7_yC2L<0+0i(g38ErE?yU*3=jvbhtcYk-}IyW~)0G+CECk~|W8 z27Ylu89}(j|Bzntr=lj2^o}}ALUqhmv-*HbWWrt4I~W!a%6|WyQU99|NUd1WNsvZL zr>>6n1m2VJ+VKBZ-l(!vdzZb43-5ko+;K!Pl-qe(xko0mp`T<exkzXc+gv^L?g!u9 ze5C+*>l^VA_40df$S*5pk8_*MWx{;JMd-Mz=i1fLHyD^ii>inG6&D0|phOER&er9& zBZjT2=%Nr{TS%G3Y@zO>3V-SiaS&iUV=E4g5+&NkhA7V~=OhEhFXHYh^mjsZ&a{?* zwA3X-l{*$m2Pc8eB@k*0hS2tQ-X&pxYvzg?VxcEPY(XJ_y_&1pg3hWW?9rkLc!{Bv z;$BP+E=hEhih83p2aQv;(Us;F>V$3bH3`HT7vU5%dYJ%}L76Yv>LqSZOZ}a8AU6PV zyd@k=UOGsRuHe{x!#U`p5pKAH2q^#lPO%h!#on|eh31bkU9DfhhjwUITNe4rEvJyp zJEwS;QS#$fW2wPO#k=$^e!++a9F#bsf%gy!(^1AeiyEJdu&-XZ_8x{xLXobXm!=`j zrshoHRiCB>nM~Db$<;^UX-#2Ozr>3(sD6DmGZ>@~?k>nnz>Jz*HnSP4k1NUE(YMmy zr4DH{p=niHI6buD?qr=03P1^w;Ei+GF~Mp9K@vM4qx|A+Y?qnv-GcK_eHe(|Vmw3+ z`e$*2s<TYDF>Y7#fPPmC39x5NGrU%5L90b>l^C?QirZr%j6i1r7X>H^l-@pFFvUWh zYqqZ-BEdohO^q)ywo8o}##naViB7Y$F#Z=rMo}wB$7ZT2s66VGH2jFvg=HN^v8)xd zAQpYj0*CntHtaDXf&j6E;{Z$_i}gi9@3nG@d}oMhRFNMis@OqgxWq)M2N($(I~y`} zX^s$9BMm$nzQpP7;(-@;n7ojj94my9t!>RQg#fs@Xsj*)Yl)o;998bsq`%N_dC*OI zdDL#G;5!qt{KTb2yB{zfyqu%&Rgxn_v&SmuOu~7%Y`EJ>6w8=gju^zZSP>;Q4s@#& zHhX09asy-6O<9#kt_&k>Tw@HF1_`5I#sp@P3rucwTQ|yTwhq_GEU~<vhN<mdDW^si zbL1y>Eqf+*9-m<kK6abJm1j7H*%hKkxVn-7deo`<)rPV|&6JpD@FDK?wE}h_>PA)W zp%&}41u6(_7@9eaRZf6?P(*^l`e4T*Lj?08y11%JE2_h^sp*_rGDbur#VI3?Eql$F zw>%h0Rg})aXAUEunKoDZ%#wK+rBhO^TulP&{(!$autjygz%d`sR+3b;ix=I+W1wd) zo@SUB0xQze)T|q^ks7gsm=<bxQcy9lFhi#_kYHNeq40qh-e8fv!NR>k3>oB?Q&=W> zzvdJM8Mp#(54Vo|2jmYTb+~?_WPg~9;_6jjpwX?3JaQ-1WlcfIvpAuW<gEK+m1Ji$ zcv(|PBDsy~YZPBH>E>N;go&Swngh`q3Ntv2)x0PhtB2p<^RZgpfJL|<Y4TF3{O%~E zu!g~?EdyCL!YW{fi@sHz`A}$7U%ml)wW=G;6y^`OBjzk6d?{F+J7atZhh(Nge`Tgp z%rr9<)Fy+NDvg+m6k{qU9!kPOu{P#X1L7t)$R8&En8@={Z?^cTEv8B^Ra$G@AQ7;# zT=L>f71m-ZY?el{EdxnRg${N;SMvr}f~gQ78)5`!DmY(E)c|#NPk=EM2dE2$FqIxK zmE?ot*kLLY=!TGqR2ox(Krt0u=)L11kx{+)?#^mix|q&${+p04W=A0}HUt+c7qN;A zX$)e$h&7T?$Z!pYl_sQi7F8Mh^7<GZW2Ad@$9n*dByFo3KY1WRn}#E7+mN$VPy%#J z>P8eH7c>z8keo;{woNf|du^ZWs}&;*$~86;PW($mADk%i>-vv$8$<J3A2!q<0H&zc zi%&Q(UH(2=&0GZh4Stx-%|?)s2bwZ}=1r~zs=;#0p)htJ#nq-PoU6@M94-?#8ESwa zYjHSW6VVX#GHu4;BMWC7PD2ch1$hC7;{+W$G8Tth*-d3ygTv`Nx@MZWnW4+fEkbCt zRUDVO6|!!QG$ty5w#3|c)irZ-K5EU}O=oVZMPpi5HuA{*<6)*dbE>6U=LtYMr&@`O z3WjiY>bu~h6J2L2Eb%c+CBFeIn*YiKt{H_HXR6FnT=R#m<yOdknZ#0_)q*XIpu|!h z1~CrFEJYqnD(RV}kmk{3!$v`rSqiS0W+^=3)hwmS0OvT~G>ciY6ly-R)O761Mzqo` z1iGP~N3IxOjZ`M@s~HN4n0JJ7F%<#P#aCD-@NT}H_1gx`XbG{6DGv^w!<s0t+WVPk zw;xi*@KF$ZD3}1~e>7?w2Kq8Wnu>pm>pbV?a|%NEpoA>fG68@e9eg!p%*wIQ2u5kh zcTn#cJ7}_rkh3^OHJO*CnuH#%j8zh<jTQ=v149T+r)n$~S!^h_B8joE&&iONfkmVD zqccQYmB%irVNx7T3L0!$uy{FLK63f|fXg7U^-2Dt{w?^wEQURRL|AN~$?%W3PKW8i zc~-&nA7pH$Q6Zuvjli9pOH`%XsPb?z>4Rcud_efeALP&DpX!TGd!DQS)xLZ%BWzOi zVnT`I8?M}GWnQVAk*%^2mW&S!=<Glt`a26CQlA>2aD+3YW~9$L3NSTm!fr?zvc`gy zBDV~67dCMRi&$JUSKrV{D+jqwRuM5>Cp*5Ybn1pqzk4&^gfYjBv2>CtBWqJrOaqyn zE`Ugj=#~=AcJPpcEx7a%2GA-W`BOY*#k1{_mQ|OuyCk1`G%R4nTmS<K{?#HP#lg<w z#*V0fgwP6)v5-Rp%wx!*e(T1e-aN6*iM-fa(a|bkzQGt2QZX4^s4k!tJ6LeU$S9Z8 zF1(};-9?9yhnqF(;>!|1i}VD<bfpON<G<ZXd^zJC-SNzNovOG=2Sr;Ywn)Vo!uicu zN<(RC*h#OaYOtGksR30ot^tX_N`YYOIhvC70LHq;gh<e^aA5fTa)6~VLN1mW+pW2B z{pMma@Fv;JAUm{jLdR|OtoUj+x9SnNTu{xxR_ZHUIZ+y10qPh~){dZ2#o=Q3;fT!x zro@I{BQ}?s)=jN(`B`OezhmWM<MaC38~QjQBo+hJ=&`V|7R)3|<Kz9J>=AHk5aQA* z7m$u*pGU`S`Z3>MBjPB$e_<_6#CL7r%B(%2hmDfQi{NPNpm|@E!gB5mlLJATrLx<y z@obg{TFjMTf74{tJ?z;WO?MJxQ&R%D>mVy{kKmN$>`mrmhYFY`XU}uOby{aGmX%&| zVX^>m-JaFKtjR&UV>g0c=PT;)!Dz4drv-ZgjD+y<R8~{6>UBKe=7xLqxGzRm<4Ge9 zab|U?9ZtQppRM?S7Knh!jRN{WE7351?;%i-T>1&3j{(Zv2e;OWiFZTFm{==B0HV>Y zdz$C92I;RZa@DPS-bj5XE0e#Ib!Tp<>lULc|LXM^@@kk*WYDeV#-L?fjSyfx1+@}( zyhwTq6G_opN9FCBU?WPa`Z%h{`&ePvS9NWz3kAJe1sGH<695MW*h95E0U}>atvi8b zGZCQA<2Xj<z@*l1HN?YHHq7ev-cNSfNNBOmFOcSKi(NMledX+N1t{?qkH~Oi5)|QI zn7B1i$c3e986p&wU0U18tEW^Y7tQGLbYUghJQ+=C*#S)nPW!q|D=Fa%)^dt>Qf+?B z;pO5iBujT@DKe-#vx?CL(dLuXxn)g8S7j?O2A(7aGA)ebbrTeRA%FlnzmZ!3!dM5C zDUUvy`Ed(LX}c3fwulWR(i_|IeQKB=p}^R8$|j4yXEaqMD`jgV7&?kOP@Qmx@u<^Y zDI=<>SR-Fn39=T%ku?X`g&34-;)CQRF(tK`7h<(7xG4FO61*(<Is%>*k=mxnq#)uT zOzKFr4lH(6CSDXqx~8YgEx)a4l5^98D8lJlKR`k3w33tnDl0y?fy?a1CWqgU?})n4 z8DXn4g8AGvBV0IQge_X^Lp!S(q4q=0h!L#K5hLVF3D;%>zf%gL%T+Q)*vbzW;X)oT z!j`gS6qX+%FHi#@DMQf*d<42Iii00$u!J=QVUR(r?H&X?H{k`2@GLjeD23l-70I4c zpDc#RWa2>xU_=R+V497h2&qXQ6_^%2%@6?ovBKBMIA_juLina|uEoLZh&;aVIij-f z$9z;4K5Nr(uC+3{s`9wPm(3O4U5#@tWYU#!BjHn+)mNlQwCtK#Iyuc)&}iJrNyeg+ zW~Xr-2%FbBqisuAq@B?)w!FM#odrLoG23ibYcuK@=eB<3PRa{$4P$LuCplQ;6g#QN z#)z>PbdDHnqLVl!Ty&S^$<$d^pvG#D7?(;s23KSrBU9!vY|a`yhPfE~gPF(RS$sxQ ze2jz^hirWqt9+c(TNLoC(EGJpr044!I0?RdhBZ~D47Fe<DCWR!Lv}+*C21Ug-RQnQ z|9X|aGQs9wcaFbG4U^165o>&2zmW~v2nZ6^FZKrpo9EhC=UPWqvxLkU8hXZc${4Cm zOl(n^{seug?*8M@e?tUsq_|D1m5pG6+pvIGBC^_TE_v}9Vnl=N`omE%B49@VO5xZ; z_)l#)T(w#8;Y_wJG;5}3Y*t{D37%%yJ!MeV1`EZ5IbH=8MjysMi(pB;A!_16z}hml zbKsHt`ZkhI7-0bgZ_$DA61@-D+Vm)RgdiRa*$suY64JdxmVyP3{M%+_qcOS2tYv{* zG}tx003tKakZ(3Hz^qtp2CdGPd2raNbiW~LWSqTzQ$WwFur)hYnZ}%+#uP$++c0`l zwAH`r-tSVaaghzPyCx3;R`MmN>67l+q+Mbl8O*$HGD><JL)^8?i-Pbb-1@1l9V981 z-srcT?HO%IQV<a4IT8$6>m!>PsXZR5;a_$<09vh&icwA~m2J{~RGWI$ZvsdfI14_Q zLkNySZ>vVH_%S2ZObL+!mwdrXVFoVvwCon*A13a!F2E73c^ELI;FvuOgBp+9FT=4K zwqHgCZ>iKkVB}Q^2hKU)kyy#%TBG`y)<Nu|qby_%&siR_*Ei4?4BJguw+H@6GV2l^ zt6#HU352ptU4J$XUFegRy^Q=u8(3@_P^A#0#ixvQ?HVkap@8JJAuVDTb<)GNy@1h$ zp;$3m6AiWQ*Rdcd3tJs2N?t2quA)WLc~_NEhQ1hDUoRth!5z(kdS-fo#XrGTLzhiQ z%4ec2WK~VN+8I@hC~A-{nni_};?gUta+ekWD3d2w&4ZR<aLv4U&gwRnvg(y<as)*4 zsXCuU5yq6NM8p0A7===c8f4@n|0b<IUOKqU>O##>Dn(&8p9I3P(5TQ?mA3eT_JwFW zI)>8K?qysSAxZ!Zd9!9{A<{I{d|qj<XZQ0yiP{Yqsp<Z=(1>Ymy=euuer)VN*O1wJ zc`A<R=0yN$YJHh4S!cBf3)o+%pXx0;_$~?oMrOH3Ubl`6-H$&-D3Wmwx<uXSznM8x zc~YzpRvXNA9oUbe(uE#X)a+x?>l^46m@os<Yg@v#y&g}&4EcK>iN?wTyZ?0gxacf( zKVpA|MkU@a3|~X@>;fqk$~Y7Z19Iv>xKx#wgQ)IO)!aomBM+|XZ%<;UQ%r%0#VE&` zddx&xl%Fl))eP%PsIsVLZn7dvtcOA9sX3|vwIfI@r)jjJf@>I#*htl=q|3z>N$uSg zZBvKy7INh;o8XD!WOsSW{DQ-Ne{%`dVBh{%Irmf6b))9z@quYvGUSq>QXojBz^9io zls=80;^Qr@B_Tj{^bcHSBu%rP%!H19A(0guHmRex;yoB;R<zz3-9%P*4yzsR1NXjJ z=%MZ#Y7uV$MgVbO$+(_u)*k_Pj>X8w{bB2i`a{h`53FYX+^h)w7W55%zG_Is)Q1IN zvX#{;MMdftc+f*;)pV86a83hKZAsS;c&J+3C<l{O5_-vT{JN<s_P$H3rygN)$su)b z%*ynmJK8L?Av{H=ZjaVyrhic*2AHaWMVC}q=wRA+`qP$)Pn)Md-5r<uuPosTSM3IY z?+7(3C#{%8rPKRS(If%BD>WV{<EnW;vos0*l#><B-pG*>#vYOFxtfkOsutFbl-<i% zX46f@E*7!NIJJBIXIPyB99@-C<X`i)N%QtX32Ebzk#LGuFf`gnn}9Q0?LV_laz*^% z4e1>84DM}7jCymhhU9Nyz0J)Lm%!R|iN@-wSfesM1!DO>7Uor~@J9XFEju-P^H9r* zAd;;gBl%?*CS^g{@|BrA%G<~?QE`jFX*J98ziRg7!c@U}{%nt%7o<M!18os$+Gv&+ zX`;+JG7i_(CRa7c@M(@>bL}*(Q8w2iqwZg2(7onzlqSpXUpJ4wUI<rjm5pcVo(JyX zt{VxV(hm!i*8T2iT~^m@ebkz`2Qm7vkBl)`fpDU<PL1kvwRWT8>w|&OmtBDErF3WH z4E^Dh3If0yb`w?}b~B!EBhL&|ESAA$fTr5z`GTM+yF$(oAkE0x73d7G^{6)_@e@un zUoNX0l@YVI>AUa%zrTzhNE{5NY0KTCp%iNd>aiMBu&XKCpw`0pWEXMZ<A<XDe%uyk z@zT(yk_(44d!y(nmTdzcBE|fXQ7K2b2`|C@h1Jm+%+WZILy8%TVIp<f2WxS_If<do z+(=TGOB*n|WU)aDxKDl#%nez*Ora23Wuuj1CYGg;8zGUS234mCksRxtsshv9;c`&0 zrn}aeI&!^$;>c*HgZQ`GnU#zdlA#q?TDqQ<Jg%fozI$q{QSy+JXc=?}f%G;-ELNM4 zRQ)Ubf+al^U+@jww%v(#f{h%K+)aVTFrosaK6i>sS;52_hVqBd>QdF%IVZ$+3$L}G zJMDc9PO@9e{)AE!cKhR~;m6VOPS@e%WZ5-_a&#el1PX?Y`N27mGnJ29!Y-hTq&Baf zAI#A#Dg#FV{y%cX{z2PdcpS>)EfK={sx;t1S@C`u?b<ZLq=FSJNwCQ4BvVNkp<zTL z0BSP?S_h)p0s1>zo>TYE;$h4T0EryjiT#&^o99BYAdHFHz4Oo(U@jLloWmnvk?KVU z%8CxuGtjyMxwT>ypTRv(zpdrYskH3MEbG#_JVFvKnG2fLc64gFWjF(cX?eC>k4EER zv92c5o-8AQ`!<MyZRpyl$87lwq;kFL0Mvs>nnp|9;tRC(5N|5v#8z&a%^@cZh2>I% zQ|B(}%#IzLWYMJIdShj1nL*H4)n-irkV#WBUs9iGz}^p&BK1JrK?WOiTd2~6tPWKg z+G@PZu@Q6esKh_Sp>x0qhSOv!%NIp9T4<Pjn2H%O<~e*c7Ch%z7EF{nhbqN$Vjy%I zogL1Ii%>E(;p8~XkqtX%>&3O!mML%%hQ(*#=awOXj4&n(8d8EdB1>5ex|-dzXlJ)3 zjqm>}APuz;(me>w3VO;Obw;F_!!4N`72$P6nmXjk!gg;@#%#t&qg;zMX*#P(qs0(l z%jTN#oHB_l1^&TCsx;5K|I|)Q!4x2*J3*A0F0Mg3<o_7b(TJ1IIlV93_EmVSozgAL zK=%+gGc4Mk$^59^fx(Q&%*c4a9A-S6)R4|iJfLcN6!NnS7>$F*tdb8O^So#a1`v4c zGi7OUgJp|@uP7<6Atcl7W(`C674mzOjeW7FkW)&4w%lygQ=+zrVBD09?zpMi@Oo2- zu&jod3)V8*(WAc6_`Z<BBOs`CCl(H9;;Z5^rry^Ft!%#v>ITI!uc9lQ-gR*qzAo+D z(LS`JxQnA@F2;L(a(rU-8tswsjJHS6xlcJ);wbCBUhi+3aW+R?JG8-SF}ML+T0jL& z#83tL4%;Htqup^3vfz>O{EsXnaTN)>!aR9ZjxfY{m!XNQ6yIMym`e-#x3Ir_v85cy zAugQFZ^}$ck6Q#>>6mR+4rmd*dEXC3bd-rcbF!*MYR;_*l)Oupis#*N*p%u-$|N%i zbtryymu<nb92&ROLaojmyD&wrG@&d7@3lHb!TVELox(;@lS=cP)HI6H#FY>&1i&lL zpx7tV{M&)IWJxx()!?ac<XR`yRdv~vn!@G6f1aKzz$c4l(0ds-ACI2h^dy*}?86Ku zs>XrE{svWVm7QI5wemCvy*yQPfz7dY`$C{=gsdLy1#M^Tv<f-)T7R~B!r`}?aVE2V z8`dY3?5v;0tlu87K3`R%B2=)xS*g{mZ+4E)C<pn}SV`uxM;wonE%p#+n*(7)F^;d* zu$e(fYQ!9q)R=ulRHoXdiK+oP9u+DE889y!8E8lb2!%@qj1fjMU^$QhOcIiI3+zv? z*el6Djcf9-**pl_|9TLgiv{WB3^LFdnXD!zYg7a$bWBv6n#MA*0Mwh7E7HYeVZo3A zDNPqgUJ(!>#ALu!p6NQn@)QO#Q6obTGY>U}kPdTB8E(iu07D|qSwu$dT4_kB@#HBW zLyM<I_WKKg47v3<+ENHwRtfD`y(1foc3I8izu(iU8^fi7zvuuRe4*mQf|!B0Ts=d( zYQ2IE&?E~vEsF;Zj4o+FRA3zQ4}Es5Qj6k%V8vWVxALZrJvdNc3rs--LjE2m7?rc~ z_oPL8zOV4-{SALU(DdigmOmeE`*Wo$o1J3<aFSaj$(IveopZ?X@>rD?sz3kWJJu;K z@Mk<x<N0G!TtF*XaV~9E_Ji+uvnFL*2u#b$C@Rnr9}yNHirLnyt<$d2(6%A=s5@gc z<RdFaXaJB&G<X<bRPGGWkQ-vEMZhUYqX;SXkq0zp4RwJu@J-?OhCLe=ICh~FnWemp zC(H-3H(MErO;PwUFf^@m*dZpCV}o20dm}(Zq|wK@mbWj@WE1n4Nr_v^qzXzhH!le+ z92aYqn)0x>&D+yvf7@aqSubMskVC(=c?B1Gt_wAdXeGCD?2x~)uxOh@z(b9ZLo*^a zwhmsLwSQ{(Vomtl+tW2$+N78=f-B)87qB{Vw#&As%T#b@-5+M0)x=fQf;DG`SzoW( zZV9|yixcN**J*az@WLY(QGa%O1=oA7>lKQ%I&RpWZt%C=%48*Zs3gJKi^7dH1pB;# zmysEa-sojsrhtvrbJO;8lfUiTo^bQjCJ)s^4*fdh6&&zf2evagXC-glo^JKGL&{_& zd8p(8^>QU2QRTjhl1-6=hLz~$ZpUs~8oBS{{jQvTH}Cj2R->M|ENamd7Rtw*Lzoc} zVmj39DMTSoLJcAf3Wk+H@UrxcO?F|q6k28n(PaFXiTNc{0QPAr>Kv+Z)HzgBQRh&3 z)Hx1mM<7iGxoYS#SOyP+BpP7GwbvugOAc9Ct>-hNgFF#J09Y41L{Vmz97({^SG1_S zyp)0UPXIgl$$|Ax06Y1q1{R5Sbqmy>tk=7<j@c8W7sYU$9T1Pz;}vJDoz+;q8XL`K z0%xQ5XUQiU*&W8tbewgmBU2f?U65v(W=RVP;+2|9@XyQz`Fw+xUI2SZ9KY0t`cgQs z!K;|JbndZZmo~}0N{Wl&%SgX6TPe@X46kYtttg;!%;X4%<8r1cH+s2IEFYhQgOdgA zCX@j&KNaKGmKwOt4%~%n19zbVx7mt}fP)>52OI?i9CJ|uZd}fQLouq{8o+IF;I_bg z^^p0K>r?MYp=pJqffWXuLjtcd1r{%}Q@Gaql;*k@Xp|x5XqM}IJ`?nn>vSyYoaU0| z%JrJ?Y?gEWRgsEyJCc8;+TwnEpnBPP?VWPc9L#^SZ?2ZPGf5z>Ob3~SQA`AIel1dP z4&JPO4X*(aa90~<unBuH1?%lQPmY_1Y&ScA$?Y86kN3cGf!Er2-e6O-GsD(2*a|yG zm64h*WB@nvz1XwJ(2r?Y;(yPYOFE~aJC`7;1qbqU?FTuqNN^FZ&JY(GPT$C{PjLbi z`UetRF;{@rhe2yGF<sNCJ{N2*?(R=OK`<&pDnAb?R3s8jE$<g~EQL4gj}89FTd1J1 zzFp|$w)wA%`E~Rt^>lbySW*V+*JGzYFfnQd%b^EqUEg-ABRDE$!LMSgKeo^lrnkCE zg2(h=s>Lg<6Lxy~wWM36_IQ~mGP9^M7xOJcWWRTp#J1%f$aFGu#iPNAQHH!%5ZdDG z_B>5R+W*Jiy8zpDUiW?babEYHbMHMDxBxBzwA$wwjv*Vg5C^7MnzpbRnh%kxl$v&^ z36p5*%v1$vjX*&d&O{PmSx%JLar|H!EAdP@j$L_FvQ-?p_1K=8Nj0vf(WHtkrEIFn zXc{+B9lKUsb*wtB)!+ZWzP-;r_r(i}6sa15c+WZe@jch$|E;yY_5CgemzC+v`N!r^ z#A%-7LrFx^3uS$dGmzpP7708m&Q(wd!zb4egK7Vf%#DTIo(eMMqc?pzFA&7UF(M=w zbYjEMqgo*s^_}d#A`zkfT$nz@g^y>xayLNeqO^oBlIcrNJfJ@h>x#ap5MKCP+<R1) z9-AK3y1W?$S)rr@+_t}DRiF;OWpVM5_Ts&Zi&W$Fy}~Ek*J)5J`ak)<dD1E8obNWz zR-IoEqD?@uPKymAs|DXM@ten<mzsv_&*4k?RFLQg{&&h<Ceer0QGpwJ`B~RmFwuu3 zQuwcB7x+XuX`xI8RRoks^-lC56%gjGa_^0gyW`_Re4LAqN8;mQL37PI#sM<!>wEzg zQJVOO)zZq54eToI3~<-2uHs>iB>=>W(6wM4Ouv}Z8j%Nj<7rqsxlu$Bj4iBTieNgY z|Cje<z}^?p8%x~np<})^C2)><MsfOhI3^vo5qaLr#Si=@mq%t5Mo=6ga@9xL3w$Pi zor?l4@X?G_Nu$i3RFe2t6H%TuQ<oJT*(MH9mttTM(B^uCgf5Qa<2)DL3Les+!4cw2 z*6iX;YstH^Hy~~?IX0YG)Ni0<xD92{n`4PQ&4YYw^BPs?`Jz5^sd<H5Xgn%Cg$Ps6 zX^3VRxuzQFK0}WAiUCJsXqfpEjMub`i>741M|fg@AX7c<K3kkw&^f=hJHHq&W~Us_ zowlHU4!WkQkK_n*MopgbVwM%Cj|x~A%1O<cVRs3+0~KgxODGJc4#e~ur366>Le-Uy zQLLm@dY7kvLBfOKQ<NsD?_`)j+O#nbDWqS>G>F|mPy#~ja2yALKWP<g8Hv$}n^dNf zXoSo<U=vXldmXJ9m12QfbK!=z7)<H!s$X+$Hjy(0NksoA<4-jRZ(;K=!lRpX!%CMT zGz8kz6@#Nnp-OeXukMpf8OsR*Jlf>vHTu-Ny_s>3?A)cwV^Do{Yco$s4X;f59P<s> zD&OcnB*~MSAmypx#IOlaZi^DSMhjAh<(I~v`I_hvR)k1E#6s-U3w8~Zp(rky5gCK= zuRKs32b+<ROD^vX$1f-!D#)Z8Ty`?x7R*|mjNmd8^mx6<a>1wBMwP>%r21w0JcS{* zdQb-PUrXDbL;@NwB#1w%_{COsU1X!Xr3Un(Ezj`K|Ks!?>BpD+V*_r0ps^Q2l#o)L zO&>m4>FO9F#+kv*GqWvyoSz-j$M)>FKJFx}mX8aw)l#e|!!T!4Wf0S<s7j`9e3sbU z9h{8DKc;Xxo+InK((<7*us`Nu)9O`Q)p3<UL}4c85uswog^R={+?iZ^yh20s3$FC* z_z1|vtl?3HMRE+6n13r$;6Te`04I%_$R#HIMTs?T7y=8$@e^&JJ0WB7l^Lr7)*rAb zAE%Y{P90pAyLd*{3lF`v+G!JN$OVdBsT3(*Ub{5k#9+qVO_jPy_h$GVxdpF44i#QV zq5-eSo6QXh<DqIw%J(PmpA&`9Dd>p8d5)+AWL>8O;(MDC@TjN+oN7<Zj_`rSd5R!A za<$rgg12xEUSenMi4aGr)73WXtZqGP56SVUdT@Pq>RD^+(Q<=E62drA2qS|h&aaa3 ziP$Q|%-nWqejDCu+an9953sFQ998kHMb&zmXsenGnVfOx8G=*`AV;~0k`@<JC?6Li zNX<{CcsL<AscV>t6n}(GKyL*y>(Fc!FYpSc)645ehUtHBTG<=%zrMCcnA<jj%M_}` zIEY9ct#Lj+&c;U-A8n|IACb{t_Hp!3sm9@pQ^vlG?}TC#hUNw{xo-76z4v?<2FDP( z6~f?bmdV>J{i-LpKR*cvLsvB##JduvcPP$OcV{Q9=e(w>2iKm}#Zh(gz2EKX5dMG{ zF%Sz%6d*p1@C)D)zC7JbuZm*1<NXO0W*D&u5=_+*V4;OnTaloJYM7nU=!-R~lhvuW zt`$6_YF5+%krb-d(#%aq<`mb=KZADsaWY?-udnxtJkRKvye|k&%(i4dJBf(EjbcW{ z>5yO1`h1m4lO&}q#^puT`De(1($<ErrBj=>jFb9l@C4?oCuWiulsl-_gB?=Q*2HqC zi9tOObD61y^+`hst<#;^I#b3MKpnA^xZ;Q%XU}7JRc|~;d+8VBr~%B8V2UnbA{CmU zXq+uceBP`mlek?7+VfE2bBTGtBS=oU>9>n3)HjOZj@TbV0P}#%Lv*lOwnRpsGW?8t zkN-+WLGd*Vl9Ij<<HH+_DL>b$at^)rSkT)As@qHqc)hG?^h0ZKO+`D2Zl@qJI?1xX zX2aDg1WJj5cbO%^V)RnP3Ok)H*8@m}`qR_&#?SjhFrHu9<;sUJJRiV!eGtu}58-=0 zFb}~YkYutUCDdTy!hq4z`(|W=n2zPX95W_BTB|1Y9^RaCtj8I6iq43`I*c`EkuBCb zb<YUa5p#()t5YAo^x7<&5fxJ{_z6pcwBfgQ_{sErx*D3y$JMFoH2m~EhE>p=O%A6% zjA{~I5|~oiP`$)F!U4|DHFOx>nQ~YG2iqG&F+6GY$EErWSD5Qy1*mg?R=C_~dn_2J zEvyrG88wX;m@2Ww?HR_qtM!dPBD9<z*%L;PHF+$6;XI8WXV=quu&AfJbps}PBE1Kd z=>@2{eF2eUUrkA3>nu?(K?QvKqw+zC`S2}O_68}5MV&h!N^^2y2JjUIU@(LaXpZm! zeUSPbmYN`yj*&)01AG=DP~4gfy6Pa`aoEr&o)aRVSy8#tx8mhu<Rl&HFTa6cRneyi zS}g7`GQG71A|TBPfIE71Cm}ZuFK|qg8Y`WRJGdGrohUVwc~+<mJDipzYVhJBCct!& zJW0)ylXNlE&`8#$TiW85wm3jrIJJ^_3W{IS7Ndo>Py)4AqqewFe645;bnh)~@d{}R zQEv$BFKxV3+Cs^?Z&F)m2WMAX==89?)y2jur7lo1x75Wgb#Z{Ya1KGK3mF=h)Wvk6 zE~c+mbwQf%TyXDIzqq*3yQMB#^#4^}T!?x@U3}p+FO|C3xOsIk-Kj3L6>iVf#q^a@ z7q@Itw`@@d+oEh)kh)M><|TE3`J^>QUA+7%U0zJTX7t7MmcDqU^o6K5^u=>u&R!~o z@rIjM7|&%pHO9t%8so?-r7;LszO}%(wZJ%Ff$`-mxi4;1J5|OF?W0KkiyO{*{3>){ z+`z5-HL}L2Zt09yN@tjSLuuUja{f{&jV7w$W_%boQdmRl#86zr-s_B`uawqM03kk> za{BxEOs-5^OX2*^aemWT>EAp;O#Fe{UcV3^`XIJiA0SYD;QZ#5PKb$oCxmK5R7tuM z@g@-$GuyEHRE{L7mLrK>Tyi84BP>S}h7dWD26iOrJdPAvg3nlvq}-nTIq?Y>_)dZa zJCX`Jl5n^wrnU_&!KaGvkusQqjb^Dw26h}t6M6C2Cd?FUu<hH9B)^Uy%Pvs@-|*@Y zi<5GkW#LFtOYI)Y<xozJBsF+(F*%aB7>*=AnH))ZIFdXB%@mAh1R8CONn};(&-L-o z4T=@wh-_Gq6POrJ;<eaBXb&XidWf7&YTmbRl&D6XN;{aoY3?nvIL7W|4<r`Rnpg(D zJ^foM=<#Q!@2o$kn7ZCn`NK)dNA#+^(f2B{lhA?bw<$#e&r*W7&hT}LZ;!|$xpgB% z|29RcMO=p5<oKK4BA>1N&isEKTgdRHl0(LR*@+_2i79!Uxg{eFldLpqjvpXyC*lXh zE|VrS-N_jG(2-A)rCUF%2s+%7Yt=fj2Nco?3!f0OE^1Uu&lVRI1s5?8Y)xkJqUQ=5 zF6};Nx3IPmC~6`aSM{HruMv_#%fh!yi#Q27&I7=$T&<~i(JTdUyt*8)o!8&%_p9Es z@5Aw2Ly?N0NDg~HHlcv;Qm7EK?40iS+wDW%UC(@?j+7B~6MH_QM3P(3y)A7nVLFL& z@=#Y$g|bys8?)@#lU~pWQ>zUZJq0_hU{;S^igTT7%T{<z67g9|`NqeU%Q`<$H%JfO zeMF~U@(3U45g0>pl!R0%Dkx=Aq^d|%Y`&S7%F;e?74##r%BA;d=a@|2m<!z%kqi@& z`f`@oL;2+UT=jjmh`0eFm>_sx<MO%9k)9$_#rb>2$Jr*tSy(^$gZP!R`V&8x*WbvO z@xwfiY=RE5`Z>~Bq@VDhu5QH#Y^q;pc;+XM_!&hg-5poY#Rty#@j2dhgr6FsASJ{` z_@rlWww(Nws|QH<F#b%*4r9kC&{`#}<ip3h!KWf2ex_}g<PD3>L=2Z=b(r+J_&!SJ z7z+n&Iy16}l9O}@4N#0gp-n3)LfaG>JqJ~YD6z0PUx^}4iT%vqt<U>(lti=5*Nt|X zM*?^`@_=z=OY<dXF)ST0$KFE0LDx6nI*~sm4BJOMvxoQcoR~muyGh$Zp*LLp)Gboh z=xN(Mk1A^jZ#gdp!Z(B_Ni1~E^|(IGifZXCzwh7>e?#aZn^dN^Ci<H<Bl??n7Wtbu zBl_EEMUoeUgu8Ac!>KzeC9F55hS(}X>6+1!T(6uSvLA^u2r5<(Q17w{EeJuA#}&qx zoi`+@__w*!+SQ+;F^~hY(fhmzCy!ldRoP@qV;Gn&#suOhq)8zSI5D3hG@*4h&F@R^ zx=p$#HxW|NA#o-pR9m`uCMxpQq;4(S)Z($HD#QTcSc}5Xw1ua5yOs+iuGJh@vej0? z&aUPn?B<%s|4osPloN-*n-t1qxh`fz2J~h*^C)stq*T>^V9tTI{ABjIHt;dxrTU6M z6jc%O!E=gL=99dDVt!?2R9H48(t6@J$MgI-0-BX$$f6iEN0LF+6rnRIfQA|g(7HV% z6?)b43qyU)_4GsY6%xbJ86>S5rr@rM+oXP(ZqHW{Fg(P5UmY!*zQIZaS$S85(1M=h z$RF(@Qq)Q@{c$3BA!`R(x4+d<(+!Q+$-np^=>*Tdr0FI9>laQh`Gd!cBi9RIg<L9) zKhybfhZts>WsU7|hZvd?7x(8UlFrN&H_MZH`#1qq-^Gvg;)#e&gkwCq6ivZ;ZRCg` zhJ~FGa5OXmp~GVu?0i~la<lqrNFkrD#gC75e|)0-LGYAVjbPTor&@qLeU5v@_IrhW zI;4FD_)rC%m}X(jY$4ku=MkKJ_Gw8DBSDxtHhSnCibR_eOo+HZ9?<5q#TSvxnz$8; z=}SxyT8J<}xKAWTBw(Rs{eps-b3FhBYX~8I=!!~cDFk$=c4>1CVasY4^3{Q3M99&u zEZRlE(XJc)Il~dT6d@;7OPY{q5V}weve@7S7iD48G-%KGZ(7J%LyR2n>W@!4Q%=$P zGsQcIZVW}H3FiW5z$gb>qdF@IyE@m1=+)DLB}~KVg0a`EI&gBcL<vwhF_kKw*g#$( z@>|<8RfWN{sE{zRMHTS;C<3l~5lAYLqBDL-`Ooko+H&he+C*uL6vFg=ADev%?RKgD zNMAcSBx@;JBjndCv8RGV3XzkoIVO8XTe(1ryvNCI!MxspIM%2CIH$FmWwKx}0;s4p zNf=$q=1i1GYFMrF%W%dy?ob@L!p^2t!N(TIVT2;2f%hS`a!0)qGpkVLYG7^0bB-=Y z%xp2d4$mClo;?B+DL>M^Z2}zS(-Kv!=<-`=73>ko>7<UBDgZTabF692ajzso%jg-U zYw)=~Wl~O-7a1#ssPj0)vyxtLs#s5;pOj(KZ;mN}%0zWh?b$i$1sDw<h@~FR)gosg zBmC1{SJs8Cl#pViE20cdot1%3G7zmR+Y1C^WxNP}gdAj!Vu(Ml3>C^i28A&{?nO<^ zpm9DwfhqL*p*0SR(l=O^ZJsJ|UDL>s@RR!qX9rxX>HO(UkH&NGD`D!IGG%=VC0T2N z$))qIOR^Pa44mc-ZvIc|*Su?9XeN~ZXQtBvOJxwtBIye6a7+yYKr11Bh)@IPR6&%d z>?zP1x`cNWQLiyq@No_G=+(>jlV-w98m~t$HTcblApanB<`3~ge5RHu4h!bVPpij# zei8)=b<rPTZ(Vu5H(yhMV5H{}OqPRBR%_R;7+tdw!mAyLCT;_<(N%X)9N5}}3k_?V zi8D~qV<ZYZZn=p3VXoN+MP+ab!`Ganqfvvf#@fEgT@AKmu*8D-UQe2HEgvDso$TAc z|CCy_5JyQ80SkH0a!nD?OCm$Zue4GLwh&oC=@Nd-h+5PNCddzbCFblj$v>umaMdvP zdRgU#L}BvxYm(oy?5EGmO=6-JP0FfuHHpa%d5pmBG|93OdV)m2)bJ)mA_8C(`1qL~ z@=vmb{T%%KY!89L=jVH~qoPa`6k}|zU*$1<(Trw=Unj7<I-*T{y1}AN6E+smB63zx zo2gRpdZjWy+MDxZLrKKQCwI1ZrZ=B37baaK4hN+1b~V1r)105HKA6fr$|ze`>5Go< z7QCYc{M2q6(bO}}5!M#UwfR<4GLf<>mwiKJ1#o{xZ{^hn4RH~!wMUg3m#<aF+S+v_ zlz?*6Gg`3fAHnCjIvU4DEjUX2q)}dFXplyn<Ef7=MuSn5cw(fr(v|SlM)mo=!nZ4U zJt^A19Fmt4<U~Y!NM5clB=00i0ZHC?p(A<q<RK+*61eI|>eFFlZrb>ewk3)a1Yk18 zr#6fCG=E9O2A+T`Ad?leDPtuq&?r-9I^=1i25da+AK}3fYKO7@NG@Z8m8HDUFw}aH zXOQ}5$U&%GmCC>%UjnQV(~ycrtV)bVIuP2YxiWLw6Cq5KQ&C!%g5JD;D6D7>&W2!O zQ*=6Cjog88M&lnHyLlLVLOX4a?*W5PEW_Zy&)WPfxg&&~U~qo{gE1;)Og#hkmB3)J zevT!!g};be<j^5urp|C^;V%i1kV*l6%Yd2u24+$ux)j0!Tq6-sv+9@fZfGJ9ReT8k zM%BvbXX%FIm1F?JGHdiwEj?tr1b@8-*ZiVWC}@hPXS}-bm-<jYa2?o7B2ogL7aI7x zP!os|w^(^vB&t$_ZVLW}RL>+-sZd1Mk?P5ER2`*!_(oPg>evN;``R~j47TCs1S!SG z_FS`%A_wG`RvazDrqzooSe7a2F(1+bTBOb3GYxcNPPFh&1-fedJL=+J9X!Un4a-gw z{sj~rWls?^q<o<IFmPhPHK%hm5aXTJ#F>z9A_z7Sf~(fqSZKcHDtj)NCe(|G<_1|r z5XM~Akj;&TCsMc|lWDBi0}XF5BxvdTs5UnmW>sx8%rco<Jbs#6Dp~?r1<qFz8YZ{$ zy(pQO6-g2i8Le;8Fa};Ec_Wia)T|D%Go(eslrA*P^@U8<oEVuQljDVsOxBZ@$$E24 zbyQ|F>}t=>Gte;PVRLYUhLdp%Wy{M-u-2eqgUtpFlSPkdMomd3kl$AdYeV?4!G7#f z4K&Pipkek|2EnCy0zW1+ta4PC(eQ|j$`gd>rOJcBAAvFMei3fDr11e8!&`i-nFh#i z7wVlD^*U!PyJT9_dyH{%szKgaLcL+N(xVidP;VKi7dG|SYDge3fCtni+7fTl05yfS zF((>iVND@dscQbU;FrywUGU2bfL}J{H{e%u!j>M7DB#y>4zUHg9VPHP0Q?RL#72N$ z%;ABJq5K4X2LXObj340F)EVFxLZd3A4~Q(b7(w}rBEsIIXz&Z|Xmu<LQ4IMG{2P*y z7cCC*o$Nc<4{Z9qgnvht8BP?ciB!t%4*p#eApw#@57EI6*fjpds<s#YZ8g2D%pLr@ zZ<BW8-?m9m)S^kSqV-)g30b_<qz?XNb5`JAkpjY<5Ag4nxKSG!`3e3#qEGOzREq?~ z5&Cc9GH4T(X;L#Lndc;%jIi_sP6u5{(F{je$BXVS&o}Ez&w_u~5y`^8Tlx+DEd!;N z6Y#H>mq2;p-_5|kCNyyF<_`R8vf{dYAPfB46w2|cJl~WI{?)=7QD@5$__xoxl9LJ1 zUKFvWyTZRfZbV#Dd*I(A!j7qDi3)?;-O(=or8^UGmc+bvy;~w#FeUuU1&Ld^aU^cl zr2WNhSJYDSXCr;Rh91Snt9!~?uJ0{t<Asi_)su&mwMoR%dXkVx%7O}CSjvWsttR0B zkkanpUjb85P*Sl0C=QE%(Ur^i7h$7+$h#f*7sIkOdBVTLz3^}Bd8K_=<3nCJc+<;T z2;v3tuk?D85KL$L4aPrq%M8p&T3*~T13N}zDGf-+?()?!17j-`4weCKS*OXF*y=Pm zyD<X?g0yQ%>LfAgzINc%E)Kp4JMfYXm;)=4wT@*65JkWkrHE<~$U$b_G6_rS-!ch< zMsAse0S>oJ!YoNq`Ab&nTPERKCgB~<xLYP+ROu^i68`5e!X&K7iJORwaOA*}NqA*p z5?*1c0}5ir(VB#{3g%MP35>YV`ThwdIdjBB6Bj`$-`NUFJNp^ChG7Ag*<lUCgRWs1 z(<FYXFbofN#6^%NU+cpmD`o6+vNH@DyYQ~C2qJX!09Z+@e%lycgk9JPC1n@JBX7Gf zOYCL4Fg?AI?;jQs&b_6u2+E`kt*g|ao3aZZDl9?)g>{ZSYHz!+!y=|YhA;%_V_SiM z!o%c0dO<u)@Bo&91`o4LRSwP<!o&ST;9;zD8(|k7g<V+oC7bP*;V&9a@Ry5MS)R)3 zHSaq%LYD|mp)1^(=+_ODADQsDYzxc)<A;-1$%?wg%X|>bp{qPRf?%=P=;CQiYKj+- zKY%%+IgD3c75Cxd&TTY?ylgb?+i0v;6e>o8TchzL8IAEW-iuc@8I8RmidM<_*bSk; z)D(_9r#@YF<Wc%AqcMtJMLL9ncX^>>$lyX4GW4cGDCFtn|55D{Ugn7ip-8?thQMR8 zFlVfIK$wUa5)G7pj2J3?n~#=^#swqX22s3Svk~NoP0HN}t1%J&DoB59H5N$0YK;GW zN4&(<6e_{Z#@y*)Zj8oZGwD@$Y-Ba&C#l(#up48rZ5Ko-JV=m+9G0^Ya*J8SQbOAy zch7ti&+rKADw^{!XH_T$Md_sNXMQw-83^cqlwuXH8nFyAXN^0t43F}7947NfHN==p z7s-=`Ri_xkEciEriWFz0iG$x{krrIDMOwqeEylAMDO;p526LKZL_g%T8*;|-g$%41 zku{GN@916Pery0HDuF@8=3YS7Ft=Hg+`S%+X~aQHA_J>dy3|fHh=$o|0G=r3sg1~z z1cUYsExid^<P;GRDJ%<ClsL=7F~%^fQLPAqc(4QQZ2-3H-qj=q>hMh}5`R&>1X$Z7 z2kf>@!hyBiB<$;GFMQ`a!ynEtWfB_^{qR@>KfHa9*auC9>TYbmP!N`0jKk>$B2`yb zBlba=fNA2YY;~2W?fjhY>oWbC_|6d|Vb7Q|dD*7PDt~9>!}%2Wz-K4!fppT)qs+eN z<Thx^lhHQ?J&Yy<^0HuVgC5TD3ei}!K&j$folLtZ#*Z9*QJ4w*vr;}9VaSRq56 zSga(IF9Jrw5~XZmX;<%R5|&7=WnsxlPpzP2ydJZ6Lj#W2k2m)elw4m}e7k}&Ug!u) zJ!y+?BPgjX2}-^#3CbiNB`;H#4kIFQN-4`*3i%c{&QrJp_V-@L+}j2L9V*;`(OWk6 z7R5#VgCKU8dyyXwEKTO#{$A!@$76`sUu3w0^y9L*_wz45wzbzEm9PkR7%Z^u;3dGe zq|2R^3EK|3*cSM6cx*fDVq46OG&`{Eup9J1kwi&JP>c`-=v6`2QG;#Un1`rYAyMu< zI!pr1o`RPJ+fv_+Jh1J6cEPcR)J@F8D}Ze`>2SS2wk;I%aHL$uwp!kx>~WaNwEK>E ztG?vpZ*>KuKSJp9(L*?CF7W)}U}~|g5W|v(679D;=7CL0mw9(*%mZ|!RL7f&`PF34 z<fwGGug6#}LFs;LV$Cvf$$<*0zOXJT<I+q4OWc!s$&i5H1YxC1x-t}m)gdF)V}GH* zE#eaIzwYpsz%A}GT?}vwFylDz4!9*E0^MYA+eAc+3~u!bL()V<AT!Zt`^oE!o^@rm z)XhR>uZPU;Mnq7$!0nREZsLOnL_}C-5B8GTdQ;$bf0@k_0dCuf2(BzeL>S>U5fKiL zXu$1?BLU`4GmAbA`N|A%Mxi2v8Pc}{7+Y}bNdw9$Bm(585!WAsTmQVO;Am?D&HI{S zEr<`^us+rwBQ_|5Fcy5inpI)F(ATvnfRi6ncyNPxk5nsN%)8RTyrd51$Y{MKuuBXN zYdcXwoI1+EBH%!pXRw=S-MxQwPADER%mTY{Z19uSnAn9CdcGcDw~*H2$QK$Uu<?jC zqNvM|A7FPhR&*!HSiNM5eSHUm-59wA*af4olCtCx*{7Wli=m)SA<wl-bPE`wag)&8 zjdWpObJ8-`5@&ySSjl8J5m+k=Q33BRAzh^PGORT6H{RX>zEh}!k3Ud(4fx&_>aaif z-aFJG*HQ2t@a_1PF8B_lyRKQvkdGSlpknQ7mK<RxF&7_;b^QYA4yq=~SA5?^x;!mW zv>^`F4Hn_LVx)_-(AKFI>GG_R?o>$Ely|O)@io%*a(Ef(njCi_T@xQCdZYkfBi*LF zok%x@_ZAB8J;y6~MT%zhBuSCAAQsY{?tye2K;sU<2;M(H$PzsRbn~|x+@L`e-D(Y? z)u4q7Viu_rFpF=2bR)Py1GT^8>`G0|gvPar?d9uoYy&0llA05%1tNgHLaCXArMi*2 zv_QK1%gc0-e6#EJWkb4$4QzP%kuHL2IR5?<#pcfaZO5?EcDAV<+qu6@_xB9!J+^0H zufZT1V1aZG-rttCw4G^;wU7k|4z*j|KDo<^`&HiE_GGePAPN9l2U~H!iksU$kdUs- zCfTcIbDQj|Qf<=8=-p;>8zS7w%}S=-)z*eHH0DO6US~fDQe~v`5|AqhXFdYr9wMA! za2WIL3R~K2ycnYVB@!D*8^Q`*CyUM;L7L3BPoh3-zC~HYL5w`v8gPwcKY*?Uj&Rw^ z#mB29oNGBPoQrT=HsT6tb8%tBUBbD=eMTr5Eo2aE#2s2E>J@Hj$XX*V$B}p+92)Xo z08gNSnf612bFDa&5m(AaNOWH#u0=TgrLm~s*az3OO>ko$Bd*>Q&Xtx{Ev|OSHo+5t zbCdnhh?_B4$nE|2!Lb8RwB;=id*EDV<ne_OH})ec5+&hWZZ}3;V4v1BHsX3Tq+<bR zJOYN)^nux!u83LnFgJh}-DxD-Sj8$O6qpDr@bc*}h@w&nRiqTmb+THK<AJqVMdWgk z>|+?|u*bIhfGQsA8={_;JuFHRM(}rvW1>~uI?s8Pr&1@>t5O9l!3PuY0ZBqq1y9Vd zrWj>II1jFg%mt<BHFTjx=5B*-vKmo2>bk+WD#95tD9(0izytp{q9tt8hU-hV=|^J> z-lCm$ZZr!y_2@AUB4YAr{$nj%pCq{6wM{?Pjs>tj0*&D!s>e1hk4796udEFe`hlET zg6r&SV;Lj^mL`;%0(uW^XZF_3{q4*NeMjzy7U~ieyBmEQ6*v3sY`P3P^M2@ibqVV3 zVQ2O(*xd_)WM|&dB<An%P1?`Sj129dZ+rNb<#vcfPC(gdX+FyYc%Pk5zj<3&njfDX zK|E!qt|I~KJRM#9%}fb@6SJ$ik^M+K)>xX;F1v-L`GPFX-ehP0!uiJ1JXDM^xi5Hk zx22gp5B7WV+2JhC4NR8i^Wv<gJn`017MT+LI*39=5=32Uql%2v&F;DjQJwfpo9hU( zZukrGf+X7xNi6w?$!|CQ7FRX+yN?V(4DPYHZdkFBwnR5UFIg_S5`DOAX?~k(ZlpP1 zmo3dnnsa?`X&x_htQLAwZB-+etQM|zNt!1iE}@>fbQn4A9k<Zep0UL!tX{|1oR*=s zA-{;dbwwCMUeMV5vh1ys)NPH;2(142f)9DFfA~u>#y|!r$zF{hx2nOMgP%{_S?G{b zz(=GH`JtB|w;S5hhy`vRE-chK+X=>|$udtmFU3vc_9Gn&_3%YosCPzR(Cn~Kr|1iQ zvn>y__+)4V8C$?!OBQOIptUQH$FPmd`{drg?9mt0hq@9ha#RT5sI#8XA;dz-U)AV~ zBM@P|uZ0?k-o@>jd*~A@S8OeBjXPLi7xpG(#|U7`hj2R|f!k4oDeQt_UN&-}zjvFa zl_iOH_c2W$Nv7#11#D%a^qhYHulYLS^B~hS2O6$QB6vjs*I5~bQnN;~2|9sxz?QIT zGEUoU%@n?{aeBBgPD5G-?MudKjh8?>LNi<5Kiw>aoRW&Z^`(~*Xa{q5jMEd#W@cis zT~8W@#!~7+%r|D1VPj@N)vD8ItH9kB^LkUDT}n{3xY{K#?}5-VB4I=uj_}Vfg#G@; z7B+&ZKA#}B2WV$VAIHEec?c<jD&371v}?q54dXQ0N8g^5k5VP3O_q&u+5^O&WSo8y z!`YZUXzoz6^SwsI(T6>;JVjS*KnyI;kJE(c@?k8mvcdAQ%K<hCS`wBYG*}+65Qqb@ zty^rlUtswtNqECXOJjK#hb5z;Br<MMYJ=s~{yMNcX>A&;A)#O_5A(EGUQ5<}v3%0Y zRK63-lPibftQD^#`rzojZ0?VOW_Z~kJ~6S4oR7`Do1S&Y0>rN-5TBA|cn~-VoN<=T zeFuog=1!$?0GfkEJmZG(IK8x9n6E5mD}ng+SJHltl<vUgJ?!WEM2c9??1~h5NrG3> z?nQ`A+ng})cTD=7t%8#V!HW#ggnXQ3^o`(6jBk?(0sfm!A&LxnKO{CuA~A%MzKEi; zqLr6BE$GgZL7&2cp7LZ+<OQY4*wm`nbaZ~c7GQfM1Ru`8Hcy3`Z{pg8;7v*wxVdIh zGJ<c)6GtTkZ?nAp0y<^e2wpt3NekkLJno6B*pUc=Z<2FFtO)*VXpWxFktoT6F817w z;5CR1f*&v<$V4G{iN+lk^uvhvu4t#^x2YL{;MWc(+I7;b*#9dP?Tc0a%~;S=tjOL7 z{-q5U34_DM-3VR_1!1VKZn((b$ulX?yRvVE1_a+LB{GUj7vd7uEWooa-Jz72&fvj^ zV{%KfiDJ#+#q%|rY<-qFP*na-u5Hg*wEKI!RLY7I&+4tBeT521o{JWw23h84&mH6O zpU-nAft!*Pu-gFE6x*o*8;E{*Lz{M8VNL6E?&%Sd&_zjnq*pq%jDM*haU;;31i6J0 z%1Kr$*CU@wMq7{kt*i=?K9p5_oQ)5>U|h^zAHO&&T4Duetv~rizDN`DVg2egMpa(2 zZ@;9iN|=*PzlrA3d*vi%z?CAI2GraUM5QHLn-g82A82t#=~Sc$ZJzBsxxG0?o>4GQ zo=XRZ^7VAQdsgqpS4Ow_s;NpPM)^tz%eV6k9UnZYLF5~+^UY{<d!}&8NbOsW|EHo@ zd9PFP^3>^Ce4{Ll+qLomXefJg#{6=9n(Pa8E~tU>ooki#r?V`(STjXex&QNji?|1F zY3%h$@?Ruf`pqZ583bi{)N5>*j*pf2San4|UyYvP_l;lu@p(_5Z}3cZuJ(WEC#v2L z{lt9u!+z~=%dqjoKx{poWq<w@?^V60&=td{5asOdulnsBc6&ed<3Bzh{PMkj<9B}H z>EHjgkABDZiV{;rgCF}_^YSUo`j}y!B4mZA)u%K}8526AL)Ge?8U3qP?#!6Es=PDf zB4%23Qiu;vdYB9*<9}Y{JrQG^WXr?K%~1dDm%sew;U!`oFi>W<XXAQ!E$G~-xkzxM zKwvnr{?|N6&e-exq~xn2KG}qI@^BWVio_LdpasUIIiYmfgYrkP{N;w4zUsuBMLm8q z#prtd&MR1-p;D(4t;hGB>es6ZQRqjz#?${eVs!{dV8TyUeNhnu*q`2yF|+DjMmh6g z;v%2|N{7w|x|!Fjx=NH4gB8)Lrka$p;ff3NDYU~Y=rxvVn$&bRU67w!-~gGalg1}1 z2=#G$Hn}TPFV!(Jw35v1p)gYX)bH~&1tn_*)`-_2p4KiAC02$p0A5#l{@_7mzy#-= zhTziF`#G}l1+Fh9!s%utX5!+F{7RKSaTjawbm7a{6@HE1pNFJjayddg=A&fTb0st? z-YxoeCfG8>hSwhCy--Yvb*QEjZ<BC7gQ(?A;+O0}B}Da#PDz=lmY<>x#y@6OnP?>3 z#?MajK_ajo7uZ)psl`Qx<2Q7Ob^X!b&FU|FfgALB`m5r>uuNz5d&mGa&FGZ&Vr2EN z=kFkx>(_H!6PKA9y;Ohn_w*v!B!4y6Z+EIsr-bNr;gZ`6-PiqDR$g?quM>j$ja<K> znv9H-6^E(-pDPCDak&WiR<k^(J`9*~i>|h}AmjaRk(PG9TSxZ4b$tI@q{ZB?z<+=L zTW9vab$0(--?;y+Z{Gjbh5c{cwg0WV_rLXzI3#?(KL6SQ_t>el?|c8`fP24wz`f@W zxc9jO?)~Ng_x{xZ_kQbud%u0aJt%$OzJKX}dw+Dmz4uE|?85>dJmB76Kj7Yv9B}Wc z1MdB22i*Iq1MdCw0r&ok1MdCY0r#Fc;NH(4aPMOW-20^i?)`TM+<WeTdmlgG-me{S z?^8?nBzFT-NCXNs$o(S;iG)RVOTxBff*wI-%}|J_4LyxQsO5>FNQv<C_sz3Y*rqbO z8YRn-^%)8C5aL!B#rQ+glt3LFO<<gtfeP}P6N5-Sdr_J7sgVB*4dwNX>sRU<zgprZ zR;zd{jxOcf8@M5rh;Zi@r`tcLU$k0bi@bP|`_Gm4>+46$H(yb4da!xT%7BwN>d*PL zrjX`#UYDty8@<cmg*XDQ^FAZNuOrv$FYNh#Tl}KH9tDo;&;4Om-v(N!uQO;KYRXZ& z8OdLg0b#Fy)U<MW{YW-iSskt9McG?jS>;=Q0LrmJfEn__pP@C%r2@di?pxoIv*OtM z)}Pw{*7<DTxBlevt$KK=e)0;9(P_<Y%r}+Uf8ZLGE&gOS-m_U3ihV2i*5zBfD|l_G zcgIgSS3Y!ej<Gy{xn2cZh{V7EqNZ6{U!MtZeey&9;9u!*s``3W#-qT4qFx1b1R?|P zetGz=Hv)bHwpfLRX$@q}^SO(*Ew~u}Q0#{Qb$tq_+YsynGQOjD7>M|KlJxO$=cU<Z zGoLghSK28|G^q+!Li|bzpbMfU=Kb3<a!e^LrryFXsMDo$k#2wHAm6<HdM%*(I;f@^ z+)jJGUT}B7UDm&1L-`VJ&k7JYZU^K$NO`sXdh9Mfw0Z@c*fwB({Ee83GcyJan?6Vh zY^qD0&^m&6hU>EpT9P+ie>01)obu~4ND9c3^(UbQad$>0q}dVqopF^v%<4)j=strC zs;jiK<uybS(e_obG9Ptb<ye#IzxGdiI?RI}MR3u4RfCvU<0oc3N7>E$l|qbGX;kM$ zb<9Kcji5fulhtlpaSW%n`f_o#>Rm!oKp&#dRka_x4jaOJyS&PRy1r3reXd3xY4#Wr z6RugnArU>3BYVU}5pt4GX#W0K3q!xa|8|4<?Pgr#zEj8Mwxmr5VjMD0!g`+UwL z53I4^B6OQwffS-)*S1DxGONEi&2a4|dD7dy4$jd%Q#-T4tup4tmv{74MrJs`xAy9% z$VFSeon~DpJ81RH$jdZM+5Ct_p(%W%HRNlqxfc+cctm6${n6S{U4eqev!hIFf3{wq zh9dL%MAXo){~bX7z6aM<2>6A_#0Km2U5{U?|K`8RE{O%0;mfs8T4xkhq1mBdpVCke z2g1okj4I!Ie35O>u^HOhxuJ8GED|n?BS;xfW3VkyMKS$H<`TWS#&T1UV%$fBj^W6^ ze1+A!zA`^oPR(?CqyFs?p$?lVaiFP74dI_pTS?!=si|Lo@e1|y>y0aQdEY7Z>J(jh zKD)d=>usg~t#54%*4Nj!2Krs}%dM@It$b^%mzi1Wf5^kb^{w$1&!9E?^>2`*Yh`j2 zYI$vWadv_xP5N&8qIP{_0Ff2zqfFZ2WPfmy7dV%w!T_F4I0a<!W4rnB3}SO~qWSf0 zc{VxT{6HT~jx|42!dCOcFC87%7=YQCI(pM7CYxVSbp0g;bj)b6<fp0g6Zd5Qk!Gu| zuFNJ70dASg<T^a@VGYmI;0h+Xnn-0=C+^w!9^@3MaX&aaq5Sp8DwXjTg2N~r;ozXJ zYjpn7Y^yG28)Cgp=C4ze=uB1gRmJd1eLfXE{2p3#;+|4PuY?%nLKI6neL`&{6rn@r zYxDs95#2Q9a)eSfyoVOPR|y&}A}K@^B6|pBdIdG2E5GAoaQ@E`x44eT-Z(Wj;S898 z6ZdF$@$?Z&Ix*YkRT>J%kQ=Z%!Ohhh^X+?9-}l}Rw+)td_|Nn2p?BLfx$h=#e^|#x zEZ$`McD<@|4p!L|8$DgAS02I~)~9n5zcWx~f0Fw$PuT;f*4Am7$Q&X+3VqWucXFF) zLU!PH)zm@tqY2)?QMLURkBl}hH{*h!y&k&DlW#5d=2P=k!qu|-RiX(|lt#n;2~9aQ zUm<aR>64mLF2;3coftJSJ`O~`2kC+y<GDPweax;WS{P45CUp;;OZVlGq44YPVy?gc z{T~=z2ITSi<Q0lsmw;Q>vnpBcUdTwvVm0FHsjT9ptMhYefgY+k1BMMGmz8B6hGhd4 zvWh{IfEh>yF(wq1zE-G|Y;A3_$|#9C=q?l!(xhhd0RujszTQM6+mFm;8tCu9*2Fh} zk#af%KVY0bE<U|jT%?7PuyZ-o>9;oFa5%_6%yA-eG!0}++j#ymoq~AiC$SpLi#F0I zX0xDqD{E`x`rBza$t)f~LS||V&(Ih|rohmw5B2duLM0j<5TdEHQzbb^<yTa}Rn}a8 zu&I_xV`SU%B{APcC8~@AFkqp+0>u`TH*&MUf5UGoFP^NXC#%uPYK&D6IG9G~?(Fq& z(x^HH^)k+a-e4ht7jY&9dJT~QSB^kEJSrOy$t@-P)rE|ikc>e1(`HF}o{8OeViGVD z?lf4_*H+)WHe7n0j;fk?lJ(D!GowH$G=gNm5)T9sRFgL<N83gV-U{~$-!n(~$seYk zLp)$AmIjPHT;s9N@T6@_ALN?0s7OHExY5&i>B0bV&Ga2Z>BJAE7t^3JVVbcu<ejSX z@<BWDvoQq3BoBd}vcj#6Im0g>e{o^!4O1Mtb0T~Ssmn~us_l;AlX+FtPt#qLeSKCN zR;}wl$*oU7e9$is)}KHi7AhTU=Er&R0nF`B{X0Qv7z2Rvi9ax`&g&md7ja?gBAD<m zUQq)>N7i5RbD}@KQ69JI-{hOWJpTte_NC0~FGgvlzSwFjO64xq!N2u&l|21K?sMl< z$#M(b9a^c-jI!s4=~`C*whP!SIkZHTyGm7{l(CCOeAZ8$RCUpq3|ufisVY-1=~E?Z zapn^h0DTOoMm^TF<3B~G0c+qTK<@)kBEO-*4;ZmG-^V^@!xr8A9Vf?cwF62^lLwfG z{4&;E9fqh5^LvD5Q7Lt$TI=h2jkaMyrt5fPl(mMF<TRU{D@ScyJP!s#_>9XeAOG%; z<;4j$urT#cbCBC@XR;)m30uQOPwd+K<nnfwlRLMwoYHodlWm^**GTgC?NiI!S(+E+ zUw6Ta7Y}-TviouRutl5>B1hdJ9^n2{2iB={&&0I3RvN3O4(p+g=($bK&aD3XYt?Pj zU-K;7CZhUD1g&R~4<;-8L-P^m4}G6D<TAVUKl{jMK9WC35!_dnbn=%x?$n;FOtjJ= zk4)tk6f8X-lH-<b34l_>2_}7=mq)HgU=GtLa&c-~A2jE0ghWVCBwsL*>iUh3L#_dq zmwID_0+9Ct`iJLZ)|$T>mg)M?5U)Q##NLKBsmtki(u~{cpQM3X^vt8~nP{dM8#nE# znwb*4?3gJG|A?$zQ@r$|hP#>MX1H0k(QmrSb^+`=hzf^0vI^;ZUu;t<wLoYe(g>fB zR^q=Al*$rO$BD`bfr=WaSfs01azwXQnUqy0YT+a`g(9vZ`{y|>7LO{SGWdX`S~(~T z8p<Wt&>qM?hrd4=8}V~W@rr_;5Hi=)rC>Gk5~*e&tk<tNe-sWWYUFy_h_Bp52Q-V- z)uLHPG%9KqegO)aR;(GDX7M|kMK}+-7?xjd7d4JpNxDJIb4ne6@>^<949<3ZG($xT zefE~#RRP?_kJ^MHwkHEH2#Zie9jWWNJ)!a)o$akjC>m`|T8(MO96sBI&{Z-?YE<?d z{b<bn0_Cea80CVeM2zf9_2isZG0I20wlmamjZjBQ?`~0AoIKzrHYX22KIE9HP6)3s zp-;l5W3jEH5*6x5bPw8{(bsf`wAD!jtFdK?RT{>chR2ee<jKsPgT|%~R5#4<PNj|S zTpKV9$2@Q9+41PvQL~wj^QyLV53Jgw5<W)k5)t`U$3+vX3cTUmF|W-4rfil%bo)>n zKb_5|5=nFIS)Z?jNP6?yiTX2=P0&-^1+YN=h$H@ch_z<T-Opse@fFOe?OV4=9z8xC z!DGU>&LuQI674t=?Kl$cI6^CCSXZiPh%<g)=1CeyBrDw!W%%qLi!*;S<LLz>Z30SN z8GYfj0I8-PAEsD^SyofIWbJ@d$Mnz!@|rHjVO?ZHVkwVdPP6nlJ%jjwG?A)jqQQ8G z0~BK~OS3r%yyzJxDpKC#`B6=~d~Mo<pL>S%r`fNB_#RisHIbFvc%H60hsv~|h%>sF zyA7XHuvS+px|(ZoxNFZ6$dghaJ0)Mx{wD=9q8k*3xOVxPj6j{86_i93vZE~aERFb0 z6R5&rlM1bJaaQb{Gz`{{QXTD75q)^AQ^6B5vtez!#+)8`aBYODK=EIcu(3Hrp@-1B zRxwUEp|Ru^L*#Rx7*3fmwMJ1PmcU0s*=W1c5k)#~DB#hdyjGwzl$2R&uOl5DL)LCr zGNmGF7m<!5A{`~QS^X=1rj*pwcBKeUdz9s-4+TTpX|WyKm8A13ko}mI1oa>qIe0k& z3Y5aGnJ<PByvsaFlg8u@sX|iDGD%=O2^Bsj^CLSY%aPa^)RB`RYLld#A#gbb0O{B{ zsu0lB5trIorbtJIRT@!XV<9z}Wfm_|<6qS#AyYa{Vlp~Sl0o&fXB$R@Oc-57Ir4E9 zu`HK=<QI8caNFay1FZ5OxhSmAVzZ`5OB0zfvAin*$qeyDnmF<V_%sA4hyz`i9w<ns zA@J;l`Ehbph>xs|&(GP&&5FrvR2>)Fq(cxaATFdc5O!}+3N~_hV=CyV8R<S&hDX&8 z;$<Xyv@>ZFq$VD^Kt0^+QHi*SC0eRa*jjVF=t3g0kR0xjo{^5zide%Yz8SNk+n(M@ z6<leAS=wLkvsQp7P$SE=YSoV$G$d6QT3y?=M$HLW60d*}D>a{h#dKMBPbGl$;Nk?V zJSnJAy(1+QyaU)sF@CGnk%+WRMJvjh4jhrB4(8a>2g;Dgcy9|T-dZ{VfV*fd=F2;4 zu-~)Z5hh)w_vQ3Hon+gh&;Ehv6ZZi9I|zMBme#w`=hBP&p-&W>2w%Y{G}Y*{-$9@K z&L;VO7kyG^Z^qhtRxXey*Ip2L0!+;jMxF$v2gJhy0D7MyO|u5#@f(Ook$WT0rY_+J zu#jrTq=`b2NCD1>?7GO4XVlXM<-vhVfOrXcS~>}N5+_bUayqol;&(J_f8;rd27%br zAYM>|D6`X`mmYZ%C%;o*sgD8<{aVOVegu=Occ`|=lM}~clg&QJR^tm8(QE^GB_WP6 zgN$;EJXdz=2e9EGk!Lljjy;H=7w<E~n$v)nq>yUir6|D1Cp|tVjaBOoOnl5c8LLJw zW{#_b4*>AkvB6~l6>DIq^muhFP^Z!t&gsW!wjI4%i(aiTTKl0+&Mg<}#1$aaNw`^d z0O~9y>qZUgJiY^U(o>;MX_^tJbJ(KJ5s0gOYui9Gp-yPpi{)|Uc8~^1?Z95Cb^z3u zP$$31>BVq#P$xf`zIcgmJ5eW#BbBc{wy4w8x<H-SC3%mI>7irQadq*yWTC{^u|S<X z(LtT&+{qktlu)M%P$}%Lv8|7G69?~XlKLZv$=xR-7#?ua!WFc{BF7VxbgYG!Ja2ee zN-gr^^xQRo2MK3nnju&a^<MB26&LW*(y!t%!N~+KqojbBeDA_bB&rA>4{%i;3@?#I z#{@4C_Dk?`ybLcHADz2}zS2}Os?E4H@KS}~8bZvn!-xlF+ot>Lf&oIA$Al3aVr`U3 zdxbLj=%P$d-(wIZ6@ayNqs(ETOpnH6>Yhhq2g)oXhgHOpDA_||H|m4oWU<);Wp0bK z7C=*H7b1ijplQLa)vE>5c&8v4?*y6+!b}1m`6>Xu1T=x&U7+csUR$7v*y;#LrV;_Y z18BbdO)?j^O<Kmj4bWu5Hzct#gf^2Yu*rwOW?DG#>uqvw!E`=)OJMVaq^{`8nL)Z> zlgA_^<LFv}&Da!g@G`7U2yDU<ELUrIA%RVEmC5luLeyYWmX-j2M>;2NU66ssFtN*2 z7a*fZg_gi3<({8!o2>*kw;KlKP1*HXSG8c1dkxqew)F+rJkf$p9Z6}?9Wul{>Vi$` zYr*DGz~+(+gYUFU?pUn6MUi`hO@lp-i6lqBA;2brRuAq5n=H(ik6YaVHnq2j30wx7 z<F6cS;<6zu<vy+Y6WILIuOd^Y^Xiu%;|6$^^@Yy&MP7X^6F6xOrob{e>+I>)f&v#; zFOZ$jPST>803gtwyvCS1m9A17h!>_#Ejd{a!+9N3Cm5}<DY6z5zX-fr;CD=&P7xqe zr#Da|10ixLRuqUti#Jxcrp^PKMbP-7S!^CtUV1i?B~#}nXvh{=r;!g+=Z(EhowQ^$ z+l&TvO`XaK3hv~#8gx_n^bZ7tjj8j9%3oyjAg)KIPIf3};FZq;IFH+;ZHuQy3pK%q zaHpO3WN|#O8ubbvhbA5qorDEvwaOfwHh1r1@x-mWx5d*f?N~f<!&cth4GmodDNJPg z@{;%lT9!x$Bm|S-)Sv-M(bKF66hQ@=zoe+H#XnIf&gYoX_38w_j6R)R5)eLsyEjZ! z>K9HI^=qfSlTFc_lBvDX$=*4rJar@+6panS&WK1_*gO3+meM`!om(yPjJpYWHula1 z@?5fa9`D*a6Ed7{Mmsj69h=dP%|M=P@(g<?zp+-RakwGqs>s7xSd2XV&B#+Pcu}v# zk&LSbl^Cu9pqgygMMdko?45GWBe$KHS;!M*m+YNy7lxq5I)@b`6$Ey6+dF0E)_h~{ z^tM9VJ7vlYd#7ed)0FI;Bprprr<zFF(Hi?1G@<CNuy=;+=~dg+YB%X929Il00>Sr` z;An_<lhu;|8%A>sqO$2VX2D0`3>rn!QOtYP1-;ua@@Na#7D-1NvtR;jr39Zc><3_b z#AZQ+J!U}#00dy`FN~X;0tMnfkv6On=+nD;H#M@&*fr=g7tFI80O7;gm;1szj0deT zu}|OVc$4GPva&rfadRie+uWUH$il2ie1u5D4z-N&SUq(yUdr)FHzY!BxohRp0^@yE zo0N=+sY%9o-6qLUtED+oLBz^{@o@%uC&3Y>#K(e=-)>W)#0Ozk7B8$3c&Ll+csERm z>Bcg;+f+=CO^L^9n-b6C9tl(8MAe=Xx*IafMt4)0_KpR*GZmh%jv3vNbF^cTmw7PI zopX(*f*MmI0!#gnbsw%i$H%c`N<2?J9aAEkz*BvJ?lzqmA^>WG?#z@6bSL6PNNU&` zQ{wTRro@mE6;Ug)HEQDL5fj%Fza#|`DpP3~T05e|R+9(Bc0}gS2QN+~*bZ+;gbb4% zk>e5q+NGiudPM6t4ee;ybiSqbB|Bno4?7}vJ9b21ak3+h=vg_vS1~qU`_Rr_?64y$ z>_(IOLa<JFsfBf{p94QBo=dQ975SF%6TbsLA@#*5f^|DR*a_D8H27r?wpZpYiUNJ| z%t2^#3D#LKNhV?IpdkF9i)Qirg<zd*sha*753&hV;tjp^GQ&E1uv=NB#QZy8-FCn_ znG;R9&S-a2ur4{WlR0r?2dvxEoOn1`*Eq40IZ<S^FefJL#>J~(Q0!zlxOe!iMR-I< z23^^Qc7t<3b{iA1Q}5%#-f2wS1Jc=rZ7e597e+j4Y+cw(kj|2<H47fy8`8aiF%j8I zXIo>UB65_w(CwInF%bv9$O;TBV`2;G_^r^rB}iw#iXol9?S^!%F|mboCfR);-3IZV z2z0x^1?d(p><*-}dSMm5H>9&|7#($Kr@#7YGA4F?)iO%##BN8!WesEdkR*9@yV%W! zx!LgrgtKS&m4a}SWeCTZ$bbl&YWf(-W~`PVT%u(l+yVYz(Z#+f&XTA_ag&`WZn6`_ zHSjHoR3z90p}b_N0||FgTyhB~$aDx4_wqN%EaHWQg!o=4&I$oxup7xWNM6a~9W(HD z8!v?9aE@EV?1SWFv)&WQ;S^Sk2<wOB6gHA`aD``m4<y%h3ZG9-;lm)g<H=4psE+SI za+@izLP(B#3p<^W9Q6f~JJRVwgX9$OL;fEA+D^9zlH27JPLAW`6h`0dh2#v;NCZ!u zO=F}x0LdY?^x$qI9jnP*M!GJNo9u<;d}zHC;fqId!-V9p@Fyhq&3NGtibq^>?27YQ znkpo95jiRYR{fHAgljFu`}Nbr)3@&7k9B{1qVofKu$fNVAUb9`nPRa!?gUP929%AN z4vfW*WTrzK1)d{87i>4hPSD~xej`mN@{7I5YbQX53iRp^^xjk^;1t<*wTNZ!fF59x zs_}|7DV5Mpp4kEDmf9si*R~7c6zw9v1qI<uUbKtf(XJc)J%Of?oPp*<`%18V1fa9% zZV~3oZl{yywqV?2T0hH92;4Y0{}*<;qax>Rj9DeRMJ}Dg+UXMbK`zT0+S=)k?o<{> z@ekvSIE0<9vC(<97e+dM-XK`_1ZEFgGBo7@^ay%9z(~h)S}1$j&@s}<eFh;ANcf#= z+7|JGhB~G2#+|}PGSrn}AahP%$R!M9$m9j8^V1or%611P9%)fs+&!G3j^oz4s4fB% z_cRy^TY~D?2^NOBfOBdbo<l}N4B-W}QJudT)#(K<ptS?1HPm5~72P65^&Z=d_#;Ez zl6!?POkt5o#E3mA8R{7S&tng3EOi9+Y2vW7%2FqT6$7e2&cL{#Z}9jFo9g`BKDIi= zRX2D~%+7xV3)qG1ZNW0sk-(``@Sj#Ty{ng|8ruBo6SBjp7Z@?TT-T#=qP>~M4x4a6 ziH43vjTc)umR_cH^wDrEZ$bnqrL_evId4DR1EcZACwt0i-uU`-<$0u?T7wvSzDEP) z-FULvVGpzem)ng8_tS7<H&Aew3zvcsR~^e<*U))MGc4z>#3r+%to6uRX<>^91qxd8 zAtT+%os7OmQuA0Xx(p6|B#7arY<u?Kwu@6_O!D7$n&b*vpjz&1Qn?>cO{xMV%;YQs zRZQkxpn8yPPf<(?6okwOa|&E20$|wq_!%Om8WSHsKik8`$LHs9afmJ<K^gf>QoD?N zJa=d#AJ2ZY*Rk^P`xzKXPTW1reCFJb_L7~CFI_h-Kec31aKtl?ux3}HOKWU>DQr-o z76^uC^mt?J<K3^++SlQsuC;GT*d!d;vGyrgq72(#$KV&bcaEExou2G+VYns!mJEJO zUo!Y12le1?n7DEvOyscJfQhMSB#I=6&yfgbd9en+fql8JQxxhSW0=S!nnCQ%1wp+k zVPe<rXPDTr`yC1<#)@VMCcfNuza8$}7lw(+oqH27aoO&tne4*EJvXo%5+)Ap%0-5< zGj}H>R45^!MSfc(mlh4J@o(9M%UuP@$iOmpVD$~{Y?;fIVPCFe`SEWb3L@I@2ZA~n zA|j@`5K*iCJ$<>GEkwK-U+z((w$|_$5OESvbrQZ@+y7d_U)lI_li_a(BHF}|41Wl> z1Q8GP<?b;2ElX`cA#lc0Tk$D?a`|$Z1Vco<TIXOjF6;{t7nZ-S=hm~lhv}~yM+m6| z6dWv|AbRAmP*9KV0|jM-s~J&YNI^l5K}U_XP%zAjM;${zDxE-t7^!!J^Sx4tur(Aa zxUX@2CqyW>`Tn4A*)F%2IbYsy=Omm;CGId4vNqP9i9?tQ8Cu!pUQM7dH3^WOA>IT_ zMdS$-IyeT@A(CzZ;fe5-8ucFt2(`;Ziwz-~j1@ek1RzW|c6ohe^njY=_2pRrAt#!9 z2Z_T58$bwxrl4xQ<M+KeK-iQ<Yz>4WSMrnsS*-5~2#Kd)B|(#7KUPz1<NjUrr7;@r zaQ}8VX<tB?jE2Ts;r`tl5GK3fAps%s@5KSaWH(#}gfD^Ju%7@Su>^mN0U;rGuYN%I z$HH!S^MEko`%W&x`(7$Mm_qxE1TcLm)-T2PaS7Am{KWJhlN8O8Simsf9nhD=>#NLG zIBkL8&DaXrg?P(W7zQkp#4TH);D><3EnA_JC)j*>%T{=iWeW__K*L+M!b3vCSDmep zJh|-qcpXWPSZX*GkN%J|a`Jum%}7OfTm5uj`IolH!jC6ox{;0lWtk62%82n-nR;0t z=aEE+HHUU+vKYr>QI}UZe?vvhN**bAp8M>3COZeK^-Qlh2|@jyD^7}_EMgf;o~&k{ zDLFvv0uP1?lkXry?`kI=iyAFKO5OI?hfab1m+r7zd!IYaS(Urrk?K~#4=D|Q#_D87 zIKLJtWF<<Gq3r!q<MwZd-()|4(q++Rj!M;=bg`~9JRirK#d^K&DbpRlpX>1mpTF3% zOHrwMJyxnhHDf;cxcr0p)%x@`%4Q*?Y_yD<Z>Sbo+Mi=ttBh4qpkLghRFZ5}6v)FW z{q$uQL4CdYZms(=?bOe&a<e2TW5y~WAOEv)K8i_JIx>~X`JMXUoCSGGs{Bn{P9tyU z;2hC-ckFk$6PE@_mfW21Byvv+y`Gn(Hl{m$fLFhY0`E^roT(S={8#_0!mcz`Jj0Mp zaZwWeCc&DD<B=$?M*%$*poeVCr)8Mu3y*YfPKF2^`L#QO(BeEB$*$9EhFr^-)aLM# zZ5bOhtk`ROe-t%pIY!&dsH~|v1^K9I40ATvPtU|kzBm0k+JmQ4g(;bFlsR&TRI(PC zZHKrU-c_GhV;`$Kw125hFZ;^0<zy3Xb<=ygP4Ms=*E02=uL|O0{I^7t>V4|AI#RI; z&!f-jZSf>u85usBVmVcLx_;8jryj%;XB)*pGCx}`v8EiYdpYak-PBan`J0rHH77ZV z_+M5W<qPZA?+bqKG4f*F0^XYwB;knL6{U2O3puA6@+as4`tk%4f!5B4x=q&P<~HwY ze5q0dlUS7<4I)gH3mfV+sPtj?r%W$uV2Gj*g08+sn}0r<f9`9v`FBV2@BEr;zDVbR zX#Bk-8eGdv`D7)>8@r(Vo+uySZ1y+h_eA*!ky%i_B)H;>_aSXWJt9k#ul?!sfha%r z!<jLbDL+X)%Q?Lmv`;&;d7&eFbtO1z{Ii36C7mEMLaihF@QejNkOnXWJSS+<6SxK$ zViAu%>nW=i3JC_+LsO|}=>#hSnd8wg<RzegV#llVa!L}HOQeV)SaX6W(#GqHl*U^l zozY1Rn17WB)VnVQ3zX#+ey@gX3zOO0p(54z!Bfb9Kjhw!lv@KyfF=@5$2k^Pr$lds zC0HEKm`4kG(^X190F#Ho&s~y$t?+FZB@Jn%E|4rFI|*;tZxzuhJQwOmdXwXaq=lqC zSLO9p7tm8#Bo!oDjr~{@Nl-AO!=R(udZ|cS8>%hAfwDzW8ZZ}~%5<V5bRch(=nlzY zN|ut9+EmZbN}-UVp{fW)mb4PD71p6429?!dG(&GPfi$@pe#9XRXXT(fRt>1PZMx0J zX^Ib9EcYl`07F@nxyIeCIeD@y-R(vnHj}_X5uP_F{u+RZ#JklBQ`T#zYzSSnPs_EU zDWl!vv<p&jkAMKx3Eo0;t_%I>+;i=Lp$QrYzs3(zDoDQftzPxo-7y{F7IdefqDRXc zK~Zo{aav{cEYtXSTow<vmwjZ$0^@#<Pn+t39>&IuZi1h~Q&MoV0)Ebzdnu|+^)f5K zAR!4I{lG&ytiw=-)T-mVNkvLF*`nZ$`nr@XU{748FVfSz%%ON1Y#?|ht;G-K8Kpcv zsY-w9-xwhXq}Iyus@#j&_{}tzGAU(x_Z$hpT^BBt!$oDkfJkWw1DRc(em|o!eSfYS z&3#>7Ia%XJgYL%f^9c`WK(&oGgMZ2M24qC?X=oAK^sz{A0YoNvMa@DDB#P|Se1ieO z@)9t*E*A`Qtcg|u(5{Lb&)@@I;sG@vX5g8k6;kCHs@5QgM)^2BPqArbw60XrO6Y+S zD<)z3Pjd<^Z-=;s&yn%DoFUxw&#CsAtjK2vjSgrq8T`_cM=xYm_S`(vWmw;ET<y~D zncAQi<~_3ORwbf9=c|_R{OuX9@#lW0A~ybq5hQAaQs%>01Nh8S!(P$ysfy*rbX)n@ z)NY;5pa3T-;Pe89pKFjeRgTtsSy^UGiI|ZAh%h_4LB6YWHrVR;W2cL)>pdl)C9UW9 zOjb{r0OANV?oAAyeueXPzB$WdNN7Gp$68II!aIz6438)G2)#U7e}4Ez@}m%;Bpw`V zpxJ>jD`}XBa$YFGEq|u-<A1gpu;U-T#9+|-qB?$0?nJR;<%{Zx<^*f?CR4AAP#}`B zQ%co)c7EbL-vt?Qndd4><INRkO{SjegbEzj+sZ^5o6AR(GcQb`=(0%7lC+wVF*6{X z6+(lRa#7>w$KjDRuJGonh?wJMC5YL1YeHd42-(y;d(eAvf|}a{ZHrKP&xsTUrwIGw zGS0h-?}O5GmZ+^1^5iVZ+p|;1?b0u7=quW$8az1Xv;vKW3*e+l+EQ_w4NlYT`P4L4 z4HW9g)ca5iGa7HcNkmg<d^H2*T2Bt~4a(7rrKo3}C_VxtOA(Wn8SV{KNG0gP9?MZi zPqZ^zVO&7nsPc0eldOd)it@FE*j?Ws3rI*D?jI~AC~HbKM8LIZORUF})FiQtZnX@T zPNHpUo^*B6r&fzW@3ejT=eW*O3R9${+LnM~MoHtlveQfmMQy8X^a+-yNRt1ml0qq1 zboiqBHD$fUjHppxN14uPXz)+?0zT(>0HTNod`#icn<BCCuiY;}H$InfuBM<B@f49X zQ@f!lgm?^f3wk%rm~5wS<T|`Z45UVFLvdkb>Bqpa$ZG}<tLaXqJ2g4o466)82Rm6s z7hf!^NT#6v>4idj+g^AoS<g$87SGO)2S4}3&-|Ib_q)07H$j|CGV--xm>7DN^`ah4 zv{(4>lqsR+iRmhfWM`V~L0Bqme!|7gx2xmtncwzShS|aES+xyc7vgJpM|^!;e9a)9 z$8CB>?CU<?4a16~(YzFBw)7FU{aI07)V$LYNr~cq_@RVIdLe9eGb|DX7ld9QflQnZ z&C+yvy9EObiGx07J?l@x@#96ABp^SOU5NRm@~9M>0=QrKlp~jtWVV<E0-mkY*hp9C zWUg}`ol8Cfa|c+_CNr31)>DAqDusoF@gw3~4!?AkouS|ucu5^y)iC=o0rdrNDy)$> zPETZd0(h!R^fDUHC9;rFNL&`<4t=sF4r&cOSojnYf%ZCoS5M@y?r2Bk7MokSVg8D7 zHaL`MDs-?fMZ|%f?keMv+OS-qfujb-0|elwyGV>^y+?#6Vqi>2!Y4_#6>6Kg8}t)W zRqatV#>ljgxk&;}^Ti<sT#<Nm!+6-Qk75EEG0sD4Y#xk0=<Ec^4_SyPN+pOR;+Wnt zx*4T05T15`DR_n2D4T9s7RJ;ELDGEnuvnTOLmvvzI21~{n#e<=tdUFu3NiUtG)bf_ z988HfUmY!Qbq<x^YtEwA>WqiZ4>J}G9mjN8Mz_;NFH*5uMp*-Bx}YS_l-iqSDrPBg zdUr@;{!p%TNK_v47i461)__Qquvj|9DI;l;7_fGJc~jG)Sr+3U!}pk`uYBANJ5A7{ z$mc7i3aNPyfC+;ExGyawkPMkl^b68(0M6-o!5|p3RML7}Y_%AIz*=mm%S5e-;8sF_ zOLqg^ZAL3E&w3JG)=$j2IGYO+@B$K}SVM!}nFwzqpp@7Y1zs_?GSR|lJiKy}Sp`6# zM-zZRYfA+hN=%XK1`twg)Xg?1V39DyN_|?#uKYSxa&HcMRx1gBNnr;7lk}e>?!C$| zUj+c`KPLb-JjK#pWI$8+J}h4dfC0LYfKcr4!TA*9B;9ra34n2%O_SiLEpZG_B>=W1 zD3t)%FafXts0{#PKagKE0Gl2Nz&KFqtW>Dv1cK3PTSG1a+yYNA6Bd{nAfMyQ7%d~N zMrJZ*(gqe3v>4@Wh7LwF?twu5T&wMNL#=bn5>n}`_G|=Qd4dyNt+aH-ZPS%A_lf-c z7$Pv}?0h7ekbfu<m^mA$EAb_31_|eGd#kuLD8**nROTQcnQ{fH0D@+{R||xmwsIPX z3Bs@ue*s|tXf{7R8`z~?MSxvkBJ0?->L@5byPv}(L>d)2vt-0#b)oUiHOvYMWEL`h zdFPYL4CzlM1}$pI4X-d^{8>J(;>~Nl6jrgxecffThxwXf07tfZG`Znr4eK>;5y89& ztB?U(YyG_&g4DbEeY(%ujUy<S<9L~TrcEmq5;)PQ7RvXaoo$R3$s+}JXtxYktkaGm zB^#Gr)xHA$mpkv+_<t=ps~lT|4r}C4YHSkW?y*$@nu0!AJT`JjPv9d`Rjk`_<k8IX zou{<yPYx|!d7Cckq%5^wrm2z>v%)5V)?)@J1uH~-y+(5Ab%_^BNDih&2{ueg8+A)4 zF`&Q*So!mlZZ8KrQ4pR+3i1>!HHGV(x9g_BKT8EgJH*kH11Hwk88XQjt=yRwj9iza zT;_eLbuN?zHvP*n4Rrd)Mjqx{ZNC51c+3ewJ^d-iKh)1BS|en@TaxLlGWM*n-!caY z+@5XEdyhA(@es!1!(rXO9}*ede??&A_UsYEbaEnUwH*8oRjh`XSPk)>i?G#J&rW2p z<7G}#!6d}4Bu=qHRZ3Fm$uf54Io~vkN{btPNSnhI8PwAkbTIN@2IoUWR)%ICVs6qz zO6x^&4%)?0>r)pf7vt@8Q)9_Do%14_o~ek^wX%{Gjl$6%GNmvud3lj`s+%xO?jGJ7 zZ_rvu{9J}XZ2F&SNoMkcVc#rLtn5y6LG>SEYhP#D@HuM|dk=C@T-e#$l6$FSn^Jd_ zY}k`IMfI9m#D9JAb{Gk>dr>4TSF~F-Uy+GVB12bj5<d~Ym2gGBN9ngtAk*(j`Ym2! z{jG%<A1srs+S&wX-MUguO+D(h-_s;E+@AJZnqb)+p%LLjoS(Q}_AX{Yh9pSE=K=S} z|6{M{U+=v~mb`B)vR|IBd`Mq<zdRp*=xKc${qlVBp{M7o_x_FF`Gu!{|JOeH9e;^I zxHt3vzVL?GO8S~*$}`I(x3{X*zX!M<|1`sowf(0tj1Wfm)9vHmOL{RXU6HKD-0<Jd zSDJgDd&AQ|HDCQudh&Di_d=bk9}#DI*CMu-`ZezsOTG(7wfresVNw(TVyTFg<sw$P zMQ|AEyID%+9AtO-5*B_6;XjTT8(l^>3OVrmHSg9%o?xE1cSS6tih3d7klC69+CQ4{ z6h|(L#sSD~o*G9Zb$1S#T!wpPHH1c)OKPFy2RNp%S6r;<$`cG~1({I-7g)4v!kN0o zwcOVfK(M%`=b#>$gt5Pqu;j7{RntHznf(iTK>nWgf##-*$4q5s&`d-~3BAiROFc=1 zp1+Ftp`*dW?Uluou%cx{2oEAbXd9ehrVy#73)p!1ak<XlJ$`yntX?l=m(-cPy)#*3 z4>^5%b_VM?l{go{nvTDMKd=~lx8#>fUHkB*vyd5brJ4kWtR<J@Orsykp=|-Ehi6bX zX?bDBXZ^kleD6K|_hG@%s4yY=!vZh4w1z?e2<J<}fk{$<^yFsIv<}7Vh(lTKv5@hB z>D&k4sdZ>sH+cQe#u{G2$L3OY!-U-vSW&HG_nfQIDDX9m9t<j>2wL<_;vuq`@KAB^ zLyQ9tl?Oj0dAptthyp8f<Zn}%vU=;3()$0FU~aC;eA0aPu8KDSUC=~uYY9-&J{!3) zSKnk$9%qvO=x=#L6Nk1i{f|F0eP=s`uglNy<cLFj>(R9*Z~>K9>i2tJPMTBoZ`Yi@ zjyYA&x^wEJ5bcz*5I}@$nQ?FZxonClX!;Ixw3ng|Ipat$qEEO2nJ~SZ1LjRog+IQf zE=Xhpv2{tLsnYBw(r#$kO|&5$@~{h&L)|2l3KPgkPy{?6`EGA3z9~@*z*T(Qo6ZG0 zHKA}nm!#pOX00ReS&2zX)-|C+S<)c8<rCAPh#VZLv6q61g9MAQ-j*iiPj)#m&_uu7 zlkuhs&wZC3Zsyte|L7OP>-qb1>7wS+wp<|q()OffL*N0~W=j?qjJBS|lHyT-(diAG zgY{ltG%^Xs6R;AG(n3G$o?)HiOfVVgw-M@@N<AMRXL)LcijhA2yRMc3Xzr4>7E_#- zxz^XJyRu5(UR$1heW|zjcHYJ4xjXMD?u=_ARph%`HR>CVG)<gY%$C1Qeavb}&e}uA z`Wx;)2{{NDG38zkmY1KM{w5$Xcg_I{0$kjcJrYH}<&NSl`ldy1R)1WFq@685960r- z4@s2r?NJ%$wN4W{)O-s;QZ=Kj5s-n+4ohKVDJLduUZ}tvFV?&e4il7;t(50vZR5jl zRR!V&!*F^>AGqD^nj`rDa81gHLO4}-J~Akv$lJ3_NB1TmP(V{mtDUfrpmaV$upWZ{ zOShnTTrXl#($a))#a)>=k8kB&nFI&ldUs`70r9PWS0+rwx4~VRmNR@C-jyMLIpU1& z7dlK8I2pCMKP){Mo!6Gt>&q&>ZHwd}w?}ya<fnY293v^&*Id*fa?#L)aYkEu(6|cO z3#tf`h7WL<>8))1e4Y<<!W2KWY~}+yhV)AW9k7U@aUPtjbG)HdM$kb)&_QoQlWFpY z*d0;uZsAmH4OZ!KxF`+h9{o@cIAx)%|0o3-1okze)*265kR6JF&b6^hlOdG73WZ2< zFdw+B<@e{d=9(vv1mZ4kOPq+`v|e8Ln4c{2_j%Ek)jH=jTxqliP4ia$r1w?%;Y;T- z!BON&@~8EmrOv!~pHT&c!Vg-F6w`mnxazSlXFnhw%kCNel@CZxaV7tOv5x-CvG!KI z@voN*X)?AbwFTWN?#aGut;ChA;k6)un^4+S@!>d74Jub~gl9n!8Zr9d91I^AKh#rM zvAhN;)7U!LRRh*pAP*y2fJhFlDOlQSFe!qn5vWXpy#Ii$W(*YopfR**17@d#czPfy z8l?Rg?Kp=_a6by!q}&rrc+7z`{n@JUsD7B)?xQKGi+Bci6>lP$o}x#%J+#Vk3v8e- z#m!BRFtM1Dlot>)Lp5@2isK&?n?jGsN}?WVp+wtwp3aFd2B}BXntEiaz~)Xz!gs~3 z&?k(7o<W(=SfLyG;(ii@C*hnSjZF;O7KK{mkN?41zN)w$Jf4c{f%tSz8e}2!4pqb` z(qeGU^obasOhuo|Ht3<~h^ZF~j&9FRFa?MWYK7@Gac)B+&!LR99KI|27H0XUS5f8P zmMKBl-&uWamc2fsmiouzEA`fYJ-%{sO8x%$I_2vhtoT`3Uw$vX(t=R824#8uEmID3 zi}A?Slw)%Q*BM&F_v3R!*Vn`DWni2CR~XVd(Cy-E!1`~FT>+<))PF6$s;=*kud3@W zix*Q}$J@FXkD^wTMor;z(3i}_a>-wcUZ~{Xi?1sAx8m#mC2JHb3Kvp(VqSb({wG|Q z@zM_vFAa@+GpY&;V-^+yaB_Wyp@x!mP^3S$DF7p>ln<?!VO#{lH_1~<*JQIr(b~}! z&dMkZZ<;)m@|&V15psIVhGFdNb*}X(UL-j-xs7#?)az0@#YNv6VSt1Nrf+1FPtzpV zPa$dxC$-!8%dcn)C^}Rf#n`aPgVRqV|9L`{$lP~EOd~S;I$H%<Lzd%cC|-IYa=4!1 z5zT9qWDG&_F@VBg$QlWSWc-wQNfqmuKVTI>3Hs-E^k<tKZwfK<Nh!NR%v7XuyP-p` zv2F!iR;!1IGDE(}8RygiZcB+xQpN#Z*T7;*(a*HHXZ7G7Ako#H)tzx?B+HHoqazZn zoIj!>yv<$u#52nfIF=fPhWDFtko|N$49DaTDNA6i-j`t?HG%k2F@44hGu$OXU=6$B zvxePqQ?yfhoWYmqP)L7UpQ6yH$TgrjC`RVn)NiIZ=D<Q}-)ZG3+Z$4n$+f@?f|;Mr z$FyGtf9R5;DIWGf;qZqWc4|O2uJtF-Tv-sAKNN^yj%3vC66CA@%ZX)>axwkAiP>H# z`0vJ7<a7NK@m0)eL~ph)>yxlOy$XH-+fG$goG)!jE3IOw=+$zPin&^fIGi93r83Vq z(r|_p`26baf@qR^p9_H?x%Yg0mE8N(LSlSkAu$$>%IjGxi>juot*8o-{a;O{S7x+o z(T!PF<!#gk-(Opp9r<SN8yR%D$sS=99*@&Gb)=E7(W&jWrk`DXd1_jkNpy^@(BmH{ z*hxZvrDi~v(m<dN_%?L0upP6___3U8u$=-*1KWYT=t)}ICuFxHmJ~u39*4`NiLsEu z<wYBq7!c2|kf{q2a4ac?QkenJ*u0r42k6Nlge(IB8<r!2DVgT+fk-pg>88=Rpo|TT z3B`o+MHMH`T!Mjrr2vgty<&$~=vE8_Mq<5P)KC9w7fxGLjM(TS;5bXWJTy0JX5qX{ zP<;qriA<vuTzM9QAbLd^dIbS^tOg3jN8Ta?r+-23@=e$S;VKCxsoU)){gd1Y*<$vz z@t5h^1ffe@H2p?0u`W<Rf@jSEjau?20H<&YJ&z>QWczIbA>UQM=Gypw7!&lzTh|pK zkv6r6jcmp*uX)z8D_+m@E58C4QY^&~2+zrr(eFFmaBA@S48><9aY3>}j!j^VCV|#) zU9l@#d-8EXmvp+26eS}J3{v}~fOtiVcuHJ&J^C6Xx&VQ=wHcwFSPg0|u*w>*fE^MZ zN<EeOq^BtL3`K%6qC@$WCjPt5E2x~)=&?B>$C;gxbDwHfHNw+x@XLbOop&{m@<FkE zXWsXaK*v>o@g@zLeuL}10PxjlwZkiNSt&1?l3F@;V;KXUOoQLHmBDv-GZs|0wUB>; zzBJW|do^Slshz`9Uaay^((c9b0HCA@7K=iM6zUdH(per$CAHDAOoeb)f$7!`sB}X( zWocymTV$d(VgZ3A7VY9CEHYZoG0q+<9GV&^HLgcs&H?u*Wd}JVr`9Zo1o5V6F<-_r zP{3t%)s8aXa68)(W%kuhC6n#8v+4B=s?F7_cg#6>#%mb@;wZ3B*6B1dGwH=Nh2dPo zlc#pjND(6qpa2^1Vg?FpRqcf$1(olVTE@C&|EOGX+I8dp<|pm^QdfAcC2aqWu7N$% z9PpNDV@!j}chI)$_sv&NX@Sd}h@*v-)JHl!=yr5YyjC?}DS5>~KC6jFdA7gnv3~nl zrUEZmNW<mwX(=A6m^o}quP!&YujVcu(7SL~k1@2^z+8o$o%>L|E=Y<n9HlG`w&HQv zuJ%3xJnc0uBSu~p*ocvbcCNAL)zVSk;=ENw1K57owg%h=W2oIz&1AYtdy!b8G<t~N zay_V#W==P2A&+ImWWYnv0k0+K=nKcF$<YoP^!U(+{sIdM=J5`^5fX^0TjpsA``Xe> zi2Z`4%lWh^t<J}vUS;c`XLgq$Z^t_ca*y|m5#%Vb5ae2ZDE>x*oDcPnHgyEKUA)28 zv}p(HGEJsBvt`Rto=?2<lH`sO;l0bDW0_mQ0y&I50-}F<sliCBodi}#Gf=r?ewQ_3 zI~&&Fs_e>q;%pX@n`vleepg~dgra1=9J7}BqKA-Up)IV6`cguz>^G>`TlNQ(fm<6H zL4)^Dyb<E3dTDbhc?DX)o5egJ-8I5)8H2oQ2rQp84C3onJ}e4!N0QtJOli5B${2(^ zwXxH*+{pcOgQt^+R_$jtl3Z`bLvlTzenSZK9Tz3dq}UfyIx3TP0q%%cW=!LZfu^Ih zJj8gCQcU-xZRfJ2wkX&wsRu$K1X_5kka(s>)q{+dd?h+5s1bdr@X8p1g$$M)NA{Q) z6)uAeHaRvjIQ$^ZdtCuLLckV?y(nJO+lbiSlI)ZY?p>Yt5V2@LIqTI{J-jSq^&B!* z&)HkRLzc0^VUn>}uB+l^WUSyvN5(oLjUg9{i^1VN^JJ;!?2xg&ePpbl^0JJLh@2g8 z-!c{ypwV8Ev6}OQ^^=TkF_N3Lkg+Y+mkiPn@Ue%CE%uVJw9y=IMAAxC6_TWC+B%ev z|LRc;d}5^dr;&I}e;x&IFt?h5!2EZLK=%N^T=VG3tSb#=o=T>XH?Q@RhJwF!q=if( zLp0Q47grw*)jlnPXm@dGFO5bofom&8M~Bl8Btxhsh))Y9xKyLZ;5I7;Ip29ZBsfNo z7K(?F!BAWak4MBh7_&mN$X-Qnz-r<L?Ty>bMi$5oJHSSaQkRAL9TvjD$wp|5tA3|} z_hSaC6<4Ybm#5^w4hbf1umsa`RRh<6$^_jtx7>0&yUPf9RT~M990~zu25gW#!@ST3 zgs68qFDc;eXe1;CC@Q3jt205kGu$)aVgTHQ<qqf(#Ev@<wW6rHwOV}o%}02yU==B0 z4_7*Z4Q`Y<0m?%Qa#1r;Gqra5c*a!$BF`4+q?{j-AY!<g55|-jC^hLF!h<oe2^-`A z9gB;ip?GB2c?4#a@q(rguWFE_=gk`O2Q^UABhV-l;tzv&^f$(0Nhhl~ucgp$F&4DC z84K)aXN$KXCmh>`ByNUvCCcJJa0kJ&1hU^bP@){c5QJEQ#k;hS@3PuSFwqI<Mj^tm zL3CjvVw8W{{knjOarAc*VLFnuWkN;yga~t;hKU68V(Bvz?hO-D-aGb1xhUEw`zi&{ z$`Hpsq;mihMlbPIs-N91T1X$%Mf<?pE`}$?+Eu1kby23*!*r3zqSQs#d6QkFF1>v~ z7ex}db6e#r`XZDWVeW4bH)dC?7b0GK;gUY^8WN}o2?U+(P~?lU#0BiMP>3Z&{CKib zz{AaIikBCwDb=??0OPr;v;n4k2g^XkD<;j%cQ|JUs)i-{SJ`}CmBh@U-|lxXUrpGZ zEbHZDC7?d0U#$Xi&QglW-A25yHW3V2h&UQv@k{H|TJboNf@VB=9fD=SxM?|S#!cAa zQOPE2R=OmBsX@$YMvNQT!^B?Msj6ZhdHBj299(6=WP->SU~)dJ(GXFZ3oKb?CYf}Y z819}Yj*BL1Ke^^1^4;SboFryKDrqbE3jf4RWxM8z(@YaHDGTc^W?F(E)Yc>fkt!1j zYw1O|f<}@jo)Ogg0|h8u#t~gXwbE~~IV~BN9;t@j-Yd7sBMbr>SkY!l4~e=o^liA} ztYG-_82+vb(nGc%v;*#WNz!qT0r#+JxZj8=xR<oTwrw7!1G**A4xbB8@R9HYiz|t; zg+UD^&fW78WgdOj=eUI$QI`C?(h1#N;fv8<+7%uEtlbrEPGy8$rvV^L)`+rzVQNSh zPqd=UqmMk&=<9qWBRh?LE6Pl4n!kr->6e^)q{_{Qz7v~DN+N*>*uf4d|A_r0@|E!4 z-|yvp!d>dm{x6>Rtp2>T9vOb}xgzN(_m1KdkhkWU%fFaA)P`@rl1tU;1lfy*MX~i3 z12%6FjdeNV1ni;llR`*Q0?P}nK<=Q3w%niURQL4a@&|LYZ7IO?K{$qzTP^I?34d^K z#Vn@<xdM`TD3F+azghh}YsSBAI!pcW05$!AZs?D?>B~)Xxcp4#@<&s1xcqeI^3N<T z|EMpk4bZRP0fq=hCXDB2X}U-~bwagyFe&ay*WLVjeCgNQmVQ03XywE0>+Fs16n1{` z$c6TiGmDF7+l$+ai&#Pu1EVUMalplsE{>XpW2AIde-i98{*_X$jI4epk<8iR1LflF z4?;5O^)D2Nd3XE^%pwJt*bUNDoMjHPS1@vgX0OH3U+vk0veX969u&mvLFNB{oxPt; zv-hRvgW=B>x26f%20Om0nCy4^@}sd$W#>9+*?AL&mmO=T*`OeXk^lTpUHiFweUxSW zqM!Fm_H4-t#MP(r*eg?`FZ3HBto5tcch=X<(ot(W1E2791?<76gV{=JK|kwNGaS@B zi;aVNyh=~?h~JI%{CvBTBMu?zwt*jX<*14*RU*UXqLKp}r0Qyk9Dr2kom~x+8{n(e zFa=0zF;{quU!Y+NgW8K5F;_<K4>MwmhQ08JVSEdatPnuVIwqf(w5Bdo6SL3nz|jpE zaE-UQ{V`-JZ7UuiUkF**bEkxn;(hoO$LHkZzdHzmU$%<uGBZfM?lKn0PrOX<==E|3 z$=i;}z(N~vO<Gke(1h>NW?~{eO+k(TLespXO&W46Kwu_Ezu4H=o6ZK!JFc*u!6-~X ze?i6#?Kkf&lRRL%^K8?&_Sr5EnzA&3f}D%;ceTqT|J7;Ng0Li2UZ7p3_!r-<Ao#<L z*P>l7JYK9(jRqX^nu%V2k<QrOQkCn2Ea!h2DAse^70@<m0ib0LFMz<dgERA3HErR0 zN(fQ+!fTj5>%O+AWHqk)Uva2_uwwc~RL!sC;}7P};3P2qqwu1+k*F^MUHEHbo7&4B z53!i)SllcLz^(W*eeZ`Q<#*nHUH&JC;^Vs4qZuJe<&<CLvnhT(m3D@z?m%IT|3%Jv z0WOgRo?3nwu4d)Sa$1HetnC2uC-^1@AqhwoW)~%E-NSbWdzS&&BOEH{Bhz>hhKG3Y zGJ%2t%`mK1pCJDTZAmL6Z@8BOY6tRnhEfa~fX`Yu&aHFXz;-T?N_eNrrWk${scPYp z9`pjK>W_b+Eb`dqBS1<VAODCxj#z)b5g+~lQ+4sO<5rbS#19bUFMBx;5cq%ImXWMJ zd#R>J1SU*9zq-q&f%L`$3N-f{7aeG>yLZmZ7=FH=pZC&U1;So1eU<Nh6gLJzhN3&L zb6;6Tii=go4A$S@ix?x`qp5F;a%t)fdY2mdWPGEc?~HFW^z8-j*PqLFxASdnJ8$G| zL!WFL`p!;6-@ac%rP!N>((0O)Xs?LIpV7z5&V}i}CCpnkU$v5^i$3{A)2sOAD12Y@ zJ_>)M<t)#YYl~$A!FQ}l9?WwsNj~@42Gs7c9I8M2FPgitE^5{(u^@_H;~x>LeVw<r zmY#li4zv8(;-al1GSS;s1_2Tzw?U=b3Rv$cGD$H2Wxa7}IupT>BNux^yl`PAbi)hl zyl{p{RCc`a0@v34G;#99==E&Lpiho|Q^cS8HhzCml-G;*X{Kb*vlfG^90XxpuK ztJ*w|?q?gAo^(n-UWo7yt~bHh7C!PZPs}Ei+wL}306Y80<|M8flDJBfr!`SE*pawu z_@4Pdbm|ue?AX$?G(0_fR-%GzQMx~!549hz^LU$Fi&AgTGGr1u^&V3*U1n7NJ?$Pa z=i|MRtso!Y#)auqKn4lMbBy3K|8vab_+yh|J=pakE*s{nr$>luK&r5}#~)|oqlyns z-O;^BP*9Ep9AvN1{>Y0}4l_AOo$uIoOK}yO4_N-HE1T{rxWGcO+VrlzIpM(s<M;`6 zb(6A1?Sf&1tme}@ENXZ^4n3SGIohZmTuXcWHkF@<>ST)6pKKnRkW0e*sGW2_-rA>I zyejVJj&}IT9F&Z}<iW~ikIP}CwxVpt(9!ldn7F(MyKPoS-nv%Axf7VH>40VcY*KA% zo1dC4?-!>*Awh+y{EtiJmHFCwugG(>9_7#^j<KDWZ(8f0Y)pb&Ca)!X^f*hN-2&xo zg{aN)qU!uJ>>p}tV=OzhDITP}S`VI3KsmJFK$9T}t-SnB)<$Uoj7K)TlT%S_Fe26* zGb1d*OB%J=T8!bAez7Z8N7kT&yf3rFjQ5-(#fxiclcde6g<_i&WQ@^N=wM40L*A|^ z_jC$mV=hW<wDDXJLZS`f-|n;!^pCmVj&@(fT$D1%Gai}=+q#$n26DiEeMVwUW6SzR z@q{UjCvPZAhjLKq%*a()C3Tz0A=jWBl+R@k*|$V5|3CKLKIqc(EbMze&ii@JyYJZ# z?XGrL(sPa%SlcVSP+@Pe67La0mMs|zaKJF0R-O6}vaj%HWudxL*(-vYIN@X5hIUAy ziKZo$ORSa<n7S#MaWih~=|Dru$C!?iXc%A|Lx|H-3dM!~e%EzB=i`0fl~%Gv9AdBa zo^zh({=Dw%>%Ok*zHWo~HCk_boGLRL(Th#S5kS5oUFRSy7nET|-kXtVtzrPBG}H0O zp!+w&qvM18Wd1slAEb}-m-pZD!KD3A<Z^6^f#l+Z$F&^U0%8vJJ~KFs@|+q_VV`$G zP&ohOs7COEQ$c4-<TWK<p9FU7o=vduTl-_P$DX}PAT+nggE4ce;!wI&^>s^B6<E%t zZ-MMXu9-jH9sS_9vAERhjz!wOW1Kw+T|mwYfW>`Jv%w;ue|a+pEzMpFL16YZ6+9&& zZH(SLn!V*3t6j)}WCpkp_Kq}FjTe#ycpIJxq2t*rYtS5x-&t|m?D5%Ce^hb&nl>IY ziWz6b+YHY2%ORyLh)ko_Q;^bQr5?y+1<mw*^YGYo2wY=x)+6v`G#YUEkJ`6+x+??I zGr?#CdDoL&QI=Iv8u4)%Y~kZPXCe78Ap;+$C!6gRmMC0XTu?0H)PjyGYD^ee9R%Mw z`@^&-xcT^Fj_fjDB_&DI5yPIMmA72OJD(aapcUo4?TS|?o_K_~WUrIXsS)l<en9cr zOzJbn%TKgvq++6+gPm5fG;sL~2n8%Rj(PErW18jR=HlU~JVb3nMC=a#sA<;cO5WfG zI7y7OIJqfKZq0FWGjUQb=6O*73hPyVtl%VBB1Fb*PZVwj!-oNG6`Uk4DsXc1*`hml zV5$(=N}Oa~fs>8E=FXmFoP=R10bc?q*)xihh-7gR&Hf_8#Upn(PBw{?mIfyel)fQO zT0xz>Z+<^c>KwzN4o>`W{Wkp&<y1mD{M350l{!rbT*H)`E3~#>;0}wxE$|tpz*To) zKCX@em$QIn8AxTaDsW?mh6-fYbAdZ70#^-9O{tH$hbk4gs1O{YOeLylPrT`m)R#DT zTf{{bf!&T{5<P_|b-_7~6dWIB7)R!br*nbf>P!Kefr;1MP?7845qgN+hC1o;zXB|v z6OPRGBG(~7ZBtLAM|7SUH=vW5-o=H?B^z7HT>4F!Te_227u^N(NtxR`#*Pu*CtII; z{G#dDwJBj^H=C+w$lORJPzT^9+l-V~C;T%uSk#SQ6-v|Wsg4Dm3)}`QAUl5rcoh|* zMu=M~cIb16TeU~y`w_QrC08QYq~g|BOih`}vDR24UG%-U_0(Ykc*2RE%p(EQf_{Zj zgz=%{ptJ?=+3W~(SDF!krxe7MMF0Z_ZP6~D>QdN(*(|sVg2<kqUB;;s%nANS0RVFl zc2I0DY)fhPywQyx=a>K=rpe;NoX~u5%*PKr<bJ4H@xg*CY%!lE=PO&)*y94Pr@H$h zOZf0tG!r9ROHK+ArR-4$?os){1}ab*EOn0>1=v6#_<V~d47&lC7fjD}`Xvri4(_b( znCbDGc~l>%@b%RR!1~dlDu3nCpl24x6n|uKOmX>W5c$$zm66_*=DNvxY6fe`g+n`7 zPtoeBr19@@UD@p8zZvR&q!i=m3;H`NKr{%z1L0?P_2npquX^?a>DoB7IQ-hNqm!AN zb$#|jqZm6$PG^6yKX$b~`=fpu>$BhMr-1>^h2(tOV^f1S&oPlTPF5*BLk0D1go~j$ zBYh)(6Z&Cn=hU{$(&+*ZW{fiu$zg3TTK{I>SUJcgQ}7gJ6i}cUwL;(JtQj&dJ*^=R zpenTP3BBh*ujFEm^9CoWs7^p3!x<kd8o^lMALD{hkmVO8RJaD*Vf-6O?ctI?aK5(6 z#fT3!Hfb!S`8W(i7h{K&4J)`ADnp;YpC3$fL?O2`o5b*=T7&;Y@p>7ljo|qgiPWd~ z`q@MQ@%z_$#HeTgM~@iTzFd0OfD&hy@cSb8T{PeICH!71_<a#XTyrxjR)s<nzq&3y zPUi<VGFyaDCU?MVvycDNLumoEAZXzgwfX#KZro-e7zQZ8tSty;Z9y<=3xZi&5DbQP z;lhDV35GotkRfAU5{&lqS3)q<gYW}&v$6dIV}YQRpqdqeSq}sZuKz_K7(<tsf+ibx z&@Y!#)?*hrr-WBbDeuEPMCJuZYqo~Ao<<i;;^-msybHzD0>>u<a^^8dY5fG)#94Xm zW;K|L<@EEBiiqG@w=68sj9^6g0%sJ}#?j!~;UBim(d+dGlWA|GO(UGo&9)4fl&q1M zjV37-{^=TNCfNBa$RY#Q=V2_+$?KXElM~pB+4o<6|FoS|oXBQxia7kK|Ku_oedglB z=`L!a%|A4aq)4uwgW~^wUb;FlR{oDjmZs5ykE00ex{YyghekIfDH#1A#QD#?cOR-k z>kJN!{X~ZzsYst5qtT!GVN`;xtJM0B83jC@97G_l#dtl~_nJ1`Y*U@^6Y`j$UGH?` z6xK%>Y3v6%S+LYg_MzpZ??b6RL3d%2SDe-n4TEc@lJ*96lE59O0Gs2uy~C|WMPHam z44B*S0+xy=EmQ6rU>!>X?#{HQXUi*(X~WT@nH1%M7KwciSjRBtt)S&fMJ40f?(o;@ zX28CQ1#)`>QLFnF3!gT?P;xn!km;`UMTFrG1A?2V^(c~$P@l5PxQ3ixd$V(5FN0vp zO37;WA>)v_Vd?$qYmylf`28wMQRsWrqpEMHs*350IA|gZQ#f{s@7Qt2T2SAyY}}Lk zE_y)Cvz0eC_oKLL07oSuRi+63&uX&D9hl>mJB^K{IkHznaR`6QhB|y~WY&ry9z1fw zl&|fV_Xb+t<c!ysW(*5`(HZw0qFm&30sWo*unMKW_;i{6=J+X~G5&is8t~8lesJY# z_WbWd^5eQ1{();gn6G*4Y!9qC;q?o6#F`VTCI~hK88)_j>pleC6U%W|?g?Qp7dCH~ zb?~vS`Pc`i>-R*`8tpflo}~cz278RIHTsT4W8G)0-d-rwf)#QIoZtx|tqU}eIwWdg zgCTVpHV0AR-J-(hmQmpXPK73z&SjAszBV(^pJJ%iDCsgqY&y;GzAWf-$XHT>OWj*O zFP6_s<@2ucdAWSP2gj{UpdS8E+icFw5}^<$fo;b&H)zgW_EK55y?}S@AsZ9BI5d;W zHRIQY)<8Lxhf34-n&hhI1xUGb^@@iX6!JKm(arG*^I?&K4w<%ymSsO`4DHtYVdn{D zH%pw&imh0D1wXHm4pHv<el}THA5*BaXh@r2hb#i?F28`=$}e&{b6O%v#J;(Vx@~c1 z+aj%7W+@F`+ifTAw0Xx2STV<)HgRWrjyp_{-91f<KdhDb1G_zdKRomB*8+WdEgP{% z%F{Lftow&8|0=0`t|yg`{6Qg=ccv5SBgaF`u`ixLSLz6`CQuY!0L&02p&M7Tj~^}N z#(g>1h~>Q5M=RDlzL@O||DQ8?4b7#<snc8mCtwYM&x}cE>0y9zrYgFr*4cIOaXLQ; z(GOJ=tk^`Tdo-6u>e+|f*sH;#mVpTfROUHBc=(W3O}aCyRS^az+5?P_3(JydZ^Bk- zQlU`f^(F@!V$;9WQ2J>U7@_W9pl}L(3H{WX-9X#y`yz?v*xPK2_mRVW@#+Gv(nffp zxybxCI+jYCH%v*JH!8LEaNRg!+J;jeI98{<{7=N%Gc2HO25Weq??$f&bKS*PvrpX` ztBgX{ux&-I`EB9q8^0;pS(r0{Zqq5VOQsmkswwK(k(u2E0>|CRPLQp)=~O^yp#9`E zMt1=n0I3eN?F=`!N=b3Khq>OuZ*0zkSC}Ln$i@7|K<;9YPoJP3q4Tfe&~bdeDnozj zj6)}K=X0iXdUe3Q^XiP<<tCHk?6--4s=C-h-<ux~=EuA8gOhO<eJ@2>-$yu;ID7up zo9yV-o$RmQcF1I%7nAj{&btkw`pm00JxSozAfcRr>r@ucmHpHmG1)?M@1|?051M-z zvlVeePt{)#$~JItc}49<;T4d*Cm7%rHNCaTE6($E&NAA<GD@YwZZeGjMR|yjD@<he zk;2suV<uPjgaQaX`{-9js?ym{PnN-OKkXzK9s;rP7=8ZzZ)(1auh#(#AK%NPN8dzd z#cKA<YoY<$do+lk`ku}Rn9(-TAAH7@#B%zJ6D@4p$-h~OFH!#eYB9l20_aznf4@pR zaQ54;b?C1y|9+KO+Rwc{&|57165!vj5`%Mgvb2xidB|k{1o`(i+~ZG-e}Ci+G1)(T z{QIY+y5z&G>%}=oRvBFI?~i|7^6$@GS}y%E`1j9!?G5<%R?ojpPZoE0aB$mD5$)IP z`7+!jb!SY9MR$&Gp*zR7(4CQW>dvkBS#)PqY~^9(Fy=cE3(7+bv}~=&nx*dSo}ymp z&g@l-?i>yrexgE8i}%gKp*y#;UjiV+9ht8J3C^AYpH4T89Y2~qg<{{v?POrs=r z^N8JFHi9oKN*ZOSk$;*9r9KdjjWXsD^Wrk8u+L7l7&TW=;A3aCY}~O}nsJ+mAut_5 zWJdqP`fVxknHXCx{(s?UYgxXXpk+qmb|%vh#7<$p5v4%H)S@nws^{1lg;N!Q&zQ2k z^R&k<igEEf?vewxcbfY?4R>sAfhk=_U}M&~R2rHQFwDk!_-|?`!QdPXXobiYh*mIN z0lnRzjp6X#s5t{?=l<p<I`T4fGLACLFy+#JE_Vi8pPxS+Ul|VnVVyU@{>ZVwXEJh6 z(2_(T@^ZWLUfrR49@NK-E8=dnh0=XFR0o8?)H=|tb+HU$q5JR((<DQpZU&Mwt;`OW znIfVUO-Io(iNT`f*(Y|(u*QpSF&&g{2`BBxq9w<%@aG@=DVx&p2QjNv6VR;x*VWt` zTQ@Dco)fCe_ZVBg`zGzc(mWX6TT*uOGSwF;;ZmQVLNU=$!OWL8Ut#u9@|tRX{OGU5 z3daaKe&gvnm*ct6kv?grkGWoq)F5}Mql^@O6h@&kjvAB5ha<~uHT&H+1`b4ntnl!Y zi_3%S^H@<b@LmMs|7N<>Fc3$t;W-iiu+|3Xz^yEFjzZw71`wlH;6MC4p9%l4&B%4e zSEgIO-&ZB9+n_XA?RAtmCyW~4>^(n%ivHBo{D;b}r{kwG{jnKKf1*!{+|K@sJ}Gjm z^N>79G!hXy{|$E2lETwm%`y$~Inot6xGpX_(3-S0ej$>Z#nb-yIE<O-iUI*S6_iA* zuqMa#Z_<&S8DTN0hWih`^8rq*vfrxbGYrTL0&+4Bo2NbKxdMzH-zY5dL^8cI5V%5t zK2oYU$fj7jsI^)FImTqV!8Z+GdB@|I+p!gvIwsNln#OBpc6UTH%iNh;2-Y&W$o`rf z-E#atz`|;QP-4*>T!}+rBxGV)_C#9NqJyxu>Elh?UvX`22KQI26v*}WMnE94NieCj zb-t8bJkdC}jFK0@;xx8@wuxIKVs!QRdCw0pv-2b>UK(&rBn}qIq!}YQ%OYgHF@DHs zAY!~CS15s126y2$bMT;$CO4M*ruaFULD;yN3gYzwv4Bhquc`-Pkmmuzuz6=dpblA) z-AKPXoeu!mDsGx;4p@aIg1ePiu}Ly^vP4pg;slQzE?9J@ljWVi(@grwh;o@+I)3z` z-Bl~JvzaKCW2QThyCl1b<<YV6RcV2KNlW!t+)TOQKdK|_GC%;^QP`Vv#DQ+Uw!JXj zdKU0Ql=pLP2tFsh7IVe`-v)F#MPCRH0#FMn@O{%E!I?hfvK>lLJd#1_k1!p_d=Xf0 zA%v#^m*y51gL9jS&IG$o7b!=R1h3B51O@lWx?E(hpUk_R_x9~UYJ`V<lgCgZ^WgA% zBlT@vE=F>lQB{C`At%NX+8EXfB!Mg=N}Ogv#{Yohijgd%x#Ez}u0pYjNIFMO9b;(= zb!A1BGzbc78F7cygKYHxS=tbD4B1o)6{%G|@SItzJoW9A=HR9fXpE&3^T-&yE)t2H z{1-1$A#B8N$G(^w$PU`9;gB)pS3gNT{IeXO$$6k`<1~{%sTI?vHHS2QbJDgwFkk-P zfsE;ZJyt=^$W!FIdY31Cws<stPMzmhkF>WCIobyxj54amHr$(r`>l91F8S~-emG|I z^%y$sL~pW(WiEHTJP)2$H&^^e_gT0wKjAl5F_DVrH2QB<jsKdaZX#|Wj^h{^T21hy zWXG<%6}eyo?SICs;($aJ6~+2@pnkk7f#xxYzN59Kt=lRVTYpJ&Pc=Eor=e!;Ql}v- zqd|f%rVS0oZ4~}M>4+aOPNFI@=Rt^qxZ2r6g5<rF5Kna{KlCJ|a_U)bf!HDrA-dp- za3OMO!X54r-pa`ZhdvCp!`+nL6GNcs)sC2@?&#HmU)?c;4qXSL^w(f+vkcwIXS?-B zj69)}Gu=t!VNZ7L*EJ8lOLStv&<WBZrgA{<p(k&|Me+=R2~BWsPN*XUqJY<Pcu@^J zn9`g>iCb&R4>oT7ym6^8g6XcqICS1enD-pGk!&TVzD=KO(lP|2M4#|ztG&WB8hdB@ z8^GWVHQWa5PB8H6>YI5IWgeR{x5uZ)EO@LG9PTTKZee&SM^?OXsl=7gZ3In}p0;dY z>+qh2T}%xK9|;IEor4fw0Cx@GnyN)QVS=lG%_T^f2I`8(qLx1n!j#NnFCV6QvLdV{ zVd^LfOvR54rKJJA1xoz7>K#I`r&;~jbXP#^mNL8h%0LV<@B+zl)8G;$U!?tE7jr2< zY`VjNI7iGLh^%E`BzK(7YQuEn_^Jx7nIt#;vb7`f4$LkITHS5@P)Td&@AC?Z73OmR zt(E}cqKc1ldm&Yg_Nn6aLKUwUsyH{C^r|@hs*2N`s`zM(D$e)FrmrgQ$qWbRHLR1m z0V{ZjcqnT4fETC9r*s5n&LD&Cf(KxcBgSe(X!lbY<#og;FLQ7WBFbwpizu&A$ML(2 z@>0-0xYN)DvgaYi!P*kvgr1n~6;X+(N}{*KU-WuBuvk|RIU&m)G9n$EE#eD=h`6v_ zn2m8^#OFdW5d$XAR2vx3FoXAK#)v2^MwpBmjurUF>m51>uEtn*W6N}PdJ6*~0F3zk zdF<9sM-p~O`6|VDZG71BYudPqn!%REA#<w5V=Tu~Sv&zuOD}|%&3nl{$RIcG!%dB+ z7kW@^%t67qdN0@75)|k^Krm0;?6`RKWapr`E3stc$-;8Q0*?b6oD|4C(qQ=aZ*51I zsY0~=0<rv@epLdk{>$K+?;DtLzjYV;Q8+1^+x8ih?Sitsa9szOsJi88h*oue5S;%n z3Dx;NifLphAxOcLe>|A<Gi&AY6ZT)h<~<tF&Ys~eShiT@JRjdY-)g>rXzh(umWL3S ziE5Z(Cr9Fyhg)|!u*v~D@;Rjv=6#2$`PEUh+kJ9+MC~x5R>pBD;dIwJDn96_lz&}S zd4+MeYdOv-eFtv`-EQjjioql0Oe<G@K45REH0oYj5ZEWDxiUUD4&YGSxS~=_N3+}1 z`@-mW0!W~`${nWM?6QaCATu0<r`ZvWFwC4PRMrS^aovdr*}z2!g~B@za5X4ZiN_!W z%5VY?unyz$CCJ(B5Xl7h5H_@SPV(Z?79RSA8=GbD0vZ{94#bHc!}uZDQI5CTKFpdF z2+`%-g0NIISO(P6Jgg?^5`jb8{Kx%doAc~-jhy4DvWU)ix~Y(f2roPE$OPLTI_?;K z3^1p$)ele@ImWzro8m_=6YszPMzh-kH^6go4?WRb{QNn;H#_~^R%21e|Ec>(O8e5| zAh;BT!g{P1n1$jTf*+J8+|<=0)Wwm-VsPDfE=J^2XL4qxW!?lvfmksSf>kXZwOHr~ z+W-$-!O}#37e_aMGZ})~7{@_l+M?N?Ci93^IA%$()$5w`hCSjB;p7I}&y?QVJ;g4~ z<vdvhnXLIhv0%*p)-V6WFIUjfEUx#C$$|nFfD59+0BX*$l3s9aM#<N48Q2h546~k> zi(qJb1dhM$1-Tp>K_WEEfYMYFfNBy@%wZ0w5M!sOP8N{{N^?muSCY};4uGN@Xa|Dq z6bQjXn0f(7G0vCUhU02*3$s^nAP!1q%Tg4`G{6P2BBm+t7UH*Olq5l*E7;<yp%@%L zkqg;9-$rgg;@LP>Jm*sup67@+Vc(yBMNGw^39yF|Aj|Ygh-0uIy3#X%^tx|H`2)Z} zj}o6$u@ec&=IWvkL~g#4qmP=|YH2RoVdce3_`E#cd$4<!63l>i3yP%dH}0T-^h{UI zTx5njHUfTDUNQ0@;ZGHw{s}k|?G0u>|JVM`Z&t25OlfxF5d*uYglh0!)7KWbXBApz z;<FQ8|HQ|md$SX44aa$(-X}3j(plIufJ<*Y5=Q)gNgDJvq$xLVoihn0&E*}gzFEG* zHI#f5eeXWzx>#-ifSMT721C?_x23qiljLrMg$3CR5P%mZ*-{|UU?`DoNEw8FC6QIk zBu5qlWz+`;+9%nWQq}u7H{5XFOGt5wjol)3z8%~Su|Y_8N(XE~NC!4MX0(u4yDbld z;2>fApDeR5J<^G{GAD*HHtcjjIpmC9Bdc>EZ6w6l<@-9~D&uU&i%7~4V3<kAZ`PoJ zxWvdDR_Cx;v$>WunU=s%F2Nn!*(cVnj<3go^+5*YnE|D-9@bkbgj=de#jtDb8k!oN z#~e|^a|9Yh9l@Lzv3Q)AW|~9Jxg#x!6crx&vpfvBTcjlz;t~PUI8nfxhLMf`*P2YP zH~{|Ak=d!)&;6E5GyY$~_VGI?q)SiIr_xsnA69r^AY%Cn8itW>Iky3Gv!zMxnS=r2 zJhHE=zpA*_p}1}fHV-Ha(CRBySCi&aE7h*e=|+eNMP~(udw8Gr_!ub9W#y-*N5d4; zZSVcm4_^iwZ3$G2Uqn6gi^$gag=wD3a378x+r=7Jy`mI*2<%?W8!4(LfDi*FDqmMW z!08RXISU%$+l6VxelN}=(?S@`F`b}0J7i*fY5N>F1?vDGl&++J7Vozb?+4+Fg|DD= zQe!-==pCgkye6uaO*(7W#~+mWaNT#RS#D$kIpqf+AsaM0TgKC^*+%G$d7JS6g%lY7 z&vjPo5xCSf*w?LIATay~HE!eO@(#c&-XqPVOxRJO%vCB6vgmrOuX<eVKOxHvf;#a$ zts&@wLYnb6BI#=lRO6qiS*vDzpBKPx$x2I!Z<v?(=`3-tB{m6hIauQFES1<08l{b| zp11K+S>g@0v5v9tV2QuIRKoMW2TT0qyadYsqLal`{<|y?Q=yA0SC`&G8sWnB5e>^; zC;lSwGW;I2fL*a))Ceg$fQJMSum>X_dPJAUbn5Yc%isZ;{!}?Fcx+o^)sZLQw0vCK z<D3J;pIkWF3HNT<;DG}IST#Al?a}#<N9RuX7uNK*uMZ!@4xLAnU|cXv8X7>r=HC*H z&DSH_x~Gab`m{+lB<x9s@o$UYnNWzB{NY+P`yaOa`;X%9U)>s>s+hVM>D^be=l}0& z{CC+;zjb()=Qf6H8NVKi0WSd0VEl0$L6>j%E-%o+{n(cWQ5i7*KXG(a4WF&&H3zoJ zbm#*022%AK_Qy0(!>`V95wFwrIq)36K9$)p-;QNaJSQVhTqn{RF<ompL7DbsdP)FH z=PK8{fQzsUC@|UMdCN!3r)Sx>RP{!^YicLM;fLum-fKR8xdV-P-FTc~;pxZe0CP+i zXM>pgta@`D7}rCwnR)1E0Yy)3e4X>3QTd|3IDVnv=tsYp{$k#OAZ8uFh*<}`nDxOm z%f3z@g-V8B+XG@&E%0Fc-<Rv(`Z0pLvC8L;ZdH-m$o{YkuT&WhpQ$qu6^V`9il_Gy zbQ`}u10JBM2z(&f{O^j0(|7<eaNG_>`LS8W!Dut_xX|Y2$PK7e%f2H_>r5VeVlY6B zF)%F0B%O6oO^D#!*Fc+Me0`tZjutz+q7%{>SJm)$^)x2Yt(`BTl>z4yWi0EV_N7{! zN4p@6P_W(9>Df>Y^|>KXVpT(xryJQsO%o_)dx{%Q!i7LWmyWHe<M%FN+|!U;-bx(m z7V3LUGFm5wBFP%a2jl6gy{P1_gRY<qf2$eti>l>YD2;7OJS517x#tON=KkRw5>M41 zVu+t$55vS~^<=xblK*-u3ET_Lg)q};mF9%G3$RE@Zs6_4a~EKb7!_ZD%tPo#06JDi z-F*_yMYk4lCb&zZ_(DC`RDgP}%{z#h-=w06@~oPg9LhN~)GOy$$Vm%gY!hU)+)=1J zt<PBY=>BHRH(c?A&}~xahO!mvFbH;T+RnBf(Awv}8N7!3c4n`OlUsw?FID8qXMiXn z>~7K8C#VAWs>knOn?!Aqcb(z4vmgJgqj}_G<3}m*0zu+%9IlfKJ^nzqIUFinVa|Nq z>kZp#OVK<ysZ0P)Oq@X*@Aby!3IdcR!=%PA@PV}q*SdG57x^-Yr$9hpnblgV5gMck zGN}5}l<4bGm|c`)<u;#p?rit=kB;|Y1i`Y%zg_m&3nR$Nl|B#*g0du$-%Ja!d*$rd zG!Y}N;tmUAf8Webj)v)gxtF@dl{3AWkU51wjX9RZaCR}pyNicB3b$#G(MF)7H70j& znl-TC*t_}3mT%O_o#Ipc4=avF3kN?z9SMj-Q91PRX<*HwdM-fdsIl|J*s&F($>q9x z%C4OSaBaX^*Nq){wgTKSP<D{2YZ#eJm^I=EHJRzq9Q#~W(_eQ(HQ<ghUJNS@0fx;@ zAuv&4P?~gIJ$XeTmEm6d@jl_c>C$F2MnPGTN^x|_OdY6gLZvHMRu;mxB?SO%i2n9F zP~Ka>w7jQf<kao3Ww?ihKe>kmQZh3J>VI$Nv<T|6V{sig&JMp+hNA#sAyW-=MEpOt z`=RO&(?N?O3^!wkSM{7~@!1_YvXRQ}x_KNRKX`0W5uv115n-paUzA>rTlmP=M}Xi! z`P7bA%5&n~@@wkKrF_wqX+L%4zI>?6arF=;6E)`p<x_KBDUT?yeK(4I`JzYDe(KSE z`B0~|7E|8axDJ+2t$L+A0><)j8&Da~qW#pdSIV=K^W=88p4mXKAcw~F5!Img1L5dO zMqr;Pka{i};XJBz&FwkDa67|FdrQ%vx~Cd`8;Wltdz(_Tq9Bs+S%S5?4?hcP{&9T` z2~IB37EkH**$bbCa=@9{bqI4PiC`$7)D%$xzQ>$s&Dr7ad8IK8ax@Q-PJ>K>OJv1I zzMWu;TZ~PiPbkmX^hSm-WG<p*!nPkbYRN?&0|e#G^g4s}vh^G{Q@CD?hE~gHpeuHu zFja^@Me-EW8Q{lKSl+S3f)}M_Fx`9rk}|EB2%vv`>nuz*>}xP*;5r-4$VPV7^YCgp zm^yt7dhIa*=5cpNY$ZCz)*d_IGAgdHj8T~_B4NZL;Wyz7dT7x>V;4P$N8F!FryaJo zHDjze;jB!kWGxvNXsn5Efo0t9<X*=Fgvd)rI@n9iDnp?o;DK?C*M^(a8vna+nQ>H) z;Jt`s8osln1Rnof-2kvKv)jYFlYMf*m5u@L1qn=W*ChZHbSw?|N70}dlT3?KSHt0t z4!pkFNi^f1w@KUbPicu}<J#p=$!P=GV88ksT8q60_-FUUA;H_=e9gqL9MUKuB3RMb zc+d?4;RRcCZFR-&COZ^uM2?!kW<}4n*#<((ig7Y1g1+ZpQL6f<xOw`ow%)}w)2tDw z{%%%;A%!aNt|_C&CCt5Xk*jaNv_tLCf{&=vI0bIpgs3yECnzeI*ZUc7+<3;3(;>|G zR*{mHXN;}nmCd+#2{d+XjgK%65S``a0~~#qA0e8-(f7;+7&=eSOmaWCk}Ecl<Ie<t znZ5AY)ITmX4=<vT-<wP;FvVDb=!&b7LNo^MzWJ5cHl*l3D98_Y6jl(CPoMP92mSLQ z|BU=I^v||`w*0f{pAG-45AS9SO$<&f<^L}y=8zWFhW|#@X%4F{R$rBjh(^xEBz2|p zV?6#r;mx<f_*=D$42OTWCh{~na$%q>Kr{Y-EyrF1Xr6XZ_$eTQ);+Ds&?XYhAab+a zS?x~OKcPYs-F_1T7-VWG+IejgHe9|Tcu)tl{!o?v{j)iKSSC~+sFGFpPb=<>;uV~- zIy?S%P+R92ovh|;<j?T>wHuB75C2sd`!BZ%_g-+tadp<gJZXwXaP+lpH_zqGkI0i2 zk0Vc7e2YA3@eR{A{v2B2&jtT1Ql$}D#iGC!6)JF3SC7Ry)vuDZj1;)RYJn}IM4n@P zHMS`}%_M2rlyWbhAyvr2rT~RU%p%U*kPfd+{GWzzsH!(t-gf)<7AdQKW|6Y$xs{Yv z$dWQN3F{2mnd}Qr6f82;bEgxVP7x0jDi{|sON^7s#k#1nZyw8IwivkBq|+gQg^ctU zY%|h=t6sSI=Och;Z5{vxQF2Kx(&hiy4*&V<h$UVB5Qj-HJhEd$)K2Q=%IZHVMvNZF z(5!82tZyg)Fo8b=+YimUoo+l5vd5qAvVl<1v3N~4p~X<lfJg8P7FXfUj&qAZ(@EaB z%^)|}ZPPoSL_^uW7Q*sAE}iA(BL>&<-=Jkq9gz#s7VF8UL3jMQFlBSY7}ygGqDOXH zJ+pf*g7HSrj!CMbEg#<rxrgk7GHx?7-aV*4`;H;QG;DpclkFdQmZhCXS&=-*0FZ|N zT1Lgr!qE^T@!W^H9b^AULo|Ozkk!&-xA;XyM;4)wWK=ZyZw6L@4Ow^89a%JYh5^Q) zg=arFX3frAq!R`^&*rFB#)(R|JjNX~HwN(dbnEKZHPwf@k)s7J*`sf_Ah*?b`-j}; zx{QE2`B}`qZ+Tx`5SJ0aMl(K1aADlYwQ9>+wf$Ok%|!^X8h^I|w5_YdHshVvE{hb6 z^~f-9=fIjTwPW4DnWe>_FT72c^@osRBO%4qY|0`EH_#l51K=u{zl`v0!(5PJI2flJ z>WMZGQ%dAqLU<OB!Xh-lh|52>^w-Z&w^tEAZYbEGT&^q@CYQTTTm->f=Uvu0qTvcm z8`=b}U`KS%aG|qQ)_3vj2XtexkMxVZ6;3Vpy9+RvZF{%=+yq0(q&d97QMdb{?$CBd zI%P-Q&bPSzhpENj7?N$RU?f|nz{sT`21afs=FA(9-G&n|mDuXL{TSItcLYYlUKf+M z<$ZM>-1>9VoqOu<BN$hp6}sMu{5QMbH#vF_InP>jg=}Ya&Sh9k_vr;B&Jau3Jc)^A zN8j>JcT^}40r?Qp=&)AK$j=Kp+zd$!#(S$I0k*A>1f!jk!wtwP+KABkf+2wgwO9a= z%!zH@GNG3ubf`5E?$FRjSX6?4ycj{Oy(B?|1fanil7zgD_YpjNfF7!wp@+ihq=lfz zFNhZQH@1os%k*?89o(1(=0iJ_2Ig;H0S(OSz7!3-2>wSKt8*>Qz8w5N*oycM8vyxk zUMvj8e}0t)_KSs^q5;~F1|l8+%!rl4sBslGu%Ll?%gZ!SV@eYvZ$blVzN`U#SpzD< zc8=;VO9Oi3#ZevFQ5~MM{2OXOwDZa|pux-1fCewg@V~49l@l859lopqp?|(?4e07B zNzC<>6eTyOMbXA9*MM5t|4nK@>n}+VU)F%iE?`AZA^LuGt1^H4Weo^b{JU0ZV6LaU z92%gFSF8cWHWtgs!EFHB$Jh+Vxj*i3a%YQa2Ny90g*`%%y_x>1jtrvVi}-58bMU05 zzgAnBUfQt8l!Ip5vvW8vI@B|FacKZD<=Im|z<*cF{n#%5#Lc_>6aVh=Py4{FK_B7P zh`mMHd*nnLnT0#dDP_~Wk(&$*Kw7sjzq$9u4us1*XTU7vI{0549>X+#6)VtC*EB(t zbXW}Tz5S=b&=MLa=R=rJ*mHWVGxpzXO^0g4b)3&+ix=mr_$X3Cp+D~@JLoAU>`r!2 zMzOqa?%x^Dgz-r@V|-eiiYWW$eJv*?&g+(aGx0X;kYng&bmM;CJYI}$VY^xyQtlb% z4fcEHUH8lcz~-L$sC(uzl9g6ouEeOur0rPPHx8JQu)f6l&6TJd?3<$<DW+fMr4<C8 z2aHrJmZS*y91g#KtsY&czbd^M+vh7y3lHIF4N@9B;%2x17j#5m{MuVV%k{UKVOJEC zroc~cn$jqwU8o_uI9?DA9bpV^X%o9qtuIqIBSyZ=kcbJIbDCfV=ixFCv<j<xxSg?1 zgpt@#h^2@KJyopnn&AK$oI-Q^jkP*GG&A?N?&0o>0G|$@UpZUGw>(=$?@|L^`eOL7 zanL<(0;(o8s54)Py4VHh4y)dt2kT<cf}EY>I{^eAJ>3kv%ZJm}<Y2xAwGyQAw#hCa zzd1dbmO&L^>h(h!z<?ti>_UwU&1CtE9)~7C7P4D9(qvpd36p93jy$;h-h3?In@Q34 zqw?EKFyZ6iUI&9s%3+*x-5i{8(O2oI@5fnB;-IhfJYkBNsqo3dH3K4WmI4vIk{UJP zZgDELB%)s%{=h3i##Uq;ykca;g!;uqMw)w3WURe*a2XkYEzkBZV<TqLFAN(|CSN6N zOjY+qv60aiY}7jKId+f8C$=?@<!>|n6zq)mJ$9~__k@7l6gFy57Vr5i{d^f4ms#VN z1U6zIewDB>P0#;&VB<&DGtWEsSCbwkg*2+4`tI5zld2cd4bsYBF6iK`3WS4v5tj`R z6KD;GXhTSkQb<<_=_-XZF}OHWDGGfdpDT1i94AzoT8O|PgW7_5qq3!Z=EI1^h^#_O zjBq{5dZ=)HhW{tsNsLe7jD8WV5i$uUP&UINP{w`AAw*)i^02gVU)zK;Z_5#t$~nFW zAtJJia3|w#^@3IW+lsi`2ruGrt4EDdI<ICE`d2->v_W_+PAb|{si0R|=3CrwfM>W4 z-?yTvXUPCN`EjoRM`U4|hn2-uyQCphMMLP1b+JTx4%f%nyMUO|k?3nxK0ZPoMwp@+ zg2A+C2>NeP>eLcUZ{PvTx&E<MTJKL&F1OxVkN<!WvFTf>9tdPpE#OM>^p@E*QZXV7 z)X_YaPxS>^G@rtyqpbd_#nZMt1!(eS8uG)7fCxQ9r*|@JS3*-bq+6#RmH0rl6A&y$ zRw~hA0TvFi7qCR|lBxo(7S<!KN-Jp%sD5quWs3M$n<DU~zlsz=>;KwO#N`agd)Wy` zho2kNLqcwrHh%RZk$o&eWpZBuH(i5(Yb_<)LFLuLN-}2&kTonJ$r>tM3HD^Cx&`sK zF#Bcu2XPh4KZ&Sa{z*8~@=w^j#uB(s^wFd^Nnw(y0AY2x*Mq^8y&jKD28gK2-4Yys zm;y81e59n()KVu;uNdH*<KBRuujLlL@N@Pz>a)4Ov7y-U?eGad=bVtd{0MA$z<>2} z>o?d>M(dc+6w-Pl6$!F+tPaW6-9@_VW1j{*V%Jx4Dfnc|u!Q(+=(NAt^~G-k1pUpf zFMf~q@p2-nxyHFG_q69Km%d6*S<h8iX6NOA=VIN<KG-nZIaIi(1=yI6s@oX;M>RQn z)8<gA&LAY&)N-}LXNg$HWMCBAC(3tTvmm@3lfxq{T*yaNi%5~o>?0c(3!p^@D^jnj zG?a-zcI<*_N?27@4DC~+h``8o6a8%%O9~mh7X;(u;c4h6aXgX-#Bt6T$!tW%4Hlq& z$5|6=Ah=x~SHz>x+-!C&1h;sutQ?V8K>^8_SumC~tcnWw#}K#ZLjK<NTSVSjrGCs> z>jsaqv0l_7&@0MgADfqF`BScj-K-q=4l`%zoD~&-d@!TvJmwbaT70ux6bTMN4F86? z4if|qp<}fVKsBr2h{?~^nN!!?7l%^fxGKv7J<bf;Q<q5KGy*4Zw+Buma0FLVfMY|Z zI;sOu@D7IPcF~h!s38V$4g4KpV4H8Q)zpL!fG5Ws%b=z-;+scvEEorEsG{z|v#3%) zM6>~i!RCsJRx2B`9jsDi04m0|6OoV6PJFW+RFL6czpJ@}^MPFxDW)0__ys~wRmjy$ zFeZCbm&Y?lp38jCs)C*9ew4!7hDhGas*8e6p@ZY+D?vX!LA<0;KVh<nOajcH2u6(a z&b*a2(tbN>f{%4g;aqYt3cPnx`SCFJ)Z?k)A1@ld2h{-BcTZ}%V*YvD_E$(4Q+vGY zc&O`vk;efbM=TyuQ4aj(!3;HiHp)aGBNBm(Sb_02sNiwAFuuP_6EVPq^+O$j05%hp z5sR;e+AlshzCp?_f=?$?Fq-cu=7kJ4x~X|A7S!-kC07^Ov(0Fu-XR@r&{YKiWLL~0 zXrgpgMOQj1<|Bulvq`!)n69IBAkh6I(?Uf(_*n^8Dwr{AG@(b^My>I2I0ty_R%4LK z?=gZ&?f^!lOZAsCz^M6&9JimZW}lAD*Z93>^3fUaB@)y;B+Wm_(yqIv4|cI#ldr|w zdwG0?Gdd1~-Yrtii!@id;|!C5@lnCmBxCM{2P(l*{8LRgJmE2IAApM?J3*E4Z`KFv zP4Wy(*J?iHC{!Y2id0tK6Wjn20U9XK1`mk#85SfM=^~cdK;YCPT&X#Yp!VbeG58MO zOW^_j2DtMTgYO29WIeDg$lT-{mO{uE9vR<)r@~7-ig5@7D4oL?fElvm#d+kJNMI^8 z@L$V+C7sGp$_2(}q=+$$h3|4|mN)>rDbWF1j@EIUz(1quRsfq+9~AYV0itqm_Di3w z#&0>SYEe+S4fPoA?!)96HfwI6L_si*%TNmU3dYU*IC&O=D9r6j+&DLU0swMca_mQ6 z{d7@-V)TgA)>$mr3j-c{jyjGUaWsg&qc>p{B7aRyYY69qeCs{Zk4<C3Y-OE31_r8+ zC*G?-jY!CB=dpX`Xw`fm(^_%?ZD1oHt;7MYU<4>&i_@(Umqj;_w1xmD8oEFj>(^%g zAKQK``n&-*IHO9{KX#Pu;~E}v+?xp{W+8WlGwi`toA2pwyz5VD0Jj<_NrrKwz_2?e z?r4>zg^rY{yxXRJCEHs<cFwC^3)8-~O_sA2*|$h}HMym|0tDm}m_)Un2txI=>B*}= zB#ibnH=V!Pd~ABkHzzf-ue=#OW)p39YURzMjmdmxenf5VNOw!}Lhs!@I0`NF?8jHC z7aRU=*5j7mK;sLOTLN<<LG2bTk;dKm+=2QryG}SdQ@%=$Ssw0nr)KS=XE8!ue=88+ zIDyb(B4jX(kVnLiY6kFnRLON6?+DeHeqVuQ$qGlnP(Za4f~q^>$4-Y=f^}Z+Zn4K( zJP1!qSJOO{XLYSc#kM=*5G(tho-M+Z?5qx@l75+nTBpYh&8#{-*QaaV>CQ2I)2$As zyN-&>5xd<oDozW6(2OPMrJA_1jAYQAjl12Ie$K^KJG<h7ZJzma((xcvuSs`KETBUV z9)h)5LJmW>4x{N#c6VIu;`WG>*>|Mb(flNhOkC*fHdm^R<K$(wc#1qCSlwW@L2uX1 z#zab<f{q|_!f?6mvKKft)Rq>6*z|{}NeCS0laJBLF$EDEB=vjAK2N$b)OnVnAv-sO z8F_}^Iz2hKf_UQ`&z9mX)+2cak&nsHwvwSS$@}v31X5Lc4X!5H@*Nsm(|hl^nK+lO ziBE1AZJgj2103@U4poi6A7$E}*cGt|o{o)T;<0q+VuBN<K}P(CAdB@SV;LuWWhGBU zV#E4cP~HX|>jA}aF6Pitw99?N-NvL~224mykmK!%X3#`Y<63?uiuX@kQZ)yQ;wrSL z=aN~%RQzfiSQ$a(2;5Ww`N?J;#|5DsFM$b*vNWVxJFC0R$33OW%NP~<Nf{M6RTDC^ z>oXWDy-!b(!T`Ts6YW(~818-3vy5f{|0}dv_yOKNP_fXun_gb)zox3)2LH(oI`>>k zPeH|8JPzGAWaK*H{5H-++B!}yF<LiVCV*u!w?rFq`s;Ak>i{>KkZd?W?op?{g38yN z(UgJX#+C!2-#^zKd+wg@FFvhS30hdsB~vsZrbMik6r2L44YNkmr*{zU%@goZlOr6# z!d%UMKV;2WuGjIXzi}UwHq`~fX48Y$lx7K`ci^(zvBRCz-C39(bK@8NIu;Tkpqe@~ z#^U4yr_k;hDjnODvL}!m0!abVI5EktreLtUQ#@g9_a<>zgXLua!O&oqaUSge%DLQu zm!{rb6Wca>hLi|lz65h6z;yd%#~sZaj=1Q-8O?edoH2M8;FMkZFl1(VSnwj*8<)=6 zSp1mP6O@=@K#(p`n!=DHuj$5t-9cb;bvNj7@hh3i8RiE@k>exT%BE~Zedj#t73m^- zc|Z^61jcEVV0nlNn2HE{t<=8Q?Z`nkgZ+pe=#;4vqcAvZ^D+UZrBWWSp&;GIeN?PK zVM|VvbQutyOGcyCI-x+6Ep5t{TG&!7PX#=kzojj<nM0@~BZLj8hP4P}EIcq6$l*LN zny0$0M84Oc`6UJzd~h%nJJ|^U=tgu@Az?=l>zr9MkaIA}BND|%E~;#>P`@|_x(3p) z14K2SM)s!UoU8=7kma@;G`%7Iz}=RZlAK`>46JM!`%Toe!k}Z-F&j$`=spq5JtR1m zM`R7%x{9e>cR}8XR-FDr<6(IUQPYJ6oKU@Ya}v@jiA=Ui`V-jm6I1R0=HD2~UYjSb z-2mJhLD`h%b*y7hHfe!{0Ii0kHcnzf`mx|M%#`2mk3D`L$xTwU218S0@xI|ep^hI& zc5u;y-0b%?M;P#uv%4#2cR86C>nJwo>>@2qXk=Vt^{UM-Sxn51alPExU1qcl`mUVa zrN!)A*AuzCr{PU&kE?++tc|3D+fRyUX5JLvnnwle4B8t{9=-;dPwS4cJa87xUIsiI z|Ji6xHVL1nk)W+a95%OeSxE~a|1jJ9d)ENv3_^Y!#P)Fh5_%!^TgHU)qf0JD2?)Ls zB2$);T#MD_$B6wTAC=S^Sl+SSkqHMW!2-!B0#>aIV;qU+>AguYyt`1JcqU#1)RAMD z1g^)7Ku%ulp);uvM6+ZEBRgc47sJcLgT;r_KszK6vJ&v*#$D9{m?P=-`Ui-K9I(@l zaV*-E#<K=3lo}LS)L4N<kowA;u?5oDV$SM{E0cZk4p`d#L$bDF%VClHgCC*&W^#K{ zDUnna!BN(RkHLhWu{Y6499)0azOQU4m2I#p$Vp~-G1$%oAsG8ZhdR6CnmPwx7Wl-P zW3Zu`tWCpXX9#Izy}}+6jK&OlGZD8IpYOPDIyf5$7fcTR5V`jdq%rispa^_}0hA#i zcIZAl?3*FshFBNEP<;~Rp}RdL#QOMa7zUwpx97WcIG=7)rjUjnxyo^+4XTl<!tpGp zeh}qIQ5q0RQzY7Fbow><w3ZnKV_LQ;a`}ZP(?>XdFN3h8)WDd;GqS!+!uSZeX?&cT z2L%Ap!R7AOCGZKbTYG?EG4&;esPTUogV_X5R8fs4OE4r?UoCIUOT!xz$q}?GG5Tf( zjKK%S!S<cZRpg!yxsFI@WJvhtfoXfzis${)`OHyw?b!#;PAX=|(|dEXbky$;nuqDA zNvJlN6{!JYYL|GloeY2+;$R&)Yar4X5zOUb(eZuLR)eW+Gb1|6q!#L#hqg#q!-eL4 zDw(Y9ek$cXAV*~jFH!-BP+YVvM#C0eC)&C<UTIg>?Er14^zldia%Q?)>2QWJTdZ?% zyv3ZtEX#l{%X;90Oh+JJ7k8&C+X<{GNz-LJk@Lu5^+|z%s~11;QDw#imXk^eDS@Qc zSs;{&uL9tvIRp^k(j|pBTZF@3lA^X5hIXPJgnqKJaT?g=^?8S|y!SB!dqo{uS{nE9 zhqoUbCKTfis|@X_*!2^L_B03E9_v0|Y8WaEOOPJKj(u|;nr`Vqkd%)RANyyo73-S2 z9vVZIta-4weWa^Y2$=BR#LJcWrt=3Ky)QQ)_mAKR^4PP^qaZn>N?6?poDLeKb3B22 z2gft-!5cjR1YCV&_le^2HoL`$pB$}Z8wn>wQ(O{52%R#wc2J)@Ll(@XD#4M!lbV^G z21TawAY`pPEBN2(xV}UcD87aDB))}hm#a<QHMvb>@sg7?Ixw<%ZJypAO-5V%x)i^n z2suV&iab2Ocz9v{5DkT)L`kwem69hWReE*E4CPvkzsAcpUZ}Ke+&279Bn3E5AkGNu zAwO6GRz5rrnU|Z_F>al^hXgw_aBbMoFMBsx5Z{^0tR7x9(~XRd76x(mpI02(9DU?E zkXs668C;DFqV&KF+<Bub!;8;^YN96Og{G*Sswg_{DHNK*EVhm9aJZ4348Kb=UFmY< zY*g~KdwC@rKMSV?<KA(0(!!9cvXQ9DfZRrqpD#ON?HP^uksS>fKFIynvqKXBtxRP2 znFjZ8IL0s$4bIapTirWQx<9Apht;{^A2>Hmm+S6hVipElJd$z()%*{jw{b0v0cj@Z zM$0~dF2PkZF-snNJxO!SPpTK4r|>H`aj4nYu)KewQp_>pMZaX4Jgi^b&s3Kc^!@7Z ziIt3g`ECyiX9x22=p%d>Esbtcx^>aBTQm{64Gl0>+UyUieDuIzIcoEZbznKEVN`2R zkN>w?c|W))TurZ{!X>iu1e0fZGL9#qNp$i9qAcRS;nT~Iu0Uep+^)j8O*pr+gfmxP zAc`GNKVQgI0GkYrEjJDWrx&&r9tdZh>~M!RY|Q~@)H*;boWTR(9N>2Ge&_H1%-=GK zkgo$^wSa_IAPNbXTQn#n;u(-Y$|WQK${Z5ny7T5qfdo$i5>-ON*lQtSW;WX3!oJ}@ zsWUL)3Tz)}m~(x6W*UiEy>UQ?tt#nrhA0fYRg?~S&}Q-{V9%x6CV%2_q<_+;Qj$Me z9FsrHa&Tw$mg)K@)GX)upV~gNP;Ux~Ny#e|Dwvqf!p)z{eg3C-psrED;6P>dEVf;d z|B1DK%Y5zc%C(R5zH6_1f{`JLUcS^PcsE>Yc0u-w2}dE~hnqK0FmCK+LHMPmz;CQ5 zEZ#C5nDAI!B`sq=h%<6djcy<j3>YQJgR|`w^_9H|drHJI7at_pA>BYdZh%bY8e7l_ z8~_TNtK$|K{`^|K2~x-Tv|2?*_B;}A_%wwfA9S33Ay|<8Y)6**nxi>oi>0CM^@`|= zMWX@G6<)tZ!|j!ZQQLU*;q^g0AW#)5F(VX1d~HKUzRGV9mN=Lr*R;%&6XRoHGeb%- z7v919*BTmGX_q^d!qH4j2#}velmV>U%V&NfW(5UB0c@6!M}!PJfC%A@3v3ACRVOGF zaqaPS<oz@#K7KP`R^KVN!_+Io2MT5Qd|M1Ze)Pi+pt6$?3T_a&OGFnj?aG&-`%F?R zxPdC-7_-}J8;}IpyObfr18V?MZpNq-TThr@2<~VZRtPW4I9j_)1`_RKB9DeAw!gHT z3)CqsYJ+7{7k1db@zQEE2MYyGrb8JDhd`P@Oaz51U+>8AE6wS=gf4gpqS!CIh_|R= z?2Xf0;8IpJvjH9#6ifs}+Oy9K2XxI_wVG&%`6t6g(FD7T@~}Dl#X4?h&L9T2C<>Or zs$dzUU>Ov_;&pSdQWmurEb2c%6Eqc}F(%9fDGwB+e7ImO^$hk1a{-`GuB0ICz%<~i z_!<Ahn)x#5u~P@zAtbVr6|pIm$ta8Jiocp_Tv|J0<Y#+1@mqD%Uay~Qo=huq#k53% zmU~oQf!I`D2CguU+y<<OO|CCR`n<T<WTlvkLh5cP+*30$4wkv|59a{(W(MHVQT^J= zfwDxeZ%>Qk7b}8;R1bhiTwhqFPz)o2Lh%P%m9Q&|sov}gVyv96;F4;<3Z7V6L9lyC zHHc-r!4mcaCZww}W3G?cH)AFn6HhZV1`j9~hkQh1U?zA%)+%kVu0a){y{>E8XC!2e z9di>5FDAfK(p{6~@jSC;B7fCsrz{tNU?7JZvFNYwmi{t%!1xyNGP<BlP<*kzfQUR! zbheLR3_eS4a!}&Lg7moe8)_zfu$TnZ%6Hh{za(7|0V1lSFE7(o8Ayx*2*CcF@iJXO zi`2_S0jUaIVfj))b^0x90A>}eV<MfiIcMOSyim%!P&vo|$jCw5h~B~^CDwgD!Z4Sz zYrgdS<QsOjz`C+;^5J5Bp@1*XPrh+*euZzecjCvZJ~7!sn_!NCIVzwbGC-LvhzGq( zt1*k}RL>eu&@BDaILM~s&Prcy^@*%7_2?yLz6YkwS;JYS2*s**5YPrlygp{%#@>uV zNIm_c<y-9dVatJmpk|iC<Ho(Cap0z+3&XDr5eVBoH8fC8*J9V@KEYv&mONeJc5~=| zCA-Yoxn6l<)Z!R4tbPQ$@&jL1$=vGF=h3^>2VY%RLwSyHsXa@w^a~AXsW2q<I)ZR- zqcDSlCGF<$sG8}$6l%9bQ&2B>)|WXODU|8p8`Y?yGNRiq$K&%pv4Pjbu6=lnpDJA) zA832rurmB=b;Q&CG;R9Dl*2OM_uA^iioxMU!Svf~ILE(Gr=Cd?-gzEfq4b^v7IlW( z6?Y*-(c!Ju^I#GiU#Y*EeHhwje2UGA+viGGC1gg}e3ez^Lk0MK&AjifUzuot-FErB zR6Z}n=bcp-pF~-g=a<XpyN9o}{TCeHJ7Om76}n*2-<^`}{`jcg!4S6y$&PZvDRmO) z>Jw^d0a*?ai<1er>OXW1V$|wW2I!C1_;(%p~}EeqfFmo(2RyQY^+ki&b-<#Zs%! zkIxM6YZ~q{bs0KLDlHyI6Tado^uDt8I~a$`Q@6IbFRhK{Kn4-up<r*{KK!o@bDn*Q zxl9|^%B_1InuwpURG)Hxh#y>n>Bo7>`~vrlF(!Xr%#XYB0~?1^y0>dm4Q94dnfz4Q z97ib_^hmp$5G#?EU1Z)iS_st;ZmKau14g?y{<jJ*Hr|hGQbP7H%-jUby^Cxhqhr_) zRf#}g_RRIDaqX~c)lta<7HAUBAjfElLaKhDeK4U=oUjQm)n?V+KfB|J;X^>YAs;I& zkV*;lgn28>2V78xA;Om11<(fooeB(1Q<N1MI^c)!hWEt=E6~OlqiJh!N4=|dYC8#{ zt_)_()%CIGQpUg<F&`Q3(hUFiw%H~SyScI$8fh>vg^3PBuG7O{>ZpeO)vW|p<b5m+ z92Y(=ngeqo0neZt0LUW5R)tPbn9&RSdx4@Ht5^154ikQ#6HAzHa?yRBbB%H4Hmr1o zMqS$-lcs|-)vZo*ME^^tWOE<kC_$eS+z3nyO?$<50ID&B(b&}-M-ISSA&fuA%HLk0 z<LE8o3K=SZi+Ot83-X6|uylP~Z74x&m}1=lIr%s|;~fxdDnzF2$oNgRTH+$>jF@E( zNCl~hAQRk{EH1zd*!72h8h`aTII|)h@_+Ay3^Ce2=y<?ASF>vPw`;B(VnwgS;EN@b zRKV0CDkPA|8Rsz{CS~v`I<MqHpfaUmms<M-r40m#1&y(?vO}zgeKh@Ya{+=lno|W% zxbtITRZI+`W}Hq103|sU%HXyJ^gKip)Alwxy2X!#V+JJubla?XN&uig6i%8;y%95} zLem~wJ?H6)T$lK~6c$14hS)1L_~H773PWk0!SvXHrbUzb->ozod_z@L0L$wO;Zni| zk27!rO~I9l|5~Pmg5q3UNj6Ed^M=_=Y5ZSG#yfBR7-EYu_w5?HU}l2;kd=m+r+AAz z#oTDBk|IAs)`n^9S5a32R-EI|1ce{NPz98ajNDG?7H$fL0UY62^OX!XSUj=XL1V;@ zoKeR>S=}2Cv?>FQm7>_efr0?50~HWc&NMFu3M*Y2DDUz9?^|%qc4*t1v)kS_{DbXg zbba9cP}rp#o&v>gQYX^Bp*|0eZ9dNIH=lUS^E20G-#hRibI7W^q>l8idADZHjkVZW zy<3wT7kBR2Bv<RVf`@UNCMq;qCPA>URm8$fCUDNgDc=O+j$fxk^XcM&@IA*$^Kp8D zG>*%De_~B!TYHYcG)J7mvmek0?`f}p8?QH>>yF&he#oyxbj`1{VtlA@A)!c3`y_*i z>6#x!=GzCs*FXcYCyHuii#tU*&`e~%qA7MB#L}>H!gMfQNir;A#IV?4{LOmO+B{4^ zgfOy7tk?>kwmGXHX`_z8BUT)KNBqu^z;k`Y*N6t7gjS0>k6Bora)TEyr%y1-5hibY z+k1G!__n{j;F}k9^#J<sWEd?s8_gIm{vQyVi)fV_xK9{wguLg*DfHMnx7I$^loRDJ zqWp0!cIbGB`89$M3zguD-eRG~Q-bGIc8>H*g4$CSMb_@3Oyk0G_?CJV2t?E%|NXhM z)A2V0j`<DdS)8OsaSLY@=S*Q&3YCj&RYi90X<cYpXqff!dB?;XEe+p^1Yp8Y`C`Ix zi6s*<Zs#Ru#8jLS6N>~(UUDm)=d?(64@k=u>}5vGMyeTGGA7d(ipz56^VspuT<FF^ zT*PLfn9R$b3E1ac{<xBAD(QM%y5>($*MDIUGE)L10OR251zEaXf!ZX?3Q)@USf3le z0*@f=Lu;WE-`pA$Hp-A_>M(R#0zM$!mCG!EFRM8W`0yiuuRtv~0b6K4@JEGd1@LX@ z=7Ar2s&aue45*3WD-*D&dPzC!!{=4ngE0V!kq31yJMg=VZ6M4etU8=<QppN?cgS^B z7Qo<v4jvj?=~+>|)$kCRB-5ZE*S1gBwS}T!hUGLhZ1|bi9)X&n-}K=+Y}h5Ua4l+* z4DBa!thcfKQR5$gLX7jlG+~R}K#UO-WtX`@^3>&Nk+b8^)KfHZ1|f0PSzGQEIznn{ zy{r@h7n&<mKG{RkI=TTsAkJaZ0zEYQ2<x2pf*tIU(th2yUt*7%ymsopYU`cQv_^Sb z+r2W_hXje%9@LxJCrJV_Vph!Je*fG%T~Fn)YgEM8G#PsHOY9`y;*k0V+{f@nE1IeT zYo+dZe;9<`%QWfc;VBh4lL%LtY}-Qyl@jO6t!jdf;8Wp-Iu3zw-&pvYk92EHwu+n= z+rW~B)NP5x4%po<lI%dnsl`kgg>L|xT2iX51b@IPD8T_7F^9Ay8Mr6d`x=C?_HC5b zIThuTlrbV4X6=agqZ%?KJKBkcLq!Ke?7HY-a#UcEi_9GYo(v`;o=NjiX9j0+_=ez& zU0<1h>Ym%fcg4<o_QLa^BqCz=^lt=i0`SX=efZsFA3l5jA7?Q`mco}3_!$ZSOE%xE zf6EuW(cuHx<kP?25079~x@6*pg=WvQpZm4`?fI4A5uCj|ydSOEGoo_glGW@<8-epo zitP+cX7S*H50K@UGD11L%p&9sX;j0<0+q!5d=SgZ{e0cP%O}GMf*1aMQ<#Q#UQ$Ke zr*5kD_JoPWI|tkTw$xuez?RNg==7f&w)9V59$R{OJSiK$0Z;lb7d#1$CQE_X9#TFn z^Q2*O<q)3K%9GrnuJWX8AZ;sip5(3|c@nSXNqj8xq%C_0o-|vqAC5ObnvvE4_Liv~ z;6^B_C{)4aBL2JQC^RYGVPhJ|8{BEM;4CPdzA>&29u`ci+m=tLGX($REp4F6X35cl zvz1oKwHRC}5*bkqF_&D4Y8uL-1Guz>>;|pLE{$T4nJsVO;YzR|58b&k?IVbRo;e}X z!+%>g!&^N=3PP75y)dWg!x&Ofe5kfJ!;rp+jSk=T#bQXqJF}&mWL~eo`O?E5th4Y7 zFZ6uz-3zYyp29VaXPdLq2j>ro{F1-ImeO{bEY@(hdEuAKcYm?XYa&TGwsyW+QN31p z90mX}Q#`u~)hnz=_#c;4uMPE#n^e8<rmK2^<%g+WMKe5SgYJLbZURg77M_H@67+{z z-u;YYMl*}&jh;X?)@IK=>eca7Ho?zy02W2<jm>+DO}A)xq>ofqMLT|^h8K~bu!9<Q zu%hIB_5e41TutjnO5V%krrG#@Zdxw4E{fiMriz;Jg)!B>fq(f-^-)*<PX$x`tILc) zuKEN2q~{0^FX;KbbK-w!@eozLD0%lT9-^?9hhG3wCS{LapILCHFNr}7zkhj1p{D)I zW0=FgT;uXWO@&<+HB}xZXK*77jl+#vH5ZP-5*i3=2}?GcHXiSKdLq~;CC_CA*;iD+ zXouNW<|L=$*^wx1nA2vsW&MUz3a>Zz+4EH|qC))-u)L^#T}0H)l<xKV*ndRJhsl?l zX$gGXqJi;miJ9^3x98vfnctp&Thpbf6}|r!^?o_|)3s3g;gD$;nvcLubH6T>*?Dn( zrkysry=E0MAgX+%hWk_L2MDgy5JMQ8j<$h$8Cv+W8WF}UN_^OJXlh;YoqZ;@;nfEu z(pr5$Carv+-A1W1_fu)o;H1E{2-T*WY%|oaz6O53raSFUkc9EYS?9YS_T)`3Z}C;! zS)HGr)&Rw~uXt?Q7OOH!UKg&#c9v$hb!}=>EoGCA@0)*)L&@Rwo2H3b?RA1N3|2j> zIa<9wKBd8dk!2^7)7>osQn#gA#MAEGOD8d$)9$9&eTRR6td<A*TeDS~=(5Kt_Q<<S zr!>j0A7lMyKgPs&97IJLB?dCPn@m`aC5#zmEG-on4ZE#H9q_w;z$h<A#hK~e;g@s% zR;GJPsO5e4%;7SEe`(I1S+a7@oc1p}+oIFbbhqQ^ReJpqkU>0mQ^7fXP0o1o?Ywf9 z=+KkiI1XgB!%oxiP4LM1fK&Gxp0BYWWpMq-cJg%O^2qKgKxmxyU8c%lG;dP{C$9rc zV(037Nd2OS5T&1kYauZ9t;MBP1jyUq0|)5xlII@DArZYeb>cqHMK+@Gd!;4Ry9kYB zr$BxeD2UT%@e~{qVJPqn0RM4U_!-W<)#Go;ryt|#Px|y@{Zq8mLPiD$7%Fl7O>vDe zZJalsN3=$uF())^_x{LtH2XA^a@+WC)ZJ}(3jR7Rs&U2#DAHaX{}q$N`1HqW226I4 zj4S_rEcWbnu6DPKC(RY#52ouHb(^56xlxzj>8=54Nm$&k9`@{mz|GU2Wi==J2y1q6 zj?cjLVqjRfcb|*SS8(@(66r1DGbHzOV7@yd3LcTRz^=%R@2|~n^1)}30L%=V{Tu49 zd~^Mke2Yl=NZ>ox1{ZPZRW}-cb8i3Oi65Jsht}@7J~<CCo!a=D-59!Nv(Et0HMsES z0Go!X-({V_fdC;};-_M0)7vAdO`WoBqih9;E0X;Nz0oLM+(STG0J_$#MOMEH>?8Ts zc|-4-TNQr94ZZO=Zs?6~aYOIg?84O<W;0z554y1N>Vnq^#JBt3)OPvpiUFAM?DF(A z8vEn>C5e&Ew3IvPrrm2k_-)b1q<f9N4ebVNfN|dtAI{1Q@u|`y1N=ZfWPp$6HwO4! z%z!P#(g@upGogp)BYdi!5Ag%@AwIe^#P2#}h_+IOs7k%Y<;GsyItnUV8~=;I@!bMY zQZN*NcKMCLp3ZM!osYK+cGJn;{DK`?dd_Ngm)Jhv5i?vzuweSg;oT*c>-u%O$=wMj z*i0_NV15MbF>OXPH}PZhJN#)&g{?+Q>2vH_-mTs97l>f|T=k~*CnIhC@^9z&BhWp< zAr1aSO~9#U&7{uhJi~g*8j9T-tE@JnHKh^kVX&8&Hnq@C){`jw(|GrkQyc0Q9q!AD z#hDwipNZx9xY0ZGzy@(Ijk+}Ovr-11A1D4lLfnlrMcjn}omf+h%Wjt`#0N$l%jh^G zO`Hc8X9TWb3pVN;0-Kdwd(C*86lEMa#cplTebEuNbJKk!`{{;<#M+a@A>JZBO|GCw zX$Z7$XD=RTPtcI}OBm{{i}a8owdBE)wIUe2K_bo9+uE}mR36S;66nBm_}FGyRjv5R zjMa?eTSUGxUuDWReosnJU0uk1bL{mg4)}X-3(a6Mr?!o8sPw)abvTb;q`ghS#3|Cf zWQ>tCy1^zNsY!9pj<z$7zHdC^=+lRT7n#c2=$??BYuINlTUTFf@)ye-00AL-R}o!@ zHlR|9NLe<(tP7pg><FfPBW+62p9E!&1j;0efH>si!-0IE`BdQDCqbVuN<?__5m&)z zoG6``*$)o5>*LasHPVjvMp{sD$f&A`aZI2ci!n=1nv}?Qu`j0i!=NZ24*!XLqH3rC z4D(C~b451>Nimk-I~k+{B`qctO3x1+Iy_5pz|IvaDc^>U&Eu`Z92<eFYM#4T=>KMY zrVBwA8nM|CD_$|VMj{I0`PqQQ#{)XW^Tk}4-bU<l0HBA{BL<;$lKeN|zjgi_A*)`% zD`s{nB3?aSy`@+EN`73*5A%k>Pd?AWT+U)$z92ekN)CW0CwC-`(N)Q(wW-J?T^Vmb zUHkX>`mK|Wf!|8o>r<u>(SB55av!UW-~mni@yQx_%L+{^#j8#&{Si!iw#BSrRu7_z zQ|{xqgRCl+3DBryg=#i<Ky95yW}o}Vk<*Oz4ek_GkjB~cLK;^pIQ;3o*56ADs1|ot z$kPfiQ4c9><0tL({waATo^XWxxOaLqEMIq4MxPKQ;JO4PNtQwqXixA@x7|=}6QgyM zWM!O}eqy={`;n8;_{^x{u3j`i+6YuZj1d$hjm8EwvK@{AgA^xe{{gdpSc5T8E{?i) z72l%Z<Fn=(2E8H2Js*EeOrXpgn~x?d?3ll~5#XtM3$Fv5b<aH$q$aZ8ib6Zx1zXIl z;l*E0`<R+g94b5((=)l%o)ej8>N?X=aj^=+>2Vj)x&(r`v<?!8;l?c$Q@|ZtjDbci z>4<D>G|!;L;~iYwKAUhy*rJp_vX@e1oOPfc{DLRTN>rqi5gW*&+C`$mQms2l7}NBq z406o*Y6=WFR4=AopPUK+lxc&d$CxUUVD@{7OxNv65u!(vQ#3JqCRYx66Z_*p<8)e1 zoRO|VY!zUWQ?3EQ0^M<rv6GDAlpnSV&=@GLhvSZv@T05Usr<%pBhq#p5CJpBQO+5W z>g7W7f$lgM)F)%39SMpMx#N-E1p#u>c3fqiPfkfA3?WFF0~9?;=O+-X_l|7TyA}Vi zkp}wg1c7f(Pr5R2dhx|jNb$urZ*w{9l_jK-9FCP?oHNOM?Y`+zqLIuLL^{4)oKmOc z^TPl%d*)ZG@okBmaNu)t;M1xCn0W4ZJ44`iHRTY{)sAs^%!H5A(>9oN;T>{%2eciC zkjVncnkB$UT*0Ai01ggZ6@E~u>rUz8iCz(yJ-fcpB$kokgtQx|a3WBF+#y+u&l5K1 z;ACI)EUL_hAfj1!xf8Po+?c>T=Tz{^_FykIp(1BSPV<NXewTQ1JaeDj3lb6-a1r*y zY~cL%$Ab$@aXXU(UG0X~y6r!YxnN2HOM*cW?%fdX7vCNo#@ZwqFSVhuF0-d*qx2J3 zd=p)^HzCM?-!L@9;B-T%lRo2Gx9j9B?y*D|O*cd(iLW%J9^<=)@aBV+-wCs$jYmnF zFkH0b>5kG4FvubG?J&=(J7eE)9FS9ZMUumN1p#MMz*F#ty&p^|&u62x-V!ir5i*3g zvCpIO;DNLJ{Jf{>IcK?&?uw{imZK!HlZ;rKX;?6$ySVm)m5E^>^!QD5Yj?&Evakh8 z_);UB%N4C%ot_C9tef#(o}vIkMNGqpnL=~KuG&WA;oO#65T*ef;EdZ~7-lqzk7b|X z=cFfTkIdyho1BCt1Znyuk*T~sndOr}Ps!UN?BgU4l68ikwNxW<X-YYGQ()zk%|Y-d zw;$WdECU-(xZaH9>J<8TE0!yUf!+f-@jL{MM&4x_mx1IcAS>7&7=3OUab2gUC-<f> z>hD3gK-iJ-b7N6EDhBx!53kIEho=iC5DE78D7hs0rZd^j?D1fo{)LCOlJl@hVRgpc z$;7kBcNRP>G=`(IC&75}FaVuyYR28m4Bv#jh%0qm+rZZ*xuB^RiI5i!3WXPp9b^k0 zPy=I+uVO3&X5z0UjOA=8y_C`fvI5aL#)d;1lnj|z1~V~s84E4=+&dZz;s(;eIs$R$ z+WJ;k5SGUW5LS|Af1;q**B@eL{5!RaZ~->W$9b_A6)wbv$E@Li@5h2S-F`qLr`r+V z5B5}bLK|1(!B`Q-FZZu(Nu&lN0#Lu8qin!va59e0PJ}M@?)ZKIT;kEEtE=O8M&d}= zAX-VLk1=)%K@R9bO#vJBXbb%Yh5=WO*Dyu3QU0`#${{Iq6(YfvwlX1zeR)bu1=EpJ z!3g(aQ{hUVFO^xyl|~z?11ExD*%`tT`c#zHMM>$H$GwajQnD24PC#kE4Ek5&gBS}a zry&9X9F{X%qlF>MsZBD{fUq8LCnYaDxTL+j&Q+yLq8EimJxux!Jxt<SP?XiE+pA$K za+mS4T?vjNV^a>ydvT(4W3!H!Hg7!Q$<Z!G&6+>mPPYR9=I5_N1R*_(CduU3WrEQ{ z>NNb3?YJzE(SyiWBTEwRVFTg)4n<ONkvu^Vb|t%sgF?VLD6}Uu?kF4D_{qgwnS&}i zMJUde)8cF(9zDw`v=B0(UfzoHAUU$9&6+D+$HwF=Nt_whxh{0!Es`z6dPut*2_nyS zP$#XC@jhDanaQZI9{N*Q)}XkoXE+y@T4;uSX~g|9>uFsFMj0LI3nKUPs5{Fjf_NZk zvcF2#X91(2@a0@m+SJwQS<iMbShGV$##fRZF^dtBva2W9WOhSOmiL^J>jWR-=FR&j zw_=-$e9hesp|b%OR+ErKdA!=?Ug7X^K~ITbq4^YHo!-cMH^+?l_&5h3Jc>2vil9X* z7)4#)d_(<1O|hA7-dX*2gsjrb3z4()GuT>C%|$kz{d&YbmhGI*Nw;&K2@`YK_+i$S z=7!@Fh!j?hN>>08ANN93nI6&&mK>2_P8NPOH>7Blxgo)-u6^6S+>lo$P=nmbj-z!# zBM;p=)VXz_V?uWA|Di<aSjgaSwD6$kYSDD%5IbD^A@W3a)V4>5svr-M+#*lwpg^9{ z9C=0{&!{iG88(|Dw=!2b>O>;XiIi6OeiC{3y~jHl?NUT?$<FO@=VJbOi1~t95Ap%6 z-QVr#;oBK+0Ok>z7BkzN;^X23fwR~ZBWCUUy7dRkmU$rFv;d3ur>93^y9f&@yX2#i zN+m1U&q#D?7uF|Wa(`f4EbZ2lQ#9(1qW_98j)oA`s}0TAuh9}Oft@cwCpbgyjWryV zrYGDUfVve(PTK>Bq375vNpPcB8O#XtF5+UK?kMUxDsX)8#b3<N)n>+|-76i0Qa9{Q zsddJSzUO>FpQqyaWG6rr5x{V%Mc8kYgZJKOre~PV9AqZI$I{9cGPuG{zDZ2j$uWf_ zp?xEw19%QJw)H%W!L5`)dPM6PZd`_yC3d5Y@;Vr@BLU<)HVOJiLiiXR_Xor??0#}9 zu;&BQk?g+PaZwK2gttjaI|);_FPH$}b6g2<$d>(7W@ObuP?k+A;smnQo_tu1LaAGN z_udUlNX6%`xdGi`JMGaFtkFQ}it8<(bMqwL7j%J1!V6ano)q!ff=MzQS~!jAlaF&| zEU#gTT6yu)$w?ssxJm^10y4)Os2*It(MRW7TAA;kvP7_YOtl)6w{r1fzMg7gJ|iBo zH8Rt8n8?AZr2b&8%z=$ttcU77Z@|J@sfQeKdA7#?zT=H}^yOLiBaW>cw8G^?;ybkh zha3Ub4OdWj&WMtKd=eo009y2Dc@;(=drkgYrmup!v_5LkXq;gm?uL)4h8Sy)c)b4p zYq8@>S0R|j14o+>GEWOqc|DE(v5hA?2~TM&toKYPQuYB_XANjMUv7rV6q{(M6SZGv zfZNzvDJQ9PW$G^!XBGH-sJ{+_aAf@=@hgXV<ZIpSj`Q~7Z>4>{Zt85MT|f?WI+#&g zJg!)S9DJ)a8GBn-g~!!$Q;LvBaBgyC6TWl=5Txm*RmbgS<L-R#f23M(MRp+kBr|}M zq+ME^RPf<>E8+|t<6419hRGv-VP@6755I55|9QF~S`FxZV{A8QQ9e&BfydL31f}?o zy<~AtLA#P`;~x#7_-Wl*G>p+3<Ris54Iy1-AE~_>iFJ%##~;Q+PoF@Im8JKmt;Xkv z>nT`!ol3sur8PvH@m~a~L<5Qi;`$zk2`Fiq@n6EwZ$I*=?BBnRW{<v0CP|bRHtYSg z7rWgtA~6b+e|<4@K}Oadhc2i53|2Nqc(;Ep3oHhIu&F5v*tPecrOC#@6kzo2FAoOf z{m<&jX~74eI4gY%mUfWube^{%-9ydYy~Ah!3>S*E9w;TsX_xnvnEW)1<3>?VKnnb4 z>f*m^pH)6mgDX@b%1N&X)D=-qwNXwZmkCl=rXGlLYWGJu;XUhvnxZtqWq*{DxkZQ@ z7`awz@I*P;Dcxj^U^Gso3OF&w*nyCVIBUctOO%sUN{rL-MU2y0Q8B@eZsOEP`W>Md zac;277$;9f8a|<r>AJ-++C@|imVx~-PRGN;Y!WftW=k<nbmBiox)kHYh~*0_{o(9h z?$MM$XqDmd&L-#aN@ekxJ4xe-af-17J(d_Jmf6uP$2bYjLt~tB42BVrH+(T+yI+lQ z+FgxtqW#Oxc76_+J(Sfwn>!CE0)iP&HJxM%h0Yi!y8&l_tY!*Ncy&uLPT+5eJ(}>G z7^f}=*Y+_^aDDP)bRCQ`R6l?~j8l^f!m#d|fIJunjB(;aHFUU$adJqLh6P#l6UiOQ zS{VH0+OGlwZ_p*WTtWb2oEBYPQnLU6hsHPsb!<vdN@n;e47Yjl7^k&EW1QmY7ZBrg z#uz8=5S+(2VP`RNfmon@F-}}-u!wPD!Hl$+0JEei<<Y(a>HN+ZrywlB+Y{D7;NnzX z;8`4&T!t$#P61brgc{={h8g3ucB2@lU1FR7Z7)!5xeeNSmhcu;Hhyh(9WhR8d(l}h zaY@b|j3gy4p5YSX)U3ofb)XnAP92Nq)b_<VVa&}KC-kI<af0%MD4V*cz#%exlAj%B z+GdQ?+W88|oMeLkXE4)%%|xa%l{`Sa=%q4F<w7A1BmYpA;{5qYR}Jwkb=(IfBQ)@X zXU~KahZvMmkuj0P;$+02U@qEYH5MliIG<B72o+)U@;6d>*qxkx)NqwCZYfFHXkS|P z@F|)Z<L5u;fs=IZ11De$iymXRzuQP3czj&SUl(|X88v<2QLM`s`oK|mpPZbNE#^On zG*W1+&py&#o!pM<rZ*g=JM<X->J7hRR!@!~3b^A=T|BJGr8*^kylmxek1c<<erNU5 z=AU5_y!>c`!pY}PHrRsFjKHstHB%B{Rp}Szrc^m3GMk`6a&q&d_@deARvJLCws}G% zywTg-$G75*9?QwNf=`&T)rmIj3LA*d)ZQI!1Jqr1M`yQDq3Szb@kg7{`<Ye~!Mf1q zE9=E+Rp*@V$Xd=LFxXA8s(Tn|V#Z;lIXxY-ip4)o?(7Q1q~Cd?mb*2p+|4rJg|$rO z-T~#7o2!S)w-x_1?i(u-k4!#rwnZpki!sos`vFH}V<S6>{X38KPy38yo4FZ@QvO&e zg3ZAP=;3T(!#)aVQD|da(_7LE>as+saGMYTYXSG1Q=;Jk9>a)iYaTL)X@eA+s?~dY zyC~41Cm>-7{nM+npGXb47w01&7AA&eh^<zcY^9+LLxGNI?pyN1R)Kc<Tgv@t%wo$i z*PZD${FZPF#BuV@h!xjAeFT&`=$}54TjLYuXdk8=x`{l=LN#dQfPdPjPDLN}(Tab~ z(L|x0xJYu-IF%9D8wR@`XWZRw3#j=rQi=VstJBV!8Ad~W)I0d7U6J_$l{#rN*j#v^ znA4^K6X&#jfu%C9?%dlMLfFCx;SR<79A;yNb9%aI0k_9o&gUX;JD@QtuwZhfwNWz= zU<Nt@QNoU|`V!i8?J4aLd2ql-y^Ii<l~#1fbK8pc#4vU%)^-&mP^_Hm_Rgh#2vX;A zC!hg+gEF#?o>qDSq+}1x*vsM*U>2G#F>T+sgA$@$4v|tpD8#j}=VaON(Ou-sf%uyn zHXi7s=1{VZSMcdtHwYiKaWrS#^><t0qvjhv>afQICN8z1vb)bm9d2-OBoh$Q4uyy+ z6zcG?Yk88>F(9RRg?-`1KI(myy@rQ)JABmJT(JVp#awzHHSGX{91?qhexA4<?HgJF zIYj|B?0WnF`7xv%P-TM^HwHAlEi_?*3Z~^0+XDXvgeX>X%W1_xs=oAzSdL;jB_D&U z%7&!xE^;60bZ{7mB7S=-(=k7e0Y8W2%h<k<&L~>D>TRFM$n;TfxH&+wGL7Cx%~e<7 zz67mZ0}$H>(#AxC9X{%~cr~nrJ+{a~1)M}G_J!f4pdpQv*BQrC*e4i_71$w;(+RU( z*v%Y!#ZvK)0uWKK&%p9p-{KO(+``r6)X4fAtlVL!BV6}+(DZ&9*A$d&A|@a;&xsm~ zH(@2;1Fb>WF}}fqLqx?OpF-p^3mz`}o1@2rbr|01q{<uC>0e~-FFDVV;EUT~9cTT* z_8UwY#iu6xC4JPU_L1I`4TU@ixq)3FC1%GN2hbMhwD^j8DpVs7VV{p0@ma11%p|J# zsC$e>8+l@CE^0EUfwA=*V^@6C$D+f6u|*IXdT)m*Ca-b}V<0ZNW$&Xdh&%VjSlX8b zaSOuAZW#3n!b*y0h^mRV1$Sa)$NxOetz4L*Cxwq1>zF=j$i};&L6Y|yJ`4*o3n6#O z`#yct3{l)cS25!50xS$g*GOn6N*OQ_YzST(&`0f^X(vL#(nh;MC_gN8qxh%|Xi!V* zebmy9KI*`q;Iw-{3snV%5nMU60blR&Cw<hSHLRG(*z{4C2|?`PqmB(wa8t>fsi-LC zRG<+D?3oP!cY)_jg)p3c7N{04XBP0?rHfj=2(xf;M_Z96N`)whR#Tdo+>67^2;RSn zj93hRNa<2ARFz($ErWC}(PXu>7}ey4MX8B(DZc9MzQ4)#vaj0vL7^7;06Hu@9U|*B zG6g&Qs<?Y;JRKUj!j8B1Rm(uEYw?(sY8c(vEQ+^n=3@6(rY?Ke(RV66>?}IIYHan) zWD2@*=^<T$X)12hO(zF7R?#oT$jgK1OCDTzCqieD0F_&HU=E0;*a&SpwY?=@b=+aO zhsL_3eKX*37I&`2fz1Qvuv~n_SB+zeYg@xzjX<D(<jfuHT~2kk%7t!C^>Bmha<H=9 zTHMvAx}!yIw#mmz>`UaS`r{%u&DsDoZY(z?=y{|J$RY*+m~DX+?&@2K#66WlGhL1N zZ6NVe%+4~tEW9V1;>Ks))eKg5HFin!za3>3N7G%6-g!&W_&l@)0}7UebKvdxy!f!W zZiri36*z?w!N=!}Ku&ix%wC=s3Afk7U44WN7Vc^ep@qAexV+>;S}P_dOIFwDcbrS^ z>h<1T4cfdAHz?w+hM(ZBj-Jz9jk&2X2jCp;>KdTs#;~}nw~M=)b)zXA)_fdvSc7l? zb=6@lm~V8Mp>0hdiGHUUt-plBnmRhH`6v$SP)}{a`z;<Esi+A{=#XQ{3bAnEM%=rB zR&{Y$gH)<rseyVjqz?_;LhYKDb_+2_AAG2RK5Yc=Q-x>;C<z;H=v@4!M+dTSSo<>2 zC*+H@N%zHk8T5mEpwrynMIzJ+hjqF2fOL6@7HAWBo8a_lY%eeuj#j+ZURMeQ;=M-2 zb{mqeSum@3uOoy+m(&5)LhOs90Zv1eoZLCcwAdEcWcf2vC%;e-+CFCaJrqh=K`=MM zR>=N>%_P)X&8y3ucz^h!5APit5=%_tsU7>Y1t~w8ZnNpuro+e+0i`e{<4XBJ3*~!O zV3s4N6XR9IW4X87E5wV?ifKMy02o$RJv3PwYM@|Y!Ga6)<zQ&wf)v5yB8KOD?I_Dx zz=SHWp>OaJjVP7N?wdq~05Lzx8^wL{EK8uJSUd)|QX*uCB|^0=!^#qwh!!yUI>Pz{ zrla%;YLt7*1TdO$JR>~GXAs5*rba>%5_cBdU)q)@G7&a@G`HoTj*Gw{8x~STX1l!D z#KTyf#)rDCg~z&>vLd>z4%A<+!7Q^z@mLdLr^lN8VW>fPtdDdXc&yDHiE$k$UD1jv ztCJ@(^3BPSWQ!d56#1p&g8CHk=Ymg8B8u?zG#WZL1zD76x?m?!^0eC{HTUq%7!s7| zO(B4|hiTTgw1U+)09Z-{xx#?8qHzpFnEGZC(ZqVJH_})hA2`(mh%_4fHKcK_hhPP~ zlBm1TqWNy%v1a0C-UNFWvvzKTy5~@^1{VSe+7O3mjFD&oEgtLYaZ1HvTV`q9MD|*b zwW`sf9&1;rTMLhMe$_!8Y_xc+)r(g=)*}TogqOUG@t-y<YaXP<gBS5w^Y#Ku5~kKA zk2R04gvUCq2kEiin0u_bu?t4%6)=SuJ0r-tvkR{^U(;(HaDdP|@SZcdaZZ>8bmgkF zp)=jEp#!hMbl<UE_}7xx8h}JIdab+OYfUx0*8F|myWj#*<Ln)?LIe-OX)|vnz1Ca- z*T5f(*V+r=`~{k@g;?=g(`vZDQ%M)uSG?91U-nubUc7j%PwKUf!Q!Zm;fjD&#<#&X z^;&a)7az3E=(RR}-Ax%xq<F3Q#B0qN3%%C9=A|{%HI}^Au_KH3Yy;s0OJ3^`Izi6Q z&quT5C`O0Dpx@79#cQ2IKfXM4L3SK8zM<E;EC&Q~PAUl%${BTQZ(s6S2QX|G7y9w# z!Qi6AYkj<TToP-TUhCt-uc&M7FXhq!SIOW3*uHzP%r1k*_w#RVZhO_;*=qnn9t8=4 zpC4XL+5v5@dap<O-Pxl9?rbB&QGQBJGj^U|ba(b(+3Qv}T6CA(*|+Oix<gm<!kvA4 zdX_Yf-m!3?-q4+$HvOA)XRq`(cV}mhdMb2h+bPS-uem#WTP27?IJ1}G&UV{<s5?8y zu;k8Obgw&mY0ihZvzhH6)6nV2-IgqIZ5-y#z9Ze)x6j?#YaJb_;_J@7U3a$rX;uWi z|9qzGxP#}ovv1GAt(C}vDVrqS*|#rNW4}8aLm%c=-PwHT&fb1$cXnBeeeUc642Vm2 z_A)RIb7vEY&mKi$SWeji)kCJ?&PM0DDR=hZP<M7b{Q}(Cx9ZNmb;+F_%>9+Qv$;m( zaZsv1(TXtK=gwwB6LBKpvRwggac3uJQD0Z#y3d_0hUv~8+?+dG-7rH%Xr7=Ylo6@9 zyB&A-0JA)u)kPGe-zkcl-km)-)SZ1hw1zwTc9s=Uv)`S~g|6DJK2la)DSfo^Z-fS` zsgAEs4!#^XB>s$vZF5M0GK<Rd0fydwV1VH|hfvOizx+(P#?h{-NWt6iIpDuhIeGmB zc%6}3PfpI}2HwBWQh1$tj^4pvz09}G>d6>EFw!2q@G>9jKcfjQVbafx91JfrnqzpG z*=0qrI=}ET@65f-<Tgi@WrG2f@iMbD?Y+#$XoP8UD->b3NO~HWu4AuHFLOH!qt*!- zjMvSg`-Z8WHtdQh2R#?X%RIp_<>r^@M{^IZTdD7OwOjqn>8QkJ*=;?>@#pT?V^dTM z+=9)~ntyG$1&ddAeRR}~1Diz!b)3^U_6j`99))ptP&UTBnNbbYol;o2!dSNF>~g!x z_8>jWj)A#alA)}7T4coUY)oyR*FFPJbJGx|V%s_2&Qb&{whs0{wwhrZjA#&4DIU)q zm!+CkLkw@ySDl{aQ@Nd_?Yu~q0lDi1BQzwd!Sq&4c8K)kmXZ>BmRDy#si?z1)p!Fl z4%r~DRw246ro@8Xho^MQ4Lm1vfhn772Fj$0KN;_7>^JI;;f9^9?03S<K)LiRvzQ-P z-IOK)&o`wYSNMSj?6F86<w1B{lYs+J`TQhvc!|pz7F#ESa!JP8V*}Ex^^7<vy~IPj z#Nnl9n86uJofs7`o1b!wj!>A(N#<i}@7>wAGX!^x?B-~Iah%I!YlKk8UbgoVqq&My z$BLIYr|eNTyu`z^#s>+)-b?H%QMz14)0@TXVR8*nGZr_tv_X+zF~l58>l`BqDW8E` z4z7nfOV1GEafBVEi8_k+R_et2AdEdqE?Iz<8jSVisGg|kau7yQckFxeykL5Y*V#MM z@4X-vyT6Omu-ueQlDkA$%vSFy-n`arg{OEJo?;B$n0Ynd@VV?Mj#ILwjfDEbbxc1) ze-W0m*Wak&(va$0$OGL~Pcg6PCp^X3lpA#0E~l9}b+TMpPch~vJjI0dEqjXlcJN27 zwi7m!qxKC=fuI6w;VH)0R4m@OSa8SnzFz~P*`fk^OqMug`S&6g?>t;y{BHk$d*=dJ z*KyYQb02zMS-!SqTejr*+*_x0QYY2RmfVKc*KrcNbsjWsNNI|r*h(T>v200BQ?MNa z0aBXMkfc!9!WQUmTQ+68A+Xsk3n>%`-7d6CfU<NUJQliap@D6e00s8<|7PZ#bEPZG zQf$Z2C>fu7&Y3fhZ)U#tH-iF9>keK&RA)h<+7U<1fSmZC&=t~Ju3%y~RI<WL`oPGh zhBjBoSc+ki!G?50a*$tl-csz=THGv4vDQb0dB7}mJ5``K^3Gj;{lP%$8RleM(*+m( zNHL}i$$XxmLkrKhDMnZbkE;d0Lj7l`y#Sn{1h<R5@TH;82s1}^jkL-lY->a&Y7Bd( z(_+2oxvlHAx$9g;8j!MEEEXr>-1ik5MbnOBbq<!|Li)9)fX0qZ9jzzar*Rj2Ac#9m zGUpqXutjTX^yc{{yr>oe_E}~u1dtOveO#v@S*Un35OS7ckc+j(EXA}Nnmh|xXm1LQ zt<Bd4mSR)g(O+iRaXzMm!t5E#JifQOf<_Q>gpH<{DA@}vog_CIXo{b)E8GNN#@bYL z?+y`^XA>7B6#H$6{KT!Z6ziqw?^+Z|qzNl@!^KTl+mbF(v_q>1W;9#~RG4D{sWzGF zNef??%%+1Z$czzD&IlQ@ATuEBsmFZ4bc)|x>ziPmxxLQbJF_eLHwt$Qj?At&$?YbW zHQ3EI8V1l+K*oZMGB~jyOXujKoI#JWATv-6Y_EpaJxd~yRfOH^x|v_x%(5WUlg&^k z-yx7dL0y7US(g;BZCw!)=(=K?g-QiV@6{E!J_T$iy?{+vOfQ%$=e8FbbSYW=Xd15p zz)B3TZ3-ZEirEZcjD=gPm48?PS{biGqi>G!tK|616MulNh2c<km?GXlqJ;(`B#cdr z6}>{8Ecyuw3v3niBL+#Og*)qk<GIvc4v(^RD6FP$l|2w%Rik2MoS@9ZWNqAH3>~== z!=v)ZYb%?H=e=(N^M(3LYYL)N$ua2G2FXMo!SX7`k`#bs=<zTdQKm}Xd3;P!UN6gO zh-zUrd&c++8*Ikkf(&y2l1lPK!@yIniMxfMx*f~V!nUyJq$JJ@3hd6*(D>V&C50Fp z`A;q=^Egd8C(XnKMOa3lbWAAKvHfeOZTeu)kl8L?BRYuRvLPS6^ytJDb*RclJ2A^v z?c@S?ND=g+(;0s|OK_xSt}(>XE~76lgWl-d?u@=jJQ7mG7@7tn;B5q77o*%{MqeF} zi_w=&&>F-jw^Mn>=*zZ_NsKarpNmnZmgkVYH|H}(U+(IRzQShn8GS>HGULT(GWv39 zWb~Dh?Cg!cD$B5{%^NWiJXyf#OAZ-*xp<>5swogMC1i}gCTIksuf@W)26|Ly^krQL zzY(RJ8hu-#M@epcI#YT?oSsb^+%{~1Xxg-E(Kz<$j7DE=ooKj7Mqm61W%NZvp3mq@ z_c*HxENpf!?^Bu@eVbWA&@8YRJHE+%_I_tHaz<Y~NhIg7Ld_dl`Zy4V`9DLU9X0S? zSi+3#spZ%#duc{rkhq8kn*dUXaiGRM9tNEV1^7Z>B2W^+1F`0z(RG!`=$qEzjK0D} z-snpSTJcu2Iih-mrrE&m5;F6m+tdZ{>O!CN0U)X00|!)MY`?uQZj3I8jdQWw_5oW| zI#lMm?%m%)zJTPk<r-kZdzl^*k1G(;h2T<N0*QK~uNeXv8G+4B1p_fR{*5TKfFe&E z5WXgh!6(gbIZP^34wEc{SDt0ZP)ZqqR<8|73F`>^>j}^{PS!AyuLl1g+xd%`Bcrd# z1xDXGUu^Toml@alVuST<5U5GUc2GWQ8sp1yoCyX(RW~@vGd249QIKiVjTBTU{Q}n3 zeNk`p)t*Y?Trm2U=NNq%KcPBFSDN#c$mtExmT2;;JQI`)N64bv6i;eAMB^xv$JGvJ z^wr9Dp*G!ul9+G@GBIFAyg~3Hpb&PW((=Zr%VAg^?oq}&V;X^r3SG$PYd9%m^i|sd zua>9_Q#LE)9HX!AwfZKbuQf#qN;fv*5j6!cX*zn%!eKhqXx|LEY_OFlGYTA9%xm^K zZHLva8y}4)%$C{j;-VRSWy)g}2BR<E=>fy+jJ^&+sDnh1iSY3xkfv5pmy{{1ENaI9 zoMWSJGjjH9qpw*Y*URX;@xzB0V}7>A8%>=H92PM8I!&|k%`y7Qm$eX1D`gmBmXC!h zUlNSId=`|iQh{;H?zI4_VhU<!^i4`x!03x6zRu`tg;8rd+3SqH%APg)HqP#izP&Q~ zT4T|Xa}A-&<|W3crbb^CBcreFMM%}Q!RZ4ERmN)qqi=^Z`q~DF4UN9ecTMkcKmm7T zjJ`&6+FkvjH5ofAJPbzP(2sOI6Ibk-zRG>7wZl?oxh`PzwW1jQ)aRO&&#cZGeaV9b z+Lxbg3~GycjJ|7_1vamtMEu}?os?aAMJ~6HEx0uIQyp?$>Pkv<<!!=lQTk}k4h640 z^m#-4s<J|bilX9lVpf=2lS~jh*_^Fi|14zeO3l!S4qAwO?QPT0Nnw+!myjKAqA4q7 zycJ*(o`wrT*=ThQ5v!C63M)vj4BUiV^P7J@{LiGRa{#S#x92?6q2Z;kwSX>jrv$jz z4hD9HtioGhUknv;vilX0payXKX50%5k>tRz(Po_QEJV3HyvXSSXK&_eFSt<_vs#PT z-Mrk6%p_~r?VxHf`)%CWaRB!4Zujn}yWHn4r<oA?g4JtR3}L!jh^&}gMKiwNKl_ls zKJKqi`s>g6>!<wnGrCH%xO_POtbfLO$tlFKyk276!+HOMO_Hj4)d%k5!t&46o(V6R zST6u7HSc+@Ao1EqT*n{(U7K|OLOZSwKge>^^|Zfc0ilr5*-&Gg3m+t}811JVkiPJB z4I}|i0NEM#xqrWIfYQSrq95_sk8>>vNeWk**1}u`bWDQtS_=qG8MF_nPETb4gU<|) zw}OndlX3$*-6cGI%3<Uzq7|}a!b`??=+IaIJ#>hcm|f@<v?@ikvXQwtKL?5XC>BH4 zj*q6~;7L^KiS%L%)(UI4-Ki(SSMSXkzH*V;oWY*A7O?$_$t#Auc1DWOX7PHS0wIAm zmiIS!S?fYNLDTGCitSY9qK;`Q)|Hdzkfu0K$aQ%?47-J1)4ltzD}8x&uG=5{)Jd$h z?MaQtW-S)Fli<_2^ZoMHe}DvH6R-V5+hq}mL!kpd>3+&p{Kwr-TCQWFy6IsbyNszw zT3=}rR*fStXxaSJqN*9R3zZ0%GcclKXi0Wgi#-)?L9Y@k<R)l)g^-0vMX3qsUik(^ zBJ0=?ScVQ<P`ed`Rh-h`cBuSFGcn?oxsD);XmD_)LgiD*JJ7GCVeAJ)n~1o<0uIoe zSwmZwRok8J&sfB~8YtI<a+QX?QF8&MfhHom_}B(;JifsmGbe46H7iUKk+5Z@y(D1b zR3TLqooiBiTh)5&kB%sBVj$Tp*^C|JqA4h^Xs$vk3Oihj%e0scuwmti1X<0n<0VlN zRMY=r9hJFC9cU4-V5z#|;uTR3Tw(rc)V$RKUc^!?qVBx{y@4KAm+M8o2e0rI@yb2b zww~%TIwS3C%uMM)F-|#UWQ;P_X!gxwKelcLk38gOPj~e=UyE+w7o)<n>lIbWH>k^P z(3#xvDsE{K;BMBJaNIx@@LJ?J@Vi#QKcIp(pr&G)T?VI`&r71?(?$(vCojwj>S!U` zQF^hOwyfSm->HubiZ-MNZES|<y0)wbOh8XGm&l11l10R-Cu)G2Nv}0?iXGahSGpdy z&jPwKE17g}P(XauixxfgMGK@o*uh#{NNX6NnEeISQqDa}hXe>Or+(6&YI9GujcVBu zEom>W*(EGMoLqAt&NG8}fz{7<S}#Q+un>K*tA!3W(>vN{<D{T?%}dM9UM>Q;v@j^R zY-rW}Hrs8<kE>wMcw$g!ICj^~KXz{M+AO7fO-hO~7!<NF(450?P4eTFg<}R73|=y1 zWIof7X_)9#7&T4O21CZvY*mXHvXu-O%jGPFZ0;iA%eg~_$z#rtB};4WkR^T7VJcy! zx@e_%b;)h`j%BVEHPtqQ$~E~bd7vL{iF%mhOfyKuW%;u4fx@b&!7U`+C`egPy2>k6 zZ*TJ9t1=(<CLeCferV!gY#*9~jC}VB4%fA~*a$6ip#x3TBF$Lk;vY0Rl392K6)V4u z=lqn<3`Nv(C3)+wb>8}A`jS#k*0*qpbnrIaSjCa{2#eGOQ_b71T#|;?IrRq|ubS25 znuVY%GS>uVmc3i0NNQuZN<Ef)W(7<x0)Y(mHlFh{+pH~)&TPg6rDjR~mWw>bhbjFo zmv6={!jIna%_T<^+sV}~EMDY3_UF?=16D&Bxx}FFD&7{-sDba{HKYP-Q?$@GKv6#a z*J>lqp1a)^619G9qEi4+m3%G2bpx^|Mu!g4&`QoxkETtL`_XEUgSX+_m)e(+7+P@t z%1fnY=b;c+as?{9)45}D^VDl;f`9N&(J{MoUhu87o;Q4>UErJPc<tyhkrS!wbSYiS zW~LB6q>nok*4V)g*1Dp05mYUD#p&qpJ7({ltH?2EI7(+>8~@fnKwDbWpi08EsSEyq z%YbrNzg_pWXNlrDd4WYGW`oxjWofl>;T@A2kh)QlhaYG4$O6O(AV#Mm5n<X`bdm6_ zqNB_TEiYIYu|}PMrs^nZ)Kej##O7+u@8$w94FAPBO-6j>gyV8??rBk2bh$DikoJfS zYv!Yz6rL9)m#P<j2Xt*w_~i0<9%jl@R-PHsV1FEa$1HVGn0d;v4~4f2;BC;JeFgF$ zAHC5`iiGi-N`?!>gBdPha>v!e7RK8ngu-QcCm0Ip!i{)@AhMz-MXl?c*eMu3w|b~) zTYi(f!)f0wnjG_Aid3~y<QMl{TVmX6EeXc9mMr2mSxW*mT50C+Yojd;4(o5T)*trz zEfJ_^HziSIuW2*lc9e(W|7?j8Ewzay)o1I^T{^8>`bLANZ#r${OUG0FkHUFB^4rGa zQ*fMWW9X38QhV4P@4;wR=(qX`UZ6}y)%q87I#1!EU<jui^1&S|UwIv!qO2V<@#Ja- z2R=ns&|+W_=4;<3-y^(&#h(`seXKlb@31XFuMgP}ZbNXGzVOX1t)fdXt8`$8+R<A6 zhaBc$Q=hq~%x*nr_F6lEVfm}M(h5EULcHPs5ea02@^|0{+_I@A#e7X!T!taUA|yY2 z7F}IJnLofneogipcWP&&Z>T6=<`A9I)z&c08e|lzQoHify=&GL_!QV93OEunI|I|I z)^=^_uTb@%O-j%*HW>L_@sD&XY=&HIE`wj#9<d$kMUK^iD8RzhvLWICv!D*`6N67@ z;NSI|#mzQmhswu6Nnm8iEKSib_Q-|>L(OU6&~dsm3UaJO1<kLBTXrxHRj|q-3vrts z%&w}w7PeCGwb(DK1&ph(^ulgX0laOQH;|c45p?xOTk@^<=hbDzwPvs)qat=8f4J6b zZovZBUYc_XU=(K9#6r7w>;sUpI>;DGxwZT~b`s{*Q55Zn3s1anB!4U8Datye0ym5C zjXcN6U^Htbu>}w~q|ln@3;fKfGm>;AzyXJdb0`U^mk^%67rF?6yS}HQN%9<<err?6 zP_Act?L6YR6&wlf@Ox)aDRlw-eN=+WgjA}9+D10RnAVwjJdwmy)RU%Zwr)H0F+D4T zshjkyWjby-{IL_&&YNhL`OVzsaiY7awmc5=UVI#b-2ER`?1_xgIE?xSPGE2qF5>_N zOt`MD!ZhUf5O6?X6elLbWC7nX?KH>@oU(2Zam!r-7Oj;0Y}>g2IcuUa2#mVH-^b(> z-8R8agf{Yq?XvjLR|CLq6A_|^svPSRB!Mbfn?;9St@9p41`xx^n;CBR#sEe8nx+pQ zDnW+|?z3#S-05jlwa@oegG+WZQ1a9tH`p{~vP8AuT0k2SSjj0XVe+iNjf-rG3A|TJ zT|VmwAkzkQEpjI>9InumP?Y~9<l39f<qGi?Sq^e52bSy^+q_R*recZ%X$WFuP(?`w zkwAP0Sqio~3Fy}n*~A6N$6PvfjAgTS4bisPF<y%x1Y7^CLL1M`LIU<{iybBi69caB zA(_oaz-l@6T3sELma`&jAOCenq#z`}vaFClxtz15ofQxnT5j{A&No%s9E&GC4lOSV zMX^mQ{5Eg<;8(N=9X9L~cCxM9rEP|3#ncTWH^Y*CB91Q4cd>%ST*;MBo8S?c4G5gd z224a*?U%EljT2#OY9ZW+L(vEu=|eZcWpj1ShjEvo{(Tx~-tS`Z=4=0$JBAxf9zUYW zN<b_y%ed9yPR`_98^|~~duu*A6|X))I7+$PRsrQ&n1;4&@oGAFC*`ZIV)C+ejY#WE zb=e^r1zhd==wrf0Z+PVUs>OHf*Ntzd9mS6@yyi)AADnU&htHS6tuOj>=nT$bm7JP# zsKQd@g1W@}+peTK-^y$obJj-CnyzQn#z-tKY?C+3u^o)lkvL$A$N@}b{f}`TH4x20 zb8QBQZSw<B7(lzn84%k&5bb(a4Gf>R3y6#Td>$a;eJN5URa6#;zKu%<;#vjGt&O|i zY{hddg=Y)3+-9vFT*9<^SlwDZ&I5G5)q{6l+%jwRFdf3`(JF;{bBU@r#V}R0oN(KP z($$E4kL}<zCqO~vmdCAgR~L(^es$r!$Laz=&3;v3>`zx!-sXXYfpCZvlca7{Ez7Jb zIj;IuC9*qbRh9gNu<Kb(h_I?knh=ZqeD;LUc|O1{v#NY6&&{f0^<deFmxonlm`aYz z!c;2-nqvfwvaU#VFkKO#%AhU^xLw(XFBUo|Dg5W>61aXdxm8T2^9Ee8GwEt8G5=G# zR{HT=zHrK^<B{tilFaoo1~)>Bi#L;1^d-)xn`9To1LHTdv-LzZZyDmevBeCRmR8eU zwT;tgO>%It>`7S5v5YB&u@;jirzreunrf%WBSwl3jG2{uK&IoeBt(vx&54=iypHCt z6HfV-JP74wPWfd{`JX4J{Hb3_IAy~y;lA|cT)ycnMf+-tq;6D&U?EA{-TW#!!5(2g z5$sXeNYXFg>%@86vBv~^c88l+u+JNXg-e1_G-2M=L)b`zswCK_wV1ED+ZRY8zSV+Q zk`e4%vV#2&zbx3lEZDy+*r#&)SqSzB%o)*sxImznWcywx+e@fNnwL<If=>dzt^FX> z$B9snMNA5)`GxvUF+UH#K_5st{KvUmlT^TFagrt&O&J`IR}$x?8Z#v^SjB6IWnRb1 zgQfz6gm8g|SXXgQTyXx};n`JqBr&H_1tbNcb#4j;YR^`woLzyaoSSSvpGXCI)>sAl z!sW_M;4Xq$S{lvEh0^5jkd{XCa1`b9E-A1(GJP)n)Kd68Z9?I9%t%?k97877PnMnY z$NPPKAk&w5KLjA=>&seFQ?<TGE$IbCre7Qm$kgzRzb*Y#d#**^ZNbW(-+_1oMm*e^ zk8<EA2D=Ed6^a8z+J<~^d*(^|-qWX_euK%Ba$%H)@s##g08yH0N!lGVEn&7b><RY8 zl2yw|8(ZY?8Z6$kvtr%JWUWNB1*Ctt)`W-(LD2T1Ne=mz6Y`3Y-G8zLLmGP5R*APd z6&^J}`f@WbtIgD$t2JMT1%#@%pfY_vlIw@!kHnBRU6#jWs^d2Kh2w`LXlE<x=9it` z%th{S@X(uhgw;Lf0$CzpT^V*kfOZ^q0a5n)D))LME?~;R-@Q<CkT2}SUGQtu!-PK< z03TMO!p?8!(b3`jZZdu4b=&e=xMIo?RklVOXwN~TF<YOh(Y&79Xh(_{X!QGk5wQ4H zm(0gd<ePp+xb75idaLysw6QZfXv;wDpk0^^?b-)^S#pXxzt}0r6q!A*UY>$FMl6|v zUgle1IA8d5I-D29B=km}1)BZr=h9|3n1xt37BLH-e^#?ltdp$4cpS{J_<thT*m!Ry zZrlR$<r9sJ_kE3w_x25FGV_s`H?!Wq@l4kHTnsbntoPueR?sGkrnQQHO?OQZFS?ce zUN*);={-%k65a-KD{D0*$=gk!SNy7Q!-}dc;$o{!+O-PbPHcW<_T!~IO#<+9+{8v& z+F2O48sT`M!Xn1bxxN4`<_pk*FTgUIgppNtL`sS)Ed|jTw~<M;No1mGUfktsn@rqI zI%+&@5}+GrNaM_@xYfN+UxKd~Ak@&(7^s=mCRy=)b#VF3DEisti>6W&)et463at{Z z_%Kldtr0BvUQX851b%lNR-es?*MZloUbF9)P9|tnrL3>81nQ*gYYiBi*Fq;=3$Du^ z2zV=~J!m<W$DN0;0}AkF#-p_qBh$6DSCB#DESr1D^&EYN>URx85^}Ap;*#p#r!NJg z29Oa*!e9`BjD-aNEe{nEREed_1IX>M9{_|O*oy=ZlgGR?yq^UJSL0yu?$&&pbFhF3 zF$W9TiFc{0kw$J2NSShr(5{X^JL49?1_C(LK{Ye}5C~=v`9pS=X($llBd})tAvCYU zJ{kamAOP<V(FJo*?+;O~vIJ)NLumKqI)8}ei9f_d;<P~R6Y__^XBzj1<<1|1ab~RL z51|K0(zt263frdRwgvqmx-|=eKLn?cE(`t;<=Ora-G`;J_x=!F<`2<jx6U8JIaV;c zXZu4;IDd%l`TZdj(`z8g`a>L)ikvr#@rO9*;7Vy(e~5$U$R7gOpM^h!<vOE31V`bX z*&o6(%<_jYB?*U_XkrKK?64tTnDUgs&e^F64`yU}HW?1k9_qkW?m31ajSDYV+qKML zHeF!8CV+07F9u!;vD~G2#QqD0BLJqM0o%CVxg%7ILXgzMJJ*Vw8CpRDomxF|+)zOt z4QS08o>W0Bx&#drg(t054o}+86i*gCo-7D8o7$z-xmS6`kB_yM%1Dk@&YR;3=RNm) zA9b;GpW)yMM>6L69-<d|_1WhxeL0^4%^(15&fi+qk&1=|oJ?WATR9Lhg51*$(=d^j z5dndSrg)lY7Vm0)k98bfwn(EH!OexFl|XpLgXgx@Bm^=KG$D{3A`J?LsIgUwWnmZM z3iMN0zo2)Lataiy42+D0isWlw!?w!ym=*jUD>;V8DXSQsnAm;@*X2<pHx!K{`y$8O z7sEZL{OZ0n+;hmU?mL{@3cjvHFUrl8p+_eLjcIod1(KYSnp{1;7TV~(;^SP<-nF=| zB5ROk?5gD|2#)#Eqs#IuPnDeOFpPq+A@c8(c@Y`OQ(d6Di3ji=v5+#Vw_;5m*Ku5f zYX_ABVnM7}W3M`<0u!`VEC-lg`=@#u;ZVBK0^>2XnaujyELu>Zo=-sws+#)r(LR=} zVB_HFK>`0bV~Vs8H18`L5RX60Rx9h6rT1&+(s+Yyv!D&ZH?3FO_z^>g*|by}S8PCf zrn!C_5qV=HL&6D!@_MuZM0f3e`nN&3;thP|Hbbb-2trpC)wGFC#+eo4p6dZcG49r- zDeeg+Un1!}{KpGBcuP>-;80&7zC_TmdbP&}U9S)^5?=xeVm9e^Bi+-i6qeIPyJp8d z@kU+N8~Wn1kr}O6AX*3DL+#!1I??6boNTk>uznFwpv#EzMb%#K>C}s-Q_?aWo!yK3 zfA5xv&)EyQe5ot-l3Atpxw1C9OMLc4#z~QkiyKhiP=6`AB3oUN8+<D{qP)J98))SQ z*Gk+aFOAn}(|rEfTwQq*=Bso{H?8_7uC6*+C7kZm3Efc(UMbbClSJ?=J9VPkdXu@% zb(;!BPP6}nEBNWS>G3M=^E==0J=Ny#iknYDtTxJZa(ViMy-nhleLefwbd3^s5WcnY zq_1|Qx+Y$AGSs*m_noejR#|(tmg3`a=SkR)a$06f-1B(6{3H=#E7FI)qSJ4orn&;? zQ<|$Krqk)I|A=<e%{h-%)=o}Z;k2NYc!dD0*85MKgkNty#qL+Dc+`=3bb>e*PSK<X zX|@w_>#1t<&fKl&ZkokQ$89@v-%W`vJ6mo+LDjM||DX^mgiWDL>zUQe_BY}<ehGey z=7>prNW7j2i6Fz=g(|V{?%|Rqg;oNHpDAFf1L141OScMYuC{#`+)U^IRbr7m9k-p> znR^g?*>);!zQt7iOz$oZg47C;_<$dz><8(FB@|8zZS@E_cJs46UP0&L<)=>UjIfuK z>Dx()XVKk@lAah(`g{NDAwJ4lR@P3YQyX6a1iYh868h<~5P7!_^d#w2+@L%ntCxt< z5E0B;2FKwX=vI9}oCd*48)BhabA~G#r%^TJRP8Y~W23&o!&huXciaQjfCLN6=>~Mc z+YXq*je6gcyaYv%O=#M1psKC*cs4^A%9@aisl5k4Zh&2e&FB@n?BOBJp?JF<s^X9x z2@3^jqgQN(g-tm&!+xf0Mz3cxG7OGmGZ<m<9Ti8RE^++D>m0}M@M}C@vDf$tAIz`- zx3PVx-<F>1EVSL<aWZ#8$XUQPVkqD-LZXSgYpwW^8UwXUtelv(UCHs3E{|s%J+)L= zp81+PYRNnnCJxjRBI&3lWHV4pla5WIs;8E-$t0&-FNQp}$PFl}tbj`5AYU{h*-XD$ z9Fb%u3>lH+M<4py7L5uby@(`>gq^5R9EeCN9>%7H5nVewnKyK+#fYTj#!N<u&z2F@ zqN-3lA6P&@ajY7i=8ihr;nH&9^B>SQwJxa&jez+{!)d!^LUFrkVe5pU29^5+0y<1x z-0U8SP(D#vsZyx#3F4APDxavXyA2djj#t{{6T715X|Ver)DAikeHY<mD0olb=l*4O zms7Xfa>ng8Zt9840_tzPy+_>Ws`{d4m$E7?W!0=wRwboG;2rHaBv`>l23WAOO%24i zS+VfLg;;N|s<wC%NauDXP}12&z$|VN2`s{{l{cdTQeg>TePO&-Vfc)xux4Kv;$VGY z$U<?mD-3Zv6c&VVG!)h{^!q9-a)q(mpE*kd?p<lUgzHjN++>BRq~hhEa{lSAc0DQ@ z`j~ED^6=WOu6`6+xyGKb$Sw!bt$!4Hxz>E4qemWjq|%)~soHL>eTRb9ZF0xmcKH^k z$m6TcF(oS|nb_jTpkO@O6jL-+t<??u$)nY-q|CVcebp6@JqpQQ{TQFD;UnL$F7k&P ztAiGh`}<3{xYCH5s!gm6ez29Es0y2JCYzBl<sf*_0)?0`>mG%))0mZyKu^~_%A{QW z7$NH`A7a>=ji@yDJfcZ!(|?t+u6u;Wlpm{>AL4u7YM$xuxi@_91J#~z^T`9u>Yljg z4qeho4J>RnCDYnd2^z~IW_QmIg%WB9=tR#?LPOltcj~j1bE*r=MT<4FQj+y@h7#iz zT1Xp7q1I0x(CT4s)S~N5E~8DXagi<Bs1@EkA+lD0HbE}U0g~sURC(pt6-4oXE3{IC zp$vbi2$31Trc@mC=I}&`uT+%R^I19a&PSw&h`VFagi2a$t8>P%L7AeW7O5v`(g?cZ z%I72Ks1BC7_HyE)O$w@WbRD%LE4^O7YU%^kpJ)hl6SRoz1}Om9_KiWsNDJ%fx{2}X z6GEV;>olU39xk&UN`254qfs-uK3jdDvlRdfeA3ye4^n`8^#O1eT@UI5N7p}BK#5rJ zfoVmUp`wPX*Cu<$EyBEJOY)k<cLaX@EsQk^fhaCH*I8_NaR<mtb5*-G_96k7FK4cc zG3+(<xoHm6gFfw$MkqF)ODuCH%Fje>0#Uw<Pl+GNi`zur;u1B1D)Z2qT)Bf1m?O*( z`Abs`VQp-kiR!LR#qLEJkgoDd3*bT_I}Mq{dxNnN%^~zyQ`h~}R(9IEkqpy}39CnQ zDlaI(6Nvk<uIj{6`3$?>2cKcG%<4LWSd!OpNm<w}%>f25$;D4}P|92I4qS`;g3(!a z#QDe3VIl_Y)Xu0aaK-emotGteXZBf?S~HR*mpC=^9Io*l3dvqQJ7%RZsM1j4I3wc1 z__deb?AWcRu26Rbm<+3?<(Y#mVvKkBI8p*w7t|NsbdHNG{luEwMw!odV0@s_#<yWd z$nRkK(`3)9X<w77lidrlsz5O4KdK{BWRJK@pS$2uC5jijOVD+L5rruXU&Te00VV=e z@HEnexXg<vhyg%gQB0|{-884UT$ReU7m~sy*8a+_O6v+5M$<gl**j>Pu4h3gCeJq@ zR=X_7y<^I{rsDKOZMFg^bBhYz9KawAPf}3QlP#_w0>cELMy1e4aeE$^jY}DEr3__C zp%Dy+M^}_k)@Iq#+9>D;X_EJ1O{H)Z(gK_Fwp{HHGE@{wtkVk|^g(r|%<KS#n2-c2 zN?uA<VqI$1Lz^W8nW@8w46DL1*2byNF-DoqWy!`U)=#~XmCA>lf~>Eyu2#nIzSdzQ zyTBc5aJXo)*%;B&qLEsi8!K7Vpuu;x#j}hIE17Gp>>khJWmh*7ksVw!LPd3>lyJh- zP9Qlhrl*$Q+f#{aImG|f7NuID^i#(wuxhM-WXfXg#IcH`P_&|KatJO!NL2$Wui#SL zQ`rRQx<M+0wF;%{zqkX@j-45_*fz3xkz?;AO-S-#-^LE6AUIKC1_3g7av(=kTTNM3 zDN|mX$k%lY&HdL+RV0{0y`+q_*&x2amq_RmC8D!yk1x^O=yZEZuHbW*Ll@SKskMnr zl4P^oB%9?<V1ZHeIoayS)(JY-jtLWAmKzeUtU~i{aeY)!vHcb($2MB0)Wek)rXJ>1 ziZ&?-Hyc*2cAa$%(AMuA@hXWgXi{W*=u}=4kRUmF0+38Y0aczLH{1D6&>w`0iApE1 zkkw&TyrD?v;R&r=Fg<+=Y>M4+mbWWZdruLn5^llVk$sk%;t*D{@VYf#5ngkLz9Zb} zWoLS8-%_C<xJvz76|Wb~D#bmbv`cFYp+9tz$T1j^8pq`1r3%qrA<LL=uu}dMTqHjY zmLSc(O&aE$_LR<yy?;nPippkZKqwN8%28p6%otH(I!0Dl7$sLj#7XCxl=@U=bmcEq zZSO9&HKGmLzqU&phi&og8o=o2rG1u%!BB&Z8DWCKhhzJ#8g2s(Yu^kl(N}1RB3)?y zP&0!fk%CW|cmx&esEHkiHQN-sg&|%)3;YzLid>_KF8FC=+u~I>E^DK^9GP+zP))fL za>Z>DE*L5CX|NwQ%Z#Wj3v*mJR#ps6vd(xDObm5EQfL&xZ-^~A`A0>m$5vw@w%{#x zD&vryxNI-A_e}D#b*ei5%MQiVH7d3RO9#`eQwERDxay`^FVn29J)KE=v@wQNDTL04 zKESlseaKwWG4K|M$x7;&faz@#Q56it-KoC?w*R-|0F*&gRYXBtvv#7>uyBq&;D^uB z=oU@Ez{0eh&{EpO4*1GiN1MzYz-Ut`AwMZ?0`)oCmA;%yo6J$d8foGRKGiIE&&XTb z@RyL#?-+US7LbrAai*e@@mcyy6a+5^0F#`GCffk|m9BR%%;=6a51QC4fuk&#yI8eY zc1|^94?U*Ps-dhbrf{X`sjU0143khj)o1Ut1l+U0>l;u9UT<cF^tU$vZ+if5`f@?= z!U11E@DfcZcz49BZ$RVR5yx)QYMoajaD?snvX*!l<EQil{h++W>;(@uTQ+;RC3)DJ zK8%xx?E4o!htJ0>3ys@xcoQmJWHa`f`uUc8OCp;!x$TuwPjwSY2wO%Pdn;Jaq_H-) zC#@zVYJP1}jb>jM7apQ15y}{3IM%9h+H-|5@D;d_*^M-hIgl-YF5_D!S;6r^x<p9r z%y5&*azPdYGa-u^e|S}$EM{trR&`YqtY9LT`)MMW=4@Ut$8KrBu4^m}pTDt)mq}Bf zL4sULTX#2TtK`MBg~k@UrVA^ai^e{?#K!J>DH{9S5*vH_i)^f>pr&`#1aVy4q<?6? z*{dEvSWNfLk!(b`V`;8K&n1DkDGQz)scNE4ZwqKnq@t4OEeRY`K?mYDZbc_4+DqU} zL`{5(){M+b;AGdfPJ9RJ<t1?C6xYow6k2i($%}V3K|Eg?%jLlIwa>g-lLm}`dz~P@ zukMb0yqI%gtM02ZcMJJ)960~AlzwD+ZXI0_$Yy&!t`uU-$mlCg1g-OY1n`&?<oTEg ztefQd2#;pMN>%cVEV|kUsmXjFo8<c#r@zf<%_+?QWGq^nPy8So(I341QW67k_M+#! z^e5{FIZN~uXNT(1F%sBbwZ(>E14rLMjEpa>k@D8)dO-?0tI!$VT-}KuWMQu1%}KjP zbw|vfz&R20$R66HjeIC~2nml%AB?B9=3aQbu3Da59VGH06|zU8q(YP=k_s>3f>elF zo%v}pV7p-EWx)2hOSYq)RCq$R0lw8vp}u9z^7Y0CONQfti9M~_0FJE_JCKW`3cIa& zf2(x{8-WBpy9trFDqv2s%@`r1!O#H!l?irQifUGu;@uD<V2lwXIF>{w!*m$8p?nCW zW@OeU=spEtGSV2nJ#30;rVj<6L2?oZlw0>!iS&By@p4Iac<4y7Q=RS|L#QVd*vWHL zI1{j_IBiW-<h8qeqOzRsA?CyDcN@#?oJu8sp}Ps<nB8@RJNI&VxCJ4=m8+#wbc|}r ztv$AU3%F~G>%MJ^>%UdM=mJ9FA?ziq9S^dG&M&Pk>``Z06qzX1GxnCMNu$Qh_P)fJ z3GoT=A_J!uI{uxVX0_8sn;H@137!9F%)MSBPt5-kd7^Q#&5|eB&`R>e^7s<hyR}Z9 zNZX@%;zSrpRaT{@4Ig?AZLRwdg$fR=>=na^N>>4tq`nAK#IzV;iZEr?r4zyFJa8}| zyL~DwrTit?F|Xt2{nsI)AskBVXCEb<4cNIX@1cmJ5MoOm4Dm&wt#QeCZU;Sy0;X_w z5B<nmtD4-%!e7W*5wDTp?)ooNuZ*LvBxh`a$&=Tk34hF3A>NGVvxi$9F6?xo47gCo z4~dQ89NPpJb_QNNed%~{TbyR~_G&o#>pVfkXCiZ&Yq+xnBU?e9QF=B+iQ2&DMWIA% zv%~w@zM~k?ka@AMb2cp4IZI%wgN0W~0*h4Zn8IRSmE;*<A-Uv2!XnwIX@i^h9I%7q zG9q^Ahf2BfJmgu^F-x8?Z8;S>!{P%I<|WUL>R1dzpCLuo1Bjz;+d|wgAQr8VYi;IL zm_wogY&sOC+AUYjmZ+I%7MI!65*+KMt;{j*B>`eA4=GBVf_aX1xSm8Kn9M_>6Vdye zk?56yL<gdbpO_J4b{`f|?&1PbMt$pe7J$?mmqmL`qgXO&-P0vQM>*+`9Mp`Y`iH{0 zAQICr$z<g|@fW#sIq<;Wh@`fI279#gnn)_-&gY}7grquUX%=5<$36zwVWvP*)4H@R zAG*Q4;DFY+T^EM|Tr1;N_!~M`bTa^lEJszrn{v;BxJoM{?anem1OR|HeK$dC8N;sK zH3w2D$|(hk?|~6keFkB*Uhx|JQh3cBy$yHz7U~~v?OXMZj&O3fv?g6{C9M|XU0P#2 zYG!L<RBzxMG)e6KE7UA47V{FAxRO0OGQ8@8QsjW11f}REu&HPQW^19e8XByD6gA7z zNbSwQ)n<Y4A2dBh%`F<Kgj-F_$xB@d2s}o${F=}9U#L1o&u*9F3_R401U-9rEOY$@ z9?Q~YpTGm+=H90-7len<^M!;546zVYYrM)$DmJA8HNX2}4ASx8_+8TZDbgg_wDjd5 z9h7C+O-l*IaUgm*NXMkumxFY2;)<Z^FCs|i$qFbA#n1w7v#)lFowLbZ`kRiIHfE%^ zw$zvr@uQx&SJwN8k#2K_#qJ0@f?*LW@_McySG>W+-dK<bRGepr`NtUqdBfJh8-j`h zx{Dej8wAp0t{Cg}ICd&!ks-&v$mJC+lwwfa6KSkakAxhROH?io%yUD$*cn1Y<V3$v zXb8a|kO|zg5xH8qgwPNgmjTGSxLbY(yNUY<p&|BQM4gDLJ>IXA(~NfE&F-3BVPp6n zq}(3)b#}YZ5Gyqa4e_P+xxzQQOMLc4T4;zB8NgNXMN*;KTXq-vWsvf%w9t@jD>u+e z3k~VUyg+D3w?aesCk+kZrd3Zep&{H+OQX<`b=jbe#f646tHd-kgquug2zQGL4OxGt z&=A<uY%^a}Xb52)aQ^2YGz1=TfzS{%f4$7=Mxi0SG7HTg8e(T}O4TmEmvyKRjcGia z@DL`C4-etjyx}3Xg5-s=juxJEc!;tt6duy;!$a1cF)oDI4j&gHt!U90ejgXI-f+uC z(}1|Rkah9;LrLg|ZgAy+oFs7}7VBa{uLX-q^W@N;r1k20nSYJpU+<)>oFYrs!|?mK zkRHR3JY?Ak1L%6FiaT!v?n>f9dZeDVcoe6ecA+VWdb($>dRp~L&;bJ%8pnk^qbL@2 zW$z*^7d|dz@!yty?P7=vF>OZ1g)2l+&L)M6j0<VHI^r+Hh2R~D2bDXf+*ARkp)^tm zZ3?6iaeIym(<0d!kwzgNJnj<-Y)k2x5j^DkgydD*L;}69A`{7<w1*ly(8weJ#P+$z z7AE&_sWp_r0!v%~h?D{LNP&~}0U!z>J3|17nW%SR1j)Fy!=KL=08%_d0Ej?TU&?#| zAe2%c0Max!00gUn`~VZDQ@TDY03<L9Yz!bE#ufn5oDBd;cndu0RaoM)YK0X&)dWJj zk}**<2_1=xqV2Zd!khpQUs&)^)Sz5dJ&VE=0Me`g5dKL6K)9i+*#Ho3B0X6`00>{r z4gld%8UVu0`3eAmW1JHJ0#RBh0Ho-n3eOY(Qe1KXh;tjg&+9uFs9jYd=`)0DkQI&L z83I6jk+Wv{8A@Cz0K^~TffuM0FtkxCys16_#GHP2izFEiZ~-7t!hk%?ojF6v>H|Q; z?j`{sG7wv6grH&84V5F?Bq#+2L_rZA{fOYC)X~b61C0fMsMQt#(t<g&Hcvz+%AxuI z5LV&B0U*t(VVR|Negi<vr~*x=s}S%+V|Q)>Kw4Y?NHMDAOV7RpQ6R*?y&MP<n>Wh& z4Fvg<4O%KJs4Q=$<&~2=%aQ^?&RLPA2iE2)J`hAF=dq;C#YFt7n(PBX*1{%atyp+9 zI4f3*#Lbb|E`9E@*<E6H>2?>+QZ+2(>`4s*K^9w3jh4!1RY40D2+~3z2xi`1%pF`} zxvaV>tt&`arhUi;g5Z(h@EZFHs$D9m76L&iPEQyfEq#m7-J*gU1%hCQ2?bdoNK0+A z58-G~3czX{2$Ctq0zq18ArM5R&<KXZyM$6gT_6ZH2j0UvfST*Au1j>bonv){Mu;qc zpbOB03myov$^t>8+h8TxMNuyd4j0Wp8zbmrCJ@9i&Q%@XZb$gFAUv<Yi2?t9=1vF% zS?A!Iks{7xAjmqT<dTNU{TG+Afgr&!=mSB>il256D=?NNaUj(-Ggvis&?>$?YchOQ z<x+;HE;!_saT*wct6e59U&nA{<^WGoJ7n?<YQU-s9C7B9PPBWtt5^U@vuf>Shoums z;W+`qbxU&bLAT-pIEW(&d%J`z#CZBF78`G&3s|82>yWG2a%sWIB4{f+i8xX42d+X2 z{^%t5gUia)RjBM^K-?M-r;@Ql+FcU#;a=9e`{*+)nk&@~a<>yQ<eS7D?hWBiFFE5k z+?qwxJCtB`mhXPnvwLZcX&3|I;y*M*_|<U1<AzZJ$598vA#1aZ8d0FS&GOoDtBrF` zgJ<I$MlXC}W;05XILjPSga+u4LC_70irSnr55MFUW%W9T9_<K37#Yy3uhIgy8NpDc z5R)lmlBs1S%S!2vm7{WujaF&gq&TQFrsS2N`S?;z*sf#z3Pr97MdHOs{0mcmF_9+1 z0WQ*{n~o=uChTQKCtak;N`ARWlQmX2NH?m01})OW`5EC`79vg7xJVP6g3d0|#O8Jq zX(APc?DOJ)m#2{?hR@k+vCNF@Fr`u^(!>tsvS5;qxsfKELhK_=8otCctZ}jRo?){i zO+tH?C+(T-8RkNl;>M9Cr8$u%>Tf2}q;$qe6BL-}TU?|GM@DNn3}#0Boa<pd@mpdj zM3(rSO{57f8elR_(AkkDiAU;-jWp4*Rgm`CktPb|n-gh5PWk9*twJ=i_{f!_rwd1# z%mS}(KqHT?#Ri$40lZP%AkyT#ftP)tq){y?(qtXP*hiXZom*gtMTB(Y<Yf$71SUk| zm_(ZJ&_$Zq!!0g;goiHD#2&`ULl<dc4}GLbi;FZ_=ORr$eIX)E8VP(NwMhiWMHXz* zpuHD$yvYLXz34(t7HIFwQ778>0daU~Q72!L*+(+ld5t<bpS6^poImOWF04)=fVbsY zyR~{J)_I~%aMnvAP?j4L8uXE|HhkvEc_Q^^9d+V2Jh;G7C&(r;L!9HNlQu+VqE1#Q z>I5d#N1YH0l0==fDC)#~-DO|pG}=tmNj=kVTL8kkliB2qU|$JQDMt8Bp2V1~`C~rx zy;UzJ@g%VH@VgQg3FAljf}c4Ym*&coA&beA3Qg%j9qda81tA1d5OZb)#U+s@h>sE` z%Wew+@u0Xpm_w}FP25R{iK5%Y$3#?hFB56fL_mFp_-G<Lx!GbeG=w|C7Q&sr#Tzr+ zHV_{(ktR!P3)?H0nns%=sAp1x_(&7KZeSvDl_cH;fZN7P7TF=O(av;5*eLmziLjxU z$P*Tv-tZ;zMB`$;JfQ$~hPyt}#J7hK6|^|MN<~a(BTYKRp>@VS(nOK#m1RU3E+*Eb zev*30RNEzlc`DZ0gwu?DcTPCUbu7MYFbb~!3PxEmHyFiti?AFY0KUwEQ50AuUY!j% z1$g(+^XjY=dDh$Dd&`LnMsZ~&!6^2T_jt}}qS10fd{~vj#|ub9wn3J~-RtB5r-;P_ z;{)^9<I8#YrZ3Mb7=_xK3p)_kwc6$JEInHYMybb?FWULv+U(3z*}m5Yqu~Er4-1E0 z>LtS!uCItL(hbgr#fkun^yPxEkmzzDVKF-xWjS(+^LT!Rb6Y%<b7Sc}7em0xvRTwU z#FYA(#3(YEV4z+OSXnq=1>M6e6`Z5S7R^#mjSb70W*KAz*+iq72DkJQoEhkLK#O31 zIVZ_nV%{l)x6G!-Xq|l)qsEGA!FMyzxlj;llEy(QM5ic7r6UbeArdqMsW{Xk(z&Q0 z6@B(1gH$?%mOJW#RF>A5vk6j3FsSDJ%RwqIAsIa2;o)Nl2~tU82-Bb)h^0g8>C1~g zNX5ku{)`UIEGT}~wp(C7h2)U*LbBmubM~0@f^97l=aXa7QTVy-78D=vPD}?JaJ`si z{6Xm2ZlU>cc5FXc&4=w4BJ4~cS&9~;mECRuisuC1CfL->hKF)=;}yoyQoG5wtsK@= z`e0XX8SStCFJ>akZxS4ifBNCh=3G?BHx;$vA>UMs>>LfRAOug2n~0R-qW^X6J4CFS z_6N(cCy{LqRdlCHh@U-%naj3UTgKieQ6(Y~QicozCxQb15bSMUNJl<!(Q6|fVQJ5C zkOcR|aG!Vgt>M1l?mKiJDL@*i=pwNT?v<@YEw0GwYMWD)uZU{ghg|d_Kt(C+0+Iv^ z6OD*<V=pW=OKFqKd&eQ--n}ML2L+Zo*h895X^%<8DRMmFF|#>jzSm}*?t8=<ofDnD zt9xU80Ey8Q*9OWwCV-~-<D{$(ZArbTfnjfA8u;}yFiq!sU=UH$Ns<l>61WWvvx_rs z(q+RIu39$Q$yLjSt6w&3OC;$eVss)~HaJ>o*|amU@DbC_gq@kCqfI9YJKQRfKmnb1 z>qp|)>vCE@h#IU9?u+4G2e)wF8t$9jeTVKFuAgP;`f1P9m(=F#YPf{_Auk!|l#+>F zR1|o!ZIoL=#Rem#zSGN083}~J8cSG4hP=X(PRi2h3riR+hUM#av<equv~US%w6^le zXd%Cz_1elUWwcCKuUlJE5o>MvwIoMFyVoH|T3g{>hahn;#%2*~OU?{_C9}5Nw++bC zV%HYup+=Qi<msHREp~EkG+MZ6`L(r}(E@0TUt9k|MvFZK&i`m-8IY8rK<rTrwmZD@ zO4Jg0xEY;d261BkFehvNKoNeoZniVb$j*vnFR$-E)*ICxXf6HGEw>k=C?7>pfyB?K ziPTJLA+?g)NbRH&se`nPbi>wzQ=<na2S#c$GgISt9G@Ax@xaXJ-D3x*CXei!8a*<7 z=j7Bq*F;hG>o|#wLO)JnSG+oo<Gx$_?u+*CKQeaT%>JWO<M)ikllP8I-8nJ&j_BU8 z12dCT(e%v0*S>b_z5`=NXT~RwMAL`IkM180wd|h>g-3Uc9^5}VH8uK93VX-?iLoPh z&D_ny>G1>mr)krXyIe_@ZDL~bK(y=4wX1K8-ZIUrc>KtL$$O5D&WztNF%};jJ1}{0 zY$~SB@yy+0ygYh*CcbNI@}9Aosdru(T{}8HF?KMXne;j1qm$!DX5yq#)7dQJN5*Hy zM<>R=b<E20WnUS+<;dY9lkYeZ-!p!MYUuMcy~{ivJ(PXC$C@xc9UqybqWGS%>ARJ8 z`uNeKlT$M^CbTY|dFRowE2A4M+b)esd?&5FGMZI_Yx04K$>Rs>3mO9w2L%#3d-o(S z=k%5rqX$Q4MjO0JTH)SrK5~3w;<D(b<5Oetz2j3e$44jPJC7eZpn;4Jj7|W>O7y0K z`=-Xml6f<|%R&FOu|{NSY+7)MC&um_n}{zRxBe%+zOp^Kc4BgL<|e^^TE#5x<69im zXB8T^N7q~5=RRkqN6`b!-Q`@%B+eF(R+3hcx=5=@Ye;KJS|8n{btJz&2K$nJe&g}c zBQxXQ%9N{LA#RP_N*!7w{=5EkU1e8O6g`jh^f3AKcNL3sJ=Y#mFKGkm64FLeOsbHo zq*stOkuD{L@`sal1^8bR-VJP<^KQ?P8P@3NfiYIJYeNThYi&PITZV)r`1=soS8{z7 z=}hg}%=^nomy-e>8JuTUs6y3qnzGej{S`q-ujaaibOq^3(rZY4q<+!>X^<4k-gfiY zvEyR^e{>@0nV&aFf4)H3+M$onq7#%q#C0o4{n$ntCS~C|!u@s<!x7QE=qi%0Z*X}2 z`lhd*JTfyi$wHXA#`?9Fx<bF6=l3^I&g)5UAZ7ctgM0O>M%qcbnzW0g4upCK(|R>v zca2TW?XF<?De4gn^>+e<el6GQNV`dUNN*&)iL{q=J?RG0jij4M->7?s`-l3j2P@q) zHFj{^7WmBv?jE~m?55Evt@DY=yQW6(@lf6~e#6cC2Zv{8{idnWqm~2glg#ox<Kx#{ zL-v88My2lp4ed$ZCf&Pwa_Y#~)V@)W`8E0rO&l0*ScpS7FI}q!XG3DCa7ueR7rOhP z3kO5NVf`9(19S!l=4(gDo&s{~?5r7-Ae<C4k2JTw3KHDqe}9tSd;RZw_<gJY{W~xd z2mS9Mejnwx{&dw`d^1TnOLI}z`R1bD=}%?pyPHXi`R?;DGWu>G=`AGHcMEC0`o4*G zVeW5jG_kHfJ~1<XaV!9hMIZeOu>EW&@TdK6C4DnVeSI6LQD1N4`P)gpuUoe@>MMv0 zE^BoB$k@S)sM|INd+BTF_mdFrZ=o;yNw<^K?@`hnqywabq=4VX_<g7D9ex{Z*zbK~ z_gy_XIdw3Q%?po3tdCvvEA;V$FeZ1=?z>6jB=zwS=`d-6bPp-?@d&>sb?<R_LoA#0 z@g{gpA=Q9JE;t^yzP^y@>q9VLM``~t(iBO3ohHqYj+5>sg}%On-}mX>_jRDrJig9x z`Qry}Kwuf2c<FlT@aLZ}mSJ4GU^3rH`@fa+ZKM;Vlcdm}k+bNJN86KAwW+bu3qMzv z)YP4$(_<IDsgAGRztWAvlgzUY;IBVjH4djpqAwZ;UG?`tgaFZy`$?xsnvdU3YJ^wC zKYa%&0Ocj*pZfbR5|*h!Lu}2r1J}SK%mDw#xYwVqg7<flGzNmVuJge=jMGyHYWnU0 z(sz;c-FK7b`|f*q7slzOruFl|sFywkxO@m9^g-JEF4Fgs)W3I=8ujlXp1+6W`*$(X z_eNc{`S7(&Ur!)xe;@6CFX>^D`uhE(M@Wy79wP-B@IHS3fbL&fnm%v8zR0+RF}w}s z!4J~b_mh5zq<;M{>0gmPK>86<=+}?(`(Nw+;-KU6_U~!ND)et;9r%(q{}}1VN$THE zkUm8EH>7_{3jO;qzdxe;i-C4G=$-iM4>De%Zy#D8MIWWTKS}y`q{m4gBZc-~1hl$A zFP7B0^Fy8+v`%v6KQd<o>)W}002u2}SHb$HNW$-eb-?qt_c%QN?|JrdlIGZdAT`2+ zqQ_5=JQM~-X3My{#wKP)m&y?$oAal(7ip7dnf{*T_fK<ulJqmAD@m^*{VZt*X@Ddh z&wnI6Mfy*q|4j0292`h>JdR;abRfQ+)T%l^LOs$a>F>D>QS=F}KS%m6q@O4K0_kbe zCrQ6Z`X$n*NWV<_6;hZPi{+Vzw$BElYi4R4uy)pKd@iKI=cR7o8FfEPY#dWfV?NF} z2OY~Zy;1ZG_j=yV?`Qd~zY`my=vTQuL;5w+r%C^n6vlgLcxs95P84~w=gcD2d_#+B zb%MWMs#XiH{rn|vY+AX_FedsdR-))LT>l&C*GXEZzd`ye>2sw2P73SvH~IZ6DU932 zvQ8VIao@y+b+PAbJQ}pg*2RH1T_aC31}|{0zXz*P^jlnioAf)R&y#+a6kxrm*_O!N z7qE9rYUp`i7LA6%>{-9XyceF@!u2$;*Iyq5{eN)%J<=CQS_}V^^!ubgAU#J4YvB+1 z{YRuQ(H5rTOB@T2XFo$5g<JJ^@X{#yW3GQf`d_3!CH)!ci=_We`g79%A$^JT7o@)= zh2dH3n%y=>Uq73+UOjqb^2j)bR;<rX_y5un+KZ~SXQaC4qNU>YG>89SQ%ZyT`MsC< zq31Kq=Ue%$zus3x(U-YCPx>p;Uz7eXDa?zd;g@sKi<g)nUld(%dcYfB>Bj9L#;l9+ z(%;jYqv$JKze@UlB(3$oA-zEQThiZ=!dm}(et(S=#`L0G>kTk+z@ZBoPA|w<HE19( z)p{y37GZ7O&iFjZz5Z^yJc|B->pznINe^=TPYUC35wEQVon2C^6GHw{4UzcUAHB?t z(-#?+eT<3zx?b&QdY<tpkhFe^T$@PEq!v<GKdt<3BZc|6Fik%fy%iRB?fxKb*8I}n z`)PMOZ7GpDNI_;_#_t`x4>Efv_g8bji?p2IWzq_g@5A6oD!XT$ff`8gt_=sNH^}fW z@Ovd?ts-@iR+Atp(HgF6N!_G%r1hj8QZGsGeck>2vK6H&0$W4RQRdzuGVynC3;siV za|uc1ZzRQ}Z21-LtE5+uHjyqRh4C@`cFn=N#_qt*ba-qkQ<c@VgYwk}{XKXEenNcv zD$-`sWu(hVuO@9FT|v5%^cqs|$@voB^l{%$8XyglhDcjU+epKt5z=;&{`N9RujMz+ z^3heKZy>#%^aj!nQjN5ebTujT!R)<r`>^MpqZ9Hu88jGX-s7_(H@?JZm~lKAG@C&t zuZM?~m3mh=T5}V96Ha3j<LET$EZZ|QZ+n6`eQz+_s%5T@#}-$|pyA6*KaxJ*GK$CL zfw~IRhZlVL8iU;^wsryEYe?6oaPHr}3)jxOuN|M7p7F(vO)cQmBk<esB#ULw5!{Z( zrmykdi#OgeJvPN??76vrKfO&HSNaE&Dhw|s98OYD))2P%YJ}^4m$|0CPjKBKWgdUJ zUPqsIyS~@H^7~QgXNBO*%eIMYi?Z>zyALfTFWyLc6KO9g%m7<e3CJD#IN*Uba{cIi zVW20E>>9fZZ^)#t0%tuvSwz<c41yULZgu{aN&SW;)$>=-cJ=%N^mYfo!)hJr$8${m zAl;bh&-rWff}_4<X!w$yr0V-S!L^S*>QC33=;Jr~zUtZYJbN?uH<R{}-a<NyF`aj1 zEV=Q?P`YtCO1m^p`a25Qx`lRq6Dc!B=e`XdfSM;|>I`s;2a$-V`>mvJCcTaHVqoMP z24C#5P64L&K1O?iSMA9^jY_|sdx#c`2H!>sH2CfO&eF))H27OGy)t~A@&E~mG~7Yi zfj)kQ-~0LQcG4*6j<k&at$Xpf8l9?Jiu(TJd=o}iG+pgHKsrbYyuuj2GrU6W;V(v| zkLFW%@1vtr(_^voA-{WU6pwiP%ANhKf7npK)p8$C+U=;<m7at6kgxU5Os#kE`|kQ$ zLx}@}X^GDFH&d>9bei%4cT(KydNiIX`w+hm&r^1$wGH6y*1{Kj`4kZ;<$Wr0RciGq z{LV$SU;1-RgQt0sBw;-L@hmz`D<>%G9?}ugB+0|i+^hl(K1#k%k-~TSR`*BAe~dIm znohs%?@J+-VBW{c|I}6THE)mBty`xeL{#`Qqfg2G*83Ihyf3u3(8;zE7R$C~UY4R} zeWNdHKlUZ!fIHI<+L!6^GC`zGkJ}>t?Tl)_N4{J~RQofot5+$%{nOTApYkv7-uD;e zDN`ob)ysKN)IU*M+4Ar&?|wshR#G0<OIGNG{nNJ6^6)SJujlvr_3NYBBYzo{I>Vi1 zXk#3BnCqe>uB$OHJNNsjt;;g-FYo?AdDcX=cYT>j-o9FI?4LFa?)>pD|M&F|3=VDG zHaxPuw)5&;*IcVNng<1vz$qFnPy!5Vq&lqnr2Io+Y##LpI_8ZI2{ey!rmlH$OA@$_ zw1;#f>1NVfNu#7O(p{v(q<cumNcWSzlk_gqyGidO{UGT_NIyaPFzI8YpC<hb=@&?! zB>gh!S4qD~V$xi&_P&$4X1DphJZseMkMca*_D^s>yZxWznf}^I2T5OK5X!H@%KqKC zXvfaw(di#}e-!=USDT_w|FA%8e|>#@{e1&{gMCANTl=>44fl=oZSU{v@9!VzAM79M z-`c;ef4G07fBQh+K>xtNz~I2pz}A6n1H%I&1KS7t2KxsG1_uX+2Dc7w8yp@S8Qeb9 zH`G5gFf=$cG_-YS+tBdP$k6t!eOvpt4s0FVI<$4`)@@sdw~lPxzO8Rt|F(f`gWHC- zZQZtQ+wiuLZQF<YhWm#Hh6jg-hPMuH8y+4W8Qwn9H_|^cFfuqYG_rMM+sN?9$jJ8X zG;urCZ>Q+(e72oOH}v=I-+$n~`$q2=zqh}C+y4F2caPt*Uy(ig$B*1Od5t<NoVXdD z>v2|neg0v-ofw^-uKz&!Zzca;(wzK9@4&}yZvF=w=HI@5|4{|pj7?>~Q29@(JtX~| z;QCG`;J1>#jdX%^l5~o6Kj}0{f4B3U@_jogo9{cg|4z~aq`LMF0GsLYMqM<Rj8LBH z*57COEtK_Ll)<#IzZd+o@8SMI|LiIM>|NY{FX`r)?P<UnUx~N<2zhv(hL7=FeSVsx z?{A(N=xZ2)=JS1lJZg{rHZx|b`rZ8Vkk!}UPlN=KYGYGVguJQTZt|#H{oUsCzbDN< z-~!zI2jtN=yUC}r_4ly<=KC_=Odg-vKY8bVLgwxg%CT=w_;2W2GQspteg42zQSGU} z1#vb-wNG))&p`FQz>oIhlzJ~|;`LGOE6PD^;RAmcm0FGZi2&A~;Z`3$%QgQFKKv3t jI`!dwO0TC5&f<9B@5#l>$GA4><Mycbd43n-YjXb|l+P}t literal 280793 zcmeFa3%ni2QRm;?Gv{^ZT<OTjiEN3#=bXQQYmhezQDl9*2H%ktTZ-k_V3RnD0ZTDp z?v))$mKDQamaY>!7zhy91U5?m^K=L?>m`8=kli)A34~o>%_9&XfC(=zk6=Oo2ZHtg z{;GTCocoaVG;tt$oSEtAM|E{|RdscBjoWkQ?cO=(zsEoS7JtkiyCodcuRrE)$&T4A z3GNn0nx5S)Ils!$*46GTg)HutmL<9RU7cWMj~??!t@3;LJzD4CrelRvb^F+nR3%Lv zO)dH(g6p2}!mi)r_qZv3_qq<huX5A;-U{q{{8!rVSGkP)uXb&IZ*wmDhwP~=xGb9r z-iN&1o^qMX+QGZ2_EesS&~tg#?vTZYkUJOhENi<W4=wMr-1)W-KD4uT=5n9sZQmxl zYvnl^^PXyJwL-`K_`w?A4((pgJ8D;jISu8snS~aGNDca*yLOLCJ#RdJI?iWPYAS2~ z^xEeEBu)A0yzN4k(JnP+bfDGhb-1UeIe@G!R0B`I;~njgCF}K+lVtw#tG-h(K5@-F z&pgsy*Y6hv*@0u#s*Ieu@Y1qBK3-_t=iQErUF>wSj>>oV*J;sOc0P@PDeqU)VHa8| z{k+vJK++#@(`vV9nm-+WeNZd3&TqW7x#17*NHl24s+<gsKn5q>E_eLz#2eBDf+drx ze^l7jOa3XN{*g#^dB^Yf-<W-4)&gk@VPS#cfsU#NANbi&bbh$~Chxz7GIQ>2-p^BD zpZgZ?Z+G`+{tkCv=3lMH{qA*{Kj41X`-ASanZMKBoB2a}ahF@j{9*Ua-oM5j5B_fV zbnsv6KHq<x`={V5_le-QyMGM+O7{=J?{FUv{w3~0f0cVG_^aLTc)!!V(C>18AN)(* z-vxh-`zpWN{cZ5q>fOtDcO5C$yN?C`Meet~|6;Xs14%c!zX|?J+((0dxzb;u^qWY3 zrTgpP|DAg>_^%MG8{J=puxF3^NC<oPxW5eHReRj!;nqFw&qMgiJ?;%YeAOQJZ^KtB z^|n3k&qDZ`J?^)Bm{aP!Qupm~|2Kr&E%gqizFMjK_qZoQIIzck(1(Lcy;G@&_P9R{ z;Vw%(tkl;i_3l0HH+}e8YwhclS}AqArCw>NJCyp8J?>9JxN494;}EXi<NhdwoqOCL zhOldo`)~*^-Q)fsglqP=$3xh?$Nhc?*Y0t@7sAW-xZe%ox;^egAzZ)5{Z0s9w8#B+ z2wx1qA>05cA>2q)A$-Xm_ZuO+e2@D;2(Q@Vem#Vn_PAdQ;gx&buZHmN_PAdO;VbsI z$3ob+$Ne9$w%7eKSljD9;KQr-x?c+6*1hf*LEB#UzeD({z3zX7@YVMAw!QBCAa1Yw z`4Hyzx}OVSey@992>bTB_ky~;?tg}G$6oh8LU{FF_myG)UUySCu-Dxh4(@f|;KQ9t zJfy_Clz7+@U$fW!nh$sHb-xPgl;P`?p;CtJy1P<$J1px<EbCR4_3FLuXF=Rv_b7<l z>;5~4+w1-th}-M_D~Q|c-UH(Hx}OGdd)-fgIMsE%>i?p>?%kkmulp~cZLj-D(6-n8 z1ZX3-4=>;Ay1j*#ca<-`A^WV+mmbgFlf5DPN&nXH|9yLQZ}@0-&yQvA$j<-M?ANnj z%AWE+o&A-+H~dKU3*kk75q`t}On7JbPvP^|?|syt{|^6_@FU^7!ha0^K74z4yZ;a2 zJHvN`NBx__o5DARZw%iS-Wa|id~5iY@Xg^3;r?(Rc^(K~A0G0r5C4=s4I{t#{1?7r z(+~Ugo6i44_K(?%UUc)9zT)F>_rK3x7hdt&@ORnYW*^Ib$ba4W>%Vp({7v@P*^}9E zdwSacRrZnWFS8r}$)CUe6aF9lU(k~;{`?zWbo2SI`14HF{8{#YvnOITf0F%i_D4-M zf0%tZ`-7&M$Ftwhes5gO?^-oq^rD+Lo&TXs0RK+*TiI`CznOjM2eaSEK9Jq`!q=R? z{_y!<`VaosVuQbuJ(k_5w14pbCzk!J(Wdj&rC-f{Is3)zf7eBR$ba1buUO{&+0Vx^ zANM~O%cLT|ki9SaZ`ps%-kbf8?0;rIn?0KS_w3!-i_Sm)r(k&Bke$D2{rY!iKc4+$ z_FuAhW&b&QB>PX<Ph?N{w`D)zzu$kKf6zaio&Un`@PFzbYEpjGQvSsMaFg<OOZiLx zL)l0C4`x4*J(zuO_C48mXWy5-HT(YTyR!e7{fF#3v+u~>oV_J`Q}*w(Z_D18eQWmZ z{=@!T0QQ@+Z^~Y@>HKf^U!Of-iLcMz6@EPY=kQ2))sKZ=@bC8zhj)Y@4V&H`K5O(o z|33f2;lc3z;fKQL`@#=|A0+X6!}o+2es`Gq`fnRNmHlGhcaDYG(!FHbm9FZ}k1{U# z{7i5oU)_CR<mQGg-uucQAcwEA1238OWmaaEgY4D2?(^L5B9-@ZLsw?iyDjPJT;-1Y zYq^rWI|?d)c$8P!q3Rd!^K(~SSO&f6kNj2nZ1scpdHtud>S&q2=D=2@X;zTMZw>v@ zmtkw@_Cui(>xONBGAJmlhUx|;vid@Ks<m^YAYgOg&#J-rsd7W#_eC~ahGD17>F;D# zPu3xA&xC=B7G<Y$Kva}%5KuS1VHB!xsQUHS`?*n0BXpz81uv+W_SM_y5&vV4Lerym zHK^8>ZE7yFtJcq@{4bfNZ@z4A4eQjK!6*oS>h&PvV4Zb+?I>sj?8Vyjf?kxZnV>FY z2deDqX;;1DK3@vnvIWwQg3BCq!Ez4j4n)k^+tpNAwypy+skmo&9li5aIPenMZ&mLx z_%%M<l^Io5kI*gt)2-6YjjWY%-OcDvX9B{ICW5dV+G{21P>m$V8kLd%E7v#)t!R=) zhY`j|TY!E7+TzVK&=%-kOj{9)k+xdGNTRLSKuzc(+DVEuGHWfOoz}S_Gj-D7I0G`H za}#9Nnj|y2naGTetw?618<|1HqQ9EVL@dilXgu8^_?qf8&d)@51@*+ibK(e)ZR7}y z>#@WGm|0Nyp%D}rd4phqdZ9UyyJOG`<|o7fTVP1I^aWqMh*zvGs*A{xZFiS4g=p~j z@s4;AY>p-YZ{g`H=BmNrs(WBWL!k`S!s8cNN`7Dz4vq3MuND?oTS_=E$`4hm4;vI^ zesCV3{UMt7)%kOW;f@EZ4e$%0h_*LSSK<ppA7=G8F#@<B{Wvu0Shrvf@QaRhD^3N< zLtN{ui<PS`pdx>Gp5KeET7M|=BiI%^%ZuUUHXW{-7VMvScu36vMJ{+yl^>WJbs$70 z)yNwI6OLdxWljSEG@(ogRD0Cd9T`6RRG?JG7JR~vR3u@yTU765w(?(W&Cicqb*yyj z8JMEj;yw3t(5=@D1xh#gX;16EdeZ~SKl0*fYo;`W#lXQ$eQ|H@vtt0hkYA_4De1(Z zbz$kCAy<aEVHPa)PKllzMACrWm2MaWb`YOR_grX{`FV+RmpKg%63MUv+fT9!ir57@ zqHs9EuvU*Ey=aQjo}C-Du9<eR4&W8JnGB%+dA#dJa-%nW;l$n!5|3uuq}hUq65{Ob z2BQZ_l5%S(W7@{8VPm|T*&1fz-KMQ!Q@q=}HEfP|TegNR@owAJur1zQzBOD<&t~VX zXS4HAZtGh0h}Zdb(|!^3&_TpN4hG6xJr~llD&IAMHa*Xe@@poNmSECw>MwI3Q`ilc zIcQFI*<}urUEE3yO-36h9*<Ij3aDN2QP!)NF&JB9n=2VN4IZeU8)cAKd}RDIO!iXq z-hj!fEWOUE&}8g186k3dR#(uo^omO6A%+ns5$MPLf$HAZ-q+nXGQrIRF7x?Hlp&%~ zX^}x*S!oK`#LxwbKx2xpL)C9GUZ7?yqoxiS*T#$H9#0TWHE4>hZSK}JcN^-e1pR?( z-N6x~6RJ}6`iHmQyRfh@I67=mody>S`?7Uuwk}=<@zRYK3RGpJfKqi_1bG|ITW)ZX zEA}w=s_vizH+$FL8M*uF@p$6~5<Am#gC2vxE4YDJoAd}S)C+KZ)ClpMxxtj)`09;+ zpDKCe?_D)L!0hv_S?C<gj{d)nK9BN^E&%Pt*<jSurTfY_qD-~2_t2cpTB&+5$98{Y zG<9h<P>~n-&#vyx#lBT+RFu8#ts|q}4X{2jmU8N$xf#dwr*MxV(0B!F6@Y&5_ue!n zS{=q#hsNysV%Oo}(Nsxo_k0PEgv#w+1kk9Zo+6YGXLNIZ)P|=5<)~X-VWLFp8VsDI z>WTw28fF2uTeXo0^Q!{J7FwvnE}&HHVcv+QY|U{y3YR!vbq^ti+<}q@chK0G$lP1@ zY@9u_?9dI_7e3)FzX~6W1&eB-G)=4vcRYUl3I<t-D5s8qi^>lHBS#c$ge;4n$4te5 zkddK6E=rWTk&P@cLZ0-%aNO2qFluejkBssgRHG2x8Y4QV@;GC~TZO-eN3F75<_VdJ zq0{ffgEdy?FxEND(N2&tts|;d?Z>+Fhvs1ZQx^ien&!P)SOh5W#r|Z)KW4sl47!4@ zz0nmFq0Uqv2vLye4h(8O@FurafXG-Qk<V!)XtwIk4Zd6h$12DMkE~rSf+#Uxg}X-N zk|NkLFg1h1UE-Xm%~vr@zWT&PgI=sP)zvE0Ae3hUpz?P?h+#binYG9`6#@WMfQ*?1 zzBN%Ld%_{s5D{EN6s6bl!sKq<h$dJUf(H7*mkS=Ly#iFrj?mAwl(8J*TB9)dQB|z> z;<H*g)fEW`${6zit<b}o!)7@&(x4}Ro2;nbJvE>PYq1y_ZrsqY2MCcB0H;-IQV}?f zkkkr861!-+2MzV%Tb7Qf)Kq7NNx#f&wFp|_F7tp7%~Z$k6jDG5)GN7=54!3@2^|-I zi<$Qr#i_9y2ZsUHfW>L)bEy>SC5U!Z;O3aY1%tj?g5S`>l8_0lG48N%g~{0fF}N%Y z0f;Hj`xXN@66@<;vtAnHanh?#NR`~Rew2w2>T#tAjSYI@Djn{SUNrz7089~SSMH@6 zD`>wBotuVZ#ptEsFH)uP*PM*%@#<pGcl8+D?IWSmxhd-@q>3yynI5WFUz0dTah>&l zFjwtAKn@8}yA)TgZ&g#UMo3M3-MAaHr=H)97HX3N7^EGFN@47m(*9?<;`;)V4Zu~A zP}ZKnybzf%Zv%qfOfIG}liV_Qt^rpn+ESmWxi$D4I^Qlkrg1=hLkf}~Hpgs#DZnFL zP#&jj+<Y82a=<dc6k}KlJ3I?tASv<)F4Fa>Vc60rBer%zHf=_XL6pAI-nD!Xn~4c0 ziW5_)u_53&4G4lZVkZ+~1s$+uW17+sAyN0T&Ec@?&DZ*jtE5ks!5FD7Ch=sC5F@?B zIi?fp8<I|(P9k-|AD{^;VWPtfpJ(Ql>Np}o?6>M1I*8l{A><Gn&5N&<`s^-o{irEx zKA_V`&c}HjYM~ZH1+hbFKd5=JfkOv}XoO%5^h+5US?b|^8Zvth0)@A8^TN<IBWe5K zy13Vmsj*hx4@wgFjKNVG0{Lo*=%^oJS(1S$vZpEoL@BNGP@Ib{I5nw@akQko3l&yK z&`*2#n5Z+KXL;v}x8=UOlnvCx7-mZZKSTnKebqTIYMV9+!huSZFFwb+E)6in+ff@8 z$B<ejX6wO+ru>0Q8YM7JlufmmI%M^keq?uADaAIV@x?o-fbmW`VZ7S_1c+@qlN4d2 zXJb$%b=;^uKbq2P1DHt$MGeT=#GHCO^;Td`nrp2wb81EA)PXtG!luScPqT8EE$-hU z-1H)V!U-ICDQ*zAi_50|olD$Ii7m_md%K)UoU=psOg@Nf87FXMN8`#k!(Nwg&aZ=3 zOUD}s^QIy6EcNH6(iWs9NqLpTRxmlEAM)<7H7lgNHS9!}jES>#1(Z=ahJ9?VV_7h+ zfIG1SR~)lxI`mMb7O;jg(K=>7QQDl0Am~tq3GoqA#FTbboFNFI6fIHa4^#_W@0OKL zi#TShR=<cdrUPRjl~NqV>XQ(&8AfO4i>|AF)WrA)1CT^@yoEw&c*w&naA~&aqHd!D zRV_>)Nu0t4rJS~ev@ZP0U79(-hQGqSpr@xbO|BK+uCSoo!rBSw+UPhCXTA%eqj}UR z2Ahp903!U)<_cGt8h}Gmz?2HHT<SE=3m}##6P&fIbY`07b!J$uT89BO98xxF9Kv3} zs>T`YAR7u&016Y2IH@MR6fJ8H%SBZpmJZAQqV9o<B_+tWVhM&s_Gw{6YBe&F#S|$1 zL{FO14w@7MMi_%K-sIdsC>urs4oGARaMp!QZatV(D%w&_I>nb#d|b(}u4HJHSf{9B zLnLWih^er$36pB{8R~A6i`VRGBGi?C1VErTn(W{6Tf(Fb3aB$x*_e{$F|7$UaF<jg zEs$%iNn%lQ7V;~zh99AFYUELtf+XjdA4vrs^dP8$5;l>kaNIJqrTGr^FzKSEB)V?q zdn>|4ca3^hRF<AD@(i<rzsDa5RAtmHLSOz@o!<bvUsX6Cvb@#qbbC{M8C2XRw+>=P zW829f2_)ghjQyp%ID?)q&SqGYA3gGrCai37!*-?tZeKS&Ek=!P6ZyH>r72^2prH<h zbW!!_DiVif{?cjMKI_IMg;L`$Jgvri{i(BVTp~I({`o%j99tfmpNQredfx5#&bo0l zv%2vYomS(WKJ0z*pq%!YOB|=3ZwaaA#>-FE^L8KEe3p$%2T6^;__P{t_1kCNcxT-B z#aZfk_f*C_@3Uq;%buHI!HqiG-3`;MIuaH-QB0i@6d4QXvxPz?Im3TATKdn0PjtWO zO6S~Hd>MSB`(uch?c$d9=U5S8J0;o(aU=Asn31%x2DZ=3+^F}K9l*w)$FF=9@bw;9 z5x!HxowV|^#hp}zM7yWMuXeL~prkgHwcdt(V%t45C@z%V#UkYcl5tVJiINUN69;Fh zY4&b-HdX+o$&L`_lUdJ%6{;jF_x5<1hlDeg2R_DP3E{`S5gT1)E6KYKB1)Q0hP-QO z70F5hps3|SAT;rTa74$b*Zx}0N`3V#$I?<$au->pB_>-~yuoHfN4SwuC{Ol)CxWfL zlztVjJvUg(={r}TO5LE^!IW*Jc<rBPg&1a4#!OfYI_po7)_6-L(@2tv2xDO;nvs&a zcrRsMnx*)77FAa0hFZ}zH40I)rL4?6fC84Z#8C%RMX3}7Q)TQF(2_DT3bxJ++OQH1 zc-t%xL&{{eP1Y5VnMQkcRkW1Kr!{9<<i!Ris#Lq<&Z#@L95V47!8UR1ir3|`G>JZD z!YzX84z`T?`()mryZf+w91_UGZlELBx1>!;4WQH7Q8VX+(#&MiiA|eI2-AC5R<fw{ zgweEM)9^rHQm3$9l<h{H${Ka51%)nK-kCbpE_<fq_F}79q&ti)GFo7E!S+PSq)Fvu zj>b@uh4v0jchC*N>V(}%bQAlxLg%8nYNB%@@yV{)3cCT;CeJB%O-!ND6x%G;rM|P_ zYt!T;UF$CCnpO?!o5m?0X|R~k)Td|m>l}orI|c&V?IOF|ubfwNkuy*uD?b!*ER}G! z)gUxQTrE{6N3B|+ga$hETHjpaN-g(T9_^l9Rbk~a8n&@4{U+yrd>egOQO|f8>oi29 zNX%<i^;d}wsAhVlYLHn^Z-4VMREBmtS=qFhe^OhYmCi1M5?1ogXMk@>XMxW;+h5vQ zRYPZwU3nUvwPgXFm74slbaok(|Hhxf$iijg$O4~r7W3F*0#P+rx~Gp{b@I+OmDLLp zspZc~XO}_w0)Gl4I|-k47W2^J&Z?R#-SJ~rpGIeG*~7?c8St!hb{Uk+{*%vHwxQ$5 z0-trZx3sgW1~PV=-}DS~BF@>SGFxWRSuH!BmCmjN<;mylBz)G{?h2jNoLzXqX>`_> zb#zwCoM)x8%b;Wh^sZ+ZjL4wafr}#xeAZcf3>TBJs?o@nC+}=inJpvftd>>JN@rJs z@+VHcv%qJaWixD9XMaK?d(mlh)|RbwR;xF4cA1oIOg6GNE|syiIyI9`g2l`>as4R0 zKx;U4Ea{Rfiq;9Ujh1QW3W&IrG$2^4{bYpVlow;q3<a*IE1?2yg8qY!>rC-Cy+Y%0 zg(wgtAT8HNI8MQc)vU|tLWMT3bs2gb>#|awd9FAlXR+wKMUzt7^Q+=gMXsS<OCOTt zCE=pgTu&KKqv)($dNw5hnGAl&;)sjhu+TuuNh=gHG;4u`9HRqQ6`vD5)L38)NI==c zB`vPI%rVD|`6!6dWdGqV+sKXMiYm~SwTm`zXIqUt;ZdB$dtIE=b~zcxBwZ|teV(OB zo0lianQKYG$K3L4kFSvS<O*pEsC!H6d*cde53Z2*$O>tXu8{WF3Tcn8koM#XX$#2l zW$>+#_TUO>kF1dP=n83%t&sNk3TaQSkhYMm0N)B}53Z2*$O>tXu8{WF3Tcn8koF{L zi|NcL@Qo}BL}PD`*YF@$5$Gf7`EBX?u9W`X^!%Q5eSb>-V0wNmJ^xX9{*azOme0xU z!1g0>o8=FVgkH<Txa0mrD)gj0W@)@z=D?J>O8)hlH_ZIn-9;6`4d@M?AG8u+4w>vD z1~xTVw^XBCLmt;PIm%dCU6PFBlFIoPv|Z=K5YaS&M5tRp>S(TeHnwntFJzq=Tp3rY z^5menUfZ_PqHb8f<KE}U*KQL$r%qsWr3HLEu<=+6bh%n+nSr3LUyOwk*1Q&=$s5ZR zpYU>3fe|gVYzHyu{=Sw@M8F-j!1H((#wDVFWWRnsZh1sF*|-VXoQ+i!Fha1ql^UA8 z%8$WADQFcx#YWE=RQ$2LsrV^+kyg-8P#G1|b;Ew0{Go~D$LrkH`|(-&Jn-_abbV0Q zf-`^e7*;JaVfVPY>r*2*xf+YEo7vGczImK^OOv>6oVcM$#EHKyj)z5pJ$fP==rxF9 z`@hrkz2s8X-sozRM;C%Ay{vGkEb{7Vi@K>y#z4;nKY<n=e`s?Oad-e}d2AV#pQ9cc z5(Ex?VSucXe$0Z~fsz>_wkSm%6og>2!)E942QWmq=;9VO(!5D$92ODMxTMYNiXB&% zE_NiDK%obo*5ZCM!sfKrx?sDd*kB+We(p3MP~{p7ZBsYiVOc3<`^*Kh?S|&^jG)p6 z7JDP*4GUhAIArgb1U6W))W{JHtRVYK*{7J20EmA$6HZ&LElgdSHu}F4m!SE>2k@k1 zE4A#9uk0SE9pUFeQwQVC5MKqd<1aaGkgZ|)F!-vx9YY+91!p4UJa$rsNpAVpyb6u# z_Gy}3US6rGR@srguEb?Ob(Aga=%S7HfPA*6qDvZXeL8sqQ@~@__MPb|o*THUX&V=G zawP{ABgVpzk7m3Z6p+-nvqco}wn1Mf=v9{ioHD!sm$J$aty^~KvEXDpJ7rJkq33v= zjk@!=!j<`<0}=d)Q4dCO@DvIUPy!;JKg6@F**c@Zp1a`^xJwoWE!zN(9ht&HG{&Y} z4z+8<$uEqDQkEx>)>6x$tS2xxP?7DFgADN1FI#dO!l*dUDB)Zs!x^hLUac#vBf}gJ zIgVf*dl@xrsE1RqG(!U2(=bdiB3xxgKa@a@R#HJl4&c|A<!V}7eX<=ecEvS}J%|$! zSfJ7KGzLu7i8h2i{)(15;8hsvP9hU%J4T9Q5WwJKtjP>Hfi;MNZfWZPtf{%!n?&Ui zYe>Q6_!3xnK(bdJy92sl-T^-#=67NcOmql~7m-I8<H%tumX6z`xC9Jkt@3y4bnKU6 zCZyvBE<>lWy0%pu-4i<2KwiY_h9YyW_+#(eCVrgEp|ByVb0o)o!N|Y}46qq3sgur= zcrcsuq%De~3!$AU(1hh3tVWKNpnL`6buQ*G_65*1Ug`_bG!DCro&a#w#uLEYWz}QZ zJEQ%YF%YaK>)_>!%(t%zoGy?C<EkmlpV1!=Fem--vWMm{q1xDF$se!vuow$_c?`1r zGf-&c3Ks@1me)?U{kVIb9F^Vn&g<`!rbCK<o%Z!AAAR%Y&zT?KR@)JJCO^PI>^lRm zO&_+uzL*`N>Zy;5sN~*JWpg^zz%IN45doEjtk<pw8}15LF^9|*bD*84LZ#yAL6%|F zQ?K<ECsN?!#j6q5h@%C@w<Y-qjbx&J#`4iz9^g9lg;SE!S;~-+h8DuEkzX(MNW75g zuQ6K)gPrzH*^ZkP1RaL*q|2*@r2$^P4~Ima+D#F)kBr0^lth_!XRbnaXFfs@f_Yy@ zS6?d!dzr8Lw{sp!tB~q9-u{8N+ZLGEV|>H0tV7t@p)tty1A0%VxO~9LbtRUN?>6T= z_L=W2HhJv=F=J|2?9O1ZJA;MnvN6Ct*as5llQIW#bcqhvPPk&~MRvfQl~aMVYGt;g z1=uE`@{nI--hv!kOUZmRp-r7Y!&yg`s*e)u;yTkws8c!nq|j<O8W^6LFgxw4Qkt$U z&ro$j%oa?oFYU6<G8+3~;?XrR9oQRNtHwM?Ov<#m!>Lx$Ty(SnrT8z)A&6sgkNlaF zL~cP~rM9^Dy<>ztd-&+!ac^~5soBOQ7hl>-Gt~Nvvvu+%7f72y3#SogxNs0gOMBSs z^-Rd(yMr7=opcF~3<D+ru=QgMk~T{(vqpg;vF=c{?k=YJD6B`6Fs2e2+-GHb7&4VK zN`mQL;?|ESHZIXaM)S72Yt%xz7@xobAhMwP-g?Q20jjAcmJX7bRF~`&N0$z{-jL`y z!KXue!l08z4=rN3pka`T&Y@<(#JJg<J!UF{R8SH;&1(0VhUp>s%6vT{U>#M7F_kSA zY__#qxtA%0PSL_SbX30Lqzvi=F8kRsm;LNyF8kRcm;HdSsvJ0^mr)|)oMr=(BoE4H z^;Ggg6K!TDdBSz#;qnzoF8f*IvJU_!bJ<7LUOp*T^g{bPZ(D~VJkD!e;%*ejMZU`+ zk?|)XO`M(38biH<oj$1IGIyiVoXlo&s)L;HKb1c!3`;J-;@6zRbaV8ZOm91HaDlZk zv{R9!X~9C*=_4jMyjK}-8q--&Ylb>$ZKu2k1Wsxg4h=3ntV&QwyH@=zQKi^U+(ER0 zsS*K$bF`g6$kPfz^%W0iuo}8Rp}{J3QKqu-eK~QzdE$O{ew+u}*Z2XW*Z2Wz*Z2W5 z*Z2YZ*7yO#*7yO7*7yNa*7yM%*7yPA)%XFc)%XFKG=6yF<imrL4_Kzg*&dyIz!o)r z^Z4Wg)~E5C1<p=1ID6yd!-JC#SeVAy9-Vx^rZj%@_~Zjtr16`D+#Vt)_y>_GV-&@K z2?yhsVk~|v|3m^vK$&D<u?%WdWVw_qIklKz$e}BErx+P4J~Qz`&{61#arXBkjOS1Y zq%#FAq9H}d2y)|q7<Y$t*MSBprddYVAC7g<M5wJVv?lQ)$r`1j$yg~qtnTa$Ex@H0 zdDbVLaB;1&VtpWM482-rTc1wB&}$;Jj5tFA2}mT6E?Z*aj`(zWyzGpLH^ryx<I}D2 z>1Lij=APNgc3Uj5Unmn+0xhjzV`B`cO-#WSW4EHm@YGn?_QwXPOslwCloO;<NGWxp z{S$?hZJ(5sm<{I9WMhR>*KKP;v5aI}WBjpw84WB`2PVNc+Zy_kSWRPF<5|>1!?1B$ zFxy&e0S%$je4nUa6iNvjb(wbpd`6>Ke6+Ex`LPM?K7U3gum#_k!0z(^L_2Ufq6S#w z+}?dg)gEeUy}POOwz0u#Uz2$AIPsR0SiRpxo7$FmDP>Xn%~K&|ktj-%#sTux6Uv+} z8)G8mtEWxzvMnY;zDk^pm)$WDN>k#E@d*;r6GT-#brNFU7fT>=C#hkX!5F%vwuazt z8xx#Ce<(IcWuj8%Qca~wsfn56JkU^_0m{Y%s<S-@h?zJzr$o#juZbA~Ziwyye@0Yy z-<X&m7!&i|<9d&rQMGqB#C)Wo+kIoY-QOhMGETg;CgxvE#JnvM^Tv1?h^E&$I~-P( zcGv|ez~O~^JuBREx4hnUQtkD}PW1q!7h}j#%`pxkZDk8a14CogA;`E2gij`YD%Zk9 zY*T&@bwGsrT%_o<IS?sTzdjJz8Xt&+>#<Y%96SyAX77{D#q?a)9N=dza%Q5dpTQ{G z-sKE<P)r@L#w>kk?&5e@!Ez0F&3X<!p~9wO1ONLv$D@<86#*a;zbcvSRy@}E5UX;T z!8E(AsqCJIPzpHUQ53V}gh#1;F`o1^!xQG-4Y5`+LwWJ8zBGgPDL2egm(2*3M>P+_ zEE0+qNtgYWbCV2kFbfKL2k*lCV2!jJ?xOcD3OphXC<ge-Qk-&tAQj0@EywMJw6`WZ z1Fzz_MP!W5qskyDLV*foTq7!%B%=&tLQ8b)WX&guX}mD!VhUPZmYby@o#Xz!RiS?@ zPZ1fWWX6eqt<6i^#!3;ps$=P_{%DoX|F4#vtNSIan5K+&%T*QzKzQy00hqEuqEO|_ zDZ@cLx{9G&aTe+}bWN55L%|5!FD4l9AQa+Tdkx<E>iY})Mog>SLoD68hY#XZ%^}R! z>R>;sla^}9X00WihgVBxQtuA4C5a{ja+%vX(6)<Qm?Y+h(otz-X2g`537eveF1VBF z67!1#chQ72V^%$7+9*HWo@_`oF*oYh8gVE&XCvEDQ5I#N<HgZ-lr^@aCTCXmr8&#? z!h+mvM?g2xD91RfL$~V%CUdpVdJrcnjj?Ray=45P8OUgpU{vTBwoMdErlS>>`L@<h zDzYC{PNT@&af54^V<3nB*I?ktpc{sI7;Hf3---y20XLwaKt)-gjP^R%WgwIdqoY`E z$pE%t)K$=hR$P3t&Llr{VX#0WCGBR1p<kAgoWy0X3}1BZB=zPnn?%b5%>b#2(MW7U zg-`?autAfeMZMHCuE6>OHo(2ch^@6~k^_Kl^)z-!hUUP*%N&+*jT(&A_DX3-yu*vA z*~WWuD7SZxY|kDrUXz*Mv-};QG~o%tACXJ!%I3nF8>Y=bgyU|S28@?4*N9CF%2lwe z(Q0MM%QZ1pMm<By)#c!o_F{EB`>pxBYJ1Pleq(?XxJM5htj}@JP=8IHU{1ZrOM(u` zFqNoO0Zt$SQK{t}Qz_NWjf$E|GZ17J&S`F@SFmt4ISGa$DlMSWX^IG)E4D4a@rGDe zq|)g`r3uDoCe#9^p+yZeRuf~;?B^%V{t;$kPMDsEF~t$7$3uusJc%k6SOsESOuVV) z7#t*qE0~>L2OUn(EKFw?k?f#L{<jm;v2`;{CsP%&&ssP_YS<DtP_~JqAowFIiF+qo zG)N}pHruLL5~Hg@>eTxn>|+5eyC${)*zB5w#^t|*!L-TELKlIOc1>{gmvk9H=V~)V zuF*4ddOT`Eol*WE(a5YV6SVvip|`ngiFe4Dtm&e|8Zlr<ZWF-{0f0M<hhQMY36W+( zk_vH9bdH3H>gqAjW~9a-4(S%AF$gluwA8GaY}~pr%-Gw_NK*JpjhS|h8EtsMN@Vqu zZnQjxLmSLAx!ENjW2Vz!#@b{fNBoq%LOL8VL!B#OhP~j;6X%Q>7_qu!PoSTJA+Cp0 zajDr}wAu8!s3F9Df3k#ph4`nV{4yki>*Gz%4d(<t2a^l$#8oxuq^xxQ_~}k)AL~j@ zc-*0J#O=v}=^bcZH-ka+i<{!*M&T2SJAG!8U0wi;_1a-eG;e;Fru<0Tv5B^JEcOX; zz<8UEB#nruKpG5kri(26%&}1}J1O<zP_P49h<OO}!JZq6*-j{Tc3yW#MP0VR57EHc zOyCVm3YfhHP}@^sp7PoL^{|6ul`Ie3mv{_zqE=D1@n~S4so4!o40f%Sm4v<E8DT|Z zhA>wEDEr+_*S#I9GP^2jS%SCjJ(#Bop`#mnZ+t;60Cmo~gOM+d%t{=GY)6wvtjjtJ zovP0>@lrDHs6BQao4`i8I|&zdf4YXfSMx98G0x4k+OkM+nbkSzp%OcF&eMVm+zT#( zVCW(l*}z5ArH!bPnHB>4Y#UA81KZ<{PF$SLj*5Fm{iFBjeo%5xM=#FGl1!_Q9vM!R z({g>#>1%#=j;8M!4UQhs{koF-Ub*_{J;Uj86|!zXCB3pwp;Zt9_T<6c+HJc@z96Ow ztU>@^@%5wLk+OIHuxDz&RR7~{h@dQ|^{#)U?B74?PrSQ-xEe~IVq@5dgn^;Wmrn;f z-ML>45}J(eO{sWsq%7{|cYFDI-V~G7ynOwrxBXuE)A6TNEVJJBFL;1SL+w^040=&r zD}eHHc(-LLtfp|I!pIieKl6cN)H@bYb<B{#6Ni3K;J=W07Ru=_WUNEE>I<QRj46)E z3@*0THUB@$%=e}r`c=U@_`lb#mD9XuEfvkiZz)3SSg+<1dCet|AzGi^tPvNNu*;2H z&{^RU^p8=%N2?}4Q^Y6Pf^Blh3jquhZ~_n)vjr=_Dm$?Sn9PnQkExa-xt%~!vjy`= z+@_k!mgYu2!4@)j0P~l{6$*wpnlXv>Lnh854uSA%p`9(~4ylOh(T?E?+`(2gOghDU zNt4d2Z+L2H(($7ssm2PeYfOs<JN2YXeO|;2>e`w<Z;rl~Gw~v3Kt-{`#th=z-w=hK zT0IdM#(K^e3=kaWzFjo;8!&9{_sU#zpPy}`-aR9`17^*AW_iK1<$j<U&zenhpG>Qm z#*n($q~<<9J4dVI+~<B>$$ht6#oX^Rb*F6Zcguo8XtFWr3zzFny+)keoX?67BZ0#q znMcOywO~R<v^ADu6MCWHA$jZoWY1d0#Fw+Ia+~3byoH&9Jb?D2a=t><7Jf!-i1~g@ zK1wrz-8pOULMDg=lUP2IW+*>eIa5_QDO(OKAUr=4SQp0k%OImWCeoIQFPO7dMfHr; zUNK341bmY{F;G8QP=YehI>EmiCfz+!cJCi{C%7xTuV3~jIPk=~`-iK<Vka0lgfnK~ zP|XoYsRuiTflnPNr|#!h47>|ZH~C;P;(i!-cQFI+HVoWqMAu$aR}uz`>VSkS)6@h5 zpE3sCJr?Qxm{BxOcF?jH8F)W3aQL_sj1?F-VTanqH|KcJpu-V-6BRBJyZ8<o73L~? z=BbM-7twyS?;@8r#Tk`wXwA!63d*-dCq9I1vXfiwji-VUCtS_;q)gIls@SHUw)K`p z29g6Tk%81!xMngkP-1U1%i_eikCVlK_J*F(3OL%C`N#IR0hAPC|7ck=Y7ag~t1!#P zLPvg}OS4PeGWWcICuqmq8ntp$Z#w1)YHATJO2Vm8Em6!s0|vksh7?Or78{HEDa_UB z$!&*p*pn7i7Ojw_72RZY;!WRUPU7!!tSV*1L;s>melZL?{0{|_8YOjJ(uhSGzpT2@ zzHl$5n*=f(%BX^~tyK)77lkrP{+d)GrW40ai@I@$qH||4fB8u*=AW1L|FN(MA0TUU zx^79=ZI!!PDupjBL{{2@7I8*}I4-08#eq#FR<%N*p_zL#d@Ks)D4(>(K9@(!hZG1% zDEf9W+>Pa9Y@ds+h~^O{hY*=O(xO^+d)Yq_TnPg15(KhiCG&>{q%p+Si%P9yC>zbO zvgH{?Ya#(VK*=R)(W3FYEDE;Qpj|a0qNAd)20P!RCgnHM*JlUNJ<J6bYbGRWaq`H> zJ@eU!PWklN1X3Y9@@Pd8;vBV-c;~Am<c&^NI!F_U1SgrhXh&=<#Czz|=6bkV`bPwv zDy;{4LZ(wfdIus3fW-prVzVc@lUjexgFuR(_DuCMP8D@4&I<NDtO=WP<Pc~X;Yp(+ zJlU@>?w8R<-7g@)sY{@pS(n7@PSzz07=XHDhy$r;G^f)g`bC$(fMzGcRc0|Jb4a)o zX5zp{bn>XTjA>z~(Ly18oc)PEx<K7zWXka-+Qzhr22t_hqj6l+w0g8125GjShw%<@ z6f}tyoUFoZfLLtU<GNf6W+p(i!)P+W5EXb3<zB`ZELM#%CU4ACV;3u2kl34`DO{`= zeDrvYGo=#%?CVntYws5Cl+Q3Cx3`c1h{XhfSkb6~S>0y4jK+m{h&D!SRHsCYU?c}) zFiV?iDn?IaU?)QvuA0uM5}wKl0lgChk=_h1qI4=)6P(l@J5j?Vnh1c=G?VJLNP{e= zD6P3%{8Hwp*cJ*PS%htv@3X=*xZ*wo;T*L?B#%8adSF(lj^3_;Ky=9yRmLyXM+OB* zja_1XsjoWCVBJ({ag(T4G8Rx!3NbtxVMEo*TLzP&wi8r2Z75{o5xxu1vQryzYlwtl z54a88M4Qw>7DdY}WNwKDeGGq?0L=IYaG**^&9rr?k>Mh~38Ca=p+z+|9}N2xnW{F# zxS8Wpc4sow?u-@KU5chp?RdW9aH@7vG=1(;G=1(Yntp~`yR}_T80Bmyqz|?dq9P%r zkdR`I#DuibF`KW+WA(#^C|X2yFg3<H{_B<;k8Q7wquuBotHpV2Xyg7A+d*YlhZ>+? z9odNY5OQXw(z2sldeLLoL97a^67+|Sh%F37)6vcdSrXdnNcfSsWKN&P^Ew)#;PN!Z znBloeMbgmdIwT@vnSAise3GTNjsYrrrnFPVATqmX5@&WGtvi@vureCZ;EF8F3L0pD zbPnAJR<!#&aigLYbxyR<HN{IkAXDlAbZ2FB0Vpnve>aYQR&`=f(249Sh@4<{>2Apf z1S~DT%o!uT#I-JSt(dQUnUhyGB|4Wm*~cTG3SKQ}joLJMquvHilFUU;F$aZD=z%_s zBPr9VmLNqTW;)U(kdV5hPDtfcU+BEt8a4ZjTxA~U&Y`s#;@mus&Y~F0O;_{*Y@m&) z>;l7$f+xhaG>N>OvtkmVKNuO%%f&4wT&9L=*KeZEs$v7NDWIZ;MytfoXm|D<2D>vf z+MS`%?hK7~XK2iYMjnO6#7B!SL%vKb6nGgUOj~?uu)x3#E*0rq=2r8F!y;%~4K16l zSxu?Hyc{)(ktP*mHux!YyQqB@hdGQ8YsW?ef}(;K!-8^jELnPlB8qD4z?C(a#|9x< z{A4B?)F{nU4Mr0@XvDl1H5(6DDkigY#fQBGU#;Hr=aJ=OEE)^Xok@7IIWbP;0~<1p zQ|+d4;^roC1=%Z8PO`Y$5u8*U)eQ=;-r^_FoV|p3LVu!L)QBjEOidc#*+8E}*J_+k z-1vwP%nPYTlX5D8{wCrYyivNoG-y+!j}>b{KQH(l3$@~XeH2}vVqt>+GYezH1T+tQ z<_|3Y3?gD;g^fypY*IEDGK|p4de?eU^%J2L6cMxX!?Ok;hU7GbmMLh;!Knd|!u^~z z0O-jz1_;O#0XXHznCAimOvxGmg5;bA04XfaSz`dRe+@uVCA8E%1sX`9YR(#f7^2f? z;Pe1U;bYDk0G3Xi8pCuXInBm_tgNOQmt9$N^l64uKu3!2a@Now<QG9>o1;?3PYaq9 zfaR>AX@ak?)b*dsO0{>Ta|_pfS*fdYw-8^j?EMHbhY%u>cu$FTQfQX52G8~ngdBlK zV3yI;4uR#|lhv!r`rf&(5|~pzItk_}jj7J)oQp{=`57rn>e?x@xn~I4(y^c|zwl`> zg8j0N?EGmlVi@=o6eDM=$CwWsD>K=-$K0ERg1Gld7*d+w<8WkW&6FB>qJ8A<J#icQ z#tFba>0+hxa{S(EmUKGMJbPm0n<P)JQ)K4e+r+1ZyStwoBBcq;T)j$S<n2qr`xhZf z{_^Za$=S~0RkjL=vp6mcJX%k#6YT%iYbKv$X)>P4=XQA_C?vN}2?(vkVl>jTMF(q4 zmLw4!ag|``h)|qljWR|>3Ke?ROl=GSAOB0JI0+CD73Xf9Vml>}!*L=}$5qP&LQcZv zBP{1`$ubE`T)><zEYHH~C9Bsif~ETfHfK(WIXw$&7hs7Z=5%2>w<3ntPhsT}=hP{Y z(79c?B=Amg<r2X>r4c>1D;JI7X>q`2<wD6y)<--TeGE4lS1!MI_Tnb-IEAP<O9Pm7 z4+Gd~F!<+$ggF-&hz2mj!0GYzbMa{ycJ~?)w~V8oM7oSc+&Pyp3kz%)EG!(+2_<RC z!cKk~JmOgpGlb-Mj))nMqb1FedO;)Pe3E62f9}bem6tQ8K|{};oH_Aw=3kI}`H59$ z`LQuJWtMKPD6|#_SUGmud}NGWPi^bi7e?d>somk1O{2N%d?;JQL!Ys+i)g7=HS90J zOX?4}P<(MC1OpPk(b0&sU1Y&r`m#c5<CUd_B+uCZCy$B=;0z$0<U3uMYy&94q}`aa zfoW<nOf4i42vZy~L3;`q!x48e#_VGd2|7utvw_ayI8F@b7&^gyCeYc}8xnMqUS|Ux z)~3nv)cKx-JHdSl&?zv<B5JeGEhOk9%FYHlb~8=@o!~wb=sFW~L2Ib9fllFFC+0#+ z8!sKA21=e7be+qcGsD9PW~v-P7U8Zv0i9M=X9Jyl99D)-aD%(khR(h~kVaPPth0em z{)!XO2_RNlE$tC?vE^xxNLLs4h`MQy=p<Zb87<mp1QNs&iDv_`d>B@MSc|XT4nZ2X zjq3ZfZPZKKMkj%M870`a2NL93jhzkTcyBC)+)iJg1g2$j#CEd`rh0)^ug(ZaL=?K> zXP!f1(@6YGB-67fEyto<GX50U*Rmma_QmD`PGT0IVc}_FEIfw=sFNA*l(4u=yg&N_ zR9IX%x{FoUDM7f5as4w0QSkTN6`~8CRpQYbpUZ;Oy`1PKHoDJQK{{SWb|-elPQvz= z(c(Xs5M8{o>`iQxodn{48Nzcv%R_VC(YbfK+h!q)l(soW#pP}$2FB&CyfiCgzIB&! zUeZbsOP44{D$#ACBHa|j9nHqePP@2kaWZ_KHS^Hmvnj!vbe+Y?URS(`r|85;MO#A( zn#8hI(RgRLu>LH$;I~hRB{`I?EAEs_rXOs;e|<mRpMk%4kQRy}6F9I`?dKcv92<~7 zXdd@w2>_4(c69!ylH>z#)!_h1PW;*BaLNp`0NAWvGqep+g5#{sXS(7SrYy!WeyE#c zM1!pQxhLGkd?VU_Hg1@Ya<2~;m)yTQ-79{;Bk7({762(s>1Qx%ZEqd90eI!&N=JOP zpYskePwa@F=m@|p>ImS<TL5TNN4UETug^?=*wztBP#zp9P6d6c`%)cMK_@o@%5PGX zA326|FX;8EK4hbFCidV)cF70l;k4XkI~m+)L#b>LD=VMDL&$+g`PZ8Bu($rvyOBjx zCIZP+)f%kB30y&;ef31&mhS|`sUGiNOuQ}!Mye0STS!1iUju|3e~o~Ww1&2EVO85K zGr-|1KjkrJNYI)|)WB4T*!maMJBh1*xxLex`$WBqvwHu~L&uX74!`A-O*orb{AjwR z>{!{9x^(Ut1xck66z~&hs4afXBZsB7XOX=;`=GQRntOqEqof@hLW0Glavb3o&(%e& zsoFeeQ6gZa-{9>ynjKj;<^vnMNfX@s)_0Cw;deKQTgHjon#7rL;-)4MURu{#Hi>;p ztXqJiDGTitKVaXmphN|;;rt_u5yFevF&&4)xZLRNd)C@kQS3PSar`1X*sMbXImdfs zX4MH6&X&ooo^MvnF*4-q9wHi-@lfJWm2D#btFY%l%$(Rcr#%Q1z(-m}#A4TJK$2Pq zIo5;c2<Ob~_=ttAb;S?2`LYl!mQ$A4F*xKjn&Rxv!#Y#0Q<^1D`NQ{tX5h2eERH$I zbJ1N2z}>o&iu2}S?q#Dsoo`!w9g{b70ufO8ArYnMa$7;(1GkEL#aCBI$}Pwmx8o#o zX;IE`WF5(NyVrA0tTnW+M{*v0--u&KLdqcy%<#l{1wJ^$$8*Z=KB^ye*3VVpcE#wm zvjF7PNu;tzKjwwO_*x!u7$WrTjrwmqjw8o8S)K(bR;#jQ@ai*~fMSO1PWo1-GQE_y z|Abhvd&TE(F}^wd$G$}3yb9@DREwZ*3cN!R>zcjem=o{+$zmv2F3v|0096hut%pk+ z10kMfAzsd8Xjl~(FOCD7U?wP$lM0$-gGWp8{2i_KFuyxxWrR3W6Rj>i9j`JGOIACt z9u{Y1tI-TJ9IPrsI>kEl5k(weC)lB%UzIr@FzOi0o@}|CgOSt3gNTU{2zw&Y+7@9D zngubd${4>y7)A}yWg?6WO5nVbPN3C<F-{^^Lm0Z(_X#q^S^^S{F=x&8aXwTOFRg(G znkln+rUWQ8>d0*PX#&)!h>l&(!(6iUAQ!rc$F(>iIQKAR_+=t!5Q=x?`d-75dD3}? zc|t%i5O$(@Qh*MQ;w?i5yZ~zFQ$cZ_^y-N*M#nhGJ}8vtiSCIDQ`&h}IxC*g%o8|) z;l(BZM_LUN-N|_ZIyz~V1RY-LCUl7JfGOC5qKX*}^7U`gpb;PID~M7wwT%4QE0LdN zT}FNrS!?nWdIAR)mr@I3Mkg7)h#rv!hXR*UOH3kHLoK>rKV+B}Q42WINA9hQLKw3= zQVR^gaO5MkXc9xGhjcd2(Bt`b#!_k_Y~Pq#bS4@kfw*m&gqOH=mCjC;+!MZyPM`pX z;>wr{L9jFcfdYI<K$PjaF<ocUbvNNzVt|4tf*m1~Eb%JAdV_`~ZsOX-W?Kx4B8u0s zI<GJ?gs@x`My9W13vi}DE{gpU^<-0w0eg8-iItSqVz1CR@e!IZF={}g2*Vg^+AG9_ z!o*mPCQM9UiLu#K)JpJ^?N>k;6|u8sQr-Izf1HM8#;Q4mfH7@eN$!jyz%1_f34+kj z)uQ;^G^QGYl?V3ndSGAF4D97;z)l`%;xc{DNgsY<N^v0s@s|jF;_(C@M(i`bu)FjH zC_q5KF(u3VhT`AQobbV?J1AnW);8)1kpb#NCaLt2EgX3SZIAz*&R>XFz@)zW<JBz$ zHAJql4Vq<CW~x*15j($c8W+oQEvjq%D?V9dRO12!<!e=IZ;zj~p?V!1Z&$zcmUsS% zv%qbfA?E`=_T53Pnb!g^N5`wRib`Q?e~Bz0(GD`S$RTGAJnMLiz(*0R*50Aag?Q6i zQ7N!&;3cQjS)Yo$*WOM!dQ%Zn77>8bCCw*&jzv2Vh>N3WVn|l%x0A0da{2V8>K*aP zzk$B{N3>D-?NJ?xT_y5EqJoscA@%tsuAN<yLew4)8$;l5L>-fa<n2SG7R0iyhHjxm zTQwR@{uA`p7Q-RhF6g!*7rWxyyhh1Jij%8V=dcD5%uubJWi3Vu>#WgJE%Sqi0&zRy zK~_E$q4ddOW`&3cR?W=ESzVowRpGSC4|=;w34{i}#H~tiS^2}MSnl)DtIL>Si>n<& z!*SxlUNovD8R8k-qWD=4mkP52Rb-mQAq|7~^6?={q7fZbC9n_u#1kOq+_)ygLP9xS zUXNyGr@b?wAe~npWi-qXX33%;;>|T#swq3Fs+th~gy5wnMuu$wuOwM0Km-blwJWK> z?xpBU5x)frco1z0Tha;g;{8*;pmz+lVy_Srk-5T98C%Ql07u8JT0fks{E)81n2ljJ zn+>yN1_6$y=@!9#u2S<BybWE7@Q$6i!DGgp(O)BnC2Ua5oQ)w$+QGHygkEIEwbKic zgW`MfW`cu0LjjoT9Yga^py)QDAdG`0Dextmf0Zw%i0e)CFd;Q#@-ne{`urgs5&09U zSX03w2k3j03K7-D;sYi$EcUjmII_epy^CnnfF7-6gxpYF=;DeaOQlVKj&>8EW6{_5 zSQ^l;CXQ@hogDRJo6KA(9f~dxKfOmxEHR`mp{xxS?r20s#Ag=Akxh(A%A5`xUnrP# zDo$91n9x7j4_=OSbx(mRrlsaj<VCBW6m>?4j0jRIQ(X+1Mx9BUMk`CBHKYz(^q|Na znz%5+M6g0G=kQ)Yq746TQQ{p84umJnRoOlQ^4X9Nqd!N4ygANKe76cJHVT6w^|hv9 zuBXcSs*H$4RK~Y5Co8jA&|_>32~qb7kg!!}q{nO+Ws6}Wy{=9kf)lW5MF-c$W~lW+ z)Y7E)ETd;?)YK-oakm7gRcz6U#QP^J2IVwW!)XH`jm4n01{6Zmo<x$sK-aekA9suz zns<sevWVto+azq81hyz53GQu1_VuZF$a-?lSPa?fXxV;^1<2yS74txT4_R55c%gZE zpR?7ewJtC*-7f?iO9HrPG!+kIQ<`PQTv(XE-r~S*8^W|Sqd=Yzh+KnTL=h$uvmoak z2{mwOpE89}k&$34_EFhUF$uRZFRVvp5#d%|zG{0=LC2_fqK8E6B#oS%m{WueO%sh} zj`)WuI!N1qOzl}6lMx9=k@Bd+TOCF5kt}^Yk-#&s(~0Jc^%5_j{@y9$Hj8CMK?ubq zM>*5g?u{cNbZd@ilZ>gX5d|G_auh&H4TLw)*f$>rMyl(pzCxsZ*cA#V#-ZY25J8gx zn2c{I0cQ<LuG>V$<ZX@A0dbMTlXbJ$o~&C$sQgQ{OaPO-<%`XW5s+}zAi&gahDSZ+ zLz!>}Xh_W0U~n}TfasU>v8gEbu|knp(zTUBH^ypd&6o@EG7b$9fNFV+J+To@(=2`o z+HCzZ;S(Gf_h?h`u$mArdXV5Kitj22K|}&2x7a3(?q-bI!TqeBW)*XS5Tpv@ALw7k zFvL(mu)7EigsG61F+UM8RP1u00*4UEAz?|pf17}_w*)<x0?DjlJ~z>#t|O+p)G_3c zotbXrkZ<IWsVCMIq!v0L5Y(}1U=4r+-NuD+ltYMIQypOPNF*b_t>JPWqGV*-N%3B` zXdlS21!P`sK;IWDZxAcW?J07nGMO@<Ny)g29-Dxl6eAw1(iRo;DdeY6xt!XB8W3P= z>b&Lx^_dP~W5Nsr-9ZdRv1^#(i`o<ctlS){<mGKax+}FMZOmlg26aka<WZ*pU;>$F zEH}rogbR+xa#J&wGbb2J4dGdjrM1aQAjTeAVJx*{7{_u`9Lt&USR$Idbbq1V*51<W zAWP7hOl)+xUiLC=gfcN^W0YwWxKv4Cr<~A9*@4^{87k&UNL{1^A|4l!08dh5f)&_? zu1h(aA1s?9PW4TnG(YU^mJv%P_*jbf-$dymroB4Fw2^+*%#U#(HGM+8$&C^=o*(Fc zHb1ZosLed$RG|~{6xCh<^XYt?A2GU><_F;^x0pIc;3uq|qM>NW5PcZ5MjtGVC;MXb zVQ*)ob6Q_e!I_`q*{g_$^hF`u`Dl5JKt+-m7HhW{iK@=c7wgA;A*8DHg#bbmeNoKk zx-U|FtuLaFDZ{SlgJr?Ygw6>gE3+X?i2>OVhdyzvnqo8~p%}(EQH;cFoT1|E%PB^) zbScG<R>z$}jh{owo?xj8;A~N&Vr<6=_2YLXjN`hot#u>xWA*}Vt=uG#Zxl1v8vDj3 zs9fB5*{!!b>$f|{Z?$$OnM;l$gsvU~GeNxqgM`&{ga1dbH^f})>Rc>82|h?avXpU^ zGP-I5o6S_FpZGbRcl@~<yxt2`p_HF>s7fN_Nc93t%%7BNVWy}=JFyFpxD7*qJ{Kr` zl7T}dLyrV3){L?tMrsAlW`yAk;^S~{5h>c;VkW*~^ALkR;j_4Tgea7J2F;7KXkK(h z^OJlB4MrLS%$=_sqiEV9onRO-P+YqFl9{cII}w^wK*+2j#MG=JmoQTbdXeX^J_i;T zOd`i_m}SBeFsvs9iSZOi<^o>=Pt>NVfzeulVN>8en}AbgFS7hD!NQD<jkDKxlEbkI zMJkAQI)oMPh|Ztx);4!IJ)|^+E4NU4e1-{olSvoB4v-+E#H_0bqU^QVI6J__*)xGF zPEMztSqK~~Zv53U7>`ZpQ}}jS3}sq#4mHX$P85hf((sw6B#F;t<D8;M6!Yf0l{~XW zV<tBsWKL+>cp<%Qnh<>!mJ@o@p$M}viBSeNF%&ZmmML#X^LI=^?yMk~Qh7t2EE@J? z$d#eVo(%okFS94LMEF8rN<v%Q3WSJhe0``tG8PVM85osHeOjtz8<#+l?W3<x{+T9d zoX%PGF?)iNAiq*S>ySK9Txs7R3pHkpJU3YQH_#(1A-c0BCK!PwXp)MVo0x`2G?SF+ zL9G%Y=EP%tl@eu=#EFqzuSR#*tZMg|RoUAez&VT2Q^=R3HJY|BacdiwE-46aYZrTW znAp<1dZkOd&y*!U+(GRyS#_C-7l6_eQ&g8hykIqrq5m0COWzqUfLKz|<puH5Lh*Uf zQzT`88hj&|G!Cdc?2*O}*Xf%nz*p?UcZe_A%~G)qf*FrNnp|0=Z&E|qiWX$Xm)(1B zd+4Iq1vCaUbHoKy8wTGb{~nT$y935+tInZ=Ol!rSsE}f^f(?LDte78T#YM*wt}hC% zf>;o}&qpc&=)o6CyJNzk%Oq}X>^y$#g)JFore{$TRVW<~3RQU(gV39=TDuN1uO*Vy zx%lq$*nRZDVNWoC6s%1`WQZ3)z<H{g!exspvubLe6`991fZ0T8KNKLe0~|4@F^#N( zP%yjL%1S^oo>!Yau)vi7S1{|9txM>hNs$ew5HC-14Cyc!3`-w}uC&pjh9-#KI@{RL z<V1#v(oFh+S(O41@H{9ZMlUtE?6Yd3CGcM@JQ3+s&;3Y4n9}vcEU56A*jT#a-q?jE z^SKEIXv6_@7L|6QL(8KA(yQB9dR8-<%+c*CD7Iq;oVb&Ke6c-yVi=Stfo5119@gXx zmcEd{MR>ZY9t|Qi$LS#+7I8;Yl`q~BI}CMVWQGn5i}9nOnU*<NZ|C(g@RD$5tcJu| zwI<_n!^Ep~i(k!5yxO?<)f@c$;2@>nDA$Vd=(;$%2yJ*X^%vjOM$?i(ps{D9FCHvj znTecX<^04QFgQH6#14}HW*h&iQ}6bpY*p8}R%rQFhP%Nr7$@m(;&>eQ%>QU8XlweT zPeya09eXjPyw!`lDxGDptO-mFLj?;LEDXp_6|}V)H<<DY<;91=Dvu3e5z*Y52~;LS zhLw~3gZtQEU2a5R*l`<(;)%R9a82IY3M6=Ff%mk+cKSq_WpE_}<39&np@GYv94?uU z7>qN8%i5CaGST-F;cE=n$?=8NDhh_o1|9I;O=qHOMz*T$JbzqVvb<IEH`?DOtZ%lV zHV*-fZ4(w3`b|vN@$ehXXxv*wDuyc|so$gc!A|o&-QkP*9-qWWxA>h&ebopW{gkh= z-yZc<1QdcEv}+eedzRRT?|^b~Oi_qxCO9Il35t*CvpCL*b59vFaNwd7)f&|xhZ?CA z8ygjMd0F9!T1;`Ww@F1Mt!!E|?aJP6RGO981bf>oJu0bcrlG_y14JJ%maO_N0BdD( zjlT<kVuR<9-mq{*528Z8#E`z<nK$3>q`RQM`96RQ`nV<c3N}8vGVYI}7RiRCc;1M# z8c|b}Y*hH=9bSYi+eU*oO2^bE>o&&l$tz;{>@k(%CbLbX8N<#sT3P)$1DdQ%^<(gp zA2kLuP(WX8Gg=08C`QX9C{X+zuDj@42JbII_gJ{cC?78ywlf2{5M=g^0`Bv#(Y}>j zz1hPmbGs>XKEVVAMAybI1sIk*!V~jB+G!8XNySnUA8FM+6f0X6y|~uaAo+f+F+_LT zSAsTTH0ny9Lx}Y<(1g;4gcI9TWm;#EtZzFu4fwi&&edXw2dMJ^8rz~e;Wz^b0kI5J z{Dbg8oa7`)w#bly0z--tU6`#LkkUKt)xC3sH2qvQX!$VFJKyx>>zQow@ALBqP>Q(8 zb{*8CoDX5jEu_&g_K>FE{LQ2OmCg=2>gwV_$9_8Kh-k3T^0o-_Qn7ecomx?5@mqY^ z;5~Be(O5)xF{Xg9&jl1)%WT`hg@E&&2I4cfiS0;Z+g1m@hV2qHTKTH9hQE6L5ZAD4 zy_vCTxnPo}X=cL??kn5^=$`#0EO!T3nlD_kykwlfu>mXuV+j?}nZ{wNgwY~(*tYI` zm8mZs1+;H7ni^$V6h+}WZ`8^yAh83p=()S(xnDo)`;^ozgWf2)8xWLTOb`%gK~+a$ zjrD2GNdDR`lo%kCD8kp$kw`kQ9bq4``Wn&UE)jUCg`_U~<^E;0n#C*5F-iInJ5&sk zW`b-29Z_9A>cOp<n-sJC$#&V(*FLi7oXC)yQJ)PYL%~Q}Oriw{-mr)w(=*>M;cC=V zD`IxkjPZ>hZKskq;yeaC#P^D9{A;jj2?i%wRYiunuZ>-`sUeG)84sDBbLltHev*0% zR-sgJ1#H&FS?XRhKh4BDl|dxnNF6Vy4vacWx++@17&q>!jSwUypibN`j4@;&Oh3Q; zYx-pg28pP50%aWyQPWcpM0psS<}1drIN9JaalR2|UZ#?6e8N3gJdSQyo5qFW=BV5& z;2R{vGaPh|x-1K*C`Jj!`5*!GUJ*}56{*EmYO%$Zq|LK3N60euX{u&>OhT|K4O}@Q z$5O3uEH3mw4T~?qz0mCyg`Xz%>b(QMMpjFX%XBuzrIO5RL1F`<24R{W0tt^_jqFU> z(dwc!0PP!o+6{&a&V*a_b4%1RMlJI{(O0WPVDl8_<8<Gty)r%PbD)|Qwky3g+$xmO z;s?EcKjby?+(7@bT7!{WX@Scvhy$2GfSv`Pb~Gu7)mJWu_6bZW;L&t0n5WPg5iUdd z-f=q>x8=;TuAa%rj>^C*8l>KMc11PR`j%=?b@-_)+O({zD3E?3@&vQ3sQ=giQ8_s0 zq;L67U<|$_Y_!Uv!G?8`FMz3QpqZgFg#)LkC|{;bzQj-dw$L<}qC+h~4A3ZVU_X3% zk=~j+vNgRf4i**@jiwmD&|6jp*fQWDtI;$8UUO+-wA2!eL11#ri<>#by3;~u;wnxm zUvg(Mf;%H)`7HCLmkY_qGu@!24f<gZa$bICLT=7~FOTndixFt(vsr6wTI36GaEI~E z<lW`;l8u?^@!s5rj8H!4`Mjz`JjBGR@%9lzq2a(4Y!%f{p;%=5NkrtrccdF0yZYd8 zwe*d7&5iZLfkB`RiZ^;RJ?M9!tdc6+?*Jx)Yt0f!*3{dJWGY8%aOMzd&nuCv(93E7 z((XD4=$C`KZ>&5J+4hZgmc40B$`S<sJHB1xGH^sPdHNTY=ap-?k4TXQBoAKDO7+4Q zWtB!Jj3dyJs!{J?==Rw_YuT8Bu=-3bM+ufJ&8y;*OyJ@t2xF;@7_`N&Y1x;3ea3;q z1Y#}_g~TRAx7PTQrc&IuX0sP!lv9k>6}D&OSKKqw$BLRFTKG2m!%TO<Af;bzNwo4f zWXT|jtx+}=7FLo}*p5D&4!vs<tmT3P#9s+$`RsLM7HISwC{X7Tk%>CUAZmzn#)!nQ z1(z}$)`O66NV7|Ki(J_j56~x#7{ihkqvnxXY-p5|A19>IKpFPMjQm7PtF7Oofe4DP z$=7^F3~?3NG~;m4!SO{ROJ@h=cyD8r<VqSLlduybq^?scGQ0-mI+)Z~4d@+rNsTC{ z8jE|Y+1Xn(N@N<35-#vIO6ISFqSTC%_9Mrm1Zz9ND532QqRU9j4nJUuu1Bj>ib-ap z1iD)zLvjl=iQ2(*7Dq8_Mv?4bNw4Ye3Zp3ESvrb{-8hPI222ale1dqAjfK1Pu?o(k z$b3Js?>BL4?0huc$SfRt7RfA)AL2B!c}^IOFb#EK|6FoNTZSTJ5?(=8j`KqjB&$v= zNLDQoBt*D1K{5rdKtXin3z`_<e=J3o0yvf;ywSw9T`ZF&1%jf0_6jNE_MJAHS!*>; zQrmP~4FCHtc5-KprU^DFcb7c#-Ph8+IPBcsIkG)_089Bc%oQ*2pIzOXOR06*&AiXY zocon?!8cj=7sYqC@e+;Osa@KL`{2lMX-0Bkq6$Q^G)-uPw;Hib^ap2$BG#+Vviy-x zR=}t`@f!VH`L%$9agyT>e&li5*Syu=%zl+B)+@;=J}#;^Ss)=2*EMFbLk6KtnbM*q zEYOK{nKVIddO*fOu5a*sbCcQ-tdX4sCdgJ^3wq0OA36EVlx-iXFU`g~OI|U#W{z?^ zVud+s-+`+4e{?>q;iOtQiIW;<L=UbS?~I;#5}5kWKuEufFmX$xDzp{ACmb}GV?y#I zZ-Z12ywX9U3;>;do{+wa@)>gkHxzvm^|Z<l%?+L}xlIB}-#JAXr|M1@VbTAfaZP#_ z5!Rp!{w-|cPADqlI9{SJJ1Qn#Cr|MT8{Y(fnYg{TjVss+(*sk2(X;AYIz5a%CsX6n z>7fHuqH*|>rU!hP4eQCdzzAxv7R?3mSPiwAWovO~Tsh65INU6<7Y}zU&JUQC%@3~3 zk9=Z&pnWZxALKaU{6HI#cuATDI^V?nIDvPHyr-M_A-Z2aKg2NO{9vKAmDbT0oB1Kb z;!5))?I_dh8X0N0&2x2P^lF^JJkm6&CkXbFbBP?_JYD4IQ0hMqa<q4yn8%sShQFQi zEjYNSGJQ@KGl11N(s$o95wzJ2f~D8%Q>2!Y-Bucv2!auzf3iw8jB7Q5RB9p`41R?I zERMo$q~aiQYkWdfDe>-jSx9*v;7Tp}R<D-|QF`WtydjuYQL4}mP&5!?<{)$R(RaUf zmFS*gD9Zv&2X17mMw^1o|26NKmhXP+x5)J&x{Ij{VJIS@B%URDG?`QLQuGKvbmyi= zW_FiQh<HL63FE0hS^Sh|y=x~d;4(r_CFj5jS&i2i^U$i+((GH1unt*M4WCjw$ZKDQ zv^)DUq}|z<AuTUkn!-KH*-M<<8_e`HQ+g$qR6uA8Hh@)6sXYa|+qgAsjCV7(>l;_( zRu4J!v?W%sDdyTF7a=RTnFEIL4rkjfQdsPw#>gQ@hg?bYQb`<mSHs)n!eDoo%i{^v zz%nL$qypA@%C=)`*r9?u>;Bvr>)TB&U~XruZ1>in1oB;vUKa0elqZ=%#YG^HLjc_p zE4V4<y2(!MtK`jF!_6`67G<)MTvU?n;7i=CH3a)(1-FqIjNTf{+_sg8;8oAQtzloh z+rKq19n@x;739#<kyyc@nCsA1JZr4v-CLPAc6UUXtRxpfa7Z;T;EE7yK<zNB!gmb~ z3%ZiyKGY{m<Ng8enRk}{2JR_iHR`G=$;aHb*~nxug9^krgl?q@!{DWEBWa>aM%MTR zS$qd<i(2Lnr;TmX*pgd8+}Mt<*w~(Y6*soyD>k+#U&W2>G&Lef*heSi0YF3m6J%DJ zH4Y%i_lC`vl8G%wAsL<~dUEf^WMuFva}d0?^fQ;8kT&AuE8v}c72%DqfOqm$gjb7F z)|Qc>p}Pwx4q&|Ar*pD=XIevoK^P4NPV>*>5g<T-H81YZ>`WigEJALM9I|m5*8tLs zLmy`jabCe~dc0l}i^x2!0K4QH^0-ZDkg-$6<$>;^w}V!pqU17?(mE?VWIY*V5R-c1 zajU@!q?M+mrPN&+zbK$`@}C0AaXFSIR36JU?#Adi`U<cBlTTDE#uGk|HJF<w!Q9w@ zxp6U=n<AJnItn*nLgFU^lL7*BCW1LGXJBqTA(%4}%o*(lUc@Sx|G&996vwiosG^T^ zUe!Ebg;5OVGH2K^+|}_I?y6VFPA7tCm8-^XRI3ydWm--w)8%UUS+&aP_*Q0>Rog>+ z8<+~!x<l1EPQ5kfrfM~7)G^svX4fJY**b|+#15y(eksETF#S5rNzss9_3Ny|JFH)A zo|$~+;K~d9#!-iWAn1AB!v|x$!`B*x7+_iyCBTq?0G65e7dqcHqcELU0zBv_YZog% zX1-|!b11u<rgB<E1N2U58`Zo09MXMq*^_B0d@E2t;c!sN*_~tDSm1)wC&6hpVVCb# zPdW1dddKfGe4taKsBz{3IZI;f=YlP0Um3&%*{sxMZM@($ttSRpmrb!8p169_xvqsj zpdMMYXXlkf{krUom+NEpo8slRn0Sl2f+4=l$eC@9ml^tk<6}=r%mZE6*Vjd!N>+EB zzB8s@PdZKC6fd{M#BDq!h^+7}CEBqx1{wK>_#cR!V=EE*Ud=Aq6yB<`OtS{fs=smo zfYUQehrYImHjtCcI?AO2S+!}dE`zR5R!v}ed4fLqA%ILdE6^lgtCq7Bz0@Tie6NQb zAqZI^Z1s*TzS)-Y)i(A!ID?^|ErXX*?!DRp;RFGD9kXK8miSmq+^ILam7*I}LIK+{ z!B<O3HxE7oG0<SawijsAV7oOMVd&uXBYgnb5^ro0cZ?HhM&=rFa-5;g2|$)u{l$lE z(0R)N0p8Ym%ZVol(JVdm5vrVp>n$S6$3&EX`G?fRfJdUV%kBsk!z`@s;N1`YQEU!! zU??@P!m=))UYCvWvMJWHh083P2(jXAk*a7UkzJrfHe<Ayl^|~&h7Kh~(uLkEgGibh zAaT9h%#%SuCXFrwDT1=yp?qjO{xWw3+@T<7Pa>#LT|vzdiRr#mq9@*po@Bj+0I%S( zajq^>T2_ewW}bQuAfhMv4w$4DAz>5!UbbUYB_P%GQbR_f4S<!~5=SM(!2)g$VvmQ1 zC%#uw4_yFXj80a_>TG*K;yv&^=xGxQmhm1A%-WzCUUo;|cF=`Se8@%z1pTq0+}^`r zU~Y-48k<s7AlO1PGQz8I5DF!J0(Vhj;x&o$BtC?#Q`q3tp0ezSm&@a2OT27~mmA|{ zHwA2RvN|Oyq2d^_f<k^Ob^%*9Lh9O>bt6k5>qSX2nF)W0jb8l7mhFR&c;MD7MzsR{ zBuYI9nz&2>IG7Ctvt{s?+Dv&A(q^E3#KXhE99y$x7`h<M!Xx|bbg>3=h`l5-8|u_@ z6Te$KM-g5sv4^GrlVmKVacJW=pC5dgI0nS0qZRS+k64Vfl}y@{f;NaQlS<4ch(=hW zC^*bzltp7SSVzW)xZx#@$({iaZm9m*I1(Pfq@W@@$kHQCp{WLY_?^{7hlhP_j=+AP zo__I|m))N{7%8mlABvFCO}b$cmMVk-or#XfQKQUhb>Fsz3439dKzc5iEWc=%TGy>{ zydy9dePtn@QrE8WNneX@buk|!jiQykG;MqsObG<ZOtfQmnKYujX;cDs9vkC=N!{Xi z)g!=P)Ti3;BCDhn>*aj{;p~wt>65g9lk|yMV?8}VpCZVM`;?}b+`KDT9BZ=msC=jq z5dkOYUqxsKrh7pN)6v=C|G>_$7Okw5JBW;k^xC}H(Lg7?+1Euy3l>(!NS`qP=G3a- zymTh^O1&hkZQj~YM(&TA2c<w*+icFkQ8kg_!**ff=_$@`Sg<{5dbA_c`<v)|7#}`r z533<<wm;SyafXVf2G?9zDpg0vhSUMW8?Mo1^YAltSvOppX%cd~ZPZ0uBXqIT)0Uxw zq>Q#?8g!_@BjZZkm!F}K7Fb3J`!<3rb0!^|xsO}uZ8lxkl5qT@16XDfxv~e%T+(FW zP5<z|62Z+=K2Kp<pE44L#+d<^ID!jh>{^%C=mPB1I!As!7Y>*|4;r5`9)MnKwkD`! z!;noq^@Yd+>_7RTaLmR$vV}s%2xw##dvrQEjO@c~#oL}3M~|Mccf`aK?Xxy3VIq#h zF4~*s1(lJhls<cKhy+0K8CP_kyfe;I4Q$y@)X*8%fO4!F@Q^sj&Nh2*usCGmc|?Fa zNU4H^QBj^B`47xg7%QI#%b0AZe+>zWC8~~2w4(!R5mK!v0FvVo9rG{9Y^q1TR<`1T zC)LiB7|6@O5XmmiRQde5(eumIarlCyFw({dy$ml7WwV_$sH`gx$42vNz&56}kFDuN zO5?<Iet^X27;icIDQA?cilcH2bb85va60oU7N7{*?enY7>!d$SwJh)Qr-k2<)R1hr zI!?2kX_m)nmTN|#RmN#%moh%Bix;+0^^R%A`XQG<$^;x6ZX=z*;oeopGc$WC^kn1) z+w&tguwshbw}czaIGiw|nxY)MM`wrHDg=q0C>(4}K1zMOq^J~L&*+G0vLHs@F$HC& zkej)iAK)1Q^E4N<k~emSuv9EUXhmyyswL)uR!hJ%yud25x!|KagrYaCD=&EEbRdfw zDFkFqwqjW$bOC}4RpGGBomPWmbK>i*%7gd#Uqd>Y{!A2i?R4uxCY0^xk=&_1;SXpb z4q-8<Fxzalv^H~;xzw6AWyh`Q<ZX7SY9GXCb#TbKPb7;gUYrW4Y7@H%TAQ4PhEZFD z3LXdM$3S<6uv@)C|HbqvCtb$qxYr={tA$4$LlzE$MNM}HqmrKpsP(!9e{0hKl+?L_ zo~2R9bROSEL7i^R4;XqiW_yji(bT6BMgi6a+d$}x?LyMbMLUp)<Ag@YJnLXZXc@)@ z@lz5f#i_8gscMdQa12DVpuNVn;{j04U46BvI&ogq0lYP))TkR`6KHGd96FIUB*9*< zTobV;Pryoq!YHKN>|9!YyKw4VPjd7ymCr5^fS&sCA}+-f+5ocvf=t0R(kMk^wgG(A za8*&RDzpu0p4>_P2no!;0Xwc6nKulPX3@mt85z9}Mi*@FLVub-qRsMxhvqJJ4l0IL znpwlCO6mD8)~wNt8b%2`B*KP~d{JIdURbWX=j8xFx$*)tDqQdolpy5@eb4HK4#nbO z0L*SL)M1%plbET1&Eg7C3^}EHE2+BT03;Kq0_ble5$0==Ug3}`MVNs=hHWV|DYzY> zY~YJ{s9JcMGiyA!gQhRysZ9TrJsW3dSA`s*8jyW~>7)EAd@vP+Tvb9sGBtoMn@T8) z8FC14@l<xeicFN%SDNXVsTLyng?yJb>|3@S8qc*)nNAa(^-#+;4sB(#8U36m9f9UT zn3qf=XY)yl0cl%?U5JX%gak7LJ_H-i{DKh7;V(g#$u7m9X&h9^w+;oI2}4y^OgNU? z>`^o`m6}E|Ac`wb>ZtUJ)d+A=y1bW=K3&Okxs;@10D^nuY}Ck(8BR-afj>^fgqRY$ z<HUYSjH0N^cb>{mON@W@5~GtO#)4F=MG^xSZy2CS4EY&9rzFNg_!N^E$lp&(jOV1p zkenCSHHk4eYl+c0V~NpSA~6(6+;l1A1TI}#OD2)A`jaIx*!TFf$oN+;GFI0j!!*Ik zMaEz(G6v5%k&%C@iH!WyBBNddJhv7ZgGrH5p0&tWea0eVuvBE|1h&==%S6WDlO-}f zZI@y!{?&^Nvoc_pTEPEq@ham{H<lT*Ec%~Y%Z$ONn#>q{T4p>qWyWkW?$|P8!JoCz zxZ;e3#-nbj)L4BYsd3&XOKNbC;L{6@fAv!1xT{wh<x;V+kYZS9KV!kZ67XEw&{$v_ z*UN<bsj{K5P<~o&JU8VA#64l3S_o$?IHI$|8SQBxwia({$lYP(^~Ps>vLpvb-L)H* z4gT5>*-O%<ESqvuaZ}v0DefyX_vwfLo8oq1J6}&_yx@4Pr$M~P_e6m<*oce1C)#<z zizB+5q&LwKB|6Lur?lltj*arZlFtc#S=wB}A3&Q+!8Vsd?R7%h7W-C!xr2DNi?qW( zn$qSHo2U4FXmcsp<`SE9xFN#v(l}@<N@2+~3>GF?%f7Bz3bnt=8+n~f@l^xcT(aU> zx!N|D*uB!`(iD$S*y<RFHNtIMMqZoHX>&>7j}z185{Yqh$#SO6B^_-6$A*G>7>Xe- zMym@#YG(R5R{U(62vFHk5bJDr8P`G_x&YjEEveV=##yUy*RUN2E~C<HuzQ5XiDp3~ zTX5#kU9s<6J^E+bq%OPr-Z6M}^|<^=@sS%?=&s8gUai_4+aaez&^7pi3%SHv?3fL= z14fFicsoz7eYFAK7m(*Djq0sD)2`P}FIP1bBlF7bfK54V%#I4VrxOum9~I&3$e=5v znRy*#Wf8p&T2N&nuY*3c#r~?i$y&CHheri){h-|Jpk6{by^>wltn5#gOP|~Xnwc;w zfTHIFXOqKh-G6f_&T!yR42oTR=|vzW0L$#*QUAy*X#&*>AorEoH3V8%)QNle;^7E) zwTF-1fKNKag$w9~+R?_l9=LG#$k+rW5Rnm(?Jd(cf+WQ6^?(R6jf&`00a0<>n*&}E z3YEt}zfiQTh#BF9F`X<+Nx60CthmLoTdR`_l{TRw=1a)LqEsYz12CAUt#0#p;t8jz zo&hPg#Ai1Iu31BvRfnmH%Ypej<wBr-<Oe6S;6I=&Tv8V5kk^$31;}b24KQP02aqR+ z5KSkDU?;N3VtFpHJdCGMd@d0YT`>w0YceXD!CO)B%Ua_D&ud45N{23S=OUBJ@o&?b zE;;2#quuO`=(qaRcJ+q)eD&7Xv9a%}_rA_opUX|Ln=<e&h{IJMTCHB%Ba>69YvYCa ztEY|RdDnSOo=q{;wrDKgcCm@l<`XDjm_d+|1|FD(OnG?>P_Htu8(#c!#+hPscmU#@ z`6t-r9Gl#*c<e@3P`(5bPwV12q$v*j;ggR-C2;^rv%nt|gphRrQ!|-!E-F8iTcI7` zQS%_3rp0T?L{6emRP41+1bLR<5!LdcaFODi+(}5u<_H0X+ljtF6kFra1=ZpMK-38M z3eCbybv{SVCqyu)h^zojnU4TW5r+VLe#okG#*`ukh$2}R(FvtX?VQhK`cG9G5SNPz zS`~O5%WFUwwF48nvonpBW~UhK&dwv*ot<K|yA3*IkmHbS&EuC$^RZo=Vd8+`HP9WS z$-b&ke|kw+#0go<EuS|Mv*EX7^SB@|Vv4-=H{MQaReu3I&;e%<%+Za3hc7a;#GS!A zkD#aEMHmw|(CA6Hf=rE{xG0V*0?#VYNfx6QipV>GN;g}jmWZ@ViP6uFmh3RoL^H&f zuRVJmoPfhm<Jvbiwa=v5>j_}qQNUxZtZiE11X`WQY_q0|p9y?kG>{dK5sP0HC#~ip z<CzaVy_Gu$GZ?SZouih0&C>WlWB}?a{7V)sllB9-H&dLGVWKf(nRMY2S8)C_$}eZt z7)wM>l~gI8?X~coY*zCLaA*!MuS*=?AK_I~tfOc7m*l%fQ|m`PJGLy(c7V5yLY$fS zLJ`MP){VOOy(lMf{3HMnwL29Dkzfz@T8`aRO`@Fj!{A$S`&IU96b5Aq$eTnc$D&|} ziCHu^Q@1E^4kKXyn1S<*5wM>=KYYfqAQi$shHW3nex7+GLadQ_KF>T7MU8Y#LR#-f z&zE$9vYb3^c_j(?JbbZk;2{-!espEjLBUisx-#NH6dj`B2Xg6w(wS&r8}iw%;dRx6 zxgHe5iHCPhKD@tqzzK`?bNrG6Ute~^z<-aHQ*tI)3Ws98^=Tki17pw3IH$DQT_8k~ z2Hu#Po#+xE(qM3Yf*n(FMLlv#qysPoT%cyc$2fJZG5i17dmA82uIs+9Ki=2Oo0)yP zJNp6bO6d1$MK9%rxRF;N3^C$141oX$il_)uKo?YIMXs`H2V%Iua*ZmJ*cHW+5Pg*- zgO2E^EEFvp3<FkBw3H|zBS8vFW+imYNK}HP7=@`QGNO+%<DyH5&4~H^|L1nUelu@o z2fzX(L~@Dge%-h4$GPX8^S|ewd+xwo?@g?OW~U;}kVc@JQ_&W-mP^9W(8Vrs68U7T z=ST(DeX*9bL_*c0e`!rEn^e;QlFOSf<~5Z*aZRuGqo(cnq!l}AD(R^)sR~;y@VPTy zsNzyDSL!^vFoCjst3Now;!VvgtNy*>T{^1BI!>+T!9xVNA-I?6qx>Zf>wGHu>nlD& z_`@nEX?G?}l_4XPv&N<dzV-%y=V@@{Z}3D%kb2n3U(H!DV_4V8w;Hf&X)ggrW#SYi zeL{YaEkA)0DKBhEPkq#JI^{J-&d|!0n^>fSsNgR~x=h)@2vdz`<N_@tZWDcewa@u< zlYgrC(c*wOAQXply8-GE9VShR4><P{br>@>7+Bb-hR6<i+)gt{fZPEt>#~UuEb+tC z#~Lj<zmu3qapXs?@JP(c_(DOJ<lUgr$Y=DX9!(^#3cH<>vtTECiOumKI?f-BucUoT zcYwdq<TUbtY02v(qiFT!?0)67$_yaBSHV(&dUT(f%2gvHp0ItEBl%D)0;cX<R}0^M zw`_}JO=Ax1<J(SBxcbP!yA=;mBavugs?(YjU+YRqOX+!;vmod5ihw}pl0PjF$!9c! z{t^D?rz314e6@>=pA20HraafxWowKb#Rg|Op=$G|H#r>Xm}vsE)j`z;vcQ6{&ee`B zx$9=ovJgG1;oqundPGw?C@X+VkQD^k<QSqufn{5=`gjf<C@O3WUZdVaoU;{sAAT43 zqJE!K{kVR{aNpWeYJ?}x_3$vI-s4-iC2vWuN2}rGi_-#vj5%aL1d*WQHI+xX+(LG2 zfHf)DgQlJu!@pEI+^dmt8lkmVk`oi8@A9oXIYLMSpV|u&QL<2`=r7qI8O9^Y6(+-m zDyT&WMC1@i#W(sEzhfrK($ONPWS9oH2eI<xM~I9W&8I8hGare=6Kcj>sw9B|6(tC! zf<M$u!lfPj3ZXa`E)i_YEFl?#I6=s|c-QSDx>yRjQy<hrTOakxLVdDb>f?_rF4e!P z58s8bE8&q&eb%koBA@`0W}!Zoc41Z7(BRKtAyEqo|FR<2a{YWS*!uY%+ipZ+Hi6iw z`>>eLgBkCBmF>8a(VrAjI2U%>XgI5GM2X}^!UpNUpd>C_U8#g;dPF#r)j|h!y3D70 zvvqX?D2ANW?|DT?GJ5<HpJZE?)d(}?Gtk&JHQm&ej;}Tg@{?WKX2GW&8LZ8hXS2;t z=J1oUW_wP*0;NB#4~e)(g>Io{Q7|B#Czq=uZ3TP|AEUNu8<ofds$|t6wNnWo3oOix z2F|gdfnuUdh#y^&U^SV)&Lr!GXamy`CdvdtCS+rVmj;GqIwQW$HQamR0uSB^N=?I% zfI%}3G+_&+_!Vk5YEp;Qil>bQl-dbL=pzmc{b(-g8-*iw!WTZziZO#l;~EBHKY>>s znjnrTYvE+NF@?X8?qEo(8s3MYQI1U5LPIN8c2F`Fz(a0ISk=OTo0%S%P)1Be{Lp`H z=lI{g_VF)~9lW)S0Xr>T7XC#(1^$)r7pf%72LHCGvcbPYWCTh~XmPj$Rch1;dh258 zJqrArz@-JD`!V5PWU?4-UnsqceaVOk<h+*rUc|nIYw2Q{D<h^TrA6sfuf@LbI{fkK zU|$)O7+w&@BM$8$QMC;Fns&!gvPiQI_T2?rt2wJNDat)Jn`&fr!7nO~;nz{Q#R){; za3A0o1a*K-OX9K6Sp`(r#wrUCHDRmD1s|$RSP%vfqhPxMXt57&-9w+Jf*a@~$B(#5 z=+X-_46z9c=K+O*Vht1?76!J0!btlhv8|012~JQL&>2veh@E6K)iMJ&Eff~Oof?}O z3PW|k7Og0eUMRxQo`%Bll_I7>Y{?uR*e^^)TibIL6dolgj1Jijg?VHs%r!w_?oQ9x z(k$F9C~O$VoI$1t{?M{H6kgGjrBE2=RGo|>yHI$%6bgq>pV5qEP#7G}E<$!Lg<4m* z(FXPc4AeusW!!UDqgOkSR}uy@{BDq!q(I)5d;xi7C}w&A@<pRu*6fS!-4F6*|CqQ4 z<jaR3c0=1Zwcyce4DuCku+MiF<U0)H3$6;}3)-F|-)7(8667nE22MzTb&)R)+dMMz zg=GcJ0lm;E9X{P4Ulxk!Y9P~6@N48b2fuV)XC#hy0h|6PfnQCe-vvDq*vz462W+k` zfXyY~S2IjY9Q`3kM;H96V;1Uj4e*P+R8Q{(ev!I}+6MgEfZBrb4*2zO&lrw7!7n_Z zNgm+WF!4|&Sut(E?~uLX0e%^&M&Od}8EnB<0>9}otj=$y{Q|#C7+}Y`0l$PUC$?V~ z{H}?i3g;y7OXOZ<#-_Xq=3M~4VwAwC+rh7(kl?K5bq)A6JTmxAne)zAz6*ZyYJ&<n zQx`1oyJ7I#R3O0bux%TaNLwHCy}|ENQ3|0xj{)rKN|uHst;W{?zx2H^$qw+F?-%^C zro99FB6+R{__fncfZu$-;8%Kk5&Ztd(Z3MJU&U%*OilBb1%559MAB~<e{E8O5@-qG z^REHpZ&;^h<Hq<4h;59^G6*%sWdUGR4$2pBEdYZlm<R&x3^rS8{nfJb7HWSV*58#y z>#vR`Yc0R>GDLBJh?C)rdmGerFl-Jv_iG4VY0$4!86GD>zg(6Xf<c#!Ay|;phG1@5 z^vh?Ofbr;BhT!<BV+htaGMuPr5VWt?%Mh&Aq?XOm?@&*cqTiKW48bc)(Qjk6T#kO{ zhG3bQub&}!Wj9m|7c4adV~0+LV3sRhj3L+t>_tQH%GZD)cxAaE*pbz)Z3w0-J6L#S z7c9Kf5X^TW2o&6LE(jFut%E(6VBxP-LokCsTZ)Cv*84C7Gj5k*;q>?~q#?Lz+lw*; zBWxB0YlDSjiH$tJ4kT+b1g~5J3nTrPW8uFzhTwmFgkWvk93hS^Izog$gVq)>i^vf| z?<4k+jU{tOh+~V65GkgU{gvX=<OtD|!3!4=z$?fz*(SpgVndTvR#iHF5a&AgpH>Jo zJ4iHc5HbVHm7rq=ma}Ij{~OE)%#>|lEpbpNWh7(GlKfjYh>{=J<p%h8F{vFfCnPvg z#|%7(pkJV546I~HQUuLRR$v?e8!IrTSbeNubC3xWzR(93%)k1`W(-_(l-yChuny>T zYX#n4CGD6Rm1HT(vv5UAqOnoQumV%w)jT{P_Ot@KdUiH7%%OL~3XB^oIX2a+Ot^Uj zU6T=_+5<ujRYG0^VH%LSi<MTi(L5trfgymu(wPH%*;s+)narRgOclqYDFK+yMaU%( zU^!y}Hq1dS7RH=8SAkfdM$le{C|n?9umTHX(-amaHv(N%11!o5YIksgYW2HVSOGBk z6w7%yYb8$zf=?x5@F0xAGQrET=}yLwgfV!CF_@|f`kGyYjX}#81F;3`5k-mPR&{@s zVR2!0kcVNa8Oqf_IM@qy<byb7<wvF&Qjew>WE56U#5TC6-YeXVsEu7HWb7dSaGkKd zSoK?GFV>n9cA_=h@8_-)OYFrNy&!wBb*o%;(^s+=(_UFj$tDmp^|HNK^`oleWG`j` z_m22py#cc3Rk9arZC4cWlV$c|vP!NKxN|Rcov>-Gah*u6l*sh}{~{PUaQv9o`HJ)L z56EOs3P}1xTJ4Wzi5RKs#AH1d#YJ`;DF)P#5c9ZcE?SRydkJx&Ccu}pgS#4M85qI- z5+Qwh)ub{`<|o149)TlZ2YE#p48xX++(gHMhX?9wJ4TTA{j7j+xmV3WZ^yKb2M>VX zAw5o?50FJTMXZB`R|*AhvuU^|i9{G@>LQ!m{nbhshG8xY!voHuuW+_9-_W~_VOVj> zv=$vRI7@<L7^c*<nK%CN4WD8d=FwFIjW}52j5uo0!2H4Yl<97@Vb}+!3JecuoJ563 zv<RjlsXw?o#Q{_r$&_A04uj#2q?uxPZDo!4NE|3bYzv0@Xf6pDc#@S2htBF&$Q)M> zuLv84cdri;rUTB4eb=XzOd9(gaL(kVQy&|KyY-RPG{ImgDad;Y=W#9%%9#sZ#S6mr z;KP+9#&i>{mz7MFIkM5iQ;R~rQQv3q0v~0B6-|$q+k;7Sb~bL!!7lL3Y`Haf+_46G z+_C?~YKUvtg3WekVY@H|pHZ8dEVZJ2q+?~~l?}m1Nq$5ppUCqe?7)Pi*1N_Ge6(sx z-pdSpSmV$>5aK_Wi>9?c5R#0D0xhFUB7}q_!Gkc!*QbPRkV&{eXcWw{@P8oWLMawX z8Z$70+?HAsu;g5$9BtqywUNL?x=#t`Cg36o-5n-i<OmMm$^W6%S}ALM5!HnbF>NWq zkB}2`js~^y4>7UB|A90e|A#XCA0+2m6EH4vz44D9eT~E3#{2i>!QOrs_JSzsjqrZx z?|{8pTbfCJ6UEawmj1Wf6PLYUFP`5@j&q(gf_dpBz+Qx<uoz=C!Cs8tF9Y`CSRkx| z1cHk~Jy;xvLULIGy4Mr-(rCmI{%zNQy$6x#X7mJm(bMQdnSl3#y?7mJt|8|`g?gv2 z40~+?CbtPNXF2R$@PW`yjLyjJH~{13A0}W#=A|h_6Q;FUiv6Xw04L}mnG2@01(;>b zumIzCC%nl!30s3-Nq)&|`R2h?!n~-nH4A4@Pl#$M3qHCw?(LI1S$AB9VKw7kW^0X~ zgeGpb6m!F|91FOYM~i+E8QlOqL$TuNv#RjkeAU6d`o@-GD%-`q3ogUf$12#k7frn2 zGHmd?fO}J<Sm~%lg#F;&a2T$3;NIb0xK|txNA8V#)1+6vwdm9hb-Q4&{D;}HM8ot) z&`ykj=R)H?3>35<10|S&7vS*01vtDP9Bd3>94tBH<qZmaVAl9Z%yF<>B!q*Li-ZA* za4-i!F2%v<tDQL5bGjILOy?{bcEQ0kIL+ixP%NQo=*?D^xdyiu;XObweoD(M!d(z- zyF!|9i>bt-dx2oYn?NUR(BvD@E$xX&NGlG&Gfg-3K!5O#2pJeM2*Go`K`^WQo%(o+ z(X9`F5jn820|?s*^TEKw0>WZFg7F(bHbA)F0%1*-kTZCB(_WatlE+Igdb|w?_b*I~ zx>B06;S`+wB6x5ne1Z$-qlr%u&O`PIPHqv`0K(xAY#{75kmV8}Y+Szpgu@$HK$v#| z!g2;a8qUC!96*?D7|~Mf3v+*nJ%O-9Wk^@c+65r|^&~R8CSZCR6Wuj|aG-|$0%63* zO9R45jV%J<p|?R=m3x3PVZJUv_=Cq@abJiRW&cfk-#E>v-3Q0vIPLvsmfC-H!o;ft zgdf%Ry03L0{DFMG_TR4p5Ki`AW&+kaz*<e#yY}A(0ei9_FJM5#H4$*v@aw&^U_FYM zBVe2xb&h%0q|=w-cL4$KX80w{MR)=C(E@OrtnT)rl<1hLe)#WevutDdeN=ED8Ghp| zNKz*BYfSY4n||j`zyrbHRq0~+$dZ%2WV@zc9Wp0JSzrv#S=4-$yVmqOK(4nCSZa}9 z14Cc|G$}*O;?|m41>vTJz~m`cVIExz0>@V!2&``mft?5XQT3Z*V(GdHTN6{EfWYXU z1y^C)V-_HAW5g8%CO=Fza|pcPD!gF&O~83owo-jXEx2q>w?SZb=4%rjouT>5J|Hk% zs@V>3_JYxd?NWhvA7#-%gqC|wWBR4?Vfuy0tKl0_8(UPIN;MnZ8)cu2O(k-R6f+4~ zFq^=O+x@EDlsZy}nRVKG1n$AEtDQ#1vt&r$3eTRDfsMwHp-_eQptQO2%DJwSoD73$ z@chI{pwgQjH5-8{*4uI()(Pwd19Cb7l`G_h1`V7hUFPs0jcNLUXu*9Vw+jIUt0E81 zJQu-j`9Z!9)ASmUd=+|hA^C%C6CPlLxOeNp{FtWuW9G;~lkz<1r!h_MAChCfq9T%k zt!a8yeY9=2o}8F;2BVgW<OojB?2dwAn~o`Xb>F67zH1z|R=cL)WSUN>d<P1q<6d1< zp8Q6Z&Jrw~#iDdjMxP|(^y#olzcY4GKZLWg!Fb16S&4P9l?A{IS>c-nOn%rRX(uKp zlt;qk=Vo(XWt+jz?t;l1Phrh)%!)*Wu(611XYA<6jlkq*HFlaTHF~yrDI1d?Avs(0 zWYTVo)0{EbVDe=?$}ufgle(CEzCjOVA$b9dw#I46?vQkrSuG}iXZ7_e!*?2|tv$j% zjf^Tg_UYF?ESCaUv`;_vT8HHatLx#Gv2XkIH(<GrCGFUWY|ODjL)h3rbPczRgJBK4 z-mtuDn2xwzI}FqNfaSXzraAhoI;hAL$kRushH7$6HUJ32^c<!GY#Nxp-8Gr?37l__ zQSow3(+jv<I<S@LOe7mzZlk6k5;rX_w^`X+vaW^8<EsuX=fU+iO($IbN}Hzljmr)5 z9tFjF2HAwR=*u+SH>}W~WSV}IMUlodP2h&uI#lO#)3h}3B3#E7JGcg1$0|*4V)bQ~ zSy5;)hwI}G<X8sRWsU}s!gpP`Zaz3buAa8qU`s8WdBF7na2=1gRF2?!V?8%cw+qQO zobFW`<8&_zVT4qv4`OHrhfvOgOeF%R%bi;6O5MHkA{{H7t~h0KCK&`y2bx|loW2nQ z6*$Ct!9Gmqdw}#;+;slc2k9xQ#-1RZ>Ew3f`RPFD?+oMlL!7HCG1LvIkpa~E@Kpfy zrN;Bat)+Q!SK-`veon@7R*z#-AuP5VP~TxZ-xpA~@tiF81=Kk|k@eONP@i}+VN>#6 z#`9|e^<~EMIZ$T=e;o+*y^QByUqJnz7sbl^9E%n4b+XnutcuTfyw=H|-jW6Ux@oKa zLCj=z&H^{d?whSMlm2U2mYtUhx>OfiAO9e>9|=GK1g^w?wG*p<W1--8#?a2o^ZJY} z-Emoo3+5Tv?&H<y34UMwjh~<ObbYgJQk|#$pZvR3?<fE6Z1_|D>_5hYGx#YfA^-e= z6MR?oo?uEmd;)R6Jhtk$Z&=KI;^%*UHu%IHKmDh_`sAPe_A}r0gECmAf(AeL!CCnP z23O$Y697D>WKSs2NQR#<po|y=w`R1jTDdh-=*sfejE5N2)JUlzLhWdM0}Va?`#EH* z^V_oTKohB1j?oy8&c!3V8B{i@Zc!9c#XCCAg<tp*637*k6d#_gSt0Sk^Q_}bpYe=v zYIWSlN97b$5NY)l05N?+9dN&+YLuX6P@h}I;~&U#2j61@#X<$-#FQ#<K#mTqr#1!F z#IK}}?dL>H#K?(D`lM6J_#;K$zrtQlgx3%cc9Dj_E(f=;SEA%Ox^!F*FGo9Ug(H^B z3NP~dUwq{&Ul}SUDh|)=y3ztGci<A7vLe5N{Dv}OBD{3RUVdB=vb(3U_DvKbW)*AW z_yo_O(D?0&4#xBP-4_LwfX%*)?>y13R~3`2ewP>CN0SwLP)ZpiAkM*Wlt-7MuKEcE zQ;zFZj9#AS^{S$|t~gMpr~!ou$Y9`sIM$LdL5sW)AfHu^(;kXyMAW)D8{U?w(yHfy z@#LGb@lStSK2DSxpUR5!%l<**FX=Sn`j<ao@6<s}+{Su*p?;JjW9#wV80$IKd{$g$ z0iwJ})l6;9lLgL|guv$U=RV-@Q8S-tO)&y13PPLLpWzJ)aFILs>9MN(+ZSn*EK0nW zGaU4%Sqv^%(z%s1Q${3kUv8r#hnw?cjeP~f`st|TD)BX|T!A=i=za;&0hzWQR%VxU zFuZ<URCjPgZ0>qO|EK}|%k_x&RiUJrp0M4z$CLIqk%^0Kzd0T-y-zL9<}Fr3$tfDD zMF^3xX{ckRsi~w;Q$6(5)EMpRzi2FX!rDQAYUm)lEfpe6nGQc*RY%YZms}icE5BxH zOm*Hcla4B<GcGdVTnB1F7P$AQ0%+TjqPqda#X}HR^}*RAF7kaKAT2c)!->c)6q45; z34+_#p5?=8<rSeTR>1mmKNeghJF}Q?NX+djpBCkLI0{kE`i6uFcf@bT>T7|NQi^zz zmv_&K6MO}sD{dgW!@1A_h%^+3`Dty|(+J}c4v_V)xP5mMgRr3qT{T)m#40#!U~QL6 zdewl4;kkBQ_z3a>sK^GIc|uf~_hfi3L2_huIR9m9tK<5LoXP9oxWcY~uHLNtC~-<U zG|r%~+Fj6Q{&9poJaSb>9N$>q#H|DvUn^qb=rVkqaTN5Mi705c);Q3UFWlrOur&<f zCsz;ni5UA*eSjz{8UWeD3=hO0GBB%;Tp;Yg#fLefe5_3$^WKmKL7{5I>Ovi|`UY{^ zWlRM1O?RHSG|ihHYB~eursKs6HZAoPyOs~>9rBQ-iw;ChT5x}ph98SVsH!`?yW|9A zNH|Zaqct5AeK_g>UaSW5vA#lU)E#913XS#-9SqjQbme(zyr!j$le?vx#eKnes9{AG zCJkF?P!BmA0>_Tc3k-d2+bWY7qpL+Hq@@lm@N^S*1u>@u=mK*lS!w26kqB8}PSPjl z4E9qsgE>1~Oi{tQ;{8SDL@2egRqK9@WPuUsCIk{664A|)ftqBN6$%WcH4n(IF0;U5 z4B~~LX9^l(=_bxWw0Jo~8Tdv7OTtf|%*aDjbtbY}3l1@4$m5w1KqK_F?oq$0j_UA9 z^5Q@1;-yt-#B0%HmpJ$hghOO(efh`rE!lqHaown%k3XK@eub@R^;K@JJ}Ir+(@&Bz z+h4nYqOYI(=<j{BugLcG&pw`7^@Sf#H&?5%Rx`BS3FXrlDj2?PeWm`qi<<Q)>~nET z`=#H?x2?0XrU1~$2eP?2!=d})dQZc@X&fk_{(~RSrx~3JyQ{r9oxx|K8MxuCvNLdx zJkyY=v&pS=*p)kVGQkw1g`0=6wm!_I!(rJi^_s$amRlEzqRvX1stTN~|2(8je`&21 zUstu(P9JUf;X6trE8yE2n_W1ZVXLCyZ8ogHsyeQBRQOKGPzF@NP*N==RL&A%^leCr z=n9gr;D@W)<y(lcR3$2&5vrC_^2x3B6-#k;6?q+0k4Zk*n%sJ$qPs#PQmprpIrMtZ zZ~2xb5kJQ{L7m2bkdxyH=uSbr)O2Le<W_mg@Rus6k~AP)s$AehHDg{dtWRIy=UCmE zx>nmFH7e@ooOzXrbGa7=X!ce$UEA+;ZIFmq4(e50@3dmvcB;H7LRHN&nn~$zJ0Ypa zGY>Zl=lXd{k>{e=#gFSxF-ETF$)~vqhS#qzCWbB51)#3dh=y@zz-H80*3SXn5(4#7 zoGf)<YYoCdeOe&pQHVh7ek#O921W5dA*U~62nMEV*$Rjv2?$vJLVX%MS3gUQe#)## zjkIhEa$f_UNkCS8=}7PjJV7?deK2}YR70KOPLN9Nx22+~)h_Cm1crKn8ld8MP6lYY zgsA#U%cl#2zEv&<mX@wm!fUJ^fEty}KS<~P@!<=ppEQeV+aYbyj@!QZe^zMR`ZLfi z+OZwEjaMCwR(<&g6GW?_?M^x)!5aAr+dirgm+prmQA7tN;2Oh3W=k^<oNj28$j1Wq z0-2CPrVta0ppXv^N%CJG2^IPyiEjR5yhwB{enf>ixku0ZxfmF}0)dkQ8G~~Ag>Js0 znTGrzM&fh9S+SqF?#>(OcHW=?6O0y&)#!Yz%3{(0k03c>(!gBSXHxLRaff<ij_!{o z6<mNxsrd!fQc@~_pAR*c00ousOXtg`UkHhuL>dsN?-J?JO=`VKhSHmSD*da*qMy*` z%2-97WJDz7<ZRvc=ueKE5z0$QZ$1s8Ma<Xg2zDaRsH8j<eF8}(znkOA8f{Ip+!SVK z%JVp)HX&httBssGl3vi=J{E_0A~-cFrxRN=uhQWnjjGmROX4;THgdn9kvkotpnRzd zpaw+%z1rCYMR|6iXo*5}%r3~M39A9WutPza>tgyNhHp|5Ls&5ZoJwIZK?lJiiTq?g z2)67XSPkzvf)!SCsVA$EcHC$_oBD;R()k8%m(iw}G0{0tQFsNlW_~9NCP~NLK4V_S z2bdQll`yYS8!S_vuX3Lfq!|k#XT{auba@K3gkdGg@RZ{e6a%!}oTJ<)<SuKBDw>GJ zMLue;jCj?=ul`Gz970NPue%c$>Ng-D;hR1~fth|$pAe4}^`HEB{`$hCD<r~vKhjfm z8=^Q{qG}qQLXzX4Hz<?UVS?uqQ-l*O#H&4f!XcGJF0U{(%&9p6>oW-l@`E0L(uqBL zFPlA??#h7TSubUYJ^R6)y<ku8&>{k3%cV@!cW~)Too6vC*v6$UoMVDo_AHB*JsGAN za$WW;%$_JmQH4oXVozidQ?hOBiHlalo(xaVSBM&~Ds<UXHX5;~{iV&G&Yfrpq7LlI zJT0gs(n+?H5||lGOQ=&3l&BJ<4UTTcJ06be^-O?E;(<?`5&f%Aydmy*l+yHpSzpo^ zJSZqAoWbo&1pCOF7v7)OXT_@-^(ZX=Ls~N!Pr~b6S<P88$RrC;{)Duq36E99-@Z8G zz#jt?6b7PN;+W*yMK!p~@#vR|YD(PHY*p;v71hQ0s;m!496HJ(>L^W$;Cg--1thhM zoZV(Hf&-E$mqjqlL>%T~QI09;Wr}k5)6%g5tdS_ED6A2xJJYr6Hb^8u7e#p*Bxz{Q z$4V|FMjt^@cB)u2Ns41U_b>q|s@ou2xomt0SxkrJ`D&<5`5qso5x2&N^ohl{<ekO` zEIgSFCBDtT#1HpAO>wZ<+85&yGHaRLRp>Cgp^KZ-8Ud*vjnKhZT=;eeUj~9of^d;9 z6IYJRm0E36fMsmSJeQrp48s8Bn8gM_F#M%^c<sT>^Td^YApqeQR3&kx3>%u{w_GVe zzl|#u#-Xv<CNpLOFt7z6q%fMpBsN~QXm7!I8C?h<>%fa0#!E>&YA5;4rDMDlyjWtq z)I?7b2ya$f#H(!lBRLkCF!c9NWpPtt(}#n$@LLUSE`Ao7*rqLE2Y^KHqml~k%oCjK zvDzSuy<Yn8Dhask?%6;FN1a$k4Y?QViTAu}ApJ@~+4#R$%Ll0nJsz0uxV^(~ziT7> zXa6N;h5v^a7#k*^po7AK$@}**b(s7IG>32a`8)Z$m}CD=ju*%l1kgwIXaAKxB;w2` za{YFj`mng-sOW*6u-Ri;)cq;^R-SjkZxG!6-F%vn62|9b9;U21vao_O4{1zjIN*0c ziNKk71!J_YST5P^6##p;SBG|gb#(Vv1kc$m!*AaG)v4WIo!<S`x9<Mx+jf6-ZueKW z?f&XbyTAG^g)Q5K^uN8wJ3>J1`rZGq$GhLz<K1(6y!*l)@BUzqcYnCYyFc3F-Jk67 z?u&c8dtr}vf4;}N_apmu>xakpc=r=~y!)9w-aWC$yT7-`yI<Vn-G}#h_mB5@_mMr` zJ-x@fkMHsBSN3@KU+?km*Y|k$>>lqvwa2^P-s9b87v4$oY8qps|3fl}d4`CDM8+b$ zC1YDQF^=e_MkUlJGMm%*<m{cZ?1a{kWUaC^PwQ1kUzCl^4AvXP_(Nz>Eko6;?AnVW z)7nDK!R_mLab9PXQZD}|36HN{xmaKQ4e(5<%8|?v6LDU@nHTxPw`It9ehn_y&*~SI zm(7$9&-4D-@-4c3rhL2fu@g3*Stn>g^$Y&2$)tJB+GNV-DpSp`eC5qThuvb)tYm%Y za{a}n-?!P%GwhLJK=~U$67>~mXNr@L>J33ZS!6<jJO5GA%GSoAY_zgETFHyDx4N>* zU4MW9+0#xs${u@=Ru~DT4|SKk`u3a{7t3G$mEB*R&366j-&uTB54GA(WjwW3W&U!R z{Z*F;qt)5LUN&A@v2)DPcd6KSEWX-V#Oq6aJAT;5kJ9)vQ1k3oy{cs%+6ovDKTS(k zEro(V^Pzw8hZ)^jU#ZGS3Qj2MRqzKkD@_Hy!kJ!M_W**hfP#A>vK8yMO3y@$tYh9k z=4|SG{NW?TLE<R_!al1lQ(z$@>U$X+Z@e(w<Z>&a?doirHyuljnsU~*?!g3~bHKvX z2Zh`_TWQi&D=eYRM!oYwHwDm|2@$Ii9v9QF7}nn+SCf1?QjRxMH~&`T2JD(l<L>1n z?d;Oa0$-g01X!)Vg@p<L9dYHf8W!zc+nOD@XPxy^vpLbbCU-H4)(6n+Kuru2%4g;M z-dWyIK+Ao~wLXR9sM2GnJy>&4uBR1}1<VxgrS0ovK%#6mt}C{q)i+_9rs4ySYF2h~ z&K<x#<3IWzdpaqZ=A`fwZp5%!e|Wm?LYnU@g&Cna-4E3&iW%46su^(K!e!8{Z?s^s z(nNFXT|jowslxYeNO?)7{j24c*apWpHaZ~>E~u^tAxSnp$bTEA)wa=Rn7cvap%s*8 z2~C}_QD@(yU?+sS;<I(+Qbv1}UB6~~^W-;j!fbGoDibWegYC#(lplK894cq^w?So2 zuT>v+T1Rb*V0HSSX<gZNi3|hVTZd(|+dBCV^_rH^BApSaNkA)4)FNygiXP`i6-}dt za#gzNvRgqW8YE)*XirM5{uxgX(VYX%vN$P5)QJ1H0Qx)cUSDZC8JFaH{f6}~`F0Gd z!}V<sU8w)_Kh7@Dc=QR~Gt!vzKp4~~Y#RUWbx!Jmv~+fl8>Tf8>;h{7Kg&xOEEvvv zLFT(fT+SgT?_%=nOlL)CpY^94v}Bo4Fm??j>N;cM?_6X{!Fu%7#S`=fEL?wn1y9<^ zl-;!c=fkVF-NjJFRccGjp4WflVwFRk0~hNOuYkNd%n7{pbJ^C$w6~f5x3PI(u(7eR zIneK-Uv6%$Z04JrNJ@>F`Zq~D+}Ip%l7=}`UjJ@(=laUpVVLLj<@xDRYK3V^)lb!m z%AJRX$cv3pCVg>Zf56eoH2S=@g=T9vbbrV=<~L6xM%RutzrHii){Ztm&`@hfnjgwx zv-#nVs0}V=`tPkL==(uEdKj9$K&8eIjCJ9<B1VgAJUe<HA`F&buPL!TtD{eeI?sYP z=xQt;l*IA62flwg=F)q7N+dXotJU=VeVAIwA2DHz^kv$A0l8B!pfKu9=ta?`Ed>rl z%Bd7qmCmNzhu=?TM{h5c`-*eVc@Vj>&aL2$5{)bxViLHE7Kw)<+uO76m2kP8O1^J) z^o`|t#Dh3P<A4R~32V}R^1tax{rfDKD`N!r`iZf*XN5jEdb`%+C-;-n(djV~LJrJ7 zgn}X7$I;tYug;F$zWUhvo@y&BA^l7F_tUszR9WWDadqse8P<sTm&9SLS9KcgDu)C_ zOIPcaw?fC99xxHd)uCEz)Y)Ap);Fk@_?!`O2nMHCO#}Zugb5a+YJx6OoZX=v)~ciT znJ$R*mMX~GD@lP2BiosrZnC#DW5kR_m3|-T&3V(@m6Gq;>zYw>i8h^RuK}LEgH?o5 zoeoLhmSR-0aVe7XbuGiYzL%sLA&Ag(Kl1($jPU5X%JtEU>l$<z>B)frS7fb-r_ih^ zw<#HsN^wr68Ym62jux(LRnSexWy4)!Y>Syy1XK<^$SK`w-+Q*cZU+zX1>;CdA25EE z)tqPpxd)TKYW9(BSr%fE`MYE}Mj+vpiG~1*FldmJj%qA(h61$^RETyLWGYL{%H+Sv z*}#$AHPhkR^0&>mXcG;mnc@A(8mR-BYUOryeSKX2yArrkEZ`VbhJK?moD3>p<V8X* zmh0yYA=*N_MapVMVcKw&HP7#Aie-2NVcYzr+#aD26~^{i22Z|*jd0F)BUg*8{xZ$v zWJdUpIvzYMX^A8ruHh3DM0!*9MuyU`+GK1(ZsGARDu5e6J{2G!!nkC>mxFK<-{fSC z<E2!B=qOMlVS!4Z4U+$)S>u5@ZB_mrD|CE3TYdYwjH&a_%}Y&6CP{c_pvhDlBPb*v z|HgO8yEL%WI+(6-D*-NwkGg@c?Z!P~CNNg%z5s{0F9?oYtxxXa838r*4FA}k=%)u{ zi{l3O^!M0_swR<%jNlNfts(eSoF^Ar$jIcNr_%vJq%zj6jlWd1_QEjM$$%@w3fIe1 zm^t7r#b@%WsGoF8v--5c0U8T@hF71459>_Ct3QoYER-=A@i)y~cz6B3LfCX4#?a?q zFxtj@Aw6VAl^#OwzafWNPx{F17yMeR$Q}9ds{R0XzIow=jP=ektDkVHX{j5{BxQ@N zc}sD~g!+ndo_vaBjvL1=WU+>B4z<*hZrO9<niA@ta;^tUd=XW+i&OzJ@y;vpWfya! zii^r*%x}jxsvP}C6=+j+(KdQQYN4E=OD=-PWOw{mNPt5tcnS!77fi@+*zZTQJm22q zPX}C;qj;6S>&Edr>~O9b%UukJe9NoT@Q3)AX_Z`_T&zm1ujn)C#!4rhqu^Ea6{~RS zO)sMB;aQLw(~ohP<>L>2FfWe9WaUYgCvP~F1!$;zs=Y(K-?$hG{ze~dPhnKu?@uTc z{EcrcF}|zMZ;}x5*C!T3!8aeu0eahqdnIRBZck1*n=_6=<D4^Yi8c6^6ML39JFKOF z$R>rKKU@#xuX01htE~Rbjp~NUZ@Cw45L5j^zd*{;gIwsW*p`96Nxk;Nif1UX_dnq( zm*f7V_dP&-Ux8k<SD7#p@=!R;Aom9fF)=%gC1g}>2&Hn1G$A=tL(~D64ag>X@{_!@ zO6|K?faD`9Ds-Y&2ntnL25hYWX>o;l(nNDVhWs|T2Wci7L!-U^0Ev48%B3zRcj5zb zL;VX>@-VG4<=q=iH`6_0<fgZlbTcb{NcSDxyzt?S`ZXP$NG^IZ5NImy2N-`47moDQ ztLKrPdQ6Sy&*zbz<Tcv!oEb1N9U-XB;-sa4MgOA_N@dH=4-HGucr}F3abRNa?dw|Z zaLCD=?lBdS{hEqG;W$Dyk5H%ljtKv0D|t>XC>Xb7d8ktd2X_VFl9=R@i8_#S)T6AV zq)?~C^4zPEUXDUP%~VNdo(gq}{P(PV0+6F0qLO4BmHa>+aj33UOC5}=1)ZoKpR0PF z+qTsU!tFEEX@7AmxioMa;5rZ4lUE9LN((6Wq@)&z0XZaoGd^Gds79PW$mRG<a7t*4 z06Tl-EfOCPclHEfVM0s*Kz|81vQgM!B1fa+J5gHl6X?uQH>^L{NwfGSa`8fZ)AcsK z>7$I-0~*nerh~KK^awqm4KL=n5X9_-L6_$;JP?})%g(j|sBuEi(WeKiBisvmVCq1_ zRc!tmK!i=6XpMFx46k+_igszDcUbQTr_uv#abYipq|LB8D&8R8xB3x0AUdx>zcqxq z4_$QXY<5t>3M&GnABC`b`??$%@+#h7Y=qbNIlB8q{d*E-$RsYmm*FgvH(wm1bD;v8 zd_q_u%9x<32CGp6<`Jp^XWa@kgSQZIG>qSx%26#gGSLvH(e_b`H(t=7Xve`2Z^FSc z5sqk#2i#h)DEKX_4r<4ceaM?2|Ld9|FgEn@8n&hNPDm$44aL=pvn%N^gSXzgUdUU6 zpB}I{_l}5(&QAt9{Y*}W)J!eTY3q3Ij?tg_)^R>R>P5zbByum+&<?hBR8#tE-CM`8 zW+~rl1}hHQt>Z2=ZSqziYNL5rj7{D;I*JBYw0}cey2o3WHK*9NbzGnxJ{L?N_mgy~ zw-9mP=E^I<b>~WkiuA<vh5@0>dDA0vf<|`AVMea4<D4UK*$FXkXcWp;W>rY;L|0XT zY#lFS$1uCK_25Bj0M!uk52C{~cYU-Pv2|Rsx4&)c_}F!Spc;Xyp&~j9q|E692o5lO z$)OA|jOJy4a|W3X&4s%p5j4KUInmcDm)?}sM<mP@r;102LG9|d7M+c%PWM1D#w^_? z)f;^|ply;#mOGlpNO0)S8rpq_><}g7uRn2;Cg7?+S_55^?Ql_E$#^!Gg*xU$1CBOG z6<Q;7<D7!WrN4KnkGgJ~EZeg_;pV<)eUKTQ`WQj9^|64CnJRWJMjf33brsr4%9PvF z2wyG_A*3X?kiimam_x(a1gin$pbsUqvgk}Y0EXZrES(MwC1L2TP+PNO8rf3A)8lX^ zY0e?D=)hw#-?^l-5pL|b;kddSpA=<vP~+rS97t<!JXam_Alez_Ni$_4H)-6YERTBR zh>|H^UL93CG#VKzit=;}<fd_RjuLq{A306Q!rJg~+axwEhD=~|jU^?NKrAd4qiK%v zq#MX7M_>G`5Q$aXAreo;9U}3x<vv_jU6|Y!W37>S8W_mbbvf)SPs|P(gU9?c#Y%~V zhIxJ|Y9)mjoT_6ru=@aaHO?rx(S45EPcy+sQlBy)kZ>Ng9}|%NNrf#Q+!}3=pAB!3 z`Ya#JvzD0!YIK5?9*zN)f|VWy8t1!3?H88GCGAVLO`Ou)4$}(5eDW4a`PV*z1w~8; zFAlwmUt09)@DBopm=TaC6NEQ|Xd5uxCwd(LpMsCvKMU}Xau(4mNNeBd)nZSTJm9m- zCurEVl4Shi(CeB&o)8i<+kVC8La&M+%0+A|k!IL`J<%&ikz|lvl37six}jIF4dMjJ zsbR=U;PpbUfSDuM<HTH$dI?MgHmB359!12i3G5t1@Gb+aS~r;yhFY3c+Vl`r4dmJv za@`E%dYq@PB639{!%r^;xdN!SBi93gTn_|tB?O9k8I-?(T=~5<JHUwRAXk3UZDKv& zT@$&QJ$FH_IN6G!TI9O9fL!%u&H8}{=5ELpkVB=>qm_C=e;Sy|rX)QPjx~z`QNj5w zMBRK%LR8q5`PU(k>Sl{nH@})lmC1&YswNKNh(N0Dbf3x9^xgteO(P1d%9xVHXC_mB z>ZOEKH3``tSY3aS;1GlVIu+F+0gVxy$=U)~Wf@RojApz9u=)zrCxO*epFO}T5=rpG z=!!-nqquFsDyR`+W1y29i`6R<uQM;$1FRw<Nxc)SuFG#@4ps*{!76rDhOodY8x6?g zdV$rH?^3WDle}}3xCdBWZ=2Kws~dZRRoJHVX$JvTbqYa%Rqpl$Rykzr#e>xY`vt29 zI$(7@fmPJkB3O+!yh>noHGx&8rU|Ux@ik;_^}(vlW;!O;`N68adVa8~Mo^D=nejwp zZe3~2ttCs-a5-z@jk#69UP_w*Ft-w+oFB=O2}sp(l}pU6E8b}1Dg32<7&3{C%beSK zaY_Y*2$>OJGzvuM$u)r>0}-m?dsi~=RuZ@ul{}JAwTyj6)hyLFfc5Hr%&o515mjT+ z+-gACRxb#5JT46xsjn>!`c@h68u)n)lW1dZJuWB{fzbo7vTzmVR-f$Y$O%W0d&(TE ztFi|NmT0bhSzWPmiXjqiW%F%VUCCxQt82NN)zy_;u(}Sb<0*LOB_`om4j%%4!GKrM z`iQ+{aP~-Jbv@uCRp&5P-(}Siao<`s53FySEBjdo68)qI<cbrQTD9HgdVq)Q2H=ux zu4P4FRN3QEN!rU4xDo2LHdm*{TD!#Ndc?>z-t5oj3bxsfT#rNzjzkTPL=BDvaxJU1 zu(|RZpFLHJr4bq_mf$C?QMG+%<f;#BDmb9w1N0aHVlV>;-I`C=WSLppVRMxiPZznO zKji}p#eWDOqc1_O$>s`Y?X<bF_^s58b{qM^<|=z#*j&{y4yxTfN$Q{ht<Y`*Xj_|W z4DbpEnW1nkKe3rS0!##uT^5VuS16P8cAMt?U@)q|Nm7e8%?DbW<^y}$G<A|x*fj6o zuTArakfOTAHcb<`Ytt+jkRo+M)?lz|aH6c6P4g2{Jh%-e(%O?A)$DiF6``V$zKczB zE@_gG35l9)n&l!)WFp_SX|9T2+}$lq>>kLFY?`~&XBV61uJu8}YuRi8wr;CWf{D;n z^)XEB)&~m`%HW7MvorXi?St^B^cA<KSQ+Ee9;ymxg9mNVEJ-YjrWDzQ8L~iV5c4!# zj?IgYWYJ8I8;hoZs5Ra6Sb)T{NCd>}rYxE+=}cHOkF_B2Sb)SeSu{607R|F2Tl8&> z?5+gJHW?O8pCy&DJlI+^Q@()2gK9^zXrAFK4wAD)^DMSa-pwtVP02D?ir7t)x*&0G z(S(7;U^KtAXhKdl#I_bq-x(zOZVnPXI=5LgH7t-=*bfs(EW@HH?r|&vZMB8uW^JMq z1XDAfk8DGT?(w-fQv-n1PPo&YiFQ~-h|z!+A+on1qxWT^!BU#cnF{6TqfI6(@Oy08 zoVkKAbGbQ_G^h_c-sa4e)|`o75$4SAmbcJrA0eWi8*}D<(IH*sLFILB7KH<N;ZkOE zCT?{*fY(0J;b<DB_C}T&9g?Z+g_I+Eq4<IlsWcEqjMZQ-hV%l2T|kGHc!IDj#*<NJ zF&?M87mE(%D<IaG5&+8e>MX{m>Ro?y=*9SuimwDZ+`cA%z0e_WVX~)HGcCR&jxHf) zW4->u^w=B@(ytcPX%U|LtGTr4Hk)QzjX%bSe-)7-G8v|NF~|@}vmF_(1~Oc_8s8$r zv>LyF4DAzQWaztVB11+2pl~@d+<i4($WUL_a@&;Jn4v<JAwwIbQF#|C^@9E+o93lt z)9kG4&TX1=2<X-K1OdIGZ-b$iwi#ANf;(5YUqvKnV-vzHt!_hwc6Gb6OgLLaf(J!1 zV?lU!|29J!ybKIF)ZL<UjFv%n1z%cHyaxEfI42&ahhG91d<E*0z+kG+u3&J!y!{|- zxg8ARNH6r%u^0*r;%c)O7)1Q=k*yxFSdzdXhXtqQZG*wVPB6G*dAosR8gO3TeraHE zzP!B?42H$<EX&(_fWcwgq%IhoTMXghonR2AK`TNESqy!bz+ia%q~+~Bz~Fp&d%s|C z``Y%dV6eNkJq#tWb8R~s@G619Q38YPQ%PX(=C2`h;q8+4z4}Qu8?>&Pzta8j>CO)X zwtVEK{cWq;JKY`!2%R`?0%M`fD)Ri9!$B<^0|yzr6K3)W4mxyCEF6ES=Lpuu)(9Vq z9&kFSPQu7hv8XkwM)N!&t?+`7w-8$_lpMDmjV+4q;K4HRpqG;6#k5dMIcK)Dj3sAk zNdySvK^dvi8vGm&_V;1ar2N)*)Nxn%TzJrU?bTe~1}2BKaDZ1Y!cG;#0>R}t)<R4b zOk=NMi4>(15KIO&IcEYZTIbC1&NVA0oE!Ua&IAZ*d0V~uC7o>_NYBa<H|ABye@F%v z;|sgUAHs7Chwr^TGbduZgVid+Dnzz+(!#;VUYvKPy?~OXa1blZ7!K5t>|Hcyf`F~1 zFnorVdS?b6d@*a>OYk6TKpF;<sKF#^FbPW`=kSH4kl#9{gKA;^wX9}um!|N>gT6B! z)CaZ{F7eJZkM6R@y<Q!YZaAio7rir|?*Rz)=^PNkT{{6`a?fO}@5?{)OFcFSEpyNm z>)Jt+enprd62eV0w=<Ma(8Q`UxiC2<tKp@G5f;fXN6=T?sT%i4VHLP=yD9N=y|5*I zhWKNP#>D54QlbF@=egdV=0sjM_QcO2o7VSql5Ak)MEtHEG>mj#bYbLRhe5GVMOzU0 zwdf>C8(Iw6Iwc}Kl0gws)HrQgtS6_<T`=U_X*0>!#&;8=fO>erpeS$Kj?-qskf}b# zkZpZrq&OK)l9m#Zl}Me>_ry1-HST}87jBZzYhfYzNlL`nsyHA$uG`dL|9+Ck!>S07 zOiRzt^ukf{c<U(nG{ZztJ}nX#i;K_4J9foqdew0o7P;wK7Wvtj7N52kxmRGwckV8k zGT*iW{j@&BuiVx}a#^+pO$EZd7_R9OyIn*%H!r54Cpj(#Zb)knxCANjg|nEF$K(Q} zT;?$uQmErGIp}yy!V0mOw3OygTFSgdm{!E&HWQ<HU~XcBA1B12b;7xck!?fzM@MWk zF(RA{VUow>V3~>0E<wg5m>8{rU!uq4(5Uj;<b?2biYkG89%HW|RLPuGSa^w*5k_yV zj4u{dF0nF-b6u7e?_W`;$=3#|T#g>+rbRFa%ObM7;V8J&W3ppi)IOk@+{pt`%3~7L zvDqNX{drAZH$-{Z7RDEYD1q)fEsVSG_h}JjvM??nO7<=%MCrS0B1+i_wO@Prejj}Q zIGuSHM5#}&i6|i}ICzQM<d@Ke>aQ*=n%fv(B68ejg#20qkjW020HjI3JAe#3<N}0* zj%h*ug1Sxn`S<I)xVdv4DDX1JYz<gT6L$iO5JY?tv$3k*#cWILkS%8WDq={;Dond8 zhO}H*jv>9aYYb`k#k5C7du<jm<o;Hs(_Whe4C$q5Z?<t+yJAS2BfGn8KzXs<=2{rC z$#=d$J;#t;o1`&hv**Sba;H_23N#q9F|@uq7&7F}OT&=cEt9)q$o*O-4Fz5m3^_;` z61e|$iXoW_yw)&e;5sDEH!PDK?J&1Y65K~K@mI<)iGdOu(SmVuwmSKzIi@yEX=RPn z>htn_;$Lgl$U`q0J1Qm~D7m{={2SKD1xzWl^$lwzOWF%ivP+@_Cco-iw!dMGl*n4L zYx^74$ZuF9mpeRSSL!%C&i8Nk14$B>3LWTZN%}*;&$S;W6p`TNlYNKCI>1Q>s}t<L z6RfoVXPFNPr-@2Ypk<~#d4zhx#o})CsB*y3k4e8KljX%}k0b@@dB0VcI+iY<X8KH9 z|MU92oYJLVdWsF6vl?(XRAOz=Cl`XGR2kY?&c&GK#rn!UZr`dvZ3}NkyT0)P4WIA) z#x{SyQCslYoo4vnuveZan6b*HgDq6K-Rt2m*%qOoX4IKOglrJO$GH-DKE>*q&aUfe zWq{w$a@L-%zorvl6#2NN8_lF-mis=X4GsCF`lJqa!Y$Y*Rm&jG3zeeq3C}W#Ra~*i z&>t?zRiVDgki;~gKDp&A6dbF5lg#9qB9Cw)D}-e#H&w5UKQqop(aD4)%#`O^RG1^w zbi#v<BUDGYPkbJQ7S-RxHXtsyIz%NTP=(4^*n|h=+gYjs)F%0TLX7@|Xs1evdj(OO zn@=p{raDGA*i#h68F@@E&~zf<DL)Q!iu~*%s*Dod`NrpU6ec!nFtT0YhoH7lK@J+% z1yAO%_D2*kp3@n8BHGSabWw^?R9_;O>ch*bep7g~BK%X=ICTX3?PLm7xamzQj@Bkz zf-)l<wQ0d3qPQY*rn#v>yyN((XizHQ8hHkH$xoG#Xj=A)IzvD6D{UZ_<~<IQmT{{% zXXL*rBC7SN*=h!-w`kC+#p!DeOKzbIE%6JYApj3)ghb(a#rexC2b8yv5$+;z6N z2#sg{du9v+zRnqK?5!dE3}c*+>XBl*^*I*Kqh9V?!sZ2|R@<HAo-|vzizIRb&f!$3 zr35tRVdR2d5A|ASV5Zl6D*{ufe4f&P)!8;FU!SAH*?U!fFVB=PJ`CPCrK(r2$*P}K z)z7>ptNtcc{npo5)m3Llcf3RAjV|MKj*tt!ZaH0N%vl2lr^A2ZbUb#JvT|NYN{Q1Q z-gO{OCu-_)PPc;b8obm}<jgrq8Y0E_!0CDtoId`QLB5jC{~57W)Mq5hlZwO~CZx+~ zHk4S`C_!vku**e4am^U?iib!dEvxzys{rjVLz)tl3!%=Crd=hjQso6cz`JG*siYNG zia}q`OIRfc<E$4uQkA`&aWKKt$oJp~fxpFDPdGNKOgvvENb8WGX9Lo;erXCpTwI#0 zObI?quvzYvU#dZWGA0+f9`Vk49j7F0a~vpys6o5XaZpGOXh{=U_BIiqA~X(p$;C}g z<!d~HX^op8TocDZA!zU`Axj0Vvp*T?3mjwRrdCNAC22$;E#amFp+qz1p0br6kfQ4F zk@SV6FW*VK67AQGV^>d7Lam;VJ_$|4XGN4{eo#2E(G-0^A8Khb^#GFo))}o=-}1%^ z0XiI~^SPWPdnk{?9`CHF5bdgn-)_!)I3mn}L`Fn6n~Al74~BmaOhFG4s!kDg^?B24 zLs+9tO&_?|pwXBwR@^eSZkS+ob`Lcez-qn8stLyerDCuMg;5voB=G5JxdT|4_pMv? zy=BR0YW=R&Q(+wOgbhj>8VW^QWfYK!P$tkkar@Y3o*d}*)b}bNte7C!w*V<AwT4Mn zGvcJ&rm)d8gAXXCMWp~CEt?3{kw|Bkg<7t!jNe4aSOWeQ1z*G|)WE&y6`5!}ev>u@ zhiB4Q)Bx3qP9ERLkNT5;?2Z>qtrd$`5r(qy+anZhKKU*HvEDVX5-Oae0$eIXF)2U} z9-9#Ac5*e>a}Iy=YtGRy@m1ULe_!OQNn(@=JgZt9kKuoEmUgw$^merxltDG2LOJ<o zIYXhmnQqSN<Cp5=@4>yRoUQ~Xl9LXjhiL3I0wq<jIj~I88sSlZfWE_VCBD?SzUu^# z#)ylm`?p54XyRz1B$)LS{f0fnl&(>DbEfVkpgsq2(=&7dJ*Uv+yvc=7=@ar`$GSSF zM{=-^1J|tzHE6BBcLH8qog80>?rPXn5vP$i)RogA7@<591FmfJva-x@5(c1X-V*zF zX&$gOox(OA|MWK%lL+KXXw=nHSuI1H!#E51xI1Zn3NU_}{fKb&DK0Q>rIRuAPb^l; zmj^0AJ1*Kqn3DEsKfab4DXa1wzy~d+T%?-K<H#QR_i3KKtPVYOfo3Dl^6Jp-`Fj;1 zcvW#<OZY;P$UKL`gZ%HVsy{oKROQEJhu{0XP@BgoGd^6!gsWte>ag+~*T-q3!Vu7_ zE95hC08%DaX;ABqb}F(pdq4(eGD7dtAue`Sz{*H+eYv60#9<JKO_4$vmgyAF3}B&= zn5GPt5kK^Gu7TMJNve~MJiRDNzMcP5-PzB5b9Mry*ZFu|zoj$!ch3%-(3vjCIi1Ap z;CaNrB*8k7eUH!9#CD{Uk0czhCf@ML#5{YOI7ifBv!srJ$NEgPQ$8xiJ_m3m#L0;P z^gZkNA8E!1f+ab-+lj$g6`q6%)G|xX6iLo4;7j^ddqLH3F!_}_BcvmA7OTa1)Y8)Z zGiVzJ!AFJo6kRJ5Gy~&Ra@}#{(L)qCIV62UN5J;#EJnW=>7?X@WiutIFk+H7Dnf-r zpz#zAAO{?*|2nU@P2uqBe0*DWl3J31&yi-jg_t2Zr(`N?oik0NnK991&6xP5s#Ij< z`VmZDGjI}U;~fdSaX<-HH0lOyCkMt5pz|#v$Lg8v1l>+&;LSI&UQirMGAUzJFdTxt z)so5GJZFINNVGa2cT=6+GTjJH9FjA`TvZ=>EScp@gW~li&<Pfwc_fJr^O01vBZ;%M zw~Zvuso+_Rq)sN?k<?@sBMF|KkEEy$p_aITBuyizrf21%l`D+%yef>agc?woF(B4Z zFLDbolU0Fku1PT&1A)-rS_XI9dTJYgXj@fifWKq50Yx1&z^&vPhB*D)RxGv?2vD+{ zMD6=7MvgQ#aDq`P@gAa?yO9B}W|atOB;AzJ7+kEQBjNO5Ag4-(6B6LxBi`#Fp2ejw zgW|7K9PofaVXjcn0X2)4J?suLT9o17-y^A5d{%_@rZDuI6_J~3XHA3}Xu*y~2nfYz zAbB1?nvGS3Lgg|HMNGhmwX14Pm{d5BB)zGJzLUUw=)X0NEkF_oTX7Kyg!ITn_hOy? zTZB_$m^nqJ6yj_8Oj^j5=MkXTrR%ZifF4`BEmQ7-Oq}1&MsJ$!Er2>TqgoeJODwMG z=yCcU?!s_Gp+<U=TSd)DW@J%kkyG@Rn!2Mvqd@xzxg*_Ns1UU`MMx2ZF@pin`6q^k zY}8G+kSAeL)km)kc&Q<M1GaH*P_3SyK+?h$Be6dpMF$Lm$ZFU+@-y0?BP-&2XQdn< zK{53ybY(O%a?>DiL8`2{14)}mN(OGBu4o{H8Cfj!4=G6=T~o+9n%F~?5eXAPVJ82I zDv9J8b>#Tsi=zfEP8-q<aklqaw0ho{;14%)-d(9Nsk>-J%9cKJ>nX(R>Fz1jH}zEX zlE9ifr6p<fABu_wiOZw^f{jc)5u{cj17iQfdM1ctJU9KzRo$ar7H6P4mvqz1ryGUr ztDE4(>%kSm049JL0|MNs;cbF8I$W&b@ek&P2)5o;2v#^4ot=~zquxr)Gn`RK^kxf{ zU99y714J=-ox@7|r=>GpGjujGGNTQE>{4Ugy}p=$$t2}CxA}tJu!9TyBkk|JPgN=j z-8`yK62Js{IPa|}gU4dzB3^i&;EZO2X=(K+;p--efiyCN$P$Q8h>T8FuHbVaGO39v z^XEAp3%=Tv)H*RE-5k!X={F!wi0mNXi^gf}gUA#U1iy9?0LuVZ6G=AGB}9f#Q$l1s zGa{pZq)v>;*2qO4^(24}1|sVvL?*MRtjp#LA+nNDA*My*7txz;K|Iv<H8p(J3q*Dr zwToH9B8Ai0tAQ~XdqPBFW=cXAntgCN#YK^%;tj%FJ;R?hQ65epwUm5%(bo)(3?;Ry zUVKB9G^V8+RfPhawxR@d1HU2L7(J!_fkpm$t1_8Lqd387XQ(?FoL1KcSK2z1xN_8T zC9lnu!3dDq$&@L~J8}#SGok>j5hlV2vgvK`r0|*e&QAisZNQMSjC}XHPAXt7MvOz- zuLHIT@!-8WM?Ane5o7SNfGq8t<bB^~L|5qbDS+L;n9gwUG#!!q{6bNidm&IPI+Uj% zk92?rg|T48$_BRT@;x)VTXGgD|0~{3=WC|JJ5J+%&rF-DIXKP64xZO9BokGeTumu4 z@tFsh`N|TpP_{~@k{Ci{^pF_td)|#to?||BCV+HIRfVBZWJ8q7O7GnWz+R^GmG?q{ zUlvVFdc}%bHl8xyqYwu=S&dH0#=l?WeHkHi$R@{%PYZ*lFh|si69pro0Evj(2r#8e zUBon{F1Dyj`R)@l)M{GK;*)pk;k%%qyiJ*G*X2W)6hi{`g-^(ZiFS?gjkAC>mnRF3 zJX9`ejcJ~XO;pl<-CRlz5fZsr3A@qt<}fZYg5G2#_F1eB&pE)_)e-3IR0rVXnHrgJ zi;6S;3l5~0w<1gB*R7cI%Tj)<Q_h=*7@%>g?wu#b;~&W4pr3T%j322$tU4O7m=$%w zOr;B}54xO*%elB<(9%Op&AQwdmj^1cyQR2e%sHk#{VB))U9ae0>Ae>tRsO9-_KDfb zhji2X#BBVbCv`Xa#BA+DPtI2F_~}3W)hGY#x1ag0zlnIfBlG{h_~z+Ky3I1I8=^q_ zs#^Vr*ki^Yp2B3+%7=BNSGD%xHu(>7z$AsPh)*yH|Ch6s=G_<G{NyjrRzH+dexd$B zcyINiWbLu^s8qsD?_rc{bMhlv00JifVaW_IzmUnwVkRryOmbxcJ6@>zk6e&xnvAd@ zjkb_ULrwkrB+$dEub#~AIl;k>SbQj^7aYRWM?;YM%WjBp^{JZ5NYzv2sHEP`7(ZJ~ zZpfeXvMo}IiyIqR)0Bs$bF!(X5aMxg65q&V)js10K%U7wJAbBh2rAk4uzV9qV@u<8 zs%{{cl$r!G<hKc$m(CuwVk`fYRLY^Z<*z;7d%h(<Nv=5SB3`yB5hh|M>1u>vHvZFo zzJ8@h7C($Jnvmbe`gd_AJ3h-EQe!P8(1?n=-G2*&9lYftwL@RuFObNavj_=kSpGjH zh>vSVA*^7)$fZWUMm_5UnMkI=RbrEsDGWe>n4heQ>=!W6aY5KhdQ1_|)~))6<PzdG zy){OQ2s3Fc%Q%BXjed<ntF|oRTyl;5>~{QSlb9AG*ux{EAZ?Z{72co>^@8z=%Z{}X zh^Yk&6fWI0IjEv|6zkwJg;U$~<qABZ_A5!8pFO2+)4V(n*+npvbY@!J;VNB#V)O{K zMi=~$OqC>;-FW40h{z>PiFu5>!~rh&RjetIJSy0INZyp!>*mkCTl(UTsMkXNYJ<9n z0QH2@0AIugT=h?02||$#7B001F(4-lh~}+;p*nTc9cxs4r_NA{F=vRzZ=F7)-)rf& zDhZTg+~`8ba-oxxnqTXdl}d_yGBqx~<H8{!q6Y_61Uv}CZBPg6BKiRPfE$7}txx-m zoq-gONCOUlif}X;UZg_=IL3e8FUD8O<{aqWsjM;boV+<ZRp(mTk|}exp##*|T#Rw# z`{)%01&&ufWlj39S`ScN!v;D`7Y6!C+qTf2_bRGEtW<o=-#f$i-QIuf`(jxh>0(7Y z8+hT3F(Bp=wHOURZ1WdS#b1_^!C%0DjP|JarQ{jV0i#_86mqo>G=^S=)`2kfDoWM? zOuaMJneN?qhsJER9&f=zye)QlD?UGPd%4S7$imy6jmUsv9X_T#M>4?I|2k*4Xa&GS zq5*p*_u|vT`G|q-VU>dOM@fx=o<qIg#;DNpX#LC|d6QP3^^$7*(9@Iuuz)ZKo;T#D zNH@Afs?p_#fnepu`u&b{nL0}iFd@2~^@c1A-QCV|bd0vIJOu@ap<e4RAdsrz<cASe zSTTfx_`_*&xV-R${^!@h0UgqPr3MT&N}OaQ7FKRvnF7?Q=j<v%I~Y!~JM)J)c<%WX zVGQ7d2A2$JF#1rez|m1U+O#*h!SSKPp1~s>a!2;0w7_8x4!DCko4%I?c7`y!8(hN* zM+}VeyLBQ?FC8#Rl8fUBS*Vf?!b=ar7P!Tt-dKfb(x7Bp>9u*zv=|>$9df^g5C`*Y z{98Sy9{FQ>bY9|5W@+YxlKd0(vxKaF!FGD+Rj%{Ylg4wbYAk?KSWF`|gGrMM<`B+Q zGcdkYGr2H2IZsa4<3g;;@oZd9^Ljv`h;aTPXl3L-ZUCkMd{P!@KdWxbD&4)lJpIN} zUvYQV*(lwuw-mR=vylq&TTP;M#{!>vSK?q+&{&2f?L)vIUuvqS=Ys7w(oIr`vzSUU ziTK#$3t-pWBZ7=j1-E7QN0#^9BCH2?aDJbXIFbD3&s~#yq>s3JK-8(3Uruvp4EYfJ zT29vL3e^PYia-=<hdvgJY<QBc^*n}7Awfz9!l!~-Vbu|g?KiRB%k0EpTT8N}k-=XJ z%1Ze9vU+1##oh7LlMgUpsQfL(169FXT75-z^-%TWVPoe5Q_(=95BSN`8vew>>o90H zem>6!I_rxpWR2qjCy6b?=Rj)_1$0KhgC+1e$f#Z+yX67ViM&N~R;`ha%;q#TC=LA3 zaEul7w^p=ulO}S~-hZAZa<*%UUYdO5@-v_<GT`SvS-@oi6oe>+ygZ2$fEjoa2kHHp z=GQ?Fsvk_-=%s}<=0}VCF$1ftUX|n&UyEB%I2O<}q$;1fzyamLRxHuPVqO1Z>iOa^ zV^Q;qP%D%1{~i6KWM9dCRP3DHKK!u{2!-$@|Ix8P7^`^*gYiWcjG>jz7p@8)lx;6W zYVg$Lb^2odupwy@1|NGspF9=vNa=C=cpW83$cymQBfP};$>?;AkHhjGLrV)_vf8IL z19NJnO3V6y2GxL<T$6=ra*;xnner5J;MJMz0Np~_GR}%`MmJ~2)Vm&s63dy)+x4@8 zlzIK}F@pa)v$Jr?N5`+vvNvXwQhzvZDYyRnaeJKGpO0HcLH!eP%Lu98AGcIh*3ECH zB9_sNqx#z?Y{!kYs$BIrGAnM&PEi%^kIu^5vTuPw5%1E0|DWK5#bI9m(wb|6nyx<- zw<_r8;x-j@l!E?_2C)h{+7_f<s0;8<P0q}7suD$zvVDA>?fd81{+osR?~<*ESCKPX zwS0J1d}sbT7i8V~qd4@UQ@#y}g&{4Y?<O33&ieH!fp!FrM6@o)$pCX)se3qrUlJ<Z zY3!4`gc6a{EhJsww2aJFPi0zrlXO5>;u4^*ypoLxxz5A<Q)<bM*Q*FMElQQ=i}QXr z^7<evdeHZzBwJKTi=i_ug^?Gg$W#|-rb^g`gsvpKGHm+KIgOYU*qA`XJA60m47*BH z)T@H3o}3O!4VqYTW2A^)niVlVA*D2TT8%?wng|S1kwZrWB7n+*>Zfn?1zr_~0Xj+r z<B5z;o@PXLI{nX53^2LWHOf*YzIr<&Umin<EKJeZ+D20@BDxln)&v*uP(VzIEOspd zMapl1WNv}A)NulqY;%@60Ex&&NE&A+w%n&I1jgxHjwhjyAptU}Q2s0)(=H1v7V6}^ zlbofN_+MeGBU?HEK&1{a=+a8>Ktr4_J@r{MZ#6}xva}j_e2)85(*=;C=@Lx4_A#kE zJ4naFq$7Qq_`(}w8YCA8n3PVZqKp;J{NxWWSW=b5vbvc3ECSQk8pM?tPpjA-n`Qlp zb;}{BQ2kA4E=)c;xBYBlyB#;xjzn8BGR#EfSGWql(8KnTc#2fX8=<WHd)jRYi; z^GpU~$r#W`##}Y!?HVExUaiksBEB%bIirLMvGT<b4U&D&$E{@F7vfeT>A3~jF>NX( zku+^ZQq`2R8Ra0le|>%O?rGj6&!c8g4it<w(unlJf|jR*5y+2<ny$(<H6*fa#A`I= zcw5A;j<0hO3mqq8w!90*KURQ2tV}SHu1VmD-cT5vMnBZg{tFL@LQJM*jbiejqFOz) z(HGWJv09nQ-aCYY)FF|}2yh}}G6o3wet{{p+5nu8bMz3dA8bv2KuVZ9pJ@$mX!Ifz z&~POJM+1>TrkRav0Qc}|tUOW6gSIEc;DIycaR_vSb5)pf66+YTp?0$doN3sqjs6;Y z@FVq2m&gC@7~fI8x}r7jwAny>gKZT>blKj1*+oxz6j|q@WTRR0tdQop!tK75<zm-Q z#wK2eP(G(o(u1_HK|HsYJe3vl=7K>~xZrHZ1|EHIQlCg*LbbZsB0rg<Ez@Yi49m7^ zD+fF#R<&lR)b*h)TZz%4HcEpL+EnCviY&<{8kApbJalXH1J?YDKu#<w@|hTEw>un; z_CY*NPOD!}fd{+a+G>QAf^8MEzDZ)#IscLhO-|D@I$P6>b+#q1*kz^L$5ga@S6XNb zE4{vxK$(+Y?)^aCsBI~`obYWw3ZzT*9><%e>2m^6P|ga#`RJ!p^GrnoEkH^Ahy+72 zbuw}~O|lLV6ARBIIOvR#J0sOp^;)2fe~VE<UY*xWrL7kqY0fG*T@77%w6sX2!LZ{Y z-)&=oSYfy_%|)SJI6wFq{qLl7e#0%ILDWI~IPZ8>kY5WGY??cTVd+#aEL@6}673}^ z>;7dM05lAy68@%C5hX-bwAKKTT@QL+^&lU(_N5RC1z%&Xb$;c$8ChhzWpSfr2<?P$ z+4+rHF>x2PW0ihY3q4kas(9-@;42S{vDuBfUAc3%s-;?J^Ddeya?OSw-2yG-uRg*z zyW92|)`e=oR*s8ILs&h4zO-H>>hDO_Z<9IEIg2#LyxbjDB`m^zs!ta?r?1YLC!hev z5ML)D!qnYjGGHey6~d8+o~WhjoYlSqSS~H}6?4pmpwNsFG0Pfq<ItS94$bm)PY7*} zwJ;oy5#+YUh!rePT_l+$zh;D0njNy*Av%YI13*Z^0be*iLW`iiFm;@xy8W&vGWBu( zP&}j$owhidg_4>H9JyMuoP`WLhGWN{U1d9$`*ep8Z>gJvxT)I_;;JN+gKjNZldu+H z)n7@7BZ}w3T~03&;#|~3s6uT7#I#=QWj8WpfQsN+)3o4#M;Q;S4oX*;Ynz>U@H=(L z#R?Cx;=^mc3x?OHW_Q|Z3e06&!}&>6X-FikK;b*&y|m+O1^(^Gd!&7}GMCz@<5u2x z2UIwgN#0`vg!jdq2;jl|OUgzK^`(HWuiUqYR>{=ba-RXqq7*%WWEYKHHxVh6-kb;) zQ6dB*WIn)>>s-^6B=gZ{n&YKBh9TE%s$|JcqAX;7dO>QPd!JI%A4#S+6aif`Ad*bq z_7FK^hCt$OsbcRw5rv6CgpqhVr43U^EzMw#;kP(OtyRfQJ*RVFU0jj{L6S({Ago)) z8j5{c1NYZRJM*K;>FNpP4x!~P7mdOul;p2uc*BnJI72L&A+24Izl+~>h3iPdl?J@4 zRZ}yCxlPrS+^z<AzI1Dgjsfmpn)MK`IY@P$oRQIKmD3?#l}?s8<+&hVN0d{9d<7+R zx?ifHk*_I%z6DV&$k&ACkPVFOj(jau62LFXSD?eTIW6RU4?s)4JTFGRLJCnHIqM=l zX_e4uT__s)O2$gKAYU5<$;jAEzA~`&8TAU(VH~ojMEy?=0gE++;-A|6p#D4nra)Ag zXlA)vEzBC(D1aL>ld>9G*|9{s5>R8F|I6t_OQqgi!<s^?i{_ha<mc0-hAdQnvXXR> zNq`o!JnjXN<l`5cYfv~&o`@92iB=EIy-kp&w-om?HhP$7LU{-;P-#tnJx&(nb{d6( zzL7sS*cv6bJ7Yv%vdtKgEW(w8X-@YWx$?L2NX4<}11;J|37HG)G8BeF=7pdkXSU4c ztrQDFLDhz=`o(y*$B9;z8X?XbN`~qdpCPzK`HtW&7aC7)0oz0gjdQY+_(;XM->tZK z7oIPG88u<C0cx*Hr2&n)SSXeJlA5@mbOn<{Npr}WcJhK3G%9oS84t}kY%#LgofX!! z#|`>O@v3VXHTR1mkemLXLfZKiFt#CVQvZ-y$hSC8fhozLlSE^e%GW}9qPE#XW55hD zm%^E-(@>xpBvJGpv}mSEXv*kHY(jD@@(yOz_uWmVE0Gsbe68SE9uO00vo_sl7cU8V zjWx&2^;<6qK+X5eSaIxZWCL7@i1O`1-?w9}XmQ`dMz+J&Y-y~q+^rh1Oztv^7;7xR zfpcOboAsjvl5B9RQ6uiWTGwu5i^gyQi<;AIiAV5WEdj4|T4JlzOKr)DTavcqU8^PX zezf^(TT8@SZpRuNFNsQ%d;+FT6D$Mp6}CFFq8*3`8lT1w4Ut&cTkj%IH0yySABvSS zjYuy=G(u%}#e3yW%Pr4l5C!i->B}W;KB*xKctLJ$b72$AUR=6J>Jony2=f-;c@I>r zC+sCzTQO9ZUx5uN?CgpDJWhUyUG@_#=2xXLCS!022RnK;0|soeP<%DekW8xnfusn- z(nHQ7XjWT-)!Du5N2C%A0%v^xz3hWgT`J6<>@CE^dJeU~#Y!nD2u(>^rR29~*$gaW zN*XAmMk#?fNXtOsfY@rK9Vq>Fpo|c>ZR!Kuwo0klsEeb4FawH8&W|j2C+A0YgldW~ zNJHctcN8KHk}79!U&f+524UFi{;Kr0NXfSQY3(`;<c_o|A%O+3xsT2p+cPH7841$b zcX(Ij3zT&S%yOF~nIFz63(g42237Bo%@uHIIXabm=@J=prA#_pOk{XW4bGD^(rgJP z<Lz1O{*vv89g1o!|8HNHBC|AtG}W*r@?07%%tDD!GAA<9OB6$nxlCA9L?-@ul190f zKv)nXnLC_2Im;y?d*_I)?jo|p(7iMi-jVJo;rVFs{a{}zSmL#ysb#EYiuv_l+T;B3 z9v-Hc$X@tgY$MI;=QX&Af|AeVj><5<rT8?2wuzr0D7hE?E%-i3k~^)^Q9$ewW1*Iw zN>e^L-<f^%q0TGt1XnWV*D%(j#HHvyInVePJLNq&fBd+IuHen%WI=^wJ&1BtJ)xSO zJkMMMmb_9q6loT$pJNjD1f*#jME}kk#A6zyjQqH%4v(MiJborshsRHL9{=+E@z46P z>Hq<dHBhT6W;he#>%><yf-0m&s5DcP7mvE^=GQ|Dzuvj<>#lh%?`=PS(?XK7^Caim zB&X&NPqz<`&mUr%NMm(v{*VQR^l;Qv9DAYb{RSE|{$#0T{jC0U;+fOM2g>=^kHa(R z^Dh<>n`-zM;TST|++^N+By{f;P_EE|C5dbXdDVLl&QcxJdvFlF2b=#z?Y)1Ldhdz0 z_rB3hp{~BB2HC&tYf%el{_V4xMH^h$LAK3w6x2!JEB;9YeI(x)Wm&)I=l!y;X^>^& z6M5_^sPlj~2w`a%&&I5pt#KF?nu%Fod4FOS3Rmi?leV$bG-)y8QjV=PsT_^>xxugj zQNlsgPznI~Af*_HDHS41;yx>+;%bQ;raYZ*c2rCjp;xP7g+ZSxCK_L(Vsrb}OQV<z zqmcbjY+kWzQw&>}RU6KW==8)sb*66n6(nVJUsEa%pO7BpH=WsG9&VLSRortzUp$i& zn@5WGo)fpAZ^w`44&ovG{Ig1?Jn+(BF`2(!L6v~UpBDYP?PaMQ(fpab4__x`x%mDK z`Rj0&;khkR8LR%~gkR;ylDA+=eTt%Pq3+}VD@VW4Uqx|V75%9k@UHkCfL9b4Ug`K$ zbEhCG*+o>=2`@PVz9<2>CP?WmX#q>ZyG2fanQWFgyujyDbIKcNfN@C`1K))IU$O}p zXJO&kj&D*dA#K-E6{CVtJ(L$(%(;eUt+L6+OzwRA1lHw|*l-Xhyk9MgJUpwVdgY`b zFEEJ1I;rmP9J~wdeV$IjIZV6N{TR<mEf??%Z_BgEBkuHtnvRv<uy%0yEuNZOmF_ON zAo}jST@dw*7&p-i+_TD)97I`dmnGzV4`4IJrAIIpq}Z3ka&f-O=*ap<df{2fcU1MA zkuO!fO6yWZAB{UI`tG=+qCZsdJubsL>-o;Mo>%j>qK~!}eRrp#KeSs#CBmADQfmzj z`S6PVP@kne9!&lihd<e(R7<KZHsy}0S8-?mOh2>ps_&>da}K%21CZ=UGQK;{1-`!g z`2g&ip0o(I0e<xhzu&wK1lS<5fPV37{4*MH;WSmc`x$x|l1>-r6}tqBpzfJI!Rt7q zXfMNYxi0qP5W%FJ#|JJ<zFABKz-JN_ADnAG*x-XxGSss50iW!$-f(I>CX11GSLse3 zIJ{EZ#_unRlHe=qDVZj0bxlDG;R{?&sC{_ev!IWZ!}DG#N1?pfKre>jdE<5+vqUCX zYjnUgCto>h>W{)>!DnF6kIjYzNKxkr{Z)gfs4(^*W)@0T4c|MHgK~U0z;#|}>5P>2 zv?K-_VI$9>wjgwp%eB8ri9Zk3#Ab23xtS(Im2Z+CDP==;#<D6uKF)*5&*kzhBI`3; zKK(zdE62aKRvd`YdLCOS-PKcqTfMgwe`;+pW#IZ!#fAN>dPv-CT}FTbO}=qi=tGH| zv1G?*?h$2W+D8HM6?G1|rP%f?8WlN%mTLEn{E(F*HW7%`rETyD%O|%;&S>dnI@Bba zJ1qRriQQhBI%Dus-!V~!?sQzFRFCmSJ0}$8$171#L)j`y5Tk`2n;v#X-UTx%&oh{! zlGWjNtQRCvA)K8t-#wu~IkQ7*I+n7_Q`pyt=)CX{kIIX)wT)hp=b4A9ym;7QTE1<) ze<Ry1JTa$?mHNxLg!V3Ir%{QgKrt@QbLtpn66B#NO+Kyj(gcXgOZDJkd1%tzUQ}r! z4K-P-yAl32C19ixrw?)7Wci6vKv;FrY$|cb&8GfLpdcCuZR6c8>)3dng=uJ6+ImvT z>Ql%=0vh@rHNBZSp(0<lEi>_UPq1f}6>#;0ERZ-aaiap|34!%tDDfRV!FE`@1#v~9 zA2faj{MUyBIxtTtP1~5KvNNg8gxsn6@*?V0YvH%3*I1tjWukTXXETnTq)iBOjm~v{ zONMea9bTLr^!y7}P|hjB8yX7|+ShWeIYJQ|>Q+5~Tc}4$O&JO?f(?obCpPOMk5Mk0 zae)i;i=uSF9HtASpP>L(rYMxDt0Jmg)cDTn261b`{~xLVh&hhfq|ouK=uCX0%~2Xl zogp;a4E{WP`v@-l-exn>;ioRVKFi=`I0n{?u`{9)jGgb$*b!56+?_d|V=T@1<LWTy zwj6rj_d_(ki-1klVH~-w@+Dj$rMOW$q!9zM?$b1OxhO^_QipYN1^*=_tv*-jQT=A^ zu2R+Mk(F9T%dL$f%dr;G0e53M6?KX&r6;os+|Jnlz;5VE_0>NI^6(>jSWbZ@d)jE9 zl9%)3T2s6^Lt&BpDuYPr_3^{$LpV)e^yXiHdD0h3;t)@;^b6%hf71EZ+f#8Ops}|C zYP<w@w@;-F^=Lc29Vzqas#uy{I|UnYIm_NOE^>C|a;vZs&CflqB!_u;Zn_F%;nXa1 znu1$F##K=PPsnQZ0<9)J?dTLQziX^Kw1;7%%-(#lU9o0uS0h6sfmfTCA7b~a_xICU z)t?<-=6B?3R#RVog3{2l$q1tLw9H+Hqz9DAs-hOmAF@3rJ&e5?s7x_>JOsI+CRWG) zpezP0&g<>Mv#Y_gBk}A?%d?~4S+qj6((<fy$O6x@5Fut|?};u{Qd<jG63;T;yx(l} z)T{`eg&3m9O7JZ0GS3zwHd{OgP#MCRXAx-9fqJySv%>|RErMs!wdUC~RJPcIXEBJ1 zXO&z$o09K?XZ3}6HhuA;c$R*pXU?L|C92u;MNbCDmgA=f#cIGFD`olKz?elxqD0@U zC8eC`w-!nnnY%`dB|N%Hna%I5QWlyDw;Vw=K_;!QNhxD+GoXTdwU5!bD|U<UCbl!m zs|=wmrEG6{JC?e?*PT<V7gPhZ!1_Cq<BrubhgF7J77MLOEw4!}qhl{mVTbU-wH(4N z<>G9$QOl~3HvDSKpk0NMH&(5Ub92315O&&nS>>Xa+u}6Uo)^dXZ}f8UFmoo*mR6cq zW1OX|Jv)>Z=3U>En87IMWpCmfMPpa#8R)mEKNB`OF&AVKDEW%wtr+F4QkHP?(UW2u zZX1=%hZR|(l1(7`0hOHk0b#3tIPU@Ch}ux0j2V@^`;tm#Ez5eS2L&@pELtR$tQ_(G zL%><^3@etdrRq@hQjsojP-XBUl?{bV?bOeT72>mfWuZVJkFAik*eZpb)+pr9LldD- zUX2s&7`2T;PN{jB)={`%U)C?Ykaa;Z>Vkb)7qKlDaRwJnby3I+%*Z+QQJN`J-#Z;e zcKpGDnD!75Pr))eqi1<&pbZeeIUD1N<7k%nb}PUjh+k|E8a<(X*W$M3U+PQ6vEkGC zS9tSCtMT96vlYCR)xYKghrJd(aeiYx?0Bq5k}k!u8Opog>n}WW92<|e!dv=~09hqZ zXM6+wG28Emrhqd58;}_d-=kP~(K1zx^<~AyE2rW?O&+Eh>o)v=O_WnfPPqg=x8r}- zhb+L7&k}A38L!Hx8GKJOcz$>W@5i3O`;O@)m_ctnd*HMBG~LZSZ^yPSn5o^?CI36? zotv|pYVCrowS_dVe{D?@qD&hUo|$iM`pCkbDTYq$ngBZ2L^VQ_7<=|^&Z_AkfK@+~ zl;y%8kcl@&3?^R`e?IqzZnUN~aE~u)Fg!j%8r0{gOG;^(JE%YM-0mMRkW~3W{SVe% zdBPypf3Mm7F{pp0+5Iu7f2`U40TNc!M67J0Jxj6=3xu+->5yVW9gre4iq~65gJkX{ zR1vYBRy^rt$O#H~cLhw~iGaTvDbN!GTf;=T#RdhY0bbGaqMs%TqL9EqthZTFQkc`L z7;TfJT3ITK&P!zh+IZ*jz>~?LgpnpfMX6A6*O`he;V#6_<o|%lC`ilN#0O$3km3WG z1!PU5nZBU;3CuxKviHUW%9%_>1Ggq415$S1M|}f)xqWHt^Z1trUnO>KdHF|z9ge}J z|0Wn%Z2hn1Z2d<IY>i2C&ekV7Y<&i{PV)svP7Tph^%Gm4f%g<r3Ud%E?Sgs!RmFuM z6M6?H=pv!<b2;*?UqAPMFXd?1$wS~J=KAI5ch5DAlm2|1^ylNGKOZOk`8c6LjxHL6 z!4pv9gxM(688qVr4~HmI0)0Q@gbx_%=G}IjD7Rosy_IBgREdZt(TtOU+0Tmb<%|;y zM~R&g<1c=Ic+=c<7$6T33X1*6jHsFzYG`qxuf8tx-N^lbUWQU>H?ro2S8>Ug22J~r z|IBePurFw0M{m@_OAiA!#z?Ok>oi0jKi(@2Udi7V!g-8#L7|?kSLD*Brc80<iSRSB z3{Z=KCRK!dP+UQ_IASl6YIlI~FI#nG-&$-=H)T)1#NMS@Sts|0&8qzP2XDnZLc{cM zc0leVly=`t$3y^kWK_xSrC{tQav>WjYQJ9O<#{DMPYal`N&?G_$E=Kkn-}e4tWYv8 z0M~?N65=37IqNow=ebBmiZaTY>sf{L7^qyCLO4d?AVu?1GoT^iooE=<;lFjgrjop7 zo-Wc5I%l&=zR9yg<oEF>Fh{Ij;H#gf*(AeTi&3IvyzXs#t@=*Yg<Q&NUA14YCV`hQ zp){q?v27_)M&2o-q~q;-l!&#_p~}Vu!ps~d0f(pi{1bX#!)Y9Il>_5H$?;|_#dn$l z%#yh<44*QM8e#%CBk+n=YHSb1vZsmVz)9j!VQSO4f2+Rf5vGRUyjB08_Av8=@&yaC z`my>kx#<%E02r$!8&vKip5T(G_+jD7?5|~6M$e0FfS2<X0x;G)=uBiqi~`kVc)RDK z62VomQREp*lq|~uucY(t68K_;07SB(hvoRsa>91)XzdE~tl6;BT4u7Rv&`#KLkVk7 z<N9f(0yVFulRj4scrUCcPTN=8<#`lsXGwF<wl@XhS`-bZ6K-y*6~lku4gb-CZtk_+ z><Rv4wym2PMA2|fw%pA)iK(q4(FQ3HZ(;okoXJ+&DuvJY6u>0M_3-JceENN}!R-#} zATyVY@Zvz44OSGbF3Ye;SJ!;Q{F^<?qMw9M1vB$RZi;QsGw_IhS*?f&STY+KxY+w; z+xq|_3L)-=djE^5_jy>1PqWZcz~~r@s1|mq<F#fZBm+=mz>#=#!aF0Oo-^Fku}FhE z()CQbo=w+t>3VCrKFCV-R03xFGi5Pq?KFnKG4Ed$zmb3eM?fMEv1)bBa)gR-)E39T zb8Mqx@_hyj2o&LlO!of1#;R7MXe=0q*nt?*86KCW@XO>Ff#az2z38^N+a2>Oc}1=~ z0yqwO%TkQ%w&Y>l!jcyWF(*0qh&G-%bPk!&eatE>nCK2TK*ECgo|IHHryV}H+HPyh zTD2-JT2+#=8qaxb)h(?`ZNxSENF>m82-K&m0xnu@xrhd0=pbuVg}xFeF>}2vt_n_) zc~cv+ym`=UW=0A#ye3d%BKP&j|5e*51jC?H0;QewNSgCpw`HlLkT;@MYMh3MIttQ3 zby?);jqjJX0WY%~U$zys%KcZW|2!F{_sFAYI<aUwaeo~MMp*1X6lBwZal5SpS)YnY zi#yPB?`!oRp*-h3WM1s{9}5Wc-fjBNoT`pf|1q@J=sZh-ee~ZpNznFRBM8)g4mt1s z8;t+gK{1R$75!J7?}&=%wlH5xT)4-O<`SC{TPq1QDei2c;WF>IjEvNE4%(B|Z$gPK z?KS)Wndo{M*aNP-gmfA*;A~KO69Q~L;AX@`ue9GsptveL&f?bHq@JOfTC@l!fQ1SL zC#gF0SP3V68d>&I>U7tVI!V~hYohU=syKd;mHOOEtQ2moI|y~%DkYu&QYiJ#msu(G zlO>~t`($Qdf!GVtfdwi73$dcd4#px$M%(AxaVKCS<Gid@3Wa2msF7t88zZZSWL#+^ zV}ay=JIH#wWF&b=M%lQNWK?cQb4f-lD_R9aQl$Y_N<j9~aW?hShs6o#kj-fh^D(Cb zjlnfBsDQFI2xRr=4yJUICLMT5>2%<aEDCQ6_lE0}-}nnR6e}_O&l2~|MiVGtEl!<8 z3E9TA@Jx+Q17DbCS8-_$m55&>hUO5NET^D?>ei2Gy%jBpjbp?t1T!gvc8VOgYUJU; zEUUfir&KV!OksQYlY-$n=w`-*3aO+Ro;xyP2G+^Q`wo$HTQS+AOVorWg&dcdd$5X~ zJ~=~_Hw2i^$Z=Ts`K!~svb~fN&(MC%!4kmeZb5D)x9T{}ao51$n%~gm9{rxF+1-Cq zom(4&EH8^*e>kq+gdqd%C_`>m|G^FFWjT5<RpK&XF2qGaEX^CI!(ddwUh9fUlvQit z5wanR9;zwg(g^vRIhfqzZJ)s<4vMDl7&>x8@zMm@@f&*;@y|4OI3-Niv+e6l+~II? zj-sF3q+aa$c;#!$3c|~-?JwS_+TyPHMa9W_MTsl0^fHMntU?&Y`f<YcWzoNP#O2<& z+#eVAUMlI|3{H4R`*S}3inmW9?>e>b>NhWGpTr04)7F>=<oNphE8ZfB=9khUhJ^;D zhhgfG)IaLHKe)+_({N<Gq%rhB+%bmUi59>g`Kk)OKKxjmpAUDuT+jri276ACC4~Up zHQ2eF(uJ4ZF~1-v_)c*U!9je9G$hbq4m^=8sGqhxYT9##tVD*83Fo)Oj&N-Ksn<CW zX#Lq~5FsSUU2W?7{(tt~1y;7}Jj|QD_nhaP$K3b150ZOE*Y=f6S~o5&u@W7hVJYfL zq$Q$}ZMkq^78Y9j9!lY*C{{ovk+#)FN!)^|T~u+MLJb5+aimm@6;x=I!f@4AY3x7< zY(qs|M@^hWwbj%u>_%waxZn5xYwwvk5AsqE+Y%`1o|)NuJ^%Hu|GoYN=HkBngLl5V z{!zX@13dWnaUMPKYVsy>;oHli0o!{buzc{Y)+k2L+u*#(FG^2Ad{K1sV!@!n-~7b) z3xM|<hxmTr6^`~Bjre}?+XHpQz;8<8`>XdHGrw;Z;`^~z#^k=)i0|iKp3^!`Ae$54 zU;VBmzCZP+7E8Yf;`_z#yba=u;+p0G@0P(9qoWM>gi`D9`J`4vVD*FWHMba*Luw_~ zQK@y<9+F!7>qjFs?GUx5FftXn!2$>KH+&p!HAty-IQw0|fQ#Qy=HMFG(mnnVRz<wH z!3VX-ujLgX!_l8NXgX}v`hGAFg(qmWi#=v`*kMgds~c$52pnzDwR|>Im_>83#jx8^ ztd5v1e8`y?_5UR~I73IsW;W<K<P|&BST+<sg{#mTG9yJ%LW;(RMi^|}%31XaDu@9r z)Qagxdsk@>3mD^~P((hUKSYLiy<3#zY1n5XmOLA}UK*NJk->fRFKdUzvlR_!<jfWb z(KB<!$!&~A4@S)y9WBK6uuyRkIVn|viT)c^Ji;7U*37PPwSPLEjYfaJsv7-jpFABH zOy=ncFcWd^KTZ`sHgG>uXdncE6~LI=-;rqQmB!U7=R#<+u}!8!xn=blZ#{Y;Q>B@a zooi&fhL{M#3}(L($v}BG4yB3)LP?L8g3R{fp_XE6@aJ>iY;zj@MeO#235eGH*H+vN zTh$GE$XUhO2lQR;z8a-C^b~NsGg|ECO{vdQ!i70Yg<`#+g84jezk+<br9Ocrgm%t; z4}ZQkna})sEO?9uU6*Ft7u9Un-Umv1&%HW`%wY5@b${D<bro|(91R$VKm6Z3o|yji zwgRyg<<<dIXR_7=?7)>QcZG5wtM+Td&>%tlyc&B20o~IX^>{Xoi$V`o36~kNFbUjo z4#cD|Lx6)1d=R1f+4u7gA=_AC0tw8b_*XYyZhC0bvi@v-_3+4lm|wwm8i}ySkK>u~ zz(@&J(XJ~-8(JBIBi=uzh?{8q8+rE!LyqC+xCxTcKrRp@R=9bJQ)Bgpkuu%IP9En9 zp8yFs$<_aCRjojQX70R%O~4T5!Rax{h=8G4OnX8SPdOwix;dNVk9_l!y4j}#Zot&N z-C(6-D%RtBp+H9X;c@FLLQAzf4c|2SDn>B=N=IPDg%Nx{V6g9y?~el}(tRc?i|q_n zk?b~!{UV%LX5b`t_3%sFGW(pXn=n1glCTKT0hTK5Z{1PD0+jVwG&xSKl@mvl`F21C zc8=abFs!t7wUnGc(LfexQcBzncBh-~$8`mHZ35)+*YgDY)teqH;Yp4xRy#&^%_U~h zrcK1z4vpcAz|4{@mhc3_E-_lUs95xmWQzp_lFY}czzFq%NSAD}LFU<xTJ5eGEJ3JE zZc_yZkO*EGzP7M0lb+sbgIAqP>K^8#OKP(?I2=h%L7qCvNX~8}=SdIlbWP{b(d@P1 z3y2-%g2SJBfVh18SX{Z@swuw*{bPaJl^Y>=kbD}BHXk`IK!fXF$Ml%ht<kroargy| z$lr21<wpNY6@l>q6~O^~CxIB8y|^~r_y}>No|qcE$siWbVKX*7(9^_I_VbkS=U_LI zYy9MNgn8bFx@rkOL59$Ks)O{6+;_z?G=bkl>acxvo#A=d!~l)4UmHG)Kq&6M?}*|c zxG{oQgb}_~EzY=X4FM_L_PzZ;*@3HX@~j}yPwimz<B=8_TmU~9c_9}Aa3OXXV+r|< z4Wt|jNr@5?yz$@l$m=`>74q2pvK>brn~uqaL{us&*0Ikpe#L1k=B}I+rHz^;%^-6N z=`E7N&`MZ(3Hd4QbmR>wrclLJWaRePRU={bbMP+)nIdFeFnwWeYy@Dnf`?eV(L+&< z_BrJU2n6kv$gjPaKP1-mj;ao7{N1_f?IU+W3th`FkkbPw7%X`UR7PeZPH42jqw&WS zlYaVibB^f!h>pUTA3lccO?z5I1Qd6}bsN5yA2axDZc}JQ=}poR1FQGz{XmfcK|DE< zAb6E8Y`8oulu;=5qA9HOidOlJLG6EaUBS2-raU3~L2A<ZG-$``Bv>heID*XZbwdsx z(yd3sY;>xf50gIUAOSv+RQiZ4DZPOTax#u!QbnG{P7L;mfJV=|W`myk>l=*xTO>)3 z1|VMDe^Q1R{z~0cjj=gkDF3(}Y;rzh&%BMIbhYlV@w`M=0h!)YP_c2MH!szWfIs)w zDlEvuYM`V8_Z_Xrk1)tR3OQ<|(hOrTJ;fi7l#|d}VsN27|GxLISucEKy2XCo6o45n zKILvM_LHk}eUj{jGXb0&jPSH=!^C!(giTA*0qW_SEuu&}=8Q`2pUw8PQU~Khf}%|I z<n*)!&scEG%Xz^weL<SaaQp~iE4Or!8b1PyN>7lG<(`ZKD?M?Ms#84wk=9EfQDvnx z=hY9-x6OCekN#_HxQ3V)QcoImt}>bj)D@(RrHoKyZveSEFzWiNS}SsI{|Q_xM#WmW zI<Kq-3y|d3&DZjzUn>f-R-5gaQm|XIuHXx<6%9l*=H~G|eNER2`GC+wxLK}PJ>Om7 zh)in1Hi_L*c30|}X_zPKm92wfsr|a*sFellS)m8Mb6ZIqa$80GBe(>%iEzj5sj{Qo z*;7W>ZzpaRfpS6R6@^FLR^kXS{dzB0Ig{r>lH5)A3<ft}GjL__PChw3<)WN2oP(gt zG2h%sT^T5ZoD|osX}HP;QpyOb^}OxJ#Bw%j=@q*u_K>Mf7x&Oxk_|EVh@vF$3UcH2 ziCr^O@o-;-F$A54>EDbS0=IGWQ+C6$D}0G)=Iw20GmHa%NZ0qbJB2DF7r&}Ryu=!= zA?U6NcC;&kenPu~dqK;Wv@6{7sa<j7PN!XQ<4&htapTThyIP|eZu|-D>gZL$Ui>$y zYUaq0QAdhqwZcgENNKkPyETJg%ySx)(CnrqQn-#t;T<|a=`%=}yP^#eHZ$K!1PQ}( zGDjLg@kV<RN2%1iy+V)3Bam;1IS+!Z!CvC9GSlA|>sD^IJ8|z5a?UCz;EA(EPS}Ww z9`cg)(MYT*pJ=%_tVOufd=TP$hW6k%6HakNyG$moY<UH)?cj(!KV{Jj_uZj=2>9;J zc8_D<DdV4`dE$9T?QS3LyVLF(?i<B;ZMg5^Yuey`0joRWQzGiA_Ouorjs*kb(hJeT zeJ|Mu_xAODC=h8L>mae&Ljv#9O~M8cXCe<BAk4F@JEC31;pZ80N{>_uDD7Fxo+Yau zUfV$3U<*_bEE**v^lD}FYv-FyjFKS~ea;)ajJ#O>FT=2Ya_Bu8L#fS2(W@mlA6o7+ zmY5w63K#SaaY!Z3)k0)oV8AZK$+9KP7L)Pmb>PN_X`1A1E9KN9;-!?P_UPkq_91Ws z@>I^!^UVY5=x3}Z)Z$h3hw%Z0wuDfhx(Oi-uI|dmr`zO%2qa?AN~WH6%)s+1iniP3 zz+;5@a4DvtoZHs1H2Oc~UojYPPiPf4RDvwr_Q;ZVw>_%pZ<Ul0TzUJjy(x;G<wNUG zCU>aYv`mxnf&ED!X3Q3?g2m?=sM#GJP(=My2REVv`ACw@^u}j+zDww|O611u&X_xG z2wUV=sGEPT9?bUMUSK=^X~jB9`!coMyCu(cj0eaW0tAFzQeu)=QQ3ovDkgT8#XozQ z7@qBWV;fx)h?TqUq8#9be1P>Ox+5Z+x|*h93`*dQcT5S}`3j!ia^oE#P_L-38VN2f z*kkofUC#2MrRRS+Y*0+)9Cc*x?bAl2u4jM!*M9!j2BJhL09>{nFQF4pO}YKD-6X%` z&szjA@$rf`T%HDv&U#)lumPDvQB+@PIl>Ofdr>f%ju!mi05JUDo55V+Vrr6!kAh<p zI+0Fpv=aNXZ_fnG0pRrGEa>_}+YS4N--MEvMFQlrvj!`>D*hmwfydOdHxhc}J6D20 zR1U$%yRnDZWF{M~DiG%7@PM-m0(`~xiMLJzwCjC$z?wlJC}@Tj<Uvr79k6D3)6|fG z0V*cm$p>uaIJIFj5E<!9$y6Dn2KgZmr)7)Uw{h@yJW`59fLgybJS#6VVvZ3uE@8t$ z!QYN}1XWuT0oK$RJ&3vZis25O@@ETe`bEyS(ca4JSN`%Z{F8x;4xyNxeY}%ic`rOw zHLQ}_29TbeeFvpxXF&<W|9SlxkT^^-hv=G7P5_GkFVM9vgV_|@z!mnh*&Xr{R^KdM z!m7R2Uf+0`%*h-|Wf0eDMzu!w=44+F5zC#~#~z@L8G8VP7;okXCTdsRBH_|y$QaOa zjw}c;)cEK?`<n!)>TQ__3`D|nv?A<K)41`KL*hTcvDP4f<VMM8TPSOu*WL-|RL#L2 z56H!3^w7k(B$oo*8fyW_<kkbLkXA#)SG#L|5jt_m@s^>Dznkk)B<<{O)(-_$lqFC+ zF&CUn8VaQw&VF&_=J<V+ng#Ko9!mV+Ds!_Q#&;@&yR1;~Fivet#-sC?#hTRG6CldN zj-V$tEDxDAn8*kL6w0n*&5ZT4sZnot$$+%18HAYeg1qs}`S`!DNLh?q;y>P<U6_68 zcLe_UzYPn^zd)o~c%qg+uN2~BEY8?g<C}4BIky$&rYz0?npYr^?YeV`k?-U#EFJAy z2wWHj6u7E(w_VFqSuQvUnPT08=7WwNB*+FM`f#Yg(pC@!5?Rm>vpV>jKZCT!(_Kx7 z@rz_J{OaDpA9PAZ#+Y^QD5qC2{Xq~J7Ufu>sh&{h|DvdjXB~mt82QMjVKGiIWZEXi z<bH-gT!FT1X*siEicKpap+F|w=*N1(QiQ3;@1YPhYCE|<%OGzSaRc8_B4DrLY=@HT zv$YUqVh7EBatHbMmlTs0aJAH3#1zR1c((=&4-o=J9phdi1f8jjIjxG~ur9Y*P|w(A z%Ud>un-0MT9a?su?6I}gfv&HWO{pfEp&ma3Pp{ZOpR6VoKVOfbXnRAYqr88xy#IxK z|2p5VOE(X_|C<Z%*MviPe^06ZU*!Amu>LAm!^7`CvGCp`4~O6X=l%PTM!VPD@c&l6 zj^WezAlH+AWFyH+coYV{ppbgl!@DhMrue!;0z-&`Lml9xqv()!4i;;M{wcVs@!w$h z=$djl9l8=tk&!kzj>&-&h$bJm4mi4{5+<X`W^1jEMfK>%fruK;2Mn_co{qzbe{MxD zQ!{!5vvwN7NY__`GRVC|7RTjSNG;}QlRiB#h;u@cSWOhD7q#T%hv7VY25o!h^`jB^ zHGVIN#^_@`zVl^eF#E~P(Pe&G+XKh12oj(~HXQ$#IGXM|@g3<17|{BZs_;O88DbXC z&YlA3AF2A9LtAD1IY4%%-`KTj;D*Cr;g(_N=W|5L@hei~4D;_;%ENQguEk|F>;XPi z_=y#alnAggv|1&FmJf<v1MWy5+2d8qN6ULNk0@F5HG@}a`oxrZ_h|G1x{UXl-(T!N zV_qkZlQ;8mI=~#$-LqlLeKvS)6&Tk+v7Uixg0(==V`$&y{AVEt@r(0hvV?B*Ot?&c zK5sz~vkqXytOH)m`skWvUwfyp`HjA_1H^1F$Aj^w%GHA17?ZwAr#1$oizieWjsB|! z=P1~l>FbJ@6x+l273mvgBMmO)`vx3k%qU36mwYP6B8K`6u2mTN>`TALCh=Gy3lC?X z{oL>KJ2X*#?A@FVX5Xfv7t?o|B~~p_W&+Zffk{Cf9um-Cr*<yYEs-MFWD8Pq`H$v- zuI$WLSyCuTOl5R;cNw(A<fseQJ#;z00{!mm^?8fbqJ7bsZ`Z+LKFT`rjp~WtNU@>7 z<4nLu4?UR%sGtibFvEbrOz(B3!<<y7AWB1wPGY9ADwG2N2tEnfTrJ5|3jxW?NkTJ& zOtFo5GMcdQqDx#!f2XN73+2JV5!S%LJxJzjPkWM_O&?~QHH_W|E3?fJE+-zB0{cOx zgrHAGur3S|N=o>H5AciD`$^IiOwe3aQvNI-sH}$@F@l!COgxJ*oc&WQM<t~o6MxD{ zqO)VS0~@kMbDEl*Ff(w)i8>XTH%xj$NSdm4beU&#I(oCQHW0|!6Stt_wNkbpqlYd# zC-um8pkUA%N*?r$W%HaVm)oOYPB-Ic!z~)b7POl@WQd!t?YcA^Wl090^7t(OdpCEc zsGW!L93$WznshvFxdgN_->Io?0_F{?ABI&>ZlR>=Rph<|fUmJ7BsX~h^88H`zU^WX z^`X6u{*<`Ap+Uee*TY=Odf${1@Su8X_PPISpc(qL1ICNZY4o3M)jRmTf$1+|%3+yi zl@5^nuQTJo$>3rfztA7bksgdC-ij`+wd0iWcUbdr?{H2!(<?cTVsN9sKuwi0AdH6e zs`^uCT#DeIU~L8QT=UXEQ#3DVA@5y%6BJv8eGSNu)x16#O2uMdGv(YyfB=IS!EKnB zIDdbv1jf$20yb@s5GWxut31O#oV_BBEDvYDI=F?TL5bIMq$QkLOm+Ool<k16mKUq+ z=g<7M18M8WKQ{ievo9DxDF1!CP?4`a=j22514E03Rp)@Hw-4U(@!*>wDV$M!Zbd;> zU|P-UOrH8?Dt=YHpF$1KQ4KY=)eTE){d*Y_ANNgH(@;hORy=wy7JC*`<-4Ylt1%3? z&ko<bO)`Ys&-lLIg)*?#?)Fz?toHYiEM3@>SJCyCW92>AI05V!i!Q5Vi`d1zut#c9 z@`c{Vk1ghtHz=_iNNS`xIIZp=Hvn;Z_@hT<x&?cMmXo}nizb~yNN7#$(YV?>c-w<g zC1{MPGZDP|S<J8a%5w|uY$i@$$bb?FEE55K*;fbt7&4G$lq^CNC8R2#3RQGGxq1Z8 z<mKKh6od$DK(ne77RF`LL^x7uLe&NcphG?w4S*#8hoy~~DVpk}z2DwCTTs`e@?n5C zqD(x4SK2F*a<RS8LbhI-jrO2eEQpDyORtjE<k#R^OuTGj@y_+A?I1P?aF)<-es9p+ zWg7+#4QjKY3CP1}!GJVcFrP34vag4r0y)FAPKDkK8BRM^pf(C3nPeC-u;l+?;R(7u z%BX;q*>hNYS7x6Gt$&b+u=uy#*;z}iXqBm9(&}}hxl)13vbOwgt}ktekH&gOb*1g0 zs?y@Sxt<ite!M%XBau@K8P9s%ySaXZ{3oU@yqoJr+5#lku|&tleGWpJ09=R($O^7z zKtB}`B=}d=pDc>Vik1?1>gN0=nSvj~!2^TQ_eanTduh@n|J95F<N65keC-E50&?IM zhoz7tyv8i|%<RiQ0cm6#%${L;jKo^F#-s}4$5qbPz%S~{qyNK%Z#0Nq1~&rRpGCcr zQ3-t0)?CbcA?aWOr%%rfrV^m*ggXJ&@;Zdr5a5qV*k{NJ2nS<AUCLNQpBxJo2>3x5 z&$uFseJDS<0ohiJf~O6q>kngUi|n2}LFgnS90_5yMx-B~K*SlF{IX6aAGYfpqD34* z=FtYKb)8hAik_sBLqsJNFPh=W17eG_FyxA0K@+#{c8Wxax^UXND_b?rj%^Zxk{g@% zVZh2N0MX0Z7%fx?g~K%0&gLM6y>Q+PBDRI`jfbfg{s<^Bj@`tjvM_X#wN_XGT|QgY z`^+RleR%uUBwlaHxVH$OmZDGstr(cYa|oc4lZQY${<a|GtTW?&>uB`XhLPNlm-YDX z*s@Lfr!+|GaSeN@QM3nRvip{Z`^I8Flq`!;I7&rG2vks>3H_Pa5PJ(N8%o%Kj|iq( zHkwGh84u`)l0f)7|7&i|Ownw`IPNv}%xeD?X{URNoZWr3^_C&3rMh-dKhFl5NC1e$ zl)%#9oAe}Xf_=zp6^(V8<@IpY!bNv;juZ4ctArUkIZpT<>VS3K&A413deW>*njdG& z5*?m3Cate();-t8<JxoWNLKkOFX0TB@BwjuOK-)8nk|_9Q=?x>=^m)EpCNwF{!Xwj z;Q81*fc<Sr#{$R|0A($xQyz|gByApv(+~~k%?=&?>94BA5wT|fj(^_cpZEIbeg4_< z&uDZ%jn^>}*Pj2sn8;IF*tD4q|E&9G%|EODSsDFHgLdE~?;d;``_OL?$l%HbL-S)i z{tFc_;M;KgXxMv3f4kzWLQ-j!Z8nd)X#D$@gFyq+Jx8l$7<#I0LPc}JCPJM+Esy+~ zQfw2M(laWMX$R~4ps|<N;UeN2+9Ar0EGn7~F?W6ZSdb|DVg;;sV>-C(Pqnzg<?+9P zpwMS^vy>Ccdji_wNyGoYzd?ros}149$<hM)FoH?VZ<BY1??L^k?XTb9N4b7O?JBR| zP{A^Jr=Tv$J7p&W^LM&zUH;DX*cH%AxsNhGYsh+C$c5rNwTwZi%Yv~M^9AFzft!Is zr@Lw>6+X?Zo!L}DI-aq}<OG$uLOEuhQmAIXw)M&Z+9VWn_AB#DivQg_lj7fA%B1Mk z2Y9$)Hf3mT(M#kEv@dvP5KmC5OsB44)CK#>d1c;c%LufCTSkR$77Q?Ezc^%s9<i~8 zQ`)Mqf`|Ic`FN3sTSPMqAAM~e#Dtsl7@%1U7z*n#{;!+S=$BqwZ=2MaO@G{fpmM}% zf(Z4>+S=-xPU=B!$epV;#J+jdP-11@wZ|jli^rMXGVvvAgt_$fUNOf25v$~JfF>vl zQ&12<``Pq7fmQ?>Z`vINg7tQXi8V+7Y**|AH;5=8>V}01g=BTc8$-7obQ@<j3=}P; z-*aoCiq_nk*dkJk46=E{WE&oV2eIqjs7V5puaQJ928WE_#NZxe+J)GDJi;l@e1y<1 zMv*Bd_*`$dQ}&8*)6JIA7_enbm--~8hbQwlv0w4KF2D7O`@Si^p=csI%aJ(mJ&MR@ zTgi+wy|H~P_MjOgYVZLMR&V5NVAK$fu9@DX4gA(+DKKlJdO2~F7N&fi^#1&MP&5?) zXFoEjnN@}M8g{-7LyE*HmMok;2qI5nHHnA~1AbM9EA1COSNiz-NcvAy3AfaW)Lo%X z3vJG!*%!j#X}l0pgYiP^W&92RBthEj8tGQ%#NIBsC)QXEC&2t07FmMN&~uPZbUx0& zRJ>A;N2IopV%8)&Z~0JwPTWm^t<AtBEmB|-Aq5MVgbCqLN9zT1x)dvbn=O$YA$Lw1 z{tfs?1nUCkfC?DD3g&2sSj3$CJ;$8<eG=wq@96QM#m)yD3g+}ZEMrcScv8}fdpRo5 zhzpNV5Clnq1>O`4h#PN?Eh=`sbHb=q*_ht?Xp0-3nA;*z2x>q<GD#+ZIG!>zw@(=k zQH3;QKoy`9NNfvK!Crg95VyPrVF=uh6AwM^Z}zxfECjB$N48k)U1n4j{6FQCgMOUm zspv%<OJew`BpDI*lEPWH4Mq@*A;q=xyX<v)I+xuoQ=wy!QqaYIYPuap%nHj8Pso+| zWd5$p?_v4vg(bdUEx$#TMZ%GGvM$T!Zcz-QuhLW3&oUC^qL;W*u(~H7am5JQJcADk zs*QL}x`5mhbU}(CG=esuLv}#%9(i^vHrB)29-u518d@lXY@j(>fLu=-Aj49!a`y>j zywHXM{)J6`d~ZP;nmKJ)XSlaP8*VPphP5|@1D!)H%e0{pTXg62T&C%`3{Z60mkH4k z&eG8bI+H$#EFwzJSvo`^Wp^S<1YH}??Gs39k0|+jjwt#2Bt$um!<4>CPsbz55}$#G zH9<YXE7S&%7N`aBBZXS5zix7Sv;y1n^U{iyubx({9i<i6KRY4fPbjU>9+9*H2yLqX zDpDpbV9DcmM;q45Z{&xd6<g&uLgj7I3i=9Kk+P5dyhJNrNRIf?KT29bXD8AM5hZB_ zh!V$VT)>_-6hz72b41DCCn3s7v_eFYDxHKVUmIHSl_(qa?UM<J?TN|;!Ba0O8==lD zQ-Gy~U6dAHQZ}AX**I7r5?@zkgN`H+4gVA-z6q6$h;#f(l#Su-Q-+h24UP!Cq-?0O zzocv&quP9h%Epf^(1x$OvO#Aj3J_|gDL{CXq*DS?K={T~Hcq4!FQja&e)Y71Y+HwE z#Y@Ttrv`h&gfgTikdtJ{mkbkg14?Hr__zKjX$75~NGn*hZ!%?r^DD?qX~f*TI;i(S z&SJ)dS`Y`SpJVNDtn6COuOM1s5!O$!8GZ^XSDgbTUHQmh=7+^-u6IdY3>y_z6G5lT zhaR|U>R`(GXfC$B8Mhf?scJF7r6+_wCxd36EuzQ$J*kd|$&W}i4@s4~4R>Z&(&;~V zz=A);zx_y7z4&uXfW^XFyjF`pRrCo0Ao?Ty4%k9;EO>L0P&v+XfPGsp55Y~vfw0Zo z;>IJ)baPuF)$5o8{sV37#Wk>nv^*eks^9;;`EPsfKd=yHGySPaBo+(le#3vj*t8K6 zz*R;bHp1KO>5|b(Vae0TTkO6DP|xkXnhckQjiDcN_%S1z)JzuVRY=~XR_N@#aXJVq zriMouk4K)pM9C*!qm;i52l6+ndAuiLH-4j<$M4>T1JW3mJl5P#u7I3&M^>Y+(o@$@ z(cnZH>UsKo%7N~v7aCk4w7tEzB7m>y4ycQOY52?)3uj74w2P0U8o%5_DfR;jA;WC6 zeAt2B^uvbIIe52$Ra#_4CE7p1hZ5}zT%t4rxI3Nq%`3dzPp)?Wci2rjFklI|BJ?6~ z{e2Q}cLXlSpcA<1g)4oPp1OXPfs6M_x>z=52Ur0@`brz~^LyFg89Ji3OJ9m-b2u5H zTY591pM~YEIH6nO8(Fq;BBt_A?8Tp>(f__u;lnLq5+=u3^vMn$H?dM=7Lsn^=U(Bk z(QNhgx1?mAVoQp49lO3x68;}>HWyUTH`3bRhXwM+p@F{xXcRw<GBe)SNMBC&lN=OB z+Q5j$Sc*6VJYl4`p9fKg;zsVpQ6W}G(n&;`k3e*YTcnv-?zHXu;;d>eaLM$8O__eY zGtGAJs{=hw77%GmgE)mVU?cioi-1{H+mI!L@Tzizo=2J6%y>4isMOpj?gGK=Ws-q& z)ud`(cq6QggF%ZEYy=d2K+zIE%|@^>JqFyGEuC>UCyg1i2ZPNnwm&S+#NIiQ0s!qh z2bajbL#7D7>X&wXs&<?tXFJIg$HDb9vt*;rZ0wVfyMlT`K7Y@xf%*H0HBd943+t}n zm}TyYt&rqOU!|w6A0aS-oA`l;PI&aYshE%gI>ZJWD2N}?i5PLp{3448PNjDm?UyM? zgqC=3yw&KwjDLF3X+lT;?8WVq#(gsU%JvBwRFAvQw@<2f=?wf@?-P3eiuMVS<IDTx zHzVid(nevpUyF?rTCZsGb=oLDcDoxztv5FcP#bkxZ*GLS)|<cQF1GxA#Krak8->1N zqwwj$l}fSe>$p)~!uQ$p^MyY`d=HoM*Ad@uzJ%|iKQt=4lY>?|IcQBOXK%V*(%`K= zKB-bs3q5Yin!H{vd6dpm5w0X-QuZWnE#;v&<^^5>aQJov+am^{ED{2S6oQfm>nn1P zg+kUr>WIKlWgz9A;JyeWA@`8FE<)c9b>S#8gPq-YN?A?PD#$BvMg<-kAAf7RhN6xX z5z@8~{6R>RN2Fdzc;}qy0fQ`<iR`Y(g6u9+mIr66=nkAzF!%!>y`t%+T>zEUdVjHx z)grfa2@#5dz(Ec2*pGEig!F=(*beWBaJd+&y{EsTtPFyK`6#Nvh}M;NtYIqvH|sG< zp9ArD&Qp$=RSYg-%2-e355y-!qCx^gv{uqRp|KbMVu%b0AyP2#5fZ!IdcAP<Iv#Rd z3rQ}5eDhRffTNR4UP3_d{>3BU<9}2LNX*|iHv;~>lyD_iY02ueLH4c2EUZ>bS{(!? z4`_s`ikM5a1w}{blPZ?`ZOW|^WEfCg$ulMsO;<zhRh#G=Es95IH=!Zr>5#Bhm4H_B zx{+_G1Q}-b5jJ(TXnyjL%7SsqgDML@J*=|ulQC(lsyZzjJ6I7&+3Al@p{~a2yU(W# znX{6c9Nq>kvD6jCk8hsS08>*@>gCx;d8;;9vh!68v^Rbb(iX;#KB_HsvVq2r?wpT0 z-x|&KI^R&8Pw1iZjae3sY8Ab2bFuBM(srCAW#ol!(zZhn0z~DaCaL;Kd)J_7p@YF1 z)L&7tNL=I!M&>?EOg=GnUs@}4N%(ti1<BuYD@ea)=zAt(Lf<Qf3lh98_Emc7tRV0N z-GZ()_3{*B7m66CZMPCK8=6#leUE8|k|bv=dfpm0h%Tslzff`fBRG1=c2tSP1|WX% zw>gA|VZv(%zEHk<TS&!%`JOx?FQ1zJb&y<p&{;7UB~Rhy-a#qcA}3ZARU&v9&H=R# z{HcY$#tFE4vTwMr?3)kG7Fu=H>*GM$YR3hh=Fo&AxmLf;KaZITj$y$}H1uF}nQgsY zv4e`$!<lS*05TvH%(foq5IwtvZ3^RJ-Q9+9yf1o;Z`zKn8n(7n#cBPa(Q^T-==V`} zYV)xDEsY`jU45Jm>W3f&IhwGX&MJP-#{_sL-I!K6+bTD7bQoG0l!^;ovdvywf%$%0 ze{B`@9aOQz4oCm|yXw0*kk1LcdP1&=iAP7iz|oOyM6+$rHg3$kNLV>$+oKde#7D?S z+p$<l!Ol^5gWvUo#4-u+8e>+zx^R^rZ8aq^0u+QZmeaw3C&LFG{J`jx31@gKywZX^ zsWA>wsb=RmM=2Kt-ZmNd@fhL1oH!A{7h(u4Nde4Zw)J){nMN2331ar^<kzb_&30jK z+rI!D8X-hw8|EE*6tvztm~Fj-7v^`sMm2?+sX&M6P4of}`1de}E0wEE2;h+vDkE%Z z*{Pd-Qo;smu;i;8f0<0_i<BBHN**5J=hPD+7OS2Vi6{vIuSfcdDB1MKW;i|(;7~p) zrt^?<u)W9~OIHJ$&#tiIxTt_P5ihzDZ2icw>q{6pznY_6p%HNW@hLb=TD2bZ>^#$~ zbv7;f_XsrNRy^)3>JATN6GWK!#Q$1c=iFc5dbjqItAp9+wLivHM<EfLC?$Szs$PV- zmLF|?aNyR5B@v}0dH=u%RQ2OVemu(7W2@bt2zDp97jJpYt>cV%D0VzDCtLBBbN4hh z4OO9H4JZP@TttWlXmde^#2*>bG<H8H3ILCdMzTo~$ONYv$f=z708VwZ8WdleP_8&> zSG8V-S|D-*Ft`TwaliNv$^xs8T`WChIU<yr-I|-&F~-6bTIMEB)BxHnO;VOSBcD9b z;9A-(w;R*BQ&c|BR^YockX|{t(@qY4OU_Tu^7&`W4at)#=H)3r@*N$_e($#j<BP{t zotzc1s`hNo%sj3!vvCHYM}~!K<T8Wqw{-3%CZ7V}-phwxTki8bW`%1C`~Zcn5)R8p z>qpn*wYCb4qi*)8VfNf45UdJo7o%?Qs%7&g?+Mi)@@{TH?<v$A@Der?GZ~P8S6Hxt zNx9n=ktlPt+G}ir$N|Z&wJSg@zJS^bD8AAHLy7`J$qOxAoebhAihio4nPQrj&dvTm zv&+1Bn{<8rz=BoMlarMgG&&n6zXLw2#IXVoNG%09h%H1JYZAMFD08Jh<{l%MT#U6Y zy}&GuDR#fb<xE>-#k<Hf#3@=ME%l6jIv!0*^F!WN{)4WCy<3{7{|m@AlDDvhuQmJa zC8Pz~F{PV;xTIg}$!VirH`bagy3#|wS$`6m!kZ@EK%@FMTbvB^&Faz{k=-_MOOPs3 zBetHCaP1VDw+<BNqd=XEQ7FJr6htUPp!zAP(5cQrdRFL*;gdb8pH4x-(~+}hFw2L` zd&!3f?WI}sgg|&kpD2d|3!ag-SgJXIuP7|6P)e5c4B45f#>|dXI3;Qmuo{P4+f#n* z=>EgS7DVJ);L<glx~V0A7_G=eWj$(ECT7Me?Tn^~qOwUAe9Wn?0jZuHO3fmvaC0yw z5J#iD1L3k08lXEx7#<F%XB^!#Oy^9Q4k!NM2#hJVQ#~O?jqpNhd=qu(A{s<u6$c<d z@iSzsIL@~gLVM8sOdWu>o^_-@1G-@lW-;2k*~SIld)c$8f(Pymc|@#ncG`(W<{k$z zoCn0PpE6i=Xv#e4heTg2Rnx`|;2b_-SP9R?E((3TG=ln_g-~#+a@3x0<Nj8hvF)z% zqVNqrK<+vAPd;ojX+=D}TAq^P2ySzJHhBH?(r_P&i^MyU|F|+iQilOmP=2o+Ndimy zP8Q}YIT=Jq<OM?xNSg4jY2#j7c^Xgy614(T{<cupsP9SkF~3M9!8O`50kSrGfAxmT zu4ghZpEk502(dLylvC~^<CGn_(U3n73P6upOJ0Mg5!`RF7$X)wC_;P$I)GId`Byp6 z4nsyl##1NF(~)AQx)nQ(JcN~gNm_Bu7+s+D7E4=AqOsPMWJZcs>@M&scbD5C9qh5% z=n+1F4_Xv}^hMjq-WOP{XiWo4BN#XWjXc1HURN_CN5c-Km3dJbP4Z0+Qd3nN?Fkdv zGc%#uJTV<##x^+hu8hg~dY^H|N%gb+xyT8^iL``6nXK{Y-1=wQ^El5M_pV*Fd+t87 zi$aBX0NZ7T5RAsm^G<j5QltguG%}+LX$f}7$Wf7~Whe*Kg?|vCsP0ZfX7KoOS78K$ zJ|DC|9iKHo*^zFcJ%7C2{P+XyzxRG6CWSvLxjZ2Wn%Cm|tO=w;eTjIL`pw(sQavv& z0<3lg+|qtf@#xDkEfQ1jK|}Vs(p!9Oz*59WH&qk+kr^*`>{t;u*(K&!LXBz9N45rp z*Ql-ZomkC**dPuF31UVFVoV7o)}=attyUiFOiBxZgNU*M0HcTj1wr^=5d+Iqg;x`) z0=LS>6j4DG5jq63XlQ^W0|`Du4!owcIAUdizR)}qr1)l#HsK!+=iQg*J^*rJO%?@+ z(OA5nRg;Thp>-cpl>C~I0e~$nYA*%?#~$i6Y)6<*NvY5%lvaQ+zKimAihTn%>FFdq z1VF)5*vD59ZOP9K)-L|XNa!+Cq!%Mgt%!G?7i2U^`ED}>v&|q?LYsHG;L$r1%%;x_ zy0BDI!N$T#$_9ms#hzD2gNhkb1)JXE17b$9?+|EG-J;%Pk%*~-k$WPDSOXDrEg@o| z$VEC6%sVV#5V6$-BF6O0b}wMHvm{B2sj$`CT~g@04vRcejr11P<y|IG4SKsc(w!VB z_NI16B0&y#whVJVg%}d*&mo%Y)0L&+l1!iB0=DNH?fPu%4UwaK7tBJlAay1ZX86>h z4#;_X(m`Ysv2Pbvmq?Doy>@R)Ncd2joSJTj0bZm(A2;6Ku-9H>voBCTfYU+?A(Rjm z^DcKtK8066)#(Aw(_Q>=YdQ{th$xfD+B%LZSv%-}L<TO1A`l1KCf_|01~3g+_KDg~ z0r@lLnt}0PqEB+t@aPW;Iaz_6B=I4;Szc#R$O$_)KvMeTmJI0!rmgl&&<}2}r6y2O zOXx?$H^NEwT7^WiR)sFdB<{^g+!vEbfw8M{Z%%?j*T0UF$UdKM5-7q2toP<5uFogY zZfYsPB8%0;XrQN*c9d8}W>6KKhM)fem^NlTTY*r_9y8M<K|>gaUEMd3X_EJUxHcMJ zkLC>B0J&*Id4iT9{R{YFE!K7RzINr`R!9J622X*O?o7mGvszYMjxZP@p;(#nfjm<- zuei1nEEcHlfmy5)Rr#@{VU^eHQz{t_(@X}7WD4XBGEQrJ0bxZHBn=38*d-iAv`p7- zPnm=9IrI=9hRu=wl|V&CM;%@q1V0aPp3QNIcXQJcIr-!ZTs3BKB?5{E=NL^Rt2es@ zjth{I`LLm$pu?u;Mr<PL*$6vfq1|`{Bq*<ihS9*jmS--rSpvn82abN;dO%P0>kwe_ zdV^S=0L&4HKrb8z<IZ6OUGH0F6al6<3SXu|!37q|kCe?<C$cFab#a!70n7OLfaG$M zl<(Z~yK=Qz^NtX*$%_rY>iz|?On}x<0)4kXu>r>5?z)AXAh71kt~D%}+>VGLUY#y9 zj6ISuO6FCb$#c2o>h$a`l5}5ITuQ8CO_lngl;v(4v99B&{ZKl)4;x9dFuauw1v|Z@ zv0{>pWH^2$G#1%wlJDX&%uj8OVco23T8gAO*btR~!*zTiiz>J9{|P<@0p$Tt%eXFV z*1`Cd@f;e=ZB1d*d>ci>v^i+cnQj$J{OmqeWlS?$Z|51Q<?aj{DD$%*EI_J0xr=T9 z6y4m{-mw5i0e43SxDBAi%g3k9_$OjW+8n8}<;Z4X+PqoboQ3)F#ykEtkg3FW-pttg zGq3_6V<soH667VUFColB>mT+Z^{)D-^%bm%(O<^ERWWUzKA5WAIln(*zQuFxwu0a} zq{W=zy*$!$9enR@$PM|Y*x5ubG8^X10ypmfVZCB5#J$JqC=)uEd-T{ABVXPPDwz}R zhWjD1+nkehJWmBsi{hg+FnUj5wDVv*e$e?aObzV}3vm>djBXe6gOO91)c{xvbAisj z!xRb7jVUSmn8=*YRY`UMY0|kIa*hBBgQWc?kfwt{n6IVVPn5Z<)H@ea5(v(9!HKAG zb9^u3Tos>fgKdgsS7L`YhcX6m7h4U;#*|z)P^E+H$*l*$2o2!zgUbeaf+5OT-9Txj zTPzS^p~)ny>k1afjhfraB=nCkY(BaY0oR4OF_(~&=uI-|)B+PESZlL2O_PxJrx_IB zEq2x_l0B5g8Ssh$N(rBN=+KG`g78rDm=%eEFjW(jbyHmnloYTFqd0CBORIxLX@=WO z-f~N|k8#3P8d+2GcpK6Aj2tea>4aTzldayBs!hHT42&0Z1{Q3IB#0eUK>OSuASK-x zf?Z4^dDUXloH_^#kdvN3C@6PF3pthaNY6)XPpKpLbQiO}(h*eBK}z_-UUH?~=CS-a zzJ<9uzJ<A(cW;@rj6X`HU4;zIeQn;eM`=6S;@9=~6-CHkuPVgDtMiA~`iFb-hm5C` zJj;B;OGPTnX!VsefLBWr?=T`l^%hwtbAu0fjOg>&L_}p&V4nIAlt$M@3m&+@{MuyS zY$@1;QA{S%ED(Rp-MqDW+N1aY4j@xNZ&r<N5)<oHiFP*hcH_9ln;+%=tRQpu=SGTG zbi@4YjV#cLE%kl_kX!&?X(e&U*h*P0S@ulM(~>c4Ejt<gn_gF2y2Qk-@}TY5uBoWj zKeGiL5zTBc8AJy@NyO2;NvhxMCh#r9far#K=uKqzaC=*HH=oAnm+J+e@Gx+v9$!IM zcmnOR=09Y8a-{o_InuecYhr_`8ko`?bBic~k3u_GI34)*8W@c!S1FvyjhHzOzLLZF zrpyz7(bdZA2~t)^S1Z|-u|ScIy>wNFQ6sabM_185NGS{%3E9tEnYS)C6=PPl^s|!v zgxncx82}Cb7&mzg$A7OXKn9kq)cAiy8ld^RT_Ur^DMyK{JRz%pc`}YCA(6Ck`hZOC zk<I;|R}0V-TZLsahh>u!G^3#t6qZbA36^v&ESW`tCEtXl$Vp+4F(wVmk2!+61(xiH z*9=_ffA&j%>#v6$7=!~f^T}(xQObrVM{`a-p0(_pZt}pPpS%d{RC!V+&y$$^ASZ9E zN=$qMykfF{w;KJ0I=AaSE_VPB*A>7TUt4`E(+t8BA%F0?FlFQimpk%na7X{p-3naV z`s1(W{=FgQT-c%yn#@+ovRnuA>V3M6e3fAXv>XnP2{xR22H*3QC#<A(G(CiaE@5Rn zV1i(P0+g>9OD3!YGrp(CjC&I^yt9Gb{dI>$q`qV{-vF?<AGDZVgHB7b<wmTVmWo8h zY2{PC`+<qo^+#aySBob5PPSEYh@+S&kqtG$4Ggt@2qCOmY4%~HTL(zV4ZNAFw{nRz zPq{?(6ow!n4k8_vtYi=onPQRA|G84F8*8y9lEGbqly5=Y!@B}H25+gcThJFGnQEkR zK;Kutdng-3AA;}ZCe4*nZShrutMUahehiv@x}sIcGp*Wf%r;W2wgeE6fLJ05A=`s_ zN&Mmm0bXco<I^^uj4d=EJd!nyWRpWC5aSI!B~3wfhF)kz1WI<BFW2>aVib(a54rU4 z=PSgaxC9X+b8YE)%m)2=`ymDkzhOe~To*ieQorcoJA|PWjwMn$B(=F5+!>(-K}qmg z0cn2Y83$;53}0Rc*7S)#GrmBolhQ#X&=f9M3Nw_AMMAa``q2*`Y5$4#8`?*h5Nlwy z^Oc-q4aLNoa*nLali#&p8ZPFJOs)?m2?|j&JnVd1R~-Ra<kqGGpH%eAb1gUi0`&Bl zrJ}b`9qXtytwYd5cd>SWjKSg|ACQw0!9cj9;c(|cyo^~IH-K^)!nWdeQHa=WZK3s- zCm0**B8;q$K2sTVRfMjlu(9EsjSZ8H$wFmg1X3$%vGN8MCZ7(F2x}$Gkab#_QQJ^5 z!+u%XNLCswyznq)1muZjS{eUJ<tnfNfQMYih3grUYv(pDsexq-YBk=wQ(x|Q(r;FE z^Gx-g`aNldmmNz`2y%O|Tv>L^JlG&|<t?Yfx7Q5JbjpH(L??0OnuU!*<3AlXzu`>@ z2&>!r2LtZG%#(~XSG|1T*l79Nn>`W!?g2K*lCU;!lS!T%k#Sxf^K7HAu|J=k(|Vy* zLK^E=Njl5MD6<Q}jd}LM#`7%{<TT(RJO^cxL~k6Lqy}o|8qPJ>$guYYm!vgj_0v*S zHwLU!><1W{sr7v@4lEdi?f4=wfM^f_&+|+RF5yJ@^-ch6KPb(`f}D2o05NA1H_an5 zJ}c%$7qq>s3fO^M2*hJ3K^Xj&(K|=EO{_tOVZYvsd&IT5Pa45uq|EazL`u+XkbWUl zM9LtJY!@I=#M*AV@T7>fB3A>@!5(;sn8nCj|6Fm;OR8dC14k7Q*m~Y=)XnSnYgpfl z+y8bn$E>e#LgpFAyj${&b8gzj-$ZU;f`KQY4oUPt5R7FCV>*<a<mJh**)I%_Lk3(; zd(QyVGMg{5mRq>GJmvC9{^J^l`m%l?@K8+#f&<Jb+foE?{1|0UgA656P0|kxNewgu z|KfEhbUdtQQGlXvFn9#=%mWMoTw(_M;#0I+foRVLY8H-~mNyrvR|ocQMeUqj=|m)l z&bqNlm4eu$en5iCwG6I#o_t$=@Ez4)l!!nHk9REmLNr+@%;tFoAqJ<NH}Xj9^zj^_ z|K7nPH({TO9q7a<jS!5^@ivx#8FpnZ$E^`e^>vcQs0`n>+;}|ki4C-&_m93qNpP>5 zCQB*&JNb`aMJg;JU>We+Y~nHb*yxpl=}SgW4aUD*p&kpEw@|UW6~NzIGvEi+Mw<g} zUm9;vc68CI>(<n&W!E2Iqcc2N-+-IvOK+aeE#Ub!tMsD<{#{Kk;--?lusG2GI(YfK zUOunI=RJcqJ_)xj&+jXrZynuj`(Mb}Jd%@X_UVPCe`~bf+=!3C_tMG6VD^hn<&n{p zY6)j01?AsZJxm8;R;<%^b`p2-(<y3%^vz|t(LR%5^i56zwpfk!%6AF~etx9}HoDhQ zhV-7QT+}axOEc85wZvCcxxwh6y5>4~7p^7#wONPUo63H=;zhd64>D$jo^~a#(bW#! zc#*HTB0@e2#cGE?F#2nCwffBLvx2A=+Ps|Qapm|4x%DX*L;7(gKdw^dOI(D@_<eeJ ze%zZM7)k{1gKeE6GK=k|WE%n(`1xwR?;y6|*nF%{^UOPJgR6wxb#i>h8deeLM{_X# z*R9K7!<<?862na0z|gV0%1Qa0j-i#zy}SH+cq&dPq+sdpfdzQGx1b3u4BDhH)Q4cu zS$f)mRMcjL-#NSM>CvM=-1PGh%pU3q^G28txj7kwq%Ajdpbr5$6&M;)BN*6$A3`vC zC={<iu>=X~)&8v79f6}Mu|`L7dFqW%RmiZeE1MWXiVe!ppL+E7n|jmOb%M>ip^@kW zJx6pHanCb%(m1M7-Wdnz2+FG76H!@lsTbV=4f`tH&<Ts63Do-%anM0uz07W5sGVv? zohb~$cPaH#=2U|vh!xForgm1-Bn$>2y0SY;CH$=)n9!DKZZXZQZTCgTuqx<tmTSEf z!<&8E0jT)!u`tuv%^Zh34F&GhV8C77I?kJYI*#5pN)Z4Tg}jdrj%9KGoSilyAgy5Q zRXcL>aY>t*%vTha^uuyrE$D$7CN3sdhLXWYL{MTYiZ`~vt~*Ht7bB#h;Gj!nhy350 z`hw|p4_Y2@O)Jdo6BRdmvZDJj_+kw8ejvasy0eHhQEpfR)Tw7Ow<6Ys0$Z`D4f33K z61ko+RK5_ily0a)tpx-!yK|s~N+I(a#Jpl_!G5)}mSYoTV{mm9BH%x4>J_k1=sr4G zMQ$bx8yi*5z$<m{I+*>4z)kSS=k>Uzt=Km;91`@&X45f0!~@Uy3wjL;=&XKw#5?>e zgTVlpcy~6$NDzSMfCFLxN(}hdFmxm&$LxY3XV0!0x$lPJ|8Cgp{<#L`RGG_V1>xDm z`<?rQ+&x|ou)$3V-T+FFfyd3@xZ2yszgi)>2$LyS9bg{XlI9qb!PzB$%eiJ19aBaF zZ6nMePW_^-i)i5@2AA|rSsJ`@@cbJvff#exA5I$cpo}>dhj|?xGi$y)W?^FJ@qEk> z&-s{z84+t`=&{blO`_!w`FmxAZ~|5EdTdY&h~XWCj{V|@dpU+)W=R}qr6LGVQdf5E zUs+uR+t!}~KI>0E>0zH+vmYOFjg;hReai6*snm`HbobAIZn36hzfKCO8oMjo8gs|S zIyco@MELK<dsC{QaJF7xF8~=8m*=1%d=FB6{2~a~(ZmCXe1&!4V^6pJ%1ryqiieL@ zKF*0W3vy}8d{n#deV}>f`+2?gak_8b=hxkK>?NEI(?K8t;=E^&5Y(x|V9q9SmlRK$ z1c`U1)+ue)@XIKJ>yq<R(%H~c2m*qfF(S@BY{H6Bgw5_x7#3mhm^cEK9LI|>qLqBO znr=%HG0Kbc&^iTlS|CcE9h<sa#MD8^o}O+T;7;V*E$&VW!HW1~3Q}M=#r6I4bc+K5 zI>Ac;SwtzYJ_W3$1-@ATgb%uTx4tBR{e$$^$hJ9YZGwuR4#BfSw~E^g>r}6|d92%s zV~BhMR%^uiiwsPJg%wDis02vCzSg<pk_+N1rv|{;Mc{=XcYr&BoU41NkoE(X<_Cgc zmCI4H5SPi%3wan|xsZ#;+R6=SC*Teq<kXbum|cW+!31zi_Bb*ogy;C-a!+`q&|zjq zC7nFAF-X${)-TWRm1TZ`_ho9LKRe`<=--HUU7=I`{I_C{td>1ONO%^C`F(9B=OBRQ zF8J>ZbM^l44+n0b*ypS6bN+Pu{3nLNOj%m+6AHYzys<k`adNM+z(G-v&OlR2s{E9F z>xO5`D!85eDg@i-T{UF9lLk;$Ob^%5fp&Ci_kopIticj8UOQp2pj9ju2vsOmVC><= z+KR=p5Q}9?x4&2^GD)pYz{G+vu~>2z4O@aV;shUs$aAk<m78*P^gpNsB)wKL2io@u z@_VtnXf%q>hCW7Ub05Zqg^ECpVr?!Dgtd`!wMu0gm9fFZ)zfKbjwnVb6AP}F5<7rY z1jCY=Vr;xY2#A@mV4$YZfMJaIk#s=VFH6V_ijd5t+&IE4L>mf>{}H}~q$E(HDr?Uf zFTVUa<E3TJJnT;cCj3#@;5Fe8lN#`-z7nY_b<JL|tvz1a7eS-_;&>P$vSmor|5I0^ z5Yo2f|8PiUwMSW35DT`+gqXk$|2$X}AB1LQw`%qoXesa^BpH46;$mf2jyD?SWPP&n zh|7^CzRf?6O*hejLXbd8uTkTtOo1;tw8KbpWddW6B?B;2I;LVHacp-=3`$tLvGh=t zaGo%#AmNIb%;AP8fd$4IF2aUyVg{Uk^kH6_i&Qbh^-<cQ4OmOIQ6gHc8?ACbPgDyx zssa;s)p@n`=}K3vJAOGu^{Wu-LOzq$%THMV^cXGpYD|dCZwaM+_6NTK6M;X?KKzeU zWCfY$Dm+(&h6+FX@^5A_Xno>WJXQh-cUPz9|CI_I4K|L$RTHEuAg)jg^+6=*A6)YR zJA!McL&PAiHH~8og^GAQz^}NR7c_fn_KDw)<4r~uwZr~OYJBUQw`Pxgw}A;EX;C*N zE&IX-;;q9?cZvMJ`Zb^P=;3Vg!@t!*@A@2i_jb_x(m(9pUR{6}a@E2wK=_#>bmfY3 z*!zZ~E5G&P=*o*DD%m)D>I9<l<4sRgHW%r_aYQ8#=e}5?0_k=~8tk_~R7NKgl{q!3 zQ;3#=Y_c)fn2WR};*6yuL6%OSEo7Xucj?1=Pg@GnFzX_W;V5m1l3W~@B&eq?g-*#` zqS^_xWg|sos|9T-A@xhNB{FI*)0Ws2(w1lcQHTG>(U#a9DIzcIha<G5Y~HV7qoX%` ztv2uIo^0thH~P2Ve(BM_UuEHE|JM$NZ=F+^A1V~aP`KXi`bhtfurQb<<oF;hs7cI? zl<Nz>SQ_=;G<g>`PNtQsgC!xTBUbPs&WpMA7KNaYCKQ5(3qlZv0)!y;pBO#i5Im*> zPMo10nM*c=Ak~r#FM^w=5EL%+5cSzW>U9|?QDm_zimvLc#;yXht$JUXC(KpBj<Cb4 ziX}TwGgh2&Qn0EI)G9gptrWq}bnhvU#D;%cvC0l<llgIILSe*xK@sMg@zr#x3|Te% zOsLeQ%=jNyh#jH0b>h}jhU8HuS~x6j9Y+?MS*7)LQP$E_g{+m0_hd0b?o`?%M7{1s zuEW%k<N+s&TrWr+yUI%<*B={od_n~H2B3~Vy||+#k01L7-PV3=zA@j{@8U=253wW_ z!Rx{KLj>gV@T;J%f9X%$phkajaY!N8{qa%0(Vwp}l(0D05iUa$W8)&$y7eJ9P^{Ms zJZ6L$4f5oEMnB^5t_LwXdT4_ALZ7072X(GuW=s-A>76KzB3-YCJI`<UjkMCbnLAz+ zB6)!2d4<ZtYi_4>C(MRU5G^0aC~l`E@Nt6%#{WdjjBo$6|Mo?{;o>ym)94RhPa>f( zhN3cTsxnBj-yd}PXM#yxtDmdHb%?2iR^@OED7<)BKg)!oR(Y;UlKfNEG|tDM=9GjK zBNKHsR)>bC|KkH5iBsfZO+HYeUt!l>en29v<p*Ta$_E--=(OCQR><s#NRo)nrkiXt z7)DnEFI|-<HTO!gn;i7dXcp>tD9rMn!BtLpVin@sw~#9X)34Sd=G_v`*38mEwyp_y zqJgVz`M&;ruoO>^x0B8+vfj4Zuu!jrCDeK5$=dZXsa*oH*%fEgv6xcPLU6n2rHp6K z%kgH~8UZoqB#(6I1)mF@YJ$BVopavr&$%!^XJQ5WrxC|6yPtC=4g*z?Jrgr#MPnGK zYV$fwwtCp;Vn-DY+jJe~wEqmIMUDv1=d76)8%%UxrW;40sBCY952Dsia7M3pMr?Sy z)z@L2^pm534Y$(`E!xwTkMXp{m>LH*rZk<VR8N|;no=h~xW=BsngyI%RzsUtTLxEF z!$U^*T8HA@$nM1k&=2e02zMh4gs!mSN-*l1{g7f&Ht0v($bMpEW%(WK_XRLKR?>CJ zT3kQWC6{r}ySzRzuLhPBC+^e<;k=SLm#Q)QfhX&c=^q-0^#KuQgVSd|1(bS)`T8N= zeVC%N4{@Mwef;Kp`Z1n<!lxhWo+5jejbyBXkr2;BfP`&aeHEFUqBUZMIkMri8<B)* z_IV_vJIDWN)!x~T#(yP;1b8R_jx;yNf6m1E`Ew#(q5D&P_GPR>zQ+-8XT9(H;dEV} z3btu>Rc~wMcY0Mo;dT=6Et~5obn_@#x4D4F(puhK0E;;vD@UN1?pSgg*!dFjzBg7X zV-_|OD4S`!j}MN!`-{Wxd>FG(>T6$WR{|aJvSH}k@E2R{y&q}U51f6w^2+L44Qk&^ z+fvtDTSdgWZjm=JV-E_o)yF0;0}mf~X7Vxs?)1lR@{Q{{`yx;$+Hd^ZfY#iLzlW%q zRxLL2tLkUjb+<cwcKkYqAlT*kq9zbTASI7&OSkxLk6D<qEUWEm<N&;eKEO9N&kZzJ z)EIv386^^raa7!w-_~D^mvVJ>?dGg%&+CSGSoDZO*ZSf&$Ssx6_62jiy>B{|QpWe| z?&<aRyab?aC++mT-ye;%?Non<7W`EJeQ1b}Wo3r=Z0V5!zB?Z>z$fw>1N>12h}y9* zLa#nxLXY($e75R``0jp)Pb>`aM~@kzt&}0Muypb{Ho@w6C-&;<_;+Hba92$L6kI3( zZSxz0HQfSl!|fB_80@-}z5N9{wscRiHW#=D-=SD>M!lm~Fo4a4J>~j=vB4zB8L%#~ zBA)MB{Xwwj%@VuV3x2Hspg-Log*rz|8LZJZyjy+XCx`<6-NCDyPedxy#oyWFL>`kG zDY-|Wce8p@CjTMUQ+k6xP>q&ynx0o>Y7m*xL1NlP3w@%3KlAy?DncG+Yl<oDNbQkB zvmtq~e?An;^C@_u6bB-4pb0C&Yd-DHpn*?S23BB^UMKRDLU62uX&iqguquw|;e6!1 zp0bVh9LEcEVRF=$EQCB?NJmJ(9a+FkpbAzLu8z|ZV40H69@=wsK99R+enf8grZMQA zjoOY##gIYwO&@eWqUTb}OlBjxCghr&S359M?cu}Y2E_KEMf7@ab+?YmUKn4-(PscX zQz4EXFGGlCTyO~iRLG8RFnIEm#R^46IB8<u;sP9Cc+h2v)96OtJmN&Tiv!D*a$aLk zO#{&FLcw9W&OFF<bC4#p2x<oQ+2o;+`mTf0a@bNx0Yw8_h_Yq<GS-D0H7-q}0o}$_ zH4bF>l}9tCicM3&2tPWI%tC8vr*(ykJc;$=RrRL>T|NW4>;$?bdVn-65ivE_>dyws zd<N7>1T|Qh6lI_$@i$RAvGUVpIJ`-W)G`wGjL*^qc$j93_1<hzXjJY(C~7zzZ1HCR z5nv93MNw}QRq)I+!oV%2%Ib36!t|U4`2(n9c(}LRKj&D_2oQ=DiU1)VIIeRr`0!z{ z=ves~gu%3N!wDYzOYIJA<yMMCMW|(Z#R|;WK3z7D@G0RUG9hwzh1$db&Gr$I25k7q zY1#0pY)T+(-0Kbnn4E)aeF5)QrZNQ;Z?uuLbU#0?=f^dUhC*5XfMvQbPmQ+u0x@^O z0XfrSzGre*?mPc-%4d*KL~F8H{Na@NJSMGc^>0+KpIibrH>M`kl{WC-Gfwwo7>x4B zGCw|3Asw=6_;D0n*=P7jkS+%^&9kIH6GYbf6j?E>>n;;yQHw8Bo;~*uGEE%yK1zE^ zq-)+HWDU4;7s=Og=UTCeKb?y@^^u)>29Fq$OlAd}A;!2Cil$oFKX7QLZSDrS=$fY; zE<YZeUUZ4c*B>cz$OQ=HV-PpmQ+!{$6<G&do%Uj+Y;2w;)iK6qdZ{POPR=%*SFU+y zWg;n_CP~OC#+Yr8d4iaQ)3p6Cv@yD)f00RZJwmV9t?BHkS$zxZ;OI%ea)B8LN2vhH zaD-EoenCC=#WRyLTdSO*W_qmE`t+=Bn~R{4hp-8z+;zfZMW{H>7!#|QQ+)t#dTKrd zFM`UbSkRX*qv-|L(z@kP`jO-Ij)^)(e$pC#!!2|bS_5!+fq`Xg;_0cIZN`=|HA|s* zl8`J5m|<#aAeLA{wxAew87phf`k3#7As;YFP~jPSx@itT92B^nW5``1z|ll~Cwz|@ zaa}*VJOK8Y96%6cl@8;GITwC}T3mPtp1+bGwo2X5klPD6Qf5&m#c*Rj4AVmt7t7?G z5vTO8)$b;c??NI3TBSLn-!4S{85SR$6kY7tW6ZIe+))evIsAj2wQ4-zKayLvu)2q~ zcXNSHC(HxdfCDl#oUJ@Gy+|m}uJ9y`4I2Q_dQRhP4nMM)wvj;dG}fQ-%i6oLF?MPM z-tA3KNd#}uNo?K=BtK~B>56}F@BuOI3&N%z?J@627RhqjCb<@4VcLtALG}y$x_HyI zX1APWsVIGcG@U$9#bTkEea_Z2p|0>*SJ=(YH`W)L!upQ7T6}g3mi>c~I;a+hVBN(| z#1&cv6>U<Zxi}CNL3L*5Z~#znw_&U(L;^Sy7Gx+8@YCo``a>=kB>Wl7;;{bR(^H!B z`F4%Doytr^ApWiP)Q@2gFj#@sxA^ZA6y9&Ao*2cd#7;_IfXm`Hk=1=nx|xH?sfOjJ zJPmXFP{bOxr*5^o%+n(kJVv@eM2N4{H^!wVu=r@DH$zvb`vmNaJ5R08XIGyo^0m|l zWKDaAeGzm4Qn|FGaW~kzFl5dcA52N!S<>r`y5Ke#wZkSy3J_BWGbIyYFMU3&p@Zm3 zpK%*@>GkMS&{MPPQdY{7$sK}SvFp?<94j~n+EWo-vfbVhY%W%UA+l%@hlPlxT++BX zn!snWXa~`|=p-+ICJ{%`j+q_XGMC&uK!C(&WY_^gg@9j{UZ2kL9Z>@-BPr);M#mo8 zy_tleRAb~F)hh{Ep%S_EAS=)Vk^F+|d}fOQGm;=;uisvC81njOd>-_>$^9AM-NHG7 z$i=5vbHzVwNcPjaNMKZ0EFg?s9Tm(W<f^ed`JK7)LKvzJT;j!E#BuZdDHU6O-a+nn z%NI(~znV5lDYo6i?QXInQ}W)7yrsw&v6D;WP%B}C`4Uq(dyfRTiS)f$Hq$V5+r6tH zH*hNkYF5#Jcxm{#Td{2>ao>#EfWtlxIia72k#pE1XD#RLkW<!t3~~m8VzW4{Ic5&$ zm^pkN%w(|>F(+)Xkq4WSqyX&k{}v+EHTVnbaP=XR8xtbkk|)@EK!*pDEhH@@nvhf2 z$05F&Y?o^^c&&(m$Fb8A04tY1Xr`)DM^rn325<8_S~d218v*bvJI+Hge!r%AxQ#vS z=J<nrp$5bZh-Jc--5{=)ST3-L412wx5Il?Dve9^bz>nsM{88UzQ*u~)vNXLokPBj8 zrt$5~t&Ip4h4CRV(5rzp!nflJWY{8>w0kvY>j)BAFwP1?*x5-StlQ{-aZA{f>y!65 zX$g&w022yW$`*4*v_kgX(%<CrNt{SoLwe9j8d4&5{0a&G7_K81Md>Qo5K|$h-8X^% z*6n+d%hL^w#fXCyoit*^^5F<!1iW~EL!_*@hxEimV^{A2#gLZhA6XH)Af)!VwSo06 zQaJbmN2Y)~h|L*-(g1`iLk|G*GzP<DmcYkO>!F9FA9ITvG|+G7Ma{pgXG27w7dpAb zras?Zk&2#gFFUerR2nwx`An@ykt^-FvQ<NhESpblOA(E&ieVWGbH_(c*s2KsK%nGR zEa79|P;{wfniZH_fwKdV^E4Yw1S3K@IKACo@yG#VV_1Bku<v1@K;aABc5)7WD*j1` zFNTm7+tv*$R>w9Tv>R_!durpBl@`S;<;NhYXzeA!0Gia^<@u+Eh&Fmy!>vGG%eC33 zh{!+3as-c(_L8-{lP^LddZt}_W%VD_#e}zZ&)`epkf;4G1i|=XjexDv5@h_haQ`>$ zK$^hsU_!5|zo<>LD(Z&Fcy4?Fj}u>Flo~CxT%Z#KPiWrJZalILDo?<n(6o5DH%(ET z1SoEH5crZfGvEW9F%4gzh!A0KAmnLrH0|<k7M&tSL@jptaxJRRTxHD#EksZewOv|M zy?||$9W>bu-C(}IJGF(e1@m3%rBi8+zCrrTZn{BF2(cuM%_(8Bg<`m&5_5$yC`Vrs zn@>AyHaF<w56*nvoce^TE^<GW6#iXlDic(10qmR$LIZN5EpSIg5+#T*XF1`EJ{|ad zC3Cg1PVWYkigB0PE98-I$@>hFlm*r(6jdq|td28MteadGWiKCF`f{efl=iZ>t)X55 ze5rwgbWHnow$EtxlUqGFC2MBn?5u%-{AQJ%QqL21)&wA%u+xPlVW+bqulGX2PTR7} z4eH}2SfjFfFFPbMG95Dv#Ke;2+Q{L+`bQl+DY*pO8a;Ug_7R2mcza{IQ%Ft9WF4RP zu8$x!j;hNDO&IR+QbCfFJ|lGCB)vzU!&y)k7OPMeqRo=}a13)kBEF$4-Dt6MWA7Np z39f);aL73<9j35ck?PE0S=|;a-PM8rJrJK4SLlBkh=Jg9Aky6P0#OzD_JQc~_Vl{2 zaDW(nzIY%G1Y!vL@}D4P6UK}2T8gI0w9qqN`!i|rwDu`n6~Bp!==n)3#Cn{sk*`k3 znkYw%7*_O>(AL#iA=7e5^by~hAiZs*16_$=f=zqQldYjOfmX4j5Uud`ZSfHM5eW?a zP-Jt{(WoO$bZO6t!rS9_m&quKkp`K9(KZG5*m%(?^!;4f=X{YGNd&0Qf~7c9wdbBn zquslSAvm|Vm89h`F*l^wt1s+zSrAfR47}ZWGDH`L2l095tx%2g;H{lRj{O1)RW=y> zusxqc)m9xAYGx2w?wF?ooInW(hNz~4n2~xjGl?X2*V+M<A~A`k=1}S$OgnRz)b5OC zZgZ}}l}kYWbR#%Y`c%@-@)2Vf^tI@4q;+tdb#1X}H^uAN1UGLRy_epnG6=7u<)#!N z0iQ-h{yhC8ly>1n8_;Qi8Ml3n+n047HmY@2QMDO<X6_mAgc*}rt!9b4R>TdY0GtSD zKzUc4zclYwfQYR-{<(<In>Dh-uCWL{2z15+4iHk+kK+Hy3l`^euj{xv{@G~o^HnyC z5jSEb*6Fvx6Y^X|=2Q}ZaV;=Y82`I?vRSYx@gMMcBv7mI`2p50@wVXx42z4u<Dbmp zL|%kiM$trsQfT~syMRxULPGnoe;vpH-InZ&2t)ACZpLIe1l!%J<L@nn_p)k^T4>o9 zqo&c>7vZc&tFq*{E{O6Vmcpi7ySBM;nI?l5#4!57(A#`41Q7h?YO*KfSR0Q2Zel4W z+GlU{H(py$IGCSj2DG^k^zkr12D}ge#6fO`7)%(J6*#Yr#@3L>tg;XQ1WRy_0ggBq zzheN9Gn8C%G$X(cPYAgn0)W;I2LP>kliqTPJ^%<ck)Rg*fb39CY30J~7y#t0YjhLs zCke_X<igYlwTi^QStAC0C;$k1^;OI&+T0@m$S4H^fS7k1C&DrSNN4TzWd;CEb=*b( z5Dt(*`?3rG!V$t<UhFCe^*jJ*8=Rd70NK^#0wvT>GXN-i2{~D7%0d7Tx1k;Bas`^Q z(5dS0{Y(A+9BUW>K>B!CC#DZ+A^<3cQ38Ns7!-6E_b&thK~qWqkfVxYri8)u(>BHi z!atw$l$hZAU?EQ1?(B+O$X3os8`{6mLtLx#03fL|zZU|4*n91C4Tw&!wtS4IQv-n5 z30U;nX$An{xM`;b0KJT^YBqcC=Dx~v0)VDvaAh^LsoZOwg^}IM_UeaqZ*g#Ii7@IJ zjiH$b0L7xL(T|YI0H7FIS$+p=Sjl#bvg?wyxPGWh0)XaSUYE1OvLeh#e4PgX)qMaE z8znjH8dP@e`2&Dfj|~8dr(Z<?P-_5Ci(JwL01=xK0YKGq08pJGfwUt7fH<|iJr4jP zXyYnuf60@@?+gF}h1*E0SC;^wqtJ~@?E1~c<-tp9d3OQqP!zs9P|N_J)p-DrXQTsp zBLE2QY^Y8!Y0zG#i4c>#Gd}j>*RcUWpdi=tOpttSa!LTuDt3JqzY72Y4MOHA&1J$A z)^VEvAOs)Hxb?>-SJ@#10A1yU(?1jdg#MiYKwNAQ0YE{Ey8xiu9zHvMB?ExCskYv4 zFSpy%o$;6AX3CxUPHy=Q21Bpso0%!?Bmt|H+(AQ=4S%qju6gCuszlYGex7|OGN2Qp z5n`yESfj_~2+@H1A5eH6%pW=DF4I_?pUH5H%d?NdCU?d=S`qW6Qd;($I6~cE(m9G5 z$AlX^;@-Wr;vgQute|V^AS2;TScD(f^Wz%tdIxb7Yx9K;;yYSQTsnv+Np1bxHV8^_ zk=1ba9Dx#dA_M9uj!Wnei72n5_%8ZcgGKWOs?h!C+YdJ>!QMH(pfv)s);)tyYK!IF zM{5%9^ZAJy2~Yb5ni($QdV1Ozjz$Z|CN<O>rB|OIV3Hr5Tb4vFDCXKvam#KIr>k4G z@fbab)NWeagu5J5<XzULB+(ao3p&5-X$)#u+Zz3{(IG=Ha1ZU0?g-pD)-j7cYvhPN z)R@OAOm!b_@<H3gsd&J|8hnViI+wy>yNOE&V+%$qrAO>_d(+cl-Uz=_7-v$>)$)>a zcJK#I5X%d2OcSga8R`LFM&4VJ#>vfuvttL2n|;N}d8~F?IfR`$gu$iLa|NbGUfGxz z;%&G|H?iVb3VowEKQ`0(LHH9kG*p7g9Wm-MR#1es)6>C_4<?(kIfpOM9kC8uZIg~D z?L`r0bUr2e^Eq0&T%KlD>1H{(L%=cq_RK@X=$>is@WWP_X(~o>Nn4|l1*Z}4AtEv7 z!!QvhL6n@lmKjz|hwYgqohX7wu&<m+`v(d2ZRa9(wErkVmFfRPziq?J@!ReW_>VI! zEIF6vVJC2%PYHTbzYBDRfC$j&w>^#DHsId*ZNoGkv)EDtWd*>m0iX{L&m<c|5-18T zVO9EV@h}L5bNX%R>56}F6XE9!zbzaW{gmmG^r~-D?b-EdPhaMIv-cF7?)<h|jwwxZ zmhLR{Rp++_VlH%O#t|aJK%IumjKwi)@!74L(ig&ByzhsgFWC*c*oi1Zt7=1P-&7If zJA2-_9K7gmd*fKx-ftT|B3#wHMqS5wlYU#$V%$C5Qsm~Fe%r0iZ@Yf0-TE>8wqxF2 z!bE^GCj7R1;<pW-TcDPemBu239y}lG^ujhC-Wq-r`>r-Q7Qdh>x7ySCU7^@Krq%G< zW_@&m&To6Dk~iLPcP4&Y{QXfM187$t>(;zJAgj~f4qXDN1O=#;e%tW9VFf2pO%*5< zpPkMKrp=0Bn*sn9*86R@dLtOuCE>}3FFecn^wSaAP>f)Du)qWj5~a(XjC{c4UNjD( z-@Mz%2rshAv)e}+%-}w;5`4h0lXs<ij3LPI-5eML^=?fA_px+51f*$-5G=Nz{Q`Wp zuYOyfVXoB=K?%Psy*^dQKy0({Y+~qV_ptAvZTN#?H<xO0-Adx-shFQe-y|T|<1nI# z<Pb=y8MddOgi=@hwh<kM55(uOz3bisOBx)8+i!F>Fld)i76&5LyKv5GZweI7T2Ub= zy@q2VOsv44P>CsQ(ZycG@g%JodNc1J_q*i_rRZO!402-|(S&6<EquLO)b2zf*naF} z7C4^C1CS`Vawh$@i)E=MZz<cot6^A-BrjY+1cN#VeyfMN72T(Sm<;(i#3an;Fk+5- z#BAis9b(G1d&A-!F{4ASVsiL%tR!7qhn3^o!OD=dG;7BlrqFzV1?aD(NP@@Kl}(Q= z;Tn2u$A~;eYDyrgcI#mz7Cy+d#?$oJdN!uSbplYVm3nL&Wykb{5{JMBpL=Y*B(L+> z`aL|hqt0Us8Pj8njFlc+Zf%si7G&0)U+89X;CKyrBP`&6Kk2b`XN1RgVQQ)O*BGkE zrgX>l2B;mTHzgI(9iJrC=G>t8Ys;%SS3hrrTi{TN3GN^XI@_lVtS9J1Ls^i<M-#*& zy{vKyW>**x8GbtM6HyY!av((w=|CrF5c_INT+US*Ut&LuS5p$*Mrf^d`(BhT2*#kX zlUUGv#HOAaDVB!67W*<yVp3zGa$<ObtP>{@Kae5eegbii2SkM;^hmwH5C%a3cMf<K za?${FDnk!Bi>EOdCbI-S1E4zSmAwcKMNzguS2W0#{@S>kW<V!*fx&z2CHv<pf!w5f zZc>$Opg|FW0SN<kn?{3~t2Uxzxi{Ty${gF(o`0<O+jM@dCj6u3NLjy4wHyF)YDSl< z@$M%6Pw9gvxMs0Uxj7n3axxDb1?VKL!{P%2%3gbxL7&wPuo~A~hQAhM9cPdTsN1rA zk=0JKZ^M`IMs=Asu3T;hleLr{gOVaNUQu!k65CF6*TRs5%20Q$>W%JNH+QfmNiKY+ z6DvZqL3dej*P_p)yO#F9fMfewz2L6p*OI#yBEVW5<E|Zd?pkWB8*N_PwHKB1G`_5* zyB2aGs!q-;gNGa*j$8AX8k!a=LVN=wlpeu|WykGBewV%HTBq({yk2^IBV>Vi$)gn! zgG95?Jr)}ETIPA13~e-;-bK54m36n}8B)k3N`w87I{EJC8@WD9GH+KUhHZzoh8!@> zdxaFIpPHU6-quTnsRcW@1eav25wwLO9X$6^qGI}HEdb%@{IwDHBdwG?gk*J=V8-^Y z+`wK&nR^n2;N}!m^*IamZXoy!ky0B3?7V=#w%o+3IHyi8nON}1474CETvx~?yPdz* zuvATPGLz$KG^wvJn*HQeb04GYmHyg0soY<%*u0RB(YEZ;dj+xT5LeF^g*aZAw&v(C zplIo@rNkqk2p`2?8_R)JmF?d9Yk7NP+L4-A{QeS6{k1`AfXITsc1~)RBm!a5lbX4! zG5Rc&g+S0kSquycVx+&e9}(ZeU(5aKl{7}a!1(szdVI`bX<StLYwsimribP3ZNU<i z5OsACh=fob<9pxj*K!$%5l+w#*&zmqPXeO;+S>=>+VMb)K3_Z#AsrHGX(~#OFkCm* zf?SW1G*$LO(0J|7B*w*G%Q3HZPX(0h{?2lBGJp=dH6ZU8e?oqCkH%RUXjZsi<dEza z-@=!RSlX2c4<u)L^vPj}hz)If9uW$EZBTa3#~kw4I#M`*^dOlf{@R>O+)}OCG6g3J z&i%Epxujef1)pv+`h<9O{@RtN@^bZe<MLUe0lmK#bK&wP)6(DjYtPR8wNUNiug&{K z?IiuR2@B9f1`prQp{@dhRaXa5a>-wduL|E4M?nHw>dO;kcnw$!{@R^@Aj;f>>5?DK zz7Us?Z64#VEw`cT#A&y~V}ZXGi*T_I(>k!^|D2(2tKzS%Tmkq)8i}joueIEiB1`^S zjN<bQq~RTbT+mH>we#0ftusz4y7RO6YiXAjCrU(pE9tN0u912MV&wMn<`I8^e|YiJ zUrWG@nsC<`8<P2n&P)DUi-*7Vd5af+?PdM7G1zRl^VhD@ug*OEwGbX0u=c9Iwx!Q0 z?z+xj%i1maYpeD`6jyH1Uu$t3YREDUz4&WOA^o)_EheqwA}s@1aFHSn!9VR=_wbUx zHVa?yWjAV}Wnba1T@8Qj(W)#t=6#%Ui~iaw{IxYCvV%hz%!S3l;P1g-d!hJiFL)7N z_-ikWzNM<j*f%Q)=N+ydbFj(qR5Lq7%)y^~O?{>J>S`z-h~r1Rx>RK%iu2&CX&nf^ zb7z1LppR9at7=-mR{s<xeyv0dym)nMy}CPAhjze3VsVyyw!4SDy1R$Hy1TR9s~ci+ zXq3tzK~terGrYR?OE=MebXGc%pEAsd1}8)<cYX}|kXN_DbBA35{}bO1r*)8urdK!I zn|J8dy;E;dcy&dt_Kq&CL*3q)UR}hjF0BKDT=44JRa|SU4x3(GckQH3M*)Lf@ai&X zDaKNlo;+CSR3pm$?2mcBy;s-Vw5$`;hk)VLjbX%2EomLt1k%4nuP!cI%z>IPgO-?w zzl|*XIR+i4@v57%-QU*|3(@;dN6Tp)X#YM1sAlff4N{2cG*9cmd@_XufX&|Y>WXz_ zF$TEz3=HWe9$v5RUFp@Gdt2}1IbPj6a&SBCU9lQd?oGYdItwGa7cP`uU50h<WSe2N z+vZr{L&akIkXN??wdegTz`;?5S9cj0Q0?o7fPq(c-sSZP79eQ<F<#xB-m6=&DzFyd z&bF<d->cgk>(z~?UxioqqF!B2>GfXS#=Qkzacl5$T89uE1`vYYt2>%|b%RyaCwO%O z=>xuHa~*{)QtZ;^TE;TGx&hdsD13LIm|opx?$vdT0-eIE%T~~<8>}3(m$f45B!`WU zz4*1@)s5bBSa@|Cxpp*p2VUJqF^k1744YMzVRy|j3R~yFQd);Q*pPU2)yJLwA+N62 z9|b+-HQ?s|Eg2Zx8L{2@!<CM1+2xmwv*gd1*sliUJM{hpiJ}`IQXn4W+lEbTB>O0R z#HiUY1^zYsQ$W!Dx?5bYCJNe=J=|zFg)x>LKe(~pk88Z^U9VBB%@?{}iE1#y@I8|Y zNfNuiY|(JO@(y{1zdBnzmAixX3!&!-_HkY*Z}$159Kv?2hNl&kGd!&xPE{!67oOHF z&%Z`2c?p%}Rk%J)mfv|=waj^YF_wg<r>i%oV?C{$NSTErXDp=}qjPW?g6P1gZ6|~V z871C%TDK7Hy<J65YYASDuu}9wJgvxRM?J060ep35^-RTo4O9f0g~*TfW4N`eO@|@N z>cNt|={PJP;YvLNB2l$7Y0!v4i<mtQ=w$KSNZ=TwPE+KxPhd%0d|HI4C>*FrK+Y4F z4WppWR<?#}5MkqCYDkj+Y8PDpJaL-t4AKUM0+FVMd=eIi%fw6YlNqeXsLNPcDs45w zR$ayn378icH^X-}x>A>iJYj+9#F?ff7hNt-bGZs9&xIfGUeiTMrcFO=6~T*vGO38w zs9R<clOoEY%!gqLmJ<3Ob`lP~=t||9=VR2_wNz)%q)(thw8kL0u!dx3=+;k=1~7rx ztaAQO>LuMW)qMeJEG@wmENy}kz%bezWB5~IV$ovnNSU5dK5s9)aeF&Y7!ka><d{Ll z3r}etR%Uh_3+~%R19b^830=l|YZl0@o4#Z_xMY+b#)@~gY8EUvF0be7m>Pwv7_lyh z8KoAVp<xE_om0MN2&s5FHJa>-hX$D#5n?j)KcJ)tT@Z+p0TdbxPwC~%pxOZW<=ul2 z5a5)mGP6zb^+8Z+Q>STMv<`KP*|e)ahHQi*mC3Gl9@LFnsV0#`WLg^uNCMX<Wb@R& zHlI_RbIpd7<_RvbmA>WDCYZk3?9(~<0#x?4#4#X!tIfNb83+b5^$0I?M5@ZBv@Y0G zISzZMvTjuf4sKQM3F_OykJz=tV3*qg&e$&On~lpJcRe=4z3LL2h4}$xOyi&@=7-KF zg*{hf#ka>7jDP_lB!}KK&MlFEy0}))grHtrt9b;m=sVF}G3;X>P+gnYa#+U+aY232 zI=<=gQn*Wuiw}%6IHA-);(i8(fD#*<O16j_YD$ufq=k7TRxfUkBbqRjQh7#H45mzH z@0TQq<#j3F(K^t0Axgopk=Tx<8l@z*0&h#g`4k7$$`&=b+QP0_)7=C_Z$fq%2aW=9 z5nAT+*u?9HHZ=;P-cRBvsOHXBA>|M84&n61<aLl^TTS<BRA6;rSW$uBS5!L}-K){l za(RZ7AuuPG?;4t}cH|{Cew!$r5RB91uy)Bf_#6)FfYr>ioLlK$)v@ASg8VRnj?!Br z7*p7trJ8}7phUq-^?7~&HeR(RrxiIlrEv&3o1@6t9FLrdeLZqU?=m_&oMWaZ0KiPd zAKk0qaLIyuEM^iOjRJ=9eQMfB9su?=n&bnAD$aCWpW7Y@5>=%F%sCyZEOhD%9Jw?7 zO6O3GlsrMTH0Lt5YrMpv8a9QQV}v{jG5ZX$BwPz4>|8sBlK8r)Tmz(TB+9I8P? zai|8y1SLJ7F~}=04n7<Lg|80+lMNmbfy1G?Ff~<fkT|#zCiGj2E>*zghJ<js>|KCO zajBM9oftAg@GS*H(vC5(zQ~GFet7Nz<tGN!7HND06kt`kFT-IRoC;yA>yPWV7LqX# zGNH)f?nzt)BNx$-9bRzJkq0^?q?`)58UueN35n;W7pG4*Hmk5nn+dczubPio>DPn1 zwuhA?=FcQFu`)1XL!%2<onF{zE-?~MBb&%g5{gJ5KYn(*LeuU-=5WgMGhxFnQI6ub zJI%*si50LqQ^~>s*K?Ro8N#`gi8k?Nv+W2aDGt-Ub~kfm<i;B$oj2Cg(Zdy>+k`WB zT%qna-jWw1E!Jh@v38D?!G#z`b${Y1jg7~trQCSf&e>VX67ZCwNf_aBg%4oFuo%K_ zSiL5@aL90&Zjf>)C9$#_x7(dJ0(w52dAm)vthoe*&H0MK+vz7oei}e#P6><^{iNI- z8h+9XEJE;^iq&BwCud3_2;3t8xIfm4N|Jt3w#pZRN#Q3|qmTviEd8Wd9tPk&dz&Q+ zKPkFF(IG^z3!R^o8tdk)LY5LQw~Je$-AO+wD5`lW_``H7r0m-XuH;y5L6uQ54ciW+ zaV28&1=8f^TYM2KwSeP-YP;W*Qom+0D7%8|6Lr@bNV15RapX3735?}7r#TiwYmUAt zM>@ADnC+;bG$Wb0S_(<c<d)88O77ouizVerm#F?T<|Hkeo=JicS{{vcrK!yRwZNs~ z88vl*1%eW6b37=`0Nd>u5B{jvFz-t$PQlbzr*}`cnJs7zQRjN}MO}fUDL|O8%W~|r zL~FXFxb10ZNwdg2P?S#1LJ|XngG$KjkEt;T!$Ds|Jlogtvgq2=&6#e}vvk+H_STAP zPy8##TI;1_t+r*C9O*G}7V-FeiC8zy+e-s4!@#qXZc?i1;p3yYNy9@e(l5A4d3yuL zn9zS0LQ*VL5hTstH;}+=^JTjyFmthU1F>_X6FWC!%?p7Mq%0pmh&~6iVC0xUi-_p~ znqW@4Nu5)Sh;Nt{Z?xDHkT%jy>ilyOT#!?a2s5aFrEb^39F~IuOUWXzRNb#1UOXaf zTWpVh--prSewtX&EBn<Sq+Us#WgrHE&w&WF2oN6vVjoY2JGcWPrqE-6xJ0G($@RYG zIS`}IV}WRK(BXI>GJnalBvsnWRMrEPB)O5%Ytc>G(_#)eg9~uV-S(W?=Q*f5v)m0g zl{)+cD=M4<Iav1td(h2Q+@$hFBsbsELKi<*N-zka6}Px;ChLhEwS%}6Zqm&(&&G!t z)!cN@euhSu_LcNt6E|s2MqO~-^X$o1WhL0PV_4`WW!IWy+`39W@^)YxxuTGBpQ02k zd8~B_3lQ06RZAvFQGe;!vn)tAse(e=gqt+K_HI(@`3`E7ZqkGW3ZiViZqMaVd*;au zmfWO_YT;NbZ?6IGu;eYcNl!6?P|O}AjS)+{IZHR`5G{7;SnCLGkoQfod%}W)O&9B_ z&W}6ecq?Dm+dIR=2_#TT+bM*k7&logN$ntwxlA~$ua=u0%3wRil{0sj0+MJ(cj+CS zyOe63c~MgmKXITj8s^8xa8lL#EKO-;$z7_IK*ULRY1OcCF;OobZ;i(26^WV_Mc^fO zsl^wMw;o@-xJ$3-E{(xXJ8NhhZ*AyTsZMt(xopunZAN!#q=Y)%a<2xC`Z(UoC&ycN z6MsqVuynlD;&`eMY0#tE-9(5|NOx)Q%Ro%rrDY%s9!i8F+@;+VmfWRTm^@K)cd5{_ zuW*-==9uHHQI*|L@;yoU*(~xC{@f?<M1gkccx$v+26K9GFwhv>rKgL#^t2(R;VwNr zdRbLz!g@Y;>F7Ki#RdSfu3X+-e9U9-`W>C^OJ~`unDIwHU&Y<XvyXm0gaw<M(3mE2 zTt;k^+>qeLDL4OM_UsqCf@kLrT*5X(locsMqjWf1Q%u1K6)V7So>wIlQ@6#@#t}b) z)KYhS<R}zd7JS1W{YDw<5m0*p@sWq#o;>=WH#s9!y-#>8W~*<$Pooq|>J`^1Zv(iJ zpZEn9DMb5{y|Ar!nn6WY)Y-FM8d%MK=6{OibN9>!Bz)%D(~ReM3@nGR{}8_-&w2!T z{Aj*=B0t`pAJ2jklC%$$&*$<}M_icEOl|tX^6bOq^JC@nljZZ%<?}P;^OyZJSKaQb zYwrEEeWM*J53)gf!$ro2cvIUq4*#U8@xj%!{K7@XMnx8WG3ALQom#mxJTOG<voEp@ zhV^B9a1Q8q`9zzWeKeu{*_WVgmhgUcz6Q`1${%PF+Rv8HMd*73^6-j+(anb_3nQF; zDp%&qFRjcU^~$(%uEGOdX7vyHgQa<{EaOMZ=O_3K`Y$t55kZW)Ui6yqgZ11<=2v-l zXq@PyU@*aTxSc6_k70yfMn8HcS>7KPCmUT3MtnD(mKb>alBUZK{!&#p@Pj=6%!StV zzN~?KC@FvH_J3gDsb`2|5!i70!feMs95DsUFK3!o!!A``N06osdfm{<QsJ7*hT58p z*W({n+>YD7==JrZPoJsIdNn6EGKBlw<=8@KZe=J^<jn^@sM7m>{=qtopXW9sM1t90 z-F*1~x@_vOpUtlXKFt3A_Ra;s&f}`@-+k@t?&C^Ytya5|{oNZSmL1vI_pTf#)|F*j zj$cZw7!wT2TDrDYyV{j^SBjEIvI2x8#RX$KV8Ch9;9`f$;5rFVa7&;8S_ssXKvNn@ zS`1BTAOV~bAcg+^XXg99dw1_jtF<hNpevpI-t#y!bIzGF|CxEzodyKiH(6>_9+gW* z5w+?TC0GhHT!Qi5N(Uodlns`m7LaV_7ws%%dyBd>C!D>l?paDhNN7uOrErHWs>TRI zsa>L7U8#1Ni?;Bmh0EBgV#}yba;}~cE25~s-AcDuGs;U^mW8*PFg|CCEa)1tH6`Cf zbJJIYBxuBcwwih3cymB$;dEC{qJNljMA@NbWk}a%eBGI=1AMF4P~G$8?!)*qO3k{) zIK)$aH4}w3lxfd!Z1HqeFFh#wLbsIG_Ldq*4R7*#$bC(zCjA;lXDpIn7~U&%m)6+m zoq#-P&3ax_4(@PMoeAZ3?bM-O9Ih=AsafNKs01XBD+S-+SS=VKNG!Ojjsx?j4iv>$ zK9$dhPA$CP6*%M`SxvM@u8XQD%m<ugj8|$hol*d}AH)zXd>J#OL)R?9!P;sCQbeU= ziU0vJjM32><-fT%ERfk|gM%rvw(2NLv0J&@*eKpP)y#}Ws#;yYSB@Lj;|_HrS9sZm zESVKxd<$%HtP3Y_;fO=x!ve;T>xeNjcEtx@!d3xPO~jgJyQ2Hc%p&)e^;3-TIEEe1 z6CNz)Ps9cFbbYa_PO!v+SYophnPl6G3we2rQ0A!-5ic~@95aGa_WZ)eG}D}_s9XeD zur#^yW*WMpwLWHU3!UQN4w6Oh>dLfPPS($2DBPg=c0o0Tc?CK&L3u;`;kv31TV-<D zyR^#WL&}B*Y#(ZYYX)5rZ)(H=BMD~zsm>~K8n&g~E4@l=E@Xfrr5cR@D!hY7oHm)e zkH7hAgDtL^Z>FhAwo$%x*XfC?$#CX+(_vO)4-9cp=c8)wt{AY1-%?r9HuQq^!96Nl zBY<iG1ntBaAxo&C!|<)x%4R$w@dY}rSq;v)j1XhMXgx#U+`glY-Xx_Z#i#VK?1hA2 z04KSXDh8~%#f9CmSW?m>CW|eW5ria8Ok-WAnw<?)C{FYH+M`ab*1dtW<dk_LWh72* zov|8|gOZ8`FAkL`la6MSV}3i9%X_U-po+*JExD=GU_NVbi>C!VG4J3Jr<$-t44SQC z(p0G{6n04}tCH-}gFcGHDTF3F2^qDqLQ0p}Y=mfWPnH_#QNrMmE)$7|Pg+p0`8E|` zIaU7X%VH-`h)D(;c?mYA3eV7mWQv4xNB2_aZ?eHa65AAsa>0z7ROD%=<=nC(R44^M z1CWZyvf5Ibat+a(;=Z4en=R*US#L_Ye29(Q5SN-j%prdh&eIlvh)iLk{aCxw3Xjs1 zM`y)m!qR>fszqT=%7zSG9iTdqD13(QBLmb!(oWI19RgV%=IWqBuec>gcvjd*g7Q|U zLzF2jZ(+2_Buz^C-=tVT@F+gCs#e`#N0mh6rol|<nQ#)EYsgLG#~E^+{Hv1Jgq?ic z$Y2321G=S@XBl^*(V!tBO0@&A!VCEF5mGkp&U;=pF(uurChnPPvbK<J%SvRkDY1Q& zRzc>G%R+VO3t%SJI8v^0;Oi#Yu5pn1sBu^h;7U;Bb4(7Bf?Fb%WioE01XVY~QZ^Q7 zRDUnfIHP`0NWN7lFOn9LOVleXJtve%)ku0%nAR2RKDdDvX<5ao#z85XNaZ>grqwu9 zAl5jXPPN7ni70A?2Fyv==2EaFxB`(6O9^a)`B!Y$K1Jl3m|||SrW3YUF7&dB*?Bc> z&&O@dJ46iF@GFeKog!HWR3=@1uOK*5;_x<m;Mu~oJ;UctCUF*%%n>Zo!-*qGL&=}{ zUCR$oLqxFZE+TjnB3A(Z@+kwJ@UXK;5s5d*Al^z@ArPYXB7M&0F7aL=dJn0k_X<F0 zl>E8#A8US1K$00O3kqfBzNzqamXLAjaCb}OiThy+HB4S$LE$T@{3<>pgWTc&m^v7P z0xjqbt-O`S8C%vX?u8+&d`4)LO^ZvS@G)BW8>+u?+b7ohhKSOIr+NPdOPH8X3$Vmc zcjT!j84?}NcSdbfWnK6J^{L!^Q~qT<L$0%dxXo?C<8M|qe{9=;2gB^m7@mb@lHX9s zYaKb-2NSs1Lr4t;9l>^7a>nE=E7YWt&VeK3I4`gmowPZF-=s!oEINUBG1W(q+U9hg z0cocCWK=@}E=!FEq9{<B8Ukz9jfGLw#$tno7K@!(ECesLkzo-iNlyj^a%d2;n984O zOgBB0Ru_xz2eMuTLyIV1K3U%D9Ov-tHj;A!ey}*FcAOYV?}nwqt!TK2aLeg~wkhEa zK@e;UGtYl`EPW3}s+nj*3UITnMoK}*4nn9RzonTQkQ14v^fqKBO)y)Iki(2%+nZ7Y zfmD%(R2Y?j*+F^Bfg(`2a{34#$T&&e+G~r^W1Q3cU6B(39DgezV+`SWC54v*HUdpE zr#o!V&WGG#8I9cBfoFBEz_P|U-D?C;I`{0cQu{7qM|^Ki-y4fQU6dM6X|Cm|6Jh&9 zPYbHU7&7Bq8Gi%jU_QDC+gLwsPNtH=%`j>-Cp|`ITn3{SK+8<R1}9a4k?4Z)m%=(; zQYzVK24?D2RXLKV7orQ+X&`POgFIsu6*%q0Gx=pnYCiPQSdwj<E5tmtjfHoLIijRZ zW}Q5>%=;7@LzEys+wIs={bZ8m#mSn9;p%KT1Hitiz771|g=7nMlk-_KFH0Gh0@7%m z)GT&l7~jiqK`M1GXW=R@TsYo`8LeH$;PO1oE0UBbDE~?H)@{{qDZ6lz1{{UM+j@iA zGY|JH4A#L42o7PPLgocU6u%(D58#pDfohWN6dxtMi36MuIkekGgIWTE&L@qFKP-f# zMo-hT^4zSJZ)aQ7@@0)9AhdOxqO>MLtOzXh5#uJ>%9Pex=tOllm|CN?cEE@7XMfWv z9TbD|6JO^)hP&j1S%aDaL98|}BCWYl*}HfZ!H4W|)1a_T!>l9;_Vo6qW2Lmc5T;GI z00NWKA@@M}@;R)d%a8>uI8;s{^a#c2Xd*rVPJw|<svm+E6PG$Ck<e-{NhF{mok&PY zBw+J4d^5|NyQpL|rc3e$Q7WNwN#1;O$eS<zO0B$!uJeD>mPsF9#lGX#+tr^e4l$YZ zyNb=O_t@bqiY$_Y+kI$o-yJ~Err5chUOdxDwXg*}L5-EsP0}`SVZ%JK<oPhTD&2|b zkTE8E4sohk&>GmkxtIMiTWNC55>;tuJTR+XR)Pc_i=ZI>`j|`1VRNbbX$_NK9qhJF zK5#0mh;;eHgIX~iaaZg__NOx2=%ks4jd^AcCNi83*c9y;bIVp2T9|rJxQd_+8UO%B z`T}ZD5N>>)xMhQs)=Iz9+rl&g`Eh`cQ1^Cx>~V?2>mU8TQto?ocIUUlvfMN1DAyaN zLmq_D=WV!K&-!z9T3HeX2I~OQSdcgX-PA^`KdnvUQ(2wHjHMAPM8_nJ*(8nG1!<HX zP?u70GLSO1*N999<EnORfU96$o-Ovkq8iq&ui|KP4M%ZK6qn$rSu7}5<EW()jyBb% z_B0%gJ_jE*i;d?BWVxR&!BIcGxorVQeHtT<E{J3q99^#&wCls3w^@O)IVx>L-Pdxe zBY&o51;$9tDzofnC4QR0x}aI9H9ODUD!RvNV-$>xCP1?Wfma)&N!7M7l{=UZ3SSif z(;U|=jZRX*HMUIL*eL3Tj2axCO)d3=^I1(NX>jdz8yqcNQY30{!c<i^I7tb%O?BmK z$D}f!rg}sTj$w+~v;G`DsiolzbPbLLK3L<cy21HW`UYodOj{b&uRGfY=a)ceQ+rl} zL)z^?j2VL&R}q8P!lV>b!{9X$i{bYx;4~{anP^)fr=!o$C8wRI*|te~)i}+tKvhG` z|3xaDTfVn|)zE1zf{V&&psoTd1UO%TCL~D%s!xvdNzQ}9Vdo)mbNtjNU{qj9Ujf|* z)%h05c=Hdqcxa_{qN<I>=A&9Hc4o2A>8bJ+G*<fxp1I^Jxa2D+MDCPJzJeuv1^5Q5 zyak#{Z|(vn^T}P%jiSRrAU^?~)CPP8*5D&QK^Xf9Hm%rC&@R8gsp}Pz{Ku_Tm-$bo z7%{?6fR|BT0*NFLyjgh(8e%U&Hd-tN^HDAVt)bwT`ezcn90qt4Qr?H4adGD{$iyB4 zOaSjcT;wmn*XR8OnKStd(&hVZ)l`&p{+n3#T=E-W9-7zflHY(<`3n7%7hLxIVJel= zNE&Ti&O+SxHYVf8+HB^pjkT#$<p$aqI|?)$sAXoU2O4P8Q65YVnqQA8o2IXTuTqAq z#$LFuKfI&W<9&eIR8u2&E<l{m=qNl<fdWjcn~JTZ4_)96+OIxw5*o=%MWG26oP<X5 zfXee_r^W$Iz<&2wjezx+`Cn>DH3=fdFj7{d_WGxUPqwFn6u}Timd=7wQk07spfS@W z4e<N@Cr^I*ddb_Ypn$@Moe%^=eKGQChMo;+wa5`d#<<A{S~-Q=1*<&GvU5F)UuMzr zs+Vn4fzp{Q=WsA%Z)zi@_zl6}i|mLOa?8Ts!Vn%#|3>o%+aE!^@OZ>;Y}OkLw`qYN zwnwEcr^*d1D_#C-AgGKc=HV~VXmZo2@}RTAsQHV@6eCr5iKP}da{!gGi35YpAqR$O zHMq;O9b|pmq?@c~kC|Vf$72o-)5l}a{q6E2&5bgFI)H^5p4$FCZXFs;@8qRNSVn6L zM+TEh9>SpmwJ#6|$Pym7gfsci8{IzPv`e3G&V0fd(@?_k>MP-RPn2+KsS<9_c2LQq zgxh1*BXtSS5O2DV$4*UWl7wem!ZS(2Gv!bI5<a*syseZ6`jjSODW}!sOYGs1FK-aC zLU;%3DxllNZlyY7?5;|6`DcGwE<JS~&$cpJy|`2vqcUBhGDa@aq)_YC#>ao%3iaZu zj(&9M4E6D=zjcQCh&%Hv>f^(|qxz_ET@6c9qZgqMemYejNMK{_Koru2_tpav^wk3r z*f)}=$wyeS4oUEq(;*2`PU@gQ1U1mewIpx}pi*~PvvqVSEP=*7Gx<kzsTPnA1|u_{ z2~Ux3WYLDhOHDRCs^L~7CN?#DP!(3$_#eVl!K!s~*Uiq?ni6O}qzpG1g+(E<^oZT$ zPZdC+(EtjK02JgK=RI6@87UwQ72_tzNq>MOAcjJzS+G0S-gUF56`?K=_dIO{Mce3} zYtE>9s5$-`jzpE(&^X-(VG4XaN)%dJ>wsEJL<6Q#5n8w$$vGjA8i9qCgfJ(Rjz!ox z>Eck_U|02+S^HY8qF$7KL{|<;m&r1WHVj2um@PJ0mfZu=BV2$SB<)(g!`8SA&3R91 zNlQnRUU3GffjE<QIR^}&_<iPM&al0Qd!9TLkLqwnEb$417jm4!AV!ZpgM=Pw_6%y& zF=h~(_q;*|$w?=-l1F{uy<!0QV@>I12lv1_F}R0UuYh&xfi&o=qGfD{KD5fxAdRnr z&On)HsRdg{ry8BnMwW$%s6uCetA8t;$2RLkW!0iH=!;UNYtb3(^bHrQ&>0;uI%6t^ zP*8AFLT6w-0mkTX=nMc8A%ooh1_MlZNL_@@)cP}`GrCpublwe}!G@dp2%S+_h|cJq zbUk~F7;<Ikj84j#>S^c<2lL>`LUab}9q5a0RW4LC<2FPoaS@|4;>;U_L<u6N`|P8L zE%pR-1~x|xI>UT44&GqjRC5;Cg9~W^IwMA1EQQ1%m6CNehz-Yk2bwT+hENq$e#?vu z_XvAI2|4UV{Fbu2jmm0}4-1Ey7NavVpgff2oS`#JP)t!l3<hH8485QtLa=DXK1w)} z%Wk+rtsmS*vz9y{bl32ig-M)Ts<LGyf=Cr@5`>U%?*7^h^=U7%j9NUa@%ZO_W-T83 znKrASKouz<L62NmG-pdY2yqIA@>Hf$w0AEAY$OY>4@&@fA;3&}Cj^uV5*P~s3mGd~ zHA~#E(?m*Uy_C!-G1h5na!@Z1GHLT56Kmp2gG@Xm>}rSdd$^xO(4=2lZ^yb2M|?}K zU;f+qpJ`3EpU9iq(qvft)`Cx&Y47y{IrJ(L8&gOaI(Lo28l(Qi)gvfLs}5z>0VH)a z<tEdLt~kdWz?YWfzZTc6`zXv4)zF~DCZ^cdP9s$t%d9?IPQ9hKcv(4BRJ{;Nb-n6> z%CD1t+>60vX|3>pMHahcrwLo0h;_;~^(ahELTZWaLy>X&P-LQIPy}F8K1ihxZ=F_D z=`KG+ZaVc=C`_^~PO#ubWR0S*{J7jmyJ>dyy4%(G!fqY1Y%m+8RKTC;9}l#tiL$`j z+v^2oVuJ`Bw0~}f0cw(!Wm^+V2AA+FTNDW1*iPlvm%VD{J#3W3p)2fFS#@cztXB1v zNL@DJQ+K#ldSWLl4sDy%8DrQwjOjhf(GR>6?2b5P+Q686gc$}b`EKk$VUr7$%{(0U zeW-mdtj+EaE<eaH4l-ubIv0o!x!|tI*P>J=UnrI9qEvz_+!U_WVg&rzTq+!=`L>+U zMU(!7rB%mEsEHHDbVV!-kCs*+FR^aSiDRXvU6NwDxvj*yjmQ0$V;Cl@jz=Hu1YWrM zxV_(IP61hWe;=SiTen~Tfl|Y<u;Kj(QKC&Qn?vGEE}1$NHtz<l%CT{G@5#5f<$AVj z(N-em!?qJ)(?iFO>oF)sMg>{8rs~!)EFx_)S$nVPM5$qW>K@Q)4JN-Dx2L{`5SzC* z-i>r?-k$y-FiliOUNdXDRI$SKJ89%JjCuCDv33}CQ75o$sXptujY}l2qE_w0{#Wf% zJ*0v$Q$WEqlp3GLQvvQB6N0Rq3>%MaPkoTwH=YO^?zZ7^O0KgcPy;6g#Wu;-&&et* zgiP|f!gbR8U91(;b1K|$s?>12)J_m#(}`o-1<lBw3VXqI9xpYM&Eq_v$dBOEE@gU; z!K^o<TUd<BSQ2(nxQ$`E_<^!N9!9T#`36ODv$XJ9gobrwkPt%f-Po3P0t$eGv_P8t zqm()iXzyqV5Md-TPAQqNFgtxm$)MHfC}(Z5qEV!ta;#Vs+3DG^*F8@j(pIrXtJHzB z(}@J>A1NYYN8VAj)wLik$QG8tk<6g%dYmHCBtcT1iLB91sW|4UMT*Ey6GhbN6%m?Q zGi`XyD<X>f0FZ`_J4y8V@UmDRsk|d$Ezslo1oVhzog=MOg$MI*bV}yb8@wvI&CvE9 zW`70+wRNT6=0DSxX?m#Rc<NY)6*r;+6#sYD>vw@gG9zFIg>NtKFyyYSa%o@5C^3e3 z^=3d%*8^lP*KKefK6vGZu^{1&Z^4RYv3|p-m%PHV%(%j&+a_IunmNKPTlNF&g$xgR zLWCWe-o=I+0)EAI)Eap2jA^w-X$|Za(`yvjkm)r}`e@PC*TXMQTcze`kvhL)i1t&H zMs||gmJj3!dac3q8mlf7q7r2<s>5Rn)!Cdwno>vSR=H?)-Qdvn6(%Mv@J!b;`k=v5 z*BnPh53NaxjJE6a842Bq1=c*JFG|d&%0AEP&RUYK!QB$*{Q2T4^2o#Bc_gox|9olP zy#!MTSLr|?J4)<m5*8A`Q=ta%#5S(Uqg=S=8LFaWl-mmEsICxegtIN-wt=P1K`31q z>gjc*Mz0G=%#Ju$vc)ku!$#@C3@(Dgl`Ph%z!J`JA1TRW1y*o@HTb~bWNly=#9@OA zjLudRSaZZxpE4?v0<-*IS6W733Mq3H3klJUx+=Y?$lj?}A->k95rbDD!THl&>Uj(m z*73M5sMH|%O1+PjR)?$Y4z|lxnB5y5D|LlkhJ_0ree}^%w^hvV0G($i%H2KX_od%r zlS2?kkD((8G;Dty-Ly6&KqBZumJm>998B2#;ZpnKkFme(+Q&_c>B7<?;U8UC3`EM? zKah9+fZG(|E-8=dJ#MHbbl<H#?@~=sE=a(tM^U8f9%J5d$K&)i3lCEnbEYkFy^j{P zoBb-iw(e1q${XzuqhxtP4%+XfK@byl&7u8NZ7?F;EvjGp&+kwJ4T3LT|IsH)8-F;u zD(~gPjX%M=2}&@od#bj}{f=xD?nOOll~=x_6-lBKzuHj4lp>J7UwX>lmxM`M3eCGC zcLohjRZ;Cf>iz6ghr_o31x3$ea!Rvgyt+{i&F3PO6Lq$%k=hE?aJo)-Qem14Nvfnp zVJyMKDir^Q8o0W4c;uu-%_p^^$Qtx!$!|m5E3wSIAbhL_UMiGYq%7%kABg*Mx{%zK z(~HH#-1DfTXI^`hX_D2ZQlm0UBs`0hDT!z#XZSf3VU9%#)tXJ2!dItEeIKV8zAGi+ zGJRi}C3<!FI$AU*VOlkH0GH3(oc{aV)nYL5R_jg`N{S8`%-`XsoY~B^GpN*E=Qzmx zb6u$o8Zz64)(~RY`%EeD<>*Z3qZ)IEK6e0e;bg8IA~zP&RP~JdL=DJF@75^Uvks_C zN}bzTGf+uvLt(wN+6F9R4xwy87o}xIZY1l(sYh#C9(aYUPqiq9j+8D1#C|%2m6=p< zx}!8(0ED?k0dGe4FAhlC6Iei7TtG}lSt=Bmg`z)wC}S>^p{h`*^H>Y2MZOhs7UHia zu!4F8JaeksH#xJ33Z*vJq;QO|D5K{-erDg~Xr%6W@=z^B6QPkV)@m8%H9s>N5c63r zkGAI4p>=I-DL?ZoZfj(4h+TR)^wDoGFvPZodPPgJ136dWa4<EhGNNR&CZpL}RHbXi zwU*hDDa|!L0*bmxT?Lk+&i7#77CRhIo%h1ob{l2e$+<3pLbo5o3X+?GV`Si6PUt|` z*K+{$*~5X&oI(zn2aCPBIf;T+0*XaqX;b;Qe+b6QWt(kexe02Fq@#?xB6dDW!H&bZ z0+)qk4sMnV#gU9PH_H~g-I9{%GXfXBy;t8C*%TQWjOQ@D%_@Q4-dN%CodRP!`f!7; zI}}2I?u=|w3jip$3Y!VaGBootAxpSQlt#LzK8?i|*F0G7vvo>|E>cHyK+UoQi_1t+ z+uq9tOIC?)q#|Rq6ExLH$<c(<Ra7tcMV<=W7OqymjJ~mq$_~Bj*uo?35FqV5pgA>7 z@iuP2De{vIS5Fl?)FvRT5?c&J)s}Cmor0(PVC<?Tx^fTMG1$d{<2VSdw$IuQpnBXC zu8JOW#rllVl^%8^m-a0YYTrwC13iF&vL1I0n1&vucV&qInoA~|RUpk})__P$^U648 zQ+BtPGgZ)r7F1Z`bT1Xu_zIh=%HH2pjjes10wKtZD<hsx7JV5}$CEO$z@k!eF}P)g zC+$<MXRh}d{-%amcv`$ushlIBoONmSS1k|Xlc$8}+ca}AmFgnZyU2zMq!YjbOlzjP zB4H52YR5=5T0vM;E5+iINkc#s8gon3E~$jfWn9hKwn<gPE<#gvU^>4Es8u$XgqEch zA261}t~=YBNhg5!>u5kVP6}s0lI9F=BN?r_DFN08L$|a>bzVF8v_PtKw);ENbThHs z&9fegWtp;XH?u=g;~x^Ros|gIh3g2ELMqfeY&zY;Rzc$H1*^q&sd$3jVDg2o;`LJT zlJsB+;hIvExvKO?vhyKpwaWc1KO@Yi+?WVNPnIj%R@)Rd6njOm!adBuh!QifCN1MQ z+uAZ(Bt-8?%SI|m%P**moK?s+UMlgdbp&a#PF*Ps6H^#_dexbSURSlpx{Ce17U?Pk zpL?D>T&$~XOq57$G=}B9!`SJcn1|}@MI(PrRun588qJ7pjsa$aXU$fo1hg13xoZ`R zTT}uWrevxdTB!@-w5>|vZh8@7BC@GQgt$;tzUno*Fs#E8+u`a|RvF>k_w3d3)C<|` zt#3?$#K2BW0mefedy|J}WN&a@*=y=rwdw$CGhOB?u4-l}Kwt=K8?FH|&z&K=LyyEz zN_xP}&B@Iz?rm;vNN$Gl%|db$ADexSl-Y!C>agYU|0E5#09gWb?Vgg`QH4}EFc+nS zfwnmy>MXBN>8*dn0F@byAbxQSl+uPQ&}bFiFkugLw`e`RCbzKy_ieW=8X534S*UW% z(ry*JbUn9icqLo3Wp%aBV^NN-G>xvDA$$}`it1oH3fWGR>NT;xMlnVGbfIFuQGgi? z|Eq$4nSR_xp3DN=yDG>=*G=xaDY|CANj-1XHNm;LH%vHXh+VR%CCs~$X>zj2r{Ci7 zv5-Xfm6mt$y3UCnDtGdt*6GPtTzBV7uUGSdoA0dhJ~B_f=4xln)pb=@XBtS``|8J% z|3pWso6e{2UcqW|;~kRbQFPstoH|As6@;pV9#H1I=^-gO2T6&$Ee?``4mDGgKUHv) zoWW6Yz)|Qy$LH(<hme*jZ(>+h-9kBG01Ns{2{c6)PS6XQ;^jmHO+nOBI0}e{X>Nc; zT?RQGsL?JaLQthMi53mIYCxBS#a#v)7dFA_23=iuC5EPCysx|3G2pQl@Tz*Kl?{J# z<(w9M;K2~)I)^@HY>^h$pun<+u<Uy{(vPuebF$vC>^nJVIu{2l`wbjuVH&x_Vp`1s z%bvkYt$z_)_N}N>V(Lc9JM$6)A`7oe1<ib={e>INp3&|S++b&)sbaG<Da+@z7Fm=` zlQzBkWSvsx>|nWvu}*AxYQ~Wy@znWoPotPRuz9TnTJ&g=#wgRUMRvRv#%l5J(Z5Jc zdb8H$GbS;7%eFesS|<Q=Av<e5iAz4E*094_>x?{T^d?FNC9gXaVuAbg#;2&bW~|F* z?{LOCJvQvO)n+s~B#tB?-SEi7wyW55cMofgb$ynaC1Yftw=ra@z9pa0l^(W)wcjdV zWMP%Ex5}@PW;54TmX^G-N{%`p<;=PPv|lQ_Z&rYSy#8l@jo9c@PYa6>P?WP$NoVat zEW)K9ViDF4wn4%eUP=l#+Q>169cDNUJxUJ?+1Ns8D!3#{RU1Ckrt@?WyPWuznq>pn z@<YB`YL$cr;#TZH;7~oWOnjG)>#7RtI<eNKCV4M&NZkd!pO-1a)@*Jh!`Yf@17VvM zmn*cTJtuSFYK+f%>25PSN_{KYQGPFTchi@yOP4EMs<SQPvDS6Stgc4ZlzpWBhdLcp z7Bi&~bF6eJ#|mo=$>&Oat|ua!oT&tk3B0toRB=N(F$Iskh)f<XAtH&yh69uYR>Y$i z$aL&EC4cgdI!S33E7qoylre~JrIHfXcs)>)cdZPUSnY;}tmcK21+`XtA?AgqGg`O; z+IU{zYIV<(hiBx4jDYjWi@5*O<LZ7pW@O$ldq18}b(~IVyHUhCO1m0I>XmlYh@x<$ z#-AZK1kzVj&yr?idWAn#YCLbMJ1;d(Wwh!_i?(_x4N>c0Z*aWEu+$=pt}GH0AK~Dh zCl4K}bdetQ@hDML$V7DuRT`;o-*q}y71BC3)vB9ie!c1@pVi75sBWyRrHO4N2~*ZU z5FGv#_B4g7rHsvO)XLCH>{fCzOG`fDHuGxH3$l<6A2e8D>+br|7Vh|$kW=b#BPHo8 zEz+^9UFhE<f(1HOGLW<^DLzqwQAz+9lk{c@1hknBiql&HJi-Pdb6K<C$XqT~v$#7M zh&8#To;pz6Xr8_XP@J~Zu!s*!g^FzPSJIa16#Gl>79+h&X<Bj{y{vDwFhTXVL@0~| z9!~YuqUA4~6kbVUysTm}joDV}@_LVgxndT#2eU&9rB+wpF=e%DrfUz0DGO-PJx?C0 zWz-HhnO&L4X;vDLbd#L6TA&6fXGtulJ&f>NS+tDnnF@0azb5~JS0=K$)#<H-AFg(L z`QZ8CM+4wT;_y%S(H8L|d3Z*CNLHUue#m&D1>&T2vf9b%k6kp_YCog26SvSMZ1p8< zH4>V7s-|hsX?2~D%kvB{Ucy#0SwH{?^Msr~Z1sypMEtU`)ysK1|DzWXw%Q<tb+FZF zs0fx^T<ek5orXcn+6I$r&B@RMd=lv@6eT_cH&Bz+y-EJKejHB@<clmN6T3Ya)u;wb z_n4=1tp+<nd06pgdDEa|*g9}ap>3KhTPq{9okmZcg+sV9ZEbMLIX~D|RgMM*KXqW^ zwFE-l%Vn2c;wM`Sp_VZp_Bsgly0AwBzw2TMHHk}b+PH-}HHf^Ek>LnJZ8yej#HJQP z9plr12Y^<0;N(sRp|((?yhWk*xxhEOL%94P4MJ@}!gJ#W-Y82~w>yBjRkF#Kv9cQI zoqVBG!gAr!I`KFIq3#rfnm-AInhQq7YarBI@j*QZH8&FoH5XM7YOY=t2zA3bgHU6q zodH6PJ8qpSR@f~Fb(cY?yD_(sRO<vkFbH*bJqR^Gb!wG|P`ja^Wx=Q^z0OjX!WS}$ z7@6}>J3>ik5%9cV)a&pL^ezRX?pXk%Ub_HBy$(BF$nw*{s2NB#7<Fd^qh5@kX2Rus zsp|lh(L5!+7{_(+(}tmp@zcE^Sw@@%o(p@c@Y6lAz(LQ%4{4}a;29@|h@hz+ewx_T zF?9$F(t?m-h}S$N%$6`uTd9kHkR>sGx=YHYOKEn>#!eIbbk|b&Y0COQsoUYFyHA6k z?mjJk`lZWBjv~M9EXE}~e){ac&1dPf=AZos4x-jz{xU$+z$5USI4^mR+`}3%#n<P2 zkG=Fm<=p0vQ(*EF;>k8eLwO7tZrQ*rB{v4stYYeu>T*3iRi{!;ib|VSn-fuYT68Dr zocj<pvhI89m(bGEPM6Tqm(bEUpjZgx<k44-mNq{IAm@LmXld`YvTU3QEo~Fw<yeX* z!s{Y(tTP7UoL70TIvJ!j)oC6|L)4rOEv<Dt@gAQSv~;x4dNs&$X|(jo%j#&#SB928 zXF=wlSeM%9(bC%EhTc5=3L7G;9?)NEhEdoki8$sCeeST?9YS~Lb_X^+Iz3wYYy&Ej zQsKEYa%O1hM$pm#I5%j-(4(bYl=3dqWoWQoT&4;wt-WxppXSlh3MfWP6P$tu_9C0h zwk2nutNLhZ;jer^hL&zDZ}vFnI-$TU>FC9n>#9%;E!|j-(9#M8%K;59MP7@RCa?r8 zEmdASmbF5(wAmcirWZjUE(lt>-O$pS1&qyU2R0RSXlbiBRz_IERcL7kDJcmpEyEeZ zhF&_bBW8wDcg_P^+RcSLXJ~1xcEF&9=>R7SSh}=&p1EnO%ef=KKQzEoEQJYbx+G`E zk@7bfcuPI#MqJf-!ouU#Z5k?)xHL=9p{ku5S||&K@C;qeMijCc<)C(NMjxzl$mRw{ zl3Vm}k}U)myyC&nykhhC4A+}Ln4^FiY5>vJkYhNuP!?b=gv#^)=~W5lf_|gH5<HZH z?kzDz12%RQ58r4s2P{DJ&_;sv86!d9CJb`{fIE83%Vz*c%i2c9Ft40#FKf_^D@#mW zfHVaSI9f#nhJ^#r1xg7`NgQxoNEj=%loh=0)D(4-6}3IIqK*nM`p8BcY!Q{nCl;-( zLC_X2un1vilmc>VQCojR;CGUt>ZbljO{@(IDp=gHh%1-{t}!0xD<)ZJe;Wl3b4$Rk zyAkp(x;4JmgoOv)Ez24}bythQjA?m0c%?io6P1nh43Gv6mAw`|)<tDAKhdMI@td3; zmEG-7*`3QpWh((1hLsMBQP~pqt07@<a#~{{LS>tL2T9{m*+3J`Ga&IsPfi#dP}yq? zQAOLVMrF5@9V&Z?hhT8(2kS97OQ5nXJy={G6T~{yaeAadsJg4wd0o9sRJJigW4+2a zPQbHAW!soLlZX_CA49b?)}XRi2pg`}iOWG{GX%~+q8bXL+{Tv(mEG{lChY;R(+Dc= zBJ&CuD%<1YPlL*a4=NC~IR+c6Cw90{&JvaF*xO~^gIbfrTlqjX5<@<LY%mtR(8^y7 zpIN|OKP1~sjuX)PtH$1XsBG0t15q1#dM$7o?l@F7Xx12&%}s~OwwqfV)|#6Rm2Ee} z_@+Z;+f9$kZmdCNd!+COStJF!{8dH@znZb+f8)X-g~1HONMX&4%NWkYL<3+6bVqI7 z^)NW#1PRhDffFnr2Iu3E{HD?-a3fY>jp0VMxC;7QDrD`$Ed{LeSBMl|7sHJRYpBS| zs6q-0Yg7Y1TF;FLDXej;MMz=6hZiA*H(-sni;eCdbAWmTPFfeXdwr~#ZSdM{oQ>Zz z++avynF74W#^FqQ6H<7U6yQb})fTczofXVRQdDbM*o1gYS6<#$gL3jnViV2HGF|g- zMqr~}mAg|#EZG}b35BrT!F*fLm^@^D;6l^2Iew*P35o>)VH`Vj@EXz;ql3XKX)0gA z!Iq@Pu+Ys?bqfPJW3(Exv;cRcZ5Mn@W~u5kELDSFQI8sHtX%1T|FXj@#h3Q2m-q!q ze8$Hdyo8B`%=t66m|?v9w1Db1bTIucQ_w9a_q0O?`=-<!&(CVc;D+mTx3ty}6aQ*w zebqk1GO3;tR{Idkq<*m8GVyaX{IoBR4)*E6q_KU%H5W4p)mtWwvP>FRj1E@4U8<h; z;Jsf|RnLGSZmPi$t93XG@tVaLVxK!e(=~8mX1f`N*aM=Mhaq-h#kzkXhPZ|5#STXi zHZ8HMd>U%(s&nOQkkoVnv<gF<VAHBG#OD~Y>3TexOQL>YocA<Rjb4SH`RDP}2`@mI z>D3xu_$enCLCLI=#0Xmcl#_%PGJ+_H2K32!;YGX|mp2tVFnZj&pRaL~i%z$$L;goD z;f!k(|2G%Tcqz%3cpMB9i-?SH$mYX04UH()eZwSgV3JMrrdMR3YXu2L)1eCWkeNS= zHFWffX=s6wds*GrhY$s{B(@kOEo^byC2X;mSsqJ!30qvtk8f6N@uyO3?VGU)zuL5i zDdpO<$F}y(M4R@|FsnBA&1lq{iLdeIzW5}cKCn5!5JW4veSU#jqc-sh`t5sx4TTM- z!rZCj1pRlop&MCakzNBGUV@hKl@k63wN_3Yk!OSs3f+Vprt1dXldD>CCdCaF_iW6! zSTDE<+*khhx>9X1Trci}AXJ2|p_@bRWU{>>6=c%6Y$HA)O;M(+fSwNS&{m%|oI{pb zrVB`v+nj<_(LXwX`$=nfq->Rdav)ztgXT+W(iFWQEta5V>1<B2RzcyKWaAQTV@f0< zpUwcCM<x=}?<i?f{I!Al2jrY-#$0Ek>$JOWimo&6x>eVKX1<Xi9kc`i6W}s_8nVUJ zvM4Ga5z)90Ip{;UoC#Z;<uB$~{|T;Yc&ee$!X!2gz~ZOUn@nTXo2?DzMWdr-9UHwx zaoohJ2^`qIQIkkBBts>aR;SN4>9ncY8RehV`WS7ABa5S2`U%X^b}AM-E@!bm`QAc| z0%_Hfe=90Y^81goG~FVJi%OGLf4)l7T3b~0R14zL%xWneD^DgDXpv8#wYM&(fwJkW zCRkFz=UrdHe2QwPZQP`t%7tzXKx+rcQ=tkAF?8YDsWnM0HGwtl8Y?Lb-k4IIXXYf0 zk?U-9tu+L=Zi=oO+;yw2>o!)~P*aJZ-CARH@x`(Exazi7zurJq696#*?mlj>%uH5$ zWz!;SuXs_AdA@}0Eo-ltWtK4h`-Sb*0+E=g|71~n1*s9YciL;tN?3ugsO2juVJpE) zC9I`E>y@xJiCvCFUaB0=qJ(ihEm6Yhq=eCV02MRQWY3Ikt9>S2YfV|>cBX4HXWNE} zazPuG&q;0Aw^;#k?ON-8s0~NgTK9u%O_e)~Hmnh2FEMDt?%O&#_iWp6x_$|#&R+@B z<yxYIZNW1qrB`0U!9VsAPSr1AvwxRiRh@%2TrK5mq%;@{O%7)_5$17UgLfyr&8-E5 zk|llAa|}H*$2s?F0r5I@Hl5FZd}bpXrZwgN?(TPHgCG?IK^n?HTn0I)0cwPrpk}BA z%0sQt9mD%($M?<*jFso-XD9AEJYTtU@BH}w%D&l|>D{yA({uOF%pSZk2tJQlJVt<@ zRY3e+<h-3@2ULJoL93xPP$#q&>Vg#4I;b1+aSisxalQ5M`1Jh5d&cJ{YGZTpJ>}!O z`t@NL_TAHWG}yCex^i@W&!O3ggOzaRNM-i^shM{LM=E>gXJ&)B`F+=3TRFP7a!A1i zbCVN?_KZil+A|+zCb(~WZes7AIkG$bKrlWvHM4h|&#&A4=4-F@SC!3k6Yr_)nGdJ0 z46m5JB2=K2eRJW#@uL$54<8KY4j(!+Gdo||7wWxW$J@#`+!?%mj_|^X>Af=t50Rn! zrYhmS%HElMmDvy;hV%O?JUn!GK761ubFeZ$`|fLko5m-m2xNZ7zZo8ynV6mr<3!I@ zzcMjBF+VXrMT8cX5Br+n?bDOfGw+%X4^B)I4Lq46_f@yY4^-d2#gZ^F7f#O*QFyR2 zw_oojIf_yj&cFLm<(l9Qdu@m6NO(V~y(U-?f=lw=shPw3Y6GgkiG5-TncY9b!$rB} z!T7%M`SCiB;#9cjo2L&?O<fu6Iy_qmk4((YA0D3y?>{`fR|OsJrPM0>iovb>cF$HS zaow8R;kbWos1lj2%!x1IROLuzDtzsP<v-5#H7&tSQ#0f9yTt!F1#@;E-|e`*AkeTS zxZU!;_`Yun{YkT{YHZKZ)_%&jvwLW?>uEbZP%pFr+6Y|+T@Hm%5h_8ifi^)=;G>Ip zabxssU}Vv=Tc+n}Pvd(lwDurS8a5NR+I=g>T@oJrKF#s99A5{WE<IQ9d^2<<6v>#u zB}zyUDxN0^Tlv*5L{MGD@%7La=xXR1=nYUG)DI0nQP?AQRUSNCL70qB#X0k380Y8f zgspWj_$+vW@CP{#LCVK4Gy+xgb(HHdXe&hWf;U1wzQNI@<D0u-W_o^hhDtemqvdNq zaYgxRMIc^BIB$a93{~grdajkPZBQB74&4ClfTDN@lXz8N4^(CsXIH%ZB5{g``aOZ5 z7ZYxRZiaS3w?J=!ZiQ}xZinuG?u2&f-06j(zT1%yyJjo<CakgDwReBzU}e|%tlHev z%mcII2R)Z>nYiPwJ%ghQU;UQZ@k90ok|3_)w@ggjcq6Y54Al#L2O{B?_-UNI8)jyw zE3>=D5v(`r7bS6Ev~D1-@n5)94KC!wO8J!JbTM~#Bcu040Y~lExEpb2aA2u)M6V}| z9A5Zpl}M00xQ=?Hy0wbqJN^0ZV@T}x=O5yH-k<*^_57qi-^KaEoa?8f>f&1=$t=}H z9ha($dZwSk(syrz&gQ$9+uV0|@!f7n@x2{dD!#jU7S;XXdKK&T!&CDU7e@n7Suj)@ z^Y+UaWZy#i?}5G*QeNKy)ywO*asOV(=XH3bUS1Jom`URk)0KS}QMRoPj*-`>PQ8c` z`t9W9JD@#~^8HR|9J&wM3q|s6ALkV)lBad^y}NSshMAe!eUS-q{-ucJv5$O3d3*sQ z`+m~>0JI-c9w(p!&?GbkMR`2P`7{*O<GNBd&f_jDSqarhjGT8lZh7q_e^Fkap))Z< z`VT=5LdxqbGzZN?hoLC1M>u~M6y<fGUOm3qS=<wQ@1Qd?K6T-8>g1<7OHp3?=rA26 z{qKg}1HBhI21WT9TSk7o*q)g!&sN6Ie_dTsQn!!KRnC7>on8B0I;xVLFH#Ph;lF-5 zsvM3((l089NcX%zhgQ1h1oRN3`gjtmCs$=Zy$_0*asln9{{D-^WU7-8<Nxd6Yh)ul z0{@@mT0b4d@9%_E2I9AlOYu7@r_bSZ(0AVjeK(}<-VZJH-S_Y;DyIvr>zCru7<r2L z@@X6@A0W*iggyi*fByukm%s1j{=<;Z-^HZg>t)sILpS-0^7;f$qkl^JzYqF;NO^q( z`T^)s=rJhL0grS3VaVro@B-=dCG(XfFHydZb_c-^lGY!Bo`96EABKJe`cddfD9YDI zIR9r*R7Wqc9$zwlU#QC8?)5?N&q?z~p??7>e;<Q>40;Osmr#_yALsmOD9Yaj)!lV+ zCmrzu<rS6Pr+b3n8PfZ4=qI3m1)YMT^j`$Jx=t=ul)6_(J=aN{`jtKKRlGh%-T7J0 z_0v(jeio8^7q25Zf2`NZ`Jd$8PeH0<&q4L%p!D&-hCCMr#uoN*cT}e4$5(0*(l_U) zw1=cgx=g>Xa{fHWPe7l9u7<9GJ_S|#cz&AepMicB`ZthI<KRHz<8cOS>;v)XBv!@w z8RC&YNxyGw41%BI`18;U(7%QL9rO#(r=eejehK>b&}X1uhN7Brw(V|c>p~{FWF{jA zmd;v_&-rxtT<8Rz*7vi*#8K5$=I^JRBOl948-m~^u62Ki^RIHQ-xHSy!LM-qRp>uJ z{}K8%C@Sxj$*C2lJ9gwPtTSin<{LVzRLAn`LZw=A?e{KoWwVLnBb14LVKE4Po#SVr z-+<Ike-rvo(2LM-K~X#X&z%1@6qVb>(oXA$ai7F9`(j_M@~D$0YZniNNgMeBWzY%# z^?M3s@;Q#b1N|=aU!c!J5wFjxw#EJK^O(C8CG=Hq7WIn3#*+RVzDrK+<oKjl<hQ*h z2>vTP|2^oxL23(MfPNqP@6aDWQCs*T=l=tWD%zR#_zKIy%h@lHM#)zFPQEq>{wK#j zgkFOF2>N5_e?eb@{x|d|(EowH4E-q-70=nW*^x#5`h~jnhVki{=?Mls83}g2{|l#R zFRIj@R_mUNl*-yu9sb)*i4MM<^ZnEh-G7AoJkPm)V^;*hpK<&O^i}B3p}&Blda*M3 zaxQXlffe#akp=n-l-K0zT)90%ne|a#`h8(@5d0;_m!Ypge+2zs=&zu!Lw^lLZT)XJ z|63?3(~GjL*OADP3_at(>3J!uIthfQYEN4zi>PfKqkLZETEC-L(cj_t|DeBv{vHZa zNjY4^ZL3aZquO&;sg4!-g(@PopP#$Zl~b1EA<9I*zSldQo}xU`klIg%V;0ImObUtH zPb23|P*fk!tkcg$ZY9NCx?dp8s$cqjl5{tdmKG=vMSb>G&adZrKeP>M<9a*C8=!X1 zJD>vO^DsD;^xdn$ZFPF^E)6G%H|oQ8ZeeVluvSBBpiT%gBv{L_3t9(tL+ha)s29?6 zA9sJh#)=XbfwiG;5dPE<FY!A`_#60UBc$*zgD!`v!w<PGLM7-m&?YD<ACqr4?t7qe zALC4umD#GOEUtSAUwP2)DH!-#zI`2Z1+*Eu61oa{J+uY78oCCGFgZ;)N#4M9AJh*G zK!eZ_Gz^VEqtF<nAIP;}E9cijOaut7gWd$a8M+?Y29=@hP?QJr4KL2aEe8)x33D=N zJgj;SW<`*?c+jv4crs{X237BReppxuy29z2Dfl6o7IJ(NT4s8NmP}97ojwu`+$v=* zj_1xUjzN<=Rr!eXeE0YiD88Bql!s3Et~}_s?+vsC_`3tTG2wIn)*Zkw_un)zJ2&rx ztIVDO)Fbv=@x+bgmT6!|mAM-|lJL&^<|?z4#w~aC?;*D_aHW4Rj>6<(Y~jQKRS$%n zeKeAFUn9@T`v*DROP=-9@h0+ov&(z=@jnRiKP{nV=-V8}M!m*we;+*`9^3-G1-ccA zYJjz>nB`7<?DfnVyM6p<RM0ciJ1P%=OpNm?cGl{Xv&h<jaj=Sq!w&lx$8S<nIlqCl zE9Wne+jnvvwbpwOiMNrD+m)B9{JeT;K4Yn`m>WK1vkJfF^ZPKzT@w5Jbi9*1?(%un zy}|$}Ca&KG-39H|GmoY|O_?s)GFF`UxF}sYJwjSlPWnAU8sAR3?pE58^qu=Ocm}GT z^bu#ow{3$Ul8E;n=v$$8Bxx8}36C6L@Rc^}gkehWCrK~-Du3>egZyu%PLX2i;BSK> z9egk6)jD#a4*vG4T$#L1Y=BrrDyD}CJJOF|=KMSOZV&WMXgmp{fA}^KSL3raO;O*! z$Tv~RN~bHG_d$E1$X3|Ld6lhDe(p;_{^RKcdVOeocCHdSJoo;}IOudR-mcd6kD3U$ zK~U~E-A;Sm;Vp>I_*g4dvEI-51GTY6Ar1^CAv)}DRk+I0M+q;oPBsm@9PO_PdxG-= zON3pO+B*DpZQ&a}e1Zr>X-`>>q9#w#c`7LX;h(4)e3}O_N#g0pz2Kvya+08?po7pf z<oRdAvyl#dg!f*8qVM#ru4j1v5cD84n|#~fmvAbUyr1R$&%aUl@0MWwdIrbbbPf*9 zI?wBme(Qr(Ej-V(G?K~YJR_FP4Lr;T4f;l3mVfcf%&Km;x9x+LHr;L$N1AoJS(7>1 zgYw_<UaB=Hf8bAp{Mt2o-~KeW>NMal&pySoRDm${P6xNM`V%x4^jDKXc=i>&vzqWY zUbag2?N9S+oob>8|9d#=VeGH`{GSE+_UOu9Xr>&vnd&4Yj%yiUcGF0L=1zNozdZZM zS9qr@D1V&eSF&sM#QrpQ*-QN8e_#K=;Lz~M=-Afs_8WHGc#|Hf9%P_MM~js(!xE_s zD?T~@E{9$V(ZMk!Ix5hR;uMM@xYY}|8M+0!6S@ofR%jfmKo3BZ&_U=y=ppF4pbtUc z3w;>+A?PE}k3mmE&qAMoJ_Y>(^o!6hL%$0BHbkYdqCX$$eK&C}O!N11uU@)8&i(4N z|2)?V)BjuC>+9?5?;GeF>>KJE?i=YF?HlXc+TYjT-#^el*gw=i+&|Jk+CSF6b)avc ze_&u>aA0U)cwl5;bYN^?>tNqt|KPyj;NZ~U@ZiYc=-}Ak)}g+k{-J@P!J(m{;h~YC z(V?-St;2o8{lf#pgTq6^!^0!Pqr+pvTSxjv`bP#v21kZQhDSz5Mn}d*wvP6V_KyyX z4vr3u4v&tEj*gCvZXN3z>mM5!8yp)N8y*`O8yy=P+q#t`ZYBDy1ih8dwsI>dKlO5u z|H(`XdD;hki3(M?0txXwsbJgoj^N}EK7q^nYq{Xpe&mgJ^!M%Av-jxH@%tu@^!JbK z*)z9);@}?5u-P*)egDjjd~P<@PGsU|sa&=1kMix*_}pCW2a=yhp(#keCv{EbcsKMO z=)KS}=s0u&dI-`lBz(Ph5~_aheO!Mh^j%O*`~#$YZlYciEX`jhUd657F2eq9zJEUi z8-ly$w<Z&^crJT#8}I0MjHBxC2YBy;_HKVaGYXiRRhgY-I+yY{#XAa9zvuk>A4=XI zpnLMb{C@ud@93K+c~4;zcg$e>o@Xz-F(`ljuMir!p!^cY^c)iZ8=SPv6Y61T|C@sH z<6q|u=G;BSvB@OAgn#)<y3L0#b4(xM!-xMGxup-^1s#18k+4b1Q`}7P@RJ;K`nV-1 Mf1UG8xMSD<2gkon`2YX_ diff --git a/public/lib/Cesium/Workers/AttributeCompression-48e336db.js b/public/lib/Cesium/Workers/AttributeCompression-0b8f7b7d.js similarity index 95% rename from public/lib/Cesium/Workers/AttributeCompression-48e336db.js rename to public/lib/Cesium/Workers/AttributeCompression-0b8f7b7d.js index adfb361d..84a12e21 100644 --- a/public/lib/Cesium/Workers/AttributeCompression-48e336db.js +++ b/public/lib/Cesium/Workers/AttributeCompression-0b8f7b7d.js @@ -1 +1 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(t,e,n,o,a,r){"use strict";const c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",getMathType:function(t){switch(t){case c.SCALAR:return Number;case c.VEC2:return e.Cartesian2;case c.VEC3:return n.Cartesian3;case c.VEC4:return e.Cartesian4;case c.MAT2:return e.Matrix2;case c.MAT3:return n.Matrix3;case c.MAT4:return e.Matrix4}},getNumberOfComponents:function(t){switch(t){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16}},getAttributeLocationCount:function(t){switch(t){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4}},getGlslType:function(t){switch(t){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4"}}};var s=Object.freeze(c);const u=1/256,i={octEncodeInRange:function(t,e,n){if(n.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),n.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){const t=n.x,e=n.y;n.x=(1-Math.abs(e))*r.CesiumMath.signNotZero(t),n.y=(1-Math.abs(t))*r.CesiumMath.signNotZero(e)}return n.x=r.CesiumMath.toSNorm(n.x,e),n.y=r.CesiumMath.toSNorm(n.y,e),n},octEncode:function(t,e){return i.octEncodeInRange(t,255,e)}},C=new e.Cartesian2,M=new Uint8Array(1);function f(t){return M[0]=t,M[0]}i.octEncodeToCartesian4=function(t,e){return i.octEncodeInRange(t,65535,C),e.x=f(C.x*u),e.y=f(C.x),e.z=f(C.y*u),e.w=f(C.y),e},i.octDecodeInRange=function(t,e,o,a){if(a.x=r.CesiumMath.fromSNorm(t,o),a.y=r.CesiumMath.fromSNorm(e,o),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){const t=a.x;a.x=(1-Math.abs(a.y))*r.CesiumMath.signNotZero(t),a.y=(1-Math.abs(t))*r.CesiumMath.signNotZero(a.y)}return n.Cartesian3.normalize(a,a)},i.octDecode=function(t,e,n){return i.octDecodeInRange(t,e,255,n)},i.octDecodeFromCartesian4=function(t,e){const n=256*t.x+t.y,o=256*t.z+t.w;return i.octDecodeInRange(n,o,65535,e)},i.octPackFloat=function(t){return 256*t.x+t.y};const m=new e.Cartesian2;function y(t){return t>>1^-(1&t)}i.octEncodeFloat=function(t){return i.octEncode(t,m),i.octPackFloat(m)},i.octDecodeFloat=function(t,e){const n=t/256,o=Math.floor(n),a=256*(n-o);return i.octDecode(o,a,e)},i.octPack=function(t,e,n,o){const a=i.octEncodeFloat(t),r=i.octEncodeFloat(e),c=i.octEncode(n,m);return o.x=65536*c.x+a,o.y=65536*c.y+r,o},i.octUnpack=function(t,e,n,o){let a=t.x/65536;const r=Math.floor(a),c=65536*(a-r);a=t.y/65536;const s=Math.floor(a),u=65536*(a-s);i.octDecodeFloat(c,e),i.octDecodeFloat(u,n),i.octDecode(r,s,o)},i.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},i.decompressTextureCoordinates=function(t,e){const n=t/4096,o=Math.floor(n);return e.x=o/4095,e.y=(t-4096*o)/4095,e},i.zigZagDeltaDecode=function(t,e,n){const o=t.length;let r=0,c=0,s=0;for(let u=0;u<o;++u)r+=y(t[u]),c+=y(e[u]),t[u]=r,e[u]=c,a.defined(n)&&(s+=y(n[u]),n[u]=s)},i.dequantize=function(t,e,n,a){const r=s.getNumberOfComponents(n);let c;switch(e){case o.ComponentDatatype.BYTE:c=127;break;case o.ComponentDatatype.UNSIGNED_BYTE:c=255;break;case o.ComponentDatatype.SHORT:c=32767;break;case o.ComponentDatatype.UNSIGNED_SHORT:c=65535;break;case o.ComponentDatatype.INT:c=2147483647;break;case o.ComponentDatatype.UNSIGNED_INT:c=4294967295}const u=new Float32Array(a*r);for(let e=0;e<a;e++)for(let n=0;n<r;n++){const o=e*r+n;u[o]=Math.max(t[o]/c,-1)}return u},i.decodeRGB565=function(t,e){const n=t.length;a.defined(e)||(e=new Float32Array(3*n));const o=1/31;for(let a=0;a<n;a++){const n=t[a],r=n>>11,c=n>>5&63,s=31&n,u=3*a;e[u]=r*o,e[u+1]=.015873015873015872*c,e[u+2]=s*o}return e};var A=i;t.AttributeCompression=A})); +define(["exports","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./Math-355606c6"],(function(t,e,n,o,a,r){"use strict";const c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",getMathType:function(t){switch(t){case c.SCALAR:return Number;case c.VEC2:return e.Cartesian2;case c.VEC3:return n.Cartesian3;case c.VEC4:return e.Cartesian4;case c.MAT2:return e.Matrix2;case c.MAT3:return n.Matrix3;case c.MAT4:return e.Matrix4}},getNumberOfComponents:function(t){switch(t){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16}},getAttributeLocationCount:function(t){switch(t){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4}},getGlslType:function(t){switch(t){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4"}}};var s=Object.freeze(c);const u=1/256,i={octEncodeInRange:function(t,e,n){if(n.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),n.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){const t=n.x,e=n.y;n.x=(1-Math.abs(e))*r.CesiumMath.signNotZero(t),n.y=(1-Math.abs(t))*r.CesiumMath.signNotZero(e)}return n.x=r.CesiumMath.toSNorm(n.x,e),n.y=r.CesiumMath.toSNorm(n.y,e),n},octEncode:function(t,e){return i.octEncodeInRange(t,255,e)}},C=new e.Cartesian2,M=new Uint8Array(1);function f(t){return M[0]=t,M[0]}i.octEncodeToCartesian4=function(t,e){return i.octEncodeInRange(t,65535,C),e.x=f(C.x*u),e.y=f(C.x),e.z=f(C.y*u),e.w=f(C.y),e},i.octDecodeInRange=function(t,e,o,a){if(a.x=r.CesiumMath.fromSNorm(t,o),a.y=r.CesiumMath.fromSNorm(e,o),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){const t=a.x;a.x=(1-Math.abs(a.y))*r.CesiumMath.signNotZero(t),a.y=(1-Math.abs(t))*r.CesiumMath.signNotZero(a.y)}return n.Cartesian3.normalize(a,a)},i.octDecode=function(t,e,n){return i.octDecodeInRange(t,e,255,n)},i.octDecodeFromCartesian4=function(t,e){const n=256*t.x+t.y,o=256*t.z+t.w;return i.octDecodeInRange(n,o,65535,e)},i.octPackFloat=function(t){return 256*t.x+t.y};const m=new e.Cartesian2;function y(t){return t>>1^-(1&t)}i.octEncodeFloat=function(t){return i.octEncode(t,m),i.octPackFloat(m)},i.octDecodeFloat=function(t,e){const n=t/256,o=Math.floor(n),a=256*(n-o);return i.octDecode(o,a,e)},i.octPack=function(t,e,n,o){const a=i.octEncodeFloat(t),r=i.octEncodeFloat(e),c=i.octEncode(n,m);return o.x=65536*c.x+a,o.y=65536*c.y+r,o},i.octUnpack=function(t,e,n,o){let a=t.x/65536;const r=Math.floor(a),c=65536*(a-r);a=t.y/65536;const s=Math.floor(a),u=65536*(a-s);i.octDecodeFloat(c,e),i.octDecodeFloat(u,n),i.octDecode(r,s,o)},i.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},i.decompressTextureCoordinates=function(t,e){const n=t/4096,o=Math.floor(n);return e.x=o/4095,e.y=(t-4096*o)/4095,e},i.zigZagDeltaDecode=function(t,e,n){const o=t.length;let r=0,c=0,s=0;for(let u=0;u<o;++u)r+=y(t[u]),c+=y(e[u]),t[u]=r,e[u]=c,a.defined(n)&&(s+=y(n[u]),n[u]=s)},i.dequantize=function(t,e,n,a){const r=s.getNumberOfComponents(n);let c;switch(e){case o.ComponentDatatype.BYTE:c=127;break;case o.ComponentDatatype.UNSIGNED_BYTE:c=255;break;case o.ComponentDatatype.SHORT:c=32767;break;case o.ComponentDatatype.UNSIGNED_SHORT:c=65535;break;case o.ComponentDatatype.INT:c=2147483647;break;case o.ComponentDatatype.UNSIGNED_INT:c=4294967295}const u=new Float32Array(a*r);for(let e=0;e<a;e++)for(let n=0;n<r;n++){const o=e*r+n;u[o]=Math.max(t[o]/c,-1)}return u},i.decodeRGB565=function(t,e){const n=t.length;a.defined(e)||(e=new Float32Array(3*n));const o=1/31;for(let a=0;a<n;a++){const n=t[a],r=n>>11,c=n>>5&63,s=31&n,u=3*a;e[u]=r*o,e[u+1]=.015873015873015872*c,e[u+2]=s*o}return e};var A=i;t.AttributeCompression=A})); diff --git a/public/lib/Cesium/Workers/AxisAlignedBoundingBox-e7b79110.js b/public/lib/Cesium/Workers/AxisAlignedBoundingBox-04c1a5e3.js similarity index 94% rename from public/lib/Cesium/Workers/AxisAlignedBoundingBox-e7b79110.js rename to public/lib/Cesium/Workers/AxisAlignedBoundingBox-04c1a5e3.js index 6b949758..6d9693b1 100644 --- a/public/lib/Cesium/Workers/AxisAlignedBoundingBox-e7b79110.js +++ b/public/lib/Cesium/Workers/AxisAlignedBoundingBox-04c1a5e3.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Transforms-b3716b06"],(function(n,e,t,i){"use strict";function a(n,i,a){this.minimum=e.Cartesian3.clone(t.defaultValue(n,e.Cartesian3.ZERO)),this.maximum=e.Cartesian3.clone(t.defaultValue(i,e.Cartesian3.ZERO)),a=t.defined(a)?e.Cartesian3.clone(a):e.Cartesian3.midpoint(this.minimum,this.maximum,new e.Cartesian3),this.center=a}a.fromCorners=function(n,i,m){return t.defined(m)||(m=new a),m.minimum=e.Cartesian3.clone(n,m.minimum),m.maximum=e.Cartesian3.clone(i,m.maximum),m.center=e.Cartesian3.midpoint(n,i,m.center),m},a.fromPoints=function(n,i){if(t.defined(i)||(i=new a),!t.defined(n)||0===n.length)return i.minimum=e.Cartesian3.clone(e.Cartesian3.ZERO,i.minimum),i.maximum=e.Cartesian3.clone(e.Cartesian3.ZERO,i.maximum),i.center=e.Cartesian3.clone(e.Cartesian3.ZERO,i.center),i;let m=n[0].x,r=n[0].y,s=n[0].z,u=n[0].x,c=n[0].y,o=n[0].z;const l=n.length;for(let e=1;e<l;e++){const t=n[e],i=t.x,a=t.y,l=t.z;m=Math.min(i,m),u=Math.max(i,u),r=Math.min(a,r),c=Math.max(a,c),s=Math.min(l,s),o=Math.max(l,o)}const C=i.minimum;C.x=m,C.y=r,C.z=s;const f=i.maximum;return f.x=u,f.y=c,f.z=o,i.center=e.Cartesian3.midpoint(C,f,i.center),i},a.clone=function(n,i){if(t.defined(n))return t.defined(i)?(i.minimum=e.Cartesian3.clone(n.minimum,i.minimum),i.maximum=e.Cartesian3.clone(n.maximum,i.maximum),i.center=e.Cartesian3.clone(n.center,i.center),i):new a(n.minimum,n.maximum,n.center)},a.equals=function(n,i){return n===i||t.defined(n)&&t.defined(i)&&e.Cartesian3.equals(n.center,i.center)&&e.Cartesian3.equals(n.minimum,i.minimum)&&e.Cartesian3.equals(n.maximum,i.maximum)};let m=new e.Cartesian3;a.intersectPlane=function(n,t){m=e.Cartesian3.subtract(n.maximum,n.minimum,m);const a=e.Cartesian3.multiplyByScalar(m,.5,m),r=t.normal,s=a.x*Math.abs(r.x)+a.y*Math.abs(r.y)+a.z*Math.abs(r.z),u=e.Cartesian3.dot(n.center,r)+t.distance;return u-s>0?i.Intersect.INSIDE:u+s<0?i.Intersect.OUTSIDE:i.Intersect.INTERSECTING},a.prototype.clone=function(n){return a.clone(this,n)},a.prototype.intersectPlane=function(n){return a.intersectPlane(this,n)},a.prototype.equals=function(n){return a.equals(this,n)},n.AxisAlignedBoundingBox=a})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Transforms-f17097e5"],(function(n,e,t,i){"use strict";function a(n,i,a){this.minimum=e.Cartesian3.clone(t.defaultValue(n,e.Cartesian3.ZERO)),this.maximum=e.Cartesian3.clone(t.defaultValue(i,e.Cartesian3.ZERO)),a=t.defined(a)?e.Cartesian3.clone(a):e.Cartesian3.midpoint(this.minimum,this.maximum,new e.Cartesian3),this.center=a}a.fromCorners=function(n,i,m){return t.defined(m)||(m=new a),m.minimum=e.Cartesian3.clone(n,m.minimum),m.maximum=e.Cartesian3.clone(i,m.maximum),m.center=e.Cartesian3.midpoint(n,i,m.center),m},a.fromPoints=function(n,i){if(t.defined(i)||(i=new a),!t.defined(n)||0===n.length)return i.minimum=e.Cartesian3.clone(e.Cartesian3.ZERO,i.minimum),i.maximum=e.Cartesian3.clone(e.Cartesian3.ZERO,i.maximum),i.center=e.Cartesian3.clone(e.Cartesian3.ZERO,i.center),i;let m=n[0].x,r=n[0].y,s=n[0].z,u=n[0].x,c=n[0].y,o=n[0].z;const l=n.length;for(let e=1;e<l;e++){const t=n[e],i=t.x,a=t.y,l=t.z;m=Math.min(i,m),u=Math.max(i,u),r=Math.min(a,r),c=Math.max(a,c),s=Math.min(l,s),o=Math.max(l,o)}const C=i.minimum;C.x=m,C.y=r,C.z=s;const f=i.maximum;return f.x=u,f.y=c,f.z=o,i.center=e.Cartesian3.midpoint(C,f,i.center),i},a.clone=function(n,i){if(t.defined(n))return t.defined(i)?(i.minimum=e.Cartesian3.clone(n.minimum,i.minimum),i.maximum=e.Cartesian3.clone(n.maximum,i.maximum),i.center=e.Cartesian3.clone(n.center,i.center),i):new a(n.minimum,n.maximum,n.center)},a.equals=function(n,i){return n===i||t.defined(n)&&t.defined(i)&&e.Cartesian3.equals(n.center,i.center)&&e.Cartesian3.equals(n.minimum,i.minimum)&&e.Cartesian3.equals(n.maximum,i.maximum)};let m=new e.Cartesian3;a.intersectPlane=function(n,t){m=e.Cartesian3.subtract(n.maximum,n.minimum,m);const a=e.Cartesian3.multiplyByScalar(m,.5,m),r=t.normal,s=a.x*Math.abs(r.x)+a.y*Math.abs(r.y)+a.z*Math.abs(r.z),u=e.Cartesian3.dot(n.center,r)+t.distance;return u-s>0?i.Intersect.INSIDE:u+s<0?i.Intersect.OUTSIDE:i.Intersect.INTERSECTING},a.prototype.clone=function(n){return a.clone(this,n)},a.prototype.intersectPlane=function(n){return a.intersectPlane(this,n)},a.prototype.equals=function(n){return a.equals(this,n)},n.AxisAlignedBoundingBox=a})); diff --git a/public/lib/Cesium/Workers/BoundingRectangle-9216d683.js b/public/lib/Cesium/Workers/BoundingRectangle-4ef16803.js similarity index 94% rename from public/lib/Cesium/Workers/BoundingRectangle-9216d683.js rename to public/lib/Cesium/Workers/BoundingRectangle-4ef16803.js index 5928595f..7e26cb62 100644 --- a/public/lib/Cesium/Workers/BoundingRectangle-9216d683.js +++ b/public/lib/Cesium/Workers/BoundingRectangle-4ef16803.js @@ -1 +1 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Transforms-b3716b06"],(function(t,e,n,i,h){"use strict";function r(t,e,n,h){this.x=i.defaultValue(t,0),this.y=i.defaultValue(e,0),this.width=i.defaultValue(n,0),this.height=i.defaultValue(h,0)}r.packedLength=4,r.pack=function(t,e,n){return n=i.defaultValue(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},r.unpack=function(t,e,n){return e=i.defaultValue(e,0),i.defined(n)||(n=new r),n.x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},r.fromPoints=function(t,e){if(i.defined(e)||(e=new r),!i.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;const n=t.length;let h=t[0].x,u=t[0].y,d=t[0].x,a=t[0].y;for(let e=1;e<n;e++){const n=t[e],i=n.x,r=n.y;h=Math.min(i,h),d=Math.max(i,d),u=Math.min(r,u),a=Math.max(r,a)}return e.x=h,e.y=u,e.width=d-h,e.height=a-u,e};const u=new h.GeographicProjection,d=new n.Cartographic,a=new n.Cartographic;r.fromRectangle=function(t,n,h){if(i.defined(h)||(h=new r),!i.defined(t))return h.x=0,h.y=0,h.width=0,h.height=0,h;const o=(n=i.defaultValue(n,u)).project(e.Rectangle.southwest(t,d)),c=n.project(e.Rectangle.northeast(t,a));return e.Cartesian2.subtract(c,o,c),h.x=o.x,h.y=o.y,h.width=c.x,h.height=c.y,h},r.clone=function(t,e){if(i.defined(t))return i.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new r(t.x,t.y,t.width,t.height)},r.union=function(t,e,n){i.defined(n)||(n=new r);const h=Math.min(t.x,e.x),u=Math.min(t.y,e.y),d=Math.max(t.x+t.width,e.x+e.width),a=Math.max(t.y+t.height,e.y+e.height);return n.x=h,n.y=u,n.width=d-h,n.height=a-u,n},r.expand=function(t,e,n){n=r.clone(t,n);const i=e.x-n.x,h=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),h>n.height?n.height=h:h<0&&(n.height-=h,n.y=e.y),n},r.intersect=function(t,e){const n=t.x,i=t.y,r=e.x,u=e.y;return n>r+e.width||n+t.width<r||i+t.height<u||i>u+e.height?h.Intersect.OUTSIDE:h.Intersect.INTERSECTING},r.equals=function(t,e){return t===e||i.defined(t)&&i.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},r.prototype.clone=function(t){return r.clone(this,t)},r.prototype.intersect=function(t){return r.intersect(this,t)},r.prototype.equals=function(t){return r.equals(this,t)},t.BoundingRectangle=r})); +define(["exports","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Transforms-f17097e5"],(function(t,e,n,i,h){"use strict";function r(t,e,n,h){this.x=i.defaultValue(t,0),this.y=i.defaultValue(e,0),this.width=i.defaultValue(n,0),this.height=i.defaultValue(h,0)}r.packedLength=4,r.pack=function(t,e,n){return n=i.defaultValue(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},r.unpack=function(t,e,n){return e=i.defaultValue(e,0),i.defined(n)||(n=new r),n.x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},r.fromPoints=function(t,e){if(i.defined(e)||(e=new r),!i.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;const n=t.length;let h=t[0].x,u=t[0].y,d=t[0].x,a=t[0].y;for(let e=1;e<n;e++){const n=t[e],i=n.x,r=n.y;h=Math.min(i,h),d=Math.max(i,d),u=Math.min(r,u),a=Math.max(r,a)}return e.x=h,e.y=u,e.width=d-h,e.height=a-u,e};const u=new h.GeographicProjection,d=new n.Cartographic,a=new n.Cartographic;r.fromRectangle=function(t,n,h){if(i.defined(h)||(h=new r),!i.defined(t))return h.x=0,h.y=0,h.width=0,h.height=0,h;const o=(n=i.defaultValue(n,u)).project(e.Rectangle.southwest(t,d)),c=n.project(e.Rectangle.northeast(t,a));return e.Cartesian2.subtract(c,o,c),h.x=o.x,h.y=o.y,h.width=c.x,h.height=c.y,h},r.clone=function(t,e){if(i.defined(t))return i.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new r(t.x,t.y,t.width,t.height)},r.union=function(t,e,n){i.defined(n)||(n=new r);const h=Math.min(t.x,e.x),u=Math.min(t.y,e.y),d=Math.max(t.x+t.width,e.x+e.width),a=Math.max(t.y+t.height,e.y+e.height);return n.x=h,n.y=u,n.width=d-h,n.height=a-u,n},r.expand=function(t,e,n){n=r.clone(t,n);const i=e.x-n.x,h=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),h>n.height?n.height=h:h<0&&(n.height-=h,n.y=e.y),n},r.intersect=function(t,e){const n=t.x,i=t.y,r=e.x,u=e.y;return n>r+e.width||n+t.width<r||i+t.height<u||i>u+e.height?h.Intersect.OUTSIDE:h.Intersect.INTERSECTING},r.equals=function(t,e){return t===e||i.defined(t)&&i.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},r.prototype.clone=function(t){return r.clone(this,t)},r.prototype.intersect=function(t){return r.intersect(this,t)},r.prototype.equals=function(t){return r.equals(this,t)},t.BoundingRectangle=r})); diff --git a/public/lib/Cesium/Workers/BoxGeometry-0a50f4ca.js b/public/lib/Cesium/Workers/BoxGeometry-bbe159e0.js similarity index 98% rename from public/lib/Cesium/Workers/BoxGeometry-0a50f4ca.js rename to public/lib/Cesium/Workers/BoxGeometry-bbe159e0.js index 8eec70ba..52c9617b 100644 --- a/public/lib/Cesium/Workers/BoxGeometry-0a50f4ca.js +++ b/public/lib/Cesium/Workers/BoxGeometry-bbe159e0.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922"],(function(t,e,n,a,r,i,o,m,u){"use strict";const s=new n.Cartesian3;function y(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,i=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT);this._minimum=n.Cartesian3.clone(e),this._maximum=n.Cartesian3.clone(a),this._vertexFormat=i,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}y.fromDimensions=function(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(e,.5,new n.Cartesian3);return new y({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},y.fromAxisAlignedBoundingBox=function(t){return new y({minimum:t.minimum,maximum:t.maximum})},y.packedLength=2*n.Cartesian3.packedLength+u.VertexFormat.packedLength+1,y.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._minimum,e,a),n.Cartesian3.pack(t._maximum,e,a+n.Cartesian3.packedLength),u.VertexFormat.pack(t._vertexFormat,e,a+2*n.Cartesian3.packedLength),e[a+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength]=r.defaultValue(t._offsetAttribute,-1),e};const p=new n.Cartesian3,x=new n.Cartesian3,c=new u.VertexFormat,f={minimum:p,maximum:x,vertexFormat:c,offsetAttribute:void 0};let l;y.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,p),o=n.Cartesian3.unpack(t,e+n.Cartesian3.packedLength,x),m=u.VertexFormat.unpack(t,e+2*n.Cartesian3.packedLength,c),s=t[e+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength];return r.defined(a)?(a._minimum=n.Cartesian3.clone(i,a._minimum),a._maximum=n.Cartesian3.clone(o,a._maximum),a._vertexFormat=u.VertexFormat.clone(m,a._vertexFormat),a._offsetAttribute=-1===s?void 0:s,a):(f.offsetAttribute=-1===s?void 0:s,new y(f))},y.createGeometry=function(t){const u=t._minimum,y=t._maximum,p=t._vertexFormat;if(n.Cartesian3.equals(u,y))return;const x=new o.GeometryAttributes;let c,f;if(p.position&&(p.st||p.normal||p.tangent||p.bitangent)){if(p.position&&(f=new Float64Array(72),f[0]=u.x,f[1]=u.y,f[2]=y.z,f[3]=y.x,f[4]=u.y,f[5]=y.z,f[6]=y.x,f[7]=y.y,f[8]=y.z,f[9]=u.x,f[10]=y.y,f[11]=y.z,f[12]=u.x,f[13]=u.y,f[14]=u.z,f[15]=y.x,f[16]=u.y,f[17]=u.z,f[18]=y.x,f[19]=y.y,f[20]=u.z,f[21]=u.x,f[22]=y.y,f[23]=u.z,f[24]=y.x,f[25]=u.y,f[26]=u.z,f[27]=y.x,f[28]=y.y,f[29]=u.z,f[30]=y.x,f[31]=y.y,f[32]=y.z,f[33]=y.x,f[34]=u.y,f[35]=y.z,f[36]=u.x,f[37]=u.y,f[38]=u.z,f[39]=u.x,f[40]=y.y,f[41]=u.z,f[42]=u.x,f[43]=y.y,f[44]=y.z,f[45]=u.x,f[46]=u.y,f[47]=y.z,f[48]=u.x,f[49]=y.y,f[50]=u.z,f[51]=y.x,f[52]=y.y,f[53]=u.z,f[54]=y.x,f[55]=y.y,f[56]=y.z,f[57]=u.x,f[58]=y.y,f[59]=y.z,f[60]=u.x,f[61]=u.y,f[62]=u.z,f[63]=y.x,f[64]=u.y,f[65]=u.z,f[66]=y.x,f[67]=u.y,f[68]=y.z,f[69]=u.x,f[70]=u.y,f[71]=y.z,x.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})),p.normal){const t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,x.normal=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(p.st){const t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,x.st=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}if(p.tangent){const t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,x.tangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(p.bitangent){const t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,x.bitangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}c=new Uint16Array(36),c[0]=0,c[1]=1,c[2]=2,c[3]=0,c[4]=2,c[5]=3,c[6]=6,c[7]=5,c[8]=4,c[9]=7,c[10]=6,c[11]=4,c[12]=8,c[13]=9,c[14]=10,c[15]=8,c[16]=10,c[17]=11,c[18]=14,c[19]=13,c[20]=12,c[21]=15,c[22]=14,c[23]=12,c[24]=18,c[25]=17,c[26]=16,c[27]=19,c[28]=18,c[29]=16,c[30]=20,c[31]=21,c[32]=22,c[33]=20,c[34]=22,c[35]=23}else f=new Float64Array(24),f[0]=u.x,f[1]=u.y,f[2]=u.z,f[3]=y.x,f[4]=u.y,f[5]=u.z,f[6]=y.x,f[7]=y.y,f[8]=u.z,f[9]=u.x,f[10]=y.y,f[11]=u.z,f[12]=u.x,f[13]=u.y,f[14]=y.z,f[15]=y.x,f[16]=u.y,f[17]=y.z,f[18]=y.x,f[19]=y.y,f[20]=y.z,f[21]=u.x,f[22]=y.y,f[23]=y.z,x.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),c=new Uint16Array(36),c[0]=4,c[1]=5,c[2]=6,c[3]=4,c[4]=6,c[5]=7,c[6]=1,c[7]=0,c[8]=3,c[9]=1,c[10]=3,c[11]=2,c[12]=1,c[13]=6,c[14]=5,c[15]=1,c[16]=2,c[17]=6,c[18]=2,c[19]=3,c[20]=7,c[21]=2,c[22]=7,c[23]=6,c[24]=3,c[25]=0,c[26]=4,c[27]=3,c[28]=4,c[29]=7,c[30]=0,c[31]=1,c[32]=5,c[33]=0,c[34]=5,c[35]=4;const l=n.Cartesian3.subtract(y,u,s),A=.5*n.Cartesian3.magnitude(l);if(r.defined(t._offsetAttribute)){const e=f.length,n=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(n);x.applyOffset=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new i.Geometry({attributes:x,indices:c,primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:new e.BoundingSphere(n.Cartesian3.ZERO,A),offsetAttribute:t._offsetAttribute})},y.getUnitBox=function(){return r.defined(l)||(l=y.createGeometry(y.fromDimensions({dimensions:new n.Cartesian3(1,1,1),vertexFormat:u.VertexFormat.POSITION_ONLY}))),l},t.BoxGeometry=y})); +define(["exports","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922"],(function(t,e,n,a,r,i,o,m,u){"use strict";const s=new n.Cartesian3;function y(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,i=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT);this._minimum=n.Cartesian3.clone(e),this._maximum=n.Cartesian3.clone(a),this._vertexFormat=i,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}y.fromDimensions=function(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(e,.5,new n.Cartesian3);return new y({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},y.fromAxisAlignedBoundingBox=function(t){return new y({minimum:t.minimum,maximum:t.maximum})},y.packedLength=2*n.Cartesian3.packedLength+u.VertexFormat.packedLength+1,y.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._minimum,e,a),n.Cartesian3.pack(t._maximum,e,a+n.Cartesian3.packedLength),u.VertexFormat.pack(t._vertexFormat,e,a+2*n.Cartesian3.packedLength),e[a+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength]=r.defaultValue(t._offsetAttribute,-1),e};const p=new n.Cartesian3,x=new n.Cartesian3,c=new u.VertexFormat,f={minimum:p,maximum:x,vertexFormat:c,offsetAttribute:void 0};let l;y.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,p),o=n.Cartesian3.unpack(t,e+n.Cartesian3.packedLength,x),m=u.VertexFormat.unpack(t,e+2*n.Cartesian3.packedLength,c),s=t[e+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength];return r.defined(a)?(a._minimum=n.Cartesian3.clone(i,a._minimum),a._maximum=n.Cartesian3.clone(o,a._maximum),a._vertexFormat=u.VertexFormat.clone(m,a._vertexFormat),a._offsetAttribute=-1===s?void 0:s,a):(f.offsetAttribute=-1===s?void 0:s,new y(f))},y.createGeometry=function(t){const u=t._minimum,y=t._maximum,p=t._vertexFormat;if(n.Cartesian3.equals(u,y))return;const x=new o.GeometryAttributes;let c,f;if(p.position&&(p.st||p.normal||p.tangent||p.bitangent)){if(p.position&&(f=new Float64Array(72),f[0]=u.x,f[1]=u.y,f[2]=y.z,f[3]=y.x,f[4]=u.y,f[5]=y.z,f[6]=y.x,f[7]=y.y,f[8]=y.z,f[9]=u.x,f[10]=y.y,f[11]=y.z,f[12]=u.x,f[13]=u.y,f[14]=u.z,f[15]=y.x,f[16]=u.y,f[17]=u.z,f[18]=y.x,f[19]=y.y,f[20]=u.z,f[21]=u.x,f[22]=y.y,f[23]=u.z,f[24]=y.x,f[25]=u.y,f[26]=u.z,f[27]=y.x,f[28]=y.y,f[29]=u.z,f[30]=y.x,f[31]=y.y,f[32]=y.z,f[33]=y.x,f[34]=u.y,f[35]=y.z,f[36]=u.x,f[37]=u.y,f[38]=u.z,f[39]=u.x,f[40]=y.y,f[41]=u.z,f[42]=u.x,f[43]=y.y,f[44]=y.z,f[45]=u.x,f[46]=u.y,f[47]=y.z,f[48]=u.x,f[49]=y.y,f[50]=u.z,f[51]=y.x,f[52]=y.y,f[53]=u.z,f[54]=y.x,f[55]=y.y,f[56]=y.z,f[57]=u.x,f[58]=y.y,f[59]=y.z,f[60]=u.x,f[61]=u.y,f[62]=u.z,f[63]=y.x,f[64]=u.y,f[65]=u.z,f[66]=y.x,f[67]=u.y,f[68]=y.z,f[69]=u.x,f[70]=u.y,f[71]=y.z,x.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})),p.normal){const t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,x.normal=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(p.st){const t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,x.st=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}if(p.tangent){const t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,x.tangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(p.bitangent){const t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,x.bitangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}c=new Uint16Array(36),c[0]=0,c[1]=1,c[2]=2,c[3]=0,c[4]=2,c[5]=3,c[6]=6,c[7]=5,c[8]=4,c[9]=7,c[10]=6,c[11]=4,c[12]=8,c[13]=9,c[14]=10,c[15]=8,c[16]=10,c[17]=11,c[18]=14,c[19]=13,c[20]=12,c[21]=15,c[22]=14,c[23]=12,c[24]=18,c[25]=17,c[26]=16,c[27]=19,c[28]=18,c[29]=16,c[30]=20,c[31]=21,c[32]=22,c[33]=20,c[34]=22,c[35]=23}else f=new Float64Array(24),f[0]=u.x,f[1]=u.y,f[2]=u.z,f[3]=y.x,f[4]=u.y,f[5]=u.z,f[6]=y.x,f[7]=y.y,f[8]=u.z,f[9]=u.x,f[10]=y.y,f[11]=u.z,f[12]=u.x,f[13]=u.y,f[14]=y.z,f[15]=y.x,f[16]=u.y,f[17]=y.z,f[18]=y.x,f[19]=y.y,f[20]=y.z,f[21]=u.x,f[22]=y.y,f[23]=y.z,x.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),c=new Uint16Array(36),c[0]=4,c[1]=5,c[2]=6,c[3]=4,c[4]=6,c[5]=7,c[6]=1,c[7]=0,c[8]=3,c[9]=1,c[10]=3,c[11]=2,c[12]=1,c[13]=6,c[14]=5,c[15]=1,c[16]=2,c[17]=6,c[18]=2,c[19]=3,c[20]=7,c[21]=2,c[22]=7,c[23]=6,c[24]=3,c[25]=0,c[26]=4,c[27]=3,c[28]=4,c[29]=7,c[30]=0,c[31]=1,c[32]=5,c[33]=0,c[34]=5,c[35]=4;const l=n.Cartesian3.subtract(y,u,s),A=.5*n.Cartesian3.magnitude(l);if(r.defined(t._offsetAttribute)){const e=f.length,n=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(n);x.applyOffset=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new i.Geometry({attributes:x,indices:c,primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:new e.BoundingSphere(n.Cartesian3.ZERO,A),offsetAttribute:t._offsetAttribute})},y.getUnitBox=function(){return r.defined(l)||(l=y.createGeometry(y.fromDimensions({dimensions:new n.Cartesian3(1,1,1),vertexFormat:u.VertexFormat.POSITION_ONLY}))),l},t.BoxGeometry=y})); diff --git a/public/lib/Cesium/Workers/Color-9ff9e611.js b/public/lib/Cesium/Workers/Color-9ff9e611.js deleted file mode 100644 index f2b62400..00000000 --- a/public/lib/Cesium/Workers/Color-9ff9e611.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./defaultValue-f6d5e6da","./Transforms-b3716b06","./Math-2ce22ee9"],(function(e,r,t,o){"use strict";function f(e,r,t){return t<0&&(t+=1),t>1&&(t-=1),6*t<1?e+6*(r-e)*t:2*t<1?r:3*t<2?e+(r-e)*(2/3-t)*6:e}function s(e,t,o,f){this.red=r.defaultValue(e,1),this.green=r.defaultValue(t,1),this.blue=r.defaultValue(o,1),this.alpha=r.defaultValue(f,1)}let n,l,C;s.fromCartesian4=function(e,t){return r.defined(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(e,t,o,f,n){return e=s.byteToFloat(r.defaultValue(e,255)),t=s.byteToFloat(r.defaultValue(t,255)),o=s.byteToFloat(r.defaultValue(o,255)),f=s.byteToFloat(r.defaultValue(f,255)),r.defined(n)?(n.red=e,n.green=t,n.blue=o,n.alpha=f,n):new s(e,t,o,f)},s.fromAlpha=function(e,t,o){return r.defined(o)?(o.red=e.red,o.green=e.green,o.blue=e.blue,o.alpha=t,o):new s(e.red,e.green,e.blue,t)},t.FeatureDetection.supportsTypedArrays()&&(n=new ArrayBuffer(4),l=new Uint32Array(n),C=new Uint8Array(n)),s.fromRgba=function(e,r){return l[0]=e,s.fromBytes(C[0],C[1],C[2],C[3],r)},s.fromHsl=function(e,t,o,n,l){e=r.defaultValue(e,0)%1,t=r.defaultValue(t,0),o=r.defaultValue(o,0),n=r.defaultValue(n,1);let C=o,i=o,a=o;if(0!==t){let r;r=o<.5?o*(1+t):o+t-o*t;const s=2*o-r;C=f(s,r,e+1/3),i=f(s,r,e),a=f(s,r,e-1/3)}return r.defined(l)?(l.red=C,l.green=i,l.blue=a,l.alpha=n,l):new s(C,i,a,n)},s.fromRandom=function(e,t){let f=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).red;if(!r.defined(f)){const t=r.defaultValue(e.minimumRed,0),s=r.defaultValue(e.maximumRed,1);f=t+o.CesiumMath.nextRandomNumber()*(s-t)}let n=e.green;if(!r.defined(n)){const t=r.defaultValue(e.minimumGreen,0),f=r.defaultValue(e.maximumGreen,1);n=t+o.CesiumMath.nextRandomNumber()*(f-t)}let l=e.blue;if(!r.defined(l)){const t=r.defaultValue(e.minimumBlue,0),f=r.defaultValue(e.maximumBlue,1);l=t+o.CesiumMath.nextRandomNumber()*(f-t)}let C=e.alpha;if(!r.defined(C)){const t=r.defaultValue(e.minimumAlpha,0),f=r.defaultValue(e.maximumAlpha,1);C=t+o.CesiumMath.nextRandomNumber()*(f-t)}return r.defined(t)?(t.red=f,t.green=n,t.blue=l,t.alpha=C,t):new s(f,n,l,C)};const i=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,a=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,E=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,u=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;s.fromCssColorString=function(e,t){r.defined(t)||(t=new s);const o=s[(e=e.replace(/\s/g,"")).toUpperCase()];if(r.defined(o))return s.clone(o,t),t;let f=i.exec(e);return null!==f?(t.red=parseInt(f[1],16)/15,t.green=parseInt(f[2],16)/15,t.blue=parseInt(f[3],16)/15,t.alpha=parseInt(r.defaultValue(f[4],"f"),16)/15,t):(f=a.exec(e),null!==f?(t.red=parseInt(f[1],16)/255,t.green=parseInt(f[2],16)/255,t.blue=parseInt(f[3],16)/255,t.alpha=parseInt(r.defaultValue(f[4],"ff"),16)/255,t):(f=E.exec(e),null!==f?(t.red=parseFloat(f[1])/("%"===f[1].substr(-1)?100:255),t.green=parseFloat(f[2])/("%"===f[2].substr(-1)?100:255),t.blue=parseFloat(f[3])/("%"===f[3].substr(-1)?100:255),t.alpha=parseFloat(r.defaultValue(f[4],"1.0")),t):(f=u.exec(e),null!==f?s.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(r.defaultValue(f[4],"1.0")),t):t=void 0)))},s.packedLength=4,s.pack=function(e,t,o){return o=r.defaultValue(o,0),t[o++]=e.red,t[o++]=e.green,t[o++]=e.blue,t[o]=e.alpha,t},s.unpack=function(e,t,o){return t=r.defaultValue(t,0),r.defined(o)||(o=new s),o.red=e[t++],o.green=e[t++],o.blue=e[t++],o.alpha=e[t],o},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},s.equalsArray=function(e,r,t){return e.red===r[t]&&e.green===r[t+1]&&e.blue===r[t+2]&&e.alpha===r[t+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return this===e||r.defined(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},s.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},s.prototype.toCssColorString=function(){const e=s.floatToByte(this.red),r=s.floatToByte(this.green),t=s.floatToByte(this.blue);return 1===this.alpha?`rgb(${e},${r},${t})`:`rgba(${e},${r},${t},${this.alpha})`},s.prototype.toCssHexString=function(){let e=s.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let r=s.floatToByte(this.green).toString(16);r.length<2&&(r=`0${r}`);let t=s.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let o=s.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${e}${r}${t}${o}`}return`#${e}${r}${t}`},s.prototype.toBytes=function(e){const t=s.floatToByte(this.red),o=s.floatToByte(this.green),f=s.floatToByte(this.blue),n=s.floatToByte(this.alpha);return r.defined(e)?(e[0]=t,e[1]=o,e[2]=f,e[3]=n,e):[t,o,f,n]},s.prototype.toRgba=function(){return C[0]=s.floatToByte(this.red),C[1]=s.floatToByte(this.green),C[2]=s.floatToByte(this.blue),C[3]=s.floatToByte(this.alpha),l[0]},s.prototype.brighten=function(e,r){return e=1-e,r.red=1-(1-this.red)*e,r.green=1-(1-this.green)*e,r.blue=1-(1-this.blue)*e,r.alpha=this.alpha,r},s.prototype.darken=function(e,r){return e=1-e,r.red=this.red*e,r.green=this.green*e,r.blue=this.blue*e,r.alpha=this.alpha,r},s.prototype.withAlpha=function(e,r){return s.fromAlpha(this,e,r)},s.add=function(e,r,t){return t.red=e.red+r.red,t.green=e.green+r.green,t.blue=e.blue+r.blue,t.alpha=e.alpha+r.alpha,t},s.subtract=function(e,r,t){return t.red=e.red-r.red,t.green=e.green-r.green,t.blue=e.blue-r.blue,t.alpha=e.alpha-r.alpha,t},s.multiply=function(e,r,t){return t.red=e.red*r.red,t.green=e.green*r.green,t.blue=e.blue*r.blue,t.alpha=e.alpha*r.alpha,t},s.divide=function(e,r,t){return t.red=e.red/r.red,t.green=e.green/r.green,t.blue=e.blue/r.blue,t.alpha=e.alpha/r.alpha,t},s.mod=function(e,r,t){return t.red=e.red%r.red,t.green=e.green%r.green,t.blue=e.blue%r.blue,t.alpha=e.alpha%r.alpha,t},s.lerp=function(e,r,t,f){return f.red=o.CesiumMath.lerp(e.red,r.red,t),f.green=o.CesiumMath.lerp(e.green,r.green,t),f.blue=o.CesiumMath.lerp(e.blue,r.blue,t),f.alpha=o.CesiumMath.lerp(e.alpha,r.alpha,t),f},s.multiplyByScalar=function(e,r,t){return t.red=e.red*r,t.green=e.green*r,t.blue=e.blue*r,t.alpha=e.alpha*r,t},s.divideByScalar=function(e,r,t){return t.red=e.red/r,t.green=e.green/r,t.blue=e.blue/r,t.alpha=e.alpha/r,t},s.ALICEBLUE=Object.freeze(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=Object.freeze(s.fromCssColorString("#FAEBD7")),s.AQUA=Object.freeze(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=Object.freeze(s.fromCssColorString("#7FFFD4")),s.AZURE=Object.freeze(s.fromCssColorString("#F0FFFF")),s.BEIGE=Object.freeze(s.fromCssColorString("#F5F5DC")),s.BISQUE=Object.freeze(s.fromCssColorString("#FFE4C4")),s.BLACK=Object.freeze(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=Object.freeze(s.fromCssColorString("#FFEBCD")),s.BLUE=Object.freeze(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=Object.freeze(s.fromCssColorString("#8A2BE2")),s.BROWN=Object.freeze(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=Object.freeze(s.fromCssColorString("#DEB887")),s.CADETBLUE=Object.freeze(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=Object.freeze(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=Object.freeze(s.fromCssColorString("#D2691E")),s.CORAL=Object.freeze(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=Object.freeze(s.fromCssColorString("#6495ED")),s.CORNSILK=Object.freeze(s.fromCssColorString("#FFF8DC")),s.CRIMSON=Object.freeze(s.fromCssColorString("#DC143C")),s.CYAN=Object.freeze(s.fromCssColorString("#00FFFF")),s.DARKBLUE=Object.freeze(s.fromCssColorString("#00008B")),s.DARKCYAN=Object.freeze(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=Object.freeze(s.fromCssColorString("#B8860B")),s.DARKGRAY=Object.freeze(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=Object.freeze(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=Object.freeze(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=Object.freeze(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=Object.freeze(s.fromCssColorString("#556B2F")),s.DARKORANGE=Object.freeze(s.fromCssColorString("#FF8C00")),s.DARKORCHID=Object.freeze(s.fromCssColorString("#9932CC")),s.DARKRED=Object.freeze(s.fromCssColorString("#8B0000")),s.DARKSALMON=Object.freeze(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=Object.freeze(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=Object.freeze(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=Object.freeze(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=Object.freeze(s.fromCssColorString("#00CED1")),s.DARKVIOLET=Object.freeze(s.fromCssColorString("#9400D3")),s.DEEPPINK=Object.freeze(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=Object.freeze(s.fromCssColorString("#00BFFF")),s.DIMGRAY=Object.freeze(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=Object.freeze(s.fromCssColorString("#1E90FF")),s.FIREBRICK=Object.freeze(s.fromCssColorString("#B22222")),s.FLORALWHITE=Object.freeze(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=Object.freeze(s.fromCssColorString("#228B22")),s.FUCHSIA=Object.freeze(s.fromCssColorString("#FF00FF")),s.GAINSBORO=Object.freeze(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=Object.freeze(s.fromCssColorString("#F8F8FF")),s.GOLD=Object.freeze(s.fromCssColorString("#FFD700")),s.GOLDENROD=Object.freeze(s.fromCssColorString("#DAA520")),s.GRAY=Object.freeze(s.fromCssColorString("#808080")),s.GREEN=Object.freeze(s.fromCssColorString("#008000")),s.GREENYELLOW=Object.freeze(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=Object.freeze(s.fromCssColorString("#F0FFF0")),s.HOTPINK=Object.freeze(s.fromCssColorString("#FF69B4")),s.INDIANRED=Object.freeze(s.fromCssColorString("#CD5C5C")),s.INDIGO=Object.freeze(s.fromCssColorString("#4B0082")),s.IVORY=Object.freeze(s.fromCssColorString("#FFFFF0")),s.KHAKI=Object.freeze(s.fromCssColorString("#F0E68C")),s.LAVENDER=Object.freeze(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=Object.freeze(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=Object.freeze(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=Object.freeze(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=Object.freeze(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=Object.freeze(s.fromCssColorString("#F08080")),s.LIGHTCYAN=Object.freeze(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=Object.freeze(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=Object.freeze(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=Object.freeze(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=Object.freeze(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=Object.freeze(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=Object.freeze(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=Object.freeze(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=Object.freeze(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=Object.freeze(s.fromCssColorString("#FFFFE0")),s.LIME=Object.freeze(s.fromCssColorString("#00FF00")),s.LIMEGREEN=Object.freeze(s.fromCssColorString("#32CD32")),s.LINEN=Object.freeze(s.fromCssColorString("#FAF0E6")),s.MAGENTA=Object.freeze(s.fromCssColorString("#FF00FF")),s.MAROON=Object.freeze(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=Object.freeze(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=Object.freeze(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=Object.freeze(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=Object.freeze(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=Object.freeze(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=Object.freeze(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=Object.freeze(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=Object.freeze(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=Object.freeze(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=Object.freeze(s.fromCssColorString("#191970")),s.MINTCREAM=Object.freeze(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=Object.freeze(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=Object.freeze(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=Object.freeze(s.fromCssColorString("#FFDEAD")),s.NAVY=Object.freeze(s.fromCssColorString("#000080")),s.OLDLACE=Object.freeze(s.fromCssColorString("#FDF5E6")),s.OLIVE=Object.freeze(s.fromCssColorString("#808000")),s.OLIVEDRAB=Object.freeze(s.fromCssColorString("#6B8E23")),s.ORANGE=Object.freeze(s.fromCssColorString("#FFA500")),s.ORANGERED=Object.freeze(s.fromCssColorString("#FF4500")),s.ORCHID=Object.freeze(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=Object.freeze(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=Object.freeze(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=Object.freeze(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=Object.freeze(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=Object.freeze(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=Object.freeze(s.fromCssColorString("#FFDAB9")),s.PERU=Object.freeze(s.fromCssColorString("#CD853F")),s.PINK=Object.freeze(s.fromCssColorString("#FFC0CB")),s.PLUM=Object.freeze(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=Object.freeze(s.fromCssColorString("#B0E0E6")),s.PURPLE=Object.freeze(s.fromCssColorString("#800080")),s.RED=Object.freeze(s.fromCssColorString("#FF0000")),s.ROSYBROWN=Object.freeze(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=Object.freeze(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=Object.freeze(s.fromCssColorString("#8B4513")),s.SALMON=Object.freeze(s.fromCssColorString("#FA8072")),s.SANDYBROWN=Object.freeze(s.fromCssColorString("#F4A460")),s.SEAGREEN=Object.freeze(s.fromCssColorString("#2E8B57")),s.SEASHELL=Object.freeze(s.fromCssColorString("#FFF5EE")),s.SIENNA=Object.freeze(s.fromCssColorString("#A0522D")),s.SILVER=Object.freeze(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=Object.freeze(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=Object.freeze(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=Object.freeze(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=Object.freeze(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=Object.freeze(s.fromCssColorString("#00FF7F")),s.STEELBLUE=Object.freeze(s.fromCssColorString("#4682B4")),s.TAN=Object.freeze(s.fromCssColorString("#D2B48C")),s.TEAL=Object.freeze(s.fromCssColorString("#008080")),s.THISTLE=Object.freeze(s.fromCssColorString("#D8BFD8")),s.TOMATO=Object.freeze(s.fromCssColorString("#FF6347")),s.TURQUOISE=Object.freeze(s.fromCssColorString("#40E0D0")),s.VIOLET=Object.freeze(s.fromCssColorString("#EE82EE")),s.WHEAT=Object.freeze(s.fromCssColorString("#F5DEB3")),s.WHITE=Object.freeze(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=Object.freeze(s.fromCssColorString("#F5F5F5")),s.YELLOW=Object.freeze(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=Object.freeze(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=Object.freeze(new s(0,0,0,0)),e.Color=s})); diff --git a/public/lib/Cesium/Workers/Color-d89a2fad.js b/public/lib/Cesium/Workers/Color-d89a2fad.js new file mode 100644 index 00000000..0a094fb3 --- /dev/null +++ b/public/lib/Cesium/Workers/Color-d89a2fad.js @@ -0,0 +1 @@ +define(["exports","./defaultValue-f6d5e6da","./Transforms-f17097e5","./Math-355606c6"],(function(e,r,t,o){"use strict";function s(e,r,t){return t<0&&(t+=1),t>1&&(t-=1),6*t<1?e+6*(r-e)*t:2*t<1?r:3*t<2?e+(r-e)*(2/3-t)*6:e}function f(e,t,o,s){this.red=r.defaultValue(e,1),this.green=r.defaultValue(t,1),this.blue=r.defaultValue(o,1),this.alpha=r.defaultValue(s,1)}let n,l,C;f.fromCartesian4=function(e,t){return r.defined(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new f(e.x,e.y,e.z,e.w)},f.fromBytes=function(e,t,o,s,n){return e=f.byteToFloat(r.defaultValue(e,255)),t=f.byteToFloat(r.defaultValue(t,255)),o=f.byteToFloat(r.defaultValue(o,255)),s=f.byteToFloat(r.defaultValue(s,255)),r.defined(n)?(n.red=e,n.green=t,n.blue=o,n.alpha=s,n):new f(e,t,o,s)},f.fromAlpha=function(e,t,o){return r.defined(o)?(o.red=e.red,o.green=e.green,o.blue=e.blue,o.alpha=t,o):new f(e.red,e.green,e.blue,t)},t.FeatureDetection.supportsTypedArrays()&&(n=new ArrayBuffer(4),l=new Uint32Array(n),C=new Uint8Array(n)),f.fromRgba=function(e,r){return l[0]=e,f.fromBytes(C[0],C[1],C[2],C[3],r)},f.fromHsl=function(e,t,o,n,l){e=r.defaultValue(e,0)%1,t=r.defaultValue(t,0),o=r.defaultValue(o,0),n=r.defaultValue(n,1);let C=o,i=o,a=o;if(0!==t){let r;r=o<.5?o*(1+t):o+t-o*t;const f=2*o-r;C=s(f,r,e+1/3),i=s(f,r,e),a=s(f,r,e-1/3)}return r.defined(l)?(l.red=C,l.green=i,l.blue=a,l.alpha=n,l):new f(C,i,a,n)},f.fromRandom=function(e,t){let s=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).red;if(!r.defined(s)){const t=r.defaultValue(e.minimumRed,0),f=r.defaultValue(e.maximumRed,1);s=t+o.CesiumMath.nextRandomNumber()*(f-t)}let n=e.green;if(!r.defined(n)){const t=r.defaultValue(e.minimumGreen,0),s=r.defaultValue(e.maximumGreen,1);n=t+o.CesiumMath.nextRandomNumber()*(s-t)}let l=e.blue;if(!r.defined(l)){const t=r.defaultValue(e.minimumBlue,0),s=r.defaultValue(e.maximumBlue,1);l=t+o.CesiumMath.nextRandomNumber()*(s-t)}let C=e.alpha;if(!r.defined(C)){const t=r.defaultValue(e.minimumAlpha,0),s=r.defaultValue(e.maximumAlpha,1);C=t+o.CesiumMath.nextRandomNumber()*(s-t)}return r.defined(t)?(t.red=s,t.green=n,t.blue=l,t.alpha=C,t):new f(s,n,l,C)};const i=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,a=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,E=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,u=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;f.fromCssColorString=function(e,t){r.defined(t)||(t=new f);const o=f[(e=e.trim()).toUpperCase()];if(r.defined(o))return f.clone(o,t),t;let s=i.exec(e);return null!==s?(t.red=parseInt(s[1],16)/15,t.green=parseInt(s[2],16)/15,t.blue=parseInt(s[3],16)/15,t.alpha=parseInt(r.defaultValue(s[4],"f"),16)/15,t):(s=a.exec(e),null!==s?(t.red=parseInt(s[1],16)/255,t.green=parseInt(s[2],16)/255,t.blue=parseInt(s[3],16)/255,t.alpha=parseInt(r.defaultValue(s[4],"ff"),16)/255,t):(s=E.exec(e),null!==s?(t.red=parseFloat(s[1])/("%"===s[1].substr(-1)?100:255),t.green=parseFloat(s[2])/("%"===s[2].substr(-1)?100:255),t.blue=parseFloat(s[3])/("%"===s[3].substr(-1)?100:255),t.alpha=parseFloat(r.defaultValue(s[4],"1.0")),t):(s=u.exec(e),null!==s?f.fromHsl(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(r.defaultValue(s[4],"1.0")),t):t=void 0)))},f.packedLength=4,f.pack=function(e,t,o){return o=r.defaultValue(o,0),t[o++]=e.red,t[o++]=e.green,t[o++]=e.blue,t[o]=e.alpha,t},f.unpack=function(e,t,o){return t=r.defaultValue(t,0),r.defined(o)||(o=new f),o.red=e[t++],o.green=e[t++],o.blue=e[t++],o.alpha=e[t],o},f.byteToFloat=function(e){return e/255},f.floatToByte=function(e){return 1===e?255:256*e|0},f.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new f(e.red,e.green,e.blue,e.alpha)},f.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},f.equalsArray=function(e,r,t){return e.red===r[t]&&e.green===r[t+1]&&e.blue===r[t+2]&&e.alpha===r[t+3]},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return this===e||r.defined(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},f.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},f.prototype.toCssColorString=function(){const e=f.floatToByte(this.red),r=f.floatToByte(this.green),t=f.floatToByte(this.blue);return 1===this.alpha?`rgb(${e},${r},${t})`:`rgba(${e},${r},${t},${this.alpha})`},f.prototype.toCssHexString=function(){let e=f.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let r=f.floatToByte(this.green).toString(16);r.length<2&&(r=`0${r}`);let t=f.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let o=f.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${e}${r}${t}${o}`}return`#${e}${r}${t}`},f.prototype.toBytes=function(e){const t=f.floatToByte(this.red),o=f.floatToByte(this.green),s=f.floatToByte(this.blue),n=f.floatToByte(this.alpha);return r.defined(e)?(e[0]=t,e[1]=o,e[2]=s,e[3]=n,e):[t,o,s,n]},f.prototype.toRgba=function(){return C[0]=f.floatToByte(this.red),C[1]=f.floatToByte(this.green),C[2]=f.floatToByte(this.blue),C[3]=f.floatToByte(this.alpha),l[0]},f.prototype.brighten=function(e,r){return e=1-e,r.red=1-(1-this.red)*e,r.green=1-(1-this.green)*e,r.blue=1-(1-this.blue)*e,r.alpha=this.alpha,r},f.prototype.darken=function(e,r){return e=1-e,r.red=this.red*e,r.green=this.green*e,r.blue=this.blue*e,r.alpha=this.alpha,r},f.prototype.withAlpha=function(e,r){return f.fromAlpha(this,e,r)},f.add=function(e,r,t){return t.red=e.red+r.red,t.green=e.green+r.green,t.blue=e.blue+r.blue,t.alpha=e.alpha+r.alpha,t},f.subtract=function(e,r,t){return t.red=e.red-r.red,t.green=e.green-r.green,t.blue=e.blue-r.blue,t.alpha=e.alpha-r.alpha,t},f.multiply=function(e,r,t){return t.red=e.red*r.red,t.green=e.green*r.green,t.blue=e.blue*r.blue,t.alpha=e.alpha*r.alpha,t},f.divide=function(e,r,t){return t.red=e.red/r.red,t.green=e.green/r.green,t.blue=e.blue/r.blue,t.alpha=e.alpha/r.alpha,t},f.mod=function(e,r,t){return t.red=e.red%r.red,t.green=e.green%r.green,t.blue=e.blue%r.blue,t.alpha=e.alpha%r.alpha,t},f.lerp=function(e,r,t,s){return s.red=o.CesiumMath.lerp(e.red,r.red,t),s.green=o.CesiumMath.lerp(e.green,r.green,t),s.blue=o.CesiumMath.lerp(e.blue,r.blue,t),s.alpha=o.CesiumMath.lerp(e.alpha,r.alpha,t),s},f.multiplyByScalar=function(e,r,t){return t.red=e.red*r,t.green=e.green*r,t.blue=e.blue*r,t.alpha=e.alpha*r,t},f.divideByScalar=function(e,r,t){return t.red=e.red/r,t.green=e.green/r,t.blue=e.blue/r,t.alpha=e.alpha/r,t},f.ALICEBLUE=Object.freeze(f.fromCssColorString("#F0F8FF")),f.ANTIQUEWHITE=Object.freeze(f.fromCssColorString("#FAEBD7")),f.AQUA=Object.freeze(f.fromCssColorString("#00FFFF")),f.AQUAMARINE=Object.freeze(f.fromCssColorString("#7FFFD4")),f.AZURE=Object.freeze(f.fromCssColorString("#F0FFFF")),f.BEIGE=Object.freeze(f.fromCssColorString("#F5F5DC")),f.BISQUE=Object.freeze(f.fromCssColorString("#FFE4C4")),f.BLACK=Object.freeze(f.fromCssColorString("#000000")),f.BLANCHEDALMOND=Object.freeze(f.fromCssColorString("#FFEBCD")),f.BLUE=Object.freeze(f.fromCssColorString("#0000FF")),f.BLUEVIOLET=Object.freeze(f.fromCssColorString("#8A2BE2")),f.BROWN=Object.freeze(f.fromCssColorString("#A52A2A")),f.BURLYWOOD=Object.freeze(f.fromCssColorString("#DEB887")),f.CADETBLUE=Object.freeze(f.fromCssColorString("#5F9EA0")),f.CHARTREUSE=Object.freeze(f.fromCssColorString("#7FFF00")),f.CHOCOLATE=Object.freeze(f.fromCssColorString("#D2691E")),f.CORAL=Object.freeze(f.fromCssColorString("#FF7F50")),f.CORNFLOWERBLUE=Object.freeze(f.fromCssColorString("#6495ED")),f.CORNSILK=Object.freeze(f.fromCssColorString("#FFF8DC")),f.CRIMSON=Object.freeze(f.fromCssColorString("#DC143C")),f.CYAN=Object.freeze(f.fromCssColorString("#00FFFF")),f.DARKBLUE=Object.freeze(f.fromCssColorString("#00008B")),f.DARKCYAN=Object.freeze(f.fromCssColorString("#008B8B")),f.DARKGOLDENROD=Object.freeze(f.fromCssColorString("#B8860B")),f.DARKGRAY=Object.freeze(f.fromCssColorString("#A9A9A9")),f.DARKGREEN=Object.freeze(f.fromCssColorString("#006400")),f.DARKGREY=f.DARKGRAY,f.DARKKHAKI=Object.freeze(f.fromCssColorString("#BDB76B")),f.DARKMAGENTA=Object.freeze(f.fromCssColorString("#8B008B")),f.DARKOLIVEGREEN=Object.freeze(f.fromCssColorString("#556B2F")),f.DARKORANGE=Object.freeze(f.fromCssColorString("#FF8C00")),f.DARKORCHID=Object.freeze(f.fromCssColorString("#9932CC")),f.DARKRED=Object.freeze(f.fromCssColorString("#8B0000")),f.DARKSALMON=Object.freeze(f.fromCssColorString("#E9967A")),f.DARKSEAGREEN=Object.freeze(f.fromCssColorString("#8FBC8F")),f.DARKSLATEBLUE=Object.freeze(f.fromCssColorString("#483D8B")),f.DARKSLATEGRAY=Object.freeze(f.fromCssColorString("#2F4F4F")),f.DARKSLATEGREY=f.DARKSLATEGRAY,f.DARKTURQUOISE=Object.freeze(f.fromCssColorString("#00CED1")),f.DARKVIOLET=Object.freeze(f.fromCssColorString("#9400D3")),f.DEEPPINK=Object.freeze(f.fromCssColorString("#FF1493")),f.DEEPSKYBLUE=Object.freeze(f.fromCssColorString("#00BFFF")),f.DIMGRAY=Object.freeze(f.fromCssColorString("#696969")),f.DIMGREY=f.DIMGRAY,f.DODGERBLUE=Object.freeze(f.fromCssColorString("#1E90FF")),f.FIREBRICK=Object.freeze(f.fromCssColorString("#B22222")),f.FLORALWHITE=Object.freeze(f.fromCssColorString("#FFFAF0")),f.FORESTGREEN=Object.freeze(f.fromCssColorString("#228B22")),f.FUCHSIA=Object.freeze(f.fromCssColorString("#FF00FF")),f.GAINSBORO=Object.freeze(f.fromCssColorString("#DCDCDC")),f.GHOSTWHITE=Object.freeze(f.fromCssColorString("#F8F8FF")),f.GOLD=Object.freeze(f.fromCssColorString("#FFD700")),f.GOLDENROD=Object.freeze(f.fromCssColorString("#DAA520")),f.GRAY=Object.freeze(f.fromCssColorString("#808080")),f.GREEN=Object.freeze(f.fromCssColorString("#008000")),f.GREENYELLOW=Object.freeze(f.fromCssColorString("#ADFF2F")),f.GREY=f.GRAY,f.HONEYDEW=Object.freeze(f.fromCssColorString("#F0FFF0")),f.HOTPINK=Object.freeze(f.fromCssColorString("#FF69B4")),f.INDIANRED=Object.freeze(f.fromCssColorString("#CD5C5C")),f.INDIGO=Object.freeze(f.fromCssColorString("#4B0082")),f.IVORY=Object.freeze(f.fromCssColorString("#FFFFF0")),f.KHAKI=Object.freeze(f.fromCssColorString("#F0E68C")),f.LAVENDER=Object.freeze(f.fromCssColorString("#E6E6FA")),f.LAVENDAR_BLUSH=Object.freeze(f.fromCssColorString("#FFF0F5")),f.LAWNGREEN=Object.freeze(f.fromCssColorString("#7CFC00")),f.LEMONCHIFFON=Object.freeze(f.fromCssColorString("#FFFACD")),f.LIGHTBLUE=Object.freeze(f.fromCssColorString("#ADD8E6")),f.LIGHTCORAL=Object.freeze(f.fromCssColorString("#F08080")),f.LIGHTCYAN=Object.freeze(f.fromCssColorString("#E0FFFF")),f.LIGHTGOLDENRODYELLOW=Object.freeze(f.fromCssColorString("#FAFAD2")),f.LIGHTGRAY=Object.freeze(f.fromCssColorString("#D3D3D3")),f.LIGHTGREEN=Object.freeze(f.fromCssColorString("#90EE90")),f.LIGHTGREY=f.LIGHTGRAY,f.LIGHTPINK=Object.freeze(f.fromCssColorString("#FFB6C1")),f.LIGHTSEAGREEN=Object.freeze(f.fromCssColorString("#20B2AA")),f.LIGHTSKYBLUE=Object.freeze(f.fromCssColorString("#87CEFA")),f.LIGHTSLATEGRAY=Object.freeze(f.fromCssColorString("#778899")),f.LIGHTSLATEGREY=f.LIGHTSLATEGRAY,f.LIGHTSTEELBLUE=Object.freeze(f.fromCssColorString("#B0C4DE")),f.LIGHTYELLOW=Object.freeze(f.fromCssColorString("#FFFFE0")),f.LIME=Object.freeze(f.fromCssColorString("#00FF00")),f.LIMEGREEN=Object.freeze(f.fromCssColorString("#32CD32")),f.LINEN=Object.freeze(f.fromCssColorString("#FAF0E6")),f.MAGENTA=Object.freeze(f.fromCssColorString("#FF00FF")),f.MAROON=Object.freeze(f.fromCssColorString("#800000")),f.MEDIUMAQUAMARINE=Object.freeze(f.fromCssColorString("#66CDAA")),f.MEDIUMBLUE=Object.freeze(f.fromCssColorString("#0000CD")),f.MEDIUMORCHID=Object.freeze(f.fromCssColorString("#BA55D3")),f.MEDIUMPURPLE=Object.freeze(f.fromCssColorString("#9370DB")),f.MEDIUMSEAGREEN=Object.freeze(f.fromCssColorString("#3CB371")),f.MEDIUMSLATEBLUE=Object.freeze(f.fromCssColorString("#7B68EE")),f.MEDIUMSPRINGGREEN=Object.freeze(f.fromCssColorString("#00FA9A")),f.MEDIUMTURQUOISE=Object.freeze(f.fromCssColorString("#48D1CC")),f.MEDIUMVIOLETRED=Object.freeze(f.fromCssColorString("#C71585")),f.MIDNIGHTBLUE=Object.freeze(f.fromCssColorString("#191970")),f.MINTCREAM=Object.freeze(f.fromCssColorString("#F5FFFA")),f.MISTYROSE=Object.freeze(f.fromCssColorString("#FFE4E1")),f.MOCCASIN=Object.freeze(f.fromCssColorString("#FFE4B5")),f.NAVAJOWHITE=Object.freeze(f.fromCssColorString("#FFDEAD")),f.NAVY=Object.freeze(f.fromCssColorString("#000080")),f.OLDLACE=Object.freeze(f.fromCssColorString("#FDF5E6")),f.OLIVE=Object.freeze(f.fromCssColorString("#808000")),f.OLIVEDRAB=Object.freeze(f.fromCssColorString("#6B8E23")),f.ORANGE=Object.freeze(f.fromCssColorString("#FFA500")),f.ORANGERED=Object.freeze(f.fromCssColorString("#FF4500")),f.ORCHID=Object.freeze(f.fromCssColorString("#DA70D6")),f.PALEGOLDENROD=Object.freeze(f.fromCssColorString("#EEE8AA")),f.PALEGREEN=Object.freeze(f.fromCssColorString("#98FB98")),f.PALETURQUOISE=Object.freeze(f.fromCssColorString("#AFEEEE")),f.PALEVIOLETRED=Object.freeze(f.fromCssColorString("#DB7093")),f.PAPAYAWHIP=Object.freeze(f.fromCssColorString("#FFEFD5")),f.PEACHPUFF=Object.freeze(f.fromCssColorString("#FFDAB9")),f.PERU=Object.freeze(f.fromCssColorString("#CD853F")),f.PINK=Object.freeze(f.fromCssColorString("#FFC0CB")),f.PLUM=Object.freeze(f.fromCssColorString("#DDA0DD")),f.POWDERBLUE=Object.freeze(f.fromCssColorString("#B0E0E6")),f.PURPLE=Object.freeze(f.fromCssColorString("#800080")),f.RED=Object.freeze(f.fromCssColorString("#FF0000")),f.ROSYBROWN=Object.freeze(f.fromCssColorString("#BC8F8F")),f.ROYALBLUE=Object.freeze(f.fromCssColorString("#4169E1")),f.SADDLEBROWN=Object.freeze(f.fromCssColorString("#8B4513")),f.SALMON=Object.freeze(f.fromCssColorString("#FA8072")),f.SANDYBROWN=Object.freeze(f.fromCssColorString("#F4A460")),f.SEAGREEN=Object.freeze(f.fromCssColorString("#2E8B57")),f.SEASHELL=Object.freeze(f.fromCssColorString("#FFF5EE")),f.SIENNA=Object.freeze(f.fromCssColorString("#A0522D")),f.SILVER=Object.freeze(f.fromCssColorString("#C0C0C0")),f.SKYBLUE=Object.freeze(f.fromCssColorString("#87CEEB")),f.SLATEBLUE=Object.freeze(f.fromCssColorString("#6A5ACD")),f.SLATEGRAY=Object.freeze(f.fromCssColorString("#708090")),f.SLATEGREY=f.SLATEGRAY,f.SNOW=Object.freeze(f.fromCssColorString("#FFFAFA")),f.SPRINGGREEN=Object.freeze(f.fromCssColorString("#00FF7F")),f.STEELBLUE=Object.freeze(f.fromCssColorString("#4682B4")),f.TAN=Object.freeze(f.fromCssColorString("#D2B48C")),f.TEAL=Object.freeze(f.fromCssColorString("#008080")),f.THISTLE=Object.freeze(f.fromCssColorString("#D8BFD8")),f.TOMATO=Object.freeze(f.fromCssColorString("#FF6347")),f.TURQUOISE=Object.freeze(f.fromCssColorString("#40E0D0")),f.VIOLET=Object.freeze(f.fromCssColorString("#EE82EE")),f.WHEAT=Object.freeze(f.fromCssColorString("#F5DEB3")),f.WHITE=Object.freeze(f.fromCssColorString("#FFFFFF")),f.WHITESMOKE=Object.freeze(f.fromCssColorString("#F5F5F5")),f.YELLOW=Object.freeze(f.fromCssColorString("#FFFF00")),f.YELLOWGREEN=Object.freeze(f.fromCssColorString("#9ACD32")),f.TRANSPARENT=Object.freeze(new f(0,0,0,0)),e.Color=f})); diff --git a/public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-21546fbd.js b/public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-c5fc6f2f.js similarity index 91% rename from public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-21546fbd.js rename to public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-c5fc6f2f.js index d93ff680..21a97970 100644 --- a/public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-21546fbd.js +++ b/public/lib/Cesium/Workers/CoplanarPolygonGeometryLibrary-c5fc6f2f.js @@ -1 +1 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./OrientedBoundingBox-8446a826"],(function(n,t,e,r){"use strict";const a={},i=new e.Cartesian3,o=new e.Cartesian3,u=new e.Cartesian3,s=new e.Cartesian3,c=new r.OrientedBoundingBox;function C(n,r,a,o,u){const s=e.Cartesian3.subtract(n,r,i),c=e.Cartesian3.dot(a,s),C=e.Cartesian3.dot(o,s);return t.Cartesian2.fromElements(c,C,u)}a.validOutline=function(n){const t=r.OrientedBoundingBox.fromPoints(n,c).halfAxes,a=e.Matrix3.getColumn(t,0,o),i=e.Matrix3.getColumn(t,1,u),C=e.Matrix3.getColumn(t,2,s),m=e.Cartesian3.magnitude(a),g=e.Cartesian3.magnitude(i),l=e.Cartesian3.magnitude(C);return!(0===m&&(0===g||0===l)||0===g&&0===l)},a.computeProjectTo2DArguments=function(n,t,a,i){const C=r.OrientedBoundingBox.fromPoints(n,c),m=C.halfAxes,g=e.Matrix3.getColumn(m,0,o),l=e.Matrix3.getColumn(m,1,u),d=e.Matrix3.getColumn(m,2,s),f=e.Cartesian3.magnitude(g),x=e.Cartesian3.magnitude(l),M=e.Cartesian3.magnitude(d),B=Math.min(f,x,M);if(0===f&&(0===x||0===M)||0===x&&0===M)return!1;let P,w;return B!==x&&B!==M||(P=g),B===f?P=l:B===M&&(w=l),B!==f&&B!==x||(w=d),e.Cartesian3.normalize(P,a),e.Cartesian3.normalize(w,i),e.Cartesian3.clone(C.center,t),!0},a.createProjectPointsTo2DFunction=function(n,t,e){return function(r){const a=new Array(r.length);for(let i=0;i<r.length;i++)a[i]=C(r[i],n,t,e);return a}},a.createProjectPointTo2DFunction=function(n,t,e){return function(r,a){return C(r,n,t,e,a)}};var m=a;n.CoplanarPolygonGeometryLibrary=m})); +define(["exports","./Matrix2-7a8e9daf","./Matrix3-b2351961","./OrientedBoundingBox-c083edd8"],(function(n,t,e,r){"use strict";const a={},i=new e.Cartesian3,o=new e.Cartesian3,u=new e.Cartesian3,s=new e.Cartesian3,c=new r.OrientedBoundingBox;function C(n,r,a,o,u){const s=e.Cartesian3.subtract(n,r,i),c=e.Cartesian3.dot(a,s),C=e.Cartesian3.dot(o,s);return t.Cartesian2.fromElements(c,C,u)}a.validOutline=function(n){const t=r.OrientedBoundingBox.fromPoints(n,c).halfAxes,a=e.Matrix3.getColumn(t,0,o),i=e.Matrix3.getColumn(t,1,u),C=e.Matrix3.getColumn(t,2,s),m=e.Cartesian3.magnitude(a),g=e.Cartesian3.magnitude(i),l=e.Cartesian3.magnitude(C);return!(0===m&&(0===g||0===l)||0===g&&0===l)},a.computeProjectTo2DArguments=function(n,t,a,i){const C=r.OrientedBoundingBox.fromPoints(n,c),m=C.halfAxes,g=e.Matrix3.getColumn(m,0,o),l=e.Matrix3.getColumn(m,1,u),d=e.Matrix3.getColumn(m,2,s),f=e.Cartesian3.magnitude(g),x=e.Cartesian3.magnitude(l),M=e.Cartesian3.magnitude(d),B=Math.min(f,x,M);if(0===f&&(0===x||0===M)||0===x&&0===M)return!1;let P,w;return B!==x&&B!==M||(P=g),B===f?P=l:B===M&&(w=l),B!==f&&B!==x||(w=d),e.Cartesian3.normalize(P,a),e.Cartesian3.normalize(w,i),e.Cartesian3.clone(C.center,t),!0},a.createProjectPointsTo2DFunction=function(n,t,e){return function(r){const a=new Array(r.length);for(let i=0;i<r.length;i++)a[i]=C(r[i],n,t,e);return a}},a.createProjectPointTo2DFunction=function(n,t,e){return function(r,a){return C(r,n,t,e,a)}};var m=a;n.CoplanarPolygonGeometryLibrary=m})); diff --git a/public/lib/Cesium/Workers/CorridorGeometryLibrary-4521ac9a.js b/public/lib/Cesium/Workers/CorridorGeometryLibrary-d09d785b.js similarity index 96% rename from public/lib/Cesium/Workers/CorridorGeometryLibrary-4521ac9a.js rename to public/lib/Cesium/Workers/CorridorGeometryLibrary-d09d785b.js index 931f5f0a..6213f93a 100644 --- a/public/lib/Cesium/Workers/CorridorGeometryLibrary-4521ac9a.js +++ b/public/lib/Cesium/Workers/CorridorGeometryLibrary-d09d785b.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./PolylineVolumeGeometryLibrary-01e8948c","./defaultValue-f6d5e6da","./Math-2ce22ee9","./PolylinePipeline-bcbea07f","./Transforms-b3716b06"],(function(a,e,n,t,r,i,s){"use strict";const o={},l=new e.Cartesian3,C=new e.Cartesian3,y=new e.Cartesian3,c=new e.Cartesian3,u=[new e.Cartesian3,new e.Cartesian3],d=new e.Cartesian3,p=new e.Cartesian3,m=new e.Cartesian3,g=new e.Cartesian3,h=new e.Cartesian3,f=new e.Cartesian3,w=new e.Cartesian3,x=new e.Cartesian3,z=new e.Cartesian3,B=new e.Cartesian3,P=new s.Quaternion,A=new e.Matrix3;function E(a,t,i,o,y){const c=e.Cartesian3.angleBetween(e.Cartesian3.subtract(t,a,l),e.Cartesian3.subtract(i,a,C)),u=o===n.CornerType.BEVELED?1:Math.ceil(c/r.CesiumMath.toRadians(5))+1,d=3*u,p=new Array(d);let m;p[d-3]=i.x,p[d-2]=i.y,p[d-1]=i.z,m=y?e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e.Cartesian3.negate(a,l),c/u,P),A):e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(a,c/u,P),A);let g=0;t=e.Cartesian3.clone(t,l);for(let a=0;a<u;a++)t=e.Matrix3.multiplyByVector(m,t,t),p[g++]=t.x,p[g++]=t.y,p[g++]=t.z;return p}function S(a,n,t,r){let i=l;return r||(n=e.Cartesian3.negate(n,n)),i=e.Cartesian3.add(a,n,i),[i.x,i.y,i.z,t.x,t.y,t.z]}function D(a,n,t,r){const i=new Array(a.length),s=new Array(a.length),o=e.Cartesian3.multiplyByScalar(n,t,l),u=e.Cartesian3.negate(o,C);let d=0,p=a.length-1;for(let n=0;n<a.length;n+=3){const t=e.Cartesian3.fromArray(a,n,y),r=e.Cartesian3.add(t,u,c);i[d++]=r.x,i[d++]=r.y,i[d++]=r.z;const l=e.Cartesian3.add(t,o,c);s[p--]=l.z,s[p--]=l.y,s[p--]=l.x}return r.push(i,s),r}o.addAttribute=function(a,e,n,r){const i=e.x,s=e.y,o=e.z;t.defined(n)&&(a[n]=i,a[n+1]=s,a[n+2]=o),t.defined(r)&&(a[r]=o,a[r-1]=s,a[r-2]=i)};const b=new e.Cartesian3,M=new e.Cartesian3;o.computePositions=function(a){const t=a.granularity,s=a.positions,o=a.ellipsoid,C=a.width/2,y=a.cornerType,c=a.saveAttributes;let P=d,A=p,T=m,N=g,L=h,V=f,O=w,R=x,Q=z,U=B,v=[];const G=c?[]:void 0,I=c?[]:void 0;let q,j=s[0],k=s[1];A=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,A),A),P=o.geodeticSurfaceNormal(j,P),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),O=e.Cartesian3.clone(j,O),j=k,T=e.Cartesian3.negate(A,T);const F=[];let H;const J=s.length;for(H=1;H<J-1;H++){P=o.geodeticSurfaceNormal(j,P),k=s[H+1],A=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,A),A),L=e.Cartesian3.normalize(e.Cartesian3.add(A,T,L),L);const a=e.Cartesian3.multiplyByScalar(P,e.Cartesian3.dot(A,P),b);e.Cartesian3.subtract(A,a,a),e.Cartesian3.normalize(a,a);const d=e.Cartesian3.multiplyByScalar(P,e.Cartesian3.dot(T,P),M);e.Cartesian3.subtract(T,d,d),e.Cartesian3.normalize(d,d);if(!r.CesiumMath.equalsEpsilon(Math.abs(e.Cartesian3.dot(a,d)),1,r.CesiumMath.EPSILON7)){L=e.Cartesian3.cross(L,P,L),L=e.Cartesian3.cross(P,L,L),L=e.Cartesian3.normalize(L,L);const a=C/Math.max(.25,e.Cartesian3.magnitude(e.Cartesian3.cross(L,T,l))),r=n.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(A,T,j,o);L=e.Cartesian3.multiplyByScalar(L,a,L),r?(R=e.Cartesian3.add(j,L,R),U=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,U),U),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),V=e.Cartesian3.clone(Q,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),O=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,O),O),y===n.CornerType.ROUNDED||y===n.CornerType.BEVELED?F.push({leftPositions:E(R,V,Q,y,r)}):F.push({leftPositions:S(j,e.Cartesian3.negate(L,L),Q,r)})):(Q=e.Cartesian3.add(j,L,Q),U=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,U),U),U),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),V=e.Cartesian3.clone(R,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),O=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,O),O),O),y===n.CornerType.ROUNDED||y===n.CornerType.BEVELED?F.push({rightPositions:E(Q,V,R,y,r)}):F.push({rightPositions:S(j,L,R,r)})),T=e.Cartesian3.negate(A,T)}j=k}let K;return P=o.geodeticSurfaceNormal(j,P),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(j,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),y===n.CornerType.ROUNDED&&(K=function(a){let t=d,r=p,i=m,s=a[1];r=e.Cartesian3.fromArray(a[1],s.length-3,r),i=e.Cartesian3.fromArray(a[0],0,i),t=e.Cartesian3.midpoint(r,i,t);const o=E(t,r,i,n.CornerType.ROUNDED,!1),l=a.length-1,C=a[l-1];return s=a[l],r=e.Cartesian3.fromArray(C,C.length-3,r),i=e.Cartesian3.fromArray(s,0,i),t=e.Cartesian3.midpoint(r,i,t),[o,E(t,r,i,n.CornerType.ROUNDED,!1)]}(v)),{positions:v,corners:F,lefts:G,normals:I,endPositions:K}};var T=o;a.CorridorGeometryLibrary=T})); +define(["exports","./Matrix3-b2351961","./PolylineVolumeGeometryLibrary-5050cb1d","./defaultValue-f6d5e6da","./Math-355606c6","./PolylinePipeline-8df321dd","./Transforms-f17097e5"],(function(a,e,n,t,r,i,s){"use strict";const o={},l=new e.Cartesian3,C=new e.Cartesian3,y=new e.Cartesian3,c=new e.Cartesian3,u=[new e.Cartesian3,new e.Cartesian3],d=new e.Cartesian3,p=new e.Cartesian3,m=new e.Cartesian3,g=new e.Cartesian3,h=new e.Cartesian3,f=new e.Cartesian3,w=new e.Cartesian3,x=new e.Cartesian3,z=new e.Cartesian3,B=new e.Cartesian3,P=new s.Quaternion,A=new e.Matrix3;function E(a,t,i,o,y){const c=e.Cartesian3.angleBetween(e.Cartesian3.subtract(t,a,l),e.Cartesian3.subtract(i,a,C)),u=o===n.CornerType.BEVELED?1:Math.ceil(c/r.CesiumMath.toRadians(5))+1,d=3*u,p=new Array(d);let m;p[d-3]=i.x,p[d-2]=i.y,p[d-1]=i.z,m=y?e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e.Cartesian3.negate(a,l),c/u,P),A):e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(a,c/u,P),A);let g=0;t=e.Cartesian3.clone(t,l);for(let a=0;a<u;a++)t=e.Matrix3.multiplyByVector(m,t,t),p[g++]=t.x,p[g++]=t.y,p[g++]=t.z;return p}function S(a,n,t,r){let i=l;return r||(n=e.Cartesian3.negate(n,n)),i=e.Cartesian3.add(a,n,i),[i.x,i.y,i.z,t.x,t.y,t.z]}function D(a,n,t,r){const i=new Array(a.length),s=new Array(a.length),o=e.Cartesian3.multiplyByScalar(n,t,l),u=e.Cartesian3.negate(o,C);let d=0,p=a.length-1;for(let n=0;n<a.length;n+=3){const t=e.Cartesian3.fromArray(a,n,y),r=e.Cartesian3.add(t,u,c);i[d++]=r.x,i[d++]=r.y,i[d++]=r.z;const l=e.Cartesian3.add(t,o,c);s[p--]=l.z,s[p--]=l.y,s[p--]=l.x}return r.push(i,s),r}o.addAttribute=function(a,e,n,r){const i=e.x,s=e.y,o=e.z;t.defined(n)&&(a[n]=i,a[n+1]=s,a[n+2]=o),t.defined(r)&&(a[r]=o,a[r-1]=s,a[r-2]=i)};const b=new e.Cartesian3,M=new e.Cartesian3;o.computePositions=function(a){const t=a.granularity,s=a.positions,o=a.ellipsoid,C=a.width/2,y=a.cornerType,c=a.saveAttributes;let P=d,A=p,T=m,N=g,L=h,V=f,O=w,R=x,Q=z,U=B,v=[];const G=c?[]:void 0,I=c?[]:void 0;let q,j=s[0],k=s[1];A=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,A),A),P=o.geodeticSurfaceNormal(j,P),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),O=e.Cartesian3.clone(j,O),j=k,T=e.Cartesian3.negate(A,T);const F=[];let H;const J=s.length;for(H=1;H<J-1;H++){P=o.geodeticSurfaceNormal(j,P),k=s[H+1],A=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,A),A),L=e.Cartesian3.normalize(e.Cartesian3.add(A,T,L),L);const a=e.Cartesian3.multiplyByScalar(P,e.Cartesian3.dot(A,P),b);e.Cartesian3.subtract(A,a,a),e.Cartesian3.normalize(a,a);const d=e.Cartesian3.multiplyByScalar(P,e.Cartesian3.dot(T,P),M);e.Cartesian3.subtract(T,d,d),e.Cartesian3.normalize(d,d);if(!r.CesiumMath.equalsEpsilon(Math.abs(e.Cartesian3.dot(a,d)),1,r.CesiumMath.EPSILON7)){L=e.Cartesian3.cross(L,P,L),L=e.Cartesian3.cross(P,L,L),L=e.Cartesian3.normalize(L,L);const a=C/Math.max(.25,e.Cartesian3.magnitude(e.Cartesian3.cross(L,T,l))),r=n.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(A,T,j,o);L=e.Cartesian3.multiplyByScalar(L,a,L),r?(R=e.Cartesian3.add(j,L,R),U=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,U),U),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),V=e.Cartesian3.clone(Q,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),O=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,O),O),y===n.CornerType.ROUNDED||y===n.CornerType.BEVELED?F.push({leftPositions:E(R,V,Q,y,r)}):F.push({leftPositions:S(j,e.Cartesian3.negate(L,L),Q,r)})):(Q=e.Cartesian3.add(j,L,Q),U=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,U),U),U),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),V=e.Cartesian3.clone(R,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(P,A,N),N),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),O=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,O),O),O),y===n.CornerType.ROUNDED||y===n.CornerType.BEVELED?F.push({rightPositions:E(Q,V,R,y,r)}):F.push({rightPositions:S(j,L,R,r)})),T=e.Cartesian3.negate(A,T)}j=k}let K;return P=o.geodeticSurfaceNormal(j,P),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(j,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=D(q,N,C,v),c&&(G.push(N.x,N.y,N.z),I.push(P.x,P.y,P.z)),y===n.CornerType.ROUNDED&&(K=function(a){let t=d,r=p,i=m,s=a[1];r=e.Cartesian3.fromArray(a[1],s.length-3,r),i=e.Cartesian3.fromArray(a[0],0,i),t=e.Cartesian3.midpoint(r,i,t);const o=E(t,r,i,n.CornerType.ROUNDED,!1),l=a.length-1,C=a[l-1];return s=a[l],r=e.Cartesian3.fromArray(C,C.length-3,r),i=e.Cartesian3.fromArray(s,0,i),t=e.Cartesian3.midpoint(r,i,t),[o,E(t,r,i,n.CornerType.ROUNDED,!1)]}(v)),{positions:v,corners:F,lefts:G,normals:I,endPositions:K}};var T=o;a.CorridorGeometryLibrary=T})); diff --git a/public/lib/Cesium/Workers/CylinderGeometry-a492df0d.js b/public/lib/Cesium/Workers/CylinderGeometry-25b4eb3a.js similarity index 92% rename from public/lib/Cesium/Workers/CylinderGeometry-a492df0d.js rename to public/lib/Cesium/Workers/CylinderGeometry-25b4eb3a.js index e01ec1fa..e5a857c7 100644 --- a/public/lib/Cesium/Workers/CylinderGeometry-a492df0d.js +++ b/public/lib/Cesium/Workers/CylinderGeometry-25b4eb3a.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./CylinderGeometryLibrary-f49f33a8","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./VertexFormat-fbdec922"],(function(t,e,n,a,o,r,i,s,u,m,l,c,p){"use strict";const y=new n.Cartesian2,d=new a.Cartesian3,f=new a.Cartesian3,b=new a.Cartesian3,A=new a.Cartesian3;function x(t){const e=(t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT)).length,n=t.topRadius,a=t.bottomRadius,o=i.defaultValue(t.vertexFormat,p.VertexFormat.DEFAULT),r=i.defaultValue(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=a,this._vertexFormat=p.VertexFormat.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}x.packedLength=p.VertexFormat.packedLength+5,x.pack=function(t,e,n){return n=i.defaultValue(n,0),p.VertexFormat.pack(t._vertexFormat,e,n),n+=p.VertexFormat.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=i.defaultValue(t._offsetAttribute,-1),e};const g=new p.VertexFormat,_={vertexFormat:g,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};let h;x.unpack=function(t,e,n){e=i.defaultValue(e,0);const a=p.VertexFormat.unpack(t,e,g);e+=p.VertexFormat.packedLength;const o=t[e++],r=t[e++],s=t[e++],u=t[e++],m=t[e];return i.defined(n)?(n._vertexFormat=p.VertexFormat.clone(a,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=u,n._offsetAttribute=-1===m?void 0:m,n):(_.length=o,_.topRadius=r,_.bottomRadius=s,_.slices=u,_.offsetAttribute=-1===m?void 0:m,new x(_))},x.createGeometry=function(t){let p=t._length;const x=t._topRadius,g=t._bottomRadius,_=t._vertexFormat,h=t._slices;if(p<=0||x<0||g<0||0===x&&0===g)return;const F=h+h,v=h+F,C=F+F,w=r.CylinderGeometryLibrary.computePositions(p,x,g,h,!0),G=_.st?new Float32Array(2*C):void 0,V=_.normal?new Float32Array(3*C):void 0,D=_.tangent?new Float32Array(3*C):void 0,R=_.bitangent?new Float32Array(3*C):void 0;let T;const O=_.normal||_.tangent||_.bitangent;if(O){const t=_.tangent||_.bitangent;let e=0,n=0,o=0;const r=Math.atan2(g-x,p),i=d;i.z=Math.sin(r);const s=Math.cos(r);let u=b,m=f;for(T=0;T<h;T++){const r=T/h*c.CesiumMath.TWO_PI,l=s*Math.cos(r),p=s*Math.sin(r);O&&(i.x=l,i.y=p,t&&(u=a.Cartesian3.normalize(a.Cartesian3.cross(a.Cartesian3.UNIT_Z,i,u),u)),_.normal&&(V[e++]=i.x,V[e++]=i.y,V[e++]=i.z,V[e++]=i.x,V[e++]=i.y,V[e++]=i.z),_.tangent&&(D[n++]=u.x,D[n++]=u.y,D[n++]=u.z,D[n++]=u.x,D[n++]=u.y,D[n++]=u.z),_.bitangent&&(m=a.Cartesian3.normalize(a.Cartesian3.cross(i,u,m),m),R[o++]=m.x,R[o++]=m.y,R[o++]=m.z,R[o++]=m.x,R[o++]=m.y,R[o++]=m.z))}for(T=0;T<h;T++)_.normal&&(V[e++]=0,V[e++]=0,V[e++]=-1),_.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),_.bitangent&&(R[o++]=0,R[o++]=-1,R[o++]=0);for(T=0;T<h;T++)_.normal&&(V[e++]=0,V[e++]=0,V[e++]=1),_.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),_.bitangent&&(R[o++]=0,R[o++]=1,R[o++]=0)}const L=12*h-12,M=l.IndexDatatype.createTypedArray(C,L);let P=0,k=0;for(T=0;T<h-1;T++)M[P++]=k,M[P++]=k+2,M[P++]=k+3,M[P++]=k,M[P++]=k+3,M[P++]=k+1,k+=2;for(M[P++]=F-2,M[P++]=0,M[P++]=1,M[P++]=F-2,M[P++]=1,M[P++]=F-1,T=1;T<h-1;T++)M[P++]=F+T+1,M[P++]=F+T,M[P++]=F;for(T=1;T<h-1;T++)M[P++]=v,M[P++]=v+T,M[P++]=v+T+1;let z=0;if(_.st){const t=Math.max(x,g);for(T=0;T<C;T++){const e=a.Cartesian3.fromArray(w,3*T,A);G[z++]=(e.x+t)/(2*t),G[z++]=(e.y+t)/(2*t)}}const E=new u.GeometryAttributes;_.position&&(E.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w})),_.normal&&(E.normal=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),_.tangent&&(E.tangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),_.bitangent&&(E.bitangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),_.st&&(E.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:G})),y.x=.5*p,y.y=Math.max(g,x);const N=new e.BoundingSphere(a.Cartesian3.ZERO,n.Cartesian2.magnitude(y));if(i.defined(t._offsetAttribute)){p=w.length;const e=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(p/3).fill(e);E.applyOffset=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new s.Geometry({attributes:E,indices:M,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:N,offsetAttribute:t._offsetAttribute})},x.getUnitCylinder=function(){return i.defined(h)||(h=x.createGeometry(new x({topRadius:1,bottomRadius:1,length:1,vertexFormat:p.VertexFormat.POSITION_ONLY}))),h},t.CylinderGeometry=x})); +define(["exports","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./CylinderGeometryLibrary-4d7f606d","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./VertexFormat-fbdec922"],(function(t,e,n,a,o,r,i,s,u,m,l,c,p){"use strict";const y=new n.Cartesian2,d=new a.Cartesian3,f=new a.Cartesian3,b=new a.Cartesian3,A=new a.Cartesian3;function x(t){const e=(t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT)).length,n=t.topRadius,a=t.bottomRadius,o=i.defaultValue(t.vertexFormat,p.VertexFormat.DEFAULT),r=i.defaultValue(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=a,this._vertexFormat=p.VertexFormat.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}x.packedLength=p.VertexFormat.packedLength+5,x.pack=function(t,e,n){return n=i.defaultValue(n,0),p.VertexFormat.pack(t._vertexFormat,e,n),n+=p.VertexFormat.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=i.defaultValue(t._offsetAttribute,-1),e};const g=new p.VertexFormat,_={vertexFormat:g,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};let h;x.unpack=function(t,e,n){e=i.defaultValue(e,0);const a=p.VertexFormat.unpack(t,e,g);e+=p.VertexFormat.packedLength;const o=t[e++],r=t[e++],s=t[e++],u=t[e++],m=t[e];return i.defined(n)?(n._vertexFormat=p.VertexFormat.clone(a,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=u,n._offsetAttribute=-1===m?void 0:m,n):(_.length=o,_.topRadius=r,_.bottomRadius=s,_.slices=u,_.offsetAttribute=-1===m?void 0:m,new x(_))},x.createGeometry=function(t){let p=t._length;const x=t._topRadius,g=t._bottomRadius,_=t._vertexFormat,h=t._slices;if(p<=0||x<0||g<0||0===x&&0===g)return;const F=h+h,v=h+F,C=F+F,w=r.CylinderGeometryLibrary.computePositions(p,x,g,h,!0),G=_.st?new Float32Array(2*C):void 0,V=_.normal?new Float32Array(3*C):void 0,D=_.tangent?new Float32Array(3*C):void 0,R=_.bitangent?new Float32Array(3*C):void 0;let T;const O=_.normal||_.tangent||_.bitangent;if(O){const t=_.tangent||_.bitangent;let e=0,n=0,o=0;const r=Math.atan2(g-x,p),i=d;i.z=Math.sin(r);const s=Math.cos(r);let u=b,m=f;for(T=0;T<h;T++){const r=T/h*c.CesiumMath.TWO_PI,l=s*Math.cos(r),p=s*Math.sin(r);O&&(i.x=l,i.y=p,t&&(u=a.Cartesian3.normalize(a.Cartesian3.cross(a.Cartesian3.UNIT_Z,i,u),u)),_.normal&&(V[e++]=i.x,V[e++]=i.y,V[e++]=i.z,V[e++]=i.x,V[e++]=i.y,V[e++]=i.z),_.tangent&&(D[n++]=u.x,D[n++]=u.y,D[n++]=u.z,D[n++]=u.x,D[n++]=u.y,D[n++]=u.z),_.bitangent&&(m=a.Cartesian3.normalize(a.Cartesian3.cross(i,u,m),m),R[o++]=m.x,R[o++]=m.y,R[o++]=m.z,R[o++]=m.x,R[o++]=m.y,R[o++]=m.z))}for(T=0;T<h;T++)_.normal&&(V[e++]=0,V[e++]=0,V[e++]=-1),_.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),_.bitangent&&(R[o++]=0,R[o++]=-1,R[o++]=0);for(T=0;T<h;T++)_.normal&&(V[e++]=0,V[e++]=0,V[e++]=1),_.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),_.bitangent&&(R[o++]=0,R[o++]=1,R[o++]=0)}const L=12*h-12,M=l.IndexDatatype.createTypedArray(C,L);let P=0,k=0;for(T=0;T<h-1;T++)M[P++]=k,M[P++]=k+2,M[P++]=k+3,M[P++]=k,M[P++]=k+3,M[P++]=k+1,k+=2;for(M[P++]=F-2,M[P++]=0,M[P++]=1,M[P++]=F-2,M[P++]=1,M[P++]=F-1,T=1;T<h-1;T++)M[P++]=F+T+1,M[P++]=F+T,M[P++]=F;for(T=1;T<h-1;T++)M[P++]=v,M[P++]=v+T,M[P++]=v+T+1;let z=0;if(_.st){const t=Math.max(x,g);for(T=0;T<C;T++){const e=a.Cartesian3.fromArray(w,3*T,A);G[z++]=(e.x+t)/(2*t),G[z++]=(e.y+t)/(2*t)}}const E=new u.GeometryAttributes;_.position&&(E.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w})),_.normal&&(E.normal=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),_.tangent&&(E.tangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),_.bitangent&&(E.bitangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),_.st&&(E.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:G})),y.x=.5*p,y.y=Math.max(g,x);const N=new e.BoundingSphere(a.Cartesian3.ZERO,n.Cartesian2.magnitude(y));if(i.defined(t._offsetAttribute)){p=w.length;const e=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(p/3).fill(e);E.applyOffset=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new s.Geometry({attributes:E,indices:M,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:N,offsetAttribute:t._offsetAttribute})},x.getUnitCylinder=function(){return i.defined(h)||(h=x.createGeometry(new x({topRadius:1,bottomRadius:1,length:1,vertexFormat:p.VertexFormat.POSITION_ONLY}))),h},t.CylinderGeometry=x})); diff --git a/public/lib/Cesium/Workers/CylinderGeometryLibrary-f49f33a8.js b/public/lib/Cesium/Workers/CylinderGeometryLibrary-4d7f606d.js similarity index 86% rename from public/lib/Cesium/Workers/CylinderGeometryLibrary-f49f33a8.js rename to public/lib/Cesium/Workers/CylinderGeometryLibrary-4d7f606d.js index f7984e70..af29f5ac 100644 --- a/public/lib/Cesium/Workers/CylinderGeometryLibrary-f49f33a8.js +++ b/public/lib/Cesium/Workers/CylinderGeometryLibrary-4d7f606d.js @@ -1 +1 @@ -define(["exports","./Math-2ce22ee9"],(function(t,n){"use strict";const o={computePositions:function(t,o,e,r,s){const i=.5*t,c=-i,a=r+r,u=new Float64Array(3*(s?2*a:a));let f,h=0,y=0;const M=s?3*a:0,l=s?3*(a+r):3*r;for(f=0;f<r;f++){const t=f/r*n.CesiumMath.TWO_PI,a=Math.cos(t),m=Math.sin(t),d=a*e,p=m*e,C=a*o,P=m*o;u[y+M]=d,u[y+M+1]=p,u[y+M+2]=c,u[y+l]=C,u[y+l+1]=P,u[y+l+2]=i,y+=3,s&&(u[h++]=d,u[h++]=p,u[h++]=c,u[h++]=C,u[h++]=P,u[h++]=i)}return u}};var e=o;t.CylinderGeometryLibrary=e})); +define(["exports","./Math-355606c6"],(function(t,n){"use strict";const o={computePositions:function(t,o,e,r,s){const i=.5*t,c=-i,a=r+r,u=new Float64Array(3*(s?2*a:a));let f,h=0,y=0;const M=s?3*a:0,l=s?3*(a+r):3*r;for(f=0;f<r;f++){const t=f/r*n.CesiumMath.TWO_PI,a=Math.cos(t),m=Math.sin(t),d=a*e,p=m*e,C=a*o,P=m*o;u[y+M]=d,u[y+M+1]=p,u[y+M+2]=c,u[y+l]=C,u[y+l+1]=P,u[y+l+2]=i,y+=3,s&&(u[h++]=d,u[h++]=p,u[h++]=c,u[h++]=C,u[h++]=P,u[h++]=i)}return u}};var e=o;t.CylinderGeometryLibrary=e})); diff --git a/public/lib/Cesium/Workers/EllipseGeometry-436ecd16.js b/public/lib/Cesium/Workers/EllipseGeometry-e2d7986e.js similarity index 97% rename from public/lib/Cesium/Workers/EllipseGeometry-436ecd16.js rename to public/lib/Cesium/Workers/EllipseGeometry-e2d7986e.js index 1f799300..8532b895 100644 --- a/public/lib/Cesium/Workers/EllipseGeometry-436ecd16.js +++ b/public/lib/Cesium/Workers/EllipseGeometry-e2d7986e.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./VertexFormat-fbdec922"],(function(t,e,i,r,n,o,a,s,l,u,m,c,p,y,d){"use strict";const f=new r.Cartesian3,A=new r.Cartesian3,x=new r.Cartesian3,h=new r.Cartesian3,g=new i.Cartesian2,_=new r.Matrix3,b=new r.Matrix3,C=new e.Quaternion,w=new r.Cartesian3,M=new r.Cartesian3,E=new r.Cartesian3,I=new r.Cartographic,T=new r.Cartesian3,G=new i.Cartesian2,N=new i.Cartesian2;function P(t,u,c){const p=u.vertexFormat,y=u.center,d=u.semiMajorAxis,h=u.semiMinorAxis,P=u.ellipsoid,v=u.stRotation,V=c?t.length/3*2:t.length/3,F=u.shadowVolume,D=p.st?new Float32Array(2*V):void 0,O=p.normal?new Float32Array(3*V):void 0,S=p.tangent?new Float32Array(3*V):void 0,L=p.bitangent?new Float32Array(3*V):void 0,R=F?new Float32Array(3*V):void 0;let j=0,z=w,k=M,B=E;const Y=new e.GeographicProjection(P),H=Y.project(P.cartesianToCartographic(y,I),T),U=P.scaleToGeodeticSurface(y,f);P.geodeticSurfaceNormal(U,U);let Q=_,W=b;if(0!==v){let t=e.Quaternion.fromAxisAngle(U,v,C);Q=r.Matrix3.fromQuaternion(t,Q),t=e.Quaternion.fromAxisAngle(U,-v,C),W=r.Matrix3.fromQuaternion(t,W)}else Q=r.Matrix3.clone(r.Matrix3.IDENTITY,Q),W=r.Matrix3.clone(r.Matrix3.IDENTITY,W);const J=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,G),q=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,N);let Z=t.length;const K=c?Z:0,X=K/3*2;for(let e=0;e<Z;e+=3){const i=e+1,n=e+2,o=r.Cartesian3.fromArray(t,e,f);if(p.st){const t=r.Matrix3.multiplyByVector(Q,o,A),e=Y.project(P.cartesianToCartographic(t,I),x);r.Cartesian3.subtract(e,H,e),g.x=(e.x+d)/(2*d),g.y=(e.y+h)/(2*h),J.x=Math.min(g.x,J.x),J.y=Math.min(g.y,J.y),q.x=Math.max(g.x,q.x),q.y=Math.max(g.y,q.y),c&&(D[j+X]=g.x,D[j+1+X]=g.y),D[j++]=g.x,D[j++]=g.y}(p.normal||p.tangent||p.bitangent||F)&&(z=P.geodeticSurfaceNormal(o,z),F&&(R[e+K]=-z.x,R[i+K]=-z.y,R[n+K]=-z.z),(p.normal||p.tangent||p.bitangent)&&((p.tangent||p.bitangent)&&(k=r.Cartesian3.normalize(r.Cartesian3.cross(r.Cartesian3.UNIT_Z,z,k),k),r.Matrix3.multiplyByVector(W,k,k)),p.normal&&(O[e]=z.x,O[i]=z.y,O[n]=z.z,c&&(O[e+K]=-z.x,O[i+K]=-z.y,O[n+K]=-z.z)),p.tangent&&(S[e]=k.x,S[i]=k.y,S[n]=k.z,c&&(S[e+K]=-k.x,S[i+K]=-k.y,S[n+K]=-k.z)),p.bitangent&&(B=r.Cartesian3.normalize(r.Cartesian3.cross(z,k,B),B),L[e]=B.x,L[i]=B.y,L[n]=B.z,c&&(L[e+K]=B.x,L[i+K]=B.y,L[n+K]=B.z))))}if(p.st){Z=D.length;for(let t=0;t<Z;t+=2)D[t]=(D[t]-J.x)/(q.x-J.x),D[t+1]=(D[t+1]-J.y)/(q.y-J.y)}const $=new l.GeometryAttributes;if(p.position){const e=a.EllipseGeometryLibrary.raisePositionsToHeight(t,u,c);$.position=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}if(p.st&&($.st=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),p.normal&&($.normal=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),p.tangent&&($.tangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),p.bitangent&&($.bitangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),F&&($.extrudeDirection=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),c&&o.defined(u.offsetAttribute)){let t=new Uint8Array(V);if(u.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,V/2);else{const e=u.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}$.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return $}function v(t){const e=new Array(t*(t+1)*12-6);let i,r,n,o,a,s=0;for(i=0,n=1,o=0;o<3;o++)e[s++]=n++,e[s++]=i,e[s++]=n;for(o=2;o<t+1;++o){for(n=o*(o+1)-1,i=(o-1)*o-1,e[s++]=n++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=n++,e[s++]=i,e[s++]=n}for(r=2*t,++n,++i,o=0;o<r-1;++o)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;for(e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i++,e[s++]=i,++i,o=t-1;o>1;--o){for(e[s++]=i++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=i++,e[s++]=i++,e[s++]=n++}for(o=0;o<3;o++)e[s++]=i++,e[s++]=i,e[s++]=n;return e}let V=new r.Cartesian3;const F=new e.BoundingSphere,D=new e.BoundingSphere;function O(t){const y=t.center,d=t.ellipsoid,b=t.semiMajorAxis;let V=r.Cartesian3.multiplyByScalar(d.geodeticSurfaceNormal(y,f),t.height,f);F.center=r.Cartesian3.add(y,V,F.center),F.radius=b,V=r.Cartesian3.multiplyByScalar(d.geodeticSurfaceNormal(y,V),t.extrudedHeight,V),D.center=r.Cartesian3.add(y,V,D.center),D.radius=b;const O=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),S=O.positions,L=O.numPts,R=O.outerPositions,j=e.BoundingSphere.union(F,D),z=P(S,t,!0);let k=v(L);const B=k.length;k.length=2*B;const Y=S.length/3;for(let t=0;t<B;t+=3)k[t+B]=k[t+2]+Y,k[t+1+B]=k[t+1]+Y,k[t+2+B]=k[t]+Y;const H=p.IndexDatatype.createTypedArray(2*Y/3,k),U=new s.Geometry({attributes:z,indices:H,primitiveType:s.PrimitiveType.TRIANGLES}),Q=function(t,a){const u=a.vertexFormat,c=a.center,p=a.semiMajorAxis,y=a.semiMinorAxis,d=a.ellipsoid,b=a.height,P=a.extrudedHeight,v=a.stRotation,V=t.length/3*2,F=new Float64Array(3*V),D=u.st?new Float32Array(2*V):void 0,O=u.normal?new Float32Array(3*V):void 0,S=u.tangent?new Float32Array(3*V):void 0,L=u.bitangent?new Float32Array(3*V):void 0,R=a.shadowVolume,j=R?new Float32Array(3*V):void 0;let z=0,k=w,B=M,Y=E;const H=new e.GeographicProjection(d),U=H.project(d.cartesianToCartographic(c,I),T),Q=d.scaleToGeodeticSurface(c,f);d.geodeticSurfaceNormal(Q,Q);const W=e.Quaternion.fromAxisAngle(Q,v,C),J=r.Matrix3.fromQuaternion(W,_),q=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,G),Z=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,N);let K=t.length;const X=K/3*2;for(let e=0;e<K;e+=3){const i=e+1,n=e+2;let o,a=r.Cartesian3.fromArray(t,e,f);if(u.st){const t=r.Matrix3.multiplyByVector(J,a,A),e=H.project(d.cartesianToCartographic(t,I),x);r.Cartesian3.subtract(e,U,e),g.x=(e.x+p)/(2*p),g.y=(e.y+y)/(2*y),q.x=Math.min(g.x,q.x),q.y=Math.min(g.y,q.y),Z.x=Math.max(g.x,Z.x),Z.y=Math.max(g.y,Z.y),D[z+X]=g.x,D[z+1+X]=g.y,D[z++]=g.x,D[z++]=g.y}a=d.scaleToGeodeticSurface(a,a),o=r.Cartesian3.clone(a,A),k=d.geodeticSurfaceNormal(a,k),R&&(j[e+K]=-k.x,j[i+K]=-k.y,j[n+K]=-k.z);let s=r.Cartesian3.multiplyByScalar(k,b,h);if(a=r.Cartesian3.add(a,s,a),s=r.Cartesian3.multiplyByScalar(k,P,s),o=r.Cartesian3.add(o,s,o),u.position&&(F[e+K]=o.x,F[i+K]=o.y,F[n+K]=o.z,F[e]=a.x,F[i]=a.y,F[n]=a.z),u.normal||u.tangent||u.bitangent){Y=r.Cartesian3.clone(k,Y);const s=r.Cartesian3.fromArray(t,(e+3)%K,h);r.Cartesian3.subtract(s,a,s);const l=r.Cartesian3.subtract(o,a,x);k=r.Cartesian3.normalize(r.Cartesian3.cross(l,s,k),k),u.normal&&(O[e]=k.x,O[i]=k.y,O[n]=k.z,O[e+K]=k.x,O[i+K]=k.y,O[n+K]=k.z),u.tangent&&(B=r.Cartesian3.normalize(r.Cartesian3.cross(Y,k,B),B),S[e]=B.x,S[i]=B.y,S[n]=B.z,S[e+K]=B.x,S[e+1+K]=B.y,S[e+2+K]=B.z),u.bitangent&&(L[e]=Y.x,L[i]=Y.y,L[n]=Y.z,L[e+K]=Y.x,L[i+K]=Y.y,L[n+K]=Y.z)}}if(u.st){K=D.length;for(let t=0;t<K;t+=2)D[t]=(D[t]-q.x)/(Z.x-q.x),D[t+1]=(D[t+1]-q.y)/(Z.y-q.y)}const $=new l.GeometryAttributes;if(u.position&&($.position=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),u.st&&($.st=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),u.normal&&($.normal=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),u.tangent&&($.tangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),u.bitangent&&($.bitangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),R&&($.extrudeDirection=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),o.defined(a.offsetAttribute)){let t=new Uint8Array(V);if(a.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,V/2);else{const e=a.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}$.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return $}(R,t);k=function(t){const e=t.length/3,i=p.IndexDatatype.createTypedArray(e,6*e);let r=0;for(let t=0;t<e;t++){const n=t,o=t+e,a=(n+1)%e,s=a+e;i[r++]=n,i[r++]=o,i[r++]=a,i[r++]=a,i[r++]=o,i[r++]=s}return i}(R);const W=p.IndexDatatype.createTypedArray(2*R.length/3,k),J=new s.Geometry({attributes:Q,indices:W,primitiveType:s.PrimitiveType.TRIANGLES}),q=c.GeometryPipeline.combineInstances([new u.GeometryInstance({geometry:U}),new u.GeometryInstance({geometry:J})]);return{boundingSphere:j,attributes:q[0].attributes,indices:q[0].indices}}function S(t,e,n,o,s,l,u){const m=a.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:n,rotation:o,granularity:s},!1,!0).outerPositions,c=m.length/3,p=new Array(c);for(let t=0;t<c;++t)p[t]=r.Cartesian3.fromArray(m,3*t);const d=i.Rectangle.fromCartesianArray(p,l,u);return d.width>y.CesiumMath.PI&&(d.north=d.north>0?y.CesiumMath.PI_OVER_TWO-y.CesiumMath.EPSILON7:d.north,d.south=d.south<0?y.CesiumMath.EPSILON7-y.CesiumMath.PI_OVER_TWO:d.south,d.east=y.CesiumMath.PI,d.west=-y.CesiumMath.PI),d}function L(t){const e=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).center,i=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),n=t.semiMajorAxis,a=t.semiMinorAxis,s=o.defaultValue(t.granularity,y.CesiumMath.RADIANS_PER_DEGREE),l=o.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),u=o.defaultValue(t.height,0),m=o.defaultValue(t.extrudedHeight,u);this._center=r.Cartesian3.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=a,this._ellipsoid=r.Ellipsoid.clone(i),this._rotation=o.defaultValue(t.rotation,0),this._stRotation=o.defaultValue(t.stRotation,0),this._height=Math.max(m,u),this._granularity=s,this._vertexFormat=d.VertexFormat.clone(l),this._extrudedHeight=Math.min(m,u),this._shadowVolume=o.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}L.packedLength=r.Cartesian3.packedLength+r.Ellipsoid.packedLength+d.VertexFormat.packedLength+9,L.pack=function(t,e,i){return i=o.defaultValue(i,0),r.Cartesian3.pack(t._center,e,i),i+=r.Cartesian3.packedLength,r.Ellipsoid.pack(t._ellipsoid,e,i),i+=r.Ellipsoid.packedLength,d.VertexFormat.pack(t._vertexFormat,e,i),i+=d.VertexFormat.packedLength,e[i++]=t._semiMajorAxis,e[i++]=t._semiMinorAxis,e[i++]=t._rotation,e[i++]=t._stRotation,e[i++]=t._height,e[i++]=t._granularity,e[i++]=t._extrudedHeight,e[i++]=t._shadowVolume?1:0,e[i]=o.defaultValue(t._offsetAttribute,-1),e};const R=new r.Cartesian3,j=new r.Ellipsoid,z=new d.VertexFormat,k={center:R,ellipsoid:j,vertexFormat:z,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};L.unpack=function(t,e,i){e=o.defaultValue(e,0);const n=r.Cartesian3.unpack(t,e,R);e+=r.Cartesian3.packedLength;const a=r.Ellipsoid.unpack(t,e,j);e+=r.Ellipsoid.packedLength;const s=d.VertexFormat.unpack(t,e,z);e+=d.VertexFormat.packedLength;const l=t[e++],u=t[e++],m=t[e++],c=t[e++],p=t[e++],y=t[e++],f=t[e++],A=1===t[e++],x=t[e];return o.defined(i)?(i._center=r.Cartesian3.clone(n,i._center),i._ellipsoid=r.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=d.VertexFormat.clone(s,i._vertexFormat),i._semiMajorAxis=l,i._semiMinorAxis=u,i._rotation=m,i._stRotation=c,i._height=p,i._granularity=y,i._extrudedHeight=f,i._shadowVolume=A,i._offsetAttribute=-1===x?void 0:x,i):(k.height=p,k.extrudedHeight=f,k.granularity=y,k.stRotation=c,k.rotation=m,k.semiMajorAxis=l,k.semiMinorAxis=u,k.shadowVolume=A,k.offsetAttribute=-1===x?void 0:x,new L(k))},L.computeRectangle=function(t,e){const i=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).center,n=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),a=t.semiMajorAxis,s=t.semiMinorAxis,l=o.defaultValue(t.granularity,y.CesiumMath.RADIANS_PER_DEGREE);return S(i,a,s,o.defaultValue(t.rotation,0),l,n,e)},L.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;const i=t._height,l=t._extrudedHeight,u=!y.CesiumMath.equalsEpsilon(i,l,0,y.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);const c={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:i,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};let d;if(u)c.extrudedHeight=l,c.shadowVolume=t._shadowVolume,c.offsetAttribute=t._offsetAttribute,d=O(c);else if(d=function(t){const i=t.center;V=r.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,V),t.height,V),V=r.Cartesian3.add(i,V,V);const n=new e.BoundingSphere(V,t.semiMajorAxis),o=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),s=o.positions,l=o.numPts,u=P(s,t,!1);let m=v(l);return m=p.IndexDatatype.createTypedArray(s.length/3,m),{boundingSphere:n,attributes:u,indices:m}}(c),o.defined(t._offsetAttribute)){const e=d.attributes.position.values.length,i=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(i);d.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new s.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:d.boundingSphere,offsetAttribute:t._offsetAttribute})},L.createShadowVolume=function(t,e,i){const r=t._granularity,n=t._ellipsoid,o=e(r,n),a=i(r,n);return new L({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(L.prototype,{rectangle:{get:function(){return o.defined(this._rectangle)||(this._rectangle=S(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return o.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const i=a.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,n=i.length/3,o=new Array(n);for(let t=0;t<n;++t)o[t]=r.Cartesian3.fromArray(i,3*t);const l=t._ellipsoid,u=t.rectangle;return s.Geometry._textureCoordinateRotationPoints(o,e,l,u)}(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=L})); +define(["exports","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./VertexFormat-fbdec922"],(function(t,e,i,r,n,o,a,s,l,u,m,c,p,y,d){"use strict";const f=new r.Cartesian3,A=new r.Cartesian3,x=new r.Cartesian3,h=new r.Cartesian3,g=new i.Cartesian2,_=new r.Matrix3,b=new r.Matrix3,C=new e.Quaternion,w=new r.Cartesian3,M=new r.Cartesian3,E=new r.Cartesian3,I=new r.Cartographic,T=new r.Cartesian3,G=new i.Cartesian2,N=new i.Cartesian2;function P(t,u,c){const p=u.vertexFormat,y=u.center,d=u.semiMajorAxis,h=u.semiMinorAxis,P=u.ellipsoid,v=u.stRotation,V=c?t.length/3*2:t.length/3,F=u.shadowVolume,D=p.st?new Float32Array(2*V):void 0,O=p.normal?new Float32Array(3*V):void 0,S=p.tangent?new Float32Array(3*V):void 0,L=p.bitangent?new Float32Array(3*V):void 0,R=F?new Float32Array(3*V):void 0;let j=0,z=w,k=M,B=E;const Y=new e.GeographicProjection(P),H=Y.project(P.cartesianToCartographic(y,I),T),U=P.scaleToGeodeticSurface(y,f);P.geodeticSurfaceNormal(U,U);let Q=_,W=b;if(0!==v){let t=e.Quaternion.fromAxisAngle(U,v,C);Q=r.Matrix3.fromQuaternion(t,Q),t=e.Quaternion.fromAxisAngle(U,-v,C),W=r.Matrix3.fromQuaternion(t,W)}else Q=r.Matrix3.clone(r.Matrix3.IDENTITY,Q),W=r.Matrix3.clone(r.Matrix3.IDENTITY,W);const J=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,G),q=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,N);let Z=t.length;const K=c?Z:0,X=K/3*2;for(let e=0;e<Z;e+=3){const i=e+1,n=e+2,o=r.Cartesian3.fromArray(t,e,f);if(p.st){const t=r.Matrix3.multiplyByVector(Q,o,A),e=Y.project(P.cartesianToCartographic(t,I),x);r.Cartesian3.subtract(e,H,e),g.x=(e.x+d)/(2*d),g.y=(e.y+h)/(2*h),J.x=Math.min(g.x,J.x),J.y=Math.min(g.y,J.y),q.x=Math.max(g.x,q.x),q.y=Math.max(g.y,q.y),c&&(D[j+X]=g.x,D[j+1+X]=g.y),D[j++]=g.x,D[j++]=g.y}(p.normal||p.tangent||p.bitangent||F)&&(z=P.geodeticSurfaceNormal(o,z),F&&(R[e+K]=-z.x,R[i+K]=-z.y,R[n+K]=-z.z),(p.normal||p.tangent||p.bitangent)&&((p.tangent||p.bitangent)&&(k=r.Cartesian3.normalize(r.Cartesian3.cross(r.Cartesian3.UNIT_Z,z,k),k),r.Matrix3.multiplyByVector(W,k,k)),p.normal&&(O[e]=z.x,O[i]=z.y,O[n]=z.z,c&&(O[e+K]=-z.x,O[i+K]=-z.y,O[n+K]=-z.z)),p.tangent&&(S[e]=k.x,S[i]=k.y,S[n]=k.z,c&&(S[e+K]=-k.x,S[i+K]=-k.y,S[n+K]=-k.z)),p.bitangent&&(B=r.Cartesian3.normalize(r.Cartesian3.cross(z,k,B),B),L[e]=B.x,L[i]=B.y,L[n]=B.z,c&&(L[e+K]=B.x,L[i+K]=B.y,L[n+K]=B.z))))}if(p.st){Z=D.length;for(let t=0;t<Z;t+=2)D[t]=(D[t]-J.x)/(q.x-J.x),D[t+1]=(D[t+1]-J.y)/(q.y-J.y)}const $=new l.GeometryAttributes;if(p.position){const e=a.EllipseGeometryLibrary.raisePositionsToHeight(t,u,c);$.position=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}if(p.st&&($.st=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),p.normal&&($.normal=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),p.tangent&&($.tangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),p.bitangent&&($.bitangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),F&&($.extrudeDirection=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),c&&o.defined(u.offsetAttribute)){let t=new Uint8Array(V);if(u.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,V/2);else{const e=u.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}$.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return $}function v(t){const e=new Array(t*(t+1)*12-6);let i,r,n,o,a,s=0;for(i=0,n=1,o=0;o<3;o++)e[s++]=n++,e[s++]=i,e[s++]=n;for(o=2;o<t+1;++o){for(n=o*(o+1)-1,i=(o-1)*o-1,e[s++]=n++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=n++,e[s++]=i,e[s++]=n}for(r=2*t,++n,++i,o=0;o<r-1;++o)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;for(e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i++,e[s++]=i,++i,o=t-1;o>1;--o){for(e[s++]=i++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=i++,e[s++]=i++,e[s++]=n++}for(o=0;o<3;o++)e[s++]=i++,e[s++]=i,e[s++]=n;return e}let V=new r.Cartesian3;const F=new e.BoundingSphere,D=new e.BoundingSphere;function O(t){const y=t.center,d=t.ellipsoid,b=t.semiMajorAxis;let V=r.Cartesian3.multiplyByScalar(d.geodeticSurfaceNormal(y,f),t.height,f);F.center=r.Cartesian3.add(y,V,F.center),F.radius=b,V=r.Cartesian3.multiplyByScalar(d.geodeticSurfaceNormal(y,V),t.extrudedHeight,V),D.center=r.Cartesian3.add(y,V,D.center),D.radius=b;const O=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),S=O.positions,L=O.numPts,R=O.outerPositions,j=e.BoundingSphere.union(F,D),z=P(S,t,!0);let k=v(L);const B=k.length;k.length=2*B;const Y=S.length/3;for(let t=0;t<B;t+=3)k[t+B]=k[t+2]+Y,k[t+1+B]=k[t+1]+Y,k[t+2+B]=k[t]+Y;const H=p.IndexDatatype.createTypedArray(2*Y/3,k),U=new s.Geometry({attributes:z,indices:H,primitiveType:s.PrimitiveType.TRIANGLES}),Q=function(t,a){const u=a.vertexFormat,c=a.center,p=a.semiMajorAxis,y=a.semiMinorAxis,d=a.ellipsoid,b=a.height,P=a.extrudedHeight,v=a.stRotation,V=t.length/3*2,F=new Float64Array(3*V),D=u.st?new Float32Array(2*V):void 0,O=u.normal?new Float32Array(3*V):void 0,S=u.tangent?new Float32Array(3*V):void 0,L=u.bitangent?new Float32Array(3*V):void 0,R=a.shadowVolume,j=R?new Float32Array(3*V):void 0;let z=0,k=w,B=M,Y=E;const H=new e.GeographicProjection(d),U=H.project(d.cartesianToCartographic(c,I),T),Q=d.scaleToGeodeticSurface(c,f);d.geodeticSurfaceNormal(Q,Q);const W=e.Quaternion.fromAxisAngle(Q,v,C),J=r.Matrix3.fromQuaternion(W,_),q=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,G),Z=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,N);let K=t.length;const X=K/3*2;for(let e=0;e<K;e+=3){const i=e+1,n=e+2;let o,a=r.Cartesian3.fromArray(t,e,f);if(u.st){const t=r.Matrix3.multiplyByVector(J,a,A),e=H.project(d.cartesianToCartographic(t,I),x);r.Cartesian3.subtract(e,U,e),g.x=(e.x+p)/(2*p),g.y=(e.y+y)/(2*y),q.x=Math.min(g.x,q.x),q.y=Math.min(g.y,q.y),Z.x=Math.max(g.x,Z.x),Z.y=Math.max(g.y,Z.y),D[z+X]=g.x,D[z+1+X]=g.y,D[z++]=g.x,D[z++]=g.y}a=d.scaleToGeodeticSurface(a,a),o=r.Cartesian3.clone(a,A),k=d.geodeticSurfaceNormal(a,k),R&&(j[e+K]=-k.x,j[i+K]=-k.y,j[n+K]=-k.z);let s=r.Cartesian3.multiplyByScalar(k,b,h);if(a=r.Cartesian3.add(a,s,a),s=r.Cartesian3.multiplyByScalar(k,P,s),o=r.Cartesian3.add(o,s,o),u.position&&(F[e+K]=o.x,F[i+K]=o.y,F[n+K]=o.z,F[e]=a.x,F[i]=a.y,F[n]=a.z),u.normal||u.tangent||u.bitangent){Y=r.Cartesian3.clone(k,Y);const s=r.Cartesian3.fromArray(t,(e+3)%K,h);r.Cartesian3.subtract(s,a,s);const l=r.Cartesian3.subtract(o,a,x);k=r.Cartesian3.normalize(r.Cartesian3.cross(l,s,k),k),u.normal&&(O[e]=k.x,O[i]=k.y,O[n]=k.z,O[e+K]=k.x,O[i+K]=k.y,O[n+K]=k.z),u.tangent&&(B=r.Cartesian3.normalize(r.Cartesian3.cross(Y,k,B),B),S[e]=B.x,S[i]=B.y,S[n]=B.z,S[e+K]=B.x,S[e+1+K]=B.y,S[e+2+K]=B.z),u.bitangent&&(L[e]=Y.x,L[i]=Y.y,L[n]=Y.z,L[e+K]=Y.x,L[i+K]=Y.y,L[n+K]=Y.z)}}if(u.st){K=D.length;for(let t=0;t<K;t+=2)D[t]=(D[t]-q.x)/(Z.x-q.x),D[t+1]=(D[t+1]-q.y)/(Z.y-q.y)}const $=new l.GeometryAttributes;if(u.position&&($.position=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),u.st&&($.st=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),u.normal&&($.normal=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),u.tangent&&($.tangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),u.bitangent&&($.bitangent=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),R&&($.extrudeDirection=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),o.defined(a.offsetAttribute)){let t=new Uint8Array(V);if(a.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,V/2);else{const e=a.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}$.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return $}(R,t);k=function(t){const e=t.length/3,i=p.IndexDatatype.createTypedArray(e,6*e);let r=0;for(let t=0;t<e;t++){const n=t,o=t+e,a=(n+1)%e,s=a+e;i[r++]=n,i[r++]=o,i[r++]=a,i[r++]=a,i[r++]=o,i[r++]=s}return i}(R);const W=p.IndexDatatype.createTypedArray(2*R.length/3,k),J=new s.Geometry({attributes:Q,indices:W,primitiveType:s.PrimitiveType.TRIANGLES}),q=c.GeometryPipeline.combineInstances([new u.GeometryInstance({geometry:U}),new u.GeometryInstance({geometry:J})]);return{boundingSphere:j,attributes:q[0].attributes,indices:q[0].indices}}function S(t,e,n,o,s,l,u){const m=a.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:n,rotation:o,granularity:s},!1,!0).outerPositions,c=m.length/3,p=new Array(c);for(let t=0;t<c;++t)p[t]=r.Cartesian3.fromArray(m,3*t);const d=i.Rectangle.fromCartesianArray(p,l,u);return d.width>y.CesiumMath.PI&&(d.north=d.north>0?y.CesiumMath.PI_OVER_TWO-y.CesiumMath.EPSILON7:d.north,d.south=d.south<0?y.CesiumMath.EPSILON7-y.CesiumMath.PI_OVER_TWO:d.south,d.east=y.CesiumMath.PI,d.west=-y.CesiumMath.PI),d}function L(t){const e=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).center,i=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),n=t.semiMajorAxis,a=t.semiMinorAxis,s=o.defaultValue(t.granularity,y.CesiumMath.RADIANS_PER_DEGREE),l=o.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),u=o.defaultValue(t.height,0),m=o.defaultValue(t.extrudedHeight,u);this._center=r.Cartesian3.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=a,this._ellipsoid=r.Ellipsoid.clone(i),this._rotation=o.defaultValue(t.rotation,0),this._stRotation=o.defaultValue(t.stRotation,0),this._height=Math.max(m,u),this._granularity=s,this._vertexFormat=d.VertexFormat.clone(l),this._extrudedHeight=Math.min(m,u),this._shadowVolume=o.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}L.packedLength=r.Cartesian3.packedLength+r.Ellipsoid.packedLength+d.VertexFormat.packedLength+9,L.pack=function(t,e,i){return i=o.defaultValue(i,0),r.Cartesian3.pack(t._center,e,i),i+=r.Cartesian3.packedLength,r.Ellipsoid.pack(t._ellipsoid,e,i),i+=r.Ellipsoid.packedLength,d.VertexFormat.pack(t._vertexFormat,e,i),i+=d.VertexFormat.packedLength,e[i++]=t._semiMajorAxis,e[i++]=t._semiMinorAxis,e[i++]=t._rotation,e[i++]=t._stRotation,e[i++]=t._height,e[i++]=t._granularity,e[i++]=t._extrudedHeight,e[i++]=t._shadowVolume?1:0,e[i]=o.defaultValue(t._offsetAttribute,-1),e};const R=new r.Cartesian3,j=new r.Ellipsoid,z=new d.VertexFormat,k={center:R,ellipsoid:j,vertexFormat:z,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};L.unpack=function(t,e,i){e=o.defaultValue(e,0);const n=r.Cartesian3.unpack(t,e,R);e+=r.Cartesian3.packedLength;const a=r.Ellipsoid.unpack(t,e,j);e+=r.Ellipsoid.packedLength;const s=d.VertexFormat.unpack(t,e,z);e+=d.VertexFormat.packedLength;const l=t[e++],u=t[e++],m=t[e++],c=t[e++],p=t[e++],y=t[e++],f=t[e++],A=1===t[e++],x=t[e];return o.defined(i)?(i._center=r.Cartesian3.clone(n,i._center),i._ellipsoid=r.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=d.VertexFormat.clone(s,i._vertexFormat),i._semiMajorAxis=l,i._semiMinorAxis=u,i._rotation=m,i._stRotation=c,i._height=p,i._granularity=y,i._extrudedHeight=f,i._shadowVolume=A,i._offsetAttribute=-1===x?void 0:x,i):(k.height=p,k.extrudedHeight=f,k.granularity=y,k.stRotation=c,k.rotation=m,k.semiMajorAxis=l,k.semiMinorAxis=u,k.shadowVolume=A,k.offsetAttribute=-1===x?void 0:x,new L(k))},L.computeRectangle=function(t,e){const i=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).center,n=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),a=t.semiMajorAxis,s=t.semiMinorAxis,l=o.defaultValue(t.granularity,y.CesiumMath.RADIANS_PER_DEGREE);return S(i,a,s,o.defaultValue(t.rotation,0),l,n,e)},L.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;const i=t._height,l=t._extrudedHeight,u=!y.CesiumMath.equalsEpsilon(i,l,0,y.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);const c={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:i,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};let d;if(u)c.extrudedHeight=l,c.shadowVolume=t._shadowVolume,c.offsetAttribute=t._offsetAttribute,d=O(c);else if(d=function(t){const i=t.center;V=r.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,V),t.height,V),V=r.Cartesian3.add(i,V,V);const n=new e.BoundingSphere(V,t.semiMajorAxis),o=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),s=o.positions,l=o.numPts,u=P(s,t,!1);let m=v(l);return m=p.IndexDatatype.createTypedArray(s.length/3,m),{boundingSphere:n,attributes:u,indices:m}}(c),o.defined(t._offsetAttribute)){const e=d.attributes.position.values.length,i=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(i);d.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new s.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:d.boundingSphere,offsetAttribute:t._offsetAttribute})},L.createShadowVolume=function(t,e,i){const r=t._granularity,n=t._ellipsoid,o=e(r,n),a=i(r,n);return new L({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(L.prototype,{rectangle:{get:function(){return o.defined(this._rectangle)||(this._rectangle=S(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return o.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const i=a.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,n=i.length/3,o=new Array(n);for(let t=0;t<n;++t)o[t]=r.Cartesian3.fromArray(i,3*t);const l=t._ellipsoid,u=t.rectangle;return s.Geometry._textureCoordinateRotationPoints(o,e,l,u)}(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=L})); diff --git a/public/lib/Cesium/Workers/EllipseGeometryLibrary-ce8bea87.js b/public/lib/Cesium/Workers/EllipseGeometryLibrary-d93d7f63.js similarity index 95% rename from public/lib/Cesium/Workers/EllipseGeometryLibrary-ce8bea87.js rename to public/lib/Cesium/Workers/EllipseGeometryLibrary-d93d7f63.js index 2bcb823e..8a03ebdb 100644 --- a/public/lib/Cesium/Workers/EllipseGeometryLibrary-ce8bea87.js +++ b/public/lib/Cesium/Workers/EllipseGeometryLibrary-d93d7f63.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./Math-2ce22ee9","./Transforms-b3716b06"],(function(t,a,e,n){"use strict";const i={},r=new a.Cartesian3,s=new a.Cartesian3,o=new n.Quaternion,l=new a.Matrix3;function c(t,e,i,c,C,y,u,m,h,x){const M=t+e;a.Cartesian3.multiplyByScalar(c,Math.cos(M),r),a.Cartesian3.multiplyByScalar(i,Math.sin(M),s),a.Cartesian3.add(r,s,r);let z=Math.cos(t);z*=z;let f=Math.sin(t);f*=f;const _=y/Math.sqrt(u*z+C*f)/m;return n.Quaternion.fromAxisAngle(r,_,o),a.Matrix3.fromQuaternion(o,l),a.Matrix3.multiplyByVector(l,h,x),a.Cartesian3.normalize(x,x),a.Cartesian3.multiplyByScalar(x,m,x),x}const C=new a.Cartesian3,y=new a.Cartesian3,u=new a.Cartesian3,m=new a.Cartesian3;i.raisePositionsToHeight=function(t,e,n){const i=e.ellipsoid,r=e.height,s=e.extrudedHeight,o=n?t.length/3*2:t.length/3,l=new Float64Array(3*o),c=t.length,h=n?c:0;for(let e=0;e<c;e+=3){const o=e+1,c=e+2,x=a.Cartesian3.fromArray(t,e,C);i.scaleToGeodeticSurface(x,x);const M=a.Cartesian3.clone(x,y),z=i.geodeticSurfaceNormal(x,m),f=a.Cartesian3.multiplyByScalar(z,r,u);a.Cartesian3.add(x,f,x),n&&(a.Cartesian3.multiplyByScalar(z,s,f),a.Cartesian3.add(M,f,M),l[e+h]=M.x,l[o+h]=M.y,l[c+h]=M.z),l[e]=x.x,l[o]=x.y,l[c]=x.z}return l};const h=new a.Cartesian3,x=new a.Cartesian3,M=new a.Cartesian3;i.computeEllipsePositions=function(t,n,i){const r=t.semiMinorAxis,s=t.semiMajorAxis,o=t.rotation,l=t.center,m=8*t.granularity,z=r*r,f=s*s,_=s*r,O=a.Cartesian3.magnitude(l),d=a.Cartesian3.normalize(l,h);let p=a.Cartesian3.cross(a.Cartesian3.UNIT_Z,l,x);p=a.Cartesian3.normalize(p,p);const w=a.Cartesian3.cross(d,p,M);let P=1+Math.ceil(e.CesiumMath.PI_OVER_TWO/m);const T=e.CesiumMath.PI_OVER_TWO/(P-1);let I=e.CesiumMath.PI_OVER_TWO-P*T;I<0&&(P-=Math.ceil(Math.abs(I)/T));const g=n?new Array(3*(P*(P+2)*2)):void 0;let E=0,V=C,A=y;const R=4*P*3;let W=R-1,S=0;const B=i?new Array(R):void 0;let v,Q,b,G,H;for(I=e.CesiumMath.PI_OVER_TWO,V=c(I,o,w,p,z,_,f,O,d,V),n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x),I=e.CesiumMath.PI_OVER_TWO-T,v=1;v<P+1;++v){if(V=c(I,o,w,p,z,_,f,O,d,V),A=c(Math.PI-I,o,w,p,z,_,f,O,d,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,b=2*v+2,Q=1;Q<b-1;++Q)G=Q/(b-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z),I=e.CesiumMath.PI_OVER_TWO-(v+1)*T}for(v=P;v>1;--v){if(I=e.CesiumMath.PI_OVER_TWO-(v-1)*T,V=c(-I,o,w,p,z,_,f,O,d,V),A=c(I+Math.PI,o,w,p,z,_,f,O,d,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,b=2*(v-1)+2,Q=1;Q<b-1;++Q)G=Q/(b-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z)}I=e.CesiumMath.PI_OVER_TWO,V=c(-I,o,w,p,z,_,f,O,d,V);const N={};return n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,N.positions=g,N.numPts=P),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,N.outerPositions=B),N};var z=i;t.EllipseGeometryLibrary=z})); +define(["exports","./Matrix3-b2351961","./Math-355606c6","./Transforms-f17097e5"],(function(t,a,e,n){"use strict";const i={},r=new a.Cartesian3,s=new a.Cartesian3,o=new n.Quaternion,l=new a.Matrix3;function c(t,e,i,c,C,y,u,m,h,x){const M=t+e;a.Cartesian3.multiplyByScalar(c,Math.cos(M),r),a.Cartesian3.multiplyByScalar(i,Math.sin(M),s),a.Cartesian3.add(r,s,r);let z=Math.cos(t);z*=z;let f=Math.sin(t);f*=f;const _=y/Math.sqrt(u*z+C*f)/m;return n.Quaternion.fromAxisAngle(r,_,o),a.Matrix3.fromQuaternion(o,l),a.Matrix3.multiplyByVector(l,h,x),a.Cartesian3.normalize(x,x),a.Cartesian3.multiplyByScalar(x,m,x),x}const C=new a.Cartesian3,y=new a.Cartesian3,u=new a.Cartesian3,m=new a.Cartesian3;i.raisePositionsToHeight=function(t,e,n){const i=e.ellipsoid,r=e.height,s=e.extrudedHeight,o=n?t.length/3*2:t.length/3,l=new Float64Array(3*o),c=t.length,h=n?c:0;for(let e=0;e<c;e+=3){const o=e+1,c=e+2,x=a.Cartesian3.fromArray(t,e,C);i.scaleToGeodeticSurface(x,x);const M=a.Cartesian3.clone(x,y),z=i.geodeticSurfaceNormal(x,m),f=a.Cartesian3.multiplyByScalar(z,r,u);a.Cartesian3.add(x,f,x),n&&(a.Cartesian3.multiplyByScalar(z,s,f),a.Cartesian3.add(M,f,M),l[e+h]=M.x,l[o+h]=M.y,l[c+h]=M.z),l[e]=x.x,l[o]=x.y,l[c]=x.z}return l};const h=new a.Cartesian3,x=new a.Cartesian3,M=new a.Cartesian3;i.computeEllipsePositions=function(t,n,i){const r=t.semiMinorAxis,s=t.semiMajorAxis,o=t.rotation,l=t.center,m=8*t.granularity,z=r*r,f=s*s,_=s*r,O=a.Cartesian3.magnitude(l),d=a.Cartesian3.normalize(l,h);let p=a.Cartesian3.cross(a.Cartesian3.UNIT_Z,l,x);p=a.Cartesian3.normalize(p,p);const w=a.Cartesian3.cross(d,p,M);let P=1+Math.ceil(e.CesiumMath.PI_OVER_TWO/m);const T=e.CesiumMath.PI_OVER_TWO/(P-1);let I=e.CesiumMath.PI_OVER_TWO-P*T;I<0&&(P-=Math.ceil(Math.abs(I)/T));const g=n?new Array(3*(P*(P+2)*2)):void 0;let E=0,V=C,A=y;const R=4*P*3;let W=R-1,S=0;const B=i?new Array(R):void 0;let v,Q,b,G,H;for(I=e.CesiumMath.PI_OVER_TWO,V=c(I,o,w,p,z,_,f,O,d,V),n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x),I=e.CesiumMath.PI_OVER_TWO-T,v=1;v<P+1;++v){if(V=c(I,o,w,p,z,_,f,O,d,V),A=c(Math.PI-I,o,w,p,z,_,f,O,d,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,b=2*v+2,Q=1;Q<b-1;++Q)G=Q/(b-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z),I=e.CesiumMath.PI_OVER_TWO-(v+1)*T}for(v=P;v>1;--v){if(I=e.CesiumMath.PI_OVER_TWO-(v-1)*T,V=c(-I,o,w,p,z,_,f,O,d,V),A=c(I+Math.PI,o,w,p,z,_,f,O,d,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,b=2*(v-1)+2,Q=1;Q<b-1;++Q)G=Q/(b-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z)}I=e.CesiumMath.PI_OVER_TWO,V=c(-I,o,w,p,z,_,f,O,d,V);const N={};return n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,N.positions=g,N.numPts=P),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,N.outerPositions=B),N};var z=i;t.EllipseGeometryLibrary=z})); diff --git a/public/lib/Cesium/Workers/EllipseOutlineGeometry-14470848.js b/public/lib/Cesium/Workers/EllipseOutlineGeometry-3d88fb74.js similarity index 96% rename from public/lib/Cesium/Workers/EllipseOutlineGeometry-14470848.js rename to public/lib/Cesium/Workers/EllipseOutlineGeometry-3d88fb74.js index bd1d1df4..40f83d04 100644 --- a/public/lib/Cesium/Workers/EllipseOutlineGeometry-14470848.js +++ b/public/lib/Cesium/Workers/EllipseOutlineGeometry-3d88fb74.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9"],(function(e,t,i,r,n,o,a,s,l,u,d){"use strict";const c=new i.Cartesian3;let p=new i.Cartesian3;const f=new t.BoundingSphere,m=new t.BoundingSphere;function h(e){const t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).center,r=n.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84),o=e.semiMajorAxis,a=e.semiMinorAxis,s=n.defaultValue(e.granularity,d.CesiumMath.RADIANS_PER_DEGREE),l=n.defaultValue(e.height,0),u=n.defaultValue(e.extrudedHeight,l);this._center=i.Cartesian3.clone(t),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=i.Ellipsoid.clone(r),this._rotation=n.defaultValue(e.rotation,0),this._height=Math.max(u,l),this._granularity=s,this._extrudedHeight=Math.min(u,l),this._numberOfVerticalLines=Math.max(n.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}h.packedLength=i.Cartesian3.packedLength+i.Ellipsoid.packedLength+8,h.pack=function(e,t,r){return r=n.defaultValue(r,0),i.Cartesian3.pack(e._center,t,r),r+=i.Cartesian3.packedLength,i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._numberOfVerticalLines,t[r]=n.defaultValue(e._offsetAttribute,-1),t};const y=new i.Cartesian3,A=new i.Ellipsoid,_={center:y,ellipsoid:A,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};h.unpack=function(e,t,r){t=n.defaultValue(t,0);const o=i.Cartesian3.unpack(e,t,y);t+=i.Cartesian3.packedLength;const a=i.Ellipsoid.unpack(e,t,A);t+=i.Ellipsoid.packedLength;const s=e[t++],l=e[t++],u=e[t++],d=e[t++],c=e[t++],p=e[t++],f=e[t++],m=e[t];return n.defined(r)?(r._center=i.Cartesian3.clone(o,r._center),r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._semiMajorAxis=s,r._semiMinorAxis=l,r._rotation=u,r._height=d,r._granularity=c,r._extrudedHeight=p,r._numberOfVerticalLines=f,r._offsetAttribute=-1===m?void 0:m,r):(_.height=d,_.extrudedHeight=p,_.granularity=c,_.rotation=u,_.semiMajorAxis=s,_.semiMinorAxis=l,_.numberOfVerticalLines=f,_.offsetAttribute=-1===m?void 0:m,new h(_))},h.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;const h=e._height,y=e._extrudedHeight,A=!d.CesiumMath.equalsEpsilon(h,y,0,d.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);const _={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:h,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};let b;if(A)_.extrudedHeight=y,_.offsetAttribute=e._offsetAttribute,b=function(e){const p=e.center,h=e.ellipsoid,y=e.semiMajorAxis;let A=i.Cartesian3.multiplyByScalar(h.geodeticSurfaceNormal(p,c),e.height,c);f.center=i.Cartesian3.add(p,A,f.center),f.radius=y,A=i.Cartesian3.multiplyByScalar(h.geodeticSurfaceNormal(p,A),e.extrudedHeight,A),m.center=i.Cartesian3.add(p,A,m.center),m.radius=y;let _=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions;const b=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(_,e,!0)})});_=b.position.values;const g=t.BoundingSphere.union(f,m);let x=_.length/3;if(n.defined(e.offsetAttribute)){let t=new Uint8Array(x);if(e.offsetAttribute===l.GeometryOffsetAttribute.TOP)t=t.fill(1,0,x/2);else{const i=e.offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}b.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let E=n.defaultValue(e.numberOfVerticalLines,16);E=d.CesiumMath.clamp(E,0,x/2);const M=u.IndexDatatype.createTypedArray(x,2*x+2*E);x/=2;let C,G,L=0;for(C=0;C<x;++C)M[L++]=C,M[L++]=(C+1)%x,M[L++]=C+x,M[L++]=(C+1)%x+x;if(E>0){const e=Math.min(E,x);G=Math.round(x/e);const t=Math.min(G*E,x);for(C=0;C<t;C+=G)M[L++]=C,M[L++]=C+x}return{boundingSphere:g,attributes:b,indices:M}}(_);else if(b=function(e){const n=e.center;p=i.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(n,p),e.height,p),p=i.Cartesian3.add(n,p,p);const l=new t.BoundingSphere(p,e.semiMajorAxis),d=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,c=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(d,e,!1)})}),f=d.length/3,m=u.IndexDatatype.createTypedArray(f,2*f);let h=0;for(let e=0;e<f;++e)m[h++]=e,m[h++]=(e+1)%f;return{boundingSphere:l,attributes:c,indices:m}}(_),n.defined(e._offsetAttribute)){const t=b.attributes.position.values.length,i=e._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(i);b.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new a.Geometry({attributes:b.attributes,indices:b.indices,primitiveType:a.PrimitiveType.LINES,boundingSphere:b.boundingSphere,offsetAttribute:e._offsetAttribute})},e.EllipseOutlineGeometry=h})); +define(["exports","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6"],(function(e,t,i,r,n,o,a,s,l,u,d){"use strict";const c=new i.Cartesian3;let p=new i.Cartesian3;const f=new t.BoundingSphere,m=new t.BoundingSphere;function h(e){const t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).center,r=n.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84),o=e.semiMajorAxis,a=e.semiMinorAxis,s=n.defaultValue(e.granularity,d.CesiumMath.RADIANS_PER_DEGREE),l=n.defaultValue(e.height,0),u=n.defaultValue(e.extrudedHeight,l);this._center=i.Cartesian3.clone(t),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=i.Ellipsoid.clone(r),this._rotation=n.defaultValue(e.rotation,0),this._height=Math.max(u,l),this._granularity=s,this._extrudedHeight=Math.min(u,l),this._numberOfVerticalLines=Math.max(n.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}h.packedLength=i.Cartesian3.packedLength+i.Ellipsoid.packedLength+8,h.pack=function(e,t,r){return r=n.defaultValue(r,0),i.Cartesian3.pack(e._center,t,r),r+=i.Cartesian3.packedLength,i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._numberOfVerticalLines,t[r]=n.defaultValue(e._offsetAttribute,-1),t};const y=new i.Cartesian3,A=new i.Ellipsoid,_={center:y,ellipsoid:A,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};h.unpack=function(e,t,r){t=n.defaultValue(t,0);const o=i.Cartesian3.unpack(e,t,y);t+=i.Cartesian3.packedLength;const a=i.Ellipsoid.unpack(e,t,A);t+=i.Ellipsoid.packedLength;const s=e[t++],l=e[t++],u=e[t++],d=e[t++],c=e[t++],p=e[t++],f=e[t++],m=e[t];return n.defined(r)?(r._center=i.Cartesian3.clone(o,r._center),r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._semiMajorAxis=s,r._semiMinorAxis=l,r._rotation=u,r._height=d,r._granularity=c,r._extrudedHeight=p,r._numberOfVerticalLines=f,r._offsetAttribute=-1===m?void 0:m,r):(_.height=d,_.extrudedHeight=p,_.granularity=c,_.rotation=u,_.semiMajorAxis=s,_.semiMinorAxis=l,_.numberOfVerticalLines=f,_.offsetAttribute=-1===m?void 0:m,new h(_))},h.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;const h=e._height,y=e._extrudedHeight,A=!d.CesiumMath.equalsEpsilon(h,y,0,d.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);const _={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:h,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};let b;if(A)_.extrudedHeight=y,_.offsetAttribute=e._offsetAttribute,b=function(e){const p=e.center,h=e.ellipsoid,y=e.semiMajorAxis;let A=i.Cartesian3.multiplyByScalar(h.geodeticSurfaceNormal(p,c),e.height,c);f.center=i.Cartesian3.add(p,A,f.center),f.radius=y,A=i.Cartesian3.multiplyByScalar(h.geodeticSurfaceNormal(p,A),e.extrudedHeight,A),m.center=i.Cartesian3.add(p,A,m.center),m.radius=y;let _=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions;const b=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(_,e,!0)})});_=b.position.values;const g=t.BoundingSphere.union(f,m);let x=_.length/3;if(n.defined(e.offsetAttribute)){let t=new Uint8Array(x);if(e.offsetAttribute===l.GeometryOffsetAttribute.TOP)t=t.fill(1,0,x/2);else{const i=e.offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}b.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let E=n.defaultValue(e.numberOfVerticalLines,16);E=d.CesiumMath.clamp(E,0,x/2);const M=u.IndexDatatype.createTypedArray(x,2*x+2*E);x/=2;let C,G,L=0;for(C=0;C<x;++C)M[L++]=C,M[L++]=(C+1)%x,M[L++]=C+x,M[L++]=(C+1)%x+x;if(E>0){const e=Math.min(E,x);G=Math.round(x/e);const t=Math.min(G*E,x);for(C=0;C<t;C+=G)M[L++]=C,M[L++]=C+x}return{boundingSphere:g,attributes:b,indices:M}}(_);else if(b=function(e){const n=e.center;p=i.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(n,p),e.height,p),p=i.Cartesian3.add(n,p,p);const l=new t.BoundingSphere(p,e.semiMajorAxis),d=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,c=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(d,e,!1)})}),f=d.length/3,m=u.IndexDatatype.createTypedArray(f,2*f);let h=0;for(let e=0;e<f;++e)m[h++]=e,m[h++]=(e+1)%f;return{boundingSphere:l,attributes:c,indices:m}}(_),n.defined(e._offsetAttribute)){const t=b.attributes.position.values.length,i=e._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(i);b.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new a.Geometry({attributes:b.attributes,indices:b.indices,primitiveType:a.PrimitiveType.LINES,boundingSphere:b.boundingSphere,offsetAttribute:e._offsetAttribute})},e.EllipseOutlineGeometry=h})); diff --git a/public/lib/Cesium/Workers/EllipsoidGeodesic-2723ab86.js b/public/lib/Cesium/Workers/EllipsoidGeodesic-20aaff03.js similarity index 96% rename from public/lib/Cesium/Workers/EllipsoidGeodesic-2723ab86.js rename to public/lib/Cesium/Workers/EllipsoidGeodesic-20aaff03.js index 82e855ae..b3755fdb 100644 --- a/public/lib/Cesium/Workers/EllipsoidGeodesic-2723ab86.js +++ b/public/lib/Cesium/Workers/EllipsoidGeodesic-20aaff03.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(t,a,i,n){"use strict";function e(t,a,i,n,e,s,o){const r=function(t,a){return t*a*(4+t*(4-3*a))/16}(t,i);return(1-r)*t*a*(n+r*e*(o+r*s*(2*o*o-1)))}const s=new a.Cartesian3,o=new a.Cartesian3;function r(t,i,r,h){a.Cartesian3.normalize(h.cartographicToCartesian(i,o),s),a.Cartesian3.normalize(h.cartographicToCartesian(r,o),o),function(t,a,i,s,o,r,h){const c=(a-i)/a,d=r-s,u=Math.atan((1-c)*Math.tan(o)),l=Math.atan((1-c)*Math.tan(h)),M=Math.cos(u),g=Math.sin(u),_=Math.cos(l),p=Math.sin(l),f=M*_,m=M*p,H=g*p,C=g*_;let v,O,S,q,U,A=d,w=n.CesiumMath.TWO_PI,R=Math.cos(A),b=Math.sin(A);do{R=Math.cos(A),b=Math.sin(A);const t=m-C*R;let a;S=Math.sqrt(_*_*b*b+t*t),O=H+f*R,v=Math.atan2(S,O),0===S?(a=0,q=1):(a=f*b/S,q=1-a*a),w=A,U=O-2*H/q,isFinite(U)||(U=0),A=d+e(c,a,q,v,S,O,U)}while(Math.abs(A-w)>n.CesiumMath.EPSILON12);const x=q*(a*a-i*i)/(i*i),y=x*(256+x*(x*(74-47*x)-128))/1024,E=U*U,P=i*(1+x*(4096+x*(x*(320-175*x)-768))/16384)*(v-y*S*(U+y*(O*(2*E-1)-y*U*(4*S*S-3)*(4*E-3)/6)/4)),D=Math.atan2(_*b,m-C*R),T=Math.atan2(M*b,m*R-C);t._distance=P,t._startHeading=D,t._endHeading=T,t._uSquared=x}(t,h.maximumRadius,h.minimumRadius,i.longitude,i.latitude,r.longitude,r.latitude),t._start=a.Cartographic.clone(i,t._start),t._end=a.Cartographic.clone(r,t._end),t._start.height=0,t._end.height=0,function(t){const a=t._uSquared,i=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,e=(i-n)/i,s=Math.cos(t._startHeading),o=Math.sin(t._startHeading),r=(1-e)*Math.tan(t._start.latitude),h=1/Math.sqrt(1+r*r),c=h*r,d=Math.atan2(r,s),u=h*o,l=u*u,M=1-l,g=Math.sqrt(M),_=a/4,p=_*_,f=p*_,m=p*p,H=1+_-3*p/4+5*f/4-175*m/64,C=1-_+15*p/8-35*f/8,v=1-3*_+35*p/4,O=1-5*_,S=H*d-C*Math.sin(2*d)*_/2-v*Math.sin(4*d)*p/16-O*Math.sin(6*d)*f/48-5*Math.sin(8*d)*m/512,q=t._constants;q.a=i,q.b=n,q.f=e,q.cosineHeading=s,q.sineHeading=o,q.tanU=r,q.cosineU=h,q.sineU=c,q.sigma=d,q.sineAlpha=u,q.sineSquaredAlpha=l,q.cosineSquaredAlpha=M,q.cosineAlpha=g,q.u2Over4=_,q.u4Over16=p,q.u6Over64=f,q.u8Over256=m,q.a0=H,q.a1=C,q.a2=v,q.a3=O,q.distanceRatio=S}(t)}function h(t,n,e){const s=i.defaultValue(e,a.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new a.Cartographic,this._end=new a.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i.defined(t)&&i.defined(n)&&r(this,t,n,s)}Object.defineProperties(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),h.prototype.setEndPoints=function(t,a){r(this,t,a,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},h.prototype.interpolateUsingSurfaceDistance=function(t,n){const s=this._constants,o=s.distanceRatio+t/s.b,r=Math.cos(2*o),h=Math.cos(4*o),c=Math.cos(6*o),d=Math.sin(2*o),u=Math.sin(4*o),l=Math.sin(6*o),M=Math.sin(8*o),g=o*o,_=o*g,p=s.u8Over256,f=s.u2Over4,m=s.u6Over64,H=s.u4Over16;let C=2*_*p*r/3+o*(1-f+7*H/4-15*m/4+579*p/64-(H-15*m/4+187*p/16)*r-(5*m/4-115*p/16)*h-29*p*c/16)+(f/2-H+71*m/32-85*p/16)*d+(5*H/16-5*m/4+383*p/96)*u-g*((m-11*p/2)*d+5*p*u/2)+(29*m/96-29*p/16)*l+539*p*M/1536;const v=Math.asin(Math.sin(C)*s.cosineAlpha),O=Math.atan(s.a/s.b*Math.tan(v));C-=s.sigma;const S=Math.cos(2*s.sigma+C),q=Math.sin(C),U=Math.cos(C),A=s.cosineU*U,w=s.sineU*q,R=Math.atan2(q*s.sineHeading,A-w*s.cosineHeading)-e(s.f,s.sineAlpha,s.cosineSquaredAlpha,C,q,U,S);return i.defined(n)?(n.longitude=this._start.longitude+R,n.latitude=O,n.height=0,n):new a.Cartographic(this._start.longitude+R,O,0)},t.EllipsoidGeodesic=h})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6"],(function(t,a,i,n){"use strict";function e(t,a,i,n,e,s,o){const r=function(t,a){return t*a*(4+t*(4-3*a))/16}(t,i);return(1-r)*t*a*(n+r*e*(o+r*s*(2*o*o-1)))}const s=new a.Cartesian3,o=new a.Cartesian3;function r(t,i,r,h){a.Cartesian3.normalize(h.cartographicToCartesian(i,o),s),a.Cartesian3.normalize(h.cartographicToCartesian(r,o),o),function(t,a,i,s,o,r,h){const c=(a-i)/a,d=r-s,u=Math.atan((1-c)*Math.tan(o)),l=Math.atan((1-c)*Math.tan(h)),M=Math.cos(u),g=Math.sin(u),_=Math.cos(l),p=Math.sin(l),f=M*_,m=M*p,H=g*p,C=g*_;let v,O,S,q,U,A=d,w=n.CesiumMath.TWO_PI,R=Math.cos(A),b=Math.sin(A);do{R=Math.cos(A),b=Math.sin(A);const t=m-C*R;let a;S=Math.sqrt(_*_*b*b+t*t),O=H+f*R,v=Math.atan2(S,O),0===S?(a=0,q=1):(a=f*b/S,q=1-a*a),w=A,U=O-2*H/q,isFinite(U)||(U=0),A=d+e(c,a,q,v,S,O,U)}while(Math.abs(A-w)>n.CesiumMath.EPSILON12);const x=q*(a*a-i*i)/(i*i),y=x*(256+x*(x*(74-47*x)-128))/1024,E=U*U,P=i*(1+x*(4096+x*(x*(320-175*x)-768))/16384)*(v-y*S*(U+y*(O*(2*E-1)-y*U*(4*S*S-3)*(4*E-3)/6)/4)),D=Math.atan2(_*b,m-C*R),T=Math.atan2(M*b,m*R-C);t._distance=P,t._startHeading=D,t._endHeading=T,t._uSquared=x}(t,h.maximumRadius,h.minimumRadius,i.longitude,i.latitude,r.longitude,r.latitude),t._start=a.Cartographic.clone(i,t._start),t._end=a.Cartographic.clone(r,t._end),t._start.height=0,t._end.height=0,function(t){const a=t._uSquared,i=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,e=(i-n)/i,s=Math.cos(t._startHeading),o=Math.sin(t._startHeading),r=(1-e)*Math.tan(t._start.latitude),h=1/Math.sqrt(1+r*r),c=h*r,d=Math.atan2(r,s),u=h*o,l=u*u,M=1-l,g=Math.sqrt(M),_=a/4,p=_*_,f=p*_,m=p*p,H=1+_-3*p/4+5*f/4-175*m/64,C=1-_+15*p/8-35*f/8,v=1-3*_+35*p/4,O=1-5*_,S=H*d-C*Math.sin(2*d)*_/2-v*Math.sin(4*d)*p/16-O*Math.sin(6*d)*f/48-5*Math.sin(8*d)*m/512,q=t._constants;q.a=i,q.b=n,q.f=e,q.cosineHeading=s,q.sineHeading=o,q.tanU=r,q.cosineU=h,q.sineU=c,q.sigma=d,q.sineAlpha=u,q.sineSquaredAlpha=l,q.cosineSquaredAlpha=M,q.cosineAlpha=g,q.u2Over4=_,q.u4Over16=p,q.u6Over64=f,q.u8Over256=m,q.a0=H,q.a1=C,q.a2=v,q.a3=O,q.distanceRatio=S}(t)}function h(t,n,e){const s=i.defaultValue(e,a.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new a.Cartographic,this._end=new a.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i.defined(t)&&i.defined(n)&&r(this,t,n,s)}Object.defineProperties(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),h.prototype.setEndPoints=function(t,a){r(this,t,a,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},h.prototype.interpolateUsingSurfaceDistance=function(t,n){const s=this._constants,o=s.distanceRatio+t/s.b,r=Math.cos(2*o),h=Math.cos(4*o),c=Math.cos(6*o),d=Math.sin(2*o),u=Math.sin(4*o),l=Math.sin(6*o),M=Math.sin(8*o),g=o*o,_=o*g,p=s.u8Over256,f=s.u2Over4,m=s.u6Over64,H=s.u4Over16;let C=2*_*p*r/3+o*(1-f+7*H/4-15*m/4+579*p/64-(H-15*m/4+187*p/16)*r-(5*m/4-115*p/16)*h-29*p*c/16)+(f/2-H+71*m/32-85*p/16)*d+(5*H/16-5*m/4+383*p/96)*u-g*((m-11*p/2)*d+5*p*u/2)+(29*m/96-29*p/16)*l+539*p*M/1536;const v=Math.asin(Math.sin(C)*s.cosineAlpha),O=Math.atan(s.a/s.b*Math.tan(v));C-=s.sigma;const S=Math.cos(2*s.sigma+C),q=Math.sin(C),U=Math.cos(C),A=s.cosineU*U,w=s.sineU*q,R=Math.atan2(q*s.sineHeading,A-w*s.cosineHeading)-e(s.f,s.sineAlpha,s.cosineSquaredAlpha,C,q,U,S);return i.defined(n)?(n.longitude=this._start.longitude+R,n.latitude=O,n.height=0,n):new a.Cartographic(this._start.longitude+R,O,0)},t.EllipsoidGeodesic=h})); diff --git a/public/lib/Cesium/Workers/EllipsoidGeometry-e261a196.js b/public/lib/Cesium/Workers/EllipsoidGeometry-ad4c3540.js similarity index 96% rename from public/lib/Cesium/Workers/EllipsoidGeometry-e261a196.js rename to public/lib/Cesium/Workers/EllipsoidGeometry-ad4c3540.js index 0c74d633..6fae1ac8 100644 --- a/public/lib/Cesium/Workers/EllipsoidGeometry-e261a196.js +++ b/public/lib/Cesium/Workers/EllipsoidGeometry-ad4c3540.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./VertexFormat-fbdec922"],(function(t,e,a,n,i,r,o,s,m,u,l,c){"use strict";const f=new n.Cartesian3,d=new n.Cartesian3,C=new n.Cartesian3,p=new n.Cartesian3,y=new n.Cartesian3,_=new n.Cartesian3(1,1,1),h=Math.cos,x=Math.sin;function A(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT);const e=r.defaultValue(t.radii,_),a=r.defaultValue(t.innerRadii,e),i=r.defaultValue(t.minimumClock,0),o=r.defaultValue(t.maximumClock,l.CesiumMath.TWO_PI),s=r.defaultValue(t.minimumCone,0),m=r.defaultValue(t.maximumCone,l.CesiumMath.PI),u=Math.round(r.defaultValue(t.stackPartitions,64)),f=Math.round(r.defaultValue(t.slicePartitions,64)),d=r.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._radii=n.Cartesian3.clone(e),this._innerRadii=n.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=o,this._minimumCone=s,this._maximumCone=m,this._stackPartitions=u,this._slicePartitions=f,this._vertexFormat=c.VertexFormat.clone(d),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}A.packedLength=2*n.Cartesian3.packedLength+c.VertexFormat.packedLength+7,A.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._radii,e,a),a+=n.Cartesian3.packedLength,n.Cartesian3.pack(t._innerRadii,e,a),a+=n.Cartesian3.packedLength,c.VertexFormat.pack(t._vertexFormat,e,a),a+=c.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=r.defaultValue(t._offsetAttribute,-1),e};const k=new n.Cartesian3,b=new n.Cartesian3,w=new c.VertexFormat,g={radii:k,innerRadii:b,vertexFormat:w,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let P;A.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,k);e+=n.Cartesian3.packedLength;const o=n.Cartesian3.unpack(t,e,b);e+=n.Cartesian3.packedLength;const s=c.VertexFormat.unpack(t,e,w);e+=c.VertexFormat.packedLength;const m=t[e++],u=t[e++],l=t[e++],f=t[e++],d=t[e++],C=t[e++],p=t[e];return r.defined(a)?(a._radii=n.Cartesian3.clone(i,a._radii),a._innerRadii=n.Cartesian3.clone(o,a._innerRadii),a._vertexFormat=c.VertexFormat.clone(s,a._vertexFormat),a._minimumClock=m,a._maximumClock=u,a._minimumCone=l,a._maximumCone=f,a._stackPartitions=d,a._slicePartitions=C,a._offsetAttribute=-1===p?void 0:p,a):(g.minimumClock=m,g.maximumClock=u,g.minimumCone=l,g.maximumCone=f,g.stackPartitions=d,g.slicePartitions=C,g.offsetAttribute=-1===p?void 0:p,new A(g))},A.createGeometry=function(t){const c=t._radii;if(c.x<=0||c.y<=0||c.z<=0)return;const _=t._innerRadii;if(_.x<=0||_.y<=0||_.z<=0)return;const A=t._minimumClock,k=t._maximumClock,b=t._minimumCone,w=t._maximumCone,g=t._vertexFormat;let P,v,F=t._slicePartitions+1,V=t._stackPartitions+1;F=Math.round(F*Math.abs(k-A)/l.CesiumMath.TWO_PI),V=Math.round(V*Math.abs(w-b)/l.CesiumMath.PI),F<2&&(F=2),V<2&&(V=2);let M=0;const T=[b],D=[A];for(P=0;P<V;P++)T.push(b+P*(w-b)/(V-1));for(T.push(w),v=0;v<F;v++)D.push(A+v*(k-A)/(F-1));D.push(k);const G=T.length,L=D.length;let O=0,I=1;const E=_.x!==c.x||_.y!==c.y||_.z!==c.z;let z=!1,N=!1,R=!1;E&&(I=2,b>0&&(z=!0,O+=F-1),w<Math.PI&&(N=!0,O+=F-1),(k-A)%l.CesiumMath.TWO_PI?(R=!0,O+=2*(V-1)+1):O+=1);const U=L*G*I,S=new Float64Array(3*U),B=new Array(U).fill(!1),W=new Array(U).fill(!1),Y=F*V*I,J=6*(Y+O+1-(F+V)*I),X=u.IndexDatatype.createTypedArray(Y,J),Z=g.normal?new Float32Array(3*U):void 0,j=g.tangent?new Float32Array(3*U):void 0,q=g.bitangent?new Float32Array(3*U):void 0,H=g.st?new Float32Array(2*U):void 0,K=new Array(G),Q=new Array(G);for(P=0;P<G;P++)K[P]=x(T[P]),Q[P]=h(T[P]);const $=new Array(L),tt=new Array(L);for(v=0;v<L;v++)tt[v]=h(D[v]),$[v]=x(D[v]);for(P=0;P<G;P++)for(v=0;v<L;v++)S[M++]=c.x*K[P]*tt[v],S[M++]=c.y*K[P]*$[v],S[M++]=c.z*Q[P];let et,at,nt,it,rt=U/2;if(E)for(P=0;P<G;P++)for(v=0;v<L;v++)S[M++]=_.x*K[P]*tt[v],S[M++]=_.y*K[P]*$[v],S[M++]=_.z*Q[P],B[rt]=!0,P>0&&P!==G-1&&0!==v&&v!==L-1&&(W[rt]=!0),rt++;for(M=0,P=1;P<G-2;P++)for(et=P*L,at=(P+1)*L,v=1;v<L-2;v++)X[M++]=at+v,X[M++]=at+v+1,X[M++]=et+v+1,X[M++]=at+v,X[M++]=et+v+1,X[M++]=et+v;if(E){const t=G*L;for(P=1;P<G-2;P++)for(et=t+P*L,at=t+(P+1)*L,v=1;v<L-2;v++)X[M++]=at+v,X[M++]=et+v,X[M++]=et+v+1,X[M++]=at+v,X[M++]=et+v+1,X[M++]=at+v+1}if(E){if(z)for(it=G*L,P=1;P<L-2;P++)X[M++]=P,X[M++]=P+1,X[M++]=it+P+1,X[M++]=P,X[M++]=it+P+1,X[M++]=it+P;if(N)for(nt=G*L-L,it=G*L*I-L,P=1;P<L-2;P++)X[M++]=nt+P+1,X[M++]=nt+P,X[M++]=it+P,X[M++]=nt+P+1,X[M++]=it+P,X[M++]=it+P+1}if(R){for(P=1;P<G-2;P++)it=L*G+L*P,nt=L*P,X[M++]=it,X[M++]=nt+L,X[M++]=nt,X[M++]=it,X[M++]=it+L,X[M++]=nt+L;for(P=1;P<G-2;P++)it=L*G+L*(P+1)-1,nt=L*(P+1)-1,X[M++]=nt+L,X[M++]=it,X[M++]=nt,X[M++]=nt+L,X[M++]=it+L,X[M++]=it}const ot=new s.GeometryAttributes;g.position&&(ot.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:S}));let st=0,mt=0,ut=0,lt=0;const ct=U/2;let ft;const dt=n.Ellipsoid.fromCartesian3(c),Ct=n.Ellipsoid.fromCartesian3(_);if(g.st||g.normal||g.tangent||g.bitangent){for(P=0;P<U;P++){ft=B[P]?Ct:dt;const t=n.Cartesian3.fromArray(S,3*P,f),e=ft.geodeticSurfaceNormal(t,d);if(W[P]&&n.Cartesian3.negate(e,e),g.st){const t=a.Cartesian2.negate(e,y);H[st++]=Math.atan2(t.y,t.x)/l.CesiumMath.TWO_PI+.5,H[st++]=Math.asin(e.z)/Math.PI+.5}if(g.normal&&(Z[mt++]=e.x,Z[mt++]=e.y,Z[mt++]=e.z),g.tangent||g.bitangent){const t=C;let a,i=0;if(B[P]&&(i=ct),a=!z&&P>=i&&P<i+2*L?n.Cartesian3.UNIT_X:n.Cartesian3.UNIT_Z,n.Cartesian3.cross(a,e,t),n.Cartesian3.normalize(t,t),g.tangent&&(j[ut++]=t.x,j[ut++]=t.y,j[ut++]=t.z),g.bitangent){const a=n.Cartesian3.cross(e,t,p);n.Cartesian3.normalize(a,a),q[lt++]=a.x,q[lt++]=a.y,q[lt++]=a.z}}}g.st&&(ot.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:H})),g.normal&&(ot.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:Z})),g.tangent&&(ot.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),g.bitangent&&(ot.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:q}))}if(r.defined(t._offsetAttribute)){const e=S.length,a=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(e/3).fill(a);ot.applyOffset=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new o.Geometry({attributes:ot,indices:X,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromEllipsoid(dt),offsetAttribute:t._offsetAttribute})},A.getUnitEllipsoid=function(){return r.defined(P)||(P=A.createGeometry(new A({radii:new n.Cartesian3(1,1,1),vertexFormat:c.VertexFormat.POSITION_ONLY}))),P},t.EllipsoidGeometry=A})); +define(["exports","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./VertexFormat-fbdec922"],(function(t,e,a,n,i,r,o,s,m,u,l,c){"use strict";const f=new n.Cartesian3,d=new n.Cartesian3,C=new n.Cartesian3,p=new n.Cartesian3,y=new n.Cartesian3,_=new n.Cartesian3(1,1,1),h=Math.cos,x=Math.sin;function A(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT);const e=r.defaultValue(t.radii,_),a=r.defaultValue(t.innerRadii,e),i=r.defaultValue(t.minimumClock,0),o=r.defaultValue(t.maximumClock,l.CesiumMath.TWO_PI),s=r.defaultValue(t.minimumCone,0),m=r.defaultValue(t.maximumCone,l.CesiumMath.PI),u=Math.round(r.defaultValue(t.stackPartitions,64)),f=Math.round(r.defaultValue(t.slicePartitions,64)),d=r.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._radii=n.Cartesian3.clone(e),this._innerRadii=n.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=o,this._minimumCone=s,this._maximumCone=m,this._stackPartitions=u,this._slicePartitions=f,this._vertexFormat=c.VertexFormat.clone(d),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}A.packedLength=2*n.Cartesian3.packedLength+c.VertexFormat.packedLength+7,A.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._radii,e,a),a+=n.Cartesian3.packedLength,n.Cartesian3.pack(t._innerRadii,e,a),a+=n.Cartesian3.packedLength,c.VertexFormat.pack(t._vertexFormat,e,a),a+=c.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=r.defaultValue(t._offsetAttribute,-1),e};const k=new n.Cartesian3,b=new n.Cartesian3,w=new c.VertexFormat,g={radii:k,innerRadii:b,vertexFormat:w,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let P;A.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,k);e+=n.Cartesian3.packedLength;const o=n.Cartesian3.unpack(t,e,b);e+=n.Cartesian3.packedLength;const s=c.VertexFormat.unpack(t,e,w);e+=c.VertexFormat.packedLength;const m=t[e++],u=t[e++],l=t[e++],f=t[e++],d=t[e++],C=t[e++],p=t[e];return r.defined(a)?(a._radii=n.Cartesian3.clone(i,a._radii),a._innerRadii=n.Cartesian3.clone(o,a._innerRadii),a._vertexFormat=c.VertexFormat.clone(s,a._vertexFormat),a._minimumClock=m,a._maximumClock=u,a._minimumCone=l,a._maximumCone=f,a._stackPartitions=d,a._slicePartitions=C,a._offsetAttribute=-1===p?void 0:p,a):(g.minimumClock=m,g.maximumClock=u,g.minimumCone=l,g.maximumCone=f,g.stackPartitions=d,g.slicePartitions=C,g.offsetAttribute=-1===p?void 0:p,new A(g))},A.createGeometry=function(t){const c=t._radii;if(c.x<=0||c.y<=0||c.z<=0)return;const _=t._innerRadii;if(_.x<=0||_.y<=0||_.z<=0)return;const A=t._minimumClock,k=t._maximumClock,b=t._minimumCone,w=t._maximumCone,g=t._vertexFormat;let P,v,F=t._slicePartitions+1,V=t._stackPartitions+1;F=Math.round(F*Math.abs(k-A)/l.CesiumMath.TWO_PI),V=Math.round(V*Math.abs(w-b)/l.CesiumMath.PI),F<2&&(F=2),V<2&&(V=2);let M=0;const T=[b],D=[A];for(P=0;P<V;P++)T.push(b+P*(w-b)/(V-1));for(T.push(w),v=0;v<F;v++)D.push(A+v*(k-A)/(F-1));D.push(k);const G=T.length,L=D.length;let O=0,I=1;const E=_.x!==c.x||_.y!==c.y||_.z!==c.z;let z=!1,N=!1,R=!1;E&&(I=2,b>0&&(z=!0,O+=F-1),w<Math.PI&&(N=!0,O+=F-1),(k-A)%l.CesiumMath.TWO_PI?(R=!0,O+=2*(V-1)+1):O+=1);const U=L*G*I,S=new Float64Array(3*U),B=new Array(U).fill(!1),W=new Array(U).fill(!1),Y=F*V*I,J=6*(Y+O+1-(F+V)*I),X=u.IndexDatatype.createTypedArray(Y,J),Z=g.normal?new Float32Array(3*U):void 0,j=g.tangent?new Float32Array(3*U):void 0,q=g.bitangent?new Float32Array(3*U):void 0,H=g.st?new Float32Array(2*U):void 0,K=new Array(G),Q=new Array(G);for(P=0;P<G;P++)K[P]=x(T[P]),Q[P]=h(T[P]);const $=new Array(L),tt=new Array(L);for(v=0;v<L;v++)tt[v]=h(D[v]),$[v]=x(D[v]);for(P=0;P<G;P++)for(v=0;v<L;v++)S[M++]=c.x*K[P]*tt[v],S[M++]=c.y*K[P]*$[v],S[M++]=c.z*Q[P];let et,at,nt,it,rt=U/2;if(E)for(P=0;P<G;P++)for(v=0;v<L;v++)S[M++]=_.x*K[P]*tt[v],S[M++]=_.y*K[P]*$[v],S[M++]=_.z*Q[P],B[rt]=!0,P>0&&P!==G-1&&0!==v&&v!==L-1&&(W[rt]=!0),rt++;for(M=0,P=1;P<G-2;P++)for(et=P*L,at=(P+1)*L,v=1;v<L-2;v++)X[M++]=at+v,X[M++]=at+v+1,X[M++]=et+v+1,X[M++]=at+v,X[M++]=et+v+1,X[M++]=et+v;if(E){const t=G*L;for(P=1;P<G-2;P++)for(et=t+P*L,at=t+(P+1)*L,v=1;v<L-2;v++)X[M++]=at+v,X[M++]=et+v,X[M++]=et+v+1,X[M++]=at+v,X[M++]=et+v+1,X[M++]=at+v+1}if(E){if(z)for(it=G*L,P=1;P<L-2;P++)X[M++]=P,X[M++]=P+1,X[M++]=it+P+1,X[M++]=P,X[M++]=it+P+1,X[M++]=it+P;if(N)for(nt=G*L-L,it=G*L*I-L,P=1;P<L-2;P++)X[M++]=nt+P+1,X[M++]=nt+P,X[M++]=it+P,X[M++]=nt+P+1,X[M++]=it+P,X[M++]=it+P+1}if(R){for(P=1;P<G-2;P++)it=L*G+L*P,nt=L*P,X[M++]=it,X[M++]=nt+L,X[M++]=nt,X[M++]=it,X[M++]=it+L,X[M++]=nt+L;for(P=1;P<G-2;P++)it=L*G+L*(P+1)-1,nt=L*(P+1)-1,X[M++]=nt+L,X[M++]=it,X[M++]=nt,X[M++]=nt+L,X[M++]=it+L,X[M++]=it}const ot=new s.GeometryAttributes;g.position&&(ot.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:S}));let st=0,mt=0,ut=0,lt=0;const ct=U/2;let ft;const dt=n.Ellipsoid.fromCartesian3(c),Ct=n.Ellipsoid.fromCartesian3(_);if(g.st||g.normal||g.tangent||g.bitangent){for(P=0;P<U;P++){ft=B[P]?Ct:dt;const t=n.Cartesian3.fromArray(S,3*P,f),e=ft.geodeticSurfaceNormal(t,d);if(W[P]&&n.Cartesian3.negate(e,e),g.st){const t=a.Cartesian2.negate(e,y);H[st++]=Math.atan2(t.y,t.x)/l.CesiumMath.TWO_PI+.5,H[st++]=Math.asin(e.z)/Math.PI+.5}if(g.normal&&(Z[mt++]=e.x,Z[mt++]=e.y,Z[mt++]=e.z),g.tangent||g.bitangent){const t=C;let a,i=0;if(B[P]&&(i=ct),a=!z&&P>=i&&P<i+2*L?n.Cartesian3.UNIT_X:n.Cartesian3.UNIT_Z,n.Cartesian3.cross(a,e,t),n.Cartesian3.normalize(t,t),g.tangent&&(j[ut++]=t.x,j[ut++]=t.y,j[ut++]=t.z),g.bitangent){const a=n.Cartesian3.cross(e,t,p);n.Cartesian3.normalize(a,a),q[lt++]=a.x,q[lt++]=a.y,q[lt++]=a.z}}}g.st&&(ot.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:H})),g.normal&&(ot.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:Z})),g.tangent&&(ot.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),g.bitangent&&(ot.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:q}))}if(r.defined(t._offsetAttribute)){const e=S.length,a=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(e/3).fill(a);ot.applyOffset=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new o.Geometry({attributes:ot,indices:X,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromEllipsoid(dt),offsetAttribute:t._offsetAttribute})},A.getUnitEllipsoid=function(){return r.defined(P)||(P=A.createGeometry(new A({radii:new n.Cartesian3(1,1,1),vertexFormat:c.VertexFormat.POSITION_ONLY}))),P},t.EllipsoidGeometry=A})); diff --git a/public/lib/Cesium/Workers/EllipsoidOutlineGeometry-1242f733.js b/public/lib/Cesium/Workers/EllipsoidOutlineGeometry-52005f3f.js similarity index 94% rename from public/lib/Cesium/Workers/EllipsoidOutlineGeometry-1242f733.js rename to public/lib/Cesium/Workers/EllipsoidOutlineGeometry-52005f3f.js index 06ee2b5f..67f768f3 100644 --- a/public/lib/Cesium/Workers/EllipsoidOutlineGeometry-1242f733.js +++ b/public/lib/Cesium/Workers/EllipsoidOutlineGeometry-52005f3f.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9"],(function(t,i,e,n,a,o,r,s,u,m){"use strict";const l=new e.Cartesian3(1,1,1),f=Math.cos,c=Math.sin;function d(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);const i=a.defaultValue(t.radii,l),n=a.defaultValue(t.innerRadii,i),o=a.defaultValue(t.minimumClock,0),r=a.defaultValue(t.maximumClock,m.CesiumMath.TWO_PI),s=a.defaultValue(t.minimumCone,0),u=a.defaultValue(t.maximumCone,m.CesiumMath.PI),f=Math.round(a.defaultValue(t.stackPartitions,10)),c=Math.round(a.defaultValue(t.slicePartitions,8)),d=Math.round(a.defaultValue(t.subdivisions,128));this._radii=e.Cartesian3.clone(i),this._innerRadii=e.Cartesian3.clone(n),this._minimumClock=o,this._maximumClock=r,this._minimumCone=s,this._maximumCone=u,this._stackPartitions=f,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}d.packedLength=2*e.Cartesian3.packedLength+8,d.pack=function(t,i,n){return n=a.defaultValue(n,0),e.Cartesian3.pack(t._radii,i,n),n+=e.Cartesian3.packedLength,e.Cartesian3.pack(t._innerRadii,i,n),n+=e.Cartesian3.packedLength,i[n++]=t._minimumClock,i[n++]=t._maximumClock,i[n++]=t._minimumCone,i[n++]=t._maximumCone,i[n++]=t._stackPartitions,i[n++]=t._slicePartitions,i[n++]=t._subdivisions,i[n]=a.defaultValue(t._offsetAttribute,-1),i};const C=new e.Cartesian3,_=new e.Cartesian3,p={radii:C,innerRadii:_,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};d.unpack=function(t,i,n){i=a.defaultValue(i,0);const o=e.Cartesian3.unpack(t,i,C);i+=e.Cartesian3.packedLength;const r=e.Cartesian3.unpack(t,i,_);i+=e.Cartesian3.packedLength;const s=t[i++],u=t[i++],m=t[i++],l=t[i++],f=t[i++],c=t[i++],h=t[i++],y=t[i];return a.defined(n)?(n._radii=e.Cartesian3.clone(o,n._radii),n._innerRadii=e.Cartesian3.clone(r,n._innerRadii),n._minimumClock=s,n._maximumClock=u,n._minimumCone=m,n._maximumCone=l,n._stackPartitions=f,n._slicePartitions=c,n._subdivisions=h,n._offsetAttribute=-1===y?void 0:y,n):(p.minimumClock=s,p.maximumClock=u,p.minimumCone=m,p.maximumCone=l,p.stackPartitions=f,p.slicePartitions=c,p.subdivisions=h,p.offsetAttribute=-1===y?void 0:y,new d(p))},d.createGeometry=function(t){const l=t._radii;if(l.x<=0||l.y<=0||l.z<=0)return;const d=t._innerRadii;if(d.x<=0||d.y<=0||d.z<=0)return;const C=t._minimumClock,_=t._maximumClock,p=t._minimumCone,h=t._maximumCone,y=t._subdivisions,k=e.Ellipsoid.fromCartesian3(l);let b=t._slicePartitions+1,x=t._stackPartitions+1;b=Math.round(b*Math.abs(_-C)/m.CesiumMath.TWO_PI),x=Math.round(x*Math.abs(h-p)/m.CesiumMath.PI),b<2&&(b=2),x<2&&(x=2);let A=0,P=1;const v=d.x!==l.x||d.y!==l.y||d.z!==l.z;let M=!1,w=!1;v&&(P=2,p>0&&(M=!0,A+=b),h<Math.PI&&(w=!0,A+=b));const V=y*P*(x+b),g=new Float64Array(3*V),G=2*(V+A-(b+x)*P),E=u.IndexDatatype.createTypedArray(V,G);let O,D,I,T,z=0;const L=new Array(x),R=new Array(x);for(O=0;O<x;O++)T=p+O*(h-p)/(x-1),L[O]=c(T),R[O]=f(T);const N=new Array(y),B=new Array(y);for(O=0;O<y;O++)I=C+O*(_-C)/(y-1),N[O]=c(I),B[O]=f(I);for(O=0;O<x;O++)for(D=0;D<y;D++)g[z++]=l.x*L[O]*B[D],g[z++]=l.y*L[O]*N[D],g[z++]=l.z*R[O];if(v)for(O=0;O<x;O++)for(D=0;D<y;D++)g[z++]=d.x*L[O]*B[D],g[z++]=d.y*L[O]*N[D],g[z++]=d.z*R[O];for(L.length=y,R.length=y,O=0;O<y;O++)T=p+O*(h-p)/(y-1),L[O]=c(T),R[O]=f(T);for(N.length=b,B.length=b,O=0;O<b;O++)I=C+O*(_-C)/(b-1),N[O]=c(I),B[O]=f(I);for(O=0;O<y;O++)for(D=0;D<b;D++)g[z++]=l.x*L[O]*B[D],g[z++]=l.y*L[O]*N[D],g[z++]=l.z*R[O];if(v)for(O=0;O<y;O++)for(D=0;D<b;D++)g[z++]=d.x*L[O]*B[D],g[z++]=d.y*L[O]*N[D],g[z++]=d.z*R[O];for(z=0,O=0;O<x*P;O++){const t=O*y;for(D=0;D<y-1;D++)E[z++]=t+D,E[z++]=t+D+1}let S=x*y*P;for(O=0;O<b;O++)for(D=0;D<y-1;D++)E[z++]=S+O+D*b,E[z++]=S+O+(D+1)*b;if(v)for(S=x*y*P+b*y,O=0;O<b;O++)for(D=0;D<y-1;D++)E[z++]=S+O+D*b,E[z++]=S+O+(D+1)*b;if(v){let t=x*y*P,i=t+y*b;if(M)for(O=0;O<b;O++)E[z++]=t+O,E[z++]=i+O;if(w)for(t+=y*b-b,i+=y*b-b,O=0;O<b;O++)E[z++]=t+O,E[z++]=i+O}const U=new r.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})});if(a.defined(t._offsetAttribute)){const i=g.length,e=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,a=new Uint8Array(i/3).fill(e);U.applyOffset=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return new o.Geometry({attributes:U,indices:E,primitiveType:o.PrimitiveType.LINES,boundingSphere:i.BoundingSphere.fromEllipsoid(k),offsetAttribute:t._offsetAttribute})},t.EllipsoidOutlineGeometry=d})); +define(["exports","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6"],(function(t,i,e,n,a,o,r,s,u,m){"use strict";const l=new e.Cartesian3(1,1,1),f=Math.cos,c=Math.sin;function d(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);const i=a.defaultValue(t.radii,l),n=a.defaultValue(t.innerRadii,i),o=a.defaultValue(t.minimumClock,0),r=a.defaultValue(t.maximumClock,m.CesiumMath.TWO_PI),s=a.defaultValue(t.minimumCone,0),u=a.defaultValue(t.maximumCone,m.CesiumMath.PI),f=Math.round(a.defaultValue(t.stackPartitions,10)),c=Math.round(a.defaultValue(t.slicePartitions,8)),d=Math.round(a.defaultValue(t.subdivisions,128));this._radii=e.Cartesian3.clone(i),this._innerRadii=e.Cartesian3.clone(n),this._minimumClock=o,this._maximumClock=r,this._minimumCone=s,this._maximumCone=u,this._stackPartitions=f,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}d.packedLength=2*e.Cartesian3.packedLength+8,d.pack=function(t,i,n){return n=a.defaultValue(n,0),e.Cartesian3.pack(t._radii,i,n),n+=e.Cartesian3.packedLength,e.Cartesian3.pack(t._innerRadii,i,n),n+=e.Cartesian3.packedLength,i[n++]=t._minimumClock,i[n++]=t._maximumClock,i[n++]=t._minimumCone,i[n++]=t._maximumCone,i[n++]=t._stackPartitions,i[n++]=t._slicePartitions,i[n++]=t._subdivisions,i[n]=a.defaultValue(t._offsetAttribute,-1),i};const C=new e.Cartesian3,_=new e.Cartesian3,p={radii:C,innerRadii:_,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};d.unpack=function(t,i,n){i=a.defaultValue(i,0);const o=e.Cartesian3.unpack(t,i,C);i+=e.Cartesian3.packedLength;const r=e.Cartesian3.unpack(t,i,_);i+=e.Cartesian3.packedLength;const s=t[i++],u=t[i++],m=t[i++],l=t[i++],f=t[i++],c=t[i++],h=t[i++],y=t[i];return a.defined(n)?(n._radii=e.Cartesian3.clone(o,n._radii),n._innerRadii=e.Cartesian3.clone(r,n._innerRadii),n._minimumClock=s,n._maximumClock=u,n._minimumCone=m,n._maximumCone=l,n._stackPartitions=f,n._slicePartitions=c,n._subdivisions=h,n._offsetAttribute=-1===y?void 0:y,n):(p.minimumClock=s,p.maximumClock=u,p.minimumCone=m,p.maximumCone=l,p.stackPartitions=f,p.slicePartitions=c,p.subdivisions=h,p.offsetAttribute=-1===y?void 0:y,new d(p))},d.createGeometry=function(t){const l=t._radii;if(l.x<=0||l.y<=0||l.z<=0)return;const d=t._innerRadii;if(d.x<=0||d.y<=0||d.z<=0)return;const C=t._minimumClock,_=t._maximumClock,p=t._minimumCone,h=t._maximumCone,y=t._subdivisions,k=e.Ellipsoid.fromCartesian3(l);let b=t._slicePartitions+1,x=t._stackPartitions+1;b=Math.round(b*Math.abs(_-C)/m.CesiumMath.TWO_PI),x=Math.round(x*Math.abs(h-p)/m.CesiumMath.PI),b<2&&(b=2),x<2&&(x=2);let A=0,P=1;const v=d.x!==l.x||d.y!==l.y||d.z!==l.z;let M=!1,w=!1;v&&(P=2,p>0&&(M=!0,A+=b),h<Math.PI&&(w=!0,A+=b));const V=y*P*(x+b),g=new Float64Array(3*V),G=2*(V+A-(b+x)*P),E=u.IndexDatatype.createTypedArray(V,G);let O,D,I,T,z=0;const L=new Array(x),R=new Array(x);for(O=0;O<x;O++)T=p+O*(h-p)/(x-1),L[O]=c(T),R[O]=f(T);const N=new Array(y),B=new Array(y);for(O=0;O<y;O++)I=C+O*(_-C)/(y-1),N[O]=c(I),B[O]=f(I);for(O=0;O<x;O++)for(D=0;D<y;D++)g[z++]=l.x*L[O]*B[D],g[z++]=l.y*L[O]*N[D],g[z++]=l.z*R[O];if(v)for(O=0;O<x;O++)for(D=0;D<y;D++)g[z++]=d.x*L[O]*B[D],g[z++]=d.y*L[O]*N[D],g[z++]=d.z*R[O];for(L.length=y,R.length=y,O=0;O<y;O++)T=p+O*(h-p)/(y-1),L[O]=c(T),R[O]=f(T);for(N.length=b,B.length=b,O=0;O<b;O++)I=C+O*(_-C)/(b-1),N[O]=c(I),B[O]=f(I);for(O=0;O<y;O++)for(D=0;D<b;D++)g[z++]=l.x*L[O]*B[D],g[z++]=l.y*L[O]*N[D],g[z++]=l.z*R[O];if(v)for(O=0;O<y;O++)for(D=0;D<b;D++)g[z++]=d.x*L[O]*B[D],g[z++]=d.y*L[O]*N[D],g[z++]=d.z*R[O];for(z=0,O=0;O<x*P;O++){const t=O*y;for(D=0;D<y-1;D++)E[z++]=t+D,E[z++]=t+D+1}let S=x*y*P;for(O=0;O<b;O++)for(D=0;D<y-1;D++)E[z++]=S+O+D*b,E[z++]=S+O+(D+1)*b;if(v)for(S=x*y*P+b*y,O=0;O<b;O++)for(D=0;D<y-1;D++)E[z++]=S+O+D*b,E[z++]=S+O+(D+1)*b;if(v){let t=x*y*P,i=t+y*b;if(M)for(O=0;O<b;O++)E[z++]=t+O,E[z++]=i+O;if(w)for(t+=y*b-b,i+=y*b-b,O=0;O<b;O++)E[z++]=t+O,E[z++]=i+O}const U=new r.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})});if(a.defined(t._offsetAttribute)){const i=g.length,e=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,a=new Uint8Array(i/3).fill(e);U.applyOffset=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return new o.Geometry({attributes:U,indices:E,primitiveType:o.PrimitiveType.LINES,boundingSphere:i.BoundingSphere.fromEllipsoid(k),offsetAttribute:t._offsetAttribute})},t.EllipsoidOutlineGeometry=d})); diff --git a/public/lib/Cesium/Workers/EllipsoidRhumbLine-77eff028.js b/public/lib/Cesium/Workers/EllipsoidRhumbLine-1289f7e8.js similarity index 97% rename from public/lib/Cesium/Workers/EllipsoidRhumbLine-77eff028.js rename to public/lib/Cesium/Workers/EllipsoidRhumbLine-1289f7e8.js index 0988f4d1..cfd87c37 100644 --- a/public/lib/Cesium/Workers/EllipsoidRhumbLine-77eff028.js +++ b/public/lib/Cesium/Workers/EllipsoidRhumbLine-1289f7e8.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(t,i,e,a){"use strict";function n(t,i,e){if(0===t)return i*e;const a=t*t,n=a*a,s=n*a,h=s*a,u=h*a,o=u*a,l=e;return i*((1-a/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*o/1048576)*l-(3*a/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*o/524288)*Math.sin(2*l)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*o/8388608)*Math.sin(4*l)-(35*s/3072+175*h/12288+3675*u/262144+13475*o/1048576)*Math.sin(6*l)+(315*h/131072+2205*u/524288+43659*o/8388608)*Math.sin(8*l)-(693*u/1310720+6237*o/5242880)*Math.sin(10*l)+1001*o/8388608*Math.sin(12*l))}function s(t,i){if(0===t)return Math.log(Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+i)));const e=t*Math.sin(i);return Math.log(Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+e)/(1-e))}const h=new i.Cartesian3,u=new i.Cartesian3;function o(t,e,o,l){i.Cartesian3.normalize(l.cartographicToCartesian(e,u),h),i.Cartesian3.normalize(l.cartographicToCartesian(o,u),u);const r=l.maximumRadius,d=l.minimumRadius,c=r*r,M=d*d;t._ellipticitySquared=(c-M)/c,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=i.Cartographic.clone(e,t._start),t._start.height=0,t._end=i.Cartographic.clone(o,t._end),t._end.height=0,t._heading=function(t,i,e,n,h){const u=s(t._ellipticity,e),o=s(t._ellipticity,h);return Math.atan2(a.CesiumMath.negativePiToPi(n-i),o-u)}(t,e.longitude,e.latitude,o.longitude,o.latitude),t._distance=function(t,i,e,s,h,u,o){const l=t._heading,r=u-s;let d=0;if(a.CesiumMath.equalsEpsilon(Math.abs(l),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8))if(i===e)d=i*Math.cos(h)*a.CesiumMath.negativePiToPi(r);else{const e=Math.sin(h);d=i*Math.cos(h)*a.CesiumMath.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*e*e)}else{const e=n(t._ellipticity,i,h);d=(n(t._ellipticity,i,o)-e)/Math.cos(l)}return Math.abs(d)}(t,l.maximumRadius,l.minimumRadius,e.longitude,e.latitude,o.longitude,o.latitude)}function l(t,h,u,o,l,r){if(0===u)return i.Cartographic.clone(t,r);const d=l*l;let c,M,g;if(Math.abs(a.CesiumMath.PI_OVER_TWO-Math.abs(h))>a.CesiumMath.EPSILON8){M=function(t,i,e){const a=t/e;if(0===i)return a;const n=a*a,s=n*a,h=s*a,u=i*i,o=u*u,l=o*u,r=l*u,d=r*u,c=d*u,M=Math.sin(2*a),g=Math.cos(2*a),m=Math.sin(4*a),_=Math.cos(4*a),p=Math.sin(6*a),C=Math.cos(6*a),f=Math.sin(8*a),P=Math.cos(8*a),O=Math.sin(10*a);return a+a*u/4+7*a*o/64+15*a*l/256+579*a*r/16384+1515*a*d/65536+16837*a*c/1048576+(3*a*o/16+45*a*l/256-a*(32*n-561)*r/4096-a*(232*n-1677)*d/16384+a*(399985-90560*n+512*h)*c/5242880)*g+(21*a*l/256+483*a*r/4096-a*(224*n-1969)*d/16384-a*(33152*n-112599)*c/1048576)*_+(151*a*r/4096+4681*a*d/65536+1479*a*c/16384-453*s*c/32768)*C+(1097*a*d/65536+42783*a*c/1048576)*P+8011*a*c/1048576*Math.cos(10*a)+(3*u/8+3*o/16+213*l/2048-3*n*l/64+255*r/4096-33*n*r/512+20861*d/524288-33*n*d/512+h*d/1024+28273*c/1048576-471*n*c/8192+9*h*c/4096)*M+(21*o/256+21*l/256+533*r/8192-21*n*r/512+197*d/4096-315*n*d/4096+584039*c/16777216-12517*n*c/131072+7*h*c/2048)*m+(151*l/6144+151*r/4096+5019*d/131072-453*n*d/16384+26965*c/786432-8607*n*c/131072)*p+(1097*r/131072+1097*d/65536+225797*c/10485760-1097*n*c/65536)*f+(8011*d/2621440+8011*c/1048576)*O+293393*c/251658240*Math.sin(12*a)}(n(l,o,t.latitude)+u*Math.cos(h),l,o);const i=s(l,t.latitude),e=s(l,M);g=Math.tan(h)*(e-i),c=a.CesiumMath.negativePiToPi(t.longitude+g)}else{let i;if(M=t.latitude,0===l)i=o*Math.cos(t.latitude);else{const e=Math.sin(t.latitude);i=o*Math.cos(t.latitude)/Math.sqrt(1-d*e*e)}g=u/i,c=h>0?a.CesiumMath.negativePiToPi(t.longitude+g):a.CesiumMath.negativePiToPi(t.longitude-g)}return e.defined(r)?(r.longitude=c,r.latitude=M,r.height=0,r):new i.Cartographic(c,M,0)}function r(t,a,n){const s=e.defaultValue(n,i.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new i.Cartographic,this._end=new i.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,e.defined(t)&&e.defined(a)&&o(this,t,a,s)}Object.defineProperties(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}}),r.fromStartHeadingDistance=function(t,n,s,h,u){const o=e.defaultValue(h,i.Ellipsoid.WGS84),d=o.maximumRadius,c=o.minimumRadius,M=d*d,g=c*c,m=Math.sqrt((M-g)/M),_=l(t,n=a.CesiumMath.negativePiToPi(n),s,o.maximumRadius,m);return!e.defined(u)||e.defined(h)&&!h.equals(u.ellipsoid)?new r(t,_,o):(u.setEndPoints(t,_),u)},r.prototype.setEndPoints=function(t,i){o(this,t,i,this._ellipsoid)},r.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},r.prototype.interpolateUsingSurfaceDistance=function(t,i){return l(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},r.prototype.findIntersectionWithLongitude=function(t,n){const s=this._ellipticity,h=this._heading,u=Math.abs(h),o=this._start;if(t=a.CesiumMath.negativePiToPi(t),a.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,a.CesiumMath.EPSILON14)&&(t=a.CesiumMath.sign(o.longitude)*Math.PI),e.defined(n)||(n=new i.Cartographic),Math.abs(a.CesiumMath.PI_OVER_TWO-u)<=a.CesiumMath.EPSILON8)return n.longitude=t,n.latitude=o.latitude,n.height=0,n;if(a.CesiumMath.equalsEpsilon(Math.abs(a.CesiumMath.PI_OVER_TWO-u),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8)){if(a.CesiumMath.equalsEpsilon(t,o.longitude,a.CesiumMath.EPSILON12))return;return n.longitude=t,n.latitude=a.CesiumMath.PI_OVER_TWO*a.CesiumMath.sign(a.CesiumMath.PI_OVER_TWO-h),n.height=0,n}const l=o.latitude,r=s*Math.sin(l),d=Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+l))*Math.exp((t-o.longitude)/Math.tan(h)),c=(1+r)/(1-r);let M,g=o.latitude;do{M=g;const t=s*Math.sin(M),i=(1+t)/(1-t);g=2*Math.atan(d*Math.pow(i/c,s/2))-a.CesiumMath.PI_OVER_TWO}while(!a.CesiumMath.equalsEpsilon(g,M,a.CesiumMath.EPSILON12));return n.longitude=t,n.latitude=g,n.height=0,n},r.prototype.findIntersectionWithLatitude=function(t,n){const h=this._ellipticity,u=this._heading,o=this._start;if(a.CesiumMath.equalsEpsilon(Math.abs(u),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8))return;const l=s(h,o.latitude),r=s(h,t),d=Math.tan(u)*(r-l),c=a.CesiumMath.negativePiToPi(o.longitude+d);return e.defined(n)?(n.longitude=c,n.latitude=t,n.height=0,n):new i.Cartographic(c,t,0)},t.EllipsoidRhumbLine=r})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6"],(function(t,i,e,a){"use strict";function n(t,i,e){if(0===t)return i*e;const a=t*t,n=a*a,s=n*a,h=s*a,u=h*a,o=u*a,l=e;return i*((1-a/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*o/1048576)*l-(3*a/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*o/524288)*Math.sin(2*l)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*o/8388608)*Math.sin(4*l)-(35*s/3072+175*h/12288+3675*u/262144+13475*o/1048576)*Math.sin(6*l)+(315*h/131072+2205*u/524288+43659*o/8388608)*Math.sin(8*l)-(693*u/1310720+6237*o/5242880)*Math.sin(10*l)+1001*o/8388608*Math.sin(12*l))}function s(t,i){if(0===t)return Math.log(Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+i)));const e=t*Math.sin(i);return Math.log(Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+e)/(1-e))}const h=new i.Cartesian3,u=new i.Cartesian3;function o(t,e,o,l){i.Cartesian3.normalize(l.cartographicToCartesian(e,u),h),i.Cartesian3.normalize(l.cartographicToCartesian(o,u),u);const r=l.maximumRadius,d=l.minimumRadius,c=r*r,M=d*d;t._ellipticitySquared=(c-M)/c,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=i.Cartographic.clone(e,t._start),t._start.height=0,t._end=i.Cartographic.clone(o,t._end),t._end.height=0,t._heading=function(t,i,e,n,h){const u=s(t._ellipticity,e),o=s(t._ellipticity,h);return Math.atan2(a.CesiumMath.negativePiToPi(n-i),o-u)}(t,e.longitude,e.latitude,o.longitude,o.latitude),t._distance=function(t,i,e,s,h,u,o){const l=t._heading,r=u-s;let d=0;if(a.CesiumMath.equalsEpsilon(Math.abs(l),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8))if(i===e)d=i*Math.cos(h)*a.CesiumMath.negativePiToPi(r);else{const e=Math.sin(h);d=i*Math.cos(h)*a.CesiumMath.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*e*e)}else{const e=n(t._ellipticity,i,h);d=(n(t._ellipticity,i,o)-e)/Math.cos(l)}return Math.abs(d)}(t,l.maximumRadius,l.minimumRadius,e.longitude,e.latitude,o.longitude,o.latitude)}function l(t,h,u,o,l,r){if(0===u)return i.Cartographic.clone(t,r);const d=l*l;let c,M,g;if(Math.abs(a.CesiumMath.PI_OVER_TWO-Math.abs(h))>a.CesiumMath.EPSILON8){M=function(t,i,e){const a=t/e;if(0===i)return a;const n=a*a,s=n*a,h=s*a,u=i*i,o=u*u,l=o*u,r=l*u,d=r*u,c=d*u,M=Math.sin(2*a),g=Math.cos(2*a),m=Math.sin(4*a),_=Math.cos(4*a),p=Math.sin(6*a),C=Math.cos(6*a),f=Math.sin(8*a),P=Math.cos(8*a),O=Math.sin(10*a);return a+a*u/4+7*a*o/64+15*a*l/256+579*a*r/16384+1515*a*d/65536+16837*a*c/1048576+(3*a*o/16+45*a*l/256-a*(32*n-561)*r/4096-a*(232*n-1677)*d/16384+a*(399985-90560*n+512*h)*c/5242880)*g+(21*a*l/256+483*a*r/4096-a*(224*n-1969)*d/16384-a*(33152*n-112599)*c/1048576)*_+(151*a*r/4096+4681*a*d/65536+1479*a*c/16384-453*s*c/32768)*C+(1097*a*d/65536+42783*a*c/1048576)*P+8011*a*c/1048576*Math.cos(10*a)+(3*u/8+3*o/16+213*l/2048-3*n*l/64+255*r/4096-33*n*r/512+20861*d/524288-33*n*d/512+h*d/1024+28273*c/1048576-471*n*c/8192+9*h*c/4096)*M+(21*o/256+21*l/256+533*r/8192-21*n*r/512+197*d/4096-315*n*d/4096+584039*c/16777216-12517*n*c/131072+7*h*c/2048)*m+(151*l/6144+151*r/4096+5019*d/131072-453*n*d/16384+26965*c/786432-8607*n*c/131072)*p+(1097*r/131072+1097*d/65536+225797*c/10485760-1097*n*c/65536)*f+(8011*d/2621440+8011*c/1048576)*O+293393*c/251658240*Math.sin(12*a)}(n(l,o,t.latitude)+u*Math.cos(h),l,o);const i=s(l,t.latitude),e=s(l,M);g=Math.tan(h)*(e-i),c=a.CesiumMath.negativePiToPi(t.longitude+g)}else{let i;if(M=t.latitude,0===l)i=o*Math.cos(t.latitude);else{const e=Math.sin(t.latitude);i=o*Math.cos(t.latitude)/Math.sqrt(1-d*e*e)}g=u/i,c=h>0?a.CesiumMath.negativePiToPi(t.longitude+g):a.CesiumMath.negativePiToPi(t.longitude-g)}return e.defined(r)?(r.longitude=c,r.latitude=M,r.height=0,r):new i.Cartographic(c,M,0)}function r(t,a,n){const s=e.defaultValue(n,i.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new i.Cartographic,this._end=new i.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,e.defined(t)&&e.defined(a)&&o(this,t,a,s)}Object.defineProperties(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}}),r.fromStartHeadingDistance=function(t,n,s,h,u){const o=e.defaultValue(h,i.Ellipsoid.WGS84),d=o.maximumRadius,c=o.minimumRadius,M=d*d,g=c*c,m=Math.sqrt((M-g)/M),_=l(t,n=a.CesiumMath.negativePiToPi(n),s,o.maximumRadius,m);return!e.defined(u)||e.defined(h)&&!h.equals(u.ellipsoid)?new r(t,_,o):(u.setEndPoints(t,_),u)},r.prototype.setEndPoints=function(t,i){o(this,t,i,this._ellipsoid)},r.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},r.prototype.interpolateUsingSurfaceDistance=function(t,i){return l(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},r.prototype.findIntersectionWithLongitude=function(t,n){const s=this._ellipticity,h=this._heading,u=Math.abs(h),o=this._start;if(t=a.CesiumMath.negativePiToPi(t),a.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,a.CesiumMath.EPSILON14)&&(t=a.CesiumMath.sign(o.longitude)*Math.PI),e.defined(n)||(n=new i.Cartographic),Math.abs(a.CesiumMath.PI_OVER_TWO-u)<=a.CesiumMath.EPSILON8)return n.longitude=t,n.latitude=o.latitude,n.height=0,n;if(a.CesiumMath.equalsEpsilon(Math.abs(a.CesiumMath.PI_OVER_TWO-u),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8)){if(a.CesiumMath.equalsEpsilon(t,o.longitude,a.CesiumMath.EPSILON12))return;return n.longitude=t,n.latitude=a.CesiumMath.PI_OVER_TWO*a.CesiumMath.sign(a.CesiumMath.PI_OVER_TWO-h),n.height=0,n}const l=o.latitude,r=s*Math.sin(l),d=Math.tan(.5*(a.CesiumMath.PI_OVER_TWO+l))*Math.exp((t-o.longitude)/Math.tan(h)),c=(1+r)/(1-r);let M,g=o.latitude;do{M=g;const t=s*Math.sin(M),i=(1+t)/(1-t);g=2*Math.atan(d*Math.pow(i/c,s/2))-a.CesiumMath.PI_OVER_TWO}while(!a.CesiumMath.equalsEpsilon(g,M,a.CesiumMath.EPSILON12));return n.longitude=t,n.latitude=g,n.height=0,n},r.prototype.findIntersectionWithLatitude=function(t,n){const h=this._ellipticity,u=this._heading,o=this._start;if(a.CesiumMath.equalsEpsilon(Math.abs(u),a.CesiumMath.PI_OVER_TWO,a.CesiumMath.EPSILON8))return;const l=s(h,o.latitude),r=s(h,t),d=Math.tan(u)*(r-l),c=a.CesiumMath.negativePiToPi(o.longitude+d);return e.defined(n)?(n.longitude=c,n.latitude=t,n.height=0,n):new i.Cartographic(c,t,0)},t.EllipsoidRhumbLine=r})); diff --git a/public/lib/Cesium/Workers/EllipsoidTangentPlane-cf43ca0f.js b/public/lib/Cesium/Workers/EllipsoidTangentPlane-c3e9d965.js similarity index 91% rename from public/lib/Cesium/Workers/EllipsoidTangentPlane-cf43ca0f.js rename to public/lib/Cesium/Workers/EllipsoidTangentPlane-c3e9d965.js index 57584346..659ad76d 100644 --- a/public/lib/Cesium/Workers/EllipsoidTangentPlane-cf43ca0f.js +++ b/public/lib/Cesium/Workers/EllipsoidTangentPlane-c3e9d965.js @@ -1 +1 @@ -define(["exports","./AxisAlignedBoundingBox-e7b79110","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./IntersectionTests-56142431","./Plane-6add0ae1","./Transforms-b3716b06"],(function(t,n,e,i,o,r,s,a){"use strict";const l=new e.Cartesian4;function c(t,n){t=(n=o.defaultValue(n,i.Ellipsoid.WGS84)).scaleToGeodeticSurface(t);const r=a.Transforms.eastNorthUpToFixedFrame(t,n);this._ellipsoid=n,this._origin=t,this._xAxis=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,0,l)),this._yAxis=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,1,l));const c=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,2,l));this._plane=s.Plane.fromPointNormal(t,c)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const d=new n.AxisAlignedBoundingBox;c.fromPoints=function(t,e){return new c(n.AxisAlignedBoundingBox.fromPoints(t,d).center,e)};const p=new r.Ray,u=new i.Cartesian3;c.prototype.projectPointOntoPlane=function(t,n){const s=p;s.origin=t,i.Cartesian3.normalize(t,s.direction);let a=r.IntersectionTests.rayPlane(s,this._plane,u);if(o.defined(a)||(i.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,u)),o.defined(a)){const t=i.Cartesian3.subtract(a,this._origin,a),r=i.Cartesian3.dot(this._xAxis,t),s=i.Cartesian3.dot(this._yAxis,t);return o.defined(n)?(n.x=r,n.y=s,n):new e.Cartesian2(r,s)}},c.prototype.projectPointsOntoPlane=function(t,n){o.defined(n)||(n=[]);let e=0;const i=t.length;for(let r=0;r<i;r++){const i=this.projectPointOntoPlane(t[r],n[e]);o.defined(i)&&(n[e]=i,e++)}return n.length=e,n},c.prototype.projectPointToNearestOnPlane=function(t,n){o.defined(n)||(n=new e.Cartesian2);const s=p;s.origin=t,i.Cartesian3.clone(this._plane.normal,s.direction);let a=r.IntersectionTests.rayPlane(s,this._plane,u);o.defined(a)||(i.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,u));const l=i.Cartesian3.subtract(a,this._origin,a),c=i.Cartesian3.dot(this._xAxis,l),d=i.Cartesian3.dot(this._yAxis,l);return n.x=c,n.y=d,n},c.prototype.projectPointsToNearestOnPlane=function(t,n){o.defined(n)||(n=[]);const e=t.length;n.length=e;for(let i=0;i<e;i++)n[i]=this.projectPointToNearestOnPlane(t[i],n[i]);return n};const f=new i.Cartesian3;c.prototype.projectPointOntoEllipsoid=function(t,n){o.defined(n)||(n=new i.Cartesian3);const e=this._ellipsoid,r=this._origin,s=this._xAxis,a=this._yAxis,l=f;return i.Cartesian3.multiplyByScalar(s,t.x,l),n=i.Cartesian3.add(r,l,n),i.Cartesian3.multiplyByScalar(a,t.y,l),i.Cartesian3.add(n,l,n),e.scaleToGeocentricSurface(n,n),n},c.prototype.projectPointsOntoEllipsoid=function(t,n){const e=t.length;o.defined(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.projectPointOntoEllipsoid(t[i],n[i]);return n},t.EllipsoidTangentPlane=c})); +define(["exports","./AxisAlignedBoundingBox-04c1a5e3","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./IntersectionTests-f1b36d69","./Plane-5931b53e","./Transforms-f17097e5"],(function(t,n,e,i,o,r,s,a){"use strict";const l=new e.Cartesian4;function c(t,n){t=(n=o.defaultValue(n,i.Ellipsoid.WGS84)).scaleToGeodeticSurface(t);const r=a.Transforms.eastNorthUpToFixedFrame(t,n);this._ellipsoid=n,this._origin=t,this._xAxis=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,0,l)),this._yAxis=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,1,l));const c=i.Cartesian3.fromCartesian4(e.Matrix4.getColumn(r,2,l));this._plane=s.Plane.fromPointNormal(t,c)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const d=new n.AxisAlignedBoundingBox;c.fromPoints=function(t,e){return new c(n.AxisAlignedBoundingBox.fromPoints(t,d).center,e)};const p=new r.Ray,u=new i.Cartesian3;c.prototype.projectPointOntoPlane=function(t,n){const s=p;s.origin=t,i.Cartesian3.normalize(t,s.direction);let a=r.IntersectionTests.rayPlane(s,this._plane,u);if(o.defined(a)||(i.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,u)),o.defined(a)){const t=i.Cartesian3.subtract(a,this._origin,a),r=i.Cartesian3.dot(this._xAxis,t),s=i.Cartesian3.dot(this._yAxis,t);return o.defined(n)?(n.x=r,n.y=s,n):new e.Cartesian2(r,s)}},c.prototype.projectPointsOntoPlane=function(t,n){o.defined(n)||(n=[]);let e=0;const i=t.length;for(let r=0;r<i;r++){const i=this.projectPointOntoPlane(t[r],n[e]);o.defined(i)&&(n[e]=i,e++)}return n.length=e,n},c.prototype.projectPointToNearestOnPlane=function(t,n){o.defined(n)||(n=new e.Cartesian2);const s=p;s.origin=t,i.Cartesian3.clone(this._plane.normal,s.direction);let a=r.IntersectionTests.rayPlane(s,this._plane,u);o.defined(a)||(i.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,u));const l=i.Cartesian3.subtract(a,this._origin,a),c=i.Cartesian3.dot(this._xAxis,l),d=i.Cartesian3.dot(this._yAxis,l);return n.x=c,n.y=d,n},c.prototype.projectPointsToNearestOnPlane=function(t,n){o.defined(n)||(n=[]);const e=t.length;n.length=e;for(let i=0;i<e;i++)n[i]=this.projectPointToNearestOnPlane(t[i],n[i]);return n};const f=new i.Cartesian3;c.prototype.projectPointOntoEllipsoid=function(t,n){o.defined(n)||(n=new i.Cartesian3);const e=this._ellipsoid,r=this._origin,s=this._xAxis,a=this._yAxis,l=f;return i.Cartesian3.multiplyByScalar(s,t.x,l),n=i.Cartesian3.add(r,l,n),i.Cartesian3.multiplyByScalar(a,t.y,l),i.Cartesian3.add(n,l,n),e.scaleToGeocentricSurface(n,n),n},c.prototype.projectPointsOntoEllipsoid=function(t,n){const e=t.length;o.defined(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.projectPointOntoEllipsoid(t[i],n[i]);return n},t.EllipsoidTangentPlane=c})); diff --git a/public/lib/Cesium/Workers/EncodedCartesian3-5e2017ab.js b/public/lib/Cesium/Workers/EncodedCartesian3-abad5e8c.js similarity index 91% rename from public/lib/Cesium/Workers/EncodedCartesian3-5e2017ab.js rename to public/lib/Cesium/Workers/EncodedCartesian3-abad5e8c.js index 928b813a..4d07f71d 100644 --- a/public/lib/Cesium/Workers/EncodedCartesian3-5e2017ab.js +++ b/public/lib/Cesium/Workers/EncodedCartesian3-abad5e8c.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da"],(function(e,n,o){"use strict";function i(){this.high=n.Cartesian3.clone(n.Cartesian3.ZERO),this.low=n.Cartesian3.clone(n.Cartesian3.ZERO)}i.encode=function(e,n){let i;return o.defined(n)||(n={high:0,low:0}),e>=0?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};const t={high:0,low:0};i.fromCartesian=function(e,n){o.defined(n)||(n=new i);const h=n.high,a=n.low;return i.encode(e.x,t),h.x=t.high,a.x=t.low,i.encode(e.y,t),h.y=t.high,a.y=t.low,i.encode(e.z,t),h.z=t.high,a.z=t.low,n};const h=new i;i.writeElements=function(e,n,o){i.fromCartesian(e,h);const t=h.high,a=h.low;n[o]=t.x,n[o+1]=t.y,n[o+2]=t.z,n[o+3]=a.x,n[o+4]=a.y,n[o+5]=a.z},e.EncodedCartesian3=i})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da"],(function(e,n,o){"use strict";function i(){this.high=n.Cartesian3.clone(n.Cartesian3.ZERO),this.low=n.Cartesian3.clone(n.Cartesian3.ZERO)}i.encode=function(e,n){let i;return o.defined(n)||(n={high:0,low:0}),e>=0?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};const t={high:0,low:0};i.fromCartesian=function(e,n){o.defined(n)||(n=new i);const h=n.high,a=n.low;return i.encode(e.x,t),h.x=t.high,a.x=t.low,i.encode(e.y,t),h.y=t.high,a.y=t.low,i.encode(e.z,t),h.z=t.high,a.z=t.low,n};const h=new i;i.writeElements=function(e,n,o){i.fromCartesian(e,h);const t=h.high,a=h.low;n[o]=t.x,n[o+1]=t.y,n[o+2]=t.z,n[o+3]=a.x,n[o+4]=a.y,n[o+5]=a.z},e.EncodedCartesian3=i})); diff --git a/public/lib/Cesium/Workers/FrustumGeometry-99a05ec3.js b/public/lib/Cesium/Workers/FrustumGeometry-a659c64b.js similarity index 68% rename from public/lib/Cesium/Workers/FrustumGeometry-99a05ec3.js rename to public/lib/Cesium/Workers/FrustumGeometry-a659c64b.js index e0399003..132c4b15 100644 --- a/public/lib/Cesium/Workers/FrustumGeometry-99a05ec3.js +++ b/public/lib/Cesium/Workers/FrustumGeometry-a659c64b.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix3-81054f0f","./Matrix2-413c4048","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./Math-2ce22ee9","./Plane-6add0ae1","./VertexFormat-fbdec922"],(function(t,e,a,n,i,r,o,s,f,u,l){"use strict";function c(t){this.planes=r.defaultValue(t,[])}const h=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,h[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,h[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,h[2]);const p=new a.Cartesian3,d=new a.Cartesian3,m=new u.Plane(new a.Cartesian3(1,0,0),0);function C(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new c,this._orthographicMatrix=new n.Matrix4}function _(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=n.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}c.fromBoundingSphere=function(t,e){r.defined(e)||(e=new c);const i=h.length,o=e.planes;o.length=2*i;const s=t.center,f=t.radius;let u=0;for(let t=0;t<i;++t){const e=h[t];let i=o[u],l=o[u+1];r.defined(i)||(i=o[u]=new n.Cartesian4),r.defined(l)||(l=o[u+1]=new n.Cartesian4),a.Cartesian3.multiplyByScalar(e,-f,p),a.Cartesian3.add(s,p,p),i.x=e.x,i.y=e.y,i.z=e.z,i.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,f,p),a.Cartesian3.add(s,p,p),l.x=-e.x,l.y=-e.y,l.z=-e.z,l.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,d),p),u+=2}return e},c.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(u.Plane.fromCartesian4(a[i],m));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},c.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===c.MASK_OUTSIDE||a===c.MASK_INSIDE)return a;let n=c.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(u.Plane.fromCartesian4(i[r],m));if(s===e.Intersect.OUTSIDE)return c.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},c.MASK_OUTSIDE=4294967295,c.MASK_INSIDE=0,c.MASK_INDETERMINATE=2147483647,Object.defineProperties(C.prototype,{projectionMatrix:{get:function(){return _(this),this._orthographicMatrix}}});const y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3;function v(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new C,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function M(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new c,this._perspectiveMatrix=new n.Matrix4,this._infinitePerspective=new n.Matrix4}function F(t){const e=t.top,a=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=o,t._far=s,t._perspectiveMatrix=n.Matrix4.computePerspectiveOffCenter(r,i,a,e,o,s,t._perspectiveMatrix),t._infinitePerspective=n.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,o,t._infinitePerspective))}C.prototype.computeCullingVolume=function(t,e,i){const o=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,y);a.Cartesian3.normalize(p,p);const d=g;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=w;a.Cartesian3.multiplyByScalar(p,l,m),a.Cartesian3.add(d,m,m);let C=o[0];return r.defined(C)||(C=o[0]=new n.Cartesian4),C.x=p.x,C.y=p.y,C.z=p.z,C.w=-a.Cartesian3.dot(p,m),a.Cartesian3.multiplyByScalar(p,u,m),a.Cartesian3.add(d,m,m),C=o[1],r.defined(C)||(C=o[1]=new n.Cartesian4),C.x=-p.x,C.y=-p.y,C.z=-p.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(p,x),m),a.Cartesian3.multiplyByScalar(i,f,m),a.Cartesian3.add(d,m,m),C=o[2],r.defined(C)||(C=o[2]=new n.Cartesian4),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-a.Cartesian3.dot(i,m),a.Cartesian3.multiplyByScalar(i,s,m),a.Cartesian3.add(d,m,m),C=o[3],r.defined(C)||(C=o[3]=new n.Cartesian4),C.x=-i.x,C.y=-i.y,C.z=-i.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(i,x),m),C=o[4],r.defined(C)||(C=o[4]=new n.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,d),a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m),C=o[5],r.defined(C)||(C=o[5]=new n.Cartesian4),C.x=-e.x,C.y=-e.y,C.z=-e.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,x),m),this._cullingVolume},C.prototype.getPixelDimensions=function(t,e,a,n,i){_(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},C.prototype.clone=function(t){return r.defined(t)||(t=new C),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},C.prototype.equals=function(t){return r.defined(t)&&t instanceof C&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},C.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof C&&f.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&f.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&f.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&f.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&f.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&f.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},v.packedLength=4,v.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},v.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new v),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return M(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return M(this),this._offCenterFrustum}}}),v.prototype.computeCullingVolume=function(t,e,a){return M(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},v.prototype.getPixelDimensions=function(t,e,a,n,i){return M(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},v.prototype.clone=function(t){return r.defined(t)||(t=new v),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},v.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof v)&&(M(this),M(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},v.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof v)&&(M(this),M(t),f.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&f.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return F(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return F(this),this._infinitePerspective}}});const V=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3,P=new a.Cartesian3;function z(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function R(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,i){const o=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,V),d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m);const C=P;a.Cartesian3.multiplyByScalar(p,l,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.normalize(C,C),a.Cartesian3.cross(C,i,C),a.Cartesian3.normalize(C,C);let _=o[0];return r.defined(_)||(_=o[0]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(p,u,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(i,C,C),a.Cartesian3.normalize(C,C),_=o[1],r.defined(_)||(_=o[1]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,f,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(p,C,C),a.Cartesian3.normalize(C,C),_=o[2],r.defined(_)||(_=o[2]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,s,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(C,p,C),a.Cartesian3.normalize(C,C),_=o[3],r.defined(_)||(_=o[3]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),_=o[4],r.defined(_)||(_=o[4]=new n.Cartesian4),_.x=e.x,_.y=e.y,_.z=e.z,_.w=-a.Cartesian3.dot(e,d),a.Cartesian3.negate(e,C),_=o[5],r.defined(_)||(_=o[5]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,m),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){F(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&f.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&f.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&f.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&f.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&f.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&f.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},z.packedLength=6,z.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},z.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new z),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return R(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return R(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return R(this),this._fovy}},sseDenominator:{get:function(){return R(this),this._sseDenominator}},offCenterFrustum:{get:function(){return R(this),this._offCenterFrustum}}}),z.prototype.computeCullingVolume=function(t,e,a){return R(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},z.prototype.getPixelDimensions=function(t,e,a,n,i){return R(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},z.prototype.clone=function(t){return r.defined(t)||(t=new z),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},z.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof z)&&(R(this),R(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},z.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof z)&&(R(this),R(t),f.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&f.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};const S=0,T=1;function k(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let u,c;n instanceof z?(u=S,c=z.packedLength):n instanceof v&&(u=T,c=v.packedLength),this._frustumType=u,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+l.VertexFormat.packedLength}k.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,o===S?(z.pack(s,n,i),i+=z.packedLength):(v.pack(s,n,i),i+=v.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,l.VertexFormat.pack(t._vertexFormat,n,i),n[i+=l.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const A=new z,D=new v,I=new e.Quaternion,q=new a.Cartesian3,B=new l.VertexFormat;function L(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}k.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;o===S?(s=z.unpack(t,n,A),n+=z.packedLength):(s=v.unpack(t,n,D),n+=v.packedLength);const f=a.Cartesian3.unpack(t,n,q);n+=a.Cartesian3.packedLength;const u=e.Quaternion.unpack(t,n,I);n+=e.Quaternion.packedLength;const c=l.VertexFormat.unpack(t,n,B),h=1===t[n+=l.VertexFormat.packedLength];if(!r.defined(i))return new k({frustum:s,origin:f,orientation:u,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(u,i._orientation),i._vertexFormat=l.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const N=new a.Matrix3,G=new n.Matrix4,j=new n.Matrix4,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new a.Cartesian3,J=new a.Cartesian3,W=new a.Cartesian3,X=new Array(3),Z=new Array(4);Z[0]=new n.Cartesian4(-1,-1,1,1),Z[1]=new n.Cartesian4(1,-1,1,1),Z[2]=new n.Cartesian4(1,1,1,1),Z[3]=new n.Cartesian4(-1,1,1,1);const H=new Array(4);for(let t=0;t<4;++t)H[t]=new n.Cartesian4;k._computeNearFarPlanes=function(t,e,i,o,s,f,u,l){const c=a.Matrix3.fromQuaternion(e,N);let h=r.defaultValue(f,U),p=r.defaultValue(u,Q),d=r.defaultValue(l,K);h=a.Matrix3.getColumn(c,0,h),p=a.Matrix3.getColumn(c,1,p),d=a.Matrix3.getColumn(c,2,d),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.normalize(d,d),a.Cartesian3.negate(h,h);const m=n.Matrix4.computeView(t,d,p,h,G);let C,_;const y=o.projectionMatrix;if(i===S){const t=n.Matrix4.multiply(y,m,j);_=n.Matrix4.inverse(t,j)}else C=n.Matrix4.inverseTransformation(m,j);r.defined(_)?(X[0]=o.near,X[1]=o.far):(X[0]=0,X[1]=o.near,X[2]=o.far);for(let e=0;e<2;++e)for(let i=0;i<4;++i){let f=n.Cartesian4.clone(Z[i],H[i]);if(r.defined(_)){f=n.Matrix4.multiplyByVector(_,f,f);const i=1/f.w;a.Cartesian3.multiplyByScalar(f,i,f),a.Cartesian3.subtract(f,t,f),a.Cartesian3.normalize(f,f);const r=a.Cartesian3.dot(d,f);a.Cartesian3.multiplyByScalar(f,X[e]/r,f),a.Cartesian3.add(f,t,f)}else{const t=o.offCenterFrustum;r.defined(t)&&(o=t);const a=X[e],i=X[e+1];f.x=.5*(f.x*(o.right-o.left)+o.left+o.right),f.y=.5*(f.y*(o.top-o.bottom)+o.bottom+o.top),f.z=.5*(f.z*(a-i)-a-i),f.w=1,n.Matrix4.multiplyByVector(C,f,f)}s[12*e+3*i]=f.x,s[12*e+3*i+1]=f.y,s[12*e+3*i+2]=f.z}},k.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);k._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=U,u=Q,l=K,d=a.Cartesian3.negate(f,Y),_=a.Cartesian3.negate(u,J),y=a.Cartesian3.negate(l,W);m=0,c&&(L(m,t,e,n,s,y,f,u),m+=12),L(m,t,e,n,s,l,d,u),m+=12,L(m,t,e,n,s,d,y,u),m+=12,L(m,t,e,n,s,_,y,d),m+=12,L(m,t,e,n,s,f,l,u),m+=12,L(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=k,t.OrthographicFrustum=v,t.PerspectiveFrustum=z})); +define(["exports","./Transforms-f17097e5","./Matrix3-b2351961","./Matrix2-7a8e9daf","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./Math-355606c6","./Plane-5931b53e","./VertexFormat-fbdec922"],(function(t,e,a,n,i,r,o,s,f,u,l){"use strict";function c(t){this.planes=r.defaultValue(t,[])}const h=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,h[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,h[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,h[2]);const p=new a.Cartesian3,d=new a.Cartesian3,m=new u.Plane(new a.Cartesian3(1,0,0),0);function C(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new c,this._orthographicMatrix=new n.Matrix4}function _(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=n.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}c.fromBoundingSphere=function(t,e){r.defined(e)||(e=new c);const i=h.length,o=e.planes;o.length=2*i;const s=t.center,f=t.radius;let u=0;for(let t=0;t<i;++t){const e=h[t];let i=o[u],l=o[u+1];r.defined(i)||(i=o[u]=new n.Cartesian4),r.defined(l)||(l=o[u+1]=new n.Cartesian4),a.Cartesian3.multiplyByScalar(e,-f,p),a.Cartesian3.add(s,p,p),i.x=e.x,i.y=e.y,i.z=e.z,i.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,f,p),a.Cartesian3.add(s,p,p),l.x=-e.x,l.y=-e.y,l.z=-e.z,l.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,d),p),u+=2}return e},c.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(u.Plane.fromCartesian4(a[i],m));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},c.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===c.MASK_OUTSIDE||a===c.MASK_INSIDE)return a;let n=c.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(u.Plane.fromCartesian4(i[r],m));if(s===e.Intersect.OUTSIDE)return c.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},c.MASK_OUTSIDE=4294967295,c.MASK_INSIDE=0,c.MASK_INDETERMINATE=2147483647,Object.defineProperties(C.prototype,{projectionMatrix:{get:function(){return _(this),this._orthographicMatrix}}});const y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3;function v(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new C,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function M(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new c,this._perspectiveMatrix=new n.Matrix4,this._infinitePerspective=new n.Matrix4}function F(t){const e=t.top,a=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=o,t._far=s,t._perspectiveMatrix=n.Matrix4.computePerspectiveOffCenter(r,i,a,e,o,s,t._perspectiveMatrix),t._infinitePerspective=n.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,o,t._infinitePerspective))}C.prototype.computeCullingVolume=function(t,e,i){const o=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,y);a.Cartesian3.normalize(p,p);const d=g;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=w;a.Cartesian3.multiplyByScalar(p,l,m),a.Cartesian3.add(d,m,m);let C=o[0];return r.defined(C)||(C=o[0]=new n.Cartesian4),C.x=p.x,C.y=p.y,C.z=p.z,C.w=-a.Cartesian3.dot(p,m),a.Cartesian3.multiplyByScalar(p,u,m),a.Cartesian3.add(d,m,m),C=o[1],r.defined(C)||(C=o[1]=new n.Cartesian4),C.x=-p.x,C.y=-p.y,C.z=-p.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(p,x),m),a.Cartesian3.multiplyByScalar(i,f,m),a.Cartesian3.add(d,m,m),C=o[2],r.defined(C)||(C=o[2]=new n.Cartesian4),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-a.Cartesian3.dot(i,m),a.Cartesian3.multiplyByScalar(i,s,m),a.Cartesian3.add(d,m,m),C=o[3],r.defined(C)||(C=o[3]=new n.Cartesian4),C.x=-i.x,C.y=-i.y,C.z=-i.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(i,x),m),C=o[4],r.defined(C)||(C=o[4]=new n.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,d),a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m),C=o[5],r.defined(C)||(C=o[5]=new n.Cartesian4),C.x=-e.x,C.y=-e.y,C.z=-e.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,x),m),this._cullingVolume},C.prototype.getPixelDimensions=function(t,e,a,n,i){_(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},C.prototype.clone=function(t){return r.defined(t)||(t=new C),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},C.prototype.equals=function(t){return r.defined(t)&&t instanceof C&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},C.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof C&&f.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&f.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&f.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&f.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&f.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&f.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},v.packedLength=4,v.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},v.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new v),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return M(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return M(this),this._offCenterFrustum}}}),v.prototype.computeCullingVolume=function(t,e,a){return M(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},v.prototype.getPixelDimensions=function(t,e,a,n,i){return M(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},v.prototype.clone=function(t){return r.defined(t)||(t=new v),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},v.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof v)&&(M(this),M(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},v.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof v)&&(M(this),M(t),f.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&f.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return F(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return F(this),this._infinitePerspective}}});const V=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3,P=new a.Cartesian3;function z(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function R(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,i){const o=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,V),d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m);const C=P;a.Cartesian3.multiplyByScalar(p,l,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.normalize(C,C),a.Cartesian3.cross(C,i,C),a.Cartesian3.normalize(C,C);let _=o[0];return r.defined(_)||(_=o[0]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(p,u,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(i,C,C),a.Cartesian3.normalize(C,C),_=o[1],r.defined(_)||(_=o[1]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,f,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(p,C,C),a.Cartesian3.normalize(C,C),_=o[2],r.defined(_)||(_=o[2]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,s,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(C,p,C),a.Cartesian3.normalize(C,C),_=o[3],r.defined(_)||(_=o[3]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),_=o[4],r.defined(_)||(_=o[4]=new n.Cartesian4),_.x=e.x,_.y=e.y,_.z=e.z,_.w=-a.Cartesian3.dot(e,d),a.Cartesian3.negate(e,C),_=o[5],r.defined(_)||(_=o[5]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,m),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){F(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&f.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&f.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&f.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&f.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&f.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&f.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},z.packedLength=6,z.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},z.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new z),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return R(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return R(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return R(this),this._fovy}},sseDenominator:{get:function(){return R(this),this._sseDenominator}},offCenterFrustum:{get:function(){return R(this),this._offCenterFrustum}}}),z.prototype.computeCullingVolume=function(t,e,a){return R(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},z.prototype.getPixelDimensions=function(t,e,a,n,i){return R(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},z.prototype.clone=function(t){return r.defined(t)||(t=new z),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},z.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof z)&&(R(this),R(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},z.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof z)&&(R(this),R(t),f.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&f.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function S(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let u,c;n instanceof z?(u=0,c=z.packedLength):n instanceof v&&(u=1,c=v.packedLength),this._frustumType=u,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+l.VertexFormat.packedLength}S.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,0===o?(z.pack(s,n,i),i+=z.packedLength):(v.pack(s,n,i),i+=v.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,l.VertexFormat.pack(t._vertexFormat,n,i),n[i+=l.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const T=new z,k=new v,A=new e.Quaternion,D=new a.Cartesian3,I=new l.VertexFormat;function q(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}S.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;0===o?(s=z.unpack(t,n,T),n+=z.packedLength):(s=v.unpack(t,n,k),n+=v.packedLength);const f=a.Cartesian3.unpack(t,n,D);n+=a.Cartesian3.packedLength;const u=e.Quaternion.unpack(t,n,A);n+=e.Quaternion.packedLength;const c=l.VertexFormat.unpack(t,n,I),h=1===t[n+=l.VertexFormat.packedLength];if(!r.defined(i))return new S({frustum:s,origin:f,orientation:u,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(u,i._orientation),i._vertexFormat=l.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const B=new a.Matrix3,L=new n.Matrix4,N=new n.Matrix4,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new a.Cartesian3,J=new Array(3),W=new Array(4);W[0]=new n.Cartesian4(-1,-1,1,1),W[1]=new n.Cartesian4(1,-1,1,1),W[2]=new n.Cartesian4(1,1,1,1),W[3]=new n.Cartesian4(-1,1,1,1);const X=new Array(4);for(let t=0;t<4;++t)X[t]=new n.Cartesian4;S._computeNearFarPlanes=function(t,e,i,o,s,f,u,l){const c=a.Matrix3.fromQuaternion(e,B);let h=r.defaultValue(f,G),p=r.defaultValue(u,j),d=r.defaultValue(l,U);h=a.Matrix3.getColumn(c,0,h),p=a.Matrix3.getColumn(c,1,p),d=a.Matrix3.getColumn(c,2,d),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.normalize(d,d),a.Cartesian3.negate(h,h);const m=n.Matrix4.computeView(t,d,p,h,L);let C,_;const y=o.projectionMatrix;if(0===i){const t=n.Matrix4.multiply(y,m,N);_=n.Matrix4.inverse(t,N)}else C=n.Matrix4.inverseTransformation(m,N);r.defined(_)?(J[0]=o.near,J[1]=o.far):(J[0]=0,J[1]=o.near,J[2]=o.far);for(let e=0;e<2;++e)for(let i=0;i<4;++i){let f=n.Cartesian4.clone(W[i],X[i]);if(r.defined(_)){f=n.Matrix4.multiplyByVector(_,f,f);const i=1/f.w;a.Cartesian3.multiplyByScalar(f,i,f),a.Cartesian3.subtract(f,t,f),a.Cartesian3.normalize(f,f);const r=a.Cartesian3.dot(d,f);a.Cartesian3.multiplyByScalar(f,J[e]/r,f),a.Cartesian3.add(f,t,f)}else{const t=o.offCenterFrustum;r.defined(t)&&(o=t);const a=J[e],i=J[e+1];f.x=.5*(f.x*(o.right-o.left)+o.left+o.right),f.y=.5*(f.y*(o.top-o.bottom)+o.bottom+o.top),f.z=.5*(f.z*(a-i)-a-i),f.w=1,n.Matrix4.multiplyByVector(C,f,f)}s[12*e+3*i]=f.x,s[12*e+3*i+1]=f.y,s[12*e+3*i+2]=f.z}},S.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);S._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=G,u=j,l=U,d=a.Cartesian3.negate(f,Q),_=a.Cartesian3.negate(u,K),y=a.Cartesian3.negate(l,Y);m=0,c&&(q(m,t,e,n,s,y,f,u),m+=12),q(m,t,e,n,s,l,d,u),m+=12,q(m,t,e,n,s,d,y,u),m+=12,q(m,t,e,n,s,_,y,d),m+=12,q(m,t,e,n,s,f,l,u),m+=12,q(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=S,t.OrthographicFrustum=v,t.PerspectiveFrustum=z})); diff --git a/public/lib/Cesium/Workers/GeometryAttribute-12713b29.js b/public/lib/Cesium/Workers/GeometryAttribute-9c1a6bab.js similarity index 96% rename from public/lib/Cesium/Workers/GeometryAttribute-12713b29.js rename to public/lib/Cesium/Workers/GeometryAttribute-9c1a6bab.js index ef4cb4cf..39c0e310 100644 --- a/public/lib/Cesium/Workers/GeometryAttribute-12713b29.js +++ b/public/lib/Cesium/Workers/GeometryAttribute-9c1a6bab.js @@ -1 +1 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./Transforms-b3716b06"],(function(t,e,n,a,r,i){"use strict";var o=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const s={POINTS:r.WebGLConstants.POINTS,LINES:r.WebGLConstants.LINES,LINE_LOOP:r.WebGLConstants.LINE_LOOP,LINE_STRIP:r.WebGLConstants.LINE_STRIP,TRIANGLES:r.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:r.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:r.WebGLConstants.TRIANGLE_FAN,isLines:function(t){return t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP},isTriangles:function(t){return t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN},validate:function(t){return t===s.POINTS||t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP||t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN}};var u=Object.freeze(s);function I(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,u.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,o.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}I.computeNumberOfVertices=function(t){let e=-1;for(const n in t.attributes)if(t.attributes.hasOwnProperty(n)&&a.defined(t.attributes[n])&&a.defined(t.attributes[n].values)){const a=t.attributes[n];e=a.values.length/a.componentsPerAttribute}return e};const N=new n.Cartographic,T=new n.Cartesian3,l=new e.Matrix4,c=[new n.Cartographic,new n.Cartographic,new n.Cartographic],L=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],f=new n.Cartesian3,p=new i.Quaternion,m=new e.Matrix4,y=new e.Matrix2;I._textureCoordinateRotationPoints=function(t,a,r,o){let s;const u=e.Rectangle.center(o,N),I=n.Cartographic.toCartesian(u,r,T),C=i.Transforms.eastNorthUpToFixedFrame(I,r,l),b=e.Matrix4.inverse(C,l),h=L,A=c;A[0].longitude=o.west,A[0].latitude=o.south,A[1].longitude=o.west,A[1].latitude=o.north,A[2].longitude=o.east,A[2].latitude=o.south;let x=f;for(s=0;s<3;s++)n.Cartographic.toCartesian(A[s],r,x),x=e.Matrix4.multiplyByPointAsVector(b,x,x),h[s].x=x.x,h[s].y=x.y;const S=i.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,-a,p),d=n.Matrix3.fromQuaternion(S,m),P=t.length;let G=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(s=0;s<P;s++)x=e.Matrix4.multiplyByPointAsVector(b,t[s],x),x=n.Matrix3.multiplyByVector(d,x,x),G=Math.min(G,x.x),R=Math.min(R,x.y),_=Math.max(_,x.x),O=Math.max(O,x.y);const g=e.Matrix2.fromRotation(a,y),w=E;w[0].x=G,w[0].y=R,w[1].x=G,w[1].y=O,w[2].x=_,w[2].y=R;const V=h[0],M=h[2].x-V.x,v=h[1].y-V.y;for(s=0;s<3;s++){const t=w[s];e.Matrix2.multiplyByVector(g,t,t),t.x=(t.x-V.x)/M,t.y=(t.y-V.y)/v}const F=w[0],W=w[1],Y=w[2],B=new Array(6);return e.Cartesian2.pack(F,B),e.Cartesian2.pack(W,B,2),e.Cartesian2.pack(Y,B,4),B},t.Geometry=I,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=o,t.PrimitiveType=u})); +define(["exports","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./Transforms-f17097e5"],(function(t,e,n,a,r,i){"use strict";var o=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const s={POINTS:r.WebGLConstants.POINTS,LINES:r.WebGLConstants.LINES,LINE_LOOP:r.WebGLConstants.LINE_LOOP,LINE_STRIP:r.WebGLConstants.LINE_STRIP,TRIANGLES:r.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:r.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:r.WebGLConstants.TRIANGLE_FAN,isLines:function(t){return t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP},isTriangles:function(t){return t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN},validate:function(t){return t===s.POINTS||t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP||t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN}};var u=Object.freeze(s);function I(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,u.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,o.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}I.computeNumberOfVertices=function(t){let e=-1;for(const n in t.attributes)if(t.attributes.hasOwnProperty(n)&&a.defined(t.attributes[n])&&a.defined(t.attributes[n].values)){const a=t.attributes[n];e=a.values.length/a.componentsPerAttribute}return e};const N=new n.Cartographic,T=new n.Cartesian3,l=new e.Matrix4,c=[new n.Cartographic,new n.Cartographic,new n.Cartographic],L=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],f=new n.Cartesian3,p=new i.Quaternion,m=new e.Matrix4,y=new e.Matrix2;I._textureCoordinateRotationPoints=function(t,a,r,o){let s;const u=e.Rectangle.center(o,N),I=n.Cartographic.toCartesian(u,r,T),C=i.Transforms.eastNorthUpToFixedFrame(I,r,l),b=e.Matrix4.inverse(C,l),h=L,A=c;A[0].longitude=o.west,A[0].latitude=o.south,A[1].longitude=o.west,A[1].latitude=o.north,A[2].longitude=o.east,A[2].latitude=o.south;let x=f;for(s=0;s<3;s++)n.Cartographic.toCartesian(A[s],r,x),x=e.Matrix4.multiplyByPointAsVector(b,x,x),h[s].x=x.x,h[s].y=x.y;const S=i.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,-a,p),d=n.Matrix3.fromQuaternion(S,m),P=t.length;let G=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(s=0;s<P;s++)x=e.Matrix4.multiplyByPointAsVector(b,t[s],x),x=n.Matrix3.multiplyByVector(d,x,x),G=Math.min(G,x.x),R=Math.min(R,x.y),_=Math.max(_,x.x),O=Math.max(O,x.y);const g=e.Matrix2.fromRotation(a,y),w=E;w[0].x=G,w[0].y=R,w[1].x=G,w[1].y=O,w[2].x=_,w[2].y=R;const V=h[0],M=h[2].x-V.x,v=h[1].y-V.y;for(s=0;s<3;s++){const t=w[s];e.Matrix2.multiplyByVector(g,t,t),t.x=(t.x-V.x)/M,t.y=(t.y-V.y)/v}const F=w[0],W=w[1],Y=w[2],B=new Array(6);return e.Cartesian2.pack(F,B),e.Cartesian2.pack(W,B,2),e.Cartesian2.pack(Y,B,4),B},t.Geometry=I,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=o,t.PrimitiveType=u})); diff --git a/public/lib/Cesium/Workers/GeometryInstance-0318e0cd.js b/public/lib/Cesium/Workers/GeometryInstance-c4920693.js similarity index 85% rename from public/lib/Cesium/Workers/GeometryInstance-0318e0cd.js rename to public/lib/Cesium/Workers/GeometryInstance-c4920693.js index 869a9990..8d25174e 100644 --- a/public/lib/Cesium/Workers/GeometryInstance-0318e0cd.js +++ b/public/lib/Cesium/Workers/GeometryInstance-c4920693.js @@ -1 +1 @@ -define(["exports","./defaultValue-f6d5e6da","./Matrix2-413c4048"],(function(e,t,i){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=i.Matrix4.clone(t.defaultValue(e.modelMatrix,i.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}})); +define(["exports","./defaultValue-f6d5e6da","./Matrix2-7a8e9daf"],(function(e,t,i){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=i.Matrix4.clone(t.defaultValue(e.modelMatrix,i.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}})); diff --git a/public/lib/Cesium/Workers/GeometryPipeline-fea557d0.js b/public/lib/Cesium/Workers/GeometryPipeline-a9233ae3.js similarity index 98% rename from public/lib/Cesium/Workers/GeometryPipeline-fea557d0.js rename to public/lib/Cesium/Workers/GeometryPipeline-a9233ae3.js index b6bb8fd9..b953d5ba 100644 --- a/public/lib/Cesium/Workers/GeometryPipeline-fea557d0.js +++ b/public/lib/Cesium/Workers/GeometryPipeline-a9233ae3.js @@ -1 +1 @@ -define(["exports","./AttributeCompression-48e336db","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./EncodedCartesian3-5e2017ab","./GeometryAttribute-12713b29","./IndexDatatype-d3db4e7d","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,n,i,r,a,s,o,u,c,l,p,d){"use strict";const y=new i.Cartesian3,f=new i.Cartesian3,m=new i.Cartesian3;const C={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};C.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let y;for(y=0;y<u;y++)d[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let f=0;for(;c<p;)d[t[c]].vertexTriangles.push(f),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(f),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(f),++d[t[c+2]].numLiveTriangles,++f,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(y=0;y<x;y++)P[y]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(f=g.vertexTriangles[e],!P[f]){P[f]=!0,c=f+f+f;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};var h=C;const v={};function b(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function g(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new c.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function A(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}v.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case c.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=l.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)b(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case c.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=l.IndexDatatype.createTypedArray(t,n);b(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)b(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case c.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=l.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)b(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=c.PrimitiveType.LINES}return e},v.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,a=e.attributes[t].values,u=i.length,l=new Float64Array(2*u);let p,d=0;for(let e=0;e<u;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+a[e]*n,l[d++]=i[e+1]+a[e+1]*n,l[d++]=i[e+2]+a[e+2]*n;const y=e.boundingSphere;return r.defined(y)&&(p=new s.BoundingSphere(y.center,y.radius+n)),new c.Geometry({attributes:{position:new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:c.PrimitiveType.LINES,boundingSphere:p})},v.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},v.reorderForPreVertexCache=function(e){const t=c.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const a=n,s=a.length,u=l.IndexDatatype.createTypedArray(t,s);let c,p=0,d=0,y=0;for(;p<s;)c=i[a[p]],-1!==c?u[d]=c:(c=a[p],i[c]=y,u[d]=y,++y),++p,++d;e.indices=u;const f=e.attributes;for(const e in f)if(f.hasOwnProperty(e)&&r.defined(f[e])&&r.defined(f[e].values)){const n=f[e],r=n.values;let a=0;const s=n.componentsPerAttribute,u=o.ComponentDatatype.createTypedArray(n.componentDatatype,y*s);for(;a<t;){const e=i[a];if(-1!==e)for(let t=0;t<s;t++)u[s*e+t]=r[s*a+t];++a}n.values=u}}return e},v.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===c.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=h.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},v.fitToUnsignedShortIndices=function(e){const t=[],n=c.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=g(e.attributes);const u=e.indices,l=u.length;let p;e.primitiveType===c.PrimitiveType.TRIANGLES?p=3:e.primitiveType===c.PrimitiveType.LINES?p=2:e.primitiveType===c.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=u[d+t];let c=n[a];r.defined(c)||(c=s++,n[a]=c,A(o,e.attributes,a)),i.push(c)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new c.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=g(e.attributes))}0!==i.length&&t.push(new c.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const T=new i.Cartesian3,x=new i.Cartographic;v.projectTo2D=function(e,t,n,a,u){const l=e.attributes[t],p=(u=r.defined(u)?u:new s.GeographicProjection).ellipsoid,d=l.values,y=new Float64Array(d.length);let f=0;for(let e=0;e<d.length;e+=3){const t=i.Cartesian3.fromArray(d,e,T),n=p.cartesianToCartographic(t,x),r=u.project(n,T);y[f++]=r.x,y[f++]=r.y,y[f++]=r.z}return e.attributes[n]=l,e.attributes[a]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),delete e.attributes[t],e};const P={high:0,low:0};v.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],a=r.values,s=a.length,l=new Float32Array(s),p=new Float32Array(s);for(let e=0;e<s;++e)u.EncodedCartesian3.encode(a[e],P),l[e]=P.high,p[e]=P.low;const d=r.componentsPerAttribute;return e.attributes[n]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let w=new i.Cartesian3;function S(e,t){if(r.defined(t)){const r=t.values,a=r.length;for(let t=0;t<a;t+=3)i.Cartesian3.unpack(r,t,w),n.Matrix4.multiplyByPoint(e,w,w),i.Cartesian3.pack(w,r,t)}}function I(e,t){if(r.defined(t)){const n=t.values,r=n.length;for(let t=0;t<r;t+=3)i.Cartesian3.unpack(n,t,w),i.Matrix3.multiplyByVector(e,w,w),w=i.Cartesian3.normalize(w,w),i.Cartesian3.pack(w,n,t)}}const O=new n.Matrix4,E=new i.Matrix3;v.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;S(t,i.position),S(t,i.prevPosition),S(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,O),n.Matrix4.transpose(O,O),n.Matrix4.getMatrix3(O,E),I(E,i.normal),I(E,i.tangent),I(E,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const N=new i.Cartesian3;function L(e,t){const n=e.length;let a,u,p,d;e[0].modelMatrix;const y=r.defined(e[0][t].indices),f=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},a=e[0][t].attributes;let s;for(s in a)if(a.hasOwnProperty(s)&&r.defined(a[s])&&r.defined(a[s].values)){const u=a[s];let l=u.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[s];if(!r.defined(n)||u.componentDatatype!==n.componentDatatype||u.componentsPerAttribute!==n.componentsPerAttribute||u.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[s]=new c.GeometryAttribute({componentDatatype:u.componentDatatype,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:o.ComponentDatatype.createTypedArray(u.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(a in m)if(m.hasOwnProperty(a))for(C=m[a].values,d=0,u=0;u<n;++u)for(h=e[u][t].attributes[a].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(y){let i=0;for(u=0;u<n;++u)i+=e[u][t].indices.length;const r=c.Geometry.computeNumberOfVertices(new c.Geometry({attributes:m,primitiveType:c.PrimitiveType.POINTS})),a=l.IndexDatatype.createTypedArray(r,i);let s=0,o=0;for(u=0;u<n;++u){const n=e[u][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=c.Geometry.computeNumberOfVertices(e[u][t])}b=a}let g,A=new i.Cartesian3,T=0;for(u=0;u<n;++u){if(g=e[u][t].boundingSphere,!r.defined(g)){A=void 0;break}i.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(i.Cartesian3.divideByScalar(A,n,A),u=0;u<n;++u){g=e[u][t].boundingSphere;const n=i.Cartesian3.magnitude(i.Cartesian3.subtract(g.center,A,N))+g.radius;n>T&&(T=n)}return new c.Geometry({attributes:m,indices:b,primitiveType:f,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}v.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(L(t,"geometry")),n.length>0&&(a.push(L(n,"westHemisphereGeometry")),a.push(L(n,"eastHemisphereGeometry"))),a};const M=new i.Cartesian3,z=new i.Cartesian3,D=new i.Cartesian3,G=new i.Cartesian3;v.computeNormal=function(e){const t=e.indices,n=e.attributes,r=n.position.values,s=n.position.values.length/3,u=t.length,l=new Array(s),p=new Array(u/3),d=new Array(u);let y;for(y=0;y<s;y++)l[y]={indexOffset:0,count:0,currentCount:0};let f=0;for(y=0;y<u;y+=3){const e=t[y],n=t[y+1],a=t[y+2],s=3*e,o=3*n,u=3*a;z.x=r[s],z.y=r[s+1],z.z=r[s+2],D.x=r[o],D.y=r[o+1],D.z=r[o+2],G.x=r[u],G.y=r[u+1],G.z=r[u+2],l[e].count++,l[n].count++,l[a].count++,i.Cartesian3.subtract(D,z,D),i.Cartesian3.subtract(G,z,G),p[f]=i.Cartesian3.cross(D,G,new i.Cartesian3),f++}let m,C=0;for(y=0;y<s;y++)l[y].indexOffset+=C,C+=l[y].count;for(f=0,y=0;y<u;y+=3){m=l[t[y]];let e=m.indexOffset+m.currentCount;d[e]=f,m.currentCount++,m=l[t[y+1]],e=m.indexOffset+m.currentCount,d[e]=f,m.currentCount++,m=l[t[y+2]],e=m.indexOffset+m.currentCount,d[e]=f,m.currentCount++,f++}const h=new Float32Array(3*s);for(y=0;y<s;y++){const e=3*y;if(m=l[y],i.Cartesian3.clone(i.Cartesian3.ZERO,M),m.count>0){for(f=0;f<m.count;f++)i.Cartesian3.add(M,p[d[m.indexOffset+f]],M);i.Cartesian3.equalsEpsilon(i.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&i.Cartesian3.clone(p[d[m.indexOffset]],M)}i.Cartesian3.equalsEpsilon(i.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&(M.z=1),i.Cartesian3.normalize(M,M),h[e]=M.x,h[e+1]=M.y,h[e+2]=M.z}return e.attributes.normal=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h}),e};const V=new i.Cartesian3,R=new i.Cartesian3,F=new i.Cartesian3;v.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,n=e.attributes.position.values,r=e.attributes.normal.values,a=e.attributes.st.values,s=e.attributes.position.values.length/3,u=t.length,l=new Array(3*s);let p,d,y,f;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<u;p+=3){const e=t[p],i=t[p+1],r=t[p+2];d=3*e,y=3*i,f=3*r;const s=2*e,o=2*i,u=2*r,c=n[d],m=n[d+1],C=n[d+2],h=a[s],v=a[s+1],b=a[o+1]-v,g=a[u+1]-v,A=1/((a[o]-h)*g-(a[u]-h)*b),T=(g*(n[y]-c)-b*(n[f]-c))*A,x=(g*(n[y+1]-m)-b*(n[f+1]-m))*A,P=(g*(n[y+2]-C)-b*(n[f+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P}const m=new Float32Array(3*s),C=new Float32Array(3*s);for(p=0;p<s;p++){d=3*p,y=d+1,f=d+2;const e=i.Cartesian3.fromArray(r,d,V),t=i.Cartesian3.fromArray(l,d,F),n=i.Cartesian3.dot(e,t);i.Cartesian3.multiplyByScalar(e,n,R),i.Cartesian3.normalize(i.Cartesian3.subtract(t,R,t),t),m[d]=t.x,m[y]=t.y,m[f]=t.z,i.Cartesian3.normalize(i.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[y]=t.y,C[f]=t.z}return e.attributes.tangent=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const B=new n.Cartesian2,_=new i.Cartesian3,k=new i.Cartesian3,q=new i.Cartesian3;let U=new n.Cartesian2;function Y(e){switch(e.primitiveType){case c.PrimitiveType.TRIANGLE_FAN:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=c.PrimitiveType.TRIANGLES,e}(e);case c.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=c.PrimitiveType.TRIANGLES,e}(e);case c.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case c.PrimitiveType.LINE_STRIP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=c.PrimitiveType.LINES,e}(e);case c.PrimitiveType.LINE_LOOP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=c.PrimitiveType.LINES,e}(e);case c.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function Z(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}v.compressVertices=function(e){const a=e.attributes.extrudeDirection;let s,u;if(r.defined(a)){const n=a.values;u=n.length/3;const r=new Float32Array(2*u);let l=0;for(s=0;s<u;++s)i.Cartesian3.fromArray(n,3*s,_),i.Cartesian3.equals(_,i.Cartesian3.ZERO)?l+=2:(U=t.AttributeCompression.octEncodeInRange(_,65535,U),r[l++]=U.x,r[l++]=U.y);return e.attributes.compressedAttributes=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:r}),delete e.attributes.extrudeDirection,e}const l=e.attributes.normal,p=e.attributes.st,d=r.defined(l),y=r.defined(p);if(!d&&!y)return e;const f=e.attributes.tangent,m=e.attributes.bitangent,C=r.defined(f),h=r.defined(m);let v,b,g,A;d&&(v=l.values),y&&(b=p.values),C&&(g=f.values),h&&(A=m.values);u=(d?v.length:b.length)/(d?3:2);let T=u,x=y&&d?2:1;x+=C||h?1:0,T*=x;const P=new Float32Array(T);let w=0;for(s=0;s<u;++s){y&&(n.Cartesian2.fromArray(b,2*s,B),P[w++]=t.AttributeCompression.compressTextureCoordinates(B));const e=3*s;d&&r.defined(g)&&r.defined(A)?(i.Cartesian3.fromArray(v,e,_),i.Cartesian3.fromArray(g,e,k),i.Cartesian3.fromArray(A,e,q),t.AttributeCompression.octPack(_,k,q,B),P[w++]=B.x,P[w++]=B.y):(d&&(i.Cartesian3.fromArray(v,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)),C&&(i.Cartesian3.fromArray(g,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)),h&&(i.Cartesian3.fromArray(A,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)))}return e.attributes.compressedAttributes=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:x,values:P}),d&&delete e.attributes.normal,y&&delete e.attributes.st,h&&delete e.attributes.bitangent,C&&delete e.attributes.tangent,e};const H=new i.Cartesian3;function W(e,t,n,r){i.Cartesian3.add(e,i.Cartesian3.multiplyByScalar(i.Cartesian3.subtract(t,e,H),e.y/(e.y-t.y),H),n),i.Cartesian3.clone(n,r),Z(n,!0),Z(r,!1)}const X=new i.Cartesian3,j=new i.Cartesian3,J=new i.Cartesian3,K=new i.Cartesian3,Q={positions:new Array(7),indices:new Array(9)};function $(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return Z(e,e.y<0),Z(t,t.y<0),void Z(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;Z(e,u),Z(t,u),Z(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=Q.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(W(e,t,X,J),W(e,n,j,K),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(W(t,n,X,J),W(t,e,j,K),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(W(n,e,X,J),W(n,t,j,K),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(W(n,e,X,J),W(n,t,j,K),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,n,X,J),W(t,e,j,K),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,X,J),W(e,n,j,K),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=Q.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=X,c[4]=j,c[5]=J,c[6]=K,c.length=7),Q}function ee(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=o.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=c.Geometry.computeNumberOfVertices(e);return e.indices=l.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function te(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new c.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new c.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ne(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=ee(t,i),n=ee(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function ie(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const y=e.fromArray(c,a*t,n),f=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(y,u.x,y),e.multiplyByScalar(f,u.y,f),e.multiplyByScalar(m,u.z,m);const C=e.add(y,f,y);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const re=ie(n.Cartesian4,4),ae=ie(i.Cartesian3,3),se=ie(n.Cartesian2,2),oe=function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0},ue=new i.Cartesian3,ce=new i.Cartesian3,le=new i.Cartesian3,pe=new i.Cartesian3;function de(e,t,s,o,u,c,l,p,d,C,h,v,b,g,A,T){if(!(r.defined(c)||r.defined(l)||r.defined(p)||r.defined(d)||r.defined(C)||0!==g))return;const x=function(e,t,s,o,u){let c,l,p,d,C,h,v,b;if(r.defined(u)||(u=new i.Cartesian3),r.defined(t.z)){if(i.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_X,u);if(i.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Y,u);if(i.Cartesian3.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Z,u);c=i.Cartesian3.subtract(s,t,y),l=i.Cartesian3.subtract(o,t,f),p=i.Cartesian3.subtract(e,t,m),d=i.Cartesian3.dot(c,c),C=i.Cartesian3.dot(c,l),h=i.Cartesian3.dot(c,p),v=i.Cartesian3.dot(l,l),b=i.Cartesian3.dot(l,p)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_X,u);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Y,u);if(n.Cartesian2.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Z,u);c=n.Cartesian2.subtract(s,t,y),l=n.Cartesian2.subtract(o,t,f),p=n.Cartesian2.subtract(e,t,m),d=n.Cartesian2.dot(c,c),C=n.Cartesian2.dot(c,l),h=n.Cartesian2.dot(c,p),v=n.Cartesian2.dot(l,l),b=n.Cartesian2.dot(l,p)}u.y=v*h-C*b,u.z=d*b-C*h;const g=d*v-C*C;if(0!==g)return u.y/=g,u.z/=g,u.x=1-u.y-u.z,u}(o,i.Cartesian3.fromArray(u,3*e,ue),i.Cartesian3.fromArray(u,3*t,ce),i.Cartesian3.fromArray(u,3*s,le),pe);if(r.defined(x)){if(r.defined(c)&&ae(e,t,s,x,c,v.normal.values,T,!0),r.defined(C)){const n=i.Cartesian3.fromArray(C,3*e,ue),r=i.Cartesian3.fromArray(C,3*t,ce),a=i.Cartesian3.fromArray(C,3*s,le);let o;i.Cartesian3.multiplyByScalar(n,x.x,n),i.Cartesian3.multiplyByScalar(r,x.y,r),i.Cartesian3.multiplyByScalar(a,x.z,a),i.Cartesian3.equals(n,i.Cartesian3.ZERO)&&i.Cartesian3.equals(r,i.Cartesian3.ZERO)&&i.Cartesian3.equals(a,i.Cartesian3.ZERO)?(o=ue,o.x=0,o.y=0,o.z=0):(o=i.Cartesian3.add(n,r,n),i.Cartesian3.add(o,a,o),i.Cartesian3.normalize(o,o)),i.Cartesian3.pack(o,v.extrudeDirection.values,3*T)}if(r.defined(h)&&oe(e,t,s,x,h,v.applyOffset.values,T),r.defined(l)&&ae(e,t,s,x,l,v.tangent.values,T,!0),r.defined(p)&&ae(e,t,s,x,p,v.bitangent.values,T,!0),r.defined(d)&&se(e,t,s,x,d,v.st.values,T),g>0)for(let n=0;n<g;n++){const i=b[n];ye(e,t,s,x,T,A[i],v[i])}}}function ye(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:re(e,t,n,i,u,c,r,!1);break;case 3:ae(e,t,n,i,u,c,r,!1);break;case 2:se(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function fe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const me={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Ce(e){const t=e.geometry,n=t.attributes,a=n.position.values,s=r.defined(n.normal)?n.normal.values:void 0,o=r.defined(n.bitangent)?n.bitangent.values:void 0,u=r.defined(n.tangent)?n.tangent.values:void 0,c=r.defined(n.st)?n.st.values:void 0,l=r.defined(n.extrudeDirection)?n.extrudeDirection.values:void 0,p=r.defined(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,y=[];for(const e in n)n.hasOwnProperty(e)&&!me[e]&&r.defined(n[e])&&y.push(e);const f=y.length,m=te(t),C=te(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=i.Cartesian3.fromArray(a,3*e),S=i.Cartesian3.fromArray(a,3*t),I=i.Cartesian3.fromArray(a,3*P);const O=$(w,S,I);if(r.defined(O)&&O.positions.length>3){const i=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=i[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=fe(h,v,b,d,w<3?A+w:-1,I),de(e,t,P,I,a,s,u,o,c,l,p,h,y,f,n,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=fe(h,v,b,d,A,w),de(e,t,P,w,a,s,u,o,c,l,p,h,y,f,n,g),g=fe(h,v,b,d,A+1,S),de(e,t,P,S,a,s,u,o,c,l,p,h,y,f,n,g),g=fe(h,v,b,d,A+2,I),de(e,t,P,I,a,s,u,o,c,l,p,h,y,f,n,g)}ne(e,C,m)}const he=d.Plane.fromPointNormal(i.Cartesian3.ZERO,i.Cartesian3.UNIT_Y),ve=new i.Cartesian3,be=new i.Cartesian3;function ge(e,t,n,s,o,u,c){if(!r.defined(c))return;const l=i.Cartesian3.fromArray(s,3*e,ue);i.Cartesian3.equalsEpsilon(l,n,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function Ae(e){const t=e.geometry,n=t.attributes,s=n.position.values,o=r.defined(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,c=te(t),l=te(t);let d;const y=u.length,f=[];f.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<f.length;++d)f[d]=-1,m[d]=-1;for(d=0;d<y;d+=2){const e=u[d],t=u[d+1],n=i.Cartesian3.fromArray(s,3*e,ue),y=i.Cartesian3.fromArray(s,3*t,ce);let C;Math.abs(n.y)<a.CesiumMath.EPSILON6&&(n.y<0?n.y=-a.CesiumMath.EPSILON6:n.y=a.CesiumMath.EPSILON6),Math.abs(y.y)<a.CesiumMath.EPSILON6&&(y.y<0?y.y=-a.CesiumMath.EPSILON6:y.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=l.attributes,A=l.indices,T=f;const x=p.IntersectionTests.lineSegmentPlane(n,y,he,le);if(r.defined(x)){const r=i.Cartesian3.multiplyByScalar(i.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,ve);n.y<0&&(i.Cartesian3.negate(r,r),h=l.attributes,v=l.indices,b=f,g=c.attributes,A=c.indices,T=m);const p=i.Cartesian3.add(x,r,be);C=fe(h,v,b,u,d,n),ge(e,t,n,s,C,h,o),C=fe(h,v,b,u,-1,p),ge(e,t,p,s,C,h,o),i.Cartesian3.negate(r,r),i.Cartesian3.add(x,r,p),C=fe(g,A,T,u,-1,p),ge(e,t,p,s,C,g,o),C=fe(g,A,T,u,d+1,y),ge(e,t,y,s,C,g,o)}else{let i,r,a;n.y<0?(i=l.attributes,r=l.indices,a=f):(i=c.attributes,r=c.indices,a=m),C=fe(i,r,a,u,d,n),ge(e,t,n,s,C,i,o),C=fe(i,r,a,u,d+1,y),ge(e,t,y,s,C,i,o)}}ne(e,l,c)}const Te=new n.Cartesian2,xe=new n.Cartesian2,Pe=new i.Cartesian3,we=new i.Cartesian3,Se=new i.Cartesian3,Ie=new i.Cartesian3,Oe=new i.Cartesian3,Ee=new i.Cartesian3,Ne=new n.Cartesian4;function Le(e){const t=e.attributes,n=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=n.length;for(let e=0;e<s;e+=3){const t=i.Cartesian3.unpack(n,e,Pe);if(t.x>0)continue;const o=i.Cartesian3.unpack(r,e,we);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=n[e-3],r[e+1]=n[e-2],r[e+2]=n[e-1]):i.Cartesian3.pack(t,r,e));const u=i.Cartesian3.unpack(a,e,Se);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=n[e+3],a[e+1]=n[e+4],a[e+2]=n[e+5]):i.Cartesian3.pack(t,a,e))}}const Me=5*a.CesiumMath.EPSILON9,ze=a.CesiumMath.EPSILON6;v.splitLongitude=function(e){const t=e.geometry,o=t.boundingSphere;if(r.defined(o)){if(o.center.x-o.radius>0||s.BoundingSphere.intersectPlane(o,d.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==c.GeometryType.NONE)switch(t.geometryType){case c.GeometryType.POLYLINES:!function(e){const t=e.geometry,s=t.attributes,o=s.position.values,u=s.prevPosition.values,c=s.nextPosition.values,l=s.expandAndWidth.values,d=r.defined(s.st)?s.st.values:void 0,y=r.defined(s.color)?s.color.values:void 0,f=te(t),m=te(t);let C,h,v,b=!1;const g=o.length/3;for(C=0;C<g;C+=4){const e=C,t=C+2,s=i.Cartesian3.fromArray(o,3*e,Pe),g=i.Cartesian3.fromArray(o,3*t,we);if(Math.abs(s.y)<ze)for(s.y=ze*(g.y<0?-1:1),o[3*C+1]=s.y,o[3*(C+1)+1]=s.y,h=3*e;h<3*e+12;h+=3)u[h]=o[3*C],u[h+1]=o[3*C+1],u[h+2]=o[3*C+2];if(Math.abs(g.y)<ze)for(g.y=ze*(s.y<0?-1:1),o[3*(C+2)+1]=g.y,o[3*(C+3)+1]=g.y,h=3*e;h<3*e+12;h+=3)c[h]=o[3*(C+2)],c[h+1]=o[3*(C+2)+1],c[h+2]=o[3*(C+2)+2];let A=f.attributes,T=f.indices,x=m.attributes,P=m.indices;const w=p.IntersectionTests.lineSegmentPlane(s,g,he,Ie);if(r.defined(w)){b=!0;const o=i.Cartesian3.multiplyByScalar(i.Cartesian3.UNIT_Y,Me,Oe);s.y<0&&(i.Cartesian3.negate(o,o),A=m.attributes,T=m.indices,x=f.attributes,P=f.indices);const p=i.Cartesian3.add(w,o,Ee);A.position.values.push(s.x,s.y,s.z,s.x,s.y,s.z),A.position.values.push(p.x,p.y,p.z),A.position.values.push(p.x,p.y,p.z),A.prevPosition.values.push(u[3*e],u[3*e+1],u[3*e+2]),A.prevPosition.values.push(u[3*e+3],u[3*e+4],u[3*e+5]),A.prevPosition.values.push(s.x,s.y,s.z,s.x,s.y,s.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),i.Cartesian3.negate(o,o),i.Cartesian3.add(w,o,p),x.position.values.push(p.x,p.y,p.z),x.position.values.push(p.x,p.y,p.z),x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(c[3*t],c[3*t+1],c[3*t+2]),x.nextPosition.values.push(c[3*t+3],c[3*t+4],c[3*t+5]);const S=n.Cartesian2.fromArray(l,2*e,Te),I=Math.abs(S.y);A.expandAndWidth.values.push(-1,I,1,I),A.expandAndWidth.values.push(-1,-I,1,-I),x.expandAndWidth.values.push(-1,I,1,I),x.expandAndWidth.values.push(-1,-I,1,-I);let O=i.Cartesian3.magnitudeSquared(i.Cartesian3.subtract(w,s,Se));if(O/=i.Cartesian3.magnitudeSquared(i.Cartesian3.subtract(g,s,Se)),r.defined(y)){const i=n.Cartesian4.fromArray(y,4*e,Ne),r=n.Cartesian4.fromArray(y,4*t,Ne),s=a.CesiumMath.lerp(i.x,r.x,O),o=a.CesiumMath.lerp(i.y,r.y,O),u=a.CesiumMath.lerp(i.z,r.z,O),c=a.CesiumMath.lerp(i.w,r.w,O);for(h=4*e;h<4*e+8;++h)A.color.values.push(y[h]);for(A.color.values.push(s,o,u,c),A.color.values.push(s,o,u,c),x.color.values.push(s,o,u,c),x.color.values.push(s,o,u,c),h=4*t;h<4*t+8;++h)x.color.values.push(y[h])}if(r.defined(d)){const i=n.Cartesian2.fromArray(d,2*e,Te),r=n.Cartesian2.fromArray(d,2*(C+3),xe),s=a.CesiumMath.lerp(i.x,r.x,O);for(h=2*e;h<2*e+4;++h)A.st.values.push(d[h]);for(A.st.values.push(s,i.y),A.st.values.push(s,r.y),x.st.values.push(s,i.y),x.st.values.push(s,r.y),h=2*t;h<2*t+4;++h)x.st.values.push(d[h])}v=A.position.values.length/3-4,T.push(v,v+2,v+1),T.push(v+1,v+2,v+3),v=x.position.values.length/3-4,P.push(v,v+2,v+1),P.push(v+1,v+2,v+3)}else{let e,t;for(s.y<0?(e=m.attributes,t=m.indices):(e=f.attributes,t=f.indices),e.position.values.push(s.x,s.y,s.z),e.position.values.push(s.x,s.y,s.z),e.position.values.push(g.x,g.y,g.z),e.position.values.push(g.x,g.y,g.z),h=3*C;h<3*C+12;++h)e.prevPosition.values.push(u[h]),e.nextPosition.values.push(c[h]);for(h=2*C;h<2*C+8;++h)e.expandAndWidth.values.push(l[h]),r.defined(d)&&e.st.values.push(d[h]);if(r.defined(y))for(h=4*C;h<4*C+16;++h)e.color.values.push(y[h]);v=e.position.values.length/3-4,t.push(v,v+2,v+1),t.push(v+1,v+2,v+3)}}b&&(Le(m),Le(f)),ne(e,m,f)}(e);break;case c.GeometryType.TRIANGLES:Ce(e);break;case c.GeometryType.LINES:Ae(e)}else Y(t),t.primitiveType===c.PrimitiveType.TRIANGLES?Ce(e):t.primitiveType===c.PrimitiveType.LINES&&Ae(e);return e};var De=v;e.GeometryPipeline=De})); +define(["exports","./AttributeCompression-0b8f7b7d","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./EncodedCartesian3-abad5e8c","./GeometryAttribute-9c1a6bab","./IndexDatatype-a9b1bc18","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,n,i,r,a,s,o,u,c,l,p,d){"use strict";const y=new i.Cartesian3,f=new i.Cartesian3,m=new i.Cartesian3;const C={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};C.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let y;for(y=0;y<u;y++)d[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let f=0;for(;c<p;)d[t[c]].vertexTriangles.push(f),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(f),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(f),++d[t[c+2]].numLiveTriangles,++f,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(y=0;y<x;y++)P[y]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(f=g.vertexTriangles[e],!P[f]){P[f]=!0,c=f+f+f;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};var h=C;const v={};function b(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function g(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new c.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function A(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}v.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case c.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=l.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)b(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case c.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=l.IndexDatatype.createTypedArray(t,n);b(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)b(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case c.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=l.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)b(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=c.PrimitiveType.LINES}return e},v.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,a=e.attributes[t].values,u=i.length,l=new Float64Array(2*u);let p,d=0;for(let e=0;e<u;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+a[e]*n,l[d++]=i[e+1]+a[e+1]*n,l[d++]=i[e+2]+a[e+2]*n;const y=e.boundingSphere;return r.defined(y)&&(p=new s.BoundingSphere(y.center,y.radius+n)),new c.Geometry({attributes:{position:new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:c.PrimitiveType.LINES,boundingSphere:p})},v.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},v.reorderForPreVertexCache=function(e){const t=c.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const a=n,s=a.length,u=l.IndexDatatype.createTypedArray(t,s);let c,p=0,d=0,y=0;for(;p<s;)c=i[a[p]],-1!==c?u[d]=c:(c=a[p],i[c]=y,u[d]=y,++y),++p,++d;e.indices=u;const f=e.attributes;for(const e in f)if(f.hasOwnProperty(e)&&r.defined(f[e])&&r.defined(f[e].values)){const n=f[e],r=n.values;let a=0;const s=n.componentsPerAttribute,u=o.ComponentDatatype.createTypedArray(n.componentDatatype,y*s);for(;a<t;){const e=i[a];if(-1!==e)for(let t=0;t<s;t++)u[s*e+t]=r[s*a+t];++a}n.values=u}}return e},v.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===c.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=h.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},v.fitToUnsignedShortIndices=function(e){const t=[],n=c.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=g(e.attributes);const u=e.indices,l=u.length;let p;e.primitiveType===c.PrimitiveType.TRIANGLES?p=3:e.primitiveType===c.PrimitiveType.LINES?p=2:e.primitiveType===c.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=u[d+t];let c=n[a];r.defined(c)||(c=s++,n[a]=c,A(o,e.attributes,a)),i.push(c)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new c.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=g(e.attributes))}0!==i.length&&t.push(new c.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const T=new i.Cartesian3,x=new i.Cartographic;v.projectTo2D=function(e,t,n,a,u){const l=e.attributes[t],p=(u=r.defined(u)?u:new s.GeographicProjection).ellipsoid,d=l.values,y=new Float64Array(d.length);let f=0;for(let e=0;e<d.length;e+=3){const t=i.Cartesian3.fromArray(d,e,T),n=p.cartesianToCartographic(t,x),r=u.project(n,T);y[f++]=r.x,y[f++]=r.y,y[f++]=r.z}return e.attributes[n]=l,e.attributes[a]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),delete e.attributes[t],e};const P={high:0,low:0};v.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],a=r.values,s=a.length,l=new Float32Array(s),p=new Float32Array(s);for(let e=0;e<s;++e)u.EncodedCartesian3.encode(a[e],P),l[e]=P.high,p[e]=P.low;const d=r.componentsPerAttribute;return e.attributes[n]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let w=new i.Cartesian3;function S(e,t){if(r.defined(t)){const r=t.values,a=r.length;for(let t=0;t<a;t+=3)i.Cartesian3.unpack(r,t,w),n.Matrix4.multiplyByPoint(e,w,w),i.Cartesian3.pack(w,r,t)}}function I(e,t){if(r.defined(t)){const n=t.values,r=n.length;for(let t=0;t<r;t+=3)i.Cartesian3.unpack(n,t,w),i.Matrix3.multiplyByVector(e,w,w),w=i.Cartesian3.normalize(w,w),i.Cartesian3.pack(w,n,t)}}const O=new n.Matrix4,E=new i.Matrix3;v.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;S(t,i.position),S(t,i.prevPosition),S(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,O),n.Matrix4.transpose(O,O),n.Matrix4.getMatrix3(O,E),I(E,i.normal),I(E,i.tangent),I(E,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const N=new i.Cartesian3;function L(e,t){const n=e.length;let a,u,p,d;e[0].modelMatrix;const y=r.defined(e[0][t].indices),f=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},a=e[0][t].attributes;let s;for(s in a)if(a.hasOwnProperty(s)&&r.defined(a[s])&&r.defined(a[s].values)){const u=a[s];let l=u.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[s];if(!r.defined(n)||u.componentDatatype!==n.componentDatatype||u.componentsPerAttribute!==n.componentsPerAttribute||u.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[s]=new c.GeometryAttribute({componentDatatype:u.componentDatatype,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:o.ComponentDatatype.createTypedArray(u.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(a in m)if(m.hasOwnProperty(a))for(C=m[a].values,d=0,u=0;u<n;++u)for(h=e[u][t].attributes[a].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(y){let i=0;for(u=0;u<n;++u)i+=e[u][t].indices.length;const r=c.Geometry.computeNumberOfVertices(new c.Geometry({attributes:m,primitiveType:c.PrimitiveType.POINTS})),a=l.IndexDatatype.createTypedArray(r,i);let s=0,o=0;for(u=0;u<n;++u){const n=e[u][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=c.Geometry.computeNumberOfVertices(e[u][t])}b=a}let g,A=new i.Cartesian3,T=0;for(u=0;u<n;++u){if(g=e[u][t].boundingSphere,!r.defined(g)){A=void 0;break}i.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(i.Cartesian3.divideByScalar(A,n,A),u=0;u<n;++u){g=e[u][t].boundingSphere;const n=i.Cartesian3.magnitude(i.Cartesian3.subtract(g.center,A,N))+g.radius;n>T&&(T=n)}return new c.Geometry({attributes:m,indices:b,primitiveType:f,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}v.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(L(t,"geometry")),n.length>0&&(a.push(L(n,"westHemisphereGeometry")),a.push(L(n,"eastHemisphereGeometry"))),a};const M=new i.Cartesian3,z=new i.Cartesian3,D=new i.Cartesian3,G=new i.Cartesian3;v.computeNormal=function(e){const t=e.indices,n=e.attributes,r=n.position.values,s=n.position.values.length/3,u=t.length,l=new Array(s),p=new Array(u/3),d=new Array(u);let y;for(y=0;y<s;y++)l[y]={indexOffset:0,count:0,currentCount:0};let f=0;for(y=0;y<u;y+=3){const e=t[y],n=t[y+1],a=t[y+2],s=3*e,o=3*n,u=3*a;z.x=r[s],z.y=r[s+1],z.z=r[s+2],D.x=r[o],D.y=r[o+1],D.z=r[o+2],G.x=r[u],G.y=r[u+1],G.z=r[u+2],l[e].count++,l[n].count++,l[a].count++,i.Cartesian3.subtract(D,z,D),i.Cartesian3.subtract(G,z,G),p[f]=i.Cartesian3.cross(D,G,new i.Cartesian3),f++}let m,C=0;for(y=0;y<s;y++)l[y].indexOffset+=C,C+=l[y].count;for(f=0,y=0;y<u;y+=3){m=l[t[y]];let e=m.indexOffset+m.currentCount;d[e]=f,m.currentCount++,m=l[t[y+1]],e=m.indexOffset+m.currentCount,d[e]=f,m.currentCount++,m=l[t[y+2]],e=m.indexOffset+m.currentCount,d[e]=f,m.currentCount++,f++}const h=new Float32Array(3*s);for(y=0;y<s;y++){const e=3*y;if(m=l[y],i.Cartesian3.clone(i.Cartesian3.ZERO,M),m.count>0){for(f=0;f<m.count;f++)i.Cartesian3.add(M,p[d[m.indexOffset+f]],M);i.Cartesian3.equalsEpsilon(i.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&i.Cartesian3.clone(p[d[m.indexOffset]],M)}i.Cartesian3.equalsEpsilon(i.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&(M.z=1),i.Cartesian3.normalize(M,M),h[e]=M.x,h[e+1]=M.y,h[e+2]=M.z}return e.attributes.normal=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h}),e};const V=new i.Cartesian3,R=new i.Cartesian3,F=new i.Cartesian3;v.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,n=e.attributes.position.values,r=e.attributes.normal.values,a=e.attributes.st.values,s=e.attributes.position.values.length/3,u=t.length,l=new Array(3*s);let p,d,y,f;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<u;p+=3){const e=t[p],i=t[p+1],r=t[p+2];d=3*e,y=3*i,f=3*r;const s=2*e,o=2*i,u=2*r,c=n[d],m=n[d+1],C=n[d+2],h=a[s],v=a[s+1],b=a[o+1]-v,g=a[u+1]-v,A=1/((a[o]-h)*g-(a[u]-h)*b),T=(g*(n[y]-c)-b*(n[f]-c))*A,x=(g*(n[y+1]-m)-b*(n[f+1]-m))*A,P=(g*(n[y+2]-C)-b*(n[f+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P}const m=new Float32Array(3*s),C=new Float32Array(3*s);for(p=0;p<s;p++){d=3*p,y=d+1,f=d+2;const e=i.Cartesian3.fromArray(r,d,V),t=i.Cartesian3.fromArray(l,d,F),n=i.Cartesian3.dot(e,t);i.Cartesian3.multiplyByScalar(e,n,R),i.Cartesian3.normalize(i.Cartesian3.subtract(t,R,t),t),m[d]=t.x,m[y]=t.y,m[f]=t.z,i.Cartesian3.normalize(i.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[y]=t.y,C[f]=t.z}return e.attributes.tangent=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const B=new n.Cartesian2,_=new i.Cartesian3,k=new i.Cartesian3,q=new i.Cartesian3;let U=new n.Cartesian2;function Y(e){switch(e.primitiveType){case c.PrimitiveType.TRIANGLE_FAN:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=c.PrimitiveType.TRIANGLES,e}(e);case c.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=c.PrimitiveType.TRIANGLES,e}(e);case c.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case c.PrimitiveType.LINE_STRIP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=c.PrimitiveType.LINES,e}(e);case c.PrimitiveType.LINE_LOOP:return function(e){const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=c.PrimitiveType.LINES,e}(e);case c.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=c.Geometry.computeNumberOfVertices(e),n=l.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function Z(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}v.compressVertices=function(e){const a=e.attributes.extrudeDirection;let s,u;if(r.defined(a)){const n=a.values;u=n.length/3;const r=new Float32Array(2*u);let l=0;for(s=0;s<u;++s)i.Cartesian3.fromArray(n,3*s,_),i.Cartesian3.equals(_,i.Cartesian3.ZERO)?l+=2:(U=t.AttributeCompression.octEncodeInRange(_,65535,U),r[l++]=U.x,r[l++]=U.y);return e.attributes.compressedAttributes=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:r}),delete e.attributes.extrudeDirection,e}const l=e.attributes.normal,p=e.attributes.st,d=r.defined(l),y=r.defined(p);if(!d&&!y)return e;const f=e.attributes.tangent,m=e.attributes.bitangent,C=r.defined(f),h=r.defined(m);let v,b,g,A;d&&(v=l.values),y&&(b=p.values),C&&(g=f.values),h&&(A=m.values);u=(d?v.length:b.length)/(d?3:2);let T=u,x=y&&d?2:1;x+=C||h?1:0,T*=x;const P=new Float32Array(T);let w=0;for(s=0;s<u;++s){y&&(n.Cartesian2.fromArray(b,2*s,B),P[w++]=t.AttributeCompression.compressTextureCoordinates(B));const e=3*s;d&&r.defined(g)&&r.defined(A)?(i.Cartesian3.fromArray(v,e,_),i.Cartesian3.fromArray(g,e,k),i.Cartesian3.fromArray(A,e,q),t.AttributeCompression.octPack(_,k,q,B),P[w++]=B.x,P[w++]=B.y):(d&&(i.Cartesian3.fromArray(v,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)),C&&(i.Cartesian3.fromArray(g,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)),h&&(i.Cartesian3.fromArray(A,e,_),P[w++]=t.AttributeCompression.octEncodeFloat(_)))}return e.attributes.compressedAttributes=new c.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:x,values:P}),d&&delete e.attributes.normal,y&&delete e.attributes.st,h&&delete e.attributes.bitangent,C&&delete e.attributes.tangent,e};const H=new i.Cartesian3;function W(e,t,n,r){i.Cartesian3.add(e,i.Cartesian3.multiplyByScalar(i.Cartesian3.subtract(t,e,H),e.y/(e.y-t.y),H),n),i.Cartesian3.clone(n,r),Z(n,!0),Z(r,!1)}const X=new i.Cartesian3,j=new i.Cartesian3,J=new i.Cartesian3,K=new i.Cartesian3,Q={positions:new Array(7),indices:new Array(9)};function $(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return Z(e,e.y<0),Z(t,t.y<0),void Z(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;Z(e,u),Z(t,u),Z(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=Q.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(W(e,t,X,J),W(e,n,j,K),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(W(t,n,X,J),W(t,e,j,K),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(W(n,e,X,J),W(n,t,j,K),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(W(n,e,X,J),W(n,t,j,K),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,n,X,J),W(t,e,j,K),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,X,J),W(e,n,j,K),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=Q.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=X,c[4]=j,c[5]=J,c[6]=K,c.length=7),Q}function ee(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=o.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=c.Geometry.computeNumberOfVertices(e);return e.indices=l.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function te(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new c.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new c.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ne(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=ee(t,i),n=ee(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function ie(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const y=e.fromArray(c,a*t,n),f=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(y,u.x,y),e.multiplyByScalar(f,u.y,f),e.multiplyByScalar(m,u.z,m);const C=e.add(y,f,y);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const re=ie(n.Cartesian4,4),ae=ie(i.Cartesian3,3),se=ie(n.Cartesian2,2),oe=function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0},ue=new i.Cartesian3,ce=new i.Cartesian3,le=new i.Cartesian3,pe=new i.Cartesian3;function de(e,t,s,o,u,c,l,p,d,C,h,v,b,g,A,T){if(!(r.defined(c)||r.defined(l)||r.defined(p)||r.defined(d)||r.defined(C)||0!==g))return;const x=function(e,t,s,o,u){let c,l,p,d,C,h,v,b;if(r.defined(u)||(u=new i.Cartesian3),r.defined(t.z)){if(i.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_X,u);if(i.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Y,u);if(i.Cartesian3.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Z,u);c=i.Cartesian3.subtract(s,t,y),l=i.Cartesian3.subtract(o,t,f),p=i.Cartesian3.subtract(e,t,m),d=i.Cartesian3.dot(c,c),C=i.Cartesian3.dot(c,l),h=i.Cartesian3.dot(c,p),v=i.Cartesian3.dot(l,l),b=i.Cartesian3.dot(l,p)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_X,u);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Y,u);if(n.Cartesian2.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return i.Cartesian3.clone(i.Cartesian3.UNIT_Z,u);c=n.Cartesian2.subtract(s,t,y),l=n.Cartesian2.subtract(o,t,f),p=n.Cartesian2.subtract(e,t,m),d=n.Cartesian2.dot(c,c),C=n.Cartesian2.dot(c,l),h=n.Cartesian2.dot(c,p),v=n.Cartesian2.dot(l,l),b=n.Cartesian2.dot(l,p)}u.y=v*h-C*b,u.z=d*b-C*h;const g=d*v-C*C;if(0!==g)return u.y/=g,u.z/=g,u.x=1-u.y-u.z,u}(o,i.Cartesian3.fromArray(u,3*e,ue),i.Cartesian3.fromArray(u,3*t,ce),i.Cartesian3.fromArray(u,3*s,le),pe);if(r.defined(x)){if(r.defined(c)&&ae(e,t,s,x,c,v.normal.values,T,!0),r.defined(C)){const n=i.Cartesian3.fromArray(C,3*e,ue),r=i.Cartesian3.fromArray(C,3*t,ce),a=i.Cartesian3.fromArray(C,3*s,le);let o;i.Cartesian3.multiplyByScalar(n,x.x,n),i.Cartesian3.multiplyByScalar(r,x.y,r),i.Cartesian3.multiplyByScalar(a,x.z,a),i.Cartesian3.equals(n,i.Cartesian3.ZERO)&&i.Cartesian3.equals(r,i.Cartesian3.ZERO)&&i.Cartesian3.equals(a,i.Cartesian3.ZERO)?(o=ue,o.x=0,o.y=0,o.z=0):(o=i.Cartesian3.add(n,r,n),i.Cartesian3.add(o,a,o),i.Cartesian3.normalize(o,o)),i.Cartesian3.pack(o,v.extrudeDirection.values,3*T)}if(r.defined(h)&&oe(e,t,s,x,h,v.applyOffset.values,T),r.defined(l)&&ae(e,t,s,x,l,v.tangent.values,T,!0),r.defined(p)&&ae(e,t,s,x,p,v.bitangent.values,T,!0),r.defined(d)&&se(e,t,s,x,d,v.st.values,T),g>0)for(let n=0;n<g;n++){const i=b[n];ye(e,t,s,x,T,A[i],v[i])}}}function ye(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:re(e,t,n,i,u,c,r,!1);break;case 3:ae(e,t,n,i,u,c,r,!1);break;case 2:se(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function fe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const me={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Ce(e){const t=e.geometry,n=t.attributes,a=n.position.values,s=r.defined(n.normal)?n.normal.values:void 0,o=r.defined(n.bitangent)?n.bitangent.values:void 0,u=r.defined(n.tangent)?n.tangent.values:void 0,c=r.defined(n.st)?n.st.values:void 0,l=r.defined(n.extrudeDirection)?n.extrudeDirection.values:void 0,p=r.defined(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,y=[];for(const e in n)n.hasOwnProperty(e)&&!me[e]&&r.defined(n[e])&&y.push(e);const f=y.length,m=te(t),C=te(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=i.Cartesian3.fromArray(a,3*e),S=i.Cartesian3.fromArray(a,3*t),I=i.Cartesian3.fromArray(a,3*P);const O=$(w,S,I);if(r.defined(O)&&O.positions.length>3){const i=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=i[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=fe(h,v,b,d,w<3?A+w:-1,I),de(e,t,P,I,a,s,u,o,c,l,p,h,y,f,n,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=fe(h,v,b,d,A,w),de(e,t,P,w,a,s,u,o,c,l,p,h,y,f,n,g),g=fe(h,v,b,d,A+1,S),de(e,t,P,S,a,s,u,o,c,l,p,h,y,f,n,g),g=fe(h,v,b,d,A+2,I),de(e,t,P,I,a,s,u,o,c,l,p,h,y,f,n,g)}ne(e,C,m)}const he=d.Plane.fromPointNormal(i.Cartesian3.ZERO,i.Cartesian3.UNIT_Y),ve=new i.Cartesian3,be=new i.Cartesian3;function ge(e,t,n,s,o,u,c){if(!r.defined(c))return;const l=i.Cartesian3.fromArray(s,3*e,ue);i.Cartesian3.equalsEpsilon(l,n,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function Ae(e){const t=e.geometry,n=t.attributes,s=n.position.values,o=r.defined(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,c=te(t),l=te(t);let d;const y=u.length,f=[];f.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<f.length;++d)f[d]=-1,m[d]=-1;for(d=0;d<y;d+=2){const e=u[d],t=u[d+1],n=i.Cartesian3.fromArray(s,3*e,ue),y=i.Cartesian3.fromArray(s,3*t,ce);let C;Math.abs(n.y)<a.CesiumMath.EPSILON6&&(n.y<0?n.y=-a.CesiumMath.EPSILON6:n.y=a.CesiumMath.EPSILON6),Math.abs(y.y)<a.CesiumMath.EPSILON6&&(y.y<0?y.y=-a.CesiumMath.EPSILON6:y.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=l.attributes,A=l.indices,T=f;const x=p.IntersectionTests.lineSegmentPlane(n,y,he,le);if(r.defined(x)){const r=i.Cartesian3.multiplyByScalar(i.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,ve);n.y<0&&(i.Cartesian3.negate(r,r),h=l.attributes,v=l.indices,b=f,g=c.attributes,A=c.indices,T=m);const p=i.Cartesian3.add(x,r,be);C=fe(h,v,b,u,d,n),ge(e,t,n,s,C,h,o),C=fe(h,v,b,u,-1,p),ge(e,t,p,s,C,h,o),i.Cartesian3.negate(r,r),i.Cartesian3.add(x,r,p),C=fe(g,A,T,u,-1,p),ge(e,t,p,s,C,g,o),C=fe(g,A,T,u,d+1,y),ge(e,t,y,s,C,g,o)}else{let i,r,a;n.y<0?(i=l.attributes,r=l.indices,a=f):(i=c.attributes,r=c.indices,a=m),C=fe(i,r,a,u,d,n),ge(e,t,n,s,C,i,o),C=fe(i,r,a,u,d+1,y),ge(e,t,y,s,C,i,o)}}ne(e,l,c)}const Te=new n.Cartesian2,xe=new n.Cartesian2,Pe=new i.Cartesian3,we=new i.Cartesian3,Se=new i.Cartesian3,Ie=new i.Cartesian3,Oe=new i.Cartesian3,Ee=new i.Cartesian3,Ne=new n.Cartesian4;function Le(e){const t=e.attributes,n=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=n.length;for(let e=0;e<s;e+=3){const t=i.Cartesian3.unpack(n,e,Pe);if(t.x>0)continue;const o=i.Cartesian3.unpack(r,e,we);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=n[e-3],r[e+1]=n[e-2],r[e+2]=n[e-1]):i.Cartesian3.pack(t,r,e));const u=i.Cartesian3.unpack(a,e,Se);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=n[e+3],a[e+1]=n[e+4],a[e+2]=n[e+5]):i.Cartesian3.pack(t,a,e))}}const Me=5*a.CesiumMath.EPSILON9,ze=a.CesiumMath.EPSILON6;v.splitLongitude=function(e){const t=e.geometry,o=t.boundingSphere;if(r.defined(o)){if(o.center.x-o.radius>0||s.BoundingSphere.intersectPlane(o,d.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==c.GeometryType.NONE)switch(t.geometryType){case c.GeometryType.POLYLINES:!function(e){const t=e.geometry,s=t.attributes,o=s.position.values,u=s.prevPosition.values,c=s.nextPosition.values,l=s.expandAndWidth.values,d=r.defined(s.st)?s.st.values:void 0,y=r.defined(s.color)?s.color.values:void 0,f=te(t),m=te(t);let C,h,v,b=!1;const g=o.length/3;for(C=0;C<g;C+=4){const e=C,t=C+2,s=i.Cartesian3.fromArray(o,3*e,Pe),g=i.Cartesian3.fromArray(o,3*t,we);if(Math.abs(s.y)<ze)for(s.y=ze*(g.y<0?-1:1),o[3*C+1]=s.y,o[3*(C+1)+1]=s.y,h=3*e;h<3*e+12;h+=3)u[h]=o[3*C],u[h+1]=o[3*C+1],u[h+2]=o[3*C+2];if(Math.abs(g.y)<ze)for(g.y=ze*(s.y<0?-1:1),o[3*(C+2)+1]=g.y,o[3*(C+3)+1]=g.y,h=3*e;h<3*e+12;h+=3)c[h]=o[3*(C+2)],c[h+1]=o[3*(C+2)+1],c[h+2]=o[3*(C+2)+2];let A=f.attributes,T=f.indices,x=m.attributes,P=m.indices;const w=p.IntersectionTests.lineSegmentPlane(s,g,he,Ie);if(r.defined(w)){b=!0;const o=i.Cartesian3.multiplyByScalar(i.Cartesian3.UNIT_Y,Me,Oe);s.y<0&&(i.Cartesian3.negate(o,o),A=m.attributes,T=m.indices,x=f.attributes,P=f.indices);const p=i.Cartesian3.add(w,o,Ee);A.position.values.push(s.x,s.y,s.z,s.x,s.y,s.z),A.position.values.push(p.x,p.y,p.z),A.position.values.push(p.x,p.y,p.z),A.prevPosition.values.push(u[3*e],u[3*e+1],u[3*e+2]),A.prevPosition.values.push(u[3*e+3],u[3*e+4],u[3*e+5]),A.prevPosition.values.push(s.x,s.y,s.z,s.x,s.y,s.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),A.nextPosition.values.push(p.x,p.y,p.z),i.Cartesian3.negate(o,o),i.Cartesian3.add(w,o,p),x.position.values.push(p.x,p.y,p.z),x.position.values.push(p.x,p.y,p.z),x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.prevPosition.values.push(p.x,p.y,p.z),x.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(c[3*t],c[3*t+1],c[3*t+2]),x.nextPosition.values.push(c[3*t+3],c[3*t+4],c[3*t+5]);const S=n.Cartesian2.fromArray(l,2*e,Te),I=Math.abs(S.y);A.expandAndWidth.values.push(-1,I,1,I),A.expandAndWidth.values.push(-1,-I,1,-I),x.expandAndWidth.values.push(-1,I,1,I),x.expandAndWidth.values.push(-1,-I,1,-I);let O=i.Cartesian3.magnitudeSquared(i.Cartesian3.subtract(w,s,Se));if(O/=i.Cartesian3.magnitudeSquared(i.Cartesian3.subtract(g,s,Se)),r.defined(y)){const i=n.Cartesian4.fromArray(y,4*e,Ne),r=n.Cartesian4.fromArray(y,4*t,Ne),s=a.CesiumMath.lerp(i.x,r.x,O),o=a.CesiumMath.lerp(i.y,r.y,O),u=a.CesiumMath.lerp(i.z,r.z,O),c=a.CesiumMath.lerp(i.w,r.w,O);for(h=4*e;h<4*e+8;++h)A.color.values.push(y[h]);for(A.color.values.push(s,o,u,c),A.color.values.push(s,o,u,c),x.color.values.push(s,o,u,c),x.color.values.push(s,o,u,c),h=4*t;h<4*t+8;++h)x.color.values.push(y[h])}if(r.defined(d)){const i=n.Cartesian2.fromArray(d,2*e,Te),r=n.Cartesian2.fromArray(d,2*(C+3),xe),s=a.CesiumMath.lerp(i.x,r.x,O);for(h=2*e;h<2*e+4;++h)A.st.values.push(d[h]);for(A.st.values.push(s,i.y),A.st.values.push(s,r.y),x.st.values.push(s,i.y),x.st.values.push(s,r.y),h=2*t;h<2*t+4;++h)x.st.values.push(d[h])}v=A.position.values.length/3-4,T.push(v,v+2,v+1),T.push(v+1,v+2,v+3),v=x.position.values.length/3-4,P.push(v,v+2,v+1),P.push(v+1,v+2,v+3)}else{let e,t;for(s.y<0?(e=m.attributes,t=m.indices):(e=f.attributes,t=f.indices),e.position.values.push(s.x,s.y,s.z),e.position.values.push(s.x,s.y,s.z),e.position.values.push(g.x,g.y,g.z),e.position.values.push(g.x,g.y,g.z),h=3*C;h<3*C+12;++h)e.prevPosition.values.push(u[h]),e.nextPosition.values.push(c[h]);for(h=2*C;h<2*C+8;++h)e.expandAndWidth.values.push(l[h]),r.defined(d)&&e.st.values.push(d[h]);if(r.defined(y))for(h=4*C;h<4*C+16;++h)e.color.values.push(y[h]);v=e.position.values.length/3-4,t.push(v,v+2,v+1),t.push(v+1,v+2,v+3)}}b&&(Le(m),Le(f)),ne(e,m,f)}(e);break;case c.GeometryType.TRIANGLES:Ce(e);break;case c.GeometryType.LINES:Ae(e)}else Y(t),t.primitiveType===c.PrimitiveType.TRIANGLES?Ce(e):t.primitiveType===c.PrimitiveType.LINES&&Ae(e);return e};var De=v;e.GeometryPipeline=De})); diff --git a/public/lib/Cesium/Workers/IndexDatatype-d3db4e7d.js b/public/lib/Cesium/Workers/IndexDatatype-a9b1bc18.js similarity index 94% rename from public/lib/Cesium/Workers/IndexDatatype-d3db4e7d.js rename to public/lib/Cesium/Workers/IndexDatatype-a9b1bc18.js index cc641de7..0d56cc6b 100644 --- a/public/lib/Cesium/Workers/IndexDatatype-d3db4e7d.js +++ b/public/lib/Cesium/Workers/IndexDatatype-a9b1bc18.js @@ -1 +1 @@ -define(["exports","./defaultValue-f6d5e6da","./Math-2ce22ee9","./WebGLConstants-7f557f93"],(function(n,r,e,t){"use strict";const N={UNSIGNED_BYTE:t.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:t.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:t.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(n){switch(n){case N.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case N.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case N.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(n){switch(n){case 2:return N.UNSIGNED_SHORT;case 4:return N.UNSIGNED_INT;case 1:return N.UNSIGNED_BYTE}},validate:function(n){return r.defined(n)&&(n===N.UNSIGNED_BYTE||n===N.UNSIGNED_SHORT||n===N.UNSIGNED_INT)},createTypedArray:function(n,r){return n>=e.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(r):new Uint16Array(r)},createTypedArrayFromArrayBuffer:function(n,r,t,N){return n>=e.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(r,t,N):new Uint16Array(r,t,N)},fromTypedArray:function(n){return n instanceof Uint8Array?N.UNSIGNED_BYTE:n instanceof Uint16Array?N.UNSIGNED_SHORT:n instanceof Uint32Array?N.UNSIGNED_INT:void 0}};var E=Object.freeze(N);n.IndexDatatype=E})); +define(["exports","./defaultValue-f6d5e6da","./Math-355606c6","./WebGLConstants-7f557f93"],(function(n,r,e,t){"use strict";const N={UNSIGNED_BYTE:t.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:t.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:t.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(n){switch(n){case N.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case N.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case N.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(n){switch(n){case 2:return N.UNSIGNED_SHORT;case 4:return N.UNSIGNED_INT;case 1:return N.UNSIGNED_BYTE}},validate:function(n){return r.defined(n)&&(n===N.UNSIGNED_BYTE||n===N.UNSIGNED_SHORT||n===N.UNSIGNED_INT)},createTypedArray:function(n,r){return n>=e.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(r):new Uint16Array(r)},createTypedArrayFromArrayBuffer:function(n,r,t,N){return n>=e.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(r,t,N):new Uint16Array(r,t,N)},fromTypedArray:function(n){return n instanceof Uint8Array?N.UNSIGNED_BYTE:n instanceof Uint16Array?N.UNSIGNED_SHORT:n instanceof Uint32Array?N.UNSIGNED_INT:void 0}};var E=Object.freeze(N);n.IndexDatatype=E})); diff --git a/public/lib/Cesium/Workers/IntersectionTests-56142431.js b/public/lib/Cesium/Workers/IntersectionTests-f1b36d69.js similarity index 99% rename from public/lib/Cesium/Workers/IntersectionTests-56142431.js rename to public/lib/Cesium/Workers/IntersectionTests-f1b36d69.js index 50a34d04..71ce02a8 100644 --- a/public/lib/Cesium/Workers/IntersectionTests-56142431.js +++ b/public/lib/Cesium/Workers/IntersectionTests-f1b36d69.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Transforms-b3716b06","./Math-2ce22ee9"],(function(t,n,e,a,i){"use strict";const r={};function s(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}r.computeDiscriminant=function(t,n,e){return n*n-4*t*e},r.computeRealRoots=function(t,n,e){let a;if(0===t)return 0===n?[]:[-e/n];if(0===n){if(0===e)return[0,0];const n=Math.abs(e),r=Math.abs(t);if(n<r&&n/r<i.CesiumMath.EPSILON14)return[0,0];if(n>r&&r/n<i.CesiumMath.EPSILON14)return[];if(a=-e/t,a<0)return[];const s=Math.sqrt(a);return[-s,s]}if(0===e)return a=-n/t,a<0?[a,0]:[0,a];const r=s(n*n,-(4*t*e),i.CesiumMath.EPSILON14);if(r<0)return[];const o=-.5*s(n,i.CesiumMath.sign(n)*Math.sqrt(r),i.CesiumMath.EPSILON14);return n>0?[o/t,e/o]:[e/o,o/t]};var o=r;const c={};function u(t,n,e,a){const i=t,r=n/3,s=e/3,o=a,c=i*s,u=r*o,l=r*r,C=s*s,M=i*s-l,h=i*o-r*s,m=r*o-C,f=4*M*m-h*h;let d,g;if(f<0){let t,n,e;l*u>=c*C?(t=i,n=M,e=-2*r*M+i*h):(t=o,n=m,e=-o*h+2*s*m);const a=-(e<0?-1:1)*Math.abs(t)*Math.sqrt(-f);g=-e+a;const p=g/2,w=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),R=g===a?-w:-n/w;return d=n<=0?w+R:-e/(w*w+R*R+n),l*u>=c*C?[(d-r)/i]:[-o/(d+s)]}const p=M,w=-2*r*M+i*h,R=m,S=-o*h+2*s*m,O=Math.sqrt(f),x=Math.sqrt(3)/2;let y=Math.abs(Math.atan2(i*O,-w)/3);d=2*Math.sqrt(-p);let P=Math.cos(y);g=d*P;let N=d*(-P/2-x*Math.sin(y));const b=g+N>2*r?g-r:N-r,q=i,L=b/q;y=Math.abs(Math.atan2(o*O,-S)/3),d=2*Math.sqrt(-R),P=Math.cos(y),g=d*P,N=d*(-P/2-x*Math.sin(y));const I=-o,E=g+N<2*s?g+s:N+s,v=I/E,z=-b*E-q*I,T=(s*z-r*(b*I))/(-r*z+s*(q*E));return L<=T?L<=v?T<=v?[L,T,v]:[L,v,T]:[v,L,T]:L<=v?[T,L,v]:T<=v?[T,v,L]:[v,T,L]}c.computeDiscriminant=function(t,n,e,a){const i=n*n,r=e*e;return 18*t*n*e*a+i*r-27*(t*t)*(a*a)-4*(t*r*e+i*n*a)},c.computeRealRoots=function(t,n,e,a){let i,r;if(0===t)return o.computeRealRoots(n,e,a);if(0===n){if(0===e){if(0===a)return[0,0,0];r=-a/t;const n=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[n,n,n]}return 0===a?(i=o.computeRealRoots(t,0,e),0===i.Length?[0]:[i[0],0,i[1]]):u(t,0,e,a)}return 0===e?0===a?(r=-n/t,r<0?[r,0,0]:[0,0,r]):u(t,n,0,a):0===a?(i=o.computeRealRoots(t,n,e),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):u(t,n,e,a)};var l=c;const C={};function M(t,n,e,a){const r=t*t,s=n-3*r/8,c=e-n*t/2+r*t/8,u=a-e*t/4+n*r/16-3*r*r/256,C=l.computeRealRoots(1,2*s,s*s-4*u,-c*c);if(C.length>0){const n=-t/4,e=C[C.length-1];if(Math.abs(e)<i.CesiumMath.EPSILON14){const t=o.computeRealRoots(1,s,u);if(2===t.length){const e=t[0],a=t[1];let i;if(e>=0&&a>=0){const t=Math.sqrt(e),i=Math.sqrt(a);return[n-i,n-t,n+t,n+i]}if(e>=0&&a<0)return i=Math.sqrt(e),[n-i,n+i];if(e<0&&a>=0)return i=Math.sqrt(a),[n-i,n+i]}return[]}if(e>0){const t=Math.sqrt(e),a=(s+e-c/t)/2,i=(s+e+c/t)/2,r=o.computeRealRoots(1,t,a),u=o.computeRealRoots(1,-t,i);return 0!==r.length?(r[0]+=n,r[1]+=n,0!==u.length?(u[0]+=n,u[1]+=n,r[1]<=u[0]?[r[0],r[1],u[0],u[1]]:u[1]<=r[0]?[u[0],u[1],r[0],r[1]]:r[0]>=u[0]&&r[1]<=u[1]?[u[0],r[0],r[1],u[1]]:u[0]>=r[0]&&u[1]<=r[1]?[r[0],u[0],u[1],r[1]]:r[0]>u[0]&&r[0]<u[1]?[u[0],r[0],u[1],r[1]]:[r[0],u[0],r[1],u[1]]):r):0!==u.length?(u[0]+=n,u[1]+=n,u):[]}}return[]}function h(t,n,e,a){const r=t*t,s=-2*n,c=e*t+n*n-4*a,u=r*a-e*n*t+e*e,C=l.computeRealRoots(1,s,c,u);if(C.length>0){const s=C[0],c=n-s,u=c*c,l=t/2,M=c/2,h=u-4*a,m=u+4*Math.abs(a),f=r-4*s,d=r+4*Math.abs(s);let g,p,w,R,S,O;if(s<0||h*d<f*m){const n=Math.sqrt(f);g=n/2,p=0===n?0:(t*M-e)/n}else{const n=Math.sqrt(h);g=0===n?0:(t*M-e)/n,p=n/2}0===l&&0===g?(w=0,R=0):i.CesiumMath.sign(l)===i.CesiumMath.sign(g)?(w=l+g,R=s/w):(R=l-g,w=s/R),0===M&&0===p?(S=0,O=0):i.CesiumMath.sign(M)===i.CesiumMath.sign(p)?(S=M+p,O=a/S):(O=M-p,S=a/O);const x=o.computeRealRoots(1,w,S),y=o.computeRealRoots(1,R,O);if(0!==x.length)return 0!==y.length?x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>y[0]&&x[0]<y[1]?[y[0],x[0],y[1],x[1]]:[x[0],y[0],x[1],y[1]]:x;if(0!==y.length)return y}return[]}C.computeDiscriminant=function(t,n,e,a,i){const r=t*t,s=n*n,o=s*n,c=e*e,u=c*e,l=a*a,C=l*a,M=i*i;return s*c*l-4*o*C-4*t*u*l+18*t*n*e*C-27*r*l*l+256*(r*t)*(M*i)+i*(18*o*e*a-4*s*u+16*t*c*c-80*t*n*c*a-6*t*s*l+144*r*e*l)+M*(144*t*s*e-27*s*s-128*r*c-192*r*n*a)},C.computeRealRoots=function(t,n,e,a,r){if(Math.abs(t)<i.CesiumMath.EPSILON15)return l.computeRealRoots(n,e,a,r);const s=n/t,o=e/t,c=a/t,u=r/t;let C=s<0?1:0;switch(C+=o<0?C+1:C,C+=c<0?C+1:C,C+=u<0?C+1:C,C){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return M(s,o,c,u);case 1:case 2:case 5:case 8:case 11:return h(s,o,c,u);default:return}};var m=C;function f(t,a){a=n.Cartesian3.clone(e.defaultValue(a,n.Cartesian3.ZERO)),n.Cartesian3.equals(a,n.Cartesian3.ZERO)||n.Cartesian3.normalize(a,a),this.origin=n.Cartesian3.clone(e.defaultValue(t,n.Cartesian3.ZERO)),this.direction=a}f.clone=function(t,a){if(e.defined(t))return e.defined(a)?(a.origin=n.Cartesian3.clone(t.origin),a.direction=n.Cartesian3.clone(t.direction),a):new f(t.origin,t.direction)},f.getPoint=function(t,a,i){return e.defined(i)||(i=new n.Cartesian3),i=n.Cartesian3.multiplyByScalar(t.direction,a,i),n.Cartesian3.add(t.origin,i,i)};const d={rayPlane:function(t,a,r){e.defined(r)||(r=new n.Cartesian3);const s=t.origin,o=t.direction,c=a.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON15)return;const l=(-a.distance-n.Cartesian3.dot(c,s))/u;return l<0?void 0:(r=n.Cartesian3.multiplyByScalar(o,l,r),n.Cartesian3.add(s,r,r))}},g=new n.Cartesian3,p=new n.Cartesian3,w=new n.Cartesian3,R=new n.Cartesian3,S=new n.Cartesian3;d.rayTriangleParametric=function(t,a,r,s,o){o=e.defaultValue(o,!1);const c=t.origin,u=t.direction,l=n.Cartesian3.subtract(r,a,g),C=n.Cartesian3.subtract(s,a,p),M=n.Cartesian3.cross(u,C,w),h=n.Cartesian3.dot(l,M);let m,f,d,O,x;if(o){if(h<i.CesiumMath.EPSILON6)return;if(m=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(m,M),d<0||d>h)return;if(f=n.Cartesian3.cross(m,l,S),O=n.Cartesian3.dot(u,f),O<0||d+O>h)return;x=n.Cartesian3.dot(C,f)/h}else{if(Math.abs(h)<i.CesiumMath.EPSILON6)return;const t=1/h;if(m=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(m,M)*t,d<0||d>1)return;if(f=n.Cartesian3.cross(m,l,S),O=n.Cartesian3.dot(u,f)*t,O<0||d+O>1)return;x=n.Cartesian3.dot(C,f)*t}return x},d.rayTriangle=function(t,a,i,r,s,o){const c=d.rayTriangleParametric(t,a,i,r,s);if(e.defined(c)&&!(c<0))return e.defined(o)||(o=new n.Cartesian3),n.Cartesian3.multiplyByScalar(t.direction,c,o),n.Cartesian3.add(t.origin,o,o)};const O=new f;d.lineSegmentTriangle=function(t,a,i,r,s,o,c){const u=O;n.Cartesian3.clone(t,u.origin),n.Cartesian3.subtract(a,t,u.direction),n.Cartesian3.normalize(u.direction,u.direction);const l=d.rayTriangleParametric(u,i,r,s,o);if(!(!e.defined(l)||l<0||l>n.Cartesian3.distance(t,a)))return e.defined(c)||(c=new n.Cartesian3),n.Cartesian3.multiplyByScalar(u.direction,l,c),n.Cartesian3.add(u.origin,c,c)};const x={root0:0,root1:0};function y(t,i,r){e.defined(r)||(r=new a.Interval);const s=t.origin,o=t.direction,c=i.center,u=i.radius*i.radius,l=n.Cartesian3.subtract(s,c,w),C=function(t,n,e,a){const i=n*n-4*t*e;if(i<0)return;if(i>0){const e=1/(2*t),r=Math.sqrt(i),s=(-n+r)*e,o=(-n-r)*e;return s<o?(a.root0=s,a.root1=o):(a.root0=o,a.root1=s),a}const r=-n/(2*t);return 0!==r?(a.root0=a.root1=r,a):void 0}(n.Cartesian3.dot(o,o),2*n.Cartesian3.dot(o,l),n.Cartesian3.magnitudeSquared(l)-u,x);if(e.defined(C))return r.start=C.root0,r.stop=C.root1,r}d.raySphere=function(t,n,a){if(a=y(t,n,a),e.defined(a)&&!(a.stop<0))return a.start=Math.max(a.start,0),a};const P=new f;d.lineSegmentSphere=function(t,a,i,r){const s=P;n.Cartesian3.clone(t,s.origin);const o=n.Cartesian3.subtract(a,t,s.direction),c=n.Cartesian3.magnitude(o);if(n.Cartesian3.normalize(o,o),r=y(s,i,r),!(!e.defined(r)||r.stop<0||r.start>c))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,c),r};const N=new n.Cartesian3,b=new n.Cartesian3;function q(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}d.rayEllipsoid=function(t,e){const i=e.oneOverRadii,r=n.Cartesian3.multiplyComponents(i,t.origin,N),s=n.Cartesian3.multiplyComponents(i,t.direction,b),o=n.Cartesian3.magnitudeSquared(r),c=n.Cartesian3.dot(r,s);let u,l,C,M,h;if(o>1){if(c>=0)return;const t=c*c;if(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,t<C)return;if(t>C){M=c*c-C,h=-c+Math.sqrt(M);const t=h/l,n=u/h;return t<n?new a.Interval(t,n):{start:n,stop:t}}const e=Math.sqrt(u/l);return new a.Interval(e,e)}return o<1?(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,M=c*c-C,h=-c+Math.sqrt(M),new a.Interval(0,h/l)):c<0?(l=n.Cartesian3.magnitudeSquared(s),new a.Interval(0,-c/l)):void 0};const L=new n.Cartesian3,I=new n.Cartesian3,E=new n.Cartesian3,v=new n.Cartesian3,z=new n.Cartesian3,T=new n.Matrix3,U=new n.Matrix3,W=new n.Matrix3,B=new n.Matrix3,V=new n.Matrix3,Z=new n.Matrix3,A=new n.Matrix3,D=new n.Cartesian3,F=new n.Cartesian3,G=new n.Cartographic;d.grazingAltitudeLocation=function(t,a){const r=t.origin,s=t.direction;if(!n.Cartesian3.equals(r,n.Cartesian3.ZERO)){const t=a.geodeticSurfaceNormal(r,L);if(n.Cartesian3.dot(s,t)>=0)return r}const c=e.defined(this.rayEllipsoid(t,a)),u=a.transformPositionToScaledSpace(s,L),l=n.Cartesian3.normalize(u,u),C=n.Cartesian3.mostOrthogonalAxis(u,v),M=n.Cartesian3.normalize(n.Cartesian3.cross(C,l,I),I),h=n.Cartesian3.normalize(n.Cartesian3.cross(l,M,E),E),f=T;f[0]=l.x,f[1]=l.y,f[2]=l.z,f[3]=M.x,f[4]=M.y,f[5]=M.z,f[6]=h.x,f[7]=h.y,f[8]=h.z;const d=n.Matrix3.transpose(f,U),g=n.Matrix3.fromScale(a.radii,W),p=n.Matrix3.fromScale(a.oneOverRadii,B),w=V;w[0]=0,w[1]=-s.z,w[2]=s.y,w[3]=s.z,w[4]=0,w[5]=-s.x,w[6]=-s.y,w[7]=s.x,w[8]=0;const R=n.Matrix3.multiply(n.Matrix3.multiply(d,p,Z),w,Z),S=n.Matrix3.multiply(n.Matrix3.multiply(R,g,A),f,A),O=n.Matrix3.multiplyByVector(R,r,z),x=function(t,e,a,r,s){const c=r*r,u=s*s,l=(t[n.Matrix3.COLUMN1ROW1]-t[n.Matrix3.COLUMN2ROW2])*u,C=s*(r*q(t[n.Matrix3.COLUMN1ROW0],t[n.Matrix3.COLUMN0ROW1],i.CesiumMath.EPSILON15)+e.y),M=t[n.Matrix3.COLUMN0ROW0]*c+t[n.Matrix3.COLUMN2ROW2]*u+r*e.x+a,h=u*q(t[n.Matrix3.COLUMN2ROW1],t[n.Matrix3.COLUMN1ROW2],i.CesiumMath.EPSILON15),f=s*(r*q(t[n.Matrix3.COLUMN2ROW0],t[n.Matrix3.COLUMN0ROW2])+e.z);let d;const g=[];if(0===f&&0===h){if(d=o.computeRealRoots(l,C,M),0===d.length)return g;const t=d[0],e=Math.sqrt(Math.max(1-t*t,0));if(g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e)),2===d.length){const t=d[1],e=Math.sqrt(Math.max(1-t*t,0));g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e))}return g}const p=f*f,w=h*h,R=f*h,S=l*l+w,O=2*(C*l+R),x=2*M*l+C*C-w+p,y=2*(M*C-R),P=M*M-p;if(0===S&&0===O&&0===x&&0===y)return g;d=m.computeRealRoots(S,O,x,y,P);const N=d.length;if(0===N)return g;for(let t=0;t<N;++t){const e=d[t],a=e*e,o=Math.max(1-a,0),c=Math.sqrt(o);let u;u=i.CesiumMath.sign(l)===i.CesiumMath.sign(M)?q(l*a+M,C*e,i.CesiumMath.EPSILON12):i.CesiumMath.sign(M)===i.CesiumMath.sign(C*e)?q(l*a,C*e+M,i.CesiumMath.EPSILON12):q(l*a+C*e,M,i.CesiumMath.EPSILON12);const m=u*q(h*e,f,i.CesiumMath.EPSILON15);m<0?g.push(new n.Cartesian3(r,s*e,s*c)):m>0?g.push(new n.Cartesian3(r,s*e,s*-c)):0!==c?(g.push(new n.Cartesian3(r,s*e,s*-c)),g.push(new n.Cartesian3(r,s*e,s*c)),++t):g.push(new n.Cartesian3(r,s*e,s*c))}return g}(S,n.Cartesian3.negate(O,L),0,0,1);let y,P;const N=x.length;if(N>0){let t=n.Cartesian3.clone(n.Cartesian3.ZERO,F),e=Number.NEGATIVE_INFINITY;for(let a=0;a<N;++a){y=n.Matrix3.multiplyByVector(g,n.Matrix3.multiplyByVector(f,x[a],D),D);const i=n.Cartesian3.normalize(n.Cartesian3.subtract(y,r,v),v),o=n.Cartesian3.dot(i,s);o>e&&(e=o,t=n.Cartesian3.clone(y,t))}const o=a.cartesianToCartographic(t,G);return e=i.CesiumMath.clamp(e,0,1),P=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r,v))*Math.sqrt(1-e*e),P=c?-P:P,o.height=P,a.cartographicToCartesian(o,new n.Cartesian3)}};const Y=new n.Cartesian3;d.lineSegmentPlane=function(t,a,r,s){e.defined(s)||(s=new n.Cartesian3);const o=n.Cartesian3.subtract(a,t,Y),c=r.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON6)return;const l=n.Cartesian3.dot(c,t),C=-(r.distance+l)/u;return C<0||C>1?void 0:(n.Cartesian3.multiplyByScalar(o,C,s),n.Cartesian3.add(t,s,s),s)},d.trianglePlaneIntersection=function(t,e,a,i){const r=i.normal,s=i.distance,o=n.Cartesian3.dot(r,t)+s<0,c=n.Cartesian3.dot(r,e)+s<0,u=n.Cartesian3.dot(r,a)+s<0;let l,C,M=0;if(M+=o?1:0,M+=c?1:0,M+=u?1:0,1!==M&&2!==M||(l=new n.Cartesian3,C=new n.Cartesian3),1===M){if(o)return d.lineSegmentPlane(t,e,i,l),d.lineSegmentPlane(t,a,i,C),{positions:[t,e,a,l,C],indices:[0,3,4,1,2,4,1,4,3]};if(c)return d.lineSegmentPlane(e,a,i,l),d.lineSegmentPlane(e,t,i,C),{positions:[t,e,a,l,C],indices:[1,3,4,2,0,4,2,4,3]};if(u)return d.lineSegmentPlane(a,t,i,l),d.lineSegmentPlane(a,e,i,C),{positions:[t,e,a,l,C],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===M){if(!o)return d.lineSegmentPlane(e,t,i,l),d.lineSegmentPlane(a,t,i,C),{positions:[t,e,a,l,C],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return d.lineSegmentPlane(a,e,i,l),d.lineSegmentPlane(t,e,i,C),{positions:[t,e,a,l,C],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return d.lineSegmentPlane(t,a,i,l),d.lineSegmentPlane(e,a,i,C),{positions:[t,e,a,l,C],indices:[0,1,4,0,4,3,2,3,4]}}};var _=d;t.IntersectionTests=_,t.Ray=f})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Transforms-f17097e5","./Math-355606c6"],(function(t,n,e,a,i){"use strict";const r={};function s(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}r.computeDiscriminant=function(t,n,e){return n*n-4*t*e},r.computeRealRoots=function(t,n,e){let a;if(0===t)return 0===n?[]:[-e/n];if(0===n){if(0===e)return[0,0];const n=Math.abs(e),r=Math.abs(t);if(n<r&&n/r<i.CesiumMath.EPSILON14)return[0,0];if(n>r&&r/n<i.CesiumMath.EPSILON14)return[];if(a=-e/t,a<0)return[];const s=Math.sqrt(a);return[-s,s]}if(0===e)return a=-n/t,a<0?[a,0]:[0,a];const r=s(n*n,-(4*t*e),i.CesiumMath.EPSILON14);if(r<0)return[];const o=-.5*s(n,i.CesiumMath.sign(n)*Math.sqrt(r),i.CesiumMath.EPSILON14);return n>0?[o/t,e/o]:[e/o,o/t]};var o=r;const c={};function u(t,n,e,a){const i=t,r=n/3,s=e/3,o=a,c=i*s,u=r*o,l=r*r,C=s*s,M=i*s-l,h=i*o-r*s,m=r*o-C,f=4*M*m-h*h;let d,g;if(f<0){let t,n,e;l*u>=c*C?(t=i,n=M,e=-2*r*M+i*h):(t=o,n=m,e=-o*h+2*s*m);const a=-(e<0?-1:1)*Math.abs(t)*Math.sqrt(-f);g=-e+a;const p=g/2,w=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),R=g===a?-w:-n/w;return d=n<=0?w+R:-e/(w*w+R*R+n),l*u>=c*C?[(d-r)/i]:[-o/(d+s)]}const p=M,w=-2*r*M+i*h,R=m,S=-o*h+2*s*m,O=Math.sqrt(f),x=Math.sqrt(3)/2;let y=Math.abs(Math.atan2(i*O,-w)/3);d=2*Math.sqrt(-p);let P=Math.cos(y);g=d*P;let N=d*(-P/2-x*Math.sin(y));const b=g+N>2*r?g-r:N-r,q=i,L=b/q;y=Math.abs(Math.atan2(o*O,-S)/3),d=2*Math.sqrt(-R),P=Math.cos(y),g=d*P,N=d*(-P/2-x*Math.sin(y));const I=-o,E=g+N<2*s?g+s:N+s,v=I/E,z=-b*E-q*I,T=(s*z-r*(b*I))/(-r*z+s*(q*E));return L<=T?L<=v?T<=v?[L,T,v]:[L,v,T]:[v,L,T]:L<=v?[T,L,v]:T<=v?[T,v,L]:[v,T,L]}c.computeDiscriminant=function(t,n,e,a){const i=n*n,r=e*e;return 18*t*n*e*a+i*r-27*(t*t)*(a*a)-4*(t*r*e+i*n*a)},c.computeRealRoots=function(t,n,e,a){let i,r;if(0===t)return o.computeRealRoots(n,e,a);if(0===n){if(0===e){if(0===a)return[0,0,0];r=-a/t;const n=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[n,n,n]}return 0===a?(i=o.computeRealRoots(t,0,e),0===i.Length?[0]:[i[0],0,i[1]]):u(t,0,e,a)}return 0===e?0===a?(r=-n/t,r<0?[r,0,0]:[0,0,r]):u(t,n,0,a):0===a?(i=o.computeRealRoots(t,n,e),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):u(t,n,e,a)};var l=c;const C={};function M(t,n,e,a){const r=t*t,s=n-3*r/8,c=e-n*t/2+r*t/8,u=a-e*t/4+n*r/16-3*r*r/256,C=l.computeRealRoots(1,2*s,s*s-4*u,-c*c);if(C.length>0){const n=-t/4,e=C[C.length-1];if(Math.abs(e)<i.CesiumMath.EPSILON14){const t=o.computeRealRoots(1,s,u);if(2===t.length){const e=t[0],a=t[1];let i;if(e>=0&&a>=0){const t=Math.sqrt(e),i=Math.sqrt(a);return[n-i,n-t,n+t,n+i]}if(e>=0&&a<0)return i=Math.sqrt(e),[n-i,n+i];if(e<0&&a>=0)return i=Math.sqrt(a),[n-i,n+i]}return[]}if(e>0){const t=Math.sqrt(e),a=(s+e-c/t)/2,i=(s+e+c/t)/2,r=o.computeRealRoots(1,t,a),u=o.computeRealRoots(1,-t,i);return 0!==r.length?(r[0]+=n,r[1]+=n,0!==u.length?(u[0]+=n,u[1]+=n,r[1]<=u[0]?[r[0],r[1],u[0],u[1]]:u[1]<=r[0]?[u[0],u[1],r[0],r[1]]:r[0]>=u[0]&&r[1]<=u[1]?[u[0],r[0],r[1],u[1]]:u[0]>=r[0]&&u[1]<=r[1]?[r[0],u[0],u[1],r[1]]:r[0]>u[0]&&r[0]<u[1]?[u[0],r[0],u[1],r[1]]:[r[0],u[0],r[1],u[1]]):r):0!==u.length?(u[0]+=n,u[1]+=n,u):[]}}return[]}function h(t,n,e,a){const r=t*t,s=-2*n,c=e*t+n*n-4*a,u=r*a-e*n*t+e*e,C=l.computeRealRoots(1,s,c,u);if(C.length>0){const s=C[0],c=n-s,u=c*c,l=t/2,M=c/2,h=u-4*a,m=u+4*Math.abs(a),f=r-4*s,d=r+4*Math.abs(s);let g,p,w,R,S,O;if(s<0||h*d<f*m){const n=Math.sqrt(f);g=n/2,p=0===n?0:(t*M-e)/n}else{const n=Math.sqrt(h);g=0===n?0:(t*M-e)/n,p=n/2}0===l&&0===g?(w=0,R=0):i.CesiumMath.sign(l)===i.CesiumMath.sign(g)?(w=l+g,R=s/w):(R=l-g,w=s/R),0===M&&0===p?(S=0,O=0):i.CesiumMath.sign(M)===i.CesiumMath.sign(p)?(S=M+p,O=a/S):(O=M-p,S=a/O);const x=o.computeRealRoots(1,w,S),y=o.computeRealRoots(1,R,O);if(0!==x.length)return 0!==y.length?x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>y[0]&&x[0]<y[1]?[y[0],x[0],y[1],x[1]]:[x[0],y[0],x[1],y[1]]:x;if(0!==y.length)return y}return[]}C.computeDiscriminant=function(t,n,e,a,i){const r=t*t,s=n*n,o=s*n,c=e*e,u=c*e,l=a*a,C=l*a,M=i*i;return s*c*l-4*o*C-4*t*u*l+18*t*n*e*C-27*r*l*l+256*(r*t)*(M*i)+i*(18*o*e*a-4*s*u+16*t*c*c-80*t*n*c*a-6*t*s*l+144*r*e*l)+M*(144*t*s*e-27*s*s-128*r*c-192*r*n*a)},C.computeRealRoots=function(t,n,e,a,r){if(Math.abs(t)<i.CesiumMath.EPSILON15)return l.computeRealRoots(n,e,a,r);const s=n/t,o=e/t,c=a/t,u=r/t;let C=s<0?1:0;switch(C+=o<0?C+1:C,C+=c<0?C+1:C,C+=u<0?C+1:C,C){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return M(s,o,c,u);case 1:case 2:case 5:case 8:case 11:return h(s,o,c,u);default:return}};var m=C;function f(t,a){a=n.Cartesian3.clone(e.defaultValue(a,n.Cartesian3.ZERO)),n.Cartesian3.equals(a,n.Cartesian3.ZERO)||n.Cartesian3.normalize(a,a),this.origin=n.Cartesian3.clone(e.defaultValue(t,n.Cartesian3.ZERO)),this.direction=a}f.clone=function(t,a){if(e.defined(t))return e.defined(a)?(a.origin=n.Cartesian3.clone(t.origin),a.direction=n.Cartesian3.clone(t.direction),a):new f(t.origin,t.direction)},f.getPoint=function(t,a,i){return e.defined(i)||(i=new n.Cartesian3),i=n.Cartesian3.multiplyByScalar(t.direction,a,i),n.Cartesian3.add(t.origin,i,i)};const d={rayPlane:function(t,a,r){e.defined(r)||(r=new n.Cartesian3);const s=t.origin,o=t.direction,c=a.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON15)return;const l=(-a.distance-n.Cartesian3.dot(c,s))/u;return l<0?void 0:(r=n.Cartesian3.multiplyByScalar(o,l,r),n.Cartesian3.add(s,r,r))}},g=new n.Cartesian3,p=new n.Cartesian3,w=new n.Cartesian3,R=new n.Cartesian3,S=new n.Cartesian3;d.rayTriangleParametric=function(t,a,r,s,o){o=e.defaultValue(o,!1);const c=t.origin,u=t.direction,l=n.Cartesian3.subtract(r,a,g),C=n.Cartesian3.subtract(s,a,p),M=n.Cartesian3.cross(u,C,w),h=n.Cartesian3.dot(l,M);let m,f,d,O,x;if(o){if(h<i.CesiumMath.EPSILON6)return;if(m=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(m,M),d<0||d>h)return;if(f=n.Cartesian3.cross(m,l,S),O=n.Cartesian3.dot(u,f),O<0||d+O>h)return;x=n.Cartesian3.dot(C,f)/h}else{if(Math.abs(h)<i.CesiumMath.EPSILON6)return;const t=1/h;if(m=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(m,M)*t,d<0||d>1)return;if(f=n.Cartesian3.cross(m,l,S),O=n.Cartesian3.dot(u,f)*t,O<0||d+O>1)return;x=n.Cartesian3.dot(C,f)*t}return x},d.rayTriangle=function(t,a,i,r,s,o){const c=d.rayTriangleParametric(t,a,i,r,s);if(e.defined(c)&&!(c<0))return e.defined(o)||(o=new n.Cartesian3),n.Cartesian3.multiplyByScalar(t.direction,c,o),n.Cartesian3.add(t.origin,o,o)};const O=new f;d.lineSegmentTriangle=function(t,a,i,r,s,o,c){const u=O;n.Cartesian3.clone(t,u.origin),n.Cartesian3.subtract(a,t,u.direction),n.Cartesian3.normalize(u.direction,u.direction);const l=d.rayTriangleParametric(u,i,r,s,o);if(!(!e.defined(l)||l<0||l>n.Cartesian3.distance(t,a)))return e.defined(c)||(c=new n.Cartesian3),n.Cartesian3.multiplyByScalar(u.direction,l,c),n.Cartesian3.add(u.origin,c,c)};const x={root0:0,root1:0};function y(t,i,r){e.defined(r)||(r=new a.Interval);const s=t.origin,o=t.direction,c=i.center,u=i.radius*i.radius,l=n.Cartesian3.subtract(s,c,w),C=function(t,n,e,a){const i=n*n-4*t*e;if(i<0)return;if(i>0){const e=1/(2*t),r=Math.sqrt(i),s=(-n+r)*e,o=(-n-r)*e;return s<o?(a.root0=s,a.root1=o):(a.root0=o,a.root1=s),a}const r=-n/(2*t);return 0!==r?(a.root0=a.root1=r,a):void 0}(n.Cartesian3.dot(o,o),2*n.Cartesian3.dot(o,l),n.Cartesian3.magnitudeSquared(l)-u,x);if(e.defined(C))return r.start=C.root0,r.stop=C.root1,r}d.raySphere=function(t,n,a){if(a=y(t,n,a),e.defined(a)&&!(a.stop<0))return a.start=Math.max(a.start,0),a};const P=new f;d.lineSegmentSphere=function(t,a,i,r){const s=P;n.Cartesian3.clone(t,s.origin);const o=n.Cartesian3.subtract(a,t,s.direction),c=n.Cartesian3.magnitude(o);if(n.Cartesian3.normalize(o,o),r=y(s,i,r),!(!e.defined(r)||r.stop<0||r.start>c))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,c),r};const N=new n.Cartesian3,b=new n.Cartesian3;function q(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}d.rayEllipsoid=function(t,e){const i=e.oneOverRadii,r=n.Cartesian3.multiplyComponents(i,t.origin,N),s=n.Cartesian3.multiplyComponents(i,t.direction,b),o=n.Cartesian3.magnitudeSquared(r),c=n.Cartesian3.dot(r,s);let u,l,C,M,h;if(o>1){if(c>=0)return;const t=c*c;if(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,t<C)return;if(t>C){M=c*c-C,h=-c+Math.sqrt(M);const t=h/l,n=u/h;return t<n?new a.Interval(t,n):{start:n,stop:t}}const e=Math.sqrt(u/l);return new a.Interval(e,e)}return o<1?(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,M=c*c-C,h=-c+Math.sqrt(M),new a.Interval(0,h/l)):c<0?(l=n.Cartesian3.magnitudeSquared(s),new a.Interval(0,-c/l)):void 0};const L=new n.Cartesian3,I=new n.Cartesian3,E=new n.Cartesian3,v=new n.Cartesian3,z=new n.Cartesian3,T=new n.Matrix3,U=new n.Matrix3,W=new n.Matrix3,B=new n.Matrix3,V=new n.Matrix3,Z=new n.Matrix3,A=new n.Matrix3,D=new n.Cartesian3,F=new n.Cartesian3,G=new n.Cartographic;d.grazingAltitudeLocation=function(t,a){const r=t.origin,s=t.direction;if(!n.Cartesian3.equals(r,n.Cartesian3.ZERO)){const t=a.geodeticSurfaceNormal(r,L);if(n.Cartesian3.dot(s,t)>=0)return r}const c=e.defined(this.rayEllipsoid(t,a)),u=a.transformPositionToScaledSpace(s,L),l=n.Cartesian3.normalize(u,u),C=n.Cartesian3.mostOrthogonalAxis(u,v),M=n.Cartesian3.normalize(n.Cartesian3.cross(C,l,I),I),h=n.Cartesian3.normalize(n.Cartesian3.cross(l,M,E),E),f=T;f[0]=l.x,f[1]=l.y,f[2]=l.z,f[3]=M.x,f[4]=M.y,f[5]=M.z,f[6]=h.x,f[7]=h.y,f[8]=h.z;const d=n.Matrix3.transpose(f,U),g=n.Matrix3.fromScale(a.radii,W),p=n.Matrix3.fromScale(a.oneOverRadii,B),w=V;w[0]=0,w[1]=-s.z,w[2]=s.y,w[3]=s.z,w[4]=0,w[5]=-s.x,w[6]=-s.y,w[7]=s.x,w[8]=0;const R=n.Matrix3.multiply(n.Matrix3.multiply(d,p,Z),w,Z),S=n.Matrix3.multiply(n.Matrix3.multiply(R,g,A),f,A),O=n.Matrix3.multiplyByVector(R,r,z),x=function(t,e,a,r,s){const c=r*r,u=s*s,l=(t[n.Matrix3.COLUMN1ROW1]-t[n.Matrix3.COLUMN2ROW2])*u,C=s*(r*q(t[n.Matrix3.COLUMN1ROW0],t[n.Matrix3.COLUMN0ROW1],i.CesiumMath.EPSILON15)+e.y),M=t[n.Matrix3.COLUMN0ROW0]*c+t[n.Matrix3.COLUMN2ROW2]*u+r*e.x+a,h=u*q(t[n.Matrix3.COLUMN2ROW1],t[n.Matrix3.COLUMN1ROW2],i.CesiumMath.EPSILON15),f=s*(r*q(t[n.Matrix3.COLUMN2ROW0],t[n.Matrix3.COLUMN0ROW2])+e.z);let d;const g=[];if(0===f&&0===h){if(d=o.computeRealRoots(l,C,M),0===d.length)return g;const t=d[0],e=Math.sqrt(Math.max(1-t*t,0));if(g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e)),2===d.length){const t=d[1],e=Math.sqrt(Math.max(1-t*t,0));g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e))}return g}const p=f*f,w=h*h,R=f*h,S=l*l+w,O=2*(C*l+R),x=2*M*l+C*C-w+p,y=2*(M*C-R),P=M*M-p;if(0===S&&0===O&&0===x&&0===y)return g;d=m.computeRealRoots(S,O,x,y,P);const N=d.length;if(0===N)return g;for(let t=0;t<N;++t){const e=d[t],a=e*e,o=Math.max(1-a,0),c=Math.sqrt(o);let u;u=i.CesiumMath.sign(l)===i.CesiumMath.sign(M)?q(l*a+M,C*e,i.CesiumMath.EPSILON12):i.CesiumMath.sign(M)===i.CesiumMath.sign(C*e)?q(l*a,C*e+M,i.CesiumMath.EPSILON12):q(l*a+C*e,M,i.CesiumMath.EPSILON12);const m=u*q(h*e,f,i.CesiumMath.EPSILON15);m<0?g.push(new n.Cartesian3(r,s*e,s*c)):m>0?g.push(new n.Cartesian3(r,s*e,s*-c)):0!==c?(g.push(new n.Cartesian3(r,s*e,s*-c)),g.push(new n.Cartesian3(r,s*e,s*c)),++t):g.push(new n.Cartesian3(r,s*e,s*c))}return g}(S,n.Cartesian3.negate(O,L),0,0,1);let y,P;const N=x.length;if(N>0){let t=n.Cartesian3.clone(n.Cartesian3.ZERO,F),e=Number.NEGATIVE_INFINITY;for(let a=0;a<N;++a){y=n.Matrix3.multiplyByVector(g,n.Matrix3.multiplyByVector(f,x[a],D),D);const i=n.Cartesian3.normalize(n.Cartesian3.subtract(y,r,v),v),o=n.Cartesian3.dot(i,s);o>e&&(e=o,t=n.Cartesian3.clone(y,t))}const o=a.cartesianToCartographic(t,G);return e=i.CesiumMath.clamp(e,0,1),P=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r,v))*Math.sqrt(1-e*e),P=c?-P:P,o.height=P,a.cartographicToCartesian(o,new n.Cartesian3)}};const Y=new n.Cartesian3;d.lineSegmentPlane=function(t,a,r,s){e.defined(s)||(s=new n.Cartesian3);const o=n.Cartesian3.subtract(a,t,Y),c=r.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON6)return;const l=n.Cartesian3.dot(c,t),C=-(r.distance+l)/u;return C<0||C>1?void 0:(n.Cartesian3.multiplyByScalar(o,C,s),n.Cartesian3.add(t,s,s),s)},d.trianglePlaneIntersection=function(t,e,a,i){const r=i.normal,s=i.distance,o=n.Cartesian3.dot(r,t)+s<0,c=n.Cartesian3.dot(r,e)+s<0,u=n.Cartesian3.dot(r,a)+s<0;let l,C,M=0;if(M+=o?1:0,M+=c?1:0,M+=u?1:0,1!==M&&2!==M||(l=new n.Cartesian3,C=new n.Cartesian3),1===M){if(o)return d.lineSegmentPlane(t,e,i,l),d.lineSegmentPlane(t,a,i,C),{positions:[t,e,a,l,C],indices:[0,3,4,1,2,4,1,4,3]};if(c)return d.lineSegmentPlane(e,a,i,l),d.lineSegmentPlane(e,t,i,C),{positions:[t,e,a,l,C],indices:[1,3,4,2,0,4,2,4,3]};if(u)return d.lineSegmentPlane(a,t,i,l),d.lineSegmentPlane(a,e,i,C),{positions:[t,e,a,l,C],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===M){if(!o)return d.lineSegmentPlane(e,t,i,l),d.lineSegmentPlane(a,t,i,C),{positions:[t,e,a,l,C],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return d.lineSegmentPlane(a,e,i,l),d.lineSegmentPlane(t,e,i,C),{positions:[t,e,a,l,C],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return d.lineSegmentPlane(t,a,i,l),d.lineSegmentPlane(e,a,i,C),{positions:[t,e,a,l,C],indices:[0,1,4,0,4,3,2,3,4]}}};var _=d;t.IntersectionTests=_,t.Ray=f})); diff --git a/public/lib/Cesium/Workers/Math-2ce22ee9.js b/public/lib/Cesium/Workers/Math-2ce22ee9.js deleted file mode 100644 index 447f525a..00000000 --- a/public/lib/Cesium/Workers/Math-2ce22ee9.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./defaultValue-f6d5e6da"],(function(t,n){"use strict";var i=function(t){null==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};i.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},i.prototype.init_by_array=function(t,n){var i,e,r;for(this.init_seed(19650218),i=1,e=0,r=this.N>n?this.N:n;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&a)>>>16)<<16)+1664525*(65535&a))+t[e]+e,this.mt[i]>>>=0,e++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),e>=n&&(e=0)}for(r=this.N-1;r;r--){a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1566083941*((4294901760&a)>>>16)<<16)+1566083941*(65535&a))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},i.prototype.random_int=function(){var t,n=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_seed(5489),i=0;i<this.N-this.M;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^t>>>1^n[1&t];for(;i<this.N-1;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^t>>>1^n[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^n[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},i.prototype.random_int31=function(){return this.random_int()>>>1},i.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},i.prototype.random=function(){return this.random_int()*(1/4294967296)},i.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},i.prototype.random_long=function(){return(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))*(1/9007199254740992)};var e=i;const r={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};r.sign=n.defaultValue(Math.sign,(function(t){return 0===(t=+t)||t!=t?t:t>0?1:-1})),r.signNotZero=function(t){return t<0?-1:1},r.toSNorm=function(t,i){return i=n.defaultValue(i,255),Math.round((.5*r.clamp(t,-1,1)+.5)*i)},r.fromSNorm=function(t,i){return i=n.defaultValue(i,255),r.clamp(t,0,i)/i*2-1},r.normalize=function(t,n,i){return 0===(i=Math.max(i-n,0))?0:r.clamp((t-n)/i,0,1)},r.sinh=n.defaultValue(Math.sinh,(function(t){return(Math.exp(t)-Math.exp(-t))/2})),r.cosh=n.defaultValue(Math.cosh,(function(t){return(Math.exp(t)+Math.exp(-t))/2})),r.lerp=function(t,n,i){return(1-i)*t+i*n},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=Math.PI/2,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=3*Math.PI/2,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(t){return t*r.RADIANS_PER_DEGREE},r.toDegrees=function(t){return t*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(t){const n=r.TWO_PI,i=t-Math.floor(t/n)*n;return i<-Math.PI?i+n:i>=Math.PI?i-n:i},r.clampToLatitudeRange=function(t){return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)},r.negativePiToPi=function(t){return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI},r.zeroToTwoPi=function(t){if(t>=0&&t<=r.TWO_PI)return t;const n=r.mod(t,r.TWO_PI);return Math.abs(n)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:n},r.mod=function(t,n){return r.sign(t)===r.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},r.equalsEpsilon=function(t,i,e,r){e=n.defaultValue(e,0),r=n.defaultValue(r,e);const a=Math.abs(t-i);return a<=r||a<=e*Math.max(Math.abs(t),Math.abs(i))},r.lessThan=function(t,n,i){return t-n<-i},r.lessThanOrEquals=function(t,n,i){return t-n<i},r.greaterThan=function(t,n,i){return t-n>i},r.greaterThanOrEquals=function(t,n,i){return t-n>-i};const a=[1];r.factorial=function(t){const n=a.length;if(t>=n){let i=a[n-1];for(let e=n;e<=t;e++){const t=i*e;a.push(t),i=t}}return a[t]},r.incrementWrap=function(t,i,e){return e=n.defaultValue(e,0),++t>i&&(t=e),t},r.isPowerOfTwo=function(t){return 0!==t&&0==(t&t-1)},r.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},r.previousPowerOfTwo=function(t){return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t=((t|=t>>32)>>>0)-(t>>>1)},r.clamp=function(t,n,i){return t<n?n:t>i?i:t};let s=new e;r.setRandomNumberSeed=function(t){s=new e(t)},r.nextRandomNumber=function(){return s.random()},r.randomBetween=function(t,n){return r.nextRandomNumber()*(n-t)+t},r.acosClamped=function(t){return Math.acos(r.clamp(t,-1,1))},r.asinClamped=function(t){return Math.asin(r.clamp(t,-1,1))},r.chordLength=function(t,n){return 2*n*Math.sin(.5*t)},r.logBase=function(t,n){return Math.log(t)/Math.log(n)},r.cbrt=n.defaultValue(Math.cbrt,(function(t){const n=Math.pow(Math.abs(t),1/3);return t<0?-n:n})),r.log2=n.defaultValue(Math.log2,(function(t){return Math.log(t)*Math.LOG2E})),r.fog=function(t,n){const i=t*n;return 1-Math.exp(-i*i)},r.fastApproximateAtan=function(t){return t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},r.fastApproximateAtan2=function(t,n){let i,e=Math.abs(t);i=Math.abs(n);const a=Math.max(e,i);i=Math.min(e,i);const s=i/a;return e=r.fastApproximateAtan(s),e=Math.abs(n)>Math.abs(t)?r.PI_OVER_TWO-e:e,e=t<0?r.PI-e:e,e=n<0?-e:e,e};var h=r;t.CesiumMath=h})); diff --git a/public/lib/Cesium/Workers/Math-355606c6.js b/public/lib/Cesium/Workers/Math-355606c6.js new file mode 100644 index 00000000..798167a1 --- /dev/null +++ b/public/lib/Cesium/Workers/Math-355606c6.js @@ -0,0 +1 @@ +define(["exports","./defaultValue-f6d5e6da"],(function(t,n){"use strict";var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r=function(t){null==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};r.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},r.prototype.init_by_array=function(t,n){var i,e,r;for(this.init_seed(19650218),i=1,e=0,r=this.N>n?this.N:n;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&a)>>>16)<<16)+1664525*(65535&a))+t[e]+e,this.mt[i]>>>=0,e++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),e>=n&&(e=0)}for(r=this.N-1;r;r--){a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1566083941*((4294901760&a)>>>16)<<16)+1566083941*(65535&a))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},r.prototype.random_int=function(){var t,n=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_seed(5489),i=0;i<this.N-this.M;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^t>>>1^n[1&t];for(;i<this.N-1;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^t>>>1^n[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^n[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},r.prototype.random_int31=function(){return this.random_int()>>>1},r.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},r.prototype.random=function(){return this.random_int()*(1/4294967296)},r.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},r.prototype.random_long=function(){return(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))*(1/9007199254740992)};var a=e(r);const o={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};o.sign=n.defaultValue(Math.sign,(function(t){return 0===(t=+t)||t!=t?t:t>0?1:-1})),o.signNotZero=function(t){return t<0?-1:1},o.toSNorm=function(t,i){return i=n.defaultValue(i,255),Math.round((.5*o.clamp(t,-1,1)+.5)*i)},o.fromSNorm=function(t,i){return i=n.defaultValue(i,255),o.clamp(t,0,i)/i*2-1},o.normalize=function(t,n,i){return 0===(i=Math.max(i-n,0))?0:o.clamp((t-n)/i,0,1)},o.sinh=n.defaultValue(Math.sinh,(function(t){return(Math.exp(t)-Math.exp(-t))/2})),o.cosh=n.defaultValue(Math.cosh,(function(t){return(Math.exp(t)+Math.exp(-t))/2})),o.lerp=function(t,n,i){return(1-i)*t+i*n},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=Math.PI/2,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI/2,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(t){return t*o.RADIANS_PER_DEGREE},o.toDegrees=function(t){return t*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(t){const n=o.TWO_PI,i=t-Math.floor(t/n)*n;return i<-Math.PI?i+n:i>=Math.PI?i-n:i},o.clampToLatitudeRange=function(t){return o.clamp(t,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(t){return t>=-o.PI&&t<=o.PI?t:o.zeroToTwoPi(t+o.PI)-o.PI},o.zeroToTwoPi=function(t){if(t>=0&&t<=o.TWO_PI)return t;const n=o.mod(t,o.TWO_PI);return Math.abs(n)<o.EPSILON14&&Math.abs(t)>o.EPSILON14?o.TWO_PI:n},o.mod=function(t,n){return o.sign(t)===o.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},o.equalsEpsilon=function(t,i,e,r){e=n.defaultValue(e,0),r=n.defaultValue(r,e);const a=Math.abs(t-i);return a<=r||a<=e*Math.max(Math.abs(t),Math.abs(i))},o.lessThan=function(t,n,i){return t-n<-i},o.lessThanOrEquals=function(t,n,i){return t-n<i},o.greaterThan=function(t,n,i){return t-n>i},o.greaterThanOrEquals=function(t,n,i){return t-n>-i};const s=[1];o.factorial=function(t){const n=s.length;if(t>=n){let i=s[n-1];for(let e=n;e<=t;e++){const t=i*e;s.push(t),i=t}}return s[t]},o.incrementWrap=function(t,i,e){return e=n.defaultValue(e,0),++t>i&&(t=e),t},o.isPowerOfTwo=function(t){return 0!==t&&0==(t&t-1)},o.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},o.previousPowerOfTwo=function(t){return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t=((t|=t>>32)>>>0)-(t>>>1)},o.clamp=function(t,n,i){return t<n?n:t>i?i:t};let h=new a;o.setRandomNumberSeed=function(t){h=new a(t)},o.nextRandomNumber=function(){return h.random()},o.randomBetween=function(t,n){return o.nextRandomNumber()*(n-t)+t},o.acosClamped=function(t){return Math.acos(o.clamp(t,-1,1))},o.asinClamped=function(t){return Math.asin(o.clamp(t,-1,1))},o.chordLength=function(t,n){return 2*n*Math.sin(.5*t)},o.logBase=function(t,n){return Math.log(t)/Math.log(n)},o.cbrt=n.defaultValue(Math.cbrt,(function(t){const n=Math.pow(Math.abs(t),1/3);return t<0?-n:n})),o.log2=n.defaultValue(Math.log2,(function(t){return Math.log(t)*Math.LOG2E})),o.fog=function(t,n){const i=t*n;return 1-Math.exp(-i*i)},o.fastApproximateAtan=function(t){return t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},o.fastApproximateAtan2=function(t,n){let i,e=Math.abs(t);i=Math.abs(n);const r=Math.max(e,i);i=Math.min(e,i);const a=i/r;return e=o.fastApproximateAtan(a),e=Math.abs(n)>Math.abs(t)?o.PI_OVER_TWO-e:e,e=t<0?o.PI-e:e,e=n<0?-e:e,e};var u=o;t.CesiumMath=u,t.commonjsGlobal=i,t.getDefaultExportFromCjs=e})); diff --git a/public/lib/Cesium/Workers/Matrix2-413c4048.js b/public/lib/Cesium/Workers/Matrix2-7a8e9daf.js similarity index 99% rename from public/lib/Cesium/Workers/Matrix2-413c4048.js rename to public/lib/Cesium/Workers/Matrix2-7a8e9daf.js index 4b3d0c1e..c7ceac2b 100644 --- a/public/lib/Cesium/Workers/Matrix2-413c4048.js +++ b/public/lib/Cesium/Workers/Matrix2-7a8e9daf.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./RuntimeError-9b4ce3fb"],(function(t,e,n,a,u){"use strict";function r(t,e,a,u){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(a,0),this.w=n.defaultValue(u,0)}r.fromElements=function(t,e,a,u,i){return n.defined(i)?(i.x=t,i.y=e,i.z=a,i.w=u,i):new r(t,e,a,u)},r.fromColor=function(t,e){return n.defined(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new r(t.red,t.green,t.blue,t.alpha)},r.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new r(t.x,t.y,t.z,t.w)},r.packedLength=4,r.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a++]=t.y,e[a++]=t.z,e[a]=t.w,e},r.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new r),a.x=t[e++],a.y=t[e++],a.z=t[e++],a.w=t[e],a},r.packArray=function(t,e){const a=t.length,u=4*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)r.pack(t[n],e,4*n);return e},r.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/4:e=new Array(a/4);for(let n=0;n<a;n+=4){const a=n/4;e[a]=r.unpack(t,n,e[a])}return e},r.fromArray=r.unpack,r.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},r.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},r.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},r.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},r.clamp=function(t,e,n,u){const r=a.CesiumMath.clamp(t.x,e.x,n.x),i=a.CesiumMath.clamp(t.y,e.y,n.y),o=a.CesiumMath.clamp(t.z,e.z,n.z),s=a.CesiumMath.clamp(t.w,e.w,n.w);return u.x=r,u.y=i,u.z=o,u.w=s,u},r.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},r.magnitude=function(t){return Math.sqrt(r.magnitudeSquared(t))};const i=new r;r.distance=function(t,e){return r.subtract(t,e,i),r.magnitude(i)},r.distanceSquared=function(t,e){return r.subtract(t,e,i),r.magnitudeSquared(i)},r.normalize=function(t,e){const n=r.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},r.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},r.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},r.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},r.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},r.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},r.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},r.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},r.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},r.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};const o=new r;r.lerp=function(t,e,n,a){return r.multiplyByScalar(e,n,o),a=r.multiplyByScalar(t,1-n,a),r.add(o,a,a)};const s=new r;r.mostOrthogonalAxis=function(t,e){const n=r.normalize(t,s);return r.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?r.clone(r.UNIT_X,e):r.clone(r.UNIT_W,e):n.z<=n.w?r.clone(r.UNIT_Z,e):r.clone(r.UNIT_W,e):n.y<=n.z?n.y<=n.w?r.clone(r.UNIT_Y,e):r.clone(r.UNIT_W,e):n.z<=n.w?r.clone(r.UNIT_Z,e):r.clone(r.UNIT_W,e)},r.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},r.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},r.equalsEpsilon=function(t,e,u,r){return t===e||n.defined(t)&&n.defined(e)&&a.CesiumMath.equalsEpsilon(t.x,e.x,u,r)&&a.CesiumMath.equalsEpsilon(t.y,e.y,u,r)&&a.CesiumMath.equalsEpsilon(t.z,e.z,u,r)&&a.CesiumMath.equalsEpsilon(t.w,e.w,u,r)},r.ZERO=Object.freeze(new r(0,0,0,0)),r.ONE=Object.freeze(new r(1,1,1,1)),r.UNIT_X=Object.freeze(new r(1,0,0,0)),r.UNIT_Y=Object.freeze(new r(0,1,0,0)),r.UNIT_Z=Object.freeze(new r(0,0,1,0)),r.UNIT_W=Object.freeze(new r(0,0,0,1)),r.prototype.clone=function(t){return r.clone(this,t)},r.prototype.equals=function(t){return r.equals(this,t)},r.prototype.equalsEpsilon=function(t,e,n){return r.equalsEpsilon(this,t,e,n)},r.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const c=new Float32Array(1),l=new Uint8Array(c.buffer),f=new Uint32Array([287454020]),h=68===new Uint8Array(f.buffer)[0];function d(t,e,a,u,r,i,o,s,c,l,f,h,d,m,y,w){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(c,0),this[3]=n.defaultValue(d,0),this[4]=n.defaultValue(e,0),this[5]=n.defaultValue(i,0),this[6]=n.defaultValue(l,0),this[7]=n.defaultValue(m,0),this[8]=n.defaultValue(a,0),this[9]=n.defaultValue(o,0),this[10]=n.defaultValue(f,0),this[11]=n.defaultValue(y,0),this[12]=n.defaultValue(u,0),this[13]=n.defaultValue(s,0),this[14]=n.defaultValue(h,0),this[15]=n.defaultValue(w,0)}r.packFloat=function(t,e){return n.defined(e)||(e=new r),c[0]=t,h?(e.x=l[0],e.y=l[1],e.z=l[2],e.w=l[3]):(e.x=l[3],e.y=l[2],e.z=l[1],e.w=l[0]),e},r.unpackFloat=function(t){return h?(l[0]=t.x,l[1]=t.y,l[2]=t.z,l[3]=t.w):(l[0]=t.w,l[1]=t.z,l[2]=t.y,l[3]=t.x),c[0]},d.packedLength=16,d.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t[0],e[a++]=t[1],e[a++]=t[2],e[a++]=t[3],e[a++]=t[4],e[a++]=t[5],e[a++]=t[6],e[a++]=t[7],e[a++]=t[8],e[a++]=t[9],e[a++]=t[10],e[a++]=t[11],e[a++]=t[12],e[a++]=t[13],e[a++]=t[14],e[a]=t[15],e},d.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new d),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a[9]=t[e++],a[10]=t[e++],a[11]=t[e++],a[12]=t[e++],a[13]=t[e++],a[14]=t[e++],a[15]=t[e],a},d.packArray=function(t,e){const a=t.length,u=16*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)d.pack(t[n],e,16*n);return e},d.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/16:e=new Array(a/16);for(let n=0;n<a;n+=16){const a=n/16;e[a]=d.unpack(t,n,e[a])}return e},d.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):new d(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},d.fromArray=d.unpack,d.fromColumnMajorArray=function(t,e){return d.clone(t,e)},d.fromRowMajorArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new d(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},d.fromRotationTranslation=function(t,a,u){return a=n.defaultValue(a,e.Cartesian3.ZERO),n.defined(u)?(u[0]=t[0],u[1]=t[1],u[2]=t[2],u[3]=0,u[4]=t[3],u[5]=t[4],u[6]=t[5],u[7]=0,u[8]=t[6],u[9]=t[7],u[10]=t[8],u[11]=0,u[12]=a.x,u[13]=a.y,u[14]=a.z,u[15]=1,u):new d(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},d.fromTranslationQuaternionRotationScale=function(t,e,a,u){n.defined(u)||(u=new d);const r=a.x,i=a.y,o=a.z,s=e.x*e.x,c=e.x*e.y,l=e.x*e.z,f=e.x*e.w,h=e.y*e.y,m=e.y*e.z,y=e.y*e.w,w=e.z*e.z,x=e.z*e.w,M=e.w*e.w,p=s-h-w+M,g=2*(c-x),C=2*(l+y),z=2*(c+x),b=-s+h-w+M,O=2*(m-f),V=2*(l-y),T=2*(m+f),A=-s-h+w+M;return u[0]=p*r,u[1]=z*r,u[2]=V*r,u[3]=0,u[4]=g*i,u[5]=b*i,u[6]=T*i,u[7]=0,u[8]=C*o,u[9]=O*o,u[10]=A*o,u[11]=0,u[12]=t.x,u[13]=t.y,u[14]=t.z,u[15]=1,u},d.fromTranslationRotationScale=function(t,e){return d.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},d.fromTranslation=function(t,n){return d.fromRotationTranslation(e.Matrix3.IDENTITY,t,n)},d.fromScale=function(t,e){return n.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new d(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},d.fromUniformScale=function(t,e){return n.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new d(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},d.fromRotation=function(t,e){return n.defined(e)||(e=new d),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};const m=new e.Cartesian3,y=new e.Cartesian3,w=new e.Cartesian3;d.fromCamera=function(t,a){const u=t.position,r=t.direction,i=t.up;e.Cartesian3.normalize(r,m),e.Cartesian3.normalize(e.Cartesian3.cross(m,i,y),y),e.Cartesian3.normalize(e.Cartesian3.cross(y,m,w),w);const o=y.x,s=y.y,c=y.z,l=m.x,f=m.y,h=m.z,x=w.x,M=w.y,p=w.z,g=u.x,C=u.y,z=u.z,b=o*-g+s*-C+c*-z,O=x*-g+M*-C+p*-z,V=l*g+f*C+h*z;return n.defined(a)?(a[0]=o,a[1]=x,a[2]=-l,a[3]=0,a[4]=s,a[5]=M,a[6]=-f,a[7]=0,a[8]=c,a[9]=p,a[10]=-h,a[11]=0,a[12]=b,a[13]=O,a[14]=V,a[15]=1,a):new d(o,s,c,b,x,M,p,O,-l,-f,-h,V,0,0,0,1)},d.computePerspectiveFieldOfView=function(t,e,n,a,u){const r=1/Math.tan(.5*t),i=r/e,o=(a+n)/(n-a),s=2*a*n/(n-a);return u[0]=i,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=r,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=o,u[11]=-1,u[12]=0,u[13]=0,u[14]=s,u[15]=0,u},d.computeOrthographicOffCenter=function(t,e,n,a,u,r,i){let o=1/(e-t),s=1/(a-n),c=1/(r-u);const l=-(e+t)*o,f=-(a+n)*s,h=-(r+u)*c;return o*=2,s*=2,c*=-2,i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=0,i[12]=l,i[13]=f,i[14]=h,i[15]=1,i},d.computePerspectiveOffCenter=function(t,e,n,a,u,r,i){const o=2*u/(e-t),s=2*u/(a-n),c=(e+t)/(e-t),l=(a+n)/(a-n),f=-(r+u)/(r-u),h=-2*r*u/(r-u);return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=c,i[9]=l,i[10]=f,i[11]=-1,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},d.computeInfinitePerspectiveOffCenter=function(t,e,n,a,u,r){const i=2*u/(e-t),o=2*u/(a-n),s=(e+t)/(e-t),c=(a+n)/(a-n),l=-2*u;return r[0]=i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=s,r[9]=c,r[10]=-1,r[11]=-1,r[12]=0,r[13]=0,r[14]=l,r[15]=0,r},d.computeViewportTransformation=function(t,e,a,u){n.defined(u)||(u=new d),t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT);const r=n.defaultValue(t.x,0),i=n.defaultValue(t.y,0),o=n.defaultValue(t.width,0),s=n.defaultValue(t.height,0);e=n.defaultValue(e,0);const c=.5*o,l=.5*s,f=.5*((a=n.defaultValue(a,1))-e),h=c,m=l,y=f,w=r+c,x=i+l,M=e+f;return u[0]=h,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=m,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=y,u[11]=0,u[12]=w,u[13]=x,u[14]=M,u[15]=1,u},d.computeView=function(t,n,a,u,r){return r[0]=u.x,r[1]=a.x,r[2]=-n.x,r[3]=0,r[4]=u.y,r[5]=a.y,r[6]=-n.y,r[7]=0,r[8]=u.z,r[9]=a.z,r[10]=-n.z,r[11]=0,r[12]=-e.Cartesian3.dot(u,t),r[13]=-e.Cartesian3.dot(a,t),r[14]=e.Cartesian3.dot(n,t),r[15]=1,r},d.toArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},d.getElementIndex=function(t,e){return 4*t+e},d.getColumn=function(t,e,n){const a=4*e,u=t[a],r=t[a+1],i=t[a+2],o=t[a+3];return n.x=u,n.y=r,n.z=i,n.w=o,n},d.setColumn=function(t,e,n,a){const u=4*e;return(a=d.clone(t,a))[u]=n.x,a[u+1]=n.y,a[u+2]=n.z,a[u+3]=n.w,a},d.getRow=function(t,e,n){const a=t[e],u=t[e+4],r=t[e+8],i=t[e+12];return n.x=a,n.y=u,n.z=r,n.w=i,n},d.setRow=function(t,e,n,a){return(a=d.clone(t,a))[e]=n.x,a[e+4]=n.y,a[e+8]=n.z,a[e+12]=n.w,a},d.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n};const x=new e.Cartesian3;d.setScale=function(t,e,n){const a=d.getScale(t,x),u=e.x/a.x,r=e.y/a.y,i=e.z/a.z;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*u,n[3]=t[3],n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=t[7],n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const M=new e.Cartesian3;d.setUniformScale=function(t,e,n){const a=d.getScale(t,M),u=e/a.x,r=e/a.y,i=e/a.z;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*u,n[3]=t[3],n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=t[7],n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const p=new e.Cartesian3;d.getScale=function(t,n){return n.x=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[0],t[1],t[2],p)),n.y=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[4],t[5],t[6],p)),n.z=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[8],t[9],t[10],p)),n};const g=new e.Cartesian3;d.getMaximumScale=function(t){return d.getScale(t,g),e.Cartesian3.maximumComponent(g)};const C=new e.Cartesian3;d.setRotation=function(t,e,n){const a=d.getScale(t,C);return n[0]=e[0]*a.x,n[1]=e[1]*a.x,n[2]=e[2]*a.x,n[3]=t[3],n[4]=e[3]*a.y,n[5]=e[4]*a.y,n[6]=e[5]*a.y,n[7]=t[7],n[8]=e[6]*a.z,n[9]=e[7]*a.z,n[10]=e[8]*a.z,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const z=new e.Cartesian3;d.getRotation=function(t,e){const n=d.getScale(t,z);return e[0]=t[0]/n.x,e[1]=t[1]/n.x,e[2]=t[2]/n.x,e[3]=t[4]/n.y,e[4]=t[5]/n.y,e[5]=t[6]/n.y,e[6]=t[8]/n.z,e[7]=t[9]/n.z,e[8]=t[10]/n.z,e},d.multiply=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],w=t[13],x=t[14],M=t[15],p=e[0],g=e[1],C=e[2],z=e[3],b=e[4],O=e[5],V=e[6],T=e[7],A=e[8],E=e[9],I=e[10],U=e[11],N=e[12],S=e[13],P=e[14],_=e[15],q=a*p+o*g+f*C+y*z,R=u*p+s*g+h*C+w*z,W=r*p+c*g+d*C+x*z,L=i*p+l*g+m*C+M*z,k=a*b+o*O+f*V+y*T,B=u*b+s*O+h*V+w*T,$=r*b+c*O+d*V+x*T,j=i*b+l*O+m*V+M*T,v=a*A+o*E+f*I+y*U,X=u*A+s*E+h*I+w*U,Y=r*A+c*E+d*I+x*U,Z=i*A+l*E+m*I+M*U,D=a*N+o*S+f*P+y*_,F=u*N+s*S+h*P+w*_,G=r*N+c*S+d*P+x*_,H=i*N+l*S+m*P+M*_;return n[0]=q,n[1]=R,n[2]=W,n[3]=L,n[4]=k,n[5]=B,n[6]=$,n[7]=j,n[8]=v,n[9]=X,n[10]=Y,n[11]=Z,n[12]=D,n[13]=F,n[14]=G,n[15]=H,n},d.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},d.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},d.multiplyTransformation=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[4],o=t[5],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],w=e[1],x=e[2],M=e[4],p=e[5],g=e[6],C=e[8],z=e[9],b=e[10],O=e[12],V=e[13],T=e[14],A=a*y+i*w+c*x,E=u*y+o*w+l*x,I=r*y+s*w+f*x,U=a*M+i*p+c*g,N=u*M+o*p+l*g,S=r*M+s*p+f*g,P=a*C+i*z+c*b,_=u*C+o*z+l*b,q=r*C+s*z+f*b,R=a*O+i*V+c*T+h,W=u*O+o*V+l*T+d,L=r*O+s*V+f*T+m;return n[0]=A,n[1]=E,n[2]=I,n[3]=0,n[4]=U,n[5]=N,n[6]=S,n[7]=0,n[8]=P,n[9]=_,n[10]=q,n[11]=0,n[12]=R,n[13]=W,n[14]=L,n[15]=1,n},d.multiplyByMatrix3=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[4],o=t[5],s=t[6],c=t[8],l=t[9],f=t[10],h=e[0],d=e[1],m=e[2],y=e[3],w=e[4],x=e[5],M=e[6],p=e[7],g=e[8],C=a*h+i*d+c*m,z=u*h+o*d+l*m,b=r*h+s*d+f*m,O=a*y+i*w+c*x,V=u*y+o*w+l*x,T=r*y+s*w+f*x,A=a*M+i*p+c*g,E=u*M+o*p+l*g,I=r*M+s*p+f*g;return n[0]=C,n[1]=z,n[2]=b,n[3]=0,n[4]=O,n[5]=V,n[6]=T,n[7]=0,n[8]=A,n[9]=E,n[10]=I,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},d.multiplyByTranslation=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=a*t[0]+u*t[4]+r*t[8]+t[12],o=a*t[1]+u*t[5]+r*t[9]+t[13],s=a*t[2]+u*t[6]+r*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=i,n[13]=o,n[14]=s,n[15]=t[15],n},d.multiplyByScale=function(t,e,n){const a=e.x,u=e.y,r=e.z;return 1===a&&1===u&&1===r?d.clone(t,n):(n[0]=a*t[0],n[1]=a*t[1],n[2]=a*t[2],n[3]=t[3],n[4]=u*t[4],n[5]=u*t[5],n[6]=u*t[6],n[7]=t[7],n[8]=r*t[8],n[9]=r*t[9],n[10]=r*t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n)},d.multiplyByUniformScale=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3],n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7],n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},d.multiplyByVector=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=e.w,o=t[0]*a+t[4]*u+t[8]*r+t[12]*i,s=t[1]*a+t[5]*u+t[9]*r+t[13]*i,c=t[2]*a+t[6]*u+t[10]*r+t[14]*i,l=t[3]*a+t[7]*u+t[11]*r+t[15]*i;return n.x=o,n.y=s,n.z=c,n.w=l,n},d.multiplyByPointAsVector=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=t[0]*a+t[4]*u+t[8]*r,o=t[1]*a+t[5]*u+t[9]*r,s=t[2]*a+t[6]*u+t[10]*r;return n.x=i,n.y=o,n.z=s,n},d.multiplyByPoint=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=t[0]*a+t[4]*u+t[8]*r+t[12],o=t[1]*a+t[5]*u+t[9]*r+t[13],s=t[2]*a+t[6]*u+t[10]*r+t[14];return n.x=i,n.y=o,n.z=s,n},d.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},d.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e[11]=-t[11],e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=-t[15],e},d.transpose=function(t,e){const n=t[1],a=t[2],u=t[3],r=t[6],i=t[7],o=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=a,e[9]=r,e[10]=t[10],e[11]=t[14],e[12]=u,e[13]=i,e[14]=o,e[15]=t[15],e},d.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},d.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},d.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=a&&Math.abs(t[1]-e[1])<=a&&Math.abs(t[2]-e[2])<=a&&Math.abs(t[3]-e[3])<=a&&Math.abs(t[4]-e[4])<=a&&Math.abs(t[5]-e[5])<=a&&Math.abs(t[6]-e[6])<=a&&Math.abs(t[7]-e[7])<=a&&Math.abs(t[8]-e[8])<=a&&Math.abs(t[9]-e[9])<=a&&Math.abs(t[10]-e[10])<=a&&Math.abs(t[11]-e[11])<=a&&Math.abs(t[12]-e[12])<=a&&Math.abs(t[13]-e[13])<=a&&Math.abs(t[14]-e[14])<=a&&Math.abs(t[15]-e[15])<=a},d.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},d.getMatrix3=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};const b=new e.Matrix3,O=new e.Matrix3,V=new r,T=new r(0,0,0,1);d.inverse=function(t,n){const i=t[0],o=t[4],s=t[8],c=t[12],l=t[1],f=t[5],h=t[9],m=t[13],y=t[2],w=t[6],x=t[10],M=t[14],p=t[3],g=t[7],C=t[11],z=t[15];let A=x*z,E=M*C,I=w*z,U=M*g,N=w*C,S=x*g,P=y*z,_=M*p,q=y*C,R=x*p,W=y*g,L=w*p;const k=A*f+U*h+N*m-(E*f+I*h+S*m),B=E*l+P*h+R*m-(A*l+_*h+q*m),$=I*l+_*f+W*m-(U*l+P*f+L*m),j=S*l+q*f+L*h-(N*l+R*f+W*h),v=E*o+I*s+S*c-(A*o+U*s+N*c),X=A*i+_*s+q*c-(E*i+P*s+R*c),Y=U*i+P*o+L*c-(I*i+_*o+W*c),Z=N*i+R*o+W*s-(S*i+q*o+L*s);A=s*m,E=c*h,I=o*m,U=c*f,N=o*h,S=s*f,P=i*m,_=c*l,q=i*h,R=s*l,W=i*f,L=o*l;const D=A*g+U*C+N*z-(E*g+I*C+S*z),F=E*p+P*C+R*z-(A*p+_*C+q*z),G=I*p+_*g+W*z-(U*p+P*g+L*z),H=S*p+q*g+L*C-(N*p+R*g+W*C),Q=I*x+S*M+E*w-(N*M+A*w+U*x),J=q*M+A*y+_*x-(P*x+R*M+E*y),K=P*w+L*M+U*y-(W*M+I*y+_*w),tt=W*x+N*y+R*w-(q*w+L*x+S*y);let et=i*k+o*B+s*$+c*j;if(Math.abs(et)<a.CesiumMath.EPSILON21){if(e.Matrix3.equalsEpsilon(d.getMatrix3(t,b),O,a.CesiumMath.EPSILON7)&&r.equals(d.getRow(t,3,V),T))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new u.RuntimeError("matrix is not invertible because its determinate is zero.")}return et=1/et,n[0]=k*et,n[1]=B*et,n[2]=$*et,n[3]=j*et,n[4]=v*et,n[5]=X*et,n[6]=Y*et,n[7]=Z*et,n[8]=D*et,n[9]=F*et,n[10]=G*et,n[11]=H*et,n[12]=Q*et,n[13]=J*et,n[14]=K*et,n[15]=tt*et,n},d.inverseTransformation=function(t,e){const n=t[0],a=t[1],u=t[2],r=t[4],i=t[5],o=t[6],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-a*h-u*d,y=-r*f-i*h-o*d,w=-s*f-c*h-l*d;return e[0]=n,e[1]=r,e[2]=s,e[3]=0,e[4]=a,e[5]=i,e[6]=c,e[7]=0,e[8]=u,e[9]=o,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=w,e[15]=1,e};const A=new d;function E(t,e,a,u){this.west=n.defaultValue(t,0),this.south=n.defaultValue(e,0),this.east=n.defaultValue(a,0),this.north=n.defaultValue(u,0)}d.inverseTranspose=function(t,e){return d.inverse(d.transpose(t,A),e)},d.IDENTITY=Object.freeze(new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),d.ZERO=Object.freeze(new d(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),d.COLUMN0ROW0=0,d.COLUMN0ROW1=1,d.COLUMN0ROW2=2,d.COLUMN0ROW3=3,d.COLUMN1ROW0=4,d.COLUMN1ROW1=5,d.COLUMN1ROW2=6,d.COLUMN1ROW3=7,d.COLUMN2ROW0=8,d.COLUMN2ROW1=9,d.COLUMN2ROW2=10,d.COLUMN2ROW3=11,d.COLUMN3ROW0=12,d.COLUMN3ROW1=13,d.COLUMN3ROW2=14,d.COLUMN3ROW3=15,Object.defineProperties(d.prototype,{length:{get:function(){return d.packedLength}}}),d.prototype.clone=function(t){return d.clone(this,t)},d.prototype.equals=function(t){return d.equals(this,t)},d.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},d.prototype.equalsEpsilon=function(t,e){return d.equalsEpsilon(this,t,e)},d.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.west,e[a++]=t.south,e[a++]=t.east,e[a]=t.north,e},E.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){let e=t.east;const n=t.west;return e<n&&(e+=a.CesiumMath.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,u,r,i){return t=a.CesiumMath.toRadians(n.defaultValue(t,0)),e=a.CesiumMath.toRadians(n.defaultValue(e,0)),u=a.CesiumMath.toRadians(n.defaultValue(u,0)),r=a.CesiumMath.toRadians(n.defaultValue(r,0)),n.defined(i)?(i.west=t,i.south=e,i.east=u,i.north=r,i):new E(t,e,u,r)},E.fromRadians=function(t,e,a,u,r){return n.defined(r)?(r.west=n.defaultValue(t,0),r.south=n.defaultValue(e,0),r.east=n.defaultValue(a,0),r.north=n.defaultValue(u,0),r):new E(t,e,a,u)},E.fromCartographicArray=function(t,e){let u=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let e=0,n=t.length;e<n;e++){const n=t[e];u=Math.min(u,n.longitude),r=Math.max(r,n.longitude),s=Math.min(s,n.latitude),c=Math.max(c,n.latitude);const l=n.longitude>=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return r-u>o-i&&(u=i,r=o,r>a.CesiumMath.PI&&(r-=a.CesiumMath.TWO_PI),u>a.CesiumMath.PI&&(u-=a.CesiumMath.TWO_PI)),n.defined(e)?(e.west=u,e.south=s,e.east=r,e.north=c,e):new E(u,s,r,c)},E.fromCartesianArray=function(t,u,r){u=n.defaultValue(u,e.Ellipsoid.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let e=0,n=t.length;e<n;e++){const n=u.cartesianToCartographic(t[e]);i=Math.min(i,n.longitude),o=Math.max(o,n.longitude),l=Math.min(l,n.latitude),f=Math.max(f,n.latitude);const r=n.longitude>=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;s=Math.min(s,r),c=Math.max(c,r)}return o-i>c-s&&(i=s,o=c,o>a.CesiumMath.PI&&(o-=a.CesiumMath.TWO_PI),i>a.CesiumMath.PI&&(i-=a.CesiumMath.TWO_PI)),n.defined(r)?(r.west=i,r.south=l,r.east=o,r.north=f,r):new E(i,l,o,f)},E.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.west-e.west)<=a&&Math.abs(t.south-e.south)<=a&&Math.abs(t.east-e.east)<=a&&Math.abs(t.north-e.north)<=a},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.validate=function(t){},E.southwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.west,t.south)},E.northwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.west,t.north)},E.northeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.east,t.north)},E.southeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.east,t.south)},E.center=function(t,u){let r=t.east;const i=t.west;r<i&&(r+=a.CesiumMath.TWO_PI);const o=a.CesiumMath.negativePiToPi(.5*(i+r)),s=.5*(t.south+t.north);return n.defined(u)?(u.longitude=o,u.latitude=s,u.height=0,u):new e.Cartographic(o,s)},E.intersection=function(t,e,u){let r=t.east,i=t.west,o=e.east,s=e.west;r<i&&o>0?r+=a.CesiumMath.TWO_PI:o<s&&r>0&&(o+=a.CesiumMath.TWO_PI),r<i&&s<0?s+=a.CesiumMath.TWO_PI:o<s&&i<0&&(i+=a.CesiumMath.TWO_PI);const c=a.CesiumMath.negativePiToPi(Math.max(i,s)),l=a.CesiumMath.negativePiToPi(Math.min(r,o));if((t.west<t.east||e.west<e.east)&&l<=c)return;const f=Math.max(t.south,e.south),h=Math.min(t.north,e.north);return f>=h?void 0:n.defined(u)?(u.west=c,u.south=f,u.east=l,u.north=h,u):new E(c,f,l,h)},E.simpleIntersection=function(t,e,a){const u=Math.max(t.west,e.west),r=Math.max(t.south,e.south),i=Math.min(t.east,e.east),o=Math.min(t.north,e.north);if(!(r>=o||u>=i))return n.defined(a)?(a.west=u,a.south=r,a.east=i,a.north=o,a):new E(u,r,i,o)},E.union=function(t,e,u){n.defined(u)||(u=new E);let r=t.east,i=t.west,o=e.east,s=e.west;r<i&&o>0?r+=a.CesiumMath.TWO_PI:o<s&&r>0&&(o+=a.CesiumMath.TWO_PI),r<i&&s<0?s+=a.CesiumMath.TWO_PI:o<s&&i<0&&(i+=a.CesiumMath.TWO_PI);const c=a.CesiumMath.negativePiToPi(Math.min(i,s)),l=a.CesiumMath.negativePiToPi(Math.max(r,o));return u.west=c,u.south=Math.min(t.south,e.south),u.east=l,u.north=Math.max(t.north,e.north),u},E.expand=function(t,e,a){return n.defined(a)||(a=new E),a.west=Math.min(t.west,e.longitude),a.south=Math.min(t.south,e.latitude),a.east=Math.max(t.east,e.longitude),a.north=Math.max(t.north,e.latitude),a},E.contains=function(t,e){let n=e.longitude;const u=e.latitude,r=t.west;let i=t.east;return i<r&&(i+=a.CesiumMath.TWO_PI,n<0&&(n+=a.CesiumMath.TWO_PI)),(n>r||a.CesiumMath.equalsEpsilon(n,r,a.CesiumMath.EPSILON14))&&(n<i||a.CesiumMath.equalsEpsilon(n,i,a.CesiumMath.EPSILON14))&&u>=t.south&&u<=t.north};const I=new e.Cartographic;function U(t,e){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0)}E.subsample=function(t,u,r,i){u=n.defaultValue(u,e.Ellipsoid.WGS84),r=n.defaultValue(r,0),n.defined(i)||(i=[]);let o=0;const s=t.north,c=t.south,l=t.east,f=t.west,h=I;h.height=r,h.longitude=f,h.latitude=s,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=c,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=s<0?s:c>0?c:0;for(let e=1;e<8;++e)h.longitude=-Math.PI+e*a.CesiumMath.PI_OVER_TWO,E.contains(t,h)&&(i[o]=u.cartographicToCartesian(h,i[o]),o++);return 0===h.latitude&&(h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++),i.length=o,i},E.subsection=function(t,e,u,r,i,o){if(n.defined(o)||(o=new E),t.west<=t.east){const n=t.east-t.west;o.west=t.west+e*n,o.east=t.west+r*n}else{const n=a.CesiumMath.TWO_PI+t.east-t.west;o.west=a.CesiumMath.negativePiToPi(t.west+e*n),o.east=a.CesiumMath.negativePiToPi(t.west+r*n)}const s=t.north-t.south;return o.south=t.south+u*s,o.north=t.south+i*s,1===e&&(o.west=t.east),1===r&&(o.east=t.east),1===u&&(o.south=t.north),1===i&&(o.north=t.north),o},E.MAX_VALUE=Object.freeze(new E(-Math.PI,-a.CesiumMath.PI_OVER_TWO,Math.PI,a.CesiumMath.PI_OVER_TWO)),U.fromElements=function(t,e,a){return n.defined(a)?(a.x=t,a.y=e,a):new U(t,e)},U.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e):new U(t.x,t.y)},U.fromCartesian3=U.clone,U.fromCartesian4=U.clone,U.packedLength=2,U.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a]=t.y,e},U.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new U),a.x=t[e++],a.y=t[e],a},U.packArray=function(t,e){const a=t.length,u=2*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)U.pack(t[n],e,2*n);return e},U.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/2:e=new Array(a/2);for(let n=0;n<a;n+=2){const a=n/2;e[a]=U.unpack(t,n,e[a])}return e},U.fromArray=U.unpack,U.maximumComponent=function(t){return Math.max(t.x,t.y)},U.minimumComponent=function(t){return Math.min(t.x,t.y)},U.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},U.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},U.clamp=function(t,e,n,u){const r=a.CesiumMath.clamp(t.x,e.x,n.x),i=a.CesiumMath.clamp(t.y,e.y,n.y);return u.x=r,u.y=i,u},U.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},U.magnitude=function(t){return Math.sqrt(U.magnitudeSquared(t))};const N=new U;U.distance=function(t,e){return U.subtract(t,e,N),U.magnitude(N)},U.distanceSquared=function(t,e){return U.subtract(t,e,N),U.magnitudeSquared(N)},U.normalize=function(t,e){const n=U.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},U.dot=function(t,e){return t.x*e.x+t.y*e.y},U.cross=function(t,e){return t.x*e.y-t.y*e.x},U.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},U.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},U.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},U.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},U.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},U.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},U.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},U.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};const S=new U;U.lerp=function(t,e,n,a){return U.multiplyByScalar(e,n,S),a=U.multiplyByScalar(t,1-n,a),U.add(S,a,a)};const P=new U,_=new U;U.angleBetween=function(t,e){return U.normalize(t,P),U.normalize(e,_),a.CesiumMath.acosClamped(U.dot(P,_))};const q=new U;function R(t,e,a,u){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(e,0),this[3]=n.defaultValue(u,0)}U.mostOrthogonalAxis=function(t,e){const n=U.normalize(t,q);return U.abs(n,n),e=n.x<=n.y?U.clone(U.UNIT_X,e):U.clone(U.UNIT_Y,e)},U.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.x===e.x&&t.y===e.y},U.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},U.equalsEpsilon=function(t,e,u,r){return t===e||n.defined(t)&&n.defined(e)&&a.CesiumMath.equalsEpsilon(t.x,e.x,u,r)&&a.CesiumMath.equalsEpsilon(t.y,e.y,u,r)},U.ZERO=Object.freeze(new U(0,0)),U.ONE=Object.freeze(new U(1,1)),U.UNIT_X=Object.freeze(new U(1,0)),U.UNIT_Y=Object.freeze(new U(0,1)),U.prototype.clone=function(t){return U.clone(this,t)},U.prototype.equals=function(t){return U.equals(this,t)},U.prototype.equalsEpsilon=function(t,e,n){return U.equalsEpsilon(this,t,e,n)},U.prototype.toString=function(){return`(${this.x}, ${this.y})`},R.packedLength=4,R.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t[0],e[a++]=t[1],e[a++]=t[2],e[a++]=t[3],e},R.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new R),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a},R.packArray=function(t,e){const a=t.length,u=4*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)R.pack(t[n],e,4*n);return e},R.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/4:e=new Array(a/4);for(let n=0;n<a;n+=4){const a=n/4;e[a]=R.unpack(t,n,e[a])}return e},R.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new R(t[0],t[2],t[1],t[3])},R.fromArray=R.unpack,R.fromColumnMajorArray=function(t,e){return R.clone(t,e)},R.fromRowMajorArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new R(t[0],t[1],t[2],t[3])},R.fromScale=function(t,e){return n.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new R(t.x,0,0,t.y)},R.fromUniformScale=function(t,e){return n.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new R(t,0,0,t)},R.fromRotation=function(t,e){const a=Math.cos(t),u=Math.sin(t);return n.defined(e)?(e[0]=a,e[1]=u,e[2]=-u,e[3]=a,e):new R(a,-u,u,a)},R.toArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},R.getElementIndex=function(t,e){return 2*t+e},R.getColumn=function(t,e,n){const a=2*e,u=t[a],r=t[a+1];return n.x=u,n.y=r,n},R.setColumn=function(t,e,n,a){const u=2*e;return(a=R.clone(t,a))[u]=n.x,a[u+1]=n.y,a},R.getRow=function(t,e,n){const a=t[e],u=t[e+2];return n.x=a,n.y=u,n},R.setRow=function(t,e,n,a){return(a=R.clone(t,a))[e]=n.x,a[e+2]=n.y,a};const W=new U;R.setScale=function(t,e,n){const a=R.getScale(t,W),u=e.x/a.x,r=e.y/a.y;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*r,n[3]=t[3]*r,n};const L=new U;R.setUniformScale=function(t,e,n){const a=R.getScale(t,L),u=e/a.x,r=e/a.y;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*r,n[3]=t[3]*r,n};const k=new U;R.getScale=function(t,e){return e.x=U.magnitude(U.fromElements(t[0],t[1],k)),e.y=U.magnitude(U.fromElements(t[2],t[3],k)),e};const B=new U;R.getMaximumScale=function(t){return R.getScale(t,B),U.maximumComponent(B)};const $=new U;R.setRotation=function(t,e,n){const a=R.getScale(t,$);return n[0]=e[0]*a.x,n[1]=e[1]*a.x,n[2]=e[2]*a.y,n[3]=e[3]*a.y,n};const j=new U;R.getRotation=function(t,e){const n=R.getScale(t,j);return e[0]=t[0]/n.x,e[1]=t[1]/n.x,e[2]=t[2]/n.y,e[3]=t[3]/n.y,e},R.multiply=function(t,e,n){const a=t[0]*e[0]+t[2]*e[1],u=t[0]*e[2]+t[2]*e[3],r=t[1]*e[0]+t[3]*e[1],i=t[1]*e[2]+t[3]*e[3];return n[0]=a,n[1]=r,n[2]=u,n[3]=i,n},R.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},R.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},R.multiplyByVector=function(t,e,n){const a=t[0]*e.x+t[2]*e.y,u=t[1]*e.x+t[3]*e.y;return n.x=a,n.y=u,n},R.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},R.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},R.multiplyByUniformScale=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},R.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},R.transpose=function(t,e){const n=t[0],a=t[2],u=t[1],r=t[3];return e[0]=n,e[1]=a,e[2]=u,e[3]=r,e},R.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},R.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},R.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},R.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=a&&Math.abs(t[1]-e[1])<=a&&Math.abs(t[2]-e[2])<=a&&Math.abs(t[3]-e[3])<=a},R.IDENTITY=Object.freeze(new R(1,0,0,1)),R.ZERO=Object.freeze(new R(0,0,0,0)),R.COLUMN0ROW0=0,R.COLUMN0ROW1=1,R.COLUMN1ROW0=2,R.COLUMN1ROW1=3,Object.defineProperties(R.prototype,{length:{get:function(){return R.packedLength}}}),R.prototype.clone=function(t){return R.clone(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.equalsEpsilon=function(t,e){return R.equalsEpsilon(this,t,e)},R.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`},t.Cartesian2=U,t.Cartesian4=r,t.Matrix2=R,t.Matrix4=d,t.Rectangle=E})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./RuntimeError-9b4ce3fb"],(function(t,e,n,a,u){"use strict";function r(t,e,a,u){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(a,0),this.w=n.defaultValue(u,0)}r.fromElements=function(t,e,a,u,i){return n.defined(i)?(i.x=t,i.y=e,i.z=a,i.w=u,i):new r(t,e,a,u)},r.fromColor=function(t,e){return n.defined(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new r(t.red,t.green,t.blue,t.alpha)},r.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new r(t.x,t.y,t.z,t.w)},r.packedLength=4,r.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a++]=t.y,e[a++]=t.z,e[a]=t.w,e},r.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new r),a.x=t[e++],a.y=t[e++],a.z=t[e++],a.w=t[e],a},r.packArray=function(t,e){const a=t.length,u=4*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)r.pack(t[n],e,4*n);return e},r.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/4:e=new Array(a/4);for(let n=0;n<a;n+=4){const a=n/4;e[a]=r.unpack(t,n,e[a])}return e},r.fromArray=r.unpack,r.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},r.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},r.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},r.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},r.clamp=function(t,e,n,u){const r=a.CesiumMath.clamp(t.x,e.x,n.x),i=a.CesiumMath.clamp(t.y,e.y,n.y),o=a.CesiumMath.clamp(t.z,e.z,n.z),s=a.CesiumMath.clamp(t.w,e.w,n.w);return u.x=r,u.y=i,u.z=o,u.w=s,u},r.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},r.magnitude=function(t){return Math.sqrt(r.magnitudeSquared(t))};const i=new r;r.distance=function(t,e){return r.subtract(t,e,i),r.magnitude(i)},r.distanceSquared=function(t,e){return r.subtract(t,e,i),r.magnitudeSquared(i)},r.normalize=function(t,e){const n=r.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},r.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},r.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},r.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},r.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},r.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},r.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},r.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},r.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},r.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};const o=new r;r.lerp=function(t,e,n,a){return r.multiplyByScalar(e,n,o),a=r.multiplyByScalar(t,1-n,a),r.add(o,a,a)};const s=new r;r.mostOrthogonalAxis=function(t,e){const n=r.normalize(t,s);return r.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?r.clone(r.UNIT_X,e):r.clone(r.UNIT_W,e):n.z<=n.w?r.clone(r.UNIT_Z,e):r.clone(r.UNIT_W,e):n.y<=n.z?n.y<=n.w?r.clone(r.UNIT_Y,e):r.clone(r.UNIT_W,e):n.z<=n.w?r.clone(r.UNIT_Z,e):r.clone(r.UNIT_W,e)},r.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},r.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},r.equalsEpsilon=function(t,e,u,r){return t===e||n.defined(t)&&n.defined(e)&&a.CesiumMath.equalsEpsilon(t.x,e.x,u,r)&&a.CesiumMath.equalsEpsilon(t.y,e.y,u,r)&&a.CesiumMath.equalsEpsilon(t.z,e.z,u,r)&&a.CesiumMath.equalsEpsilon(t.w,e.w,u,r)},r.ZERO=Object.freeze(new r(0,0,0,0)),r.ONE=Object.freeze(new r(1,1,1,1)),r.UNIT_X=Object.freeze(new r(1,0,0,0)),r.UNIT_Y=Object.freeze(new r(0,1,0,0)),r.UNIT_Z=Object.freeze(new r(0,0,1,0)),r.UNIT_W=Object.freeze(new r(0,0,0,1)),r.prototype.clone=function(t){return r.clone(this,t)},r.prototype.equals=function(t){return r.equals(this,t)},r.prototype.equalsEpsilon=function(t,e,n){return r.equalsEpsilon(this,t,e,n)},r.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const c=new Float32Array(1),l=new Uint8Array(c.buffer),f=new Uint32Array([287454020]),h=68===new Uint8Array(f.buffer)[0];function d(t,e,a,u,r,i,o,s,c,l,f,h,d,m,y,w){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(c,0),this[3]=n.defaultValue(d,0),this[4]=n.defaultValue(e,0),this[5]=n.defaultValue(i,0),this[6]=n.defaultValue(l,0),this[7]=n.defaultValue(m,0),this[8]=n.defaultValue(a,0),this[9]=n.defaultValue(o,0),this[10]=n.defaultValue(f,0),this[11]=n.defaultValue(y,0),this[12]=n.defaultValue(u,0),this[13]=n.defaultValue(s,0),this[14]=n.defaultValue(h,0),this[15]=n.defaultValue(w,0)}r.packFloat=function(t,e){return n.defined(e)||(e=new r),c[0]=t,h?(e.x=l[0],e.y=l[1],e.z=l[2],e.w=l[3]):(e.x=l[3],e.y=l[2],e.z=l[1],e.w=l[0]),e},r.unpackFloat=function(t){return h?(l[0]=t.x,l[1]=t.y,l[2]=t.z,l[3]=t.w):(l[0]=t.w,l[1]=t.z,l[2]=t.y,l[3]=t.x),c[0]},d.packedLength=16,d.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t[0],e[a++]=t[1],e[a++]=t[2],e[a++]=t[3],e[a++]=t[4],e[a++]=t[5],e[a++]=t[6],e[a++]=t[7],e[a++]=t[8],e[a++]=t[9],e[a++]=t[10],e[a++]=t[11],e[a++]=t[12],e[a++]=t[13],e[a++]=t[14],e[a]=t[15],e},d.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new d),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a[9]=t[e++],a[10]=t[e++],a[11]=t[e++],a[12]=t[e++],a[13]=t[e++],a[14]=t[e++],a[15]=t[e],a},d.packArray=function(t,e){const a=t.length,u=16*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)d.pack(t[n],e,16*n);return e},d.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/16:e=new Array(a/16);for(let n=0;n<a;n+=16){const a=n/16;e[a]=d.unpack(t,n,e[a])}return e},d.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):new d(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},d.fromArray=d.unpack,d.fromColumnMajorArray=function(t,e){return d.clone(t,e)},d.fromRowMajorArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new d(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},d.fromRotationTranslation=function(t,a,u){return a=n.defaultValue(a,e.Cartesian3.ZERO),n.defined(u)?(u[0]=t[0],u[1]=t[1],u[2]=t[2],u[3]=0,u[4]=t[3],u[5]=t[4],u[6]=t[5],u[7]=0,u[8]=t[6],u[9]=t[7],u[10]=t[8],u[11]=0,u[12]=a.x,u[13]=a.y,u[14]=a.z,u[15]=1,u):new d(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},d.fromTranslationQuaternionRotationScale=function(t,e,a,u){n.defined(u)||(u=new d);const r=a.x,i=a.y,o=a.z,s=e.x*e.x,c=e.x*e.y,l=e.x*e.z,f=e.x*e.w,h=e.y*e.y,m=e.y*e.z,y=e.y*e.w,w=e.z*e.z,x=e.z*e.w,M=e.w*e.w,p=s-h-w+M,g=2*(c-x),C=2*(l+y),z=2*(c+x),b=-s+h-w+M,O=2*(m-f),V=2*(l-y),T=2*(m+f),A=-s-h+w+M;return u[0]=p*r,u[1]=z*r,u[2]=V*r,u[3]=0,u[4]=g*i,u[5]=b*i,u[6]=T*i,u[7]=0,u[8]=C*o,u[9]=O*o,u[10]=A*o,u[11]=0,u[12]=t.x,u[13]=t.y,u[14]=t.z,u[15]=1,u},d.fromTranslationRotationScale=function(t,e){return d.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},d.fromTranslation=function(t,n){return d.fromRotationTranslation(e.Matrix3.IDENTITY,t,n)},d.fromScale=function(t,e){return n.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new d(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},d.fromUniformScale=function(t,e){return n.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new d(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},d.fromRotation=function(t,e){return n.defined(e)||(e=new d),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};const m=new e.Cartesian3,y=new e.Cartesian3,w=new e.Cartesian3;d.fromCamera=function(t,a){const u=t.position,r=t.direction,i=t.up;e.Cartesian3.normalize(r,m),e.Cartesian3.normalize(e.Cartesian3.cross(m,i,y),y),e.Cartesian3.normalize(e.Cartesian3.cross(y,m,w),w);const o=y.x,s=y.y,c=y.z,l=m.x,f=m.y,h=m.z,x=w.x,M=w.y,p=w.z,g=u.x,C=u.y,z=u.z,b=o*-g+s*-C+c*-z,O=x*-g+M*-C+p*-z,V=l*g+f*C+h*z;return n.defined(a)?(a[0]=o,a[1]=x,a[2]=-l,a[3]=0,a[4]=s,a[5]=M,a[6]=-f,a[7]=0,a[8]=c,a[9]=p,a[10]=-h,a[11]=0,a[12]=b,a[13]=O,a[14]=V,a[15]=1,a):new d(o,s,c,b,x,M,p,O,-l,-f,-h,V,0,0,0,1)},d.computePerspectiveFieldOfView=function(t,e,n,a,u){const r=1/Math.tan(.5*t),i=r/e,o=(a+n)/(n-a),s=2*a*n/(n-a);return u[0]=i,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=r,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=o,u[11]=-1,u[12]=0,u[13]=0,u[14]=s,u[15]=0,u},d.computeOrthographicOffCenter=function(t,e,n,a,u,r,i){let o=1/(e-t),s=1/(a-n),c=1/(r-u);const l=-(e+t)*o,f=-(a+n)*s,h=-(r+u)*c;return o*=2,s*=2,c*=-2,i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=0,i[12]=l,i[13]=f,i[14]=h,i[15]=1,i},d.computePerspectiveOffCenter=function(t,e,n,a,u,r,i){const o=2*u/(e-t),s=2*u/(a-n),c=(e+t)/(e-t),l=(a+n)/(a-n),f=-(r+u)/(r-u),h=-2*r*u/(r-u);return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=c,i[9]=l,i[10]=f,i[11]=-1,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},d.computeInfinitePerspectiveOffCenter=function(t,e,n,a,u,r){const i=2*u/(e-t),o=2*u/(a-n),s=(e+t)/(e-t),c=(a+n)/(a-n),l=-2*u;return r[0]=i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=s,r[9]=c,r[10]=-1,r[11]=-1,r[12]=0,r[13]=0,r[14]=l,r[15]=0,r},d.computeViewportTransformation=function(t,e,a,u){n.defined(u)||(u=new d),t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT);const r=n.defaultValue(t.x,0),i=n.defaultValue(t.y,0),o=n.defaultValue(t.width,0),s=n.defaultValue(t.height,0);e=n.defaultValue(e,0);const c=.5*o,l=.5*s,f=.5*((a=n.defaultValue(a,1))-e),h=c,m=l,y=f,w=r+c,x=i+l,M=e+f;return u[0]=h,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=m,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=y,u[11]=0,u[12]=w,u[13]=x,u[14]=M,u[15]=1,u},d.computeView=function(t,n,a,u,r){return r[0]=u.x,r[1]=a.x,r[2]=-n.x,r[3]=0,r[4]=u.y,r[5]=a.y,r[6]=-n.y,r[7]=0,r[8]=u.z,r[9]=a.z,r[10]=-n.z,r[11]=0,r[12]=-e.Cartesian3.dot(u,t),r[13]=-e.Cartesian3.dot(a,t),r[14]=e.Cartesian3.dot(n,t),r[15]=1,r},d.toArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},d.getElementIndex=function(t,e){return 4*t+e},d.getColumn=function(t,e,n){const a=4*e,u=t[a],r=t[a+1],i=t[a+2],o=t[a+3];return n.x=u,n.y=r,n.z=i,n.w=o,n},d.setColumn=function(t,e,n,a){const u=4*e;return(a=d.clone(t,a))[u]=n.x,a[u+1]=n.y,a[u+2]=n.z,a[u+3]=n.w,a},d.getRow=function(t,e,n){const a=t[e],u=t[e+4],r=t[e+8],i=t[e+12];return n.x=a,n.y=u,n.z=r,n.w=i,n},d.setRow=function(t,e,n,a){return(a=d.clone(t,a))[e]=n.x,a[e+4]=n.y,a[e+8]=n.z,a[e+12]=n.w,a},d.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n};const x=new e.Cartesian3;d.setScale=function(t,e,n){const a=d.getScale(t,x),u=e.x/a.x,r=e.y/a.y,i=e.z/a.z;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*u,n[3]=t[3],n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=t[7],n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const M=new e.Cartesian3;d.setUniformScale=function(t,e,n){const a=d.getScale(t,M),u=e/a.x,r=e/a.y,i=e/a.z;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*u,n[3]=t[3],n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=t[7],n[8]=t[8]*i,n[9]=t[9]*i,n[10]=t[10]*i,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const p=new e.Cartesian3;d.getScale=function(t,n){return n.x=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[0],t[1],t[2],p)),n.y=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[4],t[5],t[6],p)),n.z=e.Cartesian3.magnitude(e.Cartesian3.fromElements(t[8],t[9],t[10],p)),n};const g=new e.Cartesian3;d.getMaximumScale=function(t){return d.getScale(t,g),e.Cartesian3.maximumComponent(g)};const C=new e.Cartesian3;d.setRotation=function(t,e,n){const a=d.getScale(t,C);return n[0]=e[0]*a.x,n[1]=e[1]*a.x,n[2]=e[2]*a.x,n[3]=t[3],n[4]=e[3]*a.y,n[5]=e[4]*a.y,n[6]=e[5]*a.y,n[7]=t[7],n[8]=e[6]*a.z,n[9]=e[7]*a.z,n[10]=e[8]*a.z,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n};const z=new e.Cartesian3;d.getRotation=function(t,e){const n=d.getScale(t,z);return e[0]=t[0]/n.x,e[1]=t[1]/n.x,e[2]=t[2]/n.x,e[3]=t[4]/n.y,e[4]=t[5]/n.y,e[5]=t[6]/n.y,e[6]=t[8]/n.z,e[7]=t[9]/n.z,e[8]=t[10]/n.z,e},d.multiply=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],w=t[13],x=t[14],M=t[15],p=e[0],g=e[1],C=e[2],z=e[3],b=e[4],O=e[5],V=e[6],T=e[7],A=e[8],E=e[9],I=e[10],U=e[11],N=e[12],S=e[13],P=e[14],_=e[15],q=a*p+o*g+f*C+y*z,R=u*p+s*g+h*C+w*z,W=r*p+c*g+d*C+x*z,L=i*p+l*g+m*C+M*z,k=a*b+o*O+f*V+y*T,B=u*b+s*O+h*V+w*T,$=r*b+c*O+d*V+x*T,j=i*b+l*O+m*V+M*T,v=a*A+o*E+f*I+y*U,X=u*A+s*E+h*I+w*U,Y=r*A+c*E+d*I+x*U,Z=i*A+l*E+m*I+M*U,D=a*N+o*S+f*P+y*_,F=u*N+s*S+h*P+w*_,G=r*N+c*S+d*P+x*_,H=i*N+l*S+m*P+M*_;return n[0]=q,n[1]=R,n[2]=W,n[3]=L,n[4]=k,n[5]=B,n[6]=$,n[7]=j,n[8]=v,n[9]=X,n[10]=Y,n[11]=Z,n[12]=D,n[13]=F,n[14]=G,n[15]=H,n},d.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},d.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},d.multiplyTransformation=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[4],o=t[5],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],w=e[1],x=e[2],M=e[4],p=e[5],g=e[6],C=e[8],z=e[9],b=e[10],O=e[12],V=e[13],T=e[14],A=a*y+i*w+c*x,E=u*y+o*w+l*x,I=r*y+s*w+f*x,U=a*M+i*p+c*g,N=u*M+o*p+l*g,S=r*M+s*p+f*g,P=a*C+i*z+c*b,_=u*C+o*z+l*b,q=r*C+s*z+f*b,R=a*O+i*V+c*T+h,W=u*O+o*V+l*T+d,L=r*O+s*V+f*T+m;return n[0]=A,n[1]=E,n[2]=I,n[3]=0,n[4]=U,n[5]=N,n[6]=S,n[7]=0,n[8]=P,n[9]=_,n[10]=q,n[11]=0,n[12]=R,n[13]=W,n[14]=L,n[15]=1,n},d.multiplyByMatrix3=function(t,e,n){const a=t[0],u=t[1],r=t[2],i=t[4],o=t[5],s=t[6],c=t[8],l=t[9],f=t[10],h=e[0],d=e[1],m=e[2],y=e[3],w=e[4],x=e[5],M=e[6],p=e[7],g=e[8],C=a*h+i*d+c*m,z=u*h+o*d+l*m,b=r*h+s*d+f*m,O=a*y+i*w+c*x,V=u*y+o*w+l*x,T=r*y+s*w+f*x,A=a*M+i*p+c*g,E=u*M+o*p+l*g,I=r*M+s*p+f*g;return n[0]=C,n[1]=z,n[2]=b,n[3]=0,n[4]=O,n[5]=V,n[6]=T,n[7]=0,n[8]=A,n[9]=E,n[10]=I,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},d.multiplyByTranslation=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=a*t[0]+u*t[4]+r*t[8]+t[12],o=a*t[1]+u*t[5]+r*t[9]+t[13],s=a*t[2]+u*t[6]+r*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=i,n[13]=o,n[14]=s,n[15]=t[15],n},d.multiplyByScale=function(t,e,n){const a=e.x,u=e.y,r=e.z;return 1===a&&1===u&&1===r?d.clone(t,n):(n[0]=a*t[0],n[1]=a*t[1],n[2]=a*t[2],n[3]=t[3],n[4]=u*t[4],n[5]=u*t[5],n[6]=u*t[6],n[7]=t[7],n[8]=r*t[8],n[9]=r*t[9],n[10]=r*t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n)},d.multiplyByUniformScale=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3],n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7],n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},d.multiplyByVector=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=e.w,o=t[0]*a+t[4]*u+t[8]*r+t[12]*i,s=t[1]*a+t[5]*u+t[9]*r+t[13]*i,c=t[2]*a+t[6]*u+t[10]*r+t[14]*i,l=t[3]*a+t[7]*u+t[11]*r+t[15]*i;return n.x=o,n.y=s,n.z=c,n.w=l,n},d.multiplyByPointAsVector=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=t[0]*a+t[4]*u+t[8]*r,o=t[1]*a+t[5]*u+t[9]*r,s=t[2]*a+t[6]*u+t[10]*r;return n.x=i,n.y=o,n.z=s,n},d.multiplyByPoint=function(t,e,n){const a=e.x,u=e.y,r=e.z,i=t[0]*a+t[4]*u+t[8]*r+t[12],o=t[1]*a+t[5]*u+t[9]*r+t[13],s=t[2]*a+t[6]*u+t[10]*r+t[14];return n.x=i,n.y=o,n.z=s,n},d.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},d.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e[11]=-t[11],e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=-t[15],e},d.transpose=function(t,e){const n=t[1],a=t[2],u=t[3],r=t[6],i=t[7],o=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=a,e[9]=r,e[10]=t[10],e[11]=t[14],e[12]=u,e[13]=i,e[14]=o,e[15]=t[15],e},d.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},d.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},d.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=a&&Math.abs(t[1]-e[1])<=a&&Math.abs(t[2]-e[2])<=a&&Math.abs(t[3]-e[3])<=a&&Math.abs(t[4]-e[4])<=a&&Math.abs(t[5]-e[5])<=a&&Math.abs(t[6]-e[6])<=a&&Math.abs(t[7]-e[7])<=a&&Math.abs(t[8]-e[8])<=a&&Math.abs(t[9]-e[9])<=a&&Math.abs(t[10]-e[10])<=a&&Math.abs(t[11]-e[11])<=a&&Math.abs(t[12]-e[12])<=a&&Math.abs(t[13]-e[13])<=a&&Math.abs(t[14]-e[14])<=a&&Math.abs(t[15]-e[15])<=a},d.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},d.getMatrix3=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};const b=new e.Matrix3,O=new e.Matrix3,V=new r,T=new r(0,0,0,1);d.inverse=function(t,n){const i=t[0],o=t[4],s=t[8],c=t[12],l=t[1],f=t[5],h=t[9],m=t[13],y=t[2],w=t[6],x=t[10],M=t[14],p=t[3],g=t[7],C=t[11],z=t[15];let A=x*z,E=M*C,I=w*z,U=M*g,N=w*C,S=x*g,P=y*z,_=M*p,q=y*C,R=x*p,W=y*g,L=w*p;const k=A*f+U*h+N*m-(E*f+I*h+S*m),B=E*l+P*h+R*m-(A*l+_*h+q*m),$=I*l+_*f+W*m-(U*l+P*f+L*m),j=S*l+q*f+L*h-(N*l+R*f+W*h),v=E*o+I*s+S*c-(A*o+U*s+N*c),X=A*i+_*s+q*c-(E*i+P*s+R*c),Y=U*i+P*o+L*c-(I*i+_*o+W*c),Z=N*i+R*o+W*s-(S*i+q*o+L*s);A=s*m,E=c*h,I=o*m,U=c*f,N=o*h,S=s*f,P=i*m,_=c*l,q=i*h,R=s*l,W=i*f,L=o*l;const D=A*g+U*C+N*z-(E*g+I*C+S*z),F=E*p+P*C+R*z-(A*p+_*C+q*z),G=I*p+_*g+W*z-(U*p+P*g+L*z),H=S*p+q*g+L*C-(N*p+R*g+W*C),Q=I*x+S*M+E*w-(N*M+A*w+U*x),J=q*M+A*y+_*x-(P*x+R*M+E*y),K=P*w+L*M+U*y-(W*M+I*y+_*w),tt=W*x+N*y+R*w-(q*w+L*x+S*y);let et=i*k+o*B+s*$+c*j;if(Math.abs(et)<a.CesiumMath.EPSILON21){if(e.Matrix3.equalsEpsilon(d.getMatrix3(t,b),O,a.CesiumMath.EPSILON7)&&r.equals(d.getRow(t,3,V),T))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new u.RuntimeError("matrix is not invertible because its determinate is zero.")}return et=1/et,n[0]=k*et,n[1]=B*et,n[2]=$*et,n[3]=j*et,n[4]=v*et,n[5]=X*et,n[6]=Y*et,n[7]=Z*et,n[8]=D*et,n[9]=F*et,n[10]=G*et,n[11]=H*et,n[12]=Q*et,n[13]=J*et,n[14]=K*et,n[15]=tt*et,n},d.inverseTransformation=function(t,e){const n=t[0],a=t[1],u=t[2],r=t[4],i=t[5],o=t[6],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-a*h-u*d,y=-r*f-i*h-o*d,w=-s*f-c*h-l*d;return e[0]=n,e[1]=r,e[2]=s,e[3]=0,e[4]=a,e[5]=i,e[6]=c,e[7]=0,e[8]=u,e[9]=o,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=w,e[15]=1,e};const A=new d;function E(t,e,a,u){this.west=n.defaultValue(t,0),this.south=n.defaultValue(e,0),this.east=n.defaultValue(a,0),this.north=n.defaultValue(u,0)}d.inverseTranspose=function(t,e){return d.inverse(d.transpose(t,A),e)},d.IDENTITY=Object.freeze(new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),d.ZERO=Object.freeze(new d(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),d.COLUMN0ROW0=0,d.COLUMN0ROW1=1,d.COLUMN0ROW2=2,d.COLUMN0ROW3=3,d.COLUMN1ROW0=4,d.COLUMN1ROW1=5,d.COLUMN1ROW2=6,d.COLUMN1ROW3=7,d.COLUMN2ROW0=8,d.COLUMN2ROW1=9,d.COLUMN2ROW2=10,d.COLUMN2ROW3=11,d.COLUMN3ROW0=12,d.COLUMN3ROW1=13,d.COLUMN3ROW2=14,d.COLUMN3ROW3=15,Object.defineProperties(d.prototype,{length:{get:function(){return d.packedLength}}}),d.prototype.clone=function(t){return d.clone(this,t)},d.prototype.equals=function(t){return d.equals(this,t)},d.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},d.prototype.equalsEpsilon=function(t,e){return d.equalsEpsilon(this,t,e)},d.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.west,e[a++]=t.south,e[a++]=t.east,e[a]=t.north,e},E.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){let e=t.east;const n=t.west;return e<n&&(e+=a.CesiumMath.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,u,r,i){return t=a.CesiumMath.toRadians(n.defaultValue(t,0)),e=a.CesiumMath.toRadians(n.defaultValue(e,0)),u=a.CesiumMath.toRadians(n.defaultValue(u,0)),r=a.CesiumMath.toRadians(n.defaultValue(r,0)),n.defined(i)?(i.west=t,i.south=e,i.east=u,i.north=r,i):new E(t,e,u,r)},E.fromRadians=function(t,e,a,u,r){return n.defined(r)?(r.west=n.defaultValue(t,0),r.south=n.defaultValue(e,0),r.east=n.defaultValue(a,0),r.north=n.defaultValue(u,0),r):new E(t,e,a,u)},E.fromCartographicArray=function(t,e){let u=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let e=0,n=t.length;e<n;e++){const n=t[e];u=Math.min(u,n.longitude),r=Math.max(r,n.longitude),s=Math.min(s,n.latitude),c=Math.max(c,n.latitude);const l=n.longitude>=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return r-u>o-i&&(u=i,r=o,r>a.CesiumMath.PI&&(r-=a.CesiumMath.TWO_PI),u>a.CesiumMath.PI&&(u-=a.CesiumMath.TWO_PI)),n.defined(e)?(e.west=u,e.south=s,e.east=r,e.north=c,e):new E(u,s,r,c)},E.fromCartesianArray=function(t,u,r){u=n.defaultValue(u,e.Ellipsoid.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let e=0,n=t.length;e<n;e++){const n=u.cartesianToCartographic(t[e]);i=Math.min(i,n.longitude),o=Math.max(o,n.longitude),l=Math.min(l,n.latitude),f=Math.max(f,n.latitude);const r=n.longitude>=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;s=Math.min(s,r),c=Math.max(c,r)}return o-i>c-s&&(i=s,o=c,o>a.CesiumMath.PI&&(o-=a.CesiumMath.TWO_PI),i>a.CesiumMath.PI&&(i-=a.CesiumMath.TWO_PI)),n.defined(r)?(r.west=i,r.south=l,r.east=o,r.north=f,r):new E(i,l,o,f)},E.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.west-e.west)<=a&&Math.abs(t.south-e.south)<=a&&Math.abs(t.east-e.east)<=a&&Math.abs(t.north-e.north)<=a},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.validate=function(t){},E.southwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.west,t.south)},E.northwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.west,t.north)},E.northeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.east,t.north)},E.southeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.east,t.south)},E.center=function(t,u){let r=t.east;const i=t.west;r<i&&(r+=a.CesiumMath.TWO_PI);const o=a.CesiumMath.negativePiToPi(.5*(i+r)),s=.5*(t.south+t.north);return n.defined(u)?(u.longitude=o,u.latitude=s,u.height=0,u):new e.Cartographic(o,s)},E.intersection=function(t,e,u){let r=t.east,i=t.west,o=e.east,s=e.west;r<i&&o>0?r+=a.CesiumMath.TWO_PI:o<s&&r>0&&(o+=a.CesiumMath.TWO_PI),r<i&&s<0?s+=a.CesiumMath.TWO_PI:o<s&&i<0&&(i+=a.CesiumMath.TWO_PI);const c=a.CesiumMath.negativePiToPi(Math.max(i,s)),l=a.CesiumMath.negativePiToPi(Math.min(r,o));if((t.west<t.east||e.west<e.east)&&l<=c)return;const f=Math.max(t.south,e.south),h=Math.min(t.north,e.north);return f>=h?void 0:n.defined(u)?(u.west=c,u.south=f,u.east=l,u.north=h,u):new E(c,f,l,h)},E.simpleIntersection=function(t,e,a){const u=Math.max(t.west,e.west),r=Math.max(t.south,e.south),i=Math.min(t.east,e.east),o=Math.min(t.north,e.north);if(!(r>=o||u>=i))return n.defined(a)?(a.west=u,a.south=r,a.east=i,a.north=o,a):new E(u,r,i,o)},E.union=function(t,e,u){n.defined(u)||(u=new E);let r=t.east,i=t.west,o=e.east,s=e.west;r<i&&o>0?r+=a.CesiumMath.TWO_PI:o<s&&r>0&&(o+=a.CesiumMath.TWO_PI),r<i&&s<0?s+=a.CesiumMath.TWO_PI:o<s&&i<0&&(i+=a.CesiumMath.TWO_PI);const c=a.CesiumMath.negativePiToPi(Math.min(i,s)),l=a.CesiumMath.negativePiToPi(Math.max(r,o));return u.west=c,u.south=Math.min(t.south,e.south),u.east=l,u.north=Math.max(t.north,e.north),u},E.expand=function(t,e,a){return n.defined(a)||(a=new E),a.west=Math.min(t.west,e.longitude),a.south=Math.min(t.south,e.latitude),a.east=Math.max(t.east,e.longitude),a.north=Math.max(t.north,e.latitude),a},E.contains=function(t,e){let n=e.longitude;const u=e.latitude,r=t.west;let i=t.east;return i<r&&(i+=a.CesiumMath.TWO_PI,n<0&&(n+=a.CesiumMath.TWO_PI)),(n>r||a.CesiumMath.equalsEpsilon(n,r,a.CesiumMath.EPSILON14))&&(n<i||a.CesiumMath.equalsEpsilon(n,i,a.CesiumMath.EPSILON14))&&u>=t.south&&u<=t.north};const I=new e.Cartographic;function U(t,e){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0)}E.subsample=function(t,u,r,i){u=n.defaultValue(u,e.Ellipsoid.WGS84),r=n.defaultValue(r,0),n.defined(i)||(i=[]);let o=0;const s=t.north,c=t.south,l=t.east,f=t.west,h=I;h.height=r,h.longitude=f,h.latitude=s,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=c,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=s<0?s:c>0?c:0;for(let e=1;e<8;++e)h.longitude=-Math.PI+e*a.CesiumMath.PI_OVER_TWO,E.contains(t,h)&&(i[o]=u.cartographicToCartesian(h,i[o]),o++);return 0===h.latitude&&(h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++),i.length=o,i},E.subsection=function(t,e,u,r,i,o){if(n.defined(o)||(o=new E),t.west<=t.east){const n=t.east-t.west;o.west=t.west+e*n,o.east=t.west+r*n}else{const n=a.CesiumMath.TWO_PI+t.east-t.west;o.west=a.CesiumMath.negativePiToPi(t.west+e*n),o.east=a.CesiumMath.negativePiToPi(t.west+r*n)}const s=t.north-t.south;return o.south=t.south+u*s,o.north=t.south+i*s,1===e&&(o.west=t.east),1===r&&(o.east=t.east),1===u&&(o.south=t.north),1===i&&(o.north=t.north),o},E.MAX_VALUE=Object.freeze(new E(-Math.PI,-a.CesiumMath.PI_OVER_TWO,Math.PI,a.CesiumMath.PI_OVER_TWO)),U.fromElements=function(t,e,a){return n.defined(a)?(a.x=t,a.y=e,a):new U(t,e)},U.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e):new U(t.x,t.y)},U.fromCartesian3=U.clone,U.fromCartesian4=U.clone,U.packedLength=2,U.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a]=t.y,e},U.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new U),a.x=t[e++],a.y=t[e],a},U.packArray=function(t,e){const a=t.length,u=2*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)U.pack(t[n],e,2*n);return e},U.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/2:e=new Array(a/2);for(let n=0;n<a;n+=2){const a=n/2;e[a]=U.unpack(t,n,e[a])}return e},U.fromArray=U.unpack,U.maximumComponent=function(t){return Math.max(t.x,t.y)},U.minimumComponent=function(t){return Math.min(t.x,t.y)},U.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},U.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},U.clamp=function(t,e,n,u){const r=a.CesiumMath.clamp(t.x,e.x,n.x),i=a.CesiumMath.clamp(t.y,e.y,n.y);return u.x=r,u.y=i,u},U.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},U.magnitude=function(t){return Math.sqrt(U.magnitudeSquared(t))};const N=new U;U.distance=function(t,e){return U.subtract(t,e,N),U.magnitude(N)},U.distanceSquared=function(t,e){return U.subtract(t,e,N),U.magnitudeSquared(N)},U.normalize=function(t,e){const n=U.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},U.dot=function(t,e){return t.x*e.x+t.y*e.y},U.cross=function(t,e){return t.x*e.y-t.y*e.x},U.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},U.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},U.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},U.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},U.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},U.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},U.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},U.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};const S=new U;U.lerp=function(t,e,n,a){return U.multiplyByScalar(e,n,S),a=U.multiplyByScalar(t,1-n,a),U.add(S,a,a)};const P=new U,_=new U;U.angleBetween=function(t,e){return U.normalize(t,P),U.normalize(e,_),a.CesiumMath.acosClamped(U.dot(P,_))};const q=new U;function R(t,e,a,u){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(e,0),this[3]=n.defaultValue(u,0)}U.mostOrthogonalAxis=function(t,e){const n=U.normalize(t,q);return U.abs(n,n),e=n.x<=n.y?U.clone(U.UNIT_X,e):U.clone(U.UNIT_Y,e)},U.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.x===e.x&&t.y===e.y},U.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},U.equalsEpsilon=function(t,e,u,r){return t===e||n.defined(t)&&n.defined(e)&&a.CesiumMath.equalsEpsilon(t.x,e.x,u,r)&&a.CesiumMath.equalsEpsilon(t.y,e.y,u,r)},U.ZERO=Object.freeze(new U(0,0)),U.ONE=Object.freeze(new U(1,1)),U.UNIT_X=Object.freeze(new U(1,0)),U.UNIT_Y=Object.freeze(new U(0,1)),U.prototype.clone=function(t){return U.clone(this,t)},U.prototype.equals=function(t){return U.equals(this,t)},U.prototype.equalsEpsilon=function(t,e,n){return U.equalsEpsilon(this,t,e,n)},U.prototype.toString=function(){return`(${this.x}, ${this.y})`},R.packedLength=4,R.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t[0],e[a++]=t[1],e[a++]=t[2],e[a++]=t[3],e},R.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new R),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a},R.packArray=function(t,e){const a=t.length,u=4*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n<a;++n)R.pack(t[n],e,4*n);return e},R.unpackArray=function(t,e){const a=t.length;n.defined(e)?e.length=a/4:e=new Array(a/4);for(let n=0;n<a;n+=4){const a=n/4;e[a]=R.unpack(t,n,e[a])}return e},R.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new R(t[0],t[2],t[1],t[3])},R.fromArray=R.unpack,R.fromColumnMajorArray=function(t,e){return R.clone(t,e)},R.fromRowMajorArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new R(t[0],t[1],t[2],t[3])},R.fromScale=function(t,e){return n.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new R(t.x,0,0,t.y)},R.fromUniformScale=function(t,e){return n.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new R(t,0,0,t)},R.fromRotation=function(t,e){const a=Math.cos(t),u=Math.sin(t);return n.defined(e)?(e[0]=a,e[1]=u,e[2]=-u,e[3]=a,e):new R(a,-u,u,a)},R.toArray=function(t,e){return n.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},R.getElementIndex=function(t,e){return 2*t+e},R.getColumn=function(t,e,n){const a=2*e,u=t[a],r=t[a+1];return n.x=u,n.y=r,n},R.setColumn=function(t,e,n,a){const u=2*e;return(a=R.clone(t,a))[u]=n.x,a[u+1]=n.y,a},R.getRow=function(t,e,n){const a=t[e],u=t[e+2];return n.x=a,n.y=u,n},R.setRow=function(t,e,n,a){return(a=R.clone(t,a))[e]=n.x,a[e+2]=n.y,a};const W=new U;R.setScale=function(t,e,n){const a=R.getScale(t,W),u=e.x/a.x,r=e.y/a.y;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*r,n[3]=t[3]*r,n};const L=new U;R.setUniformScale=function(t,e,n){const a=R.getScale(t,L),u=e/a.x,r=e/a.y;return n[0]=t[0]*u,n[1]=t[1]*u,n[2]=t[2]*r,n[3]=t[3]*r,n};const k=new U;R.getScale=function(t,e){return e.x=U.magnitude(U.fromElements(t[0],t[1],k)),e.y=U.magnitude(U.fromElements(t[2],t[3],k)),e};const B=new U;R.getMaximumScale=function(t){return R.getScale(t,B),U.maximumComponent(B)};const $=new U;R.setRotation=function(t,e,n){const a=R.getScale(t,$);return n[0]=e[0]*a.x,n[1]=e[1]*a.x,n[2]=e[2]*a.y,n[3]=e[3]*a.y,n};const j=new U;R.getRotation=function(t,e){const n=R.getScale(t,j);return e[0]=t[0]/n.x,e[1]=t[1]/n.x,e[2]=t[2]/n.y,e[3]=t[3]/n.y,e},R.multiply=function(t,e,n){const a=t[0]*e[0]+t[2]*e[1],u=t[0]*e[2]+t[2]*e[3],r=t[1]*e[0]+t[3]*e[1],i=t[1]*e[2]+t[3]*e[3];return n[0]=a,n[1]=r,n[2]=u,n[3]=i,n},R.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},R.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},R.multiplyByVector=function(t,e,n){const a=t[0]*e.x+t[2]*e.y,u=t[1]*e.x+t[3]*e.y;return n.x=a,n.y=u,n},R.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},R.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},R.multiplyByUniformScale=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},R.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},R.transpose=function(t,e){const n=t[0],a=t[2],u=t[1],r=t[3];return e[0]=n,e[1]=a,e[2]=u,e[3]=r,e},R.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},R.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},R.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},R.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=a&&Math.abs(t[1]-e[1])<=a&&Math.abs(t[2]-e[2])<=a&&Math.abs(t[3]-e[3])<=a},R.IDENTITY=Object.freeze(new R(1,0,0,1)),R.ZERO=Object.freeze(new R(0,0,0,0)),R.COLUMN0ROW0=0,R.COLUMN0ROW1=1,R.COLUMN1ROW0=2,R.COLUMN1ROW1=3,Object.defineProperties(R.prototype,{length:{get:function(){return R.packedLength}}}),R.prototype.clone=function(t){return R.clone(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.equalsEpsilon=function(t,e){return R.equalsEpsilon(this,t,e)},R.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`},t.Cartesian2=U,t.Cartesian4=r,t.Matrix2=R,t.Matrix4=d,t.Rectangle=E})); diff --git a/public/lib/Cesium/Workers/Matrix3-81054f0f.js b/public/lib/Cesium/Workers/Matrix3-b2351961.js similarity index 99% rename from public/lib/Cesium/Workers/Matrix3-81054f0f.js rename to public/lib/Cesium/Workers/Matrix3-b2351961.js index cfeab7ad..4c2955f9 100644 --- a/public/lib/Cesium/Workers/Matrix3-81054f0f.js +++ b/public/lib/Cesium/Workers/Matrix3-b2351961.js @@ -1 +1 @@ -define(["exports","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(e,t,n){"use strict";function i(e,n,i){this.x=t.defaultValue(e,0),this.y=t.defaultValue(n,0),this.z=t.defaultValue(i,0)}i.fromSpherical=function(e,n){t.defined(n)||(n=new i);const r=e.clock,a=e.cone,o=t.defaultValue(e.magnitude,1),u=o*Math.sin(a);return n.x=u*Math.cos(r),n.y=u*Math.sin(r),n.z=o*Math.cos(a),n},i.fromElements=function(e,n,r,a){return t.defined(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,n,i){return i=t.defaultValue(i,0),n[i++]=e.x,n[i++]=e.y,n[i]=e.z,n},i.unpack=function(e,n,r){return n=t.defaultValue(n,0),t.defined(r)||(r=new i),r.x=e[n++],r.y=e[n++],r.z=e[n],r},i.packArray=function(e,n){const r=e.length,a=3*r;t.defined(n)?(Array.isArray(n)||n.length===a)&&n.length!==a&&(n.length=a):n=new Array(a);for(let t=0;t<r;++t)i.pack(e[t],n,3*t);return n},i.unpackArray=function(e,n){const r=e.length;t.defined(n)?n.length=r/3:n=new Array(r/3);for(let t=0;t<r;t+=3){const r=t/3;n[r]=i.unpack(e,t,n[r])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},i.clamp=function(e,t,i,r){const a=n.CesiumMath.clamp(e.x,t.x,i.x),o=n.CesiumMath.clamp(e.y,t.y,i.y),u=n.CesiumMath.clamp(e.z,t.z,i.z);return r.x=a,r.y=o,r.z=u,r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};const r=new i;i.distance=function(e,t){return i.subtract(e,t,r),i.magnitude(r)},i.distanceSquared=function(e,t){return i.subtract(e,t,r),i.magnitudeSquared(r)},i.normalize=function(e,t){const n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const a=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,a),r=i.multiplyByScalar(e,1-n,r),i.add(a,r,r)};const o=new i,u=new i;i.angleBetween=function(e,t){i.normalize(e,o),i.normalize(t,u);const n=i.dot(o,u),r=i.magnitude(i.cross(o,u,o));return Math.atan2(r,n)};const c=new i;i.mostOrthogonalAxis=function(e,t){const n=i.normalize(e,c);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,t)},i.projectVector=function(e,t,n){const r=i.dot(e,t)/i.dot(t,t);return i.multiplyByScalar(t,r,n)},i.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},i.equalsEpsilon=function(e,i,r,a){return e===i||t.defined(e)&&t.defined(i)&&n.CesiumMath.equalsEpsilon(e.x,i.x,r,a)&&n.CesiumMath.equalsEpsilon(e.y,i.y,r,a)&&n.CesiumMath.equalsEpsilon(e.z,i.z,r,a)},i.cross=function(e,t,n){const i=e.x,r=e.y,a=e.z,o=t.x,u=t.y,c=t.z,s=r*c-a*u,d=a*o-i*c,l=i*u-r*o;return n.x=s,n.y=d,n.z=l,n},i.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},i.fromDegrees=function(e,t,r,a,o){return e=n.CesiumMath.toRadians(e),t=n.CesiumMath.toRadians(t),i.fromRadians(e,t,r,a,o)};let s=new i,d=new i;const l=new i(40680631590769,40680631590769,40408299984661.445);i.fromRadians=function(e,n,r,a,o){r=t.defaultValue(r,0);const u=t.defined(a)?a.radiiSquared:l,c=Math.cos(n);s.x=c*Math.cos(e),s.y=c*Math.sin(e),s.z=Math.sin(n),s=i.normalize(s,s),i.multiplyComponents(u,s,d);const f=Math.sqrt(i.dot(s,d));return d=i.divideByScalar(d,f,d),s=i.multiplyByScalar(s,r,s),t.defined(o)||(o=new i),i.add(d,s,o)},i.fromDegreesArray=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const a=e[t],o=e[t+1],u=t/2;r[u]=i.fromDegrees(a,o,0,n,r[u])}return r},i.fromRadiansArray=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const a=e[t],o=e[t+1],u=t/2;r[u]=i.fromRadians(a,o,0,n,r[u])}return r},i.fromDegreesArrayHeights=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/3:r=new Array(a/3);for(let t=0;t<a;t+=3){const a=e[t],o=e[t+1],u=e[t+2],c=t/3;r[c]=i.fromDegrees(a,o,u,n,r[c])}return r},i.fromRadiansArrayHeights=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/3:r=new Array(a/3);for(let t=0;t<a;t+=3){const a=e[t],o=e[t+1],u=e[t+2],c=t/3;r[c]=i.fromRadians(a,o,u,n,r[c])}return r},i.ZERO=Object.freeze(new i(0,0,0)),i.ONE=Object.freeze(new i(1,1,1)),i.UNIT_X=Object.freeze(new i(1,0,0)),i.UNIT_Y=Object.freeze(new i(0,1,0)),i.UNIT_Z=Object.freeze(new i(0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const f=new i,h=new i;function m(e,r,a,o,u){const c=e.x,s=e.y,d=e.z,l=r.x,m=r.y,y=r.z,p=c*c*l*l,g=s*s*m*m,x=d*d*y*y,z=p+g+x,M=Math.sqrt(1/z),w=i.multiplyByScalar(e,M,f);if(z<o)return isFinite(M)?i.clone(w,u):void 0;const S=a.x,q=a.y,R=a.z,_=h;_.x=w.x*S*2,_.y=w.y*q*2,_.z=w.z*R*2;let O,C,b,E,T,A,v,N,I,V,U,k=(1-M)*i.magnitude(e)/(.5*i.magnitude(_)),L=0;do{k-=L,b=1/(1+k*S),E=1/(1+k*q),T=1/(1+k*R),A=b*b,v=E*E,N=T*T,I=A*b,V=v*E,U=N*T,O=p*A+g*v+x*N-1,C=p*I*S+g*V*q+x*U*R;L=O/(-2*C)}while(Math.abs(O)>n.CesiumMath.EPSILON12);return t.defined(u)?(u.x=c*b,u.y=s*E,u.z=d*T,u):new i(c*b,s*E,d*T)}function y(e,n,i){this.longitude=t.defaultValue(e,0),this.latitude=t.defaultValue(n,0),this.height=t.defaultValue(i,0)}y.fromRadians=function(e,n,i,r){return i=t.defaultValue(i,0),t.defined(r)?(r.longitude=e,r.latitude=n,r.height=i,r):new y(e,n,i)},y.fromDegrees=function(e,t,i,r){return e=n.CesiumMath.toRadians(e),t=n.CesiumMath.toRadians(t),y.fromRadians(e,t,i,r)};const p=new i,g=new i,x=new i,z=new i(1/6378137,1/6378137,1/6356752.314245179),M=new i(1/40680631590769,1/40680631590769,1/40408299984661.445),w=n.CesiumMath.EPSILON1;function S(e,r,a,o){r=t.defaultValue(r,0),a=t.defaultValue(a,0),o=t.defaultValue(o,0),e._radii=new i(r,a,o),e._radiiSquared=new i(r*r,a*a,o*o),e._radiiToTheFourth=new i(r*r*r*r,a*a*a*a,o*o*o*o),e._oneOverRadii=new i(0===r?0:1/r,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new i(0===r?0:1/(r*r),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(r,a,o),e._maximumRadius=Math.max(r,a,o),e._centerToleranceSquared=n.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function q(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,S(this,e,t,n)}y.fromCartesian=function(e,r,a){const o=t.defined(r)?r.oneOverRadii:z,u=t.defined(r)?r.oneOverRadiiSquared:M,c=m(e,o,u,t.defined(r)?r._centerToleranceSquared:w,g);if(!t.defined(c))return;let s=i.multiplyComponents(c,u,p);s=i.normalize(s,s);const d=i.subtract(e,c,x),l=Math.atan2(s.y,s.x),f=Math.asin(s.z),h=n.CesiumMath.sign(i.dot(d,e))*i.magnitude(d);return t.defined(a)?(a.longitude=l,a.latitude=f,a.height=h,a):new y(l,f,h)},y.toCartesian=function(e,t,n){return i.fromRadians(e.longitude,e.latitude,e.height,t,n)},y.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new y(e.longitude,e.latitude,e.height)},y.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},y.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e.longitude-n.longitude)<=i&&Math.abs(e.latitude-n.latitude)<=i&&Math.abs(e.height-n.height)<=i},y.ZERO=Object.freeze(new y(0,0,0)),y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(q.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),q.clone=function(e,n){if(!t.defined(e))return;const r=e._radii;return t.defined(n)?(i.clone(r,n._radii),i.clone(e._radiiSquared,n._radiiSquared),i.clone(e._radiiToTheFourth,n._radiiToTheFourth),i.clone(e._oneOverRadii,n._oneOverRadii),i.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new q(r.x,r.y,r.z)},q.fromCartesian3=function(e,n){return t.defined(n)||(n=new q),t.defined(e)?(S(n,e.x,e.y,e.z),n):n},q.WGS84=Object.freeze(new q(6378137,6378137,6356752.314245179)),q.UNIT_SPHERE=Object.freeze(new q(1,1,1)),q.MOON=Object.freeze(new q(n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS)),q.prototype.clone=function(e){return q.clone(this,e)},q.packedLength=i.packedLength,q.pack=function(e,n,r){return r=t.defaultValue(r,0),i.pack(e._radii,n,r),n},q.unpack=function(e,n,r){n=t.defaultValue(n,0);const a=i.unpack(e,n);return q.fromCartesian3(a,r)},q.prototype.geocentricSurfaceNormal=i.normalize,q.prototype.geodeticSurfaceNormalCartographic=function(e,n){const r=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(r),c=o*Math.sin(r),s=Math.sin(a);return t.defined(n)||(n=new i),n.x=u,n.y=c,n.z=s,i.normalize(n,n)},q.prototype.geodeticSurfaceNormal=function(e,r){if(!i.equalsEpsilon(e,i.ZERO,n.CesiumMath.EPSILON14))return t.defined(r)||(r=new i),r=i.multiplyComponents(e,this._oneOverRadiiSquared,r),i.normalize(r,r)};const R=new i,_=new i;q.prototype.cartographicToCartesian=function(e,n){const r=R,a=_;this.geodeticSurfaceNormalCartographic(e,r),i.multiplyComponents(this._radiiSquared,r,a);const o=Math.sqrt(i.dot(r,a));return i.divideByScalar(a,o,a),i.multiplyByScalar(r,e.height,r),t.defined(n)||(n=new i),i.add(a,r,n)},q.prototype.cartographicArrayToCartesianArray=function(e,n){const i=e.length;t.defined(n)?n.length=i:n=new Array(i);for(let t=0;t<i;t++)n[t]=this.cartographicToCartesian(e[t],n[t]);return n};const O=new i,C=new i,b=new i;q.prototype.cartesianToCartographic=function(e,r){const a=this.scaleToGeodeticSurface(e,C);if(!t.defined(a))return;const o=this.geodeticSurfaceNormal(a,O),u=i.subtract(e,a,b),c=Math.atan2(o.y,o.x),s=Math.asin(o.z),d=n.CesiumMath.sign(i.dot(u,e))*i.magnitude(u);return t.defined(r)?(r.longitude=c,r.latitude=s,r.height=d,r):new y(c,s,d)},q.prototype.cartesianArrayToCartographicArray=function(e,n){const i=e.length;t.defined(n)?n.length=i:n=new Array(i);for(let t=0;t<i;++t)n[t]=this.cartesianToCartographic(e[t],n[t]);return n},q.prototype.scaleToGeodeticSurface=function(e,t){return m(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},q.prototype.scaleToGeocentricSurface=function(e,n){t.defined(n)||(n=new i);const r=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,c=1/Math.sqrt(r*r*u.x+a*a*u.y+o*o*u.z);return i.multiplyByScalar(e,c,n)},q.prototype.transformPositionToScaledSpace=function(e,n){return t.defined(n)||(n=new i),i.multiplyComponents(e,this._oneOverRadii,n)},q.prototype.transformPositionFromScaledSpace=function(e,n){return t.defined(n)||(n=new i),i.multiplyComponents(e,this._radii,n)},q.prototype.equals=function(e){return this===e||t.defined(e)&&i.equals(this._radii,e._radii)},q.prototype.toString=function(){return this._radii.toString()},q.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,n,r){n=t.defaultValue(n,0);const a=this._squaredXOverSquaredZ;if(t.defined(r)||(r=new i),r.x=0,r.y=0,r.z=e.z*(1-a),!(Math.abs(r.z)>=this._radii.z-n))return r};const E=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],T=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function A(e,t,n){const i=.5*(t+e),r=.5*(t-e);let a=0;for(let e=0;e<5;e++){const t=r*E[e];a+=T[e]*(n(i+t)+n(i-t))}return a*=r,a}function v(e,n,i,r,a,o,u,c,s){this[0]=t.defaultValue(e,0),this[1]=t.defaultValue(r,0),this[2]=t.defaultValue(u,0),this[3]=t.defaultValue(n,0),this[4]=t.defaultValue(a,0),this[5]=t.defaultValue(c,0),this[6]=t.defaultValue(i,0),this[7]=t.defaultValue(o,0),this[8]=t.defaultValue(s,0)}q.prototype.surfaceArea=function(e){const t=e.west;let i=e.east;const r=e.south,a=e.north;for(;i<t;)i+=n.CesiumMath.TWO_PI;const o=this._radiiSquared,u=o.x,c=o.y,s=o.z,d=u*c;return A(r,a,(function(e){const n=Math.cos(e),r=Math.sin(e);return Math.cos(e)*A(t,i,(function(e){const t=Math.cos(e),i=Math.sin(e);return Math.sqrt(d*r*r+s*(c*t*t+u*i*i)*n*n)}))}))},v.packedLength=9,v.pack=function(e,n,i){return i=t.defaultValue(i,0),n[i++]=e[0],n[i++]=e[1],n[i++]=e[2],n[i++]=e[3],n[i++]=e[4],n[i++]=e[5],n[i++]=e[6],n[i++]=e[7],n[i++]=e[8],n},v.unpack=function(e,n,i){return n=t.defaultValue(n,0),t.defined(i)||(i=new v),i[0]=e[n++],i[1]=e[n++],i[2]=e[n++],i[3]=e[n++],i[4]=e[n++],i[5]=e[n++],i[6]=e[n++],i[7]=e[n++],i[8]=e[n++],i},v.packArray=function(e,n){const i=e.length,r=9*i;t.defined(n)?(Array.isArray(n)||n.length===r)&&n.length!==r&&(n.length=r):n=new Array(r);for(let t=0;t<i;++t)v.pack(e[t],n,9*t);return n},v.unpackArray=function(e,n){const i=e.length;t.defined(n)?n.length=i/9:n=new Array(i/9);for(let t=0;t<i;t+=9){const i=t/9;n[i]=v.unpack(e,t,n[i])}return n},v.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):new v(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},v.fromArray=v.unpack,v.fromColumnMajorArray=function(e,t){return v.clone(e,t)},v.fromRowMajorArray=function(e,n){return t.defined(n)?(n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8],n):new v(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},v.fromQuaternion=function(e,n){const i=e.x*e.x,r=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,s=e.y*e.w,d=e.z*e.z,l=e.z*e.w,f=e.w*e.w,h=i-u-d+f,m=2*(r-l),y=2*(a+s),p=2*(r+l),g=-i+u-d+f,x=2*(c-o),z=2*(a-s),M=2*(c+o),w=-i-u+d+f;return t.defined(n)?(n[0]=h,n[1]=p,n[2]=z,n[3]=m,n[4]=g,n[5]=M,n[6]=y,n[7]=x,n[8]=w,n):new v(h,m,y,p,g,x,z,M,w)},v.fromHeadingPitchRoll=function(e,n){const i=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),s=i*r,d=-a*u+c*o*r,l=c*u+a*o*r,f=i*u,h=a*r+c*o*u,m=-c*r+a*o*u,y=-o,p=c*i,g=a*i;return t.defined(n)?(n[0]=s,n[1]=f,n[2]=y,n[3]=d,n[4]=h,n[5]=p,n[6]=l,n[7]=m,n[8]=g,n):new v(s,d,l,f,h,m,y,p,g)},v.fromScale=function(e,n){return t.defined(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=e.y,n[5]=0,n[6]=0,n[7]=0,n[8]=e.z,n):new v(e.x,0,0,0,e.y,0,0,0,e.z)},v.fromUniformScale=function(e,n){return t.defined(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=e,n):new v(e,0,0,0,e,0,0,0,e)},v.fromCrossProduct=function(e,n){return t.defined(n)?(n[0]=0,n[1]=e.z,n[2]=-e.y,n[3]=-e.z,n[4]=0,n[5]=e.x,n[6]=e.y,n[7]=-e.x,n[8]=0,n):new v(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},v.fromRotationX=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new v(1,0,0,0,i,-r,0,r,i)},v.fromRotationY=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new v(i,0,r,0,1,0,-r,0,i)},v.fromRotationZ=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new v(i,-r,0,r,i,0,0,0,1)},v.toArray=function(e,n){return t.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},v.getElementIndex=function(e,t){return 3*e+t},v.getColumn=function(e,t,n){const i=3*t,r=e[i],a=e[i+1],o=e[i+2];return n.x=r,n.y=a,n.z=o,n},v.setColumn=function(e,t,n,i){const r=3*t;return(i=v.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i},v.getRow=function(e,t,n){const i=e[t],r=e[t+3],a=e[t+6];return n.x=i,n.y=r,n.z=a,n},v.setRow=function(e,t,n,i){return(i=v.clone(e,i))[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const N=new i;v.setScale=function(e,t,n){const i=v.getScale(e,N),r=t.x/i.x,a=t.y/i.y,o=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};const I=new i;v.setUniformScale=function(e,t,n){const i=v.getScale(e,I),r=t/i.x,a=t/i.y,o=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};const V=new i;v.getScale=function(e,t){return t.x=i.magnitude(i.fromElements(e[0],e[1],e[2],V)),t.y=i.magnitude(i.fromElements(e[3],e[4],e[5],V)),t.z=i.magnitude(i.fromElements(e[6],e[7],e[8],V)),t};const U=new i;v.getMaximumScale=function(e){return v.getScale(e,U),i.maximumComponent(U)};const k=new i;v.setRotation=function(e,t,n){const i=v.getScale(e,k);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};const L=new i;v.getRotation=function(e,t){const n=v.getScale(e,L);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},v.multiply=function(e,t,n){const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],l=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=a,n[3]=o,n[4]=u,n[5]=c,n[6]=s,n[7]=d,n[8]=l,n},v.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},v.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},v.multiplyByVector=function(e,t,n){const i=t.x,r=t.y,a=t.z,o=e[0]*i+e[3]*r+e[6]*a,u=e[1]*i+e[4]*r+e[7]*a,c=e[2]*i+e[5]*r+e[8]*a;return n.x=o,n.y=u,n.z=c,n},v.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},v.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},v.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},v.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},v.transpose=function(e,t){const n=e[0],i=e[3],r=e[6],a=e[1],o=e[4],u=e[7],c=e[2],s=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o,t[5]=u,t[6]=c,t[7]=s,t[8]=d,t};const B=[1,0,0],j=[2,2,1];function $(e){let t=0;for(let n=0;n<3;++n){const i=e[v.getElementIndex(j[n],B[n])];t+=2*i*i}return Math.sqrt(t)}function P(e,t){const i=n.CesiumMath.EPSILON15;let r=0,a=1;for(let t=0;t<3;++t){const n=Math.abs(e[v.getElementIndex(j[t],B[t])]);n>r&&(a=t,r=n)}let o=1,u=0;const c=B[a],s=j[a];if(Math.abs(e[v.getElementIndex(s,c)])>i){const t=(e[v.getElementIndex(s,s)]-e[v.getElementIndex(c,c)])/2/e[v.getElementIndex(s,c)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),o=1/Math.sqrt(1+n*n),u=n*o}return(t=v.clone(v.IDENTITY,t))[v.getElementIndex(c,c)]=t[v.getElementIndex(s,s)]=o,t[v.getElementIndex(s,c)]=u,t[v.getElementIndex(c,s)]=-u,t}const D=new v,W=new v;v.computeEigenDecomposition=function(e,i){const r=n.CesiumMath.EPSILON20;let a=0,o=0;t.defined(i)||(i={});const u=i.unitary=v.clone(v.IDENTITY,i.unitary),c=i.diagonal=v.clone(e,i.diagonal),s=r*function(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}(c);for(;o<10&&$(c)>s;)P(c,D),v.transpose(D,W),v.multiply(c,D,c),v.multiply(W,c,c),v.multiply(u,D,u),++a>2&&(++o,a=0);return i},v.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},v.determinant=function(e){const t=e[0],n=e[3],i=e[6],r=e[1],a=e[4],o=e[7],u=e[2],c=e[5],s=e[8];return t*(a*s-c*o)+r*(c*i-n*s)+u*(n*o-a*i)},v.inverse=function(e,t){const n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],u=e[5],c=e[6],s=e[7],d=e[8],l=v.determinant(e);t[0]=o*d-s*u,t[1]=s*r-i*d,t[2]=i*u-o*r,t[3]=c*u-a*d,t[4]=n*d-c*r,t[5]=a*r-n*u,t[6]=a*s-c*o,t[7]=c*i-n*s,t[8]=n*o-a*i;const f=1/l;return v.multiplyByScalar(t,f,t)};const Z=new v;v.inverseTranspose=function(e,t){return v.inverse(v.transpose(e,Z),t)},v.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[7]===n[7]&&e[8]===n[8]},v.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e[0]-n[0])<=i&&Math.abs(e[1]-n[1])<=i&&Math.abs(e[2]-n[2])<=i&&Math.abs(e[3]-n[3])<=i&&Math.abs(e[4]-n[4])<=i&&Math.abs(e[5]-n[5])<=i&&Math.abs(e[6]-n[6])<=i&&Math.abs(e[7]-n[7])<=i&&Math.abs(e[8]-n[8])<=i},v.IDENTITY=Object.freeze(new v(1,0,0,0,1,0,0,0,1)),v.ZERO=Object.freeze(new v(0,0,0,0,0,0,0,0,0)),v.COLUMN0ROW0=0,v.COLUMN0ROW1=1,v.COLUMN0ROW2=2,v.COLUMN1ROW0=3,v.COLUMN1ROW1=4,v.COLUMN1ROW2=5,v.COLUMN2ROW0=6,v.COLUMN2ROW1=7,v.COLUMN2ROW2=8,Object.defineProperties(v.prototype,{length:{get:function(){return v.packedLength}}}),v.prototype.clone=function(e){return v.clone(this,e)},v.prototype.equals=function(e){return v.equals(this,e)},v.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},v.prototype.equalsEpsilon=function(e,t){return v.equalsEpsilon(this,e,t)},v.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},e.Cartesian3=i,e.Cartographic=y,e.Ellipsoid=q,e.Matrix3=v})); +define(["exports","./defaultValue-f6d5e6da","./Math-355606c6"],(function(e,t,n){"use strict";function i(e,n,i){this.x=t.defaultValue(e,0),this.y=t.defaultValue(n,0),this.z=t.defaultValue(i,0)}i.fromSpherical=function(e,n){t.defined(n)||(n=new i);const r=e.clock,a=e.cone,o=t.defaultValue(e.magnitude,1),u=o*Math.sin(a);return n.x=u*Math.cos(r),n.y=u*Math.sin(r),n.z=o*Math.cos(a),n},i.fromElements=function(e,n,r,a){return t.defined(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,n,i){return i=t.defaultValue(i,0),n[i++]=e.x,n[i++]=e.y,n[i]=e.z,n},i.unpack=function(e,n,r){return n=t.defaultValue(n,0),t.defined(r)||(r=new i),r.x=e[n++],r.y=e[n++],r.z=e[n],r},i.packArray=function(e,n){const r=e.length,a=3*r;t.defined(n)?(Array.isArray(n)||n.length===a)&&n.length!==a&&(n.length=a):n=new Array(a);for(let t=0;t<r;++t)i.pack(e[t],n,3*t);return n},i.unpackArray=function(e,n){const r=e.length;t.defined(n)?n.length=r/3:n=new Array(r/3);for(let t=0;t<r;t+=3){const r=t/3;n[r]=i.unpack(e,t,n[r])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},i.clamp=function(e,t,i,r){const a=n.CesiumMath.clamp(e.x,t.x,i.x),o=n.CesiumMath.clamp(e.y,t.y,i.y),u=n.CesiumMath.clamp(e.z,t.z,i.z);return r.x=a,r.y=o,r.z=u,r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};const r=new i;i.distance=function(e,t){return i.subtract(e,t,r),i.magnitude(r)},i.distanceSquared=function(e,t){return i.subtract(e,t,r),i.magnitudeSquared(r)},i.normalize=function(e,t){const n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const a=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,a),r=i.multiplyByScalar(e,1-n,r),i.add(a,r,r)};const o=new i,u=new i;i.angleBetween=function(e,t){i.normalize(e,o),i.normalize(t,u);const n=i.dot(o,u),r=i.magnitude(i.cross(o,u,o));return Math.atan2(r,n)};const c=new i;i.mostOrthogonalAxis=function(e,t){const n=i.normalize(e,c);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,t)},i.projectVector=function(e,t,n){const r=i.dot(e,t)/i.dot(t,t);return i.multiplyByScalar(t,r,n)},i.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},i.equalsEpsilon=function(e,i,r,a){return e===i||t.defined(e)&&t.defined(i)&&n.CesiumMath.equalsEpsilon(e.x,i.x,r,a)&&n.CesiumMath.equalsEpsilon(e.y,i.y,r,a)&&n.CesiumMath.equalsEpsilon(e.z,i.z,r,a)},i.cross=function(e,t,n){const i=e.x,r=e.y,a=e.z,o=t.x,u=t.y,c=t.z,s=r*c-a*u,d=a*o-i*c,l=i*u-r*o;return n.x=s,n.y=d,n.z=l,n},i.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},i.fromDegrees=function(e,t,r,a,o){return e=n.CesiumMath.toRadians(e),t=n.CesiumMath.toRadians(t),i.fromRadians(e,t,r,a,o)};let s=new i,d=new i;const l=new i(40680631590769,40680631590769,40408299984661.445);i.fromRadians=function(e,n,r,a,o){r=t.defaultValue(r,0);const u=t.defined(a)?a.radiiSquared:l,c=Math.cos(n);s.x=c*Math.cos(e),s.y=c*Math.sin(e),s.z=Math.sin(n),s=i.normalize(s,s),i.multiplyComponents(u,s,d);const f=Math.sqrt(i.dot(s,d));return d=i.divideByScalar(d,f,d),s=i.multiplyByScalar(s,r,s),t.defined(o)||(o=new i),i.add(d,s,o)},i.fromDegreesArray=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const a=e[t],o=e[t+1],u=t/2;r[u]=i.fromDegrees(a,o,0,n,r[u])}return r},i.fromRadiansArray=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const a=e[t],o=e[t+1],u=t/2;r[u]=i.fromRadians(a,o,0,n,r[u])}return r},i.fromDegreesArrayHeights=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/3:r=new Array(a/3);for(let t=0;t<a;t+=3){const a=e[t],o=e[t+1],u=e[t+2],c=t/3;r[c]=i.fromDegrees(a,o,u,n,r[c])}return r},i.fromRadiansArrayHeights=function(e,n,r){const a=e.length;t.defined(r)?r.length=a/3:r=new Array(a/3);for(let t=0;t<a;t+=3){const a=e[t],o=e[t+1],u=e[t+2],c=t/3;r[c]=i.fromRadians(a,o,u,n,r[c])}return r},i.ZERO=Object.freeze(new i(0,0,0)),i.ONE=Object.freeze(new i(1,1,1)),i.UNIT_X=Object.freeze(new i(1,0,0)),i.UNIT_Y=Object.freeze(new i(0,1,0)),i.UNIT_Z=Object.freeze(new i(0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const f=new i,h=new i;function m(e,r,a,o,u){const c=e.x,s=e.y,d=e.z,l=r.x,m=r.y,y=r.z,p=c*c*l*l,g=s*s*m*m,x=d*d*y*y,z=p+g+x,M=Math.sqrt(1/z),w=i.multiplyByScalar(e,M,f);if(z<o)return isFinite(M)?i.clone(w,u):void 0;const S=a.x,q=a.y,R=a.z,_=h;_.x=w.x*S*2,_.y=w.y*q*2,_.z=w.z*R*2;let O,C,b,E,T,A,v,N,I,V,U,k=(1-M)*i.magnitude(e)/(.5*i.magnitude(_)),L=0;do{k-=L,b=1/(1+k*S),E=1/(1+k*q),T=1/(1+k*R),A=b*b,v=E*E,N=T*T,I=A*b,V=v*E,U=N*T,O=p*A+g*v+x*N-1,C=p*I*S+g*V*q+x*U*R;L=O/(-2*C)}while(Math.abs(O)>n.CesiumMath.EPSILON12);return t.defined(u)?(u.x=c*b,u.y=s*E,u.z=d*T,u):new i(c*b,s*E,d*T)}function y(e,n,i){this.longitude=t.defaultValue(e,0),this.latitude=t.defaultValue(n,0),this.height=t.defaultValue(i,0)}y.fromRadians=function(e,n,i,r){return i=t.defaultValue(i,0),t.defined(r)?(r.longitude=e,r.latitude=n,r.height=i,r):new y(e,n,i)},y.fromDegrees=function(e,t,i,r){return e=n.CesiumMath.toRadians(e),t=n.CesiumMath.toRadians(t),y.fromRadians(e,t,i,r)};const p=new i,g=new i,x=new i,z=new i(1/6378137,1/6378137,1/6356752.314245179),M=new i(1/40680631590769,1/40680631590769,1/40408299984661.445),w=n.CesiumMath.EPSILON1;function S(e,r,a,o){r=t.defaultValue(r,0),a=t.defaultValue(a,0),o=t.defaultValue(o,0),e._radii=new i(r,a,o),e._radiiSquared=new i(r*r,a*a,o*o),e._radiiToTheFourth=new i(r*r*r*r,a*a*a*a,o*o*o*o),e._oneOverRadii=new i(0===r?0:1/r,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new i(0===r?0:1/(r*r),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(r,a,o),e._maximumRadius=Math.max(r,a,o),e._centerToleranceSquared=n.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function q(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,S(this,e,t,n)}y.fromCartesian=function(e,r,a){const o=t.defined(r)?r.oneOverRadii:z,u=t.defined(r)?r.oneOverRadiiSquared:M,c=m(e,o,u,t.defined(r)?r._centerToleranceSquared:w,g);if(!t.defined(c))return;let s=i.multiplyComponents(c,u,p);s=i.normalize(s,s);const d=i.subtract(e,c,x),l=Math.atan2(s.y,s.x),f=Math.asin(s.z),h=n.CesiumMath.sign(i.dot(d,e))*i.magnitude(d);return t.defined(a)?(a.longitude=l,a.latitude=f,a.height=h,a):new y(l,f,h)},y.toCartesian=function(e,t,n){return i.fromRadians(e.longitude,e.latitude,e.height,t,n)},y.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new y(e.longitude,e.latitude,e.height)},y.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},y.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e.longitude-n.longitude)<=i&&Math.abs(e.latitude-n.latitude)<=i&&Math.abs(e.height-n.height)<=i},y.ZERO=Object.freeze(new y(0,0,0)),y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(q.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),q.clone=function(e,n){if(!t.defined(e))return;const r=e._radii;return t.defined(n)?(i.clone(r,n._radii),i.clone(e._radiiSquared,n._radiiSquared),i.clone(e._radiiToTheFourth,n._radiiToTheFourth),i.clone(e._oneOverRadii,n._oneOverRadii),i.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new q(r.x,r.y,r.z)},q.fromCartesian3=function(e,n){return t.defined(n)||(n=new q),t.defined(e)?(S(n,e.x,e.y,e.z),n):n},q.WGS84=Object.freeze(new q(6378137,6378137,6356752.314245179)),q.UNIT_SPHERE=Object.freeze(new q(1,1,1)),q.MOON=Object.freeze(new q(n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS)),q.prototype.clone=function(e){return q.clone(this,e)},q.packedLength=i.packedLength,q.pack=function(e,n,r){return r=t.defaultValue(r,0),i.pack(e._radii,n,r),n},q.unpack=function(e,n,r){n=t.defaultValue(n,0);const a=i.unpack(e,n);return q.fromCartesian3(a,r)},q.prototype.geocentricSurfaceNormal=i.normalize,q.prototype.geodeticSurfaceNormalCartographic=function(e,n){const r=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(r),c=o*Math.sin(r),s=Math.sin(a);return t.defined(n)||(n=new i),n.x=u,n.y=c,n.z=s,i.normalize(n,n)},q.prototype.geodeticSurfaceNormal=function(e,r){if(!i.equalsEpsilon(e,i.ZERO,n.CesiumMath.EPSILON14))return t.defined(r)||(r=new i),r=i.multiplyComponents(e,this._oneOverRadiiSquared,r),i.normalize(r,r)};const R=new i,_=new i;q.prototype.cartographicToCartesian=function(e,n){const r=R,a=_;this.geodeticSurfaceNormalCartographic(e,r),i.multiplyComponents(this._radiiSquared,r,a);const o=Math.sqrt(i.dot(r,a));return i.divideByScalar(a,o,a),i.multiplyByScalar(r,e.height,r),t.defined(n)||(n=new i),i.add(a,r,n)},q.prototype.cartographicArrayToCartesianArray=function(e,n){const i=e.length;t.defined(n)?n.length=i:n=new Array(i);for(let t=0;t<i;t++)n[t]=this.cartographicToCartesian(e[t],n[t]);return n};const O=new i,C=new i,b=new i;q.prototype.cartesianToCartographic=function(e,r){const a=this.scaleToGeodeticSurface(e,C);if(!t.defined(a))return;const o=this.geodeticSurfaceNormal(a,O),u=i.subtract(e,a,b),c=Math.atan2(o.y,o.x),s=Math.asin(o.z),d=n.CesiumMath.sign(i.dot(u,e))*i.magnitude(u);return t.defined(r)?(r.longitude=c,r.latitude=s,r.height=d,r):new y(c,s,d)},q.prototype.cartesianArrayToCartographicArray=function(e,n){const i=e.length;t.defined(n)?n.length=i:n=new Array(i);for(let t=0;t<i;++t)n[t]=this.cartesianToCartographic(e[t],n[t]);return n},q.prototype.scaleToGeodeticSurface=function(e,t){return m(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},q.prototype.scaleToGeocentricSurface=function(e,n){t.defined(n)||(n=new i);const r=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,c=1/Math.sqrt(r*r*u.x+a*a*u.y+o*o*u.z);return i.multiplyByScalar(e,c,n)},q.prototype.transformPositionToScaledSpace=function(e,n){return t.defined(n)||(n=new i),i.multiplyComponents(e,this._oneOverRadii,n)},q.prototype.transformPositionFromScaledSpace=function(e,n){return t.defined(n)||(n=new i),i.multiplyComponents(e,this._radii,n)},q.prototype.equals=function(e){return this===e||t.defined(e)&&i.equals(this._radii,e._radii)},q.prototype.toString=function(){return this._radii.toString()},q.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,n,r){n=t.defaultValue(n,0);const a=this._squaredXOverSquaredZ;if(t.defined(r)||(r=new i),r.x=0,r.y=0,r.z=e.z*(1-a),!(Math.abs(r.z)>=this._radii.z-n))return r};const E=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],T=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function A(e,t,n){const i=.5*(t+e),r=.5*(t-e);let a=0;for(let e=0;e<5;e++){const t=r*E[e];a+=T[e]*(n(i+t)+n(i-t))}return a*=r,a}function v(e,n,i,r,a,o,u,c,s){this[0]=t.defaultValue(e,0),this[1]=t.defaultValue(r,0),this[2]=t.defaultValue(u,0),this[3]=t.defaultValue(n,0),this[4]=t.defaultValue(a,0),this[5]=t.defaultValue(c,0),this[6]=t.defaultValue(i,0),this[7]=t.defaultValue(o,0),this[8]=t.defaultValue(s,0)}q.prototype.surfaceArea=function(e){const t=e.west;let i=e.east;const r=e.south,a=e.north;for(;i<t;)i+=n.CesiumMath.TWO_PI;const o=this._radiiSquared,u=o.x,c=o.y,s=o.z,d=u*c;return A(r,a,(function(e){const n=Math.cos(e),r=Math.sin(e);return Math.cos(e)*A(t,i,(function(e){const t=Math.cos(e),i=Math.sin(e);return Math.sqrt(d*r*r+s*(c*t*t+u*i*i)*n*n)}))}))},v.packedLength=9,v.pack=function(e,n,i){return i=t.defaultValue(i,0),n[i++]=e[0],n[i++]=e[1],n[i++]=e[2],n[i++]=e[3],n[i++]=e[4],n[i++]=e[5],n[i++]=e[6],n[i++]=e[7],n[i++]=e[8],n},v.unpack=function(e,n,i){return n=t.defaultValue(n,0),t.defined(i)||(i=new v),i[0]=e[n++],i[1]=e[n++],i[2]=e[n++],i[3]=e[n++],i[4]=e[n++],i[5]=e[n++],i[6]=e[n++],i[7]=e[n++],i[8]=e[n++],i},v.packArray=function(e,n){const i=e.length,r=9*i;t.defined(n)?(Array.isArray(n)||n.length===r)&&n.length!==r&&(n.length=r):n=new Array(r);for(let t=0;t<i;++t)v.pack(e[t],n,9*t);return n},v.unpackArray=function(e,n){const i=e.length;t.defined(n)?n.length=i/9:n=new Array(i/9);for(let t=0;t<i;t+=9){const i=t/9;n[i]=v.unpack(e,t,n[i])}return n},v.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):new v(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},v.fromArray=v.unpack,v.fromColumnMajorArray=function(e,t){return v.clone(e,t)},v.fromRowMajorArray=function(e,n){return t.defined(n)?(n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8],n):new v(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},v.fromQuaternion=function(e,n){const i=e.x*e.x,r=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,s=e.y*e.w,d=e.z*e.z,l=e.z*e.w,f=e.w*e.w,h=i-u-d+f,m=2*(r-l),y=2*(a+s),p=2*(r+l),g=-i+u-d+f,x=2*(c-o),z=2*(a-s),M=2*(c+o),w=-i-u+d+f;return t.defined(n)?(n[0]=h,n[1]=p,n[2]=z,n[3]=m,n[4]=g,n[5]=M,n[6]=y,n[7]=x,n[8]=w,n):new v(h,m,y,p,g,x,z,M,w)},v.fromHeadingPitchRoll=function(e,n){const i=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),s=i*r,d=-a*u+c*o*r,l=c*u+a*o*r,f=i*u,h=a*r+c*o*u,m=-c*r+a*o*u,y=-o,p=c*i,g=a*i;return t.defined(n)?(n[0]=s,n[1]=f,n[2]=y,n[3]=d,n[4]=h,n[5]=p,n[6]=l,n[7]=m,n[8]=g,n):new v(s,d,l,f,h,m,y,p,g)},v.fromScale=function(e,n){return t.defined(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=e.y,n[5]=0,n[6]=0,n[7]=0,n[8]=e.z,n):new v(e.x,0,0,0,e.y,0,0,0,e.z)},v.fromUniformScale=function(e,n){return t.defined(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=e,n):new v(e,0,0,0,e,0,0,0,e)},v.fromCrossProduct=function(e,n){return t.defined(n)?(n[0]=0,n[1]=e.z,n[2]=-e.y,n[3]=-e.z,n[4]=0,n[5]=e.x,n[6]=e.y,n[7]=-e.x,n[8]=0,n):new v(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},v.fromRotationX=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new v(1,0,0,0,i,-r,0,r,i)},v.fromRotationY=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new v(i,0,r,0,1,0,-r,0,i)},v.fromRotationZ=function(e,n){const i=Math.cos(e),r=Math.sin(e);return t.defined(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new v(i,-r,0,r,i,0,0,0,1)},v.toArray=function(e,n){return t.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},v.getElementIndex=function(e,t){return 3*e+t},v.getColumn=function(e,t,n){const i=3*t,r=e[i],a=e[i+1],o=e[i+2];return n.x=r,n.y=a,n.z=o,n},v.setColumn=function(e,t,n,i){const r=3*t;return(i=v.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i},v.getRow=function(e,t,n){const i=e[t],r=e[t+3],a=e[t+6];return n.x=i,n.y=r,n.z=a,n},v.setRow=function(e,t,n,i){return(i=v.clone(e,i))[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const N=new i;v.setScale=function(e,t,n){const i=v.getScale(e,N),r=t.x/i.x,a=t.y/i.y,o=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};const I=new i;v.setUniformScale=function(e,t,n){const i=v.getScale(e,I),r=t/i.x,a=t/i.y,o=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*a,n[4]=e[4]*a,n[5]=e[5]*a,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};const V=new i;v.getScale=function(e,t){return t.x=i.magnitude(i.fromElements(e[0],e[1],e[2],V)),t.y=i.magnitude(i.fromElements(e[3],e[4],e[5],V)),t.z=i.magnitude(i.fromElements(e[6],e[7],e[8],V)),t};const U=new i;v.getMaximumScale=function(e){return v.getScale(e,U),i.maximumComponent(U)};const k=new i;v.setRotation=function(e,t,n){const i=v.getScale(e,k);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};const L=new i;v.getRotation=function(e,t){const n=v.getScale(e,L);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},v.multiply=function(e,t,n){const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],l=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=a,n[3]=o,n[4]=u,n[5]=c,n[6]=s,n[7]=d,n[8]=l,n},v.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},v.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},v.multiplyByVector=function(e,t,n){const i=t.x,r=t.y,a=t.z,o=e[0]*i+e[3]*r+e[6]*a,u=e[1]*i+e[4]*r+e[7]*a,c=e[2]*i+e[5]*r+e[8]*a;return n.x=o,n.y=u,n.z=c,n},v.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},v.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},v.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},v.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},v.transpose=function(e,t){const n=e[0],i=e[3],r=e[6],a=e[1],o=e[4],u=e[7],c=e[2],s=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o,t[5]=u,t[6]=c,t[7]=s,t[8]=d,t};const B=[1,0,0],j=[2,2,1];function $(e){let t=0;for(let n=0;n<3;++n){const i=e[v.getElementIndex(j[n],B[n])];t+=2*i*i}return Math.sqrt(t)}function P(e,t){const i=n.CesiumMath.EPSILON15;let r=0,a=1;for(let t=0;t<3;++t){const n=Math.abs(e[v.getElementIndex(j[t],B[t])]);n>r&&(a=t,r=n)}let o=1,u=0;const c=B[a],s=j[a];if(Math.abs(e[v.getElementIndex(s,c)])>i){const t=(e[v.getElementIndex(s,s)]-e[v.getElementIndex(c,c)])/2/e[v.getElementIndex(s,c)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),o=1/Math.sqrt(1+n*n),u=n*o}return(t=v.clone(v.IDENTITY,t))[v.getElementIndex(c,c)]=t[v.getElementIndex(s,s)]=o,t[v.getElementIndex(s,c)]=u,t[v.getElementIndex(c,s)]=-u,t}const D=new v,W=new v;v.computeEigenDecomposition=function(e,i){const r=n.CesiumMath.EPSILON20;let a=0,o=0;t.defined(i)||(i={});const u=i.unitary=v.clone(v.IDENTITY,i.unitary),c=i.diagonal=v.clone(e,i.diagonal),s=r*function(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}(c);for(;o<10&&$(c)>s;)P(c,D),v.transpose(D,W),v.multiply(c,D,c),v.multiply(W,c,c),v.multiply(u,D,u),++a>2&&(++o,a=0);return i},v.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},v.determinant=function(e){const t=e[0],n=e[3],i=e[6],r=e[1],a=e[4],o=e[7],u=e[2],c=e[5],s=e[8];return t*(a*s-c*o)+r*(c*i-n*s)+u*(n*o-a*i)},v.inverse=function(e,t){const n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],u=e[5],c=e[6],s=e[7],d=e[8],l=v.determinant(e);t[0]=o*d-s*u,t[1]=s*r-i*d,t[2]=i*u-o*r,t[3]=c*u-a*d,t[4]=n*d-c*r,t[5]=a*r-n*u,t[6]=a*s-c*o,t[7]=c*i-n*s,t[8]=n*o-a*i;const f=1/l;return v.multiplyByScalar(t,f,t)};const Z=new v;v.inverseTranspose=function(e,t){return v.inverse(v.transpose(e,Z),t)},v.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[7]===n[7]&&e[8]===n[8]},v.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e[0]-n[0])<=i&&Math.abs(e[1]-n[1])<=i&&Math.abs(e[2]-n[2])<=i&&Math.abs(e[3]-n[3])<=i&&Math.abs(e[4]-n[4])<=i&&Math.abs(e[5]-n[5])<=i&&Math.abs(e[6]-n[6])<=i&&Math.abs(e[7]-n[7])<=i&&Math.abs(e[8]-n[8])<=i},v.IDENTITY=Object.freeze(new v(1,0,0,0,1,0,0,0,1)),v.ZERO=Object.freeze(new v(0,0,0,0,0,0,0,0,0)),v.COLUMN0ROW0=0,v.COLUMN0ROW1=1,v.COLUMN0ROW2=2,v.COLUMN1ROW0=3,v.COLUMN1ROW1=4,v.COLUMN1ROW2=5,v.COLUMN2ROW0=6,v.COLUMN2ROW1=7,v.COLUMN2ROW2=8,Object.defineProperties(v.prototype,{length:{get:function(){return v.packedLength}}}),v.prototype.clone=function(e){return v.clone(this,e)},v.prototype.equals=function(e){return v.equals(this,e)},v.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},v.prototype.equalsEpsilon=function(e,t){return v.equalsEpsilon(this,e,t)},v.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},e.Cartesian3=i,e.Cartographic=y,e.Ellipsoid=q,e.Matrix3=v})); diff --git a/public/lib/Cesium/Workers/OrientedBoundingBox-8446a826.js b/public/lib/Cesium/Workers/OrientedBoundingBox-c083edd8.js similarity index 98% rename from public/lib/Cesium/Workers/OrientedBoundingBox-8446a826.js rename to public/lib/Cesium/Workers/OrientedBoundingBox-c083edd8.js index 28593ab6..5c745386 100644 --- a/public/lib/Cesium/Workers/OrientedBoundingBox-8446a826.js +++ b/public/lib/Cesium/Workers/OrientedBoundingBox-c083edd8.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipsoidTangentPlane-cf43ca0f","./Math-2ce22ee9","./Plane-6add0ae1"],(function(a,t,e,n,r,i,s,o){"use strict";function C(a,t){this.center=n.Cartesian3.clone(r.defaultValue(a,n.Cartesian3.ZERO)),this.halfAxes=n.Matrix3.clone(r.defaultValue(t,n.Matrix3.ZERO))}C.packedLength=n.Cartesian3.packedLength+n.Matrix3.packedLength,C.pack=function(a,t,e){return e=r.defaultValue(e,0),n.Cartesian3.pack(a.center,t,e),n.Matrix3.pack(a.halfAxes,t,e+n.Cartesian3.packedLength),t},C.unpack=function(a,t,e){return t=r.defaultValue(t,0),r.defined(e)||(e=new C),n.Cartesian3.unpack(a,t,e.center),n.Matrix3.unpack(a,t+n.Cartesian3.packedLength,e.halfAxes),e};const c=new n.Cartesian3,u=new n.Cartesian3,l=new n.Cartesian3,d=new n.Cartesian3,h=new n.Cartesian3,x=new n.Cartesian3,m=new n.Matrix3,M={unitary:new n.Matrix3,diagonal:new n.Matrix3};C.fromPoints=function(a,t){if(r.defined(t)||(t=new C),!r.defined(a)||0===a.length)return t.halfAxes=n.Matrix3.ZERO,t.center=n.Cartesian3.ZERO,t;let e;const i=a.length,s=n.Cartesian3.clone(a[0],c);for(e=1;e<i;e++)n.Cartesian3.add(s,a[e],s);const o=1/i;n.Cartesian3.multiplyByScalar(s,o,s);let f,p=0,w=0,g=0,y=0,b=0,N=0;for(e=0;e<i;e++)f=n.Cartesian3.subtract(a[e],s,u),p+=f.x*f.x,w+=f.x*f.y,g+=f.x*f.z,y+=f.y*f.y,b+=f.y*f.z,N+=f.z*f.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=n.Matrix3.computeEigenDecomposition(T,M),A=n.Matrix3.clone(O.unitary,t.halfAxes);let P=n.Matrix3.getColumn(A,0,d),I=n.Matrix3.getColumn(A,1,h),R=n.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(e=0;e<i;e++)f=a[e],E=Math.max(n.Cartesian3.dot(P,f),E),S=Math.max(n.Cartesian3.dot(I,f),S),U=Math.max(n.Cartesian3.dot(R,f),U),L=Math.min(n.Cartesian3.dot(P,f),L),z=Math.min(n.Cartesian3.dot(I,f),z),B=Math.min(n.Cartesian3.dot(R,f),B);P=n.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=n.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=n.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=n.Cartesian3.add(P,I,t.center);n.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,n.Cartesian3.multiplyByScalar(_,.5,_),n.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const f=new n.Cartesian3,p=new n.Cartesian3;function w(a,t,e,i,s,o,c,u,l,d,h){r.defined(h)||(h=new C);const x=h.halfAxes;n.Matrix3.setColumn(x,0,t,x),n.Matrix3.setColumn(x,1,e,x),n.Matrix3.setColumn(x,2,i,x);let m=f;m.x=(s+o)/2,m.y=(c+u)/2,m.z=(l+d)/2;const M=p;M.x=(o-s)/2,M.y=(u-c)/2,M.z=(d-l)/2;const w=h.center;return m=n.Matrix3.multiplyByVector(x,m,m),n.Cartesian3.add(a,m,w),n.Matrix3.multiplyByScale(x,M,x),h}const g=new n.Cartographic,y=new n.Cartesian3,b=new n.Cartographic,N=new n.Cartographic,T=new n.Cartographic,O=new n.Cartographic,A=new n.Cartographic,P=new n.Cartesian3,I=new n.Cartesian3,R=new n.Cartesian3,E=new n.Cartesian3,S=new n.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new n.Cartesian3,k=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,q=new e.Cartesian2,D=new n.Cartesian3,j=new n.Cartesian3,Z=new n.Cartesian3,v=new o.Plane(n.Cartesian3.UNIT_X,0);C.fromRectangle=function(a,t,C,c,u){let l,d,h,x,m,M,f;if(t=r.defaultValue(t,0),C=r.defaultValue(C,0),c=r.defaultValue(c,n.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),p=new i.EllipsoidTangentPlane(s,c);f=p.plane;const _=r.longitude,k=a.south<0&&a.north>0?0:r.latitude,W=n.Cartographic.fromRadians(_,a.north,C,b),X=n.Cartographic.fromRadians(a.west,a.north,C,N),q=n.Cartographic.fromRadians(a.west,k,C,T),D=n.Cartographic.fromRadians(a.west,a.south,C,O),j=n.Cartographic.fromRadians(_,a.south,C,A),Z=c.cartographicToCartesian(W,P);let v=c.cartographicToCartesian(X,I);const Y=c.cartographicToCartesian(q,R);let G=c.cartographicToCartesian(D,E);const F=c.cartographicToCartesian(j,S),H=p.projectPointToNearestOnPlane(Z,U),J=p.projectPointToNearestOnPlane(v,L),K=p.projectPointToNearestOnPlane(Y,z),Q=p.projectPointToNearestOnPlane(G,B),$=p.projectPointToNearestOnPlane(F,V);return l=Math.min(J.x,K.x,Q.x),d=-l,x=Math.max(J.y,H.y),h=Math.min(Q.y,$.y),X.height=D.height=t,v=c.cartographicToCartesian(X,I),G=c.cartographicToCartesian(D,E),m=Math.min(o.Plane.getPointDistance(f,v),o.Plane.getPointDistance(f,G)),M=C,w(p.origin,p.xAxis,p.yAxis,p.zAxis,l,d,h,x,m,M,u)}const p=a.south>0,Y=a.north<0,G=p?a.south:Y?a.north:0,F=e.Rectangle.center(a,g).longitude,H=n.Cartesian3.fromRadians(F,G,C,c,_);H.z=0;const J=Math.abs(H.x)<s.CesiumMath.EPSILON10&&Math.abs(H.y)<s.CesiumMath.EPSILON10?n.Cartesian3.UNIT_X:n.Cartesian3.normalize(H,k),K=n.Cartesian3.UNIT_Z,Q=n.Cartesian3.cross(J,K,W);f=o.Plane.fromPointNormal(H,J,v);const $=n.Cartesian3.fromRadians(F+s.CesiumMath.PI_OVER_TWO,G,C,c,X);d=n.Cartesian3.dot(o.Plane.projectPointOntoPlane(f,$,q),Q),l=-d,x=n.Cartesian3.fromRadians(0,a.north,Y?t:C,c,D).z,h=n.Cartesian3.fromRadians(0,a.south,p?t:C,c,j).z;const aa=n.Cartesian3.fromRadians(a.east,G,C,c,Z);return m=o.Plane.getPointDistance(f,aa),M=0,w(H,Q,K,J,l,d,h,x,m,M,u)},C.fromTransformation=function(a,t){return r.defined(t)||(t=new C),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=n.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},C.clone=function(a,t){if(r.defined(a))return r.defined(t)?(n.Cartesian3.clone(a.center,t.center),n.Matrix3.clone(a.halfAxes,t.halfAxes),t):new C(a.center,a.halfAxes)},C.intersectPlane=function(a,e){const r=a.center,i=e.normal,s=a.halfAxes,o=i.x,C=i.y,c=i.z,u=Math.abs(o*s[n.Matrix3.COLUMN0ROW0]+C*s[n.Matrix3.COLUMN0ROW1]+c*s[n.Matrix3.COLUMN0ROW2])+Math.abs(o*s[n.Matrix3.COLUMN1ROW0]+C*s[n.Matrix3.COLUMN1ROW1]+c*s[n.Matrix3.COLUMN1ROW2])+Math.abs(o*s[n.Matrix3.COLUMN2ROW0]+C*s[n.Matrix3.COLUMN2ROW1]+c*s[n.Matrix3.COLUMN2ROW2]),l=n.Cartesian3.dot(i,r)+e.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new n.Cartesian3,G=new n.Cartesian3,F=new n.Cartesian3,H=new n.Cartesian3,J=new n.Cartesian3,K=new n.Cartesian3;C.distanceSquaredTo=function(a,t){const e=n.Cartesian3.subtract(t,a.center,f),r=a.halfAxes;let i=n.Matrix3.getColumn(r,0,Y),o=n.Matrix3.getColumn(r,1,G),C=n.Matrix3.getColumn(r,2,F);const c=n.Cartesian3.magnitude(i),u=n.Cartesian3.magnitude(o),l=n.Cartesian3.magnitude(C);let d=!0,h=!0,x=!0;c>0?n.Cartesian3.divideByScalar(i,c,i):d=!1,u>0?n.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?n.Cartesian3.divideByScalar(C,l,C):x=!1;const m=!d+!h+!x;let M,p,w;if(1===m){let a=i;M=o,p=C,h?x||(a=C,p=i):(a=o,M=i),w=n.Cartesian3.cross(M,p,J),a===i?i=w:a===o?o=w:a===C&&(C=w)}else if(2===m){M=i,h?M=o:x&&(M=C);let a=n.Cartesian3.UNIT_Y;a.equalsEpsilon(M,s.CesiumMath.EPSILON3)&&(a=n.Cartesian3.UNIT_X),p=n.Cartesian3.cross(M,a,H),n.Cartesian3.normalize(p,p),w=n.Cartesian3.cross(M,p,J),n.Cartesian3.normalize(w,w),M===i?(o=p,C=w):M===o?(C=p,i=w):M===C&&(i=p,o=w)}else 3===m&&(i=n.Cartesian3.UNIT_X,o=n.Cartesian3.UNIT_Y,C=n.Cartesian3.UNIT_Z);const g=K;g.x=n.Cartesian3.dot(e,i),g.y=n.Cartesian3.dot(e,o),g.z=n.Cartesian3.dot(e,C);let y,b=0;return g.x<-c?(y=g.x+c,b+=y*y):g.x>c&&(y=g.x-c,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new n.Cartesian3,$=new n.Cartesian3;C.computePlaneDistances=function(a,e,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;const c=a.center,u=a.halfAxes,l=n.Matrix3.getColumn(u,0,Y),d=n.Matrix3.getColumn(u,1,G),h=n.Matrix3.getColumn(u,2,F),x=n.Cartesian3.add(l,d,Q);n.Cartesian3.add(x,h,x),n.Cartesian3.add(x,c,x);const m=n.Cartesian3.subtract(x,e,$);let M=n.Cartesian3.dot(i,m);return o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),s.start=o,s.stop=C,s};const aa=new n.Cartesian3,ta=new n.Cartesian3,ea=new n.Cartesian3;C.computeCorners=function(a,t){r.defined(t)||(t=[new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3]);const e=a.center,i=a.halfAxes,s=n.Matrix3.getColumn(i,0,aa),o=n.Matrix3.getColumn(i,1,ta),C=n.Matrix3.getColumn(i,2,ea);return n.Cartesian3.clone(e,t[0]),n.Cartesian3.subtract(t[0],s,t[0]),n.Cartesian3.subtract(t[0],o,t[0]),n.Cartesian3.subtract(t[0],C,t[0]),n.Cartesian3.clone(e,t[1]),n.Cartesian3.subtract(t[1],s,t[1]),n.Cartesian3.subtract(t[1],o,t[1]),n.Cartesian3.add(t[1],C,t[1]),n.Cartesian3.clone(e,t[2]),n.Cartesian3.subtract(t[2],s,t[2]),n.Cartesian3.add(t[2],o,t[2]),n.Cartesian3.subtract(t[2],C,t[2]),n.Cartesian3.clone(e,t[3]),n.Cartesian3.subtract(t[3],s,t[3]),n.Cartesian3.add(t[3],o,t[3]),n.Cartesian3.add(t[3],C,t[3]),n.Cartesian3.clone(e,t[4]),n.Cartesian3.add(t[4],s,t[4]),n.Cartesian3.subtract(t[4],o,t[4]),n.Cartesian3.subtract(t[4],C,t[4]),n.Cartesian3.clone(e,t[5]),n.Cartesian3.add(t[5],s,t[5]),n.Cartesian3.subtract(t[5],o,t[5]),n.Cartesian3.add(t[5],C,t[5]),n.Cartesian3.clone(e,t[6]),n.Cartesian3.add(t[6],s,t[6]),n.Cartesian3.add(t[6],o,t[6]),n.Cartesian3.subtract(t[6],C,t[6]),n.Cartesian3.clone(e,t[7]),n.Cartesian3.add(t[7],s,t[7]),n.Cartesian3.add(t[7],o,t[7]),n.Cartesian3.add(t[7],C,t[7]),t};const na=new n.Matrix3;C.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const i=a.center,s=n.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(s,i,t)};const ra=new t.BoundingSphere;C.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},C.prototype.intersectPlane=function(a){return C.intersectPlane(this,a)},C.prototype.distanceSquaredTo=function(a){return C.distanceSquaredTo(this,a)},C.prototype.computePlaneDistances=function(a,t,e){return C.computePlaneDistances(this,a,t,e)},C.prototype.computeCorners=function(a){return C.computeCorners(this,a)},C.prototype.computeTransformation=function(a){return C.computeTransformation(this,a)},C.prototype.isOccluded=function(a){return C.isOccluded(this,a)},C.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&n.Cartesian3.equals(a.center,t.center)&&n.Matrix3.equals(a.halfAxes,t.halfAxes)},C.prototype.clone=function(a){return C.clone(this,a)},C.prototype.equals=function(a){return C.equals(this,a)},a.OrientedBoundingBox=C})); +define(["exports","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipsoidTangentPlane-c3e9d965","./Math-355606c6","./Plane-5931b53e"],(function(a,t,e,n,r,i,s,o){"use strict";function C(a,t){this.center=n.Cartesian3.clone(r.defaultValue(a,n.Cartesian3.ZERO)),this.halfAxes=n.Matrix3.clone(r.defaultValue(t,n.Matrix3.ZERO))}C.packedLength=n.Cartesian3.packedLength+n.Matrix3.packedLength,C.pack=function(a,t,e){return e=r.defaultValue(e,0),n.Cartesian3.pack(a.center,t,e),n.Matrix3.pack(a.halfAxes,t,e+n.Cartesian3.packedLength),t},C.unpack=function(a,t,e){return t=r.defaultValue(t,0),r.defined(e)||(e=new C),n.Cartesian3.unpack(a,t,e.center),n.Matrix3.unpack(a,t+n.Cartesian3.packedLength,e.halfAxes),e};const c=new n.Cartesian3,u=new n.Cartesian3,l=new n.Cartesian3,d=new n.Cartesian3,h=new n.Cartesian3,x=new n.Cartesian3,m=new n.Matrix3,M={unitary:new n.Matrix3,diagonal:new n.Matrix3};C.fromPoints=function(a,t){if(r.defined(t)||(t=new C),!r.defined(a)||0===a.length)return t.halfAxes=n.Matrix3.ZERO,t.center=n.Cartesian3.ZERO,t;let e;const i=a.length,s=n.Cartesian3.clone(a[0],c);for(e=1;e<i;e++)n.Cartesian3.add(s,a[e],s);const o=1/i;n.Cartesian3.multiplyByScalar(s,o,s);let f,p=0,w=0,g=0,y=0,b=0,N=0;for(e=0;e<i;e++)f=n.Cartesian3.subtract(a[e],s,u),p+=f.x*f.x,w+=f.x*f.y,g+=f.x*f.z,y+=f.y*f.y,b+=f.y*f.z,N+=f.z*f.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=n.Matrix3.computeEigenDecomposition(T,M),A=n.Matrix3.clone(O.unitary,t.halfAxes);let P=n.Matrix3.getColumn(A,0,d),I=n.Matrix3.getColumn(A,1,h),R=n.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(e=0;e<i;e++)f=a[e],E=Math.max(n.Cartesian3.dot(P,f),E),S=Math.max(n.Cartesian3.dot(I,f),S),U=Math.max(n.Cartesian3.dot(R,f),U),L=Math.min(n.Cartesian3.dot(P,f),L),z=Math.min(n.Cartesian3.dot(I,f),z),B=Math.min(n.Cartesian3.dot(R,f),B);P=n.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=n.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=n.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=n.Cartesian3.add(P,I,t.center);n.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,n.Cartesian3.multiplyByScalar(_,.5,_),n.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const f=new n.Cartesian3,p=new n.Cartesian3;function w(a,t,e,i,s,o,c,u,l,d,h){r.defined(h)||(h=new C);const x=h.halfAxes;n.Matrix3.setColumn(x,0,t,x),n.Matrix3.setColumn(x,1,e,x),n.Matrix3.setColumn(x,2,i,x);let m=f;m.x=(s+o)/2,m.y=(c+u)/2,m.z=(l+d)/2;const M=p;M.x=(o-s)/2,M.y=(u-c)/2,M.z=(d-l)/2;const w=h.center;return m=n.Matrix3.multiplyByVector(x,m,m),n.Cartesian3.add(a,m,w),n.Matrix3.multiplyByScale(x,M,x),h}const g=new n.Cartographic,y=new n.Cartesian3,b=new n.Cartographic,N=new n.Cartographic,T=new n.Cartographic,O=new n.Cartographic,A=new n.Cartographic,P=new n.Cartesian3,I=new n.Cartesian3,R=new n.Cartesian3,E=new n.Cartesian3,S=new n.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new n.Cartesian3,k=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,q=new e.Cartesian2,D=new n.Cartesian3,j=new n.Cartesian3,Z=new n.Cartesian3,v=new o.Plane(n.Cartesian3.UNIT_X,0);C.fromRectangle=function(a,t,C,c,u){let l,d,h,x,m,M,f;if(t=r.defaultValue(t,0),C=r.defaultValue(C,0),c=r.defaultValue(c,n.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),p=new i.EllipsoidTangentPlane(s,c);f=p.plane;const _=r.longitude,k=a.south<0&&a.north>0?0:r.latitude,W=n.Cartographic.fromRadians(_,a.north,C,b),X=n.Cartographic.fromRadians(a.west,a.north,C,N),q=n.Cartographic.fromRadians(a.west,k,C,T),D=n.Cartographic.fromRadians(a.west,a.south,C,O),j=n.Cartographic.fromRadians(_,a.south,C,A),Z=c.cartographicToCartesian(W,P);let v=c.cartographicToCartesian(X,I);const Y=c.cartographicToCartesian(q,R);let G=c.cartographicToCartesian(D,E);const F=c.cartographicToCartesian(j,S),H=p.projectPointToNearestOnPlane(Z,U),J=p.projectPointToNearestOnPlane(v,L),K=p.projectPointToNearestOnPlane(Y,z),Q=p.projectPointToNearestOnPlane(G,B),$=p.projectPointToNearestOnPlane(F,V);return l=Math.min(J.x,K.x,Q.x),d=-l,x=Math.max(J.y,H.y),h=Math.min(Q.y,$.y),X.height=D.height=t,v=c.cartographicToCartesian(X,I),G=c.cartographicToCartesian(D,E),m=Math.min(o.Plane.getPointDistance(f,v),o.Plane.getPointDistance(f,G)),M=C,w(p.origin,p.xAxis,p.yAxis,p.zAxis,l,d,h,x,m,M,u)}const p=a.south>0,Y=a.north<0,G=p?a.south:Y?a.north:0,F=e.Rectangle.center(a,g).longitude,H=n.Cartesian3.fromRadians(F,G,C,c,_);H.z=0;const J=Math.abs(H.x)<s.CesiumMath.EPSILON10&&Math.abs(H.y)<s.CesiumMath.EPSILON10?n.Cartesian3.UNIT_X:n.Cartesian3.normalize(H,k),K=n.Cartesian3.UNIT_Z,Q=n.Cartesian3.cross(J,K,W);f=o.Plane.fromPointNormal(H,J,v);const $=n.Cartesian3.fromRadians(F+s.CesiumMath.PI_OVER_TWO,G,C,c,X);d=n.Cartesian3.dot(o.Plane.projectPointOntoPlane(f,$,q),Q),l=-d,x=n.Cartesian3.fromRadians(0,a.north,Y?t:C,c,D).z,h=n.Cartesian3.fromRadians(0,a.south,p?t:C,c,j).z;const aa=n.Cartesian3.fromRadians(a.east,G,C,c,Z);return m=o.Plane.getPointDistance(f,aa),M=0,w(H,Q,K,J,l,d,h,x,m,M,u)},C.fromTransformation=function(a,t){return r.defined(t)||(t=new C),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=n.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},C.clone=function(a,t){if(r.defined(a))return r.defined(t)?(n.Cartesian3.clone(a.center,t.center),n.Matrix3.clone(a.halfAxes,t.halfAxes),t):new C(a.center,a.halfAxes)},C.intersectPlane=function(a,e){const r=a.center,i=e.normal,s=a.halfAxes,o=i.x,C=i.y,c=i.z,u=Math.abs(o*s[n.Matrix3.COLUMN0ROW0]+C*s[n.Matrix3.COLUMN0ROW1]+c*s[n.Matrix3.COLUMN0ROW2])+Math.abs(o*s[n.Matrix3.COLUMN1ROW0]+C*s[n.Matrix3.COLUMN1ROW1]+c*s[n.Matrix3.COLUMN1ROW2])+Math.abs(o*s[n.Matrix3.COLUMN2ROW0]+C*s[n.Matrix3.COLUMN2ROW1]+c*s[n.Matrix3.COLUMN2ROW2]),l=n.Cartesian3.dot(i,r)+e.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new n.Cartesian3,G=new n.Cartesian3,F=new n.Cartesian3,H=new n.Cartesian3,J=new n.Cartesian3,K=new n.Cartesian3;C.distanceSquaredTo=function(a,t){const e=n.Cartesian3.subtract(t,a.center,f),r=a.halfAxes;let i=n.Matrix3.getColumn(r,0,Y),o=n.Matrix3.getColumn(r,1,G),C=n.Matrix3.getColumn(r,2,F);const c=n.Cartesian3.magnitude(i),u=n.Cartesian3.magnitude(o),l=n.Cartesian3.magnitude(C);let d=!0,h=!0,x=!0;c>0?n.Cartesian3.divideByScalar(i,c,i):d=!1,u>0?n.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?n.Cartesian3.divideByScalar(C,l,C):x=!1;const m=!d+!h+!x;let M,p,w;if(1===m){let a=i;M=o,p=C,h?x||(a=C,p=i):(a=o,M=i),w=n.Cartesian3.cross(M,p,J),a===i?i=w:a===o?o=w:a===C&&(C=w)}else if(2===m){M=i,h?M=o:x&&(M=C);let a=n.Cartesian3.UNIT_Y;a.equalsEpsilon(M,s.CesiumMath.EPSILON3)&&(a=n.Cartesian3.UNIT_X),p=n.Cartesian3.cross(M,a,H),n.Cartesian3.normalize(p,p),w=n.Cartesian3.cross(M,p,J),n.Cartesian3.normalize(w,w),M===i?(o=p,C=w):M===o?(C=p,i=w):M===C&&(i=p,o=w)}else 3===m&&(i=n.Cartesian3.UNIT_X,o=n.Cartesian3.UNIT_Y,C=n.Cartesian3.UNIT_Z);const g=K;g.x=n.Cartesian3.dot(e,i),g.y=n.Cartesian3.dot(e,o),g.z=n.Cartesian3.dot(e,C);let y,b=0;return g.x<-c?(y=g.x+c,b+=y*y):g.x>c&&(y=g.x-c,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new n.Cartesian3,$=new n.Cartesian3;C.computePlaneDistances=function(a,e,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;const c=a.center,u=a.halfAxes,l=n.Matrix3.getColumn(u,0,Y),d=n.Matrix3.getColumn(u,1,G),h=n.Matrix3.getColumn(u,2,F),x=n.Cartesian3.add(l,d,Q);n.Cartesian3.add(x,h,x),n.Cartesian3.add(x,c,x);const m=n.Cartesian3.subtract(x,e,$);let M=n.Cartesian3.dot(i,m);return o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.add(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.add(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.add(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),n.Cartesian3.subtract(c,l,x),n.Cartesian3.subtract(x,d,x),n.Cartesian3.subtract(x,h,x),n.Cartesian3.subtract(x,e,m),M=n.Cartesian3.dot(i,m),o=Math.min(M,o),C=Math.max(M,C),s.start=o,s.stop=C,s};const aa=new n.Cartesian3,ta=new n.Cartesian3,ea=new n.Cartesian3;C.computeCorners=function(a,t){r.defined(t)||(t=[new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3,new n.Cartesian3]);const e=a.center,i=a.halfAxes,s=n.Matrix3.getColumn(i,0,aa),o=n.Matrix3.getColumn(i,1,ta),C=n.Matrix3.getColumn(i,2,ea);return n.Cartesian3.clone(e,t[0]),n.Cartesian3.subtract(t[0],s,t[0]),n.Cartesian3.subtract(t[0],o,t[0]),n.Cartesian3.subtract(t[0],C,t[0]),n.Cartesian3.clone(e,t[1]),n.Cartesian3.subtract(t[1],s,t[1]),n.Cartesian3.subtract(t[1],o,t[1]),n.Cartesian3.add(t[1],C,t[1]),n.Cartesian3.clone(e,t[2]),n.Cartesian3.subtract(t[2],s,t[2]),n.Cartesian3.add(t[2],o,t[2]),n.Cartesian3.subtract(t[2],C,t[2]),n.Cartesian3.clone(e,t[3]),n.Cartesian3.subtract(t[3],s,t[3]),n.Cartesian3.add(t[3],o,t[3]),n.Cartesian3.add(t[3],C,t[3]),n.Cartesian3.clone(e,t[4]),n.Cartesian3.add(t[4],s,t[4]),n.Cartesian3.subtract(t[4],o,t[4]),n.Cartesian3.subtract(t[4],C,t[4]),n.Cartesian3.clone(e,t[5]),n.Cartesian3.add(t[5],s,t[5]),n.Cartesian3.subtract(t[5],o,t[5]),n.Cartesian3.add(t[5],C,t[5]),n.Cartesian3.clone(e,t[6]),n.Cartesian3.add(t[6],s,t[6]),n.Cartesian3.add(t[6],o,t[6]),n.Cartesian3.subtract(t[6],C,t[6]),n.Cartesian3.clone(e,t[7]),n.Cartesian3.add(t[7],s,t[7]),n.Cartesian3.add(t[7],o,t[7]),n.Cartesian3.add(t[7],C,t[7]),t};const na=new n.Matrix3;C.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const i=a.center,s=n.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(s,i,t)};const ra=new t.BoundingSphere;C.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},C.prototype.intersectPlane=function(a){return C.intersectPlane(this,a)},C.prototype.distanceSquaredTo=function(a){return C.distanceSquaredTo(this,a)},C.prototype.computePlaneDistances=function(a,t,e){return C.computePlaneDistances(this,a,t,e)},C.prototype.computeCorners=function(a){return C.computeCorners(this,a)},C.prototype.computeTransformation=function(a){return C.computeTransformation(this,a)},C.prototype.isOccluded=function(a){return C.isOccluded(this,a)},C.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&n.Cartesian3.equals(a.center,t.center)&&n.Matrix3.equals(a.halfAxes,t.halfAxes)},C.prototype.clone=function(a){return C.clone(this,a)},C.prototype.equals=function(a){return C.equals(this,a)},a.OrientedBoundingBox=C})); diff --git a/public/lib/Cesium/Workers/Plane-6add0ae1.js b/public/lib/Cesium/Workers/Plane-5931b53e.js similarity index 96% rename from public/lib/Cesium/Workers/Plane-6add0ae1.js rename to public/lib/Cesium/Workers/Plane-5931b53e.js index 10402633..2b0e061e 100644 --- a/public/lib/Cesium/Workers/Plane-6add0ae1.js +++ b/public/lib/Cesium/Workers/Plane-5931b53e.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./Matrix2-413c4048","./defaultValue-f6d5e6da"],(function(n,e,a,t){"use strict";function r(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}r.fromPointNormal=function(n,a,i){const s=-e.Cartesian3.dot(a,n);return t.defined(i)?(e.Cartesian3.clone(a,i.normal),i.distance=s,i):new r(a,s)};const i=new e.Cartesian3;r.fromCartesian4=function(n,a){const s=e.Cartesian3.fromCartesian4(n,i),o=n.w;return t.defined(a)?(e.Cartesian3.clone(s,a.normal),a.distance=o,a):new r(s,o)},r.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const s=new e.Cartesian3;r.projectPointOntoPlane=function(n,a,i){t.defined(i)||(i=new e.Cartesian3);const o=r.getPointDistance(n,a),c=e.Cartesian3.multiplyByScalar(n.normal,o,s);return e.Cartesian3.subtract(a,c,i)};const o=new a.Matrix4,c=new a.Cartesian4,l=new e.Cartesian3;r.transform=function(n,t,i){const s=n.normal,C=n.distance,d=a.Matrix4.inverseTranspose(t,o);let f=a.Cartesian4.fromElements(s.x,s.y,s.z,C,c);f=a.Matrix4.multiplyByVector(d,f,f);const u=e.Cartesian3.fromCartesian4(f,l);return f=a.Cartesian4.divideByScalar(f,e.Cartesian3.magnitude(u),f),r.fromCartesian4(f,i)},r.clone=function(n,a){return t.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new r(n.normal,n.distance)},r.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},r.ORIGIN_XY_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_Z,0)),r.ORIGIN_YZ_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_X,0)),r.ORIGIN_ZX_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_Y,0)),n.Plane=r})); +define(["exports","./Matrix3-b2351961","./Matrix2-7a8e9daf","./defaultValue-f6d5e6da"],(function(n,e,a,t){"use strict";function r(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}r.fromPointNormal=function(n,a,i){const s=-e.Cartesian3.dot(a,n);return t.defined(i)?(e.Cartesian3.clone(a,i.normal),i.distance=s,i):new r(a,s)};const i=new e.Cartesian3;r.fromCartesian4=function(n,a){const s=e.Cartesian3.fromCartesian4(n,i),o=n.w;return t.defined(a)?(e.Cartesian3.clone(s,a.normal),a.distance=o,a):new r(s,o)},r.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const s=new e.Cartesian3;r.projectPointOntoPlane=function(n,a,i){t.defined(i)||(i=new e.Cartesian3);const o=r.getPointDistance(n,a),c=e.Cartesian3.multiplyByScalar(n.normal,o,s);return e.Cartesian3.subtract(a,c,i)};const o=new a.Matrix4,c=new a.Cartesian4,l=new e.Cartesian3;r.transform=function(n,t,i){const s=n.normal,C=n.distance,d=a.Matrix4.inverseTranspose(t,o);let f=a.Cartesian4.fromElements(s.x,s.y,s.z,C,c);f=a.Matrix4.multiplyByVector(d,f,f);const u=e.Cartesian3.fromCartesian4(f,l);return f=a.Cartesian4.divideByScalar(f,e.Cartesian3.magnitude(u),f),r.fromCartesian4(f,i)},r.clone=function(n,a){return t.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new r(n.normal,n.distance)},r.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},r.ORIGIN_XY_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_Z,0)),r.ORIGIN_YZ_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_X,0)),r.ORIGIN_ZX_PLANE=Object.freeze(new r(e.Cartesian3.UNIT_Y,0)),n.Plane=r})); diff --git a/public/lib/Cesium/Workers/PolygonGeometryLibrary-f2ea6fbf.js b/public/lib/Cesium/Workers/PolygonGeometryLibrary-b67529a6.js similarity index 96% rename from public/lib/Cesium/Workers/PolygonGeometryLibrary-f2ea6fbf.js rename to public/lib/Cesium/Workers/PolygonGeometryLibrary-b67529a6.js index 72075015..c43d8df4 100644 --- a/public/lib/Cesium/Workers/PolygonGeometryLibrary-f2ea6fbf.js +++ b/public/lib/Cesium/Workers/PolygonGeometryLibrary-b67529a6.js @@ -1 +1 @@ -define(["exports","./ArcType-26a3f38d","./arrayRemoveDuplicates-9b636830","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipsoidRhumbLine-77eff028","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./Transforms-b3716b06"],(function(e,t,n,i,o,r,a,s,c,l,u,h,p,d,f){"use strict";function y(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(y.prototype,{length:{get:function(){return this._length}}}),y.prototype.enqueue=function(e){this._array.push(e),this._length++},y.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},y.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},y.prototype.contains=function(e){return-1!==this._array.indexOf(e)},y.prototype.clear=function(){this._array.length=this._offset=this._length=0},y.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const g={computeHierarchyPackedLength:function(e,t){let n=0;const i=[e];for(;i.length>0;){const e=i.pop();if(!a.defined(e))continue;n+=2;const o=e.positions,r=e.holes;if(a.defined(o)&&o.length>0&&(n+=o.length*t.packedLength),a.defined(r)){const e=r.length;for(let t=0;t<e;++t)i.push(r[t])}}return n},packPolygonHierarchy:function(e,t,n,i){const o=[e];for(;o.length>0;){const e=o.pop();if(!a.defined(e))continue;const r=e.positions,s=e.holes;if(t[n++]=a.defined(r)?r.length:0,t[n++]=a.defined(s)?s.length:0,a.defined(r)){const e=r.length;for(let o=0;o<e;++o,n+=i.packedLength)i.pack(r[o],t,n)}if(a.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t,n){const i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let o=0;o<i;++o,t+=n.packedLength)r[o]=n.unpack(e,t);for(let i=0;i<o;++i)a[i]=g.unpackPolygonHierarchy(e,t,n),t=a[i].startingIndex,delete a[i].startingIndex;return{positions:r,holes:a,startingIndex:t}}},m=new i.Cartesian2;function C(e,t,n,o){return i.Cartesian2.subtract(t,e,m),i.Cartesian2.multiplyByScalar(m,n/o,m),i.Cartesian2.add(e,m,m),[m.x,m.y]}const b=new o.Cartesian3;function x(e,t,n,i){return o.Cartesian3.subtract(t,e,b),o.Cartesian3.multiplyByScalar(b,n/i,b),o.Cartesian3.add(e,b,b),[b.x,b.y,b.z]}g.subdivideLineCount=function(e,t,n){const i=o.Cartesian3.distance(e,t)/n,r=Math.max(0,Math.ceil(p.CesiumMath.log2(i)));return Math.pow(2,r)};const T=new o.Cartographic,v=new o.Cartographic,w=new o.Cartographic,A=new o.Cartesian3,L=new s.EllipsoidRhumbLine;g.subdivideRhumbLineCount=function(e,t,n,i){const o=e.cartesianToCartographic(t,T),r=e.cartesianToCartographic(n,v),a=new s.EllipsoidRhumbLine(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(p.CesiumMath.log2(a)));return Math.pow(2,c)},g.subdivideTexcoordLine=function(e,t,n,o,r,a){const s=g.subdivideLineCount(n,o,r),c=i.Cartesian2.distance(e,t),l=c/s,u=a;u.length=2*s;let h=0;for(let n=0;n<s;n++){const i=C(e,t,n*l,c);u[h++]=i[0],u[h++]=i[1]}return u},g.subdivideLine=function(e,t,n,i){const r=g.subdivideLineCount(e,t,n),s=o.Cartesian3.distance(e,t),c=s/r;a.defined(i)||(i=[]);const l=i;l.length=3*r;let u=0;for(let n=0;n<r;n++){const i=x(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},g.subdivideTexcoordRhumbLine=function(e,t,n,o,r,a,s){const c=n.cartesianToCartographic(o,T),l=n.cartesianToCartographic(r,v);L.setEndPoints(c,l);const u=L.surfaceDistance/a,h=Math.max(0,Math.ceil(p.CesiumMath.log2(u))),d=Math.pow(2,h),f=i.Cartesian2.distance(e,t),y=f/d,g=s;g.length=2*d;let m=0;for(let n=0;n<d;n++){const i=C(e,t,n*y,f);g[m++]=i[0],g[m++]=i[1]}return g},g.subdivideRhumbLine=function(e,t,n,i,o){const r=e.cartesianToCartographic(t,T),c=e.cartesianToCartographic(n,v),l=new s.EllipsoidRhumbLine(r,c,e),u=l.surfaceDistance/i,h=Math.max(0,Math.ceil(p.CesiumMath.log2(u))),d=Math.pow(2,h),f=l.surfaceDistance/d;a.defined(o)||(o=[]);const y=o;y.length=3*d;let g=0;for(let t=0;t<d;t++){const n=l.interpolateUsingSurfaceDistance(t*f,w),i=e.cartographicToCartesian(n,A);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const E=new o.Cartesian3,I=new o.Cartesian3,M=new o.Cartesian3,P=new o.Cartesian3;g.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=a.defaultValue(i,o.Ellipsoid.WGS84);const s=E;let c=I;const l=M;let u=P;if(a.defined(e)&&a.defined(e.attributes)&&a.defined(e.attributes.position)){const a=e.attributes.position.values,h=a.length/2;for(let e=0;e<h;e+=3)o.Cartesian3.fromArray(a,e,l),i.geodeticSurfaceNormal(l,s),u=i.scaleToGeodeticSurface(l,u),c=o.Cartesian3.multiplyByScalar(s,n,c),c=o.Cartesian3.add(u,c,c),a[e+h]=c.x,a[e+1+h]=c.y,a[e+2+h]=c.z,r&&(u=o.Cartesian3.clone(l,u)),c=o.Cartesian3.multiplyByScalar(s,t,c),c=o.Cartesian3.add(u,c,c),a[e]=c.x,a[e+1]=c.y,a[e+2]=c.z}return e},g.polygonOutlinesFromHierarchy=function(e,t,i){const r=[],s=new y;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)i.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,o.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const p=e.holes?e.holes.length:0;for(c=0;c<p;c++){const h=e.holes[c];let p=h.positions;if(t)for(u=p.length,l=0;l<u;++l)i.scaleToGeodeticSurface(p[l],p[l]);if(p=n.arrayRemoveDuplicates(p,o.Cartesian3.equalsEpsilon,!0),p.length<3)continue;r.push(p);let d=0;for(a.defined(h.holes)&&(d=h.holes.length),l=0;l<d;l++)s.enqueue(h.holes[l])}r.push(h)}return r},g.polygonsFromHierarchy=function(e,t,i,r,s){const c=[],l=[],u=new y;for(u.enqueue(e);0!==u.length;){const e=u.dequeue();let h=e.positions;const p=e.holes;let f,y;if(r)for(y=h.length,f=0;f<y;f++)s.scaleToGeodeticSurface(h[f],h[f]);if(t||(h=n.arrayRemoveDuplicates(h,o.Cartesian3.equalsEpsilon,!0)),h.length<3)continue;let g=i(h);if(!a.defined(g))continue;const m=[];let C=d.PolygonPipeline.computeWindingOrder2D(g);C===d.WindingOrder.CLOCKWISE&&(g.reverse(),h=h.slice().reverse());let b=h.slice();const x=a.defined(p)?p.length:0,T=[];let v;for(f=0;f<x;f++){const e=p[f];let c=e.positions;if(r)for(y=c.length,v=0;v<y;++v)s.scaleToGeodeticSurface(c[v],c[v]);if(t||(c=n.arrayRemoveDuplicates(c,o.Cartesian3.equalsEpsilon,!0)),c.length<3)continue;const l=i(c);if(!a.defined(l))continue;C=d.PolygonPipeline.computeWindingOrder2D(l),C===d.WindingOrder.CLOCKWISE&&(l.reverse(),c=c.slice().reverse()),T.push(c),m.push(b.length),b=b.concat(c),g=g.concat(l);let h=0;for(a.defined(e.holes)&&(h=e.holes.length),v=0;v<h;v++)u.enqueue(e.holes[v])}c.push({outerRing:h,holes:T}),l.push({positions:b,positions2D:g,holes:m})}return{hierarchy:c,polygons:l}};const D=new i.Cartesian2,_=new o.Cartesian3,G=new f.Quaternion,S=new o.Matrix3;g.computeBoundingRectangle=function(e,t,n,i,r){const s=f.Quaternion.fromAxisAngle(e,i,G),c=o.Matrix3.fromQuaternion(s,S);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const i=o.Cartesian3.clone(n[e],_);o.Matrix3.multiplyByVector(c,i,i);const r=t(i,D);a.defined(r)&&(l=Math.min(l,r.x),u=Math.max(u,r.x),h=Math.min(h,r.y),p=Math.max(p,r.y))}return r.x=l,r.y=h,r.width=u-l,r.height=p-h,r},g.createGeometryFromPositions=function(e,n,o,s,l,h,p){let f=d.PolygonPipeline.triangulate(n.positions2D,n.holes);f.length<3&&(f=[0,1,2]);const y=n.positions,g=a.defined(o),m=g?o.positions:void 0;if(l){const e=y.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=y[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const o={attributes:{position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:f,primitiveType:c.PrimitiveType.TRIANGLES};g&&(o.attributes.st=new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i.Cartesian2.packArray(m)}));const a=new c.Geometry(o);return h.normal?u.GeometryPipeline.computeNormal(a):a}return p===t.ArcType.GEODESIC?d.PolygonPipeline.computeSubdivision(e,y,f,m,s):p===t.ArcType.RHUMB?d.PolygonPipeline.computeRhumbLineSubdivision(e,y,f,m,s):void 0};const R=[],N=[],O=new o.Cartesian3,q=new o.Cartesian3;g.computeWallGeometry=function(e,n,i,s,u,d){let f,y,m,C,b,x,T,v,w,A=e.length,L=0,E=0;const I=a.defined(n),M=I?n.positions:void 0;if(u)for(y=3*A*2,f=new Array(2*y),I&&(w=2*A*2,v=new Array(2*w)),m=0;m<A;m++)C=e[m],b=e[(m+1)%A],f[L]=f[L+y]=C.x,++L,f[L]=f[L+y]=C.y,++L,f[L]=f[L+y]=C.z,++L,f[L]=f[L+y]=b.x,++L,f[L]=f[L+y]=b.y,++L,f[L]=f[L+y]=b.z,++L,I&&(x=M[m],T=M[(m+1)%A],v[E]=v[E+w]=x.x,++E,v[E]=v[E+w]=x.y,++E,v[E]=v[E+w]=T.x,++E,v[E]=v[E+w]=T.y,++E);else{const n=p.CesiumMath.chordLength(s,i.maximumRadius);let o=0;if(d===t.ArcType.GEODESIC)for(m=0;m<A;m++)o+=g.subdivideLineCount(e[m],e[(m+1)%A],n);else if(d===t.ArcType.RHUMB)for(m=0;m<A;m++)o+=g.subdivideRhumbLineCount(i,e[m],e[(m+1)%A],n);for(y=3*(o+A),f=new Array(2*y),I&&(w=2*(o+A),v=new Array(2*w)),m=0;m<A;m++){let o,r;C=e[m],b=e[(m+1)%A],I&&(x=M[m],T=M[(m+1)%A]),d===t.ArcType.GEODESIC?(o=g.subdivideLine(C,b,n,N),I&&(r=g.subdivideTexcoordLine(x,T,C,b,n,R))):d===t.ArcType.RHUMB&&(o=g.subdivideRhumbLine(i,C,b,n,N),I&&(r=g.subdivideTexcoordRhumbLine(x,T,i,C,b,n,R)));const a=o.length;for(let e=0;e<a;++e,++L)f[L]=o[e],f[L+y]=o[e];if(f[L]=b.x,f[L+y]=b.x,++L,f[L]=b.y,f[L+y]=b.y,++L,f[L]=b.z,f[L+y]=b.z,++L,I){const e=r.length;for(let t=0;t<e;++t,++E)v[E]=r[t],v[E+w]=r[t];v[E]=T.x,v[E+w]=T.x,++E,v[E]=T.y,v[E+w]=T.y,++E}}}A=f.length;const P=h.IndexDatatype.createTypedArray(A/3,A-6*e.length);let D=0;for(A/=6,m=0;m<A;m++){const e=m,t=e+1,n=e+A,i=n+1;C=o.Cartesian3.fromArray(f,3*e,O),b=o.Cartesian3.fromArray(f,3*t,q),o.Cartesian3.equalsEpsilon(C,b,p.CesiumMath.EPSILON10,p.CesiumMath.EPSILON10)||(P[D++]=e,P[D++]=n,P[D++]=t,P[D++]=t,P[D++]=n,P[D++]=i)}const _={attributes:new l.GeometryAttributes({position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:P,primitiveType:c.PrimitiveType.TRIANGLES};I&&(_.attributes.st=new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v}));return new c.Geometry(_)};var k=g;e.PolygonGeometryLibrary=k})); +define(["exports","./ArcType-26a3f38d","./arrayRemoveDuplicates-0d8dde26","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipsoidRhumbLine-1289f7e8","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./Transforms-f17097e5"],(function(e,t,n,i,o,r,a,s,c,l,u,h,p,d,f){"use strict";function y(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(y.prototype,{length:{get:function(){return this._length}}}),y.prototype.enqueue=function(e){this._array.push(e),this._length++},y.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},y.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},y.prototype.contains=function(e){return-1!==this._array.indexOf(e)},y.prototype.clear=function(){this._array.length=this._offset=this._length=0},y.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const g={computeHierarchyPackedLength:function(e,t){let n=0;const i=[e];for(;i.length>0;){const e=i.pop();if(!a.defined(e))continue;n+=2;const o=e.positions,r=e.holes;if(a.defined(o)&&o.length>0&&(n+=o.length*t.packedLength),a.defined(r)){const e=r.length;for(let t=0;t<e;++t)i.push(r[t])}}return n},packPolygonHierarchy:function(e,t,n,i){const o=[e];for(;o.length>0;){const e=o.pop();if(!a.defined(e))continue;const r=e.positions,s=e.holes;if(t[n++]=a.defined(r)?r.length:0,t[n++]=a.defined(s)?s.length:0,a.defined(r)){const e=r.length;for(let o=0;o<e;++o,n+=i.packedLength)i.pack(r[o],t,n)}if(a.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t,n){const i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let o=0;o<i;++o,t+=n.packedLength)r[o]=n.unpack(e,t);for(let i=0;i<o;++i)a[i]=g.unpackPolygonHierarchy(e,t,n),t=a[i].startingIndex,delete a[i].startingIndex;return{positions:r,holes:a,startingIndex:t}}},m=new i.Cartesian2;function C(e,t,n,o){return i.Cartesian2.subtract(t,e,m),i.Cartesian2.multiplyByScalar(m,n/o,m),i.Cartesian2.add(e,m,m),[m.x,m.y]}const b=new o.Cartesian3;function x(e,t,n,i){return o.Cartesian3.subtract(t,e,b),o.Cartesian3.multiplyByScalar(b,n/i,b),o.Cartesian3.add(e,b,b),[b.x,b.y,b.z]}g.subdivideLineCount=function(e,t,n){const i=o.Cartesian3.distance(e,t)/n,r=Math.max(0,Math.ceil(p.CesiumMath.log2(i)));return Math.pow(2,r)};const T=new o.Cartographic,v=new o.Cartographic,w=new o.Cartographic,A=new o.Cartesian3,L=new s.EllipsoidRhumbLine;g.subdivideRhumbLineCount=function(e,t,n,i){const o=e.cartesianToCartographic(t,T),r=e.cartesianToCartographic(n,v),a=new s.EllipsoidRhumbLine(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(p.CesiumMath.log2(a)));return Math.pow(2,c)},g.subdivideTexcoordLine=function(e,t,n,o,r,a){const s=g.subdivideLineCount(n,o,r),c=i.Cartesian2.distance(e,t),l=c/s,u=a;u.length=2*s;let h=0;for(let n=0;n<s;n++){const i=C(e,t,n*l,c);u[h++]=i[0],u[h++]=i[1]}return u},g.subdivideLine=function(e,t,n,i){const r=g.subdivideLineCount(e,t,n),s=o.Cartesian3.distance(e,t),c=s/r;a.defined(i)||(i=[]);const l=i;l.length=3*r;let u=0;for(let n=0;n<r;n++){const i=x(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},g.subdivideTexcoordRhumbLine=function(e,t,n,o,r,a,s){const c=n.cartesianToCartographic(o,T),l=n.cartesianToCartographic(r,v);L.setEndPoints(c,l);const u=L.surfaceDistance/a,h=Math.max(0,Math.ceil(p.CesiumMath.log2(u))),d=Math.pow(2,h),f=i.Cartesian2.distance(e,t),y=f/d,g=s;g.length=2*d;let m=0;for(let n=0;n<d;n++){const i=C(e,t,n*y,f);g[m++]=i[0],g[m++]=i[1]}return g},g.subdivideRhumbLine=function(e,t,n,i,o){const r=e.cartesianToCartographic(t,T),c=e.cartesianToCartographic(n,v),l=new s.EllipsoidRhumbLine(r,c,e),u=l.surfaceDistance/i,h=Math.max(0,Math.ceil(p.CesiumMath.log2(u))),d=Math.pow(2,h),f=l.surfaceDistance/d;a.defined(o)||(o=[]);const y=o;y.length=3*d;let g=0;for(let t=0;t<d;t++){const n=l.interpolateUsingSurfaceDistance(t*f,w),i=e.cartographicToCartesian(n,A);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const E=new o.Cartesian3,I=new o.Cartesian3,M=new o.Cartesian3,P=new o.Cartesian3;g.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=a.defaultValue(i,o.Ellipsoid.WGS84);const s=E;let c=I;const l=M;let u=P;if(a.defined(e)&&a.defined(e.attributes)&&a.defined(e.attributes.position)){const a=e.attributes.position.values,h=a.length/2;for(let e=0;e<h;e+=3)o.Cartesian3.fromArray(a,e,l),i.geodeticSurfaceNormal(l,s),u=i.scaleToGeodeticSurface(l,u),c=o.Cartesian3.multiplyByScalar(s,n,c),c=o.Cartesian3.add(u,c,c),a[e+h]=c.x,a[e+1+h]=c.y,a[e+2+h]=c.z,r&&(u=o.Cartesian3.clone(l,u)),c=o.Cartesian3.multiplyByScalar(s,t,c),c=o.Cartesian3.add(u,c,c),a[e]=c.x,a[e+1]=c.y,a[e+2]=c.z}return e},g.polygonOutlinesFromHierarchy=function(e,t,i){const r=[],s=new y;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)i.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,o.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const p=e.holes?e.holes.length:0;for(c=0;c<p;c++){const h=e.holes[c];let p=h.positions;if(t)for(u=p.length,l=0;l<u;++l)i.scaleToGeodeticSurface(p[l],p[l]);if(p=n.arrayRemoveDuplicates(p,o.Cartesian3.equalsEpsilon,!0),p.length<3)continue;r.push(p);let d=0;for(a.defined(h.holes)&&(d=h.holes.length),l=0;l<d;l++)s.enqueue(h.holes[l])}r.push(h)}return r},g.polygonsFromHierarchy=function(e,t,i,r,s){const c=[],l=[],u=new y;for(u.enqueue(e);0!==u.length;){const e=u.dequeue();let h=e.positions;const p=e.holes;let f,y;if(r)for(y=h.length,f=0;f<y;f++)s.scaleToGeodeticSurface(h[f],h[f]);if(t||(h=n.arrayRemoveDuplicates(h,o.Cartesian3.equalsEpsilon,!0)),h.length<3)continue;let g=i(h);if(!a.defined(g))continue;const m=[];let C=d.PolygonPipeline.computeWindingOrder2D(g);C===d.WindingOrder.CLOCKWISE&&(g.reverse(),h=h.slice().reverse());let b=h.slice();const x=a.defined(p)?p.length:0,T=[];let v;for(f=0;f<x;f++){const e=p[f];let c=e.positions;if(r)for(y=c.length,v=0;v<y;++v)s.scaleToGeodeticSurface(c[v],c[v]);if(t||(c=n.arrayRemoveDuplicates(c,o.Cartesian3.equalsEpsilon,!0)),c.length<3)continue;const l=i(c);if(!a.defined(l))continue;C=d.PolygonPipeline.computeWindingOrder2D(l),C===d.WindingOrder.CLOCKWISE&&(l.reverse(),c=c.slice().reverse()),T.push(c),m.push(b.length),b=b.concat(c),g=g.concat(l);let h=0;for(a.defined(e.holes)&&(h=e.holes.length),v=0;v<h;v++)u.enqueue(e.holes[v])}c.push({outerRing:h,holes:T}),l.push({positions:b,positions2D:g,holes:m})}return{hierarchy:c,polygons:l}};const D=new i.Cartesian2,_=new o.Cartesian3,G=new f.Quaternion,S=new o.Matrix3;g.computeBoundingRectangle=function(e,t,n,i,r){const s=f.Quaternion.fromAxisAngle(e,i,G),c=o.Matrix3.fromQuaternion(s,S);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const i=o.Cartesian3.clone(n[e],_);o.Matrix3.multiplyByVector(c,i,i);const r=t(i,D);a.defined(r)&&(l=Math.min(l,r.x),u=Math.max(u,r.x),h=Math.min(h,r.y),p=Math.max(p,r.y))}return r.x=l,r.y=h,r.width=u-l,r.height=p-h,r},g.createGeometryFromPositions=function(e,n,o,s,l,h,p){let f=d.PolygonPipeline.triangulate(n.positions2D,n.holes);f.length<3&&(f=[0,1,2]);const y=n.positions,g=a.defined(o),m=g?o.positions:void 0;if(l){const e=y.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=y[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const o={attributes:{position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:f,primitiveType:c.PrimitiveType.TRIANGLES};g&&(o.attributes.st=new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i.Cartesian2.packArray(m)}));const a=new c.Geometry(o);return h.normal?u.GeometryPipeline.computeNormal(a):a}return p===t.ArcType.GEODESIC?d.PolygonPipeline.computeSubdivision(e,y,f,m,s):p===t.ArcType.RHUMB?d.PolygonPipeline.computeRhumbLineSubdivision(e,y,f,m,s):void 0};const R=[],N=[],O=new o.Cartesian3,q=new o.Cartesian3;g.computeWallGeometry=function(e,n,i,s,u,d){let f,y,m,C,b,x,T,v,w,A=e.length,L=0,E=0;const I=a.defined(n),M=I?n.positions:void 0;if(u)for(y=3*A*2,f=new Array(2*y),I&&(w=2*A*2,v=new Array(2*w)),m=0;m<A;m++)C=e[m],b=e[(m+1)%A],f[L]=f[L+y]=C.x,++L,f[L]=f[L+y]=C.y,++L,f[L]=f[L+y]=C.z,++L,f[L]=f[L+y]=b.x,++L,f[L]=f[L+y]=b.y,++L,f[L]=f[L+y]=b.z,++L,I&&(x=M[m],T=M[(m+1)%A],v[E]=v[E+w]=x.x,++E,v[E]=v[E+w]=x.y,++E,v[E]=v[E+w]=T.x,++E,v[E]=v[E+w]=T.y,++E);else{const n=p.CesiumMath.chordLength(s,i.maximumRadius);let o=0;if(d===t.ArcType.GEODESIC)for(m=0;m<A;m++)o+=g.subdivideLineCount(e[m],e[(m+1)%A],n);else if(d===t.ArcType.RHUMB)for(m=0;m<A;m++)o+=g.subdivideRhumbLineCount(i,e[m],e[(m+1)%A],n);for(y=3*(o+A),f=new Array(2*y),I&&(w=2*(o+A),v=new Array(2*w)),m=0;m<A;m++){let o,r;C=e[m],b=e[(m+1)%A],I&&(x=M[m],T=M[(m+1)%A]),d===t.ArcType.GEODESIC?(o=g.subdivideLine(C,b,n,N),I&&(r=g.subdivideTexcoordLine(x,T,C,b,n,R))):d===t.ArcType.RHUMB&&(o=g.subdivideRhumbLine(i,C,b,n,N),I&&(r=g.subdivideTexcoordRhumbLine(x,T,i,C,b,n,R)));const a=o.length;for(let e=0;e<a;++e,++L)f[L]=o[e],f[L+y]=o[e];if(f[L]=b.x,f[L+y]=b.x,++L,f[L]=b.y,f[L+y]=b.y,++L,f[L]=b.z,f[L+y]=b.z,++L,I){const e=r.length;for(let t=0;t<e;++t,++E)v[E]=r[t],v[E+w]=r[t];v[E]=T.x,v[E+w]=T.x,++E,v[E]=T.y,v[E+w]=T.y,++E}}}A=f.length;const P=h.IndexDatatype.createTypedArray(A/3,A-6*e.length);let D=0;for(A/=6,m=0;m<A;m++){const e=m,t=e+1,n=e+A,i=n+1;C=o.Cartesian3.fromArray(f,3*e,O),b=o.Cartesian3.fromArray(f,3*t,q),o.Cartesian3.equalsEpsilon(C,b,p.CesiumMath.EPSILON10,p.CesiumMath.EPSILON10)||(P[D++]=e,P[D++]=n,P[D++]=t,P[D++]=t,P[D++]=n,P[D++]=i)}const _={attributes:new l.GeometryAttributes({position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:P,primitiveType:c.PrimitiveType.TRIANGLES};I&&(_.attributes.st=new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v}));return new c.Geometry(_)};var k=g;e.PolygonGeometryLibrary=k})); diff --git a/public/lib/Cesium/Workers/PolygonPipeline-3fa47499.js b/public/lib/Cesium/Workers/PolygonPipeline-3fa47499.js new file mode 100644 index 00000000..ceeeb08e --- /dev/null +++ b/public/lib/Cesium/Workers/PolygonPipeline-3fa47499.js @@ -0,0 +1 @@ +define(["exports","./Math-355606c6","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipsoidRhumbLine-1289f7e8","./GeometryAttribute-9c1a6bab","./WebGLConstants-7f557f93"],(function(e,t,n,r,a,i,o,s,u){"use strict";var x={exports:{}};function p(e,t,n){n=n||2;var r,a,i,o,s,u,x,p=t&&t.length,h=p?t[0]*n:e.length,f=l(e,0,h,n,!0),c=[];if(!f||f.next===f.prev)return c;if(p&&(f=function(e,t,n,r){var a,i,o,s=[];for(a=0,i=t.length;a<i;a++)(o=l(e,t[a]*r,a<i-1?t[a+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(A(o));for(s.sort(m),a=0;a<s.length;a++)n=C(s[a],n);return n}(e,t,f,n)),e.length>80*n){r=i=e[0],a=o=e[1];for(var v=n;v<h;v+=n)(s=e[v])<r&&(r=s),(u=e[v+1])<a&&(a=u),s>i&&(i=s),u>o&&(o=u);x=0!==(x=Math.max(i-r,o-a))?32767/x:0}return y(f,c,n,r,a,x,0),c}function l(e,t,n,r,a){var i,o;if(a===B(e,t,n,r)>0)for(i=t;i<n;i+=r)o=G(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=G(i,e[i],e[i+1],o);return o&&E(o,o.next)&&(O(o),o=o.next),o}function h(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!E(r,r.next)&&0!==S(r.prev,r,r.next))r=r.next;else{if(O(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,a,i,o){if(e){!o&&i&&function(e,t,n,r){var a=e;do{0===a.z&&(a.z=w(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,o,s,u,x=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,x*=2}while(o>1)}(a)}(e,r,a,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?c(e,r,a,i):f(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),O(e),e=u.next,x=u.next;else if((e=u)===x){o?1===o?y(e=v(h(e),t,n),t,n,r,a,i,2):2===o&&d(e,t,n,r,a,i):y(h(e),t,n,r,a,i,1);break}}}function f(e){var t=e.prev,n=e,r=e.next;if(S(t,n,r)>=0)return!1;for(var a=t.x,i=n.x,o=r.x,s=t.y,u=n.y,x=r.y,p=a<i?a<o?a:o:i<o?i:o,l=s<u?s<x?s:x:u<x?u:x,h=a>i?a>o?a:o:i>o?i:o,y=s>u?s>x?s:x:u>x?u:x,f=r.next;f!==t;){if(f.x>=p&&f.x<=h&&f.y>=l&&f.y<=y&&b(a,s,i,u,o,x,f.x,f.y)&&S(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function c(e,t,n,r){var a=e.prev,i=e,o=e.next;if(S(a,i,o)>=0)return!1;for(var s=a.x,u=i.x,x=o.x,p=a.y,l=i.y,h=o.y,y=s<u?s<x?s:x:u<x?u:x,f=p<l?p<h?p:h:l<h?l:h,c=s>u?s>x?s:x:u>x?u:x,v=p>l?p>h?p:h:l>h?l:h,d=w(y,f,t,n,r),m=w(c,v,t,n,r),C=e.prevZ,g=e.nextZ;C&&C.z>=d&&g&&g.z<=m;){if(C.x>=y&&C.x<=c&&C.y>=f&&C.y<=v&&C!==a&&C!==o&&b(s,p,u,l,x,h,C.x,C.y)&&S(C.prev,C,C.next)>=0)return!1;if(C=C.prevZ,g.x>=y&&g.x<=c&&g.y>=f&&g.y<=v&&g!==a&&g!==o&&b(s,p,u,l,x,h,g.x,g.y)&&S(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;C&&C.z>=d;){if(C.x>=y&&C.x<=c&&C.y>=f&&C.y<=v&&C!==a&&C!==o&&b(s,p,u,l,x,h,C.x,C.y)&&S(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;g&&g.z<=m;){if(g.x>=y&&g.x<=c&&g.y>=f&&g.y<=v&&g!==a&&g!==o&&b(s,p,u,l,x,h,g.x,g.y)&&S(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function v(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!E(a,i)&&Z(a,r,r.next,i)&&L(a,i)&&L(i,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),O(r),O(r.next),r=e=i),r=r.next}while(r!==e);return h(r)}function d(e,t,n,r,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&M(o,s)){var u=R(o,s);return o=h(o,o.next),u=h(u,u.next),y(o,t,n,r,a,i,0),void y(u,t,n,r,a,i,0)}s=s.next}o=o.next}while(o!==e)}function m(e,t){return e.x-t.x}function C(e,t){var n=function(e,t){var n,r=t,a=e.x,i=e.y,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=a&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===a))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,p=n.x,l=n.y,h=1/0;r=n;do{a>=r.x&&r.x>=p&&a!==r.x&&b(i<l?a:o,i,p,l,i<l?o:a,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(a-r.x),L(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=R(n,e);return h(r,r.next),h(n,n.next)}function g(e,t){return S(e.prev,e,t.prev)<0&&S(t.next,e,e.next)<0}function w(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function A(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function b(e,t,n,r,a,i,o,s){return(a-o)*(t-s)>=(e-o)*(i-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(i-s)>=(a-o)*(r-s)}function M(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Z(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(L(e,t)&&L(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(S(e.prev,e,t.prev)||S(e,t.prev,t))||E(e,t)&&S(e.prev,e,e.next)>0&&S(t.prev,t,t.next)>0)}function S(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function E(e,t){return e.x===t.x&&e.y===t.y}function Z(e,t,n,r){var a=D(S(e,t,n)),i=D(S(e,t,r)),o=D(S(n,r,e)),s=D(S(n,r,t));return a!==i&&o!==s||(!(0!==a||!z(e,n,t))||(!(0!==i||!z(e,r,t))||(!(0!==o||!z(n,e,r))||!(0!==s||!z(n,t,r)))))}function z(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function D(e){return e>0?1:e<0?-1:0}function L(e,t){return S(e.prev,e,e.next)<0?S(e,t,e.next)>=0&&S(e,e.prev,t)>=0:S(e,t,e.prev)<0||S(e,e.next,t)<0}function R(e,t){var n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function G(e,t,n,r){var a=new T(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}x.exports=p,x.exports.default=p,p.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(B(e,0,i,n));if(a)for(var s=0,u=t.length;s<u;s++){var x=t[s]*n,p=s<u-1?t[s+1]*n:e.length;o-=Math.abs(B(e,x,p,n))}var l=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,y=r[s+1]*n,f=r[s+2]*n;l+=Math.abs((e[h]-e[f])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[f+1]-e[h+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},p.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n};var W=x.exports,P=t.getDefaultExportFromCjs(W);const $={CLOCKWISE:u.WebGLConstants.CW,COUNTER_CLOCKWISE:u.WebGLConstants.CCW,validate:function(e){return e===$.CLOCKWISE||e===$.COUNTER_CLOCKWISE}};var I=Object.freeze($);const N=new r.Cartesian3,U=new r.Cartesian3,_={computeArea2D:function(e){const t=e.length;let n=0;for(let r=t-1,a=0;a<t;r=a++){const t=e[r],i=e[a];n+=t.x*i.y-i.x*t.y}return.5*n},computeWindingOrder2D:function(e){return _.computeArea2D(e)>0?I.COUNTER_CLOCKWISE:I.CLOCKWISE},triangulate:function(e,t){const r=n.Cartesian2.packArray(e);return P(r,t,2)}},F=new r.Cartesian3,K=new r.Cartesian3,V=new r.Cartesian3,k=new r.Cartesian3,q=new r.Cartesian3,j=new r.Cartesian3,H=new r.Cartesian3,J=new n.Cartesian2,Q=new n.Cartesian2,X=new n.Cartesian2,Y=new n.Cartesian2;_.computeSubdivision=function(e,o,u,x,p){p=i.defaultValue(p,t.CesiumMath.RADIANS_PER_DEGREE);const l=i.defined(x),h=u.slice(0);let y;const f=o.length,c=new Array(3*f),v=new Array(2*f);let d=0,m=0;for(y=0;y<f;y++){const e=o[y];if(c[d++]=e.x,c[d++]=e.y,c[d++]=e.z,l){const e=x[y];v[m++]=e.x,v[m++]=e.y}}const C=[],g={},w=e.maximumRadius,A=t.CesiumMath.chordLength(p,w),b=A*A;for(;h.length>0;){const e=h.pop(),t=h.pop(),a=h.pop(),o=r.Cartesian3.fromArray(c,3*a,F),s=r.Cartesian3.fromArray(c,3*t,K),u=r.Cartesian3.fromArray(c,3*e,V);let x,p,f;l&&(x=n.Cartesian2.fromArray(v,2*a,J),p=n.Cartesian2.fromArray(v,2*t,Q),f=n.Cartesian2.fromArray(v,2*e,X));const d=r.Cartesian3.multiplyByScalar(r.Cartesian3.normalize(o,k),w,k),m=r.Cartesian3.multiplyByScalar(r.Cartesian3.normalize(s,q),w,q),A=r.Cartesian3.multiplyByScalar(r.Cartesian3.normalize(u,j),w,j),M=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(d,m,H)),S=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(m,A,H)),E=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(A,d,H)),Z=Math.max(M,S,E);let z,D,L;Z>b?M===Z?(z=`${Math.min(a,t)} ${Math.max(a,t)}`,y=g[z],i.defined(y)||(D=r.Cartesian3.add(o,s,H),r.Cartesian3.multiplyByScalar(D,.5,D),c.push(D.x,D.y,D.z),y=c.length/3-1,g[z]=y,l&&(L=n.Cartesian2.add(x,p,Y),n.Cartesian2.multiplyByScalar(L,.5,L),v.push(L.x,L.y))),h.push(a,y,e),h.push(y,t,e)):S===Z?(z=`${Math.min(t,e)} ${Math.max(t,e)}`,y=g[z],i.defined(y)||(D=r.Cartesian3.add(s,u,H),r.Cartesian3.multiplyByScalar(D,.5,D),c.push(D.x,D.y,D.z),y=c.length/3-1,g[z]=y,l&&(L=n.Cartesian2.add(p,f,Y),n.Cartesian2.multiplyByScalar(L,.5,L),v.push(L.x,L.y))),h.push(t,y,a),h.push(y,e,a)):E===Z&&(z=`${Math.min(e,a)} ${Math.max(e,a)}`,y=g[z],i.defined(y)||(D=r.Cartesian3.add(u,o,H),r.Cartesian3.multiplyByScalar(D,.5,D),c.push(D.x,D.y,D.z),y=c.length/3-1,g[z]=y,l&&(L=n.Cartesian2.add(f,x,Y),n.Cartesian2.multiplyByScalar(L,.5,L),v.push(L.x,L.y))),h.push(e,y,t),h.push(y,a,t)):(C.push(a),C.push(t),C.push(e))}const M={attributes:{position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})},indices:C,primitiveType:s.PrimitiveType.TRIANGLES};return l&&(M.attributes.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v})),new s.Geometry(M)};const ee=new r.Cartographic,te=new r.Cartographic,ne=new r.Cartographic,re=new r.Cartographic;_.computeRhumbLineSubdivision=function(e,u,x,p,l){l=i.defaultValue(l,t.CesiumMath.RADIANS_PER_DEGREE);const h=i.defined(p),y=x.slice(0);let f;const c=u.length,v=new Array(3*c),d=new Array(2*c);let m=0,C=0;for(f=0;f<c;f++){const e=u[f];if(v[m++]=e.x,v[m++]=e.y,v[m++]=e.z,h){const e=p[f];d[C++]=e.x,d[C++]=e.y}}const g=[],w={},A=e.maximumRadius,b=t.CesiumMath.chordLength(l,A),M=new o.EllipsoidRhumbLine(void 0,void 0,e),S=new o.EllipsoidRhumbLine(void 0,void 0,e),E=new o.EllipsoidRhumbLine(void 0,void 0,e);for(;y.length>0;){const t=y.pop(),a=y.pop(),o=y.pop(),s=r.Cartesian3.fromArray(v,3*o,F),u=r.Cartesian3.fromArray(v,3*a,K),x=r.Cartesian3.fromArray(v,3*t,V);let p,l,c;h&&(p=n.Cartesian2.fromArray(d,2*o,J),l=n.Cartesian2.fromArray(d,2*a,Q),c=n.Cartesian2.fromArray(d,2*t,X));const m=e.cartesianToCartographic(s,ee),C=e.cartesianToCartographic(u,te),A=e.cartesianToCartographic(x,ne);M.setEndPoints(m,C);const Z=M.surfaceDistance;S.setEndPoints(C,A);const z=S.surfaceDistance;E.setEndPoints(A,m);const D=E.surfaceDistance,L=Math.max(Z,z,D);let R,G,O,T,B;L>b?Z===L?(R=`${Math.min(o,a)} ${Math.max(o,a)}`,f=w[R],i.defined(f)||(G=M.interpolateUsingFraction(.5,re),O=.5*(m.height+C.height),T=r.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,H),v.push(T.x,T.y,T.z),f=v.length/3-1,w[R]=f,h&&(B=n.Cartesian2.add(p,l,Y),n.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(o,f,t),y.push(f,a,t)):z===L?(R=`${Math.min(a,t)} ${Math.max(a,t)}`,f=w[R],i.defined(f)||(G=S.interpolateUsingFraction(.5,re),O=.5*(C.height+A.height),T=r.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,H),v.push(T.x,T.y,T.z),f=v.length/3-1,w[R]=f,h&&(B=n.Cartesian2.add(l,c,Y),n.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(a,f,o),y.push(f,t,o)):D===L&&(R=`${Math.min(t,o)} ${Math.max(t,o)}`,f=w[R],i.defined(f)||(G=E.interpolateUsingFraction(.5,re),O=.5*(A.height+m.height),T=r.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,H),v.push(T.x,T.y,T.z),f=v.length/3-1,w[R]=f,h&&(B=n.Cartesian2.add(c,p,Y),n.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(t,f,a),y.push(f,o,a)):(g.push(o),g.push(a),g.push(t))}const Z={attributes:{position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v})},indices:g,primitiveType:s.PrimitiveType.TRIANGLES};return h&&(Z.attributes.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),new s.Geometry(Z)},_.scaleToGeodeticHeight=function(e,t,n,a){n=i.defaultValue(n,r.Ellipsoid.WGS84);let o=N,s=U;if(t=i.defaultValue(t,0),a=i.defaultValue(a,!0),i.defined(e)){const i=e.length;for(let u=0;u<i;u+=3)r.Cartesian3.fromArray(e,u,s),a&&(s=n.scaleToGeodeticSurface(s,s)),0!==t&&(o=n.geodeticSurfaceNormal(s,o),r.Cartesian3.multiplyByScalar(o,t,o),r.Cartesian3.add(s,o,s)),e[u]=s.x,e[u+1]=s.y,e[u+2]=s.z}return e};var ae=_;e.PolygonPipeline=ae,e.WindingOrder=I})); diff --git a/public/lib/Cesium/Workers/PolygonPipeline-87656bae.js b/public/lib/Cesium/Workers/PolygonPipeline-87656bae.js deleted file mode 100644 index c81d7163..00000000 --- a/public/lib/Cesium/Workers/PolygonPipeline-87656bae.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./EllipsoidRhumbLine-77eff028","./GeometryAttribute-12713b29","./Math-2ce22ee9","./WebGLConstants-7f557f93"],(function(e,t,n,r,a,i,o,s,u){"use strict";var x={};function p(e,t,n){n=n||2;var r,a,i,o,s,u,x,p=t&&t.length,h=p?t[0]*n:e.length,c=l(e,0,h,n,!0),f=[];if(!c||c.next===c.prev)return f;if(p&&(c=function(e,t,n,r){var a,i,o,s=[];for(a=0,i=t.length;a<i;a++)(o=l(e,t[a]*r,a<i-1?t[a+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(A(o));for(s.sort(m),a=0;a<s.length;a++)n=C(s[a],n);return n}(e,t,c,n)),e.length>80*n){r=i=e[0],a=o=e[1];for(var v=n;v<h;v+=n)(s=e[v])<r&&(r=s),(u=e[v+1])<a&&(a=u),s>i&&(i=s),u>o&&(o=u);x=0!==(x=Math.max(i-r,o-a))?32767/x:0}return y(c,f,n,r,a,x,0),f}function l(e,t,n,r,a){var i,o;if(a===B(e,t,n,r)>0)for(i=t;i<n;i+=r)o=G(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=G(i,e[i],e[i+1],o);return o&&E(o,o.next)&&(O(o),o=o.next),o}function h(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!E(r,r.next)&&0!==S(r.prev,r,r.next))r=r.next;else{if(O(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,a,i,o){if(e){!o&&i&&function(e,t,n,r){var a=e;do{0===a.z&&(a.z=w(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,o,s,u,x=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,x*=2}while(o>1)}(a)}(e,r,a,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?f(e,r,a,i):c(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),O(e),e=u.next,x=u.next;else if((e=u)===x){o?1===o?y(e=v(h(e),t,n),t,n,r,a,i,2):2===o&&d(e,t,n,r,a,i):y(h(e),t,n,r,a,i,1);break}}}function c(e){var t=e.prev,n=e,r=e.next;if(S(t,n,r)>=0)return!1;for(var a=t.x,i=n.x,o=r.x,s=t.y,u=n.y,x=r.y,p=a<i?a<o?a:o:i<o?i:o,l=s<u?s<x?s:x:u<x?u:x,h=a>i?a>o?a:o:i>o?i:o,y=s>u?s>x?s:x:u>x?u:x,c=r.next;c!==t;){if(c.x>=p&&c.x<=h&&c.y>=l&&c.y<=y&&b(a,s,i,u,o,x,c.x,c.y)&&S(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function f(e,t,n,r){var a=e.prev,i=e,o=e.next;if(S(a,i,o)>=0)return!1;for(var s=a.x,u=i.x,x=o.x,p=a.y,l=i.y,h=o.y,y=s<u?s<x?s:x:u<x?u:x,c=p<l?p<h?p:h:l<h?l:h,f=s>u?s>x?s:x:u>x?u:x,v=p>l?p>h?p:h:l>h?l:h,d=w(y,c,t,n,r),m=w(f,v,t,n,r),C=e.prevZ,g=e.nextZ;C&&C.z>=d&&g&&g.z<=m;){if(C.x>=y&&C.x<=f&&C.y>=c&&C.y<=v&&C!==a&&C!==o&&b(s,p,u,l,x,h,C.x,C.y)&&S(C.prev,C,C.next)>=0)return!1;if(C=C.prevZ,g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&b(s,p,u,l,x,h,g.x,g.y)&&S(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;C&&C.z>=d;){if(C.x>=y&&C.x<=f&&C.y>=c&&C.y<=v&&C!==a&&C!==o&&b(s,p,u,l,x,h,C.x,C.y)&&S(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;g&&g.z<=m;){if(g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&b(s,p,u,l,x,h,g.x,g.y)&&S(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function v(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!E(a,i)&&Z(a,r,r.next,i)&&D(a,i)&&D(i,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),O(r),O(r.next),r=e=i),r=r.next}while(r!==e);return h(r)}function d(e,t,n,r,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&M(o,s)){var u=R(o,s);return o=h(o,o.next),u=h(u,u.next),y(o,t,n,r,a,i,0),void y(u,t,n,r,a,i,0)}s=s.next}o=o.next}while(o!==e)}function m(e,t){return e.x-t.x}function C(e,t){var n=function(e,t){var n,r=t,a=e.x,i=e.y,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=a&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===a))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,p=n.x,l=n.y,h=1/0;r=n;do{a>=r.x&&r.x>=p&&a!==r.x&&b(i<l?a:o,i,p,l,i<l?o:a,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(a-r.x),D(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=R(n,e);return h(r,r.next),h(n,n.next)}function g(e,t){return S(e.prev,e,t.prev)<0&&S(t.next,e,e.next)<0}function w(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function A(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function b(e,t,n,r,a,i,o,s){return(a-o)*(t-s)>=(e-o)*(i-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(i-s)>=(a-o)*(r-s)}function M(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Z(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(D(e,t)&&D(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(S(e.prev,e,t.prev)||S(e,t.prev,t))||E(e,t)&&S(e.prev,e,e.next)>0&&S(t.prev,t,t.next)>0)}function S(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function E(e,t){return e.x===t.x&&e.y===t.y}function Z(e,t,n,r){var a=L(S(e,t,n)),i=L(S(e,t,r)),o=L(S(n,r,e)),s=L(S(n,r,t));return a!==i&&o!==s||(!(0!==a||!z(e,n,t))||(!(0!==i||!z(e,r,t))||(!(0!==o||!z(n,e,r))||!(0!==s||!z(n,t,r)))))}function z(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function L(e){return e>0?1:e<0?-1:0}function D(e,t){return S(e.prev,e,e.next)<0?S(e,t,e.next)>=0&&S(e,e.prev,t)>=0:S(e,t,e.prev)<0||S(e,e.next,t)<0}function R(e,t){var n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function G(e,t,n,r){var a=new T(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}({get exports(){return x},set exports(e){x=e}}).exports=p,x.default=p,p.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(B(e,0,i,n));if(a)for(var s=0,u=t.length;s<u;s++){var x=t[s]*n,p=s<u-1?t[s+1]*n:e.length;o-=Math.abs(B(e,x,p,n))}var l=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,y=r[s+1]*n,c=r[s+2]*n;l+=Math.abs((e[h]-e[c])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[c+1]-e[h+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},p.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n};const W={CLOCKWISE:u.WebGLConstants.CW,COUNTER_CLOCKWISE:u.WebGLConstants.CCW,validate:function(e){return e===W.CLOCKWISE||e===W.COUNTER_CLOCKWISE}};var P=Object.freeze(W);const $=new n.Cartesian3,I=new n.Cartesian3,N={computeArea2D:function(e){const t=e.length;let n=0;for(let r=t-1,a=0;a<t;r=a++){const t=e[r],i=e[a];n+=t.x*i.y-i.x*t.y}return.5*n},computeWindingOrder2D:function(e){return N.computeArea2D(e)>0?P.COUNTER_CLOCKWISE:P.CLOCKWISE},triangulate:function(e,n){const r=t.Cartesian2.packArray(e);return x(r,n,2)}},U=new n.Cartesian3,_=new n.Cartesian3,K=new n.Cartesian3,V=new n.Cartesian3,F=new n.Cartesian3,k=new n.Cartesian3,q=new n.Cartesian3,j=new t.Cartesian2,H=new t.Cartesian2,J=new t.Cartesian2,Q=new t.Cartesian2;N.computeSubdivision=function(e,i,u,x,p){p=a.defaultValue(p,s.CesiumMath.RADIANS_PER_DEGREE);const l=a.defined(x),h=u.slice(0);let y;const c=i.length,f=new Array(3*c),v=new Array(2*c);let d=0,m=0;for(y=0;y<c;y++){const e=i[y];if(f[d++]=e.x,f[d++]=e.y,f[d++]=e.z,l){const e=x[y];v[m++]=e.x,v[m++]=e.y}}const C=[],g={},w=e.maximumRadius,A=s.CesiumMath.chordLength(p,w),b=A*A;for(;h.length>0;){const e=h.pop(),r=h.pop(),i=h.pop(),o=n.Cartesian3.fromArray(f,3*i,U),s=n.Cartesian3.fromArray(f,3*r,_),u=n.Cartesian3.fromArray(f,3*e,K);let x,p,c;l&&(x=t.Cartesian2.fromArray(v,2*i,j),p=t.Cartesian2.fromArray(v,2*r,H),c=t.Cartesian2.fromArray(v,2*e,J));const d=n.Cartesian3.multiplyByScalar(n.Cartesian3.normalize(o,V),w,V),m=n.Cartesian3.multiplyByScalar(n.Cartesian3.normalize(s,F),w,F),A=n.Cartesian3.multiplyByScalar(n.Cartesian3.normalize(u,k),w,k),M=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,m,q)),S=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(m,A,q)),E=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(A,d,q)),Z=Math.max(M,S,E);let z,L,D;Z>b?M===Z?(z=`${Math.min(i,r)} ${Math.max(i,r)}`,y=g[z],a.defined(y)||(L=n.Cartesian3.add(o,s,q),n.Cartesian3.multiplyByScalar(L,.5,L),f.push(L.x,L.y,L.z),y=f.length/3-1,g[z]=y,l&&(D=t.Cartesian2.add(x,p,Q),t.Cartesian2.multiplyByScalar(D,.5,D),v.push(D.x,D.y))),h.push(i,y,e),h.push(y,r,e)):S===Z?(z=`${Math.min(r,e)} ${Math.max(r,e)}`,y=g[z],a.defined(y)||(L=n.Cartesian3.add(s,u,q),n.Cartesian3.multiplyByScalar(L,.5,L),f.push(L.x,L.y,L.z),y=f.length/3-1,g[z]=y,l&&(D=t.Cartesian2.add(p,c,Q),t.Cartesian2.multiplyByScalar(D,.5,D),v.push(D.x,D.y))),h.push(r,y,i),h.push(y,e,i)):E===Z&&(z=`${Math.min(e,i)} ${Math.max(e,i)}`,y=g[z],a.defined(y)||(L=n.Cartesian3.add(u,o,q),n.Cartesian3.multiplyByScalar(L,.5,L),f.push(L.x,L.y,L.z),y=f.length/3-1,g[z]=y,l&&(D=t.Cartesian2.add(c,x,Q),t.Cartesian2.multiplyByScalar(D,.5,D),v.push(D.x,D.y))),h.push(e,y,r),h.push(y,i,r)):(C.push(i),C.push(r),C.push(e))}const M={attributes:{position:new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})},indices:C,primitiveType:o.PrimitiveType.TRIANGLES};return l&&(M.attributes.st=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v})),new o.Geometry(M)};const X=new n.Cartographic,Y=new n.Cartographic,ee=new n.Cartographic,te=new n.Cartographic;N.computeRhumbLineSubdivision=function(e,u,x,p,l){l=a.defaultValue(l,s.CesiumMath.RADIANS_PER_DEGREE);const h=a.defined(p),y=x.slice(0);let c;const f=u.length,v=new Array(3*f),d=new Array(2*f);let m=0,C=0;for(c=0;c<f;c++){const e=u[c];if(v[m++]=e.x,v[m++]=e.y,v[m++]=e.z,h){const e=p[c];d[C++]=e.x,d[C++]=e.y}}const g=[],w={},A=e.maximumRadius,b=s.CesiumMath.chordLength(l,A),M=new i.EllipsoidRhumbLine(void 0,void 0,e),S=new i.EllipsoidRhumbLine(void 0,void 0,e),E=new i.EllipsoidRhumbLine(void 0,void 0,e);for(;y.length>0;){const r=y.pop(),i=y.pop(),o=y.pop(),s=n.Cartesian3.fromArray(v,3*o,U),u=n.Cartesian3.fromArray(v,3*i,_),x=n.Cartesian3.fromArray(v,3*r,K);let p,l,f;h&&(p=t.Cartesian2.fromArray(d,2*o,j),l=t.Cartesian2.fromArray(d,2*i,H),f=t.Cartesian2.fromArray(d,2*r,J));const m=e.cartesianToCartographic(s,X),C=e.cartesianToCartographic(u,Y),A=e.cartesianToCartographic(x,ee);M.setEndPoints(m,C);const Z=M.surfaceDistance;S.setEndPoints(C,A);const z=S.surfaceDistance;E.setEndPoints(A,m);const L=E.surfaceDistance,D=Math.max(Z,z,L);let R,G,O,T,B;D>b?Z===D?(R=`${Math.min(o,i)} ${Math.max(o,i)}`,c=w[R],a.defined(c)||(G=M.interpolateUsingFraction(.5,te),O=.5*(m.height+C.height),T=n.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,q),v.push(T.x,T.y,T.z),c=v.length/3-1,w[R]=c,h&&(B=t.Cartesian2.add(p,l,Q),t.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(o,c,r),y.push(c,i,r)):z===D?(R=`${Math.min(i,r)} ${Math.max(i,r)}`,c=w[R],a.defined(c)||(G=S.interpolateUsingFraction(.5,te),O=.5*(C.height+A.height),T=n.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,q),v.push(T.x,T.y,T.z),c=v.length/3-1,w[R]=c,h&&(B=t.Cartesian2.add(l,f,Q),t.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(i,c,o),y.push(c,r,o)):L===D&&(R=`${Math.min(r,o)} ${Math.max(r,o)}`,c=w[R],a.defined(c)||(G=E.interpolateUsingFraction(.5,te),O=.5*(A.height+m.height),T=n.Cartesian3.fromRadians(G.longitude,G.latitude,O,e,q),v.push(T.x,T.y,T.z),c=v.length/3-1,w[R]=c,h&&(B=t.Cartesian2.add(f,p,Q),t.Cartesian2.multiplyByScalar(B,.5,B),d.push(B.x,B.y))),y.push(r,c,i),y.push(c,o,i)):(g.push(o),g.push(i),g.push(r))}const Z={attributes:{position:new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v})},indices:g,primitiveType:o.PrimitiveType.TRIANGLES};return h&&(Z.attributes.st=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),new o.Geometry(Z)},N.scaleToGeodeticHeight=function(e,t,r,i){r=a.defaultValue(r,n.Ellipsoid.WGS84);let o=$,s=I;if(t=a.defaultValue(t,0),i=a.defaultValue(i,!0),a.defined(e)){const a=e.length;for(let u=0;u<a;u+=3)n.Cartesian3.fromArray(e,u,s),i&&(s=r.scaleToGeodeticSurface(s,s)),0!==t&&(o=r.geodeticSurfaceNormal(s,o),n.Cartesian3.multiplyByScalar(o,t,o),n.Cartesian3.add(s,o,s)),e[u]=s.x,e[u+1]=s.y,e[u+2]=s.z}return e};var ne=N;e.PolygonPipeline=ne,e.WindingOrder=P})); diff --git a/public/lib/Cesium/Workers/PolylinePipeline-bcbea07f.js b/public/lib/Cesium/Workers/PolylinePipeline-8df321dd.js similarity index 95% rename from public/lib/Cesium/Workers/PolylinePipeline-bcbea07f.js rename to public/lib/Cesium/Workers/PolylinePipeline-8df321dd.js index bdc96b0c..8afc3305 100644 --- a/public/lib/Cesium/Workers/PolylinePipeline-bcbea07f.js +++ b/public/lib/Cesium/Workers/PolylinePipeline-8df321dd.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./IntersectionTests-56142431","./Math-2ce22ee9","./Matrix2-413c4048","./Plane-6add0ae1"],(function(e,t,a,n,i,r,o,s,c){"use strict";const l={numberOfPoints:function(e,a,n){const i=t.Cartesian3.distance(e,a);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,a){const n=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(a*a))))}},u=new t.Cartographic;l.extractHeights=function(e,t){const a=e.length,n=new Array(a);for(let i=0;i<a;i++){const a=e[i];n[i]=t.cartesianToCartographic(a,u).height}return n};const h=new s.Matrix4,f=new t.Cartesian3,g=new t.Cartesian3,C=new c.Plane(t.Cartesian3.UNIT_X,0),p=new t.Cartesian3,d=new c.Plane(t.Cartesian3.UNIT_X,0),m=new t.Cartesian3,w=new t.Cartesian3,P=[];function T(e,t,a){const n=P;let i;if(n.length=e,t===a){for(i=0;i<e;i++)n[i]=t;return n}const r=(a-t)/e;for(i=0;i<e;i++){const e=t+i*r;n[i]=e}return n}const y=new t.Cartographic,A=new t.Cartographic,E=new t.Cartesian3,M=new t.Cartesian3,R=new t.Cartesian3,S=new n.EllipsoidGeodesic;let b=new i.EllipsoidRhumbLine;function x(e,a,n,i,r,o,s,c){const u=i.scaleToGeodeticSurface(e,M),h=i.scaleToGeodeticSurface(a,R),f=l.numberOfPoints(e,a,n),g=i.cartesianToCartographic(u,y),C=i.cartesianToCartographic(h,A),p=T(f,r,o);S.setEndPoints(g,C);const d=S.surfaceDistance/f;let m=c;g.height=r;let w=i.cartographicToCartesian(g,E);t.Cartesian3.pack(w,s,m),m+=3;for(let e=1;e<f;e++){const a=S.interpolateUsingSurfaceDistance(e*d,A);a.height=p[e],w=i.cartographicToCartesian(a,E),t.Cartesian3.pack(w,s,m),m+=3}return m}function D(e,a,n,r,o,s,c,u){const h=r.cartesianToCartographic(e,y),f=r.cartesianToCartographic(a,A),g=l.numberOfPointsRhumbLine(h,f,n);h.height=0,f.height=0;const C=T(g,o,s);b.ellipsoid.equals(r)||(b=new i.EllipsoidRhumbLine(void 0,void 0,r)),b.setEndPoints(h,f);const p=b.surfaceDistance/g;let d=u;h.height=o;let m=r.cartographicToCartesian(h,E);t.Cartesian3.pack(m,c,d),d+=3;for(let e=1;e<g;e++){const a=b.interpolateUsingSurfaceDistance(e*p,A);a.height=C[e],m=r.cartographicToCartesian(a,E),t.Cartesian3.pack(m,c,d),d+=3}return d}l.wrapLongitude=function(e,n){const i=[],o=[];if(a.defined(e)&&e.length>0){n=a.defaultValue(n,s.Matrix4.IDENTITY);const l=s.Matrix4.inverseTransformation(n,h),u=s.Matrix4.multiplyByPoint(l,t.Cartesian3.ZERO,f),P=t.Cartesian3.normalize(s.Matrix4.multiplyByPointAsVector(l,t.Cartesian3.UNIT_Y,g),g),T=c.Plane.fromPointNormal(u,P,C),y=t.Cartesian3.normalize(s.Matrix4.multiplyByPointAsVector(l,t.Cartesian3.UNIT_X,p),p),A=c.Plane.fromPointNormal(u,y,d);let E=1;i.push(t.Cartesian3.clone(e[0]));let M=i[0];const R=e.length;for(let n=1;n<R;++n){const s=e[n];if(c.Plane.getPointDistance(A,M)<0||c.Plane.getPointDistance(A,s)<0){const e=r.IntersectionTests.lineSegmentPlane(M,s,T,m);if(a.defined(e)){const a=t.Cartesian3.multiplyByScalar(P,5e-9,w);c.Plane.getPointDistance(T,M)<0&&t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),o.push(E+1),t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),E=1}}i.push(t.Cartesian3.clone(e[n])),E++,M=s}o.push(E)}return{positions:i,lengths:o}},l.generateArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const c=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],M);if(s=c?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}let u=e.minDistance;if(!a.defined(u)){const t=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);u=o.CesiumMath.chordLength(t,r.maximumRadius)}let h,f=0;for(h=0;h<i-1;h++)f+=l.numberOfPoints(n[h],n[h+1],u);const g=3*(f+1),C=new Array(g);let p=0;for(h=0;h<i-1;h++){p=x(n[h],n[h+1],u,r,c?s[h]:s,c?s[h+1]:s,C,p)}P.length=0;const d=n[i-1],m=r.cartesianToCartographic(d,y);m.height=c?s[i-1]:s;const w=r.cartographicToCartesian(m,E);return t.Cartesian3.pack(w,C,g-3),C};const N=new t.Cartographic,G=new t.Cartographic;l.generateRhumbArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const c=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],M);if(s=c?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}const u=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);let h,f,g=0,C=r.cartesianToCartographic(n[0],N);for(h=0;h<i-1;h++)f=r.cartesianToCartographic(n[h+1],G),g+=l.numberOfPointsRhumbLine(C,f,u),C=t.Cartographic.clone(f,N);const p=3*(g+1),d=new Array(p);let m=0;for(h=0;h<i-1;h++){m=D(n[h],n[h+1],u,r,c?s[h]:s,c?s[h+1]:s,d,m)}P.length=0;const w=n[i-1],T=r.cartesianToCartographic(w,y);T.height=c?s[i-1]:s;const A=r.cartographicToCartesian(T,E);return t.Cartesian3.pack(A,d,p-3),d},l.generateCartesianArc=function(e){const a=l.generateArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},l.generateCartesianRhumbArc=function(e){const a=l.generateRhumbArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i};var I=l;e.PolylinePipeline=I})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./IntersectionTests-f1b36d69","./Math-355606c6","./Matrix2-7a8e9daf","./Plane-5931b53e"],(function(e,t,a,n,i,r,o,s,c){"use strict";const l={numberOfPoints:function(e,a,n){const i=t.Cartesian3.distance(e,a);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,a){const n=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(a*a))))}},u=new t.Cartographic;l.extractHeights=function(e,t){const a=e.length,n=new Array(a);for(let i=0;i<a;i++){const a=e[i];n[i]=t.cartesianToCartographic(a,u).height}return n};const h=new s.Matrix4,f=new t.Cartesian3,g=new t.Cartesian3,C=new c.Plane(t.Cartesian3.UNIT_X,0),p=new t.Cartesian3,d=new c.Plane(t.Cartesian3.UNIT_X,0),m=new t.Cartesian3,w=new t.Cartesian3,P=[];function T(e,t,a){const n=P;let i;if(n.length=e,t===a){for(i=0;i<e;i++)n[i]=t;return n}const r=(a-t)/e;for(i=0;i<e;i++){const e=t+i*r;n[i]=e}return n}const y=new t.Cartographic,A=new t.Cartographic,E=new t.Cartesian3,M=new t.Cartesian3,R=new t.Cartesian3,S=new n.EllipsoidGeodesic;let b=new i.EllipsoidRhumbLine;function x(e,a,n,i,r,o,s,c){const u=i.scaleToGeodeticSurface(e,M),h=i.scaleToGeodeticSurface(a,R),f=l.numberOfPoints(e,a,n),g=i.cartesianToCartographic(u,y),C=i.cartesianToCartographic(h,A),p=T(f,r,o);S.setEndPoints(g,C);const d=S.surfaceDistance/f;let m=c;g.height=r;let w=i.cartographicToCartesian(g,E);t.Cartesian3.pack(w,s,m),m+=3;for(let e=1;e<f;e++){const a=S.interpolateUsingSurfaceDistance(e*d,A);a.height=p[e],w=i.cartographicToCartesian(a,E),t.Cartesian3.pack(w,s,m),m+=3}return m}function D(e,a,n,r,o,s,c,u){const h=r.cartesianToCartographic(e,y),f=r.cartesianToCartographic(a,A),g=l.numberOfPointsRhumbLine(h,f,n);h.height=0,f.height=0;const C=T(g,o,s);b.ellipsoid.equals(r)||(b=new i.EllipsoidRhumbLine(void 0,void 0,r)),b.setEndPoints(h,f);const p=b.surfaceDistance/g;let d=u;h.height=o;let m=r.cartographicToCartesian(h,E);t.Cartesian3.pack(m,c,d),d+=3;for(let e=1;e<g;e++){const a=b.interpolateUsingSurfaceDistance(e*p,A);a.height=C[e],m=r.cartographicToCartesian(a,E),t.Cartesian3.pack(m,c,d),d+=3}return d}l.wrapLongitude=function(e,n){const i=[],o=[];if(a.defined(e)&&e.length>0){n=a.defaultValue(n,s.Matrix4.IDENTITY);const l=s.Matrix4.inverseTransformation(n,h),u=s.Matrix4.multiplyByPoint(l,t.Cartesian3.ZERO,f),P=t.Cartesian3.normalize(s.Matrix4.multiplyByPointAsVector(l,t.Cartesian3.UNIT_Y,g),g),T=c.Plane.fromPointNormal(u,P,C),y=t.Cartesian3.normalize(s.Matrix4.multiplyByPointAsVector(l,t.Cartesian3.UNIT_X,p),p),A=c.Plane.fromPointNormal(u,y,d);let E=1;i.push(t.Cartesian3.clone(e[0]));let M=i[0];const R=e.length;for(let n=1;n<R;++n){const s=e[n];if(c.Plane.getPointDistance(A,M)<0||c.Plane.getPointDistance(A,s)<0){const e=r.IntersectionTests.lineSegmentPlane(M,s,T,m);if(a.defined(e)){const a=t.Cartesian3.multiplyByScalar(P,5e-9,w);c.Plane.getPointDistance(T,M)<0&&t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),o.push(E+1),t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),E=1}}i.push(t.Cartesian3.clone(e[n])),E++,M=s}o.push(E)}return{positions:i,lengths:o}},l.generateArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const c=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],M);if(s=c?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}let u=e.minDistance;if(!a.defined(u)){const t=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);u=o.CesiumMath.chordLength(t,r.maximumRadius)}let h,f=0;for(h=0;h<i-1;h++)f+=l.numberOfPoints(n[h],n[h+1],u);const g=3*(f+1),C=new Array(g);let p=0;for(h=0;h<i-1;h++){p=x(n[h],n[h+1],u,r,c?s[h]:s,c?s[h+1]:s,C,p)}P.length=0;const d=n[i-1],m=r.cartesianToCartographic(d,y);m.height=c?s[i-1]:s;const w=r.cartographicToCartesian(m,E);return t.Cartesian3.pack(w,C,g-3),C};const N=new t.Cartographic,G=new t.Cartographic;l.generateRhumbArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const c=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],M);if(s=c?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}const u=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);let h,f,g=0,C=r.cartesianToCartographic(n[0],N);for(h=0;h<i-1;h++)f=r.cartesianToCartographic(n[h+1],G),g+=l.numberOfPointsRhumbLine(C,f,u),C=t.Cartographic.clone(f,N);const p=3*(g+1),d=new Array(p);let m=0;for(h=0;h<i-1;h++){m=D(n[h],n[h+1],u,r,c?s[h]:s,c?s[h+1]:s,d,m)}P.length=0;const w=n[i-1],T=r.cartesianToCartographic(w,y);T.height=c?s[i-1]:s;const A=r.cartographicToCartesian(T,E);return t.Cartesian3.pack(A,d,p-3),d},l.generateCartesianArc=function(e){const a=l.generateArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},l.generateCartesianRhumbArc=function(e){const a=l.generateRhumbArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i};var I=l;e.PolylinePipeline=I})); diff --git a/public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-01e8948c.js b/public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-5050cb1d.js similarity index 97% rename from public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-01e8948c.js rename to public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-5050cb1d.js index 158e8151..2d70ef55 100644 --- a/public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-01e8948c.js +++ b/public/lib/Cesium/Workers/PolylineVolumeGeometryLibrary-5050cb1d.js @@ -1 +1 @@ -define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./EllipsoidTangentPlane-cf43ca0f","./Math-2ce22ee9","./PolylinePipeline-bcbea07f","./Transforms-b3716b06","./defaultValue-f6d5e6da"],(function(e,a,t,n,r,i,s,o){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new t.Cartesian3,new t.Cartesian3],d=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,f=new t.Cartesian3,p=new t.Cartesian3,w=new t.Cartesian3,x=new t.Cartesian3,E=new t.Cartesian3,P=new t.Cartesian3,M={};let T=new t.Cartographic;function b(e,a,n,r){const i=e[0],s=e[1],o=t.Cartesian3.angleBetween(i,s),l=Math.ceil(o/r),c=new Array(l);let C;if(a===n){for(C=0;C<l;C++)c[C]=a;return c.push(n),c}const u=(n-a)/l;for(C=1;C<l;C++){const e=a+C*u;c[C]=e}return c[0]=a,c.push(n),c}const B=new t.Cartesian3,z=new t.Cartesian3;const S=new t.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new t.Matrix3;const O=t.Matrix3.IDENTITY.clone(),V=new t.Cartesian3,I=new a.Cartesian4,v=new t.Cartesian3;function N(e,r,i,o,l,c,C,u){let d=V,g=I;A=s.Transforms.eastNorthUpToFixedFrame(e,l,A),d=a.Matrix4.multiplyByPointAsVector(A,S,d),d=t.Cartesian3.normalize(d,d);const y=function(e,r,i,s){const o=new n.EllipsoidTangentPlane(i,s),l=o.projectPointOntoPlane(t.Cartesian3.add(i,e,B),B),c=o.projectPointOntoPlane(t.Cartesian3.add(i,r,z),z),C=a.Cartesian2.angleBetween(l,c);return c.x*l.y-c.y*l.x>=0?-C:C}(d,r,e,l);R=t.Matrix3.fromRotationZ(y,R),v.z=c,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,v,D),A);const h=O;h[0]=C;for(let e=0;e<u;e++)for(let e=0;e<i.length;e+=3)g=t.Cartesian3.fromArray(i,e,g),g=t.Matrix3.multiplyByVector(h,g,g),g=a.Matrix4.multiplyByPoint(A,g,g),o.push(g.x,g.y,g.z);return o}const G=new t.Cartesian3;function H(e,a,n,r,i,s,o){for(let l=0;l<e.length;l+=3){r=N(t.Cartesian3.fromArray(e,l,G),a,n,r,i,s[l/3],o,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-s;return n}const j=new s.Quaternion,Q=new t.Cartesian3,q=new t.Matrix3;function F(e,a,n,i,o,c,C,u,d,g){const y=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,E),t.Cartesian3.subtract(n,e,P)),h=i===l.BEVELED?0:Math.ceil(y/r.CesiumMath.toRadians(5));let m,f,p;if(m=o?t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,E),y/(h+1),j),q):t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e,y/(h+1),j),q),a=t.Cartesian3.clone(a,Q),h>0){const n=g?2:1;for(let r=0;r<h;r++)a=t.Matrix3.multiplyByVector(m,a,a),f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,n)}else f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,1),n=t.Cartesian3.clone(n,Q),f=t.Cartesian3.subtract(n,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(n,P),C=N(p,f,u,C,c,d,1,1);return C}M.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],s=e[i];a.Cartesian2.equals(t,s)||n.push(s)}return n},M.angleIsGreaterThanPi=function(e,a,r,i){const s=new n.EllipsoidTangentPlane(r,i),o=s.projectPointOntoPlane(t.Cartesian3.add(r,e,B),B),l=s.projectPointOntoPlane(t.Cartesian3.add(r,a,z),z);return l.x*o.y-l.y*o.x>=0};const U=new t.Cartesian3,_=new t.Cartesian3;M.computePositions=function(e,a,n,s,o){const c=s._ellipsoid,P=function(e,a){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];T=a.cartesianToCartographic(r,T),t[n]=T.height,e[n]=a.scaleToGeodeticSurface(r,r)}return t}(e,c),B=s._granularity,z=s._cornerType,S=o?function(e,a){const t=e.length,n=new Array(6*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;let o=e[0];n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s;for(let a=1;a<t;a++){o=e[a];const t=o.x-i,l=o.y-s;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}return o=e[0],n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s,n}(a,n):L(a,n),A=o?L(a,n):void 0,D=n.height/2,R=n.width/2;let O=e.length,V=[],I=o?[]:void 0,v=d,G=g,j=y,Q=h,q=m,Z=f,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),v=t.Cartesian3.subtract(K,J,v),v=t.Cartesian3.normalize(v,v),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y);let X,$,ee=P[0],ae=P[1];o&&(I=N(J,Y,A,I,c,ee+D,1,1)),k=t.Cartesian3.clone(J,k),J=K,G=t.Cartesian3.negate(v,G);for(let a=1;a<O-1;a++){const n=o?2:1;if(K=e[a+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}v=t.Cartesian3.subtract(K,J,v),v=t.Cartesian3.normalize(v,v),j=t.Cartesian3.add(v,G,j),j=t.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);const s=t.Cartesian3.multiplyByScalar(Q,t.Cartesian3.dot(v,Q),U);t.Cartesian3.subtract(v,s,s),t.Cartesian3.normalize(s,s);const d=t.Cartesian3.multiplyByScalar(Q,t.Cartesian3.dot(G,Q),_);t.Cartesian3.subtract(G,d,d),t.Cartesian3.normalize(d,d);if(!r.CesiumMath.equalsEpsilon(Math.abs(t.Cartesian3.dot(s,d)),1,r.CesiumMath.EPSILON7)){j=t.Cartesian3.cross(j,Q,j),j=t.Cartesian3.cross(Q,j,j),j=t.Cartesian3.normalize(j,j);const e=1/Math.max(.25,t.Cartesian3.magnitude(t.Cartesian3.cross(j,G,E))),a=M.angleIsGreaterThanPi(v,G,J,c);a?(q=t.Cartesian3.add(J,t.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y),W=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,a,c,V,S,ae+D,o):(j=t.Cartesian3.negate(j,j),V=N(J,j,S,V,c,ae+D,e,n)),k=t.Cartesian3.clone(W,k)):(q=t.Cartesian3.add(J,t.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y),W=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,a,c,V,S,ae+D,o):V=N(J,j,S,V,c,ae+D,e,n),k=t.Cartesian3.clone(W,k)),G=t.Cartesian3.negate(v,G)}else V=N(k,Y,S,V,c,ee+D,1,1),k=J;ee=ae,ae=P[a+1],J=K}u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(J,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),o&&(I=N(J,Y,A,I,c,ae+D,1,1)),O=V.length;const te=o?O+I.length:O,ne=new Float64Array(te);return ne.set(V),o&&ne.set(I,O),ne};var Z=M;e.CornerType=l,e.PolylineVolumeGeometryLibrary=Z,e.oneTimeWarning=C})); +define(["exports","./Matrix2-7a8e9daf","./Matrix3-b2351961","./EllipsoidTangentPlane-c3e9d965","./Math-355606c6","./PolylinePipeline-8df321dd","./Transforms-f17097e5","./defaultValue-f6d5e6da"],(function(e,a,t,n,r,i,s,o){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new t.Cartesian3,new t.Cartesian3],d=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,f=new t.Cartesian3,p=new t.Cartesian3,w=new t.Cartesian3,x=new t.Cartesian3,E=new t.Cartesian3,P=new t.Cartesian3,M={};let T=new t.Cartographic;function b(e,a,n,r){const i=e[0],s=e[1],o=t.Cartesian3.angleBetween(i,s),l=Math.ceil(o/r),c=new Array(l);let C;if(a===n){for(C=0;C<l;C++)c[C]=a;return c.push(n),c}const u=(n-a)/l;for(C=1;C<l;C++){const e=a+C*u;c[C]=e}return c[0]=a,c.push(n),c}const B=new t.Cartesian3,z=new t.Cartesian3;const S=new t.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new t.Matrix3;const O=t.Matrix3.IDENTITY.clone(),V=new t.Cartesian3,I=new a.Cartesian4,v=new t.Cartesian3;function N(e,r,i,o,l,c,C,u){let d=V,g=I;A=s.Transforms.eastNorthUpToFixedFrame(e,l,A),d=a.Matrix4.multiplyByPointAsVector(A,S,d),d=t.Cartesian3.normalize(d,d);const y=function(e,r,i,s){const o=new n.EllipsoidTangentPlane(i,s),l=o.projectPointOntoPlane(t.Cartesian3.add(i,e,B),B),c=o.projectPointOntoPlane(t.Cartesian3.add(i,r,z),z),C=a.Cartesian2.angleBetween(l,c);return c.x*l.y-c.y*l.x>=0?-C:C}(d,r,e,l);R=t.Matrix3.fromRotationZ(y,R),v.z=c,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,v,D),A);const h=O;h[0]=C;for(let e=0;e<u;e++)for(let e=0;e<i.length;e+=3)g=t.Cartesian3.fromArray(i,e,g),g=t.Matrix3.multiplyByVector(h,g,g),g=a.Matrix4.multiplyByPoint(A,g,g),o.push(g.x,g.y,g.z);return o}const G=new t.Cartesian3;function H(e,a,n,r,i,s,o){for(let l=0;l<e.length;l+=3){r=N(t.Cartesian3.fromArray(e,l,G),a,n,r,i,s[l/3],o,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-s;return n}const j=new s.Quaternion,Q=new t.Cartesian3,q=new t.Matrix3;function F(e,a,n,i,o,c,C,u,d,g){const y=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,E),t.Cartesian3.subtract(n,e,P)),h=i===l.BEVELED?0:Math.ceil(y/r.CesiumMath.toRadians(5));let m,f,p;if(m=o?t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,E),y/(h+1),j),q):t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e,y/(h+1),j),q),a=t.Cartesian3.clone(a,Q),h>0){const n=g?2:1;for(let r=0;r<h;r++)a=t.Matrix3.multiplyByVector(m,a,a),f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,n)}else f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,1),n=t.Cartesian3.clone(n,Q),f=t.Cartesian3.subtract(n,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(n,P),C=N(p,f,u,C,c,d,1,1);return C}M.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],s=e[i];a.Cartesian2.equals(t,s)||n.push(s)}return n},M.angleIsGreaterThanPi=function(e,a,r,i){const s=new n.EllipsoidTangentPlane(r,i),o=s.projectPointOntoPlane(t.Cartesian3.add(r,e,B),B),l=s.projectPointOntoPlane(t.Cartesian3.add(r,a,z),z);return l.x*o.y-l.y*o.x>=0};const U=new t.Cartesian3,_=new t.Cartesian3;M.computePositions=function(e,a,n,s,o){const c=s._ellipsoid,P=function(e,a){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];T=a.cartesianToCartographic(r,T),t[n]=T.height,e[n]=a.scaleToGeodeticSurface(r,r)}return t}(e,c),B=s._granularity,z=s._cornerType,S=o?function(e,a){const t=e.length,n=new Array(6*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;let o=e[0];n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s;for(let a=1;a<t;a++){o=e[a];const t=o.x-i,l=o.y-s;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}return o=e[0],n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s,n}(a,n):L(a,n),A=o?L(a,n):void 0,D=n.height/2,R=n.width/2;let O=e.length,V=[],I=o?[]:void 0,v=d,G=g,j=y,Q=h,q=m,Z=f,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),v=t.Cartesian3.subtract(K,J,v),v=t.Cartesian3.normalize(v,v),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y);let X,$,ee=P[0],ae=P[1];o&&(I=N(J,Y,A,I,c,ee+D,1,1)),k=t.Cartesian3.clone(J,k),J=K,G=t.Cartesian3.negate(v,G);for(let a=1;a<O-1;a++){const n=o?2:1;if(K=e[a+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}v=t.Cartesian3.subtract(K,J,v),v=t.Cartesian3.normalize(v,v),j=t.Cartesian3.add(v,G,j),j=t.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);const s=t.Cartesian3.multiplyByScalar(Q,t.Cartesian3.dot(v,Q),U);t.Cartesian3.subtract(v,s,s),t.Cartesian3.normalize(s,s);const d=t.Cartesian3.multiplyByScalar(Q,t.Cartesian3.dot(G,Q),_);t.Cartesian3.subtract(G,d,d),t.Cartesian3.normalize(d,d);if(!r.CesiumMath.equalsEpsilon(Math.abs(t.Cartesian3.dot(s,d)),1,r.CesiumMath.EPSILON7)){j=t.Cartesian3.cross(j,Q,j),j=t.Cartesian3.cross(Q,j,j),j=t.Cartesian3.normalize(j,j);const e=1/Math.max(.25,t.Cartesian3.magnitude(t.Cartesian3.cross(j,G,E))),a=M.angleIsGreaterThanPi(v,G,J,c);a?(q=t.Cartesian3.add(J,t.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y),W=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,a,c,V,S,ae+D,o):(j=t.Cartesian3.negate(j,j),V=N(J,j,S,V,c,ae+D,e,n)),k=t.Cartesian3.clone(W,k)):(q=t.Cartesian3.add(J,t.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=t.Cartesian3.cross(Q,v,Y),Y=t.Cartesian3.normalize(Y,Y),W=t.Cartesian3.add(q,t.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,a,c,V,S,ae+D,o):V=N(J,j,S,V,c,ae+D,e,n),k=t.Cartesian3.clone(W,k)),G=t.Cartesian3.negate(v,G)}else V=N(k,Y,S,V,c,ee+D,1,1),k=J;ee=ae,ae=P[a+1],J=K}u[0]=t.Cartesian3.clone(k,u[0]),u[1]=t.Cartesian3.clone(J,u[1]),X=b(u,ee+D,ae+D,B),$=i.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),o&&(I=N(J,Y,A,I,c,ae+D,1,1)),O=V.length;const te=o?O+I.length:O,ne=new Float64Array(te);return ne.set(V),o&&ne.set(I,O),ne};var Z=M;e.CornerType=l,e.PolylineVolumeGeometryLibrary=Z,e.oneTimeWarning=C})); diff --git a/public/lib/Cesium/Workers/PrimitivePipeline-adac135e.js b/public/lib/Cesium/Workers/PrimitivePipeline-72a87ada.js similarity index 96% rename from public/lib/Cesium/Workers/PrimitivePipeline-adac135e.js rename to public/lib/Cesium/Workers/PrimitivePipeline-72a87ada.js index 817bb306..25a4ba77 100644 --- a/public/lib/Cesium/Workers/PrimitivePipeline-adac135e.js +++ b/public/lib/Cesium/Workers/PrimitivePipeline-72a87ada.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./Matrix3-81054f0f","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Matrix2-413c4048","./WebMercatorProjection-943e2226"],(function(e,t,n,r,o,i,s,c,a,d,p){"use strict";function u(e,t,n){e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,0),this.value=new Float32Array([e,t,n])}function f(e,t){const r=e.attributes,o=r.position,s=o.values.length/o.componentsPerAttribute;r.batchId=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(s)});const c=r.batchId.values;for(let e=0;e<s;++e)c[e]=t}function l(e){const o=e.instances,i=e.projection,s=e.elementIndexUintSupported,a=e.scene3DOnly,p=e.vertexCacheOptimize,u=e.compressVertices,l=e.modelMatrix;let m,h,g=o.length;for(m=0;m<g;++m)if(r.defined(o[m].geometry)){o[m].geometry.primitiveType;break}if(function(e,t,n){let o=!n;const i=e.length;let s;if(!o&&i>1){const t=e[0].modelMatrix;for(s=1;s<i;++s)if(!d.Matrix4.equals(t,e[s].modelMatrix)){o=!0;break}}if(o)for(s=0;s<i;++s)r.defined(e[s].geometry)&&c.GeometryPipeline.transformToWorldCoordinates(e[s]);else d.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(o,l,a),!a)for(m=0;m<g;++m)r.defined(o[m].geometry)&&c.GeometryPipeline.splitLongitude(o[m]);if(function(e){const t=e.length;for(let n=0;n<t;++n){const t=e[n];r.defined(t.geometry)?f(t.geometry,n):r.defined(t.westHemisphereGeometry)&&r.defined(t.eastHemisphereGeometry)&&(f(t.westHemisphereGeometry,n),f(t.eastHemisphereGeometry,n))}}(o),p)for(m=0;m<g;++m){const e=o[m];r.defined(e.geometry)?(c.GeometryPipeline.reorderForPostVertexCache(e.geometry),c.GeometryPipeline.reorderForPreVertexCache(e.geometry)):r.defined(e.westHemisphereGeometry)&&r.defined(e.eastHemisphereGeometry)&&(c.GeometryPipeline.reorderForPostVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPostVertexCache(e.eastHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.eastHemisphereGeometry))}let y=c.GeometryPipeline.combineInstances(o);for(g=y.length,m=0;m<g;++m){h=y[m];const e=h.attributes;if(a)for(const t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===n.ComponentDatatype.DOUBLE&&c.GeometryPipeline.encodeAttribute(h,t,`${t}3DHigh`,`${t}3DLow`);else for(const o in e)if(e.hasOwnProperty(o)&&e[o].componentDatatype===n.ComponentDatatype.DOUBLE){const e=`${o}3D`,n=`${o}2D`;c.GeometryPipeline.projectTo2D(h,o,e,n,i),r.defined(h.boundingSphere)&&"position"===o&&(h.boundingSphereCV=t.BoundingSphere.fromVertices(h.attributes.position2D.values)),c.GeometryPipeline.encodeAttribute(h,e,`${e}High`,`${e}Low`),c.GeometryPipeline.encodeAttribute(h,n,`${n}High`,`${n}Low`)}u&&c.GeometryPipeline.compressVertices(h)}if(!s){let e=[];for(g=y.length,m=0;m<g;++m)h=y[m],e=e.concat(c.GeometryPipeline.fitToUnsignedShortIndices(h));y=e}return y}function m(e,t,n,o){let i,s,c;const a=o.length-1;if(a>=0){const e=o[a];i=e.offset+e.count,c=e.index,s=n[c].indices.length}else i=0,c=0,s=n[c].indices.length;const d=e.length;for(let a=0;a<d;++a){const d=e[a][t];if(!r.defined(d))continue;const p=d.indices.length;i+p>s&&(i=0,s=n[++c].indices.length),o.push({index:c,offset:i,count:p}),i+=p}}Object.defineProperties(u.prototype,{componentDatatype:{get:function(){return n.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),u.fromCartesian3=function(e){return new u(e.x,e.y,e.z)},u.toValue=function(e,t){return r.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const h={};function g(e,t){const n=e.attributes;for(const e in n)if(n.hasOwnProperty(e)){const o=n[e];r.defined(o)&&r.defined(o.values)&&t.push(o.values.buffer)}r.defined(e.indices)&&t.push(e.indices.buffer)}function y(e,t){const n=e.length,o=new Float64Array(1+19*n);let i=0;o[i++]=n;for(let t=0;t<n;t++){const n=e[t];if(d.Matrix4.pack(n.modelMatrix,o,i),i+=d.Matrix4.packedLength,r.defined(n.attributes)&&r.defined(n.attributes.offset)){const e=n.attributes.offset.value;o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2]}i+=3}return t.push(o.buffer),o}function b(e){const n=e.length,o=1+(t.BoundingSphere.packedLength+1)*n,i=new Float32Array(o);let s=0;i[s++]=n;for(let o=0;o<n;++o){const n=e[o];r.defined(n)?(i[s++]=1,t.BoundingSphere.pack(e[o],i,s)):i[s++]=0,s+=t.BoundingSphere.packedLength}return i}function x(e){const n=new Array(e[0]);let r=0,o=1;for(;o<e.length;)1===e[o++]&&(n[r]=t.BoundingSphere.unpack(e,o)),++r,o+=t.BoundingSphere.packedLength;return n}h.combineGeometry=function(e){let n,o;const i=e.instances,s=i.length;let a,d,p=!1;s>0&&(n=l(e),n.length>0&&(o=c.GeometryPipeline.createAttributeLocations(n[0]),e.createPickOffsets&&(a=function(e,t){const n=[];return m(e,"geometry",t,n),m(e,"westHemisphereGeometry",t,n),m(e,"eastHemisphereGeometry",t,n),n}(i,n))),r.defined(i[0].attributes)&&r.defined(i[0].attributes.offset)&&(d=new Array(s),p=!0));const u=new Array(s),f=new Array(s);for(let e=0;e<s;++e){const n=i[e],o=n.geometry;r.defined(o)&&(u[e]=o.boundingSphere,f[e]=o.boundingSphereCV,p&&(d[e]=n.geometry.offsetAttribute));const s=n.eastHemisphereGeometry,c=n.westHemisphereGeometry;r.defined(s)&&r.defined(c)&&(r.defined(s.boundingSphere)&&r.defined(c.boundingSphere)&&(u[e]=t.BoundingSphere.union(s.boundingSphere,c.boundingSphere)),r.defined(s.boundingSphereCV)&&r.defined(c.boundingSphereCV)&&(f[e]=t.BoundingSphere.union(s.boundingSphereCV,c.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:o,pickOffsets:a,offsetInstanceExtend:d,boundingSpheres:u,boundingSpheresCV:f}},h.packCreateGeometryResults=function(e,n){const o=new Float64Array(function(e){let n=1;const o=e.length;for(let i=0;i<o;i++){const o=e[i];if(++n,!r.defined(o))continue;const s=o.attributes;n+=7+2*t.BoundingSphere.packedLength+(r.defined(o.indices)?o.indices.length:0);for(const e in s)s.hasOwnProperty(e)&&r.defined(s[e])&&(n+=5+s[e].values.length)}return n}(e)),i=[],s={},c=e.length;let a=0;o[a++]=c;for(let n=0;n<c;n++){const c=e[n],d=r.defined(c);if(o[a++]=d?1:0,!d)continue;o[a++]=c.primitiveType,o[a++]=c.geometryType,o[a++]=r.defaultValue(c.offsetAttribute,-1);const p=r.defined(c.boundingSphere)?1:0;o[a++]=p,p&&t.BoundingSphere.pack(c.boundingSphere,o,a),a+=t.BoundingSphere.packedLength;const u=r.defined(c.boundingSphereCV)?1:0;o[a++]=u,u&&t.BoundingSphere.pack(c.boundingSphereCV,o,a),a+=t.BoundingSphere.packedLength;const f=c.attributes,l=[];for(const e in f)f.hasOwnProperty(e)&&r.defined(f[e])&&(l.push(e),r.defined(s[e])||(s[e]=i.length,i.push(e)));o[a++]=l.length;for(let e=0;e<l.length;e++){const t=l[e],n=f[t];o[a++]=s[t],o[a++]=n.componentDatatype,o[a++]=n.componentsPerAttribute,o[a++]=n.normalize?1:0,o[a++]=n.values.length,o.set(n.values,a),a+=n.values.length}const m=r.defined(c.indices)?c.indices.length:0;o[a++]=m,m>0&&(o.set(c.indices,a),a+=m)}return n.push(o.buffer),{stringTable:i,packedData:o}},h.unpackCreateGeometryResults=function(e){const r=e.stringTable,o=e.packedData;let c;const d=new Array(o[0]);let p=0,u=1;for(;u<o.length;){if(!(1===o[u++])){d[p++]=void 0;continue}const e=o[u++],f=o[u++];let l,m,h=o[u++];-1===h&&(h=void 0);1===o[u++]&&(l=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;let g,y,b;1===o[u++]&&(m=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;const x=new s.GeometryAttributes,G=o[u++];for(c=0;c<G;c++){const e=r[o[u++]],t=o[u++];b=o[u++];const s=0!==o[u++];g=o[u++],y=n.ComponentDatatype.createTypedArray(t,g);for(let e=0;e<g;e++)y[e]=o[u++];x[e]=new i.GeometryAttribute({componentDatatype:t,componentsPerAttribute:b,normalize:s,values:y})}let S;if(g=o[u++],g>0){const e=y.length/b;for(S=a.IndexDatatype.createTypedArray(e,g),c=0;c<g;c++)S[c]=o[u++]}d[p++]=new i.Geometry({primitiveType:e,geometryType:f,boundingSphere:l,boundingSphereCV:m,indices:S,attributes:x,offsetAttribute:h})}return d},h.packCombineGeometryParameters=function(e,n){const r=e.createGeometryResults,o=r.length;for(let e=0;e<o;e++)n.push(r[e].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:y(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof t.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},h.unpackCombineGeometryParameters=function(e){const n=function(e){const t=e,n=new Array(t[0]);let o=0,i=1;for(;i<t.length;){const e=d.Matrix4.unpack(t,i);let s;i+=d.Matrix4.packedLength,r.defined(t[i])&&(s={offset:new u(t[i],t[i+1],t[i+2])}),i+=3,n[o++]={modelMatrix:e,attributes:s}}return n}(e.packedInstances),i=e.createGeometryResults,s=i.length;let c=0;for(let e=0;e<s;e++){const t=h.unpackCreateGeometryResults(i[e]),r=t.length;for(let e=0;e<r;e++){const r=t[e];n[c].geometry=r,++c}}const a=o.Ellipsoid.clone(e.ellipsoid);return{instances:n,ellipsoid:a,projection:e.isGeographic?new t.GeographicProjection(a):new p.WebMercatorProjection(a),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:d.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},h.packCombineGeometryResults=function(e,t){r.defined(e.geometries)&&function(e,t){const n=e.length;for(let r=0;r<n;++r)g(e[r],t)}(e.geometries,t);const n=b(e.boundingSpheres),o=b(e.boundingSpheresCV);return t.push(n.buffer,o.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:o}},h.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}};var G=h;e.PrimitivePipeline=G})); +define(["exports","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./Matrix3-b2351961","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Matrix2-7a8e9daf","./WebMercatorProjection-db7467f4"],(function(e,t,n,r,o,i,s,c,a,d,p){"use strict";function u(e,t,n){e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,0),this.value=new Float32Array([e,t,n])}function f(e,t){const r=e.attributes,o=r.position,s=o.values.length/o.componentsPerAttribute;r.batchId=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(s)});const c=r.batchId.values;for(let e=0;e<s;++e)c[e]=t}function l(e){const o=e.instances,i=e.projection,s=e.elementIndexUintSupported,a=e.scene3DOnly,p=e.vertexCacheOptimize,u=e.compressVertices,l=e.modelMatrix;let m,h,g=o.length;for(m=0;m<g;++m)if(r.defined(o[m].geometry)){o[m].geometry.primitiveType;break}if(function(e,t,n){let o=!n;const i=e.length;let s;if(!o&&i>1){const t=e[0].modelMatrix;for(s=1;s<i;++s)if(!d.Matrix4.equals(t,e[s].modelMatrix)){o=!0;break}}if(o)for(s=0;s<i;++s)r.defined(e[s].geometry)&&c.GeometryPipeline.transformToWorldCoordinates(e[s]);else d.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(o,l,a),!a)for(m=0;m<g;++m)r.defined(o[m].geometry)&&c.GeometryPipeline.splitLongitude(o[m]);if(function(e){const t=e.length;for(let n=0;n<t;++n){const t=e[n];r.defined(t.geometry)?f(t.geometry,n):r.defined(t.westHemisphereGeometry)&&r.defined(t.eastHemisphereGeometry)&&(f(t.westHemisphereGeometry,n),f(t.eastHemisphereGeometry,n))}}(o),p)for(m=0;m<g;++m){const e=o[m];r.defined(e.geometry)?(c.GeometryPipeline.reorderForPostVertexCache(e.geometry),c.GeometryPipeline.reorderForPreVertexCache(e.geometry)):r.defined(e.westHemisphereGeometry)&&r.defined(e.eastHemisphereGeometry)&&(c.GeometryPipeline.reorderForPostVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPostVertexCache(e.eastHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.eastHemisphereGeometry))}let y=c.GeometryPipeline.combineInstances(o);for(g=y.length,m=0;m<g;++m){h=y[m];const e=h.attributes;if(a)for(const t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===n.ComponentDatatype.DOUBLE&&c.GeometryPipeline.encodeAttribute(h,t,`${t}3DHigh`,`${t}3DLow`);else for(const o in e)if(e.hasOwnProperty(o)&&e[o].componentDatatype===n.ComponentDatatype.DOUBLE){const e=`${o}3D`,n=`${o}2D`;c.GeometryPipeline.projectTo2D(h,o,e,n,i),r.defined(h.boundingSphere)&&"position"===o&&(h.boundingSphereCV=t.BoundingSphere.fromVertices(h.attributes.position2D.values)),c.GeometryPipeline.encodeAttribute(h,e,`${e}High`,`${e}Low`),c.GeometryPipeline.encodeAttribute(h,n,`${n}High`,`${n}Low`)}u&&c.GeometryPipeline.compressVertices(h)}if(!s){let e=[];for(g=y.length,m=0;m<g;++m)h=y[m],e=e.concat(c.GeometryPipeline.fitToUnsignedShortIndices(h));y=e}return y}function m(e,t,n,o){let i,s,c;const a=o.length-1;if(a>=0){const e=o[a];i=e.offset+e.count,c=e.index,s=n[c].indices.length}else i=0,c=0,s=n[c].indices.length;const d=e.length;for(let a=0;a<d;++a){const d=e[a][t];if(!r.defined(d))continue;const p=d.indices.length;i+p>s&&(i=0,s=n[++c].indices.length),o.push({index:c,offset:i,count:p}),i+=p}}Object.defineProperties(u.prototype,{componentDatatype:{get:function(){return n.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),u.fromCartesian3=function(e){return new u(e.x,e.y,e.z)},u.toValue=function(e,t){return r.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const h={};function g(e,t){const n=e.attributes;for(const e in n)if(n.hasOwnProperty(e)){const o=n[e];r.defined(o)&&r.defined(o.values)&&t.push(o.values.buffer)}r.defined(e.indices)&&t.push(e.indices.buffer)}function y(e,t){const n=e.length,o=new Float64Array(1+19*n);let i=0;o[i++]=n;for(let t=0;t<n;t++){const n=e[t];if(d.Matrix4.pack(n.modelMatrix,o,i),i+=d.Matrix4.packedLength,r.defined(n.attributes)&&r.defined(n.attributes.offset)){const e=n.attributes.offset.value;o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2]}i+=3}return t.push(o.buffer),o}function b(e){const n=e.length,o=1+(t.BoundingSphere.packedLength+1)*n,i=new Float32Array(o);let s=0;i[s++]=n;for(let o=0;o<n;++o){const n=e[o];r.defined(n)?(i[s++]=1,t.BoundingSphere.pack(e[o],i,s)):i[s++]=0,s+=t.BoundingSphere.packedLength}return i}function x(e){const n=new Array(e[0]);let r=0,o=1;for(;o<e.length;)1===e[o++]&&(n[r]=t.BoundingSphere.unpack(e,o)),++r,o+=t.BoundingSphere.packedLength;return n}h.combineGeometry=function(e){let n,o;const i=e.instances,s=i.length;let a,d,p=!1;s>0&&(n=l(e),n.length>0&&(o=c.GeometryPipeline.createAttributeLocations(n[0]),e.createPickOffsets&&(a=function(e,t){const n=[];return m(e,"geometry",t,n),m(e,"westHemisphereGeometry",t,n),m(e,"eastHemisphereGeometry",t,n),n}(i,n))),r.defined(i[0].attributes)&&r.defined(i[0].attributes.offset)&&(d=new Array(s),p=!0));const u=new Array(s),f=new Array(s);for(let e=0;e<s;++e){const n=i[e],o=n.geometry;r.defined(o)&&(u[e]=o.boundingSphere,f[e]=o.boundingSphereCV,p&&(d[e]=n.geometry.offsetAttribute));const s=n.eastHemisphereGeometry,c=n.westHemisphereGeometry;r.defined(s)&&r.defined(c)&&(r.defined(s.boundingSphere)&&r.defined(c.boundingSphere)&&(u[e]=t.BoundingSphere.union(s.boundingSphere,c.boundingSphere)),r.defined(s.boundingSphereCV)&&r.defined(c.boundingSphereCV)&&(f[e]=t.BoundingSphere.union(s.boundingSphereCV,c.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:o,pickOffsets:a,offsetInstanceExtend:d,boundingSpheres:u,boundingSpheresCV:f}},h.packCreateGeometryResults=function(e,n){const o=new Float64Array(function(e){let n=1;const o=e.length;for(let i=0;i<o;i++){const o=e[i];if(++n,!r.defined(o))continue;const s=o.attributes;n+=7+2*t.BoundingSphere.packedLength+(r.defined(o.indices)?o.indices.length:0);for(const e in s)s.hasOwnProperty(e)&&r.defined(s[e])&&(n+=5+s[e].values.length)}return n}(e)),i=[],s={},c=e.length;let a=0;o[a++]=c;for(let n=0;n<c;n++){const c=e[n],d=r.defined(c);if(o[a++]=d?1:0,!d)continue;o[a++]=c.primitiveType,o[a++]=c.geometryType,o[a++]=r.defaultValue(c.offsetAttribute,-1);const p=r.defined(c.boundingSphere)?1:0;o[a++]=p,p&&t.BoundingSphere.pack(c.boundingSphere,o,a),a+=t.BoundingSphere.packedLength;const u=r.defined(c.boundingSphereCV)?1:0;o[a++]=u,u&&t.BoundingSphere.pack(c.boundingSphereCV,o,a),a+=t.BoundingSphere.packedLength;const f=c.attributes,l=[];for(const e in f)f.hasOwnProperty(e)&&r.defined(f[e])&&(l.push(e),r.defined(s[e])||(s[e]=i.length,i.push(e)));o[a++]=l.length;for(let e=0;e<l.length;e++){const t=l[e],n=f[t];o[a++]=s[t],o[a++]=n.componentDatatype,o[a++]=n.componentsPerAttribute,o[a++]=n.normalize?1:0,o[a++]=n.values.length,o.set(n.values,a),a+=n.values.length}const m=r.defined(c.indices)?c.indices.length:0;o[a++]=m,m>0&&(o.set(c.indices,a),a+=m)}return n.push(o.buffer),{stringTable:i,packedData:o}},h.unpackCreateGeometryResults=function(e){const r=e.stringTable,o=e.packedData;let c;const d=new Array(o[0]);let p=0,u=1;for(;u<o.length;){if(!(1===o[u++])){d[p++]=void 0;continue}const e=o[u++],f=o[u++];let l,m,h=o[u++];-1===h&&(h=void 0);1===o[u++]&&(l=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;let g,y,b;1===o[u++]&&(m=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;const x=new s.GeometryAttributes,G=o[u++];for(c=0;c<G;c++){const e=r[o[u++]],t=o[u++];b=o[u++];const s=0!==o[u++];g=o[u++],y=n.ComponentDatatype.createTypedArray(t,g);for(let e=0;e<g;e++)y[e]=o[u++];x[e]=new i.GeometryAttribute({componentDatatype:t,componentsPerAttribute:b,normalize:s,values:y})}let S;if(g=o[u++],g>0){const e=y.length/b;for(S=a.IndexDatatype.createTypedArray(e,g),c=0;c<g;c++)S[c]=o[u++]}d[p++]=new i.Geometry({primitiveType:e,geometryType:f,boundingSphere:l,boundingSphereCV:m,indices:S,attributes:x,offsetAttribute:h})}return d},h.packCombineGeometryParameters=function(e,n){const r=e.createGeometryResults,o=r.length;for(let e=0;e<o;e++)n.push(r[e].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:y(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof t.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},h.unpackCombineGeometryParameters=function(e){const n=function(e){const t=e,n=new Array(t[0]);let o=0,i=1;for(;i<t.length;){const e=d.Matrix4.unpack(t,i);let s;i+=d.Matrix4.packedLength,r.defined(t[i])&&(s={offset:new u(t[i],t[i+1],t[i+2])}),i+=3,n[o++]={modelMatrix:e,attributes:s}}return n}(e.packedInstances),i=e.createGeometryResults,s=i.length;let c=0;for(let e=0;e<s;e++){const t=h.unpackCreateGeometryResults(i[e]),r=t.length;for(let e=0;e<r;e++){const r=t[e];n[c].geometry=r,++c}}const a=o.Ellipsoid.clone(e.ellipsoid);return{instances:n,ellipsoid:a,projection:e.isGeographic?new t.GeographicProjection(a):new p.WebMercatorProjection(a),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:d.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},h.packCombineGeometryResults=function(e,t){r.defined(e.geometries)&&function(e,t){const n=e.length;for(let r=0;r<n;++r)g(e[r],t)}(e.geometries,t);const n=b(e.boundingSpheres),o=b(e.boundingSpheresCV);return t.push(n.buffer,o.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:o}},h.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}};var G=h;e.PrimitivePipeline=G})); diff --git a/public/lib/Cesium/Workers/RectangleGeometryLibrary-c7310394.js b/public/lib/Cesium/Workers/RectangleGeometryLibrary-6ad7ff7a.js similarity index 94% rename from public/lib/Cesium/Workers/RectangleGeometryLibrary-c7310394.js rename to public/lib/Cesium/Workers/RectangleGeometryLibrary-6ad7ff7a.js index e6618473..98aaf91e 100644 --- a/public/lib/Cesium/Workers/RectangleGeometryLibrary-c7310394.js +++ b/public/lib/Cesium/Workers/RectangleGeometryLibrary-6ad7ff7a.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Transforms-b3716b06","./Math-2ce22ee9","./Matrix2-413c4048"],(function(t,n,a,o,r,e){"use strict";const s=Math.cos,i=Math.sin,c=Math.sqrt,g={computePosition:function(t,n,o,r,e,g,u){const h=n.radiiSquared,l=t.nwCorner,C=t.boundingRectangle;let S=l.latitude-t.granYCos*r+e*t.granXSin;const M=s(S),d=i(S),w=h.z*d;let X=l.longitude+r*t.granYSin+e*t.granXCos;const Y=M*s(X),m=M*i(X),f=h.x*Y,p=h.y*m,x=c(f*Y+p*m+w*d);if(g.x=f/x,g.y=p/x,g.z=w/x,o){const n=t.stNwCorner;a.defined(n)?(S=n.latitude-t.stGranYCos*r+e*t.stGranXSin,X=n.longitude+r*t.stGranYSin+e*t.stGranXCos,u.x=(X-t.stWest)*t.lonScalar,u.y=(S-t.stSouth)*t.latScalar):(u.x=(X-C.west)*t.lonScalar,u.y=(S-C.south)*t.latScalar)}}},u=new e.Matrix2;let h=new n.Cartesian3;const l=new n.Cartographic;let C=new n.Cartesian3;const S=new o.GeographicProjection;function M(t,a,o,r,s,i,c){const g=Math.cos(a),l=r*g,M=o*g,d=Math.sin(a),w=r*d,X=o*d;h=S.project(t,h),h=n.Cartesian3.subtract(h,C,h);const Y=e.Matrix2.fromRotation(a,u);h=e.Matrix2.multiplyByVector(Y,h,h),h=n.Cartesian3.add(h,C,h),i-=1,c-=1;const m=(t=S.unproject(h,t)).latitude,f=m+i*X,p=m-l*c,x=m-l*c+i*X,G=Math.max(m,f,p,x),R=Math.min(m,f,p,x),y=t.longitude,O=y+i*M,P=y+c*w,W=y+c*w+i*M;return{north:G,south:R,east:Math.max(y,O,P,W),west:Math.min(y,O,P,W),granYCos:l,granYSin:w,granXCos:M,granXSin:X,nwCorner:t}}g.computeOptions=function(t,n,a,o,s,i,c){let g,u=t.east,h=t.west,d=t.north,w=t.south,X=!1,Y=!1;d===r.CesiumMath.PI_OVER_TWO&&(X=!0),w===-r.CesiumMath.PI_OVER_TWO&&(Y=!0);const m=d-w;g=h>u?r.CesiumMath.TWO_PI-h+u:u-h;const f=Math.ceil(g/n)+1,p=Math.ceil(m/n)+1,x=g/(f-1),G=m/(p-1),R=e.Rectangle.northwest(t,i),y=e.Rectangle.center(t,l);0===a&&0===o||(y.longitude<R.longitude&&(y.longitude+=r.CesiumMath.TWO_PI),C=S.project(y,C));const O=G,P=x,W=e.Rectangle.clone(t,s),_={granYCos:O,granYSin:0,granXCos:P,granXSin:0,nwCorner:R,boundingRectangle:W,width:f,height:p,northCap:X,southCap:Y};if(0!==a){const t=M(R,a,x,G,0,f,p);d=t.north,w=t.south,u=t.east,h=t.west,_.granYCos=t.granYCos,_.granYSin=t.granYSin,_.granXCos=t.granXCos,_.granXSin=t.granXSin,W.north=d,W.south=w,W.east=u,W.west=h}if(0!==o){a-=o;const t=e.Rectangle.northwest(W,c),n=M(t,a,x,G,0,f,p);_.stGranYCos=n.granYCos,_.stGranXCos=n.granXCos,_.stGranYSin=n.granYSin,_.stGranXSin=n.granXSin,_.stNwCorner=t,_.stWest=n.west,_.stSouth=n.south}return _};var d=g;t.RectangleGeometryLibrary=d})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Transforms-f17097e5","./Math-355606c6","./Matrix2-7a8e9daf"],(function(t,n,a,o,r,e){"use strict";const s=Math.cos,i=Math.sin,c=Math.sqrt,g={computePosition:function(t,n,o,r,e,g,u){const h=n.radiiSquared,l=t.nwCorner,C=t.boundingRectangle;let S=l.latitude-t.granYCos*r+e*t.granXSin;const M=s(S),d=i(S),w=h.z*d;let X=l.longitude+r*t.granYSin+e*t.granXCos;const Y=M*s(X),m=M*i(X),f=h.x*Y,p=h.y*m,x=c(f*Y+p*m+w*d);if(g.x=f/x,g.y=p/x,g.z=w/x,o){const n=t.stNwCorner;a.defined(n)?(S=n.latitude-t.stGranYCos*r+e*t.stGranXSin,X=n.longitude+r*t.stGranYSin+e*t.stGranXCos,u.x=(X-t.stWest)*t.lonScalar,u.y=(S-t.stSouth)*t.latScalar):(u.x=(X-C.west)*t.lonScalar,u.y=(S-C.south)*t.latScalar)}}},u=new e.Matrix2;let h=new n.Cartesian3;const l=new n.Cartographic;let C=new n.Cartesian3;const S=new o.GeographicProjection;function M(t,a,o,r,s,i,c){const g=Math.cos(a),l=r*g,M=o*g,d=Math.sin(a),w=r*d,X=o*d;h=S.project(t,h),h=n.Cartesian3.subtract(h,C,h);const Y=e.Matrix2.fromRotation(a,u);h=e.Matrix2.multiplyByVector(Y,h,h),h=n.Cartesian3.add(h,C,h),i-=1,c-=1;const m=(t=S.unproject(h,t)).latitude,f=m+i*X,p=m-l*c,x=m-l*c+i*X,G=Math.max(m,f,p,x),R=Math.min(m,f,p,x),y=t.longitude,O=y+i*M,P=y+c*w,W=y+c*w+i*M;return{north:G,south:R,east:Math.max(y,O,P,W),west:Math.min(y,O,P,W),granYCos:l,granYSin:w,granXCos:M,granXSin:X,nwCorner:t}}g.computeOptions=function(t,n,a,o,s,i,c){let g,u=t.east,h=t.west,d=t.north,w=t.south,X=!1,Y=!1;d===r.CesiumMath.PI_OVER_TWO&&(X=!0),w===-r.CesiumMath.PI_OVER_TWO&&(Y=!0);const m=d-w;g=h>u?r.CesiumMath.TWO_PI-h+u:u-h;const f=Math.ceil(g/n)+1,p=Math.ceil(m/n)+1,x=g/(f-1),G=m/(p-1),R=e.Rectangle.northwest(t,i),y=e.Rectangle.center(t,l);0===a&&0===o||(y.longitude<R.longitude&&(y.longitude+=r.CesiumMath.TWO_PI),C=S.project(y,C));const O=G,P=x,W=e.Rectangle.clone(t,s),_={granYCos:O,granYSin:0,granXCos:P,granXSin:0,nwCorner:R,boundingRectangle:W,width:f,height:p,northCap:X,southCap:Y};if(0!==a){const t=M(R,a,x,G,0,f,p);d=t.north,w=t.south,u=t.east,h=t.west,_.granYCos=t.granYCos,_.granYSin=t.granYSin,_.granXCos=t.granXCos,_.granXSin=t.granXSin,W.north=d,W.south=w,W.east=u,W.west=h}if(0!==o){a-=o;const t=e.Rectangle.northwest(W,c),n=M(t,a,x,G,0,f,p);_.stGranYCos=n.granYCos,_.stGranXCos=n.granXCos,_.stGranYSin=n.granYSin,_.stGranXSin=n.granXSin,_.stNwCorner=t,_.stWest=n.west,_.stSouth=n.south}return _};var d=g;t.RectangleGeometryLibrary=d})); diff --git a/public/lib/Cesium/Workers/TerrainEncoding-5fbe99d6.js b/public/lib/Cesium/Workers/TerrainEncoding-c5a10c4f.js similarity index 98% rename from public/lib/Cesium/Workers/TerrainEncoding-5fbe99d6.js rename to public/lib/Cesium/Workers/TerrainEncoding-c5a10c4f.js index df8cc168..84e04d20 100644 --- a/public/lib/Cesium/Workers/TerrainEncoding-5fbe99d6.js +++ b/public/lib/Cesium/Workers/TerrainEncoding-c5a10c4f.js @@ -1 +1 @@ -define(["exports","./Transforms-b3716b06","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Matrix2-413c4048","./AttributeCompression-48e336db","./ComponentDatatype-ab629b88","./Math-2ce22ee9"],(function(t,e,i,o,a,r,n,s){"use strict";function c(t,e){this._ellipsoid=t,this._cameraPosition=new i.Cartesian3,this._cameraPositionInScaledSpace=new i.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,o.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){const e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),o=i.Cartesian3.magnitudeSquared(e)-1;i.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=o}}});const u=new i.Cartesian3;c.prototype.isPointVisible=function(t){return C(this._ellipsoid.transformPositionToScaledSpace(t,u),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},c.prototype.isScaledSpacePointVisible=function(t){return C(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const d=new i.Cartesian3;c.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){const i=this._ellipsoid;let a,r;return o.defined(e)&&e<0&&i.minimumRadius>-e?(r=d,r.x=this._cameraPosition.x/(i.radii.x+e),r.y=this._cameraPosition.y/(i.radii.y+e),r.z=this._cameraPosition.z/(i.radii.z+e),a=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),C(t,r,a)},c.prototype.computeHorizonCullingPoint=function(t,e,i){return p(this._ellipsoid,t,e,i)};const l=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE);c.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,o){return p(f(this._ellipsoid,i,l),t,e,o)},c.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,o,a){return S(this._ellipsoid,t,e,i,o,a)},c.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,o,a,r){return S(f(this._ellipsoid,a,l),t,e,i,o,r)};const m=[];c.prototype.computeHorizonCullingPointFromRectangle=function(t,o,r){const n=a.Rectangle.subsample(t,o,0,m),s=e.BoundingSphere.fromPoints(n);if(!(i.Cartesian3.magnitude(s.center)<.1*o.minimumRadius))return this.computeHorizonCullingPoint(s.center,n,r)};const h=new i.Cartesian3;function f(t,e,a){if(o.defined(e)&&e<0&&t.minimumRadius>-e){const o=i.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,h);t=i.Ellipsoid.fromCartesian3(o,a)}return t}function p(t,e,a,r){o.defined(r)||(r=new i.Cartesian3);const n=P(t,e);let s=0;for(let e=0,i=a.length;e<i;++e){const i=N(t,a[e],n);if(i<0)return;s=Math.max(s,i)}return M(n,s,r)}const x=new i.Cartesian3;function S(t,e,a,r,n,s){o.defined(s)||(s=new i.Cartesian3),r=o.defaultValue(r,3),n=o.defaultValue(n,i.Cartesian3.ZERO);const c=P(t,e);let u=0;for(let e=0,i=a.length;e<i;e+=r){x.x=a[e]+n.x,x.y=a[e+1]+n.y,x.z=a[e+2]+n.z;const i=N(t,x,c);if(i<0)return;u=Math.max(u,i)}return M(c,u,s)}function C(t,e,o){const a=e,r=o,n=i.Cartesian3.subtract(t,a,u),s=-i.Cartesian3.dot(n,a);return!(r<0?s>0:s>r&&s*s/i.Cartesian3.magnitudeSquared(n)>r)}const g=new i.Cartesian3,y=new i.Cartesian3;function N(t,e,o){const a=t.transformPositionToScaledSpace(e,g);let r=i.Cartesian3.magnitudeSquared(a),n=Math.sqrt(r);const s=i.Cartesian3.divideByScalar(a,n,y);r=Math.max(1,r),n=Math.max(1,n);const c=1/n;return 1/(i.Cartesian3.dot(s,o)*c-i.Cartesian3.magnitude(i.Cartesian3.cross(s,o,s))*(Math.sqrt(r-1)*c))}function M(t,e,o){if(!(e<=0||e===1/0||e!=e))return i.Cartesian3.multiplyByScalar(t,e,o)}const T=new i.Cartesian3;function P(t,e){return i.Cartesian3.equals(e,i.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,T),i.Cartesian3.normalize(T,T))}const b={getHeight:function(t,e,i){return(t-i)*e+i}},z=new i.Cartesian3;b.getPosition=function(t,e,o,a,r){const n=e.cartesianToCartographic(t,z),s=b.getHeight(n.height,o,a);return i.Cartesian3.fromRadians(n.longitude,n.latitude,s,e,r)};var _=b;var E=Object.freeze({NONE:0,BITS12:1});const H=new i.Cartesian3,w=new i.Cartesian3,A=new a.Cartesian2,I=new a.Matrix4,V=new a.Matrix4,q=Math.pow(2,12);function G(t,e,r,n,s,c,u,d,l,m){let h,f,p=E.NONE;if(o.defined(e)&&o.defined(r)&&o.defined(n)&&o.defined(s)){const t=e.minimum,o=e.maximum,c=i.Cartesian3.subtract(o,t,w),u=n-r;p=Math.max(i.Cartesian3.maximumComponent(c),u)<q-1?E.BITS12:E.NONE,h=a.Matrix4.inverseTransformation(s,new a.Matrix4);const d=i.Cartesian3.negate(t,H);a.Matrix4.multiply(a.Matrix4.fromTranslation(d,I),h,h);const l=H;l.x=1/c.x,l.y=1/c.y,l.z=1/c.z,a.Matrix4.multiply(a.Matrix4.fromScale(l,I),h,h),f=a.Matrix4.clone(s),a.Matrix4.setTranslation(f,i.Cartesian3.ZERO,f),s=a.Matrix4.clone(s,new a.Matrix4);const m=a.Matrix4.fromTranslation(t,I),x=a.Matrix4.fromScale(c,V),S=a.Matrix4.multiply(m,x,I);a.Matrix4.multiply(s,S,s),a.Matrix4.multiply(f,S,f)}this.quantization=p,this.minimumHeight=r,this.maximumHeight=n,this.center=i.Cartesian3.clone(t),this.toScaledENU=h,this.fromScaledENU=s,this.matrix=f,this.hasVertexNormals=c,this.hasWebMercatorT=o.defaultValue(u,!1),this.hasGeodeticSurfaceNormals=o.defaultValue(d,!1),this.exaggeration=o.defaultValue(l,1),this.exaggerationRelativeHeight=o.defaultValue(m,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}G.prototype.encode=function(t,e,o,n,c,u,d,l){const m=n.x,h=n.y;if(this.quantization===E.BITS12){(o=a.Matrix4.multiplyByPoint(this.toScaledENU,o,H)).x=s.CesiumMath.clamp(o.x,0,1),o.y=s.CesiumMath.clamp(o.y,0,1),o.z=s.CesiumMath.clamp(o.z,0,1);const i=this.maximumHeight-this.minimumHeight,n=s.CesiumMath.clamp((c-this.minimumHeight)/i,0,1);a.Cartesian2.fromElements(o.x,o.y,A);const u=r.AttributeCompression.compressTextureCoordinates(A);a.Cartesian2.fromElements(o.z,n,A);const l=r.AttributeCompression.compressTextureCoordinates(A);a.Cartesian2.fromElements(m,h,A);const f=r.AttributeCompression.compressTextureCoordinates(A);if(t[e++]=u,t[e++]=l,t[e++]=f,this.hasWebMercatorT){a.Cartesian2.fromElements(d,0,A);const i=r.AttributeCompression.compressTextureCoordinates(A);t[e++]=i}}else i.Cartesian3.subtract(o,this.center,H),t[e++]=H.x,t[e++]=H.y,t[e++]=H.z,t[e++]=c,t[e++]=m,t[e++]=h,this.hasWebMercatorT&&(t[e++]=d);return this.hasVertexNormals&&(t[e++]=r.AttributeCompression.octPackFloat(u)),this.hasGeodeticSurfaceNormals&&(t[e++]=l.x,t[e++]=l.y,t[e++]=l.z),e};const O=new i.Cartesian3,B=new i.Cartesian3;G.prototype.addGeodeticSurfaceNormals=function(t,e,i){if(this.hasGeodeticSurfaceNormals)return;const o=this.stride,a=t.length/o;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();const r=this.stride;for(let n=0;n<a;n++){for(let i=0;i<o;i++){const a=n*o+i;e[n*r+i]=t[a]}const a=this.decodePosition(e,n,O),s=i.geodeticSurfaceNormal(a,B),c=n*r+this._offsetGeodeticSurfaceNormal;e[c]=s.x,e[c+1]=s.y,e[c+2]=s.z}},G.prototype.removeGeodeticSurfaceNormals=function(t,e){if(!this.hasGeodeticSurfaceNormals)return;const i=this.stride,o=t.length/i;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();const a=this.stride;for(let r=0;r<o;r++)for(let o=0;o<a;o++){const n=r*i+o;e[r*a+o]=t[n]}},G.prototype.decodePosition=function(t,e,n){if(o.defined(n)||(n=new i.Cartesian3),e*=this.stride,this.quantization===E.BITS12){const i=r.AttributeCompression.decompressTextureCoordinates(t[e],A);n.x=i.x,n.y=i.y;const o=r.AttributeCompression.decompressTextureCoordinates(t[e+1],A);return n.z=o.x,a.Matrix4.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[e],n.y=t[e+1],n.z=t[e+2],i.Cartesian3.add(n,this.center,n)},G.prototype.getExaggeratedPosition=function(t,e,i){i=this.decodePosition(t,e,i);const o=this.exaggeration,a=this.exaggerationRelativeHeight;if(1!==o&&this.hasGeodeticSurfaceNormals){const r=this.decodeGeodeticSurfaceNormal(t,e,B),n=this.decodeHeight(t,e),s=_.getHeight(n,o,a)-n;i.x+=r.x*s,i.y+=r.y*s,i.z+=r.z*s}return i},G.prototype.decodeTextureCoordinates=function(t,e,i){return o.defined(i)||(i=new a.Cartesian2),e*=this.stride,this.quantization===E.BITS12?r.AttributeCompression.decompressTextureCoordinates(t[e+2],i):a.Cartesian2.fromElements(t[e+4],t[e+5],i)},G.prototype.decodeHeight=function(t,e){if(e*=this.stride,this.quantization===E.BITS12){return r.AttributeCompression.decompressTextureCoordinates(t[e+1],A).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[e+3]},G.prototype.decodeWebMercatorT=function(t,e){return e*=this.stride,this.quantization===E.BITS12?r.AttributeCompression.decompressTextureCoordinates(t[e+3],A).x:t[e+6]},G.prototype.getOctEncodedNormal=function(t,e,i){const o=t[e=e*this.stride+this._offsetVertexNormal]/256,r=Math.floor(o),n=256*(o-r);return a.Cartesian2.fromElements(r,n,i)},G.prototype.decodeGeodeticSurfaceNormal=function(t,e,i){return e=e*this.stride+this._offsetGeodeticSurfaceNormal,i.x=t[e],i.y=t[e+1],i.z=t[e+2],i},G.prototype._calculateStrideAndOffsets=function(){let t=0;if(this.quantization===E.BITS12)t+=3;else t+=6;this.hasWebMercatorT&&(t+=1),this.hasVertexNormals&&(this._offsetVertexNormal=t,t+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=t,t+=3),this.stride=t};const R={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},U={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};G.prototype.getAttributes=function(t){const e=n.ComponentDatatype.FLOAT,i=n.ComponentDatatype.getSizeInBytes(e),o=this.stride*i;let a=0;const r=[];function s(n,s){r.push({index:n,vertexBuffer:t,componentDatatype:e,componentsPerAttribute:s,offsetInBytes:a,strideInBytes:o}),a+=s*i}if(this.quantization===E.NONE){s(R.position3DAndHeight,4);let t=2;t+=this.hasWebMercatorT?1:0,t+=this.hasVertexNormals?1:0,s(R.textureCoordAndEncodedNormals,t),this.hasGeodeticSurfaceNormals&&s(R.geodeticSurfaceNormal,3)}else{const t=this.hasWebMercatorT||this.hasVertexNormals,e=this.hasWebMercatorT&&this.hasVertexNormals;s(U.compressed0,t?4:3),e&&s(U.compressed1,1),this.hasGeodeticSurfaceNormals&&s(U.geodeticSurfaceNormal,3)}return r},G.prototype.getAttributeLocations=function(){return this.quantization===E.NONE?R:U},G.clone=function(t,e){if(o.defined(t))return o.defined(e)||(e=new G),e.quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=i.Cartesian3.clone(t.center),e.toScaledENU=a.Matrix4.clone(t.toScaledENU),e.fromScaledENU=a.Matrix4.clone(t.fromScaledENU),e.matrix=a.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e.hasGeodeticSurfaceNormals=t.hasGeodeticSurfaceNormals,e.exaggeration=t.exaggeration,e.exaggerationRelativeHeight=t.exaggerationRelativeHeight,e._calculateStrideAndOffsets(),e},t.EllipsoidalOccluder=c,t.TerrainEncoding=G})); +define(["exports","./Transforms-f17097e5","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Matrix2-7a8e9daf","./AttributeCompression-0b8f7b7d","./ComponentDatatype-ab629b88","./Math-355606c6"],(function(t,e,i,o,a,r,n,s){"use strict";function c(t,e){this._ellipsoid=t,this._cameraPosition=new i.Cartesian3,this._cameraPositionInScaledSpace=new i.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,o.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){const e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),o=i.Cartesian3.magnitudeSquared(e)-1;i.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=o}}});const u=new i.Cartesian3;c.prototype.isPointVisible=function(t){return C(this._ellipsoid.transformPositionToScaledSpace(t,u),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},c.prototype.isScaledSpacePointVisible=function(t){return C(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const d=new i.Cartesian3;c.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){const i=this._ellipsoid;let a,r;return o.defined(e)&&e<0&&i.minimumRadius>-e?(r=d,r.x=this._cameraPosition.x/(i.radii.x+e),r.y=this._cameraPosition.y/(i.radii.y+e),r.z=this._cameraPosition.z/(i.radii.z+e),a=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),C(t,r,a)},c.prototype.computeHorizonCullingPoint=function(t,e,i){return p(this._ellipsoid,t,e,i)};const l=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE);c.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,o){return p(f(this._ellipsoid,i,l),t,e,o)},c.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,o,a){return S(this._ellipsoid,t,e,i,o,a)},c.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,o,a,r){return S(f(this._ellipsoid,a,l),t,e,i,o,r)};const m=[];c.prototype.computeHorizonCullingPointFromRectangle=function(t,o,r){const n=a.Rectangle.subsample(t,o,0,m),s=e.BoundingSphere.fromPoints(n);if(!(i.Cartesian3.magnitude(s.center)<.1*o.minimumRadius))return this.computeHorizonCullingPoint(s.center,n,r)};const h=new i.Cartesian3;function f(t,e,a){if(o.defined(e)&&e<0&&t.minimumRadius>-e){const o=i.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,h);t=i.Ellipsoid.fromCartesian3(o,a)}return t}function p(t,e,a,r){o.defined(r)||(r=new i.Cartesian3);const n=P(t,e);let s=0;for(let e=0,i=a.length;e<i;++e){const i=N(t,a[e],n);if(i<0)return;s=Math.max(s,i)}return M(n,s,r)}const x=new i.Cartesian3;function S(t,e,a,r,n,s){o.defined(s)||(s=new i.Cartesian3),r=o.defaultValue(r,3),n=o.defaultValue(n,i.Cartesian3.ZERO);const c=P(t,e);let u=0;for(let e=0,i=a.length;e<i;e+=r){x.x=a[e]+n.x,x.y=a[e+1]+n.y,x.z=a[e+2]+n.z;const i=N(t,x,c);if(i<0)return;u=Math.max(u,i)}return M(c,u,s)}function C(t,e,o){const a=e,r=o,n=i.Cartesian3.subtract(t,a,u),s=-i.Cartesian3.dot(n,a);return!(r<0?s>0:s>r&&s*s/i.Cartesian3.magnitudeSquared(n)>r)}const g=new i.Cartesian3,y=new i.Cartesian3;function N(t,e,o){const a=t.transformPositionToScaledSpace(e,g);let r=i.Cartesian3.magnitudeSquared(a),n=Math.sqrt(r);const s=i.Cartesian3.divideByScalar(a,n,y);r=Math.max(1,r),n=Math.max(1,n);const c=1/n;return 1/(i.Cartesian3.dot(s,o)*c-i.Cartesian3.magnitude(i.Cartesian3.cross(s,o,s))*(Math.sqrt(r-1)*c))}function M(t,e,o){if(!(e<=0||e===1/0||e!=e))return i.Cartesian3.multiplyByScalar(t,e,o)}const T=new i.Cartesian3;function P(t,e){return i.Cartesian3.equals(e,i.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,T),i.Cartesian3.normalize(T,T))}const b={getHeight:function(t,e,i){return(t-i)*e+i}},z=new i.Cartesian3;b.getPosition=function(t,e,o,a,r){const n=e.cartesianToCartographic(t,z),s=b.getHeight(n.height,o,a);return i.Cartesian3.fromRadians(n.longitude,n.latitude,s,e,r)};var _=b;var E=Object.freeze({NONE:0,BITS12:1});const H=new i.Cartesian3,w=new i.Cartesian3,A=new a.Cartesian2,I=new a.Matrix4,V=new a.Matrix4,q=Math.pow(2,12);function G(t,e,r,n,s,c,u,d,l,m){let h,f,p=E.NONE;if(o.defined(e)&&o.defined(r)&&o.defined(n)&&o.defined(s)){const t=e.minimum,o=e.maximum,c=i.Cartesian3.subtract(o,t,w),u=n-r;p=Math.max(i.Cartesian3.maximumComponent(c),u)<q-1?E.BITS12:E.NONE,h=a.Matrix4.inverseTransformation(s,new a.Matrix4);const d=i.Cartesian3.negate(t,H);a.Matrix4.multiply(a.Matrix4.fromTranslation(d,I),h,h);const l=H;l.x=1/c.x,l.y=1/c.y,l.z=1/c.z,a.Matrix4.multiply(a.Matrix4.fromScale(l,I),h,h),f=a.Matrix4.clone(s),a.Matrix4.setTranslation(f,i.Cartesian3.ZERO,f),s=a.Matrix4.clone(s,new a.Matrix4);const m=a.Matrix4.fromTranslation(t,I),x=a.Matrix4.fromScale(c,V),S=a.Matrix4.multiply(m,x,I);a.Matrix4.multiply(s,S,s),a.Matrix4.multiply(f,S,f)}this.quantization=p,this.minimumHeight=r,this.maximumHeight=n,this.center=i.Cartesian3.clone(t),this.toScaledENU=h,this.fromScaledENU=s,this.matrix=f,this.hasVertexNormals=c,this.hasWebMercatorT=o.defaultValue(u,!1),this.hasGeodeticSurfaceNormals=o.defaultValue(d,!1),this.exaggeration=o.defaultValue(l,1),this.exaggerationRelativeHeight=o.defaultValue(m,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}G.prototype.encode=function(t,e,o,n,c,u,d,l){const m=n.x,h=n.y;if(this.quantization===E.BITS12){(o=a.Matrix4.multiplyByPoint(this.toScaledENU,o,H)).x=s.CesiumMath.clamp(o.x,0,1),o.y=s.CesiumMath.clamp(o.y,0,1),o.z=s.CesiumMath.clamp(o.z,0,1);const i=this.maximumHeight-this.minimumHeight,n=s.CesiumMath.clamp((c-this.minimumHeight)/i,0,1);a.Cartesian2.fromElements(o.x,o.y,A);const u=r.AttributeCompression.compressTextureCoordinates(A);a.Cartesian2.fromElements(o.z,n,A);const l=r.AttributeCompression.compressTextureCoordinates(A);a.Cartesian2.fromElements(m,h,A);const f=r.AttributeCompression.compressTextureCoordinates(A);if(t[e++]=u,t[e++]=l,t[e++]=f,this.hasWebMercatorT){a.Cartesian2.fromElements(d,0,A);const i=r.AttributeCompression.compressTextureCoordinates(A);t[e++]=i}}else i.Cartesian3.subtract(o,this.center,H),t[e++]=H.x,t[e++]=H.y,t[e++]=H.z,t[e++]=c,t[e++]=m,t[e++]=h,this.hasWebMercatorT&&(t[e++]=d);return this.hasVertexNormals&&(t[e++]=r.AttributeCompression.octPackFloat(u)),this.hasGeodeticSurfaceNormals&&(t[e++]=l.x,t[e++]=l.y,t[e++]=l.z),e};const O=new i.Cartesian3,B=new i.Cartesian3;G.prototype.addGeodeticSurfaceNormals=function(t,e,i){if(this.hasGeodeticSurfaceNormals)return;const o=this.stride,a=t.length/o;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();const r=this.stride;for(let n=0;n<a;n++){for(let i=0;i<o;i++){const a=n*o+i;e[n*r+i]=t[a]}const a=this.decodePosition(e,n,O),s=i.geodeticSurfaceNormal(a,B),c=n*r+this._offsetGeodeticSurfaceNormal;e[c]=s.x,e[c+1]=s.y,e[c+2]=s.z}},G.prototype.removeGeodeticSurfaceNormals=function(t,e){if(!this.hasGeodeticSurfaceNormals)return;const i=this.stride,o=t.length/i;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();const a=this.stride;for(let r=0;r<o;r++)for(let o=0;o<a;o++){const n=r*i+o;e[r*a+o]=t[n]}},G.prototype.decodePosition=function(t,e,n){if(o.defined(n)||(n=new i.Cartesian3),e*=this.stride,this.quantization===E.BITS12){const i=r.AttributeCompression.decompressTextureCoordinates(t[e],A);n.x=i.x,n.y=i.y;const o=r.AttributeCompression.decompressTextureCoordinates(t[e+1],A);return n.z=o.x,a.Matrix4.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[e],n.y=t[e+1],n.z=t[e+2],i.Cartesian3.add(n,this.center,n)},G.prototype.getExaggeratedPosition=function(t,e,i){i=this.decodePosition(t,e,i);const o=this.exaggeration,a=this.exaggerationRelativeHeight;if(1!==o&&this.hasGeodeticSurfaceNormals){const r=this.decodeGeodeticSurfaceNormal(t,e,B),n=this.decodeHeight(t,e),s=_.getHeight(n,o,a)-n;i.x+=r.x*s,i.y+=r.y*s,i.z+=r.z*s}return i},G.prototype.decodeTextureCoordinates=function(t,e,i){return o.defined(i)||(i=new a.Cartesian2),e*=this.stride,this.quantization===E.BITS12?r.AttributeCompression.decompressTextureCoordinates(t[e+2],i):a.Cartesian2.fromElements(t[e+4],t[e+5],i)},G.prototype.decodeHeight=function(t,e){if(e*=this.stride,this.quantization===E.BITS12){return r.AttributeCompression.decompressTextureCoordinates(t[e+1],A).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[e+3]},G.prototype.decodeWebMercatorT=function(t,e){return e*=this.stride,this.quantization===E.BITS12?r.AttributeCompression.decompressTextureCoordinates(t[e+3],A).x:t[e+6]},G.prototype.getOctEncodedNormal=function(t,e,i){const o=t[e=e*this.stride+this._offsetVertexNormal]/256,r=Math.floor(o),n=256*(o-r);return a.Cartesian2.fromElements(r,n,i)},G.prototype.decodeGeodeticSurfaceNormal=function(t,e,i){return e=e*this.stride+this._offsetGeodeticSurfaceNormal,i.x=t[e],i.y=t[e+1],i.z=t[e+2],i},G.prototype._calculateStrideAndOffsets=function(){let t=0;if(this.quantization===E.BITS12)t+=3;else t+=6;this.hasWebMercatorT&&(t+=1),this.hasVertexNormals&&(this._offsetVertexNormal=t,t+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=t,t+=3),this.stride=t};const R={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},U={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};G.prototype.getAttributes=function(t){const e=n.ComponentDatatype.FLOAT,i=n.ComponentDatatype.getSizeInBytes(e),o=this.stride*i;let a=0;const r=[];function s(n,s){r.push({index:n,vertexBuffer:t,componentDatatype:e,componentsPerAttribute:s,offsetInBytes:a,strideInBytes:o}),a+=s*i}if(this.quantization===E.NONE){s(R.position3DAndHeight,4);let t=2;t+=this.hasWebMercatorT?1:0,t+=this.hasVertexNormals?1:0,s(R.textureCoordAndEncodedNormals,t),this.hasGeodeticSurfaceNormals&&s(R.geodeticSurfaceNormal,3)}else{const t=this.hasWebMercatorT||this.hasVertexNormals,e=this.hasWebMercatorT&&this.hasVertexNormals;s(U.compressed0,t?4:3),e&&s(U.compressed1,1),this.hasGeodeticSurfaceNormals&&s(U.geodeticSurfaceNormal,3)}return r},G.prototype.getAttributeLocations=function(){return this.quantization===E.NONE?R:U},G.clone=function(t,e){if(o.defined(t))return o.defined(e)||(e=new G),e.quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=i.Cartesian3.clone(t.center),e.toScaledENU=a.Matrix4.clone(t.toScaledENU),e.fromScaledENU=a.Matrix4.clone(t.fromScaledENU),e.matrix=a.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e.hasGeodeticSurfaceNormals=t.hasGeodeticSurfaceNormals,e.exaggeration=t.exaggeration,e.exaggerationRelativeHeight=t.exaggerationRelativeHeight,e._calculateStrideAndOffsets(),e},t.EllipsoidalOccluder=c,t.TerrainEncoding=G})); diff --git a/public/lib/Cesium/Workers/Transforms-b3716b06.js b/public/lib/Cesium/Workers/Transforms-b3716b06.js deleted file mode 100644 index fede6c33..00000000 --- a/public/lib/Cesium/Workers/Transforms-b3716b06.js +++ /dev/null @@ -1,14 +0,0 @@ -define(["require","exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./Matrix2-413c4048","./combine-0c102d93","./RuntimeError-9b4ce3fb"],(function(e,t,n,r,o,i,s,a){"use strict";function u(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}function c(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}r.defined(Object.create)&&(c.prototype=Object.create(Error.prototype),c.prototype.constructor=c),c.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return r.defined(this.stack)&&(e+=`\n${this.stack.toString()}`),e},c.throwInstantiationError=function(){throw new c("This function defines an interface and should not be called directly.")};const l={};function d(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}l.typeOf={},l.defined=function(e,t){if(!r.defined(t))throw new c(function(e){return`${e} is required, actual value was undefined`}(e))},l.typeOf.func=function(e,t){if("function"!=typeof t)throw new c(d(typeof t,"function",e))},l.typeOf.string=function(e,t){if("string"!=typeof t)throw new c(d(typeof t,"string",e))},l.typeOf.number=function(e,t){if("number"!=typeof t)throw new c(d(typeof t,"number",e))},l.typeOf.number.lessThan=function(e,t,n){if(l.typeOf.number(e,t),t>=n)throw new c(`Expected ${e} to be less than ${n}, actual value was ${t}`)},l.typeOf.number.lessThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),t>n)throw new c(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},l.typeOf.number.greaterThan=function(e,t,n){if(l.typeOf.number(e,t),t<=n)throw new c(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},l.typeOf.number.greaterThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),t<n)throw new c(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},l.typeOf.object=function(e,t){if("object"!=typeof t)throw new c(d(typeof t,"object",e))},l.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new c(d(typeof t,"boolean",e))},l.typeOf.bigint=function(e,t){if("bigint"!=typeof t)throw new c(d(typeof t,"bigint",e))},l.typeOf.number.equals=function(e,t,n,r){if(l.typeOf.number(e,n),l.typeOf.number(t,r),n!==r)throw new c(`${e} must be equal to ${t}, the actual values are ${n} and ${r}`)};var f=l,p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){this._ellipsoid=r.defaultValue(e,n.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),h.prototype.project=function(e,t){const o=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;return r.defined(t)?(t.x=i,t.y=s,t.z=a,t):new n.Cartesian3(i,s,a)},h.prototype.unproject=function(e,t){const o=this._oneOverSemimajorAxis,i=e.x*o,s=e.y*o,a=e.z;return r.defined(t)?(t.longitude=i,t.latitude=s,t.height=a,t):new n.Cartographic(i,s,a)};var m=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function g(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}function y(e,t){this.center=n.Cartesian3.clone(r.defaultValue(e,n.Cartesian3.ZERO)),this.radius=r.defaultValue(t,0)}const v=new n.Cartesian3,w=new n.Cartesian3,C=new n.Cartesian3,_=new n.Cartesian3,b=new n.Cartesian3,x=new n.Cartesian3,S=new n.Cartesian3,A=new n.Cartesian3,E=new n.Cartesian3,O=new n.Cartesian3,I=new n.Cartesian3,P=new n.Cartesian3,R=4/3*o.CesiumMath.PI;y.fromPoints=function(e,t){if(r.defined(t)||(t=new y),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=n.Cartesian3.clone(e[0],S),i=n.Cartesian3.clone(o,v),s=n.Cartesian3.clone(o,w),a=n.Cartesian3.clone(o,C),u=n.Cartesian3.clone(o,_),c=n.Cartesian3.clone(o,b),l=n.Cartesian3.clone(o,x),d=e.length;let f;for(f=1;f<d;f++){n.Cartesian3.clone(e[f],o);const t=o.x,r=o.y,d=o.z;t<i.x&&n.Cartesian3.clone(o,i),t>u.x&&n.Cartesian3.clone(o,u),r<s.y&&n.Cartesian3.clone(o,s),r>c.y&&n.Cartesian3.clone(o,c),d<a.z&&n.Cartesian3.clone(o,a),d>l.z&&n.Cartesian3.clone(o,l)}const p=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(u,i,A)),h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,A)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A));let g=i,R=u,T=p;h>T&&(T=h,g=s,R=c),m>T&&(T=m,g=a,R=l);const q=E;q.x=.5*(g.x+R.x),q.y=.5*(g.y+R.y),q.z=.5*(g.z+R.z);let z=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(R,q,A)),M=Math.sqrt(z);const D=O;D.x=i.x,D.y=s.y,D.z=a.z;const U=I;U.x=u.x,U.y=c.y,U.z=l.z;const k=n.Cartesian3.midpoint(D,U,P);let F=0;for(f=0;f<d;f++){n.Cartesian3.clone(e[f],o);const t=n.Cartesian3.magnitude(n.Cartesian3.subtract(o,k,A));t>F&&(F=t);const r=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(o,q,A));if(r>z){const e=Math.sqrt(r);M=.5*(M+e),z=M*M;const t=e-M;q.x=(M*q.x+t*o.x)/e,q.y=(M*q.y+t*o.y)/e,q.z=(M*q.z+t*o.z)/e}}return M<F?(n.Cartesian3.clone(q,t.center),t.radius=M):(n.Cartesian3.clone(k,t.center),t.radius=F),t};const T=new h,q=new n.Cartesian3,z=new n.Cartesian3,M=new n.Cartographic,D=new n.Cartographic;y.fromRectangle2D=function(e,t,n){return y.fromRectangleWithHeights2D(e,t,0,0,n)},y.fromRectangleWithHeights2D=function(e,t,o,s,a){if(r.defined(a)||(a=new y),!r.defined(e))return a.center=n.Cartesian3.clone(n.Cartesian3.ZERO,a.center),a.radius=0,a;t=r.defaultValue(t,T),i.Rectangle.southwest(e,M),M.height=o,i.Rectangle.northeast(e,D),D.height=s;const u=t.project(M,q),c=t.project(D,z),l=c.x-u.x,d=c.y-u.y,f=c.z-u.z;a.radius=.5*Math.sqrt(l*l+d*d+f*f);const p=a.center;return p.x=u.x+.5*l,p.y=u.y+.5*d,p.z=u.z+.5*f,a};const U=[];y.fromRectangle3D=function(e,t,o,s){if(t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,0),r.defined(s)||(s=new y),!r.defined(e))return s.center=n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=0,s;const a=i.Rectangle.subsample(e,t,o,U);return y.fromPoints(a,s)},y.fromVertices=function(e,t,o,i){if(r.defined(i)||(i=new y),!r.defined(e)||0===e.length)return i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i.radius=0,i;t=r.defaultValue(t,n.Cartesian3.ZERO),o=r.defaultValue(o,3);const s=S;s.x=e[0]+t.x,s.y=e[1]+t.y,s.z=e[2]+t.z;const a=n.Cartesian3.clone(s,v),u=n.Cartesian3.clone(s,w),c=n.Cartesian3.clone(s,C),l=n.Cartesian3.clone(s,_),d=n.Cartesian3.clone(s,b),f=n.Cartesian3.clone(s,x),p=e.length;let h;for(h=0;h<p;h+=o){const r=e[h]+t.x,o=e[h+1]+t.y,i=e[h+2]+t.z;s.x=r,s.y=o,s.z=i,r<a.x&&n.Cartesian3.clone(s,a),r>l.x&&n.Cartesian3.clone(s,l),o<u.y&&n.Cartesian3.clone(s,u),o>d.y&&n.Cartesian3.clone(s,d),i<c.z&&n.Cartesian3.clone(s,c),i>f.z&&n.Cartesian3.clone(s,f)}const m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A)),g=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,A)),R=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(f,c,A));let T=a,q=l,z=m;g>z&&(z=g,T=u,q=d),R>z&&(z=R,T=c,q=f);const M=E;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(q,M,A)),U=Math.sqrt(D);const k=O;k.x=a.x,k.y=u.y,k.z=c.z;const F=I;F.x=l.x,F.y=d.y,F.z=f.z;const N=n.Cartesian3.midpoint(k,F,P);let j=0;for(h=0;h<p;h+=o){s.x=e[h]+t.x,s.y=e[h+1]+t.y,s.z=e[h+2]+t.z;const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(s,N,A));r>j&&(j=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(s,M,A));if(o>D){const e=Math.sqrt(o);U=.5*(U+e),D=U*U;const t=e-U;M.x=(U*M.x+t*s.x)/e,M.y=(U*M.y+t*s.y)/e,M.z=(U*M.z+t*s.z)/e}}return U<j?(n.Cartesian3.clone(M,i.center),i.radius=U):(n.Cartesian3.clone(N,i.center),i.radius=j),i},y.fromEncodedCartesianVertices=function(e,t,o){if(r.defined(o)||(o=new y),!r.defined(e)||!r.defined(t)||e.length!==t.length||0===e.length)return o.center=n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=0,o;const i=S;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const s=n.Cartesian3.clone(i,v),a=n.Cartesian3.clone(i,w),u=n.Cartesian3.clone(i,C),c=n.Cartesian3.clone(i,_),l=n.Cartesian3.clone(i,b),d=n.Cartesian3.clone(i,x),f=e.length;let p;for(p=0;p<f;p+=3){const r=e[p]+t[p],o=e[p+1]+t[p+1],f=e[p+2]+t[p+2];i.x=r,i.y=o,i.z=f,r<s.x&&n.Cartesian3.clone(i,s),r>c.x&&n.Cartesian3.clone(i,c),o<a.y&&n.Cartesian3.clone(i,a),o>l.y&&n.Cartesian3.clone(i,l),f<u.z&&n.Cartesian3.clone(i,u),f>d.z&&n.Cartesian3.clone(i,d)}const h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,A)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,A)),g=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,A));let R=s,T=c,q=h;m>q&&(q=m,R=a,T=l),g>q&&(q=g,R=u,T=d);const z=E;z.x=.5*(R.x+T.x),z.y=.5*(R.y+T.y),z.z=.5*(R.z+T.z);let M=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(T,z,A)),D=Math.sqrt(M);const U=O;U.x=s.x,U.y=a.y,U.z=u.z;const k=I;k.x=c.x,k.y=l.y,k.z=d.z;const F=n.Cartesian3.midpoint(U,k,P);let N=0;for(p=0;p<f;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(i,F,A));r>N&&(N=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(i,z,A));if(o>M){const e=Math.sqrt(o);D=.5*(D+e),M=D*D;const t=e-D;z.x=(D*z.x+t*i.x)/e,z.y=(D*z.y+t*i.y)/e,z.z=(D*z.z+t*i.z)/e}}return D<N?(n.Cartesian3.clone(z,o.center),o.radius=D):(n.Cartesian3.clone(F,o.center),o.radius=N),o},y.fromCornerPoints=function(e,t,o){r.defined(o)||(o=new y);const i=n.Cartesian3.midpoint(e,t,o.center);return o.radius=n.Cartesian3.distance(i,t),o},y.fromEllipsoid=function(e,t){return r.defined(t)||(t=new y),n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};const k=new n.Cartesian3;y.fromBoundingSpheres=function(e,t){if(r.defined(t)||(t=new y),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=e.length;if(1===o)return y.clone(e[0],t);if(2===o)return y.union(e[0],e[1],t);const i=[];let s;for(s=0;s<o;s++)i.push(e[s].center);const a=(t=y.fromPoints(i,t)).center;let u=t.radius;for(s=0;s<o;s++){const t=e[s];u=Math.max(u,n.Cartesian3.distance(a,t.center,k)+t.radius)}return t.radius=u,t};const F=new n.Cartesian3,N=new n.Cartesian3,j=new n.Cartesian3;y.fromOrientedBoundingBox=function(e,t){r.defined(t)||(t=new y);const o=e.halfAxes,i=n.Matrix3.getColumn(o,0,F),s=n.Matrix3.getColumn(o,1,N),a=n.Matrix3.getColumn(o,2,j);return n.Cartesian3.add(i,s,i),n.Cartesian3.add(i,a,i),t.center=n.Cartesian3.clone(e.center,t.center),t.radius=n.Cartesian3.magnitude(i),t};const B=new n.Cartesian3,V=new n.Cartesian3;y.fromTransformation=function(e,t){r.defined(t)||(t=new y);const o=i.Matrix4.getTranslation(e,B),s=i.Matrix4.getScale(e,V),a=.5*n.Cartesian3.magnitude(s);return t.center=n.Cartesian3.clone(o,t.center),t.radius=a,t},y.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.center=n.Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new y(e.center,e.radius)},y.packedLength=4,y.pack=function(e,t,n){n=r.defaultValue(n,0);const o=e.center;return t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius,t},y.unpack=function(e,t,n){t=r.defaultValue(t,0),r.defined(n)||(n=new y);const o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};const $=new n.Cartesian3,L=new n.Cartesian3;y.union=function(e,t,o){r.defined(o)||(o=new y);const i=e.center,s=e.radius,a=t.center,u=t.radius,c=n.Cartesian3.subtract(a,i,$),l=n.Cartesian3.magnitude(c);if(s>=l+u)return e.clone(o),o;if(u>=l+s)return t.clone(o),o;const d=.5*(s+l+u),f=n.Cartesian3.multiplyByScalar(c,(-s+d)/l,L);return n.Cartesian3.add(f,i,f),n.Cartesian3.clone(f,o.center),o.radius=d,o};const Q=new n.Cartesian3;y.expand=function(e,t,r){r=y.clone(e,r);const o=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r.center,Q));return o>r.radius&&(r.radius=o),r},y.intersectPlane=function(e,t){const r=e.center,o=e.radius,i=t.normal,s=n.Cartesian3.dot(i,r)+t.distance;return s<-o?m.OUTSIDE:s<o?m.INTERSECTING:m.INSIDE},y.transform=function(e,t,n){return r.defined(n)||(n=new y),n.center=i.Matrix4.multiplyByPoint(t,e.center,n.center),n.radius=i.Matrix4.getMaximumScale(t)*e.radius,n};const W=new n.Cartesian3;y.distanceSquaredTo=function(e,t){const r=n.Cartesian3.subtract(e.center,t,W),o=n.Cartesian3.magnitude(r)-e.radius;return o<=0?0:o*o},y.transformWithoutScale=function(e,t,n){return r.defined(n)||(n=new y),n.center=i.Matrix4.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const H=new n.Cartesian3;y.computePlaneDistances=function(e,t,o,i){r.defined(i)||(i=new g);const s=n.Cartesian3.subtract(e.center,t,H),a=n.Cartesian3.dot(o,s);return i.start=a-e.radius,i.stop=a+e.radius,i};const Y=new n.Cartesian3,Z=new n.Cartesian3,J=new n.Cartesian3,X=new n.Cartesian3,G=new n.Cartesian3,K=new n.Cartographic,ee=new Array(8);for(let e=0;e<8;++e)ee[e]=new n.Cartesian3;const te=new h;let ne;y.projectTo2D=function(e,t,o){const i=(t=r.defaultValue(t,te)).ellipsoid;let s=e.center;const a=e.radius;let u;u=n.Cartesian3.equals(s,n.Cartesian3.ZERO)?n.Cartesian3.clone(n.Cartesian3.UNIT_X,Y):i.geodeticSurfaceNormal(s,Y);const c=n.Cartesian3.cross(n.Cartesian3.UNIT_Z,u,Z);n.Cartesian3.normalize(c,c);const l=n.Cartesian3.cross(u,c,J);n.Cartesian3.normalize(l,l),n.Cartesian3.multiplyByScalar(u,a,u),n.Cartesian3.multiplyByScalar(l,a,l),n.Cartesian3.multiplyByScalar(c,a,c);const d=n.Cartesian3.negate(l,G),f=n.Cartesian3.negate(c,X),p=ee;let h=p[0];n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[1],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[2],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[3],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h),n.Cartesian3.negate(u,u),h=p[4],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[5],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[6],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[7],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h);const m=p.length;for(let e=0;e<m;++e){const r=p[e];n.Cartesian3.add(s,r,r);const o=i.cartesianToCartographic(r,K);t.project(o,r)}s=(o=y.fromPoints(p,o)).center;const g=s.x,v=s.y,w=s.z;return s.x=w,s.y=g,s.z=v,o},y.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},y.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&n.Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},y.prototype.intersectPlane=function(e){return y.intersectPlane(this,e)},y.prototype.distanceSquaredTo=function(e){return y.distanceSquaredTo(this,e)},y.prototype.computePlaneDistances=function(e,t,n){return y.computePlaneDistances(this,e,t,n)},y.prototype.isOccluded=function(e){return y.isOccluded(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.volume=function(){const e=this.radius;return R*e*e*e};const re={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},oe={};Object.defineProperties(oe,{element:{get:function(){if(oe.supportsFullscreen())return document[re.fullscreenElement]}},changeEventName:{get:function(){if(oe.supportsFullscreen())return re.fullscreenchange}},errorEventName:{get:function(){if(oe.supportsFullscreen())return re.fullscreenerror}},enabled:{get:function(){if(oe.supportsFullscreen())return document[re.fullscreenEnabled]}},fullscreen:{get:function(){if(oe.supportsFullscreen())return null!==oe.element}}}),oe.supportsFullscreen=function(){if(r.defined(ne))return ne;ne=!1;const e=document.body;if("function"==typeof e.requestFullscreen)return re.requestFullscreen="requestFullscreen",re.exitFullscreen="exitFullscreen",re.fullscreenEnabled="fullscreenEnabled",re.fullscreenElement="fullscreenElement",re.fullscreenchange="fullscreenchange",re.fullscreenerror="fullscreenerror",ne=!0,ne;const t=["webkit","moz","o","ms","khtml"];let n;for(let r=0,o=t.length;r<o;++r){const o=t[r];n=`${o}RequestFullscreen`,"function"==typeof e[n]?(re.requestFullscreen=n,ne=!0):(n=`${o}RequestFullScreen`,"function"==typeof e[n]&&(re.requestFullscreen=n,ne=!0)),n=`${o}ExitFullscreen`,"function"==typeof document[n]?re.exitFullscreen=n:(n=`${o}CancelFullScreen`,"function"==typeof document[n]&&(re.exitFullscreen=n)),n=`${o}FullscreenEnabled`,void 0!==document[n]?re.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,void 0!==document[n]&&(re.fullscreenEnabled=n)),n=`${o}FullscreenElement`,void 0!==document[n]?re.fullscreenElement=n:(n=`${o}FullScreenElement`,void 0!==document[n]&&(re.fullscreenElement=n)),n=`${o}fullscreenchange`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenChange"),re.fullscreenchange=n),n=`${o}fullscreenerror`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenError"),re.fullscreenerror=n)}return ne},oe.requestFullscreen=function(e,t){oe.supportsFullscreen()&&e[re.requestFullscreen]({vrDisplay:t})},oe.exitFullscreen=function(){oe.supportsFullscreen()&&document[re.exitFullscreen]()},oe._names=re;var ie=oe;let se,ae,ue,ce,le,de,fe,pe,he,me,ge,ye,ve,we,Ce,_e,be,xe;function Se(e){const t=e.split(".");for(let e=0,n=t.length;e<n;++e)t[e]=parseInt(t[e],10);return t}function Ae(){if(!r.defined(ae)&&(ae=!1,!Pe())){const e=/ Chrome\/([\.0-9]+)/.exec(se.userAgent);null!==e&&(ae=!0,ue=Se(e[1]))}return ae}function Ee(){if(!r.defined(ce)&&(ce=!1,!Ae()&&!Pe()&&/ Safari\/[\.0-9]+/.test(se.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(se.userAgent);null!==e&&(ce=!0,le=Se(e[1]))}return ce}function Oe(){if(!r.defined(de)){de=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(se.userAgent);null!==e&&(de=!0,fe=Se(e[1]),fe.isNightly=!!e[2])}return de}function Ie(){if(!r.defined(pe)){let e;pe=!1,"Microsoft Internet Explorer"===se.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(se.userAgent),null!==e&&(pe=!0,he=Se(e[1]))):"Netscape"===se.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(se.userAgent),null!==e&&(pe=!0,he=Se(e[1])))}return pe}function Pe(){if(!r.defined(me)){me=!1;const e=/ Edg\/([\.0-9]+)/.exec(se.userAgent);null!==e&&(me=!0,ge=Se(e[1]))}return me}function Re(){if(!r.defined(ye)){ye=!1;const e=/Firefox\/([\.0-9]+)/.exec(se.userAgent);null!==e&&(ye=!0,ve=Se(e[1]))}return ye}function Te(){if(!r.defined(xe)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;xe=r.defined(t)&&""!==t,xe&&(be=t)}return xe}function qe(){return qe._result}se="undefined"!=typeof navigator?navigator:{},qe._promise=void 0,qe._result=void 0,qe.initialize=function(){return r.defined(qe._promise)||(qe._promise=new Promise((e=>{const t=new Image;t.onload=function(){qe._result=t.width>0&&t.height>0,e(qe._result)},t.onerror=function(){qe._result=!1,e(qe._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}))),qe._promise},Object.defineProperties(qe,{initialized:{get:function(){return r.defined(qe._result)}}});const ze=[];"undefined"!=typeof ArrayBuffer&&(ze.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&ze.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&ze.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&ze.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&ze.push(BigUint64Array));const Me={isChrome:Ae,chromeVersion:function(){return Ae()&&ue},isSafari:Ee,safariVersion:function(){return Ee()&&le},isWebkit:Oe,webkitVersion:function(){return Oe()&&fe},isInternetExplorer:Ie,internetExplorerVersion:function(){return Ie()&&he},isEdge:Pe,edgeVersion:function(){return Pe()&&ge},isFirefox:Re,firefoxVersion:function(){return Re()&&ve},isWindows:function(){return r.defined(we)||(we=/Windows/i.test(se.appVersion)),we},isIPadOrIOS:function(){return r.defined(Ce)||(Ce="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),Ce},hardwareConcurrency:r.defaultValue(se.hardwareConcurrency,3),supportsPointerEvents:function(){return r.defined(_e)||(_e=!Re()&&"undefined"!=typeof PointerEvent&&(!r.defined(se.pointerEnabled)||se.pointerEnabled)),_e},supportsImageRenderingPixelated:Te,supportsWebP:qe,imageRenderingValue:function(){return Te()?be:void 0},typedArrayTypes:ze,supportsBasis:function(e){return Me.supportsWebAssembly()&&e.context.supportsBasis},supportsFullscreen:function(){return ie.supportsFullscreen()},supportsTypedArrays:function(){return"undefined"!=typeof ArrayBuffer},supportsBigInt64Array:function(){return"undefined"!=typeof BigInt64Array},supportsBigUint64Array:function(){return"undefined"!=typeof BigUint64Array},supportsBigInt:function(){return"undefined"!=typeof BigInt},supportsWebWorkers:function(){return"undefined"!=typeof Worker},supportsWebAssembly:function(){return"undefined"!=typeof WebAssembly},supportsWebgl2:function(e){return e.context.webgl2}};var De=Me;function Ue(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}let ke=new n.Cartesian3;Ue.fromAxisAngle=function(e,t,o){const i=t/2,s=Math.sin(i);ke=n.Cartesian3.normalize(e,ke);const a=ke.x*s,u=ke.y*s,c=ke.z*s,l=Math.cos(i);return r.defined(o)?(o.x=a,o.y=u,o.z=c,o.w=l,o):new Ue(a,u,c,l)};const Fe=[1,2,0],Ne=new Array(3);Ue.fromRotationMatrix=function(e,t){let o,i,s,a,u;const c=e[n.Matrix3.COLUMN0ROW0],l=e[n.Matrix3.COLUMN1ROW1],d=e[n.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)o=Math.sqrt(f+1),u=.5*o,o=.5/o,i=(e[n.Matrix3.COLUMN1ROW2]-e[n.Matrix3.COLUMN2ROW1])*o,s=(e[n.Matrix3.COLUMN2ROW0]-e[n.Matrix3.COLUMN0ROW2])*o,a=(e[n.Matrix3.COLUMN0ROW1]-e[n.Matrix3.COLUMN1ROW0])*o;else{const t=Fe;let r=0;l>c&&(r=1),d>c&&d>l&&(r=2);const f=t[r],p=t[f];o=Math.sqrt(e[n.Matrix3.getElementIndex(r,r)]-e[n.Matrix3.getElementIndex(f,f)]-e[n.Matrix3.getElementIndex(p,p)]+1);const h=Ne;h[r]=.5*o,o=.5/o,u=(e[n.Matrix3.getElementIndex(p,f)]-e[n.Matrix3.getElementIndex(f,p)])*o,h[f]=(e[n.Matrix3.getElementIndex(f,r)]+e[n.Matrix3.getElementIndex(r,f)])*o,h[p]=(e[n.Matrix3.getElementIndex(p,r)]+e[n.Matrix3.getElementIndex(r,p)])*o,i=-h[0],s=-h[1],a=-h[2]}return r.defined(t)?(t.x=i,t.y=s,t.z=a,t.w=u,t):new Ue(i,s,a,u)};const je=new Ue;let Be=new Ue,Ve=new Ue,$e=new Ue;Ue.fromHeadingPitchRoll=function(e,t){return $e=Ue.fromAxisAngle(n.Cartesian3.UNIT_X,e.roll,je),Ve=Ue.fromAxisAngle(n.Cartesian3.UNIT_Y,-e.pitch,t),t=Ue.multiply(Ve,$e,Ve),Be=Ue.fromAxisAngle(n.Cartesian3.UNIT_Z,-e.heading,je),Ue.multiply(Be,t,t)};const Le=new n.Cartesian3,Qe=new n.Cartesian3,We=new Ue,He=new Ue,Ye=new Ue;Ue.packedLength=4,Ue.pack=function(e,t,n){return n=r.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Ue.unpack=function(e,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new Ue),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},Ue.packedInterpolationLength=3,Ue.convertPackedArrayForInterpolation=function(e,t,n,o){Ue.unpack(e,4*n,Ye),Ue.conjugate(Ye,Ye);for(let i=0,s=n-t+1;i<s;i++){const n=3*i;Ue.unpack(e,4*(t+i),We),Ue.multiply(We,Ye,We),We.w<0&&Ue.negate(We,We),Ue.computeAxis(We,Le);const s=Ue.computeAngle(We);r.defined(o)||(o=[]),o[n]=Le.x*s,o[n+1]=Le.y*s,o[n+2]=Le.z*s}},Ue.unpackInterpolationResult=function(e,t,o,i,s){r.defined(s)||(s=new Ue),n.Cartesian3.fromArray(e,0,Qe);const a=n.Cartesian3.magnitude(Qe);return Ue.unpack(t,4*i,He),0===a?Ue.clone(Ue.IDENTITY,We):Ue.fromAxisAngle(Qe,a,We),Ue.multiply(We,He,s)},Ue.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Ue(e.x,e.y,e.z,e.w)},Ue.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},Ue.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Ue.magnitude=function(e){return Math.sqrt(Ue.magnitudeSquared(e))},Ue.normalize=function(e,t){const n=1/Ue.magnitude(e),r=e.x*n,o=e.y*n,i=e.z*n,s=e.w*n;return t.x=r,t.y=o,t.z=i,t.w=s,t},Ue.inverse=function(e,t){const n=Ue.magnitudeSquared(e);return t=Ue.conjugate(e,t),Ue.multiplyByScalar(t,1/n,t)},Ue.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},Ue.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},Ue.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Ue.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Ue.multiply=function(e,t,n){const r=e.x,o=e.y,i=e.z,s=e.w,a=t.x,u=t.y,c=t.z,l=t.w,d=s*a+r*l+o*c-i*u,f=s*u-r*c+o*l+i*a,p=s*c+r*u-o*a+i*l,h=s*l-r*a-o*u-i*c;return n.x=d,n.y=f,n.z=p,n.w=h,n},Ue.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},Ue.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},Ue.computeAxis=function(e,t){const n=e.w;if(Math.abs(n-1)<o.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;const r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},Ue.computeAngle=function(e){return Math.abs(e.w-1)<o.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};let Ze=new Ue;Ue.lerp=function(e,t,n,r){return Ze=Ue.multiplyByScalar(t,n,Ze),r=Ue.multiplyByScalar(e,1-n,r),Ue.add(Ze,r,r)};let Je=new Ue,Xe=new Ue,Ge=new Ue;Ue.slerp=function(e,t,n,r){let i=Ue.dot(e,t),s=t;if(i<0&&(i=-i,s=Je=Ue.negate(t,Je)),1-i<o.CesiumMath.EPSILON6)return Ue.lerp(e,s,n,r);const a=Math.acos(i);return Xe=Ue.multiplyByScalar(e,Math.sin((1-n)*a),Xe),Ge=Ue.multiplyByScalar(s,Math.sin(n*a),Ge),r=Ue.add(Xe,Ge,r),Ue.multiplyByScalar(r,1/Math.sin(a),r)},Ue.log=function(e,t){const r=o.CesiumMath.acosClamped(e.w);let i=0;return 0!==r&&(i=r/Math.sin(r)),n.Cartesian3.multiplyByScalar(e,i,t)},Ue.exp=function(e,t){const r=n.Cartesian3.magnitude(e);let o=0;return 0!==r&&(o=Math.sin(r)/r),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(r),t};const Ke=new n.Cartesian3,et=new n.Cartesian3,tt=new Ue,nt=new Ue;Ue.computeInnerQuadrangle=function(e,t,r,o){const i=Ue.conjugate(t,tt);Ue.multiply(i,r,nt);const s=Ue.log(nt,Ke);Ue.multiply(i,e,nt);const a=Ue.log(nt,et);return n.Cartesian3.add(s,a,s),n.Cartesian3.multiplyByScalar(s,.25,s),n.Cartesian3.negate(s,s),Ue.exp(s,tt),Ue.multiply(t,tt,o)},Ue.squad=function(e,t,n,r,o,i){const s=Ue.slerp(e,t,o,tt),a=Ue.slerp(n,r,o,nt);return Ue.slerp(s,a,2*o*(1-o),i)};const rt=new Ue,ot=1.9011074535173003,it=De.supportsTypedArrays()?new Float32Array(8):[],st=De.supportsTypedArrays()?new Float32Array(8):[],at=De.supportsTypedArrays()?new Float32Array(8):[],ut=De.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;it[e]=1/(t*n),st[e]=t/n}function ct(e,t,n){let r,o,i=0,s=e.length-1;for(;i<=s;)if(r=~~((i+s)/2),o=n(e[r],t),o<0)i=r+1;else{if(!(o>0))return r;s=r-1}return~(s+1)}function lt(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function dt(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function ft(e){return e%4==0&&e%100!=0||e%400==0}function pt(e,t){this.julianDate=e,this.offset=t}it[7]=ot/136,st[7]=8*ot/17,Ue.fastSlerp=function(e,t,n,r){let o,i=Ue.dot(e,t);i>=0?o=1:(o=-1,i=-i);const s=i-1,a=1-n,u=n*n,c=a*a;for(let e=7;e>=0;--e)at[e]=(it[e]*u-st[e])*s,ut[e]=(it[e]*c-st[e])*s;const l=o*n*(1+at[0]*(1+at[1]*(1+at[2]*(1+at[3]*(1+at[4]*(1+at[5]*(1+at[6]*(1+at[7])))))))),d=a*(1+ut[0]*(1+ut[1]*(1+ut[2]*(1+ut[3]*(1+ut[4]*(1+ut[5]*(1+ut[6]*(1+ut[7])))))))),f=Ue.multiplyByScalar(e,d,rt);return Ue.multiplyByScalar(t,l,r),Ue.add(f,r,r)},Ue.fastSquad=function(e,t,n,r,o,i){const s=Ue.fastSlerp(e,t,o,tt),a=Ue.fastSlerp(n,r,o,nt);return Ue.fastSlerp(s,a,2*o*(1-o),i)},Ue.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Ue.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},Ue.ZERO=Object.freeze(new Ue(0,0,0,0)),Ue.IDENTITY=Object.freeze(new Ue(0,0,0,1)),Ue.prototype.clone=function(e){return Ue.clone(this,e)},Ue.prototype.equals=function(e){return Ue.equals(this,e)},Ue.prototype.equalsEpsilon=function(e,t){return Ue.equalsEpsilon(this,e,t)},Ue.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ht=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5});var mt=Object.freeze({UTC:0,TAI:1});const gt=new dt,yt=[31,28,31,30,31,30,31,31,30,31,30,31];function vt(e,t){return zt.compare(e.julianDate,t.julianDate)}const wt=new pt;function Ct(e){wt.julianDate=e;const t=zt.leapSeconds;let n=ct(t,wt,vt);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){zt.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}zt.addSeconds(e,r,e)}function _t(e,t){wt.julianDate=e;const n=zt.leapSeconds;let r=ct(n,wt,vt);if(r<0&&(r=~r),0===r)return zt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return zt.addSeconds(e,-n[r-1].offset,t);const o=zt.secondsDifference(n[r].julianDate,e);return 0===o?zt.addSeconds(e,-n[r].offset,t):o<=1?void 0:zt.addSeconds(e,-n[--r].offset,t)}function bt(e,t,n){const r=t/ht.SECONDS_PER_DAY|0;return e+=r,(t-=ht.SECONDS_PER_DAY*r)<0&&(e--,t+=ht.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function xt(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);const l=i+(r*ht.SECONDS_PER_HOUR+o*ht.SECONDS_PER_MINUTE+s*ht.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const St=/^(\d{4})$/,At=/^(\d{4})-(\d{2})$/,Et=/^(\d{4})-?(\d{3})$/,Ot=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,It=/^(\d{4})-?(\d{2})-?(\d{2})$/,Pt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Rt=/^(\d{2})(\.\d+)?/.source+Pt.source,Tt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Pt.source,qt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Pt.source;function zt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,mt.UTC);const o=0|e;bt(o,t+=(e-o)*ht.SECONDS_PER_DAY,this),n===mt.UTC&&Ct(this)}zt.fromGregorianDate=function(e,t){const n=xt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(bt(n[0],n[1],t),Ct(t),t):new zt(n[0],n[1],mt.UTC)},zt.fromDate=function(e,t){const n=xt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(bt(n[0],n[1],t),Ct(t),t):new zt(n[0],n[1],mt.UTC)},zt.fromIso8601=function(e,t){let n,o=(e=e.replace(",",".")).split("T"),i=1,s=1,a=0,u=0,c=0,l=0;const d=o[0],f=o[1];let p,h,m;if(o=d.match(It),null!==o)n=+o[1],i=+o[2],s=+o[3];else if(o=d.match(At),null!==o)n=+o[1],i=+o[2];else if(o=d.match(St),null!==o)n=+o[1];else{let e;if(o=d.match(Et),null!==o)n=+o[1],e=+o[2],h=ft(n);else if(o=d.match(Ot),null!==o){n=+o[1];e=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),i=p.getUTCMonth()+1,s=p.getUTCDate()}if(h=ft(n),r.defined(f)){o=f.match(qt),null!==o?(a=+o[1],u=+o[2],c=+o[3],l=1e3*+(o[4]||0),m=5):(o=f.match(Tt),null!==o?(a=+o[1],u=+o[2],c=60*+(o[3]||0),m=4):(o=f.match(Rt),null!==o&&(a=+o[1],u=60*+(o[2]||0),m=3)));const e=o[m],t=+o[m+1],r=+(o[m+2]||0);switch(e){case"+":a-=t,u-=r;break;case"-":a+=t,u+=r;break;case"Z":break;default:u+=new Date(Date.UTC(n,i-1,s,a,u)).getTimezoneOffset()}}const g=60===c;for(g&&c--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,s++;for(p=h&&2===i?29:yt[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:yt[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)i--,i<1&&(i+=12,n--),p=h&&2===i?29:yt[i-1],s+=p;const y=xt(n,i,s,a,u,c,l);return r.defined(t)?(bt(y[0],y[1],t),Ct(t)):t=new zt(y[0],y[1],mt.UTC),g&&zt.addSeconds(t,1,t),t},zt.now=function(e){return zt.fromDate(new Date,e)};const Mt=new zt(0,0,mt.TAI);zt.toGregorianDate=function(e,t){let n=!1,o=_t(e,Mt);r.defined(o)||(zt.addSeconds(e,-1,Mt),o=_t(Mt,Mt),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let a=i+68569|0;const u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const l=80*a/2447|0,d=a-(2447*l/80|0)|0;a=l/11|0;const f=l+2-12*a|0,p=100*(u-49)+c+a|0;let h=s/ht.SECONDS_PER_HOUR|0,m=s-h*ht.SECONDS_PER_HOUR;const g=m/ht.SECONDS_PER_MINUTE|0;m-=g*ht.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/ht.SECONDS_PER_MILLISECOND;return h+=12,h>23&&(h-=24),n&&(y+=1),r.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=y,t.millisecond=v,t.isLeapSecond=n,t):new dt(p,f,d,h,g,y,v,n)},zt.toDate=function(e){const t=zt.toGregorianDate(e,gt);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},zt.toIso8601=function(e,t){const n=zt.toGregorianDate(e,gt);let o=n.year,i=n.month,s=n.day,a=n.hour;const u=n.minute,c=n.second,l=n.millisecond;let d;return 1e4===o&&1===i&&1===s&&0===a&&0===u&&0===c&&0===l&&(o=9999,i=12,s=31,a=24),r.defined(t)||0===l?r.defined(t)&&0!==t?(d=(.01*l).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*l).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},zt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new zt(e.dayNumber,e.secondsOfDay,mt.TAI)},zt.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},zt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},zt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(zt.secondsDifference(e,t))<=n},zt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ht.SECONDS_PER_DAY},zt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ht.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},zt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/ht.SECONDS_PER_DAY},zt.computeTaiMinusUtc=function(e){wt.julianDate=e;const t=zt.leapSeconds;let n=ct(t,wt,vt);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},zt.addSeconds=function(e,t,n){return bt(e.dayNumber,e.secondsOfDay+t,n)},zt.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*ht.SECONDS_PER_MINUTE;return bt(e.dayNumber,r,n)},zt.addHours=function(e,t,n){const r=e.secondsOfDay+t*ht.SECONDS_PER_HOUR;return bt(e.dayNumber,r,n)},zt.addDays=function(e,t,n){return bt(e.dayNumber+t,e.secondsOfDay,n)},zt.lessThan=function(e,t){return zt.compare(e,t)<0},zt.lessThanOrEquals=function(e,t){return zt.compare(e,t)<=0},zt.greaterThan=function(e,t){return zt.compare(e,t)>0},zt.greaterThanOrEquals=function(e,t){return zt.compare(e,t)>=0},zt.prototype.clone=function(e){return zt.clone(this,e)},zt.prototype.equals=function(e){return zt.equals(this,e)},zt.prototype.equalsEpsilon=function(e,t){return zt.equalsEpsilon(this,e,t)},zt.prototype.toString=function(){return zt.toIso8601(this)},zt.leapSeconds=[new pt(new zt(2441317,43210,mt.TAI),10),new pt(new zt(2441499,43211,mt.TAI),11),new pt(new zt(2441683,43212,mt.TAI),12),new pt(new zt(2442048,43213,mt.TAI),13),new pt(new zt(2442413,43214,mt.TAI),14),new pt(new zt(2442778,43215,mt.TAI),15),new pt(new zt(2443144,43216,mt.TAI),16),new pt(new zt(2443509,43217,mt.TAI),17),new pt(new zt(2443874,43218,mt.TAI),18),new pt(new zt(2444239,43219,mt.TAI),19),new pt(new zt(2444786,43220,mt.TAI),20),new pt(new zt(2445151,43221,mt.TAI),21),new pt(new zt(2445516,43222,mt.TAI),22),new pt(new zt(2446247,43223,mt.TAI),23),new pt(new zt(2447161,43224,mt.TAI),24),new pt(new zt(2447892,43225,mt.TAI),25),new pt(new zt(2448257,43226,mt.TAI),26),new pt(new zt(2448804,43227,mt.TAI),27),new pt(new zt(2449169,43228,mt.TAI),28),new pt(new zt(2449534,43229,mt.TAI),29),new pt(new zt(2450083,43230,mt.TAI),30),new pt(new zt(2450630,43231,mt.TAI),31),new pt(new zt(2451179,43232,mt.TAI),32),new pt(new zt(2453736,43233,mt.TAI),33),new pt(new zt(2454832,43234,mt.TAI),34),new pt(new zt(2456109,43235,mt.TAI),35),new pt(new zt(2457204,43236,mt.TAI),36),new pt(new zt(2457754,43237,mt.TAI),37)];var Dt,Ut={},kt={get exports(){return Ut},set exports(e){Ut=e}},Ft={},Nt={get exports(){return Ft},set exports(e){Ft=e}};var jt,Bt={},Vt={get exports(){return Bt},set exports(e){Bt=e}};var $t,Lt,Qt,Wt,Ht={},Yt={get exports(){return Ht},set exports(e){Ht=e}};Qt=p,Wt=function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1;if(!(this instanceof i))return n?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.10";var s=i.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function d(e,t){var n,r,o={};if("RegExp"===c(t))o=null;else if(l(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;else o[t]=!0;for(n=0,r=e.length;n<r;n++)(o&&void 0!==o[e[n]]||!o&&t.test(e[n]))&&(e.splice(n,1),r--,n--);return e}function f(e,t){var n,r;if(l(t)){for(n=0,r=t.length;n<r;n++)if(!f(e,t[n]))return!1;return!0}var o=c(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"==typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function p(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function h(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},w=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(e){return n}}};for(y in v)i[y+"PathSegment"]=w("pathname",v[y]),i[y+"UrnPathSegment"]=w("urnpath",v[y]);var C=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);return s.join(e)}};function _(e){return function(t,n){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}function b(e,t){return function(n,r){return void 0===n?this._parts[e]||"":(null!==n&&(n+="").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!r),this)}}i.decodePath=C("/","decodePathSegment"),i.decodeUrnPath=C(":","decodeUrnPathSegment"),i.recodePath=C("/","encodePathSegment","decode"),i.recodeUrnPath=C(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(e,t){var n;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(n=(e=e.replace(i.leading_whitespace_expression,"")).indexOf("#"))>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var n,r,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var n=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var r,o=e.indexOf("/"),s=e.lastIndexOf("@",o>-1?o:e.length-1);return s>-1&&(-1===o||s<o)?(r=e.substring(0,s).split(":"),t.username=r[0]?i.decode(r[0]):null,r.shift(),t.password=r[0]?i.decode(r.join(":")):null,e=n.substring(s+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var n,r,o,s={},u=e.split("&"),c=u.length,l=0;l<c;l++)n=u[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(a.call(s,r)?("string"!=typeof s[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);return s},i.build=function(e){var t="",n=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){var r,o,s,u,c="";for(o in e)if("__proto__"!==o&&a.call(e,o))if(l(e[o]))for(r={},s=0,u=e[o].length;s<u;s++)void 0!==e[o][s]&&void 0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));return c.substring(1)},i.buildQueryParameter=function(e,t,n){return i.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=n);"string"==typeof e[t]&&(e[t]=[e[t]]),l(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===n?null:n}},i.removeQuery=function(e,t,n){var r,o,s;if(l(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void 0;else if("RegExp"===c(t))for(s in e)t.test(s)&&(e[s]=void 0);else if("object"==typeof t)for(s in t)a.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===c(n)?!l(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=d(e[t],n):e[t]!==String(n)||l(n)&&1!==n.length?l(e[t])&&(e[t]=d(e[t],n)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,n,r){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(a.call(e,o)&&t.test(o)&&(void 0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(var s in t)if(a.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(n)){case"Undefined":return t in e;case"Boolean":return n===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!n(e[t],t,e);case"Array":return!!l(e[t])&&(r?f:p)(e[t],n);case"RegExp":return l(e[t])?!!r&&f(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":return l(e[t])?!!r&&f(e[t],n):e[t]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],n=0,r=0;r<arguments.length;r++){var o=new i(arguments[r]);e.push(o);for(var s=o.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});var r=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(r.lastIndex=0;;){var c=r.exec(e);if(!c)break;var l=c.index;if(n.ignoreHtml){var d=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}for(var f=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;;){var m=a.exec(p);if(!m)break;var g=m.index+m[0].length;h=Math.max(h,g)}if(!((p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){var y=t(p,l,f=l+p.length,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=r||o))&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+u(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(l(t)){s=[];for(var a=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(h(t[a])))}else(t||"string"==typeof t)&&(t=h(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));else t?s[e]=h(t):s.splice(e,1);return i&&s.unshift(""),this.path(s.join(r),n)},s.segmentCoded=function(e,t,n){var r,o,s;if("number"!=typeof e&&(n=t,t=e,e=void 0),void 0===t){if(l(r=this.segment(e,t,n)))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);else r=void 0!==r?i.decode(r):void 0;return r}if(l(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,n)};var E=s.query;return s.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);return this._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},s.setQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)a.call(e,o)&&(r[o]=e[o])}return this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.addQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(r,e,void 0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.removeQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.hasQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(r,e,t,n)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(n){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},s.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var r,o,s="";for("/"!==(n=i.recodePath(n)).charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"")&&(s=s[0]);-1!==(r=n.search(/\/\.\.(\/|$)/));)0!==r?(-1===(o=n.substring(0,r).lastIndexOf("/"))&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3);return t&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.unicode=function(){var e=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.readable=function(){var t=this.clone();t.username("").password("").normalize();var n="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(var r="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){var u=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}return n+=i.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){var t,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},s.relativeTo=function(e){var t,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==s.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==n.hostname||t.port!==n.port)return a.build();if(t.hostname=null,t.port=null,o===s)return t.path="",a.build();if(!(r=i.commonPath(o,s)))return a.build();var u=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(r.length)||"./",a.build()},s.equals=function(e){var t,n,r,o,s,u=this.clone(),c=new i(e),d={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(r=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(r.length!==o.length)return!1;for(s in t=i.parseQuery(r,this._parts.escapeQuerySpace),n=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,s)){if(l(t[s])){if(!p(t[s],n[s]))return!1}else if(t[s]!==n[s])return!1;d[s]=!0}for(s in n)if(a.call(n,s)&&!d[s])return!1;return!0},s.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i},( -/*! - * URI.js - Mutating URLs - * - * Version: 1.19.10 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -Lt=kt).exports?Lt.exports=Wt((Dt||(Dt=1,function(e,t){!function(n){var r=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,i="object"==typeof p&&p;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var s,a,u=2147483647,c=36,l=1,d=26,f=38,h=700,m=72,g=128,y="-",v=/^xn--/,w=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=c-l,x=Math.floor,S=String.fromCharCode;function A(e){throw new RangeError(_[e])}function E(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function O(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+E((e=e.replace(C,".")).split("."),t).join(".")}function I(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function P(e){return E(e,(function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+S(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>b*d>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+f))}function q(e){var t,n,r,o,i,s,a,f,p,h,v,w=[],C=e.length,_=0,b=g,S=m;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&A("not-basic"),w.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<C;){for(i=_,s=1,a=c;o>=C&&A("invalid-input"),((f=(v=e.charCodeAt(o++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||f>x((u-_)/s))&&A("overflow"),_+=f*s,!(f<(p=a<=S?l:a>=S+d?d:a-S));a+=c)s>x(u/(h=c-p))&&A("overflow"),s*=h;S=T(_-i,t=w.length+1,0==i),x(_/t)>u-b&&A("overflow"),b+=x(_/t),_%=t,w.splice(_++,0,b)}return P(w)}function z(e){var t,n,r,o,i,s,a,f,p,h,v,w,C,_,b,E=[];for(w=(e=I(e)).length,t=g,n=0,i=m,s=0;s<w;++s)(v=e[s])<128&&E.push(S(v));for(r=o=E.length,o&&E.push(y);r<w;){for(a=u,s=0;s<w;++s)(v=e[s])>=t&&v<a&&(a=v);for(a-t>x((u-n)/(C=r+1))&&A("overflow"),n+=(a-t)*C,t=a,s=0;s<w;++s)if((v=e[s])<t&&++n>u&&A("overflow"),v==t){for(f=n,p=c;!(f<(h=p<=i?l:p>=i+d?d:p-i));p+=c)b=f-h,_=c-h,E.push(S(R(h+b%_,0))),f=x(b/_);E.push(S(R(f,0))),i=T(n,C,r==o),n=0,++r}++n,++t}return E.join("")}if(s={version:"1.3.2",ucs2:{decode:I,encode:P},decode:q,encode:z,toASCII:function(e){return O(e,(function(e){return w.test(e)?"xn--"+z(e):e}))},toUnicode:function(e){return O(e,(function(e){return v.test(e)?q(e.slice(4).toLowerCase()):e}))}},r&&o)if(e.exports==r)o.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else n.punycode=s}(p)}(Nt,Ft)),Ft),function(){return jt||(jt=1,t=p,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(":"),o=r.length,i=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[o-1]&&""===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==r[t];t++);if(t<i)for(r.splice(t,1,"0000");r.length<i;)r.splice(t,0,"0000");for(var s=0;s<i;s++){n=r[s].split("");for(var a=0;a<3&&"0"===n[0]&&n.length>1;a++)n.splice(0,1);r[s]=n.join("")}var u=-1,c=0,l=0,d=-1,f=!1;for(s=0;s<i;s++)f?"0"===r[s]?l+=1:(f=!1,l>c&&(u=d,c=l)):"0"===r[s]&&(f=!0,d=s,l=1);l>c&&(u=d,c=l),c>1&&r.splice(u,c,""),o=r.length;var p="";for(""===r[0]&&(p=":"),s=0;s<o&&(p+=r[s],s!==o-1);s++)p+=":";return""===r[o-1]&&(p+=":"),p},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}},(e=Vt).exports?e.exports=n():t.IPv6=n(t)),Bt;var e,t,n}(),function(){return $t||($t=1,t=p,n=function(e){var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n},(e=Yt).exports?e.exports=n():t.SecondLevelDomains=n(t)),Ht;var e,t,n}()):Qt.URI=Wt(Qt.punycode,Qt.IPv6,Qt.SecondLevelDomains,Qt);var Zt=Ut;function Jt(e,t){if(null===e||"object"!=typeof e)return e;t=r.defaultValue(t,!1);const n=new e.constructor;for(const r in e)if(e.hasOwnProperty(r)){let o=e[r];t&&(o=Jt(o,t)),n[r]=o}return n}function Xt(){let e,t;const n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}function Gt(e,t){let n;return"undefined"!=typeof document&&(n=document),Gt._implementation(e,t,n)}Gt._implementation=function(e,t,n){if(!r.defined(t)){if(void 0===n)return e;t=r.defaultValue(n.baseURI,n.location.href)}const o=new Zt(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};const Kt={};function en(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);let o=Kt[t];r.defined(o)||(o={},Kt[t]=o);let i=o[n];if(!r.defined(i)){const e=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const tn=/^blob:/i;function nn(e){return tn.test(e)}let rn;const on=/^data:/i;function sn(e){return on.test(e)}var an=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});var un=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function cn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,un.OTHER),this.serverKey=e.serverKey,this.state=an.UNISSUED,this.deferred=void 0,this.cancelled=!1}function ln(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){const t={};if(!e)return t;const n=e.split("\r\n");for(let e=0;e<n.length;++e){const r=n[e],o=r.indexOf(": ");if(o>0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function dn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function fn(e,t){return t-e}function pn(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function hn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}cn.prototype.cancel=function(){this.cancelled=!0},cn.prototype.clone=function(e){return r.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=an.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new cn(this)},ln.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(dn.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),dn.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},dn.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i<n.length;i++)if(n[i]===e&&r[i]===t){o=i;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,r[o]=void 0):(n.splice(o,1),r.splice(o,1)),!0)},dn.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const o=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(fn),e=0;e<o;e++){const r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(pn.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){const t=this._length;if(e<t){const n=this._array;for(let r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),pn.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},pn.prototype.heapify=function(e){e=r.defaultValue(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;for(;s;){const r=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(hn(o,i,e),e=i):s=!1}},pn.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},pn.prototype.insert=function(e){const t=this._array,n=this._comparator,o=this._maximumLength;let i,s=this._length++;for(s<t.length?t[s]=e:t.push(e);0!==s;){const e=Math.floor((s-1)/2);if(!(n(t[s],t[e])<0))break;hn(t,s,e),s=e}return r.defined(o)&&this._length>o&&(i=t[o],this._length=o),i},pn.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return hn(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const mn={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let gn=20;const yn=new pn({comparator:function(e,t){return e.priority-t.priority}});yn.maximumLength=gn,yn.reserve(gn);const vn=[];let wn={};const Cn="undefined"!=typeof document?new Zt(document.location.href):new Zt,_n=new dn;function bn(){}function xn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Sn(e){return e.state===an.UNISSUED&&(e.state=an.ISSUED,e.deferred=Xt()),e.deferred.promise}function An(e){const t=Sn(e);return e.state=an.ACTIVE,vn.push(e),++mn.numberOfActiveRequests,++mn.numberOfActiveRequestsEver,++wn[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===an.CANCELLED)return;const n=e.deferred;--mn.numberOfActiveRequests,--wn[e.serverKey],_n.raiseEvent(),e.state=an.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).catch(function(e){return function(t){e.state!==an.CANCELLED&&(++mn.numberOfFailedRequests,--mn.numberOfActiveRequests,--wn[e.serverKey],_n.raiseEvent(t),e.state=an.FAILED,e.deferred.reject(t))}}(e)),t}function En(e){const t=e.state===an.ACTIVE;if(e.state=an.CANCELLED,++mn.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--mn.numberOfActiveRequests,--wn[e.serverKey],++mn.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}bn.maximumRequests=50,bn.maximumRequestsPerServer=6,bn.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18},bn.throttleRequests=!0,bn.debugShowStatistics=!1,bn.requestCompletedEvent=_n,Object.defineProperties(bn,{statistics:{get:function(){return mn}},priorityHeapLength:{get:function(){return gn},set:function(e){if(e<gn)for(;yn.length>e;){En(yn.pop())}gn=e,yn.maximumLength=e,yn.reserve(e)}}}),bn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(bn.requestsByServer[e],bn.maximumRequestsPerServer);return wn[e]+t<=n},bn.heapHasOpenSlots=function(e){return yn.length+e<=gn},bn.update=function(){let e,t,n=0;const r=vn.length;for(e=0;e<r;++e)t=vn[e],t.cancelled&&En(t),t.state===an.ACTIVE?n>0&&(vn[e-n]=t):++n;vn.length-=n;const o=yn.internalArray,i=yn.length;for(e=0;e<i;++e)xn(o[e]);yn.resort();const s=Math.max(bn.maximumRequests-vn.length,0);let a=0;for(;a<s&&yn.length>0;)t=yn.pop(),t.cancelled?En(t):!t.throttleByServer||bn.serverHasOpenSlots(t.serverKey)?(An(t),++a):En(t);!function(){if(!bn.debugShowStatistics)return;0===mn.numberOfActiveRequests&&mn.lastNumberOfActiveRequests>0&&(mn.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${mn.numberOfAttemptedRequests}`),mn.numberOfAttemptedRequests=0),mn.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${mn.numberOfCancelledRequests}`),mn.numberOfCancelledRequests=0),mn.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${mn.numberOfCancelledActiveRequests}`),mn.numberOfCancelledActiveRequests=0),mn.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${mn.numberOfFailedRequests}`),mn.numberOfFailedRequests=0));mn.lastNumberOfActiveRequests=mn.numberOfActiveRequests}()},bn.getServerKey=function(e){let t=new Zt(e);""===t.scheme()&&(t=t.absoluteTo(Cn),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const o=wn[n];return r.defined(o)||(wn[n]=0),n},bn.request=function(e){if(sn(e.url)||nn(e.url))return _n.raiseEvent(),e.state=an.RECEIVED,e.requestFunction();if(++mn.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=bn.getServerKey(e.url)),bn.throttleRequests&&e.throttleByServer&&!bn.serverHasOpenSlots(e.serverKey))return;if(!bn.throttleRequests||!e.throttle)return An(e);if(vn.length>=bn.maximumRequests)return;xn(e);const t=yn.insert(e);if(r.defined(t)){if(t===e)return;En(t)}return Sn(e)},bn.clearForSpecs=function(){for(;yn.length>0;){En(yn.pop())}const e=vn.length;for(let t=0;t<e;++t)En(vn[t]);vn.length=0,wn={},mn.numberOfAttemptedRequests=0,mn.numberOfActiveRequests=0,mn.numberOfCancelledRequests=0,mn.numberOfCancelledActiveRequests=0,mn.numberOfFailedRequests=0,mn.numberOfActiveRequestsEver=0,mn.lastNumberOfActiveRequests=0},bn.numberOfActiveRequestsByServer=function(e){return wn[e]},bn.requestHeap=yn;const On={};let In={};On.add=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(In[n])||(In[n]=!0)},On.remove=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(In[n])&&delete In[n]},On.contains=function(e){const t=function(e){const t=new Zt(e);t.normalize();let n=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){const e=n.split("@");n=e[1]}if(-1===n.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}return n}}(e);return!(!r.defined(t)||!r.defined(In[t]))},On.clear=function(){In={}};var Pn=On;const Rn=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function Tn(e){"string"==typeof(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=qn(e.templateValues,{}),this._queryParameters=qn(e.queryParameters,{}),this.headers=qn(e.headers,{}),this.request=r.defaultValue(e.request,new cn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;r.defaultValue(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url}function qn(e,t){return r.defined(e)?Jt(e):t}let zn;function Mn(e,t,n){if(!n)return s.combine(e,t);const o=Jt(e,!0);for(const e in t)if(t.hasOwnProperty(e)){let n=o[e];const i=t[e];r.defined(n)?(Array.isArray(n)||(n=o[e]=[n]),o[e]=n.concat(i)):o[e]=Array.isArray(i)?i.slice():i}return o}function Dn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);const r=Xt();return Tn._Implementations.createImage(s,e,r,n,o,i),r.promise};const a=bn.request(s);if(r.defined(a))return a.catch((function(e){return s.state!==an.FAILED?Promise.reject(e):t.retryOnError(e).then((function(r){return r?(s.state=an.UNISSUED,s.deferred=void 0,Dn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(e)}))}))}function Un(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request,s=e.url;i.url=s,i.requestFunction=function(){const e=Xt();return window[n]=function(t){e.resolve(t);try{delete window[n]}catch(e){window[n]=void 0}},Tn._Implementations.loadAndExecuteScript(s,n,e),e.promise};const a=bn.request(i);if(r.defined(a))return a.catch((function(r){return i.state!==an.FAILED?Promise.reject(r):e.retryOnError(r).then((function(o){return o?(i.state=an.UNISSUED,i.deferred=void 0,Un(e,t,n)):Promise.reject(r)}))}))}function kn(e){if(e.state===an.ISSUED||e.state===an.ACTIVE)throw new a.RuntimeError("The Resource is already being fetched.");e.state=an.UNISSUED,e.deferred=void 0}Tn.createIfNeeded=function(e){return e instanceof Tn?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Tn({url:e})},Tn.supportsImageBitmapOptions=function(){if(r.defined(zn))return zn;if("function"!=typeof createImageBitmap)return zn=Promise.resolve(!1),zn;return zn=Tn.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){return Promise.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){const t=en(e[0]),n=en(e[1]);return t[1]!==n[1]})).catch((function(){return!1})),zn},Object.defineProperties(Tn,{isBlobSupported:{get:function(){return Rn}}}),Object.defineProperties(Tn.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return function(e){const t=new Zt(e);t.normalize();let n=t.path(),r=n.lastIndexOf("/");return-1!==r&&(n=n.substr(r+1)),r=n.lastIndexOf("."),n=-1===r?"":n.substr(r+1),n}(this._url)}},isDataUri:{get:function(){return sn(this._url)}},isBlobUri:{get:function(){return nn(this._url)}},isCrossOriginUrl:{get:function(){return function(e){r.defined(rn)||(rn=document.createElement("a")),rn.href=window.location.href;const t=rn.host,n=rn.protocol;return rn.href=e,rn.href=rn.href,n!==rn.protocol||t!==rn.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),Tn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},Tn.prototype.parseUrl=function(e,t,n,o){let i=new Zt(e);const s=function(e){if(0===e.length)return{};if(-1===e.indexOf("="))return{[e]:void 0};return function(e){const t={};if(""===e)return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,o=n.length;e<o;++e){const o=n[e].split("="),i=decodeURIComponent(o[0]);let s=o[1];s=r.defined(s)?decodeURIComponent(s):"";const a=t[i];"string"==typeof a?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}return t}(e)}(i.query());this._queryParameters=t?Mn(s,this.queryParameters,n):s,i.search(""),i.fragment(""),r.defined(o)&&""===i.scheme()&&(i=i.absoluteTo(Gt(o))),this._url=i.toString()},Tn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${function(e){const t=Object.keys(e);if(0===t.length)return"";if(1===t.length&&!r.defined(e[t[0]]))return`?${t[0]}`;return`?${function(e){let t="";for(const n in e)if(e.hasOwnProperty(n)){const r=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(let e=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;else t+=`${o+encodeURIComponent(r)}&`}return t=t.slice(0,-1),t}(e)}`}(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,(function(e,t){const n=o[t];return r.defined(n)?encodeURIComponent(n):e}))),t&&r.defined(this.proxy)&&(n=this.proxy.getURL(n)),n},Tn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Mn(this._queryParameters,e,!1):Mn(e,this._queryParameters,!1)},Tn.prototype.appendQueryParameters=function(e){this._queryParameters=Mn(e,this._queryParameters,!0)},Tn.prototype.setTemplateValues=function(e,t){this._templateValues=t?s.combine(this._templateValues,e):s.combine(e,this._templateValues)},Tn.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=r.defaultValue(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return r.defined(e.queryParameters)&&(t._queryParameters=s.combine(e.queryParameters,t.queryParameters)),r.defined(e.templateValues)&&(t._templateValues=s.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=s.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},Tn.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},Tn.prototype.clone=function(e){return r.defined(e)?(e._url=this._url,e._queryParameters=Jt(this._queryParameters),e._templateValues=Jt(this._templateValues),e.headers=Jt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Tn({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1})},Tn.prototype.getBaseUri=function(e){return function(e,t){let n="";const r=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=new Zt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},Tn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},Tn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Tn.fetchArrayBuffer=function(e){return new Tn(e).fetchArrayBuffer()},Tn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Tn.fetchBlob=function(e){return new Tn(e).fetchBlob()},Tn.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(kn(this.request),!Rn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Dn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return Tn.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return Tn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new Tn({url:t}),Dn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},Tn.fetchImage=function(e){return new Tn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Tn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Tn.fetchText=function(e){return new Tn(e).fetchText()},Tn.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))return e.then((function(e){if(r.defined(e))return JSON.parse(e)}))},Tn.fetchJson=function(e){return new Tn(e).fetchJson()},Tn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Tn.fetchXML=function(e){return new Tn(e).fetchXML()},Tn.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),kn(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return Un(this,e,t)},Tn.fetchJsonp=function(e){return new Tn(e).fetchJsonp(e.callbackParameterName)},Tn.prototype._makeRequest=function(e){const t=this;kn(t.request);const n=t.request,o=t.url;n.url=o,n.requestFunction=function(){const i=e.responseType,a=s.combine(e.headers,t.headers),u=e.overrideMimeType,c=e.method,l=e.data,d=Xt(),f=Tn._Implementations.loadWithXhr(o,i,c,l,a,d,u);return r.defined(f)&&r.defined(f.abort)&&(n.cancelFunction=function(){f.abort()}),d.promise};const i=bn.request(n);if(r.defined(i))return i.then((function(e){return n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==an.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=an.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const Fn=/^data:(.*?)(;base64)?,(.*)$/;function Nn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function jn(e,t){const n=Nn(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);return r}function Bn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Tn.prototype.fetch=function(e){return(e=qn(e,{})).method="GET",this._makeRequest(e)},Tn.fetch=function(e){return new Tn(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.delete=function(e){return(e=qn(e,{})).method="DELETE",this._makeRequest(e)},Tn.delete=function(e){return new Tn(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Tn.prototype.head=function(e){return(e=qn(e,{})).method="HEAD",this._makeRequest(e)},Tn.head=function(e){return new Tn(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.options=function(e){return(e=qn(e,{})).method="OPTIONS",this._makeRequest(e)},Tn.options=function(e){return new Tn(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.post=function(e,t){return f.defined("data",e),(t=qn(t,{})).method="POST",t.data=e,this._makeRequest(t)},Tn.post=function(e){return new Tn(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.put=function(e,t){return f.defined("data",e),(t=qn(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Tn.put=function(e){return new Tn(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.patch=function(e,t){return f.defined("data",e),(t=qn(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Tn.patch=function(e){return new Tn(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn._Implementations={},Tn._Implementations.loadImageElement=function(e,t,n){const r=new Image;r.onload=function(){0===r.naturalWidth&&0===r.naturalHeight&&0===r.width&&0===r.height&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(Pn.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},Tn._Implementations.createImage=function(e,t,n,o,i,s){const u=e.url;Tn.supportsImageBitmapOptions().then((function(c){if(!c||!s)return void Tn._Implementations.loadImageElement(u,t,n);const l=Xt(),d=Tn._Implementations.loadWithXhr(u,"blob","GET",void 0,void 0,l,void 0,void 0,void 0);return r.defined(d)&&r.defined(d.abort)&&(e.cancelFunction=function(){d.abort()}),l.promise.then((function(e){if(r.defined(e))return Tn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});n.reject(new a.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then((function(e){n.resolve(e)}))})).catch((function(e){n.reject(e)}))},Tn.createImageBitmapFromBlob=function(e,t){return f.defined("options",t),f.typeOf.bool("options.flipY",t.flipY),f.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),f.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};const Vn="undefined"==typeof XMLHttpRequest;function $n(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data)?Qn(this,e.data):Qn(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function Ln(e,t){return zt.compare(e.julianDate,t)}function Qn(e,t){if(!r.defined(t.columnNames))throw new a.RuntimeError("Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))throw new a.RuntimeError("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),u=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||u<0||c<0||l<0)throw new a.RuntimeError("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const d=e._samples=t.samples,f=e._dates=[];let p;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=u,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;const h=e._addNewLeapSeconds;for(let t=0,o=d.length;t<o;t+=e._columnCount){const e=d[t+n],o=d[t+l],i=new zt(e+ht.MODIFIED_JULIAN_DATE_DIFFERENCE,o,mt.TAI);if(f.push(i),h){if(o!==p&&r.defined(p)){const e=zt.leapSeconds,t=ct(e,i,Ln);if(t<0){const n=new pt(i,o);e.splice(~t,0,n)}}p=o}}}function Wn(e,t,n,r,o){const i=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function Hn(e,t,n){return t+e*(n-t)}function Yn(e,t,n,r,o,i,s){const a=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return Wn(e,n,o,a,s),s;if(r.equals(c))return Wn(e,n,i,a,s),s;const l=zt.secondsDifference(r,u)/zt.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=Hn(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=Hn(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Hn(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Hn(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Hn(l,p,h),s}function Zn(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}Tn._Implementations.loadWithXhr=function(t,n,o,i,s,c,l){const d=Fn.exec(t);if(null!==d)return void c.resolve(function(e,t){t=r.defaultValue(t,"");const n=e[1],o=!!e[2],i=e[3];let s,a;switch(t){case"":case"text":return Nn(o,i);case"arraybuffer":return jn(o,i);case"blob":return s=jn(o,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(Nn(o,i),n);case"json":return JSON.parse(Nn(o,i))}}(d,n));if(Vn)return void function(t,n,r,o,i,s,c){let l,d;Promise.all([new Promise((function(t,n){e(["url"],(function(e){t(u(e))}),n)})),new Promise((function(t,n){e(["zlib"],(function(e){t(u(e))}),n)}))]).then((([n,r])=>(l=n.parse(t),d=r,"https:"===l.protocol?new Promise((function(t,n){e(["https"],(function(e){t(u(e))}),n)})):new Promise((function(t,n){e(["http"],(function(e){t(u(e))}),n)}))))).then((e=>{const t={protocol:l.protocol,hostname:l.hostname,port:l.port,path:l.path,query:l.query,method:r,headers:i};e.request(t).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new ln(e.statusCode,e,e.headers));const t=[];e.on("data",(function(e){t.push(e)})),e.on("end",(function(){const r=Buffer.concat(t);"gzip"===e.headers["content-encoding"]?d.gunzip(r,(function(e,t){e?s.reject(new a.RuntimeError("Error decompressing response.")):s.resolve(Bn(t,n))})):s.resolve(Bn(r,n))}))})).on("error",(function(e){s.reject(new ln)})).end()}))}(t,n,o,0,s,c);const f=new XMLHttpRequest;if(Pn.contains(t)&&(f.withCredentials=!0),f.open(o,t,!0),r.defined(l)&&r.defined(f.overrideMimeType)&&f.overrideMimeType(l),r.defined(s))for(const e in s)s.hasOwnProperty(e)&&f.setRequestHeader(e,s[e]);r.defined(n)&&(f.responseType=n);let p=!1;return"string"==typeof t&&(p=0===t.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),f.onload=function(){if((f.status<200||f.status>=300)&&(!p||0!==f.status))return void c.reject(new ln(f.status,f.response,f.getAllResponseHeaders()));const e=f.response,t=f.responseType;if("HEAD"===o||"OPTIONS"===o){const e=f.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void c.resolve(t)}if(204===f.status)c.resolve();else if(!r.defined(e)||r.defined(n)&&t!==n)if("json"===n&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===t||"document"===t)&&r.defined(f.responseXML)&&f.responseXML.hasChildNodes()?c.resolve(f.responseXML):""!==t&&"text"!==t||!r.defined(f.responseText)?c.reject(new a.RuntimeError("Invalid XMLHttpRequest response type.")):c.resolve(f.responseText);else c.resolve(e)},f.onerror=function(e){c.reject(new ln)},f.send(i),f},Tn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise(((e,n)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),e()},t.onerror=function(e){n(e)},r.appendChild(t)}))}(e).catch((function(e){n.reject(e)}))},Tn._DefaultImplementations={},Tn._DefaultImplementations.createImage=Tn._Implementations.createImage,Tn._DefaultImplementations.loadWithXhr=Tn._Implementations.loadWithXhr,Tn._DefaultImplementations.loadAndExecuteScript=Tn._Implementations.loadAndExecuteScript,Tn.DEFAULT=Object.freeze(new Tn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),$n.fromUrl=async function(e,t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT);const n=Tn.createIfNeeded(e);let o;try{o=await n.fetchJson()}catch(e){throw new a.RuntimeError(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new $n({addNewLeapSeconds:t.addNewLeapSeconds,data:o})},$n.NONE=Object.freeze({compute:function(e,t){return r.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new lt(0,0,0,0,0),t}}),$n.prototype.compute=function(e,t){if(!r.defined(this._samples))return;if(r.defined(t)||(t=new lt(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,o=this._lastIndex;let i=0,s=0;if(r.defined(o)){const a=n[o],u=n[o+1],c=zt.lessThanOrEquals(a,e),l=!r.defined(u),d=l||zt.greaterThanOrEquals(u,e);if(c&&d)return i=o,!l&&u.equals(e)&&++i,s=i+1,Yn(this,n,this._samples,e,i,s,t),t}let a=ct(n,e,zt.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,i=a,s=a):(s=~a,i=s-1,i<0&&(i=0)),this._lastIndex=i,Yn(this,n,this._samples,e,i,s,t),t},Zn.fromQuaternion=function(e,t){r.defined(t)||(t=new Zn);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),s=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(u,a),t.roll=Math.atan2(s,i),t.pitch=-o.CesiumMath.asinClamped(n),t},Zn.fromDegrees=function(e,t,n,i){return r.defined(i)||(i=new Zn),i.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,i.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,i.roll=n*o.CesiumMath.RADIANS_PER_DEGREE,i},Zn.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Zn(e.heading,e.pitch,e.roll)},Zn.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},Zn.equalsEpsilon=function(e,t,n,i){return e===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},Zn.prototype.clone=function(e){return Zn.clone(this,e)},Zn.prototype.equals=function(e){return Zn.equals(this,e)},Zn.prototype.equalsEpsilon=function(e,t,n){return Zn.equalsEpsilon(this,e,t,n)},Zn.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Jn=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;let Xn,Gn,Kn;function er(e){return"undefined"==typeof document?e:(r.defined(Xn)||(Xn=document.createElement("a")),Xn.href=e,Xn.href=Xn.href,Xn.href)}function tr(){if(r.defined(Gn))return Gn;let t;return t="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?Gt("..",or("Core/buildModuleUrl.js")):function(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const n=e[t].getAttribute("src"),r=Jn.exec(n);if(null!==r)return r[1]}}(),Gn=new Tn({url:er(t)}),Gn.appendForwardSlash(),Gn}function nr(t){return er(e.toUrl(`../${t}`))}function rr(e){return tr().getDerivedResource({url:e}).url}function or(t){r.defined(Kn)||(Kn="object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?nr:rr);return Kn(t)}function ir(e,t,n){this.x=e,this.y=t,this.s=n}function sr(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=Tn.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new zt(this._sampleZeroJulianEphemerisDate,0,mt.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){n[e]=i,o[e]=e*this._stepSizeDays;for(let r=0;r<=t;++r)r!==e&&(n[e]*=e-r);n[e]=1/n[e]}this._work=new Array(t+1),this._coef=new Array(t+1)}or._cesiumScriptRegex=Jn,or._buildModuleUrlFromBaseUrl=rr,or._clearBaseResource=function(){Gn=void 0},or.setBaseUrl=function(e){Gn=Tn.DEFAULT.getDerivedResource({url:e})},or.getCesiumBaseUrl=tr;const ar=new zt(0,0,mt.TAI);function ur(e,t,n){const r=ar;return r.dayNumber=t,r.secondsOfDay=n,zt.daysDifference(r,e._sampleZeroDateTT)}function cr(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const o=e._xysFileUrlTemplate;n=r.defined(o)?o.getDerivedResource({templateValues:{0:t}}):new Tn({url:or(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const i=n.fetchJson().then((function(n){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,o=n.samples,i=t*e._samplesPerXysFile*3;for(let e=0,t=o.length;e<t;++e)r[i+e]=o[e]}));return e._chunkDownloadsInProgress[t]=i,i}sr.prototype.preload=function(e,t,n,r){const o=ur(this,e,t),i=ur(this,n,r);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=i/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let e=u;e<=c;++e)l.push(cr(this,e));return Promise.all(l)},sr.prototype.computeXysRadians=function(e,t,n){const o=ur(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(r.defined(l[3*a])||(cr(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(cr(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new ir(0,0,0);const d=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const lr={},dr={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},fr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},pr={},hr={east:new n.Cartesian3,north:new n.Cartesian3,up:new n.Cartesian3,west:new n.Cartesian3,south:new n.Cartesian3,down:new n.Cartesian3};let mr=new n.Cartesian3,gr=new n.Cartesian3,yr=new n.Cartesian3;lr.localFrameToFixedFrameGenerator=function(e,t){if(!dr.hasOwnProperty(e)||!dr[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");const s=dr[e][t];let a;const u=e+t;return r.defined(pr[u])?a=pr[u]:(a=function(a,u,c){if(r.defined(c)||(c=new i.Matrix4),n.Cartesian3.equalsEpsilon(a,n.Cartesian3.ZERO,o.CesiumMath.EPSILON14))n.Cartesian3.unpack(fr[e],0,mr),n.Cartesian3.unpack(fr[t],0,gr),n.Cartesian3.unpack(fr[s],0,yr);else if(o.CesiumMath.equalsEpsilon(a.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(a.y,0,o.CesiumMath.EPSILON14)){const r=o.CesiumMath.sign(a.z);n.Cartesian3.unpack(fr[e],0,mr),"east"!==e&&"west"!==e&&n.Cartesian3.multiplyByScalar(mr,r,mr),n.Cartesian3.unpack(fr[t],0,gr),"east"!==t&&"west"!==t&&n.Cartesian3.multiplyByScalar(gr,r,gr),n.Cartesian3.unpack(fr[s],0,yr),"east"!==s&&"west"!==s&&n.Cartesian3.multiplyByScalar(yr,r,yr)}else{(u=r.defaultValue(u,n.Ellipsoid.WGS84)).geodeticSurfaceNormal(a,hr.up);const o=hr.up,i=hr.east;i.x=-a.y,i.y=a.x,i.z=0,n.Cartesian3.normalize(i,hr.east),n.Cartesian3.cross(o,i,hr.north),n.Cartesian3.multiplyByScalar(hr.up,-1,hr.down),n.Cartesian3.multiplyByScalar(hr.east,-1,hr.west),n.Cartesian3.multiplyByScalar(hr.north,-1,hr.south),mr=hr[e],gr=hr[t],yr=hr[s]}return c[0]=mr.x,c[1]=mr.y,c[2]=mr.z,c[3]=0,c[4]=gr.x,c[5]=gr.y,c[6]=gr.z,c[7]=0,c[8]=yr.x,c[9]=yr.y,c[10]=yr.z,c[11]=0,c[12]=a.x,c[13]=a.y,c[14]=a.z,c[15]=1,c},pr[u]=a),a},lr.eastNorthUpToFixedFrame=lr.localFrameToFixedFrameGenerator("east","north"),lr.northEastDownToFixedFrame=lr.localFrameToFixedFrameGenerator("north","east"),lr.northUpEastToFixedFrame=lr.localFrameToFixedFrameGenerator("north","up"),lr.northWestUpToFixedFrame=lr.localFrameToFixedFrameGenerator("north","west");const vr=new Ue,wr=new n.Cartesian3(1,1,1),Cr=new i.Matrix4;lr.headingPitchRollToFixedFrame=function(e,t,o,s,a){s=r.defaultValue(s,lr.eastNorthUpToFixedFrame);const u=Ue.fromHeadingPitchRoll(t,vr),c=i.Matrix4.fromTranslationQuaternionRotationScale(n.Cartesian3.ZERO,u,wr,Cr);return a=s(e,o,a),i.Matrix4.multiply(a,c,a)};const _r=new i.Matrix4,br=new n.Matrix3;lr.headingPitchRollQuaternion=function(e,t,n,r,o){const s=lr.headingPitchRollToFixedFrame(e,t,n,r,_r),a=i.Matrix4.getMatrix3(s,br);return Ue.fromRotationMatrix(a,o)};const xr=new n.Cartesian3(1,1,1),Sr=new n.Cartesian3,Ar=new i.Matrix4,Er=new i.Matrix4,Or=new n.Matrix3,Ir=new Ue;lr.fixedFrameToHeadingPitchRoll=function(e,t,o,s){t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,lr.eastNorthUpToFixedFrame),r.defined(s)||(s=new Zn);const a=i.Matrix4.getTranslation(e,Sr);if(n.Cartesian3.equals(a,n.Cartesian3.ZERO))return s.heading=0,s.pitch=0,s.roll=0,s;let u=i.Matrix4.inverseTransformation(o(a,t,Ar),Ar),c=i.Matrix4.setScale(e,xr,Er);c=i.Matrix4.setTranslation(c,n.Cartesian3.ZERO,c),u=i.Matrix4.multiply(u,c,u);let l=Ue.fromRotationMatrix(i.Matrix4.getMatrix3(u,Or),Ir);return l=Ue.normalize(l,l),Zn.fromQuaternion(l,s)};const Pr=o.CesiumMath.TWO_PI/86400;let Rr=new zt;lr.computeTemeToPseudoFixedMatrix=function(e,t){Rr=zt.addSeconds(e,-zt.computeTaiMinusUtc(e),Rr);const i=Rr.dayNumber,s=Rr.secondsOfDay;let a;const u=i-2451545;a=s>=43200?(u+.5)/ht.DAYS_PER_JULIAN_CENTURY:(u-.5)/ht.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*Pr%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*ht.SECONDS_PER_DAY)%ht.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return r.defined(t)?(t[0]=l,t[1]=-d,t[2]=0,t[3]=d,t[4]=l,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new n.Matrix3(l,d,0,-d,l,0,0,0,1)},lr.iau2006XysData=new sr,lr.earthOrientationParameters=$n.NONE;const Tr=32.184;lr.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Tr,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Tr;return lr.iau2006XysData.preload(t,n,r,o)},lr.computeIcrfToFixedMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const o=lr.computeFixedToIcrfMatrix(e,t);if(r.defined(o))return n.Matrix3.transpose(o,t)};const qr=new ir(0,0,0),zr=new lt(0,0,0,0,0),Mr=new n.Matrix3,Dr=new n.Matrix3;lr.computeFixedToIcrfMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const i=lr.earthOrientationParameters.compute(e,zr);if(!r.defined(i))return;const s=e.dayNumber,a=e.secondsOfDay+Tr,u=lr.iau2006XysData.computeXysRadians(s,a,qr);if(!r.defined(u))return;const c=u.x+i.xPoleOffset,l=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=Mr;f[0]=1-d*c*c,f[3]=-d*c*l,f[6]=c,f[1]=-d*c*l,f[4]=1-d*l*l,f[7]=l,f[2]=-c,f[5]=-l,f[8]=1-d*(c*c+l*l);const p=n.Matrix3.fromRotationZ(-u.s,Dr),h=n.Matrix3.multiply(f,p,Mr),m=e.dayNumber-2451545,g=(e.secondsOfDay-zt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/ht.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;const v=n.Matrix3.fromRotationZ(y,Dr),w=n.Matrix3.multiply(h,v,Mr),C=Math.cos(i.xPoleWander),_=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);let S=s-2451545+a/ht.SECONDS_PER_DAY;S/=36525;const A=-47e-6*S*o.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=Dr;return I[0]=C*E,I[1]=C*O,I[2]=b,I[3]=-_*O+x*b*E,I[4]=_*E+x*b*O,I[5]=-x*C,I[6]=-x*O-_*b*E,I[7]=x*E-_*b*O,I[8]=_*C,n.Matrix3.multiply(w,I,t)};const Ur=new i.Cartesian4;lr.pointToWindowCoordinates=function(e,t,n,r){return(r=lr.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},lr.pointToGLWindowCoordinates=function(e,t,n,o){r.defined(o)||(o=new i.Cartesian2);const s=Ur;return i.Matrix4.multiplyByVector(e,i.Cartesian4.fromElements(n.x,n.y,n.z,1,s),s),i.Cartesian4.multiplyByScalar(s,1/s.w,s),i.Matrix4.multiplyByVector(t,s,s),i.Cartesian2.fromCartesian4(s,o)};const kr=new n.Cartesian3,Fr=new n.Cartesian3,Nr=new n.Cartesian3;lr.rotationMatrixFromPositionVelocity=function(e,t,i,s){const a=r.defaultValue(i,n.Ellipsoid.WGS84).geodeticSurfaceNormal(e,kr);let u=n.Cartesian3.cross(t,a,Fr);n.Cartesian3.equalsEpsilon(u,n.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=n.Cartesian3.clone(n.Cartesian3.UNIT_X,u));const c=n.Cartesian3.cross(u,t,Nr);return n.Cartesian3.normalize(c,c),n.Cartesian3.cross(t,c,u),n.Cartesian3.negate(u,u),n.Cartesian3.normalize(u,u),r.defined(s)||(s=new n.Matrix3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=u.x,s[4]=u.y,s[5]=u.z,s[6]=c.x,s[7]=c.y,s[8]=c.z,s};const jr=new i.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Br=new n.Cartographic,Vr=new n.Cartesian3,$r=new n.Cartesian3,Lr=new n.Matrix3,Qr=new i.Matrix4,Wr=new i.Matrix4;lr.basisTo2D=function(e,t,r){const o=i.Matrix4.getTranslation(t,$r),s=e.ellipsoid,a=s.cartesianToCartographic(o,Br),u=e.project(a,Vr);n.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=lr.eastNorthUpToFixedFrame(o,s,Qr),l=i.Matrix4.inverseTransformation(c,Wr),d=i.Matrix4.getMatrix3(t,Lr),f=i.Matrix4.multiplyByMatrix3(l,d,r);return i.Matrix4.multiply(jr,f,r),i.Matrix4.setTranslation(r,u,r),r},lr.wgs84To2DModelMatrix=function(e,t,r){const o=e.ellipsoid,s=lr.eastNorthUpToFixedFrame(t,o,Qr),a=i.Matrix4.inverseTransformation(s,Wr),u=o.cartesianToCartographic(t,Br),c=e.project(u,Vr);n.Cartesian3.fromElements(c.z,c.x,c.y,c);const l=i.Matrix4.fromTranslation(c,Qr);return i.Matrix4.multiply(jr,a,r),i.Matrix4.multiply(l,r,r),r};var Hr=lr;t.BoundingSphere=y,t.DeveloperError=c,t.FeatureDetection=De,t.GeographicProjection=h,t.Intersect=m,t.Interval=g,t.Quaternion=Ue,t.Resource=Tn,t.Transforms=Hr,t.buildModuleUrl=or})); diff --git a/public/lib/Cesium/Workers/Transforms-f17097e5.js b/public/lib/Cesium/Workers/Transforms-f17097e5.js new file mode 100644 index 00000000..2551be65 --- /dev/null +++ b/public/lib/Cesium/Workers/Transforms-f17097e5.js @@ -0,0 +1,40 @@ +define(["require","exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./Matrix2-7a8e9daf","./combine-0c102d93","./RuntimeError-9b4ce3fb"],(function(e,t,n,r,o,i,s,a){"use strict";function u(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}function c(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}r.defined(Object.create)&&(c.prototype=Object.create(Error.prototype),c.prototype.constructor=c),c.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return r.defined(this.stack)&&(e+=`\n${this.stack.toString()}`),e},c.throwInstantiationError=function(){throw new c("This function defines an interface and should not be called directly.")};const l={};function d(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}l.typeOf={},l.defined=function(e,t){if(!r.defined(t))throw new c(function(e){return`${e} is required, actual value was undefined`}(e))},l.typeOf.func=function(e,t){if("function"!=typeof t)throw new c(d(typeof t,"function",e))},l.typeOf.string=function(e,t){if("string"!=typeof t)throw new c(d(typeof t,"string",e))},l.typeOf.number=function(e,t){if("number"!=typeof t)throw new c(d(typeof t,"number",e))},l.typeOf.number.lessThan=function(e,t,n){if(l.typeOf.number(e,t),t>=n)throw new c(`Expected ${e} to be less than ${n}, actual value was ${t}`)},l.typeOf.number.lessThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),t>n)throw new c(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},l.typeOf.number.greaterThan=function(e,t,n){if(l.typeOf.number(e,t),t<=n)throw new c(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},l.typeOf.number.greaterThanOrEquals=function(e,t,n){if(l.typeOf.number(e,t),t<n)throw new c(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},l.typeOf.object=function(e,t){if("object"!=typeof t)throw new c(d(typeof t,"object",e))},l.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new c(d(typeof t,"boolean",e))},l.typeOf.bigint=function(e,t){if("bigint"!=typeof t)throw new c(d(typeof t,"bigint",e))},l.typeOf.number.equals=function(e,t,n,r){if(l.typeOf.number(e,n),l.typeOf.number(t,r),n!==r)throw new c(`${e} must be equal to ${t}, the actual values are ${n} and ${r}`)};var f=l;function p(e){this._ellipsoid=r.defaultValue(e,n.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),p.prototype.project=function(e,t){const o=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;return r.defined(t)?(t.x=i,t.y=s,t.z=a,t):new n.Cartesian3(i,s,a)},p.prototype.unproject=function(e,t){const o=this._oneOverSemimajorAxis,i=e.x*o,s=e.y*o,a=e.z;return r.defined(t)?(t.longitude=i,t.latitude=s,t.height=a,t):new n.Cartographic(i,s,a)};var h=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function m(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}function g(e,t){this.center=n.Cartesian3.clone(r.defaultValue(e,n.Cartesian3.ZERO)),this.radius=r.defaultValue(t,0)}const y=new n.Cartesian3,v=new n.Cartesian3,w=new n.Cartesian3,C=new n.Cartesian3,_=new n.Cartesian3,b=new n.Cartesian3,x=new n.Cartesian3,S=new n.Cartesian3,A=new n.Cartesian3,E=new n.Cartesian3,O=new n.Cartesian3,I=new n.Cartesian3,P=4/3*o.CesiumMath.PI;g.fromPoints=function(e,t){if(r.defined(t)||(t=new g),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=n.Cartesian3.clone(e[0],x),i=n.Cartesian3.clone(o,y),s=n.Cartesian3.clone(o,v),a=n.Cartesian3.clone(o,w),u=n.Cartesian3.clone(o,C),c=n.Cartesian3.clone(o,_),l=n.Cartesian3.clone(o,b),d=e.length;let f;for(f=1;f<d;f++){n.Cartesian3.clone(e[f],o);const t=o.x,r=o.y,d=o.z;t<i.x&&n.Cartesian3.clone(o,i),t>u.x&&n.Cartesian3.clone(o,u),r<s.y&&n.Cartesian3.clone(o,s),r>c.y&&n.Cartesian3.clone(o,c),d<a.z&&n.Cartesian3.clone(o,a),d>l.z&&n.Cartesian3.clone(o,l)}const p=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(u,i,S)),h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,S)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S));let P=i,R=u,T=p;h>T&&(T=h,P=s,R=c),m>T&&(T=m,P=a,R=l);const q=A;q.x=.5*(P.x+R.x),q.y=.5*(P.y+R.y),q.z=.5*(P.z+R.z);let z=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(R,q,S)),M=Math.sqrt(z);const D=E;D.x=i.x,D.y=s.y,D.z=a.z;const U=O;U.x=u.x,U.y=c.y,U.z=l.z;const k=n.Cartesian3.midpoint(D,U,I);let F=0;for(f=0;f<d;f++){n.Cartesian3.clone(e[f],o);const t=n.Cartesian3.magnitude(n.Cartesian3.subtract(o,k,S));t>F&&(F=t);const r=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(o,q,S));if(r>z){const e=Math.sqrt(r);M=.5*(M+e),z=M*M;const t=e-M;q.x=(M*q.x+t*o.x)/e,q.y=(M*q.y+t*o.y)/e,q.z=(M*q.z+t*o.z)/e}}return M<F?(n.Cartesian3.clone(q,t.center),t.radius=M):(n.Cartesian3.clone(k,t.center),t.radius=F),t};const R=new p,T=new n.Cartesian3,q=new n.Cartesian3,z=new n.Cartographic,M=new n.Cartographic;g.fromRectangle2D=function(e,t,n){return g.fromRectangleWithHeights2D(e,t,0,0,n)},g.fromRectangleWithHeights2D=function(e,t,o,s,a){if(r.defined(a)||(a=new g),!r.defined(e))return a.center=n.Cartesian3.clone(n.Cartesian3.ZERO,a.center),a.radius=0,a;t=r.defaultValue(t,R),i.Rectangle.southwest(e,z),z.height=o,i.Rectangle.northeast(e,M),M.height=s;const u=t.project(z,T),c=t.project(M,q),l=c.x-u.x,d=c.y-u.y,f=c.z-u.z;a.radius=.5*Math.sqrt(l*l+d*d+f*f);const p=a.center;return p.x=u.x+.5*l,p.y=u.y+.5*d,p.z=u.z+.5*f,a};const D=[];g.fromRectangle3D=function(e,t,o,s){if(t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,0),r.defined(s)||(s=new g),!r.defined(e))return s.center=n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=0,s;const a=i.Rectangle.subsample(e,t,o,D);return g.fromPoints(a,s)},g.fromVertices=function(e,t,o,i){if(r.defined(i)||(i=new g),!r.defined(e)||0===e.length)return i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i.radius=0,i;t=r.defaultValue(t,n.Cartesian3.ZERO),o=r.defaultValue(o,3);const s=x;s.x=e[0]+t.x,s.y=e[1]+t.y,s.z=e[2]+t.z;const a=n.Cartesian3.clone(s,y),u=n.Cartesian3.clone(s,v),c=n.Cartesian3.clone(s,w),l=n.Cartesian3.clone(s,C),d=n.Cartesian3.clone(s,_),f=n.Cartesian3.clone(s,b),p=e.length;let h;for(h=0;h<p;h+=o){const r=e[h]+t.x,o=e[h+1]+t.y,i=e[h+2]+t.z;s.x=r,s.y=o,s.z=i,r<a.x&&n.Cartesian3.clone(s,a),r>l.x&&n.Cartesian3.clone(s,l),o<u.y&&n.Cartesian3.clone(s,u),o>d.y&&n.Cartesian3.clone(s,d),i<c.z&&n.Cartesian3.clone(s,c),i>f.z&&n.Cartesian3.clone(s,f)}const m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S)),P=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,S)),R=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(f,c,S));let T=a,q=l,z=m;P>z&&(z=P,T=u,q=d),R>z&&(z=R,T=c,q=f);const M=A;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(q,M,S)),U=Math.sqrt(D);const k=E;k.x=a.x,k.y=u.y,k.z=c.z;const F=O;F.x=l.x,F.y=d.y,F.z=f.z;const N=n.Cartesian3.midpoint(k,F,I);let j=0;for(h=0;h<p;h+=o){s.x=e[h]+t.x,s.y=e[h+1]+t.y,s.z=e[h+2]+t.z;const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(s,N,S));r>j&&(j=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(s,M,S));if(o>D){const e=Math.sqrt(o);U=.5*(U+e),D=U*U;const t=e-U;M.x=(U*M.x+t*s.x)/e,M.y=(U*M.y+t*s.y)/e,M.z=(U*M.z+t*s.z)/e}}return U<j?(n.Cartesian3.clone(M,i.center),i.radius=U):(n.Cartesian3.clone(N,i.center),i.radius=j),i},g.fromEncodedCartesianVertices=function(e,t,o){if(r.defined(o)||(o=new g),!r.defined(e)||!r.defined(t)||e.length!==t.length||0===e.length)return o.center=n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=0,o;const i=x;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const s=n.Cartesian3.clone(i,y),a=n.Cartesian3.clone(i,v),u=n.Cartesian3.clone(i,w),c=n.Cartesian3.clone(i,C),l=n.Cartesian3.clone(i,_),d=n.Cartesian3.clone(i,b),f=e.length;let p;for(p=0;p<f;p+=3){const r=e[p]+t[p],o=e[p+1]+t[p+1],f=e[p+2]+t[p+2];i.x=r,i.y=o,i.z=f,r<s.x&&n.Cartesian3.clone(i,s),r>c.x&&n.Cartesian3.clone(i,c),o<a.y&&n.Cartesian3.clone(i,a),o>l.y&&n.Cartesian3.clone(i,l),f<u.z&&n.Cartesian3.clone(i,u),f>d.z&&n.Cartesian3.clone(i,d)}const h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,S)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S)),P=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,S));let R=s,T=c,q=h;m>q&&(q=m,R=a,T=l),P>q&&(q=P,R=u,T=d);const z=A;z.x=.5*(R.x+T.x),z.y=.5*(R.y+T.y),z.z=.5*(R.z+T.z);let M=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(T,z,S)),D=Math.sqrt(M);const U=E;U.x=s.x,U.y=a.y,U.z=u.z;const k=O;k.x=c.x,k.y=l.y,k.z=d.z;const F=n.Cartesian3.midpoint(U,k,I);let N=0;for(p=0;p<f;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(i,F,S));r>N&&(N=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(i,z,S));if(o>M){const e=Math.sqrt(o);D=.5*(D+e),M=D*D;const t=e-D;z.x=(D*z.x+t*i.x)/e,z.y=(D*z.y+t*i.y)/e,z.z=(D*z.z+t*i.z)/e}}return D<N?(n.Cartesian3.clone(z,o.center),o.radius=D):(n.Cartesian3.clone(F,o.center),o.radius=N),o},g.fromCornerPoints=function(e,t,o){r.defined(o)||(o=new g);const i=n.Cartesian3.midpoint(e,t,o.center);return o.radius=n.Cartesian3.distance(i,t),o},g.fromEllipsoid=function(e,t){return r.defined(t)||(t=new g),n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};const U=new n.Cartesian3;g.fromBoundingSpheres=function(e,t){if(r.defined(t)||(t=new g),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=e.length;if(1===o)return g.clone(e[0],t);if(2===o)return g.union(e[0],e[1],t);const i=[];let s;for(s=0;s<o;s++)i.push(e[s].center);const a=(t=g.fromPoints(i,t)).center;let u=t.radius;for(s=0;s<o;s++){const t=e[s];u=Math.max(u,n.Cartesian3.distance(a,t.center,U)+t.radius)}return t.radius=u,t};const k=new n.Cartesian3,F=new n.Cartesian3,N=new n.Cartesian3;g.fromOrientedBoundingBox=function(e,t){r.defined(t)||(t=new g);const o=e.halfAxes,i=n.Matrix3.getColumn(o,0,k),s=n.Matrix3.getColumn(o,1,F),a=n.Matrix3.getColumn(o,2,N);return n.Cartesian3.add(i,s,i),n.Cartesian3.add(i,a,i),t.center=n.Cartesian3.clone(e.center,t.center),t.radius=n.Cartesian3.magnitude(i),t};const j=new n.Cartesian3,B=new n.Cartesian3;g.fromTransformation=function(e,t){r.defined(t)||(t=new g);const o=i.Matrix4.getTranslation(e,j),s=i.Matrix4.getScale(e,B),a=.5*n.Cartesian3.magnitude(s);return t.center=n.Cartesian3.clone(o,t.center),t.radius=a,t},g.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.center=n.Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new g(e.center,e.radius)},g.packedLength=4,g.pack=function(e,t,n){n=r.defaultValue(n,0);const o=e.center;return t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius,t},g.unpack=function(e,t,n){t=r.defaultValue(t,0),r.defined(n)||(n=new g);const o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};const V=new n.Cartesian3,$=new n.Cartesian3;g.union=function(e,t,o){r.defined(o)||(o=new g);const i=e.center,s=e.radius,a=t.center,u=t.radius,c=n.Cartesian3.subtract(a,i,V),l=n.Cartesian3.magnitude(c);if(s>=l+u)return e.clone(o),o;if(u>=l+s)return t.clone(o),o;const d=.5*(s+l+u),f=n.Cartesian3.multiplyByScalar(c,(-s+d)/l,$);return n.Cartesian3.add(f,i,f),n.Cartesian3.clone(f,o.center),o.radius=d,o};const L=new n.Cartesian3;g.expand=function(e,t,r){r=g.clone(e,r);const o=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r.center,L));return o>r.radius&&(r.radius=o),r},g.intersectPlane=function(e,t){const r=e.center,o=e.radius,i=t.normal,s=n.Cartesian3.dot(i,r)+t.distance;return s<-o?h.OUTSIDE:s<o?h.INTERSECTING:h.INSIDE},g.transform=function(e,t,n){return r.defined(n)||(n=new g),n.center=i.Matrix4.multiplyByPoint(t,e.center,n.center),n.radius=i.Matrix4.getMaximumScale(t)*e.radius,n};const Q=new n.Cartesian3;g.distanceSquaredTo=function(e,t){const r=n.Cartesian3.subtract(e.center,t,Q),o=n.Cartesian3.magnitude(r)-e.radius;return o<=0?0:o*o},g.transformWithoutScale=function(e,t,n){return r.defined(n)||(n=new g),n.center=i.Matrix4.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const W=new n.Cartesian3;g.computePlaneDistances=function(e,t,o,i){r.defined(i)||(i=new m);const s=n.Cartesian3.subtract(e.center,t,W),a=n.Cartesian3.dot(o,s);return i.start=a-e.radius,i.stop=a+e.radius,i};const H=new n.Cartesian3,Y=new n.Cartesian3,Z=new n.Cartesian3,G=new n.Cartesian3,J=new n.Cartesian3,X=new n.Cartographic,K=new Array(8);for(let e=0;e<8;++e)K[e]=new n.Cartesian3;const ee=new p;let te;g.projectTo2D=function(e,t,o){const i=(t=r.defaultValue(t,ee)).ellipsoid;let s=e.center;const a=e.radius;let u;u=n.Cartesian3.equals(s,n.Cartesian3.ZERO)?n.Cartesian3.clone(n.Cartesian3.UNIT_X,H):i.geodeticSurfaceNormal(s,H);const c=n.Cartesian3.cross(n.Cartesian3.UNIT_Z,u,Y);n.Cartesian3.normalize(c,c);const l=n.Cartesian3.cross(u,c,Z);n.Cartesian3.normalize(l,l),n.Cartesian3.multiplyByScalar(u,a,u),n.Cartesian3.multiplyByScalar(l,a,l),n.Cartesian3.multiplyByScalar(c,a,c);const d=n.Cartesian3.negate(l,J),f=n.Cartesian3.negate(c,G),p=K;let h=p[0];n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[1],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[2],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[3],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h),n.Cartesian3.negate(u,u),h=p[4],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[5],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[6],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[7],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h);const m=p.length;for(let e=0;e<m;++e){const r=p[e];n.Cartesian3.add(s,r,r);const o=i.cartesianToCartographic(r,X);t.project(o,r)}s=(o=g.fromPoints(p,o)).center;const y=s.x,v=s.y,w=s.z;return s.x=w,s.y=y,s.z=v,o},g.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},g.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&n.Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},g.prototype.intersectPlane=function(e){return g.intersectPlane(this,e)},g.prototype.distanceSquaredTo=function(e){return g.distanceSquaredTo(this,e)},g.prototype.computePlaneDistances=function(e,t,n){return g.computePlaneDistances(this,e,t,n)},g.prototype.isOccluded=function(e){return g.isOccluded(this,e)},g.prototype.equals=function(e){return g.equals(this,e)},g.prototype.clone=function(e){return g.clone(this,e)},g.prototype.volume=function(){const e=this.radius;return P*e*e*e};const ne={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},re={};Object.defineProperties(re,{element:{get:function(){if(re.supportsFullscreen())return document[ne.fullscreenElement]}},changeEventName:{get:function(){if(re.supportsFullscreen())return ne.fullscreenchange}},errorEventName:{get:function(){if(re.supportsFullscreen())return ne.fullscreenerror}},enabled:{get:function(){if(re.supportsFullscreen())return document[ne.fullscreenEnabled]}},fullscreen:{get:function(){if(re.supportsFullscreen())return null!==re.element}}}),re.supportsFullscreen=function(){if(r.defined(te))return te;te=!1;const e=document.body;if("function"==typeof e.requestFullscreen)return ne.requestFullscreen="requestFullscreen",ne.exitFullscreen="exitFullscreen",ne.fullscreenEnabled="fullscreenEnabled",ne.fullscreenElement="fullscreenElement",ne.fullscreenchange="fullscreenchange",ne.fullscreenerror="fullscreenerror",te=!0,te;const t=["webkit","moz","o","ms","khtml"];let n;for(let r=0,o=t.length;r<o;++r){const o=t[r];n=`${o}RequestFullscreen`,"function"==typeof e[n]?(ne.requestFullscreen=n,te=!0):(n=`${o}RequestFullScreen`,"function"==typeof e[n]&&(ne.requestFullscreen=n,te=!0)),n=`${o}ExitFullscreen`,"function"==typeof document[n]?ne.exitFullscreen=n:(n=`${o}CancelFullScreen`,"function"==typeof document[n]&&(ne.exitFullscreen=n)),n=`${o}FullscreenEnabled`,void 0!==document[n]?ne.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,void 0!==document[n]&&(ne.fullscreenEnabled=n)),n=`${o}FullscreenElement`,void 0!==document[n]?ne.fullscreenElement=n:(n=`${o}FullScreenElement`,void 0!==document[n]&&(ne.fullscreenElement=n)),n=`${o}fullscreenchange`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenChange"),ne.fullscreenchange=n),n=`${o}fullscreenerror`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenError"),ne.fullscreenerror=n)}return te},re.requestFullscreen=function(e,t){re.supportsFullscreen()&&e[ne.requestFullscreen]({vrDisplay:t})},re.exitFullscreen=function(){re.supportsFullscreen()&&document[ne.exitFullscreen]()},re._names=ne;var oe=re;let ie,se,ae,ue,ce,le,de,fe,pe,he,me,ge,ye,ve,we,Ce,_e,be;function xe(e){const t=e.split(".");for(let e=0,n=t.length;e<n;++e)t[e]=parseInt(t[e],10);return t}function Se(){if(!r.defined(se)&&(se=!1,!Ie())){const e=/ Chrome\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(se=!0,ae=xe(e[1]))}return se}function Ae(){if(!r.defined(ue)&&(ue=!1,!Se()&&!Ie()&&/ Safari\/[\.0-9]+/.test(ie.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(ue=!0,ce=xe(e[1]))}return ue}function Ee(){if(!r.defined(le)){le=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ie.userAgent);null!==e&&(le=!0,de=xe(e[1]),de.isNightly=!!e[2])}return le}function Oe(){if(!r.defined(fe)){let e;fe=!1,"Microsoft Internet Explorer"===ie.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ie.userAgent),null!==e&&(fe=!0,pe=xe(e[1]))):"Netscape"===ie.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ie.userAgent),null!==e&&(fe=!0,pe=xe(e[1])))}return fe}function Ie(){if(!r.defined(he)){he=!1;const e=/ Edg\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(he=!0,me=xe(e[1]))}return he}function Pe(){if(!r.defined(ge)){ge=!1;const e=/Firefox\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(ge=!0,ye=xe(e[1]))}return ge}function Re(){if(!r.defined(be)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;be=r.defined(t)&&""!==t,be&&(_e=t)}return be}function Te(){return Te._result}ie="undefined"!=typeof navigator?navigator:{},Te._promise=void 0,Te._result=void 0,Te.initialize=function(){return r.defined(Te._promise)||(Te._promise=new Promise((e=>{const t=new Image;t.onload=function(){Te._result=t.width>0&&t.height>0,e(Te._result)},t.onerror=function(){Te._result=!1,e(Te._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}))),Te._promise},Object.defineProperties(Te,{initialized:{get:function(){return r.defined(Te._result)}}});const qe=[];"undefined"!=typeof ArrayBuffer&&(qe.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&qe.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&qe.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&qe.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&qe.push(BigUint64Array));const ze={isChrome:Se,chromeVersion:function(){return Se()&&ae},isSafari:Ae,safariVersion:function(){return Ae()&&ce},isWebkit:Ee,webkitVersion:function(){return Ee()&&de},isInternetExplorer:Oe,internetExplorerVersion:function(){return Oe()&&pe},isEdge:Ie,edgeVersion:function(){return Ie()&&me},isFirefox:Pe,firefoxVersion:function(){return Pe()&&ye},isWindows:function(){return r.defined(ve)||(ve=/Windows/i.test(ie.appVersion)),ve},isIPadOrIOS:function(){return r.defined(we)||(we="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),we},hardwareConcurrency:r.defaultValue(ie.hardwareConcurrency,3),supportsPointerEvents:function(){return r.defined(Ce)||(Ce=!Pe()&&"undefined"!=typeof PointerEvent&&(!r.defined(ie.pointerEnabled)||ie.pointerEnabled)),Ce},supportsImageRenderingPixelated:Re,supportsWebP:Te,imageRenderingValue:function(){return Re()?_e:void 0},typedArrayTypes:qe,supportsBasis:function(e){return ze.supportsWebAssembly()&&e.context.supportsBasis},supportsFullscreen:function(){return oe.supportsFullscreen()},supportsTypedArrays:function(){return"undefined"!=typeof ArrayBuffer},supportsBigInt64Array:function(){return"undefined"!=typeof BigInt64Array},supportsBigUint64Array:function(){return"undefined"!=typeof BigUint64Array},supportsBigInt:function(){return"undefined"!=typeof BigInt},supportsWebWorkers:function(){return"undefined"!=typeof Worker},supportsWebAssembly:function(){return"undefined"!=typeof WebAssembly},supportsWebgl2:function(e){return e.context.webgl2}};var Me=ze;function De(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}let Ue=new n.Cartesian3;De.fromAxisAngle=function(e,t,o){const i=t/2,s=Math.sin(i);Ue=n.Cartesian3.normalize(e,Ue);const a=Ue.x*s,u=Ue.y*s,c=Ue.z*s,l=Math.cos(i);return r.defined(o)?(o.x=a,o.y=u,o.z=c,o.w=l,o):new De(a,u,c,l)};const ke=[1,2,0],Fe=new Array(3);De.fromRotationMatrix=function(e,t){let o,i,s,a,u;const c=e[n.Matrix3.COLUMN0ROW0],l=e[n.Matrix3.COLUMN1ROW1],d=e[n.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)o=Math.sqrt(f+1),u=.5*o,o=.5/o,i=(e[n.Matrix3.COLUMN1ROW2]-e[n.Matrix3.COLUMN2ROW1])*o,s=(e[n.Matrix3.COLUMN2ROW0]-e[n.Matrix3.COLUMN0ROW2])*o,a=(e[n.Matrix3.COLUMN0ROW1]-e[n.Matrix3.COLUMN1ROW0])*o;else{const t=ke;let r=0;l>c&&(r=1),d>c&&d>l&&(r=2);const f=t[r],p=t[f];o=Math.sqrt(e[n.Matrix3.getElementIndex(r,r)]-e[n.Matrix3.getElementIndex(f,f)]-e[n.Matrix3.getElementIndex(p,p)]+1);const h=Fe;h[r]=.5*o,o=.5/o,u=(e[n.Matrix3.getElementIndex(p,f)]-e[n.Matrix3.getElementIndex(f,p)])*o,h[f]=(e[n.Matrix3.getElementIndex(f,r)]+e[n.Matrix3.getElementIndex(r,f)])*o,h[p]=(e[n.Matrix3.getElementIndex(p,r)]+e[n.Matrix3.getElementIndex(r,p)])*o,i=-h[0],s=-h[1],a=-h[2]}return r.defined(t)?(t.x=i,t.y=s,t.z=a,t.w=u,t):new De(i,s,a,u)};const Ne=new De;let je=new De,Be=new De,Ve=new De;De.fromHeadingPitchRoll=function(e,t){return Ve=De.fromAxisAngle(n.Cartesian3.UNIT_X,e.roll,Ne),Be=De.fromAxisAngle(n.Cartesian3.UNIT_Y,-e.pitch,t),t=De.multiply(Be,Ve,Be),je=De.fromAxisAngle(n.Cartesian3.UNIT_Z,-e.heading,Ne),De.multiply(je,t,t)};const $e=new n.Cartesian3,Le=new n.Cartesian3,Qe=new De,We=new De,He=new De;De.packedLength=4,De.pack=function(e,t,n){return n=r.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},De.unpack=function(e,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new De),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},De.packedInterpolationLength=3,De.convertPackedArrayForInterpolation=function(e,t,n,o){De.unpack(e,4*n,He),De.conjugate(He,He);for(let i=0,s=n-t+1;i<s;i++){const n=3*i;De.unpack(e,4*(t+i),Qe),De.multiply(Qe,He,Qe),Qe.w<0&&De.negate(Qe,Qe),De.computeAxis(Qe,$e);const s=De.computeAngle(Qe);r.defined(o)||(o=[]),o[n]=$e.x*s,o[n+1]=$e.y*s,o[n+2]=$e.z*s}},De.unpackInterpolationResult=function(e,t,o,i,s){r.defined(s)||(s=new De),n.Cartesian3.fromArray(e,0,Le);const a=n.Cartesian3.magnitude(Le);return De.unpack(t,4*i,We),0===a?De.clone(De.IDENTITY,Qe):De.fromAxisAngle(Le,a,Qe),De.multiply(Qe,We,s)},De.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new De(e.x,e.y,e.z,e.w)},De.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},De.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},De.magnitude=function(e){return Math.sqrt(De.magnitudeSquared(e))},De.normalize=function(e,t){const n=1/De.magnitude(e),r=e.x*n,o=e.y*n,i=e.z*n,s=e.w*n;return t.x=r,t.y=o,t.z=i,t.w=s,t},De.inverse=function(e,t){const n=De.magnitudeSquared(e);return t=De.conjugate(e,t),De.multiplyByScalar(t,1/n,t)},De.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},De.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},De.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},De.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},De.multiply=function(e,t,n){const r=e.x,o=e.y,i=e.z,s=e.w,a=t.x,u=t.y,c=t.z,l=t.w,d=s*a+r*l+o*c-i*u,f=s*u-r*c+o*l+i*a,p=s*c+r*u-o*a+i*l,h=s*l-r*a-o*u-i*c;return n.x=d,n.y=f,n.z=p,n.w=h,n},De.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},De.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},De.computeAxis=function(e,t){const n=e.w;if(Math.abs(n-1)<o.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;const r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},De.computeAngle=function(e){return Math.abs(e.w-1)<o.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};let Ye=new De;De.lerp=function(e,t,n,r){return Ye=De.multiplyByScalar(t,n,Ye),r=De.multiplyByScalar(e,1-n,r),De.add(Ye,r,r)};let Ze=new De,Ge=new De,Je=new De;De.slerp=function(e,t,n,r){let i=De.dot(e,t),s=t;if(i<0&&(i=-i,s=Ze=De.negate(t,Ze)),1-i<o.CesiumMath.EPSILON6)return De.lerp(e,s,n,r);const a=Math.acos(i);return Ge=De.multiplyByScalar(e,Math.sin((1-n)*a),Ge),Je=De.multiplyByScalar(s,Math.sin(n*a),Je),r=De.add(Ge,Je,r),De.multiplyByScalar(r,1/Math.sin(a),r)},De.log=function(e,t){const r=o.CesiumMath.acosClamped(e.w);let i=0;return 0!==r&&(i=r/Math.sin(r)),n.Cartesian3.multiplyByScalar(e,i,t)},De.exp=function(e,t){const r=n.Cartesian3.magnitude(e);let o=0;return 0!==r&&(o=Math.sin(r)/r),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(r),t};const Xe=new n.Cartesian3,Ke=new n.Cartesian3,et=new De,tt=new De;De.computeInnerQuadrangle=function(e,t,r,o){const i=De.conjugate(t,et);De.multiply(i,r,tt);const s=De.log(tt,Xe);De.multiply(i,e,tt);const a=De.log(tt,Ke);return n.Cartesian3.add(s,a,s),n.Cartesian3.multiplyByScalar(s,.25,s),n.Cartesian3.negate(s,s),De.exp(s,et),De.multiply(t,et,o)},De.squad=function(e,t,n,r,o,i){const s=De.slerp(e,t,o,et),a=De.slerp(n,r,o,tt);return De.slerp(s,a,2*o*(1-o),i)};const nt=new De,rt=1.9011074535173003,ot=Me.supportsTypedArrays()?new Float32Array(8):[],it=Me.supportsTypedArrays()?new Float32Array(8):[],st=Me.supportsTypedArrays()?new Float32Array(8):[],at=Me.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;ot[e]=1/(t*n),it[e]=t/n}function ut(e,t,n){let r,o,i=0,s=e.length-1;for(;i<=s;)if(r=~~((i+s)/2),o=n(e[r],t),o<0)i=r+1;else{if(!(o>0))return r;s=r-1}return~(s+1)}function ct(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function lt(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function dt(e){return e%4==0&&e%100!=0||e%400==0}function ft(e,t){this.julianDate=e,this.offset=t}ot[7]=rt/136,it[7]=8*rt/17,De.fastSlerp=function(e,t,n,r){let o,i=De.dot(e,t);i>=0?o=1:(o=-1,i=-i);const s=i-1,a=1-n,u=n*n,c=a*a;for(let e=7;e>=0;--e)st[e]=(ot[e]*u-it[e])*s,at[e]=(ot[e]*c-it[e])*s;const l=o*n*(1+st[0]*(1+st[1]*(1+st[2]*(1+st[3]*(1+st[4]*(1+st[5]*(1+st[6]*(1+st[7])))))))),d=a*(1+at[0]*(1+at[1]*(1+at[2]*(1+at[3]*(1+at[4]*(1+at[5]*(1+at[6]*(1+at[7])))))))),f=De.multiplyByScalar(e,d,nt);return De.multiplyByScalar(t,l,r),De.add(f,r,r)},De.fastSquad=function(e,t,n,r,o,i){const s=De.fastSlerp(e,t,o,et),a=De.fastSlerp(n,r,o,tt);return De.fastSlerp(s,a,2*o*(1-o),i)},De.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},De.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},De.ZERO=Object.freeze(new De(0,0,0,0)),De.IDENTITY=Object.freeze(new De(0,0,0,1)),De.prototype.clone=function(e){return De.clone(this,e)},De.prototype.equals=function(e){return De.equals(this,e)},De.prototype.equalsEpsilon=function(e,t){return De.equalsEpsilon(this,e,t)},De.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var pt=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5});var ht=Object.freeze({UTC:0,TAI:1});const mt=new lt,gt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(e,t){return qt.compare(e.julianDate,t.julianDate)}const vt=new ft;function wt(e){vt.julianDate=e;const t=qt.leapSeconds;let n=ut(t,vt,yt);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){qt.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}qt.addSeconds(e,r,e)}function Ct(e,t){vt.julianDate=e;const n=qt.leapSeconds;let r=ut(n,vt,yt);if(r<0&&(r=~r),0===r)return qt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return qt.addSeconds(e,-n[r-1].offset,t);const o=qt.secondsDifference(n[r].julianDate,e);return 0===o?qt.addSeconds(e,-n[r].offset,t):o<=1?void 0:qt.addSeconds(e,-n[--r].offset,t)}function _t(e,t,n){const r=t/pt.SECONDS_PER_DAY|0;return e+=r,(t-=pt.SECONDS_PER_DAY*r)<0&&(e--,t+=pt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function bt(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);const l=i+(r*pt.SECONDS_PER_HOUR+o*pt.SECONDS_PER_MINUTE+s*pt.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const xt=/^(\d{4})$/,St=/^(\d{4})-(\d{2})$/,At=/^(\d{4})-?(\d{3})$/,Et=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Ot=/^(\d{4})-?(\d{2})-?(\d{2})$/,It=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Pt=/^(\d{2})(\.\d+)?/.source+It.source,Rt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+It.source,Tt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+It.source;function qt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,ht.UTC);const o=0|e;_t(o,t+=(e-o)*pt.SECONDS_PER_DAY,this),n===ht.UTC&&wt(this)}qt.fromGregorianDate=function(e,t){const n=bt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(_t(n[0],n[1],t),wt(t),t):new qt(n[0],n[1],ht.UTC)},qt.fromDate=function(e,t){const n=bt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(_t(n[0],n[1],t),wt(t),t):new qt(n[0],n[1],ht.UTC)},qt.fromIso8601=function(e,t){let n,o=(e=e.replace(",",".")).split("T"),i=1,s=1,a=0,u=0,c=0,l=0;const d=o[0],f=o[1];let p,h,m;if(o=d.match(Ot),null!==o)n=+o[1],i=+o[2],s=+o[3];else if(o=d.match(St),null!==o)n=+o[1],i=+o[2];else if(o=d.match(xt),null!==o)n=+o[1];else{let e;if(o=d.match(At),null!==o)n=+o[1],e=+o[2],h=dt(n);else if(o=d.match(Et),null!==o){n=+o[1];e=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),i=p.getUTCMonth()+1,s=p.getUTCDate()}if(h=dt(n),r.defined(f)){o=f.match(Tt),null!==o?(a=+o[1],u=+o[2],c=+o[3],l=1e3*+(o[4]||0),m=5):(o=f.match(Rt),null!==o?(a=+o[1],u=+o[2],c=60*+(o[3]||0),m=4):(o=f.match(Pt),null!==o&&(a=+o[1],u=60*+(o[2]||0),m=3)));const e=o[m],t=+o[m+1],r=+(o[m+2]||0);switch(e){case"+":a-=t,u-=r;break;case"-":a+=t,u+=r;break;case"Z":break;default:u+=new Date(Date.UTC(n,i-1,s,a,u)).getTimezoneOffset()}}const g=60===c;for(g&&c--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,s++;for(p=h&&2===i?29:gt[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:gt[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)i--,i<1&&(i+=12,n--),p=h&&2===i?29:gt[i-1],s+=p;const y=bt(n,i,s,a,u,c,l);return r.defined(t)?(_t(y[0],y[1],t),wt(t)):t=new qt(y[0],y[1],ht.UTC),g&&qt.addSeconds(t,1,t),t},qt.now=function(e){return qt.fromDate(new Date,e)};const zt=new qt(0,0,ht.TAI);qt.toGregorianDate=function(e,t){let n=!1,o=Ct(e,zt);r.defined(o)||(qt.addSeconds(e,-1,zt),o=Ct(zt,zt),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let a=i+68569|0;const u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const l=80*a/2447|0,d=a-(2447*l/80|0)|0;a=l/11|0;const f=l+2-12*a|0,p=100*(u-49)+c+a|0;let h=s/pt.SECONDS_PER_HOUR|0,m=s-h*pt.SECONDS_PER_HOUR;const g=m/pt.SECONDS_PER_MINUTE|0;m-=g*pt.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/pt.SECONDS_PER_MILLISECOND;return h+=12,h>23&&(h-=24),n&&(y+=1),r.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=y,t.millisecond=v,t.isLeapSecond=n,t):new lt(p,f,d,h,g,y,v,n)},qt.toDate=function(e){const t=qt.toGregorianDate(e,mt);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},qt.toIso8601=function(e,t){const n=qt.toGregorianDate(e,mt);let o=n.year,i=n.month,s=n.day,a=n.hour;const u=n.minute,c=n.second,l=n.millisecond;let d;return 1e4===o&&1===i&&1===s&&0===a&&0===u&&0===c&&0===l&&(o=9999,i=12,s=31,a=24),r.defined(t)||0===l?r.defined(t)&&0!==t?(d=(.01*l).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*l).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},qt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new qt(e.dayNumber,e.secondsOfDay,ht.TAI)},qt.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},qt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},qt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(qt.secondsDifference(e,t))<=n},qt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/pt.SECONDS_PER_DAY},qt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*pt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},qt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/pt.SECONDS_PER_DAY},qt.computeTaiMinusUtc=function(e){vt.julianDate=e;const t=qt.leapSeconds;let n=ut(t,vt,yt);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},qt.addSeconds=function(e,t,n){return _t(e.dayNumber,e.secondsOfDay+t,n)},qt.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*pt.SECONDS_PER_MINUTE;return _t(e.dayNumber,r,n)},qt.addHours=function(e,t,n){const r=e.secondsOfDay+t*pt.SECONDS_PER_HOUR;return _t(e.dayNumber,r,n)},qt.addDays=function(e,t,n){return _t(e.dayNumber+t,e.secondsOfDay,n)},qt.lessThan=function(e,t){return qt.compare(e,t)<0},qt.lessThanOrEquals=function(e,t){return qt.compare(e,t)<=0},qt.greaterThan=function(e,t){return qt.compare(e,t)>0},qt.greaterThanOrEquals=function(e,t){return qt.compare(e,t)>=0},qt.prototype.clone=function(e){return qt.clone(this,e)},qt.prototype.equals=function(e){return qt.equals(this,e)},qt.prototype.equalsEpsilon=function(e,t){return qt.equalsEpsilon(this,e,t)},qt.prototype.toString=function(){return qt.toIso8601(this)},qt.leapSeconds=[new ft(new qt(2441317,43210,ht.TAI),10),new ft(new qt(2441499,43211,ht.TAI),11),new ft(new qt(2441683,43212,ht.TAI),12),new ft(new qt(2442048,43213,ht.TAI),13),new ft(new qt(2442413,43214,ht.TAI),14),new ft(new qt(2442778,43215,ht.TAI),15),new ft(new qt(2443144,43216,ht.TAI),16),new ft(new qt(2443509,43217,ht.TAI),17),new ft(new qt(2443874,43218,ht.TAI),18),new ft(new qt(2444239,43219,ht.TAI),19),new ft(new qt(2444786,43220,ht.TAI),20),new ft(new qt(2445151,43221,ht.TAI),21),new ft(new qt(2445516,43222,ht.TAI),22),new ft(new qt(2446247,43223,ht.TAI),23),new ft(new qt(2447161,43224,ht.TAI),24),new ft(new qt(2447892,43225,ht.TAI),25),new ft(new qt(2448257,43226,ht.TAI),26),new ft(new qt(2448804,43227,ht.TAI),27),new ft(new qt(2449169,43228,ht.TAI),28),new ft(new qt(2449534,43229,ht.TAI),29),new ft(new qt(2450083,43230,ht.TAI),30),new ft(new qt(2450630,43231,ht.TAI),31),new ft(new qt(2451179,43232,ht.TAI),32),new ft(new qt(2453736,43233,ht.TAI),33),new ft(new qt(2454832,43234,ht.TAI),34),new ft(new qt(2456109,43235,ht.TAI),35),new ft(new qt(2457204,43236,ht.TAI),36),new ft(new qt(2457754,43237,ht.TAI),37)];var Mt,Dt={exports:{}},Ut={exports:{}};var kt,Ft={exports:{}}; +/*! + * URI.js - Mutating URLs + * IPv6 Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */var Nt,jt,Bt,Vt,$t={exports:{}}; +/*! + * URI.js - Mutating URLs + * Second Level Domain (SLD) Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */ +/*! + * URI.js - Mutating URLs + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */ +jt=Dt,Bt=o.commonjsGlobal,Vt=function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1;if(!(this instanceof i))return n?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var s=i.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function d(e,t){var n,r,o={};if("RegExp"===c(t))o=null;else if(l(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;else o[t]=!0;for(n=0,r=e.length;n<r;n++)(o&&void 0!==o[e[n]]||!o&&t.test(e[n]))&&(e.splice(n,1),r--,n--);return e}function f(e,t){var n,r;if(l(t)){for(n=0,r=t.length;n<r;n++)if(!f(e,t[n]))return!1;return!0}var o=c(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"==typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function p(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function h(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},w=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(e){return n}}};for(y in v)i[y+"PathSegment"]=w("pathname",v[y]),i[y+"UrnPathSegment"]=w("urnpath",v[y]);var C=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);return s.join(e)}};function _(e){return function(t,n){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}function b(e,t){return function(n,r){return void 0===n?this._parts[e]||"":(null!==n&&(n+="").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!r),this)}}i.decodePath=C("/","decodePathSegment"),i.decodeUrnPath=C(":","decodeUrnPathSegment"),i.recodePath=C("/","encodePathSegment","decode"),i.recodeUrnPath=C(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(e,t){var n;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(n=(e=(e=e.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var n,r,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var n=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var r,o=e.indexOf("/"),s=e.lastIndexOf("@",o>-1?o:e.length-1);return s>-1&&(-1===o||s<o)?(r=e.substring(0,s).split(":"),t.username=r[0]?i.decode(r[0]):null,r.shift(),t.password=r[0]?i.decode(r.join(":")):null,e=n.substring(s+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var n,r,o,s={},u=e.split("&"),c=u.length,l=0;l<c;l++)n=u[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(a.call(s,r)?("string"!=typeof s[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);return s},i.build=function(e){var t="",n=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){var r,o,s,u,c="";for(o in e)if("__proto__"!==o&&a.call(e,o))if(l(e[o]))for(r={},s=0,u=e[o].length;s<u;s++)void 0!==e[o][s]&&void 0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));return c.substring(1)},i.buildQueryParameter=function(e,t,n){return i.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=n);"string"==typeof e[t]&&(e[t]=[e[t]]),l(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===n?null:n}},i.removeQuery=function(e,t,n){var r,o,s;if(l(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void 0;else if("RegExp"===c(t))for(s in e)t.test(s)&&(e[s]=void 0);else if("object"==typeof t)for(s in t)a.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===c(n)?!l(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=d(e[t],n):e[t]!==String(n)||l(n)&&1!==n.length?l(e[t])&&(e[t]=d(e[t],n)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,n,r){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(a.call(e,o)&&t.test(o)&&(void 0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(var s in t)if(a.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(n)){case"Undefined":return t in e;case"Boolean":return n===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!n(e[t],t,e);case"Array":return!!l(e[t])&&(r?f:p)(e[t],n);case"RegExp":return l(e[t])?!!r&&f(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":return l(e[t])?!!r&&f(e[t],n):e[t]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],n=0,r=0;r<arguments.length;r++){var o=new i(arguments[r]);e.push(o);for(var s=o.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});var r=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(r.lastIndex=0;;){var c=r.exec(e);if(!c)break;var l=c.index;if(n.ignoreHtml){var d=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}for(var f=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;;){var m=a.exec(p);if(!m)break;var g=m.index+m[0].length;h=Math.max(h,g)}if(!((p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){var y=t(p,l,f=l+p.length,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=r||o))&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+u(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(l(t)){s=[];for(var a=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(h(t[a])))}else(t||"string"==typeof t)&&(t=h(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));else t?s[e]=h(t):s.splice(e,1);return i&&s.unshift(""),this.path(s.join(r),n)},s.segmentCoded=function(e,t,n){var r,o,s;if("number"!=typeof e&&(n=t,t=e,e=void 0),void 0===t){if(l(r=this.segment(e,t,n)))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);else r=void 0!==r?i.decode(r):void 0;return r}if(l(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,n)};var E=s.query;return s.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);return this._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},s.setQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)a.call(e,o)&&(r[o]=e[o])}return this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.addQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(r,e,void 0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.removeQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.hasQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(r,e,t,n)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(n){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},s.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var r,o,s="";for("/"!==(n=i.recodePath(n)).charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"")&&(s=s[0]);-1!==(r=n.search(/\/\.\.(\/|$)/));)0!==r?(-1===(o=n.substring(0,r).lastIndexOf("/"))&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3);return t&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.unicode=function(){var e=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.readable=function(){var t=this.clone();t.username("").password("").normalize();var n="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(var r="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){var u=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}return n+=i.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){var t,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},s.relativeTo=function(e){var t,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==s.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==n.hostname||t.port!==n.port)return a.build();if(t.hostname=null,t.port=null,o===s)return t.path="",a.build();if(!(r=i.commonPath(o,s)))return a.build();var u=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(r.length)||"./",a.build()},s.equals=function(e){var t,n,r,o,s,u=this.clone(),c=new i(e),d={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(r=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(r.length!==o.length)return!1;for(s in t=i.parseQuery(r,this._parts.escapeQuerySpace),n=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,s)){if(l(t[s])){if(!p(t[s],n[s]))return!1}else if(t[s]!==n[s])return!1;d[s]=!0}for(s in n)if(a.call(n,s)&&!d[s])return!1;return!0},s.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i},jt.exports?jt.exports=Vt((Mt||(Mt=1,function(e,t){!function(n){var r=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s="object"==typeof o.commonjsGlobal&&o.commonjsGlobal;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,u,c=2147483647,l=36,d=1,f=26,p=38,h=700,m=72,g=128,y="-",v=/^xn--/,w=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=l-d,x=Math.floor,S=String.fromCharCode;function A(e){throw new RangeError(_[e])}function E(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function O(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+E((e=e.replace(C,".")).split("."),t).join(".")}function I(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function P(e){return E(e,(function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+S(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>b*f>>1;r+=l)e=x(e/b);return x(r+(b+1)*e/(e+p))}function q(e){var t,n,r,o,i,s,a,u,p,h,v,w=[],C=e.length,_=0,b=g,S=m;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&A("not-basic"),w.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<C;){for(i=_,s=1,a=l;o>=C&&A("invalid-input"),((u=(v=e.charCodeAt(o++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:l)>=l||u>x((c-_)/s))&&A("overflow"),_+=u*s,!(u<(p=a<=S?d:a>=S+f?f:a-S));a+=l)s>x(c/(h=l-p))&&A("overflow"),s*=h;S=T(_-i,t=w.length+1,0==i),x(_/t)>c-b&&A("overflow"),b+=x(_/t),_%=t,w.splice(_++,0,b)}return P(w)}function z(e){var t,n,r,o,i,s,a,u,p,h,v,w,C,_,b,E=[];for(w=(e=I(e)).length,t=g,n=0,i=m,s=0;s<w;++s)(v=e[s])<128&&E.push(S(v));for(r=o=E.length,o&&E.push(y);r<w;){for(a=c,s=0;s<w;++s)(v=e[s])>=t&&v<a&&(a=v);for(a-t>x((c-n)/(C=r+1))&&A("overflow"),n+=(a-t)*C,t=a,s=0;s<w;++s)if((v=e[s])<t&&++n>c&&A("overflow"),v==t){for(u=n,p=l;!(u<(h=p<=i?d:p>=i+f?f:p-i));p+=l)b=u-h,_=l-h,E.push(S(R(h+b%_,0))),u=x(b/_);E.push(S(R(u,0))),i=T(n,C,r==o),n=0,++r}++n,++t}return E.join("")}if(a={version:"1.3.2",ucs2:{decode:I,encode:P},decode:q,encode:z,toASCII:function(e){return O(e,(function(e){return w.test(e)?"xn--"+z(e):e}))},toUnicode:function(e){return O(e,(function(e){return v.test(e)?q(e.slice(4).toLowerCase()):e}))}},r&&i)if(e.exports==r)i.exports=a;else for(u in a)a.hasOwnProperty(u)&&(r[u]=a[u]);else n.punycode=a}(o.commonjsGlobal)}(Ut,Ut.exports)),Ut.exports),function(){return kt||(kt=1,e=Ft,t=o.commonjsGlobal,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(":"),o=r.length,i=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[o-1]&&""===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==r[t];t++);if(t<i)for(r.splice(t,1,"0000");r.length<i;)r.splice(t,0,"0000");for(var s=0;s<i;s++){n=r[s].split("");for(var a=0;a<3&&"0"===n[0]&&n.length>1;a++)n.splice(0,1);r[s]=n.join("")}var u=-1,c=0,l=0,d=-1,f=!1;for(s=0;s<i;s++)f?"0"===r[s]?l+=1:(f=!1,l>c&&(u=d,c=l)):"0"===r[s]&&(f=!0,d=s,l=1);l>c&&(u=d,c=l),c>1&&r.splice(u,c,""),o=r.length;var p="";for(""===r[0]&&(p=":"),s=0;s<o&&(p+=r[s],s!==o-1);s++)p+=":";return""===r[o-1]&&(p+=":"),p},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}},e.exports?e.exports=n():t.IPv6=n(t)),Ft.exports;var e,t,n}(),function(){return Nt||(Nt=1,e=$t,t=o.commonjsGlobal,n=function(e){var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n},e.exports?e.exports=n():t.SecondLevelDomains=n(t)),$t.exports;var e,t,n}()):Bt.URI=Vt(Bt.punycode,Bt.IPv6,Bt.SecondLevelDomains,Bt);var Lt=Dt.exports,Qt=o.getDefaultExportFromCjs(Lt);function Wt(e,t){if(null===e||"object"!=typeof e)return e;t=r.defaultValue(t,!1);const n=new e.constructor;for(const r in e)if(e.hasOwnProperty(r)){let o=e[r];t&&(o=Wt(o,t)),n[r]=o}return n}function Ht(){let e,t;const n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}function Yt(e,t){let n;return"undefined"!=typeof document&&(n=document),Yt._implementation(e,t,n)}Yt._implementation=function(e,t,n){if(!r.defined(t)){if(void 0===n)return e;t=r.defaultValue(n.baseURI,n.location.href)}const o=new Qt(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};const Zt={};function Gt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);let o=Zt[t];r.defined(o)||(o={},Zt[t]=o);let i=o[n];if(!r.defined(i)){const e=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const Jt=/^blob:/i;function Xt(e){return Jt.test(e)}let Kt;const en=/^data:/i;function tn(e){return en.test(e)}var nn=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});var rn=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function on(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,rn.OTHER),this.serverKey=e.serverKey,this.state=nn.UNISSUED,this.deferred=void 0,this.cancelled=!1}function sn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){const t={};if(!e)return t;const n=e.split("\r\n");for(let e=0;e<n.length;++e){const r=n[e],o=r.indexOf(": ");if(o>0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function an(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function un(e,t){return t-e}function cn(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function ln(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}on.prototype.cancel=function(){this.cancelled=!0},on.prototype.clone=function(e){return r.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=nn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new on(this)},sn.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(an.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),an.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},an.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i<n.length;i++)if(n[i]===e&&r[i]===t){o=i;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,r[o]=void 0):(n.splice(o,1),r.splice(o,1)),!0)},an.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const o=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(un),e=0;e<o;e++){const r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(cn.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){const t=this._length;if(e<t){const n=this._array;for(let r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),cn.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},cn.prototype.heapify=function(e){e=r.defaultValue(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;for(;s;){const r=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(ln(o,i,e),e=i):s=!1}},cn.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},cn.prototype.insert=function(e){const t=this._array,n=this._comparator,o=this._maximumLength;let i,s=this._length++;for(s<t.length?t[s]=e:t.push(e);0!==s;){const e=Math.floor((s-1)/2);if(!(n(t[s],t[e])<0))break;ln(t,s,e),s=e}return r.defined(o)&&this._length>o&&(i=t[o],this._length=o),i},cn.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return ln(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const dn={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let fn=20;const pn=new cn({comparator:function(e,t){return e.priority-t.priority}});pn.maximumLength=fn,pn.reserve(fn);const hn=[];let mn={};const gn="undefined"!=typeof document?new Qt(document.location.href):new Qt,yn=new an;function vn(){}function wn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Cn(e){return e.state===nn.UNISSUED&&(e.state=nn.ISSUED,e.deferred=Ht()),e.deferred.promise}function _n(e){const t=Cn(e);return e.state=nn.ACTIVE,hn.push(e),++dn.numberOfActiveRequests,++dn.numberOfActiveRequestsEver,++mn[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===nn.CANCELLED)return;const n=e.deferred;--dn.numberOfActiveRequests,--mn[e.serverKey],yn.raiseEvent(),e.state=nn.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).catch(function(e){return function(t){e.state!==nn.CANCELLED&&(++dn.numberOfFailedRequests,--dn.numberOfActiveRequests,--mn[e.serverKey],yn.raiseEvent(t),e.state=nn.FAILED,e.deferred.reject(t))}}(e)),t}function bn(e){const t=e.state===nn.ACTIVE;if(e.state=nn.CANCELLED,++dn.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--dn.numberOfActiveRequests,--mn[e.serverKey],++dn.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}vn.maximumRequests=50,vn.maximumRequestsPerServer=6,vn.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18},vn.throttleRequests=!0,vn.debugShowStatistics=!1,vn.requestCompletedEvent=yn,Object.defineProperties(vn,{statistics:{get:function(){return dn}},priorityHeapLength:{get:function(){return fn},set:function(e){if(e<fn)for(;pn.length>e;){bn(pn.pop())}fn=e,pn.maximumLength=e,pn.reserve(e)}}}),vn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(vn.requestsByServer[e],vn.maximumRequestsPerServer);return mn[e]+t<=n},vn.heapHasOpenSlots=function(e){return pn.length+e<=fn},vn.update=function(){let e,t,n=0;const r=hn.length;for(e=0;e<r;++e)t=hn[e],t.cancelled&&bn(t),t.state===nn.ACTIVE?n>0&&(hn[e-n]=t):++n;hn.length-=n;const o=pn.internalArray,i=pn.length;for(e=0;e<i;++e)wn(o[e]);pn.resort();const s=Math.max(vn.maximumRequests-hn.length,0);let a=0;for(;a<s&&pn.length>0;)t=pn.pop(),t.cancelled?bn(t):!t.throttleByServer||vn.serverHasOpenSlots(t.serverKey)?(_n(t),++a):bn(t);!function(){if(!vn.debugShowStatistics)return;0===dn.numberOfActiveRequests&&dn.lastNumberOfActiveRequests>0&&(dn.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${dn.numberOfAttemptedRequests}`),dn.numberOfAttemptedRequests=0),dn.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${dn.numberOfCancelledRequests}`),dn.numberOfCancelledRequests=0),dn.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${dn.numberOfCancelledActiveRequests}`),dn.numberOfCancelledActiveRequests=0),dn.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${dn.numberOfFailedRequests}`),dn.numberOfFailedRequests=0));dn.lastNumberOfActiveRequests=dn.numberOfActiveRequests}()},vn.getServerKey=function(e){let t=new Qt(e);""===t.scheme()&&(t=t.absoluteTo(gn),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const o=mn[n];return r.defined(o)||(mn[n]=0),n},vn.request=function(e){if(tn(e.url)||Xt(e.url))return yn.raiseEvent(),e.state=nn.RECEIVED,e.requestFunction();if(++dn.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=vn.getServerKey(e.url)),vn.throttleRequests&&e.throttleByServer&&!vn.serverHasOpenSlots(e.serverKey))return;if(!vn.throttleRequests||!e.throttle)return _n(e);if(hn.length>=vn.maximumRequests)return;wn(e);const t=pn.insert(e);if(r.defined(t)){if(t===e)return;bn(t)}return Cn(e)},vn.clearForSpecs=function(){for(;pn.length>0;){bn(pn.pop())}const e=hn.length;for(let t=0;t<e;++t)bn(hn[t]);hn.length=0,mn={},dn.numberOfAttemptedRequests=0,dn.numberOfActiveRequests=0,dn.numberOfCancelledRequests=0,dn.numberOfCancelledActiveRequests=0,dn.numberOfFailedRequests=0,dn.numberOfActiveRequestsEver=0,dn.lastNumberOfActiveRequests=0},vn.numberOfActiveRequestsByServer=function(e){return mn[e]},vn.requestHeap=pn;const xn={};let Sn={};xn.add=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(Sn[n])||(Sn[n]=!0)},xn.remove=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(Sn[n])&&delete Sn[n]},xn.contains=function(e){const t=function(e){const t=new Qt(e);t.normalize();let n=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){const e=n.split("@");n=e[1]}if(-1===n.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}return n}}(e);return!(!r.defined(t)||!r.defined(Sn[t]))},xn.clear=function(){Sn={}};var An=xn;const En=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function On(e){"string"==typeof(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=In(e.templateValues,{}),this._queryParameters=In(e.queryParameters,{}),this.headers=In(e.headers,{}),this.request=r.defaultValue(e.request,new on),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;r.defaultValue(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function In(e,t){return r.defined(e)?Wt(e):t}let Pn;function Rn(e,t,n){if(!n)return s.combine(e,t);const o=Wt(e,!0);for(const e in t)if(t.hasOwnProperty(e)){let n=o[e];const i=t[e];r.defined(n)?(Array.isArray(n)||(n=o[e]=[n]),o[e]=n.concat(i)):o[e]=Array.isArray(i)?i.slice():i}return o}function Tn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);const r=Ht();return On._Implementations.createImage(s,e,r,n,o,i),r.promise};const a=vn.request(s);if(r.defined(a))return a.catch((function(e){return s.state!==nn.FAILED?Promise.reject(e):t.retryOnError(e).then((function(r){return r?(s.state=nn.UNISSUED,s.deferred=void 0,Tn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(e)}))}))}function qn(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request,s=e.url;i.url=s,i.requestFunction=function(){const e=Ht();return window[n]=function(t){e.resolve(t);try{delete window[n]}catch(e){window[n]=void 0}},On._Implementations.loadAndExecuteScript(s,n,e),e.promise};const a=vn.request(i);if(r.defined(a))return a.catch((function(r){return i.state!==nn.FAILED?Promise.reject(r):e.retryOnError(r).then((function(o){return o?(i.state=nn.UNISSUED,i.deferred=void 0,qn(e,t,n)):Promise.reject(r)}))}))}function zn(e){if(e.state===nn.ISSUED||e.state===nn.ACTIVE)throw new a.RuntimeError("The Resource is already being fetched.");e.state=nn.UNISSUED,e.deferred=void 0}On.createIfNeeded=function(e){return e instanceof On?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new On({url:e})},On.supportsImageBitmapOptions=function(){if(r.defined(Pn))return Pn;if("function"!=typeof createImageBitmap)return Pn=Promise.resolve(!1),Pn;return Pn=On.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){return Promise.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){const t=Gt(e[0]),n=Gt(e[1]);return t[1]!==n[1]})).catch((function(){return!1})),Pn},Object.defineProperties(On,{isBlobSupported:{get:function(){return En}}}),Object.defineProperties(On.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return function(e){const t=new Qt(e);t.normalize();let n=t.path(),r=n.lastIndexOf("/");return-1!==r&&(n=n.substr(r+1)),r=n.lastIndexOf("."),n=-1===r?"":n.substr(r+1),n}(this._url)}},isDataUri:{get:function(){return tn(this._url)}},isBlobUri:{get:function(){return Xt(this._url)}},isCrossOriginUrl:{get:function(){return function(e){r.defined(Kt)||(Kt=document.createElement("a")),Kt.href=window.location.href;const t=Kt.host,n=Kt.protocol;return Kt.href=e,Kt.href=Kt.href,n!==Kt.protocol||t!==Kt.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),On.prototype.toString=function(){return this.getUrlComponent(!0,!0)},On.prototype.parseUrl=function(e,t,n,o){let i=new Qt(e);const s=function(e){if(0===e.length)return{};if(-1===e.indexOf("="))return{[e]:void 0};return function(e){const t={};if(""===e)return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,o=n.length;e<o;++e){const o=n[e].split("="),i=decodeURIComponent(o[0]);let s=o[1];s=r.defined(s)?decodeURIComponent(s):"";const a=t[i];"string"==typeof a?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}return t}(e)}(i.query());this._queryParameters=t?Rn(s,this.queryParameters,n):s,i.search(""),i.fragment(""),r.defined(o)&&""===i.scheme()&&(i=i.absoluteTo(Yt(o))),this._url=i.toString()},On.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${function(e){const t=Object.keys(e);if(0===t.length)return"";if(1===t.length&&!r.defined(e[t[0]]))return`?${t[0]}`;return`?${function(e){let t="";for(const n in e)if(e.hasOwnProperty(n)){const r=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(let e=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;else t+=`${o+encodeURIComponent(r)}&`}return t=t.slice(0,-1),t}(e)}`}(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,(function(e,t){const n=o[t];return r.defined(n)?encodeURIComponent(n):e}))),t&&r.defined(this.proxy)&&(n=this.proxy.getURL(n)),n},On.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Rn(this._queryParameters,e,!1):Rn(e,this._queryParameters,!1)},On.prototype.appendQueryParameters=function(e){this._queryParameters=Rn(e,this._queryParameters,!0)},On.prototype.setTemplateValues=function(e,t){this._templateValues=t?s.combine(this._templateValues,e):s.combine(e,this._templateValues)},On.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=r.defaultValue(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return r.defined(e.queryParameters)&&(t._queryParameters=s.combine(e.queryParameters,t.queryParameters)),r.defined(e.templateValues)&&(t._templateValues=s.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=s.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},On.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},On.prototype.clone=function(e){return r.defined(e)?(e._url=this._url,e._queryParameters=Wt(this._queryParameters),e._templateValues=Wt(this._templateValues),e.headers=Wt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new On({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:r.defined(this.credits)?this.credits.slice():void 0})},On.prototype.getBaseUri=function(e){return function(e,t){let n="";const r=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=new Qt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},On.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},On.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},On.fetchArrayBuffer=function(e){return new On(e).fetchArrayBuffer()},On.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},On.fetchBlob=function(e){return new On(e).fetchBlob()},On.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(zn(this.request),!En||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Tn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return On.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return On.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new On({url:t}),Tn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},On.fetchImage=function(e){return new On(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},On.prototype.fetchText=function(){return this.fetch({responseType:"text"})},On.fetchText=function(e){return new On(e).fetchText()},On.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))return e.then((function(e){if(r.defined(e))return JSON.parse(e)}))},On.fetchJson=function(e){return new On(e).fetchJson()},On.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},On.fetchXML=function(e){return new On(e).fetchXML()},On.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),zn(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return qn(this,e,t)},On.fetchJsonp=function(e){return new On(e).fetchJsonp(e.callbackParameterName)},On.prototype._makeRequest=function(e){const t=this;zn(t.request);const n=t.request,o=t.url;n.url=o,n.requestFunction=function(){const i=e.responseType,a=s.combine(e.headers,t.headers),u=e.overrideMimeType,c=e.method,l=e.data,d=Ht(),f=On._Implementations.loadWithXhr(o,i,c,l,a,d,u);return r.defined(f)&&r.defined(f.abort)&&(n.cancelFunction=function(){f.abort()}),d.promise};const i=vn.request(n);if(r.defined(i))return i.then((function(e){return n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==nn.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=nn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const Mn=/^data:(.*?)(;base64)?,(.*)$/;function Dn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Un(e,t){const n=Dn(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);return r}function kn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}On.prototype.fetch=function(e){return(e=In(e,{})).method="GET",this._makeRequest(e)},On.fetch=function(e){return new On(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On.prototype.delete=function(e){return(e=In(e,{})).method="DELETE",this._makeRequest(e)},On.delete=function(e){return new On(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},On.prototype.head=function(e){return(e=In(e,{})).method="HEAD",this._makeRequest(e)},On.head=function(e){return new On(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On.prototype.options=function(e){return(e=In(e,{})).method="OPTIONS",this._makeRequest(e)},On.options=function(e){return new On(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On.prototype.post=function(e,t){return f.defined("data",e),(t=In(t,{})).method="POST",t.data=e,this._makeRequest(t)},On.post=function(e){return new On(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On.prototype.put=function(e,t){return f.defined("data",e),(t=In(t,{})).method="PUT",t.data=e,this._makeRequest(t)},On.put=function(e){return new On(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On.prototype.patch=function(e,t){return f.defined("data",e),(t=In(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},On.patch=function(e){return new On(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},On._Implementations={},On._Implementations.loadImageElement=function(e,t,n){const r=new Image;r.onload=function(){0===r.naturalWidth&&0===r.naturalHeight&&0===r.width&&0===r.height&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(An.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},On._Implementations.createImage=function(e,t,n,o,i,s){const u=e.url;On.supportsImageBitmapOptions().then((function(c){if(!c||!s)return void On._Implementations.loadImageElement(u,t,n);const l=Ht(),d=On._Implementations.loadWithXhr(u,"blob","GET",void 0,void 0,l,void 0,void 0,void 0);return r.defined(d)&&r.defined(d.abort)&&(e.cancelFunction=function(){d.abort()}),l.promise.then((function(e){if(r.defined(e))return On.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});n.reject(new a.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then((function(e){n.resolve(e)}))})).catch((function(e){n.reject(e)}))},On.createImageBitmapFromBlob=function(e,t){return f.defined("options",t),f.typeOf.bool("options.flipY",t.flipY),f.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),f.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};const Fn="undefined"==typeof XMLHttpRequest;function Nn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data)?Bn(this,e.data):Bn(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function jn(e,t){return qt.compare(e.julianDate,t)}function Bn(e,t){if(!r.defined(t.columnNames))throw new a.RuntimeError("Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))throw new a.RuntimeError("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),u=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||u<0||c<0||l<0)throw new a.RuntimeError("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const d=e._samples=t.samples,f=e._dates=[];let p;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=u,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;const h=e._addNewLeapSeconds;for(let t=0,o=d.length;t<o;t+=e._columnCount){const e=d[t+n],o=d[t+l],i=new qt(e+pt.MODIFIED_JULIAN_DATE_DIFFERENCE,o,ht.TAI);if(f.push(i),h){if(o!==p&&r.defined(p)){const e=qt.leapSeconds,t=ut(e,i,jn);if(t<0){const n=new ft(i,o);e.splice(~t,0,n)}}p=o}}}function Vn(e,t,n,r,o){const i=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function $n(e,t,n){return t+e*(n-t)}function Ln(e,t,n,r,o,i,s){const a=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return Vn(e,n,o,a,s),s;if(r.equals(c))return Vn(e,n,i,a,s),s;const l=qt.secondsDifference(r,u)/qt.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=$n(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=$n(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=$n(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=$n(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=$n(l,p,h),s}function Qn(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}On._Implementations.loadWithXhr=function(t,n,o,i,s,c,l){const d=Mn.exec(t);if(null!==d)return void c.resolve(function(e,t){t=r.defaultValue(t,"");const n=e[1],o=!!e[2],i=e[3];let s,a;switch(t){case"":case"text":return Dn(o,i);case"arraybuffer":return Un(o,i);case"blob":return s=Un(o,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(Dn(o,i),n);case"json":return JSON.parse(Dn(o,i))}}(d,n));if(Fn)return void function(t,n,r,o,i,s,c){let l,d;Promise.all([new Promise((function(t,n){e(["url"],(function(e){t(u(e))}),n)})),new Promise((function(t,n){e(["zlib"],(function(e){t(u(e))}),n)}))]).then((([n,r])=>(l=n.parse(t),d=r,"https:"===l.protocol?new Promise((function(t,n){e(["https"],(function(e){t(u(e))}),n)})):new Promise((function(t,n){e(["http"],(function(e){t(u(e))}),n)}))))).then((e=>{const t={protocol:l.protocol,hostname:l.hostname,port:l.port,path:l.path,query:l.query,method:r,headers:i};e.request(t).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new sn(e.statusCode,e,e.headers));const t=[];e.on("data",(function(e){t.push(e)})),e.on("end",(function(){const r=Buffer.concat(t);"gzip"===e.headers["content-encoding"]?d.gunzip(r,(function(e,t){e?s.reject(new a.RuntimeError("Error decompressing response.")):s.resolve(kn(t,n))})):s.resolve(kn(r,n))}))})).on("error",(function(e){s.reject(new sn)})).end()}))}(t,n,o,0,s,c);const f=new XMLHttpRequest;if(An.contains(t)&&(f.withCredentials=!0),f.open(o,t,!0),r.defined(l)&&r.defined(f.overrideMimeType)&&f.overrideMimeType(l),r.defined(s))for(const e in s)s.hasOwnProperty(e)&&f.setRequestHeader(e,s[e]);r.defined(n)&&(f.responseType=n);let p=!1;return"string"==typeof t&&(p=0===t.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),f.onload=function(){if((f.status<200||f.status>=300)&&(!p||0!==f.status))return void c.reject(new sn(f.status,f.response,f.getAllResponseHeaders()));const e=f.response,t=f.responseType;if("HEAD"===o||"OPTIONS"===o){const e=f.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void c.resolve(t)}if(204===f.status)c.resolve();else if(!r.defined(e)||r.defined(n)&&t!==n)if("json"===n&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===t||"document"===t)&&r.defined(f.responseXML)&&f.responseXML.hasChildNodes()?c.resolve(f.responseXML):""!==t&&"text"!==t||!r.defined(f.responseText)?c.reject(new a.RuntimeError("Invalid XMLHttpRequest response type.")):c.resolve(f.responseText);else c.resolve(e)},f.onerror=function(e){c.reject(new sn)},f.send(i),f},On._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise(((e,n)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),e()},t.onerror=function(e){n(e)},r.appendChild(t)}))}(e).catch((function(e){n.reject(e)}))},On._DefaultImplementations={},On._DefaultImplementations.createImage=On._Implementations.createImage,On._DefaultImplementations.loadWithXhr=On._Implementations.loadWithXhr,On._DefaultImplementations.loadAndExecuteScript=On._Implementations.loadAndExecuteScript,On.DEFAULT=Object.freeze(new On({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),Nn.fromUrl=async function(e,t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT);const n=On.createIfNeeded(e);let o;try{o=await n.fetchJson()}catch(e){throw new a.RuntimeError(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Nn({addNewLeapSeconds:t.addNewLeapSeconds,data:o})},Nn.NONE=Object.freeze({compute:function(e,t){return r.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ct(0,0,0,0,0),t}}),Nn.prototype.compute=function(e,t){if(!r.defined(this._samples))return;if(r.defined(t)||(t=new ct(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,o=this._lastIndex;let i=0,s=0;if(r.defined(o)){const a=n[o],u=n[o+1],c=qt.lessThanOrEquals(a,e),l=!r.defined(u),d=l||qt.greaterThanOrEquals(u,e);if(c&&d)return i=o,!l&&u.equals(e)&&++i,s=i+1,Ln(this,n,this._samples,e,i,s,t),t}let a=ut(n,e,qt.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,i=a,s=a):(s=~a,i=s-1,i<0&&(i=0)),this._lastIndex=i,Ln(this,n,this._samples,e,i,s,t),t},Qn.fromQuaternion=function(e,t){r.defined(t)||(t=new Qn);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),s=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(u,a),t.roll=Math.atan2(s,i),t.pitch=-o.CesiumMath.asinClamped(n),t},Qn.fromDegrees=function(e,t,n,i){return r.defined(i)||(i=new Qn),i.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,i.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,i.roll=n*o.CesiumMath.RADIANS_PER_DEGREE,i},Qn.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Qn(e.heading,e.pitch,e.roll)},Qn.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},Qn.equalsEpsilon=function(e,t,n,i){return e===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},Qn.prototype.clone=function(e){return Qn.clone(this,e)},Qn.prototype.equals=function(e){return Qn.equals(this,e)},Qn.prototype.equalsEpsilon=function(e,t,n){return Qn.equalsEpsilon(this,e,t,n)},Qn.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Wn=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;let Hn,Yn,Zn;function Gn(e){return"undefined"==typeof document?e:(r.defined(Hn)||(Hn=document.createElement("a")),Hn.href=e,Hn.href=Hn.href,Hn.href)}function Jn(){if(r.defined(Yn))return Yn;let t;return t="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?Yt("..",er("Core/buildModuleUrl.js")):function(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const n=e[t].getAttribute("src"),r=Wn.exec(n);if(null!==r)return r[1]}}(),Yn=new On({url:Gn(t)}),Yn.appendForwardSlash(),Yn}function Xn(t){return Gn(e.toUrl(`../${t}`))}function Kn(e){return Jn().getDerivedResource({url:e}).url}function er(t){r.defined(Zn)||(Zn="object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?Xn:Kn);return Zn(t)}function tr(e,t,n){this.x=e,this.y=t,this.s=n}function nr(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=On.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new qt(this._sampleZeroJulianEphemerisDate,0,ht.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){n[e]=i,o[e]=e*this._stepSizeDays;for(let r=0;r<=t;++r)r!==e&&(n[e]*=e-r);n[e]=1/n[e]}this._work=new Array(t+1),this._coef=new Array(t+1)}er._cesiumScriptRegex=Wn,er._buildModuleUrlFromBaseUrl=Kn,er._clearBaseResource=function(){Yn=void 0},er.setBaseUrl=function(e){Yn=On.DEFAULT.getDerivedResource({url:e})},er.getCesiumBaseUrl=Jn;const rr=new qt(0,0,ht.TAI);function or(e,t,n){const r=rr;return r.dayNumber=t,r.secondsOfDay=n,qt.daysDifference(r,e._sampleZeroDateTT)}function ir(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const o=e._xysFileUrlTemplate;n=r.defined(o)?o.getDerivedResource({templateValues:{0:t}}):new On({url:er(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const i=n.fetchJson().then((function(n){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,o=n.samples,i=t*e._samplesPerXysFile*3;for(let e=0,t=o.length;e<t;++e)r[i+e]=o[e]}));return e._chunkDownloadsInProgress[t]=i,i}nr.prototype.preload=function(e,t,n,r){const o=or(this,e,t),i=or(this,n,r);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=i/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let e=u;e<=c;++e)l.push(ir(this,e));return Promise.all(l)},nr.prototype.computeXysRadians=function(e,t,n){const o=or(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(r.defined(l[3*a])||(ir(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(ir(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new tr(0,0,0);const d=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const sr={},ar={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ur={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},cr={},lr={east:new n.Cartesian3,north:new n.Cartesian3,up:new n.Cartesian3,west:new n.Cartesian3,south:new n.Cartesian3,down:new n.Cartesian3};let dr=new n.Cartesian3,fr=new n.Cartesian3,pr=new n.Cartesian3;sr.localFrameToFixedFrameGenerator=function(e,t){if(!ar.hasOwnProperty(e)||!ar[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");const s=ar[e][t];let a;const u=e+t;return r.defined(cr[u])?a=cr[u]:(a=function(a,u,c){if(r.defined(c)||(c=new i.Matrix4),n.Cartesian3.equalsEpsilon(a,n.Cartesian3.ZERO,o.CesiumMath.EPSILON14))n.Cartesian3.unpack(ur[e],0,dr),n.Cartesian3.unpack(ur[t],0,fr),n.Cartesian3.unpack(ur[s],0,pr);else if(o.CesiumMath.equalsEpsilon(a.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(a.y,0,o.CesiumMath.EPSILON14)){const r=o.CesiumMath.sign(a.z);n.Cartesian3.unpack(ur[e],0,dr),"east"!==e&&"west"!==e&&n.Cartesian3.multiplyByScalar(dr,r,dr),n.Cartesian3.unpack(ur[t],0,fr),"east"!==t&&"west"!==t&&n.Cartesian3.multiplyByScalar(fr,r,fr),n.Cartesian3.unpack(ur[s],0,pr),"east"!==s&&"west"!==s&&n.Cartesian3.multiplyByScalar(pr,r,pr)}else{(u=r.defaultValue(u,n.Ellipsoid.WGS84)).geodeticSurfaceNormal(a,lr.up);const o=lr.up,i=lr.east;i.x=-a.y,i.y=a.x,i.z=0,n.Cartesian3.normalize(i,lr.east),n.Cartesian3.cross(o,i,lr.north),n.Cartesian3.multiplyByScalar(lr.up,-1,lr.down),n.Cartesian3.multiplyByScalar(lr.east,-1,lr.west),n.Cartesian3.multiplyByScalar(lr.north,-1,lr.south),dr=lr[e],fr=lr[t],pr=lr[s]}return c[0]=dr.x,c[1]=dr.y,c[2]=dr.z,c[3]=0,c[4]=fr.x,c[5]=fr.y,c[6]=fr.z,c[7]=0,c[8]=pr.x,c[9]=pr.y,c[10]=pr.z,c[11]=0,c[12]=a.x,c[13]=a.y,c[14]=a.z,c[15]=1,c},cr[u]=a),a},sr.eastNorthUpToFixedFrame=sr.localFrameToFixedFrameGenerator("east","north"),sr.northEastDownToFixedFrame=sr.localFrameToFixedFrameGenerator("north","east"),sr.northUpEastToFixedFrame=sr.localFrameToFixedFrameGenerator("north","up"),sr.northWestUpToFixedFrame=sr.localFrameToFixedFrameGenerator("north","west");const hr=new De,mr=new n.Cartesian3(1,1,1),gr=new i.Matrix4;sr.headingPitchRollToFixedFrame=function(e,t,o,s,a){s=r.defaultValue(s,sr.eastNorthUpToFixedFrame);const u=De.fromHeadingPitchRoll(t,hr),c=i.Matrix4.fromTranslationQuaternionRotationScale(n.Cartesian3.ZERO,u,mr,gr);return a=s(e,o,a),i.Matrix4.multiply(a,c,a)};const yr=new i.Matrix4,vr=new n.Matrix3;sr.headingPitchRollQuaternion=function(e,t,n,r,o){const s=sr.headingPitchRollToFixedFrame(e,t,n,r,yr),a=i.Matrix4.getMatrix3(s,vr);return De.fromRotationMatrix(a,o)};const wr=new n.Cartesian3(1,1,1),Cr=new n.Cartesian3,_r=new i.Matrix4,br=new i.Matrix4,xr=new n.Matrix3,Sr=new De;sr.fixedFrameToHeadingPitchRoll=function(e,t,o,s){t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,sr.eastNorthUpToFixedFrame),r.defined(s)||(s=new Qn);const a=i.Matrix4.getTranslation(e,Cr);if(n.Cartesian3.equals(a,n.Cartesian3.ZERO))return s.heading=0,s.pitch=0,s.roll=0,s;let u=i.Matrix4.inverseTransformation(o(a,t,_r),_r),c=i.Matrix4.setScale(e,wr,br);c=i.Matrix4.setTranslation(c,n.Cartesian3.ZERO,c),u=i.Matrix4.multiply(u,c,u);let l=De.fromRotationMatrix(i.Matrix4.getMatrix3(u,xr),Sr);return l=De.normalize(l,l),Qn.fromQuaternion(l,s)};const Ar=o.CesiumMath.TWO_PI/86400;let Er=new qt;sr.computeTemeToPseudoFixedMatrix=function(e,t){Er=qt.addSeconds(e,-qt.computeTaiMinusUtc(e),Er);const i=Er.dayNumber,s=Er.secondsOfDay;let a;const u=i-2451545;a=s>=43200?(u+.5)/pt.DAYS_PER_JULIAN_CENTURY:(u-.5)/pt.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*Ar%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*pt.SECONDS_PER_DAY)%pt.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return r.defined(t)?(t[0]=l,t[1]=-d,t[2]=0,t[3]=d,t[4]=l,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new n.Matrix3(l,d,0,-d,l,0,0,0,1)},sr.iau2006XysData=new nr,sr.earthOrientationParameters=Nn.NONE;const Or=32.184;sr.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Or,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Or;return sr.iau2006XysData.preload(t,n,r,o)},sr.computeIcrfToFixedMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const o=sr.computeFixedToIcrfMatrix(e,t);if(r.defined(o))return n.Matrix3.transpose(o,t)};const Ir=new tr(0,0,0),Pr=new ct(0,0,0,0,0),Rr=new n.Matrix3,Tr=new n.Matrix3;sr.computeFixedToIcrfMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const i=sr.earthOrientationParameters.compute(e,Pr);if(!r.defined(i))return;const s=e.dayNumber,a=e.secondsOfDay+Or,u=sr.iau2006XysData.computeXysRadians(s,a,Ir);if(!r.defined(u))return;const c=u.x+i.xPoleOffset,l=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=Rr;f[0]=1-d*c*c,f[3]=-d*c*l,f[6]=c,f[1]=-d*c*l,f[4]=1-d*l*l,f[7]=l,f[2]=-c,f[5]=-l,f[8]=1-d*(c*c+l*l);const p=n.Matrix3.fromRotationZ(-u.s,Tr),h=n.Matrix3.multiply(f,p,Rr),m=e.dayNumber-2451545,g=(e.secondsOfDay-qt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/pt.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;const v=n.Matrix3.fromRotationZ(y,Tr),w=n.Matrix3.multiply(h,v,Rr),C=Math.cos(i.xPoleWander),_=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);let S=s-2451545+a/pt.SECONDS_PER_DAY;S/=36525;const A=-47e-6*S*o.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=Tr;return I[0]=C*E,I[1]=C*O,I[2]=b,I[3]=-_*O+x*b*E,I[4]=_*E+x*b*O,I[5]=-x*C,I[6]=-x*O-_*b*E,I[7]=x*E-_*b*O,I[8]=_*C,n.Matrix3.multiply(w,I,t)};const qr=new i.Cartesian4;sr.pointToWindowCoordinates=function(e,t,n,r){return(r=sr.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},sr.pointToGLWindowCoordinates=function(e,t,n,o){r.defined(o)||(o=new i.Cartesian2);const s=qr;return i.Matrix4.multiplyByVector(e,i.Cartesian4.fromElements(n.x,n.y,n.z,1,s),s),i.Cartesian4.multiplyByScalar(s,1/s.w,s),i.Matrix4.multiplyByVector(t,s,s),i.Cartesian2.fromCartesian4(s,o)};const zr=new n.Cartesian3,Mr=new n.Cartesian3,Dr=new n.Cartesian3;sr.rotationMatrixFromPositionVelocity=function(e,t,i,s){const a=r.defaultValue(i,n.Ellipsoid.WGS84).geodeticSurfaceNormal(e,zr);let u=n.Cartesian3.cross(t,a,Mr);n.Cartesian3.equalsEpsilon(u,n.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=n.Cartesian3.clone(n.Cartesian3.UNIT_X,u));const c=n.Cartesian3.cross(u,t,Dr);return n.Cartesian3.normalize(c,c),n.Cartesian3.cross(t,c,u),n.Cartesian3.negate(u,u),n.Cartesian3.normalize(u,u),r.defined(s)||(s=new n.Matrix3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=u.x,s[4]=u.y,s[5]=u.z,s[6]=c.x,s[7]=c.y,s[8]=c.z,s};const Ur=new i.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),kr=new n.Cartographic,Fr=new n.Cartesian3,Nr=new n.Cartesian3,jr=new n.Matrix3,Br=new i.Matrix4,Vr=new i.Matrix4;sr.basisTo2D=function(e,t,r){const o=i.Matrix4.getTranslation(t,Nr),s=e.ellipsoid,a=s.cartesianToCartographic(o,kr),u=e.project(a,Fr);n.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=sr.eastNorthUpToFixedFrame(o,s,Br),l=i.Matrix4.inverseTransformation(c,Vr),d=i.Matrix4.getMatrix3(t,jr),f=i.Matrix4.multiplyByMatrix3(l,d,r);return i.Matrix4.multiply(Ur,f,r),i.Matrix4.setTranslation(r,u,r),r},sr.wgs84To2DModelMatrix=function(e,t,r){const o=e.ellipsoid,s=sr.eastNorthUpToFixedFrame(t,o,Br),a=i.Matrix4.inverseTransformation(s,Vr),u=o.cartesianToCartographic(t,kr),c=e.project(u,Fr);n.Cartesian3.fromElements(c.z,c.x,c.y,c);const l=i.Matrix4.fromTranslation(c,Br);return i.Matrix4.multiply(Ur,a,r),i.Matrix4.multiply(l,r,r),r};var $r=sr;t.BoundingSphere=g,t.DeveloperError=c,t.FeatureDetection=Me,t.GeographicProjection=p,t.Intersect=h,t.Interval=m,t.Quaternion=De,t.Resource=On,t.Transforms=$r,t.buildModuleUrl=er})); diff --git a/public/lib/Cesium/Workers/WallGeometryLibrary-a8271824.js b/public/lib/Cesium/Workers/WallGeometryLibrary-12b21f08.js similarity index 90% rename from public/lib/Cesium/Workers/WallGeometryLibrary-a8271824.js rename to public/lib/Cesium/Workers/WallGeometryLibrary-12b21f08.js index 37dfa088..7db2e2c1 100644 --- a/public/lib/Cesium/Workers/WallGeometryLibrary-a8271824.js +++ b/public/lib/Cesium/Workers/WallGeometryLibrary-12b21f08.js @@ -1 +1 @@ -define(["exports","./arrayRemoveDuplicates-9b636830","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./PolylinePipeline-bcbea07f"],(function(e,t,i,n,o,r){"use strict";const a={};function s(e,t){return o.CesiumMath.equalsEpsilon(e.latitude,t.latitude,o.CesiumMath.EPSILON10)&&o.CesiumMath.equalsEpsilon(e.longitude,t.longitude,o.CesiumMath.EPSILON10)}const l=new i.Cartographic,h=new i.Cartographic;const g=new Array(2),c=new Array(2),u={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};a.computePositions=function(e,a,p,d,y,m){const P=function(e,o,r,a){const g=(o=t.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon)).length;if(g<2)return;const c=n.defined(a),u=n.defined(r),p=new Array(g),d=new Array(g),y=new Array(g),m=o[0];p[0]=m;const P=e.cartesianToCartographic(m,l);u&&(P.height=r[0]),d[0]=P.height,y[0]=c?a[0]:0;let f=d[0]===y[0],A=1;for(let t=1;t<g;++t){const n=o[t],l=e.cartesianToCartographic(n,h);u&&(l.height=r[t]),f=f&&0===l.height,s(P,l)?P.height<l.height&&(d[A-1]=l.height):(p[A]=n,d[A]=l.height,y[A]=c?a[t]:0,f=f&&d[A]===y[A],i.Cartographic.clone(l,P),++A)}return f||A<2?void 0:(p.length=A,d.length=A,y.length=A,{positions:p,topHeights:d,bottomHeights:y})}(e,a,p,d);if(!n.defined(P))return;a=P.positions,p=P.topHeights,d=P.bottomHeights;const f=a.length,A=f-2;let C,w;const v=o.CesiumMath.chordLength(y,e.maximumRadius),M=u;if(M.minDistance=v,M.ellipsoid=e,m){let e,t=0;for(e=0;e<f-1;e++)t+=r.PolylinePipeline.numberOfPoints(a[e],a[e+1],v)+1;C=new Float64Array(3*t),w=new Float64Array(3*t);const i=g,n=c;M.positions=i,M.height=n;let o=0;for(e=0;e<f-1;e++){i[0]=a[e],i[1]=a[e+1],n[0]=p[e],n[1]=p[e+1];const t=r.PolylinePipeline.generateArc(M);C.set(t,o),n[0]=d[e],n[1]=d[e+1],w.set(r.PolylinePipeline.generateArc(M),o),o+=t.length}}else M.positions=a,M.height=p,C=new Float64Array(r.PolylinePipeline.generateArc(M)),M.height=d,w=new Float64Array(r.PolylinePipeline.generateArc(M));return{bottomPositions:w,topPositions:C,numCorners:A}};var p=a;e.WallGeometryLibrary=p})); +define(["exports","./arrayRemoveDuplicates-0d8dde26","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./PolylinePipeline-8df321dd"],(function(e,t,i,n,o,r){"use strict";const a={};function s(e,t){return o.CesiumMath.equalsEpsilon(e.latitude,t.latitude,o.CesiumMath.EPSILON10)&&o.CesiumMath.equalsEpsilon(e.longitude,t.longitude,o.CesiumMath.EPSILON10)}const l=new i.Cartographic,h=new i.Cartographic;const g=new Array(2),c=new Array(2),u={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};a.computePositions=function(e,a,p,d,y,m){const P=function(e,o,r,a){const g=(o=t.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon)).length;if(g<2)return;const c=n.defined(a),u=n.defined(r),p=new Array(g),d=new Array(g),y=new Array(g),m=o[0];p[0]=m;const P=e.cartesianToCartographic(m,l);u&&(P.height=r[0]),d[0]=P.height,y[0]=c?a[0]:0;let f=d[0]===y[0],A=1;for(let t=1;t<g;++t){const n=o[t],l=e.cartesianToCartographic(n,h);u&&(l.height=r[t]),f=f&&0===l.height,s(P,l)?P.height<l.height&&(d[A-1]=l.height):(p[A]=n,d[A]=l.height,y[A]=c?a[t]:0,f=f&&d[A]===y[A],i.Cartographic.clone(l,P),++A)}return f||A<2?void 0:(p.length=A,d.length=A,y.length=A,{positions:p,topHeights:d,bottomHeights:y})}(e,a,p,d);if(!n.defined(P))return;a=P.positions,p=P.topHeights,d=P.bottomHeights;const f=a.length,A=f-2;let C,w;const v=o.CesiumMath.chordLength(y,e.maximumRadius),M=u;if(M.minDistance=v,M.ellipsoid=e,m){let e,t=0;for(e=0;e<f-1;e++)t+=r.PolylinePipeline.numberOfPoints(a[e],a[e+1],v)+1;C=new Float64Array(3*t),w=new Float64Array(3*t);const i=g,n=c;M.positions=i,M.height=n;let o=0;for(e=0;e<f-1;e++){i[0]=a[e],i[1]=a[e+1],n[0]=p[e],n[1]=p[e+1];const t=r.PolylinePipeline.generateArc(M);C.set(t,o),n[0]=d[e],n[1]=d[e+1],w.set(r.PolylinePipeline.generateArc(M),o),o+=t.length}}else M.positions=a,M.height=p,C=new Float64Array(r.PolylinePipeline.generateArc(M)),M.height=d,w=new Float64Array(r.PolylinePipeline.generateArc(M));return{bottomPositions:w,topPositions:C,numCorners:A}};var p=a;e.WallGeometryLibrary=p})); diff --git a/public/lib/Cesium/Workers/WebMercatorProjection-943e2226.js b/public/lib/Cesium/Workers/WebMercatorProjection-db7467f4.js similarity index 89% rename from public/lib/Cesium/Workers/WebMercatorProjection-943e2226.js rename to public/lib/Cesium/Workers/WebMercatorProjection-db7467f4.js index b8dde820..18cf4d2f 100644 --- a/public/lib/Cesium/Workers/WebMercatorProjection-943e2226.js +++ b/public/lib/Cesium/Workers/WebMercatorProjection-db7467f4.js @@ -1 +1 @@ -define(["exports","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(t,e,i,o){"use strict";function a(t){this._ellipsoid=i.defaultValue(t,e.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.mercatorAngleToGeodeticLatitude=function(t){return o.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},a.geodeticLatitudeToMercatorAngle=function(t){t>a.MaximumLatitude?t=a.MaximumLatitude:t<-a.MaximumLatitude&&(t=-a.MaximumLatitude);const e=Math.sin(t);return.5*Math.log((1+e)/(1-e))},a.MaximumLatitude=a.mercatorAngleToGeodeticLatitude(Math.PI),a.prototype.project=function(t,o){const r=this._semimajorAxis,n=t.longitude*r,u=a.geodeticLatitudeToMercatorAngle(t.latitude)*r,d=t.height;return i.defined(o)?(o.x=n,o.y=u,o.z=d,o):new e.Cartesian3(n,u,d)},a.prototype.unproject=function(t,o){const r=this._oneOverSemimajorAxis,n=t.x*r,u=a.mercatorAngleToGeodeticLatitude(t.y*r),d=t.z;return i.defined(o)?(o.longitude=n,o.latitude=u,o.height=d,o):new e.Cartographic(n,u,d)},t.WebMercatorProjection=a})); +define(["exports","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6"],(function(t,e,i,o){"use strict";function a(t){this._ellipsoid=i.defaultValue(t,e.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.mercatorAngleToGeodeticLatitude=function(t){return o.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},a.geodeticLatitudeToMercatorAngle=function(t){t>a.MaximumLatitude?t=a.MaximumLatitude:t<-a.MaximumLatitude&&(t=-a.MaximumLatitude);const e=Math.sin(t);return.5*Math.log((1+e)/(1-e))},a.MaximumLatitude=a.mercatorAngleToGeodeticLatitude(Math.PI),a.prototype.project=function(t,o){const r=this._semimajorAxis,n=t.longitude*r,u=a.geodeticLatitudeToMercatorAngle(t.latitude)*r,d=t.height;return i.defined(o)?(o.x=n,o.y=u,o.z=d,o):new e.Cartesian3(n,u,d)},a.prototype.unproject=function(t,o){const r=this._oneOverSemimajorAxis,n=t.x*r,u=a.mercatorAngleToGeodeticLatitude(t.y*r),d=t.z;return i.defined(o)?(o.longitude=n,o.latitude=u,o.height=d,o):new e.Cartographic(n,u,d)},t.WebMercatorProjection=a})); diff --git a/public/lib/Cesium/Workers/arrayRemoveDuplicates-9b636830.js b/public/lib/Cesium/Workers/arrayRemoveDuplicates-0d8dde26.js similarity index 88% rename from public/lib/Cesium/Workers/arrayRemoveDuplicates-9b636830.js rename to public/lib/Cesium/Workers/arrayRemoveDuplicates-0d8dde26.js index ccad6345..f4f0a819 100644 --- a/public/lib/Cesium/Workers/arrayRemoveDuplicates-9b636830.js +++ b/public/lib/Cesium/Workers/arrayRemoveDuplicates-0d8dde26.js @@ -1 +1 @@ -define(["exports","./defaultValue-f6d5e6da","./Math-2ce22ee9"],(function(e,n,t){"use strict";const i=t.CesiumMath.EPSILON10;e.arrayRemoveDuplicates=function(e,t,d,f){if(!n.defined(e))return;d=n.defaultValue(d,!1);const u=n.defined(f),s=e.length;if(s<2)return e;let l,r,a,c=e[0],h=0,o=-1;for(l=1;l<s;++l)r=e[l],t(c,r,i)?(n.defined(a)||(a=e.slice(0,l),h=l-1,o=0),u&&f.push(l)):(n.defined(a)&&(a.push(r),h=l,u&&(o=f.length)),c=r);return d&&t(e[0],e[s-1],i)&&(u&&(n.defined(a)?f.splice(o,0,h):f.push(s-1)),n.defined(a)?a.length-=1:a=e.slice(0,-1)),n.defined(a)?a:e}})); +define(["exports","./defaultValue-f6d5e6da","./Math-355606c6"],(function(e,n,t){"use strict";const i=t.CesiumMath.EPSILON10;e.arrayRemoveDuplicates=function(e,t,d,f){if(!n.defined(e))return;d=n.defaultValue(d,!1);const u=n.defined(f),s=e.length;if(s<2)return e;let l,r,a,c=e[0],h=0,o=-1;for(l=1;l<s;++l)r=e[l],t(c,r,i)?(n.defined(a)||(a=e.slice(0,l),h=l-1,o=0),u&&f.push(l)):(n.defined(a)&&(a.push(r),h=l,u&&(o=f.length)),c=r);return d&&t(e[0],e[s-1],i)&&(u&&(n.defined(a)?f.splice(o,0,h):f.push(s-1)),n.defined(a)?a.length-=1:a=e.slice(0,-1)),n.defined(a)?a:e}})); diff --git a/public/lib/Cesium/Workers/cesiumWorkerBootstrapper.js b/public/lib/Cesium/Workers/cesiumWorkerBootstrapper.js index be5f13e2..9e0e3c38 100644 --- a/public/lib/Cesium/Workers/cesiumWorkerBootstrapper.js +++ b/public/lib/Cesium/Workers/cesiumWorkerBootstrapper.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/lib/Cesium/Workers/combineGeometry.js b/public/lib/Cesium/Workers/combineGeometry.js index f9f143a4..0983fcae 100644 --- a/public/lib/Cesium/Workers/combineGeometry.js +++ b/public/lib/Cesium/Workers/combineGeometry.js @@ -1 +1 @@ -define(["./PrimitivePipeline-adac135e","./createTaskProcessorWorker","./Transforms-b3716b06","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-fea557d0","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./IndexDatatype-d3db4e7d","./IntersectionTests-56142431","./Plane-6add0ae1","./WebMercatorProjection-943e2226"],(function(e,t,i,r,n,o,a,s,m,c,u,P,p,b,l,y,G,d,f,C){"use strict";return t((function(t,i){const r=e.PrimitivePipeline.unpackCombineGeometryParameters(t),n=e.PrimitivePipeline.combineGeometry(r);return e.PrimitivePipeline.packCombineGeometryResults(n,i)}))})); +define(["./PrimitivePipeline-72a87ada","./createTaskProcessorWorker","./Transforms-f17097e5","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-a9233ae3","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./IndexDatatype-a9b1bc18","./IntersectionTests-f1b36d69","./Plane-5931b53e","./WebMercatorProjection-db7467f4"],(function(e,t,i,r,n,o,a,s,m,c,u,P,p,b,l,y,G,d,f,C){"use strict";return t((function(t,i){const r=e.PrimitivePipeline.unpackCombineGeometryParameters(t),n=e.PrimitivePipeline.combineGeometry(r);return e.PrimitivePipeline.packCombineGeometryResults(n,i)}))})); diff --git a/public/lib/Cesium/Workers/createBoxGeometry.js b/public/lib/Cesium/Workers/createBoxGeometry.js index 7d1f08a0..9aa4b9db 100644 --- a/public/lib/Cesium/Workers/createBoxGeometry.js +++ b/public/lib/Cesium/Workers/createBoxGeometry.js @@ -1 +1 @@ -define(["./BoxGeometry-0a50f4ca","./defaultValue-f6d5e6da","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922"],(function(e,t,r,o,n,a,m,i,u,f,s,y,G,c){"use strict";return function(r,o){return t.defined(o)&&(r=e.BoxGeometry.unpack(r,o)),e.BoxGeometry.createGeometry(r)}})); +define(["./BoxGeometry-bbe159e0","./defaultValue-f6d5e6da","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922"],(function(e,t,r,o,n,a,m,i,u,f,s,y,G,c){"use strict";return function(r,o){return t.defined(o)&&(r=e.BoxGeometry.unpack(r,o)),e.BoxGeometry.createGeometry(r)}})); diff --git a/public/lib/Cesium/Workers/createBoxOutlineGeometry.js b/public/lib/Cesium/Workers/createBoxOutlineGeometry.js index c3e41b5d..b6912028 100644 --- a/public/lib/Cesium/Workers/createBoxOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createBoxOutlineGeometry.js @@ -1 +1 @@ -define(["./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(t,e,n,a,i,r,u,o,s,m,f,c){"use strict";const l=new e.Cartesian3;function p(t){const n=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).minimum,i=t.maximum;this._min=e.Cartesian3.clone(n),this._max=e.Cartesian3.clone(i),this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxOutlineGeometry"}p.fromDimensions=function(t){const n=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).dimensions,i=e.Cartesian3.multiplyByScalar(n,.5,new e.Cartesian3);return new p({minimum:e.Cartesian3.negate(i,new e.Cartesian3),maximum:i,offsetAttribute:t.offsetAttribute})},p.fromAxisAlignedBoundingBox=function(t){return new p({minimum:t.minimum,maximum:t.maximum})},p.packedLength=2*e.Cartesian3.packedLength+1,p.pack=function(t,n,i){return i=a.defaultValue(i,0),e.Cartesian3.pack(t._min,n,i),e.Cartesian3.pack(t._max,n,i+e.Cartesian3.packedLength),n[i+2*e.Cartesian3.packedLength]=a.defaultValue(t._offsetAttribute,-1),n};const y=new e.Cartesian3,d=new e.Cartesian3,C={minimum:y,maximum:d,offsetAttribute:void 0};return p.unpack=function(t,n,i){n=a.defaultValue(n,0);const r=e.Cartesian3.unpack(t,n,y),u=e.Cartesian3.unpack(t,n+e.Cartesian3.packedLength,d),o=t[n+2*e.Cartesian3.packedLength];return a.defined(i)?(i._min=e.Cartesian3.clone(r,i._min),i._max=e.Cartesian3.clone(u,i._max),i._offsetAttribute=-1===o?void 0:o,i):(C.offsetAttribute=-1===o?void 0:o,new p(C))},p.createGeometry=function(o){const s=o._min,m=o._max;if(e.Cartesian3.equals(s,m))return;const f=new r.GeometryAttributes,c=new Uint16Array(24),p=new Float64Array(24);p[0]=s.x,p[1]=s.y,p[2]=s.z,p[3]=m.x,p[4]=s.y,p[5]=s.z,p[6]=m.x,p[7]=m.y,p[8]=s.z,p[9]=s.x,p[10]=m.y,p[11]=s.z,p[12]=s.x,p[13]=s.y,p[14]=m.z,p[15]=m.x,p[16]=s.y,p[17]=m.z,p[18]=m.x,p[19]=m.y,p[20]=m.z,p[21]=s.x,p[22]=m.y,p[23]=m.z,f.position=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),c[0]=4,c[1]=5,c[2]=5,c[3]=6,c[4]=6,c[5]=7,c[6]=7,c[7]=4,c[8]=0,c[9]=1,c[10]=1,c[11]=2,c[12]=2,c[13]=3,c[14]=3,c[15]=0,c[16]=0,c[17]=4,c[18]=1,c[19]=5,c[20]=2,c[21]=6,c[22]=3,c[23]=7;const y=e.Cartesian3.subtract(m,s,l),d=.5*e.Cartesian3.magnitude(y);if(a.defined(o._offsetAttribute)){const t=p.length,e=o._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,a=new Uint8Array(t/3).fill(e);f.applyOffset=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return new i.Geometry({attributes:f,indices:c,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(e.Cartesian3.ZERO,d),offsetAttribute:o._offsetAttribute})},function(t,e){return a.defined(e)&&(t=p.unpack(t,e)),p.createGeometry(t)}})); +define(["./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(t,e,n,a,i,r,u,o,s,m,f,c){"use strict";const l=new e.Cartesian3;function p(t){const n=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).minimum,i=t.maximum;this._min=e.Cartesian3.clone(n),this._max=e.Cartesian3.clone(i),this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxOutlineGeometry"}p.fromDimensions=function(t){const n=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).dimensions,i=e.Cartesian3.multiplyByScalar(n,.5,new e.Cartesian3);return new p({minimum:e.Cartesian3.negate(i,new e.Cartesian3),maximum:i,offsetAttribute:t.offsetAttribute})},p.fromAxisAlignedBoundingBox=function(t){return new p({minimum:t.minimum,maximum:t.maximum})},p.packedLength=2*e.Cartesian3.packedLength+1,p.pack=function(t,n,i){return i=a.defaultValue(i,0),e.Cartesian3.pack(t._min,n,i),e.Cartesian3.pack(t._max,n,i+e.Cartesian3.packedLength),n[i+2*e.Cartesian3.packedLength]=a.defaultValue(t._offsetAttribute,-1),n};const y=new e.Cartesian3,d=new e.Cartesian3,C={minimum:y,maximum:d,offsetAttribute:void 0};return p.unpack=function(t,n,i){n=a.defaultValue(n,0);const r=e.Cartesian3.unpack(t,n,y),u=e.Cartesian3.unpack(t,n+e.Cartesian3.packedLength,d),o=t[n+2*e.Cartesian3.packedLength];return a.defined(i)?(i._min=e.Cartesian3.clone(r,i._min),i._max=e.Cartesian3.clone(u,i._max),i._offsetAttribute=-1===o?void 0:o,i):(C.offsetAttribute=-1===o?void 0:o,new p(C))},p.createGeometry=function(o){const s=o._min,m=o._max;if(e.Cartesian3.equals(s,m))return;const f=new r.GeometryAttributes,c=new Uint16Array(24),p=new Float64Array(24);p[0]=s.x,p[1]=s.y,p[2]=s.z,p[3]=m.x,p[4]=s.y,p[5]=s.z,p[6]=m.x,p[7]=m.y,p[8]=s.z,p[9]=s.x,p[10]=m.y,p[11]=s.z,p[12]=s.x,p[13]=s.y,p[14]=m.z,p[15]=m.x,p[16]=s.y,p[17]=m.z,p[18]=m.x,p[19]=m.y,p[20]=m.z,p[21]=s.x,p[22]=m.y,p[23]=m.z,f.position=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),c[0]=4,c[1]=5,c[2]=5,c[3]=6,c[4]=6,c[5]=7,c[6]=7,c[7]=4,c[8]=0,c[9]=1,c[10]=1,c[11]=2,c[12]=2,c[13]=3,c[14]=3,c[15]=0,c[16]=0,c[17]=4,c[18]=1,c[19]=5,c[20]=2,c[21]=6,c[22]=3,c[23]=7;const y=e.Cartesian3.subtract(m,s,l),d=.5*e.Cartesian3.magnitude(y);if(a.defined(o._offsetAttribute)){const t=p.length,e=o._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,a=new Uint8Array(t/3).fill(e);f.applyOffset=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return new i.Geometry({attributes:f,indices:c,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(e.Cartesian3.ZERO,d),offsetAttribute:o._offsetAttribute})},function(t,e){return a.defined(e)&&(t=p.unpack(t,e)),p.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createCircleGeometry.js b/public/lib/Cesium/Workers/createCircleGeometry.js index 12bed426..0d435831 100644 --- a/public/lib/Cesium/Workers/createCircleGeometry.js +++ b/public/lib/Cesium/Workers/createCircleGeometry.js @@ -1 +1 @@ -define(["./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipseGeometry-436ecd16","./VertexFormat-fbdec922","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./IndexDatatype-d3db4e7d","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,i,r,o,n,s,l,a,m,d,u,p,c,y,_,x,G,h,g,f,E){"use strict";function w(e){const r=(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).radius,o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new i.EllipseGeometry(o),this._workerName="createCircleGeometry"}w.packedLength=i.EllipseGeometry.packedLength,w.pack=function(e,t,r){return i.EllipseGeometry.pack(e._ellipseGeometry,t,r)};const A=new i.EllipseGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),M={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new r.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return w.unpack=function(o,n,s){const l=i.EllipseGeometry.unpack(o,n,A);return M.center=e.Cartesian3.clone(l._center,M.center),M.ellipsoid=e.Ellipsoid.clone(l._ellipsoid,M.ellipsoid),M.height=l._height,M.extrudedHeight=l._extrudedHeight,M.granularity=l._granularity,M.vertexFormat=r.VertexFormat.clone(l._vertexFormat,M.vertexFormat),M.stRotation=l._stRotation,M.shadowVolume=l._shadowVolume,t.defined(s)?(M.semiMajorAxis=l._semiMajorAxis,M.semiMinorAxis=l._semiMinorAxis,s._ellipseGeometry=new i.EllipseGeometry(M),s):(M.radius=l._semiMajorAxis,new w(M))},w.createGeometry=function(e){return i.EllipseGeometry.createGeometry(e._ellipseGeometry)},w.createShadowVolume=function(e,t,i){const o=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,s=t(o,n),l=i(o,n);return new w({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:o,extrudedHeight:s,height:l,vertexFormat:r.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(w.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(i,r){return t.defined(r)&&(i=w.unpack(i,r)),i._ellipseGeometry._center=e.Cartesian3.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(i._ellipseGeometry._ellipsoid),w.createGeometry(i)}})); +define(["./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipseGeometry-e2d7986e","./VertexFormat-fbdec922","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./IndexDatatype-a9b1bc18","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,i,r,o,n,s,l,a,m,d,u,p,c,y,_,x,G,h,g,f,E){"use strict";function w(e){const r=(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).radius,o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new i.EllipseGeometry(o),this._workerName="createCircleGeometry"}w.packedLength=i.EllipseGeometry.packedLength,w.pack=function(e,t,r){return i.EllipseGeometry.pack(e._ellipseGeometry,t,r)};const A=new i.EllipseGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),M={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new r.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return w.unpack=function(o,n,s){const l=i.EllipseGeometry.unpack(o,n,A);return M.center=e.Cartesian3.clone(l._center,M.center),M.ellipsoid=e.Ellipsoid.clone(l._ellipsoid,M.ellipsoid),M.height=l._height,M.extrudedHeight=l._extrudedHeight,M.granularity=l._granularity,M.vertexFormat=r.VertexFormat.clone(l._vertexFormat,M.vertexFormat),M.stRotation=l._stRotation,M.shadowVolume=l._shadowVolume,t.defined(s)?(M.semiMajorAxis=l._semiMajorAxis,M.semiMinorAxis=l._semiMinorAxis,s._ellipseGeometry=new i.EllipseGeometry(M),s):(M.radius=l._semiMajorAxis,new w(M))},w.createGeometry=function(e){return i.EllipseGeometry.createGeometry(e._ellipseGeometry)},w.createShadowVolume=function(e,t,i){const o=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,s=t(o,n),l=i(o,n);return new w({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:o,extrudedHeight:s,height:l,vertexFormat:r.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(w.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(i,r){return t.defined(r)&&(i=w.unpack(i,r)),i._ellipseGeometry._center=e.Cartesian3.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(i._ellipseGeometry._ellipsoid),w.createGeometry(i)}})); diff --git a/public/lib/Cesium/Workers/createCircleOutlineGeometry.js b/public/lib/Cesium/Workers/createCircleOutlineGeometry.js index bd0b0bc4..26a14830 100644 --- a/public/lib/Cesium/Workers/createCircleOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createCircleOutlineGeometry.js @@ -1 +1 @@ -define(["./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipseOutlineGeometry-14470848","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d"],(function(e,i,t,r,l,n,o,s,a,u,m,c,d,p,y){"use strict";function G(e){const r=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).radius,l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new t.EllipseOutlineGeometry(l),this._workerName="createCircleOutlineGeometry"}G.packedLength=t.EllipseOutlineGeometry.packedLength,G.pack=function(e,i,r){return t.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,r)};const _=new t.EllipseOutlineGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),f={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return G.unpack=function(r,l,n){const o=t.EllipseOutlineGeometry.unpack(r,l,_);return f.center=e.Cartesian3.clone(o._center,f.center),f.ellipsoid=e.Ellipsoid.clone(o._ellipsoid,f.ellipsoid),f.height=o._height,f.extrudedHeight=o._extrudedHeight,f.granularity=o._granularity,f.numberOfVerticalLines=o._numberOfVerticalLines,i.defined(n)?(f.semiMajorAxis=o._semiMajorAxis,f.semiMinorAxis=o._semiMinorAxis,n._ellipseGeometry=new t.EllipseOutlineGeometry(f),n):(f.radius=o._semiMajorAxis,new G(f))},G.createGeometry=function(e){return t.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(t,r){return i.defined(r)&&(t=G.unpack(t,r)),t._ellipseGeometry._center=e.Cartesian3.clone(t._ellipseGeometry._center),t._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(t._ellipseGeometry._ellipsoid),G.createGeometry(t)}})); +define(["./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipseOutlineGeometry-3d88fb74","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18"],(function(e,i,t,r,l,n,o,s,a,u,m,c,d,p,y){"use strict";function G(e){const r=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).radius,l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new t.EllipseOutlineGeometry(l),this._workerName="createCircleOutlineGeometry"}G.packedLength=t.EllipseOutlineGeometry.packedLength,G.pack=function(e,i,r){return t.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,r)};const _=new t.EllipseOutlineGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),f={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return G.unpack=function(r,l,n){const o=t.EllipseOutlineGeometry.unpack(r,l,_);return f.center=e.Cartesian3.clone(o._center,f.center),f.ellipsoid=e.Ellipsoid.clone(o._ellipsoid,f.ellipsoid),f.height=o._height,f.extrudedHeight=o._extrudedHeight,f.granularity=o._granularity,f.numberOfVerticalLines=o._numberOfVerticalLines,i.defined(n)?(f.semiMajorAxis=o._semiMajorAxis,f.semiMinorAxis=o._semiMinorAxis,n._ellipseGeometry=new t.EllipseOutlineGeometry(f),n):(f.radius=o._semiMajorAxis,new G(f))},G.createGeometry=function(e){return t.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(t,r){return i.defined(r)&&(t=G.unpack(t,r)),t._ellipseGeometry._center=e.Cartesian3.clone(t._ellipseGeometry._center),t._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(t._ellipseGeometry._ellipsoid),G.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createCoplanarPolygonGeometry.js b/public/lib/Cesium/Workers/createCoplanarPolygonGeometry.js index 492a1e00..5f24a00f 100644 --- a/public/lib/Cesium/Workers/createCoplanarPolygonGeometry.js +++ b/public/lib/Cesium/Workers/createCoplanarPolygonGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-9b636830","./BoundingRectangle-9216d683","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./CoplanarPolygonGeometryLibrary-21546fbd","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonGeometryLibrary-f2ea6fbf","./PolygonPipeline-87656bae","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./OrientedBoundingBox-8446a826","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./ArcType-26a3f38d","./EllipsoidRhumbLine-77eff028"],(function(e,t,n,o,r,a,i,s,l,y,c,p,u,m,d,g,h,x,C,b,f,P,A,w,L,G,F,v,E){"use strict";const _=new r.Cartesian3,T=new t.BoundingRectangle,k=new o.Cartesian2,D=new o.Cartesian2,V=new r.Cartesian3,R=new r.Cartesian3,H=new r.Cartesian3,I=new r.Cartesian3,M=new r.Cartesian3,B=new r.Cartesian3,O=new n.Quaternion,z=new r.Matrix3,S=new r.Matrix3,N=new r.Cartesian3;function Q(e,t,i,c,p,d,h,x,C){const b=e.positions;let f=g.PolygonPipeline.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);const P=u.IndexDatatype.createTypedArray(b.length,f.length);P.set(f);let A=z;if(0!==c){let e=n.Quaternion.fromAxisAngle(h,c,O);if(A=r.Matrix3.fromQuaternion(e,A),t.tangent||t.bitangent){e=n.Quaternion.fromAxisAngle(h,-c,O);const o=r.Matrix3.fromQuaternion(e,S);x=r.Cartesian3.normalize(r.Matrix3.multiplyByVector(o,x,x),x),t.bitangent&&(C=r.Cartesian3.normalize(r.Cartesian3.cross(h,x,C),C))}}else A=r.Matrix3.clone(r.Matrix3.IDENTITY,A);const w=D;t.st&&(w.x=i.x,w.y=i.y);const L=b.length,G=3*L,F=new Float64Array(G),v=t.normal?new Float32Array(G):void 0,E=t.tangent?new Float32Array(G):void 0,T=t.bitangent?new Float32Array(G):void 0,V=t.st?new Float32Array(2*L):void 0;let R=0,H=0,I=0,M=0,B=0;for(let e=0;e<L;e++){const n=b[e];if(F[R++]=n.x,F[R++]=n.y,F[R++]=n.z,t.st)if(s.defined(p)&&p.positions.length===L)V[B++]=p.positions[e].x,V[B++]=p.positions[e].y;else{const e=d(r.Matrix3.multiplyByVector(A,n,_),k);o.Cartesian2.subtract(e,w,e);const t=m.CesiumMath.clamp(e.x/i.width,0,1),a=m.CesiumMath.clamp(e.y/i.height,0,1);V[B++]=t,V[B++]=a}t.normal&&(v[H++]=h.x,v[H++]=h.y,v[H++]=h.z),t.tangent&&(E[M++]=x.x,E[M++]=x.y,E[M++]=x.z),t.bitangent&&(T[I++]=C.x,T[I++]=C.y,T[I++]=C.z)}const N=new y.GeometryAttributes;return t.position&&(N.position=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),t.normal&&(N.normal=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(N.tangent=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(N.bitangent=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(N.st=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),new l.Geometry({attributes:N,indices:P,primitiveType:l.PrimitiveType.TRIANGLES})}function j(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=e.textureCoordinates,a=s.defaultValue(e.vertexFormat,h.VertexFormat.DEFAULT);this._vertexFormat=h.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=r.Ellipsoid.clone(s.defaultValue(e.ellipsoid,r.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=d.PolygonGeometryLibrary.computeHierarchyPackedLength(t,r.Cartesian3)+h.VertexFormat.packedLength+r.Ellipsoid.packedLength+(s.defined(n)?d.PolygonGeometryLibrary.computeHierarchyPackedLength(n,o.Cartesian2):1)+2}j.fromPositions=function(e){return new j({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates})},j.pack=function(e,t,n){return n=s.defaultValue(n,0),n=d.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n,r.Cartesian3),r.Ellipsoid.pack(e._ellipsoid,t,n),n+=r.Ellipsoid.packedLength,h.VertexFormat.pack(e._vertexFormat,t,n),n+=h.VertexFormat.packedLength,t[n++]=e._stRotation,s.defined(e._textureCoordinates)?n=d.PolygonGeometryLibrary.packPolygonHierarchy(e._textureCoordinates,t,n,o.Cartesian2):t[n++]=-1,t[n++]=e.packedLength,t};const U=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),Y=new h.VertexFormat,q={polygonHierarchy:{}};return j.unpack=function(e,t,n){t=s.defaultValue(t,0);const a=d.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,r.Cartesian3);t=a.startingIndex,delete a.startingIndex;const i=r.Ellipsoid.unpack(e,t,U);t+=r.Ellipsoid.packedLength;const l=h.VertexFormat.unpack(e,t,Y);t+=h.VertexFormat.packedLength;const y=e[t++],c=-1===e[t]?void 0:d.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,o.Cartesian2);s.defined(c)?(t=c.startingIndex,delete c.startingIndex):t++;const p=e[t++];return s.defined(n)||(n=new j(q)),n._polygonHierarchy=a,n._ellipsoid=r.Ellipsoid.clone(i,n._ellipsoid),n._vertexFormat=h.VertexFormat.clone(l,n._vertexFormat),n._stRotation=y,n._textureCoordinates=c,n.packedLength=p,n},j.createGeometry=function(t){const o=t._vertexFormat,a=t._polygonHierarchy,y=t._stRotation,g=t._textureCoordinates,h=s.defined(g);let x=a.positions;if(x=e.arrayRemoveDuplicates(x,r.Cartesian3.equalsEpsilon,!0),x.length<3)return;let C=V,b=R,f=H,P=M;const A=B;if(!i.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(x,I,P,A))return;if(C=r.Cartesian3.cross(P,A,C),C=r.Cartesian3.normalize(C,C),!r.Cartesian3.equalsEpsilon(I,r.Cartesian3.ZERO,m.CesiumMath.EPSILON6)){const e=t._ellipsoid.geodeticSurfaceNormal(I,N);r.Cartesian3.dot(C,e)<0&&(C=r.Cartesian3.negate(C,C),P=r.Cartesian3.negate(P,P))}const w=i.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(I,P,A),L=i.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(I,P,A);o.tangent&&(b=r.Cartesian3.clone(P,b)),o.bitangent&&(f=r.Cartesian3.clone(A,f));const G=d.PolygonGeometryLibrary.polygonsFromHierarchy(a,h,w,!1),F=G.hierarchy,v=G.polygons,E=h?d.PolygonGeometryLibrary.polygonsFromHierarchy(g,!0,(function(e){return e}),!1).polygons:void 0;if(0===F.length)return;x=F[0].outerRing;const _=n.BoundingSphere.fromPoints(x),k=d.PolygonGeometryLibrary.computeBoundingRectangle(C,L,x,y,T),D=[];for(let e=0;e<v.length;e++){const t=new c.GeometryInstance({geometry:Q(v[e],o,k,y,h?E[e]:void 0,L,C,b,f)});D.push(t)}const O=p.GeometryPipeline.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=u.IndexDatatype.createTypedArray(O.attributes.position.values.length/3,O.indices);const z=O.attributes;return o.position||delete z.position,new l.Geometry({attributes:z,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:_})},function(e,t){return s.defined(t)&&(e=j.unpack(e,t)),j.createGeometry(e)}})); +define(["./arrayRemoveDuplicates-0d8dde26","./BoundingRectangle-4ef16803","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./CoplanarPolygonGeometryLibrary-c5fc6f2f","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonGeometryLibrary-b67529a6","./PolygonPipeline-3fa47499","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./OrientedBoundingBox-c083edd8","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./ArcType-26a3f38d","./EllipsoidRhumbLine-1289f7e8"],(function(e,t,n,o,r,a,i,s,l,y,c,p,u,m,d,g,h,x,C,b,f,P,A,w,L,G,F,v,E){"use strict";const _=new r.Cartesian3,T=new t.BoundingRectangle,k=new o.Cartesian2,D=new o.Cartesian2,V=new r.Cartesian3,R=new r.Cartesian3,H=new r.Cartesian3,I=new r.Cartesian3,M=new r.Cartesian3,B=new r.Cartesian3,O=new n.Quaternion,z=new r.Matrix3,S=new r.Matrix3,N=new r.Cartesian3;function Q(e,t,i,c,p,d,h,x,C){const b=e.positions;let f=g.PolygonPipeline.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);const P=u.IndexDatatype.createTypedArray(b.length,f.length);P.set(f);let A=z;if(0!==c){let e=n.Quaternion.fromAxisAngle(h,c,O);if(A=r.Matrix3.fromQuaternion(e,A),t.tangent||t.bitangent){e=n.Quaternion.fromAxisAngle(h,-c,O);const o=r.Matrix3.fromQuaternion(e,S);x=r.Cartesian3.normalize(r.Matrix3.multiplyByVector(o,x,x),x),t.bitangent&&(C=r.Cartesian3.normalize(r.Cartesian3.cross(h,x,C),C))}}else A=r.Matrix3.clone(r.Matrix3.IDENTITY,A);const w=D;t.st&&(w.x=i.x,w.y=i.y);const L=b.length,G=3*L,F=new Float64Array(G),v=t.normal?new Float32Array(G):void 0,E=t.tangent?new Float32Array(G):void 0,T=t.bitangent?new Float32Array(G):void 0,V=t.st?new Float32Array(2*L):void 0;let R=0,H=0,I=0,M=0,B=0;for(let e=0;e<L;e++){const n=b[e];if(F[R++]=n.x,F[R++]=n.y,F[R++]=n.z,t.st)if(s.defined(p)&&p.positions.length===L)V[B++]=p.positions[e].x,V[B++]=p.positions[e].y;else{const e=d(r.Matrix3.multiplyByVector(A,n,_),k);o.Cartesian2.subtract(e,w,e);const t=m.CesiumMath.clamp(e.x/i.width,0,1),a=m.CesiumMath.clamp(e.y/i.height,0,1);V[B++]=t,V[B++]=a}t.normal&&(v[H++]=h.x,v[H++]=h.y,v[H++]=h.z),t.tangent&&(E[M++]=x.x,E[M++]=x.y,E[M++]=x.z),t.bitangent&&(T[I++]=C.x,T[I++]=C.y,T[I++]=C.z)}const N=new y.GeometryAttributes;return t.position&&(N.position=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),t.normal&&(N.normal=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(N.tangent=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(N.bitangent=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(N.st=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),new l.Geometry({attributes:N,indices:P,primitiveType:l.PrimitiveType.TRIANGLES})}function j(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=e.textureCoordinates,a=s.defaultValue(e.vertexFormat,h.VertexFormat.DEFAULT);this._vertexFormat=h.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=r.Ellipsoid.clone(s.defaultValue(e.ellipsoid,r.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=d.PolygonGeometryLibrary.computeHierarchyPackedLength(t,r.Cartesian3)+h.VertexFormat.packedLength+r.Ellipsoid.packedLength+(s.defined(n)?d.PolygonGeometryLibrary.computeHierarchyPackedLength(n,o.Cartesian2):1)+2}j.fromPositions=function(e){return new j({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates})},j.pack=function(e,t,n){return n=s.defaultValue(n,0),n=d.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n,r.Cartesian3),r.Ellipsoid.pack(e._ellipsoid,t,n),n+=r.Ellipsoid.packedLength,h.VertexFormat.pack(e._vertexFormat,t,n),n+=h.VertexFormat.packedLength,t[n++]=e._stRotation,s.defined(e._textureCoordinates)?n=d.PolygonGeometryLibrary.packPolygonHierarchy(e._textureCoordinates,t,n,o.Cartesian2):t[n++]=-1,t[n++]=e.packedLength,t};const U=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),Y=new h.VertexFormat,q={polygonHierarchy:{}};return j.unpack=function(e,t,n){t=s.defaultValue(t,0);const a=d.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,r.Cartesian3);t=a.startingIndex,delete a.startingIndex;const i=r.Ellipsoid.unpack(e,t,U);t+=r.Ellipsoid.packedLength;const l=h.VertexFormat.unpack(e,t,Y);t+=h.VertexFormat.packedLength;const y=e[t++],c=-1===e[t]?void 0:d.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,o.Cartesian2);s.defined(c)?(t=c.startingIndex,delete c.startingIndex):t++;const p=e[t++];return s.defined(n)||(n=new j(q)),n._polygonHierarchy=a,n._ellipsoid=r.Ellipsoid.clone(i,n._ellipsoid),n._vertexFormat=h.VertexFormat.clone(l,n._vertexFormat),n._stRotation=y,n._textureCoordinates=c,n.packedLength=p,n},j.createGeometry=function(t){const o=t._vertexFormat,a=t._polygonHierarchy,y=t._stRotation,g=t._textureCoordinates,h=s.defined(g);let x=a.positions;if(x=e.arrayRemoveDuplicates(x,r.Cartesian3.equalsEpsilon,!0),x.length<3)return;let C=V,b=R,f=H,P=M;const A=B;if(!i.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(x,I,P,A))return;if(C=r.Cartesian3.cross(P,A,C),C=r.Cartesian3.normalize(C,C),!r.Cartesian3.equalsEpsilon(I,r.Cartesian3.ZERO,m.CesiumMath.EPSILON6)){const e=t._ellipsoid.geodeticSurfaceNormal(I,N);r.Cartesian3.dot(C,e)<0&&(C=r.Cartesian3.negate(C,C),P=r.Cartesian3.negate(P,P))}const w=i.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(I,P,A),L=i.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(I,P,A);o.tangent&&(b=r.Cartesian3.clone(P,b)),o.bitangent&&(f=r.Cartesian3.clone(A,f));const G=d.PolygonGeometryLibrary.polygonsFromHierarchy(a,h,w,!1),F=G.hierarchy,v=G.polygons,E=h?d.PolygonGeometryLibrary.polygonsFromHierarchy(g,!0,(function(e){return e}),!1).polygons:void 0;if(0===F.length)return;x=F[0].outerRing;const _=n.BoundingSphere.fromPoints(x),k=d.PolygonGeometryLibrary.computeBoundingRectangle(C,L,x,y,T),D=[];for(let e=0;e<v.length;e++){const t=new c.GeometryInstance({geometry:Q(v[e],o,k,y,h?E[e]:void 0,L,C,b,f)});D.push(t)}const O=p.GeometryPipeline.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=u.IndexDatatype.createTypedArray(O.attributes.position.values.length/3,O.indices);const z=O.attributes;return o.position||delete z.position,new l.Geometry({attributes:z,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:_})},function(e,t){return s.defined(t)&&(e=j.unpack(e,t)),j.createGeometry(e)}})); diff --git a/public/lib/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js b/public/lib/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js index 4376e40a..a6a49159 100644 --- a/public/lib/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-9b636830","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./CoplanarPolygonGeometryLibrary-21546fbd","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./PolygonGeometryLibrary-f2ea6fbf","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./OrientedBoundingBox-8446a826","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./ArcType-26a3f38d","./EllipsoidRhumbLine-77eff028","./PolygonPipeline-87656bae"],(function(e,t,n,o,r,i,a,y,l,s,c,u,p,m,d,g,h,f,P,b,G,L,C,T,A,E,x){"use strict";function H(e){const t=e.length,n=new Float64Array(3*t),r=c.IndexDatatype.createTypedArray(t,2*t);let i=0,l=0;for(let o=0;o<t;o++){const a=e[o];n[i++]=a.x,n[i++]=a.y,n[i++]=a.z,r[l++]=o,r[l++]=(o+1)%t}const s=new y.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})});return new a.Geometry({attributes:s,indices:r,primitiveType:a.PrimitiveType.LINES})}function k(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=u.PolygonGeometryLibrary.computeHierarchyPackedLength(t,n.Cartesian3)+1}k.fromPositions=function(e){return new k({polygonHierarchy:{positions:(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).positions}})},k.pack=function(e,t,o){return o=i.defaultValue(o,0),t[o=u.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,o,n.Cartesian3)]=e.packedLength,t};const w={polygonHierarchy:{}};return k.unpack=function(e,t,o){t=i.defaultValue(t,0);const r=u.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,n.Cartesian3);t=r.startingIndex,delete r.startingIndex;const a=e[t];return i.defined(o)||(o=new k(w)),o._polygonHierarchy=r,o.packedLength=a,o},k.createGeometry=function(o){const i=o._polygonHierarchy;let y=i.positions;if(y=e.arrayRemoveDuplicates(y,n.Cartesian3.equalsEpsilon,!0),y.length<3)return;if(!r.CoplanarPolygonGeometryLibrary.validOutline(y))return;const c=u.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(i,!1);if(0===c.length)return;const p=[];for(let e=0;e<c.length;e++){const t=new l.GeometryInstance({geometry:H(c[e])});p.push(t)}const m=s.GeometryPipeline.combineInstances(p)[0],d=t.BoundingSphere.fromPoints(i.positions);return new a.Geometry({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:d})},function(e,t){return i.defined(t)&&(e=k.unpack(e,t)),e._ellipsoid=n.Ellipsoid.clone(e._ellipsoid),k.createGeometry(e)}})); +define(["./arrayRemoveDuplicates-0d8dde26","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./CoplanarPolygonGeometryLibrary-c5fc6f2f","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./PolygonGeometryLibrary-b67529a6","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./OrientedBoundingBox-c083edd8","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./ArcType-26a3f38d","./EllipsoidRhumbLine-1289f7e8","./PolygonPipeline-3fa47499"],(function(e,t,n,o,r,i,a,y,l,s,c,u,p,m,d,g,h,f,P,b,G,L,C,T,A,E,x){"use strict";function H(e){const t=e.length,n=new Float64Array(3*t),r=c.IndexDatatype.createTypedArray(t,2*t);let i=0,l=0;for(let o=0;o<t;o++){const a=e[o];n[i++]=a.x,n[i++]=a.y,n[i++]=a.z,r[l++]=o,r[l++]=(o+1)%t}const s=new y.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})});return new a.Geometry({attributes:s,indices:r,primitiveType:a.PrimitiveType.LINES})}function k(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=u.PolygonGeometryLibrary.computeHierarchyPackedLength(t,n.Cartesian3)+1}k.fromPositions=function(e){return new k({polygonHierarchy:{positions:(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).positions}})},k.pack=function(e,t,o){return o=i.defaultValue(o,0),t[o=u.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,o,n.Cartesian3)]=e.packedLength,t};const w={polygonHierarchy:{}};return k.unpack=function(e,t,o){t=i.defaultValue(t,0);const r=u.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,n.Cartesian3);t=r.startingIndex,delete r.startingIndex;const a=e[t];return i.defined(o)||(o=new k(w)),o._polygonHierarchy=r,o.packedLength=a,o},k.createGeometry=function(o){const i=o._polygonHierarchy;let y=i.positions;if(y=e.arrayRemoveDuplicates(y,n.Cartesian3.equalsEpsilon,!0),y.length<3)return;if(!r.CoplanarPolygonGeometryLibrary.validOutline(y))return;const c=u.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(i,!1);if(0===c.length)return;const p=[];for(let e=0;e<c.length;e++){const t=new l.GeometryInstance({geometry:H(c[e])});p.push(t)}const m=s.GeometryPipeline.combineInstances(p)[0],d=t.BoundingSphere.fromPoints(i.positions);return new a.Geometry({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:d})},function(e,t){return i.defined(t)&&(e=k.unpack(e,t)),e._ellipsoid=n.Ellipsoid.clone(e._ellipsoid),k.createGeometry(e)}})); diff --git a/public/lib/Cesium/Workers/createCorridorGeometry.js b/public/lib/Cesium/Workers/createCorridorGeometry.js index 4b83a6ea..8eb03486 100644 --- a/public/lib/Cesium/Workers/createCorridorGeometry.js +++ b/public/lib/Cesium/Workers/createCorridorGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-9b636830","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-01e8948c","./CorridorGeometryLibrary-4521ac9a","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./Matrix2-413c4048","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028"],(function(t,e,r,a,i,o,n,s,l,d,u,m,c,y,f,p,g,h,C,b,A,_,w,v,T){"use strict";const G=new r.Cartesian3,E=new r.Cartesian3,V=new r.Cartesian3,x=new r.Cartesian3,L=new r.Cartesian3,P=new r.Cartesian3,F=new r.Cartesian3,N=new r.Cartesian3;function D(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function M(t,e,a,i,n,s){const l=t.normals,d=t.tangents,u=t.bitangents,m=r.Cartesian3.normalize(r.Cartesian3.cross(a,e,F),F);s.normal&&o.CorridorGeometryLibrary.addAttribute(l,e,i,n),s.tangent&&o.CorridorGeometryLibrary.addAttribute(d,m,i,n),s.bitangent&&o.CorridorGeometryLibrary.addAttribute(u,a,i,n)}function O(t,e,i){const d=t.positions,c=t.corners,y=t.endPositions,f=t.lefts,p=t.normals,g=new l.GeometryAttributes;let h,C,b,A=0,_=0,w=0;for(C=0;C<d.length;C+=2)b=d[C].length-3,A+=b,w+=2*b,_+=d[C+1].length-3;for(A+=3,_+=3,C=0;C<c.length;C++){h=c[C];const t=c[C].leftPositions;n.defined(t)?(b=t.length,A+=b,w+=b):(b=c[C].rightPositions.length,_+=b,w+=b)}const v=n.defined(y);let T;v&&(T=y[0].length-3,A+=T,_+=T,T/=3,w+=6*T);const L=A+_,D=new Float64Array(L),O={normals:e.normal?new Float32Array(L):void 0,tangents:e.tangent?new Float32Array(L):void 0,bitangents:e.bitangent?new Float32Array(L):void 0};let I,S,R,k,H,z,B=0,U=L-1,Y=G,W=E;const q=T/2,J=u.IndexDatatype.createTypedArray(L/3,w);let j=0;if(v){z=V,H=x;const t=y[0];for(Y=r.Cartesian3.fromArray(p,0,Y),W=r.Cartesian3.fromArray(f,0,W),C=0;C<q;C++)z=r.Cartesian3.fromArray(t,3*(q-1-C),z),H=r.Cartesian3.fromArray(t,3*(q+C),H),o.CorridorGeometryLibrary.addAttribute(D,H,B),o.CorridorGeometryLibrary.addAttribute(D,z,void 0,U),M(O,Y,W,B,U,e),S=B/3,k=S+1,I=(U-2)/3,R=I-1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3}let K,Q,X=0,Z=0,$=d[X++],tt=d[X++];for(D.set($,B),D.set(tt,U-tt.length+1),W=r.Cartesian3.fromArray(f,Z,W),b=tt.length-3,C=0;C<b;C+=3)K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,C,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b-C,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),M(O,Y,W,B,U,e),S=B/3,k=S+1,I=(U-2)/3,R=I-1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3;for(K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,b,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),Z+=3,C=0;C<c.length;C++){let t;h=c[C];const a=h.leftPositions,s=h.rightPositions;let l,u,m=P,y=V,g=x;if(Y=r.Cartesian3.fromArray(p,Z,Y),n.defined(a)){for(M(O,Y,W,void 0,U,e),U-=3,l=k,u=R,t=0;t<a.length/3;t++)m=r.Cartesian3.fromArray(a,3*t,m),J[j++]=l,J[j++]=u-t-1,J[j++]=u-t,o.CorridorGeometryLibrary.addAttribute(D,m,void 0,U),y=r.Cartesian3.fromArray(D,3*(u-t-1),y),g=r.Cartesian3.fromArray(D,3*l,g),W=r.Cartesian3.normalize(r.Cartesian3.subtract(y,g,W),W),M(O,Y,W,void 0,U,e),U-=3;m=r.Cartesian3.fromArray(D,3*l,m),y=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*u,y),m,y),g=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*(u-t),g),m,g),W=r.Cartesian3.normalize(r.Cartesian3.add(y,g,W),W),M(O,Y,W,B,void 0,e),B+=3}else{for(M(O,Y,W,B,void 0,e),B+=3,l=R,u=k,t=0;t<s.length/3;t++)m=r.Cartesian3.fromArray(s,3*t,m),J[j++]=l,J[j++]=u+t,J[j++]=u+t+1,o.CorridorGeometryLibrary.addAttribute(D,m,B),y=r.Cartesian3.fromArray(D,3*l,y),g=r.Cartesian3.fromArray(D,3*(u+t),g),W=r.Cartesian3.normalize(r.Cartesian3.subtract(y,g,W),W),M(O,Y,W,B,void 0,e),B+=3;m=r.Cartesian3.fromArray(D,3*l,m),y=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*(u+t),y),m,y),g=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*u,g),m,g),W=r.Cartesian3.normalize(r.Cartesian3.negate(r.Cartesian3.add(g,y,W),W),W),M(O,Y,W,void 0,U,e),U-=3}for($=d[X++],tt=d[X++],$.splice(0,3),tt.splice(tt.length-3,3),D.set($,B),D.set(tt,U-tt.length+1),b=tt.length-3,Z+=3,W=r.Cartesian3.fromArray(f,Z,W),t=0;t<tt.length;t+=3)K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,t,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b-t,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),M(O,Y,W,B,U,e),k=B/3,S=k-1,R=(U-2)/3,I=R+1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3;B-=3,U+=3}if(Y=r.Cartesian3.fromArray(p,p.length-3,Y),M(O,Y,W,B,U,e),v){B+=3,U-=3,z=V,H=x;const t=y[1];for(C=0;C<q;C++)z=r.Cartesian3.fromArray(t,3*(T-C-1),z),H=r.Cartesian3.fromArray(t,3*C,H),o.CorridorGeometryLibrary.addAttribute(D,z,void 0,U),o.CorridorGeometryLibrary.addAttribute(D,H,B),M(O,Y,W,B,U,e),k=B/3,S=k-1,R=(U-2)/3,I=R+1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3}if(g.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),e.st){const t=new Float32Array(L/3*2);let e,r,i=0;if(v){A/=3,_/=3;const a=Math.PI/(T+1);let o;r=1/(A-T+1),e=1/(_-T+1);const n=T/2;for(C=n+1;C<T+1;C++)o=m.CesiumMath.PI_OVER_TWO+a*C,t[i++]=e*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=1;C<_-T+1;C++)t[i++]=C*e,t[i++]=0;for(C=T;C>n;C--)o=m.CesiumMath.PI_OVER_TWO-C*a,t[i++]=1-e*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=n;C>0;C--)o=m.CesiumMath.PI_OVER_TWO-a*C,t[i++]=1-r*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=A-T;C>0;C--)t[i++]=C*r,t[i++]=1;for(C=1;C<n+1;C++)o=m.CesiumMath.PI_OVER_TWO+a*C,t[i++]=r*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o))}else{for(A/=3,_/=3,r=1/(A-1),e=1/(_-1),C=0;C<_;C++)t[i++]=C*e,t[i++]=0;for(C=A;C>0;C--)t[i++]=(C-1)*r,t[i++]=1}g.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}return e.normal&&(g.normal=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.normals})),e.tangent&&(g.tangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.tangents})),e.bitangent&&(g.bitangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.bitangents})),{attributes:g,indices:J}}function I(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(let a=3;a<t.length;a+=3){const i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function S(t,e){const i=new f.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,m=O(o.CorridorGeometryLibrary.computePositions(t),i,l),y=t.height,p=t.extrudedHeight;let g=m.attributes;const h=m.indices;let C=g.position.values,b=C.length;const A=new Float64Array(6*b);let _=new Float64Array(b);_.set(C);let w,v=new Float64Array(4*b);C=c.PolygonPipeline.scaleToGeodeticHeight(C,y,l),v=I(C,0,v),_=c.PolygonPipeline.scaleToGeodeticHeight(_,p,l),v=I(_,2*b,v),A.set(C),A.set(_,b),A.set(v,2*b),g.position.values=A,g=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;const a=t.position.values;let i,n;(e.normal||e.bitangent)&&(i=t.normal.values,n=t.bitangent.values);const s=t.position.values.length/18,l=3*s,d=2*s,u=2*l;let m;if(e.normal||e.bitangent||e.tangent){const s=e.normal?new Float32Array(6*l):void 0,d=e.tangent?new Float32Array(6*l):void 0,c=e.bitangent?new Float32Array(6*l):void 0;let y=G,f=E,p=V,g=x,h=L,C=P,b=u;for(m=0;m<l;m+=3){const t=b+u;y=r.Cartesian3.fromArray(a,m,y),f=r.Cartesian3.fromArray(a,m+l,f),p=r.Cartesian3.fromArray(a,(m+3)%l,p),f=r.Cartesian3.subtract(f,y,f),p=r.Cartesian3.subtract(p,y,p),g=r.Cartesian3.normalize(r.Cartesian3.cross(f,p,g),g),e.normal&&(o.CorridorGeometryLibrary.addAttribute(s,g,t),o.CorridorGeometryLibrary.addAttribute(s,g,t+3),o.CorridorGeometryLibrary.addAttribute(s,g,b),o.CorridorGeometryLibrary.addAttribute(s,g,b+3)),(e.tangent||e.bitangent)&&(C=r.Cartesian3.fromArray(i,m,C),e.bitangent&&(o.CorridorGeometryLibrary.addAttribute(c,C,t),o.CorridorGeometryLibrary.addAttribute(c,C,t+3),o.CorridorGeometryLibrary.addAttribute(c,C,b),o.CorridorGeometryLibrary.addAttribute(c,C,b+3)),e.tangent&&(h=r.Cartesian3.normalize(r.Cartesian3.cross(C,g,h),h),o.CorridorGeometryLibrary.addAttribute(d,h,t),o.CorridorGeometryLibrary.addAttribute(d,h,t+3),o.CorridorGeometryLibrary.addAttribute(d,h,b),o.CorridorGeometryLibrary.addAttribute(d,h,b+3))),b+=6}if(e.normal){for(s.set(i),m=0;m<l;m+=3)s[m+l]=-i[m],s[m+l+1]=-i[m+1],s[m+l+2]=-i[m+2];t.normal.values=s}else t.normal=void 0;if(e.bitangent?(c.set(n),c.set(n,l),t.bitangent.values=c):t.bitangent=void 0,e.tangent){const e=t.tangent.values;d.set(e),d.set(e,l),t.tangent.values=d}}if(e.st){const e=t.st.values,r=new Float32Array(6*d);r.set(e),r.set(e,d);let a=2*d;for(let t=0;t<2;t++){for(r[a++]=e[0],r[a++]=e[1],m=2;m<d;m+=2){const t=e[m],i=e[m+1];r[a++]=t,r[a++]=i,r[a++]=t,r[a++]=i}r[a++]=e[0],r[a++]=e[1]}t.st.values=r}return t}(g,e);const T=b/3;if(t.shadowVolume){const t=g.normal.values;b=t.length;let r=new Float32Array(6*b);for(w=0;w<b;w++)t[w]=-t[w];r.set(t,b),r=I(t,4*b,r),g.extrudeDirection=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r}),e.normal||(g.normal=void 0)}if(n.defined(t.offsetAttribute)){let e=new Uint8Array(6*T);if(t.offsetAttribute===d.GeometryOffsetAttribute.TOP)e=e.fill(1,0,T).fill(1,2*T,4*T);else{const r=t.offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1;e=e.fill(r)}g.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}const F=h.length,N=T+T,D=u.IndexDatatype.createTypedArray(A.length/3,2*F+3*N);D.set(h);let M,S,R,k,H=F;for(w=0;w<F;w+=3){const t=h[w],e=h[w+1],r=h[w+2];D[H++]=r+T,D[H++]=e+T,D[H++]=t+T}for(w=0;w<N;w+=2)M=w+N,S=M+N,R=M+1,k=S+1,D[H++]=M,D[H++]=S,D[H++]=R,D[H++]=R,D[H++]=S,D[H++]=k;return{attributes:g,indices:D}}const R=new r.Cartesian3,k=new r.Cartesian3,H=new r.Cartographic;function z(t,e,a,i,o,n){const s=r.Cartesian3.subtract(e,t,R);r.Cartesian3.normalize(s,s);const l=a.geodeticSurfaceNormal(t,k),d=r.Cartesian3.cross(s,l,R);r.Cartesian3.multiplyByScalar(d,i,d);let u=o.latitude,m=o.longitude,c=n.latitude,y=n.longitude;r.Cartesian3.add(t,d,k),a.cartesianToCartographic(k,H);let f=H.latitude,p=H.longitude;u=Math.min(u,f),m=Math.min(m,p),c=Math.max(c,f),y=Math.max(y,p),r.Cartesian3.subtract(t,d,k),a.cartesianToCartographic(k,H),f=H.latitude,p=H.longitude,u=Math.min(u,f),m=Math.min(m,p),c=Math.max(c,f),y=Math.max(y,p),o.latitude=u,o.longitude=m,n.latitude=c,n.longitude=y}const B=new r.Cartesian3,U=new r.Cartesian3,Y=new r.Cartographic,W=new r.Cartographic;function q(e,a,o,s,l){e=D(e,a);const d=t.arrayRemoveDuplicates(e,r.Cartesian3.equalsEpsilon),u=d.length;if(u<2||o<=0)return new y.Rectangle;const m=.5*o;let c,f;if(Y.latitude=Number.POSITIVE_INFINITY,Y.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY,s===i.CornerType.ROUNDED){const t=d[0];r.Cartesian3.subtract(t,d[1],B),r.Cartesian3.normalize(B,B),r.Cartesian3.multiplyByScalar(B,m,B),r.Cartesian3.add(t,B,U),a.cartesianToCartographic(U,H),c=H.latitude,f=H.longitude,Y.latitude=Math.min(Y.latitude,c),Y.longitude=Math.min(Y.longitude,f),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,f)}for(let t=0;t<u-1;++t)z(d[t],d[t+1],a,m,Y,W);const p=d[u-1];r.Cartesian3.subtract(p,d[u-2],B),r.Cartesian3.normalize(B,B),r.Cartesian3.multiplyByScalar(B,m,B),r.Cartesian3.add(p,B,U),z(p,U,a,m,Y,W),s===i.CornerType.ROUNDED&&(a.cartesianToCartographic(U,H),c=H.latitude,f=H.longitude,Y.latitude=Math.min(Y.latitude,c),Y.longitude=Math.min(Y.longitude,f),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,f));const g=n.defined(l)?l:new y.Rectangle;return g.north=W.latitude,g.south=Y.latitude,g.east=W.longitude,g.west=Y.longitude,g}function J(t){const e=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,a=t.width,o=n.defaultValue(t.height,0),s=n.defaultValue(t.extrudedHeight,o);this._positions=e,this._ellipsoid=r.Ellipsoid.clone(n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84)),this._vertexFormat=f.VertexFormat.clone(n.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT)),this._width=a,this._height=Math.max(o,s),this._extrudedHeight=Math.min(o,s),this._cornerType=n.defaultValue(t.cornerType,i.CornerType.ROUNDED),this._granularity=n.defaultValue(t.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=n.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+f.VertexFormat.packedLength+7}J.pack=function(t,e,a){a=n.defaultValue(a,0);const i=t._positions,o=i.length;e[a++]=o;for(let t=0;t<o;++t,a+=r.Cartesian3.packedLength)r.Cartesian3.pack(i[t],e,a);return r.Ellipsoid.pack(t._ellipsoid,e,a),a+=r.Ellipsoid.packedLength,f.VertexFormat.pack(t._vertexFormat,e,a),a+=f.VertexFormat.packedLength,e[a++]=t._width,e[a++]=t._height,e[a++]=t._extrudedHeight,e[a++]=t._cornerType,e[a++]=t._granularity,e[a++]=t._shadowVolume?1:0,e[a]=n.defaultValue(t._offsetAttribute,-1),e};const j=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),K=new f.VertexFormat,Q={positions:void 0,ellipsoid:j,vertexFormat:K,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return J.unpack=function(t,e,a){e=n.defaultValue(e,0);const i=t[e++],o=new Array(i);for(let a=0;a<i;++a,e+=r.Cartesian3.packedLength)o[a]=r.Cartesian3.unpack(t,e);const s=r.Ellipsoid.unpack(t,e,j);e+=r.Ellipsoid.packedLength;const l=f.VertexFormat.unpack(t,e,K);e+=f.VertexFormat.packedLength;const d=t[e++],u=t[e++],m=t[e++],c=t[e++],y=t[e++],p=1===t[e++],g=t[e];return n.defined(a)?(a._positions=o,a._ellipsoid=r.Ellipsoid.clone(s,a._ellipsoid),a._vertexFormat=f.VertexFormat.clone(l,a._vertexFormat),a._width=d,a._height=u,a._extrudedHeight=m,a._cornerType=c,a._granularity=y,a._shadowVolume=p,a._offsetAttribute=-1===g?void 0:g,a):(Q.positions=o,Q.width=d,Q.height=u,Q.extrudedHeight=m,Q.cornerType=c,Q.granularity=y,Q.shadowVolume=p,Q.offsetAttribute=-1===g?void 0:g,new J(Q))},J.computeRectangle=function(t,e){const a=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,o=t.width;return q(a,n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o,n.defaultValue(t.cornerType,i.CornerType.ROUNDED),e)},J.createGeometry=function(i){let l=i._positions;const u=i._width,y=i._ellipsoid;l=D(l,y);const f=t.arrayRemoveDuplicates(l,r.Cartesian3.equalsEpsilon);if(f.length<2||u<=0)return;const p=i._height,g=i._extrudedHeight,h=!m.CesiumMath.equalsEpsilon(p,g,0,m.CesiumMath.EPSILON2),C=i._vertexFormat,b={ellipsoid:y,positions:f,width:u,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};let A;if(h)b.height=p,b.extrudedHeight=g,b.shadowVolume=i._shadowVolume,b.offsetAttribute=i._offsetAttribute,A=S(b,C);else{if(A=O(o.CorridorGeometryLibrary.computePositions(b),C,y),A.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(A.attributes.position.values,p,y),n.defined(i._offsetAttribute)){const t=i._offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1,e=A.attributes.position.values.length,r=new Uint8Array(e/3).fill(t);A.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}}const _=A.attributes,w=e.BoundingSphere.fromVertices(_.position.values,void 0,3);return C.position||(A.attributes.position.values=void 0),new s.Geometry({attributes:_,indices:A.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:w,offsetAttribute:i._offsetAttribute})},J.createShadowVolume=function(t,e,r){const a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new J({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(J.prototype,{rectangle:{get:function(){return n.defined(this._rectangle)||(this._rectangle=q(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return n.defined(e)&&(t=J.unpack(t,e)),t._ellipsoid=r.Ellipsoid.clone(t._ellipsoid),J.createGeometry(t)}})); +define(["./arrayRemoveDuplicates-0d8dde26","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-5050cb1d","./CorridorGeometryLibrary-d09d785b","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./Matrix2-7a8e9daf","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8"],(function(t,e,r,a,i,o,n,s,l,d,u,m,c,y,f,p,g,h,C,b,A,_,w,v,T){"use strict";const G=new r.Cartesian3,E=new r.Cartesian3,V=new r.Cartesian3,x=new r.Cartesian3,L=new r.Cartesian3,P=new r.Cartesian3,F=new r.Cartesian3,N=new r.Cartesian3;function D(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function M(t,e,a,i,n,s){const l=t.normals,d=t.tangents,u=t.bitangents,m=r.Cartesian3.normalize(r.Cartesian3.cross(a,e,F),F);s.normal&&o.CorridorGeometryLibrary.addAttribute(l,e,i,n),s.tangent&&o.CorridorGeometryLibrary.addAttribute(d,m,i,n),s.bitangent&&o.CorridorGeometryLibrary.addAttribute(u,a,i,n)}function O(t,e,i){const d=t.positions,c=t.corners,y=t.endPositions,f=t.lefts,p=t.normals,g=new l.GeometryAttributes;let h,C,b,A=0,_=0,w=0;for(C=0;C<d.length;C+=2)b=d[C].length-3,A+=b,w+=2*b,_+=d[C+1].length-3;for(A+=3,_+=3,C=0;C<c.length;C++){h=c[C];const t=c[C].leftPositions;n.defined(t)?(b=t.length,A+=b,w+=b):(b=c[C].rightPositions.length,_+=b,w+=b)}const v=n.defined(y);let T;v&&(T=y[0].length-3,A+=T,_+=T,T/=3,w+=6*T);const L=A+_,D=new Float64Array(L),O={normals:e.normal?new Float32Array(L):void 0,tangents:e.tangent?new Float32Array(L):void 0,bitangents:e.bitangent?new Float32Array(L):void 0};let I,S,R,k,H,z,B=0,U=L-1,Y=G,W=E;const q=T/2,J=u.IndexDatatype.createTypedArray(L/3,w);let j=0;if(v){z=V,H=x;const t=y[0];for(Y=r.Cartesian3.fromArray(p,0,Y),W=r.Cartesian3.fromArray(f,0,W),C=0;C<q;C++)z=r.Cartesian3.fromArray(t,3*(q-1-C),z),H=r.Cartesian3.fromArray(t,3*(q+C),H),o.CorridorGeometryLibrary.addAttribute(D,H,B),o.CorridorGeometryLibrary.addAttribute(D,z,void 0,U),M(O,Y,W,B,U,e),S=B/3,k=S+1,I=(U-2)/3,R=I-1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3}let K,Q,X=0,Z=0,$=d[X++],tt=d[X++];for(D.set($,B),D.set(tt,U-tt.length+1),W=r.Cartesian3.fromArray(f,Z,W),b=tt.length-3,C=0;C<b;C+=3)K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,C,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b-C,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),M(O,Y,W,B,U,e),S=B/3,k=S+1,I=(U-2)/3,R=I-1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3;for(K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,b,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),Z+=3,C=0;C<c.length;C++){let t;h=c[C];const a=h.leftPositions,s=h.rightPositions;let l,u,m=P,y=V,g=x;if(Y=r.Cartesian3.fromArray(p,Z,Y),n.defined(a)){for(M(O,Y,W,void 0,U,e),U-=3,l=k,u=R,t=0;t<a.length/3;t++)m=r.Cartesian3.fromArray(a,3*t,m),J[j++]=l,J[j++]=u-t-1,J[j++]=u-t,o.CorridorGeometryLibrary.addAttribute(D,m,void 0,U),y=r.Cartesian3.fromArray(D,3*(u-t-1),y),g=r.Cartesian3.fromArray(D,3*l,g),W=r.Cartesian3.normalize(r.Cartesian3.subtract(y,g,W),W),M(O,Y,W,void 0,U,e),U-=3;m=r.Cartesian3.fromArray(D,3*l,m),y=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*u,y),m,y),g=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*(u-t),g),m,g),W=r.Cartesian3.normalize(r.Cartesian3.add(y,g,W),W),M(O,Y,W,B,void 0,e),B+=3}else{for(M(O,Y,W,B,void 0,e),B+=3,l=R,u=k,t=0;t<s.length/3;t++)m=r.Cartesian3.fromArray(s,3*t,m),J[j++]=l,J[j++]=u+t,J[j++]=u+t+1,o.CorridorGeometryLibrary.addAttribute(D,m,B),y=r.Cartesian3.fromArray(D,3*l,y),g=r.Cartesian3.fromArray(D,3*(u+t),g),W=r.Cartesian3.normalize(r.Cartesian3.subtract(y,g,W),W),M(O,Y,W,B,void 0,e),B+=3;m=r.Cartesian3.fromArray(D,3*l,m),y=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*(u+t),y),m,y),g=r.Cartesian3.subtract(r.Cartesian3.fromArray(D,3*u,g),m,g),W=r.Cartesian3.normalize(r.Cartesian3.negate(r.Cartesian3.add(g,y,W),W),W),M(O,Y,W,void 0,U,e),U-=3}for($=d[X++],tt=d[X++],$.splice(0,3),tt.splice(tt.length-3,3),D.set($,B),D.set(tt,U-tt.length+1),b=tt.length-3,Z+=3,W=r.Cartesian3.fromArray(f,Z,W),t=0;t<tt.length;t+=3)K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,t,F),F),Q=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(tt,b-t,N),N),Y=r.Cartesian3.normalize(r.Cartesian3.add(K,Q,Y),Y),M(O,Y,W,B,U,e),k=B/3,S=k-1,R=(U-2)/3,I=R+1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3;B-=3,U+=3}if(Y=r.Cartesian3.fromArray(p,p.length-3,Y),M(O,Y,W,B,U,e),v){B+=3,U-=3,z=V,H=x;const t=y[1];for(C=0;C<q;C++)z=r.Cartesian3.fromArray(t,3*(T-C-1),z),H=r.Cartesian3.fromArray(t,3*C,H),o.CorridorGeometryLibrary.addAttribute(D,z,void 0,U),o.CorridorGeometryLibrary.addAttribute(D,H,B),M(O,Y,W,B,U,e),k=B/3,S=k-1,R=(U-2)/3,I=R+1,J[j++]=I,J[j++]=S,J[j++]=R,J[j++]=R,J[j++]=S,J[j++]=k,B+=3,U-=3}if(g.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),e.st){const t=new Float32Array(L/3*2);let e,r,i=0;if(v){A/=3,_/=3;const a=Math.PI/(T+1);let o;r=1/(A-T+1),e=1/(_-T+1);const n=T/2;for(C=n+1;C<T+1;C++)o=m.CesiumMath.PI_OVER_TWO+a*C,t[i++]=e*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=1;C<_-T+1;C++)t[i++]=C*e,t[i++]=0;for(C=T;C>n;C--)o=m.CesiumMath.PI_OVER_TWO-C*a,t[i++]=1-e*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=n;C>0;C--)o=m.CesiumMath.PI_OVER_TWO-a*C,t[i++]=1-r*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o));for(C=A-T;C>0;C--)t[i++]=C*r,t[i++]=1;for(C=1;C<n+1;C++)o=m.CesiumMath.PI_OVER_TWO+a*C,t[i++]=r*(1+Math.cos(o)),t[i++]=.5*(1+Math.sin(o))}else{for(A/=3,_/=3,r=1/(A-1),e=1/(_-1),C=0;C<_;C++)t[i++]=C*e,t[i++]=0;for(C=A;C>0;C--)t[i++]=(C-1)*r,t[i++]=1}g.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}return e.normal&&(g.normal=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.normals})),e.tangent&&(g.tangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.tangents})),e.bitangent&&(g.bitangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O.bitangents})),{attributes:g,indices:J}}function I(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(let a=3;a<t.length;a+=3){const i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function S(t,e){const i=new f.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,m=O(o.CorridorGeometryLibrary.computePositions(t),i,l),y=t.height,p=t.extrudedHeight;let g=m.attributes;const h=m.indices;let C=g.position.values,b=C.length;const A=new Float64Array(6*b);let _=new Float64Array(b);_.set(C);let w,v=new Float64Array(4*b);C=c.PolygonPipeline.scaleToGeodeticHeight(C,y,l),v=I(C,0,v),_=c.PolygonPipeline.scaleToGeodeticHeight(_,p,l),v=I(_,2*b,v),A.set(C),A.set(_,b),A.set(v,2*b),g.position.values=A,g=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;const a=t.position.values;let i,n;(e.normal||e.bitangent)&&(i=t.normal.values,n=t.bitangent.values);const s=t.position.values.length/18,l=3*s,d=2*s,u=2*l;let m;if(e.normal||e.bitangent||e.tangent){const s=e.normal?new Float32Array(6*l):void 0,d=e.tangent?new Float32Array(6*l):void 0,c=e.bitangent?new Float32Array(6*l):void 0;let y=G,f=E,p=V,g=x,h=L,C=P,b=u;for(m=0;m<l;m+=3){const t=b+u;y=r.Cartesian3.fromArray(a,m,y),f=r.Cartesian3.fromArray(a,m+l,f),p=r.Cartesian3.fromArray(a,(m+3)%l,p),f=r.Cartesian3.subtract(f,y,f),p=r.Cartesian3.subtract(p,y,p),g=r.Cartesian3.normalize(r.Cartesian3.cross(f,p,g),g),e.normal&&(o.CorridorGeometryLibrary.addAttribute(s,g,t),o.CorridorGeometryLibrary.addAttribute(s,g,t+3),o.CorridorGeometryLibrary.addAttribute(s,g,b),o.CorridorGeometryLibrary.addAttribute(s,g,b+3)),(e.tangent||e.bitangent)&&(C=r.Cartesian3.fromArray(i,m,C),e.bitangent&&(o.CorridorGeometryLibrary.addAttribute(c,C,t),o.CorridorGeometryLibrary.addAttribute(c,C,t+3),o.CorridorGeometryLibrary.addAttribute(c,C,b),o.CorridorGeometryLibrary.addAttribute(c,C,b+3)),e.tangent&&(h=r.Cartesian3.normalize(r.Cartesian3.cross(C,g,h),h),o.CorridorGeometryLibrary.addAttribute(d,h,t),o.CorridorGeometryLibrary.addAttribute(d,h,t+3),o.CorridorGeometryLibrary.addAttribute(d,h,b),o.CorridorGeometryLibrary.addAttribute(d,h,b+3))),b+=6}if(e.normal){for(s.set(i),m=0;m<l;m+=3)s[m+l]=-i[m],s[m+l+1]=-i[m+1],s[m+l+2]=-i[m+2];t.normal.values=s}else t.normal=void 0;if(e.bitangent?(c.set(n),c.set(n,l),t.bitangent.values=c):t.bitangent=void 0,e.tangent){const e=t.tangent.values;d.set(e),d.set(e,l),t.tangent.values=d}}if(e.st){const e=t.st.values,r=new Float32Array(6*d);r.set(e),r.set(e,d);let a=2*d;for(let t=0;t<2;t++){for(r[a++]=e[0],r[a++]=e[1],m=2;m<d;m+=2){const t=e[m],i=e[m+1];r[a++]=t,r[a++]=i,r[a++]=t,r[a++]=i}r[a++]=e[0],r[a++]=e[1]}t.st.values=r}return t}(g,e);const T=b/3;if(t.shadowVolume){const t=g.normal.values;b=t.length;let r=new Float32Array(6*b);for(w=0;w<b;w++)t[w]=-t[w];r.set(t,b),r=I(t,4*b,r),g.extrudeDirection=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r}),e.normal||(g.normal=void 0)}if(n.defined(t.offsetAttribute)){let e=new Uint8Array(6*T);if(t.offsetAttribute===d.GeometryOffsetAttribute.TOP)e=e.fill(1,0,T).fill(1,2*T,4*T);else{const r=t.offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1;e=e.fill(r)}g.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}const F=h.length,N=T+T,D=u.IndexDatatype.createTypedArray(A.length/3,2*F+3*N);D.set(h);let M,S,R,k,H=F;for(w=0;w<F;w+=3){const t=h[w],e=h[w+1],r=h[w+2];D[H++]=r+T,D[H++]=e+T,D[H++]=t+T}for(w=0;w<N;w+=2)M=w+N,S=M+N,R=M+1,k=S+1,D[H++]=M,D[H++]=S,D[H++]=R,D[H++]=R,D[H++]=S,D[H++]=k;return{attributes:g,indices:D}}const R=new r.Cartesian3,k=new r.Cartesian3,H=new r.Cartographic;function z(t,e,a,i,o,n){const s=r.Cartesian3.subtract(e,t,R);r.Cartesian3.normalize(s,s);const l=a.geodeticSurfaceNormal(t,k),d=r.Cartesian3.cross(s,l,R);r.Cartesian3.multiplyByScalar(d,i,d);let u=o.latitude,m=o.longitude,c=n.latitude,y=n.longitude;r.Cartesian3.add(t,d,k),a.cartesianToCartographic(k,H);let f=H.latitude,p=H.longitude;u=Math.min(u,f),m=Math.min(m,p),c=Math.max(c,f),y=Math.max(y,p),r.Cartesian3.subtract(t,d,k),a.cartesianToCartographic(k,H),f=H.latitude,p=H.longitude,u=Math.min(u,f),m=Math.min(m,p),c=Math.max(c,f),y=Math.max(y,p),o.latitude=u,o.longitude=m,n.latitude=c,n.longitude=y}const B=new r.Cartesian3,U=new r.Cartesian3,Y=new r.Cartographic,W=new r.Cartographic;function q(e,a,o,s,l){e=D(e,a);const d=t.arrayRemoveDuplicates(e,r.Cartesian3.equalsEpsilon),u=d.length;if(u<2||o<=0)return new y.Rectangle;const m=.5*o;let c,f;if(Y.latitude=Number.POSITIVE_INFINITY,Y.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY,s===i.CornerType.ROUNDED){const t=d[0];r.Cartesian3.subtract(t,d[1],B),r.Cartesian3.normalize(B,B),r.Cartesian3.multiplyByScalar(B,m,B),r.Cartesian3.add(t,B,U),a.cartesianToCartographic(U,H),c=H.latitude,f=H.longitude,Y.latitude=Math.min(Y.latitude,c),Y.longitude=Math.min(Y.longitude,f),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,f)}for(let t=0;t<u-1;++t)z(d[t],d[t+1],a,m,Y,W);const p=d[u-1];r.Cartesian3.subtract(p,d[u-2],B),r.Cartesian3.normalize(B,B),r.Cartesian3.multiplyByScalar(B,m,B),r.Cartesian3.add(p,B,U),z(p,U,a,m,Y,W),s===i.CornerType.ROUNDED&&(a.cartesianToCartographic(U,H),c=H.latitude,f=H.longitude,Y.latitude=Math.min(Y.latitude,c),Y.longitude=Math.min(Y.longitude,f),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,f));const g=n.defined(l)?l:new y.Rectangle;return g.north=W.latitude,g.south=Y.latitude,g.east=W.longitude,g.west=Y.longitude,g}function J(t){const e=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,a=t.width,o=n.defaultValue(t.height,0),s=n.defaultValue(t.extrudedHeight,o);this._positions=e,this._ellipsoid=r.Ellipsoid.clone(n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84)),this._vertexFormat=f.VertexFormat.clone(n.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT)),this._width=a,this._height=Math.max(o,s),this._extrudedHeight=Math.min(o,s),this._cornerType=n.defaultValue(t.cornerType,i.CornerType.ROUNDED),this._granularity=n.defaultValue(t.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=n.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+f.VertexFormat.packedLength+7}J.pack=function(t,e,a){a=n.defaultValue(a,0);const i=t._positions,o=i.length;e[a++]=o;for(let t=0;t<o;++t,a+=r.Cartesian3.packedLength)r.Cartesian3.pack(i[t],e,a);return r.Ellipsoid.pack(t._ellipsoid,e,a),a+=r.Ellipsoid.packedLength,f.VertexFormat.pack(t._vertexFormat,e,a),a+=f.VertexFormat.packedLength,e[a++]=t._width,e[a++]=t._height,e[a++]=t._extrudedHeight,e[a++]=t._cornerType,e[a++]=t._granularity,e[a++]=t._shadowVolume?1:0,e[a]=n.defaultValue(t._offsetAttribute,-1),e};const j=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),K=new f.VertexFormat,Q={positions:void 0,ellipsoid:j,vertexFormat:K,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return J.unpack=function(t,e,a){e=n.defaultValue(e,0);const i=t[e++],o=new Array(i);for(let a=0;a<i;++a,e+=r.Cartesian3.packedLength)o[a]=r.Cartesian3.unpack(t,e);const s=r.Ellipsoid.unpack(t,e,j);e+=r.Ellipsoid.packedLength;const l=f.VertexFormat.unpack(t,e,K);e+=f.VertexFormat.packedLength;const d=t[e++],u=t[e++],m=t[e++],c=t[e++],y=t[e++],p=1===t[e++],g=t[e];return n.defined(a)?(a._positions=o,a._ellipsoid=r.Ellipsoid.clone(s,a._ellipsoid),a._vertexFormat=f.VertexFormat.clone(l,a._vertexFormat),a._width=d,a._height=u,a._extrudedHeight=m,a._cornerType=c,a._granularity=y,a._shadowVolume=p,a._offsetAttribute=-1===g?void 0:g,a):(Q.positions=o,Q.width=d,Q.height=u,Q.extrudedHeight=m,Q.cornerType=c,Q.granularity=y,Q.shadowVolume=p,Q.offsetAttribute=-1===g?void 0:g,new J(Q))},J.computeRectangle=function(t,e){const a=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,o=t.width;return q(a,n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o,n.defaultValue(t.cornerType,i.CornerType.ROUNDED),e)},J.createGeometry=function(i){let l=i._positions;const u=i._width,y=i._ellipsoid;l=D(l,y);const f=t.arrayRemoveDuplicates(l,r.Cartesian3.equalsEpsilon);if(f.length<2||u<=0)return;const p=i._height,g=i._extrudedHeight,h=!m.CesiumMath.equalsEpsilon(p,g,0,m.CesiumMath.EPSILON2),C=i._vertexFormat,b={ellipsoid:y,positions:f,width:u,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};let A;if(h)b.height=p,b.extrudedHeight=g,b.shadowVolume=i._shadowVolume,b.offsetAttribute=i._offsetAttribute,A=S(b,C);else{if(A=O(o.CorridorGeometryLibrary.computePositions(b),C,y),A.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(A.attributes.position.values,p,y),n.defined(i._offsetAttribute)){const t=i._offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1,e=A.attributes.position.values.length,r=new Uint8Array(e/3).fill(t);A.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}}const _=A.attributes,w=e.BoundingSphere.fromVertices(_.position.values,void 0,3);return C.position||(A.attributes.position.values=void 0),new s.Geometry({attributes:_,indices:A.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:w,offsetAttribute:i._offsetAttribute})},J.createShadowVolume=function(t,e,r){const a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new J({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(J.prototype,{rectangle:{get:function(){return n.defined(this._rectangle)||(this._rectangle=q(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return n.defined(e)&&(t=J.unpack(t,e)),t._ellipsoid=r.Ellipsoid.clone(t._ellipsoid),J.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createCorridorOutlineGeometry.js b/public/lib/Cesium/Workers/createCorridorOutlineGeometry.js index 2678da9b..c913100b 100644 --- a/public/lib/Cesium/Workers/createCorridorOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createCorridorOutlineGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-9b636830","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-01e8948c","./CorridorGeometryLibrary-4521ac9a","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028"],(function(e,t,i,r,o,n,s,a,l,u,d,p,f,h,c,y,g,b,m,A,_,E,C,G){"use strict";const T=new i.Cartesian3,P=new i.Cartesian3,v=new i.Cartesian3;function w(e,t){const u=[],p=e.positions,f=e.corners,h=e.endPositions,c=new l.GeometryAttributes;let y,g,b,m=0,A=0,_=0;for(g=0;g<p.length;g+=2)b=p[g].length-3,m+=b,_+=b/3*4,A+=p[g+1].length-3;for(m+=3,A+=3,g=0;g<f.length;g++){y=f[g];const e=f[g].leftPositions;s.defined(e)?(b=e.length,m+=b,_+=b/3*2):(b=f[g].rightPositions.length,A+=b,_+=b/3*2)}const E=s.defined(h);let C;E&&(C=h[0].length-3,m+=C,A+=C,C/=3,_+=4*C);const G=m+A,w=new Float64Array(G);let L,D,x,k,V,N,O=0,H=G-1;const I=C/2,M=d.IndexDatatype.createTypedArray(G/3,_+4);let B=0;if(M[B++]=O/3,M[B++]=(H-2)/3,E){u.push(O/3),N=T,V=P;const e=h[0];for(g=0;g<I;g++)N=i.Cartesian3.fromArray(e,3*(I-1-g),N),V=i.Cartesian3.fromArray(e,3*(I+g),V),n.CorridorGeometryLibrary.addAttribute(w,V,O),n.CorridorGeometryLibrary.addAttribute(w,N,void 0,H),D=O/3,k=D+1,L=(H-2)/3,x=L-1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3}let S=0,R=p[S++],U=p[S++];for(w.set(R,O),w.set(U,H-U.length+1),b=U.length-3,u.push(O/3,(H-2)/3),g=0;g<b;g+=3)D=O/3,k=D+1,L=(H-2)/3,x=L-1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;for(g=0;g<f.length;g++){let e;y=f[g];const r=y.leftPositions,a=y.rightPositions;let l,d=v;if(s.defined(r)){for(H-=3,l=x,u.push(k),e=0;e<r.length/3;e++)d=i.Cartesian3.fromArray(r,3*e,d),M[B++]=l-e-1,M[B++]=l-e,n.CorridorGeometryLibrary.addAttribute(w,d,void 0,H),H-=3;u.push(l-Math.floor(r.length/6)),t===o.CornerType.BEVELED&&u.push((H-2)/3+1),O+=3}else{for(O+=3,l=k,u.push(x),e=0;e<a.length/3;e++)d=i.Cartesian3.fromArray(a,3*e,d),M[B++]=l+e,M[B++]=l+e+1,n.CorridorGeometryLibrary.addAttribute(w,d,O),O+=3;u.push(l+Math.floor(a.length/6)),t===o.CornerType.BEVELED&&u.push(O/3-1),H-=3}for(R=p[S++],U=p[S++],R.splice(0,3),U.splice(U.length-3,3),w.set(R,O),w.set(U,H-U.length+1),b=U.length-3,e=0;e<U.length;e+=3)k=O/3,D=k-1,x=(H-2)/3,L=x+1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;O-=3,H+=3,u.push(O/3,(H-2)/3)}if(E){O+=3,H-=3,N=T,V=P;const e=h[1];for(g=0;g<I;g++)N=i.Cartesian3.fromArray(e,3*(C-g-1),N),V=i.Cartesian3.fromArray(e,3*g,V),n.CorridorGeometryLibrary.addAttribute(w,N,void 0,H),n.CorridorGeometryLibrary.addAttribute(w,V,O),k=O/3,D=k-1,x=(H-2)/3,L=x+1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;u.push(O/3)}else u.push(O/3,(H-2)/3);return M[B++]=O/3,M[B++]=(H-2)/3,c.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:c,indices:M,wallIndices:u}}function L(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions,r=e.width,n=s.defaultValue(e.height,0),a=s.defaultValue(e.extrudedHeight,n);this._positions=t,this._ellipsoid=i.Ellipsoid.clone(s.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84)),this._width=r,this._height=Math.max(n,a),this._extrudedHeight=Math.min(n,a),this._cornerType=s.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=s.defaultValue(e.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*i.Cartesian3.packedLength+i.Ellipsoid.packedLength+6}L.pack=function(e,t,r){r=s.defaultValue(r,0);const o=e._positions,n=o.length;t[r++]=n;for(let e=0;e<n;++e,r+=i.Cartesian3.packedLength)i.Cartesian3.pack(o[e],t,r);return i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=s.defaultValue(e._offsetAttribute,-1),t};const D=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),x={positions:void 0,ellipsoid:D,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return L.unpack=function(e,t,r){t=s.defaultValue(t,0);const o=e[t++],n=new Array(o);for(let r=0;r<o;++r,t+=i.Cartesian3.packedLength)n[r]=i.Cartesian3.unpack(e,t);const a=i.Ellipsoid.unpack(e,t,D);t+=i.Ellipsoid.packedLength;const l=e[t++],u=e[t++],d=e[t++],p=e[t++],f=e[t++],h=e[t];return s.defined(r)?(r._positions=n,r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._width=l,r._height=u,r._extrudedHeight=d,r._cornerType=p,r._granularity=f,r._offsetAttribute=-1===h?void 0:h,r):(x.positions=n,x.width=l,x.height=u,x.extrudedHeight=d,x.cornerType=p,x.granularity=f,x.offsetAttribute=-1===h?void 0:h,new L(x))},L.createGeometry=function(o){let l=o._positions;const h=o._width,c=o._ellipsoid;l=function(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(l,c);const y=e.arrayRemoveDuplicates(l,i.Cartesian3.equalsEpsilon);if(y.length<2||h<=0)return;const g=o._height,b=o._extrudedHeight,m=!p.CesiumMath.equalsEpsilon(g,b,0,p.CesiumMath.EPSILON2),A={ellipsoid:c,positions:y,width:h,cornerType:o._cornerType,granularity:o._granularity,saveAttributes:!1};let _;if(m)A.height=g,A.extrudedHeight=b,A.offsetAttribute=o._offsetAttribute,_=function(e){const t=e.ellipsoid,i=w(n.CorridorGeometryLibrary.computePositions(e),e.cornerType),o=i.wallIndices,l=e.height,p=e.extrudedHeight,h=i.attributes,c=i.indices;let y=h.position.values,g=y.length,b=new Float64Array(g);b.set(y);const m=new Float64Array(2*g);if(y=f.PolygonPipeline.scaleToGeodeticHeight(y,l,t),b=f.PolygonPipeline.scaleToGeodeticHeight(b,p,t),m.set(y),m.set(b,g),h.position.values=m,g/=3,s.defined(e.offsetAttribute)){let t=new Uint8Array(2*g);if(e.offsetAttribute===u.GeometryOffsetAttribute.TOP)t=t.fill(1,0,g);else{const i=e.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}h.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let A;const _=c.length,E=d.IndexDatatype.createTypedArray(m.length/3,2*(_+o.length));E.set(c);let C,G,T=_;for(A=0;A<_;A+=2){const e=c[A],t=c[A+1];E[T++]=e+g,E[T++]=t+g}for(A=0;A<o.length;A++)C=o[A],G=C+g,E[T++]=C,E[T++]=G;return{attributes:h,indices:E}}(A);else{if(_=w(n.CorridorGeometryLibrary.computePositions(A),A.cornerType),_.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,g,c),s.defined(o._offsetAttribute)){const e=_.attributes.position.values.length,t=o._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,i=new Uint8Array(e/3).fill(t);_.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const E=_.attributes,C=t.BoundingSphere.fromVertices(E.position.values,void 0,3);return new a.Geometry({attributes:E,indices:_.indices,primitiveType:a.PrimitiveType.LINES,boundingSphere:C,offsetAttribute:o._offsetAttribute})},function(e,t){return s.defined(t)&&(e=L.unpack(e,t)),e._ellipsoid=i.Ellipsoid.clone(e._ellipsoid),L.createGeometry(e)}})); +define(["./arrayRemoveDuplicates-0d8dde26","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-5050cb1d","./CorridorGeometryLibrary-d09d785b","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8"],(function(e,t,i,r,o,n,s,a,l,u,d,p,f,h,c,y,g,b,m,A,_,E,C,G){"use strict";const T=new i.Cartesian3,P=new i.Cartesian3,v=new i.Cartesian3;function w(e,t){const u=[],p=e.positions,f=e.corners,h=e.endPositions,c=new l.GeometryAttributes;let y,g,b,m=0,A=0,_=0;for(g=0;g<p.length;g+=2)b=p[g].length-3,m+=b,_+=b/3*4,A+=p[g+1].length-3;for(m+=3,A+=3,g=0;g<f.length;g++){y=f[g];const e=f[g].leftPositions;s.defined(e)?(b=e.length,m+=b,_+=b/3*2):(b=f[g].rightPositions.length,A+=b,_+=b/3*2)}const E=s.defined(h);let C;E&&(C=h[0].length-3,m+=C,A+=C,C/=3,_+=4*C);const G=m+A,w=new Float64Array(G);let L,D,x,k,V,N,O=0,H=G-1;const I=C/2,M=d.IndexDatatype.createTypedArray(G/3,_+4);let B=0;if(M[B++]=O/3,M[B++]=(H-2)/3,E){u.push(O/3),N=T,V=P;const e=h[0];for(g=0;g<I;g++)N=i.Cartesian3.fromArray(e,3*(I-1-g),N),V=i.Cartesian3.fromArray(e,3*(I+g),V),n.CorridorGeometryLibrary.addAttribute(w,V,O),n.CorridorGeometryLibrary.addAttribute(w,N,void 0,H),D=O/3,k=D+1,L=(H-2)/3,x=L-1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3}let S=0,R=p[S++],U=p[S++];for(w.set(R,O),w.set(U,H-U.length+1),b=U.length-3,u.push(O/3,(H-2)/3),g=0;g<b;g+=3)D=O/3,k=D+1,L=(H-2)/3,x=L-1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;for(g=0;g<f.length;g++){let e;y=f[g];const r=y.leftPositions,a=y.rightPositions;let l,d=v;if(s.defined(r)){for(H-=3,l=x,u.push(k),e=0;e<r.length/3;e++)d=i.Cartesian3.fromArray(r,3*e,d),M[B++]=l-e-1,M[B++]=l-e,n.CorridorGeometryLibrary.addAttribute(w,d,void 0,H),H-=3;u.push(l-Math.floor(r.length/6)),t===o.CornerType.BEVELED&&u.push((H-2)/3+1),O+=3}else{for(O+=3,l=k,u.push(x),e=0;e<a.length/3;e++)d=i.Cartesian3.fromArray(a,3*e,d),M[B++]=l+e,M[B++]=l+e+1,n.CorridorGeometryLibrary.addAttribute(w,d,O),O+=3;u.push(l+Math.floor(a.length/6)),t===o.CornerType.BEVELED&&u.push(O/3-1),H-=3}for(R=p[S++],U=p[S++],R.splice(0,3),U.splice(U.length-3,3),w.set(R,O),w.set(U,H-U.length+1),b=U.length-3,e=0;e<U.length;e+=3)k=O/3,D=k-1,x=(H-2)/3,L=x+1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;O-=3,H+=3,u.push(O/3,(H-2)/3)}if(E){O+=3,H-=3,N=T,V=P;const e=h[1];for(g=0;g<I;g++)N=i.Cartesian3.fromArray(e,3*(C-g-1),N),V=i.Cartesian3.fromArray(e,3*g,V),n.CorridorGeometryLibrary.addAttribute(w,N,void 0,H),n.CorridorGeometryLibrary.addAttribute(w,V,O),k=O/3,D=k-1,x=(H-2)/3,L=x+1,M[B++]=L,M[B++]=x,M[B++]=D,M[B++]=k,O+=3,H-=3;u.push(O/3)}else u.push(O/3,(H-2)/3);return M[B++]=O/3,M[B++]=(H-2)/3,c.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:c,indices:M,wallIndices:u}}function L(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions,r=e.width,n=s.defaultValue(e.height,0),a=s.defaultValue(e.extrudedHeight,n);this._positions=t,this._ellipsoid=i.Ellipsoid.clone(s.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84)),this._width=r,this._height=Math.max(n,a),this._extrudedHeight=Math.min(n,a),this._cornerType=s.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=s.defaultValue(e.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*i.Cartesian3.packedLength+i.Ellipsoid.packedLength+6}L.pack=function(e,t,r){r=s.defaultValue(r,0);const o=e._positions,n=o.length;t[r++]=n;for(let e=0;e<n;++e,r+=i.Cartesian3.packedLength)i.Cartesian3.pack(o[e],t,r);return i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=s.defaultValue(e._offsetAttribute,-1),t};const D=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),x={positions:void 0,ellipsoid:D,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return L.unpack=function(e,t,r){t=s.defaultValue(t,0);const o=e[t++],n=new Array(o);for(let r=0;r<o;++r,t+=i.Cartesian3.packedLength)n[r]=i.Cartesian3.unpack(e,t);const a=i.Ellipsoid.unpack(e,t,D);t+=i.Ellipsoid.packedLength;const l=e[t++],u=e[t++],d=e[t++],p=e[t++],f=e[t++],h=e[t];return s.defined(r)?(r._positions=n,r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._width=l,r._height=u,r._extrudedHeight=d,r._cornerType=p,r._granularity=f,r._offsetAttribute=-1===h?void 0:h,r):(x.positions=n,x.width=l,x.height=u,x.extrudedHeight=d,x.cornerType=p,x.granularity=f,x.offsetAttribute=-1===h?void 0:h,new L(x))},L.createGeometry=function(o){let l=o._positions;const h=o._width,c=o._ellipsoid;l=function(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(l,c);const y=e.arrayRemoveDuplicates(l,i.Cartesian3.equalsEpsilon);if(y.length<2||h<=0)return;const g=o._height,b=o._extrudedHeight,m=!p.CesiumMath.equalsEpsilon(g,b,0,p.CesiumMath.EPSILON2),A={ellipsoid:c,positions:y,width:h,cornerType:o._cornerType,granularity:o._granularity,saveAttributes:!1};let _;if(m)A.height=g,A.extrudedHeight=b,A.offsetAttribute=o._offsetAttribute,_=function(e){const t=e.ellipsoid,i=w(n.CorridorGeometryLibrary.computePositions(e),e.cornerType),o=i.wallIndices,l=e.height,p=e.extrudedHeight,h=i.attributes,c=i.indices;let y=h.position.values,g=y.length,b=new Float64Array(g);b.set(y);const m=new Float64Array(2*g);if(y=f.PolygonPipeline.scaleToGeodeticHeight(y,l,t),b=f.PolygonPipeline.scaleToGeodeticHeight(b,p,t),m.set(y),m.set(b,g),h.position.values=m,g/=3,s.defined(e.offsetAttribute)){let t=new Uint8Array(2*g);if(e.offsetAttribute===u.GeometryOffsetAttribute.TOP)t=t.fill(1,0,g);else{const i=e.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}h.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let A;const _=c.length,E=d.IndexDatatype.createTypedArray(m.length/3,2*(_+o.length));E.set(c);let C,G,T=_;for(A=0;A<_;A+=2){const e=c[A],t=c[A+1];E[T++]=e+g,E[T++]=t+g}for(A=0;A<o.length;A++)C=o[A],G=C+g,E[T++]=C,E[T++]=G;return{attributes:h,indices:E}}(A);else{if(_=w(n.CorridorGeometryLibrary.computePositions(A),A.cornerType),_.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,g,c),s.defined(o._offsetAttribute)){const e=_.attributes.position.values.length,t=o._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,i=new Uint8Array(e/3).fill(t);_.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const E=_.attributes,C=t.BoundingSphere.fromVertices(E.position.values,void 0,3);return new a.Geometry({attributes:E,indices:_.indices,primitiveType:a.PrimitiveType.LINES,boundingSphere:C,offsetAttribute:o._offsetAttribute})},function(e,t){return s.defined(t)&&(e=L.unpack(e,t)),e._ellipsoid=i.Ellipsoid.clone(e._ellipsoid),L.createGeometry(e)}})); diff --git a/public/lib/Cesium/Workers/createCylinderGeometry.js b/public/lib/Cesium/Workers/createCylinderGeometry.js index 47d3c3df..fe98ef43 100644 --- a/public/lib/Cesium/Workers/createCylinderGeometry.js +++ b/public/lib/Cesium/Workers/createCylinderGeometry.js @@ -1 +1 @@ -define(["./CylinderGeometry-a492df0d","./defaultValue-f6d5e6da","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./CylinderGeometryLibrary-f49f33a8","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./VertexFormat-fbdec922"],(function(e,t,r,n,i,o,a,y,m,u,G,d,f,s,b,c){"use strict";return function(r,n){return t.defined(n)&&(r=e.CylinderGeometry.unpack(r,n)),e.CylinderGeometry.createGeometry(r)}})); +define(["./CylinderGeometry-25b4eb3a","./defaultValue-f6d5e6da","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./CylinderGeometryLibrary-4d7f606d","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./VertexFormat-fbdec922"],(function(e,t,r,n,i,o,a,y,m,u,G,d,f,s,b,c){"use strict";return function(r,n){return t.defined(n)&&(r=e.CylinderGeometry.unpack(r,n)),e.CylinderGeometry.createGeometry(r)}})); diff --git a/public/lib/Cesium/Workers/createCylinderOutlineGeometry.js b/public/lib/Cesium/Workers/createCylinderOutlineGeometry.js index b01487a8..abdf08d9 100644 --- a/public/lib/Cesium/Workers/createCylinderOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createCylinderOutlineGeometry.js @@ -1 +1 @@ -define(["./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./CylinderGeometryLibrary-f49f33a8","./defaultValue-f6d5e6da","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93"],(function(t,e,i,n,o,r,a,s,u,f,l,d,c,m){"use strict";const b=new e.Cartesian2;function p(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,n=t.bottomRadius,o=r.defaultValue(t.slices,128),a=Math.max(r.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=n,this._slices=o,this._numberOfVerticalLines=a,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}p.packedLength=6,p.pack=function(t,e,i){return i=r.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=r.defaultValue(t._offsetAttribute,-1),e};const y={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return p.unpack=function(t,e,i){e=r.defaultValue(e,0);const n=t[e++],o=t[e++],a=t[e++],s=t[e++],u=t[e++],f=t[e];return r.defined(i)?(i._length=n,i._topRadius=o,i._bottomRadius=a,i._slices=s,i._numberOfVerticalLines=u,i._offsetAttribute=-1===f?void 0:f,i):(y.length=n,y.topRadius=o,y.bottomRadius=a,y.slices=s,y.numberOfVerticalLines=u,y.offsetAttribute=-1===f?void 0:f,new p(y))},p.createGeometry=function(l){let d=l._length;const c=l._topRadius,m=l._bottomRadius,p=l._slices,y=l._numberOfVerticalLines;if(d<=0||c<0||m<0||0===c&&0===m)return;const _=2*p,h=o.CylinderGeometryLibrary.computePositions(d,c,m,p,!1);let A,G=2*p;if(y>0){const t=Math.min(y,p);A=Math.round(p/t),G+=t}const R=f.IndexDatatype.createTypedArray(_,2*G);let O,V=0;for(O=0;O<p-1;O++)R[V++]=O,R[V++]=O+1,R[V++]=O+p,R[V++]=O+1+p;if(R[V++]=p-1,R[V++]=0,R[V++]=p+p-1,R[V++]=p,y>0)for(O=0;O<p;O+=A)R[V++]=O,R[V++]=O+p;const g=new s.GeometryAttributes;g.position=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),b.x=.5*d,b.y=Math.max(m,c);const L=new t.BoundingSphere(i.Cartesian3.ZERO,e.Cartesian2.magnitude(b));if(r.defined(l._offsetAttribute)){d=h.length;const t=l._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,e=new Uint8Array(d/3).fill(t);g.applyOffset=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return new a.Geometry({attributes:g,indices:R,primitiveType:a.PrimitiveType.LINES,boundingSphere:L,offsetAttribute:l._offsetAttribute})},function(t,e){return r.defined(e)&&(t=p.unpack(t,e)),p.createGeometry(t)}})); +define(["./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./CylinderGeometryLibrary-4d7f606d","./defaultValue-f6d5e6da","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93"],(function(t,e,i,n,o,r,a,s,u,f,l,d,c,m){"use strict";const b=new e.Cartesian2;function p(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,n=t.bottomRadius,o=r.defaultValue(t.slices,128),a=Math.max(r.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=n,this._slices=o,this._numberOfVerticalLines=a,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}p.packedLength=6,p.pack=function(t,e,i){return i=r.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=r.defaultValue(t._offsetAttribute,-1),e};const y={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return p.unpack=function(t,e,i){e=r.defaultValue(e,0);const n=t[e++],o=t[e++],a=t[e++],s=t[e++],u=t[e++],f=t[e];return r.defined(i)?(i._length=n,i._topRadius=o,i._bottomRadius=a,i._slices=s,i._numberOfVerticalLines=u,i._offsetAttribute=-1===f?void 0:f,i):(y.length=n,y.topRadius=o,y.bottomRadius=a,y.slices=s,y.numberOfVerticalLines=u,y.offsetAttribute=-1===f?void 0:f,new p(y))},p.createGeometry=function(l){let d=l._length;const c=l._topRadius,m=l._bottomRadius,p=l._slices,y=l._numberOfVerticalLines;if(d<=0||c<0||m<0||0===c&&0===m)return;const _=2*p,h=o.CylinderGeometryLibrary.computePositions(d,c,m,p,!1);let A,G=2*p;if(y>0){const t=Math.min(y,p);A=Math.round(p/t),G+=t}const R=f.IndexDatatype.createTypedArray(_,2*G);let O,V=0;for(O=0;O<p-1;O++)R[V++]=O,R[V++]=O+1,R[V++]=O+p,R[V++]=O+1+p;if(R[V++]=p-1,R[V++]=0,R[V++]=p+p-1,R[V++]=p,y>0)for(O=0;O<p;O+=A)R[V++]=O,R[V++]=O+p;const g=new s.GeometryAttributes;g.position=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),b.x=.5*d,b.y=Math.max(m,c);const L=new t.BoundingSphere(i.Cartesian3.ZERO,e.Cartesian2.magnitude(b));if(r.defined(l._offsetAttribute)){d=h.length;const t=l._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,e=new Uint8Array(d/3).fill(t);g.applyOffset=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return new a.Geometry({attributes:g,indices:R,primitiveType:a.PrimitiveType.LINES,boundingSphere:L,offsetAttribute:l._offsetAttribute})},function(t,e){return r.defined(e)&&(t=p.unpack(t,e)),p.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createEllipseGeometry.js b/public/lib/Cesium/Workers/createEllipseGeometry.js index ad479670..a4aad2df 100644 --- a/public/lib/Cesium/Workers/createEllipseGeometry.js +++ b/public/lib/Cesium/Workers/createEllipseGeometry.js @@ -1 +1 @@ -define(["./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipseGeometry-436ecd16","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./IndexDatatype-d3db4e7d","./IntersectionTests-56142431","./Plane-6add0ae1","./VertexFormat-fbdec922"],(function(e,t,r,n,i,o,s,a,l,m,c,p,u,y,d,G,f,b,E,C,x,A){"use strict";return function(n,i){return t.defined(i)&&(n=r.EllipseGeometry.unpack(n,i)),n._center=e.Cartesian3.clone(n._center),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),r.EllipseGeometry.createGeometry(n)}})); +define(["./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipseGeometry-e2d7986e","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./IndexDatatype-a9b1bc18","./IntersectionTests-f1b36d69","./Plane-5931b53e","./VertexFormat-fbdec922"],(function(e,t,r,n,i,o,s,a,l,m,c,p,u,y,d,G,f,b,E,C,x,A){"use strict";return function(n,i){return t.defined(i)&&(n=r.EllipseGeometry.unpack(n,i)),n._center=e.Cartesian3.clone(n._center),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),r.EllipseGeometry.createGeometry(n)}})); diff --git a/public/lib/Cesium/Workers/createEllipseOutlineGeometry.js b/public/lib/Cesium/Workers/createEllipseOutlineGeometry.js index c00af83c..7be25033 100644 --- a/public/lib/Cesium/Workers/createEllipseOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createEllipseOutlineGeometry.js @@ -1 +1 @@ -define(["./Matrix3-81054f0f","./defaultValue-f6d5e6da","./EllipseOutlineGeometry-14470848","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-ce8bea87","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d"],(function(e,t,r,i,n,l,o,a,s,u,m,c,p,y,G){"use strict";return function(i,n){return t.defined(n)&&(i=r.EllipseOutlineGeometry.unpack(i,n)),i._center=e.Cartesian3.clone(i._center),i._ellipsoid=e.Ellipsoid.clone(i._ellipsoid),r.EllipseOutlineGeometry.createGeometry(i)}})); +define(["./Matrix3-b2351961","./defaultValue-f6d5e6da","./EllipseOutlineGeometry-3d88fb74","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipseGeometryLibrary-d93d7f63","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18"],(function(e,t,r,i,n,l,o,a,s,u,m,c,p,y,G){"use strict";return function(i,n){return t.defined(n)&&(i=r.EllipseOutlineGeometry.unpack(i,n)),i._center=e.Cartesian3.clone(i._center),i._ellipsoid=e.Ellipsoid.clone(i._ellipsoid),r.EllipseOutlineGeometry.createGeometry(i)}})); diff --git a/public/lib/Cesium/Workers/createEllipsoidGeometry.js b/public/lib/Cesium/Workers/createEllipsoidGeometry.js index 1dd66b59..0f6b9c1e 100644 --- a/public/lib/Cesium/Workers/createEllipsoidGeometry.js +++ b/public/lib/Cesium/Workers/createEllipsoidGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./EllipsoidGeometry-e261a196","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./VertexFormat-fbdec922"],(function(e,t,r,o,i,n,a,m,u,s,l,y,d,f,G){"use strict";return function(r,o){return e.defined(o)&&(r=t.EllipsoidGeometry.unpack(r,o)),t.EllipsoidGeometry.createGeometry(r)}})); +define(["./defaultValue-f6d5e6da","./EllipsoidGeometry-ad4c3540","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./VertexFormat-fbdec922"],(function(e,t,r,o,i,n,a,m,u,s,l,y,d,f,G){"use strict";return function(r,o){return e.defined(o)&&(r=t.EllipsoidGeometry.unpack(r,o)),t.EllipsoidGeometry.createGeometry(r)}})); diff --git a/public/lib/Cesium/Workers/createEllipsoidOutlineGeometry.js b/public/lib/Cesium/Workers/createEllipsoidOutlineGeometry.js index d1caf79f..095b3e1d 100644 --- a/public/lib/Cesium/Workers/createEllipsoidOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createEllipsoidOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./EllipsoidOutlineGeometry-1242f733","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d"],(function(e,t,r,i,n,o,u,a,l,m,s,f,y,d){"use strict";return function(r,i){return e.defined(r.buffer)&&(r=t.EllipsoidOutlineGeometry.unpack(r,i)),t.EllipsoidOutlineGeometry.createGeometry(r)}})); +define(["./defaultValue-f6d5e6da","./EllipsoidOutlineGeometry-52005f3f","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18"],(function(e,t,r,i,n,o,u,a,l,m,s,f,y,d){"use strict";return function(r,i){return e.defined(r.buffer)&&(r=t.EllipsoidOutlineGeometry.unpack(r,i)),t.EllipsoidOutlineGeometry.createGeometry(r)}})); diff --git a/public/lib/Cesium/Workers/createFrustumGeometry.js b/public/lib/Cesium/Workers/createFrustumGeometry.js index 659b3bff..980404f4 100644 --- a/public/lib/Cesium/Workers/createFrustumGeometry.js +++ b/public/lib/Cesium/Workers/createFrustumGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./FrustumGeometry-99a05ec3","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./Plane-6add0ae1","./VertexFormat-fbdec922"],(function(t,e,r,n,u,m,o,a,i,s,c,y,G,f){"use strict";return function(r,n){return t.defined(n)&&(r=e.FrustumGeometry.unpack(r,n)),e.FrustumGeometry.createGeometry(r)}})); +define(["./defaultValue-f6d5e6da","./FrustumGeometry-a659c64b","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./Plane-5931b53e","./VertexFormat-fbdec922"],(function(t,e,r,n,u,m,o,a,i,s,c,y,G,f){"use strict";return function(r,n){return t.defined(n)&&(r=e.FrustumGeometry.unpack(r,n)),e.FrustumGeometry.createGeometry(r)}})); diff --git a/public/lib/Cesium/Workers/createFrustumOutlineGeometry.js b/public/lib/Cesium/Workers/createFrustumOutlineGeometry.js index 3211dd09..d1d3945e 100644 --- a/public/lib/Cesium/Workers/createFrustumOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createFrustumOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./FrustumGeometry-99a05ec3","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./Plane-6add0ae1","./VertexFormat-fbdec922"],(function(e,t,r,n,a,i,u,o,s,c,p,m,h,d){"use strict";const f=0,g=1;function l(n){const i=n.frustum,u=n.orientation,o=n.origin,s=e.defaultValue(n._drawNearPlane,!0);let c,p;i instanceof a.PerspectiveFrustum?(c=f,p=a.PerspectiveFrustum.packedLength):i instanceof a.OrthographicFrustum&&(c=g,p=a.OrthographicFrustum.packedLength),this._frustumType=c,this._frustum=i.clone(),this._origin=r.Cartesian3.clone(o),this._orientation=t.Quaternion.clone(u),this._drawNearPlane=s,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+r.Cartesian3.packedLength+t.Quaternion.packedLength}l.pack=function(n,i,u){u=e.defaultValue(u,0);const o=n._frustumType,s=n._frustum;return i[u++]=o,o===f?(a.PerspectiveFrustum.pack(s,i,u),u+=a.PerspectiveFrustum.packedLength):(a.OrthographicFrustum.pack(s,i,u),u+=a.OrthographicFrustum.packedLength),r.Cartesian3.pack(n._origin,i,u),u+=r.Cartesian3.packedLength,t.Quaternion.pack(n._orientation,i,u),i[u+=t.Quaternion.packedLength]=n._drawNearPlane?1:0,i};const _=new a.PerspectiveFrustum,k=new a.OrthographicFrustum,y=new t.Quaternion,F=new r.Cartesian3;return l.unpack=function(n,i,u){i=e.defaultValue(i,0);const o=n[i++];let s;o===f?(s=a.PerspectiveFrustum.unpack(n,i,_),i+=a.PerspectiveFrustum.packedLength):(s=a.OrthographicFrustum.unpack(n,i,k),i+=a.OrthographicFrustum.packedLength);const c=r.Cartesian3.unpack(n,i,F);i+=r.Cartesian3.packedLength;const p=t.Quaternion.unpack(n,i,y),m=1===n[i+=t.Quaternion.packedLength];if(!e.defined(u))return new l({frustum:s,origin:c,orientation:p,_drawNearPlane:m});const h=o===u._frustumType?u._frustum:void 0;return u._frustum=s.clone(h),u._frustumType=o,u._origin=r.Cartesian3.clone(c,u._origin),u._orientation=t.Quaternion.clone(p,u._orientation),u._drawNearPlane=m,u},l.createGeometry=function(e){const r=e._frustumType,o=e._frustum,s=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);a.FrustumGeometry._computeNearFarPlanes(s,c,r,o,m);const h=new u.GeometryAttributes({position:new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let d,f;const g=p?2:1,l=new Uint16Array(8*(g+1));let _=p?0:1;for(;_<2;++_)d=p?8*_:0,f=4*_,l[d]=f,l[d+1]=f+1,l[d+2]=f+1,l[d+3]=f+2,l[d+4]=f+2,l[d+5]=f+3,l[d+6]=f+3,l[d+7]=f;for(_=0;_<2;++_)d=8*(g+_),f=4*_,l[d]=f,l[d+1]=f+4,l[d+2]=f+1,l[d+3]=f+5,l[d+4]=f+2,l[d+5]=f+6,l[d+6]=f+3,l[d+7]=f+7;return new i.Geometry({attributes:h,indices:l,primitiveType:i.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=l.unpack(t,r)),l.createGeometry(t)}})); +define(["./defaultValue-f6d5e6da","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./FrustumGeometry-a659c64b","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./Plane-5931b53e","./VertexFormat-fbdec922"],(function(e,t,r,n,a,i,u,o,s,c,p,m,h,d){"use strict";const f=0,g=1;function l(n){const i=n.frustum,u=n.orientation,o=n.origin,s=e.defaultValue(n._drawNearPlane,!0);let c,p;i instanceof a.PerspectiveFrustum?(c=f,p=a.PerspectiveFrustum.packedLength):i instanceof a.OrthographicFrustum&&(c=g,p=a.OrthographicFrustum.packedLength),this._frustumType=c,this._frustum=i.clone(),this._origin=r.Cartesian3.clone(o),this._orientation=t.Quaternion.clone(u),this._drawNearPlane=s,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+r.Cartesian3.packedLength+t.Quaternion.packedLength}l.pack=function(n,i,u){u=e.defaultValue(u,0);const o=n._frustumType,s=n._frustum;return i[u++]=o,o===f?(a.PerspectiveFrustum.pack(s,i,u),u+=a.PerspectiveFrustum.packedLength):(a.OrthographicFrustum.pack(s,i,u),u+=a.OrthographicFrustum.packedLength),r.Cartesian3.pack(n._origin,i,u),u+=r.Cartesian3.packedLength,t.Quaternion.pack(n._orientation,i,u),i[u+=t.Quaternion.packedLength]=n._drawNearPlane?1:0,i};const _=new a.PerspectiveFrustum,k=new a.OrthographicFrustum,y=new t.Quaternion,F=new r.Cartesian3;return l.unpack=function(n,i,u){i=e.defaultValue(i,0);const o=n[i++];let s;o===f?(s=a.PerspectiveFrustum.unpack(n,i,_),i+=a.PerspectiveFrustum.packedLength):(s=a.OrthographicFrustum.unpack(n,i,k),i+=a.OrthographicFrustum.packedLength);const c=r.Cartesian3.unpack(n,i,F);i+=r.Cartesian3.packedLength;const p=t.Quaternion.unpack(n,i,y),m=1===n[i+=t.Quaternion.packedLength];if(!e.defined(u))return new l({frustum:s,origin:c,orientation:p,_drawNearPlane:m});const h=o===u._frustumType?u._frustum:void 0;return u._frustum=s.clone(h),u._frustumType=o,u._origin=r.Cartesian3.clone(c,u._origin),u._orientation=t.Quaternion.clone(p,u._orientation),u._drawNearPlane=m,u},l.createGeometry=function(e){const r=e._frustumType,o=e._frustum,s=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);a.FrustumGeometry._computeNearFarPlanes(s,c,r,o,m);const h=new u.GeometryAttributes({position:new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let d,f;const g=p?2:1,l=new Uint16Array(8*(g+1));let _=p?0:1;for(;_<2;++_)d=p?8*_:0,f=4*_,l[d]=f,l[d+1]=f+1,l[d+2]=f+1,l[d+3]=f+2,l[d+4]=f+2,l[d+5]=f+3,l[d+6]=f+3,l[d+7]=f;for(_=0;_<2;++_)d=8*(g+_),f=4*_,l[d]=f,l[d+1]=f+4,l[d+2]=f+1,l[d+3]=f+5,l[d+4]=f+2,l[d+5]=f+6,l[d+6]=f+3,l[d+7]=f+7;return new i.Geometry({attributes:h,indices:l,primitiveType:i.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=l.unpack(t,r)),l.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createGeometry.js b/public/lib/Cesium/Workers/createGeometry.js index 4ba2f56f..1ff2d4f8 100644 --- a/public/lib/Cesium/Workers/createGeometry.js +++ b/public/lib/Cesium/Workers/createGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./PrimitivePipeline-adac135e","./createTaskProcessorWorker","./Transforms-b3716b06","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-fea557d0","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./IndexDatatype-d3db4e7d","./IntersectionTests-56142431","./Plane-6add0ae1","./WebMercatorProjection-943e2226"],(function(e,t,r,n,o,i,s,a,u,c,f,m,l,d,p,b,y,P,k,C){"use strict";const G={};function W(t){let r=G[t];return e.defined(r)||("object"==typeof exports?G[r]=r=require(`Workers/${t}`):require([`Workers/${t}`],(function(e){r=e,G[r]=e}))),r}return r((function(r,n){const o=r.subTasks,i=o.length,s=new Array(i);for(let t=0;t<i;t++){const r=o[t],n=r.geometry,i=r.moduleName;if(e.defined(i)){const e=W(i);s[t]=e(n,r.offset)}else s[t]=n}return Promise.all(s).then((function(e){return t.PrimitivePipeline.packCreateGeometryResults(e,n)}))}))})); +define(["./defaultValue-f6d5e6da","./PrimitivePipeline-72a87ada","./createTaskProcessorWorker","./Transforms-f17097e5","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-a9233ae3","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./IndexDatatype-a9b1bc18","./IntersectionTests-f1b36d69","./Plane-5931b53e","./WebMercatorProjection-db7467f4"],(function(e,t,r,n,o,i,s,a,u,c,f,m,l,d,p,b,y,P,k,C){"use strict";const G={};function W(t){let r=G[t];return e.defined(r)||("object"==typeof exports?G[r]=r=require(`Workers/${t}`):require([`Workers/${t}`],(function(e){r=e,G[r]=e}))),r}return r((function(r,n){const o=r.subTasks,i=o.length,s=new Array(i);for(let t=0;t<i;t++){const r=o[t],n=r.geometry,i=r.moduleName;if(e.defined(i)){const e=W(i);s[t]=e(n,r.offset)}else s[t]=n}return Promise.all(s).then((function(e){return t.PrimitivePipeline.packCreateGeometryResults(e,n)}))}))})); diff --git a/public/lib/Cesium/Workers/createGroundPolylineGeometry.js b/public/lib/Cesium/Workers/createGroundPolylineGeometry.js index 84520faf..a3fe5893 100644 --- a/public/lib/Cesium/Workers/createGroundPolylineGeometry.js +++ b/public/lib/Cesium/Workers/createGroundPolylineGeometry.js @@ -1 +1 @@ -define(["./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./Math-2ce22ee9","./ArcType-26a3f38d","./arrayRemoveDuplicates-9b636830","./ComponentDatatype-ab629b88","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./EncodedCartesian3-5e2017ab","./GeometryAttribute-12713b29","./IntersectionTests-56142431","./Plane-6add0ae1","./WebMercatorProjection-943e2226","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93"],(function(e,t,a,n,i,r,s,o,l,c,u,C,p,h,d,g,f,m){"use strict";function w(i){i=n.defaultValue(i,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(i.ellipsoid,a.Ellipsoid.WGS84),this._rectangle=n.defaultValue(i.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(i.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(i.numberOfLevelZeroTilesY,1)}Object.defineProperties(w.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),w.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},w.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},w.prototype.rectangleToNativeRectangle=function(e,a){const r=i.CesiumMath.toDegrees(e.west),s=i.CesiumMath.toDegrees(e.south),o=i.CesiumMath.toDegrees(e.east),l=i.CesiumMath.toDegrees(e.north);return n.defined(a)?(a.west=r,a.south=s,a.east=o,a.north=l,a):new t.Rectangle(r,s,o,l)},w.prototype.tileXYToNativeRectangle=function(e,t,a,n){const r=this.tileXYToRectangle(e,t,a,n);return r.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},w.prototype.tileXYToRectangle=function(e,a,i,r){const s=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,p=s.height/l,h=s.north-a*p,d=s.north-(a+1)*p;return n.defined(r)||(r=new t.Rectangle(u,d,C,h)),r.west=u,r.south=d,r.east=C,r.north=h,r},w.prototype.positionToTileXY=function(e,a,r){const s=this._rectangle;if(!t.Rectangle.contains(s,e))return;const o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;let C=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);let p=(C-s.west)/c|0;p>=o&&(p=o-1);let h=(s.north-e.latitude)/u|0;return h>=l&&(h=l-1),n.defined(r)?(r.x=p,r.y=h,r):new t.Cartesian2(p,h)};const y=new a.Cartesian3,M=new a.Cartesian3,T=new a.Cartographic,E=new a.Cartesian3,_=new a.Cartesian3,O=new e.BoundingSphere,P=new w,A=[new a.Cartographic,new a.Cartographic,new a.Cartographic,new a.Cartographic],b=new t.Cartesian2,k={};function L(e){a.Cartographic.fromRadians(e.east,e.north,0,A[0]),a.Cartographic.fromRadians(e.west,e.north,0,A[1]),a.Cartographic.fromRadians(e.east,e.south,0,A[2]),a.Cartographic.fromRadians(e.west,e.south,0,A[3]);let t=0,n=0,i=0,r=0;const s=k._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let t=0;t<4;++t){const a=A[t];if(P.positionToTileXY(a,o,b),0===t)i=b.x,r=b.y;else if(i!==b.x||r!==b.y){e=!0;break}}if(e)break;t=i,n=r}if(0!==o)return{x:t,y:n,level:o>s?s:o-1}}k.initialize=function(){let t=k._initPromise;return n.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){k._terrainHeights=e})),k._initPromise=t),t},k.getMinimumMaximumHeights=function(e,i){i=n.defaultValue(i,a.Ellipsoid.WGS84);const r=L(e);let s=k._defaultMinTerrainHeight,o=k._defaultMaxTerrainHeight;if(n.defined(r)){const l=`${r.level}-${r.x}-${r.y}`,c=k._terrainHeights[l];n.defined(c)&&(s=c[0],o=c[1]),i.cartographicToCartesian(t.Rectangle.northeast(e,T),y),i.cartographicToCartesian(t.Rectangle.southwest(e,T),M),a.Cartesian3.midpoint(M,y,E);const u=i.scaleToGeodeticSurface(E,_);if(n.defined(u)){const e=a.Cartesian3.distance(E,u);s=Math.min(s,-e)}else s=k._defaultMinTerrainHeight}return s=Math.max(k._defaultMinTerrainHeight,s),{minimumTerrainHeight:s,maximumTerrainHeight:o}},k.getBoundingSphere=function(t,i){i=n.defaultValue(i,a.Ellipsoid.WGS84);const r=L(t);let s=k._defaultMaxTerrainHeight;if(n.defined(r)){const e=`${r.level}-${r.x}-${r.y}`,t=k._terrainHeights[e];n.defined(t)&&(s=t[1])}const o=e.BoundingSphere.fromRectangle3D(t,i,0);return e.BoundingSphere.fromRectangle3D(t,i,s,O),e.BoundingSphere.union(o,O,o)},k._terrainHeightsMaxLevel=6,k._defaultMaxTerrainHeight=9e3,k._defaultMinTerrainHeight=-1e5,k._terrainHeights=void 0,k._initPromise=void 0,Object.defineProperties(k,{initialized:{get:function(){return n.defined(k._terrainHeights)}}});var S=k;const x=[e.GeographicProjection,d.WebMercatorProjection],I=x.length,N=Math.cos(i.CesiumMath.toRadians(30)),R=Math.cos(i.CesiumMath.toRadians(150)),D=0,v=1e3;function z(e){const t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).positions;this.width=n.defaultValue(e.width,1),this._positions=t,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=a.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(z.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+a.Ellipsoid.packedLength+1+1}}}),z.setProjectionAndEllipsoid=function(e,t){let a=0;for(let e=0;e<I;e++)if(t instanceof x[e]){a=e;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};const H=new a.Cartesian3,j=new a.Cartesian3,B=new a.Cartesian3;function V(e,t,n,i,r){const s=U(i,e,0,H),o=U(i,e,n,j),l=U(i,t,0,B),c=Z(o,s,j),u=Z(l,s,B);return a.Cartesian3.cross(u,c,r),a.Cartesian3.normalize(r,r)}const G=new a.Cartographic,Y=new a.Cartesian3,F=new a.Cartesian3,q=new a.Cartesian3;function X(e,t,n,i,s,o,u,C,p,h,d){if(0===s)return;let g;o===r.ArcType.GEODESIC?g=new l.EllipsoidGeodesic(e,t,u):o===r.ArcType.RHUMB&&(g=new c.EllipsoidRhumbLine(e,t,u));const f=g.surfaceDistance;if(f<s)return;const m=V(e,t,i,u,q),w=Math.ceil(f/s),y=f/w;let M=y;const T=w-1;let E=C.length;for(let e=0;e<T;e++){const e=g.interpolateUsingSurfaceDistance(M,G),t=U(u,e,n,Y),r=U(u,e,i,F);a.Cartesian3.pack(m,C,E),a.Cartesian3.pack(t,p,E),a.Cartesian3.pack(r,h,E),d.push(e.latitude),d.push(e.longitude),E+=3,M+=y}}const W=new a.Cartographic;function U(e,t,n,i){return a.Cartographic.clone(t,W),W.height=n,a.Cartographic.toCartesian(W,e,i)}function Z(e,t,n){return a.Cartesian3.subtract(e,t,n),a.Cartesian3.normalize(n,n),n}function $(e,t,n,i){return i=Z(e,t,i),i=a.Cartesian3.cross(i,n,i),i=a.Cartesian3.normalize(i,i),i=a.Cartesian3.cross(n,i,i)}z.pack=function(e,t,i){let r=n.defaultValue(i,0);const s=e._positions,o=s.length;t[r++]=o;for(let e=0;e<o;++e){const n=s[e];a.Cartesian3.pack(n,t,r),r+=3}return t[r++]=e.granularity,t[r++]=e.loop?1:0,t[r++]=e.arcType,a.Ellipsoid.pack(e._ellipsoid,t,r),r+=a.Ellipsoid.packedLength,t[r++]=e._projectionIndex,t[r++]=e._scene3DOnly?1:0,t},z.unpack=function(e,t,i){let r=n.defaultValue(t,0);const s=e[r++],o=new Array(s);for(let t=0;t<s;t++)o[t]=a.Cartesian3.unpack(e,r),r+=3;const l=e[r++],c=1===e[r++],u=e[r++],C=a.Ellipsoid.unpack(e,r);r+=a.Ellipsoid.packedLength;const p=e[r++],h=1===e[r++];return n.defined(i)||(i=new z({positions:o})),i._positions=o,i.granularity=l,i.loop=c,i.arcType=u,i._ellipsoid=C,i._projectionIndex=p,i._scene3DOnly=h,i};const J=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,ee=new a.Cartesian3,te=0,ae=-1;function ne(e,t,n,r,s){const o=Z(n,t,ee),l=$(e,t,o,J),c=$(r,t,o,Q);if(i.CesiumMath.equalsEpsilon(a.Cartesian3.dot(l,c),ae,i.CesiumMath.EPSILON5))return s=a.Cartesian3.cross(o,l,s),s=a.Cartesian3.normalize(s,s);s=a.Cartesian3.add(c,l,s),s=a.Cartesian3.normalize(s,s);const u=a.Cartesian3.cross(o,s,K);return a.Cartesian3.dot(c,u)<te&&(s=a.Cartesian3.negate(s,s)),s}const ie=h.Plane.fromPointNormal(a.Cartesian3.ZERO,a.Cartesian3.UNIT_Y),re=new a.Cartesian3,se=new a.Cartesian3,oe=new a.Cartesian3,le=new a.Cartesian3,ce=new a.Cartesian3,ue=new a.Cartesian3,Ce=new a.Cartographic,pe=new a.Cartographic,he=new a.Cartographic;z.createGeometry=function(l){const h=!l._scene3DOnly;let d=l.loop;const g=l._ellipsoid,f=l.granularity,m=l.arcType,w=new x[l._projectionIndex](g),y=D,M=v;let T,E;const _=l._positions,O=_.length;let P,A,b,k;2===O&&(d=!1);const L=new c.EllipsoidRhumbLine(void 0,void 0,g);let I,R,z;const H=[_[0]];for(E=0;E<O-1;E++)P=_[E],A=_[E+1],I=p.IntersectionTests.lineSegmentPlane(P,A,ie,ue),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||(l.arcType===r.ArcType.GEODESIC?H.push(a.Cartesian3.clone(I)):l.arcType===r.ArcType.RHUMB&&(z=g.cartesianToCartographic(I,Ce).longitude,b=g.cartesianToCartographic(P,Ce),k=g.cartesianToCartographic(A,pe),L.setEndPoints(b,k),R=L.findIntersectionWithLongitude(z,he),I=g.cartographicToCartesian(R,ue),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||H.push(a.Cartesian3.clone(I)))),H.push(A);d&&(P=_[O-1],A=_[0],I=p.IntersectionTests.lineSegmentPlane(P,A,ie,ue),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||(l.arcType===r.ArcType.GEODESIC?H.push(a.Cartesian3.clone(I)):l.arcType===r.ArcType.RHUMB&&(z=g.cartesianToCartographic(I,Ce).longitude,b=g.cartesianToCartographic(P,Ce),k=g.cartesianToCartographic(A,pe),L.setEndPoints(b,k),R=L.findIntersectionWithLongitude(z,he),I=g.cartographicToCartesian(R,ue),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||H.push(a.Cartesian3.clone(I)))));let j=H.length,B=new Array(j);for(E=0;E<j;E++){const e=a.Cartographic.fromCartesian(H[E],g);e.height=0,B[E]=e}if(B=s.arrayRemoveDuplicates(B,a.Cartographic.equalsEpsilon),j=B.length,j<2)return;const G=[],Y=[],F=[],q=[];let W=re,$=se,J=oe,Q=le,K=ce;const ee=B[0],te=B[1];for(W=U(g,B[j-1],y,W),Q=U(g,te,y,Q),$=U(g,ee,y,$),J=U(g,ee,M,J),K=d?ne(W,$,J,Q,K):V(ee,te,M,g,K),a.Cartesian3.pack(K,Y,0),a.Cartesian3.pack($,F,0),a.Cartesian3.pack(J,q,0),G.push(ee.latitude),G.push(ee.longitude),X(ee,te,y,M,f,m,g,Y,F,q,G),E=1;E<j-1;++E){W=a.Cartesian3.clone($,W),$=a.Cartesian3.clone(Q,$);const e=B[E];U(g,e,M,J),U(g,B[E+1],y,Q),ne(W,$,J,Q,K),T=Y.length,a.Cartesian3.pack(K,Y,T),a.Cartesian3.pack($,F,T),a.Cartesian3.pack(J,q,T),G.push(e.latitude),G.push(e.longitude),X(B[E],B[E+1],y,M,f,m,g,Y,F,q,G)}const ae=B[j-1],de=B[j-2];if($=U(g,ae,y,$),J=U(g,ae,M,J),d){const e=B[0];W=U(g,de,y,W),Q=U(g,e,y,Q),K=ne(W,$,J,Q,K)}else K=V(de,ae,M,g,K);if(T=Y.length,a.Cartesian3.pack(K,Y,T),a.Cartesian3.pack($,F,T),a.Cartesian3.pack(J,q,T),G.push(ae.latitude),G.push(ae.longitude),d){for(X(ae,ee,y,M,f,m,g,Y,F,q,G),T=Y.length,E=0;E<3;++E)Y[T+E]=Y[E],F[T+E]=F[E],q[T+E]=q[E];G.push(ee.latitude),G.push(ee.longitude)}return function(n,r,s,l,c,p,h){let d,g;const f=r._ellipsoid,m=s.length/3-1,w=8*m,y=4*w,M=36*m,T=w>65535?new Uint32Array(M):new Uint16Array(M),E=new Float64Array(3*w),_=new Float32Array(y),O=new Float32Array(y),P=new Float32Array(y),A=new Float32Array(y),b=new Float32Array(y);let k,L,x,I;h&&(k=new Float32Array(y),L=new Float32Array(y),x=new Float32Array(y),I=new Float32Array(2*w));const R=p.length/2;let D=0;const v=ke;v.height=0;const z=Le;z.height=0;let H=Se,j=xe;if(h)for(g=0,d=1;d<R;d++)v.latitude=p[g],v.longitude=p[g+1],z.latitude=p[g+2],z.longitude=p[g+3],H=r.project(v,H),j=r.project(z,j),D+=a.Cartesian3.distance(H,j),g+=2;const B=l.length/3;j=a.Cartesian3.unpack(l,0,j);let V,G=0;for(g=3,d=1;d<B;d++)H=a.Cartesian3.clone(j,H),j=a.Cartesian3.unpack(l,g,j),G+=a.Cartesian3.distance(H,j),g+=3;g=3;let Y=0,F=0,q=0,X=0,W=!1,U=a.Cartesian3.unpack(s,0,Ne),$=a.Cartesian3.unpack(l,0,xe),J=a.Cartesian3.unpack(c,0,De);if(n){me(J,a.Cartesian3.unpack(s,s.length-6,Ie),U,$)&&(J=a.Cartesian3.negate(J,J))}let Q=0,K=0,ee=0;for(d=0;d<m;d++){const e=a.Cartesian3.clone(U,Ie),n=a.Cartesian3.clone($,Se);let o,C,d,m,w=a.Cartesian3.clone(J,Re);if(W&&(w=a.Cartesian3.negate(w,w)),U=a.Cartesian3.unpack(s,g,Ne),$=a.Cartesian3.unpack(l,g,xe),J=a.Cartesian3.unpack(c,g,De),W=me(J,e,U,$),v.latitude=p[Y],v.longitude=p[Y+1],z.latitude=p[Y+2],z.longitude=p[Y+3],h){const e=be(v,z);o=r.project(v,Ge),C=r.project(z,Ye);const t=Z(C,o,et);t.y=Math.abs(t.y),d=Fe,m=qe,0===e||a.Cartesian3.dot(t,a.Cartesian3.UNIT_Y)>N?(d=Te(r,v,w,o,Fe),m=Te(r,z,J,C,qe)):1===e?(m=Te(r,z,J,C,qe),d.x=0,d.y=i.CesiumMath.sign(v.longitude-Math.abs(z.longitude)),d.z=0):(d=Te(r,v,w,o,Fe),m.x=0,m.y=i.CesiumMath.sign(v.longitude-z.longitude),m.z=0)}const y=a.Cartesian3.distance(n,$),M=u.EncodedCartesian3.fromCartesian(e,Qe),T=a.Cartesian3.subtract(U,e,Xe),R=a.Cartesian3.normalize(T,Ze);let H=a.Cartesian3.subtract(n,e,We);H=a.Cartesian3.normalize(H,H);let j=a.Cartesian3.cross(R,H,Ze);j=a.Cartesian3.normalize(j,j);let B=a.Cartesian3.cross(H,w,$e);B=a.Cartesian3.normalize(B,B);let te=a.Cartesian3.subtract($,U,Ue);te=a.Cartesian3.normalize(te,te);let ae=a.Cartesian3.cross(J,te,Je);ae=a.Cartesian3.normalize(ae,ae);const ne=y/G,ie=Q/G;let re,se,oe,le=0,ce=0,ue=0;if(h){le=a.Cartesian3.distance(o,C),re=u.EncodedCartesian3.fromCartesian(o,Ke),se=a.Cartesian3.subtract(C,o,et),oe=a.Cartesian3.normalize(se,tt);const e=oe.x;oe.x=oe.y,oe.y=-e,ce=le/D,ue=K/D}for(V=0;V<8;V++){const e=X+4*V,t=F+2*V,n=e+3,i=V<4?1:-1,r=2===V||3===V||6===V||7===V?1:-1;a.Cartesian3.pack(M.high,_,e),_[n]=T.x,a.Cartesian3.pack(M.low,O,e),O[n]=T.y,a.Cartesian3.pack(B,P,e),P[n]=T.z,a.Cartesian3.pack(ae,A,e),A[n]=ne*i,a.Cartesian3.pack(j,b,e);let s=ie*r;0===s&&r<0&&(s=9),b[n]=s,h&&(k[e]=re.high.x,k[e+1]=re.high.y,k[e+2]=re.low.x,k[e+3]=re.low.y,x[e]=-d.y,x[e+1]=d.x,x[e+2]=m.y,x[e+3]=-m.x,L[e]=se.x,L[e+1]=se.y,L[e+2]=oe.x,L[e+3]=oe.y,I[t]=ce*i,s=ue*r,0===s&&r<0&&(s=9),I[t+1]=s)}const Ce=Be,pe=Ve,he=He,de=je,ge=t.Rectangle.fromCartographicArray(ve,ze),fe=S.getMinimumMaximumHeights(ge,f),we=fe.minimumTerrainHeight,ye=fe.maximumTerrainHeight;ee+=we,ee+=ye,Oe(e,n,we,ye,Ce,he),Oe(U,$,we,ye,pe,de);let Me=a.Cartesian3.multiplyByScalar(j,i.CesiumMath.EPSILON5,at);a.Cartesian3.add(Ce,Me,Ce),a.Cartesian3.add(pe,Me,pe),a.Cartesian3.add(he,Me,he),a.Cartesian3.add(de,Me,de),Ae(Ce,pe),Ae(he,de),a.Cartesian3.pack(Ce,E,q),a.Cartesian3.pack(pe,E,q+3),a.Cartesian3.pack(de,E,q+6),a.Cartesian3.pack(he,E,q+9),Me=a.Cartesian3.multiplyByScalar(j,-2*i.CesiumMath.EPSILON5,at),a.Cartesian3.add(Ce,Me,Ce),a.Cartesian3.add(pe,Me,pe),a.Cartesian3.add(he,Me,he),a.Cartesian3.add(de,Me,de),Ae(Ce,pe),Ae(he,de),a.Cartesian3.pack(Ce,E,q+12),a.Cartesian3.pack(pe,E,q+15),a.Cartesian3.pack(de,E,q+18),a.Cartesian3.pack(he,E,q+21),Y+=2,g+=3,F+=16,q+=24,X+=32,Q+=y,K+=le}g=0;let te=0;for(d=0;d<m;d++){for(V=0;V<rt;V++)T[g+V]=it[V]+te;te+=8,g+=rt}const ae=nt;e.BoundingSphere.fromVertices(s,a.Cartesian3.ZERO,3,ae[0]),e.BoundingSphere.fromVertices(l,a.Cartesian3.ZERO,3,ae[1]);const ne=e.BoundingSphere.fromBoundingSpheres(ae);ne.radius+=ee/(2*m);const ie={position:new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:st(_),startLoAndForwardOffsetY:st(O),startNormalAndForwardOffsetZ:st(P),endNormalAndTextureCoordinateNormalizationX:st(A),rightNormalAndTextureCoordinateNormalizationY:st(b)};h&&(ie.startHiLo2D=st(k),ie.offsetAndRight2D=st(L),ie.startEndNormals2D=st(x),ie.texcoordNormalization2D=new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:I}));return new C.Geometry({attributes:ie,indices:T,boundingSphere:ne})}(d,w,F,q,Y,G,h)};const de=new a.Cartesian3,ge=new a.Matrix3,fe=new e.Quaternion;function me(t,n,r,s){const o=Z(r,n,de),l=a.Cartesian3.dot(o,t);if(l>N||l<R){const n=Z(s,r,ee),o=l<R?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,fe),u=a.Matrix3.fromQuaternion(c,ge);return a.Matrix3.multiplyByVector(u,t,t),!0}return!1}const we=new a.Cartographic,ye=new a.Cartesian3,Me=new a.Cartesian3;function Te(e,t,n,r,s){const o=a.Cartographic.toCartesian(t,e._ellipsoid,ye);let l=a.Cartesian3.add(o,n,Me),c=!1;const u=e._ellipsoid;let C=u.cartesianToCartographic(l,we);Math.abs(t.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=a.Cartesian3.subtract(o,n,Me),C=u.cartesianToCartographic(l,we)),C.height=0;const p=e.project(C,s);return(s=a.Cartesian3.subtract(p,r,s)).z=0,s=a.Cartesian3.normalize(s,s),c&&a.Cartesian3.negate(s,s),s}const Ee=new a.Cartesian3,_e=new a.Cartesian3;function Oe(e,t,n,i,r,s){const o=a.Cartesian3.subtract(t,e,Ee);a.Cartesian3.normalize(o,o);const l=n-D;let c=a.Cartesian3.multiplyByScalar(o,l,_e);a.Cartesian3.add(e,c,r);const u=i-v;c=a.Cartesian3.multiplyByScalar(o,u,_e),a.Cartesian3.add(t,c,s)}const Pe=new a.Cartesian3;function Ae(e,t){const n=h.Plane.getPointDistance(ie,e),r=h.Plane.getPointDistance(ie,t);let s=Pe;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=Z(t,e,s),a.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),a.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=Z(e,t,s),a.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),a.Cartesian3.add(t,s,t))}function be(e,t){const a=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const n=i.CesiumMath.sign(t.longitude);return e.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const a=i.CesiumMath.sign(e.longitude);return t.longitude=a*(n-i.CesiumMath.EPSILON11),2}return 0}const ke=new a.Cartographic,Le=new a.Cartographic,Se=new a.Cartesian3,xe=new a.Cartesian3,Ie=new a.Cartesian3,Ne=new a.Cartesian3,Re=new a.Cartesian3,De=new a.Cartesian3,ve=[ke,Le],ze=new t.Rectangle,He=new a.Cartesian3,je=new a.Cartesian3,Be=new a.Cartesian3,Ve=new a.Cartesian3,Ge=new a.Cartesian3,Ye=new a.Cartesian3,Fe=new a.Cartesian3,qe=new a.Cartesian3,Xe=new a.Cartesian3,We=new a.Cartesian3,Ue=new a.Cartesian3,Ze=new a.Cartesian3,$e=new a.Cartesian3,Je=new a.Cartesian3,Qe=new u.EncodedCartesian3,Ke=new u.EncodedCartesian3,et=new a.Cartesian3,tt=new a.Cartesian3,at=new a.Cartesian3,nt=[new e.BoundingSphere,new e.BoundingSphere],it=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],rt=it.length;function st(e){return new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return z._projectNormal=Te,function(e,t){return S.initialize().then((function(){return n.defined(t)&&(e=z.unpack(e,t)),z.createGeometry(e)}))}})); +define(["./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./Math-355606c6","./ArcType-26a3f38d","./arrayRemoveDuplicates-0d8dde26","./ComponentDatatype-ab629b88","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./EncodedCartesian3-abad5e8c","./GeometryAttribute-9c1a6bab","./IntersectionTests-f1b36d69","./Plane-5931b53e","./WebMercatorProjection-db7467f4","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93"],(function(e,t,a,n,i,r,s,o,l,c,u,C,p,h,d,g,f,m){"use strict";function w(i){i=n.defaultValue(i,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(i.ellipsoid,a.Ellipsoid.WGS84),this._rectangle=n.defaultValue(i.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(i.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(i.numberOfLevelZeroTilesY,1)}Object.defineProperties(w.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),w.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},w.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},w.prototype.rectangleToNativeRectangle=function(e,a){const r=i.CesiumMath.toDegrees(e.west),s=i.CesiumMath.toDegrees(e.south),o=i.CesiumMath.toDegrees(e.east),l=i.CesiumMath.toDegrees(e.north);return n.defined(a)?(a.west=r,a.south=s,a.east=o,a.north=l,a):new t.Rectangle(r,s,o,l)},w.prototype.tileXYToNativeRectangle=function(e,t,a,n){const r=this.tileXYToRectangle(e,t,a,n);return r.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},w.prototype.tileXYToRectangle=function(e,a,i,r){const s=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,p=s.height/l,h=s.north-a*p,d=s.north-(a+1)*p;return n.defined(r)||(r=new t.Rectangle(u,d,C,h)),r.west=u,r.south=d,r.east=C,r.north=h,r},w.prototype.positionToTileXY=function(e,a,r){const s=this._rectangle;if(!t.Rectangle.contains(s,e))return;const o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;let C=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);let p=(C-s.west)/c|0;p>=o&&(p=o-1);let h=(s.north-e.latitude)/u|0;return h>=l&&(h=l-1),n.defined(r)?(r.x=p,r.y=h,r):new t.Cartesian2(p,h)};const y=new a.Cartesian3,M=new a.Cartesian3,T=new a.Cartographic,E=new a.Cartesian3,_=new a.Cartesian3,O=new e.BoundingSphere,P=new w,A=[new a.Cartographic,new a.Cartographic,new a.Cartographic,new a.Cartographic],b=new t.Cartesian2,k={};function L(e){a.Cartographic.fromRadians(e.east,e.north,0,A[0]),a.Cartographic.fromRadians(e.west,e.north,0,A[1]),a.Cartographic.fromRadians(e.east,e.south,0,A[2]),a.Cartographic.fromRadians(e.west,e.south,0,A[3]);let t=0,n=0,i=0,r=0;const s=k._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let t=0;t<4;++t){const a=A[t];if(P.positionToTileXY(a,o,b),0===t)i=b.x,r=b.y;else if(i!==b.x||r!==b.y){e=!0;break}}if(e)break;t=i,n=r}if(0!==o)return{x:t,y:n,level:o>s?s:o-1}}k.initialize=function(){let t=k._initPromise;return n.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){k._terrainHeights=e})),k._initPromise=t),t},k.getMinimumMaximumHeights=function(e,i){i=n.defaultValue(i,a.Ellipsoid.WGS84);const r=L(e);let s=k._defaultMinTerrainHeight,o=k._defaultMaxTerrainHeight;if(n.defined(r)){const l=`${r.level}-${r.x}-${r.y}`,c=k._terrainHeights[l];n.defined(c)&&(s=c[0],o=c[1]),i.cartographicToCartesian(t.Rectangle.northeast(e,T),y),i.cartographicToCartesian(t.Rectangle.southwest(e,T),M),a.Cartesian3.midpoint(M,y,E);const u=i.scaleToGeodeticSurface(E,_);if(n.defined(u)){const e=a.Cartesian3.distance(E,u);s=Math.min(s,-e)}else s=k._defaultMinTerrainHeight}return s=Math.max(k._defaultMinTerrainHeight,s),{minimumTerrainHeight:s,maximumTerrainHeight:o}},k.getBoundingSphere=function(t,i){i=n.defaultValue(i,a.Ellipsoid.WGS84);const r=L(t);let s=k._defaultMaxTerrainHeight;if(n.defined(r)){const e=`${r.level}-${r.x}-${r.y}`,t=k._terrainHeights[e];n.defined(t)&&(s=t[1])}const o=e.BoundingSphere.fromRectangle3D(t,i,0);return e.BoundingSphere.fromRectangle3D(t,i,s,O),e.BoundingSphere.union(o,O,o)},k._terrainHeightsMaxLevel=6,k._defaultMaxTerrainHeight=9e3,k._defaultMinTerrainHeight=-1e5,k._terrainHeights=void 0,k._initPromise=void 0,Object.defineProperties(k,{initialized:{get:function(){return n.defined(k._terrainHeights)}}});var S=k;const x=[e.GeographicProjection,d.WebMercatorProjection],I=x.length,N=Math.cos(i.CesiumMath.toRadians(30)),R=Math.cos(i.CesiumMath.toRadians(150)),D=0,v=1e3;function z(e){const t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).positions;this.width=n.defaultValue(e.width,1),this._positions=t,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=a.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(z.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+a.Ellipsoid.packedLength+1+1}}}),z.setProjectionAndEllipsoid=function(e,t){let a=0;for(let e=0;e<I;e++)if(t instanceof x[e]){a=e;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};const H=new a.Cartesian3,j=new a.Cartesian3,B=new a.Cartesian3;function V(e,t,n,i,r){const s=U(i,e,0,H),o=U(i,e,n,j),l=U(i,t,0,B),c=Z(o,s,j),u=Z(l,s,B);return a.Cartesian3.cross(u,c,r),a.Cartesian3.normalize(r,r)}const G=new a.Cartographic,Y=new a.Cartesian3,F=new a.Cartesian3,q=new a.Cartesian3;function X(e,t,n,i,s,o,u,C,p,h,d){if(0===s)return;let g;o===r.ArcType.GEODESIC?g=new l.EllipsoidGeodesic(e,t,u):o===r.ArcType.RHUMB&&(g=new c.EllipsoidRhumbLine(e,t,u));const f=g.surfaceDistance;if(f<s)return;const m=V(e,t,i,u,q),w=Math.ceil(f/s),y=f/w;let M=y;const T=w-1;let E=C.length;for(let e=0;e<T;e++){const e=g.interpolateUsingSurfaceDistance(M,G),t=U(u,e,n,Y),r=U(u,e,i,F);a.Cartesian3.pack(m,C,E),a.Cartesian3.pack(t,p,E),a.Cartesian3.pack(r,h,E),d.push(e.latitude),d.push(e.longitude),E+=3,M+=y}}const W=new a.Cartographic;function U(e,t,n,i){return a.Cartographic.clone(t,W),W.height=n,a.Cartographic.toCartesian(W,e,i)}function Z(e,t,n){return a.Cartesian3.subtract(e,t,n),a.Cartesian3.normalize(n,n),n}function $(e,t,n,i){return i=Z(e,t,i),i=a.Cartesian3.cross(i,n,i),i=a.Cartesian3.normalize(i,i),i=a.Cartesian3.cross(n,i,i)}z.pack=function(e,t,i){let r=n.defaultValue(i,0);const s=e._positions,o=s.length;t[r++]=o;for(let e=0;e<o;++e){const n=s[e];a.Cartesian3.pack(n,t,r),r+=3}return t[r++]=e.granularity,t[r++]=e.loop?1:0,t[r++]=e.arcType,a.Ellipsoid.pack(e._ellipsoid,t,r),r+=a.Ellipsoid.packedLength,t[r++]=e._projectionIndex,t[r++]=e._scene3DOnly?1:0,t},z.unpack=function(e,t,i){let r=n.defaultValue(t,0);const s=e[r++],o=new Array(s);for(let t=0;t<s;t++)o[t]=a.Cartesian3.unpack(e,r),r+=3;const l=e[r++],c=1===e[r++],u=e[r++],C=a.Ellipsoid.unpack(e,r);r+=a.Ellipsoid.packedLength;const p=e[r++],h=1===e[r++];return n.defined(i)||(i=new z({positions:o})),i._positions=o,i.granularity=l,i.loop=c,i.arcType=u,i._ellipsoid=C,i._projectionIndex=p,i._scene3DOnly=h,i};const J=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,ee=new a.Cartesian3;function te(e,t,n,r,s){const o=Z(n,t,ee),l=$(e,t,o,J),c=$(r,t,o,Q);if(i.CesiumMath.equalsEpsilon(a.Cartesian3.dot(l,c),-1,i.CesiumMath.EPSILON5))return s=a.Cartesian3.cross(o,l,s),s=a.Cartesian3.normalize(s,s);s=a.Cartesian3.add(c,l,s),s=a.Cartesian3.normalize(s,s);const u=a.Cartesian3.cross(o,s,K);return a.Cartesian3.dot(c,u)<0&&(s=a.Cartesian3.negate(s,s)),s}const ae=h.Plane.fromPointNormal(a.Cartesian3.ZERO,a.Cartesian3.UNIT_Y),ne=new a.Cartesian3,ie=new a.Cartesian3,re=new a.Cartesian3,se=new a.Cartesian3,oe=new a.Cartesian3,le=new a.Cartesian3,ce=new a.Cartographic,ue=new a.Cartographic,Ce=new a.Cartographic;z.createGeometry=function(l){const h=!l._scene3DOnly;let d=l.loop;const g=l._ellipsoid,f=l.granularity,m=l.arcType,w=new x[l._projectionIndex](g),y=D,M=v;let T,E;const _=l._positions,O=_.length;let P,A,b,k;2===O&&(d=!1);const L=new c.EllipsoidRhumbLine(void 0,void 0,g);let I,R,z;const H=[_[0]];for(E=0;E<O-1;E++)P=_[E],A=_[E+1],I=p.IntersectionTests.lineSegmentPlane(P,A,ae,le),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||(l.arcType===r.ArcType.GEODESIC?H.push(a.Cartesian3.clone(I)):l.arcType===r.ArcType.RHUMB&&(z=g.cartesianToCartographic(I,ce).longitude,b=g.cartesianToCartographic(P,ce),k=g.cartesianToCartographic(A,ue),L.setEndPoints(b,k),R=L.findIntersectionWithLongitude(z,Ce),I=g.cartographicToCartesian(R,le),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||H.push(a.Cartesian3.clone(I)))),H.push(A);d&&(P=_[O-1],A=_[0],I=p.IntersectionTests.lineSegmentPlane(P,A,ae,le),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||(l.arcType===r.ArcType.GEODESIC?H.push(a.Cartesian3.clone(I)):l.arcType===r.ArcType.RHUMB&&(z=g.cartesianToCartographic(I,ce).longitude,b=g.cartesianToCartographic(P,ce),k=g.cartesianToCartographic(A,ue),L.setEndPoints(b,k),R=L.findIntersectionWithLongitude(z,Ce),I=g.cartographicToCartesian(R,le),!n.defined(I)||a.Cartesian3.equalsEpsilon(I,P,i.CesiumMath.EPSILON7)||a.Cartesian3.equalsEpsilon(I,A,i.CesiumMath.EPSILON7)||H.push(a.Cartesian3.clone(I)))));let j=H.length,B=new Array(j);for(E=0;E<j;E++){const e=a.Cartographic.fromCartesian(H[E],g);e.height=0,B[E]=e}if(B=s.arrayRemoveDuplicates(B,a.Cartographic.equalsEpsilon),j=B.length,j<2)return;const G=[],Y=[],F=[],q=[];let W=ne,$=ie,J=re,Q=se,K=oe;const ee=B[0],pe=B[1];for(W=U(g,B[j-1],y,W),Q=U(g,pe,y,Q),$=U(g,ee,y,$),J=U(g,ee,M,J),K=d?te(W,$,J,Q,K):V(ee,pe,M,g,K),a.Cartesian3.pack(K,Y,0),a.Cartesian3.pack($,F,0),a.Cartesian3.pack(J,q,0),G.push(ee.latitude),G.push(ee.longitude),X(ee,pe,y,M,f,m,g,Y,F,q,G),E=1;E<j-1;++E){W=a.Cartesian3.clone($,W),$=a.Cartesian3.clone(Q,$);const e=B[E];U(g,e,M,J),U(g,B[E+1],y,Q),te(W,$,J,Q,K),T=Y.length,a.Cartesian3.pack(K,Y,T),a.Cartesian3.pack($,F,T),a.Cartesian3.pack(J,q,T),G.push(e.latitude),G.push(e.longitude),X(B[E],B[E+1],y,M,f,m,g,Y,F,q,G)}const he=B[j-1],de=B[j-2];if($=U(g,he,y,$),J=U(g,he,M,J),d){const e=B[0];W=U(g,de,y,W),Q=U(g,e,y,Q),K=te(W,$,J,Q,K)}else K=V(de,he,M,g,K);if(T=Y.length,a.Cartesian3.pack(K,Y,T),a.Cartesian3.pack($,F,T),a.Cartesian3.pack(J,q,T),G.push(he.latitude),G.push(he.longitude),d){for(X(he,ee,y,M,f,m,g,Y,F,q,G),T=Y.length,E=0;E<3;++E)Y[T+E]=Y[E],F[T+E]=F[E],q[T+E]=q[E];G.push(ee.latitude),G.push(ee.longitude)}return function(n,r,s,l,c,p,h){let d,g;const f=r._ellipsoid,m=s.length/3-1,w=8*m,y=4*w,M=36*m,T=w>65535?new Uint32Array(M):new Uint16Array(M),E=new Float64Array(3*w),_=new Float32Array(y),O=new Float32Array(y),P=new Float32Array(y),A=new Float32Array(y),b=new Float32Array(y);let k,L,x,I;h&&(k=new Float32Array(y),L=new Float32Array(y),x=new Float32Array(y),I=new Float32Array(2*w));const R=p.length/2;let D=0;const v=Ae;v.height=0;const z=be;z.height=0;let H=ke,j=Le;if(h)for(g=0,d=1;d<R;d++)v.latitude=p[g],v.longitude=p[g+1],z.latitude=p[g+2],z.longitude=p[g+3],H=r.project(v,H),j=r.project(z,j),D+=a.Cartesian3.distance(H,j),g+=2;const B=l.length/3;j=a.Cartesian3.unpack(l,0,j);let V,G=0;for(g=3,d=1;d<B;d++)H=a.Cartesian3.clone(j,H),j=a.Cartesian3.unpack(l,g,j),G+=a.Cartesian3.distance(H,j),g+=3;g=3;let Y=0,F=0,q=0,X=0,W=!1,U=a.Cartesian3.unpack(s,0,xe),$=a.Cartesian3.unpack(l,0,Le),J=a.Cartesian3.unpack(c,0,Ne);if(n){ge(J,a.Cartesian3.unpack(s,s.length-6,Se),U,$)&&(J=a.Cartesian3.negate(J,J))}let Q=0,K=0,ee=0;for(d=0;d<m;d++){const e=a.Cartesian3.clone(U,Se),n=a.Cartesian3.clone($,ke);let o,C,d,m,w=a.Cartesian3.clone(J,Ie);if(W&&(w=a.Cartesian3.negate(w,w)),U=a.Cartesian3.unpack(s,g,xe),$=a.Cartesian3.unpack(l,g,Le),J=a.Cartesian3.unpack(c,g,Ne),W=ge(J,e,U,$),v.latitude=p[Y],v.longitude=p[Y+1],z.latitude=p[Y+2],z.longitude=p[Y+3],h){const e=Pe(v,z);o=r.project(v,Be),C=r.project(z,Ve);const t=Z(C,o,Qe);t.y=Math.abs(t.y),d=Ge,m=Ye,0===e||a.Cartesian3.dot(t,a.Cartesian3.UNIT_Y)>N?(d=ye(r,v,w,o,Ge),m=ye(r,z,J,C,Ye)):1===e?(m=ye(r,z,J,C,Ye),d.x=0,d.y=i.CesiumMath.sign(v.longitude-Math.abs(z.longitude)),d.z=0):(d=ye(r,v,w,o,Ge),m.x=0,m.y=i.CesiumMath.sign(v.longitude-z.longitude),m.z=0)}const y=a.Cartesian3.distance(n,$),M=u.EncodedCartesian3.fromCartesian(e,$e),T=a.Cartesian3.subtract(U,e,Fe),R=a.Cartesian3.normalize(T,We);let H=a.Cartesian3.subtract(n,e,qe);H=a.Cartesian3.normalize(H,H);let j=a.Cartesian3.cross(R,H,We);j=a.Cartesian3.normalize(j,j);let B=a.Cartesian3.cross(H,w,Ue);B=a.Cartesian3.normalize(B,B);let te=a.Cartesian3.subtract($,U,Xe);te=a.Cartesian3.normalize(te,te);let ae=a.Cartesian3.cross(J,te,Ze);ae=a.Cartesian3.normalize(ae,ae);const ne=y/G,ie=Q/G;let re,se,oe,le=0,ce=0,ue=0;if(h){le=a.Cartesian3.distance(o,C),re=u.EncodedCartesian3.fromCartesian(o,Je),se=a.Cartesian3.subtract(C,o,Qe),oe=a.Cartesian3.normalize(se,Ke);const e=oe.x;oe.x=oe.y,oe.y=-e,ce=le/D,ue=K/D}for(V=0;V<8;V++){const e=X+4*V,t=F+2*V,n=e+3,i=V<4?1:-1,r=2===V||3===V||6===V||7===V?1:-1;a.Cartesian3.pack(M.high,_,e),_[n]=T.x,a.Cartesian3.pack(M.low,O,e),O[n]=T.y,a.Cartesian3.pack(B,P,e),P[n]=T.z,a.Cartesian3.pack(ae,A,e),A[n]=ne*i,a.Cartesian3.pack(j,b,e);let s=ie*r;0===s&&r<0&&(s=9),b[n]=s,h&&(k[e]=re.high.x,k[e+1]=re.high.y,k[e+2]=re.low.x,k[e+3]=re.low.y,x[e]=-d.y,x[e+1]=d.x,x[e+2]=m.y,x[e+3]=-m.x,L[e]=se.x,L[e+1]=se.y,L[e+2]=oe.x,L[e+3]=oe.y,I[t]=ce*i,s=ue*r,0===s&&r<0&&(s=9),I[t+1]=s)}const Ce=He,pe=je,he=ve,de=ze,fe=t.Rectangle.fromCartographicArray(Re,De),me=S.getMinimumMaximumHeights(fe,f),we=me.minimumTerrainHeight,Me=me.maximumTerrainHeight;ee+=we,ee+=Me,Ee(e,n,we,Me,Ce,he),Ee(U,$,we,Me,pe,de);let Te=a.Cartesian3.multiplyByScalar(j,i.CesiumMath.EPSILON5,et);a.Cartesian3.add(Ce,Te,Ce),a.Cartesian3.add(pe,Te,pe),a.Cartesian3.add(he,Te,he),a.Cartesian3.add(de,Te,de),Oe(Ce,pe),Oe(he,de),a.Cartesian3.pack(Ce,E,q),a.Cartesian3.pack(pe,E,q+3),a.Cartesian3.pack(de,E,q+6),a.Cartesian3.pack(he,E,q+9),Te=a.Cartesian3.multiplyByScalar(j,-2*i.CesiumMath.EPSILON5,et),a.Cartesian3.add(Ce,Te,Ce),a.Cartesian3.add(pe,Te,pe),a.Cartesian3.add(he,Te,he),a.Cartesian3.add(de,Te,de),Oe(Ce,pe),Oe(he,de),a.Cartesian3.pack(Ce,E,q+12),a.Cartesian3.pack(pe,E,q+15),a.Cartesian3.pack(de,E,q+18),a.Cartesian3.pack(he,E,q+21),Y+=2,g+=3,F+=16,q+=24,X+=32,Q+=y,K+=le}g=0;let te=0;for(d=0;d<m;d++){for(V=0;V<nt;V++)T[g+V]=at[V]+te;te+=8,g+=nt}const ae=tt;e.BoundingSphere.fromVertices(s,a.Cartesian3.ZERO,3,ae[0]),e.BoundingSphere.fromVertices(l,a.Cartesian3.ZERO,3,ae[1]);const ne=e.BoundingSphere.fromBoundingSpheres(ae);ne.radius+=ee/(2*m);const ie={position:new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:it(_),startLoAndForwardOffsetY:it(O),startNormalAndForwardOffsetZ:it(P),endNormalAndTextureCoordinateNormalizationX:it(A),rightNormalAndTextureCoordinateNormalizationY:it(b)};h&&(ie.startHiLo2D=it(k),ie.offsetAndRight2D=it(L),ie.startEndNormals2D=it(x),ie.texcoordNormalization2D=new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:I}));return new C.Geometry({attributes:ie,indices:T,boundingSphere:ne})}(d,w,F,q,Y,G,h)};const pe=new a.Cartesian3,he=new a.Matrix3,de=new e.Quaternion;function ge(t,n,r,s){const o=Z(r,n,pe),l=a.Cartesian3.dot(o,t);if(l>N||l<R){const n=Z(s,r,ee),o=l<R?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,de),u=a.Matrix3.fromQuaternion(c,he);return a.Matrix3.multiplyByVector(u,t,t),!0}return!1}const fe=new a.Cartographic,me=new a.Cartesian3,we=new a.Cartesian3;function ye(e,t,n,r,s){const o=a.Cartographic.toCartesian(t,e._ellipsoid,me);let l=a.Cartesian3.add(o,n,we),c=!1;const u=e._ellipsoid;let C=u.cartesianToCartographic(l,fe);Math.abs(t.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=a.Cartesian3.subtract(o,n,we),C=u.cartesianToCartographic(l,fe)),C.height=0;const p=e.project(C,s);return(s=a.Cartesian3.subtract(p,r,s)).z=0,s=a.Cartesian3.normalize(s,s),c&&a.Cartesian3.negate(s,s),s}const Me=new a.Cartesian3,Te=new a.Cartesian3;function Ee(e,t,n,i,r,s){const o=a.Cartesian3.subtract(t,e,Me);a.Cartesian3.normalize(o,o);const l=n-D;let c=a.Cartesian3.multiplyByScalar(o,l,Te);a.Cartesian3.add(e,c,r);const u=i-v;c=a.Cartesian3.multiplyByScalar(o,u,Te),a.Cartesian3.add(t,c,s)}const _e=new a.Cartesian3;function Oe(e,t){const n=h.Plane.getPointDistance(ae,e),r=h.Plane.getPointDistance(ae,t);let s=_e;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=Z(t,e,s),a.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),a.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=Z(e,t,s),a.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),a.Cartesian3.add(t,s,t))}function Pe(e,t){const a=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const n=i.CesiumMath.sign(t.longitude);return e.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const a=i.CesiumMath.sign(e.longitude);return t.longitude=a*(n-i.CesiumMath.EPSILON11),2}return 0}const Ae=new a.Cartographic,be=new a.Cartographic,ke=new a.Cartesian3,Le=new a.Cartesian3,Se=new a.Cartesian3,xe=new a.Cartesian3,Ie=new a.Cartesian3,Ne=new a.Cartesian3,Re=[Ae,be],De=new t.Rectangle,ve=new a.Cartesian3,ze=new a.Cartesian3,He=new a.Cartesian3,je=new a.Cartesian3,Be=new a.Cartesian3,Ve=new a.Cartesian3,Ge=new a.Cartesian3,Ye=new a.Cartesian3,Fe=new a.Cartesian3,qe=new a.Cartesian3,Xe=new a.Cartesian3,We=new a.Cartesian3,Ue=new a.Cartesian3,Ze=new a.Cartesian3,$e=new u.EncodedCartesian3,Je=new u.EncodedCartesian3,Qe=new a.Cartesian3,Ke=new a.Cartesian3,et=new a.Cartesian3,tt=[new e.BoundingSphere,new e.BoundingSphere],at=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],nt=at.length;function it(e){return new C.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return z._projectNormal=ye,function(e,t){return S.initialize().then((function(){return n.defined(t)&&(e=z.unpack(e,t)),z.createGeometry(e)}))}})); diff --git a/public/lib/Cesium/Workers/createPlaneGeometry.js b/public/lib/Cesium/Workers/createPlaneGeometry.js index c7b9a59f..82f9bc11 100644 --- a/public/lib/Cesium/Workers/createPlaneGeometry.js +++ b/public/lib/Cesium/Workers/createPlaneGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./VertexFormat-fbdec922","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(t,e,n,r,a,o,i,m,u,p,c,s){"use strict";function y(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT);const n=t.defaultValue(e.vertexFormat,i.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}y.packedLength=i.VertexFormat.packedLength,y.pack=function(e,n,r){return r=t.defaultValue(r,0),i.VertexFormat.pack(e._vertexFormat,n,r),n};const l=new i.VertexFormat,A={vertexFormat:l};y.unpack=function(e,n,r){n=t.defaultValue(n,0);const a=i.VertexFormat.unpack(e,n,l);return t.defined(r)?(r._vertexFormat=i.VertexFormat.clone(a,r._vertexFormat),r):new y(A)};const F=new n.Cartesian3(-.5,-.5,0),f=new n.Cartesian3(.5,.5,0);return y.createGeometry=function(t){const i=t._vertexFormat,m=new o.GeometryAttributes;let u,p;if(i.position){if(p=new Float64Array(12),p[0]=F.x,p[1]=F.y,p[2]=0,p[3]=f.x,p[4]=F.y,p[5]=0,p[6]=f.x,p[7]=f.y,p[8]=0,p[9]=F.x,p[10]=f.y,p[11]=0,m.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),i.normal){const t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,m.normal=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(i.st){const t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,m.st=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}if(i.tangent){const t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,m.tangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(i.bitangent){const t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,m.bitangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}u=new Uint16Array(6),u[0]=0,u[1]=1,u[2]=2,u[3]=0,u[4]=2,u[5]=3}return new a.Geometry({attributes:m,indices:u,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:new e.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(e,n){return t.defined(n)&&(e=y.unpack(e,n)),y.createGeometry(e)}})); +define(["./defaultValue-f6d5e6da","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./VertexFormat-fbdec922","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(t,e,n,r,a,o,i,m,u,p,c,s){"use strict";function y(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT);const n=t.defaultValue(e.vertexFormat,i.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}y.packedLength=i.VertexFormat.packedLength,y.pack=function(e,n,r){return r=t.defaultValue(r,0),i.VertexFormat.pack(e._vertexFormat,n,r),n};const l=new i.VertexFormat,A={vertexFormat:l};y.unpack=function(e,n,r){n=t.defaultValue(n,0);const a=i.VertexFormat.unpack(e,n,l);return t.defined(r)?(r._vertexFormat=i.VertexFormat.clone(a,r._vertexFormat),r):new y(A)};const F=new n.Cartesian3(-.5,-.5,0),f=new n.Cartesian3(.5,.5,0);return y.createGeometry=function(t){const i=t._vertexFormat,m=new o.GeometryAttributes;let u,p;if(i.position){if(p=new Float64Array(12),p[0]=F.x,p[1]=F.y,p[2]=0,p[3]=f.x,p[4]=F.y,p[5]=0,p[6]=f.x,p[7]=f.y,p[8]=0,p[9]=F.x,p[10]=f.y,p[11]=0,m.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),i.normal){const t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,m.normal=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(i.st){const t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,m.st=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}if(i.tangent){const t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,m.tangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(i.bitangent){const t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,m.bitangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}u=new Uint16Array(6),u[0]=0,u[1]=1,u[2]=2,u[3]=0,u[4]=2,u[5]=3}return new a.Geometry({attributes:m,indices:u,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:new e.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(e,n){return t.defined(n)&&(e=y.unpack(e,n)),y.createGeometry(e)}})); diff --git a/public/lib/Cesium/Workers/createPlaneOutlineGeometry.js b/public/lib/Cesium/Workers/createPlaneOutlineGeometry.js index b3e6acc0..0e291675 100644 --- a/public/lib/Cesium/Workers/createPlaneOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createPlaneOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Transforms-b3716b06","./Matrix3-81054f0f","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./Math-2ce22ee9","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(e,t,n,r,i,a,o,u,c,s,y){"use strict";function m(){this._workerName="createPlaneOutlineGeometry"}m.packedLength=0,m.pack=function(e,t){return t},m.unpack=function(t,n,r){return e.defined(r)?r:new m};const p=new n.Cartesian3(-.5,-.5,0),f=new n.Cartesian3(.5,.5,0);return m.createGeometry=function(){const e=new a.GeometryAttributes,o=new Uint16Array(8),u=new Float64Array(12);return u[0]=p.x,u[1]=p.y,u[2]=p.z,u[3]=f.x,u[4]=p.y,u[5]=p.z,u[6]=f.x,u[7]=f.y,u[8]=p.z,u[9]=p.x,u[10]=f.y,u[11]=p.z,e.position=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),o[0]=0,o[1]=1,o[2]=1,o[3]=2,o[4]=2,o[5]=3,o[6]=3,o[7]=0,new i.Geometry({attributes:e,indices:o,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=m.unpack(t,n)),m.createGeometry(t)}})); +define(["./defaultValue-f6d5e6da","./Transforms-f17097e5","./Matrix3-b2351961","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./Math-355606c6","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93"],(function(e,t,n,r,i,a,o,u,c,s,y){"use strict";function m(){this._workerName="createPlaneOutlineGeometry"}m.packedLength=0,m.pack=function(e,t){return t},m.unpack=function(t,n,r){return e.defined(r)?r:new m};const p=new n.Cartesian3(-.5,-.5,0),f=new n.Cartesian3(.5,.5,0);return m.createGeometry=function(){const e=new a.GeometryAttributes,o=new Uint16Array(8),u=new Float64Array(12);return u[0]=p.x,u[1]=p.y,u[2]=p.z,u[3]=f.x,u[4]=p.y,u[5]=p.z,u[6]=f.x,u[7]=f.y,u[8]=p.z,u[9]=p.x,u[10]=f.y,u[11]=p.z,e.position=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),o[0]=0,o[1]=1,o[2]=1,o[3]=2,o[4]=2,o[5]=3,o[6]=3,o[7]=0,new i.Geometry({attributes:e,indices:o,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=m.unpack(t,n)),m.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createPolygonGeometry.js b/public/lib/Cesium/Workers/createPolygonGeometry.js index 31767ee9..741d4790 100644 --- a/public/lib/Cesium/Workers/createPolygonGeometry.js +++ b/public/lib/Cesium/Workers/createPolygonGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./ArcType-26a3f38d","./BoundingRectangle-9216d683","./Transforms-b3716b06","./Matrix2-413c4048","./ComponentDatatype-ab629b88","./EllipsoidGeodesic-2723ab86","./EllipsoidTangentPlane-cf43ca0f","./GeometryAttribute-12713b29","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonGeometryLibrary-f2ea6fbf","./PolygonPipeline-87656bae","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./arrayRemoveDuplicates-9b636830","./EllipsoidRhumbLine-77eff028","./GeometryAttributes-1e4ddcd2"],(function(t,e,o,i,r,n,a,s,l,u,c,p,y,d,m,g,h,f,b,_,P,x,C,w,T,I,A,v,E){"use strict";const G=new e.Cartographic,O=new e.Cartographic;function L(t,e,o,i){const r=i.cartesianToCartographic(t,G).height,n=i.cartesianToCartographic(e,O);n.height=r,i.cartographicToCartesian(n,e);const a=i.cartesianToCartographic(o,O);a.height=r-100,i.cartographicToCartesian(a,o)}const V=new i.BoundingRectangle,H=new e.Cartesian3,D=new e.Cartesian3,N=new e.Cartesian3,F=new e.Cartesian3,R=new e.Cartesian3,M=new e.Cartesian3;let S=new e.Cartesian3,B=new e.Cartesian3,k=new e.Cartesian3;const z=new n.Cartesian2,W=new n.Cartesian2,Y=new e.Cartesian3,U=new r.Quaternion,j=new e.Matrix3,Q=new e.Matrix3;function q(o){const i=o.vertexFormat,s=o.geometry,l=o.shadowVolume,c=s.attributes.position.values,y=t.defined(s.attributes.st)?s.attributes.st.values:void 0;let d=c.length;const g=o.wall,h=o.top||g,f=o.bottom||g;if(i.st||i.normal||i.tangent||i.bitangent||l){const p=o.boundingRectangle,b=o.tangentPlane,_=o.ellipsoid,P=o.stRotation,x=o.perPositionHeight,C=z;C.x=p.x,C.y=p.y;const w=i.st?new Float32Array(d/3*2):void 0;let T;i.normal&&(T=x&&h&&!g?s.attributes.normal.values:new Float32Array(d));const I=i.tangent?new Float32Array(d):void 0,A=i.bitangent?new Float32Array(d):void 0,v=l?new Float32Array(d):void 0;let E=0,G=0,O=D,V=N,q=F,K=!0,Z=j,J=Q;if(0!==P){let t=r.Quaternion.fromAxisAngle(b._plane.normal,P,U);Z=e.Matrix3.fromQuaternion(t,Z),t=r.Quaternion.fromAxisAngle(b._plane.normal,-P,U),J=e.Matrix3.fromQuaternion(t,J)}else Z=e.Matrix3.clone(e.Matrix3.IDENTITY,Z),J=e.Matrix3.clone(e.Matrix3.IDENTITY,J);let X=0,$=0;h&&f&&(X=d/2,$=d/3,d/=2);for(let r=0;r<d;r+=3){const a=e.Cartesian3.fromArray(c,r,Y);if(i.st&&!t.defined(y)){let t=e.Matrix3.multiplyByVector(Z,a,H);t=_.scaleToGeodeticSurface(t,t);const o=b.projectPointOntoPlane(t,W);n.Cartesian2.subtract(o,C,o);const i=m.CesiumMath.clamp(o.x/p.width,0,1),r=m.CesiumMath.clamp(o.y/p.height,0,1);f&&(w[E+$]=i,w[E+1+$]=r),h&&(w[E]=i,w[E+1]=r),E+=2}if(i.normal||i.tangent||i.bitangent||l){const t=G+1,n=G+2;if(g){if(r+3<d){const t=e.Cartesian3.fromArray(c,r+3,R);if(K){const o=e.Cartesian3.fromArray(c,r+d,M);x&&L(a,t,o,_),e.Cartesian3.subtract(t,a,t),e.Cartesian3.subtract(o,a,o),O=e.Cartesian3.normalize(e.Cartesian3.cross(o,t,O),O),K=!1}e.Cartesian3.equalsEpsilon(t,a,m.CesiumMath.EPSILON10)&&(K=!0)}(i.tangent||i.bitangent)&&(q=_.geodeticSurfaceNormal(a,q),i.tangent&&(V=e.Cartesian3.normalize(e.Cartesian3.cross(q,O,V),V)))}else O=_.geodeticSurfaceNormal(a,O),(i.tangent||i.bitangent)&&(x&&(S=e.Cartesian3.fromArray(T,G,S),B=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,S,B),B=e.Cartesian3.normalize(e.Matrix3.multiplyByVector(J,B,B),B),i.bitangent&&(k=e.Cartesian3.normalize(e.Cartesian3.cross(S,B,k),k))),V=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,O,V),V=e.Cartesian3.normalize(e.Matrix3.multiplyByVector(J,V,V),V),i.bitangent&&(q=e.Cartesian3.normalize(e.Cartesian3.cross(O,V,q),q)));i.normal&&(o.wall?(T[G+X]=O.x,T[t+X]=O.y,T[n+X]=O.z):f&&(T[G+X]=-O.x,T[t+X]=-O.y,T[n+X]=-O.z),(h&&!x||g)&&(T[G]=O.x,T[t]=O.y,T[n]=O.z)),l&&(g&&(O=_.geodeticSurfaceNormal(a,O)),v[G+X]=-O.x,v[t+X]=-O.y,v[n+X]=-O.z),i.tangent&&(o.wall?(I[G+X]=V.x,I[t+X]=V.y,I[n+X]=V.z):f&&(I[G+X]=-V.x,I[t+X]=-V.y,I[n+X]=-V.z),h&&(x?(I[G]=B.x,I[t]=B.y,I[n]=B.z):(I[G]=V.x,I[t]=V.y,I[n]=V.z))),i.bitangent&&(f&&(A[G+X]=q.x,A[t+X]=q.y,A[n+X]=q.z),h&&(x?(A[G]=k.x,A[t]=k.y,A[n]=k.z):(A[G]=q.x,A[t]=q.y,A[n]=q.z))),G+=3}}i.st&&!t.defined(y)&&(s.attributes.st=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:w})),i.normal&&(s.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),i.tangent&&(s.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:I})),i.bitangent&&(s.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})),l&&(s.attributes.extrudeDirection=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v}))}if(o.extrude&&t.defined(o.offsetAttribute)){const t=c.length/3;let e=new Uint8Array(t);if(o.offsetAttribute===p.GeometryOffsetAttribute.TOP)h&&f||g?e=e.fill(1,0,t/2):h&&(e=e.fill(1));else{const t=o.offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;e=e.fill(t)}s.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return s}const K=new e.Cartographic,Z=new e.Cartographic,J={westOverIDL:0,eastOverIDL:0};let X=new s.EllipsoidGeodesic;function $(e,i,r,a,l){if(l=t.defaultValue(l,new n.Rectangle),!t.defined(e)||e.length<3)return l.west=0,l.north=0,l.south=0,l.east=0,l;if(r===o.ArcType.RHUMB)return n.Rectangle.fromCartesianArray(e,i,l);X.ellipsoid.equals(i)||(X=new s.EllipsoidGeodesic(void 0,void 0,i)),l.west=Number.POSITIVE_INFINITY,l.east=Number.NEGATIVE_INFINITY,l.south=Number.POSITIVE_INFINITY,l.north=Number.NEGATIVE_INFINITY,J.westOverIDL=Number.POSITIVE_INFINITY,J.eastOverIDL=Number.NEGATIVE_INFINITY;const u=1/m.CesiumMath.chordLength(a,i.maximumRadius),c=e.length;let p,y=i.cartesianToCartographic(e[0],Z),d=K;for(let t=1;t<c;t++)p=d,d=y,y=i.cartesianToCartographic(e[t],p),X.setEndPoints(d,y),et(X,u,l,J);return p=d,d=y,y=i.cartesianToCartographic(e[0],p),X.setEndPoints(d,y),et(X,u,l,J),l.east-l.west>J.eastOverIDL-J.westOverIDL&&(l.west=J.westOverIDL,l.east=J.eastOverIDL,l.east>m.CesiumMath.PI&&(l.east=l.east-m.CesiumMath.TWO_PI),l.west>m.CesiumMath.PI&&(l.west=l.west-m.CesiumMath.TWO_PI)),l}const tt=new e.Cartographic;function et(t,e,o,i){const r=t.surfaceDistance,n=Math.ceil(r*e),a=n>0?r/(n-1):Number.POSITIVE_INFINITY;let s=0;for(let e=0;e<n;e++){const e=t.interpolateUsingSurfaceDistance(s,tt);s+=a;const r=e.longitude,n=e.latitude;o.west=Math.min(o.west,r),o.east=Math.max(o.east,r),o.south=Math.min(o.south,n),o.north=Math.max(o.north,n);const l=r>=0?r:r+m.CesiumMath.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,l),i.eastOverIDL=Math.max(i.eastOverIDL,l)}}const ot=[];function it(e,o,i,r,n,a,s,u,p,y){const m={walls:[]};let f;if(s||u){const n=g.PolygonGeometryLibrary.createGeometryFromPositions(e,o,i,r,a,p,y),l=n.attributes.position.values,h=n.indices;let b,_;if(s&&u){const e=l.concat(l);b=e.length/3,_=d.IndexDatatype.createTypedArray(b,2*h.length),_.set(h);const o=h.length,r=b/2;for(f=0;f<o;f+=3){const t=_[f]+r,e=_[f+1]+r,i=_[f+2]+r;_[f+o]=i,_[f+1+o]=e,_[f+2+o]=t}if(n.attributes.position.values=e,a&&p.normal){const t=n.attributes.normal.values;n.attributes.normal.values=new Float32Array(e.length),n.attributes.normal.values.set(t)}if(p.st&&t.defined(i)){const t=n.attributes.st.values;n.attributes.st.values=new Float32Array(2*b),n.attributes.st.values=t.concat(t)}n.indices=_}else if(u){for(b=l.length/3,_=d.IndexDatatype.createTypedArray(b,h.length),f=0;f<h.length;f+=3)_[f]=h[f+2],_[f+1]=h[f+1],_[f+2]=h[f];n.indices=_}m.topAndBottom=new c.GeometryInstance({geometry:n})}let b=n.outerRing,_=l.EllipsoidTangentPlane.fromPoints(b,e),P=_.projectPointsOntoPlane(b,ot),x=h.PolygonPipeline.computeWindingOrder2D(P);x===h.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());let C=g.PolygonGeometryLibrary.computeWallGeometry(b,i,e,r,a,y);m.walls.push(new c.GeometryInstance({geometry:C}));const w=n.holes;for(f=0;f<w.length;f++){let t=w[f];_=l.EllipsoidTangentPlane.fromPoints(t,e),P=_.projectPointsOntoPlane(t,ot),x=h.PolygonPipeline.computeWindingOrder2D(P),x===h.WindingOrder.COUNTER_CLOCKWISE&&(t=t.slice().reverse()),C=g.PolygonGeometryLibrary.computeWallGeometry(t,i,e,r,a,y),m.walls.push(new c.GeometryInstance({geometry:C}))}return m}function rt(i){const r=i.polygonHierarchy,a=t.defaultValue(i.vertexFormat,f.VertexFormat.DEFAULT),s=t.defaultValue(i.ellipsoid,e.Ellipsoid.WGS84),l=t.defaultValue(i.granularity,m.CesiumMath.RADIANS_PER_DEGREE),u=t.defaultValue(i.stRotation,0),c=i.textureCoordinates,p=t.defaultValue(i.perPositionHeight,!1),y=p&&t.defined(i.extrudedHeight);let d=t.defaultValue(i.height,0),h=t.defaultValue(i.extrudedHeight,d);if(!y){const t=Math.max(d,h);h=Math.min(d,h),d=t}this._vertexFormat=f.VertexFormat.clone(a),this._ellipsoid=e.Ellipsoid.clone(s),this._granularity=l,this._stRotation=u,this._height=d,this._extrudedHeight=h,this._closeTop=t.defaultValue(i.closeTop,!0),this._closeBottom=t.defaultValue(i.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=p,this._perPositionHeightExtrude=y,this._shadowVolume=t.defaultValue(i.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=i.offsetAttribute,this._arcType=t.defaultValue(i.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=c,this.packedLength=g.PolygonGeometryLibrary.computeHierarchyPackedLength(r,e.Cartesian3)+e.Ellipsoid.packedLength+f.VertexFormat.packedLength+(c?g.PolygonGeometryLibrary.computeHierarchyPackedLength(c,n.Cartesian2):1)+12}rt.fromPositions=function(e){return new rt({polygonHierarchy:{positions:(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates})},rt.pack=function(o,i,r){return r=t.defaultValue(r,0),r=g.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,i,r,e.Cartesian3),e.Ellipsoid.pack(o._ellipsoid,i,r),r+=e.Ellipsoid.packedLength,f.VertexFormat.pack(o._vertexFormat,i,r),r+=f.VertexFormat.packedLength,i[r++]=o._height,i[r++]=o._extrudedHeight,i[r++]=o._granularity,i[r++]=o._stRotation,i[r++]=o._perPositionHeightExtrude?1:0,i[r++]=o._perPositionHeight?1:0,i[r++]=o._closeTop?1:0,i[r++]=o._closeBottom?1:0,i[r++]=o._shadowVolume?1:0,i[r++]=t.defaultValue(o._offsetAttribute,-1),i[r++]=o._arcType,t.defined(o._textureCoordinates)?r=g.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,i,r,n.Cartesian2):i[r++]=-1,i[r++]=o.packedLength,i};const nt=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),at=new f.VertexFormat,st={polygonHierarchy:{}};return rt.unpack=function(o,i,r){i=t.defaultValue(i,0);const a=g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,i,e.Cartesian3);i=a.startingIndex,delete a.startingIndex;const s=e.Ellipsoid.unpack(o,i,nt);i+=e.Ellipsoid.packedLength;const l=f.VertexFormat.unpack(o,i,at);i+=f.VertexFormat.packedLength;const u=o[i++],c=o[i++],p=o[i++],y=o[i++],d=1===o[i++],m=1===o[i++],h=1===o[i++],b=1===o[i++],_=1===o[i++],P=o[i++],x=o[i++],C=-1===o[i]?void 0:g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,i,n.Cartesian2);t.defined(C)?(i=C.startingIndex,delete C.startingIndex):i++;const w=o[i++];return t.defined(r)||(r=new rt(st)),r._polygonHierarchy=a,r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(l,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=p,r._stRotation=y,r._perPositionHeightExtrude=d,r._perPositionHeight=m,r._closeTop=h,r._closeBottom=b,r._shadowVolume=_,r._offsetAttribute=-1===P?void 0:P,r._arcType=x,r._textureCoordinates=C,r.packedLength=w,r},rt.computeRectangle=function(i,r){const n=t.defaultValue(i.granularity,m.CesiumMath.RADIANS_PER_DEGREE),a=t.defaultValue(i.arcType,o.ArcType.GEODESIC),s=i.polygonHierarchy,l=t.defaultValue(i.ellipsoid,e.Ellipsoid.WGS84);return $(s.positions,l,a,n,r)},rt.createGeometry=function(e){const o=e._vertexFormat,i=e._ellipsoid,n=e._granularity,s=e._stRotation,f=e._polygonHierarchy,b=e._perPositionHeight,_=e._closeTop,P=e._closeBottom,x=e._arcType,C=e._textureCoordinates,w=t.defined(C);let T=f.positions;if(T.length<3)return;const I=l.EllipsoidTangentPlane.fromPoints(T,i),A=g.PolygonGeometryLibrary.polygonsFromHierarchy(f,w,I.projectPointsOntoPlane.bind(I),!b,i),v=A.hierarchy,E=A.polygons,G=w?g.PolygonGeometryLibrary.polygonsFromHierarchy(C,!0,(function(t){return t}),!1).polygons:void 0;if(0===v.length)return;T=v[0].outerRing;const O=g.PolygonGeometryLibrary.computeBoundingRectangle(I.plane.normal,I.projectPointOntoPlane.bind(I),T,s,V),L=[],H=e._height,D=e._extrudedHeight,N={perPositionHeight:b,vertexFormat:o,geometry:void 0,tangentPlane:I,boundingRectangle:O,ellipsoid:i,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:x};let F;if(e._perPositionHeightExtrude||!m.CesiumMath.equalsEpsilon(H,D,0,m.CesiumMath.EPSILON2))for(N.extrude=!0,N.top=_,N.bottom=P,N.shadowVolume=e._shadowVolume,N.offsetAttribute=e._offsetAttribute,F=0;F<E.length;F++){const t=it(i,E[F],w?G[F]:void 0,n,v[F],b,_,P,o,x);let e;_&&P?(e=t.topAndBottom,N.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,H,D,i,b)):_?(e=t.topAndBottom,e.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(e.geometry.attributes.position.values,H,i,!b),N.geometry=e.geometry):P&&(e=t.topAndBottom,e.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(e.geometry.attributes.position.values,D,i,!0),N.geometry=e.geometry),(_||P)&&(N.wall=!1,e.geometry=q(N),L.push(e));const r=t.walls;N.wall=!0;for(let t=0;t<r.length;t++){const e=r[t];N.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,H,D,i,b),e.geometry=q(N),L.push(e)}}else for(F=0;F<E.length;F++){const r=new c.GeometryInstance({geometry:g.PolygonGeometryLibrary.createGeometryFromPositions(i,E[F],w?G[F]:void 0,n,b,o,x)});if(r.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(r.geometry.attributes.position.values,H,i,!b),N.geometry=r.geometry,r.geometry=q(N),t.defined(e._offsetAttribute)){const t=r.geometry.attributes.position.values.length,o=e._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,i=new Uint8Array(t/3).fill(o);r.geometry.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}L.push(r)}const R=y.GeometryPipeline.combineInstances(L)[0];R.attributes.position.values=new Float64Array(R.attributes.position.values),R.indices=d.IndexDatatype.createTypedArray(R.attributes.position.values.length/3,R.indices);const M=R.attributes,S=r.BoundingSphere.fromVertices(M.position.values);return o.position||delete M.position,new u.Geometry({attributes:M,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:S,offsetAttribute:e._offsetAttribute})},rt.createShadowVolume=function(t,e,o){const i=t._granularity,r=t._ellipsoid,n=e(i,r),a=o(i,r);return new rt({polygonHierarchy:t._polygonHierarchy,ellipsoid:r,stRotation:t._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})},Object.defineProperties(rt.prototype,{rectangle:{get:function(){if(!t.defined(this._rectangle)){const t=this._polygonHierarchy.positions;this._rectangle=$(t,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const o=t._ellipsoid,i=t._polygonHierarchy.positions,r=t.rectangle;return u.Geometry._textureCoordinateRotationPoints(i,e,o,r)}(this)),this._textureCoordinateRotationPoints}}}),function(o,i){return t.defined(i)&&(o=rt.unpack(o,i)),o._ellipsoid=e.Ellipsoid.clone(o._ellipsoid),rt.createGeometry(o)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./ArcType-26a3f38d","./BoundingRectangle-4ef16803","./Transforms-f17097e5","./Matrix2-7a8e9daf","./ComponentDatatype-ab629b88","./EllipsoidGeodesic-20aaff03","./EllipsoidTangentPlane-c3e9d965","./GeometryAttribute-9c1a6bab","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonGeometryLibrary-b67529a6","./PolygonPipeline-3fa47499","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./arrayRemoveDuplicates-0d8dde26","./EllipsoidRhumbLine-1289f7e8","./GeometryAttributes-1e4ddcd2"],(function(t,e,o,i,r,n,a,s,l,u,c,p,y,d,m,g,h,f,b,_,P,x,C,w,T,I,A,v,E){"use strict";const G=new e.Cartographic,O=new e.Cartographic;function L(t,e,o,i){const r=i.cartesianToCartographic(t,G).height,n=i.cartesianToCartographic(e,O);n.height=r,i.cartographicToCartesian(n,e);const a=i.cartesianToCartographic(o,O);a.height=r-100,i.cartographicToCartesian(a,o)}const V=new i.BoundingRectangle,H=new e.Cartesian3,D=new e.Cartesian3,N=new e.Cartesian3,F=new e.Cartesian3,R=new e.Cartesian3,M=new e.Cartesian3;let S=new e.Cartesian3,B=new e.Cartesian3,k=new e.Cartesian3;const z=new n.Cartesian2,W=new n.Cartesian2,Y=new e.Cartesian3,U=new r.Quaternion,j=new e.Matrix3,Q=new e.Matrix3;function q(o){const i=o.vertexFormat,s=o.geometry,l=o.shadowVolume,c=s.attributes.position.values,y=t.defined(s.attributes.st)?s.attributes.st.values:void 0;let d=c.length;const g=o.wall,h=o.top||g,f=o.bottom||g;if(i.st||i.normal||i.tangent||i.bitangent||l){const p=o.boundingRectangle,b=o.tangentPlane,_=o.ellipsoid,P=o.stRotation,x=o.perPositionHeight,C=z;C.x=p.x,C.y=p.y;const w=i.st?new Float32Array(d/3*2):void 0;let T;i.normal&&(T=x&&h&&!g?s.attributes.normal.values:new Float32Array(d));const I=i.tangent?new Float32Array(d):void 0,A=i.bitangent?new Float32Array(d):void 0,v=l?new Float32Array(d):void 0;let E=0,G=0,O=D,V=N,q=F,K=!0,Z=j,J=Q;if(0!==P){let t=r.Quaternion.fromAxisAngle(b._plane.normal,P,U);Z=e.Matrix3.fromQuaternion(t,Z),t=r.Quaternion.fromAxisAngle(b._plane.normal,-P,U),J=e.Matrix3.fromQuaternion(t,J)}else Z=e.Matrix3.clone(e.Matrix3.IDENTITY,Z),J=e.Matrix3.clone(e.Matrix3.IDENTITY,J);let X=0,$=0;h&&f&&(X=d/2,$=d/3,d/=2);for(let r=0;r<d;r+=3){const a=e.Cartesian3.fromArray(c,r,Y);if(i.st&&!t.defined(y)){let t=e.Matrix3.multiplyByVector(Z,a,H);t=_.scaleToGeodeticSurface(t,t);const o=b.projectPointOntoPlane(t,W);n.Cartesian2.subtract(o,C,o);const i=m.CesiumMath.clamp(o.x/p.width,0,1),r=m.CesiumMath.clamp(o.y/p.height,0,1);f&&(w[E+$]=i,w[E+1+$]=r),h&&(w[E]=i,w[E+1]=r),E+=2}if(i.normal||i.tangent||i.bitangent||l){const t=G+1,n=G+2;if(g){if(r+3<d){const t=e.Cartesian3.fromArray(c,r+3,R);if(K){const o=e.Cartesian3.fromArray(c,r+d,M);x&&L(a,t,o,_),e.Cartesian3.subtract(t,a,t),e.Cartesian3.subtract(o,a,o),O=e.Cartesian3.normalize(e.Cartesian3.cross(o,t,O),O),K=!1}e.Cartesian3.equalsEpsilon(t,a,m.CesiumMath.EPSILON10)&&(K=!0)}(i.tangent||i.bitangent)&&(q=_.geodeticSurfaceNormal(a,q),i.tangent&&(V=e.Cartesian3.normalize(e.Cartesian3.cross(q,O,V),V)))}else O=_.geodeticSurfaceNormal(a,O),(i.tangent||i.bitangent)&&(x&&(S=e.Cartesian3.fromArray(T,G,S),B=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,S,B),B=e.Cartesian3.normalize(e.Matrix3.multiplyByVector(J,B,B),B),i.bitangent&&(k=e.Cartesian3.normalize(e.Cartesian3.cross(S,B,k),k))),V=e.Cartesian3.cross(e.Cartesian3.UNIT_Z,O,V),V=e.Cartesian3.normalize(e.Matrix3.multiplyByVector(J,V,V),V),i.bitangent&&(q=e.Cartesian3.normalize(e.Cartesian3.cross(O,V,q),q)));i.normal&&(o.wall?(T[G+X]=O.x,T[t+X]=O.y,T[n+X]=O.z):f&&(T[G+X]=-O.x,T[t+X]=-O.y,T[n+X]=-O.z),(h&&!x||g)&&(T[G]=O.x,T[t]=O.y,T[n]=O.z)),l&&(g&&(O=_.geodeticSurfaceNormal(a,O)),v[G+X]=-O.x,v[t+X]=-O.y,v[n+X]=-O.z),i.tangent&&(o.wall?(I[G+X]=V.x,I[t+X]=V.y,I[n+X]=V.z):f&&(I[G+X]=-V.x,I[t+X]=-V.y,I[n+X]=-V.z),h&&(x?(I[G]=B.x,I[t]=B.y,I[n]=B.z):(I[G]=V.x,I[t]=V.y,I[n]=V.z))),i.bitangent&&(f&&(A[G+X]=q.x,A[t+X]=q.y,A[n+X]=q.z),h&&(x?(A[G]=k.x,A[t]=k.y,A[n]=k.z):(A[G]=q.x,A[t]=q.y,A[n]=q.z))),G+=3}}i.st&&!t.defined(y)&&(s.attributes.st=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:w})),i.normal&&(s.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),i.tangent&&(s.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:I})),i.bitangent&&(s.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})),l&&(s.attributes.extrudeDirection=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v}))}if(o.extrude&&t.defined(o.offsetAttribute)){const t=c.length/3;let e=new Uint8Array(t);if(o.offsetAttribute===p.GeometryOffsetAttribute.TOP)h&&f||g?e=e.fill(1,0,t/2):h&&(e=e.fill(1));else{const t=o.offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;e=e.fill(t)}s.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return s}const K=new e.Cartographic,Z=new e.Cartographic,J={westOverIDL:0,eastOverIDL:0};let X=new s.EllipsoidGeodesic;function $(e,i,r,a,l){if(l=t.defaultValue(l,new n.Rectangle),!t.defined(e)||e.length<3)return l.west=0,l.north=0,l.south=0,l.east=0,l;if(r===o.ArcType.RHUMB)return n.Rectangle.fromCartesianArray(e,i,l);X.ellipsoid.equals(i)||(X=new s.EllipsoidGeodesic(void 0,void 0,i)),l.west=Number.POSITIVE_INFINITY,l.east=Number.NEGATIVE_INFINITY,l.south=Number.POSITIVE_INFINITY,l.north=Number.NEGATIVE_INFINITY,J.westOverIDL=Number.POSITIVE_INFINITY,J.eastOverIDL=Number.NEGATIVE_INFINITY;const u=1/m.CesiumMath.chordLength(a,i.maximumRadius),c=e.length;let p,y=i.cartesianToCartographic(e[0],Z),d=K;for(let t=1;t<c;t++)p=d,d=y,y=i.cartesianToCartographic(e[t],p),X.setEndPoints(d,y),et(X,u,l,J);return p=d,d=y,y=i.cartesianToCartographic(e[0],p),X.setEndPoints(d,y),et(X,u,l,J),l.east-l.west>J.eastOverIDL-J.westOverIDL&&(l.west=J.westOverIDL,l.east=J.eastOverIDL,l.east>m.CesiumMath.PI&&(l.east=l.east-m.CesiumMath.TWO_PI),l.west>m.CesiumMath.PI&&(l.west=l.west-m.CesiumMath.TWO_PI)),l}const tt=new e.Cartographic;function et(t,e,o,i){const r=t.surfaceDistance,n=Math.ceil(r*e),a=n>0?r/(n-1):Number.POSITIVE_INFINITY;let s=0;for(let e=0;e<n;e++){const e=t.interpolateUsingSurfaceDistance(s,tt);s+=a;const r=e.longitude,n=e.latitude;o.west=Math.min(o.west,r),o.east=Math.max(o.east,r),o.south=Math.min(o.south,n),o.north=Math.max(o.north,n);const l=r>=0?r:r+m.CesiumMath.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,l),i.eastOverIDL=Math.max(i.eastOverIDL,l)}}const ot=[];function it(e,o,i,r,n,a,s,u,p,y){const m={walls:[]};let f;if(s||u){const n=g.PolygonGeometryLibrary.createGeometryFromPositions(e,o,i,r,a,p,y),l=n.attributes.position.values,h=n.indices;let b,_;if(s&&u){const e=l.concat(l);b=e.length/3,_=d.IndexDatatype.createTypedArray(b,2*h.length),_.set(h);const o=h.length,r=b/2;for(f=0;f<o;f+=3){const t=_[f]+r,e=_[f+1]+r,i=_[f+2]+r;_[f+o]=i,_[f+1+o]=e,_[f+2+o]=t}if(n.attributes.position.values=e,a&&p.normal){const t=n.attributes.normal.values;n.attributes.normal.values=new Float32Array(e.length),n.attributes.normal.values.set(t)}if(p.st&&t.defined(i)){const t=n.attributes.st.values;n.attributes.st.values=new Float32Array(2*b),n.attributes.st.values=t.concat(t)}n.indices=_}else if(u){for(b=l.length/3,_=d.IndexDatatype.createTypedArray(b,h.length),f=0;f<h.length;f+=3)_[f]=h[f+2],_[f+1]=h[f+1],_[f+2]=h[f];n.indices=_}m.topAndBottom=new c.GeometryInstance({geometry:n})}let b=n.outerRing,_=l.EllipsoidTangentPlane.fromPoints(b,e),P=_.projectPointsOntoPlane(b,ot),x=h.PolygonPipeline.computeWindingOrder2D(P);x===h.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());let C=g.PolygonGeometryLibrary.computeWallGeometry(b,i,e,r,a,y);m.walls.push(new c.GeometryInstance({geometry:C}));const w=n.holes;for(f=0;f<w.length;f++){let t=w[f];_=l.EllipsoidTangentPlane.fromPoints(t,e),P=_.projectPointsOntoPlane(t,ot),x=h.PolygonPipeline.computeWindingOrder2D(P),x===h.WindingOrder.COUNTER_CLOCKWISE&&(t=t.slice().reverse()),C=g.PolygonGeometryLibrary.computeWallGeometry(t,i,e,r,a,y),m.walls.push(new c.GeometryInstance({geometry:C}))}return m}function rt(i){const r=i.polygonHierarchy,a=t.defaultValue(i.vertexFormat,f.VertexFormat.DEFAULT),s=t.defaultValue(i.ellipsoid,e.Ellipsoid.WGS84),l=t.defaultValue(i.granularity,m.CesiumMath.RADIANS_PER_DEGREE),u=t.defaultValue(i.stRotation,0),c=i.textureCoordinates,p=t.defaultValue(i.perPositionHeight,!1),y=p&&t.defined(i.extrudedHeight);let d=t.defaultValue(i.height,0),h=t.defaultValue(i.extrudedHeight,d);if(!y){const t=Math.max(d,h);h=Math.min(d,h),d=t}this._vertexFormat=f.VertexFormat.clone(a),this._ellipsoid=e.Ellipsoid.clone(s),this._granularity=l,this._stRotation=u,this._height=d,this._extrudedHeight=h,this._closeTop=t.defaultValue(i.closeTop,!0),this._closeBottom=t.defaultValue(i.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=p,this._perPositionHeightExtrude=y,this._shadowVolume=t.defaultValue(i.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=i.offsetAttribute,this._arcType=t.defaultValue(i.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=c,this.packedLength=g.PolygonGeometryLibrary.computeHierarchyPackedLength(r,e.Cartesian3)+e.Ellipsoid.packedLength+f.VertexFormat.packedLength+(c?g.PolygonGeometryLibrary.computeHierarchyPackedLength(c,n.Cartesian2):1)+12}rt.fromPositions=function(e){return new rt({polygonHierarchy:{positions:(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates})},rt.pack=function(o,i,r){return r=t.defaultValue(r,0),r=g.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,i,r,e.Cartesian3),e.Ellipsoid.pack(o._ellipsoid,i,r),r+=e.Ellipsoid.packedLength,f.VertexFormat.pack(o._vertexFormat,i,r),r+=f.VertexFormat.packedLength,i[r++]=o._height,i[r++]=o._extrudedHeight,i[r++]=o._granularity,i[r++]=o._stRotation,i[r++]=o._perPositionHeightExtrude?1:0,i[r++]=o._perPositionHeight?1:0,i[r++]=o._closeTop?1:0,i[r++]=o._closeBottom?1:0,i[r++]=o._shadowVolume?1:0,i[r++]=t.defaultValue(o._offsetAttribute,-1),i[r++]=o._arcType,t.defined(o._textureCoordinates)?r=g.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,i,r,n.Cartesian2):i[r++]=-1,i[r++]=o.packedLength,i};const nt=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),at=new f.VertexFormat,st={polygonHierarchy:{}};return rt.unpack=function(o,i,r){i=t.defaultValue(i,0);const a=g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,i,e.Cartesian3);i=a.startingIndex,delete a.startingIndex;const s=e.Ellipsoid.unpack(o,i,nt);i+=e.Ellipsoid.packedLength;const l=f.VertexFormat.unpack(o,i,at);i+=f.VertexFormat.packedLength;const u=o[i++],c=o[i++],p=o[i++],y=o[i++],d=1===o[i++],m=1===o[i++],h=1===o[i++],b=1===o[i++],_=1===o[i++],P=o[i++],x=o[i++],C=-1===o[i]?void 0:g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,i,n.Cartesian2);t.defined(C)?(i=C.startingIndex,delete C.startingIndex):i++;const w=o[i++];return t.defined(r)||(r=new rt(st)),r._polygonHierarchy=a,r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(l,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=p,r._stRotation=y,r._perPositionHeightExtrude=d,r._perPositionHeight=m,r._closeTop=h,r._closeBottom=b,r._shadowVolume=_,r._offsetAttribute=-1===P?void 0:P,r._arcType=x,r._textureCoordinates=C,r.packedLength=w,r},rt.computeRectangle=function(i,r){const n=t.defaultValue(i.granularity,m.CesiumMath.RADIANS_PER_DEGREE),a=t.defaultValue(i.arcType,o.ArcType.GEODESIC),s=i.polygonHierarchy,l=t.defaultValue(i.ellipsoid,e.Ellipsoid.WGS84);return $(s.positions,l,a,n,r)},rt.createGeometry=function(e){const o=e._vertexFormat,i=e._ellipsoid,n=e._granularity,s=e._stRotation,f=e._polygonHierarchy,b=e._perPositionHeight,_=e._closeTop,P=e._closeBottom,x=e._arcType,C=e._textureCoordinates,w=t.defined(C);let T=f.positions;if(T.length<3)return;const I=l.EllipsoidTangentPlane.fromPoints(T,i),A=g.PolygonGeometryLibrary.polygonsFromHierarchy(f,w,I.projectPointsOntoPlane.bind(I),!b,i),v=A.hierarchy,E=A.polygons,G=w?g.PolygonGeometryLibrary.polygonsFromHierarchy(C,!0,(function(t){return t}),!1).polygons:void 0;if(0===v.length)return;T=v[0].outerRing;const O=g.PolygonGeometryLibrary.computeBoundingRectangle(I.plane.normal,I.projectPointOntoPlane.bind(I),T,s,V),L=[],H=e._height,D=e._extrudedHeight,N={perPositionHeight:b,vertexFormat:o,geometry:void 0,tangentPlane:I,boundingRectangle:O,ellipsoid:i,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:x};let F;if(e._perPositionHeightExtrude||!m.CesiumMath.equalsEpsilon(H,D,0,m.CesiumMath.EPSILON2))for(N.extrude=!0,N.top=_,N.bottom=P,N.shadowVolume=e._shadowVolume,N.offsetAttribute=e._offsetAttribute,F=0;F<E.length;F++){const t=it(i,E[F],w?G[F]:void 0,n,v[F],b,_,P,o,x);let e;_&&P?(e=t.topAndBottom,N.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,H,D,i,b)):_?(e=t.topAndBottom,e.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(e.geometry.attributes.position.values,H,i,!b),N.geometry=e.geometry):P&&(e=t.topAndBottom,e.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(e.geometry.attributes.position.values,D,i,!0),N.geometry=e.geometry),(_||P)&&(N.wall=!1,e.geometry=q(N),L.push(e));const r=t.walls;N.wall=!0;for(let t=0;t<r.length;t++){const e=r[t];N.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,H,D,i,b),e.geometry=q(N),L.push(e)}}else for(F=0;F<E.length;F++){const r=new c.GeometryInstance({geometry:g.PolygonGeometryLibrary.createGeometryFromPositions(i,E[F],w?G[F]:void 0,n,b,o,x)});if(r.geometry.attributes.position.values=h.PolygonPipeline.scaleToGeodeticHeight(r.geometry.attributes.position.values,H,i,!b),N.geometry=r.geometry,r.geometry=q(N),t.defined(e._offsetAttribute)){const t=r.geometry.attributes.position.values.length,o=e._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,i=new Uint8Array(t/3).fill(o);r.geometry.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}L.push(r)}const R=y.GeometryPipeline.combineInstances(L)[0];R.attributes.position.values=new Float64Array(R.attributes.position.values),R.indices=d.IndexDatatype.createTypedArray(R.attributes.position.values.length/3,R.indices);const M=R.attributes,S=r.BoundingSphere.fromVertices(M.position.values);return o.position||delete M.position,new u.Geometry({attributes:M,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:S,offsetAttribute:e._offsetAttribute})},rt.createShadowVolume=function(t,e,o){const i=t._granularity,r=t._ellipsoid,n=e(i,r),a=o(i,r);return new rt({polygonHierarchy:t._polygonHierarchy,ellipsoid:r,stRotation:t._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})},Object.defineProperties(rt.prototype,{rectangle:{get:function(){if(!t.defined(this._rectangle)){const t=this._polygonHierarchy.positions;this._rectangle=$(t,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const o=t._ellipsoid,i=t._polygonHierarchy.positions,r=t.rectangle;return u.Geometry._textureCoordinateRotationPoints(i,e,o,r)}(this)),this._textureCoordinateRotationPoints}}}),function(o,i){return t.defined(i)&&(o=rt.unpack(o,i)),o._ellipsoid=e.Ellipsoid.clone(o._ellipsoid),rt.createGeometry(o)}})); diff --git a/public/lib/Cesium/Workers/createPolygonOutlineGeometry.js b/public/lib/Cesium/Workers/createPolygonOutlineGeometry.js index 503f7744..5d54dad8 100644 --- a/public/lib/Cesium/Workers/createPolygonOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createPolygonOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./ArcType-26a3f38d","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./EllipsoidTangentPlane-cf43ca0f","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonGeometryLibrary-f2ea6fbf","./PolygonPipeline-87656bae","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./arrayRemoveDuplicates-9b636830","./EllipsoidRhumbLine-77eff028"],(function(e,t,i,o,r,n,a,s,l,y,u,p,d,c,g,f,h,m,b,P,A,E,_,G,L,T){"use strict";const H=[],v=[];function x(e,t,o,y,u){const d=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let f,h;g.PolygonPipeline.computeWindingOrder2D(d)===g.WindingOrder.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());let m=t.length,b=0;if(y)for(f=new Float64Array(2*m*3),h=0;h<m;h++){const e=t[h],i=t[(h+1)%m];f[b++]=e.x,f[b++]=e.y,f[b++]=e.z,f[b++]=i.x,f[b++]=i.y,f[b++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%m],o);else if(u===i.ArcType.RHUMB)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%m],o);for(f=new Float64Array(3*r),h=0;h<m;h++){let r;u===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%m],o,v):u===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%m],o,v));const n=r.length;for(let e=0;e<n;++e)f[b++]=r[e]}}m=f.length/3;const P=2*m,A=p.IndexDatatype.createTypedArray(m,P);for(b=0,h=0;h<m-1;h++)A[b++]=h,A[b++]=h+1;return A[b++]=m-1,A[b++]=0,new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:A,primitiveType:a.PrimitiveType.LINES})})}function C(e,t,o,y,u){const d=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let f,h;g.PolygonPipeline.computeWindingOrder2D(d)===g.WindingOrder.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());let m=t.length;const b=new Array(m);let P=0;if(y)for(f=new Float64Array(2*m*3*2),h=0;h<m;++h){b[h]=P/3;const e=t[h],i=t[(h+1)%m];f[P++]=e.x,f[P++]=e.y,f[P++]=e.z,f[P++]=i.x,f[P++]=i.y,f[P++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%m],o);else if(u===i.ArcType.RHUMB)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%m],o);for(f=new Float64Array(3*r*2),h=0;h<m;++h){let r;b[h]=P/3,u===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%m],o,v):u===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%m],o,v));const n=r.length;for(let e=0;e<n;++e)f[P++]=r[e]}}m=f.length/6;const A=b.length,E=2*(2*m+A),_=p.IndexDatatype.createTypedArray(m+A,E);for(P=0,h=0;h<m;++h)_[P++]=h,_[P++]=(h+1)%m,_[P++]=h+m,_[P++]=(h+1)%m+m;for(h=0;h<A;h++){const e=b[h];_[P++]=e,_[P++]=e+m}return new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:_,primitiveType:a.PrimitiveType.LINES})})}function O(o){const r=o.polygonHierarchy,n=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),a=e.defaultValue(o.granularity,d.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(o.perPositionHeight,!1),l=s&&e.defined(o.extrudedHeight),y=e.defaultValue(o.arcType,i.ArcType.GEODESIC);let u=e.defaultValue(o.height,0),p=e.defaultValue(o.extrudedHeight,u);if(!l){const e=Math.max(u,p);p=Math.min(u,p),u=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=a,this._height=u,this._extrudedHeight=p,this._arcType=y,this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._offsetAttribute=o.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=c.PolygonGeometryLibrary.computeHierarchyPackedLength(r,t.Cartesian3)+t.Ellipsoid.packedLength+8}O.pack=function(i,o,r){return r=e.defaultValue(r,0),r=c.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,o,r,t.Cartesian3),t.Ellipsoid.pack(i._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=i._height,o[r++]=i._extrudedHeight,o[r++]=i._granularity,o[r++]=i._perPositionHeightExtrude?1:0,o[r++]=i._perPositionHeight?1:0,o[r++]=i._arcType,o[r++]=e.defaultValue(i._offsetAttribute,-1),o[r]=i.packedLength,o};const D=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),I={polygonHierarchy:{}};return O.unpack=function(i,o,r){o=e.defaultValue(o,0);const n=c.PolygonGeometryLibrary.unpackPolygonHierarchy(i,o,t.Cartesian3);o=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(i,o,D);o+=t.Ellipsoid.packedLength;const s=i[o++],l=i[o++],y=i[o++],u=1===i[o++],p=1===i[o++],d=i[o++],g=i[o++],f=i[o];return e.defined(r)||(r=new O(I)),r._polygonHierarchy=n,r._ellipsoid=t.Ellipsoid.clone(a,r._ellipsoid),r._height=s,r._extrudedHeight=l,r._granularity=y,r._perPositionHeight=p,r._perPositionHeightExtrude=u,r._arcType=d,r._offsetAttribute=-1===g?void 0:g,r.packedLength=f,r},O.fromPositions=function(t){return new O({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute})},O.createGeometry=function(t){const i=t._ellipsoid,n=t._granularity,s=t._polygonHierarchy,l=t._perPositionHeight,p=t._arcType,f=c.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(s,!l,i);if(0===f.length)return;let h;const m=[],b=d.CesiumMath.chordLength(n,i.maximumRadius),P=t._height,A=t._extrudedHeight;let E,_;if(t._perPositionHeightExtrude||!d.CesiumMath.equalsEpsilon(P,A,0,d.CesiumMath.EPSILON2))for(_=0;_<f.length;_++){if(h=C(i,f[_],b,l,p),h.geometry=c.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(h.geometry,P,A,i,l),e.defined(t._offsetAttribute)){const e=h.geometry.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===y.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(E=t._offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1,i=i.fill(E)),h.geometry.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(h)}else for(_=0;_<f.length;_++){if(h=x(i,f[_],b,l,p),h.geometry.attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(h.geometry.attributes.position.values,P,i,!l),e.defined(t._offsetAttribute)){const e=h.geometry.attributes.position.values.length;E=t._offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(E);h.geometry.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(h)}const G=u.GeometryPipeline.combineInstances(m)[0],L=o.BoundingSphere.fromVertices(G.attributes.position.values);return new a.Geometry({attributes:G.attributes,indices:G.indices,primitiveType:G.primitiveType,boundingSphere:L,offsetAttribute:t._offsetAttribute})},function(i,o){return e.defined(o)&&(i=O.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),O.createGeometry(i)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./ArcType-26a3f38d","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./EllipsoidTangentPlane-c3e9d965","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonGeometryLibrary-b67529a6","./PolygonPipeline-3fa47499","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./arrayRemoveDuplicates-0d8dde26","./EllipsoidRhumbLine-1289f7e8"],(function(e,t,i,o,r,n,a,s,l,y,u,p,d,c,g,f,h,m,b,P,A,E,_,G,L,T){"use strict";const H=[],v=[];function x(e,t,o,y,u){const d=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let f,h;g.PolygonPipeline.computeWindingOrder2D(d)===g.WindingOrder.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());let m=t.length,b=0;if(y)for(f=new Float64Array(2*m*3),h=0;h<m;h++){const e=t[h],i=t[(h+1)%m];f[b++]=e.x,f[b++]=e.y,f[b++]=e.z,f[b++]=i.x,f[b++]=i.y,f[b++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%m],o);else if(u===i.ArcType.RHUMB)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%m],o);for(f=new Float64Array(3*r),h=0;h<m;h++){let r;u===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%m],o,v):u===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%m],o,v));const n=r.length;for(let e=0;e<n;++e)f[b++]=r[e]}}m=f.length/3;const P=2*m,A=p.IndexDatatype.createTypedArray(m,P);for(b=0,h=0;h<m-1;h++)A[b++]=h,A[b++]=h+1;return A[b++]=m-1,A[b++]=0,new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:A,primitiveType:a.PrimitiveType.LINES})})}function C(e,t,o,y,u){const d=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let f,h;g.PolygonPipeline.computeWindingOrder2D(d)===g.WindingOrder.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());let m=t.length;const b=new Array(m);let P=0;if(y)for(f=new Float64Array(2*m*3*2),h=0;h<m;++h){b[h]=P/3;const e=t[h],i=t[(h+1)%m];f[P++]=e.x,f[P++]=e.y,f[P++]=e.z,f[P++]=i.x,f[P++]=i.y,f[P++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%m],o);else if(u===i.ArcType.RHUMB)for(h=0;h<m;h++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%m],o);for(f=new Float64Array(3*r*2),h=0;h<m;++h){let r;b[h]=P/3,u===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%m],o,v):u===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%m],o,v));const n=r.length;for(let e=0;e<n;++e)f[P++]=r[e]}}m=f.length/6;const A=b.length,E=2*(2*m+A),_=p.IndexDatatype.createTypedArray(m+A,E);for(P=0,h=0;h<m;++h)_[P++]=h,_[P++]=(h+1)%m,_[P++]=h+m,_[P++]=(h+1)%m+m;for(h=0;h<A;h++){const e=b[h];_[P++]=e,_[P++]=e+m}return new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:_,primitiveType:a.PrimitiveType.LINES})})}function O(o){const r=o.polygonHierarchy,n=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),a=e.defaultValue(o.granularity,d.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(o.perPositionHeight,!1),l=s&&e.defined(o.extrudedHeight),y=e.defaultValue(o.arcType,i.ArcType.GEODESIC);let u=e.defaultValue(o.height,0),p=e.defaultValue(o.extrudedHeight,u);if(!l){const e=Math.max(u,p);p=Math.min(u,p),u=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=a,this._height=u,this._extrudedHeight=p,this._arcType=y,this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._offsetAttribute=o.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=c.PolygonGeometryLibrary.computeHierarchyPackedLength(r,t.Cartesian3)+t.Ellipsoid.packedLength+8}O.pack=function(i,o,r){return r=e.defaultValue(r,0),r=c.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,o,r,t.Cartesian3),t.Ellipsoid.pack(i._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=i._height,o[r++]=i._extrudedHeight,o[r++]=i._granularity,o[r++]=i._perPositionHeightExtrude?1:0,o[r++]=i._perPositionHeight?1:0,o[r++]=i._arcType,o[r++]=e.defaultValue(i._offsetAttribute,-1),o[r]=i.packedLength,o};const D=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),I={polygonHierarchy:{}};return O.unpack=function(i,o,r){o=e.defaultValue(o,0);const n=c.PolygonGeometryLibrary.unpackPolygonHierarchy(i,o,t.Cartesian3);o=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(i,o,D);o+=t.Ellipsoid.packedLength;const s=i[o++],l=i[o++],y=i[o++],u=1===i[o++],p=1===i[o++],d=i[o++],g=i[o++],f=i[o];return e.defined(r)||(r=new O(I)),r._polygonHierarchy=n,r._ellipsoid=t.Ellipsoid.clone(a,r._ellipsoid),r._height=s,r._extrudedHeight=l,r._granularity=y,r._perPositionHeight=p,r._perPositionHeightExtrude=u,r._arcType=d,r._offsetAttribute=-1===g?void 0:g,r.packedLength=f,r},O.fromPositions=function(t){return new O({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute})},O.createGeometry=function(t){const i=t._ellipsoid,n=t._granularity,s=t._polygonHierarchy,l=t._perPositionHeight,p=t._arcType,f=c.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(s,!l,i);if(0===f.length)return;let h;const m=[],b=d.CesiumMath.chordLength(n,i.maximumRadius),P=t._height,A=t._extrudedHeight;let E,_;if(t._perPositionHeightExtrude||!d.CesiumMath.equalsEpsilon(P,A,0,d.CesiumMath.EPSILON2))for(_=0;_<f.length;_++){if(h=C(i,f[_],b,l,p),h.geometry=c.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(h.geometry,P,A,i,l),e.defined(t._offsetAttribute)){const e=h.geometry.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===y.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(E=t._offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1,i=i.fill(E)),h.geometry.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(h)}else for(_=0;_<f.length;_++){if(h=x(i,f[_],b,l,p),h.geometry.attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(h.geometry.attributes.position.values,P,i,!l),e.defined(t._offsetAttribute)){const e=h.geometry.attributes.position.values.length;E=t._offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(E);h.geometry.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(h)}const G=u.GeometryPipeline.combineInstances(m)[0],L=o.BoundingSphere.fromVertices(G.attributes.position.values);return new a.Geometry({attributes:G.attributes,indices:G.indices,primitiveType:G.primitiveType,boundingSphere:L,offsetAttribute:t._offsetAttribute})},function(i,o){return e.defined(o)&&(i=O.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),O.createGeometry(i)}})); diff --git a/public/lib/Cesium/Workers/createPolylineGeometry.js b/public/lib/Cesium/Workers/createPolylineGeometry.js index 2726004d..8b05cdd1 100644 --- a/public/lib/Cesium/Workers/createPolylineGeometry.js +++ b/public/lib/Cesium/Workers/createPolylineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./ArcType-26a3f38d","./arrayRemoveDuplicates-9b636830","./Transforms-b3716b06","./Color-9ff9e611","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolylinePipeline-bcbea07f","./VertexFormat-fbdec922","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,o,r,n,a,i,l,s,c,p,d,u,y,m,h,f,C,g,_,A){"use strict";const E=[];function P(e,t,o,r,n){const i=E;let l;i.length=n;const s=o.red,c=o.green,p=o.blue,d=o.alpha,u=r.red,y=r.green,m=r.blue,h=r.alpha;if(a.Color.equals(o,r)){for(l=0;l<n;l++)i[l]=a.Color.clone(o);return i}const f=(u-s)/n,C=(y-c)/n,g=(m-p)/n,_=(h-d)/n;for(l=0;l<n;l++)i[l]=new a.Color(s+l*f,c+l*C,p+l*g,d+l*_);return i}function x(r){const n=(r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT)).positions,i=r.colors,l=e.defaultValue(r.width,1),s=e.defaultValue(r.colorsPerVertex,!1);this._positions=n,this._colors=i,this._width=l,this._colorsPerVertex=s,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(r.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";let c=1+n.length*t.Cartesian3.packedLength;c+=e.defined(i)?1+i.length*a.Color.packedLength:1,this.packedLength=c+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}x.pack=function(o,r,n){let i;n=e.defaultValue(n,0);const l=o._positions;let s=l.length;for(r[n++]=s,i=0;i<s;++i,n+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[i],r,n);const c=o._colors;for(s=e.defined(c)?c.length:0,r[n++]=s,i=0;i<s;++i,n+=a.Color.packedLength)a.Color.pack(c[i],r,n);return t.Ellipsoid.pack(o._ellipsoid,r,n),n+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,r,n),n+=u.VertexFormat.packedLength,r[n++]=o._width,r[n++]=o._colorsPerVertex?1:0,r[n++]=o._arcType,r[n]=o._granularity,r};const w=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),T=new u.VertexFormat,b={positions:void 0,colors:void 0,ellipsoid:w,vertexFormat:T,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};x.unpack=function(o,r,n){let i;r=e.defaultValue(r,0);let l=o[r++];const s=new Array(l);for(i=0;i<l;++i,r+=t.Cartesian3.packedLength)s[i]=t.Cartesian3.unpack(o,r);l=o[r++];const c=l>0?new Array(l):void 0;for(i=0;i<l;++i,r+=a.Color.packedLength)c[i]=a.Color.unpack(o,r);const p=t.Ellipsoid.unpack(o,r,w);r+=t.Ellipsoid.packedLength;const d=u.VertexFormat.unpack(o,r,T);r+=u.VertexFormat.packedLength;const y=o[r++],m=1===o[r++],h=o[r++],f=o[r];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=t.Ellipsoid.clone(p,n._ellipsoid),n._vertexFormat=u.VertexFormat.clone(d,n._vertexFormat),n._width=y,n._colorsPerVertex=m,n._arcType=h,n._granularity=f,n):(b.positions=s,b.colors=c,b.width=y,b.colorsPerVertex=m,b.arcType=h,b.granularity=f,new x(b))};const D=new t.Cartesian3,k=new t.Cartesian3,V=new t.Cartesian3,v=new t.Cartesian3;return x.createGeometry=function(u){const y=u._width,m=u._vertexFormat;let h=u._colors;const f=u._colorsPerVertex,C=u._arcType,g=u._granularity,_=u._ellipsoid;let A,x,w;const T=[];let b=r.arrayRemoveDuplicates(u._positions,t.Cartesian3.equalsEpsilon,!1,T);if(e.defined(h)&&T.length>0){let e=0,t=T[0];h=h.filter((function(o,r){let n=!1;return n=f?r===t||0===r&&1===t:r+1===t,!n||(e++,t=T[e],!1)}))}let L=b.length;if(L<2||y<=0)return;if(C===o.ArcType.GEODESIC||C===o.ArcType.RHUMB){let t,r;C===o.ArcType.GEODESIC?(t=p.CesiumMath.chordLength(g,_.maximumRadius),r=d.PolylinePipeline.numberOfPoints):(t=g,r=d.PolylinePipeline.numberOfPointsRhumbLine);const n=d.PolylinePipeline.extractHeights(b,_);if(e.defined(h)){let e=1;for(A=0;A<L-1;++A)e+=r(b[A],b[A+1],t);const o=new Array(e);let n=0;for(A=0;A<L-1;++A){const i=b[A],l=b[A+1],s=h[A],c=r(i,l,t);if(f&&A<e){const e=P(0,0,s,h[A+1],c),t=e.length;for(x=0;x<t;++x)o[n++]=e[x]}else for(x=0;x<c;++x)o[n++]=a.Color.clone(s)}o[n]=a.Color.clone(h[h.length-1]),h=o,E.length=0}b=C===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:b,minDistance:t,ellipsoid:_,height:n}):d.PolylinePipeline.generateCartesianRhumbArc({positions:b,granularity:t,ellipsoid:_,height:n})}L=b.length;const F=4*L-4,G=new Float64Array(3*F),O=new Float64Array(3*F),R=new Float64Array(3*F),I=new Float32Array(2*F),S=m.st?new Float32Array(2*F):void 0,B=e.defined(h)?new Uint8Array(4*F):void 0;let M,U=0,N=0,H=0,W=0;for(x=0;x<L;++x){let o,r;0===x?(M=D,t.Cartesian3.subtract(b[0],b[1],M),t.Cartesian3.add(b[0],M,M)):M=b[x-1],t.Cartesian3.clone(M,V),t.Cartesian3.clone(b[x],k),x===L-1?(M=D,t.Cartesian3.subtract(b[L-1],b[L-2],M),t.Cartesian3.add(b[L-1],M,M)):M=b[x+1],t.Cartesian3.clone(M,v),e.defined(B)&&(o=0===x||f?h[x]:h[x-1],x!==L-1&&(r=h[x]));const n=x===L-1?2:4;for(w=0===x?2:0;w<n;++w){t.Cartesian3.pack(k,G,U),t.Cartesian3.pack(V,O,U),t.Cartesian3.pack(v,R,U),U+=3;const n=w-2<0?-1:1;if(I[N++]=w%2*2-1,I[N++]=n*y,m.st&&(S[H++]=x/(L-1),S[H++]=Math.max(I[N-2],0)),e.defined(B)){const e=w<2?o:r;B[W++]=a.Color.floatToByte(e.red),B[W++]=a.Color.floatToByte(e.green),B[W++]=a.Color.floatToByte(e.blue),B[W++]=a.Color.floatToByte(e.alpha)}}}const Y=new s.GeometryAttributes;Y.position=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),Y.prevPosition=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),Y.nextPosition=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:R}),Y.expandAndWidth=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I}),m.st&&(Y.st=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:S})),e.defined(B)&&(Y.color=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:B,normalize:!0}));const q=c.IndexDatatype.createTypedArray(F,6*L-6);let z=0,J=0;const K=L-1;for(x=0;x<K;++x)q[J++]=z,q[J++]=z+2,q[J++]=z+1,q[J++]=z+1,q[J++]=z+2,q[J++]=z+3,z+=4;return new l.Geometry({attributes:Y,indices:q,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:n.BoundingSphere.fromPoints(b),geometryType:l.GeometryType.POLYLINES})},function(o,r){return e.defined(r)&&(o=x.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),x.createGeometry(o)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./ArcType-26a3f38d","./arrayRemoveDuplicates-0d8dde26","./Transforms-f17097e5","./Color-d89a2fad","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolylinePipeline-8df321dd","./VertexFormat-fbdec922","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,o,r,n,a,i,l,s,c,p,d,u,y,m,h,f,C,g,_,A){"use strict";const E=[];function P(e,t,o,r,n){const i=E;let l;i.length=n;const s=o.red,c=o.green,p=o.blue,d=o.alpha,u=r.red,y=r.green,m=r.blue,h=r.alpha;if(a.Color.equals(o,r)){for(l=0;l<n;l++)i[l]=a.Color.clone(o);return i}const f=(u-s)/n,C=(y-c)/n,g=(m-p)/n,_=(h-d)/n;for(l=0;l<n;l++)i[l]=new a.Color(s+l*f,c+l*C,p+l*g,d+l*_);return i}function x(r){const n=(r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT)).positions,i=r.colors,l=e.defaultValue(r.width,1),s=e.defaultValue(r.colorsPerVertex,!1);this._positions=n,this._colors=i,this._width=l,this._colorsPerVertex=s,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(r.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";let c=1+n.length*t.Cartesian3.packedLength;c+=e.defined(i)?1+i.length*a.Color.packedLength:1,this.packedLength=c+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}x.pack=function(o,r,n){let i;n=e.defaultValue(n,0);const l=o._positions;let s=l.length;for(r[n++]=s,i=0;i<s;++i,n+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[i],r,n);const c=o._colors;for(s=e.defined(c)?c.length:0,r[n++]=s,i=0;i<s;++i,n+=a.Color.packedLength)a.Color.pack(c[i],r,n);return t.Ellipsoid.pack(o._ellipsoid,r,n),n+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,r,n),n+=u.VertexFormat.packedLength,r[n++]=o._width,r[n++]=o._colorsPerVertex?1:0,r[n++]=o._arcType,r[n]=o._granularity,r};const w=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),T=new u.VertexFormat,b={positions:void 0,colors:void 0,ellipsoid:w,vertexFormat:T,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};x.unpack=function(o,r,n){let i;r=e.defaultValue(r,0);let l=o[r++];const s=new Array(l);for(i=0;i<l;++i,r+=t.Cartesian3.packedLength)s[i]=t.Cartesian3.unpack(o,r);l=o[r++];const c=l>0?new Array(l):void 0;for(i=0;i<l;++i,r+=a.Color.packedLength)c[i]=a.Color.unpack(o,r);const p=t.Ellipsoid.unpack(o,r,w);r+=t.Ellipsoid.packedLength;const d=u.VertexFormat.unpack(o,r,T);r+=u.VertexFormat.packedLength;const y=o[r++],m=1===o[r++],h=o[r++],f=o[r];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=t.Ellipsoid.clone(p,n._ellipsoid),n._vertexFormat=u.VertexFormat.clone(d,n._vertexFormat),n._width=y,n._colorsPerVertex=m,n._arcType=h,n._granularity=f,n):(b.positions=s,b.colors=c,b.width=y,b.colorsPerVertex=m,b.arcType=h,b.granularity=f,new x(b))};const D=new t.Cartesian3,k=new t.Cartesian3,V=new t.Cartesian3,v=new t.Cartesian3;return x.createGeometry=function(u){const y=u._width,m=u._vertexFormat;let h=u._colors;const f=u._colorsPerVertex,C=u._arcType,g=u._granularity,_=u._ellipsoid;let A,x,w;const T=[];let b=r.arrayRemoveDuplicates(u._positions,t.Cartesian3.equalsEpsilon,!1,T);if(e.defined(h)&&T.length>0){let e=0,t=T[0];h=h.filter((function(o,r){let n=!1;return n=f?r===t||0===r&&1===t:r+1===t,!n||(e++,t=T[e],!1)}))}let L=b.length;if(L<2||y<=0)return;if(C===o.ArcType.GEODESIC||C===o.ArcType.RHUMB){let t,r;C===o.ArcType.GEODESIC?(t=p.CesiumMath.chordLength(g,_.maximumRadius),r=d.PolylinePipeline.numberOfPoints):(t=g,r=d.PolylinePipeline.numberOfPointsRhumbLine);const n=d.PolylinePipeline.extractHeights(b,_);if(e.defined(h)){let e=1;for(A=0;A<L-1;++A)e+=r(b[A],b[A+1],t);const o=new Array(e);let n=0;for(A=0;A<L-1;++A){const i=b[A],l=b[A+1],s=h[A],c=r(i,l,t);if(f&&A<e){const e=P(0,0,s,h[A+1],c),t=e.length;for(x=0;x<t;++x)o[n++]=e[x]}else for(x=0;x<c;++x)o[n++]=a.Color.clone(s)}o[n]=a.Color.clone(h[h.length-1]),h=o,E.length=0}b=C===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:b,minDistance:t,ellipsoid:_,height:n}):d.PolylinePipeline.generateCartesianRhumbArc({positions:b,granularity:t,ellipsoid:_,height:n})}L=b.length;const F=4*L-4,G=new Float64Array(3*F),O=new Float64Array(3*F),R=new Float64Array(3*F),I=new Float32Array(2*F),S=m.st?new Float32Array(2*F):void 0,B=e.defined(h)?new Uint8Array(4*F):void 0;let M,U=0,N=0,H=0,W=0;for(x=0;x<L;++x){let o,r;0===x?(M=D,t.Cartesian3.subtract(b[0],b[1],M),t.Cartesian3.add(b[0],M,M)):M=b[x-1],t.Cartesian3.clone(M,V),t.Cartesian3.clone(b[x],k),x===L-1?(M=D,t.Cartesian3.subtract(b[L-1],b[L-2],M),t.Cartesian3.add(b[L-1],M,M)):M=b[x+1],t.Cartesian3.clone(M,v),e.defined(B)&&(o=0===x||f?h[x]:h[x-1],x!==L-1&&(r=h[x]));const n=x===L-1?2:4;for(w=0===x?2:0;w<n;++w){t.Cartesian3.pack(k,G,U),t.Cartesian3.pack(V,O,U),t.Cartesian3.pack(v,R,U),U+=3;const n=w-2<0?-1:1;if(I[N++]=w%2*2-1,I[N++]=n*y,m.st&&(S[H++]=x/(L-1),S[H++]=Math.max(I[N-2],0)),e.defined(B)){const e=w<2?o:r;B[W++]=a.Color.floatToByte(e.red),B[W++]=a.Color.floatToByte(e.green),B[W++]=a.Color.floatToByte(e.blue),B[W++]=a.Color.floatToByte(e.alpha)}}}const Y=new s.GeometryAttributes;Y.position=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),Y.prevPosition=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),Y.nextPosition=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:R}),Y.expandAndWidth=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I}),m.st&&(Y.st=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:S})),e.defined(B)&&(Y.color=new l.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:B,normalize:!0}));const q=c.IndexDatatype.createTypedArray(F,6*L-6);let z=0,J=0;const K=L-1;for(x=0;x<K;++x)q[J++]=z,q[J++]=z+2,q[J++]=z+1,q[J++]=z+1,q[J++]=z+2,q[J++]=z+3,z+=4;return new l.Geometry({attributes:Y,indices:q,primitiveType:l.PrimitiveType.TRIANGLES,boundingSphere:n.BoundingSphere.fromPoints(b),geometryType:l.GeometryType.POLYLINES})},function(o,r){return e.defined(r)&&(o=x.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),x.createGeometry(o)}})); diff --git a/public/lib/Cesium/Workers/createPolylineVolumeGeometry.js b/public/lib/Cesium/Workers/createPolylineVolumeGeometry.js index d1a56fca..17e72aca 100644 --- a/public/lib/Cesium/Workers/createPolylineVolumeGeometry.js +++ b/public/lib/Cesium/Workers/createPolylineVolumeGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./arrayRemoveDuplicates-9b636830","./BoundingRectangle-9216d683","./Transforms-b3716b06","./Matrix2-413c4048","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-01e8948c","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab"],(function(e,t,n,o,i,r,a,l,s,p,c,u,d,m,y,g,h,f,E,P,_,b,k,v,x,V,L){"use strict";function A(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._vertexFormat=y.VertexFormat.clone(e.defaultValue(n.vertexFormat,y.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,d.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let a=1+o.length*t.Cartesian3.packedLength;a+=1+i.length*r.Cartesian2.packedLength,this.packedLength=a+t.Ellipsoid.packedLength+y.VertexFormat.packedLength+2}A.pack=function(n,o,i){let a;i=e.defaultValue(i,0);const l=n._positions;let s=l.length;for(o[i++]=s,a=0;a<s;++a,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],o,i);const p=n._shape;for(s=p.length,o[i++]=s,a=0;a<s;++a,i+=r.Cartesian2.packedLength)r.Cartesian2.pack(p[a],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,y.VertexFormat.pack(n._vertexFormat,o,i),i+=y.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),F=new y.VertexFormat,T={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,vertexFormat:F,cornerType:void 0,granularity:void 0};A.unpack=function(n,o,i){let a;o=e.defaultValue(o,0);let l=n[o++];const s=new Array(l);for(a=0;a<l;++a,o+=t.Cartesian3.packedLength)s[a]=t.Cartesian3.unpack(n,o);l=n[o++];const p=new Array(l);for(a=0;a<l;++a,o+=r.Cartesian2.packedLength)p[a]=r.Cartesian2.unpack(n,o);const c=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;const u=y.VertexFormat.unpack(n,o,F);o+=y.VertexFormat.packedLength;const d=n[o++],m=n[o];return e.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=y.VertexFormat.clone(u,i._vertexFormat),i._cornerType=d,i._granularity=m,i):(T.polylinePositions=s,T.shapePositions=p,T.cornerType=d,T.granularity=m,new A(T))};const G=new o.BoundingRectangle;return A.createGeometry=function(e){const r=e._positions,d=n.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),d.length<2||y.length<3)return;m.PolygonPipeline.computeWindingOrder2D(y)===m.WindingOrder.CLOCKWISE&&y.reverse();const g=o.BoundingRectangle.fromPoints(y,G);return function(e,t,n,o){const r=new p.GeometryAttributes;o.position&&(r.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const d=t.length,y=e.length/3,g=(y-2*d)/(2*d),h=m.PolygonPipeline.triangulate(t),f=(g-1)*d*6+2*h.length,E=u.IndexDatatype.createTypedArray(y,f);let P,_,b,k,v,x;const V=2*d;let L=0;for(P=0;P<g-1;P++){for(_=0;_<d-1;_++)b=2*_+P*d*2,x=b+V,k=b+1,v=k+V,E[L++]=k,E[L++]=b,E[L++]=v,E[L++]=v,E[L++]=b,E[L++]=x;b=2*d-2+P*d*2,k=b+1,v=k+V,x=b+V,E[L++]=k,E[L++]=b,E[L++]=v,E[L++]=v,E[L++]=b,E[L++]=x}if(o.st||o.tangent||o.bitangent){const e=new Float32Array(2*y),o=1/(g-1),i=1/n.height,l=n.height/2;let p,c,u=0;for(P=0;P<g;P++){for(p=P*o,c=i*(t[0].y+l),e[u++]=p,e[u++]=c,_=1;_<d;_++)c=i*(t[_].y+l),e[u++]=p,e[u++]=c,e[u++]=p,e[u++]=c;c=i*(t[0].y+l),e[u++]=p,e[u++]=c}for(_=0;_<d;_++)p=0,c=i*(t[_].y+l),e[u++]=p,e[u++]=c;for(_=0;_<d;_++)p=(g-1)*o,c=i*(t[_].y+l),e[u++]=p,e[u++]=c;r.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const A=y-2*d;for(P=0;P<h.length;P+=3){const e=h[P]+A,t=h[P+1]+A,n=h[P+2]+A;E[L++]=e,E[L++]=t,E[L++]=n,E[L++]=n+d,E[L++]=t+d,E[L++]=e+d}let C=new s.Geometry({attributes:r,indices:E,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(C=c.GeometryPipeline.computeNormal(C)),o.tangent||o.bitangent){try{C=c.GeometryPipeline.computeTangentAndBitangent(C)}catch(e){l.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(C.attributes.tangent=void 0),o.bitangent||(C.attributes.bitangent=void 0),o.st||(C.attributes.st=void 0)}return C}(l.PolylineVolumeGeometryLibrary.computePositions(d,y,g,e,!0),y,g,e._vertexFormat)},function(n,o){return e.defined(o)&&(n=A.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),A.createGeometry(n)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./arrayRemoveDuplicates-0d8dde26","./BoundingRectangle-4ef16803","./Transforms-f17097e5","./Matrix2-7a8e9daf","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-5050cb1d","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./VertexFormat-fbdec922","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c"],(function(e,t,n,o,i,r,a,l,s,p,c,u,d,m,y,g,h,f,E,P,_,b,k,v,x,V,L){"use strict";function A(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._vertexFormat=y.VertexFormat.clone(e.defaultValue(n.vertexFormat,y.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,d.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let a=1+o.length*t.Cartesian3.packedLength;a+=1+i.length*r.Cartesian2.packedLength,this.packedLength=a+t.Ellipsoid.packedLength+y.VertexFormat.packedLength+2}A.pack=function(n,o,i){let a;i=e.defaultValue(i,0);const l=n._positions;let s=l.length;for(o[i++]=s,a=0;a<s;++a,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],o,i);const p=n._shape;for(s=p.length,o[i++]=s,a=0;a<s;++a,i+=r.Cartesian2.packedLength)r.Cartesian2.pack(p[a],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,y.VertexFormat.pack(n._vertexFormat,o,i),i+=y.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),F=new y.VertexFormat,T={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,vertexFormat:F,cornerType:void 0,granularity:void 0};A.unpack=function(n,o,i){let a;o=e.defaultValue(o,0);let l=n[o++];const s=new Array(l);for(a=0;a<l;++a,o+=t.Cartesian3.packedLength)s[a]=t.Cartesian3.unpack(n,o);l=n[o++];const p=new Array(l);for(a=0;a<l;++a,o+=r.Cartesian2.packedLength)p[a]=r.Cartesian2.unpack(n,o);const c=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;const u=y.VertexFormat.unpack(n,o,F);o+=y.VertexFormat.packedLength;const d=n[o++],m=n[o];return e.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=y.VertexFormat.clone(u,i._vertexFormat),i._cornerType=d,i._granularity=m,i):(T.polylinePositions=s,T.shapePositions=p,T.cornerType=d,T.granularity=m,new A(T))};const G=new o.BoundingRectangle;return A.createGeometry=function(e){const r=e._positions,d=n.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),d.length<2||y.length<3)return;m.PolygonPipeline.computeWindingOrder2D(y)===m.WindingOrder.CLOCKWISE&&y.reverse();const g=o.BoundingRectangle.fromPoints(y,G);return function(e,t,n,o){const r=new p.GeometryAttributes;o.position&&(r.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const d=t.length,y=e.length/3,g=(y-2*d)/(2*d),h=m.PolygonPipeline.triangulate(t),f=(g-1)*d*6+2*h.length,E=u.IndexDatatype.createTypedArray(y,f);let P,_,b,k,v,x;const V=2*d;let L=0;for(P=0;P<g-1;P++){for(_=0;_<d-1;_++)b=2*_+P*d*2,x=b+V,k=b+1,v=k+V,E[L++]=k,E[L++]=b,E[L++]=v,E[L++]=v,E[L++]=b,E[L++]=x;b=2*d-2+P*d*2,k=b+1,v=k+V,x=b+V,E[L++]=k,E[L++]=b,E[L++]=v,E[L++]=v,E[L++]=b,E[L++]=x}if(o.st||o.tangent||o.bitangent){const e=new Float32Array(2*y),o=1/(g-1),i=1/n.height,l=n.height/2;let p,c,u=0;for(P=0;P<g;P++){for(p=P*o,c=i*(t[0].y+l),e[u++]=p,e[u++]=c,_=1;_<d;_++)c=i*(t[_].y+l),e[u++]=p,e[u++]=c,e[u++]=p,e[u++]=c;c=i*(t[0].y+l),e[u++]=p,e[u++]=c}for(_=0;_<d;_++)p=0,c=i*(t[_].y+l),e[u++]=p,e[u++]=c;for(_=0;_<d;_++)p=(g-1)*o,c=i*(t[_].y+l),e[u++]=p,e[u++]=c;r.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const A=y-2*d;for(P=0;P<h.length;P+=3){const e=h[P]+A,t=h[P+1]+A,n=h[P+2]+A;E[L++]=e,E[L++]=t,E[L++]=n,E[L++]=n+d,E[L++]=t+d,E[L++]=e+d}let C=new s.Geometry({attributes:r,indices:E,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(C=c.GeometryPipeline.computeNormal(C)),o.tangent||o.bitangent){try{C=c.GeometryPipeline.computeTangentAndBitangent(C)}catch(e){l.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(C.attributes.tangent=void 0),o.bitangent||(C.attributes.bitangent=void 0),o.st||(C.attributes.st=void 0)}return C}(l.PolylineVolumeGeometryLibrary.computePositions(d,y,g,e,!0),y,g,e._vertexFormat)},function(n,o){return e.defined(o)&&(n=A.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),A.createGeometry(n)}})); diff --git a/public/lib/Cesium/Workers/createPolylineVolumeOutlineGeometry.js b/public/lib/Cesium/Workers/createPolylineVolumeOutlineGeometry.js index 6358cb6e..bd35d57a 100644 --- a/public/lib/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createPolylineVolumeOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./arrayRemoveDuplicates-9b636830","./BoundingRectangle-9216d683","./Transforms-b3716b06","./Matrix2-413c4048","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-01e8948c","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028"],(function(e,t,i,n,o,r,a,l,s,p,c,u,d,y,g,h,m,f,E,P,_,k,C){"use strict";function L(i){const n=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).polylinePositions,o=i.shapePositions;this._positions=n,this._shape=o,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(i.cornerType,l.CornerType.ROUNDED),this._granularity=e.defaultValue(i.granularity,u.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let a=1+n.length*t.Cartesian3.packedLength;a+=1+o.length*r.Cartesian2.packedLength,this.packedLength=a+t.Ellipsoid.packedLength+2}L.pack=function(i,n,o){let a;o=e.defaultValue(o,0);const l=i._positions;let s=l.length;for(n[o++]=s,a=0;a<s;++a,o+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],n,o);const p=i._shape;for(s=p.length,n[o++]=s,a=0;a<s;++a,o+=r.Cartesian2.packedLength)r.Cartesian2.pack(p[a],n,o);return t.Ellipsoid.pack(i._ellipsoid,n,o),o+=t.Ellipsoid.packedLength,n[o++]=i._cornerType,n[o]=i._granularity,n};const T=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,height:void 0,cornerType:void 0,granularity:void 0};L.unpack=function(i,n,o){let a;n=e.defaultValue(n,0);let l=i[n++];const s=new Array(l);for(a=0;a<l;++a,n+=t.Cartesian3.packedLength)s[a]=t.Cartesian3.unpack(i,n);l=i[n++];const p=new Array(l);for(a=0;a<l;++a,n+=r.Cartesian2.packedLength)p[a]=r.Cartesian2.unpack(i,n);const c=t.Ellipsoid.unpack(i,n,T);n+=t.Ellipsoid.packedLength;const u=i[n++],d=i[n];return e.defined(o)?(o._positions=s,o._shape=p,o._ellipsoid=t.Ellipsoid.clone(c,o._ellipsoid),o._cornerType=u,o._granularity=d,o):(D.polylinePositions=s,D.shapePositions=p,D.cornerType=u,D.granularity=d,new L(D))};const G=new n.BoundingRectangle;return L.createGeometry=function(e){const r=e._positions,u=i.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),u.length<2||y.length<3)return;d.PolygonPipeline.computeWindingOrder2D(y)===d.WindingOrder.CLOCKWISE&&y.reverse();const g=n.BoundingRectangle.fromPoints(y,G);return function(e,t){const i=new p.GeometryAttributes;i.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});const n=t.length,r=i.position.values.length/3,l=e.length/3/n,u=c.IndexDatatype.createTypedArray(r,2*n*(l+1));let d,y,g=0;d=0;let h=d*n;for(y=0;y<n-1;y++)u[g++]=y+h,u[g++]=y+h+1;for(u[g++]=n-1+h,u[g++]=h,d=l-1,h=d*n,y=0;y<n-1;y++)u[g++]=y+h,u[g++]=y+h+1;for(u[g++]=n-1+h,u[g++]=h,d=0;d<l-1;d++){const e=n*d,t=e+n;for(y=0;y<n;y++)u[g++]=y+e,u[g++]=y+t}return new s.Geometry({attributes:i,indices:c.IndexDatatype.createTypedArray(r,u),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES})}(l.PolylineVolumeGeometryLibrary.computePositions(u,y,g,e,!1),y)},function(i,n){return e.defined(n)&&(i=L.unpack(i,n)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),L.createGeometry(i)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./arrayRemoveDuplicates-0d8dde26","./BoundingRectangle-4ef16803","./Transforms-f17097e5","./Matrix2-7a8e9daf","./ComponentDatatype-ab629b88","./PolylineVolumeGeometryLibrary-5050cb1d","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./combine-0c102d93","./RuntimeError-9b4ce3fb","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8"],(function(e,t,i,n,o,r,a,l,s,p,c,u,d,y,g,h,m,f,E,P,_,k,C){"use strict";function L(i){const n=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).polylinePositions,o=i.shapePositions;this._positions=n,this._shape=o,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(i.cornerType,l.CornerType.ROUNDED),this._granularity=e.defaultValue(i.granularity,u.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let a=1+n.length*t.Cartesian3.packedLength;a+=1+o.length*r.Cartesian2.packedLength,this.packedLength=a+t.Ellipsoid.packedLength+2}L.pack=function(i,n,o){let a;o=e.defaultValue(o,0);const l=i._positions;let s=l.length;for(n[o++]=s,a=0;a<s;++a,o+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],n,o);const p=i._shape;for(s=p.length,n[o++]=s,a=0;a<s;++a,o+=r.Cartesian2.packedLength)r.Cartesian2.pack(p[a],n,o);return t.Ellipsoid.pack(i._ellipsoid,n,o),o+=t.Ellipsoid.packedLength,n[o++]=i._cornerType,n[o]=i._granularity,n};const T=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,height:void 0,cornerType:void 0,granularity:void 0};L.unpack=function(i,n,o){let a;n=e.defaultValue(n,0);let l=i[n++];const s=new Array(l);for(a=0;a<l;++a,n+=t.Cartesian3.packedLength)s[a]=t.Cartesian3.unpack(i,n);l=i[n++];const p=new Array(l);for(a=0;a<l;++a,n+=r.Cartesian2.packedLength)p[a]=r.Cartesian2.unpack(i,n);const c=t.Ellipsoid.unpack(i,n,T);n+=t.Ellipsoid.packedLength;const u=i[n++],d=i[n];return e.defined(o)?(o._positions=s,o._shape=p,o._ellipsoid=t.Ellipsoid.clone(c,o._ellipsoid),o._cornerType=u,o._granularity=d,o):(D.polylinePositions=s,D.shapePositions=p,D.cornerType=u,D.granularity=d,new L(D))};const G=new n.BoundingRectangle;return L.createGeometry=function(e){const r=e._positions,u=i.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),u.length<2||y.length<3)return;d.PolygonPipeline.computeWindingOrder2D(y)===d.WindingOrder.CLOCKWISE&&y.reverse();const g=n.BoundingRectangle.fromPoints(y,G);return function(e,t){const i=new p.GeometryAttributes;i.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});const n=t.length,r=i.position.values.length/3,l=e.length/3/n,u=c.IndexDatatype.createTypedArray(r,2*n*(l+1));let d,y,g=0;d=0;let h=d*n;for(y=0;y<n-1;y++)u[g++]=y+h,u[g++]=y+h+1;for(u[g++]=n-1+h,u[g++]=h,d=l-1,h=d*n,y=0;y<n-1;y++)u[g++]=y+h,u[g++]=y+h+1;for(u[g++]=n-1+h,u[g++]=h,d=0;d<l-1;d++){const e=n*d,t=e+n;for(y=0;y<n;y++)u[g++]=y+e,u[g++]=y+t}return new s.Geometry({attributes:i,indices:c.IndexDatatype.createTypedArray(r,u),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES})}(l.PolylineVolumeGeometryLibrary.computePositions(u,y,g,e,!1),y)},function(i,n){return e.defined(n)&&(i=L.unpack(i,n)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),L.createGeometry(i)}})); diff --git a/public/lib/Cesium/Workers/createRectangleGeometry.js b/public/lib/Cesium/Workers/createRectangleGeometry.js index 317fcfc3..f2faf8a2 100644 --- a/public/lib/Cesium/Workers/createRectangleGeometry.js +++ b/public/lib/Cesium/Workers/createRectangleGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./Matrix2-413c4048","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryInstance-0318e0cd","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-fea557d0","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./RectangleGeometryLibrary-c7310394","./VertexFormat-fbdec922","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./AttributeCompression-48e336db","./EncodedCartesian3-5e2017ab","./IntersectionTests-56142431","./Plane-6add0ae1","./EllipsoidRhumbLine-77eff028"],(function(t,e,n,a,o,r,i,s,l,u,c,m,p,g,d,y,f,h,b,_,A,x,w){"use strict";const C=new e.Cartesian3,v=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,G=new n.Rectangle,F=new n.Cartesian2,P=new a.BoundingSphere,V=new a.BoundingSphere;function L(t,e){const n=new r.Geometry({attributes:new i.GeometryAttributes,primitiveType:r.PrimitiveType.TRIANGLES});return n.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}const D=new e.Cartesian3,M=new e.Cartesian3;function T(t,n){const a=t._vertexFormat,i=t._ellipsoid,s=n.height,l=n.width,u=n.northCap,m=n.southCap;let p=0,d=s,y=s,f=0;u&&(p=1,y-=1,f+=1),m&&(d-=1,y-=1,f+=1),f+=l*y;const h=a.position?new Float64Array(3*f):void 0,b=a.st?new Float32Array(2*f):void 0;let _=0,A=0;const x=C,w=F;let G=Number.MAX_VALUE,P=Number.MAX_VALUE,V=-Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let t=p;t<d;++t)for(let e=0;e<l;++e)g.RectangleGeometryLibrary.computePosition(n,i,a.st,t,e,x,w),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=w.x,b[A++]=w.y,G=Math.min(G,w.x),P=Math.min(P,w.y),V=Math.max(V,w.x),D=Math.max(D,w.y));if(u&&(g.RectangleGeometryLibrary.computePosition(n,i,a.st,0,0,x,w),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=w.x,b[A++]=w.y,G=w.x,P=w.y,V=w.x,D=w.y)),m&&(g.RectangleGeometryLibrary.computePosition(n,i,a.st,s-1,0,x,w),h[_++]=x.x,h[_++]=x.y,h[_]=x.z,a.st&&(b[A++]=w.x,b[A]=w.y,G=Math.min(G,w.x),P=Math.min(P,w.y),V=Math.max(V,w.x),D=Math.max(D,w.y))),a.st&&(G<0||P<0||V>1||D>1))for(let t=0;t<b.length;t+=2)b[t]=(b[t]-G)/(V-G),b[t+1]=(b[t+1]-P)/(D-P);const M=function(t,n,a,o){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let u=0;const c=E,m=R;let p=v;if(n.normal||n.tangent||n.bitangent)for(let g=0;g<r;g+=3){const r=e.Cartesian3.fromArray(t,g,C),d=u+1,y=u+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,c),c)),n.normal&&(i[u]=p.x,i[d]=p.y,i[y]=p.z),n.tangent&&(s[u]=m.x,s[d]=m.y,s[y]=m.z),n.bitangent&&(l[u]=c.x,l[d]=c.y,l[y]=c.z),u+=3}return L(n,{positions:t,normals:i,tangents:s,bitangents:l})}(h,a,i,n.tangentRotationMatrix);let T=6*(l-1)*(y-1);u&&(T+=3*(l-1)),m&&(T+=3*(l-1));const O=c.IndexDatatype.createTypedArray(f,T);let N,S=0,I=0;for(N=0;N<y-1;++N){for(let t=0;t<l-1;++t){const t=S,e=t+l,n=e+1,a=t+1;O[I++]=t,O[I++]=e,O[I++]=a,O[I++]=a,O[I++]=e,O[I++]=n,++S}++S}if(u||m){let t=f-1;const e=f-1;let n,a;if(u&&m&&(t=f-2),S=0,u)for(N=0;N<l-1;N++)n=S,a=n+1,O[I++]=t,O[I++]=n,O[I++]=a,++S;if(m)for(S=(y-1)*l,N=0;N<l-1;N++)n=S,a=n+1,O[I++]=n,O[I++]=e,O[I++]=a,++S}return M.indices=O,a.st&&(M.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:b})),M}function O(t,e,n,a,o){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}function N(t,e,n,a){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}const S=new d.VertexFormat;function I(n,a){const i=n._shadowVolume,g=n._offsetAttribute,y=n._vertexFormat,f=n._extrudedHeight,h=n._surfaceHeight,b=n._ellipsoid,_=a.height,A=a.width;let x;if(i){const t=d.VertexFormat.clone(y,S);t.normal=!0,n._vertexFormat=t}const w=T(n,a);i&&(n._vertexFormat=y);let G=p.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,h,b,!1);G=new Float64Array(G);let F=G.length;const P=2*F,V=new Float64Array(P);V.set(G);const I=p.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,f,b);V.set(I,F),w.attributes.position.values=V;const k=y.normal?new Float32Array(P):void 0,H=y.tangent?new Float32Array(P):void 0,z=y.bitangent?new Float32Array(P):void 0,B=y.st?new Float32Array(P/3*2):void 0;let U,Y,q;if(y.normal){for(Y=w.attributes.normal.values,k.set(Y),x=0;x<F;x++)Y[x]=-Y[x];k.set(Y,F),w.attributes.normal.values=k}if(i){Y=w.attributes.normal.values,y.normal||(w.attributes.normal=void 0);const t=new Float32Array(P);for(x=0;x<F;x++)Y[x]=-Y[x];t.set(Y,F),w.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}const X=t.defined(g);if(X){const t=F/3*2;let e=new Uint8Array(t);g===l.GeometryOffsetAttribute.TOP?e=e.fill(1,0,t/2):(q=g===l.GeometryOffsetAttribute.NONE?0:1,e=e.fill(q)),w.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(y.tangent){const t=w.attributes.tangent.values;for(H.set(t),x=0;x<F;x++)t[x]=-t[x];H.set(t,F),w.attributes.tangent.values=H}if(y.bitangent){const t=w.attributes.bitangent.values;z.set(t),z.set(t,F),w.attributes.bitangent.values=z}y.st&&(U=w.attributes.st.values,B.set(U),B.set(U,F/3*2),w.attributes.st.values=B);const Q=w.indices,W=Q.length,J=F/3,j=c.IndexDatatype.createTypedArray(P/3,2*W);for(j.set(Q),x=0;x<W;x+=3)j[x+W]=Q[x+2]+J,j[x+1+W]=Q[x+1]+J,j[x+2+W]=Q[x]+J;w.indices=j;const Z=a.northCap,K=a.southCap;let $=_,tt=2,et=0,nt=4,at=4;Z&&(tt-=1,$-=1,et+=1,nt-=2,at-=1),K&&(tt-=1,$-=1,et+=1,nt-=2,at-=1),et+=tt*A+2*$-nt;const ot=2*(et+at);let rt=new Float64Array(3*ot);const it=i?new Float32Array(3*ot):void 0;let st=X?new Uint8Array(ot):void 0,lt=y.st?new Float32Array(2*ot):void 0;const ut=g===l.GeometryOffsetAttribute.TOP;X&&!ut&&(q=g===l.GeometryOffsetAttribute.ALL?1:0,st=st.fill(q));let ct=0,mt=0,pt=0,gt=0;const dt=A*$;let yt;for(x=0;x<dt;x+=A)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);if(K){const t=Z?dt+1:dt;for(yt=3*t,x=0;x<2;x++)rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*t,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1)}else for(x=dt-A;x<dt;x++)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);for(x=dt-1;x>0;x-=A)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);if(Z){const t=dt;for(yt=3*t,x=0;x<2;x++)rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*t,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1)}else for(x=A-1;x>=0;x--)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);let ft=function(t,n,a){const o=t.length,r=n.normal?new Float32Array(o):void 0,i=n.tangent?new Float32Array(o):void 0,s=n.bitangent?new Float32Array(o):void 0;let l=0,u=0,c=0,p=!0,g=E,d=R,y=v;if(n.normal||n.tangent||n.bitangent)for(let f=0;f<o;f+=6){const h=e.Cartesian3.fromArray(t,f,C),b=e.Cartesian3.fromArray(t,(f+6)%o,D);if(p){const n=e.Cartesian3.fromArray(t,(f+3)%o,M);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,m.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(g=a.geodeticSurfaceNormal(h,g),n.tangent&&(d=e.Cartesian3.normalize(e.Cartesian3.cross(g,y,d),d))),n.normal&&(r[l++]=y.x,r[l++]=y.y,r[l++]=y.z,r[l++]=y.x,r[l++]=y.y,r[l++]=y.z),n.tangent&&(i[u++]=d.x,i[u++]=d.y,i[u++]=d.z,i[u++]=d.x,i[u++]=d.y,i[u++]=d.z),n.bitangent&&(s[c++]=g.x,s[c++]=g.y,s[c++]=g.z,s[c++]=g.x,s[c++]=g.y,s[c++]=g.z)}return L(n,{positions:t,normals:r,tangents:i,bitangents:s})}(rt,y,b);y.st&&(ft.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:lt})),i&&(ft.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:it})),X&&(ft.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:st}));const ht=c.IndexDatatype.createTypedArray(ot,6*et);let bt,_t,At,xt;F=rt.length/3;let wt=0;for(x=0;x<F-1;x+=2){bt=x,xt=(bt+2)%F;const t=e.Cartesian3.fromArray(rt,3*bt,D),n=e.Cartesian3.fromArray(rt,3*xt,M);e.Cartesian3.equalsEpsilon(t,n,m.CesiumMath.EPSILON10)||(_t=(bt+1)%F,At=(_t+2)%F,ht[wt++]=bt,ht[wt++]=_t,ht[wt++]=xt,ht[wt++]=xt,ht[wt++]=_t,ht[wt++]=At)}return ft.indices=ht,ft=u.GeometryPipeline.combineInstances([new s.GeometryInstance({geometry:w}),new s.GeometryInstance({geometry:ft})]),ft[0]}const k=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3],H=new e.Cartographic,z=new e.Cartographic;function B(t,e,a,o,r){if(0===a)return n.Rectangle.clone(t,r);const i=g.RectangleGeometryLibrary.computeOptions(t,e,a,0,G,H),s=i.height,l=i.width,u=k;return g.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,u[0]),g.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,u[1]),g.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,u[2]),g.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,u[3]),n.Rectangle.fromCartesianArray(u,o,r)}function U(a){const o=(a=t.defaultValue(a,t.defaultValue.EMPTY_OBJECT)).rectangle,r=t.defaultValue(a.height,0),i=t.defaultValue(a.extrudedHeight,r);this._rectangle=n.Rectangle.clone(o),this._granularity=t.defaultValue(a.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(a.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(r,i),this._rotation=t.defaultValue(a.rotation,0),this._stRotation=t.defaultValue(a.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(a.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(r,i),this._shadowVolume=t.defaultValue(a.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=a.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}U.packedLength=n.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,U.pack=function(a,o,r){return r=t.defaultValue(r,0),n.Rectangle.pack(a._rectangle,o,r),r+=n.Rectangle.packedLength,e.Ellipsoid.pack(a._ellipsoid,o,r),r+=e.Ellipsoid.packedLength,d.VertexFormat.pack(a._vertexFormat,o,r),r+=d.VertexFormat.packedLength,o[r++]=a._granularity,o[r++]=a._surfaceHeight,o[r++]=a._rotation,o[r++]=a._stRotation,o[r++]=a._extrudedHeight,o[r++]=a._shadowVolume?1:0,o[r]=t.defaultValue(a._offsetAttribute,-1),o};const Y=new n.Rectangle,q=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),X={rectangle:Y,ellipsoid:q,vertexFormat:S,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};U.unpack=function(a,o,r){o=t.defaultValue(o,0);const i=n.Rectangle.unpack(a,o,Y);o+=n.Rectangle.packedLength;const s=e.Ellipsoid.unpack(a,o,q);o+=e.Ellipsoid.packedLength;const l=d.VertexFormat.unpack(a,o,S);o+=d.VertexFormat.packedLength;const u=a[o++],c=a[o++],m=a[o++],p=a[o++],g=a[o++],y=1===a[o++],f=a[o];return t.defined(r)?(r._rectangle=n.Rectangle.clone(i,r._rectangle),r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(l,r._vertexFormat),r._granularity=u,r._surfaceHeight=c,r._rotation=m,r._stRotation=p,r._extrudedHeight=g,r._shadowVolume=y,r._offsetAttribute=-1===f?void 0:f,r):(X.granularity=u,X.height=c,X.rotation=m,X.stRotation=p,X.extrudedHeight=g,X.shadowVolume=y,X.offsetAttribute=-1===f?void 0:f,new U(X))},U.computeRectangle=function(n,a){const o=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,r=t.defaultValue(n.granularity,m.CesiumMath.RADIANS_PER_DEGREE),i=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84);return B(o,r,t.defaultValue(n.rotation,0),i,a)};const Q=new e.Matrix3,W=new a.Quaternion,J=new e.Cartographic;U.createGeometry=function(i){if(m.CesiumMath.equalsEpsilon(i._rectangle.north,i._rectangle.south,m.CesiumMath.EPSILON10)||m.CesiumMath.equalsEpsilon(i._rectangle.east,i._rectangle.west,m.CesiumMath.EPSILON10))return;let s=i._rectangle;const u=i._ellipsoid,c=i._rotation,d=i._stRotation,y=i._vertexFormat,f=g.RectangleGeometryLibrary.computeOptions(s,i._granularity,c,d,G,H,z),h=Q;if(0!==d||0!==c){const t=n.Rectangle.center(s,J),o=u.geodeticSurfaceNormalCartographic(t,D);a.Quaternion.fromAxisAngle(o,-d,W),e.Matrix3.fromQuaternion(W,h)}else e.Matrix3.clone(e.Matrix3.IDENTITY,h);const b=i._surfaceHeight,_=i._extrudedHeight,A=!m.CesiumMath.equalsEpsilon(b,_,0,m.CesiumMath.EPSILON2);let x,w;if(f.lonScalar=1/i._rectangle.width,f.latScalar=1/i._rectangle.height,f.tangentRotationMatrix=h,s=i._rectangle,A){x=I(i,f);const t=a.BoundingSphere.fromRectangle3D(s,u,b,V),e=a.BoundingSphere.fromRectangle3D(s,u,_,P);w=a.BoundingSphere.union(t,e)}else{if(x=T(i,f),x.attributes.position.values=p.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,b,u,!1),t.defined(i._offsetAttribute)){const t=x.attributes.position.values.length,e=i._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(e);x.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}w=a.BoundingSphere.fromRectangle3D(s,u,b)}return y.position||delete x.attributes.position,new r.Geometry({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:w,offsetAttribute:i._offsetAttribute})},U.createShadowVolume=function(t,e,n){const a=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);return new U({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};const j=new n.Rectangle,Z=[new n.Cartesian2,new n.Cartesian2,new n.Cartesian2],K=new n.Matrix2,$=new e.Cartographic;return Object.defineProperties(U.prototype,{rectangle:{get:function(){return t.defined(this._rotatedRectangle)||(this._rotatedRectangle=B(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];const e=n.Rectangle.clone(t._rectangle,j),a=t._granularity,o=t._ellipsoid,r=B(e,a,t._rotation-t._stRotation,o,j),i=Z;i[0].x=r.west,i[0].y=r.south,i[1].x=r.west,i[1].y=r.north,i[2].x=r.east,i[2].y=r.south;const s=t.rectangle,l=n.Matrix2.fromRotation(t._stRotation,K),u=n.Rectangle.center(s,$);for(let t=0;t<3;++t){const e=i[t];e.x-=u.longitude,e.y-=u.latitude,n.Matrix2.multiplyByVector(l,e,e),e.x+=u.longitude,e.y+=u.latitude,e.x=(e.x-s.west)/s.width,e.y=(e.y-s.south)/s.height}const c=i[0],m=i[1],p=i[2],g=new Array(6);return n.Cartesian2.pack(c,g),n.Cartesian2.pack(m,g,2),n.Cartesian2.pack(p,g,4),g}(this)),this._textureCoordinateRotationPoints}}}),function(a,o){return t.defined(o)&&(a=U.unpack(a,o)),a._ellipsoid=e.Ellipsoid.clone(a._ellipsoid),a._rectangle=n.Rectangle.clone(a._rectangle),U.createGeometry(a)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./Matrix2-7a8e9daf","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryInstance-c4920693","./GeometryOffsetAttribute-2579b8d2","./GeometryPipeline-a9233ae3","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./RectangleGeometryLibrary-6ad7ff7a","./VertexFormat-fbdec922","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./AttributeCompression-0b8f7b7d","./EncodedCartesian3-abad5e8c","./IntersectionTests-f1b36d69","./Plane-5931b53e","./EllipsoidRhumbLine-1289f7e8"],(function(t,e,n,a,o,r,i,s,l,u,c,m,p,g,d,y,f,h,b,_,A,x,w){"use strict";const C=new e.Cartesian3,v=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,G=new n.Rectangle,F=new n.Cartesian2,P=new a.BoundingSphere,V=new a.BoundingSphere;function L(t,e){const n=new r.Geometry({attributes:new i.GeometryAttributes,primitiveType:r.PrimitiveType.TRIANGLES});return n.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}const D=new e.Cartesian3,M=new e.Cartesian3;function T(t,n){const a=t._vertexFormat,i=t._ellipsoid,s=n.height,l=n.width,u=n.northCap,m=n.southCap;let p=0,d=s,y=s,f=0;u&&(p=1,y-=1,f+=1),m&&(d-=1,y-=1,f+=1),f+=l*y;const h=a.position?new Float64Array(3*f):void 0,b=a.st?new Float32Array(2*f):void 0;let _=0,A=0;const x=C,w=F;let G=Number.MAX_VALUE,P=Number.MAX_VALUE,V=-Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let t=p;t<d;++t)for(let e=0;e<l;++e)g.RectangleGeometryLibrary.computePosition(n,i,a.st,t,e,x,w),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=w.x,b[A++]=w.y,G=Math.min(G,w.x),P=Math.min(P,w.y),V=Math.max(V,w.x),D=Math.max(D,w.y));if(u&&(g.RectangleGeometryLibrary.computePosition(n,i,a.st,0,0,x,w),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=w.x,b[A++]=w.y,G=w.x,P=w.y,V=w.x,D=w.y)),m&&(g.RectangleGeometryLibrary.computePosition(n,i,a.st,s-1,0,x,w),h[_++]=x.x,h[_++]=x.y,h[_]=x.z,a.st&&(b[A++]=w.x,b[A]=w.y,G=Math.min(G,w.x),P=Math.min(P,w.y),V=Math.max(V,w.x),D=Math.max(D,w.y))),a.st&&(G<0||P<0||V>1||D>1))for(let t=0;t<b.length;t+=2)b[t]=(b[t]-G)/(V-G),b[t+1]=(b[t+1]-P)/(D-P);const M=function(t,n,a,o){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let u=0;const c=E,m=R;let p=v;if(n.normal||n.tangent||n.bitangent)for(let g=0;g<r;g+=3){const r=e.Cartesian3.fromArray(t,g,C),d=u+1,y=u+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,c),c)),n.normal&&(i[u]=p.x,i[d]=p.y,i[y]=p.z),n.tangent&&(s[u]=m.x,s[d]=m.y,s[y]=m.z),n.bitangent&&(l[u]=c.x,l[d]=c.y,l[y]=c.z),u+=3}return L(n,{positions:t,normals:i,tangents:s,bitangents:l})}(h,a,i,n.tangentRotationMatrix);let T=6*(l-1)*(y-1);u&&(T+=3*(l-1)),m&&(T+=3*(l-1));const O=c.IndexDatatype.createTypedArray(f,T);let N,S=0,I=0;for(N=0;N<y-1;++N){for(let t=0;t<l-1;++t){const t=S,e=t+l,n=e+1,a=t+1;O[I++]=t,O[I++]=e,O[I++]=a,O[I++]=a,O[I++]=e,O[I++]=n,++S}++S}if(u||m){let t=f-1;const e=f-1;let n,a;if(u&&m&&(t=f-2),S=0,u)for(N=0;N<l-1;N++)n=S,a=n+1,O[I++]=t,O[I++]=n,O[I++]=a,++S;if(m)for(S=(y-1)*l,N=0;N<l-1;N++)n=S,a=n+1,O[I++]=n,O[I++]=e,O[I++]=a,++S}return M.indices=O,a.st&&(M.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:b})),M}function O(t,e,n,a,o){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}function N(t,e,n,a){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}const S=new d.VertexFormat;function I(n,a){const i=n._shadowVolume,g=n._offsetAttribute,y=n._vertexFormat,f=n._extrudedHeight,h=n._surfaceHeight,b=n._ellipsoid,_=a.height,A=a.width;let x;if(i){const t=d.VertexFormat.clone(y,S);t.normal=!0,n._vertexFormat=t}const w=T(n,a);i&&(n._vertexFormat=y);let G=p.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,h,b,!1);G=new Float64Array(G);let F=G.length;const P=2*F,V=new Float64Array(P);V.set(G);const I=p.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,f,b);V.set(I,F),w.attributes.position.values=V;const k=y.normal?new Float32Array(P):void 0,H=y.tangent?new Float32Array(P):void 0,z=y.bitangent?new Float32Array(P):void 0,B=y.st?new Float32Array(P/3*2):void 0;let U,Y,q;if(y.normal){for(Y=w.attributes.normal.values,k.set(Y),x=0;x<F;x++)Y[x]=-Y[x];k.set(Y,F),w.attributes.normal.values=k}if(i){Y=w.attributes.normal.values,y.normal||(w.attributes.normal=void 0);const t=new Float32Array(P);for(x=0;x<F;x++)Y[x]=-Y[x];t.set(Y,F),w.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}const X=t.defined(g);if(X){const t=F/3*2;let e=new Uint8Array(t);g===l.GeometryOffsetAttribute.TOP?e=e.fill(1,0,t/2):(q=g===l.GeometryOffsetAttribute.NONE?0:1,e=e.fill(q)),w.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(y.tangent){const t=w.attributes.tangent.values;for(H.set(t),x=0;x<F;x++)t[x]=-t[x];H.set(t,F),w.attributes.tangent.values=H}if(y.bitangent){const t=w.attributes.bitangent.values;z.set(t),z.set(t,F),w.attributes.bitangent.values=z}y.st&&(U=w.attributes.st.values,B.set(U),B.set(U,F/3*2),w.attributes.st.values=B);const Q=w.indices,W=Q.length,J=F/3,j=c.IndexDatatype.createTypedArray(P/3,2*W);for(j.set(Q),x=0;x<W;x+=3)j[x+W]=Q[x+2]+J,j[x+1+W]=Q[x+1]+J,j[x+2+W]=Q[x]+J;w.indices=j;const Z=a.northCap,K=a.southCap;let $=_,tt=2,et=0,nt=4,at=4;Z&&(tt-=1,$-=1,et+=1,nt-=2,at-=1),K&&(tt-=1,$-=1,et+=1,nt-=2,at-=1),et+=tt*A+2*$-nt;const ot=2*(et+at);let rt=new Float64Array(3*ot);const it=i?new Float32Array(3*ot):void 0;let st=X?new Uint8Array(ot):void 0,lt=y.st?new Float32Array(2*ot):void 0;const ut=g===l.GeometryOffsetAttribute.TOP;X&&!ut&&(q=g===l.GeometryOffsetAttribute.ALL?1:0,st=st.fill(q));let ct=0,mt=0,pt=0,gt=0;const dt=A*$;let yt;for(x=0;x<dt;x+=A)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);if(K){const t=Z?dt+1:dt;for(yt=3*t,x=0;x<2;x++)rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*t,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1)}else for(x=dt-A;x<dt;x++)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);for(x=dt-1;x>0;x-=A)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);if(Z){const t=dt;for(yt=3*t,x=0;x<2;x++)rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*t,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1)}else for(x=A-1;x>=0;x--)yt=3*x,rt=O(rt,ct,yt,G,I),ct+=6,y.st&&(lt=N(lt,mt,2*x,U),mt+=4),i&&(pt+=3,it[pt++]=Y[yt],it[pt++]=Y[yt+1],it[pt++]=Y[yt+2]),ut&&(st[gt++]=1,gt+=1);let ft=function(t,n,a){const o=t.length,r=n.normal?new Float32Array(o):void 0,i=n.tangent?new Float32Array(o):void 0,s=n.bitangent?new Float32Array(o):void 0;let l=0,u=0,c=0,p=!0,g=E,d=R,y=v;if(n.normal||n.tangent||n.bitangent)for(let f=0;f<o;f+=6){const h=e.Cartesian3.fromArray(t,f,C),b=e.Cartesian3.fromArray(t,(f+6)%o,D);if(p){const n=e.Cartesian3.fromArray(t,(f+3)%o,M);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,m.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(g=a.geodeticSurfaceNormal(h,g),n.tangent&&(d=e.Cartesian3.normalize(e.Cartesian3.cross(g,y,d),d))),n.normal&&(r[l++]=y.x,r[l++]=y.y,r[l++]=y.z,r[l++]=y.x,r[l++]=y.y,r[l++]=y.z),n.tangent&&(i[u++]=d.x,i[u++]=d.y,i[u++]=d.z,i[u++]=d.x,i[u++]=d.y,i[u++]=d.z),n.bitangent&&(s[c++]=g.x,s[c++]=g.y,s[c++]=g.z,s[c++]=g.x,s[c++]=g.y,s[c++]=g.z)}return L(n,{positions:t,normals:r,tangents:i,bitangents:s})}(rt,y,b);y.st&&(ft.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:lt})),i&&(ft.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:it})),X&&(ft.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:st}));const ht=c.IndexDatatype.createTypedArray(ot,6*et);let bt,_t,At,xt;F=rt.length/3;let wt=0;for(x=0;x<F-1;x+=2){bt=x,xt=(bt+2)%F;const t=e.Cartesian3.fromArray(rt,3*bt,D),n=e.Cartesian3.fromArray(rt,3*xt,M);e.Cartesian3.equalsEpsilon(t,n,m.CesiumMath.EPSILON10)||(_t=(bt+1)%F,At=(_t+2)%F,ht[wt++]=bt,ht[wt++]=_t,ht[wt++]=xt,ht[wt++]=xt,ht[wt++]=_t,ht[wt++]=At)}return ft.indices=ht,ft=u.GeometryPipeline.combineInstances([new s.GeometryInstance({geometry:w}),new s.GeometryInstance({geometry:ft})]),ft[0]}const k=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3],H=new e.Cartographic,z=new e.Cartographic;function B(t,e,a,o,r){if(0===a)return n.Rectangle.clone(t,r);const i=g.RectangleGeometryLibrary.computeOptions(t,e,a,0,G,H),s=i.height,l=i.width,u=k;return g.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,u[0]),g.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,u[1]),g.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,u[2]),g.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,u[3]),n.Rectangle.fromCartesianArray(u,o,r)}function U(a){const o=(a=t.defaultValue(a,t.defaultValue.EMPTY_OBJECT)).rectangle,r=t.defaultValue(a.height,0),i=t.defaultValue(a.extrudedHeight,r);this._rectangle=n.Rectangle.clone(o),this._granularity=t.defaultValue(a.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(a.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(r,i),this._rotation=t.defaultValue(a.rotation,0),this._stRotation=t.defaultValue(a.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(a.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(r,i),this._shadowVolume=t.defaultValue(a.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=a.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}U.packedLength=n.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,U.pack=function(a,o,r){return r=t.defaultValue(r,0),n.Rectangle.pack(a._rectangle,o,r),r+=n.Rectangle.packedLength,e.Ellipsoid.pack(a._ellipsoid,o,r),r+=e.Ellipsoid.packedLength,d.VertexFormat.pack(a._vertexFormat,o,r),r+=d.VertexFormat.packedLength,o[r++]=a._granularity,o[r++]=a._surfaceHeight,o[r++]=a._rotation,o[r++]=a._stRotation,o[r++]=a._extrudedHeight,o[r++]=a._shadowVolume?1:0,o[r]=t.defaultValue(a._offsetAttribute,-1),o};const Y=new n.Rectangle,q=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),X={rectangle:Y,ellipsoid:q,vertexFormat:S,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};U.unpack=function(a,o,r){o=t.defaultValue(o,0);const i=n.Rectangle.unpack(a,o,Y);o+=n.Rectangle.packedLength;const s=e.Ellipsoid.unpack(a,o,q);o+=e.Ellipsoid.packedLength;const l=d.VertexFormat.unpack(a,o,S);o+=d.VertexFormat.packedLength;const u=a[o++],c=a[o++],m=a[o++],p=a[o++],g=a[o++],y=1===a[o++],f=a[o];return t.defined(r)?(r._rectangle=n.Rectangle.clone(i,r._rectangle),r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(l,r._vertexFormat),r._granularity=u,r._surfaceHeight=c,r._rotation=m,r._stRotation=p,r._extrudedHeight=g,r._shadowVolume=y,r._offsetAttribute=-1===f?void 0:f,r):(X.granularity=u,X.height=c,X.rotation=m,X.stRotation=p,X.extrudedHeight=g,X.shadowVolume=y,X.offsetAttribute=-1===f?void 0:f,new U(X))},U.computeRectangle=function(n,a){const o=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,r=t.defaultValue(n.granularity,m.CesiumMath.RADIANS_PER_DEGREE),i=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84);return B(o,r,t.defaultValue(n.rotation,0),i,a)};const Q=new e.Matrix3,W=new a.Quaternion,J=new e.Cartographic;U.createGeometry=function(i){if(m.CesiumMath.equalsEpsilon(i._rectangle.north,i._rectangle.south,m.CesiumMath.EPSILON10)||m.CesiumMath.equalsEpsilon(i._rectangle.east,i._rectangle.west,m.CesiumMath.EPSILON10))return;let s=i._rectangle;const u=i._ellipsoid,c=i._rotation,d=i._stRotation,y=i._vertexFormat,f=g.RectangleGeometryLibrary.computeOptions(s,i._granularity,c,d,G,H,z),h=Q;if(0!==d||0!==c){const t=n.Rectangle.center(s,J),o=u.geodeticSurfaceNormalCartographic(t,D);a.Quaternion.fromAxisAngle(o,-d,W),e.Matrix3.fromQuaternion(W,h)}else e.Matrix3.clone(e.Matrix3.IDENTITY,h);const b=i._surfaceHeight,_=i._extrudedHeight,A=!m.CesiumMath.equalsEpsilon(b,_,0,m.CesiumMath.EPSILON2);let x,w;if(f.lonScalar=1/i._rectangle.width,f.latScalar=1/i._rectangle.height,f.tangentRotationMatrix=h,s=i._rectangle,A){x=I(i,f);const t=a.BoundingSphere.fromRectangle3D(s,u,b,V),e=a.BoundingSphere.fromRectangle3D(s,u,_,P);w=a.BoundingSphere.union(t,e)}else{if(x=T(i,f),x.attributes.position.values=p.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,b,u,!1),t.defined(i._offsetAttribute)){const t=x.attributes.position.values.length,e=i._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(e);x.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}w=a.BoundingSphere.fromRectangle3D(s,u,b)}return y.position||delete x.attributes.position,new r.Geometry({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:w,offsetAttribute:i._offsetAttribute})},U.createShadowVolume=function(t,e,n){const a=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);return new U({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};const j=new n.Rectangle,Z=[new n.Cartesian2,new n.Cartesian2,new n.Cartesian2],K=new n.Matrix2,$=new e.Cartographic;return Object.defineProperties(U.prototype,{rectangle:{get:function(){return t.defined(this._rotatedRectangle)||(this._rotatedRectangle=B(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];const e=n.Rectangle.clone(t._rectangle,j),a=t._granularity,o=t._ellipsoid,r=B(e,a,t._rotation-t._stRotation,o,j),i=Z;i[0].x=r.west,i[0].y=r.south,i[1].x=r.west,i[1].y=r.north,i[2].x=r.east,i[2].y=r.south;const s=t.rectangle,l=n.Matrix2.fromRotation(t._stRotation,K),u=n.Rectangle.center(s,$);for(let t=0;t<3;++t){const e=i[t];e.x-=u.longitude,e.y-=u.latitude,n.Matrix2.multiplyByVector(l,e,e),e.x+=u.longitude,e.y+=u.latitude,e.x=(e.x-s.west)/s.width,e.y=(e.y-s.south)/s.height}const c=i[0],m=i[1],p=i[2],g=new Array(6);return n.Cartesian2.pack(c,g),n.Cartesian2.pack(m,g,2),n.Cartesian2.pack(p,g,4),g}(this)),this._textureCoordinateRotationPoints}}}),function(a,o){return t.defined(o)&&(a=U.unpack(a,o)),a._ellipsoid=e.Ellipsoid.clone(a._ellipsoid),a._rectangle=n.Rectangle.clone(a._rectangle),U.createGeometry(a)}})); diff --git a/public/lib/Cesium/Workers/createRectangleOutlineGeometry.js b/public/lib/Cesium/Workers/createRectangleOutlineGeometry.js index 02fc7944..946dbf4d 100644 --- a/public/lib/Cesium/Workers/createRectangleOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createRectangleOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./Matrix2-413c4048","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolygonPipeline-87656bae","./RectangleGeometryLibrary-c7310394","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidRhumbLine-77eff028"],(function(e,t,i,n,o,r,a,l,s,u,c,p,d,f,g,h){"use strict";const y=new n.BoundingSphere,m=new n.BoundingSphere,b=new t.Cartesian3,_=new i.Rectangle;function A(e,t){const i=e._ellipsoid,n=t.height,l=t.width,u=t.northCap,c=t.southCap;let d=n,f=2,g=0,h=4;u&&(f-=1,d-=1,g+=1,h-=2),c&&(f-=1,d-=1,g+=1,h-=2),g+=f*l+2*d-h;const y=new Float64Array(3*g);let m,_=0,A=0;const E=b;if(u)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,0,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;else for(m=0;m<l;m++)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;for(m=l-1,A=1;A<n;A++)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;if(A=n-1,!c)for(m=l-2;m>=0;m--)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;for(m=0,A=n-2;A>0;A--)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;const G=y.length/3*2,R=s.IndexDatatype.createTypedArray(y.length/3,G);let P=0;for(let e=0;e<y.length/3-1;e++)R[P++]=e,R[P++]=e+1;R[P++]=y.length/3-1,R[P++]=0;const L=new r.Geometry({attributes:new a.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});return L.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),L.indices=R,L}function E(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).rectangle,r=e.defaultValue(n.granularity,u.CesiumMath.RADIANS_PER_DEGREE),a=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(n.rotation,0),s=e.defaultValue(n.height,0),c=e.defaultValue(n.extrudedHeight,s);this._rectangle=i.Rectangle.clone(o),this._granularity=r,this._ellipsoid=a,this._surfaceHeight=Math.max(s,c),this._rotation=l,this._extrudedHeight=Math.min(s,c),this._offsetAttribute=n.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}E.packedLength=i.Rectangle.packedLength+t.Ellipsoid.packedLength+5,E.pack=function(n,o,r){return r=e.defaultValue(r,0),i.Rectangle.pack(n._rectangle,o,r),r+=i.Rectangle.packedLength,t.Ellipsoid.pack(n._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=n._granularity,o[r++]=n._surfaceHeight,o[r++]=n._rotation,o[r++]=n._extrudedHeight,o[r]=e.defaultValue(n._offsetAttribute,-1),o};const G=new i.Rectangle,R=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),P={rectangle:G,ellipsoid:R,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};E.unpack=function(n,o,r){o=e.defaultValue(o,0);const a=i.Rectangle.unpack(n,o,G);o+=i.Rectangle.packedLength;const l=t.Ellipsoid.unpack(n,o,R);o+=t.Ellipsoid.packedLength;const s=n[o++],u=n[o++],c=n[o++],p=n[o++],d=n[o];return e.defined(r)?(r._rectangle=i.Rectangle.clone(a,r._rectangle),r._ellipsoid=t.Ellipsoid.clone(l,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=p,r._offsetAttribute=-1===d?void 0:d,r):(P.granularity=s,P.height=u,P.rotation=c,P.extrudedHeight=p,P.offsetAttribute=-1===d?void 0:d,new E(P))};const L=new t.Cartographic;return E.createGeometry=function(t){const i=t._rectangle,a=t._ellipsoid,d=p.RectangleGeometryLibrary.computeOptions(i,t._granularity,t._rotation,0,_,L);let f,g;if(u.CesiumMath.equalsEpsilon(i.north,i.south,u.CesiumMath.EPSILON10)||u.CesiumMath.equalsEpsilon(i.east,i.west,u.CesiumMath.EPSILON10))return;const h=t._surfaceHeight,b=t._extrudedHeight;let E;if(!u.CesiumMath.equalsEpsilon(h,b,0,u.CesiumMath.EPSILON2)){if(f=function(e,t){const i=e._surfaceHeight,n=e._extrudedHeight,o=e._ellipsoid,r=n,a=i,l=A(e,t),u=t.height,p=t.width,d=c.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,o,!1);let f=d.length;const g=new Float64Array(2*f);g.set(d);const h=c.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,o);g.set(h,f),l.attributes.position.values=g;const y=t.northCap,m=t.southCap;let b=4;y&&(b-=1),m&&(b-=1);const _=2*(g.length/3+b),E=s.IndexDatatype.createTypedArray(g.length/3,_);f=g.length/6;let G,R=0;for(let e=0;e<f-1;e++)E[R++]=e,E[R++]=e+1,E[R++]=e+f,E[R++]=e+f+1;if(E[R++]=f-1,E[R++]=0,E[R++]=f+f-1,E[R++]=f,E[R++]=0,E[R++]=f,y)G=u-1;else{const e=p-1;E[R++]=e,E[R++]=e+f,G=p+u-2}if(E[R++]=G,E[R++]=G+f,!m){const e=p+G-1;E[R++]=e,E[R]=e+f}return l.indices=E,l}(t,d),e.defined(t._offsetAttribute)){const e=f.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===l.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(E=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,i=i.fill(E)),f.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}const u=n.BoundingSphere.fromRectangle3D(i,a,h,m),p=n.BoundingSphere.fromRectangle3D(i,a,b,y);g=n.BoundingSphere.union(u,p)}else{if(f=A(t,d),f.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(f.attributes.position.values,h,a,!1),e.defined(t._offsetAttribute)){const e=f.attributes.position.values.length;E=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(E);f.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}g=n.BoundingSphere.fromRectangle3D(i,a,h)}return new r.Geometry({attributes:f.attributes,indices:f.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})},function(n,o){return e.defined(o)&&(n=E.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),n._rectangle=i.Rectangle.clone(n._rectangle),E.createGeometry(n)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./Matrix2-7a8e9daf","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolygonPipeline-3fa47499","./RectangleGeometryLibrary-6ad7ff7a","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidRhumbLine-1289f7e8"],(function(e,t,i,n,o,r,a,l,s,u,c,p,d,f,g,h){"use strict";const y=new n.BoundingSphere,m=new n.BoundingSphere,b=new t.Cartesian3,_=new i.Rectangle;function A(e,t){const i=e._ellipsoid,n=t.height,l=t.width,u=t.northCap,c=t.southCap;let d=n,f=2,g=0,h=4;u&&(f-=1,d-=1,g+=1,h-=2),c&&(f-=1,d-=1,g+=1,h-=2),g+=f*l+2*d-h;const y=new Float64Array(3*g);let m,_=0,A=0;const E=b;if(u)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,0,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;else for(m=0;m<l;m++)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;for(m=l-1,A=1;A<n;A++)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;if(A=n-1,!c)for(m=l-2;m>=0;m--)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;for(m=0,A=n-2;A>0;A--)p.RectangleGeometryLibrary.computePosition(t,i,!1,A,m,E),y[_++]=E.x,y[_++]=E.y,y[_++]=E.z;const G=y.length/3*2,R=s.IndexDatatype.createTypedArray(y.length/3,G);let P=0;for(let e=0;e<y.length/3-1;e++)R[P++]=e,R[P++]=e+1;R[P++]=y.length/3-1,R[P++]=0;const L=new r.Geometry({attributes:new a.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});return L.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),L.indices=R,L}function E(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).rectangle,r=e.defaultValue(n.granularity,u.CesiumMath.RADIANS_PER_DEGREE),a=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(n.rotation,0),s=e.defaultValue(n.height,0),c=e.defaultValue(n.extrudedHeight,s);this._rectangle=i.Rectangle.clone(o),this._granularity=r,this._ellipsoid=a,this._surfaceHeight=Math.max(s,c),this._rotation=l,this._extrudedHeight=Math.min(s,c),this._offsetAttribute=n.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}E.packedLength=i.Rectangle.packedLength+t.Ellipsoid.packedLength+5,E.pack=function(n,o,r){return r=e.defaultValue(r,0),i.Rectangle.pack(n._rectangle,o,r),r+=i.Rectangle.packedLength,t.Ellipsoid.pack(n._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=n._granularity,o[r++]=n._surfaceHeight,o[r++]=n._rotation,o[r++]=n._extrudedHeight,o[r]=e.defaultValue(n._offsetAttribute,-1),o};const G=new i.Rectangle,R=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),P={rectangle:G,ellipsoid:R,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};E.unpack=function(n,o,r){o=e.defaultValue(o,0);const a=i.Rectangle.unpack(n,o,G);o+=i.Rectangle.packedLength;const l=t.Ellipsoid.unpack(n,o,R);o+=t.Ellipsoid.packedLength;const s=n[o++],u=n[o++],c=n[o++],p=n[o++],d=n[o];return e.defined(r)?(r._rectangle=i.Rectangle.clone(a,r._rectangle),r._ellipsoid=t.Ellipsoid.clone(l,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=p,r._offsetAttribute=-1===d?void 0:d,r):(P.granularity=s,P.height=u,P.rotation=c,P.extrudedHeight=p,P.offsetAttribute=-1===d?void 0:d,new E(P))};const L=new t.Cartographic;return E.createGeometry=function(t){const i=t._rectangle,a=t._ellipsoid,d=p.RectangleGeometryLibrary.computeOptions(i,t._granularity,t._rotation,0,_,L);let f,g;if(u.CesiumMath.equalsEpsilon(i.north,i.south,u.CesiumMath.EPSILON10)||u.CesiumMath.equalsEpsilon(i.east,i.west,u.CesiumMath.EPSILON10))return;const h=t._surfaceHeight,b=t._extrudedHeight;let E;if(!u.CesiumMath.equalsEpsilon(h,b,0,u.CesiumMath.EPSILON2)){if(f=function(e,t){const i=e._surfaceHeight,n=e._extrudedHeight,o=e._ellipsoid,r=n,a=i,l=A(e,t),u=t.height,p=t.width,d=c.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,o,!1);let f=d.length;const g=new Float64Array(2*f);g.set(d);const h=c.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,o);g.set(h,f),l.attributes.position.values=g;const y=t.northCap,m=t.southCap;let b=4;y&&(b-=1),m&&(b-=1);const _=2*(g.length/3+b),E=s.IndexDatatype.createTypedArray(g.length/3,_);f=g.length/6;let G,R=0;for(let e=0;e<f-1;e++)E[R++]=e,E[R++]=e+1,E[R++]=e+f,E[R++]=e+f+1;if(E[R++]=f-1,E[R++]=0,E[R++]=f+f-1,E[R++]=f,E[R++]=0,E[R++]=f,y)G=u-1;else{const e=p-1;E[R++]=e,E[R++]=e+f,G=p+u-2}if(E[R++]=G,E[R++]=G+f,!m){const e=p+G-1;E[R++]=e,E[R]=e+f}return l.indices=E,l}(t,d),e.defined(t._offsetAttribute)){const e=f.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===l.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(E=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,i=i.fill(E)),f.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}const u=n.BoundingSphere.fromRectangle3D(i,a,h,m),p=n.BoundingSphere.fromRectangle3D(i,a,b,y);g=n.BoundingSphere.union(u,p)}else{if(f=A(t,d),f.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(f.attributes.position.values,h,a,!1),e.defined(t._offsetAttribute)){const e=f.attributes.position.values.length;E=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(E);f.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}g=n.BoundingSphere.fromRectangle3D(i,a,h)}return new r.Geometry({attributes:f.attributes,indices:f.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})},function(n,o){return e.defined(o)&&(n=E.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),n._rectangle=i.Rectangle.clone(n._rectangle),E.createGeometry(n)}})); diff --git a/public/lib/Cesium/Workers/createSimplePolylineGeometry.js b/public/lib/Cesium/Workers/createSimplePolylineGeometry.js index df078e5e..4ef9677b 100644 --- a/public/lib/Cesium/Workers/createSimplePolylineGeometry.js +++ b/public/lib/Cesium/Workers/createSimplePolylineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./ArcType-26a3f38d","./Transforms-b3716b06","./Color-9ff9e611","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./PolylinePipeline-bcbea07f","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,o,t,l,r,n,i,a,s,p,c,y,d,u,f,h,C,g,T){"use strict";function m(e,o,t,l,n,i,a){const s=c.PolylinePipeline.numberOfPoints(e,o,n);let p;const y=t.red,d=t.green,u=t.blue,f=t.alpha,h=l.red,C=l.green,g=l.blue,T=l.alpha;if(r.Color.equals(t,l)){for(p=0;p<s;p++)i[a++]=r.Color.floatToByte(y),i[a++]=r.Color.floatToByte(d),i[a++]=r.Color.floatToByte(u),i[a++]=r.Color.floatToByte(f);return a}const m=(h-y)/s,P=(C-d)/s,_=(g-u)/s,A=(T-f)/s;let B=a;for(p=0;p<s;p++)i[B++]=r.Color.floatToByte(y+p*m),i[B++]=r.Color.floatToByte(d+p*P),i[B++]=r.Color.floatToByte(u+p*_),i[B++]=r.Color.floatToByte(f+p*A);return B}function P(l){const n=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,i=l.colors,a=e.defaultValue(l.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=a,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let s=1+n.length*o.Cartesian3.packedLength;s+=e.defined(i)?1+i.length*r.Color.packedLength:1,this.packedLength=s+o.Ellipsoid.packedLength+3}P.pack=function(t,l,n){let i;n=e.defaultValue(n,0);const a=t._positions;let s=a.length;for(l[n++]=s,i=0;i<s;++i,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(a[i],l,n);const p=t._colors;for(s=e.defined(p)?p.length:0,l[n++]=s,i=0;i<s;++i,n+=r.Color.packedLength)r.Color.pack(p[i],l,n);return o.Ellipsoid.pack(t._ellipsoid,l,n),n+=o.Ellipsoid.packedLength,l[n++]=t._colorsPerVertex?1:0,l[n++]=t._arcType,l[n]=t._granularity,l},P.unpack=function(t,l,n){let i;l=e.defaultValue(l,0);let a=t[l++];const s=new Array(a);for(i=0;i<a;++i,l+=o.Cartesian3.packedLength)s[i]=o.Cartesian3.unpack(t,l);a=t[l++];const p=a>0?new Array(a):void 0;for(i=0;i<a;++i,l+=r.Color.packedLength)p[i]=r.Color.unpack(t,l);const c=o.Ellipsoid.unpack(t,l);l+=o.Ellipsoid.packedLength;const y=1===t[l++],d=t[l++],u=t[l];return e.defined(n)?(n._positions=s,n._colors=p,n._ellipsoid=c,n._colorsPerVertex=y,n._arcType=d,n._granularity=u,n):new P({positions:s,colors:p,ellipsoid:c,colorsPerVertex:y,arcType:d,granularity:u})};const _=new Array(2),A=new Array(2),B={positions:_,height:A,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return P.createGeometry=function(y){const d=y._positions,u=y._colors,f=y._colorsPerVertex,h=y._arcType,C=y._granularity,g=y._ellipsoid,T=p.CesiumMath.chordLength(C,g.maximumRadius),P=e.defined(u)&&!f;let E;const b=d.length;let k,D,G,L,w=0;if(h===t.ArcType.GEODESIC||h===t.ArcType.RHUMB){let o,l,n;h===t.ArcType.GEODESIC?(o=p.CesiumMath.chordLength(C,g.maximumRadius),l=c.PolylinePipeline.numberOfPoints,n=c.PolylinePipeline.generateArc):(o=C,l=c.PolylinePipeline.numberOfPointsRhumbLine,n=c.PolylinePipeline.generateRhumbArc);const i=c.PolylinePipeline.extractHeights(d,g),a=B;if(h===t.ArcType.GEODESIC?a.minDistance=T:a.granularity=C,a.ellipsoid=g,P){let t=0;for(E=0;E<b-1;E++)t+=l(d[E],d[E+1],o)+1;k=new Float64Array(3*t),G=new Uint8Array(4*t),a.positions=_,a.height=A;let s=0;for(E=0;E<b-1;++E){_[0]=d[E],_[1]=d[E+1],A[0]=i[E],A[1]=i[E+1];const o=n(a);if(e.defined(u)){const e=o.length/3;L=u[E];for(let o=0;o<e;++o)G[s++]=r.Color.floatToByte(L.red),G[s++]=r.Color.floatToByte(L.green),G[s++]=r.Color.floatToByte(L.blue),G[s++]=r.Color.floatToByte(L.alpha)}k.set(o,w),w+=o.length}}else if(a.positions=d,a.height=i,k=new Float64Array(n(a)),e.defined(u)){for(G=new Uint8Array(k.length/3*4),E=0;E<b-1;++E){w=m(d[E],d[E+1],u[E],u[E+1],T,G,w)}const e=u[b-1];G[w++]=r.Color.floatToByte(e.red),G[w++]=r.Color.floatToByte(e.green),G[w++]=r.Color.floatToByte(e.blue),G[w++]=r.Color.floatToByte(e.alpha)}}else{D=P?2*b-2:b,k=new Float64Array(3*D),G=e.defined(u)?new Uint8Array(4*D):void 0;let t=0,l=0;for(E=0;E<b;++E){const n=d[E];if(P&&E>0&&(o.Cartesian3.pack(n,k,t),t+=3,L=u[E-1],G[l++]=r.Color.floatToByte(L.red),G[l++]=r.Color.floatToByte(L.green),G[l++]=r.Color.floatToByte(L.blue),G[l++]=r.Color.floatToByte(L.alpha)),P&&E===b-1)break;o.Cartesian3.pack(n,k,t),t+=3,e.defined(u)&&(L=u[E],G[l++]=r.Color.floatToByte(L.red),G[l++]=r.Color.floatToByte(L.green),G[l++]=r.Color.floatToByte(L.blue),G[l++]=r.Color.floatToByte(L.alpha))}}const V=new a.GeometryAttributes;V.position=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),e.defined(u)&&(V.color=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0})),D=k.length/3;const x=2*(D-1),S=s.IndexDatatype.createTypedArray(D,x);let I=0;for(E=0;E<D-1;++E)S[I++]=E,S[I++]=E+1;return new i.Geometry({attributes:V,indices:S,primitiveType:i.PrimitiveType.LINES,boundingSphere:l.BoundingSphere.fromPoints(d)})},function(t,l){return e.defined(l)&&(t=P.unpack(t,l)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),P.createGeometry(t)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./ArcType-26a3f38d","./Transforms-f17097e5","./Color-d89a2fad","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./IndexDatatype-a9b1bc18","./Math-355606c6","./PolylinePipeline-8df321dd","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,o,t,l,r,n,i,a,s,p,c,y,d,u,f,h,C,g,T){"use strict";function m(e,o,t,l,n,i,a){const s=c.PolylinePipeline.numberOfPoints(e,o,n);let p;const y=t.red,d=t.green,u=t.blue,f=t.alpha,h=l.red,C=l.green,g=l.blue,T=l.alpha;if(r.Color.equals(t,l)){for(p=0;p<s;p++)i[a++]=r.Color.floatToByte(y),i[a++]=r.Color.floatToByte(d),i[a++]=r.Color.floatToByte(u),i[a++]=r.Color.floatToByte(f);return a}const m=(h-y)/s,P=(C-d)/s,_=(g-u)/s,A=(T-f)/s;let B=a;for(p=0;p<s;p++)i[B++]=r.Color.floatToByte(y+p*m),i[B++]=r.Color.floatToByte(d+p*P),i[B++]=r.Color.floatToByte(u+p*_),i[B++]=r.Color.floatToByte(f+p*A);return B}function P(l){const n=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,i=l.colors,a=e.defaultValue(l.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=a,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,p.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let s=1+n.length*o.Cartesian3.packedLength;s+=e.defined(i)?1+i.length*r.Color.packedLength:1,this.packedLength=s+o.Ellipsoid.packedLength+3}P.pack=function(t,l,n){let i;n=e.defaultValue(n,0);const a=t._positions;let s=a.length;for(l[n++]=s,i=0;i<s;++i,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(a[i],l,n);const p=t._colors;for(s=e.defined(p)?p.length:0,l[n++]=s,i=0;i<s;++i,n+=r.Color.packedLength)r.Color.pack(p[i],l,n);return o.Ellipsoid.pack(t._ellipsoid,l,n),n+=o.Ellipsoid.packedLength,l[n++]=t._colorsPerVertex?1:0,l[n++]=t._arcType,l[n]=t._granularity,l},P.unpack=function(t,l,n){let i;l=e.defaultValue(l,0);let a=t[l++];const s=new Array(a);for(i=0;i<a;++i,l+=o.Cartesian3.packedLength)s[i]=o.Cartesian3.unpack(t,l);a=t[l++];const p=a>0?new Array(a):void 0;for(i=0;i<a;++i,l+=r.Color.packedLength)p[i]=r.Color.unpack(t,l);const c=o.Ellipsoid.unpack(t,l);l+=o.Ellipsoid.packedLength;const y=1===t[l++],d=t[l++],u=t[l];return e.defined(n)?(n._positions=s,n._colors=p,n._ellipsoid=c,n._colorsPerVertex=y,n._arcType=d,n._granularity=u,n):new P({positions:s,colors:p,ellipsoid:c,colorsPerVertex:y,arcType:d,granularity:u})};const _=new Array(2),A=new Array(2),B={positions:_,height:A,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return P.createGeometry=function(y){const d=y._positions,u=y._colors,f=y._colorsPerVertex,h=y._arcType,C=y._granularity,g=y._ellipsoid,T=p.CesiumMath.chordLength(C,g.maximumRadius),P=e.defined(u)&&!f;let E;const b=d.length;let k,D,G,L,w=0;if(h===t.ArcType.GEODESIC||h===t.ArcType.RHUMB){let o,l,n;h===t.ArcType.GEODESIC?(o=p.CesiumMath.chordLength(C,g.maximumRadius),l=c.PolylinePipeline.numberOfPoints,n=c.PolylinePipeline.generateArc):(o=C,l=c.PolylinePipeline.numberOfPointsRhumbLine,n=c.PolylinePipeline.generateRhumbArc);const i=c.PolylinePipeline.extractHeights(d,g),a=B;if(h===t.ArcType.GEODESIC?a.minDistance=T:a.granularity=C,a.ellipsoid=g,P){let t=0;for(E=0;E<b-1;E++)t+=l(d[E],d[E+1],o)+1;k=new Float64Array(3*t),G=new Uint8Array(4*t),a.positions=_,a.height=A;let s=0;for(E=0;E<b-1;++E){_[0]=d[E],_[1]=d[E+1],A[0]=i[E],A[1]=i[E+1];const o=n(a);if(e.defined(u)){const e=o.length/3;L=u[E];for(let o=0;o<e;++o)G[s++]=r.Color.floatToByte(L.red),G[s++]=r.Color.floatToByte(L.green),G[s++]=r.Color.floatToByte(L.blue),G[s++]=r.Color.floatToByte(L.alpha)}k.set(o,w),w+=o.length}}else if(a.positions=d,a.height=i,k=new Float64Array(n(a)),e.defined(u)){for(G=new Uint8Array(k.length/3*4),E=0;E<b-1;++E){w=m(d[E],d[E+1],u[E],u[E+1],T,G,w)}const e=u[b-1];G[w++]=r.Color.floatToByte(e.red),G[w++]=r.Color.floatToByte(e.green),G[w++]=r.Color.floatToByte(e.blue),G[w++]=r.Color.floatToByte(e.alpha)}}else{D=P?2*b-2:b,k=new Float64Array(3*D),G=e.defined(u)?new Uint8Array(4*D):void 0;let t=0,l=0;for(E=0;E<b;++E){const n=d[E];if(P&&E>0&&(o.Cartesian3.pack(n,k,t),t+=3,L=u[E-1],G[l++]=r.Color.floatToByte(L.red),G[l++]=r.Color.floatToByte(L.green),G[l++]=r.Color.floatToByte(L.blue),G[l++]=r.Color.floatToByte(L.alpha)),P&&E===b-1)break;o.Cartesian3.pack(n,k,t),t+=3,e.defined(u)&&(L=u[E],G[l++]=r.Color.floatToByte(L.red),G[l++]=r.Color.floatToByte(L.green),G[l++]=r.Color.floatToByte(L.blue),G[l++]=r.Color.floatToByte(L.alpha))}}const V=new a.GeometryAttributes;V.position=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),e.defined(u)&&(V.color=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0})),D=k.length/3;const x=2*(D-1),S=s.IndexDatatype.createTypedArray(D,x);let I=0;for(E=0;E<D-1;++E)S[I++]=E,S[I++]=E+1;return new i.Geometry({attributes:V,indices:S,primitiveType:i.PrimitiveType.LINES,boundingSphere:l.BoundingSphere.fromPoints(d)})},function(t,l){return e.defined(l)&&(t=P.unpack(t,l)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),P.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createSphereGeometry.js b/public/lib/Cesium/Workers/createSphereGeometry.js index 6d5c4e36..dee23044 100644 --- a/public/lib/Cesium/Workers/createSphereGeometry.js +++ b/public/lib/Cesium/Workers/createSphereGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./EllipsoidGeometry-e261a196","./VertexFormat-fbdec922","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d"],(function(e,t,i,r,o,a,n,s,l,c,m,d,u,p,y){"use strict";function G(r){const o=e.defaultValue(r.radius,1),a={radii:new t.Cartesian3(o,o,o),stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,vertexFormat:r.vertexFormat};this._ellipsoidGeometry=new i.EllipsoidGeometry(a),this._workerName="createSphereGeometry"}G.packedLength=i.EllipsoidGeometry.packedLength,G.pack=function(e,t,r){return i.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,r)};const f=new i.EllipsoidGeometry,k={radius:void 0,radii:new t.Cartesian3,vertexFormat:new r.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return G.unpack=function(o,a,n){const s=i.EllipsoidGeometry.unpack(o,a,f);return k.vertexFormat=r.VertexFormat.clone(s._vertexFormat,k.vertexFormat),k.stackPartitions=s._stackPartitions,k.slicePartitions=s._slicePartitions,e.defined(n)?(t.Cartesian3.clone(s._radii,k.radii),n._ellipsoidGeometry=new i.EllipsoidGeometry(k),n):(k.radius=s._radii.x,new G(k))},G.createGeometry=function(e){return i.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(t,i){return e.defined(i)&&(t=G.unpack(t,i)),G.createGeometry(t)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./EllipsoidGeometry-ad4c3540","./VertexFormat-fbdec922","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18"],(function(e,t,i,r,o,a,n,s,l,c,m,d,u,p,y){"use strict";function G(r){const o=e.defaultValue(r.radius,1),a={radii:new t.Cartesian3(o,o,o),stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,vertexFormat:r.vertexFormat};this._ellipsoidGeometry=new i.EllipsoidGeometry(a),this._workerName="createSphereGeometry"}G.packedLength=i.EllipsoidGeometry.packedLength,G.pack=function(e,t,r){return i.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,r)};const f=new i.EllipsoidGeometry,k={radius:void 0,radii:new t.Cartesian3,vertexFormat:new r.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return G.unpack=function(o,a,n){const s=i.EllipsoidGeometry.unpack(o,a,f);return k.vertexFormat=r.VertexFormat.clone(s._vertexFormat,k.vertexFormat),k.stackPartitions=s._stackPartitions,k.slicePartitions=s._slicePartitions,e.defined(n)?(t.Cartesian3.clone(s._radii,k.radii),n._ellipsoidGeometry=new i.EllipsoidGeometry(k),n):(k.radius=s._radii.x,new G(k))},G.createGeometry=function(e){return i.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(t,i){return e.defined(i)&&(t=G.unpack(t,i)),G.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/createSphereOutlineGeometry.js b/public/lib/Cesium/Workers/createSphereOutlineGeometry.js index 6a1bc99d..3a162b84 100644 --- a/public/lib/Cesium/Workers/createSphereOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createSphereOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./EllipsoidOutlineGeometry-1242f733","./Math-2ce22ee9","./Transforms-b3716b06","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-d3db4e7d"],(function(i,e,t,n,r,o,s,a,l,u,d,c,m,p){"use strict";function y(n){const r=i.defaultValue(n.radius,1),o={radii:new e.Cartesian3(r,r,r),stackPartitions:n.stackPartitions,slicePartitions:n.slicePartitions,subdivisions:n.subdivisions};this._ellipsoidGeometry=new t.EllipsoidOutlineGeometry(o),this._workerName="createSphereOutlineGeometry"}y.packedLength=t.EllipsoidOutlineGeometry.packedLength,y.pack=function(i,e,n){return t.EllipsoidOutlineGeometry.pack(i._ellipsoidGeometry,e,n)};const G=new t.EllipsoidOutlineGeometry,f={radius:void 0,radii:new e.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return y.unpack=function(n,r,o){const s=t.EllipsoidOutlineGeometry.unpack(n,r,G);return f.stackPartitions=s._stackPartitions,f.slicePartitions=s._slicePartitions,f.subdivisions=s._subdivisions,i.defined(o)?(e.Cartesian3.clone(s._radii,f.radii),o._ellipsoidGeometry=new t.EllipsoidOutlineGeometry(f),o):(f.radius=s._radii.x,new y(f))},y.createGeometry=function(i){return t.EllipsoidOutlineGeometry.createGeometry(i._ellipsoidGeometry)},function(e,t){return i.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./EllipsoidOutlineGeometry-52005f3f","./Math-355606c6","./Transforms-f17097e5","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./IndexDatatype-a9b1bc18"],(function(i,e,t,n,r,o,s,a,l,u,d,c,m,p){"use strict";function y(n){const r=i.defaultValue(n.radius,1),o={radii:new e.Cartesian3(r,r,r),stackPartitions:n.stackPartitions,slicePartitions:n.slicePartitions,subdivisions:n.subdivisions};this._ellipsoidGeometry=new t.EllipsoidOutlineGeometry(o),this._workerName="createSphereOutlineGeometry"}y.packedLength=t.EllipsoidOutlineGeometry.packedLength,y.pack=function(i,e,n){return t.EllipsoidOutlineGeometry.pack(i._ellipsoidGeometry,e,n)};const G=new t.EllipsoidOutlineGeometry,f={radius:void 0,radii:new e.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return y.unpack=function(n,r,o){const s=t.EllipsoidOutlineGeometry.unpack(n,r,G);return f.stackPartitions=s._stackPartitions,f.slicePartitions=s._slicePartitions,f.subdivisions=s._subdivisions,i.defined(o)?(e.Cartesian3.clone(s._radii,f.radii),o._ellipsoidGeometry=new t.EllipsoidOutlineGeometry(f),o):(f.radius=s._radii.x,new y(f))},y.createGeometry=function(i){return t.EllipsoidOutlineGeometry.createGeometry(i._ellipsoidGeometry)},function(e,t){return i.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}})); diff --git a/public/lib/Cesium/Workers/createVectorTileClampedPolylines.js b/public/lib/Cesium/Workers/createVectorTileClampedPolylines.js index 58c1529f..4140dfbf 100644 --- a/public/lib/Cesium/Workers/createVectorTileClampedPolylines.js +++ b/public/lib/Cesium/Workers/createVectorTileClampedPolylines.js @@ -1 +1 @@ -define(["./AttributeCompression-48e336db","./Matrix3-81054f0f","./combine-0c102d93","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./Matrix2-413c4048","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(t,e,a,s,n,r,i,o,l,c,d){"use strict";const f=32767,u=Math.cos(n.CesiumMath.toRadians(150)),h=new e.Cartographic,C=new e.Cartesian3;const p=new e.Cartographic,m=new e.Cartographic;function A(t){const e=8*t,a=3*e,n=4*e;this.startEllipsoidNormals=new Float32Array(a),this.endEllipsoidNormals=new Float32Array(a),this.startPositionAndHeights=new Float32Array(n),this.startFaceNormalAndVertexCornerIds=new Float32Array(n),this.endPositionAndHeights=new Float32Array(n),this.endFaceNormalAndHalfWidths=new Float32Array(n),this.vertexBatchIds=new Uint16Array(e),this.indices=s.IndexDatatype.createTypedArray(e,36*t),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}const b=new e.Cartesian3,w=new e.Cartesian3;function g(t,a,s,n,r){const i=e.Cartesian3.subtract(s,a,w);let o=e.Cartesian3.subtract(a,t,b);return e.Cartesian3.normalize(i,i),e.Cartesian3.normalize(o,o),e.Cartesian3.dot(i,o)<u&&(o=e.Cartesian3.multiplyByScalar(o,-1,b)),e.Cartesian3.add(i,o,r),e.Cartesian3.equals(r,e.Cartesian3.ZERO)&&(r=e.Cartesian3.subtract(t,a)),e.Cartesian3.cross(r,n,r),e.Cartesian3.cross(n,r,r),e.Cartesian3.normalize(r,r),r}const y=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],N=y.length,k=new e.Cartesian3,x=new e.Cartesian3,I=new e.Cartesian3,E=new e.Cartesian3,F=new e.Cartesian3;A.prototype.addVolume=function(t,a,s,n,r,i,o,l,c,d){let f=e.Cartesian3.add(a,c,k);const u=d.geodeticSurfaceNormal(f,x);f=e.Cartesian3.add(s,c,k);const h=d.geodeticSurfaceNormal(f,E),C=g(t,a,s,u,I),p=g(n,s,a,h,F),m=this.startEllipsoidNormals,A=this.endEllipsoidNormals,b=this.startPositionAndHeights,w=this.startFaceNormalAndVertexCornerIds,H=this.endPositionAndHeights,O=this.endFaceNormalAndHalfWidths,P=this.vertexBatchIds;let v,D=this.batchIdOffset,M=this.vec3Offset,S=this.vec4Offset;for(v=0;v<8;v++)e.Cartesian3.pack(u,m,M),e.Cartesian3.pack(h,A,M),e.Cartesian3.pack(a,b,S),b[S+3]=r,e.Cartesian3.pack(s,H,S),H[S+3]=i,e.Cartesian3.pack(C,w,S),w[S+3]=v,e.Cartesian3.pack(p,O,S),O[S+3]=o,P[D++]=l,M+=3,S+=4;this.batchIdOffset=D,this.vec3Offset=M,this.vec4Offset=S;const R=this.indices,U=this.volumeStartIndex,B=this.indexOffset;for(v=0;v<N;v++)R[B+v]=y[v]+U;this.volumeStartIndex+=8,this.indexOffset+=N};const H=new r.Rectangle,O=new e.Ellipsoid,P=new e.Cartesian3,v=new e.Cartesian3,D=new e.Cartesian3,M=new e.Cartesian3,S=new e.Cartesian3;return i((function(i,o){const l=new Uint16Array(i.positions),c=new Uint16Array(i.widths),d=new Uint32Array(i.counts),u=new Uint16Array(i.batchIds),b=H,w=O,g=P,y=new Float64Array(i.packedBuffer);let N=0;const k=y[N++],x=y[N++];let I;r.Rectangle.unpack(y,N,b),N+=r.Rectangle.packedLength,e.Ellipsoid.unpack(y,N,w),N+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(y,N,g);let E=l.length/3;const F=l.subarray(0,E),R=l.subarray(E,2*E),U=l.subarray(2*E,3*E);t.AttributeCompression.zigZagDeltaDecode(F,R,U),function(t,a,s,n){const r=n.length,i=t.length,o=new Uint8Array(i),l=p,c=m;let d=0;for(let s=0;s<r;s++){const r=n[s];let i=r;for(let s=1;s<r;s++){const n=d+s,r=n-1;c.longitude=t[n],c.latitude=a[n],l.longitude=t[r],l.latitude=a[r],e.Cartographic.equals(c,l)&&(i--,o[r]=1)}n[s]=i,d+=r}let f=0;for(let e=0;e<i;e++)1!==o[e]&&(t[f]=t[e],a[f]=a[e],s[f]=s[e],f++)}(F,R,U,d);const B=d.length;let V=0;for(I=0;I<B;I++){V+=d[I]-1}const T=new A(V),W=function(t,a,s,r,i,o,l){const c=t.length,d=new Float64Array(3*c);for(let u=0;u<c;++u){const c=t[u],p=a[u],m=s[u],A=n.CesiumMath.lerp(r.west,r.east,c/f),b=n.CesiumMath.lerp(r.south,r.north,p/f),w=n.CesiumMath.lerp(i,o,m/f),g=e.Cartographic.fromRadians(A,b,w,h),y=l.cartographicToCartesian(g,C);e.Cartesian3.pack(y,d,3*u)}return d}(F,R,U,b,k,x,w);E=F.length;const z=new Float32Array(3*E);for(I=0;I<E;++I)z[3*I]=W[3*I]-g.x,z[3*I+1]=W[3*I+1]-g.y,z[3*I+2]=W[3*I+2]-g.z;let q=0,L=0;for(I=0;I<B;I++){const t=d[I]-1,a=.5*c[I],s=u[I],r=q;for(let i=0;i<t;i++){const o=e.Cartesian3.unpack(z,q,D),l=e.Cartesian3.unpack(z,q+3,M);let c=U[L],d=U[L+1];c=n.CesiumMath.lerp(k,x,c/f),d=n.CesiumMath.lerp(k,x,d/f),L++;let u=v,h=S;if(0===i){const a=r+3*t,s=e.Cartesian3.unpack(z,a,v);if(e.Cartesian3.equals(s,o))e.Cartesian3.unpack(z,a-3,u);else{const t=e.Cartesian3.subtract(o,l,v);u=e.Cartesian3.add(t,o,v)}}else e.Cartesian3.unpack(z,q-3,u);if(i===t-1){const t=e.Cartesian3.unpack(z,r,S);if(e.Cartesian3.equals(t,l))e.Cartesian3.unpack(z,r+3,h);else{const t=e.Cartesian3.subtract(l,o,S);h=e.Cartesian3.add(t,l,S)}}else e.Cartesian3.unpack(z,q+6,h);T.addVolume(u,o,l,h,c,d,a,s,g,w),q+=3}q+=3,L++}const _=T.indices;o.push(T.startEllipsoidNormals.buffer),o.push(T.endEllipsoidNormals.buffer),o.push(T.startPositionAndHeights.buffer),o.push(T.startFaceNormalAndVertexCornerIds.buffer),o.push(T.endPositionAndHeights.buffer),o.push(T.endFaceNormalAndHalfWidths.buffer),o.push(T.vertexBatchIds.buffer),o.push(_.buffer);let G={indexDatatype:2===_.BYTES_PER_ELEMENT?s.IndexDatatype.UNSIGNED_SHORT:s.IndexDatatype.UNSIGNED_INT,startEllipsoidNormals:T.startEllipsoidNormals.buffer,endEllipsoidNormals:T.endEllipsoidNormals.buffer,startPositionAndHeights:T.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:T.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:T.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:T.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:T.vertexBatchIds.buffer,indices:_.buffer};if(i.keepDecodedPositions){const t=function(t){const e=t.length,a=new Uint32Array(e+1);let s=0;for(let n=0;n<e;++n)a[n]=s,s+=t[n];return a[e]=s,a}(d);o.push(W.buffer,t.buffer),G=a.combine(G,{decodedPositions:W.buffer,decodedPositionOffsets:t.buffer})}return G}))})); +define(["./AttributeCompression-0b8f7b7d","./Matrix3-b2351961","./combine-0c102d93","./IndexDatatype-a9b1bc18","./Math-355606c6","./Matrix2-7a8e9daf","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(t,e,a,s,n,r,i,o,l,c,d){"use strict";const f=32767,u=Math.cos(n.CesiumMath.toRadians(150)),h=new e.Cartographic,C=new e.Cartesian3;const p=new e.Cartographic,m=new e.Cartographic;function A(t){const e=8*t,a=3*e,n=4*e;this.startEllipsoidNormals=new Float32Array(a),this.endEllipsoidNormals=new Float32Array(a),this.startPositionAndHeights=new Float32Array(n),this.startFaceNormalAndVertexCornerIds=new Float32Array(n),this.endPositionAndHeights=new Float32Array(n),this.endFaceNormalAndHalfWidths=new Float32Array(n),this.vertexBatchIds=new Uint16Array(e),this.indices=s.IndexDatatype.createTypedArray(e,36*t),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}const b=new e.Cartesian3,w=new e.Cartesian3;function g(t,a,s,n,r){const i=e.Cartesian3.subtract(s,a,w);let o=e.Cartesian3.subtract(a,t,b);return e.Cartesian3.normalize(i,i),e.Cartesian3.normalize(o,o),e.Cartesian3.dot(i,o)<u&&(o=e.Cartesian3.multiplyByScalar(o,-1,b)),e.Cartesian3.add(i,o,r),e.Cartesian3.equals(r,e.Cartesian3.ZERO)&&(r=e.Cartesian3.subtract(t,a)),e.Cartesian3.cross(r,n,r),e.Cartesian3.cross(n,r,r),e.Cartesian3.normalize(r,r),r}const y=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],N=y.length,k=new e.Cartesian3,x=new e.Cartesian3,I=new e.Cartesian3,E=new e.Cartesian3,F=new e.Cartesian3;A.prototype.addVolume=function(t,a,s,n,r,i,o,l,c,d){let f=e.Cartesian3.add(a,c,k);const u=d.geodeticSurfaceNormal(f,x);f=e.Cartesian3.add(s,c,k);const h=d.geodeticSurfaceNormal(f,E),C=g(t,a,s,u,I),p=g(n,s,a,h,F),m=this.startEllipsoidNormals,A=this.endEllipsoidNormals,b=this.startPositionAndHeights,w=this.startFaceNormalAndVertexCornerIds,H=this.endPositionAndHeights,O=this.endFaceNormalAndHalfWidths,P=this.vertexBatchIds;let v,D=this.batchIdOffset,M=this.vec3Offset,S=this.vec4Offset;for(v=0;v<8;v++)e.Cartesian3.pack(u,m,M),e.Cartesian3.pack(h,A,M),e.Cartesian3.pack(a,b,S),b[S+3]=r,e.Cartesian3.pack(s,H,S),H[S+3]=i,e.Cartesian3.pack(C,w,S),w[S+3]=v,e.Cartesian3.pack(p,O,S),O[S+3]=o,P[D++]=l,M+=3,S+=4;this.batchIdOffset=D,this.vec3Offset=M,this.vec4Offset=S;const R=this.indices,U=this.volumeStartIndex,B=this.indexOffset;for(v=0;v<N;v++)R[B+v]=y[v]+U;this.volumeStartIndex+=8,this.indexOffset+=N};const H=new r.Rectangle,O=new e.Ellipsoid,P=new e.Cartesian3,v=new e.Cartesian3,D=new e.Cartesian3,M=new e.Cartesian3,S=new e.Cartesian3;return i((function(i,o){const l=new Uint16Array(i.positions),c=new Uint16Array(i.widths),d=new Uint32Array(i.counts),u=new Uint16Array(i.batchIds),b=H,w=O,g=P,y=new Float64Array(i.packedBuffer);let N=0;const k=y[N++],x=y[N++];let I;r.Rectangle.unpack(y,N,b),N+=r.Rectangle.packedLength,e.Ellipsoid.unpack(y,N,w),N+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(y,N,g);let E=l.length/3;const F=l.subarray(0,E),R=l.subarray(E,2*E),U=l.subarray(2*E,3*E);t.AttributeCompression.zigZagDeltaDecode(F,R,U),function(t,a,s,n){const r=n.length,i=t.length,o=new Uint8Array(i),l=p,c=m;let d=0;for(let s=0;s<r;s++){const r=n[s];let i=r;for(let s=1;s<r;s++){const n=d+s,r=n-1;c.longitude=t[n],c.latitude=a[n],l.longitude=t[r],l.latitude=a[r],e.Cartographic.equals(c,l)&&(i--,o[r]=1)}n[s]=i,d+=r}let f=0;for(let e=0;e<i;e++)1!==o[e]&&(t[f]=t[e],a[f]=a[e],s[f]=s[e],f++)}(F,R,U,d);const B=d.length;let V=0;for(I=0;I<B;I++){V+=d[I]-1}const T=new A(V),W=function(t,a,s,r,i,o,l){const c=t.length,d=new Float64Array(3*c);for(let u=0;u<c;++u){const c=t[u],p=a[u],m=s[u],A=n.CesiumMath.lerp(r.west,r.east,c/f),b=n.CesiumMath.lerp(r.south,r.north,p/f),w=n.CesiumMath.lerp(i,o,m/f),g=e.Cartographic.fromRadians(A,b,w,h),y=l.cartographicToCartesian(g,C);e.Cartesian3.pack(y,d,3*u)}return d}(F,R,U,b,k,x,w);E=F.length;const z=new Float32Array(3*E);for(I=0;I<E;++I)z[3*I]=W[3*I]-g.x,z[3*I+1]=W[3*I+1]-g.y,z[3*I+2]=W[3*I+2]-g.z;let q=0,L=0;for(I=0;I<B;I++){const t=d[I]-1,a=.5*c[I],s=u[I],r=q;for(let i=0;i<t;i++){const o=e.Cartesian3.unpack(z,q,D),l=e.Cartesian3.unpack(z,q+3,M);let c=U[L],d=U[L+1];c=n.CesiumMath.lerp(k,x,c/f),d=n.CesiumMath.lerp(k,x,d/f),L++;let u=v,h=S;if(0===i){const a=r+3*t,s=e.Cartesian3.unpack(z,a,v);if(e.Cartesian3.equals(s,o))e.Cartesian3.unpack(z,a-3,u);else{const t=e.Cartesian3.subtract(o,l,v);u=e.Cartesian3.add(t,o,v)}}else e.Cartesian3.unpack(z,q-3,u);if(i===t-1){const t=e.Cartesian3.unpack(z,r,S);if(e.Cartesian3.equals(t,l))e.Cartesian3.unpack(z,r+3,h);else{const t=e.Cartesian3.subtract(l,o,S);h=e.Cartesian3.add(t,l,S)}}else e.Cartesian3.unpack(z,q+6,h);T.addVolume(u,o,l,h,c,d,a,s,g,w),q+=3}q+=3,L++}const _=T.indices;o.push(T.startEllipsoidNormals.buffer),o.push(T.endEllipsoidNormals.buffer),o.push(T.startPositionAndHeights.buffer),o.push(T.startFaceNormalAndVertexCornerIds.buffer),o.push(T.endPositionAndHeights.buffer),o.push(T.endFaceNormalAndHalfWidths.buffer),o.push(T.vertexBatchIds.buffer),o.push(_.buffer);let G={indexDatatype:2===_.BYTES_PER_ELEMENT?s.IndexDatatype.UNSIGNED_SHORT:s.IndexDatatype.UNSIGNED_INT,startEllipsoidNormals:T.startEllipsoidNormals.buffer,endEllipsoidNormals:T.endEllipsoidNormals.buffer,startPositionAndHeights:T.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:T.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:T.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:T.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:T.vertexBatchIds.buffer,indices:_.buffer};if(i.keepDecodedPositions){const t=function(t){const e=t.length,a=new Uint32Array(e+1);let s=0;for(let n=0;n<e;++n)a[n]=s,s+=t[n];return a[e]=s,a}(d);o.push(W.buffer,t.buffer),G=a.combine(G,{decodedPositions:W.buffer,decodedPositionOffsets:t.buffer})}return G}))})); diff --git a/public/lib/Cesium/Workers/createVectorTileGeometries.js b/public/lib/Cesium/Workers/createVectorTileGeometries.js index abc74e81..08473192 100644 --- a/public/lib/Cesium/Workers/createVectorTileGeometries.js +++ b/public/lib/Cesium/Workers/createVectorTileGeometries.js @@ -1 +1 @@ -define(["./Transforms-b3716b06","./BoxGeometry-0a50f4ca","./Matrix3-81054f0f","./Color-9ff9e611","./CylinderGeometry-a492df0d","./defaultValue-f6d5e6da","./EllipsoidGeometry-e261a196","./IndexDatatype-d3db4e7d","./Matrix2-413c4048","./createTaskProcessorWorker","./Math-2ce22ee9","./combine-0c102d93","./RuntimeError-9b4ce3fb","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922","./CylinderGeometryLibrary-f49f33a8"],(function(e,t,n,r,i,a,o,s,d,c,l,f,u,h,p,b,y,x,g,m){"use strict";function C(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const I=new n.Cartesian3,k=d.Matrix4.packedLength+n.Cartesian3.packedLength,M=d.Matrix4.packedLength+2,B=d.Matrix4.packedLength+n.Cartesian3.packedLength,w=n.Cartesian3.packedLength+1,A={modelMatrix:new d.Matrix4,boundingVolume:new e.BoundingSphere};function O(e,t){let r=t*k;const i=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const a=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(a,i,a);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),A}function L(e,t){let r=t*M;const i=e[r++],a=e[r++],o=n.Cartesian3.fromElements(i,i,a,I),s=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(s,o,s);const c=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,c.center),c.radius=Math.sqrt(2),A}function v(e,t){let r=t*B;const i=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const a=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(a,i,a);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,A}function E(e,t){let r=t*w;const i=e[r++],a=n.Cartesian3.unpack(e,r,I),o=d.Matrix4.fromTranslation(a,A.modelMatrix);d.Matrix4.multiplyByUniformScale(o,i,o);const s=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,A}const U=new n.Cartesian3;function G(t,i,o,s,c){if(!a.defined(i))return;const l=o.length,f=s.attributes.position.values,u=s.indices,h=t.positions,p=t.vertexBatchIds,b=t.indices,y=t.batchIds,x=t.batchTableColors,g=t.batchedIndices,m=t.indexOffsets,I=t.indexCounts,k=t.boundingVolumes,M=t.modelMatrix,B=t.center;let w=t.positionOffset,A=t.batchIdIndex,O=t.indexOffset;const L=t.batchedIndicesOffset;for(let t=0;t<l;++t){const a=c(i,t),s=a.modelMatrix;d.Matrix4.multiply(M,s,s);const l=o[t],v=f.length;for(let e=0;e<v;e+=3){const t=n.Cartesian3.unpack(f,e,U);d.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,B,t),n.Cartesian3.pack(t,h,3*w+e),p[A++]=l}const E=u.length;for(let e=0;e<E;++e)b[O+e]=u[e]+w;const G=t+L;g[G]=new C({offset:O,count:E,color:r.Color.fromRgba(x[l]),batchIds:[l]}),y[G]=l,m[G]=O,I[G]=E,k[G]=e.BoundingSphere.transform(a.boundingVolume,s),w+=v/3,O+=E}t.positionOffset=w,t.batchIdIndex=A,t.indexOffset=O,t.batchedIndicesOffset+=l}const S=new n.Cartesian3,V=new d.Matrix4;function F(t,n,i){const a=i.length,o=2+a*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let i=0;i<t;++i)n+=r.Color.packedLength+3+e[i].batchIds.length;return n}(n),s=new Float64Array(o);let d=0;s[d++]=t,s[d++]=a;for(let t=0;t<a;++t)e.BoundingSphere.pack(i[t],s,d),d+=e.BoundingSphere.packedLength;const c=n.length;s[d++]=c;for(let e=0;e<c;++e){const t=n[e];r.Color.pack(t.color,s,d),d+=r.Color.packedLength,s[d++]=t.offset,s[d++]=t.count;const i=t.batchIds,a=i.length;s[d++]=a;for(let e=0;e<a;++e)s[d++]=i[e]}return s}return c((function(e,r){const c=a.defined(e.boxes)?new Float32Array(e.boxes):void 0,l=a.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,f=a.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,u=a.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,h=a.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,p=a.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,b=a.defined(e.spheres)?new Float32Array(e.spheres):void 0,y=a.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,x=a.defined(c)?l.length:0,g=a.defined(f)?u.length:0,m=a.defined(h)?p.length:0,C=a.defined(b)?y.length:0,I=t.BoxGeometry.getUnitBox(),k=i.CylinderGeometry.getUnitCylinder(),M=o.EllipsoidGeometry.getUnitEllipsoid(),B=I.attributes.position.values,w=k.attributes.position.values,A=M.attributes.position.values;let U=B.length*x;U+=w.length*g,U+=A.length*(m+C);const T=I.indices,R=k.indices,Z=M.indices;let D=T.length*x;D+=R.length*g,D+=Z.length*(m+C);const P=new Float32Array(U),q=new Uint16Array(U/3),W=s.IndexDatatype.createTypedArray(U/3,D),_=x+g+m+C,H=new Uint16Array(_),K=new Array(_),N=new Uint32Array(_),Y=new Uint32Array(_),j=new Array(_);!function(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,S),r+=n.Cartesian3.packedLength,d.Matrix4.unpack(t,r,V)}(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:P,vertexBatchIds:q,indices:W,batchIds:H,batchedIndices:K,indexOffsets:N,indexCounts:Y,boundingVolumes:j,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:V,center:S};G(z,c,l,I,O),G(z,f,u,k,L),G(z,h,p,M,v),G(z,b,y,M,E);const J=F(W.BYTES_PER_ELEMENT,K,j);return r.push(P.buffer,q.buffer,W.buffer),r.push(H.buffer,N.buffer,Y.buffer),r.push(J.buffer),{positions:P.buffer,vertexBatchIds:q.buffer,indices:W.buffer,indexOffsets:N.buffer,indexCounts:Y.buffer,batchIds:H.buffer,packedBuffer:J.buffer}}))})); +define(["./Transforms-f17097e5","./BoxGeometry-bbe159e0","./Matrix3-b2351961","./Color-d89a2fad","./CylinderGeometry-25b4eb3a","./defaultValue-f6d5e6da","./EllipsoidGeometry-ad4c3540","./IndexDatatype-a9b1bc18","./Matrix2-7a8e9daf","./createTaskProcessorWorker","./Math-355606c6","./combine-0c102d93","./RuntimeError-9b4ce3fb","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./GeometryOffsetAttribute-2579b8d2","./VertexFormat-fbdec922","./CylinderGeometryLibrary-4d7f606d"],(function(e,t,n,r,i,a,o,s,d,c,l,f,u,h,p,b,y,x,g,m){"use strict";function C(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const I=new n.Cartesian3,k=d.Matrix4.packedLength+n.Cartesian3.packedLength,M=d.Matrix4.packedLength+2,B=d.Matrix4.packedLength+n.Cartesian3.packedLength,w=n.Cartesian3.packedLength+1,A={modelMatrix:new d.Matrix4,boundingVolume:new e.BoundingSphere};function O(e,t){let r=t*k;const i=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const a=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(a,i,a);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),A}function L(e,t){let r=t*M;const i=e[r++],a=e[r++],o=n.Cartesian3.fromElements(i,i,a,I),s=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(s,o,s);const c=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,c.center),c.radius=Math.sqrt(2),A}function v(e,t){let r=t*B;const i=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const a=d.Matrix4.unpack(e,r,A.modelMatrix);d.Matrix4.multiplyByScale(a,i,a);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,A}function E(e,t){let r=t*w;const i=e[r++],a=n.Cartesian3.unpack(e,r,I),o=d.Matrix4.fromTranslation(a,A.modelMatrix);d.Matrix4.multiplyByUniformScale(o,i,o);const s=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,A}const U=new n.Cartesian3;function G(t,i,o,s,c){if(!a.defined(i))return;const l=o.length,f=s.attributes.position.values,u=s.indices,h=t.positions,p=t.vertexBatchIds,b=t.indices,y=t.batchIds,x=t.batchTableColors,g=t.batchedIndices,m=t.indexOffsets,I=t.indexCounts,k=t.boundingVolumes,M=t.modelMatrix,B=t.center;let w=t.positionOffset,A=t.batchIdIndex,O=t.indexOffset;const L=t.batchedIndicesOffset;for(let t=0;t<l;++t){const a=c(i,t),s=a.modelMatrix;d.Matrix4.multiply(M,s,s);const l=o[t],v=f.length;for(let e=0;e<v;e+=3){const t=n.Cartesian3.unpack(f,e,U);d.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,B,t),n.Cartesian3.pack(t,h,3*w+e),p[A++]=l}const E=u.length;for(let e=0;e<E;++e)b[O+e]=u[e]+w;const G=t+L;g[G]=new C({offset:O,count:E,color:r.Color.fromRgba(x[l]),batchIds:[l]}),y[G]=l,m[G]=O,I[G]=E,k[G]=e.BoundingSphere.transform(a.boundingVolume,s),w+=v/3,O+=E}t.positionOffset=w,t.batchIdIndex=A,t.indexOffset=O,t.batchedIndicesOffset+=l}const S=new n.Cartesian3,V=new d.Matrix4;function F(t,n,i){const a=i.length,o=2+a*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let i=0;i<t;++i)n+=r.Color.packedLength+3+e[i].batchIds.length;return n}(n),s=new Float64Array(o);let d=0;s[d++]=t,s[d++]=a;for(let t=0;t<a;++t)e.BoundingSphere.pack(i[t],s,d),d+=e.BoundingSphere.packedLength;const c=n.length;s[d++]=c;for(let e=0;e<c;++e){const t=n[e];r.Color.pack(t.color,s,d),d+=r.Color.packedLength,s[d++]=t.offset,s[d++]=t.count;const i=t.batchIds,a=i.length;s[d++]=a;for(let e=0;e<a;++e)s[d++]=i[e]}return s}return c((function(e,r){const c=a.defined(e.boxes)?new Float32Array(e.boxes):void 0,l=a.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,f=a.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,u=a.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,h=a.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,p=a.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,b=a.defined(e.spheres)?new Float32Array(e.spheres):void 0,y=a.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,x=a.defined(c)?l.length:0,g=a.defined(f)?u.length:0,m=a.defined(h)?p.length:0,C=a.defined(b)?y.length:0,I=t.BoxGeometry.getUnitBox(),k=i.CylinderGeometry.getUnitCylinder(),M=o.EllipsoidGeometry.getUnitEllipsoid(),B=I.attributes.position.values,w=k.attributes.position.values,A=M.attributes.position.values;let U=B.length*x;U+=w.length*g,U+=A.length*(m+C);const T=I.indices,R=k.indices,Z=M.indices;let D=T.length*x;D+=R.length*g,D+=Z.length*(m+C);const P=new Float32Array(U),q=new Uint16Array(U/3),W=s.IndexDatatype.createTypedArray(U/3,D),_=x+g+m+C,H=new Uint16Array(_),K=new Array(_),N=new Uint32Array(_),Y=new Uint32Array(_),j=new Array(_);!function(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,S),r+=n.Cartesian3.packedLength,d.Matrix4.unpack(t,r,V)}(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:P,vertexBatchIds:q,indices:W,batchIds:H,batchedIndices:K,indexOffsets:N,indexCounts:Y,boundingVolumes:j,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:V,center:S};G(z,c,l,I,O),G(z,f,u,k,L),G(z,h,p,M,v),G(z,b,y,M,E);const J=F(W.BYTES_PER_ELEMENT,K,j);return r.push(P.buffer,q.buffer,W.buffer),r.push(H.buffer,N.buffer,Y.buffer),r.push(J.buffer),{positions:P.buffer,vertexBatchIds:q.buffer,indices:W.buffer,indexOffsets:N.buffer,indexCounts:Y.buffer,batchIds:H.buffer,packedBuffer:J.buffer}}))})); diff --git a/public/lib/Cesium/Workers/createVectorTilePoints.js b/public/lib/Cesium/Workers/createVectorTilePoints.js index c1a0b006..87d0b1d1 100644 --- a/public/lib/Cesium/Workers/createVectorTilePoints.js +++ b/public/lib/Cesium/Workers/createVectorTilePoints.js @@ -1 +1 @@ -define(["./AttributeCompression-48e336db","./Matrix3-81054f0f","./Math-2ce22ee9","./Matrix2-413c4048","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(e,t,a,r,n,o,i,s,c){"use strict";const u=32767,p=new t.Cartographic,l=new t.Cartesian3,m=new r.Rectangle,f=new t.Ellipsoid,h={min:void 0,max:void 0};return n((function(n,o){const i=new Uint16Array(n.positions);!function(e){e=new Float64Array(e);let a=0;h.min=e[a++],h.max=e[a++],r.Rectangle.unpack(e,a,m),a+=r.Rectangle.packedLength,t.Ellipsoid.unpack(e,a,f)}(n.packedBuffer);const s=m,c=f,C=h.min,g=h.max,d=i.length/3,b=i.subarray(0,d),w=i.subarray(d,2*d),k=i.subarray(2*d,3*d);e.AttributeCompression.zigZagDeltaDecode(b,w,k);const y=new Float64Array(i.length);for(let e=0;e<d;++e){const r=b[e],n=w[e],o=k[e],i=a.CesiumMath.lerp(s.west,s.east,r/u),m=a.CesiumMath.lerp(s.south,s.north,n/u),f=a.CesiumMath.lerp(C,g,o/u),h=t.Cartographic.fromRadians(i,m,f,p),d=c.cartographicToCartesian(h,l);t.Cartesian3.pack(d,y,3*e)}return o.push(y.buffer),{positions:y.buffer}}))})); +define(["./AttributeCompression-0b8f7b7d","./Matrix3-b2351961","./Math-355606c6","./Matrix2-7a8e9daf","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(e,t,a,r,n,o,i,s,c){"use strict";const u=32767,p=new t.Cartographic,l=new t.Cartesian3,m=new r.Rectangle,f=new t.Ellipsoid,h={min:void 0,max:void 0};return n((function(n,o){const i=new Uint16Array(n.positions);!function(e){e=new Float64Array(e);let a=0;h.min=e[a++],h.max=e[a++],r.Rectangle.unpack(e,a,m),a+=r.Rectangle.packedLength,t.Ellipsoid.unpack(e,a,f)}(n.packedBuffer);const s=m,c=f,C=h.min,g=h.max,d=i.length/3,b=i.subarray(0,d),w=i.subarray(d,2*d),k=i.subarray(2*d,3*d);e.AttributeCompression.zigZagDeltaDecode(b,w,k);const y=new Float64Array(i.length);for(let e=0;e<d;++e){const r=b[e],n=w[e],o=k[e],i=a.CesiumMath.lerp(s.west,s.east,r/u),m=a.CesiumMath.lerp(s.south,s.north,n/u),f=a.CesiumMath.lerp(C,g,o/u),h=t.Cartographic.fromRadians(i,m,f,p),d=c.cartographicToCartesian(h,l);t.Cartesian3.pack(d,y,3*e)}return o.push(y.buffer),{positions:y.buffer}}))})); diff --git a/public/lib/Cesium/Workers/createVectorTilePolygons.js b/public/lib/Cesium/Workers/createVectorTilePolygons.js index 66db526c..d503a1bd 100644 --- a/public/lib/Cesium/Workers/createVectorTilePolygons.js +++ b/public/lib/Cesium/Workers/createVectorTilePolygons.js @@ -1 +1 @@ -define(["./AttributeCompression-48e336db","./Matrix3-81054f0f","./Color-9ff9e611","./defaultValue-f6d5e6da","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./OrientedBoundingBox-8446a826","./Matrix2-413c4048","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./Transforms-b3716b06","./combine-0c102d93","./RuntimeError-9b4ce3fb","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,n,a,r,o,i,s,c,f,d,l,u,h,g,p,y,m){"use strict";const b=new t.Cartesian3,x=new t.Ellipsoid,C=new s.Rectangle,I={min:void 0,max:void 0,indexBytesPerElement:void 0};function w(e,t,a){const r=t.length,o=2+r*i.OrientedBoundingBox.packedLength+1+function(e){const t=e.length;let a=0;for(let r=0;r<t;++r)a+=n.Color.packedLength+3+e[r].batchIds.length;return a}(a),s=new Float64Array(o);let c=0;s[c++]=e,s[c++]=r;for(let e=0;e<r;++e)i.OrientedBoundingBox.pack(t[e],s,c),c+=i.OrientedBoundingBox.packedLength;const f=a.length;s[c++]=f;for(let e=0;e<f;++e){const t=a[e];n.Color.pack(t.color,s,c),c+=n.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const r=t.batchIds,o=r.length;s[c++]=o;for(let e=0;e<o;++e)s[c++]=r[e]}return s}const A=32767,E=new t.Cartesian3,N=new t.Cartesian3,T=new t.Cartesian3,B=new t.Cartesian3,k=new t.Cartesian3,L=new t.Cartographic,O=new s.Rectangle;return c((function(c,f){let d;!function(e){const n=new Float64Array(e);let a=0;I.indexBytesPerElement=n[a++],I.min=n[a++],I.max=n[a++],t.Cartesian3.unpack(n,a,b),a+=t.Cartesian3.packedLength,t.Ellipsoid.unpack(n,a,x),a+=t.Ellipsoid.packedLength,s.Rectangle.unpack(n,a,C)}(c.packedBuffer),d=2===I.indexBytesPerElement?new Uint16Array(c.indices):new Uint32Array(c.indices);const l=new Uint16Array(c.positions),u=new Uint32Array(c.counts),h=new Uint32Array(c.indexCounts),g=new Uint32Array(c.batchIds),p=new Uint32Array(c.batchTableColors),y=new Array(u.length),m=b,U=x;let P=C;const F=I.min,M=I.max;let S,D,R,_=c.minimumHeights,G=c.maximumHeights;a.defined(_)&&a.defined(G)&&(_=new Float32Array(_),G=new Float32Array(G));const V=l.length/2,Y=l.subarray(0,V),v=l.subarray(V,2*V);e.AttributeCompression.zigZagDeltaDecode(Y,v);const H=new Float64Array(3*V);for(S=0;S<V;++S){const e=Y[S],n=v[S],a=o.CesiumMath.lerp(P.west,P.east,e/A),r=o.CesiumMath.lerp(P.south,P.north,n/A),i=t.Cartographic.fromRadians(a,r,0,L),s=U.cartographicToCartesian(i,E);t.Cartesian3.pack(s,H,3*S)}const W=u.length,z=new Array(W),K=new Array(W);let Z=0,j=0;for(S=0;S<W;++S)z[S]=Z,K[S]=j,Z+=u[S],j+=h[S];const q=new Float32Array(3*V*2),J=new Uint16Array(2*V),Q=new Uint32Array(K.length),X=new Uint32Array(h.length);let $=[];const ee={};for(S=0;S<W;++S)R=p[S],a.defined(ee[R])?(ee[R].positionLength+=u[S],ee[R].indexLength+=h[S],ee[R].batchIds.push(S)):ee[R]={positionLength:u[S],indexLength:h[S],offset:0,indexOffset:0,batchIds:[S]};let te,ne=0,ae=0;for(R in ee)if(ee.hasOwnProperty(R)){te=ee[R],te.offset=ne,te.indexOffset=ae;const e=2*te.positionLength,t=2*te.indexLength+6*te.positionLength;ne+=e,ae+=t,te.indexLength=t}const re=[];for(R in ee)ee.hasOwnProperty(R)&&(te=ee[R],re.push({color:n.Color.fromRgba(parseInt(R)),offset:te.indexOffset,count:te.indexLength,batchIds:te.batchIds}));for(S=0;S<W;++S){R=p[S],te=ee[R];const e=te.offset;let n=3*e,r=e;const o=z[S],s=u[S],c=g[S];let f=F,l=M;a.defined(_)&&a.defined(G)&&(f=_[S],l=G[S]);let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(D=0;D<s;++D){const e=t.Cartesian3.unpack(H,3*o+3*D,E);U.scaleToGeodeticSurface(e,e);const a=U.cartesianToCartographic(e,L),i=a.latitude,s=a.longitude;b=Math.min(i,b),x=Math.max(i,x),C=Math.min(s,C),I=Math.max(s,I);const d=U.geodeticSurfaceNormal(e,N);let u=t.Cartesian3.multiplyByScalar(d,f,T);const h=t.Cartesian3.add(e,u,B);u=t.Cartesian3.multiplyByScalar(d,l,u);const g=t.Cartesian3.add(e,u,k);t.Cartesian3.subtract(g,m,g),t.Cartesian3.subtract(h,m,h),t.Cartesian3.pack(g,q,n),t.Cartesian3.pack(h,q,n+3),J[r]=c,J[r+1]=c,n+=6,r+=2}P=O,P.west=C,P.east=I,P.south=b,P.north=x,y[S]=i.OrientedBoundingBox.fromRectangle(P,F,M,U);let w=te.indexOffset;const A=K[S],V=h[S];for(Q[S]=w,D=0;D<V;D+=3){const t=d[A+D]-o,n=d[A+D+1]-o,a=d[A+D+2]-o;$[w++]=2*t+e,$[w++]=2*n+e,$[w++]=2*a+e,$[w++]=2*a+1+e,$[w++]=2*n+1+e,$[w++]=2*t+1+e}for(D=0;D<s;++D){const t=D,n=(D+1)%s;$[w++]=2*t+1+e,$[w++]=2*n+e,$[w++]=2*t+e,$[w++]=2*t+1+e,$[w++]=2*n+1+e,$[w++]=2*n+e}te.offset+=2*s,te.indexOffset=w,X[S]=w-Q[S]}$=r.IndexDatatype.createTypedArray(q.length/3,$);const oe=re.length;for(let e=0;e<oe;++e){const t=re[e].batchIds;let n=0;const a=t.length;for(let e=0;e<a;++e)n+=X[t[e]];re[e].count=n}const ie=w(2===$.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,y,re);return f.push(q.buffer,$.buffer,Q.buffer,X.buffer,J.buffer,ie.buffer),{positions:q.buffer,indices:$.buffer,indexOffsets:Q.buffer,indexCounts:X.buffer,batchIds:J.buffer,packedBuffer:ie.buffer}}))})); +define(["./AttributeCompression-0b8f7b7d","./Matrix3-b2351961","./Color-d89a2fad","./defaultValue-f6d5e6da","./IndexDatatype-a9b1bc18","./Math-355606c6","./OrientedBoundingBox-c083edd8","./Matrix2-7a8e9daf","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./Transforms-f17097e5","./combine-0c102d93","./RuntimeError-9b4ce3fb","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,n,a,r,o,i,s,c,f,d,l,u,h,g,p,y,m){"use strict";const b=new t.Cartesian3,x=new t.Ellipsoid,C=new s.Rectangle,I={min:void 0,max:void 0,indexBytesPerElement:void 0};function w(e,t,a){const r=t.length,o=2+r*i.OrientedBoundingBox.packedLength+1+function(e){const t=e.length;let a=0;for(let r=0;r<t;++r)a+=n.Color.packedLength+3+e[r].batchIds.length;return a}(a),s=new Float64Array(o);let c=0;s[c++]=e,s[c++]=r;for(let e=0;e<r;++e)i.OrientedBoundingBox.pack(t[e],s,c),c+=i.OrientedBoundingBox.packedLength;const f=a.length;s[c++]=f;for(let e=0;e<f;++e){const t=a[e];n.Color.pack(t.color,s,c),c+=n.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const r=t.batchIds,o=r.length;s[c++]=o;for(let e=0;e<o;++e)s[c++]=r[e]}return s}const A=new t.Cartesian3,E=new t.Cartesian3,N=new t.Cartesian3,T=new t.Cartesian3,B=new t.Cartesian3,k=new t.Cartographic,L=new s.Rectangle;return c((function(c,f){let d;!function(e){const n=new Float64Array(e);let a=0;I.indexBytesPerElement=n[a++],I.min=n[a++],I.max=n[a++],t.Cartesian3.unpack(n,a,b),a+=t.Cartesian3.packedLength,t.Ellipsoid.unpack(n,a,x),a+=t.Ellipsoid.packedLength,s.Rectangle.unpack(n,a,C)}(c.packedBuffer),d=2===I.indexBytesPerElement?new Uint16Array(c.indices):new Uint32Array(c.indices);const l=new Uint16Array(c.positions),u=new Uint32Array(c.counts),h=new Uint32Array(c.indexCounts),g=new Uint32Array(c.batchIds),p=new Uint32Array(c.batchTableColors),y=new Array(u.length),m=b,O=x;let U=C;const P=I.min,F=I.max;let M,S,D,R=c.minimumHeights,_=c.maximumHeights;a.defined(R)&&a.defined(_)&&(R=new Float32Array(R),_=new Float32Array(_));const G=l.length/2,V=l.subarray(0,G),Y=l.subarray(G,2*G);e.AttributeCompression.zigZagDeltaDecode(V,Y);const v=new Float64Array(3*G);for(M=0;M<G;++M){const e=V[M],n=Y[M],a=o.CesiumMath.lerp(U.west,U.east,e/32767),r=o.CesiumMath.lerp(U.south,U.north,n/32767),i=t.Cartographic.fromRadians(a,r,0,k),s=O.cartographicToCartesian(i,A);t.Cartesian3.pack(s,v,3*M)}const H=u.length,W=new Array(H),z=new Array(H);let K=0,Z=0;for(M=0;M<H;++M)W[M]=K,z[M]=Z,K+=u[M],Z+=h[M];const j=new Float32Array(3*G*2),q=new Uint16Array(2*G),J=new Uint32Array(z.length),Q=new Uint32Array(h.length);let X=[];const $={};for(M=0;M<H;++M)D=p[M],a.defined($[D])?($[D].positionLength+=u[M],$[D].indexLength+=h[M],$[D].batchIds.push(M)):$[D]={positionLength:u[M],indexLength:h[M],offset:0,indexOffset:0,batchIds:[M]};let ee,te=0,ne=0;for(D in $)if($.hasOwnProperty(D)){ee=$[D],ee.offset=te,ee.indexOffset=ne;const e=2*ee.positionLength,t=2*ee.indexLength+6*ee.positionLength;te+=e,ne+=t,ee.indexLength=t}const ae=[];for(D in $)$.hasOwnProperty(D)&&(ee=$[D],ae.push({color:n.Color.fromRgba(parseInt(D)),offset:ee.indexOffset,count:ee.indexLength,batchIds:ee.batchIds}));for(M=0;M<H;++M){D=p[M],ee=$[D];const e=ee.offset;let n=3*e,r=e;const o=W[M],s=u[M],c=g[M];let f=P,l=F;a.defined(R)&&a.defined(_)&&(f=R[M],l=_[M]);let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(S=0;S<s;++S){const e=t.Cartesian3.unpack(v,3*o+3*S,A);O.scaleToGeodeticSurface(e,e);const a=O.cartesianToCartographic(e,k),i=a.latitude,s=a.longitude;b=Math.min(i,b),x=Math.max(i,x),C=Math.min(s,C),I=Math.max(s,I);const d=O.geodeticSurfaceNormal(e,E);let u=t.Cartesian3.multiplyByScalar(d,f,N);const h=t.Cartesian3.add(e,u,T);u=t.Cartesian3.multiplyByScalar(d,l,u);const g=t.Cartesian3.add(e,u,B);t.Cartesian3.subtract(g,m,g),t.Cartesian3.subtract(h,m,h),t.Cartesian3.pack(g,j,n),t.Cartesian3.pack(h,j,n+3),q[r]=c,q[r+1]=c,n+=6,r+=2}U=L,U.west=C,U.east=I,U.south=b,U.north=x,y[M]=i.OrientedBoundingBox.fromRectangle(U,P,F,O);let w=ee.indexOffset;const G=z[M],V=h[M];for(J[M]=w,S=0;S<V;S+=3){const t=d[G+S]-o,n=d[G+S+1]-o,a=d[G+S+2]-o;X[w++]=2*t+e,X[w++]=2*n+e,X[w++]=2*a+e,X[w++]=2*a+1+e,X[w++]=2*n+1+e,X[w++]=2*t+1+e}for(S=0;S<s;++S){const t=S,n=(S+1)%s;X[w++]=2*t+1+e,X[w++]=2*n+e,X[w++]=2*t+e,X[w++]=2*t+1+e,X[w++]=2*n+1+e,X[w++]=2*n+e}ee.offset+=2*s,ee.indexOffset=w,Q[M]=w-J[M]}X=r.IndexDatatype.createTypedArray(j.length/3,X);const re=ae.length;for(let e=0;e<re;++e){const t=ae[e].batchIds;let n=0;const a=t.length;for(let e=0;e<a;++e)n+=Q[t[e]];ae[e].count=n}const oe=w(2===X.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,y,ae);return f.push(j.buffer,X.buffer,J.buffer,Q.buffer,q.buffer,oe.buffer),{positions:j.buffer,indices:X.buffer,indexOffsets:J.buffer,indexCounts:Q.buffer,batchIds:q.buffer,packedBuffer:oe.buffer}}))})); diff --git a/public/lib/Cesium/Workers/createVectorTilePolylines.js b/public/lib/Cesium/Workers/createVectorTilePolylines.js index a98013ea..f2e4510e 100644 --- a/public/lib/Cesium/Workers/createVectorTilePolylines.js +++ b/public/lib/Cesium/Workers/createVectorTilePolylines.js @@ -1 +1 @@ -define(["./Matrix3-81054f0f","./combine-0c102d93","./AttributeCompression-48e336db","./Math-2ce22ee9","./IndexDatatype-d3db4e7d","./Matrix2-413c4048","./createTaskProcessorWorker","./defaultValue-f6d5e6da","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(e,t,a,n,r,s,i,o,c,u,f){"use strict";const p=32767,l=new e.Cartographic,d=new e.Cartesian3;const C=new s.Rectangle,b=new e.Ellipsoid,w=new e.Cartesian3,h={min:void 0,max:void 0};const y=new e.Cartesian3,k=new e.Cartesian3,g=new e.Cartesian3,m=new e.Cartesian3,A=new e.Cartesian3;return i((function(i,o){const c=new Uint16Array(i.positions),u=new Uint16Array(i.widths),f=new Uint32Array(i.counts),x=new Uint16Array(i.batchIds);!function(t){t=new Float64Array(t);let a=0;h.min=t[a++],h.max=t[a++],s.Rectangle.unpack(t,a,C),a+=s.Rectangle.packedLength,e.Ellipsoid.unpack(t,a,b),a+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(t,a,w)}(i.packedBuffer);const D=b,E=w,I=function(t,r,s,i,o){const c=t.length/3,u=t.subarray(0,c),f=t.subarray(c,2*c),C=t.subarray(2*c,3*c);a.AttributeCompression.zigZagDeltaDecode(u,f,C);const b=new Float64Array(t.length);for(let t=0;t<c;++t){const a=u[t],c=f[t],w=C[t],h=n.CesiumMath.lerp(r.west,r.east,a/p),y=n.CesiumMath.lerp(r.south,r.north,c/p),k=n.CesiumMath.lerp(s,i,w/p),g=e.Cartographic.fromRadians(h,y,k,l),m=o.cartographicToCartesian(g,d);e.Cartesian3.pack(m,b,3*t)}return b}(c,C,h.min,h.max,D),P=I.length/3,U=4*P-4,M=new Float32Array(3*U),R=new Float32Array(3*U),T=new Float32Array(3*U),F=new Float32Array(2*U),N=new Uint16Array(U);let L,S=0,_=0,v=0,G=0,W=f.length;for(L=0;L<W;++L){const t=f[L],a=u[L],n=x[L];for(let r=0;r<t;++r){let s;if(0===r){const t=e.Cartesian3.unpack(I,3*G,y),a=e.Cartesian3.unpack(I,3*(G+1),k);s=e.Cartesian3.subtract(t,a,g),e.Cartesian3.add(t,s,s)}else s=e.Cartesian3.unpack(I,3*(G+r-1),g);const i=e.Cartesian3.unpack(I,3*(G+r),m);let o;if(r===t-1){const a=e.Cartesian3.unpack(I,3*(G+t-1),y),n=e.Cartesian3.unpack(I,3*(G+t-2),k);o=e.Cartesian3.subtract(a,n,A),e.Cartesian3.add(a,o,o)}else o=e.Cartesian3.unpack(I,3*(G+r+1),A);e.Cartesian3.subtract(s,E,s),e.Cartesian3.subtract(i,E,i),e.Cartesian3.subtract(o,E,o);const c=r===t-1?2:4;for(let t=0===r?2:0;t<c;++t){e.Cartesian3.pack(i,M,S),e.Cartesian3.pack(s,R,S),e.Cartesian3.pack(o,T,S),S+=3;const r=t-2<0?-1:1;F[_++]=t%2*2-1,F[_++]=r*a,N[v++]=n}}G+=t}const B=r.IndexDatatype.createTypedArray(U,6*P-6);let O=0,z=0;for(W=P-1,L=0;L<W;++L)B[z++]=O,B[z++]=O+2,B[z++]=O+1,B[z++]=O+1,B[z++]=O+2,B[z++]=O+3,O+=4;o.push(M.buffer,R.buffer,T.buffer),o.push(F.buffer,N.buffer,B.buffer);let H={indexDatatype:2===B.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,currentPositions:M.buffer,previousPositions:R.buffer,nextPositions:T.buffer,expandAndWidth:F.buffer,batchIds:N.buffer,indices:B.buffer};if(i.keepDecodedPositions){const e=function(e){const t=e.length,a=new Uint32Array(t+1);let n=0;for(let r=0;r<t;++r)a[r]=n,n+=e[r];return a[t]=n,a}(f);o.push(I.buffer,e.buffer),H=t.combine(H,{decodedPositions:I.buffer,decodedPositionOffsets:e.buffer})}return H}))})); +define(["./Matrix3-b2351961","./combine-0c102d93","./AttributeCompression-0b8f7b7d","./Math-355606c6","./IndexDatatype-a9b1bc18","./Matrix2-7a8e9daf","./createTaskProcessorWorker","./defaultValue-f6d5e6da","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./RuntimeError-9b4ce3fb"],(function(e,t,a,n,r,s,i,o,c,u,f){"use strict";const p=32767,l=new e.Cartographic,d=new e.Cartesian3;const C=new s.Rectangle,b=new e.Ellipsoid,w=new e.Cartesian3,h={min:void 0,max:void 0};const y=new e.Cartesian3,k=new e.Cartesian3,g=new e.Cartesian3,m=new e.Cartesian3,A=new e.Cartesian3;return i((function(i,o){const c=new Uint16Array(i.positions),u=new Uint16Array(i.widths),f=new Uint32Array(i.counts),x=new Uint16Array(i.batchIds);!function(t){t=new Float64Array(t);let a=0;h.min=t[a++],h.max=t[a++],s.Rectangle.unpack(t,a,C),a+=s.Rectangle.packedLength,e.Ellipsoid.unpack(t,a,b),a+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(t,a,w)}(i.packedBuffer);const D=b,E=w,I=function(t,r,s,i,o){const c=t.length/3,u=t.subarray(0,c),f=t.subarray(c,2*c),C=t.subarray(2*c,3*c);a.AttributeCompression.zigZagDeltaDecode(u,f,C);const b=new Float64Array(t.length);for(let t=0;t<c;++t){const a=u[t],c=f[t],w=C[t],h=n.CesiumMath.lerp(r.west,r.east,a/p),y=n.CesiumMath.lerp(r.south,r.north,c/p),k=n.CesiumMath.lerp(s,i,w/p),g=e.Cartographic.fromRadians(h,y,k,l),m=o.cartographicToCartesian(g,d);e.Cartesian3.pack(m,b,3*t)}return b}(c,C,h.min,h.max,D),P=I.length/3,U=4*P-4,M=new Float32Array(3*U),R=new Float32Array(3*U),T=new Float32Array(3*U),F=new Float32Array(2*U),N=new Uint16Array(U);let L,S=0,_=0,v=0,G=0,W=f.length;for(L=0;L<W;++L){const t=f[L],a=u[L],n=x[L];for(let r=0;r<t;++r){let s;if(0===r){const t=e.Cartesian3.unpack(I,3*G,y),a=e.Cartesian3.unpack(I,3*(G+1),k);s=e.Cartesian3.subtract(t,a,g),e.Cartesian3.add(t,s,s)}else s=e.Cartesian3.unpack(I,3*(G+r-1),g);const i=e.Cartesian3.unpack(I,3*(G+r),m);let o;if(r===t-1){const a=e.Cartesian3.unpack(I,3*(G+t-1),y),n=e.Cartesian3.unpack(I,3*(G+t-2),k);o=e.Cartesian3.subtract(a,n,A),e.Cartesian3.add(a,o,o)}else o=e.Cartesian3.unpack(I,3*(G+r+1),A);e.Cartesian3.subtract(s,E,s),e.Cartesian3.subtract(i,E,i),e.Cartesian3.subtract(o,E,o);const c=r===t-1?2:4;for(let t=0===r?2:0;t<c;++t){e.Cartesian3.pack(i,M,S),e.Cartesian3.pack(s,R,S),e.Cartesian3.pack(o,T,S),S+=3;const r=t-2<0?-1:1;F[_++]=t%2*2-1,F[_++]=r*a,N[v++]=n}}G+=t}const B=r.IndexDatatype.createTypedArray(U,6*P-6);let O=0,z=0;for(W=P-1,L=0;L<W;++L)B[z++]=O,B[z++]=O+2,B[z++]=O+1,B[z++]=O+1,B[z++]=O+2,B[z++]=O+3,O+=4;o.push(M.buffer,R.buffer,T.buffer),o.push(F.buffer,N.buffer,B.buffer);let H={indexDatatype:2===B.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,currentPositions:M.buffer,previousPositions:R.buffer,nextPositions:T.buffer,expandAndWidth:F.buffer,batchIds:N.buffer,indices:B.buffer};if(i.keepDecodedPositions){const e=function(e){const t=e.length,a=new Uint32Array(t+1);let n=0;for(let r=0;r<t;++r)a[r]=n,n+=e[r];return a[t]=n,a}(f);o.push(I.buffer,e.buffer),H=t.combine(H,{decodedPositions:I.buffer,decodedPositionOffsets:e.buffer})}return H}))})); diff --git a/public/lib/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/public/lib/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js index c81b67c6..3a0024f8 100644 --- a/public/lib/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +++ b/public/lib/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -1 +1 @@ -define(["./AxisAlignedBoundingBox-e7b79110","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./TerrainEncoding-5fbe99d6","./Math-2ce22ee9","./OrientedBoundingBox-8446a826","./RuntimeError-9b4ce3fb","./WebMercatorProjection-943e2226","./createTaskProcessorWorker","./combine-0c102d93","./AttributeCompression-48e336db","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(t,e,n,i,o,r,a,s,c,u,h,l,d,g,m,p,I,E){"use strict";const T=Uint16Array.BYTES_PER_ELEMENT,f=Int32Array.BYTES_PER_ELEMENT,C=Uint32Array.BYTES_PER_ELEMENT,M=Float32Array.BYTES_PER_ELEMENT,x=Float64Array.BYTES_PER_ELEMENT;function N(t,e,n){n=o.defaultValue(n,a.CesiumMath);const i=t.length;for(let o=0;o<i;++o)if(n.equalsEpsilon(t[o],e,a.CesiumMath.EPSILON12))return o;return-1}const S=new i.Cartographic,b=new i.Cartesian3,w=new i.Cartesian3,B=new i.Cartesian3,P=new n.Matrix4;function A(t,e,r,s,c,u,h,l,d,g,m){const p=l.length;for(let I=0;I<p;++I){const E=l[I],T=E.cartographic,f=E.index,C=t.length,M=T.longitude;let x=T.latitude;x=a.CesiumMath.clamp(x,-a.CesiumMath.PI_OVER_TWO,a.CesiumMath.PI_OVER_TWO);const N=T.height-h.skirtHeight;h.hMin=Math.min(h.hMin,N),i.Cartographic.fromRadians(M,x,N,S),g&&(S.longitude+=d),g?I===p-1?S.latitude+=m:0===I&&(S.latitude-=m):S.latitude+=d;const w=h.ellipsoid.cartographicToCartesian(S);t.push(w),e.push(N),r.push(n.Cartesian2.clone(r[f])),s.length>0&&s.push(s[f]),c.length>0&&c.push(c[f]),n.Matrix4.multiplyByPoint(h.toENU,w,b);const B=h.minimum,P=h.maximum;i.Cartesian3.minimumByComponent(b,B,B),i.Cartesian3.maximumByComponent(b,P,P);const A=h.lastBorderPoint;if(o.defined(A)){const t=A.index;u.push(t,C-1,C,C,f,t)}h.lastBorderPoint=E}}return h((function(h,l){h.ellipsoid=i.Ellipsoid.clone(h.ellipsoid),h.rectangle=n.Rectangle.clone(h.rectangle);const d=function(h,l,d,g,m,p,I,E,y,R,_){let W,v,F,O,V,Y;o.defined(g)?(W=g.west,v=g.south,F=g.east,O=g.north,V=g.width,Y=g.height):(W=a.CesiumMath.toRadians(m.west),v=a.CesiumMath.toRadians(m.south),F=a.CesiumMath.toRadians(m.east),O=a.CesiumMath.toRadians(m.north),V=a.CesiumMath.toRadians(g.width),Y=a.CesiumMath.toRadians(g.height));const U=[v,O],k=[W,F],H=e.Transforms.eastNorthUpToFixedFrame(l,d),L=n.Matrix4.inverseTransformation(H,P);let j,D;y&&(j=u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(v),D=1/(u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(O)-j));const G=1!==p,z=new DataView(h);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY;const K=w;K.x=Number.POSITIVE_INFINITY,K.y=Number.POSITIVE_INFINITY,K.z=Number.POSITIVE_INFINITY;const Q=B;Q.x=Number.NEGATIVE_INFINITY,Q.y=Number.NEGATIVE_INFINITY,Q.z=Number.NEGATIVE_INFINITY;let X,Z,$=0,tt=0,et=0;for(Z=0;Z<4;++Z){let t=$;X=z.getUint32(t,!0),t+=C;const e=a.CesiumMath.toRadians(180*z.getFloat64(t,!0));t+=x,-1===N(k,e)&&k.push(e);const n=a.CesiumMath.toRadians(180*z.getFloat64(t,!0));t+=x,-1===N(U,n)&&U.push(n),t+=2*x;let i=z.getInt32(t,!0);t+=f,tt+=i,i=z.getInt32(t,!0),et+=3*i,$+=X+C}const nt=[],it=[],ot=new Array(tt),rt=new Array(tt),at=new Array(tt),st=y?new Array(tt):[],ct=G?new Array(tt):[],ut=new Array(et),ht=[],lt=[],dt=[],gt=[];let mt=0,pt=0;for($=0,Z=0;Z<4;++Z){X=z.getUint32($,!0),$+=C;const t=$,e=a.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=x;const o=a.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=x;const r=a.CesiumMath.toRadians(180*z.getFloat64($,!0)),s=.5*r;$+=x;const h=a.CesiumMath.toRadians(180*z.getFloat64($,!0)),l=.5*h;$+=x;const g=z.getInt32($,!0);$+=f;const m=z.getInt32($,!0);$+=f,$+=f;const p=new Array(g);for(let t=0;t<g;++t){const c=e+z.getUint8($++)*r;S.longitude=c;const g=o+z.getUint8($++)*h;S.latitude=g;let m=z.getFloat32($,!0);if($+=M,0!==m&&m<_&&(m*=-Math.pow(2,R)),m*=6371010,S.height=m,-1!==N(k,c)||-1!==N(U,g)){const e=N(nt,S,i.Cartographic);if(-1!==e){p[t]=it[e];continue}nt.push(i.Cartographic.clone(S)),it.push(mt)}p[t]=mt,Math.abs(c-W)<s?ht.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(c-F)<s?dt.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(g-v)<l?lt.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(g-O)<l&>.push({index:mt,cartographic:i.Cartographic.clone(S)}),q=Math.min(m,q),J=Math.max(m,J),at[mt]=m;const I=d.cartographicToCartesian(S);if(ot[mt]=I,y&&(st[mt]=(u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(g)-j)*D),G){const t=d.geodeticSurfaceNormal(I);ct[mt]=t}n.Matrix4.multiplyByPoint(L,I,b),i.Cartesian3.minimumByComponent(b,K,K),i.Cartesian3.maximumByComponent(b,Q,Q);let E=(c-W)/(F-W);E=a.CesiumMath.clamp(E,0,1);let T=(g-v)/(O-v);T=a.CesiumMath.clamp(T,0,1),rt[mt]=new n.Cartesian2(E,T),++mt}const I=3*m;for(let t=0;t<I;++t,++pt)ut[pt]=p[z.getUint16($,!0)],$+=T;if(X!==$-t)throw new c.RuntimeError("Invalid terrain tile.")}ot.length=mt,rt.length=mt,at.length=mt,y&&(st.length=mt);G&&(ct.length=mt);const It=mt,Et=pt,Tt={hMin:q,lastBorderPoint:void 0,skirtHeight:E,toENU:L,ellipsoid:d,minimum:K,maximum:Q};ht.sort((function(t,e){return e.cartographic.latitude-t.cartographic.latitude})),lt.sort((function(t,e){return t.cartographic.longitude-e.cartographic.longitude})),dt.sort((function(t,e){return t.cartographic.latitude-e.cartographic.latitude})),gt.sort((function(t,e){return e.cartographic.longitude-t.cartographic.longitude}));const ft=1e-5;if(A(ot,at,rt,st,ct,ut,Tt,ht,-ft*V,!0,-ft*Y),A(ot,at,rt,st,ct,ut,Tt,lt,-ft*Y,!1),A(ot,at,rt,st,ct,ut,Tt,dt,ft*V,!0,ft*Y),A(ot,at,rt,st,ct,ut,Tt,gt,ft*Y,!1),ht.length>0&>.length>0){const t=ht[0].index,e=It,n=gt[gt.length-1].index,i=ot.length-1;ut.push(n,i,e,e,t,n)}tt=ot.length;const Ct=e.BoundingSphere.fromPoints(ot);let Mt;o.defined(g)&&(Mt=s.OrientedBoundingBox.fromRectangle(g,q,J,d));const xt=new r.EllipsoidalOccluder(d).computeHorizonCullingPointPossiblyUnderEllipsoid(l,ot,q),Nt=new t.AxisAlignedBoundingBox(K,Q,l),St=new r.TerrainEncoding(l,Nt,Tt.hMin,J,H,!1,y,G,p,I),bt=new Float32Array(tt*St.stride);let wt=0;for(let t=0;t<tt;++t)wt=St.encode(bt,wt,ot[t],rt[t],at[t],void 0,st[t],ct[t]);const Bt=ht.map((function(t){return t.index})).reverse(),Pt=lt.map((function(t){return t.index})).reverse(),At=dt.map((function(t){return t.index})).reverse(),yt=gt.map((function(t){return t.index})).reverse();return Pt.unshift(At[At.length-1]),Pt.push(Bt[0]),yt.unshift(Bt[Bt.length-1]),yt.push(At[0]),{vertices:bt,indices:new Uint16Array(ut),maximumHeight:J,minimumHeight:q,encoding:St,boundingSphere3D:Ct,orientedBoundingBox:Mt,occludeePointInScaledSpace:xt,vertexCountWithoutSkirts:It,indexCountWithoutSkirts:Et,westIndicesSouthToNorth:Bt,southIndicesEastToWest:Pt,eastIndicesNorthToSouth:At,northIndicesWestToEast:yt}}(h.buffer,h.relativeToCenter,h.ellipsoid,h.rectangle,h.nativeRectangle,h.exaggeration,h.exaggerationRelativeHeight,h.skirtHeight,h.includeWebMercatorT,h.negativeAltitudeExponentBias,h.negativeElevationThreshold),g=d.vertices;l.push(g.buffer);const m=d.indices;return l.push(m.buffer),{vertices:g.buffer,indices:m.buffer,numberOfAttributes:d.encoding.stride,minimumHeight:d.minimumHeight,maximumHeight:d.maximumHeight,boundingSphere3D:d.boundingSphere3D,orientedBoundingBox:d.orientedBoundingBox,occludeePointInScaledSpace:d.occludeePointInScaledSpace,encoding:d.encoding,vertexCountWithoutSkirts:d.vertexCountWithoutSkirts,indexCountWithoutSkirts:d.indexCountWithoutSkirts,westIndicesSouthToNorth:d.westIndicesSouthToNorth,southIndicesEastToWest:d.southIndicesEastToWest,eastIndicesNorthToSouth:d.eastIndicesNorthToSouth,northIndicesWestToEast:d.northIndicesWestToEast}}))})); +define(["./AxisAlignedBoundingBox-04c1a5e3","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./TerrainEncoding-c5a10c4f","./Math-355606c6","./OrientedBoundingBox-c083edd8","./RuntimeError-9b4ce3fb","./WebMercatorProjection-db7467f4","./createTaskProcessorWorker","./combine-0c102d93","./AttributeCompression-0b8f7b7d","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(t,e,n,i,o,r,a,s,c,u,h,l,d,g,m,p,I,E){"use strict";const T=Uint16Array.BYTES_PER_ELEMENT,f=Int32Array.BYTES_PER_ELEMENT,C=Uint32Array.BYTES_PER_ELEMENT,M=Float32Array.BYTES_PER_ELEMENT,x=Float64Array.BYTES_PER_ELEMENT;function N(t,e,n){n=o.defaultValue(n,a.CesiumMath);const i=t.length;for(let o=0;o<i;++o)if(n.equalsEpsilon(t[o],e,a.CesiumMath.EPSILON12))return o;return-1}const S=new i.Cartographic,b=new i.Cartesian3,w=new i.Cartesian3,B=new i.Cartesian3,P=new n.Matrix4;function A(t,e,r,s,c,u,h,l,d,g,m){const p=l.length;for(let I=0;I<p;++I){const E=l[I],T=E.cartographic,f=E.index,C=t.length,M=T.longitude;let x=T.latitude;x=a.CesiumMath.clamp(x,-a.CesiumMath.PI_OVER_TWO,a.CesiumMath.PI_OVER_TWO);const N=T.height-h.skirtHeight;h.hMin=Math.min(h.hMin,N),i.Cartographic.fromRadians(M,x,N,S),g&&(S.longitude+=d),g?I===p-1?S.latitude+=m:0===I&&(S.latitude-=m):S.latitude+=d;const w=h.ellipsoid.cartographicToCartesian(S);t.push(w),e.push(N),r.push(n.Cartesian2.clone(r[f])),s.length>0&&s.push(s[f]),c.length>0&&c.push(c[f]),n.Matrix4.multiplyByPoint(h.toENU,w,b);const B=h.minimum,P=h.maximum;i.Cartesian3.minimumByComponent(b,B,B),i.Cartesian3.maximumByComponent(b,P,P);const A=h.lastBorderPoint;if(o.defined(A)){const t=A.index;u.push(t,C-1,C,C,f,t)}h.lastBorderPoint=E}}return h((function(h,l){h.ellipsoid=i.Ellipsoid.clone(h.ellipsoid),h.rectangle=n.Rectangle.clone(h.rectangle);const d=function(h,l,d,g,m,p,I,E,y,R,_){let W,v,F,O,V,Y;o.defined(g)?(W=g.west,v=g.south,F=g.east,O=g.north,V=g.width,Y=g.height):(W=a.CesiumMath.toRadians(m.west),v=a.CesiumMath.toRadians(m.south),F=a.CesiumMath.toRadians(m.east),O=a.CesiumMath.toRadians(m.north),V=a.CesiumMath.toRadians(g.width),Y=a.CesiumMath.toRadians(g.height));const U=[v,O],k=[W,F],H=e.Transforms.eastNorthUpToFixedFrame(l,d),L=n.Matrix4.inverseTransformation(H,P);let j,D;y&&(j=u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(v),D=1/(u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(O)-j));const G=1!==p,z=new DataView(h);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY;const K=w;K.x=Number.POSITIVE_INFINITY,K.y=Number.POSITIVE_INFINITY,K.z=Number.POSITIVE_INFINITY;const Q=B;Q.x=Number.NEGATIVE_INFINITY,Q.y=Number.NEGATIVE_INFINITY,Q.z=Number.NEGATIVE_INFINITY;let X,Z,$=0,tt=0,et=0;for(Z=0;Z<4;++Z){let t=$;X=z.getUint32(t,!0),t+=C;const e=a.CesiumMath.toRadians(180*z.getFloat64(t,!0));t+=x,-1===N(k,e)&&k.push(e);const n=a.CesiumMath.toRadians(180*z.getFloat64(t,!0));t+=x,-1===N(U,n)&&U.push(n),t+=2*x;let i=z.getInt32(t,!0);t+=f,tt+=i,i=z.getInt32(t,!0),et+=3*i,$+=X+C}const nt=[],it=[],ot=new Array(tt),rt=new Array(tt),at=new Array(tt),st=y?new Array(tt):[],ct=G?new Array(tt):[],ut=new Array(et),ht=[],lt=[],dt=[],gt=[];let mt=0,pt=0;for($=0,Z=0;Z<4;++Z){X=z.getUint32($,!0),$+=C;const t=$,e=a.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=x;const o=a.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=x;const r=a.CesiumMath.toRadians(180*z.getFloat64($,!0)),s=.5*r;$+=x;const h=a.CesiumMath.toRadians(180*z.getFloat64($,!0)),l=.5*h;$+=x;const g=z.getInt32($,!0);$+=f;const m=z.getInt32($,!0);$+=f,$+=f;const p=new Array(g);for(let t=0;t<g;++t){const c=e+z.getUint8($++)*r;S.longitude=c;const g=o+z.getUint8($++)*h;S.latitude=g;let m=z.getFloat32($,!0);if($+=M,0!==m&&m<_&&(m*=-Math.pow(2,R)),m*=6371010,S.height=m,-1!==N(k,c)||-1!==N(U,g)){const e=N(nt,S,i.Cartographic);if(-1!==e){p[t]=it[e];continue}nt.push(i.Cartographic.clone(S)),it.push(mt)}p[t]=mt,Math.abs(c-W)<s?ht.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(c-F)<s?dt.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(g-v)<l?lt.push({index:mt,cartographic:i.Cartographic.clone(S)}):Math.abs(g-O)<l&>.push({index:mt,cartographic:i.Cartographic.clone(S)}),q=Math.min(m,q),J=Math.max(m,J),at[mt]=m;const I=d.cartographicToCartesian(S);if(ot[mt]=I,y&&(st[mt]=(u.WebMercatorProjection.geodeticLatitudeToMercatorAngle(g)-j)*D),G){const t=d.geodeticSurfaceNormal(I);ct[mt]=t}n.Matrix4.multiplyByPoint(L,I,b),i.Cartesian3.minimumByComponent(b,K,K),i.Cartesian3.maximumByComponent(b,Q,Q);let E=(c-W)/(F-W);E=a.CesiumMath.clamp(E,0,1);let T=(g-v)/(O-v);T=a.CesiumMath.clamp(T,0,1),rt[mt]=new n.Cartesian2(E,T),++mt}const I=3*m;for(let t=0;t<I;++t,++pt)ut[pt]=p[z.getUint16($,!0)],$+=T;if(X!==$-t)throw new c.RuntimeError("Invalid terrain tile.")}ot.length=mt,rt.length=mt,at.length=mt,y&&(st.length=mt);G&&(ct.length=mt);const It=mt,Et=pt,Tt={hMin:q,lastBorderPoint:void 0,skirtHeight:E,toENU:L,ellipsoid:d,minimum:K,maximum:Q};ht.sort((function(t,e){return e.cartographic.latitude-t.cartographic.latitude})),lt.sort((function(t,e){return t.cartographic.longitude-e.cartographic.longitude})),dt.sort((function(t,e){return t.cartographic.latitude-e.cartographic.latitude})),gt.sort((function(t,e){return e.cartographic.longitude-t.cartographic.longitude}));const ft=1e-5;if(A(ot,at,rt,st,ct,ut,Tt,ht,-ft*V,!0,-ft*Y),A(ot,at,rt,st,ct,ut,Tt,lt,-ft*Y,!1),A(ot,at,rt,st,ct,ut,Tt,dt,ft*V,!0,ft*Y),A(ot,at,rt,st,ct,ut,Tt,gt,ft*Y,!1),ht.length>0&>.length>0){const t=ht[0].index,e=It,n=gt[gt.length-1].index,i=ot.length-1;ut.push(n,i,e,e,t,n)}tt=ot.length;const Ct=e.BoundingSphere.fromPoints(ot);let Mt;o.defined(g)&&(Mt=s.OrientedBoundingBox.fromRectangle(g,q,J,d));const xt=new r.EllipsoidalOccluder(d).computeHorizonCullingPointPossiblyUnderEllipsoid(l,ot,q),Nt=new t.AxisAlignedBoundingBox(K,Q,l),St=new r.TerrainEncoding(l,Nt,Tt.hMin,J,H,!1,y,G,p,I),bt=new Float32Array(tt*St.stride);let wt=0;for(let t=0;t<tt;++t)wt=St.encode(bt,wt,ot[t],rt[t],at[t],void 0,st[t],ct[t]);const Bt=ht.map((function(t){return t.index})).reverse(),Pt=lt.map((function(t){return t.index})).reverse(),At=dt.map((function(t){return t.index})).reverse(),yt=gt.map((function(t){return t.index})).reverse();return Pt.unshift(At[At.length-1]),Pt.push(Bt[0]),yt.unshift(Bt[Bt.length-1]),yt.push(At[0]),{vertices:bt,indices:new Uint16Array(ut),maximumHeight:J,minimumHeight:q,encoding:St,boundingSphere3D:Ct,orientedBoundingBox:Mt,occludeePointInScaledSpace:xt,vertexCountWithoutSkirts:It,indexCountWithoutSkirts:Et,westIndicesSouthToNorth:Bt,southIndicesEastToWest:Pt,eastIndicesNorthToSouth:At,northIndicesWestToEast:yt}}(h.buffer,h.relativeToCenter,h.ellipsoid,h.rectangle,h.nativeRectangle,h.exaggeration,h.exaggerationRelativeHeight,h.skirtHeight,h.includeWebMercatorT,h.negativeAltitudeExponentBias,h.negativeElevationThreshold),g=d.vertices;l.push(g.buffer);const m=d.indices;return l.push(m.buffer),{vertices:g.buffer,indices:m.buffer,numberOfAttributes:d.encoding.stride,minimumHeight:d.minimumHeight,maximumHeight:d.maximumHeight,boundingSphere3D:d.boundingSphere3D,orientedBoundingBox:d.orientedBoundingBox,occludeePointInScaledSpace:d.occludeePointInScaledSpace,encoding:d.encoding,vertexCountWithoutSkirts:d.vertexCountWithoutSkirts,indexCountWithoutSkirts:d.indexCountWithoutSkirts,westIndicesSouthToNorth:d.westIndicesSouthToNorth,southIndicesEastToWest:d.southIndicesEastToWest,eastIndicesNorthToSouth:d.eastIndicesNorthToSouth,northIndicesWestToEast:d.northIndicesWestToEast}}))})); diff --git a/public/lib/Cesium/Workers/createVerticesFromHeightmap.js b/public/lib/Cesium/Workers/createVerticesFromHeightmap.js index 7b893a43..d0a72c9b 100644 --- a/public/lib/Cesium/Workers/createVerticesFromHeightmap.js +++ b/public/lib/Cesium/Workers/createVerticesFromHeightmap.js @@ -1,3 +1,3 @@ -define(["./Matrix3-81054f0f","./AxisAlignedBoundingBox-e7b79110","./Transforms-b3716b06","./Matrix2-413c4048","./defaultValue-f6d5e6da","./TerrainEncoding-5fbe99d6","./Math-2ce22ee9","./OrientedBoundingBox-8446a826","./WebMercatorProjection-943e2226","./RuntimeError-9b4ce3fb","./createTaskProcessorWorker","./combine-0c102d93","./AttributeCompression-48e336db","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-cf43ca0f","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p,x){"use strict";var w=Object.freeze({NONE:0,LERC:1});const k={};k.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const y=new e.Cartesian3,I=new a.Matrix4,U=new e.Cartesian3,b=new e.Cartesian3;k.computeVertices=function(f){const u=Math.cos,c=Math.sin,d=Math.sqrt,h=Math.atan,m=Math.exp,g=s.CesiumMath.PI_OVER_TWO,p=s.CesiumMath.toRadians,x=f.heightmap,w=f.width,M=f.height,T=f.skirtHeight,V=T>0,v=n.defaultValue(f.isGeographic,!0),A=n.defaultValue(f.ellipsoid,e.Ellipsoid.WGS84),B=1/A.maximumRadius,D=a.Rectangle.clone(f.nativeRectangle),S=a.Rectangle.clone(f.rectangle);let P,E,C,F;n.defined(S)?(P=S.west,E=S.south,C=S.east,F=S.north):v?(P=p(D.west),E=p(D.south),C=p(D.east),F=p(D.north)):(P=D.west*B,E=g-2*h(m(-D.south*B)),C=D.east*B,F=g-2*h(m(-D.north*B)));let N=f.relativeToCenter;const O=n.defined(N);N=O?N:e.Cartesian3.ZERO;const R=n.defaultValue(f.includeWebMercatorT,!1),L=n.defaultValue(f.exaggeration,1),z=n.defaultValue(f.exaggerationRelativeHeight,0),H=1!==L,_=n.defaultValue(f.structure,k.DEFAULT_STRUCTURE),Y=n.defaultValue(_.heightScale,k.DEFAULT_STRUCTURE.heightScale),W=n.defaultValue(_.heightOffset,k.DEFAULT_STRUCTURE.heightOffset),X=n.defaultValue(_.elementsPerHeight,k.DEFAULT_STRUCTURE.elementsPerHeight),Z=n.defaultValue(_.stride,k.DEFAULT_STRUCTURE.stride),j=n.defaultValue(_.elementMultiplier,k.DEFAULT_STRUCTURE.elementMultiplier),G=n.defaultValue(_.isBigEndian,k.DEFAULT_STRUCTURE.isBigEndian);let q=a.Rectangle.computeWidth(D),Q=a.Rectangle.computeHeight(D);const J=q/(w-1),K=Q/(M-1);v||(q*=B,Q*=B);const $=A.radiiSquared,ee=$.x,te=$.y,ie=$.z;let ae=65536,ne=-65536;const re=i.Transforms.eastNorthUpToFixedFrame(N,A),se=a.Matrix4.inverseTransformation(re,I);let le,oe;R&&(le=o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(E),oe=1/(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F)-le));const fe=U;fe.x=Number.POSITIVE_INFINITY,fe.y=Number.POSITIVE_INFINITY,fe.z=Number.POSITIVE_INFINITY;const ue=b;ue.x=Number.NEGATIVE_INFINITY,ue.y=Number.NEGATIVE_INFINITY,ue.z=Number.NEGATIVE_INFINITY;let ce=Number.POSITIVE_INFINITY;const de=w*M,he=de+(T>0?2*w+2*M:0),me=new Array(he),ge=new Array(he),pe=new Array(he),xe=R?new Array(he):[],we=H?new Array(he):[];let ke=0,ye=M,Ie=0,Ue=w;V&&(--ke,++ye,--Ie,++Ue);const be=1e-5;for(let t=ke;t<ye;++t){let i=t;i<0&&(i=0),i>=M&&(i=M-1);let n=D.north-K*i;n=v?p(n):g-2*h(m(-n*B));let r=(n-E)/(F-E);r=s.CesiumMath.clamp(r,0,1);const l=t===ke,f=t===ye-1;T>0&&(l?n+=be*Q:f&&(n-=be*Q));const k=u(n),I=c(n),U=ie*I;let b;R&&(b=(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(n)-le)*oe);for(let t=Ie;t<Ue;++t){let n=t;n<0&&(n=0),n>=w&&(n=w-1);const o=i*(w*Z)+n*Z;let h;if(1===X)h=x[o];else{let e;if(h=0,G)for(e=0;e<X;++e)h=h*j+x[o+e];else for(e=X-1;e>=0;--e)h=h*j+x[o+e]}h=h*Y+W,ne=Math.max(ne,h),ae=Math.min(ae,h);let m=D.west+J*n;v?m=p(m):m*=B;let g=(m-P)/(C-P);g=s.CesiumMath.clamp(g,0,1);let V=i*w+n;if(T>0){const e=t===Ie,a=t===Ue-1,r=l||f||e||a;if((l||f)&&(e||a))continue;r&&(h-=T,e?(V=de+(M-i-1),m-=be*q):f?V=de+M+(w-n-1):a?(V=de+M+w+i,m+=be*q):l&&(V=de+M+w+M+n))}const S=k*u(m),E=k*c(m),F=ee*S,N=te*E,O=1/d(F*S+N*E+U*I),L=F*O,z=N*O,_=U*O,Q=new e.Cartesian3;Q.x=L+S*h,Q.y=z+E*h,Q.z=_+I*h,a.Matrix4.multiplyByPoint(se,Q,y),e.Cartesian3.minimumByComponent(y,fe,fe),e.Cartesian3.maximumByComponent(y,ue,ue),ce=Math.min(ce,h),me[V]=Q,pe[V]=new a.Cartesian2(g,r),ge[V]=h,R&&(xe[V]=b),H&&(we[V]=A.geodeticSurfaceNormal(Q))}}const Me=i.BoundingSphere.fromPoints(me);let Te,Ve;if(n.defined(S)&&(Te=l.OrientedBoundingBox.fromRectangle(S,ae,ne,A)),O){Ve=new r.EllipsoidalOccluder(A).computeHorizonCullingPointPossiblyUnderEllipsoid(N,me,ae)}const ve=new t.AxisAlignedBoundingBox(fe,ue,N),Ae=new r.TerrainEncoding(N,ve,ce,ne,re,!1,R,H,L,z),Be=new Float32Array(he*Ae.stride);let De=0;for(let e=0;e<he;++e)De=Ae.encode(Be,De,me[e],pe[e],ge[e],void 0,xe[e],we[e]);return{vertices:Be,maximumHeight:ne,minimumHeight:ae,encoding:Ae,boundingSphere3D:Me,orientedBoundingBox:Te,occludeePointInScaledSpace:Ve}};var M,T=k,V={};M={get exports(){return V},set exports(e){V=e}}, +define(["./Matrix3-b2351961","./AxisAlignedBoundingBox-04c1a5e3","./Transforms-f17097e5","./Matrix2-7a8e9daf","./defaultValue-f6d5e6da","./TerrainEncoding-c5a10c4f","./Math-355606c6","./OrientedBoundingBox-c083edd8","./WebMercatorProjection-db7467f4","./RuntimeError-9b4ce3fb","./createTaskProcessorWorker","./combine-0c102d93","./AttributeCompression-0b8f7b7d","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./EllipsoidTangentPlane-c3e9d965","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p,x){"use strict";var w=Object.freeze({NONE:0,LERC:1});const k={};k.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const y=new e.Cartesian3,I=new a.Matrix4,U=new e.Cartesian3,b=new e.Cartesian3;k.computeVertices=function(f){const u=Math.cos,c=Math.sin,d=Math.sqrt,h=Math.atan,m=Math.exp,g=s.CesiumMath.PI_OVER_TWO,p=s.CesiumMath.toRadians,x=f.heightmap,w=f.width,M=f.height,T=f.skirtHeight,V=T>0,v=n.defaultValue(f.isGeographic,!0),A=n.defaultValue(f.ellipsoid,e.Ellipsoid.WGS84),B=1/A.maximumRadius,D=a.Rectangle.clone(f.nativeRectangle),S=a.Rectangle.clone(f.rectangle);let P,E,C,F;n.defined(S)?(P=S.west,E=S.south,C=S.east,F=S.north):v?(P=p(D.west),E=p(D.south),C=p(D.east),F=p(D.north)):(P=D.west*B,E=g-2*h(m(-D.south*B)),C=D.east*B,F=g-2*h(m(-D.north*B)));let N=f.relativeToCenter;const O=n.defined(N);N=O?N:e.Cartesian3.ZERO;const R=n.defaultValue(f.includeWebMercatorT,!1),L=n.defaultValue(f.exaggeration,1),z=n.defaultValue(f.exaggerationRelativeHeight,0),H=1!==L,_=n.defaultValue(f.structure,k.DEFAULT_STRUCTURE),Y=n.defaultValue(_.heightScale,k.DEFAULT_STRUCTURE.heightScale),W=n.defaultValue(_.heightOffset,k.DEFAULT_STRUCTURE.heightOffset),X=n.defaultValue(_.elementsPerHeight,k.DEFAULT_STRUCTURE.elementsPerHeight),Z=n.defaultValue(_.stride,k.DEFAULT_STRUCTURE.stride),j=n.defaultValue(_.elementMultiplier,k.DEFAULT_STRUCTURE.elementMultiplier),G=n.defaultValue(_.isBigEndian,k.DEFAULT_STRUCTURE.isBigEndian);let q=a.Rectangle.computeWidth(D),Q=a.Rectangle.computeHeight(D);const J=q/(w-1),K=Q/(M-1);v||(q*=B,Q*=B);const $=A.radiiSquared,ee=$.x,te=$.y,ie=$.z;let ae=65536,ne=-65536;const re=i.Transforms.eastNorthUpToFixedFrame(N,A),se=a.Matrix4.inverseTransformation(re,I);let le,oe;R&&(le=o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(E),oe=1/(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F)-le));const fe=U;fe.x=Number.POSITIVE_INFINITY,fe.y=Number.POSITIVE_INFINITY,fe.z=Number.POSITIVE_INFINITY;const ue=b;ue.x=Number.NEGATIVE_INFINITY,ue.y=Number.NEGATIVE_INFINITY,ue.z=Number.NEGATIVE_INFINITY;let ce=Number.POSITIVE_INFINITY;const de=w*M,he=de+(T>0?2*w+2*M:0),me=new Array(he),ge=new Array(he),pe=new Array(he),xe=R?new Array(he):[],we=H?new Array(he):[];let ke=0,ye=M,Ie=0,Ue=w;V&&(--ke,++ye,--Ie,++Ue);const be=1e-5;for(let t=ke;t<ye;++t){let i=t;i<0&&(i=0),i>=M&&(i=M-1);let n=D.north-K*i;n=v?p(n):g-2*h(m(-n*B));let r=(n-E)/(F-E);r=s.CesiumMath.clamp(r,0,1);const l=t===ke,f=t===ye-1;T>0&&(l?n+=be*Q:f&&(n-=be*Q));const k=u(n),I=c(n),U=ie*I;let b;R&&(b=(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(n)-le)*oe);for(let t=Ie;t<Ue;++t){let n=t;n<0&&(n=0),n>=w&&(n=w-1);const o=i*(w*Z)+n*Z;let h;if(1===X)h=x[o];else{let e;if(h=0,G)for(e=0;e<X;++e)h=h*j+x[o+e];else for(e=X-1;e>=0;--e)h=h*j+x[o+e]}h=h*Y+W,ne=Math.max(ne,h),ae=Math.min(ae,h);let m=D.west+J*n;v?m=p(m):m*=B;let g=(m-P)/(C-P);g=s.CesiumMath.clamp(g,0,1);let V=i*w+n;if(T>0){const e=t===Ie,a=t===Ue-1,r=l||f||e||a;if((l||f)&&(e||a))continue;r&&(h-=T,e?(V=de+(M-i-1),m-=be*q):f?V=de+M+(w-n-1):a?(V=de+M+w+i,m+=be*q):l&&(V=de+M+w+M+n))}const S=k*u(m),E=k*c(m),F=ee*S,N=te*E,O=1/d(F*S+N*E+U*I),L=F*O,z=N*O,_=U*O,Q=new e.Cartesian3;Q.x=L+S*h,Q.y=z+E*h,Q.z=_+I*h,a.Matrix4.multiplyByPoint(se,Q,y),e.Cartesian3.minimumByComponent(y,fe,fe),e.Cartesian3.maximumByComponent(y,ue,ue),ce=Math.min(ce,h),me[V]=Q,pe[V]=new a.Cartesian2(g,r),ge[V]=h,R&&(xe[V]=b),H&&(we[V]=A.geodeticSurfaceNormal(Q))}}const Me=i.BoundingSphere.fromPoints(me);let Te,Ve;if(n.defined(S)&&(Te=l.OrientedBoundingBox.fromRectangle(S,ae,ne,A)),O){Ve=new r.EllipsoidalOccluder(A).computeHorizonCullingPointPossiblyUnderEllipsoid(N,me,ae)}const ve=new t.AxisAlignedBoundingBox(fe,ue,N),Ae=new r.TerrainEncoding(N,ve,ce,ne,re,!1,R,H,L,z),Be=new Float32Array(he*Ae.stride);let De=0;for(let e=0;e<he;++e)De=Ae.encode(Be,De,me[e],pe[e],ge[e],void 0,xe[e],we[e]);return{vertices:Be,maximumHeight:ne,minimumHeight:ae,encoding:Ae,boundingSphere3D:Me,orientedBoundingBox:Te,occludeePointInScaledSpace:Ve}};var M,T=k,V={exports:{}};M=V, /* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */ -function(){var e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p=(e={defaultNoDataValue:-34027999387901484e22,decode:function(r,s){var l=(s=s||{}).encodedMaskData||null===s.encodedMaskData,o=n(r,s.inputOffset||0,l),f=null!==s.noDataValue?s.noDataValue:e.defaultNoDataValue,u=t(o,s.pixelType||Float32Array,s.encodedMaskData,f,s.returnMask),c={width:o.width,height:o.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:o.pixels.maxValue,noDataValue:f};return u.resultMask&&(c.maskData=u.resultMask),s.returnEncodedMask&&o.mask&&(c.encodedMaskData=o.mask.bitset?o.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=i(o),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=a(o))),c}},t=function(e,t,i,a,n){var s,l,o,f=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),m=2*e.maxZError,g=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),l=new t(e.width*e.height),n&&i&&(o=new Uint8Array(e.width*e.height));for(var p,x,w=new Float32Array(d*h),k=0;k<=c;k++){var y=k!==c?h:e.height%c;if(0!==y)for(var I=0;I<=u;I++){var U=I!==u?d:e.width%u;if(0!==U){var b,M,T,V,v=k*e.width*h+I*d,A=e.width-U,B=e.pixels.blocks[f];if(B.encoding<2?(0===B.encoding?b=B.rawData:(r(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,m,w,e.pixels.maxValue),b=w),M=0):T=2===B.encoding?0:B.offset,i)for(x=0;x<y;x++){for(7&v&&(V=i[v>>3],V<<=7&v),p=0;p<U;p++)7&v||(V=i[v>>3]),128&V?(o&&(o[v]=1),g=g>(s=B.encoding<2?b[M++]:T)?s:g,l[v++]=s):(o&&(o[v]=0),l[v++]=a),V<<=1;v+=A}else if(B.encoding<2)for(x=0;x<y;x++){for(p=0;p<U;p++)g=g>(s=b[M++])?s:g,l[v++]=s;v+=A}else for(g=g>T?T:g,x=0;x<y;x++){for(p=0;p<U;p++)l[v++]=T;v+=A}if(1===B.encoding&&M!==B.numValidPixels)throw"Block and Mask do not match";f++}}}return{resultPixels:l,resultMask:o,minValue:g}},i=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},a=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},a=0;a<t;a++){var n=e.pixels.blocks[a];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},n=function(e,t,i){var a={},n=new Uint8Array(e,t,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;t+=10;var r=new DataView(e,t,24);if(a.fileVersion=r.getInt32(0,!0),a.imageType=r.getInt32(4,!0),a.height=r.getUint32(8,!0),a.width=r.getUint32(12,!0),a.maxZError=r.getFloat64(16,!0),t+=24,!i)if(r=new DataView(e,t,16),a.mask={},a.mask.numBlocksY=r.getUint32(0,!0),a.mask.numBlocksX=r.getUint32(4,!0),a.mask.numBytes=r.getUint32(8,!0),a.mask.maxValue=r.getFloat32(12,!0),t+=16,a.mask.numBytes>0){var s=new Uint8Array(Math.ceil(a.width*a.height/8)),l=(r=new DataView(e,t,a.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(l>0)for(;l--;)s[f++]=r.getUint8(o++);else{var u=r.getUint8(o++);for(l=-l;l--;)s[f++]=u}l=r.getInt16(o,!0),o+=2}while(o<a.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=s,t+=a.mask.numBytes}else 0==(a.mask.numBytes|a.mask.numBlocksY|a.mask.maxValue)&&(a.mask.bitset=new Uint8Array(Math.ceil(a.width*a.height/8)));r=new DataView(e,t,16),a.pixels={},a.pixels.numBlocksY=r.getUint32(0,!0),a.pixels.numBlocksX=r.getUint32(4,!0),a.pixels.numBytes=r.getUint32(8,!0),a.pixels.maxValue=r.getFloat32(12,!0),t+=16;var c=a.pixels.numBlocksX,d=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),m=d+(a.height%d>0?1:0);a.pixels.blocks=new Array(h*m);for(var g=0,p=0;p<m;p++)for(var x=0;x<h;x++){var w=0,k=e.byteLength-t;r=new DataView(e,t,Math.min(10,k));var y={};a.pixels.blocks[g++]=y;var I=r.getUint8(0);if(w++,y.encoding=63&I,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==I&&2!==I){if(I>>=6,y.offsetType=I,2===I)y.offset=r.getInt8(1),w++;else if(1===I)y.offset=r.getInt16(1,!0),w+=2;else{if(0!==I)throw"Invalid block offset type";y.offset=r.getFloat32(1,!0),w+=4}if(1===y.encoding)if(I=r.getUint8(w),w++,y.bitsPerPixel=63&I,I>>=6,y.numValidPixelsType=I,2===I)y.numValidPixels=r.getUint8(w),w++;else if(1===I)y.numValidPixels=r.getUint16(w,!0),w+=2;else{if(0!==I)throw"Invalid valid pixel count type";y.numValidPixels=r.getUint32(w,!0),w+=4}}var U;if(t+=w,3!==y.encoding)if(0===y.encoding){var b=(a.pixels.numBytes-1)/4;if(b!==Math.floor(b))throw"uncompressed block has invalid length";U=new ArrayBuffer(4*b),new Uint8Array(U).set(new Uint8Array(e,t,4*b));var M=new Float32Array(U);y.rawData=M,t+=4*b}else if(1===y.encoding){var T=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),V=Math.ceil(T/4);U=new ArrayBuffer(4*V),new Uint8Array(U).set(new Uint8Array(e,t,T)),y.stuffedData=new Uint32Array(U),t+=T}}else t++}return a.eofOffset=t,a},r=function(e,t,i,a,n,r,s){var l,o,f,u=(1<<t)-1,c=0,d=0,h=Math.ceil((s-a)/n),m=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*m,l=0;l<i;l++){if(0===d&&(f=e[c++],d=32),d>=t)o=f>>>d-t&u,d-=t;else{var g=t-d;o=(f&u)<<g&u,o+=(f=e[c++])>>>(d=32-g)}r[l]=o<h?a+o*n:s}return r},e),x=(s=function(e,t,i,a,n,r,s,l){var o,f,u,c,d,h=(1<<i)-1,m=0,g=0,p=4*e.length-Math.ceil(i*a/8);if(e[e.length-1]<<=8*p,n)for(o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=n[f];else for(d=Math.ceil((l-r)/s),o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?r+f*s:l},l=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;var g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32),c>=t?(d=s>>>c-t&l,c-=t):(d=(s&l)<<(u=t-c)&l,d+=(s=e[o++])>>>(c=32-u)),h[f]=d<g?a+d*n:r;return h.unshift(a),h},o=function(e,t,i,a,n,r,s,l){var o,f,u,c,d=(1<<i)-1,h=0,m=0,g=0;if(n)for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=n[f];else{var p=Math.ceil((l-r)/s);for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=f<p?r+f*s:l}return t},f=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32,h=0),c>=t?(d=s>>>h&l,c-=t,h+=t):(d=s>>>h&l,c=32-(u=t-c),d|=((s=e[o++])&(1<<u)-1)<<t-u,h=u),m[f]=d<g?a+d*n:r;return m.unshift(a),m},u=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=4*e.length-Math.ceil(i*a/8);for(e[e.length-1]<<=8*c,n=0;n<a;n++)0===u&&(s=e[f++],u=32),u>=i?(r=s>>>u-i&o,u-=i):(r=(s&o)<<(l=i-u)&o,r+=(s=e[f++])>>>(u=32-l)),t[n]=r;return t},c=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=0;for(n=0;n<a;n++)0===u&&(s=e[f++],u=32,c=0),u>=i?(r=s>>>c&o,u-=i,c+=i):(r=s>>>c&o,u=32-(l=i-u),r|=((s=e[f++])&(1<<l)-1)<<i-l,c=l),t[n]=r;return t},d={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,a=e.length,n=Math.floor(a/2),r=0;n;){var s=n>=359?359:n;n-=s;do{t+=e[r++]<<8,i+=t+=e[r++]}while(--s);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&a&&(i+=t+=e[r]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,a=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,a),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var r,s=new DataView(e,i,8),l=s.getInt32(0,!0);if(n.fileVersion=l,i+=4,l>=3&&(n.checksum=s.getUint32(4,!0),i+=4),s=new DataView(e,i,12),n.height=s.getUint32(0,!0),n.width=s.getUint32(4,!0),i+=8,l>=4?(n.numDims=s.getUint32(8,!0),i+=4):n.numDims=1,s=new DataView(e,i,40),n.numValidPixel=s.getUint32(0,!0),n.microBlockSize=s.getInt32(4,!0),n.blobSize=s.getInt32(8,!0),n.imageType=s.getInt32(12,!0),n.maxZError=s.getFloat64(16,!0),n.zMin=s.getFloat64(24,!0),n.zMax=s.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,l>=3&&(r=l>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,a=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),r=this.readSubArray(e,t.ptr,a,n),s=this.readSubArray(e,t.ptr+n,a,n);t.ptr+=2*n;var l,o=!0;for(l=0;l<i.numDims;l++)if(r[l]!==s[l]){o=!1;break}return i.minValues=r,i.maxValues=s,o},readSubArray:function(e,t,i,a){var n;if(i===Uint8Array)n=new Uint8Array(e,t,a);else{var r=new ArrayBuffer(a);new Uint8Array(r).set(new Uint8Array(e,t,a)),n=new i(r)}return n},readMask:function(e,t){var i,a,n=t.ptr,r=t.headerInfo,s=r.width*r.height,l=r.numValidPixel,o=new DataView(e,n,4),f={};if(f.numBytes=o.getUint32(0,!0),n+=4,(0===l||s===l)&&0!==f.numBytes)throw"invalid mask";if(0===l)i=new Uint8Array(Math.ceil(s/8)),f.bitset=i,a=new Uint8Array(s),t.pixels.resultMask=a,n+=f.numBytes;else if(f.numBytes>0){i=new Uint8Array(Math.ceil(s/8));var u=(o=new DataView(e,n,f.numBytes)).getInt16(0,!0),c=2,d=0,h=0;do{if(u>0)for(;u--;)i[d++]=o.getUint8(c++);else for(h=o.getUint8(c++),u=-u;u--;)i[d++]=h;u=o.getInt16(c,!0),c+=2}while(c<f.numBytes);if(-32768!==u||d<i.length)throw"Unexpected end of mask RLE encoding";a=new Uint8Array(s);var m=0,g=0;for(g=0;g<s;g++)7&g?(m=i[g>>3],m<<=7&g):m=i[g>>3],128&m&&(a[g]=1);t.pixels.resultMask=a,f.bitset=i,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,i){var a,n=t.ptr,r=t.headerInfo,s=r.numDims,l=r.width*r.height,o=r.imageType,f=r.numValidPixel*d.getDataTypeSize(o)*s,u=t.pixels.resultMask;if(i===Uint8Array)a=new Uint8Array(e,n,f);else{var c=new ArrayBuffer(f);new Uint8Array(c).set(new Uint8Array(e,n,f)),a=new i(c)}if(a.length===l*s)t.pixels.resultPixels=a;else{t.pixels.resultPixels=new i(l*s);var h=0,m=0,g=0,p=0;if(s>1)for(g=0;g<s;g++)for(p=g*l,m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[p+m]=a[h++]);else for(m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[m]=a[h++])}return n+=f,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(e,t.ptr,16);if(t.ptr+=16,a.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=a.getInt32(4,!0),r=a.getInt32(8,!0),s=a.getInt32(12,!0);if(r>=s)return!1;var l=new Uint32Array(s-r);d.decodeBits(e,t,l);var o,f,u,c,m=[];for(o=r;o<s;o++)m[f=o-(o<n?0:n)]={first:l[o-r],second:null};var g=e.byteLength-t.ptr,p=Math.ceil(g/4),x=new ArrayBuffer(4*p);new Uint8Array(x).set(new Uint8Array(e,t.ptr,g));var w,k=new Uint32Array(x),y=0,I=0;for(w=k[0],o=r;o<s;o++)(c=m[f=o-(o<n?0:n)].first)>0&&(m[f].second=w<<y>>>32-c,32-y>=c?32===(y+=c)&&(y=0,w=k[++I]):(y+=c-32,w=k[++I],m[f].second|=w>>>32-y));var U=0,b=0,M=new h;for(o=0;o<m.length;o++)void 0!==m[o]&&(U=Math.max(U,m[o].first));b=U>=i?i:U,U>=30&&console.log("WARning, large NUM LUT BITS IS "+U);var T,V,v,A,B,D=[];for(o=r;o<s;o++)if((c=m[f=o-(o<n?0:n)].first)>0)if(T=[c,f],c<=b)for(V=m[f].second<<b-c,v=1<<b-c,u=0;u<v;u++)D[V|u]=T;else for(V=m[f].second,B=M,A=c-1;A>=0;A--)V>>>A&1?(B.right||(B.right=new h),B=B.right):(B.left||(B.left=new h),B=B.left),0!==A||B.val||(B.val=T[1]);return{decodeLut:D,numBitsLUTQick:b,numBitsLUT:U,tree:M,stuffedData:k,srcPtr:I,bitPos:y}},readHuffman:function(e,t,i){var a,n,r,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,x=this.readHuffmanTree(e,t),w=x.decodeLut,k=x.tree,y=x.stuffedData,I=x.srcPtr,U=x.bitPos,b=x.numBitsLUTQick,M=x.numBitsLUT,T=0===t.headerInfo.imageType?128:0,V=t.pixels.resultMask,v=0;U>0&&(I++,U=0);var A,B=y[I],D=1===t.encodeMode,S=new i(p*h),P=S;for(A=0;A<d.numDims;A++){if(h>1&&(P=new i(S.buffer,p*A,p),v=0),t.headerInfo.numValidPixel===g*m)for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++){if(n=0,l=s=B<<U>>>32-b,32-U<b&&(l=s|=y[I+1]>>>64-U-b),w[l])n=w[l][1],U+=w[l][0];else for(l=s=B<<U>>>32-M,32-U<M&&(l=s|=y[I+1]>>>64-U-M),a=k,c=0;c<M;c++)if(!(a=s>>>M-c-1&1?a.right:a.left).left&&!a.right){n=a.val,U=U+c+1;break}U>=32&&(U-=32,B=y[++I]),r=n-T,D?(r+=f>0?v:o>0?P[u-g]:v,r&=255,P[u]=r,v=r):P[u]=r}else for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++)if(V[u]){if(n=0,l=s=B<<U>>>32-b,32-U<b&&(l=s|=y[I+1]>>>64-U-b),w[l])n=w[l][1],U+=w[l][0];else for(l=s=B<<U>>>32-M,32-U<M&&(l=s|=y[I+1]>>>64-U-M),a=k,c=0;c<M;c++)if(!(a=s>>>M-c-1&1?a.right:a.left).left&&!a.right){n=a.val,U=U+c+1;break}U>=32&&(U-=32,B=y[++I]),r=n-T,D?(f>0&&V[u-1]?r+=v:o>0&&V[u-g]?r+=P[u-g]:r+=v,r&=255,P[u]=r,v=r):P[u]=r}t.ptr=t.ptr+4*(I+1)+(U>0?4:0)}t.pixels.resultPixels=S},decodeBits:function(e,t,i,a,n){var r=t.headerInfo,d=r.fileVersion,h=0,m=new DataView(e,t.ptr,5),g=m.getUint8(0);h++;var p=g>>6,x=0===p?4:3-p,w=(32&g)>0,k=31&g,y=0;if(1===x)y=m.getUint8(h),h++;else if(2===x)y=m.getUint16(h,!0),h+=2;else{if(4!==x)throw"Invalid valid pixel count type";y=m.getUint32(h,!0),h+=4}var I,U,b,M,T,V,v,A,B,D=2*r.maxZError,S=r.numDims>1?r.maxValues[n]:r.zMax;if(w){for(t.counter.lut++,A=m.getUint8(h),h++,M=Math.ceil((A-1)*k/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),b=new Uint8Array(U),t.ptr+=h,b.set(new Uint8Array(e,t.ptr,M)),v=new Uint32Array(U),t.ptr+=M,B=0;A-1>>>B;)B++;M=Math.ceil(y*B/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),(b=new Uint8Array(U)).set(new Uint8Array(e,t.ptr,M)),I=new Uint32Array(U),t.ptr+=M,V=d>=3?f(v,k,A-1,a,D,S):l(v,k,A-1,a,D,S),d>=3?o(I,i,B,y,V):s(I,i,B,y,V)}else t.counter.bitstuffer++,B=k,t.ptr+=h,B>0&&(M=Math.ceil(y*B/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),(b=new Uint8Array(U)).set(new Uint8Array(e,t.ptr,M)),I=new Uint32Array(U),t.ptr+=M,d>=3?null==a?c(I,i,B,y):o(I,i,B,y,!1,a,D,S):null==a?u(I,i,B,y):s(I,i,B,y,!1,a,D,S))},readTiles:function(e,t,i){var a=t.headerInfo,n=a.width,r=a.height,s=a.microBlockSize,l=a.imageType,o=d.getDataTypeSize(l),f=Math.ceil(n/s),u=Math.ceil(r/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f,t.pixels.ptr=0;var c,h,m,g,p,x,w,k,y=0,I=0,U=0,b=0,M=0,T=0,V=0,v=0,A=0,B=0,D=0,S=0,P=0,E=0,C=0,F=new i(s*s),N=r%s||s,O=n%s||s,R=a.numDims,L=t.pixels.resultMask,z=t.pixels.resultPixels;for(U=0;U<u;U++)for(M=U!==u-1?s:N,b=0;b<f;b++)for(B=U*n*s+b*s,D=n-(T=b!==f-1?s:O),k=0;k<R;k++){if(R>1&&(z=new i(t.pixels.resultPixels.buffer,n*r*k*o,n*r)),V=e.byteLength-t.ptr,h={},C=0,C++,A=(v=(c=new DataView(e,t.ptr,Math.min(10,V))).getUint8(0))>>6&255,(v>>2&15)!=(b*s>>3&15))throw"integrity issue";if((p=3&v)>3)throw t.ptr+=C,"Invalid block encoding ("+p+")";if(2!==p)if(0===p){if(t.counter.uncompressed++,t.ptr+=C,S=(S=M*T*o)<(P=e.byteLength-t.ptr)?S:P,m=new ArrayBuffer(S%o==0?S:S+o-S%o),new Uint8Array(m).set(new Uint8Array(e,t.ptr,S)),g=new i(m),E=0,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=g[E++]),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=g[E++];B+=D}t.ptr+=E*o}else if(x=d.getDataTypeUsed(l,A),w=d.getOnePixel(h,C,x,c),C+=d.getDataTypeSize(x),3===p)if(t.ptr+=C,t.counter.constantoffset++,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=w),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=w;B+=D}else if(t.ptr+=C,d.decodeBits(e,t,F,w,k),C=0,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=F[C++]),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=F[C++];B+=D}else t.counter.constant++,t.ptr+=C}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:d.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,n=a*i,r=0,s=0,l=0,o=e.pixels.resultMask;if(o)if(i>1)for(r=0;r<i;r++)for(l=r*a,s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[l+s]=t);else for(s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[s]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(s=0;s<n;s++)e.pixels.resultPixels[s]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,a){var n=0;switch(i){case 0:n=a.getInt8(t);break;case 1:n=a.getUint8(t);break;case 2:n=a.getInt16(t,!0);break;case 3:n=a.getUint16(t,!0);break;case 4:n=a.getInt32(t,!0);break;case 5:n=a.getUInt32(t,!0);break;case 6:n=a.getFloat32(t,!0);break;case 7:n=a.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},h=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,a=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},d.readHeaderInfo(e,n)){var r=n.headerInfo,s=r.fileVersion,l=d.getDataTypeArray(r.imageType);d.readMask(e,n),r.numValidPixel===r.width*r.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var o,f=r.width*r.height;if(n.pixels.resultPixels=new l(f*r.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==r.numValidPixel)if(r.zMax===r.zMin)d.constructConstantSurface(n);else if(s>=4&&d.checkMinMaxRanges(e,n))d.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),c=u.getUint8(0);if(n.ptr++,c)d.readDataOneSweep(e,n,l);else if(s>1&&r.imageType<=1&&Math.abs(r.maxZError-.5)<1e-5){var h=u.getUint8(1);if(n.ptr++,n.encodeMode=h,h>2||s<4&&h>1)throw"Invalid Huffman flag "+h;h?d.readHuffman(e,n,l):d.readTiles(e,n,l)}else d.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(o=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(o)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(o=n.headerInfo.blobSize-n.ptr,Math.abs(o)>=1&&(n.eofOffset=n.headerInfo.blobSize));var m={width:r.width,height:r.height,pixelData:n.pixels.resultPixels,minValue:r.zMin,maxValue:r.zMax,validPixelCount:r.numValidPixel,dimCount:r.numDims,dimStats:{minValues:r.minValues,maxValues:r.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&d.isValidPixelValue(r.imageType,i)){var g=n.pixels.resultMask;for(a=0;a<f;a++)g[a]||(m.pixelData[a]=i);m.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(m.fileInfo=d.formatFileInfo(n)),m}},getBandCount:function(e){for(var t=0,i=0,a={ptr:0,pixels:{}};i<e.byteLength-58;)d.readHeaderInfo(e,a),i+=a.headerInfo.blobSize,t++,a.ptr=i;return t}}),w=(m=new ArrayBuffer(4),g=new Uint8Array(m),new Uint32Array(m)[0]=1,1===g[0]),k={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var i,a,n=(t=t||{}).inputOffset||0,r=new Uint8Array(e,n,10),s=String.fromCharCode.apply(null,r);if("CntZImage"===s.trim())i=p,a=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;i=x,a=2}for(var l,o,f,u,c,d,h=0,m=e.byteLength-10,g=[],k={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<m;){var y=i.decode(e,{inputOffset:n,encodedMaskData:l,maskData:f,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===h&&(l=y.encodedMaskData,f=y.maskData,k.width=y.width,k.height=y.height,k.dimCount=y.dimCount||1,k.pixelType=y.pixelType||y.fileInfo.pixelType,k.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),h++,k.pixels.push(y.pixelData),k.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(d=k.width*k.height,k.bandMasks=g,(f=new Uint8Array(d)).set(g[0]),u=1;u<g.length;u++)for(o=g[u],c=0;c<d;c++)f[c]=f[c]&o[c];k.maskData=f}return k}};M.exports?M.exports=k:this.Lerc=k}();var v=V;return u((function(t,i){if(t.encoding===w.LERC){let e;try{e=v.decode(t.heightmap)}catch(e){throw new f.RuntimeError(e)}if(e.statistics[0].minValue===Number.MAX_VALUE)throw new f.RuntimeError("Invalid tile data");t.heightmap=e.pixels[0],t.width=e.width,t.height=e.height}t.ellipsoid=e.Ellipsoid.clone(t.ellipsoid),t.rectangle=a.Rectangle.clone(t.rectangle);const n=T.computeVertices(t),r=n.vertices;return i.push(r.buffer),{vertices:r.buffer,numberOfAttributes:n.encoding.stride,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,gridWidth:t.width,gridHeight:t.height,boundingSphere3D:n.boundingSphere3D,orientedBoundingBox:n.orientedBoundingBox,occludeePointInScaledSpace:n.occludeePointInScaledSpace,encoding:n.encoding,westIndicesSouthToNorth:n.westIndicesSouthToNorth,southIndicesEastToWest:n.southIndicesEastToWest,eastIndicesNorthToSouth:n.eastIndicesNorthToSouth,northIndicesWestToEast:n.northIndicesWestToEast}}))})); +function(){var e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p=(e={defaultNoDataValue:-34027999387901484e22,decode:function(r,s){var l=(s=s||{}).encodedMaskData||null===s.encodedMaskData,o=n(r,s.inputOffset||0,l),f=null!==s.noDataValue?s.noDataValue:e.defaultNoDataValue,u=t(o,s.pixelType||Float32Array,s.encodedMaskData,f,s.returnMask),c={width:o.width,height:o.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:o.pixels.maxValue,noDataValue:f};return u.resultMask&&(c.maskData=u.resultMask),s.returnEncodedMask&&o.mask&&(c.encodedMaskData=o.mask.bitset?o.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=i(o),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=a(o))),c}},t=function(e,t,i,a,n){var s,l,o,f=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),m=2*e.maxZError,g=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),l=new t(e.width*e.height),n&&i&&(o=new Uint8Array(e.width*e.height));for(var p,x,w=new Float32Array(d*h),k=0;k<=c;k++){var y=k!==c?h:e.height%c;if(0!==y)for(var I=0;I<=u;I++){var U=I!==u?d:e.width%u;if(0!==U){var b,M,T,V,v=k*e.width*h+I*d,A=e.width-U,B=e.pixels.blocks[f];if(B.encoding<2?(0===B.encoding?b=B.rawData:(r(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,m,w,e.pixels.maxValue),b=w),M=0):T=2===B.encoding?0:B.offset,i)for(x=0;x<y;x++){for(7&v&&(V=i[v>>3],V<<=7&v),p=0;p<U;p++)7&v||(V=i[v>>3]),128&V?(o&&(o[v]=1),g=g>(s=B.encoding<2?b[M++]:T)?s:g,l[v++]=s):(o&&(o[v]=0),l[v++]=a),V<<=1;v+=A}else if(B.encoding<2)for(x=0;x<y;x++){for(p=0;p<U;p++)g=g>(s=b[M++])?s:g,l[v++]=s;v+=A}else for(g=g>T?T:g,x=0;x<y;x++){for(p=0;p<U;p++)l[v++]=T;v+=A}if(1===B.encoding&&M!==B.numValidPixels)throw"Block and Mask do not match";f++}}}return{resultPixels:l,resultMask:o,minValue:g}},i=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},a=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},a=0;a<t;a++){var n=e.pixels.blocks[a];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},n=function(e,t,i){var a={},n=new Uint8Array(e,t,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;t+=10;var r=new DataView(e,t,24);if(a.fileVersion=r.getInt32(0,!0),a.imageType=r.getInt32(4,!0),a.height=r.getUint32(8,!0),a.width=r.getUint32(12,!0),a.maxZError=r.getFloat64(16,!0),t+=24,!i)if(r=new DataView(e,t,16),a.mask={},a.mask.numBlocksY=r.getUint32(0,!0),a.mask.numBlocksX=r.getUint32(4,!0),a.mask.numBytes=r.getUint32(8,!0),a.mask.maxValue=r.getFloat32(12,!0),t+=16,a.mask.numBytes>0){var s=new Uint8Array(Math.ceil(a.width*a.height/8)),l=(r=new DataView(e,t,a.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(l>0)for(;l--;)s[f++]=r.getUint8(o++);else{var u=r.getUint8(o++);for(l=-l;l--;)s[f++]=u}l=r.getInt16(o,!0),o+=2}while(o<a.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=s,t+=a.mask.numBytes}else 0==(a.mask.numBytes|a.mask.numBlocksY|a.mask.maxValue)&&(a.mask.bitset=new Uint8Array(Math.ceil(a.width*a.height/8)));r=new DataView(e,t,16),a.pixels={},a.pixels.numBlocksY=r.getUint32(0,!0),a.pixels.numBlocksX=r.getUint32(4,!0),a.pixels.numBytes=r.getUint32(8,!0),a.pixels.maxValue=r.getFloat32(12,!0),t+=16;var c=a.pixels.numBlocksX,d=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),m=d+(a.height%d>0?1:0);a.pixels.blocks=new Array(h*m);for(var g=0,p=0;p<m;p++)for(var x=0;x<h;x++){var w=0,k=e.byteLength-t;r=new DataView(e,t,Math.min(10,k));var y={};a.pixels.blocks[g++]=y;var I=r.getUint8(0);if(w++,y.encoding=63&I,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==I&&2!==I){if(I>>=6,y.offsetType=I,2===I)y.offset=r.getInt8(1),w++;else if(1===I)y.offset=r.getInt16(1,!0),w+=2;else{if(0!==I)throw"Invalid block offset type";y.offset=r.getFloat32(1,!0),w+=4}if(1===y.encoding)if(I=r.getUint8(w),w++,y.bitsPerPixel=63&I,I>>=6,y.numValidPixelsType=I,2===I)y.numValidPixels=r.getUint8(w),w++;else if(1===I)y.numValidPixels=r.getUint16(w,!0),w+=2;else{if(0!==I)throw"Invalid valid pixel count type";y.numValidPixels=r.getUint32(w,!0),w+=4}}var U;if(t+=w,3!==y.encoding)if(0===y.encoding){var b=(a.pixels.numBytes-1)/4;if(b!==Math.floor(b))throw"uncompressed block has invalid length";U=new ArrayBuffer(4*b),new Uint8Array(U).set(new Uint8Array(e,t,4*b));var M=new Float32Array(U);y.rawData=M,t+=4*b}else if(1===y.encoding){var T=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),V=Math.ceil(T/4);U=new ArrayBuffer(4*V),new Uint8Array(U).set(new Uint8Array(e,t,T)),y.stuffedData=new Uint32Array(U),t+=T}}else t++}return a.eofOffset=t,a},r=function(e,t,i,a,n,r,s){var l,o,f,u=(1<<t)-1,c=0,d=0,h=Math.ceil((s-a)/n),m=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*m,l=0;l<i;l++){if(0===d&&(f=e[c++],d=32),d>=t)o=f>>>d-t&u,d-=t;else{var g=t-d;o=(f&u)<<g&u,o+=(f=e[c++])>>>(d=32-g)}r[l]=o<h?a+o*n:s}return r},e),x=(s=function(e,t,i,a,n,r,s,l){var o,f,u,c,d,h=(1<<i)-1,m=0,g=0,p=4*e.length-Math.ceil(i*a/8);if(e[e.length-1]<<=8*p,n)for(o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=n[f];else for(d=Math.ceil((l-r)/s),o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?r+f*s:l},l=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;var g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32),c>=t?(d=s>>>c-t&l,c-=t):(d=(s&l)<<(u=t-c)&l,d+=(s=e[o++])>>>(c=32-u)),h[f]=d<g?a+d*n:r;return h.unshift(a),h},o=function(e,t,i,a,n,r,s,l){var o,f,u,c,d=(1<<i)-1,h=0,m=0,g=0;if(n)for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=n[f];else{var p=Math.ceil((l-r)/s);for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=f<p?r+f*s:l}return t},f=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32,h=0),c>=t?(d=s>>>h&l,c-=t,h+=t):(d=s>>>h&l,c=32-(u=t-c),d|=((s=e[o++])&(1<<u)-1)<<t-u,h=u),m[f]=d<g?a+d*n:r;return m.unshift(a),m},u=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=4*e.length-Math.ceil(i*a/8);for(e[e.length-1]<<=8*c,n=0;n<a;n++)0===u&&(s=e[f++],u=32),u>=i?(r=s>>>u-i&o,u-=i):(r=(s&o)<<(l=i-u)&o,r+=(s=e[f++])>>>(u=32-l)),t[n]=r;return t},c=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=0;for(n=0;n<a;n++)0===u&&(s=e[f++],u=32,c=0),u>=i?(r=s>>>c&o,u-=i,c+=i):(r=s>>>c&o,u=32-(l=i-u),r|=((s=e[f++])&(1<<l)-1)<<i-l,c=l),t[n]=r;return t},d={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,a=e.length,n=Math.floor(a/2),r=0;n;){var s=n>=359?359:n;n-=s;do{t+=e[r++]<<8,i+=t+=e[r++]}while(--s);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&a&&(i+=t+=e[r]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,a=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,a),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var r,s=new DataView(e,i,8),l=s.getInt32(0,!0);if(n.fileVersion=l,i+=4,l>=3&&(n.checksum=s.getUint32(4,!0),i+=4),s=new DataView(e,i,12),n.height=s.getUint32(0,!0),n.width=s.getUint32(4,!0),i+=8,l>=4?(n.numDims=s.getUint32(8,!0),i+=4):n.numDims=1,s=new DataView(e,i,40),n.numValidPixel=s.getUint32(0,!0),n.microBlockSize=s.getInt32(4,!0),n.blobSize=s.getInt32(8,!0),n.imageType=s.getInt32(12,!0),n.maxZError=s.getFloat64(16,!0),n.zMin=s.getFloat64(24,!0),n.zMax=s.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,l>=3&&(r=l>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,a=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),r=this.readSubArray(e,t.ptr,a,n),s=this.readSubArray(e,t.ptr+n,a,n);t.ptr+=2*n;var l,o=!0;for(l=0;l<i.numDims;l++)if(r[l]!==s[l]){o=!1;break}return i.minValues=r,i.maxValues=s,o},readSubArray:function(e,t,i,a){var n;if(i===Uint8Array)n=new Uint8Array(e,t,a);else{var r=new ArrayBuffer(a);new Uint8Array(r).set(new Uint8Array(e,t,a)),n=new i(r)}return n},readMask:function(e,t){var i,a,n=t.ptr,r=t.headerInfo,s=r.width*r.height,l=r.numValidPixel,o=new DataView(e,n,4),f={};if(f.numBytes=o.getUint32(0,!0),n+=4,(0===l||s===l)&&0!==f.numBytes)throw"invalid mask";if(0===l)i=new Uint8Array(Math.ceil(s/8)),f.bitset=i,a=new Uint8Array(s),t.pixels.resultMask=a,n+=f.numBytes;else if(f.numBytes>0){i=new Uint8Array(Math.ceil(s/8));var u=(o=new DataView(e,n,f.numBytes)).getInt16(0,!0),c=2,d=0,h=0;do{if(u>0)for(;u--;)i[d++]=o.getUint8(c++);else for(h=o.getUint8(c++),u=-u;u--;)i[d++]=h;u=o.getInt16(c,!0),c+=2}while(c<f.numBytes);if(-32768!==u||d<i.length)throw"Unexpected end of mask RLE encoding";a=new Uint8Array(s);var m=0,g=0;for(g=0;g<s;g++)7&g?(m=i[g>>3],m<<=7&g):m=i[g>>3],128&m&&(a[g]=1);t.pixels.resultMask=a,f.bitset=i,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,i){var a,n=t.ptr,r=t.headerInfo,s=r.numDims,l=r.width*r.height,o=r.imageType,f=r.numValidPixel*d.getDataTypeSize(o)*s,u=t.pixels.resultMask;if(i===Uint8Array)a=new Uint8Array(e,n,f);else{var c=new ArrayBuffer(f);new Uint8Array(c).set(new Uint8Array(e,n,f)),a=new i(c)}if(a.length===l*s)t.pixels.resultPixels=a;else{t.pixels.resultPixels=new i(l*s);var h=0,m=0,g=0,p=0;if(s>1)for(g=0;g<s;g++)for(p=g*l,m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[p+m]=a[h++]);else for(m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[m]=a[h++])}return n+=f,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(e,t.ptr,16);if(t.ptr+=16,a.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=a.getInt32(4,!0),r=a.getInt32(8,!0),s=a.getInt32(12,!0);if(r>=s)return!1;var l=new Uint32Array(s-r);d.decodeBits(e,t,l);var o,f,u,c,m=[];for(o=r;o<s;o++)m[f=o-(o<n?0:n)]={first:l[o-r],second:null};var g=e.byteLength-t.ptr,p=Math.ceil(g/4),x=new ArrayBuffer(4*p);new Uint8Array(x).set(new Uint8Array(e,t.ptr,g));var w,k=new Uint32Array(x),y=0,I=0;for(w=k[0],o=r;o<s;o++)(c=m[f=o-(o<n?0:n)].first)>0&&(m[f].second=w<<y>>>32-c,32-y>=c?32===(y+=c)&&(y=0,w=k[++I]):(y+=c-32,w=k[++I],m[f].second|=w>>>32-y));var U=0,b=0,M=new h;for(o=0;o<m.length;o++)void 0!==m[o]&&(U=Math.max(U,m[o].first));b=U>=i?i:U,U>=30&&console.log("WARning, large NUM LUT BITS IS "+U);var T,V,v,A,B,D=[];for(o=r;o<s;o++)if((c=m[f=o-(o<n?0:n)].first)>0)if(T=[c,f],c<=b)for(V=m[f].second<<b-c,v=1<<b-c,u=0;u<v;u++)D[V|u]=T;else for(V=m[f].second,B=M,A=c-1;A>=0;A--)V>>>A&1?(B.right||(B.right=new h),B=B.right):(B.left||(B.left=new h),B=B.left),0!==A||B.val||(B.val=T[1]);return{decodeLut:D,numBitsLUTQick:b,numBitsLUT:U,tree:M,stuffedData:k,srcPtr:I,bitPos:y}},readHuffman:function(e,t,i){var a,n,r,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,x=this.readHuffmanTree(e,t),w=x.decodeLut,k=x.tree,y=x.stuffedData,I=x.srcPtr,U=x.bitPos,b=x.numBitsLUTQick,M=x.numBitsLUT,T=0===t.headerInfo.imageType?128:0,V=t.pixels.resultMask,v=0;U>0&&(I++,U=0);var A,B=y[I],D=1===t.encodeMode,S=new i(p*h),P=S;for(A=0;A<d.numDims;A++){if(h>1&&(P=new i(S.buffer,p*A,p),v=0),t.headerInfo.numValidPixel===g*m)for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++){if(n=0,l=s=B<<U>>>32-b,32-U<b&&(l=s|=y[I+1]>>>64-U-b),w[l])n=w[l][1],U+=w[l][0];else for(l=s=B<<U>>>32-M,32-U<M&&(l=s|=y[I+1]>>>64-U-M),a=k,c=0;c<M;c++)if(!(a=s>>>M-c-1&1?a.right:a.left).left&&!a.right){n=a.val,U=U+c+1;break}U>=32&&(U-=32,B=y[++I]),r=n-T,D?(r+=f>0?v:o>0?P[u-g]:v,r&=255,P[u]=r,v=r):P[u]=r}else for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++)if(V[u]){if(n=0,l=s=B<<U>>>32-b,32-U<b&&(l=s|=y[I+1]>>>64-U-b),w[l])n=w[l][1],U+=w[l][0];else for(l=s=B<<U>>>32-M,32-U<M&&(l=s|=y[I+1]>>>64-U-M),a=k,c=0;c<M;c++)if(!(a=s>>>M-c-1&1?a.right:a.left).left&&!a.right){n=a.val,U=U+c+1;break}U>=32&&(U-=32,B=y[++I]),r=n-T,D?(f>0&&V[u-1]?r+=v:o>0&&V[u-g]?r+=P[u-g]:r+=v,r&=255,P[u]=r,v=r):P[u]=r}t.ptr=t.ptr+4*(I+1)+(U>0?4:0)}t.pixels.resultPixels=S},decodeBits:function(e,t,i,a,n){var r=t.headerInfo,d=r.fileVersion,h=0,m=new DataView(e,t.ptr,5),g=m.getUint8(0);h++;var p=g>>6,x=0===p?4:3-p,w=(32&g)>0,k=31&g,y=0;if(1===x)y=m.getUint8(h),h++;else if(2===x)y=m.getUint16(h,!0),h+=2;else{if(4!==x)throw"Invalid valid pixel count type";y=m.getUint32(h,!0),h+=4}var I,U,b,M,T,V,v,A,B,D=2*r.maxZError,S=r.numDims>1?r.maxValues[n]:r.zMax;if(w){for(t.counter.lut++,A=m.getUint8(h),h++,M=Math.ceil((A-1)*k/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),b=new Uint8Array(U),t.ptr+=h,b.set(new Uint8Array(e,t.ptr,M)),v=new Uint32Array(U),t.ptr+=M,B=0;A-1>>>B;)B++;M=Math.ceil(y*B/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),(b=new Uint8Array(U)).set(new Uint8Array(e,t.ptr,M)),I=new Uint32Array(U),t.ptr+=M,V=d>=3?f(v,k,A-1,a,D,S):l(v,k,A-1,a,D,S),d>=3?o(I,i,B,y,V):s(I,i,B,y,V)}else t.counter.bitstuffer++,B=k,t.ptr+=h,B>0&&(M=Math.ceil(y*B/8),T=Math.ceil(M/4),U=new ArrayBuffer(4*T),(b=new Uint8Array(U)).set(new Uint8Array(e,t.ptr,M)),I=new Uint32Array(U),t.ptr+=M,d>=3?null==a?c(I,i,B,y):o(I,i,B,y,!1,a,D,S):null==a?u(I,i,B,y):s(I,i,B,y,!1,a,D,S))},readTiles:function(e,t,i){var a=t.headerInfo,n=a.width,r=a.height,s=a.microBlockSize,l=a.imageType,o=d.getDataTypeSize(l),f=Math.ceil(n/s),u=Math.ceil(r/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f,t.pixels.ptr=0;var c,h,m,g,p,x,w,k,y=0,I=0,U=0,b=0,M=0,T=0,V=0,v=0,A=0,B=0,D=0,S=0,P=0,E=0,C=0,F=new i(s*s),N=r%s||s,O=n%s||s,R=a.numDims,L=t.pixels.resultMask,z=t.pixels.resultPixels;for(U=0;U<u;U++)for(M=U!==u-1?s:N,b=0;b<f;b++)for(B=U*n*s+b*s,D=n-(T=b!==f-1?s:O),k=0;k<R;k++){if(R>1&&(z=new i(t.pixels.resultPixels.buffer,n*r*k*o,n*r)),V=e.byteLength-t.ptr,h={},C=0,C++,A=(v=(c=new DataView(e,t.ptr,Math.min(10,V))).getUint8(0))>>6&255,(v>>2&15)!=(b*s>>3&15))throw"integrity issue";if((p=3&v)>3)throw t.ptr+=C,"Invalid block encoding ("+p+")";if(2!==p)if(0===p){if(t.counter.uncompressed++,t.ptr+=C,S=(S=M*T*o)<(P=e.byteLength-t.ptr)?S:P,m=new ArrayBuffer(S%o==0?S:S+o-S%o),new Uint8Array(m).set(new Uint8Array(e,t.ptr,S)),g=new i(m),E=0,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=g[E++]),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=g[E++];B+=D}t.ptr+=E*o}else if(x=d.getDataTypeUsed(l,A),w=d.getOnePixel(h,C,x,c),C+=d.getDataTypeSize(x),3===p)if(t.ptr+=C,t.counter.constantoffset++,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=w),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=w;B+=D}else if(t.ptr+=C,d.decodeBits(e,t,F,w,k),C=0,L)for(y=0;y<M;y++){for(I=0;I<T;I++)L[B]&&(z[B]=F[C++]),B++;B+=D}else for(y=0;y<M;y++){for(I=0;I<T;I++)z[B++]=F[C++];B+=D}else t.counter.constant++,t.ptr+=C}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:d.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,n=a*i,r=0,s=0,l=0,o=e.pixels.resultMask;if(o)if(i>1)for(r=0;r<i;r++)for(l=r*a,s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[l+s]=t);else for(s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[s]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(s=0;s<n;s++)e.pixels.resultPixels[s]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,a){var n=0;switch(i){case 0:n=a.getInt8(t);break;case 1:n=a.getUint8(t);break;case 2:n=a.getInt16(t,!0);break;case 3:n=a.getUint16(t,!0);break;case 4:n=a.getInt32(t,!0);break;case 5:n=a.getUInt32(t,!0);break;case 6:n=a.getFloat32(t,!0);break;case 7:n=a.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},h=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,a=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},d.readHeaderInfo(e,n)){var r=n.headerInfo,s=r.fileVersion,l=d.getDataTypeArray(r.imageType);d.readMask(e,n),r.numValidPixel===r.width*r.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var o,f=r.width*r.height;if(n.pixels.resultPixels=new l(f*r.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==r.numValidPixel)if(r.zMax===r.zMin)d.constructConstantSurface(n);else if(s>=4&&d.checkMinMaxRanges(e,n))d.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),c=u.getUint8(0);if(n.ptr++,c)d.readDataOneSweep(e,n,l);else if(s>1&&r.imageType<=1&&Math.abs(r.maxZError-.5)<1e-5){var h=u.getUint8(1);if(n.ptr++,n.encodeMode=h,h>2||s<4&&h>1)throw"Invalid Huffman flag "+h;h?d.readHuffman(e,n,l):d.readTiles(e,n,l)}else d.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(o=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(o)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(o=n.headerInfo.blobSize-n.ptr,Math.abs(o)>=1&&(n.eofOffset=n.headerInfo.blobSize));var m={width:r.width,height:r.height,pixelData:n.pixels.resultPixels,minValue:r.zMin,maxValue:r.zMax,validPixelCount:r.numValidPixel,dimCount:r.numDims,dimStats:{minValues:r.minValues,maxValues:r.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&d.isValidPixelValue(r.imageType,i)){var g=n.pixels.resultMask;for(a=0;a<f;a++)g[a]||(m.pixelData[a]=i);m.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(m.fileInfo=d.formatFileInfo(n)),m}},getBandCount:function(e){for(var t=0,i=0,a={ptr:0,pixels:{}};i<e.byteLength-58;)d.readHeaderInfo(e,a),i+=a.headerInfo.blobSize,t++,a.ptr=i;return t}}),w=(m=new ArrayBuffer(4),g=new Uint8Array(m),new Uint32Array(m)[0]=1,1===g[0]),k={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var i,a,n=(t=t||{}).inputOffset||0,r=new Uint8Array(e,n,10),s=String.fromCharCode.apply(null,r);if("CntZImage"===s.trim())i=p,a=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;i=x,a=2}for(var l,o,f,u,c,d,h=0,m=e.byteLength-10,g=[],k={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<m;){var y=i.decode(e,{inputOffset:n,encodedMaskData:l,maskData:f,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===h&&(l=y.encodedMaskData,f=y.maskData,k.width=y.width,k.height=y.height,k.dimCount=y.dimCount||1,k.pixelType=y.pixelType||y.fileInfo.pixelType,k.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),h++,k.pixels.push(y.pixelData),k.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(d=k.width*k.height,k.bandMasks=g,(f=new Uint8Array(d)).set(g[0]),u=1;u<g.length;u++)for(o=g[u],c=0;c<d;c++)f[c]=f[c]&o[c];k.maskData=f}return k}};M.exports?M.exports=k:this.Lerc=k}();var v=V.exports,A=s.getDefaultExportFromCjs(v);return u((function(t,i){if(t.encoding===w.LERC){let e;try{e=A.decode(t.heightmap)}catch(e){throw new f.RuntimeError(e)}if(e.statistics[0].minValue===Number.MAX_VALUE)throw new f.RuntimeError("Invalid tile data");t.heightmap=e.pixels[0],t.width=e.width,t.height=e.height}t.ellipsoid=e.Ellipsoid.clone(t.ellipsoid),t.rectangle=a.Rectangle.clone(t.rectangle);const n=T.computeVertices(t),r=n.vertices;return i.push(r.buffer),{vertices:r.buffer,numberOfAttributes:n.encoding.stride,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,gridWidth:t.width,gridHeight:t.height,boundingSphere3D:n.boundingSphere3D,orientedBoundingBox:n.orientedBoundingBox,occludeePointInScaledSpace:n.occludeePointInScaledSpace,encoding:n.encoding,westIndicesSouthToNorth:n.westIndicesSouthToNorth,southIndicesEastToWest:n.southIndicesEastToWest,eastIndicesNorthToSouth:n.eastIndicesNorthToSouth,northIndicesWestToEast:n.northIndicesWestToEast}}))})); diff --git a/public/lib/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/public/lib/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js index d2fd2d55..5a2f4b49 100644 --- a/public/lib/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/public/lib/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1 +1 @@ -define(["./AxisAlignedBoundingBox-e7b79110","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./TerrainEncoding-5fbe99d6","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./Transforms-b3716b06","./WebMercatorProjection-943e2226","./createTaskProcessorWorker","./RuntimeError-9b4ce3fb","./AttributeCompression-48e336db","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./combine-0c102d93"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I,g){"use strict";function m(){s.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:s.DeveloperError.throwInstantiationError},credit:{get:s.DeveloperError.throwInstantiationError},tilingScheme:{get:s.DeveloperError.throwInstantiationError},ready:{get:s.DeveloperError.throwInstantiationError},readyPromise:{get:s.DeveloperError.throwInstantiationError},hasWaterMask:{get:s.DeveloperError.throwInstantiationError},hasVertexNormals:{get:s.DeveloperError.throwInstantiationError},availability:{get:s.DeveloperError.throwInstantiationError}});const T=[];m.getRegularGridIndices=function(e,t){let r=T[e];n.defined(r)||(T[e]=r=[]);let o=r[t];return n.defined(o)||(o=e*t<a.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),y(e,t,o,0)),o};const E=[];m.getRegularGridIndicesAndEdgeIndices=function(e,t){let r=E[e];n.defined(r)||(E[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=m.getRegularGridIndices(e,t),i=f(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=r[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const p=[];function f(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function y(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function N(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}m.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let r=p[e];n.defined(r)||(p[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=n+s,d=a+6*Math.max(0,s-4),h=f(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,g=h.northIndicesWestToEast,T=i.IndexDatatype.createTypedArray(c,d);y(e,t,T,0),m.addSkirtIndices(u,l,I,g,n,T,a),o=r[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return o},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=N(e,s,i,a),s+=e.length,a=N(t,s,i,a),s+=t.length,a=N(r,s,i,a),s+=r.length,N(n,s,i,a)},m.heightmapTerrainQuality=.25,m.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*m.heightmapTerrainQuality/(t*r)},m.prototype.requestTileGeometry=s.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=s.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=s.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=s.DeveloperError.throwInstantiationError;const w=32767,M=new r.Cartesian3,S=new r.Cartesian3,x=new r.Cartesian3,A=new r.Cartographic,C=new t.Cartesian2;function b(e,n,o,i,s,c,d,h,u){let l=Number.POSITIVE_INFINITY;const I=s.north,g=s.south;let m=s.east;const T=s.west;m<T&&(m+=a.CesiumMath.TWO_PI);const E=e.length;for(let s=0;s<E;++s){const E=e[s],p=o[E],f=i[E];A.longitude=a.CesiumMath.lerp(T,m,f.x),A.latitude=a.CesiumMath.lerp(g,I,f.y),A.height=p-n;const y=c.cartographicToCartesian(A,M);t.Matrix4.multiplyByPoint(d,y,y),r.Cartesian3.minimumByComponent(y,h,h),r.Cartesian3.maximumByComponent(y,u,u),l=Math.min(l,A.height)}return l}function W(e,t,r,o,i,s,d,h,u,l,I,g,m,T){const E=n.defined(d),p=u.north,f=u.south;let y=u.east;const N=u.west;y<N&&(y+=a.CesiumMath.TWO_PI);const w=r.length;for(let n=0;n<w;++n){const u=r[n],w=i[u],S=s[u];A.longitude=a.CesiumMath.lerp(N,y,S.x)+m,A.latitude=a.CesiumMath.lerp(f,p,S.y)+T,A.height=w-l;const x=h.cartographicToCartesian(A,M);if(E){const e=2*u;C.x=d[e],C.y=d[e+1]}let b,W;o.hasWebMercatorT&&(b=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(A.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=h.geodeticSurfaceNormal(x)),t=o.encode(e,t,x,S,A.height,C,b,W)}}function v(e,t){let r;return"function"==typeof e.slice&&(r=e.slice(),"function"!=typeof r.sort&&(r=void 0)),n.defined(r)||(r=Array.prototype.slice.call(e)),r.sort(t),r}return d((function(d,h){const u=d.quantizedVertices,l=u.length/3,I=d.octEncodedNormals,g=d.westIndices.length+d.eastIndices.length+d.southIndices.length+d.northIndices.length,T=d.includeWebMercatorT,E=d.exaggeration,p=d.exaggerationRelativeHeight,f=1!==E,y=t.Rectangle.clone(d.rectangle),N=y.west,P=y.south,D=y.east,k=y.north,F=r.Ellipsoid.clone(d.ellipsoid),H=d.minimumHeight,_=d.maximumHeight,G=d.relativeToCenter,V=s.Transforms.eastNorthUpToFixedFrame(G,F),Y=t.Matrix4.inverseTransformation(V,new t.Matrix4);let O,B;T&&(O=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(P),B=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(k)-O));const R=u.subarray(0,l),L=u.subarray(l,2*l),j=u.subarray(2*l,3*l),U=n.defined(I),z=new Array(l),q=new Array(l),Q=new Array(l),K=T?new Array(l):[],X=f?new Array(l):[],Z=S;Z.x=Number.POSITIVE_INFINITY,Z.y=Number.POSITIVE_INFINITY,Z.z=Number.POSITIVE_INFINITY;const J=x;J.x=Number.NEGATIVE_INFINITY,J.y=Number.NEGATIVE_INFINITY,J.z=Number.NEGATIVE_INFINITY;let $=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,te=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY;for(let e=0;e<l;++e){const n=R[e],o=L[e],i=n/w,s=o/w,d=a.CesiumMath.lerp(H,_,j[e]/w);A.longitude=a.CesiumMath.lerp(N,D,i),A.latitude=a.CesiumMath.lerp(P,k,s),A.height=d,$=Math.min(A.longitude,$),ee=Math.max(A.longitude,ee),te=Math.min(A.latitude,te),re=Math.max(A.latitude,re);const h=F.cartographicToCartesian(A);z[e]=new t.Cartesian2(i,s),q[e]=d,Q[e]=h,T&&(K[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(A.latitude)-O)*B),f&&(X[e]=F.geodeticSurfaceNormal(h)),t.Matrix4.multiplyByPoint(Y,h,M),r.Cartesian3.minimumByComponent(M,Z,Z),r.Cartesian3.maximumByComponent(M,J,J)}const ne=v(d.westIndices,(function(e,t){return z[e].y-z[t].y})),oe=v(d.eastIndices,(function(e,t){return z[t].y-z[e].y})),ie=v(d.southIndices,(function(e,t){return z[t].x-z[e].x})),ae=v(d.northIndices,(function(e,t){return z[e].x-z[t].x}));let se;if(H<0){se=new o.EllipsoidalOccluder(F).computeHorizonCullingPointPossiblyUnderEllipsoid(G,Q,H)}let ce=H;ce=Math.min(ce,b(d.westIndices,d.westSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.southIndices,d.southSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.eastIndices,d.eastSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.northIndices,d.northSkirtHeight,q,z,y,F,Y,Z,J));const de=new e.AxisAlignedBoundingBox(Z,J,G),he=new o.TerrainEncoding(G,de,ce,_,V,U,T,f,E,p),ue=he.stride,le=new Float32Array(l*ue+g*ue);let Ie=0;for(let e=0;e<l;++e){if(U){const t=2*e;C.x=I[t],C.y=I[t+1]}Ie=he.encode(le,Ie,Q[e],z[e],q[e],C,K[e],X[e])}const ge=Math.max(0,2*(g-4)),me=d.indices.length+3*ge,Te=i.IndexDatatype.createTypedArray(l+g,me);Te.set(d.indices,0);const Ee=1e-4,pe=(ee-$)*Ee,fe=(re-te)*Ee,ye=-pe,Ne=pe,we=fe,Me=-fe;let Se=l*ue;return W(le,Se,ne,he,q,z,I,F,y,d.westSkirtHeight,O,B,ye,0),Se+=d.westIndices.length*ue,W(le,Se,ie,he,q,z,I,F,y,d.southSkirtHeight,O,B,0,Me),Se+=d.southIndices.length*ue,W(le,Se,oe,he,q,z,I,F,y,d.eastSkirtHeight,O,B,Ne,0),Se+=d.eastIndices.length*ue,W(le,Se,ae,he,q,z,I,F,y,d.northSkirtHeight,O,B,0,we),m.addSkirtIndices(ne,ie,oe,ae,l,Te,d.indices.length),h.push(le.buffer,Te.buffer),{vertices:le.buffer,indices:Te.buffer,westIndicesSouthToNorth:ne,southIndicesEastToWest:ie,eastIndicesNorthToSouth:oe,northIndicesWestToEast:ae,vertexStride:ue,center:G,minimumHeight:H,maximumHeight:_,occludeePointInScaledSpace:se,encoding:he,indexCountWithoutSkirts:d.indices.length}}))})); +define(["./AxisAlignedBoundingBox-04c1a5e3","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./TerrainEncoding-c5a10c4f","./IndexDatatype-a9b1bc18","./Math-355606c6","./Transforms-f17097e5","./WebMercatorProjection-db7467f4","./createTaskProcessorWorker","./RuntimeError-9b4ce3fb","./AttributeCompression-0b8f7b7d","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./combine-0c102d93"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I,g){"use strict";function m(){s.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:s.DeveloperError.throwInstantiationError},credit:{get:s.DeveloperError.throwInstantiationError},tilingScheme:{get:s.DeveloperError.throwInstantiationError},ready:{get:s.DeveloperError.throwInstantiationError},readyPromise:{get:s.DeveloperError.throwInstantiationError},hasWaterMask:{get:s.DeveloperError.throwInstantiationError},hasVertexNormals:{get:s.DeveloperError.throwInstantiationError},availability:{get:s.DeveloperError.throwInstantiationError}});const T=[];m.getRegularGridIndices=function(e,t){let r=T[e];n.defined(r)||(T[e]=r=[]);let o=r[t];return n.defined(o)||(o=e*t<a.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),y(e,t,o,0)),o};const E=[];m.getRegularGridIndicesAndEdgeIndices=function(e,t){let r=E[e];n.defined(r)||(E[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=m.getRegularGridIndices(e,t),i=f(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=r[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const p=[];function f(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function y(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function N(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}m.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let r=p[e];n.defined(r)||(p[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=n+s,d=a+6*Math.max(0,s-4),h=f(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,g=h.northIndicesWestToEast,T=i.IndexDatatype.createTypedArray(c,d);y(e,t,T,0),m.addSkirtIndices(u,l,I,g,n,T,a),o=r[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return o},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=N(e,s,i,a),s+=e.length,a=N(t,s,i,a),s+=t.length,a=N(r,s,i,a),s+=r.length,N(n,s,i,a)},m.heightmapTerrainQuality=.25,m.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*m.heightmapTerrainQuality/(t*r)},m.prototype.requestTileGeometry=s.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=s.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=s.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=s.DeveloperError.throwInstantiationError;const w=32767,M=new r.Cartesian3,S=new r.Cartesian3,x=new r.Cartesian3,A=new r.Cartographic,C=new t.Cartesian2;function b(e,n,o,i,s,c,d,h,u){let l=Number.POSITIVE_INFINITY;const I=s.north,g=s.south;let m=s.east;const T=s.west;m<T&&(m+=a.CesiumMath.TWO_PI);const E=e.length;for(let s=0;s<E;++s){const E=e[s],p=o[E],f=i[E];A.longitude=a.CesiumMath.lerp(T,m,f.x),A.latitude=a.CesiumMath.lerp(g,I,f.y),A.height=p-n;const y=c.cartographicToCartesian(A,M);t.Matrix4.multiplyByPoint(d,y,y),r.Cartesian3.minimumByComponent(y,h,h),r.Cartesian3.maximumByComponent(y,u,u),l=Math.min(l,A.height)}return l}function W(e,t,r,o,i,s,d,h,u,l,I,g,m,T){const E=n.defined(d),p=u.north,f=u.south;let y=u.east;const N=u.west;y<N&&(y+=a.CesiumMath.TWO_PI);const w=r.length;for(let n=0;n<w;++n){const u=r[n],w=i[u],S=s[u];A.longitude=a.CesiumMath.lerp(N,y,S.x)+m,A.latitude=a.CesiumMath.lerp(f,p,S.y)+T,A.height=w-l;const x=h.cartographicToCartesian(A,M);if(E){const e=2*u;C.x=d[e],C.y=d[e+1]}let b,W;o.hasWebMercatorT&&(b=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(A.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=h.geodeticSurfaceNormal(x)),t=o.encode(e,t,x,S,A.height,C,b,W)}}function v(e,t){let r;return"function"==typeof e.slice&&(r=e.slice(),"function"!=typeof r.sort&&(r=void 0)),n.defined(r)||(r=Array.prototype.slice.call(e)),r.sort(t),r}return d((function(d,h){const u=d.quantizedVertices,l=u.length/3,I=d.octEncodedNormals,g=d.westIndices.length+d.eastIndices.length+d.southIndices.length+d.northIndices.length,T=d.includeWebMercatorT,E=d.exaggeration,p=d.exaggerationRelativeHeight,f=1!==E,y=t.Rectangle.clone(d.rectangle),N=y.west,P=y.south,D=y.east,k=y.north,F=r.Ellipsoid.clone(d.ellipsoid),H=d.minimumHeight,_=d.maximumHeight,G=d.relativeToCenter,V=s.Transforms.eastNorthUpToFixedFrame(G,F),Y=t.Matrix4.inverseTransformation(V,new t.Matrix4);let O,B;T&&(O=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(P),B=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(k)-O));const R=u.subarray(0,l),L=u.subarray(l,2*l),j=u.subarray(2*l,3*l),U=n.defined(I),z=new Array(l),q=new Array(l),Q=new Array(l),K=T?new Array(l):[],X=f?new Array(l):[],Z=S;Z.x=Number.POSITIVE_INFINITY,Z.y=Number.POSITIVE_INFINITY,Z.z=Number.POSITIVE_INFINITY;const J=x;J.x=Number.NEGATIVE_INFINITY,J.y=Number.NEGATIVE_INFINITY,J.z=Number.NEGATIVE_INFINITY;let $=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,te=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY;for(let e=0;e<l;++e){const n=R[e],o=L[e],i=n/w,s=o/w,d=a.CesiumMath.lerp(H,_,j[e]/w);A.longitude=a.CesiumMath.lerp(N,D,i),A.latitude=a.CesiumMath.lerp(P,k,s),A.height=d,$=Math.min(A.longitude,$),ee=Math.max(A.longitude,ee),te=Math.min(A.latitude,te),re=Math.max(A.latitude,re);const h=F.cartographicToCartesian(A);z[e]=new t.Cartesian2(i,s),q[e]=d,Q[e]=h,T&&(K[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(A.latitude)-O)*B),f&&(X[e]=F.geodeticSurfaceNormal(h)),t.Matrix4.multiplyByPoint(Y,h,M),r.Cartesian3.minimumByComponent(M,Z,Z),r.Cartesian3.maximumByComponent(M,J,J)}const ne=v(d.westIndices,(function(e,t){return z[e].y-z[t].y})),oe=v(d.eastIndices,(function(e,t){return z[t].y-z[e].y})),ie=v(d.southIndices,(function(e,t){return z[t].x-z[e].x})),ae=v(d.northIndices,(function(e,t){return z[e].x-z[t].x}));let se;if(H<0){se=new o.EllipsoidalOccluder(F).computeHorizonCullingPointPossiblyUnderEllipsoid(G,Q,H)}let ce=H;ce=Math.min(ce,b(d.westIndices,d.westSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.southIndices,d.southSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.eastIndices,d.eastSkirtHeight,q,z,y,F,Y,Z,J)),ce=Math.min(ce,b(d.northIndices,d.northSkirtHeight,q,z,y,F,Y,Z,J));const de=new e.AxisAlignedBoundingBox(Z,J,G),he=new o.TerrainEncoding(G,de,ce,_,V,U,T,f,E,p),ue=he.stride,le=new Float32Array(l*ue+g*ue);let Ie=0;for(let e=0;e<l;++e){if(U){const t=2*e;C.x=I[t],C.y=I[t+1]}Ie=he.encode(le,Ie,Q[e],z[e],q[e],C,K[e],X[e])}const ge=Math.max(0,2*(g-4)),me=d.indices.length+3*ge,Te=i.IndexDatatype.createTypedArray(l+g,me);Te.set(d.indices,0);const Ee=1e-4,pe=(ee-$)*Ee,fe=(re-te)*Ee,ye=-pe,Ne=pe,we=fe,Me=-fe;let Se=l*ue;return W(le,Se,ne,he,q,z,I,F,y,d.westSkirtHeight,O,B,ye,0),Se+=d.westIndices.length*ue,W(le,Se,ie,he,q,z,I,F,y,d.southSkirtHeight,O,B,0,Me),Se+=d.southIndices.length*ue,W(le,Se,oe,he,q,z,I,F,y,d.eastSkirtHeight,O,B,Ne,0),Se+=d.eastIndices.length*ue,W(le,Se,ae,he,q,z,I,F,y,d.northSkirtHeight,O,B,0,we),m.addSkirtIndices(ne,ie,oe,ae,l,Te,d.indices.length),h.push(le.buffer,Te.buffer),{vertices:le.buffer,indices:Te.buffer,westIndicesSouthToNorth:ne,southIndicesEastToWest:ie,eastIndicesNorthToSouth:oe,northIndicesWestToEast:ae,vertexStride:ue,center:G,minimumHeight:H,maximumHeight:_,occludeePointInScaledSpace:se,encoding:he,indexCountWithoutSkirts:d.indices.length}}))})); diff --git a/public/lib/Cesium/Workers/createWallGeometry.js b/public/lib/Cesium/Workers/createWallGeometry.js index 6cff788b..99de1ea2 100644 --- a/public/lib/Cesium/Workers/createWallGeometry.js +++ b/public/lib/Cesium/Workers/createWallGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./VertexFormat-fbdec922","./WallGeometryLibrary-a8271824","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./arrayRemoveDuplicates-9b636830","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,n,i,a,o,r,s,l,m,u,p,c,d,y,g,f,h,C,x){"use strict";const A=new t.Cartesian3,_=new t.Cartesian3,E=new t.Cartesian3,b=new t.Cartesian3,w=new t.Cartesian3,F=new t.Cartesian3,v=new t.Cartesian3;function L(n){const i=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,a=n.maximumHeights,o=n.minimumHeights,r=e.defaultValue(n.vertexFormat,l.VertexFormat.DEFAULT),m=e.defaultValue(n.granularity,s.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=o,this._maximumHeights=a,this._vertexFormat=l.VertexFormat.clone(r),this._granularity=m,this._ellipsoid=t.Ellipsoid.clone(u),this._workerName="createWallGeometry";let p=1+i.length*t.Cartesian3.packedLength+2;e.defined(o)&&(p+=o.length),e.defined(a)&&(p+=a.length),this.packedLength=p+t.Ellipsoid.packedLength+l.VertexFormat.packedLength+1}L.pack=function(n,i,a){let o;a=e.defaultValue(a,0);const r=n._positions;let s=r.length;for(i[a++]=s,o=0;o<s;++o,a+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[o],i,a);const m=n._minimumHeights;if(s=e.defined(m)?m.length:0,i[a++]=s,e.defined(m))for(o=0;o<s;++o)i[a++]=m[o];const u=n._maximumHeights;if(s=e.defined(u)?u.length:0,i[a++]=s,e.defined(u))for(o=0;o<s;++o)i[a++]=u[o];return t.Ellipsoid.pack(n._ellipsoid,i,a),a+=t.Ellipsoid.packedLength,l.VertexFormat.pack(n._vertexFormat,i,a),i[a+=l.VertexFormat.packedLength]=n._granularity,i};const V=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),k=new l.VertexFormat,H={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:V,vertexFormat:k,granularity:void 0};return L.unpack=function(n,i,a){let o;i=e.defaultValue(i,0);let r=n[i++];const s=new Array(r);for(o=0;o<r;++o,i+=t.Cartesian3.packedLength)s[o]=t.Cartesian3.unpack(n,i);let m,u;if(r=n[i++],r>0)for(m=new Array(r),o=0;o<r;++o)m[o]=n[i++];if(r=n[i++],r>0)for(u=new Array(r),o=0;o<r;++o)u[o]=n[i++];const p=t.Ellipsoid.unpack(n,i,V);i+=t.Ellipsoid.packedLength;const c=l.VertexFormat.unpack(n,i,k),d=n[i+=l.VertexFormat.packedLength];return e.defined(a)?(a._positions=s,a._minimumHeights=m,a._maximumHeights=u,a._ellipsoid=t.Ellipsoid.clone(p,a._ellipsoid),a._vertexFormat=l.VertexFormat.clone(c,a._vertexFormat),a._granularity=d,a):(H.positions=s,H.minimumHeights=m,H.maximumHeights=u,H.granularity=d,new L(H))},L.fromConstantHeights=function(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions;let i,a;const o=t.minimumHeight,r=t.maximumHeight,s=e.defined(o),l=e.defined(r);if(s||l){const e=n.length;i=s?new Array(e):void 0,a=l?new Array(e):void 0;for(let t=0;t<e;++t)s&&(i[t]=o),l&&(a[t]=r)}return new L({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},L.createGeometry=function(l){const u=l._positions,p=l._minimumHeights,c=l._maximumHeights,d=l._vertexFormat,y=l._granularity,g=l._ellipsoid,f=m.WallGeometryLibrary.computePositions(g,u,c,p,y,!0);if(!e.defined(f))return;const h=f.bottomPositions,C=f.topPositions,x=f.numCorners;let L=C.length,V=2*L;const k=d.position?new Float64Array(V):void 0,H=d.normal?new Float32Array(V):void 0,D=d.tangent?new Float32Array(V):void 0,G=d.bitangent?new Float32Array(V):void 0,P=d.st?new Float32Array(V/3*2):void 0;let T,z=0,O=0,R=0,S=0,I=0,M=v,N=F,W=w,B=!0;L/=3;let U=0;const q=1/(L-x-1);for(T=0;T<L;++T){const e=3*T,n=t.Cartesian3.fromArray(C,e,A),i=t.Cartesian3.fromArray(h,e,_);if(d.position&&(k[z++]=i.x,k[z++]=i.y,k[z++]=i.z,k[z++]=n.x,k[z++]=n.y,k[z++]=n.z),d.st&&(P[I++]=U,P[I++]=0,P[I++]=U,P[I++]=1),d.normal||d.tangent||d.bitangent){let i=t.Cartesian3.clone(t.Cartesian3.ZERO,b);const a=t.Cartesian3.subtract(n,g.geodeticSurfaceNormal(n,_),_);if(T+1<L&&(i=t.Cartesian3.fromArray(C,e+3,b)),B){const e=t.Cartesian3.subtract(i,n,E),o=t.Cartesian3.subtract(a,n,A);M=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,M),M),B=!1}t.Cartesian3.equalsEpsilon(n,i,s.CesiumMath.EPSILON10)?B=!0:(U+=q,d.tangent&&(N=t.Cartesian3.normalize(t.Cartesian3.subtract(i,n,N),N)),d.bitangent&&(W=t.Cartesian3.normalize(t.Cartesian3.cross(M,N,W),W))),d.normal&&(H[O++]=M.x,H[O++]=M.y,H[O++]=M.z,H[O++]=M.x,H[O++]=M.y,H[O++]=M.z),d.tangent&&(D[S++]=N.x,D[S++]=N.y,D[S++]=N.z,D[S++]=N.x,D[S++]=N.y,D[S++]=N.z),d.bitangent&&(G[R++]=W.x,G[R++]=W.y,G[R++]=W.z,G[R++]=W.x,G[R++]=W.y,G[R++]=W.z)}}const J=new o.GeometryAttributes;d.position&&(J.position=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k})),d.normal&&(J.normal=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:H})),d.tangent&&(J.tangent=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),d.bitangent&&(J.bitangent=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d.st&&(J.st=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:P}));const Y=V/3;V-=6*(x+1);const Z=r.IndexDatatype.createTypedArray(Y,V);let j=0;for(T=0;T<Y-2;T+=2){const e=T,n=T+2,i=t.Cartesian3.fromArray(k,3*e,A),a=t.Cartesian3.fromArray(k,3*n,_);if(t.Cartesian3.equalsEpsilon(i,a,s.CesiumMath.EPSILON10))continue;const o=T+1,r=T+3;Z[j++]=o,Z[j++]=e,Z[j++]=r,Z[j++]=r,Z[j++]=e,Z[j++]=n}return new a.Geometry({attributes:J,indices:Z,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:new n.BoundingSphere.fromVertices(k)})},function(n,i){return e.defined(i)&&(n=L.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),L.createGeometry(n)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./IndexDatatype-a9b1bc18","./Math-355606c6","./VertexFormat-fbdec922","./WallGeometryLibrary-12b21f08","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./arrayRemoveDuplicates-0d8dde26","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,n,i,a,o,r,s,l,m,u,p,c,d,y,g,f,h,C,x){"use strict";const A=new t.Cartesian3,_=new t.Cartesian3,E=new t.Cartesian3,b=new t.Cartesian3,w=new t.Cartesian3,F=new t.Cartesian3,v=new t.Cartesian3;function L(n){const i=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,a=n.maximumHeights,o=n.minimumHeights,r=e.defaultValue(n.vertexFormat,l.VertexFormat.DEFAULT),m=e.defaultValue(n.granularity,s.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=o,this._maximumHeights=a,this._vertexFormat=l.VertexFormat.clone(r),this._granularity=m,this._ellipsoid=t.Ellipsoid.clone(u),this._workerName="createWallGeometry";let p=1+i.length*t.Cartesian3.packedLength+2;e.defined(o)&&(p+=o.length),e.defined(a)&&(p+=a.length),this.packedLength=p+t.Ellipsoid.packedLength+l.VertexFormat.packedLength+1}L.pack=function(n,i,a){let o;a=e.defaultValue(a,0);const r=n._positions;let s=r.length;for(i[a++]=s,o=0;o<s;++o,a+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[o],i,a);const m=n._minimumHeights;if(s=e.defined(m)?m.length:0,i[a++]=s,e.defined(m))for(o=0;o<s;++o)i[a++]=m[o];const u=n._maximumHeights;if(s=e.defined(u)?u.length:0,i[a++]=s,e.defined(u))for(o=0;o<s;++o)i[a++]=u[o];return t.Ellipsoid.pack(n._ellipsoid,i,a),a+=t.Ellipsoid.packedLength,l.VertexFormat.pack(n._vertexFormat,i,a),i[a+=l.VertexFormat.packedLength]=n._granularity,i};const V=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),k=new l.VertexFormat,H={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:V,vertexFormat:k,granularity:void 0};return L.unpack=function(n,i,a){let o;i=e.defaultValue(i,0);let r=n[i++];const s=new Array(r);for(o=0;o<r;++o,i+=t.Cartesian3.packedLength)s[o]=t.Cartesian3.unpack(n,i);let m,u;if(r=n[i++],r>0)for(m=new Array(r),o=0;o<r;++o)m[o]=n[i++];if(r=n[i++],r>0)for(u=new Array(r),o=0;o<r;++o)u[o]=n[i++];const p=t.Ellipsoid.unpack(n,i,V);i+=t.Ellipsoid.packedLength;const c=l.VertexFormat.unpack(n,i,k),d=n[i+=l.VertexFormat.packedLength];return e.defined(a)?(a._positions=s,a._minimumHeights=m,a._maximumHeights=u,a._ellipsoid=t.Ellipsoid.clone(p,a._ellipsoid),a._vertexFormat=l.VertexFormat.clone(c,a._vertexFormat),a._granularity=d,a):(H.positions=s,H.minimumHeights=m,H.maximumHeights=u,H.granularity=d,new L(H))},L.fromConstantHeights=function(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions;let i,a;const o=t.minimumHeight,r=t.maximumHeight,s=e.defined(o),l=e.defined(r);if(s||l){const e=n.length;i=s?new Array(e):void 0,a=l?new Array(e):void 0;for(let t=0;t<e;++t)s&&(i[t]=o),l&&(a[t]=r)}return new L({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},L.createGeometry=function(l){const u=l._positions,p=l._minimumHeights,c=l._maximumHeights,d=l._vertexFormat,y=l._granularity,g=l._ellipsoid,f=m.WallGeometryLibrary.computePositions(g,u,c,p,y,!0);if(!e.defined(f))return;const h=f.bottomPositions,C=f.topPositions,x=f.numCorners;let L=C.length,V=2*L;const k=d.position?new Float64Array(V):void 0,H=d.normal?new Float32Array(V):void 0,D=d.tangent?new Float32Array(V):void 0,G=d.bitangent?new Float32Array(V):void 0,P=d.st?new Float32Array(V/3*2):void 0;let T,z=0,O=0,R=0,S=0,I=0,M=v,N=F,W=w,B=!0;L/=3;let U=0;const q=1/(L-x-1);for(T=0;T<L;++T){const e=3*T,n=t.Cartesian3.fromArray(C,e,A),i=t.Cartesian3.fromArray(h,e,_);if(d.position&&(k[z++]=i.x,k[z++]=i.y,k[z++]=i.z,k[z++]=n.x,k[z++]=n.y,k[z++]=n.z),d.st&&(P[I++]=U,P[I++]=0,P[I++]=U,P[I++]=1),d.normal||d.tangent||d.bitangent){let i=t.Cartesian3.clone(t.Cartesian3.ZERO,b);const a=t.Cartesian3.subtract(n,g.geodeticSurfaceNormal(n,_),_);if(T+1<L&&(i=t.Cartesian3.fromArray(C,e+3,b)),B){const e=t.Cartesian3.subtract(i,n,E),o=t.Cartesian3.subtract(a,n,A);M=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,M),M),B=!1}t.Cartesian3.equalsEpsilon(n,i,s.CesiumMath.EPSILON10)?B=!0:(U+=q,d.tangent&&(N=t.Cartesian3.normalize(t.Cartesian3.subtract(i,n,N),N)),d.bitangent&&(W=t.Cartesian3.normalize(t.Cartesian3.cross(M,N,W),W))),d.normal&&(H[O++]=M.x,H[O++]=M.y,H[O++]=M.z,H[O++]=M.x,H[O++]=M.y,H[O++]=M.z),d.tangent&&(D[S++]=N.x,D[S++]=N.y,D[S++]=N.z,D[S++]=N.x,D[S++]=N.y,D[S++]=N.z),d.bitangent&&(G[R++]=W.x,G[R++]=W.y,G[R++]=W.z,G[R++]=W.x,G[R++]=W.y,G[R++]=W.z)}}const J=new o.GeometryAttributes;d.position&&(J.position=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k})),d.normal&&(J.normal=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:H})),d.tangent&&(J.tangent=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),d.bitangent&&(J.bitangent=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d.st&&(J.st=new a.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:P}));const Y=V/3;V-=6*(x+1);const Z=r.IndexDatatype.createTypedArray(Y,V);let j=0;for(T=0;T<Y-2;T+=2){const e=T,n=T+2,i=t.Cartesian3.fromArray(k,3*e,A),a=t.Cartesian3.fromArray(k,3*n,_);if(t.Cartesian3.equalsEpsilon(i,a,s.CesiumMath.EPSILON10))continue;const o=T+1,r=T+3;Z[j++]=o,Z[j++]=e,Z[j++]=r,Z[j++]=r,Z[j++]=e,Z[j++]=n}return new a.Geometry({attributes:J,indices:Z,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:new n.BoundingSphere.fromVertices(k)})},function(n,i){return e.defined(i)&&(n=L.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),L.createGeometry(n)}})); diff --git a/public/lib/Cesium/Workers/createWallOutlineGeometry.js b/public/lib/Cesium/Workers/createWallOutlineGeometry.js index 4383ee48..6d2e74c3 100644 --- a/public/lib/Cesium/Workers/createWallOutlineGeometry.js +++ b/public/lib/Cesium/Workers/createWallOutlineGeometry.js @@ -1 +1 @@ -define(["./defaultValue-f6d5e6da","./Matrix3-81054f0f","./Transforms-b3716b06","./ComponentDatatype-ab629b88","./GeometryAttribute-12713b29","./GeometryAttributes-1e4ddcd2","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./WallGeometryLibrary-a8271824","./Matrix2-413c4048","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./arrayRemoveDuplicates-9b636830","./PolylinePipeline-bcbea07f","./EllipsoidGeodesic-2723ab86","./EllipsoidRhumbLine-77eff028","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,i,t,n,o,a,s,r,l,m,u,d,p,c,f,h,g,y,E){"use strict";const _=new i.Cartesian3,C=new i.Cartesian3;function H(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,a=t.minimumHeights,s=e.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=n,this._minimumHeights=a,this._maximumHeights=o,this._granularity=s,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+n.length*i.Cartesian3.packedLength+2;e.defined(a)&&(m+=a.length),e.defined(o)&&(m+=o.length),this.packedLength=m+i.Ellipsoid.packedLength+1}H.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[o++]=r,e.defined(m))for(a=0;a<r;++a)n[o++]=m[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const A=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),k={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:A,granularity:void 0};return H.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),a=0;a<s;++a)m[a]=t[n++];const u=i.Ellipsoid.unpack(t,n,A),d=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(u,o._ellipsoid),o._granularity=d,o):(k.positions=r,k.minimumHeights=l,k.maximumHeights=m,k.granularity=d,new H(k))},H.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new H({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},H.createGeometry=function(m){const u=m._positions,d=m._minimumHeights,p=m._maximumHeights,c=m._granularity,f=m._ellipsoid,h=l.WallGeometryLibrary.computePositions(f,u,p,d,c,!1);if(!e.defined(h))return;const g=h.bottomPositions,y=h.topPositions;let E=y.length,H=2*E;const A=new Float64Array(H);let k,w=0;for(E/=3,k=0;k<E;++k){const e=3*k,t=i.Cartesian3.fromArray(y,e,_),n=i.Cartesian3.fromArray(g,e,C);A[w++]=n.x,A[w++]=n.y,A[w++]=n.z,A[w++]=t.x,A[w++]=t.y,A[w++]=t.z}const x=new a.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A})}),b=H/3;H=2*b-4+b;const G=s.IndexDatatype.createTypedArray(b,H);let L=0;for(k=0;k<b-2;k+=2){const e=k,t=k+2,n=i.Cartesian3.fromArray(A,3*e,_),o=i.Cartesian3.fromArray(A,3*t,C);if(i.Cartesian3.equalsEpsilon(n,o,r.CesiumMath.EPSILON10))continue;const a=k+1,s=k+3;G[L++]=a,G[L++]=e,G[L++]=a,G[L++]=s,G[L++]=e,G[L++]=t}return G[L++]=b-2,G[L++]=b-1,new o.Geometry({attributes:x,indices:G,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(A)})},function(t,n){return e.defined(n)&&(t=H.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),H.createGeometry(t)}})); +define(["./defaultValue-f6d5e6da","./Matrix3-b2351961","./Transforms-f17097e5","./ComponentDatatype-ab629b88","./GeometryAttribute-9c1a6bab","./GeometryAttributes-1e4ddcd2","./IndexDatatype-a9b1bc18","./Math-355606c6","./WallGeometryLibrary-12b21f08","./Matrix2-7a8e9daf","./RuntimeError-9b4ce3fb","./combine-0c102d93","./WebGLConstants-7f557f93","./arrayRemoveDuplicates-0d8dde26","./PolylinePipeline-8df321dd","./EllipsoidGeodesic-20aaff03","./EllipsoidRhumbLine-1289f7e8","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,i,t,n,o,a,s,r,l,m,u,d,p,c,f,h,g,y,E){"use strict";const _=new i.Cartesian3,C=new i.Cartesian3;function H(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,a=t.minimumHeights,s=e.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=n,this._minimumHeights=a,this._maximumHeights=o,this._granularity=s,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+n.length*i.Cartesian3.packedLength+2;e.defined(a)&&(m+=a.length),e.defined(o)&&(m+=o.length),this.packedLength=m+i.Ellipsoid.packedLength+1}H.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[o++]=r,e.defined(m))for(a=0;a<r;++a)n[o++]=m[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const A=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),k={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:A,granularity:void 0};return H.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),a=0;a<s;++a)m[a]=t[n++];const u=i.Ellipsoid.unpack(t,n,A),d=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(u,o._ellipsoid),o._granularity=d,o):(k.positions=r,k.minimumHeights=l,k.maximumHeights=m,k.granularity=d,new H(k))},H.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new H({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},H.createGeometry=function(m){const u=m._positions,d=m._minimumHeights,p=m._maximumHeights,c=m._granularity,f=m._ellipsoid,h=l.WallGeometryLibrary.computePositions(f,u,p,d,c,!1);if(!e.defined(h))return;const g=h.bottomPositions,y=h.topPositions;let E=y.length,H=2*E;const A=new Float64Array(H);let k,w=0;for(E/=3,k=0;k<E;++k){const e=3*k,t=i.Cartesian3.fromArray(y,e,_),n=i.Cartesian3.fromArray(g,e,C);A[w++]=n.x,A[w++]=n.y,A[w++]=n.z,A[w++]=t.x,A[w++]=t.y,A[w++]=t.z}const x=new a.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A})}),b=H/3;H=2*b-4+b;const G=s.IndexDatatype.createTypedArray(b,H);let L=0;for(k=0;k<b-2;k+=2){const e=k,t=k+2,n=i.Cartesian3.fromArray(A,3*e,_),o=i.Cartesian3.fromArray(A,3*t,C);if(i.Cartesian3.equalsEpsilon(n,o,r.CesiumMath.EPSILON10))continue;const a=k+1,s=k+3;G[L++]=a,G[L++]=e,G[L++]=a,G[L++]=s,G[L++]=e,G[L++]=t}return G[L++]=b-2,G[L++]=b-1,new o.Geometry({attributes:x,indices:G,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(A)})},function(t,n){return e.defined(n)&&(t=H.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),H.createGeometry(t)}})); diff --git a/public/lib/Cesium/Workers/decodeDraco.js b/public/lib/Cesium/Workers/decodeDraco.js index 5ef3256b..6e7b8f13 100644 --- a/public/lib/Cesium/Workers/decodeDraco.js +++ b/public/lib/Cesium/Workers/decodeDraco.js @@ -1 +1 @@ -define(["./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./IndexDatatype-d3db4e7d","./RuntimeError-9b4ce3fb","./createTaskProcessorWorker","./WebGLConstants-7f557f93","./Math-2ce22ee9"],(function(t,e,r,n,o,a,i){"use strict";let s;function u(t,e){const n=t.num_points(),o=t.num_faces(),a=new s.DracoInt32Array,i=3*o,u=r.IndexDatatype.createTypedArray(n,i);let c=0;for(let r=0;r<o;++r)e.GetFaceFromMesh(t,r,a),u[c+0]=a.GetValue(0),u[c+1]=a.GetValue(1),u[c+2]=a.GetValue(2),c+=3;return s.destroy(a),{typedArray:u,numberOfIndices:i}}function c(r,n,o){const a=r.num_points(),i=o.num_components();let u,c=new s.AttributeQuantizationTransform;if(c.InitFromAttribute(o)){const t=new Array(i);for(let e=0;e<i;++e)t[e]=c.min_value(e);u={quantizationBits:c.quantization_bits(),minValues:t,range:c.range(),octEncoded:!1}}s.destroy(c),c=new s.AttributeOctahedronTransform,c.InitFromAttribute(o)&&(u={quantizationBits:c.quantization_bits(),octEncoded:!0}),s.destroy(c);const d=a*i;let y;y=e.defined(u)?function(t,e,r,n,o){let a,i;n.quantizationBits<=8?(i=new s.DracoUInt8Array,a=new Uint8Array(o),e.GetAttributeUInt8ForAllPoints(t,r,i)):n.quantizationBits<=16?(i=new s.DracoUInt16Array,a=new Uint16Array(o),e.GetAttributeUInt16ForAllPoints(t,r,i)):(i=new s.DracoFloat32Array,a=new Float32Array(o),e.GetAttributeFloatForAllPoints(t,r,i));for(let t=0;t<o;++t)a[t]=i.GetValue(t);return s.destroy(i),a}(r,n,o,u,d):function(t,e,r,n){let o,a;switch(r.data_type()){case 1:case 11:a=new s.DracoInt8Array,o=new Int8Array(n),e.GetAttributeInt8ForAllPoints(t,r,a);break;case 2:a=new s.DracoUInt8Array,o=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,r,a);break;case 3:a=new s.DracoInt16Array,o=new Int16Array(n),e.GetAttributeInt16ForAllPoints(t,r,a);break;case 4:a=new s.DracoUInt16Array,o=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,r,a);break;case 5:case 7:a=new s.DracoInt32Array,o=new Int32Array(n),e.GetAttributeInt32ForAllPoints(t,r,a);break;case 6:case 8:a=new s.DracoUInt32Array,o=new Uint32Array(n),e.GetAttributeUInt32ForAllPoints(t,r,a);break;case 9:case 10:a=new s.DracoFloat32Array,o=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,r,a)}for(let t=0;t<n;++t)o[t]=a.GetValue(t);return s.destroy(a),o}(r,n,o,d);const f=t.ComponentDatatype.fromTypedArray(y);return{array:y,data:{componentsPerAttribute:i,componentDatatype:f,byteOffset:o.byte_offset(),byteStride:t.ComponentDatatype.getSizeInBytes(f)*i,normalized:o.normalized(),quantization:u}}}function d(t){return e.defined(t.bufferView)?function(t){const e=new s.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let t=0;t<r.length;++t)e.SkipAttributeTransform(s[r[t]]);const o=t.bufferView,a=new s.DecoderBuffer;if(a.Init(t.array,o.byteLength),e.GetEncodedGeometryType(a)!==s.TRIANGULAR_MESH)throw new n.RuntimeError("Unsupported draco mesh geometry type.");const i=new s.Mesh,d=e.DecodeBufferToMesh(a,i);if(!d.ok()||0===i.ptr)throw new n.RuntimeError(`Error decoding draco mesh geometry: ${d.error_msg()}`);s.destroy(a);const y={},f=t.compressedAttributes;for(const t in f)if(f.hasOwnProperty(t)){const r=f[t],n=e.GetAttributeByUniqueId(i,r);y[t]=c(i,e,n)}const A={indexArray:u(i,e),attributeData:y};return s.destroy(i),s.destroy(e),A}(t):function(t){const e=new s.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(s.POSITION),e.SkipAttributeTransform(s.NORMAL));const r=new s.DecoderBuffer;if(r.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(r)!==s.POINT_CLOUD)throw new n.RuntimeError("Draco geometry type must be POINT_CLOUD.");const o=new s.PointCloud,a=e.DecodeBufferToPointCloud(r,o);if(!a.ok()||0===o.ptr)throw new n.RuntimeError(`Error decoding draco point cloud: ${a.error_msg()}`);s.destroy(r);const i={},u=t.properties;for(const t in u)if(u.hasOwnProperty(t)){let r;if("POSITION"===t||"NORMAL"===t){const n=e.GetAttributeId(o,s[t]);r=e.GetAttribute(o,n)}else{const n=u[t];r=e.GetAttributeByUniqueId(o,n)}i[t]=c(o,e,r)}return s.destroy(o),s.destroy(e),i}(t)}function y(t){s=t,self.onmessage=o(d),self.postMessage(!0)}return function(t){const r=t.data.webAssemblyConfig;if(e.defined(r))return require([r.modulePath],(function(t){e.defined(r.wasmBinaryFile)?(e.defined(t)||(t=self.DracoDecoderModule),t(r).then((function(t){y(t)}))):y(t())}))}})); +define(["./ComponentDatatype-ab629b88","./defaultValue-f6d5e6da","./IndexDatatype-a9b1bc18","./RuntimeError-9b4ce3fb","./createTaskProcessorWorker","./WebGLConstants-7f557f93","./Math-355606c6"],(function(t,e,r,n,o,a,i){"use strict";let s;function u(t,e){const n=t.num_points(),o=t.num_faces(),a=new s.DracoInt32Array,i=3*o,u=r.IndexDatatype.createTypedArray(n,i);let c=0;for(let r=0;r<o;++r)e.GetFaceFromMesh(t,r,a),u[c+0]=a.GetValue(0),u[c+1]=a.GetValue(1),u[c+2]=a.GetValue(2),c+=3;return s.destroy(a),{typedArray:u,numberOfIndices:i}}function c(r,n,o){const a=r.num_points(),i=o.num_components();let u,c=new s.AttributeQuantizationTransform;if(c.InitFromAttribute(o)){const t=new Array(i);for(let e=0;e<i;++e)t[e]=c.min_value(e);u={quantizationBits:c.quantization_bits(),minValues:t,range:c.range(),octEncoded:!1}}s.destroy(c),c=new s.AttributeOctahedronTransform,c.InitFromAttribute(o)&&(u={quantizationBits:c.quantization_bits(),octEncoded:!0}),s.destroy(c);const d=a*i;let y;y=e.defined(u)?function(t,e,r,n,o){let a,i;n.quantizationBits<=8?(i=new s.DracoUInt8Array,a=new Uint8Array(o),e.GetAttributeUInt8ForAllPoints(t,r,i)):n.quantizationBits<=16?(i=new s.DracoUInt16Array,a=new Uint16Array(o),e.GetAttributeUInt16ForAllPoints(t,r,i)):(i=new s.DracoFloat32Array,a=new Float32Array(o),e.GetAttributeFloatForAllPoints(t,r,i));for(let t=0;t<o;++t)a[t]=i.GetValue(t);return s.destroy(i),a}(r,n,o,u,d):function(t,e,r,n){let o,a;switch(r.data_type()){case 1:case 11:a=new s.DracoInt8Array,o=new Int8Array(n),e.GetAttributeInt8ForAllPoints(t,r,a);break;case 2:a=new s.DracoUInt8Array,o=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,r,a);break;case 3:a=new s.DracoInt16Array,o=new Int16Array(n),e.GetAttributeInt16ForAllPoints(t,r,a);break;case 4:a=new s.DracoUInt16Array,o=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,r,a);break;case 5:case 7:a=new s.DracoInt32Array,o=new Int32Array(n),e.GetAttributeInt32ForAllPoints(t,r,a);break;case 6:case 8:a=new s.DracoUInt32Array,o=new Uint32Array(n),e.GetAttributeUInt32ForAllPoints(t,r,a);break;case 9:case 10:a=new s.DracoFloat32Array,o=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,r,a)}for(let t=0;t<n;++t)o[t]=a.GetValue(t);return s.destroy(a),o}(r,n,o,d);const f=t.ComponentDatatype.fromTypedArray(y);return{array:y,data:{componentsPerAttribute:i,componentDatatype:f,byteOffset:o.byte_offset(),byteStride:t.ComponentDatatype.getSizeInBytes(f)*i,normalized:o.normalized(),quantization:u}}}function d(t){return e.defined(t.bufferView)?function(t){const e=new s.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let t=0;t<r.length;++t)e.SkipAttributeTransform(s[r[t]]);const o=t.bufferView,a=new s.DecoderBuffer;if(a.Init(t.array,o.byteLength),e.GetEncodedGeometryType(a)!==s.TRIANGULAR_MESH)throw new n.RuntimeError("Unsupported draco mesh geometry type.");const i=new s.Mesh,d=e.DecodeBufferToMesh(a,i);if(!d.ok()||0===i.ptr)throw new n.RuntimeError(`Error decoding draco mesh geometry: ${d.error_msg()}`);s.destroy(a);const y={},f=t.compressedAttributes;for(const t in f)if(f.hasOwnProperty(t)){const r=f[t],n=e.GetAttributeByUniqueId(i,r);y[t]=c(i,e,n)}const A={indexArray:u(i,e),attributeData:y};return s.destroy(i),s.destroy(e),A}(t):function(t){const e=new s.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(s.POSITION),e.SkipAttributeTransform(s.NORMAL));const r=new s.DecoderBuffer;if(r.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(r)!==s.POINT_CLOUD)throw new n.RuntimeError("Draco geometry type must be POINT_CLOUD.");const o=new s.PointCloud,a=e.DecodeBufferToPointCloud(r,o);if(!a.ok()||0===o.ptr)throw new n.RuntimeError(`Error decoding draco point cloud: ${a.error_msg()}`);s.destroy(r);const i={},u=t.properties;for(const t in u)if(u.hasOwnProperty(t)){let r;if("POSITION"===t||"NORMAL"===t){const n=e.GetAttributeId(o,s[t]);r=e.GetAttribute(o,n)}else{const n=u[t];r=e.GetAttributeByUniqueId(o,n)}i[t]=c(o,e,r)}return s.destroy(o),s.destroy(e),i}(t)}function y(t){s=t,self.onmessage=o(d),self.postMessage(!0)}return function(t){const r=t.data.webAssemblyConfig;if(e.defined(r))return require([r.modulePath],(function(t){e.defined(r.wasmBinaryFile)?(e.defined(t)||(t=self.DracoDecoderModule),t(r).then((function(t){y(t)}))):y(t())}))}})); diff --git a/public/lib/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js b/public/lib/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js index dc5edec2..9bcd9b24 100644 --- a/public/lib/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +++ b/public/lib/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js @@ -1 +1 @@ -define(["./RuntimeError-9b4ce3fb","./defaultValue-f6d5e6da","./createTaskProcessorWorker"],(function(e,t,n){"use strict";const i=1953029805,r=2917034100;function a(t,n){if(a.passThroughDataForTesting)return n;const o=t.byteLength;if(0===o||o%4!=0)throw new e.RuntimeError("The length of key must be greater than 0 and a multiple of 4.");const s=new DataView(n),l=s.getUint32(0,!0);if(l===i||l===r)return n;const c=new DataView(t);let f=0;const d=n.byteLength,h=d-d%8,u=o;let w,b=8;for(;f<h;)for(b=(b+8)%24,w=b;f<h&&w<u;)s.setUint32(f,s.getUint32(f,!0)^c.getUint32(w,!0),!0),s.setUint32(f+4,s.getUint32(f+4,!0)^c.getUint32(w+4,!0),!0),f+=8,w+=24;if(f<d)for(w>=u&&(b=(b+8)%24,w=b);f<d;)s.setUint8(f,s.getUint8(f)^c.getUint8(w)),f++,w++}function o(e,t){return 0!=(e&t)}a.passThroughDataForTesting=!1;const s=[1,2,4,8];function l(e,t,n,i,r,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}l.clone=function(e,n){return t.defined(n)?(n._bits=e._bits,n.cnodeVersion=e.cnodeVersion,n.imageryVersion=e.imageryVersion,n.terrainVersion=e.terrainVersion,n.imageryProvider=e.imageryProvider,n.terrainProvider=e.terrainProvider):n=new l(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),n.ancestorHasTerrain=e.ancestorHasTerrain,n.terrainState=e.terrainState,n},l.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},l.prototype.hasSubtree=function(){return o(this._bits,16)},l.prototype.hasImagery=function(){return o(this._bits,64)},l.prototype.hasTerrain=function(){return o(this._bits,128)},l.prototype.hasChildren=function(){return o(this._bits,15)},l.prototype.hasChild=function(e){return o(this._bits,s[e])},l.prototype.getChildBitmask=function(){return 15&this._bits};var c={},f={};var d=(e,t,n,i)=>{let r=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{r=r+t[i++]|0,a=a+r|0}while(--o);r%=65521,a%=65521}return r|a<<16|0};const h=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var u=(e,t,n,i)=>{const r=h,a=i+n;e^=-1;for(let n=i;n<a;n++)e=e>>>8^r[255&(e^t[n])];return-1^e};const w=15,b=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),m=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),g=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),k=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var _={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const p=d,y=u,v=function(e,t){let n,i,r,a,o,s,l,c,f,d,h,u,w,b,m,g,k,_,p,y,v,E,x,R;const A=e.state;n=e.next_in,x=e.input,i=n+(e.avail_in-5),r=e.next_out,R=e.output,a=r-(t-e.avail_out),o=r+(e.avail_out-257),s=A.dmax,l=A.wsize,c=A.whave,f=A.wnext,d=A.window,h=A.hold,u=A.bits,w=A.lencode,b=A.distcode,m=(1<<A.lenbits)-1,g=(1<<A.distbits)-1;e:do{u<15&&(h+=x[n++]<<u,u+=8,h+=x[n++]<<u,u+=8),k=w[h&m];t:for(;;){if(_=k>>>24,h>>>=_,u-=_,_=k>>>16&255,0===_)R[r++]=65535&k;else{if(!(16&_)){if(0==(64&_)){k=w[(65535&k)+(h&(1<<_)-1)];continue t}if(32&_){A.mode=12;break e}e.msg="invalid literal/length code",A.mode=30;break e}p=65535&k,_&=15,_&&(u<_&&(h+=x[n++]<<u,u+=8),p+=h&(1<<_)-1,h>>>=_,u-=_),u<15&&(h+=x[n++]<<u,u+=8,h+=x[n++]<<u,u+=8),k=b[h&g];n:for(;;){if(_=k>>>24,h>>>=_,u-=_,_=k>>>16&255,!(16&_)){if(0==(64&_)){k=b[(65535&k)+(h&(1<<_)-1)];continue n}e.msg="invalid distance code",A.mode=30;break e}if(y=65535&k,_&=15,u<_&&(h+=x[n++]<<u,u+=8,u<_&&(h+=x[n++]<<u,u+=8)),y+=h&(1<<_)-1,y>s){e.msg="invalid distance too far back",A.mode=30;break e}if(h>>>=_,u-=_,_=r-a,y>_){if(_=y-_,_>c&&A.sane){e.msg="invalid distance too far back",A.mode=30;break e}if(v=0,E=d,0===f){if(v+=l-_,_<p){p-=_;do{R[r++]=d[v++]}while(--_);v=r-y,E=R}}else if(f<_){if(v+=l+f-_,_-=f,_<p){p-=_;do{R[r++]=d[v++]}while(--_);if(v=0,f<p){_=f,p-=_;do{R[r++]=d[v++]}while(--_);v=r-y,E=R}}}else if(v+=f-_,_<p){p-=_;do{R[r++]=d[v++]}while(--_);v=r-y,E=R}for(;p>2;)R[r++]=E[v++],R[r++]=E[v++],R[r++]=E[v++],p-=3;p&&(R[r++]=E[v++],p>1&&(R[r++]=E[v++]))}else{v=r-y;do{R[r++]=R[v++],R[r++]=R[v++],R[r++]=R[v++],p-=3}while(p>2);p&&(R[r++]=R[v++],p>1&&(R[r++]=R[v++]))}break}}break}}while(n<i&&r<o);p=u>>3,n-=p,u-=p<<3,h&=(1<<u)-1,e.next_in=n,e.next_out=r,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=r<o?o-r+257:257-(r-o),A.hold=h,A.bits=u},E=(e,t,n,i,r,a,o,s)=>{const l=s.bits;let c,f,d,h,u,_,p=0,y=0,v=0,E=0,x=0,R=0,A=0,T=0,U=0,S=0,Z=null,D=0;const I=new Uint16Array(16),O=new Uint16Array(16);let B,N,C,M=null,L=0;for(p=0;p<=w;p++)I[p]=0;for(y=0;y<i;y++)I[t[n+y]]++;for(x=l,E=w;E>=1&&0===I[E];E--);if(x>E&&(x=E),0===E)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(v=1;v<E&&0===I[v];v++);for(x<v&&(x=v),T=1,p=1;p<=w;p++)if(T<<=1,T-=I[p],T<0)return-1;if(T>0&&(0===e||1!==E))return-1;for(O[1]=0,p=1;p<w;p++)O[p+1]=O[p]+I[p];for(y=0;y<i;y++)0!==t[n+y]&&(o[O[t[n+y]]++]=y);if(0===e?(Z=M=o,_=19):1===e?(Z=b,D-=257,M=m,L-=257,_=256):(Z=g,M=k,_=-1),S=0,y=0,p=v,u=a,R=x,A=0,d=-1,U=1<<x,h=U-1,1===e&&U>852||2===e&&U>592)return 1;for(;;){B=p-A,o[y]<_?(N=0,C=o[y]):o[y]>_?(N=M[L+o[y]],C=Z[D+o[y]]):(N=96,C=0),c=1<<p-A,f=1<<R,v=f;do{f-=c,r[u+(S>>A)+f]=B<<24|N<<16|C|0}while(0!==f);for(c=1<<p-1;S&c;)c>>=1;if(0!==c?(S&=c-1,S+=c):S=0,y++,0==--I[p]){if(p===E)break;p=t[n+o[y]]}if(p>x&&(S&h)!==d){for(0===A&&(A=x),u+=v,R=p-A,T=1<<R;R+A<E&&(T-=I[R+A],!(T<=0));)R++,T<<=1;if(U+=1<<R,1===e&&U>852||2===e&&U>592)return 1;d=S&h,r[d]=x<<24|R<<16|u-a|0}}return 0!==S&&(r[u+S]=p-A<<24|64<<16|0),s.bits=x,0},{Z_FINISH:x,Z_BLOCK:R,Z_TREES:A,Z_OK:T,Z_STREAM_END:U,Z_NEED_DICT:S,Z_STREAM_ERROR:Z,Z_DATA_ERROR:D,Z_MEM_ERROR:I,Z_BUF_ERROR:O,Z_DEFLATED:B}=_,N=12,C=30,M=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function L(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const F=e=>{if(!e||!e.state)return Z;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,T},P=e=>{if(!e||!e.state)return Z;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,F(e)},z=(e,t)=>{let n;if(!e||!e.state)return Z;const i=e.state;return t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,P(e))},V=(e,t)=>{if(!e)return Z;const n=new L;e.state=n,n.window=null;const i=z(e,t);return i!==T&&(e.state=null),i};let H,j,K=!0;const Y=e=>{if(K){H=new Int32Array(512),j=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(E(1,e.lens,0,288,H,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;E(2,e.lens,0,32,j,0,e.work,{bits:5}),K=!1}e.lencode=H,e.lenbits=9,e.distcode=j,e.distbits=5},G=(e,t,n,i)=>{let r;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(t.subarray(n-i,n-i+r),a.wnext),(i-=r)?(a.window.set(t.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};f.inflateReset=P,f.inflateReset2=z,f.inflateResetKeep=F,f.inflateInit=e=>V(e,15),f.inflateInit2=V,f.inflate=(e,t)=>{let n,i,r,a,o,s,l,c,f,d,h,u,w,b,m,g,k,_,L,F,P,z,V=0;const H=new Uint8Array(4);let j,K;const Q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Z;n=e.state,n.mode===N&&(n.mode=13),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,f=n.bits,d=s,h=l,z=T;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;f<16;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(2&n.wrap&&35615===c){n.check=0,H[0]=255&c,H[1]=c>>>8&255,n.check=y(n.check,H,2,0),c=0,f=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=C;break}if((15&c)!==B){e.msg="unknown compression method",n.mode=C;break}if(c>>>=4,f-=4,P=8+(15&c),0===n.wbits)n.wbits=P;else if(P>n.wbits){e.msg="invalid window size",n.mode=C;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=512&c?10:N,c=0,f=0;break;case 2:for(;f<16;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(n.flags=c,(255&n.flags)!==B){e.msg="unknown compression method",n.mode=C;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=C;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(H[0]=255&c,H[1]=c>>>8&255,n.check=y(n.check,H,2,0)),c=0,f=0,n.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.head&&(n.head.time=c),512&n.flags&&(H[0]=255&c,H[1]=c>>>8&255,H[2]=c>>>16&255,H[3]=c>>>24&255,n.check=y(n.check,H,4,0)),c=0,f=0,n.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(H[0]=255&c,H[1]=c>>>8&255,n.check=y(n.check,H,2,0)),c=0,f=0,n.mode=5;case 5:if(1024&n.flags){for(;f<16;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(H[0]=255&c,H[1]=c>>>8&255,n.check=y(n.check,H,2,0)),c=0,f=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(u=n.length,u>s&&(u=s),u&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+u),P)),512&n.flags&&(n.check=y(n.check,i,u,a)),s-=u,a+=u,n.length-=u),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;u=0;do{P=i[a+u++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P))}while(P&&u<s);if(512&n.flags&&(n.check=y(n.check,i,u,a)),s-=u,a+=u,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break e;u=0;do{P=i[a+u++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P))}while(P&&u<s);if(512&n.flags&&(n.check=y(n.check,i,u,a)),s-=u,a+=u,P)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;f<16;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=C;break}c=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=N;break;case 10:for(;f<32;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}e.adler=n.check=M(c),c=0,f=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=f,S;e.adler=n.check=1,n.mode=N;case N:if(t===R||t===A)break e;case 13:if(n.last){c>>>=7&f,f-=7&f,n.mode=27;break}for(;f<3;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}switch(n.last=1&c,c>>>=1,f-=1,3&c){case 0:n.mode=14;break;case 1:if(Y(n),n.mode=20,t===A){c>>>=2,f-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=C}c>>>=2,f-=2;break;case 14:for(c>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=C;break}if(n.length=65535&c,c=0,f=0,n.mode=15,t===A)break e;case 15:n.mode=16;case 16:if(u=n.length,u){if(u>s&&(u=s),u>l&&(u=l),0===u)break e;r.set(i.subarray(a,a+u),o),s-=u,a+=u,l-=u,o+=u,n.length-=u;break}n.mode=N;break;case 17:for(;f<14;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(n.nlen=257+(31&c),c>>>=5,f-=5,n.ndist=1+(31&c),c>>>=5,f-=5,n.ncode=4+(15&c),c>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=C;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;f<3;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.lens[Q[n.have++]]=7&c,c>>>=3,f-=3}for(;n.have<19;)n.lens[Q[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,j={bits:n.lenbits},z=E(0,n.lens,0,19,n.lencode,0,n.work,j),n.lenbits=j.bits,z){e.msg="invalid code lengths set",n.mode=C;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;V=n.lencode[c&(1<<n.lenbits)-1],m=V>>>24,g=V>>>16&255,k=65535&V,!(m<=f);){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(k<16)c>>>=m,f-=m,n.lens[n.have++]=k;else{if(16===k){for(K=m+2;f<K;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(c>>>=m,f-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=C;break}P=n.lens[n.have-1],u=3+(3&c),c>>>=2,f-=2}else if(17===k){for(K=m+3;f<K;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}c>>>=m,f-=m,P=0,u=3+(7&c),c>>>=3,f-=3}else{for(K=m+7;f<K;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}c>>>=m,f-=m,P=0,u=11+(127&c),c>>>=7,f-=7}if(n.have+u>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=C;break}for(;u--;)n.lens[n.have++]=P}}if(n.mode===C)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=C;break}if(n.lenbits=9,j={bits:n.lenbits},z=E(1,n.lens,0,n.nlen,n.lencode,0,n.work,j),n.lenbits=j.bits,z){e.msg="invalid literal/lengths set",n.mode=C;break}if(n.distbits=6,n.distcode=n.distdyn,j={bits:n.distbits},z=E(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,j),n.distbits=j.bits,z){e.msg="invalid distances set",n.mode=C;break}if(n.mode=20,t===A)break e;case 20:n.mode=21;case 21:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=f,v(e,h),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,f=n.bits,n.mode===N&&(n.back=-1);break}for(n.back=0;V=n.lencode[c&(1<<n.lenbits)-1],m=V>>>24,g=V>>>16&255,k=65535&V,!(m<=f);){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(g&&0==(240&g)){for(_=m,L=g,F=k;V=n.lencode[F+((c&(1<<_+L)-1)>>_)],m=V>>>24,g=V>>>16&255,k=65535&V,!(_+m<=f);){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}c>>>=_,f-=_,n.back+=_}if(c>>>=m,f-=m,n.back+=m,n.length=k,0===g){n.mode=26;break}if(32&g){n.back=-1,n.mode=N;break}if(64&g){e.msg="invalid literal/length code",n.mode=C;break}n.extra=15&g,n.mode=22;case 22:if(n.extra){for(K=n.extra;f<K;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;V=n.distcode[c&(1<<n.distbits)-1],m=V>>>24,g=V>>>16&255,k=65535&V,!(m<=f);){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(0==(240&g)){for(_=m,L=g,F=k;V=n.distcode[F+((c&(1<<_+L)-1)>>_)],m=V>>>24,g=V>>>16&255,k=65535&V,!(_+m<=f);){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}c>>>=_,f-=_,n.back+=_}if(c>>>=m,f-=m,n.back+=m,64&g){e.msg="invalid distance code",n.mode=C;break}n.offset=k,n.extra=15&g,n.mode=24;case 24:if(n.extra){for(K=n.extra;f<K;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=C;break}n.mode=25;case 25:if(0===l)break e;if(u=h-l,n.offset>u){if(u=n.offset-u,u>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=C;break}u>n.wnext?(u-=n.wnext,w=n.wsize-u):w=n.wnext-u,u>n.length&&(u=n.length),b=n.window}else b=r,w=o-n.offset,u=n.length;u>l&&(u=l),l-=u,n.length-=u;do{r[o++]=b[w++]}while(--u);0===n.length&&(n.mode=21);break;case 26:if(0===l)break e;r[o++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;f<32;){if(0===s)break e;s--,c|=i[a++]<<f,f+=8}if(h-=l,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?y(n.check,r,h,o-h):p(n.check,r,h,o-h)),h=l,(n.flags?c:M(c))!==n.check){e.msg="incorrect data check",n.mode=C;break}c=0,f=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;f<32;){if(0===s)break e;s--,c+=i[a++]<<f,f+=8}if(c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=C;break}c=0,f=0}n.mode=29;case 29:z=U;break e;case C:z=D;break e;case 31:return I;default:return Z}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=f,(n.wsize||h!==e.avail_out&&n.mode<C&&(n.mode<27||t!==x))&&G(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?y(n.check,r,h,e.next_out-h):p(n.check,r,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===N?128:0)+(20===n.mode||15===n.mode?256:0),(0===d&&0===h||t===x)&&z===T&&(z=O),z},f.inflateEnd=e=>{if(!e||!e.state)return Z;let t=e.state;return t.window&&(t.window=null),e.state=null,T},f.inflateGetHeader=(e,t)=>{if(!e||!e.state)return Z;const n=e.state;return 0==(2&n.wrap)?Z:(n.head=t,t.done=!1,T)},f.inflateSetDictionary=(e,t)=>{const n=t.length;let i,r,a;return e&&e.state?(i=e.state,0!==i.wrap&&11!==i.mode?Z:11===i.mode&&(r=1,r=p(r,t,n,0),r!==i.check)?D:(a=G(e,t,n,n),a?(i.mode=31,I):(i.havedict=1,T))):Z},f.inflateInfo="pako inflate (from Nodeca project)";var Q={};const W=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Q.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)W(n,t)&&(e[t]=n[t])}}return e},Q.flattenChunks=e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,i=0,r=e.length;t<r;t++){let r=e[t];n.set(r,i),i+=r.length}return n};var X={};let q=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){q=!1}const J=new Uint8Array(256);for(let e=0;e<256;e++)J[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;J[254]=J[254]=1,X.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,i,r,a,o=e.length,s=0;for(r=0;r<o;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<o&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,r=0;a<s;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<o&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t};X.buf2string=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const a=new Array(2*n);for(r=0,i=0;i<n;){let t=e[i++];if(t<128){a[r++]=t;continue}let o=J[t];if(o>4)a[r++]=65533,i+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&i<n;)t=t<<6|63&e[i++],o--;o>1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&q)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(a,r)},X.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+J[e[n]]>t?n:t};const $=f,ee=Q,te=X,ne={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ie=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},re=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},ae=Object.prototype.toString,{Z_NO_FLUSH:oe,Z_FINISH:se,Z_OK:le,Z_STREAM_END:ce,Z_NEED_DICT:fe,Z_STREAM_ERROR:de,Z_DATA_ERROR:he,Z_MEM_ERROR:ue}=_;function we(e){this.options=ee.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ie,this.strm.avail_out=0;let n=$.inflateInit2(this.strm,t.windowBits);if(n!==le)throw new Error(ne[n]);if(this.header=new re,$.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=te.string2buf(t.dictionary):"[object ArrayBuffer]"===ae.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=$.inflateSetDictionary(this.strm,t.dictionary),n!==le)))throw new Error(ne[n])}function be(e,t){const n=new we(t);if(n.push(e),n.err)throw n.msg||ne[n.err];return n.result}we.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?se:oe,"[object ArrayBuffer]"===ae.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=$.inflate(n,o),a===fe&&r&&(a=$.inflateSetDictionary(n,r),a===le?a=$.inflate(n,o):a===he&&(a=fe));n.avail_in>0&&a===ce&&n.state.wrap>0&&0!==e[n.next_in];)$.inflateReset(n),a=$.inflate(n,o);switch(a){case de:case he:case fe:case ue:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||a===ce))if("string"===this.options.to){let e=te.utf8border(n.output,n.next_out),t=n.next_out-e,r=te.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==le||0!==s){if(a===ce)return a=$.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},we.prototype.onData=function(e){this.chunks.push(e)},we.prototype.onEnd=function(e){e===le&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ee.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},c.Inflate=we,c.inflate=be,c.inflateRaw=function(e,t){return(t=t||{}).raw=!0,be(e,t)},c.ungzip=be,c.constants=_;const me=Uint16Array.BYTES_PER_ELEMENT,ge=Int32Array.BYTES_PER_ELEMENT,ke=Uint32Array.BYTES_PER_ELEMENT,_e={METADATA:0,TERRAIN:1,DBROOT:2};_e.fromString=function(e){return"Metadata"===e?_e.METADATA:"Terrain"===e?_e.TERRAIN:"DbRoot"===e?_e.DBROOT:void 0};const pe=32301;const ye=5,ve=4;const Ee=1953029805,xe=2917034100;return n((function(t,n){const i=_e.fromString(t.type);let r=t.buffer;a(t.key,r);const o=function(t){const n=new DataView(t);let i=0;const r=n.getUint32(i,!0);if(i+=ke,r!==Ee&&r!==xe)throw new e.RuntimeError("Invalid magic");const a=n.getUint32(i,r===Ee);i+=ke;const o=new Uint8Array(t,i),s=c.inflate(o);if(s.length!==a)throw new e.RuntimeError("Size of packet doesn't match header");return s}(r);r=o.buffer;const s=o.length;switch(i){case _e.METADATA:return function(t,n,i){const r=new DataView(t);let a=0;const o=r.getUint32(a,!0);if(a+=ke,o!==pe)throw new e.RuntimeError("Invalid magic");const s=r.getUint32(a,!0);if(a+=ke,1!==s)throw new e.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");const c=r.getUint32(a,!0);if(a+=ke,2!==c)throw new e.RuntimeError("Invalid QuadTreePacket version. Only version 2 is supported.");const f=r.getInt32(a,!0);a+=ge;const d=r.getInt32(a,!0);if(a+=ge,32!==d)throw new e.RuntimeError("Invalid instance size.");const h=r.getInt32(a,!0);a+=ge;const u=r.getInt32(a,!0);a+=ge;const w=r.getInt32(a,!0);if(a+=ge,h!==f*d+a)throw new e.RuntimeError("Invalid dataBufferOffset");if(h+u+w!==n)throw new e.RuntimeError("Invalid packet offsets");const b=[];for(let e=0;e<f;++e){const e=r.getUint8(a);++a,++a;const t=r.getUint16(a,!0);a+=me;const n=r.getUint16(a,!0);a+=me;const i=r.getUint16(a,!0);a+=me,a+=me,a+=me,a+=ge,a+=ge,a+=8;const o=r.getUint8(a++),s=r.getUint8(a++);a+=me,b.push(new l(e,t,n,i,o,s))}const m=[];let g=0;function k(e,t,n){let i=!1;if(4===n){if(t.hasSubtree())return;i=!0}for(let r=0;r<4;++r){const a=e+r.toString();if(i)m[a]=null;else if(n<4)if(t.hasChild(r)){if(g===f)return void console.log("Incorrect number of instances");const e=b[g++];m[a]=e,k(a,e,n+1)}else m[a]=null}}let _=0;const p=b[g++];""===i?++_:m[i]=p;return k(i,p,_),m}(r,s,t.quadKey);case _e.TERRAIN:return function(t,n,i){const r=new DataView(t),a=function(t){for(let i=0;i<ve;++i){const i=r.getUint32(t,!0);if(t+=ke,(t+=i)>n)throw new e.RuntimeError("Malformed terrain packet found.")}return t};let o=0;const s=[];for(;s.length<ye;){const e=o;o=a(o);const n=t.slice(e,o);i.push(n),s.push(n)}return s}(r,s,n);case _e.DBROOT:return n.push(r),{buffer:r}}}))})); +define(["./RuntimeError-9b4ce3fb","./defaultValue-f6d5e6da","./createTaskProcessorWorker"],(function(e,t,n){"use strict";const i=1953029805,r=2917034100;function a(t,n){if(a.passThroughDataForTesting)return n;const o=t.byteLength;if(0===o||o%4!=0)throw new e.RuntimeError("The length of key must be greater than 0 and a multiple of 4.");const s=new DataView(n),l=s.getUint32(0,!0);if(l===i||l===r)return n;const c=new DataView(t);let d=0;const f=n.byteLength,h=f-f%8,u=o;let w,b=8;for(;d<h;)for(b=(b+8)%24,w=b;d<h&&w<u;)s.setUint32(d,s.getUint32(d,!0)^c.getUint32(w,!0),!0),s.setUint32(d+4,s.getUint32(d+4,!0)^c.getUint32(w+4,!0),!0),d+=8,w+=24;if(d<f)for(w>=u&&(b=(b+8)%24,w=b);d<f;)s.setUint8(d,s.getUint8(d)^c.getUint8(w)),d++,w++}function o(e,t){return 0!=(e&t)}a.passThroughDataForTesting=!1;const s=[1,2,4,8];function l(e,t,n,i,r,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}l.clone=function(e,n){return t.defined(n)?(n._bits=e._bits,n.cnodeVersion=e.cnodeVersion,n.imageryVersion=e.imageryVersion,n.terrainVersion=e.terrainVersion,n.imageryProvider=e.imageryProvider,n.terrainProvider=e.terrainProvider):n=new l(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),n.ancestorHasTerrain=e.ancestorHasTerrain,n.terrainState=e.terrainState,n},l.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},l.prototype.hasSubtree=function(){return o(this._bits,16)},l.prototype.hasImagery=function(){return o(this._bits,64)},l.prototype.hasTerrain=function(){return o(this._bits,128)},l.prototype.hasChildren=function(){return o(this._bits,15)},l.prototype.hasChild=function(e){return o(this._bits,s[e])},l.prototype.getChildBitmask=function(){return 15&this._bits};var c={},d={};var f=(e,t,n,i)=>{let r=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{r=r+t[i++]|0,a=a+r|0}while(--o);r%=65521,a%=65521}return r|a<<16|0};const h=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var u=(e,t,n,i)=>{const r=h,a=i+n;e^=-1;for(let n=i;n<a;n++)e=e>>>8^r[255&(e^t[n])];return-1^e};const w=16209;const b=15,m=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),g=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),k=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var p={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const y=f,v=u,E=function(e,t){let n,i,r,a,o,s,l,c,d,f,h,u,b,m,g,k,_,p,y,v,E,x,R,A;const T=e.state;n=e.next_in,R=e.input,i=n+(e.avail_in-5),r=e.next_out,A=e.output,a=r-(t-e.avail_out),o=r+(e.avail_out-257),s=T.dmax,l=T.wsize,c=T.whave,d=T.wnext,f=T.window,h=T.hold,u=T.bits,b=T.lencode,m=T.distcode,g=(1<<T.lenbits)-1,k=(1<<T.distbits)-1;e:do{u<15&&(h+=R[n++]<<u,u+=8,h+=R[n++]<<u,u+=8),_=b[h&g];t:for(;;){if(p=_>>>24,h>>>=p,u-=p,p=_>>>16&255,0===p)A[r++]=65535&_;else{if(!(16&p)){if(0==(64&p)){_=b[(65535&_)+(h&(1<<p)-1)];continue t}if(32&p){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=w;break e}y=65535&_,p&=15,p&&(u<p&&(h+=R[n++]<<u,u+=8),y+=h&(1<<p)-1,h>>>=p,u-=p),u<15&&(h+=R[n++]<<u,u+=8,h+=R[n++]<<u,u+=8),_=m[h&k];n:for(;;){if(p=_>>>24,h>>>=p,u-=p,p=_>>>16&255,!(16&p)){if(0==(64&p)){_=m[(65535&_)+(h&(1<<p)-1)];continue n}e.msg="invalid distance code",T.mode=w;break e}if(v=65535&_,p&=15,u<p&&(h+=R[n++]<<u,u+=8,u<p&&(h+=R[n++]<<u,u+=8)),v+=h&(1<<p)-1,v>s){e.msg="invalid distance too far back",T.mode=w;break e}if(h>>>=p,u-=p,p=r-a,v>p){if(p=v-p,p>c&&T.sane){e.msg="invalid distance too far back",T.mode=w;break e}if(E=0,x=f,0===d){if(E+=l-p,p<y){y-=p;do{A[r++]=f[E++]}while(--p);E=r-v,x=A}}else if(d<p){if(E+=l+d-p,p-=d,p<y){y-=p;do{A[r++]=f[E++]}while(--p);if(E=0,d<y){p=d,y-=p;do{A[r++]=f[E++]}while(--p);E=r-v,x=A}}}else if(E+=d-p,p<y){y-=p;do{A[r++]=f[E++]}while(--p);E=r-v,x=A}for(;y>2;)A[r++]=x[E++],A[r++]=x[E++],A[r++]=x[E++],y-=3;y&&(A[r++]=x[E++],y>1&&(A[r++]=x[E++]))}else{E=r-v;do{A[r++]=A[E++],A[r++]=A[E++],A[r++]=A[E++],y-=3}while(y>2);y&&(A[r++]=A[E++],y>1&&(A[r++]=A[E++]))}break}}break}}while(n<i&&r<o);y=u>>3,n-=y,u-=y<<3,h&=(1<<u)-1,e.next_in=n,e.next_out=r,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=r<o?o-r+257:257-(r-o),T.hold=h,T.bits=u},x=(e,t,n,i,r,a,o,s)=>{const l=s.bits;let c,d,f,h,u,w,p=0,y=0,v=0,E=0,x=0,R=0,A=0,T=0,U=0,S=0,Z=null;const D=new Uint16Array(16),I=new Uint16Array(16);let O,B,N,C=null;for(p=0;p<=b;p++)D[p]=0;for(y=0;y<i;y++)D[t[n+y]]++;for(x=l,E=b;E>=1&&0===D[E];E--);if(x>E&&(x=E),0===E)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(v=1;v<E&&0===D[v];v++);for(x<v&&(x=v),T=1,p=1;p<=b;p++)if(T<<=1,T-=D[p],T<0)return-1;if(T>0&&(0===e||1!==E))return-1;for(I[1]=0,p=1;p<b;p++)I[p+1]=I[p]+D[p];for(y=0;y<i;y++)0!==t[n+y]&&(o[I[t[n+y]]++]=y);if(0===e?(Z=C=o,w=20):1===e?(Z=m,C=g,w=257):(Z=k,C=_,w=0),S=0,y=0,p=v,u=a,R=x,A=0,f=-1,U=1<<x,h=U-1,1===e&&U>852||2===e&&U>592)return 1;for(;;){O=p-A,o[y]+1<w?(B=0,N=o[y]):o[y]>=w?(B=C[o[y]-w],N=Z[o[y]-w]):(B=96,N=0),c=1<<p-A,d=1<<R,v=d;do{d-=c,r[u+(S>>A)+d]=O<<24|B<<16|N|0}while(0!==d);for(c=1<<p-1;S&c;)c>>=1;if(0!==c?(S&=c-1,S+=c):S=0,y++,0==--D[p]){if(p===E)break;p=t[n+o[y]]}if(p>x&&(S&h)!==f){for(0===A&&(A=x),u+=v,R=p-A,T=1<<R;R+A<E&&(T-=D[R+A],!(T<=0));)R++,T<<=1;if(U+=1<<R,1===e&&U>852||2===e&&U>592)return 1;f=S&h,r[f]=x<<24|R<<16|u-a|0}}return 0!==S&&(r[u+S]=p-A<<24|64<<16|0),s.bits=x,0},{Z_FINISH:R,Z_BLOCK:A,Z_TREES:T,Z_OK:U,Z_STREAM_END:S,Z_NEED_DICT:Z,Z_STREAM_ERROR:D,Z_DATA_ERROR:I,Z_MEM_ERROR:O,Z_BUF_ERROR:B,Z_DEFLATED:N}=p,C=16180,M=16190,L=16191,F=16192,P=16194,z=16199,V=16200,H=16206,j=16209,K=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Y(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const G=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<C||t.mode>16211?1:0},Q=e=>{if(G(e))return D;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=C,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,U},W=e=>{if(G(e))return D;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Q(e)},X=(e,t)=>{let n;if(G(e))return D;const i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?D:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,W(e))},q=(e,t)=>{if(!e)return D;const n=new Y;e.state=n,n.strm=e,n.window=null,n.mode=C;const i=X(e,t);return i!==U&&(e.state=null),i};let J,$,ee=!0;const te=e=>{if(ee){J=new Int32Array(512),$=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(x(1,e.lens,0,288,J,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;x(2,e.lens,0,32,$,0,e.work,{bits:5}),ee=!1}e.lencode=J,e.lenbits=9,e.distcode=$,e.distbits=5},ne=(e,t,n,i)=>{let r;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(t.subarray(n-i,n-i+r),a.wnext),(i-=r)?(a.window.set(t.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};d.inflateReset=W,d.inflateReset2=X,d.inflateResetKeep=Q,d.inflateInit=e=>q(e,15),d.inflateInit2=q,d.inflate=(e,t)=>{let n,i,r,a,o,s,l,c,d,f,h,u,w,b,m,g,k,_,p,Y,Q,W,X=0;const q=new Uint8Array(4);let J,$;const ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(G(e)||!e.output||!e.input&&0!==e.avail_in)return D;n=e.state,n.mode===L&&(n.mode=F),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,d=n.bits,f=s,h=l,W=U;e:for(;;)switch(n.mode){case C:if(0===n.wrap){n.mode=F;break}for(;d<16;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0),c=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=j;break}if((15&c)!==N){e.msg="unknown compression method",n.mode=j;break}if(c>>>=4,d-=4,Q=8+(15&c),0===n.wbits&&(n.wbits=Q),Q>15||Q>n.wbits){e.msg="invalid window size",n.mode=j;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&c?16189:L,c=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(n.flags=c,(255&n.flags)!==N){e.msg="unknown compression method",n.mode=j;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=j;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,q[2]=c>>>16&255,q[3]=c>>>24&255,n.check=v(n.check,q,4,0)),c=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(u=n.length,u>s&&(u=s),u&&(n.head&&(Q=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+u),Q)),512&n.flags&&4&n.wrap&&(n.check=v(n.check,i,u,a)),s-=u,a+=u,n.length-=u),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;u=0;do{Q=i[a+u++],n.head&&Q&&n.length<65536&&(n.head.name+=String.fromCharCode(Q))}while(Q&&u<s);if(512&n.flags&&4&n.wrap&&(n.check=v(n.check,i,u,a)),s-=u,a+=u,Q)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;u=0;do{Q=i[a+u++],n.head&&Q&&n.length<65536&&(n.head.comment+=String.fromCharCode(Q))}while(Q&&u<s);if(512&n.flags&&4&n.wrap&&(n.check=v(n.check,i,u,a)),s-=u,a+=u,Q)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;d<16;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(4&n.wrap&&c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=j;break}c=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=L;break;case 16189:for(;d<32;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}e.adler=n.check=K(c),c=0,d=0,n.mode=M;case M:if(0===n.havedict)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=d,Z;e.adler=n.check=1,n.mode=L;case L:if(t===A||t===T)break e;case F:if(n.last){c>>>=7&d,d-=7&d,n.mode=H;break}for(;d<3;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}switch(n.last=1&c,c>>>=1,d-=1,3&c){case 0:n.mode=16193;break;case 1:if(te(n),n.mode=z,t===T){c>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=j}c>>>=2,d-=2;break;case 16193:for(c>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=j;break}if(n.length=65535&c,c=0,d=0,n.mode=P,t===T)break e;case P:n.mode=16195;case 16195:if(u=n.length,u){if(u>s&&(u=s),u>l&&(u=l),0===u)break e;r.set(i.subarray(a,a+u),o),s-=u,a+=u,l-=u,o+=u,n.length-=u;break}n.mode=L;break;case 16196:for(;d<14;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(n.nlen=257+(31&c),c>>>=5,d-=5,n.ndist=1+(31&c),c>>>=5,d-=5,n.ncode=4+(15&c),c>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=j;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.lens[ee[n.have++]]=7&c,c>>>=3,d-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,J={bits:n.lenbits},W=x(0,n.lens,0,19,n.lencode,0,n.work,J),n.lenbits=J.bits,W){e.msg="invalid code lengths set",n.mode=j;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;X=n.lencode[c&(1<<n.lenbits)-1],m=X>>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(k<16)c>>>=m,d-=m,n.lens[n.have++]=k;else{if(16===k){for($=m+2;d<$;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(c>>>=m,d-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=j;break}Q=n.lens[n.have-1],u=3+(3&c),c>>>=2,d-=2}else if(17===k){for($=m+3;d<$;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}c>>>=m,d-=m,Q=0,u=3+(7&c),c>>>=3,d-=3}else{for($=m+7;d<$;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}c>>>=m,d-=m,Q=0,u=11+(127&c),c>>>=7,d-=7}if(n.have+u>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=j;break}for(;u--;)n.lens[n.have++]=Q}}if(n.mode===j)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=j;break}if(n.lenbits=9,J={bits:n.lenbits},W=x(1,n.lens,0,n.nlen,n.lencode,0,n.work,J),n.lenbits=J.bits,W){e.msg="invalid literal/lengths set",n.mode=j;break}if(n.distbits=6,n.distcode=n.distdyn,J={bits:n.distbits},W=x(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,J),n.distbits=J.bits,W){e.msg="invalid distances set",n.mode=j;break}if(n.mode=z,t===T)break e;case z:n.mode=V;case V:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=d,E(e,h),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,d=n.bits,n.mode===L&&(n.back=-1);break}for(n.back=0;X=n.lencode[c&(1<<n.lenbits)-1],m=X>>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(g&&0==(240&g)){for(_=m,p=g,Y=k;X=n.lencode[Y+((c&(1<<_+p)-1)>>_)],m=X>>>24,g=X>>>16&255,k=65535&X,!(_+m<=d);){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}c>>>=_,d-=_,n.back+=_}if(c>>>=m,d-=m,n.back+=m,n.length=k,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=L;break}if(64&g){e.msg="invalid literal/length code",n.mode=j;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for($=n.extra;d<$;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;X=n.distcode[c&(1<<n.distbits)-1],m=X>>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(0==(240&g)){for(_=m,p=g,Y=k;X=n.distcode[Y+((c&(1<<_+p)-1)>>_)],m=X>>>24,g=X>>>16&255,k=65535&X,!(_+m<=d);){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}c>>>=_,d-=_,n.back+=_}if(c>>>=m,d-=m,n.back+=m,64&g){e.msg="invalid distance code",n.mode=j;break}n.offset=k,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for($=n.extra;d<$;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=j;break}n.mode=16204;case 16204:if(0===l)break e;if(u=h-l,n.offset>u){if(u=n.offset-u,u>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=j;break}u>n.wnext?(u-=n.wnext,w=n.wsize-u):w=n.wnext-u,u>n.length&&(u=n.length),b=n.window}else b=r,w=o-n.offset,u=n.length;u>l&&(u=l),l-=u,n.length-=u;do{r[o++]=b[w++]}while(--u);0===n.length&&(n.mode=V);break;case 16205:if(0===l)break e;r[o++]=n.length,l--,n.mode=V;break;case H:if(n.wrap){for(;d<32;){if(0===s)break e;s--,c|=i[a++]<<d,d+=8}if(h-=l,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?v(n.check,r,h,o-h):y(n.check,r,h,o-h)),h=l,4&n.wrap&&(n.flags?c:K(c))!==n.check){e.msg="incorrect data check",n.mode=j;break}c=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,c+=i[a++]<<d,d+=8}if(4&n.wrap&&c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=j;break}c=0,d=0}n.mode=16208;case 16208:W=S;break e;case j:W=I;break e;case 16210:return O;default:return D}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=d,(n.wsize||h!==e.avail_out&&n.mode<j&&(n.mode<H||t!==R))&&ne(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?v(n.check,r,h,e.next_out-h):y(n.check,r,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===L?128:0)+(n.mode===z||n.mode===P?256:0),(0===f&&0===h||t===R)&&W===U&&(W=B),W},d.inflateEnd=e=>{if(G(e))return D;let t=e.state;return t.window&&(t.window=null),e.state=null,U},d.inflateGetHeader=(e,t)=>{if(G(e))return D;const n=e.state;return 0==(2&n.wrap)?D:(n.head=t,t.done=!1,U)},d.inflateSetDictionary=(e,t)=>{const n=t.length;let i,r,a;return G(e)?D:(i=e.state,0!==i.wrap&&i.mode!==M?D:i.mode===M&&(r=1,r=y(r,t,n,0),r!==i.check)?I:(a=ne(e,t,n,n),a?(i.mode=16210,O):(i.havedict=1,U)))},d.inflateInfo="pako inflate (from Nodeca project)";var ie={};const re=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);ie.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)re(n,t)&&(e[t]=n[t])}}return e},ie.flattenChunks=e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,i=0,r=e.length;t<r;t++){let r=e[t];n.set(r,i),i+=r.length}return n};var ae={};let oe=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){oe=!1}const se=new Uint8Array(256);for(let e=0;e<256;e++)se[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;se[254]=se[254]=1,ae.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,i,r,a,o=e.length,s=0;for(r=0;r<o;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<o&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,r=0;a<s;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<o&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t};ae.buf2string=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const a=new Array(2*n);for(r=0,i=0;i<n;){let t=e[i++];if(t<128){a[r++]=t;continue}let o=se[t];if(o>4)a[r++]=65533,i+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&i<n;)t=t<<6|63&e[i++],o--;o>1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&oe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(a,r)},ae.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+se[e[n]]>t?n:t};const le=d,ce=ie,de=ae,fe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},he=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ue=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},we=Object.prototype.toString,{Z_NO_FLUSH:be,Z_FINISH:me,Z_OK:ge,Z_STREAM_END:ke,Z_NEED_DICT:_e,Z_STREAM_ERROR:pe,Z_DATA_ERROR:ye,Z_MEM_ERROR:ve}=p;function Ee(e){this.options=ce.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new he,this.strm.avail_out=0;let n=le.inflateInit2(this.strm,t.windowBits);if(n!==ge)throw new Error(fe[n]);if(this.header=new ue,le.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=de.string2buf(t.dictionary):"[object ArrayBuffer]"===we.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=le.inflateSetDictionary(this.strm,t.dictionary),n!==ge)))throw new Error(fe[n])}function xe(e,t){const n=new Ee(t);if(n.push(e),n.err)throw n.msg||fe[n.err];return n.result}Ee.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?me:be,"[object ArrayBuffer]"===we.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=le.inflate(n,o),a===_e&&r&&(a=le.inflateSetDictionary(n,r),a===ge?a=le.inflate(n,o):a===ye&&(a=_e));n.avail_in>0&&a===ke&&n.state.wrap>0&&0!==e[n.next_in];)le.inflateReset(n),a=le.inflate(n,o);switch(a){case pe:case ye:case _e:case ve:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||a===ke))if("string"===this.options.to){let e=de.utf8border(n.output,n.next_out),t=n.next_out-e,r=de.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==ge||0!==s){if(a===ke)return a=le.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ee.prototype.onData=function(e){this.chunks.push(e)},Ee.prototype.onEnd=function(e){e===ge&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ce.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},c.Inflate=Ee,c.inflate=xe,c.inflateRaw=function(e,t){return(t=t||{}).raw=!0,xe(e,t)},c.ungzip=xe,c.constants=p;const Re=Uint16Array.BYTES_PER_ELEMENT,Ae=Int32Array.BYTES_PER_ELEMENT,Te=Uint32Array.BYTES_PER_ELEMENT,Ue={METADATA:0,TERRAIN:1,DBROOT:2};Ue.fromString=function(e){return"Metadata"===e?Ue.METADATA:"Terrain"===e?Ue.TERRAIN:"DbRoot"===e?Ue.DBROOT:void 0};const Se=32301;const Ze=5,De=4;const Ie=1953029805,Oe=2917034100;return n((function(t,n){const i=Ue.fromString(t.type);let r=t.buffer;a(t.key,r);const o=function(t){const n=new DataView(t);let i=0;const r=n.getUint32(i,!0);if(i+=Te,r!==Ie&&r!==Oe)throw new e.RuntimeError("Invalid magic");const a=n.getUint32(i,r===Ie);i+=Te;const o=new Uint8Array(t,i),s=c.inflate(o);if(s.length!==a)throw new e.RuntimeError("Size of packet doesn't match header");return s}(r);r=o.buffer;const s=o.length;switch(i){case Ue.METADATA:return function(t,n,i){const r=new DataView(t);let a=0;const o=r.getUint32(a,!0);if(a+=Te,o!==Se)throw new e.RuntimeError("Invalid magic");const s=r.getUint32(a,!0);if(a+=Te,1!==s)throw new e.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");const c=r.getUint32(a,!0);if(a+=Te,2!==c)throw new e.RuntimeError("Invalid QuadTreePacket version. Only version 2 is supported.");const d=r.getInt32(a,!0);a+=Ae;const f=r.getInt32(a,!0);if(a+=Ae,32!==f)throw new e.RuntimeError("Invalid instance size.");const h=r.getInt32(a,!0);a+=Ae;const u=r.getInt32(a,!0);a+=Ae;const w=r.getInt32(a,!0);if(a+=Ae,h!==d*f+a)throw new e.RuntimeError("Invalid dataBufferOffset");if(h+u+w!==n)throw new e.RuntimeError("Invalid packet offsets");const b=[];for(let e=0;e<d;++e){const e=r.getUint8(a);++a,++a;const t=r.getUint16(a,!0);a+=Re;const n=r.getUint16(a,!0);a+=Re;const i=r.getUint16(a,!0);a+=Re,a+=Re,a+=Re,a+=Ae,a+=Ae,a+=8;const o=r.getUint8(a++),s=r.getUint8(a++);a+=Re,b.push(new l(e,t,n,i,o,s))}const m=[];let g=0;function k(e,t,n){let i=!1;if(4===n){if(t.hasSubtree())return;i=!0}for(let r=0;r<4;++r){const a=e+r.toString();if(i)m[a]=null;else if(n<4)if(t.hasChild(r)){if(g===d)return void console.log("Incorrect number of instances");const e=b[g++];m[a]=e,k(a,e,n+1)}else m[a]=null}}let _=0;const p=b[g++];""===i?++_:m[i]=p;return k(i,p,_),m}(r,s,t.quadKey);case Ue.TERRAIN:return function(t,n,i){const r=new DataView(t),a=function(t){for(let i=0;i<De;++i){const i=r.getUint32(t,!0);if(t+=Te,(t+=i)>n)throw new e.RuntimeError("Malformed terrain packet found.")}return t};let o=0;const s=[];for(;s.length<Ze;){const e=o;o=a(o);const n=t.slice(e,o);i.push(n),s.push(n)}return s}(r,s,n);case Ue.DBROOT:return n.push(r),{buffer:r}}}))})); diff --git a/public/lib/Cesium/Workers/decodeI3S.js b/public/lib/Cesium/Workers/decodeI3S.js index 9f6ab8f7..e3b78065 100644 --- a/public/lib/Cesium/Workers/decodeI3S.js +++ b/public/lib/Cesium/Workers/decodeI3S.js @@ -1 +1 @@ -define(["./createTaskProcessorWorker","./defaultValue-f6d5e6da","./WebMercatorProjection-943e2226","./Matrix3-81054f0f","./Math-2ce22ee9"],(function(e,t,n,r,o){"use strict";let i;function a(e,t,n,r){return r[e+t*n]}function s(e,t,n){const r=n.nativeExtent;let o=(e-r.west)/(r.east-r.west)*(n.width-1),i=(t-r.south)/(r.north-r.south)*(n.height-1);const s=Math.floor(o);let u=Math.floor(i);o-=s,i-=u;const c=s<n.width?s+1:s;let f=u<n.height?u+1:u;u=n.height-1-u,f=n.height-1-f;let l=function(e,t,n,r,o,i){return(n*(1-e)+r*e)*(1-t)+(o*(1-e)+i*e)*t}(o,i,a(s,u,n.width,n.buffer),a(c,u,n.width,n.buffer),a(s,f,n.width,n.buffer),a(c,f,n.width,n.buffer));return l=l*n.scale+n.offset,l}function u(e,t,o){for(let i=0;i<o.length;i++){const a=o[i].nativeExtent;let u=new r.Cartesian3;if("WebMercator"===o[i].projectionType){const a=o[i].projection._ellipsoid._radii;u=new n.WebMercatorProjection(new r.Ellipsoid(a.x,a.y,a.z)).project(new r.Cartographic(e,t,0))}else u.x=e,u.y=t;if(u.x>a.west&&u.x<a.east&&u.y>a.south&&u.y<a.north)return s(u.x,u.y,o[i])}return 0}function c(e,n,r,o){const a=new Uint8Array(e,0,5);return a[0]==="D".charCodeAt()&&a[1]==="R".charCodeAt()&&a[2]==="A".charCodeAt()&&a[3]==="C".charCodeAt()&&a[4]==="O".charCodeAt()?function(e){const n=i,r=new n.DecoderBuffer,o=new Uint8Array(e);r.Init(o,o.length);const a=new n.Decoder,s=a.GetEncodedGeometryType(r),u=new n.MetadataQuerier;let c,l;s===n.TRIANGULAR_MESH&&(c=new n.Mesh,l=a.DecodeBufferToMesh(r,c));const d={vertexCount:[0],featureCount:0};if(t.defined(l)&&l.ok()&&0!==c.ptr){const e=c.num_faces(),r=c.num_attributes(),o=c.num_points();d.indices=new Uint32Array(3*e);const i=d.indices;d.vertexCount[0]=o,d.scale_x=1,d.scale_y=1;const s=new n.DracoInt32Array(3);for(let t=0;t<e;++t)a.GetFaceFromMesh(c,t,s),i[3*t]=s.GetValue(0),i[3*t+1]=s.GetValue(1),i[3*t+2]=s.GetValue(2);n.destroy(s);for(let e=0;e<r;++e){const r=a.GetAttribute(c,e),i=f(n,a,c,r,o),s=r.attribute_type();let l="unknown";s===n.POSITION?l="positions":s===n.NORMAL?l="normals":s===n.COLOR?l="colors":s===n.TEX_COORD&&(l="uv0s");const y=a.GetAttributeMetadata(c,e);if(0!==y.ptr){const e=u.NumEntries(y);for(let t=0;t<e;++t){const e=u.GetEntryName(y,t);"i3s-scale_x"===e?d.scale_x=u.GetDoubleEntry(y,"i3s-scale_x"):"i3s-scale_y"===e?d.scale_y=u.GetDoubleEntry(y,"i3s-scale_y"):"i3s-attribute-type"===e&&(l=u.GetStringEntry(y,"i3s-attribute-type"))}}t.defined(d[l])&&console.log("Attribute already exists",l),d[l]=i,"feature-index"===l&&d.featureCount++}n.destroy(c)}return n.destroy(u),n.destroy(a),d}(e):function(e,n,r,o){const i={vertexCount:0},a=new DataView(e);try{let s=0;if(i.vertexCount=a.getUint32(s,1),s+=4,i.featureCount=a.getUint32(s,1),s+=4,t.defined(r))for(let n=0;n<r.attributes.length;n++)t.defined(l[r.attributes[n]])?s=l[r.attributes[n]](i,e,s):console.error("Unknown decoder for",r.attributes[n]);else{let r=n.ordering,a=n.featureAttributeOrder;t.defined(o)&&t.defined(o.geometryData)&&t.defined(o.geometryData[0])&&t.defined(o.geometryData[0].params)&&(r=Object.keys(o.geometryData[0].params.vertexAttributes),a=Object.keys(o.geometryData[0].params.featureAttributes));for(let n=0;n<r.length;n++){const o=l[r[n]];t.defined(o)||console.log(r[n]),s=o(i,e,s)}for(let n=0;n<a.length;n++){const r=l[a[n]];t.defined(r)||console.log(a[n]),s=r(i,e,s)}}}catch(e){console.error(e)}return i.scale_x=1,i.scale_y=1,i}(e,n,r,o)}function f(e,n,r,o,i){const a=o.num_components()*i;let s;const u=[function(){},function(){s=new e.DracoInt8Array(a);n.GetAttributeInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt8Array(a);n.GetAttributeUInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt16Array(a);n.GetAttributeInt16ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int16Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt16Array(a);n.GetAttributeUInt16ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint16Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt32Array(a);n.GetAttributeInt32ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt32Array(a);n.GetAttributeUInt32ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){},function(){},function(){s=new e.DracoFloat32Array(a);n.GetAttributeFloatForAllPoints(r,o,s)||console.error("Bad stream");const t=new Float32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){},function(){s=new e.DracoUInt8Array(a);n.GetAttributeUInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t}],c=u[o.data_type()]();return t.defined(s)&&e.destroy(s),c}const l={position:function(e,t,n){const r=3*e.vertexCount;return e.positions=new Float32Array(t,n,r),n+=4*r},normal:function(e,t,n){const r=3*e.vertexCount;return e.normals=new Float32Array(t,n,r),n+=4*r},uv0:function(e,t,n){const r=2*e.vertexCount;return e.uv0s=new Float32Array(t,n,r),n+=4*r},color:function(e,t,n){const r=4*e.vertexCount;return e.colors=new Uint8Array(t,n,r),n+=r},featureId:function(e,t,n){return n+=8*e.featureCount},id:function(e,t,n){return n+=8*e.featureCount},faceRange:function(e,t,n){const r=2*e.featureCount;return e.faceRange=new Uint32Array(t,n,r),n+=4*r},uvRegion:function(e,t,n){const r=4*e.vertexCount;return e["uv-region"]=new Uint16Array(t,n,r),n+=2*r},region:function(e,t,n){const r=4*e.vertexCount;return e["uv-region"]=new Uint16Array(t,n,r),n+=2*r}};function d(e){const n=c(e.binaryData,e.schema,e.bufferInfo,e.featureData);t.defined(e.geoidDataList)&&e.geoidDataList.length>0&&function(e,t,n,r,i,a,s){if(s)return;const c=u(i.longitude,i.latitude,a);for(let s=0;s<e;++s){const e=u(i.longitude+o.CesiumMath.toRadians(n*t[3*s]),i.latitude+o.CesiumMath.toRadians(r*t[3*s+1]),a);t[3*s+2]+=e-c}}(n.vertexCount,n.positions,n.scale_x,n.scale_y,e.cartographicCenter,e.geoidDataList,!1),function(e,n,i,a,s,u,c,f,l){if(0===e||!t.defined(n)||0===n.length)return;const d=new r.Ellipsoid(Math.sqrt(c.x),Math.sqrt(c.y),Math.sqrt(c.z));for(let c=0;c<e;++c){const e=3*c,y=e+1,h=e+2,b=new r.Cartographic;b.longitude=a.longitude+o.CesiumMath.toRadians(f*n[e]),b.latitude=a.latitude+o.CesiumMath.toRadians(l*n[y]),b.height=a.height+n[h];const p={};d.cartographicToCartesian(b,p),p.x-=s.x,p.y-=s.y,p.z-=s.z;const g={};if(r.Matrix3.multiplyByVector(u,p,g),n[e]=g.x,n[y]=g.y,n[h]=g.z,t.defined(i)){const t=new r.Cartesian3(i[e],i[y],i[h]),n={};r.Matrix3.multiplyByVector(u,t,n),i[e]=n.x,i[y]=n.y,i[h]=n.z}}}(n.vertexCount,n.positions,n.normals,e.cartographicCenter,e.cartesianCenter,e.parentRotation,e.ellipsoidRadiiSquare,n.scale_x,n.scale_y),t.defined(n.uv0s)&&t.defined(n["uv-region"])&&function(e,t,n){for(let r=0;r<e;++r){const e=n[4*r]/65535,o=n[4*r+1]/65535,i=(n[4*r+2]-n[4*r])/65535,a=(n[4*r+3]-n[4*r+1])/65535;t[2*r]*=i,t[2*r]+=e,t[2*r+1]*=a,t[2*r+1]+=o}}(n.vertexCount,n.uv0s,n["uv-region"]);const i=function(e,n,r,o,i,a){if(0===e||!t.defined(r)||0===r.length)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};const s=[],u=[],c=[],f=[],l=[],d=[];t.defined(n)&&(e=n.length);const y=new Uint32Array(e);if(t.defined(n))for(let t=0;t<e;++t)y[t]=n[t];else for(let t=0;t<e;++t)y[t]=t;const h=new Blob([y],{type:"application/binary"}),b=URL.createObjectURL(h),p=e,g=r.subarray(0,3*p),m=new Blob([g],{type:"application/binary"}),A=URL.createObjectURL(m);let w=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let e=0;e<g.length/3;e++)w=Math.min(w,g[3*e+0]),I=Math.max(I,g[3*e+0]),C=Math.min(C,g[3*e+1]),x=Math.max(x,g[3*e+1]),L=Math.min(L,g[3*e+2]),R=Math.max(R,g[3*e+2]);const O=o?o.subarray(0,3*p):void 0;let _;if(t.defined(O)){const e=new Blob([O],{type:"application/binary"});_=URL.createObjectURL(e)}const v=i?i.subarray(0,2*p):void 0;let G;if(t.defined(v)){const e=new Blob([v],{type:"application/binary"});G=URL.createObjectURL(e)}const M=t.defined(a)?a.subarray(0,4*p):void 0;let U;if(t.defined(M)){const e=new Blob([M],{type:"application/binary"});U=URL.createObjectURL(e)}let V=0,D=0,N=0,T=0,E=0;const F={POSITION:0};return s.push({uri:A,byteLength:g.byteLength}),u.push({buffer:0,byteOffset:0,byteLength:g.byteLength,target:34962}),c.push({bufferView:0,byteOffset:0,componentType:5126,count:e,type:"VEC3",max:[w,C,L],min:[I,x,R]}),t.defined(_)&&(++E,V=E,F.NORMAL=V,s.push({uri:_,byteLength:O.byteLength}),u.push({buffer:V,byteOffset:0,byteLength:O.byteLength,target:34962}),c.push({bufferView:V,byteOffset:0,componentType:5126,count:e,type:"VEC3"})),t.defined(G)&&(++E,D=E,F.TEXCOORD_0=D,s.push({uri:G,byteLength:v.byteLength}),u.push({buffer:D,byteOffset:0,byteLength:v.byteLength,target:34962}),c.push({bufferView:D,byteOffset:0,componentType:5126,count:e,type:"VEC2"})),t.defined(U)&&(++E,N=E,F.COLOR_0=N,s.push({uri:U,byteLength:M.byteLength}),u.push({buffer:N,byteOffset:0,byteLength:M.byteLength,target:34962}),c.push({bufferView:N,byteOffset:0,componentType:5121,normalized:!0,count:e,type:"VEC4"})),++E,T=E,s.push({uri:b,byteLength:y.byteLength}),u.push({buffer:T,byteOffset:0,byteLength:y.byteLength,target:34963}),c.push({bufferView:T,byteOffset:0,componentType:5125,count:e,type:"SCALAR"}),f.push({primitives:[{attributes:F,indices:T,material:0}]}),d.push(0),l.push({mesh:0}),{buffers:s,bufferViews:u,accessors:c,meshes:f,nodes:l,nodesInScene:d}}(n.vertexCount,n.indices,n.positions,n.normals,n.uv0s,n.colors),a={};if(t.defined(n["feature-index"]))a.positions=n.positions,a.indices=n.indices,a.featureIndex=n["feature-index"],a.cartesianCenter=e.cartesianCenter,a.parentRotation=e.parentRotation;else if(t.defined(n.faceRange)){a.positions=n.positions,a.indices=n.indices,a.sourceURL=e.url,a.cartesianCenter=e.cartesianCenter,a.parentRotation=e.parentRotation,a.featureIndex=new Array(n.positions.length);for(let e=0;e<n.faceRange.length-1;e+=2){const t=e/2,r=n.faceRange[e],o=n.faceRange[e+1];for(let e=r;e<=o;e++)a.featureIndex[3*e]=t,a.featureIndex[3*e+1]=t,a.featureIndex[3*e+2]=t}}i._customAttributes=a;return{meshData:i}}function y(t){i=t,self.onmessage=e(d),self.postMessage(!0)}return function(e){const n=e.data.webAssemblyConfig;if(t.defined(n))return require([n.modulePath],(function(e){t.defined(n.wasmBinaryFile)?(t.defined(e)||(e=self.DracoDecoderModule),e(n).then((function(e){y(e)}))):y(e())}))}})); +define(["./createTaskProcessorWorker","./defaultValue-f6d5e6da","./WebMercatorProjection-db7467f4","./Matrix3-b2351961","./Math-355606c6"],(function(e,t,n,r,o){"use strict";let i;function a(e,t,n,r){return r[e+t*n]}function s(e,t,n){const r=n.nativeExtent;let o=(e-r.west)/(r.east-r.west)*(n.width-1),i=(t-r.south)/(r.north-r.south)*(n.height-1);const s=Math.floor(o);let u=Math.floor(i);o-=s,i-=u;const c=s<n.width?s+1:s;let f=u<n.height?u+1:u;u=n.height-1-u,f=n.height-1-f;let l=function(e,t,n,r,o,i){return(n*(1-e)+r*e)*(1-t)+(o*(1-e)+i*e)*t}(o,i,a(s,u,n.width,n.buffer),a(c,u,n.width,n.buffer),a(s,f,n.width,n.buffer),a(c,f,n.width,n.buffer));return l=l*n.scale+n.offset,l}function u(e,t,o){for(let i=0;i<o.length;i++){const a=o[i].nativeExtent;let u=new r.Cartesian3;if("WebMercator"===o[i].projectionType){const a=o[i].projection._ellipsoid._radii;u=new n.WebMercatorProjection(new r.Ellipsoid(a.x,a.y,a.z)).project(new r.Cartographic(e,t,0))}else u.x=e,u.y=t;if(u.x>a.west&&u.x<a.east&&u.y>a.south&&u.y<a.north)return s(u.x,u.y,o[i])}return 0}function c(e,n,r,o){const a=new Uint8Array(e,0,5);return a[0]==="D".charCodeAt()&&a[1]==="R".charCodeAt()&&a[2]==="A".charCodeAt()&&a[3]==="C".charCodeAt()&&a[4]==="O".charCodeAt()?function(e){const n=i,r=new n.DecoderBuffer,o=new Uint8Array(e);r.Init(o,o.length);const a=new n.Decoder,s=a.GetEncodedGeometryType(r),u=new n.MetadataQuerier;let c,l;s===n.TRIANGULAR_MESH&&(c=new n.Mesh,l=a.DecodeBufferToMesh(r,c));const d={vertexCount:[0],featureCount:0};if(t.defined(l)&&l.ok()&&0!==c.ptr){const e=c.num_faces(),r=c.num_attributes(),o=c.num_points();d.indices=new Uint32Array(3*e);const i=d.indices;d.vertexCount[0]=o,d.scale_x=1,d.scale_y=1;const s=new n.DracoInt32Array(3);for(let t=0;t<e;++t)a.GetFaceFromMesh(c,t,s),i[3*t]=s.GetValue(0),i[3*t+1]=s.GetValue(1),i[3*t+2]=s.GetValue(2);n.destroy(s);for(let e=0;e<r;++e){const r=a.GetAttribute(c,e),i=f(n,a,c,r,o),s=r.attribute_type();let l="unknown";s===n.POSITION?l="positions":s===n.NORMAL?l="normals":s===n.COLOR?l="colors":s===n.TEX_COORD&&(l="uv0s");const y=a.GetAttributeMetadata(c,e);if(0!==y.ptr){const e=u.NumEntries(y);for(let t=0;t<e;++t){const e=u.GetEntryName(y,t);"i3s-scale_x"===e?d.scale_x=u.GetDoubleEntry(y,"i3s-scale_x"):"i3s-scale_y"===e?d.scale_y=u.GetDoubleEntry(y,"i3s-scale_y"):"i3s-attribute-type"===e&&(l=u.GetStringEntry(y,"i3s-attribute-type"))}}t.defined(d[l])&&console.log("Attribute already exists",l),d[l]=i,"feature-index"===l&&d.featureCount++}n.destroy(c)}return n.destroy(u),n.destroy(a),d}(e):function(e,n,r,o){const i={vertexCount:0},a=new DataView(e);try{let s=0;if(i.vertexCount=a.getUint32(s,1),s+=4,i.featureCount=a.getUint32(s,1),s+=4,t.defined(r))for(let n=0;n<r.attributes.length;n++)t.defined(l[r.attributes[n]])?s=l[r.attributes[n]](i,e,s):console.error("Unknown decoder for",r.attributes[n]);else{let r=n.ordering,a=n.featureAttributeOrder;t.defined(o)&&t.defined(o.geometryData)&&t.defined(o.geometryData[0])&&t.defined(o.geometryData[0].params)&&(r=Object.keys(o.geometryData[0].params.vertexAttributes),a=Object.keys(o.geometryData[0].params.featureAttributes));for(let n=0;n<r.length;n++){const o=l[r[n]];t.defined(o)||console.log(r[n]),s=o(i,e,s)}for(let n=0;n<a.length;n++){const r=l[a[n]];t.defined(r)||console.log(a[n]),s=r(i,e,s)}}}catch(e){console.error(e)}return i.scale_x=1,i.scale_y=1,i}(e,n,r,o)}function f(e,n,r,o,i){const a=o.num_components()*i;let s;const u=[function(){},function(){s=new e.DracoInt8Array(a);n.GetAttributeInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt8Array(a);n.GetAttributeUInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt16Array(a);n.GetAttributeInt16ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int16Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt16Array(a);n.GetAttributeUInt16ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint16Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt32Array(a);n.GetAttributeInt32ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Int32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){s=new e.DracoInt32Array(a);n.GetAttributeUInt32ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){},function(){},function(){s=new e.DracoFloat32Array(a);n.GetAttributeFloatForAllPoints(r,o,s)||console.error("Bad stream");const t=new Float32Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t},function(){},function(){s=new e.DracoUInt8Array(a);n.GetAttributeUInt8ForAllPoints(r,o,s)||console.error("Bad stream");const t=new Uint8Array(a);for(let e=0;e<a;++e)t[e]=s.GetValue(e);return t}],c=u[o.data_type()]();return t.defined(s)&&e.destroy(s),c}const l={position:function(e,t,n){const r=3*e.vertexCount;return e.positions=new Float32Array(t,n,r),n+=4*r},normal:function(e,t,n){const r=3*e.vertexCount;return e.normals=new Float32Array(t,n,r),n+=4*r},uv0:function(e,t,n){const r=2*e.vertexCount;return e.uv0s=new Float32Array(t,n,r),n+=4*r},color:function(e,t,n){const r=4*e.vertexCount;return e.colors=new Uint8Array(t,n,r),n+=r},featureId:function(e,t,n){return n+=8*e.featureCount},id:function(e,t,n){return n+=8*e.featureCount},faceRange:function(e,t,n){const r=2*e.featureCount;return e.faceRange=new Uint32Array(t,n,r),n+=4*r},uvRegion:function(e,t,n){const r=4*e.vertexCount;return e["uv-region"]=new Uint16Array(t,n,r),n+=2*r},region:function(e,t,n){const r=4*e.vertexCount;return e["uv-region"]=new Uint16Array(t,n,r),n+=2*r}};function d(e){const n=c(e.binaryData,e.schema,e.bufferInfo,e.featureData);t.defined(e.geoidDataList)&&e.geoidDataList.length>0&&function(e,t,n,r,i,a,s){if(s)return;const c=u(i.longitude,i.latitude,a);for(let s=0;s<e;++s){const e=u(i.longitude+o.CesiumMath.toRadians(n*t[3*s]),i.latitude+o.CesiumMath.toRadians(r*t[3*s+1]),a);t[3*s+2]+=e-c}}(n.vertexCount,n.positions,n.scale_x,n.scale_y,e.cartographicCenter,e.geoidDataList,!1),function(e,n,i,a,s,u,c,f,l){if(0===e||!t.defined(n)||0===n.length)return;const d=new r.Ellipsoid(Math.sqrt(c.x),Math.sqrt(c.y),Math.sqrt(c.z));for(let c=0;c<e;++c){const e=3*c,y=e+1,h=e+2,b=new r.Cartographic;b.longitude=a.longitude+o.CesiumMath.toRadians(f*n[e]),b.latitude=a.latitude+o.CesiumMath.toRadians(l*n[y]),b.height=a.height+n[h];const p={};d.cartographicToCartesian(b,p),p.x-=s.x,p.y-=s.y,p.z-=s.z;const g={};if(r.Matrix3.multiplyByVector(u,p,g),n[e]=g.x,n[y]=g.y,n[h]=g.z,t.defined(i)){const t=new r.Cartesian3(i[e],i[y],i[h]),n={};r.Matrix3.multiplyByVector(u,t,n),i[e]=n.x,i[y]=n.y,i[h]=n.z}}}(n.vertexCount,n.positions,n.normals,e.cartographicCenter,e.cartesianCenter,e.parentRotation,e.ellipsoidRadiiSquare,n.scale_x,n.scale_y),t.defined(n.uv0s)&&t.defined(n["uv-region"])&&function(e,t,n){for(let r=0;r<e;++r){const e=n[4*r]/65535,o=n[4*r+1]/65535,i=(n[4*r+2]-n[4*r])/65535,a=(n[4*r+3]-n[4*r+1])/65535;t[2*r]*=i,t[2*r]+=e,t[2*r+1]*=a,t[2*r+1]+=o}}(n.vertexCount,n.uv0s,n["uv-region"]);const i=function(e,n,r,o,i,a){if(0===e||!t.defined(r)||0===r.length)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};const s=[],u=[],c=[],f=[],l=[],d=[];t.defined(n)&&(e=n.length);const y=new Uint32Array(e);if(t.defined(n))for(let t=0;t<e;++t)y[t]=n[t];else for(let t=0;t<e;++t)y[t]=t;const h=new Blob([y],{type:"application/binary"}),b=URL.createObjectURL(h),p=e,g=r.subarray(0,3*p),m=new Blob([g],{type:"application/binary"}),A=URL.createObjectURL(m);let w=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let e=0;e<g.length/3;e++)w=Math.min(w,g[3*e+0]),I=Math.max(I,g[3*e+0]),C=Math.min(C,g[3*e+1]),x=Math.max(x,g[3*e+1]),L=Math.min(L,g[3*e+2]),R=Math.max(R,g[3*e+2]);const O=o?o.subarray(0,3*p):void 0;let _;if(t.defined(O)){const e=new Blob([O],{type:"application/binary"});_=URL.createObjectURL(e)}const v=i?i.subarray(0,2*p):void 0;let G;if(t.defined(v)){const e=new Blob([v],{type:"application/binary"});G=URL.createObjectURL(e)}const M=t.defined(a)?a.subarray(0,4*p):void 0;let U;if(t.defined(M)){const e=new Blob([M],{type:"application/binary"});U=URL.createObjectURL(e)}let V=0,D=0,N=0,T=0,E=0;const F={POSITION:0};return s.push({uri:A,byteLength:g.byteLength}),u.push({buffer:0,byteOffset:0,byteLength:g.byteLength,target:34962}),c.push({bufferView:0,byteOffset:0,componentType:5126,count:e,type:"VEC3",max:[w,C,L],min:[I,x,R]}),t.defined(_)&&(++E,V=E,F.NORMAL=V,s.push({uri:_,byteLength:O.byteLength}),u.push({buffer:V,byteOffset:0,byteLength:O.byteLength,target:34962}),c.push({bufferView:V,byteOffset:0,componentType:5126,count:e,type:"VEC3"})),t.defined(G)&&(++E,D=E,F.TEXCOORD_0=D,s.push({uri:G,byteLength:v.byteLength}),u.push({buffer:D,byteOffset:0,byteLength:v.byteLength,target:34962}),c.push({bufferView:D,byteOffset:0,componentType:5126,count:e,type:"VEC2"})),t.defined(U)&&(++E,N=E,F.COLOR_0=N,s.push({uri:U,byteLength:M.byteLength}),u.push({buffer:N,byteOffset:0,byteLength:M.byteLength,target:34962}),c.push({bufferView:N,byteOffset:0,componentType:5121,normalized:!0,count:e,type:"VEC4"})),++E,T=E,s.push({uri:b,byteLength:y.byteLength}),u.push({buffer:T,byteOffset:0,byteLength:y.byteLength,target:34963}),c.push({bufferView:T,byteOffset:0,componentType:5125,count:e,type:"SCALAR"}),f.push({primitives:[{attributes:F,indices:T,material:0}]}),d.push(0),l.push({mesh:0}),{buffers:s,bufferViews:u,accessors:c,meshes:f,nodes:l,nodesInScene:d}}(n.vertexCount,n.indices,n.positions,n.normals,n.uv0s,n.colors),a={};if(t.defined(n["feature-index"]))a.positions=n.positions,a.indices=n.indices,a.featureIndex=n["feature-index"],a.cartesianCenter=e.cartesianCenter,a.parentRotation=e.parentRotation;else if(t.defined(n.faceRange)){a.positions=n.positions,a.indices=n.indices,a.sourceURL=e.url,a.cartesianCenter=e.cartesianCenter,a.parentRotation=e.parentRotation,a.featureIndex=new Array(n.positions.length);for(let e=0;e<n.faceRange.length-1;e+=2){const t=e/2,r=n.faceRange[e],o=n.faceRange[e+1];for(let e=r;e<=o;e++)a.featureIndex[3*e]=t,a.featureIndex[3*e+1]=t,a.featureIndex[3*e+2]=t}}i._customAttributes=a;return{meshData:i}}function y(t){i=t,self.onmessage=e(d),self.postMessage(!0)}return function(e){const n=e.data.webAssemblyConfig;if(t.defined(n))return require([n.modulePath],(function(e){t.defined(n.wasmBinaryFile)?(t.defined(e)||(e=self.DracoDecoderModule),e(n).then((function(e){y(e)}))):y(e())}))}})); diff --git a/public/lib/Cesium/Workers/package.js b/public/lib/Cesium/Workers/package.js index 5b6619a3..43b67a9f 100644 --- a/public/lib/Cesium/Workers/package.js +++ b/public/lib/Cesium/Workers/package.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/lib/Cesium/Workers/transferTypedArrayTest.js b/public/lib/Cesium/Workers/transferTypedArrayTest.js index cddc397f..deca1ebb 100644 --- a/public/lib/Cesium/Workers/transferTypedArrayTest.js +++ b/public/lib/Cesium/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/lib/Cesium/Workers/upsampleQuantizedTerrainMesh.js b/public/lib/Cesium/Workers/upsampleQuantizedTerrainMesh.js index c8afd295..aad7c556 100644 --- a/public/lib/Cesium/Workers/upsampleQuantizedTerrainMesh.js +++ b/public/lib/Cesium/Workers/upsampleQuantizedTerrainMesh.js @@ -1 +1 @@ -define(["./AttributeCompression-48e336db","./Transforms-b3716b06","./Matrix2-413c4048","./Matrix3-81054f0f","./defaultValue-f6d5e6da","./TerrainEncoding-5fbe99d6","./IndexDatatype-d3db4e7d","./Math-2ce22ee9","./OrientedBoundingBox-8446a826","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./combine-0c102d93","./RuntimeError-9b4ce3fb","./EllipsoidTangentPlane-cf43ca0f","./AxisAlignedBoundingBox-e7b79110","./IntersectionTests-56142431","./Plane-6add0ae1"],(function(e,t,n,i,s,r,h,o,u,p,d,l,a,f,c,g,m,x){"use strict";const w={clipTriangleAtAxisAlignedThreshold:function(e,t,n,i,r,h){let o,u,p;s.defined(h)?h.length=0:h=[],t?(o=n<e,u=i<e,p=r<e):(o=n>e,u=i>e,p=r>e);const d=o+u+p;let l,a,f,c,g,m;return 1===d?o?(l=(e-n)/(i-n),a=(e-n)/(r-n),h.push(1),h.push(2),1!==a&&(h.push(-1),h.push(0),h.push(2),h.push(a)),1!==l&&(h.push(-1),h.push(0),h.push(1),h.push(l))):u?(f=(e-i)/(r-i),c=(e-i)/(n-i),h.push(2),h.push(0),1!==c&&(h.push(-1),h.push(1),h.push(0),h.push(c)),1!==f&&(h.push(-1),h.push(1),h.push(2),h.push(f))):p&&(g=(e-r)/(n-r),m=(e-r)/(i-r),h.push(0),h.push(1),1!==m&&(h.push(-1),h.push(2),h.push(1),h.push(m)),1!==g&&(h.push(-1),h.push(2),h.push(0),h.push(g))):2===d?o||n===e?u||i===e?p||r===e||(a=(e-n)/(r-n),f=(e-i)/(r-i),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(a),h.push(-1),h.push(1),h.push(2),h.push(f)):(m=(e-r)/(i-r),l=(e-n)/(i-n),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(m),h.push(-1),h.push(0),h.push(1),h.push(l)):(c=(e-i)/(n-i),g=(e-r)/(n-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(c),h.push(-1),h.push(2),h.push(0),h.push(g)):3!==d&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,n,r,h,o,u,p,d){const l=n-u,a=u-h,f=o-p,c=r-p,g=1/(f*l+a*c),m=t-p,x=e-u,w=(f*x+a*m)*g,C=(-c*x+l*m)*g,y=1-w-C;return s.defined(d)?(d.x=w,d.y=C,d.z=y,d):new i.Cartesian3(w,C,y)},computeLineSegmentLineSegmentIntersection:function(e,t,i,r,h,o,u,p,d){const l=(p-o)*(i-e)-(u-h)*(r-t);if(0===l)return;const a=((u-h)*(t-o)-(p-o)*(e-h))/l,f=((i-e)*(t-o)-(r-t)*(e-h))/l;return a>=0&&a<=1&&f>=0&&f<=1?(s.defined(d)||(d=new n.Cartesian2),d.x=e+a*(i-e),d.y=t+a*(r-t),d):void 0}};var C=w;const y=32767,B=y/2|0,I=[],A=[],v=[],b=new i.Cartographic;let T=new i.Cartesian3;const M=[],z=[],V=[],N=[],E=[],R=new i.Cartesian3,H=new t.BoundingSphere,O=new u.OrientedBoundingBox,S=new n.Cartesian2,U=new i.Cartesian3;function F(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}F.prototype.clone=function(e){return s.defined(e)||(e=new F),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},F.prototype.initializeIndexed=function(e,t,n,i,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},F.prototype.initializeFromClipResult=function(e,t,n){let i=t+1;return-1!==e[t]?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[i]],++i,this.second=n[e[i]],++i,this.ratio=e[i],++i),i},F.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},F.prototype.isIndexed=function(){return s.defined(this.index)},F.prototype.getH=function(){return s.defined(this.index)?this.heightBuffer[this.index]:o.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},F.prototype.getU=function(){return s.defined(this.index)?this.uBuffer[this.index]:o.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},F.prototype.getV=function(){return s.defined(this.index)?this.vBuffer[this.index]:o.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};let P=new n.Cartesian2,D=-1;const W=[new i.Cartesian3,new i.Cartesian3],X=[new i.Cartesian3,new i.Cartesian3];function k(t,n){++D;let s=W[D],r=X[D];return s=e.AttributeCompression.octDecode(t.first.getNormalX(),t.first.getNormalY(),s),r=e.AttributeCompression.octDecode(t.second.getNormalX(),t.second.getNormalY(),r),T=i.Cartesian3.lerp(s,r,t.ratio,T),i.Cartesian3.normalize(T,T),e.AttributeCompression.octEncode(T,n),--D,n}F.prototype.getNormalX=function(){return s.defined(this.index)?this.normalBuffer[2*this.index]:(P=k(this,P),P.x)},F.prototype.getNormalY=function(){return s.defined(this.index)?this.normalBuffer[2*this.index+1]:(P=k(this,P),P.y)};const K=[];function L(e,t,n,i,r,h,o,u,p){if(0===o.length)return;let d=0,l=0;for(;l<o.length;)l=K[d++].initializeFromClipResult(o,l,u);for(let r=0;r<d;++r){const o=K[r];if(o.isIndexed())o.newIndex=h[o.index],o.uBuffer=e,o.vBuffer=t,o.heightBuffer=n,p&&(o.normalBuffer=i);else{const r=o.getKey();if(s.defined(h[r]))o.newIndex=h[r];else{const s=e.length;e.push(o.getU()),t.push(o.getV()),n.push(o.getH()),p&&(i.push(o.getNormalX()),i.push(o.getNormalY())),o.newIndex=s,h[r]=s}}}3===d?(r.push(K[0].newIndex),r.push(K[1].newIndex),r.push(K[2].newIndex)):4===d&&(r.push(K[0].newIndex),r.push(K[1].newIndex),r.push(K[2].newIndex),r.push(K[0].newIndex),r.push(K[2].newIndex),r.push(K[3].newIndex))}return K.push(new F),K.push(new F),K.push(new F),K.push(new F),p((function(e,s){const p=e.isEastChild,d=e.isNorthChild,l=p?B:0,a=p?y:B,f=d?B:0,c=d?y:B,g=M,m=z,x=V,w=E;g.length=0,m.length=0,x.length=0,w.length=0;const P=N;P.length=0;const D={},W=e.vertices;let X=e.indices;X=X.subarray(0,e.indexCountWithoutSkirts);const k=r.TerrainEncoding.clone(e.encoding),K=k.hasVertexNormals;let Y=0;const _=e.vertexCountWithoutSkirts,G=e.minimumHeight,J=e.maximumHeight,Z=new Array(_),j=new Array(_),q=new Array(_),Q=K?new Array(2*_):void 0;let $,ee,te,ne,ie;for(ee=0,te=0;ee<_;++ee,te+=2){const e=k.decodeTextureCoordinates(W,ee,S);if($=k.decodeHeight(W,ee),ne=o.CesiumMath.clamp(e.x*y|0,0,y),ie=o.CesiumMath.clamp(e.y*y|0,0,y),q[ee]=o.CesiumMath.clamp(($-G)/(J-G)*y|0,0,y),ne<20&&(ne=0),ie<20&&(ie=0),y-ne<20&&(ne=y),y-ie<20&&(ie=y),Z[ee]=ne,j[ee]=ie,K){const e=k.getOctEncodedNormal(W,ee,U);Q[te]=e.x,Q[te+1]=e.y}(p&&ne>=B||!p&&ne<=B)&&(d&&ie>=B||!d&&ie<=B)&&(D[ee]=Y,g.push(ne),m.push(ie),x.push(q[ee]),K&&(w.push(Q[te]),w.push(Q[te+1])),++Y)}const se=[];se.push(new F),se.push(new F),se.push(new F);const re=[];let he,oe;for(re.push(new F),re.push(new F),re.push(new F),ee=0;ee<X.length;ee+=3){const e=X[ee],t=X[ee+1],n=X[ee+2],i=Z[e],s=Z[t],r=Z[n];se[0].initializeIndexed(Z,j,q,Q,e),se[1].initializeIndexed(Z,j,q,Q,t),se[2].initializeIndexed(Z,j,q,Q,n);const h=C.clipTriangleAtAxisAlignedThreshold(B,p,i,s,r,I);he=0,he>=h.length||(he=re[0].initializeFromClipResult(h,he,se),he>=h.length||(he=re[1].initializeFromClipResult(h,he,se),he>=h.length||(he=re[2].initializeFromClipResult(h,he,se),oe=C.clipTriangleAtAxisAlignedThreshold(B,d,re[0].getV(),re[1].getV(),re[2].getV(),A),L(g,m,x,w,P,D,oe,re,K),he<h.length&&(re[2].clone(re[1]),re[2].initializeFromClipResult(h,he,se),oe=C.clipTriangleAtAxisAlignedThreshold(B,d,re[0].getV(),re[1].getV(),re[2].getV(),A),L(g,m,x,w,P,D,oe,re,K)))))}const ue=p?-y:0,pe=d?-y:0,de=[],le=[],ae=[],fe=[];let ce=Number.MAX_VALUE,ge=-ce;const me=v;me.length=0;const xe=i.Ellipsoid.clone(e.ellipsoid),we=n.Rectangle.clone(e.childRectangle),Ce=we.north,ye=we.south;let Be=we.east;const Ie=we.west;for(Be<Ie&&(Be+=o.CesiumMath.TWO_PI),ee=0;ee<g.length;++ee)ne=Math.round(g[ee]),ne<=l?(de.push(ee),ne=0):ne>=a?(ae.push(ee),ne=y):ne=2*ne+ue,g[ee]=ne,ie=Math.round(m[ee]),ie<=f?(le.push(ee),ie=0):ie>=c?(fe.push(ee),ie=y):ie=2*ie+pe,m[ee]=ie,$=o.CesiumMath.lerp(G,J,x[ee]/y),$<ce&&(ce=$),$>ge&&(ge=$),x[ee]=$,b.longitude=o.CesiumMath.lerp(Ie,Be,ne/y),b.latitude=o.CesiumMath.lerp(ye,Ce,ie/y),b.height=$,xe.cartographicToCartesian(b,T),me.push(T.x),me.push(T.y),me.push(T.z);const Ae=t.BoundingSphere.fromVertices(me,i.Cartesian3.ZERO,3,H),ve=u.OrientedBoundingBox.fromRectangle(we,ce,ge,xe,O),be=new r.EllipsoidalOccluder(xe).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(Ae.center,me,3,Ae.center,ce,R),Te=ge-ce,Me=new Uint16Array(g.length+m.length+x.length);for(ee=0;ee<g.length;++ee)Me[ee]=g[ee];let ze=g.length;for(ee=0;ee<m.length;++ee)Me[ze+ee]=m[ee];for(ze+=m.length,ee=0;ee<x.length;++ee)Me[ze+ee]=y*(x[ee]-ce)/Te;const Ve=h.IndexDatatype.createTypedArray(g.length,P);let Ne;if(K){const e=new Uint8Array(w);s.push(Me.buffer,Ve.buffer,e.buffer),Ne=e.buffer}else s.push(Me.buffer,Ve.buffer);return{vertices:Me.buffer,encodedNormals:Ne,indices:Ve.buffer,minimumHeight:ce,maximumHeight:ge,westIndices:de,southIndices:le,eastIndices:ae,northIndices:fe,boundingSphere:Ae,orientedBoundingBox:ve,horizonOcclusionPoint:be}}))})); +define(["./AttributeCompression-0b8f7b7d","./Transforms-f17097e5","./Matrix2-7a8e9daf","./Matrix3-b2351961","./defaultValue-f6d5e6da","./TerrainEncoding-c5a10c4f","./IndexDatatype-a9b1bc18","./Math-355606c6","./OrientedBoundingBox-c083edd8","./createTaskProcessorWorker","./ComponentDatatype-ab629b88","./WebGLConstants-7f557f93","./combine-0c102d93","./RuntimeError-9b4ce3fb","./EllipsoidTangentPlane-c3e9d965","./AxisAlignedBoundingBox-04c1a5e3","./IntersectionTests-f1b36d69","./Plane-5931b53e"],(function(e,t,n,i,s,r,h,o,u,p,d,l,a,f,c,g,m,x){"use strict";const w={clipTriangleAtAxisAlignedThreshold:function(e,t,n,i,r,h){let o,u,p;s.defined(h)?h.length=0:h=[],t?(o=n<e,u=i<e,p=r<e):(o=n>e,u=i>e,p=r>e);const d=o+u+p;let l,a,f,c,g,m;return 1===d?o?(l=(e-n)/(i-n),a=(e-n)/(r-n),h.push(1),h.push(2),1!==a&&(h.push(-1),h.push(0),h.push(2),h.push(a)),1!==l&&(h.push(-1),h.push(0),h.push(1),h.push(l))):u?(f=(e-i)/(r-i),c=(e-i)/(n-i),h.push(2),h.push(0),1!==c&&(h.push(-1),h.push(1),h.push(0),h.push(c)),1!==f&&(h.push(-1),h.push(1),h.push(2),h.push(f))):p&&(g=(e-r)/(n-r),m=(e-r)/(i-r),h.push(0),h.push(1),1!==m&&(h.push(-1),h.push(2),h.push(1),h.push(m)),1!==g&&(h.push(-1),h.push(2),h.push(0),h.push(g))):2===d?o||n===e?u||i===e?p||r===e||(a=(e-n)/(r-n),f=(e-i)/(r-i),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(a),h.push(-1),h.push(1),h.push(2),h.push(f)):(m=(e-r)/(i-r),l=(e-n)/(i-n),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(m),h.push(-1),h.push(0),h.push(1),h.push(l)):(c=(e-i)/(n-i),g=(e-r)/(n-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(c),h.push(-1),h.push(2),h.push(0),h.push(g)):3!==d&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,n,r,h,o,u,p,d){const l=n-u,a=u-h,f=o-p,c=r-p,g=1/(f*l+a*c),m=t-p,x=e-u,w=(f*x+a*m)*g,C=(-c*x+l*m)*g,y=1-w-C;return s.defined(d)?(d.x=w,d.y=C,d.z=y,d):new i.Cartesian3(w,C,y)},computeLineSegmentLineSegmentIntersection:function(e,t,i,r,h,o,u,p,d){const l=(p-o)*(i-e)-(u-h)*(r-t);if(0===l)return;const a=((u-h)*(t-o)-(p-o)*(e-h))/l,f=((i-e)*(t-o)-(r-t)*(e-h))/l;return a>=0&&a<=1&&f>=0&&f<=1?(s.defined(d)||(d=new n.Cartesian2),d.x=e+a*(i-e),d.y=t+a*(r-t),d):void 0}};var C=w;const y=32767,B=16383,I=[],A=[],v=[],b=new i.Cartographic;let T=new i.Cartesian3;const M=[],z=[],V=[],N=[],E=[],R=new i.Cartesian3,H=new t.BoundingSphere,O=new u.OrientedBoundingBox,S=new n.Cartesian2,U=new i.Cartesian3;function F(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}F.prototype.clone=function(e){return s.defined(e)||(e=new F),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},F.prototype.initializeIndexed=function(e,t,n,i,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},F.prototype.initializeFromClipResult=function(e,t,n){let i=t+1;return-1!==e[t]?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[i]],++i,this.second=n[e[i]],++i,this.ratio=e[i],++i),i},F.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},F.prototype.isIndexed=function(){return s.defined(this.index)},F.prototype.getH=function(){return s.defined(this.index)?this.heightBuffer[this.index]:o.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},F.prototype.getU=function(){return s.defined(this.index)?this.uBuffer[this.index]:o.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},F.prototype.getV=function(){return s.defined(this.index)?this.vBuffer[this.index]:o.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};let P=new n.Cartesian2,D=-1;const W=[new i.Cartesian3,new i.Cartesian3],X=[new i.Cartesian3,new i.Cartesian3];function k(t,n){++D;let s=W[D],r=X[D];return s=e.AttributeCompression.octDecode(t.first.getNormalX(),t.first.getNormalY(),s),r=e.AttributeCompression.octDecode(t.second.getNormalX(),t.second.getNormalY(),r),T=i.Cartesian3.lerp(s,r,t.ratio,T),i.Cartesian3.normalize(T,T),e.AttributeCompression.octEncode(T,n),--D,n}F.prototype.getNormalX=function(){return s.defined(this.index)?this.normalBuffer[2*this.index]:(P=k(this,P),P.x)},F.prototype.getNormalY=function(){return s.defined(this.index)?this.normalBuffer[2*this.index+1]:(P=k(this,P),P.y)};const K=[];function L(e,t,n,i,r,h,o,u,p){if(0===o.length)return;let d=0,l=0;for(;l<o.length;)l=K[d++].initializeFromClipResult(o,l,u);for(let r=0;r<d;++r){const o=K[r];if(o.isIndexed())o.newIndex=h[o.index],o.uBuffer=e,o.vBuffer=t,o.heightBuffer=n,p&&(o.normalBuffer=i);else{const r=o.getKey();if(s.defined(h[r]))o.newIndex=h[r];else{const s=e.length;e.push(o.getU()),t.push(o.getV()),n.push(o.getH()),p&&(i.push(o.getNormalX()),i.push(o.getNormalY())),o.newIndex=s,h[r]=s}}}3===d?(r.push(K[0].newIndex),r.push(K[1].newIndex),r.push(K[2].newIndex)):4===d&&(r.push(K[0].newIndex),r.push(K[1].newIndex),r.push(K[2].newIndex),r.push(K[0].newIndex),r.push(K[2].newIndex),r.push(K[3].newIndex))}return K.push(new F),K.push(new F),K.push(new F),K.push(new F),p((function(e,s){const p=e.isEastChild,d=e.isNorthChild,l=p?B:0,a=p?y:B,f=d?B:0,c=d?y:B,g=M,m=z,x=V,w=E;g.length=0,m.length=0,x.length=0,w.length=0;const P=N;P.length=0;const D={},W=e.vertices;let X=e.indices;X=X.subarray(0,e.indexCountWithoutSkirts);const k=r.TerrainEncoding.clone(e.encoding),K=k.hasVertexNormals;let Y=0;const _=e.vertexCountWithoutSkirts,G=e.minimumHeight,J=e.maximumHeight,Z=new Array(_),j=new Array(_),q=new Array(_),Q=K?new Array(2*_):void 0;let $,ee,te,ne,ie;for(ee=0,te=0;ee<_;++ee,te+=2){const e=k.decodeTextureCoordinates(W,ee,S);if($=k.decodeHeight(W,ee),ne=o.CesiumMath.clamp(e.x*y|0,0,y),ie=o.CesiumMath.clamp(e.y*y|0,0,y),q[ee]=o.CesiumMath.clamp(($-G)/(J-G)*y|0,0,y),ne<20&&(ne=0),ie<20&&(ie=0),y-ne<20&&(ne=y),y-ie<20&&(ie=y),Z[ee]=ne,j[ee]=ie,K){const e=k.getOctEncodedNormal(W,ee,U);Q[te]=e.x,Q[te+1]=e.y}(p&&ne>=B||!p&&ne<=B)&&(d&&ie>=B||!d&&ie<=B)&&(D[ee]=Y,g.push(ne),m.push(ie),x.push(q[ee]),K&&(w.push(Q[te]),w.push(Q[te+1])),++Y)}const se=[];se.push(new F),se.push(new F),se.push(new F);const re=[];let he,oe;for(re.push(new F),re.push(new F),re.push(new F),ee=0;ee<X.length;ee+=3){const e=X[ee],t=X[ee+1],n=X[ee+2],i=Z[e],s=Z[t],r=Z[n];se[0].initializeIndexed(Z,j,q,Q,e),se[1].initializeIndexed(Z,j,q,Q,t),se[2].initializeIndexed(Z,j,q,Q,n);const h=C.clipTriangleAtAxisAlignedThreshold(B,p,i,s,r,I);he=0,he>=h.length||(he=re[0].initializeFromClipResult(h,he,se),he>=h.length||(he=re[1].initializeFromClipResult(h,he,se),he>=h.length||(he=re[2].initializeFromClipResult(h,he,se),oe=C.clipTriangleAtAxisAlignedThreshold(B,d,re[0].getV(),re[1].getV(),re[2].getV(),A),L(g,m,x,w,P,D,oe,re,K),he<h.length&&(re[2].clone(re[1]),re[2].initializeFromClipResult(h,he,se),oe=C.clipTriangleAtAxisAlignedThreshold(B,d,re[0].getV(),re[1].getV(),re[2].getV(),A),L(g,m,x,w,P,D,oe,re,K)))))}const ue=p?-32767:0,pe=d?-32767:0,de=[],le=[],ae=[],fe=[];let ce=Number.MAX_VALUE,ge=-ce;const me=v;me.length=0;const xe=i.Ellipsoid.clone(e.ellipsoid),we=n.Rectangle.clone(e.childRectangle),Ce=we.north,ye=we.south;let Be=we.east;const Ie=we.west;for(Be<Ie&&(Be+=o.CesiumMath.TWO_PI),ee=0;ee<g.length;++ee)ne=Math.round(g[ee]),ne<=l?(de.push(ee),ne=0):ne>=a?(ae.push(ee),ne=y):ne=2*ne+ue,g[ee]=ne,ie=Math.round(m[ee]),ie<=f?(le.push(ee),ie=0):ie>=c?(fe.push(ee),ie=y):ie=2*ie+pe,m[ee]=ie,$=o.CesiumMath.lerp(G,J,x[ee]/y),$<ce&&(ce=$),$>ge&&(ge=$),x[ee]=$,b.longitude=o.CesiumMath.lerp(Ie,Be,ne/y),b.latitude=o.CesiumMath.lerp(ye,Ce,ie/y),b.height=$,xe.cartographicToCartesian(b,T),me.push(T.x),me.push(T.y),me.push(T.z);const Ae=t.BoundingSphere.fromVertices(me,i.Cartesian3.ZERO,3,H),ve=u.OrientedBoundingBox.fromRectangle(we,ce,ge,xe,O),be=new r.EllipsoidalOccluder(xe).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(Ae.center,me,3,Ae.center,ce,R),Te=ge-ce,Me=new Uint16Array(g.length+m.length+x.length);for(ee=0;ee<g.length;++ee)Me[ee]=g[ee];let ze=g.length;for(ee=0;ee<m.length;++ee)Me[ze+ee]=m[ee];for(ze+=m.length,ee=0;ee<x.length;++ee)Me[ze+ee]=y*(x[ee]-ce)/Te;const Ve=h.IndexDatatype.createTypedArray(g.length,P);let Ne;if(K){const e=new Uint8Array(w);s.push(Me.buffer,Ve.buffer,e.buffer),Ne=e.buffer}else s.push(Me.buffer,Ve.buffer);return{vertices:Me.buffer,encodedNormals:Ne,indices:Ve.buffer,minimumHeight:ce,maximumHeight:ge,westIndices:de,southIndices:le,eastIndices:ae,northIndices:fe,boundingSphere:Ae,orientedBoundingBox:ve,horizonOcclusionPoint:be}}))})); diff --git a/public/lib/Cesium/index.cjs b/public/lib/Cesium/index.cjs index 0cf59c87..c32fc148 100644 --- a/public/lib/Cesium/index.cjs +++ b/public/lib/Cesium/index.cjs @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * @@ -23,11 +23,11 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Kxe=Object.create;var g3=Object.defineProperty;var Jxe=Object.getOwnPropertyDescriptor;var Zxe=Object.getOwnPropertyNames;var Qxe=Object.getPrototypeOf,$xe=Object.prototype.hasOwnProperty;var eCe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uJ=(e,t)=>{for(var n in t)g3(e,n,{get:t[n],enumerable:!0})},fJ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zxe(t))!$xe.call(e,r)&&r!==n&&g3(e,r,{get:()=>t[r],enumerable:!(i=Jxe(t,r))||i.enumerable});return e};var Ki=(e,t,n)=>(n=e!=null?Kxe(Qxe(e)):{},fJ(t||!e||!e.__esModule?g3(n,"default",{value:e,enumerable:!0}):n,e)),Dm=e=>fJ(g3({},"__esModule",{value:!0}),e);var y3=Jn((wxt,mJ)=>{var qh=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};qh.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};qh.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};qh.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};qh.prototype.random_int31=function(){return this.random_int()>>>1};qh.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};qh.prototype.random=function(){return this.random_int()*(1/4294967296)};qh.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};qh.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};mJ.exports=qh});var MZ=Jn((tT,nT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof tT=="object"&&tT&&!tT.nodeType&&tT,n=typeof nT=="object"&&nT&&!nT.nodeType&&nT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,l=38,f=700,d=72,p=128,g="-",h=/^xn--/,A=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,E=Math.floor,S=String.fromCharCode,w;function D(V){throw new RangeError(C[V])}function M(V,G){for(var U=V.length,Y=[];U--;)Y[U]=G(V[U]);return Y}function O(V,G){var U=V.split("@"),Y="";U.length>1&&(Y=U[0]+"@",V=U[1]),V=V.replace(x,".");var W=V.split("."),J=M(W,G).join(".");return Y+J}function B(V){for(var G=[],U=0,Y=V.length,W,J;U<Y;)W=V.charCodeAt(U++),W>=55296&&W<=56319&&U<Y?(J=V.charCodeAt(U++),(J&64512)==56320?G.push(((W&1023)<<10)+(J&1023)+65536):(G.push(W),U--)):G.push(W);return G}function L(V){return M(V,function(G){var U="";return G>65535&&(G-=65536,U+=S(G>>>10&1023|55296),G=56320|G&1023),U+=S(G),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function b(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function v(V,G,U){var Y=0;for(V=U?E(V/f):V>>1,V+=E(V/G);V>T*c>>1;Y+=s)V=E(V/T);return E(Y+(T+1)*V/(V+l))}function I(V){var G=[],U=V.length,Y,W=0,J=p,j=d,K,Z,me,ye,se,pe,Ae,De,Ce;for(K=V.lastIndexOf(g),K<0&&(K=0),Z=0;Z<K;++Z)V.charCodeAt(Z)>=128&&D("not-basic"),G.push(V.charCodeAt(Z));for(me=K>0?K+1:0;me<U;){for(ye=W,se=1,pe=s;me>=U&&D("invalid-input"),Ae=_(V.charCodeAt(me++)),(Ae>=s||Ae>E((o-W)/se))&&D("overflow"),W+=Ae*se,De=pe<=j?a:pe>=j+c?c:pe-j,!(Ae<De);pe+=s)Ce=s-De,se>E(o/Ce)&&D("overflow"),se*=Ce;Y=G.length+1,j=v(W-ye,Y,ye==0),E(W/Y)>o-J&&D("overflow"),J+=E(W/Y),W%=Y,G.splice(W++,0,J)}return L(G)}function R(V){var G,U,Y,W,J,j,K,Z,me,ye,se,pe=[],Ae,De,Ce,Re;for(V=B(V),Ae=V.length,G=p,U=0,J=d,j=0;j<Ae;++j)se=V[j],se<128&&pe.push(S(se));for(Y=W=pe.length,W&&pe.push(g);Y<Ae;){for(K=o,j=0;j<Ae;++j)se=V[j],se>=G&&se<K&&(K=se);for(De=Y+1,K-G>E((o-U)/De)&&D("overflow"),U+=(K-G)*De,G=K,j=0;j<Ae;++j)if(se=V[j],se<G&&++U>o&&D("overflow"),se==G){for(Z=U,me=s;ye=me<=J?a:me>=J+c?c:me-J,!(Z<ye);me+=s)Re=Z-ye,Ce=s-ye,pe.push(S(b(ye+Re%Ce,0))),Z=E(Re/Ce);pe.push(S(b(Z,0))),J=v(U,De,Y==W),U=0,++Y}++U,++G}return pe.join("")}function F(V){return O(V,function(G){return h.test(G)?I(G.slice(4).toLowerCase()):G})}function k(V){return O(V,function(G){return A.test(G)?"xn--"+R(G):G})}if(r={version:"1.3.2",ucs2:{decode:B,encode:L},decode:I,encode:R,toASCII:k,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(nT.exports==t)n.exports=r;else for(w in r)r.hasOwnProperty(w)&&(t[w]=r[w]);else e.punycode=r})(tT)});var BZ=Jn((RZ,j3)=>{/*! +var RCe=Object.create;var A3=Object.defineProperty;var OCe=Object.getOwnPropertyDescriptor;var MCe=Object.getOwnPropertyNames;var LCe=Object.getPrototypeOf,NCe=Object.prototype.hasOwnProperty;var FCe=(e,t)=>()=>(e&&(t=e(e=0)),t);var $n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bJ=(e,t)=>{for(var n in t)A3(e,n,{get:t[n],enumerable:!0})},CJ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of MCe(t))!NCe.call(e,r)&&r!==n&&A3(e,r,{get:()=>t[r],enumerable:!(i=OCe(t,r))||i.enumerable});return e};var Ki=(e,t,n)=>(n=e!=null?RCe(LCe(e)):{},CJ(t||!e||!e.__esModule?A3(n,"default",{value:e,enumerable:!0}):n,e)),Pm=e=>CJ(A3({},"__esModule",{value:!0}),e);var E3=$n((lCt,AJ)=>{var Yh=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Yh.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Yh.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Yh.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Yh.prototype.random_int31=function(){return this.random_int()>>>1};Yh.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Yh.prototype.random=function(){return this.random_int()*(1/4294967296)};Yh.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Yh.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};AJ.exports=Yh});var rZ=$n((rT,oT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof rT=="object"&&rT&&!rT.nodeType&&rT,n=typeof oT=="object"&&oT&&!oT.nodeType&&oT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",h=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=s-a,T=Math.floor,S=String.fromCharCode,v;function I(U){throw new RangeError(C[U])}function O(U,G){for(var k=U.length,Y=[];k--;)Y[k]=G(U[k]);return Y}function R(U,G){var k=U.split("@"),Y="";k.length>1&&(Y=k[0]+"@",U=k[1]),U=U.replace(b,".");var j=U.split("."),J=O(j,G).join(".");return Y+J}function L(U){for(var G=[],k=0,Y=U.length,j,J;k<Y;)j=U.charCodeAt(k++),j>=55296&&j<=56319&&k<Y?(J=U.charCodeAt(k++),(J&64512)==56320?G.push(((j&1023)<<10)+(J&1023)+65536):(G.push(j),k--)):G.push(j);return G}function N(U){return O(U,function(G){var k="";return G>65535&&(G-=65536,k+=S(G>>>10&1023|55296),G=56320|G&1023),k+=S(G),k}).join("")}function _(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function E(U,G){return U+22+75*(U<26)-((G!=0)<<5)}function w(U,G,k){var Y=0;for(U=k?T(U/f):U>>1,U+=T(U/G);U>A*c>>1;Y+=s)U=T(U/A);return T(Y+(A+1)*U/(U+u))}function P(U){var G=[],k=U.length,Y,j=0,J=p,W=d,K,Z,he,ge,se,pe,xe,Pe,we;for(K=U.lastIndexOf(g),K<0&&(K=0),Z=0;Z<K;++Z)U.charCodeAt(Z)>=128&&I("not-basic"),G.push(U.charCodeAt(Z));for(he=K>0?K+1:0;he<k;){for(ge=j,se=1,pe=s;he>=k&&I("invalid-input"),xe=_(U.charCodeAt(he++)),(xe>=s||xe>T((o-j)/se))&&I("overflow"),j+=xe*se,Pe=pe<=W?a:pe>=W+c?c:pe-W,!(xe<Pe);pe+=s)we=s-Pe,se>T(o/we)&&I("overflow"),se*=we;Y=G.length+1,W=w(j-ge,Y,ge==0),T(j/Y)>o-J&&I("overflow"),J+=T(j/Y),j%=Y,G.splice(j++,0,J)}return N(G)}function M(U){var G,k,Y,j,J,W,K,Z,he,ge,se,pe=[],xe,Pe,we,Se;for(U=L(U),xe=U.length,G=p,k=0,J=d,W=0;W<xe;++W)se=U[W],se<128&&pe.push(S(se));for(Y=j=pe.length,j&&pe.push(g);Y<xe;){for(K=o,W=0;W<xe;++W)se=U[W],se>=G&&se<K&&(K=se);for(Pe=Y+1,K-G>T((o-k)/Pe)&&I("overflow"),k+=(K-G)*Pe,G=K,W=0;W<xe;++W)if(se=U[W],se<G&&++k>o&&I("overflow"),se==G){for(Z=k,he=s;ge=he<=J?a:he>=J+c?c:he-J,!(Z<ge);he+=s)Se=Z-ge,we=s-ge,pe.push(S(E(ge+Se%we,0))),Z=T(Se/we);pe.push(S(E(Z,0))),J=w(k,Pe,Y==j),k=0,++Y}++k,++G}return pe.join("")}function B(U){return R(U,function(G){return h.test(G)?P(G.slice(4).toLowerCase()):G})}function V(U){return R(U,function(G){return x.test(G)?"xn--"+M(G):G})}if(r={version:"1.3.2",ucs2:{decode:L,encode:N},decode:P,encode:M,toASCII:V,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(oT.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(rT)});var sZ=$n((oZ,j3)=>{/*! * URI.js - Mutating URLs * IPv6 Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -35,11 +35,11 @@ var Kxe=Object.create;var g3=Object.defineProperty;var Jxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof j3=="object"&&j3.exports?j3.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(RZ,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var l;for(l=0;l<a&&s[l]!=="";l++);if(l<c)for(s.splice(l,1,"0000");s.length<c;)s.splice(l,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,A=0,x=-1,C=!1;for(d=0;d<c;d++)C?s[d]==="0"?A+=1:(C=!1,A>h&&(g=x,h=A)):s[d]==="0"&&(C=!0,x=d,A=1);A>h&&(g=x,h=A),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d<a&&(T+=s[d],d!==a-1);d++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var NZ=Jn((LZ,q3)=>{/*! + */(function(e,t){"use strict";typeof j3=="object"&&j3.exports?j3.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(oZ,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,x=0,b=-1,C=!1;for(d=0;d<c;d++)C?s[d]==="0"?x+=1:(C=!1,x>h&&(g=b,h=x)):s[d]==="0"&&(C=!0,b=d,x=1);x>h&&(g=b,h=x),h>1&&s.splice(g,h,""),a=s.length;var A="";for(s[0]===""&&(A=":"),d=0;d<a&&(A+=s[d],d!==a-1);d++)A+=":";return s[a-1]===""&&(A+=":"),A}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var cZ=$n((aZ,q3)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -47,10 +47,10 @@ var Kxe=Object.create;var g3=Object.defineProperty;var Jxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof q3=="object"&&q3.exports?q3.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(LZ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Yl=Jn((FZ,Y3)=>{/*! + */(function(e,t){"use strict";typeof q3=="object"&&q3.exports?q3.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(aZ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Xl=$n((lZ,Y3)=>{/*! * URI.js - Mutating URLs * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -58,8465 +58,7601 @@ var Kxe=Object.create;var g3=Object.defineProperty;var Jxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof Y3=="object"&&Y3.exports?Y3.exports=t(MZ(),BZ(),NZ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(FZ,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(b,v){var I=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof o))return I?R?new o(b,v):new o(b):new o;if(b===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(b),v!==void 0?this.absoluteTo(v):this}function s(b){return/^[0-9]+$/.test(b)}o.version="1.19.10";var a=o.prototype,c=Object.prototype.hasOwnProperty;function l(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function d(b){return f(b)==="Array"}function p(b,v){var I={},R,F;if(f(v)==="RegExp")I=null;else if(d(v))for(R=0,F=v.length;R<F;R++)I[v[R]]=!0;else I[v]=!0;for(R=0,F=b.length;R<F;R++){var k=I&&I[b[R]]!==void 0||!I&&v.test(b[R]);k&&(b.splice(R,1),F--,R--)}return b}function g(b,v){var I,R;if(d(v)){for(I=0,R=v.length;I<R;I++)if(!g(b,v[I]))return!1;return!0}var F=f(v);for(I=0,R=b.length;I<R;I++)if(F==="RegExp"){if(typeof b[I]=="string"&&b[I].match(v))return!0}else if(b[I]===v)return!0;return!1}function h(b,v){if(!d(b)||!d(v)||b.length!==v.length)return!1;b.sort(),v.sort();for(var I=0,R=b.length;I<R;I++)if(b[I]!==v[I])return!1;return!0}function A(b){var v=/^\/+|\/+$/g;return b.replace(v,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(b){if(!(!b||!b.nodeName)){var v=b.nodeName.toLowerCase();if(!(v==="input"&&b.type!=="image"))return o.domAttributes[v]}};function x(b){return escape(b)}function C(b){return encodeURIComponent(b).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}o.encode=C,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=C,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(b,v){var I=o.encode(b+"");return v===void 0&&(v=o.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},o.decodeQuery=function(b,v){b+="",v===void 0&&(v=o.escapeQuerySpace);try{return o.decode(v?b.replace(/\+/g,"%20"):b)}catch{return b}};var T={encode:"encode",decode:"decode"},E,S=function(b,v){return function(I){try{return o[v](I+"").replace(o.characters[b][v].expression,function(R){return o.characters[b][v].map[R]})}catch{return I}}};for(E in T)o[E+"PathSegment"]=S("pathname",T[E]),o[E+"UrnPathSegment"]=S("urnpath",T[E]);var w=function(b,v,I){return function(R){var F;I?F=function(U){return o[v](o[I](U))}:F=o[v];for(var k=(R+"").split(b),V=0,G=k.length;V<G;V++)k[V]=F(k[V]);return k.join(b)}};o.decodePath=w("/","decodePathSegment"),o.decodeUrnPath=w(":","decodeUrnPathSegment"),o.recodePath=w("/","encodePathSegment","decode"),o.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),o.encodeReserved=S("reserved","encode"),o.parse=function(b,v){var I;return v||(v={preventInvalidHostname:o.preventInvalidHostname}),b=b.replace(o.leading_whitespace_expression,""),I=b.indexOf("#"),I>-1&&(v.fragment=b.substring(I+1)||null,b=b.substring(0,I)),I=b.indexOf("?"),I>-1&&(v.query=b.substring(I+1)||null,b=b.substring(0,I)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b.substring(0,2)==="//"?(v.protocol=null,b=b.substring(2),b=o.parseAuthority(b,v)):(I=b.indexOf(":"),I>-1&&(v.protocol=b.substring(0,I)||null,v.protocol&&!v.protocol.match(o.protocol_expression)?v.protocol=void 0:b.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(b=b.substring(I+3),b=o.parseAuthority(b,v)):(b=b.substring(I+1),v.urn=!0))),v.path=b,v},o.parseHost=function(b,v){b||(b=""),b=b.replace(/\\/g,"/");var I=b.indexOf("/"),R,F;if(I===-1&&(I=b.length),b.charAt(0)==="[")R=b.indexOf("]"),v.hostname=b.substring(1,R)||null,v.port=b.substring(R+2,I)||null,v.port==="/"&&(v.port=null);else{var k=b.indexOf(":"),V=b.indexOf("/"),G=b.indexOf(":",k+1);G!==-1&&(V===-1||G<V)?(v.hostname=b.substring(0,I)||null,v.port=null):(F=b.substring(0,I).split(":"),v.hostname=F[0]||null,v.port=F[1]||null)}return v.hostname&&b.substring(I).charAt(0)!=="/"&&(I++,b="/"+b),v.preventInvalidHostname&&o.ensureValidHostname(v.hostname,v.protocol),v.port&&o.ensureValidPort(v.port),b.substring(I)||"/"},o.parseAuthority=function(b,v){return b=o.parseUserinfo(b,v),o.parseHost(b,v)},o.parseUserinfo=function(b,v){var I=b,R=b.indexOf("\\");R!==-1&&(b=b.replace(/\\/g,"/"));var F=b.indexOf("/"),k=b.lastIndexOf("@",F>-1?F:b.length-1),V;return k>-1&&(F===-1||k<F)?(V=b.substring(0,k).split(":"),v.username=V[0]?o.decode(V[0]):null,V.shift(),v.password=V[0]?o.decode(V.join(":")):null,b=I.substring(k+1)):(v.username=null,v.password=null),b},o.parseQuery=function(b,v){if(!b)return{};if(b=b.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!b)return{};for(var I={},R=b.split("&"),F=R.length,k,V,G,U=0;U<F;U++)k=R[U].split("="),V=o.decodeQuery(k.shift(),v),G=k.length?o.decodeQuery(k.join("="),v):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},o.build=function(b){var v="",I=!1;return b.protocol&&(v+=b.protocol+":"),!b.urn&&(v||b.hostname)&&(v+="//",I=!0),v+=o.buildAuthority(b)||"",typeof b.path=="string"&&(b.path.charAt(0)!=="/"&&I&&(v+="/"),v+=b.path),typeof b.query=="string"&&b.query&&(v+="?"+b.query),typeof b.fragment=="string"&&b.fragment&&(v+="#"+b.fragment),v},o.buildHost=function(b){var v="";if(b.hostname)o.ip6_expression.test(b.hostname)?v+="["+b.hostname+"]":v+=b.hostname;else return"";return b.port&&(v+=":"+b.port),v},o.buildAuthority=function(b){return o.buildUserinfo(b)+o.buildHost(b)},o.buildUserinfo=function(b){var v="";return b.username&&(v+=o.encode(b.username)),b.password&&(v+=":"+o.encode(b.password)),v&&(v+="@"),v},o.buildQuery=function(b,v,I){var R="",F,k,V,G;for(k in b)if(k!=="__proto__"&&c.call(b,k))if(d(b[k]))for(F={},V=0,G=b[k].length;V<G;V++)b[k][V]!==void 0&&F[b[k][V]+""]===void 0&&(R+="&"+o.buildQueryParameter(k,b[k][V],I),v!==!0&&(F[b[k][V]+""]=!0));else b[k]!==void 0&&(R+="&"+o.buildQueryParameter(k,b[k],I));return R.substring(1)},o.buildQueryParameter=function(b,v,I){return o.encodeQuery(b,I)+(v!==null?"="+o.encodeQuery(v,I):"")},o.addQuery=function(b,v,I){if(typeof v=="object")for(var R in v)c.call(v,R)&&o.addQuery(b,R,v[R]);else if(typeof v=="string"){if(b[v]===void 0){b[v]=I;return}else typeof b[v]=="string"&&(b[v]=[b[v]]);d(I)||(I=[I]),b[v]=(b[v]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(b,v,I){if(typeof v=="object")for(var R in v)c.call(v,R)&&o.setQuery(b,R,v[R]);else if(typeof v=="string")b[v]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(b,v,I){var R,F,k;if(d(v))for(R=0,F=v.length;R<F;R++)b[v[R]]=void 0;else if(f(v)==="RegExp")for(k in b)v.test(k)&&(b[k]=void 0);else if(typeof v=="object")for(k in v)c.call(v,k)&&o.removeQuery(b,k,v[k]);else if(typeof v=="string")I!==void 0?f(I)==="RegExp"?!d(b[v])&&I.test(b[v])?b[v]=void 0:b[v]=p(b[v],I):b[v]===String(I)&&(!d(I)||I.length===1)?b[v]=void 0:d(b[v])&&(b[v]=p(b[v],I)):b[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(b,v,I,R){switch(f(v)){case"String":break;case"RegExp":for(var F in b)if(c.call(b,F)&&v.test(F)&&(I===void 0||o.hasQuery(b,F,I)))return!0;return!1;case"Object":for(var k in v)if(c.call(v,k)&&!o.hasQuery(b,k,v[k]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return v in b;case"Boolean":var V=!!(d(b[v])?b[v].length:b[v]);return I===V;case"Function":return!!I(b[v],v,b);case"Array":if(!d(b[v]))return!1;var G=R?g:h;return G(b[v],I);case"RegExp":return d(b[v])?R?g(b[v],I):!1:!!(b[v]&&b[v].match(I));case"Number":I=String(I);case"String":return d(b[v])?R?g(b[v],I):!1:b[v]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var b=[],v=[],I=0,R=0;R<arguments.length;R++){var F=new o(arguments[R]);b.push(F);for(var k=F.segment(),V=0;V<k.length;V++)typeof k[V]=="string"&&v.push(k[V]),k[V]&&I++}if(!v.length||!I)return new o("");var G=new o("").segment(v);return(b[0].path()===""||b[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},o.commonPath=function(b,v){var I=Math.min(b.length,v.length),R;for(R=0;R<I;R++)if(b.charAt(R)!==v.charAt(R)){R--;break}return R<1?b.charAt(0)===v.charAt(0)&&b.charAt(0)==="/"?"/":"":((b.charAt(R)!=="/"||v.charAt(R)!=="/")&&(R=b.substring(0,R).lastIndexOf("/")),b.substring(0,R+1))},o.withinString=function(b,v,I){I||(I={});var R=I.start||o.findUri.start,F=I.end||o.findUri.end,k=I.trim||o.findUri.trim,V=I.parens||o.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(R.lastIndex=0;;){var U=R.exec(b);if(!U)break;var Y=U.index;if(I.ignoreHtml){var W=b.slice(Math.max(Y-3,0),Y);if(W&&G.test(W))continue}for(var J=Y+b.slice(Y).search(F),j=b.slice(Y,J),K=-1;;){var Z=V.exec(j);if(!Z)break;var me=Z.index+Z[0].length;K=Math.max(K,me)}if(K>-1?j=j.slice(0,K)+j.slice(K).replace(k,""):j=j.replace(k,""),!(j.length<=U[0].length)&&!(I.ignore&&I.ignore.test(j))){J=Y+j.length;var ye=v(j,Y,J,b);if(ye===void 0){R.lastIndex=J;continue}ye=String(ye),b=b.slice(0,Y)+ye+b.slice(J),R.lastIndex=Y+ye.length}}return R.lastIndex=0,b},o.ensureValidHostname=function(b,v){var I=!!b,R=!!v,F=!1;if(R&&(F=g(o.hostProtocols,v)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(b&&b.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(b){if(b){var v=Number(b);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},o.noConflict=function(b){if(b){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=r);return this},a.build=function(b){return b===!0?this._deferred_build=!0:(b===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(b){return function(v,I){return v===void 0?this._parts[b]||"":(this._parts[b]=v||null,this.build(!I),this)}}function M(b,v){return function(I,R){return I===void 0?this._parts[b]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[b]=I,this.build(!R),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=M("query","?"),a.fragment=M("fragment","#"),a.search=function(b,v){var I=this.query(b,v);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(b,v){var I=this.fragment(b,v);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(b,v){if(b===void 0||b===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?o.decodeUrnPath:o.decodePath)(I):I}else return this._parts.urn?this._parts.path=b?o.recodeUrnPath(b):"":this._parts.path=b?o.recodePath(b):"/",this.build(!v),this},a.path=a.pathname,a.href=function(b,v){var I;if(b===void 0)return this.toString();this._string="",this._parts=o._parts();var R=b instanceof o,F=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var k=o.getDomAttribute(b);b=b[k]||"",F=!1}if(!R&&F&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=o.parse(String(b),this._parts);else if(R||F){var V=R?b._parts:b;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},a.is=function(b){var v=!1,I=!1,R=!1,F=!1,k=!1,V=!1,G=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=o.ip4_expression.test(this._parts.hostname),R=o.ip6_expression.test(this._parts.hostname),v=I||R,F=!v,k=F&&n&&n.has(this._parts.hostname),V=F&&o.idn_expression.test(this._parts.hostname),G=F&&o.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return F;case"sld":return k;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return R;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var O=a.protocol,B=a.port,L=a.hostname;a.protocol=function(b,v){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(o.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,b,v)},a.scheme=a.protocol,a.port=function(b,v){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),o.ensureValidPort(b))),B.call(this,b,v))},a.hostname=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},R=o.parseHost(b,I);if(R!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=I.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(b,this._parts.protocol)}return L.call(this,b,v)},a.origin=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=this.protocol(),R=this.authority();return R?(I?I+"://":"")+this.authority():""}else{var F=o(b);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var I=o.parseHost(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var I=o.parseAuthority(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=o.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),o.parseUserinfo(b,this._parts),this.build(!v),this},a.resource=function(b,v){var I;return b===void 0?this.path()+this.search()+this.hash():(I=o.parse(b),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},a.subdomain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var R=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,R),k=new RegExp("^"+l(F));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&o.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(k,b),this.build(!v),this}},a.domain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var R=this._parts.hostname.length-this.tld(v).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var F=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,b)}return this.build(!v),this}},a.tld=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var F;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))F=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b);else throw new TypeError('TLD "'+b+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return b?o.decodePath(R):R}else{var F=this._parts.path.length-this.filename().length,k=this._parts.path.substring(0,F),V=new RegExp("^"+l(k));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=o.recodePath(b),this._parts.path=this._parts.path.replace(V,b),this.build(!v),this}},a.filename=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(I+1);return b?o.decodePathSegment(R):R}else{var F=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(F=!0);var k=new RegExp(l(this.filename())+"$");return b=o.recodePath(b),this._parts.path=this._parts.path.replace(k,b),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),R=I.lastIndexOf("."),F,k;return R===-1?"":(F=I.substring(R+1),k=/^[a-z0-9%]+$/i.test(F)?F:"",b?o.decodePathSegment(k):k)}else{b.charAt(0)==="."&&(b=b.substring(1));var V=this.suffix(),G;if(V)b?G=new RegExp(l(V)+"$"):G=new RegExp(l("."+V)+"$");else{if(!b)return this;this._parts.path+="."+o.recodePath(b)}return G&&(b=o.recodePath(b),this._parts.path=this._parts.path.replace(G,b)),this.build(!v),this}},a.segment=function(b,v,I){var R=this._parts.urn?":":"/",F=this.path(),k=F.substring(0,1)==="/",V=F.split(R);if(b!==void 0&&typeof b!="number"&&(I=v,v=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(k&&V.shift(),b<0&&(b=Math.max(V.length+b,0)),v===void 0)return b===void 0?V:V[b];if(b===null||V[b]===void 0)if(d(v)){V=[];for(var G=0,U=v.length;G<U;G++)!v[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(A(v[G])))}else(v||typeof v=="string")&&(v=A(v),V[V.length-1]===""?V[V.length-1]=v:V.push(v));else v?V[b]=A(v):V.splice(b,1);return k&&V.unshift(""),this.path(V.join(R),I)},a.segmentCoded=function(b,v,I){var R,F,k;if(typeof b!="number"&&(I=v,v=b,b=void 0),v===void 0){if(R=this.segment(b,v,I),!d(R))R=R!==void 0?o.decode(R):void 0;else for(F=0,k=R.length;F<k;F++)R[F]=o.decode(R[F]);return R}if(!d(v))v=typeof v=="string"||v instanceof String?o.encode(v):v;else for(F=0,k=v.length;F<k;F++)v[F]=o.encode(v[F]);return this.segment(b,v,I)};var _=a.query;return a.query=function(b,v){if(b===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="function"){var I=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),R=b.call(this,I);return this._parts.query=o.buildQuery(R||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return b!==void 0&&typeof b!="string"?(this._parts.query=o.buildQuery(b,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):_.call(this,b,v)},a.setQuery=function(b,v,I){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="string"||b instanceof String)R[b]=v!==void 0?v:null;else if(typeof b=="object")for(var F in b)c.call(b,F)&&(R[F]=b[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.addQuery=function(b,v,I){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(R,b,v===void 0?null:v),this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.removeQuery=function(b,v,I){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(R,b,v),this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.hasQuery=function(b,v,I){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(R,b,v,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(b){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!b)),this},a.normalizeHostname=function(b){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!b)),this},a.normalizePort=function(b){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!b)),this},a.normalizePath=function(b){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!b),this;if(this._parts.path==="/")return this;v=o.recodePath(v);var I,R="",F,k;for(v.charAt(0)!=="/"&&(I=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(R=v.substring(1).match(/^(\.\.\/)+/)||"",R&&(R=R[0]));F=v.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){v=v.substring(3);continue}k=v.substring(0,F).lastIndexOf("/"),k===-1&&(k=F),v=v.substring(0,k)+v.substring(F+3)}return I&&this.is("relative")&&(v=R+v.substring(1)),this._parts.path=v,this.build(!b),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(b){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!b)),this},a.normalizeFragment=function(b){return this._parts.fragment||(this._parts.fragment=null,this.build(!b)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var b=o.encode,v=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=b,o.decode=v}return this},a.unicode=function(){var b=o.encode,v=o.decode;o.encode=C,o.decode=unescape;try{this.normalize()}finally{o.encode=b,o.decode=v}return this},a.readable=function(){var b=this.clone();b.username("").password("").normalize();var v="";if(b._parts.protocol&&(v+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&e?(v+=e.toUnicode(b._parts.hostname),b._parts.port&&(v+=":"+b._parts.port)):v+=b.host()),b._parts.hostname&&b._parts.path&&b._parts.path.charAt(0)!=="/"&&(v+="/"),v+=b.path(!0),b._parts.query){for(var I="",R=0,F=b._parts.query.split("&"),k=F.length;R<k;R++){var V=(F[R]||"").split("=");I+="&"+o.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+o.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}v+="?"+I.substring(1)}return v+=o.decodeQuery(b.hash(),!0),v},a.absoluteTo=function(b){var v=this.clone(),I=["protocol","username","password","hostname","port"],R,F,k;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b instanceof o||(b=new o(b)),v._parts.protocol||(v._parts.protocol=b._parts.protocol,this._parts.hostname))return v;for(F=0;k=I[F];F++)v._parts[k]=b._parts[k];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(R=b.directory(),R=R||(b.path().indexOf("/")===0?"/":""),v._parts.path=(R?R+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=b._parts.path,v._parts.query||(v._parts.query=b._parts.query)),v.build(),v},a.relativeTo=function(b){var v=this.clone().normalize(),I,R,F,k,V;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b=new o(b).normalize(),I=v._parts,R=b._parts,k=v.path(),V=b.path(),k.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===R.protocol&&(I.protocol=null),I.username!==R.username||I.password!==R.password||I.protocol!==null||I.username!==null||I.password!==null)return v.build();if(I.hostname===R.hostname&&I.port===R.port)I.hostname=null,I.port=null;else return v.build();if(k===V)return I.path="",v.build();if(F=o.commonPath(k,V),!F)return v.build();var G=R.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(F.length)||"./",v.build()},a.equals=function(b){var v=this.clone(),I=new o(b),R={},F={},k={},V,G,U;if(v.normalize(),I.normalize(),v.toString()===I.toString())return!0;if(V=v.query(),G=I.query(),v.query(""),I.query(""),v.toString()!==I.toString()||V.length!==G.length)return!1;R=o.parseQuery(V,this._parts.escapeQuerySpace),F=o.parseQuery(G,this._parts.escapeQuerySpace);for(U in R)if(c.call(R,U)){if(d(R[U])){if(!h(R[U],F[U]))return!1}else if(R[U]!==F[U])return!1;k[U]=!0}for(U in F)if(c.call(F,U)&&!k[U])return!1;return!0},a.preventInvalidHostname=function(b){return this._parts.preventInvalidHostname=!!b,this},a.duplicateQueryParameters=function(b){return this._parts.duplicateQueryParameters=!!b,this},a.escapeQuerySpace=function(b){return this._parts.escapeQuerySpace=!!b,this},o})});var Xte=Jn((bWt,Yte)=>{"use strict";/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */var{entries:Gte,setPrototypeOf:Nte,isFrozen:uMe,getPrototypeOf:fMe,getOwnPropertyDescriptor:dMe}=Object,{freeze:Nc,seal:Ad,create:mMe}=Object,{apply:I5,construct:P5}=typeof Reflect<"u"&&Reflect;I5||(I5=function(t,n,i){return t.apply(n,i)});Nc||(Nc=function(t){return t});Ad||(Ad=function(t){return t});P5||(P5=function(t,n){return new t(...n)});var hMe=nf(Array.prototype.forEach),Fte=nf(Array.prototype.pop),GP=nf(Array.prototype.push),OU=nf(String.prototype.toLowerCase),E5=nf(String.prototype.toString),pMe=nf(String.prototype.match),yd=nf(String.prototype.replace),_Me=nf(String.prototype.indexOf),gMe=nf(String.prototype.trim),ru=nf(RegExp.prototype.test),b5=yMe(TypeError);function nf(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return I5(e,t,i)}}function yMe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return P5(e,n)}}function hi(e,t,n){n=n||OU,Nte&&Nte(e,null);let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(uMe(t)||(t[i]=o),r=o)}e[r]=!0}return e}function OT(e){let t=mMe(null);for(let[n,i]of Gte(e))t[n]=i;return t}function IU(e,t){for(;e!==null;){let i=dMe(e,t);if(i){if(i.get)return nf(i.get);if(typeof i.value=="function")return nf(i.value)}e=fMe(e)}function n(i){return console.warn("fallback value for",i),null}return n}var Ute=Nc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),S5=Nc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),v5=Nc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AMe=Nc(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),w5=Nc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xMe=Nc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vte=Nc(["#text"]),kte=Nc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),D5=Nc(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zte=Nc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),PU=Nc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),CMe=Ad(/\{\{[\w\W]*|[\w\W]*\}\}/gm),TMe=Ad(/<%[\w\W]*|[\w\W]*%>/gm),EMe=Ad(/\${[\w\W]*}/gm),bMe=Ad(/^data-[\-\w.\u00B7-\uFFFF]/),SMe=Ad(/^aria-[\-\w]+$/),Wte=Ad(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vMe=Ad(/^(?:\w+script|data):/i),wMe=Ad(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jte=Ad(/^html$/i),Hte=Object.freeze({__proto__:null,MUSTACHE_EXPR:CMe,ERB_EXPR:TMe,TMPLIT_EXPR:EMe,DATA_ATTR:bMe,ARIA_ATTR:SMe,IS_ALLOWED_URI:Wte,IS_SCRIPT_OR_DATA:vMe,ATTR_WHITESPACE:wMe,DOCTYPE_NAME:jte}),DMe=()=>typeof window>"u"?null:window,IMe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(i=n.currentScript.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function qte(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DMe(),t=rn=>qte(rn);if(t.version="3.0.2",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let n=e.document,{document:i}=e,{DocumentFragment:r,HTMLTemplateElement:o,Node:s,Element:a,NodeFilter:c,NamedNodeMap:l=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:p}=e,g=a.prototype,h=IU(g,"cloneNode"),A=IU(g,"nextSibling"),x=IU(g,"childNodes"),C=IU(g,"parentNode");if(typeof o=="function"){let rn=i.createElement("template");rn.content&&rn.content.ownerDocument&&(i=rn.content.ownerDocument)}let T=IMe(p,n),E=T?T.createHTML(""):"",{implementation:S,createNodeIterator:w,createDocumentFragment:D,getElementsByTagName:M}=i,{importNode:O}=n,B={};t.isSupported=typeof Gte=="function"&&typeof C=="function"&&S&&typeof S.createHTMLDocument<"u";let{MUSTACHE_EXPR:L,ERB_EXPR:_,TMPLIT_EXPR:b,DATA_ATTR:v,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:F}=Hte,{IS_ALLOWED_URI:k}=Hte,V=null,G=hi({},[...Ute,...S5,...v5,...w5,...Vte]),U=null,Y=hi({},[...kte,...D5,...zte,...PU]),W=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,j=null,K=!0,Z=!0,me=!1,ye=!0,se=!1,pe=!1,Ae=!1,De=!1,Ce=!1,Re=!1,tt=!1,nt=!0,Wt=!1,un="user-content-",pt=!0,gn=!1,Bn={},Ut=null,kt=hi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ee=null,xe=hi({},["audio","video","img","source","image","track"]),ft=null,di=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Xi="http://www.w3.org/2000/svg",Or="http://www.w3.org/1999/xhtml",Jo=Or,Uo=!1,xs=null,Ue=hi({},[Xe,Xi,Or],E5),ot,Ge=["application/xhtml+xml","text/html"],Je="text/html",it,Lt=null,_n=i.createElement("form"),mr=function(Se){return Se instanceof RegExp||Se instanceof Function},Er=function(Se){Lt&&Lt===Se||((!Se||typeof Se!="object")&&(Se={}),Se=OT(Se),ot=Ge.indexOf(Se.PARSER_MEDIA_TYPE)===-1?ot=Je:ot=Se.PARSER_MEDIA_TYPE,it=ot==="application/xhtml+xml"?E5:OU,V="ALLOWED_TAGS"in Se?hi({},Se.ALLOWED_TAGS,it):G,U="ALLOWED_ATTR"in Se?hi({},Se.ALLOWED_ATTR,it):Y,xs="ALLOWED_NAMESPACES"in Se?hi({},Se.ALLOWED_NAMESPACES,E5):Ue,ft="ADD_URI_SAFE_ATTR"in Se?hi(OT(di),Se.ADD_URI_SAFE_ATTR,it):di,Ee="ADD_DATA_URI_TAGS"in Se?hi(OT(xe),Se.ADD_DATA_URI_TAGS,it):xe,Ut="FORBID_CONTENTS"in Se?hi({},Se.FORBID_CONTENTS,it):kt,J="FORBID_TAGS"in Se?hi({},Se.FORBID_TAGS,it):{},j="FORBID_ATTR"in Se?hi({},Se.FORBID_ATTR,it):{},Bn="USE_PROFILES"in Se?Se.USE_PROFILES:!1,K=Se.ALLOW_ARIA_ATTR!==!1,Z=Se.ALLOW_DATA_ATTR!==!1,me=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=Se.SAFE_FOR_TEMPLATES||!1,pe=Se.WHOLE_DOCUMENT||!1,Ce=Se.RETURN_DOM||!1,Re=Se.RETURN_DOM_FRAGMENT||!1,tt=Se.RETURN_TRUSTED_TYPE||!1,De=Se.FORCE_BODY||!1,nt=Se.SANITIZE_DOM!==!1,Wt=Se.SANITIZE_NAMED_PROPS||!1,pt=Se.KEEP_CONTENT!==!1,gn=Se.IN_PLACE||!1,k=Se.ALLOWED_URI_REGEXP||Wte,Jo=Se.NAMESPACE||Or,W=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&mr(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&mr(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),se&&(Z=!1),Re&&(Ce=!0),Bn&&(V=hi({},[...Vte]),U=[],Bn.html===!0&&(hi(V,Ute),hi(U,kte)),Bn.svg===!0&&(hi(V,S5),hi(U,D5),hi(U,PU)),Bn.svgFilters===!0&&(hi(V,v5),hi(U,D5),hi(U,PU)),Bn.mathMl===!0&&(hi(V,w5),hi(U,zte),hi(U,PU))),Se.ADD_TAGS&&(V===G&&(V=OT(V)),hi(V,Se.ADD_TAGS,it)),Se.ADD_ATTR&&(U===Y&&(U=OT(U)),hi(U,Se.ADD_ATTR,it)),Se.ADD_URI_SAFE_ATTR&&hi(ft,Se.ADD_URI_SAFE_ATTR,it),Se.FORBID_CONTENTS&&(Ut===kt&&(Ut=OT(Ut)),hi(Ut,Se.FORBID_CONTENTS,it)),pt&&(V["#text"]=!0),pe&&hi(V,["html","head","body"]),V.table&&(hi(V,["tbody"]),delete J.tbody),Nc&&Nc(Se),Lt=Se)},Cs=hi({},["mi","mo","mn","ms","mtext"]),Ts=hi({},["foreignobject","desc","title","annotation-xml"]),mo=hi({},["title","style","font","a","script"]),Di=hi({},S5);hi(Di,v5),hi(Di,AMe);let Vo=hi({},w5);hi(Vo,xMe);let Gn=function(Se){let ct=C(Se);(!ct||!ct.tagName)&&(ct={namespaceURI:Jo,tagName:"template"});let xt=OU(Se.tagName),Hi=OU(ct.tagName);return xs[Se.namespaceURI]?Se.namespaceURI===Xi?ct.namespaceURI===Or?xt==="svg":ct.namespaceURI===Xe?xt==="svg"&&(Hi==="annotation-xml"||Cs[Hi]):!!Di[xt]:Se.namespaceURI===Xe?ct.namespaceURI===Or?xt==="math":ct.namespaceURI===Xi?xt==="math"&&Ts[Hi]:!!Vo[xt]:Se.namespaceURI===Or?ct.namespaceURI===Xi&&!Ts[Hi]||ct.namespaceURI===Xe&&!Cs[Hi]?!1:!Vo[xt]&&(mo[xt]||!Di[xt]):!!(ot==="application/xhtml+xml"&&xs[Se.namespaceURI]):!1},vn=function(Se){GP(t.removed,{element:Se});try{Se.parentNode.removeChild(Se)}catch{Se.remove()}},Wn=function(Se,ct){try{GP(t.removed,{attribute:ct.getAttributeNode(Se),from:ct})}catch{GP(t.removed,{attribute:null,from:ct})}if(ct.removeAttribute(Se),Se==="is"&&!U[Se])if(Ce||Re)try{vn(ct)}catch{}else try{ct.setAttribute(Se,"")}catch{}},Ci=function(Se){let ct,xt;if(De)Se="<remove></remove>"+Se;else{let bs=pMe(Se,/^[\r\n\t ]+/);xt=bs&&bs[0]}ot==="application/xhtml+xml"&&Jo===Or&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");let Hi=T?T.createHTML(Se):Se;if(Jo===Or)try{ct=new d().parseFromString(Hi,ot)}catch{}if(!ct||!ct.documentElement){ct=S.createDocument(Jo,"template",null);try{ct.documentElement.innerHTML=Uo?E:Hi}catch{}}let tr=ct.body||ct.documentElement;return Se&&xt&&tr.insertBefore(i.createTextNode(xt),tr.childNodes[0]||null),Jo===Or?M.call(ct,pe?"html":"body")[0]:pe?ct.documentElement:tr},Ws=function(Se){return w.call(Se.ownerDocument||Se,Se,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Es=function(Se){return Se instanceof f&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof l)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},La=function(Se){return typeof s=="object"?Se instanceof s:Se&&typeof Se=="object"&&typeof Se.nodeType=="number"&&typeof Se.nodeName=="string"},js=function(Se,ct,xt){B[Se]&&hMe(B[Se],Hi=>{Hi.call(t,ct,xt,Lt)})},td=function(Se){let ct;if(js("beforeSanitizeElements",Se,null),Es(Se))return vn(Se),!0;let xt=it(Se.nodeName);if(js("uponSanitizeElement",Se,{tagName:xt,allowedTags:V}),Se.hasChildNodes()&&!La(Se.firstElementChild)&&(!La(Se.content)||!La(Se.content.firstElementChild))&&ru(/<[/\w]/g,Se.innerHTML)&&ru(/<[/\w]/g,Se.textContent))return vn(Se),!0;if(!V[xt]||J[xt]){if(!J[xt]&&ov(xt)&&(W.tagNameCheck instanceof RegExp&&ru(W.tagNameCheck,xt)||W.tagNameCheck instanceof Function&&W.tagNameCheck(xt)))return!1;if(pt&&!Ut[xt]){let Hi=C(Se)||Se.parentNode,tr=x(Se)||Se.childNodes;if(tr&&Hi){let bs=tr.length;for(let ro=bs-1;ro>=0;--ro)Hi.insertBefore(h(tr[ro],!0),A(Se))}}return vn(Se),!0}return Se instanceof a&&!Gn(Se)||(xt==="noscript"||xt==="noembed")&&ru(/<\/no(script|embed)/i,Se.innerHTML)?(vn(Se),!0):(se&&Se.nodeType===3&&(ct=Se.textContent,ct=yd(ct,L," "),ct=yd(ct,_," "),ct=yd(ct,b," "),Se.textContent!==ct&&(GP(t.removed,{element:Se.cloneNode()}),Se.textContent=ct)),js("afterSanitizeElements",Se,null),!1)},ha=function(Se,ct,xt){if(nt&&(ct==="id"||ct==="name")&&(xt in i||xt in _n))return!1;if(!(Z&&!j[ct]&&ru(v,ct))){if(!(K&&ru(I,ct))){if(!U[ct]||j[ct]){if(!(ov(Se)&&(W.tagNameCheck instanceof RegExp&&ru(W.tagNameCheck,Se)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Se))&&(W.attributeNameCheck instanceof RegExp&&ru(W.attributeNameCheck,ct)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(ct))||ct==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&ru(W.tagNameCheck,xt)||W.tagNameCheck instanceof Function&&W.tagNameCheck(xt))))return!1}else if(!ft[ct]){if(!ru(k,yd(xt,F,""))){if(!((ct==="src"||ct==="xlink:href"||ct==="href")&&Se!=="script"&&_Me(xt,"data:")===0&&Ee[Se])){if(!(me&&!ru(R,yd(xt,F,"")))){if(xt)return!1}}}}}}return!0},ov=function(Se){return Se.indexOf("-")>0},jr=function(Se){let ct,xt,Hi,tr;js("beforeSanitizeAttributes",Se,null);let{attributes:bs}=Se;if(!bs)return;let ro={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(tr=bs.length;tr--;){ct=bs[tr];let{name:wm,namespaceURI:fG}=ct;if(xt=wm==="value"?ct.value:gMe(ct.value),Hi=it(wm),ro.attrName=Hi,ro.attrValue=xt,ro.keepAttr=!0,ro.forceKeepAttr=void 0,js("uponSanitizeAttribute",Se,ro),xt=ro.attrValue,ro.forceKeepAttr||(Wn(wm,Se),!ro.keepAttr))continue;if(!ye&&ru(/\/>/i,xt)){Wn(wm,Se);continue}se&&(xt=yd(xt,L," "),xt=yd(xt,_," "),xt=yd(xt,b," "));let lJ=it(Se.nodeName);if(ha(lJ,Hi,xt)){if(Wt&&(Hi==="id"||Hi==="name")&&(Wn(wm,Se),xt=un+xt),T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!fG)switch(p.getAttributeType(lJ,Hi)){case"TrustedHTML":xt=T.createHTML(xt);break;case"TrustedScriptURL":xt=T.createScriptURL(xt);break}try{fG?Se.setAttributeNS(fG,wm,xt):Se.setAttribute(wm,xt),Fte(t.removed)}catch{}}}js("afterSanitizeAttributes",Se,null)},zo=function rn(Se){let ct,xt=Ws(Se);for(js("beforeSanitizeShadowDOM",Se,null);ct=xt.nextNode();)js("uponSanitizeShadowNode",ct,null),!td(ct)&&(ct.content instanceof r&&rn(ct.content),jr(ct));js("afterSanitizeShadowDOM",Se,null)};return t.sanitize=function(rn){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ct,xt,Hi,tr;if(Uo=!rn,Uo&&(rn="<!-->"),typeof rn!="string"&&!La(rn)){if(typeof rn.toString!="function")throw b5("toString is not a function");if(rn=rn.toString(),typeof rn!="string")throw b5("dirty is not a string, aborting")}if(!t.isSupported)return rn;if(Ae||Er(Se),t.removed=[],typeof rn=="string"&&(gn=!1),gn){if(rn.nodeName){let wm=it(rn.nodeName);if(!V[wm]||J[wm])throw b5("root node is forbidden and cannot be sanitized in-place")}}else if(rn instanceof s)ct=Ci("<!---->"),xt=ct.ownerDocument.importNode(rn,!0),xt.nodeType===1&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?ct=xt:ct.appendChild(xt);else{if(!Ce&&!se&&!pe&&rn.indexOf("<")===-1)return T&&tt?T.createHTML(rn):rn;if(ct=Ci(rn),!ct)return Ce?null:tt?E:""}ct&&De&&vn(ct.firstChild);let bs=Ws(gn?rn:ct);for(;Hi=bs.nextNode();)td(Hi)||(Hi.content instanceof r&&zo(Hi.content),jr(Hi));if(gn)return rn;if(Ce){if(Re)for(tr=D.call(ct.ownerDocument);ct.firstChild;)tr.appendChild(ct.firstChild);else tr=ct;return(U.shadowroot||U.shadowrootmod)&&(tr=O.call(n,tr,!0)),tr}let ro=pe?ct.outerHTML:ct.innerHTML;return pe&&V["!doctype"]&&ct.ownerDocument&&ct.ownerDocument.doctype&&ct.ownerDocument.doctype.name&&ru(jte,ct.ownerDocument.doctype.name)&&(ro="<!DOCTYPE "+ct.ownerDocument.doctype.name+`> -`+ro),se&&(ro=yd(ro,L," "),ro=yd(ro,_," "),ro=yd(ro,b," ")),T&&tt?T.createHTML(ro):ro},t.setConfig=function(rn){Er(rn),Ae=!0},t.clearConfig=function(){Lt=null,Ae=!1},t.isValidAttribute=function(rn,Se,ct){Lt||Er({});let xt=it(rn),Hi=it(Se);return ha(xt,Hi,ct)},t.addHook=function(rn,Se){typeof Se=="function"&&(B[rn]=B[rn]||[],GP(B[rn],Se))},t.removeHook=function(rn){if(B[rn])return Fte(B[rn])},t.removeHooks=function(rn){B[rn]&&(B[rn]=[])},t.removeAllHooks=function(){B={}},t}var PMe=qte();Yte.exports=PMe});var Fne=Jn((n1,K5)=>{var jU=function(){"use strict";var e="B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gVUUUUUB9gLUUUUB9gIUUUEU9gD99UE99I8ayDILEVLEVLOOOOORRVBWWBEdddLVE9wEIIVIEBEOWEUEC+g/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBV8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBOe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBRA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBWl9tw79o9v9wT9fw9u9j9v9kws9p2Twv9P9jTBdk9tw79o9v9wT9fw9u9j9v9kws9p2Twv9R919hTBQl9tw79o9v9wT9fw9u9j9v9kws9p2Twvt949wBKe9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9owBpA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9ow9TTv9p9wBSA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBZL79iv9rBhdWEBCEKDxcQ+1tyDBK/hKEyU8jJJJJBCJO9rGV8kJJJJBCBHODNALCEFAE0MBABCBrB+Q+KJJBC+gEv86BBAVCJDFCBCJDZ+TJJJB8aDNAItMBAVCJDFADALZmJJJB8aKABAEFHRABCEFHWAVALFCBCBCJDAL9rALCfE0eZ+TJJJB8aAVAVCJDFALZmJJJBHdCJ/ABAL9uHEDNDNALtMBAEC/wfBgGECJDAECJD6eHQCBHKINAKAI9PMEAdCJLFCBCJDZ+TJJJB8aAQAIAK9rAKAQFAI6eGXCSFGECL4CIFCD4HMADAKAL2FHpDNDNDNDNDNAEC9wgGStMBCBHZCEHhApHoAWHaXEKDNAXtMBCBHaCEHhApHcINAdAaFrBBHxAcHECBHOINAdCJLFAOFAErBBGqAx9rGxCETAxCkTCk91CR4786BBAEALFHEAqHxAOCEFGOAX9HMBKARAW9rAM6MIAWCBAMZ+TJJJBGEtMIAEAMFHWAcCEFHcAaCEFGaAL6HhAaAL9HMBXVKKARAW9rAM6MOAWCBAMZ+TJJJB8aCEHEINAWGxAMFHWALAEGOsMLDNARAW9rAM6MBAOCEFHEAWCBAMZ+TJJJB8aAxMEKKCBHWAOAL6MOXIKINDNAXtMBAdAZFrBBHxCBHEAoHOINAdCJLFAEFAOrBBGqAx9rGxCETAxCkTCk91CR4786BBAOALFHOAqHxAECEFGEAX9HMBKKARAa9rAM6MEARAaCBAMZ+TJJJBGlAMFGW9rCk6MDCBHkAdCJLFHcINAdCJLFAkFHyCWH8aCZHaCEHqINDNDNAqCE9HMBCUHOAyrBBMECBHODNINAOGECSsMEAECEFHOAcAEFCEFrBBtMBKKCUCBAECS6eHOXEKAqCETC/+fffEgHOCUAqTCU7CfEgHxCBHEINAOAxAcAEFrBB9NFHOAECEFGECZ9HMBKKAOAaAOAa6GEeHaAqA8aAEeH8aAqCETGqCW6MBKDNDNDNDNA8aCUFpDIEBKAlAkCO4FGEAErBBCDCIA8aCLseAkCI4COgTv86BBA8aCW9HMEAWAy8pBB83BBAWCWFAyCWF8pBB83BBAWCZFHWXDKAlAkCO4FGEAErBBCEAkCI4COgTv86BBKDNCWA8a9tGeMBINAWCB86BBAWCEFHWXBKKCUA8aTCU7HqCBH3AcH5INA5HEAeHxCBHOINAErBBGaAqAaAqCfEgGy6eAOCfEgA8aTvHOAECEFHEAxCUFGxMBKAWAO86BBA5AeFH5AWCEFHWA3AeFG3CZ6MBKCBHEINDNAcAEFrBBGOAy6MBAWAO86BBAWCEFHWKAECEFGECZ9HMBKKDNAkCZFGkAS9PMBAcCZFHcARAW9rCl0MEKKAkAS6MEAWtMEAoCEFHoAZCEFGZAL6HhAWHaAZALsMIXBKKCBHWAhCEgtMEXLKCBHWAhCEgMIKAdApAXCUFAL2FALZmJJJB8aAXAKFHKAWMBKCBHOXDKCBHOARAW9rCAALALCA6e6MEDNALC8f0MBAWCBCAAL9rGEZ+TJJJBAEFHWKAWAdCJDFALZmJJJBALFAB9rHOXEKCBHOKAVCJOF8kJJJJBAOK9HEEUAECAAECA0eABCJ/ABAE9uC/wfBgGDCJDADCJD6eGDFCUFAD9uAE2ADCL4CIFCD4ADv2FCEFKMBCBABbD+Q+KJJBK/YSE3U8jJJJJBC/AE9rGL8kJJJJBCBHVDNAICI9uGOChFAE0MBABCBYDn+KJJBGVC/gEv86BBALC/ABFCfECJEZ+TJJJB8aALCuFGR9CU83IBALC8wFGW9CU83IBALCYFGd9CU83IBALCAFGQ9CU83IBALCkFGK9CU83IBALCZFGX9CU83IBAL9CU83IWAL9CU83IBABAEFC9wFHMABCEFGpAOFHEDNAItMBCMCSAVCB9KGSeHZAVCE9IHhCBHoCBHaCBHcCBHxCBHqINDNAEAM9NMBCBHVXIKAqCUFHVADAcCDTFGOYDBHlAOCWFYDBHkAOCLFYDBHyCBH8aDNDNINALC/ABFAVCSgCITFGOYDLHeDNDNDNAOYDBGOAl9HMBAeAysMEKDNAOAy9HMBAeAk9HMBA8aCEFH8aXEKAOAk9HMEAeAl9HMEA8aCDFH8aKA8aC870MDAxCUFHVADA8aCIgCX2GOC+Y1JJBFYDBAcFCDTFYDBHeADAOCn1JJBFYDBAcFCDTFYDBHkADAOC+Q1JJBFYDBAcFCDTFYDBHlCBHODNINDNALAVCSgCDTFYDBAe9HMBAOHyXDKCUHyAVCUFHVAOCEFGOCZ9HMBKKAyCB9KAyAZ9IgGVCU7AeAosGOgH3DNDNDNDNDNAyCBCSAOeAVeGVCS9HMBAhMBAeAeAaAeCEFAasGVeGaCEFsMECMCSAVeHVKApAVA8aCDTC/wEgv86BBAVCS9HMEAeAa9rGVCETAVC8f917HVINAEAVCfB0CRTAVCfBgv86BBAECEFHEAVCJE6HOAVCR4HVAOtMBKAeHaXDKCpHVApA8aCDTCpv86BBAeHaKAVtMBAVAZ9IMEKALAxCDTFAebDBAxCEFCSgHxKAoA3FHoALC/ABFAqCITFGVAkbDLAVAebDBALC/ABFAqCEFCSgGVCITFGOAebDLAOAlbDBAVCEFHOXIKAVCUFHVA8aCLFG8aC/AB9HMBKKDNADCEAkAosCETAyAoseCX2GVC+Q1JJBFYDBAcFCDTFYDBGltADAVCn1JJBFYDBAcFCDTFYDBG8aCEsgADAVC+Y1JJBFYDBAcFCDTFYDBGyCDsgAoCB9HgASgG5CE9HMBAR9CU83IBAW9CU83IBAd9CU83IBAQ9CU83IBAK9CU83IBAX9CU83IBAL9CU83IWAL9CU83IBCBHoKCBHeAxCUFGVHODNINDNALAOCSgCDTFYDBA8a9HMBAeHkXDKCUHkAOCUFHOAeCEFGeCZ9HMBKKCBHODNINDNALAVCSgCDTFYDBAy9HMBAOHeXDKCUHeAVCUFHVAOCEFGOCZ9HMBKKAoAlAosG8eFH3DNDNAkCM0MBAkCEFHkXEKCBCSA8aA3sGVeHkA3AVFH3KDNDNAeCM0MBAeCEFHeXEKCBCSAyA3sGVeHeA3AVFH3KC9+CUA8eeH8fAeAkCLTvHOCBHVDNDNDNINAVCJ1JJBFrBBAOCfEgsMEAVCEFGVCZ9HMBXDKKAlAo9HAVCM0vA5vMBApAVC/wEv86BBXEKApA8f86BBAEAO86BBAECEFHEKDNA8eMBAlAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKAlHaKDNAkCS9HMBA8aAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKA8aHaKDNAeCS9HMBAyAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKAyHaKALAxCDTFAlbDBAxCEFCSgHVDNDNAkpZBEEEEEEEEEEEEEEBEKALAVCDTFA8abDBAxCDFCSgHVKDNDNAepZBEEEEEEEEEEEEEEBEKALAVCDTFAybDBAVCEFCSgHVKALC/ABFAqCITFGOAlbDLAOA8abDBALC/ABFAqCEFCSgCITFGOA8abDLAOAybDBALC/ABFAqCDFCSgCITFGOAybDLAOAlbDBAqCIFHOAVHxA3HoKApCEFHpAOCSgHqAcCIFGcAI6MBKKCBHVAEAM0MBCBHVINAEAVFAVCJ1JJBFrBB86BBAVCEFGVCZ9HMBKAEAB9rAVFHVKALC/AEF8kJJJJBAVKzEEUCBHDDNINADCEFGDC8f0MECEADTAE6MBKKADCRFCfEgCR9uCI2CDFABCI9u2ChFKMBCBABbDn+KJJBK+cDEWU8jJJJJBCZ9rHLCBHVDNAICVFAE0MBCBHOABCBrBn+KJJBC/QEv86BBAL9CB83IWABCEFHRABAEFC98FHWDNAItMBCBHdINDNARAW6MBCBSKADAdCDTFYDBGQALCWFAOAQALCWFAOCDTFYDB9rGEAEC8f91GEFAE7C507GOCDTFGKYDB9rGEC8e91C9+gAECDT7AOvHEINARAECfB0GVCRTAECfBgv86BBAECR4HEARCEFHRAVMBKAKAQbDBAdCEFGdAI9HMBKKCBHVARAW0MBARCBbBBARAB9rCLFHVKAVKbEEUCBHDDNINADCEFGDC8f0MECEADTAE6MBKKADCWFCfEgCR9uAB2CVFK+DVLI99DUI99LUDNAEtMBCUADCETCUFTCU7+yHVDNDNCUAICUFTCU7+yGOjBBBzmGR+LjBBB9P9dtMBAR+oHWXEKCJJJJ94HWKCBHICBHdINALCLFiDBGRjBBBBjBBJzALiDBGQ+LAR+LmALCWFiDBGK+LmGR+VARjBBBB9beGRnHXAQARnHRALCXFiDBHQDNDNAKjBBBB9gtMBAXHKXEKjBBJzAR+L+TGKAK+MAXjBBBB9geHKjBBJzAX+L+TGXAX+MARjBBBB9geHRKDNDNAQjBBJ+/AQjBBJ+/9geGXjBBJzAXjBBJz9feAVnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHMXEKCJJJJ94HMKDNDNAKjBBJ+/AKjBBJ+/9geGQjBBJzAQjBBJz9feAOnjBBBzjBBB+/AKjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHpXEKCJJJJ94HpKDNDNARjBBJ+/ARjBBJ+/9geGQjBBJzAQjBBJz9feAOnjBBBzjBBB+/ARjBBBB9gemGR+LjBBB9P9dtMBAR+oHSXEKCJJJJ94HSKDNDNADCL9HMBABAdFGZAS86BBAZCIFAM86BBAZCDFAW86BBAZCEFAp86BBXEKABAIFGZAS87EBAZCOFAM87EBAZCLFAW87EBAZCDFAp87EBKALCZFHLAICWFHIAdCLFHdAECUFGEMBKKK/KLLD99EUD99EUDNAEtMBDNDNCUAICUFTCU7+yGVjBBBzmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKAIC/8fIgHRINABCOFCICDALCLFiDB+LALiDB+L9eGIALCWFiDB+LALAICDTFiDB+L9eeGIALCXFiDB+LALAICDTFiDB+L9eeGIARv87EBDNDNALAICEFCIgCDTFiDBj/zL+1znjBBJ+/jBBJzALAICDTFiDBjBBBB9deGOnGWjBBJ+/AWjBBJ+/9geGdjBBJzAdjBBJz9feAVnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHQXEKCJJJJ94HQKABAQ87EBDNDNAOALAICDFCIgCDTFiDBj/zL+1znnGWjBBJ+/AWjBBJ+/9geGdjBBJzAdjBBJz9feAVnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHQXEKCJJJJ94HQKABCDFAQ87EBDNDNAOALAICUFCIgCDTFiDBj/zL+1znnGOjBBJ+/AOjBBJ+/9geGWjBBJzAWjBBJz9feAVnjBBBzjBBB+/AOjBBBB9gemGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKABCLFAI87EBABCWFHBALCZFHLAECUFGEMBKKK+7DDWUE998jJJJJBCZ9rGV8kJJJJBDNAEtMBADCL6MBCEAI9rHOADCD4GDCEADCE0eHRADCDTHWCBHdINC+cUHDALHIARHQINAIiDBAVCXFZ+XJJJB8aAVYDXGKADADAK9IeHDAICLFHIAQCUFGQMBKAOADFGICkTHKCBHDCBAI9rHXARHIINDNDNALADFiDBGMAXZ+WJJJBjBBBzjBBB+/AMjBBBB9gemGM+LjBBB9P9dtMBAM+oHQXEKCJJJJ94HQKABADFAQCfffRgAKvbDBADCLFHDAICUFGIMBKABAWFHBALAWFHLAdCEFGdAE9HMBKKAVCZF8kJJJJBK/tKDcUI998jJJJJBC+QD9rGV8kJJJJBAVC+oEFCBC/kBZ+TJJJB8aCBHODNADtMBCBHOAItMBDNABAE9HMBAVCUADCDTGOADCffffI0eCBYD1+KJJBhJJJJBBGEbD+oEAVCEbD1DAEABAOZmJJJB8aKAVC+YEFCWFCBbDBAV9CB83I+YEAVC+YEFAEADAIAVC+oEFZ+NJJJBCUAICDTGRAICffffI0eGWCBYD1+KJJBhJJJJBBHOAVC+oEFAVYD1DGdCDTFAObDBAVAdCEFGQbD1DAOAVYD+YEGKARZmJJJBHXAVC+oEFAQCDTFADCI9uGMCBYD1+KJJBhJJJJBBGObDBAVAdCDFGRbD1DAOCBAMZ+TJJJBHpAVC+oEFARCDTFAWCBYD1+KJJBhJJJJBBGSbDBAVAdCIFGQbD1DAXHOASHRINARALiDBALAOYDBGWCWAWCW6eCDTFC/EBFiDBmuDBAOCLFHOARCLFHRAICUFGIMBKAVC+oEFAQCDTFCUAMCDTADCffff970eCBYD1+KJJBhJJJJBBGQbDBAVAdCLFbD1DDNADCI6MBAMCEAMCE0eHIAEHOAQHRINARASAOYDBCDTFiDBASAOCLFYDBCDTFiDBmASAOCWFYDBCDTFiDBmuDBAOCXFHOARCLFHRAICUFGIMBKKAVC/MBFHZAVYD+cEHhAVYD+gEHoAVHOCBHWCBHRCBHaCEHcINAOHxCIHqAEARCI2GlCDTFGOCWFYDBHkAOYDBHDABAaCX2FGICLFAOCLFYDBGdbDBAIADbDBAICWFAkbDBApARFCE86BBAZAkbDWAZAdbDLAZADbDBAQARCDTFCBbDBDNAWtMBCIHqAxHIINDNAIYDBGOADsMBAOAdsMBAOAksMBAZAqCDTFAObDBAqCEFHqKAICLFHIAWCUFGWMBKKAaCEFHaAXADCDTFGOAOYDBCUFbDBAXAdCDTFGOAOYDBCUFbDBAXAkCDTFGOAOYDBCUFbDBCBHWINAoAhAEAWAlFCDTFYDBCDTGIFYDBCDTFGkHOAKAIFGdYDBGDHIDNADtMBDNINAOYDBARsMEAOCLFHOAICUFGItMDXBKKAOADCDTAkFC98FYDBbDBAdAdYDBCUFbDBKAWCEFGWCI9HMBKDNDNDNAqtMBCUHRjBBBBHyCBHOINASAZAOCDTFYDBCDTGIFGWiDBH8aAWALCBAOCEFGdAOCS0eCDTFiDBALAXAIFYDBGOCWAOCW6eCDTFC/EBFiDBmGeuDBDNAKAIFYDBGWtMBAeA8a+THeAoAhAIFYDBCDTFHOAWCDTHIINAQAOYDBGWCDTFGDAeADiDBmG8auDBA8aAyAyA8a9dGDeHyAWARADeHRAOCLFHOAIC98FGIMBKKAdHOAdAq9HMBKARCU9HMEKAcAM9PMEINDNApAcFrBBMBAcHRXDKAMAcCEFGc9HMBXDKKAqCZAqCZ6eHWAZHOAxHZARCU9HMEKKAVYD1DHOKAOCDTAVC+oEFFC98FHRDNINAOtMEARYDBCBYD+E+KJJBh+BJJJBBARC98FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var A=p.charCodeAt(h);g[h]=A>96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h<p.length;++h)g[x++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,x)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g,h){var A=n.exports.sbrk,x=A(p.length*4),C=A(g*4),T=new Uint8Array(n.exports.memory.buffer),E=s(p);T.set(E,x),h&&h(x,x,p.length,g);var S=n.exports.meshopt_optimizeVertexFetchRemap(C,x,p.length,g);T=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(g);new Uint8Array(w.buffer).set(T.subarray(C,C+g*4)),E.set(T.subarray(x,x+p.length*4)),A(x-A(0));for(var D=0;D<p.length;++D)p[D]=w[p[D]];return[w,S]}function c(p,g,h,A,x){var C=n.exports.sbrk,T=C(g),E=C(A*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(h),E);var w=p(T,g,E,A,x),D=new Uint8Array(w);return D.set(S.subarray(T,T+w)),C(T-C(0)),D}function l(p){for(var g=0,h=0;h<p.length;++h){var A=p[h];g=g<A?A:g}return g}function f(p,g){if(o(g==2||g==4),g==4)return new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4);var h=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2);return new Uint32Array(h)}function d(p,g,h,A,x,C){var T=n.exports.sbrk,E=T(h*A),S=T(h*C),w=new Uint8Array(n.exports.memory.buffer);w.set(s(g),S),p(E,h,A,x,S);var D=new Uint8Array(h*A);return D.set(w.subarray(E,E+h*A)),T(E-T(0)),D}return{ready:i,supported:!0,reorderMesh:function(p,g,h){var A=g?h?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(p,l(p)+1,A)},encodeVertexBuffer:function(p,g,h){o(h>0&&h<=256),o(h%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,A,p,g,h)},encodeIndexBuffer:function(p,g,h){o(h==2||h==4),o(g%3==0);var A=f(p,h),x=n.exports.meshopt_encodeIndexBufferBound(g,l(A)+1);return c(n.exports.meshopt_encodeIndexBuffer,x,A,g,4)},encodeIndexSequence:function(p,g,h){o(h==2||h==4);var A=f(p,h),x=n.exports.meshopt_encodeIndexSequenceBound(g,l(A)+1);return c(n.exports.meshopt_encodeIndexSequence,x,A,g,4)},encodeGltfBuffer:function(p,g,h,A){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](p,g,h)},encodeFilterOct:function(p,g,h,A){return o(h==4||h==8),o(A>=1&&A<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,A,16)},encodeFilterQuat:function(p,g,h,A){return o(h==8),o(A>=4&&A<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,A,16)},encodeFilterExp:function(p,g,h,A){return o(h>0&&h%4==0),o(A>=1&&A<=24),d(n.exports.meshopt_encodeFilterExp,p,g,h,A,h)}}}();typeof n1=="object"&&typeof K5=="object"?K5.exports=jU:typeof define=="function"&&define.amd?define([],function(){return jU}):typeof n1=="object"?n1.MeshoptEncoder=jU:(typeof self<"u"?self:n1).MeshoptEncoder=jU});var Une=Jn((i1,J5)=>{var qU=function(){"use strict";var e="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+p8yQDBK/3SEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAQAE9PMEAdAEAQ9rAQAdFAE6eGKCSFGOCL4CIFCD4HXDNDNDNDNAOC9wgGMtMBCBHpCEHSAWCJDFHZALHhINARAh9rAX6MIDNARAhAXFGL9rCk6MBCZHOINAWCJ/CBFAOGIFGOC9wFHoDNDNDNDNDNAhAIC9wFGaCO4FrBBAaCI4COg4CIgpLBEDIBKAo9CB83IBAoCWF9CB83IBXIKAoALrBLALrBBGaCO4GcAcCIsGce86BBAOCgFALCLFAcFGorBBAaCL4CIgGcAcCIsGce86BBAOCvFAoAcFGorBBAaCD4CIgGcAcCIsGce86BBAOC7FAoAcFGorBBAaCIgGaAaCIsGae86BBAOCTFAoAaFGarBBALrBEGoCO4GcAcCIsGce86BBAOC91FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC4FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC93FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC94FAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOC95FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC96FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC97FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC98FAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOC99FAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOC9+FAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCUFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAoALrBWALrBBGaCL4GcAcCSsGce86BBAOCgFALCWFAcFGorBBAaCSgGaAaCSsGae86BBAOCvFAoAaFGorBBALrBEGaCL4GcAcCSsGce86BBAOC7FAoAcFGorBBAaCSgGaAaCSsGae86BBAOCTFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOC91FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC4FAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOC93FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC94FAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOC95FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC96FAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOC97FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC98FAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOC99FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC9+FAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCUFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAoAL8pBB83BBAoCWFALCWF8pBB83BBALCZFHLKDNAIAM9PMBAICZFHOARAL9rCl0MEKKAIAM6MIALtMIDNAKtMBAWApFrBBHoCBHOAZHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKKAZCEFHZApCEFGpAD6HSALHhApAD9HMEXVKKCBHLASCEgMDXIKALAXAD2FHcDNAKtMBCBHhCEHSAWCJDFHMINARAL9rAX6MIALtMDALAXFHLAWAhFrBBHoCBHOAMHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKAMCEFHMAhCEFGhAD6HSAhAD9HMBKAcHLXIKCBHOCEHSINARAL9rAX6MDALtMEALAXFHLAOCEFGOAD6HSADAO9HMBKAcHLXDKCBHLASCEgtMEKC9+HOXIKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aAKAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK/YZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBB/+9CAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI86BBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD86BBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjB/+fsAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI87EBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD87EBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK9MBDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCE91CJJJ/8IFCJJJ98g++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",t="B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBRl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBWL79iv9rBdQ/T9TQLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK/H8jLhUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHWCBHdINAdAE9PMEAWAEAd9rAdAWFAE6eGQCSFGOC9wgGKCI2HXAKCETHMAOCL4CIFCD4HpABAdAD2FHSCBHZDNINCEHhALHoCBHaDNINARAo9rAp6MIAVCJ/CBFAaAK2FHcAoApFHLCBHIDNAKC/AB6MBARAL9rC/gB6MBCBHOINAcAOFHIDNDNDNDNDNAoAOCO4FrBBGxCIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLBXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLBALCZFHLKDNDNDNDNDNAxCD4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLZXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLZALCZFHLKDNDNDNDNDNAxCL4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLAXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLAALCZFHLKDNDNDNDNDNAxCO4pLBEDIBKAIPXBBBBBBBBBBBBBBBBPKL8wXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCLFAyPqBFAxC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCWFAyPqBFAxC+Q+YJJBFrBBFHLXEKAIALPBBBPKL8wALCZFHLKAOC/ABFHIAOCJEFAK0MEAIHOARAL9rC/fB0MBKKDNDNAIAK9PMBAICI4HOINARAL9rCk6MDAcAIFHxDNDNDNDNDNAoAICO4FrBBAOCOg4CIgpLBEDIBKAxPXBBBBBBBBBBBBBBBBPKLBXIKAxALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAxALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAxALPBBBPKLBALCZFHLKAOCDFHOAICZFGIAK6MBKKALtMBAaCI6HhALHoAaCEFGOHaAOCLsMDXEKKCBHLAhCEgMDKDNAKtMBAVCJDFAZFHIAVAZFPBDBHyCBHxINAIAVCJ/CBFAxFGOPBLBGlCEP9tAlPXEEEEEEEEEEEEEEEEGqP9OP9hP9RGlAOAKFPBLBG8aCEP9tA8aAqP9OP9hP9RG8aPMBZEhDoIaLcVxOqRlGeAOAMFPBLBG3CEP9tA3AqP9OP9hP9RG3AOAXFPBLBG5CEP9tA5AqP9OP9hP9RG5PMBZEhDoIaLcVxOqRlG8ePMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIAyP9uGyP9aDBBAIADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAeA8ePMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWkdyQ8aKeX3M5p8eS8fGlA3A5PMWkdyQ8aKeX3M5p8eS8fG8aPMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFHIAxCZFGxAK6MBKKAZCLFGZAD6MBKASAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBAQAdFHdC9+HOALMEXIKKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK/UZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+epLIUO97EUE978jJJJJBCA9rHIDNDNADCL9HMBDNAEC98gGLtMBCBHVABHDINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKLBKALAIAD/8QBBSKDNAEC98gGXtMBCBHVABHDINADCZFGLALPBBBGOPXBBBBBBffBBBBBBffGKP9OADPBBBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKBBADAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKBBADCAFHDAVCLFGVAX6MBKKAXAE9PMBAIAECIgGVCITGDFCBCAAD9r/8KBAIABAXCITFGLAD/8QBBDNAVtMBAIAIPBLZGOPXBBBBBBffBBBBBBffGKP9OAIPBLBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKLZAIAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKLBKALAIAD/8QBBKK/4WLLUE97EUV978jJJJJBC8w9rHIDNAEC98gGLtMBCBHVABHOINAIAOPBBBGRAOCZFGWPBBBGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLBAOPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLBPeB+t+J83IBAOCWFARP5EAIPBLBPeE+t+J83IBAWAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLBPeD+t+J83IBAOCkFAKP5EAIPBLBPeI+t+J83IBAOCAFHOAVCLFGVAL6MBKKDNALAE9PMBAIAECIgGVCITGOFCBCAAO9r/8KBAIABALCITFGWAO/8QBBDNAVtMBAIAIPBLBGRAIPBLZGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLAAIPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLAPeB+t+J83IBAIARP5EAIPBLAPeE+t+J83IWAIAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLAPeD+t+J83IZAIAKP5EAIPBLAPeI+t+J83IkKAWAIAO/8QBBKK+pDDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=e;WebAssembly.validate(n)&&(r=t);var o,s=WebAssembly.instantiate(a(r),{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function a(d){for(var p=new Uint8Array(d.length),g=0;g<d.length;++g){var h=d.charCodeAt(g);p[g]=h>96?h-71:h>64?h-65:h>47?h+4:h>46?63:62}for(var A=0,g=0;g<d.length;++g)p[A++]=p[g]<60?i[p[g]]:(p[g]-60)*64+p[++g];return p.buffer.slice(0,A)}function c(d,p,g,h,A,x){var C=o.exports.sbrk,T=g+3&-4,E=C(T*h),S=C(A.length),w=new Uint8Array(o.exports.memory.buffer);w.set(A,S);var D=d(E,g,h,S,A.length);if(D==0&&x&&x(E,T,h),p.set(w.subarray(E,E+g*h)),C(E-C(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var l={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:s,supported:!0,decodeVertexBuffer:function(d,p,g,h,A){c(o.exports.meshopt_decodeVertexBuffer,d,p,g,h,o.exports[l[A]])},decodeIndexBuffer:function(d,p,g,h){c(o.exports.meshopt_decodeIndexBuffer,d,p,g,h)},decodeIndexSequence:function(d,p,g,h){c(o.exports.meshopt_decodeIndexSequence,d,p,g,h)},decodeGltfBuffer:function(d,p,g,h,A,x){c(o.exports[f[A]],d,p,g,h,o.exports[l[x]])}}}();typeof i1=="object"&&typeof J5=="object"?J5.exports=qU:typeof define=="function"&&define.amd?define([],function(){return qU}):typeof i1=="object"?i1.MeshoptDecoder=qU:(typeof self<"u"?self:i1).MeshoptDecoder=qU});var Vne=Jn((r1,Z5)=>{var YU=function(){"use strict";var e="B9h79tEBBBECd9gEUEU9gEUB9gBB9gQUUUUUUU99UUEU9gVUUUUUB9gLUUUUE999gIUUUE999gLUUUUEU9gIUUUEUIMXDILVORBWWBEWLVE9wEIIVIEBEOWEUECJ/JEKR7OO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BBZ9tw79o9v9wT9f79p9t9w29p9m95BEx9tw79o9v9wT9f79p9t9w29p9m959T9j9h2wBLA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBVL79iv9rBOdWEBCEKDdQQ+stXDBK/48yIkUp99hU8jJJJJBCJ/BB9rGQ8kJJJJBAQCkFCBC/kBZ1JJJB8aCUALCDTGKALCffffI0eGXCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQAMbDWAQApCEFbD94AXCBYD/s1JJBhJJJJBBHSAQCkFAQYD94GpCDTFASbDBAQASbDXAQApCEFbD94CUADCITADCffffE0eCBYD/s1JJBhJJJJBBHZAQCkFAQYD94GpCDTFAZbDBAQAZbDZAQApCEFbD94AQCWFAEADALCBZ+CJJJBAXCBYD/s1JJBhJJJJBBHhAQCkFAQYD94GpCDTFAhbDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHoAQCkFAQYD94GpCDTFAobDBAQApCEFbD94ALCD4ALFHaCEHcINAcGpCETHcApAa6MBKCBHxCUApCDTGaApCffffI0eCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94AcCfEAaZ1JJJBHlDNALtMBAVCD4HkApCUFHqINAIAxAk2CDTFGyYDLGpCh4Ap7C+f+B+dd2AyYDBGpCh4Ap7C/d/o+b8j27AyYDWGpCh4Ap7C+3f/n8n27HaCBHpDNDNINAlAaAqgGaCDTFG8aYDBGcCUsMEAIAcAk2CDTFAyCXZ+LJJJBtMDApCEFGpAaFHaApAq9NMBXDKKA8aAxbDBAxHcKAhAxCDTFAcbDBAxCEFGxAL9HMBKCBHpAoHcINAcApbDBAcCLFHcALApCEFGp9HMBKCBHpAhHcAoHaINDNApAcYDBGqsMBAaAoAqCDTFGqYDBbDBAqApbDBKAcCLFHcAaCLFHaALApCEFGp9HMBKKCBHaALCBYD/s1JJBhJJJJBBHyAQCkFAQYD94GpCDTFAybDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GcCDTFApbDBAQAcCEFbD94AXCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94ApCfEAKZ1JJJBHeAcCfEAKZ1JJJBH3DNALtMBAZCWFH5INDNAMAaCDTGpFYDBG8etMBAZASApFYDBCITFH8fA3ApFHAAeApFHxCBHkINDNDNA8fAkCITFYDBGlAa9HMBAxAabDBAAAabDBXEKDNAMAlCDTGKFYDBGHtMBAZASAKFYDBCITGpFYDBAasMEAHCUFH8aA5ApFHcCBHpINA8aApsMEApCEFHpAcYDBHqAcCWFHcAqAa9HMBKApAH6MEKA3AKFGpAaAlApYDBCUsebDBAxAlAaAxYDBCUsebDBKAkCEFGkA8e9HMBKKAaCEFGaAL9HMBKAhHcAoHaA3HqAeHkCBHpINDNDNApAcYDBG8a9HMBDNApAaYDBG8a9HMBAkYDBH8aDNAqYDBGlCU9HMBA8aCU9HMBAyApFCB86BBXIKAyApFHxDNApAlsMBApA8asMBAxCE86BBXIKAxCL86BBXDKDNApAoA8aCDTGlFYDB9HMBDNAqYDBGxCUsMBApAxsMBAkYDBGKCUsMBApAKsMBA3AlFYDBG8eCUsMBA8eA8asMBAeAlFYDBGlCUsMBAlA8asMBDNAhAxCDTFYDBAhAlCDTFYDB9HMBAhAKCDTFYDBAhA8eCDTFYDB9HMBAyApFCD86BBXLKAyApFCL86BBXIKAyApFCL86BBXDKAyApFCL86BBXEKAyApFAyA8aFrBB86BBKAcCLFHcAaCLFHaAqCLFHqAkCLFHkALApCEFGp9HMBKAWCEgtMBAyHpALHcINDNAprBBCE9HMBApCL86BBKApCEFHpAcCUFGcMBKKCBHkCUALCX2ALC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQApCEFbD94AMAIALAVZ+DJJJB8aCUALC8s2GcALC/d/o/F8u0eCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GaCDTFApbDBAQAaCEFbD94ApCBAcZ1JJJBHZDNADtMBAEHcINDNAMAcCLFYDBG8aCX2FGpiDBAMAcYDBGlCX2FGaiDBGG+TG8jAMAcCWFYDBGxCX2FGqCLFiDBAaCLFiDBG8k+TG8lnAqiDBAG+TG8mApCLFiDBA8k+TG8nn+TGYAYnA8nAqCWFiDBAaCWFiDBG8p+TGinA8lApCWFiDBA8p+TG8nn+TG8lA8lnA8nA8mnAiA8jn+TG8jA8jnmm+RG8mjBBBB9etMBAYA8m+VHYA8jA8m+VH8jA8lA8m+VH8lKAZAhAlCDTFYDBC8s2FGpA8lA8m+RG8mA8lnnG8nApiDBmuDBApA8jA8mA8jnG8rnGiApiDLmuDLApAYA8mAYnG8snGrApiDWmuDWApA8rA8lnG8rApiDXmuDXApA8sA8lnG8uApiDZmuDZApA8sA8jnG8sApiDcmuDcApA8lA8mAYA8pnA8lAGnA8kA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApAYAGnGYApiDAmuDAApAGA8knGGApiD8kmuD8kApA8mApiDYmuDYAZAhA8aCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAZAhAxCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAcCXFHcAkCIFGkAD6MBKCBH8aAEHxINCBHcINAyAEAcC+81JJBFYDBGlA8aFCDTFYDBGaFrBBHpDNDNAyAxAcFYDBGqFrBBGkC99FCfEgCPE0MBApCEsMBApCD9HMEKDNAkCUFCfEgCE0MBAeAqCDTFYDBAa9HMEKDNApCUFCfEgCE0MBA3AaCDTFYDBAq9HMEKDNAkCV2ApFC+g1JJBFrBBtMBAhAaCDTFYDBAhAqCDTFYDB0MEKjBBACjBBJzApCEseH8mAkCEsHKAEAlCDTC+81JJBFYDBA8aFCDTFYDBHlDNAMAaCX2FGpCWFiDBAMAqCX2FGkCWFiDBG8k+TG8lA8lnApiDBAkiDBG8p+TG8jA8jnApCLFiDBAkCLFiDBG8n+TGYAYnmm+RGGjBBBB9etMBA8lAG+VH8lAYAG+VHYA8jAG+VH8jKjBBACA8mAKeH8sDNAMAlCX2FGpiDWA8k+TG8mA8lA8mA8lnApiDBA8p+TGrA8jnAYApiDLA8n+TG8rnmmGin+TG8mA8mnArA8jAin+TG8lA8lnA8rAYAin+TG8jA8jnmm+RGYjBBBB9etMBA8mAY+VH8mA8jAY+VH8jA8lAY+VH8lKAZAhAqCDTFYDBC8s2FGpA8lA8sAGnGYA8lnnGiApiDBmuDBApA8jAYA8jnG8snGrApiDLmuDLApA8mAYA8mnGGnG8rApiDWmuDWApA8sA8lnG8sApiDXmuDXApAGA8lnG8uApiDZmuDZApAGA8jnG8vApiDcmuDcApA8lAYA8mA8knA8lA8pnA8nA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApA8mAGnG8mApiDAmuDAApAGA8knGGApiD8kmuD8kApAYApiDYmuDYAZAhAaCDTFYDBC8s2FGpAiApiDBmuDBApArApiDLmuDLApA8rApiDWmuDWApA8sApiDXmuDXApA8uApiDZmuDZApA8vApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApA8mApiDAmuDAApAGApiD8kmuD8kApAYApiDYmuDYKAcCLFGcCX9HMBKAxCXFHxA8aCIFG8aAD6MBKKDNABAEsMBABAEADCDTZ+HJJJB8aKCUADCX2ADC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHAAQCkFAQYD94GpCDTFAAbDBAQApCEFbD94CUADCDTADCffffI0eCBYD/s1JJBhJJJJBBH5AQCkFAQYD94GpCDTFA5bDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHIAQCkFAQYD94GpCDTFAIbDBAQApCEFbD94ALCBYD/s1JJBhJJJJBBH8wAQCkFAQYD94GpCDTFA8wbDBAQApCEFbD94jBBBBHrDNADAO9NMBARARnH8sAACWFH8xAQYDZH8yAQYDXH8zAQYDWH80jBBBBHrINAQCWFABADGSALAhZ+CJJJBCBHHABHxCBHKINCBHpINDNAhAxApFYDBGaCDTGEFYDBGkAhABApC+81JJBFYDBAKFCDTFYDBGcCDTFYDBG8asMBAyAcFrBBGlCV2AyAaFrBBGqFC/Q1JJBFrBBGDAqCV2AlFG8eC/Q1JJBFrBBG8fvCfEgtMBDNA8eC+g1JJBFrBBtMBA8aAk0MEKDNAqAl9HMBAqCUFCfEgCE0MBAeAEFYDBAc9HMEKAAAHCX2FGqAcAaA8fCfEgGkebDLAqAaAcAkebDBAqADA8fgCfEgCB9HbDWAHCEFHHKApCLFGpCX9HMBKAxCXFHxAKCIFGKAS6MBKDNDNAHtMBAAHcAHH8aINAcCWFGljBBBBjBBJzAZAhAcYDBGaCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAcCLFGEYDBGqCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnGYjBBBBjBBJzAZAhAqAaAlYDBGkeGlCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAaAqAkeGxCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnG8lAYA8l9fGpeuDBAEAqAxApebDBAcAaAlApebDBAcCXFHcA8aCUFG8aMBKAQCJEFCBCJ/ABZ1JJJB8aA8xHpAHHcINAQCJEFApYDBCo4C/8zgFGaAaYDBCEFbDBApCXFHpAcCUFGcMBKCBHpCBHcINAQCJEFApFGaYDBHqAaAcbDBAqAcFHcApCLFGpCJ/AB9HMBKCBHpA8xHcINAQCJEFAcYDBCo4C/8zgFGaAaYDBGaCEFbDBA5AaCDTFApbDBAcCXFHcAHApCEFGp9HMBKASAO9rGaCI9uH81DNALtMBCBHpAIHcINAcApbDBAcCLFHcALApCEFGp9HMBKKCBHbA8wCBALZ1JJJBH83AaCo9uHuA81CE4H85CBH86CBHKDNINAAA5AKCDTFYDBCX2FGxiDWG8jA8s9eMEA86A819PMEjffUUH8lDNA85AH9PMBAAA5A85CDTFYDBCX2FiDWjBB/AznH8lKDNA8jA8l9etMBA86Au0MDKDNA83AhAxYDLG87CDTG88FYDBGaFG89rBBA83AhAxYDBGECDTG8+FYDBGzFGNrBBvMBDNA80AzCDTGpFYDBGqtMBA8yA8zApFYDBCITFHpAMAaCX2FG8eCWFHDA8eCLFHXAMAzCX2FG8fCWFHVA8fCLFHWCBHcCEHlDNINDNAIApYDBCDTFYDBGkAasMBAIApCLFYDBCDTFYDBG8aAasMBAMA8aCX2FG8aiDBAMAkCX2FGkiDBG8m+TG8lAWiDBAkCLFiDBGY+TGGnA8fiDBA8m+TG8kA8aCLFiDBAY+TG8jn+TA8lAXiDBAY+TG8pnA8eiDBA8m+TG8nA8jn+TnA8jAViDBAkCWFiDBGY+TGinAGA8aCWFiDBAY+TG8mn+TA8jADiDBAY+TGYnA8pA8mn+TnA8mA8knAiA8ln+TA8mA8nnAYA8ln+TnmmjBBBB9dMDKApCWFHpAcCEFGcAq6HlAqAc9HMBKKAlCEgtMBA85CEFH85XEKAxCWFHqAZAaC8s2FGpAZAzC8s2FGciDBApiDBmuDBApAciDLApiDLmuDLApAciDWApiDWmuDWApAciDXApiDXmuDXApAciDZApiDZmuDZApAciDcApiDcmuDcApAciDkApiDkmuDkApAciD3ApiD3muD3ApAciDAApiDAmuDAApAciD8kApiD8kmuD8kApAciDYApiDYmuDYDNDNDNDNAyAEFGcrBBC9+FpDEBDKAEHpINAIApCDTGpFAabDBAoApFYDBGpAE9HMBXIKKAoA88FYDBHpAoA8+FYDBHEAIA8+FA87bDBApH87KAIAECDTFA87bDBKANCE86BBA89CE86BBAqiDBG8lArArA8l9deHrAbCEFHbCECDAcrBBCEseA86FH86KAKCEFGKAH9HMBKKAbtMBDNALtMBCBHcAeHpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBAeAqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKCBHcA3HpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBA3AqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKKCBHDABHpCBHkINDNAIApYDBCDTFYDBGcAIApCLFYDBCDTFYDBGasMBAcAIApCWFYDBCDTFYDBGqsMBAaAqsMBABADCDTFG8aAcbDBA8aCLFAabDBA8aCWFAqbDBADCIFHDKApCXFHpAkCIFGkAS9PMDXBKKASHDXDKADAO0MBKKDNAdtMBAdAr+RuDBKAQYD94GpCDTAQCkFFC98FHhDNINAptMEAhYDBCBYD/w1JJBh+BJJJBBAhC98FHhApCUFHpXBKKAQCJ/BBF8kJJJJBADK/PLEOUABYDBCBAICDTZ1JJJB8aADCI9uHVDNADtMBABYDBHODNALtMBAEHRADHWINAOALARYDBCDTFYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBXDKKAEHRADHWINAOARYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBKKDNAItMBABYDBHRABYDLHWCBHdAIHOINAWAdbDBAWCLFHWARYDBAdFHdARCLFHRAOCUFGOMBKKDNADCI6MBAVCEAVCE0eHQABYDLHVABYDWHRINAECWFYDBHWAECLFYDBHdAEYDBHODNALtMBALAWCDTFYDBHWALAdCDTFYDBHdALAOCDTFYDBHOKARAVAOCDTFGDYDBCITFAdbDBARADYDBCITFAWbDLADADYDBCEFbDBARAVAdCDTFGDYDBCITFAWbDBARADYDBCITFAObDLADADYDBCEFbDBARAVAWCDTFGWYDBCITFAObDBARAWYDBCITFAdbDLAWAWYDBCEFbDBAECXFHEAQCUFGQMBKKDNAItMBABYDLHRABYDBHWINARARYDBAWYDB9rbDBAWCLFHWARCLFHRAICUFGIMBKKK+3LDOUV998jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNADtMBAICD4HVDNABtMBAVCDTHOCBHRAEHWINABARCX2FGIAEARAV2CDTFGdiDBuDBAIAdiDLuDLAIAdiDWuDWCBHIINALCZFAIFGdAWAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAWAOFHWARCEFGRAD9HMBXDKKAVCDTHRCBHWINCBHIINALCZFAIFGdAEAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAEARFHEAWCEFGWAD9HMBKKALiDBALiDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var A=p.charCodeAt(h);g[h]=A>96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h<p.length;++h)g[x++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,x)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g){var h=n.exports.sbrk,A=h(p.length*4),x=h(g*4),C=new Uint8Array(n.exports.memory.buffer),T=s(p);C.set(T,A);var E=n.exports.meshopt_optimizeVertexFetchRemap(x,A,p.length,g);C=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(g);new Uint8Array(S.buffer).set(C.subarray(x,x+g*4)),T.set(C.subarray(A,A+p.length*4)),h(A-h(0));for(var w=0;w<p.length;++w)p[w]=S[p[w]];return[S,E]}function c(p){for(var g=0,h=0;h<p.length;++h){var A=p[h];g=g<A?A:g}return g}function l(p,g,h,A,x,C,T,E,S){var w=n.exports.sbrk,D=w(4),M=w(h*4),O=w(x*C),B=w(h*4),L=new Uint8Array(n.exports.memory.buffer);L.set(s(A),O),L.set(s(g),B);var _=p(M,B,h,O,x,C,T,E,S,D);L=new Uint8Array(n.exports.memory.buffer);var b=new Uint32Array(_);s(b).set(L.subarray(M,M+_*4));var v=new Float32Array(1);return s(v).set(L.subarray(D,D+4)),w(D-w(0)),[b,v[0]]}function f(p,g,h,A){var x=n.exports.sbrk,C=x(h*A),T=new Uint8Array(n.exports.memory.buffer);T.set(s(g),C);var E=p(C,h,A);return x(C-x(0)),E}var d={LockBorder:1};return{ready:i,supported:!0,compactMesh:function(p){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0);var g=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return a(g,c(p)+1)},simplify:function(p,g,h,A,x,C){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0),o(g instanceof Float32Array),o(g.length%h==0),o(h>=3),o(A%3==0);for(var T=0,E=0;E<(C?C.length:0);++E)T|=d[C[E]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),w=l(n.exports.meshopt_simplify,S,p.length,g,g.length,h*4,A,x,T);return w[0]=p instanceof Uint32Array?w[0]:new p.constructor(w[0]),w},getScale:function(p,g){return o(p instanceof Float32Array),o(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length,g*4)}}}();typeof r1=="object"&&typeof Z5=="object"?Z5.exports=YU:typeof define=="function"&&define.amd?define([],function(){return YU}):typeof r1=="object"?r1.MeshoptSimplifier=YU:(typeof self<"u"?self:r1).MeshoptSimplifier=YU});var zne=Jn((TXt,kne)=>{var vLe=Fne(),wLe=Une(),DLe=Vne();kne.exports={MeshoptEncoder:vLe,MeshoptDecoder:wLe,MeshoptSimplifier:DLe}});var cse=Jn((bgn,ase)=>{ase.exports=CGe;function CGe(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}});var dse=Jn((Sgn,fse)=>{"use strict";var TGe=cse();fse.exports=EGe;var vM=1e20;function EGe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,l,f,d,p,g,h,A;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(l=c,c=Array(o*s),h=0,A=l.length;h<A;h++)c[h]=l[h*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var x=Array(o*s),C=Array(o*s),T=Array(a),E=Array(a),S=Array(a+1),w=Array(a);for(h=0,A=o*s;h<A;h++){var D=c[h];x[h]=D===1?0:D===0?vM:Math.pow(Math.max(0,.5-D),2),C[h]=D===1?vM:D===0?0:Math.pow(Math.max(0,D-.5),2)}lse(x,o,s,T,E,w,S),lse(C,o,s,T,E,w,S);var M=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(h=0,A=o*s;h<A;h++)M[h]=TGe(1-((x[h]-C[h])/i+n),0,1);return M}function lse(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(use(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(use(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function use(e,t,n,i,r){n[0]=0,i[0]=-vM,i[1]=+vM;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+vM}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var gse=Jn((Hgn,DV)=>{function BGe(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,l=9,f=10,d=11,p=12,g=13,h=14,A=15,x=16,C=17,T=0,E=1,S=2,w=3,D=4;function M(_,b){return 55296<=_.charCodeAt(b)&&_.charCodeAt(b)<=56319&&56320<=_.charCodeAt(b+1)&&_.charCodeAt(b+1)<=57343}function O(_,b){b===void 0&&(b=0);var v=_.charCodeAt(b);if(55296<=v&&v<=56319&&b<_.length-1){var I=v,R=_.charCodeAt(b+1);return 56320<=R&&R<=57343?(I-55296)*1024+(R-56320)+65536:I}if(56320<=v&&v<=57343&&b>=1){var I=_.charCodeAt(b-1),R=v;return 55296<=I&&I<=56319?(I-55296)*1024+(R-56320)+65536:R}return v}function B(_,b,v){var I=[_].concat(b).concat([v]),R=I[I.length-2],F=v,k=I.lastIndexOf(h);if(k>1&&I.slice(1,k).every(function(U){return U==i})&&[i,g,C].indexOf(_)==-1)return S;var V=I.lastIndexOf(r);if(V>0&&I.slice(1,V).every(function(U){return U==r})&&[p,r].indexOf(R)==-1)return I.filter(function(U){return U==r}).length%2==1?w:D;if(R==e&&F==t)return T;if(R==n||R==e||R==t)return F==h&&b.every(function(U){return U==i})?S:E;if(F==n||F==e||F==t)return E;if(R==s&&(F==s||F==a||F==l||F==f))return T;if((R==l||R==a)&&(F==a||F==c))return T;if((R==f||R==c)&&F==c)return T;if(F==i||F==A)return T;if(F==o)return T;if(R==p)return T;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,C].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(U){return U==i})&&F==h||R==A&&[x,C].indexOf(F)!=-1?T:b.indexOf(r)!=-1?S:R==r&&F==r?T:E}this.nextBreak=function(_,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=_.length-1)return _.length;for(var v=L(O(_,b)),I=[],R=b+1;R<_.length;R++)if(!M(_,R-1)){var F=L(O(_,R));if(B(v,I,F))return R;I.push(F)}return _.length},this.splitGraphemes=function(_){for(var b=[],v=0,I;(I=this.nextBreak(_,v))<_.length;)b.push(_.slice(v,I)),v=I;return v<_.length&&b.push(_.slice(v)),b},this.iterateGraphemes=function(_){var b=0,v={next:function(){var I,R;return(R=this.nextBreak(_,b))<_.length?(I=_.slice(b,R),b=R,{value:I,done:!1}):b<_.length?(I=_.slice(b),b=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(_){for(var b=0,v=0,I;(I=this.nextBreak(_,v))<_.length;)v=I,b++;return v<_.length&&b++,b};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?l:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?A:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?x:128102<=_&&_<=128105?C:d}return this}typeof DV<"u"&&DV.exports&&(DV.exports=BGe)});var $se=Jn((PCn,g9)=>{"use strict";g9.exports=LV;g9.exports.default=LV;function LV(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,o=Jse(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;var a,c,l,f,d,p,g;if(i&&(o=U5e(e,t,o,n)),e.length>80*n){a=l=e[0],c=f=e[1];for(var h=n;h<r;h+=n)d=e[h],p=e[h+1],d<a&&(a=d),p<c&&(c=p),d>l&&(l=d),p>f&&(f=p);g=Math.max(l-a,f-c),g=g!==0?32767/g:0}return JM(o,s,n,a,c,g,0),s}function Jse(e,t,n,i,r){var o,s;if(r===_9(e,t,n,i)>0)for(o=t;o<n;o+=i)s=Kse(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=Kse(o,e[o],e[o+1],s);return s&&NV(s,s.next)&&(QM(s),s=s.next),s}function QA(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(NV(n,n.next)||wo(n.prev,n,n.next)===0)){if(QM(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function JM(e,t,n,i,r,o,s){if(e){!s&&o&&G5e(e,i,r,o);for(var a=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,o?L5e(e,i,r,o):B5e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),QM(e),e=l.next,a=l.next;continue}if(e=l,e===a){s?s===1?(e=N5e(QA(e),t,n),JM(e,t,n,i,r,o,2)):s===2&&F5e(e,t,n,i,r,o):JM(QA(e),t,n,i,r,o,1);break}}}}function B5e(e){var t=e.prev,n=e,i=e.next;if(wo(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,l=i.y,f=r<o?r<s?r:s:o<s?o:s,d=a<c?a<l?a:l:c<l?c:l,p=r>o?r>s?r:s:o>s?o:s,g=a>c?a>l?a:l:c>l?c:l,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&yE(r,a,o,c,s,l,h.x,h.y)&&wo(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function L5e(e,t,n,i){var r=e.prev,o=e,s=e.next;if(wo(r,o,s)>=0)return!1;for(var a=r.x,c=o.x,l=s.x,f=r.y,d=o.y,p=s.y,g=a<c?a<l?a:l:c<l?c:l,h=f<d?f<p?f:p:d<p?d:p,A=a>c?a>l?a:l:c>l?c:l,x=f>d?f>p?f:p:d>p?d:p,C=h9(g,h,t,n,i),T=h9(A,x,t,n,i),E=e.prevZ,S=e.nextZ;E&&E.z>=C&&S&&S.z<=T;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&yE(a,f,c,d,l,p,E.x,E.y)&&wo(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&yE(a,f,c,d,l,p,S.x,S.y)&&wo(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=C;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&yE(a,f,c,d,l,p,E.x,E.y)&&wo(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&yE(a,f,c,d,l,p,S.x,S.y)&&wo(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function N5e(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!NV(r,o)&&Zse(r,i,i.next,o)&&ZM(r,o)&&ZM(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),QM(i),QM(i.next),i=e=o),i=i.next}while(i!==e);return QA(i)}function F5e(e,t,n,i,r,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&q5e(s,a)){var c=Qse(s,a);s=QA(s,s.next),c=QA(c,c.next),JM(s,t,n,i,r,o,0),JM(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function U5e(e,t,n,i){var r=[],o,s,a,c,l;for(o=0,s=t.length;o<s;o++)a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,l=Jse(e,a,c,i,!1),l===l.next&&(l.steiner=!0),r.push(j5e(l));for(r.sort(V5e),o=0;o<r.length;o++)n=k5e(r[o],n);return n}function V5e(e,t){return e.x-t.x}function k5e(e,t){var n=z5e(e,t);if(!n)return t;var i=Qse(n,e);return QA(i,i.next),QA(n,n.next)}function z5e(e,t){var n=t,i=e.x,r=e.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>o&&(o=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,l=s.x,f=s.y,d=1/0,p;n=s;do i>=n.x&&n.x>=l&&i!==n.x&&yE(r<f?i:o,r,l,f,r<f?o:i,r,n.x,n.y)&&(p=Math.abs(r-n.y)/(i-n.x),ZM(n,e)&&(p<d||p===d&&(n.x>s.x||n.x===s.x&&H5e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function H5e(e,t){return wo(e.prev,e,t.prev)<0&&wo(t.next,e,e.next)<0}function G5e(e,t,n,i){var r=e;do r.z===0&&(r.z=h9(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,W5e(r)}function W5e(e){var t,n,i,r,o,s,a,c,l=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<l&&(a++,i=i.nextZ,!!i);t++);for(c=l;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return e}function h9(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function j5e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function yE(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function q5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Y5e(e,t)&&(ZM(e,t)&&ZM(t,e)&&X5e(e,t)&&(wo(e.prev,e,t.prev)||wo(e,t.prev,t))||NV(e,t)&&wo(e.prev,e,e.next)>0&&wo(t.prev,t,t.next)>0)}function wo(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function NV(e,t){return e.x===t.x&&e.y===t.y}function Zse(e,t,n,i){var r=BV(wo(e,t,n)),o=BV(wo(e,t,i)),s=BV(wo(n,i,e)),a=BV(wo(n,i,t));return!!(r!==o&&s!==a||r===0&&RV(e,n,t)||o===0&&RV(e,i,t)||s===0&&RV(n,e,i)||a===0&&RV(n,t,i))}function RV(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function BV(e){return e>0?1:e<0?-1:0}function Y5e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Zse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function ZM(e,t){return wo(e.prev,e,e.next)<0?wo(e,t,e.next)>=0&&wo(e,e.prev,t)>=0:wo(e,t,e.prev)<0||wo(e,e.next,t)<0}function X5e(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Qse(e,t){var n=new p9(e.i,e.x,e.y),i=new p9(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Kse(e,t,n,i){var r=new p9(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function QM(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function p9(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}LV.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(_9(e,0,o,n));if(r)for(var a=0,c=t.length;a<c;a++){var l=t[a]*n,f=a<c-1?t[a+1]*n:e.length;s-=Math.abs(_9(e,l,f,n))}var d=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,g=i[a+1]*n,h=i[a+2]*n;d+=Math.abs((e[p]-e[h])*(e[g+1]-e[p+1])-(e[p]-e[g])*(e[h+1]-e[p+1]))}return s===0&&d===0?0:Math.abs((d-s)/s)};function _9(e,t,n,i){for(var r=0,o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}LV.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var s=0;s<t;s++)n.vertices.push(e[r][o][s]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}});var yfe=Jn((YW,XW)=>{(function(e,t){typeof YW=="object"&&typeof XW<"u"?XW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(YW,function(){"use strict";function e(E,S,w,D,M){t(E,S,w||0,D||E.length-1,M||i)}function t(E,S,w,D,M){for(;D>w;){if(D-w>600){var O=D-w+1,B=S-w+1,L=Math.log(O),_=.5*Math.exp(2*L/3),b=.5*Math.sqrt(L*_*(O-_)/O)*(B-O/2<0?-1:1),v=Math.max(w,Math.floor(S-B*_/O+b)),I=Math.min(D,Math.floor(S+(O-B)*_/O+b));t(E,S,v,I,M)}var R=E[S],F=w,k=D;for(n(E,w,S),M(E[D],R)>0&&n(E,w,D);F<k;){for(n(E,F,k),F++,k--;M(E[F],R)<0;)F++;for(;M(E[k],R)>0;)k--}M(E[w],R)===0?n(E,w,k):(k++,n(E,k,D)),k<=S&&(w=k+1),S<=k&&(D=k-1)}}function n(E,S,w){var D=E[S];E[S]=E[w],E[w]=D}function i(E,S){return E<S?-1:E>S?1:0}var r=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(S){var w=this.data,D=[];if(!x(S,w))return D;for(var M=this.toBBox,O=[];w;){for(var B=0;B<w.children.length;B++){var L=w.children[B],_=w.leaf?M(L):L;x(S,_)&&(w.leaf?D.push(L):A(S,_)?this._all(L,D):O.push(L))}w=O.pop()}return D},r.prototype.collides=function(S){var w=this.data;if(!x(S,w))return!1;for(var D=[];w;){for(var M=0;M<w.children.length;M++){var O=w.children[M],B=w.leaf?this.toBBox(O):O;if(x(S,B)){if(w.leaf||A(S,B))return!0;D.push(O)}}w=D.pop()}return!1},r.prototype.load=function(S){if(!(S&&S.length))return this;if(S.length<this._minEntries){for(var w=0;w<S.length;w++)this.insert(S[w]);return this}var D=this._build(S.slice(),0,S.length-1,0);if(!this.data.children.length)this.data=D;else if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var M=this.data;this.data=D,D=M}this._insert(D,this.data.height-D.height-1,!0)}return this},r.prototype.insert=function(S){return S&&this._insert(S,this.data.height-1),this},r.prototype.clear=function(){return this.data=C([]),this},r.prototype.remove=function(S,w){if(!S)return this;for(var D=this.data,M=this.toBBox(S),O=[],B=[],L,_,b;D||O.length;){if(D||(D=O.pop(),_=O[O.length-1],L=B.pop(),b=!0),D.leaf){var v=o(S,D.children,w);if(v!==-1)return D.children.splice(v,1),O.push(D),this._condense(O),this}!b&&!D.leaf&&A(D,M)?(O.push(D),B.push(L),L=0,_=D,D=D.children[0]):_?(L++,D=_.children[L],b=!1):D=null}return this},r.prototype.toBBox=function(S){return S},r.prototype.compareMinX=function(S,w){return S.minX-w.minX},r.prototype.compareMinY=function(S,w){return S.minY-w.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(S){return this.data=S,this},r.prototype._all=function(S,w){for(var D=[];S;)S.leaf?w.push.apply(w,S.children):D.push.apply(D,S.children),S=D.pop();return w},r.prototype._build=function(S,w,D,M){var O=D-w+1,B=this._maxEntries,L;if(O<=B)return L=C(S.slice(w,D+1)),s(L,this.toBBox),L;M||(M=Math.ceil(Math.log(O)/Math.log(B)),B=Math.ceil(O/Math.pow(B,M-1))),L=C([]),L.leaf=!1,L.height=M;var _=Math.ceil(O/B),b=_*Math.ceil(Math.sqrt(B));T(S,w,D,b,this.compareMinX);for(var v=w;v<=D;v+=b){var I=Math.min(v+b-1,D);T(S,v,I,_,this.compareMinY);for(var R=v;R<=I;R+=_){var F=Math.min(R+_-1,I);L.children.push(this._build(S,R,F,M-1))}}return s(L,this.toBBox),L},r.prototype._chooseSubtree=function(S,w,D,M){for(;M.push(w),!(w.leaf||M.length-1===D);){for(var O=1/0,B=1/0,L=void 0,_=0;_<w.children.length;_++){var b=w.children[_],v=d(b),I=g(S,b)-v;I<B?(B=I,O=v<O?v:O,L=b):I===B&&v<O&&(O=v,L=b)}w=L||w.children[0]}return w},r.prototype._insert=function(S,w,D){var M=D?S:this.toBBox(S),O=[],B=this._chooseSubtree(M,this.data,w,O);for(B.children.push(S),c(B,M);w>=0&&O[w].children.length>this._maxEntries;)this._split(O,w),w--;this._adjustParentBBoxes(M,O,w)},r.prototype._split=function(S,w){var D=S[w],M=D.children.length,O=this._minEntries;this._chooseSplitAxis(D,O,M);var B=this._chooseSplitIndex(D,O,M),L=C(D.children.splice(B,D.children.length-B));L.height=D.height,L.leaf=D.leaf,s(D,this.toBBox),s(L,this.toBBox),w?S[w-1].children.push(L):this._splitRoot(D,L)},r.prototype._splitRoot=function(S,w){this.data=C([S,w]),this.data.height=S.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(S,w,D){for(var M,O=1/0,B=1/0,L=w;L<=D-w;L++){var _=a(S,0,L,this.toBBox),b=a(S,L,D,this.toBBox),v=h(_,b),I=d(_)+d(b);v<O?(O=v,M=L,B=I<B?I:B):v===O&&I<B&&(B=I,M=L)}return M||D-w},r.prototype._chooseSplitAxis=function(S,w,D){var M=S.leaf?this.compareMinX:l,O=S.leaf?this.compareMinY:f,B=this._allDistMargin(S,w,D,M),L=this._allDistMargin(S,w,D,O);B<L&&S.children.sort(M)},r.prototype._allDistMargin=function(S,w,D,M){S.children.sort(M);for(var O=this.toBBox,B=a(S,0,w,O),L=a(S,D-w,D,O),_=p(B)+p(L),b=w;b<D-w;b++){var v=S.children[b];c(B,S.leaf?O(v):v),_+=p(B)}for(var I=D-w-1;I>=w;I--){var R=S.children[I];c(L,S.leaf?O(R):R),_+=p(L)}return _},r.prototype._adjustParentBBoxes=function(S,w,D){for(var M=D;M>=0;M--)c(w[M],S)},r.prototype._condense=function(S){for(var w=S.length-1,D=void 0;w>=0;w--)S[w].children.length===0?w>0?(D=S[w-1].children,D.splice(D.indexOf(S[w]),1)):this.clear():s(S[w],this.toBBox)};function o(E,S,w){if(!w)return S.indexOf(E);for(var D=0;D<S.length;D++)if(w(E,S[D]))return D;return-1}function s(E,S){a(E,0,E.children.length,S,E)}function a(E,S,w,D,M){M||(M=C(null)),M.minX=1/0,M.minY=1/0,M.maxX=-1/0,M.maxY=-1/0;for(var O=S;O<w;O++){var B=E.children[O];c(M,E.leaf?D(B):B)}return M}function c(E,S){return E.minX=Math.min(E.minX,S.minX),E.minY=Math.min(E.minY,S.minY),E.maxX=Math.max(E.maxX,S.maxX),E.maxY=Math.max(E.maxY,S.maxY),E}function l(E,S){return E.minX-S.minX}function f(E,S){return E.minY-S.minY}function d(E){return(E.maxX-E.minX)*(E.maxY-E.minY)}function p(E){return E.maxX-E.minX+(E.maxY-E.minY)}function g(E,S){return(Math.max(S.maxX,E.maxX)-Math.min(S.minX,E.minX))*(Math.max(S.maxY,E.maxY)-Math.min(S.minY,E.minY))}function h(E,S){var w=Math.max(E.minX,S.minX),D=Math.max(E.minY,S.minY),M=Math.min(E.maxX,S.maxX),O=Math.min(E.maxY,S.maxY);return Math.max(0,M-w)*Math.max(0,O-D)}function A(E,S){return E.minX<=S.minX&&E.minY<=S.minY&&S.maxX<=E.maxX&&S.maxY<=E.maxY}function x(E,S){return S.minX<=E.maxX&&S.minY<=E.maxY&&S.maxX>=E.minX&&S.maxY>=E.minY}function C(E){return{children:E,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(E,S,w,D,M){for(var O=[S,w];O.length;)if(w=O.pop(),S=O.pop(),!(w-S<=D)){var B=S+Math.ceil((w-S)/D/2)*D;e(E,B,S,w,M),O.push(S,B,B,w)}}return r})});var Bme=Jn((x4,Rme)=>{(function(e,t){typeof x4=="object"&&typeof Rme<"u"?t(x4):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(x4,function(e){"use strict";function t(E){return E}function n(E){if(E==null)return t;var S,w,D=E.scale[0],M=E.scale[1],O=E.translate[0],B=E.translate[1];return function(L,_){_||(S=w=0);var b=2,v=L.length,I=new Array(v);for(I[0]=(S+=L[0])*D+O,I[1]=(w+=L[1])*M+B;b<v;)I[b]=L[b],++b;return I}}function i(E){var S=n(E.transform),w,D=1/0,M=D,O=-D,B=-D;function L(b){b=S(b),b[0]<D&&(D=b[0]),b[0]>O&&(O=b[0]),b[1]<M&&(M=b[1]),b[1]>B&&(B=b[1])}function _(b){switch(b.type){case"GeometryCollection":b.geometries.forEach(_);break;case"Point":L(b.coordinates);break;case"MultiPoint":b.coordinates.forEach(L);break}}E.arcs.forEach(function(b){for(var v=-1,I=b.length,R;++v<I;)R=S(b[v],v),R[0]<D&&(D=R[0]),R[0]>O&&(O=R[0]),R[1]<M&&(M=R[1]),R[1]>B&&(B=R[1])});for(w in E.objects)_(E.objects[w]);return[D,M,O,B]}function r(E,S){for(var w,D=E.length,M=D-S;M<--D;)w=E[M],E[M++]=E[D],E[D]=w}function o(E,S){return typeof S=="string"&&(S=E.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(w){return s(E,w)})}:s(E,S)}function s(E,S){var w=S.id,D=S.bbox,M=S.properties==null?{}:S.properties,O=a(E,S);return w==null&&D==null?{type:"Feature",properties:M,geometry:O}:D==null?{type:"Feature",id:w,properties:M,geometry:O}:{type:"Feature",id:w,bbox:D,properties:M,geometry:O}}function a(E,S){var w=n(E.transform),D=E.arcs;function M(v,I){I.length&&I.pop();for(var R=D[v<0?~v:v],F=0,k=R.length;F<k;++F)I.push(w(R[F],F));v<0&&r(I,k)}function O(v){return w(v)}function B(v){for(var I=[],R=0,F=v.length;R<F;++R)M(v[R],I);return I.length<2&&I.push(I[0]),I}function L(v){for(var I=B(v);I.length<4;)I.push(I[0]);return I}function _(v){return v.map(L)}function b(v){var I=v.type,R;switch(I){case"GeometryCollection":return{type:I,geometries:v.geometries.map(b)};case"Point":R=O(v.coordinates);break;case"MultiPoint":R=v.coordinates.map(O);break;case"LineString":R=B(v.arcs);break;case"MultiLineString":R=v.arcs.map(B);break;case"Polygon":R=_(v.arcs);break;case"MultiPolygon":R=v.arcs.map(_);break;default:return null}return{type:I,coordinates:R}}return b(S)}function c(E,S){var w={},D={},M={},O=[],B=-1;S.forEach(function(b,v){var I=E.arcs[b<0?~b:b],R;I.length<3&&!I[1][0]&&!I[1][1]&&(R=S[++B],S[B]=b,S[v]=R)}),S.forEach(function(b){var v=L(b),I=v[0],R=v[1],F,k;if(F=M[I])if(delete M[F.end],F.push(b),F.end=R,k=D[R]){delete D[k.start];var V=k===F?F:F.concat(k);D[V.start=F.start]=M[V.end=k.end]=V}else D[F.start]=M[F.end]=F;else if(F=D[R])if(delete D[F.start],F.unshift(b),F.start=I,k=M[I]){delete M[k.end];var G=k===F?F:k.concat(F);D[G.start=k.start]=M[G.end=F.end]=G}else D[F.start]=M[F.end]=F;else F=[b],D[F.start=I]=M[F.end=R]=F});function L(b){var v=E.arcs[b<0?~b:b],I=v[0],R;return E.transform?(R=[0,0],v.forEach(function(F){R[0]+=F[0],R[1]+=F[1]})):R=v[v.length-1],b<0?[R,I]:[I,R]}function _(b,v){for(var I in b){var R=b[I];delete v[R.start],delete R.start,delete R.end,R.forEach(function(F){w[F<0?~F:F]=1}),O.push(R)}}return _(M,D),_(D,M),S.forEach(function(b){w[b<0?~b:b]||O.push([b])}),O}function l(E){return a(E,f.apply(this,arguments))}function f(E,S,w){var D,M,O;if(arguments.length>1)D=d(E,S,w);else for(M=0,D=new Array(O=E.arcs.length);M<O;++M)D[M]=M;return{type:"MultiLineString",arcs:c(E,D)}}function d(E,S,w){var D=[],M=[],O;function B(I){var R=I<0?~I:I;(M[R]||(M[R]=[])).push({i:I,g:O})}function L(I){I.forEach(B)}function _(I){I.forEach(L)}function b(I){I.forEach(_)}function v(I){switch(O=I,I.type){case"GeometryCollection":I.geometries.forEach(v);break;case"LineString":L(I.arcs);break;case"MultiLineString":case"Polygon":_(I.arcs);break;case"MultiPolygon":b(I.arcs);break}}return v(S),M.forEach(w==null?function(I){D.push(I[0].i)}:function(I){w(I[0].g,I[I.length-1].g)&&D.push(I[0].i)}),D}function p(E){for(var S=-1,w=E.length,D,M=E[w-1],O=0;++S<w;)D=M,M=E[S],O+=D[0]*M[1]-D[1]*M[0];return Math.abs(O)}function g(E){return a(E,h.apply(this,arguments))}function h(E,S){var w={},D=[],M=[];S.forEach(O);function O(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(O);break;case"Polygon":B(_.arcs);break;case"MultiPolygon":_.arcs.forEach(B);break}}function B(_){_.forEach(function(b){b.forEach(function(v){(w[v=v<0?~v:v]||(w[v]=[])).push(_)})}),D.push(_)}function L(_){return p(a(E,{type:"Polygon",arcs:[_]}).coordinates[0])}return D.forEach(function(_){if(!_._){var b=[],v=[_];for(_._=1,M.push(b);_=v.pop();)b.push(_),_.forEach(function(I){I.forEach(function(R){w[R<0?~R:R].forEach(function(F){F._||(F._=1,v.push(F))})})})}}),D.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:M.map(function(_){var b=[],v;if(_.forEach(function(V){V.forEach(function(G){G.forEach(function(U){w[U<0?~U:U].length<2&&b.push(U)})})}),b=c(E,b),(v=b.length)>1)for(var I=1,R=L(b[0]),F,k;I<v;++I)(F=L(b[I]))>R&&(k=b[0],b[0]=b[I],b[I]=k,R=F);return b}).filter(function(_){return _.length>0})}}function A(E,S){for(var w=0,D=E.length;w<D;){var M=w+D>>>1;E[M]<S?w=M+1:D=M}return w}function x(E){var S={},w=E.map(function(){return[]});function D(V,G){V.forEach(function(U){U<0&&(U=~U);var Y=S[U];Y?Y.push(G):S[U]=[G]})}function M(V,G){V.forEach(function(U){D(U,G)})}function O(V,G){V.type==="GeometryCollection"?V.geometries.forEach(function(U){O(U,G)}):V.type in B&&B[V.type](V.arcs,G)}var B={LineString:D,MultiLineString:M,Polygon:M,MultiPolygon:function(V,G){V.forEach(function(U){M(U,G)})}};E.forEach(O);for(var L in S)for(var _=S[L],b=_.length,v=0;v<b;++v)for(var I=v+1;I<b;++I){var R=_[v],F=_[I],k;(k=w[R])[L=A(k,F)]!==F&&k.splice(L,0,F),(k=w[F])[L=A(k,R)]!==R&&k.splice(L,0,R)}return w}function C(E){if(E==null)return t;var S,w,D=E.scale[0],M=E.scale[1],O=E.translate[0],B=E.translate[1];return function(L,_){_||(S=w=0);var b=2,v=L.length,I=new Array(v),R=Math.round((L[0]-O)/D),F=Math.round((L[1]-B)/M);for(I[0]=R-S,S=R,I[1]=F-w,w=F;b<v;)I[b]=L[b],++b;return I}}function T(E,S){if(E.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((B=Math.floor(S))>=2))throw new Error("n must be \u22652");_=E.bbox||i(E);var w=_[0],D=_[1],M=_[2],O=_[3],B;S={scale:[M-w?(M-w)/(B-1):1,O-D?(O-D)/(B-1):1],translate:[w,D]}}else _=E.bbox;var L=C(S),_,b,v=E.objects,I={};function R(V){return L(V)}function F(V){var G;switch(V.type){case"GeometryCollection":G={type:"GeometryCollection",geometries:V.geometries.map(F)};break;case"Point":G={type:"Point",coordinates:R(V.coordinates)};break;case"MultiPoint":G={type:"MultiPoint",coordinates:V.coordinates.map(R)};break;default:return V}return V.id!=null&&(G.id=V.id),V.bbox!=null&&(G.bbox=V.bbox),V.properties!=null&&(G.properties=V.properties),G}function k(V){var G=0,U=1,Y=V.length,W,J=new Array(Y);for(J[0]=L(V[0],0);++G<Y;)((W=L(V[G],G))[0]||W[1])&&(J[U++]=W);return U===1&&(J[U++]=[0,0]),J.length=U,J}for(b in v)I[b]=F(v[b]);return{type:"Topology",bbox:_,transform:S,objects:I,arcs:E.arcs.map(k)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=h,e.mesh=l,e.meshArcs=f,e.neighbors=x,e.quantize=T,e.transform=n,e.untransform=C,Object.defineProperty(e,"__esModule",{value:!0})})});var ehe=Jn(E4=>{"use strict";Object.defineProperty(E4,"__esModule",{value:!0});E4.version=void 0;E4.version="4.0.0"});var Ub=Jn(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.assertNever=uc.removeWithPredicate=uc.remove=uc.ellipsis=uc.defaults=uc.isBoolean=uc.isUndefined=void 0;function the(e){return e===void 0}uc.isUndefined=the;function oQe(e){return typeof e=="boolean"}uc.isBoolean=oQe;function sQe(e,t){for(var n in t)t.hasOwnProperty(n)&&the(e[n])&&(e[n]=t[n]);return e}uc.defaults=sQe;function aQe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}uc.ellipsis=aQe;function cQe(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}uc.remove=cQe;function lQe(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}uc.removeWithPredicate=lQe;function uQe(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}uc.assertNever=uQe});var zx=Jn(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.alphaNumericAndMarksRe=vi.alphaNumericAndMarksCharsStr=vi.alphaNumericCharsRe=vi.decimalNumbersStr=vi.alphaCharsAndMarksStr=vi.marksStr=vi.emojiStr=vi.alphaCharsStr=vi.controlCharsRe=vi.quoteRe=vi.whitespaceRe=vi.nonDigitRe=vi.digitRe=vi.letterRe=void 0;vi.letterRe=/[A-Za-z]/;vi.digitRe=/[\d]/;vi.nonDigitRe=/[\D]/;vi.whitespaceRe=/\s/;vi.quoteRe=/['"]/;vi.controlCharsRe=/[\x00-\x1F\x7F]/;vi.alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;vi.emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;vi.marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;vi.alphaCharsAndMarksStr=vi.alphaCharsStr+vi.emojiStr+vi.marksStr;vi.decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;vi.alphaNumericCharsRe=new RegExp("[".concat(vi.alphaCharsStr+vi.decimalNumbersStr,"]"));vi.alphaNumericAndMarksCharsStr=vi.alphaCharsAndMarksStr+vi.decimalNumbersStr;vi.alphaNumericAndMarksRe=new RegExp("[".concat(vi.alphaNumericAndMarksCharsStr,"]"))});var v4=Jn(S4=>{"use strict";Object.defineProperty(S4,"__esModule",{value:!0});S4.HtmlTag=void 0;var b4=zx(),fQe=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(b4.whitespaceRe):[],r=t.split(b4.whitespaceRe),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(b4.whitespaceRe):[],r=t.split(b4.whitespaceRe),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();S4.HtmlTag=fQe});var nhe=Jn(w4=>{"use strict";Object.defineProperty(w4,"__esModule",{value:!0});w4.truncateSmart=void 0;function dQe(e,t,n){var i,r;n==null?(n="…",r=3,i=8):(r=n.length,i=n.length);var o=function(T){var E={},S=T,w=S.match(/^([a-z]+):\/\//i);return w&&(E.scheme=w[1],S=S.substr(w[0].length)),w=S.match(/^(.*?)(?=(\?|#|\/|$))/i),w&&(E.host=w[1],S=S.substr(w[0].length)),w=S.match(/^\/(.*?)(?=(\?|#|$))/i),w&&(E.path=w[1],S=S.substr(w[0].length)),w=S.match(/^\?(.*?)(?=(#|$))/i),w&&(E.query=w[1],S=S.substr(w[0].length)),w=S.match(/^#(.*?)$/i),w&&(E.fragment=w[1]),E},s=function(T){var E="";return T.scheme&&T.host&&(E+=T.scheme+"://"),T.host&&(E+=T.host),T.path&&(E+="/"+T.path),T.query&&(E+="?"+T.query),T.fragment&&(E+="#"+T.fragment),E},a=function(T,E){var S=E/2,w=Math.ceil(S),D=-1*Math.floor(S),M="";return D<0&&(M=T.substr(D)),T.substr(0,w)+n+M};if(e.length<=t)return e;var c=t-r,l=o(e);if(l.query){var f=l.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(l.query=l.query.substr(0,f[1].length),e=s(l))}if(e.length<=t||(l.host&&(l.host=l.host.replace(/^www\./,""),e=s(l)),e.length<=t))return e;var d="";if(l.host&&(d+=l.host),d.length>=c)return l.host.length==t?(l.host.substr(0,t-r)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(l.path&&(p+="/"+l.path),l.query&&(p+="?"+l.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(l.fragment){var h="#"+l.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var A=c-d.length;return(d+a(h,A)).substr(0,c+i)}else d+=h}if(l.scheme&&l.host){var x=l.scheme+"://";if((d+x).length<c)return(x+d).substr(0,t)}if(d.length<=t)return d;var C="";return c>0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}w4.truncateSmart=dQe});var ihe=Jn(D4=>{"use strict";Object.defineProperty(D4,"__esModule",{value:!0});D4.truncateMiddle=void 0;function mQe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}D4.truncateMiddle=mQe});var rhe=Jn(I4=>{"use strict";Object.defineProperty(I4,"__esModule",{value:!0});I4.truncateEnd=void 0;var hQe=Ub();function pQe(e,t,n){return(0,hQe.ellipsis)(e,t,n)}I4.truncateEnd=pQe});var oj=Jn(P4=>{"use strict";Object.defineProperty(P4,"__esModule",{value:!0});P4.AnchorTagBuilder=void 0;var _Qe=v4(),gQe=nhe(),yQe=ihe(),AQe=rhe(),xQe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new _Qe.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,r=n.location;return r==="smart"?(0,gQe.truncateSmart)(t,i):r==="middle"?(0,yQe.truncateMiddle)(t,i):(0,AQe.truncateEnd)(t,i)},e}();P4.AnchorTagBuilder=xQe});var Ah={};uJ(Ah,{__assign:()=>aj,__asyncDelegator:()=>RQe,__asyncGenerator:()=>MQe,__asyncValues:()=>BQe,__await:()=>qB,__awaiter:()=>vQe,__classPrivateFieldGet:()=>VQe,__classPrivateFieldSet:()=>kQe,__createBinding:()=>lj,__decorate:()=>EQe,__exportStar:()=>DQe,__extends:()=>CQe,__generator:()=>wQe,__importDefault:()=>UQe,__importStar:()=>FQe,__makeTemplateObject:()=>LQe,__metadata:()=>SQe,__param:()=>bQe,__read:()=>ohe,__rest:()=>TQe,__spread:()=>IQe,__spreadArray:()=>OQe,__spreadArrays:()=>PQe,__values:()=>cj});function CQe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sj(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function TQe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function EQe(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function bQe(e,t){return function(n,i){t(n,i,e)}}function SQe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function vQe(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{l(i.next(f))}catch(d){s(d)}}function c(f){try{l(i.throw(f))}catch(d){s(d)}}function l(f){f.done?o(f.value):r(f.value).then(a,c)}l((i=i.apply(e,t||[])).next())})}function wQe(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(f){return c([l,f])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(o=l[0]&2?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(f){l=[6,f],r=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function DQe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&lj(t,e,n)}function cj(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ohe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function IQe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ohe(arguments[t]));return e}function PQe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function OQe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function qB(e){return this instanceof qB?(this.v=e,this):new qB(e)}function MQe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(p){i[p]&&(r[p]=function(g){return new Promise(function(h,A){o.push([p,g,h,A])>1||a(p,g)})})}function a(p,g){try{c(i[p](g))}catch(h){d(o[0][3],h)}}function c(p){p.value instanceof qB?Promise.resolve(p.value.v).then(l,f):d(o[0][2],p)}function l(p){a("next",p)}function f(p){a("throw",p)}function d(p,g){p(g),o.shift(),o.length&&a(o[0][0],o[0][1])}}function RQe(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(s){return(n=!n)?{value:qB(e[r](s)),done:r==="return"}:o?o(s):s}:o}}function BQe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof cj=="function"?cj(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}function LQe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function FQe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&lj(t,e,n);return NQe(t,e),t}function UQe(e){return e&&e.__esModule?e:{default:e}}function VQe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function kQe(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}var sj,aj,lj,NQe,xh=eCe(()=>{/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */sj=function(e,t){return sj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},sj(e,t)};aj=function(){return aj=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},aj.apply(this,arguments)};lj=Object.create?function(e,t,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};NQe=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}});var Hx=Jn(O4=>{"use strict";Object.defineProperty(O4,"__esModule",{value:!0});O4.AbstractMatch=void 0;var zQe=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();O4.AbstractMatch=zQe});var she=Jn(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:!0});Gx.tldRegex=Gx.tldRegexStr=void 0;Gx.tldRegexStr="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)";Gx.tldRegex=new RegExp("^"+Gx.tldRegexStr+"$")});var M4=Jn(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.isValidIpV4Address=Un.isValidTldMatch=Un.isValidSchemeUrl=Un.isKnownTld=Un.isUrlSuffixStartChar=Un.isPathChar=Un.isDomainLabelChar=Un.isDomainLabelStartChar=Un.isSchemeChar=Un.isSchemeStartChar=Un.tldUrlHostRe=Un.schemeUrlRe=Un.invalidSchemeRe=Un.urlSuffixedCharsNotAllowedAtEndRe=Un.httpSchemePrefixRe=Un.httpSchemeRe=Un.urlSuffixNotAllowedAsLastCharRe=Un.urlSuffixAllowedSpecialCharsRe=Un.urlSuffixStartCharsRe=Un.domainNameCharRegex=void 0;var Wx=zx(),HQe=she();Un.domainNameCharRegex=Wx.alphaNumericAndMarksRe;Un.urlSuffixStartCharsRe=/[\/?#]/;Un.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;Un.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;Un.httpSchemeRe=/https?:\/\//i;Un.httpSchemePrefixRe=new RegExp("^"+Un.httpSchemeRe.source,"i");Un.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(Un.urlSuffixNotAllowedAsLastCharRe.source+"$");Un.invalidSchemeRe=/^(javascript|vbscript):/i;Un.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Un.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function GQe(e){return Wx.letterRe.test(e)}Un.isSchemeStartChar=GQe;function WQe(e){return Wx.letterRe.test(e)||Wx.digitRe.test(e)||e==="+"||e==="-"||e==="."}Un.isSchemeChar=WQe;function ahe(e){return Wx.alphaNumericAndMarksRe.test(e)}Un.isDomainLabelStartChar=ahe;function jQe(e){return e==="_"||ahe(e)}Un.isDomainLabelChar=jQe;function qQe(e){return Wx.alphaNumericAndMarksRe.test(e)||Un.urlSuffixAllowedSpecialCharsRe.test(e)||Un.urlSuffixNotAllowedAsLastCharRe.test(e)}Un.isPathChar=qQe;function YQe(e){return Un.urlSuffixStartCharsRe.test(e)}Un.isUrlSuffixStartChar=YQe;function che(e){return HQe.tldRegex.test(e.toLowerCase())}Un.isKnownTld=che;function XQe(e){if(Un.invalidSchemeRe.test(e))return!1;var t=e.match(Un.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Wx.letterRe.test(i))}Un.isValidSchemeUrl=XQe;function KQe(e){var t=e.match(Un.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!che(r)}Un.isValidTldMatch=KQe;var JQe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ZQe=/[:/?#]/;function QQe(e){var t=e.split(ZQe,1)[0];return JQe.test(t)}Un.isValidIpV4Address=QQe});var uj=Jn(R4=>{"use strict";Object.defineProperty(R4,"__esModule",{value:!0});R4.UrlMatch=void 0;var $Qe=(xh(),Dm(Ah)),e$e=Hx(),t$e=M4(),n$e=/^(https?:\/\/)?(www\.)?/i,i$e=/^\/\//,r$e=function(e){(0,$Qe.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=a$e(n)),this.stripPrefix.scheme&&(n=o$e(n)),this.stripPrefix.www&&(n=s$e(n)),this.stripTrailingSlash&&(n=c$e(n)),this.decodePercentEncoding&&(n=l$e(n)),n},t}(e$e.AbstractMatch);R4.UrlMatch=r$e;function o$e(e){return e.replace(t$e.httpSchemePrefixRe,"")}function s$e(e){return e.replace(n$e,"$1")}function a$e(e){return e.replace(i$e,"")}function c$e(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function l$e(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var uhe=Jn(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.isValidEmail=Ch.isEmailLocalPartChar=Ch.isEmailLocalPartStartChar=Ch.mailtoSchemePrefixRe=void 0;var lhe=zx(),u$e=M4();Ch.mailtoSchemePrefixRe=/^mailto:/i;var f$e=new RegExp("[".concat(lhe.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function d$e(e){return lhe.alphaNumericAndMarksRe.test(e)}Ch.isEmailLocalPartStartChar=d$e;function m$e(e){return f$e.test(e)}Ch.isEmailLocalPartChar=m$e;function h$e(e){var t=e.split(".").pop()||"";return(0,u$e.isKnownTld)(t)}Ch.isValidEmail=h$e});var fj=Jn(B4=>{"use strict";Object.defineProperty(B4,"__esModule",{value:!0});B4.EmailMatch=void 0;var p$e=(xh(),Dm(Ah)),_$e=Hx(),g$e=function(e){(0,p$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(_$e.AbstractMatch);B4.EmailMatch=g$e});var dj=Jn(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.hashtagServices=Ry.isValidHashtag=Ry.isHashtagTextChar=void 0;var y$e=zx();function A$e(e){return e==="_"||y$e.alphaNumericAndMarksRe.test(e)}Ry.isHashtagTextChar=A$e;function x$e(e){return e.length<=140}Ry.isValidHashtag=x$e;Ry.hashtagServices=["twitter","facebook","instagram","tiktok"]});var mj=Jn(L4=>{"use strict";Object.defineProperty(L4,"__esModule",{value:!0});L4.HashtagMatch=void 0;var C$e=(xh(),Dm(Ah)),T$e=Ub(),E$e=Hx(),b$e=function(e){(0,C$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw(0,T$e.assertNever)(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(E$e.AbstractMatch);L4.HashtagMatch=b$e});var hj=Jn(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.mentionServices=By.isValidMention=By.isMentionTextChar=void 0;var S$e={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},v$e=/[-\w.]/;function w$e(e){return v$e.test(e)}By.isMentionTextChar=w$e;function D$e(e,t){var n=S$e[t];return n.test(e)}By.isValidMention=D$e;By.mentionServices=["twitter","instagram","soundcloud","tiktok"]});var pj=Jn(N4=>{"use strict";Object.defineProperty(N4,"__esModule",{value:!0});N4.MentionMatch=void 0;var I$e=(xh(),Dm(Ah)),P$e=Hx(),O$e=function(e){(0,I$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(P$e.AbstractMatch);N4.MentionMatch=O$e});var fhe=Jn(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.isValidPhoneNumber=Ly.isPhoneNumberControlChar=Ly.isPhoneNumberSeparatorChar=void 0;var M$e=/[-. ]/,R$e=/[-. ()]/,B$e=/[,;]/,L$e=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,N$e=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,F$e=new RegExp("^".concat(L$e.source,"|").concat(N$e.source,"$"));function U$e(e){return M$e.test(e)}Ly.isPhoneNumberSeparatorChar=U$e;function V$e(e){return B$e.test(e)}Ly.isPhoneNumberControlChar=V$e;function k$e(e){var t=e.charAt(0)==="+"||R$e.test(e);return t&&F$e.test(e)}Ly.isValidPhoneNumber=k$e});var _j=Jn(F4=>{"use strict";Object.defineProperty(F4,"__esModule",{value:!0});F4.PhoneMatch=void 0;var z$e=(xh(),Dm(Ah)),H$e=Hx(),G$e=function(e){(0,z$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(H$e.AbstractMatch);F4.PhoneMatch=G$e});var Tj=Jn(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});zb.excludeUnbalancedTrailingBracesAndPunctuation=zb.parseMatches=void 0;var Ia=zx(),W$e=uj(),Ir=Ub(),uo=M4(),Vb=uhe(),j$e=fj(),gj=dj(),q$e=mj(),yj=hj(),Y$e=pj(),kb=fhe(),X$e=_j();function K$e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,r=t.stripTrailingSlash,o=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],l=e.length,f=[],d=0;d<l;d++){var p=e.charAt(d);if(f.length===0)x(p);else for(var g=f.length-1;g>=0;g--){var h=f[g];switch(h.state){case 11:D(h,p);break;case 12:M(h,p);break;case 0:C(h,p);break;case 1:T(h,p);break;case 2:E(h,p);break;case 3:S(h,p);break;case 4:w(h,p);break;case 5:O(h,p);break;case 6:B(h,p);break;case 7:L(h,p);break;case 13:_(h,p);break;case 14:b(h,p);break;case 8:v(h,p);break;case 9:I(h,p);break;case 10:R(h,p);break;case 15:F(h,p);break;case 16:k(h,p);break;case 17:V(h,p);break;case 18:G(h,p);break;case 19:U(h,p);break;case 20:Y(h,p);break;case 21:W(h,p);break;case 22:J(h,p);break;case 23:j(h,p);break;case 24:K(h,p);break;case 25:Z(h,p);break;case 26:me(h,p);break;case 27:ye(h,p);break;case 28:se(h,p);break;case 29:pe(h,p);break;case 30:Ae(h,p);break;case 31:De(h,p);break;case 32:Re(h,p);break;case 33:tt(h,p);break;case 34:nt(h,p);break;case 35:Wt(h,p);break;case 36:un(h,p);break;case 37:Ce(h,p);break;case 38:pt(h,p);break;case 39:gn(h,p);break;case 40:Bn(h,p);break;case 41:Ut(h,p);break;default:(0,Ir.assertNever)(h.state)}}}for(var A=f.length-1;A>=0;A--)f.forEach(function(Ee){return kt(Ee)});return c;function x(Ee){if(Ee==="#")f.push($$e(d,28));else if(Ee==="@")f.push(eet(d,30));else if(Ee==="/")f.push(xj(d,11));else if(Ee==="+")f.push(Cj(d,37));else if(Ee==="(")f.push(Cj(d,32));else{if(Ia.digitRe.test(Ee)&&(f.push(Cj(d,38)),f.push(Z$e(d,13))),(0,Vb.isEmailLocalPartStartChar)(Ee)){var xe=Ee.toLowerCase()==="m"?15:22;f.push(Q$e(d,xe))}(0,uo.isSchemeStartChar)(Ee)&&f.push(Aj(d,0)),Ia.alphaNumericAndMarksRe.test(Ee)&&f.push(xj(d,5))}}function C(Ee,xe){xe===":"?Ee.state=2:xe==="-"?Ee.state=1:(0,uo.isSchemeChar)(xe)||(0,Ir.remove)(f,Ee)}function T(Ee,xe){xe==="-"||(xe==="/"?((0,Ir.remove)(f,Ee),f.push(xj(d,11))):(0,uo.isSchemeChar)(xe)?Ee.state=0:(0,Ir.remove)(f,Ee))}function E(Ee,xe){xe==="/"?Ee.state=3:xe==="."?(0,Ir.remove)(f,Ee):(0,uo.isDomainLabelStartChar)(xe)?(Ee.state=5,(0,uo.isSchemeStartChar)(xe)&&f.push(Aj(d,0))):(0,Ir.remove)(f,Ee)}function S(Ee,xe){xe==="/"?Ee.state=4:(0,uo.isPathChar)(xe)?(Ee.state=10,Ee.acceptStateReached=!0):kt(Ee)}function w(Ee,xe){xe==="/"?Ee.state=10:(0,uo.isDomainLabelStartChar)(xe)?(Ee.state=5,Ee.acceptStateReached=!0):(0,Ir.remove)(f,Ee)}function D(Ee,xe){xe==="/"?Ee.state=12:(0,Ir.remove)(f,Ee)}function M(Ee,xe){(0,uo.isDomainLabelStartChar)(xe)?Ee.state=5:(0,Ir.remove)(f,Ee)}function O(Ee,xe){xe==="."?Ee.state=7:xe==="-"?Ee.state=6:xe===":"?Ee.state=8:(0,uo.isUrlSuffixStartChar)(xe)?Ee.state=10:(0,uo.isDomainLabelChar)(xe)||kt(Ee)}function B(Ee,xe){xe==="-"||(xe==="."?kt(Ee):(0,uo.isDomainLabelStartChar)(xe)?Ee.state=5:kt(Ee))}function L(Ee,xe){xe==="."?kt(Ee):(0,uo.isDomainLabelStartChar)(xe)?(Ee.state=5,Ee.acceptStateReached=!0):kt(Ee)}function _(Ee,xe){xe==="."?Ee.state=14:xe===":"?Ee.state=8:Ia.digitRe.test(xe)||((0,uo.isUrlSuffixStartChar)(xe)?Ee.state=10:Ia.alphaNumericAndMarksRe.test(xe)?(0,Ir.remove)(f,Ee):kt(Ee))}function b(Ee,xe){Ia.digitRe.test(xe)?(Ee.octetsEncountered++,Ee.octetsEncountered===4&&(Ee.acceptStateReached=!0),Ee.state=13):kt(Ee)}function v(Ee,xe){Ia.digitRe.test(xe)?Ee.state=9:kt(Ee)}function I(Ee,xe){Ia.digitRe.test(xe)||((0,uo.isUrlSuffixStartChar)(xe)?Ee.state=10:kt(Ee))}function R(Ee,xe){(0,uo.isPathChar)(xe)||kt(Ee)}function F(Ee,xe){xe.toLowerCase()==="a"?Ee.state=16:J(Ee,xe)}function k(Ee,xe){xe.toLowerCase()==="i"?Ee.state=17:J(Ee,xe)}function V(Ee,xe){xe.toLowerCase()==="l"?Ee.state=18:J(Ee,xe)}function G(Ee,xe){xe.toLowerCase()==="t"?Ee.state=19:J(Ee,xe)}function U(Ee,xe){xe.toLowerCase()==="o"?Ee.state=20:J(Ee,xe)}function Y(Ee,xe){xe.toLowerCase()===":"?Ee.state=21:J(Ee,xe)}function W(Ee,xe){(0,Vb.isEmailLocalPartChar)(xe)?Ee.state=22:(0,Ir.remove)(f,Ee)}function J(Ee,xe){xe==="."?Ee.state=23:xe==="@"?Ee.state=24:(0,Vb.isEmailLocalPartChar)(xe)?Ee.state=22:(0,Ir.remove)(f,Ee)}function j(Ee,xe){xe==="."||xe==="@"?(0,Ir.remove)(f,Ee):(0,Vb.isEmailLocalPartChar)(xe)?Ee.state=22:(0,Ir.remove)(f,Ee)}function K(Ee,xe){(0,uo.isDomainLabelStartChar)(xe)?Ee.state=25:(0,Ir.remove)(f,Ee)}function Z(Ee,xe){xe==="."?Ee.state=27:xe==="-"?Ee.state=26:(0,uo.isDomainLabelChar)(xe)||kt(Ee)}function me(Ee,xe){xe==="-"||xe==="."?kt(Ee):(0,uo.isDomainLabelChar)(xe)?Ee.state=25:kt(Ee)}function ye(Ee,xe){xe==="."||xe==="-"?kt(Ee):(0,uo.isDomainLabelStartChar)(xe)?(Ee.state=25,Ee.acceptStateReached=!0):kt(Ee)}function se(Ee,xe){(0,gj.isHashtagTextChar)(xe)?(Ee.state=29,Ee.acceptStateReached=!0):(0,Ir.remove)(f,Ee)}function pe(Ee,xe){(0,gj.isHashtagTextChar)(xe)||kt(Ee)}function Ae(Ee,xe){(0,yj.isMentionTextChar)(xe)?(Ee.state=31,Ee.acceptStateReached=!0):(0,Ir.remove)(f,Ee)}function De(Ee,xe){(0,yj.isMentionTextChar)(xe)||(Ia.alphaNumericAndMarksRe.test(xe)?(0,Ir.remove)(f,Ee):kt(Ee))}function Ce(Ee,xe){Ia.digitRe.test(xe)?Ee.state=38:((0,Ir.remove)(f,Ee),x(xe))}function Re(Ee,xe){Ia.digitRe.test(xe)?Ee.state=33:(0,Ir.remove)(f,Ee),x(xe)}function tt(Ee,xe){Ia.digitRe.test(xe)?Ee.state=34:(0,Ir.remove)(f,Ee)}function nt(Ee,xe){Ia.digitRe.test(xe)?Ee.state=35:(0,Ir.remove)(f,Ee)}function Wt(Ee,xe){xe===")"?Ee.state=36:(0,Ir.remove)(f,Ee)}function un(Ee,xe){Ia.digitRe.test(xe)?Ee.state=38:(0,kb.isPhoneNumberSeparatorChar)(xe)?Ee.state=39:(0,Ir.remove)(f,Ee)}function pt(Ee,xe){Ee.acceptStateReached=!0,(0,kb.isPhoneNumberControlChar)(xe)?Ee.state=40:xe==="#"?Ee.state=41:Ia.digitRe.test(xe)||(xe==="("?Ee.state=32:(0,kb.isPhoneNumberSeparatorChar)(xe)?Ee.state=39:(kt(Ee),(0,uo.isSchemeStartChar)(xe)&&f.push(Aj(d,0))))}function gn(Ee,xe){Ia.digitRe.test(xe)?Ee.state=38:xe==="("?Ee.state=32:(kt(Ee),x(xe))}function Bn(Ee,xe){(0,kb.isPhoneNumberControlChar)(xe)||(xe==="#"?Ee.state=41:Ia.digitRe.test(xe)?Ee.state=38:kt(Ee))}function Ut(Ee,xe){(0,kb.isPhoneNumberControlChar)(xe)?Ee.state=40:Ia.digitRe.test(xe)?(0,Ir.remove)(f,Ee):kt(Ee)}function kt(Ee){if((0,Ir.remove)(f,Ee),!!Ee.acceptStateReached){var xe=Ee.startIdx,ft=e.slice(Ee.startIdx,d);if(ft=hhe(ft),Ee.type==="url"){var di=e.charAt(Ee.startIdx-1);if(di==="@")return;var Xe=Ee.matchType;if(Xe==="scheme"){var Xi=uo.httpSchemeRe.exec(ft);if(Xi&&(xe=xe+Xi.index,ft=ft.slice(Xi.index)),!(0,uo.isValidSchemeUrl)(ft))return}else if(Xe==="tld"){if(!(0,uo.isValidTldMatch)(ft))return}else if(Xe==="ipV4"){if(!(0,uo.isValidIpV4Address)(ft))return}else(0,Ir.assertNever)(Xe);c.push(new W$e.UrlMatch({tagBuilder:n,matchedText:ft,offset:xe,urlMatchType:Xe,url:ft,protocolRelativeMatch:ft.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:r,decodePercentEncoding:o}))}else if(Ee.type==="email")(0,Vb.isValidEmail)(ft)&&c.push(new j$e.EmailMatch({tagBuilder:n,matchedText:ft,offset:xe,email:ft.replace(Vb.mailtoSchemePrefixRe,"")}));else if(Ee.type==="hashtag")(0,gj.isValidHashtag)(ft)&&c.push(new q$e.HashtagMatch({tagBuilder:n,matchedText:ft,offset:xe,serviceName:s,hashtag:ft.slice(1)}));else if(Ee.type==="mention")(0,yj.isValidMention)(ft,a)&&c.push(new Y$e.MentionMatch({tagBuilder:n,matchedText:ft,offset:xe,serviceName:a,mention:ft.slice(1)}));else if(Ee.type==="phone"){if(ft=ft.replace(/ +$/g,""),(0,kb.isValidPhoneNumber)(ft)){var Or=ft.replace(/[^0-9,;#]/g,"");c.push(new X$e.PhoneMatch({tagBuilder:n,matchedText:ft,offset:xe,number:Or,plusSign:ft.charAt(0)==="+"}))}}else(0,Ir.assertNever)(Ee)}}}zb.parseMatches=K$e;var J$e=/[\(\{\[]/,dhe=/[\)\}\]]/,mhe={")":"(","}":"{","]":"["};function hhe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);J$e.test(i)?t[i]++:dhe.test(i)&&t[mhe[i]]--}for(var r=e.length-1,o;r>=0;)if(o=e.charAt(r),dhe.test(o)){var s=mhe[o];if(t[s]<0)t[s]++,r--;else break}else if(uo.urlSuffixedCharsNotAllowedAtEndRe.test(o))r--;else break;return e.slice(0,r+1)}zb.excludeUnbalancedTrailingBracesAndPunctuation=hhe;function Aj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function xj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Z$e(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Q$e(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function $$e(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function eet(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function Cj(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}});var phe=Jn(U4=>{"use strict";Object.defineProperty(U4,"__esModule",{value:!0});U4.parseHtml=void 0;var fc=(xh(),Dm(Ah)),Kc=zx(),tet=Ub();function net(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,r=t.onText,o=t.onComment,s=t.onDoctype,a=new Th,c=0,l=e.length,f=0,d=0,p=a;c<l;){var g=e.charAt(c);switch(f){case 0:h(g);break;case 1:A(g);break;case 2:C(g);break;case 3:x(g);break;case 4:T(g);break;case 5:E(g);break;case 6:S(g);break;case 7:w(g);break;case 8:D(g);break;case 9:M(g);break;case 10:O(g);break;case 11:B(g);break;case 12:L(g);break;case 13:_(g);break;case 14:b(g);break;case 15:v(g);break;case 16:I(g);break;case 17:R(g);break;case 18:F(g);break;case 19:k(g);break;case 20:V(g);break;default:(0,tet.assertNever)(f)}c++}d<c&&W();function h(K){K==="<"&&U()}function A(K){K==="!"?f=13:K==="/"?(f=2,p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{isClosing:!0}))):K==="<"?U():Kc.letterRe.test(K)?(f=3,p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{isOpening:!0}))):(f=0,p=a)}function x(K){Kc.whitespaceRe.test(K)?(p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{name:J()})),f=4):K==="<"?U():K==="/"?(p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{name:J()})),f=12):K===">"?(p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{name:J()})),Y()):!Kc.letterRe.test(K)&&!Kc.digitRe.test(K)&&K!==":"&&G()}function C(K){K===">"?G():Kc.letterRe.test(K)?f=3:G()}function T(K){Kc.whitespaceRe.test(K)||(K==="/"?f=12:K===">"?Y():K==="<"?U():K==="="||Kc.quoteRe.test(K)||Kc.controlCharsRe.test(K)?G():f=5)}function E(K){Kc.whitespaceRe.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?U():Kc.quoteRe.test(K)&&G()}function S(K){Kc.whitespaceRe.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?U():Kc.quoteRe.test(K)?G():f=5)}function w(K){Kc.whitespaceRe.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?U():f=10)}function D(K){K==='"'&&(f=11)}function M(K){K==="'"&&(f=11)}function O(K){Kc.whitespaceRe.test(K)?f=4:K===">"?Y():K==="<"&&U()}function B(K){Kc.whitespaceRe.test(K)?f=4:K==="/"?f=12:K===">"?Y():K==="<"?U():(f=4,j())}function L(K){K===">"?(p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{isClosing:!0})),Y()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Th((0,fc.__assign)((0,fc.__assign)({},p),{type:"doctype"})),f=20):G()}function b(K){K==="-"?f=15:K===">"?G():f=16}function v(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function R(K){K==="-"?f=18:f=16}function F(K){K===">"?Y():K==="!"?f=19:K==="-"||(f=16)}function k(K){K==="-"?f=17:K===">"?Y():f=16}function V(K){K===">"?Y():K==="<"&&U()}function G(){f=0,p=a}function U(){f=1,p=new Th({idx:c})}function Y(){var K=e.slice(d,p.idx);K&&r(K,d),p.type==="comment"?o(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function W(){var K=e.slice(d,c);r(K,d),d=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function j(){c--}}U4.parseHtml=net;var Th=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}()});var V4=Jn(Ej=>{"use strict";Object.defineProperty(Ej,"__esModule",{value:!0});var iet=ehe(),ms=Ub(),ret=oj(),oet=v4(),set=Tj(),aet=phe(),cet=hj(),uet=dj(),fet=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=det(t.urls),this.email=(0,ms.isBoolean)(t.email)?t.email:this.email,this.phone=(0,ms.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,ms.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=met(t.stripPrefix),this.stripTrailingSlash=(0,ms.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,ms.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&cet.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&uet.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=het(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return(0,aet.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,l=s.split(c),f=a;l.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(function(c,l){return c.getOffset()-l.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length,s=r+o;if(n+1<t.length){if(t[n+1].getOffset()===r){var a=t[n+1].getMatchedText().length>o?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,ms.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=(0,set.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof oet.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new ret.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=iet.version,e}();Ej.default=fet;function det(e){return e==null&&(e=!0),(0,ms.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,ms.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,ms.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,ms.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function met(e){return e==null&&(e=!0),(0,ms.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,ms.isBoolean)(e.scheme)?e.scheme:!0,www:(0,ms.isBoolean)(e.www)?e.www:!0}}function het(e){return typeof e=="number"?{length:e,location:"end"}:(0,ms.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var ghe=Jn(_he=>{"use strict";Object.defineProperty(_he,"__esModule",{value:!0})});var yhe=Jn(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var jx=(xh(),Dm(Ah));(0,jx.__exportStar)(ghe(),P_);(0,jx.__exportStar)(fj(),P_);(0,jx.__exportStar)(mj(),P_);(0,jx.__exportStar)(Hx(),P_);(0,jx.__exportStar)(pj(),P_);(0,jx.__exportStar)(_j(),P_);(0,jx.__exportStar)(uj(),P_)});var Ahe=Jn(bj=>{"use strict";Object.defineProperty(bj,"__esModule",{value:!0});var pet=(xh(),Dm(Ah));(0,pet.__exportStar)(Tj(),bj)});var Sj=Jn((cm,Che)=>{"use strict";cm=Che.exports=V4().default;Object.defineProperty(cm,"__esModule",{value:!0});cm.Autolinker=void 0;var Hb=(xh(),Dm(Ah)),xhe=(0,Hb.__importDefault)(V4());cm.Autolinker=xhe.default;cm.default=xhe.default;(0,Hb.__exportStar)(V4(),cm);(0,Hb.__exportStar)(oj(),cm);(0,Hb.__exportStar)(v4(),cm);(0,Hb.__exportStar)(yhe(),cm);(0,Hb.__exportStar)(Ahe(),cm)});var Oj=Jn(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var Wb={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Wb.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Wb.Bounce.In(e*2)*.5:Wb.Bounce.Out(e*2-1)*.5+.5}}},eL;typeof self>"u"&&typeof process<"u"&&process.hrtime?eL=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?eL=self.performance.now.bind(self.performance):Date.now!==void 0?eL=Date.now:eL=function(){return new Date().getTime()};var Fy=eL,Pj=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=Fy()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),qx={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=qx.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=qx.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=qx.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=qx.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},H4=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Uhe=new Pj,Vhe=function(){function e(t,n){n===void 0&&(n=Uhe),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Wb.Linear.None,this._interpolationFunction=qx.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=H4.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?Fy()+parseFloat(t):t:Fy(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,r){for(var o in i){var s=t[o],a=Array.isArray(s),c=a?"array":typeof s,l=!a&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(l){var f=i[o];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[o]=[s].concat(f)}if((c==="object"||a)&&s&&!l){n[o]=a?[]:{};for(var d in s)n[o][d]=s[d];r[o]=a?[]:{},this._setupProperties(s,n[o],i[o],r[o])}else typeof n[o]>"u"&&(n[o]=s),a||(n[o]*=1),l?r[o]=i[o].slice().reverse():r[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=Fy()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=Fy()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return this._group=t,this},e.prototype.delay=function(t){return this._delayTime=t,this},e.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return this._yoyo=t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.interpolation=function(t){return this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){if(t===void 0&&(t=Fy()),n===void 0&&(n=!0),this._isPaused)return!0;var i,r,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;n&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=this._duration===0||r>1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),l=Array.isArray(a),f=!c&&l;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}(),khe="18.6.4",zhe=H4.nextId,Eh=Uhe,Hhe=Eh.getAll.bind(Eh),Ghe=Eh.removeAll.bind(Eh),Whe=Eh.add.bind(Eh),jhe=Eh.remove.bind(Eh),qhe=Eh.update.bind(Eh),Let={Easing:Wb,Group:Pj,Interpolation:qx,now:Fy,Sequence:H4,nextId:zhe,Tween:Vhe,VERSION:khe,getAll:Hhe,removeAll:Ghe,add:Whe,remove:jhe,update:qhe};dc.Easing=Wb;dc.Group=Pj;dc.Interpolation=qx;dc.Sequence=H4;dc.Tween=Vhe;dc.VERSION=khe;dc.add=Whe;dc.default=Let;dc.getAll=Hhe;dc.nextId=zhe;dc.now=Fy;dc.remove=jhe;dc.removeAll=Ghe;dc.update=qhe});var Aq=Jn((exports,module)=>{/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc + */(function(e,t){"use strict";typeof Y3=="object"&&Y3.exports?Y3.exports=t(rZ(),sZ(),cZ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(lZ,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(E,w){var P=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return P?M?new o(E,w):new o(E):new o;if(E===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(E),w!==void 0?this.absoluteTo(w):this}function s(E){return/^[0-9]+$/.test(E)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,w){var P={},M,B;if(f(w)==="RegExp")P=null;else if(d(w))for(M=0,B=w.length;M<B;M++)P[w[M]]=!0;else P[w]=!0;for(M=0,B=E.length;M<B;M++){var V=P&&P[E[M]]!==void 0||!P&&w.test(E[M]);V&&(E.splice(M,1),B--,M--)}return E}function g(E,w){var P,M;if(d(w)){for(P=0,M=w.length;P<M;P++)if(!g(E,w[P]))return!1;return!0}var B=f(w);for(P=0,M=E.length;P<M;P++)if(B==="RegExp"){if(typeof E[P]=="string"&&E[P].match(w))return!0}else if(E[P]===w)return!0;return!1}function h(E,w){if(!d(E)||!d(w)||E.length!==w.length)return!1;E.sort(),w.sort();for(var P=0,M=E.length;P<M;P++)if(E[P]!==w[P])return!1;return!0}function x(E){var w=/^\/+|\/+$/g;return E.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var w=E.nodeName.toLowerCase();if(!(w==="input"&&E.type!=="image"))return o.domAttributes[w]}};function b(E){return escape(E)}function C(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}o.encode=C,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=C,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(E,w){var P=o.encode(E+"");return w===void 0&&(w=o.escapeQuerySpace),w?P.replace(/%20/g,"+"):P},o.decodeQuery=function(E,w){E+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?E.replace(/\+/g,"%20"):E)}catch{return E}};var A={encode:"encode",decode:"decode"},T,S=function(E,w){return function(P){try{return o[w](P+"").replace(o.characters[E][w].expression,function(M){return o.characters[E][w].map[M]})}catch{return P}}};for(T in A)o[T+"PathSegment"]=S("pathname",A[T]),o[T+"UrnPathSegment"]=S("urnpath",A[T]);var v=function(E,w,P){return function(M){var B;P?B=function(k){return o[w](o[P](k))}:B=o[w];for(var V=(M+"").split(E),U=0,G=V.length;U<G;U++)V[U]=B(V[U]);return V.join(E)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=S("reserved","encode"),o.parse=function(E,w){var P;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),E=E.replace(o.leading_whitespace_expression,""),E=E.replace(o.ascii_tab_whitespace,""),P=E.indexOf("#"),P>-1&&(w.fragment=E.substring(P+1)||null,E=E.substring(0,P)),P=E.indexOf("?"),P>-1&&(w.query=E.substring(P+1)||null,E=E.substring(0,P)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(w.protocol=null,E=E.substring(2),E=o.parseAuthority(E,w)):(P=E.indexOf(":"),P>-1&&(w.protocol=E.substring(0,P)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:E.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(E=E.substring(P+3),E=o.parseAuthority(E,w)):(E=E.substring(P+1),w.urn=!0))),w.path=E,w},o.parseHost=function(E,w){E||(E=""),E=E.replace(/\\/g,"/");var P=E.indexOf("/"),M,B;if(P===-1&&(P=E.length),E.charAt(0)==="[")M=E.indexOf("]"),w.hostname=E.substring(1,M)||null,w.port=E.substring(M+2,P)||null,w.port==="/"&&(w.port=null);else{var V=E.indexOf(":"),U=E.indexOf("/"),G=E.indexOf(":",V+1);G!==-1&&(U===-1||G<U)?(w.hostname=E.substring(0,P)||null,w.port=null):(B=E.substring(0,P).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&E.substring(P).charAt(0)!=="/"&&(P++,E="/"+E),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),E.substring(P)||"/"},o.parseAuthority=function(E,w){return E=o.parseUserinfo(E,w),o.parseHost(E,w)},o.parseUserinfo=function(E,w){var P=E,M=E.indexOf("\\");M!==-1&&(E=E.replace(/\\/g,"/"));var B=E.indexOf("/"),V=E.lastIndexOf("@",B>-1?B:E.length-1),U;return V>-1&&(B===-1||V<B)?(U=E.substring(0,V).split(":"),w.username=U[0]?o.decode(U[0]):null,U.shift(),w.password=U[0]?o.decode(U.join(":")):null,E=P.substring(V+1)):(w.username=null,w.password=null),E},o.parseQuery=function(E,w){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var P={},M=E.split("&"),B=M.length,V,U,G,k=0;k<B;k++)V=M[k].split("="),U=o.decodeQuery(V.shift(),w),G=V.length?o.decodeQuery(V.join("="),w):null,U!=="__proto__"&&(c.call(P,U)?((typeof P[U]=="string"||P[U]===null)&&(P[U]=[P[U]]),P[U].push(G)):P[U]=G);return P},o.build=function(E){var w="",P=!1;return E.protocol&&(w+=E.protocol+":"),!E.urn&&(w||E.hostname)&&(w+="//",P=!0),w+=o.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&P&&(w+="/"),w+=E.path),typeof E.query=="string"&&E.query&&(w+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(w+="#"+E.fragment),w},o.buildHost=function(E){var w="";if(E.hostname)o.ip6_expression.test(E.hostname)?w+="["+E.hostname+"]":w+=E.hostname;else return"";return E.port&&(w+=":"+E.port),w},o.buildAuthority=function(E){return o.buildUserinfo(E)+o.buildHost(E)},o.buildUserinfo=function(E){var w="";return E.username&&(w+=o.encode(E.username)),E.password&&(w+=":"+o.encode(E.password)),w&&(w+="@"),w},o.buildQuery=function(E,w,P){var M="",B,V,U,G;for(V in E)if(V!=="__proto__"&&c.call(E,V))if(d(E[V]))for(B={},U=0,G=E[V].length;U<G;U++)E[V][U]!==void 0&&B[E[V][U]+""]===void 0&&(M+="&"+o.buildQueryParameter(V,E[V][U],P),w!==!0&&(B[E[V][U]+""]=!0));else E[V]!==void 0&&(M+="&"+o.buildQueryParameter(V,E[V],P));return M.substring(1)},o.buildQueryParameter=function(E,w,P){return o.encodeQuery(E,P)+(w!==null?"="+o.encodeQuery(w,P):"")},o.addQuery=function(E,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.addQuery(E,M,w[M]);else if(typeof w=="string"){if(E[w]===void 0){E[w]=P;return}else typeof E[w]=="string"&&(E[w]=[E[w]]);d(P)||(P=[P]),E[w]=(E[w]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(E,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.setQuery(E,M,w[M]);else if(typeof w=="string")E[w]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(E,w,P){var M,B,V;if(d(w))for(M=0,B=w.length;M<B;M++)E[w[M]]=void 0;else if(f(w)==="RegExp")for(V in E)w.test(V)&&(E[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(E,V,w[V]);else if(typeof w=="string")P!==void 0?f(P)==="RegExp"?!d(E[w])&&P.test(E[w])?E[w]=void 0:E[w]=p(E[w],P):E[w]===String(P)&&(!d(P)||P.length===1)?E[w]=void 0:d(E[w])&&(E[w]=p(E[w],P)):E[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(E,w,P,M){switch(f(w)){case"String":break;case"RegExp":for(var B in E)if(c.call(E,B)&&w.test(B)&&(P===void 0||o.hasQuery(E,B,P)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(E,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return w in E;case"Boolean":var U=!!(d(E[w])?E[w].length:E[w]);return P===U;case"Function":return!!P(E[w],w,E);case"Array":if(!d(E[w]))return!1;var G=M?g:h;return G(E[w],P);case"RegExp":return d(E[w])?M?g(E[w],P):!1:!!(E[w]&&E[w].match(P));case"Number":P=String(P);case"String":return d(E[w])?M?g(E[w],P):!1:E[w]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var E=[],w=[],P=0,M=0;M<arguments.length;M++){var B=new o(arguments[M]);E.push(B);for(var V=B.segment(),U=0;U<V.length;U++)typeof V[U]=="string"&&w.push(V[U]),V[U]&&P++}if(!w.length||!P)return new o("");var G=new o("").segment(w);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},o.commonPath=function(E,w){var P=Math.min(E.length,w.length),M;for(M=0;M<P;M++)if(E.charAt(M)!==w.charAt(M)){M--;break}return M<1?E.charAt(0)===w.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(M)!=="/"||w.charAt(M)!=="/")&&(M=E.substring(0,M).lastIndexOf("/")),E.substring(0,M+1))},o.withinString=function(E,w,P){P||(P={});var M=P.start||o.findUri.start,B=P.end||o.findUri.end,V=P.trim||o.findUri.trim,U=P.parens||o.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var k=M.exec(E);if(!k)break;var Y=k.index;if(P.ignoreHtml){var j=E.slice(Math.max(Y-3,0),Y);if(j&&G.test(j))continue}for(var J=Y+E.slice(Y).search(B),W=E.slice(Y,J),K=-1;;){var Z=U.exec(W);if(!Z)break;var he=Z.index+Z[0].length;K=Math.max(K,he)}if(K>-1?W=W.slice(0,K)+W.slice(K).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(P.ignore&&P.ignore.test(W))){J=Y+W.length;var ge=w(W,Y,J,E);if(ge===void 0){M.lastIndex=J;continue}ge=String(ge),E=E.slice(0,Y)+ge+E.slice(J),M.lastIndex=Y+ge.length}}return M.lastIndex=0,E},o.ensureValidHostname=function(E,w){var P=!!E,M=!!w,B=!1;if(M&&(B=g(o.hostProtocols,w)),B&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(E&&E.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(E){if(E){var w=Number(E);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},o.noConflict=function(E){if(E){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(E){return function(w,P){return w===void 0?this._parts[E]||"":(this._parts[E]=w||null,this.build(!P),this)}}function O(E,w){return function(P,M){return P===void 0?this._parts[E]||"":(P!==null&&(P=P+"",P.charAt(0)===w&&(P=P.substring(1))),this._parts[E]=P,this.build(!M),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(E,w){var P=this.query(E,w);return typeof P=="string"&&P.length?"?"+P:P},a.hash=function(E,w){var P=this.fragment(E,w);return typeof P=="string"&&P.length?"#"+P:P},a.pathname=function(E,w){if(E===void 0||E===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=E?o.recodeUrnPath(E):"":this._parts.path=E?o.recodePath(E):"/",this.build(!w),this},a.path=a.pathname,a.href=function(E,w){var P;if(E===void 0)return this.toString();this._string="",this._parts=o._parts();var M=E instanceof o,B=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var V=o.getDomAttribute(E);E=E[V]||"",B=!1}if(!M&&B&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=o.parse(String(E),this._parts);else if(M||B){var U=M?E._parts:E;for(P in U)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=U[P]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(E){var w=!1,P=!1,M=!1,B=!1,V=!1,U=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,P=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),w=P||M,B=!w,V=B&&n&&n.has(this._parts.hostname),U=B&&o.idn_expression.test(this._parts.hostname),G=B&&o.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return M;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,L=a.port,N=a.hostname;a.protocol=function(E,w){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(o.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,E,w)},a.scheme=a.protocol,a.port=function(E,w){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),o.ensureValidPort(E))),L.call(this,E,w))},a.hostname=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(E,P);if(M!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(E,this._parts.protocol)}return N.call(this,E,w)},a.origin=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var P=this.protocol(),M=this.authority();return M?(P?P+"://":"")+this.authority():""}else{var B=o(E);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(E,this._parts);if(P!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(E,this._parts);if(P!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),o.parseUserinfo(E,this._parts),this.build(!w),this},a.resource=function(E,w){var P;return E===void 0?this.path()+this.search()+this.hash():(P=o.parse(E),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!w),this)},a.subdomain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var M=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(B));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&o.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,E),this.build(!w),this}},a.domain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,E)}return this.build(!w),this}},a.tld=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(P+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var B;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return E?o.decodePath(M):M}else{var B=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,B),U=new RegExp("^"+u(V));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=o.recodePath(E),this._parts.path=this._parts.path.replace(U,E),this.build(!w),this}},a.filename=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(P+1);return E?o.decodePathSegment(M):M}else{var B=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(B=!0);var V=new RegExp(u(this.filename())+"$");return E=o.recodePath(E),this._parts.path=this._parts.path.replace(V,E),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),M=P.lastIndexOf("."),B,V;return M===-1?"":(B=P.substring(M+1),V=/^[a-z0-9%]+$/i.test(B)?B:"",E?o.decodePathSegment(V):V)}else{E.charAt(0)==="."&&(E=E.substring(1));var U=this.suffix(),G;if(U)E?G=new RegExp(u(U)+"$"):G=new RegExp(u("."+U)+"$");else{if(!E)return this;this._parts.path+="."+o.recodePath(E)}return G&&(E=o.recodePath(E),this._parts.path=this._parts.path.replace(G,E)),this.build(!w),this}},a.segment=function(E,w,P){var M=this._parts.urn?":":"/",B=this.path(),V=B.substring(0,1)==="/",U=B.split(M);if(E!==void 0&&typeof E!="number"&&(P=w,w=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(V&&U.shift(),E<0&&(E=Math.max(U.length+E,0)),w===void 0)return E===void 0?U:U[E];if(E===null||U[E]===void 0)if(d(w)){U=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),U[U.length-1]===""?U[U.length-1]=w:U.push(w));else w?U[E]=x(w):U.splice(E,1);return V&&U.unshift(""),this.path(U.join(M),P)},a.segmentCoded=function(E,w,P){var M,B,V;if(typeof E!="number"&&(P=w,w=E,E=void 0),w===void 0){if(M=this.segment(E,w,P),!d(M))M=M!==void 0?o.decode(M):void 0;else for(B=0,V=M.length;B<V;B++)M[B]=o.decode(M[B]);return M}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(B=0,V=w.length;B<V;B++)w[B]=o.encode(w[B]);return this.segment(E,w,P)};var _=a.query;return a.query=function(E,w){if(E===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=E.call(this,P);return this._parts.query=o.buildQuery(M||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=o.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,E,w)},a.setQuery=function(E,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)M[E]=w!==void 0?w:null;else if(typeof E=="object")for(var B in E)c.call(E,B)&&(M[B]=E[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=w),this.build(!P),this},a.addQuery=function(E,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,E,w===void 0?null:w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=w),this.build(!P),this},a.removeQuery=function(E,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,E,w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=w),this.build(!P),this},a.hasQuery=function(E,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,E,w,P)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var P,M="",B,V;for(w.charAt(0)!=="/"&&(P=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(M=w.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}V=w.substring(0,B).lastIndexOf("/"),V===-1&&(V=B),w=w.substring(0,V)+w.substring(B+3)}return P&&this.is("relative")&&(w=M+w.substring(1)),this._parts.path=w,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=E,o.decode=w}return this},a.unicode=function(){var E=o.encode,w=o.decode;o.encode=C,o.decode=unescape;try{this.normalize()}finally{o.encode=E,o.decode=w}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var w="";if(E._parts.protocol&&(w+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(w+=e.toUnicode(E._parts.hostname),E._parts.port&&(w+=":"+E._parts.port)):w+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(w+="/"),w+=E.path(!0),E._parts.query){for(var P="",M=0,B=E._parts.query.split("&"),V=B.length;M<V;M++){var U=(B[M]||"").split("=");P+="&"+o.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(P+="="+o.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+P.substring(1)}return w+=o.decodeQuery(E.hash(),!0),w},a.absoluteTo=function(E){var w=this.clone(),P=["protocol","username","password","hostname","port"],M,B,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof o||(E=new o(E)),w._parts.protocol||(w._parts.protocol=E._parts.protocol,this._parts.hostname))return w;for(B=0;V=P[B];B++)w._parts[V]=E._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(M=E.directory(),M=M||(E.path().indexOf("/")===0?"/":""),w._parts.path=(M?M+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=E._parts.path,w._parts.query||(w._parts.query=E._parts.query)),w.build(),w},a.relativeTo=function(E){var w=this.clone().normalize(),P,M,B,V,U;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new o(E).normalize(),P=w._parts,M=E._parts,V=w.path(),U=E.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===M.protocol&&(P.protocol=null),P.username!==M.username||P.password!==M.password||P.protocol!==null||P.username!==null||P.password!==null)return w.build();if(P.hostname===M.hostname&&P.port===M.port)P.hostname=null,P.port=null;else return w.build();if(V===U)return P.path="",w.build();if(B=o.commonPath(V,U),!B)return w.build();var G=M.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=G+P.path.substring(B.length)||"./",w.build()},a.equals=function(E){var w=this.clone(),P=new o(E),M={},B={},V={},U,G,k;if(w.normalize(),P.normalize(),w.toString()===P.toString())return!0;if(U=w.query(),G=P.query(),w.query(""),P.query(""),w.toString()!==P.toString()||U.length!==G.length)return!1;M=o.parseQuery(U,this._parts.escapeQuerySpace),B=o.parseQuery(G,this._parts.escapeQuerySpace);for(k in M)if(c.call(M,k)){if(d(M[k])){if(!h(M[k],B[k]))return!1}else if(M[k]!==B[k])return!1;V[k]=!0}for(k in B)if(c.call(B,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},o})});var wte=$n((G5t,vte)=>{"use strict";/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */var{entries:Tte,setPrototypeOf:pte,isFrozen:GDe,getPrototypeOf:WDe,getOwnPropertyDescriptor:jDe}=Object,{freeze:Mc,seal:yd,create:qDe}=Object,{apply:O5,construct:M5}=typeof Reflect<"u"&&Reflect;O5||(O5=function(t,n,i){return t.apply(n,i)});Mc||(Mc=function(t){return t});yd||(yd=function(t){return t});M5||(M5=function(t,n){return new t(...n)});var YDe=Qu(Array.prototype.forEach),_te=Qu(Array.prototype.pop),LP=Qu(Array.prototype.push),Mk=Qu(String.prototype.toLowerCase),w5=Qu(String.prototype.toString),XDe=Qu(String.prototype.match),gd=Qu(String.prototype.replace),KDe=Qu(String.prototype.indexOf),JDe=Qu(String.prototype.trim),tu=Qu(RegExp.prototype.test),NP=ZDe(TypeError);function Qu(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return O5(e,t,i)}}function ZDe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return M5(e,n)}}function mi(e,t,n){var i;n=(i=n)!==null&&i!==void 0?i:Mk,pte&&pte(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let s=n(o);s!==o&&(GDe(t)||(t[r]=s),o=s)}e[o]=!0}return e}function RT(e){let t=qDe(null);for(let[n,i]of Tte(e))t[n]=i;return t}function Rk(e,t){for(;e!==null;){let i=jDe(e,t);if(i){if(i.get)return Qu(i.get);if(typeof i.value=="function")return Qu(i.value)}e=WDe(e)}function n(i){return console.warn("fallback value for",i),null}return n}var gte=Mc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),I5=Mc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P5=Mc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$De=Mc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D5=Mc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),QDe=Mc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yte=Mc(["#text"]),xte=Mc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),R5=Mc(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),bte=Mc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ok=Mc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eRe=yd(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tRe=yd(/<%[\w\W]*|[\w\W]*%>/gm),nRe=yd(/\${[\w\W]*}/gm),iRe=yd(/^data-[\-\w.\u00B7-\uFFFF]/),rRe=yd(/^aria-[\-\w]+$/),Ate=yd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),oRe=yd(/^(?:\w+script|data):/i),sRe=yd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ete=yd(/^html$/i),Cte=Object.freeze({__proto__:null,MUSTACHE_EXPR:eRe,ERB_EXPR:tRe,TMPLIT_EXPR:nRe,DATA_ATTR:iRe,ARIA_ATTR:rRe,IS_ALLOWED_URI:Ate,IS_SCRIPT_OR_DATA:oRe,ATTR_WHITESPACE:sRe,DOCTYPE_NAME:Ete}),aRe=()=>typeof window>"u"?null:window,cRe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Ste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aRe(),t=on=>Ste(on);if(t.version="3.0.3",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let n=e.document,i=n.currentScript,{document:r}=e,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=e,h=c.prototype,x=Rk(h,"cloneNode"),b=Rk(h,"nextSibling"),C=Rk(h,"childNodes"),A=Rk(h,"parentNode");if(typeof s=="function"){let on=r.createElement("template");on.content&&on.content.ownerDocument&&(r=on.content.ownerDocument)}let T,S="",{implementation:v,createNodeIterator:I,createDocumentFragment:O,getElementsByTagName:R}=r,{importNode:L}=n,N={};t.isSupported=typeof Tte=="function"&&typeof A=="function"&&v&&v.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:_,ERB_EXPR:E,TMPLIT_EXPR:w,DATA_ATTR:P,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:V}=Cte,{IS_ALLOWED_URI:U}=Cte,G=null,k=mi({},[...gte,...I5,...P5,...D5,...yte]),Y=null,j=mi({},[...xte,...R5,...bte,...Ok]),J=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,K=null,Z=!0,he=!0,ge=!1,se=!0,pe=!1,xe=!1,Pe=!1,we=!1,Se=!1,nt=!1,Ze=!1,Gt=!0,fn=!1,pt="user-content-",Tn=!0,Vn=!1,Ut={},Pt=null,Ce=mi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ve=null,ot=mi({},["audio","video","img","source","image","track"]),Kt=null,_i=mi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",ho="http://www.w3.org/2000/svg",vr="http://www.w3.org/1999/xhtml",zo=vr,os=!1,ke=null,st=mi({},[Je,ho,vr],w5),Ke,He=["application/xhtml+xml","text/html"],dt="text/html",_t,hn=null,Hi=r.createElement("form"),Rr=function(Ae){return Ae instanceof RegExp||Ae instanceof Function},ss=function(Ae){if(!(hn&&hn===Ae)){if((!Ae||typeof Ae!="object")&&(Ae={}),Ae=RT(Ae),Ke=He.indexOf(Ae.PARSER_MEDIA_TYPE)===-1?Ke=dt:Ke=Ae.PARSER_MEDIA_TYPE,_t=Ke==="application/xhtml+xml"?w5:Mk,G="ALLOWED_TAGS"in Ae?mi({},Ae.ALLOWED_TAGS,_t):k,Y="ALLOWED_ATTR"in Ae?mi({},Ae.ALLOWED_ATTR,_t):j,ke="ALLOWED_NAMESPACES"in Ae?mi({},Ae.ALLOWED_NAMESPACES,w5):st,Kt="ADD_URI_SAFE_ATTR"in Ae?mi(RT(_i),Ae.ADD_URI_SAFE_ATTR,_t):_i,ve="ADD_DATA_URI_TAGS"in Ae?mi(RT(ot),Ae.ADD_DATA_URI_TAGS,_t):ot,Pt="FORBID_CONTENTS"in Ae?mi({},Ae.FORBID_CONTENTS,_t):Ce,W="FORBID_TAGS"in Ae?mi({},Ae.FORBID_TAGS,_t):{},K="FORBID_ATTR"in Ae?mi({},Ae.FORBID_ATTR,_t):{},Ut="USE_PROFILES"in Ae?Ae.USE_PROFILES:!1,Z=Ae.ALLOW_ARIA_ATTR!==!1,he=Ae.ALLOW_DATA_ATTR!==!1,ge=Ae.ALLOW_UNKNOWN_PROTOCOLS||!1,se=Ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=Ae.SAFE_FOR_TEMPLATES||!1,xe=Ae.WHOLE_DOCUMENT||!1,Se=Ae.RETURN_DOM||!1,nt=Ae.RETURN_DOM_FRAGMENT||!1,Ze=Ae.RETURN_TRUSTED_TYPE||!1,we=Ae.FORCE_BODY||!1,Gt=Ae.SANITIZE_DOM!==!1,fn=Ae.SANITIZE_NAMED_PROPS||!1,Tn=Ae.KEEP_CONTENT!==!1,Vn=Ae.IN_PLACE||!1,U=Ae.ALLOWED_URI_REGEXP||Ate,zo=Ae.NAMESPACE||vr,J=Ae.CUSTOM_ELEMENT_HANDLING||{},Ae.CUSTOM_ELEMENT_HANDLING&&Rr(Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&Rr(Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&typeof Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),pe&&(he=!1),nt&&(Se=!0),Ut&&(G=mi({},[...yte]),Y=[],Ut.html===!0&&(mi(G,gte),mi(Y,xte)),Ut.svg===!0&&(mi(G,I5),mi(Y,R5),mi(Y,Ok)),Ut.svgFilters===!0&&(mi(G,P5),mi(Y,R5),mi(Y,Ok)),Ut.mathMl===!0&&(mi(G,D5),mi(Y,bte),mi(Y,Ok))),Ae.ADD_TAGS&&(G===k&&(G=RT(G)),mi(G,Ae.ADD_TAGS,_t)),Ae.ADD_ATTR&&(Y===j&&(Y=RT(Y)),mi(Y,Ae.ADD_ATTR,_t)),Ae.ADD_URI_SAFE_ATTR&&mi(Kt,Ae.ADD_URI_SAFE_ATTR,_t),Ae.FORBID_CONTENTS&&(Pt===Ce&&(Pt=RT(Pt)),mi(Pt,Ae.FORBID_CONTENTS,_t)),Tn&&(G["#text"]=!0),xe&&mi(G,["html","head","body"]),G.table&&(mi(G,["tbody"]),delete W.tbody),Ae.TRUSTED_TYPES_POLICY){if(typeof Ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw NP('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw NP('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Ae.TRUSTED_TYPES_POLICY,S=T.createHTML("")}else T===void 0&&(T=cRe(g,i)),T!==null&&typeof S=="string"&&(S=T.createHTML(""));Mc&&Mc(Ae),hn=Ae}},As=mi({},["mi","mo","mn","ms","mtext"]),io=mi({},["foreignobject","desc","title","annotation-xml"]),Xi=mi({},["title","style","font","a","script"]),Ao=mi({},I5);mi(Ao,P5),mi(Ao,$De);let jn=mi({},D5);mi(jn,QDe);let Fn=function(Ae){let rt=A(Ae);(!rt||!rt.tagName)&&(rt={namespaceURI:zo,tagName:"template"});let Ft=Mk(Ae.tagName),tr=Mk(rt.tagName);return ke[Ae.namespaceURI]?Ae.namespaceURI===ho?rt.namespaceURI===vr?Ft==="svg":rt.namespaceURI===Je?Ft==="svg"&&(tr==="annotation-xml"||As[tr]):!!Ao[Ft]:Ae.namespaceURI===Je?rt.namespaceURI===vr?Ft==="math":rt.namespaceURI===ho?Ft==="math"&&io[tr]:!!jn[Ft]:Ae.namespaceURI===vr?rt.namespaceURI===ho&&!io[tr]||rt.namespaceURI===Je&&!As[tr]?!1:!jn[Ft]&&(Xi[Ft]||!Ao[Ft]):!!(Ke==="application/xhtml+xml"&&ke[Ae.namespaceURI]):!1},Ln=function(Ae){LP(t.removed,{element:Ae});try{Ae.parentNode.removeChild(Ae)}catch{Ae.remove()}},gi=function(Ae,rt){try{LP(t.removed,{attribute:rt.getAttributeNode(Ae),from:rt})}catch{LP(t.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Ae),Ae==="is"&&!Y[Ae])if(Se||nt)try{Ln(rt)}catch{}else try{rt.setAttribute(Ae,"")}catch{}},Ws=function(Ae){let rt,Ft;if(we)Ae="<remove></remove>"+Ae;else{let js=XDe(Ae,/^[\r\n\t ]+/);Ft=js&&js[0]}Ke==="application/xhtml+xml"&&zo===vr&&(Ae='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ae+"</body></html>");let tr=T?T.createHTML(Ae):Ae;if(zo===vr)try{rt=new p().parseFromString(tr,Ke)}catch{}if(!rt||!rt.documentElement){rt=v.createDocument(zo,"template",null);try{rt.documentElement.innerHTML=os?S:tr}catch{}}let ur=rt.body||rt.documentElement;return Ae&&Ft&&ur.insertBefore(r.createTextNode(Ft),ur.childNodes[0]||null),zo===vr?R.call(rt,xe?"html":"body")[0]:xe?rt.documentElement:ur},as=function(Ae){return I.call(Ae.ownerDocument||Ae,Ae,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},td=function(Ae){return Ae instanceof d&&(typeof Ae.nodeName!="string"||typeof Ae.textContent!="string"||typeof Ae.removeChild!="function"||!(Ae.attributes instanceof f)||typeof Ae.removeAttribute!="function"||typeof Ae.setAttribute!="function"||typeof Ae.namespaceURI!="string"||typeof Ae.insertBefore!="function"||typeof Ae.hasChildNodes!="function")},La=function(Ae){return typeof a=="object"?Ae instanceof a:Ae&&typeof Ae=="object"&&typeof Ae.nodeType=="number"&&typeof Ae.nodeName=="string"},ha=function(Ae,rt,Ft){N[Ae]&&YDe(N[Ae],tr=>{tr.call(t,rt,Ft,hn)})},nd=function(Ae){let rt;if(ha("beforeSanitizeElements",Ae,null),td(Ae))return Ln(Ae),!0;let Ft=_t(Ae.nodeName);if(ha("uponSanitizeElement",Ae,{tagName:Ft,allowedTags:G}),Ae.hasChildNodes()&&!La(Ae.firstElementChild)&&(!La(Ae.content)||!La(Ae.content.firstElementChild))&&tu(/<[/\w]/g,Ae.innerHTML)&&tu(/<[/\w]/g,Ae.textContent))return Ln(Ae),!0;if(!G[Ft]||W[Ft]){if(!W[Ft]&&$_(Ft)&&(J.tagNameCheck instanceof RegExp&&tu(J.tagNameCheck,Ft)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ft)))return!1;if(Tn&&!Pt[Ft]){let tr=A(Ae)||Ae.parentNode,ur=C(Ae)||Ae.childNodes;if(ur&&tr){let js=ur.length;for(let ro=js-1;ro>=0;--ro)tr.insertBefore(x(ur[ro],!0),b(Ae))}}return Ln(Ae),!0}return Ae instanceof c&&!Fn(Ae)||(Ft==="noscript"||Ft==="noembed")&&tu(/<\/no(script|embed)/i,Ae.innerHTML)?(Ln(Ae),!0):(pe&&Ae.nodeType===3&&(rt=Ae.textContent,rt=gd(rt,_," "),rt=gd(rt,E," "),rt=gd(rt,w," "),Ae.textContent!==rt&&(LP(t.removed,{element:Ae.cloneNode()}),Ae.textContent=rt)),ha("afterSanitizeElements",Ae,null),!1)},ql=function(Ae,rt,Ft){if(Gt&&(rt==="id"||rt==="name")&&(Ft in r||Ft in Hi))return!1;if(!(he&&!K[rt]&&tu(P,rt))){if(!(Z&&tu(M,rt))){if(!Y[rt]||K[rt]){if(!($_(Ae)&&(J.tagNameCheck instanceof RegExp&&tu(J.tagNameCheck,Ae)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ae))&&(J.attributeNameCheck instanceof RegExp&&tu(J.attributeNameCheck,rt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(rt))||rt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&tu(J.tagNameCheck,Ft)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ft))))return!1}else if(!Kt[rt]){if(!tu(U,gd(Ft,V,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Ae!=="script"&&KDe(Ft,"data:")===0&&ve[Ae])){if(!(ge&&!tu(B,gd(Ft,V,"")))){if(Ft)return!1}}}}}}return!0},$_=function(Ae){return Ae.indexOf("-")>0},po=function(Ae){let rt,Ft,tr,ur;ha("beforeSanitizeAttributes",Ae,null);let{attributes:js}=Ae;if(!js)return;let ro={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(ur=js.length;ur--;){rt=js[ur];let{name:Im,namespaceURI:vG}=rt;if(Ft=Im==="value"?rt.value:JDe(rt.value),tr=_t(Im),ro.attrName=tr,ro.attrValue=Ft,ro.keepAttr=!0,ro.forceKeepAttr=void 0,ha("uponSanitizeAttribute",Ae,ro),Ft=ro.attrValue,ro.forceKeepAttr||(gi(Im,Ae),!ro.keepAttr))continue;if(!se&&tu(/\/>/i,Ft)){gi(Im,Ae);continue}pe&&(Ft=gd(Ft,_," "),Ft=gd(Ft,E," "),Ft=gd(Ft,w," "));let xJ=_t(Ae.nodeName);if(ql(xJ,tr,Ft)){if(fn&&(tr==="id"||tr==="name")&&(gi(Im,Ae),Ft=pt+Ft),T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!vG)switch(g.getAttributeType(xJ,tr)){case"TrustedHTML":{Ft=T.createHTML(Ft);break}case"TrustedScriptURL":{Ft=T.createScriptURL(Ft);break}}try{vG?Ae.setAttributeNS(vG,Im,Ft):Ae.setAttribute(Im,Ft),_te(t.removed)}catch{}}}ha("afterSanitizeAttributes",Ae,null)},Ho=function on(Ae){let rt,Ft=as(Ae);for(ha("beforeSanitizeShadowDOM",Ae,null);rt=Ft.nextNode();)ha("uponSanitizeShadowNode",rt,null),!nd(rt)&&(rt.content instanceof o&&on(rt.content),po(rt));ha("afterSanitizeShadowDOM",Ae,null)};return t.sanitize=function(on){let Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt,Ft,tr,ur;if(os=!on,os&&(on="<!-->"),typeof on!="string"&&!La(on))if(typeof on.toString=="function"){if(on=on.toString(),typeof on!="string")throw NP("dirty is not a string, aborting")}else throw NP("toString is not a function");if(!t.isSupported)return on;if(Pe||ss(Ae),t.removed=[],typeof on=="string"&&(Vn=!1),Vn){if(on.nodeName){let Im=_t(on.nodeName);if(!G[Im]||W[Im])throw NP("root node is forbidden and cannot be sanitized in-place")}}else if(on instanceof a)rt=Ws("<!---->"),Ft=rt.ownerDocument.importNode(on,!0),Ft.nodeType===1&&Ft.nodeName==="BODY"||Ft.nodeName==="HTML"?rt=Ft:rt.appendChild(Ft);else{if(!Se&&!pe&&!xe&&on.indexOf("<")===-1)return T&&Ze?T.createHTML(on):on;if(rt=Ws(on),!rt)return Se?null:Ze?S:""}rt&&we&&Ln(rt.firstChild);let js=as(Vn?on:rt);for(;tr=js.nextNode();)nd(tr)||(tr.content instanceof o&&Ho(tr.content),po(tr));if(Vn)return on;if(Se){if(nt)for(ur=O.call(rt.ownerDocument);rt.firstChild;)ur.appendChild(rt.firstChild);else ur=rt;return(Y.shadowroot||Y.shadowrootmod)&&(ur=L.call(n,ur,!0)),ur}let ro=xe?rt.outerHTML:rt.innerHTML;return xe&&G["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&tu(Ete,rt.ownerDocument.doctype.name)&&(ro="<!DOCTYPE "+rt.ownerDocument.doctype.name+`> +`+ro),pe&&(ro=gd(ro,_," "),ro=gd(ro,E," "),ro=gd(ro,w," ")),T&&Ze?T.createHTML(ro):ro},t.setConfig=function(on){ss(on),Pe=!0},t.clearConfig=function(){hn=null,Pe=!1},t.isValidAttribute=function(on,Ae,rt){hn||ss({});let Ft=_t(on),tr=_t(Ae);return ql(Ft,tr,rt)},t.addHook=function(on,Ae){typeof Ae=="function"&&(N[on]=N[on]||[],LP(N[on],Ae))},t.removeHook=function(on){if(N[on])return _te(N[on])},t.removeHooks=function(on){N[on]&&(N[on]=[])},t.removeAllHooks=function(){N={}},t}var lRe=Ste();vte.exports=lRe});var xne=$n((KP,$5)=>{var Kk=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiLQdilevlevlooroowwvbDDbelve9Weiiviebeoweuec:G;kekr;qiHo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbzl79IV9RbHDwebcekdXCq:fSQdbk:fxeYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:q:kjjbc:GeV86bbavcjdfcbcjdz:tjjjb8AdnaiTmbavcjdfadalzMjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0Ez:tjjjb8AavavcjdfalzMjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdz:tjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamz:tjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamz:tjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamz:tjjjb8AaXmekkcbhwaoal6mvxikindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamz:tjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falzMjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9Rgez:tjjjbaefhwkawaDcjdfalzMjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:q:kjjbk;use3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbydN:kjjbgrc;GeV86bbalc;abfcFecjez:tjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYcb9kaYaH9iGgoce7Gh3dndndndndnaYcbcsavEaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkkaLaO9havcm0Va5Vmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBdN:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRbN:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaicwfhiaDclfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8Kjjjjbk;TkdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Oefcbc;Kbz:tjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd1:kjjbHjjjjbbgeBd:OeavceBd1daeabaozMjjjb8Akavc:yefcwfcbBdbav9cb83i:yeavc:yefaeadaiavc:Oefz:njjjbcuaicdtgraicFFFFi0Egwcbyd1:kjjbHjjjjbbhoavc:Oefavyd1dgDcdtfaoBdbavaDcefgqBd1daoavyd:yegkarzMjjjbhxavc:Oefaqcdtfadci9Ugmcbyd1:kjjbHjjjjbbgoBdbavaDcdfgrBd1daocbamz:tjjjbhPavc:Oefarcdtfawcbyd1:kjjbHjjjjbbgsBdbavaDcifgqBd1daxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:OefaqcdtfcuamcdtadcFFFF970Ecbyd1:kjjbHjjjjbbgqBdbavaDclfBd1ddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;mbfhzavhoavyd:CehHavyd:GehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhKaoydbhdabaAcx2fgiclfaoclfydbgDBdbaiadBdbaicwfaKBdbaParfce86bbazaKBdwazaDBdlazadBdbaqarcdtfcbBdbdnawTmbcihQaXhiindnaiydbgoadSmbaoaDSmbaoaKSmbazaQcdtfaoBdbaQcefhQkaiclfhiawcufgwmbkkaAcefhAaxadcdtfgoaoydbcufBdbaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhoinasazaocdtfydbcdtgifgwIdbh8AawalcbaocefgDaocs0EcdtfIdbalaxaifydbgocwaocw6Ecdtfc;ebfIdbMgEUdbdnakaifydbgwTmbaEa8A:thEaOaHaifydbcdtfhoawcdthiinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDhoaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd1dhokaocdtavc:Oeffc98fhrdninaoTmearydbcbyd:e:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd1:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:tjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcifc98GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcrfc94GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:m:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:m:kjjbfgdBd:m:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Eddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkxebbbdbbbaWbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var x=p.charCodeAt(h);g[h]=x>96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h<p.length;++h)g[b++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,b)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g,h){var x=n.exports.sbrk,b=x(p.length*4),C=x(g*4),A=new Uint8Array(n.exports.memory.buffer),T=s(p);A.set(T,b),h&&h(b,b,p.length,g);var S=n.exports.meshopt_optimizeVertexFetchRemap(C,b,p.length,g);A=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(g);new Uint8Array(v.buffer).set(A.subarray(C,C+g*4)),T.set(A.subarray(b,b+p.length*4)),x(b-x(0));for(var I=0;I<p.length;++I)p[I]=v[p[I]];return[v,S]}function c(p,g,h,x,b){var C=n.exports.sbrk,A=C(g),T=C(x*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(h),T);var v=p(A,g,T,x,b),I=new Uint8Array(v);return I.set(S.subarray(A,A+v)),C(A-C(0)),I}function u(p){for(var g=0,h=0;h<p.length;++h){var x=p[h];g=g<x?x:g}return g}function f(p,g){if(o(g==2||g==4),g==4)return new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4);var h=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2);return new Uint32Array(h)}function d(p,g,h,x,b,C,A){var T=n.exports.sbrk,S=T(h*x),v=T(h*C),I=new Uint8Array(n.exports.memory.buffer);I.set(s(g),v),p(S,h,x,b,v,A);var O=new Uint8Array(h*x);return O.set(I.subarray(S,S+h*x)),T(S-T(0)),O}return{ready:i,supported:!0,reorderMesh:function(p,g,h){var x=g?h?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(p,u(p)+1,x)},encodeVertexBuffer:function(p,g,h){o(h>0&&h<=256),o(h%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,x,p,g,h)},encodeIndexBuffer:function(p,g,h){o(h==2||h==4),o(g%3==0);var x=f(p,h),b=n.exports.meshopt_encodeIndexBufferBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexBuffer,b,x,g,4)},encodeIndexSequence:function(p,g,h){o(h==2||h==4);var x=f(p,h),b=n.exports.meshopt_encodeIndexSequenceBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexSequence,b,x,g,4)},encodeGltfBuffer:function(p,g,h,x){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(b[x]),b[x](p,g,h)},encodeFilterOct:function(p,g,h,x){return o(h==4||h==8),o(x>=1&&x<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,x,16)},encodeFilterQuat:function(p,g,h,x){return o(h==8),o(x>=4&&x<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,x,16)},encodeFilterExp:function(p,g,h,x,b){o(h>0&&h%4==0),o(x>=1&&x<=24);var C={Separate:0,SharedVector:1,SharedComponent:2};return d(n.exports.meshopt_encodeFilterExp,p,g,h,x,h,b?C[b]:1)}}}();typeof KP=="object"&&typeof $5=="object"?$5.exports=Kk:typeof define=="function"&&define.amd?define([],function(){return Kk}):typeof KP=="object"?KP.MeshoptEncoder=Kk:(typeof self<"u"?self:KP).MeshoptEncoder=Kk});var bne=$n((JP,Q5)=>{var Jk=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?t:e,o,s=WebAssembly.instantiate(a(r),{}).then(function(C){o=C.instance,o.exports.__wasm_call_ctors()});function a(C){for(var A=new Uint8Array(C.length),T=0;T<C.length;++T){var S=C.charCodeAt(T);A[T]=S>96?S-97:S>64?S-39:S+4}for(var v=0,T=0;T<C.length;++T)A[v++]=A[T]<60?i[A[T]]:(A[T]-60)*64+A[++T];return A.buffer.slice(0,v)}function c(C,A,T,S,v,I){var O=o.exports.sbrk,R=T+3&-4,L=O(R*S),N=O(v.length),_=new Uint8Array(o.exports.memory.buffer);_.set(v,N);var E=C(L,T,S,N,v.length);if(E==0&&I&&I(L,R,S),A.set(_.subarray(L,L+T*S)),O(L-O(0)),E!=0)throw new Error("Malformed buffer data: "+E)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(C){var A={object:new Worker(C),pending:0,requests:{}};return A.object.onmessage=function(T){var S=T.data;A.pending-=S.count,A.requests[S.id][S.action](S.value),delete A.requests[S.id]},A}function h(C){for(var A="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(r))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+b.toString(),T=new Blob([A],{type:"text/javascript"}),S=URL.createObjectURL(T),v=0;v<C;++v)d[v]=g(S);URL.revokeObjectURL(S)}function x(C,A,T,S,v){for(var I=d[0],O=1;O<d.length;++O)d[O].pending<I.pending&&(I=d[O]);return new Promise(function(R,L){var N=new Uint8Array(T),_=p++;I.pending+=C,I.requests[_]={resolve:R,reject:L},I.object.postMessage({id:_,count:C,size:A,source:N,mode:S,filter:v},[N.buffer])})}function b(C){s.then(function(){var A=C.data;try{var T=new Uint8Array(A.count*A.size);c(o.exports[A.mode],T,A.count,A.size,A.source,o.exports[A.filter]),self.postMessage({id:A.id,count:A.count,action:"resolve",value:T},[T.buffer])}catch(S){self.postMessage({id:A.id,count:A.count,action:"reject",value:S})}})}return{ready:s,supported:!0,useWorkers:function(C){h(C)},decodeVertexBuffer:function(C,A,T,S,v){c(o.exports.meshopt_decodeVertexBuffer,C,A,T,S,o.exports[u[v]])},decodeIndexBuffer:function(C,A,T,S){c(o.exports.meshopt_decodeIndexBuffer,C,A,T,S)},decodeIndexSequence:function(C,A,T,S){c(o.exports.meshopt_decodeIndexSequence,C,A,T,S)},decodeGltfBuffer:function(C,A,T,S,v,I){c(o.exports[f[v]],C,A,T,S,o.exports[u[I]])},decodeGltfBufferAsync:function(C,A,T,S,v){return d.length>0?x(C,A,T,f[S],u[v]):s.then(function(){var I=new Uint8Array(C*A);return c(o.exports[f[S]],I,C,A,T,o.exports[u[v]]),I})}}}();typeof JP=="object"&&typeof Q5=="object"?Q5.exports=Jk:typeof define=="function"&&define.amd?define([],function(){return Jk}):typeof JP=="object"?JP.MeshoptDecoder=Jk:(typeof self<"u"?self:JP).MeshoptDecoder=Jk});var Cne=$n((ZP,e6)=>{var Zk=function(){"use strict";var e="b9H79TebbbecD9Geueu9Geub9Gbb9Gquuuuuuu99uueu9Gvuuuuub9Gluuuue999Giuuue999Gluuuueu9Giuuueuimxdilvorbwwbewlve9Weiiviebeoweuecj;jekr7oo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95beX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbla9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbvl79IV9RboDwebcekdDqq:XJxdbkp8WiKuP99Hu8Jjjjjbcj;bb9Rgq8KjjjjbaqcKfcbc;Kbz1jjjb8AaqcualcdtgkalcFFFFi0Egxcbyd;S1jjbHjjjjbbgmBdKaqceBd94aqamBdwaqaxcbyd;S1jjbHjjjjbbgPBd3aqcdBd94aqaPBdxaqcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbgsBdaaqciBd94aqasBdzaqcwfaeadalcbz:cjjjbaqaxcbyd;S1jjbHjjjjbbgzBd8KaqclBd94aqaxcbyd;S1jjbHjjjjbbgHBdyaqcvBd94alcd4alfhOcehAinaAgCcethAaCaO6mbkcbhXaqcuaCcdtgAaCcFFFFi0Ecbyd;S1jjbHjjjjbbgOBd8SaqcoBd94aOcFeaAz1jjjbhQdnalTmbavcd4hLaCcufhKinaiaXaL2cdtfgYydlgCcH4aC7c:F:b:DD2aYydbgCcH4aC7c;D;O:B8J27aYydwgCcH4aC7c:3F;N8N27hOcbhCdndninaQaOaKGgOcdtfg8AydbgAcuSmeaiaAaL2cdtfaYcxz:ljjjbTmdaCcefgCaOfhOaCaK9nmbxdkka8AaXBdbaXhAkazaXcdtfaABdbaXcefgXal9hmbkcbhCaHhAinaAaCBdbaAclfhAalaCcefgC9hmbkcbhCazhAaHhOindnaCaAydbgKSmbaOaHaKcdtfgKydbBdbaKaCBdbkaAclfhAaOclfhOalaCcefgC9hmbkkcbhOaqalcbyd;S1jjbHjjjjbbgYBd8WaqcrBd94aqaxcbyd;S1jjbHjjjjbbgCBd80aqcwBd94aqaxcbyd;S1jjbHjjjjbbgABdUaqcDBd94aCcFeakz1jjjbhEaAcFeakz1jjjbh3dnalTmbascwfh5indnamaOcdtgCfydbg8ETmbasaPaCfydbcitfh8Fa3aCfhaaEaCfhXcbhLindndna8FaLcitfydbgQaO9hmbaXaOBdbaaaOBdbxekdnamaQcdtgkfydbghTmbasaPakfydbcitgCfydbaOSmeahcufh8Aa5aCfhAcbhCina8AaCSmeaCcefhCaAydbhKaAcwfhAaKaO9hmbkaCah6meka3akfgCaOaQaCydbcuSEBdbaXaQaOaXydbcuSEBdbkaLcefgLa8E9hmbkkaOcefgOal9hmbkazhAaHhOa3hKaEhLcbhCindndnaCaAydbg8A9hmbdnaCaOydbg8A9hmbaLydbh8AdnaKydbgQcu9hmba8Acu9hmbaYaCfcb86bbxikaYaCfhXdnaCaQSmbaCa8ASmbaXce86bbxikaXcl86bbxdkdnaCaHa8AcdtgQfydb9hmbdnaKydbgXcuSmbaCaXSmbaLydbgkcuSmbaCakSmba3aQfydbg8EcuSmba8Ea8ASmbaEaQfydbgQcuSmbaQa8ASmbdnazaXcdtfydbazaQcdtfydb9hmbazakcdtfydbaza8Ecdtfydb9hmbaYaCfcd86bbxlkaYaCfcl86bbxikaYaCfcl86bbxdkaYaCfcl86bbxekaYaCfaYa8AfRbb86bbkaAclfhAaOclfhOaKclfhKaLclfhLalaCcefgC9hmbkawceGTmbaYhCalhAindnaCRbbce9hmbaCcl86bbkaCcefhCaAcufgAmbkkcbhLcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhmaqcKfaqyd94gCcdtfamBdbaqaCcefgABd94amaialavz:djjjb8AaqcKfaAcdtfcualc8S2gAalc;D;O;f8U0Ecbyd;S1jjbHjjjjbbgOBdbaqaCcdfBd94aOcbaAz1jjjbhsdnadTmbaehAindnamaAclfydbg8Acx2fgCIdbamaAydbgQcx2fgOIdbgg:tg8JamaAcwfydbgXcx2fgKIdlaOIdlg8K:tg8LNaKIdbag:tg8MaCIdla8K:tg8NN:tgyayNa8NaKIdwaOIdwg8P:tgINa8LaCIdwa8P:tg8NN:tg8La8LNa8Na8MNaIa8JN:tg8Ja8JNMM:rg8MJbbbb9ETmbaya8M:vhya8Ja8M:vh8Ja8La8M:vh8LkasazaQcdtfydbc8S2fgCa8La8M:rg8Ma8LNNg8NaCIdbMUdbaCa8Ja8Ma8JNg8RNgIaCIdlMUdlaCaya8MayNg8SNgRaCIdwMUdwaCa8Ra8LNg8RaCIdxMUdxaCa8Sa8LNg8UaCIdzMUdzaCa8Sa8JNg8SaCIdCMUdCaCa8La8Maya8PNa8LagNa8Ka8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCayagNgyaCIdaMUdaaCaga8KNggaCId8KMUd8KaCa8MaCIdyMUdyasaza8Acdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyasazaXcdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyaAcxfhAaLcifgLad6mbkcbh8AaehXincbhAinaYaeaAc:81jjbfydbgQa8AfcdtfydbgOfRbbhCdndnaYaXaAfydbgKfRbbgLc99fcFeGcpe0mbaCceSmbaCcd9hmekdnaLcufcFeGce0mbaEaKcdtfydbaO9hmekdnaCcufcFeGce0mba3aOcdtfydbaK9hmekdnaLcv2aCfc:G1jjbfRbbTmbazaOcdtfydbazaKcdtfydb0mekJbbacJbbjZaCceSEh8MaLceShkamaeaQcdtc:81jjbfydba8Afcdtfydbcx2fhCdnamaOcx2fgLIdwamaKcx2fgQIdwg8K:tg8La8LNaLIdbaQIdbg8P:tg8Ja8JNaLIdlaQIdlg8N:tgyayNMM:rggJbbbb9ETmba8Lag:vh8Layag:vhya8Jag:vh8JkJbbaca8MakEh8SdnaCIdwa8K:tg8Ma8La8Ma8LNaCIdba8P:tgRa8JNayaCIdla8N:tg8RNMMgIN:tg8Ma8MNaRa8JaIN:tg8La8LNa8RayaIN:tg8Ja8JNMM:rgyJbbbb9ETmba8May:vh8Ma8Jay:vh8Ja8Lay:vh8LkasazaKcdtfydbc8S2fgCa8La8SagNgya8LNNgIaCIdbMUdbaCa8Jaya8JNg8SNgRaCIdlMUdlaCa8Maya8MNggNg8RaCIdwMUdwaCa8Sa8LNg8SaCIdxMUdxaCaga8LNg8UaCIdzMUdzaCaga8JNg8VaCIdCMUdCaCa8Laya8Ma8KNa8La8PNa8Na8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCa8MagNg8MaCIdaMUdaaCaga8KNggaCId8KMUd8KaCayaCIdyMUdyasazaOcdtfydbc8S2fgCaIaCIdbMUdbaCaRaCIdlMUdlaCa8RaCIdwMUdwaCa8SaCIdxMUdxaCa8UaCIdzMUdzaCa8VaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCa8MaCIdaMUdaaCagaCId8KMUd8KaCayaCIdyMUdykaAclfgAcx9hmbkaXcxfhXa8Acifg8Aad6mbkkdnabaeSmbabaeadcdtz:hjjjb8Akcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaaqcKfaqyd94gCcdtfaaBdbaqaCcefgABd94aqcKfaAcdtfcuadcdtadcFFFFi0Ecbyd;S1jjbHjjjjbbg5BdbaqaCcdfgABd94aqcKfaAcdtfaxcbyd;S1jjbHjjjjbbgiBdbaqaCcifgABd94aqcKfaAcdtfalcbyd;S1jjbHjjjjbbg8WBdbaqaCclfBd94JbbbbhRdnadao9nmbararNh8Saacwfh8Xaqydwh8Yaqydxh8Zaqydzh80JbbbbhRinaqcwfabadgPalazz:cjjjbcbhhabhXcbhkincbhCindnazaXaCfydbgOcdtgefydbgLazabaCc:81jjbfydbakfcdtfydbgAcdtfydbg8ASmbaYaAfRbbgQcv2aYaOfRbbgKfc;q1jjbfRbbg8FaKcv2aQfg8Ec;q1jjbfRbbgdVcFeGTmbdna8Ec:G1jjbfRbbTmba8AaL0mekdnaKaQ9hmbaKcufcFeGce0mbaEaefydbaA9hmekaaahcx2fgKaAaOadcFeGgLEBdlaKaOaAaLEBdbaKaLa8FGcb9hBdwahcefhhkaCclfgCcx9hmbkaXcxfhXakcifgkaP6mbkdndnahTmbaahAahh8AinaAcwfgQJbbbbJbbjZasazaAydbgOcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaAclfgeydbgKcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNgyJbbbbJbbjZasazaKaOaQydbgLEgQcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaOaKaLEgXcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNg8Laya8L9FgCEUdbaeaKaXaCEBdbaAaOaQaCEBdbaAcxfhAa8Acufg8Ambkaqcjefcbcj;abz1jjjb8Aa8XhCahhAinaqcjefaCydbcO4c;8ZGfgOaOydbcefBdbaCcxfhCaAcufgAmbkcbhCcbhAinaqcjefaCfgOydbhKaOaABdbaKaAfhAaCclfgCcj;ab9hmbkcbhCa8XhAinaqcjefaAydbcO4c;8ZGfgOaOydbgOcefBdba5aOcdtfaCBdbaAcxfhAahaCcefgC9hmbkaPao9RgOci9Uh81dnalTmbcbhCaihAinaAaCBdbaAclfhAalaCcefgC9hmbkkcbhBa8Wcbalz1jjjbh83aOcO9UhUa81ce4h85cbh86cbhkdninaaa5akcdtfydbcx2fgXIdwg8Ja8S9Emea86a819pmeJFFuuh8Ldna85ah9pmbaaa5a85cdtfydbcx2fIdwJbb;aZNh8Lkdna8Ja8L9ETmba86aU0mdkdna83azaXydlg87cdtg88fydbgOfg89Rbba83azaXydbgecdtg8:fydbgZfgnRbbVmbdna8YaZcdtgCfydbgKTmba80a8ZaCfydbcitfhCamaOcx2fg8Ecwfhda8EclfhxamaZcx2fg8Fcwfhva8FclfhwcbhAcehQdnindnaiaCydbcdtfydbgLaOSmbaiaCclfydbcdtfydbg8AaOSmbama8Acx2fg8AIdbamaLcx2fgLIdbg8M:tg8LawIdbaLIdlgy:tggNa8FIdba8M:tg8Ka8AIdlay:tg8JN:ta8LaxIdbay:tg8PNa8EIdba8M:tg8Na8JN:tNa8JavIdbaLIdwgy:tgINaga8AIdway:tg8MN:ta8JadIdbay:tgyNa8Pa8MN:tNa8Ma8KNaIa8LN:ta8Ma8NNaya8LN:tNMMJbbbb9DmdkaCcwfhCaAcefgAaK6hQaKaA9hmbkkaQceGTmba85cefh85xekaXcwfhKasaOc8S2fgCasaZc8S2fgAIdbaCIdbMUdbaCaAIdlaCIdlMUdlaCaAIdwaCIdwMUdwaCaAIdxaCIdxMUdxaCaAIdzaCIdzMUdzaCaAIdCaCIdCMUdCaCaAIdKaCIdKMUdKaCaAId3aCId3MUd3aCaAIdaaCIdaMUdaaCaAId8KaCId8KMUd8KaCaAIdyaCIdyMUdydndndndnaYaefgARbbc9:fPdebdkaehCinaiaCcdtgCfaOBdbaHaCfydbgCae9hmbxikkaHa88fydbhCaHa8:fydbheaia8:fa87BdbaCh87kaiaecdtfa87Bdbkance86bba89ce86bbaKIdbg8LaRaRa8L9DEhRaBcefhBcecdaARbbceSEa86fh86kakcefgkah9hmbkkaBTmbdnalTmbcbhAaEhCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmbaEaKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkcbhAa3hCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmba3aKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkkcbhdabhCcbhLindnaiaCydbcdtfydbgAaiaCclfydbcdtfydbgOSmbaAaiaCcwfydbcdtfydbgKSmbaOaKSmbabadcdtfg8AaABdba8AclfaOBdba8AcwfaKBdbadcifhdkaCcxfhCaLcifgLaP9pmdxbkkaPhdxdkadao0mbkkdnaDTmbaDaR:rUdbkaqyd94gCcdtaqcKffc98fhzdninaCTmeazydbcbyd;W1jjbH:bjjjbbazc98fhzaCcufhCxbkkaqcj;bbf8Kjjjjbadk;pleouabydbcbaicdtz1jjjb8Aadci9UhvdnadTmbabydbhodnalTmbaehradhwinaoalarydbcdtfydbcdtfgDaDydbcefBdbarclfhrawcufgwmbxdkkaehradhwinaoarydbcdtfgDaDydbcefBdbarclfhrawcufgwmbkkdnaiTmbabydbhrabydlhwcbhDaihoinawaDBdbawclfhwarydbaDfhDarclfhraocufgombkkdnadci6mbavceavce0EhqabydlhvabydwhrinaecwfydbhwaeclfydbhDaeydbhodnalTmbalawcdtfydbhwalaDcdtfydbhDalaocdtfydbhokaravaocdtfgdydbcitfaDBdbaradydbcitfawBdladadydbcefBdbaravaDcdtfgdydbcitfawBdbaradydbcitfaoBdladadydbcefBdbaravawcdtfgwydbcitfaoBdbarawydbcitfaDBdlawawydbcefBdbaecxfheaqcufgqmbkkdnaiTmbabydlhrabydbhwinararydbawydb9RBdbawclfhwarclfhraicufgimbkkk:3ldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkaPk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz1jjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;01jjbgeabcifc98GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;01jjbgeabcrfc94GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;01jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;01jjbfgdBd;01jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:cedbcjwk9PFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbc;Swkxebbbdbbbj9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var x=p.charCodeAt(h);g[h]=x>96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h<p.length;++h)g[b++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,b)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g){var h=n.exports.sbrk,x=h(p.length*4),b=h(g*4),C=new Uint8Array(n.exports.memory.buffer),A=s(p);C.set(A,x);var T=n.exports.meshopt_optimizeVertexFetchRemap(b,x,p.length,g);C=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(g);new Uint8Array(S.buffer).set(C.subarray(b,b+g*4)),A.set(C.subarray(x,x+p.length*4)),h(x-h(0));for(var v=0;v<p.length;++v)p[v]=S[p[v]];return[S,T]}function c(p){for(var g=0,h=0;h<p.length;++h){var x=p[h];g=g<x?x:g}return g}function u(p,g,h,x,b,C,A,T,S){var v=n.exports.sbrk,I=v(4),O=v(h*4),R=v(b*C),L=v(h*4),N=new Uint8Array(n.exports.memory.buffer);N.set(s(x),R),N.set(s(g),L);var _=p(O,L,h,R,b,C,A,T,S,I);N=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(_);s(E).set(N.subarray(O,O+_*4));var w=new Float32Array(1);return s(w).set(N.subarray(I,I+4)),v(I-v(0)),[E,w[0]]}function f(p,g,h,x){var b=n.exports.sbrk,C=b(h*x),A=new Uint8Array(n.exports.memory.buffer);A.set(s(g),C);var T=p(C,h,x);return b(C-b(0)),T}var d={LockBorder:1};return{ready:i,supported:!0,compactMesh:function(p){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0);var g=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return a(g,c(p)+1)},simplify:function(p,g,h,x,b,C){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0),o(g instanceof Float32Array),o(g.length%h==0),o(h>=3),o(x%3==0),o(b>=0&&b<=1);for(var A=0,T=0;T<(C?C.length:0);++T)A|=d[C[T]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),v=u(n.exports.meshopt_simplify,S,p.length,g,g.length/h,h*4,x,b,A);return v[0]=p instanceof Uint32Array?v[0]:new p.constructor(v[0]),v},getScale:function(p,g){return o(p instanceof Float32Array),o(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length/g,g*4)}}}();typeof ZP=="object"&&typeof e6=="object"?e6.exports=Zk:typeof define=="function"&&define.amd?define([],function(){return Zk}):typeof ZP=="object"?ZP.MeshoptSimplifier=Zk:(typeof self<"u"?self:ZP).MeshoptSimplifier=Zk});var Ane=$n((mqt,Tne)=>{var lLe=xne(),uLe=bne(),fLe=Cne();Tne.exports={MeshoptEncoder:lLe,MeshoptDecoder:uLe,MeshoptSimplifier:fLe}});var qoe=$n((d_n,joe)=>{"use strict";joe.exports=uHe;var AO=1e20;function uHe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,h,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),h=0,x=Math.floor(u.length/f);h<x;h++)c[h]=u[h*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(o*s),C=Array(o*s),A=Array(a),T=Array(a),S=Array(a+1),v=Array(a);for(h=0,x=o*s;h<x;h++){var I=c[h];b[h]=I===1?0:I===0?AO:Math.pow(Math.max(0,.5-I),2),C[h]=I===1?AO:I===0?0:Math.pow(Math.max(0,I-.5),2)}Goe(b,o,s,A,T,v,S),Goe(C,o,s,A,T,v,S);var O=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(h=0,x=o*s;h<x;h++)O[h]=Math.min(Math.max(1-((b[h]-C[h])/i+n),0),1);return O}function Goe(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Woe(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Woe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Woe(e,t,n,i,r){n[0]=0,i[0]=-AO,i[1]=+AO;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+AO}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var Zoe=$n((P_n,MU)=>{function CHe(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,x=15,b=16,C=17,A=0,T=1,S=2,v=3,I=4;function O(_,E){return 55296<=_.charCodeAt(E)&&_.charCodeAt(E)<=56319&&56320<=_.charCodeAt(E+1)&&_.charCodeAt(E+1)<=57343}function R(_,E){E===void 0&&(E=0);var w=_.charCodeAt(E);if(55296<=w&&w<=56319&&E<_.length-1){var P=w,M=_.charCodeAt(E+1);return 56320<=M&&M<=57343?(P-55296)*1024+(M-56320)+65536:P}if(56320<=w&&w<=57343&&E>=1){var P=_.charCodeAt(E-1),M=w;return 55296<=P&&P<=56319?(P-55296)*1024+(M-56320)+65536:M}return w}function L(_,E,w){var P=[_].concat(E).concat([w]),M=P[P.length-2],B=w,V=P.lastIndexOf(h);if(V>1&&P.slice(1,V).every(function(k){return k==i})&&[i,g,C].indexOf(_)==-1)return S;var U=P.lastIndexOf(r);if(U>0&&P.slice(1,U).every(function(k){return k==r})&&[p,r].indexOf(M)==-1)return P.filter(function(k){return k==r}).length%2==1?v:I;if(M==e&&B==t)return A;if(M==n||M==e||M==t)return B==h&&E.every(function(k){return k==i})?S:T;if(B==n||B==e||B==t)return T;if(M==s&&(B==s||B==a||B==u||B==f))return A;if((M==u||M==a)&&(B==a||B==c))return A;if((M==f||M==c)&&B==c)return A;if(B==i||B==x)return A;if(B==o)return A;if(M==p)return A;var G=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,C].indexOf(P[G])!=-1&&P.slice(G+1,-1).every(function(k){return k==i})&&B==h||M==x&&[b,C].indexOf(B)!=-1?A:E.indexOf(r)!=-1?S:M==r&&B==r?A:T}this.nextBreak=function(_,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=_.length-1)return _.length;for(var w=N(R(_,E)),P=[],M=E+1;M<_.length;M++)if(!O(_,M-1)){var B=N(R(_,M));if(L(w,P,B))return M;P.push(B)}return _.length},this.splitGraphemes=function(_){for(var E=[],w=0,P;(P=this.nextBreak(_,w))<_.length;)E.push(_.slice(w,P)),w=P;return w<_.length&&E.push(_.slice(w)),E},this.iterateGraphemes=function(_){var E=0,w={next:function(){var P,M;return(M=this.nextBreak(_,E))<_.length?(P=_.slice(E,M),E=M,{value:P,done:!1}):E<_.length?(P=_.slice(E),E=_.length,{value:P,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var E=0,w=0,P;(P=this.nextBreak(_,w))<_.length;)w=P,E++;return w<_.length&&E++,E};function N(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?C:d}return this}typeof MU<"u"&&MU.exports&&(MU.exports=CHe)});var Mse=$n((gbn,E9)=>{"use strict";E9.exports=VU;E9.exports.default=VU;function VU(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,o=Dse(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;var a,c,u,f,d,p,g;if(i&&(o=S8e(e,t,o,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;h<r;h+=n)d=e[h],p=e[h+1],d<a&&(a=d),p<c&&(c=p),d>u&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return YO(o,s,n,a,c,g,0),s}function Dse(e,t,n,i,r){var o,s;if(r===A9(e,t,n,i)>0)for(o=t;o<n;o+=i)s=Pse(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=Pse(o,e[o],e[o+1],s);return s&&zU(s,s.next)&&(KO(s),s=s.next),s}function $x(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(zU(n,n.next)||Io(n.prev,n,n.next)===0)){if(KO(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function YO(e,t,n,i,r,o,s){if(e){!s&&o&&D8e(e,i,r,o);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,o?T8e(e,i,r,o):C8e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),KO(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=A8e($x(e),t,n),YO(e,t,n,i,r,o,2)):s===2&&E8e(e,t,n,i,r,o):YO($x(e),t,n,i,r,o,1);break}}}}function C8e(e){var t=e.prev,n=e,i=e.next;if(Io(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=r<o?r<s?r:s:o<s?o:s,d=a<c?a<u?a:u:c<u?c:u,p=r>o?r>s?r:s:o>s?o:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&xA(r,a,o,c,s,u,h.x,h.y)&&Io(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function T8e(e,t,n,i){var r=e.prev,o=e,s=e.next;if(Io(r,o,s)>=0)return!1;for(var a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=a<c?a<u?a:u:c<u?c:u,h=f<d?f<p?f:p:d<p?d:p,x=a>c?a>u?a:u:c>u?c:u,b=f>d?f>p?f:p:d>p?d:p,C=C9(g,h,t,n,i),A=C9(x,b,t,n,i),T=e.prevZ,S=e.nextZ;T&&T.z>=C&&S&&S.z<=A;){if(T.x>=g&&T.x<=x&&T.y>=h&&T.y<=b&&T!==r&&T!==s&&xA(a,f,c,d,u,p,T.x,T.y)&&Io(T.prev,T,T.next)>=0||(T=T.prevZ,S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==r&&S!==s&&xA(a,f,c,d,u,p,S.x,S.y)&&Io(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;T&&T.z>=C;){if(T.x>=g&&T.x<=x&&T.y>=h&&T.y<=b&&T!==r&&T!==s&&xA(a,f,c,d,u,p,T.x,T.y)&&Io(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;S&&S.z<=A;){if(S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==r&&S!==s&&xA(a,f,c,d,u,p,S.x,S.y)&&Io(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function A8e(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!zU(r,o)&&Rse(r,i,i.next,o)&&XO(r,o)&&XO(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),KO(i),KO(i.next),i=e=o),i=i.next}while(i!==e);return $x(i)}function E8e(e,t,n,i,r,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&M8e(s,a)){var c=Ose(s,a);s=$x(s,s.next),c=$x(c,c.next),YO(s,t,n,i,r,o,0),YO(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function S8e(e,t,n,i){var r=[],o,s,a,c,u;for(o=0,s=t.length;o<s;o++)a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Dse(e,a,c,i,!1),u===u.next&&(u.steiner=!0),r.push(O8e(u));for(r.sort(v8e),o=0;o<r.length;o++)n=w8e(r[o],n);return n}function v8e(e,t){return e.x-t.x}function w8e(e,t){var n=I8e(e,t);if(!n)return t;var i=Ose(n,e);return $x(i,i.next),$x(n,n.next)}function I8e(e,t){var n=t,i=e.x,r=e.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>o&&(o=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,u=s.x,f=s.y,d=1/0,p;n=s;do i>=n.x&&n.x>=u&&i!==n.x&&xA(r<f?i:o,r,u,f,r<f?o:i,r,n.x,n.y)&&(p=Math.abs(r-n.y)/(i-n.x),XO(n,e)&&(p<d||p===d&&(n.x>s.x||n.x===s.x&&P8e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function P8e(e,t){return Io(e.prev,e,t.prev)<0&&Io(t.next,e,e.next)<0}function D8e(e,t,n,i){var r=e;do r.z===0&&(r.z=C9(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,R8e(r)}function R8e(e){var t,n,i,r,o,s,a,c,u=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<u&&(a++,i=i.nextZ,!!i);t++);for(c=u;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1);return e}function C9(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function O8e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function xA(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function M8e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!L8e(e,t)&&(XO(e,t)&&XO(t,e)&&N8e(e,t)&&(Io(e.prev,e,t.prev)||Io(e,t.prev,t))||zU(e,t)&&Io(e.prev,e,e.next)>0&&Io(t.prev,t,t.next)>0)}function Io(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zU(e,t){return e.x===t.x&&e.y===t.y}function Rse(e,t,n,i){var r=UU(Io(e,t,n)),o=UU(Io(e,t,i)),s=UU(Io(n,i,e)),a=UU(Io(n,i,t));return!!(r!==o&&s!==a||r===0&&kU(e,n,t)||o===0&&kU(e,i,t)||s===0&&kU(n,e,i)||a===0&&kU(n,t,i))}function kU(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function UU(e){return e>0?1:e<0?-1:0}function L8e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Rse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function XO(e,t){return Io(e.prev,e,e.next)<0?Io(e,t,e.next)>=0&&Io(e,e.prev,t)>=0:Io(e,t,e.prev)<0||Io(e,e.next,t)<0}function N8e(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Ose(e,t){var n=new T9(e.i,e.x,e.y),i=new T9(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Pse(e,t,n,i){var r=new T9(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function KO(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T9(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}VU.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(A9(e,0,o,n));if(r)for(var a=0,c=t.length;a<c;a++){var u=t[a]*n,f=a<c-1?t[a+1]*n:e.length;s-=Math.abs(A9(e,u,f,n))}var d=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,g=i[a+1]*n,h=i[a+2]*n;d+=Math.abs((e[p]-e[h])*(e[g+1]-e[p+1])-(e[p]-e[g])*(e[h+1]-e[p+1]))}return s===0&&d===0?0:Math.abs((d-s)/s)};function A9(e,t,n,i){for(var r=0,o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}VU.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var s=0;s<t;s++)n.vertices.push(e[r][o][s]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}});var $ue=$n((e7,t7)=>{(function(e,t){typeof e7=="object"&&typeof t7<"u"?t7.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(e7,function(){"use strict";function e(T,S,v,I,O){t(T,S,v||0,I||T.length-1,O||i)}function t(T,S,v,I,O){for(;I>v;){if(I-v>600){var R=I-v+1,L=S-v+1,N=Math.log(R),_=.5*Math.exp(2*N/3),E=.5*Math.sqrt(N*_*(R-_)/R)*(L-R/2<0?-1:1),w=Math.max(v,Math.floor(S-L*_/R+E)),P=Math.min(I,Math.floor(S+(R-L)*_/R+E));t(T,S,w,P,O)}var M=T[S],B=v,V=I;for(n(T,v,S),O(T[I],M)>0&&n(T,v,I);B<V;){for(n(T,B,V),B++,V--;O(T[B],M)<0;)B++;for(;O(T[V],M)>0;)V--}O(T[v],M)===0?n(T,v,V):(V++,n(T,V,I)),V<=S&&(v=V+1),S<=V&&(I=V-1)}}function n(T,S,v){var I=T[S];T[S]=T[v],T[v]=I}function i(T,S){return T<S?-1:T>S?1:0}var r=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(S){var v=this.data,I=[];if(!b(S,v))return I;for(var O=this.toBBox,R=[];v;){for(var L=0;L<v.children.length;L++){var N=v.children[L],_=v.leaf?O(N):N;b(S,_)&&(v.leaf?I.push(N):x(S,_)?this._all(N,I):R.push(N))}v=R.pop()}return I},r.prototype.collides=function(S){var v=this.data;if(!b(S,v))return!1;for(var I=[];v;){for(var O=0;O<v.children.length;O++){var R=v.children[O],L=v.leaf?this.toBBox(R):R;if(b(S,L)){if(v.leaf||x(S,L))return!0;I.push(R)}}v=I.pop()}return!1},r.prototype.load=function(S){if(!(S&&S.length))return this;if(S.length<this._minEntries){for(var v=0;v<S.length;v++)this.insert(S[v]);return this}var I=this._build(S.slice(),0,S.length-1,0);if(!this.data.children.length)this.data=I;else if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var O=this.data;this.data=I,I=O}this._insert(I,this.data.height-I.height-1,!0)}return this},r.prototype.insert=function(S){return S&&this._insert(S,this.data.height-1),this},r.prototype.clear=function(){return this.data=C([]),this},r.prototype.remove=function(S,v){if(!S)return this;for(var I=this.data,O=this.toBBox(S),R=[],L=[],N,_,E;I||R.length;){if(I||(I=R.pop(),_=R[R.length-1],N=L.pop(),E=!0),I.leaf){var w=o(S,I.children,v);if(w!==-1)return I.children.splice(w,1),R.push(I),this._condense(R),this}!E&&!I.leaf&&x(I,O)?(R.push(I),L.push(N),N=0,_=I,I=I.children[0]):_?(N++,I=_.children[N],E=!1):I=null}return this},r.prototype.toBBox=function(S){return S},r.prototype.compareMinX=function(S,v){return S.minX-v.minX},r.prototype.compareMinY=function(S,v){return S.minY-v.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(S){return this.data=S,this},r.prototype._all=function(S,v){for(var I=[];S;)S.leaf?v.push.apply(v,S.children):I.push.apply(I,S.children),S=I.pop();return v},r.prototype._build=function(S,v,I,O){var R=I-v+1,L=this._maxEntries,N;if(R<=L)return N=C(S.slice(v,I+1)),s(N,this.toBBox),N;O||(O=Math.ceil(Math.log(R)/Math.log(L)),L=Math.ceil(R/Math.pow(L,O-1))),N=C([]),N.leaf=!1,N.height=O;var _=Math.ceil(R/L),E=_*Math.ceil(Math.sqrt(L));A(S,v,I,E,this.compareMinX);for(var w=v;w<=I;w+=E){var P=Math.min(w+E-1,I);A(S,w,P,_,this.compareMinY);for(var M=w;M<=P;M+=_){var B=Math.min(M+_-1,P);N.children.push(this._build(S,M,B,O-1))}}return s(N,this.toBBox),N},r.prototype._chooseSubtree=function(S,v,I,O){for(;O.push(v),!(v.leaf||O.length-1===I);){for(var R=1/0,L=1/0,N=void 0,_=0;_<v.children.length;_++){var E=v.children[_],w=d(E),P=g(S,E)-w;P<L?(L=P,R=w<R?w:R,N=E):P===L&&w<R&&(R=w,N=E)}v=N||v.children[0]}return v},r.prototype._insert=function(S,v,I){var O=I?S:this.toBBox(S),R=[],L=this._chooseSubtree(O,this.data,v,R);for(L.children.push(S),c(L,O);v>=0&&R[v].children.length>this._maxEntries;)this._split(R,v),v--;this._adjustParentBBoxes(O,R,v)},r.prototype._split=function(S,v){var I=S[v],O=I.children.length,R=this._minEntries;this._chooseSplitAxis(I,R,O);var L=this._chooseSplitIndex(I,R,O),N=C(I.children.splice(L,I.children.length-L));N.height=I.height,N.leaf=I.leaf,s(I,this.toBBox),s(N,this.toBBox),v?S[v-1].children.push(N):this._splitRoot(I,N)},r.prototype._splitRoot=function(S,v){this.data=C([S,v]),this.data.height=S.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(S,v,I){for(var O,R=1/0,L=1/0,N=v;N<=I-v;N++){var _=a(S,0,N,this.toBBox),E=a(S,N,I,this.toBBox),w=h(_,E),P=d(_)+d(E);w<R?(R=w,O=N,L=P<L?P:L):w===R&&P<L&&(L=P,O=N)}return O||I-v},r.prototype._chooseSplitAxis=function(S,v,I){var O=S.leaf?this.compareMinX:u,R=S.leaf?this.compareMinY:f,L=this._allDistMargin(S,v,I,O),N=this._allDistMargin(S,v,I,R);L<N&&S.children.sort(O)},r.prototype._allDistMargin=function(S,v,I,O){S.children.sort(O);for(var R=this.toBBox,L=a(S,0,v,R),N=a(S,I-v,I,R),_=p(L)+p(N),E=v;E<I-v;E++){var w=S.children[E];c(L,S.leaf?R(w):w),_+=p(L)}for(var P=I-v-1;P>=v;P--){var M=S.children[P];c(N,S.leaf?R(M):M),_+=p(N)}return _},r.prototype._adjustParentBBoxes=function(S,v,I){for(var O=I;O>=0;O--)c(v[O],S)},r.prototype._condense=function(S){for(var v=S.length-1,I=void 0;v>=0;v--)S[v].children.length===0?v>0?(I=S[v-1].children,I.splice(I.indexOf(S[v]),1)):this.clear():s(S[v],this.toBBox)};function o(T,S,v){if(!v)return S.indexOf(T);for(var I=0;I<S.length;I++)if(v(T,S[I]))return I;return-1}function s(T,S){a(T,0,T.children.length,S,T)}function a(T,S,v,I,O){O||(O=C(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var R=S;R<v;R++){var L=T.children[R];c(O,T.leaf?I(L):L)}return O}function c(T,S){return T.minX=Math.min(T.minX,S.minX),T.minY=Math.min(T.minY,S.minY),T.maxX=Math.max(T.maxX,S.maxX),T.maxY=Math.max(T.maxY,S.maxY),T}function u(T,S){return T.minX-S.minX}function f(T,S){return T.minY-S.minY}function d(T){return(T.maxX-T.minX)*(T.maxY-T.minY)}function p(T){return T.maxX-T.minX+(T.maxY-T.minY)}function g(T,S){return(Math.max(S.maxX,T.maxX)-Math.min(S.minX,T.minX))*(Math.max(S.maxY,T.maxY)-Math.min(S.minY,T.minY))}function h(T,S){var v=Math.max(T.minX,S.minX),I=Math.max(T.minY,S.minY),O=Math.min(T.maxX,S.maxX),R=Math.min(T.maxY,S.maxY);return Math.max(0,O-v)*Math.max(0,R-I)}function x(T,S){return T.minX<=S.minX&&T.minY<=S.minY&&S.maxX<=T.maxX&&S.maxY<=T.maxY}function b(T,S){return S.minX<=T.maxX&&S.minY<=T.maxY&&S.maxX>=T.minX&&S.maxY>=T.minY}function C(T){return{children:T,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(T,S,v,I,O){for(var R=[S,v];R.length;)if(v=R.pop(),S=R.pop(),!(v-S<=I)){var L=S+Math.ceil((v-S)/I/2)*I;e(T,L,S,v,O),R.push(S,L,L,v)}}return r})});var xme=$n((vz,yme)=>{(function(e,t){typeof vz=="object"&&typeof yme<"u"?t(vz):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(vz,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var S,v,I=T.scale[0],O=T.scale[1],R=T.translate[0],L=T.translate[1];return function(N,_){_||(S=v=0);var E=2,w=N.length,P=new Array(w);for(P[0]=(S+=N[0])*I+R,P[1]=(v+=N[1])*O+L;E<w;)P[E]=N[E],++E;return P}}function i(T){var S=n(T.transform),v,I=1/0,O=I,R=-I,L=-I;function N(E){E=S(E),E[0]<I&&(I=E[0]),E[0]>R&&(R=E[0]),E[1]<O&&(O=E[1]),E[1]>L&&(L=E[1])}function _(E){switch(E.type){case"GeometryCollection":E.geometries.forEach(_);break;case"Point":N(E.coordinates);break;case"MultiPoint":E.coordinates.forEach(N);break}}T.arcs.forEach(function(E){for(var w=-1,P=E.length,M;++w<P;)M=S(E[w],w),M[0]<I&&(I=M[0]),M[0]>R&&(R=M[0]),M[1]<O&&(O=M[1]),M[1]>L&&(L=M[1])});for(v in T.objects)_(T.objects[v]);return[I,O,R,L]}function r(T,S){for(var v,I=T.length,O=I-S;O<--I;)v=T[O],T[O++]=T[I],T[I]=v}function o(T,S){return typeof S=="string"&&(S=T.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(v){return s(T,v)})}:s(T,S)}function s(T,S){var v=S.id,I=S.bbox,O=S.properties==null?{}:S.properties,R=a(T,S);return v==null&&I==null?{type:"Feature",properties:O,geometry:R}:I==null?{type:"Feature",id:v,properties:O,geometry:R}:{type:"Feature",id:v,bbox:I,properties:O,geometry:R}}function a(T,S){var v=n(T.transform),I=T.arcs;function O(w,P){P.length&&P.pop();for(var M=I[w<0?~w:w],B=0,V=M.length;B<V;++B)P.push(v(M[B],B));w<0&&r(P,V)}function R(w){return v(w)}function L(w){for(var P=[],M=0,B=w.length;M<B;++M)O(w[M],P);return P.length<2&&P.push(P[0]),P}function N(w){for(var P=L(w);P.length<4;)P.push(P[0]);return P}function _(w){return w.map(N)}function E(w){var P=w.type,M;switch(P){case"GeometryCollection":return{type:P,geometries:w.geometries.map(E)};case"Point":M=R(w.coordinates);break;case"MultiPoint":M=w.coordinates.map(R);break;case"LineString":M=L(w.arcs);break;case"MultiLineString":M=w.arcs.map(L);break;case"Polygon":M=_(w.arcs);break;case"MultiPolygon":M=w.arcs.map(_);break;default:return null}return{type:P,coordinates:M}}return E(S)}function c(T,S){var v={},I={},O={},R=[],L=-1;S.forEach(function(E,w){var P=T.arcs[E<0?~E:E],M;P.length<3&&!P[1][0]&&!P[1][1]&&(M=S[++L],S[L]=E,S[w]=M)}),S.forEach(function(E){var w=N(E),P=w[0],M=w[1],B,V;if(B=O[P])if(delete O[B.end],B.push(E),B.end=M,V=I[M]){delete I[V.start];var U=V===B?B:B.concat(V);I[U.start=B.start]=O[U.end=V.end]=U}else I[B.start]=O[B.end]=B;else if(B=I[M])if(delete I[B.start],B.unshift(E),B.start=P,V=O[P]){delete O[V.end];var G=V===B?B:V.concat(B);I[G.start=V.start]=O[G.end=B.end]=G}else I[B.start]=O[B.end]=B;else B=[E],I[B.start=P]=O[B.end=M]=B});function N(E){var w=T.arcs[E<0?~E:E],P=w[0],M;return T.transform?(M=[0,0],w.forEach(function(B){M[0]+=B[0],M[1]+=B[1]})):M=w[w.length-1],E<0?[M,P]:[P,M]}function _(E,w){for(var P in E){var M=E[P];delete w[M.start],delete M.start,delete M.end,M.forEach(function(B){v[B<0?~B:B]=1}),R.push(M)}}return _(O,I),_(I,O),S.forEach(function(E){v[E<0?~E:E]||R.push([E])}),R}function u(T){return a(T,f.apply(this,arguments))}function f(T,S,v){var I,O,R;if(arguments.length>1)I=d(T,S,v);else for(O=0,I=new Array(R=T.arcs.length);O<R;++O)I[O]=O;return{type:"MultiLineString",arcs:c(T,I)}}function d(T,S,v){var I=[],O=[],R;function L(P){var M=P<0?~P:P;(O[M]||(O[M]=[])).push({i:P,g:R})}function N(P){P.forEach(L)}function _(P){P.forEach(N)}function E(P){P.forEach(_)}function w(P){switch(R=P,P.type){case"GeometryCollection":P.geometries.forEach(w);break;case"LineString":N(P.arcs);break;case"MultiLineString":case"Polygon":_(P.arcs);break;case"MultiPolygon":E(P.arcs);break}}return w(S),O.forEach(v==null?function(P){I.push(P[0].i)}:function(P){v(P[0].g,P[P.length-1].g)&&I.push(P[0].i)}),I}function p(T){for(var S=-1,v=T.length,I,O=T[v-1],R=0;++S<v;)I=O,O=T[S],R+=I[0]*O[1]-I[1]*O[0];return Math.abs(R)}function g(T){return a(T,h.apply(this,arguments))}function h(T,S){var v={},I=[],O=[];S.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":L(_.arcs);break;case"MultiPolygon":_.arcs.forEach(L);break}}function L(_){_.forEach(function(E){E.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),I.push(_)}function N(_){return p(a(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return I.forEach(function(_){if(!_._){var E=[],w=[_];for(_._=1,O.push(E);_=w.pop();)E.push(_),_.forEach(function(P){P.forEach(function(M){v[M<0?~M:M].forEach(function(B){B._||(B._=1,w.push(B))})})})}}),I.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:O.map(function(_){var E=[],w;if(_.forEach(function(U){U.forEach(function(G){G.forEach(function(k){v[k<0?~k:k].length<2&&E.push(k)})})}),E=c(T,E),(w=E.length)>1)for(var P=1,M=N(E[0]),B,V;P<w;++P)(B=N(E[P]))>M&&(V=E[0],E[0]=E[P],E[P]=V,M=B);return E}).filter(function(_){return _.length>0})}}function x(T,S){for(var v=0,I=T.length;v<I;){var O=v+I>>>1;T[O]<S?v=O+1:I=O}return v}function b(T){var S={},v=T.map(function(){return[]});function I(U,G){U.forEach(function(k){k<0&&(k=~k);var Y=S[k];Y?Y.push(G):S[k]=[G]})}function O(U,G){U.forEach(function(k){I(k,G)})}function R(U,G){U.type==="GeometryCollection"?U.geometries.forEach(function(k){R(k,G)}):U.type in L&&L[U.type](U.arcs,G)}var L={LineString:I,MultiLineString:O,Polygon:O,MultiPolygon:function(U,G){U.forEach(function(k){O(k,G)})}};T.forEach(R);for(var N in S)for(var _=S[N],E=_.length,w=0;w<E;++w)for(var P=w+1;P<E;++P){var M=_[w],B=_[P],V;(V=v[M])[N=x(V,B)]!==B&&V.splice(N,0,B),(V=v[B])[N=x(V,M)]!==M&&V.splice(N,0,M)}return v}function C(T){if(T==null)return t;var S,v,I=T.scale[0],O=T.scale[1],R=T.translate[0],L=T.translate[1];return function(N,_){_||(S=v=0);var E=2,w=N.length,P=new Array(w),M=Math.round((N[0]-R)/I),B=Math.round((N[1]-L)/O);for(P[0]=M-S,S=M,P[1]=B-v,v=B;E<w;)P[E]=N[E],++E;return P}}function A(T,S){if(T.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((L=Math.floor(S))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var v=_[0],I=_[1],O=_[2],R=_[3],L;S={scale:[O-v?(O-v)/(L-1):1,R-I?(R-I)/(L-1):1],translate:[v,I]}}else _=T.bbox;var N=C(S),_,E,w=T.objects,P={};function M(U){return N(U)}function B(U){var G;switch(U.type){case"GeometryCollection":G={type:"GeometryCollection",geometries:U.geometries.map(B)};break;case"Point":G={type:"Point",coordinates:M(U.coordinates)};break;case"MultiPoint":G={type:"MultiPoint",coordinates:U.coordinates.map(M)};break;default:return U}return U.id!=null&&(G.id=U.id),U.bbox!=null&&(G.bbox=U.bbox),U.properties!=null&&(G.properties=U.properties),G}function V(U){var G=0,k=1,Y=U.length,j,J=new Array(Y);for(J[0]=N(U[0],0);++G<Y;)((j=N(U[G],G))[0]||j[1])&&(J[k++]=j);return k===1&&(J[k++]=[0,0]),J.length=k,J}for(E in w)P[E]=B(w[E]);return{type:"Topology",bbox:_,transform:S,objects:P,arcs:T.arcs.map(V)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=h,e.mesh=u,e.meshArcs=f,e.neighbors=b,e.quantize=A,e.transform=n,e.untransform=C,Object.defineProperty(e,"__esModule",{value:!0})})});var Ume=$n(Pz=>{"use strict";Object.defineProperty(Pz,"__esModule",{value:!0});Pz.version=void 0;Pz.version="4.0.0"});var VE=$n(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.assertNever=cc.removeWithPredicate=cc.remove=cc.ellipsis=cc.defaults=cc.isBoolean=cc.isUndefined=void 0;function Vme(e){return e===void 0}cc.isUndefined=Vme;function XJe(e){return typeof e=="boolean"}cc.isBoolean=XJe;function KJe(e,t){for(var n in t)t.hasOwnProperty(n)&&Vme(e[n])&&(e[n]=t[n]);return e}cc.defaults=KJe;function JJe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}cc.ellipsis=JJe;function ZJe(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}cc.remove=ZJe;function $Je(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}cc.removeWithPredicate=$Je;function QJe(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}cc.assertNever=QJe});var zb=$n(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.alphaNumericAndMarksRe=wi.alphaNumericAndMarksCharsStr=wi.alphaNumericCharsRe=wi.decimalNumbersStr=wi.alphaCharsAndMarksStr=wi.marksStr=wi.emojiStr=wi.alphaCharsStr=wi.controlCharsRe=wi.quoteRe=wi.whitespaceRe=wi.nonDigitRe=wi.digitRe=wi.letterRe=void 0;wi.letterRe=/[A-Za-z]/;wi.digitRe=/[\d]/;wi.nonDigitRe=/[\D]/;wi.whitespaceRe=/\s/;wi.quoteRe=/['"]/;wi.controlCharsRe=/[\x00-\x1F\x7F]/;wi.alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;wi.emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;wi.marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;wi.alphaCharsAndMarksStr=wi.alphaCharsStr+wi.emojiStr+wi.marksStr;wi.decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;wi.alphaNumericCharsRe=new RegExp("[".concat(wi.alphaCharsStr+wi.decimalNumbersStr,"]"));wi.alphaNumericAndMarksCharsStr=wi.alphaCharsAndMarksStr+wi.decimalNumbersStr;wi.alphaNumericAndMarksRe=new RegExp("[".concat(wi.alphaNumericAndMarksCharsStr,"]"))});var Oz=$n(Rz=>{"use strict";Object.defineProperty(Rz,"__esModule",{value:!0});Rz.HtmlTag=void 0;var Dz=zb(),eZe=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Dz.whitespaceRe):[],r=t.split(Dz.whitespaceRe),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Dz.whitespaceRe):[],r=t.split(Dz.whitespaceRe),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();Rz.HtmlTag=eZe});var zme=$n(Mz=>{"use strict";Object.defineProperty(Mz,"__esModule",{value:!0});Mz.truncateSmart=void 0;function tZe(e,t,n){var i,r;n==null?(n="…",r=3,i=8):(r=n.length,i=n.length);var o=function(A){var T={},S=A,v=S.match(/^([a-z]+):\/\//i);return v&&(T.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(T.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(T.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(T.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(T.fragment=v[1]),T},s=function(A){var T="";return A.scheme&&A.host&&(T+=A.scheme+"://"),A.host&&(T+=A.host),A.path&&(T+="/"+A.path),A.query&&(T+="?"+A.query),A.fragment&&(T+="#"+A.fragment),T},a=function(A,T){var S=T/2,v=Math.ceil(S),I=-1*Math.floor(S),O="";return I<0&&(O=A.substr(I)),A.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-r,u=o(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-r)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var h="#"+u.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var x=c-d.length;return(d+a(h,x)).substr(0,c+i)}else d+=h}if(u.scheme&&u.host){var b=u.scheme+"://";if((d+b).length<c)return(b+d).substr(0,t)}if(d.length<=t)return d;var C="";return c>0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}Mz.truncateSmart=tZe});var Hme=$n(Lz=>{"use strict";Object.defineProperty(Lz,"__esModule",{value:!0});Lz.truncateMiddle=void 0;function nZe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}Lz.truncateMiddle=nZe});var Gme=$n(Nz=>{"use strict";Object.defineProperty(Nz,"__esModule",{value:!0});Nz.truncateEnd=void 0;var iZe=VE();function rZe(e,t,n){return(0,iZe.ellipsis)(e,t,n)}Nz.truncateEnd=rZe});var uj=$n(Fz=>{"use strict";Object.defineProperty(Fz,"__esModule",{value:!0});Fz.AnchorTagBuilder=void 0;var oZe=Oz(),sZe=zme(),aZe=Hme(),cZe=Gme(),lZe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new oZe.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,r=n.location;return r==="smart"?(0,sZe.truncateSmart)(t,i):r==="middle"?(0,aZe.truncateMiddle)(t,i):(0,cZe.truncateEnd)(t,i)},e}();Fz.AnchorTagBuilder=lZe});var bh={};bJ(bh,{__assign:()=>Bz,__asyncDelegator:()=>nhe,__asyncGenerator:()=>the,__asyncValues:()=>ihe,__await:()=>zE,__awaiter:()=>Kme,__classPrivateFieldGet:()=>ahe,__classPrivateFieldIn:()=>lhe,__classPrivateFieldSet:()=>che,__createBinding:()=>Uz,__decorate:()=>qme,__esDecorate:()=>uZe,__exportStar:()=>Zme,__extends:()=>Wme,__generator:()=>Jme,__importDefault:()=>she,__importStar:()=>ohe,__makeTemplateObject:()=>rhe,__metadata:()=>Xme,__param:()=>Yme,__propKey:()=>dZe,__read:()=>dj,__rest:()=>jme,__runInitializers:()=>fZe,__setFunctionName:()=>mZe,__spread:()=>$me,__spreadArray:()=>ehe,__spreadArrays:()=>Qme,__values:()=>kz,default:()=>pZe});function Wme(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fj(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function jme(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function qme(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function Yme(e,t){return function(n,i){t(n,i,e)}}function uZe(e,t,n,i,r,o){function s(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var h={};for(var x in i)h[x]=x==="access"?{}:i[x];for(var x in i.access)h.access[x]=i.access[x];h.addInitializer=function(C){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(C||null))};var b=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],h);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=s(b.get))&&(f.get=d),(d=s(b.set))&&(f.set=d),(d=s(b.init))&&r.unshift(d)}else(d=s(b))&&(a==="field"?r.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function fZe(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function dZe(e){return typeof e=="symbol"?e:"".concat(e)}function mZe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Xme(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Kme(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):r(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function Jme(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Zme(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Uz(t,e,n)}function kz(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dj(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function $me(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(dj(arguments[t]));return e}function Qme(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function ehe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function zE(e){return this instanceof zE?(this.v=e,this):new zE(e)}function the(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(p){i[p]&&(r[p]=function(g){return new Promise(function(h,x){o.push([p,g,h,x])>1||a(p,g)})})}function a(p,g){try{c(i[p](g))}catch(h){d(o[0][3],h)}}function c(p){p.value instanceof zE?Promise.resolve(p.value.v).then(u,f):d(o[0][2],p)}function u(p){a("next",p)}function f(p){a("throw",p)}function d(p,g){p(g),o.shift(),o.length&&a(o[0][0],o[0][1])}}function nhe(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(s){return(n=!n)?{value:zE(e[r](s)),done:!1}:o?o(s):s}:o}}function ihe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof kz=="function"?kz(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function rhe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ohe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Uz(t,e,n);return hZe(t,e),t}function she(e){return e&&e.__esModule?e:{default:e}}function ahe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function che(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function lhe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}var fj,Bz,Uz,hZe,pZe,Ch=FCe(()=>{fj=function(e,t){return fj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},fj(e,t)};Bz=function(){return Bz=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Bz.apply(this,arguments)};Uz=Object.create?function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};hZe=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};pZe={__extends:Wme,__assign:Bz,__rest:jme,__decorate:qme,__param:Yme,__metadata:Xme,__awaiter:Kme,__generator:Jme,__createBinding:Uz,__exportStar:Zme,__values:kz,__read:dj,__spread:$me,__spreadArrays:Qme,__spreadArray:ehe,__await:zE,__asyncGenerator:the,__asyncDelegator:nhe,__asyncValues:ihe,__makeTemplateObject:rhe,__importStar:ohe,__importDefault:she,__classPrivateFieldGet:ahe,__classPrivateFieldSet:che,__classPrivateFieldIn:lhe}});var Hb=$n(Vz=>{"use strict";Object.defineProperty(Vz,"__esModule",{value:!0});Vz.AbstractMatch=void 0;var _Ze=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();Vz.AbstractMatch=_Ze});var uhe=$n(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});Gb.tldRegex=Gb.tldRegexStr=void 0;Gb.tldRegexStr="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)";Gb.tldRegex=new RegExp("^"+Gb.tldRegexStr+"$")});var zz=$n(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.isValidIpV4Address=Un.isValidTldMatch=Un.isValidSchemeUrl=Un.isKnownTld=Un.isUrlSuffixStartChar=Un.isPathChar=Un.isDomainLabelChar=Un.isDomainLabelStartChar=Un.isSchemeChar=Un.isSchemeStartChar=Un.tldUrlHostRe=Un.schemeUrlRe=Un.invalidSchemeRe=Un.urlSuffixedCharsNotAllowedAtEndRe=Un.httpSchemePrefixRe=Un.httpSchemeRe=Un.urlSuffixNotAllowedAsLastCharRe=Un.urlSuffixAllowedSpecialCharsRe=Un.urlSuffixStartCharsRe=Un.domainNameCharRegex=void 0;var Wb=zb(),gZe=uhe();Un.domainNameCharRegex=Wb.alphaNumericAndMarksRe;Un.urlSuffixStartCharsRe=/[\/?#]/;Un.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;Un.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;Un.httpSchemeRe=/https?:\/\//i;Un.httpSchemePrefixRe=new RegExp("^"+Un.httpSchemeRe.source,"i");Un.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(Un.urlSuffixNotAllowedAsLastCharRe.source+"$");Un.invalidSchemeRe=/^(javascript|vbscript):/i;Un.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Un.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function yZe(e){return Wb.letterRe.test(e)}Un.isSchemeStartChar=yZe;function xZe(e){return Wb.letterRe.test(e)||Wb.digitRe.test(e)||e==="+"||e==="-"||e==="."}Un.isSchemeChar=xZe;function fhe(e){return Wb.alphaNumericAndMarksRe.test(e)}Un.isDomainLabelStartChar=fhe;function bZe(e){return e==="_"||fhe(e)}Un.isDomainLabelChar=bZe;function CZe(e){return Wb.alphaNumericAndMarksRe.test(e)||Un.urlSuffixAllowedSpecialCharsRe.test(e)||Un.urlSuffixNotAllowedAsLastCharRe.test(e)}Un.isPathChar=CZe;function TZe(e){return Un.urlSuffixStartCharsRe.test(e)}Un.isUrlSuffixStartChar=TZe;function dhe(e){return gZe.tldRegex.test(e.toLowerCase())}Un.isKnownTld=dhe;function AZe(e){if(Un.invalidSchemeRe.test(e))return!1;var t=e.match(Un.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Wb.letterRe.test(i))}Un.isValidSchemeUrl=AZe;function EZe(e){var t=e.match(Un.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!dhe(r)}Un.isValidTldMatch=EZe;var SZe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,vZe=/[:/?#]/;function wZe(e){var t=e.split(vZe,1)[0];return SZe.test(t)}Un.isValidIpV4Address=wZe});var mj=$n(Hz=>{"use strict";Object.defineProperty(Hz,"__esModule",{value:!0});Hz.UrlMatch=void 0;var IZe=(Ch(),Pm(bh)),PZe=Hb(),DZe=zz(),RZe=/^(https?:\/\/)?(www\.)?/i,OZe=/^\/\//,MZe=function(e){(0,IZe.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=FZe(n)),this.stripPrefix.scheme&&(n=LZe(n)),this.stripPrefix.www&&(n=NZe(n)),this.stripTrailingSlash&&(n=BZe(n)),this.decodePercentEncoding&&(n=kZe(n)),n},t}(PZe.AbstractMatch);Hz.UrlMatch=MZe;function LZe(e){return e.replace(DZe.httpSchemePrefixRe,"")}function NZe(e){return e.replace(RZe,"$1")}function FZe(e){return e.replace(OZe,"")}function BZe(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function kZe(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var hhe=$n(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.isValidEmail=Th.isEmailLocalPartChar=Th.isEmailLocalPartStartChar=Th.mailtoSchemePrefixRe=void 0;var mhe=zb(),UZe=zz();Th.mailtoSchemePrefixRe=/^mailto:/i;var VZe=new RegExp("[".concat(mhe.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function zZe(e){return mhe.alphaNumericAndMarksRe.test(e)}Th.isEmailLocalPartStartChar=zZe;function HZe(e){return VZe.test(e)}Th.isEmailLocalPartChar=HZe;function GZe(e){var t=e.split(".").pop()||"";return(0,UZe.isKnownTld)(t)}Th.isValidEmail=GZe});var hj=$n(Gz=>{"use strict";Object.defineProperty(Gz,"__esModule",{value:!0});Gz.EmailMatch=void 0;var WZe=(Ch(),Pm(bh)),jZe=Hb(),qZe=function(e){(0,WZe.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(jZe.AbstractMatch);Gz.EmailMatch=qZe});var pj=$n(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});Ny.hashtagServices=Ny.isValidHashtag=Ny.isHashtagTextChar=void 0;var YZe=zb();function XZe(e){return e==="_"||YZe.alphaNumericAndMarksRe.test(e)}Ny.isHashtagTextChar=XZe;function KZe(e){return e.length<=140}Ny.isValidHashtag=KZe;Ny.hashtagServices=["twitter","facebook","instagram","tiktok"]});var _j=$n(Wz=>{"use strict";Object.defineProperty(Wz,"__esModule",{value:!0});Wz.HashtagMatch=void 0;var JZe=(Ch(),Pm(bh)),ZZe=VE(),$Ze=Hb(),QZe=function(e){(0,JZe.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw(0,ZZe.assertNever)(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}($Ze.AbstractMatch);Wz.HashtagMatch=QZe});var gj=$n(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.mentionServices=Fy.isValidMention=Fy.isMentionTextChar=void 0;var e$e={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},t$e=/[-\w.]/;function n$e(e){return t$e.test(e)}Fy.isMentionTextChar=n$e;function i$e(e,t){var n=e$e[t];return n.test(e)}Fy.isValidMention=i$e;Fy.mentionServices=["twitter","instagram","soundcloud","tiktok"]});var yj=$n(jz=>{"use strict";Object.defineProperty(jz,"__esModule",{value:!0});jz.MentionMatch=void 0;var r$e=(Ch(),Pm(bh)),o$e=Hb(),s$e=function(e){(0,r$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(o$e.AbstractMatch);jz.MentionMatch=s$e});var phe=$n(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.isValidPhoneNumber=By.isPhoneNumberControlChar=By.isPhoneNumberSeparatorChar=void 0;var a$e=/[-. ]/,c$e=/[-. ()]/,l$e=/[,;]/,u$e=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,f$e=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,d$e=new RegExp("^".concat(u$e.source,"|").concat(f$e.source,"$"));function m$e(e){return a$e.test(e)}By.isPhoneNumberSeparatorChar=m$e;function h$e(e){return l$e.test(e)}By.isPhoneNumberControlChar=h$e;function p$e(e){var t=e.charAt(0)==="+"||c$e.test(e);return t&&d$e.test(e)}By.isValidPhoneNumber=p$e});var xj=$n(qz=>{"use strict";Object.defineProperty(qz,"__esModule",{value:!0});qz.PhoneMatch=void 0;var _$e=(Ch(),Pm(bh)),g$e=Hb(),y$e=function(e){(0,_$e.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(g$e.AbstractMatch);qz.PhoneMatch=y$e});var Sj=$n(WE=>{"use strict";Object.defineProperty(WE,"__esModule",{value:!0});WE.excludeUnbalancedTrailingBracesAndPunctuation=WE.parseMatches=void 0;var wa=zb(),x$e=mj(),Pr=VE(),fo=zz(),HE=hhe(),b$e=hj(),bj=pj(),C$e=_j(),Cj=gj(),T$e=yj(),GE=phe(),A$e=xj();function E$e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,r=t.stripTrailingSlash,o=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],d=0;d<u;d++){var p=e.charAt(d);if(f.length===0)b(p);else for(var g=f.length-1;g>=0;g--){var h=f[g];switch(h.state){case 11:I(h,p);break;case 12:O(h,p);break;case 0:C(h,p);break;case 1:A(h,p);break;case 2:T(h,p);break;case 3:S(h,p);break;case 4:v(h,p);break;case 5:R(h,p);break;case 6:L(h,p);break;case 7:N(h,p);break;case 13:_(h,p);break;case 14:E(h,p);break;case 8:w(h,p);break;case 9:P(h,p);break;case 10:M(h,p);break;case 15:B(h,p);break;case 16:V(h,p);break;case 17:U(h,p);break;case 18:G(h,p);break;case 19:k(h,p);break;case 20:Y(h,p);break;case 21:j(h,p);break;case 22:J(h,p);break;case 23:W(h,p);break;case 24:K(h,p);break;case 25:Z(h,p);break;case 26:he(h,p);break;case 27:ge(h,p);break;case 28:se(h,p);break;case 29:pe(h,p);break;case 30:xe(h,p);break;case 31:Pe(h,p);break;case 32:Se(h,p);break;case 33:nt(h,p);break;case 34:Ze(h,p);break;case 35:Gt(h,p);break;case 36:fn(h,p);break;case 37:we(h,p);break;case 38:pt(h,p);break;case 39:Tn(h,p);break;case 40:Vn(h,p);break;case 41:Ut(h,p);break;default:(0,Pr.assertNever)(h.state)}}}for(var x=f.length-1;x>=0;x--)f.forEach(function(Ce){return Pt(Ce)});return c;function b(Ce){if(Ce==="#")f.push(I$e(d,28));else if(Ce==="@")f.push(P$e(d,30));else if(Ce==="/")f.push(Aj(d,11));else if(Ce==="+")f.push(Ej(d,37));else if(Ce==="(")f.push(Ej(d,32));else{if(wa.digitRe.test(Ce)&&(f.push(Ej(d,38)),f.push(v$e(d,13))),(0,HE.isEmailLocalPartStartChar)(Ce)){var ve=Ce.toLowerCase()==="m"?15:22;f.push(w$e(d,ve))}(0,fo.isSchemeStartChar)(Ce)&&f.push(Tj(d,0)),wa.alphaNumericAndMarksRe.test(Ce)&&f.push(Aj(d,5))}}function C(Ce,ve){ve===":"?Ce.state=2:ve==="-"?Ce.state=1:(0,fo.isSchemeChar)(ve)||(0,Pr.remove)(f,Ce)}function A(Ce,ve){ve==="-"||(ve==="/"?((0,Pr.remove)(f,Ce),f.push(Aj(d,11))):(0,fo.isSchemeChar)(ve)?Ce.state=0:(0,Pr.remove)(f,Ce))}function T(Ce,ve){ve==="/"?Ce.state=3:ve==="."?(0,Pr.remove)(f,Ce):(0,fo.isDomainLabelStartChar)(ve)?(Ce.state=5,(0,fo.isSchemeStartChar)(ve)&&f.push(Tj(d,0))):(0,Pr.remove)(f,Ce)}function S(Ce,ve){ve==="/"?Ce.state=4:(0,fo.isPathChar)(ve)?(Ce.state=10,Ce.acceptStateReached=!0):Pt(Ce)}function v(Ce,ve){ve==="/"?Ce.state=10:(0,fo.isDomainLabelStartChar)(ve)?(Ce.state=5,Ce.acceptStateReached=!0):(0,Pr.remove)(f,Ce)}function I(Ce,ve){ve==="/"?Ce.state=12:(0,Pr.remove)(f,Ce)}function O(Ce,ve){(0,fo.isDomainLabelStartChar)(ve)?Ce.state=5:(0,Pr.remove)(f,Ce)}function R(Ce,ve){ve==="."?Ce.state=7:ve==="-"?Ce.state=6:ve===":"?Ce.state=8:(0,fo.isUrlSuffixStartChar)(ve)?Ce.state=10:(0,fo.isDomainLabelChar)(ve)||Pt(Ce)}function L(Ce,ve){ve==="-"||(ve==="."?Pt(Ce):(0,fo.isDomainLabelStartChar)(ve)?Ce.state=5:Pt(Ce))}function N(Ce,ve){ve==="."?Pt(Ce):(0,fo.isDomainLabelStartChar)(ve)?(Ce.state=5,Ce.acceptStateReached=!0):Pt(Ce)}function _(Ce,ve){ve==="."?Ce.state=14:ve===":"?Ce.state=8:wa.digitRe.test(ve)||((0,fo.isUrlSuffixStartChar)(ve)?Ce.state=10:wa.alphaNumericAndMarksRe.test(ve)?(0,Pr.remove)(f,Ce):Pt(Ce))}function E(Ce,ve){wa.digitRe.test(ve)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):Pt(Ce)}function w(Ce,ve){wa.digitRe.test(ve)?Ce.state=9:Pt(Ce)}function P(Ce,ve){wa.digitRe.test(ve)||((0,fo.isUrlSuffixStartChar)(ve)?Ce.state=10:Pt(Ce))}function M(Ce,ve){(0,fo.isPathChar)(ve)||Pt(Ce)}function B(Ce,ve){ve.toLowerCase()==="a"?Ce.state=16:J(Ce,ve)}function V(Ce,ve){ve.toLowerCase()==="i"?Ce.state=17:J(Ce,ve)}function U(Ce,ve){ve.toLowerCase()==="l"?Ce.state=18:J(Ce,ve)}function G(Ce,ve){ve.toLowerCase()==="t"?Ce.state=19:J(Ce,ve)}function k(Ce,ve){ve.toLowerCase()==="o"?Ce.state=20:J(Ce,ve)}function Y(Ce,ve){ve.toLowerCase()===":"?Ce.state=21:J(Ce,ve)}function j(Ce,ve){(0,HE.isEmailLocalPartChar)(ve)?Ce.state=22:(0,Pr.remove)(f,Ce)}function J(Ce,ve){ve==="."?Ce.state=23:ve==="@"?Ce.state=24:(0,HE.isEmailLocalPartChar)(ve)?Ce.state=22:(0,Pr.remove)(f,Ce)}function W(Ce,ve){ve==="."||ve==="@"?(0,Pr.remove)(f,Ce):(0,HE.isEmailLocalPartChar)(ve)?Ce.state=22:(0,Pr.remove)(f,Ce)}function K(Ce,ve){(0,fo.isDomainLabelStartChar)(ve)?Ce.state=25:(0,Pr.remove)(f,Ce)}function Z(Ce,ve){ve==="."?Ce.state=27:ve==="-"?Ce.state=26:(0,fo.isDomainLabelChar)(ve)||Pt(Ce)}function he(Ce,ve){ve==="-"||ve==="."?Pt(Ce):(0,fo.isDomainLabelChar)(ve)?Ce.state=25:Pt(Ce)}function ge(Ce,ve){ve==="."||ve==="-"?Pt(Ce):(0,fo.isDomainLabelStartChar)(ve)?(Ce.state=25,Ce.acceptStateReached=!0):Pt(Ce)}function se(Ce,ve){(0,bj.isHashtagTextChar)(ve)?(Ce.state=29,Ce.acceptStateReached=!0):(0,Pr.remove)(f,Ce)}function pe(Ce,ve){(0,bj.isHashtagTextChar)(ve)||Pt(Ce)}function xe(Ce,ve){(0,Cj.isMentionTextChar)(ve)?(Ce.state=31,Ce.acceptStateReached=!0):(0,Pr.remove)(f,Ce)}function Pe(Ce,ve){(0,Cj.isMentionTextChar)(ve)||(wa.alphaNumericAndMarksRe.test(ve)?(0,Pr.remove)(f,Ce):Pt(Ce))}function we(Ce,ve){wa.digitRe.test(ve)?Ce.state=38:((0,Pr.remove)(f,Ce),b(ve))}function Se(Ce,ve){wa.digitRe.test(ve)?Ce.state=33:(0,Pr.remove)(f,Ce),b(ve)}function nt(Ce,ve){wa.digitRe.test(ve)?Ce.state=34:(0,Pr.remove)(f,Ce)}function Ze(Ce,ve){wa.digitRe.test(ve)?Ce.state=35:(0,Pr.remove)(f,Ce)}function Gt(Ce,ve){ve===")"?Ce.state=36:(0,Pr.remove)(f,Ce)}function fn(Ce,ve){wa.digitRe.test(ve)?Ce.state=38:(0,GE.isPhoneNumberSeparatorChar)(ve)?Ce.state=39:(0,Pr.remove)(f,Ce)}function pt(Ce,ve){Ce.acceptStateReached=!0,(0,GE.isPhoneNumberControlChar)(ve)?Ce.state=40:ve==="#"?Ce.state=41:wa.digitRe.test(ve)||(ve==="("?Ce.state=32:(0,GE.isPhoneNumberSeparatorChar)(ve)?Ce.state=39:(Pt(Ce),(0,fo.isSchemeStartChar)(ve)&&f.push(Tj(d,0))))}function Tn(Ce,ve){wa.digitRe.test(ve)?Ce.state=38:ve==="("?Ce.state=32:(Pt(Ce),b(ve))}function Vn(Ce,ve){(0,GE.isPhoneNumberControlChar)(ve)||(ve==="#"?Ce.state=41:wa.digitRe.test(ve)?Ce.state=38:Pt(Ce))}function Ut(Ce,ve){(0,GE.isPhoneNumberControlChar)(ve)?Ce.state=40:wa.digitRe.test(ve)?(0,Pr.remove)(f,Ce):Pt(Ce)}function Pt(Ce){if((0,Pr.remove)(f,Ce),!!Ce.acceptStateReached){var ve=Ce.startIdx,ot=e.slice(Ce.startIdx,d);if(ot=yhe(ot),Ce.type==="url"){var Kt=e.charAt(Ce.startIdx-1);if(Kt==="@")return;var _i=Ce.matchType;if(_i==="scheme"){var Je=fo.httpSchemeRe.exec(ot);if(Je&&(ve=ve+Je.index,ot=ot.slice(Je.index)),!(0,fo.isValidSchemeUrl)(ot))return}else if(_i==="tld"){if(!(0,fo.isValidTldMatch)(ot))return}else if(_i==="ipV4"){if(!(0,fo.isValidIpV4Address)(ot))return}else(0,Pr.assertNever)(_i);c.push(new x$e.UrlMatch({tagBuilder:n,matchedText:ot,offset:ve,urlMatchType:_i,url:ot,protocolRelativeMatch:ot.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:r,decodePercentEncoding:o}))}else if(Ce.type==="email")(0,HE.isValidEmail)(ot)&&c.push(new b$e.EmailMatch({tagBuilder:n,matchedText:ot,offset:ve,email:ot.replace(HE.mailtoSchemePrefixRe,"")}));else if(Ce.type==="hashtag")(0,bj.isValidHashtag)(ot)&&c.push(new C$e.HashtagMatch({tagBuilder:n,matchedText:ot,offset:ve,serviceName:s,hashtag:ot.slice(1)}));else if(Ce.type==="mention")(0,Cj.isValidMention)(ot,a)&&c.push(new T$e.MentionMatch({tagBuilder:n,matchedText:ot,offset:ve,serviceName:a,mention:ot.slice(1)}));else if(Ce.type==="phone"){if(ot=ot.replace(/ +$/g,""),(0,GE.isValidPhoneNumber)(ot)){var ho=ot.replace(/[^0-9,;#]/g,"");c.push(new A$e.PhoneMatch({tagBuilder:n,matchedText:ot,offset:ve,number:ho,plusSign:ot.charAt(0)==="+"}))}}else(0,Pr.assertNever)(Ce)}}}WE.parseMatches=E$e;var S$e=/[\(\{\[]/,_he=/[\)\}\]]/,ghe={")":"(","}":"{","]":"["};function yhe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);S$e.test(i)?t[i]++:_he.test(i)&&t[ghe[i]]--}for(var r=e.length-1,o;r>=0;)if(o=e.charAt(r),_he.test(o)){var s=ghe[o];if(t[s]<0)t[s]++,r--;else break}else if(fo.urlSuffixedCharsNotAllowedAtEndRe.test(o))r--;else break;return e.slice(0,r+1)}WE.excludeUnbalancedTrailingBracesAndPunctuation=yhe;function Tj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Aj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function v$e(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function w$e(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function I$e(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function P$e(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function Ej(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}});var xhe=$n(Yz=>{"use strict";Object.defineProperty(Yz,"__esModule",{value:!0});Yz.parseHtml=void 0;var lc=(Ch(),Pm(bh)),Kc=zb(),D$e=VE();function R$e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,r=t.onText,o=t.onComment,s=t.onDoctype,a=new Ah,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:h(g);break;case 1:x(g);break;case 2:C(g);break;case 3:b(g);break;case 4:A(g);break;case 5:T(g);break;case 6:S(g);break;case 7:v(g);break;case 8:I(g);break;case 9:O(g);break;case 10:R(g);break;case 11:L(g);break;case 12:N(g);break;case 13:_(g);break;case 14:E(g);break;case 15:w(g);break;case 16:P(g);break;case 17:M(g);break;case 18:B(g);break;case 19:V(g);break;case 20:U(g);break;default:(0,D$e.assertNever)(f)}c++}d<c&&j();function h(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{isClosing:!0}))):K==="<"?k():Kc.letterRe.test(K)?(f=3,p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){Kc.whitespaceRe.test(K)?(p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{name:J()})),f=4):K==="<"?k():K==="/"?(p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{name:J()})),f=12):K===">"?(p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{name:J()})),Y()):!Kc.letterRe.test(K)&&!Kc.digitRe.test(K)&&K!==":"&&G()}function C(K){K===">"?G():Kc.letterRe.test(K)?f=3:G()}function A(K){Kc.whitespaceRe.test(K)||(K==="/"?f=12:K===">"?Y():K==="<"?k():K==="="||Kc.quoteRe.test(K)||Kc.controlCharsRe.test(K)?G():f=5)}function T(K){Kc.whitespaceRe.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():Kc.quoteRe.test(K)&&G()}function S(K){Kc.whitespaceRe.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():Kc.quoteRe.test(K)?G():f=5)}function v(K){Kc.whitespaceRe.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function I(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){Kc.whitespaceRe.test(K)?f=4:K===">"?Y():K==="<"&&k()}function L(K){Kc.whitespaceRe.test(K)?f=4:K==="/"?f=12:K===">"?Y():K==="<"?k():(f=4,W())}function N(K){K===">"?(p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{isClosing:!0})),Y()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Ah((0,lc.__assign)((0,lc.__assign)({},p),{type:"doctype"})),f=20):G()}function E(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function P(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function B(K){K===">"?Y():K==="!"?f=19:K==="-"||(f=16)}function V(K){K==="-"?f=17:K===">"?Y():f=16}function U(K){K===">"?Y():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new Ah({idx:c})}function Y(){var K=e.slice(d,p.idx);K&&r(K,d),p.type==="comment"?o(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function j(){var K=e.slice(d,c);r(K,d),d=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}Yz.parseHtml=R$e;var Ah=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}()});var Xz=$n(vj=>{"use strict";Object.defineProperty(vj,"__esModule",{value:!0});var O$e=Ume(),_s=VE(),M$e=uj(),L$e=Oz(),N$e=Sj(),F$e=xhe(),B$e=gj(),k$e=pj(),U$e=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=V$e(t.urls),this.email=(0,_s.isBoolean)(t.email)?t.email:this.email,this.phone=(0,_s.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,_s.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=z$e(t.stripPrefix),this.stripTrailingSlash=(0,_s.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,_s.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&B$e.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&k$e.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=H$e(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return(0,F$e.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length,s=r+o;if(n+1<t.length){if(t[n+1].getOffset()===r){var a=t[n+1].getMatchedText().length>o?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,_s.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=(0,N$e.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof L$e.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new M$e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=O$e.version,e}();vj.default=U$e;function V$e(e){return e==null&&(e=!0),(0,_s.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,_s.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,_s.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,_s.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function z$e(e){return e==null&&(e=!0),(0,_s.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,_s.isBoolean)(e.scheme)?e.scheme:!0,www:(0,_s.isBoolean)(e.www)?e.www:!0}}function H$e(e){return typeof e=="number"?{length:e,location:"end"}:(0,_s.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var Che=$n(bhe=>{"use strict";Object.defineProperty(bhe,"__esModule",{value:!0})});var The=$n(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var jb=(Ch(),Pm(bh));(0,jb.__exportStar)(Che(),D_);(0,jb.__exportStar)(hj(),D_);(0,jb.__exportStar)(_j(),D_);(0,jb.__exportStar)(Hb(),D_);(0,jb.__exportStar)(yj(),D_);(0,jb.__exportStar)(xj(),D_);(0,jb.__exportStar)(mj(),D_)});var Ahe=$n(wj=>{"use strict";Object.defineProperty(wj,"__esModule",{value:!0});var G$e=(Ch(),Pm(bh));(0,G$e.__exportStar)(Sj(),wj)});var Ij=$n((cm,She)=>{"use strict";cm=She.exports=Xz().default;Object.defineProperty(cm,"__esModule",{value:!0});cm.Autolinker=void 0;var jE=(Ch(),Pm(bh)),Ehe=(0,jE.__importDefault)(Xz());cm.Autolinker=Ehe.default;cm.default=Ehe.default;(0,jE.__exportStar)(Xz(),cm);(0,jE.__exportStar)(uj(),cm);(0,jE.__exportStar)(Oz(),cm);(0,jE.__exportStar)(The(),cm);(0,jE.__exportStar)(Ahe(),cm)});var Lj=$n(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var YE={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-YE.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?YE.Bounce.In(e*2)*.5:YE.Bounce.Out(e*2-1)*.5+.5}}},ZL;typeof self>"u"&&typeof process<"u"&&process.hrtime?ZL=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?ZL=self.performance.now.bind(self.performance):Date.now!==void 0?ZL=Date.now:ZL=function(){return new Date().getTime()};var Uy=ZL,Mj=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=Uy()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),qb={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=qb.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=qb.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=qb.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=qb.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},Zz=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Hhe=new Mj,Ghe=function(){function e(t,n){n===void 0&&(n=Hhe),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=YE.Linear.None,this._interpolationFunction=qb.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Zz.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?Uy()+parseFloat(t):t:Uy(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,r){for(var o in i){var s=t[o],a=Array.isArray(s),c=a?"array":typeof s,u=!a&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(u){var f=i[o];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[o]=[s].concat(f)}if((c==="object"||a)&&s&&!u){n[o]=a?[]:{};for(var d in s)n[o][d]=s[d];r[o]=a?[]:{},this._setupProperties(s,n[o],i[o],r[o])}else typeof n[o]>"u"&&(n[o]=s),a||(n[o]*=1),u?r[o]=i[o].slice().reverse():r[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=Uy()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=Uy()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return this._group=t,this},e.prototype.delay=function(t){return this._delayTime=t,this},e.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return this._yoyo=t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.interpolation=function(t){return this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){if(t===void 0&&(t=Uy()),n===void 0&&(n=!0),this._isPaused)return!0;var i,r,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;n&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=this._duration===0||r>1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}(),Whe="18.6.4",jhe=Zz.nextId,Eh=Hhe,qhe=Eh.getAll.bind(Eh),Yhe=Eh.removeAll.bind(Eh),Xhe=Eh.add.bind(Eh),Khe=Eh.remove.bind(Eh),Jhe=Eh.update.bind(Eh),cQe={Easing:YE,Group:Mj,Interpolation:qb,now:Uy,Sequence:Zz,nextId:jhe,Tween:Ghe,VERSION:Whe,getAll:qhe,removeAll:Yhe,add:Xhe,remove:Khe,update:Jhe};uc.Easing=YE;uc.Group=Mj;uc.Interpolation=qb;uc.Sequence=Zz;uc.Tween=Ghe;uc.VERSION=Whe;uc.add=Xhe;uc.default=cQe;uc.getAll=qhe;uc.nextId=jhe;uc.now=Uy;uc.remove=Khe;uc.removeAll=Yhe;uc.update=Jhe});var Aq=$n((exports,module)=>{/*! + * protobuf.js v7.2.3 (c) 2016, daniel wirtz + * compiled mon, 27 mar 2023 18:08:22 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function r(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},r,a,a.exports),a.exports}var o=r(i[0]);o.util.global.protobuf=o,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(o.util.Long=s,o.configure()),o}),typeof module=="object"&&module&&module.exports&&(module.exports=o)})({1:[function(e,t,n){"use strict";t.exports=i;function i(r,o){for(var s=new Array(arguments.length-1),a=0,c=2,l=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(h){if(l)if(l=!1,h)p(h);else{for(var A=new Array(arguments.length-1),x=0;x<A.length;)A[x++]=arguments[x];d.apply(null,A)}};try{r.apply(o||null,s)}catch(g){l&&(l=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(l){var f=l.length;if(!f)return 0;for(var d=0;--f%4>1&&l.charAt(f)==="=";)++d;return Math.ceil(l.length*3)/4-d};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(l,f,d){for(var p=null,g=[],h=0,A=0,x;f<d;){var C=l[f++];switch(A){case 0:g[h++]=r[C>>2],x=(C&3)<<4,A=1;break;case 1:g[h++]=r[x|C>>4],x=(C&15)<<2,A=2;break;case 2:g[h++]=r[x|C>>6],g[h++]=r[C&63],A=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return A&&(g[h++]=r[x],g[h++]=61,A===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(l,f,d){for(var p=d,g=0,h,A=0;A<l.length;){var x=l.charCodeAt(A++);if(x===61&&g>1)break;if((x=o[x])===undefined)throw Error(a);switch(g){case 0:h=x,g=1;break;case 1:f[d++]=h<<2|(x&48)>>4,h=x,g=2;break;case 2:f[d++]=(h&15)<<4|(x&60)>>2,h=x,g=3;break;case 3:f[d++]=(h&3)<<6|x,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(l){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(l)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(o,s,a){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(o,s){if(o===undefined)this._listeners={};else if(s===undefined)this._listeners[o]=[];else for(var a=this._listeners[o],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(o){var s=this._listeners[o];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var l=new Float32Array([-0]),f=new Uint8Array(l.buffer),d=f[3]===128;function p(x,C,T){l[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3]}function g(x,C,T){l[0]=x,C[T]=f[3],C[T+1]=f[2],C[T+2]=f[1],C[T+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],l[0]}function A(x,C){return f[3]=x[C],f[2]=x[C+1],f[1]=x[C+2],f[0]=x[C+3],l[0]}c.readFloatLE=d?h:A,c.readFloatBE=d?A:h}():function(){function l(d,p,g,h){var A=p<0?1:0;if(A&&(p=-p),p===0)d(1/p>0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((A<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((A<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var x=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-x)*8388608)&8388607;d((A<<31|x+127<<23|C)>>>0,g,h)}}c.writeFloatLE=l.bind(null,r),c.writeFloatBE=l.bind(null,o);function f(d,p,g){var h=d(p,g),A=(h>>31)*2+1,x=h>>>23&255,C=h&8388607;return x===255?C?NaN:A*(1/0):x===0?A*1401298464324817e-60*C:A*Math.pow(2,x-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var l=new Float64Array([-0]),f=new Uint8Array(l.buffer),d=f[7]===128;function p(x,C,T){l[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(x,C,T){l[0]=x,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],f[4]=x[C+4],f[5]=x[C+5],f[6]=x[C+6],f[7]=x[C+7],l[0]}function A(x,C){return f[7]=x[C],f[6]=x[C+1],f[5]=x[C+2],f[4]=x[C+3],f[3]=x[C+4],f[2]=x[C+5],f[1]=x[C+6],f[0]=x[C+7],l[0]}c.readDoubleLE=d?h:A,c.readDoubleBE=d?A:h}():function(){function l(d,p,g,h,A,x){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,A,x+p),d(1/h>0?0:2147483648,A,x+g);else if(isNaN(h))d(0,A,x+p),d(2146959360,A,x+g);else if(h>17976931348623157e292)d(0,A,x+p),d((C<<31|2146435072)>>>0,A,x+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,A,x+p),d((C<<31|T/4294967296)>>>0,A,x+g);else{var E=Math.floor(Math.log(h)/Math.LN2);E===1024&&(E=1023),T=h*Math.pow(2,-E),d(T*4503599627370496>>>0,A,x+p),d((C<<31|E+1023<<20|T*1048576&1048575)>>>0,A,x+g)}}}c.writeDoubleLE=l.bind(null,r,0,4),c.writeDoubleBE=l.bind(null,o,4,0);function f(d,p,g,h,A){var x=d(h,A+p),C=d(h,A+g),T=(C>>31)*2+1,E=C>>>20&2047,S=4294967296*(C&1048575)+x;return E===2047?S?NaN:T*(1/0):E===0?T*5e-324*S:T*Math.pow(2,E-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function r(c,l,f){l[f]=c&255,l[f+1]=c>>>8&255,l[f+2]=c>>>16&255,l[f+3]=c>>>24}function o(c,l,f){l[f]=c>>>24,l[f+1]=c>>>16&255,l[f+2]=c>>>8&255,l[f+3]=c&255}function s(c,l){return(c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24)>>>0}function a(c,l){return(c[l]<<24|c[l+1]<<16|c[l+2]<<8|c[l+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(r,o,s){var a=s||8192,c=a>>>1,l=null,f=a;return function(p){if(p<1||p>c)return r(p);f+p>a&&(l=r(a),f=0);var g=o.call(l,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(o){for(var s=0,a=0,c=0;c<o.length;++c)a=o.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(o.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(o,s,a){var c=a-s;if(c<1)return"";for(var l=null,f=[],d=0,p;s<a;)p=o[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|o[s++]&63:p>239&&p<365?(p=((p&7)<<18|(o[s++]&63)<<12|(o[s++]&63)<<6|o[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(o[s++]&63)<<6|o[s++]&63,d>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,f)),d=0);return l?(d&&l.push(String.fromCharCode.apply(String,f.slice(0,d))),l.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(o,s,a){for(var c=a,l,f,d=0;d<o.length;++d)l=o.charCodeAt(d),l<128?s[a++]=l:l<2048?(s[a++]=l>>6|192,s[a++]=l&63|128):(l&64512)===55296&&((f=o.charCodeAt(d+1))&64512)===56320?(l=65536+((l&1023)<<10)+(f&1023),++d,s[a++]=l>>18|240,s[a++]=l>>12&63|128,s[a++]=l>>6&63|128,s[a++]=l&63|128):(s[a++]=l>>12|224,s[a++]=l>>6&63|128,s[a++]=l&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),r,o=i.LongBits,s=i.utf8;function a(h,A){return RangeError("index out of range: "+h.pos+" + "+(A||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var l=typeof Uint8Array<"u"?function(A){if(A instanceof Uint8Array||Array.isArray(A))return new c(A);throw Error("illegal buffer")}:function(A){if(Array.isArray(A))return new c(A);throw Error("illegal buffer")},f=function(){return i.Buffer?function(x){return(c.create=function(T){return i.Buffer.isBuffer(T)?new r(T):l(T)})(x)}:l};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var A=4294967295;return function(){if(A=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(A=(A|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return A;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return A}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var A=this.uint32();return A>>>1^-(A&1)|0};function d(){var h=new o(0,0),A=0;if(this.len-this.pos>4){for(;A<4;++A)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<A*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;A=0}else{for(;A<3;++A){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<A*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<A*7)>>>0,h}if(this.len-this.pos>4){for(;A<5;++A)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<A*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;A<5;++A){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<A*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,A){return(h[A-4]|h[A-3]<<8|h[A-2]<<16|h[A-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var A=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,A},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var A=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,A},c.prototype.bytes=function(){var A=this.uint32(),x=this.pos,C=this.pos+A;if(C>this.len)throw a(this,A);return this.pos+=A,Array.isArray(this.buf)?this.buf.slice(x,C):x===C?new this.buf.constructor(0):this._slice.call(this.buf,x,C)},c.prototype.string=function(){var A=this.bytes();return s.read(A,0,A.length)},c.prototype.skip=function(A){if(typeof A=="number"){if(this.pos+A>this.len)throw a(this,A);this.pos+=A}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){r=h,c.create=f(),r._configure();var A=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[A](!1)},uint64:function(){return d.call(this)[A](!0)},sint64:function(){return d.call(this).zzDecode()[A](!1)},fixed64:function(){return g.call(this)[A](!0)},sfixed64:function(){return g.call(this)[A](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(s){i.call(this,s)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},o._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=r;var i=e(15);(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r;function r(o,s,a){if(typeof o!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!s,this.responseDelimited=!!a}r.prototype.rpcCall=function o(s,a,c,l,f){if(!l)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(o,d,s,a,c,l);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](l).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(A){return d.emit("error",A,s),f(A)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=r;var i=e(15);function r(c,l){this.lo=c>>>0,this.hi=l>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(l){if(l===0)return o;var f=l<0;f&&(l=-l);var d=l>>>0,p=(l-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new r(d,p)},r.from=function(l){if(typeof l=="number")return r.fromNumber(l);if(i.isString(l))if(i.Long)l=i.Long.fromString(l);else return r.fromNumber(parseInt(l,10));return l.low||l.high?new r(l.low>>>0,l.high>>>0):o},r.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(l){return i.Long?new i.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var a=String.prototype.charCodeAt;r.fromHash=function(l){return l===s?o:new r((a.call(l,0)|a.call(l,1)<<8|a.call(l,2)<<16|a.call(l,3)<<24)>>>0,(a.call(l,4)|a.call(l,5)<<8|a.call(l,6)<<16|a.call(l,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},r.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},r.prototype.length=function(){var l=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?l<16384?l<128?1:2:l<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var l=a[c];return l!=null&&a.hasOwnProperty(c)?typeof l!="object"||(Array.isArray(l)?l.length:Object.keys(l).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var l=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(l.lo,l.hi,c):l.toNumber(!!c)};function r(s,a,c){for(var l=Object.keys(a),f=0;f<l.length;++f)(s[l[f]]===undefined||!c)&&(s[l[f]]=a[l[f]]);return s}i.merge=r,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function o(s){function a(c,l){if(!(this instanceof a))return new a(c,l);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),l&&r(this,l)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=o,i.ProtocolError=o("ProtocolError"),i.oneOfGetter=function(a){for(var c={},l=0;l<a.length;++l)c[a[l]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var l=0;l<a.length;++l)a[l]!==c&&delete this[a[l]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,l){return new s(c,l)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),r,o=i.LongBits,s=i.base64,a=i.utf8;function c(E,S,w){this.fn=E,this.len=S,this.next=undefined,this.val=w}function l(){}function f(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function d(){this.len=0,this.head=new c(l,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=p(),d.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(S,w,D){return this.tail=this.tail.next=new c(S,w,D),this.len+=w,this};function g(E,S,w){S[w]=E&255}function h(E,S,w){for(;E>127;)S[w++]=E&127|128,E>>>=7;S[w]=E}function A(E,S){this.len=E,this.next=undefined,this.val=S}A.prototype=Object.create(c.prototype),A.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new A((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(x,10,o.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function x(E,S,w){for(;E.hi;)S[w++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[w++]=E.lo&127|128,E.lo=E.lo>>>7;S[w++]=E.lo}d.prototype.uint64=function(S){var w=o.from(S);return this._push(x,w.length(),w)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var w=o.from(S).zzEncode();return this._push(x,w.length(),w)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(E,S,w){S[w]=E&255,S[w+1]=E>>>8&255,S[w+2]=E>>>16&255,S[w+3]=E>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var w=o.from(S);return this._push(C,4,w.lo)._push(C,4,w.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,w,D){w.set(S,D)}:function(S,w,D){for(var M=0;M<S.length;++M)w[D+M]=S[M]};d.prototype.bytes=function(S){var w=S.length>>>0;if(!w)return this._push(g,1,0);if(i.isString(S)){var D=d.alloc(w=s.length(S));s.decode(S,D,0),S=D}return this.uint32(w)._push(T,w,S)},d.prototype.string=function(S){var w=a.length(S);return w?this.uint32(w)._push(a.write,w,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(l,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(l,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,w=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=w,this.len+=D),this},d.prototype.finish=function(){for(var S=this.head.next,w=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,w,D),D+=S.len,S=S.next;return w},d._configure=function(E){r=E,d.create=p(),r._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=o;var i=e(16);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(){i.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(c,l,f){l.set(c,f)}:function(c,l,f){if(c.copy)c.copy(l,f,0,c.length);else for(var d=0;d<c.length;)l[f++]=c[d++]}},o.prototype.bytes=function(c){r.isString(c)&&(c=r._Buffer_from(c,"base64"));var l=c.length>>>0;return this.uint32(l),l&&this._push(o.writeBytesBuffer,l,c),this};function s(a,c,l){a.length<40?r.utf8.write(a,c,l):c.utf8Write?c.utf8Write(a,l):c.write(a,l)}o.prototype.string=function(c){var l=r.Buffer.byteLength(c);return this.uint32(l),l&&this._push(s,l,c),this},o._configure()},{15:15,16:16}]},{},[8])})()});var m0e=Jn((Tyi,cH)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,A=o(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),x={width:g.width,height:g.height,pixelData:A.resultPixels,minValue:A.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return A.resultMask&&(x.maskData=A.resultMask),d.returnEncodedMask&&g.mask&&(x.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(x.fileInfo=s(g),d.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(g))),x};var o=function(f,d,p,g,h){var A=0,x=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/x),E=Math.floor(f.height/C),S=2*f.maxZError,w=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var M,O;M=new d(f.width*f.height),h&&p&&(O=new Uint8Array(f.width*f.height));for(var B=new Float32Array(T*E),L,_,b=0;b<=C;b++){var v=b!==C?E:f.height%C;if(v!==0)for(var I=0;I<=x;I++){var R=I!==x?T:f.width%x;if(R!==0){var F=b*f.width*E+I*T,k=f.width-R,V=f.pixels.blocks[A],G,U,Y;V.encoding<2?(V.encoding===0?G=V.rawData:(l(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,B,f.pixels.maxValue),G=B),U=0):V.encoding===2?Y=0:Y=V.offset;var W;if(p)for(_=0;_<v;_++){for(F&7&&(W=p[F>>3],W<<=F&7),L=0;L<R;L++)F&7||(W=p[F>>3]),W&128?(O&&(O[F]=1),D=V.encoding<2?G[U++]:Y,w=w>D?D:w,M[F++]=D):(O&&(O[F]=0),M[F++]=g),W<<=1;F+=k}else if(V.encoding<2)for(_=0;_<v;_++){for(L=0;L<R;L++)D=G[U++],w=w>D?D:w,M[F++]=D;F+=k}else for(w=w>Y?Y:w,_=0;_<v;_++){for(L=0;L<R;L++)M[F++]=Y;F+=k}if(V.encoding===1&&U!==V.numValidPixels)throw"Block and Mask do not match";A++}}}return{resultPixels:M,resultMask:O,minValue:w}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var h=f.pixels.blocks[g];h.encoding===0?p.float32=!0:h.encoding===1?p[h.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},h=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,h),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var A=new DataView(f,d,24);if(g.fileVersion=A.getInt32(0,!0),g.imageType=A.getInt32(4,!0),g.height=A.getUint32(8,!0),g.width=A.getUint32(12,!0),g.maxZError=A.getFloat64(16,!0),d+=24,!p)if(A=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=A.getUint32(0,!0),g.mask.numBlocksX=A.getUint32(4,!0),g.mask.numBytes=A.getUint32(8,!0),g.mask.maxValue=A.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var x=new Uint8Array(Math.ceil(g.width*g.height/8));A=new DataView(f,d,g.mask.numBytes);var C=A.getInt16(0,!0),T=2,E=0;do{if(C>0)for(;C--;)x[E++]=A.getUint8(T++);else{var S=A.getUint8(T++);for(C=-C;C--;)x[E++]=S}C=A.getInt16(T,!0),T+=2}while(T<g.mask.numBytes);if(C!==-32768||E<x.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=x,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));A=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=A.getUint32(0,!0),g.pixels.numBlocksX=A.getUint32(4,!0),g.pixels.numBytes=A.getUint32(8,!0),g.pixels.maxValue=A.getFloat32(12,!0),d+=16;var w=g.pixels.numBlocksX,D=g.pixels.numBlocksY,M=w+(g.width%w>0?1:0),O=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(M*O);for(var B=0,L=0;L<O;L++)for(var _=0;_<M;_++){var b=0,v=f.byteLength-d;A=new DataView(f,d,Math.min(10,v));var I={};g.pixels.blocks[B++]=I;var R=A.getUint8(0);if(b++,I.encoding=R&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(R!==0&&R!==2){if(R>>=6,I.offsetType=R,R===2)I.offset=A.getInt8(1),b++;else if(R===1)I.offset=A.getInt16(1,!0),b+=2;else if(R===0)I.offset=A.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(I.encoding===1)if(R=A.getUint8(b),b++,I.bitsPerPixel=R&63,R>>=6,I.numValidPixelsType=R,R===2)I.numValidPixels=A.getUint8(b),b++;else if(R===1)I.numValidPixels=A.getUint16(b,!0),b+=2;else if(R===0)I.numValidPixels=A.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(d+=b,I.encoding!==3){var F,k;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";F=new ArrayBuffer(V*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,V*4));var G=new Float32Array(F);I.rawData=G,d+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),Y=Math.ceil(U/4);F=new ArrayBuffer(Y*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,U)),I.stuffedData=new Uint32Array(F),d+=U}}}return g.eofOffset=d,g},l=function(f,d,p,g,h,A,x){var C=(1<<d)-1,T=0,E,S=0,w,D,M=Math.ceil((x-g)/h),O=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*O,E=0;E<p;E++){if(S===0&&(D=f[T++],S=32),S>=d)w=D>>>S-d&C,S-=d;else{var B=d-S;w=(D&C)<<B&C,D=f[T++],S=32-B,w+=D>>>S}A[E]=w<M?g+w*h:x}return A};return r}(),t=function(){"use strict";var r={unstuff:function(c,l,f,d,p,g,h,A){var x=(1<<f)-1,C=0,T,E=0,S,w,D,M,O=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*O,p)for(T=0;T<d;T++)E===0&&(w=c[C++],E=32),E>=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<<D&x,w=c[C++],E=32-D,S+=w>>>E),l[T]=p[S];else for(M=Math.ceil((A-g)/h),T=0;T<d;T++)E===0&&(w=c[C++],E=32),E>=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<<D&x,w=c[C++],E=32-D,S+=w>>>E),l[T]=S<M?g+S*h:A},unstuffLUT:function(c,l,f,d,p,g){var h=(1<<l)-1,A=0,x=0,C=0,T=0,E=0,S,w=[],D=c.length*4-Math.ceil(l*f/8);c[c.length-1]<<=8*D;var M=Math.ceil((g-d)/p);for(x=0;x<f;x++)T===0&&(S=c[A++],T=32),T>=l?(E=S>>>T-l&h,T-=l):(C=l-T,E=(S&h)<<C&h,S=c[A++],T=32-C,E+=S>>>T),w[x]=E<M?d+E*p:g;return w.unshift(d),w},unstuff2:function(c,l,f,d,p,g,h,A){var x=(1<<f)-1,C=0,T,E=0,S=0,w,D,M;if(p)for(T=0;T<d;T++)E===0&&(D=c[C++],E=32,S=0),E>=f?(w=D>>>S&x,E-=f,S+=f):(M=f-E,w=D>>>S&x,D=c[C++],E=32-M,w|=(D&(1<<M)-1)<<f-M,S=M),l[T]=p[w];else{var O=Math.ceil((A-g)/h);for(T=0;T<d;T++)E===0&&(D=c[C++],E=32,S=0),E>=f?(w=D>>>S&x,E-=f,S+=f):(M=f-E,w=D>>>S&x,D=c[C++],E=32-M,w|=(D&(1<<M)-1)<<f-M,S=M),l[T]=w<O?g+w*h:A}return l},unstuffLUT2:function(c,l,f,d,p,g){var h=(1<<l)-1,A=0,x=0,C=0,T=0,E=0,S=0,w,D=[],M=Math.ceil((g-d)/p);for(x=0;x<f;x++)T===0&&(w=c[A++],T=32,S=0),T>=l?(E=w>>>S&h,T-=l,S+=l):(C=l-T,E=w>>>S&h,w=c[A++],T=32-C,E|=(w&(1<<C)-1)<<l-C,S=C),D[x]=E<M?d+E*p:g;return D.unshift(d),D},originalUnstuff:function(c,l,f,d){var p=(1<<f)-1,g=0,h,A=0,x,C,T,E=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*E,h=0;h<d;h++)A===0&&(C=c[g++],A=32),A>=f?(x=C>>>A-f&p,A-=f):(T=f-A,x=(C&p)<<T&p,C=c[g++],A=32-T,x+=C>>>A),l[h]=x;return l},originalUnstuff2:function(c,l,f,d){var p=(1<<f)-1,g=0,h,A=0,x=0,C,T,E;for(h=0;h<d;h++)A===0&&(T=c[g++],A=32,x=0),A>=f?(C=T>>>x&p,A-=f,x+=f):(E=f-A,C=T>>>x&p,T=c[g++],A=32-E,C|=(T&(1<<E)-1)<<f-E,x=E),l[h]=C;return l}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var l=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var h=p>=359?359:p;p-=h;do l+=c[g++]<<8,f+=l+=c[g++];while(--h);l=(l&65535)+(l>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=l+=c[g]<<8),l=(l&65535)+(l>>>16),f=(f&65535)+(f>>>16),(f<<16|l)>>>0},readHeaderInfo:function(c,l){var f=l.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,l.headerInfo=p,l.ptr=f;var A,x;if(h>=3&&(x=h>=4?52:48,A=this.computeChecksumFletcher32(new Uint8Array(c,f-x,p.blobSize-14)),A!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,l){var f=l.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,l.ptr,d,p),h=this.readSubArray(c,l.ptr+p,d,p);l.ptr+=2*p;var A,x=!0;for(A=0;A<f.numDims;A++)if(g[A]!==h[A]){x=!1;break}return f.minValues=g,f.maxValues=h,x},readSubArray:function(c,l,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,l,d);else{var g=new ArrayBuffer(d),h=new Uint8Array(g);h.set(new Uint8Array(c,l,d)),p=new f(g)}return p},readMask:function(c,l){var f=l.ptr,d=l.headerInfo,p=d.width*d.height,g=d.numValidPixel,h=new DataView(c,f,4),A={};if(A.numBytes=h.getUint32(0,!0),f+=4,(g===0||p===g)&&A.numBytes!==0)throw"invalid mask";var x,C;if(g===0)x=new Uint8Array(Math.ceil(p/8)),A.bitset=x,C=new Uint8Array(p),l.pixels.resultMask=C,f+=A.numBytes;else if(A.numBytes>0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,A.numBytes);var T=h.getInt16(0,!0),E=2,S=0,w=0;do{if(T>0)for(;T--;)x[S++]=h.getUint8(E++);else for(w=h.getUint8(E++),T=-T;T--;)x[S++]=w;T=h.getInt16(E,!0),E+=2}while(E<A.numBytes);if(T!==-32768||S<x.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var D=0,M=0;for(M=0;M<p;M++)M&7?(D=x[M>>3],D<<=M&7):D=x[M>>3],D&128&&(C[M]=1);l.pixels.resultMask=C,A.bitset=x,f+=A.numBytes}return l.ptr=f,l.mask=A,!0},readDataOneSweep:function(c,l,f){var d=l.ptr,p=l.headerInfo,g=p.numDims,h=p.width*p.height,A=p.imageType,x=p.numValidPixel*o.getDataTypeSize(A)*g,C,T=l.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,x);else{var E=new ArrayBuffer(x),S=new Uint8Array(E);S.set(new Uint8Array(c,d,x)),C=new f(E)}if(C.length===h*g)l.pixels.resultPixels=C;else{l.pixels.resultPixels=new f(h*g);var w=0,D=0,M=0,O=0;if(g>1)for(M=0;M<g;M++)for(O=M*h,D=0;D<h;D++)T[D]&&(l.pixels.resultPixels[O+D]=C[w++]);else for(D=0;D<h;D++)T[D]&&(l.pixels.resultPixels[D]=C[w++])}return d+=x,l.ptr=d,!0},readHuffmanTree:function(c,l){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,l.ptr,16);l.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),h=d.getInt32(8,!0),A=d.getInt32(12,!0);if(h>=A)return!1;var x=new Uint32Array(A-h);o.decodeBits(c,l,x);var C=[],T,E,S,w;for(T=h;T<A;T++)E=T-(T<g?0:g),C[E]={first:x[T-h],second:null};var D=c.byteLength-l.ptr,M=Math.ceil(D/4),O=new ArrayBuffer(M*4),B=new Uint8Array(O);B.set(new Uint8Array(c,l.ptr,D));var L=new Uint32Array(O),_=0,b,v=0;for(b=L[0],T=h;T<A;T++)E=T-(T<g?0:g),w=C[E].first,w>0&&(C[E].second=b<<_>>>32-w,32-_>=w?(_+=w,_===32&&(_=0,v++,b=L[v])):(_+=w-32,v++,b=L[v],C[E].second|=b>>>32-_));var I=0,R=0,F=new s;for(T=0;T<C.length;T++)C[T]!==void 0&&(I=Math.max(I,C[T].first));I>=f?R=f:R=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var k=[],V,G,U,Y,W,J;for(T=h;T<A;T++)if(E=T-(T<g?0:g),w=C[E].first,w>0)if(V=[w,E],w<=R)for(G=C[E].second<<R-w,U=1<<R-w,S=0;S<U;S++)k[G|S]=V;else for(G=C[E].second,J=F,Y=w-1;Y>=0;Y--)W=G>>>Y&1,W?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),Y===0&&!J.val&&(J.val=V[1]);return{decodeLut:k,numBitsLUTQick:R,numBitsLUT:I,tree:F,stuffedData:L,srcPtr:v,bitPos:_}},readHuffman:function(c,l,f){var d=l.headerInfo,p=d.numDims,g=l.headerInfo.height,h=l.headerInfo.width,A=h*g,x=this.readHuffmanTree(c,l),C=x.decodeLut,T=x.tree,E=x.stuffedData,S=x.srcPtr,w=x.bitPos,D=x.numBitsLUTQick,M=x.numBitsLUT,O=l.headerInfo.imageType===0?128:0,B,L,_,b=l.pixels.resultMask,v,I,R,F,k,V,G,U=0;w>0&&(S++,w=0);var Y=E[S],W=l.encodeMode===1,J=new f(A*p),j=J,K;for(K=0;K<d.numDims;K++){if(p>1&&(j=new f(J.buffer,A*K,A),U=0),l.headerInfo.numValidPixel===h*g)for(V=0,F=0;F<g;F++)for(k=0;k<h;k++,V++){if(L=0,v=Y<<w>>>32-D,I=v,32-w<D&&(v|=E[S+1]>>>64-w-D,I=v),C[I])L=C[I][1],w+=C[I][0];else for(v=Y<<w>>>32-M,I=v,32-w<M&&(v|=E[S+1]>>>64-w-M,I=v),B=T,G=0;G<M;G++)if(R=v>>>M-G-1&1,B=R?B.right:B.left,!(B.left||B.right)){L=B.val,w=w+G+1;break}w>=32&&(w-=32,S++,Y=E[S]),_=L-O,W?(k>0?_+=U:F>0?_+=j[V-h]:_+=U,_&=255,j[V]=_,U=_):j[V]=_}else for(V=0,F=0;F<g;F++)for(k=0;k<h;k++,V++)if(b[V]){if(L=0,v=Y<<w>>>32-D,I=v,32-w<D&&(v|=E[S+1]>>>64-w-D,I=v),C[I])L=C[I][1],w+=C[I][0];else for(v=Y<<w>>>32-M,I=v,32-w<M&&(v|=E[S+1]>>>64-w-M,I=v),B=T,G=0;G<M;G++)if(R=v>>>M-G-1&1,B=R?B.right:B.left,!(B.left||B.right)){L=B.val,w=w+G+1;break}w>=32&&(w-=32,S++,Y=E[S]),_=L-O,W?(k>0&&b[V-1]?_+=U:F>0&&b[V-h]?_+=j[V-h]:_+=U,_&=255,j[V]=_,U=_):j[V]=_}l.ptr=l.ptr+(S+1)*4+(w>0?4:0)}l.pixels.resultPixels=J},decodeBits:function(c,l,f,d,p){{var g=l.headerInfo,h=g.fileVersion,A=0,x=new DataView(c,l.ptr,5),C=x.getUint8(0);A++;var T=C>>6,E=T===0?4:3-T,S=(C&32)>0,w=C&31,D=0;if(E===1)D=x.getUint8(A),A++;else if(E===2)D=x.getUint16(A,!0),A+=2;else if(E===4)D=x.getUint32(A,!0),A+=4;else throw"Invalid valid pixel count type";var M=2*g.maxZError,O,B,L,_,b,v,I,R,F,k,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(l.counter.lut++,R=x.getUint8(A),F=w,A++,_=Math.ceil((R-1)*w/8),b=Math.ceil(_/4),B=new ArrayBuffer(b*4),L=new Uint8Array(B),l.ptr+=A,L.set(new Uint8Array(c,l.ptr,_)),I=new Uint32Array(B),l.ptr+=_,k=0;R-1>>>k;)k++;_=Math.ceil(D*k/8),b=Math.ceil(_/4),B=new ArrayBuffer(b*4),L=new Uint8Array(B),L.set(new Uint8Array(c,l.ptr,_)),O=new Uint32Array(B),l.ptr+=_,h>=3?v=r.unstuffLUT2(I,w,R-1,d,M,V):v=r.unstuffLUT(I,w,R-1,d,M,V),h>=3?r.unstuff2(O,f,k,D,v):r.unstuff(O,f,k,D,v)}else l.counter.bitstuffer++,k=w,l.ptr+=A,k>0&&(_=Math.ceil(D*k/8),b=Math.ceil(_/4),B=new ArrayBuffer(b*4),L=new Uint8Array(B),L.set(new Uint8Array(c,l.ptr,_)),O=new Uint32Array(B),l.ptr+=_,h>=3?d==null?r.originalUnstuff2(O,f,k,D):r.unstuff2(O,f,k,D,!1,d,M,V):d==null?r.originalUnstuff(O,f,k,D):r.unstuff(O,f,k,D,!1,d,M,V))}},readTiles:function(c,l,f){var d=l.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,A=d.imageType,x=o.getDataTypeSize(A),C=Math.ceil(p/h),T=Math.ceil(g/h);l.pixels.numBlocksY=T,l.pixels.numBlocksX=C,l.pixels.ptr=0;var E=0,S=0,w=0,D=0,M=0,O=0,B=0,L=0,_=0,b=0,v=0,I=0,R=0,F=0,k=0,V=0,G,U,Y,W,J,j,K=new f(h*h),Z=g%h||h,me=p%h||h,ye,se,pe=d.numDims,Ae,De=l.pixels.resultMask,Ce=l.pixels.resultPixels;for(w=0;w<T;w++)for(M=w!==T-1?h:Z,D=0;D<C;D++)for(O=D!==C-1?h:me,v=w*p*h+D*h,I=p-O,Ae=0;Ae<pe;Ae++){if(pe>1&&(Ce=new f(l.pixels.resultPixels.buffer,p*g*Ae*x,p*g)),B=c.byteLength-l.ptr,G=new DataView(c,l.ptr,Math.min(10,B)),U={},V=0,L=G.getUint8(0),V++,_=L>>6&255,b=L>>2&15,b!==(D*h>>3&15))throw"integrity issue";if(j=L&3,j>3)throw l.ptr+=V,"Invalid block encoding ("+j+")";if(j===2){l.counter.constant++,l.ptr+=V;continue}else if(j===0){if(l.counter.uncompressed++,l.ptr+=V,R=M*O*x,F=c.byteLength-l.ptr,R=R<F?R:F,Y=new ArrayBuffer(R%x===0?R:R+x-R%x),W=new Uint8Array(Y),W.set(new Uint8Array(c,l.ptr,R)),J=new f(Y),k=0,De)for(E=0;E<M;E++){for(S=0;S<O;S++)De[v]&&(Ce[v]=J[k++]),v++;v+=I}else for(E=0;E<M;E++){for(S=0;S<O;S++)Ce[v++]=J[k++];v+=I}l.ptr+=k*x}else if(ye=o.getDataTypeUsed(A,_),se=o.getOnePixel(U,V,ye,G),V+=o.getDataTypeSize(ye),j===3)if(l.ptr+=V,l.counter.constantoffset++,De)for(E=0;E<M;E++){for(S=0;S<O;S++)De[v]&&(Ce[v]=se),v++;v+=I}else for(E=0;E<M;E++){for(S=0;S<O;S++)Ce[v++]=se;v+=I}else if(l.ptr+=V,o.decodeBits(c,l,K,se,Ae),V=0,De)for(E=0;E<M;E++){for(S=0;S<O;S++)De[v]&&(Ce[v]=K[V++]),v++;v+=I}else for(E=0;E<M;E++){for(S=0;S<O;S++)Ce[v++]=K[V++];v+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var l=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,h=0,A=0,x=c.pixels.resultMask;if(x)if(f>1)for(g=0;g<f;g++)for(A=g*d,h=0;h<d;h++)x[h]&&(c.pixels.resultPixels[A+h]=l);else for(h=0;h<d;h++)x[h]&&(c.pixels.resultPixels[h]=l);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(l);else for(h=0;h<p;h++)c.pixels.resultPixels[h]=l},getDataTypeArray:function(c){var l;switch(c){case 0:l=Int8Array;break;case 1:l=Uint8Array;break;case 2:l=Int16Array;break;case 3:l=Uint16Array;break;case 4:l=Int32Array;break;case 5:l=Uint32Array;break;case 6:l=Float32Array;break;case 7:l=Float64Array;break;default:l=Float32Array}return l},getPixelType:function(c){var l;switch(c){case 0:l="S8";break;case 1:l="U8";break;case 2:l="S16";break;case 3:l="U16";break;case 4:l="S32";break;case 5:l="U32";break;case 6:l="F32";break;case 7:l="F64";break;default:l="F32"}return l},isValidPixelValue:function(c,l){if(l==null)return!1;var f;switch(c){case 0:f=l>=-128&&l<=127;break;case 1:f=l>=0&&l<=255;break;case 2:f=l>=-32768&&l<=32767;break;case 3:f=l>=0&&l<=65536;break;case 4:f=l>=-2147483648&&l<=2147483647;break;case 5:f=l>=0&&l<=4294967296;break;case 6:f=l>=-34027999387901484e22&&l<=34027999387901484e22;break;case 7:f=l>=5e-324&&l<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var l=0;switch(c){case 0:case 1:l=1;break;case 2:case 3:l=2;break;case 4:case 5:case 6:l=4;break;case 7:l=8;break;default:l=c}return l},getDataTypeUsed:function(c,l){var f=c;switch(c){case 2:case 4:f=c-l;break;case 3:case 5:f=c-2*l;break;case 6:l===0?f=c:l===1?f=2:f=1;break;case 7:l===0?f=c:f=c-2*l+1;break;default:f=c;break}return f},getOnePixel:function(c,l,f,d){var p=0;switch(f){case 0:p=d.getInt8(l);break;case 1:p=d.getUint8(l);break;case 2:p=d.getInt16(l,!0);break;case 3:p=d.getUint16(l,!0);break;case 4:p=d.getInt32(l,!0);break;case 5:p=d.getUInt32(l,!0);break;case 6:p=d.getFloat32(l,!0);break;case 7:p=d.getFloat64(l,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,l,f){this.val=c,this.left=l,this.right=f},a={decode:function(c,l){l=l||{};var f=l.noDataValue,d=0,p={};if(p.ptr=l.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,A=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=l.maskData);var x=g.width*g.height;if(p.pixels.resultPixels=new A(x*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(h>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)o.readDataOneSweep(c,p,A);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=C.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||h<4&&E>1)throw"Invalid Huffman flag "+E;E?o.readHuffman(c,p,A):o.readTiles(c,p,A)}else o.readTiles(c,p,A)}p.eofOffset=p.ptr;var S;l.inputOffset?(S=p.headerInfo.blobSize+l.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=l.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var w={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d<x;d++)D[d]||(w.pixelData[d]=f);w.noDataValue=f}return p.noDataValue=f,l.returnFileInfo&&(w.fileInfo=o.formatFileInfo(p)),w}},getBandCount:function(c){var l=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,l++,d.ptr=f;return l}};return a}(),n=function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1}(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),l,f;if(c.trim()==="CntZImage")l=e,f=1;else if(c.substring(0,5)==="Lerc2")l=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,h=[],A,x,C={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var T=l.decode(r,{inputOffset:s,encodedMaskData:g,maskData:x,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=T.fileInfo.eofOffset,d===0&&(g=T.encodedMaskData,x=T.maskData,C.width=T.width,C.height=T.height,C.dimCount=T.dimCount||1,C.pixelType=T.pixelType||T.fileInfo.pixelType,C.mask=T.maskData),f>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var E,S,w;if(f>1&&h.length>1){for(w=C.width*C.height,C.bandMasks=h,x=new Uint8Array(w),x.set(h[0]),E=1;E<h.length;E++)for(A=h[E],S=0;S<w;S++)x[S]=x[S]&A[S];C.maskData=x}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof cH<"u"&&cH.exports?cH.exports=i:this.Lerc=i})()});var Vxe=Jn((d3,tJ)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof d3=="object"&&typeof tJ=="object"?tJ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof d3=="object"?d3.NoSleep=t():e.NoSleep=t()})(d3,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var s in i)n.d(o,s,function(a){return i[a]}.bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(d,p){for(var g=0;g<p.length;g++){var h=p[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}}(),r=n(1),o=r.webm,s=r.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},l=function(){function f(){var d=this;if(function(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var h=document.createElement("source");h.src=g,h.type="video/"+p,d.appendChild(h)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then(function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function r(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},r,a,a.exports),a.exports}var o=r(i[0]);o.util.global.protobuf=o,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(o.util.Long=s,o.configure()),o}),typeof module=="object"&&module&&module.exports&&(module.exports=o)})({1:[function(e,t,n){"use strict";t.exports=i;function i(r,o){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(h){if(u)if(u=!1,h)p(h);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];d.apply(null,x)}};try{r.apply(o||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],h=0,x=0,b;f<d;){var C=u[f++];switch(x){case 0:g[h++]=r[C>>2],b=(C&3)<<4,x=1;break;case 1:g[h++]=r[b|C>>4],b=(C&15)<<2,x=2;break;case 2:g[h++]=r[b|C>>6],g[h++]=r[C&63],x=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return x&&(g[h++]=r[b],g[h++]=61,x===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&g>1)break;if((b=o[b])===undefined)throw Error(a);switch(g){case 0:h=b,g=1;break;case 1:f[d++]=h<<2|(b&48)>>4,h=b,g=2;break;case 2:f[d++]=(h&15)<<4|(b&60)>>2,h=b,g=3;break;case 3:f[d++]=(h&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(o,s,a){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(o,s){if(o===undefined)this._listeners={};else if(s===undefined)this._listeners[o]=[];else for(var a=this._listeners[o],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(o){var s=this._listeners[o];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(b,C,A){u[0]=b,C[A]=f[0],C[A+1]=f[1],C[A+2]=f[2],C[A+3]=f[3]}function g(b,C,A){u[0]=b,C[A]=f[3],C[A+1]=f[2],C[A+2]=f[1],C[A+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function h(b,C){return f[0]=b[C],f[1]=b[C+1],f[2]=b[C+2],f[3]=b[C+3],u[0]}function x(b,C){return f[3]=b[C],f[2]=b[C+1],f[1]=b[C+2],f[0]=b[C+3],u[0]}c.readFloatLE=d?h:x,c.readFloatBE=d?x:h}():function(){function u(d,p,g,h){var x=p<0?1:0;if(x&&(p=-p),p===0)d(1/p>0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var b=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((x<<31|b+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,r),c.writeFloatBE=u.bind(null,o);function f(d,p,g){var h=d(p,g),x=(h>>31)*2+1,b=h>>>23&255,C=h&8388607;return b===255?C?NaN:x*(1/0):b===0?x*1401298464324817e-60*C:x*Math.pow(2,b-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,C,A){u[0]=b,C[A]=f[0],C[A+1]=f[1],C[A+2]=f[2],C[A+3]=f[3],C[A+4]=f[4],C[A+5]=f[5],C[A+6]=f[6],C[A+7]=f[7]}function g(b,C,A){u[0]=b,C[A]=f[7],C[A+1]=f[6],C[A+2]=f[5],C[A+3]=f[4],C[A+4]=f[3],C[A+5]=f[2],C[A+6]=f[1],C[A+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(b,C){return f[0]=b[C],f[1]=b[C+1],f[2]=b[C+2],f[3]=b[C+3],f[4]=b[C+4],f[5]=b[C+5],f[6]=b[C+6],f[7]=b[C+7],u[0]}function x(b,C){return f[7]=b[C],f[6]=b[C+1],f[5]=b[C+2],f[4]=b[C+3],f[3]=b[C+4],f[2]=b[C+5],f[1]=b[C+6],f[0]=b[C+7],u[0]}c.readDoubleLE=d?h:x,c.readDoubleBE=d?x:h}():function(){function u(d,p,g,h,x,b){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,x,b+p),d(1/h>0?0:2147483648,x,b+g);else if(isNaN(h))d(0,x,b+p),d(2146959360,x,b+g);else if(h>17976931348623157e292)d(0,x,b+p),d((C<<31|2146435072)>>>0,x,b+g);else{var A;if(h<22250738585072014e-324)A=h/5e-324,d(A>>>0,x,b+p),d((C<<31|A/4294967296)>>>0,x,b+g);else{var T=Math.floor(Math.log(h)/Math.LN2);T===1024&&(T=1023),A=h*Math.pow(2,-T),d(A*4503599627370496>>>0,x,b+p),d((C<<31|T+1023<<20|A*1048576&1048575)>>>0,x,b+g)}}}c.writeDoubleLE=u.bind(null,r,0,4),c.writeDoubleBE=u.bind(null,o,4,0);function f(d,p,g,h,x){var b=d(h,x+p),C=d(h,x+g),A=(C>>31)*2+1,T=C>>>20&2047,S=4294967296*(C&1048575)+b;return T===2047?S?NaN:A*(1/0):T===0?A*5e-324*S:A*Math.pow(2,T-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function r(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function o(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(r,o,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return r(p);f+p>a&&(u=r(a),f=0);var g=o.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(o){for(var s=0,a=0,c=0;c<o.length;++c)a=o.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(o.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(o,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=o[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|o[s++]&63:p>239&&p<365?(p=((p&7)<<18|(o[s++]&63)<<12|(o[s++]&63)<<6|o[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(o[s++]&63)<<6|o[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(o,s,a){for(var c=a,u,f,d=0;d<o.length;++d)u=o.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=o.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),r,o=i.LongBits,s=i.utf8;function a(h,x){return RangeError("index out of range: "+h.pos+" + "+(x||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(A){return i.Buffer.isBuffer(A)?new r(A):u(A)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var h=new o(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,h}if(this.len-this.pos>4){for(;x<5;++x)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,x){return(h[x-4]|h[x-3]<<8|h[x-2]<<16|h[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);return this.pos+=x,Array.isArray(this.buf)?this.buf.slice(b,C):b===C?new this.buf.constructor(0):this._slice.call(this.buf,b,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){r=h,c.create=f(),r._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(s){i.call(this,s)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},o._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=r;var i=e(15);(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r;function r(o,s,a){if(typeof o!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!s,this.responseDelimited=!!a}r.prototype.rpcCall=function o(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(o,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=r;var i=e(15);function r(c,u){this.lo=c>>>0,this.hi=u>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return o;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new r(d,p)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):o},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;r.fromHash=function(u){return u===s?o:new r((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function r(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=r,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function o(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&r(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=o,i.ProtocolError=o("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),r,o=i.LongBits,s=i.base64,a=i.utf8;function c(T,S,v){this.fn=T,this.len=S,this.next=undefined,this.val=v}function u(){}function f(T){this.head=T.head,this.tail=T.tail,this.len=T.len,this.next=T.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=p(),d.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(S,v,I){return this.tail=this.tail.next=new c(S,v,I),this.len+=v,this};function g(T,S,v){S[v]=T&255}function h(T,S,v){for(;T>127;)S[v++]=T&127|128,T>>>=7;S[v]=T}function x(T,S){this.len=T,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(b,10,o.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(T,S,v){for(;T.hi;)S[v++]=T.lo&127|128,T.lo=(T.lo>>>7|T.hi<<25)>>>0,T.hi>>>=7;for(;T.lo>127;)S[v++]=T.lo&127|128,T.lo=T.lo>>>7;S[v++]=T.lo}d.prototype.uint64=function(S){var v=o.from(S);return this._push(b,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var v=o.from(S).zzEncode();return this._push(b,v.length(),v)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(T,S,v){S[v]=T&255,S[v+1]=T>>>8&255,S[v+2]=T>>>16&255,S[v+3]=T>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var v=o.from(S);return this._push(C,4,v.lo)._push(C,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var A=i.Array.prototype.set?function(S,v,I){v.set(S,I)}:function(S,v,I){for(var O=0;O<S.length;++O)v[I+O]=S[O]};d.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var I=d.alloc(v=s.length(S));s.decode(S,I,0),S=I}return this.uint32(v)._push(A,v,S)},d.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,v=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=S.next,this.tail=v,this.len+=I),this},d.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),I=0;S;)S.fn(S.val,v,I),I+=S.len,S=S.next;return v},d._configure=function(T){r=T,d.create=p(),r._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=o;var i=e(16);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(){i.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},o.prototype.bytes=function(c){r.isString(c)&&(c=r._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(o.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?r.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}o.prototype.string=function(c){var u=r.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},o._configure()},{15:15,16:16}]},{},[8])})()});var Tbe=$n((sIi,jH)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,x=o(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),b={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return x.resultMask&&(b.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(g),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var o=function(f,d,p,g,h){var x=0,b=f.pixels.numBlocksX,C=f.pixels.numBlocksY,A=Math.floor(f.width/b),T=Math.floor(f.height/C),S=2*f.maxZError,v=Number.MAX_VALUE,I;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new d(f.width*f.height),h&&p&&(R=new Uint8Array(f.width*f.height));for(var L=new Float32Array(A*T),N,_,E=0;E<=C;E++){var w=E!==C?T:f.height%C;if(w!==0)for(var P=0;P<=b;P++){var M=P!==b?A:f.width%b;if(M!==0){var B=E*f.width*T+P*A,V=f.width-M,U=f.pixels.blocks[x],G,k,Y;U.encoding<2?(U.encoding===0?G=U.rawData:(u(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,S,L,f.pixels.maxValue),G=L),k=0):U.encoding===2?Y=0:Y=U.offset;var j;if(p)for(_=0;_<w;_++){for(B&7&&(j=p[B>>3],j<<=B&7),N=0;N<M;N++)B&7||(j=p[B>>3]),j&128?(R&&(R[B]=1),I=U.encoding<2?G[k++]:Y,v=v>I?I:v,O[B++]=I):(R&&(R[B]=0),O[B++]=g),j<<=1;B+=V}else if(U.encoding<2)for(_=0;_<w;_++){for(N=0;N<M;N++)I=G[k++],v=v>I?I:v,O[B++]=I;B+=V}else for(v=v>Y?Y:v,_=0;_<w;_++){for(N=0;N<M;N++)O[B++]=Y;B+=V}if(U.encoding===1&&k!==U.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var h=f.pixels.blocks[g];h.encoding===0?p.float32=!0:h.encoding===1?p[h.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},h=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,h),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var x=new DataView(f,d,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),d+=24,!p)if(x=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var C=x.getInt16(0,!0),A=2,T=0;do{if(C>0)for(;C--;)b[T++]=x.getUint8(A++);else{var S=x.getUint8(A++);for(C=-C;C--;)b[T++]=S}C=x.getInt16(A,!0),A+=2}while(A<g.mask.numBytes);if(C!==-32768||T<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,I=g.pixels.numBlocksY,O=v+(g.width%v>0?1:0),R=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(O*R);for(var L=0,N=0;N<R;N++)for(var _=0;_<O;_++){var E=0,w=f.byteLength-d;x=new DataView(f,d,Math.min(10,w));var P={};g.pixels.blocks[L++]=P;var M=x.getUint8(0);if(E++,P.encoding=M&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,P.offsetType=M,M===2)P.offset=x.getInt8(1),E++;else if(M===1)P.offset=x.getInt16(1,!0),E+=2;else if(M===0)P.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(P.encoding===1)if(M=x.getUint8(E),E++,P.bitsPerPixel=M&63,M>>=6,P.numValidPixelsType=M,M===2)P.numValidPixels=x.getUint8(E),E++;else if(M===1)P.numValidPixels=x.getUint16(E,!0),E+=2;else if(M===0)P.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,P.encoding!==3){var B,V;if(P.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";B=new ArrayBuffer(U*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,U*4));var G=new Float32Array(B);P.rawData=G,d+=U*4}else if(P.encoding===1){var k=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),Y=Math.ceil(k/4);B=new ArrayBuffer(Y*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,k)),P.stuffedData=new Uint32Array(B),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,x,b){var C=(1<<d)-1,A=0,T,S=0,v,I,O=Math.ceil((b-g)/h),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(S===0&&(I=f[A++],S=32),S>=d)v=I>>>S-d&C,S-=d;else{var L=d-S;v=(I&C)<<L&C,I=f[A++],S=32-L,v+=I>>>S}x[T]=v<O?g+v*h:b}return x};return r}(),t=function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,h,x){var b=(1<<f)-1,C=0,A,T=0,S,v,I,O,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(A=0;A<d;A++)T===0&&(v=c[C++],T=32),T>=f?(S=v>>>T-f&b,T-=f):(I=f-T,S=(v&b)<<I&b,v=c[C++],T=32-I,S+=v>>>T),u[A]=p[S];else for(O=Math.ceil((x-g)/h),A=0;A<d;A++)T===0&&(v=c[C++],T=32),T>=f?(S=v>>>T-f&b,T-=f):(I=f-T,S=(v&b)<<I&b,v=c[C++],T=32-I,S+=v>>>T),u[A]=S<O?g+S*h:x},unstuffLUT:function(c,u,f,d,p,g){var h=(1<<u)-1,x=0,b=0,C=0,A=0,T=0,S,v=[],I=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*I;var O=Math.ceil((g-d)/p);for(b=0;b<f;b++)A===0&&(S=c[x++],A=32),A>=u?(T=S>>>A-u&h,A-=u):(C=u-A,T=(S&h)<<C&h,S=c[x++],A=32-C,T+=S>>>A),v[b]=T<O?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,h,x){var b=(1<<f)-1,C=0,A,T=0,S=0,v,I,O;if(p)for(A=0;A<d;A++)T===0&&(I=c[C++],T=32,S=0),T>=f?(v=I>>>S&b,T-=f,S+=f):(O=f-T,v=I>>>S&b,I=c[C++],T=32-O,v|=(I&(1<<O)-1)<<f-O,S=O),u[A]=p[v];else{var R=Math.ceil((x-g)/h);for(A=0;A<d;A++)T===0&&(I=c[C++],T=32,S=0),T>=f?(v=I>>>S&b,T-=f,S+=f):(O=f-T,v=I>>>S&b,I=c[C++],T=32-O,v|=(I&(1<<O)-1)<<f-O,S=O),u[A]=v<R?g+v*h:x}return u},unstuffLUT2:function(c,u,f,d,p,g){var h=(1<<u)-1,x=0,b=0,C=0,A=0,T=0,S=0,v,I=[],O=Math.ceil((g-d)/p);for(b=0;b<f;b++)A===0&&(v=c[x++],A=32,S=0),A>=u?(T=v>>>S&h,A-=u,S+=u):(C=u-A,T=v>>>S&h,v=c[x++],A=32-C,T|=(v&(1<<C)-1)<<u-C,S=C),I[b]=T<O?d+T*p:g;return I.unshift(d),I},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,h,x=0,b,C,A,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,h=0;h<d;h++)x===0&&(C=c[g++],x=32),x>=f?(b=C>>>x-f&p,x-=f):(A=f-x,b=(C&p)<<A&p,C=c[g++],x=32-A,b+=C>>>x),u[h]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,h,x=0,b=0,C,A,T;for(h=0;h<d;h++)x===0&&(A=c[g++],x=32,b=0),x>=f?(C=A>>>b&p,x-=f,b+=f):(T=f-x,C=A>>>b&p,A=c[g++],x=32-T,C|=(A&(1<<T)-1)<<f-T,b=T),u[h]=C;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var h=p>=359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(h>=3&&(b=h>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(g[x]!==h[x]){b=!1;break}return f.minValues=g,f.maxValues=h,b},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),h=new Uint8Array(g);h.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,h=new DataView(c,f,4),x={};if(x.numBytes=h.getUint32(0,!0),f+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var b,C;if(g===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,C=new Uint8Array(p),u.pixels.resultMask=C,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,x.numBytes);var A=h.getInt16(0,!0),T=2,S=0,v=0;do{if(A>0)for(;A--;)b[S++]=h.getUint8(T++);else for(v=h.getUint8(T++),A=-A;A--;)b[S++]=v;A=h.getInt16(T,!0),T+=2}while(T<x.numBytes);if(A!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var I=0,O=0;for(O=0;O<p;O++)O&7?(I=b[O>>3],I<<=O&7):I=b[O>>3],I&128&&(C[O]=1);u.pixels.resultMask=C,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,x=p.imageType,b=p.numValidPixel*o.getDataTypeSize(x)*g,C,A=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,b);else{var T=new ArrayBuffer(b),S=new Uint8Array(T);S.set(new Uint8Array(c,d,b)),C=new f(T)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var v=0,I=0,O=0,R=0;if(g>1)for(O=0;O<g;O++)for(R=O*h,I=0;I<h;I++)A[I]&&(u.pixels.resultPixels[R+I]=C[v++]);else for(I=0;I<h;I++)A[I]&&(u.pixels.resultPixels[I]=C[v++])}return d+=b,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),h=d.getInt32(8,!0),x=d.getInt32(12,!0);if(h>=x)return!1;var b=new Uint32Array(x-h);o.decodeBits(c,u,b);var C=[],A,T,S,v;for(A=h;A<x;A++)T=A-(A<g?0:g),C[T]={first:b[A-h],second:null};var I=c.byteLength-u.ptr,O=Math.ceil(I/4),R=new ArrayBuffer(O*4),L=new Uint8Array(R);L.set(new Uint8Array(c,u.ptr,I));var N=new Uint32Array(R),_=0,E,w=0;for(E=N[0],A=h;A<x;A++)T=A-(A<g?0:g),v=C[T].first,v>0&&(C[T].second=E<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,E=N[w])):(_+=v-32,w++,E=N[w],C[T].second|=E>>>32-_));var P=0,M=0,B=new s;for(A=0;A<C.length;A++)C[A]!==void 0&&(P=Math.max(P,C[A].first));P>=f?M=f:M=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var V=[],U,G,k,Y,j,J;for(A=h;A<x;A++)if(T=A-(A<g?0:g),v=C[T].first,v>0)if(U=[v,T],v<=M)for(G=C[T].second<<M-v,k=1<<M-v,S=0;S<k;S++)V[G|S]=U;else for(G=C[T].second,J=B,Y=v-1;Y>=0;Y--)j=G>>>Y&1,j?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),Y===0&&!J.val&&(J.val=U[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:P,tree:B,stuffedData:N,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,x=h*g,b=this.readHuffmanTree(c,u),C=b.decodeLut,A=b.tree,T=b.stuffedData,S=b.srcPtr,v=b.bitPos,I=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,L,N,_,E=u.pixels.resultMask,w,P,M,B,V,U,G,k=0;v>0&&(S++,v=0);var Y=T[S],j=u.encodeMode===1,J=new f(x*p),W=J,K;for(K=0;K<d.numDims;K++){if(p>1&&(W=new f(J.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===h*g)for(U=0,B=0;B<g;B++)for(V=0;V<h;V++,U++){if(N=0,w=Y<<v>>>32-I,P=w,32-v<I&&(w|=T[S+1]>>>64-v-I,P=w),C[P])N=C[P][1],v+=C[P][0];else for(w=Y<<v>>>32-O,P=w,32-v<O&&(w|=T[S+1]>>>64-v-O,P=w),L=A,G=0;G<O;G++)if(M=w>>>O-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=T[S]),_=N-R,j?(V>0?_+=k:B>0?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}else for(U=0,B=0;B<g;B++)for(V=0;V<h;V++,U++)if(E[U]){if(N=0,w=Y<<v>>>32-I,P=w,32-v<I&&(w|=T[S+1]>>>64-v-I,P=w),C[P])N=C[P][1],v+=C[P][0];else for(w=Y<<v>>>32-O,P=w,32-v<O&&(w|=T[S+1]>>>64-v-O,P=w),L=A,G=0;G<O;G++)if(M=w>>>O-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=T[S]),_=N-R,j?(V>0&&E[U-1]?_+=k:B>0&&E[U-h]?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,x=0,b=new DataView(c,u.ptr,5),C=b.getUint8(0);x++;var A=C>>6,T=A===0?4:3-A,S=(C&32)>0,v=C&31,I=0;if(T===1)I=b.getUint8(x),x++;else if(T===2)I=b.getUint16(x,!0),x+=2;else if(T===4)I=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,R,L,N,_,E,w,P,M,B,V,U=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,M=b.getUint8(x),B=v,x++,_=Math.ceil((M-1)*v/8),E=Math.ceil(_/4),L=new ArrayBuffer(E*4),N=new Uint8Array(L),u.ptr+=x,N.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(L),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(I*V/8),E=Math.ceil(_/4),L=new ArrayBuffer(E*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,h>=3?w=r.unstuffLUT2(P,v,M-1,d,O,U):w=r.unstuffLUT(P,v,M-1,d,O,U),h>=3?r.unstuff2(R,f,V,I,w):r.unstuff(R,f,V,I,w)}else u.counter.bitstuffer++,V=v,u.ptr+=x,V>0&&(_=Math.ceil(I*V/8),E=Math.ceil(_/4),L=new ArrayBuffer(E*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,h>=3?d==null?r.originalUnstuff2(R,f,V,I):r.unstuff2(R,f,V,I,!1,d,O,U):d==null?r.originalUnstuff(R,f,V,I):r.unstuff(R,f,V,I,!1,d,O,U))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,x=d.imageType,b=o.getDataTypeSize(x),C=Math.ceil(p/h),A=Math.ceil(g/h);u.pixels.numBlocksY=A,u.pixels.numBlocksX=C,u.pixels.ptr=0;var T=0,S=0,v=0,I=0,O=0,R=0,L=0,N=0,_=0,E=0,w=0,P=0,M=0,B=0,V=0,U=0,G,k,Y,j,J,W,K=new f(h*h),Z=g%h||h,he=p%h||h,ge,se,pe=d.numDims,xe,Pe=u.pixels.resultMask,we=u.pixels.resultPixels;for(v=0;v<A;v++)for(O=v!==A-1?h:Z,I=0;I<C;I++)for(R=I!==C-1?h:he,w=v*p*h+I*h,P=p-R,xe=0;xe<pe;xe++){if(pe>1&&(we=new f(u.pixels.resultPixels.buffer,p*g*xe*b,p*g)),L=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,L)),k={},U=0,N=G.getUint8(0),U++,_=N>>6&255,E=N>>2&15,E!==(I*h>>3&15))throw"integrity issue";if(W=N&3,W>3)throw u.ptr+=U,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=U;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=U,M=O*R*b,B=c.byteLength-u.ptr,M=M<B?M:B,Y=new ArrayBuffer(M%b===0?M:M+b-M%b),j=new Uint8Array(Y),j.set(new Uint8Array(c,u.ptr,M)),J=new f(Y),V=0,Pe)for(T=0;T<O;T++){for(S=0;S<R;S++)Pe[w]&&(we[w]=J[V++]),w++;w+=P}else for(T=0;T<O;T++){for(S=0;S<R;S++)we[w++]=J[V++];w+=P}u.ptr+=V*b}else if(ge=o.getDataTypeUsed(x,_),se=o.getOnePixel(k,U,ge,G),U+=o.getDataTypeSize(ge),W===3)if(u.ptr+=U,u.counter.constantoffset++,Pe)for(T=0;T<O;T++){for(S=0;S<R;S++)Pe[w]&&(we[w]=se),w++;w+=P}else for(T=0;T<O;T++){for(S=0;S<R;S++)we[w++]=se;w+=P}else if(u.ptr+=U,o.decodeBits(c,u,K,se,xe),U=0,Pe)for(T=0;T<O;T++){for(S=0;S<R;S++)Pe[w]&&(we[w]=K[U++]),w++;w+=P}else for(T=0;T<O;T++){for(S=0;S<R;S++)we[w++]=K[U++];w+=P}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,h=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(x=g*d,h=0;h<d;h++)b[h]&&(c.pixels.resultPixels[x+h]=u);else for(h=0;h<d;h++)b[h]&&(c.pixels.resultPixels[h]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(h=0;h<p;h++)c.pixels.resultPixels[h]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,x=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new x(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(h>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),A=C.getUint8(0);if(p.ptr++,A)o.readDataOneSweep(c,p,x);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=C.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||h<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,x):o.readTiles(c,p,x)}else o.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var I=p.pixels.resultMask;for(d=0;d<b;d++)I[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1}(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,h=[],x,b,C={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var A=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=A.fileInfo.eofOffset,d===0&&(g=A.encodedMaskData,b=A.maskData,C.width=A.width,C.height=A.height,C.dimCount=A.dimCount||1,C.pixelType=A.pixelType||A.fileInfo.pixelType,C.mask=A.maskData),f>1&&A.fileInfo.mask&&A.fileInfo.mask.numBytes>0&&h.push(A.maskData),d++,C.pixels.push(A.pixelData),C.statistics.push({minValue:A.minValue,maxValue:A.maxValue,noDataValue:A.noDataValue,dimStats:A.dimStats})}var T,S,v;if(f>1&&h.length>1){for(v=C.width*C.height,C.bandMasks=h,b=new Uint8Array(v),b.set(h[0]),T=1;T<h.length;T++)for(x=h[T],S=0;S<v;S++)b[S]=b[S]&x[S];C.maskData=b}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof jH<"u"&&jH.exports?jH.exports=i:this.Lerc=i})()});var CCe=$n((y3,fJ)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof y3=="object"&&typeof fJ=="object"?fJ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof y3=="object"?y3.NoSleep=t():e.NoSleep=t()})(y3,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var s in i)n.d(o,s,function(a){return i[a]}.bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(d,p){for(var g=0;g<p.length;g++){var h=p[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}}(),r=n(1),o=r.webm,s=r.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=function(){function f(){var d=this;if(function(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var h=document.createElement("source");h.src=g,h.type="video/"+p,d.appendChild(h)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then(function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(function(p){return d.enabled=!0,p}).catch(function(p){throw d.enabled=!1,p})}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=l},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var _xt={};uJ(_xt,{AlphaMode:()=>Xm,AlphaPipelineStage:()=>TO,Animation:()=>O2,AnimationViewModel:()=>M2,Appearance:()=>or,ApproximateTerrainHeights:()=>si,ArcGISTiledElevationTerrainProvider:()=>$j,ArcGisBaseMapType:()=>gm,ArcGisMapServerImageryProvider:()=>Ph,ArcGisMapService:()=>Bu,ArcType:()=>Jt,ArticulationStageType:()=>ec,AssociativeArray:()=>Tt,AttributeCompression:()=>Yn,AttributeType:()=>an,AutoExposure:()=>DL,AutomaticUniforms:()=>Yh,Axis:()=>hr,AxisAlignedBoundingBox:()=>ug,B3dmLoader:()=>k1,B3dmParser:()=>F1,BaseLayerPicker:()=>B2,BaseLayerPickerViewModel:()=>R2,BatchTable:()=>G0,BatchTableHierarchy:()=>_A,BatchTexture:()=>Vc,BatchTexturePipelineStage:()=>EO,Billboard:()=>gr,BillboardCollection:()=>lu,BillboardGraphics:()=>ja,BillboardVisualizer:()=>SI,BingMapsGeocoderService:()=>tq,BingMapsImageryProvider:()=>lS,BingMapsStyle:()=>aS,BlendEquation:()=>ya,BlendFunction:()=>wr,BlendOption:()=>Dr,BlendingState:()=>dn,BoundingRectangle:()=>Ye,BoundingSphere:()=>ae,BoundingSphereState:()=>ut,BoxEmitter:()=>dY,BoxGeometry:()=>fl,BoxGeometryUpdater:()=>HP,BoxGraphics:()=>nA,BoxOutlineGeometry:()=>ld,BrdfLutGenerator:()=>ML,Buffer:()=>mt,BufferLoader:()=>TA,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>wO,CallbackProperty:()=>gd,Camera:()=>dr,CameraEventAggregator:()=>$L,CameraEventType:()=>Li,CameraFlightPath:()=>JL,Cartesian2:()=>H,Cartesian3:()=>m,Cartesian4:()=>oe,Cartographic:()=>he,CartographicGeocoderService:()=>lL,CatmullRomSpline:()=>iq,Cesium3DContentGroup:()=>pA,Cesium3DTile:()=>Tf,Cesium3DTileBatchTable:()=>Ep,Cesium3DTileColorBlendMode:()=>gl,Cesium3DTileContent:()=>EY,Cesium3DTileContentFactory:()=>KA,Cesium3DTileContentState:()=>Gr,Cesium3DTileContentType:()=>us,Cesium3DTileFeature:()=>Is,Cesium3DTileFeatureTable:()=>Od,Cesium3DTileOptimizationHint:()=>_f,Cesium3DTileOptimizations:()=>iR,Cesium3DTilePass:()=>Nr,Cesium3DTilePassState:()=>Hf,Cesium3DTilePointFeature:()=>qp,Cesium3DTileRefine:()=>kr,Cesium3DTileStyle:()=>F_,Cesium3DTileStyleEngine:()=>lR,Cesium3DTilesInspector:()=>k2,Cesium3DTilesInspectorViewModel:()=>V2,Cesium3DTilesVoxelProvider:()=>wY,Cesium3DTileset:()=>va,Cesium3DTilesetBaseTraversal:()=>pR,Cesium3DTilesetCache:()=>sR,Cesium3DTilesetGraphics:()=>lA,Cesium3DTilesetHeatmap:()=>aR,Cesium3DTilesetMetadata:()=>oy,Cesium3DTilesetMostDetailedTraversal:()=>dR,Cesium3DTilesetSkipTraversal:()=>yR,Cesium3DTilesetStatistics:()=>c_,Cesium3DTilesetTraversal:()=>Ls,Cesium3DTilesetVisualizer:()=>AR,CesiumInspector:()=>G2,CesiumInspectorViewModel:()=>H2,CesiumTerrainProvider:()=>qy,CesiumWidget:()=>T2,Check:()=>ol,CheckerboardMaterialProperty:()=>ME,CircleEmitter:()=>oN,CircleGeometry:()=>cq,CircleOutlineGeometry:()=>lq,ClassificationModelDrawCommand:()=>nO,ClassificationPipelineStage:()=>bO,ClassificationPrimitive:()=>ET,ClassificationType:()=>zn,ClearCommand:()=>ri,ClippingPlane:()=>RA,ClippingPlaneCollection:()=>cs,Clock:()=>qd,ClockRange:()=>Bo,ClockStep:()=>yr,ClockViewModel:()=>w2,CloudCollection:()=>RY,CloudType:()=>mS,Color:()=>z,ColorBlendMode:()=>$a,ColorGeometryInstanceAttribute:()=>zt,ColorMaterialProperty:()=>Vt,Command:()=>HK,ComponentDatatype:()=>X,Composite3DTileContent:()=>JP,CompositeEntityCollection:()=>j9,CompositeMaterialProperty:()=>BE,CompositePositionProperty:()=>na,CompositeProperty:()=>oc,CompressedTextureBuffer:()=>wv,ComputeCommand:()=>Yu,ComputeEngine:()=>mv,ConditionsExpression:()=>eN,ConeEmitter:()=>NY,ConstantPositionProperty:()=>Rc,ConstantProperty:()=>ei,ConstantSpline:()=>W1,ContentMetadata:()=>qM,Context:()=>yI,ContextLimits:()=>Ht,CoplanarPolygonGeometry:()=>nB,CoplanarPolygonGeometryLibrary:()=>n_,CoplanarPolygonOutlineGeometry:()=>xf,CornerType:()=>Ri,CorridorGeometry:()=>fx,CorridorGeometryLibrary:()=>ki,CorridorGeometryUpdater:()=>DR,CorridorGraphics:()=>rA,CorridorOutlineGeometry:()=>wR,Credit:()=>Dt,CreditDisplay:()=>pN,CubeMap:()=>Ga,CubeMapFace:()=>Nm,CubicRealPolynomial:()=>z0,CullFace:()=>yi,CullingVolume:()=>es,CumulusCloud:()=>Nu,CustomDataSource:()=>RR,CustomHeightmapTerrainProvider:()=>fq,CustomShader:()=>kC,CustomShaderMode:()=>Wp,CustomShaderPipelineStage:()=>BO,CustomShaderTranslucencyMode:()=>Gg,CylinderGeometry:()=>BR,CylinderGeometryLibrary:()=>mx,CylinderGeometryUpdater:()=>NR,CylinderGraphics:()=>oA,CylinderOutlineGeometry:()=>LR,CzmlDataSource:()=>qR,DataSource:()=>Mo,DataSourceClock:()=>Yd,DataSourceCollection:()=>YR,DataSourceDisplay:()=>RB,DebugAppearance:()=>JY,DebugCameraPrimitive:()=>Bh,DebugInspector:()=>yN,DebugModelMatrixPrimitive:()=>AN,DefaultProxy:()=>mq,DepthFunction:()=>qa,DepthPlane:()=>bN,DequantizationPipelineStage:()=>NO,DerivedCommand:()=>k_,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>vN,DirectionalLight:()=>QY,DiscardEmptyTileImagePolicy:()=>cS,DiscardMissingTileImagePolicy:()=>wL,DistanceDisplayCondition:()=>wt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>Qx,DoublyLinkedList:()=>oR,DracoLoader:()=>Op,DrawCommand:()=>et,DynamicGeometryBatch:()=>Cx,DynamicGeometryUpdater:()=>ai,EarthOrientationParameters:()=>Sv,EarthOrientationParametersSample:()=>Q_,EasingFunction:()=>Lo,EllipseGeometry:()=>Yc,EllipseGeometryLibrary:()=>Pl,EllipseGeometryUpdater:()=>KR,EllipseGraphics:()=>sA,EllipseOutlineGeometry:()=>yu,Ellipsoid:()=>re,EllipsoidGeodesic:()=>tf,EllipsoidGeometry:()=>Us,EllipsoidGeometryUpdater:()=>ZR,EllipsoidGraphics:()=>aA,EllipsoidOutlineGeometry:()=>fu,EllipsoidPrimitive:()=>wN,EllipsoidRhumbLine:()=>xa,EllipsoidSurfaceAppearance:()=>eX,EllipsoidTangentPlane:()=>Aa,EllipsoidTerrainProvider:()=>$x,EllipsoidalOccluder:()=>h_,Empty3DTileContent:()=>gE,EncodedCartesian3:()=>qn,Entity:()=>Jr,EntityCluster:()=>du,EntityCollection:()=>Ns,EntityView:()=>LB,Event:()=>_e,EventHelper:()=>Io,Expression:()=>of,ExpressionNodeType:()=>gt,ExtrapolationType:()=>hu,FeatureDetection:()=>Gt,FeatureIdPipelineStage:()=>Hg,Fog:()=>PN,ForEach:()=>Oe,FrameRateMonitor:()=>ON,FrameState:()=>MN,Framebuffer:()=>Ys,FramebufferManager:()=>mi,FrustumCommands:()=>RN,FrustumGeometry:()=>tC,FrustumOutlineGeometry:()=>hL,Fullscreen:()=>ho,FullscreenButton:()=>j2,FullscreenButtonViewModel:()=>W2,GeoJsonDataSource:()=>jB,GeoJsonLoader:()=>z1,GeocodeType:()=>Xy,Geocoder:()=>K2,GeocoderService:()=>tS,GeocoderViewModel:()=>X2,GeographicProjection:()=>Ii,GeographicTilingScheme:()=>ji,Geometry:()=>dt,Geometry3DTileContent:()=>QP,GeometryAttribute:()=>Ie,GeometryAttributes:()=>mn,GeometryFactory:()=>yq,GeometryInstance:()=>Ct,GeometryInstanceAttribute:()=>Ya,GeometryOffsetAttribute:()=>on,GeometryPipeline:()=>Nn,GeometryPipelineStage:()=>kO,GeometryType:()=>Xu,GeometryUpdater:()=>ci,GeometryVisualizer:()=>xB,GetFeatureInfoFormat:()=>dC,Globe:()=>ZN,GlobeDepth:()=>QN,GlobeSurfaceShaderSet:()=>FN,GlobeSurfaceTile:()=>Wf,GlobeSurfaceTileProvider:()=>zN,GlobeTranslucency:()=>HN,GlobeTranslucencyFramebuffer:()=>$N,GlobeTranslucencyState:()=>eF,GltfBufferViewLoader:()=>FT,GltfDracoLoader:()=>UT,GltfImageLoader:()=>VT,GltfIndexBufferLoader:()=>kT,GltfJsonLoader:()=>HT,GltfLoader:()=>Km,GltfLoaderUtil:()=>xl,GltfStructuralMetadataLoader:()=>R1,GltfTextureLoader:()=>GT,GltfVertexBufferLoader:()=>WT,GoogleEarthEnterpriseImageryProvider:()=>xX,GoogleEarthEnterpriseMapsProvider:()=>gS,GoogleEarthEnterpriseMetadata:()=>pm,GoogleEarthEnterpriseTerrainData:()=>nS,GoogleEarthEnterpriseTerrainProvider:()=>wq,GoogleEarthEnterpriseTileInformation:()=>_L,GpxDataSource:()=>JB,GregorianDate:()=>Qh,GridImageryProvider:()=>CX,GridMaterialProperty:()=>WE,GroundGeometryUpdater:()=>Kn,GroundPolylineGeometry:()=>Q0,GroundPolylinePrimitive:()=>md,GroundPrimitive:()=>Oc,GroupMetadata:()=>IE,HeadingPitchRange:()=>Cu,HeadingPitchRoll:()=>Ha,Heap:()=>Cv,HeightReference:()=>je,HeightmapEncoding:()=>Ff,HeightmapTerrainData:()=>Pa,HeightmapTessellator:()=>qb,HermitePolynomialApproximation:()=>FR,HermiteSpline:()=>Vg,HilbertOrder:()=>RT,HomeButton:()=>Y2,HomeButtonViewModel:()=>q2,HorizontalOrigin:()=>gi,I3SDataProvider:()=>CC,I3SFeature:()=>tF,I3SField:()=>nF,I3SGeometry:()=>LS,I3SLayer:()=>r0,I3SNode:()=>NS,I3dmLoader:()=>G1,I3dmParser:()=>H1,Iau2000Orientation:()=>yL,Iau2006XysData:()=>vv,Iau2006XysSample:()=>R0,IauOrientationAxes:()=>AL,IauOrientationParameters:()=>gL,ImageBasedLighting:()=>hA,ImageBasedLightingPipelineStage:()=>aO,ImageMaterialProperty:()=>pg,Imagery:()=>wS,ImageryLayer:()=>Gs,ImageryLayerCollection:()=>GN,ImageryLayerFeatureInfo:()=>ym,ImageryProvider:()=>Qc,ImageryState:()=>fi,Implicit3DTileContent:()=>qT,ImplicitAvailabilityBitstream:()=>LT,ImplicitMetadataView:()=>NT,ImplicitSubdivisionScheme:()=>jo,ImplicitSubtree:()=>OA,ImplicitSubtreeCache:()=>nN,ImplicitSubtreeMetadata:()=>$P,ImplicitTileCoordinates:()=>cx,ImplicitTileset:()=>sy,IndexDatatype:()=>Fe,InfoBox:()=>$2,InfoBoxViewModel:()=>Q2,InspectorShared:()=>Ba,InstanceAttributeSemantic:()=>qo,InstancingPipelineStage:()=>yO,InterpolationAlgorithm:()=>Iq,InterpolationType:()=>Id,Intersect:()=>$t,IntersectionTests:()=>Qi,Intersections2D:()=>M_,Interval:()=>vc,InvertClassification:()=>FS,Ion:()=>Cd,IonGeocoderService:()=>TL,IonImageryProvider:()=>Gf,IonResource:()=>Qs,IonWorldImageryStyle:()=>Tm,Iso8601:()=>ze,JobScheduler:()=>rF,JobType:()=>Ta,JsonMetadataTable:()=>Bp,JulianDate:()=>ee,KTX2Transcoder:()=>Dv,KeyboardEventModifier:()=>la,KeyframeNode:()=>er,KmlCamera:()=>ZB,KmlDataSource:()=>oL,KmlLookAt:()=>QB,KmlTour:()=>$B,KmlTourFlyTo:()=>tL,KmlTourWait:()=>nL,Label:()=>Kg,LabelCollection:()=>nh,LabelGraphics:()=>hd,LabelStyle:()=>Hr,LabelVisualizer:()=>CB,LagrangePolynomialApproximation:()=>UR,LeapSecond:()=>Gi,Light:()=>bX,LightingModel:()=>Zm,LightingPipelineStage:()=>HO,LinearApproximation:()=>px,LinearSpline:()=>Ug,ManagedArray:()=>Uc,MapMode2D:()=>Ul,MapProjection:()=>Mq,MapboxImageryProvider:()=>AS,MapboxStyleImageryProvider:()=>SX,Mars3DEx:()=>jh,Material:()=>Wi,MaterialAppearance:()=>ur,MaterialPipelineStage:()=>WO,MaterialProperty:()=>Kr,Math:()=>P,Matrix2:()=>ir,Matrix3:()=>Q,Matrix4:()=>N,Megatexture:()=>VS,MetadataClass:()=>vd,MetadataClassProperty:()=>bg,MetadataComponentType:()=>nn,MetadataEntity:()=>Fn,MetadataEnum:()=>A1,MetadataEnumValue:()=>y1,MetadataPipelineStage:()=>cf,MetadataSchema:()=>wd,MetadataSchemaLoader:()=>jT,MetadataSemantic:()=>MA,MetadataTable:()=>yl,MetadataTableProperty:()=>t1,MetadataType:()=>qt,MipmapHint:()=>Fm,Model:()=>Bd,Model3DTileContent:()=>$m,ModelAlphaOptions:()=>sM,ModelAnimation:()=>X1,ModelAnimationChannel:()=>Y1,ModelAnimationCollection:()=>K1,ModelAnimationLoop:()=>El,ModelAnimationState:()=>Md,ModelArticulation:()=>lO,ModelArticulationStage:()=>cO,ModelClippingPlanesPipelineStage:()=>dO,ModelColorPipelineStage:()=>zg,ModelComponents:()=>Nt,ModelDrawCommand:()=>iO,ModelFeature:()=>J1,ModelFeatureTable:()=>Q1,ModelGraphics:()=>_p,ModelLightingOptions:()=>hM,ModelMatrixUpdateStage:()=>AO,ModelNode:()=>mO,ModelRenderResources:()=>aM,ModelRuntimeNode:()=>CO,ModelRuntimePrimitive:()=>rM,ModelSceneGraph:()=>_M,ModelSilhouettePipelineStage:()=>uM,ModelSkin:()=>oM,ModelSplitterPipelineStage:()=>dM,ModelStatistics:()=>gM,ModelType:()=>Vr,ModelUtility:()=>Zt,ModelVisualizer:()=>EB,Moon:()=>sF,MorphTargetsPipelineStage:()=>qO,MorphWeightSpline:()=>Nq,MortonOrder:()=>ay,Multiple3DTileContent:()=>KM,MultisampleFramebuffer:()=>AI,NavigationHelpButton:()=>Z2,NavigationHelpButtonViewModel:()=>J2,NearFarScalar:()=>Bt,NeverTileDiscardPolicy:()=>wX,NodeRenderResources:()=>mM,NodeStatisticsPipelineStage:()=>xO,NodeTransformationProperty:()=>cA,OIT:()=>cF,Occluder:()=>EL,OctahedralProjectedCubeMap:()=>xd,OffsetGeometryInstanceAttribute:()=>Zi,OpenCageGeocoderService:()=>Vq,OpenStreetMapImageryProvider:()=>TC,OrderedGroundPrimitiveCollection:()=>XR,OrientedBoundingBox:()=>Mn,OrthographicFrustum:()=>tn,OrthographicOffCenterFrustum:()=>bo,Packable:()=>kq,PackableForInterpolation:()=>zq,Particle:()=>zS,ParticleBurst:()=>MX,ParticleEmitter:()=>RX,ParticleSystem:()=>BX,Pass:()=>ve,PassState:()=>Wa,PathGraphics:()=>gp,PathVisualizer:()=>SB,PeliasGeocoderService:()=>CL,PerInstanceColorAppearance:()=>sn,PerformanceDisplay:()=>W_,PerformanceWatchdog:()=>i3,PerformanceWatchdogViewModel:()=>n3,PerspectiveFrustum:()=>wi,PerspectiveOffCenterFrustum:()=>Zc,PickDepth:()=>uF,PickDepthFramebuffer:()=>dF,PickFramebuffer:()=>pF,Picking:()=>AF,PickingPipelineStage:()=>YO,PinBuilder:()=>I_,PixelDatatype:()=>Ke,PixelFormat:()=>at,Plane:()=>ln,PlaneGeometry:()=>QR,PlaneGeometryUpdater:()=>eB,PlaneGraphics:()=>LP,PlaneOutlineGeometry:()=>$R,PntsLoader:()=>fE,PntsParser:()=>GA,PointCloud:()=>CF,PointCloudEyeDomeLighting:()=>Np,PointCloudShading:()=>Jm,PointCloudStylingPipelineStage:()=>KO,PointGraphics:()=>uA,PointPrimitive:()=>Fs,PointPrimitiveCollection:()=>VE,PointVisualizer:()=>wB,PolygonGeometry:()=>Sx,PolygonGeometryLibrary:()=>Xn,PolygonGeometryUpdater:()=>rB,PolygonGraphics:()=>pd,PolygonHierarchy:()=>Bc,PolygonOutlineGeometry:()=>iB,PolygonPipeline:()=>ui,Polyline:()=>mf,PolylineArrowMaterialProperty:()=>qE,PolylineCollection:()=>Fd,PolylineColorAppearance:()=>Go,PolylineDashMaterialProperty:()=>XE,PolylineGeometry:()=>w_,PolylineGeometryUpdater:()=>PB,PolylineGlowMaterialProperty:()=>JE,PolylineGraphics:()=>Xa,PolylineMaterialAppearance:()=>Js,PolylineOutlineMaterialProperty:()=>py,PolylinePipeline:()=>Mi,PolylineVisualizer:()=>MB,PolylineVolumeGeometry:()=>aB,PolylineVolumeGeometryLibrary:()=>Hd,PolylineVolumeGeometryUpdater:()=>fB,PolylineVolumeGraphics:()=>fA,PolylineVolumeOutlineGeometry:()=>uB,PositionProperty:()=>hp,PositionPropertyArray:()=>y_,PostProcessStage:()=>Tr,PostProcessStageCollection:()=>GF,PostProcessStageComposite:()=>el,PostProcessStageLibrary:()=>Xf,PostProcessStageSampleMode:()=>zu,PostProcessStageTextureCache:()=>OC,Primitive:()=>Sn,PrimitiveCollection:()=>Il,PrimitiveLoadPlan:()=>FA,PrimitiveOutlineGenerator:()=>NA,PrimitiveOutlinePipelineStage:()=>QO,PrimitivePipeline:()=>K0,PrimitiveRenderResources:()=>pM,PrimitiveState:()=>go,PrimitiveStatisticsPipelineStage:()=>$O,PrimitiveType:()=>Be,ProjectionPicker:()=>t3,ProjectionPickerViewModel:()=>e3,Property:()=>q,PropertyArray:()=>QE,PropertyAttribute:()=>LA,PropertyAttributeProperty:()=>I1,PropertyBag:()=>pl,PropertyTable:()=>kc,PropertyTexture:()=>BA,PropertyTextureProperty:()=>D1,ProviderViewModel:()=>As,Proxy:()=>Gq,QuadraticRealPolynomial:()=>Dc,QuadtreeOccluders:()=>WN,QuadtreePrimitive:()=>JN,QuadtreeTile:()=>jN,QuadtreeTileLoadState:()=>Hs,QuadtreeTileProvider:()=>ZX,QuantizedMeshTerrainData:()=>Jx,QuarticRealPolynomial:()=>oP,Quaternion:()=>Le,QuaternionSpline:()=>q1,Queue:()=>ty,Ray:()=>Dn,Rectangle:()=>ce,RectangleCollisionChecker:()=>Ix,RectangleGeometry:()=>wx,RectangleGeometryLibrary:()=>fs,RectangleGeometryUpdater:()=>dB,RectangleGraphics:()=>_d,RectangleOutlineGeometry:()=>$A,ReferenceFrame:()=>ar,ReferenceProperty:()=>A_,RenderState:()=>Ve,Renderbuffer:()=>Zl,RenderbufferFormat:()=>bc,Request:()=>qr,RequestErrorEvent:()=>Rm,RequestScheduler:()=>ka,RequestState:()=>ti,RequestType:()=>$o,Resource:()=>we,ResourceCache:()=>Ui,ResourceCacheKey:()=>Cl,ResourceCacheStatistics:()=>E1,ResourceLoader:()=>cr,ResourceLoaderState:()=>vt,Rotation:()=>wf,RuntimeError:()=>de,S2Cell:()=>wp,SDFSettings:()=>Rs,SampledPositionProperty:()=>ra,SampledProperty:()=>_u,Sampler:()=>fn,ScaledPositionProperty:()=>ph,Scene:()=>$F,SceneFramebuffer:()=>bC,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>eM,SceneModePicker:()=>o3,SceneModePickerViewModel:()=>r3,SceneTransforms:()=>$i,SceneTransitioner:()=>jF,ScreenSpaceCameraController:()=>XF,ScreenSpaceEventHandler:()=>Ru,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>Wg,SelectionIndicator:()=>c3,SelectionIndicatorViewModel:()=>a3,ShaderBuilder:()=>F0,ShaderCache:()=>dI,ShaderDestination:()=>be,ShaderFunction:()=>EI,ShaderProgram:()=>Kt,ShaderSource:()=>ke,ShaderStruct:()=>TI,ShadowMap:()=>q_,ShadowMapShader:()=>Uh,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>tu,ShowGeometryInstanceAttribute:()=>An,Simon1994PlanetaryPositions:()=>sg,SimplePolylineGeometry:()=>Qq,SingleTileImageryProvider:()=>xS,SkinningPipelineStage:()=>nM,SkyAtmosphere:()=>n2,SkyBox:()=>o2,SpatialNode:()=>a2,SphereEmitter:()=>TK,SphereGeometry:()=>$q,SphereOutlineGeometry:()=>r_,Spherical:()=>VR,Spline:()=>lr,SplitDirection:()=>zc,Splitter:()=>WS,StaticGeometryColorBatch:()=>Pf,StaticGeometryPerMaterialBatch:()=>Of,StaticGroundGeometryColorBatch:()=>xb,StaticGroundGeometryPerMaterialBatch:()=>mB,StaticGroundPolylinePerMaterialBatch:()=>OB,StaticOutlineGeometryBatch:()=>Eb,StencilConstants:()=>Ft,StencilFunction:()=>Hn,StencilOperation:()=>ht,SteppedSpline:()=>j1,StripeMaterialProperty:()=>eb,StripeOrientation:()=>Kd,StructuralMetadata:()=>Ea,StyleCommandsNeeded:()=>Rd,StyleExpression:()=>EK,Sun:()=>h2,SunLight:()=>op,SunPostProcess:()=>ZF,SupportedImageFormats:()=>B1,SvgPathBindingHandler:()=>S2,TaskProcessor:()=>_i,Terrain:()=>p2,TerrainData:()=>fm,TerrainEncoding:()=>hc,TerrainExaggeration:()=>Ic,TerrainFillMesh:()=>OS,TerrainMesh:()=>Vf,TerrainOffsetProperty:()=>dA,TerrainProvider:()=>Yo,TerrainQuantization:()=>Vs,TerrainState:()=>Cr,Texture:()=>Rt,TextureAtlas:()=>Xg,TextureCache:()=>mI,TextureMagnificationFilter:()=>Ti,TextureManager:()=>A2,TextureMinificationFilter:()=>cn,TextureUniform:()=>NK,TextureWrap:()=>wn,TileAvailability:()=>dm,TileBoundingRegion:()=>Af,TileBoundingS2Cell:()=>tR,TileBoundingSphere:()=>o_,TileBoundingVolume:()=>bK,TileCoordinatesImageryProvider:()=>g2,TileDiscardPolicy:()=>vK,TileEdge:()=>yn,TileImagery:()=>DS,TileMapServiceImageryProvider:()=>Rh,TileMetadata:()=>YM,TileOrientedBoundingBox:()=>Cf,TileProviderError:()=>xi,TileReplacementQueue:()=>qN,TileSelectionResult:()=>$n,TileState:()=>wK,Tileset3DTileContent:()=>xM,TilesetMetadata:()=>nR,TilesetPipelineStage:()=>oO,TilingScheme:()=>eY,TimeConstants:()=>Qn,TimeDynamicImagery:()=>mC,TimeDynamicPointCloud:()=>KS,TimeInterval:()=>Tn,TimeIntervalCollection:()=>Oo,TimeIntervalCollectionPositionProperty:()=>x_,TimeIntervalCollectionProperty:()=>C_,TimeStandard:()=>Zn,Timeline:()=>f3,TimelineHighlightRange:()=>l3,TimelineTrack:()=>u3,Tipsify:()=>uP,ToggleButtonViewModel:()=>h0,Tonemapper:()=>u0,Transforms:()=>Mt,TranslationRotationScale:()=>_g,TranslucentTileClassification:()=>gF,TridiagonalSystemSolver:()=>eE,TrustedServers:()=>oT,TweenCollection:()=>BC,UniformState:()=>gI,UniformType:()=>ZS,UrlTemplateImageryProvider:()=>zs,VERSION:()=>pxt,VRButton:()=>h3,VRButtonViewModel:()=>m3,VRTheWorldTerrainProvider:()=>iY,VaryingType:()=>FK,Vector3DTileBatch:()=>jm,Vector3DTileClampedPolylines:()=>GM,Vector3DTileContent:()=>jM,Vector3DTileGeometry:()=>Sp,Vector3DTilePoints:()=>NM,Vector3DTilePolygons:()=>FM,Vector3DTilePolylines:()=>XA,Vector3DTilePrimitive:()=>AA,VelocityOrientationProperty:()=>zR,VelocityVectorProperty:()=>Ax,VertexArray:()=>oi,VertexArrayFacade:()=>ap,VertexAttributeSemantic:()=>Et,VertexFormat:()=>Pe,VerticalOrigin:()=>On,VideoSynchronizer:()=>tY,View:()=>wC,Viewer:()=>nJ,ViewportQuad:()=>PK,Visibility:()=>fo,Visualizer:()=>Xj,VoxelBoxShape:()=>Oh,VoxelContent:()=>iN,VoxelCylinderShape:()=>Mh,VoxelEllipsoidShape:()=>aC,VoxelInspector:()=>_3,VoxelInspectorViewModel:()=>p3,VoxelPrimitive:()=>$S,VoxelProvider:()=>BK,VoxelRenderResources:()=>qL,VoxelShape:()=>LK,VoxelShapeType:()=>qi,VoxelTraversal:()=>JS,VulkanConstants:()=>rY,WallGeometry:()=>pB,WallGeometryLibrary:()=>Px,WallGeometryUpdater:()=>yB,WallGraphics:()=>yp,WallOutlineGeometry:()=>gB,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>CS,WebMapTileServiceImageryProvider:()=>TS,WebMercatorProjection:()=>Oi,WebMercatorTilingScheme:()=>No,WindingOrder:()=>Qo,WireframeIndexGenerator:()=>lE,WireframePipelineStage:()=>iM,_shadersAcesTonemappingStage:()=>TF,_shadersAdditiveBlend:()=>KF,_shadersAdjustTranslucentFS:()=>kS,_shadersAllMaterialAppearanceFS:()=>DI,_shadersAllMaterialAppearanceVS:()=>II,_shadersAmbientOcclusionGenerate:()=>EF,_shadersAmbientOcclusionModulate:()=>bF,_shadersAspectRampMaterial:()=>BI,_shadersAtmosphereCommon:()=>z_,_shadersBasicMaterialAppearanceFS:()=>PI,_shadersBasicMaterialAppearanceVS:()=>OI,_shadersBillboardCollectionFS:()=>CM,_shadersBillboardCollectionVS:()=>TM,_shadersBlackAndWhite:()=>SF,_shadersBloomComposite:()=>vF,_shadersBrdfLutGeneratorFS:()=>PL,_shadersBrightPass:()=>JF,_shadersBrightness:()=>wF,_shadersBumpMapMaterial:()=>LI,_shadersCPUStylingStageFS:()=>vO,_shadersCPUStylingStageVS:()=>SO,_shadersCheckerboardMaterial:()=>NI,_shadersCloudCollectionFS:()=>sN,_shadersCloudCollectionVS:()=>aN,_shadersCloudNoiseFS:()=>cN,_shadersCloudNoiseVS:()=>lN,_shadersCompareAndPackTranslucentDepth:()=>_F,_shadersCompositeOITFS:()=>aF,_shadersCompositeTranslucentClassification:()=>vC,_shadersContrastBias:()=>DF,_shadersCustomShaderStageFS:()=>IO,_shadersCustomShaderStageVS:()=>DO,_shadersCzmBuiltins:()=>B0,_shadersDepthOfField:()=>IF,_shadersDepthPlaneFS:()=>xN,_shadersDepthPlaneVS:()=>CN,_shadersDepthView:()=>PF,_shadersDepthViewPacked:()=>UK,_shadersDotMaterial:()=>FI,_shadersEdgeDetection:()=>OF,_shadersElevationBandMaterial:()=>UI,_shadersElevationContourMaterial:()=>VI,_shadersElevationRampMaterial:()=>kI,_shadersEllipsoidFS:()=>ES,_shadersEllipsoidSurfaceAppearanceFS:()=>DN,_shadersEllipsoidSurfaceAppearanceVS:()=>IN,_shadersEllipsoidVS:()=>bS,_shadersFXAA:()=>RF,_shadersFXAA3_11:()=>VF,_shadersFadeMaterial:()=>zI,_shadersFeatureIdStageFS:()=>PO,_shadersFeatureIdStageVS:()=>OO,_shadersFilmicTonemapping:()=>MF,_shadersGaussianBlur1D:()=>l0,_shadersGeometryStageFS:()=>FO,_shadersGeometryStageVS:()=>UO,_shadersGlobeFS:()=>LN,_shadersGlobeVS:()=>NN,_shadersGridMaterial:()=>HI,_shadersGroundAtmosphere:()=>SS,_shadersHSBToRGB:()=>eD,_shadersHSLToRGB:()=>tD,_shadersImageBasedLightingStageFS:()=>sO,_shadersInstancingStageCommon:()=>hO,_shadersInstancingStageVS:()=>pO,_shadersIntersectBox:()=>UL,_shadersIntersectClippingPlanes:()=>FL,_shadersIntersectCylinder:()=>VL,_shadersIntersectDepth:()=>NL,_shadersIntersectEllipsoid:()=>kL,_shadersIntersection:()=>sC,_shadersIntersectionUtils:()=>LL,_shadersLegacyInstancingStageVS:()=>_O,_shadersLensFlare:()=>BF,_shadersLightingStageFS:()=>zO,_shadersMaterialStageFS:()=>GO,_shadersMegatexture:()=>jL,_shadersMetadataStageFS:()=>MO,_shadersMetadataStageVS:()=>RO,_shadersModelClippingPlanesStageFS:()=>fO,_shadersModelColorStageFS:()=>uO,_shadersModelFS:()=>$1,_shadersModelSilhouetteStageFS:()=>cM,_shadersModelSilhouetteStageVS:()=>lM,_shadersModelSplitterStageFS:()=>fM,_shadersModelVS:()=>eO,_shadersModifiedReinhardTonemapping:()=>LF,_shadersMorphTargetsStageVS:()=>jO,_shadersNightVision:()=>NF,_shadersNormalMapMaterial:()=>GI,_shadersOctahedralProjectionAtlasFS:()=>WP,_shadersOctahedralProjectionFS:()=>jP,_shadersOctahedralProjectionVS:()=>qP,_shadersOctree:()=>WL,_shadersPassThrough:()=>jl,_shadersPassThroughDepth:()=>i0,_shadersPerInstanceColorAppearanceFS:()=>$I,_shadersPerInstanceColorAppearanceVS:()=>eP,_shadersPerInstanceFlatColorAppearanceFS:()=>k0,_shadersPerInstanceFlatColorAppearanceVS:()=>tP,_shadersPointCloudEyeDomeLighting:()=>L1,_shadersPointCloudStylingStageVS:()=>XO,_shadersPointPrimitiveCollectionFS:()=>hy,_shadersPointPrimitiveCollectionVS:()=>IR,_shadersPolylineArrowMaterial:()=>WI,_shadersPolylineColorAppearanceVS:()=>TP,_shadersPolylineCommon:()=>nu,_shadersPolylineDashMaterial:()=>jI,_shadersPolylineFS:()=>eA,_shadersPolylineGlowMaterial:()=>qI,_shadersPolylineMaterialAppearanceVS:()=>EP,_shadersPolylineOutlineMaterial:()=>YI,_shadersPolylineShadowVolumeFS:()=>yP,_shadersPolylineShadowVolumeMorphFS:()=>AP,_shadersPolylineShadowVolumeMorphVS:()=>xP,_shadersPolylineShadowVolumeVS:()=>CP,_shadersPolylineVS:()=>PM,_shadersPrimitiveOutlineStageFS:()=>ZO,_shadersPrimitiveOutlineStageVS:()=>JO,_shadersRGBToHSB:()=>wD,_shadersRGBToHSL:()=>DD,_shadersRGBToXYZ:()=>ID,_shadersReinhardTonemapping:()=>FF,_shadersReprojectWebMercatorFS:()=>UN,_shadersReprojectWebMercatorVS:()=>VN,_shadersRimLightingMaterial:()=>XI,_shadersSelectedFeatureIdStageCommon:()=>cE,_shadersShadowVolumeAppearanceFS:()=>CT,_shadersShadowVolumeAppearanceVS:()=>sP,_shadersShadowVolumeFS:()=>fg,_shadersSilhouette:()=>UF,_shadersSkinningStageVS:()=>tM,_shadersSkyAtmosphereCommon:()=>jS,_shadersSkyAtmosphereFS:()=>e2,_shadersSkyAtmosphereVS:()=>t2,_shadersSkyBoxFS:()=>i2,_shadersSkyBoxVS:()=>r2,_shadersSlopeRampMaterial:()=>KI,_shadersStripeMaterial:()=>JI,_shadersSunFS:()=>l2,_shadersSunTextureFS:()=>u2,_shadersSunVS:()=>f2,_shadersTexturedMaterialAppearanceFS:()=>MI,_shadersTexturedMaterialAppearanceVS:()=>RI,_shadersVector3DTileClampedPolylinesFS:()=>zM,_shadersVector3DTileClampedPolylinesVS:()=>kM,_shadersVector3DTilePolylinesVS:()=>UM,_shadersVectorTileVS:()=>MT,_shadersViewportQuadFS:()=>y2,_shadersViewportQuadVS:()=>T0,_shadersVoxelFS:()=>RL,_shadersVoxelVS:()=>BL,_shadersWater:()=>ZI,_shadersXYZToRGB:()=>$D,_shadersacesTonemapping:()=>bw,_shadersalphaWeight:()=>Sw,_shadersantialias:()=>vw,_shadersapproximateSphericalCoordinates:()=>ww,_shadersbackFacing:()=>Dw,_shadersbranchFreeTernary:()=>Iw,_shaderscascadeColor:()=>Pw,_shaderscascadeDistance:()=>Ow,_shaderscascadeMatrix:()=>Mw,_shaderscascadeWeights:()=>Rw,_shaderscolumbusViewMorph:()=>Bw,_shaderscomputePosition:()=>Lw,_shadersconvertUvToBox:()=>zL,_shadersconvertUvToCylinder:()=>HL,_shadersconvertUvToEllipsoid:()=>GL,_shaderscosineAndSine:()=>Nw,_shadersdecompressTextureCoordinates:()=>Fw,_shadersdefaultPbrMaterial:()=>Uw,_shadersdegreesPerRadian:()=>Ov,_shadersdepthClamp:()=>Vw,_shadersdepthRange:()=>Mv,_shadersdepthRangeStruct:()=>pw,_shaderseastNorthUpToEyeCoordinates:()=>kw,_shadersellipsoidContainsPoint:()=>zw,_shadersellipsoidWgs84TextureCoordinates:()=>Hw,_shadersepsilon1:()=>Rv,_shadersepsilon2:()=>Bv,_shadersepsilon3:()=>Lv,_shadersepsilon4:()=>Nv,_shadersepsilon5:()=>Fv,_shadersepsilon6:()=>Uv,_shadersepsilon7:()=>Vv,_shadersequalsEpsilon:()=>Gw,_shaderseyeOffset:()=>Ww,_shaderseyeToWindowCoordinates:()=>jw,_shadersfastApproximateAtan:()=>qw,_shadersfog:()=>Yw,_shadersfromCartesian:()=>eI,_shadersgammaCorrect:()=>Xw,_shadersgeodeticSurfaceNormal:()=>Kw,_shadersgetDefaultMaterial:()=>Jw,_shadersgetFloodRect:()=>tI,_shadersgetIndexMat:()=>nI,_shadersgetLambertDiffuse:()=>Zw,_shadersgetMaxIndex:()=>iI,_shadersgetMaxIndexVal:()=>rI,_shadersgetSpecular:()=>Qw,_shadersgetWaterNoise:()=>$w,_shadershue:()=>nD,_shadersinfinity:()=>kv,_shadersinverseGamma:()=>iD,_shadersisEmpty:()=>rD,_shadersisFull:()=>oD,_shadersisInEllipsoid:()=>oI,_shadersisInObliq:()=>sI,_shaderslatitudeToWebMercatorFraction:()=>sD,_shaderslineDistance:()=>cD,_shaderslinearToSrgb:()=>aD,_shadersluminance:()=>lD,_shadersmagnitude:()=>aI,_shadersmagnitudeSquared:()=>cI,_shadersmaterial:()=>_w,_shadersmaterialInput:()=>gw,_shadersmetersPerPixel:()=>uD,_shadersmodelMaterial:()=>yw,_shadersmodelToWindowCoordinates:()=>fD,_shadersmodelVertexOutput:()=>Aw,_shadersmultiplyComponents:()=>lI,_shadersmultiplyWithColorBalance:()=>dD,_shadersnearFarScalar:()=>mD,_shadersoctDecode:()=>hD,_shadersoneOverPi:()=>zv,_shadersoneOverTwoPi:()=>Hv,_shaderspackDepth:()=>pD,_shaderspassCesium3DTile:()=>Gv,_shaderspassCesium3DTileClassification:()=>Wv,_shaderspassCesium3DTileClassificationIgnoreShow:()=>jv,_shaderspassClassification:()=>qv,_shaderspassCompute:()=>Yv,_shaderspassEnvironment:()=>Xv,_shaderspassGlobe:()=>Kv,_shaderspassOpaque:()=>Jv,_shaderspassOverlay:()=>Zv,_shaderspassTerrainClassification:()=>Qv,_shaderspassTranslucent:()=>$v,_shaderspassVoxels:()=>ew,_shaderspbrLighting:()=>_D,_shaderspbrMetallicRoughnessMaterial:()=>gD,_shaderspbrParameters:()=>xw,_shaderspbrSpecularGlossinessMaterial:()=>yD,_shadersphong:()=>AD,_shaderspi:()=>tw,_shaderspiOverFour:()=>nw,_shaderspiOverSix:()=>iw,_shaderspiOverThree:()=>rw,_shaderspiOverTwo:()=>ow,_shadersplaneDistance:()=>xD,_shaderspointAlongRay:()=>CD,_shadersradiansPerDegree:()=>sw,_shadersray:()=>Cw,_shadersrayEllipsoidIntersectionInterval:()=>TD,_shadersraySegment:()=>Tw,_shadersraySphereIntersectionInterval:()=>ED,_shadersreadDepth:()=>bD,_shadersreadNonPerspective:()=>SD,_shadersreverseLogDepth:()=>vD,_shadersround:()=>PD,_shaderssampleOctahedralProjection:()=>OD,_shaderssaturation:()=>MD,_shadersscaleToGeodeticSurface:()=>uI,_shaderssceneMode2D:()=>aw,_shaderssceneMode3D:()=>cw,_shaderssceneModeColumbusView:()=>lw,_shaderssceneModeMorphing:()=>uw,_shadersshadowDepthCompare:()=>RD,_shadersshadowParameters:()=>Ew,_shadersshadowVisibility:()=>BD,_shaderssignNotZero:()=>LD,_shaderssolarRadius:()=>fw,_shaderssphericalHarmonics:()=>ND,_shaderssrgbToLinear:()=>FD,_shaderstangentToEyeSpaceMatrix:()=>UD,_shaderstextureCube:()=>VD,_shadersthreePiOver2:()=>dw,_shaderstransformPlane:()=>kD,_shaderstranslateRelativeToEye:()=>zD,_shaderstranslucentPhong:()=>HD,_shaderstranspose:()=>GD,_shaderstwoPi:()=>mw,_shadersunpackDepth:()=>WD,_shadersunpackFloat:()=>jD,_shadersunpackUint:()=>qD,_shadersvalueTransform:()=>YD,_shadersvertexLogDepth:()=>XD,_shaderswebMercatorMaxLatitude:()=>hw,_shaderswindowToEyeCoordinates:()=>KD,_shaderswriteDepthClamp:()=>JD,_shaderswriteLogDepth:()=>ZD,_shaderswriteNonPerspective:()=>QD,addBuffer:()=>m1,addDefaults:()=>o1,addExtensionsRequired:()=>u1,addExtensionsUsed:()=>sf,addPipelineExtras:()=>Dg,addToArray:()=>as,appendForwardSlash:()=>gv,arrayRemoveDuplicates:()=>Sr,barycentricCoordinates:()=>W0,binarySearch:()=>Mr,buildDrawCommand:()=>rO,buildModuleUrl:()=>en,buildVoxelDrawCommands:()=>XL,clone:()=>We,combine:()=>_t,computeFlyToLocationForRectangle:()=>lC,createBillboardPointCallback:()=>WA,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>L2,createDefaultTerrainProviderViewModels:()=>N2,createElevationBandMaterial:()=>FY,createGuid:()=>jn,createMaterialPropertyDescriptor:()=>Rr,createOsmBuildings:()=>UY,createOsmBuildingsAsync:()=>VY,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>hl,createTangentSpaceDebugPrimitive:()=>kY,createTaskProcessorWorker:()=>VK,createUniform:()=>uv,createUniformArray:()=>fv,createWorldImagery:()=>XY,createWorldImageryAsync:()=>V_,createWorldTerrain:()=>uq,createWorldTerrainAsync:()=>Zx,decodeGoogleEarthEnterpriseData:()=>uL,decodeVectorPolylinePositions:()=>WM,defaultValue:()=>y,defer:()=>Xs,defined:()=>u,demodernizeShader:()=>fI,deprecationWarning:()=>$,destroyObject:()=>ue,exportKml:()=>K7,findAccessorMinMax:()=>wA,findContentMetadata:()=>JA,findGroupMetadata:()=>ZA,findTileMetadata:()=>XM,forEachTextureInMaterial:()=>zT,formatError:()=>vh,freezeRenderState:()=>PG,getAbsoluteUri:()=>ep,getAccessorByteStride:()=>Al,getBaseUri:()=>yv,getBinaryAccessor:()=>ou,getClipAndStyleCode:()=>BN,getClippingFunction:()=>L_,getComponentReader:()=>Rp,getElement:()=>In,getExtensionFromUri:()=>b0,getFilenameFromUri:()=>__,getImageFromTypedArray:()=>pL,getImagePixels:()=>od,getJsonFromTypedArray:()=>Br,getMagic:()=>Td,getStringFromTypedArray:()=>_l,getTimestamp:()=>Ai,hasExtension:()=>ni,heightReferenceOnEntityPropertyChanged:()=>Ap,isBitSet:()=>_c,isBlobUri:()=>S0,isCrossOriginUrl:()=>v0,isDataUri:()=>tp,isLeapYear:()=>$h,knockout:()=>Te,knockout_3_5_1:()=>GC,knockout_es5:()=>b2,loadAndExecuteScript:()=>w0,loadCubeMap:()=>CI,loadImageFromTypedArray:()=>bA,loadKTX2:()=>cl,mergeSort:()=>B_,moveTechniqueRenderStates:()=>l1,moveTechniquesToExtension:()=>f1,numberOfComponentsForType:()=>au,objectToQuery:()=>D0,oneTimeWarning:()=>Ot,parseBatchTable:()=>Vp,parseBoundingVolumeSemantics:()=>b1,parseFeatureMetadataLegacy:()=>M1,parseGlb:()=>a1,parseResponseHeaders:()=>Av,parseStructuralMetadata:()=>O1,pointInsideTriangle:()=>Hq,preprocess3DTileContent:()=>oh,processVoxelProperties:()=>YL,queryToObject:()=>Xl,readAccessorPacked:()=>h1,removeExtension:()=>DA,removeExtensionsRequired:()=>s1,removeExtensionsUsed:()=>vA,removePipelineExtras:()=>c1,removeUnusedElements:()=>d1,resizeImageToNextPowerOfTwo:()=>Og,sampleTerrain:()=>TB,sampleTerrainMostDetailed:()=>v_,scaleToGeodeticSurface:()=>C0,subdivideArray:()=>aP,subscribeAndEvaluate:()=>da,updateAccessorComponentTypes:()=>p1,updateVersion:()=>_1,usesExtension:()=>Ao,viewerCesium3DTilesInspectorMixin:()=>iJ,viewerCesiumInspectorMixin:()=>rJ,viewerDragDropMixin:()=>sJ,viewerPerformanceWatchdogMixin:()=>aJ,viewerVoxelInspectorMixin:()=>cJ,webGLConstantToGlslType:()=>oY,wrapFunction:()=>vL,writeTextToCanvas:()=>qA});module.exports=Dm(_xt);var YC={},tCe={addCache:function(e,t){return YC[e]=t,t},removeCache:function(e){delete YC[e]},getCache:function(e){return YC[e]},getCacheOrAdd:function(e){return YC[e]||(YC[e]={}),YC[e]}},jh=tCe;function nCe(e){return e!=null}var u=nCe;function A0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}u(Object.create)&&(A0.prototype=Object.create(Error.prototype),A0.prototype.constructor=A0);A0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return u(this.stack)&&(e+=` -${this.stack.toString()}`),e};A0.throwInstantiationError=function(){throw new A0("This function defines an interface and should not be called directly.")};var fe=A0;var os={};os.typeOf={};function iCe(e){return`${e} is required, actual value was undefined`}function XC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}os.defined=function(e,t){if(!u(t))throw new fe(iCe(e))};os.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(XC(typeof t,"function",e))};os.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(XC(typeof t,"string",e))};os.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(XC(typeof t,"number",e))};os.typeOf.number.lessThan=function(e,t,n){if(os.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};os.typeOf.number.lessThanOrEquals=function(e,t,n){if(os.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};os.typeOf.number.greaterThan=function(e,t,n){if(os.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};os.typeOf.number.greaterThanOrEquals=function(e,t,n){if(os.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};os.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(XC(typeof t,"object",e))};os.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(XC(typeof t,"boolean",e))};os.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(XC(typeof t,"bigint",e))};os.typeOf.number.equals=function(e,t,n,i){if(os.typeOf.number(e,n),os.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var ol=os;function dJ(e,t){return e??t}dJ.EMPTY_OBJECT=Object.freeze({});var y=dJ;var dG=Ki(y3(),1);var lt={};lt.EPSILON1=.1;lt.EPSILON2=.01;lt.EPSILON3=.001;lt.EPSILON4=1e-4;lt.EPSILON5=1e-5;lt.EPSILON6=1e-6;lt.EPSILON7=1e-7;lt.EPSILON8=1e-8;lt.EPSILON9=1e-9;lt.EPSILON10=1e-10;lt.EPSILON11=1e-11;lt.EPSILON12=1e-12;lt.EPSILON13=1e-13;lt.EPSILON14=1e-14;lt.EPSILON15=1e-15;lt.EPSILON16=1e-16;lt.EPSILON17=1e-17;lt.EPSILON18=1e-18;lt.EPSILON19=1e-19;lt.EPSILON20=1e-20;lt.EPSILON21=1e-21;lt.GRAVITATIONALPARAMETER=3986004418e5;lt.SOLAR_RADIUS=6955e5;lt.LUNAR_RADIUS=1737400;lt.SIXTY_FOUR_KILOBYTES=64*1024;lt.FOUR_GIGABYTES=4*1024*1024*1024;lt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});lt.signNotZero=function(e){return e<0?-1:1};lt.toSNorm=function(e,t){return t=y(t,255),Math.round((lt.clamp(e,-1,1)*.5+.5)*t)};lt.fromSNorm=function(e,t){return t=y(t,255),lt.clamp(e,0,t)/t*2-1};lt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:lt.clamp((e-t)/n,0,1)};lt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});lt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});lt.lerp=function(e,t,n){return(1-n)*e+n*t};lt.PI=Math.PI;lt.ONE_OVER_PI=1/Math.PI;lt.PI_OVER_TWO=Math.PI/2;lt.PI_OVER_THREE=Math.PI/3;lt.PI_OVER_FOUR=Math.PI/4;lt.PI_OVER_SIX=Math.PI/6;lt.THREE_PI_OVER_TWO=3*Math.PI/2;lt.TWO_PI=2*Math.PI;lt.ONE_OVER_TWO_PI=1/(2*Math.PI);lt.RADIANS_PER_DEGREE=Math.PI/180;lt.DEGREES_PER_RADIAN=180/Math.PI;lt.RADIANS_PER_ARCSECOND=lt.RADIANS_PER_DEGREE/3600;lt.toRadians=function(e){return e*lt.RADIANS_PER_DEGREE};lt.toDegrees=function(e){return e*lt.DEGREES_PER_RADIAN};lt.convertLongitudeRange=function(e){let t=lt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};lt.clampToLatitudeRange=function(e){return lt.clamp(e,-1*lt.PI_OVER_TWO,lt.PI_OVER_TWO)};lt.negativePiToPi=function(e){return e>=-lt.PI&&e<=lt.PI?e:lt.zeroToTwoPi(e+lt.PI)-lt.PI};lt.zeroToTwoPi=function(e){if(e>=0&&e<=lt.TWO_PI)return e;let t=lt.mod(e,lt.TWO_PI);return Math.abs(t)<lt.EPSILON14&&Math.abs(e)>lt.EPSILON14?lt.TWO_PI:t};lt.mod=function(e,t){return lt.sign(e)===lt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};lt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};lt.lessThan=function(e,t,n){return e-t<-n};lt.lessThanOrEquals=function(e,t,n){return e-t<n};lt.greaterThan=function(e,t,n){return e-t>n};lt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var A3=[1];lt.factorial=function(e){let t=A3.length;if(e>=t){let n=A3[t-1];for(let i=t;i<=e;i++){let r=n*i;A3.push(r),n=r}}return A3[e]};lt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};lt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};lt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};lt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};lt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var hJ=new dG.default;lt.setRandomNumberSeed=function(e){hJ=new dG.default(e)};lt.nextRandomNumber=function(){return hJ.random()};lt.randomBetween=function(e,t){return lt.nextRandomNumber()*(t-e)+e};lt.acosClamped=function(e){return Math.acos(lt.clamp(e,-1,1))};lt.asinClamped=function(e){return Math.asin(lt.clamp(e,-1,1))};lt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};lt.logBase=function(e,t){return Math.log(e)/Math.log(t)};lt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});lt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});lt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};lt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};lt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=lt.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?lt.PI_OVER_TWO-i:i,i=e<0?lt.PI-i:i,i=t<0?-i:i,i};var P=lt;function Qe(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}Qe.fromSpherical=function(e,t){u(t)||(t=new Qe);let n=e.clock,i=e.cone,r=y(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t};Qe.fromElements=function(e,t,n,i){return u(i)?(i.x=e,i.y=t,i.z=n,i):new Qe(e,t,n)};Qe.clone=function(e,t){if(u(e))return u(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Qe(e.x,e.y,e.z)};Qe.fromCartesian4=Qe.clone;Qe.packedLength=3;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Qe.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Qe),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*3;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Qe.pack(e[r],t,r*3);return t};Qe.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let r=i/3;t[r]=Qe.unpack(e,i,t[r])}return t};Qe.fromArray=Qe.unpack;Qe.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Qe.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Qe.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Qe.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Qe.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=r,i.y=o,i.z=s,i};Qe.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Qe.magnitude=function(e){return Math.sqrt(Qe.magnitudeSquared(e))};var C3=new Qe;Qe.distance=function(e,t){return Qe.subtract(e,t,C3),Qe.magnitude(C3)};Qe.distanceSquared=function(e,t){return Qe.subtract(e,t,C3),Qe.magnitudeSquared(C3)};Qe.normalize=function(e,t){let n=Qe.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Qe.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Qe.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Qe.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Qe.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Qe.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Qe.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Qe.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Qe.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Qe.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var pJ=new Qe;Qe.lerp=function(e,t,n,i){return Qe.multiplyByScalar(t,n,pJ),i=Qe.multiplyByScalar(e,1-n,i),Qe.add(pJ,i,i)};var x3=new Qe,mG=new Qe;Qe.angleBetween=function(e,t){Qe.normalize(e,x3),Qe.normalize(t,mG);let n=Qe.dot(x3,mG),i=Qe.magnitude(Qe.cross(x3,mG,x3));return Math.atan2(i,n)};var rCe=new Qe;Qe.mostOrthogonalAxis=function(e,t){let n=Qe.normalize(e,rCe);return Qe.abs(n,n),n.x<=n.y?n.x<=n.z?t=Qe.clone(Qe.UNIT_X,t):t=Qe.clone(Qe.UNIT_Z,t):n.y<=n.z?t=Qe.clone(Qe.UNIT_Y,t):t=Qe.clone(Qe.UNIT_Z,t),t};Qe.projectVector=function(e,t,n){let i=Qe.dot(e,t)/Qe.dot(t,t);return Qe.multiplyByScalar(t,i,n)};Qe.equals=function(e,t){return e===t||u(e)&&u(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Qe.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Qe.equalsEpsilon=function(e,t,n,i){return e===t||u(e)&&u(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};Qe.cross=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=t.x,a=t.y,c=t.z,l=r*c-o*a,f=o*s-i*c,d=i*a-r*s;return n.x=l,n.y=f,n.z=d,n};Qe.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Qe.fromDegrees=function(e,t,n,i,r){return e=P.toRadians(e),t=P.toRadians(t),Qe.fromRadians(e,t,n,i,r)};var ju=new Qe,KC=new Qe,oCe=new Qe(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Qe.fromRadians=function(e,t,n,i,r){n=y(n,0);let o=u(i)?i.radiiSquared:oCe,s=Math.cos(t);ju.x=s*Math.cos(e),ju.y=s*Math.sin(e),ju.z=Math.sin(t),ju=Qe.normalize(ju,ju),Qe.multiplyComponents(o,ju,KC);let a=Math.sqrt(Qe.dot(ju,KC));return KC=Qe.divideByScalar(KC,a,KC),ju=Qe.multiplyByScalar(ju,n,ju),u(r)||(r=new Qe),Qe.add(KC,ju,r)};Qe.fromDegreesArray=function(e,t,n){let i=e.length;u(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Qe.fromDegrees(o,s,0,t,n[a])}return n};Qe.fromRadiansArray=function(e,t,n){let i=e.length;u(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Qe.fromRadians(o,s,0,t,n[a])}return n};Qe.fromDegreesArrayHeights=function(e,t,n){let i=e.length;u(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Qe.fromDegrees(o,s,a,t,n[c])}return n};Qe.fromRadiansArrayHeights=function(e,t,n){let i=e.length;u(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Qe.fromRadians(o,s,a,t,n[c])}return n};Qe.ZERO=Object.freeze(new Qe(0,0,0));Qe.ONE=Object.freeze(new Qe(1,1,1));Qe.UNIT_X=Object.freeze(new Qe(1,0,0));Qe.UNIT_Y=Object.freeze(new Qe(0,1,0));Qe.UNIT_Z=Object.freeze(new Qe(0,0,1));Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.prototype.equalsEpsilon=function(e,t,n){return Qe.equalsEpsilon(this,e,t,n)};Qe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=Qe;function yt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}yt.fromElements=function(e,t,n,i,r){return u(r)?(r.x=e,r.y=t,r.z=n,r.w=i,r):new yt(e,t,n,i)};yt.fromColor=function(e,t){return u(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new yt(e.red,e.green,e.blue,e.alpha)};yt.clone=function(e,t){if(u(e))return u(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new yt(e.x,e.y,e.z,e.w)};yt.packedLength=4;yt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};yt.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new yt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};yt.packArray=function(e,t){let n=e.length,i=n*4;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)yt.pack(e[r],t,r*4);return t};yt.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=yt.unpack(e,i,t[r])}return t};yt.fromArray=yt.unpack;yt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};yt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};yt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};yt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};yt.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=r,i.y=o,i.z=s,i.w=a,i};yt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};yt.magnitude=function(e){return Math.sqrt(yt.magnitudeSquared(e))};var T3=new yt;yt.distance=function(e,t){return yt.subtract(e,t,T3),yt.magnitude(T3)};yt.distanceSquared=function(e,t){return yt.subtract(e,t,T3),yt.magnitudeSquared(T3)};yt.normalize=function(e,t){let n=yt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};yt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};yt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};yt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};yt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};yt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};yt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};yt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};yt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};yt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var _J=new yt;yt.lerp=function(e,t,n,i){return yt.multiplyByScalar(t,n,_J),i=yt.multiplyByScalar(e,1-n,i),yt.add(_J,i,i)};var sCe=new yt;yt.mostOrthogonalAxis=function(e,t){let n=yt.normalize(e,sCe);return yt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=yt.clone(yt.UNIT_X,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=yt.clone(yt.UNIT_Y,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t),t};yt.equals=function(e,t){return e===t||u(e)&&u(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};yt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};yt.equalsEpsilon=function(e,t,n,i){return e===t||u(e)&&u(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};yt.ZERO=Object.freeze(new yt(0,0,0,0));yt.ONE=Object.freeze(new yt(1,1,1,1));yt.UNIT_X=Object.freeze(new yt(1,0,0,0));yt.UNIT_Y=Object.freeze(new yt(0,1,0,0));yt.UNIT_Z=Object.freeze(new yt(0,0,1,0));yt.UNIT_W=Object.freeze(new yt(0,0,0,1));yt.prototype.clone=function(e){return yt.clone(this,e)};yt.prototype.equals=function(e){return yt.equals(this,e)};yt.prototype.equalsEpsilon=function(e,t,n){return yt.equalsEpsilon(this,e,t,n)};yt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var hG=new Float32Array(1),Na=new Uint8Array(hG.buffer),aCe=new Uint32Array([287454020]),cCe=new Uint8Array(aCe.buffer),gJ=cCe[0]===68;yt.packFloat=function(e,t){return u(t)||(t=new yt),hG[0]=e,gJ?(t.x=Na[0],t.y=Na[1],t.z=Na[2],t.w=Na[3]):(t.x=Na[3],t.y=Na[2],t.z=Na[1],t.w=Na[0]),t};yt.unpackFloat=function(e){return gJ?(Na[0]=e.x,Na[1]=e.y,Na[2]=e.z,Na[3]=e.w):(Na[0]=e.w,Na[1]=e.z,Na[2]=e.y,Na[3]=e.x),hG[0]};var oe=yt;function $e(e,t,n,i,r,o,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(o,0),this[8]=y(c,0)}$e.packedLength=9;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};$e.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};$e.packArray=function(e,t){let n=e.length,i=n*9;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)$e.pack(e[r],t,r*9);return t};$e.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let r=i/9;t[r]=$e.unpack(e,i,t[r])}return t};$e.clone=function(e,t){if(u(e))return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new $e(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};$e.fromArray=$e.unpack;$e.fromColumnMajorArray=function(e,t){return $e.clone(e,t)};$e.fromRowMajorArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new $e(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};$e.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,r=e.x*e.z,o=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,l=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-l+d,g=2*(i-f),h=2*(r+c),A=2*(i+f),x=-n+s-l+d,C=2*(a-o),T=2*(r-c),E=2*(a+o),S=-n-s+l+d;return u(t)?(t[0]=p,t[1]=A,t[2]=T,t[3]=g,t[4]=x,t[5]=E,t[6]=h,t[7]=C,t[8]=S,t):new $e(p,g,h,A,x,C,T,E,S)};$e.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),r=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,l=-r*s+a*o*i,f=a*s+r*o*i,d=n*s,p=r*i+a*o*s,g=-a*i+r*o*s,h=-o,A=a*n,x=r*n;return u(t)?(t[0]=c,t[1]=d,t[2]=h,t[3]=l,t[4]=p,t[5]=A,t[6]=f,t[7]=g,t[8]=x,t):new $e(c,l,f,d,p,g,h,A,x)};$e.fromScale=function(e,t){return u(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new $e(e.x,0,0,0,e.y,0,0,0,e.z)};$e.fromUniformScale=function(e,t){return u(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new $e(e,0,0,0,e,0,0,0,e)};$e.fromCrossProduct=function(e,t){return u(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new $e(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};$e.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return u(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new $e(1,0,0,0,n,-i,0,i,n)};$e.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return u(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new $e(n,0,i,0,1,0,-i,0,n)};$e.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return u(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $e(n,-i,0,i,n,0,0,0,1)};$e.toArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};$e.getElementIndex=function(e,t){return e*3+t};$e.getColumn=function(e,t,n){let i=t*3,r=e[i],o=e[i+1],s=e[i+2];return n.x=r,n.y=o,n.z=s,n};$e.setColumn=function(e,t,n,i){i=$e.clone(e,i);let r=t*3;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i};$e.getRow=function(e,t,n){let i=e[t],r=e[t+3],o=e[t+6];return n.x=i,n.y=r,n.z=o,n};$e.setRow=function(e,t,n,i){return i=$e.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var lCe=new m;$e.setScale=function(e,t,n){let i=$e.getScale(e,lCe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var uCe=new m;$e.setUniformScale=function(e,t,n){let i=$e.getScale(e,uCe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var pG=new m;$e.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],pG)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],pG)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],pG)),t};var yJ=new m;$e.getMaximumScale=function(e){return $e.getScale(e,yJ),m.maximumComponent(yJ)};var fCe=new m;$e.setRotation=function(e,t,n){let i=$e.getScale(e,fCe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var dCe=new m;$e.getRotation=function(e,t){let n=$e.getScale(e,dCe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};$e.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=l,n[7]=f,n[8]=d,n};$e.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};$e.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};$e.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[3]*r+e[6]*o,a=e[1]*i+e[4]*r+e[7]*o,c=e[2]*i+e[5]*r+e[8]*o;return n.x=s,n.y=a,n.z=c,n};$e.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};$e.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};$e.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};$e.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};$e.transpose=function(e,t){let n=e[0],i=e[3],r=e[6],o=e[1],s=e[4],a=e[7],c=e[2],l=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=a,t[6]=c,t[7]=l,t[8]=f,t};function mCe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var _G=[1,0,0],gG=[2,2,1];function hCe(e){let t=0;for(let n=0;n<3;++n){let i=e[$e.getElementIndex(gG[n],_G[n])];t+=2*i*i}return Math.sqrt(t)}function pCe(e,t){let n=P.EPSILON15,i=0,r=1;for(let l=0;l<3;++l){let f=Math.abs(e[$e.getElementIndex(gG[l],_G[l])]);f>i&&(r=l,i=f)}let o=1,s=0,a=_G[r],c=gG[r];if(Math.abs(e[$e.getElementIndex(c,a)])>n){let l=e[$e.getElementIndex(c,c)],f=e[$e.getElementIndex(a,a)],d=e[$e.getElementIndex(c,a)],p=(l-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=$e.clone($e.IDENTITY,t),t[$e.getElementIndex(a,a)]=t[$e.getElementIndex(c,c)]=o,t[$e.getElementIndex(c,a)]=s,t[$e.getElementIndex(a,c)]=-s,t}var E3=new $e,AJ=new $e;$e.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,r=0,o=0;u(t)||(t={});let s=t.unitary=$e.clone($e.IDENTITY,t.unitary),a=t.diagonal=$e.clone(e,t.diagonal),c=n*mCe(a);for(;o<i&&hCe(a)>c;)pCe(a,E3),$e.transpose(E3,AJ),$e.multiply(a,E3,a),$e.multiply(AJ,a,a),$e.multiply(s,E3,s),++r>2&&(++o,r=0);return t};$e.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};$e.determinant=function(e){let t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],s=e[7],a=e[2],c=e[5],l=e[8];return t*(o*l-c*s)+r*(c*i-n*l)+a*(n*s-o*i)};$e.inverse=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],f=e[8],d=$e.determinant(e);t[0]=s*f-l*a,t[1]=l*r-i*f,t[2]=i*a-s*r,t[3]=c*a-o*f,t[4]=n*f-c*r,t[5]=o*r-n*a,t[6]=o*l-c*s,t[7]=c*i-n*l,t[8]=n*s-o*i;let p=1/d;return $e.multiplyByScalar(t,p,t)};var _Ce=new $e;$e.inverseTranspose=function(e,t){return $e.inverse($e.transpose(e,_Ce),t)};$e.equals=function(e,t){return e===t||u(e)&&u(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};$e.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};$e.IDENTITY=Object.freeze(new $e(1,0,0,0,1,0,0,0,1));$e.ZERO=Object.freeze(new $e(0,0,0,0,0,0,0,0,0));$e.COLUMN0ROW0=0;$e.COLUMN0ROW1=1;$e.COLUMN0ROW2=2;$e.COLUMN1ROW0=3;$e.COLUMN1ROW1=4;$e.COLUMN1ROW2=5;$e.COLUMN2ROW0=6;$e.COLUMN2ROW1=7;$e.COLUMN2ROW2=8;Object.defineProperties($e.prototype,{length:{get:function(){return $e.packedLength}}});$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};$e.prototype.equalsEpsilon=function(e,t){return $e.equalsEpsilon(this,e,t)};$e.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var Fbt={};bJ(Fbt,{AlphaMode:()=>Km,AlphaPipelineStage:()=>gR,Animation:()=>zB,AnimationViewModel:()=>HB,Appearance:()=>or,ApproximateTerrainHeights:()=>oi,ArcGISTiledElevationTerrainProvider:()=>nq,ArcGisBaseMapType:()=>xm,ArcGisMapServerImageryProvider:()=>Rh,ArcGisMapService:()=>Lu,ArcType:()=>Zt,ArticulationStageType:()=>$a,AssociativeArray:()=>Tt,AttributeCompression:()=>Xn,AttributeType:()=>cn,AutoExposure:()=>p2,AutomaticUniforms:()=>rp,Axis:()=>hr,AxisAlignedBoundingBox:()=>lg,B3dmLoader:()=>ND,B3dmParser:()=>OD,BaseLayerPicker:()=>FB,BaseLayerPickerViewModel:()=>NB,BatchTable:()=>z0,BatchTableHierarchy:()=>hx,BatchTexture:()=>Fc,BatchTexturePipelineStage:()=>yR,Billboard:()=>gr,BillboardCollection:()=>au,BillboardGraphics:()=>Na,BillboardVisualizer:()=>hv,BingMapsGeocoderService:()=>rq,BingMapsImageryProvider:()=>xS,BingMapsStyle:()=>gS,BlendEquation:()=>_a,BlendFunction:()=>wr,BlendOption:()=>Ir,BlendingState:()=>dn,BoundingRectangle:()=>Ye,BoundingSphere:()=>ae,BoundingSphereState:()=>ut,BoxEmitter:()=>HX,BoxGeometry:()=>cl,BoxGeometryUpdater:()=>MP,BoxGraphics:()=>ex,BoxOutlineGeometry:()=>ad,BrdfLutGenerator:()=>AF,Buffer:()=>mt,BufferLoader:()=>bx,BufferUsage:()=>Fe,CPUStylingPipelineStage:()=>TR,CallbackProperty:()=>_d,Camera:()=>mr,CameraEventAggregator:()=>T2,CameraEventType:()=>Ni,CameraFlightPath:()=>SF,Cartesian2:()=>H,Cartesian3:()=>m,Cartesian4:()=>oe,Cartographic:()=>me,CartographicGeocoderService:()=>sN,CatmullRomSpline:()=>sq,Cesium3DContentGroup:()=>mx,Cesium3DTile:()=>Cf,Cesium3DTileBatchTable:()=>Tp,Cesium3DTileColorBlendMode:()=>_l,Cesium3DTileContent:()=>GX,Cesium3DTileContentFactory:()=>Kx,Cesium3DTileContentState:()=>Gr,Cesium3DTileContentType:()=>ms,Cesium3DTileFeature:()=>ws,Cesium3DTileFeatureTable:()=>Rd,Cesium3DTileOptimizationHint:()=>pf,Cesium3DTileOptimizations:()=>eM,Cesium3DTilePass:()=>Fr,Cesium3DTilePassState:()=>Wf,Cesium3DTilePointFeature:()=>qp,Cesium3DTileRefine:()=>Vr,Cesium3DTileStyle:()=>J_,Cesium3DTileStyleEngine:()=>sM,Cesium3DTilesInspector:()=>qB,Cesium3DTilesInspectorViewModel:()=>jB,Cesium3DTilesVoxelProvider:()=>YX,Cesium3DTileset:()=>Ns,Cesium3DTilesetBaseTraversal:()=>dM,Cesium3DTilesetCache:()=>iM,Cesium3DTilesetGraphics:()=>ax,Cesium3DTilesetHeatmap:()=>rM,Cesium3DTilesetMetadata:()=>ay,Cesium3DTilesetMostDetailedTraversal:()=>lM,Cesium3DTilesetSkipTraversal:()=>pM,Cesium3DTilesetStatistics:()=>c_,Cesium3DTilesetTraversal:()=>Ls,Cesium3DTilesetVisualizer:()=>_M,CesiumInspector:()=>KB,CesiumInspectorViewModel:()=>XB,CesiumTerrainProvider:()=>Xy,CesiumWidget:()=>k2,Check:()=>ol,CheckerboardMaterialProperty:()=>MA,CircleEmitter:()=>sB,CircleGeometry:()=>dq,CircleOutlineGeometry:()=>mq,ClassificationModelDrawCommand:()=>ZD,ClassificationPipelineStage:()=>xR,ClassificationPrimitive:()=>AT,ClassificationType:()=>Gn,ClearCommand:()=>li,ClippingPlane:()=>Rx,ClippingPlaneCollection:()=>us,Clock:()=>qd,ClockRange:()=>No,ClockStep:()=>yr,ClockViewModel:()=>MB,CloudCollection:()=>QX,CloudType:()=>qS,Color:()=>z,ColorBlendMode:()=>Za,ColorGeometryInstanceAttribute:()=>zt,ColorMaterialProperty:()=>Vt,Command:()=>$K,ComponentDatatype:()=>X,Composite3DTileContent:()=>GP,CompositeEntityCollection:()=>$9,CompositeMaterialProperty:()=>NA,CompositePositionProperty:()=>na,CompositeProperty:()=>ic,CompressedTextureBuffer:()=>Fv,ComputeCommand:()=>ef,ComputeEngine:()=>vN,ConditionsExpression:()=>tB,ConeEmitter:()=>nK,ConstantPositionProperty:()=>Dc,ConstantProperty:()=>ti,ConstantSpline:()=>UD,ContentMetadata:()=>GO,Context:()=>RN,ContextLimits:()=>Ht,CoplanarPolygonGeometry:()=>QM,CoplanarPolygonGeometryLibrary:()=>n_,CoplanarPolygonOutlineGeometry:()=>xf,CornerType:()=>Mi,CorridorGeometry:()=>fb,CorridorGeometryLibrary:()=>Vi,CorridorGeometryUpdater:()=>SM,CorridorGraphics:()=>nx,CorridorOutlineGeometry:()=>EM,Credit:()=>vt,CreditDisplay:()=>PF,CubeMap:()=>Ha,CubeMapFace:()=>Nm,CubicRealPolynomial:()=>B0,CullFace:()=>xi,CullingVolume:()=>ts,CumulusCloud:()=>Hu,CustomDataSource:()=>DM,CustomHeightmapTerrainProvider:()=>pq,CustomShader:()=>WC,CustomShaderMode:()=>Gp,CustomShaderPipelineStage:()=>PR,CustomShaderTranslucencyMode:()=>jg,CylinderGeometry:()=>RM,CylinderGeometryLibrary:()=>mb,CylinderGeometryUpdater:()=>MM,CylinderGraphics:()=>ix,CylinderOutlineGeometry:()=>OM,CzmlDataSource:()=>GM,DataSource:()=>Mo,DataSourceClock:()=>Yd,DataSourceCollection:()=>WM,DataSourceDisplay:()=>DL,DebugAppearance:()=>lK,DebugCameraPrimitive:()=>Mh,DebugInspector:()=>D2,DebugModelMatrixPrimitive:()=>lB,DefaultProxy:()=>gq,DepthFunction:()=>Wa,DepthPlane:()=>OF,DequantizationPipelineStage:()=>RR,DerivedCommand:()=>z_,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>LF,DirectionalLight:()=>uK,DiscardEmptyTileImagePolicy:()=>yS,DiscardMissingTileImagePolicy:()=>nF,DistanceDisplayCondition:()=>It,DistanceDisplayConditionGeometryInstanceAttribute:()=>Hn,DoubleEndedPriorityQueue:()=>$b,DoublyLinkedList:()=>nM,DracoLoader:()=>Dp,DrawCommand:()=>tt,DynamicGeometryBatch:()=>Cb,DynamicGeometryUpdater:()=>ai,EarthOrientationParameters:()=>vv,EarthOrientationParametersSample:()=>ng,EasingFunction:()=>Fo,EllipseGeometry:()=>qc,EllipseGeometryLibrary:()=>Dl,EllipseGeometryUpdater:()=>qM,EllipseGraphics:()=>rx,EllipseOutlineGeometry:()=>_u,Ellipsoid:()=>re,EllipsoidGeodesic:()=>$u,EllipsoidGeometry:()=>ks,EllipsoidGeometryUpdater:()=>XM,EllipsoidGraphics:()=>ox,EllipsoidOutlineGeometry:()=>lu,EllipsoidPrimitive:()=>xF,EllipsoidRhumbLine:()=>xa,EllipsoidSurfaceAppearance:()=>fK,EllipsoidTangentPlane:()=>ya,EllipsoidTerrainProvider:()=>Qb,EllipsoidalOccluder:()=>h_,Empty3DTileContent:()=>yA,EncodedCartesian3:()=>Yn,Entity:()=>Kr,EntityCluster:()=>uu,EntityCollection:()=>Fs,EntityView:()=>OL,Event:()=>_e,EventHelper:()=>Do,Expression:()=>rf,ExpressionNodeType:()=>yt,ExtrapolationType:()=>du,FeatureDetection:()=>Wt,FeatureIdPipelineStage:()=>Wg,Fog:()=>NF,ForEach:()=>Re,FrameRateMonitor:()=>dB,FrameState:()=>FF,Framebuffer:()=>ea,FramebufferManager:()=>hi,FrustumCommands:()=>VF,FrustumGeometry:()=>tC,FrustumOutlineGeometry:()=>fN,Fullscreen:()=>_o,FullscreenButton:()=>ZB,FullscreenButtonViewModel:()=>JB,GeoJsonDataSource:()=>GL,GeoJsonLoader:()=>FD,GeocodeType:()=>Jy,Geocoder:()=>QB,GeocoderService:()=>rS,GeocoderViewModel:()=>$B,GeographicProjection:()=>Pi,GeographicTilingScheme:()=>ji,Geometry:()=>ft,Geometry3DTileContent:()=>jP,GeometryAttribute:()=>De,GeometryAttributes:()=>pn,GeometryFactory:()=>Tq,GeometryInstance:()=>Ct,GeometryInstanceAttribute:()=>ja,GeometryOffsetAttribute:()=>sn,GeometryPipeline:()=>Bn,GeometryPipelineStage:()=>NR,GeometryType:()=>Yu,GeometryUpdater:()=>ci,GeometryVisualizer:()=>gL,GetFeatureInfoFormat:()=>uC,Globe:()=>yF,GlobeDepth:()=>zF,GlobeSurfaceShaderSet:()=>tF,GlobeSurfaceTile:()=>zf,GlobeSurfaceTileProvider:()=>cF,GlobeTranslucency:()=>lF,GlobeTranslucencyFramebuffer:()=>HF,GlobeTranslucencyState:()=>BF,GltfBufferViewLoader:()=>BT,GltfDracoLoader:()=>kT,GltfImageLoader:()=>UT,GltfIndexBufferLoader:()=>VT,GltfJsonLoader:()=>HT,GltfLoader:()=>Jm,GltfLoaderUtil:()=>xl,GltfStructuralMetadataLoader:()=>vD,GltfTextureLoader:()=>GT,GltfVertexBufferLoader:()=>WT,GoogleEarthEnterpriseImageryProvider:()=>mK,GoogleEarthEnterpriseMapsProvider:()=>AS,GoogleEarthEnterpriseMetadata:()=>pm,GoogleEarthEnterpriseTerrainData:()=>oS,GoogleEarthEnterpriseTerrainProvider:()=>Rq,GoogleEarthEnterpriseTileInformation:()=>mN,GoogleMaps:()=>iC,GpxDataSource:()=>YL,GregorianDate:()=>Zh,GridImageryProvider:()=>hK,GridMaterialProperty:()=>jA,GroundGeometryUpdater:()=>Jn,GroundPolylineGeometry:()=>J0,GroundPolylinePrimitive:()=>dd,GroundPrimitive:()=>Ic,GroupMetadata:()=>DA,HeadingPitchRange:()=>xu,HeadingPitchRoll:()=>za,Heap:()=>Tv,HeightReference:()=>We,HeightmapEncoding:()=>Ff,HeightmapTerrainData:()=>Ia,HeightmapTessellator:()=>KE,HermitePolynomialApproximation:()=>LM,HermiteSpline:()=>zg,HilbertOrder:()=>MT,HomeButton:()=>t3,HomeButtonViewModel:()=>e3,HorizontalOrigin:()=>yi,I3SDataProvider:()=>kC,I3SFeature:()=>hB,I3SField:()=>pB,I3SGeometry:()=>XS,I3SLayer:()=>m0,I3SNode:()=>KS,I3dmLoader:()=>kD,I3dmParser:()=>BD,Iau2000Orientation:()=>pN,Iau2006XysData:()=>wv,Iau2006XysSample:()=>L0,IauOrientationAxes:()=>_N,IauOrientationParameters:()=>hN,ImageBasedLighting:()=>dx,ImageBasedLightingPipelineStage:()=>nR,ImageMaterialProperty:()=>pg,Imagery:()=>DS,ImageryLayer:()=>Hs,ImageryLayerCollection:()=>uF,ImageryLayerFeatureInfo:()=>ym,ImageryProvider:()=>$c,ImageryState:()=>di,Implicit3DTileContent:()=>qT,ImplicitAvailabilityBitstream:()=>NT,ImplicitMetadataView:()=>FT,ImplicitSubdivisionScheme:()=>qo,ImplicitSubtree:()=>Px,ImplicitSubtreeCache:()=>iB,ImplicitSubtreeMetadata:()=>qP,ImplicitTileCoordinates:()=>cb,ImplicitTileset:()=>cy,IndexDatatype:()=>Be,InfoBox:()=>i3,InfoBoxViewModel:()=>n3,InspectorShared:()=>Ma,InstanceAttributeSemantic:()=>Yo,InstancingPipelineStage:()=>mR,InterpolationAlgorithm:()=>Mq,InterpolationType:()=>Id,Intersect:()=>en,IntersectionTests:()=>$i,Intersections2D:()=>O_,Interval:()=>Ac,InvertClassification:()=>kS,Ion:()=>bd,IonGeocoderService:()=>xN,IonImageryProvider:()=>Hf,IonResource:()=>Zs,IonWorldImageryStyle:()=>Cm,Iso8601:()=>Ve,JobScheduler:()=>kF,JobType:()=>Ca,JsonMetadataTable:()=>Mp,JulianDate:()=>ee,KTX2Transcoder:()=>Bv,KeyboardEventModifier:()=>la,KeyframeNode:()=>er,KmlCamera:()=>XL,KmlDataSource:()=>nN,KmlLookAt:()=>KL,KmlTour:()=>JL,KmlTourFlyTo:()=>$L,KmlTourWait:()=>QL,Label:()=>Zg,LabelCollection:()=>ih,LabelGraphics:()=>md,LabelStyle:()=>Hr,LabelVisualizer:()=>yL,LagrangePolynomialApproximation:()=>NM,LeapSecond:()=>Gi,Light:()=>gK,LightingModel:()=>$m,LightingPipelineStage:()=>BR,LinearApproximation:()=>pb,LinearSpline:()=>Vg,ManagedArray:()=>Nc,MapMode2D:()=>Ul,MapProjection:()=>Fq,MapboxImageryProvider:()=>SS,MapboxStyleImageryProvider:()=>yK,Mars3DEx:()=>qh,Material:()=>Wi,MaterialAppearance:()=>fr,MaterialPipelineStage:()=>UR,MaterialProperty:()=>Xr,Math:()=>D,Matrix2:()=>ir,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>ZS,MetadataClass:()=>Sd,MetadataClassProperty:()=>vg,MetadataComponentType:()=>rn,MetadataEntity:()=>kn,MetadataEnum:()=>dD,MetadataEnumValue:()=>fD,MetadataPipelineStage:()=>af,MetadataSchema:()=>vd,MetadataSchemaLoader:()=>jT,MetadataSemantic:()=>Dx,MetadataTable:()=>gl,MetadataTableProperty:()=>XP,MetadataType:()=>qt,MipmapHint:()=>Fm,Model:()=>Ld,Model3DTileContent:()=>eh,ModelAlphaOptions:()=>tO,ModelAnimation:()=>GD,ModelAnimationChannel:()=>HD,ModelAnimationCollection:()=>WD,ModelAnimationLoop:()=>Tl,ModelAnimationState:()=>Od,ModelArticulation:()=>rR,ModelArticulationStage:()=>iR,ModelClippingPlanesPipelineStage:()=>aR,ModelColorPipelineStage:()=>Gg,ModelComponents:()=>Bt,ModelDrawCommand:()=>$D,ModelFeature:()=>jD,ModelFeatureTable:()=>YD,ModelGraphics:()=>pp,ModelLightingOptions:()=>fO,ModelMatrixUpdateStage:()=>hR,ModelNode:()=>cR,ModelRenderResources:()=>rO,ModelRuntimeNode:()=>_R,ModelRuntimePrimitive:()=>QR,ModelSceneGraph:()=>mO,ModelSilhouettePipelineStage:()=>aO,ModelSkin:()=>eO,ModelSplitterPipelineStage:()=>lO,ModelStatistics:()=>hO,ModelType:()=>Ur,ModelUtility:()=>$t,ModelVisualizer:()=>bL,Moon:()=>CF,MorphTargetsPipelineStage:()=>zR,MorphWeightSpline:()=>Vq,MortonOrder:()=>ly,Multiple3DTileContent:()=>qO,MultisampleFramebuffer:()=>ID,NavigationHelpButton:()=>o3,NavigationHelpButtonViewModel:()=>r3,NearFarScalar:()=>Ot,NeverTileDiscardPolicy:()=>bK,NodeRenderResources:()=>uO,NodeStatisticsPipelineStage:()=>pR,NodeTransformationProperty:()=>sx,OIT:()=>GF,Occluder:()=>bN,OctahedralProjectedCubeMap:()=>xd,OffsetGeometryInstanceAttribute:()=>Zi,OpenCageGeocoderService:()=>Gq,OpenStreetMapImageryProvider:()=>UC,OrderedGroundPrimitiveCollection:()=>jM,OrientedBoundingBox:()=>On,OrthographicFrustum:()=>nn,OrthographicOffCenterFrustum:()=>vo,Packable:()=>Wq,PackableForInterpolation:()=>jq,Particle:()=>$S,ParticleBurst:()=>TK,ParticleEmitter:()=>AK,ParticleSystem:()=>EK,Pass:()=>Ee,PassState:()=>_c,PathGraphics:()=>_p,PathVisualizer:()=>TL,PeliasGeocoderService:()=>yN,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>H_,PerformanceWatchdog:()=>a3,PerformanceWatchdogViewModel:()=>s3,PerspectiveFrustum:()=>Ii,PerspectiveOffCenterFrustum:()=>Zc,PickDepth:()=>UF,PickDepthFramebuffer:()=>jF,PickFramebuffer:()=>XF,Picking:()=>ZF,PickingPipelineStage:()=>HR,PinBuilder:()=>P_,PixelDatatype:()=>Xe,PixelFormat:()=>ct,Plane:()=>un,PlaneGeometry:()=>KM,PlaneGeometryUpdater:()=>ZM,PlaneGraphics:()=>vP,PlaneOutlineGeometry:()=>JM,PntsLoader:()=>dA,PntsParser:()=>Gx,PointCloud:()=>xB,PointCloudEyeDomeLighting:()=>Np,PointCloudShading:()=>Zm,PointCloudStylingPipelineStage:()=>WR,PointGraphics:()=>cx,PointPrimitive:()=>Bs,PointPrimitiveCollection:()=>VA,PointVisualizer:()=>EL,PolygonGeometry:()=>Sb,PolygonGeometryLibrary:()=>Kn,PolygonGeometryUpdater:()=>tL,PolygonGraphics:()=>hd,PolygonHierarchy:()=>Rc,PolygonOutlineGeometry:()=>eL,PolygonPipeline:()=>fi,Polyline:()=>df,PolylineArrowMaterialProperty:()=>YA,PolylineCollection:()=>Bd,PolylineColorAppearance:()=>Wo,PolylineDashMaterialProperty:()=>KA,PolylineGeometry:()=>w_,PolylineGeometryUpdater:()=>wL,PolylineGlowMaterialProperty:()=>ZA,PolylineGraphics:()=>qa,PolylineMaterialAppearance:()=>Ks,PolylineOutlineMaterialProperty:()=>gy,PolylinePipeline:()=>Oi,PolylineVisualizer:()=>PL,PolylineVolumeGeometry:()=>rL,PolylineVolumeGeometryLibrary:()=>Hd,PolylineVolumeGeometryUpdater:()=>cL,PolylineVolumeGraphics:()=>lx,PolylineVolumeOutlineGeometry:()=>aL,PositionProperty:()=>mp,PositionPropertyArray:()=>y_,PostProcessStage:()=>Tr,PostProcessStageCollection:()=>x2,PostProcessStageComposite:()=>el,PostProcessStageLibrary:()=>qf,PostProcessStageSampleMode:()=>ku,PostProcessStageTextureCache:()=>EC,Primitive:()=>wn,PrimitiveCollection:()=>Pl,PrimitiveLoadPlan:()=>Nx,PrimitiveOutlineGenerator:()=>Lx,PrimitiveOutlinePipelineStage:()=>YR,PrimitivePipeline:()=>Y0,PrimitiveRenderResources:()=>dO,PrimitiveState:()=>xo,PrimitiveStatisticsPipelineStage:()=>XR,PrimitiveType:()=>Le,ProjectionPicker:()=>l3,ProjectionPickerViewModel:()=>c3,Property:()=>q,PropertyArray:()=>QA,PropertyAttribute:()=>Mx,PropertyAttributeProperty:()=>TD,PropertyBag:()=>ml,PropertyTable:()=>Bc,PropertyTexture:()=>Ox,PropertyTextureProperty:()=>CD,ProviderViewModel:()=>Ts,Proxy:()=>Yq,QuadraticRealPolynomial:()=>Sc,QuadtreeOccluders:()=>fF,QuadtreePrimitive:()=>gF,QuadtreeTile:()=>dF,QuadtreeTileLoadState:()=>Vs,QuadtreeTileProvider:()=>DK,QuantizedMeshTerrainData:()=>Jb,QuarticRealPolynomial:()=>dw,Quaternion:()=>Ne,QuaternionSpline:()=>zD,Queue:()=>iy,Ray:()=>vn,Rectangle:()=>ce,RectangleCollisionChecker:()=>Pb,RectangleGeometry:()=>wb,RectangleGeometryLibrary:()=>hs,RectangleGeometryUpdater:()=>lL,RectangleGraphics:()=>pd,RectangleOutlineGeometry:()=>Qx,ReferenceFrame:()=>ar,ReferenceProperty:()=>x_,RenderState:()=>Ue,Renderbuffer:()=>ou,RenderbufferFormat:()=>kc,Request:()=>jr,RequestErrorEvent:()=>Rm,RequestScheduler:()=>Ua,RequestState:()=>ni,RequestType:()=>$o,Resource:()=>Ie,ResourceCache:()=>ki,ResourceCacheKey:()=>bl,ResourceCacheStatistics:()=>_D,ResourceLoader:()=>cr,ResourceLoaderState:()=>wt,Rotation:()=>vf,RuntimeError:()=>de,S2Cell:()=>vp,SDFSettings:()=>Os,SampledPositionProperty:()=>ra,SampledProperty:()=>hu,Sampler:()=>mn,ScaledPositionProperty:()=>_h,Scene:()=>O2,SceneFramebuffer:()=>gC,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>KR,SceneModePicker:()=>f3,SceneModePickerViewModel:()=>u3,SceneTransforms:()=>Qi,SceneTransitioner:()=>C2,ScreenSpaceCameraController:()=>S2,ScreenSpaceEventHandler:()=>Ru,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>qg,SelectionIndicator:()=>h3,SelectionIndicatorViewModel:()=>m3,ShaderBuilder:()=>zx,ShaderCache:()=>wN,ShaderDestination:()=>Te,ShaderFunction:()=>iO,ShaderProgram:()=>Jt,ShaderSource:()=>ze,ShaderStruct:()=>nO,ShadowMap:()=>j_,ShadowMapShader:()=>Bh,ShadowMode:()=>bn,ShadowVolumeAppearance:()=>$l,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>Qy,SimplePolylineGeometry:()=>iY,SingleTileImageryProvider:()=>vS,SkinningPipelineStage:()=>ZR,SkyAtmosphere:()=>M2,SkyBox:()=>L2,SpatialNode:()=>CB,SphereEmitter:()=>OK,SphereGeometry:()=>rY,SphereOutlineGeometry:()=>r_,Spherical:()=>FM,Spline:()=>lr,SplitDirection:()=>Uc,Splitter:()=>QS,StaticGeometryColorBatch:()=>Pf,StaticGeometryPerMaterialBatch:()=>Df,StaticGroundGeometryColorBatch:()=>CE,StaticGroundGeometryPerMaterialBatch:()=>uL,StaticGroundPolylinePerMaterialBatch:()=>IL,StaticOutlineGeometryBatch:()=>EE,StencilConstants:()=>kt,StencilFunction:()=>Wn,StencilOperation:()=>ht,SteppedSpline:()=>VD,StripeMaterialProperty:()=>tE,StripeOrientation:()=>Kd,StructuralMetadata:()=>Ta,StyleCommandsNeeded:()=>Md,StyleExpression:()=>MK,Sun:()=>B2,SunLight:()=>N_,SunPostProcess:()=>I2,SupportedImageFormats:()=>wD,SvgPathBindingHandler:()=>RB,TaskProcessor:()=>bi,Terrain:()=>AB,TerrainData:()=>fm,TerrainEncoding:()=>dc,TerrainExaggeration:()=>vc,TerrainFillMesh:()=>LS,TerrainMesh:()=>kf,TerrainOffsetProperty:()=>ux,TerrainProvider:()=>Xo,TerrainQuantization:()=>Us,TerrainState:()=>Cr,Texture:()=>Lt,TextureAtlas:()=>Jg,TextureCache:()=>IN,TextureMagnificationFilter:()=>Ai,TextureManager:()=>vB,TextureMinificationFilter:()=>ln,TextureUniform:()=>YK,TextureWrap:()=>In,TileAvailability:()=>dm,TileBoundingRegion:()=>yf,TileBoundingS2Cell:()=>$O,TileBoundingSphere:()=>o_,TileBoundingVolume:()=>LK,TileCoordinatesImageryProvider:()=>SB,TileDiscardPolicy:()=>FK,TileEdge:()=>yn,TileImagery:()=>RS,TileMapServiceImageryProvider:()=>Oh,TileMetadata:()=>WO,TileOrientedBoundingBox:()=>bf,TileProviderError:()=>Ti,TileReplacementQueue:()=>mF,TileSelectionResult:()=>ei,TileState:()=>BK,Tileset3DTileContent:()=>gO,TilesetMetadata:()=>QO,TilesetPipelineStage:()=>eR,TilingScheme:()=>oY,TimeConstants:()=>Qn,TimeDynamicImagery:()=>fC,TimeDynamicPointCloud:()=>nv,TimeInterval:()=>An,TimeIntervalCollection:()=>Oo,TimeIntervalCollectionPositionProperty:()=>b_,TimeIntervalCollectionProperty:()=>C_,TimeStandard:()=>Zn,Timeline:()=>g3,TimelineHighlightRange:()=>p3,TimelineTrack:()=>_3,Tipsify:()=>tP,ToggleButtonViewModel:()=>_0,Tonemapper:()=>u0,Transforms:()=>Mt,TranslationRotationScale:()=>_g,TranslucentTileClassification:()=>KF,TridiagonalSystemSolver:()=>tA,TrustedServers:()=>cT,TweenCollection:()=>wC,UniformState:()=>DN,UniformType:()=>rv,UrlTemplateImageryProvider:()=>zs,VERSION:()=>Nbt,VRButton:()=>b3,VRButtonViewModel:()=>x3,VRTheWorldTerrainProvider:()=>cY,VaryingType:()=>XK,Vector3DTileBatch:()=>qm,Vector3DTileClampedPolylines:()=>VO,Vector3DTileContent:()=>HO,Vector3DTileGeometry:()=>Ep,Vector3DTilePoints:()=>MO,Vector3DTilePolygons:()=>LO,Vector3DTilePolylines:()=>Xx,Vector3DTilePrimitive:()=>gx,VelocityOrientationProperty:()=>kM,VelocityVectorProperty:()=>xb,VertexArray:()=>si,VertexArrayFacade:()=>Wp,VertexAttributeSemantic:()=>At,VertexFormat:()=>Oe,VerticalOrigin:()=>Rn,VideoSynchronizer:()=>sY,View:()=>bC,Viewer:()=>dJ,ViewportQuad:()=>VK,Visibility:()=>mo,Visualizer:()=>Zj,VoxelBoxShape:()=>Hh,VoxelContent:()=>rB,VoxelCylinderShape:()=>Gh,VoxelEllipsoidShape:()=>OC,VoxelInspector:()=>T3,VoxelInspectorViewModel:()=>C3,VoxelPrimitive:()=>sv,VoxelProvider:()=>WK,VoxelRenderResources:()=>$2,VoxelShape:()=>jK,VoxelShapeType:()=>Yi,VoxelTraversal:()=>iv,VulkanConstants:()=>lY,WallGeometry:()=>dL,WallGeometryLibrary:()=>Db,WallGeometryUpdater:()=>pL,WallGraphics:()=>gp,WallOutlineGeometry:()=>hL,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>wS,WebMapTileServiceImageryProvider:()=>IS,WebMercatorProjection:()=>Ri,WebMercatorTilingScheme:()=>Bo,WindingOrder:()=>es,WireframeIndexGenerator:()=>uA,WireframePipelineStage:()=>$R,_shadersAcesTonemappingStage:()=>$F,_shadersAdditiveBlend:()=>v2,_shadersAdjustTranslucentFS:()=>uS,_shadersAllMaterialAppearanceFS:()=>Dv,_shadersAllMaterialAppearanceVS:()=>Rv,_shadersAmbientOcclusionGenerate:()=>QF,_shadersAmbientOcclusionModulate:()=>e2,_shadersAspectRampMaterial:()=>Vv,_shadersAtmosphereCommon:()=>F_,_shadersBasicMaterialAppearanceFS:()=>Ov,_shadersBasicMaterialAppearanceVS:()=>Mv,_shadersBillboardCollectionFS:()=>yO,_shadersBillboardCollectionVS:()=>xO,_shadersBlackAndWhite:()=>t2,_shadersBloomComposite:()=>n2,_shadersBrdfLutGeneratorFS:()=>MN,_shadersBrightPass:()=>w2,_shadersBrightness:()=>i2,_shadersBumpMapMaterial:()=>zv,_shadersCPUStylingStageFS:()=>CR,_shadersCPUStylingStageVS:()=>bR,_shadersCheckerboardMaterial:()=>Hv,_shadersCloudCollectionFS:()=>LN,_shadersCloudCollectionVS:()=>NN,_shadersCloudNoiseFS:()=>FN,_shadersCloudNoiseVS:()=>BN,_shadersCompareAndPackTranslucentDepth:()=>kN,_shadersCompositeOITFS:()=>UN,_shadersCompositeTranslucentClassification:()=>xC,_shadersContrastBias:()=>r2,_shadersCustomShaderStageFS:()=>ER,_shadersCustomShaderStageVS:()=>AR,_shadersCzmBuiltins:()=>V0,_shadersDepthOfField:()=>o2,_shadersDepthPlaneFS:()=>VN,_shadersDepthPlaneVS:()=>zN,_shadersDepthView:()=>s2,_shadersDepthViewPacked:()=>qK,_shadersDotMaterial:()=>Gv,_shadersEdgeDetection:()=>a2,_shadersElevationBandMaterial:()=>Wv,_shadersElevationContourMaterial:()=>jv,_shadersElevationRampMaterial:()=>qv,_shadersEllipsoidFS:()=>fS,_shadersEllipsoidSurfaceAppearanceFS:()=>uB,_shadersEllipsoidSurfaceAppearanceVS:()=>fB,_shadersEllipsoidVS:()=>dS,_shadersFXAA:()=>l2,_shadersFXAA3_11:()=>HN,_shadersFadeMaterial:()=>Yv,_shadersFeatureIdStageFS:()=>SR,_shadersFeatureIdStageVS:()=>vR,_shadersFilmicTonemapping:()=>c2,_shadersGaussianBlur1D:()=>l0,_shadersGeometryStageFS:()=>OR,_shadersGeometryStageVS:()=>MR,_shadersGlobeFS:()=>GN,_shadersGlobeVS:()=>WN,_shadersGridMaterial:()=>Xv,_shadersGroundAtmosphere:()=>mS,_shadersHSBToRGB:()=>UI,_shadersHSLToRGB:()=>VI,_shadersImageBasedLightingStageFS:()=>tR,_shadersInstancingStageCommon:()=>lR,_shadersInstancingStageVS:()=>uR,_shadersIntersectBox:()=>W2,_shadersIntersectClippingPlanes:()=>G2,_shadersIntersectCylinder:()=>j2,_shadersIntersectDepth:()=>H2,_shadersIntersectEllipsoid:()=>q2,_shadersIntersection:()=>RC,_shadersIntersectionUtils:()=>z2,_shadersLegacyInstancingStageVS:()=>fR,_shadersLensFlare:()=>u2,_shadersLightingStageFS:()=>FR,_shadersMaterialStageFS:()=>kR,_shadersMegatexture:()=>Z2,_shadersMetadataStageFS:()=>wR,_shadersMetadataStageVS:()=>IR,_shadersModelClippingPlanesStageFS:()=>sR,_shadersModelColorStageFS:()=>oR,_shadersModelFS:()=>XD,_shadersModelSilhouetteStageFS:()=>oO,_shadersModelSilhouetteStageVS:()=>sO,_shadersModelSplitterStageFS:()=>cO,_shadersModelVS:()=>KD,_shadersModifiedReinhardTonemapping:()=>f2,_shadersMorphTargetsStageVS:()=>VR,_shadersNightVision:()=>d2,_shadersNormalMapMaterial:()=>Kv,_shadersOctahedralProjectionAtlasFS:()=>FP,_shadersOctahedralProjectionFS:()=>BP,_shadersOctahedralProjectionVS:()=>kP,_shadersOctree:()=>J2,_shadersPassThrough:()=>Vl,_shadersPassThroughDepth:()=>s0,_shadersPerInstanceColorAppearanceFS:()=>ow,_shadersPerInstanceColorAppearanceVS:()=>sw,_shadersPerInstanceFlatColorAppearanceFS:()=>F0,_shadersPerInstanceFlatColorAppearanceVS:()=>aw,_shadersPointCloudEyeDomeLighting:()=>DD,_shadersPointCloudStylingStageVS:()=>GR,_shadersPointPrimitiveCollectionFS:()=>_y,_shadersPointPrimitiveCollectionVS:()=>vM,_shadersPolylineArrowMaterial:()=>Jv,_shadersPolylineColorAppearanceVS:()=>mP,_shadersPolylineCommon:()=>Ql,_shadersPolylineDashMaterial:()=>Zv,_shadersPolylineFS:()=>$0,_shadersPolylineGlowMaterial:()=>$v,_shadersPolylineMaterialAppearanceVS:()=>hP,_shadersPolylineOutlineMaterial:()=>Qv,_shadersPolylineShadowVolumeFS:()=>lP,_shadersPolylineShadowVolumeMorphFS:()=>uP,_shadersPolylineShadowVolumeMorphVS:()=>fP,_shadersPolylineShadowVolumeVS:()=>dP,_shadersPolylineVS:()=>wO,_shadersPrimitiveOutlineStageFS:()=>qR,_shadersPrimitiveOutlineStageVS:()=>jR,_shadersRGBToHSB:()=>d1,_shadersRGBToHSL:()=>m1,_shadersRGBToXYZ:()=>h1,_shadersReinhardTonemapping:()=>m2,_shadersReprojectWebMercatorFS:()=>jN,_shadersReprojectWebMercatorVS:()=>qN,_shadersRimLightingMaterial:()=>ew,_shadersSelectedFeatureIdStageCommon:()=>lA,_shadersShadowVolumeAppearanceFS:()=>CT,_shadersShadowVolumeAppearanceVS:()=>Z1,_shadersShadowVolumeFS:()=>fg,_shadersSilhouette:()=>h2,_shadersSkinningStageVS:()=>JR,_shadersSkyAtmosphereCommon:()=>hS,_shadersSkyAtmosphereFS:()=>YN,_shadersSkyAtmosphereVS:()=>XN,_shadersSkyBoxFS:()=>KN,_shadersSkyBoxVS:()=>JN,_shadersSlopeRampMaterial:()=>tw,_shadersStripeMaterial:()=>nw,_shadersSunFS:()=>ZN,_shadersSunTextureFS:()=>$N,_shadersSunVS:()=>QN,_shadersTexturedMaterialAppearanceFS:()=>Lv,_shadersTexturedMaterialAppearanceVS:()=>Nv,_shadersVector3DTileClampedPolylinesFS:()=>kO,_shadersVector3DTileClampedPolylinesVS:()=>BO,_shadersVector3DTilePolylinesVS:()=>NO,_shadersVectorTileVS:()=>OT,_shadersViewportQuadFS:()=>eF,_shadersViewportQuadVS:()=>sC,_shadersVoxelFS:()=>U2,_shadersVoxelVS:()=>V2,_shadersWater:()=>iw,_shadersXYZToRGB:()=>k1,_shadersacesTonemapping:()=>lI,_shadersalphaWeight:()=>uI,_shadersantialias:()=>fI,_shadersapproximateSphericalCoordinates:()=>dI,_shadersbackFacing:()=>mI,_shadersbranchFreeTernary:()=>hI,_shaderscascadeColor:()=>pI,_shaderscascadeDistance:()=>_I,_shaderscascadeMatrix:()=>gI,_shaderscascadeWeights:()=>yI,_shaderscolumbusViewMorph:()=>xI,_shaderscomputePosition:()=>bI,_shadersconvertUvToBox:()=>Y2,_shadersconvertUvToCylinder:()=>X2,_shadersconvertUvToEllipsoid:()=>K2,_shaderscosineAndSine:()=>CI,_shadersdecompressTextureCoordinates:()=>TI,_shadersdefaultPbrMaterial:()=>AI,_shadersdegreesPerRadian:()=>_w,_shadersdepthClamp:()=>EI,_shadersdepthRange:()=>gw,_shadersdepthRangeStruct:()=>eI,_shaderseastNorthUpToEyeCoordinates:()=>SI,_shadersellipsoidContainsPoint:()=>vI,_shadersellipsoidWgs84TextureCoordinates:()=>wI,_shadersepsilon1:()=>yw,_shadersepsilon2:()=>xw,_shadersepsilon3:()=>bw,_shadersepsilon4:()=>Cw,_shadersepsilon5:()=>Tw,_shadersepsilon6:()=>Aw,_shadersepsilon7:()=>Ew,_shadersequalsEpsilon:()=>II,_shaderseyeOffset:()=>PI,_shaderseyeToWindowCoordinates:()=>DI,_shadersfastApproximateAtan:()=>RI,_shadersfog:()=>OI,_shadersfromCartesian:()=>U1,_shadersgammaCorrect:()=>MI,_shadersgeodeticSurfaceNormal:()=>LI,_shadersgetDefaultMaterial:()=>NI,_shadersgetFloodRect:()=>V1,_shadersgetIndexMat:()=>z1,_shadersgetLambertDiffuse:()=>FI,_shadersgetMaxIndex:()=>H1,_shadersgetMaxIndexVal:()=>G1,_shadersgetSpecular:()=>BI,_shadersgetWaterNoise:()=>kI,_shadershue:()=>zI,_shadersinfinity:()=>Sw,_shadersinverseGamma:()=>HI,_shadersisEmpty:()=>GI,_shadersisFull:()=>WI,_shadersisInEllipsoid:()=>W1,_shadersisInObliq:()=>j1,_shaderslatitudeToWebMercatorFraction:()=>jI,_shaderslineDistance:()=>YI,_shaderslinearToSrgb:()=>qI,_shadersluminance:()=>XI,_shadersmagnitude:()=>q1,_shadersmagnitudeSquared:()=>Y1,_shadersmaterial:()=>tI,_shadersmaterialInput:()=>nI,_shadersmetersPerPixel:()=>KI,_shadersmodelMaterial:()=>iI,_shadersmodelToWindowCoordinates:()=>JI,_shadersmodelVertexOutput:()=>rI,_shadersmultiplyComponents:()=>X1,_shadersmultiplyWithColorBalance:()=>ZI,_shadersnearFarScalar:()=>$I,_shadersoctDecode:()=>QI,_shadersoneOverPi:()=>vw,_shadersoneOverTwoPi:()=>ww,_shaderspackDepth:()=>e1,_shaderspassCesium3DTile:()=>Iw,_shaderspassCesium3DTileClassification:()=>Pw,_shaderspassCesium3DTileClassificationIgnoreShow:()=>Dw,_shaderspassClassification:()=>Rw,_shaderspassCompute:()=>Ow,_shaderspassEnvironment:()=>Mw,_shaderspassGlobe:()=>Lw,_shaderspassOpaque:()=>Nw,_shaderspassOverlay:()=>Fw,_shaderspassTerrainClassification:()=>Bw,_shaderspassTranslucent:()=>kw,_shaderspassVoxels:()=>Uw,_shaderspbrLighting:()=>t1,_shaderspbrMetallicRoughnessMaterial:()=>n1,_shaderspbrParameters:()=>oI,_shaderspbrSpecularGlossinessMaterial:()=>i1,_shadersphong:()=>r1,_shaderspi:()=>Vw,_shaderspiOverFour:()=>zw,_shaderspiOverSix:()=>Hw,_shaderspiOverThree:()=>Gw,_shaderspiOverTwo:()=>Ww,_shadersplaneDistance:()=>o1,_shaderspointAlongRay:()=>s1,_shadersradiansPerDegree:()=>jw,_shadersray:()=>sI,_shadersrayEllipsoidIntersectionInterval:()=>a1,_shadersraySegment:()=>aI,_shadersraySphereIntersectionInterval:()=>c1,_shadersreadDepth:()=>l1,_shadersreadNonPerspective:()=>u1,_shadersreverseLogDepth:()=>f1,_shadersround:()=>p1,_shaderssampleOctahedralProjection:()=>_1,_shaderssaturation:()=>g1,_shadersscaleToGeodeticSurface:()=>K1,_shaderssceneMode2D:()=>qw,_shaderssceneMode3D:()=>Yw,_shaderssceneModeColumbusView:()=>Xw,_shaderssceneModeMorphing:()=>Kw,_shadersshadowDepthCompare:()=>y1,_shadersshadowParameters:()=>cI,_shadersshadowVisibility:()=>x1,_shaderssignNotZero:()=>b1,_shaderssolarRadius:()=>Jw,_shaderssphericalHarmonics:()=>C1,_shaderssrgbToLinear:()=>T1,_shaderstangentToEyeSpaceMatrix:()=>A1,_shaderstextureCube:()=>E1,_shadersthreePiOver2:()=>Zw,_shaderstransformPlane:()=>S1,_shaderstranslateRelativeToEye:()=>v1,_shaderstranslucentPhong:()=>w1,_shaderstranspose:()=>I1,_shaderstwoPi:()=>$w,_shadersunpackDepth:()=>P1,_shadersunpackFloat:()=>D1,_shadersunpackUint:()=>R1,_shadersvalueTransform:()=>O1,_shadersvertexLogDepth:()=>M1,_shaderswebMercatorMaxLatitude:()=>Qw,_shaderswindowToEyeCoordinates:()=>L1,_shaderswriteDepthClamp:()=>N1,_shaderswriteLogDepth:()=>F1,_shaderswriteNonPerspective:()=>B1,addBuffer:()=>sD,addDefaults:()=>$P,addExtensionsRequired:()=>iD,addExtensionsUsed:()=>of,addPipelineExtras:()=>Dg,addToArray:()=>ls,appendForwardSlash:()=>xv,arrayRemoveDuplicates:()=>Er,barycentricCoordinates:()=>H0,binarySearch:()=>Or,buildDrawCommand:()=>QD,buildModuleUrl:()=>tn,buildVoxelDrawCommands:()=>eB,clone:()=>je,combine:()=>gt,computeFlyToLocationForRectangle:()=>LC,createBillboardPointCallback:()=>Wx,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>BB,createDefaultTerrainProviderViewModels:()=>kB,createElevationBandMaterial:()=>iK,createGooglePhotorealistic3DTileset:()=>rK,createGuid:()=>qn,createMaterialPropertyDescriptor:()=>Mr,createOsmBuildings:()=>oK,createOsmBuildingsAsync:()=>sK,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>dl,createTangentSpaceDebugPrimitive:()=>aK,createTaskProcessorWorker:()=>KK,createUniform:()=>hw,createUniformArray:()=>pw,createWorldImagery:()=>cK,createWorldImageryAsync:()=>U_,createWorldTerrain:()=>hq,createWorldTerrainAsync:()=>Zb,decodeGoogleEarthEnterpriseData:()=>aN,decodeVectorPolylinePositions:()=>zO,defaultValue:()=>y,defer:()=>Ys,defined:()=>l,demodernizeShader:()=>J1,deprecationWarning:()=>Q,destroyObject:()=>ue,exportKml:()=>ej,findAccessorMinMax:()=>Sx,findContentMetadata:()=>Jx,findGroupMetadata:()=>Zx,findTileMetadata:()=>jO,forEachTextureInMaterial:()=>zT,formatError:()=>wh,freezeRenderState:()=>U8,getAbsoluteUri:()=>Qh,getAccessorByteStride:()=>yl,getBaseUri:()=>bv,getBinaryAccessor:()=>nu,getClipAndStyleCode:()=>mB,getClippingFunction:()=>B_,getComponentReader:()=>Op,getElement:()=>Pn,getExtensionFromUri:()=>S0,getFilenameFromUri:()=>__,getImageFromTypedArray:()=>dN,getImagePixels:()=>sd,getJsonFromTypedArray:()=>Lr,getMagic:()=>Cd,getStringFromTypedArray:()=>pl,getTimestamp:()=>Ci,hasExtension:()=>ii,heightReferenceOnEntityPropertyChanged:()=>yp,isBitSet:()=>hc,isBlobUri:()=>v0,isCrossOriginUrl:()=>w0,isDataUri:()=>ep,isLeapYear:()=>$h,knockout:()=>be,knockout_3_5_1:()=>qC,knockout_es5:()=>DB,loadAndExecuteScript:()=>I0,loadCubeMap:()=>ON,loadImageFromTypedArray:()=>Tx,loadKTX2:()=>ll,mergeSort:()=>L_,moveTechniqueRenderStates:()=>nD,moveTechniquesToExtension:()=>rD,numberOfComponentsForType:()=>ru,objectToQuery:()=>P0,oneTimeWarning:()=>Nt,parseBatchTable:()=>kp,parseBoundingVolumeSemantics:()=>gD,parseFeatureMetadataLegacy:()=>SD,parseGlb:()=>eD,parseResponseHeaders:()=>Cv,parseStructuralMetadata:()=>ED,pointInsideTriangle:()=>qq,preprocess3DTileContent:()=>sh,processVoxelProperties:()=>Q2,queryToObject:()=>Kl,readAccessorPacked:()=>aD,removeExtension:()=>vx,removeExtensionsRequired:()=>QP,removeExtensionsUsed:()=>Ex,removePipelineExtras:()=>tD,removeUnusedElements:()=>oD,resizeImageToNextPowerOfTwo:()=>Mg,sampleTerrain:()=>xL,sampleTerrainMostDetailed:()=>v_,scaleToGeodeticSurface:()=>A0,subdivideArray:()=>$1,subscribeAndEvaluate:()=>da,updateAccessorComponentTypes:()=>cD,updateVersion:()=>lD,usesExtension:()=>so,viewerCesium3DTilesInspectorMixin:()=>mJ,viewerCesiumInspectorMixin:()=>hJ,viewerDragDropMixin:()=>_J,viewerPerformanceWatchdogMixin:()=>gJ,viewerVoxelInspectorMixin:()=>yJ,webGLConstantToGlslType:()=>uY,wrapFunction:()=>EN,writeTextToCanvas:()=>qx});module.exports=Pm(Fbt);var JC={},BCe={addCache:function(e,t){return JC[e]=t,t},removeCache:function(e){delete JC[e]},getCache:function(e){return JC[e]},getCacheOrAdd:function(e){return JC[e]||(JC[e]={}),JC[e]}},qh=BCe;function TJ(e,t){return e??t}TJ.EMPTY_OBJECT=Object.freeze({});var y=TJ;function kCe(e){return e!=null}var l=kCe;function C0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(C0.prototype=Object.create(Error.prototype),C0.prototype.constructor=C0);C0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};C0.throwInstantiationError=function(){throw new C0("This function defines an interface and should not be called directly.")};var fe=C0;var cs={};cs.typeOf={};function UCe(e){return`${e} is required, actual value was undefined`}function ZC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}cs.defined=function(e,t){if(!l(t))throw new fe(UCe(e))};cs.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(ZC(typeof t,"function",e))};cs.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(ZC(typeof t,"string",e))};cs.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(ZC(typeof t,"number",e))};cs.typeOf.number.lessThan=function(e,t,n){if(cs.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};cs.typeOf.number.lessThanOrEquals=function(e,t,n){if(cs.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};cs.typeOf.number.greaterThan=function(e,t,n){if(cs.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};cs.typeOf.number.greaterThanOrEquals=function(e,t,n){if(cs.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};cs.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(ZC(typeof t,"object",e))};cs.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(ZC(typeof t,"boolean",e))};cs.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(ZC(typeof t,"bigint",e))};cs.typeOf.number.equals=function(e,t,n,i){if(cs.typeOf.number(e,n),cs.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var ol=cs;function fv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(fv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});fv.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};fv.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,r=-1;for(let o=0;o<n.length;o++)if(n[o]===e&&i[o]===t){r=o;break}return r!==-1?(this._insideRaiseEvent?(this._toRemove.push(r),n[r]=void 0,i[r]=void 0):(n.splice(r,1),i.splice(r,1)),!0):!1};function VCe(e,t){return t-e}fv.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let o=t[e];l(o)&&t[e].apply(n[e],arguments)}let r=this._toRemove;if(i=r.length,i>0){for(r.sort(VCe),e=0;e<i;e++){let o=r[e];t.splice(o,1),n.splice(o,1)}r.length=0}this._insideRaiseEvent=!1};var _e=fv;function Q_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(Q_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Q_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Q_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Q_.prototype.equals=function(e){return this===e||e instanceof Q_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Q_.prototype.valueOf=function(){return this._value};Q_.prototype.toString=function(){return String(this._value)};var ti=Q_;function zCe(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function HCe(e){return new ti(e)}function GCe(e,t,n){return zCe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,HCe))}var le=GCe;function dv(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(dv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});dv.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new dv(this)};dv.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var Na=dv;function T0(){this._array=[],this._hash={}}Object.defineProperties(T0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});T0.prototype.contains=function(e){return l(this._hash[e])};T0.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};T0.prototype.get=function(e){return this._hash[e]};T0.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};T0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Tt=T0;var wG=Ki(E3(),1);var lt={};lt.EPSILON1=.1;lt.EPSILON2=.01;lt.EPSILON3=.001;lt.EPSILON4=1e-4;lt.EPSILON5=1e-5;lt.EPSILON6=1e-6;lt.EPSILON7=1e-7;lt.EPSILON8=1e-8;lt.EPSILON9=1e-9;lt.EPSILON10=1e-10;lt.EPSILON11=1e-11;lt.EPSILON12=1e-12;lt.EPSILON13=1e-13;lt.EPSILON14=1e-14;lt.EPSILON15=1e-15;lt.EPSILON16=1e-16;lt.EPSILON17=1e-17;lt.EPSILON18=1e-18;lt.EPSILON19=1e-19;lt.EPSILON20=1e-20;lt.EPSILON21=1e-21;lt.GRAVITATIONALPARAMETER=3986004418e5;lt.SOLAR_RADIUS=6955e5;lt.LUNAR_RADIUS=1737400;lt.SIXTY_FOUR_KILOBYTES=64*1024;lt.FOUR_GIGABYTES=4*1024*1024*1024;lt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});lt.signNotZero=function(e){return e<0?-1:1};lt.toSNorm=function(e,t){return t=y(t,255),Math.round((lt.clamp(e,-1,1)*.5+.5)*t)};lt.fromSNorm=function(e,t){return t=y(t,255),lt.clamp(e,0,t)/t*2-1};lt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:lt.clamp((e-t)/n,0,1)};lt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});lt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});lt.lerp=function(e,t,n){return(1-n)*e+n*t};lt.PI=Math.PI;lt.ONE_OVER_PI=1/Math.PI;lt.PI_OVER_TWO=Math.PI/2;lt.PI_OVER_THREE=Math.PI/3;lt.PI_OVER_FOUR=Math.PI/4;lt.PI_OVER_SIX=Math.PI/6;lt.THREE_PI_OVER_TWO=3*Math.PI/2;lt.TWO_PI=2*Math.PI;lt.ONE_OVER_TWO_PI=1/(2*Math.PI);lt.RADIANS_PER_DEGREE=Math.PI/180;lt.DEGREES_PER_RADIAN=180/Math.PI;lt.RADIANS_PER_ARCSECOND=lt.RADIANS_PER_DEGREE/3600;lt.toRadians=function(e){return e*lt.RADIANS_PER_DEGREE};lt.toDegrees=function(e){return e*lt.DEGREES_PER_RADIAN};lt.convertLongitudeRange=function(e){let t=lt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};lt.clampToLatitudeRange=function(e){return lt.clamp(e,-1*lt.PI_OVER_TWO,lt.PI_OVER_TWO)};lt.negativePiToPi=function(e){return e>=-lt.PI&&e<=lt.PI?e:lt.zeroToTwoPi(e+lt.PI)-lt.PI};lt.zeroToTwoPi=function(e){if(e>=0&&e<=lt.TWO_PI)return e;let t=lt.mod(e,lt.TWO_PI);return Math.abs(t)<lt.EPSILON14&&Math.abs(e)>lt.EPSILON14?lt.TWO_PI:t};lt.mod=function(e,t){return lt.sign(e)===lt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};lt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};lt.lessThan=function(e,t,n){return e-t<-n};lt.lessThanOrEquals=function(e,t,n){return e-t<n};lt.greaterThan=function(e,t,n){return e-t>n};lt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var S3=[1];lt.factorial=function(e){let t=S3.length;if(e>=t){let n=S3[t-1];for(let i=t;i<=e;i++){let r=n*i;S3.push(r),n=r}}return S3[e]};lt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};lt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};lt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};lt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};lt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var EJ=new wG.default;lt.setRandomNumberSeed=function(e){EJ=new wG.default(e)};lt.nextRandomNumber=function(){return EJ.random()};lt.randomBetween=function(e,t){return lt.nextRandomNumber()*(t-e)+e};lt.acosClamped=function(e){return Math.acos(lt.clamp(e,-1,1))};lt.asinClamped=function(e){return Math.asin(lt.clamp(e,-1,1))};lt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};lt.logBase=function(e,t){return Math.log(e)/Math.log(t)};lt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});lt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});lt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};lt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};lt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=lt.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?lt.PI_OVER_TWO-i:i,i=e<0?lt.PI-i:i,i=t<0?-i:i,i};var D=lt;function Rt(e,t){this.x=y(e,0),this.y=y(t,0)}Rt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Rt(e,t)};Rt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Rt(e.x,e.y)};Rt.fromCartesian3=Rt.clone;Rt.fromCartesian4=Rt.clone;Rt.packedLength=2;Rt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Rt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Rt),n.x=e[t++],n.y=e[t],n};Rt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Rt.pack(e[r],t,r*2);return t};Rt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let r=i/2;t[r]=Rt.unpack(e,i,t[r])}return t};Rt.fromArray=Rt.unpack;Rt.maximumComponent=function(e){return Math.max(e.x,e.y)};Rt.minimumComponent=function(e){return Math.min(e.x,e.y)};Rt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Rt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Rt.clamp=function(e,t,n,i){let r=D.clamp(e.x,t.x,n.x),o=D.clamp(e.y,t.y,n.y);return i.x=r,i.y=o,i};Rt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Rt.magnitude=function(e){return Math.sqrt(Rt.magnitudeSquared(e))};var v3=new Rt;Rt.distance=function(e,t){return Rt.subtract(e,t,v3),Rt.magnitude(v3)};Rt.distanceSquared=function(e,t){return Rt.subtract(e,t,v3),Rt.magnitudeSquared(v3)};Rt.normalize=function(e,t){let n=Rt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Rt.dot=function(e,t){return e.x*t.x+e.y*t.y};Rt.cross=function(e,t){return e.x*t.y-e.y*t.x};Rt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Rt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Rt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Rt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Rt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Rt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Rt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Rt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var SJ=new Rt;Rt.lerp=function(e,t,n,i){return Rt.multiplyByScalar(t,n,SJ),i=Rt.multiplyByScalar(e,1-n,i),Rt.add(SJ,i,i)};var vJ=new Rt,wJ=new Rt;Rt.angleBetween=function(e,t){return Rt.normalize(e,vJ),Rt.normalize(t,wJ),D.acosClamped(Rt.dot(vJ,wJ))};var WCe=new Rt;Rt.mostOrthogonalAxis=function(e,t){let n=Rt.normalize(e,WCe);return Rt.abs(n,n),n.x<=n.y?t=Rt.clone(Rt.UNIT_X,t):t=Rt.clone(Rt.UNIT_Y,t),t};Rt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Rt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Rt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)};Rt.ZERO=Object.freeze(new Rt(0,0));Rt.ONE=Object.freeze(new Rt(1,1));Rt.UNIT_X=Object.freeze(new Rt(1,0));Rt.UNIT_Y=Object.freeze(new Rt(0,1));Rt.prototype.clone=function(e){return Rt.clone(this,e)};Rt.prototype.equals=function(e){return Rt.equals(this,e)};Rt.prototype.equalsEpsilon=function(e,t,n){return Rt.equalsEpsilon(this,e,t,n)};Rt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var H=Rt;function Qe(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}Qe.fromSpherical=function(e,t){l(t)||(t=new Qe);let n=e.clock,i=e.cone,r=y(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t};Qe.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Qe(e,t,n)};Qe.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Qe(e.x,e.y,e.z)};Qe.fromCartesian4=Qe.clone;Qe.packedLength=3;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Qe.pack(e[r],t,r*3);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let r=i/3;t[r]=Qe.unpack(e,i,t[r])}return t};Qe.fromArray=Qe.unpack;Qe.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Qe.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Qe.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Qe.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Qe.clamp=function(e,t,n,i){let r=D.clamp(e.x,t.x,n.x),o=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z);return i.x=r,i.y=o,i.z=s,i};Qe.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Qe.magnitude=function(e){return Math.sqrt(Qe.magnitudeSquared(e))};var I3=new Qe;Qe.distance=function(e,t){return Qe.subtract(e,t,I3),Qe.magnitude(I3)};Qe.distanceSquared=function(e,t){return Qe.subtract(e,t,I3),Qe.magnitudeSquared(I3)};Qe.normalize=function(e,t){let n=Qe.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Qe.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Qe.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Qe.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Qe.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Qe.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Qe.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Qe.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Qe.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Qe.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var IJ=new Qe;Qe.lerp=function(e,t,n,i){return Qe.multiplyByScalar(t,n,IJ),i=Qe.multiplyByScalar(e,1-n,i),Qe.add(IJ,i,i)};var w3=new Qe,IG=new Qe;Qe.angleBetween=function(e,t){Qe.normalize(e,w3),Qe.normalize(t,IG);let n=Qe.dot(w3,IG),i=Qe.magnitude(Qe.cross(w3,IG,w3));return Math.atan2(i,n)};var jCe=new Qe;Qe.mostOrthogonalAxis=function(e,t){let n=Qe.normalize(e,jCe);return Qe.abs(n,n),n.x<=n.y?n.x<=n.z?t=Qe.clone(Qe.UNIT_X,t):t=Qe.clone(Qe.UNIT_Z,t):n.y<=n.z?t=Qe.clone(Qe.UNIT_Y,t):t=Qe.clone(Qe.UNIT_Z,t),t};Qe.projectVector=function(e,t,n){let i=Qe.dot(e,t)/Qe.dot(t,t);return Qe.multiplyByScalar(t,i,n)};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Qe.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Qe.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)};Qe.cross=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=t.x,a=t.y,c=t.z,u=r*c-o*a,f=o*s-i*c,d=i*a-r*s;return n.x=u,n.y=f,n.z=d,n};Qe.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Qe.fromDegrees=function(e,t,n,i,r){return e=D.toRadians(e),t=D.toRadians(t),Qe.fromRadians(e,t,n,i,r)};var ju=new Qe,$C=new Qe,qCe=new Qe(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Qe.fromRadians=function(e,t,n,i,r){n=y(n,0);let o=l(i)?i.radiiSquared:qCe,s=Math.cos(t);ju.x=s*Math.cos(e),ju.y=s*Math.sin(e),ju.z=Math.sin(t),ju=Qe.normalize(ju,ju),Qe.multiplyComponents(o,ju,$C);let a=Math.sqrt(Qe.dot(ju,$C));return $C=Qe.divideByScalar($C,a,$C),ju=Qe.multiplyByScalar(ju,n,ju),l(r)||(r=new Qe),Qe.add($C,ju,r)};Qe.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Qe.fromDegrees(o,s,0,t,n[a])}return n};Qe.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Qe.fromRadians(o,s,0,t,n[a])}return n};Qe.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Qe.fromDegrees(o,s,a,t,n[c])}return n};Qe.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Qe.fromRadians(o,s,a,t,n[c])}return n};Qe.ZERO=Object.freeze(new Qe(0,0,0));Qe.ONE=Object.freeze(new Qe(1,1,1));Qe.UNIT_X=Object.freeze(new Qe(1,0,0));Qe.UNIT_Y=Object.freeze(new Qe(0,1,0));Qe.UNIT_Z=Object.freeze(new Qe(0,0,1));Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.prototype.equalsEpsilon=function(e,t,n){return Qe.equalsEpsilon(this,e,t,n)};Qe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=Qe;var YCe=new m,XCe=new m;function KCe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,h=d+p+g,x=Math.sqrt(1/h),b=m.multiplyByScalar(e,x,YCe);if(h<i)return isFinite(x)?m.clone(b,r):void 0;let C=n.x,A=n.y,T=n.z,S=XCe;S.x=b.x*C*2,S.y=b.y*A*2,S.z=b.z*T*2;let v=(1-x)*m.magnitude(e)/(.5*m.magnitude(S)),I=0,O,R,L,N,_,E,w,P,M,B,V;do{v-=I,L=1/(1+v*C),N=1/(1+v*A),_=1/(1+v*T),E=L*L,w=N*N,P=_*_,M=E*L,B=w*N,V=P*_,O=d*E+p*w+g*P-1,R=d*M*C+p*B*A+g*V*T;let U=-2*R;I=O/U}while(Math.abs(O)>D.EPSILON12);return l(r)?(r.x=o*L,r.y=s*N,r.z=a*_,r):new m(o*L,s*N,a*_)}var A0=KCe;function Zo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Zo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Zo(e,t,n)};Zo.fromDegrees=function(e,t,n,i){return e=D.toRadians(e),t=D.toRadians(t),Zo.fromRadians(e,t,n,i)};var JCe=new m,ZCe=new m,$Ce=new m,QCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),eTe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),tTe=D.EPSILON1;Zo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:QCe,r=l(t)?t.oneOverRadiiSquared:eTe,o=l(t)?t._centerToleranceSquared:tTe,s=A0(e,i,r,o,ZCe);if(!l(s))return;let a=m.multiplyComponents(s,r,JCe);a=m.normalize(a,a);let c=m.subtract(e,s,$Ce),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=D.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Zo(u,f,d)};Zo.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Zo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Zo(e.longitude,e.latitude,e.height)};Zo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Zo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Zo.ZERO=Object.freeze(new Zo(0,0,0));Zo.prototype.clone=function(e){return Zo.clone(this,e)};Zo.prototype.equals=function(e){return Zo.equals(this,e)};Zo.prototype.equalsEpsilon=function(e,t){return Zo.equalsEpsilon(this,e,t)};Zo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=Zo;function DJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function nr(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,DJ(this,e,t,n)}Object.defineProperties(nr.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});nr.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new nr(n.x,n.y,n.z)};nr.fromCartesian3=function(e,t){return l(t)||(t=new nr),l(e)&&DJ(t,e.x,e.y,e.z),t};nr.WGS84=Object.freeze(new nr(6378137,6378137,6356752314245179e-9));nr.UNIT_SPHERE=Object.freeze(new nr(1,1,1));nr.MOON=Object.freeze(new nr(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));nr.prototype.clone=function(e){return nr.clone(this,e)};nr.packedLength=m.packedLength;nr.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};nr.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return nr.fromCartesian3(i,n)};nr.prototype.geocentricSurfaceNormal=m.normalize;nr.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),s=r*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=o,t.y=s,t.z=a,m.normalize(t,t)};nr.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,D.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var nTe=new m,iTe=new m;nr.prototype.cartographicToCartesian=function(e,t){let n=nTe,i=iTe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let r=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,r,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};nr.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var rTe=new m,oTe=new m,sTe=new m;nr.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,oTe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,rTe),r=m.subtract(e,n,sTe),o=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=D.sign(m.dot(r,e))*m.magnitude(r);return l(t)?(t.longitude=o,t.latitude=s,t.height=a,t):new me(o,s,a)};nr.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};nr.prototype.scaleToGeodeticSurface=function(e,t){return A0(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};nr.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,r=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return m.multiplyByScalar(e,s,t)};nr.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};nr.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};nr.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};nr.prototype.toString=function(){return this._radii.toString()};nr.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var aTe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],cTe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function PJ(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*aTe[s];o+=cTe[s]*(n(i+a)+n(i-a))}return o*=r,o}nr.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,r=e.north;for(;n<t;)n+=D.TWO_PI;let o=this._radiiSquared,s=o.x,a=o.y,c=o.z,u=s*a;return PJ(i,r,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*PJ(t,n,function(g){let h=Math.cos(g),x=Math.sin(g);return Math.sqrt(u*p*p+c*(a*h*h+s*x*x)*d*d)})})};var re=nr;function P3(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(P3.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});P3.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=e.latitude*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};P3.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=e.y*n,o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new me(i,r,o)};var Pi=P3;var lTe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},en=Object.freeze(lTe);function zn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(zn.prototype,{width:{get:function(){return zn.computeWidth(this)}},height:{get:function(){return zn.computeHeight(this)}}});zn.packedLength=4;zn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};zn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new zn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};zn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=D.TWO_PI),t-n};zn.computeHeight=function(e){return e.north-e.south};zn.fromDegrees=function(e,t,n,i,r){return e=D.toRadians(y(e,0)),t=D.toRadians(y(t,0)),n=D.toRadians(y(n,0)),i=D.toRadians(y(i,0)),l(r)?(r.west=e,r.south=t,r.east=n,r.north=i,r):new zn(e,t,n,i)};zn.fromRadians=function(e,t,n,i,r){return l(r)?(r.west=y(e,0),r.south=y(t,0),r.east=y(n,0),r.north=y(i,0),r):new zn(e,t,n,i)};zn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+D.TWO_PI;r=Math.min(r,d),o=Math.max(o,d)}return i-n>o-r&&(n=r,i=o,i>D.PI&&(i=i-D.TWO_PI),n>D.PI&&(n=n-D.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new zn(n,s,i,a)};zn.fromCartesianArray=function(e,t,n){t=y(t,re.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>D.PI&&(r=r-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new zn(i,a,r,c)};zn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new zn(e.west,e.south,e.east,e.north)};zn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};zn.prototype.clone=function(e){return zn.clone(this,e)};zn.prototype.equals=function(e){return zn.equals(this,e)};zn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};zn.prototype.equalsEpsilon=function(e,t){return zn.equalsEpsilon(this,e,t)};zn.validate=function(e){};zn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};zn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};zn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};zn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};zn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=D.TWO_PI);let r=D.negativePiToPi((i+n)*.5),o=(e.south+e.north)*.5;return l(t)?(t.longitude=r,t.latitude=o,t.height=0,t):new me(r,o)};zn.intersection=function(e,t,n){let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=D.TWO_PI:o<s&&i>0&&(o+=D.TWO_PI),i<r&&s<0?s+=D.TWO_PI:o<s&&r<0&&(r+=D.TWO_PI);let a=D.negativePiToPi(Math.max(r,s)),c=D.negativePiToPi(Math.min(i,o));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new zn(a,u,c,f)};zn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(r>=s||i>=o))return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new zn(i,r,o,s)};zn.union=function(e,t,n){l(n)||(n=new zn);let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=D.TWO_PI:o<s&&i>0&&(o+=D.TWO_PI),i<r&&s<0?s+=D.TWO_PI:o<s&&r<0&&(r+=D.TWO_PI);let a=D.negativePiToPi(Math.min(r,s)),c=D.negativePiToPi(Math.max(i,o));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};zn.expand=function(e,t,n){return l(n)||(n=new zn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};zn.contains=function(e,t){let n=t.longitude,i=t.latitude,r=e.west,o=e.east;return o<r&&(o+=D.TWO_PI,n<0&&(n+=D.TWO_PI)),(n>r||D.equalsEpsilon(n,r,D.EPSILON14))&&(n<o||D.equalsEpsilon(n,o,D.EPSILON14))&&i>=e.south&&i<=e.north};var uTe=new me;zn.subsample=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,0),l(i)||(i=[]);let r=0,o=e.north,s=e.south,a=e.east,c=e.west,u=uTe;u.height=n,u.longitude=c,u.latitude=o,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.latitude=s,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,o<0?u.latitude=o:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*D.PI_OVER_TWO,zn.contains(e,u)&&(i[r]=t.cartographicToCartesian(u,i[r]),r++);return u.latitude===0&&(u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++),i.length=r,i};zn.subsection=function(e,t,n,i,r,o){if(l(o)||(o=new zn),e.west<=e.east){let a=e.east-e.west;o.west=e.west+t*a,o.east=e.west+i*a}else{let a=D.TWO_PI+e.east-e.west;o.west=D.negativePiToPi(e.west+t*a),o.east=D.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return o.south=e.south+n*s,o.north=e.south+r*s,t===1&&(o.west=e.east),i===1&&(o.east=e.east),n===1&&(o.south=e.north),r===1&&(o.north=e.north),o};zn.MAX_VALUE=Object.freeze(new zn(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ce=zn;function Eo(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Eo.packedLength=4;Eo.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Eo.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Eo),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Eo.fromPoints=function(e,t){if(l(t)||(t=new Eo),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var fTe=new Pi,dTe=new me,mTe=new me;Eo.fromRectangle=function(e,t,n){if(l(n)||(n=new Eo),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=y(t,fTe);let i=t.project(ce.southwest(e,dTe)),r=t.project(ce.northeast(e,mTe));return H.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};Eo.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Eo(e.x,e.y,e.width,e.height)};Eo.union=function(e,t,n){l(n)||(n=new Eo);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};Eo.expand=function(e,t,n){n=Eo.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Eo.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?en.OUTSIDE:en.INTERSECTING};Eo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Eo.prototype.clone=function(e){return Eo.clone(this,e)};Eo.prototype.intersect=function(e){return Eo.intersect(this,e)};Eo.prototype.equals=function(e){return Eo.equals(this,e)};var Ye=Eo;var eg,So={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},sl={};Object.defineProperties(sl,{element:{get:function(){if(sl.supportsFullscreen())return document[So.fullscreenElement]}},changeEventName:{get:function(){if(sl.supportsFullscreen())return So.fullscreenchange}},errorEventName:{get:function(){if(sl.supportsFullscreen())return So.fullscreenerror}},enabled:{get:function(){if(sl.supportsFullscreen())return document[So.fullscreenEnabled]}},fullscreen:{get:function(){if(sl.supportsFullscreen())return sl.element!==null}}});sl.supportsFullscreen=function(){if(l(eg))return eg;eg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return So.requestFullscreen="requestFullscreen",So.exitFullscreen="exitFullscreen",So.fullscreenEnabled="fullscreenEnabled",So.fullscreenElement="fullscreenElement",So.fullscreenchange="fullscreenchange",So.fullscreenerror="fullscreenerror",eg=!0,eg;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(So.requestFullscreen=n,eg=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(So.requestFullscreen=n,eg=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?So.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(So.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?So.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(So.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?So.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(So.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),So.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),So.fullscreenerror=n)}return eg};sl.requestFullscreen=function(e,t){sl.supportsFullscreen()&&e[So.requestFullscreen]({vrDisplay:t})};sl.exitFullscreen=function(){sl.supportsFullscreen()&&document[So.exitFullscreen]()};sl._names=So;var _o=sl;var Fa;typeof navigator<"u"?Fa=navigator:Fa={};function E0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var D3,RJ;function LG(){if(!l(D3)&&(D3=!1,!F3())){let e=/ Chrome\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(D3=!0,RJ=E0(e[1]))}return D3}function hTe(){return LG()&&RJ}var R3,OJ;function MJ(){if(!l(R3)&&(R3=!1,!LG()&&!F3()&&/ Safari\/[\.0-9]+/.test(Fa.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(R3=!0,OJ=E0(e[1]))}return R3}function pTe(){return MJ()&&OJ}var O3,OG;function LJ(){if(!l(O3)){O3=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Fa.userAgent);e!==null&&(O3=!0,OG=E0(e[1]),OG.isNightly=!!e[2])}return O3}function _Te(){return LJ()&&OG}var mv,MG;function NJ(){if(!l(mv)){mv=!1;let e;Fa.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Fa.userAgent),e!==null&&(mv=!0,MG=E0(e[1]))):Fa.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Fa.userAgent),e!==null&&(mv=!0,MG=E0(e[1])))}return mv}function gTe(){return NJ()&&MG}var M3,FJ;function F3(){if(!l(M3)){M3=!1;let e=/ Edg\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(M3=!0,FJ=E0(e[1]))}return M3}function yTe(){return F3()&&FJ}var L3,BJ;function NG(){if(!l(L3)){L3=!1;let e=/Firefox\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(L3=!0,BJ=E0(e[1]))}return L3}var PG;function xTe(){return l(PG)||(PG=/Windows/i.test(Fa.appVersion)),PG}var DG;function bTe(){return l(DG)||(DG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),DG}function CTe(){return NG()&&BJ}var RG;function TTe(){return l(RG)||(RG=!NG()&&typeof PointerEvent<"u"&&(!l(Fa.pointerEnabled)||Fa.pointerEnabled)),RG}var kJ,N3;function UJ(){if(!l(N3)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;N3=l(t)&&t!=="",N3&&(kJ=t)}return N3}function ATe(){return UJ()?kJ:void 0}function Tc(){return Tc._result}Tc._promise=void 0;Tc._result=void 0;Tc.initialize=function(){return l(Tc._promise)||(Tc._promise=new Promise(e=>{let t=new Image;t.onload=function(){Tc._result=t.width>0&&t.height>0,e(Tc._result)},t.onerror=function(){Tc._result=!1,e(Tc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Tc._promise};Object.defineProperties(Tc,{initialized:{get:function(){return l(Tc._result)}}});var QC=[];typeof ArrayBuffer<"u"&&(QC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&QC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&QC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&QC.push(BigInt64Array),typeof BigUint64Array<"u"&&QC.push(BigUint64Array));var id={isChrome:LG,chromeVersion:hTe,isSafari:MJ,safariVersion:pTe,isWebkit:LJ,webkitVersion:_Te,isInternetExplorer:NJ,internetExplorerVersion:gTe,isEdge:F3,edgeVersion:yTe,isFirefox:NG,firefoxVersion:CTe,isWindows:xTe,isIPadOrIOS:bTe,hardwareConcurrency:y(Fa.hardwareConcurrency,3),supportsPointerEvents:TTe,supportsImageRenderingPixelated:UJ,supportsWebP:Tc,imageRenderingValue:ATe,typedArrayTypes:QC};id.supportsBasis=function(e){return id.supportsWebAssembly()&&e.context.supportsBasis};id.supportsFullscreen=function(){return _o.supportsFullscreen()};id.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};id.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};id.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};id.supportsBigInt=function(){return typeof BigInt<"u"};id.supportsWebWorkers=function(){return typeof Worker<"u"};id.supportsWebAssembly=function(){return typeof WebAssembly<"u"};id.supportsWebgl2=function(e){return e.context.webgl2};var Wt=id;function FG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,r){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var BG,kG,Xh;Wt.supportsTypedArrays()&&(BG=new ArrayBuffer(4),kG=new Uint32Array(BG),Xh=new Uint8Array(BG));ie.fromRgba=function(e,t){return kG[0]=e,ie.fromBytes(Xh[0],Xh[1],Xh[2],Xh[3],t)};ie.fromHsl=function(e,t,n,i,r){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let o=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;o=FG(u,c,e+1/3),s=FG(u,c,e),a=FG(u,c,e-1/3)}return l(r)?(r.red=o,r.green=s,r.blue=a,r.alpha=i,r):new ie(o,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+D.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+D.nextRandomNumber()*(a-s)}let r=e.blue;if(!l(r)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);r=s+D.nextRandomNumber()*(a-s)}let o=e.alpha;if(!l(o)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);o=s+D.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new ie(n,i,r,o)};var ETe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,STe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,vTe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,wTe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=ETe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=STe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=vTe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=wTe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),r=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]};ie.prototype.toRgba=function(){return Xh[0]=ie.floatToByte(this.red),Xh[1]=ie.floatToByte(this.green),Xh[2]=ie.floatToByte(this.blue),Xh[3]=ie.floatToByte(this.alpha),kG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=D.lerp(e.red,t.red,n),i.green=D.lerp(e.green,t.green,n),i.blue=D.lerp(e.blue,t.blue,n),i.alpha=D.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function ITe(){return!0}function PTe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=ITe}var ue=PTe;function Yl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Yl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Yl.packedLength=2;Yl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Yl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Yl),n.near=e[t++],n.far=e[t],n};Yl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Yl.clone=function(e,t){if(l(e))return l(t)||(t=new Yl),t.near=e.near,t.far=e.far,t};Yl.prototype.clone=function(e){return Yl.clone(this,e)};Yl.prototype.equals=function(e){return Yl.equals(this,e)};var It=Yl;function qu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}qu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new qu(e.near,e.nearValue,e.far,e.farValue)};qu.packedLength=4;qu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};qu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new qu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};qu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};qu.prototype.clone=function(e){return qu.clone(this,e)};qu.prototype.equals=function(e){return qu.equals(this,e)};var Ot=qu;var DTe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},We=Object.freeze(DTe);var RTe={CENTER:0,LEFT:1,RIGHT:-1},yi=Object.freeze(RTe);var OTe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Rn=Object.freeze(OTe);var MTe={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(MTe);function rd(){fe.throwInstantiationError()}Object.defineProperties(rd.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});rd.prototype.getValue=fe.throwInstantiationError;rd.prototype.equals=fe.throwInstantiationError;rd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};rd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!rd.equals(e[i],t[i]))return!1;return!0};rd.isConstant=function(e){return!l(e)||e.isConstant};rd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};rd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};rd.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var q=rd;var LTe=z.WHITE,NTe=m.ZERO,FTe=We.NONE,BTe=H.ZERO,kTe=1,UTe=0,VTe=m.ZERO,zTe=yi.CENTER,HTe=Rn.CENTER,GTe=!1,WTe=new m,jTe=new z,qTe=new m,YTe=new H,XTe=new Ot,KTe=new Ot,JTe=new Ot,ZTe=new Ye,$Te=new It;function VJ(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function tg(e,t){t.collectionChanged.addEventListener(tg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}tg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,WTe),c=q.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){UG(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u),u.show=f,(!l(u.image)||o.textureValue!==c)&&(u.image=c,o.textureValue=c),u.position=d,u.color=q.getValueOrDefault(a._color,e,LTe,jTe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,NTe,qTe),u.heightReference=q.getValueOrDefault(a._heightReference,e,FTe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,BTe,YTe),u.scale=q.getValueOrDefault(a._scale,e,kTe),u.rotation=q.getValueOrDefault(a._rotation,e,UTe),u.alignedAxis=q.getValueOrDefault(a._alignedAxis,e,VTe),u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,zTe),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,HTe),u.width=q.getValueOrUndefined(a._width,e),u.height=q.getValueOrUndefined(a._height,e),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,XTe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,KTe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,JTe),u.sizeInMeters=q.getValueOrDefault(a._sizeInMeters,e,GTe),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,$Te),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e);let p=q.getValueOrUndefined(a._imageSubRegion,e,ZTe);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};tg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};tg.prototype.isDestroyed=function(){return!1};tg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(tg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};tg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new VJ(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new VJ(o)):(UG(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],UG(s.get(o.id),o,a),s.remove(o.id)};function UG(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var hv=tg;function QTe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Ac=QTe;function et(e,t,n,i,r,o,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(o,0),this[8]=y(c,0)}et.packedLength=9;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};et.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)et.pack(e[r],t,r*9);return t};et.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let r=i/9;t[r]=et.unpack(e,i,t[r])}return t};et.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new et(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return et.clone(e,t)};et.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new et(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};et.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,r=e.x*e.z,o=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),h=2*(r+c),x=2*(i+f),b=-n+s-u+d,C=2*(a-o),A=2*(r-c),T=2*(a+o),S=-n-s+u+d;return l(t)?(t[0]=p,t[1]=x,t[2]=A,t[3]=g,t[4]=b,t[5]=T,t[6]=h,t[7]=C,t[8]=S,t):new et(p,g,h,x,b,C,A,T,S)};et.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),r=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-r*s+a*o*i,f=a*s+r*o*i,d=n*s,p=r*i+a*o*s,g=-a*i+r*o*s,h=-o,x=a*n,b=r*n;return l(t)?(t[0]=c,t[1]=d,t[2]=h,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=g,t[8]=b,t):new et(c,u,f,d,p,g,h,x,b)};et.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new et(e.x,0,0,0,e.y,0,0,0,e.z)};et.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new et(e,0,0,0,e,0,0,0,e)};et.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new et(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};et.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new et(1,0,0,0,n,-i,0,i,n)};et.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new et(n,0,i,0,1,0,-i,0,n)};et.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new et(n,-i,0,i,n,0,0,0,1)};et.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};et.getElementIndex=function(e,t){return e*3+t};et.getColumn=function(e,t,n){let i=t*3,r=e[i],o=e[i+1],s=e[i+2];return n.x=r,n.y=o,n.z=s,n};et.setColumn=function(e,t,n,i){i=et.clone(e,i);let r=t*3;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i};et.getRow=function(e,t,n){let i=e[t],r=e[t+3],o=e[t+6];return n.x=i,n.y=r,n.z=o,n};et.setRow=function(e,t,n,i){return i=et.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var eAe=new m;et.setScale=function(e,t,n){let i=et.getScale(e,eAe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var tAe=new m;et.setUniformScale=function(e,t,n){let i=et.getScale(e,tAe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var VG=new m;et.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],VG)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],VG)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],VG)),t};var zJ=new m;et.getMaximumScale=function(e){return et.getScale(e,zJ),m.maximumComponent(zJ)};var nAe=new m;et.setRotation=function(e,t,n){let i=et.getScale(e,nAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var iAe=new m;et.getRotation=function(e,t){let n=et.getScale(e,iAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};et.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};et.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};et.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};et.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[3]*r+e[6]*o,a=e[1]*i+e[4]*r+e[7]*o,c=e[2]*i+e[5]*r+e[8]*o;return n.x=s,n.y=a,n.z=c,n};et.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};et.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};et.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};et.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};et.transpose=function(e,t){let n=e[0],i=e[3],r=e[6],o=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function rAe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var zG=[1,0,0],HG=[2,2,1];function oAe(e){let t=0;for(let n=0;n<3;++n){let i=e[et.getElementIndex(HG[n],zG[n])];t+=2*i*i}return Math.sqrt(t)}function sAe(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[et.getElementIndex(HG[u],zG[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=zG[r],c=HG[r];if(Math.abs(e[et.getElementIndex(c,a)])>n){let u=e[et.getElementIndex(c,c)],f=e[et.getElementIndex(a,a)],d=e[et.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=et.clone(et.IDENTITY,t),t[et.getElementIndex(a,a)]=t[et.getElementIndex(c,c)]=o,t[et.getElementIndex(c,a)]=s,t[et.getElementIndex(a,c)]=-s,t}var B3=new et,HJ=new et;et.computeEigenDecomposition=function(e,t){let n=D.EPSILON20,i=10,r=0,o=0;l(t)||(t={});let s=t.unitary=et.clone(et.IDENTITY,t.unitary),a=t.diagonal=et.clone(e,t.diagonal),c=n*rAe(a);for(;o<i&&oAe(a)>c;)sAe(a,B3),et.transpose(B3,HJ),et.multiply(a,B3,a),et.multiply(HJ,a,a),et.multiply(s,B3,s),++r>2&&(++o,r=0);return t};et.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};et.determinant=function(e){let t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(o*u-c*s)+r*(c*i-n*u)+a*(n*s-o*i)};et.inverse=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=et.determinant(e);t[0]=s*f-u*a,t[1]=u*r-i*f,t[2]=i*a-s*r,t[3]=c*a-o*f,t[4]=n*f-c*r,t[5]=o*r-n*a,t[6]=o*u-c*s,t[7]=c*i-n*u,t[8]=n*s-o*i;let p=1/d;return et.multiplyByScalar(t,p,t)};var aAe=new et;et.inverseTranspose=function(e,t){return et.inverse(et.transpose(e,aAe),t)};et.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};et.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};et.IDENTITY=Object.freeze(new et(1,0,0,0,1,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN1ROW0=3;et.COLUMN1ROW1=4;et.COLUMN1ROW2=5;et.COLUMN2ROW0=6;et.COLUMN2ROW1=7;et.COLUMN2ROW2=8;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var Q=$e;function sv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}u(Object.create)&&(sv.prototype=Object.create(Error.prototype),sv.prototype.constructor=sv);sv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return u(this.stack)&&(e+=` -${this.stack.toString()}`),e};var de=sv;function Ze(e,t,n,i,r,o,s,a,c,l,f,d,p,g,h,A){this[0]=y(e,0),this[1]=y(r,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(o,0),this[6]=y(l,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(A,0)}Ze.packedLength=16;Ze.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Ze.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Ze),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Ze.packArray=function(e,t){let n=e.length,i=n*16;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Ze.pack(e[r],t,r*16);return t};Ze.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let r=i/16;t[r]=Ze.unpack(e,i,t[r])}return t};Ze.clone=function(e,t){if(u(e))return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Ze(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Ze.fromArray=Ze.unpack;Ze.fromColumnMajorArray=function(e,t){return Ze.clone(e,t)};Ze.fromRowMajorArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Ze(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Ze.fromRotationTranslation=function(e,t,n){return t=y(t,m.ZERO),u(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Ze(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Ze.fromTranslationQuaternionRotationScale=function(e,t,n,i){u(i)||(i=new Ze);let r=n.x,o=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,l=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,h=t.z*t.z,A=t.z*t.w,x=t.w*t.w,C=a-d-h+x,T=2*(c-A),E=2*(l+g),S=2*(c+A),w=-a+d-h+x,D=2*(p-f),M=2*(l-g),O=2*(p+f),B=-a-d+h+x;return i[0]=C*r,i[1]=S*r,i[2]=M*r,i[3]=0,i[4]=T*o,i[5]=w*o,i[6]=O*o,i[7]=0,i[8]=E*s,i[9]=D*s,i[10]=B*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Ze.fromTranslationRotationScale=function(e,t){return Ze.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Ze.fromTranslation=function(e,t){return Ze.fromRotationTranslation(Q.IDENTITY,e,t)};Ze.fromScale=function(e,t){return u(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Ze(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Ze.fromUniformScale=function(e,t){return u(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Ze(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Ze.fromRotation=function(e,t){return u(t)||(t=new Ze),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var JC=new m,ZC=new m,av=new m;Ze.fromCamera=function(e,t){let n=e.position,i=e.direction,r=e.up;m.normalize(i,JC),m.normalize(m.cross(JC,r,ZC),ZC),m.normalize(m.cross(ZC,JC,av),av);let o=ZC.x,s=ZC.y,a=ZC.z,c=JC.x,l=JC.y,f=JC.z,d=av.x,p=av.y,g=av.z,h=n.x,A=n.y,x=n.z,C=o*-h+s*-A+a*-x,T=d*-h+p*-A+g*-x,E=c*h+l*A+f*x;return u(t)?(t[0]=o,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-l,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=C,t[13]=T,t[14]=E,t[15]=1,t):new Ze(o,s,a,C,d,p,g,T,-c,-l,-f,E,0,0,0,1)};Ze.computePerspectiveFieldOfView=function(e,t,n,i,r){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),l=2*i*n/(n-i);return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=-1,r[12]=0,r[13]=0,r[14]=l,r[15]=0,r};Ze.computeOrthographicOffCenter=function(e,t,n,i,r,o,s){let a=1/(t-e),c=1/(i-n),l=1/(o-r),f=-(t+e)*a,d=-(i+n)*c,p=-(o+r)*l;return a*=2,c*=2,l*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=l,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};Ze.computePerspectiveOffCenter=function(e,t,n,i,r,o,s){let a=2*r/(t-e),c=2*r/(i-n),l=(t+e)/(t-e),f=(i+n)/(i-n),d=-(o+r)/(o-r),p=-1,g=-2*o*r/(o-r);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=l,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};Ze.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,o){let s=2*r/(t-e),a=2*r/(i-n),c=(t+e)/(t-e),l=(i+n)/(i-n),f=-1,d=-1,p=-2*r;return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=p,o[15]=0,o};Ze.computeViewportTransformation=function(e,t,n,i){u(i)||(i=new Ze),e=y(e,y.EMPTY_OBJECT);let r=y(e.x,0),o=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,l=a*.5,f=(n-t)*.5,d=c,p=l,g=f,h=r+c,A=o+l,x=t+f,C=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=h,i[13]=A,i[14]=x,i[15]=C,i};Ze.computeView=function(e,t,n,i,r){return r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-m.dot(i,e),r[13]=-m.dot(n,e),r[14]=m.dot(t,e),r[15]=1,r};Ze.toArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Ze.getElementIndex=function(e,t){return e*4+t};Ze.getColumn=function(e,t,n){let i=t*4,r=e[i],o=e[i+1],s=e[i+2],a=e[i+3];return n.x=r,n.y=o,n.z=s,n.w=a,n};Ze.setColumn=function(e,t,n,i){i=Ze.clone(e,i);let r=t*4;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i};Ze.getRow=function(e,t,n){let i=e[t],r=e[t+4],o=e[t+8],s=e[t+12];return n.x=i,n.y=r,n.z=o,n.w=s,n};Ze.setRow=function(e,t,n,i){return i=Ze.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Ze.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var gCe=new m;Ze.setScale=function(e,t,n){let i=Ze.getScale(e,gCe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var yCe=new m;Ze.setUniformScale=function(e,t,n){let i=Ze.getScale(e,yCe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var yG=new m;Ze.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],yG)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],yG)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],yG)),t};var xJ=new m;Ze.getMaximumScale=function(e){return Ze.getScale(e,xJ),m.maximumComponent(xJ)};var ACe=new m;Ze.setRotation=function(e,t,n){let i=Ze.getScale(e,ACe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var xCe=new m;Ze.getRotation=function(e,t){let n=Ze.getScale(e,xCe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Ze.multiply=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],f=e[7],d=e[8],p=e[9],g=e[10],h=e[11],A=e[12],x=e[13],C=e[14],T=e[15],E=t[0],S=t[1],w=t[2],D=t[3],M=t[4],O=t[5],B=t[6],L=t[7],_=t[8],b=t[9],v=t[10],I=t[11],R=t[12],F=t[13],k=t[14],V=t[15],G=i*E+a*S+d*w+A*D,U=r*E+c*S+p*w+x*D,Y=o*E+l*S+g*w+C*D,W=s*E+f*S+h*w+T*D,J=i*M+a*O+d*B+A*L,j=r*M+c*O+p*B+x*L,K=o*M+l*O+g*B+C*L,Z=s*M+f*O+h*B+T*L,me=i*_+a*b+d*v+A*I,ye=r*_+c*b+p*v+x*I,se=o*_+l*b+g*v+C*I,pe=s*_+f*b+h*v+T*I,Ae=i*R+a*F+d*k+A*V,De=r*R+c*F+p*k+x*V,Ce=o*R+l*F+g*k+C*V,Re=s*R+f*F+h*k+T*V;return n[0]=G,n[1]=U,n[2]=Y,n[3]=W,n[4]=J,n[5]=j,n[6]=K,n[7]=Z,n[8]=me,n[9]=ye,n[10]=se,n[11]=pe,n[12]=Ae,n[13]=De,n[14]=Ce,n[15]=Re,n};Ze.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Ze.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Ze.multiplyTransformation=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],l=e[8],f=e[9],d=e[10],p=e[12],g=e[13],h=e[14],A=t[0],x=t[1],C=t[2],T=t[4],E=t[5],S=t[6],w=t[8],D=t[9],M=t[10],O=t[12],B=t[13],L=t[14],_=i*A+s*x+l*C,b=r*A+a*x+f*C,v=o*A+c*x+d*C,I=i*T+s*E+l*S,R=r*T+a*E+f*S,F=o*T+c*E+d*S,k=i*w+s*D+l*M,V=r*w+a*D+f*M,G=o*w+c*D+d*M,U=i*O+s*B+l*L+p,Y=r*O+a*B+f*L+g,W=o*O+c*B+d*L+h;return n[0]=_,n[1]=b,n[2]=v,n[3]=0,n[4]=I,n[5]=R,n[6]=F,n[7]=0,n[8]=k,n[9]=V,n[10]=G,n[11]=0,n[12]=U,n[13]=Y,n[14]=W,n[15]=1,n};Ze.multiplyByMatrix3=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],l=e[8],f=e[9],d=e[10],p=t[0],g=t[1],h=t[2],A=t[3],x=t[4],C=t[5],T=t[6],E=t[7],S=t[8],w=i*p+s*g+l*h,D=r*p+a*g+f*h,M=o*p+c*g+d*h,O=i*A+s*x+l*C,B=r*A+a*x+f*C,L=o*A+c*x+d*C,_=i*T+s*E+l*S,b=r*T+a*E+f*S,v=o*T+c*E+d*S;return n[0]=w,n[1]=D,n[2]=M,n[3]=0,n[4]=O,n[5]=B,n[6]=L,n[7]=0,n[8]=_,n[9]=b,n[10]=v,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Ze.multiplyByTranslation=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=i*e[0]+r*e[4]+o*e[8]+e[12],a=i*e[1]+r*e[5]+o*e[9]+e[13],c=i*e[2]+r*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Ze.multiplyByScale=function(e,t,n){let i=t.x,r=t.y,o=t.z;return i===1&&r===1&&o===1?Ze.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=e[7],n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Ze.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Ze.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=t.w,a=e[0]*i+e[4]*r+e[8]*o+e[12]*s,c=e[1]*i+e[5]*r+e[9]*o+e[13]*s,l=e[2]*i+e[6]*r+e[10]*o+e[14]*s,f=e[3]*i+e[7]*r+e[11]*o+e[15]*s;return n.x=a,n.y=c,n.z=l,n.w=f,n};Ze.multiplyByPointAsVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o,a=e[1]*i+e[5]*r+e[9]*o,c=e[2]*i+e[6]*r+e[10]*o;return n.x=s,n.y=a,n.z=c,n};Ze.multiplyByPoint=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o+e[12],a=e[1]*i+e[5]*r+e[9]*o+e[13],c=e[2]*i+e[6]*r+e[10]*o+e[14];return n.x=s,n.y=a,n.z=c,n};Ze.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Ze.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Ze.transpose=function(e,t){let n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=s,t[14]=a,t[15]=e[15],t};Ze.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Ze.equals=function(e,t){return e===t||u(e)&&u(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Ze.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Ze.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Ze.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var CCe=new Q,TCe=new Q,ECe=new oe,bCe=new oe(0,0,0,1);Ze.inverse=function(e,t){let n=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],c=e[9],l=e[13],f=e[2],d=e[6],p=e[10],g=e[14],h=e[3],A=e[7],x=e[11],C=e[15],T=p*C,E=g*x,S=d*C,w=g*A,D=d*x,M=p*A,O=f*C,B=g*h,L=f*x,_=p*h,b=f*A,v=d*h,I=T*a+w*c+D*l-(E*a+S*c+M*l),R=E*s+O*c+_*l-(T*s+B*c+L*l),F=S*s+B*a+b*l-(w*s+O*a+v*l),k=M*s+L*a+v*c-(D*s+_*a+b*c),V=E*i+S*r+M*o-(T*i+w*r+D*o),G=T*n+B*r+L*o-(E*n+O*r+_*o),U=w*n+O*i+v*o-(S*n+B*i+b*o),Y=D*n+_*i+b*r-(M*n+L*i+v*r);T=r*l,E=o*c,S=i*l,w=o*a,D=i*c,M=r*a,O=n*l,B=o*s,L=n*c,_=r*s,b=n*a,v=i*s;let W=T*A+w*x+D*C-(E*A+S*x+M*C),J=E*h+O*x+_*C-(T*h+B*x+L*C),j=S*h+B*A+b*C-(w*h+O*A+v*C),K=M*h+L*A+v*x-(D*h+_*A+b*x),Z=S*p+M*g+E*d-(D*g+T*d+w*p),me=L*g+T*f+B*p-(O*p+_*g+E*f),ye=O*d+v*g+w*f-(b*g+S*f+B*d),se=b*p+D*f+_*d-(L*d+v*p+M*f),pe=n*I+i*R+r*F+o*k;if(Math.abs(pe)<P.EPSILON21){if(Q.equalsEpsilon(Ze.getMatrix3(e,CCe),TCe,P.EPSILON7)&&oe.equals(Ze.getRow(e,3,ECe),bCe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new de("matrix is not invertible because its determinate is zero.")}return pe=1/pe,t[0]=I*pe,t[1]=R*pe,t[2]=F*pe,t[3]=k*pe,t[4]=V*pe,t[5]=G*pe,t[6]=U*pe,t[7]=Y*pe,t[8]=W*pe,t[9]=J*pe,t[10]=j*pe,t[11]=K*pe,t[12]=Z*pe,t[13]=me*pe,t[14]=ye*pe,t[15]=se*pe,t};Ze.inverseTransformation=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],c=e[8],l=e[9],f=e[10],d=e[12],p=e[13],g=e[14],h=-n*d-i*p-r*g,A=-o*d-s*p-a*g,x=-c*d-l*p-f*g;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=l,t[7]=0,t[8]=r,t[9]=a,t[10]=f,t[11]=0,t[12]=h,t[13]=A,t[14]=x,t[15]=1,t};var SCe=new Ze;Ze.inverseTranspose=function(e,t){return Ze.inverse(Ze.transpose(e,SCe),t)};Ze.IDENTITY=Object.freeze(new Ze(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Ze.ZERO=Object.freeze(new Ze(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Ze.COLUMN0ROW0=0;Ze.COLUMN0ROW1=1;Ze.COLUMN0ROW2=2;Ze.COLUMN0ROW3=3;Ze.COLUMN1ROW0=4;Ze.COLUMN1ROW1=5;Ze.COLUMN1ROW2=6;Ze.COLUMN1ROW3=7;Ze.COLUMN2ROW0=8;Ze.COLUMN2ROW1=9;Ze.COLUMN2ROW2=10;Ze.COLUMN2ROW3=11;Ze.COLUMN3ROW0=12;Ze.COLUMN3ROW1=13;Ze.COLUMN3ROW2=14;Ze.COLUMN3ROW3=15;Object.defineProperties(Ze.prototype,{length:{get:function(){return Ze.packedLength}}});Ze.prototype.clone=function(e){return Ze.clone(this,e)};Ze.prototype.equals=function(e){return Ze.equals(this,e)};Ze.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Ze.prototype.equalsEpsilon=function(e,t){return Ze.equalsEpsilon(this,e,t)};Ze.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`};var $=et;function xt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}xt.fromElements=function(e,t,n,i,r){return l(r)?(r.x=e,r.y=t,r.z=n,r.w=i,r):new xt(e,t,n,i)};xt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new xt(e.red,e.green,e.blue,e.alpha)};xt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new xt(e.x,e.y,e.z,e.w)};xt.packedLength=4;xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new xt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)xt.pack(e[r],t,r*4);return t};xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=xt.unpack(e,i,t[r])}return t};xt.fromArray=xt.unpack;xt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};xt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};xt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};xt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};xt.clamp=function(e,t,n,i){let r=D.clamp(e.x,t.x,n.x),o=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z),a=D.clamp(e.w,t.w,n.w);return i.x=r,i.y=o,i.z=s,i.w=a,i};xt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};xt.magnitude=function(e){return Math.sqrt(xt.magnitudeSquared(e))};var k3=new xt;xt.distance=function(e,t){return xt.subtract(e,t,k3),xt.magnitude(k3)};xt.distanceSquared=function(e,t){return xt.subtract(e,t,k3),xt.magnitudeSquared(k3)};xt.normalize=function(e,t){let n=xt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};xt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};xt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};xt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};xt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};xt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};xt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};xt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};xt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};xt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var GJ=new xt;xt.lerp=function(e,t,n,i){return xt.multiplyByScalar(t,n,GJ),i=xt.multiplyByScalar(e,1-n,i),xt.add(GJ,i,i)};var cAe=new xt;xt.mostOrthogonalAxis=function(e,t){let n=xt.normalize(e,cAe);return xt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=xt.clone(xt.UNIT_X,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=xt.clone(xt.UNIT_Y,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t),t};xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};xt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};xt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)&&D.equalsEpsilon(e.w,t.w,n,i)};xt.ZERO=Object.freeze(new xt(0,0,0,0));xt.ONE=Object.freeze(new xt(1,1,1,1));xt.UNIT_X=Object.freeze(new xt(1,0,0,0));xt.UNIT_Y=Object.freeze(new xt(0,1,0,0));xt.UNIT_Z=Object.freeze(new xt(0,0,1,0));xt.UNIT_W=Object.freeze(new xt(0,0,0,1));xt.prototype.clone=function(e){return xt.clone(this,e)};xt.prototype.equals=function(e){return xt.equals(this,e)};xt.prototype.equalsEpsilon=function(e,t,n){return xt.equalsEpsilon(this,e,t,n)};xt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var GG=new Float32Array(1),Ba=new Uint8Array(GG.buffer),lAe=new Uint32Array([287454020]),uAe=new Uint8Array(lAe.buffer),WJ=uAe[0]===68;xt.packFloat=function(e,t){return l(t)||(t=new xt),GG[0]=e,WJ?(t.x=Ba[0],t.y=Ba[1],t.z=Ba[2],t.w=Ba[3]):(t.x=Ba[3],t.y=Ba[2],t.z=Ba[1],t.w=Ba[0]),t};xt.unpackFloat=function(e){return WJ?(Ba[0]=e.x,Ba[1]=e.y,Ba[2]=e.z,Ba[3]=e.w):(Ba[0]=e.w,Ba[1]=e.z,Ba[2]=e.y,Ba[3]=e.x),GG[0]};var oe=xt;function pv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(pv.prototype=Object.create(Error.prototype),pv.prototype.constructor=pv);pv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var de=pv;function $e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,x){this[0]=y(e,0),this[1]=y(r,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(o,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(x,0)}$e.packedLength=16;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)$e.pack(e[r],t,r*16);return t};$e.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let r=i/16;t[r]=$e.unpack(e,i,t[r])}return t};$e.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new $e(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};$e.fromArray=$e.unpack;$e.fromColumnMajorArray=function(e,t){return $e.clone(e,t)};$e.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new $e(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};$e.fromRotationTranslation=function(e,t,n){return t=y(t,m.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new $e(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};$e.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new $e);let r=n.x,o=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,h=t.z*t.z,x=t.z*t.w,b=t.w*t.w,C=a-d-h+b,A=2*(c-x),T=2*(u+g),S=2*(c+x),v=-a+d-h+b,I=2*(p-f),O=2*(u-g),R=2*(p+f),L=-a-d+h+b;return i[0]=C*r,i[1]=S*r,i[2]=O*r,i[3]=0,i[4]=A*o,i[5]=v*o,i[6]=R*o,i[7]=0,i[8]=T*s,i[9]=I*s,i[10]=L*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};$e.fromTranslationRotationScale=function(e,t){return $e.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};$e.fromTranslation=function(e,t){return $e.fromRotationTranslation($.IDENTITY,e,t)};$e.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};$e.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};$e.fromRotation=function(e,t){return l(t)||(t=new $e),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var eT=new m,tT=new m,_v=new m;$e.fromCamera=function(e,t){let n=e.position,i=e.direction,r=e.up;m.normalize(i,eT),m.normalize(m.cross(eT,r,tT),tT),m.normalize(m.cross(tT,eT,_v),_v);let o=tT.x,s=tT.y,a=tT.z,c=eT.x,u=eT.y,f=eT.z,d=_v.x,p=_v.y,g=_v.z,h=n.x,x=n.y,b=n.z,C=o*-h+s*-x+a*-b,A=d*-h+p*-x+g*-b,T=c*h+u*x+f*b;return l(t)?(t[0]=o,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=C,t[13]=A,t[14]=T,t[15]=1,t):new $e(o,s,a,C,d,p,g,A,-c,-u,-f,T,0,0,0,1)};$e.computePerspectiveFieldOfView=function(e,t,n,i,r){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=-1,r[12]=0,r[13]=0,r[14]=u,r[15]=0,r};$e.computeOrthographicOffCenter=function(e,t,n,i,r,o,s){let a=1/(t-e),c=1/(i-n),u=1/(o-r),f=-(t+e)*a,d=-(i+n)*c,p=-(o+r)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};$e.computePerspectiveOffCenter=function(e,t,n,i,r,o,s){let a=2*r/(t-e),c=2*r/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(o+r)/(o-r),p=-1,g=-2*o*r/(o-r);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};$e.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,o){let s=2*r/(t-e),a=2*r/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*r;return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=c,o[9]=u,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=p,o[15]=0,o};$e.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new $e),e=y(e,y.EMPTY_OBJECT);let r=y(e.x,0),o=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,h=r+c,x=o+u,b=t+f,C=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=h,i[13]=x,i[14]=b,i[15]=C,i};$e.computeView=function(e,t,n,i,r){return r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-m.dot(i,e),r[13]=-m.dot(n,e),r[14]=m.dot(t,e),r[15]=1,r};$e.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};$e.getElementIndex=function(e,t){return e*4+t};$e.getColumn=function(e,t,n){let i=t*4,r=e[i],o=e[i+1],s=e[i+2],a=e[i+3];return n.x=r,n.y=o,n.z=s,n.w=a,n};$e.setColumn=function(e,t,n,i){i=$e.clone(e,i);let r=t*4;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i};$e.getRow=function(e,t,n){let i=e[t],r=e[t+4],o=e[t+8],s=e[t+12];return n.x=i,n.y=r,n.z=o,n.w=s,n};$e.setRow=function(e,t,n,i){return i=$e.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};$e.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var fAe=new m;$e.setScale=function(e,t,n){let i=$e.getScale(e,fAe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var dAe=new m;$e.setUniformScale=function(e,t,n){let i=$e.getScale(e,dAe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var WG=new m;$e.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],WG)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],WG)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],WG)),t};var jJ=new m;$e.getMaximumScale=function(e){return $e.getScale(e,jJ),m.maximumComponent(jJ)};var mAe=new m;$e.setRotation=function(e,t,n){let i=$e.getScale(e,mAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var hAe=new m;$e.getRotation=function(e,t){let n=$e.getScale(e,hAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};$e.multiply=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],h=e[11],x=e[12],b=e[13],C=e[14],A=e[15],T=t[0],S=t[1],v=t[2],I=t[3],O=t[4],R=t[5],L=t[6],N=t[7],_=t[8],E=t[9],w=t[10],P=t[11],M=t[12],B=t[13],V=t[14],U=t[15],G=i*T+a*S+d*v+x*I,k=r*T+c*S+p*v+b*I,Y=o*T+u*S+g*v+C*I,j=s*T+f*S+h*v+A*I,J=i*O+a*R+d*L+x*N,W=r*O+c*R+p*L+b*N,K=o*O+u*R+g*L+C*N,Z=s*O+f*R+h*L+A*N,he=i*_+a*E+d*w+x*P,ge=r*_+c*E+p*w+b*P,se=o*_+u*E+g*w+C*P,pe=s*_+f*E+h*w+A*P,xe=i*M+a*B+d*V+x*U,Pe=r*M+c*B+p*V+b*U,we=o*M+u*B+g*V+C*U,Se=s*M+f*B+h*V+A*U;return n[0]=G,n[1]=k,n[2]=Y,n[3]=j,n[4]=J,n[5]=W,n[6]=K,n[7]=Z,n[8]=he,n[9]=ge,n[10]=se,n[11]=pe,n[12]=xe,n[13]=Pe,n[14]=we,n[15]=Se,n};$e.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};$e.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};$e.multiplyTransformation=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],h=e[14],x=t[0],b=t[1],C=t[2],A=t[4],T=t[5],S=t[6],v=t[8],I=t[9],O=t[10],R=t[12],L=t[13],N=t[14],_=i*x+s*b+u*C,E=r*x+a*b+f*C,w=o*x+c*b+d*C,P=i*A+s*T+u*S,M=r*A+a*T+f*S,B=o*A+c*T+d*S,V=i*v+s*I+u*O,U=r*v+a*I+f*O,G=o*v+c*I+d*O,k=i*R+s*L+u*N+p,Y=r*R+a*L+f*N+g,j=o*R+c*L+d*N+h;return n[0]=_,n[1]=E,n[2]=w,n[3]=0,n[4]=P,n[5]=M,n[6]=B,n[7]=0,n[8]=V,n[9]=U,n[10]=G,n[11]=0,n[12]=k,n[13]=Y,n[14]=j,n[15]=1,n};$e.multiplyByMatrix3=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],h=t[2],x=t[3],b=t[4],C=t[5],A=t[6],T=t[7],S=t[8],v=i*p+s*g+u*h,I=r*p+a*g+f*h,O=o*p+c*g+d*h,R=i*x+s*b+u*C,L=r*x+a*b+f*C,N=o*x+c*b+d*C,_=i*A+s*T+u*S,E=r*A+a*T+f*S,w=o*A+c*T+d*S;return n[0]=v,n[1]=I,n[2]=O,n[3]=0,n[4]=R,n[5]=L,n[6]=N,n[7]=0,n[8]=_,n[9]=E,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByTranslation=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=i*e[0]+r*e[4]+o*e[8]+e[12],a=i*e[1]+r*e[5]+o*e[9]+e[13],c=i*e[2]+r*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};$e.multiplyByScale=function(e,t,n){let i=t.x,r=t.y,o=t.z;return i===1&&r===1&&o===1?$e.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=e[7],n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};$e.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=t.w,a=e[0]*i+e[4]*r+e[8]*o+e[12]*s,c=e[1]*i+e[5]*r+e[9]*o+e[13]*s,u=e[2]*i+e[6]*r+e[10]*o+e[14]*s,f=e[3]*i+e[7]*r+e[11]*o+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};$e.multiplyByPointAsVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o,a=e[1]*i+e[5]*r+e[9]*o,c=e[2]*i+e[6]*r+e[10]*o;return n.x=s,n.y=a,n.z=c,n};$e.multiplyByPoint=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o+e[12],a=e[1]*i+e[5]*r+e[9]*o+e[13],c=e[2]*i+e[6]*r+e[10]*o+e[14];return n.x=s,n.y=a,n.z=c,n};$e.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};$e.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};$e.transpose=function(e,t){let n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=s,t[14]=a,t[15]=e[15],t};$e.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};$e.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};$e.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};$e.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};$e.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var pAe=new $,_Ae=new $,gAe=new oe,yAe=new oe(0,0,0,1);$e.inverse=function(e,t){let n=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],h=e[3],x=e[7],b=e[11],C=e[15],A=p*C,T=g*b,S=d*C,v=g*x,I=d*b,O=p*x,R=f*C,L=g*h,N=f*b,_=p*h,E=f*x,w=d*h,P=A*a+v*c+I*u-(T*a+S*c+O*u),M=T*s+R*c+_*u-(A*s+L*c+N*u),B=S*s+L*a+E*u-(v*s+R*a+w*u),V=O*s+N*a+w*c-(I*s+_*a+E*c),U=T*i+S*r+O*o-(A*i+v*r+I*o),G=A*n+L*r+N*o-(T*n+R*r+_*o),k=v*n+R*i+w*o-(S*n+L*i+E*o),Y=I*n+_*i+E*r-(O*n+N*i+w*r);A=r*u,T=o*c,S=i*u,v=o*a,I=i*c,O=r*a,R=n*u,L=o*s,N=n*c,_=r*s,E=n*a,w=i*s;let j=A*x+v*b+I*C-(T*x+S*b+O*C),J=T*h+R*b+_*C-(A*h+L*b+N*C),W=S*h+L*x+E*C-(v*h+R*x+w*C),K=O*h+N*x+w*b-(I*h+_*x+E*b),Z=S*p+O*g+T*d-(I*g+A*d+v*p),he=N*g+A*f+L*p-(R*p+_*g+T*f),ge=R*d+w*g+v*f-(E*g+S*f+L*d),se=E*p+I*f+_*d-(N*d+w*p+O*f),pe=n*P+i*M+r*B+o*V;if(Math.abs(pe)<D.EPSILON21){if($.equalsEpsilon($e.getMatrix3(e,pAe),_Ae,D.EPSILON7)&&oe.equals($e.getRow(e,3,gAe),yAe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new de("matrix is not invertible because its determinate is zero.")}return pe=1/pe,t[0]=P*pe,t[1]=M*pe,t[2]=B*pe,t[3]=V*pe,t[4]=U*pe,t[5]=G*pe,t[6]=k*pe,t[7]=Y*pe,t[8]=j*pe,t[9]=J*pe,t[10]=W*pe,t[11]=K*pe,t[12]=Z*pe,t[13]=he*pe,t[14]=ge*pe,t[15]=se*pe,t};$e.inverseTransformation=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],h=-n*d-i*p-r*g,x=-o*d-s*p-a*g,b=-c*d-u*p-f*g;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=r,t[9]=a,t[10]=f,t[11]=0,t[12]=h,t[13]=x,t[14]=b,t[15]=1,t};var xAe=new $e;$e.inverseTranspose=function(e,t){return $e.inverse($e.transpose(e,xAe),t)};$e.IDENTITY=Object.freeze(new $e(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));$e.ZERO=Object.freeze(new $e(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));$e.COLUMN0ROW0=0;$e.COLUMN0ROW1=1;$e.COLUMN0ROW2=2;$e.COLUMN0ROW3=3;$e.COLUMN1ROW0=4;$e.COLUMN1ROW1=5;$e.COLUMN1ROW2=6;$e.COLUMN1ROW3=7;$e.COLUMN2ROW0=8;$e.COLUMN2ROW1=9;$e.COLUMN2ROW2=10;$e.COLUMN2ROW3=11;$e.COLUMN3ROW0=12;$e.COLUMN3ROW1=13;$e.COLUMN3ROW2=14;$e.COLUMN3ROW3=15;Object.defineProperties($e.prototype,{length:{get:function(){return $e.packedLength}}});$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};$e.prototype.equalsEpsilon=function(e,t){return $e.equalsEpsilon(this,e,t)};$e.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var N=Ze;var vCe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(vCe);var wCe=new m;function jt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var qs={};qs[te.FLOAT]="float";qs[te.FLOAT_VEC2]="vec2";qs[te.FLOAT_VEC3]="vec3";qs[te.FLOAT_VEC4]="vec4";qs[te.INT]="int";qs[te.INT_VEC2]="ivec2";qs[te.INT_VEC3]="ivec3";qs[te.INT_VEC4]="ivec4";qs[te.BOOL]="bool";qs[te.BOOL_VEC2]="bvec2";qs[te.BOOL_VEC3]="bvec3";qs[te.BOOL_VEC4]="bvec4";qs[te.FLOAT_MAT2]="mat2";qs[te.FLOAT_MAT3]="mat3";qs[te.FLOAT_MAT4]="mat4";qs[te.SAMPLER_2D]="sampler2D";qs[te.SAMPLER_CUBE]="samplerCube";jt.prototype.getDeclaration=function(e){let t=`uniform ${qs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var DCe={czm_viewport:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,wCe)}}),czm_frameNumber:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new jt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new jt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Yh=DCe;function ICe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var jn=ICe;function PCe(){return!0}function OCe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=PCe}var ue=OCe;var Ss={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};Ss.getSizeInBytes=function(e){switch(e){case Ss.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ss.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ss.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Ss.fromSizeInBytes=function(e){switch(e){case 2:return Ss.UNSIGNED_SHORT;case 4:return Ss.UNSIGNED_INT;case 1:return Ss.UNSIGNED_BYTE}};Ss.validate=function(e){return u(e)&&(e===Ss.UNSIGNED_BYTE||e===Ss.UNSIGNED_SHORT||e===Ss.UNSIGNED_INT)};Ss.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ss.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ss.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ss.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ss.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ss.UNSIGNED_INT};var Fe=Object.freeze(Ss);var b3={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===b3.STREAM_DRAW||e===b3.STATIC_DRAW||e===b3.DYNAMIC_DRAW}},Ne=Object.freeze(b3);function qu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=u(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}qu.createVertexBuffer=function(e){return new qu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};qu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),r=new qu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(qu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});qu.prototype._getBuffer=function(){return this._buffer};qu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};qu.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};qu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};qu.prototype.isDestroyed=function(){return!1};qu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var mt=qu;var J_,To={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},sl={};Object.defineProperties(sl,{element:{get:function(){if(sl.supportsFullscreen())return document[To.fullscreenElement]}},changeEventName:{get:function(){if(sl.supportsFullscreen())return To.fullscreenchange}},errorEventName:{get:function(){if(sl.supportsFullscreen())return To.fullscreenerror}},enabled:{get:function(){if(sl.supportsFullscreen())return document[To.fullscreenEnabled]}},fullscreen:{get:function(){if(sl.supportsFullscreen())return sl.element!==null}}});sl.supportsFullscreen=function(){if(u(J_))return J_;J_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return To.requestFullscreen="requestFullscreen",To.exitFullscreen="exitFullscreen",To.fullscreenEnabled="fullscreenEnabled",To.fullscreenElement="fullscreenElement",To.fullscreenchange="fullscreenchange",To.fullscreenerror="fullscreenerror",J_=!0,J_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(To.requestFullscreen=n,J_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(To.requestFullscreen=n,J_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?To.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(To.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?To.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(To.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?To.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(To.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),To.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),To.fullscreenerror=n)}return J_};sl.requestFullscreen=function(e,t){sl.supportsFullscreen()&&e[To.requestFullscreen]({vrDisplay:t})};sl.exitFullscreen=function(){sl.supportsFullscreen()&&document[To.exitFullscreen]()};sl._names=To;var ho=sl;var Fa;typeof navigator<"u"?Fa=navigator:Fa={};function x0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var S3,CJ;function bG(){if(!u(S3)&&(S3=!1,!O3())){let e=/ Chrome\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(S3=!0,CJ=x0(e[1]))}return S3}function MCe(){return bG()&&CJ}var v3,TJ;function EJ(){if(!u(v3)&&(v3=!1,!bG()&&!O3()&&/ Safari\/[\.0-9]+/.test(Fa.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(v3=!0,TJ=x0(e[1]))}return v3}function RCe(){return EJ()&&TJ}var w3,TG;function bJ(){if(!u(w3)){w3=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Fa.userAgent);e!==null&&(w3=!0,TG=x0(e[1]),TG.isNightly=!!e[2])}return w3}function BCe(){return bJ()&&TG}var cv,EG;function SJ(){if(!u(cv)){cv=!1;let e;Fa.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Fa.userAgent),e!==null&&(cv=!0,EG=x0(e[1]))):Fa.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Fa.userAgent),e!==null&&(cv=!0,EG=x0(e[1])))}return cv}function LCe(){return SJ()&&EG}var D3,vJ;function O3(){if(!u(D3)){D3=!1;let e=/ Edg\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(D3=!0,vJ=x0(e[1]))}return D3}function NCe(){return O3()&&vJ}var I3,wJ;function SG(){if(!u(I3)){I3=!1;let e=/Firefox\/([\.0-9]+)/.exec(Fa.userAgent);e!==null&&(I3=!0,wJ=x0(e[1]))}return I3}var AG;function FCe(){return u(AG)||(AG=/Windows/i.test(Fa.appVersion)),AG}var xG;function UCe(){return u(xG)||(xG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),xG}function VCe(){return SG()&&wJ}var CG;function kCe(){return u(CG)||(CG=!SG()&&typeof PointerEvent<"u"&&(!u(Fa.pointerEnabled)||Fa.pointerEnabled)),CG}var DJ,P3;function IJ(){if(!u(P3)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;P3=u(t)&&t!=="",P3&&(DJ=t)}return P3}function zCe(){return IJ()?DJ:void 0}function Ec(){return Ec._result}Ec._promise=void 0;Ec._result=void 0;Ec.initialize=function(){return u(Ec._promise)||(Ec._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ec._result=t.width>0&&t.height>0,e(Ec._result)},t.onerror=function(){Ec._result=!1,e(Ec._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ec._promise};Object.defineProperties(Ec,{initialized:{get:function(){return u(Ec._result)}}});var QC=[];typeof ArrayBuffer<"u"&&(QC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&QC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&QC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&QC.push(BigInt64Array),typeof BigUint64Array<"u"&&QC.push(BigUint64Array));var nd={isChrome:bG,chromeVersion:MCe,isSafari:EJ,safariVersion:RCe,isWebkit:bJ,webkitVersion:BCe,isInternetExplorer:SJ,internetExplorerVersion:LCe,isEdge:O3,edgeVersion:NCe,isFirefox:SG,firefoxVersion:VCe,isWindows:FCe,isIPadOrIOS:UCe,hardwareConcurrency:y(Fa.hardwareConcurrency,3),supportsPointerEvents:kCe,supportsImageRenderingPixelated:IJ,supportsWebP:Ec,imageRenderingValue:zCe,typedArrayTypes:QC};nd.supportsBasis=function(e){return nd.supportsWebAssembly()&&e.context.supportsBasis};nd.supportsFullscreen=function(){return ho.supportsFullscreen()};nd.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};nd.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};nd.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};nd.supportsBigInt=function(){return typeof BigInt<"u"};nd.supportsWebWorkers=function(){return typeof Worker<"u"};nd.supportsWebAssembly=function(){return typeof WebAssembly<"u"};nd.supportsWebgl2=function(e){return e.context.webgl2};var Gt=nd;function vG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return u(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,r){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),u(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return u(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var wG,DG,Xh;Gt.supportsTypedArrays()&&(wG=new ArrayBuffer(4),DG=new Uint32Array(wG),Xh=new Uint8Array(wG));ie.fromRgba=function(e,t){return DG[0]=e,ie.fromBytes(Xh[0],Xh[1],Xh[2],Xh[3],t)};ie.fromHsl=function(e,t,n,i,r){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let o=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let l=2*n-c;o=vG(l,c,e+1/3),s=vG(l,c,e),a=vG(l,c,e-1/3)}return u(r)?(r.red=o,r.green=s,r.blue=a,r.alpha=i,r):new ie(o,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!u(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!u(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let r=e.blue;if(!u(r)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);r=s+P.nextRandomNumber()*(a-s)}let o=e.alpha;if(!u(o)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);o=s+P.nextRandomNumber()*(a-s)}return u(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new ie(n,i,r,o)};var HCe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,GCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,WCe=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,jCe=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){u(t)||(t=new ie),e=e.replace(/\s/g,"");let n=ie[e.toUpperCase()];if(u(n))return ie.clone(n,t),t;let i=HCe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=GCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=WCe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=jCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(u(e))return u(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||u(e)&&u(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||u(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),r=ie.floatToByte(this.alpha);return u(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]};ie.prototype.toRgba=function(){return Xh[0]=ie.floatToByte(this.red),Xh[1]=ie.floatToByte(this.green),Xh[2]=ie.floatToByte(this.blue),Xh[3]=ie.floatToByte(this.alpha),DG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function M3(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}M3.ALL=Object.freeze(new M3({color:new z(0,0,0,0),depth:1,stencil:0}));M3.prototype.execute=function(e,t){e.clear(this,t)};var ri=M3;var qCe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},ve=Object.freeze(qCe);function PJ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=ve.COMPUTE,this.owner=e.owner}PJ.prototype.execute=function(e){e.execute(this)};var Yu=PJ;function Pt(e,t){this.x=y(e,0),this.y=y(t,0)}Pt.fromElements=function(e,t,n){return u(n)?(n.x=e,n.y=t,n):new Pt(e,t)};Pt.clone=function(e,t){if(u(e))return u(t)?(t.x=e.x,t.y=e.y,t):new Pt(e.x,e.y)};Pt.fromCartesian3=Pt.clone;Pt.fromCartesian4=Pt.clone;Pt.packedLength=2;Pt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Pt.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Pt),n.x=e[t++],n.y=e[t],n};Pt.packArray=function(e,t){let n=e.length,i=n*2;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Pt.pack(e[r],t,r*2);return t};Pt.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let r=i/2;t[r]=Pt.unpack(e,i,t[r])}return t};Pt.fromArray=Pt.unpack;Pt.maximumComponent=function(e){return Math.max(e.x,e.y)};Pt.minimumComponent=function(e){return Math.min(e.x,e.y)};Pt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Pt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Pt.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y);return i.x=r,i.y=o,i};Pt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Pt.magnitude=function(e){return Math.sqrt(Pt.magnitudeSquared(e))};var R3=new Pt;Pt.distance=function(e,t){return Pt.subtract(e,t,R3),Pt.magnitude(R3)};Pt.distanceSquared=function(e,t){return Pt.subtract(e,t,R3),Pt.magnitudeSquared(R3)};Pt.normalize=function(e,t){let n=Pt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Pt.dot=function(e,t){return e.x*t.x+e.y*t.y};Pt.cross=function(e,t){return e.x*t.y-e.y*t.x};Pt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Pt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Pt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Pt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Pt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Pt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Pt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Pt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var OJ=new Pt;Pt.lerp=function(e,t,n,i){return Pt.multiplyByScalar(t,n,OJ),i=Pt.multiplyByScalar(e,1-n,i),Pt.add(OJ,i,i)};var MJ=new Pt,RJ=new Pt;Pt.angleBetween=function(e,t){return Pt.normalize(e,MJ),Pt.normalize(t,RJ),P.acosClamped(Pt.dot(MJ,RJ))};var YCe=new Pt;Pt.mostOrthogonalAxis=function(e,t){let n=Pt.normalize(e,YCe);return Pt.abs(n,n),n.x<=n.y?t=Pt.clone(Pt.UNIT_X,t):t=Pt.clone(Pt.UNIT_Y,t),t};Pt.equals=function(e,t){return e===t||u(e)&&u(t)&&e.x===t.x&&e.y===t.y};Pt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Pt.equalsEpsilon=function(e,t,n,i){return e===t||u(e)&&u(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Pt.ZERO=Object.freeze(new Pt(0,0));Pt.ONE=Object.freeze(new Pt(1,1));Pt.UNIT_X=Object.freeze(new Pt(1,0));Pt.UNIT_Y=Object.freeze(new Pt(0,1));Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t,n){return Pt.equalsEpsilon(this,e,t,n)};Pt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var H=Pt;var XCe=new m,KCe=new m;function JCe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,l=t.y,f=t.z,d=o*o*c*c,p=s*s*l*l,g=a*a*f*f,h=d+p+g,A=Math.sqrt(1/h),x=m.multiplyByScalar(e,A,XCe);if(h<i)return isFinite(A)?m.clone(x,r):void 0;let C=n.x,T=n.y,E=n.z,S=KCe;S.x=x.x*C*2,S.y=x.y*T*2,S.z=x.z*E*2;let w=(1-A)*m.magnitude(e)/(.5*m.magnitude(S)),D=0,M,O,B,L,_,b,v,I,R,F,k;do{w-=D,B=1/(1+w*C),L=1/(1+w*T),_=1/(1+w*E),b=B*B,v=L*L,I=_*_,R=b*B,F=v*L,k=I*_,M=d*b+p*v+g*I-1,O=d*R*C+p*F*T+g*k*E;let V=-2*O;D=M/V}while(Math.abs(M)>P.EPSILON12);return u(r)?(r.x=o*B,r.y=s*L,r.z=a*_,r):new m(o*B,s*L,a*_)}var C0=JCe;function Zo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Zo.fromRadians=function(e,t,n,i){return n=y(n,0),u(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Zo(e,t,n)};Zo.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Zo.fromRadians(e,t,n,i)};var ZCe=new m,QCe=new m,$Ce=new m,eTe=new m(1/6378137,1/6378137,1/6356752314245179e-9),tTe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),nTe=P.EPSILON1;Zo.fromCartesian=function(e,t,n){let i=u(t)?t.oneOverRadii:eTe,r=u(t)?t.oneOverRadiiSquared:tTe,o=u(t)?t._centerToleranceSquared:nTe,s=C0(e,i,r,o,QCe);if(!u(s))return;let a=m.multiplyComponents(s,r,ZCe);a=m.normalize(a,a);let c=m.subtract(e,s,$Ce),l=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return u(n)?(n.longitude=l,n.latitude=f,n.height=d,n):new Zo(l,f,d)};Zo.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Zo.clone=function(e,t){if(u(e))return u(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Zo(e.longitude,e.latitude,e.height)};Zo.equals=function(e,t){return e===t||u(e)&&u(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Zo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Zo.ZERO=Object.freeze(new Zo(0,0,0));Zo.prototype.clone=function(e){return Zo.clone(this,e)};Zo.prototype.equals=function(e){return Zo.equals(this,e)};Zo.prototype.equalsEpsilon=function(e,t){return Zo.equalsEpsilon(this,e,t)};Zo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Zo;function LJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function nr(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,LJ(this,e,t,n)}Object.defineProperties(nr.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});nr.clone=function(e,t){if(!u(e))return;let n=e._radii;return u(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new nr(n.x,n.y,n.z)};nr.fromCartesian3=function(e,t){return u(t)||(t=new nr),u(e)&&LJ(t,e.x,e.y,e.z),t};nr.WGS84=Object.freeze(new nr(6378137,6378137,6356752314245179e-9));nr.UNIT_SPHERE=Object.freeze(new nr(1,1,1));nr.MOON=Object.freeze(new nr(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));nr.prototype.clone=function(e){return nr.clone(this,e)};nr.packedLength=m.packedLength;nr.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};nr.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return nr.fromCartesian3(i,n)};nr.prototype.geocentricSurfaceNormal=m.normalize;nr.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),s=r*Math.sin(n),a=Math.sin(i);return u(t)||(t=new m),t.x=o,t.y=s,t.z=a,m.normalize(t,t)};nr.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return u(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var iTe=new m,rTe=new m;nr.prototype.cartographicToCartesian=function(e,t){let n=iTe,i=rTe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let r=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,r,i),m.multiplyByScalar(n,e.height,n),u(t)||(t=new m),m.add(i,n,t)};nr.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;u(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var oTe=new m,sTe=new m,aTe=new m;nr.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,sTe);if(!u(n))return;let i=this.geodeticSurfaceNormal(n,oTe),r=m.subtract(e,n,aTe),o=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(m.dot(r,e))*m.magnitude(r);return u(t)?(t.longitude=o,t.latitude=s,t.height=a,t):new he(o,s,a)};nr.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;u(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};nr.prototype.scaleToGeodeticSurface=function(e,t){return C0(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};nr.prototype.scaleToGeocentricSurface=function(e,t){u(t)||(t=new m);let n=e.x,i=e.y,r=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return m.multiplyByScalar(e,s,t)};nr.prototype.transformPositionToScaledSpace=function(e,t){return u(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};nr.prototype.transformPositionFromScaledSpace=function(e,t){return u(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};nr.prototype.equals=function(e){return this===e||u(e)&&m.equals(this._radii,e._radii)};nr.prototype.toString=function(){return this._radii.toString()};nr.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(u(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var cTe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],lTe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function BJ(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*cTe[s];o+=lTe[s]*(n(i+a)+n(i-a))}return o*=r,o}nr.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,r=e.north;for(;n<t;)n+=P.TWO_PI;let o=this._radiiSquared,s=o.x,a=o.y,c=o.z,l=s*a;return BJ(i,r,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*BJ(t,n,function(g){let h=Math.cos(g),A=Math.sin(g);return Math.sqrt(l*p*p+c*(a*h*h+s*A*A)*d*d)})})};var re=nr;function B3(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(B3.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});B3.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=e.latitude*n,o=e.height;return u(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};B3.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=e.y*n,o=e.z;return u(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new he(i,r,o)};var Ii=B3;var uTe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},$t=Object.freeze(uTe);function Vn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Vn.prototype,{width:{get:function(){return Vn.computeWidth(this)}},height:{get:function(){return Vn.computeHeight(this)}}});Vn.packedLength=4;Vn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Vn.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Vn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};Vn.computeHeight=function(e){return e.north-e.south};Vn.fromDegrees=function(e,t,n,i,r){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),u(r)?(r.west=e,r.south=t,r.east=n,r.north=i,r):new Vn(e,t,n,i)};Vn.fromRadians=function(e,t,n,i,r){return u(r)?(r.west=y(e,0),r.south=y(t,0),r.east=y(n,0),r.north=y(i,0),r):new Vn(e,t,n,i)};Vn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,l=e.length;c<l;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;r=Math.min(r,d),o=Math.max(o,d)}return i-n>o-r&&(n=r,i=o,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),u(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Vn(n,s,i,a)};Vn.fromCartesianArray=function(e,t,n){t=y(t,re.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let l=0,f=e.length;l<f;l++){let d=t.cartesianToCartographic(e[l]);i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),u(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new Vn(i,a,r,c)};Vn.clone=function(e,t){if(u(e))return u(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Vn(e.west,e.south,e.east,e.north)};Vn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Vn.prototype.clone=function(e){return Vn.clone(this,e)};Vn.prototype.equals=function(e){return Vn.equals(this,e)};Vn.equals=function(e,t){return e===t||u(e)&&u(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Vn.prototype.equalsEpsilon=function(e,t){return Vn.equalsEpsilon(this,e,t)};Vn.validate=function(e){};Vn.southwest=function(e,t){return u(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Vn.northwest=function(e,t){return u(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Vn.northeast=function(e,t){return u(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Vn.southeast=function(e,t){return u(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Vn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let r=P.negativePiToPi((i+n)*.5),o=(e.south+e.north)*.5;return u(t)?(t.longitude=r,t.latitude=o,t.height=0,t):new he(r,o)};Vn.intersection=function(e,t,n){let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=P.TWO_PI:o<s&&i>0&&(o+=P.TWO_PI),i<r&&s<0?s+=P.TWO_PI:o<s&&r<0&&(r+=P.TWO_PI);let a=P.negativePiToPi(Math.max(r,s)),c=P.negativePiToPi(Math.min(i,o));if((e.west<e.east||t.west<t.east)&&c<=a)return;let l=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(l>=f))return u(n)?(n.west=a,n.south=l,n.east=c,n.north=f,n):new Vn(a,l,c,f)};Vn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(r>=s||i>=o))return u(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new Vn(i,r,o,s)};Vn.union=function(e,t,n){u(n)||(n=new Vn);let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=P.TWO_PI:o<s&&i>0&&(o+=P.TWO_PI),i<r&&s<0?s+=P.TWO_PI:o<s&&r<0&&(r+=P.TWO_PI);let a=P.negativePiToPi(Math.min(r,s)),c=P.negativePiToPi(Math.max(i,o));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Vn.expand=function(e,t,n){return u(n)||(n=new Vn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Vn.contains=function(e,t){let n=t.longitude,i=t.latitude,r=e.west,o=e.east;return o<r&&(o+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>r||P.equalsEpsilon(n,r,P.EPSILON14))&&(n<o||P.equalsEpsilon(n,o,P.EPSILON14))&&i>=e.south&&i<=e.north};var fTe=new he;Vn.subsample=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,0),u(i)||(i=[]);let r=0,o=e.north,s=e.south,a=e.east,c=e.west,l=fTe;l.height=n,l.longitude=c,l.latitude=o,i[r]=t.cartographicToCartesian(l,i[r]),r++,l.longitude=a,i[r]=t.cartographicToCartesian(l,i[r]),r++,l.latitude=s,i[r]=t.cartographicToCartesian(l,i[r]),r++,l.longitude=c,i[r]=t.cartographicToCartesian(l,i[r]),r++,o<0?l.latitude=o:s>0?l.latitude=s:l.latitude=0;for(let f=1;f<8;++f)l.longitude=-Math.PI+f*P.PI_OVER_TWO,Vn.contains(e,l)&&(i[r]=t.cartographicToCartesian(l,i[r]),r++);return l.latitude===0&&(l.longitude=c,i[r]=t.cartographicToCartesian(l,i[r]),r++,l.longitude=a,i[r]=t.cartographicToCartesian(l,i[r]),r++),i.length=r,i};Vn.subsection=function(e,t,n,i,r,o){if(u(o)||(o=new Vn),e.west<=e.east){let a=e.east-e.west;o.west=e.west+t*a,o.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;o.west=P.negativePiToPi(e.west+t*a),o.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return o.south=e.south+n*s,o.north=e.south+r*s,t===1&&(o.west=e.east),i===1&&(o.east=e.east),n===1&&(o.south=e.north),r===1&&(o.north=e.north),o};Vn.MAX_VALUE=Object.freeze(new Vn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ce=Vn;function Eo(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Eo.packedLength=4;Eo.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Eo.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Eo),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Eo.fromPoints=function(e,t){if(u(t)||(t=new Eo),!u(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],l=c.x,f=c.y;i=Math.min(l,i),o=Math.max(l,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var dTe=new Ii,mTe=new he,hTe=new he;Eo.fromRectangle=function(e,t,n){if(u(n)||(n=new Eo),!u(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=y(t,dTe);let i=t.project(ce.southwest(e,mTe)),r=t.project(ce.northeast(e,hTe));return H.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};Eo.clone=function(e,t){if(u(e))return u(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Eo(e.x,e.y,e.width,e.height)};Eo.union=function(e,t,n){u(n)||(n=new Eo);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};Eo.expand=function(e,t,n){n=Eo.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Eo.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};Eo.equals=function(e,t){return e===t||u(e)&&u(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Eo.prototype.clone=function(e){return Eo.clone(this,e)};Eo.prototype.intersect=function(e){return Eo.intersect(this,e)};Eo.prototype.equals=function(e){return Eo.equals(this,e)};var Ye=Eo;var pa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};pa.isLines=function(e){return e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP};pa.isTriangles=function(e){return e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};pa.validate=function(e){return e===pa.POINTS||e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP||e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};var Be=Object.freeze(pa);var T0=`in vec4 position; -in vec2 textureCoordinates; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=$e;function gn(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var YG=new m,XG=new m,KG=new m,JG=new m,ZG=new m,$G=new m,QG=new m,qs=new m,e8=new m,t8=new m,n8=new m,i8=new m,bAe=4/3*D.PI;gn.fromPoints=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],QG),i=m.clone(n,YG),r=m.clone(n,XG),o=m.clone(n,KG),s=m.clone(n,JG),a=m.clone(n,ZG),c=m.clone(n,$G),u=e.length,f;for(f=1;f<u;f++){m.clone(e[f],n);let R=n.x,L=n.y,N=n.z;R<i.x&&m.clone(n,i),R>s.x&&m.clone(n,s),L<r.y&&m.clone(n,r),L>a.y&&m.clone(n,a),N<o.z&&m.clone(n,o),N>c.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,qs)),p=m.magnitudeSquared(m.subtract(a,r,qs)),g=m.magnitudeSquared(m.subtract(c,o,qs)),h=i,x=s,b=d;p>b&&(b=p,h=r,x=a),g>b&&(b=g,h=o,x=c);let C=e8;C.x=(h.x+x.x)*.5,C.y=(h.y+x.y)*.5,C.z=(h.z+x.z)*.5;let A=m.magnitudeSquared(m.subtract(x,C,qs)),T=Math.sqrt(A),S=t8;S.x=i.x,S.y=r.y,S.z=o.z;let v=n8;v.x=s.x,v.y=a.y,v.z=c.z;let I=m.midpoint(S,v,i8),O=0;for(f=0;f<u;f++){m.clone(e[f],n);let R=m.magnitude(m.subtract(n,I,qs));R>O&&(O=R);let L=m.magnitudeSquared(m.subtract(n,C,qs));if(L>A){let N=Math.sqrt(L);T=(T+N)*.5,A=T*T;let _=N-T;C.x=(T*C.x+_*n.x)/N,C.y=(T*C.y+_*n.y)/N,C.z=(T*C.z+_*n.z)/N}}return T<O?(m.clone(C,t.center),t.radius=T):(m.clone(I,t.center),t.radius=O),t};var CAe=new Pi,TAe=new m,AAe=new m,jG=new me,qG=new me;gn.fromRectangle2D=function(e,t,n){return gn.fromRectangleWithHeights2D(e,t,0,0,n)};gn.fromRectangleWithHeights2D=function(e,t,n,i,r){if(l(r)||(r=new gn),!l(e))return r.center=m.clone(m.ZERO,r.center),r.radius=0,r;t=y(t,CAe),ce.southwest(e,jG),jG.height=n,ce.northeast(e,qG),qG.height=i;let o=t.project(jG,TAe),s=t.project(qG,AAe),a=s.x-o.x,c=s.y-o.y,u=s.z-o.z;r.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=r.center;return f.x=o.x+a*.5,f.y=o.y+c*.5,f.z=o.z+u*.5,r};var EAe=[];gn.fromRectangle3D=function(e,t,n,i){if(t=y(t,re.WGS84),n=y(n,0),l(i)||(i=new gn),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let r=ce.subsample(e,t,n,EAe);return gn.fromPoints(r,i)};gn.fromVertices=function(e,t,n,i){if(l(i)||(i=new gn),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=y(t,m.ZERO),n=y(n,3);let r=QG;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let o=m.clone(r,YG),s=m.clone(r,XG),a=m.clone(r,KG),c=m.clone(r,JG),u=m.clone(r,ZG),f=m.clone(r,$G),d=e.length,p;for(p=0;p<d;p+=n){let N=e[p]+t.x,_=e[p+1]+t.y,E=e[p+2]+t.z;r.x=N,r.y=_,r.z=E,N<o.x&&m.clone(r,o),N>c.x&&m.clone(r,c),_<s.y&&m.clone(r,s),_>u.y&&m.clone(r,u),E<a.z&&m.clone(r,a),E>f.z&&m.clone(r,f)}let g=m.magnitudeSquared(m.subtract(c,o,qs)),h=m.magnitudeSquared(m.subtract(u,s,qs)),x=m.magnitudeSquared(m.subtract(f,a,qs)),b=o,C=c,A=g;h>A&&(A=h,b=s,C=u),x>A&&(A=x,b=a,C=f);let T=e8;T.x=(b.x+C.x)*.5,T.y=(b.y+C.y)*.5,T.z=(b.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,T,qs)),v=Math.sqrt(S),I=t8;I.x=o.x,I.y=s.y,I.z=a.z;let O=n8;O.x=c.x,O.y=u.y,O.z=f.z;let R=m.midpoint(I,O,i8),L=0;for(p=0;p<d;p+=n){r.x=e[p]+t.x,r.y=e[p+1]+t.y,r.z=e[p+2]+t.z;let N=m.magnitude(m.subtract(r,R,qs));N>L&&(L=N);let _=m.magnitudeSquared(m.subtract(r,T,qs));if(_>S){let E=Math.sqrt(_);v=(v+E)*.5,S=v*v;let w=E-v;T.x=(v*T.x+w*r.x)/E,T.y=(v*T.y+w*r.y)/E,T.z=(v*T.z+w*r.z)/E}}return v<L?(m.clone(T,i.center),i.radius=v):(m.clone(R,i.center),i.radius=L),i};gn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new gn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=QG;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let r=m.clone(i,YG),o=m.clone(i,XG),s=m.clone(i,KG),a=m.clone(i,JG),c=m.clone(i,ZG),u=m.clone(i,$G),f=e.length,d;for(d=0;d<f;d+=3){let L=e[d]+t[d],N=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=L,i.y=N,i.z=_,L<r.x&&m.clone(i,r),L>a.x&&m.clone(i,a),N<o.y&&m.clone(i,o),N>c.y&&m.clone(i,c),_<s.z&&m.clone(i,s),_>u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,r,qs)),g=m.magnitudeSquared(m.subtract(c,o,qs)),h=m.magnitudeSquared(m.subtract(u,s,qs)),x=r,b=a,C=p;g>C&&(C=g,x=o,b=c),h>C&&(C=h,x=s,b=u);let A=e8;A.x=(x.x+b.x)*.5,A.y=(x.y+b.y)*.5,A.z=(x.z+b.z)*.5;let T=m.magnitudeSquared(m.subtract(b,A,qs)),S=Math.sqrt(T),v=t8;v.x=r.x,v.y=o.y,v.z=s.z;let I=n8;I.x=a.x,I.y=c.y,I.z=u.z;let O=m.midpoint(v,I,i8),R=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let L=m.magnitude(m.subtract(i,O,qs));L>R&&(R=L);let N=m.magnitudeSquared(m.subtract(i,A,qs));if(N>T){let _=Math.sqrt(N);S=(S+_)*.5,T=S*S;let E=_-S;A.x=(S*A.x+E*i.x)/_,A.y=(S*A.y+E*i.y)/_,A.z=(S*A.z+E*i.z)/_}}return S<R?(m.clone(A,n.center),n.radius=S):(m.clone(O,n.center),n.radius=R),n};gn.fromCornerPoints=function(e,t,n){l(n)||(n=new gn);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};gn.fromEllipsoid=function(e,t){return l(t)||(t=new gn),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var SAe=new m;gn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return gn.clone(e[0],t);if(n===2)return gn.union(e[0],e[1],t);let i=[],r;for(r=0;r<n;r++)i.push(e[r].center);t=gn.fromPoints(i,t);let o=t.center,s=t.radius;for(r=0;r<n;r++){let a=e[r];s=Math.max(s,m.distance(o,a.center,SAe)+a.radius)}return t.radius=s,t};var vAe=new m,wAe=new m,IAe=new m;gn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new gn);let n=e.halfAxes,i=$.getColumn(n,0,vAe),r=$.getColumn(n,1,wAe),o=$.getColumn(n,2,IAe);return m.add(i,r,i),m.add(i,o,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var PAe=new m,DAe=new m;gn.fromTransformation=function(e,t){l(t)||(t=new gn);let n=F.getTranslation(e,PAe),i=F.getScale(e,DAe),r=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=r,t};gn.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new gn(e.center,e.radius)};gn.packedLength=4;gn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};gn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new gn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var RAe=new m,OAe=new m;gn.union=function(e,t,n){l(n)||(n=new gn);let i=e.center,r=e.radius,o=t.center,s=t.radius,a=m.subtract(o,i,RAe),c=m.magnitude(a);if(r>=c+s)return e.clone(n),n;if(s>=c+r)return t.clone(n),n;let u=(r+c+s)*.5,f=m.multiplyByScalar(a,(-r+u)/c,OAe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var MAe=new m;gn.expand=function(e,t,n){n=gn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,MAe));return i>n.radius&&(n.radius=i),n};gn.intersectPlane=function(e,t){let n=e.center,i=e.radius,r=t.normal,o=m.dot(r,n)+t.distance;return o<-i?en.OUTSIDE:o<i?en.INTERSECTING:en.INSIDE};gn.transform=function(e,t,n){return l(n)||(n=new gn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var LAe=new m;gn.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,LAe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};gn.transformWithoutScale=function(e,t,n){return l(n)||(n=new gn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var NAe=new m;gn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ac);let r=m.subtract(e.center,t,NAe),o=m.dot(n,r);return i.start=o-e.radius,i.stop=o+e.radius,i};var qJ=new m,FAe=new m,BAe=new m,kAe=new m,UAe=new m,VAe=new me,YJ=new Array(8);for(let e=0;e<8;++e)YJ[e]=new m;var zAe=new Pi;gn.projectTo2D=function(e,t,n){t=y(t,zAe);let i=t.ellipsoid,r=e.center,o=e.radius,s;m.equals(r,m.ZERO)?s=m.clone(m.UNIT_X,qJ):s=i.geodeticSurfaceNormal(r,qJ);let a=m.cross(m.UNIT_Z,s,FAe);m.normalize(a,a);let c=m.cross(s,a,BAe);m.normalize(c,c),m.multiplyByScalar(s,o,s),m.multiplyByScalar(c,o,c),m.multiplyByScalar(a,o,a);let u=m.negate(c,UAe),f=m.negate(a,kAe),d=YJ,p=d[0];m.add(s,c,p),m.add(p,a,p),p=d[1],m.add(s,c,p),m.add(p,f,p),p=d[2],m.add(s,u,p),m.add(p,f,p),p=d[3],m.add(s,u,p),m.add(p,a,p),m.negate(s,s),p=d[4],m.add(s,c,p),m.add(p,a,p),p=d[5],m.add(s,c,p),m.add(p,f,p),p=d[6],m.add(s,u,p),m.add(p,f,p),p=d[7],m.add(s,u,p),m.add(p,a,p);let g=d.length;for(let C=0;C<g;++C){let A=d[C];m.add(r,A,A);let T=i.cartesianToCartographic(A,VAe);t.project(T,A)}n=gn.fromPoints(d,n),r=n.center;let h=r.x,x=r.y,b=r.z;return r.x=b,r.y=h,r.z=x,n};gn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};gn.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};gn.prototype.intersectPlane=function(e){return gn.intersectPlane(this,e)};gn.prototype.distanceSquaredTo=function(e){return gn.distanceSquaredTo(this,e)};gn.prototype.computePlaneDistances=function(e,t,n){return gn.computePlaneDistances(this,e,t,n)};gn.prototype.isOccluded=function(e){return gn.isOccluded(this,e)};gn.prototype.equals=function(e){return gn.equals(this,e)};gn.prototype.clone=function(e){return gn.clone(this,e)};gn.prototype.volume=function(){let e=this.radius;return bAe*e*e*e};var ae=gn;var HAe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(HAe);var Sn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};Sn.getSizeInBytes=function(e){switch(e){case Sn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Sn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Sn.INT:return Int32Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Sn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Sn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Sn.fromTypedArray=function(e){if(e instanceof Int8Array)return Sn.BYTE;if(e instanceof Uint8Array)return Sn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Sn.SHORT;if(e instanceof Uint16Array)return Sn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Sn.INT;if(e instanceof Uint32Array)return Sn.UNSIGNED_INT;if(e instanceof Float32Array)return Sn.FLOAT;if(e instanceof Float64Array)return Sn.DOUBLE};Sn.validate=function(e){return l(e)&&(e===Sn.BYTE||e===Sn.UNSIGNED_BYTE||e===Sn.SHORT||e===Sn.UNSIGNED_SHORT||e===Sn.INT||e===Sn.UNSIGNED_INT||e===Sn.FLOAT||e===Sn.DOUBLE)};Sn.createTypedArray=function(e,t){switch(e){case Sn.BYTE:return new Int8Array(t);case Sn.UNSIGNED_BYTE:return new Uint8Array(t);case Sn.SHORT:return new Int16Array(t);case Sn.UNSIGNED_SHORT:return new Uint16Array(t);case Sn.INT:return new Int32Array(t);case Sn.UNSIGNED_INT:return new Uint32Array(t);case Sn.FLOAT:return new Float32Array(t);case Sn.DOUBLE:return new Float64Array(t)}};Sn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Sn.getSizeInBytes(e)),e){case Sn.BYTE:return new Int8Array(t,n,i);case Sn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Sn.SHORT:return new Int16Array(t,n,i);case Sn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Sn.INT:return new Int32Array(t,n,i);case Sn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Sn.FLOAT:return new Float32Array(t,n,i);case Sn.DOUBLE:return new Float64Array(t,n,i)}};Sn.fromName=function(e){switch(e){case"BYTE":return Sn.BYTE;case"UNSIGNED_BYTE":return Sn.UNSIGNED_BYTE;case"SHORT":return Sn.SHORT;case"UNSIGNED_SHORT":return Sn.UNSIGNED_SHORT;case"INT":return Sn.INT;case"UNSIGNED_INT":return Sn.UNSIGNED_INT;case"FLOAT":return Sn.FLOAT;case"DOUBLE":return Sn.DOUBLE}};var X=Object.freeze(Sn);var GAe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Yu=Object.freeze(GAe);function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Xt.pack(e[r],t,r*4);return t};Xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=Xt.unpack(e,i,t[r])}return t};Xt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,r=e[i],o=e[i+1];return n.x=r,n.y=o,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let r=t*2;return i[r]=n.x,i[r+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],r=e[t+2];return n.x=i,n.y=r,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var WAe=new H;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,WAe),r=t.x/i.x,o=t.y/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var jAe=new H;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,jAe),r=t/i.x,o=t/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var XJ=new H;Xt.getScale=function(e,t){return t.x=H.magnitude(H.fromElements(e[0],e[1],XJ)),t.y=H.magnitude(H.fromElements(e[2],e[3],XJ)),t};var KJ=new H;Xt.getMaximumScale=function(e){return Xt.getScale(e,KJ),H.maximumComponent(KJ)};var qAe=new H;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,qAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var YAe=new H;Xt.getRotation=function(e,t){let n=Xt.getScale(e,YAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],r=e[1],o=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`};var ir=Xt;var pa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};pa.isLines=function(e){return e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP};pa.isTriangles=function(e){return e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};pa.validate=function(e){return e===pa.POINTS||e===pa.LINES||e===pa.LINE_LOOP||e===pa.LINE_STRIP||e===pa.TRIANGLES||e===pa.TRIANGLE_STRIP||e===pa.TRIANGLE_FAN};var Le=Object.freeze(pa);function it(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var gv=new m;it.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);gv=m.normalize(e,gv);let o=gv.x*r,s=gv.y*r,a=gv.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new it(o,s,a,c)};var XAe=[1,2,0],KAe=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=XAe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(h,h)]+1);let x=KAe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(h,g)]-e[$.getElementIndex(g,h)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[h]=(e[$.getElementIndex(h,p)]+e[$.getElementIndex(p,h)])*n,i=-x[0],r=-x[1],o=-x[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new it(i,r,o,s)};var JJ=new it,ZJ=new it,r8=new it,$J=new it;it.fromHeadingPitchRoll=function(e,t){return $J=it.fromAxisAngle(m.UNIT_X,e.roll,JJ),r8=it.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=it.multiply(r8,$J,r8),ZJ=it.fromAxisAngle(m.UNIT_Z,-e.heading,JJ),it.multiply(ZJ,t,t)};var U3=new m,o8=new m,od=new it,QJ=new it,V3=new it;it.packedLength=4;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,V3),it.conjugate(V3,V3);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;it.unpack(e,(t+r)*4,od),it.multiply(od,V3,od),od.w<0&&it.negate(od,od),it.computeAxis(od,U3);let a=it.computeAngle(od);l(i)||(i=[]),i[s]=U3.x*a,i[s+1]=U3.y*a,i[s+2]=U3.z*a}};it.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new it),m.fromArray(e,0,o8);let o=m.magnitude(o8);return it.unpack(t,i*4,QJ),o===0?it.clone(it.IDENTITY,od):it.fromAxisAngle(o8,o,od),it.multiply(od,QJ,r)};it.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};it.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,h=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=h,n};it.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};it.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};it.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var s8=new it;it.lerp=function(e,t,n,i){return s8=it.multiplyByScalar(t,n,s8),i=it.multiplyByScalar(e,1-n,i),it.add(s8,i,i)};var eZ=new it,a8=new it,c8=new it;it.slerp=function(e,t,n,i){let r=it.dot(e,t),o=t;if(r<0&&(r=-r,o=eZ=it.negate(t,eZ)),1-r<D.EPSILON6)return it.lerp(e,o,n,i);let s=Math.acos(r);return a8=it.multiplyByScalar(e,Math.sin((1-n)*s),a8),c8=it.multiplyByScalar(o,Math.sin(n*s),c8),i=it.add(a8,c8,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var JAe=new m,ZAe=new m,yv=new it,nT=new it;it.computeInnerQuadrangle=function(e,t,n,i){let r=it.conjugate(t,yv);it.multiply(r,n,nT);let o=it.log(nT,JAe);it.multiply(r,e,nT);let s=it.log(nT,ZAe);return m.add(o,s,o),m.multiplyByScalar(o,.25,o),m.negate(o,o),it.exp(o,yv),it.multiply(t,yv,i)};it.squad=function(e,t,n,i,r,o){let s=it.slerp(e,t,r,yv),a=it.slerp(n,i,r,nT);return it.slerp(s,a,2*r*(1-r),o)};var $Ae=new it,tZ=1.9011074535173003,z3=Wt.supportsTypedArrays()?new Float32Array(8):[],H3=Wt.supportsTypedArrays()?new Float32Array(8):[],Kh=Wt.supportsTypedArrays()?new Float32Array(8):[],Jh=Wt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;z3[e]=1/(t*n),H3[e]=t/n}z3[7]=tZ/(8*17);H3[7]=tZ*8/17;it.fastSlerp=function(e,t,n,i){let r=it.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)Kh[g]=(z3[g]*c-H3[g])*s,Jh[g]=(z3[g]*u-H3[g])*s;let f=o*n*(1+Kh[0]*(1+Kh[1]*(1+Kh[2]*(1+Kh[3]*(1+Kh[4]*(1+Kh[5]*(1+Kh[6]*(1+Kh[7])))))))),d=a*(1+Jh[0]*(1+Jh[1]*(1+Jh[2]*(1+Jh[3]*(1+Jh[4]*(1+Jh[5]*(1+Jh[6]*(1+Jh[7])))))))),p=it.multiplyByScalar(e,d,$Ae);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,r,o){let s=it.fastSlerp(e,t,r,yv),a=it.fastSlerp(n,i,r,nT);return it.fastSlerp(s,a,2*r*(1-r),o)};it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=it;function QAe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Or=QAe;function eEe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var ng=eEe;function tEe(e,t,n,i,r,o,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a}var Zh=tEe;function nEe(e){return e%4===0&&e%100!==0||e%400===0}var $h=nEe;function iEe(e,t){this.julianDate=e,this.offset=t}var Gi=iEe;var rEe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Qn=Object.freeze(rEe);var oEe={UTC:0,TAI:1},Zn=Object.freeze(oEe);var iZ=new Zh,l8=[31,28,31,30,31,30,31,31,30,31,30,31],u8=29;function f8(e,t){return St.compare(e.julianDate,t.julianDate)}var iT=new Gi;function W3(e){iT.julianDate=e;let t=St.leapSeconds,n=Or(t,iT,f8);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&St.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),St.addSeconds(e,i,e)}function nZ(e,t){iT.julianDate=e;let n=St.leapSeconds,i=Or(n,iT,f8);if(i<0&&(i=~i),i===0)return St.addSeconds(e,-n[0].offset,t);if(i>=n.length)return St.addSeconds(e,-n[i-1].offset,t);let r=St.secondsDifference(n[i].julianDate,e);if(r===0)return St.addSeconds(e,-n[i].offset,t);if(!(r<=1))return St.addSeconds(e,-n[--i].offset,t)}function ig(e,t,n){let i=t/Qn.SECONDS_PER_DAY|0;return e+=i,t-=Qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d8(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Qn.SECONDS_PER_HOUR+r*Qn.SECONDS_PER_MINUTE+s*Qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var sEe=/^(\d{4})$/,aEe=/^(\d{4})-(\d{2})$/,cEe=/^(\d{4})-?(\d{3})$/,lEe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,uEe=/^(\d{4})-?(\d{2})-?(\d{2})$/,m8=/([Z+\-])?(\d{2})?:?(\d{2})?$/,fEe=/^(\d{2})(\.\d+)?/.source+m8.source,dEe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+m8.source,mEe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+m8.source;function St(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Zn.UTC);let i=e|0;t=t+(e-i)*Qn.SECONDS_PER_DAY,ig(i,t,this),n===Zn.UTC&&W3(this)}St.fromGregorianDate=function(e,t){let n=d8(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(ig(n[0],n[1],t),W3(t),t):new St(n[0],n[1],Zn.UTC)};St.fromDate=function(e,t){let n=d8(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(ig(n[0],n[1],t),W3(t),t):new St(n[0],n[1],Zn.UTC)};St.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,r=1,o=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(uEe),n!==null)i=+n[1],r=+n[2],o=+n[3];else if(n=f.match(aEe),n!==null)i=+n[1],r=+n[2];else if(n=f.match(sEe),n!==null)i=+n[1];else{let C;if(n=f.match(cEe),n!==null)i=+n[1],C=+n[2],g=$h(i);else if(n=f.match(lEe),n!==null){i=+n[1];let A=+n[2],T=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=A*7+T-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),r=p.getUTCMonth()+1,o=p.getUTCDate()}g=$h(i);let h;if(l(d)){n=d.match(mEe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(dEe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(fEe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],A=+n[h+1],T=+(n[h+2]||0);switch(C){case"+":s=s-A,a=a-T;break;case"-":s=s+A,a=a+T;break;case"Z":break;default:a=a+new Date(Date.UTC(i,r-1,o,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,o++;for(p=g&&r===2?u8:l8[r-1];o>p;)o-=p,r++,r>12&&(r-=12,i++),p=g&&r===2?u8:l8[r-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,o--;for(;o<1;)r--,r<1&&(r+=12,i--),p=g&&r===2?u8:l8[r-1],o+=p;let b=d8(i,r,o,s,a,c,u);return l(t)?(ig(b[0],b[1],t),W3(t)):t=new St(b[0],b[1],Zn.UTC),x&&St.addSeconds(t,1,t),t};St.now=function(e){return St.fromDate(new Date,e)};var G3=new St(0,0,Zn.TAI);St.toGregorianDate=function(e,t){let n=!1,i=nZ(e,G3);l(i)||(St.addSeconds(e,-1,G3),i=nZ(G3,G3),n=!0);let r=i.dayNumber,o=i.secondsOfDay;o>=43200&&(r+=1);let s=r+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=o/Qn.SECONDS_PER_HOUR|0,h=o-g*Qn.SECONDS_PER_HOUR,x=h/Qn.SECONDS_PER_MINUTE|0;h=h-x*Qn.SECONDS_PER_MINUTE;let b=h|0,C=(h-b)/Qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=b,t.millisecond=C,t.isLeapSecond=n,t):new Zh(p,d,f,g,x,b,C,n)};St.toDate=function(e){let t=St.toGregorianDate(e,iZ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};St.toIso8601=function(e,t){let n=St.toGregorianDate(e,iZ),i=n.year,r=n.month,o=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&r===1&&o===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,r=12,o=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};St.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new St(e.dayNumber,e.secondsOfDay,Zn.TAI)};St.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};St.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};St.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(St.secondsDifference(e,t))<=n};St.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Qn.SECONDS_PER_DAY};St.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};St.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Qn.SECONDS_PER_DAY;return n+i};St.computeTaiMinusUtc=function(e){iT.julianDate=e;let t=St.leapSeconds,n=Or(t,iT,f8);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};St.addSeconds=function(e,t,n){return ig(e.dayNumber,e.secondsOfDay+t,n)};St.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_MINUTE;return ig(e.dayNumber,i,n)};St.addHours=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_HOUR;return ig(e.dayNumber,i,n)};St.addDays=function(e,t,n){let i=e.dayNumber+t;return ig(i,e.secondsOfDay,n)};St.lessThan=function(e,t){return St.compare(e,t)<0};St.lessThanOrEquals=function(e,t){return St.compare(e,t)<=0};St.greaterThan=function(e,t){return St.compare(e,t)>0};St.greaterThanOrEquals=function(e,t){return St.compare(e,t)>=0};St.prototype.clone=function(e){return St.clone(this,e)};St.prototype.equals=function(e){return St.equals(this,e)};St.prototype.equalsEpsilon=function(e,t){return St.equalsEpsilon(this,e,t)};St.prototype.toString=function(){return St.toIso8601(this)};St.leapSeconds=[new Gi(new St(2441317,43210,Zn.TAI),10),new Gi(new St(2441499,43211,Zn.TAI),11),new Gi(new St(2441683,43212,Zn.TAI),12),new Gi(new St(2442048,43213,Zn.TAI),13),new Gi(new St(2442413,43214,Zn.TAI),14),new Gi(new St(2442778,43215,Zn.TAI),15),new Gi(new St(2443144,43216,Zn.TAI),16),new Gi(new St(2443509,43217,Zn.TAI),17),new Gi(new St(2443874,43218,Zn.TAI),18),new Gi(new St(2444239,43219,Zn.TAI),19),new Gi(new St(2444786,43220,Zn.TAI),20),new Gi(new St(2445151,43221,Zn.TAI),21),new Gi(new St(2445516,43222,Zn.TAI),22),new Gi(new St(2446247,43223,Zn.TAI),23),new Gi(new St(2447161,43224,Zn.TAI),24),new Gi(new St(2447892,43225,Zn.TAI),25),new Gi(new St(2448257,43226,Zn.TAI),26),new Gi(new St(2448804,43227,Zn.TAI),27),new Gi(new St(2449169,43228,Zn.TAI),28),new Gi(new St(2449534,43229,Zn.TAI),29),new Gi(new St(2450083,43230,Zn.TAI),30),new Gi(new St(2450630,43231,Zn.TAI),31),new Gi(new St(2451179,43232,Zn.TAI),32),new Gi(new St(2453736,43233,Zn.TAI),33),new Gi(new St(2454832,43234,Zn.TAI),34),new Gi(new St(2456109,43235,Zn.TAI),35),new Gi(new St(2457204,43236,Zn.TAI),36),new Gi(new St(2457754,43237,Zn.TAI),37)];var ee=St;var AZ=Ki(Xl(),1);function hEe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xv=hEe;function uZ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=uZ(r,t)),n[i]=r}return n}var je=uZ;function fZ(e,t,n){n=y(n,!1);let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=fZ(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var gt=fZ;function pEe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Ys=pEe;var dZ=Ki(Xl(),1);function h8(e,t){let n;return typeof document<"u"&&(n=document),h8._implementation(e,t,n)}h8._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new dZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Qh=h8;var mZ=Ki(Xl(),1);function _Ee(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new mZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var bv=_Ee;var hZ=Ki(Xl(),1);function gEe(e){let t=new hZ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var S0=gEe;var pZ={};function yEe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=pZ[t];l(i)||(i={},pZ[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var sd=yEe;var xEe=/^blob:/i;function bEe(e){return xEe.test(e)}var v0=bEe;var Dm;function CEe(e){l(Dm)||(Dm=document.createElement("a")),Dm.href=window.location.href;let t=Dm.host,n=Dm.protocol;return Dm.href=e,Dm.href=Dm.href,n!==Dm.protocol||t!==Dm.host}var w0=CEe;var TEe=/^data:/i;function AEe(e){return TEe.test(e)}var ep=AEe;function EEe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var I0=EEe;function SEe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var P0=SEe;function vEe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Kl=vEe;var wEe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ni=Object.freeze(wEe);var IEe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},$o=Object.freeze(IEe);function X3(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,$o.OTHER),this.serverKey=e.serverKey,this.state=ni.UNISSUED,this.deferred=void 0,this.cancelled=!1}X3.prototype.cancel=function(){this.cancelled=!0};X3.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ni.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new X3(this)};var jr=X3;function PEe(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var Cv=PEe;function _Z(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Cv(this.responseHeaders))}_Z.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Rm=_Z;var K3=Ki(Xl(),1);function D0(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(D0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function p8(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}D0.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};D0.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,r=-1,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(p8(i,r,e),e=r):o=!1}};D0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};D0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)p8(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};D0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return p8(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var Tv=D0;function DEe(e,t){return e.priority-t.priority}var rr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},sT=20,ka=new Tv({comparator:DEe});ka.maximumLength=sT;ka.reserve(sT);var Om=[],tp={},REe=typeof document<"u"?new K3.default(document.location.href):new K3.default,J3=new _e;function qr(){}qr.maximumRequests=50;qr.maximumRequestsPerServer=6;qr.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18};qr.throttleRequests=!0;qr.debugShowStatistics=!1;qr.requestCompletedEvent=J3;Object.defineProperties(qr,{statistics:{get:function(){return rr}},priorityHeapLength:{get:function(){return sT},set:function(e){if(e<sT)for(;ka.length>e;){let t=ka.pop();R0(t)}sT=e,ka.maximumLength=e,ka.reserve(e)}}});function gZ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}qr.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(qr.requestsByServer[e],qr.maximumRequestsPerServer);return tp[e]+t<=n};qr.heapHasOpenSlots=function(e){return ka.length+e<=sT};function yZ(e){return e.state===ni.UNISSUED&&(e.state=ni.ISSUED,e.deferred=Ys()),e.deferred.promise}function OEe(e){return function(t){if(e.state===ni.CANCELLED)return;let n=e.deferred;--rr.numberOfActiveRequests,--tp[e.serverKey],J3.raiseEvent(),e.state=ni.RECEIVED,e.deferred=void 0,n.resolve(t)}}function MEe(e){return function(t){e.state!==ni.CANCELLED&&(++rr.numberOfFailedRequests,--rr.numberOfActiveRequests,--tp[e.serverKey],J3.raiseEvent(t),e.state=ni.FAILED,e.deferred.reject(t))}}function xZ(e){let t=yZ(e);return e.state=ni.ACTIVE,Om.push(e),++rr.numberOfActiveRequests,++rr.numberOfActiveRequestsEver,++tp[e.serverKey],e.requestFunction().then(OEe(e)).catch(MEe(e)),t}function R0(e){let t=e.state===ni.ACTIVE;if(e.state=ni.CANCELLED,++rr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--rr.numberOfActiveRequests,--tp[e.serverKey],++rr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}qr.update=function(){let e,t,n=0,i=Om.length;for(e=0;e<i;++e){if(t=Om[e],t.cancelled&&R0(t),t.state!==ni.ACTIVE){++n;continue}n>0&&(Om[e-n]=t)}Om.length-=n;let r=ka.internalArray,o=ka.length;for(e=0;e<o;++e)gZ(r[e]);ka.resort();let s=Math.max(qr.maximumRequests-Om.length,0),a=0;for(;a<s&&ka.length>0;){if(t=ka.pop(),t.cancelled){R0(t);continue}if(t.throttleByServer&&!qr.serverHasOpenSlots(t.serverKey)){R0(t);continue}xZ(t),++a}LEe()};qr.getServerKey=function(e){let t=new K3.default(e);t.scheme()===""&&(t=t.absoluteTo(REe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=tp[n];return l(i)||(tp[n]=0),n};qr.request=function(e){if(ep(e.url)||v0(e.url))return J3.raiseEvent(),e.state=ni.RECEIVED,e.requestFunction();if(++rr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=qr.getServerKey(e.url)),qr.throttleRequests&&e.throttleByServer&&!qr.serverHasOpenSlots(e.serverKey))return;if(!qr.throttleRequests||!e.throttle)return xZ(e);if(Om.length>=qr.maximumRequests)return;gZ(e);let t=ka.insert(e);if(l(t)){if(t===e)return;R0(t)}return yZ(e)};function LEe(){qr.debugShowStatistics&&(rr.numberOfActiveRequests===0&&rr.lastNumberOfActiveRequests>0&&(rr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${rr.numberOfAttemptedRequests}`),rr.numberOfAttemptedRequests=0),rr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${rr.numberOfCancelledRequests}`),rr.numberOfCancelledRequests=0),rr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${rr.numberOfCancelledActiveRequests}`),rr.numberOfCancelledActiveRequests=0),rr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${rr.numberOfFailedRequests}`),rr.numberOfFailedRequests=0)),rr.lastNumberOfActiveRequests=rr.numberOfActiveRequests)}qr.clearForSpecs=function(){for(;ka.length>0;){let t=ka.pop();R0(t)}let e=Om.length;for(let t=0;t<e;++t)R0(Om[t]);Om.length=0,tp={},rr.numberOfAttemptedRequests=0,rr.numberOfActiveRequests=0,rr.numberOfCancelledRequests=0,rr.numberOfCancelledActiveRequests=0,rr.numberOfFailedRequests=0,rr.numberOfActiveRequestsEver=0,rr.lastNumberOfActiveRequests=0};qr.numberOfActiveRequestsByServer=function(e){return tp[e]};qr.requestHeap=ka;var Ua=qr;var bZ=Ki(Xl(),1);var Av={},aT={};Av.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(aT[n])||(aT[n]=!0)};Av.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(aT[n])&&delete aT[n]};function NEe(e){let t=new bZ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}Av.contains=function(e){let t=NEe(e);return!!(l(t)&&l(aT[t]))};Av.clear=function(){aT={}};var cT=Av;var EZ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Et(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Mm(e.templateValues,{}),this._queryParameters=Mm(e.queryParameters,{}),this.headers=Mm(e.headers,{}),this.request=y(e.request,new jr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Mm(e,t){return l(e)?je(e):t}Et.createIfNeeded=function(e){return e instanceof Et?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Et({url:e})};var lT;Et.supportsImageBitmapOptions=function(){if(l(lT))return lT;if(typeof createImageBitmap!="function")return lT=Promise.resolve(!1),lT;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return lT=Et.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=sd(t[0]),i=sd(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),lT};Object.defineProperties(Et,{isBlobSupported:{get:function(){return EZ}}});Object.defineProperties(Et.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return S0(this._url)}},isDataUri:{get:function(){return ep(this._url)}},isBlobUri:{get:function(){return v0(this._url)}},isCrossOriginUrl:{get:function(){return w0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Et.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Et.prototype.parseUrl=function(e,t,n,i){let r=new AZ.default(e),o=FEe(r.query());this._queryParameters=t?$3(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Qh(i))),this._url=r.toString()};function FEe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Kl(e)}function $3(e,t,n){if(!n)return gt(e,t);let i=je(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}Et.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${BEe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function BEe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${P0(e)}`}Et.prototype.setQueryParameters=function(e,t){t?this._queryParameters=$3(this._queryParameters,e,!1):this._queryParameters=$3(e,this._queryParameters,!1)};Et.prototype.appendQueryParameters=function(e){this._queryParameters=$3(e,this._queryParameters,!0)};Et.prototype.setTemplateValues=function(e,t){t?this._templateValues=gt(this._templateValues,e):this._templateValues=gt(e,this._templateValues)};Et.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=gt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=gt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=gt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Et.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Et.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=je(this._queryParameters),e._templateValues=je(this._templateValues),e.headers=je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Et({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Et.prototype.getBaseUri=function(e){return bv(this.getUrlComponent(e),e)};Et.prototype.appendForwardSlash=function(){this._url=xv(this._url)};Et.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Et.fetchArrayBuffer=function(e){return new Et(e).fetchArrayBuffer()};Et.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Et.fetchBlob=function(e){return new Et(e).fetchBlob()};Et.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1);if(g8(this.request),!EZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return _8({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return Et.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return Et.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new Et({url:d}),_8({resource:c,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function _8(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Ys();return Et._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Ua.request(o);if(l(s))return s.catch(function(a){return o.state!==ni.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=ni.UNISSUED,o.deferred=void 0,_8({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})}Et.fetchImage=function(e){return new Et(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Et.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Et.fetchText=function(e){return new Et(e).fetchText()};Et.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Et.fetchJson=function(e){return new Et(e).fetchJson()};Et.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Et.fetchXML=function(e){return new Et(e).fetchXML()};Et.prototype.fetchJsonp=function(e){e=y(e,"callback"),g8(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return SZ(this,e,t)};function SZ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=Ys();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Et._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=Ua.request(r);if(l(s))return s.catch(function(a){return r.state!==ni.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=ni.UNISSUED,r.deferred=void 0,SZ(e,t,n)):Promise.reject(a)})})}Et.fetchJsonp=function(e){return new Et(e).fetchJsonp(e.callbackParameterName)};Et.prototype._makeRequest=function(e){let t=this;g8(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=gt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Ys(),d=Et._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=Ua.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==ni.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=ni.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function g8(e){if(e.state===ni.ISSUED||e.state===ni.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ni.UNISSUED,e.deferred=void 0}var kEe=/^data:(.*?)(;base64)?,(.*)$/;function Z3(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function CZ(e,t){let n=Z3(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function UEe(e,t){t=y(t,"");let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return Z3(i,r);case"arraybuffer":return CZ(i,r);case"blob":return o=CZ(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(Z3(i,r),n);case"json":return JSON.parse(Z3(i,r));default:}}Et.prototype.fetch=function(e){return e=Mm(e,{}),e.method="GET",this._makeRequest(e)};Et.fetch=function(e){return new Et(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.delete=function(e){return e=Mm(e,{}),e.method="DELETE",this._makeRequest(e)};Et.delete=function(e){return new Et(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Et.prototype.head=function(e){return e=Mm(e,{}),e.method="HEAD",this._makeRequest(e)};Et.head=function(e){return new Et(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.options=function(e){return e=Mm(e,{}),e.method="OPTIONS",this._makeRequest(e)};Et.options=function(e){return new Et(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.post=function(e,t){return ol.defined("data",e),t=Mm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Et.post=function(e){return new Et(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.put=function(e,t){return ol.defined("data",e),t=Mm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Et.put=function(e){return new Et(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.patch=function(e,t){return ol.defined("data",e),t=Mm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Et.patch=function(e){return new Et(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et._Implementations={};Et._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(cT.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Et._Implementations.createImage=function(e,t,n,i,r,o){let s=e.url;Et.supportsImageBitmapOptions().then(function(a){if(!(a&&o)){Et._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=Ys(),d=Et._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new de(`Successfully retrieved ${s} but it contained no content.`));return}return Et.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Et.createImageBitmapFromBlob=function(e,t){return ol.defined("options",t),ol.typeOf.bool("options.flipY",t.flipY),ol.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),ol.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function TZ(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function VEe(e,t,n,i,r,o,s){let a,c;Promise.all([import("url"),import("zlib")]).then(([u,f])=>(a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:r};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){o.reject(new Rm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,x){h?o.reject(new de("Error decompressing response.")):o.resolve(TZ(x,t))}):o.resolve(TZ(g,t))})}).on("error",function(d){o.reject(new Rm)}).end()})}var zEe=typeof XMLHttpRequest>"u";Et._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=kEe.exec(e);if(a!==null){o.resolve(UEe(a,t));return}if(zEe){VEe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(cT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new Rm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(x){let b=x.split(": "),C=b.shift();h[C]=b.join(": ")}),o.resolve(h);return}if(c.status===204)o.resolve();else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new Rm)},c.send(i),c};Et._Implementations.loadAndExecuteScript=function(e,t,n){return I0(e,t).catch(function(i){n.reject(i)})};Et._DefaultImplementations={};Et._DefaultImplementations.createImage=Et._Implementations.createImage;Et._DefaultImplementations.loadWithXhr=Et._Implementations.loadWithXhr;Et._DefaultImplementations.loadAndExecuteScript=Et._Implementations.loadAndExecuteScript;Et.DEFAULT=Object.freeze(new Et({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ie=Et;function Sv(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?vZ(this,e.data):vZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Sv.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ie.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Sv({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};Sv.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ng(0,0,0,0,0),t}});Sv.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new ng(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r=0,o=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,IZ(this,n,this._samples,e,r,o,t),t}let s=Or(n,e,ee.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,IZ(this,n,this._samples,e,r,o,t),t};function HEe(e,t){return ee.compare(e.julianDate,t)}function vZ(e,t){if(!l(t.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,h=u.length;g<h;g+=e._columnCount){let x=u[g+n],b=u[g+c],C=x+Qn.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new ee(C,b,Zn.TAI);if(f.push(A),p){if(b!==d&&l(d)){let T=ee.leapSeconds,S=Or(T,A,HEe);if(S<0){let v=new Gi(A,b);T.splice(~S,0,v)}}d=b}}}function wZ(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function Ev(e,t,n){return t+e*(n-t)}function IZ(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return wZ(e,n,r,a,s),s;if(i.equals(u))return wZ(e,n,o,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],x=h-g;if(x>.5||x<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];b!==C&&(u.equals(i)?g=h:h-=C-b)}return s.xPoleWander=Ev(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=Ev(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Ev(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Ev(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Ev(f,g,h),s}var vv=Sv;function Va(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Va.fromQuaternion=function(e,t){l(t)||(t=new Va);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-D.asinClamped(n),t};Va.fromDegrees=function(e,t,n,i){return l(i)||(i=new Va),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Va.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Va(e.heading,e.pitch,e.roll)};Va.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Va.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Va.prototype.clone=function(e){return Va.clone(this,e)};Va.prototype.equals=function(e){return Va.equals(this,e)};Va.prototype.equalsEpsilon=function(e,t,n){return Va.equalsEpsilon(this,e,t,n)};Va.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var za=Va;var PZ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function GEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=PZ.exec(i);if(r!==null)return r[1]}}var uT;function DZ(e){return typeof document>"u"?e:(l(uT)||(uT=document.createElement("a")),uT.href=e,uT.href=uT.href,uT.href)}var O0;function RZ(){if(l(O0))return O0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Qh("..",M0("Core/buildModuleUrl.js")):e=GEe(),O0=new Ie({url:DZ(e)}),O0.appendForwardSlash(),O0}function WEe(e){return DZ(require.toUrl(`../${e}`))}function OZ(e){return RZ().getDerivedResource({url:e}).url}var Q3;function M0(e){return l(Q3)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Q3=WEe:Q3=OZ),Q3(e)}M0._cesiumScriptRegex=PZ;M0._buildModuleUrlFromBaseUrl=OZ;M0._clearBaseResource=function(){O0=void 0};M0.setBaseUrl=function(e){O0=Ie.DEFAULT.getDerivedResource({url:e})};M0.getCesiumBaseUrl=RZ;var tn=M0;function jEe(e,t,n){this.x=e,this.y=t,this.s=n}var L0=jEe;function b8(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ie.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Zn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var qEe=new ee(0,0,Zn.TAI);function y8(e,t,n){let i=qEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}b8.prototype.preload=function(e,t,n,i){let r=y8(this,e,t),o=y8(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(x8(this,d));return Promise.all(f)};b8.prototype.computeXysRadians=function(e,t,n){let i=y8(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(x8(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(x8(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new L0(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,x,b;for(x=0;x<=o;++x)d[x]=f-h[x];for(x=0;x<=o;++x){for(g[x]=1,b=0;b<=o;++b)b!==x&&(g[x]*=d[b]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*u[C++],n.y+=g[x]*u[C++],n.s+=g[x]*u[C]}return n};function x8(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ie({url:tn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=n.fetchJson().then(function(o){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=o.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=r,r}var wv=b8;var Ji={},C8={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},fT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},T8={},al={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},rg=new m,og=new m,sg=new m;Ji.localFrameToFixedFrameGenerator=function(e,t){if(!C8.hasOwnProperty(e)||!C8[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=C8[e][t],i,r=e+t;return l(T8[r])?i=T8[r]:(i=function(o,s,a){if(l(a)||(a=new F),m.equalsEpsilon(o,m.ZERO,D.EPSILON14))m.unpack(fT[e],0,rg),m.unpack(fT[t],0,og),m.unpack(fT[n],0,sg);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);m.unpack(fT[e],0,rg),e!=="east"&&e!=="west"&&m.multiplyByScalar(rg,c,rg),m.unpack(fT[t],0,og),t!=="east"&&t!=="west"&&m.multiplyByScalar(og,c,og),m.unpack(fT[n],0,sg),n!=="east"&&n!=="west"&&m.multiplyByScalar(sg,c,sg)}else{s=y(s,re.WGS84),s.geodeticSurfaceNormal(o,al.up);let c=al.up,u=al.east;u.x=-o.y,u.y=o.x,u.z=0,m.normalize(u,al.east),m.cross(c,u,al.north),m.multiplyByScalar(al.up,-1,al.down),m.multiplyByScalar(al.east,-1,al.west),m.multiplyByScalar(al.north,-1,al.south),rg=al[e],og=al[t],sg=al[n]}return a[0]=rg.x,a[1]=rg.y,a[2]=rg.z,a[3]=0,a[4]=og.x,a[5]=og.y,a[6]=og.z,a[7]=0,a[8]=sg.x,a[9]=sg.y,a[10]=sg.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},T8[r]=i),i};Ji.eastNorthUpToFixedFrame=Ji.localFrameToFixedFrameGenerator("east","north");Ji.northEastDownToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","east");Ji.northUpEastToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","up");Ji.northWestUpToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","west");var YEe=new Ne,XEe=new m(1,1,1),KEe=new F;Ji.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=y(i,Ji.eastNorthUpToFixedFrame);let o=Ne.fromHeadingPitchRoll(t,YEe),s=F.fromTranslationQuaternionRotationScale(m.ZERO,o,XEe,KEe);return r=i(e,n,r),F.multiply(r,s,r)};var JEe=new F,ZEe=new $;Ji.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ji.headingPitchRollToFixedFrame(e,t,n,i,JEe),s=F.getMatrix3(o,ZEe);return Ne.fromRotationMatrix(s,r)};var $Ee=new m(1,1,1),QEe=new m,MZ=new F,eSe=new F,tSe=new $,nSe=new Ne;Ji.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,Ji.eastNorthUpToFixedFrame),l(i)||(i=new za);let r=F.getTranslation(e,QEe);if(m.equals(r,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=F.inverseTransformation(n(r,t,MZ),MZ),s=F.setScale(e,$Ee,eSe);s=F.setTranslation(s,m.ZERO,s),o=F.multiply(o,s,o);let a=Ne.fromRotationMatrix(F.getMatrix3(o,tSe),nSe);return a=Ne.normalize(a,a),za.fromQuaternion(a,i)};var iSe=6*3600+41*60+50.54841,rSe=8640184812866e-6,oSe=.093104,sSe=-62e-7,aSe=11772758384668e-32,cSe=72921158553e-15,lSe=D.TWO_PI/86400,ek=new ee;Ji.computeTemeToPseudoFixedMatrix=function(e,t){ek=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),ek);let n=ek.dayNumber,i=ek.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Qn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Qn.DAYS_PER_JULIAN_CENTURY;let a=(iSe+r*(rSe+r*(oSe+r*sSe)))*lSe%D.TWO_PI,c=cSe+aSe*(n-24515455e-1),u=(i+Qn.SECONDS_PER_DAY*.5)%Qn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};Ji.iau2006XysData=new wv;Ji.earthOrientationParameters=vv.NONE;var S8=32.184,uSe=2451545;Ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+S8,i=e.stop.dayNumber,r=e.stop.secondsOfDay+S8;return Ji.iau2006XysData.preload(t,n,i,r)};Ji.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ji.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var fSe=new L0(0,0,0),dSe=new ng(0,0,0,0,0,0),A8=new $,E8=new $;Ji.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ji.earthOrientationParameters.compute(e,dSe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+S8,o=Ji.iau2006XysData.computeXysRadians(i,r,fSe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=A8;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,E8),d=$.multiply(u,f,A8),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,x=g/Qn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(h+x);b=b%1*D.TWO_PI;let C=$.fromRotationZ(b,E8),A=$.multiply(d,C,A8),T=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),O=i-uSe+r/Qn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*D.RADIANS_PER_DEGREE/3600,L=Math.cos(R),N=Math.sin(R),_=E8;return _[0]=T*L,_[1]=T*N,_[2]=v,_[3]=-S*N+I*v*L,_[4]=S*L+I*v*N,_[5]=-I*T,_[6]=-I*N-S*v*L,_[7]=I*L-S*v*N,_[8]=S*T,$.multiply(A,_,t)};var mSe=new oe;Ji.pointToWindowCoordinates=function(e,t,n,i){return i=Ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ji.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let r=mSe;return F.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,r),r),oe.multiplyByScalar(r,1/r.w,r),F.multiplyByVector(t,r,r),H.fromCartesian4(r,i)};var hSe=new m,pSe=new m,_Se=new m;Ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=y(n,re.WGS84).geodeticSurfaceNormal(e,hSe),o=m.cross(t,r,pSe);m.equalsEpsilon(o,m.ZERO,D.EPSILON6)&&(o=m.clone(m.UNIT_X,o));let s=m.cross(o,t,_Se);return m.normalize(s,s),m.cross(t,s,o),m.negate(o,o),m.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var LZ=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),NZ=new me,FZ=new m,gSe=new m,ySe=new $,v8=new F,BZ=new F;Ji.basisTo2D=function(e,t,n){let i=F.getTranslation(t,gSe),r=e.ellipsoid,o=r.cartesianToCartographic(i,NZ),s=e.project(o,FZ);m.fromElements(s.z,s.x,s.y,s);let a=Ji.eastNorthUpToFixedFrame(i,r,v8),c=F.inverseTransformation(a,BZ),u=F.getMatrix3(t,ySe),f=F.multiplyByMatrix3(c,u,n);return F.multiply(LZ,f,n),F.setTranslation(n,s,n),n};Ji.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ji.eastNorthUpToFixedFrame(t,i,v8),o=F.inverseTransformation(r,BZ),s=i.cartesianToCartographic(t,NZ),a=e.project(s,FZ);m.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,v8);return F.multiply(LZ,o,n),F.multiply(c,n,n),n};var Mt=Ji;function w8(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Le.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Yu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}w8.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var xSe=new me,bSe=new m,kZ=new F,CSe=[new me,new me,new me],TSe=[new H,new H,new H],ASe=[new H,new H,new H],ESe=new m,SSe=new Ne,vSe=new F,wSe=new ir;w8._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ce.center(i,xSe),s=me.toCartesian(o,n,bSe),a=Mt.eastNorthUpToFixedFrame(s,n,kZ),c=F.inverse(a,kZ),u=TSe,f=CSe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=ESe;for(r=0;r<3;r++)me.toCartesian(f[r],n,d),d=F.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Ne.fromAxisAngle(m.UNIT_Z,-t,SSe),g=$.fromQuaternion(p,vSe),h=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(r=0;r<h;r++)d=F.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),x=Math.min(x,d.x),b=Math.min(b,d.y),C=Math.max(C,d.x),A=Math.max(A,d.y);let T=ir.fromRotation(t,wSe),S=ASe;S[0].x=x,S[0].y=b,S[1].x=x,S[1].y=A,S[2].x=C,S[2].y=b;let v=u[0],I=u[2].x-v.x,O=u[1].y-v.y;for(r=0;r<3;r++){let E=S[r];ir.multiplyByVector(T,E,E),E.x=(E.x-v.x)/I,E.y=(E.y-v.y)/O}let R=S[0],L=S[1],N=S[2],_=new Array(6);return H.pack(R,_),H.pack(L,_,2),H.pack(N,_,4),_};var ft=w8;function ISe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var De=ISe;function PSe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var pn=PSe;var DSe={NONE:0,TOP:1,ALL:2},sn=Object.freeze(DSe);function Qo(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}Qo.POSITION_ONLY=Object.freeze(new Qo({position:!0}));Qo.POSITION_AND_NORMAL=Object.freeze(new Qo({position:!0,normal:!0}));Qo.POSITION_NORMAL_AND_ST=Object.freeze(new Qo({position:!0,normal:!0,st:!0}));Qo.POSITION_AND_ST=Object.freeze(new Qo({position:!0,st:!0}));Qo.POSITION_AND_COLOR=Object.freeze(new Qo({position:!0,color:!0}));Qo.ALL=Object.freeze(new Qo({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Qo.DEFAULT=Qo.POSITION_NORMAL_AND_ST;Qo.packedLength=6;Qo.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Qo.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qo),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Qo.clone=function(e,t){if(l(e))return l(t)||(t=new Qo),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Oe=Qo;var RSe=new m;function Jl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Oe.DEFAULT);this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Jl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Jl({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Jl.fromAxisAlignedBoundingBox=function(e){return new Jl({minimum:e.minimum,maximum:e.maximum})};Jl.packedLength=2*m.packedLength+Oe.packedLength+1;Jl.pack=function(e,t,n){return n=y(n,0),m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Oe.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Oe.packedLength]=y(e._offsetAttribute,-1),t};var VZ=new m,zZ=new m,HZ=new Oe,UZ={minimum:VZ,maximum:zZ,vertexFormat:HZ,offsetAttribute:void 0};Jl.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,VZ),r=m.unpack(e,t+m.packedLength,zZ),o=Oe.unpack(e,t+2*m.packedLength,HZ),s=e[t+2*m.packedLength+Oe.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(r,n._maximum),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(UZ.offsetAttribute=s===-1?void 0:s,new Jl(UZ))};Jl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let r=new pn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(6*2*3),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=4+2,o[7]=4+1,o[8]=4+0,o[9]=4+3,o[10]=4+2,o[11]=4+0,o[12]=8+0,o[13]=8+1,o[14]=8+2,o[15]=8+0,o[16]=8+2,o[17]=8+3,o[18]=12+2,o[19]=12+1,o[20]=12+0,o[21]=12+3,o[22]=12+2,o[23]=12+0,o[24]=16+2,o[25]=16+1,o[26]=16+0,o[27]=16+3,o[28]=16+2,o[29]=16+0,o[30]=20+0,o[31]=20+1,o[32]=20+2,o[33]=20+0,o[34]=20+2,o[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(6*2*3),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=m.subtract(n,t,RSe),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===sn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new ft({attributes:r,indices:o,primitiveType:Le.TRIANGLES,boundingSphere:new ae(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var I8;Jl.getUnitBox=function(){return l(I8)||(I8=Jl.createGeometry(Jl.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Oe.POSITION_ONLY}))),I8};var cl=Jl;var OSe=new m;function Lm(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Lm.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Lm({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};Lm.fromAxisAlignedBoundingBox=function(e){return new Lm({minimum:e.minimum,maximum:e.maximum})};Lm.packedLength=2*m.packedLength+1;Lm.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var WZ=new m,jZ=new m,GZ={minimum:WZ,maximum:jZ,offsetAttribute:void 0};Lm.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,WZ),r=m.unpack(e,t+m.packedLength,jZ),o=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(GZ.offsetAttribute=o===-1?void 0:o,new Lm(GZ))};Lm.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new pn,r=new Uint16Array(12*2),o=new Float64Array(8*3);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=m.subtract(n,t,OSe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===sn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ft({attributes:i,indices:r,primitiveType:Le.LINES,boundingSphere:new ae(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var ad=Lm;function dT(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(dT.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});dT.fromColor=function(e){return new dT(e.red,e.green,e.blue,e.alpha)};dT.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};dT.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var zt=dT;function Iv(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(Iv.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});Iv.fromDistanceDisplayCondition=function(e){return new Iv(e.near,e.far)};Iv.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Hn=Iv;function MSe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Ct=MSe;function Yr(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?ee.clone(e.start):new ee,this.stop=l(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(Yr.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var mT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Yr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(mT.start=i,mT.stop=r,mT.isStartIncluded=o,mT.isStopIncluded=s,mT.data=a,new Yr(mT))};Yr.toIso8601=function(e,t){return`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};Yr.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Yr(e)};Yr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Yr.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Yr.intersect=function(e,t,n,i){if(!l(t))return Yr.clone(Yr.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=ee.greaterThanOrEquals(s,r)&&ee.greaterThanOrEquals(o,s),u=!c&&ee.lessThanOrEquals(s,r)&&ee.lessThanOrEquals(r,a);if(!c&&!u)return Yr.clone(Yr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,h=ee.lessThan(o,a);return l(n)||(n=new Yr),n.start=c?s:r,n.isStartIncluded=f&&p||!ee.equals(s,r)&&(c&&p||u&&f),n.stop=h?o:a,n.isStopIncluded=h?d:d&&g||!ee.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Yr.contains=function(e,t){if(e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Yr.prototype.clone=function(e){return Yr.clone(this,e)};Yr.prototype.equals=function(e,t){return Yr.equals(this,e,t)};Yr.prototype.equalsEpsilon=function(e,t,n){return Yr.equalsEpsilon(this,e,t,n)};Yr.prototype.toString=function(){return Yr.toIso8601(this)};Yr.EMPTY=Object.freeze(new Yr({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var An=Yr;var qZ=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),YZ=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),LSe=Object.freeze(new An({start:qZ,stop:YZ})),NSe={MINIMUM_VALUE:qZ,MAXIMUM_VALUE:YZ,MAXIMUM_INTERVAL:LSe},Ve=NSe;function Pv(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(Pv.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});Pv.fromCartesian3=function(e){return new Pv(e.x,e.y,e.z)};Pv.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Zi=Pv;function tk(e){e=y(e,!0),this.value=tk.toValue(e)}Object.defineProperties(tk.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});tk.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=tk;var Dv=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; -out vec2 v_textureCoordinates; +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -void main() + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = tangentToEyeMatrix; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var Rv=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; + +void main() { - gl_Position = position; - v_textureCoordinates = textureCoordinates; + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_tangentEC = czm_normal * tangent; // tangent in eye coordinates + v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var po={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function lv(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Be.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ua(e,t){return(e._flags&t)===t}function Z_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(lv.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ua(this,po.CULL)},set:function(e){Ua(this,po.CULL)!==e&&(Z_(this,po.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ua(this,po.OCCLUDE)},set:function(e){Ua(this,po.OCCLUDE)!==e&&(Z_(this,po.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ua(this,po.CAST_SHADOWS)},set:function(e){Ua(this,po.CAST_SHADOWS)!==e&&(Z_(this,po.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ua(this,po.RECEIVE_SHADOWS)},set:function(e){Ua(this,po.RECEIVE_SHADOWS)!==e&&(Z_(this,po.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ua(this,po.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ua(this,po.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Z_(this,po.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ua(this,po.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ua(this,po.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Z_(this,po.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Ua(this,po.PICK_ONLY)},set:function(e){Ua(this,po.PICK_ONLY)!==e&&(Z_(this,po.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ua(this,po.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ua(this,po.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Z_(this,po.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});lv.shallowClone=function(e,t){if(u(e))return u(t)||(t=new lv),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};lv.prototype.execute=function(e,t){e.draw(this,t)};var et=lv;var Pi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Pi.toWebGLConstant=function(e,t){switch(e){case Pi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Pi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Pi.UNSIGNED_INT:return te.UNSIGNED_INT;case Pi.FLOAT:return te.FLOAT;case Pi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Pi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Pi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Pi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Pi.UNSIGNED_SHORT_5_6_5:return Pi.UNSIGNED_SHORT_5_6_5}};Pi.isPacked=function(e){return e===Pi.UNSIGNED_INT_24_8||e===Pi.UNSIGNED_SHORT_4_4_4_4||e===Pi.UNSIGNED_SHORT_5_5_5_1||e===Pi.UNSIGNED_SHORT_5_6_5};Pi.sizeInBytes=function(e){switch(e){case Pi.UNSIGNED_BYTE:return 1;case Pi.UNSIGNED_SHORT:case Pi.UNSIGNED_SHORT_4_4_4_4:case Pi.UNSIGNED_SHORT_5_5_5_1:case Pi.UNSIGNED_SHORT_5_6_5:case Pi.HALF_FLOAT:return 2;case Pi.UNSIGNED_INT:case Pi.FLOAT:case Pi.UNSIGNED_INT_24_8:return 4}};Pi.validate=function(e){return e===Pi.UNSIGNED_BYTE||e===Pi.UNSIGNED_SHORT||e===Pi.UNSIGNED_INT||e===Pi.FLOAT||e===Pi.HALF_FLOAT||e===Pi.UNSIGNED_INT_24_8||e===Pi.UNSIGNED_SHORT_4_4_4_4||e===Pi.UNSIGNED_SHORT_5_5_5_1||e===Pi.UNSIGNED_SHORT_5_6_5};var Ke=Object.freeze(Pi);var st={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let r=st.componentsLength(e);return Ke.isPacked(t)&&(r=1),r*Ke.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let r,o=Ke.sizeInBytes(t);o===Uint8Array.BYTES_PER_ELEMENT?r=Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?r=Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===Ke.FLOAT?r=Float32Array:r=Uint32Array;let s=st.componentsLength(e)*n*i;return new r(s)};st.flipY=function(e,t,n,i,r){if(r===1)return e;let o=st.createTypedArray(t,n,i,r),s=st.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let l=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[l+d]}return o};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===Ke.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Ke.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Ke.FLOAT)switch(e){case st.RGBA:return te.RGBA32F;case st.RGB:return te.RGB32F;case st.RG:return te.RG32F;case st.RED:return te.R32F}if(t===Ke.HALF_FLOAT)switch(e){case st.RGBA:return te.RGBA16F;case st.RGB:return te.RGB16F;case st.RG:return te.RG16F;case st.RED:return te.R16F}return e};var at=Object.freeze(st);var _o={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(_o,{maximumCombinedTextureImageUnits:{get:function(){return _o._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return _o._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return _o._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return _o._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return _o._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return _o._maximumTextureSize}},maximumVaryingVectors:{get:function(){return _o._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return _o._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return _o._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return _o._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return _o._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return _o._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return _o._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return _o._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return _o._maximumViewportWidth}},maximumViewportHeight:{get:function(){return _o._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return _o._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return _o._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return _o._maximumColorAttachments}},maximumSamples:{get:function(){return _o._maximumSamples}},highpFloatSupported:{get:function(){return _o._highpFloatSupported}},highpIntSupported:{get:function(){return _o._highpIntSupported}}});var Ht=_o;function IG(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function L3(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function id(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ht.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0);let r=u(e.depthTexture)||u(e.depthRenderbuffer),o=u(e.depthStencilTexture)||u(e.depthStencilRenderbuffer);this._bind();let s,a,c,l,f;if(u(e.colorTextures)){let d=e.colorTextures;for(l=this._colorTextures.length=this._activeColorAttachments.length=d.length,c=0;c<l;++c)s=d[c],f=this._gl.COLOR_ATTACHMENT0+c,IG(this,f,s),this._activeColorAttachments[c]=f,this._colorTextures[c]=s}if(u(e.colorRenderbuffers)){let d=e.colorRenderbuffers;for(l=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length,c=0;c<l;++c)a=d[c],f=this._gl.COLOR_ATTACHMENT0+c,L3(this,f,a),this._activeColorAttachments[c]=f,this._colorRenderbuffers[c]=a}u(e.depthTexture)&&(s=e.depthTexture,IG(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),u(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,L3(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),u(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,L3(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),u(e.depthStencilTexture)&&(s=e.depthStencilTexture,IG(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),u(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,L3(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(id.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});id.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};id.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};id.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};id.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};id.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};id.prototype.getColorTexture=function(e){return this._colorTextures[e]};id.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};id.prototype.isDestroyed=function(){return!1};id.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let r=t[e];u(r)&&r.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let r=i[e];u(r)&&r.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var Ys=id;var N3={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};N3.validate=function(e){return e===N3.CLOCKWISE||e===N3.COUNTER_CLOCKWISE};var Qo=Object.freeze(N3);function NJ(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=NJ(e[t]));return Object.freeze(e)}var PG=NJ;function Pm(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),r=y(t.scissorTest,y.EMPTY_OBJECT),o=y(r.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),l=y(t.blending,y.EMPTY_OBJECT),f=y(l.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),h=y(t.sampleCoverage,y.EMPTY_OBJECT),A=t.viewport;this.frontFace=y(t.frontFace,Qo.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(r.enabled,!1),rectangle:Ye.clone(o)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(l.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(l.equationRgb,te.FUNC_ADD),equationAlpha:y(l.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(l.functionSourceRgb,te.ONE),functionSourceAlpha:y(l.functionSourceAlpha,te.ONE),functionDestinationRgb:y(l.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(l.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(h.enabled,!1),value:y(h.value,1),invert:y(h.invert,!1)},this.viewport=u(A)?new Ye(A.x,A.y,A.width,A.height):void 0,this.id=0,this._applyFunctions=[]}var pTe=0,Im={};Pm.fromCache=function(e){let t=JSON.stringify(e),n=Im[t];if(u(n))return++n.referenceCount,n.state;let i=new Pm(e),r=JSON.stringify(i);return n=Im[r],u(n)||(i.id=pTe++,n={referenceCount:0,state:i},Im[r]=n),++n.referenceCount,Im[t]={referenceCount:1,state:n.state},n.state};Pm.removeFromCache=function(e){let t=new Pm(e),n=JSON.stringify(t),i=Im[n],r=JSON.stringify(e),o=Im[r];u(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Im[r],u(i)&&--i.referenceCount)),u(i)&&i.referenceCount===0&&delete Im[n]};Pm.getCache=function(){return Im};Pm.clearCache=function(){Im={}};function E0(e,t,n){n?e.enable(t):e.disable(t)}function FJ(e,t){e.frontFace(t.frontFace)}function UJ(e,t){let n=t.cull,i=n.enabled;E0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function VJ(e,t){e.lineWidth(t.lineWidth)}function kJ(e,t){let n=t.polygonOffset,i=n.enabled;E0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function zJ(e,t,n){let i=t.scissorTest,r=u(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(E0(e,e.SCISSOR_TEST,r),r){let o=u(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function HJ(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function GJ(e,t){let n=t.depthTest,i=n.enabled;E0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function WJ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function jJ(e,t){e.depthMask(t.depthMask)}function qJ(e,t){e.stencilMask(t.stencilMask)}function _Te(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function YJ(e,t,n){let i=t.blending,r=u(n.blendingEnabled)?n.blendingEnabled:i.enabled;E0(e,e.BLEND,r),r&&(_Te(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function XJ(e,t){let n=t.stencilTest,i=n.enabled;if(E0(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,l=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,l,f,d);let p=n.backOperation,g=p.fail,h=p.zFail,A=p.zPass;e.stencilOpSeparate(e.BACK,g,h,A)}}function KJ(e,t){let n=t.sampleCoverage,i=n.enabled;E0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var gTe=new Ye;function JJ(e,t,n){let i=y(t.viewport,n.viewport);u(i)||(i=gTe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Pm.apply=function(e,t,n){FJ(e,t),UJ(e,t),VJ(e,t),kJ(e,t),HJ(e,t),GJ(e,t),WJ(e,t),jJ(e,t),qJ(e,t),XJ(e,t),KJ(e,t),zJ(e,t,n),YJ(e,t,n),JJ(e,t,n)};function yTe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(FJ),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(UJ),e.lineWidth!==t.lineWidth&&n.push(VJ),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(kJ),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(HJ),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(GJ),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(WJ),e.depthMask!==t.depthMask&&n.push(jJ),e.stencilMask!==t.stencilMask&&n.push(qJ),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(XJ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(KJ),n}Pm.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];u(f)||(f=yTe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=u(i.scissorTest)?i.scissorTest:t.scissorTest,a=u(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&zJ(e,n,r);let c=u(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,l=u(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==l||l&&t.blending!==n.blending)&&YJ(e,n,r),(t!==n||i!==r||i.context!==r.context)&&JJ(e,n,r)};Pm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ye.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:u(e.viewport)?Ye.clone(e.viewport):void 0}};var Ve=Pm;function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;u(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Xt.pack(e[r],t,r*4);return t};Xt.unpackArray=function(e,t){let n=e.length;u(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=Xt.unpack(e,i,t[r])}return t};Xt.clone=function(e,t){if(u(e))return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return u(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return u(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return u(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return u(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,r=e[i],o=e[i+1];return n.x=r,n.y=o,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let r=t*2;return i[r]=n.x,i[r+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],r=e[t+2];return n.x=i,n.y=r,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var ATe=new H;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,ATe),r=t.x/i.x,o=t.y/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var xTe=new H;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,xTe),r=t/i.x,o=t/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var ZJ=new H;Xt.getScale=function(e,t){return t.x=H.magnitude(H.fromElements(e[0],e[1],ZJ)),t.y=H.magnitude(H.fromElements(e[2],e[3],ZJ)),t};var QJ=new H;Xt.getMaximumScale=function(e){return Xt.getScale(e,QJ),H.maximumComponent(QJ)};var CTe=new H;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,CTe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var TTe=new H;Xt.getRotation=function(e,t){let n=Xt.getScale(e,TTe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],r=e[1],o=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||u(e)&&u(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var ir=Xt;function ETe(e,t,n,i){switch(t.type){case e.FLOAT:return new $J(e,t,n,i);case e.FLOAT_VEC2:return new eZ(e,t,n,i);case e.FLOAT_VEC3:return new tZ(e,t,n,i);case e.FLOAT_VEC4:return new nZ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new OG(e,t,n,i);case e.INT:case e.BOOL:return new iZ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new rZ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new oZ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new sZ(e,t,n,i);case e.FLOAT_MAT2:return new aZ(e,t,n,i);case e.FLOAT_MAT3:return new cZ(e,t,n,i);case e.FLOAT_MAT4:return new lZ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function $J(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}$J.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function eZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}eZ.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function tZ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}tZ.prototype.set=function(){let e=this.value;e&&(u(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):u(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function nZ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}nZ.prototype.set=function(){let e=this.value;u(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):u(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function OG(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}OG.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};OG.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function iZ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}iZ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function rZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}rZ.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function oZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}oZ.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function sZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}sZ.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var bTe=new Float32Array(4);function aZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new ir,this._gl=e,this._location=i}aZ.prototype.set=function(){if(!ir.equalsArray(this.value,this._value,0)){ir.clone(this.value,this._value);let e=ir.toArray(this.value,bTe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var STe=new Float32Array(9);function cZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new Q,this._gl=e,this._location=i}cZ.prototype.set=function(){if(!Q.equalsArray(this.value,this._value,0)){Q.clone(this.value,this._value);let e=Q.toArray(this.value,STe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var vTe=new Float32Array(16);function lZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new N,this._gl=e,this._location=i}lZ.prototype.set=function(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);let e=N.toArray(this.value,vTe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var uv=ETe;function wTe(e,t,n,i){switch(t.type){case e.FLOAT:return new uZ(e,t,n,i);case e.FLOAT_VEC2:return new fZ(e,t,n,i);case e.FLOAT_VEC3:return new dZ(e,t,n,i);case e.FLOAT_VEC4:return new mZ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new MG(e,t,n,i);case e.INT:case e.BOOL:return new hZ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new pZ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _Z(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new gZ(e,t,n,i);case e.FLOAT_MAT2:return new yZ(e,t,n,i);case e.FLOAT_MAT3:return new AZ(e,t,n,i);case e.FLOAT_MAT4:return new xZ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function uZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._location=i[0]}uZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function fZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*2),this._gl=e,this._location=i[0]}fZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2fv(this._location,n)};function dZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*3),this._gl=e,this._location=i[0]}dZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];u(s.red)?(s.red!==n[r]||s.green!==n[r+1]||s.blue!==n[r+2])&&(n[r]=s.red,n[r+1]=s.green,n[r+2]=s.blue,i=!0):u(s.x)&&(m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0)),r+=3}i&&this._gl.uniform3fv(this._location,n)};function mZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}mZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];u(s.red)?z.equalsArray(s,n,r)||(z.pack(s,n,r),i=!0):u(s.x)&&(oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0)),r+=4}i&&this._gl.uniform4fv(this._location,n)};function MG(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}MG.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let r=0;r<i;++r){let o=n[r];e.activeTexture(t+r),e.bindTexture(o._target,o._texture)}};MG.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let r=e+i;this._gl.uniform1i(t[i],r)}return e+n};function hZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r),this._gl=e,this._location=i[0]}hZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function pZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*2),this._gl=e,this._location=i[0]}pZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2iv(this._location,n)};function _Z(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*3),this._gl=e,this._location=i[0]}_Z.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0),r+=3}i&&this._gl.uniform3iv(this._location,n)};function gZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*4),this._gl=e,this._location=i[0]}gZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniform4iv(this._location,n)};function yZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}yZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];ir.equalsArray(s,n,r)||(ir.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function AZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*9),this._gl=e,this._location=i[0]}AZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];Q.equalsArray(s,n,r)||(Q.pack(s,n,r),i=!0),r+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function xZ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*16),this._gl=e,this._location=i[0]}xZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];N.equalsArray(s,n,r)||(N.pack(s,n,r),i=!0),r+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var fv=wTe;var DTe=0;function Kh(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=ITe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=DTe++}Kh.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Kh.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Kh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return F3(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return F3(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return F3(this),this._uniformsByName}}});function CZ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(u(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function ITe(e,t){let n={};if(!Ht.highpFloatSupported||!Ht.highpIntSupported){let i,r,o,s,a=CZ(e),c=CZ(t),l=a.length,f=c.length;for(i=0;i<l;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Om="[Cesium WebGL] ";function PTe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(u(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),u(c)&&c.length>0&&console.log(`${Om}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),u(c)&&c.length>0&&console.log(`${Om}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),u(c)&&c.length>0&&console.log(`${Om}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let l,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Om}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),l=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Om}Vertex shader compile log: ${c}`),console.error(`${Om} Vertex shader source: -${n}`),l=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Om}Fragment shader compile log: ${c}`),console.error(`${Om} Fragment shader source: -${i}`),l=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new de(l);function d(p,g){if(!u(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${Om}${g} shader translation failed.`);return}console.error(`${Om}Translated ${g} shaderSource: -${h}`)}}function OTe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function MTe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",l=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(l.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,l);if(f!==null){let d=uv(e,a,l,f);n[l]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,h=l.indexOf("[");if(h>=0){if(f=n[l.slice(0,h)],!u(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,l),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let A=0;A<a.size;++A)g=e.getUniformLocation(t,`${l}[${A}]`),g!==null&&d.push(g);f=fv(e,a,l,d),n[l]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function RTe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];u(a)&&(o.name=a,s=a);let c=Yh[s];u(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function BTe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function F3(e){u(e._program)||TZ(e)}function TZ(e){let t=e._program,n=e._gl,i=PTe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=MTe(n,i),s=RTe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=OTe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=BTe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,l,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{TZ(e),l(e._program)}catch(h){e._vertexShaderText=d,e._fragmentShaderText=p;let x=/(?:Compile|Link) error: ([^]*)/.exec(h.message);f(x?x[1]:h.message)}})}Kh.prototype._bind=function(){F3(this),this._gl.useProgram(this._program)};Kh.prototype._setUniforms=function(e,t,n){let i,r;if(u(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Kh.prototype.isDestroyed=function(){return!1};Kh.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Kh.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Kt=Kh;function U3(e){this._context=e}var dv,LTe=new et({primitiveType:Be.TRIANGLES}),NTe=new ri({color:new z(0,0,0,0)});function FTe(e,t){return new Ys({context:e,colorTextures:[t],destroyAttachments:!1})}function UTe(e,t){return Kt.fromCache({context:e,vertexShaderSource:T0,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function VTe(e,t){return(!u(dv)||dv.viewport.width!==e||dv.viewport.height!==t)&&(dv=Ve.fromCache({viewport:new Ye(0,0,e,t)})),dv}U3.prototype.execute=function(e){u(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=u(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=u(e.shaderProgram)?e.shaderProgram:UTe(r,e.fragmentShaderSource),a=FTe(r,t),c=VTe(n,i),l=e.uniformMap,f=NTe;f.framebuffer=a,f.renderState=c,f.execute(r);let d=LTe;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=l,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),u(e.vertexArray)&&o.destroy()),u(e.postExecute)&&e.postExecute(t)};U3.prototype.isDestroyed=function(){return!1};U3.prototype.destroy=function(){return ue(this)};var mv=U3;var bn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};bn.getSizeInBytes=function(e){switch(e){case bn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case bn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case bn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case bn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case bn.INT:return Int32Array.BYTES_PER_ELEMENT;case bn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case bn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case bn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};bn.fromTypedArray=function(e){if(e instanceof Int8Array)return bn.BYTE;if(e instanceof Uint8Array)return bn.UNSIGNED_BYTE;if(e instanceof Int16Array)return bn.SHORT;if(e instanceof Uint16Array)return bn.UNSIGNED_SHORT;if(e instanceof Int32Array)return bn.INT;if(e instanceof Uint32Array)return bn.UNSIGNED_INT;if(e instanceof Float32Array)return bn.FLOAT;if(e instanceof Float64Array)return bn.DOUBLE};bn.validate=function(e){return u(e)&&(e===bn.BYTE||e===bn.UNSIGNED_BYTE||e===bn.SHORT||e===bn.UNSIGNED_SHORT||e===bn.INT||e===bn.UNSIGNED_INT||e===bn.FLOAT||e===bn.DOUBLE)};bn.createTypedArray=function(e,t){switch(e){case bn.BYTE:return new Int8Array(t);case bn.UNSIGNED_BYTE:return new Uint8Array(t);case bn.SHORT:return new Int16Array(t);case bn.UNSIGNED_SHORT:return new Uint16Array(t);case bn.INT:return new Int32Array(t);case bn.UNSIGNED_INT:return new Uint32Array(t);case bn.FLOAT:return new Float32Array(t);case bn.DOUBLE:return new Float64Array(t)}};bn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/bn.getSizeInBytes(e)),e){case bn.BYTE:return new Int8Array(t,n,i);case bn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case bn.SHORT:return new Int16Array(t,n,i);case bn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case bn.INT:return new Int32Array(t,n,i);case bn.UNSIGNED_INT:return new Uint32Array(t,n,i);case bn.FLOAT:return new Float32Array(t,n,i);case bn.DOUBLE:return new Float64Array(t,n,i)}};bn.fromName=function(e){switch(e){case"BYTE":return bn.BYTE;case"UNSIGNED_BYTE":return bn.UNSIGNED_BYTE;case"SHORT":return bn.SHORT;case"UNSIGNED_SHORT":return bn.UNSIGNED_SHORT;case"INT":return bn.INT;case"UNSIGNED_INT":return bn.UNSIGNED_INT;case"FLOAT":return bn.FLOAT;case"DOUBLE":return bn.DOUBLE}};var X=Object.freeze(bn);var EZ={};function hv(e,t){u(EZ[e])||(EZ[e]=!0,console.warn(y(t,e)))}hv.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";hv.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";hv.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";hv.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Ot=hv;function kTe(e,t){Ot(e,t)}var $=kTe;var zTe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Xu=Object.freeze(zTe);function rt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var pv=new m;rt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);pv=m.normalize(e,pv);let o=pv.x*r,s=pv.y*r,a=pv.z*r,c=Math.cos(i);return u(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new rt(o,s,a,c)};var HTe=[1,2,0],GTe=new Array(3);rt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[Q.COLUMN0ROW0],c=e[Q.COLUMN1ROW1],l=e[Q.COLUMN2ROW2],f=a+c+l;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Q.COLUMN1ROW2]-e[Q.COLUMN2ROW1])*n,r=(e[Q.COLUMN2ROW0]-e[Q.COLUMN0ROW2])*n,o=(e[Q.COLUMN0ROW1]-e[Q.COLUMN1ROW0])*n;else{let d=HTe,p=0;c>a&&(p=1),l>a&&l>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Q.getElementIndex(p,p)]-e[Q.getElementIndex(g,g)]-e[Q.getElementIndex(h,h)]+1);let A=GTe;A[p]=.5*n,n=.5/n,s=(e[Q.getElementIndex(h,g)]-e[Q.getElementIndex(g,h)])*n,A[g]=(e[Q.getElementIndex(g,p)]+e[Q.getElementIndex(p,g)])*n,A[h]=(e[Q.getElementIndex(h,p)]+e[Q.getElementIndex(p,h)])*n,i=-A[0],r=-A[1],o=-A[2]}return u(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new rt(i,r,o,s)};var bZ=new rt,SZ=new rt,RG=new rt,vZ=new rt;rt.fromHeadingPitchRoll=function(e,t){return vZ=rt.fromAxisAngle(m.UNIT_X,e.roll,bZ),RG=rt.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=rt.multiply(RG,vZ,RG),SZ=rt.fromAxisAngle(m.UNIT_Z,-e.heading,bZ),rt.multiply(SZ,t,t)};var V3=new m,BG=new m,rd=new rt,wZ=new rt,k3=new rt;rt.packedLength=4;rt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};rt.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new rt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};rt.packedInterpolationLength=3;rt.convertPackedArrayForInterpolation=function(e,t,n,i){rt.unpack(e,n*4,k3),rt.conjugate(k3,k3);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;rt.unpack(e,(t+r)*4,rd),rt.multiply(rd,k3,rd),rd.w<0&&rt.negate(rd,rd),rt.computeAxis(rd,V3);let a=rt.computeAngle(rd);u(i)||(i=[]),i[s]=V3.x*a,i[s+1]=V3.y*a,i[s+2]=V3.z*a}};rt.unpackInterpolationResult=function(e,t,n,i,r){u(r)||(r=new rt),m.fromArray(e,0,BG);let o=m.magnitude(BG);return rt.unpack(t,i*4,wZ),o===0?rt.clone(rt.IDENTITY,rd):rt.fromAxisAngle(BG,o,rd),rt.multiply(rd,wZ,r)};rt.clone=function(e,t){if(u(e))return u(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new rt(e.x,e.y,e.z,e.w)};rt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};rt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};rt.magnitude=function(e){return Math.sqrt(rt.magnitudeSquared(e))};rt.normalize=function(e,t){let n=1/rt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};rt.inverse=function(e,t){let n=rt.magnitudeSquared(e);return t=rt.conjugate(e,t),rt.multiplyByScalar(t,1/n,t)};rt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};rt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};rt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};rt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};rt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,l=t.z,f=t.w,d=s*a+i*f+r*l-o*c,p=s*c-i*l+r*f+o*a,g=s*l+i*c-r*a+o*f,h=s*f-i*a-r*c-o*l;return n.x=d,n.y=p,n.z=g,n.w=h,n};rt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};rt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};rt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};rt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var LG=new rt;rt.lerp=function(e,t,n,i){return LG=rt.multiplyByScalar(t,n,LG),i=rt.multiplyByScalar(e,1-n,i),rt.add(LG,i,i)};var DZ=new rt,NG=new rt,FG=new rt;rt.slerp=function(e,t,n,i){let r=rt.dot(e,t),o=t;if(r<0&&(r=-r,o=DZ=rt.negate(t,DZ)),1-r<P.EPSILON6)return rt.lerp(e,o,n,i);let s=Math.acos(r);return NG=rt.multiplyByScalar(e,Math.sin((1-n)*s),NG),FG=rt.multiplyByScalar(o,Math.sin(n*s),FG),i=rt.add(NG,FG,i),rt.multiplyByScalar(i,1/Math.sin(s),i)};rt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};rt.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var WTe=new m,jTe=new m,_v=new rt,$C=new rt;rt.computeInnerQuadrangle=function(e,t,n,i){let r=rt.conjugate(t,_v);rt.multiply(r,n,$C);let o=rt.log($C,WTe);rt.multiply(r,e,$C);let s=rt.log($C,jTe);return m.add(o,s,o),m.multiplyByScalar(o,.25,o),m.negate(o,o),rt.exp(o,_v),rt.multiply(t,_v,i)};rt.squad=function(e,t,n,i,r,o){let s=rt.slerp(e,t,r,_v),a=rt.slerp(n,i,r,$C);return rt.slerp(s,a,2*r*(1-r),o)};var qTe=new rt,IZ=1.9011074535173003,z3=Gt.supportsTypedArrays()?new Float32Array(8):[],H3=Gt.supportsTypedArrays()?new Float32Array(8):[],Jh=Gt.supportsTypedArrays()?new Float32Array(8):[],Zh=Gt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;z3[e]=1/(t*n),H3[e]=t/n}z3[7]=IZ/(8*17);H3[7]=IZ*8/17;rt.fastSlerp=function(e,t,n,i){let r=rt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,l=a*a;for(let g=7;g>=0;--g)Jh[g]=(z3[g]*c-H3[g])*s,Zh[g]=(z3[g]*l-H3[g])*s;let f=o*n*(1+Jh[0]*(1+Jh[1]*(1+Jh[2]*(1+Jh[3]*(1+Jh[4]*(1+Jh[5]*(1+Jh[6]*(1+Jh[7])))))))),d=a*(1+Zh[0]*(1+Zh[1]*(1+Zh[2]*(1+Zh[3]*(1+Zh[4]*(1+Zh[5]*(1+Zh[6]*(1+Zh[7])))))))),p=rt.multiplyByScalar(e,d,qTe);return rt.multiplyByScalar(t,f,i),rt.add(p,i,i)};rt.fastSquad=function(e,t,n,i,r,o){let s=rt.fastSlerp(e,t,r,_v),a=rt.fastSlerp(n,i,r,$C);return rt.fastSlerp(s,a,2*r*(1-r),o)};rt.equals=function(e,t){return e===t||u(e)&&u(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};rt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};rt.ZERO=Object.freeze(new rt(0,0,0,0));rt.IDENTITY=Object.freeze(new rt(0,0,0,1));rt.prototype.clone=function(e){return rt.clone(this,e)};rt.prototype.equals=function(e){return rt.equals(this,e)};rt.prototype.equalsEpsilon=function(e,t){return rt.equalsEpsilon(this,e,t)};rt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=rt;function YTe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Mr=YTe;function XTe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var Q_=XTe;function KTe(e,t,n,i,r,o,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a}var Qh=KTe;function JTe(e){return e%4===0&&e%100!==0||e%400===0}var $h=JTe;function ZTe(e,t){this.julianDate=e,this.offset=t}var Gi=ZTe;var QTe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Qn=Object.freeze(QTe);var $Te={UTC:0,TAI:1},Zn=Object.freeze($Te);var OZ=new Qh,UG=[31,28,31,30,31,30,31,31,30,31,30,31],VG=29;function kG(e,t){return St.compare(e.julianDate,t.julianDate)}var eT=new Gi;function W3(e){eT.julianDate=e;let t=St.leapSeconds,n=Mr(t,eT,kG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&St.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),St.addSeconds(e,i,e)}function PZ(e,t){eT.julianDate=e;let n=St.leapSeconds,i=Mr(n,eT,kG);if(i<0&&(i=~i),i===0)return St.addSeconds(e,-n[0].offset,t);if(i>=n.length)return St.addSeconds(e,-n[i-1].offset,t);let r=St.secondsDifference(n[i].julianDate,e);if(r===0)return St.addSeconds(e,-n[i].offset,t);if(!(r<=1))return St.addSeconds(e,-n[--i].offset,t)}function $_(e,t,n){let i=t/Qn.SECONDS_PER_DAY|0;return e+=i,t-=Qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function zG(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,l=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Qn.SECONDS_PER_HOUR+r*Qn.SECONDS_PER_MINUTE+s*Qn.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}var eEe=/^(\d{4})$/,tEe=/^(\d{4})-(\d{2})$/,nEe=/^(\d{4})-?(\d{3})$/,iEe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,rEe=/^(\d{4})-?(\d{2})-?(\d{2})$/,HG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,oEe=/^(\d{2})(\.\d+)?/.source+HG.source,sEe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+HG.source,aEe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+HG.source;function St(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Zn.UTC);let i=e|0;t=t+(e-i)*Qn.SECONDS_PER_DAY,$_(i,t,this),n===Zn.UTC&&W3(this)}St.fromGregorianDate=function(e,t){let n=zG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return u(t)?($_(n[0],n[1],t),W3(t),t):new St(n[0],n[1],Zn.UTC)};St.fromDate=function(e,t){let n=zG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return u(t)?($_(n[0],n[1],t),W3(t),t):new St(n[0],n[1],Zn.UTC)};St.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,r=1,o=1,s=0,a=0,c=0,l=0,f=n[0],d=n[1],p,g;if(n=f.match(rEe),n!==null)i=+n[1],r=+n[2],o=+n[3];else if(n=f.match(tEe),n!==null)i=+n[1],r=+n[2];else if(n=f.match(eEe),n!==null)i=+n[1];else{let C;if(n=f.match(nEe),n!==null)i=+n[1],C=+n[2],g=$h(i);else if(n=f.match(iEe),n!==null){i=+n[1];let T=+n[2],E=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+E-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),r=p.getUTCMonth()+1,o=p.getUTCDate()}g=$h(i);let h;if(u(d)){n=d.match(aEe),n!==null?(s=+n[1],a=+n[2],c=+n[3],l=+(n[4]||0)*1e3,h=5):(n=d.match(sEe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(oEe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],E=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-E;break;case"-":s=s+T,a=a+E;break;case"Z":break;default:a=a+new Date(Date.UTC(i,r-1,o,s,a)).getTimezoneOffset();break}}let A=c===60;for(A&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,o++;for(p=g&&r===2?VG:UG[r-1];o>p;)o-=p,r++,r>12&&(r-=12,i++),p=g&&r===2?VG:UG[r-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,o--;for(;o<1;)r--,r<1&&(r+=12,i--),p=g&&r===2?VG:UG[r-1],o+=p;let x=zG(i,r,o,s,a,c,l);return u(t)?($_(x[0],x[1],t),W3(t)):t=new St(x[0],x[1],Zn.UTC),A&&St.addSeconds(t,1,t),t};St.now=function(e){return St.fromDate(new Date,e)};var G3=new St(0,0,Zn.TAI);St.toGregorianDate=function(e,t){let n=!1,i=PZ(e,G3);u(i)||(St.addSeconds(e,-1,G3),i=PZ(G3,G3),n=!0);let r=i.dayNumber,o=i.secondsOfDay;o>=43200&&(r+=1);let s=r+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let l=80*s/2447|0,f=s-(2447*l/80|0)|0;s=l/11|0;let d=l+2-12*s|0,p=100*(a-49)+c+s|0,g=o/Qn.SECONDS_PER_HOUR|0,h=o-g*Qn.SECONDS_PER_HOUR,A=h/Qn.SECONDS_PER_MINUTE|0;h=h-A*Qn.SECONDS_PER_MINUTE;let x=h|0,C=(h-x)/Qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(x+=1),u(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=A,t.second=x,t.millisecond=C,t.isLeapSecond=n,t):new Qh(p,d,f,g,A,x,C,n)};St.toDate=function(e){let t=St.toGregorianDate(e,OZ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};St.toIso8601=function(e,t){let n=St.toGregorianDate(e,OZ),i=n.year,r=n.month,o=n.day,s=n.hour,a=n.minute,c=n.second,l=n.millisecond;i===1e4&&r===1&&o===1&&s===0&&a===0&&c===0&&l===0&&(i=9999,r=12,o=31,s=24);let f;return!u(t)&&l!==0?(f=(l*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!u(t)||t===0?`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(l*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};St.clone=function(e,t){if(u(e))return u(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new St(e.dayNumber,e.secondsOfDay,Zn.TAI)};St.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};St.equals=function(e,t){return e===t||u(e)&&u(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};St.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(St.secondsDifference(e,t))<=n};St.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Qn.SECONDS_PER_DAY};St.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};St.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Qn.SECONDS_PER_DAY;return n+i};St.computeTaiMinusUtc=function(e){eT.julianDate=e;let t=St.leapSeconds,n=Mr(t,eT,kG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};St.addSeconds=function(e,t,n){return $_(e.dayNumber,e.secondsOfDay+t,n)};St.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_MINUTE;return $_(e.dayNumber,i,n)};St.addHours=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_HOUR;return $_(e.dayNumber,i,n)};St.addDays=function(e,t,n){let i=e.dayNumber+t;return $_(i,e.secondsOfDay,n)};St.lessThan=function(e,t){return St.compare(e,t)<0};St.lessThanOrEquals=function(e,t){return St.compare(e,t)<=0};St.greaterThan=function(e,t){return St.compare(e,t)>0};St.greaterThanOrEquals=function(e,t){return St.compare(e,t)>=0};St.prototype.clone=function(e){return St.clone(this,e)};St.prototype.equals=function(e){return St.equals(this,e)};St.prototype.equalsEpsilon=function(e,t){return St.equalsEpsilon(this,e,t)};St.prototype.toString=function(){return St.toIso8601(this)};St.leapSeconds=[new Gi(new St(2441317,43210,Zn.TAI),10),new Gi(new St(2441499,43211,Zn.TAI),11),new Gi(new St(2441683,43212,Zn.TAI),12),new Gi(new St(2442048,43213,Zn.TAI),13),new Gi(new St(2442413,43214,Zn.TAI),14),new Gi(new St(2442778,43215,Zn.TAI),15),new Gi(new St(2443144,43216,Zn.TAI),16),new Gi(new St(2443509,43217,Zn.TAI),17),new Gi(new St(2443874,43218,Zn.TAI),18),new Gi(new St(2444239,43219,Zn.TAI),19),new Gi(new St(2444786,43220,Zn.TAI),20),new Gi(new St(2445151,43221,Zn.TAI),21),new Gi(new St(2445516,43222,Zn.TAI),22),new Gi(new St(2446247,43223,Zn.TAI),23),new Gi(new St(2447161,43224,Zn.TAI),24),new Gi(new St(2447892,43225,Zn.TAI),25),new Gi(new St(2448257,43226,Zn.TAI),26),new Gi(new St(2448804,43227,Zn.TAI),27),new Gi(new St(2449169,43228,Zn.TAI),28),new Gi(new St(2449534,43229,Zn.TAI),29),new Gi(new St(2450083,43230,Zn.TAI),30),new Gi(new St(2450630,43231,Zn.TAI),31),new Gi(new St(2451179,43232,Zn.TAI),32),new Gi(new St(2453736,43233,Zn.TAI),33),new Gi(new St(2454832,43234,Zn.TAI),34),new Gi(new St(2456109,43235,Zn.TAI),35),new Gi(new St(2457204,43236,Zn.TAI),36),new Gi(new St(2457754,43237,Zn.TAI),37)];var ee=St;var ZZ=Ki(Yl(),1);function cEe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var gv=cEe;function UZ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=UZ(r,t)),n[i]=r}return n}var We=UZ;function VZ(e,t,n){n=y(n,!1);let i={},r=u(e),o=u(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=VZ(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var _t=VZ;function lEe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Xs=lEe;var kZ=Ki(Yl(),1);function GG(e,t){let n;return typeof document<"u"&&(n=document),GG._implementation(e,t,n)}GG._implementation=function(e,t,n){if(!u(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new kZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var ep=GG;var zZ=Ki(Yl(),1);function uEe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new zZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var yv=uEe;var HZ=Ki(Yl(),1);function fEe(e){let t=new HZ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var b0=fEe;var GZ={};function dEe(e,t,n){u(t)||(t=e.width),u(n)||(n=e.height);let i=GZ[t];u(i)||(i={},GZ[t]=i);let r=i[n];if(!u(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var od=dEe;var mEe=/^blob:/i;function hEe(e){return mEe.test(e)}var S0=hEe;var Mm;function pEe(e){u(Mm)||(Mm=document.createElement("a")),Mm.href=window.location.href;let t=Mm.host,n=Mm.protocol;return Mm.href=e,Mm.href=Mm.href,n!==Mm.protocol||t!==Mm.host}var v0=pEe;var _Ee=/^data:/i;function gEe(e){return _Ee.test(e)}var tp=gEe;function yEe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var w0=yEe;function AEe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var D0=AEe;function xEe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];u(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Xl=xEe;var CEe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ti=Object.freeze(CEe);var TEe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},$o=Object.freeze(TEe);function X3(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,$o.OTHER),this.serverKey=e.serverKey,this.state=ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}X3.prototype.cancel=function(){this.cancelled=!0};X3.prototype.clone=function(e){return u(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new X3(this)};var qr=X3;function EEe(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var Av=EEe;function WZ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Av(this.responseHeaders))}WZ.prototype.toString=function(){let e="Request has failed.";return u(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Rm=WZ;var K3=Ki(Yl(),1);function xv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(xv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});xv.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};xv.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,r=-1;for(let o=0;o<n.length;o++)if(n[o]===e&&i[o]===t){r=o;break}return r!==-1?(this._insideRaiseEvent?(this._toRemove.push(r),n[r]=void 0,i[r]=void 0):(n.splice(r,1),i.splice(r,1)),!0):!1};function bEe(e,t){return t-e}xv.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let o=t[e];u(o)&&t[e].apply(n[e],arguments)}let r=this._toRemove;if(i=r.length,i>0){for(r.sort(bEe),e=0;e<i;e++){let o=r[e];t.splice(o,1),n.splice(o,1)}r.length=0}this._insideRaiseEvent=!1};var _e=xv;function I0(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(I0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function WG(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}I0.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};I0.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,r=-1,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(WG(i,r,e),e=r):o=!1}};I0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};I0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)WG(t,r,s),r=s;else break}let o;return u(i)&&this._length>i&&(o=t[i],this._length=i),o};I0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return WG(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var Cv=I0;function SEe(e,t){return e.priority-t.priority}var rr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},iT=20,Va=new Cv({comparator:SEe});Va.maximumLength=iT;Va.reserve(iT);var Bm=[],np={},vEe=typeof document<"u"?new K3.default(document.location.href):new K3.default,J3=new _e;function Yr(){}Yr.maximumRequests=50;Yr.maximumRequestsPerServer=6;Yr.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18};Yr.throttleRequests=!0;Yr.debugShowStatistics=!1;Yr.requestCompletedEvent=J3;Object.defineProperties(Yr,{statistics:{get:function(){return rr}},priorityHeapLength:{get:function(){return iT},set:function(e){if(e<iT)for(;Va.length>e;){let t=Va.pop();P0(t)}iT=e,Va.maximumLength=e,Va.reserve(e)}}});function jZ(e){u(e.priorityFunction)&&(e.priority=e.priorityFunction())}Yr.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Yr.requestsByServer[e],Yr.maximumRequestsPerServer);return np[e]+t<=n};Yr.heapHasOpenSlots=function(e){return Va.length+e<=iT};function qZ(e){return e.state===ti.UNISSUED&&(e.state=ti.ISSUED,e.deferred=Xs()),e.deferred.promise}function wEe(e){return function(t){if(e.state===ti.CANCELLED)return;let n=e.deferred;--rr.numberOfActiveRequests,--np[e.serverKey],J3.raiseEvent(),e.state=ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function DEe(e){return function(t){e.state!==ti.CANCELLED&&(++rr.numberOfFailedRequests,--rr.numberOfActiveRequests,--np[e.serverKey],J3.raiseEvent(t),e.state=ti.FAILED,e.deferred.reject(t))}}function YZ(e){let t=qZ(e);return e.state=ti.ACTIVE,Bm.push(e),++rr.numberOfActiveRequests,++rr.numberOfActiveRequestsEver,++np[e.serverKey],e.requestFunction().then(wEe(e)).catch(DEe(e)),t}function P0(e){let t=e.state===ti.ACTIVE;if(e.state=ti.CANCELLED,++rr.numberOfCancelledRequests,u(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--rr.numberOfActiveRequests,--np[e.serverKey],++rr.numberOfCancelledActiveRequests),u(e.cancelFunction)&&e.cancelFunction()}Yr.update=function(){let e,t,n=0,i=Bm.length;for(e=0;e<i;++e){if(t=Bm[e],t.cancelled&&P0(t),t.state!==ti.ACTIVE){++n;continue}n>0&&(Bm[e-n]=t)}Bm.length-=n;let r=Va.internalArray,o=Va.length;for(e=0;e<o;++e)jZ(r[e]);Va.resort();let s=Math.max(Yr.maximumRequests-Bm.length,0),a=0;for(;a<s&&Va.length>0;){if(t=Va.pop(),t.cancelled){P0(t);continue}if(t.throttleByServer&&!Yr.serverHasOpenSlots(t.serverKey)){P0(t);continue}YZ(t),++a}IEe()};Yr.getServerKey=function(e){let t=new K3.default(e);t.scheme()===""&&(t=t.absoluteTo(vEe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=np[n];return u(i)||(np[n]=0),n};Yr.request=function(e){if(tp(e.url)||S0(e.url))return J3.raiseEvent(),e.state=ti.RECEIVED,e.requestFunction();if(++rr.numberOfAttemptedRequests,u(e.serverKey)||(e.serverKey=Yr.getServerKey(e.url)),Yr.throttleRequests&&e.throttleByServer&&!Yr.serverHasOpenSlots(e.serverKey))return;if(!Yr.throttleRequests||!e.throttle)return YZ(e);if(Bm.length>=Yr.maximumRequests)return;jZ(e);let t=Va.insert(e);if(u(t)){if(t===e)return;P0(t)}return qZ(e)};function IEe(){Yr.debugShowStatistics&&(rr.numberOfActiveRequests===0&&rr.lastNumberOfActiveRequests>0&&(rr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${rr.numberOfAttemptedRequests}`),rr.numberOfAttemptedRequests=0),rr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${rr.numberOfCancelledRequests}`),rr.numberOfCancelledRequests=0),rr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${rr.numberOfCancelledActiveRequests}`),rr.numberOfCancelledActiveRequests=0),rr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${rr.numberOfFailedRequests}`),rr.numberOfFailedRequests=0)),rr.lastNumberOfActiveRequests=rr.numberOfActiveRequests)}Yr.clearForSpecs=function(){for(;Va.length>0;){let t=Va.pop();P0(t)}let e=Bm.length;for(let t=0;t<e;++t)P0(Bm[t]);Bm.length=0,np={},rr.numberOfAttemptedRequests=0,rr.numberOfActiveRequests=0,rr.numberOfCancelledRequests=0,rr.numberOfCancelledActiveRequests=0,rr.numberOfFailedRequests=0,rr.numberOfActiveRequestsEver=0,rr.lastNumberOfActiveRequests=0};Yr.numberOfActiveRequestsByServer=function(e){return np[e]};Yr.requestHeap=Va;var ka=Yr;var XZ=Ki(Yl(),1);var Tv={},rT={};Tv.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;u(rT[n])||(rT[n]=!0)};Tv.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;u(rT[n])&&delete rT[n]};function PEe(e){let t=new XZ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}Tv.contains=function(e){let t=PEe(e);return!!(u(t)&&u(rT[t]))};Tv.clear=function(){rT={}};var oT=Tv;var QZ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function bt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Lm(e.templateValues,{}),this._queryParameters=Lm(e.queryParameters,{}),this.headers=Lm(e.headers,{}),this.request=y(e.request,new qr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url}function Lm(e,t){return u(e)?We(e):t}bt.createIfNeeded=function(e){return e instanceof bt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new bt({url:e})};var sT;bt.supportsImageBitmapOptions=function(){if(u(sT))return sT;if(typeof createImageBitmap!="function")return sT=Promise.resolve(!1),sT;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return sT=bt.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=od(t[0]),i=od(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),sT};Object.defineProperties(bt,{isBlobSupported:{get:function(){return QZ}}});Object.defineProperties(bt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return b0(this._url)}},isDataUri:{get:function(){return tp(this._url)}},isBlobUri:{get:function(){return S0(this._url)}},isCrossOriginUrl:{get:function(){return v0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}});bt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};bt.prototype.parseUrl=function(e,t,n,i){let r=new ZZ.default(e),o=OEe(r.query());this._queryParameters=t?Q3(o,this.queryParameters,n):o,r.search(""),r.fragment(""),u(i)&&r.scheme()===""&&(r=r.absoluteTo(ep(i))),this._url=r.toString()};function OEe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Xl(e)}function Q3(e,t,n){if(!n)return _t(e,t);let i=We(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];u(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}bt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${MEe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return u(s)?encodeURIComponent(s):r})),t&&u(this.proxy)&&(n=this.proxy.getURL(n)),n};function MEe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!u(e[t[0]])?`?${t[0]}`:`?${D0(e)}`}bt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Q3(this._queryParameters,e,!1):this._queryParameters=Q3(e,this._queryParameters,!1)};bt.prototype.appendQueryParameters=function(e){this._queryParameters=Q3(e,this._queryParameters,!0)};bt.prototype.setTemplateValues=function(e,t){t?this._templateValues=_t(this._templateValues,e):this._templateValues=_t(e,this._templateValues)};bt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,u(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return u(e.queryParameters)&&(t._queryParameters=_t(e.queryParameters,t.queryParameters)),u(e.templateValues)&&(t._templateValues=_t(e.templateValues,t.templateValues)),u(e.headers)&&(t.headers=_t(e.headers,t.headers)),u(e.proxy)&&(t.proxy=e.proxy),u(e.request)&&(t.request=e.request),u(e.retryCallback)&&(t.retryCallback=e.retryCallback),u(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};bt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};bt.prototype.clone=function(e){return u(e)?(e._url=this._url,e._queryParameters=We(this._queryParameters),e._templateValues=We(this._templateValues),e.headers=We(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new bt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1})};bt.prototype.getBaseUri=function(e){return yv(this.getUrlComponent(e),e)};bt.prototype.appendForwardSlash=function(){this._url=gv(this._url)};bt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};bt.fetchArrayBuffer=function(e){return new bt(e).fetchArrayBuffer()};bt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};bt.fetchBlob=function(e){return new bt(e).fetchBlob()};bt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1);if(qG(this.request),!QZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return jG({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!u(o))return;let s,a,c,l;return bt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!u(f))return;if(l=f,a)return bt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new bt({url:d}),jG({resource:c,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(u(f))return f.blob=l,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return u(c)&&window.URL.revokeObjectURL(c.url),f.blob=l,Promise.reject(f)})};function jG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Xs();return bt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=ka.request(o);if(u(s))return s.catch(function(a){return o.state!==ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=ti.UNISSUED,o.deferred=void 0,jG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})}bt.fetchImage=function(e){return new bt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};bt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};bt.fetchText=function(e){return new bt(e).fetchText()};bt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(u(e))return e.then(function(t){if(u(t))return JSON.parse(t)})};bt.fetchJson=function(e){return new bt(e).fetchJson()};bt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};bt.fetchXML=function(e){return new bt(e).fetchXML()};bt.prototype.fetchJsonp=function(e){e=y(e,"callback"),qG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(u(window[t]));return $Z(this,e,t)};function $Z(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=Xs();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},bt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=ka.request(r);if(u(s))return s.catch(function(a){return r.state!==ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=ti.UNISSUED,r.deferred=void 0,$Z(e,t,n)):Promise.reject(a)})})}bt.fetchJsonp=function(e){return new bt(e).fetchJsonp(e.callbackParameterName)};bt.prototype._makeRequest=function(e){let t=this;qG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=_t(e.headers,t.headers),a=e.overrideMimeType,c=e.method,l=e.data,f=Xs(),d=bt._Implementations.loadWithXhr(i,o,c,l,s,f,a);return u(d)&&u(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=ka.request(n);if(u(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==ti.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function qG(e){if(e.state===ti.ISSUED||e.state===ti.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ti.UNISSUED,e.deferred=void 0}var REe=/^data:(.*?)(;base64)?,(.*)$/;function Z3(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function KZ(e,t){let n=Z3(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function BEe(e,t){t=y(t,"");let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return Z3(i,r);case"arraybuffer":return KZ(i,r);case"blob":return o=KZ(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(Z3(i,r),n);case"json":return JSON.parse(Z3(i,r));default:}}bt.prototype.fetch=function(e){return e=Lm(e,{}),e.method="GET",this._makeRequest(e)};bt.fetch=function(e){return new bt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt.prototype.delete=function(e){return e=Lm(e,{}),e.method="DELETE",this._makeRequest(e)};bt.delete=function(e){return new bt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};bt.prototype.head=function(e){return e=Lm(e,{}),e.method="HEAD",this._makeRequest(e)};bt.head=function(e){return new bt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt.prototype.options=function(e){return e=Lm(e,{}),e.method="OPTIONS",this._makeRequest(e)};bt.options=function(e){return new bt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt.prototype.post=function(e,t){return ol.defined("data",e),t=Lm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};bt.post=function(e){return new bt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt.prototype.put=function(e,t){return ol.defined("data",e),t=Lm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};bt.put=function(e){return new bt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt.prototype.patch=function(e,t){return ol.defined("data",e),t=Lm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};bt.patch=function(e){return new bt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};bt._Implementations={};bt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(oT.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};bt._Implementations.createImage=function(e,t,n,i,r,o){let s=e.url;bt.supportsImageBitmapOptions().then(function(a){if(!(a&&o)){bt._Implementations.loadImageElement(s,t,n);return}let c="blob",l="GET",f=Xs(),d=bt._Implementations.loadWithXhr(s,c,l,void 0,void 0,f,void 0,void 0,void 0);return u(d)&&u(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!u(p)){n.reject(new de(`Successfully retrieved ${s} but it contained no content.`));return}return bt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};bt.createImageBitmapFromBlob=function(e,t){return ol.defined("options",t),ol.typeOf.bool("options.flipY",t.flipY),ol.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),ol.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function JZ(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function LEe(e,t,n,i,r,o,s){let a,c;Promise.all([import("url"),import("zlib")]).then(([l,f])=>(a=l.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(l=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:r};l.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){o.reject(new Rm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,A){h?o.reject(new de("Error decompressing response.")):o.resolve(JZ(A,t))}):o.resolve(JZ(g,t))})}).on("error",function(d){o.reject(new Rm)}).end()})}var NEe=typeof XMLHttpRequest>"u";bt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=REe.exec(e);if(a!==null){o.resolve(BEe(a,t));return}if(NEe){LEe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(oT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),u(s)&&u(c.overrideMimeType)&&c.overrideMimeType(s),u(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);u(t)&&(c.responseType=t);let l=!1;return typeof e=="string"&&(l=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(l&&c.status===0)){o.reject(new Rm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(A){let x=A.split(": "),C=x.shift();h[C]=x.join(": ")}),o.resolve(h);return}if(c.status===204)o.resolve();else if(u(f)&&(!u(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&u(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&u(c.responseText)?o.resolve(c.responseText):o.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new Rm)},c.send(i),c};bt._Implementations.loadAndExecuteScript=function(e,t,n){return w0(e,t).catch(function(i){n.reject(i)})};bt._DefaultImplementations={};bt._DefaultImplementations.createImage=bt._Implementations.createImage;bt._DefaultImplementations.loadWithXhr=bt._Implementations.loadWithXhr;bt._DefaultImplementations.loadAndExecuteScript=bt._Implementations.loadAndExecuteScript;bt.DEFAULT=Object.freeze(new bt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=bt;function bv(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),u(e.data)?eQ(this,e.data):eQ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}bv.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=we.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new bv({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};bv.NONE=Object.freeze({compute:function(e,t){return u(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Q_(0,0,0,0,0),t}});bv.prototype.compute=function(e,t){if(!u(this._samples))return;if(u(t)||(t=new Q_(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r=0,o=0;if(u(i)){let a=n[i],c=n[i+1],l=ee.lessThanOrEquals(a,e),f=!u(c),d=f||ee.greaterThanOrEquals(c,e);if(l&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,nQ(this,n,this._samples,e,r,o,t),t}let s=Mr(n,e,ee.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,nQ(this,n,this._samples,e,r,o,t),t};function FEe(e,t){return ee.compare(e.julianDate,t)}function eQ(e,t){if(!u(t.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!u(t.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let l=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,h=l.length;g<h;g+=e._columnCount){let A=l[g+n],x=l[g+c],C=A+Qn.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new ee(C,x,Zn.TAI);if(f.push(T),p){if(x!==d&&u(d)){let E=ee.leapSeconds,S=Mr(E,T,FEe);if(S<0){let w=new Gi(T,x);E.splice(~S,0,w)}}d=x}}}function tQ(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function Ev(e,t,n){return t+e*(n-t)}function nQ(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],l=t[o];if(c.equals(l)||i.equals(c))return tQ(e,n,r,a,s),s;if(i.equals(l))return tQ(e,n,o,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(l,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],A=h-g;if(A>.5||A<-.5){let x=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];x!==C&&(l.equals(i)?g=h:h-=C-x)}return s.xPoleWander=Ev(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=Ev(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Ev(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Ev(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Ev(f,g,h),s}var Sv=bv;function za(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}za.fromQuaternion=function(e,t){u(t)||(t=new za);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};za.fromDegrees=function(e,t,n,i){return u(i)||(i=new za),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};za.clone=function(e,t){if(u(e))return u(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new za(e.heading,e.pitch,e.roll)};za.equals=function(e,t){return e===t||u(e)&&u(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};za.equalsEpsilon=function(e,t,n,i){return e===t||u(e)&&u(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};za.prototype.clone=function(e){return za.clone(this,e)};za.prototype.equals=function(e){return za.equals(this,e)};za.prototype.equalsEpsilon=function(e,t,n){return za.equalsEpsilon(this,e,t,n)};za.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ha=za;var iQ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function UEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=iQ.exec(i);if(r!==null)return r[1]}}var aT;function rQ(e){return typeof document>"u"?e:(u(aT)||(aT=document.createElement("a")),aT.href=e,aT.href=aT.href,aT.href)}var O0;function oQ(){if(u(O0))return O0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&u(define.amd)&&!define.amd.toUrlUndefined&&u(require.toUrl)?e=ep("..",M0("Core/buildModuleUrl.js")):e=UEe(),O0=new we({url:rQ(e)}),O0.appendForwardSlash(),O0}function VEe(e){return rQ(require.toUrl(`../${e}`))}function sQ(e){return oQ().getDerivedResource({url:e}).url}var $3;function M0(e){return u($3)||(typeof define=="object"&&u(define.amd)&&!define.amd.toUrlUndefined&&u(require.toUrl)?$3=VEe:$3=sQ),$3(e)}M0._cesiumScriptRegex=iQ;M0._buildModuleUrlFromBaseUrl=sQ;M0._clearBaseResource=function(){O0=void 0};M0.setBaseUrl=function(e){O0=we.DEFAULT.getDerivedResource({url:e})};M0.getCesiumBaseUrl=oQ;var en=M0;function kEe(e,t,n){this.x=e,this.y=t,this.s=n}var R0=kEe;function KG(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Zn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var zEe=new ee(0,0,Zn.TAI);function YG(e,t,n){let i=zEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}KG.prototype.preload=function(e,t,n,i){let r=YG(this,e,t),o=YG(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,l=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=l;++d)f.push(XG(this,d));return Promise.all(f)};KG.prototype.computeXysRadians=function(e,t,n){let i=YG(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,l=this._samples;if(u(l[s*3])||(XG(this,s/this._samplesPerXysFile|0),c=!0),u(l[a*3])||(XG(this,a/this._samplesPerXysFile|0),c=!0),c)return;u(n)?(n.x=0,n.y=0,n.s=0):n=new R0(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,A,x;for(A=0;A<=o;++A)d[A]=f-h[A];for(A=0;A<=o;++A){for(g[A]=1,x=0;x<=o;++x)x!==A&&(g[A]*=d[x]);g[A]*=p[A];let C=(s+A)*3;n.x+=g[A]*l[C++],n.y+=g[A]*l[C++],n.s+=g[A]*l[C]}return n};function XG(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;u(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:en(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=n.fetchJson().then(function(o){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=o.samples,c=t*e._samplesPerXysFile*3;for(let l=0,f=a.length;l<f;++l)s[c+l]=a[l]});return e._chunkDownloadsInProgress[t]=r,r}var vv=KG;var Ji={},JG={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},cT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ZG={},al={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},eg=new m,tg=new m,ng=new m;Ji.localFrameToFixedFrameGenerator=function(e,t){if(!JG.hasOwnProperty(e)||!JG[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=JG[e][t],i,r=e+t;return u(ZG[r])?i=ZG[r]:(i=function(o,s,a){if(u(a)||(a=new N),m.equalsEpsilon(o,m.ZERO,P.EPSILON14))m.unpack(cT[e],0,eg),m.unpack(cT[t],0,tg),m.unpack(cT[n],0,ng);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);m.unpack(cT[e],0,eg),e!=="east"&&e!=="west"&&m.multiplyByScalar(eg,c,eg),m.unpack(cT[t],0,tg),t!=="east"&&t!=="west"&&m.multiplyByScalar(tg,c,tg),m.unpack(cT[n],0,ng),n!=="east"&&n!=="west"&&m.multiplyByScalar(ng,c,ng)}else{s=y(s,re.WGS84),s.geodeticSurfaceNormal(o,al.up);let c=al.up,l=al.east;l.x=-o.y,l.y=o.x,l.z=0,m.normalize(l,al.east),m.cross(c,l,al.north),m.multiplyByScalar(al.up,-1,al.down),m.multiplyByScalar(al.east,-1,al.west),m.multiplyByScalar(al.north,-1,al.south),eg=al[e],tg=al[t],ng=al[n]}return a[0]=eg.x,a[1]=eg.y,a[2]=eg.z,a[3]=0,a[4]=tg.x,a[5]=tg.y,a[6]=tg.z,a[7]=0,a[8]=ng.x,a[9]=ng.y,a[10]=ng.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},ZG[r]=i),i};Ji.eastNorthUpToFixedFrame=Ji.localFrameToFixedFrameGenerator("east","north");Ji.northEastDownToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","east");Ji.northUpEastToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","up");Ji.northWestUpToFixedFrame=Ji.localFrameToFixedFrameGenerator("north","west");var HEe=new Le,GEe=new m(1,1,1),WEe=new N;Ji.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=y(i,Ji.eastNorthUpToFixedFrame);let o=Le.fromHeadingPitchRoll(t,HEe),s=N.fromTranslationQuaternionRotationScale(m.ZERO,o,GEe,WEe);return r=i(e,n,r),N.multiply(r,s,r)};var jEe=new N,qEe=new Q;Ji.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ji.headingPitchRollToFixedFrame(e,t,n,i,jEe),s=N.getMatrix3(o,qEe);return Le.fromRotationMatrix(s,r)};var YEe=new m(1,1,1),XEe=new m,aQ=new N,KEe=new N,JEe=new Q,ZEe=new Le;Ji.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,Ji.eastNorthUpToFixedFrame),u(i)||(i=new Ha);let r=N.getTranslation(e,XEe);if(m.equals(r,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,aQ),aQ),s=N.setScale(e,YEe,KEe);s=N.setTranslation(s,m.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,JEe),ZEe);return a=Le.normalize(a,a),Ha.fromQuaternion(a,i)};var QEe=6*3600+41*60+50.54841,$Ee=8640184812866e-6,ebe=.093104,tbe=-62e-7,nbe=11772758384668e-32,ibe=72921158553e-15,rbe=P.TWO_PI/86400,eU=new ee;Ji.computeTemeToPseudoFixedMatrix=function(e,t){eU=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),eU);let n=eU.dayNumber,i=eU.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Qn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Qn.DAYS_PER_JULIAN_CENTURY;let a=(QEe+r*($Ee+r*(ebe+r*tbe)))*rbe%P.TWO_PI,c=ibe+nbe*(n-24515455e-1),l=(i+Qn.SECONDS_PER_DAY*.5)%Qn.SECONDS_PER_DAY,f=a+c*l,d=Math.cos(f),p=Math.sin(f);return u(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Q(d,p,0,-p,d,0,0,0,1)};Ji.iau2006XysData=new vv;Ji.earthOrientationParameters=Sv.NONE;var e8=32.184,obe=2451545;Ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+e8,i=e.stop.dayNumber,r=e.stop.secondsOfDay+e8;return Ji.iau2006XysData.preload(t,n,i,r)};Ji.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new Q);let n=Ji.computeFixedToIcrfMatrix(e,t);if(u(n))return Q.transpose(n,t)};var sbe=new R0(0,0,0),abe=new Q_(0,0,0,0,0,0),QG=new Q,$G=new Q;Ji.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new Q);let n=Ji.earthOrientationParameters.compute(e,abe);if(!u(n))return;let i=e.dayNumber,r=e.secondsOfDay+e8,o=Ji.iau2006XysData.computeXysRadians(i,r,sbe);if(!u(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),l=QG;l[0]=1-c*s*s,l[3]=-c*s*a,l[6]=s,l[1]=-c*s*a,l[4]=1-c*a*a,l[7]=a,l[2]=-s,l[5]=-a,l[8]=1-c*(s*s+a*a);let f=Q.fromRotationZ(-o.s,$G),d=Q.multiply(l,f,QG),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,A=g/Qn.SECONDS_PER_DAY,x=.779057273264+A+.00273781191135448*(h+A);x=x%1*P.TWO_PI;let C=Q.fromRotationZ(x,$G),T=Q.multiply(d,C,QG),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),M=i-obe+r/Qn.SECONDS_PER_DAY;M/=36525;let O=-47e-6*M*P.RADIANS_PER_DEGREE/3600,B=Math.cos(O),L=Math.sin(O),_=$G;return _[0]=E*B,_[1]=E*L,_[2]=w,_[3]=-S*L+D*w*B,_[4]=S*B+D*w*L,_[5]=-D*E,_[6]=-D*L-S*w*B,_[7]=D*B-S*w*L,_[8]=S*E,Q.multiply(T,_,t)};var cbe=new oe;Ji.pointToWindowCoordinates=function(e,t,n,i){return i=Ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ji.pointToGLWindowCoordinates=function(e,t,n,i){u(i)||(i=new H);let r=cbe;return N.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,r),r),oe.multiplyByScalar(r,1/r.w,r),N.multiplyByVector(t,r,r),H.fromCartesian4(r,i)};var lbe=new m,ube=new m,fbe=new m;Ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=y(n,re.WGS84).geodeticSurfaceNormal(e,lbe),o=m.cross(t,r,ube);m.equalsEpsilon(o,m.ZERO,P.EPSILON6)&&(o=m.clone(m.UNIT_X,o));let s=m.cross(o,t,fbe);return m.normalize(s,s),m.cross(t,s,o),m.negate(o,o),m.normalize(o,o),u(i)||(i=new Q),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var cQ=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),lQ=new he,uQ=new m,dbe=new m,mbe=new Q,t8=new N,fQ=new N;Ji.basisTo2D=function(e,t,n){let i=N.getTranslation(t,dbe),r=e.ellipsoid,o=r.cartesianToCartographic(i,lQ),s=e.project(o,uQ);m.fromElements(s.z,s.x,s.y,s);let a=Ji.eastNorthUpToFixedFrame(i,r,t8),c=N.inverseTransformation(a,fQ),l=N.getMatrix3(t,mbe),f=N.multiplyByMatrix3(c,l,n);return N.multiply(cQ,f,n),N.setTranslation(n,s,n),n};Ji.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ji.eastNorthUpToFixedFrame(t,i,t8),o=N.inverseTransformation(r,fQ),s=i.cartesianToCartographic(t,lQ),a=e.project(s,uQ);m.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,t8);return N.multiply(cQ,o,n),N.multiply(c,n,n),n};var Mt=Ji;function n8(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Be.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Xu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}n8.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&u(e.attributes[n])&&u(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var hbe=new he,pbe=new m,dQ=new N,_be=[new he,new he,new he],gbe=[new H,new H,new H],ybe=[new H,new H,new H],Abe=new m,xbe=new Le,Cbe=new N,Tbe=new ir;n8._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ce.center(i,hbe),s=he.toCartesian(o,n,pbe),a=Mt.eastNorthUpToFixedFrame(s,n,dQ),c=N.inverse(a,dQ),l=gbe,f=_be;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=Abe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=N.multiplyByPointAsVector(c,d,d),l[r].x=d.x,l[r].y=d.y;let p=Le.fromAxisAngle(m.UNIT_Z,-t,xbe),g=Q.fromQuaternion(p,Cbe),h=e.length,A=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(r=0;r<h;r++)d=N.multiplyByPointAsVector(c,e[r],d),d=Q.multiplyByVector(g,d,d),A=Math.min(A,d.x),x=Math.min(x,d.y),C=Math.max(C,d.x),T=Math.max(T,d.y);let E=ir.fromRotation(t,Tbe),S=ybe;S[0].x=A,S[0].y=x,S[1].x=A,S[1].y=T,S[2].x=C,S[2].y=x;let w=l[0],D=l[2].x-w.x,M=l[1].y-w.y;for(r=0;r<3;r++){let b=S[r];ir.multiplyByVector(E,b,b),b.x=(b.x-w.x)/D,b.y=(b.y-w.y)/M}let O=S[0],B=S[1],L=S[2],_=new Array(6);return H.pack(O,_),H.pack(B,_,2),H.pack(L,_,4),_};var dt=n8;function Ebe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Ie=Ebe;function lT(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(lT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});lT.clone=function(e){if(u(e))return new lT(e._format,e._datatype,e._width,e._height,e._buffer)};lT.prototype.clone=function(){return lT.clone(this)};var wv=lT;var mQ=Ki(Yl(),1);function hQ(){if(!u(_a._canTransferArrayBuffer)){let e=new Worker(_Q("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return _a._canTransferArrayBuffer=!1,_a._canTransferArrayBuffer}let i=Xs();e.onmessage=function(r){let o=r.data.array,s=u(o)&&o[0]===t;i.resolve(s),e.terminate(),_a._canTransferArrayBuffer=s},_a._canTransferArrayBuffer=i.promise}return _a._canTransferArrayBuffer}var r8=new _e;function pQ(e,t){--e._activeTasks;let n=t.id;if(!u(n))return;let i=e._deferreds,r=i[n];if(u(t.error)){let o=t.error;o.name==="RuntimeError"?(o=new de(t.error.message),o.stack=t.error.stack):o.name==="DeveloperError"&&(o=new fe(t.error.message),o.stack=t.error.stack),r8.raiseEvent(o),r.reject(o)}else r8.raiseEvent(),r.resolve(t.result);delete i[n]}function _Q(e){let t=en(e);if(v0(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var i8;function bbe(){return u(i8)||(i8=_Q("Workers/cesiumWorkerBootstrapper.js")),i8}function gQ(e){let t=new Worker(bbe());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:en("Workers")},baseUrl:en.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){pQ(e,i.data)},t}function Sbe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Gt.supportsWebAssembly()){if(!u(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=en(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=en(t.modulePath),n.wasmBinaryFile=en(t.wasmBinaryFile),we.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function _a(e,t){let n=new mQ.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:_a._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var vbe=[];_a.prototype.scheduleTask=function(e,t){if(u(this._worker)||(this._worker=gQ(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(hQ()).then(function(i){u(t)?i||(t.length=0):t=vbe;let r=n._nextID++,o=Xs();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise})};_a.prototype.initWebAssemblyModule=function(e){u(this._worker)||(this._worker=gQ(this));let t=Xs(),n=this,i=this._worker;return Sbe(this,e).then(function(r){return Promise.resolve(hQ()).then(function(o){let s,a=r.wasmBinary;u(a)&&o&&(s=[a]),i.onmessage=function(c){i.onmessage=function(l){pQ(n,l.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:r},s)})}),t.promise};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return u(this._worker)&&this._worker.terminate(),ue(this)};_a.taskCompletedEvent=r8;_a._defaultWorkerModulePrefix="Workers/";_a._workerModulePrefix=_a._defaultWorkerModulePrefix;_a._canTransferArrayBuffer=void 0;var _i=_a;function ip(){}ip._transcodeTaskProcessor=new _i("transcodeKTX2",Number.POSITIVE_INFINITY);ip._readyPromise=void 0;function wbe(){let e=ip._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return ip._transcodeTaskProcessor});ip._readyPromise=e}ip.transcode=function(e,t){return u(ip._readyPromise)||wbe(),ip._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]),o=r.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<o;c++){let l=a[r[c]];a[r[c]]=new wv(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o===1){for(s=0;s<i;++s)n[s]=n[s][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var Dv=ip;var yQ;AQ.setKTX2SupportedFormats=function(e,t,n,i,r,o){yQ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function AQ(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=we.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return Dv.transcode(n,yQ)})}var cl=AQ;function tU(e,t,n,i,r,o,s,a,c,l,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=l,this._initialized=f}Object.defineProperties(tU.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});tU.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context._gl,o=this._textureTarget,s=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture);let a=i.width,c=i.height,l=i.arrayBufferView,f=this._size,d=this._pixelFormat,p=this._internalFormat,g=this._pixelDatatype,h=this._preMultiplyAlpha,A=this._flipY,x=y(e.skipColorSpaceConversion,!1),C=4;u(l)&&(C=at.alignmentInBytes(d,g,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,C),x?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===f)u(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),A&&(l=at.flipY(l,d,g,f,f)),r.texImage2D(s,0,p,f,f,0,d,Ke.toWebGLConstant(g,this._context),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A),r.texImage2D(s,0,p,d,Ke.toWebGLConstant(g,this._context),i)),T=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let E=at.createTypedArray(d,g,f,f);r.texImage2D(s,0,p,f,f,0,d,Ke.toWebGLConstant(g,this._context),E)}this._initialized=!0}T||(u(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),A&&(l=at.flipY(l,d,g,a,c)),r.texSubImage2D(s,0,t,n,a,c,d,Ke.toWebGLConstant(g,this._context),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A),r.texSubImage2D(s,0,t,n,d,Ke.toWebGLConstant(g,this._context),i))),r.bindTexture(o,null)};tU.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._size),o=y(o,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};var Nm=tU;var nU={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===nU.DONT_CARE||e===nU.FASTEST||e===nU.NICEST}},Fm=Object.freeze(nU);var iU={NEAREST:te.NEAREST,LINEAR:te.LINEAR};iU.validate=function(e){return e===iU.NEAREST||e===iU.LINEAR};var Ti=Object.freeze(iU);var ig={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};ig.validate=function(e){return e===ig.NEAREST||e===ig.LINEAR||e===ig.NEAREST_MIPMAP_NEAREST||e===ig.LINEAR_MIPMAP_NEAREST||e===ig.NEAREST_MIPMAP_LINEAR||e===ig.LINEAR_MIPMAP_LINEAR};var cn=Object.freeze(ig);var rU={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===rU.CLAMP_TO_EDGE||e===rU.REPEAT||e===rU.MIRRORED_REPEAT}},wn=Object.freeze(rU);function Iv(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.wrapS,wn.CLAMP_TO_EDGE),n=y(e.wrapT,wn.CLAMP_TO_EDGE),i=y(e.minificationFilter,cn.LINEAR),r=y(e.magnificationFilter,Ti.LINEAR),o=u(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=r,this._maximumAnisotropy=o}Object.defineProperties(Iv.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});Iv.equals=function(e,t){return e===t||u(e)&&u(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};Iv.NEAREST=Object.freeze(new Iv({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST}));var fn=Iv;function Pv(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.source,i,r;if(u(n)){let T=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=T[0].width,r=T[0].height}else i=e.width,r=e.height;let o=i,s=y(e.pixelDatatype,Ke.UNSIGNED_BYTE),a=y(e.pixelFormat,at.RGBA),c=at.toInternalFormat(a,s,t),l=at.textureSizeInBytes(a,s,o,o)*6,f=e.preMultiplyAlpha||a===at.RGB||a===at.LUMINANCE,d=y(e.flipY,!0),p=y(e.skipColorSpaceConversion,!1),g=t._gl,h=g.TEXTURE_CUBE_MAP,A=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,A);function x(T,E,S,w,D){let M=E.arrayBufferView;u(M)||(M=E.bufferView);let O=4;u(M)&&(O=at.alignmentInBytes(a,s,i)),g.pixelStorei(g.UNPACK_ALIGNMENT,O),D?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),u(M)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),w&&(M=at.flipY(M,a,s,o,o)),g.texImage2D(T,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),M)):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,w),g.texImage2D(T,0,c,a,Ke.toWebGLConstant(s,t),E))}u(n)?(x(g.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,f,d,p),x(g.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,f,d,p),x(g.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,f,d,p)):(g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,o,o,0,a,Ke.toWebGLConstant(s,t),null)),g.bindTexture(h,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=A,this._pixelFormat=a,this._pixelDatatype=s,this._size=o,this._hasMipmap=!1,this._sizeInBytes=l,this._preMultiplyAlpha=f,this._flipY=d,this._sampler=void 0;let C=u(n);this._positiveX=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,o,f,d,C),this._negativeX=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,o,f,d,C),this._positiveY=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,o,f,d,C),this._negativeY=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,o,f,d,C),this._positiveZ=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,o,f,d,C),this._negativeZ=new Nm(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,o,f,d,C),this.sampler=u(e.sampler)?e.sampler:new fn}Object.defineProperties(Pv.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===cn.NEAREST_MIPMAP_NEAREST||t===cn.NEAREST_MIPMAP_LINEAR||t===cn.LINEAR_MIPMAP_NEAREST||t===cn.LINEAR_MIPMAP_LINEAR,r=this._context,o=this._pixelDatatype;(o===Ke.FLOAT&&!r.textureFloatLinear||o===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=i?cn.NEAREST_MIPMAP_NEAREST:cn.NEAREST,n=Ti.NEAREST);let s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),u(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Pv.prototype.generateMipmap=function(e){e=y(e,Fm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Pv.prototype.isDestroyed=function(){return!1};Pv.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Ga=Pv;function Dbe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Wa=Dbe;var Ov=`/** - * A built-in GLSL floating-point constant for converting radians to degrees. - * - * @alias czm_degreesPerRadian - * @glslConstant - * - * @see CesiumMath.DEGREES_PER_RADIAN - * - * @example - * // GLSL declaration - * const float czm_degreesPerRadian = ...; - * - * // Example - * float deg = czm_degreesPerRadian * rad; - */ -const float czm_degreesPerRadian = 57.29577951308232; -`;var Mv=`/** - * A built-in GLSL vec2 constant for defining the depth range. - * This is a workaround to a bug where IE11 does not implement gl_DepthRange. - * - * @alias czm_depthRange - * @glslConstant - * - * @example - * // GLSL declaration - * float depthRangeNear = czm_depthRange.near; - * float depthRangeFar = czm_depthRange.far; - * - */ -const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var Rv=`/** - * 0.1 - * - * @name czm_epsilon1 - * @glslConstant - */ -const float czm_epsilon1 = 0.1; -`;var Bv=`/** - * 0.01 - * - * @name czm_epsilon2 - * @glslConstant - */ -const float czm_epsilon2 = 0.01; -`;var Lv=`/** - * 0.001 - * - * @name czm_epsilon3 - * @glslConstant - */ -const float czm_epsilon3 = 0.001; -`;var Nv=`/** - * 0.0001 - * - * @name czm_epsilon4 - * @glslConstant - */ -const float czm_epsilon4 = 0.0001; -`;var Fv=`/** - * 0.00001 - * - * @name czm_epsilon5 - * @glslConstant - */ -const float czm_epsilon5 = 0.00001; -`;var Uv=`/** - * 0.000001 - * - * @name czm_epsilon6 - * @glslConstant - */ -const float czm_epsilon6 = 0.000001; -`;var Vv=`/** - * 0.0000001 - * - * @name czm_epsilon7 - * @glslConstant - */ -const float czm_epsilon7 = 0.0000001; -`;var kv=`/** - * DOC_TBA - * - * @name czm_infinity - * @glslConstant - */ -const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp? -`;var zv=`/** - * A built-in GLSL floating-point constant for <code>1/pi</code>. - * - * @alias czm_oneOverPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverPi = ...; - * - * // Example - * float pi = 1.0 / czm_oneOverPi; - */ -const float czm_oneOverPi = 0.3183098861837907; -`;var Hv=`/** - * A built-in GLSL floating-point constant for <code>1/2pi</code>. - * - * @alias czm_oneOverTwoPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_TWO_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverTwoPi = ...; - * - * // Example - * float pi = 2.0 * czm_oneOverTwoPi; - */ -const float czm_oneOverTwoPi = 0.15915494309189535; -`;var Gv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} - * - * @name czm_passCesium3DTile - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTile = 4.0; -`;var Wv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} - * - * @name czm_passCesium3DTileClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassification = 5.0; -`;var jv=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} - * - * @name czm_passCesium3DTileClassificationIgnoreShow - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var qv=`/** - * The automatic GLSL constant for {@link Pass#CLASSIFICATION} - * - * @name czm_passClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passClassification = 7.0; -`;var Yv=`/** - * The automatic GLSL constant for {@link Pass#COMPUTE} - * - * @name czm_passCompute - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCompute = 1.0; -`;var Xv=`/** - * The automatic GLSL constant for {@link Pass#ENVIRONMENT} - * - * @name czm_passEnvironment - * @glslConstant - * - * @see czm_pass - */ -const float czm_passEnvironment = 0.0; -`;var Kv=`/** - * The automatic GLSL constant for {@link Pass#GLOBE} - * - * @name czm_passGlobe - * @glslConstant - * - * @see czm_pass - */ -const float czm_passGlobe = 2.0; -`;var Jv=`/** - * The automatic GLSL constant for {@link Pass#OPAQUE} - * - * @name czm_passOpaque - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOpaque = 7.0; -`;var Zv=`/** - * The automatic GLSL constant for {@link Pass#OVERLAY} - * - * @name czm_passOverlay - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOverlay = 10.0; -`;var Qv=`/** - * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} - * - * @name czm_passTerrainClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTerrainClassification = 3.0; -`;var $v=`/** - * The automatic GLSL constant for {@link Pass#TRANSLUCENT} - * - * @name czm_passTranslucent - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTranslucent = 8.0; -`;var ew=`/** - * The automatic GLSL constant for {@link Pass#VOXELS} - * - * @name czm_passVoxels - * @glslConstant - * - * @see czm_pass - */ -const float czm_passVoxels = 9.0; -`;var tw=`/** - * A built-in GLSL floating-point constant for <code>Math.PI</code>. - * - * @alias czm_pi - * @glslConstant - * - * @see CesiumMath.PI - * - * @example - * // GLSL declaration - * const float czm_pi = ...; - * - * // Example - * float twoPi = 2.0 * czm_pi; - */ -const float czm_pi = 3.141592653589793; -`;var nw=`/** - * A built-in GLSL floating-point constant for <code>pi/4</code>. - * - * @alias czm_piOverFour - * @glslConstant - * - * @see CesiumMath.PI_OVER_FOUR - * - * @example - * // GLSL declaration - * const float czm_piOverFour = ...; - * - * // Example - * float pi = 4.0 * czm_piOverFour; - */ -const float czm_piOverFour = 0.7853981633974483; -`;var iw=`/** - * A built-in GLSL floating-point constant for <code>pi/6</code>. - * - * @alias czm_piOverSix - * @glslConstant - * - * @see CesiumMath.PI_OVER_SIX - * - * @example - * // GLSL declaration - * const float czm_piOverSix = ...; - * - * // Example - * float pi = 6.0 * czm_piOverSix; - */ -const float czm_piOverSix = 0.5235987755982988; -`;var rw=`/** - * A built-in GLSL floating-point constant for <code>pi/3</code>. - * - * @alias czm_piOverThree - * @glslConstant - * - * @see CesiumMath.PI_OVER_THREE - * - * @example - * // GLSL declaration - * const float czm_piOverThree = ...; - * - * // Example - * float pi = 3.0 * czm_piOverThree; - */ -const float czm_piOverThree = 1.0471975511965976; -`;var ow=`/** - * A built-in GLSL floating-point constant for <code>pi/2</code>. - * - * @alias czm_piOverTwo - * @glslConstant - * - * @see CesiumMath.PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_piOverTwo = ...; - * - * // Example - * float pi = 2.0 * czm_piOverTwo; - */ -const float czm_piOverTwo = 1.5707963267948966; -`;var sw=`/** - * A built-in GLSL floating-point constant for converting degrees to radians. - * - * @alias czm_radiansPerDegree - * @glslConstant - * - * @see CesiumMath.RADIANS_PER_DEGREE - * - * @example - * // GLSL declaration - * const float czm_radiansPerDegree = ...; - * - * // Example - * float rad = czm_radiansPerDegree * deg; - */ -const float czm_radiansPerDegree = 0.017453292519943295; -`;var aw=`/** - * The constant identifier for the 2D {@link SceneMode} - * - * @name czm_sceneMode2D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode2D = 2.0; -`;var cw=`/** - * The constant identifier for the 3D {@link SceneMode} - * - * @name czm_sceneMode3D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode3D = 3.0; -`;var lw=`/** - * The constant identifier for the Columbus View {@link SceneMode} - * - * @name czm_sceneModeColumbusView - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneModeColumbusView = 1.0; -`;var uw=`/** - * The constant identifier for the Morphing {@link SceneMode} - * - * @name czm_sceneModeMorphing - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - */ -const float czm_sceneModeMorphing = 0.0; -`;var fw=`/** - * A built-in GLSL floating-point constant for one solar radius. - * - * @alias czm_solarRadius - * @glslConstant - * - * @see CesiumMath.SOLAR_RADIUS - * - * @example - * // GLSL declaration - * const float czm_solarRadius = ...; - */ -const float czm_solarRadius = 695500000.0; -`;var dw=`/** - * A built-in GLSL floating-point constant for <code>3pi/2</code>. - * - * @alias czm_threePiOver2 - * @glslConstant - * - * @see CesiumMath.THREE_PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_threePiOver2 = ...; - * - * // Example - * float pi = (2.0 / 3.0) * czm_threePiOver2; - */ -const float czm_threePiOver2 = 4.71238898038469; -`;var mw=`/** - * A built-in GLSL floating-point constant for <code>2pi</code>. - * - * @alias czm_twoPi - * @glslConstant - * - * @see CesiumMath.TWO_PI - * - * @example - * // GLSL declaration - * const float czm_twoPi = ...; - * - * // Example - * float pi = czm_twoPi / 2.0; - */ -const float czm_twoPi = 6.283185307179586; -`;var hw=`/** - * The maximum latitude, in radians, both North and South, supported by a Web Mercator - * (EPSG:3857) projection. Technically, the Mercator projection is defined - * for any latitude up to (but not including) 90 degrees, but it makes sense - * to cut it off sooner because it grows exponentially with increasing latitude. - * The logic behind this particular cutoff value, which is the one used by - * Google Maps, Bing Maps, and Esri, is that it makes the projection - * square. That is, the rectangle is equal in the X and Y directions. - * - * The constant value is computed as follows: - * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) - * - * @name czm_webMercatorMaxLatitude - * @glslConstant - */ -const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var pw=`/** - * @name czm_depthRangeStruct - * @glslStruct - */ -struct czm_depthRangeStruct +`;var Ov=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() { - float near; - float far; -}; -`;var _w=`/** - * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} specular Intensity of incoming light reflecting in a single direction. - * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - */ -struct czm_material + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var Mv=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() { - vec3 diffuse; - float specular; - float shininess; - vec3 normal; - vec3 emission; - float alpha; -}; -`;var gw=`/** - * Used as input to every material's czm_getMaterial function. - * - * @name czm_materialInput - * @glslStruct - * - * @property {float} s 1D texture coordinates. - * @property {vec2} st 2D texture coordinates. - * @property {vec3} str 3D texture coordinates. - * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. - * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. - * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. - * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. - * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. - * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. - */ -struct czm_materialInput -{ - float s; - vec2 st; - vec3 str; - vec3 normalEC; - mat3 tangentToEyeMatrix; - vec3 positionToEyeEC; - float height; - float slope; - float aspect; -}; -`;var yw=`/** - * Struct for representing a material for a {@link Model}. The model - * rendering pipeline will pass this struct between material, custom shaders, - * and lighting stages. This is not to be confused with {@link czm_material} - * which is used by the older Fabric materials system, although they are similar. - * <p> - * All color values (diffuse, specular, emissive) are in linear color space. - * </p> - * - * @name czm_modelMaterial - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. - * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. - * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. - * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - */ -struct czm_modelMaterial { - vec3 diffuse; - float alpha; - vec3 specular; - float roughness; - vec3 normalEC; - float occlusion; - vec3 emissive; -}; -`;var Aw=`/** - * Struct for representing the output of a custom vertex shader. - * - * @name czm_modelVertexOutput - * @glslStruct - * - * @see {@link CustomShader} - * @see {@link Model} - * - * @property {vec3} positionMC The position of the vertex in model coordinates - * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. - */ -struct czm_modelVertexOutput { - vec3 positionMC; - float pointSize; -}; -`;var xw=`/** - * Parameters for {@link czm_pbrLighting} - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation - * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. - * @property {vec3} f0 The reflectance of the material at normal incidence - */ -struct czm_pbrParameters -{ - vec3 diffuseColor; - float roughness; - vec3 f0; -}; -`;var Cw=`/** - * DOC_TBA - * - * @name czm_ray - * @glslStruct - */ -struct czm_ray -{ - vec3 origin; - vec3 direction; -}; -`;var Tw=`/** - * DOC_TBA - * - * @name czm_raySegment - * @glslStruct - */ -struct czm_raySegment -{ - float start; - float stop; -}; + vec4 p = czm_computePosition(); -/** - * DOC_TBA - * - * @name czm_emptyRaySegment - * @glslConstant - */ -const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates -/** - * DOC_TBA - * - * @name czm_fullRaySegment - * @glslConstant - */ -const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var Ew=`struct czm_shadowParameters + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var Lv=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() { -#ifdef USE_CUBE_MAP_SHADOW - vec3 texCoords; -#else - vec2 texCoords; -#endif + vec3 positionToEyeEC = -v_positionEC; - float depthBias; - float depth; - float nDotL; - vec2 texelStepSize; - float normalShadingSmooth; - float darkness; -}; -`;var bw=`// See: -// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif -vec3 czm_acesTonemapping(vec3 color) { - float g = 0.985; - float a = 0.065; - float b = 0.0001; - float c = 0.433; - float d = 0.238; + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); - color = (color * (color + a) - b) / (color * (g * color + c) + d); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var Nv=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; - color = clamp(color, 0.0, 1.0); +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; - return color; -} -`;var Sw=`/** - * @private - */ -float czm_alphaWeight(float a) +void main() { - float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 p = czm_computePosition(); - // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: - // http://jcgt.org/published/0002/02/09/ - return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var vw=`/** - * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. - * - * @name czm_antialias - * @glslFunction - * - * @param {vec4} color1 The color on one side of the edge. - * @param {vec4} color2 The color on the other side of the edge. - * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>. - * @param {float} dist The distance to the edge in texture coordinates. - * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. - * @returns {vec4} The anti-aliased color. - * - * @example - * // GLSL declarations - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); - * - * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space - * float dist = abs(textureCoordinates.t - 0.5); - * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); - * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); - */ -vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var FSe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},_a=Object.freeze(FSe);var BSe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},wr=Object.freeze(BSe);var kSe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.SOURCE_ALPHA,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.ONE,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.SOURCE_ALPHA,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE,functionDestinationAlpha:wr.ONE})},dn=Object.freeze(kSe);var USe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},xi=Object.freeze(USe);function hT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(hT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});hT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};hT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};hT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=dn.ALPHA_BLEND):t.depthMask=!0,t};hT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=dn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),l(n)&&(i=gt(n,i,!0)),i};var or=hT;function VSe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var qn=VSe;function pT(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(pT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});pT.clone=function(e){if(l(e))return new pT(e._format,e._datatype,e._width,e._height,e._buffer)};pT.prototype.clone=function(){return pT.clone(this)};var Fv=pT;var XZ=Ki(Xl(),1);function KZ(){if(!l(ga._canTransferArrayBuffer)){let e=new Worker(ZZ("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ga._canTransferArrayBuffer=!1,ga._canTransferArrayBuffer}let i=Ys();e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i.resolve(s),e.terminate(),ga._canTransferArrayBuffer=s},ga._canTransferArrayBuffer=i.promise}return ga._canTransferArrayBuffer}var D8=new _e;function JZ(e,t){--e._activeTasks;let n=t.id;if(!l(n))return;let i=e._deferreds,r=i[n];if(l(t.error)){let o=t.error;o.name==="RuntimeError"?(o=new de(t.error.message),o.stack=t.error.stack):o.name==="DeveloperError"&&(o=new fe(t.error.message),o.stack=t.error.stack),D8.raiseEvent(o),r.reject(o)}else D8.raiseEvent(),r.resolve(t.result);delete i[n]}function ZZ(e){let t=tn(e);if(w0(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var P8;function zSe(){return l(P8)||(P8=ZZ("Workers/cesiumWorkerBootstrapper.js")),P8}function $Z(e){let t=new Worker(zSe());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:tn("Workers")},baseUrl:tn.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){JZ(e,i.data)},t}function HSe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Wt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=tn(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=tn(t.modulePath),n.wasmBinaryFile=tn(t.wasmBinaryFile),Ie.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function ga(e,t){let n=new XZ.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:ga._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var GSe=[];ga.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=$Z(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(KZ()).then(function(i){l(t)?i||(t.length=0):t=GSe;let r=n._nextID++,o=Ys();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise})};ga.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=$Z(this));let t=Ys(),n=this,i=this._worker;return HSe(this,e).then(function(r){return Promise.resolve(KZ()).then(function(o){let s,a=r.wasmBinary;l(a)&&o&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){JZ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:r},s)})}),t.promise};ga.prototype.isDestroyed=function(){return!1};ga.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};ga.taskCompletedEvent=D8;ga._defaultWorkerModulePrefix="Workers/";ga._workerModulePrefix=ga._defaultWorkerModulePrefix;ga._canTransferArrayBuffer=void 0;var bi=ga;function np(){}np._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);np._readyPromise=void 0;function WSe(){let e=np._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return np._transcodeTaskProcessor});np._readyPromise=e}np.transcode=function(e,t){return l(np._readyPromise)||WSe(),np._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]),o=r.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<o;c++){let u=a[r[c]];a[r[c]]=new Fv(u.internalFormat,u.datatype,u.width,u.height,u.levelBuffer)}}if(o===1){for(s=0;s<i;++s)n[s]=n[s][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var Bv=np;var QZ;e$.setKTX2SupportedFormats=function(e,t,n,i,r,o){QZ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function e$(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ie.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return Bv.transcode(n,QZ)})}var ll=e$;var Di={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Di.toWebGLConstant=function(e,t){switch(e){case Di.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Di.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Di.UNSIGNED_INT:return te.UNSIGNED_INT;case Di.FLOAT:return te.FLOAT;case Di.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Di.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Di.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Di.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Di.UNSIGNED_SHORT_5_6_5:return Di.UNSIGNED_SHORT_5_6_5}};Di.isPacked=function(e){return e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.sizeInBytes=function(e){switch(e){case Di.UNSIGNED_BYTE:return 1;case Di.UNSIGNED_SHORT:case Di.UNSIGNED_SHORT_4_4_4_4:case Di.UNSIGNED_SHORT_5_5_5_1:case Di.UNSIGNED_SHORT_5_6_5:case Di.HALF_FLOAT:return 2;case Di.UNSIGNED_INT:case Di.FLOAT:case Di.UNSIGNED_INT_24_8:return 4}};Di.validate=function(e){return e===Di.UNSIGNED_BYTE||e===Di.UNSIGNED_SHORT||e===Di.UNSIGNED_INT||e===Di.FLOAT||e===Di.HALF_FLOAT||e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};var Xe=Object.freeze(Di);var at={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:return 3;case at.RGBA:return 4;case at.LUMINANCE_ALPHA:case at.RG:return 2;case at.ALPHA:case at.RED:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let r=at.componentsLength(e);return Xe.isPacked(t)&&(r=1),r*Xe.sizeInBytes(t)*n*i};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let r,o=Xe.sizeInBytes(t);o===Uint8Array.BYTES_PER_ELEMENT?r=Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?r=Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===Xe.FLOAT?r=Float32Array:r=Uint32Array;let s=at.componentsLength(e)*n*i;return new r(s)};at.flipY=function(e,t,n,i,r){if(r===1)return e;let o=at.createTypedArray(t,n,i,r),s=at.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};at.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===at.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===at.DEPTH_COMPONENT){if(t===Xe.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Xe.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Xe.FLOAT)switch(e){case at.RGBA:return te.RGBA32F;case at.RGB:return te.RGB32F;case at.RG:return te.RG32F;case at.RED:return te.R32F}if(t===Xe.HALF_FLOAT)switch(e){case at.RGBA:return te.RGBA16F;case at.RGB:return te.RGB16F;case at.RG:return te.RG16F;case at.RED:return te.R16F}return e};var ct=Object.freeze(at);var go={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(go,{maximumCombinedTextureImageUnits:{get:function(){return go._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return go._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return go._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return go._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return go._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return go._maximumTextureSize}},maximumVaryingVectors:{get:function(){return go._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return go._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return go._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return go._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return go._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return go._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return go._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return go._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return go._maximumViewportWidth}},maximumViewportHeight:{get:function(){return go._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return go._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return go._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return go._maximumColorAttachments}},maximumSamples:{get:function(){return go._maximumSamples}},highpFloatSupported:{get:function(){return go._highpFloatSupported}},highpIntSupported:{get:function(){return go._highpIntSupported}}});var Ht=go;function nk(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(nk.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});nk.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context._gl,o=this._textureTarget,s=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._size,d=this._pixelFormat,p=this._internalFormat,g=this._pixelDatatype,h=this._preMultiplyAlpha,x=this._flipY,b=y(e.skipColorSpaceConversion,!1),C=4;l(u)&&(C=ct.alignmentInBytes(d,g,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,C),b?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===f)l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,d,g,f,f)),r.texImage2D(s,0,p,f,f,0,d,Xe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x),r.texImage2D(s,0,p,d,Xe.toWebGLConstant(g,this._context),i)),A=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let T=ct.createTypedArray(d,g,f,f);r.texImage2D(s,0,p,f,f,0,d,Xe.toWebGLConstant(g,this._context),T)}this._initialized=!0}A||(l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,d,g,a,c)),r.texSubImage2D(s,0,t,n,a,c,d,Xe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x),r.texSubImage2D(s,0,t,n,d,Xe.toWebGLConstant(g,this._context),i))),r.bindTexture(o,null)};nk.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._size),o=y(o,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};var Nm=nk;var ik={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===ik.DONT_CARE||e===ik.FASTEST||e===ik.NICEST}},Fm=Object.freeze(ik);var rk={NEAREST:te.NEAREST,LINEAR:te.LINEAR};rk.validate=function(e){return e===rk.NEAREST||e===rk.LINEAR};var Ai=Object.freeze(rk);var ag={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};ag.validate=function(e){return e===ag.NEAREST||e===ag.LINEAR||e===ag.NEAREST_MIPMAP_NEAREST||e===ag.LINEAR_MIPMAP_NEAREST||e===ag.NEAREST_MIPMAP_LINEAR||e===ag.LINEAR_MIPMAP_LINEAR};var ln=Object.freeze(ag);var ok={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===ok.CLAMP_TO_EDGE||e===ok.REPEAT||e===ok.MIRRORED_REPEAT}},In=Object.freeze(ok);function kv(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.wrapS,In.CLAMP_TO_EDGE),n=y(e.wrapT,In.CLAMP_TO_EDGE),i=y(e.minificationFilter,ln.LINEAR),r=y(e.magnificationFilter,Ai.LINEAR),o=l(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=r,this._maximumAnisotropy=o}Object.defineProperties(kv.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});kv.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};kv.NEAREST=Object.freeze(new kv({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST}));var mn=kv;function Uv(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.source,i,r;if(l(n)){let A=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=A[0].width,r=A[0].height}else i=e.width,r=e.height;let o=i,s=y(e.pixelDatatype,Xe.UNSIGNED_BYTE),a=y(e.pixelFormat,ct.RGBA),c=ct.toInternalFormat(a,s,t),u=ct.textureSizeInBytes(a,s,o,o)*6,f=e.preMultiplyAlpha||a===ct.RGB||a===ct.LUMINANCE,d=y(e.flipY,!0),p=y(e.skipColorSpaceConversion,!1),g=t._gl,h=g.TEXTURE_CUBE_MAP,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,x);function b(A,T,S,v,I){let O=T.arrayBufferView;l(O)||(O=T.bufferView);let R=4;l(O)&&(R=ct.alignmentInBytes(a,s,i)),g.pixelStorei(g.UNPACK_ALIGNMENT,R),I?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(O)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),v&&(O=ct.flipY(O,a,s,o,o)),g.texImage2D(A,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),O)):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,v),g.texImage2D(A,0,c,a,Xe.toWebGLConstant(s,t),T))}l(n)?(b(g.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,f,d,p),b(g.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,f,d,p),b(g.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,f,d,p)):(g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,o,o,0,a,Xe.toWebGLConstant(s,t),null)),g.bindTexture(h,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=x,this._pixelFormat=a,this._pixelDatatype=s,this._size=o,this._hasMipmap=!1,this._sizeInBytes=u,this._preMultiplyAlpha=f,this._flipY=d,this._sampler=void 0;let C=l(n);this._positiveX=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,o,f,d,C),this._negativeX=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,o,f,d,C),this._positiveY=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,o,f,d,C),this._negativeY=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,o,f,d,C),this._positiveZ=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,o,f,d,C),this._negativeZ=new Nm(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,o,f,d,C),this.sampler=l(e.sampler)?e.sampler:new mn}Object.defineProperties(Uv.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===ln.NEAREST_MIPMAP_NEAREST||t===ln.NEAREST_MIPMAP_LINEAR||t===ln.LINEAR_MIPMAP_NEAREST||t===ln.LINEAR_MIPMAP_LINEAR,r=this._context,o=this._pixelDatatype;(o===Xe.FLOAT&&!r.textureFloatLinear||o===Xe.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=i?ln.NEAREST_MIPMAP_NEAREST:ln.NEAREST,n=Ai.NEAREST);let s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Uv.prototype.generateMipmap=function(e){e=y(e,Fm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Uv.prototype.isDestroyed=function(){return!1};Uv.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Ha=Uv;function cd(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,r=e.source;l(r)&&(l(n)||(n=y(r.videoWidth,r.width)),l(i)||(i=y(r.videoHeight,r.height)));let o=y(e.pixelFormat,ct.RGBA),s=y(e.pixelDatatype,Xe.UNSIGNED_BYTE),a=ct.toInternalFormat(o,s,t),c=ct.isCompressedFormat(a),u=e.preMultiplyAlpha||o===ct.RGB||o===ct.LUMINANCE,f=y(e.flipY,!0),d=y(e.skipColorSpaceConversion,!1),p=!0,g=t._gl,h=g.TEXTURE_2D,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,x);let b=4;if(l(r)&&l(r.arrayBufferView)&&!c&&(b=ct.alignmentInBytes(o,s,n)),g.pixelStorei(g.UNPACK_ALIGNMENT,b),d?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(r))if(l(r.arrayBufferView)){g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1);let A=r.arrayBufferView,T,S,v;if(c){if(g.compressedTexImage2D(h,0,a,n,i,0,A),l(r.mipLevels))for(S=n,v=i,T=0;T<r.mipLevels.length;++T)S=Math.floor(S/2)|0,S<1&&(S=1),v=Math.floor(v/2)|0,v<1&&(v=1),g.compressedTexImage2D(h,T+1,a,S,v,0,r.mipLevels[T])}else if(f&&(A=ct.flipY(A,o,s,n,i)),g.texImage2D(h,0,a,n,i,0,o,Xe.toWebGLConstant(s,t),A),l(r.mipLevels))for(S=n,v=i,T=0;T<r.mipLevels.length;++T)S=Math.floor(S/2)|0,S<1&&(S=1),v=Math.floor(v/2)|0,v<1&&(v=1),g.texImage2D(h,T+1,a,S,v,0,o,Xe.toWebGLConstant(s,t),r.mipLevels[T])}else l(r.framebuffer)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._bind(),g.copyTexImage2D(h,0,a,r.xOffset,r.yOffset,n,i,0),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._unBind()):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,f),g.texImage2D(h,0,a,o,Xe.toWebGLConstant(s,t),r));else g.texImage2D(h,0,a,n,i,0,o,Xe.toWebGLConstant(s,t),null),p=!1;g.bindTexture(h,null);let C;c?C=ct.compressedTextureSizeInBytes(o,n,i):C=ct.textureSizeInBytes(o,s,n,i),this._id=qn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=x,this._internalFormat=a,this._pixelFormat=o,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new H(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=u,this._flipY=f,this._initialized=p,this._sampler=void 0,this.sampler=l(e.sampler)?e.sampler:new mn}cd.create=function(e){return new cd(e)};cd.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=y(e.pixelFormat,ct.RGB),r=y(e.framebufferXOffset,0),o=y(e.framebufferYOffset,0),s=y(e.width,n.drawingBufferWidth),a=y(e.height,n.drawingBufferHeight),c=e.framebuffer;return new cd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:r,yOffset:o,width:s,height:a}})};Object.defineProperties(cd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,r=this._pixelFormat,o=this._pixelDatatype,s=t===ln.NEAREST_MIPMAP_NEAREST||t===ln.NEAREST_MIPMAP_LINEAR||t===ln.LINEAR_MIPMAP_NEAREST||t===ln.LINEAR_MIPMAP_LINEAR;(o===Xe.FLOAT&&!i.textureFloatLinear||o===Xe.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?ln.NEAREST_MIPMAP_NEAREST:ln.NEAREST,n=Ai.NEAREST),i.webgl2&&ct.isDepthFormat(r)&&(t=ln.NEAREST,n=Ai.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});cd.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context,o=r._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._width,d=this._height,p=this._internalFormat,g=this._pixelFormat,h=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,C=y(e.skipColorSpaceConversion,!1),A=4;l(u)&&(A=ct.alignmentInBytes(g,h,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,A),C?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===d)l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),b&&(u=ct.flipY(u,g,h,f,d)),o.texImage2D(s,0,p,f,d,0,g,Xe.toWebGLConstant(h,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,b),o.texImage2D(s,0,p,g,Xe.toWebGLConstant(h,r),i)),T=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let S=ct.createTypedArray(g,h,f,d);o.texImage2D(s,0,p,f,d,0,g,Xe.toWebGLConstant(h,r),S)}this._initialized=!0}T||(l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),b&&(u=ct.flipY(u,g,h,a,c)),o.texSubImage2D(s,0,t,n,a,c,g,Xe.toWebGLConstant(h,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,b),o.texSubImage2D(s,0,t,n,g,Xe.toWebGLConstant(h,r),i))),o.bindTexture(s,null)};cd.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._width),o=y(o,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};cd.prototype.generateMipmap=function(e){e=y(e,Fm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Lt=cd;var Vv=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); - float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); - val1 = val1 * (1.0 - val2); - val1 = val1 * val1 * (3.0 - (2.0 * val1)); - val1 = pow(val1, 0.5); //makes the transition nicer - - vec4 midColor = (color1 + color2) * 0.5; - return mix(midColor, currentColor, val1); + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } +`;var zv=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; -vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) +czm_material czm_getMaterial(czm_materialInput materialInput) { - return czm_antialias(color1, color2, currentColor, dist, 0.1); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + vec2 centerPixel = fract(repeat * st); + float centerBump = texture(image, centerPixel).channel; + + float imageWidth = float(imageDimensions.x); + vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); + float rightBump = texture(image, rightPixel).channel; + + float imageHeight = float(imageDimensions.y); + vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); + float topBump = texture(image, leftPixel).channel; + + vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + material.diffuse = vec3(0.01); + + return material; } -`;var ww=`/** - * Approximately computes spherical coordinates given a normal. - * Uses approximate inverse trigonometry for speed and consistency, - * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. - * - * @name czm_approximateSphericalCoordinates - * @glslFunction - * - * @param {vec3} normal arbitrary-length normal. - * - * @returns {vec2} Approximate latitude and longitude spherical coordinates. - */ -vec2 czm_approximateSphericalCoordinates(vec3 normal) { - // Project into plane with vertical for latitude - float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); - float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); - return vec2(latitudeApproximation, longitudeApproximation); -} -`;var Dw=`/** - * Determines if the fragment is back facing - * - * @name czm_backFacing - * @glslFunction - * - * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>. - */ -bool czm_backFacing() +`;var Hv=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. - return gl_FrontFacing == false; -} -`;var Iw=`/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a float expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {float} a Value to return if the comparison is true. - * @param {float} b Value to return if the comparison is false. - * - * @returns {float} equivalent of comparison ? a : b - */ -float czm_branchFreeTernary(bool comparison, float a, float b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + czm_material material = czm_getDefaultMaterial(materialInput); -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec2 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec2} a Value to return if the comparison is true. - * @param {vec2} b Value to return if the comparison is false. - * - * @returns {vec2} equivalent of comparison ? a : b - */ -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + vec2 st = materialInput.st; -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec3 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec4 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var Pw=` -vec4 czm_cascadeColor(vec4 weights) +`;var Gv=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + - vec4(0.0, 1.0, 0.0, 1.0) * weights.y + - vec4(0.0, 0.0, 1.0, 1.0) * weights.z + - vec4(1.0, 0.0, 1.0, 1.0) * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var Ow=` -uniform vec4 shadowMap_cascadeDistances; +`;var Wv=`uniform sampler2D heights; +uniform sampler2D colors; -float czm_cascadeDistance(vec4 weights) +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) { - return dot(shadowMap_cascadeDistances, weights); + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif } -`;var Mw=` -uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +czm_material czm_getMaterial(czm_materialInput materialInput) { - return shadowMap_cascadeMatrices[0] * weights.x + - shadowMap_cascadeMatrices[1] * weights.y + - shadowMap_cascadeMatrices[2] * weights.z + - shadowMap_cascadeMatrices[3] * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; + } + + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var Rw=` -uniform vec4 shadowMap_cascadeSplits[2]; +`;var jv=`uniform vec4 color; +uniform float spacing; +uniform float width; -vec4 czm_cascadeWeights(float depthEye) +czm_material czm_getMaterial(czm_materialInput materialInput) { - // One component is set to 1.0 and all others set to 0.0. - vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); - vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); - return near * far; + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } -`;var Bw=`/** - * DOC_TBA - * - * @name czm_columbusViewMorph - * @glslFunction - */ -vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var qv=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // Just linear for now. - vec3 p = mix(position2D.xyz, position3D.xyz, time); - return vec4(p, 1.0); -} -`;var Lw=`/** - * Returns a position in model coordinates relative to eye taking into - * account the current scene mode: 3D, 2D, or Columbus view. - * <p> - * This uses standard position attributes, <code>position3DHigh</code>, - * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, - * and should be used when writing a vertex shader for an {@link Appearance}. - * </p> - * - * @name czm_computePosition - * @glslFunction - * - * @returns {vec4} The position relative to eye. - * - * @example - * vec4 p = czm_computePosition(); - * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * - * @see czm_translateRelativeToEye - */ -vec4 czm_computePosition(); -`;var Nw=`/** - * @private - */ -vec2 cordic(float angle) -{ -// Scale the vector by the appropriate factor for the 24 iterations to follow. - vec2 vector = vec2(6.0725293500888267e-1, 0.0); -// Iteration 1 - float sense = (angle < 0.0) ? -1.0 : 1.0; - // float factor = sense * 1.0; // 2^-0 - mat2 rotation = mat2(1.0, sense, -sense, 1.0); - vector = rotation * vector; - angle -= sense * 7.8539816339744828e-1; // atan(2^-0) -// Iteration 2 - sense = (angle < 0.0) ? -1.0 : 1.0; - float factor = sense * 5.0e-1; // 2^-1 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.6364760900080609e-1; // atan(2^-1) -// Iteration 3 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.5e-1; // 2^-2 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4497866312686414e-1; // atan(2^-2) -// Iteration 4 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.25e-1; // 2^-3 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2435499454676144e-1; // atan(2^-3) -// Iteration 5 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.25e-2; // 2^-4 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.2418809995957350e-2; // atan(2^-4) -// Iteration 6 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.125e-2; // 2^-5 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.1239833430268277e-2; // atan(2^-5) -// Iteration 7 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.5625e-2; // 2^-6 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5623728620476831e-2; // atan(2^-6) -// Iteration 8 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.8125e-3; // 2^-7 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.8123410601011111e-3; // atan(2^-7) -// Iteration 9 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.90625e-3; // 2^-8 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.9062301319669718e-3; // atan(2^-8) -// Iteration 10 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.953125e-3; // 2^-9 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9531225164788188e-3; // atan(2^-9) -// Iteration 11 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.765625e-4; // 2^-10 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.7656218955931946e-4; // atan(2^-10) -// Iteration 12 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.8828125e-4; // 2^-11 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.8828121119489829e-4; // atan(2^-11) -// Iteration 13 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.44140625e-4; // 2^-12 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4414062014936177e-4; // atan(2^-12) -// Iteration 14 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.220703125e-4; // 2^-13 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2207031189367021e-4; // atan(2^-13) -// Iteration 15 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.103515625e-5; // 2^-14 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.1035156174208773e-5; // atan(2^-14) -// Iteration 16 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.0517578125e-5; // 2^-15 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.0517578115526096e-5; // atan(2^-15) -// Iteration 17 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.52587890625e-5; // 2^-16 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5258789061315762e-5; // atan(2^-16) -// Iteration 18 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.62939453125e-6; // 2^-17 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.6293945311019700e-6; // atan(2^-17) -// Iteration 19 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.814697265625e-6; // 2^-18 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.8146972656064961e-6; // atan(2^-18) -// Iteration 20 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.9073486328125e-6; // 2^-19 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9073486328101870e-6; // atan(2^-19) -// Iteration 21 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.5367431640625e-7; // 2^-20 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.5367431640596084e-7; // atan(2^-20) -// Iteration 22 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.76837158203125e-7; // 2^-21 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.7683715820308884e-7; // atan(2^-21) -// Iteration 23 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.384185791015625e-7; // 2^-22 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.3841857910155797e-7; // atan(2^-22) -// Iteration 24 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.1920928955078125e-7; // 2^-23 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; -// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) - - return vector; + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } +`;var Yv=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; -/** - * Computes the cosine and sine of the provided angle using the CORDIC algorithm. - * - * @name czm_cosineAndSine - * @glslFunction - * - * @param {float} angle The angle in radians. - * - * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). - * - * @example - * vec2 v = czm_cosineAndSine(czm_piOverSix); - * float cosine = v.x; - * float sine = v.y; - */ -vec2 czm_cosineAndSine(float angle) +float getTime(float t, float coord) { - if (angle < -czm_piOverTwo || angle > czm_piOverTwo) - { - if (angle < 0.0) - { - return -cordic(angle + czm_pi); - } - else - { - return -cordic(angle - czm_pi); - } - } - else + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) { - return cordic(angle); + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); } + return clamp(q, 0.0, 1.0); } -`;var Fw=`/** - * Decompresses texture coordinates that were packed into a single float. - * - * @name czm_decompressTextureCoordinates - * @glslFunction - * - * @param {float} encoded The compressed texture coordinates. - * @returns {vec2} The decompressed texture coordinates. - */ - vec2 czm_decompressTextureCoordinates(float encoded) - { - float temp = encoded / 4096.0; - float xZeroTo4095 = floor(temp); - float stx = xZeroTo4095 / 4095.0; - float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; - return vec2(stx, sty); - } -`;var Uw=`/** - * Get default parameters for physically based rendering. These defaults - * describe a rough dielectric (non-metal) surface (e.g. rough plastic). - * - * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} - */ -czm_pbrParameters czm_defaultPbrMaterial() + +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_pbrParameters results; - results.diffuseColor = vec3(1.0); - results.roughness = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - results.f0 = REFLECTANCE_DIELECTRIC; - return results; + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; } -`;var Vw=`// emulated noperspective -#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif +`;var Xv=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; -/** - * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. - * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, - * capping the shadow volume. More information here: - * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. - * - * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring - * no geometry gets clipped by setting the clip space z value to 0.0 and then - * sending the unaltered screen space z value (using emulated noperspective - * interpolation) to the frag shader where it is clamped to [0,1] and then - * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: - * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. - * - * When GL_EXT_frag_depth is not available, which is the case on some mobile - * devices, we must attempt to fix this only in the vertex shader. - * The approach is to clamp the z value to the far plane, which closes the - * shadow volume but also distorts the geometry, so there can still be artifacts - * on frustum seams. - * - * @name czm_depthClamp - * @glslFunction - * - * @param {vec4} coords The vertex in clip coordinates. - * @returns {vec4} The modified vertex. - * - * @example - * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); - * - * @see czm_writeDepthClamp - */ -vec4 czm_depthClamp(vec4 coords) +czm_material czm_getMaterial(czm_materialInput materialInput) { -#ifndef LOG_DEPTH -#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) - v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; - coords.z = 0.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); #else - coords.z = min(coords.z, coords.w); -#endif + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); #endif - return coords; -} -`;var kw=`/** - * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system - * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the - * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. - * <br /><br /> - * The ellipsoid is assumed to be centered at the model coordinate's origin. - * - * @name czm_eastNorthUpToEyeCoordinates - * @glslFunction - * - * @param {vec3} positionMC The position on the ellipsoid in model coordinates. - * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates. - * - * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. - * - * @example - * // Transform a vector defined in the east-north-up coordinate - * // system, (0, 0, 1) which is the surface normal, to eye - * // coordinates. - * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); - */ -mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) -{ - vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates - vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes - vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates - return mat3( - tangentEC.x, tangentEC.y, tangentEC.z, - bitangentEC.x, bitangentEC.y, bitangentEC.z, - normalEC.x, normalEC.y, normalEC.z); + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; } -`;var zw=`/** - * DOC_TBA - * - * @name czm_ellipsoidContainsPoint - * @glslFunction - * - */ -bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var Kv=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; - return (dot(scaled, scaled) <= 1.0); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; } -`;var Hw=`/** - * DOC_TBA - * - * @name czm_ellipsoidWgs84TextureCoordinates - * @glslFunction - */ -vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +`;var Jv=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) { - return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var Gw=`/** - * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code> - * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs - * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s, - * <code>vec3</code>s, or <code>vec4</code>s. - * - * @name czm_equalsEpsilon - * @glslFunction - * - * @param {} left The first vector. - * @param {} right The second vector. - * @param {float} epsilon The epsilon to use for equality testing. - * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise. - * - * @example - * // GLSL declarations - * bool czm_equalsEpsilon(float left, float right, float epsilon); - * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); - * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); - * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); - */ -bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec4(epsilon))); + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; } -bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec3(epsilon))); -} +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); -bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec2(epsilon))); -} + vec2 st = materialInput.st; -bool czm_equalsEpsilon(float left, float right, float epsilon) { - return (abs(left - right) <= epsilon); -} -`;var Ww=`/** - * DOC_TBA - * - * @name czm_eyeOffset - * @glslFunction - * - * @param {vec4} positionEC DOC_TBA. - * @param {vec3} eyeOffset DOC_TBA. - * - * @returns {vec4} DOC_TBA. - */ -vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) -{ - // This equation is approximate in x and y. - vec4 p = positionEC; - vec4 zEyeOffset = normalize(p) * eyeOffset.z; - p.xy += eyeOffset.xy + zEyeOffset.xy; - p.z += zEyeOffset.z; - return p; -} -`;var jw=`/** - * Transforms a position from eye to window coordinates. The transformation - * from eye to clip coordinates is done using {@link czm_projection}. - * The transform from normalized device coordinates to window coordinates is - * done using {@link czm_viewportTransformation}, which assumes a depth range - * of <code>near = 0</code> and <code>far = 1</code>. - * <br /><br /> - * This transform is useful when there is a need to manipulate window coordinates - * in a vertex shader as done by {@link BillboardCollection}. - * - * @name czm_eyeToWindowCoordinates - * @glslFunction - * - * @param {vec4} position The position in eye coordinates to transform. - * - * @returns {vec4} The transformed position in window coordinates. - * - * @see czm_modelToWindowCoordinates - * @see czm_projection - * @see czm_viewportTransformation - * @see BillboardCollection - * - * @example - * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - */ -vec4 czm_eyeToWindowCoordinates(vec4 positionEC) -{ - vec4 q = czm_projection * positionEC; // clip coordinates - q.xyz /= q.w; // normalized device coordinates - q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates - return q; +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; } -`;var qw=`/** - * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. - * - * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on - * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. - * Adapted from ShaderFastLibs under MIT License. - * - * Chosen for the following characteristics over range [0, 1]: - * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) - * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) - * - * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); - * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between 0 and 1 inclusive. - * - * @returns {float} Approximation of atan(x) - */ -float czm_fastApproximateAtan(float x) { - return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +`;var Zv=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); } -/** - * Approximation of atan2. - * - * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html - * However, we replaced their atan curve with Michael Drobot's (see above). - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between -1 and 1 inclusive. - * @param {float} y Value between -1 and 1 inclusive. - * - * @returns {float} Approximation of atan2(x, y) - */ -float czm_fastApproximateAtan(float x, float y) { - // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. - // So range-reduce using abs and by flipping whether x or y is on top. - float t = abs(x); // t used as swap and atan result. - float opposite = abs(y); - float adjacent = max(t, opposite); - opposite = min(t, opposite); +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); - t = czm_fastApproximateAtan(opposite / adjacent); + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - // Undo range reduction - t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); - t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); - t = czm_branchFreeTernary(y < 0.0, -t, t); - return t; + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; } -`;var Yw=`/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var $v=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-(scalar * scalar)); - return mix(color, fogColor, fog); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; } +`;var Qv=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; -/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * @param {float} fogModifierConstant A constant to modify the appearance of fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); - return mix(color, fogColor, fog); -} -`;var Xw=`/** - * Converts a color from RGB space to linear space. - * - * @name czm_gammaCorrect - * @glslFunction - * - * @param {vec3} color The color in RGB space. - * @returns {vec3} The color in linear space. - */ -vec3 czm_gammaCorrect(vec3 color) { -#ifdef HDR - color = pow(color, vec3(czm_gamma)); -#endif - return color; -} + czm_material material = czm_getDefaultMaterial(materialInput); -vec4 czm_gammaCorrect(vec4 color) { -#ifdef HDR - color.rgb = pow(color.rgb, vec3(czm_gamma)); -#endif - return color; + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } -`;var Kw=`/** - * DOC_TBA - * - * @name czm_geodeticSurfaceNormal - * @glslFunction - * - * @param {vec3} positionOnEllipsoid DOC_TBA - * @param {vec3} ellipsoidCenter DOC_TBA - * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA - * - * @returns {vec3} DOC_TBA. - */ -vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) -{ - return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); -} -`;var Jw=`/** - * An czm_material with default values. Every material's czm_getMaterial - * should use this default material as a base for the material it returns. - * The default normal value is given by materialInput.normalEC. - * - * @name czm_getDefaultMaterial - * @glslFunction - * - * @param {czm_materialInput} input The input used to construct the default material. - * - * @returns {czm_material} The default material. - * - * @see czm_materialInput - * @see czm_material - * @see czm_getMaterial - */ -czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +`;var ew=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_material material; - material.diffuse = vec3(0.0); - material.specular = 0.0; - material.shininess = 1.0; - material.normal = materialInput.normalEC; - material.emission = vec3(0.0); - material.alpha = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + return material; } -`;var Zw=`/** - * Calculates the intensity of diffusely reflected light. - * - * @name czm_getLambertDiffuse - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * - * @returns {float} The intensity of the diffuse reflection. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var tw=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return max(dot(lightDirectionEC, normalEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } -`;var Qw=`/** - * Calculates the specular intensity of reflected light. - * - * @name czm_getSpecular - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * - * @returns {float} The intensity of the specular highlight. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var nw=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); - float specular = max(dot(toReflectedLight, toEyeEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); - // pow has undefined behavior if both parameters <= 0. - // Prevent this by making sure shininess is at least czm_epsilon2. - return pow(specular, max(shininess, czm_epsilon2)); + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var $w=`/** - * @private - */ -vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var iw=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float cosAngle = cos(angleInRadians); - float sinAngle = sin(angleInRadians); + czm_material material = czm_getDefaultMaterial(materialInput); - // time dependent sampling directions - vec2 s0 = vec2(1.0/17.0, 0.0); - vec2 s1 = vec2(-1.0/29.0, 0.0); - vec2 s2 = vec2(1.0/101.0, 1.0/59.0); - vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); + float time = czm_frameNumber * animationSpeed; - // rotate sampling direction by specified angle - s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); - s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); - s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); - s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - vec2 uv0 = (uv/103.0) + (time * s0); - vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); - vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); - vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); + float specularMapValue = texture(specularMap, materialInput.st).r; - uv0 = fract(uv0); - uv1 = fract(uv1); - uv2 = fract(uv2); - uv3 = fract(uv3); - vec4 noise = (texture(normalMap, uv0)) + - (texture(normalMap, uv1)) + - (texture(normalMap, uv2)) + - (texture(normalMap, uv3)); + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - // average and scale to between -1 and 1 - return ((noise / 4.0) - 0.5) * 2.0; -} -`;var eD=`/** - * Converts an HSB color (hue, saturation, brightness) to RGB - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} - * - * @name czm_HSBToRGB - * @glslFunction - * - * @param {vec3} hsb The color in HSB. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); - */ + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; -const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); -vec3 czm_HSBToRGB(vec3 hsb) + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function qe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,ln.LINEAR),this._magnificationFilter=y(e.magnificationFilter,Ai.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,jSe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(qe._uniformList[this.type])||(qe._uniformList[this.type]=Object.keys(this._uniforms))}qe._uniformList={};qe.fromType=function(e,t){let n=new qe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};qe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};qe.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let d=new mn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Lt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Lt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let h=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let x=this.uniforms[h];x.x=p._width,x.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new Ha({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new mn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};qe.prototype.isDestroyed=function(){return!1};qe.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function jSe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=je(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=je(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=je(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:qn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=qe._materialCache.getMaterial(t.type);if(l(i)){let o=je(i.fabric,!0);t._template=gt(t._template,o,!0),n=i.translucent}KSe(t),l(i)||qe._materialCache.addMaterial(t.type,t),ZSe(t),tve(t),ive(t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,r),n=y(e.translucent,n),l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function R8(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function t$(e,t){}function qSe(e,t){}var YSe=["type","materials","uniforms","components","source"],XSe=["diffuse","specular","shininess","normal","emission","alpha"];function KSe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;R8(t,YSe,t$,!0),R8(r,XSe,t$,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);R8(n,o,qSe,!1)}function JSe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function ZSe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); - return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&JSe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; +`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${r} = ${t[r]}; +`}e.shaderSource+=`return material; } -`;var tD=`/** - * Converts an HSL color (hue, saturation, lightness) to RGB - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} - * - * @name czm_HSLToRGB - * @glslFunction - * - * @param {vec3} rgb The color in HSL. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); - */ +`}}var n$={mat2:ir,mat3:$,mat4:F},$Se=/\.ktx2$/i;function QSe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===qe.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new mn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Lt({context:i,source:o,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Lt&&o!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),a)return;let d=o instanceof Ie;if(!l(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if(typeof o=="string"||d){let p=d?o:Ie.createIfNeeded(o),g;$Se.test(p.url)?g=ll(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}function eve(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ha){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===qe.DefaultCubeMapId)return;let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){let o=[Ie.createIfNeeded(i.positiveX).fetchImage(),Ie.createIfNeeded(i.negativeX).fetchImage(),Ie.createIfNeeded(i.positiveY).fetchImage(),Ie.createIfNeeded(i.negativeY).fetchImage(),Ie.createIfNeeded(i.positiveZ).fetchImage(),Ie.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(o).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=r}}}function tve(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&i$(e,n)}function i$(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=nve(r),s;if(o==="channels")s=rw(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;rve(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},i$(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=rw(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(QSe(t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(eve(t));else if(o.indexOf("mat")!==-1){let u=new n$[o];e._uniforms[c]=function(){return n$[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function nve(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ie||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===qe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function ive(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new qe({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=gt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;rw(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=rw(e,i,a)}}function rw(e,t,n,i){i=y(i,!0);let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function rve(e,t,n){return rw(e,t,t,n)}qe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};qe.DefaultImageId="czm_defaultImage";qe.DefaultCubeMapId="czm_defaultCubeMap";qe.ColorType="Color";qe._materialCache.addMaterial(qe.ColorType,{fabric:{type:qe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.ImageType="Image";qe._materialCache.addMaterial(qe.ImageType,{fabric:{type:qe.ImageType,uniforms:{image:qe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.DiffuseMapType="DiffuseMap";qe._materialCache.addMaterial(qe.DiffuseMapType,{fabric:{type:qe.DiffuseMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.AlphaMapType="AlphaMap";qe._materialCache.addMaterial(qe.AlphaMapType,{fabric:{type:qe.AlphaMapType,uniforms:{image:qe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});qe.SpecularMapType="SpecularMap";qe._materialCache.addMaterial(qe.SpecularMapType,{fabric:{type:qe.SpecularMapType,uniforms:{image:qe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});qe.EmissionMapType="EmissionMap";qe._materialCache.addMaterial(qe.EmissionMapType,{fabric:{type:qe.EmissionMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.BumpMapType="BumpMap";qe._materialCache.addMaterial(qe.BumpMapType,{fabric:{type:qe.BumpMapType,uniforms:{image:qe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:zv},translucent:!1});qe.NormalMapType="NormalMap";qe._materialCache.addMaterial(qe.NormalMapType,{fabric:{type:qe.NormalMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:Kv},translucent:!1});qe.GridType="Grid";qe._materialCache.addMaterial(qe.GridType,{fabric:{type:qe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:Xv},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});qe.StripeType="Stripe";qe._materialCache.addMaterial(qe.StripeType,{fabric:{type:qe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:nw},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});qe.CheckerboardType="Checkerboard";qe._materialCache.addMaterial(qe.CheckerboardType,{fabric:{type:qe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:Hv},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.DotType="Dot";qe._materialCache.addMaterial(qe.DotType,{fabric:{type:qe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:Gv},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.WaterType="Water";qe._materialCache.addMaterial(qe.WaterType,{fabric:{type:qe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:qe.DefaultImageId,normalMap:qe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:iw},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});qe.RimLightingType="RimLighting";qe._materialCache.addMaterial(qe.RimLightingType,{fabric:{type:qe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:ew},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});qe.FadeType="Fade";qe._materialCache.addMaterial(qe.FadeType,{fabric:{type:qe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:Yv},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});qe.PolylineArrowType="PolylineArrow";qe._materialCache.addMaterial(qe.PolylineArrowType,{fabric:{type:qe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:Jv},translucent:!0});qe.PolylineDashType="PolylineDash";qe._materialCache.addMaterial(qe.PolylineDashType,{fabric:{type:qe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:Zv},translucent:!0});qe.PolylineGlowType="PolylineGlow";qe._materialCache.addMaterial(qe.PolylineGlowType,{fabric:{type:qe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:$v},translucent:!0});qe.PolylineOutlineType="PolylineOutline";qe._materialCache.addMaterial(qe.PolylineOutlineType,{fabric:{type:qe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:Qv},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});qe.ElevationContourType="ElevationContour";qe._materialCache.addMaterial(qe.ElevationContourType,{fabric:{type:qe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:jv},translucent:!1});qe.ElevationRampType="ElevationRamp";qe._materialCache.addMaterial(qe.ElevationRampType,{fabric:{type:qe.ElevationRampType,uniforms:{image:qe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:qv},translucent:!1});qe.SlopeRampMaterialType="SlopeRamp";qe._materialCache.addMaterial(qe.SlopeRampMaterialType,{fabric:{type:qe.SlopeRampMaterialType,uniforms:{image:qe.DefaultImageId},source:tw},translucent:!1});qe.AspectRampMaterialType="AspectRamp";qe._materialCache.addMaterial(qe.AspectRampMaterialType,{fabric:{type:qe.AspectRampMaterialType,uniforms:{image:qe.DefaultImageId},source:Vv},translucent:!1});qe.ElevationBandType="ElevationBand";qe._materialCache.addMaterial(qe.ElevationBandType,{fabric:{type:qe.ElevationBandType,uniforms:{heights:qe.DefaultImageId,colors:qe.DefaultImageId},source:Wv},translucent:!0});var Wi=qe;function N0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,N0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(N0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});N0.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;N0.prototype.isTranslucent=or.prototype.isTranslucent;N0.prototype.getRenderState=or.prototype.getRenderState;N0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Oe.POSITION_AND_NORMAL,vertexShaderSource:Mv,fragmentShaderSource:Ov}),TEXTURED:Object.freeze({vertexFormat:Oe.POSITION_NORMAL_AND_ST,vertexShaderSource:Nv,fragmentShaderSource:Lv}),ALL:Object.freeze({vertexFormat:Oe.ALL,vertexShaderSource:Rv,fragmentShaderSource:Dv})};var fr=N0;var ow=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; -vec3 hueToRGB(float hue) +void main() { - float r = abs(hue * 6.0 - 3.0) - 1.0; - float g = 2.0 - abs(hue * 6.0 - 2.0); - float b = 2.0 - abs(hue * 6.0 - 4.0); - return clamp(vec3(r, g, b), 0.0, 1.0); + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); } +`;var sw=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; -vec3 czm_HSLToRGB(vec3 hsl) +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() { - vec3 rgb = hueToRGB(hsl.x); - float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; - return (rgb - 0.5) * c + hsl.z; + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var nD=`/** - * Adjusts the hue of a color. - * - * @name czm_hue - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the hue of the color in radians. - * - * @returns {float} The color with the hue adjusted. - * - * @example - * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) - */ -vec3 czm_hue(vec3 rgb, float adjustment) +`;var F0=`in vec4 v_color; + +void main() { - const mat3 toYIQ = mat3(0.299, 0.587, 0.114, - 0.595716, -0.274453, -0.321263, - 0.211456, -0.522591, 0.311135); - const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, - 1.0, -0.2721, -0.6474, - 1.0, -1.107, 1.7046); - - vec3 yiq = toYIQ * rgb; - float hue = atan(yiq.z, yiq.y) + adjustment; - float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); - - vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); - return toRGB * color; + out_FragColor = czm_gammaCorrect(v_color); } -`;var iD=`/** - * Converts a color in linear space to RGB space. +`;var aw=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function ip(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),r=i?aw:sw,o=i?F0:ow,s=i?ip.FLAT_VERTEX_FORMAT:ip.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,r),this._fragmentShaderSource=y(e.fragmentShaderSource,o),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(ip.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});ip.VERTEX_FORMAT=Oe.POSITION_AND_NORMAL;ip.FLAT_VERTEX_FORMAT=Oe.POSITION_ONLY;ip.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;ip.prototype.isTranslucent=or.prototype.isTranslucent;ip.prototype.getRenderState=or.prototype.getRenderState;var an=ip;function _T(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(_T.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});_T.prototype.getType=function(e){return"Color"};_T.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};_T.prototype.equals=function(e){return this===e||e instanceof _T&&q.equals(this._color,e._color)};var Vt=_T;function cg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Pi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(cg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});cg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};cg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};cg.prototype.rectangleToNativeRectangle=function(e,t){let n=D.toDegrees(e.west),i=D.toDegrees(e.south),r=D.toDegrees(e.east),o=D.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=r,t.north=o,t):new ce(n,i,r,o)};cg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.tileXYToRectangle(e,t,n,i);return r.west=D.toDegrees(r.west),r.south=D.toDegrees(r.south),r.east=D.toDegrees(r.east),r.north=D.toDegrees(r.north),r};cg.prototype.tileXYToRectangle=function(e,t,n,i){let r=this._rectangle,o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=e*a+r.west,u=(e+1)*a+r.west,f=r.height/s,d=r.north-t*f,p=r.north-(t+1)*f;return l(i)||(i=new ce(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};cg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),s=i.width/r,a=i.height/o,c=e.longitude;i.east<i.west&&(c+=D.TWO_PI);let u=(c-i.west)/s|0;u>=r&&(u=r-1);let f=(i.north-e.latitude)/a|0;return f>=o&&(f=o-1),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var ji=cg;var r$=new m,o$=new m,s$=new me,O8=new m,ove=new m,a$=new ae,sve=new ji,cw=[new me,new me,new me,new me],lw=new H,Go={};Go.initialize=function(){let e=Go._initPromise;return l(e)||(e=Ie.fetchJson(tn("Assets/approximateTerrainHeights.json")).then(function(t){Go._terrainHeights=t}),Go._initPromise=e),e};Go.getMinimumMaximumHeights=function(e,t){t=y(t,re.WGS84);let n=c$(e),i=Go._defaultMinTerrainHeight,r=Go._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Go._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ce.northeast(e,s$),r$),t.cartographicToCartesian(ce.southwest(e,s$),o$),m.midpoint(o$,r$,O8);let a=t.scaleToGeodeticSurface(O8,ove);if(l(a)){let c=m.distance(O8,a);i=Math.min(i,-c)}else i=Go._defaultMinTerrainHeight}return i=Math.max(Go._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Go.getBoundingSphere=function(e,t){t=y(t,re.WGS84);let n=c$(e),i=Go._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Go._terrainHeights[o];l(s)&&(i=s[1])}let r=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,a$),ae.union(r,a$,r)};function c$(e){me.fromRadians(e.east,e.north,0,cw[0]),me.fromRadians(e.west,e.north,0,cw[1]),me.fromRadians(e.east,e.south,0,cw[2]),me.fromRadians(e.west,e.south,0,cw[3]);let t=0,n=0,i=0,r=0,o=Go._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=cw[c];if(sve.positionToTileXY(u,s,lw),c===0)i=lw.x,r=lw.y;else if(i!==lw.x||r!==lw.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Go._terrainHeightsMaxLevel=6;Go._defaultMaxTerrainHeight=9e3;Go._defaultMinTerrainHeight=-1e5;Go._terrainHeights=void 0;Go._initPromise=void 0;Object.defineProperties(Go,{initialized:{get:function(){return l(Go._terrainHeights)}}});var oi=Go;var l$={};function uw(e,t){l(l$[e])||(l$[e]=!0,console.warn(y(t,e)))}uw.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";uw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";uw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";uw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Nt=uw;function ave(e,t){Nt(e,t)}var Q=ave;function Ec(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Ec.fromCorners=function(e,t,n){return l(n)||(n=new Ec),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Ec.fromPoints=function(e,t){if(l(t)||(t=new Ec),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,h=p.y,x=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(h,i),s=Math.max(h,s),r=Math.min(x,r),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=m.midpoint(u,f,t.center),t};Ec.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new Ec(e.minimum,e.maximum,e.center)};Ec.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var sk=new m;Ec.intersectPlane=function(e,t){sk=m.subtract(e.maximum,e.minimum,sk);let n=m.multiplyByScalar(sk,.5,sk),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=m.dot(e.center,i)+t.distance;return o-r>0?en.INSIDE:o+r<0?en.OUTSIDE:en.INTERSECTING};Ec.prototype.clone=function(e){return Ec.clone(this,e)};Ec.prototype.intersectPlane=function(e){return Ec.intersectPlane(this,e)};Ec.prototype.equals=function(e){return Ec.equals(this,e)};var lg=Ec;var M8={};M8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function u$(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}M8.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=u$(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*u$(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Sc=M8;var N8={};N8.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function L8(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,h=o*a-d,x=4*p*h-g*g,b,C;if(x<0){let Y,j,J;f*u>=c*d?(Y=r,j=p,J=-2*o*p+r*g):(Y=a,j=h,J=-a*g+2*s*h);let K=-(J<0?-1:1)*Math.abs(Y)*Math.sqrt(-x);C=-J+K;let Z=C/2,he=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),ge=C===K?-he:-j/he;return b=j<=0?he+ge:-J/(he*he+ge*ge+j),f*u>=c*d?[(b-o)/r]:[-a/(b+s)]}let A=p,T=-2*o*p+r*g,S=h,v=-a*g+2*s*h,I=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*I,-T)/3);b=2*Math.sqrt(-A);let L=Math.cos(R);C=b*L;let N=b*(-L/2-O*Math.sin(R)),_=C+N>2*o?C-o:N-o,E=r,w=_/E;R=Math.abs(Math.atan2(a*I,-v)/3),b=2*Math.sqrt(-S),L=Math.cos(R),C=b*L,N=b*(-L/2-O*Math.sin(R));let P=-a,M=C+N<2*s?C+s:N+s,B=P/M,V=E*M,U=-_*M-E*P,G=_*P,k=(s*U-o*G)/(-o*U+s*V);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}N8.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Sc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Sc.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return L8(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):L8(e,t,0,i);if(i===0)return r=Sc.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return L8(e,t,n,i)};var B0=N8;var F8={};F8.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,h=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*h+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function ld(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=B0.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=Sc.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],h;if(p>=0&&g>=0){let x=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,h=Sc.computeRealRoots(1,d,p),x=Sc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,h[1]<=x[0]?[h[0],h[1],x[0],x[1]]:x[1]<=h[0]?[x[0],x[1],h[0],h[1]]:h[0]>=x[0]&&h[1]<=x[1]?[x[0],h[0],h[1],x[1]]:x[0]>=h[0]&&x[1]<=h[1]?[h[0],x[0],x[1],h[1]]:h[0]>x[0]&&h[0]<x[1]?[x[0],h[0],x[1],h[1]]:[h[0],x[0],h[1],x[1]]):h):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function fw(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=B0.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,h=e/2,x=p/2,b=g-4*i,C=g+4*Math.abs(i),A=s-4*d,T=s+4*Math.abs(d),S,v;if(d<0||b*T<A*C){let E=Math.sqrt(A);S=E/2,v=E===0?0:(e*x-n)/E}else{let E=Math.sqrt(b);S=E===0?0:(e*x-n)/E,v=E/2}let I,O;h===0&&S===0?(I=0,O=0):D.sign(h)===D.sign(S)?(I=h+S,O=d/I):(O=h-S,I=d/O);let R,L;x===0&&v===0?(R=0,L=0):D.sign(x)===D.sign(v)?(R=x+v,L=i/R):(L=x-v,R=i/L);let N=Sc.computeRealRoots(1,I,R),_=Sc.computeRealRoots(1,O,L);if(N.length!==0)return _.length!==0?N[1]<=_[0]?[N[0],N[1],_[0],_[1]]:_[1]<=N[0]?[_[0],_[1],N[0],N[1]]:N[0]>=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}F8.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return B0.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ld(o,s,a,c);case 1:return fw(o,s,a,c);case 2:return fw(o,s,a,c);case 3:return ld(o,s,a,c);case 4:return ld(o,s,a,c);case 5:return fw(o,s,a,c);case 6:return ld(o,s,a,c);case 7:return ld(o,s,a,c);case 8:return fw(o,s,a,c);case 9:return ld(o,s,a,c);case 10:return ld(o,s,a,c);case 11:return fw(o,s,a,c);case 12:return ld(o,s,a,c);case 13:return ld(o,s,a,c);case 14:return ld(o,s,a,c);case 15:return ld(o,s,a,c);default:return}};var dw=F8;function ak(e,t){t=m.clone(y(t,m.ZERO)),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(y(e,m.ZERO)),this.direction=t}ak.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new ak(e.origin,e.direction)};ak.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var vn=ak;var oo={};oo.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,r=e.direction,o=t.normal,s=m.dot(o,r);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-m.dot(o,i))/s;if(!(a<0))return n=m.multiplyByScalar(r,a,n),m.add(i,n,n)};var cve=new m,lve=new m,y$=new m,f$=new m,d$=new m;oo.rayTriangleParametric=function(e,t,n,i,r){r=y(r,!1);let o=e.origin,s=e.direction,a=m.subtract(n,t,cve),c=m.subtract(i,t,lve),u=m.cross(s,c,y$),f=m.dot(a,u),d,p,g,h,x;if(r){if(f<D.EPSILON6||(d=m.subtract(o,t,f$),g=m.dot(d,u),g<0||g>f)||(p=m.cross(d,a,d$),h=m.dot(s,p),h<0||g+h>f))return;x=m.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let b=1/f;if(d=m.subtract(o,t,f$),g=m.dot(d,u)*b,g<0||g>1||(p=m.cross(d,a,d$),h=m.dot(s,p)*b,h<0||g+h>1))return;x=m.dot(c,p)*b}return x};oo.rayTriangle=function(e,t,n,i,r,o){let s=oo.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new m),m.multiplyByScalar(e.direction,s,o),m.add(e.origin,o,o)};var uve=new vn;oo.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=uve;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=oo.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function fve(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var dve={root0:0,root1:0};function x$(e,t,n){l(n)||(n=new Ac);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=m.subtract(i,o,y$),c=m.dot(r,r),u=2*m.dot(r,a),f=m.magnitudeSquared(a)-s,d=fve(c,u,f,dve);if(l(d))return n.start=d.root0,n.stop=d.root1,n}oo.raySphere=function(e,t,n){if(n=x$(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var mve=new vn;oo.lineSegmentSphere=function(e,t,n,i){let r=mve;m.clone(e,r.origin);let o=m.subtract(t,e,r.direction),s=m.magnitude(o);if(m.normalize(o,o),i=x$(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var hve=new m,pve=new m;oo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,hve),r=m.multiplyComponents(n,e.direction,pve),o=m.magnitudeSquared(i),s=m.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=m.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,x=a/d;return h<x?new Ac(h,x):{start:x,stop:h}}let g=Math.sqrt(a/c);return new Ac(g,g)}else if(o<1)return a=o-1,c=m.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Ac(0,d/c);if(s<0)return c=m.magnitudeSquared(r),new Ac(0,-s/c)};function k0(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function _ve(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*k0(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*k0(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*k0(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Sc.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],L=Math.sqrt(Math.max(1-R*R,0));if(g.push(new m(i,r*R,r*-L)),g.push(new m(i,r*R,r*L)),p.length===2){let N=p[1],_=Math.sqrt(Math.max(1-N*N,0));g.push(new m(i,r*N,r*-_)),g.push(new m(i,r*N,r*_))}return g}let h=d*d,x=f*f,b=a*a,C=d*f,A=b+x,T=2*(c*a+C),S=2*u*a+c*c-x+h,v=2*(u*c-C),I=u*u-h;if(A===0&&T===0&&S===0&&v===0)return g;p=dw.computeRealRoots(A,T,S,v,I);let O=p.length;if(O===0)return g;for(let R=0;R<O;++R){let L=p[R],N=L*L,_=Math.max(1-N,0),E=Math.sqrt(_),w;D.sign(a)===D.sign(u)?w=k0(a*N+u,c*L,D.EPSILON12):D.sign(u)===D.sign(c*L)?w=k0(a*N,c*L+u,D.EPSILON12):w=k0(a*N+c*L,u,D.EPSILON12);let P=k0(f*L,d,D.EPSILON15),M=w*P;M<0?g.push(new m(i,r*L,r*E)):M>0?g.push(new m(i,r*L,r*-E)):E!==0?(g.push(new m(i,r*L,r*-E)),g.push(new m(i,r*L,r*E)),++R):g.push(new m(i,r*L,r*E))}return g}var B8=new m,m$=new m,h$=new m,ck=new m,gve=new m,yve=new $,xve=new $,bve=new $,Cve=new $,Tve=new $,p$=new $,_$=new $,g$=new m,Ave=new m,Eve=new me;oo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,B8);if(m.dot(i,I)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,B8),s=m.normalize(o,o),a=m.mostOrthogonalAxis(o,ck),c=m.normalize(m.cross(a,s,m$),m$),u=m.normalize(m.cross(s,c,h$),h$),f=yve;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,xve),p=$.fromScale(t.radii,bve),g=$.fromScale(t.oneOverRadii,Cve),h=Tve;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let x=$.multiply($.multiply(d,g,p$),h,p$),b=$.multiply($.multiply(x,p,_$),f,_$),C=$.multiplyByVector(x,n,gve),A=_ve(b,m.negate(C,B8),0,0,1),T,S,v=A.length;if(v>0){let I=m.clone(m.ZERO,Ave),O=Number.NEGATIVE_INFINITY;for(let L=0;L<v;++L){T=$.multiplyByVector(p,$.multiplyByVector(f,A[L],g$),g$);let N=m.normalize(m.subtract(T,n,ck),ck),_=m.dot(N,i);_>O&&(O=_,I=m.clone(T,I))}let R=t.cartesianToCartographic(I,Eve);return O=D.clamp(O,0,1),S=m.magnitude(m.subtract(I,n,ck))*Math.sqrt(1-O*O),S=r?-S:S,R.height=S,t.cartographicToCartesian(R,new m)}};var Sve=new m;oo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let r=m.subtract(t,e,Sve),o=n.normal,s=m.dot(o,r);if(Math.abs(s)<D.EPSILON6)return;let a=m.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(r,c,i),m.add(e,i,i),i};oo.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=m.dot(r,e)+o<0,a=m.dot(r,t)+o<0,c=m.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return oo.lineSegmentPlane(e,t,i,f),oo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return oo.lineSegmentPlane(t,n,i,f),oo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return oo.lineSegmentPlane(n,e,i,f),oo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return oo.lineSegmentPlane(e,n,i,f),oo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return oo.lineSegmentPlane(n,t,i,f),oo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return oo.lineSegmentPlane(t,e,i,f),oo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var $i=oo;function Es(e,t){this.normal=m.clone(e),this.distance=t}Es.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new Es(t,i)};var vve=new m;Es.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,vve),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new Es(n,i)};Es.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var wve=new m;Es.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=Es.getPointDistance(e,t),r=m.multiplyByScalar(e.normal,i,wve);return m.subtract(t,r,n)};var Ive=new F,Pve=new oe,Dve=new m;Es.transform=function(e,t,n){let i=e.normal,r=e.distance,o=F.inverseTranspose(t,Ive),s=oe.fromElements(i.x,i.y,i.z,r,Pve);s=F.multiplyByVector(o,s,s);let a=m.fromCartesian4(s,Dve);return s=oe.divideByScalar(s,m.magnitude(a),s),Es.fromCartesian4(s,n)};Es.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new Es(e.normal,e.distance)};Es.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};Es.ORIGIN_XY_PLANE=Object.freeze(new Es(m.UNIT_Z,0));Es.ORIGIN_YZ_PLANE=Object.freeze(new Es(m.UNIT_X,0));Es.ORIGIN_ZX_PLANE=Object.freeze(new Es(m.UNIT_Y,0));var un=Es;var k8=new oe;function Bm(e,t){t=y(t,re.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(F.getColumn(n,0,k8)),this._yAxis=m.fromCartesian4(F.getColumn(n,1,k8));let i=m.fromCartesian4(F.getColumn(n,2,k8));this._plane=un.fromPointNormal(e,i)}Object.defineProperties(Bm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var Rve=new lg;Bm.fromPoints=function(e,t){let n=lg.fromPoints(e,Rve);return new Bm(n.center,t)};var b$=new vn,lk=new m;Bm.prototype.projectPointOntoPlane=function(e,t){let n=b$;n.origin=e,m.normalize(e,n.direction);let i=$i.rayPlane(n,this._plane,lk);if(l(i)||(m.negate(n.direction,n.direction),i=$i.rayPlane(n,this._plane,lk)),l(i)){let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new H(o,s)}};Bm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Bm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new H);let n=b$;n.origin=e,m.clone(this._plane.normal,n.direction);let i=$i.rayPlane(n,this._plane,lk);l(i)||(m.negate(n.direction,n.direction),i=$i.rayPlane(n,this._plane,lk));let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return t.x=o,t.y=s,t};Bm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var Ove=new m;Bm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=Ove;return m.multiplyByScalar(r,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(o,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Bm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var ya=Bm;function Bi(e,t){this.center=m.clone(y(e,m.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Bi.packedLength=m.packedLength+$.packedLength;Bi.pack=function(e,t,n){return n=y(n,0),m.pack(e.center,t,n),$.pack(e.halfAxes,t,n+m.packedLength),t};Bi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Bi),m.unpack(e,t,n.center),$.unpack(e,t+m.packedLength,n.halfAxes),n};var Mve=new m,Lve=new m,Nve=new m,Fve=new m,Bve=new m,kve=new m,Uve=new $,Vve={unitary:new $,diagonal:new $};Bi.fromPoints=function(e,t){if(l(t)||(t=new Bi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=m.ZERO,t;let n,i=e.length,r=m.clone(e[0],Mve);for(n=1;n<i;n++)m.add(r,e[n],r);let o=1/i;m.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],r,Lve),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=Uve;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let h=$.computeEigenDecomposition(g,Vve),x=$.clone(h.unitary,t.halfAxes),b=$.getColumn(x,0,Fve),C=$.getColumn(x,1,Bve),A=$.getColumn(x,2,kve),T=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,I=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(m.dot(b,p),T),S=Math.max(m.dot(C,p),S),v=Math.max(m.dot(A,p),v),I=Math.min(m.dot(b,p),I),O=Math.min(m.dot(C,p),O),R=Math.min(m.dot(A,p),R);b=m.multiplyByScalar(b,.5*(I+T),b),C=m.multiplyByScalar(C,.5*(O+S),C),A=m.multiplyByScalar(A,.5*(R+v),A);let L=m.add(b,C,t.center);m.add(L,A,L);let N=Nve;return N.x=T-I,N.y=S-O,N.z=v-R,m.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var v$=new m,zve=new m;function C$(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new Bi);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=v$;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=zve;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let h=f.center;return p=$.multiplyByVector(d,p,p),m.add(e,p,h),$.multiplyByScale(d,g,d),f}var T$=new me,Hve=new m,Gve=new me,Wve=new me,jve=new me,qve=new me,Yve=new me,Xve=new m,A$=new m,Kve=new m,E$=new m,Jve=new m,Zve=new H,$ve=new H,Qve=new H,ewe=new H,twe=new H,nwe=new m,iwe=new m,rwe=new m,owe=new m,swe=new H,awe=new m,cwe=new m,lwe=new m,uwe=new un(m.UNIT_X,0);Bi.fromRectangle=function(e,t,n,i,r){t=y(t,0),n=y(n,0),i=y(i,re.WGS84);let o,s,a,c,u,f,d;if(e.width<=D.PI){let O=ce.center(e,T$),R=i.cartographicToCartesian(O,Hve),L=new ya(R,i);d=L.plane;let N=O.longitude,_=e.south<0&&e.north>0?0:O.latitude,E=me.fromRadians(N,e.north,n,Gve),w=me.fromRadians(e.west,e.north,n,Wve),P=me.fromRadians(e.west,_,n,jve),M=me.fromRadians(e.west,e.south,n,qve),B=me.fromRadians(N,e.south,n,Yve),V=i.cartographicToCartesian(E,Xve),U=i.cartographicToCartesian(w,A$),G=i.cartographicToCartesian(P,Kve),k=i.cartographicToCartesian(M,E$),Y=i.cartographicToCartesian(B,Jve),j=L.projectPointToNearestOnPlane(V,Zve),J=L.projectPointToNearestOnPlane(U,$ve),W=L.projectPointToNearestOnPlane(G,Qve),K=L.projectPointToNearestOnPlane(k,ewe),Z=L.projectPointToNearestOnPlane(Y,twe);return o=Math.min(J.x,W.x,K.x),s=-o,c=Math.max(J.y,j.y),a=Math.min(K.y,Z.y),w.height=M.height=t,U=i.cartographicToCartesian(w,A$),k=i.cartographicToCartesian(M,E$),u=Math.min(un.getPointDistance(d,U),un.getPointDistance(d,k)),f=n,C$(L.origin,L.xAxis,L.yAxis,L.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,x=ce.center(e,T$).longitude,b=m.fromRadians(x,h,n,i,nwe);b.z=0;let A=Math.abs(b.x)<D.EPSILON10&&Math.abs(b.y)<D.EPSILON10?m.UNIT_X:m.normalize(b,iwe),T=m.UNIT_Z,S=m.cross(A,T,rwe);d=un.fromPointNormal(b,A,uwe);let v=m.fromRadians(x+D.PI_OVER_TWO,h,n,i,owe);s=m.dot(un.projectPointOntoPlane(d,v,swe),S),o=-s,c=m.fromRadians(0,e.north,g?t:n,i,awe).z,a=m.fromRadians(0,e.south,p?t:n,i,cwe).z;let I=m.fromRadians(e.east,h,n,i,lwe);return u=un.getPointDistance(d,I),f=0,C$(b,S,T,A,o,s,a,c,u,f,r)};Bi.fromTransformation=function(e,t){return l(t)||(t=new Bi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Bi.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Bi(e.center,e.halfAxes)};Bi.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=m.dot(i,n)+t.distance;return u<=-c?en.OUTSIDE:u>=c?en.INSIDE:en.INTERSECTING};var w$=new m,I$=new m,P$=new m,fwe=new m,S$=new m,dwe=new m;Bi.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,v$),i=e.halfAxes,r=$.getColumn(i,0,w$),o=$.getColumn(i,1,I$),s=$.getColumn(i,2,P$),a=m.magnitude(r),c=m.magnitude(o),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(r,a,r):f=!1,c>0?m.divideByScalar(o,c,o):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,x,b;if(g===1){let S=r;h=o,x=s,d?p||(S=s,x=r):(S=o,h=r),b=m.cross(h,x,S$),S===r?r=b:S===o?o=b:S===s&&(s=b)}else if(g===2){h=r,d?h=o:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,D.EPSILON3)&&(S=m.UNIT_X),x=m.cross(h,S,fwe),m.normalize(x,x),b=m.cross(h,x,S$),m.normalize(b,b),h===r?(o=x,s=b):h===o?(s=x,r=b):h===s&&(r=x,o=b)}else g===3&&(r=m.UNIT_X,o=m.UNIT_Y,s=m.UNIT_Z);let C=dwe;C.x=m.dot(n,r),C.y=m.dot(n,o),C.z=m.dot(n,s);let A=0,T;return C.x<-a?(T=C.x+a,A+=T*T):C.x>a&&(T=C.x-a,A+=T*T),C.y<-c?(T=C.y+c,A+=T*T):C.y>c&&(T=C.y-c,A+=T*T),C.z<-u?(T=C.z+u,A+=T*T):C.z>u&&(T=C.z-u,A+=T*T),A};var mwe=new m,hwe=new m;Bi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ac);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,w$),u=$.getColumn(a,1,I$),f=$.getColumn(a,2,P$),d=m.add(c,u,mwe);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,hwe),g=m.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var pwe=new m,_we=new m,gwe=new m;Bi.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,pwe),o=$.getColumn(i,1,_we),s=$.getColumn(i,2,gwe);return m.clone(n,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],r,t[1]),m.subtract(t[1],o,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],r,t[2]),m.add(t[2],o,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],r,t[3]),m.add(t[3],o,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],r,t[4]),m.subtract(t[4],o,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],r,t[5]),m.subtract(t[5],o,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],r,t[6]),m.add(t[6],o,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],r,t[7]),m.add(t[7],o,t[7]),m.add(t[7],s,t[7]),t};var ywe=new $;Bi.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,ywe);return F.fromRotationTranslation(i,n,t)};var xwe=new ae;Bi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,xwe);return!t.isBoundingSphereVisible(n)};Bi.prototype.intersectPlane=function(e){return Bi.intersectPlane(this,e)};Bi.prototype.distanceSquaredTo=function(e){return Bi.distanceSquaredTo(this,e)};Bi.prototype.computePlaneDistances=function(e,t,n){return Bi.computePlaneDistances(this,e,t,n)};Bi.prototype.computeCorners=function(e){return Bi.computeCorners(this,e)};Bi.prototype.computeTransformation=function(e){return Bi.computeTransformation(this,e)};Bi.prototype.isOccluded=function(e){return Bi.isOccluded(this,e)};Bi.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Bi.prototype.clone=function(e){return Bi.clone(this,e)};Bi.prototype.equals=function(e){return Bi.equals(this,e)};var On=Bi;var uk={};uk.getHeight=function(e,t,n){return(e-n)*t+n};var bwe=new m;uk.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,bwe),s=uk.getHeight(o.height,n,i);return m.fromRadians(o.longitude,o.latitude,s,t,r)};var vc=uk;var yo={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function mw(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Le.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ga(e,t){return(e._flags&t)===t}function ug(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(mw.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ga(this,yo.CULL)},set:function(e){Ga(this,yo.CULL)!==e&&(ug(this,yo.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ga(this,yo.OCCLUDE)},set:function(e){Ga(this,yo.OCCLUDE)!==e&&(ug(this,yo.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ga(this,yo.CAST_SHADOWS)},set:function(e){Ga(this,yo.CAST_SHADOWS)!==e&&(ug(this,yo.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ga(this,yo.RECEIVE_SHADOWS)},set:function(e){Ga(this,yo.RECEIVE_SHADOWS)!==e&&(ug(this,yo.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ga(this,yo.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ga(this,yo.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(ug(this,yo.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ga(this,yo.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ga(this,yo.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(ug(this,yo.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Ga(this,yo.PICK_ONLY)},set:function(e){Ga(this,yo.PICK_ONLY)!==e&&(ug(this,yo.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ga(this,yo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ga(this,yo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(ug(this,yo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});mw.shallowClone=function(e,t){if(l(e))return l(t)||(t=new mw),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};mw.prototype.execute=function(e,t){e.draw(this,t)};var tt=mw;var Cwe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ee=Object.freeze(Cwe);var fk={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};fk.validate=function(e){return e===fk.CLOCKWISE||e===fk.COUNTER_CLOCKWISE};var es=Object.freeze(fk);function D$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=D$(e[t]));return Object.freeze(e)}var U8=D$;function Um(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),r=y(t.scissorTest,y.EMPTY_OBJECT),o=y(r.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),h=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,es.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(r.enabled,!1),rectangle:Ye.clone(o)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(h.enabled,!1),value:y(h.value,1),invert:y(h.invert,!1)},this.viewport=l(x)?new Ye(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var Twe=0,km={};Um.fromCache=function(e){let t=JSON.stringify(e),n=km[t];if(l(n))return++n.referenceCount,n.state;let i=new Um(e),r=JSON.stringify(i);return n=km[r],l(n)||(i.id=Twe++,n={referenceCount:0,state:i},km[r]=n),++n.referenceCount,km[t]={referenceCount:1,state:n.state},n.state};Um.removeFromCache=function(e){let t=new Um(e),n=JSON.stringify(t),i=km[n],r=JSON.stringify(e),o=km[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete km[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete km[n]};Um.getCache=function(){return km};Um.clearCache=function(){km={}};function U0(e,t,n){n?e.enable(t):e.disable(t)}function R$(e,t){e.frontFace(t.frontFace)}function O$(e,t){let n=t.cull,i=n.enabled;U0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function M$(e,t){e.lineWidth(t.lineWidth)}function L$(e,t){let n=t.polygonOffset,i=n.enabled;U0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function N$(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(U0(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function F$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function B$(e,t){let n=t.depthTest,i=n.enabled;U0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function k$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function U$(e,t){e.depthMask(t.depthMask)}function V$(e,t){e.stencilMask(t.stencilMask)}function Awe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function z$(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;U0(e,e.BLEND,r),r&&(Awe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function H$(e,t){let n=t.stencilTest,i=n.enabled;if(U0(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,h=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,h,x)}}function G$(e,t){let n=t.sampleCoverage,i=n.enabled;U0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Ewe=new Ye;function W$(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=Ewe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Um.apply=function(e,t,n){R$(e,t),O$(e,t),M$(e,t),L$(e,t),F$(e,t),B$(e,t),k$(e,t),U$(e,t),V$(e,t),H$(e,t),G$(e,t),N$(e,t,n),z$(e,t,n),W$(e,t,n)};function Swe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(R$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(O$),e.lineWidth!==t.lineWidth&&n.push(M$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(L$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(F$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(B$),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(k$),e.depthMask!==t.depthMask&&n.push(U$),e.stencilMask!==t.stencilMask&&n.push(V$),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(H$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(G$),n}Um.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Swe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&N$(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&z$(e,n,r),(t!==n||i!==r||i.context!==r.context)&&W$(e,n,r)};Um.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ye.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Ye.clone(e.viewport):void 0}};var Ue=Um;var vwe=new m;function jt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Xs={};Xs[te.FLOAT]="float";Xs[te.FLOAT_VEC2]="vec2";Xs[te.FLOAT_VEC3]="vec3";Xs[te.FLOAT_VEC4]="vec4";Xs[te.INT]="int";Xs[te.INT_VEC2]="ivec2";Xs[te.INT_VEC3]="ivec3";Xs[te.INT_VEC4]="ivec4";Xs[te.BOOL]="bool";Xs[te.BOOL_VEC2]="bvec2";Xs[te.BOOL_VEC3]="bvec3";Xs[te.BOOL_VEC4]="bvec4";Xs[te.FLOAT_MAT2]="mat2";Xs[te.FLOAT_MAT3]="mat3";Xs[te.FLOAT_MAT4]="mat4";Xs[te.SAMPLER_2D]="sampler2D";Xs[te.SAMPLER_CUBE]="samplerCube";jt.prototype.getDeclaration=function(e){let t=`uniform ${Xs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var wwe={czm_viewport:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,vwe)}}),czm_frameNumber:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new jt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new jt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},rp=wwe;function Iwe(e,t,n,i){switch(t.type){case e.FLOAT:return new j$(e,t,n,i);case e.FLOAT_VEC2:return new q$(e,t,n,i);case e.FLOAT_VEC3:return new Y$(e,t,n,i);case e.FLOAT_VEC4:return new X$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new V8(e,t,n,i);case e.INT:case e.BOOL:return new K$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new J$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Z$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new $$(e,t,n,i);case e.FLOAT_MAT2:return new Q$(e,t,n,i);case e.FLOAT_MAT3:return new eQ(e,t,n,i);case e.FLOAT_MAT4:return new tQ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function j$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}j$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function q$(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}q$.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Y$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Y$.prototype.set=function(){let e=this.value;e&&(l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function X$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}X$.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function V8(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}V8.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};V8.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function K$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}K$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function J$(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}J$.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Z$(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}Z$.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function $$(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}$$.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Pwe=new Float32Array(4);function Q$(e,t,n,i){this.name=n,this.value=void 0,this._value=new ir,this._gl=e,this._location=i}Q$.prototype.set=function(){if(!ir.equalsArray(this.value,this._value,0)){ir.clone(this.value,this._value);let e=ir.toArray(this.value,Pwe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var Dwe=new Float32Array(9);function eQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}eQ.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,Dwe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var Rwe=new Float32Array(16);function tQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}tQ.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,Rwe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var hw=Iwe;function Owe(e,t,n,i){switch(t.type){case e.FLOAT:return new nQ(e,t,n,i);case e.FLOAT_VEC2:return new iQ(e,t,n,i);case e.FLOAT_VEC3:return new rQ(e,t,n,i);case e.FLOAT_VEC4:return new oQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new z8(e,t,n,i);case e.INT:case e.BOOL:return new sQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new aQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new cQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new lQ(e,t,n,i);case e.FLOAT_MAT2:return new uQ(e,t,n,i);case e.FLOAT_MAT3:return new fQ(e,t,n,i);case e.FLOAT_MAT4:return new dQ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function nQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._location=i[0]}nQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function iQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*2),this._gl=e,this._location=i[0]}iQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2fv(this._location,n)};function rQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*3),this._gl=e,this._location=i[0]}rQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?(s.red!==n[r]||s.green!==n[r+1]||s.blue!==n[r+2])&&(n[r]=s.red,n[r+1]=s.green,n[r+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0)),r+=3}i&&this._gl.uniform3fv(this._location,n)};function oQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}oQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?z.equalsArray(s,n,r)||(z.pack(s,n,r),i=!0):l(s.x)&&(oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0)),r+=4}i&&this._gl.uniform4fv(this._location,n)};function z8(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}z8.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let r=0;r<i;++r){let o=n[r];e.activeTexture(t+r),e.bindTexture(o._target,o._texture)}};z8.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let r=e+i;this._gl.uniform1i(t[i],r)}return e+n};function sQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r),this._gl=e,this._location=i[0]}sQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function aQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*2),this._gl=e,this._location=i[0]}aQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2iv(this._location,n)};function cQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*3),this._gl=e,this._location=i[0]}cQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0),r+=3}i&&this._gl.uniform3iv(this._location,n)};function lQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*4),this._gl=e,this._location=i[0]}lQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniform4iv(this._location,n)};function uQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}uQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];ir.equalsArray(s,n,r)||(ir.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function fQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*9),this._gl=e,this._location=i[0]}fQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];$.equalsArray(s,n,r)||($.pack(s,n,r),i=!0),r+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function dQ(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*16),this._gl=e,this._location=i[0]}dQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];F.equalsArray(s,n,r)||(F.pack(s,n,r),i=!0),r+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var pw=Owe;var Mwe=0;function op(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=Lwe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Mwe++}op.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};op.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(op.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return dk(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return dk(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return dk(this),this._uniformsByName}}});function mQ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function Lwe(e,t){let n={};if(!Ht.highpFloatSupported||!Ht.highpIntSupported){let i,r,o,s,a=mQ(e),c=mQ(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Vm="[Cesium WebGL] ";function Nwe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Vm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Vm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Vm}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Vm}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Vm}Vertex shader compile log: ${c}`),console.error(`${Vm} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Vm}Fragment shader compile log: ${c}`),console.error(`${Vm} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${Vm}${g} shader translation failed.`);return}console.error(`${Vm}Translated ${g} shaderSource: +${h}`)}}function Fwe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function Bwe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=hw(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,h=u.indexOf("[");if(h>=0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${u}[${x}]`),g!==null&&d.push(g);f=pw(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function kwe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=rp[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function Uwe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function dk(e){l(e._program)||hQ(e)}function hQ(e){let t=e._program,n=e._gl,i=Nwe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=Bwe(n,i),s=kwe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=Fwe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Uwe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{hQ(e),u(e._program)}catch(h){e._vertexShaderText=d,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(h.message);f(b?b[1]:h.message)}})}op.prototype._bind=function(){dk(this),this._gl.useProgram(this._program)};op.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};op.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Jt=op;var _w=`/** + * A built-in GLSL floating-point constant for converting radians to degrees. * - * @name czm_inverseGamma - * @glslFunction + * @alias czm_degreesPerRadian + * @glslConstant * - * @param {vec3} color The color in linear space. - * @returns {vec3} The color in RGB space. + * @see CesiumMath.DEGREES_PER_RADIAN + * + * @example + * // GLSL declaration + * const float czm_degreesPerRadian = ...; + * + * // Example + * float deg = czm_degreesPerRadian * rad; */ -vec3 czm_inverseGamma(vec3 color) { - return pow(color, vec3(1.0 / czm_gamma)); -} -`;var rD=`/** - * Determines if a time interval is empty. +const float czm_degreesPerRadian = 57.29577951308232; +`;var gw=`/** + * A built-in GLSL vec2 constant for defining the depth range. + * This is a workaround to a bug where IE11 does not implement gl_DepthRange. * - * @name czm_isEmpty - * @glslFunction - * - * @param {czm_raySegment} interval The interval to test. - * - * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * @alias czm_depthRange + * @glslConstant * * @example - * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true - * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false - * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + * // GLSL declaration + * float depthRangeNear = czm_depthRange.near; + * float depthRangeFar = czm_depthRange.far; + * */ -bool czm_isEmpty(czm_raySegment interval) -{ - return (interval.stop < 0.0); -} -`;var oD=`/** - * Determines if a time interval is empty. +const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var yw=`/** + * 0.1 * - * @name czm_isFull - * @glslFunction - * - * @param {czm_raySegment} interval The interval to test. - * - * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * @name czm_epsilon1 + * @glslConstant + */ +const float czm_epsilon1 = 0.1; +`;var xw=`/** + * 0.01 * - * @example - * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true - * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false - * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + * @name czm_epsilon2 + * @glslConstant */ -bool czm_isFull(czm_raySegment interval) -{ - return (interval.start == 0.0 && interval.stop == czm_infinity); -} -`;var sD=`/** - * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. +const float czm_epsilon2 = 0.01; +`;var bw=`/** + * 0.001 * - * @name czm_latitudeToWebMercatorFraction - * @glslFunction + * @name czm_epsilon3 + * @glslConstant + */ +const float czm_epsilon3 = 0.001; +`;var Cw=`/** + * 0.0001 * - * @param {float} latitude The geodetic latitude, in radians. - * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. - * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * @name czm_epsilon4 + * @glslConstant + */ +const float czm_epsilon4 = 0.0001; +`;var Tw=`/** + * 0.00001 * - * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern - * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return - * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. - */ -float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) -{ - float sinLatitude = sin(latitude); - float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); - - return (mercatorY - southMercatorY) * oneOverMercatorHeight; -} -`;var aD=`/** - * Converts a linear RGB color to an sRGB color. + * @name czm_epsilon5 + * @glslConstant + */ +const float czm_epsilon5 = 0.00001; +`;var Aw=`/** + * 0.000001 * - * @param {vec3|vec4} linearIn The color in linear color space. - * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + * @name czm_epsilon6 + * @glslConstant */ -vec3 czm_linearToSrgb(vec3 linearIn) -{ - return pow(linearIn, vec3(1.0/2.2)); -} - -vec4 czm_linearToSrgb(vec4 linearIn) -{ - vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); - return vec4(srgbOut, linearIn.a); -} -`;var cD=`/** - * Computes distance from an point in 2D to a line in 2D. +const float czm_epsilon6 = 0.000001; +`;var Ew=`/** + * 0.0000001 * - * @name czm_lineDistance - * @glslFunction + * @name czm_epsilon7 + * @glslConstant + */ +const float czm_epsilon7 = 0.0000001; +`;var Sw=`/** + * DOC_TBA * - * param {vec2} point1 A point along the line. - * param {vec2} point2 A point along the line. - * param {vec2} point A point that may or may not be on the line. - * returns {float} The distance from the point to the line. + * @name czm_infinity + * @glslConstant */ -float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { - return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); -} -`;var lD=`/** - * Computes the luminance of a color. +const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp? +`;var vw=`/** + * A built-in GLSL floating-point constant for <code>1/pi</code>. * - * @name czm_luminance - * @glslFunction + * @alias czm_oneOverPi + * @glslConstant * - * @param {vec3} rgb The color. - * - * @returns {float} The luminance. + * @see CesiumMath.ONE_OVER_PI * * @example - * float light = czm_luminance(vec3(0.0)); // 0.0 - * float dark = czm_luminance(vec3(1.0)); // ~1.0 - */ -float czm_luminance(vec3 rgb) -{ - // Algorithm from Chapter 10 of Graphics Shaders. - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - return dot(rgb, W); -} -`;var uD=`/** - * Computes the size of a pixel in meters at a distance from the eye. - * <p> - * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. - * </p> - * @name czm_metersPerPixel - * @glslFunction - * - * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. - * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * // GLSL declaration + * const float czm_oneOverPi = ...; * - * @returns {float} The meters per pixel at positionEC. + * // Example + * float pi = 1.0 / czm_oneOverPi; */ -float czm_metersPerPixel(vec4 positionEC, float pixelRatio) -{ - float width = czm_viewport.z; - float height = czm_viewport.w; - float pixelWidth; - float pixelHeight; - - float top = czm_frustumPlanes.x; - float bottom = czm_frustumPlanes.y; - float left = czm_frustumPlanes.z; - float right = czm_frustumPlanes.w; - - if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) - { - float frustumWidth = right - left; - float frustumHeight = top - bottom; - pixelWidth = frustumWidth / width; - pixelHeight = frustumHeight / height; - } - else - { - float distanceToPixel = -positionEC.z; - float inverseNear = 1.0 / czm_currentFrustum.x; - float tanTheta = top * inverseNear; - pixelHeight = 2.0 * distanceToPixel * tanTheta / height; - tanTheta = right * inverseNear; - pixelWidth = 2.0 * distanceToPixel * tanTheta / width; - } - - return max(pixelWidth, pixelHeight) * pixelRatio; -} - -/** - * Computes the size of a pixel in meters at a distance from the eye. - * <p> - * Use this version when scaling by pixel ratio. - * </p> - * @name czm_metersPerPixel - * @glslFunction - * - * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. +const float czm_oneOverPi = 0.3183098861837907; +`;var ww=`/** + * A built-in GLSL floating-point constant for <code>1/2pi</code>. * - * @returns {float} The meters per pixel at positionEC. - */ -float czm_metersPerPixel(vec4 positionEC) -{ - return czm_metersPerPixel(positionEC, czm_pixelRatio); -} -`;var fD=`/** - * Transforms a position from model to window coordinates. The transformation - * from model to clip coordinates is done using {@link czm_modelViewProjection}. - * The transform from normalized device coordinates to window coordinates is - * done using {@link czm_viewportTransformation}, which assumes a depth range - * of <code>near = 0</code> and <code>far = 1</code>. - * <br /><br /> - * This transform is useful when there is a need to manipulate window coordinates - * in a vertex shader as done by {@link BillboardCollection}. - * <br /><br /> - * This function should not be confused with {@link czm_viewportOrthographic}, - * which is an orthographic projection matrix that transforms from window - * coordinates to clip coordinates. + * @alias czm_oneOverTwoPi + * @glslConstant * - * @name czm_modelToWindowCoordinates - * @glslFunction + * @see CesiumMath.ONE_OVER_TWO_PI * - * @param {vec4} position The position in model coordinates to transform. + * @example + * // GLSL declaration + * const float czm_oneOverTwoPi = ...; * - * @returns {vec4} The transformed position in window coordinates. + * // Example + * float pi = 2.0 * czm_oneOverTwoPi; + */ +const float czm_oneOverTwoPi = 0.15915494309189535; +`;var Iw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} * - * @see czm_eyeToWindowCoordinates - * @see czm_modelViewProjection - * @see czm_viewportTransformation - * @see czm_viewportOrthographic - * @see BillboardCollection + * @name czm_passCesium3DTile + * @glslConstant * - * @example - * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + * @see czm_pass */ -vec4 czm_modelToWindowCoordinates(vec4 position) -{ - vec4 q = czm_modelViewProjection * position; // clip coordinates - q.xyz /= q.w; // normalized device coordinates - q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates - return q; -} -`;var dD=`/** - * DOC_TBA +const float czm_passCesium3DTile = 4.0; +`;var Pw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} * - * @name czm_multiplyWithColorBalance - * @glslFunction - */ -vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) -{ - // Algorithm from Chapter 10 of Graphics Shaders. - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - - vec3 target = left * right; - float leftLuminance = dot(left, W); - float rightLuminance = dot(right, W); - float targetLuminance = dot(target, W); - - return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; -} -`;var mD=`/** - * Computes a value that scales with distance. The scaling is clamped at the near and - * far distances, and does not extrapolate. This function works with the - * {@link NearFarScalar} JavaScript class. + * @name czm_passCesium3DTileClassification + * @glslConstant * - * @name czm_nearFarScalar - * @glslFunction + * @see czm_pass + */ +const float czm_passCesium3DTileClassification = 5.0; +`;var Dw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} * - * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). - * @param {float} cameraDistSq The square of the current distance from the camera. + * @name czm_passCesium3DTileClassificationIgnoreShow + * @glslConstant * - * @returns {float} The value at this distance. + * @see czm_pass */ -float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) -{ - float valueAtMin = nearFarScalar.y; - float valueAtMax = nearFarScalar.w; - float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; - float farDistanceSq = nearFarScalar.z * nearFarScalar.z; - - float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); - - t = pow(clamp(t, 0.0, 1.0), 0.2); - - return mix(valueAtMin, valueAtMax, t); -} -`;var hD=` /** - * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ - * - * @name czm_octDecode - * @param {vec2} encoded The oct-encoded, unit-length vector - * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. - * @returns {vec3} The decoded and normalized vector - */ - vec3 czm_octDecode(vec2 encoded, float range) - { - if (encoded.x == 0.0 && encoded.y == 0.0) { - return vec3(0.0, 0.0, 0.0); - } - - encoded = encoded / range * 2.0 - 1.0; - vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); - if (v.z < 0.0) - { - v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); - } - - return normalize(v); - } - -/** - * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; +`;var Rw=`/** + * The automatic GLSL constant for {@link Pass#CLASSIFICATION} * - * @name czm_octDecode - * @param {vec2} encoded The oct-encoded, unit-length vector - * @returns {vec3} The decoded and normalized vector + * @name czm_passClassification + * @glslConstant + * + * @see czm_pass */ - vec3 czm_octDecode(vec2 encoded) - { - return czm_octDecode(encoded, 255.0); - } - - /** - * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passClassification = 7.0; +`;var Ow=`/** + * The automatic GLSL constant for {@link Pass#COMPUTE} * - * @name czm_octDecode - * @param {float} encoded The oct-encoded, unit-length vector - * @returns {vec3} The decoded and normalized vector + * @name czm_passCompute + * @glslConstant + * + * @see czm_pass */ - vec3 czm_octDecode(float encoded) - { - float temp = encoded / 256.0; - float x = floor(temp); - float y = (temp - x) * 256.0; - return czm_octDecode(vec2(x, y)); - } - -/** - * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passCompute = 1.0; +`;var Mw=`/** + * The automatic GLSL constant for {@link Pass#ENVIRONMENT} * - * @name czm_octDecode - * @param {vec2} encoded The packed oct-encoded, unit-length vectors. - * @param {vec3} vector1 One decoded and normalized vector. - * @param {vec3} vector2 One decoded and normalized vector. - * @param {vec3} vector3 One decoded and normalized vector. + * @name czm_passEnvironment + * @glslConstant + * + * @see czm_pass */ - void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) - { - float temp = encoded.x / 65536.0; - float x = floor(temp); - float encodedFloat1 = (temp - x) * 65536.0; - - temp = encoded.y / 65536.0; - float y = floor(temp); - float encodedFloat2 = (temp - y) * 65536.0; - - vector1 = czm_octDecode(encodedFloat1); - vector2 = czm_octDecode(encodedFloat2); - vector3 = czm_octDecode(vec2(x, y)); - } - -`;var pD=`/** - * Packs a depth value into a vec3 that can be represented by unsigned bytes. +const float czm_passEnvironment = 0.0; +`;var Lw=`/** + * The automatic GLSL constant for {@link Pass#GLOBE} * - * @name czm_packDepth - * @glslFunction + * @name czm_passGlobe + * @glslConstant * - * @param {float} depth The floating-point depth. - * @returns {vec3} The packed depth. + * @see czm_pass */ -vec4 czm_packDepth(float depth) -{ - // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; - enc = fract(enc); - enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); - return enc; -} -`;var _D=`vec3 lambertianDiffuse(vec3 diffuseColor) -{ - return diffuseColor / czm_pi; -} - -vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - -float smithVisibilityG1(float NdotV, float roughness) -{ - // this is the k value for direct lighting. - // for image based lighting it will be roughness^2 / 2 - float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; - return NdotV / (NdotV * (1.0 - k) + k); -} - -float smithVisibilityGGX(float roughness, float NdotL, float NdotV) -{ - return ( - smithVisibilityG1(NdotL, roughness) * - smithVisibilityG1(NdotV, roughness) - ); -} - -float GGX(float roughness, float NdotH) -{ - float roughnessSquared = roughness * roughness; - float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; - return roughnessSquared / (czm_pi * f * f); -} - -/** - * Compute the diffuse and specular contributions using physically based - * rendering. This function only handles direct lighting. - * <p> - * This function only handles the lighting calculations. Metallic/roughness - * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} - * </p> +const float czm_passGlobe = 2.0; +`;var Nw=`/** + * The automatic GLSL constant for {@link Pass#OPAQUE} * - * @name czm_pbrlighting - * @glslFunction + * @name czm_passOpaque + * @glslConstant * - * @param {vec3} positionEC The position of the fragment in eye coordinates - * @param {vec3} normalEC The surface normal in eye coordinates - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. - * @param {czm_pbrParameters} The computed PBR parameters. - * @return {vec3} The computed HDR color + * @see czm_pass + */ +const float czm_passOpaque = 7.0; +`;var Fw=`/** + * The automatic GLSL constant for {@link Pass#OVERLAY} * - * @example - * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( - * baseColor, - * metallic, - * roughness - * ); - * vec3 color = czm_pbrlighting( - * positionEC, - * normalEC, - * lightDirectionEC, - * lightColorHdr, - * pbrParameters); + * @name czm_passOverlay + * @glslConstant + * + * @see czm_pass */ -vec3 czm_pbrLighting( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) -{ - vec3 v = -normalize(positionEC); - vec3 l = normalize(lightDirectionEC); - vec3 h = normalize(v + l); - vec3 n = normalEC; - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = abs(dot(n, v)) + 0.001; - float NdotH = clamp(dot(n, h), 0.0, 1.0); - float LdotH = clamp(dot(l, h), 0.0, 1.0); - float VdotH = clamp(dot(v, h), 0.0, 1.0); - - vec3 f0 = pbrParameters.f0; - float reflectance = max(max(f0.r, f0.g), f0.b); - vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(f0, f90, VdotH); - - float alpha = pbrParameters.roughness; - float G = smithVisibilityGGX(alpha, NdotL, NdotV); - float D = GGX(alpha, NdotH); - vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - - vec3 diffuseColor = pbrParameters.diffuseColor; - // F here represents the specular contribution - vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - - // Lo = (diffuse + specular) * Li * NdotL - return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; -} -`;var gD=`/** - * Compute parameters for physically based rendering using the - * metallic/roughness workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passOverlay = 10.0; +`;var Bw=`/** + * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * - * @name czm_pbrMetallicRoughnessMaterial - * @glslFunction + * @name czm_passTerrainClassification + * @glslConstant * - * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) - * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); - * @param {float} roughness A value between 0.0 and 1.0 - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrMetallicRoughnessMaterial( - vec3 baseColor, - float metallic, - float roughness -) -{ - czm_pbrParameters results; - - // roughness is authored as perceptual roughness - // square it to get material roughness - roughness = clamp(roughness, 0.0, 1.0); - results.roughness = roughness * roughness; - - // dielectrics use f0 = 0.04, metals use albedo as f0 - metallic = clamp(metallic, 0.0, 1.0); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); - results.f0 = f0; - - // diffuse only applies to dielectrics. - results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); - - return results; -} -`;var yD=`/** - * Compute parameters for physically based rendering using the - * specular/glossy workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passTerrainClassification = 3.0; +`;var kw=`/** + * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * - * @name czm_pbrSpecularGlossinessMaterial - * @glslFunction + * @name czm_passTranslucent + * @glslConstant * - * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) - * @param {vec3} specular The reflectance at normal incidence (f0) - * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrSpecularGlossinessMaterial( - vec3 diffuse, - vec3 specular, - float glossiness -) -{ - czm_pbrParameters results; - - // glossiness is the opposite of roughness, but easier for artists to use. - float roughness = 1.0 - glossiness; - results.roughness = roughness * roughness; - - results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); - results.f0 = specular; - - return results; -} -`;var AD=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) -{ - return czm_getLambertDiffuse(lightDirectionEC, material.normal); -} - -float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) -{ - return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); -} - -/** - * Computes a color using the Phong lighting model. +const float czm_passTranslucent = 8.0; +`;var Uw=`/** + * The automatic GLSL constant for {@link Pass#VOXELS} * - * @name czm_phong - * @glslFunction + * @name czm_passVoxels + * @glslConstant * - * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. - * @param {czm_material} material The fragment's material. + * @see czm_pass + */ +const float czm_passVoxels = 9.0; +`;var Vw=`/** + * A built-in GLSL floating-point constant for <code>Math.PI</code>. * - * @returns {vec4} The computed color. + * @alias czm_pi + * @glslConstant + * + * @see CesiumMath.PI * * @example - * vec3 positionToEyeEC = // ... - * czm_material material = // ... - * vec3 lightDirectionEC = // ... - * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * // GLSL declaration + * const float czm_pi = ...; * - * @see czm_getMaterial + * // Example + * float twoPi = 2.0 * czm_pi; */ -vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - // Diffuse from directional light sources at eye (for top-down) - float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); - } - - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; - - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} - -vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - vec3 ambient = vec3(0.0); - vec3 color = ambient + material.emission; - color += material.diffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} -`;var xD=`/** - * Computes distance from a point to a plane. +const float czm_pi = 3.141592653589793; +`;var zw=`/** + * A built-in GLSL floating-point constant for <code>pi/4</code>. * - * @name czm_planeDistance - * @glslFunction + * @alias czm_piOverFour + * @glslConstant * - * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. - */ -float czm_planeDistance(vec4 plane, vec3 point) { - return (dot(plane.xyz, point) + plane.w); -} - -/** - * Computes distance from a point to a plane. + * @see CesiumMath.PI_OVER_FOUR * - * @name czm_planeDistance - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverFour = ...; * - * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js - * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. + * // Example + * float pi = 4.0 * czm_piOverFour; */ -float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { - return (dot(planeNormal, point) + planeDistance); -} -`;var CD=`/** - * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero. +const float czm_piOverFour = 0.7853981633974483; +`;var Hw=`/** + * A built-in GLSL floating-point constant for <code>pi/6</code>. * - * @name czm_pointAlongRay - * @glslFunction + * @alias czm_piOverSix + * @glslConstant + * + * @see CesiumMath.PI_OVER_SIX * - * @param {czm_ray} ray The ray to compute the point along. - * @param {float} time The time along the ray. - * - * @returns {vec3} The point along the ray at the given time. - * * @example - * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction - * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) - */ -vec3 czm_pointAlongRay(czm_ray ray, float time) -{ - return ray.origin + (time * ray.direction); -} -`;var TD=`/** - * DOC_TBA + * // GLSL declaration + * const float czm_piOverSix = ...; * - * @name czm_rayEllipsoidIntersectionInterval - * @glslFunction + * // Example + * float pi = 6.0 * czm_piOverSix; */ -czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) -{ - // ray and ellipsoid center in eye coordinates. radii in model coordinates. - vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; - vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - - q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - - float q2 = dot(q, q); - float qw = dot(q, w); - - if (q2 > 1.0) // Outside ellipsoid. - { - if (qw >= 0.0) // Looking outward or tangent (0 intersections). - { - return czm_emptyRaySegment; - } - else // qw < 0.0. - { - float qw2 = qw * qw; - float difference = q2 - 1.0; // Positively valued. - float w2 = dot(w, w); - float product = w2 * difference; - - if (qw2 < product) // Imaginary roots (0 intersections). - { - return czm_emptyRaySegment; - } - else if (qw2 > product) // Distinct roots (2 intersections). - { - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Avoid cancellation. - float root0 = temp / w2; - float root1 = difference / temp; - if (root0 < root1) - { - czm_raySegment i = czm_raySegment(root0, root1); - return i; - } - else - { - czm_raySegment i = czm_raySegment(root1, root0); - return i; - } - } - else // qw2 == product. Repeated roots (2 intersections). - { - float root = sqrt(difference / w2); - czm_raySegment i = czm_raySegment(root, root); - return i; - } - } - } - else if (q2 < 1.0) // Inside ellipsoid (2 intersections). - { - float difference = q2 - 1.0; // Negatively valued. - float w2 = dot(w, w); - float product = w2 * difference; // Negatively valued. - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Positively valued. - czm_raySegment i = czm_raySegment(0.0, temp / w2); - return i; - } - else // q2 == 1.0. On ellipsoid. - { - if (qw < 0.0) // Looking inward. - { - float w2 = dot(w, w); - czm_raySegment i = czm_raySegment(0.0, -qw / w2); - return i; - } - else // qw >= 0.0. Looking outward or tangent. - { - return czm_emptyRaySegment; - } - } -} -`;var ED=`/** - * Compute the intersection interval of a ray with a sphere. +const float czm_piOverSix = 0.5235987755982988; +`;var Gw=`/** + * A built-in GLSL floating-point constant for <code>pi/3</code>. * - * @name czm_raySphereIntersectionInterval - * @glslFunction + * @alias czm_piOverThree + * @glslConstant * - * @param {czm_ray} ray The ray. - * @param {vec3} center The center of the sphere. - * @param {float} radius The radius of the sphere. - * @return {czm_raySegment} The intersection interval of the ray with the sphere. - */ -czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) -{ - vec3 o = ray.origin; - vec3 d = ray.direction; - - vec3 oc = o - center; - - float a = dot(d, d); - float b = 2.0 * dot(d, oc); - float c = dot(oc, oc) - (radius * radius); - - float det = (b * b) - (4.0 * a * c); - - if (det < 0.0) { - return czm_emptyRaySegment; - } - - float sqrtDet = sqrt(det); - - float t0 = (-b - sqrtDet) / (2.0 * a); - float t1 = (-b + sqrtDet) / (2.0 * a); - - czm_raySegment result = czm_raySegment(t0, t1); - return result; -} -`;var bD=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) -{ - return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var SD=`/** - * Reads a value previously transformed with {@link czm_writeNonPerspective} - * by dividing it by \`w\`, the value used in the perspective divide. - * This function is intended to be called in a fragment shader to access a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The value should have been - * previously written in the vertex shader with a call to - * {@link czm_writeNonPerspective}. + * @see CesiumMath.PI_OVER_THREE * - * @name czm_readNonPerspective - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverThree = ...; * - * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. - * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. - * @returns {float|vec2|vec3|vec4} The usable value. + * // Example + * float pi = 3.0 * czm_piOverThree; */ -float czm_readNonPerspective(float value, float oneOverW) { - return value * oneOverW; -} - -vec2 czm_readNonPerspective(vec2 value, float oneOverW) { - return value * oneOverW; -} - -vec3 czm_readNonPerspective(vec3 value, float oneOverW) { - return value * oneOverW; -} - -vec4 czm_readNonPerspective(vec4 value, float oneOverW) { - return value * oneOverW; -} -`;var vD=`float czm_reverseLogDepth(float logZ) -{ -#ifdef LOG_DEPTH - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - return far * (1.0 - near / (depthFromNear + near)) / (far - near); -#endif - return logZ; -} -`;var wD=`/** - * Converts an RGB color to HSB (hue, saturation, brightness) - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} +const float czm_piOverThree = 1.0471975511965976; +`;var Ww=`/** + * A built-in GLSL floating-point constant for <code>pi/2</code>. * - * @name czm_RGBToHSB - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * @alias czm_piOverTwo + * @glslConstant * - * @returns {vec3} The color in HSB. + * @see CesiumMath.PI_OVER_TWO * * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); - */ - -const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - -vec3 czm_RGBToHSB(vec3 rgb) -{ - vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); - vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); - - float d = q.x - min(q.w, q.y); - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); -} -`;var DD=`/** - * Converts an RGB color to HSL (hue, saturation, lightness) - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * // GLSL declaration + * const float czm_piOverTwo = ...; * - * @name czm_RGBToHSL - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * // Example + * float pi = 2.0 * czm_piOverTwo; + */ +const float czm_piOverTwo = 1.5707963267948966; +`;var jw=`/** + * A built-in GLSL floating-point constant for converting degrees to radians. * - * @returns {vec3} The color in HSL. + * @alias czm_radiansPerDegree + * @glslConstant + * + * @see CesiumMath.RADIANS_PER_DEGREE * * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); + * // GLSL declaration + * const float czm_radiansPerDegree = ...; + * + * // Example + * float rad = czm_radiansPerDegree * deg; */ - -vec3 RGBtoHCV(vec3 rgb) -{ - // Based on work by Sam Hocevar and Emil Persson - vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); - vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); - float c = q.x - min(q.w, q.y); - float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); - return vec3(h, c, q.x); -} - -vec3 czm_RGBToHSL(vec3 rgb) -{ - vec3 hcv = RGBtoHCV(rgb); - float l = hcv.z - hcv.y * 0.5; - float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); - return vec3(hcv.x, s, l); -} -`;var ID=`/** - * Converts an RGB color to CIE Yxy. - * <p>The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - * </p> - * - * @name czm_RGBToXYZ - * @glslFunction - * - * @param {vec3} rgb The color in RGB. +const float czm_radiansPerDegree = 0.017453292519943295; +`;var qw=`/** + * The constant identifier for the 2D {@link SceneMode} * - * @returns {vec3} The color in CIE Yxy. + * @name czm_sceneMode2D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing + */ +const float czm_sceneMode2D = 2.0; +`;var Yw=`/** + * The constant identifier for the 3D {@link SceneMode} * - * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * @name czm_sceneMode3D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneModeMorphing */ -vec3 czm_RGBToXYZ(vec3 rgb) -{ - const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, - 0.3576, 0.7152, 0.1192, - 0.1805, 0.0722, 0.9505); - vec3 xyz = RGB2XYZ * rgb; - vec3 Yxy; - Yxy.r = xyz.g; - float temp = dot(vec3(1.0), xyz); - Yxy.gb = xyz.rg / temp; - return Yxy; -} -`;var PD=`/** - * Round a floating point value. This function exists because round() doesn't - * exist in GLSL 1.00. +const float czm_sceneMode3D = 3.0; +`;var Xw=`/** + * The constant identifier for the Columbus View {@link SceneMode} * - * @param {float|vec2|vec3|vec4} value The value to round - * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + * @name czm_sceneModeColumbusView + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing */ -float czm_round(float value) { - return floor(value + 0.5); -} - -vec2 czm_round(vec2 value) { - return floor(value + 0.5); -} - -vec3 czm_round(vec3 value) { - return floor(value + 0.5); -} - -vec4 czm_round(vec4 value) { - return floor(value + 0.5); -} -`;var OD=`/** - * Samples the 4 neighboring pixels and return the weighted average. +const float czm_sceneModeColumbusView = 1.0; +`;var Kw=`/** + * The constant identifier for the Morphing {@link SceneMode} * - * @private + * @name czm_sceneModeMorphing + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D */ -vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) -{ - direction /= dot(vec3(1.0), abs(direction)); - vec2 rev = abs(direction.zx) - vec2(1.0); - vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, - direction.z < 0.0 ? rev.y : -rev.y); - vec2 uv = direction.y < 0.0 ? neg : direction.xz; - vec2 coord = 0.5 * uv + vec2(0.5); - vec2 pixel = 1.0 / textureSize; - - if (lod > 0.0) - { - // Each subseqeuent mip level is half the size - float scale = 1.0 / pow(2.0, lod); - float offset = ((textureSize.y + 1.0) / textureSize.x); - - coord.x *= offset; - coord *= scale; - - coord.x += offset + pixel.x; - coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; - } - else - { - coord.x *= (textureSize.y / textureSize.x); - } - - // Do bilinear filtering - #ifndef OES_texture_float_linear - vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; - vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; - vec3 color3 = texture(projectedMap, coord + pixel).rgb; - vec3 color4 = texture(projectedMap, coord).rgb; - - vec2 texturePosition = coord * textureSize; - - float fu = fract(texturePosition.x); - float fv = fract(texturePosition.y); - - vec3 average1 = mix(color4, color2, fu); - vec3 average2 = mix(color1, color3, fu); - - vec3 color = mix(average1, average2, fv); - #else - vec3 color = texture(projectedMap, coord).rgb; - #endif - - return color; -} - - -/** - * Samples from a cube map that has been projected using an octahedral projection from the given direction. +const float czm_sceneModeMorphing = 0.0; +`;var Jw=`/** + * A built-in GLSL floating-point constant for one solar radius. * - * @name czm_sampleOctahedralProjection - * @glslFunction + * @alias czm_solarRadius + * @glslConstant * - * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. - * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. - * @param {vec3} direction The normalized direction used to sample the cube map. - * @param {float} lod The level of detail to sample. - * @param {float} maxLod The maximum level of detail. - * @returns {vec3} The color of the cube map at the direction. + * @see CesiumMath.SOLAR_RADIUS + * + * @example + * // GLSL declaration + * const float czm_solarRadius = ...; */ -vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { - float currentLod = floor(lod + 0.5); - float nextLod = min(currentLod + 1.0, maxLod); - - vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); - vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); - - return mix(colorNextLod, colorCurrentLod, nextLod - lod); -} -`;var MD=`/** - * Adjusts the saturation of a color. - * - * @name czm_saturation - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the saturation of the color. +const float czm_solarRadius = 695500000.0; +`;var Zw=`/** + * A built-in GLSL floating-point constant for <code>3pi/2</code>. * - * @returns {float} The color with the saturation adjusted. + * @alias czm_threePiOver2 + * @glslConstant + * + * @see CesiumMath.THREE_PI_OVER_TWO * * @example - * vec3 greyScale = czm_saturation(color, 0.0); - * vec3 doubleSaturation = czm_saturation(color, 2.0); + * // GLSL declaration + * const float czm_threePiOver2 = ...; + * + * // Example + * float pi = (2.0 / 3.0) * czm_threePiOver2; */ -vec3 czm_saturation(vec3 rgb, float adjustment) -{ - // Algorithm from Chapter 16 of OpenGL Shading Language - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - vec3 intensity = vec3(dot(rgb, W)); - return mix(intensity, rgb, adjustment); -} -`;var RD=` -float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) -{ - return czm_unpackDepth(czm_textureCube(shadowMap, d)); -} - -float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) -{ -#ifdef USE_SHADOW_DEPTH_TEXTURE - return texture(shadowMap, uv).r; -#else - return czm_unpackDepth(texture(shadowMap, uv)); -#endif -} - -float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} - -float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} -`;var BD=` -float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) -{ -#ifdef USE_NORMAL_SHADING -#ifdef USE_NORMAL_SHADING_SMOOTH - float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); -#else - float strength = step(0.0, nDotL); -#endif - visibility *= strength; -#endif - - visibility = max(visibility, darkness); - return visibility; -} - -#ifdef USE_CUBE_MAP_SHADOW -float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec3 uvw = shadowParameters.texCoords; - - depth -= depthBias; - float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#else -float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec2 uv = shadowParameters.texCoords; - - depth -= depthBias; -#ifdef USE_SOFT_SHADOWS - vec2 texelStepSize = shadowParameters.texelStepSize; - float radius = 1.0; - float dx0 = -texelStepSize.x * radius; - float dy0 = -texelStepSize.y * radius; - float dx1 = texelStepSize.x * radius; - float dy1 = texelStepSize.y * radius; - float visibility = ( - czm_shadowDepthCompare(shadowMap, uv, depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) - ) * (1.0 / 9.0); -#else - float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); -#endif - - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#endif -`;var LD=`/** - * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL - * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0. - * - * @name czm_signNotZero - * @glslFunction +const float czm_threePiOver2 = 4.71238898038469; +`;var $w=`/** + * A built-in GLSL floating-point constant for <code>2pi</code>. * - * @param {} value The value for which to determine the sign. - * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. - */ -float czm_signNotZero(float value) -{ - return value >= 0.0 ? 1.0 : -1.0; -} - -vec2 czm_signNotZero(vec2 value) -{ - return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); -} - -vec3 czm_signNotZero(vec3 value) -{ - return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); -} - -vec4 czm_signNotZero(vec4 value) -{ - return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); -} -`;var ND=`/** - * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. - * <p> - * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. - * </p> + * @alias czm_twoPi + * @glslConstant * - * @name czm_sphericalHarmonics - * @glslFunction + * @see CesiumMath.TWO_PI * - * @param {vec3} normal The normalized direction. - * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. - * @returns {vec3} The color at the direction. + * @example + * // GLSL declaration + * const float czm_twoPi = ...; * - * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + * // Example + * float pi = czm_twoPi / 2.0; */ -vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) -{ - vec3 L00 = coefficients[0]; - vec3 L1_1 = coefficients[1]; - vec3 L10 = coefficients[2]; - vec3 L11 = coefficients[3]; - vec3 L2_2 = coefficients[4]; - vec3 L2_1 = coefficients[5]; - vec3 L20 = coefficients[6]; - vec3 L21 = coefficients[7]; - vec3 L22 = coefficients[8]; - - float x = normal.x; - float y = normal.y; - float z = normal.z; - - return - L00 - + L1_1 * y - + L10 * z - + L11 * x - + L2_2 * (y * x) - + L2_1 * (y * z) - + L20 * (3.0 * z * z - 1.0) - + L21 * (z * x) - + L22 * (x * x - y * y); -} -`;var FD=`/** - * Converts an sRGB color to a linear RGB color. +const float czm_twoPi = 6.283185307179586; +`;var Qw=`/** + * The maximum latitude, in radians, both North and South, supported by a Web Mercator + * (EPSG:3857) projection. Technically, the Mercator projection is defined + * for any latitude up to (but not including) 90 degrees, but it makes sense + * to cut it off sooner because it grows exponentially with increasing latitude. + * The logic behind this particular cutoff value, which is the one used by + * Google Maps, Bing Maps, and Esri, is that it makes the projection + * square. That is, the rectangle is equal in the X and Y directions. * - * @param {vec3|vec4} srgbIn The color in sRGB space - * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + * The constant value is computed as follows: + * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) + * + * @name czm_webMercatorMaxLatitude + * @glslConstant */ -vec3 czm_srgbToLinear(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -vec4 czm_srgbToLinear(vec4 srgbIn) +const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var eI=`/** + * @name czm_depthRangeStruct + * @glslStruct + */ +struct czm_depthRangeStruct { - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} -`;var UD=`/** - * Creates a matrix that transforms vectors from tangent space to eye space. - * - * @name czm_tangentToEyeSpaceMatrix - * @glslFunction - * - * @param {vec3} normalEC The normal vector in eye coordinates. - * @param {vec3} tangentEC The tangent vector in eye coordinates. - * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + float near; + float far; +}; +`;var tI=`/** + * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * - * @returns {mat3} The matrix that transforms from tangent space to eye space. + * @name czm_material + * @glslStruct * - * @example - * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); - * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} specular Intensity of incoming light reflecting in a single direction. + * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. */ -mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +struct czm_material { - vec3 normal = normalize(normalEC); - vec3 tangent = normalize(tangentEC); - vec3 bitangent = normalize(bitangentEC); - return mat3(tangent.x , tangent.y , tangent.z, - bitangent.x, bitangent.y, bitangent.z, - normal.x , normal.y , normal.z); -} -`;var VD=`/** - * A wrapper around the texture (WebGL2) / textureCube (WebGL1) - * function to allow for WebGL 1 support. - * - * @name czm_textureCube - * @glslFunction + vec3 diffuse; + float specular; + float shininess; + vec3 normal; + vec3 emission; + float alpha; +}; +`;var nI=`/** + * Used as input to every material's czm_getMaterial function. * - * @param {samplerCube} sampler The sampler. - * @param {vec3} p The coordinates to sample the texture at. - */ -vec4 czm_textureCube(samplerCube sampler, vec3 p) { -#if __VERSION__ == 300 - return texture(sampler, p); -#else - return textureCube(sampler, p); -#endif -}`;var kD=`/** - * Transforms a plane. - * - * @name czm_transformPlane - * @glslFunction + * @name czm_materialInput + * @glslStruct * - * @param {vec4} plane The plane in Hessian Normal Form. - * @param {mat4} transform The inverse-transpose of a transformation matrix. + * @property {float} s 1D texture coordinates. + * @property {vec2} st 2D texture coordinates. + * @property {vec3} str 3D texture coordinates. + * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. + * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. + * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. + * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. + * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. + * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. */ -vec4 czm_transformPlane(vec4 plane, mat4 transform) { - vec4 transformedPlane = transform * plane; - // Convert the transformed plane to Hessian Normal Form - float normalMagnitude = length(transformedPlane.xyz); - return transformedPlane / normalMagnitude; -} -`;var zD=`/** - * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3}, - * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to - * be relative to the eye. As shown in the example, the position can then be transformed in eye - * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, - * respectively. - * <p> - * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as - * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. +struct czm_materialInput +{ + float s; + vec2 st; + vec3 str; + vec3 normalEC; + mat3 tangentToEyeMatrix; + vec3 positionToEyeEC; + float height; + float slope; + float aspect; +}; +`;var iI=`/** + * Struct for representing a material for a {@link Model}. The model + * rendering pipeline will pass this struct between material, custom shaders, + * and lighting stages. This is not to be confused with {@link czm_material} + * which is used by the older Fabric materials system, although they are similar. + * <p> + * All color values (diffuse, specular, emissive) are in linear color space. * </p> * - * @name czm_translateRelativeToEye - * @glslFunction + * @name czm_modelMaterial + * @glslStruct * - * @param {vec3} high The position's high bits. - * @param {vec3} low The position's low bits. - * @returns {vec3} The position translated to be relative to the camera's position. + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. + * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. + * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. + * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. + * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + */ +struct czm_modelMaterial { + vec3 diffuse; + float alpha; + vec3 specular; + float roughness; + vec3 normalEC; + float occlusion; + vec3 emissive; +}; +`;var rI=`/** + * Struct for representing the output of a custom vertex shader. + * + * @name czm_modelVertexOutput + * @glslStruct * - * @example - * in vec3 positionHigh; - * in vec3 positionLow; + * @see {@link CustomShader} + * @see {@link Model} * - * void main() - * { - * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * } + * @property {vec3} positionMC The position of the vertex in model coordinates + * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. + */ +struct czm_modelVertexOutput { + vec3 positionMC; + float pointSize; +}; +`;var oI=`/** + * Parameters for {@link czm_pbrLighting} * - * @see czm_modelViewRelativeToEye - * @see czm_modelViewProjectionRelativeToEye - * @see czm_computePosition - * @see EncodedCartesian3 + * @name czm_material + * @glslStruct + * + * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation + * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. + * @property {vec3} f0 The reflectance of the material at normal incidence */ -vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +struct czm_pbrParameters { - vec3 highDifference = high - czm_encodedCameraPositionMCHigh; - vec3 lowDifference = low - czm_encodedCameraPositionMCLow; + vec3 diffuseColor; + float roughness; + vec3 f0; +}; +`;var sI=`/** + * DOC_TBA + * + * @name czm_ray + * @glslStruct + */ +struct czm_ray +{ + vec3 origin; + vec3 direction; +}; +`;var aI=`/** + * DOC_TBA + * + * @name czm_raySegment + * @glslStruct + */ +struct czm_raySegment +{ + float start; + float stop; +}; - return vec4(highDifference + lowDifference, 1.0); -} -`;var HD=`/** - * @private +/** + * DOC_TBA + * + * @name czm_emptyRaySegment + * @glslConstant */ -vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + +/** + * DOC_TBA + * + * @name czm_fullRaySegment + * @glslConstant + */ +const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); +`;var cI=`struct czm_shadowParameters { - // Diffuse from directional light sources at eye (for top-down and horizon views) - float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +#ifdef USE_CUBE_MAP_SHADOW + vec3 texCoords; +#else + vec2 texCoords; +#endif - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); - } + float depthBias; + float depth; + float nDotL; + vec2 texelStepSize; + float normalShadingSmooth; + float darkness; +}; +`;var lI=`// See: +// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ - diffuse = clamp(diffuse, 0.0, 1.0); +vec3 czm_acesTonemapping(vec3 color) { + float g = 0.985; + float a = 0.065; + float b = 0.0001; + float c = 0.433; + float d = 0.238; - float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); + color = (color * (color + a) - b) / (color * (g * color + c) + d); - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; + color = clamp(color, 0.0, 1.0); - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; + return color; +} +`;var uI=`/** + * @private + */ +float czm_alphaWeight(float a) +{ + float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - return vec4(color, material.alpha); + // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: + // http://jcgt.org/published/0002/02/09/ + return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } -`;var GD=`/** - * Returns the transpose of the matrix. The input <code>matrix</code> can be - * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>. +`;var fI=`/** + * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * - * @name czm_transpose + * @name czm_antialias * @glslFunction * - * @param {} matrix The matrix to transpose. - * - * @returns {} The transposed matrix. + * @param {vec4} color1 The color on one side of the edge. + * @param {vec4} color2 The color on the other side of the edge. + * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>. + * @param {float} dist The distance to the edge in texture coordinates. + * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. + * @returns {vec4} The anti-aliased color. * * @example * // GLSL declarations - * mat2 czm_transpose(mat2 matrix); - * mat3 czm_transpose(mat3 matrix); - * mat4 czm_transpose(mat4 matrix); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); * - * // Transpose a 3x3 rotation matrix to find its inverse. - * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( - * positionMC, normalEC); - * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space + * float dist = abs(textureCoordinates.t - 0.5); + * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); + * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); */ -mat2 czm_transpose(mat2 matrix) -{ - return mat2( - matrix[0][0], matrix[1][0], - matrix[0][1], matrix[1][1]); -} - -mat3 czm_transpose(mat3 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { - return mat3( - matrix[0][0], matrix[1][0], matrix[2][0], - matrix[0][1], matrix[1][1], matrix[2][1], - matrix[0][2], matrix[1][2], matrix[2][2]); + float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); + float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); + val1 = val1 * (1.0 - val2); + val1 = val1 * val1 * (3.0 - (2.0 * val1)); + val1 = pow(val1, 0.5); //makes the transition nicer + + vec4 midColor = (color1 + color2) * 0.5; + return mix(midColor, currentColor, val1); } -mat4 czm_transpose(mat4 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { - return mat4( - matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], - matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], - matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], - matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); + return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var WD=`/** - * Unpacks a vec4 depth value to a float in [0, 1) range. +`;var dI=`/** + * Approximately computes spherical coordinates given a normal. + * Uses approximate inverse trigonometry for speed and consistency, + * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. * - * @name czm_unpackDepth + * @name czm_approximateSphericalCoordinates * @glslFunction * - * @param {vec4} packedDepth The packed depth. + * @param {vec3} normal arbitrary-length normal. * - * @returns {float} The floating-point depth in [0, 1) range. + * @returns {vec2} Approximate latitude and longitude spherical coordinates. */ - float czm_unpackDepth(vec4 packedDepth) - { - // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); - } -`;var jD=`/** - * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. - * - * @name czm_unpackFloat - * @glslFunction - * - * @param {vec4} packedFloat The packed float. +vec2 czm_approximateSphericalCoordinates(vec3 normal) { + // Project into plane with vertical for latitude + float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); + float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); + return vec2(latitudeApproximation, longitudeApproximation); +} +`;var mI=`/** + * Determines if the fragment is back facing * - * @returns {float} The floating-point depth in arbitrary range. - */ -float czm_unpackFloat(vec4 packedFloat) -{ - // Convert to [0.0, 255.0] and round to integer - packedFloat = floor(packedFloat * 255.0 + 0.5); - float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; - float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; - if (exponent == -127.0) - { - return 0.0; - } - float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); - float result = sign * exp2(exponent - 23.0) * mantissa; - return result; + * @name czm_backFacing + * @glslFunction + * + * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>. + */ +bool czm_backFacing() +{ + // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. + return gl_FrontFacing == false; } -`;var qD=`/** - * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, - * so the return value is an int. - * <p> - * There are also precision limitations in WebGL 1. highp int is still limited - * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. - * </p> +`;var hI=`/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a float expression. * - * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * @name czm_branchFreeTernary + * @glslFunction * - * @return {int} The unpacked value. - */ - int czm_unpackUint(float packedValue) { - float rounded = czm_round(packedValue * 255.0); - return int(rounded); - } - - int czm_unpackUint(vec2 packedValue) { - vec2 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec2(1.0, 256.0))); - } - - int czm_unpackUint(vec3 packedValue) { - vec3 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); - } - - int czm_unpackUint(vec4 packedValue) { - vec4 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); - } -`;var YD=`/** - * Transform metadata values following the EXT_structural_metadata spec - * by multiplying by scale and adding the offset. Operations are always - * performed component-wise, even for matrices. - * - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * @param {bool} comparison A comparison statement + * @param {float} a Value to return if the comparison is true. + * @param {float} b Value to return if the comparison is false. * - * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + * @returns {float} equivalent of comparison ? a : b */ -float czm_valueTransform(float offset, float scale, float value) { - return scale * value + offset; +float czm_branchFreeTernary(bool comparison, float a, float b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec2 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec2} a Value to return if the comparison is true. + * @param {vec2} b Value to return if the comparison is false. + * + * @returns {vec2} equivalent of comparison ? a : b + */ +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec3 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec4 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } - -mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { - return matrixCompMult(scale, value) + offset; +`;var pI=` +vec4 czm_cascadeColor(vec4 weights) +{ + return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + + vec4(0.0, 1.0, 0.0, 1.0) * weights.y + + vec4(0.0, 0.0, 1.0, 1.0) * weights.z + + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } +`;var _I=` +uniform vec4 shadowMap_cascadeDistances; -mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { - return matrixCompMult(scale, value) + offset; +float czm_cascadeDistance(vec4 weights) +{ + return dot(shadowMap_cascadeDistances, weights); } +`;var gI=` +uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { - return matrixCompMult(scale, value) + offset; +mat4 czm_cascadeMatrix(vec4 weights) +{ + return shadowMap_cascadeMatrices[0] * weights.x + + shadowMap_cascadeMatrices[1] * weights.y + + shadowMap_cascadeMatrices[2] * weights.z + + shadowMap_cascadeMatrices[3] * weights.w; } -`;var XD=`#ifdef LOG_DEPTH -// 1.0 at the near plane, increasing linearly from there. -out float v_depthFromNearPlusOne; -#ifdef SHADOW_MAP -out vec3 v_logPositionEC; -#endif -#endif - -vec4 czm_updatePositionDepth(vec4 coords) { -#if defined(LOG_DEPTH) - -#ifdef SHADOW_MAP - vec3 logPositionEC = (czm_inverseProjection * coords).xyz; - v_logPositionEC = logPositionEC; -#endif - - // With the very high far/near ratios used with the logarithmic depth - // buffer, floating point rounding errors can cause linear depth values - // to end up on the wrong side of the far plane, even for vertices that - // are really nowhere near it. Since we always write a correct logarithmic - // depth value in the fragment shader anyway, we just need to make sure - // such errors don't cause the primitive to be clipped entirely before - // we even get to the fragment shader. - coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; -#endif +`;var yI=` +uniform vec4 shadowMap_cascadeSplits[2]; - return coords; +vec4 czm_cascadeWeights(float depthEye) +{ + // One component is set to 1.0 and all others set to 0.0. + vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); + vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); + return near * far; } - -/** - * Writes the logarithmic depth to gl_Position using the already computed gl_Position. +`;var xI=`/** + * DOC_TBA * - * @name czm_vertexLogDepth + * @name czm_columbusViewMorph * @glslFunction */ -void czm_vertexLogDepth() +vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; - gl_Position = czm_updatePositionDepth(gl_Position); -#endif + // Just linear for now. + vec3 p = mix(position2D.xyz, position3D.xyz, time); + return vec4(p, 1.0); } - -/** - * Writes the logarithmic depth to gl_Position using the provided clip coordinates. +`;var bI=`/** + * Returns a position in model coordinates relative to eye taking into + * account the current scene mode: 3D, 2D, or Columbus view. * <p> - * An example use case for this function would be moving the vertex in window coordinates - * before converting back to clip coordinates. Use the original vertex clip coordinates. + * This uses standard position attributes, <code>position3DHigh</code>, + * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, + * and should be used when writing a vertex shader for an {@link Appearance}. * </p> - * @name czm_vertexLogDepth + * + * @name czm_computePosition * @glslFunction * - * @param {vec4} clipCoords The vertex in clip coordinates. + * @returns {vec4} The position relative to eye. * * @example - * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + * vec4 p = czm_computePosition(); + * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * + * @see czm_translateRelativeToEye */ -void czm_vertexLogDepth(vec4 clipCoords) -{ -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; - czm_updatePositionDepth(clipCoords); -#endif -} -`;var KD=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +vec4 czm_computePosition(); +`;var CI=`/** + * @private + */ +vec2 cordic(float angle) { - // Reconstruct NDC coordinates - float x = 2.0 * screenCoordinate.x - 1.0; - float y = 2.0 * screenCoordinate.y - 1.0; - float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - vec4 q = vec4(x, y, z, 1.0); - - // Reverse the perspective division to obtain clip coordinates. - q /= screenCoordinate.w; - - // Reverse the projection transformation to obtain eye coordinates. - if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s - { - q = czm_inverseProjection * q; - } - else - { - float top = czm_frustumPlanes.x; - float bottom = czm_frustumPlanes.y; - float left = czm_frustumPlanes.z; - float right = czm_frustumPlanes.w; - - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - - q.x = (q.x * (right - left) + left + right) * 0.5; - q.y = (q.y * (top - bottom) + bottom + top) * 0.5; - q.z = (q.z * (near - far) - near - far) * 0.5; - q.w = 1.0; - } - - return q; +// Scale the vector by the appropriate factor for the 24 iterations to follow. + vec2 vector = vec2(6.0725293500888267e-1, 0.0); +// Iteration 1 + float sense = (angle < 0.0) ? -1.0 : 1.0; + // float factor = sense * 1.0; // 2^-0 + mat2 rotation = mat2(1.0, sense, -sense, 1.0); + vector = rotation * vector; + angle -= sense * 7.8539816339744828e-1; // atan(2^-0) +// Iteration 2 + sense = (angle < 0.0) ? -1.0 : 1.0; + float factor = sense * 5.0e-1; // 2^-1 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.6364760900080609e-1; // atan(2^-1) +// Iteration 3 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.5e-1; // 2^-2 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4497866312686414e-1; // atan(2^-2) +// Iteration 4 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.25e-1; // 2^-3 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2435499454676144e-1; // atan(2^-3) +// Iteration 5 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.25e-2; // 2^-4 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.2418809995957350e-2; // atan(2^-4) +// Iteration 6 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.125e-2; // 2^-5 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.1239833430268277e-2; // atan(2^-5) +// Iteration 7 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.5625e-2; // 2^-6 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5623728620476831e-2; // atan(2^-6) +// Iteration 8 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.8125e-3; // 2^-7 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.8123410601011111e-3; // atan(2^-7) +// Iteration 9 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.90625e-3; // 2^-8 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.9062301319669718e-3; // atan(2^-8) +// Iteration 10 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.953125e-3; // 2^-9 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9531225164788188e-3; // atan(2^-9) +// Iteration 11 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.765625e-4; // 2^-10 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.7656218955931946e-4; // atan(2^-10) +// Iteration 12 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.8828125e-4; // 2^-11 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.8828121119489829e-4; // atan(2^-11) +// Iteration 13 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.44140625e-4; // 2^-12 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4414062014936177e-4; // atan(2^-12) +// Iteration 14 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.220703125e-4; // 2^-13 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2207031189367021e-4; // atan(2^-13) +// Iteration 15 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.103515625e-5; // 2^-14 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.1035156174208773e-5; // atan(2^-14) +// Iteration 16 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.0517578125e-5; // 2^-15 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.0517578115526096e-5; // atan(2^-15) +// Iteration 17 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.52587890625e-5; // 2^-16 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5258789061315762e-5; // atan(2^-16) +// Iteration 18 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.62939453125e-6; // 2^-17 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.6293945311019700e-6; // atan(2^-17) +// Iteration 19 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.814697265625e-6; // 2^-18 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.8146972656064961e-6; // atan(2^-18) +// Iteration 20 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.9073486328125e-6; // 2^-19 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9073486328101870e-6; // atan(2^-19) +// Iteration 21 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.5367431640625e-7; // 2^-20 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.5367431640596084e-7; // atan(2^-20) +// Iteration 22 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.76837158203125e-7; // 2^-21 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.7683715820308884e-7; // atan(2^-21) +// Iteration 23 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.384185791015625e-7; // 2^-22 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.3841857910155797e-7; // atan(2^-22) +// Iteration 24 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.1920928955078125e-7; // 2^-23 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; +// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) + + return vector; } /** - * Transforms a position from window to eye coordinates. - * The transform from window to normalized device coordinates is done using components - * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating - * the inverse of <code>czm_viewportTransformation</code>. The transformation from - * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>, - * which is expected to be the scalar used in the perspective divide. The transformation - * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * Computes the cosine and sine of the provided angle using the CORDIC algorithm. * - * @name czm_windowToEyeCoordinates + * @name czm_cosineAndSine * @glslFunction * - * @param {vec4} fragmentCoordinate The position in window coordinates to transform. - * - * @returns {vec4} The transformed position in eye coordinates. + * @param {float} angle The angle in radians. * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation + * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). * * @example - * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + * vec2 v = czm_cosineAndSine(czm_piOverSix); + * float cosine = v.x; + * float sine = v.y; */ -vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) -{ - vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); -} - -vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +vec2 czm_cosineAndSine(float angle) { - // See reverseLogDepth.glsl. This is separate to re-use the pow. -#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - float depthFromCamera = depthFromNear + near; - vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); - eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision - return eyeCoordinate; -#else - vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); -#endif - return eyeCoordinate; + if (angle < -czm_piOverTwo || angle > czm_piOverTwo) + { + if (angle < 0.0) + { + return -cordic(angle + czm_pi); + } + else + { + return -cordic(angle - czm_pi); + } + } + else + { + return cordic(angle); + } } - -/** - * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. - * This function produces more accurate results for window positions with log depth than - * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version - * of czm_windowToEyeCoordinates. +`;var TI=`/** + * Decompresses texture coordinates that were packed into a single float. * - * @name czm_windowToEyeCoordinates + * @name czm_decompressTextureCoordinates * @glslFunction * - * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. - * @param {float} depthOrLogDepth A depth or log depth for the fragment. - * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation - * - * @returns {vec4} The transformed position in eye coordinates. + * @param {float} encoded The compressed texture coordinates. + * @returns {vec2} The decompressed texture coordinates. */ -vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) + vec2 czm_decompressTextureCoordinates(float encoded) + { + float temp = encoded / 4096.0; + float xZeroTo4095 = floor(temp); + float stx = xZeroTo4095 / 4095.0; + float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; + return vec2(stx, sty); + } +`;var AI=`/** + * Get default parameters for physically based rendering. These defaults + * describe a rough dielectric (non-metal) surface (e.g. rough plastic). + * + * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} + */ +czm_pbrParameters czm_defaultPbrMaterial() { - vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); + czm_pbrParameters results; + results.diffuseColor = vec3(1.0); + results.roughness = 1.0; + + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + results.f0 = REFLECTANCE_DIELECTRIC; + return results; } -`;var JD=`// emulated noperspective -#if !defined(LOG_DEPTH) -in float v_WindowZ; +`;var EI=`// emulated noperspective +#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; #endif /** - * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane - * by writing the fragment's depth. See czm_depthClamp for more details. + * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. + * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, + * capping the shadow volume. More information here: + * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. * - * @name czm_writeDepthClamp + * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring + * no geometry gets clipped by setting the clip space z value to 0.0 and then + * sending the unaltered screen space z value (using emulated noperspective + * interpolation) to the frag shader where it is clamped to [0,1] and then + * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: + * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. + * + * When GL_EXT_frag_depth is not available, which is the case on some mobile + * devices, we must attempt to fix this only in the vertex shader. + * The approach is to clamp the z value to the far plane, which closes the + * shadow volume but also distorts the geometry, so there can still be artifacts + * on frustum seams. + * + * @name czm_depthClamp * @glslFunction * + * @param {vec4} coords The vertex in clip coordinates. + * @returns {vec4} The modified vertex. + * * @example - * out_FragColor = color; - * czm_writeDepthClamp(); + * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); * - * @see czm_depthClamp + * @see czm_writeDepthClamp */ -void czm_writeDepthClamp() +vec4 czm_depthClamp(vec4 coords) { -#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); -#endif -} -`;var ZD=`#ifdef LOG_DEPTH -in float v_depthFromNearPlusOne; - -#ifdef POLYGON_OFFSET -uniform vec2 u_polygonOffset; -#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) + v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; + coords.z = 0.0; +#else + coords.z = min(coords.z, coords.w); #endif - #endif - -/** - * Writes the fragment depth to the logarithmic depth buffer. - * <p> - * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when - * ray-casting geometry using a full screen quad. - * </p> - * @name czm_writeLogDepth + return coords; +} +`;var SI=`/** + * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system + * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the + * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. + * <br /><br /> + * The ellipsoid is assumed to be centered at the model coordinate's origin. + * + * @name czm_eastNorthUpToEyeCoordinates * @glslFunction * - * @param {float} depth The depth coordinate, where 1.0 is on the near plane and - * depth increases in eye-space units from there + * @param {vec3} positionMC The position on the ellipsoid in model coordinates. + * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates. + * + * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. * * @example - * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + * // Transform a vector defined in the east-north-up coordinate + * // system, (0, 0, 1) which is the surface normal, to eye + * // coordinates. + * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); */ -void czm_writeLogDepth(float depth) +mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { -#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - // Discard the vertex if it's not between the near and far planes. - // We allow a bit of epsilon on the near plane comparison because a 1.0 - // from the vertex shader (indicating the vertex should be _on_ the near - // plane) will not necessarily come here as exactly 1.0. - if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { - discard; - } - -#ifdef POLYGON_OFFSET - // Polygon offset: m * factor + r * units - float factor = u_polygonOffset[0]; - float units = u_polygonOffset[1]; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // This factor doesn't work in IE 10 - if (factor != 0.0) { - // m = sqrt(dZdX^2 + dZdY^2); - float x = dFdx(depth); - float y = dFdy(depth); - float m = sqrt(x * x + y * y); - - // Apply the factor before computing the log depth. - depth += m * factor; - } -#endif - -#endif - - gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; - -#ifdef POLYGON_OFFSET - // Apply the units after the log depth. - gl_FragDepth += czm_epsilon7 * units; -#endif + vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates + vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes + vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates -#endif + return mat3( + tangentEC.x, tangentEC.y, tangentEC.z, + bitangentEC.x, bitangentEC.y, bitangentEC.z, + normalEC.x, normalEC.y, normalEC.z); } - -/** - * Writes the fragment depth to the logarithmic depth buffer. - * <p> - * Use this when the vertex shader calls {@link czm_vertexlogDepth}. - * </p> +`;var vI=`/** + * DOC_TBA * - * @name czm_writeLogDepth + * @name czm_ellipsoidContainsPoint * @glslFunction + * */ -void czm_writeLogDepth() { -#ifdef LOG_DEPTH - czm_writeLogDepth(v_depthFromNearPlusOne); -#endif +bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +{ + vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; + return (dot(scaled, scaled) <= 1.0); } -`;var QD=`/** - * Transforms a value for non-perspective interpolation by multiplying - * it by w, the value used in the perspective divide. This function is - * intended to be called in a vertex shader to compute the value of a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The fragment shader - * must call {@link czm_readNonPerspective} to retrieve the final - * non-perspective value. +`;var wI=`/** + * DOC_TBA * - * @name czm_writeNonPerspective + * @name czm_ellipsoidWgs84TextureCoordinates * @glslFunction + */ +vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +{ + return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); +} +`;var II=`/** + * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code> + * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs + * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s, + * <code>vec3</code>s, or <code>vec4</code>s. * - * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. - * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. - * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the - * fragment shader with {@link czm_readNonPerspective}. + * @name czm_equalsEpsilon + * @glslFunction + * + * @param {} left The first vector. + * @param {} right The second vector. + * @param {float} epsilon The epsilon to use for equality testing. + * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise. + * + * @example + * // GLSL declarations + * bool czm_equalsEpsilon(float left, float right, float epsilon); + * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); + * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); + * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); */ -float czm_writeNonPerspective(float value, float w) { - return value * w; +bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec4(epsilon))); } -vec2 czm_writeNonPerspective(vec2 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec3(epsilon))); } -vec3 czm_writeNonPerspective(vec3 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec2(epsilon))); } -vec4 czm_writeNonPerspective(vec4 value, float w) { - return value * w; +bool czm_equalsEpsilon(float left, float right, float epsilon) { + return (abs(left - right) <= epsilon); } -`;var $D=`/** - * Converts a CIE Yxy color to RGB. - * <p>The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - * </p> - * - * @name czm_XYZToRGB +`;var PI=`/** + * DOC_TBA + * + * @name czm_eyeOffset * @glslFunction - * - * @param {vec3} Yxy The color in CIE Yxy. * - * @returns {vec3} The color in RGB. + * @param {vec4} positionEC DOC_TBA. + * @param {vec3} eyeOffset DOC_TBA. * - * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * @returns {vec4} DOC_TBA. */ -vec3 czm_XYZToRGB(vec3 Yxy) +vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { - const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, - -1.5371, 1.8760, -0.2040, - -0.4985, 0.0416, 1.0572); - vec3 xyz; - xyz.r = Yxy.r * Yxy.g / Yxy.b; - xyz.g = Yxy.r; - xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; - - return XYZ2RGB * xyz; -} -`;var eI=`vec3 czm_fromCartesian(vec3 position) { - vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); - vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); - float centerToleranceSquared = 0.1; - - vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); - - vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); - n = normalize(n); - - vec3 h = p - position; - - float longitude = atan(n.y, n.x); - float latitude = asin(n.z); - - float dotNum = dot(h, position); - // float height = MathSign(dotNum)*czm_magnitude(h); - float height = czm_magnitude(h); + // This equation is approximate in x and y. + vec4 p = positionEC; + vec4 zEyeOffset = normalize(p) * eyeOffset.z; + p.xy += eyeOffset.xy + zEyeOffset.xy; + p.z += zEyeOffset.z; + return p; +} +`;var DI=`/** + * Transforms a position from eye to window coordinates. The transformation + * from eye to clip coordinates is done using {@link czm_projection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of <code>near = 0</code> and <code>far = 1</code>. + * <br /><br /> + * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * + * @name czm_eyeToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in eye coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_projection + * @see czm_viewportTransformation + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + */ +vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +{ + vec4 q = czm_projection * positionEC; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var RI=`/** + * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. + * + * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on + * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + * Adapted from ShaderFastLibs under MIT License. + * + * Chosen for the following characteristics over range [0, 1]: + * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) + * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) + * + * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); + * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between 0 and 1 inclusive. + * + * @returns {float} Approximation of atan(x) + */ +float czm_fastApproximateAtan(float x) { + return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +} - vec3 result; - result.x = longitude; - result.y = latitude; - result.z = height; - return result; -}`;var tI=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ - for(int i=0;i<=16;i++){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ - if(xyxy[0][0]<minx){ - minx = xyxy[0][0]; - } - if(xyxy[0][0]>maxx){ - maxx = xyxy[0][0]; - } +/** + * Approximation of atan2. + * + * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html + * However, we replaced their atan curve with Michael Drobot's (see above). + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between -1 and 1 inclusive. + * @param {float} y Value between -1 and 1 inclusive. + * + * @returns {float} Approximation of atan2(x, y) + */ +float czm_fastApproximateAtan(float x, float y) { + // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. + // So range-reduce using abs and by flipping whether x or y is on top. + float t = abs(x); // t used as swap and atan result. + float opposite = abs(y); + float adjacent = max(t, opposite); + opposite = min(t, opposite); - if(xyxy[0][1]<miny){ - miny = xyxy[0][1]; - } - if(xyxy[0][1]>maxy){ - maxy = xyxy[0][1]; - } + t = czm_fastApproximateAtan(opposite / adjacent); - if(xyxy[0][2]<minz){ - minz = xyxy[0][2]; - } - if(xyxy[0][2]>maxz){ - maxz = xyxy[0][2]; - } - } - } - return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); + // Undo range reduction + t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); + t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); + t = czm_branchFreeTernary(y < 0.0, -t, t); + return t; +} +`;var OI=`/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-(scalar * scalar)); + return mix(color, fogColor, fog); } +/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * @param {float} fogModifierConstant A constant to modify the appearance of fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); + return mix(color, fogColor, fog); +} +`;var MI=`/** + * Converts a color from RGB space to linear space. + * + * @name czm_gammaCorrect + * @glslFunction + * + * @param {vec3} color The color in RGB space. + * @returns {vec3} The color in linear space. + */ +vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR + color = pow(color, vec3(czm_gamma)); +#endif + return color; +} +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR + color.rgb = pow(color.rgb, vec3(czm_gamma)); +#endif + return color; +} +`;var LI=`/** + * DOC_TBA + * + * @name czm_geodeticSurfaceNormal + * @glslFunction + * + * @param {vec3} positionOnEllipsoid DOC_TBA + * @param {vec3} ellipsoidCenter DOC_TBA + * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA + * + * @returns {vec3} DOC_TBA. + */ +vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) +{ + return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); +} +`;var NI=`/** + * An czm_material with default values. Every material's czm_getMaterial + * should use this default material as a base for the material it returns. + * The default normal value is given by materialInput.normalEC. + * + * @name czm_getDefaultMaterial + * @glslFunction + * + * @param {czm_materialInput} input The input used to construct the default material. + * + * @returns {czm_material} The default material. + * + * @see czm_materialInput + * @see czm_material + * @see czm_getMaterial + */ +czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +{ + czm_material material; + material.diffuse = vec3(0.0); + material.specular = 0.0; + material.shininess = 1.0; + material.normal = materialInput.normalEC; + material.emission = vec3(0.0); + material.alpha = 1.0; + return material; +} +`;var FI=`/** + * Calculates the intensity of diffusely reflected light. + * + * @name czm_getLambertDiffuse + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * + * @returns {float} The intensity of the diffuse reflection. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +{ + return max(dot(lightDirectionEC, normalEC), 0.0); +} +`;var BI=`/** + * Calculates the specular intensity of reflected light. + * + * @name czm_getSpecular + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * + * @returns {float} The intensity of the specular highlight. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +{ + vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); + float specular = max(dot(toReflectedLight, toEyeEC), 0.0); -`;var nI=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); - if(index==0){ - return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); - } - if(index==1){ - return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); - } - if(index==2){ - return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); - } - if(index==3){ - return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); - } - if(index==4){ - return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); - } - if(index==5){ - return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); - } - if(index==6){ - return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); - } - if(index==7){ - return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); - } - if(index==8){ - return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); - } - if(index==9){ - return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); - } - if(index==10){ - return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); - } - if(index==11){ - return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); - } - if(index==12){ - return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); - } - if(index==13){ - return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); - } - if(index==14){ - return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); - } - if(index==15){ - return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); - } -}`;var iI=`int czm_getMaxIndex(mat4 yp_mat_x){ - if(yp_mat_x[3][3]!=0.0){ - return 16; - } - if(yp_mat_x[3][2]!=0.0){ - return 15; - } - if(yp_mat_x[3][1]!=0.0){ - return 14; - } - if(yp_mat_x[3][0]!=0.0){ - return 15; - } - if(yp_mat_x[2][3]!=0.0){ - return 12; - } - if(yp_mat_x[2][2]!=0.0){ - return 11; - } - if(yp_mat_x[2][1]!=0.0){ - return 10; - } - if(yp_mat_x[2][0]!=0.0){ - return 9; - } - if(yp_mat_x[1][3]!=0.0){ - return 8; - } - if(yp_mat_x[1][2]!=0.0){ - return 7; - } - if(yp_mat_x[1][1]!=0.0){ - return 6; - } - if(yp_mat_x[1][0]!=0.0){ - return 5; - } - if(yp_mat_x[0][3]!=0.0){ - return 4; - } - if(yp_mat_x[0][2]!=0.0){ - return 3; - } - if(yp_mat_x[0][1]!=0.0){ - return 2; - } - if(yp_mat_x[0][0]!=0.0){ - return 1; - } -}`;var rI=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - if(yp_max_index==0){ - return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); - } - if(yp_max_index==1){ - return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); - } - if(yp_max_index==2){ - return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); - } - if(yp_max_index==3){ - return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); - } - if(yp_max_index==4){ - return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); - } - if(yp_max_index==5){ - return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); - } - if(yp_max_index==6){ - return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); - } - if(yp_max_index==7){ - return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); - } - if(yp_max_index==8){ - return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); - } - if(yp_max_index==9){ - return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); - } - if(yp_max_index==10){ - return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); - } - if(yp_max_index==11){ - return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); - } - if(yp_max_index==12){ - return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); - } - if(yp_max_index==13){ - return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); - } - if(yp_max_index==14){ - return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); - } - if(yp_max_index==15){ - return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); - } -}`;var oI=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - float pz = position.z; - if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ - vec3 lonlat = czm_fromCartesian(position); - px = lonlat.x; - py = lonlat.y; - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); - vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); - vec3 llh1 = czm_fromCartesian(pos1); - vec3 llh2 = czm_fromCartesian(pos2); - float sx = llh1.x; - float sy = llh1.y; - float tx = llh2.x; - float ty = llh2.y; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - return isIn ? true : false; -}`;var sI=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - if(currVal.x!=0.0&&currVal.y!=0.0){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - float sx = xyxy[0][0]; - float sy = xyxy[0][1]; - float tx = xyxy[1][0]; - float ty = xyxy[1][1]; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - } - return isIn ? true : false; -}`;var aI=`float czm_magnitude(vec3 cartesian3) { - return sqrt(czm_magnitudeSquared(cartesian3)); -}`;var cI=`float czm_magnitudeSquared (vec3 cartesian4) { - return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; -}`;var lI=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { - vec3 result; - result.x = left.x * right.x; - result.y = left.y * right.y; - result.z = left.z * right.z; - return result; -}`;var uI=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { - - float positionX = cartesian1.x; - float positionY = cartesian1.y; - float positionZ = cartesian1.z; + // pow has undefined behavior if both parameters <= 0. + // Prevent this by making sure shininess is at least czm_epsilon2. + return pow(specular, max(shininess, czm_epsilon2)); +} +`;var kI=`/** + * @private + */ +vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +{ + float cosAngle = cos(angleInRadians); + float sinAngle = sin(angleInRadians); - float oneOverRadiiX = oneOverRadii.x; - float oneOverRadiiY = oneOverRadii.y; - float oneOverRadiiZ = oneOverRadii.z; + // time dependent sampling directions + vec2 s0 = vec2(1.0/17.0, 0.0); + vec2 s1 = vec2(-1.0/29.0, 0.0); + vec2 s2 = vec2(1.0/101.0, 1.0/59.0); + vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); - float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; - float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; - float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; - - // Compute the squared ellipsoid norm. - float squaredNorm = x2 + y2 + z2; - float ratio = sqrt(1.0 / squaredNorm); - - // As an initial approximation, assume that the radial intersection is the projection point. - vec3 intersection = cartesian1*ratio; - - - float oneOverRadiiSquaredX = oneOverRadiiSquared.x; - float oneOverRadiiSquaredY = oneOverRadiiSquared.y; - float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; - - // Use the gradient at the intersection point in place of the true unit normal. - // The difference in magnitude will be absorbed in the multiplier. - vec3 gradient; - gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; - gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; - gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - - // Compute the initial guess at the normal vector multiplier, lambda. - float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); - float correction = 0.0; - - float func; - float denominator; - float xMultiplier; - float yMultiplier; - float zMultiplier; - float xMultiplier2; - float yMultiplier2; - float zMultiplier2; - float xMultiplier3; - float yMultiplier3; - float zMultiplier3; - func = 1.0; - for(int i=0;i<9;i++){ - if(abs(func) > 0.000000000001){ - lambda -= correction; - - xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); - yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); - zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); - - xMultiplier2 = xMultiplier * xMultiplier; - yMultiplier2 = yMultiplier * yMultiplier; - zMultiplier2 = zMultiplier * zMultiplier; - - xMultiplier3 = xMultiplier2 * xMultiplier; - yMultiplier3 = yMultiplier2 * yMultiplier; - zMultiplier3 = zMultiplier2 * zMultiplier; - - func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - - // "denominator" here refers to the use of this expression in the velocity and acceleration - // computations in the sections to follow. - denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - - float derivative = -2.0 * denominator; - - correction = func / derivative; - - }else{ - break; - } - } - - vec3 result; - result.x = positionX * xMultiplier; - result.y = positionY * yMultiplier; - result.z = positionZ * zMultiplier; - return result; -}`;var B0={czm_degreesPerRadian:Ov,czm_depthRange:Mv,czm_epsilon1:Rv,czm_epsilon2:Bv,czm_epsilon3:Lv,czm_epsilon4:Nv,czm_epsilon5:Fv,czm_epsilon6:Uv,czm_epsilon7:Vv,czm_infinity:kv,czm_oneOverPi:zv,czm_oneOverTwoPi:Hv,czm_passCesium3DTile:Gv,czm_passCesium3DTileClassification:Wv,czm_passCesium3DTileClassificationIgnoreShow:jv,czm_passClassification:qv,czm_passCompute:Yv,czm_passEnvironment:Xv,czm_passGlobe:Kv,czm_passOpaque:Jv,czm_passOverlay:Zv,czm_passTerrainClassification:Qv,czm_passTranslucent:$v,czm_passVoxels:ew,czm_pi:tw,czm_piOverFour:nw,czm_piOverSix:iw,czm_piOverThree:rw,czm_piOverTwo:ow,czm_radiansPerDegree:sw,czm_sceneMode2D:aw,czm_sceneMode3D:cw,czm_sceneModeColumbusView:lw,czm_sceneModeMorphing:uw,czm_solarRadius:fw,czm_threePiOver2:dw,czm_twoPi:mw,czm_webMercatorMaxLatitude:hw,czm_depthRangeStruct:pw,czm_material:_w,czm_materialInput:gw,czm_modelMaterial:yw,czm_modelVertexOutput:Aw,czm_pbrParameters:xw,czm_ray:Cw,czm_raySegment:Tw,czm_shadowParameters:Ew,czm_acesTonemapping:bw,czm_alphaWeight:Sw,czm_antialias:vw,czm_approximateSphericalCoordinates:ww,czm_backFacing:Dw,czm_branchFreeTernary:Iw,czm_cascadeColor:Pw,czm_cascadeDistance:Ow,czm_cascadeMatrix:Mw,czm_cascadeWeights:Rw,czm_columbusViewMorph:Bw,czm_computePosition:Lw,czm_cosineAndSine:Nw,czm_decompressTextureCoordinates:Fw,czm_defaultPbrMaterial:Uw,czm_depthClamp:Vw,czm_eastNorthUpToEyeCoordinates:kw,czm_ellipsoidContainsPoint:zw,czm_ellipsoidWgs84TextureCoordinates:Hw,czm_equalsEpsilon:Gw,czm_eyeOffset:Ww,czm_eyeToWindowCoordinates:jw,czm_fastApproximateAtan:qw,czm_fog:Yw,czm_gammaCorrect:Xw,czm_geodeticSurfaceNormal:Kw,czm_getDefaultMaterial:Jw,czm_getLambertDiffuse:Zw,czm_getSpecular:Qw,czm_getWaterNoise:$w,czm_HSBToRGB:eD,czm_HSLToRGB:tD,czm_hue:nD,czm_inverseGamma:iD,czm_isEmpty:rD,czm_isFull:oD,czm_latitudeToWebMercatorFraction:sD,czm_linearToSrgb:aD,czm_lineDistance:cD,czm_luminance:lD,czm_metersPerPixel:uD,czm_modelToWindowCoordinates:fD,czm_multiplyWithColorBalance:dD,czm_nearFarScalar:mD,czm_octDecode:hD,czm_packDepth:pD,czm_pbrLighting:_D,czm_pbrMetallicRoughnessMaterial:gD,czm_pbrSpecularGlossinessMaterial:yD,czm_phong:AD,czm_planeDistance:xD,czm_pointAlongRay:CD,czm_rayEllipsoidIntersectionInterval:TD,czm_raySphereIntersectionInterval:ED,czm_readDepth:bD,czm_readNonPerspective:SD,czm_reverseLogDepth:vD,czm_RGBToHSB:wD,czm_RGBToHSL:DD,czm_RGBToXYZ:ID,czm_round:PD,czm_sampleOctahedralProjection:OD,czm_saturation:MD,czm_shadowDepthCompare:RD,czm_shadowVisibility:BD,czm_signNotZero:LD,czm_sphericalHarmonics:ND,czm_srgbToLinear:FD,czm_tangentToEyeSpaceMatrix:UD,czm_textureCube:VD,czm_transformPlane:kD,czm_translateRelativeToEye:zD,czm_translucentPhong:HD,czm_transpose:GD,czm_unpackDepth:WD,czm_unpackFloat:jD,czm_unpackUint:qD,czm_valueTransform:YD,czm_vertexLogDepth:XD,czm_windowToEyeCoordinates:KD,czm_writeDepthClamp:JD,czm_writeLogDepth:ZD,czm_writeNonPerspective:QD,czm_XYZToRGB:$D,czm_fromCartesian:eI,czm_getFloodRect:tI,czm_getIndexMat:nI,czm_getMaxIndex:iI,czm_getMaxIndexVal:rI,czm_isInEllipsoid:oI,czm_isInObliq:sI,czm_magnitude:aI,czm_magnitudeSquared:cI,czm_multiplyComponents:lI,czm_scaleToGeodeticSurface:uI};function Ibe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable -${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable -${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT"))):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var fI=Ibe;function xQ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` -`;return i})}function CQ(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return u(i)||(t=xQ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function TQ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);u(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&vs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=CQ(i,vs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),TQ(r,t)}}))}function Pbe(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function Obe(e){let t=[],n=CQ("main",e,t);TQ(n,t),Pbe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} -`;return i.replace(n.glslSource,"")}function EQ(e,t,n){let i,r,o="",s=e.sources;if(u(s))for(i=0,r=s.length;i<r;++i)o+=` -#line 0 -${s[i]}`;o=xQ(o);let a;o=o.replace(/#version\s+(.*?)\n/gm,function(A,x){return a=x,` -`});let c=[];o=o.replace(/#extension.*\n/gm,function(A){return c.push(A),` -`}),o=o.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let l=e.pickColorQualifier;u(l)&&(o=vs.createPickFragmentShaderSource(o,l));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp int; -#else - precision mediump float; - precision mediump int; - #define highp mediump -#endif - -`);let p=e.defines;if(u(p))for(i=0,r=p.length;i<r;++i){let A=p[i];A.length!==0&&(f+=`#define ${A} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear - -`),n.floatingPointTexture&&(f+=`#define OES_texture_float - -`);let g="";e.includeBuiltIns&&(g=Obe(o)),f+=` -#line 0 -`;let h=g+o;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(h)&&!/czm_out_FragColor/g.test(h)&&/out_FragColor/g.test(h)&&(f+=`layout(location = 0) out vec4 out_FragColor; - -`),f+=g,f+=o,n.webgl2?f=`#version 300 es -${f}`:f=fI(f,t),f}function vs(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=u(e.defines)?e.defines.slice(0):[],this.sources=u(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}vs.prototype.clone=function(){return new vs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};vs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};vs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(` -`);return`${t}:${n}:${i}:${r}`};vs.prototype.createCombinedVertexShader=function(e){return EQ(this,!1,e)};vs.prototype.createCombinedFragmentShader=function(e){return EQ(this,!0,e)};vs._czmBuiltinsAndUniforms={};for(let e in B0)B0.hasOwnProperty(e)&&(vs._czmBuiltinsAndUniforms[e]=B0[e]);for(let e in Yh)if(Yh.hasOwnProperty(e)){let t=Yh[e];typeof t.getDeclaration=="function"&&(vs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}vs.createPickVertexShaderSource=function(e){return`${vs.replaceMain(e,"czm_old_main")} -in vec4 pickColor; -out vec4 czm_pickColor; -void main() -{ - czm_old_main(); - czm_pickColor = pickColor; -}`};vs.createPickFragmentShaderSource=function(e,t){let n=vs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; -void main() -{ - czm_old_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = czm_pickColor; -}`;return`${n} -${i}`};function Mbe(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function bQ(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function SQ(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(bQ(e,r))return r}}var Rbe=["v_normalEC","v_normal"];vs.findNormalVarying=function(e){return bQ(e,"#ifdef HAS_NORMALS")?Mbe(e,"HAS_NORMALS")?"v_normalEC":void 0:SQ(e,Rbe)};var Bbe=["v_positionEC"];vs.findPositionVarying=function(e){return SQ(e,Bbe)};var ke=vs;function sd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(sd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});sd.prototype.replaceShaderProgram=function(e){return u(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function Lbe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}sd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new ke({sources:[t]})),typeof n=="string"&&(n=new ke({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=u(i)?Lbe(i):"",a=`${r}:${o}:${s}`,c;if(u(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let l=this._context,f=t.createCombinedVertexShader(l),d=n.createCombinedFragmentShader(l),p=new Kt({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};sd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(u(o)){o8(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};sd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(u(r))return r.shaderProgram};sd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new ke({sources:[o]})),typeof s=="string"&&(s=new ke({sources:[s]}));let c=this._context,l=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Kt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:l,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function o8(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];o8(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}sd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];o8(this,n),--this._numberOfShaders}this._shadersToRelease={}};sd.prototype.releaseShaderProgram=function(e){if(u(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};sd.prototype.isDestroyed=function(){return!1};sd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var dI=sd;function ad(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,r=e.source;u(r)&&(u(n)||(n=y(r.videoWidth,r.width)),u(i)||(i=y(r.videoHeight,r.height)));let o=y(e.pixelFormat,at.RGBA),s=y(e.pixelDatatype,Ke.UNSIGNED_BYTE),a=at.toInternalFormat(o,s,t),c=at.isCompressedFormat(a),l=e.preMultiplyAlpha||o===at.RGB||o===at.LUMINANCE,f=y(e.flipY,!0),d=y(e.skipColorSpaceConversion,!1),p=!0,g=t._gl,h=g.TEXTURE_2D,A=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,A);let x=4;if(u(r)&&u(r.arrayBufferView)&&!c&&(x=at.alignmentInBytes(o,s,n)),g.pixelStorei(g.UNPACK_ALIGNMENT,x),d?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),u(r))if(u(r.arrayBufferView)){g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1);let T=r.arrayBufferView,E,S,w;if(c){if(g.compressedTexImage2D(h,0,a,n,i,0,T),u(r.mipLevels))for(S=n,w=i,E=0;E<r.mipLevels.length;++E)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.compressedTexImage2D(h,E+1,a,S,w,0,r.mipLevels[E])}else if(f&&(T=at.flipY(T,o,s,n,i)),g.texImage2D(h,0,a,n,i,0,o,Ke.toWebGLConstant(s,t),T),u(r.mipLevels))for(S=n,w=i,E=0;E<r.mipLevels.length;++E)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.texImage2D(h,E+1,a,S,w,0,o,Ke.toWebGLConstant(s,t),r.mipLevels[E])}else u(r.framebuffer)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._bind(),g.copyTexImage2D(h,0,a,r.xOffset,r.yOffset,n,i,0),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._unBind()):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,f),g.texImage2D(h,0,a,o,Ke.toWebGLConstant(s,t),r));else g.texImage2D(h,0,a,n,i,0,o,Ke.toWebGLConstant(s,t),null),p=!1;g.bindTexture(h,null);let C;c?C=at.compressedTextureSizeInBytes(o,n,i):C=at.textureSizeInBytes(o,s,n,i),this._id=jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=A,this._internalFormat=a,this._pixelFormat=o,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new H(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=l,this._flipY=f,this._initialized=p,this._sampler=void 0,this.sampler=u(e.sampler)?e.sampler:new fn}ad.create=function(e){return new ad(e)};ad.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=y(e.pixelFormat,at.RGB),r=y(e.framebufferXOffset,0),o=y(e.framebufferYOffset,0),s=y(e.width,n.drawingBufferWidth),a=y(e.height,n.drawingBufferHeight),c=e.framebuffer;return new ad({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:u(c)?c:t.defaultFramebuffer,xOffset:r,yOffset:o,width:s,height:a}})};Object.defineProperties(ad.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,r=this._pixelFormat,o=this._pixelDatatype,s=t===cn.NEAREST_MIPMAP_NEAREST||t===cn.NEAREST_MIPMAP_LINEAR||t===cn.LINEAR_MIPMAP_NEAREST||t===cn.LINEAR_MIPMAP_LINEAR;(o===Ke.FLOAT&&!i.textureFloatLinear||o===Ke.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?cn.NEAREST_MIPMAP_NEAREST:cn.NEAREST,n=Ti.NEAREST),i.webgl2&&at.isDepthFormat(r)&&(t=cn.NEAREST,n=Ti.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),u(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});ad.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context,o=r._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture);let a=i.width,c=i.height,l=i.arrayBufferView,f=this._width,d=this._height,p=this._internalFormat,g=this._pixelFormat,h=this._pixelDatatype,A=this._preMultiplyAlpha,x=this._flipY,C=y(e.skipColorSpaceConversion,!1),T=4;u(l)&&(T=at.alignmentInBytes(g,h,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,T),C?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let E=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===d)u(l)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(l=at.flipY(l,g,h,f,d)),o.texImage2D(s,0,p,f,d,0,g,Ke.toWebGLConstant(h,r),l)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texImage2D(s,0,p,g,Ke.toWebGLConstant(h,r),i)),E=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let S=at.createTypedArray(g,h,f,d);o.texImage2D(s,0,p,f,d,0,g,Ke.toWebGLConstant(h,r),S)}this._initialized=!0}E||(u(l)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(l=at.flipY(l,g,h,a,c)),o.texSubImage2D(s,0,t,n,a,c,g,Ke.toWebGLConstant(h,r),l)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texSubImage2D(s,0,t,n,g,Ke.toWebGLConstant(h,r),i))),o.bindTexture(s,null)};ad.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._width),o=y(o,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};ad.prototype.generateMipmap=function(e){e=y(e,Fm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ad.prototype.isDestroyed=function(){return!1};ad.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Rt=ad;function L0(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(L0.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});L0.prototype.getTexture=function(e){let t=this._textures[e];if(u(t))return delete this._texturesToRelease[e],++t.count,t.texture};L0.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};L0.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};L0.prototype.isDestroyed=function(){return!1};L0.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var mI=L0;function Um(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}Um.encode=function(e,t){u(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var rp={high:0,low:0};Um.fromCartesian=function(e,t){u(t)||(t=new Um);let n=t.high,i=t.low;return Um.encode(e.x,rp),n.x=rp.high,i.x=rp.low,Um.encode(e.y,rp),n.y=rp.high,i.y=rp.low,Um.encode(e.z,rp),n.z=rp.high,i.z=rp.low,t};var s8=new Um;Um.writeElements=function(e,t,n){Um.fromCartesian(e,s8);let i=s8.high,r=s8.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var qn=Um;function ws(e,t){this.normal=m.clone(e),this.distance=t}ws.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return u(n)?(m.clone(t,n.normal),n.distance=i,n):new ws(t,i)};var Nbe=new m;ws.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,Nbe),i=e.w;return u(t)?(m.clone(n,t.normal),t.distance=i,t):new ws(n,i)};ws.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var Fbe=new m;ws.projectPointOntoPlane=function(e,t,n){u(n)||(n=new m);let i=ws.getPointDistance(e,t),r=m.multiplyByScalar(e.normal,i,Fbe);return m.subtract(t,r,n)};var Ube=new N,Vbe=new oe,kbe=new m;ws.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,Ube),s=oe.fromElements(i.x,i.y,i.z,r,Vbe);s=N.multiplyByVector(o,s,s);let a=m.fromCartesian4(s,kbe);return s=oe.divideByScalar(s,m.magnitude(a),s),ws.fromCartesian4(s,n)};ws.clone=function(e,t){return u(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new ws(e.normal,e.distance)};ws.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};ws.ORIGIN_XY_PLANE=Object.freeze(new ws(m.UNIT_Z,0));ws.ORIGIN_YZ_PLANE=Object.freeze(new ws(m.UNIT_X,0));ws.ORIGIN_ZX_PLANE=Object.freeze(new ws(m.UNIT_Y,0));var ln=ws;function Ku(e){this.planes=y(e,[])}var hI=[new m,new m,new m];m.clone(m.UNIT_X,hI[0]);m.clone(m.UNIT_Y,hI[1]);m.clone(m.UNIT_Z,hI[2]);var rg=new m,zbe=new m,vQ=new ln(new m(1,0,0),0);Ku.fromBoundingSphere=function(e,t){u(t)||(t=new Ku);let n=hI.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=hI[a],l=i[s],f=i[s+1];u(l)||(l=i[s]=new oe),u(f)||(f=i[s+1]=new oe),m.multiplyByScalar(c,-o,rg),m.add(r,rg,rg),l.x=c.x,l.y=c.y,l.z=c.z,l.w=-m.dot(c,rg),m.multiplyByScalar(c,o,rg),m.add(r,rg,rg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-m.dot(m.negate(c,zbe),rg),s+=2}return t};Ku.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(ln.fromCartesian4(t[i],vQ));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Ku.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Ku.MASK_OUTSIDE||t===Ku.MASK_INSIDE)return t;let n=Ku.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&!(t&s))continue;let a=e.intersectPlane(ln.fromCartesian4(i[r],vQ));if(a===$t.OUTSIDE)return Ku.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Ku.MASK_OUTSIDE=4294967295;Ku.MASK_INSIDE=0;Ku.MASK_INDETERMINATE=2147483647;var es=Ku;function Vm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new es,this._orthographicMatrix=new N}function wQ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Vm.prototype,{projectionMatrix:{get:function(){return wQ(this),this._orthographicMatrix}}});var Hbe=new m,Gbe=new m,Wbe=new m,a8=new m;Vm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,l=this.far,f=m.cross(t,n,Hbe);m.normalize(f,f);let d=Gbe;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=Wbe;m.multiplyByScalar(f,a,p),m.add(d,p,p);let g=i[0];return u(g)||(g=i[0]=new oe),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-m.dot(f,p),m.multiplyByScalar(f,s,p),m.add(d,p,p),g=i[1],u(g)||(g=i[1]=new oe),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-m.dot(m.negate(f,a8),p),m.multiplyByScalar(n,o,p),m.add(d,p,p),g=i[2],u(g)||(g=i[2]=new oe),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,r,p),m.add(d,p,p),g=i[3],u(g)||(g=i[3]=new oe),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,a8),p),g=i[4],u(g)||(g=i[4]=new oe),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,d),m.multiplyByScalar(t,l,p),m.add(e,p,p),g=i[5],u(g)||(g=i[5]=new oe),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,a8),p),this._cullingVolume};Vm.prototype.getPixelDimensions=function(e,t,n,i,r){wQ(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Vm.prototype.clone=function(e){return u(e)||(e=new Vm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Vm.prototype.equals=function(e){return u(e)&&e instanceof Vm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Vm.prototype.equalsEpsilon=function(e,t,n){return e===this||u(e)&&e instanceof Vm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var bo=Vm;function ll(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new bo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}ll.packedLength=4;ll.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};ll.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new ll),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function og(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(ll.prototype,{projectionMatrix:{get:function(){return og(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return og(this),this._offCenterFrustum}}});ll.prototype.computeCullingVolume=function(e,t,n){return og(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ll.prototype.getPixelDimensions=function(e,t,n,i,r){return og(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};ll.prototype.clone=function(e){return u(e)||(e=new ll),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};ll.prototype.equals=function(e){return!u(e)||!(e instanceof ll)?!1:(og(this),og(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ll.prototype.equalsEpsilon=function(e,t,n){return!u(e)||!(e instanceof ll)?!1:(og(this),og(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var tn=ll;var c8={};function jbe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var qbe=32.184,Ybe=2451545;function qQ(e,t){t=ee.addSeconds(e,qbe,t);let n=ee.totalDays(t)-Ybe;return t=ee.addSeconds(t,jbe(n),t),t}var oU=new ee(2451545,0,Zn.TAI),Xbe=1e3,Ju=P.RADIANS_PER_DEGREE,Kl=P.RADIANS_PER_ARCSECOND,ga=14959787e4,DQ=new Q;function YQ(e,t,n,i,r,o,s){n<0&&(n=-n,r+=P.PI);let a=e*(1-t),c=i-r,l=r,f=Jbe(o-i,t),d=Kbe(t,0);tSe(c,n,l,DQ);let p=a*(1+t),g=Math.cos(f),h=Math.sin(f),A=1+t*g,x=p/A;return u(s)?(s.x=x*g,s.y=x*h,s.z=0):s=new m(x*g,x*h,0),Q.multiplyByVector(DQ,s,s)}function Kbe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function Jbe(e,t){let n=$be(e,t);return eSe(n,t)}var Zbe=50,Qbe=P.EPSILON8;function $be(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<Zbe&&Math.abs(r-i)>Qbe;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function eSe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function tSe(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),l=Math.sin(n);return u(i)?(i[0]=c*r-l*o*s,i[1]=l*r+c*o*s,i[2]=o*a,i[3]=-c*o-l*r*s,i[4]=-l*o+c*r*s,i[5]=r*a,i[6]=l*a,i[7]=-c*a,i[8]=s):i=new Q(c*r-l*o*s,-c*o-l*r*s,l*a,l*r+c*o*s,-l*o+c*r*s,-c*a,o*a,r*a,s),i}var nSe=1.0000010178*ga,iSe=100.46645683*Ju,rSe=129597742283429e-5*Kl,IQ=16002,PQ=21863,OQ=32004,MQ=10931,RQ=14529,BQ=16368,LQ=15318,NQ=32794,oSe=64*1e-7*ga,sSe=-152*1e-7*ga,aSe=62*1e-7*ga,cSe=-8*1e-7*ga,lSe=32*1e-7*ga,uSe=-41*1e-7*ga,fSe=19*1e-7*ga,dSe=-11*1e-7*ga,mSe=-150*1e-7*ga,hSe=-46*1e-7*ga,pSe=68*1e-7*ga,_Se=54*1e-7*ga,gSe=14*1e-7*ga,ySe=24*1e-7*ga,ASe=-28*1e-7*ga,xSe=22*1e-7*ga,FQ=10,UQ=16002,VQ=21863,kQ=10931,zQ=1473,HQ=32004,GQ=4387,WQ=73,CSe=-325*1e-7,TSe=-322*1e-7,ESe=-79*1e-7,bSe=232*1e-7,SSe=-52*1e-7,vSe=97*1e-7,wSe=55*1e-7,DSe=-41*1e-7,ISe=-105*1e-7,PSe=-137*1e-7,OSe=258*1e-7,MSe=35*1e-7,RSe=-116*1e-7,BSe=-88*1e-7,LSe=-112*1e-7,NSe=-80*1e-7,uT=new ee(0,0,Zn.TAI);function FSe(e,t){qQ(e,uT);let i=(uT.dayNumber-oU.dayNumber+(uT.secondsOfDay-oU.secondsOfDay)/Qn.SECONDS_PER_DAY)/(Qn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=nSe+oSe*Math.cos(IQ*r)+mSe*Math.sin(IQ*r)+sSe*Math.cos(PQ*r)+hSe*Math.sin(PQ*r)+aSe*Math.cos(OQ*r)+pSe*Math.sin(OQ*r)+cSe*Math.cos(MQ*r)+_Se*Math.sin(MQ*r)+lSe*Math.cos(RQ*r)+gSe*Math.sin(RQ*r)+uSe*Math.cos(BQ*r)+ySe*Math.sin(BQ*r)+fSe*Math.cos(LQ*r)+ASe*Math.sin(LQ*r)+dSe*Math.cos(NQ*r)+xSe*Math.sin(NQ*r),s=iSe+rSe*i+CSe*Math.cos(FQ*r)+ISe*Math.sin(FQ*r)+TSe*Math.cos(UQ*r)+PSe*Math.sin(UQ*r)+ESe*Math.cos(VQ*r)+OSe*Math.sin(VQ*r)+bSe*Math.cos(kQ*r)+MSe*Math.sin(kQ*r)+SSe*Math.cos(zQ*r)+RSe*Math.sin(zQ*r)+vSe*Math.cos(HQ*r)+BSe*Math.sin(HQ*r)+wSe*Math.cos(GQ*r)+LSe*Math.sin(GQ*r)+DSe*Math.cos(WQ*r)+NSe*Math.sin(WQ*r),a=.0167086342-.0004203654*i,c=102.93734808*Ju+11612.3529*Kl*i,l=469.97289*Kl*i,f=174.87317577*Ju-8679.27034*Kl*i;return YQ(o,a,l,c,f,s,t)}function XQ(e,t){qQ(e,uT);let i=(uT.dayNumber-oU.dayNumber+(uT.secondsOfDay-oU.secondsOfDay)/Qn.SECONDS_PER_DAY)/Qn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,l=5.15668983*Ju,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Ju,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Ju,h=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,A=218.31664563*Ju,x=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,C=297.85019547*Ju+Kl*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),T=93.27209062*Ju+Kl*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),E=134.96340251*Ju+Kl*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),S=357.52910918*Ju+Kl*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),w=310.17137918*Ju-Kl*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),D=2*C,M=4*C,O=6*C,B=2*E,L=3*E,_=4*E,b=2*T;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-E)-235.6*Math.cos(E)+218.1*Math.cos(D-S)+181*Math.cos(D+E),c+=.014216*Math.cos(D-E)+.008551*Math.cos(D-B)-.001383*Math.cos(E)+.001356*Math.cos(D+E)-.001147*Math.cos(M-L)-914e-6*Math.cos(M-B)+869e-6*Math.cos(D-S-E)-627e-6*Math.cos(D)-394e-6*Math.cos(M-_)+282e-6*Math.cos(D-S-B)-279e-6*Math.cos(C-E)-236e-6*Math.cos(B)+231e-6*Math.cos(M)+229e-6*Math.cos(O-_)-201e-6*Math.cos(B-b),f+=486.26*Math.cos(D-b)-40.13*Math.cos(D)+37.51*Math.cos(b)+25.73*Math.cos(B-b)+19.97*Math.cos(D-S-b),p+=-55609*Math.sin(D-E)-34711*Math.sin(D-B)-9792*Math.sin(E)+9385*Math.sin(M-L)+7505*Math.sin(M-B)+5318*Math.sin(D+E)+3484*Math.sin(M-_)-3417*Math.sin(D-S-E)-2530*Math.sin(O-_)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(B)-1736*Math.sin(O-5*E)+1626*Math.sin(S)-1370*Math.sin(O-L),h+=-5392*Math.sin(D-b)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(b)-288*Math.sin(B-b),x+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(D-S);let v=2*w,I=3*w;f+=46.997*Math.cos(w)*i-.614*Math.cos(D-b+w)*i+.614*Math.cos(D-b-w)*i-.0297*Math.cos(v)*r-.0335*Math.cos(w)*r+.0012*Math.cos(D-b+v)*r-16e-5*Math.cos(w)*o+4e-5*Math.cos(I)*o+4e-5*Math.cos(v)*o;let R=2.116*Math.sin(w)*i-.111*Math.sin(D-b-w)*i-.0015*Math.sin(w)*r;p+=R,x+=R,h+=-520.77*Math.sin(w)*i+13.66*Math.sin(D-b+w)*i+1.12*Math.sin(D-w)*i-1.06*Math.sin(b-w)*i+.66*Math.sin(v)*r+.371*Math.sin(w)*r-.035*Math.sin(D-b+v)*r-.015*Math.sin(D-b+w)*r+.0014*Math.sin(w)*o-.0011*Math.sin(I)*o-9e-4*Math.sin(v)*o,a*=Xbe;let F=l+f*Kl,k=d+p*Kl,V=A+x*Kl,G=g+h*Kl;return YQ(a,c,F,k,G,V,t)}var jQ=.012300034,USe=jQ/(jQ+1)*-1;function VSe(e,t){return t=XQ(e,t),m.multiplyByScalar(t,USe,t)}var KQ=new Q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),pI=new m;c8.computeSunPositionInEarthInertialFrame=function(e,t){return u(e)||(e=ee.now()),u(t)||(t=new m),pI=FSe(e,pI),t=m.negate(pI,t),VSe(e,pI),m.subtract(t,pI,t),Q.multiplyByVector(KQ,t,t),t};c8.computeMoonPositionInEarthInertialFrame=function(e,t){return u(e)||(e=ee.now()),t=XQ(e,t),Q.multiplyByVector(KQ,t,t),t};var sg=c8;var sU={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};sU.getMorphTime=function(e){return e===sU.SCENE3D?1:e===sU.MORPHING?void 0:0};var ne=Object.freeze(sU);function kSe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var op=kSe;function fT(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ye,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=N.clone(N.IDENTITY),this._viewportTransformation=N.clone(N.IDENTITY),this._model=N.clone(N.IDENTITY),this._view=N.clone(N.IDENTITY),this._inverseView=N.clone(N.IDENTITY),this._projection=N.clone(N.IDENTITY),this._infiniteProjection=N.clone(N.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Q.clone(N.IDENTITY),this._view3DDirty=!0,this._view3D=new N,this._inverseView3DDirty=!0,this._inverseView3D=new N,this._inverseModelDirty=!0,this._inverseModel=new N,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Q,this._viewRotation=new Q,this._inverseViewRotation=new Q,this._viewRotation3D=new Q,this._inverseViewRotation3D=new Q,this._inverseProjectionDirty=!0,this._inverseProjection=new N,this._modelViewDirty=!0,this._modelView=new N,this._modelView3DDirty=!0,this._modelView3D=new N,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new N,this._inverseModelViewDirty=!0,this._inverseModelView=new N,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new N,this._viewProjectionDirty=!0,this._viewProjection=new N,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new N,this._modelViewProjectionDirty=!0,this._modelViewProjection=new N,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new N,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new N,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new N,this._normalDirty=!0,this._normal=new Q,this._normal3DDirty=!0,this._normal3D=new Q,this._inverseNormalDirty=!0,this._inverseNormal=new Q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new qn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(fT.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ye.equals(e,this._viewport)){Ye.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return JQ(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return JQ(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){N.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,N.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,N.getMatrix3(this.inverseModel,e),Q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return l8(this),this._view3D}},viewRotation:{get:function(){return l8(this),this._viewRotation}},viewRotation3D:{get:function(){return l8(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return $Q(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return $Q(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return JSe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ZSe(this),this._modelView}},modelView3D:{get:function(){return QSe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return rve(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return $Se(this),this._inverseModelView}},inverseModelView3D:{get:function(){return eve(this),this._inverseModelView3D}},viewProjection:{get:function(){return tve(this),this._viewProjection}},inverseViewProjection:{get:function(){return nve(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return ive(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return ove(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return sve(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return ave(this),this._modelViewInfiniteProjection}},normal:{get:function(){return cve(this),this._normal}},normal3D:{get:function(){return lve(this),this._normal3D}},inverseNormal:{get:function(){return uve(this),this._inverseNormal}},inverseNormal3D:{get:function(){return fve(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return QQ(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return QQ(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,re.WGS84)}}});function zSe(e,t){N.clone(t,e._view),N.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function HSe(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function GSe(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function WSe(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function jSe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;u(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var _I=new Q,qSe=new he;function YSe(e,t){u(Mt.computeIcrfToFixedMatrix(t.time,_I))||(_I=Mt.computeTemeToPseudoFixedMatrix(t.time,_I));let n=sg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Q.multiplyByVector(_I,n,n),m.normalize(n,e._sunDirectionWC),n=Q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=sg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Q.multiplyByVector(_I,n,n),Q.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,qSe);i.project(o,e._sunPositionColumbusView)}fT.prototype.updateCamera=function(e){zSe(this,e.viewMatrix),HSe(this,e.inverseViewMatrix),jSe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof tn};fT.prototype.updateFrustum=function(e){GSe(this,e.projectionMatrix),u(e.infiniteProjectionMatrix)&&WSe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;u(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};fT.prototype.updatePass=function(e){this._pass=e};var XSe=[],KSe=new op;fT.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),YSe(this,e);let n=y(e.light,KSe);n instanceof op?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=m.multiplyByScalar(r,n.intensity,r);let o=m.maximumComponent(r);o>1?m.divideByScalar(r,o,this._lightColor):m.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=u(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,XSe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,u(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,l=this._viewport,f;u(c)?l.height>l.width?f=Math.tan(.5*c)*2/l.height:f=Math.tan(.5*c)*2/l.width:f=1/Math.max(l.width,l.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function JQ(e){if(e._viewportDirty){let t=e._viewport;N.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),N.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function JSe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?N.inverse(e._projection,e._inverseProjection):N.clone(N.ZERO,e._inverseProjection))}function ZSe(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function QSe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function $Se(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function eve(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function tve(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function nve(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function ive(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function rve(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function ove(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function sve(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function ave(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function cve(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),Q.getRotation(t,t),Q.transpose(t,t)}}function lve(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),Q.getRotation(t,t),Q.transpose(t,t)}}function uve(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,N.getMatrix3(e.inverseModelView,e._inverseNormal),Q.getRotation(e._inverseNormal,e._inverseNormal))}function fve(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,N.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Q.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var ZQ=new m;function QQ(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,ZQ),qn.fromCartesian(ZQ,e._encodedCameraPositionMC))}var dve=new m,mve=new m,hve=new m,pve=new m,_ve=new he,gve=new m,yve=new N;function Ave(e,t,n,i,r,o,s,a){let c=dve;c.x=e.y,c.y=e.z,c.z=e.x;let l=mve;l.x=n.y,l.y=n.z,l.z=n.x;let f=hve;f.x=i.y,f.y=i.z,f.z=i.x;let d=pve;d.x=t.y,d.y=t.z,d.z=t.x,o===ne.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,_ve);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,gve),A=Mt.eastNorthUpToFixedFrame(h,g,yve);return N.multiplyByPointAsVector(A,l,l),N.multiplyByPointAsVector(A,f,f),N.multiplyByPointAsVector(A,d,d),u(a)||(a=new N),a[0]=l.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=l.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=l.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(l,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function l8(e){e._view3DDirty&&(e._mode===ne.SCENE3D?N.clone(e._view,e._view3D):Ave(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),N.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function $Q(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var gI=fT;function xve(e,t,n,i){let r=u(t.vertexBuffer),o=u(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(r)a.vertexAttrib=function(c){let l=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(l,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(l),this.instanceDivisor>0&&(i.glVertexAttribDivisor(l,this.instanceDivisor),i._vertexAttribDivisors[l]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function t$(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}u(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function sp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,l=!1,f=i.length;for(o=0;o<f;++o)xve(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(u(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),u(s[o].value)&&(l=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),t$(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=l,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function e$(e){return e.values.length/e.componentsPerAttribute}function Cve(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Tve(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&u(e[n])&&u(e[n].values)&&(r.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=e$(e[r[0]]),t=1;t<s;++t){let l=e$(e[r[t]]);if(l!==o)throw new de(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${l.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(l,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[l].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=Cve(i);if(a>0){let l=X.getSizeInBytes(e[r[0]].componentDatatype),f=a%l;f!==0&&(a+=l-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let h=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/h,strideInComponentType:a/h}}for(t=0;t<o;++t)for(let h=0;h<s;++h){n=r[h],i=e[n];let A=i.values,x=g[n],C=x.pointer,T=i.componentsPerAttribute;for(let E=0;E<T;++E)C[x.index+E]=A[t*T+E];x.index+=x.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}sp.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Ne.DYNAMIC_DRAW),r=y(e.attributeLocations,y.EMPTY_OBJECT),o=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,l,f=u(s)?s:[],d=n.attributes;if(o){let h=Tve(d);if(u(h)){l=mt.createVertexBuffer({context:t,typedArray:h.buffer,usage:i});let A=h.offsetsInBytes,x=h.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&u(d[a])&&(c=d[a],u(c.values)?f.push({index:r[a],vertexBuffer:l,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:A[a],strideInBytes:x}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&u(d[a])){c=d[a];let h=c.componentDatatype;h===X.DOUBLE&&(h=X.FLOAT),l=void 0,u(c.values)&&(l=mt.createVertexBuffer({context:t,typedArray:X.createTypedArray(h,c.values),usage:i})),f.push({index:r[a],vertexBuffer:l,value:c.value,componentDatatype:h,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return u(g)&&(dt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new sp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(sp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});sp.prototype.getAttribute=function(e){return this._attributes[e]};function Eve(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ht.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let l=c.instanceDivisor,f=c.index;l!==i[f]&&(t.glVertexAttribDivisor(f,l),i[f]=l)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function bve(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&u(o.value)&&o.vertexAttrib(t)}}sp.prototype._bind=function(){u(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&Eve(this),this._hasConstantAttributes&&bve(this,this._gl)):t$(this._gl,this._attributes,this._indexBuffer)};sp.prototype._unBind=function(){if(u(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;u(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return u(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),u(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var oi=sp;function Jl(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0}=y(t,{});r.alpha=y(r.alpha,!1),r.stencil=y(r.stencil,!0),r.powerPreference=y(r.powerPreference,"high-performance");let s=u(n)?n(e,r):Sve(e,r,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new dI(this),this._textureCache=new mI;let l=s;this._stencilBits=l.getParameter(l.STENCIL_BITS),Ht._maximumCombinedTextureImageUnits=l.getParameter(l.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ht._maximumCubeMapSize=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Ht._maximumFragmentUniformVectors=l.getParameter(l.MAX_FRAGMENT_UNIFORM_VECTORS),Ht._maximumTextureImageUnits=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Ht._maximumRenderbufferSize=l.getParameter(l.MAX_RENDERBUFFER_SIZE),Ht._maximumTextureSize=l.getParameter(l.MAX_TEXTURE_SIZE),Ht._maximumVaryingVectors=l.getParameter(l.MAX_VARYING_VECTORS),Ht._maximumVertexAttributes=l.getParameter(l.MAX_VERTEX_ATTRIBS),Ht._maximumVertexTextureImageUnits=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ht._maximumVertexUniformVectors=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),Ht._maximumSamples=this._webgl2?l.getParameter(l.MAX_SAMPLES):0;let f=l.getParameter(l.ALIASED_LINE_WIDTH_RANGE);Ht._minimumAliasedLineWidth=f[0],Ht._maximumAliasedLineWidth=f[1];let d=l.getParameter(l.ALIASED_POINT_SIZE_RANGE);Ht._minimumAliasedPointSize=d[0],Ht._maximumAliasedPointSize=d[1];let p=l.getParameter(l.MAX_VIEWPORT_DIMS);Ht._maximumViewportWidth=p[0],Ht._maximumViewportHeight=p[1];let g=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT);Ht._highpFloatSupported=g.precision!==0;let h=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_INT);Ht._highpIntSupported=h.rangeMax!==0,this._antialias=l.getContextAttributes().antialias,this._standardDerivatives=!!So(l,["OES_standard_derivatives"]),this._blendMinmax=!!So(l,["EXT_blend_minmax"]),this._elementIndexUint=!!So(l,["OES_element_index_uint"]),this._depthTexture=!!So(l,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!So(l,["EXT_frag_depth"]),this._debugShaders=So(l,["WEBGL_debug_shaders"]),this._textureFloat=!!So(l,["OES_texture_float"]),this._textureHalfFloat=!!So(l,["OES_texture_half_float"]),this._textureFloatLinear=!!So(l,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!So(l,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!So(l,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!So(l,["EXT_float_blend"]),this._colorBufferHalfFloat=!!So(l,["EXT_color_buffer_half_float"]),this._s3tc=!!So(l,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!So(l,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!So(l,["WEBGL_compressed_texture_astc"]),this._etc=!!So(l,["WEBG_compressed_texture_etc"]),this._etc1=!!So(l,["WEBGL_compressed_texture_etc1"]),this._bc7=!!So(l,["EXT_texture_compression_bptc"]),cl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?So(l,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Ht._maximumTextureFilterAnisotropy=u(A)?l.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,C,T,E,S,w,D,M,O,B;if(c){let v=this;x=function(){return v._gl.createVertexArray()},C=function(I){v._gl.bindVertexArray(I)},T=function(I){v._gl.deleteVertexArray(I)},E=function(I,R,F,k,V){l.drawElementsInstanced(I,R,F,k,V)},S=function(I,R,F,k){l.drawArraysInstanced(I,R,F,k)},w=function(I,R){l.vertexAttribDivisor(I,R)},D=function(I){l.drawBuffers(I)}}else M=So(l,["OES_vertex_array_object"]),u(M)&&(x=function(){return M.createVertexArrayOES()},C=function(v){M.bindVertexArrayOES(v)},T=function(v){M.deleteVertexArrayOES(v)}),O=So(l,["ANGLE_instanced_arrays"]),u(O)&&(E=function(v,I,R,F,k){O.drawElementsInstancedANGLE(v,I,R,F,k)},S=function(v,I,R,F){O.drawArraysInstancedANGLE(v,I,R,F)},w=function(v,I){O.vertexAttribDivisorANGLE(v,I)}),B=So(l,["WEBGL_draw_buffers"]),u(B)&&(D=function(v){B.drawBuffersWEBGL(v)});this.glCreateVertexArray=x,this.glBindVertexArray=C,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=w,this.glDrawBuffers=D,this._vertexArrayObject=!!M,this._instancedArrays=!!O,this._drawBuffers=!!B,Ht._maximumDrawBuffers=this.drawBuffers?l.getParameter(te.MAX_DRAW_BUFFERS):1,Ht._maximumColorAttachments=this.drawBuffers?l.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new gI,_=new Wa(this),b=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=b,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=b,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<Ht._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o},this.cache={},Ve.apply(l,b,_)}function Sve(e,t,n){if(typeof WebGLRenderingContext>"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!u(o))throw new de("The browser supports WebGL, but initialization failed.");return o}function vve(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function wve(e,t,n,i){let r=`${vve(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function Dve(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new de(wve(e,t,n,i))}function Ive(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function Pve(e,t){if(!u(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,Ive(e,r,t))}return i}function So(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var Ove={};Object.defineProperties(Jl.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Pve(this._originalGLContext,e?Dve:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Rt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ga({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Ove}}});function n$(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,r,t,o,n,i)}var u8;typeof WebGLRenderingContext<"u"&&(u8=[te.BACK]);function f8(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=u8;if(u(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Mve=new ri;Jl.prototype.clear=function(e,t){e=y(e,Mve),t=y(t,this._defaultPassState);let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;u(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),u(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),u(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);n$(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);f8(this,c),n.clear(i)};function Rve(e,t,n,i,r){f8(e,t),n$(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Bve(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,N.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let l=o.indexBuffer;u(l)?(s=s*l.bytesPerIndex,a=y(a,l.numberOfIndices),c===0?e._gl.drawElements(r,a,l.indexDatatype,s):e.glDrawElementsInstanced(r,a,l.indexDatatype,s,c)):(a=y(a,o.numberOfVertices),c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Jl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let r=y(e._framebuffer,t.framebuffer),o=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),Rve(this,r,t,n,o),Bve(this,e,n,i)};Jl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=u8;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Jl.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),r=y(e.width,t.drawingBufferWidth),o=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Ke.UNSIGNED_BYTE;u(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=at.createTypedArray(at.RGBA,a,r,o);return f8(this,s),t.readPixels(n,i,r,o,at.RGBA,Ke.toWebGLConstant(a,this),c),c};var i$={position:0,textureCoordinates:1};Jl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!u(e)){let t=new dt({attributes:{position:new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Be.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:i$,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Jl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new et({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Be.TRIANGLES,renderState:t.renderState,shaderProgram:Kt.fromCache({context:this,vertexShaderSource:T0,fragmentShaderSource:e,attributeLocations:i$}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Jl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function d8(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(d8.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});d8.prototype.destroy=function(){delete this._pickObjects[this.key]};Jl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new d8(this._pickObjects,t,z.fromRgba(t))};Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];u(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Jl._deprecationWarning=$;var yI=Jl;function dT(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let r=e.colorRenderbuffers,o=e.colorTextures;if(u(r)!==u(o))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(u(s)!==u(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Ys({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new Ys({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}dT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};dT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};dT.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),u(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var AI=dT;var ul={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===ul.RGBA4||e===ul.RGBA8||e===ul.RGBA16F||e===ul.RGBA32F||e===ul.RGB5_A1||e===ul.RGB565||e===ul.DEPTH_COMPONENT16||e===ul.STENCIL_INDEX8||e===ul.DEPTH_STENCIL||e===ul.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?ul.RGBA32F:e===te.HALF_FLOAT_OES?ul.RGBA16F:ul.RGBA8}},bc=Object.freeze(ul);function xI(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ht.maximumRenderbufferSize,r=y(e.format,bc.RGBA4),o=u(e.width)?e.width:n.drawingBufferWidth,s=u(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(xI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});xI.prototype._getRenderbuffer=function(){return this._renderbuffer};xI.prototype.isDestroyed=function(){return!1};xI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Zl=xI;function ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});ss.prototype.isDirty=function(e,t,n,i,r){n=y(n,1);let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=u(i)&&this._pixelDatatype!==i||u(r)&&this._pixelFormat!==r,c=n===1?u(this._framebuffer):u(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!u(this._colorTextures[0])};ss.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?y(i,1):1,r=y(r,this._color?y(this._pixelDatatype,Ke.UNSIGNED_BYTE):void 0),o=y(o,this._color?y(this._pixelFormat,at.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Rt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:fn.NEAREST}),this._numSamples>1){let a=bc.getColorFormat(r);this._colorRenderbuffers[s]=new Zl({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:fn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Zl({context:e,width:t,height:n,format:bc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Zl({context:e,width:t,height:n,format:bc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:at.DEPTH_COMPONENT,pixelDatatype:Ke.UNSIGNED_INT,sampler:fn.NEAREST}):this._depthRenderbuffer=new Zl({context:e,width:t,height:n,format:bc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new AI({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Ys({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ss.prototype.getDepthTexture=function(){return this._depthTexture};ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ss.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&u(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),u(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&u(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),u(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),u(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),u(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),u(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),u(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var mi=ss;function Lve(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[we.createIfNeeded(t.positiveX).fetchImage(i),we.createIfNeeded(t.negativeX).fetchImage(i),we.createIfNeeded(t.positiveY).fetchImage(i),we.createIfNeeded(t.negativeY).fetchImage(i),we.createIfNeeded(t.positiveZ).fetchImage(i),we.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new Ga({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var CI=Lve;var N0={VERTEX:0,FRAGMENT:1,BOTH:2};N0.includesVertexShader=function(e){return e===N0.VERTEX||e===N0.BOTH};N0.includesFragmentShader=function(e){return e===N0.FRAGMENT||e===N0.BOTH};var be=Object.freeze(N0);function m8(e){this.name=e,this.fields=[]}m8.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};m8.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var TI=m8;function h8(e){this.signature=e,this.body=[]}h8.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};h8.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var EI=h8;function Sc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Sc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sc.prototype.addDefine=function(e,t,n){n=y(n,be.BOTH);let i=e;u(t)&&(i+=` ${t.toString()}`),be.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sc.prototype.addStruct=function(e,t,n){this._structs[e]=new TI(t),be.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Sc.prototype.addFunction=function(e,t,n){this._functions[e]=new EI(t),be.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Sc.prototype.addUniform=function(e,t,n){n=y(n,be.BOTH);let i=`uniform ${e} ${t};`;be.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=Fve(e),i};Sc.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};Sc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.buildShaderProgram=function(e){let t=u(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=Nve(this),i=Uve(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),o=new ke({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new ke({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Kt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sc.prototype.clone=function(){return We(this,!0)};function Nve(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function Fve(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Uve(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var F0=Sc;function Ds(e,t,n,i){let r=Ds._verifyAttributes(t);n=y(n,0);let o=[],s={},a,c,l=r.length;for(let d=0;d<l;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],u(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Ds._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ds._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ds._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:y(r.index,i),enabled:y(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:y(r.componentDatatype,X.FLOAT),normalize:y(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:y(r.usage,Ne.STATIC_DRAW)};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Ds._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Ds._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Ds.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Ds._resize(r,this._size),Ds._appendWriters(this.writers,r)}p8(this)};Ds._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(u(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var Vve=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ds._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=Vve[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ds.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=kve(this,i)||t;if(t||!u(this.va)){p8(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=u(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let l=0;l<c;++l){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=l*(i.vertexSizeInBytes*a);Ds._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new oi({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(l!==c-1?a:this._size%a)})}}};function kve(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=u(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=mt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ds._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ds.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)zve(n[i],e,t)};function zve(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Ds.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function p8(e){let t=e.va;if(!u(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return p8(this),ue(this)};var ap=Ds;function ag(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(ag.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});ag.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};ag.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=u(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};ag.prototype.equals=function(e){return this===e||e instanceof ag&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};ag.prototype.valueOf=function(){return this._value};ag.prototype.toString=function(){return String(this._value)};var ei=ag;function Hve(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];u(a)&&(a(),this[n]=void 0),o!==void 0&&(!u(o)||!u(o.getValue))&&u(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),u(o)&&u(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function Gve(e){return new ei(e)}function Wve(e,t,n){return Hve(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,Gve))}var le=Wve;function bI(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});bI.prototype.clone=function(e){return u(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new bI(this)};bI.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var ja=bI;function U0(){this._array=[],this._hash={}}Object.defineProperties(U0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});U0.prototype.contains=function(e){return u(this._hash[e])};U0.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};U0.prototype.get=function(e){return this._hash[e]};U0.prototype.remove=function(e){let t=this._hash[e],n=u(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};U0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Tt=U0;function Ql(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Ql.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Ql.packedLength=2;Ql.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Ql.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Ql),n.near=e[t++],n.far=e[t],n};Ql.equals=function(e,t){return e===t||u(e)&&u(t)&&e.near===t.near&&e.far===t.far};Ql.clone=function(e,t){if(u(e))return u(t)||(t=new Ql),t.near=e.near,t.far=e.far,t};Ql.prototype.clone=function(e){return Ql.clone(this,e)};Ql.prototype.equals=function(e){return Ql.equals(this,e)};var wt=Ql;function Zu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Zu.clone=function(e,t){if(u(e))return u(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Zu(e.near,e.nearValue,e.far,e.farValue)};Zu.packedLength=4;Zu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Zu.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Zu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Zu.equals=function(e,t){return e===t||u(e)&&u(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Zu.prototype.clone=function(e){return Zu.clone(this,e)};Zu.prototype.equals=function(e){return Zu.equals(this,e)};var Bt=Zu;var jve={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},je=Object.freeze(jve);var qve={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(qve);var Yve={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},On=Object.freeze(Yve);var Xve={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(Xve);function cd(){fe.throwInstantiationError()}Object.defineProperties(cd.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});cd.prototype.getValue=fe.throwInstantiationError;cd.prototype.equals=fe.throwInstantiationError;cd.equals=function(e,t){return e===t||u(e)&&e.equals(t)};cd.arrayEquals=function(e,t){if(e===t)return!0;if(!u(e)||!u(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!cd.equals(e[i],t[i]))return!1;return!0};cd.isConstant=function(e){return!u(e)||e.isConstant};cd.getValueOrUndefined=function(e,t,n){return u(e)?e.getValue(t,n):void 0};cd.getValueOrDefault=function(e,t,n,i){return u(e)?y(e.getValue(t,i),n):n};cd.getValueOrClonedDefault=function(e,t,n,i){let r;return u(e)&&(r=e.getValue(t,i)),u(r)||(r=n.clone(r)),r};var q=cd;var Kve=z.WHITE,Jve=m.ZERO,Zve=je.NONE,Qve=H.ZERO,$ve=1,ewe=0,twe=m.ZERO,nwe=gi.CENTER,iwe=On.CENTER,rwe=!1,owe=new m,swe=new z,awe=new m,cwe=new H,lwe=new Bt,uwe=new Bt,fwe=new Bt,dwe=new Ye,mwe=new wt;function r$(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function cg(e,t){t.collectionChanged.addEventListener(cg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}cg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,l=o.billboard,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,owe),c=q.getValueOrUndefined(a._image,e),f=u(d)&&u(c)),!f){_8(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0),u(l)||(l=n.getBillboard(s),l.id=s,l.image=void 0,o.billboard=l),l.show=f,(!u(l.image)||o.textureValue!==c)&&(l.image=c,o.textureValue=c),l.position=d,l.color=q.getValueOrDefault(a._color,e,Kve,swe),l.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,Jve,awe),l.heightReference=q.getValueOrDefault(a._heightReference,e,Zve),l.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,Qve,cwe),l.scale=q.getValueOrDefault(a._scale,e,$ve),l.rotation=q.getValueOrDefault(a._rotation,e,ewe),l.alignedAxis=q.getValueOrDefault(a._alignedAxis,e,twe),l.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,nwe),l.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,iwe),l.width=q.getValueOrUndefined(a._width,e),l.height=q.getValueOrUndefined(a._height,e),l.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,lwe),l.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,uwe),l.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,fwe),l.sizeInMeters=q.getValueOrDefault(a._sizeInMeters,e,rwe),l.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,mwe),l.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e);let p=q.getValueOrUndefined(a._imageSubRegion,e,dwe);u(p)&&l.setImageSubRegion(l._imageId,p)}return!0};cg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!u(n)||!u(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===je.NONE)t.center=m.clone(i.position,t.center);else{if(!u(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};cg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],u(o._billboard)&&u(o._position)&&s.set(o.id,new r$(o));for(r=i.length-1;r>-1;r--)o=i[r],u(o._billboard)&&u(o._position)?s.contains(o.id)||s.set(o.id,new r$(o)):(_8(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],_8(s.get(o.id),o,a),s.remove(o.id)};function _8(e,t,n){u(e)&&(e.billboard=void 0,n.removeBillboard(t))}var SI=cg;function hwe(e,t){this.start=y(e,0),this.stop=y(t,0)}var vc=hwe;function pn(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var A8=new m,x8=new m,C8=new m,T8=new m,E8=new m,b8=new m,S8=new m,Ks=new m,v8=new m,w8=new m,D8=new m,I8=new m,pwe=4/3*P.PI;pn.fromPoints=function(e,t){if(u(t)||(t=new pn),!u(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],S8),i=m.clone(n,A8),r=m.clone(n,x8),o=m.clone(n,C8),s=m.clone(n,T8),a=m.clone(n,E8),c=m.clone(n,b8),l=e.length,f;for(f=1;f<l;f++){m.clone(e[f],n);let O=n.x,B=n.y,L=n.z;O<i.x&&m.clone(n,i),O>s.x&&m.clone(n,s),B<r.y&&m.clone(n,r),B>a.y&&m.clone(n,a),L<o.z&&m.clone(n,o),L>c.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,Ks)),p=m.magnitudeSquared(m.subtract(a,r,Ks)),g=m.magnitudeSquared(m.subtract(c,o,Ks)),h=i,A=s,x=d;p>x&&(x=p,h=r,A=a),g>x&&(x=g,h=o,A=c);let C=v8;C.x=(h.x+A.x)*.5,C.y=(h.y+A.y)*.5,C.z=(h.z+A.z)*.5;let T=m.magnitudeSquared(m.subtract(A,C,Ks)),E=Math.sqrt(T),S=w8;S.x=i.x,S.y=r.y,S.z=o.z;let w=D8;w.x=s.x,w.y=a.y,w.z=c.z;let D=m.midpoint(S,w,I8),M=0;for(f=0;f<l;f++){m.clone(e[f],n);let O=m.magnitude(m.subtract(n,D,Ks));O>M&&(M=O);let B=m.magnitudeSquared(m.subtract(n,C,Ks));if(B>T){let L=Math.sqrt(B);E=(E+L)*.5,T=E*E;let _=L-E;C.x=(E*C.x+_*n.x)/L,C.y=(E*C.y+_*n.y)/L,C.z=(E*C.z+_*n.z)/L}}return E<M?(m.clone(C,t.center),t.radius=E):(m.clone(D,t.center),t.radius=M),t};var _we=new Ii,gwe=new m,ywe=new m,g8=new he,y8=new he;pn.fromRectangle2D=function(e,t,n){return pn.fromRectangleWithHeights2D(e,t,0,0,n)};pn.fromRectangleWithHeights2D=function(e,t,n,i,r){if(u(r)||(r=new pn),!u(e))return r.center=m.clone(m.ZERO,r.center),r.radius=0,r;t=y(t,_we),ce.southwest(e,g8),g8.height=n,ce.northeast(e,y8),y8.height=i;let o=t.project(g8,gwe),s=t.project(y8,ywe),a=s.x-o.x,c=s.y-o.y,l=s.z-o.z;r.radius=Math.sqrt(a*a+c*c+l*l)*.5;let f=r.center;return f.x=o.x+a*.5,f.y=o.y+c*.5,f.z=o.z+l*.5,r};var Awe=[];pn.fromRectangle3D=function(e,t,n,i){if(t=y(t,re.WGS84),n=y(n,0),u(i)||(i=new pn),!u(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let r=ce.subsample(e,t,n,Awe);return pn.fromPoints(r,i)};pn.fromVertices=function(e,t,n,i){if(u(i)||(i=new pn),!u(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=y(t,m.ZERO),n=y(n,3);let r=S8;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let o=m.clone(r,A8),s=m.clone(r,x8),a=m.clone(r,C8),c=m.clone(r,T8),l=m.clone(r,E8),f=m.clone(r,b8),d=e.length,p;for(p=0;p<d;p+=n){let L=e[p]+t.x,_=e[p+1]+t.y,b=e[p+2]+t.z;r.x=L,r.y=_,r.z=b,L<o.x&&m.clone(r,o),L>c.x&&m.clone(r,c),_<s.y&&m.clone(r,s),_>l.y&&m.clone(r,l),b<a.z&&m.clone(r,a),b>f.z&&m.clone(r,f)}let g=m.magnitudeSquared(m.subtract(c,o,Ks)),h=m.magnitudeSquared(m.subtract(l,s,Ks)),A=m.magnitudeSquared(m.subtract(f,a,Ks)),x=o,C=c,T=g;h>T&&(T=h,x=s,C=l),A>T&&(T=A,x=a,C=f);let E=v8;E.x=(x.x+C.x)*.5,E.y=(x.y+C.y)*.5,E.z=(x.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,E,Ks)),w=Math.sqrt(S),D=w8;D.x=o.x,D.y=s.y,D.z=a.z;let M=D8;M.x=c.x,M.y=l.y,M.z=f.z;let O=m.midpoint(D,M,I8),B=0;for(p=0;p<d;p+=n){r.x=e[p]+t.x,r.y=e[p+1]+t.y,r.z=e[p+2]+t.z;let L=m.magnitude(m.subtract(r,O,Ks));L>B&&(B=L);let _=m.magnitudeSquared(m.subtract(r,E,Ks));if(_>S){let b=Math.sqrt(_);w=(w+b)*.5,S=w*w;let v=b-w;E.x=(w*E.x+v*r.x)/b,E.y=(w*E.y+v*r.y)/b,E.z=(w*E.z+v*r.z)/b}}return w<B?(m.clone(E,i.center),i.radius=w):(m.clone(O,i.center),i.radius=B),i};pn.fromEncodedCartesianVertices=function(e,t,n){if(u(n)||(n=new pn),!u(e)||!u(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=S8;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let r=m.clone(i,A8),o=m.clone(i,x8),s=m.clone(i,C8),a=m.clone(i,T8),c=m.clone(i,E8),l=m.clone(i,b8),f=e.length,d;for(d=0;d<f;d+=3){let B=e[d]+t[d],L=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=B,i.y=L,i.z=_,B<r.x&&m.clone(i,r),B>a.x&&m.clone(i,a),L<o.y&&m.clone(i,o),L>c.y&&m.clone(i,c),_<s.z&&m.clone(i,s),_>l.z&&m.clone(i,l)}let p=m.magnitudeSquared(m.subtract(a,r,Ks)),g=m.magnitudeSquared(m.subtract(c,o,Ks)),h=m.magnitudeSquared(m.subtract(l,s,Ks)),A=r,x=a,C=p;g>C&&(C=g,A=o,x=c),h>C&&(C=h,A=s,x=l);let T=v8;T.x=(A.x+x.x)*.5,T.y=(A.y+x.y)*.5,T.z=(A.z+x.z)*.5;let E=m.magnitudeSquared(m.subtract(x,T,Ks)),S=Math.sqrt(E),w=w8;w.x=r.x,w.y=o.y,w.z=s.z;let D=D8;D.x=a.x,D.y=c.y,D.z=l.z;let M=m.midpoint(w,D,I8),O=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let B=m.magnitude(m.subtract(i,M,Ks));B>O&&(O=B);let L=m.magnitudeSquared(m.subtract(i,T,Ks));if(L>E){let _=Math.sqrt(L);S=(S+_)*.5,E=S*S;let b=_-S;T.x=(S*T.x+b*i.x)/_,T.y=(S*T.y+b*i.y)/_,T.z=(S*T.z+b*i.z)/_}}return S<O?(m.clone(T,n.center),n.radius=S):(m.clone(M,n.center),n.radius=O),n};pn.fromCornerPoints=function(e,t,n){u(n)||(n=new pn);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};pn.fromEllipsoid=function(e,t){return u(t)||(t=new pn),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var xwe=new m;pn.fromBoundingSpheres=function(e,t){if(u(t)||(t=new pn),!u(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return pn.clone(e[0],t);if(n===2)return pn.union(e[0],e[1],t);let i=[],r;for(r=0;r<n;r++)i.push(e[r].center);t=pn.fromPoints(i,t);let o=t.center,s=t.radius;for(r=0;r<n;r++){let a=e[r];s=Math.max(s,m.distance(o,a.center,xwe)+a.radius)}return t.radius=s,t};var Cwe=new m,Twe=new m,Ewe=new m;pn.fromOrientedBoundingBox=function(e,t){u(t)||(t=new pn);let n=e.halfAxes,i=Q.getColumn(n,0,Cwe),r=Q.getColumn(n,1,Twe),o=Q.getColumn(n,2,Ewe);return m.add(i,r,i),m.add(i,o,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var bwe=new m,Swe=new m;pn.fromTransformation=function(e,t){u(t)||(t=new pn);let n=N.getTranslation(e,bwe),i=N.getScale(e,Swe),r=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=r,t};pn.clone=function(e,t){if(u(e))return u(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new pn(e.center,e.radius)};pn.packedLength=4;pn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};pn.unpack=function(e,t,n){t=y(t,0),u(n)||(n=new pn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var vwe=new m,wwe=new m;pn.union=function(e,t,n){u(n)||(n=new pn);let i=e.center,r=e.radius,o=t.center,s=t.radius,a=m.subtract(o,i,vwe),c=m.magnitude(a);if(r>=c+s)return e.clone(n),n;if(s>=c+r)return t.clone(n),n;let l=(r+c+s)*.5,f=m.multiplyByScalar(a,(-r+l)/c,wwe);return m.add(f,i,f),m.clone(f,n.center),n.radius=l,n};var Dwe=new m;pn.expand=function(e,t,n){n=pn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,Dwe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){let n=e.center,i=e.radius,r=t.normal,o=m.dot(r,n)+t.distance;return o<-i?$t.OUTSIDE:o<i?$t.INTERSECTING:$t.INSIDE};pn.transform=function(e,t,n){return u(n)||(n=new pn),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=N.getMaximumScale(t)*e.radius,n};var Iwe=new m;pn.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,Iwe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};pn.transformWithoutScale=function(e,t,n){return u(n)||(n=new pn),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var Pwe=new m;pn.computePlaneDistances=function(e,t,n,i){u(i)||(i=new vc);let r=m.subtract(e.center,t,Pwe),o=m.dot(n,r);return i.start=o-e.radius,i.stop=o+e.radius,i};var o$=new m,Owe=new m,Mwe=new m,Rwe=new m,Bwe=new m,Lwe=new he,s$=new Array(8);for(let e=0;e<8;++e)s$[e]=new m;var Nwe=new Ii;pn.projectTo2D=function(e,t,n){t=y(t,Nwe);let i=t.ellipsoid,r=e.center,o=e.radius,s;m.equals(r,m.ZERO)?s=m.clone(m.UNIT_X,o$):s=i.geodeticSurfaceNormal(r,o$);let a=m.cross(m.UNIT_Z,s,Owe);m.normalize(a,a);let c=m.cross(s,a,Mwe);m.normalize(c,c),m.multiplyByScalar(s,o,s),m.multiplyByScalar(c,o,c),m.multiplyByScalar(a,o,a);let l=m.negate(c,Bwe),f=m.negate(a,Rwe),d=s$,p=d[0];m.add(s,c,p),m.add(p,a,p),p=d[1],m.add(s,c,p),m.add(p,f,p),p=d[2],m.add(s,l,p),m.add(p,f,p),p=d[3],m.add(s,l,p),m.add(p,a,p),m.negate(s,s),p=d[4],m.add(s,c,p),m.add(p,a,p),p=d[5],m.add(s,c,p),m.add(p,f,p),p=d[6],m.add(s,l,p),m.add(p,f,p),p=d[7],m.add(s,l,p),m.add(p,a,p);let g=d.length;for(let C=0;C<g;++C){let T=d[C];m.add(r,T,T);let E=i.cartesianToCartographic(T,Lwe);t.project(E,T)}n=pn.fromPoints(d,n),r=n.center;let h=r.x,A=r.y,x=r.z;return r.x=x,r.y=h,r.z=A,n};pn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};pn.equals=function(e,t){return e===t||u(e)&&u(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};pn.prototype.intersectPlane=function(e){return pn.intersectPlane(this,e)};pn.prototype.distanceSquaredTo=function(e){return pn.distanceSquaredTo(this,e)};pn.prototype.computePlaneDistances=function(e,t,n){return pn.computePlaneDistances(this,e,t,n)};pn.prototype.isOccluded=function(e){return pn.isOccluded(this,e)};pn.prototype.equals=function(e){return pn.equals(this,e)};pn.prototype.clone=function(e){return pn.clone(this,e)};pn.prototype.volume=function(){let e=this.radius;return pwe*e*e*e};var ae=pn;function Fwe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var mn=Fwe;var Uwe={NONE:0,TOP:1,ALL:2},on=Object.freeze(Uwe);function ts(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ts.POSITION_ONLY=Object.freeze(new ts({position:!0}));ts.POSITION_AND_NORMAL=Object.freeze(new ts({position:!0,normal:!0}));ts.POSITION_NORMAL_AND_ST=Object.freeze(new ts({position:!0,normal:!0,st:!0}));ts.POSITION_AND_ST=Object.freeze(new ts({position:!0,st:!0}));ts.POSITION_AND_COLOR=Object.freeze(new ts({position:!0,color:!0}));ts.ALL=Object.freeze(new ts({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ts.DEFAULT=ts.POSITION_NORMAL_AND_ST;ts.packedLength=6;ts.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ts.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new ts),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ts.clone=function(e,t){if(u(e))return u(t)||(t=new ts),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Pe=ts;var Vwe=new m;function $l(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Pe.DEFAULT);this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}$l.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new $l({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};$l.fromAxisAlignedBoundingBox=function(e){return new $l({minimum:e.minimum,maximum:e.maximum})};$l.packedLength=2*m.packedLength+Pe.packedLength+1;$l.pack=function(e,t,n){return n=y(n,0),m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Pe.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Pe.packedLength]=y(e._offsetAttribute,-1),t};var c$=new m,l$=new m,u$=new Pe,a$={minimum:c$,maximum:l$,vertexFormat:u$,offsetAttribute:void 0};$l.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,c$),r=m.unpack(e,t+m.packedLength,l$),o=Pe.unpack(e,t+2*m.packedLength,u$),s=e[t+2*m.packedLength+Pe.packedLength];return u(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(r,n._maximum),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(a$.offsetAttribute=s===-1?void 0:s,new $l(a$))};$l.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let r=new mn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let l=new Float32Array(72);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=1,l[9]=0,l[10]=0,l[11]=1,l[12]=0,l[13]=0,l[14]=-1,l[15]=0,l[16]=0,l[17]=-1,l[18]=0,l[19]=0,l[20]=-1,l[21]=0,l[22]=0,l[23]=-1,l[24]=1,l[25]=0,l[26]=0,l[27]=1,l[28]=0,l[29]=0,l[30]=1,l[31]=0,l[32]=0,l[33]=1,l[34]=0,l[35]=0,l[36]=-1,l[37]=0,l[38]=0,l[39]=-1,l[40]=0,l[41]=0,l[42]=-1,l[43]=0,l[44]=0,l[45]=-1,l[46]=0,l[47]=0,l[48]=0,l[49]=1,l[50]=0,l[51]=0,l[52]=1,l[53]=0,l[54]=0,l[55]=1,l[56]=0,l[57]=0,l[58]=1,l[59]=0,l[60]=0,l[61]=-1,l[62]=0,l[63]=0,l[64]=-1,l[65]=0,l[66]=0,l[67]=-1,l[68]=0,l[69]=0,l[70]=-1,l[71]=0,r.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:l})}if(i.st){let l=new Float32Array(48);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=1,l[5]=1,l[6]=0,l[7]=1,l[8]=1,l[9]=0,l[10]=0,l[11]=0,l[12]=0,l[13]=1,l[14]=1,l[15]=1,l[16]=0,l[17]=0,l[18]=1,l[19]=0,l[20]=1,l[21]=1,l[22]=0,l[23]=1,l[24]=1,l[25]=0,l[26]=0,l[27]=0,l[28]=0,l[29]=1,l[30]=1,l[31]=1,l[32]=1,l[33]=0,l[34]=0,l[35]=0,l[36]=0,l[37]=1,l[38]=1,l[39]=1,l[40]=0,l[41]=0,l[42]=1,l[43]=0,l[44]=1,l[45]=1,l[46]=0,l[47]=1,r.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:l})}if(i.tangent){let l=new Float32Array(72);l[0]=1,l[1]=0,l[2]=0,l[3]=1,l[4]=0,l[5]=0,l[6]=1,l[7]=0,l[8]=0,l[9]=1,l[10]=0,l[11]=0,l[12]=-1,l[13]=0,l[14]=0,l[15]=-1,l[16]=0,l[17]=0,l[18]=-1,l[19]=0,l[20]=0,l[21]=-1,l[22]=0,l[23]=0,l[24]=0,l[25]=1,l[26]=0,l[27]=0,l[28]=1,l[29]=0,l[30]=0,l[31]=1,l[32]=0,l[33]=0,l[34]=1,l[35]=0,l[36]=0,l[37]=-1,l[38]=0,l[39]=0,l[40]=-1,l[41]=0,l[42]=0,l[43]=-1,l[44]=0,l[45]=0,l[46]=-1,l[47]=0,l[48]=-1,l[49]=0,l[50]=0,l[51]=-1,l[52]=0,l[53]=0,l[54]=-1,l[55]=0,l[56]=0,l[57]=-1,l[58]=0,l[59]=0,l[60]=1,l[61]=0,l[62]=0,l[63]=1,l[64]=0,l[65]=0,l[66]=1,l[67]=0,l[68]=0,l[69]=1,l[70]=0,l[71]=0,r.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:l})}if(i.bitangent){let l=new Float32Array(72);l[0]=0,l[1]=1,l[2]=0,l[3]=0,l[4]=1,l[5]=0,l[6]=0,l[7]=1,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=1,l[14]=0,l[15]=0,l[16]=1,l[17]=0,l[18]=0,l[19]=1,l[20]=0,l[21]=0,l[22]=1,l[23]=0,l[24]=0,l[25]=0,l[26]=1,l[27]=0,l[28]=0,l[29]=1,l[30]=0,l[31]=0,l[32]=1,l[33]=0,l[34]=0,l[35]=1,l[36]=0,l[37]=0,l[38]=1,l[39]=0,l[40]=0,l[41]=1,l[42]=0,l[43]=0,l[44]=1,l[45]=0,l[46]=0,l[47]=1,l[48]=0,l[49]=0,l[50]=1,l[51]=0,l[52]=0,l[53]=1,l[54]=0,l[55]=0,l[56]=1,l[57]=0,l[58]=0,l[59]=1,l[60]=0,l[61]=0,l[62]=1,l[63]=0,l[64]=0,l[65]=1,l[66]=0,l[67]=0,l[68]=1,l[69]=0,l[70]=0,l[71]=1,r.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:l})}o=new Uint16Array(6*2*3),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=4+2,o[7]=4+1,o[8]=4+0,o[9]=4+3,o[10]=4+2,o[11]=4+0,o[12]=8+0,o[13]=8+1,o[14]=8+2,o[15]=8+0,o[16]=8+2,o[17]=8+3,o[18]=12+2,o[19]=12+1,o[20]=12+0,o[21]=12+3,o[22]=12+2,o[23]=12+0,o[24]=16+2,o[25]=16+1,o[26]=16+0,o[27]=16+3,o[28]=16+2,o[29]=16+0,o[30]=20+0,o[31]=20+1,o[32]=20+2,o[33]=20+0,o[34]=20+2,o[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(6*2*3),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=m.subtract(n,t,Vwe),c=m.magnitude(a)*.5;if(u(e._offsetAttribute)){let l=s.length,f=e._offsetAttribute===on.NONE?0:1,d=new Uint8Array(l/3).fill(f);r.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new dt({attributes:r,indices:o,primitiveType:Be.TRIANGLES,boundingSphere:new ae(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var P8;$l.getUnitBox=function(){return u(P8)||(P8=$l.createGeometry($l.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),P8};var fl=$l;var kwe=new m;function km(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}km.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new km({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};km.fromAxisAlignedBoundingBox=function(e){return new km({minimum:e.minimum,maximum:e.maximum})};km.packedLength=2*m.packedLength+1;km.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var d$=new m,m$=new m,f$={minimum:d$,maximum:m$,offsetAttribute:void 0};km.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,d$),r=m.unpack(e,t+m.packedLength,m$),o=e[t+m.packedLength*2];return u(n)?(n._min=m.clone(i,n._min),n._max=m.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(f$.offsetAttribute=o===-1?void 0:o,new km(f$))};km.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new mn,r=new Uint16Array(12*2),o=new Float64Array(8*3);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=m.subtract(n,t,kwe),a=m.magnitude(s)*.5;if(u(e._offsetAttribute)){let c=o.length,l=e._offsetAttribute===on.NONE?0:1,f=new Uint8Array(c/3).fill(l);i.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new dt({attributes:i,indices:r,primitiveType:Be.LINES,boundingSphere:new ae(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var ld=km;function mT(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(mT.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});mT.fromColor=function(e){return new mT(e.red,e.green,e.blue,e.alpha)};mT.toValue=function(e,t){return u(t)?e.toBytes(t):new Uint8Array(e.toBytes())};mT.equals=function(e,t){return e===t||u(e)&&u(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var zt=mT;function vI(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(vI.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});vI.fromDistanceDisplayCondition=function(e){return new vI(e.near,e.far)};vI.toValue=function(e,t){return u(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=vI;function zwe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Ct=zwe;function Xr(e){e=y(e,y.EMPTY_OBJECT),this.start=u(e.start)?ee.clone(e.start):new ee,this.stop=u(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(Xr.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var hT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Xr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return u(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(hT.start=i,hT.stop=r,hT.isStartIncluded=o,hT.isStopIncluded=s,hT.data=a,new Xr(hT))};Xr.toIso8601=function(e,t){return`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};Xr.clone=function(e,t){if(u(e))return u(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Xr(e)};Xr.equals=function(e,t,n){return e===t||u(e)&&u(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||u(n)&&n(e.data,t.data)))};Xr.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||u(e)&&u(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||u(i)&&i(e.data,t.data)))};Xr.intersect=function(e,t,n,i){if(!u(t))return Xr.clone(Xr.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=ee.greaterThanOrEquals(s,r)&&ee.greaterThanOrEquals(o,s),l=!c&&ee.lessThanOrEquals(s,r)&&ee.lessThanOrEquals(r,a);if(!c&&!l)return Xr.clone(Xr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,h=ee.lessThan(o,a);return u(n)||(n=new Xr),n.start=c?s:r,n.isStartIncluded=f&&p||!ee.equals(s,r)&&(c&&p||l&&f),n.stop=h?o:a,n.isStopIncluded=h?d:d&&g||!ee.equals(a,o)&&g,n.data=u(i)?i(e.data,t.data):e.data,n};Xr.contains=function(e,t){if(e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.equals=function(e,t){return Xr.equals(this,e,t)};Xr.prototype.equalsEpsilon=function(e,t,n){return Xr.equalsEpsilon(this,e,t,n)};Xr.prototype.toString=function(){return Xr.toIso8601(this)};Xr.EMPTY=Object.freeze(new Xr({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var Tn=Xr;var h$=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),p$=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),Hwe=Object.freeze(new Tn({start:h$,stop:p$})),Gwe={MINIMUM_VALUE:h$,MAXIMUM_VALUE:p$,MAXIMUM_INTERVAL:Hwe},ze=Gwe;function wI(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(wI.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});wI.fromCartesian3=function(e){return new wI(e.x,e.y,e.z)};wI.toValue=function(e,t){return u(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Zi=wI;function aU(e){e=y(e,!0),this.value=aU.toValue(e)}Object.defineProperties(aU.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});aU.toValue=function(e,t){return u(t)?(t[0]=e,t):new Uint8Array([e])};var An=aU;var DI=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); + // rotate sampling direction by specified angle + s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); + s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); + s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); + s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif + vec2 uv0 = (uv/103.0) + (time * s0); + vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); + vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); + vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = tangentToEyeMatrix; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); + uv0 = fract(uv0); + uv1 = fract(uv1); + uv2 = fract(uv2); + uv3 = fract(uv3); + vec4 noise = (texture(normalMap, uv0)) + + (texture(normalMap, uv1)) + + (texture(normalMap, uv2)) + + (texture(normalMap, uv3)); -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + // average and scale to between -1 and 1 + return ((noise / 4.0) - 0.5) * 2.0; } -`;var II=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; +`;var UI=`/** + * Converts an HSB color (hue, saturation, brightness) to RGB + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_HSBToRGB + * @glslFunction + * + * @param {vec3} hsb The color in HSB. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; +const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -void main() +vec3 czm_HSBToRGB(vec3 hsb) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); + return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); } -`;var PI=`in vec3 v_positionEC; -in vec3 v_normalEC; +`;var VI=`/** + * Converts an HSL color (hue, saturation, lightness) to RGB + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_HSLToRGB + * @glslFunction + * + * @param {vec3} rgb The color in HSL. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ -void main() +vec3 hueToRGB(float hue) { - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + float r = abs(hue * 6.0 - 3.0) - 1.0; + float g = 2.0 - abs(hue * 6.0 - 2.0); + float b = 2.0 - abs(hue * 6.0 - 4.0); + return clamp(vec3(r, g, b), 0.0, 1.0); } -`;var OI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -void main() +vec3 czm_HSLToRGB(vec3 hsl) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + vec3 rgb = hueToRGB(hsl.x); + float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; + return (rgb - 0.5) * c + hsl.z; } -`;var MI=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var RI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() +`;var zI=`/** + * Adjusts the hue of a color. + * + * @name czm_hue + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the hue of the color in radians. + * + * @returns {float} The color with the hue adjusted. + * + * @example + * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) + */ +vec3 czm_hue(vec3 rgb, float adjustment) { - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; + const mat3 toYIQ = mat3(0.299, 0.587, 0.114, + 0.595716, -0.274453, -0.321263, + 0.211456, -0.522591, 0.311135); + const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, + 1.0, -0.2721, -0.6474, + 1.0, -1.107, 1.7046); + + vec3 yiq = toYIQ * rgb; + float hue = atan(yiq.z, yiq.y) + adjustment; + float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); + + vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); + return toRGB * color; } -`;var Wwe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},ya=Object.freeze(Wwe);var jwe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},wr=Object.freeze(jwe);var qwe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.SOURCE_ALPHA,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.ONE,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.SOURCE_ALPHA,functionSourceAlpha:wr.ONE,functionDestinationRgb:wr.ONE,functionDestinationAlpha:wr.ONE})},dn=Object.freeze(qwe);var Ywe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},yi=Object.freeze(Ywe);function pT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(pT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});pT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),u(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};pT.prototype.isTranslucent=function(){return u(this.material)&&this.material.isTranslucent()||!u(this.material)&&this.translucent};pT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=We(this.renderState,!1);return e?(t.depthMask=!1,t.blending=dn.ALPHA_BLEND):t.depthMask=!0,t};pT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=dn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),u(n)&&(i=_t(n,i,!0)),i};var or=pT;var BI=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var HI=`/** + * Converts a color in linear space to RGB space. + * + * @name czm_inverseGamma + * @glslFunction + * + * @param {vec3} color The color in linear space. + * @returns {vec3} The color in RGB space. + */ +vec3 czm_inverseGamma(vec3 color) { + return pow(color, vec3(1.0 / czm_gamma)); +} +`;var GI=`/** + * Determines if a time interval is empty. + * + * @name czm_isEmpty + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isEmpty(czm_raySegment interval) { - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + return (interval.stop < 0.0); } -`;var LI=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var WI=`/** + * Determines if a time interval is empty. + * + * @name czm_isFull + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isFull(czm_raySegment interval) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; + return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var NI=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var jI=`/** + * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. + * + * @name czm_latitudeToWebMercatorFraction + * @glslFunction + * + * @param {float} latitude The geodetic latitude, in radians. + * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. + * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * + * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern + * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return + * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. + */ +float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; + float sinLatitude = sin(latitude); + float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); + + return (mercatorY - southMercatorY) * oneOverMercatorHeight; } -`;var FI=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var qI=`/** + * Converts a linear RGB color to an sRGB color. + * + * @param {vec3|vec4} linearIn The color in linear color space. + * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + */ +vec3 czm_linearToSrgb(vec3 linearIn) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; + return pow(linearIn, vec3(1.0/2.2)); } -`;var UI=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. -float getHeight(int idx, float invTexSize) +vec4 czm_linearToSrgb(vec4 linearIn) { - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif + vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); + return vec4(srgbOut, linearIn.a); } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var YI=`/** + * Computes distance from an point in 2D to a line in 2D. + * + * @name czm_lineDistance + * @glslFunction + * + * param {vec2} point1 A point along the line. + * param {vec2} point2 A point along the line. + * param {vec2} point A point that may or may not be on the line. + * returns {float} The distance from the point to the line. + */ +float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { + return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); +} +`;var XI=`/** + * Computes the luminance of a color. + * + * @name czm_luminance + * @glslFunction + * + * @param {vec3} rgb The color. + * + * @returns {float} The luminance. + * + * @example + * float light = czm_luminance(vec3(0.0)); // 0.0 + * float dark = czm_luminance(vec3(1.0)); // ~1.0 + */ +float czm_luminance(vec3 rgb) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); +} +`;var KI=`/** + * Computes the size of a pixel in meters at a distance from the eye. + * <p> + * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. + * </p> + * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +{ + float width = czm_viewport.z; + float height = czm_viewport.w; + float pixelWidth; + float pixelHeight; - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } + if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) + { + float frustumWidth = right - left; + float frustumHeight = top - bottom; + pixelWidth = frustumWidth / width; + pixelHeight = frustumHeight / height; } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) + else { - color.rgb /= color.a; + float distanceToPixel = -positionEC.z; + float inverseNear = 1.0 / czm_currentFrustum.x; + float tanTheta = top * inverseNear; + pixelHeight = 2.0 * distanceToPixel * tanTheta / height; + tanTheta = right * inverseNear; + pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } - - color.rgb = czm_gammaCorrect(color.rgb); - material.diffuse = color.rgb; - material.alpha = color.a; - return material; + return max(pixelWidth, pixelHeight) * pixelRatio; } -`;var VI=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif - -uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Computes the size of a pixel in meters at a distance from the eye. + * <p> + * Use this version when scaling by pixel ratio. + * </p> + * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; + return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var kI=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var JI=`/** + * Transforms a position from model to window coordinates. The transformation + * from model to clip coordinates is done using {@link czm_modelViewProjection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of <code>near = 0</code> and <code>far = 1</code>. + * <br /><br /> + * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * <br /><br /> + * This function should not be confused with {@link czm_viewportOrthographic}, + * which is an orthographic projection matrix that transforms from window + * coordinates to clip coordinates. + * + * @name czm_modelToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in model coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_eyeToWindowCoordinates + * @see czm_modelViewProjection + * @see czm_viewportTransformation + * @see czm_viewportOrthographic + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + */ +vec4 czm_modelToWindowCoordinates(vec4 position) { - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + vec4 q = czm_modelViewProjection * position; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; } -`;var zI=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) +`;var ZI=`/** + * DOC_TBA + * + * @name czm_multiplyWithColorBalance + * @glslFunction + */ +vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + + vec3 target = left * right; + float leftLuminance = dot(left, W); + float rightLuminance = dot(right, W); + float targetLuminance = dot(target, W); + + return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var $I=`/** + * Computes a value that scales with distance. The scaling is clamped at the near and + * far distances, and does not extrapolate. This function works with the + * {@link NearFarScalar} JavaScript class. + * + * @name czm_nearFarScalar + * @glslFunction + * + * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). + * @param {float} cameraDistSq The square of the current distance from the camera. + * + * @returns {float} The value at this distance. + */ +float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; + float valueAtMin = nearFarScalar.y; + float valueAtMax = nearFarScalar.w; + float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; + float farDistanceSq = nearFarScalar.z * nearFarScalar.z; - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); + float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; + t = pow(clamp(t, 0.0, 1.0), 0.2); - return material; + return mix(valueAtMin, valueAtMax, t); } -`;var HI=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif +`;var QI=` /** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded, float range) + { + if (encoded.x == 0.0 && encoded.y == 0.0) { + return vec3(0.0, 0.0, 0.0); + } -uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; + encoded = encoded / range * 2.0 - 1.0; + vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); + if (v.z < 0.0) + { + v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); + } -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); + return normalize(v); + } - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; +/** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded) + { + return czm_octDecode(encoded, 255.0); + } - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + /** + * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {float} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(float encoded) + { + float temp = encoded / 256.0; + float x = floor(temp); + float y = (temp - x) * 256.0; + return czm_octDecode(vec2(x, y)); + } - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; +/** + * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The packed oct-encoded, unit-length vectors. + * @param {vec3} vector1 One decoded and normalized vector. + * @param {vec3} vector2 One decoded and normalized vector. + * @param {vec3} vector3 One decoded and normalized vector. + */ + void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) + { + float temp = encoded.x / 65536.0; + float x = floor(temp); + float encodedFloat1 = (temp - x) * 65536.0; - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif + temp = encoded.y / 65536.0; + float y = floor(temp); + float encodedFloat2 = (temp - y) * 65536.0; - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); + vector1 = czm_octDecode(encodedFloat1); + vector2 = czm_octDecode(encodedFloat2); + vector3 = czm_octDecode(vec2(x, y)); + } - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; +`;var e1=`/** + * Packs a depth value into a vec3 that can be represented by unsigned bytes. + * + * @name czm_packDepth + * @glslFunction + * + * @param {float} depth The floating-point depth. + * @returns {vec3} The packed depth. + */ +vec4 czm_packDepth(float depth) +{ + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; + enc = fract(enc); + enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + return enc; +} +`;var t1=`vec3 lambertianDiffuse(vec3 diffuseColor) +{ + return diffuseColor / czm_pi; +} - return material; +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +{ + return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); } -`;var GI=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +float smithVisibilityG1(float NdotV, float roughness) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; + // this is the k value for direct lighting. + // for image based lighting it will be roughness^2 / 2 + float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; + return NdotV / (NdotV * (1.0 - k) + k); } -`;var WI=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -uniform vec4 color; +float smithVisibilityGGX(float roughness, float NdotL, float NdotV) +{ + return ( + smithVisibilityG1(NdotL, roughness) * + smithVisibilityG1(NdotV, roughness) + ); +} -float getPointOnLine(vec2 p0, vec2 p1, float x) +float GGX(float roughness, float NdotH) { - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; + float roughnessSquared = roughness * roughness; + float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; + return roughnessSquared / (czm_pi * f * f); } -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Compute the diffuse and specular contributions using physically based + * rendering. This function only handles direct lighting. + * <p> + * This function only handles the lighting calculations. Metallic/roughness + * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} + * </p> + * + * @name czm_pbrlighting + * @glslFunction + * + * @param {vec3} positionEC The position of the fragment in eye coordinates + * @param {vec3} normalEC The surface normal in eye coordinates + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. + * @param {czm_pbrParameters} The computed PBR parameters. + * @return {vec3} The computed HDR color + * + * @example + * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( + * baseColor, + * metallic, + * roughness + * ); + * vec3 color = czm_pbrlighting( + * positionEC, + * normalEC, + * lightDirectionEC, + * lightColorHdr, + * pbrParameters); + */ +vec3 czm_pbrLighting( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { - czm_material material = czm_getDefaultMaterial(materialInput); + vec3 v = -normalize(positionEC); + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); + vec3 n = normalEC; + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; + float NdotH = clamp(dot(n, h), 0.0, 1.0); + float LdotH = clamp(dot(l, h), 0.0, 1.0); + float VdotH = clamp(dot(v, h), 0.0, 1.0); - vec2 st = materialInput.st; + vec3 f0 = pbrParameters.f0; + float reflectance = max(max(f0.r, f0.g), f0.b); + vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(f0, f90, VdotH); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif + float alpha = pbrParameters.roughness; + float G = smithVisibilityGGX(alpha, NdotL, NdotV); + float D = GGX(alpha, NdotH); + vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + vec3 diffuseColor = pbrParameters.diffuseColor; + // F here represents the specular contribution + vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); + // Lo = (diffuse + specular) * Li * NdotL + return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; +} +`;var n1=`/** + * Compute parameters for physically based rendering using the + * metallic/roughness workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrMetallicRoughnessMaterial + * @glslFunction + * + * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) + * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); + * @param {float} roughness A value between 0.0 and 1.0 + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrMetallicRoughnessMaterial( + vec3 baseColor, + float metallic, + float roughness +) +{ + czm_pbrParameters results; - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); + // roughness is authored as perceptual roughness + // square it to get material roughness + roughness = clamp(roughness, 0.0, 1.0); + results.roughness = roughness * roughness; - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var jI=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; + // dielectrics use f0 = 0.04, metals use albedo as f0 + metallic = clamp(metallic, 0.0, 1.0); + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); + results.f0 = f0; -const float maskLength = 16.0; + // diffuse only applies to dielectrics. + results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); + return results; } - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var i1=`/** + * Compute parameters for physically based rendering using the + * specular/glossy workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrSpecularGlossinessMaterial + * @glslFunction + * + * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) + * @param {vec3} specular The reflectance at normal incidence (f0) + * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrSpecularGlossinessMaterial( + vec3 diffuse, + vec3 specular, + float glossiness +) { - czm_material material = czm_getDefaultMaterial(materialInput); + czm_pbrParameters results; - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + // glossiness is the opposite of roughness, but easier for artists to use. + float roughness = 1.0 - glossiness; + results.roughness = roughness * roughness; - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } + results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); + results.f0 = specular; - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; + return results; } -`;var qI=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var r1=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; + return czm_getLambertDiffuse(lightDirectionEC, material.normal); } -`;var YI=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) { - czm_material material = czm_getDefaultMaterial(materialInput); + return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +} - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); +/** + * Computes a color using the Phong lighting model. + * + * @name czm_phong + * @glslFunction + * + * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. + * @param {czm_material} material The fragment's material. + * + * @returns {vec4} The computed color. + * + * @example + * vec3 positionToEyeEC = // ... + * czm_material material = // ... + * vec3 lightDirectionEC = // ... + * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * + * @see czm_getMaterial + */ +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down) + float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); + } - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; - material.diffuse = outColor.rgb; - material.alpha = outColor.a; + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - return material; + return vec4(color, material.alpha); } -`;var XI=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); + float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); + vec3 ambient = vec3(0.0); + vec3 color = ambient + material.emission; + color += material.diffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - return material; + return vec4(color, material.alpha); +} +`;var o1=`/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec4 plane, vec3 point) { + return (dot(plane.xyz, point) + plane.w); } -`;var KI=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) +/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js + * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { + return (dot(planeNormal, point) + planeDistance); +} +`;var s1=`/** + * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero. + * + * @name czm_pointAlongRay + * @glslFunction + * + * @param {czm_ray} ray The ray to compute the point along. + * @param {float} time The time along the ray. + * + * @returns {vec3} The point along the ray at the given time. + * + * @example + * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction + * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) + */ +vec3 czm_pointAlongRay(czm_ray ray, float time) { - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; + return ray.origin + (time * ray.direction); } -`;var JI=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var a1=`/** + * DOC_TBA + * + * @name czm_rayEllipsoidIntersectionInterval + * @glslFunction + */ +czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); + // ray and ellipsoid center in eye coordinates. radii in model coordinates. + vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; + vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - material.diffuse = color.rgb; - material.alpha = color.a; + q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - return material; -} -`;var ZI=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + float q2 = dot(q, q); + float qw = dot(q, w); -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; + if (q2 > 1.0) // Outside ellipsoid. + { + if (qw >= 0.0) // Looking outward or tangent (0 intersections). + { + return czm_emptyRaySegment; + } + else // qw < 0.0. + { + float qw2 = qw * qw; + float difference = q2 - 1.0; // Positively valued. + float w2 = dot(w, w); + float product = w2 * difference; -czm_material czm_getMaterial(czm_materialInput materialInput) + if (qw2 < product) // Imaginary roots (0 intersections). + { + return czm_emptyRaySegment; + } + else if (qw2 > product) // Distinct roots (2 intersections). + { + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Avoid cancellation. + float root0 = temp / w2; + float root1 = difference / temp; + if (root0 < root1) + { + czm_raySegment i = czm_raySegment(root0, root1); + return i; + } + else + { + czm_raySegment i = czm_raySegment(root1, root0); + return i; + } + } + else // qw2 == product. Repeated roots (2 intersections). + { + float root = sqrt(difference / w2); + czm_raySegment i = czm_raySegment(root, root); + return i; + } + } + } + else if (q2 < 1.0) // Inside ellipsoid (2 intersections). + { + float difference = q2 - 1.0; // Negatively valued. + float w2 = dot(w, w); + float product = w2 * difference; // Negatively valued. + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Positively valued. + czm_raySegment i = czm_raySegment(0.0, temp / w2); + return i; + } + else // q2 == 1.0. On ellipsoid. + { + if (qw < 0.0) // Looking inward. + { + float w2 = dot(w, w); + czm_raySegment i = czm_raySegment(0.0, -qw / w2); + return i; + } + else // qw >= 0.0. Looking outward or tangent. + { + return czm_emptyRaySegment; + } + } +} +`;var c1=`/** + * Compute the intersection interval of a ray with a sphere. + * + * @name czm_raySphereIntersectionInterval + * @glslFunction + * + * @param {czm_ray} ray The ray. + * @param {vec3} center The center of the sphere. + * @param {float} radius The radius of the sphere. + * @return {czm_raySegment} The intersection interval of the ray with the sphere. + */ +czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + vec3 o = ray.origin; + vec3 d = ray.direction; - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + vec3 oc = o - center; - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + float a = dot(d, d); + float b = 2.0 * dot(d, oc); + float c = dot(oc, oc) - (radius * radius); - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); + float det = (b * b) - (4.0 * a * c); - material.diffuse = material.diffuse; + if (det < 0.0) { + return czm_emptyRaySegment; + } - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + float sqrtDet = sqrt(det); - material.specular = specularIntensity; - material.shininess = 10.0; + float t0 = (-b - sqrtDet) / (2.0 * a); + float t1 = (-b + sqrtDet) / (2.0 * a); - return material; + czm_raySegment result = czm_raySegment(t0, t1); + return result; } -`;function qe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,cn.LINEAR),this._magnificationFilter=y(e.magnificationFilter,Ti.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,Xwe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),u(qe._uniformList[this.type])||(qe._uniformList[this.type]=Object.keys(this._uniforms))}qe._uniformList={};qe.fromType=function(e,t){let n=new qe({fabric:{type:e}});if(u(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};qe.prototype.isTranslucent=function(){if(u(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};qe.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let l=c.image,f;Array.isArray(l)&&(f=l.slice(1,l.length).map(function(A){return A.bufferView}),l=l[0]);let d=new fn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;u(l.internalFormat)?p=new Rt({context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView,mipLevels:f},sampler:d}):p=new Rt({context:e,source:l,sampler:d});let g=this._textures[n];u(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let h=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let A=this.uniforms[h];A.x=p._width,A.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let l=c.images,f=new Ga({context:e,source:{positiveX:l[0],negativeX:l[1],positiveY:l[2],negativeY:l[3],positiveZ:l[4],negativeZ:l[5]},sampler:new fn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};qe.prototype.isDestroyed=function(){return!1};qe.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function Xwe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=We(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=We(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=We(y(t._template.materials,y.EMPTY_OBJECT)),t.type=u(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=qe._materialCache.getMaterial(t.type);if(u(i)){let o=We(i.fabric,!0);t._template=_t(t._template,o,!0),n=i.translucent}Qwe(t),u(i)||qe._materialCache.addMaterial(t.type,t),eDe(t),rDe(t),sDe(t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,r),n=y(e.translucent,n),u(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function O8(e,t,n,i){if(u(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function _$(e,t){}function Kwe(e,t){}var Jwe=["type","materials","uniforms","components","source"],Zwe=["diffuse","specular","shininess","normal","emission","alpha"];function Qwe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;O8(t,Jwe,_$,!0),O8(r,Zwe,_$,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);O8(n,o,Kwe,!1)}function $we(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function eDe(e){let t=e._template.components,n=e._template.source;if(u(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +`;var l1=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,u(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&$we(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; -`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${r} = ${t[r]}; -`}e.shaderSource+=`return material; + return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`}}var g$={mat2:ir,mat3:Q,mat4:N},tDe=/\.ktx2$/i;function nDe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!u(o)||o===qe.DefaultImageId;t=o;let c=n._textures[e],l,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&u(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!u(c)||c===i.defaultTexture){let p=new fn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Rt({context:i,source:o,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:o})}else u(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Rt&&o!==c){n._texturePaths[e]=void 0;let p=n._textures[e];u(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=o,l=`${e}Dimensions`,r.hasOwnProperty(l)&&(f=r[l],f.x=o._width,f.y=o._height);return}if(s&&u(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),u(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,l=`${e}Dimensions`,r.hasOwnProperty(l)&&(f=r[l],f.x=c._width,f.y=c._height)),a)return;let d=o instanceof we;if(!u(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if(typeof o=="string"||d){let p=d?o:we.createIfNeeded(o),g;tDe.test(p.url)?g=cl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){u(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}function iDe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ga){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(u(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===qe.DefaultCubeMapId)return;let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){let o=[we.createIfNeeded(i.positiveX).fetchImage(),we.createIfNeeded(i.negativeX).fetchImage(),we.createIfNeeded(i.positiveY).fetchImage(),we.createIfNeeded(i.negativeY).fetchImage(),we.createIfNeeded(i.positiveZ).fetchImage(),we.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(o).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=r}}}function rDe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&y$(e,n)}function y$(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=oDe(r),s;if(o==="channels")s=QI(e,t,r,!1);else{if(o==="sampler2D"){let l=`${t}Dimensions`;aDe(e,l)>0&&(i[l]={type:"ivec3",x:1,y:1},y$(e,l))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let l=`uniform ${o} ${t};`;e.shaderSource=l+e.shaderSource}let c=`${t}_${e._count++}`;if(s=QI(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(nDe(t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(iDe(t));else if(o.indexOf("mat")!==-1){let l=new g$[o];e._uniforms[c]=function(){return g$[o].fromColumnMajorArray(e.uniforms[t],l)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function oDe(e){let t=e.type;if(!u(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===qe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function sDe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new qe({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=_t(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;QI(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=QI(e,i,a)}}function QI(e,t,n,i){i=y(i,!0);let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,l,f){return l||f?c:(r+=1,n)}),r}function aDe(e,t,n){return QI(e,t,t,n)}qe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};qe.DefaultImageId="czm_defaultImage";qe.DefaultCubeMapId="czm_defaultCubeMap";qe.ColorType="Color";qe._materialCache.addMaterial(qe.ColorType,{fabric:{type:qe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.ImageType="Image";qe._materialCache.addMaterial(qe.ImageType,{fabric:{type:qe.ImageType,uniforms:{image:qe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});qe.DiffuseMapType="DiffuseMap";qe._materialCache.addMaterial(qe.DiffuseMapType,{fabric:{type:qe.DiffuseMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.AlphaMapType="AlphaMap";qe._materialCache.addMaterial(qe.AlphaMapType,{fabric:{type:qe.AlphaMapType,uniforms:{image:qe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});qe.SpecularMapType="SpecularMap";qe._materialCache.addMaterial(qe.SpecularMapType,{fabric:{type:qe.SpecularMapType,uniforms:{image:qe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});qe.EmissionMapType="EmissionMap";qe._materialCache.addMaterial(qe.EmissionMapType,{fabric:{type:qe.EmissionMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});qe.BumpMapType="BumpMap";qe._materialCache.addMaterial(qe.BumpMapType,{fabric:{type:qe.BumpMapType,uniforms:{image:qe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:LI},translucent:!1});qe.NormalMapType="NormalMap";qe._materialCache.addMaterial(qe.NormalMapType,{fabric:{type:qe.NormalMapType,uniforms:{image:qe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:GI},translucent:!1});qe.GridType="Grid";qe._materialCache.addMaterial(qe.GridType,{fabric:{type:qe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:HI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});qe.StripeType="Stripe";qe._materialCache.addMaterial(qe.StripeType,{fabric:{type:qe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:JI},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});qe.CheckerboardType="Checkerboard";qe._materialCache.addMaterial(qe.CheckerboardType,{fabric:{type:qe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:NI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.DotType="Dot";qe._materialCache.addMaterial(qe.DotType,{fabric:{type:qe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:FI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});qe.WaterType="Water";qe._materialCache.addMaterial(qe.WaterType,{fabric:{type:qe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:qe.DefaultImageId,normalMap:qe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:ZI},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});qe.RimLightingType="RimLighting";qe._materialCache.addMaterial(qe.RimLightingType,{fabric:{type:qe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:XI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});qe.FadeType="Fade";qe._materialCache.addMaterial(qe.FadeType,{fabric:{type:qe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:zI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});qe.PolylineArrowType="PolylineArrow";qe._materialCache.addMaterial(qe.PolylineArrowType,{fabric:{type:qe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:WI},translucent:!0});qe.PolylineDashType="PolylineDash";qe._materialCache.addMaterial(qe.PolylineDashType,{fabric:{type:qe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:jI},translucent:!0});qe.PolylineGlowType="PolylineGlow";qe._materialCache.addMaterial(qe.PolylineGlowType,{fabric:{type:qe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:qI},translucent:!0});qe.PolylineOutlineType="PolylineOutline";qe._materialCache.addMaterial(qe.PolylineOutlineType,{fabric:{type:qe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:YI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});qe.ElevationContourType="ElevationContour";qe._materialCache.addMaterial(qe.ElevationContourType,{fabric:{type:qe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:VI},translucent:!1});qe.ElevationRampType="ElevationRamp";qe._materialCache.addMaterial(qe.ElevationRampType,{fabric:{type:qe.ElevationRampType,uniforms:{image:qe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:kI},translucent:!1});qe.SlopeRampMaterialType="SlopeRamp";qe._materialCache.addMaterial(qe.SlopeRampMaterialType,{fabric:{type:qe.SlopeRampMaterialType,uniforms:{image:qe.DefaultImageId},source:KI},translucent:!1});qe.AspectRampMaterialType="AspectRamp";qe._materialCache.addMaterial(qe.AspectRampMaterialType,{fabric:{type:qe.AspectRampMaterialType,uniforms:{image:qe.DefaultImageId},source:BI},translucent:!1});qe.ElevationBandType="ElevationBand";qe._materialCache.addMaterial(qe.ElevationBandType,{fabric:{type:qe.ElevationBandType,uniforms:{heights:qe.DefaultImageId,colors:qe.DefaultImageId},source:UI},translucent:!0});var Wi=qe;function V0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,V0.MaterialSupport.TEXTURED);this.material=u(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(V0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});V0.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;V0.prototype.isTranslucent=or.prototype.isTranslucent;V0.prototype.getRenderState=or.prototype.getRenderState;V0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:OI,fragmentShaderSource:PI}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:RI,fragmentShaderSource:MI}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:II,fragmentShaderSource:DI})};var ur=V0;var $I=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +`;var u1=`/** + * Reads a value previously transformed with {@link czm_writeNonPerspective} + * by dividing it by \`w\`, the value used in the perspective divide. + * This function is intended to be called in a fragment shader to access a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The value should have been + * previously written in the vertex shader with a call to + * {@link czm_writeNonPerspective}. + * + * @name czm_readNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. + * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. + * @returns {float|vec2|vec3|vec4} The usable value. + */ +float czm_readNonPerspective(float value, float oneOverW) { + return value * oneOverW; } -`;var eP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { + return value * oneOverW; +} - gl_Position = czm_modelViewProjectionRelativeToEye * p; +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { + return value * oneOverW; } -`;var k0=`in vec4 v_color; -void main() +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { + return value * oneOverW; +} +`;var f1=`float czm_reverseLogDepth(float logZ) { - out_FragColor = czm_gammaCorrect(v_color); +#ifdef LOG_DEPTH + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + return far * (1.0 - near / (depthFromNear + near)) / (far - near); +#endif + return logZ; } -`;var tP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; +`;var d1=`/** + * Converts an RGB color to HSB (hue, saturation, brightness) + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_RGBToHSB + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -out vec4 v_color; +const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -void main() +vec3 czm_RGBToHSB(vec3 rgb) { - vec4 p = czm_computePosition(); - - v_color = color; + vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); + vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); - gl_Position = czm_modelViewProjectionRelativeToEye * p; + float d = q.x - min(q.w, q.y); + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); +} +`;var m1=`/** + * Converts an RGB color to HSL (hue, saturation, lightness) + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_RGBToHSL + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSL. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ + +vec3 RGBtoHCV(vec3 rgb) +{ + // Based on work by Sam Hocevar and Emil Persson + vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); + vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); + float c = q.x - min(q.w, q.y); + float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); + return vec3(h, c, q.x); } -`;function cp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),r=i?tP:eP,o=i?k0:$I,s=i?cp.FLAT_VERTEX_FORMAT:cp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,r),this._fragmentShaderSource=y(e.fragmentShaderSource,o),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(cp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});cp.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;cp.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;cp.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;cp.prototype.isTranslucent=or.prototype.isTranslucent;cp.prototype.getRenderState=or.prototype.getRenderState;var sn=cp;function _T(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(_T.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});_T.prototype.getType=function(e){return"Color"};_T.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};_T.prototype.equals=function(e){return this===e||e instanceof _T&&q.equals(this._color,e._color)};var Vt=_T;function lg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Ii(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(lg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});lg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};lg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};lg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),r=P.toDegrees(e.east),o=P.toDegrees(e.north);return u(t)?(t.west=n,t.south=i,t.east=r,t.north=o,t):new ce(n,i,r,o)};lg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.tileXYToRectangle(e,t,n,i);return r.west=P.toDegrees(r.west),r.south=P.toDegrees(r.south),r.east=P.toDegrees(r.east),r.north=P.toDegrees(r.north),r};lg.prototype.tileXYToRectangle=function(e,t,n,i){let r=this._rectangle,o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=e*a+r.west,l=(e+1)*a+r.west,f=r.height/s,d=r.north-t*f,p=r.north-(t+1)*f;return u(i)||(i=new ce(c,p,l,d)),i.west=c,i.south=p,i.east=l,i.north=d,i};lg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),s=i.width/r,a=i.height/o,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let l=(c-i.west)/s|0;l>=r&&(l=r-1);let f=(i.north-e.latitude)/a|0;return f>=o&&(f=o-1),u(n)?(n.x=l,n.y=f,n):new H(l,f)};var ji=lg;var A$=new m,x$=new m,C$=new he,M8=new m,cDe=new m,T$=new ae,lDe=new ji,nP=[new he,new he,new he,new he],iP=new H,Ho={};Ho.initialize=function(){let e=Ho._initPromise;return u(e)||(e=we.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ho._terrainHeights=t}),Ho._initPromise=e),e};Ho.getMinimumMaximumHeights=function(e,t){t=y(t,re.WGS84);let n=E$(e),i=Ho._defaultMinTerrainHeight,r=Ho._defaultMaxTerrainHeight;if(u(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ho._terrainHeights[o];u(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ce.northeast(e,C$),A$),t.cartographicToCartesian(ce.southwest(e,C$),x$),m.midpoint(x$,A$,M8);let a=t.scaleToGeodeticSurface(M8,cDe);if(u(a)){let c=m.distance(M8,a);i=Math.min(i,-c)}else i=Ho._defaultMinTerrainHeight}return i=Math.max(Ho._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Ho.getBoundingSphere=function(e,t){t=y(t,re.WGS84);let n=E$(e),i=Ho._defaultMaxTerrainHeight;if(u(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ho._terrainHeights[o];u(s)&&(i=s[1])}let r=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,T$),ae.union(r,T$,r)};function E$(e){he.fromRadians(e.east,e.north,0,nP[0]),he.fromRadians(e.west,e.north,0,nP[1]),he.fromRadians(e.east,e.south,0,nP[2]),he.fromRadians(e.west,e.south,0,nP[3]);let t=0,n=0,i=0,r=0,o=Ho._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let l=nP[c];if(lDe.positionToTileXY(l,s,iP),c===0)i=iP.x,r=iP.y;else if(i!==iP.x||r!==iP.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Ho._terrainHeightsMaxLevel=6;Ho._defaultMaxTerrainHeight=9e3;Ho._defaultMinTerrainHeight=-1e5;Ho._terrainHeights=void 0;Ho._initPromise=void 0;Object.defineProperties(Ho,{initialized:{get:function(){return u(Ho._terrainHeights)}}});var si=Ho;function wc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),u(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}wc.fromCorners=function(e,t,n){return u(n)||(n=new wc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};wc.fromPoints=function(e,t){if(u(t)||(t=new wc),!u(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,h=p.y,A=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(h,i),s=Math.max(h,s),r=Math.min(A,r),a=Math.max(A,a)}let l=t.minimum;l.x=n,l.y=i,l.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=m.midpoint(l,f,t.center),t};wc.clone=function(e,t){if(u(e))return u(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new wc(e.minimum,e.maximum,e.center)};wc.equals=function(e,t){return e===t||u(e)&&u(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var cU=new m;wc.intersectPlane=function(e,t){cU=m.subtract(e.maximum,e.minimum,cU);let n=m.multiplyByScalar(cU,.5,cU),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=m.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};wc.prototype.clone=function(e){return wc.clone(this,e)};wc.prototype.intersectPlane=function(e){return wc.intersectPlane(this,e)};wc.prototype.equals=function(e){return wc.equals(this,e)};var ug=wc;var R8={};R8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function b$(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}R8.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),l=Math.abs(e);if(c<l&&c/l<P.EPSILON14)return[0,0];if(c>l&&l/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=b$(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*b$(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Dc=R8;var L8={};L8.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function B8(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,l=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,h=o*a-d,A=4*p*h-g*g,x,C;if(A<0){let Y,W,J;f*l>=c*d?(Y=r,W=p,J=-2*o*p+r*g):(Y=a,W=h,J=-a*g+2*s*h);let K=-(J<0?-1:1)*Math.abs(Y)*Math.sqrt(-A);C=-J+K;let Z=C/2,me=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),ye=C===K?-me:-W/me;return x=W<=0?me+ye:-J/(me*me+ye*ye+W),f*l>=c*d?[(x-o)/r]:[-a/(x+s)]}let T=p,E=-2*o*p+r*g,S=h,w=-a*g+2*s*h,D=Math.sqrt(A),M=Math.sqrt(3)/2,O=Math.abs(Math.atan2(r*D,-E)/3);x=2*Math.sqrt(-T);let B=Math.cos(O);C=x*B;let L=x*(-B/2-M*Math.sin(O)),_=C+L>2*o?C-o:L-o,b=r,v=_/b;O=Math.abs(Math.atan2(a*D,-w)/3),x=2*Math.sqrt(-S),B=Math.cos(O),C=x*B,L=x*(-B/2-M*Math.sin(O));let I=-a,R=C+L<2*s?C+s:L+s,F=I/R,k=b*R,V=-_*R-b*I,G=_*I,U=(s*V-o*G)/(-o*V+s*k);return v<=U?v<=F?U<=F?[v,U,F]:[v,F,U]:[F,v,U]:v<=F?[U,v,F]:U<=F?[U,F,v]:[F,U,v]}L8.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Dc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Dc.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return B8(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):B8(e,t,0,i);if(i===0)return r=Dc.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return B8(e,t,n,i)};var z0=L8;var N8={};N8.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,l=n*n,f=l*n,d=i*i,p=d*i,g=r*r,h=g*r;return a*l*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*h+r*(18*c*n*i-4*a*f+16*e*l*l-80*e*t*l*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*l-192*o*t*i)};function ud(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=z0.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let l=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=Dc.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],h;if(p>=0&&g>=0){let A=Math.sqrt(p),x=Math.sqrt(g);return[l-x,l-A,l+A,l+x]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[l-h,l+h];if(p<0&&g>=0)return h=Math.sqrt(g),[l-h,l+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,h=Dc.computeRealRoots(1,d,p),A=Dc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=l,h[1]+=l,A.length!==0?(A[0]+=l,A[1]+=l,h[1]<=A[0]?[h[0],h[1],A[0],A[1]]:A[1]<=h[0]?[A[0],A[1],h[0],h[1]]:h[0]>=A[0]&&h[1]<=A[1]?[A[0],h[0],h[1],A[1]]:A[0]>=h[0]&&A[1]<=h[1]?[h[0],A[0],A[1],h[1]]:h[0]>A[0]&&h[0]<A[1]?[A[0],h[0],A[1],h[1]]:[h[0],A[0],h[1],A[1]]):h):A.length!==0?(A[0]+=l,A[1]+=l,A):[]}}return[]}function rP(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,l=s*i-n*t*e+r,f=z0.computeRealRoots(1,a,c,l);if(f.length>0){let d=f[0],p=t-d,g=p*p,h=e/2,A=p/2,x=g-4*i,C=g+4*Math.abs(i),T=s-4*d,E=s+4*Math.abs(d),S,w;if(d<0||x*E<T*C){let b=Math.sqrt(T);S=b/2,w=b===0?0:(e*A-n)/b}else{let b=Math.sqrt(x);S=b===0?0:(e*A-n)/b,w=b/2}let D,M;h===0&&S===0?(D=0,M=0):P.sign(h)===P.sign(S)?(D=h+S,M=d/D):(M=h-S,D=d/M);let O,B;A===0&&w===0?(O=0,B=0):P.sign(A)===P.sign(w)?(O=A+w,B=i/O):(B=A-w,O=i/B);let L=Dc.computeRealRoots(1,D,O),_=Dc.computeRealRoots(1,M,B);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}N8.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return z0.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,l=o<0?1:0;switch(l+=s<0?l+1:l,l+=a<0?l+1:l,l+=c<0?l+1:l,l){case 0:return ud(o,s,a,c);case 1:return rP(o,s,a,c);case 2:return rP(o,s,a,c);case 3:return ud(o,s,a,c);case 4:return ud(o,s,a,c);case 5:return rP(o,s,a,c);case 6:return ud(o,s,a,c);case 7:return ud(o,s,a,c);case 8:return rP(o,s,a,c);case 9:return ud(o,s,a,c);case 10:return ud(o,s,a,c);case 11:return rP(o,s,a,c);case 12:return ud(o,s,a,c);case 13:return ud(o,s,a,c);case 14:return ud(o,s,a,c);case 15:return ud(o,s,a,c);default:return}};var oP=N8;function lU(e,t){t=m.clone(y(t,m.ZERO)),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(y(e,m.ZERO)),this.direction=t}lU.clone=function(e,t){if(u(e))return u(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new lU(e.origin,e.direction)};lU.getPoint=function(e,t,n){return u(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var Dn=lU;var oo={};oo.rayPlane=function(e,t,n){u(n)||(n=new m);let i=e.origin,r=e.direction,o=t.normal,s=m.dot(o,r);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-m.dot(o,i))/s;if(!(a<0))return n=m.multiplyByScalar(r,a,n),m.add(i,n,n)};var uDe=new m,fDe=new m,M$=new m,S$=new m,v$=new m;oo.rayTriangleParametric=function(e,t,n,i,r){r=y(r,!1);let o=e.origin,s=e.direction,a=m.subtract(n,t,uDe),c=m.subtract(i,t,fDe),l=m.cross(s,c,M$),f=m.dot(a,l),d,p,g,h,A;if(r){if(f<P.EPSILON6||(d=m.subtract(o,t,S$),g=m.dot(d,l),g<0||g>f)||(p=m.cross(d,a,v$),h=m.dot(s,p),h<0||g+h>f))return;A=m.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let x=1/f;if(d=m.subtract(o,t,S$),g=m.dot(d,l)*x,g<0||g>1||(p=m.cross(d,a,v$),h=m.dot(s,p)*x,h<0||g+h>1))return;A=m.dot(c,p)*x}return A};oo.rayTriangle=function(e,t,n,i,r,o){let s=oo.rayTriangleParametric(e,t,n,i,r);if(!(!u(s)||s<0))return u(o)||(o=new m),m.multiplyByScalar(e.direction,s,o),m.add(e.origin,o,o)};var dDe=new Dn;oo.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=dDe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=oo.rayTriangleParametric(a,n,i,r,o);if(!(!u(c)||c<0||c>m.distance(e,t)))return u(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function mDe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,l=(-t-a)*s;return c<l?(i.root0=c,i.root1=l):(i.root0=l,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var hDe={root0:0,root1:0};function R$(e,t,n){u(n)||(n=new vc);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=m.subtract(i,o,M$),c=m.dot(r,r),l=2*m.dot(r,a),f=m.magnitudeSquared(a)-s,d=mDe(c,l,f,hDe);if(u(d))return n.start=d.root0,n.stop=d.root1,n}oo.raySphere=function(e,t,n){if(n=R$(e,t,n),!(!u(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var pDe=new Dn;oo.lineSegmentSphere=function(e,t,n,i){let r=pDe;m.clone(e,r.origin);let o=m.subtract(t,e,r.direction),s=m.magnitude(o);if(m.normalize(o,o),i=R$(r,n,i),!(!u(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var _De=new m,gDe=new m;oo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,_De),r=m.multiplyComponents(n,e.direction,gDe),o=m.magnitudeSquared(i),s=m.dot(i,r),a,c,l,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=m.magnitudeSquared(r),l=c*a,p<l)return;if(p>l){f=s*s-l,d=-s+Math.sqrt(f);let h=d/c,A=a/d;return h<A?new vc(h,A):{start:A,stop:h}}let g=Math.sqrt(a/c);return new vc(g,g)}else if(o<1)return a=o-1,c=m.magnitudeSquared(r),l=c*a,f=s*s-l,d=-s+Math.sqrt(f),new vc(0,d/c);if(s<0)return c=m.magnitudeSquared(r),new vc(0,-s/c)};function H0(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function yDe(e,t,n,i,r){let o=i*i,s=r*r,a=(e[Q.COLUMN1ROW1]-e[Q.COLUMN2ROW2])*s,c=r*(i*H0(e[Q.COLUMN1ROW0],e[Q.COLUMN0ROW1],P.EPSILON15)+t.y),l=e[Q.COLUMN0ROW0]*o+e[Q.COLUMN2ROW2]*s+i*t.x+n,f=s*H0(e[Q.COLUMN2ROW1],e[Q.COLUMN1ROW2],P.EPSILON15),d=r*(i*H0(e[Q.COLUMN2ROW0],e[Q.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Dc.computeRealRoots(a,c,l),p.length===0)return g;let O=p[0],B=Math.sqrt(Math.max(1-O*O,0));if(g.push(new m(i,r*O,r*-B)),g.push(new m(i,r*O,r*B)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new m(i,r*L,r*-_)),g.push(new m(i,r*L,r*_))}return g}let h=d*d,A=f*f,x=a*a,C=d*f,T=x+A,E=2*(c*a+C),S=2*l*a+c*c-A+h,w=2*(l*c-C),D=l*l-h;if(T===0&&E===0&&S===0&&w===0)return g;p=oP.computeRealRoots(T,E,S,w,D);let M=p.length;if(M===0)return g;for(let O=0;O<M;++O){let B=p[O],L=B*B,_=Math.max(1-L,0),b=Math.sqrt(_),v;P.sign(a)===P.sign(l)?v=H0(a*L+l,c*B,P.EPSILON12):P.sign(l)===P.sign(c*B)?v=H0(a*L,c*B+l,P.EPSILON12):v=H0(a*L+c*B,l,P.EPSILON12);let I=H0(f*B,d,P.EPSILON15),R=v*I;R<0?g.push(new m(i,r*B,r*b)):R>0?g.push(new m(i,r*B,r*-b)):b!==0?(g.push(new m(i,r*B,r*-b)),g.push(new m(i,r*B,r*b)),++O):g.push(new m(i,r*B,r*b))}return g}var F8=new m,w$=new m,D$=new m,uU=new m,ADe=new m,xDe=new Q,CDe=new Q,TDe=new Q,EDe=new Q,bDe=new Q,I$=new Q,P$=new Q,O$=new m,SDe=new m,vDe=new he;oo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let D=t.geodeticSurfaceNormal(n,F8);if(m.dot(i,D)>=0)return n}let r=u(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,F8),s=m.normalize(o,o),a=m.mostOrthogonalAxis(o,uU),c=m.normalize(m.cross(a,s,w$),w$),l=m.normalize(m.cross(s,c,D$),D$),f=xDe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=l.x,f[7]=l.y,f[8]=l.z;let d=Q.transpose(f,CDe),p=Q.fromScale(t.radii,TDe),g=Q.fromScale(t.oneOverRadii,EDe),h=bDe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let A=Q.multiply(Q.multiply(d,g,I$),h,I$),x=Q.multiply(Q.multiply(A,p,P$),f,P$),C=Q.multiplyByVector(A,n,ADe),T=yDe(x,m.negate(C,F8),0,0,1),E,S,w=T.length;if(w>0){let D=m.clone(m.ZERO,SDe),M=Number.NEGATIVE_INFINITY;for(let B=0;B<w;++B){E=Q.multiplyByVector(p,Q.multiplyByVector(f,T[B],O$),O$);let L=m.normalize(m.subtract(E,n,uU),uU),_=m.dot(L,i);_>M&&(M=_,D=m.clone(E,D))}let O=t.cartesianToCartographic(D,vDe);return M=P.clamp(M,0,1),S=m.magnitude(m.subtract(D,n,uU))*Math.sqrt(1-M*M),S=r?-S:S,O.height=S,t.cartographicToCartesian(O,new m)}};var wDe=new m;oo.lineSegmentPlane=function(e,t,n,i){u(i)||(i=new m);let r=m.subtract(t,e,wDe),o=n.normal,s=m.dot(o,r);if(Math.abs(s)<P.EPSILON6)return;let a=m.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(r,c,i),m.add(e,i,i),i};oo.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=m.dot(r,e)+o<0,a=m.dot(r,t)+o<0,c=m.dot(r,n)+o<0,l=0;l+=s?1:0,l+=a?1:0,l+=c?1:0;let f,d;if((l===1||l===2)&&(f=new m,d=new m),l===1){if(s)return oo.lineSegmentPlane(e,t,i,f),oo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return oo.lineSegmentPlane(t,n,i,f),oo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return oo.lineSegmentPlane(n,e,i,f),oo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(l===2)if(s)if(a){if(!c)return oo.lineSegmentPlane(e,n,i,f),oo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return oo.lineSegmentPlane(n,t,i,f),oo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return oo.lineSegmentPlane(t,e,i,f),oo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var Qi=oo;var U8=new oe;function zm(e,t){t=y(t,re.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(N.getColumn(n,0,U8)),this._yAxis=m.fromCartesian4(N.getColumn(n,1,U8));let i=m.fromCartesian4(N.getColumn(n,2,U8));this._plane=ln.fromPointNormal(e,i)}Object.defineProperties(zm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var DDe=new ug;zm.fromPoints=function(e,t){let n=ug.fromPoints(e,DDe);return new zm(n.center,t)};var B$=new Dn,fU=new m;zm.prototype.projectPointOntoPlane=function(e,t){let n=B$;n.origin=e,m.normalize(e,n.direction);let i=Qi.rayPlane(n,this._plane,fU);if(u(i)||(m.negate(n.direction,n.direction),i=Qi.rayPlane(n,this._plane,fU)),u(i)){let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return u(t)?(t.x=o,t.y=s,t):new H(o,s)}};zm.prototype.projectPointsOntoPlane=function(e,t){u(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);u(o)&&(t[n]=o,n++)}return t.length=n,t};zm.prototype.projectPointToNearestOnPlane=function(e,t){u(t)||(t=new H);let n=B$;n.origin=e,m.clone(this._plane.normal,n.direction);let i=Qi.rayPlane(n,this._plane,fU);u(i)||(m.negate(n.direction,n.direction),i=Qi.rayPlane(n,this._plane,fU));let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return t.x=o,t.y=s,t};zm.prototype.projectPointsToNearestOnPlane=function(e,t){u(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var IDe=new m;zm.prototype.projectPointOntoEllipsoid=function(e,t){u(t)||(t=new m);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=IDe;return m.multiplyByScalar(r,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(o,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};zm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;u(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Aa=zm;function Fi(e,t){this.center=m.clone(y(e,m.ZERO)),this.halfAxes=Q.clone(y(t,Q.ZERO))}Fi.packedLength=m.packedLength+Q.packedLength;Fi.pack=function(e,t,n){return n=y(n,0),m.pack(e.center,t,n),Q.pack(e.halfAxes,t,n+m.packedLength),t};Fi.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Fi),m.unpack(e,t,n.center),Q.unpack(e,t+m.packedLength,n.halfAxes),n};var PDe=new m,ODe=new m,MDe=new m,RDe=new m,BDe=new m,LDe=new m,NDe=new Q,FDe={unitary:new Q,diagonal:new Q};Fi.fromPoints=function(e,t){if(u(t)||(t=new Fi),!u(e)||e.length===0)return t.halfAxes=Q.ZERO,t.center=m.ZERO,t;let n,i=e.length,r=m.clone(e[0],PDe);for(n=1;n<i;n++)m.add(r,e[n],r);let o=1/i;m.multiplyByScalar(r,o,r);let s=0,a=0,c=0,l=0,f=0,d=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],r,ODe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,l+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,l*=o,f*=o,d*=o;let g=NDe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=l,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let h=Q.computeEigenDecomposition(g,FDe),A=Q.clone(h.unitary,t.halfAxes),x=Q.getColumn(A,0,RDe),C=Q.getColumn(A,1,BDe),T=Q.getColumn(A,2,LDe),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE,D=Number.MAX_VALUE,M=Number.MAX_VALUE,O=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],E=Math.max(m.dot(x,p),E),S=Math.max(m.dot(C,p),S),w=Math.max(m.dot(T,p),w),D=Math.min(m.dot(x,p),D),M=Math.min(m.dot(C,p),M),O=Math.min(m.dot(T,p),O);x=m.multiplyByScalar(x,.5*(D+E),x),C=m.multiplyByScalar(C,.5*(M+S),C),T=m.multiplyByScalar(T,.5*(O+w),T);let B=m.add(x,C,t.center);m.add(B,T,B);let L=MDe;return L.x=E-D,L.y=S-M,L.z=w-O,m.multiplyByScalar(L,.5,L),Q.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var k$=new m,UDe=new m;function L$(e,t,n,i,r,o,s,a,c,l,f){u(f)||(f=new Fi);let d=f.halfAxes;Q.setColumn(d,0,t,d),Q.setColumn(d,1,n,d),Q.setColumn(d,2,i,d);let p=k$;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+l)/2;let g=UDe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(l-c)/2;let h=f.center;return p=Q.multiplyByVector(d,p,p),m.add(e,p,h),Q.multiplyByScale(d,g,d),f}var N$=new he,VDe=new m,kDe=new he,zDe=new he,HDe=new he,GDe=new he,WDe=new he,jDe=new m,F$=new m,qDe=new m,U$=new m,YDe=new m,XDe=new H,KDe=new H,JDe=new H,ZDe=new H,QDe=new H,$De=new m,eIe=new m,tIe=new m,nIe=new m,iIe=new H,rIe=new m,oIe=new m,sIe=new m,aIe=new ln(m.UNIT_X,0);Fi.fromRectangle=function(e,t,n,i,r){t=y(t,0),n=y(n,0),i=y(i,re.WGS84);let o,s,a,c,l,f,d;if(e.width<=P.PI){let M=ce.center(e,N$),O=i.cartographicToCartesian(M,VDe),B=new Aa(O,i);d=B.plane;let L=M.longitude,_=e.south<0&&e.north>0?0:M.latitude,b=he.fromRadians(L,e.north,n,kDe),v=he.fromRadians(e.west,e.north,n,zDe),I=he.fromRadians(e.west,_,n,HDe),R=he.fromRadians(e.west,e.south,n,GDe),F=he.fromRadians(L,e.south,n,WDe),k=i.cartographicToCartesian(b,jDe),V=i.cartographicToCartesian(v,F$),G=i.cartographicToCartesian(I,qDe),U=i.cartographicToCartesian(R,U$),Y=i.cartographicToCartesian(F,YDe),W=B.projectPointToNearestOnPlane(k,XDe),J=B.projectPointToNearestOnPlane(V,KDe),j=B.projectPointToNearestOnPlane(G,JDe),K=B.projectPointToNearestOnPlane(U,ZDe),Z=B.projectPointToNearestOnPlane(Y,QDe);return o=Math.min(J.x,j.x,K.x),s=-o,c=Math.max(J.y,W.y),a=Math.min(K.y,Z.y),v.height=R.height=t,V=i.cartographicToCartesian(v,F$),U=i.cartographicToCartesian(R,U$),l=Math.min(ln.getPointDistance(d,V),ln.getPointDistance(d,U)),f=n,L$(B.origin,B.xAxis,B.yAxis,B.zAxis,o,s,a,c,l,f,r)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,A=ce.center(e,N$).longitude,x=m.fromRadians(A,h,n,i,$De);x.z=0;let T=Math.abs(x.x)<P.EPSILON10&&Math.abs(x.y)<P.EPSILON10?m.UNIT_X:m.normalize(x,eIe),E=m.UNIT_Z,S=m.cross(T,E,tIe);d=ln.fromPointNormal(x,T,aIe);let w=m.fromRadians(A+P.PI_OVER_TWO,h,n,i,nIe);s=m.dot(ln.projectPointOntoPlane(d,w,iIe),S),o=-s,c=m.fromRadians(0,e.north,g?t:n,i,rIe).z,a=m.fromRadians(0,e.south,p?t:n,i,oIe).z;let D=m.fromRadians(e.east,h,n,i,sIe);return l=ln.getPointDistance(d,D),f=0,L$(x,S,E,T,o,s,a,c,l,f,r)};Fi.fromTransformation=function(e,t){return u(t)||(t=new Fi),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=Q.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Fi.clone=function(e,t){if(u(e))return u(t)?(m.clone(e.center,t.center),Q.clone(e.halfAxes,t.halfAxes),t):new Fi(e.center,e.halfAxes)};Fi.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[Q.COLUMN0ROW0]+s*r[Q.COLUMN0ROW1]+a*r[Q.COLUMN0ROW2])+Math.abs(o*r[Q.COLUMN1ROW0]+s*r[Q.COLUMN1ROW1]+a*r[Q.COLUMN1ROW2])+Math.abs(o*r[Q.COLUMN2ROW0]+s*r[Q.COLUMN2ROW1]+a*r[Q.COLUMN2ROW2]),l=m.dot(i,n)+t.distance;return l<=-c?$t.OUTSIDE:l>=c?$t.INSIDE:$t.INTERSECTING};var z$=new m,H$=new m,G$=new m,cIe=new m,V$=new m,lIe=new m;Fi.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,k$),i=e.halfAxes,r=Q.getColumn(i,0,z$),o=Q.getColumn(i,1,H$),s=Q.getColumn(i,2,G$),a=m.magnitude(r),c=m.magnitude(o),l=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(r,a,r):f=!1,c>0?m.divideByScalar(o,c,o):d=!1,l>0?m.divideByScalar(s,l,s):p=!1;let g=!f+!d+!p,h,A,x;if(g===1){let S=r;h=o,A=s,d?p||(S=s,A=r):(S=o,h=r),x=m.cross(h,A,V$),S===r?r=x:S===o?o=x:S===s&&(s=x)}else if(g===2){h=r,d?h=o:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),A=m.cross(h,S,cIe),m.normalize(A,A),x=m.cross(h,A,V$),m.normalize(x,x),h===r?(o=A,s=x):h===o?(s=A,r=x):h===s&&(r=A,o=x)}else g===3&&(r=m.UNIT_X,o=m.UNIT_Y,s=m.UNIT_Z);let C=lIe;C.x=m.dot(n,r),C.y=m.dot(n,o),C.z=m.dot(n,s);let T=0,E;return C.x<-a?(E=C.x+a,T+=E*E):C.x>a&&(E=C.x-a,T+=E*E),C.y<-c?(E=C.y+c,T+=E*E):C.y>c&&(E=C.y-c,T+=E*E),C.z<-l?(E=C.z+l,T+=E*E):C.z>l&&(E=C.z-l,T+=E*E),T};var uIe=new m,fIe=new m;Fi.computePlaneDistances=function(e,t,n,i){u(i)||(i=new vc);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Q.getColumn(a,0,z$),l=Q.getColumn(a,1,H$),f=Q.getColumn(a,2,G$),d=m.add(c,l,uIe);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,fIe),g=m.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.add(d,l,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,l,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,l,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,l,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,l,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,l,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,l,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var dIe=new m,mIe=new m,hIe=new m;Fi.computeCorners=function(e,t){u(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,r=Q.getColumn(i,0,dIe),o=Q.getColumn(i,1,mIe),s=Q.getColumn(i,2,hIe);return m.clone(n,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],r,t[1]),m.subtract(t[1],o,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],r,t[2]),m.add(t[2],o,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],r,t[3]),m.add(t[3],o,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],r,t[4]),m.subtract(t[4],o,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],r,t[5]),m.subtract(t[5],o,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],r,t[6]),m.add(t[6],o,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],r,t[7]),m.add(t[7],o,t[7]),m.add(t[7],s,t[7]),t};var pIe=new Q;Fi.computeTransformation=function(e,t){u(t)||(t=new N);let n=e.center,i=Q.multiplyByUniformScale(e.halfAxes,2,pIe);return N.fromRotationTranslation(i,n,t)};var _Ie=new ae;Fi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,_Ie);return!t.isBoundingSphereVisible(n)};Fi.prototype.intersectPlane=function(e){return Fi.intersectPlane(this,e)};Fi.prototype.distanceSquaredTo=function(e){return Fi.distanceSquaredTo(this,e)};Fi.prototype.computePlaneDistances=function(e,t,n){return Fi.computePlaneDistances(this,e,t,n)};Fi.prototype.computeCorners=function(e){return Fi.computeCorners(this,e)};Fi.prototype.computeTransformation=function(e){return Fi.computeTransformation(this,e)};Fi.prototype.isOccluded=function(e){return Fi.isOccluded(this,e)};Fi.equals=function(e,t){return e===t||u(e)&&u(t)&&m.equals(e.center,t.center)&&Q.equals(e.halfAxes,t.halfAxes)};Fi.prototype.clone=function(e){return Fi.clone(this,e)};Fi.prototype.equals=function(e){return Fi.equals(this,e)};var Mn=Fi;var dU={};dU.getHeight=function(e,t,n){return(e-n)*t+n};var gIe=new m;dU.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,gIe),s=dU.getHeight(o.height,n,i);return m.fromRadians(o.longitude,o.latitude,s,t,r)};var Ic=dU;var sP=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY +vec3 czm_RGBToHSL(vec3 rgb) +{ + vec3 hcv = RGBtoHCV(rgb); + float l = hcv.z - hcv.y * 0.5; + float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); + return vec3(hcv.x, s, l); +} +`;var h1=`/** + * Converts an RGB color to CIE Yxy. + * <p>The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + * </p> + * + * @name czm_RGBToXYZ + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in CIE Yxy. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_RGBToXYZ(vec3 rgb) +{ + const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, + 0.3576, 0.7152, 0.1192, + 0.1805, 0.0722, 0.9505); + vec3 xyz = RGB2XYZ * rgb; + vec3 Yxy; + Yxy.r = xyz.g; + float temp = dot(vec3(1.0), xyz); + Yxy.gb = xyz.rg / temp; + return Yxy; +} +`;var p1=`/** + * Round a floating point value. This function exists because round() doesn't + * exist in GLSL 1.00. + * + * @param {float|vec2|vec3|vec4} value The value to round + * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + */ +float czm_round(float value) { + return floor(value + 0.5); +} -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR +vec2 czm_round(vec2 value) { + return floor(value + 0.5); +} -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES +vec3 czm_round(vec3 value) { + return floor(value + 0.5); +} -void main() +vec4 czm_round(vec4 value) { + return floor(value + 0.5); +} +`;var _1=`/** + * Samples the 4 neighboring pixels and return the weighted average. + * + * @private + */ +vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) { - vec4 position = czm_computePosition(); + direction /= dot(vec3(1.0), abs(direction)); + vec2 rev = abs(direction.zx) - vec2(1.0); + vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, + direction.z < 0.0 ? rev.y : -rev.y); + vec2 uv = direction.y < 0.0 ? neg : direction.xz; + vec2 coord = 0.5 * uv + vec2(0.5); + vec2 pixel = 1.0 / textureSize; -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + if (lod > 0.0) + { + // Each subseqeuent mip level is half the size + float scale = 1.0 / pow(2.0, lod); + float offset = ((textureSize.y + 1.0) / textureSize.x); - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif + coord.x *= offset; + coord *= scale; -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + coord.x += offset + pixel.x; + coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; + } + else + { + coord.x *= (textureSize.y / textureSize.x); + } - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + // Do bilinear filtering + #ifndef OES_texture_float_linear + vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; + vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; + vec3 color3 = texture(projectedMap, coord + pixel).rgb; + vec3 color4 = texture(projectedMap, coord).rgb; - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + vec2 texturePosition = coord * textureSize; - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D + float fu = fract(texturePosition.x); + float fv = fract(texturePosition.y); - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; + vec3 average1 = mix(color4, color2, fu); + vec3 average2 = mix(color1, color3, fu); - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; + vec3 color = mix(average1, average2, fv); + #else + vec3 color = texture(projectedMap, coord).rgb; + #endif - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + return color; +} - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif +/** + * Samples from a cube map that has been projected using an octahedral projection from the given direction. + * + * @name czm_sampleOctahedralProjection + * @glslFunction + * + * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. + * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. + * @param {vec3} direction The normalized direction used to sample the cube map. + * @param {float} lod The level of detail to sample. + * @param {float} maxLod The maximum level of detail. + * @returns {vec3} The color of the cube map at the direction. + */ +vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { + float currentLod = floor(lod + 0.5); + float nextLod = min(currentLod + 1.0, maxLod); - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var fg=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif + vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); + vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); + return mix(colorNextLod, colorCurrentLod, nextLod - lod); } -`;var W$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};W$.NUMBER_OF_CLASSIFICATION_TYPES=3;var zn=Object.freeze(W$);var yIe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},qa=Object.freeze(yIe);function AIe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var aP=AIe;function lp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=xIe(t),r=e.floatingPointTexture,o=i===Ke.FLOAT&&!r,s=CIe(t,o),a=TIe(s,t,o),c=Math.floor(Ht.maximumTextureSize/a),l=Math.min(n,c),f=a*l,d=Math.ceil(n/l),p=1/f,g=p*.5,h=1/d,A=h*.5;this._textureDimensions=new H(f,d),this._textureStep=new oe(p,g,h,A),this._pixelDatatype=o?Ke.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let x=4*f*d;this._batchValues=i===Ke.FLOAT&&!o?new Float32Array(x):new Uint8Array(x),this._batchValuesDirty=!1}Object.defineProperties(lp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function xIe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Ke.FLOAT:Ke.UNSIGNED_BYTE}function q$(e,t){let n=e[t].componentsPerAttribute;return n===2?H:n===3?m:n===4?oe:Number}function CIe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function TIe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?r+4:r+1}var cP=new oe;function EIe(e,t,n){let i=oe.unpack(e,t,cP),r=oe.unpackFloat(i);i=oe.unpack(e,t+4,cP);let o=oe.unpackFloat(i);i=oe.unpack(e,t+8,cP);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,cP);let a=oe.unpackFloat(i);return oe.fromElements(r,o,s,a,n)}function bIe(e,t,n){let i=oe.packFloat(e.x,cP);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var j$=new oe;lp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?a=EIe(this._batchValues,s,j$):a=oe.unpack(this._batchValues,s,j$);let c=q$(i,t);return u(c.fromCartesian4)?c.fromCartesian4(a,n):u(c.clone)?c.clone(a,n):a.x};var SIe=[void 0,void 0,new H,new m,new oe],vIe=new oe;lp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=SIe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=q$(this._attributes,t);if(u(s.equals)?s.equals(o,n):o===n)return;let c=vIe;c.x=u(n.x)?n.x:n,c.y=u(n.y)?n.y:0,c.z=u(n.z)?n.z:0,c.w=u(n.w)?n.w:0;let l=this._offsets[t],d=4*this._stride*e+4*l;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?bIe(c,this._batchValues,d):oe.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function wIe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:fn.NEAREST,flipY:!1})}function DIe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}lp.prototype.update=function(e){u(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,u(this._texture)||wIe(this,e.context),DIe(this))};lp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:_t(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function IIe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function PIe(e){return e===1?"float":`vec${e}`}function OIe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function MIe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=PIe(r),a=OIe(r),c=e._offsets[t],l=`${s} ${o}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==Ke.UNSIGNED_BYTE?l+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:l+=` vec4 textureValue = texture(batchTexture, st); -`,l+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Ke.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?l+=`value *= 255.0; -`:e._pixelDatatype===Ke.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(l+=`value /= 255.0; -`),l+=` return value; -} -`,l}lp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${IIe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=MIe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} -${t} -${s}`}};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var G0=lp;var sr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};sr.getMathType=function(e){switch(e){case sr.SCALAR:return Number;case sr.VEC2:return H;case sr.VEC3:return m;case sr.VEC4:return oe;case sr.MAT2:return ir;case sr.MAT3:return Q;case sr.MAT4:return N}};sr.getNumberOfComponents=function(e){switch(e){case sr.SCALAR:return 1;case sr.VEC2:return 2;case sr.VEC3:return 3;case sr.VEC4:case sr.MAT2:return 4;case sr.MAT3:return 9;case sr.MAT4:return 16}};sr.getAttributeLocationCount=function(e){switch(e){case sr.SCALAR:case sr.VEC2:case sr.VEC3:case sr.VEC4:return 1;case sr.MAT2:return 2;case sr.MAT3:return 3;case sr.MAT4:return 4}};sr.getGlslType=function(e){switch(e){case sr.SCALAR:return"float";case sr.VEC2:return"vec2";case sr.VEC3:return"vec3";case sr.VEC4:return"vec4";case sr.MAT2:return"mat2";case sr.MAT3:return"mat3";case sr.MAT4:return"mat4"}};var an=Object.freeze(sr);var Y$=1/256,X$=256,br={};br.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(r)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};br.octEncode=function(e,t){return br.octEncodeInRange(e,255,t)};var lP=new H,K$=new Uint8Array(1);function mU(e){return K$[0]=e,K$[0]}br.octEncodeToCartesian4=function(e,t){return br.octEncodeInRange(e,65535,lP),t.x=mU(lP.x*Y$),t.y=mU(lP.x),t.z=mU(lP.y*Y$),t.w=mU(lP.y),t};br.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(r),i.y=(1-Math.abs(r))*P.signNotZero(i.y)}return m.normalize(i,i)};br.octDecode=function(e,t,n){return br.octDecodeInRange(e,t,255,n)};br.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*X$+i,a=r*X$+o;return br.octDecodeInRange(s,a,65535,t)};br.octPackFloat=function(e){return 256*e.x+e.y};var k8=new H;br.octEncodeFloat=function(e){return br.octEncode(e,k8),br.octPackFloat(k8)};br.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return br.octDecode(i,r,t)};br.octPack=function(e,t,n,i){let r=br.octEncodeFloat(e),o=br.octEncodeFloat(t),s=br.octEncode(n,k8);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};br.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;br.octDecodeFloat(s,t),br.octDecodeFloat(c,n),br.octDecode(o,a,i)};br.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};br.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function V8(e){return e>>1^-(e&1)}br.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=V8(e[a]),o+=V8(t[a]),e[a]=r,t[a]=o,u(n)&&(s+=V8(n[a]),n[a]=s)};br.dequantize=function(e,t,n,i){let r=an.getNumberOfComponents(n),o;switch(t){case X.BYTE:o=127;break;case X.UNSIGNED_BYTE:o=255;break;case X.SHORT:o=32767;break;case X.UNSIGNED_SHORT:o=65535;break;case X.INT:o=2147483647;break;case X.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let l=a*r+c;s[l]=Math.max(e[l]/o,-1)}return s};br.decodeRGB565=function(e,t){let n=e.length;u(t)||(t=new Float32Array(n*3));let i=(1<<5)-1,r=(1<<6)-1,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],l=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=l*o,t[p+1]=f*s,t[p+2]=d*o}return t};var Yn=br;var J$=new m,Z$=new m,Q$=new m;function RIe(e,t,n,i,r){u(r)||(r=new m);let o,s,a,c,l,f,d,p;if(u(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=m.subtract(n,t,J$),s=m.subtract(i,t,Z$),a=m.subtract(e,t,Q$),c=m.dot(o,o),l=m.dot(o,s),f=m.dot(o,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=H.subtract(n,t,J$),s=H.subtract(i,t,Z$),a=H.subtract(e,t,Q$),c=H.dot(o,o),l=H.dot(o,s),f=H.dot(o,a),d=H.dot(s,s),p=H.dot(s,a)}r.y=d*f-l*p,r.z=c*p-l*f;let g=c*d-l*l;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var W0=RIe;var z8={};z8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r=t.length;if(!u(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};z8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r;function o(_,b,v,I){for(;b.length>=1;){let R=b[b.length-1];if(b.splice(b.length-1,1),_[R].numLiveTriangles>0)return R}for(;r<I;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,b,v,I,R,F,k){let V=-1,G,U=-1,Y=0;for(;Y<v.length;){let W=v[Y];I[W].numLiveTriangles&&(G=0,R-I[W].timeStamp+2*I[W].numLiveTriangles<=b&&(G=R-I[W].timeStamp),(G>U||U===-1)&&(U=G,V=W)),++Y}return V===-1?o(I,F,_,k):V}let a=t.length,c=0,l=0,f=t[l],d=a;if(u(n))c=n+1;else{for(;l<d;)f>c&&(c=f),++l,f=t[l];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};l=0;let h=0;for(;l<d;)p[t[l]].vertexTriangles.push(h),++p[t[l]].numLiveTriangles,p[t[l+1]].vertexTriangles.push(h),++p[t[l+1]].numLiveTriangles,p[t[l+2]].vertexTriangles.push(h),++p[t[l+2]].numLiveTriangles,++h,l+=3;let A=0,x=i+1;r=1;let C=[],T=[],E,S,w=0,D=[],M=a/3,O=[];for(g=0;g<M;g++)O[g]=!1;let B,L;for(;A!==-1;){C=[],S=p[A],L=S.vertexTriangles.length;for(let _=0;_<L;++_)if(h=S.vertexTriangles[_],!O[h]){O[h]=!0,l=h+h+h;for(let b=0;b<3;++b)B=t[l],C.push(B),T.push(B),D[w]=B,++w,E=p[B],--E.numLiveTriangles,x-E.timeStamp>i&&(E.timeStamp=x,++x),++l}A=s(t,i,C,p,x,T,c)}return D};var uP=z8;var Pc={};function xU(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function BIe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)xU(i,r,e[o],e[o+1],e[o+2]);return i}function LIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);xU(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)xU(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function NIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)xU(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Pc.toWireframe=function(e){let t=e.indices;if(u(t)){switch(e.primitiveType){case Be.TRIANGLES:e.indices=BIe(t);break;case Be.TRIANGLE_STRIP:e.indices=LIe(t);break;case Be.TRIANGLE_FAN:e.indices=NIe(t);break}e.primitiveType=Be.LINES}return e};Pc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,l=e.boundingSphere;return u(l)&&(c=new ae(l.center,l.radius+n)),new dt({attributes:{position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Be.LINES,boundingSphere:c})};Pc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];u(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!u(i[a])&&(i[a]=r++);return i};Pc.reorderForPreVertexCache=function(e){let t=dt.computeNumberOfVertices(e),n=e.indices;if(u(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=Fe.createTypedArray(t,o),a=0,c=0,l=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=l,s[c]=l,++l),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&u(d[p])&&u(d[p].values)){let g=d[p],h=g.values,A=0,x=g.componentsPerAttribute,C=X.createTypedArray(g.componentDatatype,l*x);for(;A<t;){let T=i[A];if(T!==-1)for(let E=0;E<x;E++)C[x*T+E]=h[x*A+E];++A}g.values=C}}return e};Pc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Be.TRIANGLES&&u(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=uP.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function $$(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&u(e[n])&&u(e[n].values)){let i=e[n];t[n]=new Ie({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function FIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}Pc.fitToUnsignedShortIndices=function(e){let t=[],n=dt.computeNumberOfVertices(e);if(u(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=$$(e.attributes),a=e.indices,c=a.length,l;e.primitiveType===Be.TRIANGLES?l=3:e.primitiveType===Be.LINES?l=2:e.primitiveType===Be.POINTS&&(l=1);for(let f=0;f<c;f+=l){for(let d=0;d<l;++d){let p=a[f+d],g=i[p];u(g)||(g=o++,i[p]=g,FIe(s,e.attributes,p)),r.push(g)}o+l>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=$$(e.attributes))}r.length!==0&&t.push(new dt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var eee=new m,UIe=new he;Pc.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=u(r)?r:new Ii;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),l=0;for(let f=0;f<a.length;f+=3){let d=m.fromArray(a,f,eee),p=s.cartesianToCartographic(d,UIe),g=r.project(p,eee);c[l++]=g.x,c[l++]=g.y,c[l++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var H8={high:0,low:0};Pc.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)qn.encode(o[f],H8),a[f]=H8.high,c[f]=H8.low;let l=r.componentsPerAttribute;return e.attributes[n]=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:l,values:a}),e.attributes[i]=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:l,values:c}),delete e.attributes[t],e};var dd=new m;function G8(e,t){if(u(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,dd),N.multiplyByPoint(e,dd,dd),m.pack(dd,n,r)}}function W8(e,t){if(u(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,dd),Q.multiplyByVector(e,dd,dd),dd=m.normalize(dd,dd),m.pack(dd,n,r)}}var hU=new N,pU=new Q;Pc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;G8(t,n.position),G8(t,n.prevPosition),G8(t,n.nextPosition),(u(n.normal)||u(n.tangent)||u(n.bitangent))&&(N.inverse(t,hU),N.transpose(hU,hU),N.getMatrix3(hU,pU),W8(pU,n.normal),W8(pU,n.tangent),W8(pU,n.bitangent));let i=e.geometry.boundingSphere;return u(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function VIe(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&u(r[o])&&u(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let l=1;l<n;++l){let f=e[l][t].attributes[o];if(!u(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ie({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var kIe=new m;function j8(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=u(e[0][t].indices),l=e[0][t].primitiveType,f=VIe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let h;if(c){let T=0;for(r=0;r<n;++r)T+=e[r][t].indices.length;let E=dt.computeNumberOfVertices(new dt({attributes:f,primitiveType:Be.POINTS})),S=Fe.createTypedArray(E,T),w=0,D=0;for(r=0;r<n;++r){let M=e[r][t].indices,O=M.length;for(s=0;s<O;++s)S[w++]=D+M[s];D+=dt.computeNumberOfVertices(e[r][t])}h=S}let A=new m,x=0,C;for(r=0;r<n;++r){if(C=e[r][t].boundingSphere,!u(C)){A=void 0;break}m.add(C.center,A,A)}if(u(A))for(m.divideByScalar(A,n,A),r=0;r<n;++r){C=e[r][t].boundingSphere;let T=m.magnitude(m.subtract(C.center,A,kIe))+C.radius;T>x&&(x=T)}return new dt({attributes:f,indices:h,primitiveType:l,boundingSphere:u(A)?new ae(A,x):void 0})}Pc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];u(s.geometry)?t.push(s):u(s.westHemisphereGeometry)&&u(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(j8(t,"geometry")),n.length>0&&(r.push(j8(n,"westHemisphereGeometry")),r.push(j8(n,"eastHemisphereGeometry"))),r};var Qu=new m,fP=new m,gT=new m,yT=new m;Pc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),l;for(l=0;l<r;l++)s[l]={indexOffset:0,count:0,currentCount:0};let f=0;for(l=0;l<o;l+=3){let h=t[l],A=t[l+1],x=t[l+2],C=h*3,T=A*3,E=x*3;fP.x=i[C],fP.y=i[C+1],fP.z=i[C+2],gT.x=i[T],gT.y=i[T+1],gT.z=i[T+2],yT.x=i[E],yT.y=i[E+1],yT.z=i[E+2],s[h].count++,s[A].count++,s[x].count++,m.subtract(gT,fP,gT),m.subtract(yT,fP,yT),a[f]=m.cross(gT,yT,new m),f++}let d=0;for(l=0;l<r;l++)s[l].indexOffset+=d,d+=s[l].count;f=0;let p;for(l=0;l<o;l+=3){p=s[t[l]];let h=p.indexOffset+p.currentCount;c[h]=f,p.currentCount++,p=s[t[l+1]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,p=s[t[l+2]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(l=0;l<r;l++){let h=l*3;if(p=s[l],m.clone(m.ZERO,Qu),p.count>0){for(f=0;f<p.count;f++)m.add(Qu,a[c[p.indexOffset+f]],Qu);m.equalsEpsilon(m.ZERO,Qu,P.EPSILON10)&&m.clone(a[c[p.indexOffset]],Qu)}m.equalsEpsilon(m.ZERO,Qu,P.EPSILON10)&&(Qu.z=1),m.normalize(Qu,Qu),g[h]=Qu.x,g[h+1]=Qu.y,g[h+2]=Qu.z}return e.attributes.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var zIe=new m,tee=new m,HIe=new m;Pc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),l;for(l=0;l<c.length;l++)c[l]=0;let f,d,p;for(l=0;l<a;l+=3){let A=n[l],x=n[l+1],C=n[l+2];f=A*3,d=x*3,p=C*3;let T=A*2,E=x*2,S=C*2,w=i[f],D=i[f+1],M=i[f+2],O=o[T],B=o[T+1],L=o[E+1]-B,_=o[S+1]-B,b=1/((o[E]-O)*_-(o[S]-O)*L),v=(_*(i[d]-w)-L*(i[p]-w))*b,I=(_*(i[d+1]-D)-L*(i[p+1]-D))*b,R=(_*(i[d+2]-M)-L*(i[p+2]-M))*b;c[f]+=v,c[f+1]+=I,c[f+2]+=R,c[d]+=v,c[d+1]+=I,c[d+2]+=R,c[p]+=v,c[p+1]+=I,c[p+2]+=R}let g=new Float32Array(s*3),h=new Float32Array(s*3);for(l=0;l<s;l++){f=l*3,d=f+1,p=f+2;let A=m.fromArray(r,f,zIe),x=m.fromArray(c,f,HIe),C=m.dot(A,x);m.multiplyByScalar(A,C,tee),m.normalize(m.subtract(x,tee,x),x),g[f]=x.x,g[d]=x.y,g[p]=x.z,m.normalize(m.cross(A,x,x),x),h[f]=x.x,h[d]=x.y,h[p]=x.z}return e.attributes.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h}),e};var dP=new H,fd=new m,nee=new m,iee=new m,_U=new H;Pc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(u(t)){let D=t.values;i=D.length/3;let M=new Float32Array(i*2),O=0;for(n=0;n<i;++n){if(m.fromArray(D,n*3,fd),m.equals(fd,m.ZERO)){O+=2;continue}_U=Yn.octEncodeInRange(fd,65535,_U),M[O++]=_U.x,M[O++]=_U.y}return e.attributes.compressedAttributes=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:M}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=u(r),a=u(o);if(!s&&!a)return e;let c=e.attributes.tangent,l=e.attributes.bitangent,f=u(c),d=u(l),p,g,h,A;s&&(p=r.values),a&&(g=o.values),f&&(h=c.values),d&&(A=l.values),i=(s?p.length:g.length)/(s?3:2);let T=i,E=a&&s?2:1;E+=f||d?1:0,T*=E;let S=new Float32Array(T),w=0;for(n=0;n<i;++n){a&&(H.fromArray(g,n*2,dP),S[w++]=Yn.compressTextureCoordinates(dP));let D=n*3;s&&u(h)&&u(A)?(m.fromArray(p,D,fd),m.fromArray(h,D,nee),m.fromArray(A,D,iee),Yn.octPack(fd,nee,iee,dP),S[w++]=dP.x,S[w++]=dP.y):(s&&(m.fromArray(p,D,fd),S[w++]=Yn.octEncodeFloat(fd)),f&&(m.fromArray(h,D,fd),S[w++]=Yn.octEncodeFloat(fd)),d&&(m.fromArray(A,D,fd),S[w++]=Yn.octEncodeFloat(fd)))}return e.attributes.compressedAttributes=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:E,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function GIe(e){if(u(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function WIe(e){let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Be.TRIANGLES,e}function jIe(e){let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Be.TRIANGLES,e}function qIe(e){if(u(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function YIe(e){let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Be.LINES,e}function XIe(e){let t=dt.computeNumberOfVertices(e),n=Fe.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Be.LINES,e}function KIe(e){switch(e.primitiveType){case Be.TRIANGLE_FAN:return WIe(e);case Be.TRIANGLE_STRIP:return jIe(e);case Be.TRIANGLES:return GIe(e);case Be.LINE_STRIP:return YIe(e);case Be.LINE_LOOP:return XIe(e);case Be.LINES:return qIe(e)}return e}function dg(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function JIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){dg(e,e.y<0),dg(t,t.y<0),dg(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;dg(e,a),dg(t,a),dg(n,a)}var ree=new m;function $u(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,ree),e.y/(e.y-t.y),ree),n),m.clone(n,i),dg(n,!0),dg(i,!1)}var j0=new m,q0=new m,Y0=new m,X0=new m,q8={positions:new Array(7),indices:new Array(3*3)};function ZIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;JIe(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=q8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?($u(e,t,j0,Y0),$u(e,n,q0,X0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?($u(t,n,j0,Y0),$u(t,e,q0,X0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&($u(n,e,j0,Y0),$u(n,t,q0,X0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||($u(n,e,j0,Y0),$u(n,t,q0,X0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):($u(t,n,j0,Y0),$u(t,e,q0,X0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):($u(e,t,j0,Y0),$u(e,n,q0,X0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=q8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=j0,c[4]=q0,c[5]=Y0,c[6]=X0,c.length=7),q8}function oee(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&u(n[r])&&u(n[r].values)){let o=n[r];o.values=X.createTypedArray(o.componentDatatype,o.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function xT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){let r=t[i];n[i]=new Ie({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function J8(e,t,n){let i=u(e.geometry.boundingSphere);t=oee(t,i),n=oee(n,i),u(n)&&!u(t)?e.geometry=n:!u(n)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function Z8(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,l,f,d,p){let g=e.fromArray(l,o*t,n),h=e.fromArray(l,s*t,i),A=e.fromArray(l,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(A,c.z,A);let x=e.add(g,h,g);e.add(x,A,x),p&&e.normalize(x,x),e.pack(x,f,d*t)}}var QIe=Z8(oe,4),AU=Z8(m,3),fee=Z8(H,2),$Ie=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;o[s]=a+c+l>P.EPSILON6?1:0},mP=new m,Y8=new m,X8=new m,ePe=new m;function gU(e,t,n,i,r,o,s,a,c,l,f,d,p,g,h,A){if(!u(o)&&!u(s)&&!u(a)&&!u(c)&&!u(l)&&g===0)return;let x=m.fromArray(r,e*3,mP),C=m.fromArray(r,t*3,Y8),T=m.fromArray(r,n*3,X8),E=W0(i,x,C,T,ePe);if(u(E)){if(u(o)&&AU(e,t,n,E,o,d.normal.values,A,!0),u(l)){let S=m.fromArray(l,e*3,mP),w=m.fromArray(l,t*3,Y8),D=m.fromArray(l,n*3,X8);m.multiplyByScalar(S,E.x,S),m.multiplyByScalar(w,E.y,w),m.multiplyByScalar(D,E.z,D);let M;!m.equals(S,m.ZERO)||!m.equals(w,m.ZERO)||!m.equals(D,m.ZERO)?(M=m.add(S,w,S),m.add(M,D,M),m.normalize(M,M)):(M=mP,M.x=0,M.y=0,M.z=0),m.pack(M,d.extrudeDirection.values,A*3)}if(u(f)&&$Ie(e,t,n,E,f,d.applyOffset.values,A),u(s)&&AU(e,t,n,E,s,d.tangent.values,A,!0),u(a)&&AU(e,t,n,E,a,d.bitangent.values,A,!0),u(c)&&fee(e,t,n,E,c,d.st.values,A),g>0)for(let S=0;S<g;S++){let w=p[S];tPe(e,t,n,E,A,h[w],d[w])}}}function tPe(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,l=s.values;switch(a){case 4:QIe(e,t,n,i,c,l,r,!1);break;case 3:AU(e,t,n,i,c,l,r,!1);break;case 2:fee(e,t,n,i,c,l,r,!1);break;default:l[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Hm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var nPe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function see(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=u(n.normal)?n.normal.values:void 0,o=u(n.bitangent)?n.bitangent.values:void 0,s=u(n.tangent)?n.tangent.values:void 0,a=u(n.st)?n.st.values:void 0,c=u(n.extrudeDirection)?n.extrudeDirection.values:void 0,l=u(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let M in n)n.hasOwnProperty(M)&&!nPe[M]&&u(n[M])&&d.push(M);let p=d.length,g=xT(t),h=xT(t),A,x,C,T,E,S=[];S.length=i.length/3;let w=[];for(w.length=i.length/3,E=0;E<S.length;++E)S[E]=-1,w[E]=-1;let D=f.length;for(E=0;E<D;E+=3){let M=f[E],O=f[E+1],B=f[E+2],L=m.fromArray(i,M*3),_=m.fromArray(i,O*3),b=m.fromArray(i,B*3),v=ZIe(L,_,b);if(u(v)&&v.positions.length>3){let I=v.positions,R=v.indices,F=R.length;for(let k=0;k<F;++k){let V=R[k],G=I[V];G.y<0?(A=h.attributes,x=h.indices,C=S):(A=g.attributes,x=g.indices,C=w),T=Hm(A,x,C,f,V<3?E+V:-1,G),gU(M,O,B,G,i,r,s,o,a,c,l,A,d,p,n,T)}}else u(v)&&(L=v.positions[0],_=v.positions[1],b=v.positions[2]),L.y<0?(A=h.attributes,x=h.indices,C=S):(A=g.attributes,x=g.indices,C=w),T=Hm(A,x,C,f,E,L),gU(M,O,B,L,i,r,s,o,a,c,l,A,d,p,n,T),T=Hm(A,x,C,f,E+1,_),gU(M,O,B,_,i,r,s,o,a,c,l,A,d,p,n,T),T=Hm(A,x,C,f,E+2,b),gU(M,O,B,b,i,r,s,o,a,c,l,A,d,p,n,T)}J8(e,h,g)}var dee=ln.fromPointNormal(m.ZERO,m.UNIT_Y),iPe=new m,rPe=new m;function AT(e,t,n,i,r,o,s){if(!u(s))return;let a=m.fromArray(i,e*3,mP);m.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function aee(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=u(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=xT(t),a=xT(t),c,l=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<l;c+=2){let p=o[c],g=o[c+1],h=m.fromArray(i,p*3,mP),A=m.fromArray(i,g*3,Y8),x;Math.abs(h.y)<P.EPSILON6&&(h.y<0?h.y=-P.EPSILON6:h.y=P.EPSILON6),Math.abs(A.y)<P.EPSILON6&&(A.y<0?A.y=-P.EPSILON6:A.y=P.EPSILON6);let C=s.attributes,T=s.indices,E=d,S=a.attributes,w=a.indices,D=f,M=Qi.lineSegmentPlane(h,A,dee,X8);if(u(M)){let O=m.multiplyByScalar(m.UNIT_Y,5*P.EPSILON9,iPe);h.y<0&&(m.negate(O,O),C=a.attributes,T=a.indices,E=f,S=s.attributes,w=s.indices,D=d);let B=m.add(M,O,rPe);x=Hm(C,T,E,o,c,h),AT(p,g,h,i,x,C,r),x=Hm(C,T,E,o,-1,B),AT(p,g,B,i,x,C,r),m.negate(O,O),m.add(M,O,B),x=Hm(S,w,D,o,-1,B),AT(p,g,B,i,x,S,r),x=Hm(S,w,D,o,c+1,A),AT(p,g,A,i,x,S,r)}else{let O,B,L;h.y<0?(O=a.attributes,B=a.indices,L=f):(O=s.attributes,B=s.indices,L=d),x=Hm(O,B,L,o,c,h),AT(p,g,h,i,x,O,r),x=Hm(O,B,L,o,c+1,A),AT(p,g,A,i,x,O,r)}}J8(e,a,s)}var cee=new H,oPe=new H,mee=new m,hee=new m,K8=new m,sPe=new m,aPe=new m,cPe=new m,lee=new oe;function uee(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=m.unpack(n,s,mee);if(a.x>0)continue;let c=m.unpack(i,s,hee);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let l=m.unpack(r,s,K8);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):m.pack(a,r,s))}}var lPe=5*P.EPSILON9,yU=P.EPSILON6;function uPe(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=u(n.st)?n.st.values:void 0,c=u(n.color)?n.color.values:void 0,l=xT(t),f=xT(t),d,p,g,h=!1,A=i.length/3;for(d=0;d<A;d+=4){let x=d,C=d+2,T=m.fromArray(i,x*3,mee),E=m.fromArray(i,C*3,hee);if(Math.abs(T.y)<yU)for(T.y=yU*(E.y<0?-1:1),i[d*3+1]=T.y,i[(d+1)*3+1]=T.y,p=x*3;p<x*3+4*3;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(E.y)<yU)for(E.y=yU*(T.y<0?-1:1),i[(d+2)*3+1]=E.y,i[(d+3)*3+1]=E.y,p=x*3;p<x*3+4*3;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let S=l.attributes,w=l.indices,D=f.attributes,M=f.indices,O=Qi.lineSegmentPlane(T,E,dee,sPe);if(u(O)){h=!0;let B=m.multiplyByScalar(m.UNIT_Y,lPe,aPe);T.y<0&&(m.negate(B,B),S=f.attributes,w=f.indices,D=l.attributes,M=l.indices);let L=m.add(O,B,cPe);S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.prevPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),S.prevPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]),S.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),m.negate(B,B),m.add(O,B,L),D.position.values.push(L.x,L.y,L.z),D.position.values.push(L.x,L.y,L.z),D.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.nextPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),D.nextPosition.values.push(o[C*3],o[C*3+1],o[C*3+2]),D.nextPosition.values.push(o[C*3+3],o[C*3+4],o[C*3+5]);let _=H.fromArray(s,x*2,cee),b=Math.abs(_.y);S.expandAndWidth.values.push(-1,b,1,b),S.expandAndWidth.values.push(-1,-b,1,-b),D.expandAndWidth.values.push(-1,b,1,b),D.expandAndWidth.values.push(-1,-b,1,-b);let v=m.magnitudeSquared(m.subtract(O,T,K8));if(v/=m.magnitudeSquared(m.subtract(E,T,K8)),u(c)){let I=oe.fromArray(c,x*4,lee),R=oe.fromArray(c,C*4,lee),F=P.lerp(I.x,R.x,v),k=P.lerp(I.y,R.y,v),V=P.lerp(I.z,R.z,v),G=P.lerp(I.w,R.w,v);for(p=x*4;p<x*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(F,k,V,G),S.color.values.push(F,k,V,G),D.color.values.push(F,k,V,G),D.color.values.push(F,k,V,G),p=C*4;p<C*4+2*4;++p)D.color.values.push(c[p])}if(u(a)){let I=H.fromArray(a,x*2,cee),R=H.fromArray(a,(d+3)*2,oPe),F=P.lerp(I.x,R.x,v);for(p=x*2;p<x*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(F,I.y),S.st.values.push(F,R.y),D.st.values.push(F,I.y),D.st.values.push(F,R.y),p=C*2;p<C*2+2*2;++p)D.st.values.push(a[p])}g=S.position.values.length/3-4,w.push(g,g+2,g+1),w.push(g+1,g+2,g+3),g=D.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}else{let B,L;for(T.y<0?(B=f.attributes,L=f.indices):(B=l.attributes,L=l.indices),B.position.values.push(T.x,T.y,T.z),B.position.values.push(T.x,T.y,T.z),B.position.values.push(E.x,E.y,E.z),B.position.values.push(E.x,E.y,E.z),p=d*3;p<d*3+4*3;++p)B.prevPosition.values.push(r[p]),B.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+4*2;++p)B.expandAndWidth.values.push(s[p]),u(a)&&B.st.values.push(a[p]);if(u(c))for(p=d*4;p<d*4+4*4;++p)B.color.values.push(c[p]);g=B.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}h&&(uee(f),uee(l)),J8(e,f,l)}Pc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(u(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,ln.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Xu.NONE)switch(t.geometryType){case Xu.POLYLINES:uPe(e);break;case Xu.TRIANGLES:see(e);break;case Xu.LINES:aee(e);break}else KIe(t),t.primitiveType===Be.TRIANGLES?see(e):t.primitiveType===Be.LINES&&aee(e);return e};var Nn=Pc;function dl(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(dl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});dl.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};dl.geodeticLatitudeToMercatorAngle=function(e){e>dl.MaximumLatitude?e=dl.MaximumLatitude:e<-dl.MaximumLatitude&&(e=-dl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};dl.MaximumLatitude=dl.mercatorAngleToGeodeticLatitude(Math.PI);dl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=dl.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return u(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};dl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=dl.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return u(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new he(i,r,o)};var Oi=dl;function fPe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!N.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)u(e[o].geometry)&&Nn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function Q8(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function dPe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];u(i.geometry)?Q8(i.geometry,n):u(i.westHemisphereGeometry)&&u(i.eastHemisphereGeometry)&&(Q8(i.westHemisphereGeometry,n),Q8(i.eastHemisphereGeometry,n))}}function mPe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,l,f,d=t.length;for(c=0;c<d;++c)if(u(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(fPe(t,a,r),!r)for(c=0;c<d;++c)u(t[c].geometry)&&Nn.splitLongitude(t[c]);if(dPe(t),o)for(c=0;c<d;++c){let g=t[c];u(g.geometry)?(Nn.reorderForPostVertexCache(g.geometry),Nn.reorderForPreVertexCache(g.geometry)):u(g.westHemisphereGeometry)&&u(g.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(g.westHemisphereGeometry),Nn.reorderForPreVertexCache(g.westHemisphereGeometry),Nn.reorderForPostVertexCache(g.eastHemisphereGeometry),Nn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(d=p.length,c=0;c<d;++c){l=p[c];let g=l.attributes;if(r)for(let h in g)g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE&&Nn.encodeAttribute(l,h,`${h}3DHigh`,`${h}3DLow`);else for(let h in g)if(g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE){let A=`${h}3D`,x=`${h}2D`;Nn.projectTo2D(l,h,A,x,n),u(l.boundingSphere)&&h==="position"&&(l.boundingSphereCV=ae.fromVertices(l.attributes.position2D.values)),Nn.encodeAttribute(l,A,`${A}High`,`${A}Low`),Nn.encodeAttribute(l,x,`${x}High`,`${x}Low`)}s&&Nn.compressVertices(l)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)l=p[c],g=g.concat(Nn.fitToUnsignedShortIndices(l));p=g}return p}function $8(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let l=i[a];r=l.offset+l.count,s=l.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let l=0;l<c;++l){let d=e[l][t];if(!u(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function hPe(e,t){let n=[];return $8(e,"geometry",t,n),$8(e,"westHemisphereGeometry",t,n),$8(e,"eastHemisphereGeometry",t,n),n}var up={};up.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=mPe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=hPe(i,t))),u(i[0].attributes)&&u(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),l=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;u(p)&&(c[f]=p.boundingSphere,l[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,h=d.westHemisphereGeometry;u(g)&&u(h)&&(u(g.boundingSphere)&&u(h.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,h.boundingSphere)),u(g.boundingSphereCV)&&u(h.boundingSphereCV)&&(l[f]=ae.union(g.boundingSphereCV,h.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:l}};function pPe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];u(r)&&u(r.values)&&t.push(r.values.buffer)}u(e.indices)&&t.push(e.indices.buffer)}function _Pe(e,t){let n=e.length;for(let i=0;i<n;++i)pPe(e[i],t)}function gPe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!u(r))continue;let o=r.attributes;t+=7+2*ae.packedLength+(u(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&u(o[s])){let a=o[s];t+=5+a.values.length}}return t}up.packCreateGeometryResults=function(e,t){let n=new Float64Array(gPe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],l=u(c);if(n[s++]=l?1:0,!l)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=u(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=u(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let A in p)p.hasOwnProperty(A)&&u(p[A])&&(g.push(A),u(r[A])||(r[A]=i.length,i.push(A)));n[s++]=g.length;for(let A=0;A<g.length;A++){let x=g[A],C=p[x];n[s++]=r[x],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let h=u(c.indices)?c.indices.length:0;n[s++]=h,h>0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};up.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],l=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let A,x,C,T=new mn,E=n[s++];for(i=0;i<E;i++){let w=t[n[s++]],D=n[s++];C=n[s++];let M=n[s++]!==0;A=n[s++],x=X.createTypedArray(D,A);for(let O=0;O<A;O++)x[O]=n[s++];T[w]=new Ie({componentDatatype:D,componentsPerAttribute:C,normalize:M,values:x})}let S;if(A=n[s++],A>0){let w=x.length/C;for(S=Fe.createTypedArray(w,A),i=0;i<A;i++)S[i]=n[s++]}r[o++]=new dt({primitiveType:c,geometryType:l,boundingSphere:d,boundingSphereCV:p,indices:S,attributes:T,offsetAttribute:f})}return r};function yPe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(N.pack(s.modelMatrix,i,r),r+=N.packedLength,u(s.attributes)&&u(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function APe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=N.unpack(t,r),s;r+=N.packedLength,u(t[r])&&(s={offset:new Zi(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}up.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:yPe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ii,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};up.unpackCombineGeometryParameters=function(e){let t=APe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=up.unpackCreateGeometryResults(n[a]),l=c.length;for(let f=0;f<l;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=re.clone(e.ellipsoid),s=e.isGeographic?new Ii(o):new Oi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function pee(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];u(s)?(i[r++]=1,ae.pack(e[o],i,r)):i[r++]=0,r+=ae.packedLength}return i}function _ee(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}up.packCombineGeometryResults=function(e,t){u(e.geometries)&&_Pe(e.geometries,t);let n=pee(e.boundingSpheres),i=pee(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};up.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:_ee(e.boundingSpheres),boundingSpheresCV:_ee(e.boundingSpheresCV)}};var K0=up;var xPe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},go=Object.freeze(xPe);var eu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};eu.NUMBER_OF_SHADOW_MODES=4;eu.castShadows=function(e){return e===eu.ENABLED||e===eu.CAST_ONLY};eu.receiveShadows=function(e){return e===eu.ENABLED||e===eu.RECEIVE_ONLY};eu.fromCastReceive=function(e,t){return e&&t?eu.ENABLED:e?eu.CAST_ONLY:t?eu.RECEIVE_ONLY:eu.DISABLED};var xn=Object.freeze(eu);function yo(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,xn.DISABLED),this._translucent=void 0,this._state=go.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoad=(r,o,s)=>{this._error=s,this._state=o,r.afterRender.push(function(){if(t._ready=t._state===go.COMPLETE||t._state===go.FAILED,!u(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(yo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function CPe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&u(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!u(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var TPe=new H,EPe=new m,See=new oe;function vee(e){let t=e.length;if(t===1)return e[0];if(t===2)return H.unpack(e,0,TPe);if(t===3)return m.unpack(e,0,EPe);if(t===4)return oe.unpack(e,0,See)}function bPe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=CPe(i),s=o.length,a=[],c={},l={},f,p=i[0].attributes,g,h,A;for(g=0;g<s;++g)h=o[g],A=p[h],c[h]=g,a.push({functionName:`czm_batchTable_${h}`,componentDatatype:A.componentDatatype,componentsPerAttribute:A.componentsPerAttribute,normalize:A.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),l.center3DHigh=a.length-5,l.center3DLow=a.length-4,l.center2DHigh=a.length-3,l.center2DLow=a.length-2,l.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let x=a.length,C=new G0(t,a,r);for(g=0;g<r;++g){let T=i[g];p=T.attributes;for(let M=0;M<s;++M){h=o[M],A=p[h];let O=vee(A.value),B=c[h];C.setBatchedAttribute(g,B,O)}let E={primitive:y(T.pickPrimitive,e)};u(T.id)&&(E.id=T.id);let S=t.createPickId(E);e._pickIds.push(S);let w=S.color,D=See;D.x=z.floatToByte(w.red),D.y=z.floatToByte(w.green),D.z=z.floatToByte(w.blue),D.w=z.floatToByte(w.alpha),C.setBatchedAttribute(g,x-1,D)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=l,e._batchTableOffsetAttribute2DIndex=f}function SPe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ie({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function vPe(e){let t=e.attributes,n=new mn;for(let r in t)t.hasOwnProperty(r)&&u(t[r])&&(n[r]=SPe(t[r]));let i;if(u(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new dt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function wPe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var DPe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;yo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=DPe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; -`),u(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView; -`,o+=`in vec4 position; -`,s+=`${c} +`;var g1=`/** + * Adjusts the saturation of a color. + * + * @name czm_saturation + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the saturation of the color. + * + * @returns {float} The color with the saturation adjusted. + * + * @example + * vec3 greyScale = czm_saturation(color, 0.0); + * vec3 doubleSaturation = czm_saturation(color, 2.0); + */ +vec3 czm_saturation(vec3 rgb, float adjustment) { - return u_modifiedModelView * position; + // Algorithm from Chapter 16 of OpenGL Shading Language + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(rgb, W)); + return mix(intensity, rgb, adjustment); } - -`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} +`;var y1=` +float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { - return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + return czm_unpackDepth(czm_textureCube(shadowMap, d)); } -`:(o+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} +float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) { - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; +#ifdef USE_SHADOW_DEPTH_TEXTURE + return texture(shadowMap, uv).r; +#else + return czm_unpackDepth(texture(shadowMap, uv)); +#endif } -`)}return[r,o,t,s].join(` -`)};yo._appendShowToShader=function(e,t){return u(e._batchTableAttributeIndices.show)?`${ke.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};yo._updateColorAttribute=function(e,t,n){if(!u(e._batchTableAttributeIndices.color)&&!u(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function gee(e){return`${ke.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function yee(e){return`in vec4 v_pickColor; -${e}`}yo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};yo._appendOffsetToShader=function(e,t){if(!u(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; -`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition(); -`;return r+=` if (czm_sceneMode == czm_sceneMode3D) -`,r+=` { -`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` } -`,r+=` else -`,r+=` { -`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` } -`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};yo._appendDistanceDisplayConditionToShader=function(e,t,n){if(!u(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=ke.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${r}`};function Aee(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",l=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); -`}n&&r&&o?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),r&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),o&&(f+=`vec3 bitangent; -`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=ke.replaceMain(p,"czm_non_compressed_main");let g=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[l,f,p,g].join(` -`)}function IPe(e){let t=ke.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function PPe(e){let t=ke.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) +{ + return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`,t}function xee(e,t){let n=e.vertexAttributes}function OPe(e,t){return function(){return e[t]}}var e5=Math.max(Gt.hardwareConcurrency-1,1),CU,MPe=new _i("combineGeometry");function RPe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===go.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],l=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),l.push({moduleName:i._workerName,geometry:i});if(!u(CU))for(CU=new Array(e5),r=0;r<e5;r++)CU[r]=new _i("createGeometry");let f;for(l=aP(l,e5),r=0;r<l.length;r++){let d=0,p=l[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,u(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let h;if(d>0){let A=new Float64Array(d);for(h=[A.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,u(i.constructor.pack)&&(i.constructor.pack(i,A,f.offset),f.geometry=A)}c.push(CU[r].scheduleTask({subTasks:l[r]},h))}e._state=go.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=go.CREATED}).catch(function(d){pP(e,t,go.FAILED,d)})}else if(e._state===go.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,l=t.mapProjection,f=MPe.scheduleTask(K0.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:l.ellipsoid,projection:l,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=go.COMBINING,Promise.resolve(f).then(function(d){let p=K0.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,u(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=go.COMBINED):pP(e,t,go.FAILED,void 0)}).catch(function(d){pP(e,t,go.FAILED,d)})}}function BPe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;u(p.attributes)&&u(p.primitiveType)?g=vPe(p):g=p.constructor.createGeometry(p),r[c++]=wPe(s,g),o.push(s.id)}r.length=c;let l=t.scene3DOnly,f=t.mapProjection,d=K0.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=N.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,u(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=go.COMBINED):pP(e,t,go.FAILED,void 0)}function LPe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!u(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!u(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let A=a[i],x=e._batchTable.getBatchedAttribute(i,n,new m);A=o[i].clone(A),Pee(A,x,r[i])}let c=[],l=[],f=[];for(i=0;i<s;++i){let A=a[i];A.center.x-A.radius>0||ae.intersectPlane(A,ln.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(A):(l.push(A),f.push(A))}let d=c[0],p=f[0],g=l[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<l.length;i++)g=ae.union(g,l[i]);let h=[];for(u(d)&&h.push(d),u(p)&&h.push(p),u(g)&&h.push(g),i=0;i<h.length;i++){let A=h[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=A,e._boundingSphereCV[i]=ae.projectTo2D(A,t.mapProjection,e._boundingSphereCV[i])}yo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Cee=new qn,wee=new he,Dee=new m,Iee=new ae;function NPe(e,t){if(!u(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,l=t.mapProjection,f=l.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let h=0;h<g;++h){let A=p[h];if(!u(A))continue;let x=e.modelMatrix;u(x)&&(A=ae.transform(A,x,Iee));let C=A.center,T=A.radius,E=qn.fromCartesian(C,Cee);if(d.setBatchedAttribute(h,r,E.high),d.setBatchedAttribute(h,o,E.low),!t.scene3DOnly){let S=f.cartesianToCartographic(C,wee),w=l.project(S,Dee);E=qn.fromCartesian(w,Cee),d.setBatchedAttribute(h,s,E.high),d.setBatchedAttribute(h,a,E.low)}d.setBatchedAttribute(h,c,T)}e._batchTableBoundingSpheresUpdated=!0}var t5=new m,FPe=new m;function Tee(e,t){if(!u(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let l=0;l<c;++l){let f=a[l];if(!u(f))continue;let d=s.getBatchedAttribute(l,e._batchTableAttributeIndices.offset);if(m.equals(d,m.ZERO)){s.setBatchedAttribute(l,i,m.ZERO);continue}let p=e.modelMatrix;u(p)&&(f=ae.transform(f,p,Iee));let g=f.center;g=o.scaleToGeodeticSurface(g,FPe);let h=o.cartesianToCartographic(g,wee),A=r.project(h,Dee),x=m.add(d,g,t5);h=o.cartesianToCartographic(x,h);let C=r.project(h,t5),T=m.subtract(C,A,t5),E=T.x;T.x=T.z,T.z=T.y,T.y=E,s.setBatchedAttribute(l,i,T)}e._batchTableOffsetsUpdated=!0}function UPe(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let l=i[c];if(s.push(oi.fromGeometry({context:o,geometry:l,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),u(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,l);else if(e._boundingSpheres.push(ae.clone(l.boundingSphere)),e._boundingSphereWC.push(new ae),!r){let f=l.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(l.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,pP(e,t,go.COMPLETE,void 0)}function VPe(e,t,n,i){let r=n.getRenderState(),o;i?(o=We(r,!1),o.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=Ve.fromCache(o),o.cull.face=yi.FRONT,e._backFaceRS=Ve.fromCache(o)):(e._frontFaceRS=Ve.fromCache(r),e._backFaceRS=e._frontFaceRS),o=We(r,!1),u(e._depthFailAppearance)&&(o.depthTest.enabled=!1),u(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=We(r,!1),o.depthTest.func=qa.GREATER,i?(o.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(o),o.cull.face=yi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(o)):(e._frontFaceDepthFailRS=Ve.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function kPe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=yo._appendOffsetToShader(e,o),o=yo._appendShowToShader(e,o),o=yo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=gee(o),o=yo._updateColorAttribute(e,o,!1),o=Aee(e,o),o=yo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=yee(s),e._sp=Kt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),xee(e._sp,r),u(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=yo._appendShowToShader(e,o),o=yo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=gee(o),o=yo._updateColorAttribute(e,o,!0),o=Aee(e,o),o=yo._modifyShaderPosition(e,o,t.scene3DOnly),o=IPe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=yee(s),s=PPe(s),e._spDepthFail=Kt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),xee(e._spDepthFail,r))}var hP=new N,Eee=new m;function bee(e,t,n,i){let r=u(n)?n._uniforms:void 0,o={},s=t.uniforms;if(u(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=OPe(s,c));let a=_t(o,r);return a=e._batchTable.getUniformMapCallback()(a),u(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return N.multiply(c,e._modelMatrix,hP),N.multiplyByPoint(hP,e.rtcCenter,Eee),N.setTranslation(hP,Eee,hP),hP}),a}function zPe(e,t,n,i,r,o,s,a){let c=bee(e,t,n,a),l;u(e._depthFailAppearance)&&(l=bee(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?ve.TRANSLUCENT:ve.OPAQUE,d=r?2:1;d*=u(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let h=0;h<p;++h){let A;r&&(A=o[h],u(A)||(A=o[h]=new et({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,++h),A=o[h],u(A)||(A=o[h]=new et({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,u(e._depthFailAppearance)&&(r&&(++h,A=o[h],u(A)||(A=o[h]=new et({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=l,A.pass=f),++h,A=o[h],u(A)||(A=o[h]=new et({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=l,A.pass=f),++g}}yo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],u(s)&&(e._boundingSphereWC[r]=ae.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ae.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphere2D[r].center.x=0,e._boundingSphereMorph[r]=ae.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(u(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function HPe(e,t,n,i,r,o,s,a){yo._updateBoundingVolumes(e,t,r);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&u(e._boundingSphere2D)?c=e._boundingSphere2D:u(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let l=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=xn.castShadows(e.shadows),g=xn.receiveShadows(e.shadows),h=n.length,A=a?2:1;A*=u(e._depthFailAppearance)?2:1;for(let x=0;x<h;++x){let C=Math.floor(x/A),T=n[x];T.modelMatrix=r,T.boundingVolume=c[C],T.cull=o,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=g,d?T.pickId="v_pickColor":T.pickId=void 0,l.push(T)}}}yo.prototype.update=function(e){if(!u(this.geometryInstances)&&this._va.length===0||u(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!u(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(u(this._error))throw this._error;if(this._state===go.FAILED)return;let t=e.context;if(u(this._batchTable)||bPe(this,t),this._batchTable.attributes.length>0){if(Ht.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==go.COMPLETE&&this._state!==go.COMBINED&&(this.asynchronous?RPe(this,e):BPe(this,e)),this._state===go.COMBINED&&(NPe(this,e),Tee(this,e),UPe(this,e)),!this.show||this._state!==go.COMPLETE)return;this._batchTableOffsetsUpdated||Tee(this,e),this._recomputeBoundingSpheres&&LPe(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=u(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),u(this._material)&&this._material.update(t);let l=n.closed&&c;r&&y(this._createRenderStatesFunction,VPe)(this,t,n,l),o&&y(this._createShaderProgramFunction,kPe)(this,e,n),(r||o)&&y(this._createCommandsFunction,zPe)(this,n,i,c,l,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,HPe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,l)};var GPe=new ae,WPe=new ae;function Pee(e,t,n){if(n===on.TOP){let i=ae.clone(e,GPe),r=ae.clone(e,WPe);r.center=m.add(r.center,t,r.center),e=ae.union(i,r,e)}else n===on.ALL&&(e.center=m.add(e.center,t,e.center));return e}function jPe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=X.createTypedArray(r.componentDatatype,o);return u(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function qPe(e,t,n,i,r){return function(o){let s=vee(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var YPe=new m;function XPe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(u(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;u(o)&&Pee(i,m.fromArray(o.get(),0,YPe),e._offsetInstanceExtend[n]),u(r)&&(i=ae.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function KPe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}yo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(u(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let l=0;l<o;++l){let f=(i+l)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let l in a)if(a.hasOwnProperty(l)){let f=a[l];c[l]={get:jPe(s,n,f),set:qPe(s,n,f,this,l)}}return XPe(this,c,n),KPe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};yo.prototype.isDestroyed=function(){return!1};yo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function pP(e,t,n,i){e._completeLoad(t,n,i)}var Sn=yo;function JPe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var Ya=JPe;var CT=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) +{ + return step(depth, czm_sampleShadowMap(shadowMap, uv)); +} +`;var x1=` +float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +{ +#ifdef USE_NORMAL_SHADING +#ifdef USE_NORMAL_SHADING_SMOOTH + float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); +#else + float strength = step(0.0, nDotL); +#endif + visibility *= strength; #endif -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); - return eyeCoordinate.xyz / eyeCoordinate.w; + visibility = max(visibility, darkness); + return visibility; } -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { - vec2 glFragCoordXY = gl_FragCoord.xy; - // Sample depths at both offset and negative offset - float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); - float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); - // Explicitly evaluate both paths - // Necessary for multifrustum and for edges of the screen - bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); - float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC +#ifdef USE_CUBE_MAP_SHADOW +float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +{ + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec3 uvw = shadowParameters.texCoords; -void main(void) + depth -= depthBias; + float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +} +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) { -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec2 uv = shadowParameters.texCoords; -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; + depth -= depthBias; +#ifdef USE_SOFT_SHADOWS + vec2 texelStepSize = shadowParameters.texelStepSize; + float radius = 1.0; + float dx0 = -texelStepSize.x * radius; + float dy0 = -texelStepSize.y * radius; + float dx1 = texelStepSize.x * radius; + float dy1 = texelStepSize.y * radius; + float visibility = ( + czm_shadowDepthCompare(shadowMap, uv, depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) + ) * (1.0 / 9.0); +#else + float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +} #endif +`;var b1=`/** + * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL + * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0. + * + * @name czm_signNotZero + * @glslFunction + * + * @param {} value The value for which to determine the sign. + * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. + */ +float czm_signNotZero(float value) +{ + return value >= 0.0 ? 1.0 : -1.0; +} -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif +vec2 czm_signNotZero(vec2 value) +{ + return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); +} +vec3 czm_signNotZero(vec3 value) +{ + return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +} -#ifdef PER_INSTANCE_COLOR +vec4 czm_signNotZero(vec4 value) +{ + return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +} +`;var C1=`/** + * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. + * <p> + * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. + * </p> + * + * @name czm_sphericalHarmonics + * @glslFunction + * + * @param {vec3} normal The normalized direction. + * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. + * @returns {vec3} The color at the direction. + * + * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + */ +vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ + vec3 L00 = coefficients[0]; + vec3 L1_1 = coefficients[1]; + vec3 L10 = coefficients[2]; + vec3 L11 = coefficients[3]; + vec3 L2_2 = coefficients[4]; + vec3 L2_1 = coefficients[5]; + vec3 L20 = coefficients[6]; + vec3 L21 = coefficients[7]; + vec3 L22 = coefficients[8]; - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; + float x = normal.x; + float y = normal.y; + float z = normal.z; - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT + return + L00 + + L1_1 * y + + L10 * z + + L11 * x + + L2_2 * (y * x) + + L2_1 * (y * z) + + L20 * (3.0 * z * z - 1.0) + + L21 * (z * x) + + L22 * (x * x - y * y); +} +`;var T1=`/** + * Converts an sRGB color to a linear RGB color. + * + * @param {vec3|vec4} srgbIn The color in sRGB space + * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + */ +vec3 czm_srgbToLinear(vec3 srgbIn) +{ + return pow(srgbIn, vec3(2.2)); +} - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; +vec4 czm_srgbToLinear(vec4 srgbIn) +{ + vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); + return vec4(linearOut, srgbIn.a); +} +`;var A1=`/** + * Creates a matrix that transforms vectors from tangent space to eye space. + * + * @name czm_tangentToEyeSpaceMatrix + * @glslFunction + * + * @param {vec3} normalEC The normal vector in eye coordinates. + * @param {vec3} tangentEC The tangent vector in eye coordinates. + * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + * + * @returns {mat3} The matrix that transforms from tangent space to eye space. + * + * @example + * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); + * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + */ +mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ + vec3 normal = normalize(normalEC); + vec3 tangent = normalize(tangentEC); + vec3 bitangent = normalize(bitangentEC); + return mat3(tangent.x , tangent.y , tangent.z, + bitangent.x, bitangent.y, bitangent.z, + normal.x , normal.y , normal.z); +} +`;var E1=`/** + * A wrapper around the texture (WebGL2) / textureCube (WebGL1) + * function to allow for WebGL 1 support. + * + * @name czm_textureCube + * @glslFunction + * + * @param {samplerCube} sampler The sampler. + * @param {vec3} p The coordinates to sample the texture at. + */ +vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 + return texture(sampler, p); +#else + return textureCube(sampler, p); +#endif +}`;var S1=`/** + * Transforms a plane. + * + * @name czm_transformPlane + * @glslFunction + * + * @param {vec4} plane The plane in Hessian Normal Form. + * @param {mat4} transform The inverse-transpose of a transformation matrix. + */ +vec4 czm_transformPlane(vec4 plane, mat4 transform) { + vec4 transformedPlane = transform * plane; + // Convert the transformed plane to Hessian Normal Form + float normalMagnitude = length(transformedPlane.xyz); + return transformedPlane / normalMagnitude; +} +`;var v1=`/** + * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3}, + * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to + * be relative to the eye. As shown in the example, the position can then be transformed in eye + * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, + * respectively. + * <p> + * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as + * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + * </p> + * + * @name czm_translateRelativeToEye + * @glslFunction + * + * @param {vec3} high The position's high bits. + * @param {vec3} low The position's low bits. + * @returns {vec3} The position translated to be relative to the camera's position. + * + * @example + * in vec3 positionHigh; + * in vec3 positionLow; + * + * void main() + * { + * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * } + * + * @see czm_modelViewRelativeToEye + * @see czm_modelViewProjectionRelativeToEye + * @see czm_computePosition + * @see EncodedCartesian3 + */ +vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +{ + vec3 highDifference = high - czm_encodedCameraPositionMCHigh; + vec3 lowDifference = low - czm_encodedCameraPositionMCLow; -#else // PER_INSTANCE_COLOR + return vec4(highDifference + lowDifference, 1.0); +} +`;var w1=`/** + * @private + */ +vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down and horizon views) + float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); + } - czm_materialInput materialInput; + diffuse = clamp(diffuse, 0.0, 1.0); -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif + float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK + return vec4(color, material.alpha); +} +`;var I1=`/** + * Returns the transpose of the matrix. The input <code>matrix</code> can be + * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>. + * + * @name czm_transpose + * @glslFunction + * + * @param {} matrix The matrix to transpose. + * + * @returns {} The transposed matrix. + * + * @example + * // GLSL declarations + * mat2 czm_transpose(mat2 matrix); + * mat3 czm_transpose(mat3 matrix); + * mat4 czm_transpose(mat4 matrix); + * + * // Transpose a 3x3 rotation matrix to find its inverse. + * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( + * positionMC, normalEC); + * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + */ +mat2 czm_transpose(mat2 matrix) +{ + return mat2( + matrix[0][0], matrix[1][0], + matrix[0][1], matrix[1][1]); } -`;function ef(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new n5;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new n5;if(r.requiresTextureCoordinates=e,n instanceof sn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}ef.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof sn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof sn||(r=t.material.shaderSource),new ke({defines:i,sources:[r,CT]})};ef.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new ke({defines:n,sources:[CT],pickColorQualifier:"in"})};ef.prototype.createVertexShader=function(e,t,n,i){return Uee(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};ef.prototype.createPickVertexShader=function(e,t,n,i){return Uee(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Oee=new m,Mee=new he,Ree={high:0,low:0};function Uee(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let l=Mee;l.longitude=P.PI,l.latitude=0,l.height=0;let f=s.project(l,Oee),d=qn.encode(f.x,Ree);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=Mee;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Oee);d=qn.encode(g.x,Ree),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),u(o)&&o instanceof sn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new ke({defines:c,sources:[r]})}function n5(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(n5.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Bee(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var ZPe=[new H,new H,new H,new H];function Vee(e,t){let n=ZPe,i=H.unpack(t,0,n[0]),r=H.unpack(t,2,n[1]),o=H.unpack(t,4,n[2]);e.uMaxVmax=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Bee(i,r,o),a=1/Bee(i,o,r);e.uvMinAndExtents=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var kee=new he,zee=new m,QPe=new m,$Pe=new m,TU={high:0,low:0};function Hee(e,t,n){let i=kee;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,zee);i.latitude=e.north;let o=t.project(i,QPe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,$Pe),a=[0,0,0,0],c=[0,0,0,0],l=qn.encode(r.x,TU);a[0]=l.high,c[0]=l.low,l=qn.encode(r.y,TU),a[1]=l.high,c[1]=l.low,l=qn.encode(o.y,TU),a[2]=l.high,c[2]=l.low,l=qn.encode(s.x,TU),a[3]=l.high,c[3]=l.low,n.planes2D_HIGH=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var e1e=new N,t1e=new N,Lee=new m,n1e=new he,i1e=[new he,new he,new he,new he,new he,new he,new he,new he];function r1e(e,t,n,i,r,o){let s=ce.center(e,n1e);s.height=n;let a=he.toCartesian(s,t,Lee),c=Mt.eastNorthUpToFixedFrame(a,t,e1e),l=N.inverse(c,t1e),f=e.west,d=e.east,p=e.north,g=e.south,h=i1e;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let A=(f+d)*.5,x=(p+g)*.5;h[4].latitude=g,h[4].longitude=A,h[5].latitude=p,h[5].longitude=A,h[6].latitude=x,h[6].longitude=f,h[7].latitude=x,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let O=0;O<8;O++){h[O].height=n;let B=he.toCartesian(h[O],t,Lee);N.multiplyByPoint(l,B,B),B.z=0,C=Math.min(C,B.x),T=Math.max(T,B.x),E=Math.min(E,B.y),S=Math.max(S,B.y)}let w=i;w.x=C,w.y=E,w.z=0,N.multiplyByPoint(c,w,w);let D=r;D.x=T,D.y=E,D.z=0,N.multiplyByPoint(c,D,D),m.subtract(D,w,r);let M=o;M.x=C,M.y=S,M.z=0,N.multiplyByPoint(c,M,M),m.subtract(M,w,o)}var o1e=new m,s1e=new m,a1e=new qn;ef.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=zee,s=o1e,a=s1e;r1e(e,n,y(r,0),o,s,a);let c={};Vee(c,t);let l=qn.fromCartesian(o,a1e);return c.southWest_HIGH=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(l.high,[0,0,0])}),c.southWest_LOW=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(l.low,[0,0,0])}),c.eastward=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),Hee(e,i,c),c};var c1e=new m;function Nee(e,t,n,i){let r=kee;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,c1e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var Fee=new H;ef.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Nee(e.south,e.west,n,Fee),o=r.x,s=r.y,a=Nee(e.north,e.east,n,Fee),c=a.x,l=a.y,f=0;s>l&&(f=P.PI-s,s=-P.PI,l+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,l+=P.EPSILON5;let d=1/(l-s),p=1/(c-o),g={sphericalExtents:new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Ya({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Vee(g,t),Hee(e,i,g),g};ef.hasAttributesForTextureCoordinatePlanes=function(e){return u(e.southWest_HIGH)&&u(e.southWest_LOW)&&u(e.northward)&&u(e.eastward)&&u(e.planes2D_HIGH)&&u(e.planes2D_LOW)&&u(e.uMaxVmax)&&u(e.uvMinAndExtents)};ef.hasAttributesForSphericalExtents=function(e){return u(e.sphericalExtents)&&u(e.longitudeRotation)&&u(e.planes2D_HIGH)&&u(e.planes2D_LOW)&&u(e.uMaxVmax)&&u(e.uvMinAndExtents)};function l1e(e){return Math.max(e.width,e.height)>ef.MAX_WIDTH_FOR_PLANAR_EXTENTS}ef.shouldUseSphericalCoordinates=function(e){return l1e(e)};ef.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var tu=ef;var u1e={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Hn=Object.freeze(u1e);var f1e={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ht=Object.freeze(f1e);var EU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};EU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Hn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Hn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:EU.CESIUM_3D_TILE_MASK,mask:EU.CESIUM_3D_TILE_MASK}};var Ft=Object.freeze(EU);function J0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,zn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;u(o)?r(o):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(J0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});J0.isSupported=function(e){return e.context.stencilBuffer};function TT(e,t){let n=t?Hn.EQUAL:Hn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qa.LESS_OR_EQUAL},depthMask:!1}}function r5(e){return{stencilTest:{enabled:e,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}}var d1e={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function m1e(e,t,n,i){if(u(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(TT(r,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(TT(r,!0)),e._rsColorPass=Ve.fromCache(r5(r,!1)),e._rsPickPass=Ve.fromCache(d1e)}function h1e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; -`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=ke.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function p1e(e,t){let n=t.context,i=e._primitive,r=sP;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Sn._appendDistanceDisplayConditionToShader(i,r),r=Sn._modifyShaderPosition(e,r,t.scene3DOnly),r=Sn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=h1e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new ke({defines:[a],sources:[r]}),l=new ke({sources:[fg]}),f=e._primitive._attributeLocations,d=new tu(s,o,e.appearance);if(e._spStencil=Kt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:f}),e._primitive.allowPicking){let h=ke.createPickVertexShaderSource(r);h=Sn._appendShowToShader(i,h),h=Sn._updatePickColorAttribute(h);let A=d.createPickFragmentShader(!1),x=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Kt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!u(C)){let T=d.createPickFragmentShader(!0),E=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Kt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:f});r=Sn._appendShowToShader(i,r),c=new ke({defines:[a],sources:[r]}),e._sp=Kt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Kt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!u(h)){let A=d.createFragmentShader(!0),x=d.createVertexShader([a],r,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f})}e._spColor2D=h}}function _1e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),l=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],u(o)||(o=t[r]=new et({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=ve.TERRAIN_CLASSIFICATION,s=et.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],u(o)||(o=t[r+1]=new et({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=ve.TERRAIN_CLASSIFICATION;let A=e.appearance.material;if(u(A)&&(c=_t(c,A._uniforms)),o.uniformMap=c,s=et.shallowClone(o,o.derivedCommands.tileset),s.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,l){let x=et.shallowClone(o,o.derivedCommands.appearance2D);x.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=x,x=et.shallowClone(s,s.derivedCommands.appearance2D),x.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=x}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let h=f[g]=et.shallowClone(t[p],f[g]);h.shaderProgram=d,h.pass=ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function g1e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,l,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let h=i._va[d++];if(n&&(a=o[s++],h=i._va[a.index]),l=t[c],u(l)||(l=t[c]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),l.vertexArray=h,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=p,l.pass=ve.TERRAIN_CLASSIFICATION,n&&(l.offset=a.offset,l.count=a.count),f=et.shallowClone(l,l.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,l.derivedCommands.tileset=f,l=t[c+1],u(l)||(l=t[c+1]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),l.vertexArray=h,l.renderState=e._rsPickPass,l.shaderProgram=e._spPick,l.uniformMap=p,l.pass=ve.TERRAIN_CLASSIFICATION,n&&(l.offset=a.offset,l.count=a.count),f=et.shallowClone(l,l.derivedCommands.tileset),f.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,l.derivedCommands.tileset=f,g){let A=et.shallowClone(l,l.derivedCommands.pick2D);A.shaderProgram=e._spPick2D,l.derivedCommands.pick2D=A,A=et.shallowClone(f,f.derivedCommands.pick2D),A.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=A}}}function y1e(e,t,n,i,r,o,s){_1e(e,o),g1e(e,s)}function Gee(e,t){return Math.floor(e%t/2)}function i5(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Wee(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function A1e(e,t,n,i,r,o,s,a){let c=e._primitive;Sn._updateBoundingVolumes(c,t,r);let l;t.mode===ne.SCENE3D?l=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===ne.SCENE2D&&u(c._boundingSphere2D)?l=c._boundingSphere2D:u(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);let f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN,g=t.passes,h,A,x;if(g.render){let C=n.length;for(h=0;h<C;++h)A=l[Gee(h,C)],d&&(x=n[h],i5(x,t,r,o,A,s)),p&&(x=n[h].derivedCommands.tileset,i5(x,t,r,o,A,s));if(t.invertClassification){let T=e._commandsIgnoreShow,E=T.length;for(h=0;h<E;++h)A=l[h],x=T[h],i5(x,t,r,o,A,s)}}if(g.pick){let C=i.length,T=c._pickOffsets;for(h=0;h<C;++h){let E=T[Gee(h,C)];A=l[E.index],d&&(x=i[h],Wee(x,t,r,o,A)),p&&(x=i[h].derivedCommands.tileset,Wee(x,t,r,o,A))}}}J0.prototype.update=function(e){if(!u(this._primitive)&&!u(this.geometryInstances))return;let t=this.appearance;u(t)&&u(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!u(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,l=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=tu.hasAttributesForSphericalExtents(c),g=tu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let A=a.attributes.color;u(A)&&(l=!0),f=f&&u(A)&&zt.equals(d,A)}if(!f&&!p&&!g)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");l&&!u(t)&&(t=new sn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=l;let h=new Array(o);for(s=0;s<o;++s)a=r[s],h[s]=new Ct({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=h,u(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(A,x){n._createBoundingVolumeFunction(A,x)}),i._createRenderStatesFunction=function(A,x,C,T){m1e(n,x)},i._createShaderProgramFunction=function(A,x,C){p1e(n,x)},i._createCommandsFunction=function(A,x,C,T,E,S,w){y1e(n,void 0,void 0,!0,!1,S,w)},u(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){n._updateAndQueueCommandsFunction(A,x,C,T,E,S,w,D)}:i._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){A1e(n,x,C,T,E,S,w,D)},this._primitive=new Sn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(TT(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(TT(!1,!0)),this._rsColorPass=Ve.fromCache(r5(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(TT(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(TT(!0,!0)),this._rsColorPass=Ve.fromCache(r5(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{u(this._primitive)&&this._primitive.ready&&this._completeLoad()})};J0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};J0.prototype.isDestroyed=function(){return!1};J0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var ET=J0;var x1e={u_globeMinimumAltitude:function(){return 55e3}};function ml(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!u(t)&&u(n)){let o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){let c=o[a].attributes;if(u(c)&&u(c.color)){t=new sn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,zn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;let i=this;this._readyPromise=new Promise((o,s)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;u(a)?s(a):o(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=si._defaultMaxTerrainHeight,this._minTerrainHeight=si._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let r=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:r,_extruded:!0,_uniformMap:x1e}}Object.defineProperties(ml.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});ml.isSupported=ET.isSupported;function jee(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function qee(e){return function(t,n){return e._minHeight}}var C1e=new m,T1e=new m,E1e=new m,b1e=new he,S1e=new ce;function bU(e,t){let n=e.mapProjection.ellipsoid;if(!u(t.attributes)||!u(t.attributes.position3DHigh))return u(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=m.unpack(i,d,C1e),g=m.unpack(r,d,T1e),h=m.add(p,g,E1e),A=n.cartesianToCartographic(h,b1e),x=A.latitude,C=A.longitude;s=Math.min(s,x),a=Math.min(a,C),c=Math.max(c,x),l=Math.max(l,C)}let f=S1e;return f.north=c,f.south=s,f.east=l,f.west=a,f}function v1e(e,t,n){let i=si.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function w1e(e,t,n){let i=t.mapProjection.ellipsoid,r=bU(t,n),o=Mn.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function o5(e,t){return Math.floor(e%t/2)}function s5(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Yee(e,t,n,i,r,o){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function D1e(e,t,n,i,r,o,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let l=e.classificationType,f=l!==zn.CESIUM_3D_TILE,d=l!==zn.TERRAIN,p=t.passes,g=e._primitive,h,A,x;if(p.render){let C=n.length;for(h=0;h<C;++h)A=c[o5(h,C)],f&&(x=n[h],s5(e,x,t,r,o,A,s)),d&&(x=n[h].derivedCommands.tileset,s5(e,x,t,r,o,A,s));if(t.invertClassification){let T=g._commandsIgnoreShow,E=T.length;for(h=0;h<E;++h)A=c[h],x=T[h],s5(e,x,t,r,o,A,s)}}if(p.pick){let C=i.length,T;for(e._useFragmentCulling||(T=g._primitive._pickOffsets),h=0;h<C;++h){if(A=c[o5(h,C)],!e._useFragmentCulling){let E=T[o5(h,C)];A=c[E.index]}f&&(x=i[h],Yee(e,x,t,r,o,A)),d&&(x=i[h].derivedCommands.tileset,Yee(e,x,t,r,o,A))}}}ml.initializeTerrainHeights=function(){return si.initialize()};ml.prototype.update=function(e){if(!u(this._primitive)&&!u(this.geometryInstances))return;if(!si.initialized){ml.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!u(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,l=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let A=bU(e,o);u(d)?u(A)&&ce.union(d,A,d):d=ce.clone(A);let x=r.id;if(u(x)&&u(A)){let C=si.getBoundingSphere(A,i);this._boundingSpheresKeys.push(x),this._boundingSpheres.push(C)}s=o.constructor,!u(s)||u(s.createShadowVolume)}v1e(this,d,i);let p=e.terrainExaggeration,g=e.terrainExaggerationRelativeHeight;this._minHeight=Ic.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Ic.getHeight(this._maxTerrainHeight,p,g);let h=ml._supportsMaterials(e.context);if(this._useFragmentCulling=h,h){let A,x=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=bU(e,o),tu.shouldUseSphericalCoordinates(d)){x=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let C=bU(e,o),T=o.textureCoordinateRotationPoints;x?A=tu.getPlanarTextureCoordinateAttributes(C,T,i,e.mapProjection,this._maxHeight):A=tu.getSphericalExtentGeometryInstanceAttributes(C,T,i,e.mapProjection);let E=r.attributes;for(let S in E)E.hasOwnProperty(S)&&(A[S]=E[S]);l[f]=new Ct({geometry:s.createShadowVolume(o,qee(this),jee(this)),attributes:A,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,l[f]=new Ct({geometry:s.createShadowVolume(o,qee(this),jee(this)),attributes:r.attributes,id:r.id});n.geometryInstances=l,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(A,x){w1e(t,A,x)},n._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){D1e(t,x,C,T,E,S,w,D)},this._primitive=new ET(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&u(this._primitive)&&this._primitive.ready&&this._completeLoad()})};ml.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};ml.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};ml.prototype.isDestroyed=function(){return!1};ml.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};ml._supportsMaterials=function(e){return e.depthTexture};ml.supportsMaterials=function(e){return ml._supportsMaterials(e.frameState.context)};var Oc=ml;function bT(){fe.throwInstantiationError()}Object.defineProperties(bT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});bT.prototype.getType=fe.throwInstantiationError;bT.prototype.getValue=fe.throwInstantiationError;bT.prototype.equals=fe.throwInstantiationError;bT.getValue=function(e,t,n){let i;return u(t)&&(i=t.getType(e),u(i))?((!u(n)||n.type!==i)&&(n=Wi.fromType(i)),t.getValue(e,n.uniforms),n):((!u(n)||n.type!==Wi.ColorType)&&(n=Wi.fromType(Wi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Kr=bT;function Z0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Z0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};Z0.prototype._setOptions=fe.throwInstantiationError;Z0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!u(s.fill)||s.fill.getValue(e)){let l=t.fillMaterialProperty,f=l instanceof Vt,d,p=t._getIsClosed(c);if(f)d=new sn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Kr.getValue(e,l,this._material);this._material=g,d=new ur({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=sn.VERTEX_FORMAT,this._primitive=r.add(new Oc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Sn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&u(s.outline)&&s.outline.getValue(e)){let l=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Sn({geometryInstances:l,appearance:new sn({flat:!0,translucent:l.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Z0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return u(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),u(r)&&u(r.boundingSphere))?(ae.clone(r.boundingSphere,e),ut.DONE):u(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),u(r)&&u(r.boundingSphere))?(ae.clone(r.boundingSphere,e),ut.DONE):u(n)&&!n.ready||u(i)&&!i.ready?ut.PENDING:ut.FAILED};Z0.prototype.isDestroyed=function(){return!1};Z0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ai=Z0;var I1e={NONE:0,GEODESIC:1,RHUMB:2},Jt=Object.freeze(I1e);var Xee=P.EPSILON10;function P1e(e,t,n,i){if(!u(e))return;n=y(n,!1);let r=u(i),o=e.length;if(o<2)return e;let s,a=e[0],c,l,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,Xee)?(u(l)||(l=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(u(l)&&(l.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],Xee)&&(r&&(u(l)?i.splice(d,0,f):i.push(o-1)),u(l)?l.length-=1:l=e.slice(0,-1)),u(l)?l:e}var Sr=P1e;function O1e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),l=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,h=Math.sqrt(g),A=t/4,x=A*A,C=x*A,T=x*x,E=1+A-3*x/4+5*C/4-175*T/64,S=1-A+15*x/8-35*C/8,w=1-3*A+35*x/4,D=1-5*A,M=E*f-S*Math.sin(2*f)*A/2-w*Math.sin(4*f)*x/16-D*Math.sin(6*f)*C/48-Math.sin(8*f)*5*T/512,O=e._constants;O.a=n,O.b=i,O.f=r,O.cosineHeading=o,O.sineHeading=s,O.tanU=a,O.cosineU=c,O.sineU=l,O.sigma=f,O.sineAlpha=d,O.sineSquaredAlpha=p,O.cosineSquaredAlpha=g,O.cosineAlpha=h,O.u2Over4=A,O.u4Over16=x,O.u6Over64=C,O.u8Over256=T,O.a0=E,O.a1=S,O.a2=w,O.a3=D,O.distanceRatio=M}function M1e(e,t){return e*t*(4+e*(4-3*t))/16}function Kee(e,t,n,i,r,o,s){let a=M1e(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function R1e(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,l=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(l),p=Math.sin(l),g=Math.cos(f),h=Math.sin(f),A=d*g,x=d*h,C=p*h,T=p*g,E=c,S=P.TWO_PI,w=Math.cos(E),D=Math.sin(E),M,O,B,L,_;do{w=Math.cos(E),D=Math.sin(E);let U=x-T*w;B=Math.sqrt(g*g*D*D+U*U),O=C+A*w,M=Math.atan2(B,O);let Y;B===0?(Y=0,L=1):(Y=A*D/B,L=1-Y*Y),S=E,_=O-2*C/L,isFinite(_)||(_=0),E=c+Kee(a,Y,L,M,B,O,_)}while(Math.abs(E-S)>P.EPSILON12);let b=L*(t*t-n*n)/(n*n),v=1+b*(4096+b*(b*(320-175*b)-768))/16384,I=b*(256+b*(b*(74-47*b)-128))/1024,R=_*_,F=I*B*(_+I*(O*(2*R-1)-I*_*(4*B*B-3)*(4*R-3)/6)/4),k=n*v*(M-F),V=Math.atan2(g*D,x-T*w),G=Math.atan2(d*D,x*w-T);e._distance=k,e._startHeading=V,e._endHeading=G,e._uSquared=b}var B1e=new m,a5=new m;function Jee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,a5),B1e),o=m.normalize(i.cartographicToCartesian(n,a5),a5);R1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,O1e(e)}function _P(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,u(e)&&u(t)&&Jee(this,e,t,i)}Object.defineProperties(_P.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});_P.prototype.setEndPoints=function(e,t){Jee(this,e,t,this._ellipsoid)};_P.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};_P.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),l=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,A=n.u6Over64,x=n.u4Over16,C=2*p*g*r/3+i*(1-h+7*x/4-15*A/4+579*g/64-(x-15*A/4+187*g/16)*r-(5*A/4-115*g/16)*o-29*g*s/16)+(h/2-x+71*A/32-85*g/16)*a+(5*x/16-5*A/4+383*g/96)*c-d*((A-11*g/2)*a+5*g*c/2)+(29*A/96-29*g/16)*l+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),w=Math.sin(C),D=Math.cos(C),M=n.cosineU*D,O=n.sineU*w,L=Math.atan2(w*n.sineHeading,M-O*n.cosineHeading)-Kee(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,w,D,S);return u(t)?(t.longitude=this._start.longitude+L,t.latitude=E,t.height=0,t):new he(this._start.longitude+L,E,0)};var tf=_P;function l5(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,l=n,f=Math.sin(2*l),d=Math.sin(4*l),p=Math.sin(6*l),g=Math.sin(8*l),h=Math.sin(10*l),A=Math.sin(12*l);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*l-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*A)}function L1e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,l=c*c,f=l*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),A=Math.cos(2*i),x=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),w=Math.cos(8*i),D=Math.sin(10*i),M=Math.cos(10*i),O=Math.sin(12*i);return i+i*c/4+7*i*l/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*l/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*A+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*w+8011*i*g/1048576*M+(3*c/8+3*l/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*h+(21*l/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*x+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*S+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*O}function ST(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function N1e(e,t,n,i,r){let o=ST(e._ellipticity,n),s=ST(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function F1e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,l=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)l=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);l=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=l5(e._ellipticity,t,r);l=(l5(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(l)}var U1e=new m,c5=new m;function Zee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,c5),U1e),o=m.normalize(i.cartographicToCartesian(n,c5),c5),s=i.maximumRadius,a=i.minimumRadius,c=s*s,l=a*a;e._ellipticitySquared=(c-l)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=N1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=F1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Qee(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,l;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=l5(r,i,e.latitude),d=n*Math.cos(t),p=f+d;c=L1e(p,r,i);let g=ST(r,e.latitude),h=ST(r,c);l=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+l)}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}l=n/f,t>0?a=P.negativePiToPi(e.longitude+l):a=P.negativePiToPi(e.longitude-l)}return u(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function fp(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,u(e)&&u(t)&&Zee(this,e,t,i)}Object.defineProperties(fp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});fp.fromStartHeadingDistance=function(e,t,n,i,r){let o=y(i,re.WGS84),s=o.maximumRadius,a=o.minimumRadius,c=s*s,l=a*a,f=Math.sqrt((c-l)/c);t=P.negativePiToPi(t);let d=Qee(e,t,n,o.maximumRadius,f);return!u(r)||u(i)&&!i.equals(r.ellipsoid)?new fp(e,d,o):(r.setEndPoints(e,d),r)};fp.prototype.setEndPoints=function(e,t){Zee(this,e,t,this._ellipsoid)};fp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};fp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Qee(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};fp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),u(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),l=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/l,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};fp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=ST(n,r.latitude),s=ST(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return u(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var xa=fp;var g5=[Ii,Oi],V1e=g5.length,yte=Math.cos(P.toRadians(30)),$ee=Math.cos(P.toRadians(150)),Ate=0,xte=1e3;function hg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Jt.GEODESIC),this._ellipsoid=re.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(hg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});hg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<V1e;i++)if(t instanceof g5[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var k1e=new m,ete=new m,tte=new m;function _5(e,t,n,i,r){let o=Mc(i,e,0,k1e),s=Mc(i,e,n,ete),a=Mc(i,t,0,tte),c=dp(s,o,ete),l=dp(a,o,tte);return m.cross(l,c,r),m.normalize(r,r)}var z1e=new he,H1e=new m,G1e=new m,W1e=new m;function u5(e,t,n,i,r,o,s,a,c,l,f){if(r===0)return;let d;o===Jt.GEODESIC?d=new tf(e,t,s):o===Jt.RHUMB&&(d=new xa(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=_5(e,t,i,s,W1e),h=Math.ceil(p/r),A=p/h,x=A,C=h-1,T=a.length;for(let E=0;E<C;E++){let S=d.interpolateUsingSurfaceDistance(x,z1e),w=Mc(s,S,n,H1e),D=Mc(s,S,i,G1e);m.pack(g,a,T),m.pack(w,c,T),m.pack(D,l,T),f.push(S.latitude),f.push(S.longitude),T+=3,x+=A}}var f5=new he;function Mc(e,t,n,i){return he.clone(t,f5),f5.height=n,he.toCartesian(f5,e,i)}hg.pack=function(e,t,n){let i=y(n,0),r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,re.pack(e._ellipsoid,t,i),i+=re.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};hg.unpack=function(e,t,n){let i=y(t,0),r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],l=re.unpack(e,i);i+=re.packedLength;let f=e[i++],d=e[i++]===1;return u(n)||(n=new hg({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=l,n._projectionIndex=f,n._scene3DOnly=d,n};function dp(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function nte(e,t,n,i){return i=dp(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var j1e=new m,q1e=new m,Y1e=new m,Cte=new m,X1e=0,K1e=-1;function d5(e,t,n,i,r){let o=dp(n,t,Cte),s=nte(e,t,o,j1e),a=nte(i,t,o,q1e);if(P.equalsEpsilon(m.dot(s,a),K1e,P.EPSILON5))return r=m.cross(o,s,r),r=m.normalize(r,r),r;r=m.add(a,s,r),r=m.normalize(r,r);let c=m.cross(o,r,Y1e);return m.dot(a,c)<X1e&&(r=m.negate(r,r)),r}var DU=ln.fromPointNormal(m.ZERO,m.UNIT_Y),J1e=new m,Z1e=new m,Q1e=new m,$1e=new m,eOe=new m,SU=new m,vU=new he,ite=new he,rte=new he;hg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new g5[e._projectionIndex](i),a=Ate,c=xte,l,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,h,A,x,C=new xa(void 0,void 0,i),T,E,S,w=[d[0]];for(f=0;f<p-1;f++)g=d[f],h=d[f+1],T=Qi.lineSegmentPlane(g,h,DU,SU),u(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?w.push(m.clone(T)):e.arcType===Jt.RHUMB&&(S=i.cartesianToCartographic(T,vU).longitude,A=i.cartesianToCartographic(g,vU),x=i.cartesianToCartographic(h,ite),C.setEndPoints(A,x),E=C.findIntersectionWithLongitude(S,rte),T=i.cartographicToCartesian(E,SU),u(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&w.push(m.clone(T)))),w.push(h);n&&(g=d[p-1],h=d[0],T=Qi.lineSegmentPlane(g,h,DU,SU),u(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?w.push(m.clone(T)):e.arcType===Jt.RHUMB&&(S=i.cartesianToCartographic(T,vU).longitude,A=i.cartesianToCartographic(g,vU),x=i.cartesianToCartographic(h,ite),C.setEndPoints(A,x),E=C.findIntersectionWithLongitude(S,rte),T=i.cartographicToCartesian(E,SU),u(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&w.push(m.clone(T)))));let D=w.length,M=new Array(D);for(f=0;f<D;f++){let W=he.fromCartesian(w[f],i);W.height=0,M[f]=W}if(M=Sr(M,he.equalsEpsilon),D=M.length,D<2)return;let O=[],B=[],L=[],_=[],b=J1e,v=Z1e,I=Q1e,R=$1e,F=eOe,k=M[0],V=M[1],G=M[D-1];for(b=Mc(i,G,a,b),R=Mc(i,V,a,R),v=Mc(i,k,a,v),I=Mc(i,k,c,I),n?F=d5(b,v,I,R,F):F=_5(k,V,c,i,F),m.pack(F,B,0),m.pack(v,L,0),m.pack(I,_,0),O.push(k.latitude),O.push(k.longitude),u5(k,V,a,c,r,o,i,B,L,_,O),f=1;f<D-1;++f){b=m.clone(v,b),v=m.clone(R,v);let W=M[f];Mc(i,W,c,I),Mc(i,M[f+1],a,R),d5(b,v,I,R,F),l=B.length,m.pack(F,B,l),m.pack(v,L,l),m.pack(I,_,l),O.push(W.latitude),O.push(W.longitude),u5(M[f],M[f+1],a,c,r,o,i,B,L,_,O)}let U=M[D-1],Y=M[D-2];if(v=Mc(i,U,a,v),I=Mc(i,U,c,I),n){let W=M[0];b=Mc(i,Y,a,b),R=Mc(i,W,a,R),F=d5(b,v,I,R,F)}else F=_5(Y,U,c,i,F);if(l=B.length,m.pack(F,B,l),m.pack(v,L,l),m.pack(I,_,l),O.push(U.latitude),O.push(U.longitude),n){for(u5(U,k,a,c,r,o,i,B,L,_,O),l=B.length,f=0;f<3;++f)B[l+f]=B[f],L[l+f]=L[f],_[l+f]=_[f];O.push(k.latitude),O.push(k.longitude)}return vOe(n,s,L,_,B,O,t)};var tOe=new m,nOe=new Q,iOe=new Le;function ote(e,t,n,i){let r=dp(n,t,tOe),o=m.dot(r,e);if(o>yte||o<$ee){let s=dp(i,n,Cte),a=o<$ee?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,iOe),l=Q.fromQuaternion(c,nOe);return Q.multiplyByVector(l,e,e),!0}return!1}var ste=new he,rOe=new m,ate=new m;function gP(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,rOe),s=m.add(o,n,ate),a=!1,c=e._ellipsoid,l=c.cartesianToCartographic(s,ste);Math.abs(t.longitude-l.longitude)>P.PI_OVER_TWO&&(a=!0,s=m.subtract(o,n,ate),l=c.cartesianToCartographic(s,ste)),l.height=0;let f=e.project(l,r);return r=m.subtract(f,i,r),r.z=0,r=m.normalize(r,r),a&&m.negate(r,r),r}var oOe=new m,cte=new m;function lte(e,t,n,i,r,o){let s=m.subtract(t,e,oOe);m.normalize(s,s);let a=n-Ate,c=m.multiplyByScalar(s,a,cte);m.add(e,c,r);let l=i-xte;c=m.multiplyByScalar(s,l,cte),m.add(t,c,o)}var sOe=new m;function wU(e,t){let n=ln.getPointDistance(DU,e),i=ln.getPointDistance(DU,t),r=sOe;P.equalsEpsilon(n,0,P.EPSILON2)?(r=dp(t,e,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=dp(e,t,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(t,r,t))}function aOe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var Tte=new he,Ete=new he,ute=new m,m5=new m,fte=new m,dte=new m,cOe=new m,mte=new m,lOe=[Tte,Ete],uOe=new ce,fOe=new m,dOe=new m,mOe=new m,hOe=new m,pOe=new m,_Oe=new m,h5=new m,p5=new m,gOe=new m,yOe=new m,AOe=new m,hte=new m,xOe=new m,COe=new m,TOe=new qn,EOe=new qn,pte=new m,bOe=new m,_te=new m,SOe=[new ae,new ae],bte=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],gte=bte.length;function vOe(e,t,n,i,r,o,s){let a,c,l=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),A=new Float64Array(d*3),x=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),w,D,M,O;s&&(w=new Float32Array(p),D=new Float32Array(p),M=new Float32Array(p),O=new Float32Array(d*2));let B=o.length/2,L=0,_=Tte;_.height=0;let b=Ete;b.height=0;let v=ute,I=m5;if(s)for(c=0,a=1;a<B;a++)_.latitude=o[c],_.longitude=o[c+1],b.latitude=o[c+2],b.longitude=o[c+3],v=t.project(_,v),I=t.project(b,I),L+=m.distance(v,I),c+=2;let R=i.length/3;I=m.unpack(i,0,I);let F=0;for(c=3,a=1;a<R;a++)v=m.clone(I,v),I=m.unpack(i,c,I),F+=m.distance(v,I),c+=3;let k;c=3;let V=0,G=0,U=0,Y=0,W=!1,J=m.unpack(n,0,dte),j=m.unpack(i,0,m5),K=m.unpack(r,0,mte);if(e){let Ce=m.unpack(n,n.length-6,fte);ote(K,Ce,J,j)&&(K=m.negate(K,K))}let Z=0,me=0,ye=0;for(a=0;a<f;a++){let Ce=m.clone(J,fte),Re=m.clone(j,ute),tt=m.clone(K,cOe);W&&(tt=m.negate(tt,tt)),J=m.unpack(n,c,dte),j=m.unpack(i,c,m5),K=m.unpack(r,c,mte),W=ote(K,Ce,J,j),_.latitude=o[V],_.longitude=o[V+1],b.latitude=o[V+2],b.longitude=o[V+3];let nt,Wt,un,pt;if(s){let Di=aOe(_,b);nt=t.project(_,pOe),Wt=t.project(b,_Oe);let Vo=dp(Wt,nt,pte);Vo.y=Math.abs(Vo.y),un=h5,pt=p5,Di===0||m.dot(Vo,m.UNIT_Y)>yte?(un=gP(t,_,tt,nt,h5),pt=gP(t,b,K,Wt,p5)):Di===1?(pt=gP(t,b,K,Wt,p5),un.x=0,un.y=P.sign(_.longitude-Math.abs(b.longitude)),un.z=0):(un=gP(t,_,tt,nt,h5),pt.x=0,pt.y=P.sign(_.longitude-b.longitude),pt.z=0)}let gn=m.distance(Re,j),Bn=qn.fromCartesian(Ce,TOe),Ut=m.subtract(J,Ce,gOe),kt=m.normalize(Ut,hte),Ee=m.subtract(Re,Ce,yOe);Ee=m.normalize(Ee,Ee);let xe=m.cross(kt,Ee,hte);xe=m.normalize(xe,xe);let ft=m.cross(Ee,tt,xOe);ft=m.normalize(ft,ft);let di=m.subtract(j,J,AOe);di=m.normalize(di,di);let Xe=m.cross(K,di,COe);Xe=m.normalize(Xe,Xe);let Xi=gn/F,Or=Z/F,Jo=0,Uo,xs,Ue,ot=0,Ge=0;if(s){Jo=m.distance(nt,Wt),Uo=qn.fromCartesian(nt,EOe),xs=m.subtract(Wt,nt,pte),Ue=m.normalize(xs,bOe);let Di=Ue.x;Ue.x=Ue.y,Ue.y=-Di,ot=Jo/L,Ge=me/L}for(k=0;k<8;k++){let Di=Y+k*4,Vo=G+k*2,Gn=Di+3,vn=k<4?1:-1,Wn=k===2||k===3||k===6||k===7?1:-1;m.pack(Bn.high,x,Di),x[Gn]=Ut.x,m.pack(Bn.low,C,Di),C[Gn]=Ut.y,m.pack(ft,T,Di),T[Gn]=Ut.z,m.pack(Xe,E,Di),E[Gn]=Xi*vn,m.pack(xe,S,Di);let Ci=Or*Wn;Ci===0&&Wn<0&&(Ci=9),S[Gn]=Ci,s&&(w[Di]=Uo.high.x,w[Di+1]=Uo.high.y,w[Di+2]=Uo.low.x,w[Di+3]=Uo.low.y,M[Di]=-un.y,M[Di+1]=un.x,M[Di+2]=pt.y,M[Di+3]=-pt.x,D[Di]=xs.x,D[Di+1]=xs.y,D[Di+2]=Ue.x,D[Di+3]=Ue.y,O[Vo]=ot*vn,Ci=Ge*Wn,Ci===0&&Wn<0&&(Ci=9),O[Vo+1]=Ci)}let Je=mOe,it=hOe,Lt=fOe,_n=dOe,mr=ce.fromCartographicArray(lOe,uOe),Er=si.getMinimumMaximumHeights(mr,l),Cs=Er.minimumTerrainHeight,Ts=Er.maximumTerrainHeight;ye+=Cs,ye+=Ts,lte(Ce,Re,Cs,Ts,Je,Lt),lte(J,j,Cs,Ts,it,_n);let mo=m.multiplyByScalar(xe,P.EPSILON5,_te);m.add(Je,mo,Je),m.add(it,mo,it),m.add(Lt,mo,Lt),m.add(_n,mo,_n),wU(Je,it),wU(Lt,_n),m.pack(Je,A,U),m.pack(it,A,U+3),m.pack(_n,A,U+6),m.pack(Lt,A,U+9),mo=m.multiplyByScalar(xe,-2*P.EPSILON5,_te),m.add(Je,mo,Je),m.add(it,mo,it),m.add(Lt,mo,Lt),m.add(_n,mo,_n),wU(Je,it),wU(Lt,_n),m.pack(Je,A,U+12),m.pack(it,A,U+15),m.pack(_n,A,U+18),m.pack(Lt,A,U+21),V+=2,c+=3,G+=16,U+=24,Y+=32,Z+=gn,me+=Jo}c=0;let se=0;for(a=0;a<f;a++){for(k=0;k<gte;k++)h[c+k]=bte[k]+se;se+=8,c+=gte}let pe=SOe;ae.fromVertices(n,m.ZERO,3,pe[0]),ae.fromVertices(i,m.ZERO,3,pe[1]);let Ae=ae.fromBoundingSpheres(pe);Ae.radius+=ye/(f*2);let De={position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:A}),startHiAndForwardOffsetX:mg(x),startLoAndForwardOffsetY:mg(C),startNormalAndForwardOffsetZ:mg(T),endNormalAndTextureCoordinateNormalizationX:mg(E),rightNormalAndTextureCoordinateNormalizationY:mg(S)};return s&&(De.startHiLo2D=mg(w),De.offsetAndRight2D=mg(D),De.startEndNormals2D=mg(M),De.texcoordNormalization2D=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:O})),new dt({attributes:De,indices:h,boundingSphere:Ae})}function mg(e){return new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}hg._projectNormal=gP;var Q0=hg;var yP=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; // Technically can compute distance for this here -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif -void main(void) +mat3 czm_transpose(mat3 matrix) { - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); + return mat3( + matrix[0][0], matrix[1][0], matrix[2][0], + matrix[0][1], matrix[1][1], matrix[2][1], + matrix[0][2], matrix[1][2], matrix[2][2]); +} - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME +mat4 czm_transpose(mat4 matrix) +{ + return mat4( + matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], + matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], + matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], + matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); +} +`;var P1=`/** + * Unpacks a vec4 depth value to a float in [0, 1) range. + * + * @name czm_unpackDepth + * @glslFunction + * + * @param {vec4} packedDepth The packed depth. + * + * @returns {float} The floating-point depth in [0, 1) range. + */ + float czm_unpackDepth(vec4 packedDepth) + { + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); + } +`;var D1=`/** + * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. + * + * @name czm_unpackFloat + * @glslFunction + * + * @param {vec4} packedFloat The packed float. + * + * @returns {float} The floating-point depth in arbitrary range. + */ +float czm_unpackFloat(vec4 packedFloat) +{ + // Convert to [0.0, 255.0] and round to integer + packedFloat = floor(packedFloat * 255.0 + 0.5); + float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; + float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; + if (exponent == -127.0) + { + return 0.0; } + float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); + float result = sign * exp2(exponent - 23.0) * mantissa; + return result; +} +`;var R1=`/** + * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, + * so the return value is an int. + * <p> + * There are also precision limitations in WebGL 1. highp int is still limited + * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. + * </p> + * + * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * + * @return {int} The unpacked value. + */ + int czm_unpackUint(float packedValue) { + float rounded = czm_round(packedValue * 255.0); + return int(rounded); + } - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + int czm_unpackUint(vec2 packedValue) { + vec2 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec2(1.0, 256.0))); + } - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); + int czm_unpackUint(vec3 packedValue) { + vec3 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); + } - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } + int czm_unpackUint(vec4 packedValue) { + vec4 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); + } +`;var O1=`/** + * Transform metadata values following the EXT_structural_metadata spec + * by multiplying by scale and adding the offset. Operations are always + * performed component-wise, even for matrices. + * + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * + * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + */ +float czm_valueTransform(float offset, float scale, float value) { + return scale * value + offset; +} - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { + return scale * value + offset; +} - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { + return scale * value + offset; +} - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); +vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { + return scale * value + offset; +} - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { + return matrixCompMult(scale, value) + offset; +} -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { + return matrixCompMult(scale, value) + offset; +} - czm_materialInput materialInput; +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { + return matrixCompMult(scale, value) + offset; +} +`;var M1=`#ifdef LOG_DEPTH +// 1.0 at the near plane, increasing linearly from there. +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; +#endif +#endif - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR +#ifdef SHADOW_MAP + vec3 logPositionEC = (czm_inverseProjection * coords).xyz; + v_logPositionEC = logPositionEC; +#endif - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; + // With the very high far/near ratios used with the logarithmic depth + // buffer, floating point rounding errors can cause linear depth values + // to end up on the wrong side of the far plane, even for vertices that + // are really nowhere near it. Since we always write a correct logarithmic + // depth value in the fragment shader anyway, we just need to make sure + // such errors don't cause the primitive to be clipped entirely before + // we even get to the fragment shader. + coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; +#endif - czm_writeDepthClamp(); + return coords; } -`;var AP=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; +/** + * Writes the logarithmic depth to gl_Position using the already computed gl_Position. + * + * @name czm_vertexLogDepth + * @glslFunction + */ +void czm_vertexLogDepth() +{ +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; + gl_Position = czm_updatePositionDepth(gl_Position); #endif - -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -void main(void) +/** + * Writes the logarithmic depth to gl_Position using the provided clip coordinates. + * <p> + * An example use case for this function would be moving the vertex in window coordinates + * before converting back to clip coordinates. Use the original vertex clip coordinates. + * </p> + * @name czm_vertexLogDepth + * @glslFunction + * + * @param {vec4} clipCoords The vertex in clip coordinates. + * + * @example + * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + */ +void czm_vertexLogDepth(vec4 clipCoords) { - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; + czm_updatePositionDepth(clipCoords); +#endif +} +`;var L1=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +{ + // Reconstruct NDC coordinates + float x = 2.0 * screenCoordinate.x - 1.0; + float y = 2.0 * screenCoordinate.y - 1.0; + float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 q = vec4(x, y, z, 1.0); - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); + // Reverse the perspective division to obtain clip coordinates. + q /= screenCoordinate.w; - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + // Reverse the projection transformation to obtain eye coordinates. + if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s + { + q = czm_inverseProjection * q; + } + else + { + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; - czm_materialInput materialInput; + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); + q.x = (q.x * (right - left) + left + right) * 0.5; + q.y = (q.y * (top - bottom) + bottom + top) * 0.5; + q.z = (q.z * (near - far) - near - far) * 0.5; + q.w = 1.0; + } - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR + return q; } -`;var xP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; +/** + * Transforms a position from window to eye coordinates. + * The transform from window to normalized device coordinates is done using components + * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating + * the inverse of <code>czm_viewportTransformation</code>. The transformation from + * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>, + * which is expected to be the scalar used in the perspective divide. The transformation + * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec4} fragmentCoordinate The position in window coordinates to transform. + * + * @returns {vec4} The transformed position in eye coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @example + * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + */ +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +{ + vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); +} -in float batchId; +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +{ + // See reverseLogDepth.glsl. This is separate to re-use the pow. +#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + float depthFromCamera = depthFromNear + near; + vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); + eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision + return eyeCoordinate; +#else + vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +#endif + return eyeCoordinate; +} -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; +/** + * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. + * This function produces more accurate results for window positions with log depth than + * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version + * of czm_windowToEyeCoordinates. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. + * @param {float} depthOrLogDepth A depth or log depth for the fragment. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @returns {vec4} The transformed position in eye coordinates. + */ +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +{ + vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +} +`;var N1=`// emulated noperspective +#if !defined(LOG_DEPTH) +in float v_WindowZ; +#endif -// For materials -#ifdef WIDTH_VARYING -out float v_width; +/** + * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane + * by writing the fragment's depth. See czm_depthClamp for more details. + * + * @name czm_writeDepthClamp + * @glslFunction + * + * @example + * out_FragColor = color; + * czm_writeDepthClamp(); + * + * @see czm_depthClamp + */ +void czm_writeDepthClamp() +{ +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; +} +`;var F1=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; + +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; #endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; #endif -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() +/** + * Writes the fragment depth to the logarithmic depth buffer. + * <p> + * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when + * ray-casting geometry using a full screen quad. + * </p> + * @name czm_writeLogDepth + * @glslFunction + * + * @param {float} depth The depth coordinate, where 1.0 is on the near plane and + * depth increases in eye-space units from there + * + * @example + * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + */ +void czm_writeLogDepth(float depth) { - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + // Discard the vertex if it's not between the near and far planes. + // We allow a bit of epsilon on the near plane comparison because a 1.0 + // from the vertex shader (indicating the vertex should be _on_ the near + // plane) will not necessarily come here as exactly 1.0. + if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { + discard; + } - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); +#ifdef POLYGON_OFFSET + // Polygon offset: m * factor + r * units + float factor = u_polygonOffset[0]; + float units = u_polygonOffset[1]; - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // This factor doesn't work in IE 10 + if (factor != 0.0) { + // m = sqrt(dZdX^2 + dZdY^2); + float x = dFdx(depth); + float y = dFdy(depth); + float m = sqrt(x * x + y * y); - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); + // Apply the factor before computing the log depth. + depth += m * factor; + } +#endif - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); +#endif - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates +#ifdef POLYGON_OFFSET + // Apply the units after the log depth. + gl_FragDepth += czm_epsilon7 * units; +#endif - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR +#endif +} -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; +/** + * Writes the fragment depth to the logarithmic depth buffer. + * <p> + * Use this when the vertex shader calls {@link czm_vertexlogDepth}. + * </p> + * + * @name czm_writeLogDepth + * @glslFunction + */ +void czm_writeLogDepth() { +#ifdef LOG_DEPTH + czm_writeLogDepth(v_depthFromNearPlusOne); #endif +} +`;var B1=`/** + * Transforms a value for non-perspective interpolation by multiplying + * it by w, the value used in the perspective divide. This function is + * intended to be called in a vertex shader to compute the value of a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The fragment shader + * must call {@link czm_readNonPerspective} to retrieve the final + * non-perspective value. + * + * @name czm_writeNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. + * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. + * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the + * fragment shader with {@link czm_readNonPerspective}. + */ +float czm_writeNonPerspective(float value, float w) { + return value * w; +} - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. +vec2 czm_writeNonPerspective(vec2 value, float w) { + return value * w; +} - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. +vec3 czm_writeNonPerspective(vec3 value, float w) { + return value * w; +} - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; +vec4 czm_writeNonPerspective(vec4 value, float w) { + return value * w; +} +`;var k1=`/** + * Converts a CIE Yxy color to RGB. + * <p>The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + * </p> + * + * @name czm_XYZToRGB + * @glslFunction + * + * @param {vec3} Yxy The color in CIE Yxy. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_XYZToRGB(vec3 Yxy) +{ + const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, + -1.5371, 1.8760, -0.2040, + -0.4985, 0.0416, 1.0572); + vec3 xyz; + xyz.r = Yxy.r * Yxy.g / Yxy.b; + xyz.g = Yxy.r; + xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; + + return XYZ2RGB * xyz; +} +`;var U1=`vec3 czm_fromCartesian(vec3 position) { + vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); + vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); + float centerToleranceSquared = 0.1; - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); + n = normalize(n); - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + vec3 h = p - position; - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; + float longitude = atan(n.y, n.x); + float latitude = asin(n.z); - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif + float dotNum = dot(h, position); + // float height = MathSign(dotNum)*czm_magnitude(h); + float height = czm_magnitude(h); - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + vec3 result; + result.x = longitude; + result.y = latitude; + result.z = height; + return result; +}`;var V1=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ + for(int i=0;i<=16;i++){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ + if(xyxy[0][0]<minx){ + minx = xyxy[0][0]; + } + if(xyxy[0][0]>maxx){ + maxx = xyxy[0][0]; + } - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + if(xyxy[0][1]<miny){ + miny = xyxy[0][1]; + } + if(xyxy[0][1]>maxy){ + maxy = xyxy[0][1]; + } -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif + if(xyxy[0][2]<minz){ + minz = xyxy[0][2]; + } + if(xyxy[0][2]>maxz){ + maxz = xyxy[0][2]; + } + } + } + return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); } -`;var CP=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif -in float batchId; -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif +`;var z1=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); + if(index==0){ + return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); + } + if(index==1){ + return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); + } + if(index==2){ + return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); + } + if(index==3){ + return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); + } + if(index==4){ + return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); + } + if(index==5){ + return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); + } + if(index==6){ + return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); + } + if(index==7){ + return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); + } + if(index==8){ + return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); + } + if(index==9){ + return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); + } + if(index==10){ + return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); + } + if(index==11){ + return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); + } + if(index==12){ + return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); + } + if(index==13){ + return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); + } + if(index==14){ + return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); + } + if(index==15){ + return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); + } +}`;var H1=`int czm_getMaxIndex(mat4 yp_mat_x){ + if(yp_mat_x[3][3]!=0.0){ + return 16; + } + if(yp_mat_x[3][2]!=0.0){ + return 15; + } + if(yp_mat_x[3][1]!=0.0){ + return 14; + } + if(yp_mat_x[3][0]!=0.0){ + return 15; + } + if(yp_mat_x[2][3]!=0.0){ + return 12; + } + if(yp_mat_x[2][2]!=0.0){ + return 11; + } + if(yp_mat_x[2][1]!=0.0){ + return 10; + } + if(yp_mat_x[2][0]!=0.0){ + return 9; + } + if(yp_mat_x[1][3]!=0.0){ + return 8; + } + if(yp_mat_x[1][2]!=0.0){ + return 7; + } + if(yp_mat_x[1][1]!=0.0){ + return 6; + } + if(yp_mat_x[1][0]!=0.0){ + return 5; + } + if(yp_mat_x[0][3]!=0.0){ + return 4; + } + if(yp_mat_x[0][2]!=0.0){ + return 3; + } + if(yp_mat_x[0][1]!=0.0){ + return 2; + } + if(yp_mat_x[0][0]!=0.0){ + return 1; + } +}`;var G1=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + if(yp_max_index==0){ + return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); + } + if(yp_max_index==1){ + return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); + } + if(yp_max_index==2){ + return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); + } + if(yp_max_index==3){ + return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); + } + if(yp_max_index==4){ + return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); + } + if(yp_max_index==5){ + return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); + } + if(yp_max_index==6){ + return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); + } + if(yp_max_index==7){ + return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); + } + if(yp_max_index==8){ + return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); + } + if(yp_max_index==9){ + return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); + } + if(yp_max_index==10){ + return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); + } + if(yp_max_index==11){ + return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); + } + if(yp_max_index==12){ + return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); + } + if(yp_max_index==13){ + return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); + } + if(yp_max_index==14){ + return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); + } + if(yp_max_index==15){ + return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); + } +}`;var W1=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + float pz = position.z; + if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ + vec3 lonlat = czm_fromCartesian(position); + px = lonlat.x; + py = lonlat.y; + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); + vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); + vec3 llh1 = czm_fromCartesian(pos1); + vec3 llh2 = czm_fromCartesian(pos2); + float sx = llh1.x; + float sy = llh1.y; + float tx = llh2.x; + float ty = llh2.y; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } + } + } + } + return isIn ? true : false; +}`;var j1=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + if(currVal.x!=0.0&&currVal.y!=0.0){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + float sx = xyxy[0][0]; + float sy = xyxy[0][1]; + float tx = xyxy[1][0]; + float ty = xyxy[1][1]; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } + } + } + } + } + return isIn ? true : false; +}`;var q1=`float czm_magnitude(vec3 cartesian3) { + return sqrt(czm_magnitudeSquared(cartesian3)); +}`;var Y1=`float czm_magnitudeSquared (vec3 cartesian4) { + return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; +}`;var X1=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { + vec3 result; + result.x = left.x * right.x; + result.y = left.y * right.y; + result.z = left.z * right.z; + return result; +}`;var K1=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif + float positionX = cartesian1.x; + float positionY = cartesian1.y; + float positionZ = cartesian1.z; -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; + float oneOverRadiiX = oneOverRadii.x; + float oneOverRadiiY = oneOverRadii.y; + float oneOverRadiiZ = oneOverRadii.z; - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); + float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; + float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; + float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + // Compute the squared ellipsoid norm. + float squaredNorm = x2 + y2 + z2; + float ratio = sqrt(1.0 / squaredNorm); - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + // As an initial approximation, assume that the radial intersection is the projection point. + vec3 intersection = cartesian1*ratio; - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; - - vec3 forwardDirectionEC = normalize(offset); - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + float oneOverRadiiSquaredX = oneOverRadiiSquared.x; + float oneOverRadiiSquaredY = oneOverRadiiSquared.y; + float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + // Use the gradient at the intersection point in place of the true unit normal. + // The difference in magnitude will be absorbed in the multiplier. + vec3 gradient; + gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; + gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; + gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + // Compute the initial guess at the normal vector multiplier, lambda. + float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); + float correction = 0.0; - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + float func; + float denominator; + float xMultiplier; + float yMultiplier; + float zMultiplier; + float xMultiplier2; + float yMultiplier2; + float zMultiplier2; + float xMultiplier3; + float yMultiplier3; + float zMultiplier3; + func = 1.0; + for(int i=0;i<9;i++){ + if(abs(func) > 0.000000000001){ + lambda -= correction; -#endif // COLUMBUS_VIEW_2D + xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); + yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); + zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + xMultiplier2 = xMultiplier * xMultiplier; + yMultiplier2 = yMultiplier * yMultiplier; + zMultiplier2 = zMultiplier * zMultiplier; -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR + xMultiplier3 = xMultiplier2 * xMultiplier; + yMultiplier3 = yMultiplier2 * yMultiplier; + zMultiplier3 = zMultiplier2 * zMultiplier; - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); + func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + // "denominator" here refers to the use of this expression in the velocity and acceleration + // computations in the sections to follow. + denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; + float derivative = -2.0 * denominator; - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + correction = func / derivative; + + }else{ + break; + } + } - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; + vec3 result; + result.x = positionX * xMultiplier; + result.y = positionY * yMultiplier; + result.z = positionZ * zMultiplier; + return result; +}`;var V0={czm_degreesPerRadian:_w,czm_depthRange:gw,czm_epsilon1:yw,czm_epsilon2:xw,czm_epsilon3:bw,czm_epsilon4:Cw,czm_epsilon5:Tw,czm_epsilon6:Aw,czm_epsilon7:Ew,czm_infinity:Sw,czm_oneOverPi:vw,czm_oneOverTwoPi:ww,czm_passCesium3DTile:Iw,czm_passCesium3DTileClassification:Pw,czm_passCesium3DTileClassificationIgnoreShow:Dw,czm_passClassification:Rw,czm_passCompute:Ow,czm_passEnvironment:Mw,czm_passGlobe:Lw,czm_passOpaque:Nw,czm_passOverlay:Fw,czm_passTerrainClassification:Bw,czm_passTranslucent:kw,czm_passVoxels:Uw,czm_pi:Vw,czm_piOverFour:zw,czm_piOverSix:Hw,czm_piOverThree:Gw,czm_piOverTwo:Ww,czm_radiansPerDegree:jw,czm_sceneMode2D:qw,czm_sceneMode3D:Yw,czm_sceneModeColumbusView:Xw,czm_sceneModeMorphing:Kw,czm_solarRadius:Jw,czm_threePiOver2:Zw,czm_twoPi:$w,czm_webMercatorMaxLatitude:Qw,czm_depthRangeStruct:eI,czm_material:tI,czm_materialInput:nI,czm_modelMaterial:iI,czm_modelVertexOutput:rI,czm_pbrParameters:oI,czm_ray:sI,czm_raySegment:aI,czm_shadowParameters:cI,czm_acesTonemapping:lI,czm_alphaWeight:uI,czm_antialias:fI,czm_approximateSphericalCoordinates:dI,czm_backFacing:mI,czm_branchFreeTernary:hI,czm_cascadeColor:pI,czm_cascadeDistance:_I,czm_cascadeMatrix:gI,czm_cascadeWeights:yI,czm_columbusViewMorph:xI,czm_computePosition:bI,czm_cosineAndSine:CI,czm_decompressTextureCoordinates:TI,czm_defaultPbrMaterial:AI,czm_depthClamp:EI,czm_eastNorthUpToEyeCoordinates:SI,czm_ellipsoidContainsPoint:vI,czm_ellipsoidWgs84TextureCoordinates:wI,czm_equalsEpsilon:II,czm_eyeOffset:PI,czm_eyeToWindowCoordinates:DI,czm_fastApproximateAtan:RI,czm_fog:OI,czm_gammaCorrect:MI,czm_geodeticSurfaceNormal:LI,czm_getDefaultMaterial:NI,czm_getLambertDiffuse:FI,czm_getSpecular:BI,czm_getWaterNoise:kI,czm_HSBToRGB:UI,czm_HSLToRGB:VI,czm_hue:zI,czm_inverseGamma:HI,czm_isEmpty:GI,czm_isFull:WI,czm_latitudeToWebMercatorFraction:jI,czm_linearToSrgb:qI,czm_lineDistance:YI,czm_luminance:XI,czm_metersPerPixel:KI,czm_modelToWindowCoordinates:JI,czm_multiplyWithColorBalance:ZI,czm_nearFarScalar:$I,czm_octDecode:QI,czm_packDepth:e1,czm_pbrLighting:t1,czm_pbrMetallicRoughnessMaterial:n1,czm_pbrSpecularGlossinessMaterial:i1,czm_phong:r1,czm_planeDistance:o1,czm_pointAlongRay:s1,czm_rayEllipsoidIntersectionInterval:a1,czm_raySphereIntersectionInterval:c1,czm_readDepth:l1,czm_readNonPerspective:u1,czm_reverseLogDepth:f1,czm_RGBToHSB:d1,czm_RGBToHSL:m1,czm_RGBToXYZ:h1,czm_round:p1,czm_sampleOctahedralProjection:_1,czm_saturation:g1,czm_shadowDepthCompare:y1,czm_shadowVisibility:x1,czm_signNotZero:b1,czm_sphericalHarmonics:C1,czm_srgbToLinear:T1,czm_tangentToEyeSpaceMatrix:A1,czm_textureCube:E1,czm_transformPlane:S1,czm_translateRelativeToEye:v1,czm_translucentPhong:w1,czm_transpose:I1,czm_unpackDepth:P1,czm_unpackFloat:D1,czm_unpackUint:R1,czm_valueTransform:O1,czm_vertexLogDepth:M1,czm_windowToEyeCoordinates:L1,czm_writeDepthClamp:N1,czm_writeLogDepth:F1,czm_writeNonPerspective:B1,czm_XYZToRGB:k1,czm_fromCartesian:U1,czm_getFloodRect:V1,czm_getIndexMat:z1,czm_getMaxIndex:H1,czm_getMaxIndexVal:G1,czm_isInEllipsoid:W1,czm_isInObliq:j1,czm_magnitude:q1,czm_magnitudeSquared:Y1,czm_multiplyComponents:X1,czm_scaleToGeodeticSurface:K1};function Vwe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable +${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable +${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable #endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); +${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 +${n}`,n}var J1=Vwe;function pQ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` +`;return i})}function _Q(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=pQ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function gQ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&Ss._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=_Q(i,Ss._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),gQ(r,t)}}))}function zwe(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function Hwe(e){let t=[],n=_Q("main",e,t);gQ(n,t),zwe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +`;return i.replace(n.glslSource,"")}function yQ(e,t,n){let i,r,o="",s=e.sources;if(l(s))for(i=0,r=s.length;i<r;++i)o+=` +#line 0 +${s[i]}`;o=pQ(o);let a;o=o.replace(/#version\s+(.*?)\n/gm,function(x,b){return a=b,` +`});let c=[];o=o.replace(/#extension.*\n/gm,function(x){return c.push(x),` +`}),o=o.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;l(u)&&(o=Ss.createPickFragmentShaderSource(o,u));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp int; #else - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + precision mediump float; + precision mediump int; + #define highp mediump #endif - positionEC.xyz += width * normalEC; - gl_Position = czm_depthClamp(czm_projection * positionEC); +`);let p=e.defines;if(l(p))for(i=0,r=p.length;i<r;++i){let x=p[i];x.length!==0&&(f+=`#define ${x} +`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var TP=`in vec3 position3DHigh; +`),n.floatingPointTexture&&(f+=`#define OES_texture_float + +`);let g="";e.includeBuiltIns&&(g=Hwe(o)),f+=` +#line 0 +`;let h=g+o;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(h)&&!/czm_out_FragColor/g.test(h)&&/out_FragColor/g.test(h)&&(f+=`layout(location = 0) out vec4 out_FragColor; + +`),f+=g,f+=o,n.webgl2?f=`#version 300 es +${f}`:f=J1(f,t),f}function Ss(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Ss.prototype.clone=function(){return new Ss({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ss.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ss.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(` +`);return`${t}:${n}:${i}:${r}`};Ss.prototype.createCombinedVertexShader=function(e){return yQ(this,!1,e)};Ss.prototype.createCombinedFragmentShader=function(e){return yQ(this,!0,e)};Ss._czmBuiltinsAndUniforms={};for(let e in V0)V0.hasOwnProperty(e)&&(Ss._czmBuiltinsAndUniforms[e]=V0[e]);for(let e in rp)if(rp.hasOwnProperty(e)){let t=rp[e];typeof t.getDeclaration=="function"&&(Ss._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ss.createPickVertexShaderSource=function(e){return`${Ss.replaceMain(e,"czm_old_main")} +in vec4 pickColor; +out vec4 czm_pickColor; +void main() +{ + czm_old_main(); + czm_pickColor = pickColor; +}`};Ss.createPickFragmentShaderSource=function(e,t){let n=Ss.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +void main() +{ + czm_old_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = czm_pickColor; +}`;return`${n} +${i}`};function Gwe(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function xQ(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function bQ(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(xQ(e,r))return r}}var Wwe=["v_normalEC","v_normal"];Ss.findNormalVarying=function(e){return xQ(e,"#ifdef HAS_NORMALS")?Gwe(e,"HAS_NORMALS")?"v_normalEC":void 0:bQ(e,Wwe)};var jwe=["v_positionEC"];Ss.findPositionVarying=function(e){return bQ(e,jwe)};var ze=Ss;var Z1=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; in float batchId; +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; + +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY + +#ifdef PER_INSTANCE_COLOR out vec4 v_color; +#endif // PER_INSTANCE_COLOR + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES void main() { - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; + vec4 position = czm_computePosition(); - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); +#endif - v_color = color; -} -`;var nu=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES - clipped = true; - } - } +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } +`;var fg=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +void main(void) { - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); #endif + czm_writeDepthClamp(); +} +`;var CQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};CQ.NUMBER_OF_CLASSIFICATION_TYPES=3;var Gn=Object.freeze(CQ);var qwe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Wa=Object.freeze(qwe);function zm(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}zm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var sp={high:0,low:0};zm.fromCartesian=function(e,t){l(t)||(t=new zm);let n=t.high,i=t.low;return zm.encode(e.x,sp),n.x=sp.high,i.x=sp.low,zm.encode(e.y,sp),n.y=sp.high,i.y=sp.low,zm.encode(e.z,sp),n.z=sp.high,i.z=sp.low,t};var H8=new zm;zm.writeElements=function(e,t,n){zm.fromCartesian(e,H8);let i=H8.high,r=H8.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Yn=zm;function Ywe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var $1=Ywe;var mk={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===mk.STREAM_DRAW||e===mk.STATIC_DRAW||e===mk.DYNAMIC_DRAW}},Fe=Object.freeze(mk);var vs={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};vs.getSizeInBytes=function(e){switch(e){case vs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case vs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case vs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};vs.fromSizeInBytes=function(e){switch(e){case 2:return vs.UNSIGNED_SHORT;case 4:return vs.UNSIGNED_INT;case 1:return vs.UNSIGNED_BYTE}};vs.validate=function(e){return l(e)&&(e===vs.UNSIGNED_BYTE||e===vs.UNSIGNED_SHORT||e===vs.UNSIGNED_INT)};vs.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return vs.UNSIGNED_INT};var Be=Object.freeze(vs);function Xu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=qn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Xu.createVertexBuffer=function(e){return new Xu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Xu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Be.getSizeInBytes(n),r=new Xu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Xu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Xu.prototype._getBuffer=function(){return this._buffer};Xu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Xu.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Xu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Xu.prototype.isDestroyed=function(){return!1};Xu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var mt=Xu;function Xwe(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function AQ(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)Xwe(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),AQ(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function TQ(e){return e.values.length/e.componentsPerAttribute}function Kwe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Jwe(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=TQ(e[r[0]]),t=1;t<s;++t){let u=TQ(e[r[t]]);if(u!==o)throw new de(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=Kwe(i);if(a>0){let u=X.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let h=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/h,strideInComponentType:a/h}}for(t=0;t<o;++t)for(let h=0;h<s;++h){n=r[h],i=e[n];let x=i.values,b=g[n],C=b.pointer,A=i.componentsPerAttribute;for(let T=0;T<A;++T)C[b.index+T]=x[t*A+T];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}ap.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),r=y(e.attributeLocations,y.EMPTY_OBJECT),o=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let h=Jwe(d);if(l(h)){u=mt.createVertexBuffer({context:t,typedArray:h.buffer,usage:i});let x=h.offsetsInBytes,b=h.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let h=c.componentDatatype;h===X.DOUBLE&&(h=X.FLOAT),u=void 0,l(c.values)&&(u=mt.createVertexBuffer({context:t,typedArray:X.createTypedArray(h,c.values),usage:i})),f.push({index:r[a],vertexBuffer:u,value:c.value,componentDatatype:h,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(ft.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Be.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Be.UNSIGNED_SHORT})),new ap({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(ap.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});ap.prototype.getAttribute=function(e){return this._attributes[e]};function Zwe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ht.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function $we(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}ap.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&Zwe(this),this._hasConstantAttributes&&$we(this,this._gl)):AQ(this._gl,this._attributes,this._indexBuffer)};ap.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var si=ap;function cp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=Qwe(t),r=e.floatingPointTexture,o=i===Xe.FLOAT&&!r,s=eIe(t,o),a=tIe(s,t,o),c=Math.floor(Ht.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,h=1/d,x=h*.5;this._textureDimensions=new H(f,d),this._textureStep=new oe(p,g,h,x),this._pixelDatatype=o?Xe.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*d;this._batchValues=i===Xe.FLOAT&&!o?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(cp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function Qwe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Xe.FLOAT:Xe.UNSIGNED_BYTE}function SQ(e,t){let n=e[t].componentsPerAttribute;return n===2?H:n===3?m:n===4?oe:Number}function eIe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function tIe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?r+4:r+1}var Q1=new oe;function nIe(e,t,n){let i=oe.unpack(e,t,Q1),r=oe.unpackFloat(i);i=oe.unpack(e,t+4,Q1);let o=oe.unpackFloat(i);i=oe.unpack(e,t+8,Q1);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,Q1);let a=oe.unpackFloat(i);return oe.fromElements(r,o,s,a,n)}function iIe(e,t,n){let i=oe.packFloat(e.x,Q1);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var EQ=new oe;cp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==Xe.UNSIGNED_BYTE?a=nIe(this._batchValues,s,EQ):a=oe.unpack(this._batchValues,s,EQ);let c=SQ(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var rIe=[void 0,void 0,new H,new m,new oe],oIe=new oe;cp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=rIe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=SQ(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=oIe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Xe.UNSIGNED_BYTE?iIe(c,this._batchValues,d):oe.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function sIe(e,t){let n=e._textureDimensions;e._texture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:mn.NEAREST,flipY:!1})}function aIe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}cp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||sIe(this,e.context),aIe(this))};cp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:gt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function cIe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function lIe(e){return e===1?"float":`vec${e}`}function uIe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function fIe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=lIe(r),a=uIe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) +{ + vec2 st = computeSt(batchId); + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==Xe.UNSIGNED_BYTE?u+=`vec4 textureValue; +textureValue.x = czm_unpackFloat(texture(batchTexture, st)); +textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); +textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); +textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); +`:u+=` vec4 textureValue = texture(batchTexture, st); +`,u+=` ${s} value = textureValue${a}; +`,e._pixelDatatype===Xe.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===Xe.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`),u+=` return value; +} +`,u}cp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${cIe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=fIe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} +${t} +${s}`}};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var z0=cp;var sr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};sr.getMathType=function(e){switch(e){case sr.SCALAR:return Number;case sr.VEC2:return H;case sr.VEC3:return m;case sr.VEC4:return oe;case sr.MAT2:return ir;case sr.MAT3:return $;case sr.MAT4:return F}};sr.getNumberOfComponents=function(e){switch(e){case sr.SCALAR:return 1;case sr.VEC2:return 2;case sr.VEC3:return 3;case sr.VEC4:case sr.MAT2:return 4;case sr.MAT3:return 9;case sr.MAT4:return 16}};sr.getAttributeLocationCount=function(e){switch(e){case sr.SCALAR:case sr.VEC2:case sr.VEC3:case sr.VEC4:return 1;case sr.MAT2:return 2;case sr.MAT3:return 3;case sr.MAT4:return 4}};sr.getGlslType=function(e){switch(e){case sr.SCALAR:return"float";case sr.VEC2:return"vec2";case sr.VEC3:return"vec3";case sr.VEC4:return"vec4";case sr.MAT2:return"mat2";case sr.MAT3:return"mat3";case sr.MAT4:return"mat4"}};var cn=Object.freeze(sr);var vQ=1/256,wQ=256,Ar={};Ar.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(r)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Ar.octEncode=function(e,t){return Ar.octEncodeInRange(e,255,t)};var eP=new H,IQ=new Uint8Array(1);function hk(e){return IQ[0]=e,IQ[0]}Ar.octEncodeToCartesian4=function(e,t){return Ar.octEncodeInRange(e,65535,eP),t.x=hk(eP.x*vQ),t.y=hk(eP.x),t.z=hk(eP.y*vQ),t.w=hk(eP.y),t};Ar.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(r),i.y=(1-Math.abs(r))*D.signNotZero(i.y)}return m.normalize(i,i)};Ar.octDecode=function(e,t,n){return Ar.octDecodeInRange(e,t,255,n)};Ar.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*wQ+i,a=r*wQ+o;return Ar.octDecodeInRange(s,a,65535,t)};Ar.octPackFloat=function(e){return 256*e.x+e.y};var W8=new H;Ar.octEncodeFloat=function(e){return Ar.octEncode(e,W8),Ar.octPackFloat(W8)};Ar.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Ar.octDecode(i,r,t)};Ar.octPack=function(e,t,n,i){let r=Ar.octEncodeFloat(e),o=Ar.octEncodeFloat(t),s=Ar.octEncode(n,W8);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Ar.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Ar.octDecodeFloat(s,t),Ar.octDecodeFloat(c,n),Ar.octDecode(o,a,i)};Ar.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Ar.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function G8(e){return e>>1^-(e&1)}Ar.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=G8(e[a]),o+=G8(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=G8(n[a]),n[a]=s)};Ar.dequantize=function(e,t,n,i){let r=cn.getNumberOfComponents(n),o;switch(t){case X.BYTE:o=127;break;case X.UNSIGNED_BYTE:o=255;break;case X.SHORT:o=32767;break;case X.UNSIGNED_SHORT:o=65535;break;case X.INT:o=2147483647;break;case X.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Ar.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=32-1,r=64-1,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var Xn=Ar;var PQ=new m,DQ=new m,RQ=new m;function dIe(e,t,n,i,r){l(r)||(r=new m);let o,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,D.EPSILON14))return m.clone(m.UNIT_X,r);if(m.equalsEpsilon(e,n,D.EPSILON14))return m.clone(m.UNIT_Y,r);if(m.equalsEpsilon(e,i,D.EPSILON14))return m.clone(m.UNIT_Z,r);o=m.subtract(n,t,PQ),s=m.subtract(i,t,DQ),a=m.subtract(e,t,RQ),c=m.dot(o,o),u=m.dot(o,s),f=m.dot(o,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,D.EPSILON14))return m.clone(m.UNIT_X,r);if(H.equalsEpsilon(e,n,D.EPSILON14))return m.clone(m.UNIT_Y,r);if(H.equalsEpsilon(e,i,D.EPSILON14))return m.clone(m.UNIT_Z,r);o=H.subtract(n,t,PQ),s=H.subtract(i,t,DQ),a=H.subtract(e,t,RQ),c=H.dot(o,o),u=H.dot(o,s),f=H.dot(o,a),d=H.dot(s,s),p=H.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var H0=dIe;var j8={};j8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};j8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r;function o(_,E,w,P){for(;E.length>=1;){let M=E[E.length-1];if(E.splice(E.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,E,w,P,M,B,V){let U=-1,G,k=-1,Y=0;for(;Y<w.length;){let j=w[Y];P[j].numLiveTriangles&&(G=0,M-P[j].timeStamp+2*P[j].numLiveTriangles<=E&&(G=M-P[j].timeStamp),(G>k||k===-1)&&(k=G,U=j)),++Y}return U===-1?o(P,B,_,V):U}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let h=0;for(;u<d;)p[t[u]].vertexTriangles.push(h),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(h),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(h),++p[t[u+2]].numLiveTriangles,++h,u+=3;let x=0,b=i+1;r=1;let C=[],A=[],T,S,v=0,I=[],O=a/3,R=[];for(g=0;g<O;g++)R[g]=!1;let L,N;for(;x!==-1;){C=[],S=p[x],N=S.vertexTriangles.length;for(let _=0;_<N;++_)if(h=S.vertexTriangles[_],!R[h]){R[h]=!0,u=h+h+h;for(let E=0;E<3;++E)L=t[u],C.push(L),A.push(L),I[v]=L,++v,T=p[L],--T.numLiveTriangles,b-T.timeStamp>i&&(T.timeStamp=b,++b),++u}x=s(t,i,C,p,b,A,c)}return I};var tP=j8;var wc={};function Ck(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function mIe(e){let t=e.length,n=t/3*6,i=Be.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)Ck(i,r,e[o],e[o+1],e[o+2]);return i}function hIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Be.createTypedArray(t,n);Ck(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)Ck(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function pIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Be.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)Ck(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}wc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Le.TRIANGLES:e.indices=mIe(t);break;case Le.TRIANGLE_STRIP:e.indices=hIe(t);break;case Le.TRIANGLE_FAN:e.indices=pIe(t);break}e.primitiveType=Le.LINES}return e};wc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new ft({attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Le.LINES,boundingSphere:c})};wc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};wc.reorderForPreVertexCache=function(e){let t=ft.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=Be.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],h=g.values,x=0,b=g.componentsPerAttribute,C=X.createTypedArray(g.componentDatatype,u*b);for(;x<t;){let A=i[x];if(A!==-1)for(let T=0;T<b;T++)C[b*A+T]=h[b*x+T];++x}g.values=C}}return e};wc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Le.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=tP.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function OQ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new De({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function _Ie(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}wc.fitToUnsignedShortIndices=function(e){let t=[],n=ft.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=OQ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Le.TRIANGLES?u=3:e.primitiveType===Le.LINES?u=2:e.primitiveType===Le.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,_Ie(s,e.attributes,p)),r.push(g)}o+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new ft({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=OQ(e.attributes))}r.length!==0&&t.push(new ft({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var MQ=new m,gIe=new me;wc.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Pi;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=m.fromArray(a,f,MQ),p=s.cartesianToCartographic(d,gIe),g=r.project(p,MQ);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var q8={high:0,low:0};wc.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Yn.encode(o[f],q8),a[f]=q8.high,c[f]=q8.low;let u=r.componentsPerAttribute;return e.attributes[n]=new De({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new De({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var fd=new m;function Y8(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,fd),F.multiplyByPoint(e,fd,fd),m.pack(fd,n,r)}}function X8(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,fd),$.multiplyByVector(e,fd,fd),fd=m.normalize(fd,fd),m.pack(fd,n,r)}}var pk=new F,_k=new $;wc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;Y8(t,n.position),Y8(t,n.prevPosition),Y8(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,pk),F.transpose(pk,pk),F.getMatrix3(pk,_k),X8(_k,n.normal),X8(_k,n.tangent),X8(_k,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function yIe(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new De({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var xIe=new m;function K8(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=yIe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let h;if(c){let A=0;for(r=0;r<n;++r)A+=e[r][t].indices.length;let T=ft.computeNumberOfVertices(new ft({attributes:f,primitiveType:Le.POINTS})),S=Be.createTypedArray(T,A),v=0,I=0;for(r=0;r<n;++r){let O=e[r][t].indices,R=O.length;for(s=0;s<R;++s)S[v++]=I+O[s];I+=ft.computeNumberOfVertices(e[r][t])}h=S}let x=new m,b=0,C;for(r=0;r<n;++r){if(C=e[r][t].boundingSphere,!l(C)){x=void 0;break}m.add(C.center,x,x)}if(l(x))for(m.divideByScalar(x,n,x),r=0;r<n;++r){C=e[r][t].boundingSphere;let A=m.magnitude(m.subtract(C.center,x,xIe))+C.radius;A>b&&(b=A)}return new ft({attributes:f,indices:h,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}wc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(K8(t,"geometry")),n.length>0&&(r.push(K8(n,"westHemisphereGeometry")),r.push(K8(n,"eastHemisphereGeometry"))),r};var Ku=new m,nP=new m,gT=new m,yT=new m;wc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let h=t[u],x=t[u+1],b=t[u+2],C=h*3,A=x*3,T=b*3;nP.x=i[C],nP.y=i[C+1],nP.z=i[C+2],gT.x=i[A],gT.y=i[A+1],gT.z=i[A+2],yT.x=i[T],yT.y=i[T+1],yT.z=i[T+2],s[h].count++,s[x].count++,s[b].count++,m.subtract(gT,nP,gT),m.subtract(yT,nP,yT),a[f]=m.cross(gT,yT,new m),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let h=p.indexOffset+p.currentCount;c[h]=f,p.currentCount++,p=s[t[u+1]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,p=s[t[u+2]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let h=u*3;if(p=s[u],m.clone(m.ZERO,Ku),p.count>0){for(f=0;f<p.count;f++)m.add(Ku,a[c[p.indexOffset+f]],Ku);m.equalsEpsilon(m.ZERO,Ku,D.EPSILON10)&&m.clone(a[c[p.indexOffset]],Ku)}m.equalsEpsilon(m.ZERO,Ku,D.EPSILON10)&&(Ku.z=1),m.normalize(Ku,Ku),g[h]=Ku.x,g[h+1]=Ku.y,g[h+2]=Ku.z}return e.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var bIe=new m,LQ=new m,CIe=new m;wc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],C=n[u+2];f=x*3,d=b*3,p=C*3;let A=x*2,T=b*2,S=C*2,v=i[f],I=i[f+1],O=i[f+2],R=o[A],L=o[A+1],N=o[T+1]-L,_=o[S+1]-L,E=1/((o[T]-R)*_-(o[S]-R)*N),w=(_*(i[d]-v)-N*(i[p]-v))*E,P=(_*(i[d+1]-I)-N*(i[p+1]-I))*E,M=(_*(i[d+2]-O)-N*(i[p+2]-O))*E;c[f]+=w,c[f+1]+=P,c[f+2]+=M,c[d]+=w,c[d+1]+=P,c[d+2]+=M,c[p]+=w,c[p+1]+=P,c[p+2]+=M}let g=new Float32Array(s*3),h=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let x=m.fromArray(r,f,bIe),b=m.fromArray(c,f,CIe),C=m.dot(x,b);m.multiplyByScalar(x,C,LQ),m.normalize(m.subtract(b,LQ,b),b),g[f]=b.x,g[d]=b.y,g[p]=b.z,m.normalize(m.cross(x,b,b),b),h[f]=b.x,h[d]=b.y,h[p]=b.z}return e.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h}),e};var iP=new H,ud=new m,NQ=new m,FQ=new m,gk=new H;wc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let I=t.values;i=I.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(m.fromArray(I,n*3,ud),m.equals(ud,m.ZERO)){R+=2;continue}gk=Xn.octEncodeInRange(ud,65535,gk),O[R++]=gk.x,O[R++]=gk.y}return e.attributes.compressedAttributes=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,h,x;s&&(p=r.values),a&&(g=o.values),f&&(h=c.values),d&&(x=u.values),i=(s?p.length:g.length)/(s?3:2);let A=i,T=a&&s?2:1;T+=f||d?1:0,A*=T;let S=new Float32Array(A),v=0;for(n=0;n<i;++n){a&&(H.fromArray(g,n*2,iP),S[v++]=Xn.compressTextureCoordinates(iP));let I=n*3;s&&l(h)&&l(x)?(m.fromArray(p,I,ud),m.fromArray(h,I,NQ),m.fromArray(x,I,FQ),Xn.octPack(ud,NQ,FQ,iP),S[v++]=iP.x,S[v++]=iP.y):(s&&(m.fromArray(p,I,ud),S[v++]=Xn.octEncodeFloat(ud)),f&&(m.fromArray(h,I,ud),S[v++]=Xn.octEncodeFloat(ud)),d&&(m.fromArray(x,I,ud),S[v++]=Xn.octEncodeFloat(ud)))}return e.attributes.compressedAttributes=new De({componentDatatype:X.FLOAT,componentsPerAttribute:T,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function TIe(e){if(l(e.indices))return e;let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function AIe(e){let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Le.TRIANGLES,e}function EIe(e){let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Le.TRIANGLES,e}function SIe(e){if(l(e.indices))return e;let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function vIe(e){let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Le.LINES,e}function wIe(e){let t=ft.computeNumberOfVertices(e),n=Be.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Le.LINES,e}function IIe(e){switch(e.primitiveType){case Le.TRIANGLE_FAN:return AIe(e);case Le.TRIANGLE_STRIP:return EIe(e);case Le.TRIANGLES:return TIe(e);case Le.LINE_STRIP:return vIe(e);case Le.LINE_LOOP:return wIe(e);case Le.LINES:return SIe(e)}return e}function dg(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function PIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){dg(e,e.y<0),dg(t,t.y<0),dg(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=D.sign(e.y):s=D.sign(n.y):r>o?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;dg(e,a),dg(t,a),dg(n,a)}var BQ=new m;function Ju(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,BQ),e.y/(e.y-t.y),BQ),n),m.clone(n,i),dg(n,!0),dg(i,!1)}var G0=new m,W0=new m,j0=new m,q0=new m,J8={positions:new Array(7),indices:new Array(3*3)};function DIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;PIe(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=J8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ju(e,t,G0,j0),Ju(e,n,W0,q0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Ju(t,n,G0,j0),Ju(t,e,W0,q0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Ju(n,e,G0,j0),Ju(n,t,W0,q0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Ju(n,e,G0,j0),Ju(n,t,W0,q0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ju(t,n,G0,j0),Ju(t,e,W0,q0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ju(e,t,G0,j0),Ju(e,n,W0,q0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=J8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=G0,c[4]=W0,c[5]=j0,c[6]=q0,c.length=7),J8}function kQ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=X.createTypedArray(o.componentDatatype,o.values)}let i=ft.computeNumberOfVertices(e);return e.indices=Be.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function bT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new De({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new ft({attributes:n,indices:[],primitiveType:e.primitiveType})}function e5(e,t,n){let i=l(e.geometry.boundingSphere);t=kQ(t,i),n=kQ(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function t5(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),h=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(x,c.z,x);let b=e.add(g,h,g);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var RIe=t5(oe,4),bk=t5(m,3),WQ=t5(H,2),OIe=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>D.EPSILON6?1:0},rP=new m,Z8=new m,$8=new m,MIe=new m;function yk(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,x){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let b=m.fromArray(r,e*3,rP),C=m.fromArray(r,t*3,Z8),A=m.fromArray(r,n*3,$8),T=H0(i,b,C,A,MIe);if(l(T)){if(l(o)&&bk(e,t,n,T,o,d.normal.values,x,!0),l(u)){let S=m.fromArray(u,e*3,rP),v=m.fromArray(u,t*3,Z8),I=m.fromArray(u,n*3,$8);m.multiplyByScalar(S,T.x,S),m.multiplyByScalar(v,T.y,v),m.multiplyByScalar(I,T.z,I);let O;!m.equals(S,m.ZERO)||!m.equals(v,m.ZERO)||!m.equals(I,m.ZERO)?(O=m.add(S,v,S),m.add(O,I,O),m.normalize(O,O)):(O=rP,O.x=0,O.y=0,O.z=0),m.pack(O,d.extrudeDirection.values,x*3)}if(l(f)&&OIe(e,t,n,T,f,d.applyOffset.values,x),l(s)&&bk(e,t,n,T,s,d.tangent.values,x,!0),l(a)&&bk(e,t,n,T,a,d.bitangent.values,x,!0),l(c)&&WQ(e,t,n,T,c,d.st.values,x),g>0)for(let S=0;S<g;S++){let v=p[S];LIe(e,t,n,T,x,h[v],d[v])}}}function LIe(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:RIe(e,t,n,i,c,u,r,!1);break;case 3:bk(e,t,n,i,c,u,r,!1);break;case 2:WQ(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Hm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var NIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function UQ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let O in n)n.hasOwnProperty(O)&&!NIe[O]&&l(n[O])&&d.push(O);let p=d.length,g=bT(t),h=bT(t),x,b,C,A,T,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<S.length;++T)S[T]=-1,v[T]=-1;let I=f.length;for(T=0;T<I;T+=3){let O=f[T],R=f[T+1],L=f[T+2],N=m.fromArray(i,O*3),_=m.fromArray(i,R*3),E=m.fromArray(i,L*3),w=DIe(N,_,E);if(l(w)&&w.positions.length>3){let P=w.positions,M=w.indices,B=M.length;for(let V=0;V<B;++V){let U=M[V],G=P[U];G.y<0?(x=h.attributes,b=h.indices,C=S):(x=g.attributes,b=g.indices,C=v),A=Hm(x,b,C,f,U<3?T+U:-1,G),yk(O,R,L,G,i,r,s,o,a,c,u,x,d,p,n,A)}}else l(w)&&(N=w.positions[0],_=w.positions[1],E=w.positions[2]),N.y<0?(x=h.attributes,b=h.indices,C=S):(x=g.attributes,b=g.indices,C=v),A=Hm(x,b,C,f,T,N),yk(O,R,L,N,i,r,s,o,a,c,u,x,d,p,n,A),A=Hm(x,b,C,f,T+1,_),yk(O,R,L,_,i,r,s,o,a,c,u,x,d,p,n,A),A=Hm(x,b,C,f,T+2,E),yk(O,R,L,E,i,r,s,o,a,c,u,x,d,p,n,A)}e5(e,h,g)}var jQ=un.fromPointNormal(m.ZERO,m.UNIT_Y),FIe=new m,BIe=new m;function xT(e,t,n,i,r,o,s){if(!l(s))return;let a=m.fromArray(i,e*3,rP);m.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function VQ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=bT(t),a=bT(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],h=m.fromArray(i,p*3,rP),x=m.fromArray(i,g*3,Z8),b;Math.abs(h.y)<D.EPSILON6&&(h.y<0?h.y=-D.EPSILON6:h.y=D.EPSILON6),Math.abs(x.y)<D.EPSILON6&&(x.y<0?x.y=-D.EPSILON6:x.y=D.EPSILON6);let C=s.attributes,A=s.indices,T=d,S=a.attributes,v=a.indices,I=f,O=$i.lineSegmentPlane(h,x,jQ,$8);if(l(O)){let R=m.multiplyByScalar(m.UNIT_Y,5*D.EPSILON9,FIe);h.y<0&&(m.negate(R,R),C=a.attributes,A=a.indices,T=f,S=s.attributes,v=s.indices,I=d);let L=m.add(O,R,BIe);b=Hm(C,A,T,o,c,h),xT(p,g,h,i,b,C,r),b=Hm(C,A,T,o,-1,L),xT(p,g,L,i,b,C,r),m.negate(R,R),m.add(O,R,L),b=Hm(S,v,I,o,-1,L),xT(p,g,L,i,b,S,r),b=Hm(S,v,I,o,c+1,x),xT(p,g,x,i,b,S,r)}else{let R,L,N;h.y<0?(R=a.attributes,L=a.indices,N=f):(R=s.attributes,L=s.indices,N=d),b=Hm(R,L,N,o,c,h),xT(p,g,h,i,b,R,r),b=Hm(R,L,N,o,c+1,x),xT(p,g,x,i,b,R,r)}}e5(e,a,s)}var zQ=new H,kIe=new H,qQ=new m,YQ=new m,Q8=new m,UIe=new m,VIe=new m,zIe=new m,HQ=new oe;function GQ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=m.unpack(n,s,qQ);if(a.x>0)continue;let c=m.unpack(i,s,YQ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(r,s,Q8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):m.pack(a,r,s))}}var HIe=5*D.EPSILON9,xk=D.EPSILON6;function GIe(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=bT(t),f=bT(t),d,p,g,h=!1,x=i.length/3;for(d=0;d<x;d+=4){let b=d,C=d+2,A=m.fromArray(i,b*3,qQ),T=m.fromArray(i,C*3,YQ);if(Math.abs(A.y)<xk)for(A.y=xk*(T.y<0?-1:1),i[d*3+1]=A.y,i[(d+1)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<xk)for(T.y=xk*(A.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let S=u.attributes,v=u.indices,I=f.attributes,O=f.indices,R=$i.lineSegmentPlane(A,T,jQ,UIe);if(l(R)){h=!0;let L=m.multiplyByScalar(m.UNIT_Y,HIe,VIe);A.y<0&&(m.negate(L,L),S=f.attributes,v=f.indices,I=u.attributes,O=u.indices);let N=m.add(R,L,zIe);S.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.position.values.push(N.x,N.y,N.z),S.position.values.push(N.x,N.y,N.z),S.prevPosition.values.push(r[b*3],r[b*3+1],r[b*3+2]),S.prevPosition.values.push(r[b*3+3],r[b*3+4],r[b*3+5]),S.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),m.negate(L,L),m.add(R,L,N),I.position.values.push(N.x,N.y,N.z),I.position.values.push(N.x,N.y,N.z),I.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),I.nextPosition.values.push(o[C*3],o[C*3+1],o[C*3+2]),I.nextPosition.values.push(o[C*3+3],o[C*3+4],o[C*3+5]);let _=H.fromArray(s,b*2,zQ),E=Math.abs(_.y);S.expandAndWidth.values.push(-1,E,1,E),S.expandAndWidth.values.push(-1,-E,1,-E),I.expandAndWidth.values.push(-1,E,1,E),I.expandAndWidth.values.push(-1,-E,1,-E);let w=m.magnitudeSquared(m.subtract(R,A,Q8));if(w/=m.magnitudeSquared(m.subtract(T,A,Q8)),l(c)){let P=oe.fromArray(c,b*4,HQ),M=oe.fromArray(c,C*4,HQ),B=D.lerp(P.x,M.x,w),V=D.lerp(P.y,M.y,w),U=D.lerp(P.z,M.z,w),G=D.lerp(P.w,M.w,w);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(B,V,U,G),S.color.values.push(B,V,U,G),I.color.values.push(B,V,U,G),I.color.values.push(B,V,U,G),p=C*4;p<C*4+2*4;++p)I.color.values.push(c[p])}if(l(a)){let P=H.fromArray(a,b*2,zQ),M=H.fromArray(a,(d+3)*2,kIe),B=D.lerp(P.x,M.x,w);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(B,P.y),S.st.values.push(B,M.y),I.st.values.push(B,P.y),I.st.values.push(B,M.y),p=C*2;p<C*2+2*2;++p)I.st.values.push(a[p])}g=S.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=I.position.values.length/3-4,O.push(g,g+2,g+1),O.push(g+1,g+2,g+3)}else{let L,N;for(A.y<0?(L=f.attributes,N=f.indices):(L=u.attributes,N=u.indices),L.position.values.push(A.x,A.y,A.z),L.position.values.push(A.x,A.y,A.z),L.position.values.push(T.x,T.y,T.z),L.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+4*3;++p)L.prevPosition.values.push(r[p]),L.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+4*2;++p)L.expandAndWidth.values.push(s[p]),l(a)&&L.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)L.color.values.push(c[p]);g=L.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}h&&(GQ(f),GQ(u)),e5(e,f,u)}wc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,un.ORIGIN_ZX_PLANE)!==en.INTERSECTING))return e;if(t.geometryType!==Yu.NONE)switch(t.geometryType){case Yu.POLYLINES:GIe(e);break;case Yu.TRIANGLES:UQ(e);break;case Yu.LINES:VQ(e);break}else IIe(t),t.primitiveType===Le.TRIANGLES?UQ(e):t.primitiveType===Le.LINES&&VQ(e);return e};var Bn=wc;function ul(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(ul.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ul.mercatorAngleToGeodeticLatitude=function(e){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};ul.geodeticLatitudeToMercatorAngle=function(e){e>ul.MaximumLatitude?e=ul.MaximumLatitude:e<-ul.MaximumLatitude&&(e=-ul.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};ul.MaximumLatitude=ul.mercatorAngleToGeodeticLatitude(Math.PI);ul.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=ul.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};ul.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=ul.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new me(i,r,o)};var Ri=ul;function WIe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!F.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Bn.transformToWorldCoordinates(e[o]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function n5(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new De({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function jIe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?n5(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(n5(i.westHemisphereGeometry,n),n5(i.eastHemisphereGeometry,n))}}function qIe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(WIe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Bn.splitLongitude(t[c]);if(jIe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Bn.reorderForPostVertexCache(g.geometry),Bn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Bn.reorderForPostVertexCache(g.westHemisphereGeometry),Bn.reorderForPreVertexCache(g.westHemisphereGeometry),Bn.reorderForPostVertexCache(g.eastHemisphereGeometry),Bn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Bn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let h in g)g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE&&Bn.encodeAttribute(u,h,`${h}3DHigh`,`${h}3DLow`);else for(let h in g)if(g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE){let x=`${h}3D`,b=`${h}2D`;Bn.projectTo2D(u,h,x,b,n),l(u.boundingSphere)&&h==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Bn.encodeAttribute(u,x,`${x}High`,`${x}Low`),Bn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Bn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Bn.fitToUnsignedShortIndices(u));p=g}return p}function i5(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function YIe(e,t){let n=[];return i5(e,"geometry",t,n),i5(e,"westHemisphereGeometry",t,n),i5(e,"eastHemisphereGeometry",t,n),n}var lp={};lp.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=qIe(e),t.length>0&&(n=Bn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=YIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,h=d.westHemisphereGeometry;l(g)&&l(h)&&(l(g.boundingSphere)&&l(h.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,h.boundingSphere)),l(g.boundingSphereCV)&&l(h.boundingSphereCV)&&(u[f]=ae.union(g.boundingSphereCV,h.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function XIe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function KIe(e,t){let n=e.length;for(let i=0;i<n;++i)XIe(e[i],t)}function JIe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ae.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}lp.packCreateGeometryResults=function(e,t){let n=new Float64Array(JIe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(r[x])||(r[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let b=g[x],C=p[b];n[s++]=r[b],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let h=l(c.indices)?c.indices.length:0;n[s++]=h,h>0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};lp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,C,A=new pn,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],I=n[s++];C=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(I,x);for(let R=0;R<x;R++)b[R]=n[s++];A[v]=new De({componentDatatype:I,componentsPerAttribute:C,normalize:O,values:b})}let S;if(x=n[s++],x>0){let v=b.length/C;for(S=Be.createTypedArray(v,x),i=0;i<x;i++)S[i]=n[s++]}r[o++]=new ft({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:S,attributes:A,offsetAttribute:f})}return r};function ZIe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(F.pack(s.modelMatrix,i,r),r+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function $Ie(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=F.unpack(t,r),s;r+=F.packedLength,l(t[r])&&(s={offset:new Zi(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}lp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ZIe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Pi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};lp.unpackCombineGeometryParameters=function(e){let t=$Ie(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=lp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=re.clone(e.ellipsoid),s=e.isGeographic?new Pi(o):new Ri(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function XQ(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ae.pack(e[o],i,r)):i[r++]=0,r+=ae.packedLength}return i}function KQ(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}lp.packCombineGeometryResults=function(e,t){l(e.geometries)&&KIe(e.geometries,t);let n=XQ(e.boundingSpheres),i=XQ(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};lp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:KQ(e.boundingSpheres),boundingSpheresCV:KQ(e.boundingSpheresCV)}};var Y0=lp;var QIe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},xo=Object.freeze(QIe);var Tk={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Tk.getMorphTime=function(e){return e===Tk.SCENE3D?1:e===Tk.MORPHING?void 0:0};var ne=Object.freeze(Tk);var Zl={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Zl.NUMBER_OF_SHADOW_MODES=4;Zl.castShadows=function(e){return e===Zl.ENABLED||e===Zl.CAST_ONLY};Zl.receiveShadows=function(e){return e===Zl.ENABLED||e===Zl.RECEIVE_ONLY};Zl.fromCastReceive=function(e,t){return e&&t?Zl.ENABLED:e?Zl.CAST_ONLY:t?Zl.RECEIVE_ONLY:Zl.DISABLED};var bn=Object.freeze(Zl);function bo(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,bn.DISABLED),this._translucent=void 0,this._state=xo.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoad=(r,o,s)=>{this._error=s,this._state=o,r.afterRender.push(function(){if(t._ready=t._state===xo.COMPLETE||t._state===xo.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(bo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function e1e(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var t1e=new H,n1e=new m,ree=new oe;function oee(e){let t=e.length;if(t===1)return e[0];if(t===2)return H.unpack(e,0,t1e);if(t===3)return m.unpack(e,0,n1e);if(t===4)return oe.unpack(e,0,ree)}function i1e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=e1e(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,h,x;for(g=0;g<s;++g)h=o[g],x=p[h],c[h]=g,a.push({functionName:`czm_batchTable_${h}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,C=new z0(t,a,r);for(g=0;g<r;++g){let A=i[g];p=A.attributes;for(let O=0;O<s;++O){h=o[O],x=p[h];let R=oee(x.value),L=c[h];C.setBatchedAttribute(g,L,R)}let T={primitive:y(A.pickPrimitive,e)};l(A.id)&&(T.id=A.id);let S=t.createPickId(T);e._pickIds.push(S);let v=S.color,I=ree;I.x=z.floatToByte(v.red),I.y=z.floatToByte(v.green),I.z=z.floatToByte(v.blue),I.w=z.floatToByte(v.alpha),C.setBatchedAttribute(g,b-1,I)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function r1e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new De({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function o1e(e){let t=e.attributes,n=new pn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=r1e(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new ft({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function s1e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var a1e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;bo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=a1e.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; +`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView; +`,o+=`in vec4 position; +`,s+=`${c} +{ + return u_modifiedModelView * position; +} - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} +{ + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); +} - if (segmentCulled) +`:(o+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} +{ + vec4 p; + if (czm_morphTime == 1.0) { - return vec4(0.0, 0.0, 0.0, 1.0); + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) + else if (czm_morphTime == 0.0) { - directionToPrevWC = -directionToNextWC; + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); } - else if (nextSegmentCulled) + else { - directionToNextWC = -directionToPrevWC; + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); } + return p; +} - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) +`)}return[r,o,t,s].join(` +`)};bo._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${ze.replaceMain(t,"czm_non_show_main")} +void main() +{ + czm_non_show_main(); + gl_Position *= czm_batchTable_show(batchId); +}`:t};bo._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function JQ(e){return`${ze.replaceMain(e,"czm_non_pick_main")} +out vec4 v_pickColor; +void main() +{ + czm_non_pick_main(); + v_pickColor = czm_batchTable_pickColor(batchId); +}`}function ZQ(e){return`in vec4 v_pickColor; +${e}`}bo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};bo._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; +`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition(); +`;return r+=` if (czm_sceneMode == czm_sceneMode3D) +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` } +`,r+=` else +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};bo._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=ze.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`void main() +{ + czm_non_distanceDisplayCondition_main(); + vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); + vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); + vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); + float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); +`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); + vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); + vec4 centerRTE; + if (czm_morphTime == 1.0) { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); } - else + else if (czm_morphTime == 0.0) { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + else { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${r}`};function $Q(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); +`}n&&r&&o?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),r&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),o&&(f+=`vec3 bitangent; +`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=ze.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function c1e(e){let t=ze.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function l1e(e){let t=ze.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif } -`;var y5=`${nu} -${TP}`,wOe=k0;Gt.isInternetExplorer()||(y5=`#define CLIP_POLYLINE -${y5}`);function $0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=$0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,y5),this._fragmentShaderSource=y(e.fragmentShaderSource,wOe),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties($0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});$0.VERTEX_FORMAT=Pe.POSITION_ONLY;$0.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;$0.prototype.isTranslucent=or.prototype.isTranslucent;$0.prototype.getRenderState=or.prototype.getRenderState;var Go=$0;var EP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; +`,t}function QQ(e,t){let n=e.vertexAttributes}function u1e(e,t){return function(){return e[t]}}var r5=Math.max(Wt.hardwareConcurrency-1,1),Ak,f1e=new bi("combineGeometry");function d1e(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===xo.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,geometry:i});if(!l(Ak))for(Ak=new Array(r5),r=0;r<r5;r++)Ak[r]=new bi("createGeometry");let f;for(u=$1(u,r5),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let h;if(d>0){let x=new Float64Array(d);for(h=[x.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(Ak[r].scheduleTask({subTasks:u[r]},h))}e._state=xo.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=xo.CREATED}).catch(function(d){sP(e,t,xo.FAILED,d)})}else if(e._state===xo.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=f1e.scheduleTask(Y0.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=xo.COMBINING,Promise.resolve(f).then(function(d){let p=Y0.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=xo.COMBINED):sP(e,t,xo.FAILED,void 0)}).catch(function(d){sP(e,t,xo.FAILED,d)})}}function m1e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=o1e(p):g=p.constructor.createGeometry(p),r[c++]=s1e(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Y0.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=F.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=xo.COMBINED):sP(e,t,xo.FAILED,void 0)}function h1e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new m);x=o[i].clone(x),lee(x,b,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,un.ORIGIN_ZX_PLANE)!==en.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)g=ae.union(g,u[i]);let h=[];for(l(d)&&h.push(d),l(p)&&h.push(p),l(g)&&h.push(g),i=0;i<h.length;i++){let x=h[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}bo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var eee=new Yn,see=new me,aee=new m,cee=new ae;function p1e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let h=0;h<g;++h){let x=p[h];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,cee));let C=x.center,A=x.radius,T=Yn.fromCartesian(C,eee);if(d.setBatchedAttribute(h,r,T.high),d.setBatchedAttribute(h,o,T.low),!t.scene3DOnly){let S=f.cartesianToCartographic(C,see),v=u.project(S,aee);T=Yn.fromCartesian(v,eee),d.setBatchedAttribute(h,s,T.high),d.setBatchedAttribute(h,a,T.low)}d.setBatchedAttribute(h,c,A)}e._batchTableBoundingSpheresUpdated=!0}var o5=new m,_1e=new m;function tee(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(m.equals(d,m.ZERO)){s.setBatchedAttribute(u,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,cee));let g=f.center;g=o.scaleToGeodeticSurface(g,_1e);let h=o.cartesianToCartographic(g,see),x=r.project(h,aee),b=m.add(d,g,o5);h=o.cartesianToCartographic(b,h);let C=r.project(h,o5),A=m.subtract(C,x,o5),T=A.x;A.x=A.z,A.z=A.y,A.y=T,s.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function g1e(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(si.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,sP(e,t,xo.COMPLETE,void 0)}function y1e(e,t,n,i){let r=n.getRenderState(),o;i?(o=je(r,!1),o.cull={enabled:!0,face:xi.BACK},e._frontFaceRS=Ue.fromCache(o),o.cull.face=xi.FRONT,e._backFaceRS=Ue.fromCache(o)):(e._frontFaceRS=Ue.fromCache(r),e._backFaceRS=e._frontFaceRS),o=je(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=je(r,!1),o.depthTest.func=Wa.GREATER,i?(o.cull={enabled:!0,face:xi.BACK},e._frontFaceDepthFailRS=Ue.fromCache(o),o.cull.face=xi.FRONT,e._backFaceDepthFailRS=Ue.fromCache(o)):(e._frontFaceDepthFailRS=Ue.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function x1e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=bo._appendOffsetToShader(e,o),o=bo._appendShowToShader(e,o),o=bo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=JQ(o),o=bo._updateColorAttribute(e,o,!1),o=$Q(e,o),o=bo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=ZQ(s),e._sp=Jt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),QQ(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=bo._appendShowToShader(e,o),o=bo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=JQ(o),o=bo._updateColorAttribute(e,o,!0),o=$Q(e,o),o=bo._modifyShaderPosition(e,o,t.scene3DOnly),o=c1e(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=ZQ(s),s=l1e(s),e._spDepthFail=Jt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),QQ(e._spDepthFail,r))}var oP=new F,nee=new m;function iee(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=u1e(s,c));let a=gt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,oP),F.multiplyByPoint(oP,e.rtcCenter,nee),F.setTranslation(oP,nee,oP),oP}),a}function b1e(e,t,n,i,r,o,s,a){let c=iee(e,t,n,a),u;l(e._depthFailAppearance)&&(u=iee(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ee.TRANSLUCENT:Ee.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let h=0;h<p;++h){let x;r&&(x=o[h],l(x)||(x=o[h]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++h),x=o[h],l(x)||(x=o[h]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(r&&(++h,x=o[h],l(x)||(x=o[h]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++h,x=o[h],l(x)||(x=o[h]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++g}}bo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ae.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ae.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphere2D[r].center.x=0,e._boundingSphereMorph[r]=ae.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function C1e(e,t,n,i,r,o,s,a){bo._updateBoundingVolumes(e,t,r);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=bn.castShadows(e.shadows),g=bn.receiveShadows(e.shadows),h=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<h;++b){let C=Math.floor(b/x),A=n[b];A.modelMatrix=r,A.boundingVolume=c[C],A.cull=o,A.debugShowBoundingVolume=s,A.castShadows=p,A.receiveShadows=g,d?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}bo.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===xo.FAILED)return;let t=e.context;if(l(this._batchTable)||i1e(this,t),this._batchTable.attributes.length>0){if(Ht.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==xo.COMPLETE&&this._state!==xo.COMBINED&&(this.asynchronous?d1e(this,e):m1e(this,e)),this._state===xo.COMBINED&&(p1e(this,e),tee(this,e),g1e(this,e)),!this.show||this._state!==xo.COMPLETE)return;this._batchTableOffsetsUpdated||tee(this,e),this._recomputeBoundingSpheres&&h1e(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&y(this._createRenderStatesFunction,y1e)(this,t,n,u),o&&y(this._createShaderProgramFunction,x1e)(this,e,n),(r||o)&&y(this._createCommandsFunction,b1e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,C1e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var T1e=new ae,A1e=new ae;function lee(e,t,n){if(n===sn.TOP){let i=ae.clone(e,T1e),r=ae.clone(e,A1e);r.center=m.add(r.center,t,r.center),e=ae.union(i,r,e)}else n===sn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function E1e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=X.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function S1e(e,t,n,i,r){return function(o){let s=oee(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var v1e=new m;function w1e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&lee(i,m.fromArray(o.get(),0,v1e),e._offsetInstanceExtend[n]),l(r)&&(i=ae.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function I1e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}bo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:E1e(s,n,f),set:S1e(s,n,f,this,u)}}return w1e(this,c,n),I1e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};bo.prototype.isDestroyed=function(){return!1};bo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function sP(e,t,n,i){e._completeLoad(t,n,i)}var wn=bo;function P1e(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var ja=P1e;var CT=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif -void main() +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); + return eyeCoordinate.xyz / eyeCoordinate.w; +} + +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { + vec2 glFragCoordXY = gl_FragCoord.xy; + // Sample depths at both offset and negative offset + float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); + float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); + // Explicitly evaluate both paths + // Necessary for multifrustum and for edges of the screen + bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); + float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +} +#endif // NORMAL_EC + +void main(void) { - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES - v_width = width; - v_st.s = st.s; - v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); - v_polylineAngle = angle; -} -`;var eA=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK + +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } #endif -in vec2 v_st; +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif -void main() -{ + +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; -#endif +#else // PER_INSTANCE_COLOR - czm_writeLogDepth(); -} -`;var A5=`${nu} -${EP}`,DOe=eA;Gt.isInternetExplorer()||(A5=`#define CLIP_POLYLINE -${A5}`);function tA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=tA.VERTEX_FORMAT;this.material=u(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,A5),this._fragmentShaderSource=y(e.fragmentShaderSource,DOe),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(tA.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});tA.VERTEX_FORMAT=Pe.POSITION_AND_ST;tA.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;tA.prototype.isTranslucent=or.prototype.isTranslucent;tA.prototype.getRenderState=or.prototype.getRenderState;var Js=tA;function mp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;u(t)||(t=new Js),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,zn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;u(o)?r(o):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Ste(!1),this._renderState3DTiles=Ste(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(mp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});mp.initializeTerrainHeights=function(){return si.initialize()};function IOe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(CP);s=Sn._appendShowToShader(r,s),s=Sn._appendDistanceDisplayConditionToShader(r,s),s=Sn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(xP);a=Sn._appendShowToShader(r,a),a=Sn._appendDistanceDisplayConditionToShader(r,a),a=Sn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(yP),l=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";u(n.material)?(d=u(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&l.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&l.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",l.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new ke({defines:l,sources:[s]}),h=new ke({defines:p,sources:[d,c]});e._sp=Kt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:o});let A=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!u(A)){let C=new ke({defines:l.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:o})}e._sp2D=A;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!u(x)){let C=new ke({defines:l.concat([`MAX_TERRAIN_HEIGHT ${si._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(AP);let T=new ke({defines:p,sources:[d,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:o})}e._spMorph=x}function Ste(e){return Ve.fromCache({cull:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Hn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function POe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let l=t instanceof Go?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(l);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];u(g)||(g=r[d]=new et({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=ve.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let h=et.shallowClone(g,g.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=h;let A=et.shallowClone(g,g.derivedCommands.color2D);A.shaderProgram=e._sp2D,g.derivedCommands.color2D=A;let x=et.shallowClone(h,h.derivedCommands.color2D);x.shaderProgram=e._sp2D,h.derivedCommands.color2D=x;let C=et.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function vte(e,t,n,i,r,o,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function OOe(e,t,n,i,r,o,s){let a=e._primitive;Sn._updateBoundingVolumes(a,t,r);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&u(a._boundingSphere2D)?c=a._boundingSphere2D:u(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let l=t.mode===ne.MORPHING,f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN&&!l,g,h=t.passes;if(h.render||h.pick&&a.allowPicking){let A=n.length;for(let x=0;x<A;++x){let C=c[x];d&&(g=n[x],vte(e,g,t,r,o,C,s)),p&&(g=n[x].derivedCommands.tileset,vte(e,g,t,r,o,C,s))}}}mp.prototype.update=function(e){if(!u(this._primitive)&&!u(this.geometryInstances))return;if(!si.initialized){mp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!u(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!u(a)||!u(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let l=c.attributes;for(let f in l)l.hasOwnProperty(f)&&(a[f]=l[f]);u(a.width)||(a.width=new Ya({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Q0.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Ct({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,l,f){IOe(n,l,f)},i._createCommandsFunction=function(c,l,f,d,p,g,h){POe(n,l,f,d,g,h)},i._updateAndQueueCommandsFunction=function(c,l,f,d,p,g,h,A){OOe(n,l,f,d,p,g,h)},this._primitive=new Sn(i)}if(this.appearance instanceof Go&&!this._hasPerInstanceColors)throw new fe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&u(this._primitive)&&this._primitive.ready&&this._completeLoad()})};mp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mp.isSupported=function(e){return e.frameState.context.depthTexture};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var md=mp;var MOe=new H(1,1),ROe=!1,BOe=z.WHITE;function vT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(vT.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});vT.prototype.getType=function(e){return"Image"};vT.prototype.getValue=function(e,t){return u(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,MOe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,BOe,t.color),q.getValueOrDefault(this._transparent,e,ROe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};vT.prototype.equals=function(e){return this===e||e instanceof vT&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var pg=vT;function LOe(e){if(e instanceof z)return new Vt(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new pg;return t.image=e,t}}function NOe(e,t){return le(e,t,LOe)}var Rr=NOe;function bP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});bP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new bP(this)};bP.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var nA=bP;var FOe={FIXED:0,INERTIAL:1},ar=Object.freeze(FOe);function wT(){fe.throwInstantiationError()}Object.defineProperties(wT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});wT.prototype.getValue=fe.throwInstantiationError;wT.prototype.getValueInReferenceFrame=fe.throwInstantiationError;wT.prototype.equals=fe.throwInstantiationError;var x5=new Q;wT.convertToReferenceFrame=function(e,t,n,i,r){if(!u(t))return t;if(u(r)||(r=new m),n===i)return m.clone(t,r);let o=Mt.computeIcrfToFixedMatrix(e,x5);if(u(o)||(o=Mt.computeTemeToPseudoFixedMatrix(e,x5)),n===ar.INERTIAL)return Q.multiplyByVector(o,t,r);if(n===ar.FIXED)return Q.multiplyByVector(Q.transpose(o,x5),t,r)};var hp=wT;function iA(e,t){this._definitionChanged=new _e,this._value=m.clone(e),this._referenceFrame=y(t,ar.FIXED)}Object.defineProperties(iA.prototype,{isConstant:{get:function(){return!u(this._value)||this._referenceFrame===ar.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});iA.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};iA.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),u(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};iA.prototype.getValueInReferenceFrame=function(e,t,n){return hp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};iA.prototype.equals=function(e){return this===e||e instanceof iA&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Rc=iA;function SP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(SP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});SP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new SP(this)};SP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var rA=SP;function UOe(e){return e}function VOe(e,t){return le(e,t,UOe)}var hl=VOe;function vP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});vP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new vP(this)};vP.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var oA=vP;function wP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});wP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new wP(this)};wP.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var sA=wP;function DP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(DP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});DP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new DP(this)};DP.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var aA=DP;function IP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(IP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});IP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new IP(this)};IP.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var hd=IP;var kOe=new m(1,1,1),zOe=m.ZERO,HOe=Le.IDENTITY;function wte(e,t,n){this.translation=m.clone(y(e,zOe)),this.rotation=Le.clone(y(t,HOe)),this.scale=m.clone(y(n,kOe))}wte.prototype.equals=function(e){return this===e||u(e)&&m.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var _g=wte;var C5=new _g;function PP(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(PP.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});PP.prototype.getValue=function(e,t){return u(t)||(t=new _g),t.translation=q.getValueOrClonedDefault(this._translation,e,C5.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,C5.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,C5.scale,t.scale),t};PP.prototype.equals=function(e){return this===e||e instanceof PP&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var cA=PP;function pp(e,t){this._propertyNames=[],this._definitionChanged=new _e,u(e)&&this.merge(e,t)}Object.defineProperties(pp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});pp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function GOe(e){return new ei(e)}pp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,GOe))),u(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};pp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};pp.prototype.getValue=function(e,t){u(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=q.getValueOrUndefined(this[o],e,t[o])}return t};pp.prototype.merge=function(e,t){let n=this._propertyNames,i=u(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?u(a)&&u(a.merge)&&a.merge(c):u(c)&&u(c.merge)&&u(c.clone)?this[s]=c.clone():this[s]=c)}};function WOe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!q.equals(e[s],t[s]))return!1}return!0}pp.prototype.equals=function(e){return this===e||e instanceof pp&&WOe(this,e)};var pl=pp;function Dte(e){return new cA(e)}function jOe(e){return new pl(e,Dte)}function qOe(e){return new pl(e)}function OP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(OP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,jOe),articulations:le("articulations",void 0,qOe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});OP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new OP(this)};OP.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(u(t)){let i=this.nodeTransformations;u(i)?i.merge(t):this.nodeTransformations=new pl(t,Dte)}let n=e.articulations;if(u(n)){let i=this.articulations;u(i)?i.merge(n):this.articulations=new pl(n)}};var _p=OP;function MP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(MP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});MP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new MP(this)};MP.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var lA=MP;function RP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(RP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Rr("material"),distanceDisplayCondition:le("distanceDisplayCondition")});RP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new RP(this)};RP.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var gp=RP;function BP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(BP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});BP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new BP(this)};BP.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var LP=BP;function NP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(NP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});NP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new NP(this)};NP.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var uA=NP;function YOe(e,t){this.positions=u(e)?e:[],this.holes=u(t)?t:[]}var Bc=YOe;function XOe(e){return Array.isArray(e)&&(e=new Bc(e)),new ei(e)}function FP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,XOe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});FP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new FP(this)};FP.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var pd=FP;function UP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(UP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Rr("material"),depthFailMaterial:Rr("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});UP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new UP(this)};UP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Xa=UP;function VP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(VP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});VP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new VP(this)};VP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var fA=VP;function kP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(kP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});kP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new kP(this)};kP.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var _d=kP;function zP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(zP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});zP.prototype.clone=function(e){return u(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new zP(this)};zP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var yp=zP;var KOe=new he;function JOe(e){return new Rc(e)}function ZOe(e){return le(e,void 0,JOe)}function Zs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Gm(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;u(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function T5(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&T5(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Gm.prototype,{availability:hl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:hl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&T5(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!u(this.entityCollection)||this.entityCollection.show)&&(!u(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(u(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,u(e)&&e._children.push(this);let i=this.isShowing;n!==i&&T5(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Zs("billboard",ja),box:Zs("box",nA),corridor:Zs("corridor",rA),cylinder:Zs("cylinder",oA),description:le("description"),ellipse:Zs("ellipse",sA),ellipsoid:Zs("ellipsoid",aA),label:Zs("label",hd),model:Zs("model",_p),tileset:Zs("tileset",lA),orientation:le("orientation"),path:Zs("path",gp),plane:Zs("plane",LP),point:Zs("point",uA),polygon:Zs("polygon",pd),polyline:Zs("polyline",Xa),polylineVolume:Zs("polylineVolume",fA),properties:Zs("properties",pl),position:ZOe("position"),rectangle:Zs("rectangle",_d),viewFrom:le("viewFrom"),wall:Zs("wall",yp)});Gm.prototype.isAvailable=function(e){let t=this._availability;return!u(t)||t.contains(e)};Gm.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,hl(e,!0))};Gm.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Gm.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=u(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!u(s)&&t.indexOf(o)===-1&&this.addProperty(o),u(a)&&(u(s)?u(s.merge)&&s.merge(a):u(a.merge)&&u(a.clone)?this[o]=a.clone():this[o]=a)}};var Ite=new Q,Pte=new m,Ote=new Le;Gm.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,Pte);if(!u(n))return;let i=q.getValueOrUndefined(this._orientation,e,Ote);return u(i)?t=N.fromRotationTranslation(Q.fromQuaternion(i,Ite),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};Gm.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=q.getValueOrDefault(t,e,je.NONE),s=q.getValueOrUndefined(this._position,e,Pte);if(o===je.NONE||!u(s)||m.equalsEpsilon(s,m.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,KOe);o===je.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=q.getValueOrUndefined(this._orientation,e,Ote);return u(c)?r=N.fromRotationTranslation(Q.fromQuaternion(c,Ite),s,r):r=Mt.eastNorthUpToFixedFrame(s,void 0,r),r};Gm.supportsMaterialsforEntitiesOnTerrain=function(e){return Oc.supportsMaterials(e)};Gm.supportsPolylinesOnTerrain=function(e){return md.isSupported(e)};var Jr=Gm;var QOe=new Vt(z.WHITE),$Oe=new ei(!0),eMe=new ei(!0),tMe=new ei(!1),nMe=new ei(z.BLACK),iMe=new ei(xn.DISABLED),rMe=new ei(new wt),oMe=new ei(zn.BOTH);function Lc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Jr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Lc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!u(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!u(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Lc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Lc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Lc.prototype.createFillGeometryInstance=fe.throwInstantiationError;Lc.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){ue(this)};Lc.prototype._isHidden=function(e,t){let n=t.show;return u(n)&&n.isConstant&&!n.getValue(ze.MINIMUM_VALUE)};Lc.prototype._isOnTerrain=function(e,t){return!1};Lc.prototype._getIsClosed=function(e){return!0};Lc.prototype._isDynamic=fe.throwInstantiationError;Lc.prototype._setStaticOptions=fe.throwInstantiationError;Lc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!u(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=u(o)&&o.isConstant?o.getValue(ze.MINIMUM_VALUE):!0,a=r.outline,c=u(a);if(c&&a.isConstant&&(c=a.getValue(ze.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let l=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(r.material,QOe),this._fillProperty=y(o,eMe),this._showProperty=y(l,$Oe),this._showOutlineProperty=y(r.outline,tMe),this._outlineColorProperty=c?y(r.outlineColor,nMe):void 0,this._shadowsProperty=y(r.shadows,iMe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,rMe),this._classificationTypeProperty=y(r.classificationType,oMe),this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Vt);if(c&&f&&(Ot(Ot.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=u(d)?d.getValue(ze.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Lc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ci=Lc;function DT(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(DT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});DT.prototype.getValue=function(e,t){return this._callback(e,t)};DT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};DT.prototype.equals=function(e){return this===e||e instanceof DT&&this._callback===e._callback&&this._isConstant===e._isConstant};var gd=DT;var Mte=new m,sMe=new he;function IT(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new he,this._normal=new m,this._definitionChanged=new _e,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(u(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(ze.MINIMUM_VALUE,Mte);if(!u(o)||m.equals(o,m.ZERO)||!u(e.globe))return;this._position=m.clone(o,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});IT.prototype._updateClamping=function(){u(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!u(t)||m.equals(n,m.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,r=t._surface,o=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);u(a)?this._terrainHeight=a:this._terrainHeight=0;function c(l){if(e.mode===ne.SCENE3D){let f=i.cartesianToCartographic(l,sMe);o._terrainHeight=f.height}else o._terrainHeight=l.x;o.definitionChanged.raiseEvent()}this._removeCallbackFunc=r.updateHeight(s,c)};IT.prototype.getValue=function(e,t){let n=q.getValueOrDefault(this._heightReference,e,je.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,je.NONE);if(n===je.NONE&&i!==je.RELATIVE_TO_GROUND)return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,Mte);if(!u(o)||m.equals(o,m.ZERO)||!u(r.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,o,P.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(o,this._position),this._updateClamping();let s=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};IT.prototype.isDestroyed=function(){return!1};IT.prototype.destroy=function(){return u(this._removeEventListener)&&this._removeEventListener(),u(this._removeModeListener)&&this._removeModeListener(),u(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var dA=IT;function aMe(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!u(r))return;u(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(u(o)){let s=new gd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new dA(this._scene,s,o)}}var Ap=aMe;var Rte=m.ZERO,Bte=new m,cMe=new m,Lte=new z;function lMe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function iu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new lMe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}u(Object.create)&&(iu.prototype=Object.create(ci.prototype),iu.prototype.constructor=iu);Object.defineProperties(iu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});iu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Lte)),u(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return u(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rte,Bte))),new Ct({id:t,geometry:fl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};iu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Lte),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return u(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rte,Bte))),new Ct({id:t,geometry:ld.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:o})};iu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};iu.prototype._isHidden=function(e,t){return!u(t.dimensions)||!u(e.position)||ci.prototype._isHidden.call(this,e,t)};iu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};iu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(ze.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==je.NONE?on.ALL:void 0};iu.prototype._onEntityPropertyChanged=Ap;iu.DynamicGeometryUpdater=PT;function PT(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(PT.prototype=Object.create(ai.prototype),PT.prototype.constructor=PT);PT.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,cMe),r=this._options.dimensions;return!u(i)||!u(r)||ai.prototype._isHidden.call(this,e,t,n)};PT.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,je.NONE),r=this._options;r.dimensions=q.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==je.NONE?on.ALL:void 0};var HP=iu;var Kte=Ki(Xte(),1);var OMe=0,O5={};function xp(e,t){let n,i=e;u(O5[i])?n=O5[i]:(n=OMe++,O5[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(xp.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!u(this._element)){let e=Kte.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});xp.equals=function(e,t){return e===t||u(e)&&u(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};xp.prototype.equals=function(e){return xp.equals(this,e)};xp.getIonCredit=function(e){let t=u(e.collapsible)&&!e.collapsible,n=new xp(e.html,t);return n._isIon=n.html.indexOf("ion-credit.png")!==-1,n};xp.clone=function(e){if(u(e))return new xp(e.html,e.showOnScreen)};var Dt=xp;var WP=`in vec2 v_textureCoordinates; + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. -uniform float originalSize; -uniform sampler2D texture0; -uniform sampler2D texture1; -uniform sampler2D texture2; -uniform sampler2D texture3; -uniform sampler2D texture4; -uniform sampler2D texture5; + czm_materialInput materialInput; -const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); -const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); -const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); -const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif -void main() -{ - vec2 uv = v_textureCoordinates; - vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); - vec2 pixel = 1.0 / textureSize; +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif - float mipLevel = 0.0; +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif - if (uv.x - pixel.x > (textureSize.y / textureSize.x)) - { - mipLevel = 1.0; - if (uv.y - pixel.y > yMipLevel1) - { - mipLevel = 2.0; - if (uv.y - pixel.y * 3.0 > yMipLevel2) - { - mipLevel = 3.0; - if (uv.y - pixel.y * 5.0 > yMipLevel3) - { - mipLevel = 4.0; - if (uv.y - pixel.y * 7.0 > yMipLevel4) - { - mipLevel = 5.0; - } - } - } - } - } +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif - if (mipLevel > 0.0) - { - float scale = pow(2.0, mipLevel); + czm_material material = czm_getMaterial(materialInput); - uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); - uv.x *= ((textureSize.x - 2.0) / textureSize.y); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT - uv.x -= 1.0 + pixel.x; - uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); - uv *= scale; - } - else - { - uv.x *= (textureSize.x / textureSize.y); - } + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - if(mipLevel == 0.0) - { - out_FragColor = texture(texture0, uv); - } - else if(mipLevel == 1.0) - { - out_FragColor = texture(texture1, uv); - } - else if(mipLevel == 2.0) - { - out_FragColor = texture(texture2, uv); - } - else if(mipLevel == 3.0) - { - out_FragColor = texture(texture3, uv); - } - else if(mipLevel == 4.0) - { - out_FragColor = texture(texture4, uv); - } - else if(mipLevel == 5.0) - { - out_FragColor = texture(texture5, uv); +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function Zu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new s5;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new s5;if(r.requiresTextureCoordinates=e,n instanceof an)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Zu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof an&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof an||(r=t.material.shaderSource),new ze({defines:i,sources:[r,CT]})};Zu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new ze({defines:n,sources:[CT],pickColorQualifier:"in"})};Zu.prototype.createVertexShader=function(e,t,n,i){return gee(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Zu.prototype.createPickVertexShader=function(e,t,n,i){return gee(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var uee=new m,fee=new me,dee={high:0,low:0};function gee(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=fee;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,uee),d=Yn.encode(f.x,dee);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=fee;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,uee);d=Yn.encode(g.x,dee),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof an&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new ze({defines:c,sources:[r]})}function s5(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(s5.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function mee(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var D1e=[new H,new H,new H,new H];function yee(e,t){let n=D1e,i=H.unpack(t,0,n[0]),r=H.unpack(t,2,n[1]),o=H.unpack(t,4,n[2]);e.uMaxVmax=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/mee(i,r,o),a=1/mee(i,o,r);e.uvMinAndExtents=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var xee=new me,bee=new m,R1e=new m,O1e=new m,Ek={high:0,low:0};function Cee(e,t,n){let i=xee;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,bee);i.latitude=e.north;let o=t.project(i,R1e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,O1e),a=[0,0,0,0],c=[0,0,0,0],u=Yn.encode(r.x,Ek);a[0]=u.high,c[0]=u.low,u=Yn.encode(r.y,Ek),a[1]=u.high,c[1]=u.low,u=Yn.encode(o.y,Ek),a[2]=u.high,c[2]=u.low,u=Yn.encode(s.x,Ek),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var M1e=new F,L1e=new F,hee=new m,N1e=new me,F1e=[new me,new me,new me,new me,new me,new me,new me,new me];function B1e(e,t,n,i,r,o){let s=ce.center(e,N1e);s.height=n;let a=me.toCartesian(s,t,hee),c=Mt.eastNorthUpToFixedFrame(a,t,M1e),u=F.inverse(c,L1e),f=e.west,d=e.east,p=e.north,g=e.south,h=F1e;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let x=(f+d)*.5,b=(p+g)*.5;h[4].latitude=g,h[4].longitude=x,h[5].latitude=p,h[5].longitude=x,h[6].latitude=b,h[6].longitude=f,h[7].latitude=b,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){h[R].height=n;let L=me.toCartesian(h[R],t,hee);F.multiplyByPoint(u,L,L),L.z=0,C=Math.min(C,L.x),A=Math.max(A,L.x),T=Math.min(T,L.y),S=Math.max(S,L.y)}let v=i;v.x=C,v.y=T,v.z=0,F.multiplyByPoint(c,v,v);let I=r;I.x=A,I.y=T,I.z=0,F.multiplyByPoint(c,I,I),m.subtract(I,v,r);let O=o;O.x=C,O.y=S,O.z=0,F.multiplyByPoint(c,O,O),m.subtract(O,v,o)}var k1e=new m,U1e=new m,V1e=new Yn;Zu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=bee,s=k1e,a=U1e;B1e(e,n,y(r,0),o,s,a);let c={};yee(c,t);let u=Yn.fromCartesian(o,V1e);return c.southWest_HIGH=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new ja({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),Cee(e,i,c),c};var z1e=new m;function pee(e,t,n,i){let r=xee;r.latitude=e,r.longitude=t,r.height=0;let o=me.toCartesian(r,n,z1e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=D.fastApproximateAtan2(s,o.z),c=D.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var _ee=new H;Zu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=pee(e.south,e.west,n,_ee),o=r.x,s=r.y,a=pee(e.north,e.east,n,_ee),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),o-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new ja({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new ja({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return yee(g,t),Cee(e,i,g),g};Zu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Zu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function H1e(e){return Math.max(e.width,e.height)>Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Zu.shouldUseSphericalCoordinates=function(e){return H1e(e)};Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var $l=Zu;var G1e={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Wn=Object.freeze(G1e);var W1e={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ht=Object.freeze(W1e);var Sk={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};Sk.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Wn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Wn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:Sk.CESIUM_3D_TILE_MASK,mask:Sk.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(Sk);function X0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Gn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(X0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});X0.isSupported=function(e){return e.context.stencilBuffer};function TT(e,t){let n=t?Wn.EQUAL:Wn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}function c5(e){return{stencilTest:{enabled:e,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}}var j1e={stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function q1e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(TT(r,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(TT(r,!0)),e._rsColorPass=Ue.fromCache(c5(r,!1)),e._rsPickPass=Ue.fromCache(j1e)}function Y1e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; +`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=ze.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function X1e(e,t){let n=t.context,i=e._primitive,r=Z1;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=wn._appendDistanceDisplayConditionToShader(i,r),r=wn._modifyShaderPosition(e,r,t.scene3DOnly),r=wn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=Y1e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new ze({defines:[a],sources:[r]}),u=new ze({sources:[fg]}),f=e._primitive._attributeLocations,d=new $l(s,o,e.appearance);if(e._spStencil=Jt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=ze.createPickVertexShaderSource(r);h=wn._appendShowToShader(i,h),h=wn._updatePickColorAttribute(h);let x=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Jt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let A=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:A,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Jt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=wn._appendShowToShader(i,r),c=new ze({defines:[a],sources:[r]}),e._sp=Jt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Jt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let x=d.createFragmentShader(!0),b=d.createVertexShader([a],r,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=h}}function K1e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new tt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ee.TERRAIN_CLASSIFICATION,s=tt.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new tt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ee.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=gt(c,x._uniforms)),o.uniformMap=c,s=tt.shallowClone(o,o.derivedCommands.tileset),s.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let b=tt.shallowClone(o,o.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=b,b=tt.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let h=f[g]=tt.shallowClone(t[p],f[g]);h.shaderProgram=d,h.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function J1e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let h=i._va[d++];if(n&&(a=o[s++],h=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ee.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=tt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ee.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=tt.shallowClone(u,u.derivedCommands.tileset),f.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let x=tt.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=tt.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function Z1e(e,t,n,i,r,o,s){K1e(e,o),J1e(e,s)}function Tee(e,t){return Math.floor(e%t/2)}function a5(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Aee(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function $1e(e,t,n,i,r,o,s,a){let c=e._primitive;wn._updateBoundingVolumes(c,t,r);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Gn.CESIUM_3D_TILE,p=f!==Gn.TERRAIN,g=t.passes,h,x,b;if(g.render){let C=n.length;for(h=0;h<C;++h)x=u[Tee(h,C)],d&&(b=n[h],a5(b,t,r,o,x,s)),p&&(b=n[h].derivedCommands.tileset,a5(b,t,r,o,x,s));if(t.invertClassification){let A=e._commandsIgnoreShow,T=A.length;for(h=0;h<T;++h)x=u[h],b=A[h],a5(b,t,r,o,x,s)}}if(g.pick){let C=i.length,A=c._pickOffsets;for(h=0;h<C;++h){let T=A[Tee(h,C)];x=u[T.index],d&&(b=i[h],Aee(b,t,r,o,x)),p&&(b=i[h].derivedCommands.tileset,Aee(b,t,r,o,x))}}}X0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=$l.hasAttributesForSphericalExtents(c),g=$l.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&zt.equals(d,x)}if(!f&&!p&&!g)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new an({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let h=new Array(o);for(s=0;s<o;++s)a=r[s],h[s]=new Ct({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=h,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,C,A){q1e(n,b)},i._createShaderProgramFunction=function(x,b,C){X1e(n,b)},i._createCommandsFunction=function(x,b,C,A,T,S,v){Z1e(n,void 0,void 0,!0,!1,S,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,C,A,T,S,v,I){n._updateAndQueueCommandsFunction(x,b,C,A,T,S,v,I)}:i._updateAndQueueCommandsFunction=function(x,b,C,A,T,S,v,I){$1e(n,b,C,A,T,S,v,I)},this._primitive=new wn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ue.fromCache(TT(!1,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(TT(!1,!0)),this._rsColorPass=Ue.fromCache(c5(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ue.fromCache(TT(!0,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(TT(!0,!0)),this._rsColorPass=Ue.fromCache(c5(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};X0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var AT=X0;var Q1e={u_globeMinimumAltitude:function(){return 55e3}};function fl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){let c=o[a].attributes;if(l(c)&&l(c.color)){t=new an({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Gn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;let i=this;this._readyPromise=new Promise((o,s)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):o(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=oi._defaultMaxTerrainHeight,this._minTerrainHeight=oi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let r=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:r,_extruded:!0,_uniformMap:Q1e}}Object.defineProperties(fl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});fl.isSupported=AT.isSupported;function Eee(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function See(e){return function(t,n){return e._minHeight}}var ePe=new m,tPe=new m,nPe=new m,iPe=new me,rPe=new ce;function vk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=m.unpack(i,d,ePe),g=m.unpack(r,d,tPe),h=m.add(p,g,nPe),x=n.cartesianToCartographic(h,iPe),b=x.latitude,C=x.longitude;s=Math.min(s,b),a=Math.min(a,C),c=Math.max(c,b),u=Math.max(u,C)}let f=rPe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function oPe(e,t,n){let i=oi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function sPe(e,t,n){let i=t.mapProjection.ellipsoid,r=vk(t,n),o=On.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function l5(e,t){return Math.floor(e%t/2)}function u5(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function vee(e,t,n,i,r,o){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function aPe(e,t,n,i,r,o,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Gn.CESIUM_3D_TILE,d=u!==Gn.TERRAIN,p=t.passes,g=e._primitive,h,x,b;if(p.render){let C=n.length;for(h=0;h<C;++h)x=c[l5(h,C)],f&&(b=n[h],u5(e,b,t,r,o,x,s)),d&&(b=n[h].derivedCommands.tileset,u5(e,b,t,r,o,x,s));if(t.invertClassification){let A=g._commandsIgnoreShow,T=A.length;for(h=0;h<T;++h)x=c[h],b=A[h],u5(e,b,t,r,o,x,s)}}if(p.pick){let C=i.length,A;for(e._useFragmentCulling||(A=g._primitive._pickOffsets),h=0;h<C;++h){if(x=c[l5(h,C)],!e._useFragmentCulling){let T=A[l5(h,C)];x=c[T.index]}f&&(b=i[h],vee(e,b,t,r,o,x)),d&&(b=i[h].derivedCommands.tileset,vee(e,b,t,r,o,x))}}}fl.initializeTerrainHeights=function(){return oi.initialize()};fl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!oi.initialized){fl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let x=vk(e,o);l(d)?l(x)&&ce.union(d,x,d):d=ce.clone(x);let b=r.id;if(l(b)&&l(x)){let C=oi.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(C)}s=o.constructor,!l(s)||l(s.createShadowVolume)}oPe(this,d,i);let p=e.terrainExaggeration,g=e.terrainExaggerationRelativeHeight;this._minHeight=vc.getHeight(this._minTerrainHeight,p,g),this._maxHeight=vc.getHeight(this._maxTerrainHeight,p,g);let h=fl._supportsMaterials(e.context);if(this._useFragmentCulling=h,h){let x,b=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=vk(e,o),$l.shouldUseSphericalCoordinates(d)){b=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let C=vk(e,o),A=o.textureCoordinateRotationPoints;b?x=$l.getPlanarTextureCoordinateAttributes(C,A,i,e.mapProjection,this._maxHeight):x=$l.getSphericalExtentGeometryInstanceAttributes(C,A,i,e.mapProjection);let T=r.attributes;for(let S in T)T.hasOwnProperty(S)&&(x[S]=T[S]);u[f]=new Ct({geometry:s.createShadowVolume(o,See(this),Eee(this)),attributes:x,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Ct({geometry:s.createShadowVolume(o,See(this),Eee(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){sPe(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,C,A,T,S,v,I){aPe(t,b,C,A,T,S,v,I)},this._primitive=new AT(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};fl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};fl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};fl.prototype.isDestroyed=function(){return!1};fl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};fl._supportsMaterials=function(e){return e.depthTexture};fl.supportsMaterials=function(e){return fl._supportsMaterials(e.frameState.context)};var Ic=fl;function ET(){fe.throwInstantiationError()}Object.defineProperties(ET.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});ET.prototype.getType=fe.throwInstantiationError;ET.prototype.getValue=fe.throwInstantiationError;ET.prototype.equals=fe.throwInstantiationError;ET.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Wi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Wi.ColorType)&&(n=Wi.fromType(Wi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Xr=ET;function K0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}K0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};K0.prototype._setOptions=fe.throwInstantiationError;K0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Vt,d,p=t._getIsClosed(c);if(f)d=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Xr.getValue(e,u,this._material);this._material=g,d=new fr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=an.VERTEX_FORMAT,this._primitive=r.add(new Ic({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new wn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new wn({geometryInstances:u,appearance:new an({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};K0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ai=K0;var cPe={NONE:0,GEODESIC:1,RHUMB:2},Zt=Object.freeze(cPe);var wee=D.EPSILON10;function lPe(e,t,n,i){if(!l(e))return;n=y(n,!1);let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,wee)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],wee)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Er=lPe;function uPe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,h=Math.sqrt(g),x=t/4,b=x*x,C=b*x,A=b*b,T=1+x-3*b/4+5*C/4-175*A/64,S=1-x+15*b/8-35*C/8,v=1-3*x+35*b/4,I=1-5*x,O=T*f-S*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-I*Math.sin(6*f)*C/48-Math.sin(8*f)*5*A/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=h,R.u2Over4=x,R.u4Over16=b,R.u6Over64=C,R.u8Over256=A,R.a0=T,R.a1=S,R.a2=v,R.a3=I,R.distanceRatio=O}function fPe(e,t){return e*t*(4+e*(4-3*t))/16}function Iee(e,t,n,i,r,o,s){let a=fPe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function dPe(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),h=Math.sin(f),x=d*g,b=d*h,C=p*h,A=p*g,T=c,S=D.TWO_PI,v=Math.cos(T),I=Math.sin(T),O,R,L,N,_;do{v=Math.cos(T),I=Math.sin(T);let k=b-A*v;L=Math.sqrt(g*g*I*I+k*k),R=C+x*v,O=Math.atan2(L,R);let Y;L===0?(Y=0,N=1):(Y=x*I/L,N=1-Y*Y),S=T,_=R-2*C/N,isFinite(_)||(_=0),T=c+Iee(a,Y,N,O,L,R,_)}while(Math.abs(T-S)>D.EPSILON12);let E=N*(t*t-n*n)/(n*n),w=1+E*(4096+E*(E*(320-175*E)-768))/16384,P=E*(256+E*(E*(74-47*E)-128))/1024,M=_*_,B=P*L*(_+P*(R*(2*M-1)-P*_*(4*L*L-3)*(4*M-3)/6)/4),V=n*w*(O-B),U=Math.atan2(g*I,b-A*v),G=Math.atan2(d*I,b*v-A);e._distance=V,e._startHeading=U,e._endHeading=G,e._uSquared=E}var mPe=new m,f5=new m;function Pee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,f5),mPe),o=m.normalize(i.cartographicToCartesian(n,f5),f5);dPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,uPe(e)}function aP(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Pee(this,e,t,i)}Object.defineProperties(aP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});aP.prototype.setEndPoints=function(e,t){Pee(this,e,t,this._ellipsoid)};aP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};aP.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,x=n.u6Over64,b=n.u4Over16,C=2*p*g*r/3+i*(1-h+7*b/4-15*x/4+579*g/64-(b-15*x/4+187*g/16)*r-(5*x/4-115*g/16)*o-29*g*s/16)+(h/2-b+71*x/32-85*g/16)*a+(5*b/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,A=Math.asin(Math.sin(C)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(A));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),v=Math.sin(C),I=Math.cos(C),O=n.cosineU*I,R=n.sineU*v,N=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-Iee(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,v,I,S);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=T,t.height=0,t):new me(this._start.longitude+N,T,0)};var $u=aP;function m5(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*x)}function hPe(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),C=Math.cos(4*i),A=Math.sin(6*i),T=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),I=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*A+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*S+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*R}function ST(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function pPe(e,t,n,i,r){let o=ST(e._ellipticity,n),s=ST(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function _Pe(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u=0;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(r)*D.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=m5(e._ellipticity,t,r);u=(m5(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var gPe=new m,d5=new m;function Dee(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,d5),gPe),o=m.normalize(i.cartographicToCartesian(n,d5),d5),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=pPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=_Pe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Ree(e,t,n,i,r,o){if(n===0)return me.clone(e,o);let s=r*r,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=m5(r,i,e.latitude),d=n*Math.cos(t),p=f+d;c=hPe(p,r,i);let g=ST(r,e.latitude),h=ST(r,c);u=Math.tan(t)*(h-g),a=D.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new me(a,c,0)}function up(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Dee(this,e,t,i)}Object.defineProperties(up.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});up.fromStartHeadingDistance=function(e,t,n,i,r){let o=y(i,re.WGS84),s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=Ree(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new up(e,d,o):(r.setEndPoints(e,d),r)};up.prototype.setEndPoints=function(e,t){Dee(this,e,t,this._ellipsoid)};up.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};up.prototype.interpolateUsingSurfaceDistance=function(e,t){return Ree(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};up.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(o.longitude)*Math.PI),l(t)||(t=new me),Math.abs(D.PI_OVER_TWO-r)<=D.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-r),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,o.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};up.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let o=ST(n,r.latitude),s=ST(n,e),a=Math.tan(i)*(s-o),c=D.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var xa=up;var C5=[Pi,Ri],yPe=C5.length,Zee=Math.cos(D.toRadians(30)),Oee=Math.cos(D.toRadians(150)),$ee=0,Qee=1e3;function hg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Zt.GEODESIC),this._ellipsoid=re.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(hg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});hg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<yPe;i++)if(t instanceof C5[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var xPe=new m,Mee=new m,Lee=new m;function b5(e,t,n,i,r){let o=Pc(i,e,0,xPe),s=Pc(i,e,n,Mee),a=Pc(i,t,0,Lee),c=fp(s,o,Mee),u=fp(a,o,Lee);return m.cross(u,c,r),m.normalize(r,r)}var bPe=new me,CPe=new m,TPe=new m,APe=new m;function h5(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===Zt.GEODESIC?d=new $u(e,t,s):o===Zt.RHUMB&&(d=new xa(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=b5(e,t,i,s,APe),h=Math.ceil(p/r),x=p/h,b=x,C=h-1,A=a.length;for(let T=0;T<C;T++){let S=d.interpolateUsingSurfaceDistance(b,bPe),v=Pc(s,S,n,CPe),I=Pc(s,S,i,TPe);m.pack(g,a,A),m.pack(v,c,A),m.pack(I,u,A),f.push(S.latitude),f.push(S.longitude),A+=3,b+=x}}var p5=new me;function Pc(e,t,n,i){return me.clone(t,p5),p5.height=n,me.toCartesian(p5,e,i)}hg.pack=function(e,t,n){let i=y(n,0),r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,re.pack(e._ellipsoid,t,i),i+=re.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};hg.unpack=function(e,t,n){let i=y(t,0),r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=re.unpack(e,i);i+=re.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new hg({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function fp(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function Nee(e,t,n,i){return i=fp(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var EPe=new m,SPe=new m,vPe=new m,ete=new m,wPe=0,IPe=-1;function _5(e,t,n,i,r){let o=fp(n,t,ete),s=Nee(e,t,o,EPe),a=Nee(i,t,o,SPe);if(D.equalsEpsilon(m.dot(s,a),IPe,D.EPSILON5))return r=m.cross(o,s,r),r=m.normalize(r,r),r;r=m.add(a,s,r),r=m.normalize(r,r);let c=m.cross(o,r,vPe);return m.dot(a,c)<wPe&&(r=m.negate(r,r)),r}var Dk=un.fromPointNormal(m.ZERO,m.UNIT_Y),PPe=new m,DPe=new m,RPe=new m,OPe=new m,MPe=new m,wk=new m,Ik=new me,Fee=new me,Bee=new me;hg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new C5[e._projectionIndex](i),a=$ee,c=Qee,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,h,x,b,C=new xa(void 0,void 0,i),A,T,S,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],h=d[f+1],A=$i.lineSegmentPlane(g,h,Dk,wk),l(A)&&!m.equalsEpsilon(A,g,D.EPSILON7)&&!m.equalsEpsilon(A,h,D.EPSILON7)&&(e.arcType===Zt.GEODESIC?v.push(m.clone(A)):e.arcType===Zt.RHUMB&&(S=i.cartesianToCartographic(A,Ik).longitude,x=i.cartesianToCartographic(g,Ik),b=i.cartesianToCartographic(h,Fee),C.setEndPoints(x,b),T=C.findIntersectionWithLongitude(S,Bee),A=i.cartographicToCartesian(T,wk),l(A)&&!m.equalsEpsilon(A,g,D.EPSILON7)&&!m.equalsEpsilon(A,h,D.EPSILON7)&&v.push(m.clone(A)))),v.push(h);n&&(g=d[p-1],h=d[0],A=$i.lineSegmentPlane(g,h,Dk,wk),l(A)&&!m.equalsEpsilon(A,g,D.EPSILON7)&&!m.equalsEpsilon(A,h,D.EPSILON7)&&(e.arcType===Zt.GEODESIC?v.push(m.clone(A)):e.arcType===Zt.RHUMB&&(S=i.cartesianToCartographic(A,Ik).longitude,x=i.cartesianToCartographic(g,Ik),b=i.cartesianToCartographic(h,Fee),C.setEndPoints(x,b),T=C.findIntersectionWithLongitude(S,Bee),A=i.cartographicToCartesian(T,wk),l(A)&&!m.equalsEpsilon(A,g,D.EPSILON7)&&!m.equalsEpsilon(A,h,D.EPSILON7)&&v.push(m.clone(A)))));let I=v.length,O=new Array(I);for(f=0;f<I;f++){let j=me.fromCartesian(v[f],i);j.height=0,O[f]=j}if(O=Er(O,me.equalsEpsilon),I=O.length,I<2)return;let R=[],L=[],N=[],_=[],E=PPe,w=DPe,P=RPe,M=OPe,B=MPe,V=O[0],U=O[1],G=O[I-1];for(E=Pc(i,G,a,E),M=Pc(i,U,a,M),w=Pc(i,V,a,w),P=Pc(i,V,c,P),n?B=_5(E,w,P,M,B):B=b5(V,U,c,i,B),m.pack(B,L,0),m.pack(w,N,0),m.pack(P,_,0),R.push(V.latitude),R.push(V.longitude),h5(V,U,a,c,r,o,i,L,N,_,R),f=1;f<I-1;++f){E=m.clone(w,E),w=m.clone(M,w);let j=O[f];Pc(i,j,c,P),Pc(i,O[f+1],a,M),_5(E,w,P,M,B),u=L.length,m.pack(B,L,u),m.pack(w,N,u),m.pack(P,_,u),R.push(j.latitude),R.push(j.longitude),h5(O[f],O[f+1],a,c,r,o,i,L,N,_,R)}let k=O[I-1],Y=O[I-2];if(w=Pc(i,k,a,w),P=Pc(i,k,c,P),n){let j=O[0];E=Pc(i,Y,a,E),M=Pc(i,j,a,M),B=_5(E,w,P,M,B)}else B=b5(Y,k,c,i,B);if(u=L.length,m.pack(B,L,u),m.pack(w,N,u),m.pack(P,_,u),R.push(k.latitude),R.push(k.longitude),n){for(h5(k,V,a,c,r,o,i,L,N,_,R),u=L.length,f=0;f<3;++f)L[u+f]=L[f],N[u+f]=N[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return oDe(n,s,N,_,L,R,t)};var LPe=new m,NPe=new $,FPe=new Ne;function kee(e,t,n,i){let r=fp(n,t,LPe),o=m.dot(r,e);if(o>Zee||o<Oee){let s=fp(i,n,ete),a=o<Oee?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Ne.fromAxisAngle(s,a,FPe),u=$.fromQuaternion(c,NPe);return $.multiplyByVector(u,e,e),!0}return!1}var Uee=new me,BPe=new m,Vee=new m;function cP(e,t,n,i,r){let o=me.toCartesian(t,e._ellipsoid,BPe),s=m.add(o,n,Vee),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Uee);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=m.subtract(o,n,Vee),u=c.cartesianToCartographic(s,Uee)),u.height=0;let f=e.project(u,r);return r=m.subtract(f,i,r),r.z=0,r=m.normalize(r,r),a&&m.negate(r,r),r}var kPe=new m,zee=new m;function Hee(e,t,n,i,r,o){let s=m.subtract(t,e,kPe);m.normalize(s,s);let a=n-$ee,c=m.multiplyByScalar(s,a,zee);m.add(e,c,r);let u=i-Qee;c=m.multiplyByScalar(s,u,zee),m.add(t,c,o)}var UPe=new m;function Pk(e,t){let n=un.getPointDistance(Dk,e),i=un.getPointDistance(Dk,t),r=UPe;D.equalsEpsilon(n,0,D.EPSILON2)?(r=fp(t,e,r),m.multiplyByScalar(r,D.EPSILON2,r),m.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=fp(e,t,r),m.multiplyByScalar(r,D.EPSILON2,r),m.add(t,r,t))}function VPe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let r=D.sign(t.longitude);return e.longitude=r*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let r=D.sign(e.longitude);return t.longitude=r*(i-D.EPSILON11),2}return 0}var tte=new me,nte=new me,Gee=new m,g5=new m,Wee=new m,jee=new m,zPe=new m,qee=new m,HPe=[tte,nte],GPe=new ce,WPe=new m,jPe=new m,qPe=new m,YPe=new m,XPe=new m,KPe=new m,y5=new m,x5=new m,JPe=new m,ZPe=new m,$Pe=new m,Yee=new m,QPe=new m,eDe=new m,tDe=new Yn,nDe=new Yn,Xee=new m,iDe=new m,Kee=new m,rDe=[new ae,new ae],ite=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Jee=ite.length;function oDe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),b=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),T=new Float32Array(p),S=new Float32Array(p),v,I,O,R;s&&(v=new Float32Array(p),I=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(d*2));let L=o.length/2,N=0,_=tte;_.height=0;let E=nte;E.height=0;let w=Gee,P=g5;if(s)for(c=0,a=1;a<L;a++)_.latitude=o[c],_.longitude=o[c+1],E.latitude=o[c+2],E.longitude=o[c+3],w=t.project(_,w),P=t.project(E,P),N+=m.distance(w,P),c+=2;let M=i.length/3;P=m.unpack(i,0,P);let B=0;for(c=3,a=1;a<M;a++)w=m.clone(P,w),P=m.unpack(i,c,P),B+=m.distance(w,P),c+=3;let V;c=3;let U=0,G=0,k=0,Y=0,j=!1,J=m.unpack(n,0,jee),W=m.unpack(i,0,g5),K=m.unpack(r,0,qee);if(e){let we=m.unpack(n,n.length-6,Wee);kee(K,we,J,W)&&(K=m.negate(K,K))}let Z=0,he=0,ge=0;for(a=0;a<f;a++){let we=m.clone(J,Wee),Se=m.clone(W,Gee),nt=m.clone(K,zPe);j&&(nt=m.negate(nt,nt)),J=m.unpack(n,c,jee),W=m.unpack(i,c,g5),K=m.unpack(r,c,qee),j=kee(K,we,J,W),_.latitude=o[U],_.longitude=o[U+1],E.latitude=o[U+2],E.longitude=o[U+3];let Ze,Gt,fn,pt;if(s){let Xi=VPe(_,E);Ze=t.project(_,XPe),Gt=t.project(E,KPe);let Ao=fp(Gt,Ze,Xee);Ao.y=Math.abs(Ao.y),fn=y5,pt=x5,Xi===0||m.dot(Ao,m.UNIT_Y)>Zee?(fn=cP(t,_,nt,Ze,y5),pt=cP(t,E,K,Gt,x5)):Xi===1?(pt=cP(t,E,K,Gt,x5),fn.x=0,fn.y=D.sign(_.longitude-Math.abs(E.longitude)),fn.z=0):(fn=cP(t,_,nt,Ze,y5),pt.x=0,pt.y=D.sign(_.longitude-E.longitude),pt.z=0)}let Tn=m.distance(Se,W),Vn=Yn.fromCartesian(we,tDe),Ut=m.subtract(J,we,JPe),Pt=m.normalize(Ut,Yee),Ce=m.subtract(Se,we,ZPe);Ce=m.normalize(Ce,Ce);let ve=m.cross(Pt,Ce,Yee);ve=m.normalize(ve,ve);let ot=m.cross(Ce,nt,QPe);ot=m.normalize(ot,ot);let Kt=m.subtract(W,J,$Pe);Kt=m.normalize(Kt,Kt);let _i=m.cross(K,Kt,eDe);_i=m.normalize(_i,_i);let Je=Tn/B,ho=Z/B,vr=0,zo,os,ke,st=0,Ke=0;if(s){vr=m.distance(Ze,Gt),zo=Yn.fromCartesian(Ze,nDe),os=m.subtract(Gt,Ze,Xee),ke=m.normalize(os,iDe);let Xi=ke.x;ke.x=ke.y,ke.y=-Xi,st=vr/N,Ke=he/N}for(V=0;V<8;V++){let Xi=Y+V*4,Ao=G+V*2,jn=Xi+3,Fn=V<4?1:-1,Ln=V===2||V===3||V===6||V===7?1:-1;m.pack(Vn.high,b,Xi),b[jn]=Ut.x,m.pack(Vn.low,C,Xi),C[jn]=Ut.y,m.pack(ot,A,Xi),A[jn]=Ut.z,m.pack(_i,T,Xi),T[jn]=Je*Fn,m.pack(ve,S,Xi);let gi=ho*Ln;gi===0&&Ln<0&&(gi=9),S[jn]=gi,s&&(v[Xi]=zo.high.x,v[Xi+1]=zo.high.y,v[Xi+2]=zo.low.x,v[Xi+3]=zo.low.y,O[Xi]=-fn.y,O[Xi+1]=fn.x,O[Xi+2]=pt.y,O[Xi+3]=-pt.x,I[Xi]=os.x,I[Xi+1]=os.y,I[Xi+2]=ke.x,I[Xi+3]=ke.y,R[Ao]=st*Fn,gi=Ke*Ln,gi===0&&Ln<0&&(gi=9),R[Ao+1]=gi)}let He=qPe,dt=YPe,_t=WPe,hn=jPe,Hi=ce.fromCartographicArray(HPe,GPe),Rr=oi.getMinimumMaximumHeights(Hi,u),ss=Rr.minimumTerrainHeight,As=Rr.maximumTerrainHeight;ge+=ss,ge+=As,Hee(we,Se,ss,As,He,_t),Hee(J,W,ss,As,dt,hn);let io=m.multiplyByScalar(ve,D.EPSILON5,Kee);m.add(He,io,He),m.add(dt,io,dt),m.add(_t,io,_t),m.add(hn,io,hn),Pk(He,dt),Pk(_t,hn),m.pack(He,x,k),m.pack(dt,x,k+3),m.pack(hn,x,k+6),m.pack(_t,x,k+9),io=m.multiplyByScalar(ve,-2*D.EPSILON5,Kee),m.add(He,io,He),m.add(dt,io,dt),m.add(_t,io,_t),m.add(hn,io,hn),Pk(He,dt),Pk(_t,hn),m.pack(He,x,k+12),m.pack(dt,x,k+15),m.pack(hn,x,k+18),m.pack(_t,x,k+21),U+=2,c+=3,G+=16,k+=24,Y+=32,Z+=Tn,he+=vr}c=0;let se=0;for(a=0;a<f;a++){for(V=0;V<Jee;V++)h[c+V]=ite[V]+se;se+=8,c+=Jee}let pe=rDe;ae.fromVertices(n,m.ZERO,3,pe[0]),ae.fromVertices(i,m.ZERO,3,pe[1]);let xe=ae.fromBoundingSpheres(pe);xe.radius+=ge/(f*2);let Pe={position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:mg(b),startLoAndForwardOffsetY:mg(C),startNormalAndForwardOffsetZ:mg(A),endNormalAndTextureCoordinateNormalizationX:mg(T),rightNormalAndTextureCoordinateNormalizationY:mg(S)};return s&&(Pe.startHiLo2D=mg(v),Pe.offsetAndRight2D=mg(I),Pe.startEndNormals2D=mg(O),Pe.texcoordNormalization2D=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new ft({attributes:Pe,indices:h,boundingSphere:xe})}function mg(e){return new De({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}hg._projectNormal=cP;var J0=hg;var lP=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; // Technically can compute distance for this here +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif + +void main(void) +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } - else - { - out_FragColor = vec4(0.0); + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } + + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; + + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); + + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + + czm_writeDepthClamp(); } -`;var jP=`in vec3 v_cubeMapCoordinates; -uniform samplerCube cubeMap; +`;var uP=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; -void main() +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; +#endif + +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) { - vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); - #ifdef RGBA_NORMALIZED - out_FragColor = vec4(rgba.rgb, 1.0); - #else - float m = rgba.a * 16.0; - vec3 r = rgba.rgb * m; - out_FragColor = vec4(r * r, 1.0); - #endif + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); + + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); + + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR } -`;var qP=`in vec4 position; -in vec3 cubeMapCoordinates; +`;var fP=`in vec3 position3DHigh; +in vec3 position3DLow; -out vec3 v_cubeMapCoordinates; +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; + +in float batchId; + +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. void main() { - gl_Position = position; - v_cubeMapCoordinates = cubeMapCoordinates; -} -`;function mA(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new _e}Object.defineProperties(mA.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});mA.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var MMe=new m(1,0,0),RMe=new m(0,0,1),BMe=new m(-1,0,0),LMe=new m(0,0,-1),MU=new m(0,1,0),NMe=new m(0,-1,0),Qte=[MU,BMe,RMe,NMe,MMe,MU,LMe,MU,MU],$te=Qte.length,ene=new Float32Array($te*3),Jte=0;for(let e=0;e<$te;++e,Jte+=3)m.pack(Qte[e],ene,Jte);var FMe=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),UMe=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function VMe(e){let t=mt.createVertexBuffer({context:e,typedArray:FMe,usage:Ne.STATIC_DRAW}),n=mt.createVertexBuffer({context:e,typedArray:ene,usage:Ne.STATIC_DRAW}),i=mt.createIndexBuffer({context:e,typedArray:UMe,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),r=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:X.FLOAT}];return new oi({context:e,attributes:r,indexBuffer:i})}function Zte(e){return function(){return e}}function M5(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(u(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let r=e._mipTextures;if(u(r))for(n=r.length,t=0;t<n;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}mA.prototype.update=function(e){let t=e.context;if(!mA.isSupported(t)||(u(this._texture)&&u(this._va)&&M5(this),u(this._texture)))return;if(!u(this._texture)&&!this._loading){let g=e.context.textureCache.getTexture(this._url);u(g)&&(M5(this),this._texture=g,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!u(n)&&!this._loading){let g=this;cl(this._url).then(function(h){g._cubeMapBuffers=h,g._loading=!1}).catch(function(h){g.isDestroyed()||g._errorEvent.raiseEvent(h)}),this._loading=!0}if(!u(this._cubeMapBuffers))return;let i=[],r=n[0].positiveX.pixelDatatype;u(r)?i.push("RGBA_NORMALIZED"):r=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT;let o=at.RGBA,s=new ke({defines:i,sources:[jP]});this._va=VMe(t),this._sp=Kt.fromCache({context:t,vertexShaderSource:qP,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),l=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let g=0;g<a;++g){let h=n[g].positiveY;n[g].positiveY=n[g].negativeY,n[g].negativeY=h;let A=c[g]=new Ga({context:t,source:n[g],pixelDatatype:r}),x=c[g].width*2,C=l[g]=new Rt({context:t,width:x,height:x,pixelDatatype:r,pixelFormat:o}),T=new Yu({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:Zte(A)},outputTexture:C,persists:!0,owner:this});e.commandList.push(T),d[`texture${g}`]=Zte(C)}this._texture=new Rt({context:t,width:f*1.5+2,height:f,pixelDatatype:r,pixelFormat:o}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Yu({fragmentShaderSource:WP,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};mA.prototype.isDestroyed=function(){return!1};mA.prototype.destroy=function(){return M5(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var xd=mA;function YP(e){e=y(e,y.EMPTY_OBJECT);let t=u(e.imageBasedLightingFactor)?H.clone(e.imageBasedLightingFactor):new H(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=H.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(YP.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=H.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return u(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return u(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function kMe(e,t){if(xd.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),u(e._specularEnvironmentMaps)){let n=new xd(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}YP.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||u(this._luminanceAtZenith)!==u(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||u(this._previousSphericalHarmonicCoefficients)!==u(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(kMe(this,t),this._specularEnvironmentMapAtlasDirty=!1),u(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!u(this._specularEnvironmentMapAtlas)&&u(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!u(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!u(this._sphericalHarmonicCoefficients)&&u(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!u(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!u(this._specularEnvironmentMapAtlas)&&u(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!u(this._sphericalHarmonicCoefficients)&&u(e.sphericalHarmonicCoefficients)};YP.prototype.isDestroyed=function(){return!1};YP.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var hA=YP;var B5=Ki(Yl(),1);var R5,tne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU",RU={};RU.defaultAccessToken=tne;RU.defaultServer=new we({url:"https://api.cesium.com/"});RU.getDefaultTokenCredit=function(e){if(e===tne){if(!u(R5)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;R5=new Dt(t,!0)}return R5}};var Cd=RU;function Fc(e,t){let n,i=e.externalType,r=u(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:zMe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new B5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}u(Object.create)&&(Fc.prototype=Object.create(we.prototype),Fc.prototype.constructor=Fc);Fc.fromAssetId=function(e,t){let n=Fc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Fc(i,n)})};Object.defineProperties(Fc.prototype,{credits:{get:function(){return u(this._ionRoot)?this._ionRoot.credits:u(this._credits)?this._credits:(this._credits=Fc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Fc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Dt.getIonCredit),i=Cd.getDefaultTokenCredit(t.queryParameters.access_token);return u(i)&&n.push(Dt.clone(i)),n};Fc.prototype.clone=function(e){let t=y(this._ionRoot,this);return u(e)||(e=new Fc(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Fc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},u(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Fc.prototype._makeRequest=function(e){return this._isExternal||new B5.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(u(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),we.prototype._makeRequest.call(this,e))};Fc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Cd.defaultServer),i=y(t.accessToken,Cd.defaultAccessToken);n=we.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return u(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};function zMe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,r=typeof Image<"u";return!u(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(u(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){return n._ionEndpoint=o,o}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Qs=Fc;function Wm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Wm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Wm.prototype.get=function(e){return this._array[e]};Wm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Wm.prototype.peek=function(){return this._array[this._length-1]};Wm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Wm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Wm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Wm.prototype.resize=function(e){this.length=e};Wm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Uc=Wm;var Cp={X:0,Y:1,Z:2};Cp.Y_UP_TO_Z_UP=N.fromRotationTranslation(Q.fromRotationX(P.PI_OVER_TWO));Cp.Z_UP_TO_Y_UP=N.fromRotationTranslation(Q.fromRotationX(-P.PI_OVER_TWO));Cp.X_UP_TO_Z_UP=N.fromRotationTranslation(Q.fromRotationY(-P.PI_OVER_TWO));Cp.Z_UP_TO_X_UP=N.fromRotationTranslation(Q.fromRotationY(P.PI_OVER_TWO));Cp.X_UP_TO_Y_UP=N.fromRotationTranslation(Q.fromRotationZ(P.PI_OVER_TWO));Cp.Y_UP_TO_X_UP=N.fromRotationTranslation(Q.fromRotationZ(-P.PI_OVER_TWO));Cp.fromName=function(e){return Cp[e]};var hr=Object.freeze(Cp);function nne(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(nne.prototype,{metadata:{get:function(){return this._metadata}}});var pA=nne;function gg(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),gg.decode(e)}gg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};gg.decodeWithFromCharCode=function(e){let t="",n=HMe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function XP(e,t,n){return t<=e&&e<=n}function HMe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let l=e[c];if(i===0){if(XP(l,0,127)){s.push(l);continue}if(XP(l,194,223)){i=1,t=l&31;continue}if(XP(l,224,239)){l===224&&(r=160),l===237&&(o=159),i=2,t=l&15;continue}if(XP(l,240,244)){l===240&&(r=144),l===244&&(o=143),i=3,t=l&7;continue}throw new de("String decoding failed.")}if(!XP(l,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|l&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?gg.decode=gg.decodeWithTextDecoder:gg.decode=gg.decodeWithFromCharCode;var _l=gg;function GMe(e,t){return t=y(t,0),_l(e,t,Math.min(4,e.length))}var Td=GMe;function Ed(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,u(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r})}Object.defineProperties(Ed.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Composite3DTileContent.readyPromise","Composite3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Composite3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var KP=Uint32Array.BYTES_PER_ELEMENT;Ed.fromTileType=async function(e,t,n,i,r,o){r=y(r,0);let s=new Uint8Array(i),a=new DataView(i);r+=KP;let c=a.getUint32(r,!0);if(c!==1)throw new de(`Only Composite Tile version 1 is supported. Version ${c} is not.`);r+=KP,r+=KP;let l=a.getUint32(r,!0);r+=KP;let f=n.queryParameters.compositeIndex;u(f)?f=`${f}_`:f="";let d=[];d.length=l;for(let h=0;h<l;++h){let A=Td(s,r),x=a.getUint32(r+KP*2,!0),C=o[A],T=`${f}${h}`,E=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(u(C))d[h]=Promise.resolve(C(e,t,E,i,r));else throw new de(`Unknown tile content type, ${A}, inside Composite tile`);r+=x}let p=await Promise.all(d);return new Ed(e,t,n,p)};Ed.prototype.hasProperty=function(e,t){return!1};Ed.prototype.getFeature=function(e){};Ed.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};Ed.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Ed.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};Ed.prototype.isDestroyed=function(){return!1};Ed.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var JP=Ed;function WMe(e,t,n){return JSON.parse(_l(e,t,n))}var Br=WMe;function Ka(e){this._id=jn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Ht.maximumTextureSize),o=Math.ceil(t/Ht.maximumTextureSize),s=1/r,a=s*.5,c=1/o,l=c*.5;n=new H(r,o),i=new oe(s,a,c,l)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Ka.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return u(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),u(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Ka.DEFAULT_COLOR_VALUE=z.WHITE;Ka.DEFAULT_SHOW_VALUE=!0;function ine(e){let t=e._textureDimensions;return t.x*t.y*4}function rne(e){if(!u(e._batchValues)){let t=ine(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function one(e){if(!u(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Ka.prototype.setShow=function(e,t){if(t&&!u(this._showAlphaProperties))return;let n=one(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=rne(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Ka.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Ka.prototype.getShow=function(e){if(!u(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var jMe=new Array(4);Ka.prototype.setColor=function(e,t){if(z.equals(t,Ka.DEFAULT_COLOR_VALUE)&&!u(this._batchValues))return;let n=t.toBytes(jMe),i=n[3],r=rne(this),o=e*4,s=one(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,l=s[a]!==0;r[o+3]=l?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,u(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Ka.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Ka.prototype.getColor=function(e,t){if(!u(this._batchValues))return z.clone(Ka.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};Ka.prototype.getPickColor=function(e){return this._pickIds[e]};function sne(e,t,n){let i=e._textureDimensions;return new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:fn.NEAREST})}function qMe(e,t){let n=e._featuresLength;if(!u(e._pickTexture)&&n>0){let i=e._pickIds,r=ine(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let l=t.createPickId(s.getFeature(c));i.push(l);let f=l.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=sne(e,t,o),u(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function YMe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ka.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&qMe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,u(this._batchTexture)||(this._batchTexture=sne(this,n,this._batchValues),u(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),YMe(this))};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Vc=Ka;var XMe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},KMe={SCALAR:void 0,VEC2:H,VEC3:m,VEC4:oe,MAT2:ir,MAT3:Q,MAT4:N};function JMe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=XMe[e.type],r=KMe[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return X.createArrayBufferView(n,o,s,i*a)}}}var ou=JMe;function Tp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,ZMe(this,e.extension,e.binaryBody)}Object.defineProperties(Tp.prototype,{byteLength:{get:function(){return this._byteLength}}});function ZMe(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,l=t.parentCounts,f=t.parentIds,d=s,p=0;u(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=an.SCALAR,o=ou(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(u(l)){for(u(l.byteOffset)&&(l.componentType=y(l.componentType,X.UNSIGNED_SHORT),l.type=an.SCALAR,o=ou(l),l=o.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=l[i];p+=g.byteLength}u(f)&&u(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=an.SCALAR,o=ou(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let h=a.length;for(i=0;i<h;++i){let C=a[i].length,T=a[i].instances,E=QMe(C,T,n);p+=$Me(E),a[i].instances=_t(E,T)}let A=new Array(h).fill(0),x=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],x[i]=A[r],++A[r];p+=x.byteLength,e._classes=a,e._classIds=c,e._classIndexes=x,e._parentCounts=l,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function QMe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(u(s)){let a=o.componentType,c=o.type;if(!u(a))throw new de("componentType is required.");if(!u(c))throw new de("type is required.");if(!u(n))throw new de(`Property ${r} requires a batch table binary.`);let l=ou(o),f=l.componentsPerAttribute,d=l.classType,p=l.createArrayBufferView(n.buffer,n.byteOffset+s,e);u(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function $Me(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var eRe=[],tRe=[],nRe=0;function iRe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=eRe;c.length=Math.max(c.length,a);let l=++nRe,f=tRe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===l)continue;c[t]=l;let d=n(e,t);if(u(d))return d;let p=r[t],g=s[t];for(let h=0;h<p;++h){let A=o[g+h];A!==t&&f.push(A)}}}function rRe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(u(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function ZP(e,t,n){let i=e._parentCounts,r=e._parentIds;if(u(r)){if(u(i))return iRe(e,t,n)}else return n(e,t);return rRe(e,t,n)}Tp.prototype.hasProperty=function(e,t){let n=ZP(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(u(s[t]))return!0});return u(n)};Tp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(u(r[e]))return!0}return!1};Tp.prototype.getPropertyIds=function(e,t){return t=u(t)?t:[],t.length=0,ZP(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Tp.prototype.getProperty=function(e,t){return ZP(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(u(a))return u(a.typedArray)?oRe(a,s):We(a[s],!0)})};function oRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Tp.prototype.setProperty=function(e,t,n){let i=ZP(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],l=a.instances[t];if(u(l))return u(l.typedArray)?sRe(l,c,n):l[c]=We(n,!0),!0});return u(i)};function sRe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Tp.prototype.isClass=function(e,t){let n=ZP(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return u(n)};Tp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var _A=Tp;var aRe={HIGHLIGHT:0,REPLACE:1,MIX:2},gl=Object.freeze(aRe);var L5=Vc.DEFAULT_COLOR_VALUE,N5=Vc.DEFAULT_SHOW_VALUE;function pr(e,t,n,i,r){this.featuresLength=t;let o;u(n)&&(o=n.extensions),this._extensions=y(o,{});let s=cRe(n);this._properties=s,this._batchTableHierarchy=lRe(this,n,i);let a=cne(t,s,i);this._binaryPropertiesByteLength=uRe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Vc({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}pr._deprecationWarning=$;Object.defineProperties(pr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return u(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function cRe(e){let t={};if(!u(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=We(e[n],!0));return t}function lRe(e,t,n){if(!u(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(u(r)&&(pr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!u(i))return new _A({extension:i,binaryBody:n})}function cne(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(u(s)){let a=o.componentType,c=o.type;if(!u(a))throw new de("componentType is required.");if(!u(c))throw new de("type is required.");if(!u(n))throw new de(`Property ${r} requires a batch table binary.`);let l=ou(o),f=l.componentsPerAttribute,d=l.classType,p=l.createArrayBufferView(n.buffer,n.byteOffset+s,e);u(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function uRe(e){if(!u(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}pr.getBinaryProperties=function(e,t,n){return cne(e,t,n)};pr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};pr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};pr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};pr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};pr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};pr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};pr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var fRe=new z;pr.prototype.applyStyle=function(e){if(!u(e)){this.setAllColor(L5),this.setAllShow(N5);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=u(e.color)?y(e.color.evaluateColor(r,fRe),L5):L5,s=u(e.show)?y(e.show.evaluate(r),N5):N5;this.setColor(i,o),this.setShow(i,s)}};function dRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function mRe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}pr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return u(n)?n.isClass(e,t):!1};pr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};pr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(u(t))return t.getClassName(e)};pr.prototype.hasProperty=function(e,t){return u(this._properties[t])||u(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};pr.prototype.hasPropertyBySemantic=function(){return!1};pr.prototype.getPropertyIds=function(e,t){t=u(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),u(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};pr.prototype.getPropertyBySemantic=function(e,t){};pr.prototype.getProperty=function(e,t){if(u(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(u(i))return dRe(i,e)}let n=this._properties[t];if(u(n))return We(n[e],!0);if(u(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(u(i))return i}};pr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(u(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(u(o)){mRe(o,e,n);return}}if(u(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];u(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=We(n,!0)};function hRe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}pr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=lne(r,n,!1),s;return Ht.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${hRe(i)}${s}`}};function ane(e,t){return e=ke.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function pRe(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let l=r;l<e.length;++l){let f=e.charAt(l);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=l+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function lne(e,t,n){if(!u(t))return ane(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!u(r))return ane(e,n);let o=r[0],s=r[2];e=ke.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,l;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),l=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=pRe(e,t),l=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${l}`,n&&(e+=c),e+=`} -`,e}pr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=lne(i,t,!0),Ht.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};pr.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=ke.replaceMain(e,"tile_main"),Ht.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function _Re(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===gl.HIGHLIGHT)return 0;if(n===gl.REPLACE)return 1;if(n===gl.MIX)return P.clamp(i,P.EPSILON4,1)}pr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return _t(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return _Re(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};pr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var yg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};pr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=gRe(this);for(let l=t;l<i;++l){let f=n[l];if(f.pass===ve.COMPUTE)continue;let d=f.derivedCommands.tileset;(!u(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=yRe(f),f.dirty=!1);let p=d.originalCommand;c!==yg.ALL_OPAQUE&&f.pass!==ve.TRANSLUCENT&&(u(d.translucent)||(d.translucent=ARe(p))),c!==yg.ALL_TRANSLUCENT&&f.pass!==ve.TRANSLUCENT&&(u(d.opaque)||(d.opaque=xRe(p)),a&&(o||(u(d.zback)||(d.zback=TRe(e.context,p)),s._backfaceCommands.push(d.zback)),(!u(d.stencil)||r._selectionDepth!==bRe(d.stencil))&&(f.renderState.depthMask?d.stencil=ERe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,h=d.translucent;f.pass!==ve.TRANSLUCENT?(c===yg.ALL_OPAQUE&&(n[l]=g),c===yg.ALL_TRANSLUCENT&&(n[l]=h),c===yg.OPAQUE_AND_TRANSLUCENT&&(n[l]=g,n.push(h))):n[l]=p}};function gRe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?yg.ALL_OPAQUE:t===e.featuresLength?yg.ALL_TRANSLUCENT:yg.OPAQUE_AND_TRANSLUCENT}function yRe(e){let t=et.shallowClone(e),n=t.pass===ve.TRANSLUCENT;return t.uniformMap=u(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function ARe(e){let t=et.shallowClone(e);return t.pass=ve.TRANSLUCENT,t.renderState=SRe(e.renderState),t}function xRe(e){let t=et.shallowClone(e);return t.renderState=vRe(e.renderState),t}function CRe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!u(n)){let i=t.fragmentShaderSource.clone();i.defines=u(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),i.sources.unshift(`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -`),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function TRe(e,t){let n=et.shallowClone(t),i=We(n.renderState,!0);i.cull.enabled=!0,i.cull.face=yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ft.setCesium3DTileBit(),i.stencilMask=Ft.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=We(t.uniformMap);let r=new H(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=CRe(e,t.shaderProgram),n}function ERe(e,t){let n=et.shallowClone(e),i=We(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ft.SKIP_LOD_MASK,i.stencilTest.reference=Ft.CESIUM_3D_TILE_MASK|t<<Ft.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Hn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Hn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=Ft.CESIUM_3D_TILE_MASK|Ft.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function bRe(e){return(e.renderState.stencilTest.reference&Ft.SKIP_LOD_MASK)>>>Ft.SKIP_LOD_BIT_SHIFT}function SRe(e){let t=We(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=dn.ALPHA_BLEND,t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function vRe(e){let t=We(e,!0);return t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}pr.prototype.update=function(e,t){this._batchTexture.update(e,t)};pr.prototype.isDestroyed=function(){return!1};pr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Ep=pr;function wRe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var jm=wRe;var MT=`in vec3 position; -in float a_batchId; + v_batchId = batchId; -uniform mat4 u_modifiedModelViewProjection; + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;function rf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(rf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return u(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(u(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});rf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};rf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};rf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};rf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(u(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let r=e.metadata;if(u(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}let o=e.tile,s=o.metadata;if(u(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(u(o.implicitSubtree)&&(a=o.implicitSubtree.metadata),u(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=u(e.group)?e.group.metadata:void 0;if(u(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let l=e.tileset.metadata;if(u(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}};rf.prototype.getPropertyInherited=function(e){return rf.getPropertyInherited(this._content,this._batchId,e)};rf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};rf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};rf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};rf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Is=rf;var F5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},U5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},He=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+He.version}static addUnaryOp(t){return He.max_unop_len=Math.max(t.length,He.max_unop_len),He.unary_ops[t]=1,He}static addBinaryOp(t,n,i){return He.max_binop_len=Math.max(t.length,He.max_binop_len),He.binary_ops[t]=n,i?He.right_associative.add(t):He.right_associative.delete(t),He}static addIdentifierChar(t){return He.additional_identifier_chars.add(t),He}static addLiteral(t,n){return He.literals[t]=n,He}static removeUnaryOp(t){return delete He.unary_ops[t],t.length===He.max_unop_len&&(He.max_unop_len=He.getMaxKeyLen(He.unary_ops)),He}static removeAllUnaryOps(){return He.unary_ops={},He.max_unop_len=0,He}static removeIdentifierChar(t){return He.additional_identifier_chars.delete(t),He}static removeBinaryOp(t){return delete He.binary_ops[t],t.length===He.max_binop_len&&(He.max_binop_len=He.getMaxKeyLen(He.binary_ops)),He.right_associative.delete(t),He}static removeAllBinaryOps(){return He.binary_ops={},He.max_binop_len=0,He}static removeLiteral(t){return delete He.literals[t],He}static removeAllLiterals(){return He.literals={},He}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new He(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return He.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!He.binary_ops[String.fromCharCode(t)]||He.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return He.isIdentifierStart(t)||He.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(He.hooks[t]){let i={context:this,node:n};return He.hooks.run(t,i),i.node}return n}searchHook(t){if(He.hooks[t]){let n={context:this};return He.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===He.SPACE_CODE||t===He.TAB_CODE||t===He.LF_CODE||t===He.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:He.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===He.SEMCOL_CODE||i===He.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,He.max_binop_len),n=t.length;for(;n>0;){if(He.binary_ops.hasOwnProperty(t)&&(!He.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!He.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,l;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:He.binaryPrecedence(n),right_a:He.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=He.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:He.right_associative.has(n)},l=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:He.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+l),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:He.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,He.isDecimalDigit(t)||t===He.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===He.SQUOTE_CODE||t===He.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===He.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,He.max_unop_len),i=n.length;i>0;){if(He.unary_ops.hasOwnProperty(n)&&(!He.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!He.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:He.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}He.isIdentifierStart(t)?(r=this.gobbleIdentifier(),He.literals.hasOwnProperty(r.name)?r={type:He.LITERAL,value:He.literals[r.name],raw:r.name}:r.name===He.this_str&&(r={type:He.THIS_EXP})):t===He.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===He.PERIOD_CODE||n===He.OBRACK_CODE||n===He.OPAREN_CODE||n===He.QUMARK_CODE;){let i;if(n===He.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==He.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===He.OBRACK_CODE?(t={type:He.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==He.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===He.OPAREN_CODE?t={type:He.CALL_EXP,arguments:this.gobbleArguments(He.CPAREN_CODE),callee:t}:(n===He.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:He.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;He.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===He.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);He.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));He.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);He.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,He.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===He.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===He.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:He.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:He.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(He.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,He.isIdentifierPart(t));)this.index++;return{type:He.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===He.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===He.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===He.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===He.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===He.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(He.CPAREN_CODE);if(this.code===He.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:He.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:He.ARRAY_EXP,elements:this.gobbleArguments(He.CBRACK_CODE)}}},DRe=new F5;Object.assign(He,{hooks:DRe,plugins:new U5(He),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});He.max_unop_len=He.getMaxKeyLen(He.unary_ops);He.max_binop_len=He.getMaxKeyLen(He.binary_ops);var Ag=e=>new He(e).parse(),IRe=Object.getOwnPropertyNames(He);IRe.forEach(e=>{Ag[e]===void 0&&e!=="prototype"&&(Ag[e]=He[e])});Ag.Jsep=He;var PRe="ConditionalExpression",ORe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:PRe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Ag.plugins.register(ORe);var MRe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(MRe);function bd(e,t){this._expression=e,e=jRe(e,t),e=YRe(qRe(e)),Ag.addBinaryOp("=~",0),Ag.addBinaryOp("!~",0);let n;try{n=Ag(e)}catch(i){throw new de(i)}this._runtimeAst=Ei(this,n)}Object.defineProperties(bd.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};bd.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof oe?n.clone(t):n};bd.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};bd.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} -{ - return ${r}; -} -`,r};bd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};bd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var RRe=["!","-","+"],une=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],NU=/\${(.*?)}/g,BRe=/\\/g,LRe="@#%",NRe=/@#%/g,FU=new z,UU={abs:Ps(Math.abs),sqrt:Ps(Math.sqrt),cos:Ps(Math.cos),sin:Ps(Math.sin),tan:Ps(Math.tan),acos:Ps(Math.acos),asin:Ps(Math.asin),atan:Ps(Math.atan),radians:Ps(P.toRadians),degrees:Ps(P.toDegrees),sign:Ps(P.sign),floor:Ps(Math.floor),ceil:Ps(Math.ceil),round:Ps(Math.round),exp:Ps(Math.exp),exp2:Ps(URe),log:Ps(Math.log),log2:Ps(VRe),fract:Ps(FRe),length:kRe,normalize:zRe},VU={atan2:BU(Math.atan2,!1),pow:BU(Math.pow,!1),min:BU(Math.min,!0),max:BU(Math.max,!0),distance:HRe,dot:GRe,cross:WRe},z5={clamp:fne(P.clamp,!0),mix:fne(P.lerp,!0)};function FRe(e){return e-Math.floor(e)}function URe(e){return Math.pow(2,e)}function VRe(e){return P.log2(e)}function Ps(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function BU(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof H)return H.fromElements(e(i.x,r),e(i.y,r),Rn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Rn.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Rn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x),e(i.y,r.y),Rn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function fne(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Rn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof H&&r instanceof H&&o instanceof H)return H.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Rn.getCartesian2());if(i instanceof m&&r instanceof m&&o instanceof m)return m.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function kRe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function zRe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof m)return m.normalize(t,Rn.getCartesian3());if(t instanceof oe)return oe.normalize(t,Rn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function HRe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function GRe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function WRe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Rn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function At(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,iBe(this)}function jRe(e,t){if(!u(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;u(r)&&(e=e.replace(i,r))}return e}function qRe(e){return e.replace(BRe,LRe)}function k5(e){return e.replace(NRe,"\\")}function YRe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new de("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function XRe(e){let t=typeof e.value;if(e.value===null)return new At(gt.LITERAL_NULL,null);if(t==="boolean")return new At(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new At(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new At(gt.VARIABLE_IN_STRING,e.value):new At(gt.LITERAL_STRING,k5(e.value))}function KRe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!u(c.callee)||c.callee.name!=="regExp")throw new de(`${r} is not a function.`);return i===0?r==="test"?new At(gt.LITERAL_BOOLEAN,!1):new At(gt.LITERAL_NULL,null):(s=Ei(e,c),a=Ei(e,n[0]),new At(gt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ei(e,c),new At(gt.FUNCTION_CALL,r,o);throw new de(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new At(gt.LITERAL_COLOR,r);if(o=Ei(e,n[0]),u(n[1])){let c=Ei(e,n[1]);return new At(gt.LITERAL_COLOR,r,[o,c])}return new At(gt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new de(`${r} requires three arguments.`);return o=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2])],new At(gt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new de(`${r} requires four arguments.`);return o=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2]),Ei(e,n[3])],new At(gt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Ei(e,n[c]);return new At(gt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new At(gt.LITERAL_BOOLEAN,!0):new At(gt.LITERAL_BOOLEAN,!1):(o=Ei(e,n[0]),new At(gt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new de(`${r} requires exactly one argument.`);return o=Ei(e,n[0]),new At(gt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new de(`${r} does not take any argument.`);return new At(gt.UNARY,r)}else if(u(UU[r])){if(i!==1)throw new de(`${r} requires exactly one argument.`);return o=Ei(e,n[0]),new At(gt.UNARY,r,o)}else if(u(VU[r])){if(i!==2)throw new de(`${r} requires exactly two arguments.`);return s=Ei(e,n[0]),a=Ei(e,n[1]),new At(gt.BINARY,r,s,a)}else if(u(z5[r])){if(i!==3)throw new de(`${r} requires exactly three arguments.`);s=Ei(e,n[0]),a=Ei(e,n[1]);let c=Ei(e,n[2]);return new At(gt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new At(gt.LITERAL_BOOLEAN,!1):(o=Ei(e,n[0]),new At(gt.UNARY,r,o));if(r==="Number")return i===0?new At(gt.LITERAL_NUMBER,0):(o=Ei(e,n[0]),new At(gt.UNARY,r,o));if(r==="String")return i===0?new At(gt.LITERAL_STRING,""):(o=Ei(e,n[0]),new At(gt.UNARY,r,o));if(r==="regExp")return JRe(e,t)}}throw new de(`Unexpected function call "${r}".`)}function JRe(e,t){let n=t.arguments;if(n.length===0)return new At(gt.LITERAL_REGEX,new RegExp);let i=Ei(e,n[0]),r;if(n.length>1){let o=Ei(e,n[1]);if(V5(i)&&V5(o)){try{r=new RegExp(k5(String(i._value)),o._value)}catch(s){throw new de(s)}return new At(gt.LITERAL_REGEX,r)}return new At(gt.REGEX,i,o)}if(V5(i)){try{r=new RegExp(k5(String(i._value)))}catch(o){throw new de(o)}return new At(gt.LITERAL_REGEX,r)}return new At(gt.REGEX,i)}function ZRe(e){if(tBe(e.name)){let t=nBe(e.name);return t.substr(0,8)==="tiles3d_"?new At(gt.BUILTIN_VARIABLE,t):new At(gt.VARIABLE,t)}else{if(e.name==="NaN")return new At(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new At(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new At(gt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function QRe(e){let t=e.property.name;if(t==="PI")return new At(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new At(gt.LITERAL_NUMBER,Math.E)}function $Re(e){if(e.property.name==="POSITIVE_INFINITY")return new At(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function eBe(e,t){if(t.object.name==="Math")return QRe(t);if(t.object.name==="Number")return $Re(t);let n,i=Ei(e,t.object);return t.computed?(n=Ei(e,t.property),new At(gt.MEMBER,"brackets",i,n)):(n=new At(gt.LITERAL_STRING,t.property.name),new At(gt.MEMBER,"dot",i,n))}function V5(e){return e._type>=gt.LITERAL_NULL}function tBe(e){return e.substr(0,4)==="czm_"}function nBe(e){return e.substr(4)}function Ei(e,t){let n,i,r,o;if(t.type==="Literal")n=XRe(t);else if(t.type==="CallExpression")n=KRe(e,t);else if(t.type==="Identifier")n=ZRe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ei(e,t.argument);if(RRe.indexOf(i)>-1)n=new At(gt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Ei(e,t.left),o=Ei(e,t.right),une.indexOf(i)>-1)n=new At(gt.BINARY,i,r,o);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Ei(e,t.left),o=Ei(e,t.right),une.indexOf(i)>-1&&(n=new At(gt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ei(e,t.test);r=Ei(e,t.consequent),o=Ei(e,t.alternate),n=new At(gt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=eBe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ei(e,t.elements[a]);n=new At(gt.ARRAY,s)}else throw t.type==="Compound"?new de("Provide exactly one expression."):new de("Cannot parse expression.");return n}function iBe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:u(UU[e._value])&&(e.evaluate=oBe(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:u(VU[e._value])&&(e.evaluate=sBe(e._value)):e._type===gt.TERNARY?e.evaluate=aBe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=rBe):e.evaluate=e._evaluateLiteral}function rBe(e){return u(e)?e.content.tileset.timeSinceLoad:0}function oBe(e){let t=UU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function sBe(e){let t=VU[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function aBe(e){let t=z5[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function kU(e,t){if(u(e))return e.getPropertyInherited(t)}At.prototype._evaluateLiteral=function(){return this._value};At.prototype._evaluateLiteralColor=function(e){let t=FU,n=this._left;if(this._value==="color")u(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Rn.getCartesian4())};At.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof H)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new de(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new de(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Rn.getCartesian4())};At.prototype._evaluateLiteralString=function(){return this._value};At.prototype._evaluateVariableString=function(e){let t=this._value,n=NU.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=kU(e,r);u(o)||(o=""),t=t.replace(i,o),n=NU.exec(t)}return t};At.prototype._evaluateVariable=function(e){return kU(e,this._value)};function gA(e){return e._value==="feature"}At.prototype._evaluateMemberDot=function(e){if(gA(this._left))return kU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!u(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};At.prototype._evaluateMemberBrackets=function(e){if(gA(this._left))return kU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!u(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};At.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};At.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};At.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof H)return H.negate(t,Rn.getCartesian2());if(t instanceof m)return m.negate(t,Rn.getCartesian3());if(t instanceof oe)return oe.negate(t,Rn.getCartesian4());if(typeof t=="number")return-t;throw new de(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};At.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof H||t instanceof m||t instanceof oe||typeof t=="number"))throw new de(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};At.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};At.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};At.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};At.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};At.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};At.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};At.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Rn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Rn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?t.equals(n):t===n};At.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};At.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};At.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};At.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};At.prototype._evaluateIsExactClass=function(e){return u(e)?e.isExactClass(this._left.evaluate(e)):!1};At.prototype._evaluateIsClass=function(e){return u(e)?e.isClass(this._left.evaluate(e)):!1};At.prototype._evaluateGetExactClassName=function(e){if(u(e))return e.getExactClassName()};At.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};At.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};At.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};At.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";u(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new de(r)}return i};At.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};At.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return u(i)?i[1]:null};At.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof oe)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function dne(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,FU)}function mne(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==gt.LITERAL_NUMBER)return;let i=FU;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function xg(e){return e%1===0?e.toFixed(1):e.toString()}function cBe(e){let t=xg(e.red),n=xg(e.green),i=xg(e.blue);return`vec3(${t}, ${n}, ${i})`}function LU(e){let t=xg(e.red),n=xg(e.green),i=xg(e.blue),r=xg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function hne(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function pne(e,t){return u(t[e])?t[e]:bd.NULL_SENTINEL}bd.NULL_SENTINEL="czm_infinity";At.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;u(this._left)&&(Array.isArray(this._left)?r=hne(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),u(this._right)&&(o=this._right.getShaderExpression(e,t,this)),u(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=hne(this._value,e,t,this));let l,f,d;switch(a){case gt.VARIABLE:return gA(this)?void 0:pne(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(u(UU[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new de(`Error generating style shader: "${c}" is not supported.`);return c+r;case gt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:u(VU[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case gt.TERNARY:if(u(z5[c]))return`${c}(${r}, ${o}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case gt.MEMBER:return gA(this._left)?pne(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case gt.FUNCTION_CALL:throw new de(`Error generating style shader: "${c}" is not supported.`);case gt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new de("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new de("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return bd.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return xg(c);case gt.LITERAL_STRING:if(u(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||gA(n._left)))return c;if(i=z.fromCssColorString(c,FU),u(i))return cBe(i);throw new de("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(l=r,c==="color"){if(u(l)){if(l.length>1){let p=l[0],g=l[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${l[0]}, 1.0)`}else{if(c==="rgb")return i=mne(this),u(i)?LU(i):`vec4(${l[0]} / 255.0, ${l[1]} / 255.0, ${l[2]} / 255.0, 1.0)`;if(c==="rgba")return l[3]!=="1.0"&&(t.translucent=!0),i=mne(this),u(i)?LU(i):`vec4(${l[0]} / 255.0, ${l[1]} / 255.0, ${l[2]} / 255.0, ${l[3]})`;if(c==="hsl")return i=dne(this),u(i)?LU(i):`vec4(czm_HSLToRGB(vec3(${l[0]}, ${l[1]}, ${l[2]})), 1.0)`;if(c==="hsla")return i=dne(this),u(i)?(i.alpha!==1&&(t.translucent=!0),LU(i)):(l[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${l[0]}, ${l[1]}, ${l[2]})), ${l[3]})`)}break;case gt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case gt.LITERAL_REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return bd.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};At.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(u(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(u(this._right)&&this._right.getVariables(e,this),u(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case gt.VARIABLE:gA(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=NU.exec(s);a!==null;)e.push(a[1]),a=NU.exec(s);break;case gt.LITERAL_STRING:u(t)&&t._type===gt.MEMBER&&gA(t._left)&&e.push(s);break}};var of=bd;function bp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,m.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,zn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(bp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var lBe={position:0,a_batchId:1};function uBe(e,t){if(u(e._va))return;let n=mt.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=mt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),r=mt.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new oi({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new oi({context:t,attributes:o,indexBuffer:mt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function fBe(e,t){if(u(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,lBe),r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(u(o)){e._sp=Kt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=ke.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`,e._spPick=Kt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(MT),c=n.getFragmentShaderCallback(!1,void 0,!0)(fg);r=n.getPickId();let l=new ke({sources:[a]}),f=new ke({defines:["VECTOR_TILE"],sources:[c]});e._sp=Kt.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:f,attributeLocations:i}),l=new ke({sources:[MT]}),f=new ke({defines:["VECTOR_TILE"],sources:[fg]}),e._spStencil=Kt.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:f,attributeLocations:i}),c=ke.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`;let d=new ke({sources:[a]}),p=new ke({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Kt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function _ne(e){let t=e?Hn.EQUAL:Hn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qa.LESS_OR_EQUAL},depthMask:!1}}var dBe={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},mBe={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function hBe(e){u(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(_ne(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(_ne(!0)),e._rsColorPass=Ve.fromCache(dBe),e._rsPickPass=Ve.fromCache(mBe))}var yA=new N,gne=new m;function pBe(e,t){if(u(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return N.clone(i,yA),N.multiplyByPoint(yA,e._center,gne),N.setTranslation(yA,gne,yA),N.multiply(r,yA,yA),yA},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function H5(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let l=0;l<c;++l){let f=o[l],d=s[f],p=i[d],g=r[d],h=new e.constructor(e.buffer,a*p,g);t.set(h,n),i[d]=n,n+=g}return n}function _Be(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],l=H5(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=l;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))l=H5(n,s,l,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=l-a.offset;else{let d=l;l=H5(n,s,l,i,r,f.batchIds,o),f.offset=d,f.count=l-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function G5(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let l=0;l<c;++l){let f=o[l],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function gBe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,l=G5(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=l;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))l=G5(a,c,l,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=l-o.offset;else{let p=l;l=G5(a,c,l,n,i,d.batchIds,r),d.offset=p,d.count=l-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function yBe(e,t){return t.color.toRgba()-e.color.toRgba()}function ABe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(u(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(yBe),t.webgl2?gBe(e,n):_Be(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function xBe(e,t){let n=ABe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(u(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,l=y(e._modelMatrix,N.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,h=r[p].count,A=i[p*2];u(A)||(A=i[p*2]=new et({owner:e})),A.vertexArray=a,A.modelMatrix=l,A.offset=g,A.count=h,A.renderState=e._rsStencilDepthPass,A.shaderProgram=c,A.uniformMap=f,A.boundingVolume=d,A.cull=!1,A.pass=ve.TERRAIN_CLASSIFICATION;let x=et.shallowClone(A,A.derivedCommands.tileset);x.renderState=e._rsStencilDepthPass3DTiles,x.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=x;let C=i[p*2+1];u(C)||(C=i[p*2+1]=new et({owner:e})),C.vertexArray=a,C.modelMatrix=l,C.offset=g,C.count=h,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=d,C.cull=!1,C.pass=ve.TERRAIN_CLASSIFICATION;let T=et.shallowClone(C,C.derivedCommands.tileset);T.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=T}e._commandsDirty=!0}function CBe(e,t){if(e.classificationType===zn.TERRAIN||!t.invertClassification||u(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let l=i[c]=et.shallowClone(n[a],i[c]);l.shaderProgram=r,l.pass=ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function TBe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=y(e._modelMatrix,N.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let l=e._indexOffsets[c],f=e._indexCounts[c],d=u(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];u(p)||(p=n[c*2]=new et({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=l,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=ve.TERRAIN_CLASSIFICATION;let g=et.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let h=n[c*2+1];u(h)||(h=n[c*2+1]=new et({owner:e,pickOnly:!0})),h.vertexArray=i,h.modelMatrix=s,h.offset=l,h.count=f,h.renderState=e._rsPickPass,h.shaderProgram=o,h.uniformMap=a,h.boundingVolume=d,h.pass=ve.TERRAIN_CLASSIFICATION;let A=et.shallowClone(h,h.derivedCommands.tileset);A.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=A}e._pickCommandsDirty=!1}bp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Is(e,o)}};bp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function EBe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var bBe=new z,SBe=z.WHITE,vBe=!0,wBe=/\$/;bp.prototype.applyStyle=function(e,t){if(!u(e)){EBe(this,t);return}let n=e.color,i=n instanceof of&&!wBe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=u(e.color)?e.color.evaluateColor(c,bBe):SBe,c.show=u(e.show)?e.show.evaluate(c):vBe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};bp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!u(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,l=c.length,f;for(f=0;f<l;++f){let A=c[f].offset,x=c[f].count;if(s>=A&&s<A+x)break}c.push(new jm({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,h=g.length;for(let A=0;A<h;++A){let x=g[A];if(x===e)continue;let C=n[x];r[C]<s?d.push(x):p.push(x)}p.length!==0&&c.push(new jm({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function yne(e,t,n,i){let r=e.classificationType,o=r!==zn.CESIUM_3D_TILE,s=r!==zn.TERRAIN,a=t.commandList,c=n.length,l,f;for(f=0;f<c;++f)o&&(l=n[f],l.pass=ve.TERRAIN_CLASSIFICATION,a.push(l)),s&&(l=n[f].derivedCommands.tileset,l.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,a.push(l));if(!(!t.invertClassification||!u(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function DBe(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=ve.OPAQUE,n.push(o)}}function IBe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;u(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Be.LINES):(n=e._rsColorPass,i=Be.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}bp.prototype.update=function(e){let t=e.context;uBe(this,t),fBe(this,t),hBe(this),pBe(this,t);let n=e.passes;n.render&&(xBe(this,t),CBe(this,e),IBe(this),this._debugWireframe?DBe(e,this._commands):yne(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(TBe(this),yne(this,e,this._pickCommands))};bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var AA=bp;function su(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,u(this._center)||(u(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=zn.BOTH}Object.defineProperties(su.prototype,{trianglesLength:{get:function(){return u(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return u(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});su.packedBoxLength=N.packedLength+m.packedLength;su.packedCylinderLength=N.packedLength+2;su.packedEllipsoidLength=N.packedLength+m.packedLength;su.packedSphereLength=m.packedLength+1;function PBe(e){let t=new Float64Array(N.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,N.pack(e._modelMatrix,t,n),t}function OBe(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let l=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let h=0;h<p;++h)g[h]=t[n++];a[c]=new jm({color:l,offset:f,count:d,batchIds:g})}return i}var MBe=new _i("createVectorTileGeometries",5),RBe=new z;function BBe(e){if(!u(e._primitive)&&!u(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,l=e._batchTableColors,f=e._packedBuffer;if(!u(l)){let h=0;u(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),h+=n.length),u(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),h+=r.length),u(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),h+=s.length),u(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),h+=c.length),l=e._batchTableColors=new Uint32Array(h);let A=e._batchTable;for(let x=0;x<h;++x){let C=A.getColor(x,RBe);l[x]=C.toRgba()}f=e._packedBuffer=PBe(e)}let d=[];u(t)&&d.push(t.buffer,n.buffer),u(i)&&d.push(i.buffer,r.buffer),u(o)&&d.push(o.buffer,s.buffer),u(a)&&d.push(a.buffer,c.buffer),d.push(l.buffer,f.buffer);let p={boxes:u(t)?t.buffer:void 0,boxBatchIds:u(t)?n.buffer:void 0,cylinders:u(i)?i.buffer:void 0,cylinderBatchIds:u(i)?r.buffer:void 0,ellipsoids:u(o)?o.buffer:void 0,ellipsoidBatchIds:u(o)?s.buffer:void 0,spheres:u(a)?a.buffer:void 0,sphereBatchIds:u(a)?c.buffer:void 0,batchTableColors:l.buffer,packedBuffer:f.buffer},g=e._verticesPromise=MBe.scheduleTask(p,d);return u(g)?g.then(function(h){if(e.isDestroyed())return;let A=new Float64Array(h.packedBuffer);OBe(e,A)===2?e._indices=new Uint16Array(h.indices):e._indices=new Uint32Array(h.indices),e._indexOffsets=new Uint32Array(h.indexOffsets),e._indexCounts=new Uint32Array(h.indexCounts),e._positions=new Float32Array(h.positions),e._vertexBatchIds=new Uint16Array(h.vertexBatchIds),e._batchIds=new Uint16Array(h.batchIds),LBe(e),e._ready=!0}).catch(h=>{e.isDestroyed()||(e._error=h)}):void 0}}function LBe(e){u(e._primitive)||(e._primitive=new AA({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}su.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};su.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};su.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};su.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};su.prototype.update=function(e){if(!this._ready){if(u(this._promise)||(this._promise=BBe(this)),u(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};su.prototype.isDestroyed=function(){return!1};su.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Sp=su;function vp(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),UBe(this,i,r)}Object.defineProperties(vp.prototype,{featuresLength:{get:function(){return u(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return u(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return u(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return u(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function NBe(e){return function(t,n){u(e._geometries)&&e._geometries.updateCommands(t,n)}}function FBe(e,t){let n,i,r,o,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),l=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&u(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&u(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(l>0&&u(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,l)}if(f>0&&u(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,f)}let d=u(n)||u(i)||u(r)||u(o),p=a>0&&!u(n)||c>0&&!u(i)||l>0&&!u(r)||f>0&&!u(o);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!u(n)&&!u(i)&&!u(r)&&!u(o)){let h=0;if(!u(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=h++;if(!u(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=h++;if(!u(r)&&l>0)for(r=new Uint16Array(l),s=0;s<l;++s)r[s]=h++;if(!u(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=h++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var xA=Uint32Array.BYTES_PER_ELEMENT;function UBe(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=xA;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=xA;let s=r.getUint32(n,!0);if(n+=xA,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=xA,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=xA;let l=r.getUint32(n,!0);n+=xA;let f=r.getUint32(n,!0);n+=xA;let d=Br(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,h;l>0&&(g=Br(i,n,l),n+=l,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let A=y(d.BOXES_LENGTH,0),x=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),E=A+x+C+T,S=new Ep(e,E,g,h,NBe(e));if(e._batchTable=S,E===0)return;let w=e.tile.computedTransform,D;u(d.RTC_CENTER)&&(D=m.unpack(d.RTC_CENTER),N.multiplyByPoint(w,D,D));let M=FBe(d,p);if(A>0||x>0||C>0||T>0){let O,B,L,_;if(A>0){let b=p.byteOffset+d.BOXES.byteOffset;O=new Float32Array(p.buffer,b,Sp.packedBoxLength*A)}if(x>0){let b=p.byteOffset+d.CYLINDERS.byteOffset;B=new Float32Array(p.buffer,b,Sp.packedCylinderLength*x)}if(C>0){let b=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,b,Sp.packedEllipsoidLength*C)}if(T>0){let b=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,b,Sp.packedSphereLength*T)}return e._geometries=new Sp({boxes:O,boxBatchIds:M.boxes,cylinders:B,cylinderBatchIds:M.cylinders,ellipsoids:L,ellipsoidBatchIds:M.ellipsoids,spheres:_,sphereBatchIds:M.spheres,center:D,modelMatrix:w,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Ane(e){let t=e.featuresLength;if(!u(e._features)&&t>0){let n=new Array(t);u(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}vp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};vp.prototype.getFeature=function(e){return Ane(this),this._features[e]};vp.prototype.applyDebugSettings=function(e,t){u(this._geometries)&&this._geometries.applyDebugSettings(e,t)};vp.prototype.applyStyle=function(e){Ane(this),u(this._geometries)&&this._geometries.applyStyle(e,this._features)};vp.prototype.update=function(e,t){u(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),u(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};vp.prototype.isDestroyed=function(){return!1};vp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var QP=vp;var W5={};W5.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),xne(i,r,o,s);return c};W5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),xne(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function xne(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var RT=W5;var CA=30,VBe=1<<CA,kBe=1<<CA+1>>>0,j5=2*CA+1,Cg=4,Ene=[],bne=[],zBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Tg=1,BT=2,zU=[Tg,0,0,Tg|BT];function Wo(e){if(!Gt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Wo.getLevel(e)}Wo.fromToken=function(e){return new Wo(Wo.getIdFromToken(e))};Wo.isValidId=function(e){return!(e<=0||e>>BigInt(j5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Wo.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Wo.isValidId(Wo.getIdFromToken(e)):!1};Wo.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Wo.getTokenFromId=function(e){let t=Math.floor(ZBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Wo.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return CA-(t>>1)};Wo.prototype.getChild=function(e){let t=wne(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Wo(n)};Wo.prototype.getParent=function(){let e=wne(this._cellId)<<BigInt(2);return new Wo(this._cellId&~e+BigInt(1)|e)};Wo.prototype.getParentAtLevel=function(e){let t=KBe(e);return new Wo(this._cellId&-t|t)};Wo.prototype.getCenter=function(e){e=y(e,re.WGS84);let t=HBe(this._cellId,this._level);t=m.normalize(t,t);let n=new he.fromCartesian(t,re.UNIT_SPHERE);return he.toCartesian(n,e,new m)};Wo.prototype.getVertex=function(e,t){t=y(t,re.WGS84);let n=GBe(this._cellId,this._level,e);n=m.normalize(n,n);let i=new he.fromCartesian(n,re.UNIT_SPHERE);return he.toCartesian(i,t,new m)};Wo.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(j5-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Wo(a)};function HBe(e,t){let n=WBe(e,t);return jBe(n[0],n[1],n[2])}function GBe(e,t,n){let i=Sne(e,t),r=qBe([i[1],i[2]],t),o=n>>1&1;return vne(i[0],r[0][o^n&1],r[1][o])}function WBe(e,t){let n=Sne(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,l=(r<<1)+c,f=(o<<1)+c;return[i,l,f]}function Sne(e){Ene.length===0&&XBe();let t=Number(e>>BigInt(j5)),n=t&Tg,i=(1<<Cg)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?CA-7*Cg:Cg))-1;n+=Number(e>>BigInt(s*2*Cg+1)&BigInt(c))<<2,n=bne[n];let l=s*Cg;r+=n>>Cg+2<<l,o+=(n>>2&i)<<l,n&=Tg|BT}return[t,r,o]}function jBe(e,t,n){let i=Cne(t),r=Cne(n),o=HU(i),s=HU(r);return vne(e,o,s)}function vne(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function HU(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Cne(e){return 1/kBe*e}function qBe(e,t){let n=[[],[]],i=YBe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=HU(Tne(o)),n[r][1]=HU(Tne(s))}return n}function YBe(e){return 1<<CA-e>>>0}function Tne(e){return 1/VBe*e}function Eg(e,t,n,i,r,o){if(e===Cg){let s=(t<<Cg)+n;Ene[(s<<2)+i]=(r<<2)+o,bne[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=zBe[o];Eg(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^zU[0]),Eg(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^zU[1]),Eg(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^zU[2]),Eg(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^zU[3])}}function XBe(){Eg(0,0,0,0,0,0),Eg(0,0,0,Tg,0,Tg),Eg(0,0,0,BT,0,BT),Eg(0,0,0,Tg|BT,0,Tg|BT)}function wne(e){return e&~e+BigInt(1)}function KBe(e){return BigInt(1)<<BigInt(2*(CA-e))}var JBe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function ZBe(e){return JBe[(-e&e)%BigInt(67)]}var wp=Wo;function QBe(e,t){return u(e)&&u(e.extensions)&&u(e.extensions[t])}var ni=QBe;function q5(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(u(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new de(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!u(n)&&s&&(n=$Be(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function $Be(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(q5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});q5.prototype.getBit=function(e){if(u(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var LT=q5;function Dp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(Dp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Dp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Dp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Dp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Dp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Dp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Dp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Dp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var NT=Dp;var GU={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};GU.getBranchingFactor=function(e){switch(e){case GU.OCTREE:return 8;case GU.QUADTREE:return 4}};var jo=Object.freeze(GU);function $s(){}Object.defineProperties($s.prototype,{class:{get:function(){fe.throwInstantiationError()}}});$s.prototype.hasProperty=function(e){fe.throwInstantiationError()};$s.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};$s.prototype.getProperty=function(e){fe.throwInstantiationError()};$s.prototype.setProperty=function(e,t){fe.throwInstantiationError()};$s.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};$s.hasProperty=function(e,t,n){if(u(t[e]))return!0;let i=n.properties;if(!u(i))return!1;let r=i[e];return!!(u(r)&&u(r.default))};$s.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!u(i))return!1;let r=i[e];return u(r)};$s.getPropertyIds=function(e,t,n){n=u(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&u(e[r])&&n.push(r);let i=t.properties;if(u(i))for(let r in i)i.hasOwnProperty(r)&&!u(e[r])&&u(i[r].default)&&n.push(r);return n};$s.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!u(r)&&u(i.default))return r=We(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(u(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};$s.setProperty=function(e,t,n,i){if(!u(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;u(o)&&(r=o[e]);let s=!0;return u(r)&&(t=r.packVectorAndMatrixTypes(t,s),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};$s.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!u(i))return;let r=i[e];if(u(r))return $s.getProperty(r.id,t,n)};$s.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!u(r))return!1;let o=i.propertiesBySemantic[e];return u(o)?$s.setProperty(o.id,t,n,i):!1};var Fn=$s;function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=u(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ip.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ip.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Ip.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Ip.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Ip.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Ip.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Ip.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Ip.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var $P=Ip;var It={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};It.getMinimum=function(e){switch(e){case It.INT8:return-128;case It.UINT8:return 0;case It.INT16:return-32768;case It.UINT16:return 0;case It.INT32:return-2147483648;case It.UINT32:return 0;case It.INT64:return Gt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case It.UINT64:return Gt.supportsBigInt()?BigInt(0):0;case It.FLOAT32:return-34028234663852886e22;case It.FLOAT64:return-Number.MAX_VALUE}};It.getMaximum=function(e){switch(e){case It.INT8:return 127;case It.UINT8:return 255;case It.INT16:return 32767;case It.UINT16:return 65535;case It.INT32:return 2147483647;case It.UINT32:return 4294967295;case It.INT64:return Gt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case It.UINT64:return Gt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case It.FLOAT32:return 34028234663852886e22;case It.FLOAT64:return Number.MAX_VALUE}};It.isIntegerType=function(e){switch(e){case It.INT8:case It.UINT8:case It.INT16:case It.UINT16:case It.INT32:case It.UINT32:case It.INT64:case It.UINT64:return!0;default:return!1}};It.isUnsignedIntegerType=function(e){switch(e){case It.UINT8:case It.UINT16:case It.UINT32:case It.UINT64:return!0;default:return!1}};It.isVectorCompatible=function(e){switch(e){case It.INT8:case It.UINT8:case It.INT16:case It.UINT16:case It.INT32:case It.UINT32:case It.FLOAT32:case It.FLOAT64:return!0;default:return!1}};It.normalize=function(e,t){return Math.max(Number(e)/Number(It.getMaximum(t)),-1)};It.unnormalize=function(e,t){let n=It.getMaximum(t),i=It.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===It.INT64||t===It.UINT64)&&Gt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};It.applyValueTransform=function(e,t,n){return n*e+t};It.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};It.getSizeInBytes=function(e){switch(e){case It.INT8:case It.UINT8:return 1;case It.INT16:case It.UINT16:return 2;case It.INT32:case It.UINT32:return 4;case It.INT64:case It.UINT64:return 8;case It.FLOAT32:return 4;case It.FLOAT64:return 8}};It.fromComponentDatatype=function(e){switch(e){case X.BYTE:return It.INT8;case X.UNSIGNED_BYTE:return It.UINT8;case X.SHORT:return It.INT16;case X.UNSIGNED_SHORT:return It.UINT16;case X.INT:return It.INT32;case X.UNSIGNED_INT:return It.UINT32;case X.FLOAT:return It.FLOAT32;case X.DOUBLE:return It.FLOAT64}};It.toComponentDatatype=function(e){switch(e){case It.INT8:return X.BYTE;case It.UINT8:return X.UNSIGNED_BYTE;case It.INT16:return X.SHORT;case It.UINT16:return X.UNSIGNED_SHORT;case It.INT32:return X.INT;case It.UINT32:return X.UNSIGNED_INT;case It.FLOAT32:return X.FLOAT;case It.FLOAT64:return X.DOUBLE}};var nn=Object.freeze(It);var Ur={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Ur.isVectorType=function(e){switch(e){case Ur.VEC2:case Ur.VEC3:case Ur.VEC4:return!0;default:return!1}};Ur.isMatrixType=function(e){switch(e){case Ur.MAT2:case Ur.MAT3:case Ur.MAT4:return!0;default:return!1}};Ur.getComponentCount=function(e){switch(e){case Ur.SCALAR:case Ur.STRING:case Ur.ENUM:case Ur.BOOLEAN:return 1;case Ur.VEC2:return 2;case Ur.VEC3:return 3;case Ur.VEC4:return 4;case Ur.MAT2:return 4;case Ur.MAT3:return 9;case Ur.MAT4:return 16}};Ur.getMathType=function(e){switch(e){case Ur.VEC2:return H;case Ur.VEC3:return m;case Ur.VEC4:return oe;case Ur.MAT2:return ir;case Ur.MAT3:return Q;case Ur.MAT4:return N;default:return}};var qt=Object.freeze(Ur);function Ca(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=u(i)&&nn.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=u(r)?r.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=We(e.min,!0),this._max=We(e.max,!0),this._normalized=o;let s=We(e.offset,!0),a=We(e.scale,!0),c=u(s)||u(a),l=!0;u(s)||(s=this.expandConstant(0,l)),u(a)||(a=this.expandConstant(1,l)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=We(e.noData,!0),this._default=We(e.default,!0),this._required=y(e.required,!0),this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}Ca.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=eLe(n),r=tLe(n,e.enums),o;return u(i)?i?o=u(n.optional)?!n.optional:!0:o=y(n.required,!1):o=!1,new Ca({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Ca.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function eLe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===qt.SCALAR||qt.isMatrixType(t)||qt.isVectorType(t))return!1;if(u(nn[t]))return!0;if(u(e.noData)||u(e.scale)||u(e.offset)||u(e.required)||u(e.count)||u(e.array)||u(e.optional))return!1}function tLe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!u(s)):e.array?(o=!0,s=e.count,a=!u(e.count)):(o=!1,s=void 0,a=!1);let c;if(u(e.enumType)&&(c=t[e.enumType]),n===qt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===qt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===qt.SCALAR||qt.isMatrixType(n)||qt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===qt.BOOLEAN||n===qt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===qt.BOOLEAN||i===qt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(u(i)&&u(nn[i]))return{type:qt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(u(nn[n]))return{type:qt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}Ca.prototype.normalize=function(e){return this._normalized?Y5(e,this._valueType,nn.normalize):e};Ca.prototype.unnormalize=function(e){return this._normalized?Y5(e,this._valueType,nn.unnormalize):e};Ca.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ca.valueTransformInPlace(e,this._offset,this._scale,nn.applyValueTransform)};Ca.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ca.valueTransformInPlace(e,this._offset,this._scale,nn.unapplyValueTransform)};Ca.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,r=qt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};Ca.prototype.handleNoData=function(e){let t=this._noData;if(!u(t))return e;if(!One(e,t))return e};function One(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!One(e[n],t[n]))return!1;return!0}Ca.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,r=qt.getComponentCount(this._type),o=i&&r>1;return u(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ca.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,r=qt.getComponentCount(this._type),o=i&&r>1;return u(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ca.prototype.validate=function(e){if(!(!u(e)&&u(this._default)))return this._required&&!u(e)?"required property must have a value":this._isArray?nLe(this,e):Mne(this,e)};function nLe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=Mne(e,t[i]);if(u(r))return r}}function Mne(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return qt.isVectorType(n)?iLe(t,n,i):qt.isMatrixType(n)?rLe(t,n,i):n===qt.STRING?oLe(t):n===qt.BOOLEAN?sLe(t):n===qt.ENUM?aLe(t,r):cLe(t,i,o)}function iLe(e,t,n){if(!nn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===qt.VEC2&&!(e instanceof H))return`vector value ${e} must be a Cartesian2`;if(t===qt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===qt.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function rLe(e,t,n){if(!nn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===qt.MAT2&&!(e instanceof ir))return`matrix value ${e} must be a Matrix2`;if(t===qt.MAT3&&!(e instanceof Q))return`matrix value ${e} must be a Matrix3`;if(t===qt.MAT4&&!(e instanceof N))return`matrix value ${e} must be a Matrix4`}function oLe(e){if(typeof e!="string")return WU(e,qt.STRING)}function sLe(e){if(typeof e!="boolean")return WU(e,qt.BOOLEAN)}function aLe(e,t){let n=typeof e;if(u(t))return n!=="string"||!u(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function cLe(e,t,n){let i=typeof e;switch(t){case nn.INT8:case nn.UINT8:case nn.INT16:case nn.UINT16:case nn.INT32:case nn.UINT32:case nn.FLOAT32:case nn.FLOAT64:return i!=="number"?WU(e,t):isFinite(e)?Ine(e,t,n):Pne(e,t);case nn.INT64:case nn.UINT64:return i!=="number"&&i!=="bigint"?WU(e,t):i==="number"&&!isFinite(e)?Pne(e,t):Ine(e,t,n)}}function WU(e,t){return`value ${e} does not match type ${t}`}function Dne(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Ine(e,t,n){if(n){let i=nn.isUnsignedIntegerType(t)?0:-1,r=1;return e<i||e>r?Dne(e,t,n):void 0}if(e<nn.getMinimum(t)||e>nn.getMaximum(t))return Dne(e,t,n)}function Pne(e,t){return`value ${e} of type ${t} must be finite`}function Y5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Y5(e[i],t,n);return e}Ca.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Ca.valueTransformInPlace(e[r],t[r],n[r],i);return e};var bg=Ca;function e1(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,l=i.enumType,f=o===qt.STRING,d=o===qt.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(nn[_],nn.UINT32);let b=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new X5(r[b],_,t+1),p+=g.typedArray.byteLength}let h=qt.getComponentCount(o),A;a?A=g.get(t)-g.get(0):s?A=t*i.arrayLength:A=t;let x=h*A,C;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(nn[_],nn.UINT32);let b=y(n.stringOffsets,n.stringOffsetBufferView);C=new X5(r[b],_,x+1),p+=C.typedArray.byteLength}(f||d)&&(c=nn.UINT8);let T;f?T=C.get(x)-C.get(0):d?T=Math.ceil(x/8):T=x;let E=y(n.values,n.bufferView),S=new X5(r[E],c,T);p+=S.typedArray.byteLength;let w=n.offset,D=n.scale,M=i.hasValueTransform||u(w)||u(D);w=y(w,i.offset),D=y(D,i.scale),w=Rne(w),D=Rne(D);let O,B,L=this;f?O=function(_){return fLe(_,L._values,L._stringOffsets)}:d?(O=function(_){return dLe(_,L._values)},B=function(_,b){mLe(_,L._values,b)}):u(l)?(O=function(_){let b=L._values.get(_);return l.namesByValue[b]},B=function(_,b){let v=l.valuesByName[b];L._values.set(_,v)}):(O=function(_){return L._values.get(_)},B=function(_,b){L._values.set(_,b)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=h,this._min=n.min,this._max=n.max,this._offset=w,this._scale=D,this._hasValueTransform=M,this._getValue=O,this._setValue=B,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(e1.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});e1.prototype.get=function(e){let t=lLe(this,e);return t=this._classProperty.handleNoData(t),u(t)?(t=this._classProperty.normalize(t),t=CLe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};e1.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=TLe(this,t),t=n.unnormalize(t),uLe(this,e,t)};e1.prototype.getTypedArray=function(){if(u(this._values))return this._values.typedArray};function Rne(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function lLe(e,t){Lne(e)&&Nne(e);let n=e._classProperty,i=n.isArray,r=n.type,o=qt.getComponentCount(r);if(u(e._unpackedValues)){let s=e._unpackedValues[t];return i?We(s,!0):s}return!i&&o===1?e._getValue(t):Bne(e,n,t)}function Bne(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=qt.getComponentCount(t.type);i*=s,r*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function uLe(e,t,n){ALe(e,t,n)&&Nne(e);let i=e._classProperty,r=i.isArray,o=i.type,s=qt.getComponentCount(o);if(u(e._unpackedValues)){i.isArray&&(n=We(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let l=0;l<c;++l)e._setValue(a+l,n[l])}function fLe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return _l(t.typedArray,i,r)}function dLe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function mLe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function hLe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function pLe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function _Le(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function gLe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function yLe(e){switch(e){case nn.INT8:return X.BYTE;case nn.UINT8:return X.UNSIGNED_BYTE;case nn.INT16:return X.SHORT;case nn.UINT16:return X.UNSIGNED_SHORT;case nn.INT32:return X.INT;case nn.UINT32:return X.UNSIGNED_INT;case nn.FLOAT32:return X.FLOAT;case nn.FLOAT64:return X.DOUBLE}}function Lne(e){if(u(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===qt.STRING||i===nn.INT64&&!Gt.supportsBigInt64Array()||i===nn.UINT64&&!Gt.supportsBigUint64Array()}function ALe(e,t,n){if(Lne(e))return!0;let i=e._arrayOffsets;if(u(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Nne(e){e._unpackedValues=xLe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function xLe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=qt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Bne(e,i,a);return n}function CLe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:bg.valueTransformInPlace(t,e._offset,e._scale,nn.applyValueTransform)}function TLe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:bg.valueTransformInPlace(t,e._offset,e._scale,nn.unapplyValueTransform)}function X5(e,t,n){let i=this,r,o,s;if(t===nn.INT64)Gt.supportsBigInt()?Gt.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return pLe(a,i)}):(Ot("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return hLe(a,i)});else if(t===nn.UINT64)Gt.supportsBigInt()?Gt.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return gLe(a,i)}):(Ot("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return _Le(a,i)});else{let a=yLe(t);r=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,l){i.typedArray[c]=l}}u(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var t1=e1;function Sd(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,r={};if(u(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new t1({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Sd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Sd.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Sd.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Sd.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Sd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return u(n)?i=n.get(e):i=ELe(this._class,t),i};Sd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return u(i)?(i.set(e,n),!0):!1};Sd.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(u(i)&&(n=i[t]),u(n))return this.getProperty(e,n.id)};Sd.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return u(r)&&(i=r[t]),u(i)?this.setProperty(e,i.id,n):!1};Sd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(u(t))return t.getTypedArray()};Sd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(u(n)&&(t=n[e]),u(t))return this.getPropertyTypedArray(t.id)};function ELe(e,t){let n=e.properties;if(!u(n))return;let i=n[t];if(u(i)&&u(i.default)){let r=i.default;return i.isArray&&(r=We(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var yl=Sd;function Sg(){}Object.defineProperties(Sg.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});Sg.prototype.load=function(){fe.throwInstantiationError()};Sg.prototype.unload=function(){};Sg.prototype.process=function(e){return!1};Sg.prototype.getError=function(e,t){u(t)&&u(t.message)&&(e+=` -${t.message}`);let n=new de(e);return u(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){return this.unload(),ue(this)};var cr=Sg;var bLe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},vt=Object.freeze(bLe);function Pp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Pp.prototype=Object.create(cr.prototype),Pp.prototype.constructor=Pp);Object.defineProperties(Pp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Pp.prototype.load=async function(){return u(this._promise)?this._promise:u(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=SLe(this),this._promise)};async function SLe(e){let t=e._resource;e._state=vt.LOADING;try{let n=await Pp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=vt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=vt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Pp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Pp.prototype.unload=function(){this._typedArray=void 0};var TA=Pp;var Hne=Ki(zne(),1);function EA(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,l=a.byteOffset,f=a.byteLength,d=!1,p,g,h,A;if(ni(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,l=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,A=y(C.filter,"NONE")}let x=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=A,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=x,this._bufferId=c,this._byteOffset=l,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(EA.prototype=Object.create(cr.prototype),EA.prototype.constructor=EA);Object.defineProperties(EA.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function ILe(e){try{let t=PLe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);Hne.MeshoptDecoder.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=vt.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=vt.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}EA.prototype.load=async function(){return u(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=ILe(this),this._promise)};function PLe(e){let t=e._resourceCache,n=e._buffer;if(u(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}EA.prototype.unload=function(){u(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var FT=EA;function Ja(){}Ja._maxDecodingConcurrency=Math.max(Gt.hardwareConcurrency-1,1);Ja._decoderTaskProcessor=void 0;Ja._taskProcessorReady=!1;Ja._getDecoderTaskProcessor=function(){if(!u(Ja._decoderTaskProcessor)){let e=new _i("decodeDraco",Ja._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Ja._taskProcessorReady=!0}),Ja._decoderTaskProcessor=e}return Ja._decoderTaskProcessor};Ja.decodePointCloud=function(e){let t=Ja._getDecoderTaskProcessor();if(Ja._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ja.decodeBufferView=function(e){let t=Ja._getDecoderTaskProcessor();if(Ja._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Op=Ja;function vg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=vt.UNLOADED,this._promise=void 0,this._dracoError=void 0}u(Object.create)&&(vg.prototype=Object.create(cr.prototype),vg.prototype.constructor=vg);Object.defineProperties(vg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function OLe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=vt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Gne(e,n)}}vg.prototype.load=async function(){return u(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=OLe(this),this._promise)};function Gne(e,t){e.unload(),e._state=vt.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function MLe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=vt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}vg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.PROCESSING||(u(this._dracoError)&&Gne(this,this._dracoError),!u(this._bufferViewTypedArray))||u(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,r=t.bufferView,o=i[r],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:o,compressedAttributes:s,dequantizeInShader:!0},c=Op.decodeBufferView(a);if(!u(c))return!1;this._decodePromise=MLe(this,c)};vg.prototype.unload=function(){u(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var UT=vg;function RLe(e){let t=e.uint8Array,n=e.format,i=e.request,r=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return we.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(we.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new we({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return u(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return u(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var bA=RLe;function Mp(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,l=a.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=c,this._uri=l,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Mp.prototype=Object.create(cr.prototype),Mp.prototype.constructor=Mp);Object.defineProperties(Mp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Mp.prototype.load=function(){return u(this._promise)?this._promise:u(this._bufferViewId)?(this._promise=BLe(this),this._promise):(this._promise=LLe(this),this._promise)};function Wne(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function BLe(e){e._state=vt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await FLe(i);if(e.isDestroyed())return;let o=Wne(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=vt.READY,e}catch(n){return e.isDestroyed()?void 0:jne(e,n,"Failed to load embedded image")}}async function LLe(e){e._state=vt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await VLe(i);if(e.isDestroyed())return;let o=Wne(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=vt.READY,e}catch(r){return e.isDestroyed()?void 0:jne(e,r,`Failed to load image: ${n}`)}}function jne(e,t,n){return e.unload(),e._state=vt.FAILED,Promise.reject(e.getError(n,t))}function NLe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function FLe(e){let t=NLe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return cl(n)}return Mp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var ULe=/(^data:image\/ktx2)|(\.ktx2$)/i;function VLe(e){let t=e.getUrlComponent(!1,!0);return ULe.test(t)?cl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Mp.prototype.unload=function(){u(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Mp._loadImageFromTypedArray=bA;var VT=Mp;var kLe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ta=Object.freeze(kLe);function wg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),l=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=l,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(wg.prototype=Object.create(cr.prototype),wg.prototype.constructor=wg);Object.defineProperties(wg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var zLe=new $5;wg.prototype.load=async function(){return u(this._promise)?this._promise:u(this._draco)?(this._promise=HLe(this),this._promise):(this._promise=GLe(this),this._promise)};async function HLe(e){e._state=vt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=vt.LOADED,e)}catch(n){if(e.isDestroyed())return;Q5(e,n)}}async function GLe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=vt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=WLe(e,a),e._state=vt.PROCESSING,e}catch(s){if(e.isDestroyed())return;Q5(e,s)}}function WLe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=Fe.getSizeInBytes(s),c=t.buffer,l=t.byteOffset+r.byteOffset;if(l%a!==0){let d=o*a,p=new Uint8Array(c,l,d);c=new Uint8Array(p).buffer,l=0,$("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(c,l,o):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(c,l,o):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(c,l,o)),f}function Q5(e,t){e.unload(),e._state=vt.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function $5(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}$5.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};$5.prototype.execute=function(){this.buffer=qne(this.typedArray,this.indexDatatype,this.context)};function qne(e,t,n){let i=mt.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}wg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.LOADED&&this._state!==vt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(u(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(r){Q5(this,r)}if(!u(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let r=zLe;if(r.set(t,n,e.context),!e.jobScheduler.execute(r,Ta.BUFFER))return!1;i=r.buffer}else this._loadBuffer&&(i=qne(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=vt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};wg.prototype.unload=function(){u(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;u(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),u(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var kT=wg;function jLe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var as=jLe;function qLe(e,t){return u(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Ao=qLe;function Yt(){}Yt.objectLegacy=function(e,t){if(u(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(u(r))return r}}};Yt.object=function(e,t){if(u(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(u(o))return o}}};Yt.topLevel=function(e,t,n){let i=e[t];return u(i)&&!Array.isArray(i)?Yt.objectLegacy(i,n):Yt.object(i,n)};Yt.accessor=function(e,t){return Yt.topLevel(e,"accessors",t)};Yt.accessorWithSemantic=function(e,t,n){let i={};return Yt.mesh(e,function(r){return Yt.meshPrimitive(r,function(o){let s=Yt.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!u(i[a])){i[a]=!0;let l=n(a);if(u(l))return l}});return u(s)?s:Yt.meshPrimitiveTarget(o,function(a){return Yt.meshPrimitiveTargetAttribute(a,function(c,l){if(l.indexOf(t)===0&&!u(i[c])){i[c]=!0;let f=n(c);if(u(f))return f}})})})})};Yt.accessorContainingVertexAttributeData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(r){let o=Yt.meshPrimitiveAttribute(r,function(s){if(!u(n[s])){n[s]=!0;let a=t(s);if(u(a))return a}});return u(o)?o:Yt.meshPrimitiveTarget(r,function(s){return Yt.meshPrimitiveTargetAttribute(s,function(a){if(!u(n[a])){n[a]=!0;let c=t(a);if(u(c))return c}})})})})};Yt.accessorContainingIndexData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(r){let o=r.indices;if(u(o)&&!u(n[o])){n[o]=!0;let s=t(o);if(u(s))return s}})})};Yt.animation=function(e,t){return Yt.topLevel(e,"animations",t)};Yt.animationChannel=function(e,t){let n=e.channels;return Yt.object(n,t)};Yt.animationSampler=function(e,t){let n=e.samplers;return Yt.object(n,t)};Yt.buffer=function(e,t){return Yt.topLevel(e,"buffers",t)};Yt.bufferView=function(e,t){return Yt.topLevel(e,"bufferViews",t)};Yt.camera=function(e,t){return Yt.topLevel(e,"cameras",t)};Yt.image=function(e,t){return Yt.topLevel(e,"images",t)};Yt.material=function(e,t){return Yt.topLevel(e,"materials",t)};Yt.materialValue=function(e,t){let n=e.values;u(e.extensions)&&u(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(u(r))return r}};Yt.mesh=function(e,t){return Yt.topLevel(e,"meshes",t)};Yt.meshPrimitive=function(e,t){let n=e.primitives;if(u(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(u(s))return s}}};Yt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(u(r))return r}};Yt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(u(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(u(o))return o}}};Yt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(u(r))return r}};Yt.node=function(e,t){return Yt.topLevel(e,"nodes",t)};Yt.nodeInTree=function(e,t,n){let i=e.nodes;if(u(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(u(a)){let c=n(a,s);if(u(c))return c;let l=a.children;if(u(l)&&(c=Yt.nodeInTree(e,l,n),u(c)))return c}}}};Yt.nodeInScene=function(e,t,n){let i=t.nodes;if(u(i))return Yt.nodeInTree(e,i,n)};Yt.program=function(e,t){return Ao(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.programs,t):Yt.topLevel(e,"programs",t)};Yt.sampler=function(e,t){return Yt.topLevel(e,"samplers",t)};Yt.scene=function(e,t){return Yt.topLevel(e,"scenes",t)};Yt.shader=function(e,t){return Ao(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.shaders,t):Yt.topLevel(e,"shaders",t)};Yt.skin=function(e,t){return Yt.topLevel(e,"skins",t)};Yt.skinJoint=function(e,t){let n=e.joints;if(u(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(u(s))return s}}};Yt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(u(r))return r}};Yt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(u(r))return r}};Yt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(u(r))return r}};Yt.technique=function(e,t){return Ao(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.techniques,t):Yt.topLevel(e,"techniques",t)};Yt.texture=function(e,t){return Yt.topLevel(e,"textures",t)};var Oe=Yt;function YLe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var au=YLe;function XLe(e,t){let n=t.bufferView;if(u(n)){let i=e.bufferViews[n];if(u(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*au(t.type)}var Al=XLe;function KLe(e){Oe.accessor(e,function(n){u(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.bufferView(e,function(n){u(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!u(i.material)){u(e.materials)||(e.materials=[]);let r={name:"default"};i.material=as(e.materials,r)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=y(i.normalized,!1),u(r)){let o=e.bufferViews[r];o.byteStride=Al(e,i),o.target=te.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(u(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),r=i.KHR_materials_common;if(u(r)){let c=r.technique,l=u(r.values)?r.values:{};r.values=l,l.ambient=u(l.ambient)?l.ambient:[0,0,0,1],l.emission=u(l.emission)?l.emission:[0,0,0,1],l.transparency=y(l.transparency,1),c!=="CONSTANT"&&(l.diffuse=u(l.diffuse)?l.diffuse:[0,0,0,1],c!=="LAMBERT"&&(l.specular=u(l.specular)?l.specular:[0,0,0,1],l.shininess=y(l.shininess,0))),r.transparent=y(r.transparent,!1),r.doubleSided=y(r.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let o=i.KHR_techniques_webgl;u(o)&&Oe.materialValue(n,function(c){u(c.index)&&SA(c)}),SA(n.emissiveTexture),SA(n.normalTexture),SA(n.occlusionTexture);let s=n.pbrMetallicRoughness;u(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),SA(s.baseColorTexture),SA(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;u(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),SA(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=JLe(e);return Oe.node(e,function(n,i){u(t[i])||u(n.translation)||u(n.rotation)||u(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Oe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),u(e.scenes)&&!u(e.scene)&&(e.scene=0),e}function JLe(e){let t={};return Oe.animation(e,function(n){Oe.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function SA(e){u(e)&&(e.texCoord=y(e.texCoord,0))}var o1=KLe;function ZLe(e){return Oe.shader(e,function(t){XU(t)}),Oe.buffer(e,function(t){XU(t)}),Oe.image(e,function(t){XU(t)}),XU(e),e}function XU(e){e.extras=u(e.extras)?e.extras:{},e.extras._pipeline=u(e.extras._pipeline)?e.extras._pipeline:{}}var Dg=ZLe;function QLe(e,t){let n=e.extensionsRequired;if(u(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var s1=QLe;function $Le(e,t){let n=e.extensionsUsed;if(u(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),s1(e,t),n.length===0&&delete e.extensionsUsed}}var vA=$Le;var eNe=4;function tNe(e){if(Td(e)!=="glTF")throw new de("File is not valid binary glTF");let n=Yne(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?nNe(e,n):iNe(e,n)}function Yne(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*eNe,!0);return r}function nNe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new de("Binary glTF scene format is not JSON");let o=20,s=o+i,a=_l(e,o,i),c=JSON.parse(a);Dg(c);let l=e.subarray(s,n),f=c.buffers;if(u(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);u(d)&&(d.extras._pipeline.source=l,delete d.uri)}return vA(c,"KHR_binary_glTF"),c}function iNe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Yne(e,i,2),a=s[0],c=s[1];i+=8;let l=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=_l(l);r=JSON.parse(f),Dg(r)}else c===5130562&&(o=l)}if(u(r)&&u(o)){let s=r.buffers;if(u(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var a1=tNe;function rNe(e){return Oe.shader(e,function(t){KU(t)}),Oe.buffer(e,function(t){KU(t)}),Oe.image(e,function(t){KU(t)}),KU(e),e}function KU(e){u(e.extras)&&(u(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var c1=rNe;function oNe(e,t){let n=e.extensionsUsed;u(n)||(n=[],e.extensionsUsed=n),as(n,t,!0)}var sf=oNe;function sNe(e){switch(e){case X.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case X.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case X.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case X.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case X.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case X.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case X.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var Rp=sNe;function aNe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=au(t.type);if(!u(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],l=c.buffer,d=i[l].extras._pipeline.source,p=t.count,g=Al(e,t),h=t.byteOffset+c.byteOffset+d.byteOffset,A=t.componentType,x=X.getSizeInBytes(A),C=new DataView(d.buffer),T=new Array(o),E=Rp(A);for(let S=0;S<p;S++){E(C,h,o,x,T);for(let w=0;w<o;w++){let D=T[w];s[w]=Math.min(s[w],D),a[w]=Math.max(a[w],D)}h+=g}return{min:s,max:a}}var wA=aNe;var cNe=[te.FUNC_ADD,te.FUNC_ADD],lNe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Xne(e,t){let n=e.enable;return u(n)?n.indexOf(t)>-1:!1}var uNe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function fNe(e,t){if(!u(e))return t;for(let n=0;n<4;n++)if(uNe.indexOf(e[n])===-1)return t;return e}function dNe(e){let t={},n={},i=e.techniques;return u(i)&&(Oe.technique(e,function(r,o){let s=r.states;if(u(s)){let a=n[o]={};if(Xne(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;u(c)&&(u(c.blendEquationSeparate)||u(c.blendFuncSeparate))&&(t[o]={blendEquation:y(c.blendEquationSeparate,cNe),blendFactors:fNe(c.blendFuncSeparate,lNe)})}Xne(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(u(e.extensions)||(e.extensions={}),sf(e,"KHR_blend")),Oe.material(e,function(r){if(u(r.technique)){let o=n[r.technique];Oe.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];u(s)&&(u(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var l1=dNe;function mNe(e,t){let n=e.extensionsRequired;u(n)||(n=[],e.extensionsRequired=n),as(n,t,!0),sf(e,t)}var u1=mNe;function hNe(e){let t=e.techniques,n={},i={},r={};if(u(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,c){let l={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(d,p){f=a.parameters[d],l.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(d,p){f=a.parameters[d],l.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},u(n[c])||(n[c]={}),n[c][d]=p}),u(r[a.program]))l.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=as(o.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=as(o.shaders,h,!0),l.program=as(o.programs,p),r[a.program]=l.program}i[c]=as(o.techniques,l)}),o.techniques.length>0&&(u(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,sf(e,"KHR_techniques_webgl"),u1(e,"KHR_techniques_webgl"))}return Oe.material(e,function(o){if(u(o.technique)){let s={technique:i[o.technique]};Oe.objectLegacy(o.values,function(a,c){u(s.values)||(s.values={});let l=n[o.technique][c];u(l)&&(s.values[l]=a)}),u(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var f1=hNe;function pNe(e,t){ol.typeOf.object("material",e),ol.defined("handler",t);let n=e.pbrMetallicRoughness;if(u(n)){if(u(n.baseColorTexture)){let r=n.baseColorTexture,o=t(r.index,r);if(u(o))return o}if(u(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,o=t(r.index,r);if(u(o))return o}}if(u(e.extensions)){let r=e.extensions.KHR_materials_pbrSpecularGlossiness;if(u(r)){if(u(r.diffuseTexture)){let s=r.diffuseTexture,a=t(s.index,s);if(u(a))return a}if(u(r.specularGlossinessTexture)){let s=r.specularGlossinessTexture,a=t(s.index,s);if(u(a))return a}}let o=e.extensions.KHR_materials_common;if(u(o)&&u(o.values)){let s=o.values.diffuse,a=o.values.ambient,c=o.values.emission,l=o.values.specular;if(u(s)&&u(s.index)){let f=t(s.index,s);if(u(f))return f}if(u(a)&&u(a.index)){let f=t(a.index,a);if(u(f))return f}if(u(c)&&u(c.index)){let f=t(c.index,c);if(u(f))return f}if(u(l)&&u(l.index)){let f=t(l.index,l);if(u(f))return f}}}let i=Oe.materialValue(e,function(r){if(u(r.index)){let o=t(r.index,r);if(u(o))return o}});if(u(i))return i;if(u(e.emissiveTexture)){let r=e.emissiveTexture,o=t(r.index,r);if(u(o))return o}if(u(e.normalTexture)){let r=e.normalTexture,o=t(r.index,r);if(u(o))return o}if(u(e.occlusionTexture)){let r=e.occlusionTexture,o=t(r.index,r);if(u(o))return o}}var zT=pNe;var Kne=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function _Ne(e,t){return t=y(t,Kne),Kne.forEach(function(n){t.indexOf(n)>-1&&yNe(e,n)}),e}var gNe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function yNe(e,t){let n=gNe[t],i=e[n];if(u(i)){let r=0,o=Ym[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(qm[t](e,a-r),r++)}}function qm(){}qm.accessor=function(e,t){e.accessors.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){Oe.meshPrimitiveAttribute(r,function(s,a){s>t&&r.attributes[a]--}),Oe.meshPrimitiveTarget(r,function(s){Oe.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let o=r.indices;u(o)&&o>t&&r.indices--})}),Oe.skin(e,function(i){u(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(r){u(r.input)&&r.input>t&&r.input--,u(r.output)&&r.output>t&&r.output--})})};qm.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){u(i.buffer)&&i.buffer>t&&i.buffer--,u(i.extensions)&&u(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};qm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){u(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){u(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){u(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ao(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){u(r.extensions)&&u(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Ao(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(u(a)){for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];u(l.bufferView)&&l.bufferView>t&&l.bufferView--,u(l.arrayOffsetBufferView)&&l.arrayOffsetBufferView>t&&l.arrayOffsetBufferView--,u(l.stringOffsetBufferView)&&l.stringOffsetBufferView>t&&l.stringOffsetBufferView--}}}}if(Ao(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(u(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let l in c)if(c.hasOwnProperty(l)){let f=c[l];u(f.values)&&f.values>t&&f.values--,u(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,u(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};qm.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){u(i.source)&&i.source>t&&--i.source;let r=i.extensions;u(r)&&u(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:u(r)&&u(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};qm.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){u(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};qm.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){u(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(r){u(r.target)&&u(r.target.node)&&r.target.node>t&&r.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(r){u(r.node)&&r.node>t&&r.node--})}),Oe.node(e,function(i){u(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};qm.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){u(r.material)&&r.material>t&&r.material--})})};qm.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){u(i.sampler)&&i.sampler>t&&--i.sampler})};qm.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){zT(i,function(r,o){o.index>t&&--o.index})}),Ao(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(s){let a=s.extensions;if(u(a)&&u(a.EXT_feature_metadata)){let l=a.EXT_feature_metadata.featureIdTextures;if(u(l)){let f=l.length;for(let d=0;d<f;++d){let g=l[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(u(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Ao(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(r){let o=r.extensions;if(u(o)&&u(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(u(a)){let c=a.length;for(let l=0;l<c;++l){let f=a[l];u(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Ao(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(u(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let l in c)if(c.hasOwnProperty(l)){let f=c[l];f.index>t&&--f.index}}}}};function Ym(){}Ym.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Oe.meshPrimitiveTarget(i,function(o){Oe.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;u(r)&&(t[r]=!0)})}),Oe.skin(e,function(n){u(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){u(i.input)&&(t[i.input]=!0),u(i.output)&&(t[i.output]=!0)})}),Ao(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){u(n.extensions)&&u(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),t};Ym.buffer=function(e){let t={};return Oe.bufferView(e,function(n){u(n.buffer)&&(t[n.buffer]=!0),u(n.extensions)&&u(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Ym.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){u(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){u(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){u(n.bufferView)&&(t[n.bufferView]=!0)}),Ao(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){u(i.extensions)&&u(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Ao(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(u(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];u(c.bufferView)&&(t[c.bufferView]=!0),u(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),u(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Ao(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(u(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];u(l.values)&&(t[l.values]=!0),u(l.arrayOffsets)&&(t[l.arrayOffsets]=!0),u(l.stringOffsets)&&(t[l.stringOffsets]=!0)}}}}return t};Ym.image=function(e){let t={};return Oe.texture(e,function(n){u(n.source)&&(t[n.source]=!0),u(n.extensions)&&u(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:u(n.extensions)&&u(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Ym.mesh=function(e){let t={};return Oe.node(e,function(n){if(u(n.mesh&&u(e.meshes))){let i=e.meshes[n.mesh];u(i)&&u(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Jne(e,t,n){let i=e.nodes[t];return u(i.mesh)||u(i.camera)||u(i.skin)||u(i.weights)||u(i.extras)||u(i.extensions)&&Object.keys(i.extensions).length!==0||u(n[t])?!1:!u(i.children)||i.children.filter(function(r){return!Jne(e,r,n)}).length===0}Ym.node=function(e){let t={};return Oe.skin(e,function(n){u(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){u(i.target)&&u(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){u(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){Jne(e,i,t)||(t[i]=!0)}),t};Ym.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){u(i.material)&&(t[i.material]=!0)})}),t};Ym.texture=function(e){let t={};if(Oe.material(e,function(n){zT(n,function(i){t[i]=!0})}),Ao(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(o){let s=o.extensions;if(u(s)&&u(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(u(c)){let l=c.length;for(let f=0;f<l;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(u(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a].texture;t[l.index]=!0}}}}if(Ao(e,"EXT_mesh_features")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let r=i.extensions;if(u(r)&&u(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(u(s)){let a=s.length;for(let c=0;c<a;++c){let l=s[c];u(l.texture)&&(t[l.texture.index]=!0)}}}})}),Ao(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(u(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];t[l.index]=!0}}}}return t};Ym.sampler=function(e){let t={};return Oe.texture(e,function(n){u(n.sampler)&&(t[n.sampler]=!0)}),t};var d1=_Ne;function ANe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:as(e.buffers,n),byteOffset:0,byteLength:t.length};return as(e.bufferViews,r)}var m1=ANe;function xNe(e,t){let n=Al(e,t),i=X.getSizeInBytes(t.componentType),r=au(t.type),o=t.count,s=new Array(r*o);if(!u(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,l=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=Rp(t.componentType);for(let g=0;g<o;++g){p(f,l,r,i,d);for(let h=0;h<r;++h)s[g*r+h]=d[h];l+=n}return s}var h1=xNe;function CNe(e){let t;return Oe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?JU(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&JU(e,i,X.UNSIGNED_SHORT)}),Oe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?JU(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&JU(e,i,X.UNSIGNED_SHORT)}),e}function JU(e,t,n){let i=X.createTypedArray(n,h1(e,t)),r=new Uint8Array(i.buffer);t.bufferView=m1(e,r),t.componentType=n,t.byteOffset=0}var p1=CNe;function TNe(e,t){return vA(e,t),t==="CESIUM_RTC"&&ENe(e),e6(e,t)}function ENe(e){Oe.technique(e,function(t){Oe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function e6(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)e6(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;u(n)&&(i=n[t],u(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&e6(e[r],t);return i}}var DA=TNe;var ZU={.8:INe,"1.0":JNe,"2.0":void 0};function bNe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(ZU,i)||(u(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(ZU,i)||(i="1.0"));let r=ZU[i];for(;u(r)&&i!==n;)r(e,t),i=e.asset.version,r=ZU[i];return t.keepLegacyExtensions||($Ne(e),eFe(e)),e}function Qne(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;u(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function SNe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(u(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function vNe(e){let t=e.nodes,n=new m,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(u(o.rotation)){let a=o.rotation;m.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;u(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function wNe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new m,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let l=t[c],f=l.channels,d=l.parameters,p=l.samplers;if(u(f)){let g=f.length;for(let h=0;h<g;++h){let A=f[h];if(A.target.path==="rotation"){let x=d[p[A.sampler].output];if(u(o[x]))continue;o[x]=!0;let C=n[x],T=i[C.bufferView],S=r[T.buffer].extras._pipeline.source,w=S.byteOffset+T.byteOffset+C.byteOffset,D=C.componentType,M=C.count,O=au(C.type),B=C.count*O,L=X.createArrayBufferView(D,S.buffer,w,B);for(let _=0;_<M;_++){let b=_*O;m.unpack(L,b,s);let v=L[b+3];Le.fromAxisAngle(s,v,a),Le.pack(a,L,b)}}}}}}function DNe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(u(r)){let o=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function INe(e){u(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(u(e.version)&&delete e.version,Qne(e),SNe(e),vNe(e),wNe(e),DNe(e),u(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),u(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,sf(e,"KHR_materials_common")}}function PNe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(u(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function Zne(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),u(r.name)||(r.name=i)}return n}function ONe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,u(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&u(n[s])){let a={},c=e[s];e[s]=Zne(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);u(e.scene)&&(e.scene=n.scenes[e.scene]),Oe.bufferView(e,function(s){u(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Oe.accessor(e,function(s){u(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Oe.shader(e,function(s){let a=s.extensions;if(u(a)){let c=a.KHR_binary_glTF;u(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.program(e,function(s){u(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),u(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Oe.technique(e,function(s){u(s.program)&&(s.program=n.programs[s.program]),Oe.techniqueParameter(s,function(a){u(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Oe.mesh(e,function(s){Oe.meshPrimitive(s,function(a){u(a.indices)&&(a.indices=n.accessors[a.indices]),Oe.meshPrimitiveAttribute(a,function(c,l){a.attributes[l]=n.accessors[c]}),u(a.material)&&(a.material=n.materials[a.material])})}),Oe.node(e,function(s){let a=s.children;if(u(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(u(s.meshes)){let c=s.meshes,l=c.length;if(l>0)for(s.mesh=n.meshes[c[0]],t=1;t<l;++t){let f={mesh:n.meshes[c[t]]},d=as(e.nodes,f);u(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(u(s.camera)&&(s.camera=n.cameras[s.camera]),u(s.skin)&&(s.skin=n.skins[s.skin]),u(s.skeletons)){let c=s.skeletons;if(c.length>0&&u(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}u(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){u(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(u(a)){let c=[],l=a.length;for(t=0;t<l;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Oe.scene(e,function(s){let a=s.nodes;if(u(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Oe.animation(e,function(s){let a={};s.samplers=Zne(s.samplers,a),Oe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Oe.animationChannel(s,function(c){c.sampler=a[c.sampler];let l=c.target;u(l)&&(l.node=n.nodes[l.id],delete l.id)})}),Oe.material(e,function(s){u(s.technique)&&(s.technique=n.techniques[s.technique]),Oe.materialValue(s,function(c,l){typeof c=="string"&&(s.values[l]={index:n.textures[c]})});let a=s.extensions;if(u(a)){let c=a.KHR_materials_common;u(c)&&u(c.values)&&Oe.materialValue(c,function(l,f){typeof l=="string"&&(c.values[f]={index:n.textures[l]})})}}),Oe.image(e,function(s){let a=s.extensions;if(u(a)){let c=a.KHR_binary_glTF;u(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.texture(e,function(s){u(s.sampler)&&(s.sampler=n.samplers[s.sampler]),u(s.source)&&(s.source=n.images[s.source])})}function MNe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){delete n.name})})}function RNe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Oe.node(e,function(t){u(t.children)&&t.children.length===0&&delete t.children})}function BNe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var LNe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function NNe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),u(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];u(LNe[r])&&e.extensionsRequired.push(r)}}}function FNe(e){Oe.buffer(e,function(t){delete t.type})}function UNe(e){Oe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function VNe(e){Oe.mesh(e,function(t){Oe.meshPrimitive(t,function(n){Oe.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Oe.technique(e,function(t){Oe.techniqueParameter(t,function(n){let i=n.semantic;u(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var kNe={POSITION:!0,NORMAL:!0,TANGENT:!0},zNe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function HNe(e){let t={};Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let l,f=zNe[a];u(f)?(l=f+c,t[o]=l):u(kNe[a])||(l=`_${o}`,t[o]=l)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];u(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let r=t[i.semantic];u(r)&&(i.semantic=r)})})}function GNe(e){Oe.camera(e,function(t){let n=t.perspective;if(u(n)){let i=n.aspectRatio;u(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;u(r)&&r===0&&(n.yfov=1)}})}function t6(e,t){return u(t.byteStride)&&t.byteStride!==0?t.byteStride:Al(e,t)}function WNe(e){Oe.buffer(e,function(t){u(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(u(n)){let i=e.bufferViews[n],r=t6(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(y(i.byteLength,0),o)}})}function jNe(e){let t,n,i,r=e.bufferViews,o={};Oe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];u(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Oe.accessor(e,function(a){u(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let l=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=t6(e,p),h=p.byteOffset,A=p.count*g;delete p.byteStride;let x=t<d-1,C=x?t6(e,c[t+1]):void 0;if(g!==C){let T=We(i,!0);o[a]&&(T.byteStride=g),T.byteOffset+=l,T.byteLength=h+A-l;let E=as(r,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=E,p.byteOffset=p.byteOffset-l;l=x?c[t+1].byteOffset:void 0,f=t+1}}}d1(e,["accessor","bufferView","buffer"])}function qNe(e){Oe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!u(n.min)||!u(n.max)){let i=wA(e,n);n.min=i.min,n.max=i.max}})}function $ne(e){return(!u(e.children)||e.children.length===0)&&(!u(e.meshes)||e.meshes.length===0)&&!u(e.camera)&&!u(e.skin)&&!u(e.skeletons)&&!u(e.jointName)&&(!u(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!u(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!u(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!u(e.matrix)||N.fromColumnMajorArray(e.matrix).equals(N.IDENTITY))&&!u(e.extensions)&&!u(e.extras)}function eie(e,t){Oe.scene(e,function(n){let i=n.nodes;if(u(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Oe.node(e,function(n,i){if(u(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),$ne(n)&&eie(e,i))}}),delete e.nodes[t]}function YNe(e){return Oe.node(e,function(t,n){$ne(t)&&eie(e,n)}),e}function XNe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!u(i.min)||!u(i.max)){let r=wA(e,i);i.min=r.min,i.max=r.max}})})}function KNe(e){Oe.accessor(e,function(t){if(u(t.min)||u(t.max)){let n=wA(e,t);u(t.min)&&(t.min=n.min),u(t.max)&&(t.max=n.max)}})}function JNe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Qne(e),PNe(e),YNe(e),ONe(e),MNe(e),BNe(e),NNe(e),WNe(e),jNe(e),qNe(e),XNe(e),KNe(e),FNe(e),UNe(e),VNe(e),HNe(e),p1(e),GNe(e),l1(e),f1(e),RNe(e)}var ZNe=["u_tex","u_diffuse","u_emission"],QNe=["u_diffuse"];function n6(e){e.pbrMetallicRoughness=u(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function QU(e){return u(e.index)}function $U(e){return Array.isArray(e)&&e.length===4}function tie(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function $Ne(e){Oe.material(e,function(t){Oe.materialValue(t,function(n,i){ZNe.indexOf(i)!==-1&&QU(n)?(n6(t),t.pbrMetallicRoughness.baseColorTexture=n):QNe.indexOf(i)!==-1&&$U(n)&&(n6(t),t.pbrMetallicRoughness.baseColorFactor=tie(n))})}),DA(e,"KHR_techniques_webgl"),DA(e,"KHR_blend")}function eFe(e){Oe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(u(n)){n.technique==="CONSTANT"&&(sf(e,"KHR_materials_unlit"),t.extensions=u(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let r=u(n.values)?n.values:{},o=r.ambient,s=r.diffuse,a=r.emission,c=r.transparency,l=n.doubleSided,f=n.transparent;n6(t),u(o)&&($U(o)?t.emissiveFactor=o.slice(0,3):QU(o)&&(t.emissiveTexture=o)),u(s)&&($U(s)?t.pbrMetallicRoughness.baseColorFactor=tie(s):QU(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),u(l)&&(t.doubleSided=l),u(a)&&($U(a)?t.emissiveFactor=a.slice(0,3):QU(a)&&(t.emissiveTexture=a)),u(c)&&(u(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),u(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),DA(e,"KHR_materials_common")}var _1=bNe;var li={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function tFe(e){switch(e){case li.POSITION:return"positionMC";case li.NORMAL:return"normalMC";case li.TANGENT:return"tangentMC";case li.TEXCOORD:return"texCoord";case li.COLOR:return"color";case li.JOINTS:return"joints";case li.WEIGHTS:return"weights";case li.FEATURE_ID:return"featureId"}}li.hasSetIndex=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return!1;case li.TEXCOORD:case li.COLOR:case li.JOINTS:case li.WEIGHTS:case li.FEATURE_ID:return!0}};li.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return li.POSITION;case"NORMAL":return li.NORMAL;case"TANGENT":return li.TANGENT;case"TEXCOORD":return li.TEXCOORD;case"COLOR":return li.COLOR;case"JOINTS":return li.JOINTS;case"WEIGHTS":return li.WEIGHTS;case"_FEATURE_ID":return li.FEATURE_ID}};li.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return li.POSITION;case"RGBA":case"RGB":case"RGB565":return li.COLOR;case"NORMAL":case"NORMAL_OCT16P":return li.NORMAL;case"BATCH_ID":return li.FEATURE_ID}};li.getGlslType=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return"vec3";case li.TEXCOORD:return"vec2";case li.COLOR:return"vec4";case li.JOINTS:return"ivec4";case li.WEIGHTS:return"vec4";case li.FEATURE_ID:return"int"}};li.getVariableName=function(e,t){let n=tFe(e);return u(t)&&(n+=`_${t}`),n};var Et=Object.freeze(li);function Za(){}Za.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;u(n)&&u(n.message)&&(i+=` -${n.message}`);let r=new de(i);return u(n)&&(r.stack=`Original stack: -${n.stack} -Handler stack: -${r.stack}`),r};Za.getNodeTransform=function(e){return u(e.matrix)?e.matrix:N.fromTranslationQuaternionRotationScale(u(e.translation)?e.translation:m.ZERO,u(e.rotation)?e.rotation:Le.IDENTITY,u(e.scale)?e.scale:m.ONE)};Za.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=u(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Za.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Za.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Za.hasQuantizedAttributes=function(e){if(!u(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(u(n.quantization))return!0}return!1};Za.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;u(t)?(i=Et.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=an.getGlslType(s);o&&(a="vec4");let c=u(e.quantization),l;return c&&(l=o?"vec4":an.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:l}};var nFe=new m,iFe=new m;Za.getPositionMinMax=function(e,t,n){let i=Za.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return u(n)&&u(t)&&(o=m.add(o,t,iFe),r=m.add(r,n,nFe)),{min:o,max:r}};Za.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===hr.Y?n=N.clone(hr.Y_UP_TO_Z_UP,n):e===hr.X&&(n=N.clone(hr.X_UP_TO_Z_UP,n)),t===hr.Z&&(n=N.multiplyTransformation(n,hr.Z_UP_TO_X_UP,n)),n};var rFe=new Q;Za.getCullFace=function(e,t){if(!Be.isTriangles(t))return yi.BACK;let n=N.getMatrix3(e,rFe);return Q.determinant(n)<0?yi.FRONT:yi.BACK};Za.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Za.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Za.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Za.supportedExtensions[i])throw new de(`Unsupported glTF Extension: ${i}`)}};var Zt=Za;function Ig(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,r=e.typedArray,o=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=r,this._gltfJson=o,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Ig.prototype=Object.create(cr.prototype),Ig.prototype.constructor=Ig);Object.defineProperties(Ig.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Ig.prototype.load=async function(){return u(this._promise)?this._promise:(this._state=vt.LOADING,u(this._gltfJson)?(this._promise=nie(this,this._gltfJson),this._promise):u(this._typedArray)?(this._promise=iie(this,this._typedArray),this._promise):(this._promise=oFe(this),this._promise))};async function oFe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;i6(e,n)}return iie(e,t)}function i6(e,t){e.unload(),e._state=vt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function sFe(e,t){if(u(t.asset)&&t.asset.version==="2.0"&&!Ao(t,"KHR_techniques_webgl")&&!Ao(t,"KHR_materials_common"))return Promise.resolve();let n=[];Oe.buffer(t,function(i){if(!u(i.extras._pipeline.source)&&u(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),_1(t)}function aFe(e){let t=[];return Oe.buffer(e,function(n){let i=n.uri;!u(n.extras._pipeline.source)&&u(i)&&tp(i)&&(delete n.uri,t.push(we.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function cFe(e,t){let n=[];return Oe.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(u(o)&&!u(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function nie(e,t){try{Dg(t),await aFe(t),await sFe(e,t),o1(t),await cFe(e,t),c1(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new de(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return u(i)&&Zt.checkSupportedExtensions(i),e._gltf=t,e._state=vt.READY,e}catch(n){if(e.isDestroyed())return;i6(e,n)}}async function iie(e,t){let n;try{Td(t)==="glTF"?n=a1(t):n=Br(t)}catch(i){if(e.isDestroyed())return;i6(e,i)}return nie(e,n)}Ig.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Ig.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var HT=Ig;var lFe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Xm=Object.freeze(lFe);var Zr={};function uFe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function fFe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function dFe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function mFe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function hFe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function pFe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function _Fe(){this.attributes=[]}function gFe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function yFe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function AFe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function xFe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function CFe(){this.nodes=[]}var TFe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function EFe(){this.input=[],this.interpolation=void 0,this.output=[]}function bFe(){this.node=void 0,this.path=void 0}function SFe(){this.sampler=void 0,this.target=void 0}function vFe(){this.name=void 0,this.samplers=[],this.channels=[]}function wFe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function DFe(){this.name=void 0,this.stages=[]}function rie(){this.credits=[]}function IFe(){this.asset=new rie,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=N.clone(N.IDENTITY)}function PFe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Q.clone(Q.IDENTITY),this.channels=void 0}function Pg(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(Pg.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Pg.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Pg.DEFAULT_ROUGHNESS_FACTOR}Pg.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;Pg.DEFAULT_METALLIC_FACTOR=1;Pg.DEFAULT_ROUGHNESS_FACTOR=1;function IA(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(IA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(IA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=IA.DEFAULT_GLOSSINESS_FACTOR}IA.DEFAULT_DIFFUSE_FACTOR=oe.ONE;IA.DEFAULT_SPECULAR_FACTOR=m.ONE;IA.DEFAULT_GLOSSINESS_FACTOR=1;function r6(){this.metallicRoughness=new Pg,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(r6.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Xm.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}r6.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Zr.Quantization=uFe;Zr.Attribute=fFe;Zr.Indices=dFe;Zr.FeatureIdAttribute=mFe;Zr.FeatureIdTexture=pFe;Zr.FeatureIdImplicitRange=hFe;Zr.MorphTarget=_Fe;Zr.Primitive=gFe;Zr.Instances=yFe;Zr.Skin=AFe;Zr.Node=xFe;Zr.Scene=CFe;Zr.AnimatedPropertyType=Object.freeze(TFe);Zr.AnimationSampler=EFe;Zr.AnimationTarget=bFe;Zr.AnimationChannel=SFe;Zr.Animation=vFe;Zr.ArticulationStage=wFe;Zr.Articulation=DFe;Zr.Asset=rie;Zr.Components=IFe;Zr.TextureReader=PFe;Zr.MetallicRoughness=Pg;Zr.SpecularGlossiness=IA;Zr.Material=r6;var Nt=Zr;var eV={};eV.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,r=t.textures[n],o=r.extensions;if(u(o)){if(i.webp&&u(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&u(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};eV.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=y(e.compressedTextureNoMipmap,!1),r=wn.REPEAT,o=wn.REPEAT,s=cn.LINEAR,a=Ti.LINEAR,c=n.index,f=t.textures[c].sampler;if(u(f)){let g=t.samplers[f];r=y(g.wrapS,r),o=y(g.wrapT,o),s=y(g.minFilter,s),a=y(g.magFilter,a)}let d=!1,p=n.extensions;return u(p)&&u(p.KHR_texture_transform)&&(d=!0),(i||d)&&s!==cn.LINEAR&&s!==cn.NEAREST&&(s===cn.NEAREST_MIPMAP_NEAREST||s===cn.NEAREST_MIPMAP_LINEAR?s=cn.NEAREST:s=cn.LINEAR),new fn({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var OFe=new H(1,1);eV.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,r=y(t.texCoord,0),o,s=y(t.extensions,y.EMPTY_OBJECT).KHR_texture_transform;if(u(s)){r=y(s.texCoord,r);let c=u(s.offset)?H.unpack(s.offset):H.ZERO,l=y(s.rotation,0),f=u(s.scale)?H.unpack(s.scale):OFe;l=-l,o=new Q(Math.cos(l)*f.x,-Math.sin(l)*f.y,c.x,Math.sin(l)*f.x,Math.cos(l)*f.y,c.y,0,0,1)}let a=new Nt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=r,a.transform=o,a.channels=n,a};var xl=eV;function MFe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Og=MFe;function Mg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),l=i.index,f=xl.getImageIdFromTexture({gltf:n,textureId:l,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=r,this._baseResource=o,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Mg.prototype=Object.create(cr.prototype),Mg.prototype.constructor=Mg);Object.defineProperties(Mg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var RFe=new o6;async function BFe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=vt.LOADED,e)}catch(n){if(e.isDestroyed())return;e.unload(),e._state=vt.FAILED;let i="Failed to load texture";throw e.getError(i,n)}}Mg.prototype.load=async function(){return u(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=BFe(this),this._promise)};function o6(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}o6.prototype.set=function(e,t,n,i,r){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=r};o6.prototype.execute=function(){this.texture=oie(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function oie(e,t,n,i,r){let o=n.internalFormat,s=!1;at.isCompressedFormat(o)&&!u(i)&&(s=!0);let a=xl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,l=a.wrapS,f=a.wrapT,d=c===cn.NEAREST_MIPMAP_NEAREST||c===cn.NEAREST_MIPMAP_LINEAR||c===cn.LINEAR_MIPMAP_NEAREST||c===cn.LINEAR_MIPMAP_LINEAR,p=!u(o)&&d,g=p||l===wn.REPEAT||l===wn.MIRRORED_REPEAT||f===wn.REPEAT||f===wn.MIRRORED_REPEAT,h=!P.isPowerOfTwo(n.width)||!P.isPowerOfTwo(n.height),A=g&&h,x;return u(o)?(!r.webgl2&&at.isCompressedFormat(o)&&h&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),x=Rt.create({context:r,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(A&&(n=Og(n)),x=Rt.create({context:r,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&x.generateMipmap(),x}Mg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.LOADED&&this._state!==vt.PROCESSING||u(this._texture)||!u(this._image))return!1;this._state=vt.PROCESSING;let t;if(this._asynchronous){let n=RFe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ta.TEXTURE))return;t=n.texture}else t=oie(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=vt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Mg.prototype.unload=function(){u(this._texture)&&this._texture.destroy(),u(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var GT=Mg;function Rg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,r=e.baseResource,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,l=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=r,this._gltf=n,this._bufferViewId=o,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=l,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Rg.prototype=Object.create(cr.prototype),Rg.prototype.constructor=Rg);Object.defineProperties(Rg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function LFe(e,t){return u(e)&&u(e.attributes)&&u(e.attributes[t])}Rg.prototype.load=async function(){return u(this._promise)?this._promise:LFe(this._draco,this._attributeSemantic)?(this._promise=FFe(this),this._promise):(this._promise=VFe(this),this._promise)};function NFe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Nt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=an.VEC2,a.normalizationRange=o;else{let c=an.getMathType(i);if(c===Number){let l=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=l,a.normalizationRange=o,a.quantizedVolumeStepSize=l*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let l=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(l);let f=l.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function FFe(e){e._state=vt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=vt.LOADED,e)}catch{if(e.isDestroyed())return;s6(e)}}function UFe(e){e._state=vt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,l=r.data.quantization;u(l)&&(e._quantization=NFe(l,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function VFe(e){e._state=vt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=vt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;s6(e,n)}}function s6(e,t){e.unload(),e._state=vt.FAILED;let n="Failed to load vertex buffer";throw e.getError(n,t)}function a6(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}a6.prototype.set=function(e,t){this.typedArray=e,this.context=t};a6.prototype.execute=function(){this.buffer=sie(this.typedArray,this.context)};function sie(e,t){let n=mt.createVertexBuffer({typedArray:e,context:t,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var kFe=new a6;Rg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.LOADED&&this._state!==vt.PROCESSING)return!1;if(u(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){s6(this,i)}UFe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=kFe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ta.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=sie(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=vt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Rg.prototype.unload=function(){u(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;u(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),u(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var WT=Rg;function g1(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];u(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}g1.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=bg.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new g1({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(g1.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});g1.BATCH_TABLE_CLASS_NAME="_batchTable";var vd=g1;function tV(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}tV.fromJson=function(e){return new tV({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(tV.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var y1=tV;function nV(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=y(e.valueType,nn.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}nV.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(r){return y1.fromJson(r)});return new nV({id:t,values:i,valueType:nn[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(nV.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var A1=nV;function iV(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}iV.fromJson=function(e){let t={};if(u(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=A1.fromJson({id:i,enum:e.enums[i]}));let n={};if(u(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=vd.fromJson({id:i,class:e.classes[i],enums:t}));return new iV({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(iV.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var wd=iV;function PA(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=u(t)?wd.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(PA.prototype=Object.create(cr.prototype),PA.prototype.constructor=PA);Object.defineProperties(PA.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});PA.prototype.load=async function(){return u(this._promise)?this._promise:u(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=zFe(this),this._promise)};async function zFe(e){let t=e._resource;e._state=vt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=wd.fromJson(n),e._state=vt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=vt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}PA.prototype.unload=function(){this._schema=void 0};var jT=PA;var Dd={};function x1(e){return ep(e.url)}function rV(e){let t=e.byteOffset,n=e.byteLength;if(ni(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function HFe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,r=e.type,o=e.count;return`${n}-${i}-${r}-${o}`}function aie(e){return x1(e)}function cie(e,t){return`${x1(e)}-buffer-id-${t}`}function C1(e,t,n,i){if(u(e.uri)){let r=i.getDerivedResource({url:e.uri});return aie(r)}return cie(n,t)}function c6(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=C1(a,s,n,i),l=rV(o);return`${c}-range-${l}`}function lie(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(u(s)){let p=i.getDerivedResource({url:s});return x1(p)}let a=e.bufferViews[o],c=a.buffer,l=e.buffers[c],f=C1(l,c,n,i),d=rV(a);return`${f}-range-${d}`}function GFe(e,t){let n=xl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Dd.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return u(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${x1(n)}`};Dd.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${aie(t)}`};Dd.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${cie(t,n)}`};Dd.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${x1(t)}`};Dd.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s];ni(o,"EXT_meshopt_compression")&&(s=o.extensions.EXT_meshopt_compression.buffer);let c=C1(a,s,i,r),l=rV(o);return`buffer-view:${c}-range-${l}`};Dd.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;return`draco:${c6(t,n,i,r)}`};Dd.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=y(e.dequantize,!1),l=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d="";if(c&&(d+="-dequantize"),l&&(d+="-buffer",d+=`-context-${r.context.id}`),f&&(d+="-typed-array"),u(s))return`vertex-buffer:${c6(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[o],g=p.buffer,h=t.buffers[g],A=C1(h,g,n,i),x=rV(p);return`vertex-buffer:${A}-range-${x}${d}`};Dd.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.loadBuffer,!1),c=y(e.loadTypedArray,!1),l="";if(a&&(l+="-buffer",l+=`-context-${o.context.id}`),c&&(l+="-typed-array"),u(s))return`index-buffer:${c6(t,s,i,r)}-draco${l}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,h=t.buffers[g],A=C1(h,g,i,r),x=HFe(f,p);return`index-buffer:${A}-accessor-${x}${l}`};Dd.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;return`image:${lie(t,n,i,r)}`};Dd.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=n.index,c=xl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),l=lie(t,c,i,r),f=GFe(t,n);return`texture:${l}-sampler-${f}-context-${s.context.id}`};var Cl=Dd;function T1(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}T1.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};T1.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;u(n)&&(r+=n.sizeInBytes),u(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};T1.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};T1.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],u(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],u(i)&&(this.texturesByteLength-=i)};var E1=T1;function Ln(){}Ln.cacheEntries={};Ln.statistics=new E1;function WFe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Ln.get=function(e){let t=Ln.cacheEntries[e];if(u(t))return++t.referenceCount,t.resourceLoader};Ln.add=function(e){let t=e.cacheKey;return Ln.cacheEntries[t]=new WFe(e),e};Ln.unload=function(e){let t=e.cacheKey,n=Ln.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Ln.statistics.removeLoader(e),e.destroy(),delete Ln.cacheEntries[t])};Ln.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=Cl.getSchemaCacheKey({schema:t,resource:n}),r=Ln.get(i);return u(r)?r:(r=new jT({schema:t,resource:n,cacheKey:i}),Ln.add(r))};Ln.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,r=Cl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Ln.get(r);return u(o)?o:(o=new TA({typedArray:i,cacheKey:r}),Ln.add(o))};Ln.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource,n=Cl.getExternalBufferCacheKey({resource:t}),i=Ln.get(n);return u(i)?i:(i=new TA({resource:t,cacheKey:n}),Ln.add(i))};Ln.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=e.gltfJson,o=Cl.getGltfCacheKey({gltfResource:t}),s=Ln.get(o);return u(s)?s:(s=new HT({resourceCache:Ln,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Ln.add(s))};Ln.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=Cl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Ln.get(o);return u(s)?s:(s=new FT({resourceCache:Ln,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Ln.add(s))};Ln.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource,o=Cl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:r}),s=Ln.get(o);return u(s)?s:(s=new UT({resourceCache:Ln,gltf:t,draco:n,gltfResource:i,baseResource:r,cacheKey:o}),Ln.add(s))};Ln.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,l=y(e.asynchronous,!0),f=y(e.dequantize,!1),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1),g=Cl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),h=Ln.get(g);return u(h)?h:(h=new WT({resourceCache:Ln,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:l,dequantize:f,loadBuffer:d,loadTypedArray:p}),Ln.add(h))};Ln.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.asynchronous,!0),c=y(e.loadBuffer,!1),l=y(e.loadTypedArray,!1),f=Cl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:c,loadTypedArray:l}),d=Ln.get(f);return u(d)?d:(d=new kT({resourceCache:Ln,gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:l}),Ln.add(d))};Ln.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource,o=Cl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Ln.get(o);return u(s)?s:(s=new VT({resourceCache:Ln,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Ln.add(s))};Ln.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=y(e.asynchronous,!0),c=Cl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),l=Ln.get(c);return u(l)?l:(l=new GT({resourceCache:Ln,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Ln.add(l))};Ln.clearForSpecs=function(){let e=[WT,kT,UT,GT,VT,FT,TA,jT,HT],t,n=Ln.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,u(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Ln.statistics.clear()};var Ui=Ln;function ea(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ea.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ea.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ea.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ea.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ea.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ea.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ea.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ea.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ea.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===jo.OCTREE&&(t=3),e>>t};ea.fromSubtreeJson=async function(e,t,n,i,r){let o=new ea(e,i,r),s;u(t)?s={json:t,binary:void 0}:s=jFe(n);let a=s.json;o._subtreeJson=a;let c;if(ni(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(u(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let l=[];if(u(a.contentMetadata)){let T=a.contentMetadata.length;for(let E=0;E<T;E++){let S=a.contentMetadata[E];l.push(a.propertyTables[S])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(u(p)){let T=p.class,E=d.classes[T];f=new $P({subtreeMetadata:p,class:E})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=l;let g={constant:0};a.contentAvailabilityHeaders=[],ni(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let h=qFe(a.buffers),A=YFe(a.bufferViews,h);XFe(a,A),u(c)&&uie(c,A);for(let T=0;T<l.length;T++){let E=l[T];uie(E,A)}let x=await KFe(o,h,s.binary),C=ZFe(A,x);return QFe(o,a,i,C),u(c)&&($Fe(o,i,C),t2e(o)),e2e(o,i,C),n2e(o),o._ready=!0,o};function jFe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Br(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function qFe(e){e=u(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=u(n.uri),n.isActive=!1}return e}function YFe(e,t){e=u(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function XFe(e,t){let n,i=e.tileAvailability;u(i.bitstream)?n=t[i.bitstream]:u(i.bufferView)&&(n=t[i.bufferView]),u(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,u(r[s].bitstream)?n=t[r[s].bitstream]:u(r[s].bufferView)&&(n=t[r[s].bufferView]),u(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;u(o.bitstream)?n=t[o.bitstream]:u(o.bufferView)&&(n=t[o.bufferView]),u(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function uie(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=y(o.values,o.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(o.stringOffsets,o.stringOffsetBufferView);u(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(o.arrayOffsets,o.arrayOffsetBufferView);u(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function KFe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=JFe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];u(a)&&(o[s]=a)}return o})}async function JFe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Ui.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function ZFe(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function QFe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=ni(t,"3DTILES_metadata"),l=u(e._tilePropertyTableJson),f=c||l;e._tileAvailability=l6(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=l6(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=l6(t.childSubtreeAvailability,i,a)}function l6(e,t,n,i){if(u(e.constant))return new LT({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return u(e.bitstream)?r=t[e.bitstream]:u(e.bufferView)&&(r=t[e.bufferView]),new LT({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function $Fe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new yl({class:a,count:r,properties:i.properties,bufferViews:n})}function e2e(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new yl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function fie(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function t2e(e){let t=fie(e._tileAvailability);e._tileJumpBuffer=t}function n2e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=fie(r);t.push(o)}}ea.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new de("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ea.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new de("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function i2e(e,t){if(!u(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function r2e(e,t,n){let i=e._contentMetadataTables;if(!u(i))return;let r=i[n];if(!u(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}ea.prototype.getTileMetadataView=function(e){let t=i2e(this,e);if(!u(t))return;let n=this._tileMetadataTable;return new NT({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ea.prototype.getContentMetadataView=function(e,t){let n=r2e(this,e,t);if(!u(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new NT({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};ea.prototype.isDestroyed=function(){return!1};ea.prototype.destroy=function(){return u(this._bufferLoader)&&Ui.unload(this._bufferLoader),ue(this)};var OA=ea;var o2e={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},MA=Object.freeze(o2e);function s2e(e){return{tile:{boundingVolume:die("TILE",e),minimumHeight:mie("TILE",e),maximumHeight:hie("TILE",e)},content:{boundingVolume:die("CONTENT",e),minimumHeight:mie("CONTENT",e),maximumHeight:hie("CONTENT",e)}}}function die(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(u(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(u(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(u(a))return{sphere:a}}function mie(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function hie(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}var b1=s2e;function Tl(e,t,n){let i=t.implicitTileset,r=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let o=r.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o});this._url=s.getUrlComponent(!0),this._ready=!1,this._readyPromise=void 0}Object.defineProperties(Tl.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Implicit3DTileContent.readyPromise","Implicit3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Implicit3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Tl.fromSubtreeJson=async function(e,t,n,i,r,o){o=y(o,0);let s;u(r)&&(s=new Uint8Array(r,o));let a=t.implicitTileset,c=t.implicitCoordinates,l=await OA.fromSubtreeJson(n,i,s,a,c),f=new Tl(e,t,n);return f._implicitSubtree=l,a2e(f,l),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function a2e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=l2e(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=c2e(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],l=c.tile,f=y2e(e,l,c.childIndex);l.children.push(f),o.numberOfTilesTotal++}}function c2e(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(u(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function l2e(e,t,n,i){let s=pie(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],l=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let h=0;h<g;h++){let A=p+h;if(!t.tileIsAvailableAtIndex(A)){l.push(void 0);continue}let x=t.getParentMortonIndex(h),C=c[x],T=h%f.branchingFactor,E=pie(e,t,C,T,A);C.children.push(E),a.numberOfTilesTotal++,l.push(E)}c=l,l=[]}return{rootTile:s,bottomRow:c}}function _ie(e,t,n){let i=MA.TILE_GEOMETRIC_ERROR;return u(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function pie(e,t,n,i,r,o){let s=e._implicitTileset,a;y(o,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,l,f;if(u(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=b1(c);l=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){g=!0;break}let h=d2e(s,a,i,o,n,l),A=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(r,D))continue;let B={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=m2e(h,f);u(L)&&(B.boundingVolume=L),A.push(_t(B,s.contentHeaders[D]))}let x=_ie(c,s,a),C={boundingVolume:h,geometricError:x,refine:s.refine,contents:A},T=!0,E=We(s.tileHeader,T);delete E.boundingVolume,delete E.transform;let S=_t(C,E,T),w=Cie(e,s.baseResource,S,n);return w.implicitCoordinates=a,w.implicitSubtree=t,w.metadata=c,w.hasImplicitContentMetadata=g,w}function oV(e,t){return u(e)&&u(t)&&(u(t.minimumHeight)||u(t.maximumHeight))&&(ni(e,"3DTILES_bounding_volume_S2")||u(e.region))}function f6(e,t){u(t)&&(ni(e,"3DTILES_bounding_volume_S2")?f2e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):u(e.region)&&u2e(e.region,t.minimumHeight,t.maximumHeight))}function u2e(e,t,n){u(t)&&(e[4]=t),u(n)&&(e[5]=n)}function f2e(e,t,n){u(t)&&(e.minimumHeight=t),u(n)&&(e.maximumHeight=n)}function d2e(e,t,n,i,r,o){let s;return!u(o)||!u(o.boundingVolume)||!oV(o.boundingVolume,o)&&oV(e.boundingVolume,o)?s=gie(e,t,n,y(i,!1),r):s=o.boundingVolume,f6(s,o),s}function m2e(e,t){let n;return u(t)&&(n=t.boundingVolume),oV(n,t)?f6(n,t):oV(e,t)&&(n=We(e,!0),f6(n,t)),n}function gie(e,t,n,i,r){let o=e.boundingVolume;return ni(o,"3DTILES_bounding_volume_S2")?yie(i,r,n,t.level,t.x,t.y,t.z):u(o.region)?{region:xie(o.region,t.level,t.x,t.y,t.z)}:{box:Aie(o.box,t.level,t.x,t.y,t.z)}}function yie(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:wp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),l=c%2===0?RT.encode2D(i,r,o):RT.encode2D(i,o,r),f=wp.fromFacePositionLevel(c,BigInt(l),i),d,p;if(u(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:wp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var h2e=new m,p2e=new m,u6=new m,_2e=new Q;function Aie(e,t,n,i,r){if(t===0)return e;let o=m.unpack(e,0,p2e),s=Q.unpack(e,3,_2e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,l=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,h2e);u(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=m.fromElements(c,l,f,u6);p=Q.multiplyByVector(s,p,u6),p=m.add(p,o,u6);let g=Q.clone(s);g=Q.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),Q.pack(g,h,3),h}var g2e=new ce;function xie(e,t,n,i,r){if(t===0)return e.slice();let o=ce.unpack(e,0,g2e),s=e[4],a=e[5],c=Math.pow(2,-t),l=c*o.width,f=P.negativePiToPi(o.west+n*l),d=P.negativePiToPi(f+l),p=c*o.height,g=P.negativePiToPi(o.south+i*p),h=P.negativePiToPi(g+p),A=s,x=a;if(u(r)){let C=c*(a-s);A+=r*C,x=A+C}return[f,g,d,h,A,x]}function y2e(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=gie(i,r,n,!1,t),s=_ie(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},l=Cie(e,i.baseResource,c,t);return l.implicitTileset=i,l.implicitCoordinates=r,l}function Cie(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}Tl.prototype.hasProperty=function(e,t){return!1};Tl.prototype.getFeature=function(e){};Tl.prototype.applyDebugSettings=function(e,t){};Tl.prototype.applyStyle=function(e){};Tl.prototype.update=function(e,t){};Tl.prototype.isDestroyed=function(){return!1};Tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};Tl._deriveBoundingBox=Aie;Tl._deriveBoundingRegion=xie;Tl._deriveBoundingVolumeS2=yie;var qT=Tl;var A2e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},El=Object.freeze(A2e);function YT(e,t){this._distance=t,this._normal=new Tie(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(YT.prototype,{distance:{get:function(){return this._distance},set:function(e){u(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){u(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});YT.fromPlane=function(e,t){return u(t)?(t.normal=e.normal,t.distance=e.distance):t=new YT(e.normal,e.distance),t};YT.clone=function(e,t){return u(t)?(t.normal=e.normal,t.distance=e.distance,t):new YT(e.normal,e.distance)};function Tie(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Tie.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){u(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){u(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){u(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var RA=YT;function Qa(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?wie:Die,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(u(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function wie(e){return e===$t.OUTSIDE}function Die(e){return e===$t.INSIDE}Object.defineProperties(Qa.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?wie:Die)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Eie(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Qa.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Eie(n,i)},e.index=t,Eie(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Qa.prototype.get=function(e){return this._planes[e]};function Iie(e,t){let n=e.length;for(let i=0;i<n;++i)if(ln.equals(e[i],t))return i;return-1}Qa.prototype.contains=function(e){return Iie(this._planes,e)!==-1};Qa.prototype.remove=function(e){let t=this._planes,n=Iie(t,e);if(n===-1)return!1;e instanceof RA&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof RA&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Qa.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof RA&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var x2e=new oe,C2e=new oe;function bie(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=Yn.octEncodeToCartesian4(a.normal,C2e);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let l=oe.packFloat(a.distance,x2e);i[o+4]=l.x,i[o+5]=l.y,i[o+6]=l.z,i[o+7]=l.w,o+=8}}function Sie(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function Pie(e,t){let n=Ht.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var T2e=new H;Qa.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Qa.useFloatTexture(n),r=i?this.length:this.length*2;if(u(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!u(t)){let s=Pie(r,T2e);s.y*=2,i?(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:Ke.FLOAT,sampler:fn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:fn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(Sie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(bie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),Sie(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),bie(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var E2e=new N,vie=new ln(m.UNIT_X,0);Qa.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;u(t)&&(r=N.multiply(t,r,E2e));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];ln.transform(a,r,vie);let c=e.intersectPlane(vie);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};Qa.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),u(e)&&(e._owner=t,t[n]=e))};Qa.useFloatTexture=function(e){return e.floatingPointTexture};Qa.getTextureResolution=function(e,t,n){let i=e.texture;if(u(i))return n.x=i.width,n.y=i.height,n;let r=Qa.useFloatTexture(t)?e.length:e.length*2,o=Pie(r,n);return o.y*=2,o};Qa.prototype.isDestroyed=function(){return!1};Qa.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var cs=Qa;var S1={HIGHLIGHT:0,REPLACE:1,MIX:2};S1.getColorBlend=function(e,t){if(e===S1.HIGHLIGHT)return 0;if(e===S1.REPLACE)return 1;if(e===S1.MIX)return P.clamp(t,P.EPSILON4,1)};var $a=Object.freeze(S1);var b2e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},ec=Object.freeze(b2e);var S2e={STEP:0,LINEAR:1,CUBICSPLINE:2},Id=Object.freeze(S2e);var Oie={};function v1(e){this._count=e.count,this._properties=We(e.properties,!0)}v1.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,Oie)};v1.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,Oie,e)};v1.prototype.getProperty=function(e,t){let n=this._properties[t];if(u(n))return We(n[e],!0)};v1.prototype.setProperty=function(e,t,n){let i=this._properties[t];u(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=We(n,!0)};var Bp=v1;function tc(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(tc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(u(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return u(this._metadataTable)&&(e+=this._metadataTable.byteLength),u(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});tc.prototype.hasProperty=function(e,t){return!!(u(this._metadataTable)&&this._metadataTable.hasProperty(t)||u(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||u(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};tc.prototype.hasPropertyBySemantic=function(e,t){return u(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};tc.prototype.propertyExists=function(e){return!!(u(this._metadataTable)&&this._metadataTable.hasProperty(e)||u(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||u(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};tc.prototype.propertyExistsBySemantic=function(e){return u(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var d6=[];tc.prototype.getPropertyIds=function(e,t){return t=u(t)?t:[],t.length=0,u(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(d6)),u(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,d6)),u(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(d6)),t};tc.prototype.getProperty=function(e,t){let n;if(u(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),u(n))||u(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),u(n))||u(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),u(n)))return n};tc.prototype.setProperty=function(e,t,n){u(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||u(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(u(this._jsonMetadataTable)||(this._jsonMetadataTable=new Bp({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};tc.prototype.getPropertyBySemantic=function(e,t){if(u(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};tc.prototype.setPropertyBySemantic=function(e,t,n){return u(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};tc.prototype.getPropertyTypedArray=function(e){if(u(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};tc.prototype.getPropertyTypedArrayBySemantic=function(e){if(u(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};tc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return u(n)?n.isClass(e,t):!1};tc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};tc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(u(t))return t.getClassName(e)};var kc=tc;function w1(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,r=u(t.channels)?t.channels:[0],o=t,s=xl.createModelTextureReader({textureInfo:o,channels:D2e(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,l=n.hasValueTransform||u(a)||u(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=l,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(w1.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});w1.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===qt.SCALAR&&n===nn.UINT8:qt.isVectorType(t)||t===qt.SCALAR?n===nn.UINT8:!1};var v2e=[void 0,"float","vec2","vec3","vec4"],w2e=[void 0,"int","ivec2","ivec3","ivec4"];w1.prototype.getGlslType=function(){let e=this._classProperty,t=qt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?v2e[t]:w2e[t]};w1.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function D2e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var D1=w1;function m6(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(u(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new D1({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(m6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});m6.prototype.getProperty=function(e){return this._properties[e]};var BA=m6;function Mie(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||u(i)||u(r);i=y(i,n.offset),r=y(r,n.scale),i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Mie.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var I1=Mie;function h6(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(u(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new I1({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(h6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});h6.prototype.getProperty=function(e){return this._properties[e]};var LA=h6;function P1(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=u(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(P1.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!u(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});P1.prototype.getPropertyTable=function(e){return this._propertyTables[e]};P1.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};P1.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Ea=P1;function I2e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(u(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],l=new yl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new kc({id:s,name:a.name,count:a.count,metadataTable:l,extras:a.extras,extensions:a.extensions}))}let r=[];if(u(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new BA({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(u(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new LA({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ea({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var O1=I2e;function P2e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,r=[],o;if(u(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],l=n.classes[c.class],f=new yl({count:c.count,properties:c.properties,class:l,bufferViews:e.bufferViews});r.push(new kc({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(u(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new BA({id:a,propertyTexture:O2e(c),class:n.classes[c.class],textures:e.textures}))}return new Ea({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function O2e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:M2e(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=_t(r.texture,o,!0)}return t}function M2e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var M1=P2e;function Bg(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,l=y(e.asynchronous,!0);this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=l,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=vt.UNLOADED,this._promise=void 0}u(Object.create)&&(Bg.prototype=Object.create(cr.prototype),Bg.prototype.constructor=Bg);Object.defineProperties(Bg.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function R2e(e){try{let t=U2e(e),n=G2e(e),i=W2e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=vt.LOADED,e)}catch(t){if(e.isDestroyed())return;e.unload(),e._state=vt.FAILED;let n="Failed to load structural metadata";throw e.getError(n,t)}}Bg.prototype.load=function(){return u(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=R2e(this),this._promise)};function B2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;u(r)&&(t[r]=!0),u(o)&&(t[o]=!0),u(s)&&(t[s]=!0)}}function L2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;u(r)&&(t[r]=!0),u(o)&&(t[o]=!0),u(s)&&(t[s]=!0)}}function N2e(e){let t=e.propertyTables,n={};if(u(t))for(let i=0;i<t.length;i++){let r=t[i];B2e(r.properties,n)}return n}function F2e(e){let t=e.featureTables,n={};if(u(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;u(o)&&L2e(o,n)}}return n}async function U2e(e){let t;u(e._extension)?t=N2e(e._extension):t=F2e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Ui.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function V2e(e){let t={},n=e.propertyTextures;if(u(n))for(let i=0;i<n.length;i++){let o=n[i].properties;u(o)&&k2e(o,t)}return t}function k2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function z2e(e){let t={},n=e.featureTextures;if(u(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;u(o)&&H2e(o,t)}}return t}function H2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function G2e(e){let t;u(e._extension)?t=V2e(e._extension):t=z2e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let l in t)if(t.hasOwnProperty(l)){let f=Ui.getTextureLoader({gltf:n,textureInfo:t[l],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(l),c.push(f.load())}return Promise.all(c)}async function W2e(e){let t=y(e._extension,e._extensionLegacy),n;if(u(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ui.getSchemaLoader({resource:i})}else n=Ui.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Bg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let l=t[a].process(e);i=i&&l}if(!i)return!1;let r=this._schemaLoader.schema,o={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],l=this._bufferViewLoaders[a];if(!l.isDestroyed()){let f=new Uint8Array(l.typedArray);o[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],l=t[a];l.isDestroyed()||(s[c]=l.texture)}return u(this._extension)?this._structuralMetadata=O1({extension:this._extension,schema:r,bufferViews:o,textures:s}):this._structuralMetadata=M1({extension:this._extensionLegacy,schema:r,bufferViews:o,textures:s}),Rie(this),this._state=vt.READY,!0};function Rie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ui.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function j2e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ui.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Bg.prototype.unload=function(){Rie(this),j2e(this),u(this._schemaLoader)&&Ui.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var R1=Bg;var XT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};XT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return XT.TRANSLATION;case"ROTATION":return XT.ROTATION;case"SCALE":return XT.SCALE;case"_FEATURE_ID":return XT.FEATURE_ID}};var qo=Object.freeze(XT);var q2e=65534,Y2e=255;function sV(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Nie(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],X2e(this)}Object.defineProperties(sV.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function X2e(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],l=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,l),g=d||n.hasEdge(l,f),h=d||n.hasEdge(f,c),A=Bie(i,c,l,f,p,g,h);for(;u(A);){let x=s[A];if(!u(x)){x=o+r.length;let C=A;for(;C>=o;)C=r[C-o];r.push(C),s[A]=x}x>q2e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>Y2e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),A===c?(c=x,t[a]=x):A===l?(l=x,t[a+1]=x):(f=x,t[a+2]=x),A=Bie(i,c,l,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Bie(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,l=0,f=p6(e,t,a,c,l);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,h=p6(e,n,d,p,g);if(h===0)return n;let A=s?1:0,x=0,C=o?1:0,T=p6(e,i,A,x,C);if(T===0)return i;let E=f&h&T,S,w,D;if(E&1<<0)S=0,w=1,D=2;else if(E&1<<1)S=0,D=1,w=2;else if(E&1<<2)w=0,S=1,D=2;else if(E&1<<3)w=0,D=1,S=2;else if(E&1<<4)D=0,S=1,w=2;else if(E&1<<5)D=0,w=1,S=2;else{let L=_6(f),_=_6(h),b=_6(T);return L<_&&L<b?t:_<b?n:i}let M=t*3;e[M+S]=a,e[M+w]=c,e[M+D]=l;let O=n*3;e[O+S]=d,e[O+w]=p,e[O+D]=g;let B=i*3;e[B+S]=A,e[B+w]=x,e[B+D]=C}function p6(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return u(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function _6(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}sV.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,l=n+a*i;for(let f=0;f<i;f++)s[l+f]=s[c+f]}return s};sV.createTexture=function(e){let t=e.cache.modelOutliningCache;if(u(t)||(t=e.cache.modelOutliningCache={}),u(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ht.maximumTextureSize),i=n,r=Lie(i),o=[];for(;i>1;)i>>=1,o.push(Lie(i));let s=new Rt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:at.LUMINANCE,sampler:new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR_MIPMAP_LINEAR,magnificationFilter:Ti.LINEAR})});return t.outlineTexture=s,s};function Lie(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Nie(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}Nie.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var NA=sV;function Fie(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function K2e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function aV(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}aV.prototype.postProcess=function(e){this.needsOutlines&&(J2e(this),Q2e(this,e))};function J2e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new NA({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Fe.fromTypedArray(n.typedArray);let o=Z2e(r.outlineCoordinates),s=new Fie(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let l=0;l<c;l++){let f=a[l].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function Z2e(e){let t=new Nt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=an.VEC3,t.normalized=!1,t.count=e.length/3,t}function Q2e(e,t){$2e(e.attributePlans,t),u(e.indicesPlan)&&e3e(e.indicesPlan,t)}function $2e(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=mt.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function e3e(e,t){let n=e.indices;if(e.loadBuffer){let i=mt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}aV.AttributeLoadPlan=Fie;aV.IndicesLoadPlan=K2e;var FA=aV;function t3e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var B1=t3e;var n3e=Nt.Attribute,i3e=Nt.Indices,Uie=Nt.FeatureIdAttribute,Vie=Nt.FeatureIdTexture,kie=Nt.FeatureIdImplicitRange,r3e=Nt.MorphTarget,o3e=Nt.Primitive,s3e=Nt.Instances,a3e=Nt.Skin,c3e=Nt.Node,l3e=Nt.AnimatedPropertyType,u3e=Nt.AnimationSampler,f3e=Nt.AnimationTarget,d3e=Nt.AnimationChannel,m3e=Nt.Animation,h3e=Nt.ArticulationStage,p3e=Nt.Articulation,_3e=Nt.Asset,g3e=Nt.Scene,y3e=Nt.Components,A3e=Nt.MetallicRoughness,x3e=Nt.SpecularGlossiness,C3e=Nt.Material,Lr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Pd(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=y(e.releaseGltfJson,!1),o=y(e.asynchronous,!0),s=y(e.incrementallyLoadTextures,!0),a=y(e.upAxis,hr.Y),c=y(e.forwardAxis,hr.Z),l=y(e.loadAttributesAsTypedArray,!1),f=y(e.loadAttributesFor2D,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.loadForClassification,!1),h=y(e.renameBatchIdSemantic,!1);n=u(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=h,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Lr.NOT_LOADED,this._textureState=Lr.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}u(Object.create)&&(Pd.prototype=Object.create(cr.prototype),Pd.prototype.constructor=Pd);Object.defineProperties(Pd.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return u(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function T3e(e){e._state=Lr.LOADING,e._textureState=Lr.LOADING;try{let t=Ui.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Lr.LOADED,e._textureState=Lr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Lr.FAILED,e._textureState=Lr.FAILED,cV(e,t)}}async function E3e(e,t){Gt.supportsWebP.initialized||await Gt.supportsWebP.initialize();let n=new B1({webp:Gt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,r=xUe(e,i,n,t);return e._state=Lr.PROCESSING,e._textureState=Lr.PROCESSING,u(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ui.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),r}Pd.prototype.load=async function(){return u(this._promise)?this._promise:(this._promise=T3e(this),this._promise)};function cV(e,t){e.unload();let n="Failed to load glTF";throw e.getError(n,t)}function b3e(e,t){let n,i=!0,r=e._geometryLoaders,o=r.length;for(n=0;n<o;++n){let a=r[n].process(t);a&&u(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(u(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=Lr.POST_PROCESSING)}function S3e(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.postProcess(t),o.needsOutlines&&v3e(e,o)}}function v3e(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;u(r)&&n.push(r.buffer);let o=i.attributes,s=o.length;for(let c=0;c<s;c++){let l=o[c];u(l.buffer)&&n.push(l.buffer)}let a=i.indices;u(a)&&u(a.buffer)&&n.push(a.buffer)}Pd.prototype._process=function(e){return this._state===Lr.READY?!0:(this._state===Lr.PROCESSING&&b3e(this,e),this._resourcesLoaded&&this._state===Lr.POST_PROCESSING&&(S3e(this,e.context),this._state=Lr.PROCESSED),this._resourcesLoaded&&this._state===Lr.PROCESSED?(Kie(this),this._typedArray=void 0,this._state=Lr.READY,!0):!1)};Pd.prototype._processTextures=function(e){if(this._textureState===Lr.READY)return!0;if(this._textureState!==Lr.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,r=i.length;for(t=0;t<r;++t){let o=i[t].process(e);o&&u(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&o}return n?(this._textureState=Lr.READY,this._texturesLoaded=!0,!0):!1};Pd.prototype.process=function(e){if(this._state===Lr.LOADED&&!u(this._loadResourcesPromise)&&(this._loadResourcesPromise=E3e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),u(this._processError)){this._state=Lr.FAILED;let r=this._processError;this._processError=void 0,cV(this,r)}let t=this._textureErrors.pop();if(u(t)){let r=this.getError("Failed to load glTF texture",t);throw r.name="TextureError",r}if(this._state===Lr.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(r){this._state=Lr.FAILED,cV(this,r)}let i=!1;try{i=this._processTextures(e)}catch(r){this._textureState=Lr.FAILED,cV(this,r)}return this._incrementallyLoadTextures?n:n&&i};function w3e(e,t,n,i,r,o,s,a){let l=t.accessors[n].bufferView;return Ui.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:l,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:s})}function D3e(e,t,n,i,r,o,s){return Ui.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function I3e(e,t,n){let i=Ui.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function zie(e,t,n){let i=t.byteOffset,r=Al(e,t),o=t.count,s=au(t.type),a=t.componentType,c=X.getSizeInBytes(a),l=c*s,f=o*s;if(r===l)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=Rp(t.componentType);i=n.byteOffset+i;for(let A=0;A<o;++A){h(p,i,s,c,g);for(let x=0;x<s;++x)d[A*s+x]=g[x];i+=r}return d}function P3e(e,t){let n=e.type;if(n===an.SCALAR)return t.fill(0);let i=an.getMathType(n);return t.fill(i.clone(i.ZERO))}function O3e(e,t,n,i){let r=e.type,o=e.count;if(r===an.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===an.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=an.getMathType(r),a=an.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function M3e(e,t,n,i,r,o){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=zie(n,i,s);r=y(r,!1),O3e(i,a,o,r)}function lV(e,t,n,i){let r=t.accessors[n],o=r.count,s=new Array(o),a=r.bufferView;if(u(a)){let c=I3e(e,t,a),l=M3e(e,c,t,r,i,s);return e._loaderPromises.push(l),s}return P3e(r,s)}function af(e,t){if(u(t))return e===Number?t[0]:e.unpack(t)}function R3e(e){return e===Number?0:new e}function B3e(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var L3e={VEC2:new H(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function N3e(e,t){let n=B3e(e.componentDatatype),i=L3e[e.type],r=e.min;u(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;u(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function F3e(e,t,n){let i=e.decodeMatrix,r=af(n,e.decodedMin),o=af(n,e.decodedMax);u(r)&&u(o)&&(t.min=r,t.max=o);let s=new Nt.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new H(i[6],i[7]),s.quantizedVolumeStepSize=new H(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function U3e(e,t,n,i,r){let o=e.accessors[t],s=an.getMathType(o.type),a=y(o.normalized,!1),c=new n3e;c.name=n,c.semantic=i,c.setIndex=r,c.constant=R3e(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=af(s,o.min),c.max=af(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=Al(e,o),ni(o,"WEB3D_quantized_attributes")&&F3e(o.extensions.WEB3D_quantized_attributes,c,s);let l=c.semantic===Et.POSITION||c.semantic===Et.NORMAL||c.semantic===Et.TANGENT||c.semantic===Et.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&l&&N3e(c,s),c}function Hie(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var V3e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function g6(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=V3e;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function k3e(e){let t=e===Et.POSITION,n=e===Et.FEATURE_ID,i=e===Et.TEXCOORD;return t||n||i}function z3e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=u(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(r,t.typedArray.buffer)}}function H3e(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=zie(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function Gie(e,t,n,i,r,o,s,a){let c=t.accessors[n],l=c.bufferView,f=i.gltfSemantic,d=i.renamedSemantic,p=i.modelSemantic,g=u(p)?Hie(d):void 0,A=U3e(t,n,f,p,g);if(!u(r)&&!u(l))return A;let x=w3e(e,t,n,f,r,o,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(x);let T=x.load();return e._loaderPromises.push(T),e._geometryCallbacks[C]=()=>{u(r)&&u(r.attributes)&&u(r.attributes[f])?z3e(A,x,o,s):H3e(t,c,A,x,o,s)},A}function Wie(e,t,n,i,r,o,s,a){let c=i.modelSemantic,l=c===Et.POSITION,f=c===Et.FEATURE_ID,d=l&&!o&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,A=g||d||p,T=Gie(e,t,n,i,r,s?!1:h,s?!0:A,a),E=new FA.AttributeLoadPlan(T);return E.loadBuffer=h,E.loadTypedArray=A,E}function G3e(e,t,n,i,r,o){let s=u(i.ROTATION),a=u(i.TRANSLATION)&&u(t.accessors[i.TRANSLATION].min)&&u(t.accessors[i.TRANSLATION].max),c=g6(e,qo,r),l=c.modelSemantic,f=l===qo.TRANSLATION||l===qo.ROTATION||l===qo.SCALE,d=l===qo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!o.scene3DOnly;return Gie(e,t,n,c,void 0,g,p||d&&(!a||h),o)}function W3e(e,t,n,i,r,o,s){let a=t.accessors[n],c=a.bufferView;if(!u(i)&&!u(c))return;let l=new i3e;l.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&r,h=!f,A=f||d||p,T=D3e(e,t,n,i,o?!1:h,o?!0:A,s),E=e._geometryLoaders.length;e._geometryLoaders.push(T);let S=T.load();e._loaderPromises.push(S),e._geometryCallbacks[E]=()=>{l.indexDatatype=T.indexDatatype,l.buffer=T.buffer,l.typedArray=T.typedArray};let w=new FA.IndicesLoadPlan(l);return w.loadBuffer=h,w.loadTypedArray=A,w}function Lp(e,t,n,i,r,o){let s=xl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!u(s))return;let a=Ui.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:r,asynchronous:e._asynchronous}),c=xl.createModelTextureReader({textureInfo:n}),l=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Lr.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[l]=()=>{c.texture=a.texture,u(o)&&(c.texture.sampler=o)},c}function j3e(e,t,n,i,r){let o=new C3e,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(o.unlit=u(s.KHR_materials_unlit),u(a)){let l=new x3e;o.specularGlossiness=l,u(a.diffuseTexture)&&(l.diffuseTexture=Lp(e,t,a.diffuseTexture,i,r)),u(a.specularGlossinessTexture)&&u(a.specularGlossinessTexture)&&(l.specularGlossinessTexture=Lp(e,t,a.specularGlossinessTexture,i,r)),l.diffuseFactor=af(oe,a.diffuseFactor),l.specularFactor=af(m,a.specularFactor),l.glossinessFactor=a.glossinessFactor,o.pbrSpecularGlossiness=a}else if(u(c)){let l=new A3e;u(c.baseColorTexture)&&(l.baseColorTexture=Lp(e,t,c.baseColorTexture,i,r)),u(c.metallicRoughnessTexture)&&(l.metallicRoughnessTexture=Lp(e,t,c.metallicRoughnessTexture,i,r)),l.baseColorFactor=af(oe,c.baseColorFactor),l.metallicFactor=c.metallicFactor,l.roughnessFactor=c.roughnessFactor,o.metallicRoughness=l}return u(n.emissiveTexture)&&(o.emissiveTexture=Lp(e,t,n.emissiveTexture,i,r)),u(n.normalTexture)&&!e._loadForClassification&&(o.normalTexture=Lp(e,t,n.normalTexture,i,r)),u(n.occlusionTexture)&&(o.occlusionTexture=Lp(e,t,n.occlusionTexture,i,r)),o.emissiveFactor=af(m,n.emissiveFactor),o.alphaMode=n.alphaMode,o.alphaCutoff=n.alphaCutoff,o.doubleSided=n.doubleSided,o}function jie(e,t){let n=new Uie;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function qie(e,t,n,i){let r=new Uie,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Hie(o.attribute),r.positionalLabel=i,r}function Yie(e,t){let n=new kie;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Xie(e,t,n,i){let r=new kie,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=y(o.constant,0);let s=y(o.divisor,0);return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function q3e(e,t,n,i,r,o){let s=new Vie;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=o;let a=n.texture;s.textureReader=Lp(e,t,a,i,r,fn.NEAREST);let l=(u(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=l,s}function Y3e(e,t,n,i,r,o,s,a){let c=new Vie,l=n.featureIds,f=l.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Lp(e,t,f,r,o,fn.NEAREST),c.textureReader.channels=l.channels,c.positionalLabel=a,c}function X3e(e,t,n,i,r,o){let s=new r3e,a=void 0,c=!1;for(let l in n)if(n.hasOwnProperty(l)){let f=n[l],d=g6(e,Et,l),p=Wie(e,t,f,d,a,c,i,o);s.attributes.push(p.attribute),r.attributePlans.push(p)}return s}function K3e(e,t,n,i,r,o){let s=new o3e,a=new FA(s);e._primitiveLoadPlans.push(a);let c=n.material;u(c)&&(s.material=j3e(e,t,t.materials[c],r,o));let l=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=l.CESIUM_primitive_outline;e._loadPrimitiveOutline&&u(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=J3e(e,t,d,a));let p=e._loadForClassification,g=l.KHR_draco_mesh_compression,h=!1,A=n.attributes;if(u(A)){for(let M in A)if(A.hasOwnProperty(M)){let O=A[M],B=g6(e,Et,M),L=B.modelSemantic;if(p&&!k3e(L))continue;L===Et.FEATURE_ID&&(h=!0);let _=Wie(e,t,O,B,g,i,f,o);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let x=n.targets;if(u(x)&&!p){let M=x.length;for(let O=0;O<M;++O)s.morphTargets.push(X3e(e,t,x[O],f,a,o))}let C=n.indices;if(u(C)){let M=W3e(e,t,C,g,h,f,o);u(M)&&(a.indicesPlan=M,s.indices=M.indices)}let T=l.EXT_structural_metadata,E=l.EXT_mesh_features,S=l.EXT_feature_metadata,w=u(S);u(E)?Z3e(e,t,s,E,r,o):w&&Q3e(e,t,s,S,r,o),u(T)?$3e(s,T):w&&eUe(e,s,S);let D=n.mode;if(p&&D!==Be.TRIANGLES)throw new de("Only triangle meshes can be used for classification.");return s.primitiveType=D,s}function J3e(e,t,n){let i=n.indices;return lV(e,t,i,!1)}function Z3e(e,t,n,i,r,o){let s;u(i)&&u(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],l=`featureId_${a}`,f;u(c.texture)?f=q3e(e,t,c,r,o,l):u(c.attribute)?f=jie(c,l):f=Yie(c,l),n.featureIds.push(f)}}function Q3e(e,t,n,i,r,o){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(u(c)){let f=c.length;for(let d=0;d<f;++d){let p=c[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),A=s[g].count,x=`featureId_${a}`;a++;let C;u(p.featureIds.attribute)?C=qie(p,h,A,x):C=Xie(p,h,A,x),n.featureIds.push(C)}}let l=i.featureIdTextures;if(u(l)){let f=l.length;for(let d=0;d<f;++d){let p=l[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),A=s[g].count,x=`featureId_${a}`;a++;let C=Y3e(e,t,p,h,r,o,A,x);n.featureIds.push(C)}}}function $3e(e,t){u(t)&&(u(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),u(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function eUe(e,t,n){u(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function tUe(e,t,n,i){let r=n.EXT_mesh_gpu_instancing,o=new s3e,s=r.attributes;if(u(s)){for(let f in s)if(s.hasOwnProperty(f)){let d=s[f];o.attributes.push(G3e(e,t,d,s,f,i))}}let a=y(r.extensions,y.EMPTY_OBJECT),c=n.EXT_instance_features,l=a.EXT_feature_metadata;return u(c)?nUe(o,c):u(l)&&iUe(t,o,l,e._sortedPropertyTableIds),o}function nUe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;u(r.attribute)?s=jie(r,o):s=Yie(r,o),e.featureIds.push(s)}}function iUe(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(u(o)){let s=o.length;for(let a=0;a<s;++a){let c=o[a],l=c.featureTable,f=i.indexOf(l),d=r[l].count,p=`instanceFeatureId_${a}`,g;u(c.featureIds.attribute)?g=qie(c,f,d,p):g=Xie(c,f,d,p),t.featureIds.push(g)}}}function rUe(e,t,n,i,r){let o=new c3e;o.name=n.name,o.matrix=af(N,n.matrix),o.translation=af(m,n.translation),o.rotation=af(Le,n.rotation),o.scale=af(m,n.scale);let s=y(n.extensions,y.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(u(a)){if(e._loadForClassification)throw new de("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");o.instances=tUe(e,t,s,r)}u(c)&&(o.articulationName=c.articulationName);let l=n.mesh;if(u(l)){let f=t.meshes[l],d=f.primitives,p=d.length;for(let x=0;x<p;++x)o.primitives.push(K3e(e,t,d[x],u(o.instances),i,r));let g=y(n.weights,f.weights),A=o.primitives[0].morphTargets.length;o.morphWeights=u(g)?g.slice():new Array(A).fill(0)}return o}function oUe(e,t,n,i){if(!u(t.nodes))return[];let r,o,s=t.nodes.length,a=new Array(s);for(r=0;r<s;++r){let c=rUe(e,t,t.nodes[r],n,i);c.index=r,a[r]=c}for(r=0;r<s;++r){let c=t.nodes[r].children;if(u(c)){let l=c.length;for(o=0;o<l;++o)a[r].children.push(a[c[o]])}}return a}function sUe(e,t,n,i){let r=new a3e,o=n.joints,s=o.length,a=new Array(s);for(let l=0;l<s;++l)a[l]=i[o[l]];r.joints=a;let c=n.inverseBindMatrices;return u(c)?r.inverseBindMatrices=lV(e,t,c):r.inverseBindMatrices=new Array(s).fill(N.IDENTITY),r}function aUe(e,t,n){let i=t.skins;if(e._loadForClassification||!u(i))return[];let r=t.skins.length,o=new Array(r);for(let a=0;a<r;++a){let c=sUe(e,t,t.skins[a],n);c.index=a,o[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;u(c)&&(n[a].skin=o[c])}return o}async function cUe(e,t,n,i,r,o){let s=new R1({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:r,frameState:o,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function lUe(e,t,n){let i=new u3e,r=n.input;i.input=lV(e,t,r);let o=n.interpolation;i.interpolation=y(Id[o],Id.LINEAR);let s=n.output;return i.output=lV(e,t,s,!0),i}function uUe(e,t){let n=new f3e,i=e.node;if(!u(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=l3e[r],n}function fUe(e,t,n){let i=new d3e,r=e.sampler;return i.sampler=t[r],i.target=uUe(e.target,n),i}function dUe(e,t,n,i){let r,o=new m3e;o.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(r=0;r<a;r++){let p=lUe(e,t,s[r]);p.index=r,c[r]=p}let l=n.channels,f=l.length,d=new Array(f);for(r=0;r<f;r++)d[r]=fUe(l[r],c,i);return o.samplers=c,o.channels=d,o}function mUe(e,t,n){let i=t.animations;if(e._loadForClassification||!u(i))return[];let r=t.animations.length,o=new Array(r);for(let s=0;s<r;++s){let a=dUe(e,t,t.animations[s],n);a.index=s,o[s]=a}return o}function hUe(e){let t=new h3e;t.name=e.name;let n=e.type.toUpperCase();return t.type=ec[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function pUe(e){let t=new p3e;t.name=e.name;let n=e.stages,i=n.length,r=new Array(i);for(let o=0;o<i;o++){let s=hUe(n[o]);r[o]=s}return t.stages=r,t}function _Ue(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations;if(!u(n))return[];let i=n.articulations;if(!u(i))return[];let r=i.length,o=new Array(r);for(let s=0;s<r;s++){let a=pUe(i[s]);o[s]=a}return o}function gUe(e){let t;return u(e.scenes)&&u(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=u(t)?t:[],t}function yUe(e,t){let n=new g3e,i=gUe(e);return n.nodes=i.map(function(r){return t[r]}),n}var AUe=new m;function xUe(e,t,n,i){let r=y(t.extensions,y.EMPTY_OBJECT),o=r.EXT_structural_metadata,s=r.EXT_feature_metadata,a=r.CESIUM_RTC;if(u(s)){let C=s.featureTables,T=s.featureTextures,E=u(C)?C:[],S=u(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let c=oUe(e,t,n,i),l=aUe(e,t,c),f=mUe(e,t,c),d=_Ue(t),p=yUe(t,c),g=new y3e,h=new _3e,A=t.asset.copyright;if(u(A)){let C=A.split(";").map(function(T){return new Dt(T.trim())});h.credits=C}if(g.asset=h,g.scene=p,g.nodes=c,g.skins=l,g.animations=f,g.articulations=d,g.upAxis=e._upAxis,g.forwardAxis=e._forwardAxis,u(a)){let C=m.fromArray(a.center,0,AUe);g.transform=N.fromTranslation(C,g.transform)}if(e._components=g,u(o)||u(s)){let C=cUe(e,t,o,s,n,i);e._loaderPromises.push(C)}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function CUe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Ui.unload(t[i]);e._textureLoaders.length=0}function Kie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Ui.unload(t[i]);e._bufferViewLoaders.length=0}function TUe(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Ui.unload(t[i]);e._geometryLoaders.length=0}function EUe(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}function bUe(e){u(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Pd.prototype.isUnloaded=function(){return this._state===Lr.UNLOADED};Pd.prototype.unload=function(){u(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ui.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,CUe(this),Kie(this),TUe(this),EUe(this),bUe(this),this._components=void 0,this._typedArray=void 0,this._state=Lr.UNLOADED};var Km=Pd;var L1=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); -vec2 neighborContribution(float log2Depth, vec2 offset) -{ - float dist = u_distanceAndEdlStrength.x; - vec2 texCoordOrig = v_textureCoordinates + offset * dist; - vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); - vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); - float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - // ignore depth values that are the clear depth - if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { - return vec2(0.0); - } + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - // interpolate the two adjacent depth values - float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); - return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); -} + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); -void main() -{ - float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); - eyeCoordinate /= eyeCoordinate.w; + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - float log2Depth = log2(-eyeCoordinate.z); +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates - if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer - { - discard; - } + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR - vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif - // sample from neighbors left, right, down, up - vec2 texelSize = 1.0 / czm_viewport.zw; + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. - vec2 responseAndCount = vec2(0.0); + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; - float response = responseAndCount.x / responseAndCount.y; - float strength = u_distanceAndEdlStrength.y; - float shade = exp(-response * 300.0 * strength); - color.rgb *= shade; - out_FragColor = vec4(color); + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - // Input and output depth are the same. - gl_FragDepth = depthOrLogDepth; -} -`;function KT(){this._framebuffer=new mi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(KT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function SUe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var y6=new H;function vUe(e,t){let n=new ke({defines:["LOG_DEPTH_WRITE"],sources:[L1]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return y6.x=e._radius,y6.y=e._strength,y6}},r=Ve.fromCache({blending:dn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ft.setCesium3DTileBit(),stencilMask:Ft.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:ve.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ri({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:ve.CESIUM_3D_TILE,owner:e})}function wUe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),vUe(e,t)}function Jie(e){return e.drawBuffers&&e.fragmentDepth}KT.isSupported=Jie;function DUe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!u(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=ke.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}KT.prototype.update=function(e,t,n,i){if(!Jie(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,wUe(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let l=o[r];if(l.primitiveType!==Be.POINTS||l.pass===ve.TRANSLUCENT)continue;let f,d,p=l.derivedCommands.pointCloudProcessor;u(p)&&(f=p.command,d=p.originalShaderProgram),(!u(f)||l.dirty||d!==l.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=et.shallowClone(l,f),f.framebuffer=this.framebuffer,f.shaderProgram=DUe(e.context,l.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,u(p)||(p={command:f,originalShaderProgram:l.shaderProgram},l.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=l.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};KT.prototype.isDestroyed=function(){return!1};KT.prototype.destroy=function(){return SUe(this),ue(this)};var Np=KT;function Zie(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Zie.isSupported=function(e){return Np.isSupported(e.context)};var Jm=Zie;var ba={},IUe=new oe(0,0,0,1),nc=new oe,PUe=new Ye,A6=new H,x6=new H;ba.wgs84ToWindowCoordinates=function(e,t,n){return ba.wgs84WithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Qie=new oe,$ie=new m;function N1(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,oe.fromElements(e.x,e.y,e.z,1,Qie),Qie),s=m.multiplyComponents(t,m.normalize(o,$ie),$ie);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,N.multiplyByVector(n.frustum.projectionMatrix,o,i)}var OUe=new he(Math.PI,P.PI_OVER_TWO),MUe=new m,RUe=new m;ba.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=ba.computeActualWgs84Position(r,t,IUe);if(!u(o))return;let s=e.canvas,a=PUe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,l=!1;if(r.mode===ne.SCENE2D){let f=e.mapProjection,d=OUe,p=f.project(d,MUe),g=m.clone(c.position,RUe),h=c.frustum.clone(),A=N.computeViewportTransformation(a,0,1,new N),x=c.frustum.projectionMatrix,C=c.positionWC.y,T=m.fromElements(P.sign(C)*p.x-C,0,-c.positionWC.x),E=Mt.pointToGLWindowCoordinates(x,A,T);if(C===0||E.x<=0||E.x>=s.clientWidth)l=!0;else{if(E.x>s.clientWidth*.5){a.width=E.x,c.frustum.right=p.x-C,nc=N1(o,n,c,nc),ba.clipToGLWindowCoordinates(a,nc,A6),a.x+=E.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,nc=N1(o,n,c,nc),ba.clipToGLWindowCoordinates(a,nc,x6)}else{a.x+=E.x,a.width-=E.x,c.frustum.left=-p.x-C,nc=N1(o,n,c,nc),ba.clipToGLWindowCoordinates(a,nc,A6),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,nc=N1(o,n,c,nc),ba.clipToGLWindowCoordinates(a,nc,x6)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(A6,i),(i.x<0||i.x>s.clientWidth)&&(i.x=x6.x)}}if(r.mode!==ne.SCENE2D||l){if(nc=N1(o,n,c,nc),nc.z<0&&!(c.frustum instanceof tn)&&!(c.frustum instanceof bo))return;i=ba.clipToGLWindowCoordinates(a,nc,i)}return i.y=s.clientHeight-i.y,i};ba.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=ba.wgs84ToWindowCoordinates(e,t,n),!!u(n))return ba.transformWindowToDrawingBuffer(e,n,n)};var Fp=new m,BUe=new he;ba.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,BUe);if(!u(o))return;if(r.project(o,Fp),i===ne.COLUMBUS_VIEW)return m.fromElements(Fp.z,Fp.x,Fp.y,n);if(i===ne.SCENE2D)return m.fromElements(0,Fp.x,Fp.y,n);let s=e.morphTime;return m.fromElements(P.lerp(Fp.z,t.x,s),P.lerp(Fp.x,t.y,s),P.lerp(Fp.y,t.z,s),n)};var ere=new m,tre=new m,nre=new N;ba.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,ere),N.computeViewportTransformation(e,0,1,nre),N.multiplyByPoint(nre,ere,tre),H.fromCartesian3(tre,n)};ba.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*r,t.y*o,n)};var LUe=new oe,ire=new oe;ba.drawingBufferToWgs84Coordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let l=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,LUe);f.x=(t.x-l.x)/l.width*2-1,f.y=(t.y-l.y)/l.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(u(p.fovy)){d=N.multiplyByVector(o.inverseViewProjection,f,ire);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;u(g)&&(p=g),d=ire,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=N.multiplyByVector(o.inverseView,d,d)}return m.fromCartesian4(d,i)};var $i=ba;var NUe={LEFT:-1,NONE:0,RIGHT:1},zc=Object.freeze(NUe);var JT={};JT._deprecationWarning=$;var Up=Uint32Array.BYTES_PER_ELEMENT;JT.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Up;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Up;let s=r.getUint32(t,!0);t+=Up;let a=r.getUint32(t,!0);t+=Up;let c=r.getUint32(t,!0);t+=Up;let l=r.getUint32(t,!0);t+=Up;let f=r.getUint32(t,!0);t+=Up;let d;l>=570425344?(t-=Up*2,d=a,l=c,f=0,a=0,c=0,JT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Up,d=l,l=a,f=c,a=0,c=0,JT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Br(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,A;l>0&&(h=Br(i,t,l),t+=l,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(JT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var F1=JT;function U1(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function rre(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return u(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function FUe(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return u(o)||(o=X.createTypedArray(n,i),r[t]=o),o}U1.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(u(i))return u(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),rre(this,e,t,n,1,i.byteOffset)):i};U1.prototype.hasProperty=function(e){return u(this.json[e])};U1.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(u(i))return u(i.byteOffset)?(u(i.componentType)&&(t=X.fromName(i.componentType)),rre(this,e,t,n,this.featuresLength,i.byteOffset)):FUe(this,e,t,i)};U1.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!u(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Od=U1;function V1(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=y(e.parseAsPropertyAttributes,!1),o=e.customAttributeOutput,s=UUe(n),a;u(s.jsonProperties)&&(a=new Bp({count:t,properties:s.jsonProperties}));let c;u(s.hierarchy)&&(c=new _A({extension:s.hierarchy,binaryBody:i}));let l=vd.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let x=kUe(t,l,f,i,o);g=x.transcodedSchema,p=[new LA({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=VUe(t,l,f,i);g=x.transcodedSchema;let C=x.featureTableJson;d=new yl({count:C.count,properties:C.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),p=[]}let h=[];if(u(d)||u(a)||u(c)){let x=new kc({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});h.push(x)}let A={schema:g,propertyTables:h,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ea(A)}function UUe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;u(t)?(V1._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):u(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=u(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function VUe(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!u(i))throw new de(`Property ${d} requires a batch table binary.`);let p=n[d],g=ou(p);o[d]={bufferView:a},r[d]=ore(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let l=wd.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:l,transcodedClass:l.classes[t]}}function kUe(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!u(i)&&!u(p.typedArray))throw new de(`Property ${d} requires a batch table binary.`);let g=Zt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let h=ore(p);h.name=d,o[g]=h;let A=g.toUpperCase();A.startsWith("_")||(A=`_${A}`);let x=p.typedArray;u(x)||(x=ou(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Nt.Attribute;C.name=A,C.count=e,C.type=p.type;let T=X.fromTypedArray(x);(T===X.INT||T===X.UNSIGNED_INT||T===X.DOUBLE)&&(V1._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${A}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),x=new Float32Array(x)),C.componentDatatype=X.fromTypedArray(x),C.typedArray=x,r.push(C),s[g]={attribute:A}}let c={classes:{}};c.classes[t]={properties:o};let l=wd.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:l,transcodedClass:l.classes[t]}}function ore(e){let t=zUe(e.componentType);return{type:e.type,componentType:t}}function zUe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}V1._deprecationWarning=$;V1._oneTimeWarning=Ot;var Vp=V1;var UA={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},HUe=Nt.FeatureIdAttribute;function Lg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),l=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.loadIndicesForWireframe,!1),g=y(e.loadPrimitiveOutline,!0),h=y(e.loadForClassification,!1);n=u(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=l,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=h,this._state=UA.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=N.IDENTITY}u(Object.create)&&(Lg.prototype=Object.create(cr.prototype),Lg.prototype.constructor=Lg);Object.defineProperties(Lg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Lg.prototype.load=function(){if(u(this._promise))return this._promise;let e=F1.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,s=new Od(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);u(a)&&(this._transform=N.fromTranslation(m.fromArray(a))),this._batchTable={json:r,binary:o};let c=new Km({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=UA.LOADING;let l=this;return this._promise=c.load().then(function(){if(!l.isDestroyed())return l._state=UA.PROCESSING,l}).catch(function(f){if(!l.isDestroyed())return GUe(l,f)}),this._promise};function GUe(e,t){e.unload(),e._state=UA.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}Lg.prototype.process=function(e){if(this._state===UA.READY)return!0;if(this._state!==UA.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=N.multiplyTransformation(this._transform,n.transform,n.transform),WUe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=UA.READY,!0};function WUe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(u(n.json))r=Vp({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new kc({name:vd.BATCH_TABLE_CLASS_NAME,count:i});r=new Ea({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)sre(o[a]);t.structuralMetadata=r}function sre(e){let t=e.children.length;for(let i=0;i<t;i++)sre(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=Zt.getAttributeBySemantic(r,Et.FEATURE_ID);if(u(o)){o.setIndex=0;let s=new HUe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}Lg.prototype.unload=function(){u(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var k1=Lg;function Ng(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}u(Object.create)&&(Ng.prototype=Object.create(cr.prototype),Ng.prototype.constructor=Ng);Object.defineProperties(Ng.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Ng.prototype.load=function(){return Promise.resolve(this)};Ng.prototype.process=function(e){return u(this._components)||(this._components=iVe(this._geoJson,e),this._geoJson=void 0),!0};function jUe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function qUe(){this.features=[]}function C6(e){let t=e[0],n=e[1],i=y(e[2],0);return new m(t,n,i)}function T6(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=C6(e[r]);return[n]}function YUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=T6(e[i])[0];return n}function are(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=T6(e[i])[0];return n}function XUe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,are(e[i]));return n}function KUe(e){return[C6(e)]}function JUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=C6(e[i]);return n}var ZUe={LineString:T6,MultiLineString:YUe,MultiPolygon:XUe,Polygon:are,MultiPoint:JUe,Point:KUe},QUe={LineString:Be.LINES,MultiLineString:Be.LINES,MultiPolygon:Be.LINES,Polygon:Be.LINES,MultiPoint:Be.POINTS,Point:Be.POINTS};function cre(e,t){if(!u(e.geometry))return;let n=e.geometry.type,i=ZUe[n],r=QUe[n],o=e.geometry.coordinates;if(!u(i)||!u(o))return;let s=new jUe;r===Be.LINES?s.lines=i(o):r===Be.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function $Ue(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)cre(n[r],t)}var eVe={FeatureCollection:$Ue,Feature:cre},uV=new m;function tVe(e,t,n){let i=0,r=0,o=e.length;for(let B=0;B<o;B++){let L=e[B];if(u(L.lines)){let _=L.lines.length;for(let b=0;b<_;b++){let v=L.lines[b];i+=v.length,r+=(v.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Fe.createTypedArray(i,r),l=Fe.fromTypedArray(c),f=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let B=0;B<o;B++){let L=e[B];if(!u(L.lines))continue;let _=L.lines.length;for(let b=0;b<_;b++){let v=L.lines[b],I=v.length;for(let R=0;R<I;R++){let F=v[R],k=m.fromDegrees(F.x,F.y,F.z,re.WGS84,uV),V=N.multiplyByPoint(t,k,uV);m.minimumByComponent(f,V,f),m.maximumByComponent(d,V,d),m.pack(V,s,p*3),a[p]=B,R<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let h=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});h.vertexArrayDestroyable=!1;let A=mt.createVertexBuffer({typedArray:a,context:n.context,usage:Ne.STATIC_DRAW});A.vertexArrayDestroyable=!1;let x=mt.createIndexBuffer({typedArray:c,context:n.context,usage:Ne.STATIC_DRAW,indexDatatype:l});x.vertexArrayDestroyable=!1;let C=new Nt.Attribute;C.semantic=Et.POSITION,C.componentDatatype=X.FLOAT,C.type=an.VEC3,C.count=i,C.min=f,C.max=d,C.buffer=h;let T=new Nt.Attribute;T.semantic=Et.FEATURE_ID,T.setIndex=0,T.componentDatatype=X.FLOAT,T.type=an.SCALAR,T.count=i,T.buffer=A;let E=[C,T],S=new Nt.Material;S.unlit=!0;let w=new Nt.Indices;w.indexDatatype=l,w.count=c.length,w.buffer=x;let D=new Nt.FeatureIdAttribute;D.featureCount=o,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let M=[D],O=new Nt.Primitive;return O.attributes=E,O.indices=w,O.featureIds=M,O.primitiveType=Be.LINES,O.material=S,O}function nVe(e,t,n){let i=0,r=e.length;for(let E=0;E<r;E++){let S=e[E];u(S.points)&&(i+=S.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=0;for(let E=0;E<r;E++){let S=e[E];if(!u(S.points))continue;let w=S.points.length;for(let D=0;D<w;D++){let M=S.points[D],O=m.fromDegrees(M.x,M.y,M.z,re.WGS84,uV),B=N.multiplyByPoint(t,O,uV);m.minimumByComponent(a,B,a),m.maximumByComponent(c,B,c),m.pack(B,o,l*3),s[l]=E,l++}}let f=mt.createVertexBuffer({typedArray:o,context:n.context,usage:Ne.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Nt.Attribute;p.semantic=Et.POSITION,p.componentDatatype=X.FLOAT,p.type=an.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Nt.Attribute;g.semantic=Et.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=an.SCALAR,g.count=i,g.buffer=d;let h=[p,g],A=new Nt.Material;A.unlit=!0;let x=new Nt.FeatureIdAttribute;x.featureCount=r,x.propertyTableId=0,x.setIndex=0,x.positionalLabel="featureId_0";let C=[x],T=new Nt.Primitive;return T.attributes=h,T.featureIds=C,T.primitiveType=Be.POINTS,T.material=A,T}function iVe(e,t){let n=new qUe,i=eVe[e.type];u(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new de("GeoJSON must have at least one feature");let s={};for(let B=0;B<o;B++){let L=r[B],_=y(L.properties,y.EMPTY_OBJECT);for(let b in _)_.hasOwnProperty(b)&&(u(s[b])||(s[b]=new Array(o)))}for(let B=0;B<o;B++){let L=r[B];for(let _ in s)if(s.hasOwnProperty(_)){let b=y(L.properties[_],"");s[_][B]=b}}let a=new Bp({count:o,properties:s}),l=[new kc({id:0,count:o,jsonMetadataTable:a})],f=wd.fromJson({}),d=new Ea({schema:f,propertyTables:l}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),h=!1,A=!1;for(let B=0;B<o;B++){let L=r[B];if(u(L.lines)){h=!0;let _=L.lines.length;for(let b=0;b<_;b++){let v=L.lines[b],I=v.length;for(let R=0;R<I;R++)m.minimumByComponent(p,v[R],p),m.maximumByComponent(g,v[R],g)}}if(u(L.points)){A=!0;let _=L.points.length;for(let b=0;b<_;b++){let v=L.points[b];m.minimumByComponent(p,v,p),m.maximumByComponent(g,v,g)}}}let x=m.midpoint(p,g,new m),C=m.fromDegrees(x.x,x.y,x.z,re.WGS84,new m),T=Mt.eastNorthUpToFixedFrame(C,re.WGS84,new N),E=N.inverseTransformation(T,new N),S=[];h&&S.push(tVe(r,E,t)),A&&S.push(nVe(r,E,t));let w=new Nt.Node;w.index=0,w.primitives=S;let D=[w],M=new Nt.Scene;M.nodes=D;let O=new Nt.Components;return O.scene=M,O.nodes=D,O.transform=T,O.structuralMetadata=d,O}Ng.prototype.unload=function(){this._components=void 0};var z1=Ng;var fV={};fV._deprecationWarning=$;var Fg=Uint32Array.BYTES_PER_ELEMENT;fV.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Fg;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=Fg;let s=r.getUint32(t,!0);t+=Fg;let a=r.getUint32(t,!0);if(a===0)throw new de("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Fg;let c=r.getUint32(t,!0);t+=Fg;let l=r.getUint32(t,!0);t+=Fg;let f=r.getUint32(t,!0);t+=Fg;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new de(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Fg;let p=Br(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let h,A;l>0&&(h=Br(i,t,l),t+=l,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(fV._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var H1=fV;var kp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},dV=Nt.Attribute,rVe=Nt.FeatureIdAttribute,ure=Nt.Instances;function zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),l=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=u(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=l,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=kp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}u(Object.create)&&(zp.prototype=Object.create(cr.prototype),zp.prototype.constructor=zp);Object.defineProperties(zp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});zp.prototype.load=function(){if(u(this._promise))return this._promise;let e=H1.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,s=new Od(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!u(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);u(c)&&(this._transform=N.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:r};let l={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(o===0){let d=_l(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});l.gltfResource=p,l.baseResource=p}else l.gltfResource=this._i3dmResource,l.typedArray=e.gltf;let f=new Km(l);return this._gltfLoader=f,this._state=kp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=kp.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw oVe(this,d)}),this._promise};function oVe(e,t){e.unload(),e._state=kp.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}zp.prototype.process=function(e){if(this._state===kp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===kp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),cVe(this,i,e),sVe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=kp.READY,!0};function sVe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(u(n.json))r=Vp({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new kc({name:vd.BATCH_TABLE_CLASS_NAME,count:i});r=new Ea({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var mV=new m,E6=new Array(4),aVe=new N;function cVe(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,l=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=uVe(r,o),d;c&&(d=new Float32Array(4*o));let p;l&&(p=new Float32Array(3*o));let g=new Float32Array(o),h=m.unpackArray(f),A=new m,x=new m,C=new m,T=new m,E=new Q,S=new Le,w=new Array(4),D=new m,M=new Array(3),O=new N;if(!u(s)){let V=ae.fromPoints(h);for(i=0;i<h.length;i++)m.subtract(h[i],V.center,mV),f[3*i+0]=mV.x,f[3*i+1]=mV.y,f[3*i+2]=mV.z;let G=N.fromTranslation(V.center,aVe);t.transform=N.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<o;i++){A=m.clone(h[i]),u(s)&&m.add(A,m.unpack(s),A),c&&(fVe(r,a,i,S,A,C,x,T,E,O),Le.pack(S,w,0),d[4*i+0]=w[0],d[4*i+1]=w[1],d[4*i+2]=w[2],d[4*i+3]=w[3]),l&&(dVe(r,i,D),m.pack(D,M,0),p[3*i+0]=M[0],p[3*i+1]=M[1],p[3*i+2]=M[2]);let V=r.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);u(V)||(V=i),g[i]=V}let B=new ure;B.transformInWorldSpace=!0;let L=e._buffers,_=new dV;if(_.name="Instance Translation",_.semantic=qo.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=an.VEC3,_.count=o,_.typedArray=f,!c){let V=mt.createVertexBuffer({context:n.context,typedArray:f,usage:Ne.STATIC_DRAW});V.vertexArrayDestroyable=!1,L.push(V),_.buffer=V}if(B.attributes.push(_),c){let V=new dV;V.name="Instance Rotation",V.semantic=qo.ROTATION,V.componentDatatype=X.FLOAT,V.type=an.VEC4,V.count=o,V.typedArray=d,B.attributes.push(V)}if(l){let V=new dV;if(V.name="Instance Scale",V.semantic=qo.SCALE,V.componentDatatype=X.FLOAT,V.type=an.VEC3,V.count=o,c)V.typedArray=p;else{let G=mt.createVertexBuffer({context:n.context,typedArray:p,usage:Ne.STATIC_DRAW});G.vertexArrayDestroyable=!1,L.push(G),V.buffer=G}B.attributes.push(V)}let b=new dV;b.name="Instance Feature ID",b.setIndex=0,b.semantic=qo.FEATURE_ID,b.componentDatatype=X.FLOAT,b.type=an.SCALAR,b.count=o;let v=mt.createVertexBuffer({context:n.context,typedArray:g,usage:Ne.STATIC_DRAW});v.vertexArrayDestroyable=!1,L.push(v),b.buffer=v,B.attributes.push(b);let I=new rVe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",B.featureIds.push(I);let R=t.nodes,F=R.length,k=!1;for(i=0;i<F;i++){let V=R[i];V.primitives.length>0&&(V.instances=k?lVe(B):B,k=!0)}}function lVe(e){let t=new ure;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=We(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function uVe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!u(i))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!u(r))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new de("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var lre=new Array(4);function fVe(e,t,n,i,r,o,s,a,c,l){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,E6),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,lre),p=!1;if(u(f)){if(!u(d))throw new de("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(f,0,o),m.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,E6),h=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,lre);if(u(g)){if(!u(h))throw new de("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Yn.octDecodeInRange(g[0],g[1],65535,o),Yn.octDecodeInRange(h[0],h[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(r,re.WGS84,l),N.getMatrix3(l,c)):Q.clone(Q.IDENTITY,c)}p&&(m.cross(s,o,a),m.normalize(a,a),Q.setColumn(c,0,s,c),Q.setColumn(c,1,o,c),Q.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function dVe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);u(i)&&m.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,E6);u(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function mVe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}zp.prototype.isUnloaded=function(){return this._state===kp.UNLOADED};zp.prototype.unload=function(){u(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),mVe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=kp.UNLOADED};var G1=zp;var hVe={STOPPED:0,ANIMATING:1},Md=Object.freeze(hVe);function ZT(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}ZT.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Le)return Le};ZT.prototype.evaluate=fe.throwInstantiationError;ZT.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};ZT.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};ZT.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var lr=ZT;function QT(e){this._value=e,this._valueType=lr.getPointType(e)}Object.defineProperties(QT.prototype,{value:{get:function(){return this._value}}});QT.prototype.findTimeInterval=function(e){};QT.prototype.wrapTime=function(e){return 0};QT.prototype.clampTime=function(e){return 0};QT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var W1=QT;function $T(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties($T.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});$T.prototype.findTimeInterval=lr.prototype.findTimeInterval;$T.prototype.wrapTime=lr.prototype.wrapTime;$T.prototype.clampTime=lr.prototype.clampTime;$T.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(u(t)||(t=new m),m.lerp(n[r],n[r+1],o,t))};var Ug=$T;var fre={};fre.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new m,s[a]=new m;r[0]=n[0]/t[0],o[0]=m.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(o[a],m.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var eE=fre;var dre=[],mre=[],hre=[],pre=[];function pVe(e,t,n){let i=dre,r=hre,o=mre,s=pre;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(u(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],u(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],u(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],u(c)||(c=s[a+1]=new m),m.clone(n,c),eE.solve(i,o,r,s)}function _Ve(e){let t=dre,n=hre,i=mre,r=pre;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(u(s)||(s=r[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],u(s)||(s=r[o]=new m),m.subtract(e[o+1],e[o-1],s),m.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],u(s)||(s=r[o]=new m),m.subtract(e[o],e[o-1],s),m.multiplyByScalar(s,3,s),eE.solve(t,i,n,r)}function bl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(bl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});bl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new bl({times:t,points:n,inTangents:o,outTangents:r})};bl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new Ug({points:n,times:t});let i=_Ve(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new bl({times:t,points:n,inTangents:o,outTangents:r})};bl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=lr.getPointType(n[0]);if(n.length<3)return new Ug({points:n,times:t});let s=pVe(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new bl({times:t,points:n,inTangents:c,outTangents:a})};bl.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);bl.prototype.findTimeInterval=lr.prototype.findTimeInterval;var gVe=new oe,tE=new m;bl.prototype.wrapTime=lr.prototype.wrapTime;bl.prototype.clampTime=lr.prototype.clampTime;bl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,l=gVe;l.z=c,l.y=c*c,l.x=l.y*c,l.w=1;let f=N.multiplyByVector(bl.hermiteCoefficientMatrix,l,l);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(u(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,tE),d.add(t,tE,t),d.multiplyByScalar(o[s],f.z,tE),d.add(t,tE,t),d.multiplyByScalar(r[s],f.w,tE),d.add(t,tE,t))};var Vg=bl;function nE(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(nE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});nE.prototype.findTimeInterval=lr.prototype.findTimeInterval;nE.prototype.wrapTime=lr.prototype.wrapTime;nE.prototype.clampTime=lr.prototype.clampTime;nE.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(u(t)||(t=new r),r.clone(n[i],t))};var j1=nE;function yVe(e){let t=e.points,n=e.times;return function(i,r){u(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function iE(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=yVe(this),this._lastTimeIndex=0}Object.defineProperties(iE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});iE.prototype.findTimeInterval=lr.prototype.findTimeInterval;iE.prototype.wrapTime=lr.prototype.wrapTime;iE.prototype.clampTime=lr.prototype.clampTime;iE.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var q1=iE;var VA=Nt.AnimatedPropertyType;function S6(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,CVe(this)}Object.defineProperties(S6.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function AVe(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new Vg({times:e,points:n,inTangents:i,outTangents:r})}function _re(e,t,n,i){if(e.length===1&&t.length===1)return new W1(t[0]);switch(n){case Id.STEP:return new j1({times:e,points:t});case Id.CUBICSPLINE:return AVe(e,t);case Id.LINEAR:return i===VA.ROTATION?new q1({times:e,points:t}):new Ug({times:e,points:t})}}function xVe(e,t,n,i,r){let o=[];if(i===VA.WEIGHTS){let a=t.length/r,c,l;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===Id.CUBICSPLINE)for(l=0;l<a;l+=3)f[l]=t[d],f[l+1]=t[d+r],f[l+2]=t[d+2*r],d+=r*3;else for(l=0;l<a;l++)f[l]=t[d],d+=r;o.push(_re(e,f,n,i))}}else o.push(_re(e,t,n,i));return o}var b6;function CVe(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,l=u(c.morphWeights)?c.morphWeights.length:1,f=xVe(i,r,o,a,l);switch(e._splines=f,e._path=a,a){case VA.TRANSLATION:case VA.SCALE:b6=new m;break;case VA.ROTATION:b6=new Le;break;case VA.WEIGHTS:break}}S6.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===VA.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],l=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(l)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);r[n]=o.evaluate(s,b6)}}};var Y1=S6;function v6(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ee.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,El.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Md.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,TVe(this)}Object.defineProperties(v6.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function TVe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let l=o[c],f=l.target;if(!u(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new Y1({channel:l,runtimeAnimation:e,runtimeNode:p}),h=l.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}v6.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var X1=v6;function Hp(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Hp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function w6(e,t,n){let i=e._model,r=new X1(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}Hp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(u(i))return w6(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return w6(this,n[i],e)};Hp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=w6(this,n[o],e);i.push(s)}return i};Hp.prototype.remove=function(e){if(!u(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Hp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Hp.prototype.contains=function(e){return u(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Hp.prototype.get=function(e){return this._runtimeAnimations[e]};var hV=[];function EVe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Hp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];u(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,r),a.delay,new ee)),u(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,l=a._duration,f=a.stopTime,d=ee.lessThanOrEquals(c,r),p=u(f)&&ee.greaterThan(r,f),g=0;if(l!==0){let x=ee.secondsDifference(p?f:r,c);g=u(a._animationTime)?a._animationTime(l,x):x/l}let h=a.loop===El.REPEAT||a.loop===El.MIRRORED_REPEAT,A=(d||h&&!u(a.startTime))&&(g<=1||h)&&!p;if(g===a._prevAnimationDelta){let x=a._state===Md.STOPPED;if(A!==x)continue}if(a._prevAnimationDelta=g,A||a._state===Md.ANIMATING){if(A&&a._state===Md.STOPPED&&(a._state=Md.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===El.REPEAT)g=g-Math.floor(g);else if(a.loop===El.MIRRORED_REPEAT){let C=Math.floor(g),T=g-C;g=C%2===1?1-T:T}a.reverse&&(g=1-g);let x=g*l*a.multiplier;x=P.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,A||(a._state=Md.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&hV.push(a))}}n=hV.length;for(let s=0;s<n;++s){let a=hV[s];t.splice(t.indexOf(a),1),e.afterRender.push(EVe(this,o,a))}return hV.length=0,i};var K1=Hp;function kA(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(kA.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return u(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});kA.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};kA.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};kA.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};kA.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};kA.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var J1=kA;var Z1={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Z1.getStyleCommandsNeeded=function(e,t){return t===0?Z1.ALL_OPAQUE:t===e?Z1.ALL_TRANSLUCENT:Z1.OPAQUE_AND_TRANSLUCENT};var Rd=Object.freeze(Z1);var kg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};kg.is3DTiles=function(e){switch(e){case kg.TILE_GLTF:case kg.TILE_B3DM:case kg.TILE_I3DM:case kg.TILE_PNTS:case kg.TILE_GEOJSON:return!0;case kg.GLTF:return!1}};var Vr=Object.freeze(kg);function vo(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Rd.ALL_OPAQUE,bVe(this)}Object.defineProperties(vo.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return u(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function bVe(e){let t=e._model,n=Vr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new Is(s,r)}else for(r=0;r<i;r++)o[r]=new J1({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Vc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}vo.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Rd.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};vo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};vo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};vo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};vo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};vo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};vo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};vo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};vo.prototype.getFeature=function(e){return this._features[e]};vo.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};vo.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};vo.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};vo.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};vo.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};vo.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};vo.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};vo.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};vo.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var SVe=new z;vo.prototype.applyStyle=function(e){if(!u(e)){this.setAllColor(Vc.DEFAULT_COLOR_VALUE),this.setAllShow(Vc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=u(e.color)?y(e.color.evaluateColor(n,SVe),Vc.DEFAULT_COLOR_VALUE):Vc.DEFAULT_COLOR_VALUE,r=u(e.show)?y(e.show.evaluate(n),Vc.DEFAULT_SHOW_VALUE):Vc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};vo.prototype.isDestroyed=function(){return!1};vo.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Q1=vo;var $1=`#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT) - #ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable - #endif + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); #endif -czm_modelMaterial defaultModelMaterial() -{ - czm_modelMaterial material; - material.diffuse = vec3(0.0); - material.specular = vec3(1.0); - material.roughness = 1.0; - material.occlusion = 1.0; - material.normalEC = vec3(0.0, 0.0, 1.0); - material.emissive = vec3(0.0); - material.alpha = 1.0; - return material; -} + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) -vec4 handleAlpha(vec3 color, float alpha) -{ - #ifdef ALPHA_MODE_MASK - if (alpha < u_alphaCutoff) { - discard; - } - #endif + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - return vec4(color, alpha); +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } +`;var dP=`in vec3 position3DHigh; +in vec3 position3DLow; -SelectedFeature selectedFeature; +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif + +in float batchId; + +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif void main() { - #ifdef HAS_MODEL_SPLITTER - modelSplitterStage(); - #endif +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - czm_modelMaterial material = defaultModelMaterial(); + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); - ProcessedAttributes attributes; - geometryStage(attributes); + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - FeatureIds featureIds; - featureIdStage(featureIds, attributes); + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - #ifdef HAS_SELECTED_FEATURE_ID - selectedFeatureIdStage(selectedFeature, featureIds); - #endif + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - #ifndef CUSTOM_SHADER_REPLACE_MATERIAL - materialStage(material, attributes, selectedFeature); - #endif +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; - #ifdef HAS_CUSTOM_FRAGMENT_SHADER - customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif + vec3 forwardDirectionEC = normalize(offset); - lightingStage(material, attributes); + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - #ifdef HAS_SELECTED_FEATURE_ID - cpuStylingStage(material, selectedFeature); - #endif + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - #ifdef HAS_MODEL_COLOR - modelColorStage(material); - #endif + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(material); - #endif + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; - vec4 color = handleAlpha(material.diffuse, material.alpha); +#endif // COLUMBUS_VIEW_2D - #ifdef HAS_CLIPPING_PLANES - modelClippingPlanesStage(color); - #endif + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) - silhouetteStage(color); - #endif +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR - out_FragColor = color; -} -`;var eO=`precision highp float; + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { - czm_modelVertexOutput vsOutput; - vsOutput.positionMC = positionMC; - vsOutput.pointSize = 1.0; - return vsOutput; -} + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. -void main() -{ - // Initialize the attributes struct with all - // attributes except quantized ones. - ProcessedAttributes attributes; - initializeAttributes(attributes); + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; - // Dequantize the quantized ones and add them to the - // attributes struct. - #ifdef USE_DEQUANTIZATION - dequantizationStage(attributes); - #endif + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - #ifdef HAS_MORPH_TARGETS - morphTargetsStage(attributes); - #endif + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; +#endif - #ifdef HAS_SKINNING - skinningStage(attributes); - #endif + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(); - #endif + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; - // Compute the bitangent according to the formula in the glTF spec. - // Normal and tangents can be affected by morphing and skinning, so - // the bitangent should not be computed until their values are finalized. - #ifdef HAS_BITANGENTS - attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); - #endif + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - SelectedFeature feature; - selectedFeatureIdStage(feature, featureIds); - // Handle any show properties that come from the style. - cpuStylingStage(attributes.positionMC, feature); - #endif + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); +#else + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - // The scene mode 2D pipeline stage and instancing stage add a different - // model view matrix to accurately project the model to 2D. However, the - // output positions and normals should be transformed by the 3D matrices - // to keep the data the same for the fragment shader. - mat4 modelView = czm_modelView3D; - mat3 normal = czm_normal3D; - #else - // These are used for individual model projection because they will - // automatically change based on the scene mode. - mat4 modelView = czm_modelView; - mat3 normal = czm_normal; - #endif + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); - // Update the position for this instance in place - #ifdef HAS_INSTANCING +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var mP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; - // The legacy instance stage is used when rendering i3dm models that - // encode instances transforms in world space, as opposed to glTF models - // that use EXT_mesh_gpu_instancing, where instance transforms are encoded - // in object space. - #ifdef USE_LEGACY_INSTANCING - mat4 instanceModelView; - mat3 instanceModelViewInverseTranspose; - - legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); +out vec4 v_color; - modelView = instanceModelView; - normal = instanceModelViewInverseTranspose; - #else - instancingStage(attributes); - #endif +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - #ifdef USE_PICKING - v_pickColor = a_pickColor; - #endif + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); - #endif + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); + v_color = color; +} +`;var Ql=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; - #ifdef HAS_CUSTOM_VERTEX_SHADER - czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); - customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); - // Compute the final position in each coordinate system needed. - // This returns the value that will be assigned to gl_Position. - vec4 positionClip = geometryStage(attributes, modelView, normal); + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; - #ifdef HAS_SILHOUETTE - silhouetteStage(attributes, positionClip); - #endif + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - float show = pointCloudShowStylingStage(attributes, metadata); - #else - float show = 1.0; - #endif + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; - #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING - show *= pointCloudBackFaceCullingStage(); - #endif + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); - #endif + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; - #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); - gl_PointSize *= show; - #endif + clipped = true; + } + } - gl_Position = show * positionClip; + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } -`;function I6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==zn.CESIUM_3D_TILE,this._classifies3DTiles=r!==zn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],IVe(this)}function vVe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qa.LESS_OR_EQUAL},depthMask:!1}}var wVe={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},DVe={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Are=[];function IVe(e){let t=e._command,n=Are;if(e._useDebugWireframe){t.pass=ve.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=tO(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=ve.TERRAIN_CLASSIFICATION,s=D6(t,o),a=gre(t,o);n.length=0,n.push(s,a),e._commandListTerrain=tO(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=yre(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=ve.CESIUM_3D_TILE_CLASSIFICATION,s=D6(t,o),a=gre(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=tO(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=yre(e,n,e._commandList3DTilesPicking))}}function tO(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let l=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=et.shallowClone(p);g.count=l,g.offset=f,n.push(g)}}return n}function D6(e,t){let n=et.shallowClone(e);n.cull=!1,n.pass=t;let i=t===ve.TERRAIN_CLASSIFICATION?Hn.ALWAYS:Hn.EQUAL,r=vVe(i);return n.renderState=Ve.fromCache(r),n}function gre(e,t){let n=et.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(wVe),n}var PVe=[];function yre(e,t,n){let i=Ve.fromCache(DVe),r=t[0],o=t[1],s=et.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=et.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=PVe;return c.length=0,c.push(s,a),tO(e,c,n)}Object.defineProperties(I6.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});I6.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=D6(this._command,r),s=Are;s.length=0,s.push(o),this._commandListIgnoreShow=tO(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var nO=I6;function pV(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r;let o=t.pass===ve.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,l=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c;this._command=t,this._modelMatrix=N.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new N,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=l,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,OVe(this)}function Gp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}Gp.clone=function(e){return new Gp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function OVe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;e._originalCommand=new Gp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Gp({command:UVe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Gp({command:WVe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Gp({command:jVe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Gp({command:VVe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Gp({command:kVe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand))}Object.defineProperties(pV.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,RVe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,BVe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,LVe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,NVe(this))}}});function MVe(e,t){let n=e._modelMatrix;e._modelMatrix2D=N.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function RVe(e){let t=e.shadows,n=xn.castShadows(t),i=xn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function BVe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=We(o.renderState,!0);s.cull.enabled=t,o.renderState=Ve.fromCache(s)}}}function LVe(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=We(o.renderState,!0);s.cull.face=t,o.renderState=Ve.fromCache(s)}}}function NVe(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}pV.prototype.pushCommands=function(e,t){let n=xre(this,e);n&&!this._has2DCommands&&(FVe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(MVe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&u(i)&&(i!==Rd.ALL_OPAQUE&&oE(t,this._translucentCommand,n),i===Rd.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||oE(r._backfaceCommands,this._skipLodBackfaceCommand,n),zVe(this,o,n),oE(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){oE(t,this._silhouetteModelCommand,n);return}return oE(t,this._originalCommand,n),t}};pV.prototype.pushSilhouetteCommands=function(e,t){let n=xre(this,e);return oE(t,this._silhouetteColorCommand,n),t};function oE(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function xre(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return r<s&&o>s||r<-s&&o>-s}function rE(e,t){if(!u(t))return;let n=Gp.clone(t),i=et.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function FVe(e){rE(e,e._originalCommand),rE(e,e._translucentCommand),rE(e,e._skipLodBackfaceCommand),rE(e,e._skipLodStencilCommand),rE(e,e._silhouetteModelCommand),rE(e,e._silhouetteColorCommand)}function UVe(e){let t=et.shallowClone(e);t.pass=ve.TRANSLUCENT;let n=We(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=dn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function VVe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),r=We(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(r),i}function kVe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),r=We(e.renderState,!0);r.cull.enabled=!1,(e.pass===ve.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=ve.TRANSLUCENT,r.depthMask=!1,r.blending=dn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=We(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function zVe(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=HVe(r);if(o!==s){let a=GVe(o),c=We(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function HVe(e){return(e.renderState.stencilTest.reference&Ft.SKIP_LOD_MASK)>>>Ft.SKIP_LOD_BIT_SHIFT}function GVe(e){return Ft.CESIUM_3D_TILE_MASK|e<<Ft.SKIP_LOD_BIT_SHIFT}function WVe(e){let t=et.shallowClone(e),n=We(e.renderState,!0);n.cull.enabled=!0,n.cull.face=yi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=We(t.uniformMap),r=new H(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function jVe(e){let t=et.shallowClone(e),n=We(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ft.SKIP_LOD_MASK,i.reference=Ft.CESIUM_3D_TILE_MASK,i.frontFunction=Hn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Hn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=Ft.CESIUM_3D_TILE_MASK|Ft.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var iO=pV;function qVe(e,t){let n=e.shaderBuilder;n.addVertexLines(eO),n.addFragmentLines($1);let i=YVe(e),r=new oi({context:t.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=n.buildShaderProgram(t.context);o._pipelineResources.push(s);let a=e.alphaOptions.pass,c=o.sceneGraph,l=t.mode===ne.SCENE3D,f,d;if(!l&&!t.scene3DOnly&&o._projectTo2D)f=N.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new N),d=e.runtimePrimitive.boundingSphere2D;else{let T=l?c._computedModelMatrix:c._computedModelMatrix2D;f=N.multiplyTransformation(T,e.runtimeNode.computedTransform,new N),d=ae.transform(e.boundingSphere,f,e.boundingSphere)}let p=We(Ve.fromCache(e.renderStateOptions),!0);p.cull.face=Zt.getCullFace(f,e.primitiveType),p=Ve.fromCache(p);let g=u(o.classificationType),h=g?!1:xn.castShadows(o.shadows),A=g?!1:xn.receiveShadows(o.shadows),x=g?void 0:e.pickId,C=new et({boundingVolume:d,modelMatrix:f,uniformMap:e.uniformMap,renderState:p,vertexArray:r,shaderProgram:s,cull:o.cull,pass:a,count:e.count,owner:o,pickId:x,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:h,receiveShadows:A});return g?new nO({primitiveRenderResources:e,command:C}):new iO({primitiveRenderResources:e,command:C})}function YVe(e){let t=e.wireframeIndexBuffer;if(u(t))return t;let n=e.indices;if(u(n))return n.buffer}var rO=qVe;var Cre={name:"TilesetPipelineStage"};Cre.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,be.FRAGMENT);let o={u_polygonOffset:function(){return H.ZERO}};e.uniformMap=_t(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ft.setCesium3DTileBit(),i.stencilMask=Ft.CESIUM_3D_TILE_MASK};var oO=Cre;var sO=`vec3 proceduralIBL( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) { - vec3 v = -positionEC; - vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); - vec3 vWC = -normalize(positionWC); - vec3 l = normalize(lightDirectionEC); - vec3 n = normalEC; - vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); - - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = abs(dot(n, v)) + 0.001; - // Figure out if the reflection vector hits the ellipsoid - float vertexRadius = length(positionWC); - float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); - float reflectionDotNadir = dot(r, normalize(positionWC)); - // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. - r.x = -r.x; - r = -normalize(czm_temeToPseudoFixed * r); - r.x = -r.x; +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - vec3 diffuseColor = pbrParameters.diffuseColor; - float roughness = pbrParameters.roughness; - vec3 specularColor = pbrParameters.f0; +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - float inverseRoughness = 1.04 - roughness; - inverseRoughness *= inverseRoughness; - vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness; + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - float atmosphereHeight = 0.05; - float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); - float blendRegionOffset = roughness * -1.0; - float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); - float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); - float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); - float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); - vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); - vec3 nadirColor = belowHorizonColor * 0.5; - vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); - vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); - vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); - vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); - float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; - float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); - vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); - float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); - vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); - specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); - specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif - // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf - #ifdef USE_SUN_LUMINANCE - // Angle between sun and zenith - float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); - float S = acos(LdotZenith); - // Angle between zenith and current pixel - float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); - // Angle between sun and current pixel - float gamma = acos(NdotL); - float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); - float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); - float luminance = model_luminanceAtZenith * (numerator / denominator); - #endif + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); - float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); - vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); - iblColor *= lightColor; - - #ifdef USE_SUN_LUMINANCE - iblColor *= luminance; - #endif - - return iblColor; -} + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - czm_pbrParameters pbrParameters -) { - vec3 diffuseColor = pbrParameters.diffuseColor; - float roughness = pbrParameters.roughness; - vec3 specularColor = pbrParameters.f0; + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - vec3 v = -positionEC; - vec3 n = normalEC; - vec3 l = normalize(lightDirectionEC); - vec3 h = normalize(v + l); + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } - float NdotV = abs(dot(n, v)) + 0.001; - float VdotH = clamp(dot(v, h), 0.0, 1.0); + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - const mat3 yUpToZUp = mat3( - -1.0, 0.0, 0.0, - 0.0, 0.0, -1.0, - 0.0, 1.0, 0.0 - ); - vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } - #ifdef DIFFUSE_IBL - #ifdef CUSTOM_SPHERICAL_HARMONICS - vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); - #else - vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); - #endif - #else - vec3 diffuseIrradiance = vec3(0.0); - #endif + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } - #ifdef SPECULAR_IBL - vec3 r0 = specularColor.rgb; - float reflectance = max(max(r0.r, r0.g), r0.b); - vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(r0, r90, VdotH); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - #ifdef CUSTOM_SPECULAR_IBL - vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); - #else - vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); - #endif - specularIBL *= F * brdfLut.x + brdfLut.y; - #else - vec3 specularIBL = vec3(0.0); - #endif + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - return diffuseColor * diffuseIrradiance + specularColor * specularIBL; -} -#endif + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; -vec3 imageBasedLightingStage( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) { - #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) - // Environment maps were provided, use them for IBL - return textureIBL( - positionEC, - normalEC, - lightDirectionEC, - pbrParameters - ); - #else - // Use the procedural IBL if there are no environment maps - return proceduralIBL( - positionEC, - normalEC, - lightDirectionEC, - lightColorHdr, - pbrParameters - ); - #endif -}`;var Tre={name:"ImageBasedLightingPipelineStage"};Tre.process=function(e,t,n){let i=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,be.FRAGMENT),r.addUniform("vec2","model_iblFactor",be.FRAGMENT),xd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",be.FRAGMENT),u(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,be.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",be.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),u(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,be.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",be.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",be.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",be.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT)),u(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,be.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",be.FRAGMENT)),r.addFragmentLines(sO);let o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=_t(o,e.uniformMap)};var aO=Tre;var XVe=P.EPSILON16;function O6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(O6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,XVe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var KVe=new m,P6=new Q;O6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=KVe,r;switch(t){case ec.XROTATE:r=Q.fromRotationX(P.toRadians(n),P6),e=N.multiplyByMatrix3(e,r,e);break;case ec.YROTATE:r=Q.fromRotationY(P.toRadians(n),P6),e=N.multiplyByMatrix3(e,r,e);break;case ec.ZROTATE:r=Q.fromRotationZ(P.toRadians(n),P6),e=N.multiplyByMatrix3(e,r,e);break;case ec.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ec.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ec.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case ec.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case ec.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case ec.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case ec.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var cO=O6;function _V(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,JVe(this)}Object.defineProperties(_V.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function JVe(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new cO({stage:a,runtimeArticulation:e});r.push(c);let l=a.name;o[l]=c}}_V.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];u(n)&&(n.currentValue=t)};var ZVe=new N,QVe=new N;_V.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,ZVe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=N.multiplyTransformation(s.originalTransform,e,QVe);s.transform=a}};var lO=_V;var uO=`void modelColorStage(inout czm_modelMaterial material) -{ - material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); - material.alpha *= model_color.a; -}`;var sE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};sE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,be.FRAGMENT),i.addFragmentLines(uO);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=ve.TRANSLUCENT),i.addUniform("vec4",sE.COLOR_UNIFORM_NAME,be.FRAGMENT),r[sE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",sE.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),r[sE.COLOR_BLEND_UNIFORM_NAME]=function(){return $a.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=_t(r,e.uniformMap)};var zg=sE;var fO=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -#else -// Handle uint8 clipping texture instead -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each - int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); - return czm_transformPlane(plane, transform); -} -#endif + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float pixelWidth = czm_metersPerPixel(position); - - #ifdef UNION_CLIPPING_REGIONS - float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. - #else - float clipAmount = 0.0; - bool clipped = true; - #endif + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - - #ifdef UNION_CLIPPING_REGIONS - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) { - discard; - } - #else - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - #endif + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); } - #ifndef UNION_CLIPPING_REGIONS - if (clipped) { - discard; - } - #endif - - return clipAmount; + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } -void modelClippingPlanesStage(inout vec4 color) +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) { - float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; - - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); } -`;var Ere={name:"ModelClippingPlanesPipelineStage"},$Ve=new H;Ere.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,be.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,be.FRAGMENT),cs.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,be.FRAGMENT);let s=cs.getTextureResolution(i,r,$Ve);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,be.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",be.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",be.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",be.FRAGMENT),o.addFragmentLines(fO);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=_t(a,e.uniformMap)};var dO=Ere;function bre(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(bre.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){u(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var mO=bre;var hO=`mat4 getInstancingTransform() +`;var T5=`${Ql} +${mP}`,sDe=F0;Wt.isInternetExplorer()||(T5=`#define CLIP_POLYLINE +${T5}`);function Z0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Z0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,T5),this._fragmentShaderSource=y(e.fragmentShaderSource,sDe),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Z0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Z0.VERTEX_FORMAT=Oe.POSITION_ONLY;Z0.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;Z0.prototype.isTranslucent=or.prototype.isTranslucent;Z0.prototype.getRenderState=or.prototype.getRenderState;var Wo=Z0;var hP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; + +out float v_width; +out vec2 v_st; +out float v_polylineAngle; + +void main() { - mat4 instancingTransform; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; - return instancingTransform; + v_width = width; + v_st.s = st.s; + v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); + v_polylineAngle = angle; } +`;var $0=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() +in vec2 v_st; + +void main() { - mat4 instancingTransform2D; + czm_materialInput materialInput; - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif + vec2 st = v_st; + st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = vec3(st, 0.0); - return instancingTransform2D; -} + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE + out_FragColor *= u_highlightColor; #endif -`;var pO=`void instancingStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif + czm_writeLogDepth(); } -`;var _O=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; +`;var A5=`${Ql} +${hP}`,aDe=$0;Wt.isInternetExplorer()||(A5=`#define CLIP_POLYLINE +${A5}`);function Q0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Q0.VERTEX_FORMAT;this.material=l(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,A5),this._fragmentShaderSource=y(e.fragmentShaderSource,aDe),this._renderState=or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Q0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Q0.VERTEX_FORMAT=Oe.POSITION_AND_ST;Q0.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;Q0.prototype.isTranslucent=or.prototype.isTranslucent;Q0.prototype.getRenderState=or.prototype.getRenderState;var Ks=Q0;function dp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ks),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Gn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=rte(!1),this._renderState3DTiles=rte(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(dp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});dp.initializeTerrainHeights=function(){return oi.initialize()};function cDe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(dP);s=wn._appendShowToShader(r,s),s=wn._appendDistanceDisplayConditionToShader(r,s),s=wn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(fP);a=wn._appendShowToShader(r,a),a=wn._appendDistanceDisplayConditionToShader(r,a),a=wn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(lP),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new ze({defines:u,sources:[s]}),h=new ze({defines:p,sources:[d,c]});e._sp=Jt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:o});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new ze({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:o})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let C=new ze({defines:u.concat([`MAX_TERRAIN_HEIGHT ${oi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(uP);let A=new ze({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:o})}e._spMorph=b}function rte(e){return Ue.fromCache({cull:{enabled:!0},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Wn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Wn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function lDe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Wo?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new tt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ee.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let h=tt.shallowClone(g,g.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=h;let x=tt.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let b=tt.shallowClone(h,h.derivedCommands.color2D);b.shaderProgram=e._sp2D,h.derivedCommands.color2D=b;let C=tt.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function ote(e,t,n,i,r,o,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function uDe(e,t,n,i,r,o,s){let a=e._primitive;wn._updateBoundingVolumes(a,t,r);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==Gn.CESIUM_3D_TILE,p=f!==Gn.TERRAIN&&!u,g,h=t.passes;if(h.render||h.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let C=c[b];d&&(g=n[b],ote(e,g,t,r,o,C,s)),p&&(g=n[b].derivedCommands.tileset,ote(e,g,t,r,o,C,s))}}}dp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!oi.initialized){dp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new ja({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,J0.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Ct({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){cDe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,h){lDe(n,u,f,d,g,h)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,h,x){uDe(n,u,f,d,p,g,h)},this._primitive=new wn(i)}if(this.appearance instanceof Wo&&!this._hasPerInstanceColors)throw new fe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};dp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};dp.isSupported=function(e){return e.frameState.context.depthTexture};dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var dd=dp;var fDe=new H(1,1),dDe=!1,mDe=z.WHITE;function vT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(vT.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});vT.prototype.getType=function(e){return"Image"};vT.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,fDe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,mDe,t.color),q.getValueOrDefault(this._transparent,e,dDe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};vT.prototype.equals=function(e){return this===e||e instanceof vT&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var pg=vT;function hDe(e){if(e instanceof z)return new Vt(e);if(typeof e=="string"||e instanceof Ie||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new pg;return t.image=e,t}}function pDe(e,t){return le(e,t,hDe)}var Mr=pDe;function pP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(pP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});pP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new pP(this)};pP.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ex=pP;var _De={FIXED:0,INERTIAL:1},ar=Object.freeze(_De);function wT(){fe.throwInstantiationError()}Object.defineProperties(wT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});wT.prototype.getValue=fe.throwInstantiationError;wT.prototype.getValueInReferenceFrame=fe.throwInstantiationError;wT.prototype.equals=fe.throwInstantiationError;var E5=new $;wT.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new m),n===i)return m.clone(t,r);let o=Mt.computeIcrfToFixedMatrix(e,E5);if(l(o)||(o=Mt.computeTemeToPseudoFixedMatrix(e,E5)),n===ar.INERTIAL)return $.multiplyByVector(o,t,r);if(n===ar.FIXED)return $.multiplyByVector($.transpose(o,E5),t,r)};var mp=wT;function tx(e,t){this._definitionChanged=new _e,this._value=m.clone(e),this._referenceFrame=y(t,ar.FIXED)}Object.defineProperties(tx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ar.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});tx.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};tx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};tx.prototype.getValueInReferenceFrame=function(e,t,n){return mp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};tx.prototype.equals=function(e){return this===e||e instanceof tx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Dc=tx;function _P(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(_P.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});_P.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new _P(this)};_P.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var nx=_P;function gDe(e){return e}function yDe(e,t){return le(e,t,gDe)}var dl=yDe;function gP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(gP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});gP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new gP(this)};gP.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ix=gP;function yP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(yP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});yP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new yP(this)};yP.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var rx=yP;function xP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(xP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});xP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new xP(this)};xP.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ox=xP;function bP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});bP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new bP(this)};bP.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var md=bP;var xDe=new m(1,1,1),bDe=m.ZERO,CDe=Ne.IDENTITY;function ste(e,t,n){this.translation=m.clone(y(e,bDe)),this.rotation=Ne.clone(y(t,CDe)),this.scale=m.clone(y(n,xDe))}ste.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var _g=ste;var S5=new _g;function CP(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(CP.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});CP.prototype.getValue=function(e,t){return l(t)||(t=new _g),t.translation=q.getValueOrClonedDefault(this._translation,e,S5.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,S5.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,S5.scale,t.scale),t};CP.prototype.equals=function(e){return this===e||e instanceof CP&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var sx=CP;function hp(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(hp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});hp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function TDe(e){return new ti(e)}hp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,TDe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};hp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};hp.prototype.getValue=function(e,t){l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=q.getValueOrUndefined(this[o],e,t[o])}return t};hp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function ADe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!q.equals(e[s],t[s]))return!1}return!0}hp.prototype.equals=function(e){return this===e||e instanceof hp&&ADe(this,e)};var ml=hp;function ate(e){return new sx(e)}function EDe(e){return new ml(e,ate)}function SDe(e){return new ml(e)}function TP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(TP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,EDe),articulations:le("articulations",void 0,SDe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});TP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new TP(this)};TP.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new ml(t,ate)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ml(n)}};var pp=TP;function AP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(AP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});AP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new AP(this)};AP.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var ax=AP;function EP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(EP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Mr("material"),distanceDisplayCondition:le("distanceDisplayCondition")});EP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new EP(this)};EP.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var _p=EP;function SP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(SP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});SP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new SP(this)};SP.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var vP=SP;function wP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});wP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new wP(this)};wP.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var cx=wP;function vDe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Rc=vDe;function wDe(e){return Array.isArray(e)&&(e=new Rc(e)),new ti(e)}function IP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(IP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,wDe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});IP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new IP(this)};IP.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var hd=IP;function PP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(PP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Mr("material"),depthFailMaterial:Mr("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});PP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new PP(this)};PP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var qa=PP;function DP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(DP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});DP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new DP(this)};DP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var lx=DP;function RP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(RP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});RP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new RP(this)};RP.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var pd=RP;function OP(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(OP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Mr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});OP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new OP(this)};OP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var gp=OP;var IDe=new me;function PDe(e){return new Dc(e)}function DDe(e){return le(e,void 0,PDe)}function Js(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Gm(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=qn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function v5(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&v5(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Gm.prototype,{availability:dl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:dl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&v5(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&v5(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Js("billboard",Na),box:Js("box",ex),corridor:Js("corridor",nx),cylinder:Js("cylinder",ix),description:le("description"),ellipse:Js("ellipse",rx),ellipsoid:Js("ellipsoid",ox),label:Js("label",md),model:Js("model",pp),tileset:Js("tileset",ax),orientation:le("orientation"),path:Js("path",_p),plane:Js("plane",vP),point:Js("point",cx),polygon:Js("polygon",hd),polyline:Js("polyline",qa),polylineVolume:Js("polylineVolume",lx),properties:Js("properties",ml),position:DDe("position"),rectangle:Js("rectangle",pd),viewFrom:le("viewFrom"),wall:Js("wall",gp)});Gm.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Gm.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,dl(e,!0))};Gm.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Gm.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var cte=new $,lte=new m,ute=new Ne;Gm.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,lte);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,ute);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,cte),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};Gm.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=q.getValueOrDefault(t,e,We.NONE),s=q.getValueOrUndefined(this._position,e,lte);if(o===We.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,IDe);o===We.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=q.getValueOrUndefined(this._orientation,e,ute);return l(c)?r=F.fromRotationTranslation($.fromQuaternion(c,cte),s,r):r=Mt.eastNorthUpToFixedFrame(s,void 0,r),r};Gm.supportsMaterialsforEntitiesOnTerrain=function(e){return Ic.supportsMaterials(e)};Gm.supportsPolylinesOnTerrain=function(e){return dd.isSupported(e)};var Kr=Gm;var RDe=new Vt(z.WHITE),ODe=new ti(!0),MDe=new ti(!0),LDe=new ti(!1),NDe=new ti(z.BLACK),FDe=new ti(bn.DISABLED),BDe=new ti(new It),kDe=new ti(Gn.BOTH);function Oc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Kr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Oc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Oc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Oc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Oc.prototype.createFillGeometryInstance=fe.throwInstantiationError;Oc.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;Oc.prototype.isDestroyed=function(){return!1};Oc.prototype.destroy=function(){ue(this)};Oc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ve.MINIMUM_VALUE)};Oc.prototype._isOnTerrain=function(e,t){return!1};Oc.prototype._getIsClosed=function(e){return!0};Oc.prototype._isDynamic=fe.throwInstantiationError;Oc.prototype._setStaticOptions=fe.throwInstantiationError;Oc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(Ve.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ve.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(r.material,RDe),this._fillProperty=y(o,MDe),this._showProperty=y(u,ODe),this._showOutlineProperty=y(r.outline,LDe),this._outlineColorProperty=c?y(r.outlineColor,NDe):void 0,this._shadowsProperty=y(r.shadows,FDe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,BDe),this._classificationTypeProperty=y(r.classificationType,kDe),this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Vt);if(c&&f&&(Nt(Nt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(Ve.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Oc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ci=Oc;function IT(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});IT.prototype.getValue=function(e,t){return this._callback(e,t)};IT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};IT.prototype.equals=function(e){return this===e||e instanceof IT&&this._callback===e._callback&&this._isConstant===e._isConstant};var _d=IT;var fte=new m,UDe=new me;function PT(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new me,this._normal=new m,this._definitionChanged=new _e,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(Ve.MINIMUM_VALUE,fte);if(!l(o)||m.equals(o,m.ZERO)||!l(e.globe))return;this._position=m.clone(o,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(PT.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});PT.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!l(t)||m.equals(n,m.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,r=t._surface,o=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);l(a)?this._terrainHeight=a:this._terrainHeight=0;function c(u){if(e.mode===ne.SCENE3D){let f=i.cartesianToCartographic(u,UDe);o._terrainHeight=f.height}else o._terrainHeight=u.x;o.definitionChanged.raiseEvent()}this._removeCallbackFunc=r.updateHeight(s,c)};PT.prototype.getValue=function(e,t){let n=q.getValueOrDefault(this._heightReference,e,We.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&i!==We.RELATIVE_TO_GROUND)return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,fte);if(!l(o)||m.equals(o,m.ZERO)||!l(r.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,o,D.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(o,this._position),this._updateClamping();let s=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};PT.prototype.isDestroyed=function(){return!1};PT.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var ux=PT;function VDe(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new _d(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new ux(this._scene,s,o)}}var yp=VDe;var dte=m.ZERO,mte=new m,zDe=new m,hte=new z;function HDe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function eu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new HDe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(eu.prototype=Object.create(ci.prototype),eu.prototype.constructor=eu);Object.defineProperties(eu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});eu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Hn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,hte)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,dte,mte))),new Ct({id:t,geometry:cl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};eu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,hte),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,dte,mte))),new Ct({id:t,geometry:ad.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:o})};eu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};eu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ci.prototype._isHidden.call(this,e,t)};eu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};eu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ve.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?sn.ALL:void 0};eu.prototype._onEntityPropertyChanged=yp;eu.DynamicGeometryUpdater=DT;function DT(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(DT.prototype=Object.create(ai.prototype),DT.prototype.constructor=DT);DT.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,zDe),r=this._options.dimensions;return!l(i)||!l(r)||ai.prototype._isHidden.call(this,e,t,n)};DT.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=q.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?sn.ALL:void 0};var MP=eu;var Ite=Ki(wte(),1);var uRe=0,L5={};function xp(e,t){let n,i=e;l(L5[i])?n=L5[i]:(n=uRe++,L5[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(xp.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Ite.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});xp.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};xp.prototype.equals=function(e){return xp.equals(this,e)};xp.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible,n=new xp(e.html,t);return n._isIon=n.html.indexOf("ion-credit.png")!==-1,n};xp.clone=function(e){if(l(e))return new xp(e.html,e.showOnScreen)};var vt=xp;function Pte(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ee.COMPUTE,this.owner=e.owner}Pte.prototype.execute=function(e){e.execute(this)};var ef=Pte;var FP=`in vec2 v_textureCoordinates; - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); +uniform float originalSize; +uniform sampler2D texture0; +uniform sampler2D texture1; +uniform sampler2D texture2; +uniform sampler2D texture3; +uniform sampler2D texture4; +uniform sampler2D texture5; - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var gV=new N,eke=new N,tke=new N,vre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Ore,_transformsToTypedArray:R6};vre.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(hO);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,l=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];_ke(e,n,i,f,l),Ake(e,n,i,f);let d={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",be.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",be.VERTEX),d.u_instance_modifiedModelView=function(){let p=N.multiplyTransformation(s.modelMatrix,a.components.transform,gV);return l?N.multiplyTransformation(n.context.uniformState.view3D,p,gV):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,gV)),N.multiplyTransformation(n.context.uniformState.view,p,gV))},d.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,eke)},o.addVertexLines(_O)):o.addVertexLines(pO),l){o.addDefine("USE_2D_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_modelView2D",be.VERTEX);let p=n.context,g=N.fromTranslation(c.instancingReferencePoint2D,new N);d.u_modelView2D=function(){return N.multiplyTransformation(p.uniformState.view,g,tke)}}e.uniformMap=_t(d,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,f)};var gO=new N,nke=new m;function ike(e,t,n,i,r){let o=N.multiplyTransformation(t,e,gO);return o=N.multiplyTransformation(o,n,gO),r=Mt.basisTo2D(i.mapProjection,o,r),r}function rke(e,t,n,i,r){let o=N.fromTranslation(e,gO),s=N.multiplyTransformation(t,o,gO);s=N.multiplyTransformation(s,n,gO);let a=N.getTranslation(s,nke);return r=$i.computeActualWgs84Position(i,a,r),r}function wre(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=N.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=N.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=N.clone(r.computedModelMatrix,t),t=N.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=N.clone(N.IDENTITY,n))}var Dre=new N,Ire=new N,oke=new N,ske=new m;function ake(e,t,n,i){let r=Dre,o=Ire;wre(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let l=0;l<c;l++){let f=e[l],d=ike(f,r,o,n,oke),p=N.getTranslation(d,ske),g=m.subtract(p,a,p);i[l]=N.setTranslation(d,g,i[l])}return i}function cke(e,t,n,i){let r=Dre,o=Ire;wre(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let l=0;l<c;l++){let f=e[l],d=rke(f,r,o,n,f);i[l]=m.subtract(d,a,i[l])}return i}var lke=new m,uke=new m;function Pre(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,lke),o=$i.computeActualWgs84Position(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,uke),a=$i.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=m.lerp(o,a,.5,new m)}function R6(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function fke(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var dke=new m,mke=new Le,hke=new m;function Ore(e,t,n){let i=new Array(t),r=Zt.getAttributeBySemantic(e,qo.TRANSLATION),o=Zt.getAttributeBySemantic(e,qo.ROTATION),s=Zt.getAttributeBySemantic(e,qo.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=u(r),f=u(o),d=u(s),p=l?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=Yn.dequantize(g,o.componentDatatype,o.type,t));let h;d?h=s.typedArray:(h=new Float32Array(t*3),h.fill(1));for(let x=0;x<t;x++){let C=new m(p[x*3],p[x*3+1],p[x*3+2],dke);m.maximumByComponent(a,C,a),m.minimumByComponent(c,C,c);let T=new Le(g[x*4],g[x*4+1],g[x*4+2],f?g[x*4+3]:1,mke),E=new m(h[x*3],h[x*3+1],h[x*3+2],hke),S=N.fromTranslationQuaternionRotationScale(C,T,E,new N);i[x]=S}let A=n.runtimeNode;return A.instancingTranslationMin=c,A.instancingTranslationMax=a,l&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function pke(e,t,n){let i=new Array(t),r=e.typedArray,o=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let l=new m(r[c*3],r[c*3+1],r[c*3+2]);i[c]=l,m.minimumByComponent(o,l,o),m.maximumByComponent(s,l,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function B6(e,t){let n=mt.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function _ke(e,t,n,i,r){let o=Zt.getAttributeBySemantic(n,qo.ROTATION);u(o)?gke(e,n,i,t,r):yke(e,n,i,t,r)}function gke(e,t,n,i,r){let o=e.shaderBuilder,s=t.attributes[0].count,a=e.model,c=e.runtimeNode;o.addDefine("HAS_INSTANCE_MATRICES");let l="Transform",f,d=c.instancingTransformsBuffer;if(!u(d)){f=Ore(t,s,e);let A=R6(f);d=B6(A,i),a._modelResources.push(d),c.instancingTransformsBuffer=d}if(Sre(e,d,n,l),!r)return;let p=We(i);p.mode=ne.COLUMBUS_VIEW,Pre(e,p);let g=c.instancingTransformsBuffer2D;if(!u(g)){let A=ake(f,e,p,f),x=R6(A);g=B6(x,i),a._modelResources.push(g),c.instancingTransformsBuffer2D=g}Sre(e,g,n,"Transform2D")}function yke(e,t,n,i,r){let o=e.shaderBuilder,s=e.runtimeNode,a=Zt.getAttributeBySemantic(t,qo.TRANSLATION),c=Zt.getAttributeBySemantic(t,qo.SCALE);if(u(c)){o.addDefine("HAS_INSTANCE_SCALE");let C="Scale";M6(e,c.buffer,c.byteOffset,c.byteStride,n,C)}if(!u(a))return;let l,f=a.typedArray;u(f)?l=pke(a,a.count,e):u(s.instancingTranslationMin)||(s.instancingTranslationMin=a.min,s.instancingTranslationMax=a.max),o.addDefine("HAS_INSTANCE_TRANSLATION");let d="Translation";if(M6(e,a.buffer,a.byteOffset,a.byteStride,n,d),!r)return;let p=We(i);p.mode=ne.COLUMBUS_VIEW,Pre(e,p);let g=s.instancingTranslationBuffer2D;if(!u(g)){let C=cke(l,e,p,l),T=fke(C);g=B6(T,i),e.model._modelResources.push(g),s.instancingTranslationBuffer2D=g}M6(e,g,0,void 0,n,"Translation2D")}function Sre(e,t,n,i){let o=X.getSizeInBytes(X.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function M6(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function Ake(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===qo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:an.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var yO=vre;var L6={};L6.name="ModelMatrixUpdateStage";L6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;Mre(e,t,r,e.transformToRoot),e._transformDirty=!1}};function Mre(e,t,n,i){let r;i=N.multiplyTransformation(i,e.transform,new N),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let c=e.runtimePrimitives[r].drawCommand;c.modelMatrix=N.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=Zt.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(r=0;r<s;r++){let a=t._runtimeNodes[e.children[r]];a._transformToRoot=N.clone(i,a._transformToRoot),Mre(a,t,n,i),a._transformDirty=!1}}var AO=L6;var Rre={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Bre,_countGeneratedBuffers:Lre};Rre.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;Bre(i,r),Lre(i,o)};function Bre(e,t){if(!u(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];u(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Lre(e,t){u(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),u(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),u(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var xO=Rre;function aE(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=N.clone(n,this._originalTransform),this._transform=N.clone(n,this._transform),this._transformToRoot=N.clone(i,this._transformToRoot),this._computedTransform=new N,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,xke(this)}Object.defineProperties(aE.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=N.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return u(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),N6(this,t))}},rotation:{get:function(){return u(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),N6(this,t))}},scale:{get:function(){return u(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),N6(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function xke(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=N.multiply(n,t,i);let r=e.node;u(r.matrix)||(e._transformParameters=new _g(r.translation,r.rotation,r.scale)),u(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(u(o)){let c=e.sceneGraph._runtimeArticulations[o];u(c)&&c.runtimeNodes.push(e)}}function N6(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}aE.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};aE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,u(e.instances)&&t.push(yO),t.push(xO),n.push(AO)};aE.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};aE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!u(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){u(t[r])||(t[r]=new N);let o=N.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=N.inverseTransformation(o,t[r]);t[r]=N.multiplyTransformation(s,n[r],t[r])}};var CO=aE;var Nre={name:"AlphaPipelineStage"};Nre.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=y(i.pass,r.opaquePass);let o=e.renderStateOptions;i.pass===ve.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=dn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;u(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,be.FRAGMENT),s.addUniform("float","u_alphaCutoff",be.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var TO=Nre;var Fre={name:"BatchTexturePipelineStage"};Fre.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=_t(r,e.uniformMap)};var EO=Fre;var Ure={name:"ClassificationPipelineStage"};Ure.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,be.BOTH);let r=e.runtimePrimitive;u(r.batchLengths)||Cke(t,r)};function Cke(e,t){let n=Zt.getAttributeBySemantic(e,Et.POSITION);if(!u(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=u(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=Zt.getAttributeBySemantic(e,Et.FEATURE_ID,0);if(!u(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let l=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let A=1;A<s;A++){let x=o?i[A]:A,C=c[x];if(C!==p){let T=A-g,E=A;l.push(T),f.push(E),g=E,p=C}}let h=s-g;l.push(h),t.batchLengths=l,t.batchOffsets=f}var bO=Ure;var SO=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); +const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); +const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); +const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); + +void main() { - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + vec2 uv = v_textureCoordinates; + vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); + vec2 pixel = 1.0 / textureSize; + + float mipLevel = 0.0; + + if (uv.x - pixel.x > (textureSize.y / textureSize.x)) { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - positionMC *= float(model_silhouettePass); - #else - positionMC *= 0.0; - #endif + mipLevel = 1.0; + if (uv.y - pixel.y > yMipLevel1) + { + mipLevel = 2.0; + if (uv.y - pixel.y * 3.0 > yMipLevel2) + { + mipLevel = 3.0; + if (uv.y - pixel.y * 5.0 > yMipLevel3) + { + mipLevel = 4.0; + if (uv.y - pixel.y * 7.0 > yMipLevel4) + { + mipLevel = 5.0; + } + } + } + } } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) + + if (mipLevel > 0.0) { - positionMC *= 0.0; - } -} + float scale = pow(2.0, mipLevel); -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ - float show = ceil(feature.color.a); - positionMC *= show; + uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); + uv.x *= ((textureSize.x - 2.0) / textureSize.y); - #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) - filterByPassType(positionMC, feature.color); - #endif -} -`;var vO=`void filterByPassType(vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - if(!model_silhouettePass) { - discard; - } - #else - discard; - #endif + uv.x -= 1.0 + pixel.x; + uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); + uv *= scale; } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) + else { - discard; + uv.x *= (textureSize.x / textureSize.y); } -} -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ - vec4 featureColor = feature.color; - if (featureColor.a == 0.0) + if(mipLevel == 0.0) { - discard; + out_FragColor = texture(texture0, uv); } + else if(mipLevel == 1.0) + { + out_FragColor = texture(texture1, uv); + } + else if(mipLevel == 2.0) + { + out_FragColor = texture(texture2, uv); + } + else if(mipLevel == 3.0) + { + out_FragColor = texture(texture3, uv); + } + else if(mipLevel == 4.0) + { + out_FragColor = texture(texture4, uv); + } + else if(mipLevel == 5.0) + { + out_FragColor = texture(texture5, uv); + } + else + { + out_FragColor = vec4(0.0); + } +} +`;var BP=`in vec3 v_cubeMapCoordinates; +uniform samplerCube cubeMap; - // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. - // So, we only apply in in the fragment shader if the feature ID texture is used. - #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) - filterByPassType(featureColor); - #endif - - featureColor = czm_gammaCorrect(featureColor); - - // Classification models compute the diffuse differently. - #ifdef HAS_CLASSIFICATION - material.diffuse = featureColor.rgb * featureColor.a; +void main() +{ + vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); + #ifdef RGBA_NORMALIZED + out_FragColor = vec4(rgba.rgb, 1.0); #else - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + float m = rgba.a * 16.0; + vec3 r = rgba.rgb * m; + out_FragColor = vec4(r * r, 1.0); #endif - - material.alpha *= featureColor.a; } -`;var Vre={name:"CPUStylingPipelineStage"};Vre.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(SO),r.addFragmentLines(vO),r.addDefine("USE_CPU_STYLING",void 0,be.BOTH),u(i.color)||(r.addUniform("float",zg.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),e.uniformMap[zg.COLOR_BLEND_UNIFORM_NAME]=function(){return $a.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",be.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===ve.TRANSLUCENT}};var wO=Vre;var kre={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};kre.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Wp=Object.freeze(kre);var DO=`void customShaderStage( - inout czm_modelVertexOutput vsOutput, - inout ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // VertexInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - VertexInput vsInput; - initializeInputStruct(vsInput, attributes); - vsInput.featureIds = featureIds; - vsInput.metadata = metadata; - vsInput.metadataClass = metadataClass; - vsInput.metadataStatistics = metadataStatistics; - vertexMain(vsInput, vsOutput); - attributes.positionMC = vsOutput.positionMC; -} -`;var IO=`void customShaderStage( - inout czm_modelMaterial material, - ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // FragmentInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - FragmentInput fsInput; - initializeInputStruct(fsInput, attributes); - fsInput.featureIds = featureIds; - fsInput.metadata = metadata; - fsInput.metadataClass = metadataClass; - fsInput.metadataStatistics = metadataStatistics; - fragmentMain(fsInput, material); -} -`;var PO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var OO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +`;var kP=`in vec4 position; +in vec3 cubeMapCoordinates; + +out vec3 v_cubeMapCoordinates; + +void main() { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); + gl_Position = position; + v_cubeMapCoordinates = cubeMapCoordinates; } -`;var Vi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Vi.process=function(e,t,n){let i=e.shaderBuilder;Tke(i);let r=e.runtimeNode.node.instances;u(r)&&Eke(e,r,n),bke(e,t,n),i.addVertexLines(OO),i.addFragmentLines(PO)};function Tke(e){e.addStruct(Vi.STRUCT_ID_FEATURE_IDS_VS,Vi.STRUCT_NAME_FEATURE_IDS,be.VERTEX),e.addStruct(Vi.STRUCT_ID_FEATURE_IDS_FS,Vi.STRUCT_NAME_FEATURE_IDS,be.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Vi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.VERTEX),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Vi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Vi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.VERTEX),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Vi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Vi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,be.VERTEX)}function Eke(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Nt.FeatureIdAttribute?Ske(e,s,a):zre(e,s,a,r,1,n);let c=s.label;u(c)&&Hre(e,a,c,be.BOTH)}}function bke(e,t,n){let i=t.featureIds,o=Zt.getAttributeBySemantic(t,Et.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,l=be.BOTH;a instanceof Nt.FeatureIdAttribute?vke(e,a,c):a instanceof Nt.FeatureIdImplicitRange?zre(e,a,c,o,void 0,n):(wke(e,a,c,s,n),l=be.FRAGMENT);let f=a.label;u(f)&&Hre(e,c,f,l)}}function Ske(e,t,n){let i=e.shaderBuilder;i.addStructField(Vi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Vi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,l=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[l]),i.addVarying("float",a),i.addFunctionLines(Vi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function vke(e,t,n){let i=e.shaderBuilder;i.addStructField(Vi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Vi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function zre(e,t,n,i,r,o){Dke(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Vi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Vi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Vi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function wke(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return y(a.texture,r.context.defaultTexture)};let c=a.channels,l=e.shaderBuilder;l.addStructField(Vi.STRUCT_ID_FEATURE_IDS_FS,"int",n),l.addUniform("sampler2D",o,be.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,d=`texture(${o}, ${f}).${c}`,p=`featureIds.${n} = czm_unpackUint(${d});`;l.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Hre(e,t,n,i){let r=e.shaderBuilder,o=be.includesVertexShader(i);o&&r.addStructField(Vi.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(Vi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Dke(e,t,n,i,r){let o=e.model,s,a;if(u(t.repeat)){let l=Ike(t,n);s=mt.createVertexBuffer({context:r.context,typedArray:l,usage:Ne.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s);let f=!1;o.statistics.addBuffer(s,f)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Ike(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var Hg=Vi;var MO=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) +`;function fx(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new _e}Object.defineProperties(fx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});fx.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var fRe=new m(1,0,0),dRe=new m(0,0,1),mRe=new m(-1,0,0),hRe=new m(0,0,-1),Lk=new m(0,1,0),pRe=new m(0,-1,0),Ote=[Lk,mRe,dRe,pRe,fRe,Lk,hRe,Lk,Lk],Mte=Ote.length,Lte=new Float32Array(Mte*3),Dte=0;for(let e=0;e<Mte;++e,Dte+=3)m.pack(Ote[e],Lte,Dte);var _Re=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),gRe=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function yRe(e){let t=mt.createVertexBuffer({context:e,typedArray:_Re,usage:Fe.STATIC_DRAW}),n=mt.createVertexBuffer({context:e,typedArray:Lte,usage:Fe.STATIC_DRAW}),i=mt.createIndexBuffer({context:e,typedArray:gRe,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),r=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:X.FLOAT}];return new si({context:e,attributes:r,indexBuffer:i})}function Rte(e){return function(){return e}}function N5(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let r=e._mipTextures;if(l(r))for(n=r.length,t=0;t<n;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}fx.prototype.update=function(e){let t=e.context;if(!fx.isSupported(t)||(l(this._texture)&&l(this._va)&&N5(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let g=e.context.textureCache.getTexture(this._url);l(g)&&(N5(this),this._texture=g,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let g=this;ll(this._url).then(function(h){g._cubeMapBuffers=h,g._loading=!1}).catch(function(h){g.isDestroyed()||g._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],r=n[0].positiveX.pixelDatatype;l(r)?i.push("RGBA_NORMALIZED"):r=t.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT;let o=ct.RGBA,s=new ze({defines:i,sources:[BP]});this._va=yRe(t),this._sp=Jt.fromCache({context:t,vertexShaderSource:kP,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let g=0;g<a;++g){let h=n[g].positiveY;n[g].positiveY=n[g].negativeY,n[g].negativeY=h;let x=c[g]=new Ha({context:t,source:n[g],pixelDatatype:r}),b=c[g].width*2,C=u[g]=new Lt({context:t,width:b,height:b,pixelDatatype:r,pixelFormat:o}),A=new ef({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:Rte(x)},outputTexture:C,persists:!0,owner:this});e.commandList.push(A),d[`texture${g}`]=Rte(C)}this._texture=new Lt({context:t,width:f*1.5+2,height:f,pixelDatatype:r,pixelFormat:o}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new ef({fragmentShaderSource:FP,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};fx.prototype.isDestroyed=function(){return!1};fx.prototype.destroy=function(){return N5(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var xd=fx;function UP(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?H.clone(e.imageBasedLightingFactor):new H(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=H.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(UP.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=H.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function xRe(e,t){if(xd.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new xd(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}UP.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(xRe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};UP.prototype.isDestroyed=function(){return!1};UP.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var dx=UP;var F5=Ki(Xl(),1);var Nk,Nte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYmE2YWEzOS1lZDUyLTQ0YWMtOTlkNS0wN2VhZWI3NTc4MmEiLCJpZCI6MjU5LCJpYXQiOjE2ODU2MzQ0Njl9.AswCMxsN03WYwuZL-r183OZicN64Ks9aPExWhA3fuLY",Fk={};Fk.defaultAccessToken=Nte;Fk.defaultServer=new Ie({url:"https://api.cesium.com/"});Fk.getDefaultTokenCredit=function(e){if(e===Nte){if(!l(Nk)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;Nk=new vt(t,!0),Nk._isDefaultToken=!0}return Nk}};var bd=Fk;function Lc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:bRe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ie.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new F5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}l(Object.create)&&(Lc.prototype=Object.create(Ie.prototype),Lc.prototype.constructor=Lc);Lc.fromAssetId=function(e,t){let n=Lc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Lc(i,n)})};Object.defineProperties(Lc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Lc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Lc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(vt.getIonCredit),i=bd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(vt.clone(i)),n};Lc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Lc(t._ionEndpoint,t._ionEndpointResource)),e=Ie.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Lc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ie.prototype.fetchImage.call(this,e)};Lc.prototype._makeRequest=function(e){return this._isExternal||new F5.default(this.url).authority()!==this._ionEndpointDomain?Ie.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ie.prototype._makeRequest.call(this,e))};Lc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,bd.defaultServer),i=y(t.accessToken,bd.defaultAccessToken);n=Ie.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};function bRe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){return n._ionEndpoint=o,o}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Zs=Lc;function Wm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Wm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Wm.prototype.get=function(e){return this._array[e]};Wm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Wm.prototype.peek=function(){return this._array[this._length-1]};Wm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Wm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Wm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Wm.prototype.resize=function(e){this.length=e};Wm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Nc=Wm;function Bk(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}Bk.ALL=Object.freeze(new Bk({color:new z(0,0,0,0),depth:1,stencil:0}));Bk.prototype.execute=function(e,t){e.clear(this,t)};var li=Bk;var bp={X:0,Y:1,Z:2};bp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromRotationX(D.PI_OVER_TWO));bp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromRotationX(-D.PI_OVER_TWO));bp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromRotationY(-D.PI_OVER_TWO));bp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromRotationY(D.PI_OVER_TWO));bp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromRotationZ(D.PI_OVER_TWO));bp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromRotationZ(-D.PI_OVER_TWO));bp.fromName=function(e){return bp[e]};var hr=Object.freeze(bp);function tf(e){this.planes=y(e,[])}var VP=[new m,new m,new m];m.clone(m.UNIT_X,VP[0]);m.clone(m.UNIT_Y,VP[1]);m.clone(m.UNIT_Z,VP[2]);var gg=new m,CRe=new m,Fte=new un(new m(1,0,0),0);tf.fromBoundingSphere=function(e,t){l(t)||(t=new tf);let n=VP.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=VP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),m.multiplyByScalar(c,-o,gg),m.add(r,gg,gg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-m.dot(c,gg),m.multiplyByScalar(c,o,gg),m.add(r,gg,gg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-m.dot(m.negate(c,CRe),gg),s+=2}return t};tf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(un.fromCartesian4(t[i],Fte));if(o===en.OUTSIDE)return en.OUTSIDE;o===en.INTERSECTING&&(n=!0)}return n?en.INTERSECTING:en.INSIDE};tf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===tf.MASK_OUTSIDE||t===tf.MASK_INSIDE)return t;let n=tf.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&!(t&s))continue;let a=e.intersectPlane(un.fromCartesian4(i[r],Fte));if(a===en.OUTSIDE)return tf.MASK_OUTSIDE;a===en.INTERSECTING&&(n|=s)}return n};tf.MASK_OUTSIDE=4294967295;tf.MASK_INSIDE=0;tf.MASK_INDETERMINATE=2147483647;var ts=tf;function jm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ts,this._orthographicMatrix=new F}function Bte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(jm.prototype,{projectionMatrix:{get:function(){return Bte(this),this._orthographicMatrix}}});var TRe=new m,ARe=new m,ERe=new m,B5=new m;jm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,TRe);m.normalize(f,f);let d=ARe;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=ERe;m.multiplyByScalar(f,a,p),m.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new oe),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-m.dot(f,p),m.multiplyByScalar(f,s,p),m.add(d,p,p),g=i[1],l(g)||(g=i[1]=new oe),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-m.dot(m.negate(f,B5),p),m.multiplyByScalar(n,o,p),m.add(d,p,p),g=i[2],l(g)||(g=i[2]=new oe),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,r,p),m.add(d,p,p),g=i[3],l(g)||(g=i[3]=new oe),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,B5),p),g=i[4],l(g)||(g=i[4]=new oe),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,d),m.multiplyByScalar(t,u,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new oe),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,B5),p),this._cullingVolume};jm.prototype.getPixelDimensions=function(e,t,n,i,r){Bte(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};jm.prototype.clone=function(e){return l(e)||(e=new jm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};jm.prototype.equals=function(e){return l(e)&&e instanceof jm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};jm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof jm&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var vo=jm;function hl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new vo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}hl.packedLength=4;hl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};hl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new hl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function yg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(hl.prototype,{projectionMatrix:{get:function(){return yg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return yg(this),this._offCenterFrustum}}});hl.prototype.computeCullingVolume=function(e,t,n){return yg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};hl.prototype.getPixelDimensions=function(e,t,n,i,r){return yg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};hl.prototype.clone=function(e){return l(e)||(e=new hl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};hl.prototype.equals=function(e){return!l(e)||!(e instanceof hl)?!1:(yg(this),yg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};hl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof hl)?!1:(yg(this),yg(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var nn=hl;function kte(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(kte.prototype,{metadata:{get:function(){return this._metadata}}});var mx=kte;function xg(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),xg.decode(e)}xg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};xg.decodeWithFromCharCode=function(e){let t="",n=SRe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function zP(e,t,n){return t<=e&&e<=n}function SRe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(zP(u,0,127)){s.push(u);continue}if(zP(u,194,223)){i=1,t=u&31;continue}if(zP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(zP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new de("String decoding failed.")}if(!zP(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?xg.decode=xg.decodeWithTextDecoder:xg.decode=xg.decodeWithFromCharCode;var pl=xg;function vRe(e,t){return t=y(t,0),pl(e,t,Math.min(4,e.length))}var Cd=vRe;function Td(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r})}Object.defineProperties(Td.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Composite3DTileContent.readyPromise","Composite3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Composite3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var HP=Uint32Array.BYTES_PER_ELEMENT;Td.fromTileType=async function(e,t,n,i,r,o){r=y(r,0);let s=new Uint8Array(i),a=new DataView(i);r+=HP;let c=a.getUint32(r,!0);if(c!==1)throw new de(`Only Composite Tile version 1 is supported. Version ${c} is not.`);r+=HP,r+=HP;let u=a.getUint32(r,!0);r+=HP;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let h=0;h<u;++h){let x=Cd(s,r),b=a.getUint32(r+HP*2,!0),C=o[x],A=`${f}${h}`,T=n.getDerivedResource({queryParameters:{compositeIndex:A}});if(l(C))d[h]=Promise.resolve(C(e,t,T,i,r));else throw new de(`Unknown tile content type, ${x}, inside Composite tile`);r+=b}let p=await Promise.all(d);return new Td(e,t,n,p)};Td.prototype.hasProperty=function(e,t){return!1};Td.prototype.getFeature=function(e){};Td.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};Td.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Td.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var GP=Td;function wRe(e,t,n){return JSON.parse(pl(e,t,n))}var Lr=wRe;function Ya(e){this._id=qn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Ht.maximumTextureSize),o=Math.ceil(t/Ht.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new H(r,o),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Ya.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Ya.DEFAULT_COLOR_VALUE=z.WHITE;Ya.DEFAULT_SHOW_VALUE=!0;function Ute(e){let t=e._textureDimensions;return t.x*t.y*4}function Vte(e){if(!l(e._batchValues)){let t=Ute(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function zte(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Ya.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=zte(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=Vte(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Ya.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Ya.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var IRe=new Array(4);Ya.prototype.setColor=function(e,t){if(z.equals(t,Ya.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(IRe),i=n[3],r=Vte(this),o=e*4,s=zte(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Ya.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Ya.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Ya.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};Ya.prototype.getPickColor=function(e){return this._pickIds[e]};function Hte(e,t,n){let i=e._textureDimensions;return new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:mn.NEAREST})}function PRe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Ute(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=Hte(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function DRe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ya.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&PRe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Hte(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),DRe(this))};Ya.prototype.isDestroyed=function(){return!1};Ya.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Fc=Ya;var RRe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ORe={SCALAR:void 0,VEC2:H,VEC3:m,VEC4:oe,MAT2:ir,MAT3:$,MAT4:F};function MRe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=RRe[e.type],r=ORe[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return X.createArrayBufferView(n,o,s,i*a)}}}var nu=MRe;function Cp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,LRe(this,e.extension,e.binaryBody)}Object.defineProperties(Cp.prototype,{byteLength:{get:function(){return this._byteLength}}});function LRe(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=cn.SCALAR,o=nu(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=cn.SCALAR,o=nu(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=cn.SCALAR,o=nu(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let h=a.length;for(i=0;i<h;++i){let C=a[i].length,A=a[i].instances,T=NRe(C,A,n);p+=FRe(T),a[i].instances=gt(T,A)}let x=new Array(h).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],b[i]=x[r],++x[r];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function NRe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${r} requires a batch table binary.`);let u=nu(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function FRe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var BRe=[],kRe=[],URe=0;function VRe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=BRe;c.length=Math.max(c.length,a);let u=++URe,f=kRe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let h=0;h<p;++h){let x=o[g+h];x!==t&&f.push(x)}}}function zRe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function WP(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return VRe(e,t,n)}else return n(e,t);return zRe(e,t,n)}Cp.prototype.hasProperty=function(e,t){let n=WP(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Cp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Cp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,WP(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Cp.prototype.getProperty=function(e,t){return WP(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?HRe(a,s):je(a[s],!0)})};function HRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Cp.prototype.setProperty=function(e,t,n){let i=WP(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?GRe(u,c,n):u[c]=je(n,!0),!0});return l(i)};function GRe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Cp.prototype.isClass=function(e,t){let n=WP(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Cp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var hx=Cp;var WRe={HIGHLIGHT:0,REPLACE:1,MIX:2},_l=Object.freeze(WRe);var k5=Fc.DEFAULT_COLOR_VALUE,U5=Fc.DEFAULT_SHOW_VALUE;function pr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=y(o,{});let s=jRe(n);this._properties=s,this._batchTableHierarchy=qRe(this,n,i);let a=Wte(t,s,i);this._binaryPropertiesByteLength=YRe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Fc({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}pr._deprecationWarning=Q;Object.defineProperties(pr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function jRe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=je(e[n],!0));return t}function qRe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(pr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new hx({extension:i,binaryBody:n})}function Wte(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${r} requires a batch table binary.`);let u=nu(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function YRe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}pr.getBinaryProperties=function(e,t,n){return Wte(e,t,n)};pr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};pr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};pr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};pr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};pr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};pr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};pr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var XRe=new z;pr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(k5),this.setAllShow(U5);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?y(e.color.evaluateColor(r,XRe),k5):k5,s=l(e.show)?y(e.show.evaluate(r),U5):U5;this.setColor(i,o),this.setShow(i,s)}};function KRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function JRe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}pr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};pr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};pr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};pr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};pr.prototype.hasPropertyBySemantic=function(){return!1};pr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};pr.prototype.getPropertyBySemantic=function(e,t){};pr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return KRe(i,e)}let n=this._properties[t];if(l(n))return je(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};pr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){JRe(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=je(n,!0)};function ZRe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}pr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=jte(r,n,!1),s;return Ht.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${o} +${ZRe(i)}${s}`}};function Gte(e,t){return e=ze.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function $Re(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function jte(e,t,n){if(!l(t))return Gte(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return Gte(e,n);let o=r[0],s=r[2];e=ze.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=$Re(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${o} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}pr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=jte(i,t,!0),Ht.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};pr.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=ze.replaceMain(e,"tile_main"),Ht.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function QRe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===_l.HIGHLIGHT)return 0;if(n===_l.REPLACE)return 1;if(n===_l.MIX)return D.clamp(i,D.EPSILON4,1)}pr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return gt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return QRe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};pr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var bg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};pr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=eOe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ee.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=tOe(f),f.dirty=!1);let p=d.originalCommand;c!==bg.ALL_OPAQUE&&f.pass!==Ee.TRANSLUCENT&&(l(d.translucent)||(d.translucent=nOe(p))),c!==bg.ALL_TRANSLUCENT&&f.pass!==Ee.TRANSLUCENT&&(l(d.opaque)||(d.opaque=iOe(p)),a&&(o||(l(d.zback)||(d.zback=oOe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==aOe(d.stencil))&&(f.renderState.depthMask?d.stencil=sOe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,h=d.translucent;f.pass!==Ee.TRANSLUCENT?(c===bg.ALL_OPAQUE&&(n[u]=g),c===bg.ALL_TRANSLUCENT&&(n[u]=h),c===bg.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(h))):n[u]=p}};function eOe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?bg.ALL_OPAQUE:t===e.featuresLength?bg.ALL_TRANSLUCENT:bg.OPAQUE_AND_TRANSLUCENT}function tOe(e){let t=tt.shallowClone(e),n=t.pass===Ee.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function nOe(e){let t=tt.shallowClone(e);return t.pass=Ee.TRANSLUCENT,t.renderState=cOe(e.renderState),t}function iOe(e){let t=tt.shallowClone(e);return t.renderState=lOe(e.renderState),t}function rOe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function oOe(e,t){let n=tt.shallowClone(t),i=je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=xi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=Ue.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=je(t.uniformMap);let r=new H(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=rOe(e,t.shaderProgram),n}function sOe(e,t){let n=tt.shallowClone(e),i=je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Wn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Wn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=Ue.fromCache(i),n}function aOe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function cOe(e){let t=je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=dn.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function lOe(e){let t=je(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}pr.prototype.update=function(e,t){this._batchTexture.update(e,t)};pr.prototype.isDestroyed=function(){return!1};pr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Tp=pr;function uOe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var qm=uOe;var OT=`in vec3 position; +in float a_batchId; + +uniform mat4 u_modifiedModelViewProjection; + +void main() { - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -`;var RO=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) +`;function nf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(nf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});nf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};nf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};nf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};nf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let r=e.metadata;if(l(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}let o=e.tile,s=o.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(o.implicitSubtree)&&(a=o.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};nf.prototype.getPropertyInherited=function(e){return nf.getPropertyInherited(this._content,this._batchId,e)};nf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};nf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};nf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};nf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ws=nf;var V5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},z5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Ge=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Ge.version}static addUnaryOp(t){return Ge.max_unop_len=Math.max(t.length,Ge.max_unop_len),Ge.unary_ops[t]=1,Ge}static addBinaryOp(t,n,i){return Ge.max_binop_len=Math.max(t.length,Ge.max_binop_len),Ge.binary_ops[t]=n,i?Ge.right_associative.add(t):Ge.right_associative.delete(t),Ge}static addIdentifierChar(t){return Ge.additional_identifier_chars.add(t),Ge}static addLiteral(t,n){return Ge.literals[t]=n,Ge}static removeUnaryOp(t){return delete Ge.unary_ops[t],t.length===Ge.max_unop_len&&(Ge.max_unop_len=Ge.getMaxKeyLen(Ge.unary_ops)),Ge}static removeAllUnaryOps(){return Ge.unary_ops={},Ge.max_unop_len=0,Ge}static removeIdentifierChar(t){return Ge.additional_identifier_chars.delete(t),Ge}static removeBinaryOp(t){return delete Ge.binary_ops[t],t.length===Ge.max_binop_len&&(Ge.max_binop_len=Ge.getMaxKeyLen(Ge.binary_ops)),Ge.right_associative.delete(t),Ge}static removeAllBinaryOps(){return Ge.binary_ops={},Ge.max_binop_len=0,Ge}static removeLiteral(t){return delete Ge.literals[t],Ge}static removeAllLiterals(){return Ge.literals={},Ge}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new Ge(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return Ge.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!Ge.binary_ops[String.fromCharCode(t)]||Ge.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return Ge.isIdentifierStart(t)||Ge.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(Ge.hooks[t]){let i={context:this,node:n};return Ge.hooks.run(t,i),i.node}return n}searchHook(t){if(Ge.hooks[t]){let n={context:this};return Ge.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===Ge.SPACE_CODE||t===Ge.TAB_CODE||t===Ge.LF_CODE||t===Ge.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:Ge.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===Ge.SEMCOL_CODE||i===Ge.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,Ge.max_binop_len),n=t.length;for(;n>0;){if(Ge.binary_ops.hasOwnProperty(t)&&(!Ge.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!Ge.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:Ge.binaryPrecedence(n),right_a:Ge.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=Ge.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:Ge.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:Ge.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:Ge.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,Ge.isDecimalDigit(t)||t===Ge.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===Ge.SQUOTE_CODE||t===Ge.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===Ge.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,Ge.max_unop_len),i=n.length;i>0;){if(Ge.unary_ops.hasOwnProperty(n)&&(!Ge.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!Ge.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:Ge.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}Ge.isIdentifierStart(t)?(r=this.gobbleIdentifier(),Ge.literals.hasOwnProperty(r.name)?r={type:Ge.LITERAL,value:Ge.literals[r.name],raw:r.name}:r.name===Ge.this_str&&(r={type:Ge.THIS_EXP})):t===Ge.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===Ge.PERIOD_CODE||n===Ge.OBRACK_CODE||n===Ge.OPAREN_CODE||n===Ge.QUMARK_CODE;){let i;if(n===Ge.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==Ge.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===Ge.OBRACK_CODE?(t={type:Ge.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==Ge.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===Ge.OPAREN_CODE?t={type:Ge.CALL_EXP,arguments:this.gobbleArguments(Ge.CPAREN_CODE),callee:t}:(n===Ge.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:Ge.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;Ge.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===Ge.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);Ge.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));Ge.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);Ge.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,Ge.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===Ge.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===Ge.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:Ge.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:Ge.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(Ge.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,Ge.isIdentifierPart(t));)this.index++;return{type:Ge.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===Ge.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===Ge.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===Ge.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===Ge.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===Ge.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(Ge.CPAREN_CODE);if(this.code===Ge.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:Ge.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:Ge.ARRAY_EXP,elements:this.gobbleArguments(Ge.CBRACK_CODE)}}},fOe=new V5;Object.assign(Ge,{hooks:fOe,plugins:new z5(Ge),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Ge.max_unop_len=Ge.getMaxKeyLen(Ge.unary_ops);Ge.max_binop_len=Ge.getMaxKeyLen(Ge.binary_ops);var Cg=e=>new Ge(e).parse(),dOe=Object.getOwnPropertyNames(Ge);dOe.forEach(e=>{Cg[e]===void 0&&e!=="prototype"&&(Cg[e]=Ge[e])});Cg.Jsep=Ge;var mOe="ConditionalExpression",hOe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:mOe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Cg.plugins.register(hOe);var pOe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},yt=Object.freeze(pOe);function Ad(e,t){this._expression=e,e=IOe(e,t),e=DOe(POe(e)),Cg.addBinaryOp("=~",0),Cg.addBinaryOp("!~",0);let n;try{n=Cg(e)}catch(i){throw new de(i)}this._runtimeAst=Ei(this,n)}Object.defineProperties(Ad.prototype,{expression:{get:function(){return this._expression}}});var Mn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};Ad.prototype.evaluate=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof oe?n.clone(t):n};Ad.prototype.evaluateColor=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Ad.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} { - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); - setMetadataVaryings(); + return ${r}; } -`;var bi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};bi.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=Pke(o.propertyAttributes,t,a),l=Mke(o.propertyTextures,a),f=c.concat(l);Bke(i,f),Fke(i),i.addVertexLines(RO),i.addFragmentLines(MO);for(let d=0;d<c.length;d++){let p=c[d];Uke(e,p)}for(let d=0;d<l.length;d++){let p=l[d];kke(e,p)}};function Pke(e,t,n){return u(e)?e.flatMap(i=>Oke(i,t,n)):[]}function Oke(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=Zt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),l=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:h,variableName:A}=r(g);l[f]={metadataVariable:o(d),property:p,type:p.classProperty.type,glslType:h,variableName:A,propertyStatistics:a?.properties[d],shaderDestination:be.BOTH}}return l}function Mke(e,t){return u(e)?e.flatMap(n=>Rke(n,t)):[]}function Rke(e,t){let{sanitizeGlslIdentifier:n}=Zt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,l]=o[a];s[a]={metadataVariable:n(c),property:l,type:l.classProperty.type,glslType:l.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:be.FRAGMENT}}return s}function Bke(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:l,propertyStatistics:f}=t[a];n.add(l),u(f)&&c!==qt.ENUM&&i.add(l)}let r=bi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=bi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,l){e.addStruct(a,a,be.BOTH);for(let f=0;f<l.length;f++){let{shaderName:d}=l[f],p=l[f].type==="float"?Nke(c):c;e.addStructField(a,p,d)}}}var Lke={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Nke(e){let t=Lke[e];return u(t)?t:e}function Fke(e){e.addStruct(bi.STRUCT_ID_METADATA_VS,bi.STRUCT_NAME_METADATA,be.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_FS,bi.STRUCT_NAME_METADATA,be.FRAGMENT),e.addStruct(bi.STRUCT_ID_METADATA_CLASS_VS,bi.STRUCT_NAME_METADATA_CLASS,be.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_CLASS_FS,bi.STRUCT_NAME_METADATA_CLASS,be.FRAGMENT),e.addStruct(bi.STRUCT_ID_METADATA_STATISTICS_VS,bi.STRUCT_NAME_METADATA_STATISTICS,be.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_STATISTICS_FS,bi.STRUCT_NAME_METADATA_STATISTICS,be.FRAGMENT),e.addFunction(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,bi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.VERTEX),e.addFunction(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,bi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.FRAGMENT),e.addFunction(bi.FUNCTION_ID_SET_METADATA_VARYINGS,bi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,be.VERTEX)}function Uke(e,t){Vke(e,t),Gre(e.shaderBuilder,t),Wre(e.shaderBuilder,t)}function Vke(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=qre({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:be.BOTH,property:r});n.addStructField(bi.STRUCT_ID_METADATA_VS,o,i),n.addStructField(bi.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function kke(e,t){zke(e,t),Gre(e.shaderBuilder,t),Wre(e.shaderBuilder,t)}function zke(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:r,glslType:o,property:s}=t,{texCoord:a,channels:c,index:l,texture:f}=s.textureReader,d=`u_propertyTexture_${l}`;i.hasOwnProperty(d)||(n.addUniform("sampler2D",d,be.FRAGMENT),i[d]=()=>f),n.addStructField(bi.STRUCT_ID_METADATA_FS,o,r);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),A=qre({valueExpression:h,renderResources:e,glslType:o,metadataVariable:r,shaderDestination:be.FRAGMENT,property:s}),x=`metadata.${r} = ${A};`;n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,[x])}function Gre(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=jre(bi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(bi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),be.includesVertexShader(o)&&(e.addStructField(bi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Wre(e,t){let{propertyStatistics:n}=t;if(!u(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===qt.ENUM)return;let s=bi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=jre(s,n,a,o),l=`${o}MetadataStatistics`;e.addStructField(bi.STRUCT_ID_METADATA_STATISTICS_FS,l,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),be.includesVertexShader(t.shaderDestination)&&(e.addStructField(bi.STRUCT_ID_METADATA_STATISTICS_VS,l,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function jre(e,t,n,i){function r(o){let s=t[o.specName];if(u(s))return`${n}.${o.shaderName} = ${i}(${s});`}return u(t)?e.map(r).filter(u):[]}function qre(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:l}=e;s.addUniform(c,r,l),s.addUniform(c,o,l);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}var cf=bi;var Hke={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Gg=Object.freeze(Hke);var ns={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Ot};ns.process=function(e,t,n){let i=e.model.customShader;if(i&&ns.process_original(e,t,n,i),u(e.model._marsOptions)&&u(e.model._marsOptions.customShaders)){let r=jh.getCache(e.model._marsOptions.customShaders);for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&ns.process_original(e,t,n,r[o])}};ns.process_original=function(e,t,n,i){let r=e.shaderBuilder;u(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let o=e.alphaOptions;i.translucencyMode===Gg.TRANSLUCENT?o.pass=ve.TRANSLUCENT:i.translucencyMode===Gg.OPAQUE&&(o.pass=void 0);let s=Jke(i,t);if(!s.customShaderEnabled)return;if(e4e(r,i,s),s.shouldComputePositionWC&&r.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,be.BOTH),u(i.vertexShaderText)&&r.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,be.VERTEX),u(i.fragmentShaderText)){r.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,be.FRAGMENT);let l=Wp.getDefineName(i.mode);r.addDefine(l,void 0,be.FRAGMENT)}let a=i.uniforms;for(let l in a)if(a.hasOwnProperty(l)){let f=a[l];r.addUniform(f.type,l)}let c=i.varyings;for(let l in c)if(c.hasOwnProperty(l)){let f=c[l];r.addVarying(f,l)}e.uniformMap=_t(e.uniformMap,i.uniformMap)};function Gke(e){let t={};for(let n=0;n<e.length;n++){let i=e[n],r=Zt.getAttributeInfo(i);t[r.variableName]=r}return t}var Wke={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},jke={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Yre(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Wke[t],i=jke[t];if(u(n))return{attributeField:[n,e],value:i}}function qke(e,t,n){let i=Xre(t,e.usedVariablesVertex.attributeSet,!1),r=i.addToShader,o=i.missingAttributes,s,a,c=[],l=[];for(s in r)if(r.hasOwnProperty(s)){let d=[r[s].glslType,s];c.push(d),a=`vsInput.attributes.${s} = attributes.${s};`,l.push(a)}for(let f=0;f<o.length;f++){s=o[f];let d=Yre(s);if(!u(d)){ns._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${s}, disabling custom vertex shader`);return}c.push(d.attributeField),a=`vsInput.attributes.${s} = ${d.value};`,l.push(a)}n.enabled=!0,n.attributeFields=c,n.initializationLines=l}function Yke(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function Xke(e,t,n){let i=Xre(t,e.usedVariablesFragment.attributeSet,!0),r=i.addToShader,o=i.missingAttributes,s,a,c=[],l=[];for(s in r)if(r.hasOwnProperty(s)){let p=[r[s].glslType,s];c.push(p),a=`fsInput.attributes.${s} = attributes.${s};`,l.push(a)}for(let d=0;d<o.length;d++){s=o[d];let p=Yre(s);if(!u(p)){ns._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${s}, disabling custom fragment shader.`);return}c.push(p.attributeField),a=`fsInput.attributes.${s} = ${p.value};`,l.push(a)}let f=Yke(e);n.enabled=!0,n.attributeFields=c.concat(f.attributeFields),n.initializationLines=f.initializationLines.concat(l)}var Kke={positionWC:!0,positionEC:!0};function Xre(e,t,n){let i,r,o={};for(r in e)if(e.hasOwnProperty(r)){let a=e[r];i=r,n&&r==="normalMC"?i="normalEC":n&&r==="tangentMC"&&(i="tangentEC"),t.hasOwnProperty(i)&&(o[i]=a)}let s=[];for(r in t)if(t.hasOwnProperty(r)){if(Kke.hasOwnProperty(r))continue;i=r,n&&r==="normalEC"?i="normalMC":n&&r==="tangentEC"&&(i="tangentMC"),e.hasOwnProperty(i)||s.push(r)}return{addToShader:o,missingAttributes:s}}function Jke(e,t){let n={enabled:!1},i={enabled:!1},r=Gke(t.attributes);u(e.vertexShaderText)&&qke(e,r,n),u(e.fragmentShaderText)&&Xke(e,r,i);let s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:s}}function Zke(e,t){let n,i=ns.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,ns.STRUCT_NAME_ATTRIBUTES,be.VERTEX);let r=t.attributeFields;for(n=0;n<r.length;n++){let a=r[n],c=a[0],l=a[1];e.addStructField(i,c,l)}i=ns.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,ns.STRUCT_NAME_VERTEX_INPUT,be.VERTEX),e.addStructField(i,ns.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Hg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,cf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,cf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,cf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ns.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,ns.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,be.VERTEX);let s=t.initializationLines;e.addFunctionLines(o,s)}function Qke(e,t){let n,i=ns.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,ns.STRUCT_NAME_ATTRIBUTES,be.FRAGMENT);let r,o,s,a=t.attributeFields;for(n=0;n<a.length;n++)r=a[n],o=r[0],s=r[1],e.addStructField(i,o,s);i=ns.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,ns.STRUCT_NAME_FRAGMENT_INPUT,be.FRAGMENT),e.addStructField(i,ns.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Hg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,cf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,cf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,cf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let c=ns.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,ns.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,be.FRAGMENT);let l=t.initializationLines;e.addFunctionLines(c,l)}var $ke=[];function e4e(e,t,n){let i=n.vertexLines,r=$ke;i.enabled&&(Zke(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,DO),e.addVertexLines(r));let o=n.fragmentLines;o.enabled&&(Qke(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,IO),e.addFragmentLines(r))}var BO=ns;var LO={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};LO.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=u(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,be.VERTEX),i.addFunction(LO.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,LO.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,be.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],l=c.quantization;if(!u(l))continue;let f=c.semantic===Et.POSITION,d=c.semantic===Et.TEXCOORD;if(o&&!f&&!d)continue;let p=Zt.getAttributeInfo(c);n4e(i,p),t4e(e,p)}};function t4e(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,be.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,be.VERTEX),n.addUniform(c,a,be.VERTEX);let l=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(l=Kre(l,0),f=Kre(f,1)),i[s]=function(){return l},i[a]=function(){return f}}}function Kre(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function n4e(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=i4e(n,i):r=r4e(n),e.addFunctionLines(LO.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function i4e(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function r4e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var NO=LO;var FO=`void geometryStage(out ProcessedAttributes attributes) -{ - attributes.positionMC = v_positionMC; - attributes.positionEC = v_positionEC; - - #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER - attributes.positionWC = v_positionWC; - #endif +`,r};Ad.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Ad.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var _Oe=["!","-","+"],qte=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],Vk=/\${(.*?)}/g,gOe=/\\/g,yOe="@#%",xOe=/@#%/g,zk=new z,Hk={abs:Is(Math.abs),sqrt:Is(Math.sqrt),cos:Is(Math.cos),sin:Is(Math.sin),tan:Is(Math.tan),acos:Is(Math.acos),asin:Is(Math.asin),atan:Is(Math.atan),radians:Is(D.toRadians),degrees:Is(D.toDegrees),sign:Is(D.sign),floor:Is(Math.floor),ceil:Is(Math.ceil),round:Is(Math.round),exp:Is(Math.exp),exp2:Is(COe),log:Is(Math.log),log2:Is(TOe),fract:Is(bOe),length:AOe,normalize:EOe},Gk={atan2:kk(Math.atan2,!1),pow:kk(Math.pow,!1),min:kk(Math.min,!0),max:kk(Math.max,!0),distance:SOe,dot:vOe,cross:wOe},W5={clamp:Yte(D.clamp,!0),mix:Yte(D.lerp,!0)};function bOe(e){return e-Math.floor(e)}function COe(e){return Math.pow(2,e)}function TOe(e){return D.log2(e)}function Is(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Mn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Mn.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Mn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function kk(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof H)return H.fromElements(e(i.x,r),e(i.y,r),Mn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Mn.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Mn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x),e(i.y,r.y),Mn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Mn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Mn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function Yte(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Mn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Mn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Mn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof H&&r instanceof H&&o instanceof H)return H.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Mn.getCartesian2());if(i instanceof m&&r instanceof m&&o instanceof m)return m.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Mn.getCartesian3());if(i instanceof oe&&r instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Mn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function AOe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function EOe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Mn.getCartesian2());if(t instanceof m)return m.normalize(t,Mn.getCartesian3());if(t instanceof oe)return oe.normalize(t,Mn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function SOe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function vOe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function wOe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Mn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function bt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,VOe(this)}function IOe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function POe(e){return e.replace(gOe,yOe)}function G5(e){return e.replace(xOe,"\\")}function DOe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new de("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function ROe(e){let t=typeof e.value;if(e.value===null)return new bt(yt.LITERAL_NULL,null);if(t==="boolean")return new bt(yt.LITERAL_BOOLEAN,e.value);if(t==="number")return new bt(yt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new bt(yt.VARIABLE_IN_STRING,e.value):new bt(yt.LITERAL_STRING,G5(e.value))}function OOe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${r} is not a function.`);return i===0?r==="test"?new bt(yt.LITERAL_BOOLEAN,!1):new bt(yt.LITERAL_NULL,null):(s=Ei(e,c),a=Ei(e,n[0]),new bt(yt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ei(e,c),new bt(yt.FUNCTION_CALL,r,o);throw new de(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new bt(yt.LITERAL_COLOR,r);if(o=Ei(e,n[0]),l(n[1])){let c=Ei(e,n[1]);return new bt(yt.LITERAL_COLOR,r,[o,c])}return new bt(yt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new de(`${r} requires three arguments.`);return o=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2])],new bt(yt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new de(`${r} requires four arguments.`);return o=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2]),Ei(e,n[3])],new bt(yt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Ei(e,n[c]);return new bt(yt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new bt(yt.LITERAL_BOOLEAN,!0):new bt(yt.LITERAL_BOOLEAN,!1):(o=Ei(e,n[0]),new bt(yt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new de(`${r} requires exactly one argument.`);return o=Ei(e,n[0]),new bt(yt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new de(`${r} does not take any argument.`);return new bt(yt.UNARY,r)}else if(l(Hk[r])){if(i!==1)throw new de(`${r} requires exactly one argument.`);return o=Ei(e,n[0]),new bt(yt.UNARY,r,o)}else if(l(Gk[r])){if(i!==2)throw new de(`${r} requires exactly two arguments.`);return s=Ei(e,n[0]),a=Ei(e,n[1]),new bt(yt.BINARY,r,s,a)}else if(l(W5[r])){if(i!==3)throw new de(`${r} requires exactly three arguments.`);s=Ei(e,n[0]),a=Ei(e,n[1]);let c=Ei(e,n[2]);return new bt(yt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new bt(yt.LITERAL_BOOLEAN,!1):(o=Ei(e,n[0]),new bt(yt.UNARY,r,o));if(r==="Number")return i===0?new bt(yt.LITERAL_NUMBER,0):(o=Ei(e,n[0]),new bt(yt.UNARY,r,o));if(r==="String")return i===0?new bt(yt.LITERAL_STRING,""):(o=Ei(e,n[0]),new bt(yt.UNARY,r,o));if(r==="regExp")return MOe(e,t)}}throw new de(`Unexpected function call "${r}".`)}function MOe(e,t){let n=t.arguments;if(n.length===0)return new bt(yt.LITERAL_REGEX,new RegExp);let i=Ei(e,n[0]),r;if(n.length>1){let o=Ei(e,n[1]);if(H5(i)&&H5(o)){try{r=new RegExp(G5(String(i._value)),o._value)}catch(s){throw new de(s)}return new bt(yt.LITERAL_REGEX,r)}return new bt(yt.REGEX,i,o)}if(H5(i)){try{r=new RegExp(G5(String(i._value)))}catch(o){throw new de(o)}return new bt(yt.LITERAL_REGEX,r)}return new bt(yt.REGEX,i)}function LOe(e){if(kOe(e.name)){let t=UOe(e.name);return t.substr(0,8)==="tiles3d_"?new bt(yt.BUILTIN_VARIABLE,t):new bt(yt.VARIABLE,t)}else{if(e.name==="NaN")return new bt(yt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new bt(yt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new bt(yt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function NOe(e){let t=e.property.name;if(t==="PI")return new bt(yt.LITERAL_NUMBER,Math.PI);if(t==="E")return new bt(yt.LITERAL_NUMBER,Math.E)}function FOe(e){if(e.property.name==="POSITIVE_INFINITY")return new bt(yt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function BOe(e,t){if(t.object.name==="Math")return NOe(t);if(t.object.name==="Number")return FOe(t);let n,i=Ei(e,t.object);return t.computed?(n=Ei(e,t.property),new bt(yt.MEMBER,"brackets",i,n)):(n=new bt(yt.LITERAL_STRING,t.property.name),new bt(yt.MEMBER,"dot",i,n))}function H5(e){return e._type>=yt.LITERAL_NULL}function kOe(e){return e.substr(0,4)==="czm_"}function UOe(e){return e.substr(4)}function Ei(e,t){let n,i,r,o;if(t.type==="Literal")n=ROe(t);else if(t.type==="CallExpression")n=OOe(e,t);else if(t.type==="Identifier")n=LOe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ei(e,t.argument);if(_Oe.indexOf(i)>-1)n=new bt(yt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Ei(e,t.left),o=Ei(e,t.right),qte.indexOf(i)>-1)n=new bt(yt.BINARY,i,r,o);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Ei(e,t.left),o=Ei(e,t.right),qte.indexOf(i)>-1&&(n=new bt(yt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ei(e,t.test);r=Ei(e,t.consequent),o=Ei(e,t.alternate),n=new bt(yt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=BOe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ei(e,t.elements[a]);n=new bt(yt.ARRAY,s)}else throw t.type==="Compound"?new de("Provide exactly one expression."):new de("Cannot parse expression.");return n}function VOe(e){e._type===yt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===yt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===yt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(Hk[e._value])&&(e.evaluate=HOe(e._value)):e._type===yt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(Gk[e._value])&&(e.evaluate=GOe(e._value)):e._type===yt.TERNARY?e.evaluate=WOe(e._value):e._type===yt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===yt.ARRAY?e.evaluate=e._evaluateArray:e._type===yt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===yt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===yt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===yt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===yt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===yt.REGEX?e.evaluate=e._evaluateRegExp:e._type===yt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=zOe):e.evaluate=e._evaluateLiteral}function zOe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function HOe(e){let t=Hk[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function GOe(e){let t=Gk[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function WOe(e){let t=W5[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function Wk(e,t){if(l(e))return e.getPropertyInherited(t)}bt.prototype._evaluateLiteral=function(){return this._value};bt.prototype._evaluateLiteralColor=function(e){let t=zk,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Mn.getCartesian4())};bt.prototype._evaluateLiteralVector=function(e){let t=Mn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof H)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new de(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new de(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Mn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Mn.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Mn.getCartesian4())};bt.prototype._evaluateLiteralString=function(){return this._value};bt.prototype._evaluateVariableString=function(e){let t=this._value,n=Vk.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=Wk(e,r);l(o)||(o=""),t=t.replace(i,o),n=Vk.exec(t)}return t};bt.prototype._evaluateVariable=function(e){return Wk(e,this._value)};function px(e){return e._value==="feature"}bt.prototype._evaluateMemberDot=function(e){if(px(this._left))return Wk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};bt.prototype._evaluateMemberBrackets=function(e){if(px(this._left))return Wk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};bt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof H)return H.negate(t,Mn.getCartesian2());if(t instanceof m)return m.negate(t,Mn.getCartesian3());if(t instanceof oe)return oe.negate(t,Mn.getCartesian4());if(typeof t=="number")return-t;throw new de(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof H||t instanceof m||t instanceof oe||typeof t=="number"))throw new de(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};bt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};bt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};bt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};bt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};bt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};bt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Mn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Mn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Mn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Mn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Mn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Mn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Mn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Mn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Mn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Mn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Mn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Mn.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Mn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Mn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Mn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Mn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Mn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Mn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Mn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Mn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?t.equals(n):t===n};bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};bt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};bt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new de(r)}return i};bt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};bt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof oe)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function Xte(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==yt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,zk)}function Kte(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==yt.LITERAL_NUMBER)return;let i=zk;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function Tg(e){return e%1===0?e.toFixed(1):e.toString()}function jOe(e){let t=Tg(e.red),n=Tg(e.green),i=Tg(e.blue);return`vec3(${t}, ${n}, ${i})`}function Uk(e){let t=Tg(e.red),n=Tg(e.green),i=Tg(e.blue),r=Tg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Jte(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function Zte(e,t){return l(t[e])?t[e]:Ad.NULL_SENTINEL}Ad.NULL_SENTINEL="czm_infinity";bt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=Jte(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Jte(this._value,e,t,this));let u,f,d;switch(a){case yt.VARIABLE:return px(this)?void 0:Zte(c,e);case yt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(Hk[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new de(`Error generating style shader: "${c}" is not supported.`);return c+r;case yt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(Gk[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case yt.TERNARY:if(l(W5[c]))return`${c}(${r}, ${o}, ${s})`;break;case yt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case yt.MEMBER:return px(this._left)?Zte(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case yt.FUNCTION_CALL:throw new de(`Error generating style shader: "${c}" is not supported.`);case yt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new de("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case yt.REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case yt.VARIABLE_IN_STRING:throw new de("Error generating style shader: Converting a variable to a string is not supported.");case yt.LITERAL_NULL:return Ad.NULL_SENTINEL;case yt.LITERAL_BOOLEAN:return c?"true":"false";case yt.LITERAL_NUMBER:return Tg(c);case yt.LITERAL_STRING:if(l(n)&&n._type===yt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||px(n._left)))return c;if(i=z.fromCssColorString(c,zk),l(i))return jOe(i);throw new de("Error generating style shader: String literals are not supported.");case yt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Kte(this),l(i)?Uk(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Kte(this),l(i)?Uk(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Xte(this),l(i)?Uk(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Xte(this),l(i)?(i.alpha!==1&&(t.translucent=!0),Uk(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case yt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case yt.LITERAL_REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case yt.LITERAL_UNDEFINED:return Ad.NULL_SENTINEL;case yt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};bt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case yt.VARIABLE:px(this)||e.push(s);break;case yt.VARIABLE_IN_STRING:for(a=Vk.exec(s);a!==null;)e.push(a[1]),a=Vk.exec(s);break;case yt.LITERAL_STRING:l(t)&&t._type===yt.MEMBER&&px(t._left)&&e.push(s);break}};var rf=Ad;function Ap(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,m.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,Gn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Ap.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var qOe={position:0,a_batchId:1};function YOe(e,t){if(l(e._va))return;let n=mt.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=mt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),r=mt.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Be.UNSIGNED_SHORT:Be.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new si({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new si({context:t,attributes:o,indexBuffer:mt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function XOe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,qOe),r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Jt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=ze.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${r}; +} +`,e._spPick=Jt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(OT),c=n.getFragmentShaderCallback(!1,void 0,!0)(fg);r=n.getPickId();let u=new ze({sources:[a]}),f=new ze({defines:["VECTOR_TILE"],sources:[c]});e._sp=Jt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new ze({sources:[OT]}),f=new ze({defines:["VECTOR_TILE"],sources:[fg]}),e._spStencil=Jt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=ze.replaceMain(c,"czm_non_pick_main"),c=`${c} +void main() +{ + czm_non_pick_main(); + out_FragColor = ${r}; +} +`;let d=new ze({sources:[a]}),p=new ze({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Jt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function $te(e){let t=e?Wn.EQUAL:Wn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}var KOe={stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},JOe={stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function ZOe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ue.fromCache($te(!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache($te(!0)),e._rsColorPass=Ue.fromCache(KOe),e._rsPickPass=Ue.fromCache(JOe))}var _x=new F,Qte=new m;function $Oe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return F.clone(i,_x),F.multiplyByPoint(_x,e._center,Qte),F.setTranslation(_x,Qte,_x),F.multiply(r,_x,_x),_x},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function j5(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],h=new e.constructor(e.buffer,a*p,g);t.set(h,n),i[d]=n,n+=g}return n}function QOe(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=j5(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=j5(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=j5(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function q5(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function eMe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=q5(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=q5(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=q5(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function tMe(e,t){return t.color.toRgba()-e.color.toRgba()}function nMe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(tMe),t.webgl2?eMe(e,n):QOe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function iMe(e,t){let n=nMe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,F.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,h=r[p].count,x=i[p*2];l(x)||(x=i[p*2]=new tt({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=h,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=Ee.TERRAIN_CLASSIFICATION;let b=tt.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new tt({owner:e})),C.vertexArray=a,C.modelMatrix=u,C.offset=g,C.count=h,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=d,C.cull=!1,C.pass=Ee.TERRAIN_CLASSIFICATION;let A=tt.shallowClone(C,C.derivedCommands.tileset);A.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=A}e._commandsDirty=!0}function rMe(e,t){if(e.classificationType===Gn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=tt.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function oMe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=y(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new tt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ee.TERRAIN_CLASSIFICATION;let g=tt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let h=n[c*2+1];l(h)||(h=n[c*2+1]=new tt({owner:e,pickOnly:!0})),h.vertexArray=i,h.modelMatrix=s,h.offset=u,h.count=f,h.renderState=e._rsPickPass,h.shaderProgram=o,h.uniformMap=a,h.boundingVolume=d,h.pass=Ee.TERRAIN_CLASSIFICATION;let x=tt.shallowClone(h,h.derivedCommands.tileset);x.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Ap.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ws(e,o)}};Ap.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function sMe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var aMe=new z,cMe=z.WHITE,lMe=!0,uMe=/\$/;Ap.prototype.applyStyle=function(e,t){if(!l(e)){sMe(this,t);return}let n=e.color,i=n instanceof rf&&!uMe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,aMe):cMe,c.show=l(e.show)?e.show.evaluate(c):lMe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Ap.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new qm({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,h=g.length;for(let x=0;x<h;++x){let b=g[x];if(b===e)continue;let C=n[b];r[C]<s?d.push(b):p.push(b)}p.length!==0&&c.push(new qm({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function ene(e,t,n,i){let r=e.classificationType,o=r!==Gn.CESIUM_3D_TILE,s=r!==Gn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ee.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function fMe(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ee.OPAQUE,n.push(o)}}function dMe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ue.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Le.LINES):(n=e._rsColorPass,i=Le.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Ap.prototype.update=function(e){let t=e.context;YOe(this,t),XOe(this,t),ZOe(this),$Oe(this,t);let n=e.passes;n.render&&(iMe(this,t),rMe(this,e),dMe(this),this._debugWireframe?fMe(e,this._commands):ene(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(oMe(this),ene(this,e,this._pickCommands))};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var gx=Ap;function iu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Gn.BOTH}Object.defineProperties(iu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});iu.packedBoxLength=F.packedLength+m.packedLength;iu.packedCylinderLength=F.packedLength+2;iu.packedEllipsoidLength=F.packedLength+m.packedLength;iu.packedSphereLength=m.packedLength+1;function mMe(e){let t=new Float64Array(F.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,F.pack(e._modelMatrix,t,n),t}function hMe(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let h=0;h<p;++h)g[h]=t[n++];a[c]=new qm({color:u,offset:f,count:d,batchIds:g})}return i}var pMe=new bi("createVectorTileGeometries",5),_Me=new z;function gMe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let h=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),h+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),h+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),h+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),h+=c.length),u=e._batchTableColors=new Uint32Array(h);let x=e._batchTable;for(let b=0;b<h;++b){let C=x.getColor(b,_Me);u[b]=C.toRgba()}f=e._packedBuffer=mMe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=pMe.scheduleTask(p,d);return l(g)?g.then(function(h){if(e.isDestroyed())return;let x=new Float64Array(h.packedBuffer);hMe(e,x)===2?e._indices=new Uint16Array(h.indices):e._indices=new Uint32Array(h.indices),e._indexOffsets=new Uint32Array(h.indexOffsets),e._indexCounts=new Uint32Array(h.indexCounts),e._positions=new Float32Array(h.positions),e._vertexBatchIds=new Uint16Array(h.vertexBatchIds),e._batchIds=new Uint16Array(h.batchIds),yMe(e),e._ready=!0}).catch(h=>{e.isDestroyed()||(e._error=h)}):void 0}}function yMe(e){l(e._primitive)||(e._primitive=new gx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}iu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};iu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};iu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};iu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};iu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=gMe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Ep=iu;function Sp(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),CMe(this,i,r)}Object.defineProperties(Sp.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function xMe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function bMe(e,t){let n,i,r,o,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=h++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=h++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=h++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=h++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var yx=Uint32Array.BYTES_PER_ELEMENT;function CMe(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=yx;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=yx;let s=r.getUint32(n,!0);if(n+=yx,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=yx,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=yx;let u=r.getUint32(n,!0);n+=yx;let f=r.getUint32(n,!0);n+=yx;let d=Lr(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,h;u>0&&(g=Lr(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let x=y(d.BOXES_LENGTH,0),b=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),A=y(d.SPHERES_LENGTH,0),T=x+b+C+A,S=new Tp(e,T,g,h,xMe(e));if(e._batchTable=S,T===0)return;let v=e.tile.computedTransform,I;l(d.RTC_CENTER)&&(I=m.unpack(d.RTC_CENTER),F.multiplyByPoint(v,I,I));let O=bMe(d,p);if(x>0||b>0||C>0||A>0){let R,L,N,_;if(x>0){let E=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,E,Ep.packedBoxLength*x)}if(b>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,E,Ep.packedCylinderLength*b)}if(C>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,E,Ep.packedEllipsoidLength*C)}if(A>0){let E=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,E,Ep.packedSphereLength*A)}return e._geometries=new Ep({boxes:R,boxBatchIds:O.boxes,cylinders:L,cylinderBatchIds:O.cylinders,ellipsoids:N,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:I,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function tne(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Sp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Sp.prototype.getFeature=function(e){return tne(this),this._features[e]};Sp.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Sp.prototype.applyStyle=function(e){tne(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Sp.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Sp.prototype.isDestroyed=function(){return!1};Sp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var jP=Sp;var Y5={};Y5.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),nne(i,r,o,s);return c};Y5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),nne(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function nne(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var MT=Y5;var xx=30,TMe=1<<xx,AMe=1<<xx+1>>>0,X5=2*xx+1,Ag=4,one=[],sne=[],EMe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Eg=1,LT=2,jk=[Eg,0,0,Eg|LT];function jo(e){if(!Wt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=jo.getLevel(e)}jo.fromToken=function(e){return new jo(jo.getIdFromToken(e))};jo.isValidId=function(e){return!(e<=0||e>>BigInt(X5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};jo.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?jo.isValidId(jo.getIdFromToken(e)):!1};jo.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};jo.getTokenFromId=function(e){let t=Math.floor(LMe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};jo.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return xx-(t>>1)};jo.prototype.getChild=function(e){let t=lne(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new jo(n)};jo.prototype.getParent=function(){let e=lne(this._cellId)<<BigInt(2);return new jo(this._cellId&~e+BigInt(1)|e)};jo.prototype.getParentAtLevel=function(e){let t=OMe(e);return new jo(this._cellId&-t|t)};jo.prototype.getCenter=function(e){e=y(e,re.WGS84);let t=SMe(this._cellId,this._level);t=m.normalize(t,t);let n=new me.fromCartesian(t,re.UNIT_SPHERE);return me.toCartesian(n,e,new m)};jo.prototype.getVertex=function(e,t){t=y(t,re.WGS84);let n=vMe(this._cellId,this._level,e);n=m.normalize(n,n);let i=new me.fromCartesian(n,re.UNIT_SPHERE);return me.toCartesian(i,t,new m)};jo.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(X5-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new jo(a)};function SMe(e,t){let n=wMe(e,t);return IMe(n[0],n[1],n[2])}function vMe(e,t,n){let i=ane(e,t),r=PMe([i[1],i[2]],t),o=n>>1&1;return cne(i[0],r[0][o^n&1],r[1][o])}function wMe(e,t){let n=ane(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function ane(e){one.length===0&&RMe();let t=Number(e>>BigInt(X5)),n=t&Eg,i=(1<<Ag)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?xx-7*Ag:Ag))-1;n+=Number(e>>BigInt(s*2*Ag+1)&BigInt(c))<<2,n=sne[n];let u=s*Ag;r+=n>>Ag+2<<u,o+=(n>>2&i)<<u,n&=Eg|LT}return[t,r,o]}function IMe(e,t,n){let i=ine(t),r=ine(n),o=qk(i),s=qk(r);return cne(e,o,s)}function cne(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function qk(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ine(e){return 1/AMe*e}function PMe(e,t){let n=[[],[]],i=DMe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=qk(rne(o)),n[r][1]=qk(rne(s))}return n}function DMe(e){return 1<<xx-e>>>0}function rne(e){return 1/TMe*e}function Sg(e,t,n,i,r,o){if(e===Ag){let s=(t<<Ag)+n;one[(s<<2)+i]=(r<<2)+o,sne[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=EMe[o];Sg(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^jk[0]),Sg(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^jk[1]),Sg(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^jk[2]),Sg(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^jk[3])}}function RMe(){Sg(0,0,0,0,0,0),Sg(0,0,0,Eg,0,Eg),Sg(0,0,0,LT,0,LT),Sg(0,0,0,Eg|LT,0,Eg|LT)}function lne(e){return e&~e+BigInt(1)}function OMe(e){return BigInt(1)<<BigInt(2*(xx-e))}var MMe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function LMe(e){return MMe[(-e&e)%BigInt(67)]}var vp=jo;function NMe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ii=NMe;function K5(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new de(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=FMe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function FMe(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(K5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});K5.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var NT=K5;function wp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};wp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};wp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};wp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};wp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};wp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};wp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var FT=wp;var Yk={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};Yk.getBranchingFactor=function(e){switch(e){case Yk.OCTREE:return 8;case Yk.QUADTREE:return 4}};var qo=Object.freeze(Yk);function $s(){}Object.defineProperties($s.prototype,{class:{get:function(){fe.throwInstantiationError()}}});$s.prototype.hasProperty=function(e){fe.throwInstantiationError()};$s.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};$s.prototype.getProperty=function(e){fe.throwInstantiationError()};$s.prototype.setProperty=function(e,t){fe.throwInstantiationError()};$s.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};$s.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};$s.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};$s.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};$s.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};$s.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=je(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};$s.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;l(o)&&(r=o[e]);let s=!0;return l(r)&&(t=r.packVectorAndMatrixTypes(t,s),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};$s.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return $s.getProperty(r.id,t,n)};$s.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?$s.setProperty(o.id,t,n,i):!1};var kn=$s;function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ip.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ip.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ip.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ip.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ip.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Ip.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Ip.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Ip.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var qP=Ip;var Dt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Dt.getMinimum=function(e){switch(e){case Dt.INT8:return-128;case Dt.UINT8:return 0;case Dt.INT16:return-32768;case Dt.UINT16:return 0;case Dt.INT32:return-2147483648;case Dt.UINT32:return 0;case Dt.INT64:return Wt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Dt.UINT64:return Wt.supportsBigInt()?BigInt(0):0;case Dt.FLOAT32:return-34028234663852886e22;case Dt.FLOAT64:return-Number.MAX_VALUE}};Dt.getMaximum=function(e){switch(e){case Dt.INT8:return 127;case Dt.UINT8:return 255;case Dt.INT16:return 32767;case Dt.UINT16:return 65535;case Dt.INT32:return 2147483647;case Dt.UINT32:return 4294967295;case Dt.INT64:return Wt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Dt.UINT64:return Wt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Dt.FLOAT32:return 34028234663852886e22;case Dt.FLOAT64:return Number.MAX_VALUE}};Dt.isIntegerType=function(e){switch(e){case Dt.INT8:case Dt.UINT8:case Dt.INT16:case Dt.UINT16:case Dt.INT32:case Dt.UINT32:case Dt.INT64:case Dt.UINT64:return!0;default:return!1}};Dt.isUnsignedIntegerType=function(e){switch(e){case Dt.UINT8:case Dt.UINT16:case Dt.UINT32:case Dt.UINT64:return!0;default:return!1}};Dt.isVectorCompatible=function(e){switch(e){case Dt.INT8:case Dt.UINT8:case Dt.INT16:case Dt.UINT16:case Dt.INT32:case Dt.UINT32:case Dt.FLOAT32:case Dt.FLOAT64:return!0;default:return!1}};Dt.normalize=function(e,t){return Math.max(Number(e)/Number(Dt.getMaximum(t)),-1)};Dt.unnormalize=function(e,t){let n=Dt.getMaximum(t),i=Dt.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Dt.INT64||t===Dt.UINT64)&&Wt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Dt.applyValueTransform=function(e,t,n){return n*e+t};Dt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Dt.getSizeInBytes=function(e){switch(e){case Dt.INT8:case Dt.UINT8:return 1;case Dt.INT16:case Dt.UINT16:return 2;case Dt.INT32:case Dt.UINT32:return 4;case Dt.INT64:case Dt.UINT64:return 8;case Dt.FLOAT32:return 4;case Dt.FLOAT64:return 8}};Dt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Dt.INT8;case X.UNSIGNED_BYTE:return Dt.UINT8;case X.SHORT:return Dt.INT16;case X.UNSIGNED_SHORT:return Dt.UINT16;case X.INT:return Dt.INT32;case X.UNSIGNED_INT:return Dt.UINT32;case X.FLOAT:return Dt.FLOAT32;case X.DOUBLE:return Dt.FLOAT64}};Dt.toComponentDatatype=function(e){switch(e){case Dt.INT8:return X.BYTE;case Dt.UINT8:return X.UNSIGNED_BYTE;case Dt.INT16:return X.SHORT;case Dt.UINT16:return X.UNSIGNED_SHORT;case Dt.INT32:return X.INT;case Dt.UINT32:return X.UNSIGNED_INT;case Dt.FLOAT32:return X.FLOAT;case Dt.FLOAT64:return X.DOUBLE}};var rn=Object.freeze(Dt);var kr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};kr.isVectorType=function(e){switch(e){case kr.VEC2:case kr.VEC3:case kr.VEC4:return!0;default:return!1}};kr.isMatrixType=function(e){switch(e){case kr.MAT2:case kr.MAT3:case kr.MAT4:return!0;default:return!1}};kr.getComponentCount=function(e){switch(e){case kr.SCALAR:case kr.STRING:case kr.ENUM:case kr.BOOLEAN:return 1;case kr.VEC2:return 2;case kr.VEC3:return 3;case kr.VEC4:return 4;case kr.MAT2:return 4;case kr.MAT3:return 9;case kr.MAT4:return 16}};kr.getMathType=function(e){switch(e){case kr.VEC2:return H;case kr.VEC3:return m;case kr.VEC4:return oe;case kr.MAT2:return ir;case kr.MAT3:return $;case kr.MAT4:return F;default:return}};var qt=Object.freeze(kr);function ba(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&rn.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=je(e.min,!0),this._max=je(e.max,!0),this._normalized=o;let s=je(e.offset,!0),a=je(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=je(e.noData,!0),this._default=je(e.default,!0),this._required=y(e.required,!0),this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}ba.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=BMe(n),r=kMe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=y(n.required,!1):o=!1,new ba({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(ba.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function BMe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===qt.SCALAR||qt.isMatrixType(t)||qt.isVectorType(t))return!1;if(l(rn[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function kMe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===qt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===qt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===qt.SCALAR||qt.isMatrixType(n)||qt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===qt.BOOLEAN||n===qt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===qt.BOOLEAN||i===qt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(rn[i]))return{type:qt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(rn[n]))return{type:qt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}ba.prototype.normalize=function(e){return this._normalized?J5(e,this._valueType,rn.normalize):e};ba.prototype.unnormalize=function(e){return this._normalized?J5(e,this._valueType,rn.unnormalize):e};ba.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ba.valueTransformInPlace(e,this._offset,this._scale,rn.applyValueTransform)};ba.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ba.valueTransformInPlace(e,this._offset,this._scale,rn.unapplyValueTransform)};ba.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,r=qt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};ba.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!mne(e,t))return e};function mne(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!mne(e[n],t[n]))return!1;return!0}ba.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,r=qt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};ba.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,r=qt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};ba.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?UMe(this,e):hne(this,e)};function UMe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=hne(e,t[i]);if(l(r))return r}}function hne(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return qt.isVectorType(n)?VMe(t,n,i):qt.isMatrixType(n)?zMe(t,n,i):n===qt.STRING?HMe(t):n===qt.BOOLEAN?GMe(t):n===qt.ENUM?WMe(t,r):jMe(t,i,o)}function VMe(e,t,n){if(!rn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===qt.VEC2&&!(e instanceof H))return`vector value ${e} must be a Cartesian2`;if(t===qt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===qt.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function zMe(e,t,n){if(!rn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===qt.MAT2&&!(e instanceof ir))return`matrix value ${e} must be a Matrix2`;if(t===qt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===qt.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function HMe(e){if(typeof e!="string")return Xk(e,qt.STRING)}function GMe(e){if(typeof e!="boolean")return Xk(e,qt.BOOLEAN)}function WMe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function jMe(e,t,n){let i=typeof e;switch(t){case rn.INT8:case rn.UINT8:case rn.INT16:case rn.UINT16:case rn.INT32:case rn.UINT32:case rn.FLOAT32:case rn.FLOAT64:return i!=="number"?Xk(e,t):isFinite(e)?fne(e,t,n):dne(e,t);case rn.INT64:case rn.UINT64:return i!=="number"&&i!=="bigint"?Xk(e,t):i==="number"&&!isFinite(e)?dne(e,t):fne(e,t,n)}}function Xk(e,t){return`value ${e} does not match type ${t}`}function une(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function fne(e,t,n){if(n){let i=rn.isUnsignedIntegerType(t)?0:-1,r=1;return e<i||e>r?une(e,t,n):void 0}if(e<rn.getMinimum(t)||e>rn.getMaximum(t))return une(e,t,n)}function dne(e,t){return`value ${e} of type ${t} must be finite`}function J5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=J5(e[i],t,n);return e}ba.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=ba.valueTransformInPlace(e[r],t[r],n[r],i);return e};var vg=ba;function YP(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===qt.STRING,d=o===qt.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(rn[_],rn.UINT32);let E=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new Z5(r[E],_,t+1),p+=g.typedArray.byteLength}let h=qt.getComponentCount(o),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let b=h*x,C;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(rn[_],rn.UINT32);let E=y(n.stringOffsets,n.stringOffsetBufferView);C=new Z5(r[E],_,b+1),p+=C.typedArray.byteLength}(f||d)&&(c=rn.UINT8);let A;f?A=C.get(b)-C.get(0):d?A=Math.ceil(b/8):A=b;let T=y(n.values,n.bufferView),S=new Z5(r[T],c,A);p+=S.typedArray.byteLength;let v=n.offset,I=n.scale,O=i.hasValueTransform||l(v)||l(I);v=y(v,i.offset),I=y(I,i.scale),v=pne(v),I=pne(I);let R,L,N=this;f?R=function(_){return XMe(_,N._values,N._stringOffsets)}:d?(R=function(_){return KMe(_,N._values)},L=function(_,E){JMe(_,N._values,E)}):l(u)?(R=function(_){let E=N._values.get(_);return u.namesByValue[E]},L=function(_,E){let w=u.valuesByName[E];N._values.set(_,w)}):(R=function(_){return N._values.get(_)},L=function(_,E){N._values.set(_,E)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=h,this._min=n.min,this._max=n.max,this._offset=v,this._scale=I,this._hasValueTransform=O,this._getValue=R,this._setValue=L,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(YP.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});YP.prototype.get=function(e){let t=qMe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=rLe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};YP.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=oLe(this,t),t=n.unnormalize(t),YMe(this,e,t)};YP.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function pne(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function qMe(e,t){gne(e)&&yne(e);let n=e._classProperty,i=n.isArray,r=n.type,o=qt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?je(s,!0):s}return!i&&o===1?e._getValue(t):_ne(e,n,t)}function _ne(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=qt.getComponentCount(t.type);i*=s,r*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function YMe(e,t,n){nLe(e,t,n)&&yne(e);let i=e._classProperty,r=i.isArray,o=i.type,s=qt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=je(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function XMe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return pl(t.typedArray,i,r)}function KMe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function JMe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function ZMe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function $Me(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function QMe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function eLe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function tLe(e){switch(e){case rn.INT8:return X.BYTE;case rn.UINT8:return X.UNSIGNED_BYTE;case rn.INT16:return X.SHORT;case rn.UINT16:return X.UNSIGNED_SHORT;case rn.INT32:return X.INT;case rn.UINT32:return X.UNSIGNED_INT;case rn.FLOAT32:return X.FLOAT;case rn.FLOAT64:return X.DOUBLE}}function gne(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===qt.STRING||i===rn.INT64&&!Wt.supportsBigInt64Array()||i===rn.UINT64&&!Wt.supportsBigUint64Array()}function nLe(e,t,n){if(gne(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function yne(e){e._unpackedValues=iLe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function iLe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=qt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=_ne(e,i,a);return n}function rLe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vg.valueTransformInPlace(t,e._offset,e._scale,rn.applyValueTransform)}function oLe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vg.valueTransformInPlace(t,e._offset,e._scale,rn.unapplyValueTransform)}function Z5(e,t,n){let i=this,r,o,s;if(t===rn.INT64)Wt.supportsBigInt()?Wt.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return $Me(a,i)}):(Nt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return ZMe(a,i)});else if(t===rn.UINT64)Wt.supportsBigInt()?Wt.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return eLe(a,i)}):(Nt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return QMe(a,i)});else{let a=tLe(t);r=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var XP=YP;function Ed(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new XP({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Ed.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Ed.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ed.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ed.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ed.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=sLe(this._class,t),i};Ed.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Ed.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Ed.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Ed.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Ed.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function sLe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=je(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var gl=Ed;function wg(){}Object.defineProperties(wg.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});wg.prototype.load=function(){fe.throwInstantiationError()};wg.prototype.unload=function(){};wg.prototype.process=function(e){return!1};wg.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` +${t.message}`);let n=new de(e);return l(t)&&(n.stack=`Original stack: +${t.stack} +Handler stack: +${n.stack}`),n};wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){return this.unload(),ue(this)};var cr=wg;var aLe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},wt=Object.freeze(aLe);function Pp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Pp.prototype=Object.create(cr.prototype),Pp.prototype.constructor=Pp);Object.defineProperties(Pp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Pp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=cLe(this),this._promise)};async function cLe(e){let t=e._resource;e._state=wt.LOADING;try{let n=await Pp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=wt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=wt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Pp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Pp.prototype.unload=function(){this._typedArray=void 0};var bx=Pp;var Ene=Ki(Ane(),1);function Cx(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,h,x;if(ii(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,x=y(C.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Cx.prototype=Object.create(cr.prototype),Cx.prototype.constructor=Cx);Object.defineProperties(Cx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function dLe(e){try{let t=mLe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);Ene.MeshoptDecoder.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=wt.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}Cx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=dLe(this),this._promise)};function mLe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}Cx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var BT=Cx;function Xa(){}Xa._maxDecodingConcurrency=Math.max(Wt.hardwareConcurrency-1,1);Xa._decoderTaskProcessor=void 0;Xa._taskProcessorReady=!1;Xa._getDecoderTaskProcessor=function(){if(!l(Xa._decoderTaskProcessor)){let e=new bi("decodeDraco",Xa._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Xa._taskProcessorReady=!0}),Xa._decoderTaskProcessor=e}return Xa._decoderTaskProcessor};Xa.decodePointCloud=function(e){let t=Xa._getDecoderTaskProcessor();if(Xa._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Xa.decodeBufferView=function(e){let t=Xa._getDecoderTaskProcessor();if(Xa._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Dp=Xa;function Ig(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=wt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Ig.prototype=Object.create(cr.prototype),Ig.prototype.constructor=Ig);Object.defineProperties(Ig.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function hLe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=wt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Sne(e,n)}}Ig.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=hLe(this),this._promise)};function Sne(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function pLe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=wt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}Ig.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.PROCESSING||(l(this._dracoError)&&Sne(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,r=t.bufferView,o=i[r],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:o,compressedAttributes:s,dequantizeInShader:!0},c=Dp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=pLe(this,c)};Ig.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var kT=Ig;function _Le(e){let t=e.uint8Array,n=e.format,i=e.request,r=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ie.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ie.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new Ie({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Tx=_Le;function Rp(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Rp.prototype=Object.create(cr.prototype),Rp.prototype.constructor=Rp);Object.defineProperties(Rp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Rp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=gLe(this),this._promise):(this._promise=yLe(this),this._promise)};function vne(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function gLe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await bLe(i);if(e.isDestroyed())return;let o=vne(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(n){return e.isDestroyed()?void 0:wne(e,n,"Failed to load embedded image")}}async function yLe(e){e._state=wt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await TLe(i);if(e.isDestroyed())return;let o=vne(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(r){return e.isDestroyed()?void 0:wne(e,r,`Failed to load image: ${n}`)}}function wne(e,t,n){return e.unload(),e._state=wt.FAILED,Promise.reject(e.getError(n,t))}function xLe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function bLe(e){let t=xLe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return ll(n)}return Rp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var CLe=/(^data:image\/ktx2)|(\.ktx2$)/i;function TLe(e){let t=e.getUrlComponent(!1,!0);return CLe.test(t)?ll(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Rp.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Rp._loadImageFromTypedArray=Tx;var UT=Rp;var ALe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ca=Object.freeze(ALe);function Pg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Pg.prototype=Object.create(cr.prototype),Pg.prototype.constructor=Pg);Object.defineProperties(Pg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var ELe=new n6;Pg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=SLe(this),this._promise):(this._promise=vLe(this),this._promise)};async function SLe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=wt.LOADED,e)}catch(n){if(e.isDestroyed())return;t6(e,n)}}async function vLe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=wt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=wLe(e,a),e._state=wt.PROCESSING,e}catch(s){if(e.isDestroyed())return;t6(e,s)}}function wLe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=Be.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Q("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Be.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===Be.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===Be.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function t6(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function n6(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}n6.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};n6.prototype.execute=function(){this.buffer=Ine(this.typedArray,this.indexDatatype,this.context)};function Ine(e,t,n){let i=mt.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Pg.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(r){t6(this,r)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let r=ELe;if(r.set(t,n,e.context),!e.jobScheduler.execute(r,Ca.BUFFER))return!1;i=r.buffer}else this._loadBuffer&&(i=Ine(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=wt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Pg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var VT=Pg;function ILe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ls=ILe;function PLe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var so=PLe;function Yt(){}Yt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};Yt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};Yt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Yt.objectLegacy(i,n):Yt.object(i,n)};Yt.accessor=function(e,t){return Yt.topLevel(e,"accessors",t)};Yt.accessorWithSemantic=function(e,t,n){let i={};return Yt.mesh(e,function(r){return Yt.meshPrimitive(r,function(o){let s=Yt.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:Yt.meshPrimitiveTarget(o,function(a){return Yt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Yt.accessorContainingVertexAttributeData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(r){let o=Yt.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:Yt.meshPrimitiveTarget(r,function(s){return Yt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Yt.accessorContainingIndexData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};Yt.animation=function(e,t){return Yt.topLevel(e,"animations",t)};Yt.animationChannel=function(e,t){let n=e.channels;return Yt.object(n,t)};Yt.animationSampler=function(e,t){let n=e.samplers;return Yt.object(n,t)};Yt.buffer=function(e,t){return Yt.topLevel(e,"buffers",t)};Yt.bufferView=function(e,t){return Yt.topLevel(e,"bufferViews",t)};Yt.camera=function(e,t){return Yt.topLevel(e,"cameras",t)};Yt.image=function(e,t){return Yt.topLevel(e,"images",t)};Yt.material=function(e,t){return Yt.topLevel(e,"materials",t)};Yt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Yt.mesh=function(e,t){return Yt.topLevel(e,"meshes",t)};Yt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};Yt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Yt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};Yt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};Yt.node=function(e,t){return Yt.topLevel(e,"nodes",t)};Yt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=Yt.nodeInTree(e,u,n),l(c)))return c}}}};Yt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Yt.nodeInTree(e,i,n)};Yt.program=function(e,t){return so(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.programs,t):Yt.topLevel(e,"programs",t)};Yt.sampler=function(e,t){return Yt.topLevel(e,"samplers",t)};Yt.scene=function(e,t){return Yt.topLevel(e,"scenes",t)};Yt.shader=function(e,t){return so(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.shaders,t):Yt.topLevel(e,"shaders",t)};Yt.skin=function(e,t){return Yt.topLevel(e,"skins",t)};Yt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};Yt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Yt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Yt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Yt.technique=function(e,t){return so(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.techniques,t):Yt.topLevel(e,"techniques",t)};Yt.texture=function(e,t){return Yt.topLevel(e,"textures",t)};var Re=Yt;function DLe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ru=DLe;function RLe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*ru(t.type)}var yl=RLe;function OLe(e){Re.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Re.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=ls(e.materials,r)}})}),Re.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=y(i.normalized,!1),l(r)){let o=e.bufferViews[r];o.byteStride=yl(e,i),o.target=te.ARRAY_BUFFER}}),Re.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Re.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),r.transparent=y(r.transparent,!1),r.doubleSided=y(r.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let o=i.KHR_techniques_webgl;l(o)&&Re.materialValue(n,function(c){l(c.index)&&Ax(c)}),Ax(n.emissiveTexture),Ax(n.normalTexture),Ax(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),Ax(s.baseColorTexture),Ax(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),Ax(a.specularGlossinessTexture))}),Re.animation(e,function(n){Re.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=MLe(e);return Re.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Re.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function MLe(e){let t={};return Re.animation(e,function(n){Re.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function Ax(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var $P=OLe;function LLe(e){return Re.shader(e,function(t){$k(t)}),Re.buffer(e,function(t){$k(t)}),Re.image(e,function(t){$k(t)}),$k(e),e}function $k(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Dg=LLe;function NLe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var QP=NLe;function FLe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),QP(e,t),n.length===0&&delete e.extensionsUsed}}var Ex=FLe;var BLe=4;function kLe(e){if(Cd(e)!=="glTF")throw new de("File is not valid binary glTF");let n=Pne(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?ULe(e,n):VLe(e,n)}function Pne(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*BLe,!0);return r}function ULe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new de("Binary glTF scene format is not JSON");let o=20,s=o+i,a=pl(e,o,i),c=JSON.parse(a);Dg(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return Ex(c,"KHR_binary_glTF"),c}function VLe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Pne(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=pl(u);r=JSON.parse(f),Dg(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var eD=kLe;function zLe(e){return Re.shader(e,function(t){Qk(t)}),Re.buffer(e,function(t){Qk(t)}),Re.image(e,function(t){Qk(t)}),Qk(e),e}function Qk(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var tD=zLe;function HLe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ls(n,t,!0)}var of=HLe;function GLe(e){switch(e){case X.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case X.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case X.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case X.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case X.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case X.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case X.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var Op=GLe;function WLe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ru(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=yl(e,t),h=t.byteOffset+c.byteOffset+d.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),C=new DataView(d.buffer),A=new Array(o),T=Op(x);for(let S=0;S<p;S++){T(C,h,o,b,A);for(let v=0;v<o;v++){let I=A[v];s[v]=Math.min(s[v],I),a[v]=Math.max(a[v],I)}h+=g}return{min:s,max:a}}var Sx=WLe;var jLe=[te.FUNC_ADD,te.FUNC_ADD],qLe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Dne(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var YLe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function XLe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(YLe.indexOf(e[n])===-1)return t;return e}function KLe(e){let t={},n={},i=e.techniques;return l(i)&&(Re.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(Dne(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:y(c.blendEquationSeparate,jLe),blendFactors:XLe(c.blendFuncSeparate,qLe)})}Dne(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),of(e,"KHR_blend")),Re.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Re.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var nD=KLe;function JLe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ls(n,t,!0),of(e,t)}var iD=JLe;function ZLe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Re.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Re.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Re.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=ls(o.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=ls(o.shaders,h,!0),u.program=ls(o.programs,p),r[a.program]=u.program}i[c]=ls(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,of(e,"KHR_techniques_webgl"),iD(e,"KHR_techniques_webgl"))}return Re.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Re.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var rD=ZLe;function $Le(e,t){ol.typeOf.object("material",e),ol.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,o=t(r.index,r);if(l(o))return o}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,o=t(r.index,r);if(l(o))return o}}if(l(e.extensions)){let r=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let s=r.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(r.specularGlossinessTexture)){let s=r.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let o=e.extensions.KHR_materials_common;if(l(o)&&l(o.values)){let s=o.values.diffuse,a=o.values.ambient,c=o.values.emission,u=o.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Re.materialValue(e,function(r){if(l(r.index)){let o=t(r.index,r);if(l(o))return o}});if(l(i))return i;if(l(e.emissiveTexture)){let r=e.emissiveTexture,o=t(r.index,r);if(l(o))return o}if(l(e.normalTexture)){let r=e.normalTexture,o=t(r.index,r);if(l(o))return o}if(l(e.occlusionTexture)){let r=e.occlusionTexture,o=t(r.index,r);if(l(o))return o}}var zT=$Le;var Rne=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function QLe(e,t){return t=y(t,Rne),Rne.forEach(function(n){t.indexOf(n)>-1&&tNe(e,n)}),e}var eNe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function tNe(e,t){let n=eNe[t],i=e[n];if(l(i)){let r=0,o=Xm[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Ym[t](e,a-r),r++)}}function Ym(){}Ym.accessor=function(e,t){e.accessors.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){Re.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),Re.meshPrimitiveTarget(r,function(a){Re.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Re.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Re.animation(e,function(i){Re.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Ym.buffer=function(e,t){e.buffers.splice(t,1),Re.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Ym.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Re.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),so(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),so(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(so(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Ym.image=function(e,t){e.images.splice(t,1),Re.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Ym.mesh=function(e,t){e.meshes.splice(t,1),Re.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Ym.node=function(e,t){e.nodes.splice(t,1),Re.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Re.animation(e,function(i){Re.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Re.technique(e,function(i){Re.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Re.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Re.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Ym.material=function(e,t){e.materials.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Ym.sampler=function(e,t){e.samplers.splice(t,1),Re.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Ym.texture=function(e,t){if(e.textures.splice(t,1),Re.material(e,function(i){zT(i,function(r,o){o.index>t&&--o.index})}),so(e,"EXT_feature_metadata")){Re.mesh(e,function(o){Re.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(so(e,"EXT_mesh_features")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),so(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Xm(){}Xm.accessor=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Re.meshPrimitiveTarget(i,function(o){Re.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Re.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Re.animation(e,function(n){Re.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),so(e,"EXT_mesh_gpu_instancing")&&Re.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),so(e,"CESIUM_primitive_outline")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Xm.buffer=function(e){let t={};return Re.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Xm.bufferView=function(e){let t={};if(Re.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),so(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),so(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(so(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Xm.image=function(e){let t={};return Re.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Xm.mesh=function(e){let t={};return Re.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function One(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!One(e,r,n)}).length===0}Xm.node=function(e){let t={};return Re.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Re.skinJoint(n,function(i){t[i]=!0})}),Re.animation(e,function(n){Re.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Re.technique(e,function(n){Re.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Re.node(e,function(n,i){One(e,i,t)||(t[i]=!0)}),t};Xm.material=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Xm.texture=function(e){let t={};if(Re.material(e,function(n){zT(n,function(i){t[i]=!0})}),so(e,"EXT_feature_metadata")){Re.mesh(e,function(r){Re.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(so(e,"EXT_mesh_features")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),so(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Xm.sampler=function(e){let t={};return Re.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var oD=QLe;function nNe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:ls(e.buffers,n),byteOffset:0,byteLength:t.length};return ls(e.bufferViews,r)}var sD=nNe;function iNe(e,t){let n=yl(e,t),i=X.getSizeInBytes(t.componentType),r=ru(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=Op(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let h=0;h<r;++h)s[g*r+h]=d[h];u+=n}return s}var aD=iNe;function rNe(e){let t;return Re.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?eU(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&eU(e,i,X.UNSIGNED_SHORT)}),Re.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?eU(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&eU(e,i,X.UNSIGNED_SHORT)}),e}function eU(e,t,n){let i=X.createTypedArray(n,aD(e,t)),r=new Uint8Array(i.buffer);t.bufferView=sD(e,r),t.componentType=n,t.byteOffset=0}var cD=rNe;function oNe(e,t){return Ex(e,t),t==="CESIUM_RTC"&&sNe(e),i6(e,t)}function sNe(e){Re.technique(e,function(t){Re.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function i6(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)i6(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&i6(e[r],t);return i}}var vx=oNe;var tU={.8:dNe,"1.0":MNe,"2.0":void 0};function aNe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(tU,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(tU,i)||(i="1.0"));let r=tU[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=tU[i];return t.keepLegacyExtensions||(FNe(e,t),BNe(e)),e}function Lne(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function cNe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function lNe(e){let t=e.nodes,n=new m,i=new Ne;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;m.fromArray(a,0,n),Ne.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function uNe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new m,a=new Ne;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let h=0;h<g;++h){let x=f[h];if(x.target.path==="rotation"){let b=d[p[x.sampler].output];if(l(o[b]))continue;o[b]=!0;let C=n[b],A=i[C.bufferView],S=r[A.buffer].extras._pipeline.source,v=S.byteOffset+A.byteOffset+C.byteOffset,I=C.componentType,O=C.count,R=ru(C.type),L=C.count*R,N=X.createArrayBufferView(I,S.buffer,v,L);for(let _=0;_<O;_++){let E=_*R;m.unpack(N,E,s);let w=N[E+3];Ne.fromAxisAngle(s,w,a),Ne.pack(a,N,E)}}}}}}function fNe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function dNe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Lne(e),cNe(e),lNe(e),uNe(e),fNe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,of(e,"KHR_materials_common")}}function mNe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function Mne(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function hNe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Mne(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Re.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Re.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Re.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Re.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Re.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Re.mesh(e,function(s){Re.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Re.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Re.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=ls(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Re.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Re.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Re.animation(e,function(s){let a={};s.samplers=Mne(s.samplers,a),Re.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Re.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Re.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Re.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Re.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Re.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function pNe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){delete n.name})})}function _Ne(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Re.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function gNe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var yNe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function xNe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(yNe[r])&&e.extensionsRequired.push(r)}}}function bNe(e){Re.buffer(e,function(t){delete t.type})}function CNe(e){Re.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function TNe(e){Re.mesh(e,function(t){Re.meshPrimitive(t,function(n){Re.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Re.technique(e,function(t){Re.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var ANe={POSITION:!0,NORMAL:!0,TANGENT:!0},ENe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function SNe(e){let t={};Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=ENe[a];l(f)?(u=f+c,t[o]=u):l(ANe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Re.technique(e,function(n){Re.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function vNe(e){Re.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function r6(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:yl(e,t)}function wNe(e){Re.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Re.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=r6(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(y(i.byteLength,0),o)}})}function INe(e){let t,n,i,r=e.bufferViews,o={};Re.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Re.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=r6(e,p),h=p.byteOffset,x=p.count*g;delete p.byteStride;let b=t<d-1,C=b?r6(e,c[t+1]):void 0;if(g!==C){let A=je(i,!0);o[a]&&(A.byteStride=g),A.byteOffset+=u,A.byteLength=h+x-u;let T=ls(r,A);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}oD(e,["accessor","bufferView","buffer"])}function PNe(e){Re.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Sx(e,n);n.min=i.min,n.max=i.max}})}function Nne(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Fne(e,t){Re.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Re.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),Nne(n)&&Fne(e,i))}}),delete e.nodes[t]}function DNe(e){return Re.node(e,function(t,n){Nne(t)&&Fne(e,n)}),e}function RNe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=Sx(e,i);i.min=r.min,i.max=r.max}})})}function ONe(e){Re.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Sx(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function MNe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Lne(e),mNe(e),DNe(e),hNe(e),pNe(e),gNe(e),xNe(e),wNe(e),INe(e),PNe(e),RNe(e),ONe(e),bNe(e),CNe(e),TNe(e),SNe(e),cD(e),vNe(e),nD(e),rD(e),_Ne(e)}var LNe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],NNe=["u_diffuse","u_diffuse_mat"];function o6(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function nU(e){return l(e.index)}function iU(e){return Array.isArray(e)&&e.length===4}function Bne(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function FNe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,LNe),i=y(t.baseColorFactorNames,NNe);Re.material(e,function(r){Re.materialValue(r,function(o,s){n.indexOf(s)!==-1&&nU(o)?(o6(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&iU(o)&&(o6(r),r.pbrMetallicRoughness.baseColorFactor=Bne(o))})}),vx(e,"KHR_techniques_webgl"),vx(e,"KHR_blend")}function BNe(e){Re.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(of(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let r=l(n.values)?n.values:{},o=r.ambient,s=r.diffuse,a=r.emission,c=r.transparency,u=n.doubleSided,f=n.transparent;o6(t),l(o)&&(iU(o)?t.emissiveFactor=o.slice(0,3):nU(o)&&(t.emissiveTexture=o)),l(s)&&(iU(s)?t.pbrMetallicRoughness.baseColorFactor=Bne(s):nU(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(iU(a)?t.emissiveFactor=a.slice(0,3):nU(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),vx(e,"KHR_materials_common")}var lD=aNe;var ui={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function kNe(e){switch(e){case ui.POSITION:return"positionMC";case ui.NORMAL:return"normalMC";case ui.TANGENT:return"tangentMC";case ui.TEXCOORD:return"texCoord";case ui.COLOR:return"color";case ui.JOINTS:return"joints";case ui.WEIGHTS:return"weights";case ui.FEATURE_ID:return"featureId"}}ui.hasSetIndex=function(e){switch(e){case ui.POSITION:case ui.NORMAL:case ui.TANGENT:return!1;case ui.TEXCOORD:case ui.COLOR:case ui.JOINTS:case ui.WEIGHTS:case ui.FEATURE_ID:return!0}};ui.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ui.POSITION;case"NORMAL":return ui.NORMAL;case"TANGENT":return ui.TANGENT;case"TEXCOORD":return ui.TEXCOORD;case"COLOR":return ui.COLOR;case"JOINTS":return ui.JOINTS;case"WEIGHTS":return ui.WEIGHTS;case"_FEATURE_ID":return ui.FEATURE_ID}};ui.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ui.POSITION;case"RGBA":case"RGB":case"RGB565":return ui.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ui.NORMAL;case"BATCH_ID":return ui.FEATURE_ID}};ui.getGlslType=function(e){switch(e){case ui.POSITION:case ui.NORMAL:case ui.TANGENT:return"vec3";case ui.TEXCOORD:return"vec2";case ui.COLOR:return"vec4";case ui.JOINTS:return"ivec4";case ui.WEIGHTS:return"vec4";case ui.FEATURE_ID:return"int"}};ui.getVariableName=function(e,t){let n=kNe(e);return l(t)&&(n+=`_${t}`),n};var At=Object.freeze(ui);function Ka(){}Ka.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let r=new de(i);return l(n)&&(r.stack=`Original stack: +${n.stack} +Handler stack: +${r.stack}`),r};Ka.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Ne.IDENTITY,l(e.scale)?e.scale:m.ONE)};Ka.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Ka.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Ka.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Ka.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Ka.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=At.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=cn.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":cn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var UNe=new m,VNe=new m;Ka.getPositionMinMax=function(e,t,n){let i=Ka.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=m.add(o,t,VNe),r=m.add(r,n,UNe)),{min:o,max:r}};Ka.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===hr.Y?n=F.clone(hr.Y_UP_TO_Z_UP,n):e===hr.X&&(n=F.clone(hr.X_UP_TO_Z_UP,n)),t===hr.Z&&(n=F.multiplyTransformation(n,hr.Z_UP_TO_X_UP,n)),n};var zNe=new $;Ka.getCullFace=function(e,t){if(!Le.isTriangles(t))return xi.BACK;let n=F.getMatrix3(e,zNe);return $.determinant(n)<0?xi.FRONT:xi.BACK};Ka.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Ka.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Ka.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Ka.supportedExtensions[i])throw new de(`Unsupported glTF Extension: ${i}`)}};var $t=Ka;function Rg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,r=e.typedArray,o=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=r,this._gltfJson=o,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Rg.prototype=Object.create(cr.prototype),Rg.prototype.constructor=Rg);Object.defineProperties(Rg.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Rg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,l(this._gltfJson)?(this._promise=kne(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Une(this,this._typedArray),this._promise):(this._promise=HNe(this),this._promise))};async function HNe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;s6(e,n)}return Une(e,t)}function s6(e,t){e.unload(),e._state=wt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function GNe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!so(t,"KHR_techniques_webgl")&&!so(t,"KHR_materials_common"))return Promise.resolve();let n=[];Re.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),lD(t)}function WNe(e){let t=[];return Re.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&ep(i)&&(delete n.uri,t.push(Ie.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function jNe(e,t){let n=[];return Re.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function kne(e,t){try{Dg(t),await WNe(t),await GNe(e,t),$P(t),await jNe(e,t),tD(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new de(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&$t.checkSupportedExtensions(i),e._gltf=t,e._state=wt.READY,e}catch(n){if(e.isDestroyed())return;s6(e,n)}}async function Une(e,t){let n;try{Cd(t)==="glTF"?n=eD(t):n=Lr(t)}catch(i){if(e.isDestroyed())return;s6(e,i)}return kne(e,n)}Rg.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Rg.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var HT=Rg;var qNe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Km=Object.freeze(qNe);var Jr={};function YNe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function XNe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function KNe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function JNe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function ZNe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function $Ne(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function QNe(){this.attributes=[]}function eFe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function tFe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function nFe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function iFe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function rFe(){this.nodes=[]}var oFe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function sFe(){this.input=[],this.interpolation=void 0,this.output=[]}function aFe(){this.node=void 0,this.path=void 0}function cFe(){this.sampler=void 0,this.target=void 0}function lFe(){this.name=void 0,this.samplers=[],this.channels=[]}function uFe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function fFe(){this.name=void 0,this.stages=[]}function Vne(){this.credits=[]}function dFe(){this.asset=new Vne,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY)}function mFe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.channels=void 0}function Og(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(Og.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Og.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Og.DEFAULT_ROUGHNESS_FACTOR}Og.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;Og.DEFAULT_METALLIC_FACTOR=1;Og.DEFAULT_ROUGHNESS_FACTOR=1;function wx(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(wx.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(wx.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=wx.DEFAULT_GLOSSINESS_FACTOR}wx.DEFAULT_DIFFUSE_FACTOR=oe.ONE;wx.DEFAULT_SPECULAR_FACTOR=m.ONE;wx.DEFAULT_GLOSSINESS_FACTOR=1;function a6(){this.metallicRoughness=new Og,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(a6.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Km.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}a6.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Jr.Quantization=YNe;Jr.Attribute=XNe;Jr.Indices=KNe;Jr.FeatureIdAttribute=JNe;Jr.FeatureIdTexture=$Ne;Jr.FeatureIdImplicitRange=ZNe;Jr.MorphTarget=QNe;Jr.Primitive=eFe;Jr.Instances=tFe;Jr.Skin=nFe;Jr.Node=iFe;Jr.Scene=rFe;Jr.AnimatedPropertyType=Object.freeze(oFe);Jr.AnimationSampler=sFe;Jr.AnimationTarget=aFe;Jr.AnimationChannel=cFe;Jr.Animation=lFe;Jr.ArticulationStage=uFe;Jr.Articulation=fFe;Jr.Asset=Vne;Jr.Components=dFe;Jr.TextureReader=mFe;Jr.MetallicRoughness=Og;Jr.SpecularGlossiness=wx;Jr.Material=a6;var Bt=Jr;var rU={};rU.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};rU.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=y(e.compressedTextureNoMipmap,!1),r=In.REPEAT,o=In.REPEAT,s=ln.LINEAR,a=Ai.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let g=t.samplers[f];r=y(g.wrapS,r),o=y(g.wrapT,o),s=y(g.minFilter,s),a=y(g.magFilter,a)}let d=!1,p=n.extensions;return l(p)&&l(p.KHR_texture_transform)&&(d=!0),(i||d)&&s!==ln.LINEAR&&s!==ln.NEAREST&&(s===ln.NEAREST_MIPMAP_NEAREST||s===ln.NEAREST_MIPMAP_LINEAR?s=ln.NEAREST:s=ln.LINEAR),new mn({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var hFe=new H(1,1);rU.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,r=y(t.texCoord,0),o,s=y(t.extensions,y.EMPTY_OBJECT).KHR_texture_transform;if(l(s)){r=y(s.texCoord,r);let c=l(s.offset)?H.unpack(s.offset):H.ZERO,u=y(s.rotation,0),f=l(s.scale)?H.unpack(s.scale):hFe;u=-u,o=new $(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new Bt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=r,a.transform=o,a.channels=n,a};var xl=rU;function pFe(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Mg=pFe;function Lg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=xl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=r,this._baseResource=o,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Lg.prototype=Object.create(cr.prototype),Lg.prototype.constructor=Lg);Object.defineProperties(Lg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var _Fe=new c6;async function gFe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=wt.LOADED,e)}catch(n){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let i="Failed to load texture";throw e.getError(i,n)}}Lg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=gFe(this),this._promise)};function c6(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}c6.prototype.set=function(e,t,n,i,r){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=r};c6.prototype.execute=function(){this.texture=zne(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function zne(e,t,n,i,r){let o=n.internalFormat,s=!1;ct.isCompressedFormat(o)&&!l(i)&&(s=!0);let a=xl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,u=a.wrapS,f=a.wrapT,d=c===ln.NEAREST_MIPMAP_NEAREST||c===ln.NEAREST_MIPMAP_LINEAR||c===ln.LINEAR_MIPMAP_NEAREST||c===ln.LINEAR_MIPMAP_LINEAR,p=!l(o)&&d,g=p||u===In.REPEAT||u===In.MIRRORED_REPEAT||f===In.REPEAT||f===In.MIRRORED_REPEAT,h=!D.isPowerOfTwo(n.width)||!D.isPowerOfTwo(n.height),x=g&&h,b;return l(o)?(!r.webgl2&&ct.isCompressedFormat(o)&&h&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Lt.create({context:r,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=Mg(n)),b=Lt.create({context:r,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&b.generateMipmap(),b}Lg.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=wt.PROCESSING;let t;if(this._asynchronous){let n=_Fe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ca.TEXTURE))return;t=n.texture}else t=zne(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=wt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Lg.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var GT=Lg;function Ng(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,r=e.baseResource,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=r,this._gltf=n,this._bufferViewId=o,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ng.prototype=Object.create(cr.prototype),Ng.prototype.constructor=Ng);Object.defineProperties(Ng.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function yFe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}Ng.prototype.load=async function(){return l(this._promise)?this._promise:yFe(this._draco,this._attributeSemantic)?(this._promise=bFe(this),this._promise):(this._promise=TFe(this),this._promise)};function xFe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Bt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=cn.VEC2,a.normalizationRange=o;else{let c=cn.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function bFe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=wt.LOADED,e)}catch{if(e.isDestroyed())return;l6(e)}}function CFe(e){e._state=wt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=xFe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function TFe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=wt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;l6(e,n)}}function l6(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load vertex buffer";throw e.getError(n,t)}function u6(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}u6.prototype.set=function(e,t){this.typedArray=e,this.context=t};u6.prototype.execute=function(){this.buffer=Hne(this.typedArray,this.context)};function Hne(e,t){let n=mt.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var AFe=new u6;Ng.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){l6(this,i)}CFe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=AFe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ca.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Hne(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=wt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Ng.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var WT=Ng;function uD(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}uD.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=vg.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new uD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(uD.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});uD.BATCH_TABLE_CLASS_NAME="_batchTable";var Sd=uD;function oU(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}oU.fromJson=function(e){return new oU({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(oU.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var fD=oU;function sU(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=y(e.valueType,rn.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}sU.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(r){return fD.fromJson(r)});return new sU({id:t,values:i,valueType:rn[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(sU.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var dD=sU;function aU(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}aU.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=dD.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Sd.fromJson({id:i,class:e.classes[i],enums:t}));return new aU({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(aU.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var vd=aU;function Ix(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?vd.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ix.prototype=Object.create(cr.prototype),Ix.prototype.constructor=Ix);Object.defineProperties(Ix.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});Ix.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=EFe(this),this._promise)};async function EFe(e){let t=e._resource;e._state=wt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=vd.fromJson(n),e._state=wt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=wt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}Ix.prototype.unload=function(){this._schema=void 0};var jT=Ix;var wd={};function mD(e){return Qh(e.url)}function cU(e){let t=e.byteOffset,n=e.byteLength;if(ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function SFe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,r=e.type,o=e.count;return`${n}-${i}-${r}-${o}`}function Gne(e){return mD(e)}function Wne(e,t){return`${mD(e)}-buffer-id-${t}`}function hD(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return Gne(r)}return Wne(n,t)}function f6(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=hD(a,s,n,i),u=cU(o);return`${c}-range-${u}`}function jne(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return mD(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=hD(u,c,n,i),d=cU(a);return`${f}-range-${d}`}function vFe(e,t){let n=xl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}wd.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${mD(n)}`};wd.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${Gne(t)}`};wd.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${Wne(t,n)}`};wd.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${mD(t)}`};wd.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s];ii(o,"EXT_meshopt_compression")&&(s=o.extensions.EXT_meshopt_compression.buffer);let c=hD(a,s,i,r),u=cU(o);return`buffer-view:${c}-range-${u}`};wd.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;return`draco:${f6(t,n,i,r)}`};wd.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=y(e.dequantize,!1),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${r.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${f6(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[o],g=p.buffer,h=t.buffers[g],x=hD(h,g,n,i),b=cU(p);return`vertex-buffer:${x}-range-${b}${d}`};wd.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.loadBuffer,!1),c=y(e.loadTypedArray,!1),u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${f6(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,h=t.buffers[g],x=hD(h,g,i,r),b=SFe(f,p);return`index-buffer:${x}-accessor-${b}${u}`};wd.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;return`image:${jne(t,n,i,r)}`};wd.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=n.index,c=xl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=jne(t,c,i,r),f=vFe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var bl=wd;function pD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}pD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};pD.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};pD.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};pD.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var _D=pD;function Nn(){}Nn.cacheEntries={};Nn.statistics=new _D;function wFe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new wFe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=bl.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new jT({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,r=bl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new bx({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource,n=bl.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new bx({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=e.gltfJson,o=bl.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new HT({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=bl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new BT({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource,o=bl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new kT({resourceCache:Nn,gltf:t,draco:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=y(e.asynchronous,!0),f=y(e.dequantize,!1),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1),g=bl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),h=Nn.get(g);return l(h)?h:(h=new WT({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:u,dequantize:f,loadBuffer:d,loadTypedArray:p}),Nn.add(h))};Nn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.asynchronous,!0),c=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),f=bl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:c,loadTypedArray:u}),d=Nn.get(f);return l(d)?d:(d=new VT({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Nn.add(d))};Nn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource,o=bl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new UT({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=y(e.asynchronous,!0),c=bl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new GT({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[WT,VT,kT,GT,UT,BT,bx,jT,HT],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var ki=Nn;function Qs(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Qs.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Qs.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Qs.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Qs.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};Qs.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Qs.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Qs.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Qs.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Qs.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===qo.OCTREE&&(t=3),e>>t};Qs.fromSubtreeJson=async function(e,t,n,i,r){let o=new Qs(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=IFe(n);let a=s.json;o._subtreeJson=a;let c;if(ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let A=a.tileMetadata;c=a.propertyTables[A]}let u=[];if(l(a.contentMetadata)){let A=a.contentMetadata.length;for(let T=0;T<A;T++){let S=a.contentMetadata[T];u.push(a.propertyTables[S])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let A=p.class,T=d.classes[A];f=new qP({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ii(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let h=PFe(a.buffers),x=DFe(a.bufferViews,h);RFe(a,x),l(c)&&qne(c,x);for(let A=0;A<u.length;A++){let T=u[A];qne(T,x)}let b=await OFe(o,h,s.binary),C=LFe(x,b);return NFe(o,a,i,C),l(c)&&(FFe(o,i,C),kFe(o)),BFe(o,i,C),UFe(o),o._ready=!0,o};function IFe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Lr(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function PFe(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function DFe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function RFe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function qne(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=y(o.values,o.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(o.stringOffsets,o.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(o.arrayOffsets,o.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function OFe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=MFe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function MFe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=ki.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function LFe(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function NFe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=ii(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=d6(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=d6(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=d6(t.childSubtreeAvailability,i,a)}function d6(e,t,n,i){if(l(e.constant))return new NT({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new NT({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function FFe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new gl({class:a,count:r,properties:i.properties,bufferViews:n})}function BFe(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new gl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function Yne(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function kFe(e){let t=Yne(e._tileAvailability);e._tileJumpBuffer=t}function UFe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=Yne(r);t.push(o)}}Qs.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new de("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Qs.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new de("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function VFe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function zFe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}Qs.prototype.getTileMetadataView=function(e){let t=VFe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new FT({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Qs.prototype.getContentMetadataView=function(e,t){let n=zFe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new FT({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Qs.prototype.isDestroyed=function(){return!1};Qs.prototype.destroy=function(){return l(this._bufferLoader)&&ki.unload(this._bufferLoader),ue(this)};var Px=Qs;var HFe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},Dx=Object.freeze(HFe);function GFe(e){return{tile:{boundingVolume:Xne("TILE",e),minimumHeight:Kne("TILE",e),maximumHeight:Jne("TILE",e)},content:{boundingVolume:Xne("CONTENT",e),minimumHeight:Kne("CONTENT",e),maximumHeight:Jne("CONTENT",e)}}}function Xne(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}}function Kne(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function Jne(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}var gD=GFe;function Cl(e,t,n){let i=t.implicitTileset,r=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let o=r.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o});this._url=s.getUrlComponent(!0),this._ready=!1,this._readyPromise=void 0}Object.defineProperties(Cl.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Implicit3DTileContent.readyPromise","Implicit3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Implicit3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Cl.fromSubtreeJson=async function(e,t,n,i,r,o){o=y(o,0);let s;l(r)&&(s=new Uint8Array(r,o));let a=t.implicitTileset,c=t.implicitCoordinates,u=await Px.fromSubtreeJson(n,i,s,a,c),f=new Cl(e,t,n);return f._implicitSubtree=u,WFe(f,u),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function WFe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=qFe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=jFe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=t2e(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function jFe(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function qFe(e,t,n,i){let s=Zne(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let h=0;h<g;h++){let x=p+h;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(h),C=c[b],A=h%f.branchingFactor,T=Zne(e,t,C,A,x);C.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function $ne(e,t,n){let i=Dx.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Zne(e,t,n,i,r,o){let s=e._implicitTileset,a;y(o,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let I=gD(c);u=I.tile,f=I.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){g=!0;break}let h=KFe(s,a,i,o,n,u),x=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(r,I))continue;let L={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},N=JFe(h,f);l(N)&&(L.boundingVolume=N),x.push(gt(L,s.contentHeaders[I]))}let b=$ne(c,s,a),C={boundingVolume:h,geometricError:b,refine:s.refine,contents:x},A=!0,T=je(s.tileHeader,A);delete T.boundingVolume,delete T.transform;let S=gt(C,T,A),v=iie(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=g,v}function lU(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function h6(e,t){l(t)&&(ii(e,"3DTILES_bounding_volume_S2")?XFe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&YFe(e.region,t.minimumHeight,t.maximumHeight))}function YFe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function XFe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function KFe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!lU(o.boundingVolume,o)&&lU(e.boundingVolume,o)?s=Qne(e,t,n,y(i,!1),r):s=o.boundingVolume,h6(s,o),s}function JFe(e,t){let n;return l(t)&&(n=t.boundingVolume),lU(n,t)?h6(n,t):lU(e,t)&&(n=je(e,!0),h6(n,t)),n}function Qne(e,t,n,i,r){let o=e.boundingVolume;return ii(o,"3DTILES_bounding_volume_S2")?eie(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:nie(o.region,t.level,t.x,t.y,t.z)}:{box:tie(o.box,t.level,t.x,t.y,t.z)}}function eie(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:vp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?MT.encode2D(i,r,o):MT.encode2D(i,o,r),f=vp.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:vp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var ZFe=new m,$Fe=new m,m6=new m,QFe=new $;function tie(e,t,n,i,r){if(t===0)return e;let o=m.unpack(e,0,$Fe),s=$.unpack(e,3,QFe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,ZFe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=m.fromElements(c,u,f,m6);p=$.multiplyByVector(s,p,m6),p=m.add(p,o,m6);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),$.pack(g,h,3),h}var e2e=new ce;function nie(e,t,n,i,r){if(t===0)return e.slice();let o=ce.unpack(e,0,e2e),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=D.negativePiToPi(o.west+n*u),d=D.negativePiToPi(f+u),p=c*o.height,g=D.negativePiToPi(o.south+i*p),h=D.negativePiToPi(g+p),x=s,b=a;if(l(r)){let C=c*(a-s);x+=r*C,b=x+C}return[f,g,d,h,x,b]}function t2e(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=Qne(i,r,n,!1,t),s=$ne(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=iie(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function iie(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}Cl.prototype.hasProperty=function(e,t){return!1};Cl.prototype.getFeature=function(e){};Cl.prototype.applyDebugSettings=function(e,t){};Cl.prototype.applyStyle=function(e){};Cl.prototype.update=function(e,t){};Cl.prototype.isDestroyed=function(){return!1};Cl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};Cl._deriveBoundingBox=tie;Cl._deriveBoundingRegion=nie;Cl._deriveBoundingVolumeS2=eie;var qT=Cl;var n2e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Tl=Object.freeze(n2e);function YT(e,t){this._distance=t,this._normal=new rie(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(YT.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});YT.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new YT(e.normal,e.distance),t};YT.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new YT(e.normal,e.distance)};function rie(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(rie.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var Rx=YT;function Ja(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?lie:uie,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function lie(e){return e===en.OUTSIDE}function uie(e){return e===en.INSIDE}Object.defineProperties(Ja.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?lie:uie)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function oie(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Ja.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){oie(n,i)},e.index=t,oie(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Ja.prototype.get=function(e){return this._planes[e]};function fie(e,t){let n=e.length;for(let i=0;i<n;++i)if(un.equals(e[i],t))return i;return-1}Ja.prototype.contains=function(e){return fie(this._planes,e)!==-1};Ja.prototype.remove=function(e){let t=this._planes,n=fie(t,e);if(n===-1)return!1;e instanceof Rx&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof Rx&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Ja.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof Rx&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var i2e=new oe,r2e=new oe;function sie(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=Xn.octEncodeToCartesian4(a.normal,r2e);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=oe.packFloat(a.distance,i2e);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function aie(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function die(e,t){let n=Ht.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var o2e=new H;Ja.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Ja.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=die(r,o2e);s.y*=2,i?(t=new Lt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:Xe.FLOAT,sampler:mn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Lt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,sampler:mn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(aie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(sie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),aie(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),sie(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var s2e=new F,cie=new un(m.UNIT_X,0);Ja.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=F.multiply(t,r,s2e));let o=en.INSIDE;!this.unionClippingRegions&&i>0&&(o=en.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];un.transform(a,r,cie);let c=e.intersectPlane(cie);if(c===en.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};Ja.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ja.useFloatTexture=function(e){return e.floatingPointTexture};Ja.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=Ja.useFloatTexture(t)?e.length:e.length*2,o=die(r,n);return o.y*=2,o};Ja.prototype.isDestroyed=function(){return!1};Ja.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var us=Ja;var yD={HIGHLIGHT:0,REPLACE:1,MIX:2};yD.getColorBlend=function(e,t){if(e===yD.HIGHLIGHT)return 0;if(e===yD.REPLACE)return 1;if(e===yD.MIX)return D.clamp(t,D.EPSILON4,1)};var Za=Object.freeze(yD);var a2e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},$a=Object.freeze(a2e);var c2e={STEP:0,LINEAR:1,CUBICSPLINE:2},Id=Object.freeze(c2e);var mie={};function xD(e){this._count=e.count,this._properties=je(e.properties,!0)}xD.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,mie)};xD.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,mie,e)};xD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return je(n[e],!0)};xD.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=je(n,!0)};var Mp=xD;function Qa(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Qa.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Qa.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Qa.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Qa.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Qa.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var p6=[];Qa.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(p6)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,p6)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(p6)),t};Qa.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};Qa.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Mp({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Qa.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Qa.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Qa.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Qa.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Qa.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Qa.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Qa.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Bc=Qa;function bD(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=xl.createModelTextureReader({textureInfo:o,channels:f2e(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(bD.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bD.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===qt.SCALAR&&n===rn.UINT8:qt.isVectorType(t)||t===qt.SCALAR?n===rn.UINT8:!1};var l2e=[void 0,"float","vec2","vec3","vec4"],u2e=[void 0,"int","ivec2","ivec3","ivec4"];bD.prototype.getGlslType=function(){let e=this._classProperty,t=qt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?l2e[t]:u2e[t]};bD.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function f2e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var CD=bD;function _6(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new CD({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(_6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_6.prototype.getProperty=function(e){return this._properties[e]};var Ox=_6;function hie(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=y(i,n.offset),r=y(r,n.scale),i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(hie.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var TD=hie;function g6(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new TD({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(g6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});g6.prototype.getProperty=function(e){return this._properties[e]};var Mx=g6;function AD(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(AD.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});AD.prototype.getPropertyTable=function(e){return this._propertyTables[e]};AD.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};AD.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Ta=AD;function d2e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new gl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Bc({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new Ox({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new Mx({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ta({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var ED=d2e;function m2e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new gl({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Bc({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new Ox({id:a,propertyTexture:h2e(c),class:n.classes[c.class],textures:e.textures}))}return new Ta({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function h2e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:p2e(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=gt(r.texture,o,!0)}return t}function p2e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var SD=m2e;function Fg(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,u=y(e.asynchronous,!0);this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Fg.prototype=Object.create(cr.prototype),Fg.prototype.constructor=Fg);Object.defineProperties(Fg.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function _2e(e){try{let t=C2e(e),n=v2e(e),i=w2e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=wt.LOADED,e)}catch(t){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let n="Failed to load structural metadata";throw e.getError(n,t)}}Fg.prototype.load=function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=_2e(this),this._promise)};function g2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function y2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function x2e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];g2e(r.properties,n)}return n}function b2e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&y2e(o,n)}}return n}async function C2e(e){let t;l(e._extension)?t=x2e(e._extension):t=b2e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=ki.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function T2e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&A2e(o,t)}return t}function A2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function E2e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&S2e(o,t)}}return t}function S2e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function v2e(e){let t;l(e._extension)?t=T2e(e._extension):t=E2e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=ki.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function w2e(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=ki.getSchemaLoader({resource:i})}else n=ki.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Fg.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let r=this._schemaLoader.schema,o={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);o[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=ED({extension:this._extension,schema:r,bufferViews:o,textures:s}):this._structuralMetadata=SD({extension:this._extensionLegacy,schema:r,bufferViews:o,textures:s}),pie(this),this._state=wt.READY,!0};function pie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function I2e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Fg.prototype.unload=function(){pie(this),I2e(this),l(this._schemaLoader)&&ki.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var vD=Fg;var XT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};XT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return XT.TRANSLATION;case"ROTATION":return XT.ROTATION;case"SCALE":return XT.SCALE;case"_FEATURE_ID":return XT.FEATURE_ID}};var Yo=Object.freeze(XT);var P2e=65534,D2e=255;function uU(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new yie(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],R2e(this)}Object.defineProperties(uU.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function R2e(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),h=d||n.hasEdge(f,c),x=_ie(i,c,u,f,p,g,h);for(;l(x);){let b=s[x];if(!l(b)){b=o+r.length;let C=x;for(;C>=o;)C=r[C-o];r.push(C),s[x]=b}b>P2e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>D2e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=_ie(i,c,u,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function _ie(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=y6(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,h=y6(e,n,d,p,g);if(h===0)return n;let x=s?1:0,b=0,C=o?1:0,A=y6(e,i,x,b,C);if(A===0)return i;let T=f&h&A,S,v,I;if(T&1)S=0,v=1,I=2;else if(T&2)S=0,I=1,v=2;else if(T&4)v=0,S=1,I=2;else if(T&8)v=0,I=1,S=2;else if(T&16)I=0,S=1,v=2;else if(T&32)I=0,v=1,S=2;else{let N=x6(f),_=x6(h),E=x6(A);return N<_&&N<E?t:_<E?n:i}let O=t*3;e[O+S]=a,e[O+v]=c,e[O+I]=u;let R=n*3;e[R+S]=d,e[R+v]=p,e[R+I]=g;let L=i*3;e[L+S]=x,e[L+v]=b,e[L+I]=C}function y6(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function x6(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}uU.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};uU.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ht.maximumTextureSize),i=n,r=gie(i),o=[];for(;i>1;)i>>=1,o.push(gie(i));let s=new Lt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:ct.LUMINANCE,sampler:new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.LINEAR_MIPMAP_LINEAR,magnificationFilter:Ai.LINEAR})});return t.outlineTexture=s,s};function gie(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function yie(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}yie.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var Lx=uU;function xie(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function O2e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function fU(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}fU.prototype.postProcess=function(e){this.needsOutlines&&(M2e(this),N2e(this,e))};function M2e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new Lx({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Be.fromTypedArray(n.typedArray);let o=L2e(r.outlineCoordinates),s=new xie(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function L2e(e){let t=new Bt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=cn.VEC3,t.normalized=!1,t.count=e.length/3,t}function N2e(e,t){F2e(e.attributePlans,t),l(e.indicesPlan)&&B2e(e.indicesPlan,t)}function F2e(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=mt.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function B2e(e,t){let n=e.indices;if(e.loadBuffer){let i=mt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}fU.AttributeLoadPlan=xie;fU.IndicesLoadPlan=O2e;var Nx=fU;function k2e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var wD=k2e;var U2e=Bt.Attribute,V2e=Bt.Indices,bie=Bt.FeatureIdAttribute,Cie=Bt.FeatureIdTexture,Tie=Bt.FeatureIdImplicitRange,z2e=Bt.MorphTarget,H2e=Bt.Primitive,G2e=Bt.Instances,W2e=Bt.Skin,j2e=Bt.Node,q2e=Bt.AnimatedPropertyType,Y2e=Bt.AnimationSampler,X2e=Bt.AnimationTarget,K2e=Bt.AnimationChannel,J2e=Bt.Animation,Z2e=Bt.ArticulationStage,$2e=Bt.Articulation,Q2e=Bt.Asset,eBe=Bt.Scene,tBe=Bt.Components,nBe=Bt.MetallicRoughness,iBe=Bt.SpecularGlossiness,rBe=Bt.Material,Nr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Pd(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=y(e.releaseGltfJson,!1),o=y(e.asynchronous,!0),s=y(e.incrementallyLoadTextures,!0),a=y(e.upAxis,hr.Y),c=y(e.forwardAxis,hr.Z),u=y(e.loadAttributesAsTypedArray,!1),f=y(e.loadAttributesFor2D,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.loadForClassification,!1),h=y(e.renameBatchIdSemantic,!1);n=l(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=h,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Nr.NOT_LOADED,this._textureState=Nr.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Pd.prototype=Object.create(cr.prototype),Pd.prototype.constructor=Pd);Object.defineProperties(Pd.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function oBe(e){e._state=Nr.LOADING,e._textureState=Nr.LOADING;try{let t=ki.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Nr.LOADED,e._textureState=Nr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Nr.FAILED,e._textureState=Nr.FAILED,dU(e,t)}}async function sBe(e,t){Wt.supportsWebP.initialized||await Wt.supportsWebP.initialize();let n=new wD({webp:Wt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,r=i3e(e,i,n,t);return e._state=Nr.PROCESSING,e._textureState=Nr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(ki.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),r}Pd.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=oBe(this),this._promise)};function dU(e,t){e.unload();let n="Failed to load glTF";throw e.getError(n,t)}function aBe(e,t){let n,i=!0,r=e._geometryLoaders,o=r.length;for(n=0;n<o;++n){let a=r[n].process(t);a&&l(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(l(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=Nr.POST_PROCESSING)}function cBe(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.postProcess(t),o.needsOutlines&&lBe(e,o)}}function lBe(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes,s=o.length;for(let c=0;c<s;c++){let u=o[c];l(u.buffer)&&n.push(u.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}Pd.prototype._process=function(e){return this._state===Nr.READY?!0:(this._state===Nr.PROCESSING&&aBe(this,e),this._resourcesLoaded&&this._state===Nr.POST_PROCESSING&&(cBe(this,e.context),this._state=Nr.PROCESSED),this._resourcesLoaded&&this._state===Nr.PROCESSED?(Rie(this),this._typedArray=void 0,this._state=Nr.READY,!0):!1)};Pd.prototype._processTextures=function(e){if(this._textureState===Nr.READY)return!0;if(this._textureState!==Nr.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,r=i.length;for(t=0;t<r;++t){let o=i[t].process(e);o&&l(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&o}return n?(this._textureState=Nr.READY,this._texturesLoaded=!0,!0):!1};Pd.prototype.process=function(e){if(this._state===Nr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=sBe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=Nr.FAILED;let r=this._processError;this._processError=void 0,dU(this,r)}let t=this._textureErrors.pop();if(l(t)){let r=this.getError("Failed to load glTF texture",t);throw r.name="TextureError",r}if(this._state===Nr.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(r){this._state=Nr.FAILED,dU(this,r)}let i=!1;try{i=this._processTextures(e)}catch(r){this._textureState=Nr.FAILED,dU(this,r)}return this._incrementallyLoadTextures?n:n&&i};function uBe(e,t,n,i,r,o,s,a){let u=t.accessors[n].bufferView;return ki.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:s})}function fBe(e,t,n,i,r,o,s){return ki.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function dBe(e,t,n){let i=ki.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function Aie(e,t,n){let i=t.byteOffset,r=yl(e,t),o=t.count,s=ru(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=Op(t.componentType);i=n.byteOffset+i;for(let x=0;x<o;++x){h(p,i,s,c,g);for(let b=0;b<s;++b)d[x*s+b]=g[b];i+=r}return d}function mBe(e,t){let n=e.type;if(n===cn.SCALAR)return t.fill(0);let i=cn.getMathType(n);return t.fill(i.clone(i.ZERO))}function hBe(e,t,n,i){let r=e.type,o=e.count;if(r===cn.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===cn.VEC4&&i)for(let s=0;s<o;s++)n[s]=Ne.unpack(t,s*4);else{let s=cn.getMathType(r),a=cn.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function pBe(e,t,n,i,r,o){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=Aie(n,i,s);r=y(r,!1),hBe(i,a,o,r)}function mU(e,t,n,i){let r=t.accessors[n],o=r.count,s=new Array(o),a=r.bufferView;if(l(a)){let c=dBe(e,t,a),u=pBe(e,c,t,r,i,s);return e._loaderPromises.push(u),s}return mBe(r,s)}function sf(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function _Be(e){return e===Number?0:new e}function gBe(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var yBe={VEC2:new H(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function xBe(e,t){let n=gBe(e.componentDatatype),i=yBe[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function bBe(e,t,n){let i=e.decodeMatrix,r=sf(n,e.decodedMin),o=sf(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new Bt.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new H(i[6],i[7]),s.quantizedVolumeStepSize=new H(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function CBe(e,t,n,i,r){let o=e.accessors[t],s=cn.getMathType(o.type),a=y(o.normalized,!1),c=new U2e;c.name=n,c.semantic=i,c.setIndex=r,c.constant=_Be(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=sf(s,o.min),c.max=sf(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=yl(e,o),ii(o,"WEB3D_quantized_attributes")&&bBe(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===At.POSITION||c.semantic===At.NORMAL||c.semantic===At.TANGENT||c.semantic===At.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&xBe(c,s),c}function Eie(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var TBe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function b6(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=TBe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function ABe(e){let t=e===At.POSITION,n=e===At.FEATURE_ID,i=e===At.TEXCOORD;return t||n||i}function EBe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(r,t.typedArray.buffer)}}function SBe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=Aie(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function Sie(e,t,n,i,r,o,s,a){let c=t.accessors[n],u=c.bufferView,f=i.gltfSemantic,d=i.renamedSemantic,p=i.modelSemantic,g=l(p)?Eie(d):void 0,x=CBe(t,n,f,p,g);if(!l(r)&&!l(u))return x;let b=uBe(e,t,n,f,r,o,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(b);let A=b.load();return e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[f])?EBe(x,b,o,s):SBe(t,c,x,b,o,s)},x}function vie(e,t,n,i,r,o,s,a){let c=i.modelSemantic,u=c===At.POSITION,f=c===At.FEATURE_ID,d=u&&!o&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,x=g||d||p,A=Sie(e,t,n,i,r,s?!1:h,s?!0:x,a),T=new Nx.AttributeLoadPlan(A);return T.loadBuffer=h,T.loadTypedArray=x,T}function vBe(e,t,n,i,r,o){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=b6(e,Yo,r),u=c.modelSemantic,f=u===Yo.TRANSLATION||u===Yo.ROTATION||u===Yo.SCALE,d=u===Yo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!o.scene3DOnly;return Sie(e,t,n,c,void 0,g,p||d&&(!a||h),o)}function wBe(e,t,n,i,r,o,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new V2e;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&r,h=!f,x=f||d||p,A=fBe(e,t,n,i,o?!1:h,o?!0:x,s),T=e._geometryLoaders.length;e._geometryLoaders.push(A);let S=A.load();e._loaderPromises.push(S),e._geometryCallbacks[T]=()=>{u.indexDatatype=A.indexDatatype,u.buffer=A.buffer,u.typedArray=A.typedArray};let v=new Nx.IndicesLoadPlan(u);return v.loadBuffer=h,v.loadTypedArray=x,v}function Lp(e,t,n,i,r,o){let s=xl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=ki.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:r,asynchronous:e._asynchronous}),c=xl.createModelTextureReader({textureInfo:n}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Nr.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{c.texture=a.texture,l(o)&&(c.texture.sampler=o)},c}function IBe(e,t,n,i,r){let o=new rBe,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(o.unlit=l(s.KHR_materials_unlit),l(a)){let u=new iBe;o.specularGlossiness=u,l(a.diffuseTexture)&&(u.diffuseTexture=Lp(e,t,a.diffuseTexture,i,r)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(u.specularGlossinessTexture=Lp(e,t,a.specularGlossinessTexture,i,r)),u.diffuseFactor=sf(oe,a.diffuseFactor),u.specularFactor=sf(m,a.specularFactor),u.glossinessFactor=a.glossinessFactor,o.pbrSpecularGlossiness=a}else if(l(c)){let u=new nBe;l(c.baseColorTexture)&&(u.baseColorTexture=Lp(e,t,c.baseColorTexture,i,r)),l(c.metallicRoughnessTexture)&&(u.metallicRoughnessTexture=Lp(e,t,c.metallicRoughnessTexture,i,r)),u.baseColorFactor=sf(oe,c.baseColorFactor),u.metallicFactor=c.metallicFactor,u.roughnessFactor=c.roughnessFactor,o.metallicRoughness=u}return l(n.emissiveTexture)&&(o.emissiveTexture=Lp(e,t,n.emissiveTexture,i,r)),l(n.normalTexture)&&!e._loadForClassification&&(o.normalTexture=Lp(e,t,n.normalTexture,i,r)),l(n.occlusionTexture)&&(o.occlusionTexture=Lp(e,t,n.occlusionTexture,i,r)),o.emissiveFactor=sf(m,n.emissiveFactor),o.alphaMode=n.alphaMode,o.alphaCutoff=n.alphaCutoff,o.doubleSided=n.doubleSided,o}function wie(e,t){let n=new bie;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Iie(e,t,n,i){let r=new bie,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Eie(o.attribute),r.positionalLabel=i,r}function Pie(e,t){let n=new Tie;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Die(e,t,n,i){let r=new Tie,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=y(o.constant,0);let s=y(o.divisor,0);return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function PBe(e,t,n,i,r,o){let s=new Cie;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=o;let a=n.texture;s.textureReader=Lp(e,t,a,i,r,mn.NEAREST);let u=(l(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=u,s}function DBe(e,t,n,i,r,o,s,a){let c=new Cie,u=n.featureIds,f=u.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Lp(e,t,f,r,o,mn.NEAREST),c.textureReader.channels=u.channels,c.positionalLabel=a,c}function RBe(e,t,n,i,r,o){let s=new z2e,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=b6(e,At,u),p=vie(e,t,f,d,a,c,i,o);s.attributes.push(p.attribute),r.attributePlans.push(p)}return s}function OBe(e,t,n,i,r,o){let s=new H2e,a=new Nx(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=IBe(e,t,t.materials[c],r,o));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=MBe(e,t,d,a));let p=e._loadForClassification,g=u.KHR_draco_mesh_compression,h=!1,x=n.attributes;if(l(x)){for(let O in x)if(x.hasOwnProperty(O)){let R=x[O],L=b6(e,At,O),N=L.modelSemantic;if(p&&!ABe(N))continue;N===At.FEATURE_ID&&(h=!0);let _=vie(e,t,R,L,g,i,f,o);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let b=n.targets;if(l(b)&&!p){let O=b.length;for(let R=0;R<O;++R)s.morphTargets.push(RBe(e,t,b[R],f,a,o))}let C=n.indices;if(l(C)){let O=wBe(e,t,C,g,h,f,o);l(O)&&(a.indicesPlan=O,s.indices=O.indices)}let A=u.EXT_structural_metadata,T=u.EXT_mesh_features,S=u.EXT_feature_metadata,v=l(S);l(T)?LBe(e,t,s,T,r,o):v&&NBe(e,t,s,S,r,o),l(A)?FBe(s,A):v&&BBe(e,s,S);let I=n.mode;if(p&&I!==Le.TRIANGLES)throw new de("Only triangle meshes can be used for classification.");return s.primitiveType=I,s}function MBe(e,t,n){let i=n.indices;return mU(e,t,i,!1)}function LBe(e,t,n,i,r,o){let s;l(i)&&l(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],u=`featureId_${a}`,f;l(c.texture)?f=PBe(e,t,c,r,o,u):l(c.attribute)?f=wie(c,u):f=Pie(c,u),n.featureIds.push(f)}}function NBe(e,t,n,i,r,o){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(l(c)){let f=c.length;for(let d=0;d<f;++d){let p=c[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),x=s[g].count,b=`featureId_${a}`;a++;let C;l(p.featureIds.attribute)?C=Iie(p,h,x,b):C=Die(p,h,x,b),n.featureIds.push(C)}}let u=i.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),x=s[g].count,b=`featureId_${a}`;a++;let C=DBe(e,t,p,h,r,o,x,b);n.featureIds.push(C)}}}function FBe(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function BBe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function kBe(e,t,n,i){let r=n.EXT_mesh_gpu_instancing,o=new G2e,s=r.attributes;if(l(s)){for(let f in s)if(s.hasOwnProperty(f)){let d=s[f];o.attributes.push(vBe(e,t,d,s,f,i))}}let a=y(r.extensions,y.EMPTY_OBJECT),c=n.EXT_instance_features,u=a.EXT_feature_metadata;return l(c)?UBe(o,c):l(u)&&VBe(t,o,u,e._sortedPropertyTableIds),o}function UBe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=wie(r,o):s=Pie(r,o),e.featureIds.push(s)}}function VBe(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o)){let s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.featureTable,f=i.indexOf(u),d=r[u].count,p=`instanceFeatureId_${a}`,g;l(c.featureIds.attribute)?g=Iie(c,f,d,p):g=Die(c,f,d,p),t.featureIds.push(g)}}}function zBe(e,t,n,i,r){let o=new j2e;o.name=n.name,o.matrix=sf(F,n.matrix),o.translation=sf(m,n.translation),o.rotation=sf(Ne,n.rotation),o.scale=sf(m,n.scale);let s=y(n.extensions,y.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(l(a)){if(e._loadForClassification)throw new de("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");o.instances=kBe(e,t,s,r)}l(c)&&(o.articulationName=c.articulationName);let u=n.mesh;if(l(u)){let f=t.meshes[u],d=f.primitives,p=d.length;for(let b=0;b<p;++b)o.primitives.push(OBe(e,t,d[b],l(o.instances),i,r));let g=y(n.weights,f.weights),x=o.primitives[0].morphTargets.length;o.morphWeights=l(g)?g.slice():new Array(x).fill(0)}return o}function HBe(e,t,n,i){if(!l(t.nodes))return[];let r,o,s=t.nodes.length,a=new Array(s);for(r=0;r<s;++r){let c=zBe(e,t,t.nodes[r],n,i);c.index=r,a[r]=c}for(r=0;r<s;++r){let c=t.nodes[r].children;if(l(c)){let u=c.length;for(o=0;o<u;++o)a[r].children.push(a[c[o]])}}return a}function GBe(e,t,n,i){let r=new W2e,o=n.joints,s=o.length,a=new Array(s);for(let u=0;u<s;++u)a[u]=i[o[u]];r.joints=a;let c=n.inverseBindMatrices;return l(c)?r.inverseBindMatrices=mU(e,t,c):r.inverseBindMatrices=new Array(s).fill(F.IDENTITY),r}function WBe(e,t,n){let i=t.skins;if(e._loadForClassification||!l(i))return[];let r=t.skins.length,o=new Array(r);for(let a=0;a<r;++a){let c=GBe(e,t,t.skins[a],n);c.index=a,o[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;l(c)&&(n[a].skin=o[c])}return o}async function jBe(e,t,n,i,r,o){let s=new vD({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:r,frameState:o,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function qBe(e,t,n){let i=new Y2e,r=n.input;i.input=mU(e,t,r);let o=n.interpolation;i.interpolation=y(Id[o],Id.LINEAR);let s=n.output;return i.output=mU(e,t,s,!0),i}function YBe(e,t){let n=new X2e,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=q2e[r],n}function XBe(e,t,n){let i=new K2e,r=e.sampler;return i.sampler=t[r],i.target=YBe(e.target,n),i}function KBe(e,t,n,i){let r,o=new J2e;o.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(r=0;r<a;r++){let p=qBe(e,t,s[r]);p.index=r,c[r]=p}let u=n.channels,f=u.length,d=new Array(f);for(r=0;r<f;r++)d[r]=XBe(u[r],c,i);return o.samplers=c,o.channels=d,o}function JBe(e,t,n){let i=t.animations;if(e._loadForClassification||!l(i))return[];let r=t.animations.length,o=new Array(r);for(let s=0;s<r;++s){let a=KBe(e,t,t.animations[s],n);a.index=s,o[s]=a}return o}function ZBe(e){let t=new Z2e;t.name=e.name;let n=e.type.toUpperCase();return t.type=$a[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function $Be(e){let t=new $2e;t.name=e.name;let n=e.stages,i=n.length,r=new Array(i);for(let o=0;o<i;o++){let s=ZBe(n[o]);r[o]=s}return t.stages=r,t}function QBe(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations;if(!l(n))return[];let i=n.articulations;if(!l(i))return[];let r=i.length,o=new Array(r);for(let s=0;s<r;s++){let a=$Be(i[s]);o[s]=a}return o}function e3e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function t3e(e,t){let n=new eBe,i=e3e(e);return n.nodes=i.map(function(r){return t[r]}),n}var n3e=new m;function i3e(e,t,n,i){let r=y(t.extensions,y.EMPTY_OBJECT),o=r.EXT_structural_metadata,s=r.EXT_feature_metadata,a=r.CESIUM_RTC;if(l(s)){let C=s.featureTables,A=s.featureTextures,T=l(C)?C:[],S=l(A)?A:[];e._sortedPropertyTableIds=Object.keys(T).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let c=HBe(e,t,n,i),u=WBe(e,t,c),f=JBe(e,t,c),d=QBe(t),p=t3e(t,c),g=new tBe,h=new Q2e,x=t.asset.copyright;if(l(x)){let C=x.split(";").map(function(A){return new vt(A.trim())});h.credits=C}if(g.asset=h,g.scene=p,g.nodes=c,g.skins=u,g.animations=f,g.articulations=d,g.upAxis=e._upAxis,g.forwardAxis=e._forwardAxis,l(a)){let C=m.fromArray(a.center,0,n3e);g.transform=F.fromTranslation(C,g.transform)}if(e._components=g,l(o)||l(s)){let C=jBe(e,t,o,s,n,i);e._loaderPromises.push(C)}let b=[];return b.push.apply(b,e._loaderPromises),e._incrementallyLoadTextures||b.push.apply(b,e._texturesPromises),Promise.all(b)}function r3e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._textureLoaders.length=0}function Rie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._bufferViewLoaders.length=0}function o3e(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._geometryLoaders.length=0}function s3e(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}function a3e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Pd.prototype.isUnloaded=function(){return this._state===Nr.UNLOADED};Pd.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&ki.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,r3e(this),Rie(this),o3e(this),s3e(this),a3e(this),this._components=void 0,this._typedArray=void 0,this._state=Nr.UNLOADED};var Jm=Pd;function C6(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function hU(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Dd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ht.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0);let r=l(e.depthTexture)||l(e.depthRenderbuffer),o=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);this._bind();let s,a,c,u,f;if(l(e.colorTextures)){let d=e.colorTextures;for(u=this._colorTextures.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)s=d[c],f=this._gl.COLOR_ATTACHMENT0+c,C6(this,f,s),this._activeColorAttachments[c]=f,this._colorTextures[c]=s}if(l(e.colorRenderbuffers)){let d=e.colorRenderbuffers;for(u=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)a=d[c],f=this._gl.COLOR_ATTACHMENT0+c,hU(this,f,a),this._activeColorAttachments[c]=f,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,C6(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,hU(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,hU(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,C6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,hU(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(Dd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Dd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Dd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Dd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Dd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Dd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Dd.prototype.getColorTexture=function(e){return this._colorTextures[e]};Dd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Dd.prototype.isDestroyed=function(){return!1};Dd.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let r=t[e];l(r)&&r.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let r=i[e];l(r)&&r.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var ea=Dd;function KT(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let r=e.colorRenderbuffers,o=e.colorTextures;if(l(r)!==l(o))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new ea({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new ea({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}KT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};KT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};KT.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};KT.prototype.isDestroyed=function(){return!1};KT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var ID=KT;var Al={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Al.RGBA4||e===Al.RGBA8||e===Al.RGBA16F||e===Al.RGBA32F||e===Al.RGB5_A1||e===Al.RGB565||e===Al.DEPTH_COMPONENT16||e===Al.STENCIL_INDEX8||e===Al.DEPTH_STENCIL||e===Al.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Al.RGBA32F:e===te.HALF_FLOAT_OES?Al.RGBA16F:Al.RGBA8}},kc=Object.freeze(Al);function PD(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ht.maximumRenderbufferSize,r=y(e.format,kc.RGBA4),o=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(PD.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});PD.prototype._getRenderbuffer=function(){return this._renderbuffer};PD.prototype.isDestroyed=function(){return!1};PD.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var ou=PD;function fs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(fs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});fs.prototype.isDirty=function(e,t,n,i,r){n=y(n,1);let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};fs.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?y(i,1):1,r=y(r,this._color?y(this._pixelDatatype,Xe.UNSIGNED_BYTE):void 0),o=y(o,this._color?y(this._pixelFormat,ct.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Lt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:mn.NEAREST}),this._numSamples>1){let a=kc.getColorFormat(r);this._colorRenderbuffers[s]=new ou({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Lt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Xe.UNSIGNED_INT_24_8,sampler:mn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new ou({context:e,width:t,height:n,format:kc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new ou({context:e,width:t,height:n,format:kc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Lt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_COMPONENT,pixelDatatype:Xe.UNSIGNED_INT,sampler:mn.NEAREST}):this._depthRenderbuffer=new ou({context:e,width:t,height:n,format:kc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new ID({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new ea({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};fs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};fs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};fs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};fs.prototype.getDepthTexture=function(){return this._depthTexture};fs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};fs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};fs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};fs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};fs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};fs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fs.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&l(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),l(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),l(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=fs;var DD=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; - #ifdef HAS_NORMALS - // renormalize after interpolation - attributes.normalEC = normalize(v_normalEC); - #endif +vec2 neighborContribution(float log2Depth, vec2 offset) +{ + float dist = u_distanceAndEdlStrength.x; + vec2 texCoordOrig = v_textureCoordinates + offset * dist; + vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); + vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); - #ifdef HAS_TANGENTS - attributes.tangentEC = normalize(v_tangentEC); - #endif + float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); + float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); - #ifdef HAS_BITANGENTS - attributes.bitangentEC = normalize(v_bitangentEC); - #endif + // ignore depth values that are the clear depth + if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { + return vec2(0.0); + } - // Everything else is dynamically generated in GeometryPipelineStage - setDynamicVaryings(attributes); + // interpolate the two adjacent depth values + float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); + return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); } -`;var UO=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ - vec4 computedPosition; - // Compute positions in different coordinate systems - vec3 positionMC = attributes.positionMC; - v_positionMC = positionMC; - v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; +void main() +{ + float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - vec3 position2D = attributes.position2D; - vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; - computedPosition = czm_projection * vec4(positionEC, 1.0); - #else - computedPosition = czm_projection * vec4(v_positionEC, 1.0); - #endif + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); + eyeCoordinate /= eyeCoordinate.w; - // Sometimes the custom shader and/or style needs this - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) - // Note that this is a 32-bit position which may result in jitter on small - // scales. - v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - #endif + float log2Depth = log2(-eyeCoordinate.z); - #ifdef HAS_NORMALS - v_normalEC = normalize(normal * attributes.normalMC); - #endif + if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer + { + discard; + } - #ifdef HAS_TANGENTS - v_tangentEC = normalize(normal * attributes.tangentMC); - #endif + vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); - #ifdef HAS_BITANGENTS - v_bitangentEC = normalize(normal * attributes.bitangentMC); - #endif + // sample from neighbors left, right, down, up + vec2 texelSize = 1.0 / czm_viewport.zw; - // All other varyings need to be dynamically generated in - // GeometryPipelineStage - setDynamicVaryings(attributes); - - return computedPosition; + vec2 responseAndCount = vec2(0.0); + + responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); + + float response = responseAndCount.x / responseAndCount.y; + float strength = u_distanceAndEdlStrength.y; + float shade = exp(-response * 300.0 * strength); + color.rgb *= shade; + out_FragColor = vec4(color); + + // Input and output depth are the same. + gl_FragDepth = depthOrLogDepth; } -`;var cE=`vec2 computeSt(float featureId) +`;function JT(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(JT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function c3e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var T6=new H;function l3e(e,t){let n=new ze({defines:["LOG_DEPTH_WRITE"],sources:[DD]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return T6.x=e._radius,T6.y=e._strength,T6}},r=Ue.fromCache({blending:dn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ee.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ue.fromCache(),pass:Ee.CESIUM_3D_TILE,owner:e})}function u3e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),l3e(e,t)}function Oie(e){return e.drawBuffers&&e.fragmentDepth}JT.isSupported=Oie;function f3e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=ze.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() +{ + czm_point_cloud_post_process_main(); +#ifdef LOG_DEPTH + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}JT.prototype.update=function(e,t,n,i){if(!Oie(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,u3e(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Le.POINTS||u.pass===Ee.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=tt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=f3e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return c3e(this),ue(this)};var Np=JT;function Mie(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Mie.isSupported=function(e){return Np.isSupported(e.context)};var Zm=Mie;var Aa={},d3e=new oe(0,0,0,1),ec=new oe,m3e=new Ye,A6=new H,E6=new H;Aa.wgs84ToWindowCoordinates=function(e,t,n){return Aa.wgs84WithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Lie=new oe,Nie=new m;function RD(e,t,n,i){let r=n.viewMatrix,o=F.multiplyByVector(r,oe.fromElements(e.x,e.y,e.z,1,Lie),Lie),s=m.multiplyComponents(t,m.normalize(o,Nie),Nie);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,o,i)}var h3e=new me(Math.PI,D.PI_OVER_TWO),p3e=new m,_3e=new m;Aa.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Aa.computeActualWgs84Position(r,t,d3e);if(!l(o))return;let s=e.canvas,a=m3e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===ne.SCENE2D){let f=e.mapProjection,d=h3e,p=f.project(d,p3e),g=m.clone(c.position,_3e),h=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),b=c.frustum.projectionMatrix,C=c.positionWC.y,A=m.fromElements(D.sign(C)*p.x-C,0,-c.positionWC.x),T=Mt.pointToGLWindowCoordinates(b,x,A);if(C===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-C,ec=RD(o,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,A6),a.x+=T.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,ec=RD(o,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,E6)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-C,ec=RD(o,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,A6),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,ec=RD(o,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,E6)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(A6,i),(i.x<0||i.x>s.clientWidth)&&(i.x=E6.x)}}if(r.mode!==ne.SCENE2D||u){if(ec=RD(o,n,c,ec),ec.z<0&&!(c.frustum instanceof nn)&&!(c.frustum instanceof vo))return;i=Aa.clipToGLWindowCoordinates(a,ec,i)}return i.y=s.clientHeight-i.y,i};Aa.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=Aa.wgs84ToWindowCoordinates(e,t,n),!!l(n))return Aa.transformWindowToDrawingBuffer(e,n,n)};var Fp=new m,g3e=new me;Aa.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,g3e);if(!l(o))return;if(r.project(o,Fp),i===ne.COLUMBUS_VIEW)return m.fromElements(Fp.z,Fp.x,Fp.y,n);if(i===ne.SCENE2D)return m.fromElements(0,Fp.x,Fp.y,n);let s=e.morphTime;return m.fromElements(D.lerp(Fp.z,t.x,s),D.lerp(Fp.x,t.y,s),D.lerp(Fp.y,t.z,s),n)};var Fie=new m,Bie=new m,kie=new F;Aa.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Fie),F.computeViewportTransformation(e,0,1,kie),F.multiplyByPoint(kie,Fie,Bie),H.fromCartesian3(Bie,n)};Aa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*r,t.y*o,n)};var y3e=new oe,Uie=new oe;Aa.drawingBufferToWgs84Coordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,y3e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=F.multiplyByVector(o.inverseViewProjection,f,Uie);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Uie,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=F.multiplyByVector(o.inverseView,d,d)}return m.fromCartesian4(d,i)};var Qi=Aa;var x3e={LEFT:-1,NONE:0,RIGHT:1},Uc=Object.freeze(x3e);var ZT={};ZT._deprecationWarning=Q;var Bp=Uint32Array.BYTES_PER_ELEMENT;ZT.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Bp;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Bp;let s=r.getUint32(t,!0);t+=Bp;let a=r.getUint32(t,!0);t+=Bp;let c=r.getUint32(t,!0);t+=Bp;let u=r.getUint32(t,!0);t+=Bp;let f=r.getUint32(t,!0);t+=Bp;let d;u>=570425344?(t-=Bp*2,d=a,u=c,f=0,a=0,c=0,ZT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Bp,d=u,u=a,f=c,a=0,c=0,ZT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Lr(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Lr(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(ZT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var OD=ZT;function MD(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Vie(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function b3e(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=X.createTypedArray(n,i),r[t]=o),o}MD.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),Vie(this,e,t,n,1,i.byteOffset)):i};MD.prototype.hasProperty=function(e){return l(this.json[e])};MD.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),Vie(this,e,t,n,this.featuresLength,i.byteOffset)):b3e(this,e,t,i)};MD.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Rd=MD;function LD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=y(e.parseAsPropertyAttributes,!1),o=e.customAttributeOutput,s=C3e(n),a;l(s.jsonProperties)&&(a=new Mp({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new hx({extension:s.hierarchy,binaryBody:i}));let u=Sd.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let b=A3e(t,u,f,i,o);g=b.transcodedSchema,p=[new Mx({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=T3e(t,u,f,i);g=b.transcodedSchema;let C=b.featureTableJson;d=new gl({count:C.count,properties:C.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let h=[];if(l(d)||l(a)||l(c)){let b=new Bc({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});h.push(b)}let x={schema:g,propertyTables:h,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ta(x)}function C3e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(LD._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function T3e(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new de(`Property ${d} requires a batch table binary.`);let p=n[d],g=nu(p);o[d]={bufferView:a},r[d]=zie(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=vd.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function A3e(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new de(`Property ${d} requires a batch table binary.`);let g=$t.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let h=zie(p);h.name=d,o[g]=h;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=nu(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Bt.Attribute;C.name=x,C.count=e,C.type=p.type;let A=X.fromTypedArray(b);(A===X.INT||A===X.UNSIGNED_INT||A===X.DOUBLE)&&(LD._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),C.componentDatatype=X.fromTypedArray(b),C.typedArray=b,r.push(C),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:o};let u=vd.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function zie(e){let t=E3e(e.componentType);return{type:e.type,componentType:t}}function E3e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}LD._deprecationWarning=Q;LD._oneTimeWarning=Nt;var kp=LD;var Fx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},S3e=Bt.FeatureIdAttribute;function Bg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),u=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.loadIndicesForWireframe,!1),g=y(e.loadPrimitiveOutline,!0),h=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=h,this._state=Fx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Bg.prototype=Object.create(cr.prototype),Bg.prototype.constructor=Bg);Object.defineProperties(Bg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bg.prototype.load=function(){if(l(this._promise))return this._promise;let e=OD.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,s=new Rd(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(m.fromArray(a))),this._batchTable={json:r,binary:o};let c=new Jm({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=Fx.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=Fx.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return v3e(u,f)}),this._promise};function v3e(e,t){e.unload(),e._state=Fx.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}Bg.prototype.process=function(e){if(this._state===Fx.READY)return!0;if(this._state!==Fx.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),w3e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=Fx.READY,!0};function w3e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=kp({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Bc({name:Sd.BATCH_TABLE_CLASS_NAME,count:i});r=new Ta({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)Hie(o[a]);t.structuralMetadata=r}function Hie(e){let t=e.children.length;for(let i=0;i<t;i++)Hie(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=$t.getAttributeBySemantic(r,At.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new S3e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}Bg.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var ND=Bg;function kg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(kg.prototype=Object.create(cr.prototype),kg.prototype.constructor=kg);Object.defineProperties(kg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});kg.prototype.load=function(){return Promise.resolve(this)};kg.prototype.process=function(e){return l(this._components)||(this._components=V3e(this._geoJson,e),this._geoJson=void 0),!0};function I3e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function P3e(){this.features=[]}function S6(e){let t=e[0],n=e[1],i=y(e[2],0);return new m(t,n,i)}function v6(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=S6(e[r]);return[n]}function D3e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=v6(e[i])[0];return n}function Gie(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=v6(e[i])[0];return n}function R3e(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Gie(e[i]));return n}function O3e(e){return[S6(e)]}function M3e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=S6(e[i]);return n}var L3e={LineString:v6,MultiLineString:D3e,MultiPolygon:R3e,Polygon:Gie,MultiPoint:M3e,Point:O3e},N3e={LineString:Le.LINES,MultiLineString:Le.LINES,MultiPolygon:Le.LINES,Polygon:Le.LINES,MultiPoint:Le.POINTS,Point:Le.POINTS};function Wie(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=L3e[n],r=N3e[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new I3e;r===Le.LINES?s.lines=i(o):r===Le.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function F3e(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)Wie(n[r],t)}var B3e={FeatureCollection:F3e,Feature:Wie},pU=new m;function k3e(e,t,n){let i=0,r=0,o=e.length;for(let L=0;L<o;L++){let N=e[L];if(l(N.lines)){let _=N.lines.length;for(let E=0;E<_;E++){let w=N.lines[E];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Be.createTypedArray(i,r),u=Be.fromTypedArray(c),f=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let L=0;L<o;L++){let N=e[L];if(!l(N.lines))continue;let _=N.lines.length;for(let E=0;E<_;E++){let w=N.lines[E],P=w.length;for(let M=0;M<P;M++){let B=w[M],V=m.fromDegrees(B.x,B.y,B.z,re.WGS84,pU),U=F.multiplyByPoint(t,V,pU);m.minimumByComponent(f,U,f),m.maximumByComponent(d,U,d),m.pack(U,s,p*3),a[p]=L,M<P-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let h=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let x=mt.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=mt.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let C=new Bt.Attribute;C.semantic=At.POSITION,C.componentDatatype=X.FLOAT,C.type=cn.VEC3,C.count=i,C.min=f,C.max=d,C.buffer=h;let A=new Bt.Attribute;A.semantic=At.FEATURE_ID,A.setIndex=0,A.componentDatatype=X.FLOAT,A.type=cn.SCALAR,A.count=i,A.buffer=x;let T=[C,A],S=new Bt.Material;S.unlit=!0;let v=new Bt.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let I=new Bt.FeatureIdAttribute;I.featureCount=o,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let O=[I],R=new Bt.Primitive;return R.attributes=T,R.indices=v,R.featureIds=O,R.primitiveType=Le.LINES,R.material=S,R}function U3e(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let S=e[T];l(S.points)&&(i+=S.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let S=e[T];if(!l(S.points))continue;let v=S.points.length;for(let I=0;I<v;I++){let O=S.points[I],R=m.fromDegrees(O.x,O.y,O.z,re.WGS84,pU),L=F.multiplyByPoint(t,R,pU);m.minimumByComponent(a,L,a),m.maximumByComponent(c,L,c),m.pack(L,o,u*3),s[u]=T,u++}}let f=mt.createVertexBuffer({typedArray:o,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Bt.Attribute;p.semantic=At.POSITION,p.componentDatatype=X.FLOAT,p.type=cn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Bt.Attribute;g.semantic=At.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=cn.SCALAR,g.count=i,g.buffer=d;let h=[p,g],x=new Bt.Material;x.unlit=!0;let b=new Bt.FeatureIdAttribute;b.featureCount=r,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let C=[b],A=new Bt.Primitive;return A.attributes=h,A.featureIds=C,A.primitiveType=Le.POINTS,A.material=x,A}function V3e(e,t){let n=new P3e,i=B3e[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new de("GeoJSON must have at least one feature");let s={};for(let L=0;L<o;L++){let N=r[L],_=y(N.properties,y.EMPTY_OBJECT);for(let E in _)_.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(o)))}for(let L=0;L<o;L++){let N=r[L];for(let _ in s)if(s.hasOwnProperty(_)){let E=y(N.properties[_],"");s[_][L]=E}}let a=new Mp({count:o,properties:s}),u=[new Bc({id:0,count:o,jsonMetadataTable:a})],f=vd.fromJson({}),d=new Ta({schema:f,propertyTables:u}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),h=!1,x=!1;for(let L=0;L<o;L++){let N=r[L];if(l(N.lines)){h=!0;let _=N.lines.length;for(let E=0;E<_;E++){let w=N.lines[E],P=w.length;for(let M=0;M<P;M++)m.minimumByComponent(p,w[M],p),m.maximumByComponent(g,w[M],g)}}if(l(N.points)){x=!0;let _=N.points.length;for(let E=0;E<_;E++){let w=N.points[E];m.minimumByComponent(p,w,p),m.maximumByComponent(g,w,g)}}}let b=m.midpoint(p,g,new m),C=m.fromDegrees(b.x,b.y,b.z,re.WGS84,new m),A=Mt.eastNorthUpToFixedFrame(C,re.WGS84,new F),T=F.inverseTransformation(A,new F),S=[];h&&S.push(k3e(r,T,t)),x&&S.push(U3e(r,T,t));let v=new Bt.Node;v.index=0,v.primitives=S;let I=[v],O=new Bt.Scene;O.nodes=I;let R=new Bt.Components;return R.scene=O,R.nodes=I,R.transform=A,R.structuralMetadata=d,R}kg.prototype.unload=function(){this._components=void 0};var FD=kg;var _U={};_U._deprecationWarning=Q;var Ug=Uint32Array.BYTES_PER_ELEMENT;_U.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Ug;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=Ug;let s=r.getUint32(t,!0);t+=Ug;let a=r.getUint32(t,!0);if(a===0)throw new de("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ug;let c=r.getUint32(t,!0);t+=Ug;let u=r.getUint32(t,!0);t+=Ug;let f=r.getUint32(t,!0);t+=Ug;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new de(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Ug;let p=Lr(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Lr(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(_U._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var BD=_U;var Up={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},gU=Bt.Attribute,z3e=Bt.FeatureIdAttribute,qie=Bt.Instances;function Vp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),u=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=Up.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Vp.prototype=Object.create(cr.prototype),Vp.prototype.constructor=Vp);Object.defineProperties(Vp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Vp.prototype.load=function(){if(l(this._promise))return this._promise;let e=BD.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,s=new Rd(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(o===0){let d=pl(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Jm(u);return this._gltfLoader=f,this._state=Up.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Up.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw H3e(this,d)}),this._promise};function H3e(e,t){e.unload(),e._state=Up.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}Vp.prototype.process=function(e){if(this._state===Up.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Up.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),j3e(this,i,e),G3e(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Up.READY,!0};function G3e(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=kp({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Bc({name:Sd.BATCH_TABLE_CLASS_NAME,count:i});r=new Ta({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var yU=new m,w6=new Array(4),W3e=new F;function j3e(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=Y3e(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),h=m.unpackArray(f),x=new m,b=new m,C=new m,A=new m,T=new $,S=new Ne,v=new Array(4),I=new m,O=new Array(3),R=new F;if(!l(s)){let U=ae.fromPoints(h);for(i=0;i<h.length;i++)m.subtract(h[i],U.center,yU),f[3*i+0]=yU.x,f[3*i+1]=yU.y,f[3*i+2]=yU.z;let G=F.fromTranslation(U.center,W3e);t.transform=F.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<o;i++){x=m.clone(h[i]),l(s)&&m.add(x,m.unpack(s),x),c&&(X3e(r,a,i,S,x,C,b,A,T,R),Ne.pack(S,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(K3e(r,i,I),m.pack(I,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let U=r.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let L=new qie;L.transformInWorldSpace=!0;let N=e._buffers,_=new gU;if(_.name="Instance Translation",_.semantic=Yo.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=cn.VEC3,_.count=o,_.typedArray=f,!c){let U=mt.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});U.vertexArrayDestroyable=!1,N.push(U),_.buffer=U}if(L.attributes.push(_),c){let U=new gU;U.name="Instance Rotation",U.semantic=Yo.ROTATION,U.componentDatatype=X.FLOAT,U.type=cn.VEC4,U.count=o,U.typedArray=d,L.attributes.push(U)}if(u){let U=new gU;if(U.name="Instance Scale",U.semantic=Yo.SCALE,U.componentDatatype=X.FLOAT,U.type=cn.VEC3,U.count=o,c)U.typedArray=p;else{let G=mt.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,N.push(G),U.buffer=G}L.attributes.push(U)}let E=new gU;E.name="Instance Feature ID",E.setIndex=0,E.semantic=Yo.FEATURE_ID,E.componentDatatype=X.FLOAT,E.type=cn.SCALAR,E.count=o;let w=mt.createVertexBuffer({context:n.context,typedArray:g,usage:Fe.STATIC_DRAW});w.vertexArrayDestroyable=!1,N.push(w),E.buffer=w,L.attributes.push(E);let P=new z3e;P.propertyTableId=0,P.setIndex=0,P.positionalLabel="instanceFeatureId_0",L.featureIds.push(P);let M=t.nodes,B=M.length,V=!1;for(i=0;i<B;i++){let U=M[i];U.primitives.length>0&&(U.instances=V?q3e(L):L,V=!0)}}function q3e(e){let t=new qie;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=je(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function Y3e(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(r))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new de("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var jie=new Array(4);function X3e(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,w6),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,jie),p=!1;if(l(f)){if(!l(d))throw new de("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(f,0,o),m.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,w6),h=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,jie);if(l(g)){if(!l(h))throw new de("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Xn.octDecodeInRange(g[0],g[1],65535,o),Xn.octDecodeInRange(h[0],h[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(r,re.WGS84,u),F.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(m.cross(s,o,a),m.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Ne.fromRotationMatrix(c,i)}function K3e(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,w6);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function J3e(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}Vp.prototype.isUnloaded=function(){return this._state===Up.UNLOADED};Vp.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),J3e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Up.UNLOADED};var kD=Vp;var Z3e={STOPPED:0,ANIMATING:1},Od=Object.freeze(Z3e);function $T(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}$T.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Ne)return Ne};$T.prototype.evaluate=fe.throwInstantiationError;$T.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};$T.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};$T.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var lr=$T;function QT(e){this._value=e,this._valueType=lr.getPointType(e)}Object.defineProperties(QT.prototype,{value:{get:function(){return this._value}}});QT.prototype.findTimeInterval=function(e){};QT.prototype.wrapTime=function(e){return 0};QT.prototype.clampTime=function(e){return 0};QT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var UD=QT;function eA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(eA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});eA.prototype.findTimeInterval=lr.prototype.findTimeInterval;eA.prototype.wrapTime=lr.prototype.wrapTime;eA.prototype.clampTime=lr.prototype.clampTime;eA.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new m),m.lerp(n[r],n[r+1],o,t))};var Vg=eA;var Yie={};Yie.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new m,s[a]=new m;r[0]=n[0]/t[0],o[0]=m.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(o[a],m.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var tA=Yie;var Xie=[],Kie=[],Jie=[],Zie=[];function $3e(e,t,n){let i=Xie,r=Jie,o=Kie,s=Zie;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),tA.solve(i,o,r,s)}function Q3e(e){let t=Xie,n=Jie,i=Kie,r=Zie;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new m),m.subtract(e[o+1],e[o-1],s),m.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new m),m.subtract(e[o],e[o-1],s),m.multiplyByScalar(s,3,s),tA.solve(t,i,n,r)}function El(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(El.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});El.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new El({times:t,points:n,inTangents:o,outTangents:r})};El.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new Vg({points:n,times:t});let i=Q3e(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new El({times:t,points:n,inTangents:o,outTangents:r})};El.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=lr.getPointType(n[0]);if(n.length<3)return new Vg({points:n,times:t});let s=$3e(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new El({times:t,points:n,inTangents:c,outTangents:a})};El.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);El.prototype.findTimeInterval=lr.prototype.findTimeInterval;var eke=new oe,nA=new m;El.prototype.wrapTime=lr.prototype.wrapTime;El.prototype.clampTime=lr.prototype.clampTime;El.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=eke;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=F.multiplyByVector(El.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,nA),d.add(t,nA,t),d.multiplyByScalar(o[s],f.z,nA),d.add(t,nA,t),d.multiplyByScalar(r[s],f.w,nA),d.add(t,nA,t))};var zg=El;function iA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(iA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});iA.prototype.findTimeInterval=lr.prototype.findTimeInterval;iA.prototype.wrapTime=lr.prototype.wrapTime;iA.prototype.clampTime=lr.prototype.clampTime;iA.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var VD=iA;function tke(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Ne);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Ne.fastSlerp(a,c,s,r)}}function rA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=tke(this),this._lastTimeIndex=0}Object.defineProperties(rA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});rA.prototype.findTimeInterval=lr.prototype.findTimeInterval;rA.prototype.wrapTime=lr.prototype.wrapTime;rA.prototype.clampTime=lr.prototype.clampTime;rA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var zD=rA;var Bx=Bt.AnimatedPropertyType;function P6(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,rke(this)}Object.defineProperties(P6.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function nke(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new zg({times:e,points:n,inTangents:i,outTangents:r})}function $ie(e,t,n,i){if(e.length===1&&t.length===1)return new UD(t[0]);switch(n){case Id.STEP:return new VD({times:e,points:t});case Id.CUBICSPLINE:return nke(e,t);case Id.LINEAR:return i===Bx.ROTATION?new zD({times:e,points:t}):new Vg({times:e,points:t})}}function ike(e,t,n,i,r){let o=[];if(i===Bx.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===Id.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push($ie(e,f,n,i))}}else o.push($ie(e,t,n,i));return o}var I6;function rke(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=ike(i,r,o,a,u);switch(e._splines=f,e._path=a,a){case Bx.TRANSLATION:case Bx.SCALE:I6=new m;break;case Bx.ROTATION:I6=new Ne;break;case Bx.WEIGHTS:break}}P6.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===Bx.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);r[n]=o.evaluate(s,I6)}}};var HD=P6;function D6(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ee.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,Tl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Od.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,oke(this)}Object.defineProperties(D6.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function oke(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new HD({channel:u,runtimeAnimation:e,runtimeNode:p}),h=u.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}D6.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var GD=D6;function zp(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(zp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function R6(e,t,n){let i=e._model,r=new GD(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}zp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return R6(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return R6(this,n[i],e)};zp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=R6(this,n[o],e);i.push(s)}return i};zp.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};zp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};zp.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};zp.prototype.get=function(e){return this._runtimeAnimations[e]};var xU=[];function ske(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}zp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,r),a.delay,new ee)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=ee.lessThanOrEquals(c,r),p=l(f)&&ee.greaterThan(r,f),g=0;if(u!==0){let b=ee.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,b):b/u}let h=a.loop===Tl.REPEAT||a.loop===Tl.MIRRORED_REPEAT,x=(d||h&&!l(a.startTime))&&(g<=1||h)&&!p;if(g===a._prevAnimationDelta){let b=a._state===Od.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=g,x||a._state===Od.ANIMATING){if(x&&a._state===Od.STOPPED&&(a._state=Od.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Tl.REPEAT)g=g-Math.floor(g);else if(a.loop===Tl.MIRRORED_REPEAT){let C=Math.floor(g),A=g-C;g=C%2===1?1-A:A}a.reverse&&(g=1-g);let b=g*u*a.multiplier;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Od.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&xU.push(a))}}n=xU.length;for(let s=0;s<n;++s){let a=xU[s];t.splice(t.indexOf(a),1),e.afterRender.push(ske(this,o,a))}return xU.length=0,i};var WD=zp;function kx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(kx.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});kx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};kx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};kx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};kx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};kx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var jD=kx;var qD={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};qD.getStyleCommandsNeeded=function(e,t){return t===0?qD.ALL_OPAQUE:t===e?qD.ALL_TRANSLUCENT:qD.OPAQUE_AND_TRANSLUCENT};var Md=Object.freeze(qD);var Hg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Hg.is3DTiles=function(e){switch(e){case Hg.TILE_GLTF:case Hg.TILE_B3DM:case Hg.TILE_I3DM:case Hg.TILE_PNTS:case Hg.TILE_GEOJSON:return!0;case Hg.GLTF:return!1}};var Ur=Object.freeze(Hg);function wo(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Md.ALL_OPAQUE,ake(this)}Object.defineProperties(wo.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function ake(e){let t=e._model,n=Ur.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new ws(s,r)}else for(r=0;r<i;r++)o[r]=new jD({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Fc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}wo.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Md.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};wo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};wo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};wo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};wo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};wo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};wo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};wo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};wo.prototype.getFeature=function(e){return this._features[e]};wo.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};wo.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};wo.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};wo.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};wo.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};wo.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};wo.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};wo.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};wo.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var cke=new z;wo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Fc.DEFAULT_COLOR_VALUE),this.setAllShow(Fc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,cke),Fc.DEFAULT_COLOR_VALUE):Fc.DEFAULT_COLOR_VALUE,r=l(e.show)?y(e.show.evaluate(n),Fc.DEFAULT_SHOW_VALUE):Fc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};wo.prototype.isDestroyed=function(){return!1};wo.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var YD=wo;var XD=`czm_modelMaterial defaultModelMaterial() { - float stepX = model_textureStep.x; - float centerX = model_textureStep.y; - - #ifdef MULTILINE_BATCH_TEXTURE - float stepY = model_textureStep.z; - float centerY = model_textureStep.w; + czm_modelMaterial material; + material.diffuse = vec3(0.0); + material.specular = vec3(1.0); + material.roughness = 1.0; + material.occlusion = 1.0; + material.normalEC = vec3(0.0, 0.0, 1.0); + material.emissive = vec3(0.0); + material.alpha = 1.0; + return material; +} - float xId = mod(featureId, model_textureDimensions.x); - float yId = floor(featureId / model_textureDimensions.x); - - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); - #else - return vec2(centerX + (featureId * stepX), 0.5); +vec4 handleAlpha(vec3 color, float alpha) +{ + #ifdef ALPHA_MODE_MASK + if (alpha < u_alphaCutoff) { + discard; + } #endif + + return vec4(color, alpha); } -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) -{ - int featureId = featureIds.SELECTED_FEATURE_ID; +SelectedFeature selectedFeature; +void main() +{ + #ifdef HAS_MODEL_SPLITTER + modelSplitterStage(); + #endif - if (featureId < model_featuresLength) - { - vec2 featureSt = computeSt(float(featureId)); + czm_modelMaterial material = defaultModelMaterial(); - feature.id = featureId; - feature.st = featureSt; - feature.color = texture(model_batchTexture, featureSt); - } - // Floating point comparisons can be unreliable in GLSL, so we - // increment the feature ID to make sure it's always greater - // then the model_featuresLength - a condition we check for in the - // pick ID, to avoid sampling the pick texture if the feature ID is - // greater than the number of features. - else - { - feature.id = model_featuresLength + 1; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } + ProcessedAttributes attributes; + geometryStage(attributes); - #ifdef HAS_NULL_FEATURE_ID - if (featureId == model_nullFeatureId) { - feature.id = featureId; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - #endif -} -`;var VO={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};VO.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=o4e(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),s4e(i);let c=s.featureIds.nullFeatureId,l=e.uniformMap;u(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),l.model_nullFeatureId=function(){return c}),s.shaderDestination===be.BOTH&&i.addVertexLines(cE),i.addFragmentLines(cE)};function Jre(e){return e instanceof Nt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Zre(e){return e instanceof Nt.FeatureIdTexture?be.FRAGMENT:be.BOTH}function o4e(e,t,n){let i,r;return u(t.instances)&&(r=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),u(r))?(i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Zre(r),featureIdDefine:Jre(r)}):(r=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Zre(r),featureIdDefine:Jre(r)})}function s4e(e){e.addStructField(VO.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(VO.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(VO.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Wg=VO;var Os={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Os.process=function(e,t,n){let i=e.shaderBuilder,r=e.model;i.addStruct(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",be.VERTEX),i.addStruct(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",be.FRAGMENT),i.addStruct(Wg.STRUCT_ID_SELECTED_FEATURE,Wg.STRUCT_NAME_SELECTED_FEATURE,be.BOTH),i.addFunction(Os.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Os.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,be.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Os.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Os.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.VERTEX),i.addFunction(Os.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Os.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.FRAGMENT),r.type===Vr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,be.FRAGMENT);let s=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=u(e.runtimeNode.node.instances),c=s&&!a,l=t.attributes.length;for(let f=0;f<l;f++){let d=t.attributes[f],p=an.getAttributeLocationCount(d.type),g=d.semantic===Et.POSITION,h;p>1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,a4e(e,d,h,p,s,a)}_4e(i,t.attributes),t.primitiveType===Be.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(UO),i.addFragmentLines(FO)};function a4e(e,t,n,i,r,o){let s=e.shaderBuilder,a=Zt.getAttributeInfo(t),c=r&&!o;i>1?u4e(e,t,n,i):l4e(e,t,n,c),d4e(s,a,c),f4e(s,a),u(t.semantic)&&c4e(s,t),m4e(s,a,r),h4e(s,a,c),p4e(s,a)}function c4e(e,t){let n=t.semantic,i=t.setIndex;switch(n){case Et.NORMAL:e.addDefine("HAS_NORMALS");break;case Et.TANGENT:e.addDefine("HAS_TANGENTS");break;case Et.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Et.TEXCOORD:case Et.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function l4e(e,t,n,i){let r=t.quantization,o,s;u(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===Et.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let l=a===Et.POSITION,f=l?0:n,d=an.getNumberOfComponents(o),p={index:f,value:u(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!l||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function u4e(e,t,n,i){let r=t.quantization,o,s;u(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.normalized,l=an.getNumberOfComponents(o)/i,f=X.getSizeInBytes(s),d=l*f,p=t.byteStride;for(let g=0;g<i;g++){let h=t.byteOffset+g*d,A={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:l,componentDatatype:s,offsetInBytes:h,strideInBytes:p,normalize:a};e.attributes.push(A)}}function f4e(e,t){let n=t.variableName,i=`v_${n}`,r;n==="normalMC"?(i="v_normalEC",r=t.glslType):n==="tangentMC"?(r="vec3",i="v_tangentEC"):r=t.glslType,e.addVarying(r,i)}function d4e(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===Et.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function m4e(e,t,n){let i=Os.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Os.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,o=t.variableName;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,t.glslType,o),e.addStructField(r,t.glslType,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function h4e(e,t,n){let i=Os.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function p4e(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(u(n)&&!u(i))return;let r=Os.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Os.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function _4e(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===Et.NORMAL?n=!0:o.semantic===Et.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Os.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var kO=Os;var zO=`#ifdef LIGHTING_PBR -vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes) -{ - czm_pbrParameters pbrParameters; - pbrParameters.diffuseColor = inputMaterial.diffuse; - pbrParameters.f0 = inputMaterial.specular; - pbrParameters.roughness = inputMaterial.roughness; - - #ifdef USE_CUSTOM_LIGHT_COLOR - vec3 lightColorHdr = model_lightColorHdr; - #else - vec3 lightColorHdr = czm_lightColorHdr; + FeatureIds featureIds; + featureIdStage(featureIds, attributes); + + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); + + #ifdef HAS_SELECTED_FEATURE_ID + selectedFeatureIdStage(selectedFeature, featureIds); #endif - vec3 color = inputMaterial.diffuse; - #ifdef HAS_NORMALS - color = czm_pbrLighting( - attributes.positionEC, - inputMaterial.normalEC, - czm_lightDirectionEC, - lightColorHdr, - pbrParameters - ); + #ifndef CUSTOM_SHADER_REPLACE_MATERIAL + materialStage(material, attributes, selectedFeature); + #endif - #ifdef USE_IBL_LIGHTING - color += imageBasedLightingStage( - attributes.positionEC, - inputMaterial.normalEC, - czm_lightDirectionEC, - lightColorHdr, - pbrParameters - ); - #endif + #ifdef HAS_CUSTOM_FRAGMENT_SHADER + customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); #endif - color *= inputMaterial.occlusion; - color += inputMaterial.emissive; + lightingStage(material, attributes); - // In HDR mode, the frame buffer is in linear color space. The - // post-processing stages (see PostProcessStageCollection) will handle - // tonemapping. However, if HDR is not enabled, we must tonemap else large - // values may be clamped to 1.0 - #ifndef HDR - color = czm_acesTonemapping(color); - #endif + #ifdef HAS_SELECTED_FEATURE_ID + cpuStylingStage(material, selectedFeature); + #endif - return color; -} -#endif + #ifdef HAS_MODEL_COLOR + modelColorStage(material); + #endif -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) -{ - // Even though the lighting will only set the diffuse color, - // pass all other properties so further stages have access to them. - vec3 color = vec3(0.0); + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(material); + #endif - #ifdef LIGHTING_PBR - color = computePbrLighting(material, attributes); - #else // unlit - color = material.diffuse; + vec4 color = handleAlpha(material.diffuse, material.alpha); + + #ifdef HAS_CLIPPING_PLANES + modelClippingPlanesStage(color); #endif - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - // The colors resulting from point cloud styles are adjusted differently. - color = czm_gammaCorrect(color); - #elif !defined(HDR) - // If HDR is not enabled, the frame buffer stores sRGB colors rather than - // linear colors so the linear value must be converted. - color = czm_linearToSrgb(color); + #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) + silhouetteStage(color); #endif - material.diffuse = color; -} -`;var g4e={UNLIT:0,PBR:1},Zm=Object.freeze(g4e);var Qre={name:"LightingPipelineStage"};Qre.process=function(e,t){let n=e.model,i=e.lightingOptions,r=e.shaderBuilder;if(u(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,be.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",be.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===Zm.PBR?r.addDefine("LIGHTING_PBR",void 0,be.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,be.FRAGMENT),r.addFragmentLines(zO)};var HO=Qre;var GO=`// If the style color is white, it implies the feature has not been styled. -bool isDefaultStyleColor(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); + out_FragColor = color; } +`;var KD=`precision highp float; -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) -{ - vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); - vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; - return color; +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { + czm_modelVertexOutput vsOutput; + vsOutput.positionMC = positionMC; + vsOutput.pointSize = 1.0; + return vsOutput; } -vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) +void main() { - return vec2(textureTransform * vec3(texCoord, 1.0)); -} + // Initialize the attributes struct with all + // attributes except quantized ones. + ProcessedAttributes attributes; + initializeAttributes(attributes); -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) -{ - // Geometry normal. This is already normalized - vec3 ng = attributes.normalEC; + // Dequantize the quantized ones and add them to the + // attributes struct. + #ifdef USE_DEQUANTIZATION + dequantizationStage(attributes); + #endif - vec3 normal = ng; - #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) - vec2 normalTexCoords = TEXCOORD_NORMAL; - #ifdef HAS_NORMAL_TEXTURE_TRANSFORM - normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform); - #endif - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // If derivatives are available (not IE 10), compute tangents - vec3 positionEC = attributes.positionEC; - vec3 pos_dx = dFdx(positionEC); - vec3 pos_dy = dFdy(positionEC); - vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0)); - vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0)); - vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); - t = normalize(t - ng * dot(ng, t)); - vec3 b = normalize(cross(ng, t)); - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #endif + #ifdef HAS_MORPH_TARGETS + morphTargetsStage(attributes); #endif - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - normal = -normal; - } + #ifdef HAS_SKINNING + skinningStage(attributes); #endif - return normal; -} -#endif - -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) -{ - #ifdef HAS_NORMALS - material.normalEC = computeNormal(attributes); + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(); #endif - vec4 baseColorWithAlpha = vec4(1.0); - // Regardless of whether we use PBR, set a base color - #ifdef HAS_BASE_COLOR_TEXTURE - vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - - #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM - baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); - #endif + // Compute the bitangent according to the formula in the glTF spec. + // Normal and tangents can be affected by morphing and skinning, so + // the bitangent should not be computed until their values are finalized. + #ifdef HAS_BITANGENTS + attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); + #endif - baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); + FeatureIds featureIds; + featureIdStage(featureIds, attributes); - #ifdef HAS_BASE_COLOR_FACTOR - baseColorWithAlpha *= u_baseColorFactor; - #endif - #elif defined(HAS_BASE_COLOR_FACTOR) - baseColorWithAlpha = u_baseColorFactor; + #ifdef HAS_SELECTED_FEATURE_ID + SelectedFeature feature; + selectedFeatureIdStage(feature, featureIds); + // Handle any show properties that come from the style. + cpuStylingStage(attributes.positionMC, feature); #endif - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - baseColorWithAlpha = v_pointCloudColor; - #elif defined(HAS_COLOR_0) - vec4 color = attributes.color_0; - // .pnts files store colors in the sRGB color space - #ifdef HAS_SRGB_COLOR - color = czm_srgbToLinear(color); - #endif - baseColorWithAlpha *= color; + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + // The scene mode 2D pipeline stage and instancing stage add a different + // model view matrix to accurately project the model to 2D. However, the + // output positions and normals should be transformed by the 3D matrices + // to keep the data the same for the fragment shader. + mat4 modelView = czm_modelView3D; + mat3 normal = czm_normal3D; + #else + // These are used for individual model projection because they will + // automatically change based on the scene mode. + mat4 modelView = czm_modelView; + mat3 normal = czm_normal; #endif - material.diffuse = baseColorWithAlpha.rgb; - material.alpha = baseColorWithAlpha.a; + // Update the position for this instance in place + #ifdef HAS_INSTANCING - #ifdef USE_CPU_STYLING - material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); - #endif + // The legacy instance stage is used when rendering i3dm models that + // encode instances transforms in world space, as opposed to glTF models + // that use EXT_mesh_gpu_instancing, where instance transforms are encoded + // in object space. + #ifdef USE_LEGACY_INSTANCING + mat4 instanceModelView; + mat3 instanceModelViewInverseTranspose; + + legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); - #ifdef HAS_OCCLUSION_TEXTURE - vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; - #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM - occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + modelView = instanceModelView; + normal = instanceModelViewInverseTranspose; + #else + instancingStage(attributes); #endif - material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; - #endif - #ifdef HAS_EMISSIVE_TEXTURE - vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; - #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM - emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #ifdef USE_PICKING + v_pickColor = a_pickColor; #endif - vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); - #ifdef HAS_EMISSIVE_FACTOR - emissive *= u_emissiveFactor; - #endif - material.emissive = emissive; - #elif defined(HAS_EMISSIVE_FACTOR) - material.emissive = u_emissiveFactor; #endif - #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE - vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM - specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); - #endif + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); - vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); - vec3 specular = specularGlossiness.rgb; - float glossiness = specularGlossiness.a; - #ifdef HAS_SPECULAR_FACTOR - specular *= u_specularFactor; - #endif + #ifdef HAS_CUSTOM_VERTEX_SHADER + czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); + customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif - #ifdef HAS_GLOSSINESS_FACTOR - glossiness *= u_glossinessFactor; - #endif - #else - #ifdef HAS_SPECULAR_FACTOR - vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); - #else - vec3 specular = vec3(1.0); - #endif + // Compute the final position in each coordinate system needed. + // This returns the value that will be assigned to gl_Position. + vec4 positionClip = geometryStage(attributes, modelView, normal); - #ifdef HAS_GLOSSINESS_FACTOR - float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); - #else - float glossiness = 1.0; - #endif - #endif + #ifdef HAS_SILHOUETTE + silhouetteStage(attributes, positionClip); + #endif - #ifdef HAS_DIFFUSE_TEXTURE - vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; - #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM - diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); - #endif + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + float show = pointCloudShowStylingStage(attributes, metadata); + #else + float show = 1.0; + #endif - vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); - #ifdef HAS_DIFFUSE_FACTOR - diffuse *= u_diffuseFactor; - #endif - #elif defined(HAS_DIFFUSE_FACTOR) - vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); - #else - vec4 diffuse = vec4(1.0); - #endif - czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial( - diffuse.rgb, - specular, - glossiness - ); - material.diffuse = parameters.diffuseColor; - // the specular glossiness extension's alpha overrides anything set - // by the base material. - material.alpha = diffuse.a; - material.specular = parameters.f0; - material.roughness = parameters.roughness; - #elif defined(LIGHTING_PBR) - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE - vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM - metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); - #endif + #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING + show *= pointCloudBackFaceCullingStage(); + #endif - vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; - float metalness = clamp(metallicRoughness.b, 0.0, 1.0); - float roughness = clamp(metallicRoughness.g, 0.04, 1.0); - #ifdef HAS_METALLIC_FACTOR - metalness *= u_metallicFactor; - #endif + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); + #endif - #ifdef HAS_ROUGHNESS_FACTOR - roughness *= u_roughnessFactor; - #endif + #ifdef PRIMITIVE_TYPE_POINTS + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); #else - #ifdef HAS_METALLIC_FACTOR - float metalness = clamp(u_metallicFactor, 0.0, 1.0); - #else - float metalness = 1.0; - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - float roughness = clamp(u_roughnessFactor, 0.04, 1.0); - #else - float roughness = 1.0; - #endif + gl_PointSize = 1.0; #endif - czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial( - material.diffuse, - metalness, - roughness - ); - material.diffuse = parameters.diffuseColor; - material.specular = parameters.f0; - material.roughness = parameters.roughness; + + gl_PointSize *= show; #endif -} -`;var y4e=Nt.Material,F6=Nt.MetallicRoughness,U6=Nt.SpecularGlossiness,$re={name:"MaterialPipelineStage",_processTexture:jg,_processTextureTransform:eoe};$re.process=function(e,t,n){let i=t.material,r=e.model,o=u(r.classificationType),s=o,a=e.uniformMap,c=e.shaderBuilder,l=n.context.defaultTexture,f=n.context.defaultNormalTexture,d=n.context.defaultEmissiveTexture;A4e(i,a,c,l,f,d,s),u(i.specularGlossiness)?x4e(i,a,c,l,s):C4e(i,a,c,l,s);let p=Zt.getAttributeBySemantic(t,Et.NORMAL),g=e.lightingOptions;i.unlit||!p||o?g.lightingModel=Zm.UNLIT:g.lightingModel=Zm.PBR;let h=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let A=e.alphaOptions;i.alphaMode===Xm.BLEND?A.pass=ve.TRANSLUCENT:i.alphaMode===Xm.MASK&&(A.alphaCutoff=i.alphaCutoff),c.addFragmentLines(GO),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,be.BOTH)};function eoe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,be.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,be.FRAGMENT),t[s]=function(){return n.transform}}function jg(e,t,n,i,r,o){e.addUniform("sampler2D",i,be.FRAGMENT),t[i]=function(){return y(n.texture,o)};let s=`HAS_${r}_TEXTURE`;e.addDefine(s,void 0,be.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,l=`TEXCOORD_${r}`;e.addDefine(l,c,be.FRAGMENT);let f=n.transform;u(f)&&!Q.equals(f,Q.IDENTITY)&&eoe(e,t,n,i,r)}function A4e(e,t,n,i,r,o,s){let a=e.emissiveFactor;if(u(a)&&!m.equals(a,y4e.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",be.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,be.FRAGMENT);let f=e.emissiveTexture;u(f)&&!s&&jg(n,t,f,"u_emissiveTexture","EMISSIVE",o)}let c=e.normalTexture;u(c)&&!s&&jg(n,t,c,"u_normalTexture","NORMAL",r);let l=e.occlusionTexture;u(l)&&!s&&jg(n,t,l,"u_occlusionTexture","OCCLUSION",i)}function x4e(e,t,n,i,r){let o=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,be.FRAGMENT);let s=o.diffuseTexture;u(s)&&!r&&jg(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=o.diffuseFactor;u(a)&&!oe.equals(a,U6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",be.FRAGMENT),t.u_diffuseFactor=function(){return o.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,be.FRAGMENT));let c=o.specularGlossinessTexture;u(c)&&!r&&jg(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let l=o.specularFactor;u(l)&&!m.equals(l,U6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",be.FRAGMENT),t.u_specularFactor=function(){return o.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,be.FRAGMENT));let f=o.glossinessFactor;u(f)&&f!==U6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",be.FRAGMENT),t.u_glossinessFactor=function(){return o.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,be.FRAGMENT))}function C4e(e,t,n,i,r){let o=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,be.FRAGMENT);let s=o.baseColorTexture;u(s)&&!r&&jg(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=o.baseColorFactor;u(a)&&!oe.equals(a,F6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",be.FRAGMENT),t.u_baseColorFactor=function(){return o.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,be.FRAGMENT));let c=o.metallicRoughnessTexture;u(c)&&!r&&jg(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=o.metallicFactor;u(l)&&l!==F6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",be.FRAGMENT),t.u_metallicFactor=function(){return o.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,be.FRAGMENT));let f=o.roughnessFactor;u(f)&&f!==F6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",be.FRAGMENT),t.u_roughnessFactor=function(){return o.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,be.FRAGMENT))}var WO=$re;var jO=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - attributes.positionMC = getMorphedPosition(positionMC); - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = getMorphedNormal(normalMC); - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = getMorphedTangent(tangentMC); - #endif -}`;var Sa={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Sa.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,be.VERTEX),w4e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,l=c.length;for(let f=0;f<l;f++){let d=c[f],p=d.semantic;p!==Et.POSITION&&p!==Et.NORMAL&&p!==Et.TANGENT||(E4e(e,d,e.attributeIndex,a),e.attributeIndex++)}}D4e(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,be.VERTEX),n.addVertexLines(jO);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=_t(s,e.uniformMap)};var T4e={attributeString:void 0,functionId:void 0};function E4e(e,t,n,i){let r=e.shaderBuilder;b4e(e,t,n);let o=S4e(t,T4e);v4e(r,o,i)}function b4e(e,t,n){let i={index:n,value:u(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:an.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function S4e(e,t){switch(e.semantic){case Et.POSITION:t.attributeString="Position",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_POSITION;break;case Et.NORMAL:t.attributeString="Normal",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Et.TANGENT:t.attributeString="Tangent",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function v4e(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function w4e(e){e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_POSITION,Sa.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,be.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,Sa.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,be.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,Sa.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,be.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function D4e(e){let t="return morphedPosition;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var qO=Sa;var toe={name:"PickingPipelineStage"};toe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)I4e(e,t,a,i);else if(u(a))P4e(e,i);else{let c=noe(e),l=i.createPickId(c);s._pipelineResources.push(l),s._pickIds.push(l),o.addUniform("vec4","czm_pickColor",be.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return l.color},e.pickId="czm_pickColor"}};function noe(e,t){let n=e.model;if(u(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Vr.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,u(t)&&(r.instanceId=t),r}function I4e(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;u(i.featureTableId)?r=i.featureTableId:u(n)?(o=Zt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=Zt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",be.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function P4e(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=noe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let h=g.color;r[d*4+0]=z.floatToByte(h.red),r[d*4+1]=z.floatToByte(h.green),r[d*4+2]=z.floatToByte(h.blue),r[d*4+3]=z.floatToByte(h.alpha)}o._pickIds=i;let a=mt.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;o.statistics.addBuffer(a,c),s.push(a);let l={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(l);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,be.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var YO=toe;var O4e={ADD:0,REPLACE:1},kr=Object.freeze(O4e);var XO=`float getPointSizeFromAttenuation(vec3 positionEC) { - // Variables are packed into a single vector to minimize gl.uniformXXX() calls - float pointSize = model_pointCloudParameters.x; - float geometricError = model_pointCloudParameters.y; - float depthMultiplier = model_pointCloudParameters.z; - - float depth = -positionEC.z; - return min((geometricError / depth) * depthMultiplier, pointSize); -} - -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); + gl_Position = show * positionClip; } -#endif +`;function M6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Gn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Gn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],dke(this)}function lke(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},depthMask:!1}}var uke={stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND},fke={stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Wn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},tre=[];function dke(e){let t=e._command,n=tre;if(e._useDebugWireframe){t.pass=Ee.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=JD(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ee.TERRAIN_CLASSIFICATION,s=O6(t,o),a=Qie(t,o);n.length=0,n.push(s,a),e._commandListTerrain=JD(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=ere(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ee.CESIUM_3D_TILE_CLASSIFICATION,s=O6(t,o),a=Qie(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=JD(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=ere(e,n,e._commandList3DTilesPicking))}}function JD(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=tt.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function O6(e,t){let n=tt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ee.TERRAIN_CLASSIFICATION?Wn.ALWAYS:Wn.EQUAL,r=lke(i);return n.renderState=Ue.fromCache(r),n}function Qie(e,t){let n=tt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ue.fromCache(uke),n}var mke=[];function ere(e,t,n){let i=Ue.fromCache(fke),r=t[0],o=t[1],s=tt.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=tt.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=mke;return c.length=0,c.push(s,a),JD(e,c,n)}Object.defineProperties(M6.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});M6.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=O6(this._command,r),s=tre;s.length=0,s.push(o),this._commandListIgnoreShow=JD(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var ZD=M6;function bU(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r;let o=t.pass===Ee.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,hke(this)}function Hp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}Hp.clone=function(e){return new Hp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function hke(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;e._originalCommand=new Hp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Hp({command:Cke(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Hp({command:wke(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Hp({command:Ike(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Hp({command:Tke(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Hp({command:Ake(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand))}Object.defineProperties(bU.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,_ke(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,gke(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,yke(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,xke(this))}}});function pke(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function _ke(e){let t=e.shadows,n=bn.castShadows(t),i=bn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function gke(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=je(o.renderState,!0);s.cull.enabled=t,o.renderState=Ue.fromCache(s)}}}function yke(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=je(o.renderState,!0);s.cull.face=t,o.renderState=Ue.fromCache(s)}}}function xke(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}bU.prototype.pushCommands=function(e,t){let n=nre(this,e);n&&!this._has2DCommands&&(bke(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(pke(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Md.ALL_OPAQUE&&sA(t,this._translucentCommand,n),i===Md.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||sA(r._backfaceCommands,this._skipLodBackfaceCommand,n),Eke(this,o,n),sA(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){sA(t,this._silhouetteModelCommand,n);return}return sA(t,this._originalCommand,n),t}};bU.prototype.pushSilhouetteCommands=function(e,t){let n=nre(this,e);return sA(t,this._silhouetteColorCommand,n),t};function sA(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function nre(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*D.PI;return r<s&&o>s||r<-s&&o>-s}function oA(e,t){if(!l(t))return;let n=Hp.clone(t),i=tt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function bke(e){oA(e,e._originalCommand),oA(e,e._translucentCommand),oA(e,e._skipLodBackfaceCommand),oA(e,e._skipLodStencilCommand),oA(e,e._silhouetteModelCommand),oA(e,e._silhouetteColorCommand)}function Cke(e){let t=tt.shallowClone(e);t.pass=Ee.TRANSLUCENT;let n=je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=dn.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function Tke(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),r=je(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(r),i}function Ake(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),r=je(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ee.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ee.TRANSLUCENT,r.depthMask=!1,r.blending=dn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function Eke(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Ske(r);if(o!==s){let a=vke(o),c=je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Ske(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function vke(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function wke(e){let t=tt.shallowClone(e),n=je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=xi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=je(t.uniformMap),r=new H(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ue.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Ike(e){let t=tt.shallowClone(e),n=je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=Wn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Wn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=Ue.fromCache(n),t}var $D=bU;function Pke(e,t){let n=e.shaderBuilder;n.addVertexLines(KD),n.addFragmentLines(XD);let i=Dke(e),r=new si({context:t.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=n.buildShaderProgram(t.context);o._pipelineResources.push(s);let a=e.alphaOptions.pass,c=o.sceneGraph,u=t.mode===ne.SCENE3D,f,d;if(!u&&!t.scene3DOnly&&o._projectTo2D)f=F.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new F),d=e.runtimePrimitive.boundingSphere2D;else{let A=u?c._computedModelMatrix:c._computedModelMatrix2D;f=F.multiplyTransformation(A,e.runtimeNode.computedTransform,new F),d=ae.transform(e.boundingSphere,f,e.boundingSphere)}let p=je(Ue.fromCache(e.renderStateOptions),!0);p.cull.face=$t.getCullFace(f,e.primitiveType),p=Ue.fromCache(p);let g=l(o.classificationType),h=g?!1:bn.castShadows(o.shadows),x=g?!1:bn.receiveShadows(o.shadows),b=g?void 0:e.pickId,C=new tt({boundingVolume:d,modelMatrix:f,uniformMap:e.uniformMap,renderState:p,vertexArray:r,shaderProgram:s,cull:o.cull,pass:a,count:e.count,owner:o,pickId:b,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:h,receiveShadows:x});return g?new ZD({primitiveRenderResources:e,command:C}):new $D({primitiveRenderResources:e,command:C})}function Dke(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var QD=Pke;var Ux={VERTEX:0,FRAGMENT:1,BOTH:2};Ux.includesVertexShader=function(e){return e===Ux.VERTEX||e===Ux.BOTH};Ux.includesFragmentShader=function(e){return e===Ux.FRAGMENT||e===Ux.BOTH};var Te=Object.freeze(Ux);var ire={name:"TilesetPipelineStage"};ire.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,Te.FRAGMENT);let o={u_polygonOffset:function(){return H.ZERO}};e.uniformMap=gt(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var eR=ire;var tR=`vec3 proceduralIBL( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { + vec3 v = -positionEC; + vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); + vec3 vWC = -normalize(positionWC); + vec3 l = normalize(lightDirectionEC); + vec3 n = normalEC; + vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); -} -#endif + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - return getPointSizeFromAttenuation(v_positionEC); -} -#endif + // Figure out if the reflection vector hits the ellipsoid + float vertexRadius = length(positionWC); + float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); + float reflectionDotNadir = dot(r, normalize(positionWC)); + // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. + r.x = -r.x; + r = -normalize(czm_temeToPseudoFixed * r); + r.x = -r.x; -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { - #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) - // This needs to be computed in eye coordinates so we can't use attributes.normalMC - return step(-v_normalEC.z, 0.0); - #else - return 1.0; - #endif -} -#endif`;var M4e=new oe,roe={name:"PointCloudStylingPipelineStage"};roe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=u(s)?s.propertyAttributes:void 0,c=u(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,l=!u(a)&&c;if(u(o)&&!l){let A=N4e(a),x=F4e(o,A);U4e(i,x);let T=V4e(x).indexOf("normalMC")>=0,E=Zt.getAttributeBySemantic(t,Et.NORMAL);if(T&&!E)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,be.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=ve.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,be.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,be.VERTEX);let d,p,g;Vr.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===kr.ADD),i.addUniform("vec4","model_pointCloudParameters",be.VERTEX),i.addVertexLines(XO);let h=e.uniformMap;h.model_pointCloudParameters=function(){let A=M4e,x=1;p&&(x=g?5:d.tileset.maximumScreenSpaceError),A.x=y(f.maximumAttenuation,x),A.x*=n.pixelRatio;let C=R4e(e,t,f,d);A.y=C*f.geometricErrorScale;let T=n.context,E=n.camera.frustum,S;return n.mode===ne.SCENE2D||E instanceof tn?S=Number.POSITIVE_INFINITY:S=T.drawingBufferHeight/n.camera.frustum.sseDenominator,A.z=S,p&&(A.w=d.tileset.timeSinceLoad),A}};var ioe=new m;function R4e(e,t,n,i){if(u(i)){let f=i.tile.geometricError;if(f>0)return f}if(u(n.baseResolution))return n.baseResolution;let r=Zt.getAttributeBySemantic(t,Et.POSITION),o=r.count,s=e.runtimeNode.transform,a=m.subtract(r.max,r.min,ioe);a=N.multiplyByPointAsVector(s,a,ioe);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var B4e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},L4e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function N4e(e){let t=We(L4e);if(!u(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var V6="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function F4e(e,t){let n=B4e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${V6})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${V6})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${V6})`,t,i),n.styleTranslucent=u(n.colorStyleFunction)&&i.translucent,n}function U4e(e,t){let n=t.colorStyleFunction;u(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,be.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;u(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,be.VERTEX),e.addVertexLines(i));let r=t.pointSizeStyleFunction;u(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,be.VERTEX),e.addVertexLines(r))}function k6(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function V4e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return u(t)&&k6(t,r),u(n)&&k6(n,r),u(i)&&k6(i,r),r}var KO=roe;var JO=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var ZO=`void primitiveOutlineStage(inout czm_modelMaterial material) { - if (!model_showOutline) { - return; - } + vec3 diffuseColor = pbrParameters.diffuseColor; + float roughness = pbrParameters.roughness; + vec3 specularColor = pbrParameters.f0; - float outlineX = - texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; - float outlineY = - texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; - float outlineZ = - texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; - float outlineness = max(outlineX, max(outlineY, outlineZ)); + float inverseRoughness = 1.04 - roughness; + inverseRoughness *= inverseRoughness; + vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness; - material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); -} + float atmosphereHeight = 0.05; + float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); + float blendRegionOffset = roughness * -1.0; + float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); + float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); + float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); + float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); + vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); + vec3 nadirColor = belowHorizonColor * 0.5; + vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); + vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); + vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); + vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); + float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; + float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); + vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); + float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); + vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); + specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); + specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -`;var ooe={name:"PrimitiveOutlinePipelineStage"};ooe.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,be.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:an.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",be.FRAGMENT);let a=NA.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",be.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",be.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(JO),i.addFragmentLines(ZO)};var QO=ooe;var soe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:aoe,_count2DPositions:coe,_countMorphTargetAttributes:loe,_countMaterialTextures:uoe,_countFeatureIdTextures:foe,_countBinaryMetadata:doe};soe.process=function(e,t,n){let i=e.model,r=i.statistics;aoe(r,t),coe(r,e.runtimePrimitive),loe(r,t),uoe(r,t.material),foe(r,t.featureIds),doe(r,i)};function aoe(e,t){let n=u(t.indices)?t.indices.count:Zt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Be.POINTS?e.pointsLength+=n:Be.isTriangles(i)&&(e.trianglesLength+=k4e(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let l=r[c];if(u(l.buffer)){let f=u(l.typedArray);e.addBuffer(l.buffer,f)}}let s=t.outlineCoordinates;u(s)&&u(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(u(a)&&u(a.buffer)){let c=u(a.typedArray);e.addBuffer(a.buffer,c)}}function k4e(e,t){switch(e){case Be.TRIANGLES:return t/3;case Be.TRIANGLE_STRIP:case Be.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function coe(e,t){let n=t.positionBuffer2D;u(n)&&e.addBuffer(n,!0)}function loe(e,t){let n=t.morphTargets;if(!u(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let l=s[c];u(l.buffer)&&e.addBuffer(l.buffer,i)}}}function uoe(e,t){let n=z4e(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];u(o)&&u(o.texture)&&e.addTexture(o.texture)}}function z4e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return u(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function foe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Nt.FeatureIdTexture){let o=r.textureReader;u(o.texture)&&e.addTexture(o.texture)}}}function doe(e,t){let n=t.structuralMetadata;u(n)&&(H4e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!u(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function H4e(e,t){let n=t.propertyTextures;if(!u(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let l=s[a].textureReader;u(l.texture)&&e.addTexture(l.texture)}}}var $O=soe;var G4e=new N,W4e=new N,moe={name:"SceneMode2DPipelineStage"};moe.process=function(e,t,n){let i=Zt.getAttributeBySemantic(t,Et.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=N.multiplyTransformation(s,a,G4e),l=Y4e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=l;let d=e.runtimeNode.node.instances;if(u(d))return;if(u(i.typedArray)){let A=J4e(i,c,l,n);f.positionBuffer2D=A,o._modelResources.push(A),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,be.VERTEX),r.addUniform("mat4","u_modelView2D",be.VERTEX);let p=N.fromTranslation(l.center,new N),g=n.context,h={u_modelView2D:function(){return N.multiplyTransformation(g.uniformState.view,p,W4e)}};e.uniformMap=_t(h,e.uniformMap)};var j4e=new m,q4e=new m;function Y4e(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,j4e),r=$i.computeActualWgs84Position(n,i,i),o=N.multiplyByPoint(t,e.positionMax,q4e),s=$i.computeActualWgs84Position(n,o,o);return ae.fromCornerPoints(r,s,new ae)}var hoe=new m;function X4e(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,hoe),c=m.multiplyComponents(a,o,a),l=m.add(c,r,c);i[s]=l.x,i[s+1]=l.y,i[s+2]=l.z}return i}function K4e(e,t,n,i){let r;u(e.quantization)?r=X4e(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=u(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let l=m.fromArray(r,c,hoe);if(isNaN(l.x)||isNaN(l.y)||isNaN(l.z))continue;let f=N.multiplyByPoint(t,l,l),d=$i.computeActualWgs84Position(i,f,f),p=m.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function J4e(e,t,n,i){let r=We(i);r.mode=ne.COLUMBUS_VIEW;let o=n.center,s=K4e(e,t,o,r),a=mt.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var eM=moe;var tM=`void skinningStage(inout ProcessedAttributes attributes) -{ - mat4 skinningMatrix = getSkinningMatrix(); - mat3 skinningMatrixMat3 = mat3(skinningMatrix); + // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf + #ifdef USE_SUN_LUMINANCE + // Angle between sun and zenith + float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); + float S = acos(LdotZenith); + // Angle between zenith and current pixel + float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); + // Angle between sun and current pixel + float gamma = acos(NdotL); + float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); + float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); + float luminance = model_luminanceAtZenith * (numerator / denominator); + #endif - vec4 positionMC = vec4(attributes.positionMC, 1.0); - attributes.positionMC = vec3(skinningMatrix * positionMC); + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); + float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); + vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); + iblColor *= lightColor; - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = skinningMatrixMat3 * normalMC; + #ifdef USE_SUN_LUMINANCE + iblColor *= luminance; #endif - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = skinningMatrixMat3 * tangentMC; - #endif -}`;var zA={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};zA.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,be.VERTEX),Q4e(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,be.VERTEX),n.addVertexLines(tM);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=_t(o,e.uniformMap)};function Z4e(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===Et.JOINTS||o.semantic===Et.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function Q4e(e,t){e.addFunction(zA.FUNCTION_ID_GET_SKINNING_MATRIX,zA.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,be.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(zA.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,r,o=["x","y","z","w"],s=Z4e(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],l=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(zA.FUNCTION_ID_GET_SKINNING_MATRIX,[l])}let a="return skinnedMatrix;";e.addFunctionLines(zA.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var nM=zA;var z6={};function $4e(e){let t=Fe.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function eze(e,t){let n=t.length,i=Fe.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function tze(e){let t=e-2,n=2+t*4,i=Fe.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function nze(e,t){let i=t.length-2,r=2+i*4,o=Fe.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],l=t[a+1],f=t[a+2];o[s++]=l,o[s++]=f,o[s++]=f,o[s++]=c}return o}function ize(e){let t=e-2,n=2+t*4,i=Fe.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function rze(e,t){let i=t.length-2,r=2+i*4,o=Fe.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let l=t[c+1],f=t[c+2];o[s++]=l,o[s++]=f,o[s++]=f,o[s++]=a}return o}z6.createWireframeIndices=function(e,t,n){let i=u(n);if(e===Be.TRIANGLES)return i?eze(t,n):$4e(t);if(e===Be.TRIANGLE_STRIP)return i?nze(t,n):tze(t);if(e===Be.TRIANGLE_FAN)return i?rze(t,n):ize(t)};z6.getWireframeIndicesCount=function(e,t){return e===Be.TRIANGLES?t*2:e===Be.TRIANGLE_STRIP||e===Be.TRIANGLE_FAN?2+(t-2)*4:t};var lE=z6;var poe={name:"WireframePipelineStage"};poe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,be.FRAGMENT);let r=e.model,o=oze(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o;let s=!1;r.statistics.addBuffer(o,s);let a=e.primitiveType,c=e.count;e.primitiveType=Be.LINES,e.count=lE.getWireframeIndicesCount(a,c)};function oze(e,t,n){let r=Zt.getAttributeBySemantic(e,Et.POSITION).count,o=n.context.webgl2,s;if(u(t)){let f=t.buffer,d=t.count;u(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):Fe.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=lE.createWireframeIndices(a,r,s),l=Fe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return mt.createIndexBuffer({context:n.context,typedArray:c,usage:Ne.STATIC_DRAW,indexDatatype:l})}var iM=poe;function _oe(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}_oe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader;if(u(r._marsOptions)&&u(r._marsOptions.customShaders)){let O=jh.getCache(r._marsOptions.customShaders);for(let B in O)if(Object.prototype.hasOwnProperty.call(O,B)){o=O[B];break}}let s=r.style,a=e.context.webgl2,l=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=u(n.morphTargets)&&n.morphTargets.length>0,d=u(i.skin),p=u(o),h=!(p&&u(o.fragmentShaderText))||o.mode!==Wp.REPLACE_MATERIAL,A=Zt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Be.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),C=r.pointCloudShading,T=u(C)&&C.attenuation,E=u(C)&&C.backFaceCulling,S=n.primitiveType===Be.POINTS&&(u(s)||T||E),w=r._enableShowOutline&&u(n.outlineCoordinates),D=sze(r,i,n),M=u(r.classificationType);l&&t.push(eM),t.push(kO),x&&t.push(iM),M&&t.push(bO),f&&t.push(qO),d&&t.push(nM),S&&t.push(KO),A&&t.push(NO),h&&t.push(WO),t.push(Hg),t.push(cf),D.hasPropertyTable&&(t.push(Wg),t.push(EO),t.push(wO)),p&&t.push(BO),t.push(HO),r.allowPicking&&t.push(YO),w&&t.push(QO),t.push(TO),t.push($O)};function sze(e,t,n){let i;return u(t.instances)&&(i=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),u(i))?{hasFeatureIds:!0,hasPropertyTable:u(i.propertyTableId)}:(i=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),u(i)?{hasFeatureIds:!0,hasPropertyTable:u(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var rM=_oe;function H6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],aze(this)}Object.defineProperties(H6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function aze(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let l=i[c].index,f=o[l];s.push(f);let d=n[c],p=goe(f,d,new N);a.push(p)}}function goe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}H6.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=goe(i,r,e[n])}};var oM=H6;function cze(){this.pass=void 0,this.alphaCutoff=void 0}var sM=cze;function lze(e){this.shaderBuilder=new F0,this.model=e,this.uniformMap={},this.alphaOptions=new sM,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:qa.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var aM=lze;var cM=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var lM=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { - #ifdef HAS_NORMALS - if(model_silhouettePass) { - vec3 normal = normalize(czm_normal3D * attributes.normalMC); - normal.x *= czm_projection[0][0]; - normal.y *= czm_projection[1][1]; - positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; - } - #endif -} -`;var yV={name:"ModelSilhouettePipelineStage"};yV.silhouettesLength=0;yV.process=function(e,t,n){u(t._silhouetteId)||(t._silhouetteId=++yV.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,be.BOTH),i.addVertexLines(lM),i.addFragmentLines(cM),i.addUniform("vec4","model_silhouetteColor",be.FRAGMENT),i.addUniform("float","model_silhouetteSize",be.VERTEX),i.addUniform("bool","model_silhouettePass",be.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=_t(r,e.uniformMap),e.hasSilhouette=!0};var uM=yV;var fM=`void modelSplitterStage() -{ - // Don't split when rendering the shadow map, because it is rendered from - // the perspective of a totally different camera. -#ifndef SHADOW_MAP - if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif + return iblColor; } -`;var AV={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};AV.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,be.FRAGMENT),i.addFragmentLines(fM);let r={};i.addUniform("float",AV.SPLIT_DIRECTION_UNIFORM_NAME,be.FRAGMENT),r[AV.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=_t(r,e.uniformMap)};var dM=AV;function uze(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var mM=uze;function fze(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Zm.UNLIT)}var hM=fze;function dze(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=u(n.indices)?n.indices.count:Zt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Zt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new hM,this.pickId=void 0}var pM=dze;function cu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=N.clone(N.IDENTITY),this._computedModelMatrix2D=N.clone(N.IDENTITY),this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N),this._runtimeArticulations={},mze(this)}Object.defineProperties(cu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function mze(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;yoe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let E=o[T],S=new lO({articulation:E,sceneGraph:e}),w=S.name;a[w]=S}let c=t.nodes,l=c.length;e._runtimeNodes=new Array(l);let d=n.nodes.length,p=N.IDENTITY;for(let T=0;T<d;T++){let E=n.nodes[T],S=Aoe(e,E,p);e._rootNodes.push(S)}let g=t.skins,h=e._runtimeSkins,A=g.length;for(let T=0;T<A;T++){let E=g[T];h.push(new oM({skin:E,sceneGraph:e}))}let x=e._skinnedNodes,C=x.length;for(let T=0;T<C;T++){let E=x[T],S=e._runtimeNodes[E],D=c[E].skin.index;S._runtimeSkin=h[D],S.updateJointMatrices()}e.applyArticulations()}function yoe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=N.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=N.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=N.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var hze=new m;function pze(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,hze);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=Mt.wgs84To2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=N.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Aoe(e,t,n){let i=[],r=Zt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=N.multiplyTransformation(n,r,new N),g=Aoe(e,d,p);i.push(g)}let s=new CO({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new rM({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,u(t.skin)&&e._skinnedNodes.push(c);let l=t.name;if(u(l)){let f=e._model,d=new mO(f,s);f._nodesByName[l]=d}return c}var _ze=new m,gze=new m,yze=new m,Aze=new m;cu.prototype.buildDrawCommands=function(e){let t=this._model,n=new aM(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,r,o,s;for(r=0;r<i.length;r++)i[r].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,_ze),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,gze);for(r=0;r<this._runtimeNodes.length;r++){let l=this._runtimeNodes[r];if(!u(l))continue;l.configurePipeline();let f=l.pipelineStages,d=new mM(n,l);for(o=0;o<f.length;o++)f[o].process(d,l.node,e);let p=l.computedTransform;for(o=0;o<l.runtimePrimitives.length;o++){let g=l.runtimePrimitives[o];g.configurePipeline(e);let h=g.pipelineStages,A=new pM(d,g);for(s=0;s<h.length;s++)h[s].process(A,g.primitive,e);g.boundingSphere=ae.clone(A.boundingSphere,new ae);let x=N.multiplyByPoint(p,A.positionMin,yze),C=N.multiplyByPoint(p,A.positionMax,Aze);m.minimumByComponent(a,x,a),m.maximumByComponent(c,C,c);let T=rO(A,e);g.drawCommand=T}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};cu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;u(n.color)&&t.push(zg),!u(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(aO),n.isClippingEnabled()&&t.push(dO),n.hasSilhouette(e)&&t.push(uM),u(n.splitDirection)&&n.splitDirection!==zc.NONE&&t.push(dM),Vr.is3DTiles(n.type)&&t.push(oO))};cu.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!u(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};cu.prototype.updateModelMatrix=function(e,t){yoe(this,e),t.mode!==ne.SCENE3D&&pze(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};cu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function xoe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let l=t.getChild(c);xoe(e,l,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let l=s[c];i(l,r)}}function xV(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];xoe(e,c,t,n,i)}}var xze={backFaceCulling:void 0};cu.prototype.updateBackFaceCulling=function(e){let t=xze;t.backFaceCulling=e,xV(this,!1,Cze,t)};function Cze(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Tze={shadowMode:void 0};cu.prototype.updateShadows=function(e){let t=Tze;t.shadowMode=e,xV(this,!1,Eze,t)};function Eze(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var bze={debugShowBoundingVolume:void 0};cu.prototype.updateShowBoundingVolume=function(e){let t=bze;t.debugShowBoundingVolume=e,xV(this,!1,Sze,t)};function Sze(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Coe=[],vze={frameState:void 0,hasSilhouette:void 0};cu.prototype.pushDrawCommands=function(e){let t=Coe;t.length=0;let n=vze;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,xV(this,!0,wze,n),e.commandList.push.apply(e.commandList,t)};function wze(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=Coe,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!r.pick&&s.pushSilhouetteCommands(n,o)}cu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];u(o)&&o.setArticulationStage(r,t)};cu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var _M=cu;function uE(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Tt}Object.defineProperties(uE.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});uE.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};uE.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};uE.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};uE.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var gM=uE;var Soe=Ki(y3(),1);var Toe={},HA=Uint32Array.BYTES_PER_ELEMENT;Toe.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=HA;let r=i.getUint32(t,!0);if(r!==1)throw new de(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=HA,t+=HA;let o=i.getUint32(t,!0);if(o===0)throw new de("Feature table must have a byte length greater than zero");t+=HA;let s=i.getUint32(t,!0);t+=HA;let a=i.getUint32(t,!0);t+=HA;let c=i.getUint32(t,!0);t+=HA;let l=Br(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Br(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new Od(l,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!u(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let A=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);u(A)&&(A=m.unpack(A));let x=Dze(g,d);if(x.rtcCenter=A,x.pointsLength=h,!x.hasPositions){let C=Ize(g);x.positions=C,x.hasPositions=x.hasPositions||u(C)}if(!x.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let C=Oze(g);x.normals=C,x.hasNormals=x.hasNormals||u(C)}if(!x.hasColors){let C=Pze(g);x.colors=C,x.hasColors=x.hasColors||u(C),x.hasConstantColor=u(x.constantColor),x.isTranslucent=u(C)&&C.isTranslucent}if(!x.hasBatchIds){let C=Mze(g);x.batchIds=C,x.hasBatchIds=x.hasBatchIds||u(C)}if(x.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!u(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=C}return u(p)&&(p=new Uint8Array(p),x.batchTableJson=d,x.batchTableBinary=p),x};function Dze(e,t){let n=e.json,i,r,o,s=u(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=u(t)&&u(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;u(a)&&(o=a.properties);let c,l,f,d,p;if(u(s)){r=s.properties;let h=s.byteOffset,A=s.byteLength;if(!u(r)||!u(h)||!u(A))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+A),c=u(r.POSITION),l=u(r.RGB)||u(r.RGBA),f=u(r.NORMAL),d=u(r.BATCH_ID),p=u(r.RGBA)}let g;return u(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:_t(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:l,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function Ize(e){let t=e.json,n;if(u(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:an.VEC3};if(u(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!u(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=(1<<16)-1,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!u(o))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:an.VEC3,quantizedRange:r,quantizedVolumeOffset:m.unpack(o),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:an.VEC3}}}function Pze(e){let t=e.json,n;if(u(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(u(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(u(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:an.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(u(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:o,componentDatatype:X.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:s}}}function Oze(e){let t=e.json,n;if(u(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:an.VEC3};if(u(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:an.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:an.VEC3}}}function Mze(e){let t=e.json;if(u(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:Et.FEATURE_ID,semantic:Et.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:an.SCALAR}}}var GA=Toe;var Rze=Nt.Components,Bze=Nt.Scene,Lze=Nt.Node,Nze=Nt.Primitive,Fze=Nt.Attribute,Eoe=Nt.Quantization,Uze=Nt.FeatureIdAttribute,Vze=Nt.Material,kze=Nt.MetallicRoughness;function qg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=vt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY}u(Object.create)&&(qg.prototype=Object.create(cr.prototype),qg.prototype.constructor=qg);Object.defineProperties(qg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});qg.prototype.load=function(){if(u(this._promise))return this._promise;this._parsedContent=GA.parse(this._arrayBuffer,this._byteOffset),this._state=vt.PROCESSING,this._promise=Promise.resolve(this)};qg.prototype.process=function(e){if(u(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===vt.READY)return!0;if(this._state===vt.PROCESSING){if(u(this._decodePromise))return!1;this._decodePromise=zze(this,e.context)}return!1};function zze(e,t){let i=e._parsedContent.draco,r;if(u(i)?r=Op.decodePointCloud(i,t):r=Promise.resolve(),!!u(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return u(o)&&Hze(e,i,o),$ze(e,t),e._state=vt.READY,e}).catch(function(o){e.unload(),e._state=vt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Hze(e,t,n){e._state=vt.READY;let i=e._parsedContent,r;if(u(n.POSITION)){if(r={name:"POSITION",semantic:Et.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:an.VEC3,isQuantized:!1},u(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,l=m.fromElements(c,c,c),f=m.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=l,r.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,r.quantizedType=an.VEC3}i.positions=r}if(u(n.NORMAL)){if(r={name:"NORMAL",semantic:Et.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:an.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},u(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=X.UNSIGNED_BYTE,r.quantizedType=an.VEC2}i.normals=r}if(u(n.RGBA)?i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isTranslucent:!0}:u(n.RGB)&&(i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isTranslucent:!1}),u(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Et.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:an.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];u(o)||(o={}),i.hasDracoBatchTable=!0;let l=c.data;o[a]={byteOffset:l.byteOffset,type:Gze(l.componentsPerAttribute),componentType:Wze(l.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Gze(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Wze(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function yM(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Eoe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Eoe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new Fze;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=y(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=Yn.decodeRGB565(i)),u(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=mt.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===Et.POSITION&&s&&(o.typedArray=i),o}var boe,CV;function jze(e){if(!u(CV)){boe=new Soe.default(0),CV=new Array(e);for(let t=0;t<e;++t)CV[t]=boe.random()}return CV}var qze=new m,Yze=new m,Xze=new m;function Kze(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=jze(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,qze),l=m.fromElements(a,a,a,Yze),f,d,p;if(e.isQuantized)c=m.ZERO,l=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=m.unpack(t,d*3,Xze),m.minimumByComponent(c,p,c),m.maximumByComponent(l,p,l);e.min=m.clone(c),e.max=m.clone(l)}var Jze={name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:!1};function Zze(e,t,n){let i=[],r,o=t.positions;return u(o)&&(Kze(o),r=yM(e,o,n),r.count=t.pointsLength,i.push(r)),u(t.normals)&&(r=yM(e,t.normals,n),i.push(r)),u(t.colors)?(r=yM(e,t.colors,n),i.push(r)):(r=yM(e,Jze,n),i.push(r)),u(t.batchIds)&&(r=yM(e,t.batchIds,n),i.push(r)),i}function Qze(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableBinary,o=!u(e.batchIds);if(u(r)||e.hasDracoBatchTable){let s=y(n,i);return Vp({count:s,batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t})}return new Ea({schema:{},propertyTables:[]})}function $ze(e,t){let n=e._parsedContent,i=new kze;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Vze;r.metallicRoughness=i;let o=n.colors;u(o)&&o.isTranslucent&&(r.alphaMode=Xm.BLEND);let s=!u(n.normals);r.unlit=s;let a=new Nze;if(a.attributes=Zze(e,n,t),a.primitiveType=Be.POINTS,a.material=r,u(n.batchIds)){let g=new Uze;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Lze;c.index=0,c.primitives=[a];let l=new Bze;l.nodes=[c],l.upAxis=hr.Z,l.forwardAxis=hr.X;let f=new Rze;f.scene=l,f.nodes=[c];let d=[];f.structuralMetadata=Qze(n,d),d.length>0&&eHe(e,a,d,t),u(n.rtcCenter)&&(f.transform=N.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;u(p)&&p.isQuantized&&(f.transform=N.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function eHe(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=mt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}qg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var fE=qg;function _r(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,Vr.GLTF),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=u(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=Q.clone(Q.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new K1(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,$a.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,ve.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,je.NONE),this._heightDirty=this._heightReference!==je.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let r=e.scene;u(r)&&u(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new Jm(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;u(s)&&s.owner===void 0?cs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=N.clone(N.IDENTITY),this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=u(e.imageBasedLighting)?e.imageBasedLighting:new hA,this._shouldDestroyImageBasedLighting=!u(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,xn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Vr.GLTF&&Ot("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new Dt(a)),this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,zc.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new gM,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._texturesLoadedPromise=void 0,this._completeLoad=void 0,this._rejectLoad=void 0,this._completeTexturesLoad=void 0,this._rejectTexturesLoad=void 0,u(this._loader._promise)?(this._readyPromise=Promise.resolve(this),this._texturesLoadedPromise=Promise.resolve(this)):(this._readyPromise=new Promise((c,l)=>{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(l(f),!1)}),this._loader instanceof fE?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,l)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(l(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!u(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad(Zt.getError("model",this._resource,c)))})),this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function TV(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function tHe(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new Q1({model:e,propertyTable:s});n.push(a)}return n}function nHe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],u(a.instances)&&(s=Zt.getFeatureIdsByLabel(a.instances.featureIds,i),u(s)&&u(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],l=Zt.getFeatureIdsByLabel(c.featureIds,n);if(u(l))return l.propertyTableId}if(t._featureTables.length===1)return 0}function W6(e,t){if(!u(e)&&!u(t))return!1;if(u(e)!==u(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(_r.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},readyPromise:{get:function(){return $("Model.readyPromise","Model.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.readyEvent instead."),this._readyPromise}},texturesLoadedPromise:{get:function(){return $("Model.texturesLoadedPromise","Model.texturesLoadedPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.texturesReadyEvent instead."),this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){W6(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=W6(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=u(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Doe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Vr.GLTF&&Ot("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(cs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){u(e)!==u(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});_r.prototype.getNode=function(e){return this._nodesByName[e]};_r.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};_r.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};_r.prototype.makeStyleDirty=function(){this._styleDirty=!0};_r.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var iHe=new N,rHe=new Q,oHe=new N;_r.prototype.update=function(e){let t=!1;try{t=sHe(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")TV(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=Zt.getError("model",this._resource,n);TV(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=Zt.getError("model",this._resource,n);TV(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(cHe(this,e),aHe(this,e),lHe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!u(n)){if(this._loader.isUnloaded())return;let o=Zt.getError("model",this._resource,new de("Failed to load model."));TV(o),this._rejectLoad=this._rejectLoad&&this._rejectLoad(o)}let i=n.structuralMetadata;u(i)&&i.propertyTableCount>0&&tHe(this,i);let r=new _M({model:this,modelComponents:n});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(uHe(this),fHe(this),dHe(this,e),mHe(this),hHe(this,e),pHe(this,e),_He(this,e),gHe(this,e),this._defaultTexture=e.context.defaultTexture,yHe(this,e),AHe(this,e),xHe(this),CHe(this,e),bHe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),EHe(this),SHe(this,e),vHe(this),wHe(this,e)}};function sHe(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function aHe(e,t){u(e._customShader)&&e._customShader.update(t)}function cHe(e,t){if(u(e._marsOptions)&&u(e._marsOptions.customShaders)){let n=jh.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function lHe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function uHe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;u(n)&&n.propertyTableCount>0&&(e.featureTableId=nHe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function fHe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function dHe(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&woe(e)}function woe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Rd.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function mHe(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function hHe(e,t){e._silhouetteDirty&&(Ioe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function pHe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function _He(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function gHe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function yHe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function AHe(e,t){N.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=N.clone(e.modelMatrix,e._modelMatrix))}var Qm=new m,EV=new he;function xHe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!u(t)||!u(t.globe)||e.heightReference===je.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,r=e.modelMatrix;Qm.x=r[12],Qm.y=r[13],Qm.z=r[14];let o=i.cartesianToCartographic(Qm);if(!u(o)){e._clampedModelMatrix=void 0;return}u(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(o,voe(e,i,o));let a=n.getHeight(o);if(u(a)){let c=voe(e,i,o);he.clone(o,EV),EV.height=a,i.cartographicToCartesian(EV,Qm),c(Qm)}e._heightDirty=!1,e._updateModelMatrix=!0}function CHe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Doe(e,n),THe(e,n,t)}function Doe(e,t){e._clampedScale=u(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function THe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);N.getTranslation(t,Qm),e._sceneMode!==ne.SCENE3D&&$i.computeActualWgs84Position(n,Qm,Qm);let s=e._boundingSphere.radius,a=DHe(Qm,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=u(e.maximumScale)?Math.min(e.maximumScale,i):i}function EHe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}function bHe(e,t){let n=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let s=rHe,a=iHe;a=N.multiply(r.uniformState.view3D,i,a),s=N.getMatrix3(a,s),s=Q.getRotation(s,s),e._iblReferenceFrameMatrix=Q.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=oHe;s=N.multiply(r.uniformState.view3D,i,s),s=N.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=N.inverseTranspose(s,e._clippingPlanesMatrix)}}function SHe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;u(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function vHe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;let t=e._showCreditsOnScreen;u(e._credit)&&(e._credit.showOnScreen=t);let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++)n[s].showOnScreen=t;let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++)r[s].showOnScreen=t}function wHe(e,t){let n=PHe(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(OHe(e,t),e._sceneGraph.pushDrawCommands(t))}var G6=new ae;function DHe(e,t,n){return G6.center=e,G6.radius=t,n.camera.getPixelSize(G6,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function voe(e,t,n){return function(i){if(e.heightReference===je.RELATIVE_TO_GROUND){let o=t.cartesianToCartographic(i,EV);o.height+=n.height,t.cartographicToCartesian(o,i)}let r=e._clampedModelMatrix;N.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightDirty=!0}}var IHe=new m;function PHe(e,t){let n=e.distanceDisplayCondition;if(!u(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=N.getTranslation(e.modelMatrix,IHe);$i.computeActualWgs84Position(t,s,s),o=m.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function OHe(e,t){let n=t.creditDisplay,i=e._credit;u(i)&&n.addCreditToNextFrame(i);let r=e._resourceCredits,o=r.length;for(let c=0;c<o;c++)n.addCreditToNextFrame(r[c]);let s=e._gltfCredits,a=s.length;for(let c=0;c<a;c++)n.addCreditToNextFrame(s[c])}_r.prototype.isTranslucent=function(){let e=this.color;return u(e)&&e.alpha>0&&e.alpha<1};_r.prototype.isInvisible=function(){let e=this.color;return u(e)&&e.alpha===0};function Ioe(e){return e.context.stencilBuffer}_r.prototype.hasSilhouette=function(e){return Ioe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!u(this._classificationType)};_r.prototype.hasSkipLevelOfDetail=function(e){if(!Vr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};_r.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return u(e)&&e.enabled&&e.length!==0};_r.prototype.isDestroyed=function(){return!1};_r.prototype.destroy=function(){let e=this._loader;u(e)&&e.destroy();let t=this._featureTables;if(u(t)){let i=t.length;for(let r=0;r<i;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),u(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),u(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;u(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};_r.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};_r.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};_r.fromGltf=function(e){$("Model.fromGltf","Model.fromGltf was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:u(e.classificationType)},i=y(e.basePath,""),r=we.createIfNeeded(i);u(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=we.createIfNeeded(t);let o=new Km(n),a=u(e.content)?Vr.TILE_GLTF:Vr.GLTF,c=dE(o,a,e);return c.resource=n.gltfResource,new _r(c)};_r.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:u(e.classificationType)},i=y(e.basePath,""),r=we.createIfNeeded(i);u(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=we.createIfNeeded(t);let o=new Km(n),a=u(e.content)?Vr.TILE_GLTF:Vr.GLTF,c=n.gltfResource,l=dE(o,a,e);l.resource=c;try{await o.load()}catch(g){throw o.destroy(),Zt.getError("model",c,g)}let f=e.gltfCallback;u(f)&&f(o.gltfJson);let d=new _r(l),p=d._resource.credits;if(u(p)){let g=p.length;for(let h=0;h<g;h++)d._resourceCredits.push(p[h])}return d};_r.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:u(e.classificationType)},n=new k1(t);try{await n.load();let i=dE(n,Vr.TILE_B3DM,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new fE(t);try{await n.load();let i=dE(n,Vr.TILE_PNTS,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new G1(t);try{await n.load();let i=dE(n,Vr.TILE_I3DM,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new z1(t),i=dE(n,Vr.TILE_GEOJSON,e);return new _r(i)};_r.prototype.applyColorAndShow=function(e){let t=this._color,n=u(e)&&u(e.color),i=u(e)&&u(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,W6(t,this._color)&&this.resetDrawCommands()};_r.prototype.applyStyle=function(e){let t=this.type===Vr.TILE_PNTS,n=u(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=u(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=u(i)&&u(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),woe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function dE(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Bd=_r;function Ms(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Ms.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return u(t)&&u(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(u(t)&&u(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ms.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Ms.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return u(i)?n.featureTables[i].hasProperty(e,t):!1};Ms.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:u(this.batchTable)&&this.batchTable.setAllColor(t)};Ms.prototype.applyStyle=function(e){this._model.style=e};Ms.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,u(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),u(r)&&u(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:El.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Ms.prototype.isDestroyed=function(){return!1};Ms.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Ms.fromGltf=async function(e,t,n,i){let r=new Ms(e,t,n),s=AM(e,t,r,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Bd.fromGltfAsync(s);return r._model=c,r._readyPromise=new Promise(l=>{r._resolveContent=l}),r};Ms.fromB3dm=async function(e,t,n,i,r){let o=new Ms(e,t,n),a=AM(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let l=await Bd.fromB3dm(a);return o._model=l,o._readyPromise=new Promise(f=>{o._resolveContent=f}),o};Ms.fromI3dm=async function(e,t,n,i,r){let o=new Ms(e,t,n),a=AM(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Bd.fromI3dm(a);return o._model=c,o._readyPromise=new Promise(l=>{o._resolveContent=l}),o};Ms.fromPnts=async function(e,t,n,i,r){let o=new Ms(e,t,n),a=AM(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Bd.fromPnts(a);return o._model=c,o._readyPromise=new Promise(l=>{o._resolveContent=l}),o};Ms.fromGeoJson=async function(e,t,n,i){let r=new Ms(e,t,n),s=AM(e,t,r,{geoJson:i,resource:n}),a=await Bd.fromGeoJson(s);return r._model=a,r._readyPromise=new Promise(c=>{r._resolveContent=c}),r};function AM(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:ve.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return _t(i,r)}var $m=Ms;function Ld(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties(Ld.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ld.fromJson=function(e,t,n,i){let r=new Ld(e,t,n);return r._tileset.loadTileset(r._resource,i,r._tile),r._ready=!0,r};Ld.prototype.hasProperty=function(e,t){return!1};Ld.prototype.getFeature=function(e){};Ld.prototype.applyDebugSettings=function(e,t){};Ld.prototype.applyStyle=function(e){};Ld.prototype.update=function(e,t){};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){return ue(this)};var xM=Ld;var CM=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif - -uniform sampler2D u_atlas; - -#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_textureCoordinates; -in vec4 v_pickColor; -in vec4 v_color; - -#ifdef SDF -in vec4 v_outlineColor; -in float v_outlineWidth; -#endif -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates -in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) -in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -in mat2 v_rotationMatrix; +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + czm_pbrParameters pbrParameters +) { + vec3 diffuseColor = pbrParameters.diffuseColor; + float roughness = pbrParameters.roughness; + vec3 specularColor = pbrParameters.f0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT1 = 2.0; + vec3 v = -positionEC; + vec3 n = normalEC; + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; + float NdotV = abs(dot(n, v)) + 0.001; + float VdotH = clamp(dot(v, h), 0.0, 1.0); -float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) -{ - vec2 lookupVector = imageSize * (depthLookupST - adjustedST); - lookupVector = v_rotationMatrix * lookupVector; - vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal + const mat3 yUpToZUp = mat3( + -1.0, 0.0, 0.0, + 0.0, 0.0, -1.0, + 0.0, 1.0, 0.0 + ); + vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); - vec2 translation = v_originTextureCoordinateAndTranslate.zw; + #ifdef DIFFUSE_IBL + #ifdef CUSTOM_SPHERICAL_HARMONICS + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif + #else + vec3 diffuseIrradiance = vec3(0.0); + #endif - if (applyTranslate) - { - // this is only needed for labels where the horizontal origin is not LEFT - // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT - translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); - } + #ifdef SPECULAR_IBL + vec3 r0 = specularColor.rgb; + float reflectance = max(max(r0.r, r0.g), r0.b); + vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(r0, r90, VdotH); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + #ifdef CUSTOM_SPECULAR_IBL + vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); + #else + vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); + #endif + specularIBL *= F * brdfLut.x + brdfLut.y; + #else + vec3 specularIBL = vec3(0.0); + #endif - vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + return diffuseColor * diffuseIrradiance + specularColor * specularIBL; +} +#endif - if (logDepthOrDepth == 0.0) - { - return 0.0; // not on the globe - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - return eyeCoordinate.z / eyeCoordinate.w; +vec3 imageBasedLightingStage( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { + #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) + // Environment maps were provided, use them for IBL + return textureIBL( + positionEC, + normalEC, + lightDirectionEC, + pbrParameters + ); + #else + // Use the procedural IBL if there are no environment maps + return proceduralIBL( + positionEC, + normalEC, + lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif +}`;var rre={name:"ImageBasedLightingPipelineStage"};rre.process=function(e,t,n){let i=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,Te.FRAGMENT),r.addUniform("vec2","model_iblFactor",Te.FRAGMENT),xd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",Te.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Te.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Te.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,Te.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",Te.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",Te.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Te.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT)),l(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,Te.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",Te.FRAGMENT)),r.addFragmentLines(tR);let o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=gt(o,e.uniformMap)};var nR=rre;var Rke=D.EPSILON16;function N6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(N6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,Rke)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Oke=new m,L6=new $;N6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Oke,r;switch(t){case $a.XROTATE:r=$.fromRotationX(D.toRadians(n),L6),e=F.multiplyByMatrix3(e,r,e);break;case $a.YROTATE:r=$.fromRotationY(D.toRadians(n),L6),e=F.multiplyByMatrix3(e,r,e);break;case $a.ZROTATE:r=$.fromRotationZ(D.toRadians(n),L6),e=F.multiplyByMatrix3(e,r,e);break;case $a.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case $a.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case $a.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case $a.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case $a.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case $a.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case $a.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var iR=N6;function CU(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,Mke(this)}Object.defineProperties(CU.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function Mke(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new iR({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}CU.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Lke=new F,Nke=new F;CU.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,Lke),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=F.multiplyTransformation(s.originalTransform,e,Nke);s.transform=a}};var rR=CU;var oR=`void modelColorStage(inout czm_modelMaterial material) +{ + material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); + material.alpha *= model_color.a; +}`;var aA={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};aA.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,Te.FRAGMENT),i.addFragmentLines(oR);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ee.TRANSLUCENT),i.addUniform("vec4",aA.COLOR_UNIFORM_NAME,Te.FRAGMENT),r[aA.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",aA.COLOR_BLEND_UNIFORM_NAME,Te.FRAGMENT),r[aA.COLOR_BLEND_UNIFORM_NAME]=function(){return Za.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=gt(r,e.uniformMap)};var Gg=aA;var sR=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +#else +// Handle uint8 clipping texture instead +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each + int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); + return czm_transformPlane(plane, transform); } #endif +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float pixelWidth = czm_metersPerPixel(position); + + #ifdef UNION_CLIPPING_REGIONS + float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. + #else + float clipAmount = 0.0; + bool clipped = true; + #endif -#ifdef SDF + for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + + #ifdef UNION_CLIPPING_REGIONS + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) { + discard; + } + #else + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + #endif + } -// Get the distance from the edge of a glyph at a given position sampling an SDF texture. -float getDistance(vec2 position) -{ - return texture(u_atlas, position).r; + #ifndef UNION_CLIPPING_REGIONS + if (clipped) { + discard; + } + #endif + + return clipAmount; } -// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. -vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) +void modelClippingPlanesStage(inout vec4 color) { - float distance = getDistance(position); - - if (outlineWidth > 0.0) - { - // Don't get the outline edge exceed the SDF_EDGE - float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); - float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); - float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); - return vec4(sdfColor.rgb, sdfColor.a * alpha); - } - else - { - float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - return vec4(v_color.rgb, v_color.a * alpha); + float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; + + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; } } -#endif - -void main() +`;var ore={name:"ModelClippingPlanesPipelineStage"},Fke=new H;ore.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,Te.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,Te.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,Te.FRAGMENT),us.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Te.FRAGMENT);let s=us.getTextureResolution(i,r,Fke);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Te.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Te.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",Te.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",Te.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",Te.FRAGMENT),o.addFragmentLines(sR);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=gt(a,e.uniformMap)};var aR=ore;function sre(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(sre.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var cR=sre;var lR=`mat4 getInstancingTransform() { - vec4 color = texture(u_atlas, v_textureCoordinates); + mat4 instancingTransform; -#ifdef SDF - float outlineWidth = v_outlineWidth; - vec4 outlineColor = v_outlineColor; + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif - // Get the current distance - float distance = getDistance(v_textureCoordinates); + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float smoothing = fwidth(distance); - // Get an offset that is approximately half the distance to the neighbor pixels - // 0.354 is approximately half of 1/sqrt(2) - vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); + return instancingTransform; +} - // Sample the center point - vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ + mat4 instancingTransform2D; - // Sample the 4 neighbors - vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif - // Equally weight the center sample and the 4 neighboring samples - color = (center + color1 + color2 + color3 + color4)/5.0; -#else - // If no derivatives available (IE 10?), just do a single sample - float smoothing = 1.0/32.0; - color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif - color = czm_gammaCorrect(color); -#else - color = czm_gammaCorrect(color); - color *= czm_gammaCorrect(v_color); + return instancingTransform2D; +} #endif +`;var uR=`void instancingStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif - -#ifdef VECTOR_TILE - color *= u_highlightColor; -#endif - out_FragColor = color; - -#ifdef LOG_DEPTH - czm_writeLogDepth(); -#endif - -#ifdef FRAGMENT_DEPTH_CHECK - float temp = v_compressed.y; - - temp = temp * SHIFT_RIGHT1; - - float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; - bool enableDepthTest = temp2 != 0.0; - bool applyTranslate = floor(temp) != 0.0; - - if (enableDepthTest) { - temp = v_compressed.z; - temp = temp * SHIFT_RIGHT12; - - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); - - temp = v_compressed.w; - temp = temp * SHIFT_RIGHT12; - - vec2 imageSize; - imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; - imageSize.x = floor(temp); - - vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; - adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); - - float epsilonEyeDepth = v_compressed.x + czm_epsilon1; - float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); - - // negative values go into the screen - if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) - { - float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner - if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) - { - float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner - if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) - { - discard; - } - } - } - } -#endif + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif } -`;var TM=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) -in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width -in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free -in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale -in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions -in vec2 sdf; // sdf outline color (rgb) and width (w) -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) -in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates -#endif -#ifdef VECTOR_TILE -in float a_batchId; -#endif - -out vec2 v_textureCoordinates; -#ifdef FRAGMENT_DEPTH_CHECK -out vec4 v_textureCoordinateBounds; -out vec4 v_originTextureCoordinateAndTranslate; -out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -out mat2 v_rotationMatrix; -#endif - -out vec4 v_pickColor; -out vec4 v_color; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; -#endif - -const float UPPER_BOUND = 32768.0; - -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; - -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; - -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +`;var fR=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) { - // Note the halfSize cannot be computed in JavaScript because it is sent via - // compressed vertex attributes that coerce it to an integer. - vec2 halfSize = imageSize * scale * 0.5; - halfSize *= ((direction * 2.0) - 1.0); + vec3 positionMC = attributes.positionMC; - vec2 originTranslate = origin * abs(halfSize); + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); -#if defined(ROTATION) || defined(ALIGNED_AXIS) - if (validAlignedAxis || rotation != 0.0) + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var TU=new F,Bke=new F,kke=new F,cre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:mre,_transformsToTypedArray:B6};cre.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(lR);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];Qke(e,n,i,f,u),nUe(e,n,i,f);let d={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,Te.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",Te.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",Te.VERTEX),d.u_instance_modifiedModelView=function(){let p=F.multiplyTransformation(s.modelMatrix,a.components.transform,TU);return u?F.multiplyTransformation(n.context.uniformState.view3D,p,TU):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,TU)),F.multiplyTransformation(n.context.uniformState.view,p,TU))},d.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Bke)},o.addVertexLines(fR)):o.addVertexLines(uR),u){o.addDefine("USE_2D_INSTANCING",void 0,Te.VERTEX),o.addUniform("mat4","u_modelView2D",Te.VERTEX);let p=n.context,g=F.fromTranslation(c.instancingReferencePoint2D,new F);d.u_modelView2D=function(){return F.multiplyTransformation(p.uniformState.view,g,kke)}}e.uniformMap=gt(d,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,f)};var dR=new F,Uke=new m;function Vke(e,t,n,i,r){let o=F.multiplyTransformation(t,e,dR);return o=F.multiplyTransformation(o,n,dR),r=Mt.basisTo2D(i.mapProjection,o,r),r}function zke(e,t,n,i,r){let o=F.fromTranslation(e,dR),s=F.multiplyTransformation(t,o,dR);s=F.multiplyTransformation(s,n,dR);let a=F.getTranslation(s,Uke);return r=Qi.computeActualWgs84Position(i,a,r),r}function lre(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=F.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(r.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var ure=new F,fre=new F,Hke=new F,Gke=new m;function Wke(e,t,n,i){let r=ure,o=fre;lre(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Vke(f,r,o,n,Hke),p=F.getTranslation(d,Gke),g=m.subtract(p,a,p);i[u]=F.setTranslation(d,g,i[u])}return i}function jke(e,t,n,i){let r=ure,o=fre;lre(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=zke(f,r,o,n,f);i[u]=m.subtract(d,a,i[u])}return i}var qke=new m,Yke=new m;function dre(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=F.multiplyByPoint(i,n.instancingTranslationMin,qke),o=Qi.computeActualWgs84Position(t,r,r),s=F.multiplyByPoint(i,n.instancingTranslationMax,Yke),a=Qi.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=m.lerp(o,a,.5,new m)}function B6(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function Xke(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var Kke=new m,Jke=new Ne,Zke=new m;function mre(e,t,n){let i=new Array(t),r=$t.getAttributeBySemantic(e,Yo.TRANSLATION),o=$t.getAttributeBySemantic(e,Yo.ROTATION),s=$t.getAttributeBySemantic(e,Yo.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=Xn.dequantize(g,o.componentDatatype,o.type,t));let h;d?h=s.typedArray:(h=new Float32Array(t*3),h.fill(1));for(let b=0;b<t;b++){let C=new m(p[b*3],p[b*3+1],p[b*3+2],Kke);m.maximumByComponent(a,C,a),m.minimumByComponent(c,C,c);let A=new Ne(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,Jke),T=new m(h[b*3],h[b*3+1],h[b*3+2],Zke),S=F.fromTranslationQuaternionRotationScale(C,A,T,new F);i[b]=S}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function $ke(e,t,n){let i=new Array(t),r=e.typedArray,o=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new m(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,m.minimumByComponent(o,u,o),m.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function k6(e,t){let n=mt.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Qke(e,t,n,i,r){let o=$t.getAttributeBySemantic(n,Yo.ROTATION);l(o)?eUe(e,n,i,t,r):tUe(e,n,i,t,r)}function eUe(e,t,n,i,r){let o=e.shaderBuilder,s=t.attributes[0].count,a=e.model,c=e.runtimeNode;o.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",f,d=c.instancingTransformsBuffer;if(!l(d)){f=mre(t,s,e);let x=B6(f);d=k6(x,i),a._modelResources.push(d),c.instancingTransformsBuffer=d}if(are(e,d,n,u),!r)return;let p=je(i);p.mode=ne.COLUMBUS_VIEW,dre(e,p);let g=c.instancingTransformsBuffer2D;if(!l(g)){let x=Wke(f,e,p,f),b=B6(x);g=k6(b,i),a._modelResources.push(g),c.instancingTransformsBuffer2D=g}are(e,g,n,"Transform2D")}function tUe(e,t,n,i,r){let o=e.shaderBuilder,s=e.runtimeNode,a=$t.getAttributeBySemantic(t,Yo.TRANSLATION),c=$t.getAttributeBySemantic(t,Yo.SCALE);if(l(c)){o.addDefine("HAS_INSTANCE_SCALE");let C="Scale";F6(e,c.buffer,c.byteOffset,c.byteStride,n,C)}if(!l(a))return;let u,f=a.typedArray;l(f)?u=$ke(a,a.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=a.min,s.instancingTranslationMax=a.max),o.addDefine("HAS_INSTANCE_TRANSLATION");let d="Translation";if(F6(e,a.buffer,a.byteOffset,a.byteStride,n,d),!r)return;let p=je(i);p.mode=ne.COLUMBUS_VIEW,dre(e,p);let g=s.instancingTranslationBuffer2D;if(!l(g)){let C=jke(u,e,p,u),A=Xke(C);g=k6(A,i),e.model._modelResources.push(g),s.instancingTranslationBuffer2D=g}F6(e,g,0,void 0,n,"Translation2D")}function are(e,t,n,i){let o=X.getSizeInBytes(X.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function F6(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function nUe(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Yo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:cn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var mR=cre;var U6={};U6.name="ModelMatrixUpdateStage";U6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;hre(e,t,r,e.transformToRoot),e._transformDirty=!1}};function hre(e,t,n,i){let r;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let c=e.runtimePrimitives[r].drawCommand;c.modelMatrix=F.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=$t.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(r=0;r<s;r++){let a=t._runtimeNodes[e.children[r]];a._transformToRoot=F.clone(i,a._transformToRoot),hre(a,t,n,i),a._transformDirty=!1}}var hR=U6;var pre={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:_re,_countGeneratedBuffers:gre};pre.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;_re(i,r),gre(i,o)};function _re(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function gre(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var pR=pre;function cA(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,iUe(this)}Object.defineProperties(cA.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),V6(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Ne.equals(n,e)||(t.rotation=Ne.clone(e,t.rotation),V6(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),V6(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function iUe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new _g(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function V6(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}cA.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};cA.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(mR),t.push(pR),n.push(hR)};cA.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};cA.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new F);let o=F.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=F.inverseTransformation(o,t[r]);t[r]=F.multiplyTransformation(s,n[r],t[r])}};var _R=cA;var yre={name:"AlphaPipelineStage"};yre.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=y(i.pass,r.opaquePass);let o=e.renderStateOptions;i.pass===Ee.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=dn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,Te.FRAGMENT),s.addUniform("float","u_alphaCutoff",Te.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var gR=yre;var xre={name:"BatchTexturePipelineStage"};xre.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=gt(r,e.uniformMap)};var yR=xre;var bre={name:"ClassificationPipelineStage"};bre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,Te.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||rUe(t,r)};function rUe(e,t){let n=$t.getAttributeBySemantic(e,At.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=$t.getAttributeBySemantic(e,At.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let x=1;x<s;x++){let b=o?i[x]:x,C=c[b];if(C!==p){let A=x-g,T=x;u.push(A),f.push(T),g=T,p=C}}let h=s-g;u.push(h),t.batchLengths=u,t.batchOffsets=f}var xR=bre;var bR=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) { - float angle = rotation; - if (validAlignedAxis) - { - vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); - angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / - (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); - } - - float cosTheta = cos(angle); - float sinTheta = sin(angle); - rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); - halfSize = rotationMatrix * halfSize; + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + positionMC *= float(model_silhouettePass); + #else + positionMC *= 0.0; + #endif } - else + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) { - rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); + positionMC *= 0.0; } -#endif - - mpp = czm_metersPerPixel(positionEC); - positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); - positionEC.xy += (translate + pixelOffset) * mpp; - - return positionEC; } -#ifdef VERTEX_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) { - vec4 posWC = czm_eyeToWindowCoordinates(positionEC); - - float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); + float show = ceil(feature.color.a); + positionMC *= show; - if (globeDepth == 0.0) + #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) + filterByPassType(positionMC, feature.color); + #endif +} +`;var CR=`void filterByPassType(vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + if(!model_silhouettePass) { + discard; + } + #else + discard; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) { - return 0.0; // not on the globe + discard; } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); - return eyeCoordinate.z / eyeCoordinate.w; } -#endif -void main() -{ - // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndScale.xyz; - vec3 positionLow = positionLowAndRotation.xyz; - float scale = positionHighAndScale.w; - -#if defined(ROTATION) || defined(ALIGNED_AXIS) - float rotation = positionLowAndRotation.w; -#else - float rotation = 0.0; -#endif - - float compressed = compressedAttribute0.x; - - vec2 pixelOffset; - pixelOffset.x = floor(compressed * SHIFT_RIGHT7); - compressed -= pixelOffset.x * SHIFT_LEFT7; - pixelOffset.x -= UPPER_BOUND; - vec2 origin; - origin.x = floor(compressed * SHIFT_RIGHT5); - compressed -= origin.x * SHIFT_LEFT5; - - origin.y = floor(compressed * SHIFT_RIGHT3); - compressed -= origin.y * SHIFT_LEFT3; +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ + vec4 featureColor = feature.color; + if (featureColor.a == 0.0) + { + discard; + } -#ifdef FRAGMENT_DEPTH_CHECK - vec2 depthOrigin = origin.xy; -#endif - origin -= vec2(1.0); + // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. + // So, we only apply in in the fragment shader if the feature ID texture is used. + #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) + filterByPassType(featureColor); + #endif - float show = floor(compressed * SHIFT_RIGHT2); - compressed -= show * SHIFT_LEFT2; + featureColor = czm_gammaCorrect(featureColor); -#ifdef INSTANCED - vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); - vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); - vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; -#else - vec2 direction; - direction.x = floor(compressed * SHIFT_RIGHT1); - direction.y = compressed - direction.x * SHIFT_LEFT1; - - vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); -#endif - - float temp = compressedAttribute0.y * SHIFT_RIGHT8; - pixelOffset.y = -(floor(temp) - UPPER_BOUND); - - vec2 translate; - translate.y = (temp - floor(temp)) * SHIFT_LEFT16; - - temp = compressedAttribute0.z * SHIFT_RIGHT8; - translate.x = floor(temp) - UPPER_BOUND; - - translate.y += (temp - floor(temp)) * SHIFT_LEFT8; - translate.y -= UPPER_BOUND; - - temp = compressedAttribute1.x * SHIFT_RIGHT8; - float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); - - vec2 imageSize = vec2(floor(temp), temp2); - -#ifdef FRAGMENT_DEPTH_CHECK - float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); - float applyTranslate = 0.0; - if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false - { - applyTranslate = 1.0; - labelHorizontalOrigin -= 2.0; - depthOrigin.x = labelHorizontalOrigin + 1.0; - } - - depthOrigin = vec2(1.0) - (depthOrigin * 0.5); -#endif - -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; + // Classification models compute the diffuse differently. + #ifdef HAS_CLASSIFICATION + material.diffuse = featureColor.rgb * featureColor.a; + #else + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + #endif + + material.alpha *= featureColor.a; +} +`;var Cre={name:"CPUStylingPipelineStage"};Cre.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(bR),r.addFragmentLines(CR),r.addDefine("USE_CPU_STYLING",void 0,Te.BOTH),l(i.color)||(r.addUniform("float",Gg.COLOR_BLEND_UNIFORM_NAME,Te.FRAGMENT),e.uniformMap[Gg.COLOR_BLEND_UNIFORM_NAME]=function(){return Za.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",Te.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ee.TRANSLUCENT}};var TR=Cre;var Tre={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Tre.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Gp=Object.freeze(Tre);var AR=`void customShaderStage( + inout czm_modelVertexOutput vsOutput, + inout ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // VertexInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + VertexInput vsInput; + initializeInputStruct(vsInput, attributes); + vsInput.featureIds = featureIds; + vsInput.metadata = metadata; + vsInput.metadataClass = metadataClass; + vsInput.metadataStatistics = metadataStatistics; + vertexMain(vsInput, vsOutput); + attributes.positionMC = vsOutput.positionMC; +} +`;var ER=`void customShaderStage( + inout czm_modelMaterial material, + ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // FragmentInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + FragmentInput fsInput; + initializeInputStruct(fsInput, attributes); + fsInput.featureIds = featureIds; + fsInput.metadata = metadata; + fsInput.metadataClass = metadataClass; + fsInput.metadataStatistics = metadataStatistics; + fragmentMain(fsInput, material); +} +`;var SR=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); +} +`;var vR=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); + setFeatureIdVaryings(); +} +`;var Ui={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Ui.process=function(e,t,n){let i=e.shaderBuilder;oUe(i);let r=e.runtimeNode.node.instances;l(r)&&sUe(e,r,n),aUe(e,t,n),i.addVertexLines(vR),i.addFragmentLines(SR)};function oUe(e){e.addStruct(Ui.STRUCT_ID_FEATURE_IDS_VS,Ui.STRUCT_NAME_FEATURE_IDS,Te.VERTEX),e.addStruct(Ui.STRUCT_ID_FEATURE_IDS_FS,Ui.STRUCT_NAME_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.VERTEX),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.VERTEX),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ui.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Te.VERTEX)}function sUe(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Bt.FeatureIdAttribute?cUe(e,s,a):Are(e,s,a,r,1,n);let c=s.label;l(c)&&Ere(e,a,c,Te.BOTH)}}function aUe(e,t,n){let i=t.featureIds,o=$t.getAttributeBySemantic(t,At.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=Te.BOTH;a instanceof Bt.FeatureIdAttribute?lUe(e,a,c):a instanceof Bt.FeatureIdImplicitRange?Are(e,a,c,o,void 0,n):(uUe(e,a,c,s,n),u=Te.FRAGMENT);let f=a.label;l(f)&&Ere(e,c,f,u)}}function cUe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function lUe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Are(e,t,n,i,r,o){fUe(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function uUe(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return y(a.texture,r.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,Te.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,d=`texture(${o}, ${f}).${c}`,p=`featureIds.${n} = czm_unpackUint(${d});`;u.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Ere(e,t,n,i){let r=e.shaderBuilder,o=Te.includesVertexShader(i);o&&r.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function fUe(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=dUe(t,n);s=mt.createVertexBuffer({context:r.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s);let f=!1;o.statistics.addBuffer(s,f)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function dUe(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var Wg=Ui;var wR=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +} +`;var IR=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); + setMetadataVaryings(); +} +`;var Si={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Si.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=mUe(o.propertyAttributes,t,a),u=pUe(o.propertyTextures,a),f=c.concat(u);gUe(i,f),bUe(i),i.addVertexLines(IR),i.addFragmentLines(wR);for(let d=0;d<c.length;d++){let p=c[d];CUe(e,p)}for(let d=0;d<u.length;d++){let p=u[d];AUe(e,p)}};function mUe(e,t,n){return l(e)?e.flatMap(i=>hUe(i,t,n)):[]}function hUe(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=$t,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:h,variableName:x}=r(g);u[f]={metadataVariable:o(d),property:p,type:p.classProperty.type,glslType:h,variableName:x,propertyStatistics:a?.properties[d],shaderDestination:Te.BOTH}}return u}function pUe(e,t){return l(e)?e.flatMap(n=>_Ue(n,t)):[]}function _Ue(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:Te.FRAGMENT}}return s}function gUe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==qt.ENUM&&i.add(u)}let r=Si.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Si.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,Te.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?xUe(c):c;e.addStructField(a,p,d)}}}var yUe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function xUe(e){let t=yUe[e];return l(t)?t:e}function bUe(e){e.addStruct(Si.STRUCT_ID_METADATA_VS,Si.STRUCT_NAME_METADATA,Te.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_FS,Si.STRUCT_NAME_METADATA,Te.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_VS,Si.STRUCT_NAME_METADATA_CLASS,Te.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_FS,Si.STRUCT_NAME_METADATA_CLASS,Te.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_VS,Si.STRUCT_NAME_METADATA_STATISTICS,Te.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_FS,Si.STRUCT_NAME_METADATA_STATISTICS,Te.FRAGMENT),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Te.VERTEX),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Te.FRAGMENT),e.addFunction(Si.FUNCTION_ID_SET_METADATA_VARYINGS,Si.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,Te.VERTEX)}function CUe(e,t){TUe(e,t),Sre(e.shaderBuilder,t),vre(e.shaderBuilder,t)}function TUe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=Ire({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:Te.BOTH,property:r});n.addStructField(Si.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Si.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function AUe(e,t){EUe(e,t),Sre(e.shaderBuilder,t),vre(e.shaderBuilder,t)}function EUe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:r,glslType:o,property:s}=t,{texCoord:a,channels:c,index:u,texture:f}=s.textureReader,d=`u_propertyTexture_${u}`;i.hasOwnProperty(d)||(n.addUniform("sampler2D",d,Te.FRAGMENT),i[d]=()=>f),n.addStructField(Si.STRUCT_ID_METADATA_FS,o,r);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),x=Ire({valueExpression:h,renderResources:e,glslType:o,metadataVariable:r,shaderDestination:Te.FRAGMENT,property:s}),b=`metadata.${r} = ${x};`;n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,[b])}function Sre(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=wre(Si.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Si.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,s),Te.includesVertexShader(o)&&(e.addStructField(Si.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function vre(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===qt.ENUM)return;let s=Si.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=wre(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,c),Te.includesVertexShader(t.shaderDestination)&&(e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function wre(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function Ire(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}var af=Si;var SUe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},jg=Object.freeze(SUe);var ns={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Nt};ns.process=function(e,t,n){let i=e.model.customShader;if(i&&ns.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let r=qh.getCache(e.model._marsOptions.customShaders);for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&ns.process_original(e,t,n,r[o])}};ns.process_original=function(e,t,n,i){let r=e.shaderBuilder;l(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let o=e.alphaOptions;i.translucencyMode===jg.TRANSLUCENT?o.pass=Ee.TRANSLUCENT:i.translucencyMode===jg.OPAQUE&&(o.pass=void 0);let s=MUe(i,t);if(!s.customShaderEnabled)return;if(BUe(r,i,s),s.shouldComputePositionWC&&r.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Te.BOTH),l(i.vertexShaderText)&&r.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Te.VERTEX),l(i.fragmentShaderText)){r.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Te.FRAGMENT);let u=Gp.getDefineName(i.mode);r.addDefine(u,void 0,Te.FRAGMENT)}let a=i.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];r.addUniform(f.type,u)}let c=i.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];r.addVarying(f,u)}e.uniformMap=gt(e.uniformMap,i.uniformMap)};function vUe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n],r=$t.getAttributeInfo(i);t[r.variableName]=r}return t}var wUe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},IUe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Pre(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=wUe[t],i=IUe[t];if(l(n))return{attributeField:[n,e],value:i}}function PUe(e,t,n){let i=Dre(t,e.usedVariablesVertex.attributeSet,!1),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let d=[r[s].glslType,s];c.push(d),a=`vsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let f=0;f<o.length;f++){s=o[f];let d=Pre(s);if(!l(d)){ns._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${s}, disabling custom vertex shader`);return}c.push(d.attributeField),a=`vsInput.attributes.${s} = ${d.value};`,u.push(a)}n.enabled=!0,n.attributeFields=c,n.initializationLines=u}function DUe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function RUe(e,t,n){let i=Dre(t,e.usedVariablesFragment.attributeSet,!0),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let p=[r[s].glslType,s];c.push(p),a=`fsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let d=0;d<o.length;d++){s=o[d];let p=Pre(s);if(!l(p)){ns._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${s}, disabling custom fragment shader.`);return}c.push(p.attributeField),a=`fsInput.attributes.${s} = ${p.value};`,u.push(a)}let f=DUe(e);n.enabled=!0,n.attributeFields=c.concat(f.attributeFields),n.initializationLines=f.initializationLines.concat(u)}var OUe={positionWC:!0,positionEC:!0};function Dre(e,t,n){let i,r,o={};for(r in e)if(e.hasOwnProperty(r)){let a=e[r];i=r,n&&r==="normalMC"?i="normalEC":n&&r==="tangentMC"&&(i="tangentEC"),t.hasOwnProperty(i)&&(o[i]=a)}let s=[];for(r in t)if(t.hasOwnProperty(r)){if(OUe.hasOwnProperty(r))continue;i=r,n&&r==="normalEC"?i="normalMC":n&&r==="tangentEC"&&(i="tangentMC"),e.hasOwnProperty(i)||s.push(r)}return{addToShader:o,missingAttributes:s}}function MUe(e,t){let n={enabled:!1},i={enabled:!1},r=vUe(t.attributes);l(e.vertexShaderText)&&PUe(e,r,n),l(e.fragmentShaderText)&&RUe(e,r,i);let s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:s}}function LUe(e,t){let n,i=ns.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,ns.STRUCT_NAME_ATTRIBUTES,Te.VERTEX);let r=t.attributeFields;for(n=0;n<r.length;n++){let a=r[n],c=a[0],u=a[1];e.addStructField(i,c,u)}i=ns.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,ns.STRUCT_NAME_VERTEX_INPUT,Te.VERTEX),e.addStructField(i,ns.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Wg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,af.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,af.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,af.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ns.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,ns.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,Te.VERTEX);let s=t.initializationLines;e.addFunctionLines(o,s)}function NUe(e,t){let n,i=ns.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,ns.STRUCT_NAME_ATTRIBUTES,Te.FRAGMENT);let r,o,s,a=t.attributeFields;for(n=0;n<a.length;n++)r=a[n],o=r[0],s=r[1],e.addStructField(i,o,s);i=ns.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,ns.STRUCT_NAME_FRAGMENT_INPUT,Te.FRAGMENT),e.addStructField(i,ns.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Wg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,af.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,af.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,af.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let c=ns.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,ns.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,Te.FRAGMENT);let u=t.initializationLines;e.addFunctionLines(c,u)}var FUe=[];function BUe(e,t,n){let i=n.vertexLines,r=FUe;i.enabled&&(LUe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,AR),e.addVertexLines(r));let o=n.fragmentLines;o.enabled&&(NUe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,ER),e.addFragmentLines(r))}var PR=ns;var DR={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};DR.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,Te.VERTEX),i.addFunction(DR.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,DR.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,Te.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===At.POSITION,d=c.semantic===At.TEXCOORD;if(o&&!f&&!d)continue;let p=$t.getAttributeInfo(c);UUe(i,p),kUe(e,p)}};function kUe(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,Te.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,Te.VERTEX),n.addUniform(c,a,Te.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=Rre(u,0),f=Rre(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Rre(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function UUe(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=VUe(n,i):r=zUe(n),e.addFunctionLines(DR.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function VUe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function zUe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var RR=DR;var OR=`void geometryStage(out ProcessedAttributes attributes) +{ + attributes.positionMC = v_positionMC; + attributes.positionEC = v_positionEC; - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER + attributes.positionWC = v_positionWC; + #endif - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif + #ifdef HAS_NORMALS + // renormalize after interpolation + attributes.normalEC = normalize(v_normalEC); + #endif -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) - temp = compressedAttribute3.w; - temp = temp * SHIFT_RIGHT12; + #ifdef HAS_TANGENTS + attributes.tangentEC = normalize(v_tangentEC); + #endif - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); -#endif + #ifdef HAS_BITANGENTS + attributes.bitangentEC = normalize(v_bitangentEC); + #endif -#ifdef ALIGNED_AXIS - vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); - temp = compressedAttribute2.z * SHIFT_RIGHT5; - bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; -#else - vec3 alignedAxis = vec3(0.0); - bool validAlignedAxis = false; -#endif + // Everything else is dynamically generated in GeometryPipelineStage + setDynamicVaryings(attributes); +} +`;var MR=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ + vec4 computedPosition; - vec4 pickColor; - vec4 color; + // Compute positions in different coordinate systems + vec3 positionMC = attributes.positionMC; + v_positionMC = positionMC; + v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; - temp = compressedAttribute2.y; - temp = temp * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + vec3 position2D = attributes.position2D; + vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; + computedPosition = czm_projection * vec4(positionEC, 1.0); + #else + computedPosition = czm_projection * vec4(v_positionEC, 1.0); + #endif - temp = compressedAttribute2.x; - temp = temp * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); + // Sometimes the custom shader and/or style needs this + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) + // Note that this is a 32-bit position which may result in jitter on small + // scales. + v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + #endif - temp = compressedAttribute2.z * SHIFT_RIGHT8; - bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; - temp = floor(temp) * SHIFT_RIGHT8; + #ifdef HAS_NORMALS + v_normalEC = normalize(normal * attributes.normalMC); + #endif - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor /= 255.0; + #ifdef HAS_TANGENTS + v_tangentEC = normalize(normal * attributes.tangentMC); + #endif - color.a = floor(temp); - color /= 255.0; + #ifdef HAS_BITANGENTS + v_bitangentEC = normalize(normal * attributes.bitangentMC); + #endif - /////////////////////////////////////////////////////////////////////////// + // All other varyings need to be dynamically generated in + // GeometryPipelineStage + setDynamicVaryings(attributes); + + return computedPosition; +} +`;var lA=`vec2 computeSt(float featureId) +{ + float stepX = model_textureStep.x; + float centerX = model_textureStep.y; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; + #ifdef MULTILINE_BATCH_TEXTURE + float stepY = model_textureStep.z; + float centerY = model_textureStep.w; -#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) - float eyeDepth = positionEC.z; -#endif + float xId = mod(featureId, model_textureDimensions.x); + float yId = floor(featureId / model_textureDimensions.x); + + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); + #else + return vec2(centerX + (featureId * stepX), 0.5); + #endif +} - positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); - positionEC.xyz *= show; +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +{ + int featureId = featureIds.SELECTED_FEATURE_ID; - /////////////////////////////////////////////////////////////////////////// -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) + if (featureId < model_featuresLength) { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; + vec2 featureSt = computeSt(float(featureId)); + + feature.id = featureId; + feature.st = featureSt; + feature.color = texture(model_batchTexture, featureSt); } + // Floating point comparisons can be unreliable in GLSL, so we + // increment the feature ID to make sure it's always greater + // then the model_featuresLength - a condition we check for in the + // pick ID, to avoid sampling the pick texture if the feature ID is + // greater than the number of features. else { - lengthSq = dot(positionEC.xyz, positionEC.xyz); + feature.id = model_featuresLength + 1; + feature.st = vec2(0.0); + feature.color = vec4(1.0); } -#endif -#ifdef EYE_DISTANCE_SCALING - float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); - scale *= distanceScale; - translate *= distanceScale; - // push vertex behind near plane for clipping - if (scale == 0.0) - { - positionEC.xyz = vec3(0.0); + #ifdef HAS_NULL_FEATURE_ID + if (featureId == model_nullFeatureId) { + feature.id = featureId; + feature.st = vec2(0.0); + feature.color = vec4(1.0); } -#endif + #endif +} +`;var LR={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};LR.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=HUe(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),GUe(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===Te.BOTH&&i.addVertexLines(lA),i.addFragmentLines(lA)};function Ore(e){return e instanceof Bt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Mre(e){return e instanceof Bt.FeatureIdTexture?Te.FRAGMENT:Te.BOTH}function HUe(e,t,n){let i,r;return l(t.instances)&&(r=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Mre(r),featureIdDefine:Ore(r)}):(r=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Mre(r),featureIdDefine:Ore(r)})}function GUe(e){e.addStructField(LR.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(LR.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(LR.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var qg=LR;var Ps={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ps.process=function(e,t,n){let i=e.shaderBuilder,r=e.model;i.addStruct(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Te.VERTEX),i.addStruct(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Te.FRAGMENT),i.addStruct(qg.STRUCT_ID_SELECTED_FEATURE,qg.STRUCT_NAME_SELECTED_FEATURE,Te.BOTH),i.addFunction(Ps.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ps.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Te.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ps.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ps.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.VERTEX),i.addFunction(Ps.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ps.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.FRAGMENT),r.type===Ur.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Te.FRAGMENT);let s=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,u=t.attributes.length;for(let f=0;f<u;f++){let d=t.attributes[f],p=cn.getAttributeLocationCount(d.type),g=d.semantic===At.POSITION,h;p>1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,WUe(e,d,h,p,s,a)}QUe(i,t.attributes),t.primitiveType===Le.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(MR),i.addFragmentLines(OR)};function WUe(e,t,n,i,r,o){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),c=r&&!o;i>1?YUe(e,t,n,i):qUe(e,t,n,c),KUe(s,a,c),XUe(s,a),l(t.semantic)&&jUe(s,t),JUe(s,a,r),ZUe(s,a,c),$Ue(s,a)}function jUe(e,t){let n=t.semantic,i=t.setIndex;switch(n){case At.NORMAL:e.addDefine("HAS_NORMALS");break;case At.TANGENT:e.addDefine("HAS_TANGENTS");break;case At.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case At.TEXCOORD:case At.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function qUe(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===At.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===At.POSITION,f=u?0:n,d=cn.getNumberOfComponents(o),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function YUe(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.normalized,u=cn.getNumberOfComponents(o)/i,f=X.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let h=t.byteOffset+g*d,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:h,strideInBytes:p,normalize:a};e.attributes.push(x)}}function XUe(e,t){let n=t.variableName,i=`v_${n}`,r;n==="normalMC"?(i="v_normalEC",r=t.glslType):n==="tangentMC"?(r="vec3",i="v_tangentEC"):r=t.glslType,e.addVarying(r,i)}function KUe(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===At.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function JUe(e,t,n){let i=Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,o=t.variableName;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,t.glslType,o),e.addStructField(r,t.glslType,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function ZUe(e,t,n){let i=Ps.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function $Ue(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(l(n)&&!l(i))return;let r=Ps.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Ps.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function QUe(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===At.NORMAL?n=!0:o.semantic===At.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ps.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var NR=Ps;var FR=`#ifdef LIGHTING_PBR +vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes) +{ + czm_pbrParameters pbrParameters; + pbrParameters.diffuseColor = inputMaterial.diffuse; + pbrParameters.f0 = inputMaterial.specular; + pbrParameters.roughness = inputMaterial.roughness; + + #ifdef USE_CUSTOM_LIGHT_COLOR + vec3 lightColorHdr = model_lightColorHdr; + #else + vec3 lightColorHdr = czm_lightColorHdr; + #endif - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency == 0.0) - { - positionEC.xyz = vec3(0.0); - } -#endif + vec3 color = inputMaterial.diffuse; + #ifdef HAS_NORMALS + color = czm_pbrLighting( + attributes.positionEC, + inputMaterial.normalEC, + czm_lightDirectionEC, + lightColorHdr, + pbrParameters + ); -#ifdef EYE_DISTANCE_PIXEL_OFFSET - float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); - pixelOffset *= pixelOffsetScale; -#endif + #ifdef USE_IBL_LIGHTING + color += imageBasedLightingStage( + attributes.positionEC, + inputMaterial.normalEC, + czm_lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif + #endif -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = compressedAttribute3.x; - float farSq = compressedAttribute3.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - positionEC.xyz = vec3(0.0); - } -#endif + color *= inputMaterial.occlusion; + color += inputMaterial.emissive; - mat2 rotationMatrix; - float mpp; + // In HDR mode, the frame buffer is in linear color space. The + // post-processing stages (see PostProcessStageCollection) will handle + // tonemapping. However, if HDR is not enabled, we must tonemap else large + // values may be clamped to 1.0 + #ifndef HDR + color = czm_acesTonemapping(color); + #endif -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = compressedAttribute3.z; + return color; +} #endif -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { - float depthsilon = 10.0; +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ + // Even though the lighting will only set the diffuse color, + // pass all other properties so further stages have access to them. + vec3 color = vec3(0.0); - vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; - vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth1 = getGlobeDepth(pEC1); + #ifdef LIGHTING_PBR + color = computePbrLighting(material, attributes); + #else // unlit + color = material.diffuse; + #endif - if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) - { - vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth2 = getGlobeDepth(pEC2); + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + // The colors resulting from point cloud styles are adjusted differently. + color = czm_gammaCorrect(color); + #elif !defined(HDR) + // If HDR is not enabled, the frame buffer stores sRGB colors rather than + // linear colors so the linear value must be converted. + color = czm_linearToSrgb(color); + #endif - if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) - { - vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth3 = getGlobeDepth(pEC3); - if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) - { - positionEC.xyz = vec3(0.0); - } - } - } + material.diffuse = color; +} +`;var eVe={UNLIT:0,PBR:1},$m=Object.freeze(eVe);var Lre={name:"LightingPipelineStage"};Lre.process=function(e,t){let n=e.model,i=e.lightingOptions,r=e.shaderBuilder;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Te.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",Te.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===$m.PBR?r.addDefine("LIGHTING_PBR",void 0,Te.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,Te.FRAGMENT),r.addFragmentLines(FR)};var BR=Lre;var kR=`// If the style color is white, it implies the feature has not been styled. +bool isDefaultStyleColor(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } -#endif - positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - gl_Position = czm_projection * positionEC; - v_textureCoordinates = textureCoordinates; +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +{ + vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); + vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; + return color; +} -#ifdef LOG_DEPTH - czm_vertexLogDepth(); -#endif +vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ + return vec2(textureTransform * vec3(texCoord, 1.0)); +} -#ifdef DISABLE_DEPTH_DISTANCE - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ + // Geometry normal. This is already normalized + vec3 ng = attributes.normalEC; - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = 1.0; -#endif - } - } -#endif + vec3 normal = ng; + #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) + vec2 normalTexCoords = TEXCOORD_NORMAL; + #ifdef HAS_NORMAL_TEXTURE_TRANSFORM + normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform); + #endif -#ifdef FRAGMENT_DEPTH_CHECK - if (sizeInMeters) { - translate /= mpp; - dimensions /= mpp; - imageSize /= mpp; + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + mat3 tbn = mat3(t, b, ng); + vec3 n = texture(u_normalTexture, normalTexCoords).rgb; + normal = normalize(tbn * (2.0 * n - 1.0)); + #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // If derivatives are available (not IE 10), compute tangents + vec3 positionEC = attributes.positionEC; + vec3 pos_dx = dFdx(positionEC); + vec3 pos_dy = dFdy(positionEC); + vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0)); + vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0)); + vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); + t = normalize(t - ng * dot(ng, t)); + vec3 b = normalize(cross(ng, t)); + mat3 tbn = mat3(t, b, ng); + vec3 n = texture(u_normalTexture, normalTexCoords).rgb; + normal = normalize(tbn * (2.0 * n - 1.0)); + #endif + #endif + + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + normal = -normal; } + #endif -#if defined(ROTATION) || defined(ALIGNED_AXIS) - v_rotationMatrix = rotationMatrix; -#else - v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); + return normal; +} #endif - float enableDepthCheck = 0.0; - if (lengthSq < disableDepthTestDistance) - { - enableDepthCheck = 1.0; - } +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +{ + #ifdef HAS_NORMALS + material.normalEC = computeNormal(attributes); + #endif - float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); - float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); + vec4 baseColorWithAlpha = vec4(1.0); + // Regardless of whether we use PBR, set a base color + #ifdef HAS_BASE_COLOR_TEXTURE + vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); - float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); + #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM + baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); + #endif - v_compressed.x = eyeDepth; - v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; - v_compressed.z = dw * SHIFT_LEFT12 + dh; - v_compressed.w = iw * SHIFT_LEFT12 + ih; - v_originTextureCoordinateAndTranslate.xy = depthOrigin; - v_originTextureCoordinateAndTranslate.zw = translate; - v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; + baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#endif + #ifdef HAS_BASE_COLOR_FACTOR + baseColorWithAlpha *= u_baseColorFactor; + #endif + #elif defined(HAS_BASE_COLOR_FACTOR) + baseColorWithAlpha = u_baseColorFactor; + #endif -#ifdef SDF - vec4 outlineColor; - float outlineWidth; + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + baseColorWithAlpha = v_pointCloudColor; + #elif defined(HAS_COLOR_0) + vec4 color = attributes.color_0; + // .pnts files store colors in the sRGB color space + #ifdef HAS_SRGB_COLOR + color = czm_srgbToLinear(color); + #endif + baseColorWithAlpha *= color; + #endif - temp = sdf.x; - temp = temp * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); - - temp = sdf.y; - temp = temp * SHIFT_RIGHT8; - float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.a = floor(temp); - outlineColor /= 255.0; + material.diffuse = baseColorWithAlpha.rgb; + material.alpha = baseColorWithAlpha.a; - v_outlineWidth = outlineWidth / 255.0; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency; -#endif + #ifdef USE_CPU_STYLING + material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); + #endif - v_pickColor = pickColor; + #ifdef HAS_OCCLUSION_TEXTURE + vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; + #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM + occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + #endif + material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; + #endif - v_color = color; - v_color.a *= translucency; + #ifdef HAS_EMISSIVE_TEXTURE + vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; + #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM + emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #endif -} -`;function Si(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;u(n)&&(n=Bt.clone(n)),u(i)&&(i=Bt.clone(i)),u(r)&&(r=Bt.clone(r)),u(o)&&(o=wt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,je.NONE),this._verticalOrigin=y(e.verticalOrigin,On.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;u(s)&&(u(a)||(typeof s=="string"?a=s:u(s.src)?a=s.src:a=jn()),this._imageId=a,this._image=s),u(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),u(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var Poe=Si.SHOW_INDEX=0,SV=Si.POSITION_INDEX=1,Loe=Si.PIXEL_OFFSET_INDEX=2,MHe=Si.EYE_OFFSET_INDEX=3,RHe=Si.HORIZONTAL_ORIGIN_INDEX=4,BHe=Si.VERTICAL_ORIGIN_INDEX=5,LHe=Si.SCALE_INDEX=6,vV=Si.IMAGE_INDEX_INDEX=7,Ooe=Si.COLOR_INDEX=8,NHe=Si.ROTATION_INDEX=9,FHe=Si.ALIGNED_AXIS_INDEX=10,UHe=Si.SCALE_BY_DISTANCE_INDEX=11,VHe=Si.TRANSLUCENCY_BY_DISTANCE_INDEX=12,kHe=Si.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,zHe=Si.DISTANCE_DISPLAY_CONDITION=14,HHe=Si.DISABLE_DEPTH_DISTANCE=15;Si.TEXTURE_COORDINATE_BOUNDS=16;var Moe=Si.SDF_INDEX=17;Si.NUMBER_OF_PROPERTIES=18;function zr(e,t){let n=e._billboardCollection;u(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Si.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,zr(this,Poe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),zr(this,SV))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),zr(this,SV))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),zr(this,Loe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),zr(this,UHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),zr(this,VHe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),zr(this,kHe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),zr(this,MHe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,zr(this,RHe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,zr(this,BHe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,zr(this,LHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),zr(this,Ooe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,zr(this,NHe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),zr(this,FHe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,zr(this,vV))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,zr(this,vV))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,zr(this,Ooe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),zr(this,zHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,zr(this,HHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,u(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,u(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){u(e)?typeof e=="string"?this.setImage(e,e):e instanceof we?this.setImage(e.url,e):u(e.src)?this.setImage(e.src,e):this.setImage(jn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,zr(this,vV))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),zr(this,SV)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,zr(this,Poe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),zr(this,Moe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,zr(this,Moe))}}});Si.prototype.getPickId=function(e){return u(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Si.prototype._updateClamping=function(){Si._updateClamping(this._billboardCollection,this)};var EM=new he,Roe=new m;Si._updateClamping=function(e,t){let n=e._scene;if(!u(n)||!u(n.globe))return;let i=n.globe,r=i.ellipsoid,o=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===je.NONE||a)&&u(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===je.NONE||!u(t._position))return;let c=r.cartesianToCartographic(t._position);if(!u(c)){t._actualClampedPosition=void 0;return}u(t._removeCallbackFunc)&&t._removeCallbackFunc();function l(d){if(t._heightReference===je.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=r.cartesianToCartographic(d,EM);p.height+=c.height,r.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=o.updateHeight(c,l),he.clone(c,EM);let f=i.getHeight(c);u(f)&&(EM.height=f),r.cartographicToCartesian(EM,Roe),l(Roe)};Si.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,r,o=this;function s(a){if(o._imageId!==t||o._image!==n||!Ye.equals(o._imageSubRegion,i))return;let c=e.textureCoordinates[a];o._imageWidth=e.texture.width*c.width,o._imageHeight=e.texture.height*c.height,o._imageIndex=a,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,zr(o,vV)}if(u(n)){let a=e.getImageIndex(t);if(u(a)){s(a);return}r=e.addImage(t,n)}u(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,u(r)&&r.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),o._imageIndexPromise=void 0})};Si.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,u(this._billboardCollection._textureAtlas)&&this._loadImage())};Si.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ye.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ye.clone(t),u(this._billboardCollection._textureAtlas)&&this._loadImage())};Si.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),zr(this,Loe))};Si.prototype._getActualPosition=function(){return u(this._clampedPosition)?this._clampedPosition:this._actualPosition};Si.prototype._setActualPosition=function(e){u(this._clampedPosition)||m.clone(e,this._actualPosition),zr(this,SV)};var Boe=new oe;Si._computeActualPosition=function(e,t,n,i){return u(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(N.multiplyByPoint(i,t,Boe),$i.computeActualWgs84Position(n,Boe))};var Noe=new m;Si._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,Noe),a=$i.wgs84WithEyeOffsetToWindowCoordinates(r,s,n,o);if(u(a))return H.add(a,i,a),a};var bV=new H(0,0);Si.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;u(t)||(t=new H),H.clone(this._pixelOffset,bV),H.add(bV,this._translate,bV);let i=n.modelMatrix,r=this._position;if(u(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,EM);r=a.cartographicToCartesian(c,Noe),i=N.IDENTITY}return Si._computeScreenSpacePosition(i,r,this._eyeOffset,bV,e,t)};Si.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?a-=r:e.verticalOrigin===On.CENTER&&(a-=r*.5),u(n)||(n=new Ye),n.x=s,n.y=a,n.width=i,n.height=r,n};Si.prototype.equals=function(e){return this===e||u(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ye.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Si.prototype._destroy=function(){u(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),u(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var gr=Si;var GHe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Dr=Object.freeze(GHe);var WHe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Rs=Object.freeze(WHe);function jp(e,t,n,i,r){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}var jHe=new H(16,16);function Yg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,jHe);this._context=e.context,this._pixelFormat=y(e.pixelFormat,at.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=jn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Yg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return u(this._texture)||(this._texture=new Rt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function qHe(e,t){let n=e._context,i=e.numberOfImages,r=2,o=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=r*(s+t.width+o),l=r*(a+t.height+o),f=s/c,d=a/l,p=new jp(new H(s+o,o),new H(c,a)),g=new jp(new H,new H(c,a),e._root,p),h=new jp(new H(o,a+o),new H(c,l)),A=new jp(new H,new H(c,l),g,h);for(let T=0;T<e._textureCoordinates.length;T++){let E=e._textureCoordinates[T];u(E)&&(E.x*=f,E.y*=d,E.width*=f,E.height*=d)}let x=new Rt({context:e._context,width:c,height:l,pixelFormat:e._pixelFormat}),C=new Ys({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),x.copyFromFramebuffer(0,0,0,0,c,l),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=x,e._root=A}else{let s=r*(t.width+2*o),a=r*(t.height+2*o);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Rt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new jp(new H(o,o),new H(s,a))}}function wV(e,t,n){if(u(t)){if(!u(t.childNode1)&&!u(t.childNode2)){if(u(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,r=t.topRight.y-t.bottomLeft.y,o=i-n.width,s=r-n.height;if(o<0||s<0)return;if(o===0&&s===0)return t;if(o>s){t.childNode1=new jp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new jp(new H(a,t.bottomLeft.y),new H(t.topRight.x,t.topRight.y)))}else{t.childNode1=new jp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new jp(new H(t.bottomLeft.x,a),new H(t.topRight.x,t.topRight.y)))}return wV(e,t.childNode1,n)}return wV(e,t.childNode1,n)||wV(e,t.childNode2,n)}}function Foe(e,t,n){let i=wV(e,e._root,t);if(u(i)){i.imageIndex=n;let r=e._texture.width,o=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/r,l=i.bottomLeft.y/o,f=s/r,d=a/o;e._textureCoordinates[n]=new Ye(c,l,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else qHe(e,t),Foe(e,t,n);e._guid=jn()}function Uoe(e,t){if(!u(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return Foe(e,t,n),n}Yg.prototype.getImageIndex=function(e){return this._indexHash[e]};Yg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return u(n)||(n=Uoe(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};Yg.prototype.addImage=function(e,t){let n=this._idHash[e];if(u(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof we)&&(t=we.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(r){let o=Uoe(i,r);return i._indexHash[e]=o,o}),this._idHash[e]=n,n};Yg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!u(n))throw new de(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(r){if(r===-1)return-1;let o=i._texture.width,s=i._texture.height,a=i._textureCoordinates[r],c=a.x+t.x/o,l=a.y+t.y/s,f=t.width/o,d=t.height/s,p=i._textureCoordinates.push(new Ye(c,l,f,d))-1;return i._indexHash[e]=p,i._guid=jn(),p})};Yg.prototype.isDestroyed=function(){return!1};Yg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Xg=Yg;var YHe=gr.SHOW_INDEX,SM=gr.POSITION_INDEX,Voe=gr.PIXEL_OFFSET_INDEX,koe=gr.EYE_OFFSET_INDEX,XHe=gr.HORIZONTAL_ORIGIN_INDEX,KHe=gr.VERTICAL_ORIGIN_INDEX,JHe=gr.SCALE_INDEX,bM=gr.IMAGE_INDEX_INDEX,zoe=gr.COLOR_INDEX,ZHe=gr.ROTATION_INDEX,QHe=gr.ALIGNED_AXIS_INDEX,Hoe=gr.SCALE_BY_DISTANCE_INDEX,Goe=gr.TRANSLUCENCY_BY_DISTANCE_INDEX,Woe=gr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,joe=gr.DISTANCE_DISPLAY_CONDITION,$He=gr.DISABLE_DEPTH_DISTANCE,eGe=gr.TEXTURE_COORDINATE_BOUNDS,qoe=gr.SDF_INDEX,Z6=gr.NUMBER_OF_PROPERTIES,vr,tGe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},nGe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function ff(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(Z6),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Dr.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;u(n)&&u(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)u(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(ff.prototype,{length:{get:function(){return Q6(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Yoe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ff.prototype.add=function(e){let t=new gr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};ff.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ff.prototype.removeAll=function(){Yoe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Q6(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];u(s)&&(s._index=o++,t.push(s))}e._billboards=t}}ff.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};ff.prototype.contains=function(e){return u(e)&&e._billboardCollection===this};ff.prototype.get=function(e){return Q6(this),this._billboards[e]};var j6;function iGe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(u(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s+0,r[o+4]=s+2,r[o+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function rGe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return u(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function oGe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return u(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}ff.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Z6;++i){let r=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function sGe(e,t,n,i,r,o){let s=[{index:vr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[SM]},{index:vr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[SM]},{index:vr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Voe]},{index:vr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Goe]},{index:vr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[zoe]},{index:vr.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[koe]},{index:vr.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Hoe]},{index:vr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Woe]},{index:vr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[joe]},{index:vr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[eGe]}];i&&s.push({index:vr.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:oGe(e)}),u(r)&&s.push({index:vr.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Ne.STATIC_DRAW}),o&&s.push({index:vr.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[qoe]});let a=i?t:4*t;return new ap(e,s,a,i)}var q6=new qn;function Xoe(e,t,n,i,r){let o,s=i[vr.positionHighAndScale],a=i[vr.positionLowAndRotation],c=r._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),qn.fromCartesian(c,q6);let l=r.scale,f=r.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let d=q6.high,p=q6.low;e._instanced?(o=r._index,s(o,d.x,d.y,d.z,l),a(o,p.x,p.y,p.z,f)):(o=r._index*4,s(o+0,d.x,d.y,d.z,l),s(o+1,d.x,d.y,d.z,l),s(o+2,d.x,d.y,d.z,l),s(o+3,d.x,d.y,d.z,l),a(o+0,p.x,p.y,p.z,f),a(o+1,p.x,p.y,p.z,f),a(o+2,p.x,p.y,p.z,f),a(o+3,p.x,p.y,p.z,f))}var uf=new H,lf=32768,mE=65536,Y6=4096,eh=256,aGe=128,cGe=32,lGe=8,Koe=4,uGe=1/256,Joe=0,Zoe=2,Qoe=3,$oe=1;function ese(e,t,n,i,r){let o,s=i[vr.compressedAttribute0],a=r.pixelOffset,c=a.x,l=a.y,f=r._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-l+p));let g=r.horizontalOrigin,h=r._verticalOrigin,A=r.show&&r.clusterShow;r.color.alpha===0&&(A=!1),h===On.BASELINE&&(h=On.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&h===On.CENTER;let x=0,C=0,T=0,E=0,S=r._imageIndex;if(S!==-1){let k=n[S];x=k.x,C=k.y,T=k.width,E=k.height}let w=x+T,D=C+E,M=Math.floor(P.clamp(c,-lf,lf)+lf)*aGe;M+=(g+1)*cGe,M+=(h+1)*lGe,M+=(A?1:0)*Koe;let O=Math.floor(P.clamp(l,-lf,lf)+lf)*eh,B=Math.floor(P.clamp(d,-lf,lf)+lf)*eh,L=(P.clamp(p,-lf,lf)+lf)*uGe,_=Math.floor(L),b=Math.floor((L-_)*eh);O+=_,B+=b,uf.x=x,uf.y=C;let v=Yn.compressTextureCoordinates(uf);uf.x=w;let I=Yn.compressTextureCoordinates(uf);uf.y=D;let R=Yn.compressTextureCoordinates(uf);uf.x=x;let F=Yn.compressTextureCoordinates(uf);e._instanced?(o=r._index,s(o,M,O,B,v)):(o=r._index*4,s(o+0,M+Joe,O,B,v),s(o+1,M+Zoe,O,B,I),s(o+2,M+Qoe,O,B,R),s(o+3,M+$oe,O,B,F))}function tse(e,t,n,i,r){let o,s=i[vr.compressedAttribute1],a=r.alignedAxis;m.equals(a,m.ZERO)||(e._shaderAlignedAxis=!0);let c=0,l=1,f=1,d=1,p=r.translucencyByDistance;u(p)&&(c=p.near,l=p.nearValue,f=p.far,d=p.farValue,(l!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,h=r._imageIndex;h!==-1&&(g=n[h].width);let A=e._textureAtlas.texture.width,x=Math.round(y(r.width,A*g));e._maxSize=Math.max(e._maxSize,x);let C=P.clamp(x,0,mE),T=0;Math.abs(m.magnitudeSquared(a)-1)<P.EPSILON6&&(T=Yn.octEncodeFloat(a)),l=P.clamp(l,0,1),l=l===1?255:l*255|0,C=C*eh+l,d=P.clamp(d,0,1),d=d===1?255:d*255|0,T=T*eh+d,e._instanced?(o=r._index,s(o,C,T,c,f)):(o=r._index*4,s(o+0,C,T,c,f),s(o+1,C,T,c,f),s(o+2,C,T,c,f),s(o+3,C,T,c,f))}function K6(e,t,n,i,r){let o,s=i[vr.compressedAttribute2],a=r.color,c=u(e._batchTable)?z.WHITE:r.getPickId(t.context).color,l=r.sizeInMeters?1:0,f=Math.abs(m.magnitudeSquared(r.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let d=0,p=r._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,h=Math.round(y(r.height,g.y*d));e._maxSize=Math.max(e._maxSize,h);let A=y(r._labelHorizontalOrigin,-2);A+=2;let x=h*Koe+A,C=z.floatToByte(a.red),T=z.floatToByte(a.green),E=z.floatToByte(a.blue),S=C*mE+T*eh+E;C=z.floatToByte(c.red),T=z.floatToByte(c.green),E=z.floatToByte(c.blue);let w=C*mE+T*eh+E,D=z.floatToByte(a.alpha)*mE+z.floatToByte(c.alpha)*eh;D+=l*2+f,e._instanced?(o=r._index,s(o,S,w,D,x)):(o=r._index*4,s(o+0,S,w,D,x),s(o+1,S,w,D,x),s(o+2,S,w,D,x),s(o+3,S,w,D,x))}function J6(e,t,n,i,r){let o,s=i[vr.eyeOffset],a=r.eyeOffset,c=a.z;if(r._heightReference!==je.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let l=0,f=0,d=r._imageIndex;if(d!==-1){let g=n[d];l=g.width,f=g.height}uf.x=l,uf.y=f;let p=Yn.compressTextureCoordinates(uf);o=r._index,s(o,a.x,a.y,c,p)}else o=r._index*4,s(o+0,a.x,a.y,c,0),s(o+1,a.x,a.y,c,0),s(o+2,a.x,a.y,c,0),s(o+3,a.x,a.y,c,0)}function nse(e,t,n,i,r){let o,s=i[vr.scaleByDistance],a=0,c=1,l=1,f=1,d=r.scaleByDistance;u(d)&&(a=d.near,c=d.nearValue,l=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,l,f)):(o=r._index*4,s(o+0,a,c,l,f),s(o+1,a,c,l,f),s(o+2,a,c,l,f),s(o+3,a,c,l,f))}function ise(e,t,n,i,r){let o,s=i[vr.pixelOffsetScaleByDistance],a=0,c=1,l=1,f=1,d=r.pixelOffsetScaleByDistance;u(d)&&(a=d.near,c=d.nearValue,l=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,l,f)):(o=r._index*4,s(o+0,a,c,l,f),s(o+1,a,c,l,f),s(o+2,a,c,l,f),s(o+3,a,c,l,f))}function rse(e,t,n,i,r){let o,s=i[vr.compressedAttribute3],a=0,c=Number.MAX_VALUE,l=r.distanceDisplayCondition;u(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=r.disableDepthTestDistance,d=r.heightReference===je.CLAMP_TO_GROUND&&t.context.depthTexture;u(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(u(r._labelDimensions))g=r._labelDimensions.x,p=r._labelDimensions.y;else{let C=0,T=0,E=r._imageIndex;if(E!==-1){let w=n[E];C=w.height,T=w.width}p=Math.round(y(r.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(r.width,S*T))}let h=Math.floor(P.clamp(g,0,Y6)),A=Math.floor(P.clamp(p,0,Y6)),x=h*Y6+A;e._instanced?(o=r._index,s(o,a,c,f,x)):(o=r._index*4,s(o+0,a,c,f,x),s(o+1,a,c,f,x),s(o+2,a,c,f,x),s(o+3,a,c,f,x))}function ose(e,t,n,i,r){if(r.heightReference===je.CLAMP_TO_GROUND){let h=e._scene,A=t.context,x=t.globeTranslucencyState.translucent,C=u(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=A.depthTexture&&!x&&C}let o,s=i[vr.textureCoordinateBoundsOrLabelTranslate];if(Ht.maximumVertexTextureImageUnits>0){let h=0,A=0;u(r._labelTranslate)&&(h=r._labelTranslate.x,A=r._labelTranslate.y),e._instanced?(o=r._index,s(o,h,A,0,0)):(o=r._index*4,s(o+0,h,A,0,0),s(o+1,h,A,0,0),s(o+2,h,A,0,0),s(o+3,h,A,0,0));return}let a=0,c=0,l=0,f=0,d=r._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,l=h.width,f=h.height}let p=a+l,g=c+f;e._instanced?(o=r._index,s(o,a,c,p,g)):(o=r._index*4,s(o+0,a,c,p,g),s(o+1,a,c,p,g),s(o+2,a,c,p,g),s(o+3,a,c,p,g))}function fGe(e,t,n,i,r){if(!u(e._batchTable))return;let o=i[vr.a_batchId],s=r._batchIndex,a;e._instanced?(a=r._index,o(a,s)):(a=r._index*4,o(a+0,s),o(a+1,s),o(a+2,s),o(a+3,s))}function sse(e,t,n,i,r){if(!e._sdf)return;let o,s=i[vr.sdf],a=r.outlineColor,c=r.outlineWidth,l=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=l*mE+f*eh+d,g=c/Rs.RADIUS,h=z.floatToByte(a.alpha)*mE+z.floatToByte(g)*eh;e._instanced?(o=r._index,s(o,p,h)):(o=r._index*4,s(o+0,p+Joe,h),s(o+1,p+Zoe,h),s(o+2,p+Qoe,h),s(o+3,p+$oe,h))}function dGe(e,t,n,i,r){Xoe(e,t,n,i,r),ese(e,t,n,i,r),tse(e,t,n,i,r),K6(e,t,n,i,r),J6(e,t,n,i,r),nse(e,t,n,i,r),ise(e,t,n,i,r),rse(e,t,n,i,r),ose(e,t,n,i,r),fGe(e,t,n,i,r),sse(e,t,n,i,r)}function X6(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let l=t[c],f=l.position,d=gr._computeActualPosition(l,f,i,r);u(d)&&(l._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function mGe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&X6(e,i,i.length,t,o,!0)):n===ne.MORPHING?X6(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&X6(e,r,e._billboardsToUpdateIndex,t,o,!1)}function hGe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function pGe(e,t){let n=`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=ve.OVERLAY,i}var _Ge=[];ff.prototype.update=function(e){if(Q6(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,vr=this._instanced?nGe:tGe,j6=this._instanced?rGe:iGe;let r=this._textureAtlas;if(!u(r)){r=this._textureAtlas=new Xg({context:i});for(let O=0;O<n;++O)t[O]._loadImage()}let o=r.textureCoordinates;if(o.length===0)return;mGe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,l=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==l;this._textureAtlasGUID=l;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let O=0;O<Z6;++O)c[O]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=sGe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let O=0;O<n;++O){let B=this._billboards[O];B._dirty=!1,dGe(this,e,o,d,B)}this._vaf.commit(j6(i))}this._billboardsToUpdateIndex=0}else if(a>0){let O=_Ge;O.length=0,(c[SM]||c[ZHe]||c[JHe])&&O.push(Xoe),(c[bM]||c[Voe]||c[XHe]||c[KHe]||c[YHe])&&(O.push(ese),this._instanced&&O.push(J6)),(c[bM]||c[QHe]||c[Goe])&&(O.push(tse),O.push(K6)),(c[bM]||c[zoe])&&O.push(K6),c[koe]&&O.push(J6),c[Hoe]&&O.push(nse),c[Woe]&&O.push(ise),(c[joe]||c[$He]||c[bM]||c[SM])&&O.push(rse),(c[bM]||c[SM])&&O.push(ose),c[qoe]&&O.push(sse);let B=O.length;if(d=this._vaf.writers,a/n>.1){for(let L=0;L<a;++L){let _=s[L];_._dirty=!1;for(let b=0;b<B;++b)O[b](this,e,o,d,_)}this._vaf.commit(j6(i))}else{for(let L=0;L<a;++L){let _=s[L];_._dirty=!1;for(let b=0;b<B;++b)O[b](this,e,o,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!u(this._vaf)||!u(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,A=N.IDENTITY;e.mode===ne.SCENE3D?(A=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),hGe(this,e,h);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===Dr.OPAQUE||this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let O=this._blendOption===Dr.TRANSLUCENT;this._blendOption===Dr.TRANSLUCENT||this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:O?te.LEQUAL:te.LESS},depthMask:O,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,T,E,S,w,D=Ht.maximumVertexTextureImageUnits>0;if(x||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=TM,T=CM,w=[],u(this._batchTable)&&(w.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),E=new ke({defines:w,sources:[C]}),this._instanced&&E.defines.push("INSTANCED"),this._shaderRotation&&E.defines.push("ROTATION"),this._shaderAlignedAxis&&E.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&E.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&E.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&E.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&E.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&E.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK"));let O=1-Rs.CUTOFF;this._sdf&&E.defines.push("SDF");let B=u(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT&&(S=new ke({defines:["OPAQUE",B],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Kt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:vr}),S=new ke({defines:["TRANSLUCENT",B],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Kt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:vr})),this._blendOption===Dr.OPAQUE&&(S=new ke({defines:[B],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Kt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:vr})),this._blendOption===Dr.TRANSLUCENT&&(S=new ke({defines:[B],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Kt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:vr})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let M=e.commandList;if(p.render||p.pick){let O=this._colorCommands,B=this._blendOption===Dr.OPAQUE,L=this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,b=_.length,v=this._uniforms,I;u(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),I=this._batchTable.getPickId()):I="v_pickColor",O.length=b;let R=L?b*2:b;for(let F=0;F<R;++F){let k=O[F];u(k)||(k=O[F]=new et);let V=B||L&&F%2===0;k.pass=V||!L?ve.OPAQUE:ve.TRANSLUCENT,k.owner=this;let G=L?Math.floor(F/2):F;k.boundingVolume=h,k.modelMatrix=A,k.count=_[G].indicesCount,k.shaderProgram=V?this._sp:this._spTranslucent,k.uniformMap=v,k.vertexArray=_[G].va,k.renderState=V?this._rsOpaque:this._rsTranslucent,k.debugShowBoundingVolume=this.debugShowBoundingVolume,k.pickId=I,this._instanced&&(k.count=6,k.instanceCount=n),M.push(k)}this.debugShowTextureAtlas&&(u(this.debugCommand)||(this.debugCommand=pGe(this,e.context)),M.push(this.debugCommand))}};ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){return u(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Yoe(this._billboards),ue(this)};var lu=ff;function gGe(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var WA=gGe;function ta(e,t,n,i,r){this._content=e,this._billboard=n,this._label=i,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),hE(this)}var yGe=new he;Object.defineProperties(ta.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),hE(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,hE(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),hE(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,hE(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){u(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,yGe);i.height=i.height-t+e;let r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&hE(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ta.defaultColor=z.WHITE;ta.defaultPointOutlineColor=z.BLACK;ta.defaultPointOutlineWidth=0;ta.defaultPointSize=8;function hE(e){let t=e._billboard;if(u(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(u(e._billboardImage))return;let n=y(e._color,ta.defaultColor),i=y(e._pointOutlineColor,ta.defaultPointOutlineColor),r=y(e._pointOutlineWidth,ta.defaultPointOutlineWidth),o=y(e._pointSize,ta.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,l=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===l)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,WA(f,d,p,r,o))}ta.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ta.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ta.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ta.prototype.getPropertyInherited=function(e){return Is.getPropertyInherited(this._content,this._batchId,e)};ta.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ta.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ta.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ta.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var qp=ta;function AGe(e,t,n,i,r){let o=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),l=100,f=o.width+l|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,l/2,p)),r&&(g.fillStyle="black",g.fillText(t,l/2,p));let h=g.getImageData(0,0,f,d).data,A=h.length,x=f*4,C,T,E,S;for(C=0;C<A;++C)if(h[C]!==255){E=C/x|0;break}for(C=A-1;C>=0;--C)if(h[C]!==255){S=C/x|0;break}let w=-1;for(C=0;C<f&&w===-1;++C)for(T=0;T<d;++T){let D=C*4+T*x;if(h[D]!==255||h[D+1]!==255||h[D+2]!==255||h[D+3]!==255){w=C;break}}return{width:o.width,height:S-E,ascent:p-E,descent:S-p,minx:w-l/2}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}var jA;function xGe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),r=y(t.fill,!0),o=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,l=document.createElement("canvas");l.width=1,l.height=1,l.style.font=n;let f=l.getContext("2d",{willReadFrequently:!0});u(jA)||(u(f.imageSmoothingEnabled)?jA="imageSmoothingEnabled":u(f.mozImageSmoothingEnabled)?jA="mozImageSmoothingEnabled":u(f.webkitImageSmoothingEnabled)?jA="webkitImageSmoothingEnabled":u(f.msImageSmoothingEnabled)&&(jA="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[jA]=!1,l.style.visibility="hidden",document.body.appendChild(l);let d=AGe(f,e,n,i,r);l.dimensions=d,document.body.removeChild(l),l.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,h=d.height+c,A=h-d.ascent+a,x=h-A+c;if(l.width=g,l.height=h,f.font=n,f.lineJoin="round",f.lineWidth=o,f[jA]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,l.width,l.height)),i){let C=y(t.strokeColor,z.BLACK);f.strokeStyle=C.toCssColorString(),f.strokeText(e,p+a,x)}if(r){let C=y(t.fillColor,z.WHITE);f.fillStyle=C.toCssColorString(),f.fillText(e,p+a,x)}return l}var qA=xGe;var Ase=Ki(dse(),1);var bGe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Hr=Object.freeze(bGe);var mse={},hse=0,SGe=256,vGe=new z(.165,.165,.165,.8),wGe=new H(7,5),is=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function YA(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function wM(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function DM(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function _se(e){let t=mse[e._font];if(!u(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(DM(n,"line-height"));isNaN(i)&&(i=void 0),t={family:DM(n,"font-family"),size:DM(n,"font-size").replace("px",""),style:DM(n,"font-style"),weight:DM(n,"font-weight"),lineHeight:i},document.body.removeChild(n),hse<SGe&&(mse[e._font]=t,hse++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Yp(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;u(n)&&(n=Bt.clone(n)),u(i)&&(i=Bt.clone(i)),u(r)&&(r=Bt.clone(r)),u(o)&&(o=wt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,vGe)),this._backgroundPadding=H.clone(y(e.backgroundPadding,wGe)),this._style=y(e.style,Hr.FILL),this._verticalOrigin=y(e.verticalOrigin,On.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,gi.LEFT),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._position=m.clone(y(e.position,m.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=y(e.heightReference,je.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,_se(this),this._updateClamping()}Object.defineProperties(Yp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;u(o)&&(o.show=e)}let n=this._backgroundBillboard;u(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;u(s)&&(s.position=e)}let i=this._backgroundBillboard;u(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;u(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;u(n)&&(n.heightReference=e),wM(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=Yp.enableRightToLeftDetection?RGe(t):t,YA(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,YA(this),_se(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),YA(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),YA(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,YA(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,YA(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;u(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;H.equals(t,e)||(H.clone(e,t),wM(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,YA(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!H.equals(t,e)){H.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];u(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;u(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];u(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;u(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];u(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;u(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];u(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;u(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];u(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;u(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wM(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;u(n)&&(n.verticalOrigin=e),wM(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;u(n)&&(n.scale=e*this._relativeSize),wM(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!wt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;u(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;u(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;u(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!u(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;u(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];u(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;u(n)&&(n.clusterShow=e)}}}});Yp.prototype._updateClamping=function(){gr._updateClamping(this._labelCollection,this)};Yp.prototype.computeScreenSpacePosition=function(e,t){u(t)||(t=new H);let i=this._labelCollection.modelMatrix,r=u(this._actualClampedPosition)?this._actualClampedPosition:this._position;return gr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Yp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,r=0,o=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(u(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?r-=s:e.verticalOrigin===On.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let l=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let h=d[g],A=h.billboard;if(!u(A))continue;let x=t.x+A._translate.x,C=t.y-A._translate.y,T=h.dimensions.width*a,E=h.dimensions.height*a;e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?C-=E:e.verticalOrigin===On.CENTER&&(C-=E*.5),e._verticalOrigin===On.TOP?C+=Rs.PADDING*a:(e._verticalOrigin===On.BOTTOM||e._verticalOrigin===On.BASELINE)&&(C-=Rs.PADDING*a),i=Math.min(i,x),r=Math.min(r,C),l=Math.max(l,x+T),f=Math.max(f,C+E)}o=l-i,s=f-r}return u(n)||(n=new Ye),n.x=i,n.y=r,n.width=o,n.height=s,n};Yp.prototype.equals=function(e){return this===e||u(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&H.equals(this._backgroundPadding,e._backgroundPadding)&&H.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Yp.prototype.isDestroyed=function(){return!1};Yp.enableRightToLeftDetection=!1;function DGe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=is.LTR,a="",c=e.length;for(let l=0;l<c;++l){let f=e.charAt(l);t.test(f)?a=is.RTL:n.test(f)?a=is.LTR:i.test(f)?a=is.BRACKETS:a=is.WEAK,l===0&&(s=a),s===a&&a!==is.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function IGe(e){return e.split("").reverse().join("")}function IM(e,t,n){return e.slice(0,t)+n+e.slice(t)}function PGe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var OGe="\u05D0-\u05EA",MGe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",pse=new RegExp(`[${OGe}${MGe}]`);function RGe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=pse.test(r.charAt(0)),s=DGe(r,pse),a=0,c="";for(let l=0;l<s.length;++l){let f=s[l],d=f.Type===is.BRACKETS?PGe(f.Word):IGe(f.Word);o?f.Type===is.RTL?(c=d+c,a=0):f.Type===is.LTR?(c=IM(c,a,f.Word),a+=f.Word.length):(f.Type===is.WEAK||f.Type===is.BRACKETS)&&(f.Type===is.WEAK&&s[l-1].Type===is.BRACKETS?c=d+c:s[l-1].Type===is.RTL?(c=d+c,a=0):s.length>l+1?s[l+1].Type===is.RTL?(c=d+c,a=0):(c=IM(c,a,f.Word),a+=f.Word.length):c=IM(c,0,d)):f.Type===is.RTL?c=IM(c,a,d):f.Type===is.LTR?(c+=f.Word,a=c.length):(f.Type===is.WEAK||f.Type===is.BRACKETS)&&(l>0&&s[l-1].Type===is.RTL?s.length>l+1?s[l+1].Type===is.RTL?c=IM(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var Kg=Yp;var xse=Ki(gse(),1);function LGe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function NGe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var FGe=1.2,Cse="ID_WHITE_PIXEL",$6=new H(4,4),UGe=new Ye(1,1,1,1);function VGe(e){let t=document.createElement("canvas");t.width=$6.x,t.height=$6.y;let n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Cse,t)}var df={};function kGe(e,t,n,i,r,o,s){return df.font=t,df.fillColor=n,df.strokeColor=i,df.strokeWidth=r,df.padding=Rs.PADDING,s===On.CENTER?df.textBaseline="middle":s===On.TOP?df.textBaseline="top":df.textBaseline="bottom",df.fill=o===Hr.FILL||o===Hr.FILL_AND_OUTLINE,df.stroke=o===Hr.OUTLINE||o===Hr.FILL_AND_OUTLINE,df.backgroundColor=z.BLACK,qA(e,df)}function e9(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;u(n)&&(n.show=!1,n.image=void 0,u(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function zGe(e,t,n,i){i.index=e.addImageSync(t,n)}var HGe=new xse.default;function GGe(e,t){let n=t._renderedText,i=HGe.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length,a,c,l;if(t._relativeSize=t._fontSize/Rs.FONT_SIZE,r<s)for(c=r;c<s;++c)e9(e,o[c]);o.length=r;let f=t._showBackground&&n.split(` -`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(u(d)||(d=p.add({collection:e,image:Cse,imageSubRegion:UGe}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=gi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):u(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(l=0;l<r;++l){let h=i[l],A=t._verticalOrigin,x=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+A]),C=g[x];if(!u(C)){let T=`${t._fontStyle} ${t._fontWeight} ${Rs.FONT_SIZE}px ${t._fontFamily}`,E=kGe(h,T,z.WHITE,z.WHITE,0,Hr.FILL,A);if(C=new NGe(e,-1,E.dimensions),g[x]=C,E.width>0&&E.height>0){let S=(0,Ase.default)(E,{cutoff:Rs.CUTOFF,radius:Rs.RADIUS}),w=E.getContext("2d"),D=E.width,M=E.height,O=w.getImageData(0,0,D,M);for(let B=0;B<D;B++)for(let L=0;L<M;L++){let _=L*D+B,b=S[_]*255,v=_*4;O.data[v+0]=b,O.data[v+1]=b,O.data[v+2]=b,O.data[v+3]=b}w.putImageData(O,0,0),h!==" "&&zGe(e._textureAtlas,x,E,C)}}if(a=o[l],u(a)?C.index===-1?e9(e,a):u(a.textureInfo)&&(a.textureInfo=void 0):(a=new LGe,o[l]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let T=a.billboard,E=e._spareBillboards;u(T)||(E.length>0?T=E.pop():(T=e._billboardCollection.add({collection:e}),T._labelDimensions=new H,T._labelTranslate=new H),a.billboard=T),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=gi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.image=x,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===Hr.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Hr.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Hr.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function yse(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var so=new H,WGe=new H;function jGe(e){let t=e._glyphs,n=e._renderedText,i,r,o=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,l=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(u(g)?e._backgroundPadding:H.ZERO,WGe);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` -`?(a.push(o),++f,o=0):(i=t[d],r=i.dimensions,l=Math.max(l,r.height-r.descent),c=Math.max(c,r.descent),o+=r.width-r.minx,d<p-1&&(o+=t[d+1].dimensions.minx),s=Math.max(s,o));a.push(o);let A=l+c,x=e.totalScale,C=e._horizontalOrigin,T=e._verticalOrigin,E=0,S=a[E],w=yse(S,C,h),D=(u(e._lineHeight)?e._lineHeight:FGe*e._fontSize)/e._relativeSize,M=D*(f-1),O=s,B=A+M;u(g)&&(O+=h.x*2,B+=h.y*2,g._labelHorizontalOrigin=C),so.x=w*x,so.y=0;let L=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` -`)++E,_+=D,S=a[E],w=yse(S,C,h),so.x=w*x,L=!0;else if(i=t[d],r=i.dimensions,T===On.TOP?(so.y=r.height-l-h.y,so.y+=Rs.PADDING):T===On.CENTER?so.y=(M+r.height-l)/2:T===On.BASELINE?(so.y=M,so.y-=Rs.PADDING):(so.y=M+c+h.y,so.y-=Rs.PADDING),so.y=(so.y-r.descent-_)*x,L&&(so.x-=Rs.PADDING*x,L=!1),u(i.billboard)&&(i.billboard._setTranslate(so),i.billboard._labelDimensions.x=O,i.billboard._labelDimensions.y=B,i.billboard._labelHorizontalOrigin=C),d<p-1){let b=t[d+1];so.x+=(r.width-r.minx+b.dimensions.minx)*x}if(u(g)&&n.split(` -`).join("").length>0&&(C===gi.CENTER?w=-s/2-h.x:C===gi.RIGHT?w=-(s+h.x*2):w=0,so.x=w*x,T===On.TOP?so.y=A-l-c:T===On.CENTER?so.y=(A-l)/2-c:T===On.BASELINE?so.y=-h.y-c:so.y=0,so.y=so.y*x,g.width=O,g.height=B,g._setTranslate(so),g._labelTranslate=H.clone(so,g._labelTranslate)),e.heightReference===je.CLAMP_TO_GROUND)for(d=0;d<p;++d){i=t[d];let b=i.billboard;u(b)&&(b._labelTranslate=H.clone(so,b._labelTranslate))}}function Tse(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)e9(e,n[i]);u(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,u(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function th(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new lu({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new lu({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Dr.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(th.prototype,{length:{get:function(){return this._labels.length}}});th.prototype.add=function(e){let t=new Kg(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};th.prototype.remove=function(e){if(u(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Tse(this,e),!0}return!1};th.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Tse(this,e[t]);e.length=0};th.prototype.contains=function(e){return u(e)&&e._labelCollection===this};th.prototype.get=function(e){return this._labels[e]};th.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;u(this._textureAtlas)||(this._textureAtlas=new Xg({context:i}),t.textureAtlas=this._textureAtlas),u(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Xg({context:i,initialSize:$6}),n.textureAtlas=this._backgroundTextureAtlas,VGe(this._backgroundTextureAtlas));let r=this._labelsToUpdate.length;for(let s=0;s<r;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(GGe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(jGe(a),a._repositionAllGlyphs=!1);let l=a._glyphs.length-c;this._totalGlyphCount+=l}let o=n.length>0?Dr.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};th.prototype.isDestroyed=function(){return!1};th.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var nh=th;var PM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; + vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); + #ifdef HAS_EMISSIVE_FACTOR + emissive *= u_emissiveFactor; + #endif + material.emissive = emissive; + #elif defined(HAS_EMISSIVE_FACTOR) + material.emissive = u_emissiveFactor; + #endif -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; + #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE + vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM + specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); + #endif -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; + vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); + vec3 specular = specularGlossiness.rgb; + float glossiness = specularGlossiness.a; + #ifdef HAS_SPECULAR_FACTOR + specular *= u_specularFactor; + #endif - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; + #ifdef HAS_GLOSSINESS_FACTOR + glossiness *= u_glossinessFactor; + #endif + #else + #ifdef HAS_SPECULAR_FACTOR + vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); + #else + vec3 specular = vec3(1.0); + #endif - if (width < 1.0) - { - show = 0.0; - } + #ifdef HAS_GLOSSINESS_FACTOR + float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); + #else + float glossiness = 1.0; + #endif + #endif - vec4 pickColor = batchTable_getPickColor(batchTableIndex); + #ifdef HAS_DIFFUSE_TEXTURE + vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; + #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM + diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); + #endif - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); - } + vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); + #ifdef HAS_DIFFUSE_FACTOR + diffuse *= u_diffuseFactor; + #endif + #elif defined(HAS_DIFFUSE_FACTOR) + vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); + #else + vec4 diffuse = vec4(1.0); + #endif + czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial( + diffuse.rgb, + specular, + glossiness + ); + material.diffuse = parameters.diffuseColor; + // the specular glossiness extension's alpha overrides anything set + // by the base material. + material.alpha = diffuse.a; + material.specular = parameters.f0; + material.roughness = parameters.roughness; + #elif defined(LIGHTING_PBR) + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE + vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM + metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); + #endif - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); + vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; + float metalness = clamp(metallicRoughness.b, 0.0, 1.0); + float roughness = clamp(metallicRoughness.g, 0.04, 1.0); + #ifdef HAS_METALLIC_FACTOR + metalness *= u_metallicFactor; + #endif - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - lengthSq = czm_eyeHeight2D.y; - } - else - { - vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); - lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); - } + #ifdef HAS_ROUGHNESS_FACTOR + roughness *= u_roughnessFactor; + #endif + #else + #ifdef HAS_METALLIC_FACTOR + float metalness = clamp(u_metallicFactor, 0.0, 1.0); + #else + float metalness = 1.0; + #endif - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - show = 0.0; - } + #ifdef HAS_ROUGHNESS_FACTOR + float roughness = clamp(u_roughnessFactor, 0.04, 1.0); + #else + float roughness = 1.0; + #endif + #endif + czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial( + material.diffuse, + metalness, + roughness + ); + material.diffuse = parameters.diffuseColor; + material.specular = parameters.f0; + material.roughness = parameters.roughness; #endif +} +`;var tVe=Bt.Material,z6=Bt.MetallicRoughness,H6=Bt.SpecularGlossiness,Nre={name:"MaterialPipelineStage",_processTexture:Yg,_processTextureTransform:Fre};Nre.process=function(e,t,n){let i=t.material,r=e.model,o=l(r.classificationType),s=o,a=e.uniformMap,c=e.shaderBuilder,u=n.context.defaultTexture,f=n.context.defaultNormalTexture,d=n.context.defaultEmissiveTexture;nVe(i,a,c,u,f,d,s),l(i.specularGlossiness)?iVe(i,a,c,u,s):rVe(i,a,c,u,s);let p=$t.getAttributeBySemantic(t,At.NORMAL),g=e.lightingOptions;i.unlit||!p||o?g.lightingModel=$m.UNLIT:g.lightingModel=$m.PBR;let h=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let x=e.alphaOptions;i.alphaMode===Km.BLEND?x.pass=Ee.TRANSLUCENT:i.alphaMode===Km.MASK&&(x.alphaCutoff=i.alphaCutoff),c.addFragmentLines(kR),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Te.BOTH)};function Fre(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,Te.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Te.FRAGMENT),t[s]=function(){return n.transform}}function Yg(e,t,n,i,r,o){e.addUniform("sampler2D",i,Te.FRAGMENT),t[i]=function(){return y(n.texture,o)};let s=`HAS_${r}_TEXTURE`;e.addDefine(s,void 0,Te.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${r}`;e.addDefine(u,c,Te.FRAGMENT);let f=n.transform;l(f)&&!$.equals(f,$.IDENTITY)&&Fre(e,t,n,i,r)}function nVe(e,t,n,i,r,o,s){let a=e.emissiveFactor;if(l(a)&&!m.equals(a,tVe.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",Te.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Te.FRAGMENT);let f=e.emissiveTexture;l(f)&&!s&&Yg(n,t,f,"u_emissiveTexture","EMISSIVE",o)}let c=e.normalTexture;l(c)&&!s&&Yg(n,t,c,"u_normalTexture","NORMAL",r);let u=e.occlusionTexture;l(u)&&!s&&Yg(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function iVe(e,t,n,i,r){let o=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Te.FRAGMENT);let s=o.diffuseTexture;l(s)&&!r&&Yg(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=o.diffuseFactor;l(a)&&!oe.equals(a,H6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Te.FRAGMENT),t.u_diffuseFactor=function(){return o.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Te.FRAGMENT));let c=o.specularGlossinessTexture;l(c)&&!r&&Yg(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let u=o.specularFactor;l(u)&&!m.equals(u,H6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Te.FRAGMENT),t.u_specularFactor=function(){return o.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Te.FRAGMENT));let f=o.glossinessFactor;l(f)&&f!==H6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Te.FRAGMENT),t.u_glossinessFactor=function(){return o.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Te.FRAGMENT))}function rVe(e,t,n,i,r){let o=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Te.FRAGMENT);let s=o.baseColorTexture;l(s)&&!r&&Yg(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=o.baseColorFactor;l(a)&&!oe.equals(a,z6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Te.FRAGMENT),t.u_baseColorFactor=function(){return o.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Te.FRAGMENT));let c=o.metallicRoughnessTexture;l(c)&&!r&&Yg(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=o.metallicFactor;l(u)&&u!==z6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Te.FRAGMENT),t.u_metallicFactor=function(){return o.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Te.FRAGMENT));let f=o.roughnessFactor;l(f)&&f!==z6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Te.FRAGMENT),t.u_roughnessFactor=function(){return o.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Te.FRAGMENT))}var UR=Nre;var VR=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + attributes.positionMC = getMorphedPosition(positionMC); - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = getMorphedNormal(normalMC); + #endif - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = getMorphedTangent(tangentMC); + #endif +}`;var Ea={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Ea.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Te.VERTEX),uVe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==At.POSITION&&p!==At.NORMAL&&p!==At.TANGENT||(sVe(e,d,e.attributeIndex,a),e.attributeIndex++)}}fVe(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,Te.VERTEX),n.addVertexLines(VR);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=gt(s,e.uniformMap)};var oVe={attributeString:void 0,functionId:void 0};function sVe(e,t,n,i){let r=e.shaderBuilder;aVe(e,t,n);let o=cVe(t,oVe);lVe(r,o,i)}function aVe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:cn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function cVe(e,t){switch(e.semantic){case At.POSITION:t.attributeString="Position",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_POSITION;break;case At.NORMAL:t.attributeString="Normal",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_NORMAL;break;case At.TANGENT:t.attributeString="Tangent",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function lVe(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function uVe(e){e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_POSITION,Ea.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,Te.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,Ea.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,Te.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,Ea.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,Te.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function fVe(e){let t="return morphedPosition;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var zR=Ea;var Bre={name:"PickingPipelineStage"};Bre.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)dVe(e,t,a,i);else if(l(a))mVe(e,i);else{let c=kre(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",Te.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function kre(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Ur.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function dVe(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=$t.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=$t.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",Te.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function mVe(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=kre(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let h=g.color;r[d*4+0]=z.floatToByte(h.red),r[d*4+1]=z.floatToByte(h.green),r[d*4+2]=z.floatToByte(h.blue),r[d*4+3]=z.floatToByte(h.alpha)}o._pickIds=i;let a=mt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;o.statistics.addBuffer(a,c),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,Te.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var HR=Bre;var hVe={ADD:0,REPLACE:1},Vr=Object.freeze(hVe);var GR=`float getPointSizeFromAttenuation(vec3 positionEC) { + // Variables are packed into a single vector to minimize gl.uniformXXX() calls + float pointSize = model_pointCloudParameters.x; + float geometricError = model_pointCloudParameters.y; + float depthMultiplier = model_pointCloudParameters.z; - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; + float depth = -positionEC.z; + return min((geometricError / depth) * depthMultiplier, pointSize); } -`;var Hc={};Hc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};Hc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var qGe=new he;Hc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,qGe).height}return i};var YGe=new N,XGe=new m,Ese=new m,KGe=new ln(m.UNIT_X,0),bse=new m,JGe=new ln(m.UNIT_X,0),ZGe=new m,QGe=new m,n9=[];function vse(e,t,n){let i=n9;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var PV=new he,IV=new he,Jg=new m,i9=new m,$Ge=new m,t9=new tf,OM=new xa;function e8e(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,i9),l=i.scaleToGeodeticSurface(t,$Ge),f=Hc.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,PV),p=i.cartesianToCartographic(l,IV),g=vse(f,r,o);t9.setEndPoints(d,p);let h=t9.surfaceDistance/f,A=a;d.height=r;let x=i.cartographicToCartesian(d,Jg);m.pack(x,s,A),A+=3;for(let C=1;C<f;C++){let T=t9.interpolateUsingSurfaceDistance(C*h,IV);T.height=g[C],x=i.cartographicToCartesian(T,Jg),m.pack(x,s,A),A+=3}return A}function t8e(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,PV),l=i.cartesianToCartographic(t,IV),f=Hc.numberOfPointsRhumbLine(c,l,n);c.height=0,l.height=0;let d=vse(f,r,o);OM.ellipsoid.equals(i)||(OM=new xa(void 0,void 0,i)),OM.setEndPoints(c,l);let p=OM.surfaceDistance/f,g=a;c.height=r;let h=i.cartographicToCartesian(c,Jg);m.pack(h,s,g),g+=3;for(let A=1;A<f;A++){let x=OM.interpolateUsingSurfaceDistance(A*p,IV);x.height=d[A],h=i.cartographicToCartesian(x,Jg),m.pack(h,s,g),g+=3}return g}Hc.wrapLongitude=function(e,t){let n=[],i=[];if(u(e)&&e.length>0){t=y(t,N.IDENTITY);let r=N.inverseTransformation(t,YGe),o=N.multiplyByPoint(r,m.ZERO,XGe),s=m.normalize(N.multiplyByPointAsVector(r,m.UNIT_Y,Ese),Ese),a=ln.fromPointNormal(o,s,KGe),c=m.normalize(N.multiplyByPointAsVector(r,m.UNIT_X,bse),bse),l=ln.fromPointNormal(o,c,JGe),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let h=e[g];if(ln.getPointDistance(l,d)<0||ln.getPointDistance(l,h)<0){let A=Qi.lineSegmentPlane(d,h,a,ZGe);if(u(A)){let x=m.multiplyByScalar(s,5e-9,QGe);ln.getPointDistance(a,d)<0&&m.negate(x,x),n.push(m.add(A,x,new m)),i.push(f+1),m.negate(x,x),n.push(m.add(A,x,new m)),f=1}}n.push(m.clone(e[g])),f++,d=h}i.push(f)}return{positions:n,lengths:i}};Hc.generateArc=function(e){u(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let A=i.scaleToGeodeticSurface(t[0],i9);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(A,Jg);m.multiplyByScalar(x,r,x),m.add(A,x,A)}return[A.x,A.y,A.z]}let s=e.minDistance;if(!u(s)){let A=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(A,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Hc.numberOfPoints(t[c],t[c+1],s);let l=(a+1)*3,f=new Array(l),d=0;for(c=0;c<n-1;c++){let A=t[c],x=t[c+1],C=o?r[c]:r,T=o?r[c+1]:r;d=e8e(A,x,s,i,C,T,f,d)}n9.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,PV);g.height=o?r[n-1]:r;let h=i.cartographicToCartesian(g,Jg);return m.pack(h,f,l-3),f};var Sse=new he,n8e=new he;Hc.generateRhumbArc=function(e){u(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],i9);if(r=o?r[0]:r,r!==0){let T=i.geodeticSurfaceNormal(C,Jg);m.multiplyByScalar(T,r,T),m.add(C,T,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,l=i.cartesianToCartographic(t[0],Sse),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],n8e),a+=Hc.numberOfPointsRhumbLine(l,f,s),l=he.clone(f,Sse);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let C=t[c],T=t[c+1],E=o?r[c]:r,S=o?r[c+1]:r;g=t8e(C,T,s,i,E,S,p,g)}n9.length=0;let h=t[n-1],A=i.cartesianToCartographic(h,PV);A.height=o?r[n-1]:r;let x=i.cartographicToCartesian(A,Jg);return m.pack(x,p,d-3),p};Hc.generateCartesianArc=function(e){let t=Hc.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};Hc.generateCartesianRhumbArc=function(e){let t=Hc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};var Mi=Hc;function uu(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,u(this._material)||(this._material=Wi.fromType(Wi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;u(n)||(n=[]),this._positions=n,this._actualPositions=Sr(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;u(t)&&(i=N.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Mi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Dse),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var wse=uu.POSITION_INDEX=0,i8e=uu.SHOW_INDEX=1,r8e=uu.WIDTH_INDEX=2,o8e=uu.MATERIAL_INDEX=3,MM=uu.POSITION_SIZE_INDEX=4,s8e=uu.DISTANCE_DISPLAY_CONDITION=5,Dse=uu.NUMBER_OF_PROPERTIES=6;function Xp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;u(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(uu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Xp(this,i8e))}},positions:{get:function(){return this._positions},set:function(e){let t=Sr(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Xp(this,MM),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Xp(this,wse),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Xp(this,o8e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Xp(this,r8e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Xp(this,MM)}}},id:{get:function(){return this._id},set:function(e){this._id=e,u(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!u(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Xp(this,s8e))}}});uu.prototype.update=function(){let e=N.IDENTITY;u(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[wse]>0||this._propertiesChanged[MM]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=Mi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)Xp(this,MM);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){Xp(this,MM);break}}};uu.prototype.getPickId=function(e){return u(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};uu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Dse-1;++t)e[t]=0};uu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var mf=uu;var a8e=mf.SHOW_INDEX,c8e=mf.WIDTH_INDEX,o9=mf.POSITION_INDEX,l8e=mf.MATERIAL_INDEX,Ise=mf.POSITION_SIZE_INDEX,u8e=mf.DISTANCE_DISPLAY_CONDITION,Nse=mf.NUMBER_OF_PROPERTIES,Sl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Nd(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Nse),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Nd.prototype,{length:{get:function(){return s9(this),this._polylines.length}}});Nd.prototype.add=function(e){let t=new mf(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Nd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,u(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Nd.prototype.removeAll=function(){a9(this),zse(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Nd.prototype.contains=function(e){return u(e)&&e._polylineCollection===this};Nd.prototype.get=function(e){return s9(this),this._polylines[e]};function f8e(e,t){u(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new G0(t,n,e._polylines.length)}var Fse=new qn,Use=new oe,Vse=new H;Nd.prototype.update=function(e){if(s9(this),this._polylines.length===0||!this.show)return;g8e(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ht.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");f8e(this,t),this._createBatchTable=!1}if(this._createVertexArray||m8e(this))Mse(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let l=c.length;for(let f=0;f<l;++f)i=c[f],i.update()}if(r[Ise]||r[l8e])Mse(this,t,n);else{let l=c.length,f=this._polylineBuckets;for(let d=0;d<l;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let h in f)if(f.hasOwnProperty(h)){if(f[h]===p){r[o9]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[h].lengthOfPositions}if((r[a8e]||r[c8e])&&this._batchTable.setBatchedAttribute(i._index,0,new H(i._width,i._show)),this._batchTable.attributes.length>2){if(r[o9]||r[Ise]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,A=qn.fromCartesian(h.center,Fse),x=oe.fromElements(A.low.x,A.low.y,A.low.z,h.radius,Use);this._batchTable.setBatchedAttribute(i._index,2,A.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(r[u8e]){let h=Vse;h.x=0,h.y=Number.MAX_VALUE;let A=i.distanceDisplayCondition;u(A)&&(h.x=A.near,h.y=A.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<Nse;++c)r[c]=0;let o=N.IDENTITY;e.mode===ne.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!u(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!u(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:dn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;d8e(this,e,c,o)}};var RM=new ae,Pse=new ae;function d8e(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,l=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=l.length;for(let h=0;h<g;++h){let A=l[h],x=A.buckets,C=x.length;for(let T=0;T<C;++T){let E=x[T],S=E.offset,w=E.bucket.shaderProgram,D=E.bucket.polylines,M=D.length,O,B,L=0,_,b;for(let v=0;v<M;++v){let I=D[v],R=p8e(I._material);if(R!==O){if(u(O)&&L>0){let G=B.isTranslucent();a>=s?(_=new et({owner:e}),n.push(_)):_=n[a],++a,b=_t(p(B._uniforms),e._uniformMap),_.boundingVolume=ae.clone(RM,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?ve.TRANSLUCENT:ve.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=L,_.offset=S,S+=L,L=0,c=!0,o.push(_)}B=I._material,B.update(r),O=R}let F=I._locatorBuckets,k=F.length;for(let G=0;G<k;++G){let U=F[G];U.locator===E&&(L+=U.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?u(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,Pse),V.center.x=0):u(I._boundingVolumeWC)&&u(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,Pse)),c?(c=!1,ae.clone(V,RM)):ae.union(V,RM,RM)}u(O)&&L>0&&(a>=s?(_=new et({owner:e}),n.push(_)):_=n[a],++a,b=_t(p(B._uniforms),e._uniformMap),_.boundingVolume=ae.clone(RM,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=B.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=B.isTranslucent()?ve.TRANSLUCENT:ve.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=L,_.offset=S,c=!0,o.push(_)),O=void 0}}n.length=a}Nd.prototype.isDestroyed=function(){return!1};Nd.prototype.destroy=function(){return kse(this),a9(this),zse(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function m8e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[o9]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Ose=[0,0,0];function Mse(e,t,n){e._createVertexArray=!1,a9(e),kse(e),_8e(e);let i=[[]],r=i[0],o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,l=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,A=new Float32Array(6*f*3),x=new Float32Array(f*4),C,T=0,E=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(A,x,T,E,S,o,t,n),h===ne.MORPHING&&(u(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,T));let b=g.lengthOfPositions;T+=6*b*3,E+=b*4,S+=b*4,c=g.updateIndices(i,a,l,c)}let w=e._positionBufferUsage.bufferUsage,D=Ne.STATIC_DRAW;e._positionBuffer=mt.createVertexBuffer({context:t,typedArray:A,usage:w});let M;u(C)&&(M=mt.createVertexBuffer({context:t,typedArray:C,usage:w})),e._texCoordExpandAndBatchIndexBuffer=mt.createVertexBuffer({context:t,typedArray:x,usage:D});let O=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let b=0;b<_;++b)if(r=i[b],r.length>0){let v=new Uint16Array(r),I=mt.createIndexBuffer({context:t,typedArray:v,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});L+=a[b];let R=6*(b*(O*P.SIXTY_FOUR_KILOBYTES)-L*O),F=O+R,k=O+F,V=O+k,G=O+V,U=O+G,Y=b*(B*P.SIXTY_FOUR_KILOBYTES)-L*B,W=[{index:Sl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:R,strideInBytes:6*O},{index:Sl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:Sl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:R,strideInBytes:6*O},{index:Sl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:Sl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:Sl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:Sl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:Sl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:Sl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:Sl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:Sl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:Sl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:Sl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:Y}],J,j,K,Z;h===ne.SCENE3D?(j=e._positionBuffer,J="vertexBuffer",K=Ose,Z="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(j=Ose,J="value",K=e._positionBuffer,Z="vertexBuffer"):(j=M,J="vertexBuffer",K=e._positionBuffer,Z="vertexBuffer"),W[0][J]=j,W[1][J]=j,W[2][Z]=K,W[3][Z]=K,W[4][J]=j,W[5][J]=j,W[6][Z]=K,W[7][Z]=K,W[8][J]=j,W[9][J]=j,W[10][Z]=K,W[11][Z]=K;let me=new oi({context:t,attributes:W,indexBuffer:I});e._vertexArrays.push({va:me,buckets:l[b]})}}}function h8e(e,t){return t instanceof Rt?t.id:t}var OV=[];function p8e(e){let t=Wi._uniformList[e.type],n=t.length;OV.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];OV[i]=o,OV[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(OV,h8e)}`}function _8e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,l=i[c.type];u(l)||(l=i[c.type]=new ih(c,t,n)),l.addPolyline(a)}}}function g8e(e,t){let n=t.mode;(e._mode!==n||!N.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=N.clone(e.modelMatrix),e._createVertexArray=!0)}function s9(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function a9(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;u(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function kse(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Nd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function zse(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function r9(e,t,n){this.count=e,this.offset=t,this.bucket=n}function ih(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}ih.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};ih.prototype.updateShader=function(e,t,n){if(u(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Gt.isInternetExplorer()||i.push("CLIP_POLYLINE");let r=new ke({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,eA]}),o=t.getVertexShaderCallback()(PM),s=new ke({defines:i,sources:[nu,o]});this.shaderProgram=Kt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Sl})};function Hse(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(ln.ORIGIN_ZX_PLANE)===$t.INTERSECTING}ih.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!Hse(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var ls=new m,hf=new m,pf=new m,MV=new m,y8e=new oe,A8e=new H;ih.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,l=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],h=g.width,A=g.show&&h>0,x=g._index,C=this.getSegments(g,a),T=C.positions,E=C.lengths,S=T.length,w=g.getPickId(s).color,D=0,M=0,O;for(let k=0;k<S;++k){k===0?g._loop?O=T[S-2]:(O=MV,m.subtract(T[0],T[1],O),m.add(T[0],O,O)):O=T[k-1],m.clone(O,hf),m.clone(T[k],ls),k===S-1?g._loop?O=T[1]:(O=MV,m.subtract(T[S-1],T[S-2],O),m.add(T[S-1],O,O)):O=T[k+1],m.clone(O,pf);let V=E[D];k===M+V&&(M+=V,++D);let G=k-M===0,U=k===M+E[D]-1;c===ne.SCENE2D&&(hf.z=0,ls.z=0,pf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||U)&&l-Math.abs(ls.x)<1&&((ls.x<0&&hf.x>0||ls.x>0&&hf.x<0)&&m.clone(ls,hf),(ls.x<0&&pf.x>0||ls.x>0&&pf.x<0)&&m.clone(ls,pf));let Y=G?2:0,W=U?2:4;for(let J=Y;J<W;++J){qn.writeElements(ls,e,n),qn.writeElements(hf,e,n+6),qn.writeElements(pf,e,n+12);let j=J-2<0?-1:1;t[r]=k/(S-1),t[r+1]=2*(J%2)-1,t[r+2]=j,t[r+3]=x,n+=6*3,r+=4}}let B=y8e;B.x=z.floatToByte(w.red),B.y=z.floatToByte(w.green),B.z=z.floatToByte(w.blue),B.w=z.floatToByte(w.alpha);let L=A8e;L.x=h,L.y=A?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,b=qn.fromCartesian(_.center,Fse),v=b.high,I=oe.fromElements(b.low.x,b.low.y,b.low.z,_.radius,Use),R=Vse;R.x=0,R.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;u(F)&&(R.x=F.near,R.y=F.far),o.setBatchedAttribute(x,0,L),o.setBatchedAttribute(x,1,B),o.attributes.length>2&&(o.setBatchedAttribute(x,2,v),o.setBatchedAttribute(x,3,I),o.setBatchedAttribute(x,4,R))}};var x8e=new m,C8e=new m,T8e=new m,Rse=new m;ih.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,l=a.length,f=0,d=0;for(let p=0;p<l;++p){let g;p===0?s._loop?g=a[l-2]:(g=Rse,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,C8e);let h=N.multiplyByPoint(n,a[p],x8e),A;p===l-1?s._loop?A=a[1]:(A=Rse,m.subtract(a[l-1],a[l-2],A),m.add(a[l-1],A,A)):A=a[p+1],A=N.multiplyByPoint(n,A,T8e);let x=c[f];p===d+x&&(d+=x,++f);let C=p-d===0,T=p===d+c[f]-1,E=C?2:0,S=T?2:4;for(let w=E;w<S;++w)qn.writeElements(h,e,t),qn.writeElements(g,e,t+6),qn.writeElements(A,e,t+12),t+=6*3}}};var E8e=new Array(1);ih.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new r9(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let l=this.polylines,f=l.length;for(let d=0;d<f;++d){let p=l[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=E8e;let A=p._actualPositions.length;if(A>0)g[0]=A;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let A=0;for(let x=0;x<h;++x){let C=g[x]-1;for(let T=0;T<C;++T)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:A}),A=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new r9(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),A+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:A}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new r9(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};ih.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var pE={positions:void 0,lengths:void 0},Bse=new Array(1),b8e=new m,S8e=new he;ih.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return Bse[0]=n.length,pE.positions=n,pE.lengths=Bse,pE;Hse(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=b8e;for(let l=0;l<s;++l)a=n[l],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,S8e)));if(r.length>0){e._boundingVolume2D=ae.fromPoints(r,e._boundingVolume2D);let l=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(l.z,l.x,l.y)}return pE.positions=r,pE.lengths=e._segments.lengths,pE};var Lse;ih.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Lse,c=6*s*3;!u(a)||a.length<c?a=Lse=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let l=this.getSegments(t,i),f=l.positions,d=l.lengths,p=0,g=0,h=0,A;s=f.length;for(let x=0;x<s;++x){x===0?t._loop?A=f[s-2]:(A=MV,m.subtract(f[0],f[1],A),m.add(f[0],A,A)):A=f[x-1],m.clone(A,hf),m.clone(f[x],ls),x===s-1?t._loop?A=f[1]:(A=MV,m.subtract(f[s-1],f[s-2],A),m.add(f[s-1],A,A)):A=f[x+1],m.clone(A,pf);let C=d[g];x===h+C&&(h+=C,++g);let T=x-h===0,E=x===h+d[g]-1;r===ne.SCENE2D&&(hf.z=0,ls.z=0,pf.z=0),(r===ne.SCENE2D||r===ne.MORPHING)&&(T||E)&&o-Math.abs(ls.x)<1&&((ls.x<0&&hf.x>0||ls.x>0&&hf.x<0)&&m.clone(ls,hf),(ls.x<0&&pf.x>0||ls.x>0&&pf.x<0)&&m.clone(ls,pf));let S=T?2:0,w=E?2:4;for(let D=S;D<w;++D)qn.writeElements(ls,a,p),qn.writeElements(hf,a,p+6),qn.writeElements(pf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Fd=Nd;function Zg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new lu({batchTable:e.batchTable}),this._labelCollection=new nh({batchTable:e.batchTable}),this._polylineCollection=new Fd,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Zg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function v8e(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ce.packedLength+re.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ce.pack(n,s,a),a+=ce.packedLength,re.pack(t,s,a),s}var w8e=new _i("createVectorTilePoints",5),D8e=new m;function I8e(e,t){let n=e._positions,i=e._packedBuffer;u(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=v8e(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=w8e.scheduleTask(o,r);if(u(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,l=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let h=d[g],A=m.unpack(n,g*3,D8e),x=c.add();x.position=A,x._batchIndex=h;let C=l.add();C.text=" ",C.position=A,C._batchIndex=h;let T=f.add();T.positions=[m.clone(A),m.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Zg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],l=n.get(a),f=i.get(a),d=r.get(a);t[c]=new qp(e,c,l,f,d)}};Zg.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function P8e(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=qp.defaultPointSize,s.color=qp.defaultColor,s.pointOutlineColor=qp.defaultPointOutlineColor,s.pointOutlineWidth=qp.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Hr.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new H(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=gi.CENTER,s.verticalOrigin=On.CENTER,s.labelHorizontalOrigin=gi.RIGHT,s.labelVerticalOrigin=On.BASELINE}}var O8e=new z,M8e=new z,R8e=new z,B8e=new z,L8e=new z,N8e=new z,BM=new Bt,LM=new Bt,c9=new wt;Zg.prototype.applyStyle=function(e,t){if(!u(e)){P8e(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(u(e.show)&&(s.show=e.show.evaluate(s)),u(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),u(e.color)&&(s.color=e.color.evaluateColor(s,O8e)),u(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,M8e)),u(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),u(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,R8e)),u(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,B8e)),u(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),u(e.font)&&(s.font=e.font.evaluate(s)),u(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),u(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,u(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,L8e)),u(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),u(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),u(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);u(a)?(BM.near=a.x,BM.nearValue=a.y,BM.far=a.z,BM.farValue=a.w,s.scaleByDistance=BM):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(u(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);u(a)?(LM.near=a.x,LM.nearValue=a.y,LM.far=a.z,LM.farValue=a.w,s.translucencyByDistance=LM):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(u(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);u(a)?(c9.near=a.x,c9.far=a.y,s.distanceDisplayCondition=c9):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;u(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),u(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),u(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,N8e)),u(e.image)?s.image=e.image.evaluate(s):s.image=void 0,u(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),u(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),u(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),u(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),u(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Zg.prototype.update=function(e){if(!this._ready){if(u(this._promise)||(this._promise=I8e(this,e.mapProjection.ellipsoid)),u(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Zg.prototype.isDestroyed=function(){return!1};Zg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var NM=Zg;function Kp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,m.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=zn.BOTH}Object.defineProperties(Kp.prototype,{trianglesLength:{get:function(){return u(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return u(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function F8e(e){let t=new Float64Array(3+m.packedLength+re.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,ce.pack(e._rectangle,t,n),t}function U8e(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=Mn.unpack(t,n),n+=Mn.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let l=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new jm({color:c,offset:l,count:f,batchIds:p})}}var V8e=new _i("createVectorTilePolygons",5),k8e=new z;function z8e(e){if(u(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!u(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,h=s.length;for(let A=0;A<h;++A){let x=g.getColor(A,k8e);s[A]=x.toRgba()}a=e._packedBuffer=F8e(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],l={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;u(f)&&u(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),l.minimumHeights=f,l.maximumHeights=d);let p=V8e.scheduleTask(l,c);if(u(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),A=h[0];U8e(e,h),e._indices=Fe.getSizeInBytes(A)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),H8e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function H8e(e){u(e._primitive)||(e._primitive=new AA({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Kp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Kp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Kp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Kp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Kp.prototype.update=function(e){if(!this._ready){if(u(this._promise)||(this._promise=z8e(this)),u(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var FM=Kp;var UM=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#endif -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +} +#endif - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + return getPointSizeFromAttenuation(v_positionEC); +} +#endif - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { + #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) + // This needs to be computed in eye coordinates so we can't use attributes.normalMC + return step(-v_normalEC.z, 0.0); + #else + return 1.0; + #endif } -`;function Ud(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Ud.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function G8e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var W8e=new _i("createVectorTilePolylines",5),_E={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function j8e(e,t){if(u(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;u(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=G8e(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},l=W8e.scheduleTask(c,a);if(u(l))return l.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),q8e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function q8e(e,t){if(!u(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let l=mt.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),f=mt.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),d=mt.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),h=mt.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),A=[{index:_E.previousPosition,vertexBuffer:l,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:_E.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:A,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var VM=new N,Gse=new m;function Y8e(e,t){u(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,VM),N.multiplyByPoint(VM,e._center,Gse),N.setTranslation(VM,Gse,VM),VM},u_highlightColor:function(){return e._highlightColor}})}function X8e(e){if(u(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:dn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var K8e=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; +#endif`;var pVe=new oe,Vre={name:"PointCloudStylingPipelineStage"};Vre.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let x=xVe(a),b=bVe(o,x);CVe(i,b);let A=TVe(b).indexOf("normalMC")>=0,T=$t.getAttributeBySemantic(t,At.NORMAL);if(A&&!T)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Te.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=Ee.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Te.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,Te.VERTEX);let d,p,g;Ur.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Vr.ADD),i.addUniform("vec4","model_pointCloudParameters",Te.VERTEX),i.addVertexLines(GR);let h=e.uniformMap;h.model_pointCloudParameters=function(){let x=pVe,b=1;p&&(b=g?5:d.tileset.maximumScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let C=_Ve(e,t,f,d);x.y=C*f.geometricErrorScale;let A=n.context,T=n.camera.frustum,S;return n.mode===ne.SCENE2D||T instanceof nn?S=Number.POSITIVE_INFINITY:S=A.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=d.tileset.timeSinceLoad),x}};var Ure=new m;function _Ve(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=$t.getAttributeBySemantic(t,At.POSITION),o=r.count,s=e.runtimeNode.transform,a=m.subtract(r.max,r.min,Ure);a=F.multiplyByPointAsVector(s,a,Ure);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var gVe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},yVe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function xVe(e){let t=je(yVe);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var G6="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function bVe(e,t){let n=gVe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${G6})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${G6})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${G6})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function CVe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,Te.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,Te.VERTEX),e.addVertexLines(i));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,Te.VERTEX),e.addVertexLines(r))}function W6(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function TVe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&W6(t,r),l(n)&&W6(n,r),l(i)&&W6(i,r),r}var WR=Vre;var jR=`void primitiveOutlineStage() { + v_outlineCoordinates = a_outlineCoordinates; } -`;function J8e(e,t){if(u(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(UM),r=n.getFragmentShaderCallback(!1,void 0,!1)(K8e),o=new ke({defines:["VECTOR_TILE",Gt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[nu,i]}),s=new ke({defines:["VECTOR_TILE"],sources:[r]});e._sp=Kt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:_E})}function Z8e(e,t){if(!u(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:ve.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Ud.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!u(n)||!u(i))return;let o,s,a=n.length,c=0,l=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[l++]=i[g],f[l++]=i[g+1],f[l++]=i[g+2]}}return f};Ud.prototype.getPositions=function(e){return Ud.getPolylinePositions(this,e)};Ud.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Is(e,o)}};Ud.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Q8e(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var $8e=new z,e5e=z.WHITE,t5e=!0;Ud.prototype.applyStyle=function(e,t){if(!u(e)){Q8e(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=u(e.color)?e.color.evaluateColor(s,$8e):e5e,s.show=u(e.show)?e.show.evaluate(s):t5e}};Ud.prototype.update=function(e){let t=e.context;if(!this._ready){if(u(this._promise)||(this._promise=j8e(this,t)),u(this._error)){let i=this._error;throw this._error=void 0,i}return}Y8e(this,t),J8e(this,t),X8e(this);let n=e.passes;(n.render||n.pick)&&Z8e(this,e)};Ud.prototype.isDestroyed=function(){return!1};Ud.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var XA=Ud;var kM=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; +`;var qR=`void primitiveOutlineStage(inout czm_modelMaterial material) { + if (!model_showOutline) { + return; + } -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; + float outlineX = + texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; + float outlineY = + texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; + float outlineZ = + texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; + float outlineness = max(outlineX, max(outlineY, outlineZ)); -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; + material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} -void main() +`;var zre={name:"PrimitiveOutlinePipelineStage"};zre.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Te.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:cn.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Te.FRAGMENT);let a=Lx.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Te.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Te.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(jR),i.addFragmentLines(qR)};var YR=zre;var Hre={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Gre,_count2DPositions:Wre,_countMorphTargetAttributes:jre,_countMaterialTextures:qre,_countFeatureIdTextures:Yre,_countBinaryMetadata:Xre};Hre.process=function(e,t,n){let i=e.model,r=i.statistics;Gre(r,t),Wre(r,e.runtimePrimitive),jre(r,t),qre(r,t.material),Yre(r,t.featureIds),Xre(r,i)};function Gre(e,t){let n=l(t.indices)?t.indices.count:$t.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Le.POINTS?e.pointsLength+=n:Le.isTriangles(i)&&(e.trianglesLength+=AVe(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function AVe(e,t){switch(e){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Wre(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function jre(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function qre(e,t){let n=EVe(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function EVe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Yre(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Bt.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function Xre(e,t){let n=t.structuralMetadata;l(n)&&(SVe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function SVe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var XR=Hre;var vVe=new F,wVe=new F,Kre={name:"SceneMode2DPipelineStage"};Kre.process=function(e,t,n){let i=$t.getAttributeBySemantic(t,At.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,vVe),u=DVe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let x=MVe(i,c,u,n);f.positionBuffer2D=x,o._modelResources.push(x),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,Te.VERTEX),r.addUniform("mat4","u_modelView2D",Te.VERTEX);let p=F.fromTranslation(u.center,new F),g=n.context,h={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,wVe)}};e.uniformMap=gt(h,e.uniformMap)};var IVe=new m,PVe=new m;function DVe(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,IVe),r=Qi.computeActualWgs84Position(n,i,i),o=F.multiplyByPoint(t,e.positionMax,PVe),s=Qi.computeActualWgs84Position(n,o,o);return ae.fromCornerPoints(r,s,new ae)}var Jre=new m;function RVe(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,Jre),c=m.multiplyComponents(a,o,a),u=m.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function OVe(e,t,n,i){let r;l(e.quantization)?r=RVe(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=m.fromArray(r,c,Jre);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),d=Qi.computeActualWgs84Position(i,f,f),p=m.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function MVe(e,t,n,i){let r=je(i);r.mode=ne.COLUMBUS_VIEW;let o=n.center,s=OVe(e,t,o,r),a=mt.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var KR=Kre;var JR=`void skinningStage(inout ProcessedAttributes attributes) { - // vertex corner IDs - // 3-----------7 - // /| left /| - // / | 1 / | - // 2-----------6 5 end - // | / | / - // start |/ right |/ - // 0-----------4 - // - float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end - float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - - vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; - vec3 right = normalize(cross(forward, startEllipsoidNormal)); - - vec4 position = vec4(startPositionAndHeight.xyz, 1.0); - position.xyz += forward * isEnd; + mat4 skinningMatrix = getSkinningMatrix(); + mat3 skinningMatrixMat3 = mat3(skinningMatrix); - v_volumeUpEC = czm_normal * normalize(cross(right, forward)); + vec4 positionMC = vec4(attributes.positionMC, 1.0); + attributes.positionMC = vec3(skinningMatrix * positionMC); - // Push for volume height - float offset; - vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = skinningMatrixMat3 * normalMC; + #endif - // offset height to create volume - offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); - offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; - position.xyz += offset * ellipsoidNormal; + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = skinningMatrixMat3 * tangentMC; + #endif +}`;var Vx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Vx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Te.VERTEX),NVe(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,Te.VERTEX),n.addVertexLines(JR);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=gt(o,e.uniformMap)};function LVe(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===At.JOINTS||o.semantic===At.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function NVe(e,t){e.addFunction(Vx.FUNCTION_ID_GET_SKINNING_MATRIX,Vx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,Te.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(Vx.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,r,o=["x","y","z","w"],s=LVe(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Vx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}let a="return skinnedMatrix;";e.addFunctionLines(Vx.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var ZR=Vx;var j6={};function FVe(e){let t=Be.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function BVe(e,t){let n=t.length,i=Be.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function kVe(e){let t=e-2,n=2+t*4,i=Be.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function UVe(e,t){let i=t.length-2,r=2+i*4,o=Be.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function VVe(e){let t=e-2,n=2+t*4,i=Be.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function zVe(e,t){let i=t.length-2,r=2+i*4,o=Be.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}j6.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Le.TRIANGLES)return i?BVe(t,n):FVe(t);if(e===Le.TRIANGLE_STRIP)return i?UVe(t,n):kVe(t);if(e===Le.TRIANGLE_FAN)return i?zVe(t,n):VVe(t)};j6.getWireframeIndicesCount=function(e,t){return e===Le.TRIANGLES?t*2:e===Le.TRIANGLE_STRIP||e===Le.TRIANGLE_FAN?2+(t-2)*4:t};var uA=j6;var Zre={name:"WireframePipelineStage"};Zre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,Te.FRAGMENT);let r=e.model,o=HVe(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o;let s=!1;r.statistics.addBuffer(o,s);let a=e.primitiveType,c=e.count;e.primitiveType=Le.LINES,e.count=uA.getWireframeIndicesCount(a,c)};function HVe(e,t,n){let r=$t.getAttributeBySemantic(e,At.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):Be.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=uA.createWireframeIndices(a,r,s),u=Be.fromSizeInBytes(c.BYTES_PER_ELEMENT);return mt.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var $R=Zre;function $re(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}$re.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader;if(l(r._marsOptions)&&l(r._marsOptions.customShaders)){let R=qh.getCache(r._marsOptions.customShaders);for(let L in R)if(Object.prototype.hasOwnProperty.call(R,L)){o=R[L];break}}let s=r.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=l(n.morphTargets)&&n.morphTargets.length>0,d=l(i.skin),p=l(o),h=!(p&&l(o.fragmentShaderText))||o.mode!==Gp.REPLACE_MATERIAL,x=$t.hasQuantizedAttributes(n.attributes),b=r.debugWireframe&&Le.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),C=r.pointCloudShading,A=l(C)&&C.attenuation,T=l(C)&&C.backFaceCulling,S=n.primitiveType===Le.POINTS&&(l(s)||A||T),v=r._enableShowOutline&&l(n.outlineCoordinates),I=GVe(r,i,n),O=l(r.classificationType);u&&t.push(KR),t.push(NR),b&&t.push($R),O&&t.push(xR),f&&t.push(zR),d&&t.push(ZR),S&&t.push(WR),x&&t.push(RR),h&&t.push(UR),t.push(Wg),t.push(af),I.hasPropertyTable&&(t.push(qg),t.push(yR),t.push(TR)),p&&t.push(PR),t.push(BR),r.allowPicking&&t.push(HR),v&&t.push(YR),t.push(gR),t.push(XR)};function GVe(e,t,n){let i;return l(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var QR=$re;function q6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],WVe(this)}Object.defineProperties(q6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function WVe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=Qre(f,d,new F);a.push(p)}}function Qre(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}q6.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=Qre(i,r,e[n])}};var eO=q6;function jVe(){this.pass=void 0,this.alphaCutoff=void 0}var tO=jVe;function Y6(e){this.name=e,this.fields=[]}Y6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};Y6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var nO=Y6;function X6(e){this.signature=e,this.body=[]}X6.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};X6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var iO=X6;function Vc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Vc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Vc.prototype.addDefine=function(e,t,n){n=y(n,Te.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),Te.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),Te.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Vc.prototype.addStruct=function(e,t,n){this._structs[e]=new nO(t),Te.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),Te.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Vc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Vc.prototype.addFunction=function(e,t,n){this._functions[e]=new iO(t),Te.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),Te.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Vc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Vc.prototype.addUniform=function(e,t,n){n=y(n,Te.BOTH);let i=`uniform ${e} ${t};`;Te.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),Te.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Vc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Vc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=YVe(e),i};Vc.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};Vc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Vc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Vc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=qVe(this),i=XVe(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +`),o=new ze({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` +`),a=new ze({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Jt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Vc.prototype.clone=function(){return je(this,!0)};function qVe(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function YVe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function XVe(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var zx=Vc;function KVe(e){this.shaderBuilder=new zx,this.model=e,this.uniformMap={},this.alphaOptions=new tO,this.renderStateOptions=Ue.getState(Ue.fromCache({depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var rO=KVe;var oO=`void silhouetteStage(inout vec4 color) { + if(model_silhouettePass) { + color = czm_gammaCorrect(model_silhouetteColor); + } +}`;var sO=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { + #ifdef HAS_NORMALS + if(model_silhouettePass) { + vec3 normal = normalize(czm_normal3D * attributes.normalMC); + normal.x *= czm_projection[0][0]; + normal.y *= czm_projection[1][1]; + positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; + } + #endif +} +`;var AU={name:"ModelSilhouettePipelineStage"};AU.silhouettesLength=0;AU.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++AU.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,Te.BOTH),i.addVertexLines(sO),i.addFragmentLines(oO),i.addUniform("vec4","model_silhouetteColor",Te.FRAGMENT),i.addUniform("float","model_silhouetteSize",Te.VERTEX),i.addUniform("bool","model_silhouettePass",Te.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=gt(r,e.uniformMap),e.hasSilhouette=!0};var aO=AU;var cO=`void modelSplitterStage() +{ + // Don't split when rendering the shadow map, because it is rendered from + // the perspective of a totally different camera. +#ifndef SHADOW_MAP + if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif +} +`;var EU={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};EU.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Te.FRAGMENT),i.addFragmentLines(cO);let r={};i.addUniform("float",EU.SPLIT_DIRECTION_UNIFORM_NAME,Te.FRAGMENT),r[EU.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=gt(r,e.uniformMap)};var lO=EU;function JVe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var uO=JVe;function ZVe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,$m.UNLIT)}var fO=ZVe;function $Ve(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new fO,this.pickId=void 0}var dO=$Ve;function su(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=$t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},QVe(this)}Object.defineProperties(su.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function QVe(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;eoe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let A=0;A<s;A++){let T=o[A],S=new rR({articulation:T,sceneGraph:e}),v=S.name;a[v]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=F.IDENTITY;for(let A=0;A<d;A++){let T=n.nodes[A],S=toe(e,T,p);e._rootNodes.push(S)}let g=t.skins,h=e._runtimeSkins,x=g.length;for(let A=0;A<x;A++){let T=g[A];h.push(new eO({skin:T,sceneGraph:e}))}let b=e._skinnedNodes,C=b.length;for(let A=0;A<C;A++){let T=b[A],S=e._runtimeNodes[T],I=c[T].skin.index;S._runtimeSkin=h[I],S.updateJointMatrices()}e.applyArticulations()}function eoe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var eze=new m;function tze(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,eze);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=Mt.wgs84To2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function toe(e,t,n){let i=[],r=$t.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=F.multiplyTransformation(n,r,new F),g=toe(e,d,p);i.push(g)}let s=new _R({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new QR({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new cR(f,s);f._nodesByName[u]=d}return c}var nze=new m,ize=new m,rze=new m,oze=new m;su.prototype.buildDrawCommands=function(e){let t=this._model,n=new rO(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,r,o,s;for(r=0;r<i.length;r++)i[r].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,nze),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,ize);for(r=0;r<this._runtimeNodes.length;r++){let u=this._runtimeNodes[r];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new uO(n,u);for(o=0;o<f.length;o++)f[o].process(d,u.node,e);let p=u.computedTransform;for(o=0;o<u.runtimePrimitives.length;o++){let g=u.runtimePrimitives[o];g.configurePipeline(e);let h=g.pipelineStages,x=new dO(d,g);for(s=0;s<h.length;s++)h[s].process(x,g.primitive,e);g.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=F.multiplyByPoint(p,x.positionMin,rze),C=F.multiplyByPoint(p,x.positionMax,oze);m.minimumByComponent(a,b,a),m.maximumByComponent(c,C,c);let A=QD(x,e);g.drawCommand=A}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};su.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;l(n.color)&&t.push(Gg),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(nR),n.isClippingEnabled()&&t.push(aR),n.hasSilhouette(e)&&t.push(aO),l(n.splitDirection)&&n.splitDirection!==Uc.NONE&&t.push(lO),Ur.is3DTiles(n.type)&&t.push(eR))};su.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};su.prototype.updateModelMatrix=function(e,t){eoe(this,e),t.mode!==ne.SCENE3D&&tze(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};su.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function noe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);noe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function SU(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];noe(e,c,t,n,i)}}var sze={backFaceCulling:void 0};su.prototype.updateBackFaceCulling=function(e){let t=sze;t.backFaceCulling=e,SU(this,!1,aze,t)};function aze(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var cze={shadowMode:void 0};su.prototype.updateShadows=function(e){let t=cze;t.shadowMode=e,SU(this,!1,lze,t)};function lze(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var uze={debugShowBoundingVolume:void 0};su.prototype.updateShowBoundingVolume=function(e){let t=uze;t.debugShowBoundingVolume=e,SU(this,!1,fze,t)};function fze(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var ioe=[],dze={frameState:void 0,hasSilhouette:void 0};su.prototype.pushDrawCommands=function(e){let t=ioe;t.length=0;let n=dze;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,SU(this,!0,mze,n),e.commandList.push.apply(e.commandList,t)};function mze(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=ioe,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!r.pick&&s.pushSilhouetteCommands(n,o)}su.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};su.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var mO=su;function fA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Tt}Object.defineProperties(fA.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});fA.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};fA.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};fA.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};fA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var hO=fA;var aoe=Ki(E3(),1);var roe={},Hx=Uint32Array.BYTES_PER_ELEMENT;roe.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Hx;let r=i.getUint32(t,!0);if(r!==1)throw new de(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=Hx,t+=Hx;let o=i.getUint32(t,!0);if(o===0)throw new de("Feature table must have a byte length greater than zero");t+=Hx;let s=i.getUint32(t,!0);t+=Hx;let a=i.getUint32(t,!0);t+=Hx;let c=i.getUint32(t,!0);t+=Hx;let u=Lr(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Lr(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new Rd(u,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!l(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=m.unpack(x));let b=hze(g,d);if(b.rtcCenter=x,b.pointsLength=h,!b.hasPositions){let C=pze(g);b.positions=C,b.hasPositions=b.hasPositions||l(C)}if(!b.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let C=gze(g);b.normals=C,b.hasNormals=b.hasNormals||l(C)}if(!b.hasColors){let C=_ze(g);b.colors=C,b.hasColors=b.hasColors||l(C),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(C)&&C.isTranslucent}if(!b.hasBatchIds){let C=yze(g);b.batchIds=C,b.hasBatchIds=b.hasBatchIds||l(C)}if(b.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=C}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function hze(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let h=s.byteOffset,x=s.byteLength;if(!l(r)||!l(h)||!l(x))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+x),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:gt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function pze(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65536-1,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(o))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:cn.VEC3,quantizedRange:r,quantizedVolumeOffset:m.unpack(o),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:cn.VEC3}}}function _ze(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:At.COLOR,semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:cn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:o,componentDatatype:X.FLOAT,type:cn.VEC4,isQuantized:!1,isTranslucent:s}}}function gze(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:cn.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:cn.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:cn.VEC3}}}function yze(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:At.FEATURE_ID,semantic:At.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:cn.SCALAR}}}var Gx=roe;var xze=Bt.Components,bze=Bt.Scene,Cze=Bt.Node,Tze=Bt.Primitive,Aze=Bt.Attribute,ooe=Bt.Quantization,Eze=Bt.FeatureIdAttribute,Sze=Bt.Material,vze=Bt.MetallicRoughness;function Xg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=wt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Xg.prototype=Object.create(cr.prototype),Xg.prototype.constructor=Xg);Object.defineProperties(Xg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Xg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=Gx.parse(this._arrayBuffer,this._byteOffset),this._state=wt.PROCESSING,this._promise=Promise.resolve(this)};Xg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===wt.READY)return!0;if(this._state===wt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=wze(this,e.context)}return!1};function wze(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Dp.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Ize(e,i,o),Uze(e,t),e._state=wt.READY,e}).catch(function(o){e.unload(),e._state=wt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Ize(e,t,n){e._state=wt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:At.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:cn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=m.fromElements(c,c,c),f=m.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,r.quantizedType=cn.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:At.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:cn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=X.UNSIGNED_BYTE,r.quantizedType=cn.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:cn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:At.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:cn.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Pze(u.componentsPerAttribute),componentType:Dze(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Pze(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Dze(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function pO(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new ooe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new ooe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new Aze;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=y(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=Xn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=mt.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===At.POSITION&&s&&(o.typedArray=i),o}var soe,vU;function Rze(e){if(!l(vU)){soe=new aoe.default(0),vU=new Array(e);for(let t=0;t<e;++t)vU[t]=soe.random()}return vU}var Oze=new m,Mze=new m,Lze=new m;function Nze(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Rze(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,Oze),u=m.fromElements(a,a,a,Mze),f,d,p;if(e.isQuantized)c=m.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=m.unpack(t,d*3,Lze),m.minimumByComponent(c,p,c),m.maximumByComponent(u,p,u);e.min=m.clone(c),e.max=m.clone(u)}var Fze={name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:cn.VEC4,isQuantized:!1,isTranslucent:!1};function Bze(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Nze(o),r=pO(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=pO(e,t.normals,n),i.push(r)),l(t.colors)?(r=pO(e,t.colors,n),i.push(r)):(r=pO(e,Fze,n),i.push(r)),l(t.batchIds)&&(r=pO(e,t.batchIds,n),i.push(r)),i}function kze(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableBinary,o=!l(e.batchIds);if(l(r)||e.hasDracoBatchTable){let s=y(n,i);return kp({count:s,batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t})}return new Ta({schema:{},propertyTables:[]})}function Uze(e,t){let n=e._parsedContent,i=new vze;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Sze;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Km.BLEND);let s=!l(n.normals);r.unlit=s;let a=new Tze;if(a.attributes=Bze(e,n,t),a.primitiveType=Le.POINTS,a.material=r,l(n.batchIds)){let g=new Eze;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Cze;c.index=0,c.primitives=[a];let u=new bze;u.nodes=[c],u.upAxis=hr.Z,u.forwardAxis=hr.X;let f=new xze;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=kze(n,d),d.length>0&&Vze(e,a,d,t),l(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Vze(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=mt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}Xg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var dA=Xg;function _r(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,Ur.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new WD(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Za.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,We.NONE),this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new Zm(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?us.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY),this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new dx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,bn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Ur.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new vt(a)),this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Uc.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new hO,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._texturesLoadedPromise=void 0,this._completeLoad=void 0,this._rejectLoad=void 0,this._completeTexturesLoad=void 0,this._rejectTexturesLoad=void 0,l(this._loader._promise)?(this._readyPromise=Promise.resolve(this),this._texturesLoadedPromise=Promise.resolve(this)):(this._readyPromise=new Promise((c,u)=>{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(u(f),!1)}),this._loader instanceof dA?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,u)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(u(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!l(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad($t.getError("model",this._resource,c)))})),this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function wU(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function zze(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new YD({model:e,propertyTable:s});n.push(a)}return n}function Hze(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=$t.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=$t.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function J6(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(_r.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},readyPromise:{get:function(){return Q("Model.readyPromise","Model.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.readyEvent instead."),this._readyPromise}},texturesLoadedPromise:{get:function(){return Q("Model.texturesLoadedPromise","Model.texturesLoadedPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.texturesReadyEvent instead."),this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){J6(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=J6(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return uoe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Ur.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(us.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});_r.prototype.getNode=function(e){return this._nodesByName[e]};_r.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};_r.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};_r.prototype.makeStyleDirty=function(){this._styleDirty=!0};_r.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Gze=new F,Wze=new $,jze=new F;_r.prototype.update=function(e){let t=!1;try{t=qze(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")wU(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=$t.getError("model",this._resource,n);wU(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=$t.getError("model",this._resource,n);wU(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(Xze(this,e),Yze(this,e),Kze(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let o=$t.getError("model",this._resource,new de("Failed to load model."));wU(o),this._rejectLoad=this._rejectLoad&&this._rejectLoad(o)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&zze(this,i);let r=new mO({model:this,modelComponents:n});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(Jze(this),Zze(this),$ze(this,e),Qze(this),e4e(this,e),t4e(this,e),n4e(this,e),i4e(this,e),this._defaultTexture=e.context.defaultTexture,r4e(this,e),o4e(this,e),s4e(this),a4e(this,e),u4e(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),l4e(this),f4e(this,e),d4e(this),m4e(this,e)}};function qze(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Yze(e,t){l(e._customShader)&&e._customShader.update(t)}function Xze(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=qh.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function Kze(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Jze(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Hze(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Zze(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function $ze(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&loe(e)}function loe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Md.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Qze(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function e4e(e,t){e._silhouetteDirty&&(foe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function t4e(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function n4e(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function i4e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function r4e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function o4e(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var Qm=new m,IU=new me;function s4e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===We.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,r=e.modelMatrix;Qm.x=r[12],Qm.y=r[13],Qm.z=r[14];let o=i.cartesianToCartographic(Qm);if(!l(o)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(r,new F));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(o,coe(e,i,o));let a=n.getHeight(o);if(l(a)){let c=coe(e,i,o);me.clone(o,IU),IU.height=a,i.cartographicToCartesian(IU,Qm),c(Qm)}e._heightDirty=!1,e._updateModelMatrix=!0}function a4e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;uoe(e,n),c4e(e,n,t)}function uoe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function c4e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);F.getTranslation(t,Qm),e._sceneMode!==ne.SCENE3D&&Qi.computeActualWgs84Position(n,Qm,Qm);let s=e._boundingSphere.radius,a=h4e(Qm,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function l4e(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}function u4e(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let s=Wze,a=Gze;a=F.multiply(r.uniformState.view3D,i,a),s=F.getMatrix3(a,s),s=$.getRotation(s,s),e._iblReferenceFrameMatrix=$.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=jze;s=F.multiply(r.uniformState.view3D,i,s),s=F.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=F.inverseTranspose(s,e._clippingPlanesMatrix)}}function f4e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function d4e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;let t=e._showCreditsOnScreen;l(e._credit)&&(e._credit.showOnScreen=t||e._credit._isDefaultToken);let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++)n[s].showOnScreen=t||n[s]._isDefaultToken;let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++)r[s].showOnScreen=t||r[s]._isDefaultToken}function m4e(e,t){let n=_4e(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(g4e(e,t),e._sceneGraph.pushDrawCommands(t))}var K6=new ae;function h4e(e,t,n){return K6.center=e,K6.radius=t,n.camera.getPixelSize(K6,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function coe(e,t,n){return function(i){if(e.heightReference===We.RELATIVE_TO_GROUND){let o=t.cartesianToCartographic(i,IU);o.height+=n.height,t.cartographicToCartesian(o,i)}let r=e._clampedModelMatrix;F.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightDirty=!0}}var p4e=new m;function _4e(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=F.getTranslation(e.modelMatrix,p4e);Qi.computeActualWgs84Position(t,s,s),o=m.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function g4e(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCreditToNextFrame(i);let r=e._resourceCredits,o=r.length;for(let c=0;c<o;c++)n.addCreditToNextFrame(r[c]);let s=e._gltfCredits,a=s.length;for(let c=0;c<a;c++)n.addCreditToNextFrame(s[c])}_r.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};_r.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function foe(e){return e.context.stencilBuffer}_r.prototype.hasSilhouette=function(e){return foe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};_r.prototype.hasSkipLevelOfDetail=function(e){if(!Ur.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};_r.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};_r.prototype.isDestroyed=function(){return!1};_r.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let r=0;r<i;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};_r.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};_r.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};_r.fromGltf=function(e){Q("Model.fromGltf","Model.fromGltf was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),r=Ie.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=Ie.createIfNeeded(t);let o=new Jm(n),a=l(e.content)?Ur.TILE_GLTF:Ur.GLTF,c=mA(o,a,e);return c.resource=n.gltfResource,new _r(c)};_r.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),r=Ie.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=Ie.createIfNeeded(t);let o=new Jm(n),a=l(e.content)?Ur.TILE_GLTF:Ur.GLTF,c=n.gltfResource,u=mA(o,a,e);u.resource=c;try{await o.load()}catch(g){throw o.destroy(),$t.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new _r(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let h=0;h<g;h++)d._resourceCredits.push(p[h])}return d};_r.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new ND(t);try{await n.load();let i=mA(n,Ur.TILE_B3DM,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new dA(t);try{await n.load();let i=mA(n,Ur.TILE_PNTS,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new kD(t);try{await n.load();let i=mA(n,Ur.TILE_I3DM,e);return new _r(i)}catch(i){throw n.destroy(),i}};_r.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new FD(t),i=mA(n,Ur.TILE_GEOJSON,e);return new _r(i)};_r.prototype.applyColorAndShow=function(e){let t=this._color,n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,J6(t,this._color)&&this.resetDrawCommands()};_r.prototype.applyStyle=function(e){let t=this.type===Ur.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),loe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function mA(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Ld=_r;function Ds(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Ds.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ds.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Ds.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Ds.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Ds.prototype.applyStyle=function(e){this._model.style=e};Ds.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),l(r)&&l(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Tl.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Ds.fromGltf=async function(e,t,n,i){let r=new Ds(e,t,n),s=_O(e,t,r,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Ld.fromGltfAsync(s);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};Ds.fromB3dm=async function(e,t,n,i,r){let o=new Ds(e,t,n),a=_O(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Ld.fromB3dm(a);return o._model=u,o._readyPromise=new Promise(f=>{o._resolveContent=f}),o};Ds.fromI3dm=async function(e,t,n,i,r){let o=new Ds(e,t,n),a=_O(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Ld.fromI3dm(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Ds.fromPnts=async function(e,t,n,i,r){let o=new Ds(e,t,n),a=_O(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Ld.fromPnts(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Ds.fromGeoJson=async function(e,t,n,i){let r=new Ds(e,t,n),s=_O(e,t,r,{geoJson:i,resource:n}),a=await Ld.fromGeoJson(s);return r._model=a,r._readyPromise=new Promise(c=>{r._resolveContent=c}),r};function _O(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ee.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return gt(i,r)}var eh=Ds;function Nd(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties(Nd.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Nd.fromJson=function(e,t,n,i){let r=new Nd(e,t,n);return r._tileset.loadTileset(r._resource,i,r._tile),r._ready=!0,r};Nd.prototype.hasProperty=function(e,t){return!1};Nd.prototype.getFeature=function(e){};Nd.prototype.applyDebugSettings=function(e,t){};Nd.prototype.applyStyle=function(e){};Nd.prototype.update=function(e,t){};Nd.prototype.isDestroyed=function(){return!1};Nd.prototype.destroy=function(){return ue(this)};var gO=Nd;function Rs(e,t,n,i){let r=Rs._verifyAttributes(t);n=y(n,0);let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Rs._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Rs._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Rs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:y(r.index,i),enabled:y(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:y(r.componentDatatype,X.FLOAT),normalize:y(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:y(r.usage,Fe.STATIC_DRAW)};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Rs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Rs._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Rs.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Rs._resize(r,this._size),Rs._appendWriters(this.writers,r)}Z6(this)};Rs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var y4e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Rs._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=y4e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Rs.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=x4e(this,i)||t;if(t||!l(this.va)){Z6(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);Rs._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new si({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function x4e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=mt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Rs._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Rs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)b4e(n[i],e,t)};function b4e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Rs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Z6(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Rs.prototype.isDestroyed=function(){return!1};Rs.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Z6(this),ue(this)};var Wp=Rs;var yO=`uniform sampler2D u_atlas; - // move from RTC to EC - position = u_modifiedModelView * position; - right = czm_normal * right; +#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif - // Push for width in a direction that is in the start or end plane and in a plane with right - // N = normalEC ("right-facing" direction for push) - // R = right - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); +in vec2 v_textureCoordinates; +in vec4 v_pickColor; +in vec4 v_color; - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; +#endif - gl_Position = czm_depthClamp(czm_projection * position); +#ifdef FRAGMENT_DEPTH_CHECK +in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates +in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) +in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +in mat2 v_rotationMatrix; - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT1 = 2.0; - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; -} -`;var zM=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; -uniform vec4 u_highlightColor; -void main() +float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) { - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + vec2 lookupVector = imageSize * (depthLookupST - adjustedST); + lookupVector = v_rotationMatrix * lookupVector; + vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } + vec2 translation = v_originTextureCoordinateAndTranslate.zw; - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; + if (applyTranslate) + { + // this is only needed for labels where the horizontal origin is not LEFT + // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT + translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); + } - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); + vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + if (logDepthOrDepth == 0.0) + { + return 0.0; // not on the globe + } - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + return eyeCoordinate.z / eyeCoordinate.w; +} +#endif - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; +#ifdef SDF - czm_writeDepthClamp(); +// Get the distance from the edge of a glyph at a given position sampling an SDF texture. +float getDistance(vec2 position) +{ + return texture(u_atlas, position).r; } -`;function Jp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight),this._boundingVolume=Mn.fromRectangle(e.rectangle,si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Jp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function n5e(e,t,n){let i=si.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;Mn.fromRectangle(c,r,o,n,a)}function i5e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var r5e=new _i("createVectorTileClampedPolylines"),Qg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function o5e(e,t){if(u(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;u(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=i5e(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},l=r5e.scheduleTask(c,a);if(u(l))return l.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),s5e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function s5e(e,t){if(!u(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,l=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+l.byteLength,e._trianglesLength=l.length/3,e._geometryByteLength=f;let d=mt.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),h=mt.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),A=mt.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),x=mt.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),C=mt.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW}),T=mt.createIndexBuffer({context:t,typedArray:l,usage:Ne.STATIC_DRAW,indexDatatype:l.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),E=[{index:Qg.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Qg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Qg.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Qg.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Qg.startFaceNormalAndVertexCorner,vertexBuffer:A,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Qg.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Qg.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:E,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var HM=new N,Wse=new m;function a5e(e,t){u(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,HM),N.multiplyByPoint(HM,e._center,Wse),N.setTranslation(HM,Wse,HM),HM},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function jse(e){return Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Hn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function c5e(e){u(e._rs)||(e._rs=jse(!1),e._rs3DTiles=jse(!0))}function l5e(e,t){if(u(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(kM),r=n.getFragmentShaderCallback(!1,void 0,!0)(zM),o=new ke({defines:["VECTOR_TILE",Gt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[nu,i]}),s=new ke({defines:["VECTOR_TILE"],sources:[r]});e._sp=Kt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Qg})}function u5e(e,t){let n=e._command;if(!u(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:ve.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=et.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=ve.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===zn.TERRAIN||i===zn.BOTH)&&t.commandList.push(n),(i===zn.CESIUM_3D_TILE||i===zn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Jp.prototype.getPositions=function(e){return XA.getPolylinePositions(this,e)};Jp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Is(e,o)}};Jp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function f5e(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var d5e=new z,m5e=z.WHITE,h5e=!0;Jp.prototype.applyStyle=function(e,t){if(!u(e)){f5e(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=u(e.color)?e.color.evaluateColor(s,d5e):m5e,s.show=u(e.show)?e.show.evaluate(s):h5e}};function p5e(e){return si.initialize().then(function(){n5e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Jp.prototype.update=function(e){let t=e.context;if(!this._ready){if(u(this._promise)||(this._promise=p5e(this).then(o5e(this,t))),u(this._error)){let i=this._error;throw this._error=void 0,i}return}a5e(this,t),l5e(this,t),c5e(this);let n=e.passes;(n.render||n.pick)&&u5e(this,e)};Jp.prototype.isDestroyed=function(){return!1};Jp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var GM=Jp;var l9=32767,_5e=new he,g5e=new m;function y5e(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);Yn.zigZagDeltaDecode(s,a,c);let l=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],h=P.lerp(t.west,t.east,d/l9),A=P.lerp(t.south,t.north,p/l9),x=P.lerp(n,i,g/l9),C=he.fromRadians(h,A,x,_5e),T=r.cartographicToCartesian(C,g5e);m.pack(T,l,f*3)}return l}var WM=y5e;function rh(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),E5e(this,i,r)}Object.defineProperties(rh.prototype,{featuresLength:{get:function(){return u(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return u(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return u(this._polygons)&&(e+=this._polygons.trianglesLength),u(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return u(this._polygons)&&(e+=this._polygons.geometryByteLength),u(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return u(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return u(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function A5e(e){return function(t,n){u(e._polygons)&&e._polygons.updateCommands(t,n)}}function x5e(e,t){let n,i,r,o,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&u(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&u(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&u(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let l=u(n)||u(i)||u(r),f=s>0&&!u(n)||a>0&&!u(i)||c>0&&!u(r);if(l&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!u(n)&&!u(i)&&!u(r)){let p=0;if(!u(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!u(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!u(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Vd=Uint32Array.BYTES_PER_ELEMENT;function C5e(e){return new XA(e)}function T5e(e){return new GM(e)}function E5e(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=Vd;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Vd;let s=r.getUint32(n,!0);if(n+=Vd,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=Vd,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Vd;let l=r.getUint32(n,!0);n+=Vd;let f=r.getUint32(n,!0);n+=Vd;let d=r.getUint32(n,!0);n+=Vd;let p=r.getUint32(n,!0);n+=Vd;let g=r.getUint32(n,!0);n+=Vd;let h=r.getUint32(n,!0);n+=Vd;let A=Br(i,n,a);n+=a;let x=new Uint8Array(t,n,c);n+=c;let C,T;l>0&&(C=Br(i,n,l),n+=l,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let E=y(A.POLYGONS_LENGTH,0),S=y(A.POLYLINES_LENGTH,0),w=y(A.POINTS_LENGTH,0),D=E+S+w,M=new Ep(e,D,C,T,A5e(e));if(e._batchTable=M,D===0)return;let O=new Od(A,x),B=O.getGlobalProperty("REGION");if(!u(B))throw new de("Feature table global property: REGION must be defined");let L=ce.unpack(B),_=B[4],b=B[5],v=e._tile.computedTransform,I=O.getGlobalProperty("RTC_CENTER",X.FLOAT,3);u(I)?(I=m.unpack(I),N.multiplyByPoint(v,I,I)):(I=ce.center(L),I.height=P.lerp(_,b,.5),I=re.WGS84.cartographicToCartesian(I));let R=x5e(A,x);if(n+=(4-n%4)%4,E>0){O.featuresLength=E;let F=y(O.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!u(F))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=y(O.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!u(k))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=F.reduce(function(j,K){return j+K*2},0),G=k.reduce(function(j,K){return j+K},0),U=new Uint32Array(t,n,G);n+=d;let Y=new Uint16Array(t,n,V);n+=p;let W,J;u(A.POLYGON_MINIMUM_HEIGHTS)&&u(A.POLYGON_MAXIMUM_HEIGHTS)&&(W=O.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=O.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new FM({positions:Y,counts:F,indexCounts:k,indices:U,minimumHeight:_,maximumHeight:b,polygonMinimumHeights:W,polygonMaximumHeights:J,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,batchIds:R.polygons,modelMatrix:v})}if(S>0){O.featuresLength=S;let F=y(O.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!u(F))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=O.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!u(k)){k=new Uint16Array(S);for(let J=0;J<S;++J)k[J]=2}let V=F.reduce(function(J,j){return J+j*3},0),G=new Uint16Array(t,n,V);n+=g;let U=e._tileset,Y=U.examineVectorLinesFunction;if(u(Y)){let J=WM(new Uint16Array(G),L,_,b,re.WGS84);b5e(J,F,R.polylines,M,e.url,Y)}let W=C5e;u(U.classificationType)&&(W=T5e),e._polylines=W({positions:G,widths:k,counts:F,batchIds:R.polylines,minimumHeight:_,maximumHeight:b,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(w>0){let F=new Uint16Array(t,n,w*3);n+=h,e._points=new NM({positions:F,batchIds:R.points,minimumHeight:_,maximumHeight:b,rectangle:L,batchTable:M})}}function u9(e){let t=e.featuresLength;if(!u(e._features)&&t>0){let n=new Array(t);u(e._polygons)&&e._polygons.createFeatures(e,n),u(e._polylines)&&e._polylines.createFeatures(e,n),u(e._points)&&e._points.createFeatures(e,n),e._features=n}}rh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};rh.prototype.getFeature=function(e){return u(this._features)||u9(this),this._features[e]};rh.prototype.applyDebugSettings=function(e,t){u(this._polygons)&&this._polygons.applyDebugSettings(e,t),u(this._polylines)&&this._polylines.applyDebugSettings(e,t),u(this._points)&&this._points.applyDebugSettings(e,t)};rh.prototype.applyStyle=function(e){u(this._features)||u9(this),u(this._polygons)&&this._polygons.applyStyle(e,this._features),u(this._polylines)&&this._polylines.applyStyle(e,this._features),u(this._points)&&this._points.applyStyle(e,this._features)};rh.prototype.update=function(e,t){let n=!0;u(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),u(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),u(this._points)&&(this._points.update(t),n=n&&this._points.ready),u(this._batchTable)&&n&&(u(this._features)||u9(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};rh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(u(t))return t.getPositions(e)};rh.prototype.isDestroyed=function(){return!1};rh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function b5e(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let l=t[c]*3,f=e.slice(a,a+l);a+=l,o(f,n[c],r,i)}}var jM=rh;var qse={b3dm:function(e,t,n,i,r){return $m.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return $m.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return $m.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return JP.fromTileType(e,t,n,i,r,qse)},externalTileset:function(e,t,n,i){return xM.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new QP(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new jM(e,t,n,i,r)},subt:function(e,t,n,i,r){return qT.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return qT.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new de("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return $m.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return $m.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return $m.fromGeoJson(e,t,n,i)}},KA=qse;var S5e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Gr=Object.freeze(S5e);var kd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};kd.isBinaryFormat=function(e){switch(e){case kd.BATCHED_3D_MODEL:case kd.INSTANCED_3D_MODEL:case kd.COMPOSITE:case kd.POINT_CLOUD:case kd.VECTOR:case kd.GEOMETRY:case kd.IMPLICIT_SUBTREE:case kd.VOXEL_BINARY:case kd.GLTF_BINARY:return!0;default:return!1}};var us=Object.freeze(kd);var v5e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},_f=Object.freeze(v5e);var Bs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Zp=new Array(Bs.NUMBER_OF_PASSES);Zp[Bs.RENDER]=Object.freeze({pass:Bs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Zp[Bs.PICK]=Object.freeze({pass:Bs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Zp[Bs.SHADOW]=Object.freeze({pass:Bs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Zp[Bs.PRELOAD]=Object.freeze({pass:Bs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Bs.PRELOAD_FLIGHT]=Object.freeze({pass:Bs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Bs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Bs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Bs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Bs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Bs.MOST_DETAILED_PICK]=Object.freeze({pass:Bs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Bs.getPassOptions=function(e){return Zp[e]};var Nr=Object.freeze(Bs);function Qp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Qp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},readyPromise:{get:function(){return $("Empty3DTileContent.readyPromise","Empty3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Empty3DTileContent.ready to return true instead."),Promise.resolve(this)}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Qp.prototype.hasProperty=function(e,t){return!1};Qp.prototype.getFeature=function(e){};Qp.prototype.applyDebugSettings=function(e,t){};Qp.prototype.applyStyle=function(e){};Qp.prototype.update=function(e,t){};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){return ue(this)};var gE=Qp;function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties($p.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$p.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};$p.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};$p.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};$p.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};$p.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};$p.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};$p.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var qM=$p;function f9(e,t){let n=ni(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!u(n))return;if(!u(e.schema)){f9._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(u(n.class)){let r=i[n.class];return new qM({content:n,class:r})}}f9._oneTimeWarning=Ot;var JA=f9;function w5e(e,t){let n=e.metadataExtension;if(!u(n))return;let i=n.groups,r=ni(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var ZA=w5e;function e_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var YM=e_;function d9(e,t){let n=ni(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!u(n))return;if(!u(e.schema)){d9._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(u(n.class)){let r=i[n.class];return new YM({tile:n,class:r})}}d9._oneTimeWarning=Ot;var XM=d9;function D5e(e){let t=new Uint8Array(e),n=Td(t);if(n==="glTF"&&(n="glb"),us.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=I5e(t);if(u(i.root))return{contentType:us.EXTERNAL_TILESET,jsonPayload:i};if(u(i.asset))return{contentType:us.GLTF,jsonPayload:i};if(u(i.tileAvailability))return{contentType:us.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(u(i.type))return{contentType:us.GEOJSON,jsonPayload:i};if(u(i.voxelTable))return{contentType:us.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function I5e(e){let t;try{t=Br(e)}catch{throw new de("Invalid tile content.")}return t}var oh=D5e;function zd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let r=u(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let s=0;s<o;s++){let a=n.getDerivedResource({url:r[s].uri}),c=ka.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(zd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},readyPromise:{get:function(){return $("Multiple3DTileContent.readyPromise","Multiple3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Multiple3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function m9(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Yse(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}zd.prototype.requestInnerContents=function(){if(!P5e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;m9(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=O5e(this,n,t,this._tile._contentState);return M5e(this)};function P5e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];u(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!ka.serverHasOpenSlots(n,t[n]))return!1;return ka.heapHasOpenSlots(e.length)}function O5e(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new qr({throttle:!0,throttleByServer:!0,type:$o.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let l=r.fetchArrayBuffer();if(u(l))return l.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ti.CANCELLED){Yse(e,i);return}return m9(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ti.CANCELLED){Yse(e,i);return}m9(e,-1),Xse(e,t,f)}})}async function M5e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>R5e(e,o,s)),r=await Promise.all(i);return e._contentsCreated=!0,e._contents=r.filter(u),r}async function R5e(e,t,n){if(u(t))try{let i=oh(t);if(i.contentType===us.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===us.GEOMETRY||i.contentType===us.VECTOR;let r=e._tileset,o=e._innerContentResources[n],s=e._tile,a,c=KA[i.contentType];u(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let l=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=JA(r,l));let f=ZA(r,l);return u(f)&&(a.group=new pA({metadata:f})),a}catch(i){Xse(e,n,i)}}function Xse(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=u(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}zd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];u(t)&&t.cancel()}};zd.prototype.hasProperty=function(e,t){return!1};zd.prototype.getFeature=function(e){};zd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};zd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};zd.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};zd.prototype.isDestroyed=function(){return!1};zd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var KM=zd;var iae=Ki($se(),1);var K5e=new m,J5e=new m,$g={};$g.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};$g.computeWindingOrder2D=function(e){return $g.computeArea2D(e)>0?Qo.COUNTER_CLOCKWISE:Qo.CLOCKWISE};$g.triangulate=function(e,t){let n=H.packArray(e);return(0,iae.default)(n,t,2)};var rae=new m,oae=new m,sae=new m,eae=new m,tae=new m,nae=new m,t_=new m,aae=new H,cae=new H,lae=new H,AE=new H;$g.computeSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=u(i),s=n.slice(0),a,c=t.length,l=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let E=t[a];if(l[d++]=E.x,l[d++]=E.y,l[d++]=E.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],h={},A=e.maximumRadius,x=P.chordLength(r,A),C=x*x;for(;s.length>0;){let E=s.pop(),S=s.pop(),w=s.pop(),D=m.fromArray(l,w*3,rae),M=m.fromArray(l,S*3,oae),O=m.fromArray(l,E*3,sae),B,L,_;o&&(B=H.fromArray(f,w*2,aae),L=H.fromArray(f,S*2,cae),_=H.fromArray(f,E*2,lae));let b=m.multiplyByScalar(m.normalize(D,eae),A,eae),v=m.multiplyByScalar(m.normalize(M,tae),A,tae),I=m.multiplyByScalar(m.normalize(O,nae),A,nae),R=m.magnitudeSquared(m.subtract(b,v,t_)),F=m.magnitudeSquared(m.subtract(v,I,t_)),k=m.magnitudeSquared(m.subtract(I,b,t_)),V=Math.max(R,F,k),G,U,Y;V>C?R===V?(G=`${Math.min(w,S)} ${Math.max(w,S)}`,a=h[G],u(a)||(U=m.add(D,M,t_),m.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,h[G]=a,o&&(Y=H.add(B,L,AE),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(w,a,E),s.push(a,S,E)):F===V?(G=`${Math.min(S,E)} ${Math.max(S,E)}`,a=h[G],u(a)||(U=m.add(M,O,t_),m.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,h[G]=a,o&&(Y=H.add(L,_,AE),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(S,a,w),s.push(a,E,w)):k===V&&(G=`${Math.min(E,w)} ${Math.max(E,w)}`,a=h[G],u(a)||(U=m.add(O,D,t_),m.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,h[G]=a,o&&(Y=H.add(_,B,AE),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(E,a,S),s.push(a,w,S)):(g.push(w),g.push(S),g.push(E))}let T={attributes:{position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:l})},indices:g,primitiveType:Be.TRIANGLES};return o&&(T.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(T)};var Z5e=new he,Q5e=new he,$5e=new he,y9=new he;$g.computeRhumbLineSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=u(i),s=n.slice(0),a,c=t.length,l=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let w=t[a];if(l[d++]=w.x,l[d++]=w.y,l[d++]=w.z,o){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let g=[],h={},A=e.maximumRadius,x=P.chordLength(r,A),C=new xa(void 0,void 0,e),T=new xa(void 0,void 0,e),E=new xa(void 0,void 0,e);for(;s.length>0;){let w=s.pop(),D=s.pop(),M=s.pop(),O=m.fromArray(l,M*3,rae),B=m.fromArray(l,D*3,oae),L=m.fromArray(l,w*3,sae),_,b,v;o&&(_=H.fromArray(f,M*2,aae),b=H.fromArray(f,D*2,cae),v=H.fromArray(f,w*2,lae));let I=e.cartesianToCartographic(O,Z5e),R=e.cartesianToCartographic(B,Q5e),F=e.cartesianToCartographic(L,$5e);C.setEndPoints(I,R);let k=C.surfaceDistance;T.setEndPoints(R,F);let V=T.surfaceDistance;E.setEndPoints(F,I);let G=E.surfaceDistance,U=Math.max(k,V,G),Y,W,J,j,K;U>x?k===U?(Y=`${Math.min(M,D)} ${Math.max(M,D)}`,a=h[Y],u(a)||(W=C.interpolateUsingFraction(.5,y9),J=(I.height+R.height)*.5,j=m.fromRadians(W.longitude,W.latitude,J,e,t_),l.push(j.x,j.y,j.z),a=l.length/3-1,h[Y]=a,o&&(K=H.add(_,b,AE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(M,a,w),s.push(a,D,w)):V===U?(Y=`${Math.min(D,w)} ${Math.max(D,w)}`,a=h[Y],u(a)||(W=T.interpolateUsingFraction(.5,y9),J=(R.height+F.height)*.5,j=m.fromRadians(W.longitude,W.latitude,J,e,t_),l.push(j.x,j.y,j.z),a=l.length/3-1,h[Y]=a,o&&(K=H.add(b,v,AE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,M),s.push(a,w,M)):G===U&&(Y=`${Math.min(w,M)} ${Math.max(w,M)}`,a=h[Y],u(a)||(W=E.interpolateUsingFraction(.5,y9),J=(F.height+I.height)*.5,j=m.fromRadians(W.longitude,W.latitude,J,e,t_),l.push(j.x,j.y,j.z),a=l.length/3-1,h[Y]=a,o&&(K=H.add(v,_,AE),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(w,a,D),s.push(a,M,D)):(g.push(M),g.push(D),g.push(w))}let S={attributes:{position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:l})},indices:g,primitiveType:Be.TRIANGLES};return o&&(S.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(S)};$g.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,re.WGS84);let r=K5e,o=J5e;if(t=y(t,0),i=y(i,!0),u(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),m.multiplyByScalar(r,t,r),m.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var ui=$g;var uae=Math.cos,fae=Math.sin,e6e=Math.sqrt,x9={};x9.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,l=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=uae(f),p=fae(f),g=a.z*p,h=c.longitude+i*e.granYSin+r*e.granXCos,A=d*uae(h),x=d*fae(h),C=a.x*A,T=a.y*x,E=e6e(C*A+T*x+g*p);if(o.x=C/E,o.y=T/E,o.z=g/E,n){let S=e.stNwCorner;u(S)?(f=S.latitude-e.stGranYCos*i+r*e.stGranXSin,h=S.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(h-l.west)*e.lonScalar,s.y=(f-l.south)*e.latScalar)}};var t6e=new ir,gf=new m,n6e=new he,FV=new m,A9=new Ii;function dae(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,l=n*a,f=Math.sin(t),d=i*f,p=n*f;gf=A9.project(e,gf),gf=m.subtract(gf,FV,gf);let g=ir.fromRotation(t,t6e);gf=ir.multiplyByVector(g,gf,gf),gf=m.add(gf,FV,gf),e=A9.unproject(gf,e),o-=1,s-=1;let h=e.latitude,A=h+o*p,x=h-c*s,C=h-c*s+o*p,T=Math.max(h,A,x,C),E=Math.min(h,A,x,C),S=e.longitude,w=S+o*l,D=S+s*d,M=S+s*d+o*l,O=Math.max(S,w,D,M),B=Math.min(S,w,D,M);return{north:T,south:E,east:O,west:B,granYCos:c,granYSin:d,granXCos:l,granXSin:p,nwCorner:e}}x9.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,l=e.north,f=e.south,d=!1,p=!1;l===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,h=l-f;c>a?g=P.TWO_PI-c+a:g=a-c;let A=Math.ceil(g/t)+1,x=Math.ceil(h/t)+1,C=g/(A-1),T=h/(x-1),E=ce.northwest(e,o),S=ce.center(e,n6e);(n!==0||i!==0)&&(S.longitude<E.longitude&&(S.longitude+=P.TWO_PI),FV=A9.project(S,FV));let w=T,D=C,M=0,O=0,B=ce.clone(e,r),L={granYCos:w,granYSin:M,granXCos:D,granXSin:O,nwCorner:E,boundingRectangle:B,width:A,height:x,northCap:d,southCap:p};if(n!==0){let _=dae(E,n,C,T,S,A,x);l=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,B.north=l,B.south=f,B.east=a,B.west=c}if(i!==0){n=n-i;let _=ce.northwest(B,s),b=dae(_,n,C,T,S,A,x);L.stGranYCos=b.granYCos,L.stGranXCos=b.granXCos,L.stGranYSin=b.granYSin,L.stGranXSin=b.granXSin,L.stNwCorner=_,L.stWest=b.west,L.stSouth=b.south}return L};var fs=x9;var i6e=new ae,r6e=new ae,o6e=new m,s6e=new ce;function mae(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,l=0,f=4;o&&(c-=1,a-=1,l+=1,f-=2),s&&(c-=1,a-=1,l+=1,f-=2),l+=c*r+2*a-f;let d=new Float64Array(l*3),p=0,g=0,h,A=o6e;if(o)fs.computePosition(t,n,!1,g,0,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;else for(h=0;h<r;h++)fs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(h=r-1,g=1;g<i;g++)fs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;if(g=i-1,!s)for(h=r-2;h>=0;h--)fs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(h=0,g=i-2;g>0;g--)fs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;let x=d.length/3*2,C=Fe.createTypedArray(d.length/3,x),T=0;for(let S=0;S<d.length/3-1;S++)C[T++]=S,C[T++]=S+1;C[T++]=d.length/3-1,C[T++]=0;let E=new dt({attributes:new mn,primitiveType:Be.LINES});return E.attributes.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),E.indices=C,E}function a6e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=i,s=n,a=mae(e,t),c=t.height,l=t.width,f=ui.scaleToGeodeticHeight(a.attributes.position.values,s,r,!1),d=f.length,p=new Float64Array(d*2);p.set(f);let g=ui.scaleToGeodeticHeight(a.attributes.position.values,o,r);p.set(g,d),a.attributes.position.values=p;let h=t.northCap,A=t.southCap,x=4;h&&(x-=1),A&&(x-=1);let C=(p.length/3+x)*2,T=Fe.createTypedArray(p.length/3,C);d=p.length/6;let E=0;for(let w=0;w<d-1;w++)T[E++]=w,T[E++]=w+1,T[E++]=w+d,T[E++]=w+d+1;T[E++]=d-1,T[E++]=0,T[E++]=d+d-1,T[E++]=d,T[E++]=0,T[E++]=d;let S;if(h)S=c-1;else{let w=l-1;T[E++]=w,T[E++]=w+d,S=l+c-2}if(T[E++]=S,T[E++]=S+d,!A){let w=l+S-1;T[E++]=w,T[E]=w+d}return a.indices=T,a}function CE(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,re.WGS84),r=y(e.rotation,0),o=y(e.height,0),s=y(e.extrudedHeight,o);this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}CE.packedLength=ce.packedLength+re.packedLength+5;CE.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var hae=new ce,pae=re.clone(re.UNIT_SPHERE),xE={rectangle:hae,ellipsoid:pae,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};CE.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,hae);t+=ce.packedLength;let r=re.unpack(e,t,pae);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t];return u(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=l===-1?void 0:l,n):(xE.granularity=o,xE.height=s,xE.rotation=a,xE.extrudedHeight=c,xE.offsetAttribute=l===-1?void 0:l,new CE(xE))};var c6e=new he;CE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=fs.computeOptions(t,e._granularity,e._rotation,0,s6e,c6e),r,o;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),l;if(c){if(r=a6e(e,i),u(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===on.TOP?g=g.fill(1,0,p/2):(l=e._offsetAttribute===on.NONE?0:1,g=g.fill(l)),r.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,r6e),d=ae.fromRectangle3D(t,n,a,i6e);o=ae.union(f,d)}else{if(r=mae(e,i),r.attributes.position.values=ui.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),u(e._offsetAttribute)){let f=r.attributes.position.values.length;l=e._offsetAttribute===on.NONE?0:1;let d=new Uint8Array(f/3).fill(l);r.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ae.fromRectangle3D(t,n,s)}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Be.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var $A=CE;function EE(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=y(e.ellipsoid,re.WGS84);m6e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(EE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});EE.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Mn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var _ae=new m,UV=new m,gae=new m,l6e=new m,u6e=new m,f6e=new m,d6e=new m,yf=new he,yae=new ln(m.UNIT_X,0),TE=new Dn;function m6e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),yf.longitude=t.west,yf.latitude=(t.south+t.north)*.5,yf.height=0;let i=n.cartographicToCartesian(yf,f6e),r=m.cross(i,m.UNIT_Z,l6e);m.normalize(r,e.westNormal),yf.longitude=t.east;let o=n.cartographicToCartesian(yf,d6e),s=m.cross(m.UNIT_Z,o,_ae);m.normalize(s,e.eastNormal);let a=m.subtract(i,o,_ae);m.magnitude(a)===0&&(a=m.clone(r,a));let c=m.normalize(a,u6e),l=t.south,f;if(l>0){yf.longitude=(t.west+t.east)*.5,yf.latitude=l;let A=n.cartographicToCartesian(yf,TE.origin);m.clone(c,TE.direction);let x=ln.fromPointNormal(e.southwestCornerCartesian,e.westNormal,yae);Qi.rayPlane(TE,x,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(A,UV)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),UV);let d=m.cross(f,a,gae);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){yf.longitude=(t.west+t.east)*.5,yf.latitude=p;let A=n.cartographicToCartesian(yf,TE.origin);m.negate(c,TE.direction);let x=ln.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,yae);Qi.rayPlane(TE,x,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(A,UV)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),UV);let h=m.cross(a,g,gae);m.normalize(h,e.northNormal)}var h6e=new m,p6e=new m,_6e=new m(0,-1,0),g6e=new m(0,0,-1),Aae=new m;function y6e(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ce.contains(e.rectangle,r)){let l=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(l=t.mapProjection.project(ce.southwest(e.rectangle),h6e),l.z=l.y,l.y=l.x,l.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),p6e),f.z=f.y,f.y=f.x,f.x=0,d=_6e,g=m.UNIT_Y,p=g6e,h=m.UNIT_Z);let A=m.subtract(i,l,Aae),x=m.dot(A,d),C=m.dot(A,p),T=m.subtract(i,f,Aae),E=m.dot(T,g),S=m.dot(T,h);x>0?o+=x*x:E>0&&(o+=E*E),C>0?o+=C*C:S>0&&(o+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let l=s-c;o+=l*l}else if(s<a){let l=a-s;o+=l*l}return Math.sqrt(o)}EE.prototype.distanceToCamera=function(e){let t=y6e(this,e);if(e.mode===ne.SCENE3D&&u(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};EE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};EE.prototype.createDebugVolume=function(e){let t=new N.clone(N.IDENTITY),n=new $A({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ct({geometry:n,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}});return new Sn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var Af=EE;var $M={},A6e=new m,xae=new m,Cae=new m,Tae=new m,Eae=new Mn;$M.validOutline=function(e){let n=Mn.fromPoints(e,Eae).halfAxes,i=Q.getColumn(n,0,xae),r=Q.getColumn(n,1,Cae),o=Q.getColumn(n,2,Tae),s=m.magnitude(i),a=m.magnitude(r),c=m.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};$M.computeProjectTo2DArguments=function(e,t,n,i){let r=Mn.fromPoints(e,Eae),o=r.halfAxes,s=Q.getColumn(o,0,xae),a=Q.getColumn(o,1,Cae),c=Q.getColumn(o,2,Tae),l=m.magnitude(s),f=m.magnitude(a),d=m.magnitude(c),p=Math.min(l,f,d);if(l===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,h;return(p===f||p===d)&&(g=s),p===l?g=a:p===d&&(h=a),(p===l||p===f)&&(h=c),m.normalize(g,n),m.normalize(h,i),m.clone(r.center,t),!0};function bae(e,t,n,i,r){let o=m.subtract(e,t,A6e),s=m.dot(n,o),a=m.dot(i,o);return H.fromElements(s,a,r)}$M.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=bae(i[o],e,t,n);return r}};$M.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return bae(i,e,t,n,r)}};var n_=$M;function ey(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ey.prototype,{length:{get:function(){return this._length}}});ey.prototype.enqueue=function(e){this._array.push(e),this._length++};ey.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ey.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ey.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ey.prototype.clear=function(){this._array.length=this._offset=this._length=0};ey.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ty=ey;var ao={};ao.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!u(r))continue;n+=2;let o=r.positions,s=r.holes;if(u(o)&&o.length>0&&(n+=o.length*t.packedLength),u(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};ao.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!u(o))continue;let s=o.positions,a=o.holes;if(t[n++]=u(s)?s.length:0,t[n++]=u(a)?a.length:0,u(s)){let c=s.length;for(let l=0;l<c;++l,n+=i.packedLength)i.pack(s[l],t,n)}if(u(a)){let c=a.length;for(let l=0;l<c;++l)r.push(a[l])}}return n};ao.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=ao.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var ex=new H;function Dae(e,t,n,i){return H.subtract(t,e,ex),H.multiplyByScalar(ex,n/i,ex),H.add(e,ex,ex),[ex.x,ex.y]}var ny=new m;function x6e(e,t,n,i){return m.subtract(t,e,ny),m.multiplyByScalar(ny,n/i,ny),m.add(e,ny,ny),[ny.x,ny.y,ny.z]}ao.subdivideLineCount=function(e,t,n){let r=m.distance(e,t)/n,o=Math.max(0,Math.ceil(P.log2(r)));return Math.pow(2,o)};var C9=new he,T9=new he,C6e=new he,T6e=new m,Sae=new xa;ao.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,C9),o=e.cartesianToCartographic(n,T9),a=new xa(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};ao.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=ao.subdivideLineCount(n,i,r),a=H.distance(e,t),c=a/s,l=o;l.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Dae(e,t,d*c,a);l[f++]=p[0],l[f++]=p[1]}return l};ao.subdivideLine=function(e,t,n,i){let r=ao.subdivideLineCount(e,t,n),o=m.distance(e,t),s=o/r;u(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let l=0;l<r;l++){let f=x6e(e,t,l*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};ao.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,C9),c=n.cartesianToCartographic(r,T9);Sae.setEndPoints(a,c);let l=Sae.surfaceDistance/o,f=Math.max(0,Math.ceil(P.log2(l))),d=Math.pow(2,f),p=H.distance(e,t),g=p/d,h=s;h.length=d*2;let A=0;for(let x=0;x<d;x++){let C=Dae(e,t,x*g,p);h[A++]=C[0],h[A++]=C[1]}return h};ao.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,C9),s=e.cartesianToCartographic(n,T9),a=new xa(o,s,e),c=a.surfaceDistance/i,l=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,l),d=a.surfaceDistance/f;u(r)||(r=[]);let p=r;p.length=f*3;let g=0;for(let h=0;h<f;h++){let A=a.interpolateUsingSurfaceDistance(h*d,C6e),x=e.cartographicToCartesian(A,T6e);p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}return p};var E6e=new m,b6e=new m,S6e=new m,v6e=new m;ao.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=y(i,re.WGS84);let o=E6e,s=b6e,a=S6e,c=v6e;if(u(e)&&u(e.attributes)&&u(e.attributes.position)){let l=e.attributes.position.values,f=l.length/2;for(let d=0;d<f;d+=3)m.fromArray(l,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(o,n,s),s=m.add(c,s,s),l[d+f]=s.x,l[d+1+f]=s.y,l[d+2+f]=s.z,r&&(c=m.clone(a,c)),s=m.multiplyByScalar(o,t,s),s=m.add(c,s,s),l[d]=s.x,l[d+1]=s.y,l[d+2]=s.z}return e};ao.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new ty;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),l=c.positions;if(t)for(a=l.length,o=0;o<a;o++)n.scaleToGeodeticSurface(l[o],l[o]);if(l=Sr(l,m.equalsEpsilon,!0),l.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Sr(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(u(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(l)}return i};ao.polygonsFromHierarchy=function(e,t,n,i,r){let o=[],s=[],a=new ty;for(a.enqueue(e);a.length!==0;){let c=a.dequeue(),l=c.positions,f=c.holes,d,p;if(i)for(p=l.length,d=0;d<p;d++)r.scaleToGeodeticSurface(l[d],l[d]);if(t||(l=Sr(l,m.equalsEpsilon,!0)),l.length<3)continue;let g=n(l);if(!u(g))continue;let h=[],A=ui.computeWindingOrder2D(g);A===Qo.CLOCKWISE&&(g.reverse(),l=l.slice().reverse());let x=l.slice(),C=u(f)?f.length:0,T=[],E;for(d=0;d<C;d++){let S=f[d],w=S.positions;if(i)for(p=w.length,E=0;E<p;++E)r.scaleToGeodeticSurface(w[E],w[E]);if(t||(w=Sr(w,m.equalsEpsilon,!0)),w.length<3)continue;let D=n(w);if(!u(D))continue;A=ui.computeWindingOrder2D(D),A===Qo.CLOCKWISE&&(D.reverse(),w=w.slice().reverse()),T.push(w),h.push(x.length),x=x.concat(w),g=g.concat(D);let M=0;for(u(S.holes)&&(M=S.holes.length),E=0;E<M;E++)a.enqueue(S.holes[E])}o.push({outerRing:l,holes:T}),s.push({positions:x,positions2D:g,holes:h})}return{hierarchy:o,polygons:s}};var w6e=new H,D6e=new m,I6e=new Le,P6e=new Q;ao.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,I6e),s=Q.fromQuaternion(o,P6e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=m.clone(n[p],D6e);Q.multiplyByVector(s,g,g);let h=t(g,w6e);u(h)&&(a=Math.min(a,h.x),c=Math.max(c,h.x),l=Math.min(l,h.y),f=Math.max(f,h.y))}return r.x=a,r.y=l,r.width=c-a,r.height=f-l,r};ao.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=ui.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,l=u(n),f=l?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let x=0;x<d;x++){let C=c[x];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let h={attributes:{position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Be.TRIANGLES};l&&(h.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H.packArray(f)}));let A=new dt(h);return o.normal?Nn.computeNormal(A):A}if(s===Jt.GEODESIC)return ui.computeSubdivision(e,c,a,f,i);if(s===Jt.RHUMB)return ui.computeRhumbLineSubdivision(e,c,a,f,i)};var vae=[],wae=[],O6e=new m,M6e=new m;ao.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,l,f,d,p,g,h,A=e.length,x=0,C=0,T=u(t),E=T?t.positions:void 0;if(r)for(a=A*3*2,s=new Array(a*2),T&&(h=A*2*2,g=new Array(h*2)),c=0;c<A;c++)l=e[c],f=e[(c+1)%A],s[x]=s[x+a]=l.x,++x,s[x]=s[x+a]=l.y,++x,s[x]=s[x+a]=l.z,++x,s[x]=s[x+a]=f.x,++x,s[x]=s[x+a]=f.y,++x,s[x]=s[x+a]=f.z,++x,T&&(d=E[c],p=E[(c+1)%A],g[C]=g[C+h]=d.x,++C,g[C]=g[C+h]=d.y,++C,g[C]=g[C+h]=p.x,++C,g[C]=g[C+h]=p.y,++C);else{let O=P.chordLength(i,n.maximumRadius),B=0;if(o===Jt.GEODESIC)for(c=0;c<A;c++)B+=ao.subdivideLineCount(e[c],e[(c+1)%A],O);else if(o===Jt.RHUMB)for(c=0;c<A;c++)B+=ao.subdivideRhumbLineCount(n,e[c],e[(c+1)%A],O);for(a=(B+A)*3,s=new Array(a*2),T&&(h=(B+A)*2,g=new Array(h*2)),c=0;c<A;c++){l=e[c],f=e[(c+1)%A];let L,_;T&&(d=E[c],p=E[(c+1)%A]),o===Jt.GEODESIC?(L=ao.subdivideLine(l,f,O,wae),T&&(_=ao.subdivideTexcoordLine(d,p,l,f,O,vae))):o===Jt.RHUMB&&(L=ao.subdivideRhumbLine(n,l,f,O,wae),T&&(_=ao.subdivideTexcoordRhumbLine(d,p,n,l,f,O,vae)));let b=L.length;for(let v=0;v<b;++v,++x)s[x]=L[v],s[x+a]=L[v];if(s[x]=f.x,s[x+a]=f.x,++x,s[x]=f.y,s[x+a]=f.y,++x,s[x]=f.z,s[x+a]=f.z,++x,T){let v=_.length;for(let I=0;I<v;++I,++C)g[C]=_[I],g[C+h]=_[I];g[C]=p.x,g[C+h]=p.x,++C,g[C]=p.y,g[C+h]=p.y,++C}}}A=s.length;let S=Fe.createTypedArray(A/3,A-e.length*6),w=0;for(A/=6,c=0;c<A;c++){let O=c,B=O+1,L=O+A,_=L+1;l=m.fromArray(s,O*3,O6e),f=m.fromArray(s,B*3,M6e),!m.equalsEpsilon(l,f,P.EPSILON10,P.EPSILON10)&&(S[w++]=O,S[w++]=L,S[w++]=B,S[w++]=B,S[w++]=L,S[w++]=_)}let D={attributes:new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Be.TRIANGLES};return T&&(D.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new dt(D)};var Xn=ao;function R6e(e){let t=e.length,n=new Float64Array(t*3),i=Fe.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:Be.LINES})}function tx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+1}tx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new tx(t)};tx.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var B6e={polygonHierarchy:{}};tx.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=e[t];return u(n)||(n=new tx(B6e)),n._polygonHierarchy=i,n.packedLength=r,n};tx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Sr(n,m.equalsEpsilon,!0),n.length<3||!n_.validOutline(n))return;let r=Xn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let l=new Ct({geometry:R6e(r[c])});o.push(l)}let s=Nn.combineInstances(o)[0],a=ae.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var xf=tx;var VV=new he;function eR(e){let t=wp.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),r=y(e.ellipsoid,re.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=G6e(t,n,i,r);this._boundingPlanes=o;let s=Y6e(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=P9(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=P9(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=P9(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();VV=r.cartesianToCartographic(c,VV),VV.height=(i+n)/2,this.center=r.cartographicToCartesian(VV,c),this._boundingSphere=ae.fromPoints(s)}var L6e=new m,N6e=new he,F6e=new m,U6e=new he,V6e=new m,k6e=new m,z6e=new m,H6e=new m;function G6e(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,L6e),a=i.cartesianToCartographic(o,N6e);a.height=n;let c=i.cartographicToCartesian(a,F6e),l=ln.fromPointNormal(c,s);r[0]=l;let f=0,d,p=[],g,h;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,h=i.cartesianToCartographic(g,U6e),h.height=t;let x=ln.getPointDistance(l,i.cartographicToCartesian(h,V6e));x<f&&(f=x)}let A=ln.clone(l);for(A.normal=m.negate(A.normal,A.normal),A.distance=A.distance*-1+f,r[1]=A,d=0;d<4;d++){g=p[d];let x=p[(d+1)%4],C=i.geodeticSurfaceNormal(g,k6e),T=m.subtract(x,g,H6e),E=m.cross(T,C,z6e);E=m.normalize(E,E),r[2+d]=ln.fromPointNormal(g,E)}return r}var nx=new m,ix=new m,rx=new m,E9=new m,b9=new m,S9=new m,W6e=new m,j6e=new m,q6e=new m,v9=new m,w9=new m,D9=new m,iy=new m,sh=new Q;function Iae(e,t,n){nx=e.normal,ix=t.normal,rx=n.normal,E9=m.multiplyByScalar(e.normal,-e.distance,E9),b9=m.multiplyByScalar(t.normal,-t.distance,b9),S9=m.multiplyByScalar(n.normal,-n.distance,S9),v9=m.multiplyByScalar(m.cross(ix,rx,W6e),m.dot(E9,nx),v9),w9=m.multiplyByScalar(m.cross(rx,nx,j6e),m.dot(b9,ix),w9),D9=m.multiplyByScalar(m.cross(nx,ix,q6e),m.dot(S9,rx),D9),sh[0]=nx.x,sh[1]=ix.x,sh[2]=rx.x,sh[3]=nx.y,sh[4]=ix.y,sh[5]=rx.y,sh[6]=nx.z,sh[7]=ix.z,sh[8]=rx.z;let i=Q.determinant(sh);return iy=m.add(v9,w9,iy),iy=m.add(iy,D9,iy),new m(iy.x/i,iy.y/i,iy.z/i)}function Y6e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Iae(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Iae(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var I9=new m,bE=new m;function P9(e,t){let n=[];for(let i=0;i<4;i++)I9=m.subtract(t[(i+1)%4],t[i],I9),bE=m.cross(e.normal,I9,bE),bE=m.normalize(bE,bE),n[i]=m.clone(bE);return n}Object.defineProperties(eR.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var O9=new m;eR.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;ln.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):ln.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,ln.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=M9(ln.projectPointOntoPlane(c,t,O9),i[0],c,r),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Pae(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=M9(ln.projectPointOntoPlane(c,t,O9),i[o],c,this._edgeNormals[n[o]]),d=m.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=M9(ln.projectPointOntoPlane(this._boundingPlanes[1],t,O9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let l=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+l)%4]):m.distance(t,this._vertices[4+(n[1]-2+l)%4])};var X6e=new m,K6e=new m;function Pae(e,t,n){let i=m.subtract(n,t,X6e),r=m.subtract(e,t,K6e),o=m.dot(i,r);if(o<=0)return t;let s=m.dot(i,i);return o>=s?n:(o=o/s,new m((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var J6e=new ln(m.UNIT_X,0);function M9(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let l=ln.fromPointNormal(t[c],i[c],J6e);ln.getPointDistance(l,e)<0||(a=Pae(e,t[c],t[(c+1)%4]),o=m.distance(e,a),o<r&&(r=o,s=a))}return u(s)?s:e}eR.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};eR.prototype.createDebugVolume=function(e){let t=new N.clone(N.IDENTITY),n=new xf({polygonHierarchy:{positions:this._planeVertices[0]}}),i=xf.createGeometry(n),r=new Ct({geometry:i,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),o=new xf({polygonHierarchy:{positions:this._planeVertices[1]}}),s=xf.createGeometry(o),a=new Ct({geometry:s,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),c=[];for(let l=0;l<4;l++){let f=new xf({polygonHierarchy:{positions:this._planeVertices[2+l]}}),d=xf.createGeometry(f);c[l]=new Ct({geometry:d,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}})}return new Sn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var tR=eR;var Z6e=new m(1,1,1),kV=Math.cos,zV=Math.sin;function SE(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,Z6e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,P.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),l=Math.round(y(e.subdivisions,128));this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=l,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}SE.packedLength=2*m.packedLength+8;SE.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var Oae=new m,Mae=new m,i_={radii:Oae,innerRadii:Mae,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};SE.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Oae);t+=m.packedLength;let r=m.unpack(e,t,Mae);t+=m.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++],p=e[t];return u(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=l,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(i_.minimumClock=o,i_.maximumClock=s,i_.minimumCone=a,i_.maximumCone=c,i_.stackPartitions=l,i_.slicePartitions=f,i_.subdivisions=d,i_.offsetAttribute=p===-1?void 0:p,new SE(i_))};SE.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=re.fromCartesian3(t),l=e._slicePartitions+1,f=e._stackPartitions+1;l=Math.round(l*Math.abs(r-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-o)/P.PI),l<2&&(l=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,A=!1;g&&(p=2,o>0&&(h=!0,d+=l),s<Math.PI&&(A=!0,d+=l));let x=a*p*(f+l),C=new Float64Array(x*3),T=2*(x+d-(l+f)*p),E=Fe.createTypedArray(x,T),S,w,D,M,O=0,B=new Array(f),L=new Array(f);for(S=0;S<f;S++)M=o+S*(s-o)/(f-1),B[S]=zV(M),L[S]=kV(M);let _=new Array(a),b=new Array(a);for(S=0;S<a;S++)D=i+S*(r-i)/(a-1),_[S]=zV(D),b[S]=kV(D);for(S=0;S<f;S++)for(w=0;w<a;w++)C[O++]=t.x*B[S]*b[w],C[O++]=t.y*B[S]*_[w],C[O++]=t.z*L[S];if(g)for(S=0;S<f;S++)for(w=0;w<a;w++)C[O++]=n.x*B[S]*b[w],C[O++]=n.y*B[S]*_[w],C[O++]=n.z*L[S];for(B.length=a,L.length=a,S=0;S<a;S++)M=o+S*(s-o)/(a-1),B[S]=zV(M),L[S]=kV(M);for(_.length=l,b.length=l,S=0;S<l;S++)D=i+S*(r-i)/(l-1),_[S]=zV(D),b[S]=kV(D);for(S=0;S<a;S++)for(w=0;w<l;w++)C[O++]=t.x*B[S]*b[w],C[O++]=t.y*B[S]*_[w],C[O++]=t.z*L[S];if(g)for(S=0;S<a;S++)for(w=0;w<l;w++)C[O++]=n.x*B[S]*b[w],C[O++]=n.y*B[S]*_[w],C[O++]=n.z*L[S];for(O=0,S=0;S<f*p;S++){let R=S*a;for(w=0;w<a-1;w++)E[O++]=R+w,E[O++]=R+w+1}let v=f*a*p;for(S=0;S<l;S++)for(w=0;w<a-1;w++)E[O++]=v+S+w*l,E[O++]=v+S+(w+1)*l;if(g)for(v=f*a*p+l*a,S=0;S<l;S++)for(w=0;w<a-1;w++)E[O++]=v+S+w*l,E[O++]=v+S+(w+1)*l;if(g){let R=f*a*p,F=R+a*l;if(h)for(S=0;S<l;S++)E[O++]=R+S,E[O++]=F+S;if(A)for(R+=a*l-l,F+=a*l-l,S=0;S<l;S++)E[O++]=R+S,E[O++]=F+S}let I=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C})});if(u(e._offsetAttribute)){let R=C.length,F=e._offsetAttribute===on.NONE?0:1,k=new Uint8Array(R/3).fill(F);I.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return new dt({attributes:I,indices:E,primitiveType:Be.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var fu=SE;function vE(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new fu(i),this._workerName="createSphereOutlineGeometry"}vE.packedLength=fu.packedLength;vE.pack=function(e,t,n){return fu.pack(e._ellipsoidGeometry,t,n)};var Q6e=new fu,ox={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};vE.unpack=function(e,t,n){let i=fu.unpack(e,t,Q6e);return ox.stackPartitions=i._stackPartitions,ox.slicePartitions=i._slicePartitions,ox.subdivisions=i._subdivisions,u(n)?(m.clone(i._radii,ox.radii),n._ellipsoidGeometry=new fu(ox),n):(ox.radius=i._radii.x,new vE(ox))};vE.createGeometry=function(e){return fu.createGeometry(e._ellipsoidGeometry)};var r_=vE;function wE(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(wE.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});wE.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};wE.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};wE.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};wE.prototype.createDebugVolume=function(e){let t=new r_({radius:this.radius}),n=N.fromTranslation(this.center,new N.clone(N.IDENTITY)),i=new Ct({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new Sn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var o_=wE;var $6e=new m,e9e=new m,t9e=new m,n9e=new m;function sx(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,P.EPSILON7/i,n)}function R9(e,t){let n=m.normalize(e,n9e),i=m.equalsEpsilon(n,m.UNIT_X,P.EPSILON6)?m.UNIT_Y:m.UNIT_X;return sx(e,i,t)}function Rae(e){let t=Q.getColumn(e,0,$6e),n=Q.getColumn(e,1,e9e),i=Q.getColumn(e,2,t9e),r=m.equals(t,m.ZERO),o=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(r&&!o&&!s?t=sx(n,i,t):!r&&o&&!s?n=sx(t,i,n):!r&&!o&&s?i=sx(n,t,i):r?o?s||(t=R9(i,t),n=sx(i,t,n)):(t=R9(n,t),i=sx(n,t,i)):(n=R9(t,n),i=sx(n,t,i)),Q.setColumn(e,0,t,e),Q.setColumn(e,1,n,e),Q.setColumn(e,2,i,e),e)}function DE(e,t){t=Rae(t),this._orientedBoundingBox=new Mn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(DE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});DE.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};DE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};DE.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=Rae(t),Q.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};DE.prototype.createDebugVolume=function(e){let t=new ld({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ct({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new Sn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var Cf=DE;function Qr(e,t,n,i){this._tileset=e,this._header=n;let r=u(n.contents),o=r&&n.contents.length>1||ni(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=u(n.transform)?N.unpack(n.transform):N.clone(N.IDENTITY);let a=u(i)?i.computedTransform:e.modelMatrix,c=N.multiply(a,this.transform,new N),l=u(i)?i._initialTransform:N.IDENTITY;this._initialTransform=N.multiply(l,this.transform,new N),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;u(s)&&u(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;u(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,u(this._geometricError)||(this._geometricError=u(i)?i._geometricError:e._geometricError,Qr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;u(n.refine)?((n.refine==="replace"||n.refine==="add")&&Qr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?kr.REPLACE:kr.ADD):u(i)?p=i.refine:p=kr.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,A,x,C;if(t=we.createIfNeeded(t),o)A=Gr.UNLOADED,x=t.clone();else if(u(s)){let w=s.uri;u(s.url)&&(Qr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),w=s.url),w===""?(Qr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new gE(e,this),h=!0,A=Gr.READY):(A=Gr.UNLOADED,x=t.getDerivedResource({url:w}),C=ka.getServerKey(x.getUrlComponent()))}else g=new gE(e,this),h=!0,A=Gr.READY;this._content=g,this._contentResource=x,this._contentState=A,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=XM(e,n),this.cacheNode=void 0;let T=n.expire,E,S;u(T)&&(E=T.duration,u(T.date)&&(S=ee.fromIso8601(T.date))),this.expireDuration=E,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=_f.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Qr._deprecationWarning=$;Object.defineProperties(Qr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return u(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||u(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Gr.READY}},contentUnloaded:{get:function(){return this._contentState===Gr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Gr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Gr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ry=new m;function i9e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,ry),c=m.add(s.positionWC,a,ry),l=m.subtract(c,o,ry);if(m.magnitude(l)>r){let S=m.normalize(l,ry),w=m.multiplyByScalar(S,r,ry),D=m.add(o,w,ry),M=m.subtract(D,s.positionWC,ry),O=m.normalize(M,ry);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,O))}else e._foveatedFactor=0;let p=e.refine===kr.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Nr.PRELOAD_FLIGHT||n._pass===Nr.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),A=n.foveatedConeSize*h;if(e._foveatedFactor<=A)return!1;let x=h-A,C=P.clamp((e._foveatedFactor-A)/x,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),E=e._screenSpaceError===0&&u(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-T<=E}var Nae=new ee;Qr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=y(n,1),o=u(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,l=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===ne.SCENE2D||l instanceof tn){let g=l.offCenterFrustum;u(g)&&(l=g);let h=Math.max(l.top-l.bottom,l.right-l.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),h=l.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let A=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,C=P.fog(g,A)*x;p-=C}}return p/=e.pixelRatio,p};function r9e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,s=u(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function o9e(e,t){let n=t.parent,r=u(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}Qr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=u(t)?t.computedTransform:n.modelMatrix,r=u(t)?t._visibilityPlaneMask:es.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==es.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=o9e(n,this),this._priorityProgressiveResolution=r9e(n,this),this.priorityDeferred=i9e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Qr.prototype.updateExpiration=function(){if(u(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(Nae);ee.lessThan(this.expireDate,e)&&(this._contentState=Gr.EXPIRED,this._expiredContent=this._content)}};function s9e(e){if(!u(e.expireDuration))return;let t=ee.now(Nae);ee.addSeconds(t,e.expireDuration,t),u(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function a9e(e){return function(){return e._priority}}Qr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?c9e(this):u9e(this)};function c9e(e){let t=e._content,n=e._tileset;if(!u(t)){let r=ni(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new KM(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(u(i))return e._contentState=Gr.LOADING,i.then(r=>{if(!e.isDestroyed()&&u(r))return e._contentState=Gr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Gr.FAILED,r})}async function l9e(e,t,n,i,r){let o=e._contentState;e._contentState=Gr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ti.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Gr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ti.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await f9e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Gr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Gr.FAILED,a}}function u9e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new qr({throttle:!0,throttleByServer:!0,type:$o.TILES3D,priorityFunction:a9e(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!u(o)){++r.statistics.numberOfAttemptedRequests;return}return l9e(e,r,i,n,o)}async function f9e(e,t){let n=oh(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===us.GEOMETRY||n.contentType===us.VECTOR,(n.contentType===us.IMPLICIT_SUBTREE||n.contentType===us.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===us.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r,o=KA[n.contentType];if(e.isDestroyed())return;u(n.binaryPayload)?r=await Promise.resolve(o(i,e,e._contentResource,n.binaryPayload.buffer,0)):r=await Promise.resolve(o(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,l=e.implicitCoordinates;r.metadata=c.getContentMetadataView(l,0)}else e.hasImplicitContent||(r.metadata=JA(i,s));let a=ZA(i,s);return u(a)&&(r.group=new pA({metadata:a})),r}Qr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Qr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Gr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Fae=new ae;function L9(e,t){if(t.mode!==ne.SCENE3D&&!u(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Fae);e._boundingVolume2D=new o_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function d9e(e,t){if(t.mode!==ne.SCENE3D&&!u(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Fae);e._contentBoundingVolume2D=new o_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Qr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=L9(this,e),r=this._tileset,o=r.clippingPlanes;if(u(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return es.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Qr.prototype.contentVisibility=function(e){if(!u(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===es.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=d9e(this,e),i=this._tileset,r=i.clippingPlanes;if(u(r)&&r.enabled){let o=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=o!==$t.INSIDE,o===$t.OUTSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};Qr.prototype.distanceToTile=function(e){return L9(this,e).distanceToCamera(e)};var m9e=new m;Qr.prototype.distanceToTileCenter=function(e){let n=L9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,m9e);return m.dot(e.camera.directionWC,i)};Qr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!u(t)||t.distanceToCamera(e)===0};var Uae=new Q,Vae=new m,h9e=new Q,kae=new m,zae=new ce,p9e=new Mn,B9=new N;function _9e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],kae),r=Q.fromArray(e,3,h9e);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,Uae);return r=Q.multiply(o,r,r),u(n)?(n.update(i,r),n):new Cf(i,r)}function g9e(e,t,n,i){let r=ce.unpack(e,0,zae),o=e[4],s=e[5],a=Mn.fromRectangle(r,o,s,re.WGS84,p9e),c=a.center,l=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,B9),B9),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,Uae);return l=Q.multiply(f,l,l),u(i)&&i instanceof Cf?(i.update(c,l),i):new Cf(c,l)}function y9e(e,t,n,i){if(!N.equalsEpsilon(t,n,P.EPSILON8))return g9e(e,t,n,i);if(u(i))return i;let r=ce.unpack(e,0,zae);return new Af({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function A9e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],kae),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,Vae),s=m.maximumComponent(o);return r*=s,u(n)?(n.update(i,r),n):new o_(i,r)}Qr.prototype.createBoundingVolume=function(e,t,n){if(!u(e))throw new de("boundingVolume must be defined");if(ni(e,"3DTILES_bounding_volume_S2"))return new tR(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:r,sphere:o}=e;if(u(i))return _9e(i,t,n);if(u(r))return y9e(r,t,this._initialTransform,n);if(u(o))return A9e(o,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};Qr.prototype.updateTransform=function(e){e=y(e,N.IDENTITY);let t=N.multiplyTransformation(e,this.transform,B9);if(!!N.equals(t,this.computedTransform))return;N.clone(t,this.computedTransform);let i=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),u(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),u(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Qr.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,Vae),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!u(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function x9e(e,t,n,i){if(!i.isRender)return;let r=u(e._contentHeader)&&u(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,u(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let l=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");l.color=zt.toValue(c,l.color)}else!o&&u(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(u(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&u(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&u(e._viewerRequestVolume)?(u(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&u(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||u(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function C9e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&u(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(u(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Gr.FAILED,r}}function T9e(e,t){let n=t.clippingPlanes,i=0;u(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Qr.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;T9e(this,e),x9e(this,e,t,n),C9e(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===ve.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var Bae=[];Qr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(s9e(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=Gr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Bae;try{this._content.update(e,t)}catch(i){throw this._contentState=Gr.FAILED,i}Bae.length=0,t.commandList=n};function Lae(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function HV(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}Qr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,l=r,f=c+l,d=o,p=Math.pow(10,f),g=f+d,h=o,A=Math.pow(10,g),x=g+h,C=Math.pow(10,x),T=HV(this._depth,n.depth,i.depth);T=t?1-T:T;let S=!e.isSkippingLevelOfDetail&&this.refine===kr.REPLACE?HV(this._priorityHolder._distanceToCamera,n.distance,i.distance):HV(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),w=Lae(S,a,s),D=this._priorityProgressiveResolution?0:p,M=HV(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),O=Lae(M,l,c),B=this.priorityDeferred?A:0,L=e._pass===Nr.PRELOAD_FLIGHT?0:C;this._priority=T+w+D+O+B+L};Qr.prototype.isDestroyed=function(){return!1};Qr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Tf=Qr;function s_(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,r=u(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(s_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});s_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};s_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};s_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};s_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};s_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};s_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};s_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var IE=s_;function a_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=u(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(a_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});a_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};a_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};a_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};a_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};a_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};a_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};a_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var nR=a_;function Hae(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),r;u(i)&&(r=new nR({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let l=0;l<c;l++){let f=a[l];s.push(new IE({group:f,class:n.classes[f.class]}))}}else if(u(a)){o=Object.keys(a).sort();let c=o.length;for(let l=0;l<c;l++){let f=o[l];if(a.hasOwnProperty(f)){let d=a[f];s.push(new IE({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Hae.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var oy=Hae;var Gae={},E9e=new m;Gae.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Cf||i instanceof Af){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=_f.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof Cf||a instanceof Af)){e._optimChildrenWithinParent=_f.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,l=m.subtract(c.center,r.center,E9e),f=m.magnitude(l);m.divideByScalar(l,f,l);let d=Math.abs(r.halfAxes[0]*l.x)+Math.abs(r.halfAxes[1]*l.y)+Math.abs(r.halfAxes[2]*l.z)+Math.abs(r.halfAxes[3]*l.x)+Math.abs(r.halfAxes[4]*l.y)+Math.abs(r.halfAxes[5]*l.z)+Math.abs(r.halfAxes[6]*l.x)+Math.abs(r.halfAxes[7]*l.y)+Math.abs(r.halfAxes[8]*l.z),p=Math.abs(c.halfAxes[0]*l.x)+Math.abs(c.halfAxes[1]*l.y)+Math.abs(c.halfAxes[2]*l.z)+Math.abs(c.halfAxes[3]*l.x)+Math.abs(c.halfAxes[4]*l.y)+Math.abs(c.halfAxes[5]*l.z)+Math.abs(c.halfAxes[6]*l.x)+Math.abs(c.halfAxes[7]*l.y)+Math.abs(c.halfAxes[8]*l.z);if(d<=p+f){e._optimChildrenWithinParent=_f.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===_f.USE_OPTIMIZATION};var iR=Gae;function rR(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(rR.prototype,{length:{get:function(){return this._length}}});function b9e(e,t,n){this.item=e,this.previous=t,this.next=n}rR.prototype.add=function(e){let t=new b9e(e,this.tail,void 0);return u(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Wae(e,t){u(t.previous)&&u(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):u(t.previous)?(t.previous.next=void 0,e.tail=t.previous):u(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}rR.prototype.remove=function(e){u(e)&&(Wae(this,e),--this._length)};rR.prototype.splice=function(e,t){if(e===t)return;Wae(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var oR=rR;function ax(){this._list=new oR,this._sentinel=this._list.add(),this._trimTiles=!1}ax.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};ax.prototype.touch=function(e){let t=e.cacheNode;u(t)&&this._list.splice(this._sentinel,t)};ax.prototype.add=function(e){u(e.cacheNode)||(e.cacheNode=this._list.add(e))};ax.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;u(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};ax.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=e.maximumMemoryUsage*1024*1024,o=this._sentinel,s=i.head;for(;s!==o&&(e.totalMemoryUsageInBytes>r||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};ax.prototype.trim=function(){this._trimTiles=!0};var sR=ax;function GV(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function F9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}GV.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=F9(e,n),this._referenceMaximum[n]=F9(t,n)};function S9e(e,t){let n=e.tilePropertyName;if(u(n)){let i=F9(t[n],n);return u(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var N9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];GV.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!u(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=S9e(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,l=N9.length-1,f=c*l,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=N9[d],A=N9[p],x=z.clone(z.WHITE);x.red=P.lerp(h.red,A.red,g),x.green=P.lerp(h.green,A.green,g),x.blue=P.lerp(h.blue,A.blue,g),e._debugColor=x};GV.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(u(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=u(t)&&u(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var aR=GV;function PE(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}PE.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function WV(e,t,n,i){let r=t.innerContents,o=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,l=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-l:l,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-s:s),u(r)){let d=r.length;for(let p=0;p<d;++p)WV(e,r[p],n,i)}}PE.prototype.incrementSelectionCounts=function(e){WV(this,e,!1,!1)};PE.prototype.incrementLoadCounts=function(e){WV(this,e,!1,!0)};PE.prototype.decrementLoadCounts=function(e){WV(this,e,!0,!0)};PE.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var c_=PE;function cR(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(cR.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});cR.prototype.makeDirty=function(){this._styleDirty=!0};cR.prototype.resetDirty=function(){this._styleDirty=!1};cR.prototype.applyStyle=function(e){if(!u(e.root)||u(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var lR=cR;function v9e(e,t,n){let i=ni(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!u(r.box)&&!u(r.region)&&!ni(r,"3DTILES_bounding_volume_S2")&&!ni(r,"3DTILES_bounding_volume_cylinder"))throw new de("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new we({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=w9e(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(We(a,!0));let c=new we({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=D9e(t),this.subdivisionScheme=jo[i.subdivisionScheme],this.branchingFactor=jo.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,u(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function w9e(e){if(ni(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return u(t.contents)?t.contents:t.content}return u(e.contents)?e.contents:u(e.content)?[e.content]:[]}function D9e(e){let t=We(e,!0);return u(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var sy=v9e;var uR={};function jae(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function U9(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function qae(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function V9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}uR.encode2D=function(e,t){return(jae(e)|jae(t)<<1)>>>0};uR.decode2D=function(e,t){return u(t)||(t=new Array(2)),t[0]=qae(e),t[1]=qae(e>>1),t};uR.encode3D=function(e,t,n){return U9(e)|U9(t)<<1|U9(n)<<2};uR.decode3D=function(e,t){return u(t)||(t=new Array(3)),t[0]=V9(e),t[1]=V9(e>>1),t[2]=V9(e>>2),t};var ay=uR;function Wr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===jo.OCTREE&&(this.z=e.z)}Object.defineProperties(Wr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===jo.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===jo.OCTREE?ay.encode3D(this.x,this.y,this.z):ay.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===jo.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Wr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===jo.OCTREE){let r=(this.z<<e.level)+e.z;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Wr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===jo.OCTREE){let o=Math.floor(this.z/t);return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};Wr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===jo.OCTREE){let o=e.z%n;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};Wr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===jo.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Wr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Wr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Wr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===jo.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};Wr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===jo.OCTREE?this.z===e.z:!0)};Wr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Wr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Wr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Wr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===jo.OCTREE&&(e.z=this.z),e};var Yae=[0,0,0];Wr.fromMortonIndex=function(e,t,n,i){let r;return e===jo.OCTREE?(r=ay.decode3D(i,Yae),new Wr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=ay.decode2D(i,Yae),new Wr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};Wr.fromTileIndex=function(e,t,n){let i,r,o;return e===jo.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),Wr.fromMortonIndex(e,t,i,o)};var cx=Wr;function l_(){}l_.selectTiles=function(e,t){fe.throwInstantiationError()};l_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};l_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};l_.selectTile=function(e,t){if(e.contentVisibility(t)===$t.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&i._selectedTilesToStyle.push(e),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};l_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};l_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};l_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!I9e(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function I9e(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}l_.updateTile=function(e,t){Xae(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,M9e(e),e._shouldSelect=!1,e._finalResolution=!0};function Xae(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];Xae(o,t),e._visible=o._visible;return}if(P9e(e,t)){e._visible=!1;return}let i=e.refine===kr.REPLACE,r=e._optimChildrenWithinParent===_f.USE_OPTIMIZATION;if(i&&r&&n&&!O9e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function P9e(e,t){let{parent:n,tileset:i}=e;return!u(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==kr.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function O9e(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function M9e(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ls=l_;function Kae(){}var fR={stack:new Uc,stackMaximumLength:0};Kae.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=Ls,s=fR.stack;for(s.push(i);s.length>0;){fR.stackMaximumLength=Math.max(fR.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===kr.ADD,l=a.refine===kr.REPLACE,f=R9e(a);f&&B9e(a,s,t),(c||l&&!f)&&(L9e(e,a),r(a,t),N9e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return fR.stack.trim(fR.stackMaximumLength),n};function R9e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function B9e(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function L9e(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function N9e(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var dR=Kae;function Jae(){}var mR={stack:new Uc,stackMaximumLength:0},hR={stack:new Uc,stackMaximumLength:0};Jae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ls.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;U9e(n,t),mR.stack.trim(mR.stackMaximumLength),hR.stack.trim(hR.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function k9(e,t){e.contentAvailable&&Ls.selectTile(e,t)}function F9e(e,t,n){let i=e.refine===kr.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Ls;for(let h=0;h<o.length;++h)s(o[h],n);o.sort(Ls.sortChildrenByDistanceToCamera);let l=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let h=0;h<o.length;++h){let A=o[h];if(A.isVisible?(t.push(A),A._foveatedFactor<g&&(p=h,g=A._foveatedFactor),d=!0):(l||r.loadSiblings)&&(A._foveatedFactor<g&&(p=h,g=A._foveatedFactor),a(A,n),c(A,n)),l){let x;A._inRequestVolume?A.hasRenderableContent?x=A.contentAvailable:x=V9e(A,n):x=!1,f=f&&x}}if(d||(f=!1),p!==-1&&i){let h=o[p];h._wasMinPriorityChild=!0;let A=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;A._foveatedFactor=Math.min(h._foveatedFactor,A._foveatedFactor),A._distanceToCamera=Math.min(h._distanceToCamera,A._distanceToCamera);for(let x=0;x<o.length;++x)o[x]._priorityHolder=A}return f}function U9e(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Ls,a=mR.stack;for(a.push(e);a.length>0;){mR.stackMaximumLength=Math.max(mR.stackMaximumLength,a.length);let c=a.pop(),l=c.parent,f=!u(l)||l._refines;c._refines=i(c)?F9e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===kr.ADD?(k9(c,t),r(c,t)):c.refine===kr.REPLACE&&(r(c,t),d&&k9(c,t)):(n._emptyTiles.push(c),r(c,t),d&&k9(c,t)),o(c,t),s(c,t)}}function V9e(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Ls,s=!0,a=hR.stack;for(a.push(e);a.length>0;){hR.stackMaximumLength=Math.max(hR.stackMaximumLength,a.length);let c=a.pop(),l=c.children,f=l.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(r(c,t),o(c,t)),d)for(let g=0;g<f;++g){let h=l[g];a.push(h)}}return s}var pR=Jae;function Zae(){}var _R={stack:new Uc,stackMaximumLength:0},gR={stack:new Uc,stackMaximumLength:0},u_={stack:new Uc,stackMaximumLength:0,ancestorStack:new Uc,ancestorStackMaximumLength:0},k9e=2;Zae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ls.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;q9e(n,t),Y9e(n,t),_R.stack.trim(_R.stackMaximumLength),gR.stack.trim(gR.stackMaximumLength),u_.stack.trim(u_.stackMaximumLength),u_.ancestorStack.trim(u_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function z9e(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Ls,o=gR.stack;for(o.push(e);o.length>0;){gR.stackMaximumLength=Math.max(gR.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let l=a[c];l.isVisible&&(l.contentAvailable?(n(l,t),i(l,t),r(l,t)):l._depth-e._depth<k9e&&o.push(l))}}}function jV(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;u(n)?n._shouldSelect=!0:z9e(e,t)}function H9e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!u(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function G9e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||u(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function W9e(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Ls;for(let l=0;l<r.length;++l)o(r[l],n);r.sort(Ls.sortChildrenByDistanceToCamera);let c=!1;for(let l=0;l<r.length;++l){let f=r[l];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function j9e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:u(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function q9e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Ls,c=_R.stack;for(c.push(e);c.length>0;){_R.stackMaximumLength=Math.max(_R.stackMaximumLength,c.length);let l=c.pop();H9e(l,t);let f=l.parent,d=!u(f)||f._refines;l._refines=r(l)?W9e(l,c,t)&&d:!1;let p=!l._refines&&d;l.hasRenderableContent?l.refine===kr.ADD?(jV(l,t),o(l,t)):l.refine===kr.REPLACE&&(j9e(l,i)?(o(l,t),p&&jV(l,t)):p?(jV(l,t),o(l,t)):G9e(n,l)&&o(l,t)):(n._emptyTiles.push(l),o(l,t),p&&jV(l,t)),s(l,t),a(l,t)}}function Y9e(e,t){let{selectTile:n,canTraverse:i}=Ls,{stack:r,ancestorStack:o}=u_,s;for(r.push(e);r.length>0||o.length>0;){if(u_.stackMaximumLength=Math.max(u_.stackMaximumLength,r.length),u_.ancestorStackMaximumLength=Math.max(u_.ancestorStackMaximumLength,o.length),o.length>0){let l=o.peek();if(l._stackLength===r.length){o.pop(),l!==s&&(l._finalResolution=!1),n(l,t);continue}}let a=r.pop();if(!u(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===kr.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let l=a.children;for(let f=0;f<l.length;++f){let d=l[f];d.isVisible&&r.push(d)}}}}var yR=Zae;function xo(e){e=y(e,y.EMPTY_OBJECT),this._marsOptions=y(e.marsOptions,{}),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new sR,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Uc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=y(e.maximumMemoryUsage,512),this._styleEngine=new lR,this._styleApplied=!1,this._modelMatrix=u(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._statistics=new c_,this._statisticsLast=new c_,this._statisticsPerPass=new Array(Nr.NUMBER_OF_PASSES);for(let i=0;i<Nr.NUMBER_OF_PASSES;++i)this._statisticsPerPass[i]=new c_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new aR(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._initialClippingPlanesOriginMatrix=N.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,xn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=gl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Jm(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Np,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,u(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new hA,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,zc.NONE),this._projectTo2D=y(e.projectTo2D,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Ot("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let t=y(e.featureIdLabel,"featureId_0");typeof t=="number"&&(t=`featureId_${t}`),this._featureIdLabel=t;let n=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");if(typeof n=="number"&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,u(e.url)){$("Cesium3DTileset options.url","Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.");let i=this,r;this._readyPromise=Promise.resolve(e.url).then(function(o){let s;return r=we.createIfNeeded(o),i._resource=r,i._credits=r.credits,r.extension==="json"?s=r.getBaseUri(!0):r.isDataUri&&(s=""),i._url=r.url,i._basePath=s,xo.loadJson(r)}).then(function(o){if(!i.isDestroyed())return tce(r,o).then(s=>(i._metadataExtension=s,o))}).then(function(o){if(i.isDestroyed())return;i._geometricError=o.geometricError,i._scaledGeometricError=o.geometricError,i._root=i.loadTileset(r,o);let s=u(o.asset.gltfUpAxis)?hr.fromName(o.asset.gltfUpAxis):hr.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,hr.X),l=o.asset;i._asset=l,i._properties=o.properties,i._extensionsUsed=o.extensionsUsed,i._extensions=o.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=o.extras;let f=l.extras;if(u(f)&&u(f.cesium)&&u(f.cesium.credits)){let h=f.cesium.credits,A=i._credits;u(A)||(A=[],i._credits=A);for(let x=0;x<h.length;++x){let C=h[x];A.push(new Dt(C.html,i._showCreditsOnScreen))}}let p=i._root.createBoundingVolume(o.root.boundingVolume,N.IDENTITY).boundingSphere.center,g=i._ellipsoid.cartesianToCartographic(p);return u(g)&&g.height>si._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=N.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(xo.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return $("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),u(this._root)}},readyPromise:{get:function(){return $("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return $("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!u(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(u(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(u(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return u(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(N.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):N.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});xo.fromIonAssetId=async function(e,t){let n=await Qs.fromAssetId(e);return xo.fromUrl(n,t)};xo.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=we.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await xo.loadJson(n),o=await tce(n,r),s=new xo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras;let c=n.credits;u(c)||(c=[]);let l=a.extras;if(u(l)&&u(l.cesium)&&u(l.cesium.credits)){let x=l.cesium.credits;for(let C=0;C<x.length;++C){let T=x[C];c.push(new Dt(T.html,s._showCreditsOnScreen))}}s._credits=c;let f=u(r.asset.gltfUpAxis)?hr.fromName(r.asset.gltfUpAxis):hr.Y,d=y(t.modelUpAxis,f),p=y(t.modelForwardAxis,hr.X);s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=d,s._modelForwardAxis=p,s._root=s.loadTileset(n,r);let h=s._root.createBoundingVolume(r.root.boundingVolume,N.IDENTITY).boundingSphere.center,A=s._ellipsoid.cartesianToCartographic(h);return u(A)&&A.height>si._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=N.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};xo.loadJson=function(e){return we.createIfNeeded(e).fetchJson()};xo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};xo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!u(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");u(t.extensionsRequired)&&xo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;u(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=Qae(this,e,t.root,n);u(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===kr.ADD;let l=c._header.children;if(u(l))for(let f=0;f<l.length;++f){let d=l[f],p=Qae(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&iR.checkChildrenWithinParent(c)}return s};function Qae(e,t,n,i){if(!(u(n.implicitTiling)||ni(n,"3DTILES_implicit_tiling")))return new Tf(e,t,n,i);let o=e.schema,s=new sy(t,n,o),a=new cx({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=We(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Tf(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function tce(e,t){let n=ni(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(u(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ui.getSchemaLoader({resource:e});else if(u(n.schema))i=Ui.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new oy({schema:i.schema,metadataJson:n});return Ui.unload(i),r}var $ae=new m,X9e=new he,K9e=new N,J9e=new m,Z9e=new m,Q9e=new m;function $9e(e,t){let n,i,r,o,s,a=t.camera,c=e._root,l=c.contentBoundingVolume;if(l instanceof Af)n=m.normalize(a.positionWC,$ae),i=a.directionWC,r=a.positionCartographic.height,o=l.minimumHeight,s=l.maximumHeight;else{let A=N.inverseTransformation(c.computedTransform,K9e),x=t.mapProjection.ellipsoid,C=l.boundingVolume,T=N.multiplyByPoint(A,C.center,J9e);if(m.magnitude(T)>x.minimumRadius){let E=he.fromCartesian(T,x,X9e);n=m.normalize(a.positionWC,$ae),i=a.directionWC,r=a.positionCartographic.height,o=0,s=E.height*2}else{let E=N.multiplyByPoint(A,a.positionWC,Z9e);if(n=m.UNIT_Z,i=N.multiplyByPointAsVector(A,a.directionWC,Q9e),i=m.normalize(i,i),r=E.z,l instanceof Cf){let S=c._header.boundingVolume.box[11];o=T.z-S,s=T.z+S}else if(l instanceof o_){let S=C.radius;o=T.z-S,s=T.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function eWe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();u(r)&&(r.then(o=>{!u(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{nce(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?lWe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function tWe(e,t){return e._priority-t._priority}xo.prototype.postPassesUpdate=function(e){u(this._root)&&(nWe(this,e),fWe(this,e),this._cache.unloadTiles(this,rce),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};xo.prototype.prePassesUpdate=function(e){if(!u(this._root))return;oWe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,u(t)&&t.enabled&&t.update(e),u(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&$9e(this,e),e.newFrame&&this._cache.reset()};function nWe(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Gr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function iWe(e){let t=e._requestedTiles;t.sort(tWe);for(let n=0;n<t.length;++n)eWe(e,t[n])}function nce(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=u(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`))}function rWe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Gr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}function oWe(e,t){rWe(e);let n=e._processingQueue,i=e._statistics,r;for(let o=0;o<n.length;++o){r=n[o];try{r.process(e,t),r.contentReady&&(--i.numberOfTilesProcessing,e.tileLoad.raiseEvent(r))}catch(s){--i.numberOfTilesProcessing,nce(s,e,r)}}}var qV=new m,sWe={maximumFractionDigits:3};function ece(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,sWe):Math.round(t).toLocaleString()}function z9(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=m.clone(i,qV);if(u(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(u(n)){let o=m.normalize(i,qV);o=m.multiplyByScalar(o,.75*n,qV),r=m.add(o,i,qV)}return r}function H9(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` -Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` -Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` -Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,r++),i+=` -Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${ece(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${ece(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` -- ${s[a]}`;r+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function aWe(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(u(e.debugPickedTile)){let s=u(e.debugPickPosition)?e.debugPickPosition:z9(e.debugPickedTile),a=H9(e.debugPickedTile,e,s);a.pixelOffset=new H(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];H9(a,e,z9(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&H9(a,e,z9(a))}}e._tileDebugLabels.update(t)}function cWe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(u(e._stencilClearCommand)||(e._stencilClearCommand=new ri({stencil:0,pass:ve.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Ft.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:l}=e,f=n.isRender,d=i.length;for(let h=0;h<s.length;++h){let A=s[h];f&&l.raiseEvent(A),A.update(e,t,n),c.incrementSelectionCounts(A.content),++c.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,A=h.length;i.length+=A;for(let x=g-1;x>=0;--x)i[d+A+x]=i[d+x];for(let x=0;x<A;++x)i[d+x]=h[x]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(u(e._tileDebugLabels)||(e._tileDebugLabels=new nh),aWe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ice=[];function lWe(e,t){let n=t,i=ice;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(uWe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function rce(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function uWe(e,t){e._cache.unloadTile(e,t,rce),t.destroy()}xo.prototype.trimLoadedTiles=function(){this._cache.trim()};function fWe(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;c_.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function dWe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function mWe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&u(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!N.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=N.clone(e.modelMatrix,e._previousModelMatrix)))}function hWe(e,t,n,i){if(t.mode===ne.MORPHING||!u(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,dWe(e),mWe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&iWe(e),cWe(e,t,i),c_.clone(r,n),i.isRender){let s=e._credits;if(u(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];c.showOnScreen=e._showCreditsOnScreen,t.creditDisplay.addCreditToNextFrame(c)}}return o}xo.prototype.getTraversal=function(e){let{pass:t}=e;return t===Nr.MOST_DETAILED_PRELOAD||t===Nr.MOST_DETAILED_PICK?dR:this.isSkippingLevelOfDetail?yR:pR};xo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};xo.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Nr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Nr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Nr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=Nr.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),l=c.length;e.commandList=c,e.camera=y(t.camera,r),e.cullingVolume=y(t.cullingVolume,o);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=hWe(this,e,f,s)),a&&(c.length=l),e.commandList=i,e.camera=r,e.cullingVolume=o};xo.prototype.hasExtension=function(e){return u(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};xo.prototype.isDestroyed=function(){return!1};xo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),u(this._root)){let e=ice;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};xo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};xo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!xo.supportedExtensions[e[t]])throw new de(`Unsupported 3D Tiles Extension: ${e[t]}`)};var va=xo;var pWe=new N;function cy(e,t){t.collectionChanged.addEventListener(cy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}cy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,l=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,pWe),c=we.createIfNeeded(q.getValueOrUndefined(a._uri,e))),!f){u(l)&&(l.tilesetPrimitive.show=!1);continue}let p=u(l)?l.tilesetPrimitive:void 0;(!u(l)||c.url!==l.url)&&(u(p)&&i.removeAndDestroy(p),delete n[s.id],_We(c,n,s,i)),u(p)&&(p.show=!0,u(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=q.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)G9(this,e[i],t,n);return ue(this)};cy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!u(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return u(i)?i.show?(ae.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};cy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],u(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],u(o._tileset)?s.set(o.id,o):(G9(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],G9(this,o,a,c),s.remove(o.id)};function G9(e,t,n,i){let r=n[t.id];u(r)&&(u(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function _We(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await va.fromUrl(e);if(r.id=n,i.add(r),!u(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var AR=cy;var gWe=z.WHITE,yWe=z.BLACK,AWe=new H(2,2);function OE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(OE.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});OE.prototype.getType=function(e){return"Checkerboard"};OE.prototype.getValue=function(e,t){return u(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,gWe,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,yWe,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,AWe),t};OE.prototype.equals=function(e){return this===e||e instanceof OE&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var ME=OE;var oce={id:void 0};function xR(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function ic(e){this._owner=e,this._entities=new Tt,this._addedEntities=new Tt,this._removedEntities=new Tt,this._changedEntities=new Tt,this._suspendCount=0,this._collectionChanged=new _e,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}ic.prototype.suspendEvents=function(){this._suspendCount++};ic.prototype.resumeEvents=function(){this._suspendCount--,xR(this)};Object.defineProperties(ic.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});ic.prototype.computeAvailability=function(){let e=ze.MAXIMUM_VALUE,t=ze.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(u(s)){let a=s.start,c=s.stop;ee.lessThan(a,e)&&!a.equals(ze.MINIMUM_VALUE)&&(e=a),ee.greaterThan(c,t)&&!c.equals(ze.MAXIMUM_VALUE)&&(t=c)}}return ze.MAXIMUM_VALUE.equals(e)&&(e=ze.MINIMUM_VALUE),ze.MINIMUM_VALUE.equals(t)&&(t=ze.MAXIMUM_VALUE),new Tn({start:e,stop:t})};ic.prototype.add=function(e){e instanceof Jr||(e=new Jr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(ic.prototype._onEntityDefinitionChanged,this),xR(this),e};ic.prototype.remove=function(e){return u(e)?this.removeById(e.id):!1};ic.prototype.contains=function(e){return this._entities.get(e.id)===e};ic.prototype.removeById=function(e){if(!u(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(ic.prototype._onEntityDefinitionChanged,this),xR(this),!0):!1};ic.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);u(c)||(s.definitionChanged.removeEventListener(ic.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),xR(this)};ic.prototype.getById=function(e){return this._entities.get(e)};ic.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return u(t)||(oce.id=e,t=new Jr(oce),this.add(t)),t};ic.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),xR(this)};var Ns=ic;var YV={id:void 0},RE=new Array(2);function W9(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function sce(e,t,n,i){RE[0]=n,RE[1]=i.id,t[JSON.stringify(RE)]=i.definitionChanged.addEventListener(Do.prototype._onDefinitionChanged,e)}function ace(e,t,n,i){RE[0]=n,RE[1]=i.id;let r=JSON.stringify(RE);t[r](),t[r]=void 0}function ly(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,l,f=e._composite,d=new Ns(e),p=e._eventHash,g;for(o=0;o<r;o++)for(l=i[o],l.collectionChanged.removeEventListener(Do.prototype._onCollectionChanged,e),a=l.values,g=l.id,c=a.length-1;c>-1;c--)s=a[c],ace(e,p,g,s);for(o=n-1;o>=0;o--)for(l=t[o],l.collectionChanged.addEventListener(Do.prototype._onCollectionChanged,e),a=l.values,g=l.id,c=a.length-1;c>-1;c--){s=a[c],sce(e,p,g,s);let A=d.getById(s.id);u(A)||(A=f.getById(s.id),u(A)?W9(A):(YV.id=s.id,A=new Jr(YV)),d.add(A)),A.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(o=0;o<h.length;o++)f.add(h[o]);f.resumeEvents()}function Do(e,t){this._owner=t,this._composite=new Ns(this),this._suspendCount=0,this._collections=u(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},ly(this),this._shouldRecomposite=!1}Object.defineProperties(Do.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Do.prototype.addCollection=function(e,t){u(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),ly(this)};Do.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),ly(this),!0):!1};Do.prototype.removeAllCollections=function(){this._collections.length=0,ly(this)};Do.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Do.prototype.contains=function(e){return this._composite.contains(e)};Do.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Do.prototype.getCollection=function(e){return this._collections[e]};Do.prototype.getCollectionsLength=function(){return this._collections.length};function XV(e,t){return e.indexOf(t)}function cce(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,ly(e)}Do.prototype.raiseCollection=function(e){let t=XV(this._collections,e);cce(this,t,t+1)};Do.prototype.lowerCollection=function(e){let t=XV(this._collections,e);cce(this,t,t-1)};Do.prototype.raiseCollectionToTop=function(e){let t=XV(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),ly(this))};Do.prototype.lowerCollectionToBottom=function(e){let t=XV(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),ly(this))};Do.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Do.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(ly(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Do.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Do.prototype.getById=function(e){return this._composite.getById(e)};Do.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,l,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let h=n[s];ace(this,d,p,h);let A=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(A),u(c)&&(u(l)||(l=o.getById(A),W9(l)),l.merge(c));u(l)||o.removeById(A),l=void 0}let g=t.length;for(s=0;s<g;s++){let h=t[s];sce(this,d,p,h);let A=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(A),u(c)&&(u(l)||(l=o.getById(A),u(l)?W9(l):(YV.id=A,l=new Jr(YV),o.add(l))),l.merge(c));l=void 0}o.resumeEvents()};Do.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),l=c[t],f=!u(l),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(u(g)){let h=g[t];if(u(h)){if(d)if(d=!1,u(h.merge)&&u(h.clone))l=h.clone(l);else{l=h;break}l.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=l};var j9=Do;function q9(){this._removalFunctions=[]}q9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};q9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Io=q9;function K9(e,t){return ee.compare(e.start,t.start)}function Po(e){if(this._intervals=[],this._changedEvent=new _e,u(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Po.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Po.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Po))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Tn.equals(n[o],i[o],t))return!1;return!0};Po.prototype.get=function(e){return this._intervals[e]};Po.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Po.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Po.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Po.prototype.contains=function(e){return this.indexOf(e)>=0};var Y9=new Tn;Po.prototype.indexOf=function(e){let t=this._intervals;Y9.start=e,Y9.stop=e;let n=Mr(t,Y9,K9);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Tn.contains(t[n-1],e)?n-1:~n)};Po.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!u(t)||c.start.equals(t))&&(!u(n)||c.stop.equals(n))&&(!u(i)||c.isStartIncluded===i)&&(!u(r)||c.isStopIncluded===r))return o[s]}};Po.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Mr(n,e,K9);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=ee.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((u(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Tn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Tn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=ee.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Tn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Tn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=ee.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(u(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Tn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Tn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Po.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Mr(t,e,K9);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Tn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Tn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Tn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Tn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Tn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Tn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Po.prototype.intersect=function(e,t,n){let i=new Po,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],l=a[o];if(ee.lessThan(c.stop,l.start))++r;else if(ee.lessThan(l.stop,c.start))++o;else{if(u(n)||u(t)&&t(c.data,l.data)||!u(t)&&l.data===c.data){let f=Tn.intersect(c,l,new Tn,n);f.isEmpty||i.addInterval(f,t)}ee.lessThan(c.stop,l.stop)||c.stop.equals(l.stop)&&!c.isStopIncluded&&l.isStopIncluded?++r:++o}}return i};Po.fromJulianDateArray=function(e,t){u(t)||(t=new Po);let n=e.julianDates,i=n.length,r=e.dataCallback,o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),l,f=0;a&&(++f,l=new Tn({start:ze.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),l.data=u(r)?r(l,t.length):t.length,t.addInterval(l));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];l=new Tn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),l.data=u(r)?r(l,t.length):t.length,t.addInterval(l),p=g}return c&&(l=new Tn({start:n[i-1],stop:ze.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),l.data=u(r)?r(l,t.length):t.length,t.addInterval(l)),t};var rc=new Qh,CR=[0,31,28,31,30,31,30,31,31,30,31,30,31];function X9(e,t,n){u(n)||(n=new ee),ee.toGregorianDate(e,rc);let i=rc.millisecond+t.millisecond,r=rc.second+t.second,o=rc.minute+t.minute,s=rc.hour+t.hour,a=rc.day+t.day,c=rc.month+t.month,l=rc.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),CR[2]=$h(l)?29:28;a>CR[c]||c>=13;)a>CR[c]&&(a-=CR[c],++c),c>=13&&(--c,l+=Math.floor(c/12),c=c%12,++c),CR[2]=$h(l)?29:28;return rc.millisecond=i,rc.second=r,rc.minute=o,rc.hour=s,rc.day=a,rc.month=c,rc.year=l,ee.fromGregorianDate(rc,n)}var xWe=new ee,CWe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function lce(e,t){if(!u(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(CWe);if(!u(n))return!1;if(u(n[1])&&(t.year=Number(n[1].replace(",","."))),u(n[2])&&(t.month=Number(n[2].replace(",","."))),u(n[3])&&(t.day=Number(n[3].replace(",","."))*7),u(n[4])&&(t.day+=Number(n[4].replace(",","."))),u(n[5])&&(t.hour=Number(n[5].replace(",","."))),u(n[6])&&(t.minute=Number(n[6].replace(",","."))),u(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,xWe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var TR=new Qh;Po.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=[];if(!lce(n[2],TR))o.push(i,r);else{let s=ee.clone(i);for(o.push(s);ee.compare(s,r)<0;)s=X9(s,TR),ee.compare(r,s)<=0&&ee.clone(r,s),o.push(s)}return Po.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Po.fromIso8601DateArray=function(e,t){return Po.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Po.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=y(e.relativeToPrevious,!1),o=[],s,a,c=i.length;for(let l=0;l<c;++l)(lce(i[l],TR)||l===0)&&(r&&u(a)?s=X9(a,TR):s=X9(n,TR),o.push(s),a=s);return Po.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Oo=Po;function TWe(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);u(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function lx(){this._eventHelper=new Io,this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(lx.prototype._intervalsChanged,this)}Object.defineProperties(lx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});lx.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(u(n))return n.getValue(e,t)};lx.prototype.equals=function(e){return this===e||e instanceof lx&&this._intervals.equals(e._intervals,q.equals)};lx.prototype._intervalsChanged=function(){TWe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var oc=lx;function uy(){this._definitionChanged=new _e,this._composite=new oc,this._composite.definitionChanged.addEventListener(uy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(uy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});uy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(u(t))return t.getType(e)};uy.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(u(n))return n.getValue(e,t)};uy.prototype.equals=function(e){return this===e||e instanceof uy&&this._composite.equals(e._composite,q.equals)};uy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var BE=uy;function fy(e){this._referenceFrame=y(e,ar.FIXED),this._definitionChanged=new _e,this._composite=new oc,this._composite.definitionChanged.addEventListener(fy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(fy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});fy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};fy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(u(i))return i.getValueInReferenceFrame(e,t,n)};fy.prototype.equals=function(e){return this===e||e instanceof fy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};fy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var na=fy;var EWe={ROUNDED:0,MITERED:1,BEVELED:2},Ri=Object.freeze(EWe);var ia=[new m,new m],bWe=new m,SWe=new m,vWe=new m,wWe=new m,DWe=new m,IWe=new m,PWe=new m,OWe=new m,MWe=new m,LE=new m,KV=new m,ER={},J9=new he;function RWe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];J9=t.cartesianToCartographic(r,J9),n[i]=J9.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function Z9(e,t,n,i){let r=e[0],o=e[1],s=m.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),l;if(t===n){for(l=0;l<a;l++)c[l]=t;return c.push(n),c}let d=(n-t)/a;for(l=1;l<a;l++){let p=t+l*d;c[l]=p}return c[0]=t,c.push(n),c}var JV=new m,ZV=new m;function BWe(e,t,n,i){let r=new Aa(n,i),o=r.projectPointOntoPlane(m.add(n,e,JV),JV),s=r.projectPointOntoPlane(m.add(n,t,ZV),ZV),a=H.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var LWe=new m(-1,0,0),ux=new N,NWe=new N,Q9=new Q,FWe=Q.IDENTITY.clone(),UWe=new m,VWe=new oe,uce=new m;function f_(e,t,n,i,r,o,s,a){let c=UWe,l=VWe;ux=Mt.eastNorthUpToFixedFrame(e,r,ux),c=N.multiplyByPointAsVector(ux,LWe,c),c=m.normalize(c,c);let f=BWe(c,t,e,r);Q9=Q.fromRotationZ(f,Q9),uce.z=o,ux=N.multiplyTransformation(ux,N.fromRotationTranslation(Q9,uce,NWe),ux);let d=FWe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)l=m.fromArray(n,g,l),l=Q.multiplyByVector(d,l,l),l=N.multiplyByPoint(ux,l,l),i.push(l.x,l.y,l.z);return i}var kWe=new m;function $9(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,kWe);i=f_(c,t,n,i,r,o[a/3],s,1)}return i}function zWe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let l=a.x-o,f=a.y-s;i[r++]=l,i[r++]=0,i[r++]=f,i[r++]=l,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s,i}function fce(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var dce=new Le,mce=new m,hce=new Q;function pce(e,t,n,i,r,o,s,a,c,l){let f=m.angleBetween(m.subtract(t,e,LE),m.subtract(n,e,KV)),d=i===Ri.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=Q.fromQuaternion(Le.fromAxisAngle(m.negate(e,LE),f/(d+1),dce),hce):p=Q.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),dce),hce);let g,h;if(t=m.clone(t,mce),d>0){let A=l?2:1;for(let x=0;x<d;x++)t=Q.multiplyByVector(p,t,t),g=m.subtract(t,e,LE),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,KV),s=f_(h,g,a,s,o,c,1,A)}else g=m.subtract(t,e,LE),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,KV),s=f_(h,g,a,s,o,c,1,1),n=m.clone(n,mce),g=m.subtract(n,e,LE),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(n,KV),s=f_(h,g,a,s,o,c,1,1);return s}ER.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];H.equals(o,s)||n.push(s)}return n};ER.angleIsGreaterThanPi=function(e,t,n,i){let r=new Aa(n,i),o=r.projectPointOntoPlane(m.add(n,e,JV),JV),s=r.projectPointOntoPlane(m.add(n,t,ZV),ZV);return s.x*o.y-s.y*o.x>=0};var HWe=new m,GWe=new m;ER.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=RWe(e,o),a=i._granularity,c=i._cornerType,l=r?zWe(t,n):fce(t,n),f=r?fce(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],A=r?[]:void 0,x=bWe,C=SWe,T=vWe,E=wWe,S=DWe,w=IWe,D=PWe,M=OWe,O=MWe,B=e[0],L=e[1];E=o.geodeticSurfaceNormal(B,E),x=m.subtract(L,B,x),x=m.normalize(x,x),M=m.cross(E,x,M),M=m.normalize(M,M);let _=s[0],b=s[1];r&&(A=f_(B,M,f,A,o,_+d,1,1)),O=m.clone(B,O),B=L,C=m.negate(x,C);let v,I;for(let k=1;k<g-1;k++){let V=r?2:1;if(L=e[k+1],B.equals(L)){Ot("Positions are too close and are considered equivalent with rounding error.");continue}x=m.subtract(L,B,x),x=m.normalize(x,x),T=m.add(x,C,T),T=m.normalize(T,T),E=o.geodeticSurfaceNormal(B,E);let G=m.multiplyByScalar(E,m.dot(x,E),HWe);m.subtract(x,G,G),m.normalize(G,G);let U=m.multiplyByScalar(E,m.dot(C,E),GWe);if(m.subtract(C,U,U),m.normalize(U,U),!P.equalsEpsilon(Math.abs(m.dot(G,U)),1,P.EPSILON7)){T=m.cross(T,E,T),T=m.cross(E,T,T),T=m.normalize(T,T);let W=1/Math.max(.25,m.magnitude(m.cross(T,C,LE))),J=ER.angleIsGreaterThanPi(x,C,B,o);J?(S=m.add(B,m.multiplyByScalar(T,W*p,T),S),w=m.add(S,m.multiplyByScalar(M,p,w),w),ia[0]=m.clone(O,ia[0]),ia[1]=m.clone(w,ia[1]),v=Z9(ia,_+d,b+d,a),I=Mi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=$9(I,M,l,h,o,v,1),M=m.cross(E,x,M),M=m.normalize(M,M),D=m.add(S,m.multiplyByScalar(M,p,D),D),c===Ri.ROUNDED||c===Ri.BEVELED?pce(S,w,D,c,J,o,h,l,b+d,r):(T=m.negate(T,T),h=f_(B,T,l,h,o,b+d,W,V)),O=m.clone(D,O)):(S=m.add(B,m.multiplyByScalar(T,W*p,T),S),w=m.add(S,m.multiplyByScalar(M,-p,w),w),ia[0]=m.clone(O,ia[0]),ia[1]=m.clone(w,ia[1]),v=Z9(ia,_+d,b+d,a),I=Mi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=$9(I,M,l,h,o,v,1),M=m.cross(E,x,M),M=m.normalize(M,M),D=m.add(S,m.multiplyByScalar(M,-p,D),D),c===Ri.ROUNDED||c===Ri.BEVELED?pce(S,w,D,c,J,o,h,l,b+d,r):h=f_(B,T,l,h,o,b+d,W,V),O=m.clone(D,O)),C=m.negate(x,C)}else h=f_(O,M,l,h,o,_+d,1,1),O=B;_=b,b=s[k+1],B=L}ia[0]=m.clone(O,ia[0]),ia[1]=m.clone(B,ia[1]),v=Z9(ia,_+d,b+d,a),I=Mi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=$9(I,M,l,h,o,v,1),r&&(A=f_(B,M,f,A,o,b+d,1,1)),g=h.length;let R=r?g+A.length:g,F=new Float64Array(R);return F.set(h),r&&F.set(A,g),F};var Hd=ER;var tW={},NE=new m,xce=new m,WWe=new m,_ce=new m,Gc=[new m,new m],Cce=new m,Tce=new m,Ece=new m,jWe=new m,qWe=new m,YWe=new m,XWe=new m,KWe=new m,JWe=new m,ZWe=new m,gce=new Le,yce=new Q;function QV(e,t,n,i,r){let o=m.angleBetween(m.subtract(t,e,NE),m.subtract(n,e,xce)),s=i===Ri.BEVELED?1:Math.ceil(o/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let l;r?l=Q.fromQuaternion(Le.fromAxisAngle(m.negate(e,NE),o/s,gce),yce):l=Q.fromQuaternion(Le.fromAxisAngle(e,o/s,gce),yce);let f=0;t=m.clone(t,NE);for(let d=0;d<s;d++)t=Q.multiplyByVector(l,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function QWe(e){let t=Cce,n=Tce,i=Ece,r=e[1];n=m.fromArray(e[1],r.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let o=QV(t,n,i,Ri.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(r,0,i),t=m.midpoint(n,i,t);let c=QV(t,n,i,Ri.ROUNDED,!1);return[o,c]}function Ace(e,t,n,i){let r=NE;return i?r=m.add(e,t,r):(t=m.negate(t,t),r=m.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function eW(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=m.multiplyByScalar(t,n,NE),a=m.negate(s,xce),c=0,l=e.length-1;for(let f=0;f<e.length;f+=3){let d=m.fromArray(e,f,WWe),p=m.add(d,a,_ce);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=m.add(d,s,_ce);o[l--]=g.z,o[l--]=g.y,o[l--]=g.x}return i.push(r,o),i}tW.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;u(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),u(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var $We=new m,e7e=new m;tW.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=Cce,c=Tce,l=Ece,f=jWe,d=qWe,p=YWe,g=XWe,h=KWe,A=JWe,x=ZWe,C=[],T=s?[]:void 0,E=s?[]:void 0,S=n[0],w=n[1];c=m.normalize(m.subtract(w,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=m.normalize(m.cross(a,c,f),f),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),g=m.clone(S,g),S=w,l=m.negate(c,l);let D,M=[],O,B=n.length;for(O=1;O<B-1;O++){a=i.geodeticSurfaceNormal(S,a),w=n[O+1],c=m.normalize(m.subtract(w,S,c),c),d=m.normalize(m.add(c,l,d),d);let _=m.multiplyByScalar(a,m.dot(c,a),$We);m.subtract(c,_,_),m.normalize(_,_);let b=m.multiplyByScalar(a,m.dot(l,a),e7e);if(m.subtract(l,b,b),m.normalize(b,b),!P.equalsEpsilon(Math.abs(m.dot(_,b)),1,P.EPSILON7)){d=m.cross(d,a,d),d=m.cross(a,d,d),d=m.normalize(d,d);let I=r/Math.max(.25,m.magnitude(m.cross(d,l,NE))),R=Hd.angleIsGreaterThanPi(c,l,S,i);d=m.multiplyByScalar(d,I,d),R?(h=m.add(S,d,h),x=m.add(h,m.multiplyByScalar(f,r,x),x),A=m.add(h,m.multiplyByScalar(f,r*2,A),A),Gc[0]=m.clone(g,Gc[0]),Gc[1]=m.clone(x,Gc[1]),D=Mi.generateArc({positions:Gc,granularity:t,ellipsoid:i}),C=eW(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=m.clone(A,p),f=m.normalize(m.cross(a,c,f),f),A=m.add(h,m.multiplyByScalar(f,r*2,A),A),g=m.add(h,m.multiplyByScalar(f,r,g),g),o===Ri.ROUNDED||o===Ri.BEVELED?M.push({leftPositions:QV(h,p,A,o,R)}):M.push({leftPositions:Ace(S,m.negate(d,d),A,R)})):(A=m.add(S,d,A),x=m.add(A,m.negate(m.multiplyByScalar(f,r,x),x),x),h=m.add(A,m.negate(m.multiplyByScalar(f,r*2,h),h),h),Gc[0]=m.clone(g,Gc[0]),Gc[1]=m.clone(x,Gc[1]),D=Mi.generateArc({positions:Gc,granularity:t,ellipsoid:i}),C=eW(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=m.clone(h,p),f=m.normalize(m.cross(a,c,f),f),h=m.add(A,m.negate(m.multiplyByScalar(f,r*2,h),h),h),g=m.add(A,m.negate(m.multiplyByScalar(f,r,g),g),g),o===Ri.ROUNDED||o===Ri.BEVELED?M.push({rightPositions:QV(A,p,h,o,R)}):M.push({rightPositions:Ace(S,d,h,R)})),l=m.negate(c,l)}S=w}a=i.geodeticSurfaceNormal(S,a),Gc[0]=m.clone(g,Gc[0]),Gc[1]=m.clone(S,Gc[1]),D=Mi.generateArc({positions:Gc,granularity:t,ellipsoid:i}),C=eW(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z));let L;return o===Ri.ROUNDED&&(L=QWe(C)),{positions:C,corners:M,lefts:T,normals:E,endPositions:L}};var ki=tW;var vce=new m,wce=new m,$V=new m,ek=new m,t7e=new m,Dce=new m,dy=new m,FE=new m;function Ice(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Gd(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,l=m.normalize(m.cross(n,t,dy),dy);o.normal&&ki.addAttribute(s,t,i,r),o.tangent&&ki.addAttribute(a,l,i,r),o.bitangent&&ki.addAttribute(c,n,i,r)}function Pce(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new mn,l,f=0,d=0,p,g=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,f+=h,g+=h*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<r.length;p++){l=r[p];let Z=r[p].leftPositions;u(Z)?(h=Z.length,f+=h,g+=h):(h=r[p].rightPositions.length,d+=h,g+=h)}let A=u(o),x;A&&(x=o[0].length-3,f+=x,d+=x,x/=3,g+=x*6);let C=f+d,T=new Float64Array(C),E=t.normal?new Float32Array(C):void 0,S=t.tangent?new Float32Array(C):void 0,w=t.bitangent?new Float32Array(C):void 0,D={normals:E,tangents:S,bitangents:w},M=0,O=C-1,B,L,_,b,v=vce,I=wce,R,F,k=x/2,V=Fe.createTypedArray(C/3,g),G=0;if(A){F=$V,R=ek;let Z=o[0];for(v=m.fromArray(a,0,v),I=m.fromArray(s,0,I),p=0;p<k;p++)F=m.fromArray(Z,(k-1-p)*3,F),R=m.fromArray(Z,(k+p)*3,R),ki.addAttribute(T,R,M),ki.addAttribute(T,F,void 0,O),Gd(D,v,I,M,O,t),L=M/3,b=L+1,B=(O-2)/3,_=B-1,V[G++]=B,V[G++]=L,V[G++]=_,V[G++]=_,V[G++]=L,V[G++]=b,M+=3,O-=3}let U=0,Y=0,W=i[U++],J=i[U++];T.set(W,M),T.set(J,O-J.length+1),I=m.fromArray(s,Y,I);let j,K;for(h=J.length-3,p=0;p<h;p+=3)j=n.geodeticSurfaceNormal(m.fromArray(W,p,dy),dy),K=n.geodeticSurfaceNormal(m.fromArray(J,h-p,FE),FE),v=m.normalize(m.add(j,K,v),v),Gd(D,v,I,M,O,t),L=M/3,b=L+1,B=(O-2)/3,_=B-1,V[G++]=B,V[G++]=L,V[G++]=_,V[G++]=_,V[G++]=L,V[G++]=b,M+=3,O-=3;for(j=n.geodeticSurfaceNormal(m.fromArray(W,h,dy),dy),K=n.geodeticSurfaceNormal(m.fromArray(J,h,FE),FE),v=m.normalize(m.add(j,K,v),v),Y+=3,p=0;p<r.length;p++){let Z;l=r[p];let me=l.leftPositions,ye=l.rightPositions,se,pe,Ae=Dce,De=$V,Ce=ek;if(v=m.fromArray(a,Y,v),u(me)){for(Gd(D,v,I,void 0,O,t),O-=3,se=b,pe=_,Z=0;Z<me.length/3;Z++)Ae=m.fromArray(me,Z*3,Ae),V[G++]=se,V[G++]=pe-Z-1,V[G++]=pe-Z,ki.addAttribute(T,Ae,void 0,O),De=m.fromArray(T,(pe-Z-1)*3,De),Ce=m.fromArray(T,se*3,Ce),I=m.normalize(m.subtract(De,Ce,I),I),Gd(D,v,I,void 0,O,t),O-=3;Ae=m.fromArray(T,se*3,Ae),De=m.subtract(m.fromArray(T,pe*3,De),Ae,De),Ce=m.subtract(m.fromArray(T,(pe-Z)*3,Ce),Ae,Ce),I=m.normalize(m.add(De,Ce,I),I),Gd(D,v,I,M,void 0,t),M+=3}else{for(Gd(D,v,I,M,void 0,t),M+=3,se=_,pe=b,Z=0;Z<ye.length/3;Z++)Ae=m.fromArray(ye,Z*3,Ae),V[G++]=se,V[G++]=pe+Z,V[G++]=pe+Z+1,ki.addAttribute(T,Ae,M),De=m.fromArray(T,se*3,De),Ce=m.fromArray(T,(pe+Z)*3,Ce),I=m.normalize(m.subtract(De,Ce,I),I),Gd(D,v,I,M,void 0,t),M+=3;Ae=m.fromArray(T,se*3,Ae),De=m.subtract(m.fromArray(T,(pe+Z)*3,De),Ae,De),Ce=m.subtract(m.fromArray(T,pe*3,Ce),Ae,Ce),I=m.normalize(m.negate(m.add(Ce,De,I),I),I),Gd(D,v,I,void 0,O,t),O-=3}for(W=i[U++],J=i[U++],W.splice(0,3),J.splice(J.length-3,3),T.set(W,M),T.set(J,O-J.length+1),h=J.length-3,Y+=3,I=m.fromArray(s,Y,I),Z=0;Z<J.length;Z+=3)j=n.geodeticSurfaceNormal(m.fromArray(W,Z,dy),dy),K=n.geodeticSurfaceNormal(m.fromArray(J,h-Z,FE),FE),v=m.normalize(m.add(j,K,v),v),Gd(D,v,I,M,O,t),b=M/3,L=b-1,_=(O-2)/3,B=_+1,V[G++]=B,V[G++]=L,V[G++]=_,V[G++]=_,V[G++]=L,V[G++]=b,M+=3,O-=3;M-=3,O+=3}if(v=m.fromArray(a,a.length-3,v),Gd(D,v,I,M,O,t),A){M+=3,O-=3,F=$V,R=ek;let Z=o[1];for(p=0;p<k;p++)F=m.fromArray(Z,(x-p-1)*3,F),R=m.fromArray(Z,p*3,R),ki.addAttribute(T,F,void 0,O),ki.addAttribute(T,R,M),Gd(D,v,I,M,O,t),b=M/3,L=b-1,_=(O-2)/3,B=_+1,V[G++]=B,V[G++]=L,V[G++]=_,V[G++]=_,V[G++]=L,V[G++]=b,M+=3,O-=3}if(c.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let Z=new Float32Array(C/3*2),me,ye,se=0;if(A){f/=3,d/=3;let pe=Math.PI/(x+1);ye=1/(f-x+1),me=1/(d-x+1);let Ae,De=x/2;for(p=De+1;p<x+1;p++)Ae=P.PI_OVER_TWO+pe*p,Z[se++]=me*(1+Math.cos(Ae)),Z[se++]=.5*(1+Math.sin(Ae));for(p=1;p<d-x+1;p++)Z[se++]=p*me,Z[se++]=0;for(p=x;p>De;p--)Ae=P.PI_OVER_TWO-p*pe,Z[se++]=1-me*(1+Math.cos(Ae)),Z[se++]=.5*(1+Math.sin(Ae));for(p=De;p>0;p--)Ae=P.PI_OVER_TWO-pe*p,Z[se++]=1-ye*(1+Math.cos(Ae)),Z[se++]=.5*(1+Math.sin(Ae));for(p=f-x;p>0;p--)Z[se++]=p*ye,Z[se++]=1;for(p=1;p<De+1;p++)Ae=P.PI_OVER_TWO+pe*p,Z[se++]=ye*(1+Math.cos(Ae)),Z[se++]=.5*(1+Math.sin(Ae))}else{for(f/=3,d/=3,ye=1/(f-1),me=1/(d-1),p=0;p<d;p++)Z[se++]=p*me,Z[se++]=0;for(p=f;p>0;p--)Z[se++]=(p-1)*ye,Z[se++]=1}c.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Z})}return t.normal&&(c.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function n7e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,l;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=vce,h=wce,A=$V,x=ek,C=t7e,T=Dce,E=c;for(l=0;l<s;l+=3){let S=E+c;g=m.fromArray(n,l,g),h=m.fromArray(n,l+s,h),A=m.fromArray(n,(l+3)%s,A),h=m.subtract(h,g,h),A=m.subtract(A,g,A),x=m.normalize(m.cross(h,A,x),x),t.normal&&(ki.addAttribute(f,x,S),ki.addAttribute(f,x,S+3),ki.addAttribute(f,x,E),ki.addAttribute(f,x,E+3)),(t.tangent||t.bitangent)&&(T=m.fromArray(i,l,T),t.bitangent&&(ki.addAttribute(p,T,S),ki.addAttribute(p,T,S+3),ki.addAttribute(p,T,E),ki.addAttribute(p,T,E+3)),t.tangent&&(C=m.normalize(m.cross(T,x,C),C),ki.addAttribute(d,C,S),ki.addAttribute(d,C,S+3),ki.addAttribute(d,C,E),ki.addAttribute(d,C,E+3))),E+=6}if(t.normal){for(f.set(i),l=0;l<s;l+=3)f[l+s]=-i[l],f[l+s+1]=-i[l+1],f[l+s+2]=-i[l+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;d.set(S),d.set(S,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],l=2;l<a;l+=2){let h=f[l],A=f[l+1];d[p++]=h,d[p++]=A,d[p++]=h,d[p++]=A}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function nW(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function i7e(e,t){let n=new Pe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=ki.computePositions(e),o=Pce(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,l=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let h=new Float64Array(d*4);f=ui.scaleToGeodeticHeight(f,s,i),h=nW(f,0,h),g=ui.scaleToGeodeticHeight(g,a,i),h=nW(g,d*2,h),p.set(f),p.set(g,d),p.set(h,d*2),c.position.values=p,c=n7e(c,t);let A,x=d/3;if(e.shadowVolume){let B=c.normal.values;d=B.length;let L=new Float32Array(d*6);for(A=0;A<d;A++)B[A]=-B[A];L.set(B,d),L=nW(B,d*4,L),c.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(u(e.offsetAttribute)){let B=new Uint8Array(x*6);if(e.offsetAttribute===on.TOP)B=B.fill(1,0,x).fill(1,x*2,x*4);else{let L=e.offsetAttribute===on.NONE?0:1;B=B.fill(L)}c.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}let C=l.length,T=x+x,E=Fe.createTypedArray(p.length/3,C*2+T*3);E.set(l);let S=C;for(A=0;A<C;A+=3){let B=l[A],L=l[A+1],_=l[A+2];E[S++]=_+x,E[S++]=L+x,E[S++]=B+x}let w,D,M,O;for(A=0;A<T;A+=2)w=A+T,D=w+T,M=w+1,O=D+1,E[S++]=w,E[S++]=D,E[S++]=M,E[S++]=M,E[S++]=D,E[S++]=O;return{attributes:c,indices:E}}var bce=new m,bR=new m,bf=new he;function Sce(e,t,n,i,r,o){let s=m.subtract(t,e,bce);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,bR),c=m.cross(s,a,bce);m.multiplyByScalar(c,i,c);let l=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;m.add(e,c,bR),n.cartesianToCartographic(bR,bf);let g=bf.latitude,h=bf.longitude;l=Math.min(l,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),m.subtract(e,c,bR),n.cartesianToCartographic(bR,bf),g=bf.latitude,h=bf.longitude,l=Math.min(l,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),r.latitude=l,r.longitude=f,o.latitude=d,o.longitude=p}var Ef=new m,SR=new m,vl=new he,wl=new he;function Oce(e,t,n,i,r){e=Ice(e,t);let o=Sr(e,m.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ce;let a=n*.5;vl.latitude=Number.POSITIVE_INFINITY,vl.longitude=Number.POSITIVE_INFINITY,wl.latitude=Number.NEGATIVE_INFINITY,wl.longitude=Number.NEGATIVE_INFINITY;let c,l;if(i===Ri.ROUNDED){let p=o[0];m.subtract(p,o[1],Ef),m.normalize(Ef,Ef),m.multiplyByScalar(Ef,a,Ef),m.add(p,Ef,SR),t.cartesianToCartographic(SR,bf),c=bf.latitude,l=bf.longitude,vl.latitude=Math.min(vl.latitude,c),vl.longitude=Math.min(vl.longitude,l),wl.latitude=Math.max(wl.latitude,c),wl.longitude=Math.max(wl.longitude,l)}for(let p=0;p<s-1;++p)Sce(o[p],o[p+1],t,a,vl,wl);let f=o[s-1];m.subtract(f,o[s-2],Ef),m.normalize(Ef,Ef),m.multiplyByScalar(Ef,a,Ef),m.add(f,Ef,SR),Sce(f,SR,t,a,vl,wl),i===Ri.ROUNDED&&(t.cartesianToCartographic(SR,bf),c=bf.latitude,l=bf.longitude,vl.latitude=Math.min(vl.latitude,c),vl.longitude=Math.min(vl.longitude,l),wl.latitude=Math.max(wl.latitude,c),wl.longitude=Math.max(wl.longitude,l));let d=u(r)?r:new ce;return d.north=wl.latitude,d.south=vl.latitude,d.east=wl.longitude,d.west=vl.longitude,d}function m_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Ri.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+re.packedLength+Pe.packedLength+7}m_.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Mce=re.clone(re.UNIT_SPHERE),Rce=new Pe,d_={positions:void 0,ellipsoid:Mce,vertexFormat:Rce,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};m_.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)r[h]=m.unpack(e,t);let o=re.unpack(e,t,Mce);t+=re.packedLength;let s=Pe.unpack(e,t,Rce);t+=Pe.packedLength;let a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return u(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=l,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(d_.positions=r,d_.width=a,d_.height=c,d_.extrudedHeight=l,d_.cornerType=f,d_.granularity=d,d_.shadowVolume=p,d_.offsetAttribute=g===-1?void 0:g,new m_(d_))};m_.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,r=y(e.ellipsoid,re.WGS84),o=y(e.cornerType,Ri.ROUNDED);return Oce(n,r,i,o,t)};m_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Ice(t,i);let r=Sr(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c=e._vertexFormat,l={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)l.height=o,l.extrudedHeight=s,l.shadowVolume=e._shadowVolume,l.offsetAttribute=e._offsetAttribute,f=i7e(l,c);else{let g=ki.computePositions(l);if(f=Pce(g,c,i),f.attributes.position.values=ui.scaleToGeodeticHeight(f.attributes.position.values,o,i),u(e._offsetAttribute)){let h=e._offsetAttribute===on.NONE?0:1,A=f.attributes.position.values.length,x=new Uint8Array(A/3).fill(h);f.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new dt({attributes:d,indices:f.indices,primitiveType:Be.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};m_.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new m_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(m_.prototype,{rectangle:{get:function(){return u(this._rectangle)||(this._rectangle=Oce(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var fx=m_;var Bce=new m,Lce=new m,r7e=new m;function o7e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Nce(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new mn,a,c=0,l=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,l+=i[f+1].length-3;for(c+=3,l+=3,f=0;f<r.length;f++){a=r[f];let R=r[f].leftPositions;u(R)?(p=R.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,l+=p,d+=p/3*2)}let g=u(o),h;g&&(h=o[0].length-3,c+=h,l+=h,h/=3,d+=h*4);let A=c+l,x=new Float64Array(A),C=0,T=A-1,E,S,w,D,M,O,B=h/2,L=Fe.createTypedArray(A/3,d+4),_=0;if(L[_++]=C/3,L[_++]=(T-2)/3,g){n.push(C/3),O=Bce,M=Lce;let R=o[0];for(f=0;f<B;f++)O=m.fromArray(R,(B-1-f)*3,O),M=m.fromArray(R,(B+f)*3,M),ki.addAttribute(x,M,C),ki.addAttribute(x,O,void 0,T),S=C/3,D=S+1,E=(T-2)/3,w=E-1,L[_++]=E,L[_++]=w,L[_++]=S,L[_++]=D,C+=3,T-=3}let b=0,v=i[b++],I=i[b++];for(x.set(v,C),x.set(I,T-I.length+1),p=I.length-3,n.push(C/3,(T-2)/3),f=0;f<p;f+=3)S=C/3,D=S+1,E=(T-2)/3,w=E-1,L[_++]=E,L[_++]=w,L[_++]=S,L[_++]=D,C+=3,T-=3;for(f=0;f<r.length;f++){let R;a=r[f];let F=a.leftPositions,k=a.rightPositions,V,G=r7e;if(u(F)){for(T-=3,V=w,n.push(D),R=0;R<F.length/3;R++)G=m.fromArray(F,R*3,G),L[_++]=V-R-1,L[_++]=V-R,ki.addAttribute(x,G,void 0,T),T-=3;n.push(V-Math.floor(F.length/6)),t===Ri.BEVELED&&n.push((T-2)/3+1),C+=3}else{for(C+=3,V=D,n.push(w),R=0;R<k.length/3;R++)G=m.fromArray(k,R*3,G),L[_++]=V+R,L[_++]=V+R+1,ki.addAttribute(x,G,C),C+=3;n.push(V+Math.floor(k.length/6)),t===Ri.BEVELED&&n.push(C/3-1),T-=3}for(v=i[b++],I=i[b++],v.splice(0,3),I.splice(I.length-3,3),x.set(v,C),x.set(I,T-I.length+1),p=I.length-3,R=0;R<I.length;R+=3)D=C/3,S=D-1,w=(T-2)/3,E=w+1,L[_++]=E,L[_++]=w,L[_++]=S,L[_++]=D,C+=3,T-=3;C-=3,T+=3,n.push(C/3,(T-2)/3)}if(g){C+=3,T-=3,O=Bce,M=Lce;let R=o[1];for(f=0;f<B;f++)O=m.fromArray(R,(h-f-1)*3,O),M=m.fromArray(R,f*3,M),ki.addAttribute(x,O,void 0,T),ki.addAttribute(x,M,C),D=C/3,S=D-1,w=(T-2)/3,E=w+1,L[_++]=E,L[_++]=w,L[_++]=S,L[_++]=D,C+=3,T-=3;n.push(C/3)}else n.push(C/3,(T-2)/3);return L[_++]=C/3,L[_++]=(T-2)/3,s.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:L,wallIndices:n}}function s7e(e){let t=e.ellipsoid,n=ki.computePositions(e),i=Nce(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,l=a.position.values,f=l.length,d=new Float64Array(f);d.set(l);let p=new Float64Array(f*2);if(l=ui.scaleToGeodeticHeight(l,o,t),d=ui.scaleToGeodeticHeight(d,s,t),p.set(l),p.set(d,f),a.position.values=p,f/=3,u(e.offsetAttribute)){let E=new Uint8Array(f*2);if(e.offsetAttribute===on.TOP)E=E.fill(1,0,f);else{let S=e.offsetAttribute===on.NONE?0:1;E=E.fill(S)}a.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}let g,h=c.length,A=Fe.createTypedArray(p.length/3,(h+r.length)*2);A.set(c);let x=h;for(g=0;g<h;g+=2){let E=c[g],S=c[g+1];A[x++]=E+f,A[x++]=S+f}let C,T;for(g=0;g<r.length;g++)C=r[g],T=C+f,A[x++]=C,A[x++]=T;return{attributes:a,indices:A}}function vR(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Ri.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+re.packedLength+6}vR.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Fce=re.clone(re.UNIT_SPHERE),my={positions:void 0,ellipsoid:Fce,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};vR.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)r[p]=m.unpack(e,t);let o=re.unpack(e,t,Fce);t+=re.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t];return u(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=l,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(my.positions=r,my.width=s,my.height=a,my.extrudedHeight=c,my.cornerType=l,my.granularity=f,my.offsetAttribute=d===-1?void 0:d,new vR(my))};vR.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=o7e(t,i);let r=Sr(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},l;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,l=s7e(c);else{let p=ki.computePositions(c);if(l=Nce(p,c.cornerType),l.attributes.position.values=ui.scaleToGeodeticHeight(l.attributes.position.values,o,i),u(e._offsetAttribute)){let g=l.attributes.position.values.length,h=e._offsetAttribute===on.NONE?0:1,A=new Uint8Array(g/3).fill(h);l.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let f=l.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new dt({attributes:f,indices:l.indices,primitiveType:Be.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var wR=vR;var a7e=new ei(0);function Wc(e){ci.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}u(Object.create)&&(Wc.prototype=Object.create(ci.prototype),Wc.prototype.constructor=Wc);Object.defineProperties(Wc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Wc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!u(t.height)&&!u(t.extrudedHeight)&&Oc.isSupported(this._scene)};Wc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||u(n)&&n!==t};Wc.prototype._computeCenter=fe.throwInstantiationError;Wc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!u(r))return;u(r.zIndex)&&(u(r.height)||u(r.extrudedHeight))&&Ot(Ot.geometryZIndex),this._zIndex=y(r.zIndex,a7e),u(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(u(o)||u(s)){let a=new gd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new dA(this._scene,a,o,s)}};Wc.prototype.destroy=function(){u(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ci.prototype.destroy.call(this)};Wc.getGeometryHeight=function(e,t){if(!u(e)){t!==je.NONE&&Ot(Ot.geometryHeightReference);return}return t!==je.CLAMP_TO_GROUND?e:0};Wc.getGeometryExtrudedHeight=function(e,t){if(!u(e)){t!==je.NONE&&Ot(Ot.geometryExtrudedHeightReference);return}return t!==je.CLAMP_TO_GROUND?e:Wc.CLAMP_TO_GROUND};Wc.CLAMP_TO_GROUND="clamp";Wc.computeGeometryOffsetAttribute=function(e,t,n,i){(!u(e)||!u(t))&&(t=je.NONE),(!u(n)||!u(i))&&(i=je.NONE);let r=0;if(t!==je.NONE&&r++,i===je.RELATIVE_TO_GROUND&&r++,r===2)return on.ALL;if(r===1)return on.TOP};var Kn=Wc;var Uce=new z,Vce=m.ZERO,kce=new m,zce=new ce;function c7e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Wd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new c7e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}u(Object.create)&&(Wd.prototype=Object.create(Kn.prototype),Wd.prototype.constructor=Wd);Wd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Uce)),u(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return u(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Vce,kce))),new Ct({id:t,geometry:new fx(this._options),attributes:i})};Wd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Uce),r={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return u(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Vce,kce))),new Ct({id:t,geometry:new wR(this._options),attributes:r})};Wd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!u(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};Wd.prototype._isHidden=function(e,t){return!u(t.positions)||!u(t.width)||ci.prototype._isHidden.call(this,e,t)};Wd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Wd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,ze.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),r=q.getValueOrUndefined(t.extrudedHeight,ze.MINIMUM_VALUE),o=q.getValueOrDefault(t.extrudedHeightReference,ze.MINIMUM_VALUE,je.NONE);u(r)&&!u(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ze.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(ze.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,ze.MINIMUM_VALUE),s.cornerType=q.getValueOrUndefined(t.cornerType,ze.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Kn.getGeometryHeight(n,i),r=Kn.getGeometryExtrudedHeight(r,o),r===Kn.CLAMP_TO_GROUND&&(r=si.getMinimumMaximumHeights(fx.computeRectangle(s,zce)).minimumTerrainHeight),s.extrudedHeight=r};Wd.DynamicGeometryUpdater=UE;function UE(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(UE.prototype=Object.create(ai.prototype),UE.prototype.constructor=UE);UE.prototype._isHidden=function(e,t,n){let i=this._options;return!u(i.positions)||!u(i.width)||ai.prototype._isHidden.call(this,e,t,n)};UE.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,je.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,je.NONE);u(s)&&!u(r)&&(r=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(fx.computeRectangle(i,zce)).minimumTerrainHeight),i.extrudedHeight=s};var DR=Wd;function tk(){fe.throwInstantiationError()}Object.defineProperties(tk.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});tk.prototype.update=function(e){fe.throwInstantiationError()};tk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Mo=tk;function ah(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,u(t)&&(this.cameraPosition=t)}Object.defineProperties(ah.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Hce=new m;ah.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Hce);return rW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};ah.prototype.isScaledSpacePointVisible=function(e){return rW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var l7e=new m;ah.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return u(t)&&t<0&&n.minimumRadius>-t?(r=l7e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),rW(e,r,i)};ah.prototype.computeHorizonCullingPoint=function(e,t,n){return jce(this._ellipsoid,e,t,n)};var Gce=re.clone(re.UNIT_SPHERE);ah.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Wce(this._ellipsoid,n,Gce);return jce(r,e,t,i)};ah.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return qce(this._ellipsoid,e,t,n,i,r)};ah.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Wce(this._ellipsoid,r,Gce);return qce(s,e,t,n,i,o)};var u7e=[];ah.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,u7e),r=ae.fromPoints(i);if(!(m.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var f7e=new m;function Wce(e,t,n){if(u(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,f7e);e=re.fromCartesian3(i,n)}return e}function jce(e,t,n,i){u(i)||(i=new m);let r=Kce(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],l=Yce(e,c,r);if(l<0)return;o=Math.max(o,l)}return Xce(r,o,i)}var nk=new m;function qce(e,t,n,i,r,o){u(o)||(o=new m),i=y(i,3),r=y(r,m.ZERO);let s=Kce(e,t),a=0;for(let c=0,l=n.length;c<l;c+=i){nk.x=n[c]+r.x,nk.y=n[c+1]+r.y,nk.z=n[c+2]+r.z;let f=Yce(e,nk,s);if(f<0)return;a=Math.max(a,f)}return Xce(s,a,o)}function rW(e,t,n){let i=t,r=n,o=m.subtract(e,i,Hce),s=-m.dot(o,i);return!(r<0?s>0:s>r&&s*s/m.magnitudeSquared(o)>r)}var d7e=new m,m7e=new m;function Yce(e,t,n){let i=e.transformPositionToScaledSpace(t,d7e),r=m.magnitudeSquared(i),o=Math.sqrt(r),s=m.divideByScalar(i,o,m7e);r=Math.max(1,r),o=Math.max(1,o);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),l=1/o,f=Math.sqrt(r-1)*l;return 1/(a*l-c*f)}function Xce(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var iW=new m;function Kce(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,iW),m.normalize(iW,iW))}var h_=ah;function Ro(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;u(n)&&(n=Bt.clone(n)),u(i)&&(i=Bt.clone(i)),u(r)&&(r=wt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var Jce=Ro.SHOW_INDEX=0,$ce=Ro.POSITION_INDEX=1,h7e=Ro.COLOR_INDEX=2,p7e=Ro.OUTLINE_COLOR_INDEX=3,_7e=Ro.OUTLINE_WIDTH_INDEX=4,g7e=Ro.PIXEL_SIZE_INDEX=5,y7e=Ro.SCALE_BY_DISTANCE_INDEX=6,A7e=Ro.TRANSLUCENCY_BY_DISTANCE_INDEX=7,x7e=Ro.DISTANCE_DISPLAY_CONDITION_INDEX=8,C7e=Ro.DISABLE_DEPTH_DISTANCE_INDEX=9;Ro.NUMBER_OF_PROPERTIES=10;function Sf(e,t){let n=e._pointPrimitiveCollection;u(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Ro.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Sf(this,Jce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Sf(this,$ce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Sf(this,y7e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Sf(this,A7e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Sf(this,g7e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Sf(this,h7e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Sf(this,p7e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Sf(this,_7e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Sf(this,x7e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Sf(this,C7e))}},id:{get:function(){return this._id},set:function(e){this._id=e,u(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Sf(this,Jce))}}});Ro.prototype.getPickId=function(e){return u(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Ro.prototype._getActualPosition=function(){return this._actualPosition};Ro.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Sf(this,$ce)};var Zce=new oe;Ro._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(N.multiplyByPoint(n,e,Zce),$i.computeActualWgs84Position(t,Zce))};var Qce=new oe;Ro._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,Qce),Qce);return $i.wgs84ToWindowCoordinates(n,r,i)};Ro.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;u(t)||(t=new H);let i=n.modelMatrix,r=Ro._computeScreenSpacePosition(i,this._actualPosition,e,t);if(u(r))return r.y=e.canvas.clientHeight-r.y,r};Ro.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return u(n)||(n=new Ye),n.x=o,n.y=s,n.width=a,n.height=c,n};Ro.prototype.equals=function(e){return this===e||u(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Ro.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Fs=Ro;var hy=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -void main() +// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); + float distance = getDistance(position); - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; + if (outlineWidth > 0.0) + { + // Don't get the outline edge exceed the SDF_EDGE + float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); + float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); + float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); + return vec4(sdfColor.rgb, sdfColor.a * alpha); + } + else + { + float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + return vec4(v_color.rgb, v_color.a * alpha); + } +} +#endif + +void main() +{ + vec4 color = texture(u_atlas, v_textureCoordinates); + +#ifdef SDF + float outlineWidth = v_outlineWidth; + vec4 outlineColor = v_outlineColor; + + // Get the current distance + float distance = getDistance(v_textureCoordinates); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float smoothing = fwidth(distance); + // Get an offset that is approximately half the distance to the neighbor pixels + // 0.354 is approximately half of 1/sqrt(2) + vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); + + // Sample the center point + vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); + + // Sample the 4 neighbors + vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + + // Equally weight the center sample and the 4 neighboring samples + color = (center + color1 + color2 + color3 + color4)/5.0; +#else + // If no derivatives available (IE 10?), just do a single sample + float smoothing = 1.0/32.0; + color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +#endif + + color = czm_gammaCorrect(color); +#else + color = czm_gammaCorrect(color); + color *= czm_gammaCorrect(v_color); +#endif // Fully transparent parts of the billboard are not pickable. #if !defined(OPAQUE) && !defined(TRANSLUCENT) @@ -8540,159 +7676,410 @@ void main() #endif #endif - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); -} -`;var IR=`uniform float u_maxTotalPointSize; - -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance - -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; - -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; - -void main() -{ - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition +#ifdef VECTOR_TILE + color *= u_highlightColor; +#endif + out_FragColor = color; - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; +#ifdef LOG_DEPTH + czm_writeLogDepth(); +#endif - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); +#ifdef FRAGMENT_DEPTH_CHECK + float temp = v_compressed.y; -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; + temp = temp * SHIFT_RIGHT1; - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; + bool enableDepthTest = temp2 != 0.0; + bool applyTranslate = floor(temp) != 0.0; - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif + if (enableDepthTest) { + temp = v_compressed.z; + temp = temp * SHIFT_RIGHT12; - /////////////////////////////////////////////////////////////////////////// + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); - vec4 color; - vec4 outlineColor; - vec4 pickColor; + temp = v_compressed.w; + temp = temp * SHIFT_RIGHT12; - // compressedAttribute0.z => pickColor.rgb + vec2 imageSize; + imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; + imageSize.x = floor(temp); - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); + vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; + adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); - // compressedAttribute0.x => color.rgb + float epsilonEyeDepth = v_compressed.x + czm_epsilon1; + float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); + // negative values go into the screen + if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) + { + float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner + if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) + { + float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner + if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) + { + discard; + } + } + } + } +#endif - // compressedAttribute0.y => outlineColor.rgb +} +`;var xO=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) +in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width +in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free +in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale +in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions +in vec2 sdf; // sdf outline color (rgb) and width (w) +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates +#endif +#ifdef VECTOR_TILE +in float a_batchId; +#endif - temp = compressedAttribute0.y * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); +out vec2 v_textureCoordinates; +#ifdef FRAGMENT_DEPTH_CHECK +out vec4 v_textureCoordinateBounds; +out vec4 v_originTextureCoordinateAndTranslate; +out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +out mat2 v_rotationMatrix; +#endif - // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a +out vec4 v_pickColor; +out vec4 v_color; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; +const float UPPER_BOUND = 32768.0; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; - /////////////////////////////////////////////////////////////////////////// +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +{ + // Note the halfSize cannot be computed in JavaScript because it is sent via + // compressed vertex attributes that coerce it to an integer. + vec2 halfSize = imageSize * scale * 0.5; + halfSize *= ((direction * 2.0) - 1.0); - /////////////////////////////////////////////////////////////////////////// + vec2 originTranslate = origin * abs(halfSize); -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) +#if defined(ROTATION) || defined(ALIGNED_AXIS) + if (validAlignedAxis || rotation != 0.0) { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; + float angle = rotation; + if (validAlignedAxis) + { + vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); + angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / + (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); + } + + float cosTheta = cos(angle); + float sinTheta = sin(angle); + rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); + halfSize = rotationMatrix * halfSize; } else { - lengthSq = dot(positionEC.xyz, positionEC.xyz); + rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } #endif -#ifdef EYE_DISTANCE_SCALING - totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif - if (totalSize > 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; + mpp = czm_metersPerPixel(positionEC); + positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); + positionEC.xy += (translate + pixelOffset) * mpp; + + return positionEC; +} + +#ifdef VERTEX_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) +{ + vec4 posWC = czm_eyeToWindowCoordinates(positionEC); + + float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); + + if (globeDepth == 0.0) + { + return 0.0; // not on the globe } - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) + vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); + return eyeCoordinate.z / eyeCoordinate.w; +} +#endif +void main() +{ + // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition + + // unpack attributes + vec3 positionHigh = positionHighAndScale.xyz; + vec3 positionLow = positionLowAndRotation.xyz; + float scale = positionHighAndScale.w; + +#if defined(ROTATION) || defined(ALIGNED_AXIS) + float rotation = positionLowAndRotation.w; +#else + float rotation = 0.0; +#endif + + float compressed = compressedAttribute0.x; + + vec2 pixelOffset; + pixelOffset.x = floor(compressed * SHIFT_RIGHT7); + compressed -= pixelOffset.x * SHIFT_LEFT7; + pixelOffset.x -= UPPER_BOUND; + + vec2 origin; + origin.x = floor(compressed * SHIFT_RIGHT5); + compressed -= origin.x * SHIFT_LEFT5; + + origin.y = floor(compressed * SHIFT_RIGHT3); + compressed -= origin.y * SHIFT_LEFT3; + +#ifdef FRAGMENT_DEPTH_CHECK + vec2 depthOrigin = origin.xy; +#endif + origin -= vec2(1.0); + + float show = floor(compressed * SHIFT_RIGHT2); + compressed -= show * SHIFT_LEFT2; + +#ifdef INSTANCED + vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); + vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); + vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +#else + vec2 direction; + direction.x = floor(compressed * SHIFT_RIGHT1); + direction.y = compressed - direction.x * SHIFT_LEFT1; + + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); +#endif + + float temp = compressedAttribute0.y * SHIFT_RIGHT8; + pixelOffset.y = -(floor(temp) - UPPER_BOUND); + + vec2 translate; + translate.y = (temp - floor(temp)) * SHIFT_LEFT16; + + temp = compressedAttribute0.z * SHIFT_RIGHT8; + translate.x = floor(temp) - UPPER_BOUND; + + translate.y += (temp - floor(temp)) * SHIFT_LEFT8; + translate.y -= UPPER_BOUND; + + temp = compressedAttribute1.x * SHIFT_RIGHT8; + float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); + + vec2 imageSize = vec2(floor(temp), temp2); + +#ifdef FRAGMENT_DEPTH_CHECK + float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); + float applyTranslate = 0.0; + if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false + { + applyTranslate = 1.0; + labelHorizontalOrigin -= 2.0; + depthOrigin.x = labelHorizontalOrigin + 1.0; + } + + depthOrigin = vec2(1.0) - (depthOrigin * 0.5); +#endif + +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; + + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif + +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) + temp = compressedAttribute3.w; + temp = temp * SHIFT_RIGHT12; + + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); +#endif + +#ifdef ALIGNED_AXIS + vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); + temp = compressedAttribute2.z * SHIFT_RIGHT5; + bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; +#else + vec3 alignedAxis = vec3(0.0); + bool validAlignedAxis = false; +#endif + + vec4 pickColor; + vec4 color; + + temp = compressedAttribute2.y; + temp = temp * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); + + temp = compressedAttribute2.x; + temp = temp * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); + + temp = compressedAttribute2.z * SHIFT_RIGHT8; + bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; + temp = floor(temp) * SHIFT_RIGHT8; + + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor /= 255.0; + + color.a = floor(temp); + color /= 255.0; + + /////////////////////////////////////////////////////////////////////////// + + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + +#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) + float eyeDepth = positionEC.z; +#endif + + positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); + positionEC.xyz *= show; + + /////////////////////////////////////////////////////////////////////////// + +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif + +#ifdef EYE_DISTANCE_SCALING + float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); + scale *= distanceScale; + translate *= distanceScale; + // push vertex behind near plane for clipping + if (scale == 0.0) { positionEC.xyz = vec3(0.0); - totalSize = 1.0; } +#endif float translucency = 1.0; #ifdef EYE_DISTANCE_TRANSLUCENCY translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); // push vertex behind near plane for clipping - if (translucency < 0.004) + if (translucency == 0.0) { positionEC.xyz = vec3(0.0); } #endif +#ifdef EYE_DISTANCE_PIXEL_OFFSET + float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); + pixelOffset *= pixelOffsetScale; +#endif + #ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepth.x; - float farSq = distanceDisplayConditionAndDisableDepth.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); + float nearSq = compressedAttribute3.x; + float farSq = compressedAttribute3.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + positionEC.xyz = vec3(0.0); + } +#endif + + mat2 rotationMatrix; + float mpp; + +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = compressedAttribute3.z; +#endif + +#ifdef VERTEX_DEPTH_CHECK +if (lengthSq < disableDepthTestDistance) { + float depthsilon = 10.0; + + vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; + vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth1 = getGlobeDepth(pEC1); + + if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) + { + vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth2 = getGlobeDepth(pEC2); + + if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) + { + vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth3 = getGlobeDepth(pEC3); + if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) + { + positionEC.xyz = vec3(0.0); + } + } } +} #endif + positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; + v_textureCoordinates = textureCoordinates; + +#ifdef LOG_DEPTH czm_vertexLogDepth(); +#endif #ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) { disableDepthTestDistance = czm_minimumDisableDepthTestDistance; @@ -8708,5608 +8095,1859 @@ void main() // Position z on the near plane. gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); + v_depthFromNearPlusOne = 1.0; #endif } } #endif - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; - - v_pickColor = pickColor; -} -`;var T7e=Fs.SHOW_INDEX,aW=Fs.POSITION_INDEX,ele=Fs.COLOR_INDEX,E7e=Fs.OUTLINE_COLOR_INDEX,b7e=Fs.OUTLINE_WIDTH_INDEX,S7e=Fs.PIXEL_SIZE_INDEX,tle=Fs.SCALE_BY_DISTANCE_INDEX,nle=Fs.TRANSLUCENCY_BY_DISTANCE_INDEX,ile=Fs.DISTANCE_DISPLAY_CONDITION_INDEX,v7e=Fs.DISABLE_DEPTH_DISTANCE_INDEX,cW=Fs.NUMBER_OF_PROPERTIES,sc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function vf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(cW),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Dr.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(vf.prototype,{length:{get:function(){return lW(this),this._pointPrimitives.length}}});function rle(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}vf.prototype.add=function(e){let t=new Fs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};vf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};vf.prototype.removeAll=function(){rle(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function lW(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}vf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};vf.prototype.contains=function(e){return u(e)&&e._pointPrimitiveCollection===this};vf.prototype.get=function(e){return lW(this),this._pointPrimitives[e]};vf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<cW;++i){let r=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function w7e(e,t,n){return new ap(e,[{index:sc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[aW]},{index:sc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[aW]},{index:sc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ele]},{index:sc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[nle]},{index:sc.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[tle]},{index:sc.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:X.FLOAT,usage:n[ile]}],t)}var oW=new qn;function ole(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),qn.fromCartesian(o,oW);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[sc.positionHighAndSize],l=oW.high;c(r,l.x,l.y,l.z,s);let f=n[sc.positionLowAndOutline],d=oW.low;f(r,d.x,d.y,d.z,a)}var ik=65536,PR=256;function sle(e,t,n,i){let r=i._index,o=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(o.red),l=z.floatToByte(o.green),f=z.floatToByte(o.blue),d=c*ik+l*PR+f;c=z.floatToByte(a.red),l=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*ik+l*PR+f;c=z.floatToByte(s.red),l=z.floatToByte(s.green),f=z.floatToByte(s.blue);let g=c*ik+l*PR+f,h=z.floatToByte(o.alpha)*ik+z.floatToByte(a.alpha)*PR+z.floatToByte(s.alpha),A=n[sc.compressedAttribute0];A(r,d,p,g,h)}function ale(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,l=i.translucencyByDistance;u(l)&&(o=l.near,s=l.nearValue,a=l.far,c=l.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*PR+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[sc.compressedAttribute1];g(r,d,p,o,a)}function cle(e,t,n,i){let r=i._index,o=n[sc.scaleByDistance],s=0,a=1,c=1,l=1,f=i.scaleByDistance;u(f)&&(s=f.near,a=f.nearValue,c=f.far,l=f.farValue,(a!==1||l!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,l)}function lle(e,t,n,i){let r=i._index,o=n[sc.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;u(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let l=i.disableDepthTestDistance;l*=l,l>0&&(e._shaderDisableDepthDistance=!0,l===Number.POSITIVE_INFINITY&&(l=-1)),o(r,s,a,l)}function D7e(e,t,n,i){ole(e,t,n,i),sle(e,t,n,i),ale(e,t,n,i),cle(e,t,n,i),lle(e,t,n,i)}function sW(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let l=t[c],f=l.position,d=Fs._computeActualPosition(f,i,r);u(d)&&(l._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function I7e(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&sW(e,i,i.length,t,o,!0)):n===ne.MORPHING?sW(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&sW(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function P7e(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var O7e=[];vf.prototype.update=function(e){if(lW(this),!this.show)return;this._maxTotalPointSize=Ht.maximumAliasedPointSize,I7e(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,l=e.passes,f=l.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let w=0;w<cW;++w)o[w]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=w7e(c,n,this._buffersUsage),a=this._vaf.writers;for(let w=0;w<n;++w){let D=this._pointPrimitives[w];D._dirty=!1,D7e(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let w=O7e;w.length=0,(o[aW]||o[b7e]||o[S7e])&&w.push(ole),(o[ele]||o[E7e])&&w.push(sle),(o[T7e]||o[nle])&&w.push(ale),o[tle]&&w.push(cle),(o[ile]||o[v7e])&&w.push(lle);let D=w.length;if(a=this._vaf.writers,r/n>.1){for(let M=0;M<r;++M){let O=i[M];O._dirty=!1;for(let B=0;B<D;++B)w[B](this,c,a,O)}this._vaf.commit()}else{for(let M=0;M<r;++M){let O=i[M];O._dirty=!1;for(let B=0;B<D;++B)w[B](this,c,a,O);this._vaf.subCommit(O._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!u(this._vaf)||!u(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),P7e(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Dr.OPAQUE||this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Dr.TRANSLUCENT||this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,A;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new ke({sources:[IR]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT&&(A=new ke({defines:["OPAQUE"],sources:[hy]}),this._sp=Kt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:sc}),A=new ke({defines:["TRANSLUCENT"],sources:[hy]}),this._spTranslucent=Kt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:sc})),this._blendOption===Dr.OPAQUE&&(A=new ke({sources:[hy]}),this._sp=Kt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:sc})),this._blendOption===Dr.TRANSLUCENT&&(A=new ke({sources:[hy]}),this._spTranslucent=Kt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:sc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,C,T,E,S=e.commandList;if(l.render||f){let w=this._colorCommands,D=this._blendOption===Dr.OPAQUE,M=this._blendOption===Dr.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,C=x.length,w.length=C;let O=M?C*2:C;for(E=0;E<O;++E){let B=D||M&&E%2===0;T=w[E],u(T)||(T=w[E]=new et),T.primitiveType=Be.POINTS,T.pass=B||!M?ve.OPAQUE:ve.TRANSLUCENT,T.owner=this;let L=M?Math.floor(E/2):E;T.boundingVolume=d,T.modelMatrix=p,T.shaderProgram=B?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=x[L].va,T.renderState=B?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",S.push(T)}}};vf.prototype.isDestroyed=function(){return!1};vf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),rle(this._pointPrimitives),ue(this)};var VE=vf;var ule=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],uW=1,OR=8,dx=class{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==uW)throw new Error(`Got v${r} data when expected v${uW}.`);let o=ule[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new dx(a,s,o,t)}constructor(t,n=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=ule.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,OR,t),this.coords=new this.ArrayType(this.data,OR+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(OR+s+a+c),this.ids=new this.IndexArrayType(this.data,OR,t),this.coords=new this.ArrayType(this.data,OR+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(uW<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return dW(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let x=p;x<=d;x++){let C=s[2*x],T=s[2*x+1];C>=t&&C<=i&&T>=n&&T<=r&&l.push(o[x])}continue}let g=p+d>>1,h=s[2*g],A=s[2*g+1];h>=t&&h<=i&&A>=n&&A<=r&&l.push(o[g]),(f===0?t<=h:n<=A)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:r>=A)&&(c.push(g+1),c.push(d),c.push(1-f))}return l}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],c=[],l=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let x=p;x<=d;x++)fle(o[2*x],o[2*x+1],t,n)<=l&&c.push(r[x]);continue}let g=p+d>>1,h=o[2*g],A=o[2*g+1];fle(h,A,t,n)<=l&&c.push(r[g]),(f===0?t-i<=h:n-i<=A)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=A)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function dW(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;dle(e,t,s,i,r,o),dW(e,t,n,i,s-1,1-o),dW(e,t,n,s+1,r,1-o)}function dle(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let l=r-i+1,f=n-i+1,d=Math.log(l),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(l-p)/l)*(f-l/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/l+g)),A=Math.min(r,Math.floor(n+(l-f)*p/l+g));dle(e,t,n,h,A,o)}let s=t[2*n+o],a=i,c=r;for(MR(e,t,i,n),t[2*r+o]>s&&MR(e,t,i,r);a<c;){for(MR(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?MR(e,t,i,c):(c++,MR(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function MR(e,t,n,i){fW(e,n,i),fW(t,2*n,2*i),fW(t,2*n+1,2*i+1)}function fW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function fle(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function jd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new _e,this.show=y(e.show,!0)}function mle(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var M7e=new Ye;function hle(e,t,n,i,r){if(u(e._labelCollection)&&i._clusterLabels?r=Kg.getScreenSpaceBoundingBox(e,t,r):u(e._billboardCollection)&&i._clusterBillboards?r=gr.getScreenSpaceBoundingBox(e,t,r):u(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Fs.getScreenSpaceBoundingBox(e,t,r)),mle(r,n),i._clusterLabels&&!u(e._labelCollection)&&u(e.id)&&_le(i,e.id.id)&&u(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=Kg.getScreenSpaceBoundingBox(s,t,M7e);mle(a,n),r=Ye.union(r,a,r)}return r}function R7e(e,t){if(e.clusterShow=!0,!u(e._labelCollection)&&u(e.id)&&_le(t,e.id.id)&&u(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function ple(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function _le(e,t){return u(e)&&u(e._collectionIndicesByEntity[t])&&u(e._collectionIndicesByEntity[t].labelIndex)}function mW(e,t,n,i,r){if(!u(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&u(a._labelCollection),l=r._clusterBillboards&&u(a.id._billboard),f=r._clusterPoints&&u(a.id._point);if(c&&(f||l))continue;let d=a.computeScreenSpacePosition(n);u(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var B7e=new Ye,L7e=new Ye,N7e=new Ye;function F7e(e){return function(t){if(u(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!u(i)&&!u(r)&&!u(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;u(s)?s.removeAll():s=e._clusterLabelCollection=new nh({scene:n}),u(a)?a.removeAll():a=e._clusterBillboardCollection=new lu({scene:n}),u(c)?c.removeAll():c=e._clusterPointCollection=new VE;let l=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,h=n.camera.positionCartographic.height,A=n.mapProjection.ellipsoid,x=n.camera.positionWC,C=new h_(A,x),T=[];e._clusterLabels&&mW(i,T,n,C,e),e._clusterBillboards&&mW(r,T,n,C,e),e._clusterPoints&&mW(o,T,n,C,e);let E,S,w,D,M,O,B,L,_,b,v,I;if(T.length>0){let R=new dx(T.length,64,Uint32Array);for(let F=0;F<T.length;++F)R.add(T[F].coord.x,T[F].coord.y);if(R.finish(),h<g)for(w=d.length,E=0;E<w;++E){let F=d[E];if(!C.isPointVisible(F.position))continue;let k=gr._computeScreenSpacePosition(N.IDENTITY,F.position,m.ZERO,H.ZERO,n);if(!u(k))continue;let V=1-h/g,G=F.width=F.width*V,U=F.height=F.height*V;G=Math.max(G,F.minimumWidth),U=Math.max(U,F.minimumHeight);let Y=k.x-G*.5,W=k.y-U*.5,J=k.x+G,j=k.y+U;for(M=R.range(Y,W,J,j),O=M.length,b=0,_=[],S=0;S<O;++S)B=M[S],L=T[B],L.clustered||(++b,v=L.collection,I=L.index,_.push(v.get(I).id));if(b>=f)for(ple(F.position,b,_,e),p.push(F),S=0;S<O;++S)T[M[S]].clustered=!0}for(w=T.length,E=0;E<w;++E){let F=T[E];if(F.clustered)continue;F.clustered=!0,v=F.collection,I=F.index;let k=v.get(I);D=hle(k,F.coord,l,e,B7e);let V=Ye.clone(D,L7e);M=R.range(D.x,D.y,D.x+D.width,D.y+D.height),O=M.length;let G=m.clone(k.position);for(b=1,_=[k.id],S=0;S<O;++S)if(B=M[S],L=T[B],!L.clustered){let U=L.collection.get(L.index),Y=hle(U,L.coord,l,e,N7e);m.add(U.position,G,G),Ye.union(V,Y,V),++b,_.push(U.id)}if(b>=f){let U=m.multiplyByScalar(G,1/b,G);for(ple(U,b,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S<O;++S)T[M[S]].clustered=!0}else R7e(k,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}jd.prototype._initialize=function(e){this._scene=e;let t=F7e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(jd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function pW(e,t,n,i){return function(r){let o=this[e];u(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(u(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),u(o)&&u(s[i]))return o.get(s[i]);u(o)||(o=this[e]=new t({scene:this._scene}));let a,c,l=this[n];l.length>0?(a=l.pop(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function _W(e,t){let n=e._collectionIndicesByEntity[t];!u(n.billboardIndex)&&!u(n.labelIndex)&&!u(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}jd.prototype.getLabel=pW("_labelCollection",nh,"_unusedLabelIndices","labelIndex");jd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!u(this._labelCollection)||!u(t)||!u(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,_W(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};jd.prototype.getBillboard=pW("_billboardCollection",lu,"_unusedBillboardIndices","billboardIndex");jd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!u(this._billboardCollection)||!u(t)||!u(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,_W(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};jd.prototype.getPoint=pW("_pointCollection",VE,"_unusedPointIndices","pointIndex");jd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!u(this._pointCollection)||!u(t)||!u(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,_W(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function hW(e){if(!u(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function U7e(e){e.enabled||(u(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),u(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),u(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,hW(e._labelCollection),hW(e._billboardCollection),hW(e._pointCollection))}jd.prototype.update=function(e){if(!this.show)return;let t;u(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),u(this._billboardCollection)&&this._billboardCollection.length>0&&!u(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,U7e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),u(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),u(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),u(this._clusterPointCollection)&&this._clusterPointCollection.update(e),u(this._labelCollection)&&this._labelCollection.update(e),u(this._billboardCollection)&&this._billboardCollection.update(e),u(this._pointCollection)&&this._pointCollection.update(e)};jd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),u(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var du=jd;function gW(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Ns(this),this._entityCluster=new du}Object.defineProperties(gW.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Mo.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});gW.prototype.update=function(e){return!0};var RR=gW;var gle={};gle.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,l=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,h=r?(a+i)*3:i*3;for(f=0;f<i;f++){let A=f/i*P.TWO_PI,x=Math.cos(A),C=Math.sin(A),T=x*n,E=C*n,S=x*t,w=C*t;l[p+g]=T,l[p+g+1]=E,l[p+g+2]=s,l[p+h]=S,l[p+h+1]=w,l[p+h+2]=o,p+=3,r&&(l[d++]=T,l[d++]=E,l[d++]=s,l[d++]=S,l[d++]=w,l[d++]=o)}return l};var mx=gle;var yW=new H,V7e=new m,k7e=new m,z7e=new m,H7e=new m;function p_(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Pe.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}p_.packedLength=Pe.packedLength+5;p_.pack=function(e,t,n){return n=y(n,0),Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var yle=new Pe,kE={vertexFormat:yle,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};p_.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,yle);t+=Pe.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return u(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(kE.length=r,kE.topRadius=o,kE.bottomRadius=s,kE.slices=a,kE.offsetAttribute=c===-1?void 0:c,new p_(kE))};p_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,l=mx.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,h,A=r.normal||r.tangent||r.bitangent;if(A){let M=r.tangent||r.bitangent,O=0,B=0,L=0,_=Math.atan2(i-n,t),b=V7e;b.z=Math.sin(_);let v=Math.cos(_),I=z7e,R=k7e;for(h=0;h<o;h++){let F=h/o*P.TWO_PI,k=v*Math.cos(F),V=v*Math.sin(F);A&&(b.x=k,b.y=V,M&&(I=m.normalize(m.cross(m.UNIT_Z,b,I),I)),r.normal&&(d[O++]=b.x,d[O++]=b.y,d[O++]=b.z,d[O++]=b.x,d[O++]=b.y,d[O++]=b.z),r.tangent&&(p[B++]=I.x,p[B++]=I.y,p[B++]=I.z,p[B++]=I.x,p[B++]=I.y,p[B++]=I.z),r.bitangent&&(R=m.normalize(m.cross(b,I,R),R),g[L++]=R.x,g[L++]=R.y,g[L++]=R.z,g[L++]=R.x,g[L++]=R.y,g[L++]=R.z))}for(h=0;h<o;h++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=-1),r.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(h=0;h<o;h++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=1),r.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let x=12*o-12,C=Fe.createTypedArray(c,x),T=0,E=0;for(h=0;h<o-1;h++)C[T++]=E,C[T++]=E+2,C[T++]=E+3,C[T++]=E,C[T++]=E+3,C[T++]=E+1,E+=2;for(C[T++]=s-2,C[T++]=0,C[T++]=1,C[T++]=s-2,C[T++]=1,C[T++]=s-1,h=1;h<o-1;h++)C[T++]=s+h+1,C[T++]=s+h,C[T++]=s;for(h=1;h<o-1;h++)C[T++]=a,C[T++]=a+h,C[T++]=a+h+1;let S=0;if(r.st){let M=Math.max(n,i);for(h=0;h<c;h++){let O=m.fromArray(l,h*3,H7e);f[S++]=(O.x+M)/(2*M),f[S++]=(O.y+M)/(2*M)}}let w=new mn;r.position&&(w.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:l})),r.normal&&(w.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(w.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(w.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(w.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),yW.x=t*.5,yW.y=Math.max(i,n);let D=new ae(m.ZERO,H.magnitude(yW));if(u(e._offsetAttribute)){t=l.length;let M=e._offsetAttribute===on.NONE?0:1,O=new Uint8Array(t/3).fill(M);w.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new dt({attributes:w,indices:C,primitiveType:Be.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var AW;p_.getUnitCylinder=function(){return u(AW)||(AW=p_.createGeometry(new p_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Pe.POSITION_ONLY}))),AW};var BR=p_;var xW=new H;function zE(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.slices,128),o=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}zE.packedLength=6;zE.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var hx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};zE.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return u(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(hx.length=i,hx.topRadius=r,hx.bottomRadius=o,hx.slices=s,hx.numberOfVerticalLines=a,hx.offsetAttribute=c===-1?void 0:c,new zE(hx))};zE.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=mx.computePositions(t,n,i,r,!1),c=r*2,l;if(o>0){let A=Math.min(o,r);l=Math.round(r/A),c+=A}let f=Fe.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=l)f[d++]=p,f[d++]=p+r;let g=new mn;g.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),xW.x=t*.5,xW.y=Math.max(i,n);let h=new ae(m.ZERO,H.magnitude(xW));if(u(e._offsetAttribute)){t=a.length;let A=e._offsetAttribute===on.NONE?0:1,x=new Uint8Array(t/3).fill(A);g.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new dt({attributes:g,indices:f,primitiveType:Be.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var LR=zE;var Ale=m.ZERO,xle=new m,G7e=new m,Cle=new z;function W7e(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function mu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new W7e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}u(Object.create)&&(mu.prototype=Object.create(ci.prototype),mu.prototype.constructor=mu);Object.defineProperties(mu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});mu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Cle)),u(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return u(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ale,xle))),new Ct({id:t,geometry:new BR(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};mu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Cle),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return u(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ale,xle))),new Ct({id:t,geometry:new LR(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:o})};mu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};mu.prototype._isHidden=function(e,t){return!u(e.position)||!u(t.length)||!u(t.topRadius)||!u(t.bottomRadius)||ci.prototype._isHidden.call(this,e,t)};mu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};mu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(ze.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(ze.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(ze.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,ze.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,ze.MINIMUM_VALUE),i.offsetAttribute=n!==je.NONE?on.ALL:void 0};mu.prototype._onEntityPropertyChanged=Ap;mu.DynamicGeometryUpdater=HE;function HE(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(HE.prototype=Object.create(ai.prototype),HE.prototype.constructor=HE);HE.prototype._isHidden=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(e.position,n,G7e);return!u(r)||!u(i.length)||!u(i.topRadius)||!u(i.bottomRadius)||ai.prototype._isHidden.call(this,e,t,n)};HE.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,je.NONE),r=this._options;r.length=q.getValueOrUndefined(t.length,n),r.topRadius=q.getValueOrUndefined(t.topRadius,n),r.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),r.slices=q.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==je.NONE?on.ALL:void 0};var NR=mu;var j7e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Bo=Object.freeze(j7e);var q7e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},yr=Object.freeze(q7e);var Y7e={NONE:0,HOLD:1,EXTRAPOLATE:2},hu=Object.freeze(Y7e);var Tle=Ki(Yl(),1);function X7e(e){let t=new Tle.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var __=X7e;var K7e=P.factorial;function CW(e,t,n,i,r,o){let s=0,a,c,l;if(i>0){for(c=0;c<r;c++){for(a=!1,l=0;l<o.length&&!a;l++)c===o[l]&&(a=!0);a||(o.push(c),s+=CW(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,l=0;l<o.length&&!a;l++)c===o[l]&&(a=!0);a||(s*=e-n[t[c]])}return s}var rk={type:"Hermite"};rk.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};rk.interpolateOrderZero=function(e,t,n,i,r){u(r)||(r=new Array(i));let o,s,a,c,l,f,d=t.length,p=new Array(i);for(o=0;o<i;o++){r[o]=0;let x=new Array(d);for(p[o]=x,s=0;s<d;s++)x[s]=[]}let g=d,h=new Array(g);for(o=0;o<g;o++)h[o]=o;let A=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=h[s]*i+c,p[c][0].push(n[f]);for(o=1;o<g;o++){let x=!1;for(s=0;s<g-o;s++){let C=t[h[s]],T=t[h[s+o]],E;T-C<=0?(f=h[s]*i+i*o+c,E=n[f],p[c][o].push(E/K7e(o))):(E=p[c][o-1][s+1]-p[c][o-1][s],p[c][o].push(E/(T-C))),x=x||E!==0}x||(A=o-1)}}for(a=0,l=0;a<=l;a++)for(o=a;o<=A;o++){let x=CW(e,h,t,a,o,[]);for(c=0;c<i;c++){let C=p[c][o][0];r[c+a*i]+=C*x}}return r};var J7e=[];rk.interpolate=function(e,t,n,i,r,o,s){let a=i*(o+1);u(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,l=new Array(c*(r+1)),f;for(f=0;f<c;f++)for(let C=0;C<r+1;C++)l[f*(r+1)+C]=f;let d=l.length,p=J7e,g=Z7e(p,l,t,n,i,r),h=[],A=d*(d+1)/2,x=Math.min(g,o);for(let C=0;C<=x;C++)for(f=C;f<=g;f++){h.length=0;let T=CW(e,l,t,C,f,h),E=Math.floor(f*(1-f)/2)+d*f;for(let S=0;S<i;S++){let w=Math.floor(S*A),D=p[w+E];s[S+C*i]+=D*T}}return s};function Z7e(e,t,n,i,r,o){let s,a,c=-1,l=t.length,f=l*(l+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<l;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<l;g++){let h=0,A=Math.floor(g*(1-g)/2)+l*g,x=!1;for(s=0;s<l-g;s++){let C=n[t[s]],T=n[t[s+g]],E,S;if(T-C<=0)a=t[s]*r*(o+1)+r*g+d,E=i[a],S=E/P.factorial(g),e[p+A+h]=S,h++;else{let w=Math.floor((g-1)*(2-g)/2)+l*(g-1);E=e[p+w+s+1]-e[p+w+s],S=E/(T-C),e[p+A+h]=S,h++}x=x||E!==0}x&&(c=Math.max(c,g))}}return c}var FR=rk;var TW={type:"Lagrange"};TW.getRequiredDataPoints=function(e){return Math.max(e+1,2)};TW.interpolateOrderZero=function(e,t,n,i,r){u(r)||(r=new Array(i));let o,s,a=t.length;for(o=0;o<i;o++)r[o]=0;for(o=0;o<a;o++){let c=1;for(s=0;s<a;s++)if(s!==o){let l=t[o]-t[s];c*=(e-t[s])/l}for(s=0;s<i;s++)r[s]+=c*n[o*i+s]}return r};var UR=TW;var EW={type:"Linear"};EW.getRequiredDataPoints=function(e){return 2};EW.interpolateOrderZero=function(e,t,n,i,r){u(r)||(r=new Array(i));let o,s,a,c=t[0],l=t[1];for(o=0;o<i;o++)s=n[o],a=n[o+i],r[o]=((a-s)*e+l*s-c*a)/(l-c);return r};var px=EW;function ac(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}ac.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return u(t)||(t=new ac),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};ac.clone=function(e,t){if(u(e))return u(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new ac(e.clock,e.cone,e.magnitude)};ac.normalize=function(e,t){return u(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new ac(e.clock,e.cone,1)};ac.equals=function(e,t){return e===t||u(e)&&u(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};ac.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||u(e)&&u(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};ac.prototype.equals=function(e){return ac.equals(this,e)};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.equalsEpsilon=function(e,t){return ac.equalsEpsilon(this,e,t)};ac.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var VR=ac;var WR=Ki(Yl(),1);var bW;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?bW=function(){return performance.now()}:bW=function(){return Date.now()};var Ai=bW;function SW(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;u(t)?t=ee.clone(t):u(n)?t=ee.clone(n):u(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),u(n)?n=ee.clone(n):n=ee.clone(t),u(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Bo.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ai(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,yr.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(SW.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===yr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});SW.prototype.tick=function(){let e=Ai(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===yr.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===yr.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===Bo.CLAMPED)ee.lessThan(t,o)?t=ee.clone(o,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(r===Bo.LOOP_STOP)for(ee.lessThan(t,o)&&(t=ee.clone(o,t));ee.greaterThan(t,s);)t=ee.addSeconds(o,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var qd=SW;function _x(){this._definitionChanged=new _e,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(_x.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:hl("startTime"),stopTime:hl("stopTime"),currentTime:hl("currentTime"),clockRange:hl("clockRange"),clockStep:hl("clockStep"),multiplier:hl("multiplier")});_x.prototype.clone=function(e){return u(e)||(e=new _x),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};_x.prototype.equals=function(e){return this===e||u(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};_x.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};_x.prototype.getValue=function(e){return u(e)||(e=new qd),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var Yd=_x;var Q7e=z.WHITE,$7e=.1,eje=new H(8,8),tje=new H(0,0),nje=new H(1,1);function GE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(GE.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});GE.prototype.getType=function(e){return"Grid"};GE.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,Q7e,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,$7e),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,eje,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,nje,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,tje,t.lineOffset),t};GE.prototype.equals=function(e){return this===e||e instanceof GE&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var WE=GE;function jE(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(jE.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});jE.prototype.getType=function(e){return"PolylineArrow"};jE.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};jE.prototype.equals=function(e){return this===e||e instanceof jE&&q.equals(this._color,e._color)};var qE=jE;var ije=z.WHITE,rje=z.TRANSPARENT,oje=16,sje=255;function YE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(YE.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});YE.prototype.getType=function(e){return"PolylineDash"};YE.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,ije,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,rje,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,oje,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,sje,t.dashPattern),t};YE.prototype.equals=function(e){return this===e||e instanceof YE&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var XE=YE;var aje=z.WHITE,cje=.25,lje=1;function KE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(KE.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});KE.prototype.getType=function(e){return"PolylineGlow"};KE.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,aje,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,cje,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,lje,t.taperPower),t};KE.prototype.equals=function(e){return this===e||e instanceof KE&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var JE=KE;var uje=z.WHITE,fje=z.BLACK,dje=1;function ZE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(ZE.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});ZE.prototype.getType=function(e){return"PolylineOutline"};ZE.prototype.getValue=function(e,t){return u(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,uje,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,fje,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,dje),t};ZE.prototype.equals=function(e){return this===e||e instanceof ZE&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var py=ZE;function g_(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Io,this._referenceFrame=y(t,ar.FIXED),this.setValue(e)}Object.defineProperties(g_.prototype,{isConstant:{get:function(){let e=this._value;if(!u(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});g_.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};g_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!u(i))return;let r=i.length;u(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);u(c)&&(n[s]=c,s++),o++}return n.length=s,n};g_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),u(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];u(r)&&t.add(r.definitionChanged,g_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};g_.prototype.equals=function(e){return this===e||e instanceof g_&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};g_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var y_=g_;function _y(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Io,this.setValue(e)}Object.defineProperties(_y.prototype,{isConstant:{get:function(){let e=this._value;if(!u(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});_y.prototype.getValue=function(e,t){let n=this._value;if(!u(n))return;let i=n.length;u(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);u(a)&&(t[o]=a,o++),r++}return t.length=o,t};_y.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),u(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];u(r)&&t.add(r.definitionChanged,_y.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};_y.prototype.equals=function(e){return this===e||e instanceof _y&&q.arrayEquals(this._value,e._value)};_y.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var QE=_y;function gx(e){let t=e._targetProperty;if(!u(t)){let n=e._targetEntity;if(!u(n)){if(n=e._targetCollection.getById(e._targetId),!u(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(pu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&u(t);++r)t=t[i[r]];e._targetProperty=t}return t}function pu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(pu.prototype._onCollectionChanged,this)}Object.defineProperties(pu.prototype,{isConstant:{get:function(){return q.isConstant(gx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=gx(this);return u(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return gx(this)}}});pu.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new pu(e,n,i)};pu.prototype.getValue=function(e,t){let n=gx(this);return u(n)?n.getValue(e,t):void 0};pu.prototype.getValueInReferenceFrame=function(e,t,n){let i=gx(this);return u(i)?i.getValueInReferenceFrame(e,t,n):void 0};pu.prototype.getType=function(e){let t=gx(this);return u(t)?t.getType(e):void 0};pu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};pu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){u(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};pu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;u(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(pu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):u(i)||(i=gx(this),u(i)&&this._definitionChanged.raiseEvent(this))};var A_=pu;var mje={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){u(i)||(i=[]),t=y(t,0),n=y(n,e.length);let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-P.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+P.TWO_PI:r}},wf=mje;var Ele={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function ble(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function Sle(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var vW=[],wW=[];function ok(e,t,n,i,r){let o=0,s,a,c,l,f,d;for(;o<i.length;){f=Sle(i[o],e),c=Mr(t,f,ee.compare);let p=0,g=0;if(c<0){for(c=~c,l=c*r,a=void 0,d=t[c];o<i.length&&(f=Sle(i[o],e),!(u(a)&&ee.compare(a,f)>=0||u(d)&&ee.compare(f,d)>=0));){for(vW[p++]=f,o=o+1,s=0;s<r;s++)wW[g++]=i[o],o=o+1;a=f}p>0&&(wW.length=g,ble(n,l,wW),vW.length=p,ble(t,c,vW))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Xd(e,t){let n=e;n===Number&&(n=Ele);let i=n.packedLength,r=y(n.packedInterpolationLength,i),o=0,s;if(u(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let l=t[c];l===Number&&(l=Ele);let f=l.packedLength;i+=f,r+=y(l.packedInterpolationLength,f),s[c]=l}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=px,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new _e,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=hu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=hu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Xd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});Xd.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Mr(n,e,ee.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===hu.NONE||r!==0&&ee.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===hu.HOLD)return o.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===hu.NONE||r!==0&&ee.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===hu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t)}let c=this._xTable,l=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,l.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,A=i-1;if(A-h+1>=g+1){let S=a-(g/2|0)-1;S<h&&(S=h);let w=S+g;w>A&&(w=A,S=w-g,S<h&&(S=h)),h=S,A=w}let C=A-h+1;for(let S=0;S<C;++S)c[S]=ee.secondsDifference(n[h+S],n[A]);if(u(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,h,A,l);else{let S=0,w=this._packedLength,D=h*w,M=(A+1)*w;for(;D<M;)l[S]=s[D],D++,S++}let T=ee.secondsDifference(e,n[A]),E;if(p===0||!u(f.interpolate))E=f.interpolateOrderZero(T,c,l,d,this._interpolationResult);else{let S=Math.floor(d/(p+1));E=f.interpolate(T,c,l,S,p,p,this._interpolationResult)}return u(o.unpackInterpolationResult)?o.unpackInterpolationResult(E,s,h,A,t):o.unpack(E,0,t)}return o.unpack(s,a*this._packedLength,t)};Xd.prototype.setInterpolationOptions=function(e){if(!u(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;u(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),u(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Xd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=u(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}ok(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=u(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let l=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(l[d],a,a.length)}ok(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.addSamplesPackedArray=function(e,t){ok(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.removeSample=function(e){let t=Mr(this._times,e,ee.compare);return t<0?!1:(vle(this,t,1),!0)};function vle(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Xd.prototype.removeSamples=function(e){let t=this._times,n=Mr(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Mr(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,vle(this,n,i-n)};Xd.prototype.equals=function(e){if(this===e)return!0;if(!u(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=u(t),i=e._derivativeTypes,r=u(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!ee.equals(a[o],c[o]))return!1;let l=this._values,f=e._values;for(s=l.length,o=0;o<s;o++)if(l[o]!==f[o])return!1;return!0};Xd._mergeNewSamples=ok;var _u=Xd;function Df(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new _u(m,n),this._definitionChanged=new _e,this._referenceFrame=y(e,ar.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Df.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});Df.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};Df.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),u(n))return hp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Df.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Df.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Df.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Df.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Df.prototype.removeSample=function(e){return this._property.removeSample(e)};Df.prototype.removeSamples=function(e){this._property.removeSamples(e)};Df.prototype.equals=function(e){return this===e||e instanceof Df&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ra=Df;var hje={HORIZONTAL:0,VERTICAL:1},Kd=Object.freeze(hje);var pje=Kd.HORIZONTAL,_je=z.WHITE,gje=z.BLACK,yje=0,Aje=1;function $E(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties($E.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});$E.prototype.getType=function(e){return"Stripe"};$E.prototype.getValue=function(e,t){return u(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,pje)===Kd.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,_je,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,gje,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,yje),t.repeat=q.getValueOrDefault(this._repeat,e,Aje),t};$E.prototype.equals=function(e){return this===e||e instanceof $E&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var eb=$E;function gy(e){this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(gy.prototype._intervalsChanged,this),this._referenceFrame=y(e,ar.FIXED)}Object.defineProperties(gy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});gy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};gy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(u(i))return hp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};gy.prototype.equals=function(e){return this===e||e instanceof gy&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};gy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var x_=gy;function yx(){this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(yx.prototype._intervalsChanged,this)}Object.defineProperties(yx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});yx.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return u(n)&&typeof n.clone=="function"?n.clone(t):n};yx.prototype.equals=function(e){return this===e||e instanceof yx&&this._intervals.equals(e._intervals,q.equals)};yx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var C_=yx;function tb(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=y(t,!0),this.position=e}Object.defineProperties(tb.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(u(t)&&this._subscription(),this._position=e,u(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var xje=new m,wle=new m,Dle=new ee,DW=1/60;tb.prototype.getValue=function(e,t){return this._getValue(e,t)};tb.prototype._getValue=function(e,t,n){u(t)||(t=new m);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let r=i.getValue(e,xje),o=i.getValue(ee.addSeconds(e,DW,Dle),wle);if(!u(r)||!u(o)&&(o=r,r=i.getValue(ee.addSeconds(e,-DW,Dle),wle),!u(r)))return;if(m.equals(r,o))return this._normalize?void 0:m.clone(m.ZERO,t);u(n)&&r.clone(n);let s=m.subtract(o,r,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,DW,t)};tb.prototype.equals=function(e){return this===e||e instanceof tb&&q.equals(this._position,e._position)};var Ax=tb;function kR(e,t){this._velocityVectorProperty=new Ax(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=y(t,re.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(kR.prototype,{isConstant:{get:function(){return q.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Ile=new m,Cje=new m,Ple=new Q;kR.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,Cje,Ile);if(u(n))return Mt.rotationMatrixFromPositionVelocity(Ile,n,this._ellipsoid,Ple),Le.fromRotationMatrix(Ple,t)};kR.prototype.equals=function(e){return this===e||e instanceof kR&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var zR=kR;function yy(){}yy.packedLength=m.packedLength;yy.unpack=m.unpack;yy.pack=m.pack;var IW;function HR(e,t){return t[0]==="#"&&(t=IW+t),A_.fromString(e,t)}function Ole(e,t,n){if(u(n.reference))return HR(t,n.reference);if(u(n.velocityReference)){let i=HR(t,n.velocityReference);switch(e){case m:case yy:return new Ax(i,e===yy);case Le:return new zR(i)}}throw new de(`${JSON.stringify(n)} is not valid CZML.`)}function Tje(e,t){return new gd(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var zi=new m,jc=new VR,cc=new he,xx=new Tn,sk=new Le;function Eje(e){let t=e.rgbaf;if(u(t))return t;let n=e.rgba;if(!u(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function Mle(e,t){let n=y(e.uri,e);return u(t)?t.getDerivedResource({url:n}):we.createIfNeeded(n)}function bje(e){let t=e.wsen;if(u(t))return t;let n=e.wsenDegrees;if(!u(n))return;let i=n.length;if(i===ce.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=P.toRadians(n[r+1]),t[r+2]=P.toRadians(n[r+2]),t[r+3]=P.toRadians(n[r+3]),t[r+4]=P.toRadians(n[r+4]);return t}function Sje(e){let t=e.length;if(jc.magnitude=1,t===2)return jc.clock=e[0],jc.cone=e[1],m.fromSpherical(jc,zi),[zi.x,zi.y,zi.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],m.fromSpherical(jc,zi),n[r+1]=zi.x,n[r+2]=zi.y,n[r+3]=zi.z;return n}function vje(e){let t=e.length;if(t===3)return jc.clock=e[0],jc.cone=e[1],jc.magnitude=e[2],m.fromSpherical(jc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],jc.magnitude=e[i+3],m.fromSpherical(jc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function wje(e){let t=e.length;if(t===3)return cc.longitude=e[0],cc.latitude=e[1],cc.height=e[2],re.WGS84.cartographicToCartesian(cc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],cc.longitude=e[i+1],cc.latitude=e[i+2],cc.height=e[i+3],re.WGS84.cartographicToCartesian(cc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function Dje(e){let t=e.length;if(t===3)return cc.longitude=P.toRadians(e[0]),cc.latitude=P.toRadians(e[1]),cc.height=e[2],re.WGS84.cartographicToCartesian(cc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],cc.longitude=P.toRadians(e[i+1]),cc.latitude=P.toRadians(e[i+2]),cc.height=e[i+3],re.WGS84.cartographicToCartesian(cc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function PW(e){let t=e.cartesian;if(u(t))return t;let n=e.cartesianVelocity;if(u(n))return n;let i=e.unitCartesian;if(u(i))return i;let r=e.unitSpherical;if(u(r))return Sje(r);let o=e.spherical;if(u(o))return vje(o);let s=e.cartographicRadians;if(u(s))return wje(s);let a=e.cartographicDegrees;if(u(a))return Dje(a);throw new de(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Rle(e,t){m.unpack(e,t,zi),m.normalize(zi,zi),m.pack(zi,e,t)}function Ije(e){let t=PW(e);if(t.length===3)return Rle(t,0),t;for(let n=1;n<t.length;n+=4)Rle(t,n);return t}function Ble(e,t){Le.unpack(e,t,sk),Le.normalize(sk,sk),Le.pack(sk,e,t)}function Pje(e){let t=e.unitQuaternion;if(u(t)){if(t.length===4)return Ble(t,0),t;for(let n=1;n<t.length;n+=5)Ble(t,n)}return t}function Lle(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ye:e.hasOwnProperty("cartesian2")?H:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?yy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?Jt:e.hasOwnProperty("classificationType")?zn:e.hasOwnProperty("colorBlendMode")?$a:e.hasOwnProperty("cornerType")?Ri:e.hasOwnProperty("heightReference")?je:e.hasOwnProperty("horizontalOrigin")?gi:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?Hr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?wt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Kd:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?WR.default:e.hasOwnProperty("verticalOrigin")?On:Object}function Oje(e,t,n){switch(e){case Jt:return Jt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ye:return t.boundingRectangle;case H:return t.cartesian2;case m:return PW(t);case yy:return Ije(t);case z:return Eje(t);case zn:return zn[y(t.classificationType,t)];case $a:return $a[y(t.colorBlendMode,t)];case Ri:return Ri[y(t.cornerType,t)];case je:return je[y(t.heightReference,t)];case gi:return gi[y(t.horizontalOrigin,t)];case Image:return Mle(t,n);case ee:return ee.fromIso8601(y(t.date,t));case Hr:return Hr[y(t.labelStyle,t)];case Number:return y(t.number,t);case Bt:return t.nearFarScalar;case wt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Le:return Pje(t);case wf:return y(t.number,t);case xn:return xn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Kd:return Kd[y(t.stripeOrientation,t)];case ce:return bje(t);case WR.default:return Mle(t,n);case On:return On[y(t.verticalOrigin,t)];default:throw new de(e)}}var Mje={HERMITE:FR,LAGRANGE:UR,LINEAR:px};function ak(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(u(n)||u(i))&&t.setInterpolationOptions({interpolationAlgorithm:Mje[n],interpolationDegree:i});let r=e.forwardExtrapolationType;u(r)&&(t.forwardExtrapolationType=hu[r]);let o=e.forwardExtrapolationDuration;u(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;u(s)&&(t.backwardExtrapolationType=hu[s]);let a=e.backwardExtrapolationDuration;u(a)&&(t.backwardExtrapolationDuration=a)}var Nle={iso8601:void 0};function co(e){if(u(e))return Nle.iso8601=e,Tn.fromIso8601(Nle)}function OW(e){let t=ze.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Fle(e){let t=new oc;return t.intervals.addInterval(OW(e)),t}function Ule(e){let t=new na(e.referenceFrame);return t.intervals.addInterval(OW(e)),t}function ck(e,t,n,i,r,o,s){let a=co(i.interval);u(r)&&(u(a)?a=Tn.intersect(a,r,xx):a=r);let c,l,f,d=!u(i.reference)&&!u(i.velocityReference),p=u(a)&&!a.equals(ze.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Kle(t[n],a)}let g=!1;if(d){if(l=Oje(e,i,o),!u(l))return;c=y(e.packedLength,1),f=y(l.length,1),g=!u(i.array)&&typeof l!="string"&&f>c&&e!==Object}let h=typeof e.unpack=="function"&&e!==wf;if(!g&&!p){d?t[n]=new ei(h?e.unpack(l,0):l):t[n]=Ole(e,s,i);return}let A=t[n],x,C=i.epoch;if(u(C)&&(x=ee.fromIso8601(C)),g&&!p){A instanceof _u||(t[n]=A=new _u(e)),A.addSamplesPackedArray(l,x),ak(i,A);return}let T;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(l,0):l:a.data=Ole(e,s,i),u(A)||(t[n]=A=d?new C_:new oc),d&&A instanceof C_?A.intervals.addInterval(a):A instanceof oc?(d&&(a.data=new ei(a.data)),A.intervals.addInterval(a)):(t[n]=A=Fle(A),d&&(a.data=new ei(a.data)),A.intervals.addInterval(a));return}u(A)||(t[n]=A=new oc),A instanceof oc||(t[n]=A=Fle(A));let E=A.intervals;T=E.findInterval(a),(!u(T)||!(T.data instanceof _u))&&(T=a.clone(),T.data=new _u(e),E.addInterval(T)),T.data.addSamplesPackedArray(l,x),ak(i,T.data)}function Kle(e,t){if(e instanceof _u){e.removeSamples(t);return}else if(e instanceof C_){e.intervals.removeInterval(t);return}else if(e instanceof oc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Tn.intersect(n.get(i),t,xx);r.isEmpty||Kle(r.data,t)}n.removeInterval(t);return}}function ge(e,t,n,i,r,o,s){if(u(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)ck(e,t,n,i[a],r,o,s);else ck(e,t,n,i,r,o,s)}function Vle(e,t,n,i,r,o){let s=co(n.interval);u(i)&&(u(s)?s=Tn.intersect(s,i,xx):s=i);let a=u(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),l,f,d=!u(n.reference),p=u(s)&&!s.equals(ze.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Jle(e[t],s)}let g,h=!1;if(d&&(u(n.referenceFrame)&&(g=ar[n.referenceFrame]),g=y(g,ar.FIXED),l=PW(n),f=y(l.length,1),h=f>c),!h&&!p){d?e[t]=new Rc(m.unpack(l),g):e[t]=HR(o,n.reference);return}let A=e[t],x,C=n.epoch;if(u(C)&&(x=ee.fromIso8601(C)),h&&!p){(!(A instanceof ra)||u(g)&&A.referenceFrame!==g)&&(e[t]=A=new ra(g,a)),A.addSamplesPackedArray(l,x),ak(n,A);return}let T;if(!h&&p){s=s.clone(),d?s.data=m.unpack(l):s.data=HR(o,n.reference),u(A)||(d?A=new x_(g):A=new na(g),e[t]=A),d&&A instanceof x_&&u(g)&&A.referenceFrame===g?A.intervals.addInterval(s):A instanceof na?(d&&(s.data=new Rc(s.data,g)),A.intervals.addInterval(s)):(e[t]=A=Ule(A),d&&(s.data=new Rc(s.data,g)),A.intervals.addInterval(s));return}u(A)?A instanceof na||(e[t]=A=Ule(A)):e[t]=A=new na(g);let E=A.intervals;T=E.findInterval(s),(!u(T)||!(T.data instanceof ra)||u(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new ra(g,a),E.addInterval(T)),T.data.addSamplesPackedArray(l,x),ak(n,T.data)}function Jle(e,t){if(e instanceof ra){e.removeSamples(t);return}else if(e instanceof x_){e.intervals.removeInterval(t);return}else if(e instanceof na){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Tn.intersect(n.get(i),t,xx);r.isEmpty||Jle(r.data,t)}n.removeInterval(t);return}}function Zle(e,t,n,i,r,o){if(u(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Vle(e,t,n[s],i,r,o);else Vle(e,t,n,i,r,o)}function kle(e,t,n,i){u(n.references)?lk(e,t,n.references,n.interval,i,QE,oc):(u(n.cartesian2)?n.array=H.unpackArray(n.cartesian2):u(n.cartesian)&&(n.array=H.unpackArray(n.cartesian)),u(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function zle(e,t,n,i,r,o){let s=co(n.interval);u(i)&&(u(s)?s=Tn.intersect(s,i,xx):s=i);let a=e[t],c,l;if(u(s)){a instanceof BE||(a=new BE,e[t]=a);let d=a.intervals;l=d.findInterval({start:s.start,stop:s.stop}),u(l)?c=l.data:(l=s.clone(),d.addInterval(l))}else c=a;let f;u(n.solidColor)?(c instanceof Vt||(c=new Vt),f=n.solidColor,ge(z,c,"color",f.color,void 0,void 0,o)):u(n.grid)?(c instanceof WE||(c=new WE),f=n.grid,ge(z,c,"color",f.color,void 0,r,o),ge(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),ge(H,c,"lineCount",f.lineCount,void 0,r,o),ge(H,c,"lineThickness",f.lineThickness,void 0,r,o),ge(H,c,"lineOffset",f.lineOffset,void 0,r,o)):u(n.image)?(c instanceof pg||(c=new pg),f=n.image,ge(Image,c,"image",f.image,void 0,r,o),ge(H,c,"repeat",f.repeat,void 0,r,o),ge(z,c,"color",f.color,void 0,r,o),ge(Boolean,c,"transparent",f.transparent,void 0,r,o)):u(n.stripe)?(c instanceof eb||(c=new eb),f=n.stripe,ge(Kd,c,"orientation",f.orientation,void 0,r,o),ge(z,c,"evenColor",f.evenColor,void 0,r,o),ge(z,c,"oddColor",f.oddColor,void 0,r,o),ge(Number,c,"offset",f.offset,void 0,r,o),ge(Number,c,"repeat",f.repeat,void 0,r,o)):u(n.polylineOutline)?(c instanceof py||(c=new py),f=n.polylineOutline,ge(z,c,"color",f.color,void 0,r,o),ge(z,c,"outlineColor",f.outlineColor,void 0,r,o),ge(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):u(n.polylineGlow)?(c instanceof JE||(c=new JE),f=n.polylineGlow,ge(z,c,"color",f.color,void 0,r,o),ge(Number,c,"glowPower",f.glowPower,void 0,r,o),ge(Number,c,"taperPower",f.taperPower,void 0,r,o)):u(n.polylineArrow)?(c instanceof qE||(c=new qE),f=n.polylineArrow,ge(z,c,"color",f.color,void 0,void 0,o)):u(n.polylineDash)?(c instanceof XE||(c=new XE),f=n.polylineDash,ge(z,c,"color",f.color,void 0,void 0,o),ge(z,c,"gapColor",f.gapColor,void 0,void 0,o),ge(Number,c,"dashLength",f.dashLength,void 0,r,o),ge(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):u(n.checkerboard)&&(c instanceof ME||(c=new ME),f=n.checkerboard,ge(z,c,"evenColor",f.evenColor,void 0,r,o),ge(z,c,"oddColor",f.oddColor,void 0,r,o),ge(H,c,"repeat",f.repeat,void 0,r,o)),u(l)?l.data=c:e[t]=c}function gu(e,t,n,i,r,o){if(u(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)zle(e,t,n[s],i,r,o);else zle(e,t,n,i,r,o)}function Rje(e,t,n,i){let r=t.name;u(r)&&(e.name=t.name)}function Bje(e,t,n,i){let r=t.description;u(r)&&ge(String,e,"description",r,void 0,i,n)}function Lje(e,t,n,i){let r=t.position;u(r)&&Zle(e,"position",r,void 0,i,n)}function Nje(e,t,n,i){let r=t.viewFrom;u(r)&&ge(m,e,"viewFrom",r,void 0,i,n)}function Fje(e,t,n,i){let r=t.orientation;u(r)&&ge(Le,e,"orientation",r,void 0,i,n)}function Uje(e,t,n,i){let r=t.properties;if(u(r)){u(e.properties)||(e.properties=new pl);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)ck(Lle(s[a]),e.properties,o,s[a],void 0,i,n);else ck(Lle(s),e.properties,o,s,void 0,i,n)}}}function lk(e,t,n,i,r,o,s){let a=n.map(function(c){return HR(r,c)});if(u(i)){i=co(i);let c=e[t];if(!(c instanceof s)){let l=new s;l.intervals.addInterval(OW(c)),e[t]=c=l}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function Hle(e,t,n,i){let r=n.references;u(r)?lk(e,t,r,n.interval,i,QE,oc):ge(Array,e,t,n,void 0,void 0,i)}function Gle(e,t,n,i){if(u(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Hle(e,t,n[r],i);else Hle(e,t,n,i)}function Wle(e,t,n,i){let r=n.references;u(r)?lk(e,t,r,n.interval,i,y_,na):(u(n.cartesian)?n.array=m.unpackArray(n.cartesian):u(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians):u(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees)),u(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function jR(e,t,n,i){if(u(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Wle(e,t,n[r],i);else Wle(e,t,n,i)}function Vje(e){return m.unpackArray(e)}function kje(e){return m.fromRadiansArrayHeights(e)}function zje(e){return m.fromDegreesArrayHeights(e)}function jle(e,t,n,i){let r=n.references;if(u(r)){let o=r.map(function(s){let a={};return lk(a,"positions",s,n.interval,i,y_,na),a.positions});e[t]=new y_(o)}else u(n.cartesian)?n.array=n.cartesian.map(Vje):u(n.cartographicRadians)?n.array=n.cartographicRadians.map(kje):u(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(zje)),u(n.array)&&ge(Array,e,t,n,void 0,void 0,i)}function Hje(e,t,n,i){if(u(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)jle(e,t,n[r],i);else jle(e,t,n,i)}function Gje(e,t,n,i){if(u(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)kle(e,t,n[r],i);else kle(e,t,n,i)}function Wje(e,t,n,i){let r=t.availability;if(!u(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)u(o)||(o=new Oo),o.addInterval(co(r[s]));else o=new Oo,o.addInterval(co(r));e.availability=o}function jje(e,t,n,i,r){u(t)&&ge(yy,e,"alignedAxis",t,n,i,r)}function qje(e,t,n,i){let r=t.billboard;if(!u(r))return;let o=co(r.interval),s=e.billboard;u(s)||(e.billboard=s=new ja),ge(Boolean,s,"show",r.show,o,i,n),ge(Image,s,"image",r.image,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(H,s,"pixelOffset",r.pixelOffset,o,i,n),ge(m,s,"eyeOffset",r.eyeOffset,o,i,n),ge(gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ge(On,s,"verticalOrigin",r.verticalOrigin,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(wf,s,"rotation",r.rotation,o,i,n),jje(s,r.alignedAxis,o,i,n),ge(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(Bt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Bt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Bt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ge(Ye,s,"imageSubRegion",r.imageSubRegion,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function Yje(e,t,n,i){let r=t.box;if(!u(r))return;let o=co(r.interval),s=e.box;u(s)||(e.box=s=new nA),ge(Boolean,s,"show",r.show,o,i,n),ge(m,s,"dimensions",r.dimensions,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Xje(e,t,n,i){let r=t.corridor;if(!u(r))return;let o=co(r.interval),s=e.corridor;u(s)||(e.corridor=s=new rA),ge(Boolean,s,"show",r.show,o,i,n),jR(s,"positions",r.positions,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(je,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(Ri,s,"cornerType",r.cornerType,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(zn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function Kje(e,t,n,i){let r=t.cylinder;if(!u(r))return;let o=co(r.interval),s=e.cylinder;u(s)||(e.cylinder=s=new oA),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"length",r.length,o,i,n),ge(Number,s,"topRadius",r.topRadius,o,i,n),ge(Number,s,"bottomRadius",r.bottomRadius,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ge(Number,s,"slices",r.slices,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Jje(e,t){let n=e.version;if(u(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new de("Cesium only supports CZML version 1.");t._version=n}}if(!u(t._version))throw new de("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;u(e.name)&&(i.name=e.name);let r=e.clock;if(u(r)){let o=i.clock;u(o)?(o.interval=y(r.interval,o.interval),o.currentTime=y(r.currentTime,o.currentTime),o.range=y(r.range,o.range),o.step=y(r.step,o.step),o.multiplier=y(r.multiplier,o.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function Zje(e,t,n,i){let r=t.ellipse;if(!u(r))return;let o=co(r.interval),s=e.ellipse;u(s)||(e.ellipse=s=new sA),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),ge(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(je,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(wf,s,"rotation",r.rotation,o,i,n),ge(wf,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(zn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function Qje(e,t,n,i){let r=t.ellipsoid;if(!u(r))return;let o=co(r.interval),s=e.ellipsoid;u(s)||(e.ellipsoid=s=new aA),ge(Boolean,s,"show",r.show,o,i,n),ge(m,s,"radii",r.radii,o,i,n),ge(m,s,"innerRadii",r.innerRadii,o,i,n),ge(Number,s,"minimumClock",r.minimumClock,o,i,n),ge(Number,s,"maximumClock",r.maximumClock,o,i,n),ge(Number,s,"minimumCone",r.minimumCone,o,i,n),ge(Number,s,"maximumCone",r.maximumCone,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"stackPartitions",r.stackPartitions,o,i,n),ge(Number,s,"slicePartitions",r.slicePartitions,o,i,n),ge(Number,s,"subdivisions",r.subdivisions,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function $je(e,t,n,i){let r=t.label;if(!u(r))return;let o=co(r.interval),s=e.label;u(s)||(e.label=s=new hd),ge(Boolean,s,"show",r.show,o,i,n),ge(String,s,"text",r.text,o,i,n),ge(String,s,"font",r.font,o,i,n),ge(Hr,s,"style",r.style,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Boolean,s,"showBackground",r.showBackground,o,i,n),ge(z,s,"backgroundColor",r.backgroundColor,o,i,n),ge(H,s,"backgroundPadding",r.backgroundPadding,o,i,n),ge(H,s,"pixelOffset",r.pixelOffset,o,i,n),ge(m,s,"eyeOffset",r.eyeOffset,o,i,n),ge(gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ge(On,s,"verticalOrigin",r.verticalOrigin,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"fillColor",r.fillColor,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Bt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Bt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ge(Bt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function eqe(e,t,n,i){let r=t.model;if(!u(r))return;let o=co(r.interval),s=e.model;u(s)||(e.model=s=new _p),ge(Boolean,s,"show",r.show,o,i,n),ge(WR.default,s,"uri",r.gltf,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),ge(Number,s,"maximumScale",r.maximumScale,o,i,n),ge(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),ge(Boolean,s,"runAnimations",r.runAnimations,o,i,n),ge(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),ge(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),ge(z,s,"color",r.color,o,i,n),ge($a,s,"colorBlendMode",r.colorBlendMode,o,i,n),ge(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,l=r.nodeTransformations;if(u(l))if(Array.isArray(l))for(a=0,c=l.length;a<c;++a)qle(s,l[a],o,i,n);else qle(s,l,o,i,n);let f=r.articulations;if(u(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Yle(s,f[a],o,i,n);else Yle(s,f,o,i,n)}function qle(e,t,n,i,r){let o=co(t.interval);u(n)&&(u(o)?o=Tn.intersect(o,n,xx):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,l=a.length;c<l;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!u(d))continue;u(s)||(e.nodeTransformations=s=new pl),s.hasProperty(f)||s.addProperty(f);let p=s[f];u(p)||(s[f]=p=new cA),ge(m,p,"translation",d.translation,o,i,r),ge(Le,p,"rotation",d.rotation,o,i,r),ge(m,p,"scale",d.scale,o,i,r)}}function Yle(e,t,n,i,r){let o=co(t.interval);u(n)&&(u(o)?o=Tn.intersect(o,n,xx):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,l=a.length;c<l;++c){let f=a[c];if(f==="interval")continue;let d=t[f];u(d)&&(u(s)||(e.articulations=s=new pl),s.hasProperty(f)||s.addProperty(f),ge(Number,s,f,d,o,i,r))}}function tqe(e,t,n,i){let r=t.path;if(!u(r))return;let o=co(r.interval),s=e.path;u(s)||(e.path=s=new gp),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"leadTime",r.leadTime,o,i,n),ge(Number,s,"trailTime",r.trailTime,o,i,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"resolution",r.resolution,o,i,n),gu(s,"material",r.material,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function nqe(e,t,n,i){let r=t.point;if(!u(r))return;let o=co(r.interval),s=e.point;u(s)||(e.point=s=new uA),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"pixelSize",r.pixelSize,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Bt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Bt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function GR(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(GR.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!u(e)||e.isConstant)&&(!u(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});GR.prototype.getValue=function(e,t){let n;u(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return u(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),u(i)&&(i=i.map(function(r){return new Bc(r)}))),u(t)?(t.positions=n,t.holes=i,t):new Bc(n,i)};GR.prototype.equals=function(e){return this===e||e instanceof GR&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function iqe(e,t,n,i){let r=t.polygon;if(!u(r))return;let o=co(r.interval),s=e.polygon;u(s)||(e.polygon=s=new pd),ge(Boolean,s,"show",r.show,o,i,n),jR(s,"_positions",r.positions,n),Hje(s,"_holes",r.holes,n),(u(s._positions)||u(s._holes))&&(s.hierarchy=new GR(s)),ge(Number,s,"height",r.height,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(je,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(wf,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),ge(Boolean,s,"closeTop",r.closeTop,o,i,n),ge(Boolean,s,"closeBottom",r.closeBottom,o,i,n),ge(Jt,s,"arcType",r.arcType,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(zn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function rqe(e){return e?Jt.GEODESIC:Jt.NONE}function oqe(e,t,n,i){let r=t.polyline;if(!u(r))return;let o=co(r.interval),s=e.polyline;if(u(s)||(e.polyline=s=new Xa),ge(Boolean,s,"show",r.show,o,i,n),jR(s,"positions",r.positions,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),gu(s,"material",r.material,o,i,n),gu(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),ge(Jt,s,"arcType",r.arcType,o,i,n),ge(Boolean,s,"clampToGround",r.clampToGround,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(zn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n),u(r.followSurface)&&!u(r.arcType)){let a={};ge(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=Tje(a.followSurface,rqe)}}function sqe(e,t,n,i){let r=t.polylineVolume;if(!u(r))return;let o=co(r.interval),s=e.polylineVolume;u(s)||(e.polylineVolume=s=new fA),jR(s,"positions",r.positions,n),Gje(s,"shape",r.shape,n),ge(Boolean,s,"show",r.show,o,i,n),ge(Ri,s,"cornerType",r.cornerType,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function aqe(e,t,n,i){let r=t.rectangle;if(!u(r))return;let o=co(r.interval),s=e.rectangle;u(s)||(e.rectangle=s=new _d),ge(Boolean,s,"show",r.show,o,i,n),ge(ce,s,"coordinates",r.coordinates,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(je,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(je,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(wf,s,"rotation",r.rotation,o,i,n),ge(wf,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(zn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function cqe(e,t,n,i){let r=t.tileset;if(!u(r))return;let o=co(r.interval),s=e.tileset;u(s)||(e.tileset=s=new lA),ge(Boolean,s,"show",r.show,o,i,n),ge(WR.default,s,"uri",r.uri,o,i,n),ge(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function lqe(e,t,n,i){let r=t.wall;if(!u(r))return;let o=co(r.interval),s=e.wall;u(s)||(e.wall=s=new yp),ge(Boolean,s,"show",r.show,o,i,n),jR(s,"positions",r.positions,n),Gle(s,"minimumHeights",r.minimumHeights,n),Gle(s,"maximumHeights",r.maximumHeights,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),gu(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(wt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Xle(e,t,n,i,r){let o=e.id;if(u(o)||(o=jn()),IW=o,!u(r._version)&&o!=="document")throw new de("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")Jje(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;u(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}IW=void 0}function uqe(e){let t,n=e._documentPacket.clock;if(!u(n)){if(!u(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(ze.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=ee.secondsDifference(s,o),c=Math.round(a/120);return t=new Yd,t.startTime=ee.clone(o),t.stopTime=ee.clone(s),t.clockRange=Bo.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(o),t.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}u(e._clock)?t=e._clock.clone():(t=new Yd,t.startTime=ze.MINIMUM_VALUE.clone(),t.stopTime=ze.MAXIMUM_VALUE.clone(),t.currentTime=ze.MINIMUM_VALUE.clone(),t.clockRange=Bo.LOOP_STOP,t.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=co(n.interval);return u(i)&&(t.startTime=i.start,t.stopTime=i.stop),u(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),u(n.range)&&(t.clockRange=y(Bo[n.range],Bo.LOOP_STOP)),u(n.step)&&(t.clockStep=y(yr[n.step],yr.SYSTEM_CLOCK_MULTIPLIER)),u(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Qle(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Dt(s)),e._credit=s,typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),r=t.fetchJson(),o=y(o,t.clone());let a=e._resourceCredits,c=t.credits;if(u(c)){let l=c.length;for(let f=0;f<l;f++)a.push(c[f])}}return o=we.createIfNeeded(o),Mo.setLoading(e,!0),Promise.resolve(r).then(function(a){return fqe(e,a,o,i)}).catch(function(a){return Mo.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function fqe(e,t,n,i){Mo.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new $le,r.removeAll()),Dl._processCzml(t,r,n,void 0,e);let o=uqe(e),s=e._documentPacket;return u(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!u(e._name)&&u(n)&&(e._name=__(n.getUrlComponent()),o=!0),Mo.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function $le(){this.name=void 0,this.clock=void 0}function Dl(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new $le,this._version=void 0,this._entityCollection=new Ns(this),this._entityCluster=new du,this._credit=void 0,this._resourceCredits=[]}Dl.load=function(e,t){return new Dl().load(e,t)};Object.defineProperties(Dl.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Dl.updaters=[qje,Yje,Xje,Kje,Zje,Qje,$je,eqe,Rje,Bje,tqe,nqe,iqe,oqe,sqe,Uje,aqe,Lje,cqe,Nje,lqe,Fje,Wje];Dl.prototype.process=function(e,t){return Qle(this,e,t,!1)};Dl.prototype.load=function(e,t){return Qle(this,e,t,!0)};Dl.prototype.update=function(e){return!0};Dl.processPacketData=ge;Dl.processPositionPacketData=Zle;Dl.processMaterialPacketData=gu;Dl._processCzml=function(e,t,n,i,r){if(i=y(i,Dl.updaters),Array.isArray(e))for(let o=0,s=e.length;o<s;++o)Xle(e[o],t,i,n,r);else Xle(e,t,i,n,r)};var qR=Dl;function qc(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(qc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});qc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};qc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};qc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};qc.prototype.contains=function(e){return this.indexOf(e)!==-1};qc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};qc.prototype.get=function(e){return this._dataSources[e]};qc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function uk(e,t){return e.indexOf(t)}function eue(e,t,n){let i=e._dataSources,r=i.length-1;if(t=P.clamp(t,0,r),n=P.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}qc.prototype.raise=function(e){let t=uk(this._dataSources,e);eue(this,t,t+1)};qc.prototype.lower=function(e){let t=uk(this._dataSources,e);eue(this,t,t-1)};qc.prototype.raiseToTop=function(e){let t=uk(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};qc.prototype.lowerToBottom=function(e){let t=uk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};qc.prototype.isDestroyed=function(){return!1};qc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var YR=qc;function oa(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=jn(),this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(oa.prototype,{length:{get:function(){return this._primitives.length}}});oa.prototype.add=function(e,t){let n=u(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e};oa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1};oa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};oa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]};oa.prototype.contains=function(e){return!!(u(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function fk(e,t){return e._primitives.indexOf(t)}oa.prototype.raise=function(e){if(u(e)){let t=fk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};oa.prototype.raiseToTop=function(e){if(u(e)){let t=fk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};oa.prototype.lower=function(e){if(u(e)){let t=fk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};oa.prototype.lowerToBottom=function(e){if(u(e)){let t=fk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};oa.prototype.get=function(e){return this._primitives[e]};oa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};oa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];u(i.prePassesUpdate)&&i.prePassesUpdate(e)}};oa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];u(r.updateForPass)&&r.updateForPass(e,t)}};oa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];u(i.postPassesUpdate)&&i.postPassesUpdate(e)}};oa.prototype.isDestroyed=function(){return!1};oa.prototype.destroy=function(){return this.removeAll(),ue(this)};var Il=oa;function ch(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(ch.prototype,{length:{get:function(){return this._length}}});ch.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!u(n)){n=new Il({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};ch.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};ch.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};ch.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};ch.prototype.contains=function(e){if(!u(e))return!1;let t=this._collections[e._zIndex];return u(t)&&t.contains(e)};ch.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){return this.removeAll(),ue(this)};var XR=ch;function nb(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Tt}nb.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};nb.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);u(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};nb.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};nb.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};nb.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),u(e)&&u(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var Cx=nb;var RW={},dk=new m,tue=new m,nue=new Le,iue=new Q;function ib(e,t,n,i,r,o,s,a,c,l){let f=e+t;m.multiplyByScalar(i,Math.cos(f),dk),m.multiplyByScalar(n,Math.sin(f),tue),m.add(dk,tue,dk);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let h=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(dk,h,nue),Q.fromQuaternion(nue,iue),Q.multiplyByVector(iue,c,l),m.normalize(l,l),m.multiplyByScalar(l,a,l),l}var rue=new m,oue=new m,MW=new m,dqe=new m;RW.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,l=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=m.fromArray(e,f,rue);i.scaleToGeodeticSurface(g,g);let h=m.clone(g,oue),A=i.geodeticSurfaceNormal(g,dqe),x=m.multiplyByScalar(A,r,MW);m.add(g,x,g),n&&(m.multiplyByScalar(A,o,x),m.add(h,x,h),a[f+l]=h.x,a[d+l]=h.y,a[p+l]=h.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var mqe=new m,hqe=new m,pqe=new m;RW.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,l=r*r,f=r*i,d=m.magnitude(s),p=m.normalize(s,mqe),g=m.cross(m.UNIT_Z,s,hqe);g=m.normalize(g,g);let h=m.cross(p,g,pqe),A=1+Math.ceil(P.PI_OVER_TWO/a),x=P.PI_OVER_TWO/(A-1),C=P.PI_OVER_TWO-A*x;C<0&&(A-=Math.ceil(Math.abs(C)/x));let T=2*(A*(A+2)),E=t?new Array(T*3):void 0,S=0,w=rue,D=oue,M=A*4*3,O=M-1,B=0,L=n?new Array(M):void 0,_,b,v,I,R;for(C=P.PI_OVER_TWO,w=ib(C,o,h,g,c,f,l,d,p,w),t&&(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z),n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x),C=P.PI_OVER_TWO-x,_=1;_<A+1;++_){if(w=ib(C,o,h,g,c,f,l,d,p,w),D=ib(Math.PI-C,o,h,g,c,f,l,d,p,D),t){for(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,v=2*_+2,b=1;b<v-1;++b)I=b/(v-1),R=m.lerp(w,D,I,MW),E[S++]=R.x,E[S++]=R.y,E[S++]=R.z;E[S++]=D.x,E[S++]=D.y,E[S++]=D.z}n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,L[B++]=D.x,L[B++]=D.y,L[B++]=D.z),C=P.PI_OVER_TWO-(_+1)*x}for(_=A;_>1;--_){if(C=P.PI_OVER_TWO-(_-1)*x,w=ib(-C,o,h,g,c,f,l,d,p,w),D=ib(C+Math.PI,o,h,g,c,f,l,d,p,D),t){for(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,v=2*(_-1)+2,b=1;b<v-1;++b)I=b/(v-1),R=m.lerp(w,D,I,MW),E[S++]=R.x,E[S++]=R.y,E[S++]=R.z;E[S++]=D.x,E[S++]=D.y,E[S++]=D.z}n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,L[B++]=D.x,L[B++]=D.y,L[B++]=D.z)}C=P.PI_OVER_TWO,w=ib(-C,o,h,g,c,f,l,d,p,w);let F={};return t&&(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,F.positions=E,F.numPts=A),n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,F.outerPositions=L),F};var Pl=RW;var rb=new m,BW=new m,LW=new m,sue=new m,ds=new H,aue=new Q,_qe=new Q,NW=new Le,cue=new m,lue=new m,uue=new m,pk=new he,fue=new m,due=new H,mue=new H;function hue(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,l=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(l*2):void 0,p=i.normal?new Float32Array(l*3):void 0,g=i.tangent?new Float32Array(l*3):void 0,h=i.bitangent?new Float32Array(l*3):void 0,A=f?new Float32Array(l*3):void 0,x=0,C=cue,T=lue,E=uue,S=new Ii(a),w=S.project(a.cartesianToCartographic(r,pk),fue),D=a.scaleToGeodeticSurface(r,rb);a.geodeticSurfaceNormal(D,D);let M=aue,O=_qe;if(c!==0){let R=Le.fromAxisAngle(D,c,NW);M=Q.fromQuaternion(R,M),R=Le.fromAxisAngle(D,-c,NW),O=Q.fromQuaternion(R,O)}else M=Q.clone(Q.IDENTITY,M),O=Q.clone(Q.IDENTITY,O);let B=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,due),L=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,mue),_=e.length,b=n?_:0,v=b/3*2;for(let R=0;R<_;R+=3){let F=R+1,k=R+2,V=m.fromArray(e,R,rb);if(i.st){let G=Q.multiplyByVector(M,V,BW),U=S.project(a.cartesianToCartographic(G,pk),LW);m.subtract(U,w,U),ds.x=(U.x+o)/(2*o),ds.y=(U.y+s)/(2*s),B.x=Math.min(ds.x,B.x),B.y=Math.min(ds.y,B.y),L.x=Math.max(ds.x,L.x),L.y=Math.max(ds.y,L.y),n&&(d[x+v]=ds.x,d[x+1+v]=ds.y),d[x++]=ds.x,d[x++]=ds.y}(i.normal||i.tangent||i.bitangent||f)&&(C=a.geodeticSurfaceNormal(V,C),f&&(A[R+b]=-C.x,A[F+b]=-C.y,A[k+b]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=m.normalize(m.cross(m.UNIT_Z,C,T),T),Q.multiplyByVector(O,T,T)),i.normal&&(p[R]=C.x,p[F]=C.y,p[k]=C.z,n&&(p[R+b]=-C.x,p[F+b]=-C.y,p[k+b]=-C.z)),i.tangent&&(g[R]=T.x,g[F]=T.y,g[k]=T.z,n&&(g[R+b]=-T.x,g[F+b]=-T.y,g[k+b]=-T.z)),i.bitangent&&(E=m.normalize(m.cross(C,T,E),E),h[R]=E.x,h[F]=E.y,h[k]=E.z,n&&(h[R+b]=E.x,h[F+b]=E.y,h[k+b]=E.z))))}if(i.st){_=d.length;for(let R=0;R<_;R+=2)d[R]=(d[R]-B.x)/(L.x-B.x),d[R+1]=(d[R+1]-B.y)/(L.y-B.y)}let I=new mn;if(i.position){let R=Pl.raisePositionsToHeight(e,t,n);I.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R})}if(i.st&&(I.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),f&&(I.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),n&&u(t.offsetAttribute)){let R=new Uint8Array(l);if(t.offsetAttribute===on.TOP)R=R.fill(1,0,l/2);else{let F=t.offsetAttribute===on.NONE?0:1;R=R.fill(F)}I.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return I}function pue(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Tx=new m;function gqe(e){let t=e.center;Tx=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Tx),e.height,Tx),Tx=m.add(t,Tx,Tx);let n=new ae(Tx,e.semiMajorAxis),i=Pl.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=hue(r,e,!1),a=pue(o);return a=Fe.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function yqe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,l=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,h=n.tangent?new Float32Array(f*3):void 0,A=n.bitangent?new Float32Array(f*3):void 0,x=t.shadowVolume,C=x?new Float32Array(f*3):void 0,T=0,E=cue,S=lue,w=uue,D=new Ii(s),M=D.project(s.cartesianToCartographic(i,pk),fue),O=s.scaleToGeodeticSurface(i,rb);s.geodeticSurfaceNormal(O,O);let B=Le.fromAxisAngle(O,l,NW),L=Q.fromQuaternion(B,aue),_=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,due),b=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,mue),v=e.length,I=v/3*2;for(let F=0;F<v;F+=3){let k=F+1,V=F+2,G=m.fromArray(e,F,rb),U;if(n.st){let W=Q.multiplyByVector(L,G,BW),J=D.project(s.cartesianToCartographic(W,pk),LW);m.subtract(J,M,J),ds.x=(J.x+r)/(2*r),ds.y=(J.y+o)/(2*o),_.x=Math.min(ds.x,_.x),_.y=Math.min(ds.y,_.y),b.x=Math.max(ds.x,b.x),b.y=Math.max(ds.y,b.y),p[T+I]=ds.x,p[T+1+I]=ds.y,p[T++]=ds.x,p[T++]=ds.y}G=s.scaleToGeodeticSurface(G,G),U=m.clone(G,BW),E=s.geodeticSurfaceNormal(G,E),x&&(C[F+v]=-E.x,C[k+v]=-E.y,C[V+v]=-E.z);let Y=m.multiplyByScalar(E,a,sue);if(G=m.add(G,Y,G),Y=m.multiplyByScalar(E,c,Y),U=m.add(U,Y,U),n.position&&(d[F+v]=U.x,d[k+v]=U.y,d[V+v]=U.z,d[F]=G.x,d[k]=G.y,d[V]=G.z),n.normal||n.tangent||n.bitangent){w=m.clone(E,w);let W=m.fromArray(e,(F+3)%v,sue);m.subtract(W,G,W);let J=m.subtract(U,G,LW);E=m.normalize(m.cross(J,W,E),E),n.normal&&(g[F]=E.x,g[k]=E.y,g[V]=E.z,g[F+v]=E.x,g[k+v]=E.y,g[V+v]=E.z),n.tangent&&(S=m.normalize(m.cross(w,E,S),S),h[F]=S.x,h[k]=S.y,h[V]=S.z,h[F+v]=S.x,h[F+1+v]=S.y,h[F+2+v]=S.z),n.bitangent&&(A[F]=w.x,A[k]=w.y,A[V]=w.z,A[F+v]=w.x,A[k+v]=w.y,A[V+v]=w.z)}}if(n.st){v=p.length;for(let F=0;F<v;F+=2)p[F]=(p[F]-_.x)/(b.x-_.x),p[F+1]=(p[F+1]-_.y)/(b.y-_.y)}let R=new mn;if(n.position&&(R.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(R.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(R.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(R.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(R.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),x&&(R.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),u(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===on.TOP)F=F.fill(1,0,f/2);else{let k=t.offsetAttribute===on.NONE?0:1;F=F.fill(k)}R.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return R}function Aqe(e){let t=e.length/3,n=Fe.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var mk=new ae,hk=new ae;function xqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,rb),e.height,rb);mk.center=m.add(t,r,mk.center),mk.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),hk.center=m.add(t,r,hk.center),hk.radius=i;let o=Pl.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,l=ae.union(mk,hk),f=hue(s,e,!0),d=pue(a),p=d.length;d.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)d[S+p]=d[S+2]+g,d[S+1+p]=d[S+1]+g,d[S+2+p]=d[S]+g;let h=Fe.createTypedArray(g*2/3,d),A=new dt({attributes:f,indices:h,primitiveType:Be.TRIANGLES}),x=yqe(c,e);d=Aqe(c);let C=Fe.createTypedArray(c.length*2/3,d),T=new dt({attributes:x,indices:C,primitiveType:Be.TRIANGLES}),E=Nn.combineInstances([new Ct({geometry:A}),new Ct({geometry:T})]);return{boundingSphere:l,attributes:E[0].attributes,indices:E[0].indices}}function _ue(e,t,n,i,r,o,s){let c=Pl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,l=c.length/3,f=new Array(l);for(let p=0;p<l;++p)f[p]=m.fromArray(c,p*3);let d=ce.fromCartesianArray(f,o,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function uh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Pe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Pe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}uh.packedLength=m.packedLength+re.packedLength+Pe.packedLength+9;uh.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var gue=new m,yue=new re,Aue=new Pe,lh={center:gue,ellipsoid:yue,vertexFormat:Aue,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};uh.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,gue);t+=m.packedLength;let r=re.unpack(e,t,yue);t+=re.packedLength;let o=Pe.unpack(e,t,Aue);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return u(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=l,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(lh.height=f,lh.extrudedHeight=p,lh.granularity=d,lh.stRotation=l,lh.rotation=c,lh.semiMajorAxis=s,lh.semiMinorAxis=a,lh.shadowVolume=g,lh.offsetAttribute=h===-1?void 0:h,new uh(lh))};uh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,re.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return _ue(n,r,o,a,s,i,t)};uh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=xqe(r);else if(o=gqe(r),u(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===on.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Be.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};uh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new uh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};function Cqe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Pl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(uh.prototype,{rectangle:{get:function(){return u(this._rectangle)||(this._rectangle=_ue(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return u(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Cqe(this)),this._textureCoordinateRotationPoints}}});var Yc=uh;var xue=new m,Ex=new m;function Tqe(e){let t=e.center;Ex=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Ex),e.height,Ex),Ex=m.add(t,Ex,Ex);let n=new ae(Ex,e.semiMajorAxis),i=Pl.computeEllipsePositions(e,!1,!0).outerPositions,r=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Pl.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=Fe.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var _k=new ae,gk=new ae;function Eqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,xue),e.height,xue);_k.center=m.add(t,r,_k.center),_k.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),gk.center=m.add(t,r,gk.center),gk.radius=i;let o=Pl.computeEllipsePositions(e,!1,!0).outerPositions,s=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Pl.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ae.union(_k,gk),c=o.length/3;if(u(e.offsetAttribute)){let h=new Uint8Array(c);if(e.offsetAttribute===on.TOP)h=h.fill(1,0,c/2);else{let A=e.offsetAttribute===on.NONE?0:1;h=h.fill(A)}s.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let l=y(e.numberOfVerticalLines,16);l=P.clamp(l,0,c/2);let f=Fe.createTypedArray(c,c*2+l*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(l>0){let h=Math.min(l,c);g=Math.round(c/h);let A=Math.min(g*l,c);for(p=0;p<A;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function ob(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}ob.packedLength=m.packedLength+re.packedLength+8;ob.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Cue=new m,Tue=new re,T_={center:Cue,ellipsoid:Tue,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};ob.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Cue);t+=m.packedLength;let r=re.unpack(e,t,Tue);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++],p=e[t];return u(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=l,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(T_.height=c,T_.extrudedHeight=f,T_.granularity=l,T_.rotation=a,T_.semiMajorAxis=o,T_.semiMinorAxis=s,T_.numberOfVerticalLines=d,T_.offsetAttribute=p===-1?void 0:p,new ob(T_))};ob.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=Eqe(r);else if(o=Tqe(r),u(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===on.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Be.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var yu=ob;var Eue=new z,bue=m.ZERO,Sue=new m,vue=new ce;function bqe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Jd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new bqe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}u(Object.create)&&(Jd.prototype=Object.create(Kn.prototype),Jd.prototype.constructor=Jd);Jd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Eue)),u(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return u(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,bue,Sue))),new Ct({id:t,geometry:new Yc(this._options),attributes:i})};Jd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Eue),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return u(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,bue,Sue))),new Ct({id:t,geometry:new yu(this._options),attributes:o})};Jd.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Jd.prototype._isHidden=function(e,t){let n=e.position;return!u(n)||!u(t.semiMajorAxis)||!u(t.semiMinorAxis)||ci.prototype._isHidden.call(this,e,t)};Jd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Jd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,ze.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),r=q.getValueOrUndefined(t.extrudedHeight,ze.MINIMUM_VALUE),o=q.getValueOrDefault(t.extrudedHeightReference,ze.MINIMUM_VALUE,je.NONE);u(r)&&!u(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(ze.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(ze.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(ze.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=q.getValueOrUndefined(t.rotation,ze.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,ze.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,ze.MINIMUM_VALUE),s.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,ze.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Kn.getGeometryHeight(n,i),r=Kn.getGeometryExtrudedHeight(r,o),r===Kn.CLAMP_TO_GROUND&&(r=si.getMinimumMaximumHeights(Yc.computeRectangle(s,vue)).minimumTerrainHeight),s.extrudedHeight=r};Jd.DynamicGeometryUpdater=sb;function sb(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(sb.prototype=Object.create(ai.prototype),sb.prototype.constructor=sb);sb.prototype._isHidden=function(e,t,n){let i=this._options;return!u(i.center)||!u(i.semiMajorAxis)||!u(i.semiMinorAxis)||ai.prototype._isHidden.call(this,e,t,n)};sb.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,je.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,je.NONE);u(s)&&!u(r)&&(r=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(Yc.computeRectangle(i,vue)).minimumTerrainHeight),i.extrudedHeight=s};var KR=Jd;var Sqe=new m,vqe=new m,wqe=new m,Dqe=new m,Iqe=new m,Pqe=new m(1,1,1),wue=Math.cos,Due=Math.sin;function E_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,Pqe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,P.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),l=y(e.vertexFormat,Pe.DEFAULT);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Pe.clone(l),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}E_.packedLength=2*m.packedLength+Pe.packedLength+7;E_.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Iue=new m,Pue=new m,Oue=new Pe,Ay={radii:Iue,innerRadii:Pue,vertexFormat:Oue,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};E_.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Iue);t+=m.packedLength;let r=m.unpack(e,t,Pue);t+=m.packedLength;let o=Pe.unpack(e,t,Oue);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++],p=e[t];return u(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=l,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(Ay.minimumClock=s,Ay.maximumClock=a,Ay.minimumCone=c,Ay.maximumCone=l,Ay.stackPartitions=f,Ay.slicePartitions=d,Ay.offsetAttribute=p===-1?void 0:p,new E_(Ay))};E_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,l=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/P.TWO_PI),l=Math.round(l*Math.abs(s-o)/P.PI),c<2&&(c=2),l<2&&(l=2);let f,d,p=0,g=[o],h=[i];for(f=0;f<l;f++)g.push(o+f*(s-o)/(l-1));for(g.push(s),d=0;d<c;d++)h.push(i+d*(r-i)/(c-1));h.push(r);let A=g.length,x=h.length,C=0,T=1,E=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,w=!1,D=!1;E&&(T=2,o>0&&(S=!0,C+=c-1),s<Math.PI&&(w=!0,C+=c-1),(r-i)%P.TWO_PI?(D=!0,C+=(l-1)*2+1):C+=1);let M=x*A*T,O=new Float64Array(M*3),B=new Array(M).fill(!1),L=new Array(M).fill(!1),_=c*l*T,b=6*(_+C+1-(c+l)*T),v=Fe.createTypedArray(_,b),I=a.normal?new Float32Array(M*3):void 0,R=a.tangent?new Float32Array(M*3):void 0,F=a.bitangent?new Float32Array(M*3):void 0,k=a.st?new Float32Array(M*2):void 0,V=new Array(A),G=new Array(A);for(f=0;f<A;f++)V[f]=Due(g[f]),G[f]=wue(g[f]);let U=new Array(x),Y=new Array(x);for(d=0;d<x;d++)Y[d]=wue(h[d]),U[d]=Due(h[d]);for(f=0;f<A;f++)for(d=0;d<x;d++)O[p++]=t.x*V[f]*Y[d],O[p++]=t.y*V[f]*U[d],O[p++]=t.z*G[f];let W=M/2;if(E)for(f=0;f<A;f++)for(d=0;d<x;d++)O[p++]=n.x*V[f]*Y[d],O[p++]=n.y*V[f]*U[d],O[p++]=n.z*G[f],B[W]=!0,f>0&&f!==A-1&&d!==0&&d!==x-1&&(L[W]=!0),W++;p=0;let J,j;for(f=1;f<A-2;f++)for(J=f*x,j=(f+1)*x,d=1;d<x-2;d++)v[p++]=j+d,v[p++]=j+d+1,v[p++]=J+d+1,v[p++]=j+d,v[p++]=J+d+1,v[p++]=J+d;if(E){let nt=A*x;for(f=1;f<A-2;f++)for(J=nt+f*x,j=nt+(f+1)*x,d=1;d<x-2;d++)v[p++]=j+d,v[p++]=J+d,v[p++]=J+d+1,v[p++]=j+d,v[p++]=J+d+1,v[p++]=j+d+1}let K,Z;if(E){if(S)for(Z=A*x,f=1;f<x-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=Z+f+1,v[p++]=f,v[p++]=Z+f+1,v[p++]=Z+f;if(w)for(K=A*x-x,Z=A*x*T-x,f=1;f<x-2;f++)v[p++]=K+f+1,v[p++]=K+f,v[p++]=Z+f,v[p++]=K+f+1,v[p++]=Z+f,v[p++]=Z+f+1}if(D){for(f=1;f<A-2;f++)Z=x*A+x*f,K=x*f,v[p++]=Z,v[p++]=K+x,v[p++]=K,v[p++]=Z,v[p++]=Z+x,v[p++]=K+x;for(f=1;f<A-2;f++)Z=x*A+x*(f+1)-1,K=x*(f+1)-1,v[p++]=K+x,v[p++]=Z,v[p++]=K,v[p++]=K+x,v[p++]=Z+x,v[p++]=Z}let me=new mn;a.position&&(me.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:O}));let ye=0,se=0,pe=0,Ae=0,De=M/2,Ce,Re=re.fromCartesian3(t),tt=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<M;f++){Ce=B[f]?tt:Re;let nt=m.fromArray(O,f*3,Sqe),Wt=Ce.geodeticSurfaceNormal(nt,vqe);if(L[f]&&m.negate(Wt,Wt),a.st){let un=H.negate(Wt,Iqe);k[ye++]=Math.atan2(un.y,un.x)/P.TWO_PI+.5,k[ye++]=Math.asin(Wt.z)/Math.PI+.5}if(a.normal&&(I[se++]=Wt.x,I[se++]=Wt.y,I[se++]=Wt.z),a.tangent||a.bitangent){let un=wqe,pt=0,gn;if(B[f]&&(pt=De),!S&&f>=pt&&f<pt+x*2?gn=m.UNIT_X:gn=m.UNIT_Z,m.cross(gn,Wt,un),m.normalize(un,un),a.tangent&&(R[pe++]=un.x,R[pe++]=un.y,R[pe++]=un.z),a.bitangent){let Bn=m.cross(Wt,un,Dqe);m.normalize(Bn,Bn),F[Ae++]=Bn.x,F[Ae++]=Bn.y,F[Ae++]=Bn.z}}}a.st&&(me.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:k})),a.normal&&(me.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:R})),a.bitangent&&(me.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}))}if(u(e._offsetAttribute)){let nt=O.length,Wt=e._offsetAttribute===on.NONE?0:1,un=new Uint8Array(nt/3).fill(Wt);me.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:un})}return new dt({attributes:me,indices:v,primitiveType:Be.TRIANGLES,boundingSphere:ae.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var FW;E_.getUnitEllipsoid=function(){return u(FW)||(FW=E_.createGeometry(new E_({radii:new m(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),FW};var Us=E_;var Oqe=new Vt(z.WHITE),UW=m.ZERO,VW=new m,Mqe=new m,Rqe=new m,kW=new z,Bqe=new m(1,1,1);function Lqe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Au(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new Lqe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}u(Object.create)&&(Au.prototype=Object.create(ci.prototype),Au.prototype.constructor=Au);Object.defineProperties(Au.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Au.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new An(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=kn.fromDistanceDisplayCondition(a),l={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let f;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,kW)),u(f)||(f=z.WHITE),o=zt.fromColor(f),l.color=o}return u(this._options.offsetAttribute)&&(l.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,UW,VW))),new Ct({id:i,geometry:new Us(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:l})};Au.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,kW),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new An(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return u(this._options.offsetAttribute)&&(a.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,UW,VW))),new Ct({id:i,geometry:new fu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};Au.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Au.prototype._isHidden=function(e,t){return!u(e.position)||!u(t.radii)||ci.prototype._isHidden.call(this,e,t)};Au.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};Au.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(ze.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,ze.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,ze.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,ze.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,ze.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,ze.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,ze.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,ze.MINIMUM_VALUE),i.offsetAttribute=n!==je.NONE?on.ALL:void 0};Au.prototype._onEntityPropertyChanged=Ap;Au.DynamicGeometryUpdater=JR;function JR(e,t,n){ai.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new N,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}u(Object.create)&&(JR.prototype=Object.create(ai.prototype),JR.prototype.constructor=JR);JR.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){u(this._primitive)&&(this._primitive.show=!1),u(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,Mqe),r=u(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!u(r)||!u(i)){u(this._primitive)&&(this._primitive.show=!1),u(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=q.getValueOrDefault(n.fill,e,!0),s=q.getValueOrDefault(n.outline,e,!1),a=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,kW),c=Kr.getValue(e,y(n.material,Oqe),this._material),l=q.getValueOrUndefined(n.innerRadii,e,Rqe),f=q.getValueOrUndefined(n.minimumClock,e),d=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),g=q.getValueOrUndefined(n.maximumCone,e),h=q.getValueOrUndefined(n.stackPartitions,e),A=q.getValueOrUndefined(n.slicePartitions,e),x=q.getValueOrUndefined(n.subdivisions,e),C=q.getValueOrDefault(n.outlineWidth,e,1),T=q.getValueOrDefault(n.heightReference,e,je.NONE),E=T!==je.NONE?on.ALL:void 0,S=this._scene.mode,w=S===ne.SCENE3D&&T===je.NONE,D=this._options,M=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,UW,VW);if(!w||this._lastSceneMode!==S||!u(this._primitive)||D.stackPartitions!==h||D.slicePartitions!==A||u(l)&&!m.equals(D.innerRadii!==l)||D.minimumClock!==f||D.maximumClock!==d||D.minimumCone!==p||D.maximumCone!==g||D.subdivisions!==x||this._lastOutlineWidth!==C||D.offsetAttribute!==E){let b=this._primitives;if(b.removeAndDestroy(this._primitive),b.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=C,D.stackPartitions=h,D.slicePartitions=A,D.subdivisions=x,D.offsetAttribute=E,D.radii=m.clone(w?Bqe:i,D.radii),u(l))if(w){let F=m.magnitude(i);D.innerRadii=m.fromElements(l.x/F,l.y/F,l.z/F,D.innerRadii)}else D.innerRadii=m.clone(l,D.innerRadii);else D.innerRadii=void 0;D.minimumClock=f,D.maximumClock=d,D.minimumCone=p,D.maximumCone=g;let v=new ur({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=v.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,w,this._modelMatrix);this._primitive=b.add(new Sn({geometryInstances:I,appearance:v,asynchronous:!1,shadows:M}));let R=this._geometryUpdater.createOutlineGeometryInstance(e,w,this._modelMatrix);this._outlinePrimitive=b.add(new Sn({geometryInstances:R,appearance:new sn({flat:!0,translucent:R.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:M})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=B,this._lastOffset=m.clone(L,this._lastOffset)}else if(this._primitive.ready){let b=this._primitive,v=this._outlinePrimitive;b.show=!0,v.show=!0,b.appearance.material=c;let I=this._attributes;u(I)||(I=b.getGeometryInstanceAttributes(t),this._attributes=I),o!==this._lastShow&&(I.show=An.toValue(o,I.show),this._lastShow=o);let R=this._outlineAttributes;u(R)||(R=v.getGeometryInstanceAttributes(t),this._outlineAttributes=R),s!==this._lastOutlineShow&&(R.show=An.toValue(s,R.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(R.color=zt.toValue(a,R.color),z.clone(a,this._lastOutlineColor)),wt.equals(B,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(B,I.distanceDisplayCondition),R.distanceDisplayCondition=kn.toValue(B,R.distanceDisplayCondition),wt.clone(B,this._lastDistanceDisplayCondition)),m.equals(L,this._lastOffset)||(I.offset=Zi.toValue(L,I.offset),R.offset=Zi.toValue(L,I.offset),m.clone(L,this._lastOffset))}w&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=N.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var ZR=Au;function ab(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}ab.packedLength=Pe.packedLength;ab.pack=function(e,t,n){return n=y(n,0),Pe.pack(e._vertexFormat,t,n),t};var Mue=new Pe,Nqe={vertexFormat:Mue};ab.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,Mue);return u(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n):new ab(Nqe)};var yk=new m(-.5,-.5,0),Ak=new m(.5,.5,0);ab.createGeometry=function(e){let t=e._vertexFormat,n=new mn,i,r;if(t.position){if(r=new Float64Array(4*3),r[0]=yk.x,r[1]=yk.y,r[2]=0,r[3]=Ak.x,r[4]=yk.y,r[5]=0,r[6]=Ak.x,r[7]=Ak.y,r[8]=0,r[9]=yk.x,r[10]=Ak.y,r[11]=0,n.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new dt({attributes:n,indices:i,primitiveType:Be.TRIANGLES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var QR=ab;function cb(){this._workerName="createPlaneOutlineGeometry"}cb.packedLength=0;cb.pack=function(e,t){return t};cb.unpack=function(e,t,n){return u(n)?n:new cb};var xy=new m(-.5,-.5,0),xk=new m(.5,.5,0);cb.createGeometry=function(){let e=new mn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=xy.x,n[1]=xy.y,n[2]=xy.z,n[3]=xk.x,n[4]=xy.y,n[5]=xy.z,n[6]=xk.x,n[7]=xk.y,n[8]=xy.z,n[9]=xy.x,n[10]=xk.y,n[11]=xy.z,e.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new dt({attributes:e,indices:t,primitiveType:Be.LINES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var $R=cb;var Fqe=new m,Rue=new z;function Uqe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function If(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new Uqe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}u(Object.create)&&(If.prototype=Object.create(ci.prototype),If.prototype.constructor=If);If.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let g;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Rue)),u(g)||(g=z.WHITE),r=zt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,l=this._options,f=t.computeModelMatrix(e),d=q.getValueOrDefault(c.plane,e,l.plane),p=q.getValueOrUndefined(c.dimensions,e,l.dimensions);return l.plane=d,l.dimensions=p,f=zW(d,p,f,f),new Ct({id:t,geometry:new QR(this._options),modelMatrix:f,attributes:i})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Rue),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=q.getValueOrDefault(o.plane,e,s.plane),l=q.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=l,a=zW(c,l,a,a),new Ct({id:t,geometry:new $R,modelMatrix:a,attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};If.prototype._isHidden=function(e,t){return!u(t.plane)||!u(t.dimensions)||!u(e.position)||ci.prototype._isHidden.call(this,e,t)};If.prototype._getIsClosed=function(e){return!1};If.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};If.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(ze.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(ze.MINIMUM_VALUE,i.dimensions)};If.DynamicGeometryUpdater=lb;function lb(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(lb.prototype=Object.create(ai.prototype),lb.prototype.constructor=lb);lb.prototype._isHidden=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(e.position,n,Fqe);return!u(r)||!u(i.plane)||!u(i.dimensions)||ai.prototype._isHidden.call(this,e,t,n)};lb.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var Vqe=new m,kqe=new m,zqe=new m,Hqe=new m,Gqe=new Q,Wqe=new Q,jqe=new N;function zW(e,t,n,i){let r=e.normal,o=e.distance,s=m.multiplyByScalar(r,-o,zqe),a=m.clone(m.UNIT_Z,kqe);P.equalsEpsilon(Math.abs(m.dot(a,r)),1,P.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,r,Vqe);a=m.cross(r,c,a),m.normalize(c,c),m.normalize(a,a);let l=Gqe;Q.setColumn(l,0,c,l),Q.setColumn(l,1,a,l),Q.setColumn(l,2,r,l);let f=m.fromElements(t.x,t.y,1,Hqe),d=Q.multiplyByScale(l,f,Wqe),p=N.fromRotationTranslation(d,s,jqe);return N.multiplyTransformation(n,p,i)}If.createPrimitiveMatrix=zW;var eB=If;var qqe=new m,Yqe=new Ye,Xqe=new H,Kqe=new H,Jqe=new m,Zqe=new m,Qqe=new m,tB=new m,$qe=new m,eYe=new m,Bue=new Le,tYe=new Q,nYe=new Q,iYe=new m;function rYe(e,t,n,i,r,o,s,a,c){let l=e.positions,f=ui.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Fe.createTypedArray(l.length,f.length);d.set(f);let p=tYe;if(i!==0){let _=Le.fromAxisAngle(s,i,Bue);if(p=Q.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,Bue);let b=Q.fromQuaternion(_,nYe);a=m.normalize(Q.multiplyByVector(b,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=Q.clone(Q.IDENTITY,p);let g=Kqe;t.st&&(g.x=n.x,g.y=n.y);let h=l.length,A=h*3,x=new Float64Array(A),C=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,S=t.st?new Float32Array(h*2):void 0,w=0,D=0,M=0,O=0,B=0;for(let _=0;_<h;_++){let b=l[_];if(x[w++]=b.x,x[w++]=b.y,x[w++]=b.z,t.st)if(u(r)&&r.positions.length===h)S[B++]=r.positions[_].x,S[B++]=r.positions[_].y;else{let v=Q.multiplyByVector(p,b,qqe),I=o(v,Xqe);H.subtract(I,g,I);let R=P.clamp(I.x/n.width,0,1),F=P.clamp(I.y/n.height,0,1);S[B++]=R,S[B++]=F}t.normal&&(C[D++]=s.x,C[D++]=s.y,C[D++]=s.z),t.tangent&&(T[O++]=a.x,T[O++]=a.y,T[O++]=a.z),t.bitangent&&(E[M++]=c.x,E[M++]=c.y,E[M++]=c.z)}let L=new mn;return t.position&&(L.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(L.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(L.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(L.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),t.st&&(L.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new dt({attributes:L,indices:d,primitiveType:Be.TRIANGLES})}function bx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=Pe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+Pe.packedLength+re.packedLength+(u(n)?Xn.computeHierarchyPackedLength(n,H):1)+2}bx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new bx(t)};bx.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._stRotation,u(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var oYe=re.clone(re.UNIT_SPHERE),sYe=new Pe,aYe={polygonHierarchy:{}};bx.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,oYe);t+=re.packedLength;let o=Pe.unpack(e,t,sYe);t+=Pe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);u(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return u(n)||(n=new bx(aYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};bx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=u(r),s=n.positions;if(s=Sr(s,m.equalsEpsilon,!0),s.length<3)return;let a=Jqe,c=Zqe,l=Qqe,f=$qe,d=eYe;if(!n_.computeProjectTo2DArguments(s,tB,f,d))return;if(a=m.cross(f,d,a),a=m.normalize(a,a),!m.equalsEpsilon(tB,m.ZERO,P.EPSILON6)){let B=e._ellipsoid.geodeticSurfaceNormal(tB,iYe);m.dot(a,B)<0&&(a=m.negate(a,a),f=m.negate(f,f))}let g=n_.createProjectPointsTo2DFunction(tB,f,d),h=n_.createProjectPointTo2DFunction(tB,f,d);t.tangent&&(c=m.clone(f,c)),t.bitangent&&(l=m.clone(d,l));let A=Xn.polygonsFromHierarchy(n,o,g,!1),x=A.hierarchy,C=A.polygons,T=function(B){return B},E=o?Xn.polygonsFromHierarchy(r,!0,T,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let S=ae.fromPoints(s),w=Xn.computeBoundingRectangle(a,h,s,i,Yqe),D=[];for(let B=0;B<C.length;B++){let L=new Ct({geometry:rYe(C[B],t,w,i,o?E[B]:void 0,h,a,c,l)});D.push(L)}let M=Nn.combineInstances(D)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=Fe.createTypedArray(M.attributes.position.values.length/3,M.indices);let O=M.attributes;return t.position||delete O.position,new dt({attributes:O,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S})};var nB=bx;var cYe=new he,Lue=new he;function lYe(e,t,n,i){let o=i.cartesianToCartographic(e,cYe).height,s=i.cartesianToCartographic(t,Lue);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Lue);a.height=o-100,i.cartographicToCartesian(a,n)}var uYe=new Ye,fYe=new m,dYe=new m,mYe=new m,hYe=new m,pYe=new m,_Ye=new m,Ck=new m,fh=new m,ub=new m,gYe=new H,yYe=new H,AYe=new m,Nue=new Le,xYe=new Q,CYe=new Q;function HW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=u(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,l=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.tangentPlane,p=e.ellipsoid,g=e.stRotation,h=e.perPositionHeight,A=gYe;A.x=f.x,A.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(h&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,D=0,M=dYe,O=mYe,B=hYe,L=!0,_=xYe,b=CYe;if(g!==0){let R=Le.fromAxisAngle(d._plane.normal,g,Nue);_=Q.fromQuaternion(R,_),R=Le.fromAxisAngle(d._plane.normal,-g,Nue),b=Q.fromQuaternion(R,b)}else _=Q.clone(Q.IDENTITY,_),b=Q.clone(Q.IDENTITY,b);let v=0,I=0;c&&l&&(v=s/2,I=s/3,s/=2);for(let R=0;R<s;R+=3){let F=m.fromArray(r,R,AYe);if(t.st&&!u(o)){let k=Q.multiplyByVector(_,F,fYe);k=p.scaleToGeodeticSurface(k,k);let V=d.projectPointOntoPlane(k,yYe);H.subtract(V,A,V);let G=P.clamp(V.x/f.width,0,1),U=P.clamp(V.y/f.height,0,1);l&&(x[w+I]=G,x[w+1+I]=U),c&&(x[w]=G,x[w+1]=U),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=D+1,V=D+2;if(a){if(R+3<s){let G=m.fromArray(r,R+3,pYe);if(L){let U=m.fromArray(r,R+s,_Ye);h&&lYe(F,G,U,p),m.subtract(G,F,G),m.subtract(U,F,U),M=m.normalize(m.cross(U,G,M),M),L=!1}m.equalsEpsilon(G,F,P.EPSILON10)&&(L=!0)}(t.tangent||t.bitangent)&&(B=p.geodeticSurfaceNormal(F,B),t.tangent&&(O=m.normalize(m.cross(B,M,O),O)))}else M=p.geodeticSurfaceNormal(F,M),(t.tangent||t.bitangent)&&(h&&(Ck=m.fromArray(C,D,Ck),fh=m.cross(m.UNIT_Z,Ck,fh),fh=m.normalize(Q.multiplyByVector(b,fh,fh),fh),t.bitangent&&(ub=m.normalize(m.cross(Ck,fh,ub),ub))),O=m.cross(m.UNIT_Z,M,O),O=m.normalize(Q.multiplyByVector(b,O,O),O),t.bitangent&&(B=m.normalize(m.cross(M,O,B),B)));t.normal&&(e.wall?(C[D+v]=M.x,C[k+v]=M.y,C[V+v]=M.z):l&&(C[D+v]=-M.x,C[k+v]=-M.y,C[V+v]=-M.z),(c&&!h||a)&&(C[D]=M.x,C[k]=M.y,C[V]=M.z)),i&&(a&&(M=p.geodeticSurfaceNormal(F,M)),S[D+v]=-M.x,S[k+v]=-M.y,S[V+v]=-M.z),t.tangent&&(e.wall?(T[D+v]=O.x,T[k+v]=O.y,T[V+v]=O.z):l&&(T[D+v]=-O.x,T[k+v]=-O.y,T[V+v]=-O.z),c&&(h?(T[D]=fh.x,T[k]=fh.y,T[V]=fh.z):(T[D]=O.x,T[k]=O.y,T[V]=O.z))),t.bitangent&&(l&&(E[D+v]=B.x,E[k+v]=B.y,E[V+v]=B.z),c&&(h?(E[D]=ub.x,E[k]=ub.y,E[V]=ub.z):(E[D]=B.x,E[k]=B.y,E[V]=B.z))),D+=3}}t.st&&!u(o)&&(n.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&u(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===on.TOP)c&&l||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===on.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var TYe=new he,EYe=new he,Cy={westOverIDL:0,eastOverIDL:0},fb=new tf;function Vue(e,t,n,i,r){if(r=y(r,new ce),!u(e)||e.length<3)return r.west=0,r.north=0,r.south=0,r.east=0,r;if(n===Jt.RHUMB)return ce.fromCartesianArray(e,t,r);fb.ellipsoid.equals(t)||(fb=new tf(void 0,void 0,t)),r.west=Number.POSITIVE_INFINITY,r.east=Number.NEGATIVE_INFINITY,r.south=Number.POSITIVE_INFINITY,r.north=Number.NEGATIVE_INFINITY,Cy.westOverIDL=Number.POSITIVE_INFINITY,Cy.eastOverIDL=Number.NEGATIVE_INFINITY;let o=1/P.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],EYe),c=TYe,l;for(let f=1;f<s;f++)l=c,c=a,a=t.cartesianToCartographic(e[f],l),fb.setEndPoints(c,a),Fue(fb,o,r,Cy);return l=c,c=a,a=t.cartesianToCartographic(e[0],l),fb.setEndPoints(c,a),Fue(fb,o,r,Cy),r.east-r.west>Cy.eastOverIDL-Cy.westOverIDL&&(r.west=Cy.westOverIDL,r.east=Cy.eastOverIDL,r.east>P.PI&&(r.east=r.east-P.TWO_PI),r.west>P.PI&&(r.west=r.west-P.TWO_PI)),r}var bYe=new he;function Fue(e,t,n,i){let r=e.surfaceDistance,o=Math.ceil(r*t),s=o>0?r/(o-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<o;c++){let l=e.interpolateUsingSurfaceDistance(a,bYe);a+=s;let f=l.longitude,d=l.latitude;n.west=Math.min(n.west,f),n.east=Math.max(n.east,f),n.south=Math.min(n.south,d),n.north=Math.max(n.north,d);let p=f>=0?f:f+P.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var Uue=[];function SYe(e,t,n,i,r,o,s,a,c,l){let f={walls:[]},d;if(s||a){let T=Xn.createGeometryFromPositions(e,t,n,i,o,c,l),E=T.attributes.position.values,S=T.indices,w,D;if(s&&a){let M=E.concat(E);w=M.length/3,D=Fe.createTypedArray(w,S.length*2),D.set(S);let O=S.length,B=w/2;for(d=0;d<O;d+=3){let L=D[d]+B,_=D[d+1]+B,b=D[d+2]+B;D[d+O]=b,D[d+1+O]=_,D[d+2+O]=L}if(T.attributes.position.values=M,o&&c.normal){let L=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(M.length),T.attributes.normal.values.set(L)}if(c.st&&u(n)){let L=T.attributes.st.values;T.attributes.st.values=new Float32Array(w*2),T.attributes.st.values=L.concat(L)}T.indices=D}else if(a){for(w=E.length/3,D=Fe.createTypedArray(w,S.length),d=0;d<S.length;d+=3)D[d]=S[d+2],D[d+1]=S[d+1],D[d+2]=S[d];T.indices=D}f.topAndBottom=new Ct({geometry:T})}let p=r.outerRing,g=Aa.fromPoints(p,e),h=g.projectPointsOntoPlane(p,Uue),A=ui.computeWindingOrder2D(h);A===Qo.CLOCKWISE&&(p=p.slice().reverse());let x=Xn.computeWallGeometry(p,n,e,i,o,l);f.walls.push(new Ct({geometry:x}));let C=r.holes;for(d=0;d<C.length;d++){let T=C[d];g=Aa.fromPoints(T,e),h=g.projectPointsOntoPlane(T,Uue),A=ui.computeWindingOrder2D(h),A===Qo.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),x=Xn.computeWallGeometry(T,n,e,i,o,l),f.walls.push(new Ct({geometry:x}))}return f}function Zd(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Pe.DEFAULT),i=y(e.ellipsoid,re.WGS84),r=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&u(e.extrudedHeight),l=y(e.height,0),f=y(e.extrudedHeight,l);if(!c){let d=Math.max(l,f);f=Math.min(l,f),l=d}this._vertexFormat=Pe.clone(n),this._ellipsoid=re.clone(i),this._granularity=r,this._stRotation=o,this._height=l,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Jt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+re.packedLength+Pe.packedLength+(s?Xn.computeHierarchyPackedLength(s,H):1)+12}Zd.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Zd(t)};Zd.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,u(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var vYe=re.clone(re.UNIT_SPHERE),wYe=new Pe,DYe={polygonHierarchy:{}};Zd.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,vYe);t+=re.packedLength;let o=Pe.unpack(e,t,wYe);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,h=e[t++]===1,A=e[t++],x=e[t++],C=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);u(C)?(t=C.startingIndex,delete C.startingIndex):t++;let T=e[t++];return u(n)||(n=new Zd(DYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=l,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=h,n._offsetAttribute=A===-1?void 0:A,n._arcType=x,n._textureCoordinates=C,n.packedLength=T,n};Zd.computeRectangle=function(e,t){let n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.arcType,Jt.GEODESIC),r=e.polygonHierarchy,o=y(e.ellipsoid,re.WGS84);return Vue(r.positions,o,i,n,t)};Zd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,l=e._arcType,f=e._textureCoordinates,d=u(f),p=o.positions;if(p.length<3)return;let g=Aa.fromPoints(p,n),h=Xn.polygonsFromHierarchy(o,d,g.projectPointsOntoPlane.bind(g),!s,n),A=h.hierarchy,x=h.polygons,C=function(v){return v},T=d?Xn.polygonsFromHierarchy(f,!0,C,!1).polygons:void 0;if(A.length===0)return;p=A[0].outerRing;let E=Xn.computeBoundingRectangle(g.plane.normal,g.projectPointOntoPlane.bind(g),p,r,uYe),S=[],w=e._height,D=e._extrudedHeight,M=e._perPositionHeightExtrude||!P.equalsEpsilon(w,D,0,P.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,tangentPlane:g,boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:l},B;if(M)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,B=0;B<x.length;B++){let v=SYe(n,x[B],d?T[B]:void 0,i,A[B],s,a,c,t,l),I;a&&c?(I=v.topAndBottom,O.geometry=Xn.scaleToGeodeticHeightExtruded(I.geometry,w,D,n,s)):a?(I=v.topAndBottom,I.geometry.attributes.position.values=ui.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!s),O.geometry=I.geometry):c&&(I=v.topAndBottom,I.geometry.attributes.position.values=ui.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!0),O.geometry=I.geometry),(a||c)&&(O.wall=!1,I.geometry=HW(O),S.push(I));let R=v.walls;O.wall=!0;for(let F=0;F<R.length;F++){let k=R[F];O.geometry=Xn.scaleToGeodeticHeightExtruded(k.geometry,w,D,n,s),k.geometry=HW(O),S.push(k)}}else for(B=0;B<x.length;B++){let v=new Ct({geometry:Xn.createGeometryFromPositions(n,x[B],d?T[B]:void 0,i,s,t,l)});if(v.geometry.attributes.position.values=ui.scaleToGeodeticHeight(v.geometry.attributes.position.values,w,n,!s),O.geometry=v.geometry,v.geometry=HW(O),u(e._offsetAttribute)){let I=v.geometry.attributes.position.values.length,R=e._offsetAttribute===on.NONE?0:1,F=new Uint8Array(I/3).fill(R);v.geometry.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}S.push(v)}let L=Nn.combineInstances(S)[0];L.attributes.position.values=new Float64Array(L.attributes.position.values),L.indices=Fe.createTypedArray(L.attributes.position.values.length/3,L.indices);let _=L.attributes,b=ae.fromVertices(_.position.values);return t.position||delete _.position,new dt({attributes:_,indices:L.indices,primitiveType:L.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};Zd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Zd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function IYe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return dt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(Zd.prototype,{rectangle:{get:function(){if(!u(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Vue(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return u(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=IYe(this)),this._textureCoordinateRotationPoints}}});var Sx=Zd;var kue=[],Tk=[];function PYe(e,t,n,i,r){let s=Aa.fromPoints(t,e).projectPointsOntoPlane(t,kue);ui.computeWindingOrder2D(s)===Qo.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,l,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),l=0;l<f;l++){let h=t[l],A=t[(l+1)%f];c[d++]=h.x,c[d++]=h.y,c[d++]=h.z,c[d++]=A.x,c[d++]=A.y,c[d++]=A.z}else{let h=0;if(r===Jt.GEODESIC)for(l=0;l<f;l++)h+=Xn.subdivideLineCount(t[l],t[(l+1)%f],n);else if(r===Jt.RHUMB)for(l=0;l<f;l++)h+=Xn.subdivideRhumbLineCount(e,t[l],t[(l+1)%f],n);for(c=new Float64Array(h*3),l=0;l<f;l++){let A;r===Jt.GEODESIC?A=Xn.subdivideLine(t[l],t[(l+1)%f],n,Tk):r===Jt.RHUMB&&(A=Xn.subdivideRhumbLine(e,t[l],t[(l+1)%f],n,Tk));let x=A.length;for(let C=0;C<x;++C)c[d++]=A[C]}}f=c.length/3;let p=f*2,g=Fe.createTypedArray(f,p);for(d=0,l=0;l<f-1;l++)g[d++]=l,g[d++]=l+1;return g[d++]=f-1,g[d++]=0,new Ct({geometry:new dt({attributes:new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Be.LINES})})}function OYe(e,t,n,i,r){let s=Aa.fromPoints(t,e).projectPointsOntoPlane(t,kue);ui.computeWindingOrder2D(s)===Qo.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,l,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),l=0;l<f;++l){d[l]=p/3;let x=t[l],C=t[(l+1)%f];c[p++]=x.x,c[p++]=x.y,c[p++]=x.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let x=0;if(r===Jt.GEODESIC)for(l=0;l<f;l++)x+=Xn.subdivideLineCount(t[l],t[(l+1)%f],n);else if(r===Jt.RHUMB)for(l=0;l<f;l++)x+=Xn.subdivideRhumbLineCount(e,t[l],t[(l+1)%f],n);for(c=new Float64Array(x*3*2),l=0;l<f;++l){d[l]=p/3;let C;r===Jt.GEODESIC?C=Xn.subdivideLine(t[l],t[(l+1)%f],n,Tk):r===Jt.RHUMB&&(C=Xn.subdivideRhumbLine(e,t[l],t[(l+1)%f],n,Tk));let T=C.length;for(let E=0;E<T;++E)c[p++]=C[E]}}f=c.length/(3*2);let g=d.length,h=(f*2+g)*2,A=Fe.createTypedArray(f+g,h);for(p=0,l=0;l<f;++l)A[p++]=l,A[p++]=(l+1)%f,A[p++]=l+f,A[p++]=(l+1)%f+f;for(l=0;l<g;l++){let x=d[l];A[p++]=x,A[p++]=x+f}return new Ct({geometry:new dt({attributes:new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:A,primitiveType:Be.LINES})})}function vx(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,re.WGS84),i=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.perPositionHeight,!1),o=r&&u(e.extrudedHeight),s=y(e.arcType,Jt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!o){let l=Math.max(a,c);c=Math.min(a,c),a=l}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+re.packedLength+8}vx.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var MYe=re.clone(re.UNIT_SPHERE),RYe={polygonHierarchy:{}};vx.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,MYe);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,l=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return u(n)||(n=new vx(RYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=l,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};vx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new vx(t)};vx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Xn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],l=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,h;if(p)for(h=0;h<s.length;h++){if(a=OYe(t,s[h],l,r,o),a.geometry=Xn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),u(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,T=new Uint8Array(C);e._offsetAttribute===on.TOP?T=T.fill(1,0,C/2):(g=e._offsetAttribute===on.NONE?0:1,T=T.fill(g)),a.geometry.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(h=0;h<s.length;h++){if(a=PYe(t,s[h],l,r,o),a.geometry.attributes.position.values=ui.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),u(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===on.NONE?0:1;let T=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let A=Nn.combineInstances(c)[0],x=ae.fromVertices(A.attributes.position.values);return new dt({attributes:A.attributes,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var iB=vx;var zue="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Hue="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Gue=new z,Wue=m.ZERO,jue=new m,que=new ce,BYe=[],LYe=new H;function NYe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function xu(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new NYe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}u(Object.create)&&(xu.prototype=Object.create(Kn.prototype),xu.prototype.constructor=xu);xu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let s;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Gue)),u(s)||(s=z.WHITE),r.color=zt.fromColor(s)}u(i.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wue,jue)));let o;return i.perPositionHeight&&!u(i.extrudedHeight)?o=new nB(i):o=new Sx(i),new Ct({id:t,geometry:o,attributes:r})};xu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Gue),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};u(i.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wue,jue)));let a;return i.perPositionHeight&&!u(i.extrudedHeight)?a=new xf(i):a=new iB(i),new Ct({id:t,geometry:a,attributes:s})};xu.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!u(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.mapProjection.ellipsoid,o=Aa.fromPoints(i,r),s=o.projectPointsOntoPlane(i,BYe),a=s.length,c=0,l=a-1,f=new H;for(let p=0;p<a;l=p++){let g=s[p],h=s[l],A=g.x*h.y-h.x*g.y,x=H.add(g,h,LYe);x=H.multiplyByScalar(x,A,x),f=H.add(f,x,f),c+=A}let d=1/(c*3);return f=H.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};xu.prototype._isHidden=function(e,t){return!u(t.hierarchy)||ci.prototype._isHidden.call(this,e,t)};xu.prototype._isOnTerrain=function(e,t){let n=Kn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=u(i)&&(i.isConstant?i.getValue(ze.MINIMUM_VALUE):!0);return n&&!r};xu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};xu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(ze.MINIMUM_VALUE),o=q.getValueOrUndefined(t.height,ze.MINIMUM_VALUE),s=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),a=q.getValueOrUndefined(t.extrudedHeight,ze.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,ze.MINIMUM_VALUE,je.NONE),l=q.getValueOrDefault(t.perPositionHeight,ze.MINIMUM_VALUE,!1);o=Kn.getGeometryHeight(o,s);let f;l?(u(o)&&(o=void 0,Ot(zue)),s!==je.NONE&&l&&(o=void 0,Ot(Hue))):(u(a)&&!u(o)&&(o=0),f=Kn.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=q.getValueOrUndefined(t.granularity,ze.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,ze.MINIMUM_VALUE),i.perPositionHeight=l,i.closeTop=q.getValueOrDefault(t.closeTop,ze.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,ze.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,ze.MINIMUM_VALUE,Jt.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,ze.MINIMUM_VALUE),a=Kn.getGeometryExtrudedHeight(a,c),a===Kn.CLAMP_TO_GROUND&&(a=si.getMinimumMaximumHeights(Sx.computeRectangle(i,que)).minimumTerrainHeight),i.extrudedHeight=a};xu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=u(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};xu.DynamicGeometryUpdater=db;function db(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(db.prototype=Object.create(ai.prototype),db.prototype.constructor=db);db.prototype._isHidden=function(e,t,n){return!u(this._options.polygonHierarchy)||ai.prototype._isHidden.call(this,e,t,n)};db.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,je.NONE),s=q.getValueOrDefault(t.extrudedHeightReference,n,je.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);r=Kn.getGeometryHeight(r,s);let l;c?(u(r)&&(r=void 0,Ot(zue)),o!==je.NONE&&c&&(r=void 0,Ot(Hue))):(u(a)&&!u(r)&&(r=0),l=Kn.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=l,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,n,Jt.GEODESIC),a=Kn.getGeometryExtrudedHeight(a,s),a===Kn.CLAMP_TO_GROUND&&(a=si.getMinimumMaximumHeights(Sx.computeRectangle(i,que)).minimumTerrainHeight),i.extrudedHeight=a};var rB=xu;function FYe(e,t,n,i){let r=new mn;i.position&&(r.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=ui.triangulate(t),l=(a-1)*o*6+c.length*2,f=Fe.createTypedArray(s,l),d,p,g,h,A,x,C=o*2,T=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,x=g+C,h=g+1,A=h+C,f[T++]=h,f[T++]=g,f[T++]=A,f[T++]=A,f[T++]=g,f[T++]=x;g=o*2-2+d*o*2,h=g+1,A=h+C,x=g+C,f[T++]=h,f[T++]=g,f[T++]=A,f[T++]=A,f[T++]=g,f[T++]=x}if(i.st||i.tangent||i.bitangent){let w=new Float32Array(s*2),D=1/(a-1),M=1/n.height,O=n.height/2,B,L,_=0;for(d=0;d<a;d++){for(B=d*D,L=M*(t[0].y+O),w[_++]=B,w[_++]=L,p=1;p<o;p++)L=M*(t[p].y+O),w[_++]=B,w[_++]=L,w[_++]=B,w[_++]=L;L=M*(t[0].y+O),w[_++]=B,w[_++]=L}for(p=0;p<o;p++)B=0,L=M*(t[p].y+O),w[_++]=B,w[_++]=L;for(p=0;p<o;p++)B=(a-1)*D,L=M*(t[p].y+O),w[_++]=B,w[_++]=L;r.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(w)})}let E=s-o*2;for(d=0;d<c.length;d+=3){let w=c[d]+E,D=c[d+1]+E,M=c[d+2]+E;f[T++]=w,f[T++]=D,f[T++]=M,f[T++]=M+o,f[T++]=D+o,f[T++]=w+o}let S=new dt({attributes:r,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Be.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{Ot("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function sB(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Ri.ROUNDED),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+Pe.packedLength+2}sB.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Yue=re.clone(re.UNIT_SPHERE),Xue=new Pe,oB={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Yue,vertexFormat:Xue,cornerType:void 0,granularity:void 0};sB.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,Yue);t+=re.packedLength;let c=Pe.unpack(e,t,Xue);t+=Pe.packedLength;let l=e[t++],f=e[t];return u(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._cornerType=l,n._granularity=f,n):(oB.polylinePositions=o,oB.shapePositions=s,oB.cornerType=l,oB.granularity=f,new sB(oB))};var UYe=new Ye;sB.createGeometry=function(e){let t=e._positions,n=Sr(t,m.equalsEpsilon),i=e._shape;if(i=Hd.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qo.CLOCKWISE&&i.reverse();let r=Ye.fromPoints(i,UYe),o=Hd.computePositions(n,i,r,e,!0);return FYe(o,i,r,e._vertexFormat)};var aB=sB;function VYe(e,t){let n=new mn;n.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=Fe.createTypedArray(r,2*i*(s+1)),c,l,f=0;c=0;let d=c*i;for(l=0;l<i-1;l++)a[f++]=l+d,a[f++]=l+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,l=0;l<i-1;l++)a[f++]=l+d,a[f++]=l+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,h=g+i;for(l=0;l<i;l++)a[f++]=l+g,a[f++]=l+h}return new dt({attributes:n,indices:Fe.createTypedArray(r,a),boundingSphere:ae.fromVertices(e),primitiveType:Be.LINES})}function lB(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Ri.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+2}lB.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Kue=re.clone(re.UNIT_SPHERE),cB={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Kue,height:void 0,cornerType:void 0,granularity:void 0};lB.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,Kue);t+=re.packedLength;let c=e[t++],l=e[t];return u(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=l,n):(cB.polylinePositions=o,cB.shapePositions=s,cB.cornerType=c,cB.granularity=l,new lB(cB))};var kYe=new Ye;lB.createGeometry=function(e){let t=e._positions,n=Sr(t,m.equalsEpsilon),i=e._shape;if(i=Hd.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qo.CLOCKWISE&&i.reverse();let r=Ye.fromPoints(i,kYe),o=Hd.computePositions(n,i,r,e,!1);return VYe(o,i)};var uB=lB;var Jue=new z;function zYe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function dh(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new zYe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}u(Object.create)&&(dh.prototype=Object.create(ci.prototype),dh.prototype.constructor=dh);dh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Jue)),u(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ct({id:t,geometry:new aB(this._options),attributes:i})};dh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jue),r=this._distanceDisplayConditionProperty.getValue(e);return new Ct({id:t,geometry:new uB(this._options),attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};dh.prototype._isHidden=function(e,t){return!u(t.positions)||!u(t.shape)||ci.prototype._isHidden.call(this,e,t)};dh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};dh.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Vt;r.vertexFormat=o?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(ze.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(ze.MINIMUM_VALUE,r.shape),r.granularity=u(n)?n.getValue(ze.MINIMUM_VALUE):void 0,r.cornerType=u(i)?i.getValue(ze.MINIMUM_VALUE):void 0};dh.DynamicGeometryUpdater=mb;function mb(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(mb.prototype=Object.create(ai.prototype),mb.prototype.constructor=mb);mb.prototype._isHidden=function(e,t,n){let i=this._options;return!u(i.polylinePositions)||!u(i.shapePositions)||ai.prototype._isHidden.call(this,e,t,n)};mb.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var fB=dh;var GW=new m,$ue=new m,efe=new m,tfe=new m,nfe=new ce,HYe=new H,GYe=new ae,WYe=new ae;function ife(e,t){let n=new dt({attributes:new mn,primitiveType:Be.TRIANGLES});return n.attributes.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function jYe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,l=tfe,f=efe,d=$ue;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=m.fromArray(e,p,GW),h=c+1,A=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,d,f),Q.multiplyByVector(i,f,f),m.normalize(f,f),t.bitangent&&m.normalize(m.cross(d,f,l),l)),t.normal&&(o[c]=d.x,o[h]=d.y,o[A]=d.z),t.tangent&&(s[c]=f.x,s[h]=f.y,s[A]=f.z),t.bitangent&&(a[c]=l.x,a[h]=l.y,a[A]=l.z),c+=3}return ife(t,{positions:e,normals:o,tangents:s,bitangents:a})}var WW=new m,rfe=new m;function qYe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,l=0,f=!0,d=tfe,p=efe,g=$ue;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let A=m.fromArray(e,h,GW),x=m.fromArray(e,(h+6)%i,WW);if(f){let C=m.fromArray(e,(h+3)%i,rfe);m.subtract(x,A,x),m.subtract(C,A,C),g=m.normalize(m.cross(C,x,g),g),f=!1}m.equalsEpsilon(x,A,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(A,d),t.tangent&&(p=m.normalize(m.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[l++]=d.x,s[l++]=d.y,s[l++]=d.z,s[l++]=d.x,s[l++]=d.y,s[l++]=d.z)}return ife(t,{positions:e,normals:r,tangents:o,bitangents:s})}function ofe(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,l=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(l-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,h=0,A=0,x=GW,C=HYe,T=Number.MAX_VALUE,E=Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let b=c;b<l;++b)for(let v=0;v<o;++v)fs.computePosition(t,i,n.st,b,v,x,C),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(g[A++]=C.x,g[A++]=C.y,T=Math.min(T,C.x),E=Math.min(E,C.y),S=Math.max(S,C.x),w=Math.max(w,C.y));if(s&&(fs.computePosition(t,i,n.st,0,0,x,C),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(g[A++]=C.x,g[A++]=C.y,T=C.x,E=C.y,S=C.x,w=C.y)),a&&(fs.computePosition(t,i,n.st,r-1,0,x,C),p[h++]=x.x,p[h++]=x.y,p[h]=x.z,n.st&&(g[A++]=C.x,g[A]=C.y,T=Math.min(T,C.x),E=Math.min(E,C.y),S=Math.max(S,C.x),w=Math.max(w,C.y))),n.st&&(T<0||E<0||S>1||w>1))for(let b=0;b<g.length;b+=2)g[b]=(g[b]-T)/(S-T),g[b+1]=(g[b+1]-E)/(w-E);let D=jYe(p,n,i,t.tangentRotationMatrix),M=6*(o-1)*(f-1);s&&(M+=3*(o-1)),a&&(M+=3*(o-1));let O=Fe.createTypedArray(d,M),B=0,L=0,_;for(_=0;_<f-1;++_){for(let b=0;b<o-1;++b){let v=B,I=v+o,R=I+1,F=v+1;O[L++]=v,O[L++]=I,O[L++]=F,O[L++]=F,O[L++]=I,O[L++]=R,++B}++B}if(s||a){let b=d-1,v=d-1;s&&a&&(b=d-2);let I,R;if(B=0,s)for(_=0;_<o-1;_++)I=B,R=I+1,O[L++]=b,O[L++]=I,O[L++]=R,++B;if(a)for(B=(f-1)*o,_=0;_<o-1;_++)I=B,R=I+1,O[L++]=I,O[L++]=v,O[L++]=R,++B}return D.indices=O,n.st&&(D.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),D}function hb(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function pb(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var jW=new Pe;function YYe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,l=t.width,f;if(n){let pt=Pe.clone(r,jW);pt.normal=!0,e._vertexFormat=pt}let d=ofe(e,t);n&&(e._vertexFormat=r);let p=ui.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,h=g*2,A=new Float64Array(h);A.set(p);let x=ui.scaleToGeodeticHeight(d.attributes.position.values,o,a);A.set(x,g),d.attributes.position.values=A;let C=r.normal?new Float32Array(h):void 0,T=r.tangent?new Float32Array(h):void 0,E=r.bitangent?new Float32Array(h):void 0,S=r.st?new Float32Array(h/3*2):void 0,w,D;if(r.normal){for(D=d.attributes.normal.values,C.set(D),f=0;f<g;f++)D[f]=-D[f];C.set(D,g),d.attributes.normal.values=C}if(n){D=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let pt=new Float32Array(h);for(f=0;f<g;f++)D[f]=-D[f];pt.set(D,g),d.attributes.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:pt})}let M,O=u(i);if(O){let pt=g/3*2,gn=new Uint8Array(pt);i===on.TOP?gn=gn.fill(1,0,pt/2):(M=i===on.NONE?0:1,gn=gn.fill(M)),d.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:gn})}if(r.tangent){let pt=d.attributes.tangent.values;for(T.set(pt),f=0;f<g;f++)pt[f]=-pt[f];T.set(pt,g),d.attributes.tangent.values=T}if(r.bitangent){let pt=d.attributes.bitangent.values;E.set(pt),E.set(pt,g),d.attributes.bitangent.values=E}r.st&&(w=d.attributes.st.values,S.set(w),S.set(w,g/3*2),d.attributes.st.values=S);let B=d.indices,L=B.length,_=g/3,b=Fe.createTypedArray(h/3,L*2);for(b.set(B),f=0;f<L;f+=3)b[f+L]=B[f+2]+_,b[f+1+L]=B[f+1]+_,b[f+2+L]=B[f]+_;d.indices=b;let v=t.northCap,I=t.southCap,R=c,F=2,k=0,V=4,G=4;v&&(F-=1,R-=1,k+=1,V-=2,G-=1),I&&(F-=1,R-=1,k+=1,V-=2,G-=1),k+=F*l+2*R-V;let U=(k+G)*2,Y=new Float64Array(U*3),W=n?new Float32Array(U*3):void 0,J=O?new Uint8Array(U):void 0,j=r.st?new Float32Array(U*2):void 0,K=i===on.TOP;O&&!K&&(M=i===on.ALL?1:0,J=J.fill(M));let Z=0,me=0,ye=0,se=0,pe=l*R,Ae;for(f=0;f<pe;f+=l)Ae=f*3,Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,f*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1);if(I){let pt=v?pe+1:pe;for(Ae=pt*3,f=0;f<2;f++)Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,pt*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1)}else for(f=pe-l;f<pe;f++)Ae=f*3,Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,f*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1);for(f=pe-1;f>0;f-=l)Ae=f*3,Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,f*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1);if(v){let pt=pe;for(Ae=pt*3,f=0;f<2;f++)Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,pt*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1)}else for(f=l-1;f>=0;f--)Ae=f*3,Y=hb(Y,Z,Ae,p,x),Z+=6,r.st&&(j=pb(j,me,f*2,w),me+=4),n&&(ye+=3,W[ye++]=D[Ae],W[ye++]=D[Ae+1],W[ye++]=D[Ae+2]),K&&(J[se++]=1,se+=1);let De=qYe(Y,r,a);r.st&&(De.attributes.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:j})),n&&(De.attributes.extrudeDirection=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:W})),O&&(De.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ce=Fe.createTypedArray(U,k*6),Re,tt,nt,Wt;g=Y.length/3;let un=0;for(f=0;f<g-1;f+=2){Re=f,Wt=(Re+2)%g;let pt=m.fromArray(Y,Re*3,WW),gn=m.fromArray(Y,Wt*3,rfe);m.equalsEpsilon(pt,gn,P.EPSILON10)||(tt=(Re+1)%g,nt=(tt+2)%g,Ce[un++]=Re,Ce[un++]=tt,Ce[un++]=Wt,Ce[un++]=Wt,Ce[un++]=tt,Ce[un++]=nt)}return De.indices=Ce,De=Nn.combineInstances([new Ct({geometry:d}),new Ct({geometry:De})]),De[0]}var XYe=[new m,new m,new m,new m],sfe=new he,KYe=new he;function qW(e,t,n,i,r){if(n===0)return ce.clone(e,r);let o=fs.computeOptions(e,t,n,0,nfe,sfe),s=o.height,a=o.width,c=XYe;return fs.computePosition(o,i,!1,0,0,c[0]),fs.computePosition(o,i,!1,0,a-1,c[1]),fs.computePosition(o,i,!1,s-1,0,c[2]),fs.computePosition(o,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,r)}function mh(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ce.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}mh.packedLength=ce.packedLength+re.packedLength+Pe.packedLength+7;mh.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var afe=new ce,cfe=re.clone(re.UNIT_SPHERE),Ty={rectangle:afe,ellipsoid:cfe,vertexFormat:jW,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};mh.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,afe);t+=ce.packedLength;let r=re.unpack(e,t,cfe);t+=re.packedLength;let o=Pe.unpack(e,t,jW);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return u(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=l,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(Ty.granularity=s,Ty.height=a,Ty.rotation=c,Ty.stRotation=l,Ty.extrudedHeight=f,Ty.shadowVolume=d,Ty.offsetAttribute=p===-1?void 0:p,new mh(Ty))};mh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,re.WGS84),o=y(e.rotation,0);return qW(n,i,o,r,t)};var JYe=new Q,Zue=new Le,ZYe=new he;mh.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=fs.computeOptions(t,e._granularity,i,r,nfe,sfe,KYe),a=JYe;if(r!==0||i!==0){let g=ce.center(t,ZYe),h=n.geodeticSurfaceNormalCartographic(g,WW);Le.fromAxisAngle(h,-r,Zue),Q.fromQuaternion(Zue,a)}else Q.clone(Q.IDENTITY,a);let c=e._surfaceHeight,l=e._extrudedHeight,f=!P.equalsEpsilon(c,l,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=YYe(e,s);let g=ae.fromRectangle3D(t,n,c,WYe),h=ae.fromRectangle3D(t,n,l,GYe);p=ae.union(g,h)}else{if(d=ofe(e,s),d.attributes.position.values=ui.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),u(e._offsetAttribute)){let g=d.attributes.position.values.length,h=e._offsetAttribute===on.NONE?0:1,A=new Uint8Array(g/3).fill(h);d.attributes.applyOffset=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}p=ae.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new dt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};mh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new mh({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};var Que=new ce,QYe=[new H,new H,new H],$Ye=new ir,eXe=new he;function tXe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,Que),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=qW(t,n,r,i,Que),s=QYe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=ir.fromRotation(e._stRotation,$Ye),l=ce.center(a,eXe);for(let h=0;h<3;++h){let A=s[h];A.x-=l.longitude,A.y-=l.latitude,ir.multiplyByVector(c,A,A),A.x+=l.longitude,A.y+=l.latitude,A.x=(A.x-a.west)/a.width,A.y=(A.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return H.pack(f,g),H.pack(d,g,2),H.pack(p,g,4),g}Object.defineProperties(mh.prototype,{rectangle:{get:function(){return u(this._rotatedRectangle)||(this._rotatedRectangle=qW(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return u(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=tXe(this)),this._textureCoordinateRotationPoints}}});var wx=mh;var lfe=new z,ufe=m.ZERO,ffe=new m,dfe=new ce,nXe=new ce,iXe=new he;function rXe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Qd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new rXe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}u(Object.create)&&(Qd.prototype=Object.create(Kn.prototype),Qd.prototype.constructor=Qd);Qd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,lfe)),u(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return u(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,ufe,ffe))),new Ct({id:t,geometry:new wx(this._options),attributes:i})};Qd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,lfe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return u(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,ufe,ffe))),new Ct({id:t,geometry:new $A(this._options),attributes:o})};Qd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,nXe);if(!u(n))return;let i=ce.center(n,iXe);return he.toCartesian(i,re.WGS84,t)};Qd.prototype._isHidden=function(e,t){return!u(t.coordinates)||ci.prototype._isHidden.call(this,e,t)};Qd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Qd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=q.getValueOrUndefined(t.height,ze.MINIMUM_VALUE),r=q.getValueOrDefault(t.heightReference,ze.MINIMUM_VALUE,je.NONE),o=q.getValueOrUndefined(t.extrudedHeight,ze.MINIMUM_VALUE),s=q.getValueOrDefault(t.extrudedHeightReference,ze.MINIMUM_VALUE,je.NONE);u(o)&&!u(i)&&(i=0);let a=this._options;a.vertexFormat=n?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(ze.MINIMUM_VALUE,a.rectangle),a.granularity=q.getValueOrUndefined(t.granularity,ze.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,ze.MINIMUM_VALUE),a.rotation=q.getValueOrUndefined(t.rotation,ze.MINIMUM_VALUE),a.offsetAttribute=Kn.computeGeometryOffsetAttribute(i,r,o,s),a.height=Kn.getGeometryHeight(i,r),o=Kn.getGeometryExtrudedHeight(o,s),o===Kn.CLAMP_TO_GROUND&&(o=si.getMinimumMaximumHeights(wx.computeRectangle(a,dfe)).minimumTerrainHeight),a.extrudedHeight=o};Qd.DynamicGeometryUpdater=_b;function _b(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(_b.prototype=Object.create(ai.prototype),_b.prototype.constructor=_b);_b.prototype._isHidden=function(e,t,n){return!u(this._options.rectangle)||ai.prototype._isHidden.call(this,e,t,n)};_b.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,je.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,je.NONE);u(s)&&!u(r)&&(r=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(wx.computeRectangle(i,dfe)).minimumTerrainHeight),i.extrudedHeight=s};var dB=Qd;var mfe=new z,oXe=new wt,sXe=new wt,aXe=m.ZERO,cXe=new m;function $d(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.invalidated=!1;let a;u(r)&&(a=r.definitionChanged.addEventListener($d.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}$d.prototype.onMaterialChanged=function(){this.invalidated=!0};$d.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:u(t)?t.equals(n):!1};$d.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};$d.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return u(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};$d.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){u(i)&&(u(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;u(this.depthFailAppearanceType)&&(u(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Kr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Sn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{u(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;u(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(u(i)&&i.ready){i.show=!0,u(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),u(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Kr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let l=s[o],f=this.geometry.get(l.id),d=this.attributes.get(f.id.id);if(u(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!l.fillMaterialProperty.isConstant||c){let x=l.fillMaterialProperty.color,C=q.getValueOrDefault(x,e,z.WHITE,mfe);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=l))}if(u(this.depthFailAppearanceType)&&l.depthFailMaterialProperty instanceof Vt&&(!l.depthFailMaterialProperty.isConstant||c)){let x=l.depthFailMaterialProperty.color,C=q.getValueOrDefault(x,e,z.WHITE,mfe);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=l.entity.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=l.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,sXe,oXe);wt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}let A=l.terrainOffsetProperty;if(!q.isConstant(A)){let x=q.getValueOrDefault(A,e,aXe,cXe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Zi.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else u(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};$d.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);u(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};$d.prototype.contains=function(e){return this.updaters.contains(e.id)};$d.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!u(i)||!u(i.boundingSphere)||u(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};$d.prototype.destroy=function(){let e=this.primitive,t=this.primitives;u(e)&&t.remove(e);let n=this.oldPrimitive;u(n)&&t.remove(n),u(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function gb(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}gb.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new $d(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function hfe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}gb.prototype.remove=function(e){hfe(this._solidItems,e)||hfe(this._translucentItems,e)};function pfe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let l=a[o];s.remove(l),e.add(n,l),i=!0}}return i}function Ek(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let l=0;l<c;l++)e.add(n,a[l]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}gb.prototype.update=function(e){let t=Ek(this,this._solidItems,e,!0);t=Ek(this,this._translucentItems,e,t)&&t;let n=pfe(this,this._solidItems,e),i=pfe(this,this._translucentItems,e);return(n||i)&&(t=Ek(this,this._solidItems,e,t)&&t,t=Ek(this,this._translucentItems,e,t)&&t),t};function _fe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return ut.FAILED}gb.prototype.getBoundingSphere=function(e,t){let n=_fe(this._solidItems,e,t);return n===ut.FAILED?_fe(this._translucentItems,e,t):n};function gfe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}gb.prototype.removeAllPrimitives=function(){gfe(this._solidItems),gfe(this._translucentItems)};var Pf=gb;var lXe=new wt,uXe=new wt,fXe=m.ZERO,dXe=new m;function em(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(em.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt}em.prototype.onMaterialChanged=function(){this.invalidated=!0};em.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=u(t)&&t.equals(n);return o=(!u(i)&&!u(r)||u(i)&&i.equals(r))&&o,o};em.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};em.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return u(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var mXe=new z;em.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){u(n)&&(u(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Kr.getValue(e,this.materialProperty,this.material);let a;u(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Kr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Sn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{u(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;u(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(u(n)&&n.ready){n.show=!0,u(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Kr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,u(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Kr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],l=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(u(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),u(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Vt&&!c.depthFailMaterialProperty.isConstant){let x=c.depthFailMaterialProperty.color,C=q.getValueOrDefault(x,e,z.WHITE,mXe);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,uXe,lXe);wt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}let A=c.terrainOffsetProperty;if(!q.isConstant(A)){let x=q.getValueOrDefault(A,e,fXe,dXe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Zi.toValue(x,d.offset))}}this.updateShows(n)}else u(n)&&!n.ready&&(t=!1);return t};em.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);u(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,l=a.show[0]===1;c!==l&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};em.prototype.contains=function(e){return this.updaters.contains(e.id)};em.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!u(i)||!u(i.boundingSphere)||u(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};em.prototype.destroy=function(){let e=this.primitive,t=this.primitives;u(e)&&t.remove(e);let n=this.oldPrimitive;u(n)&&t.remove(n),this.removeMaterialSubscription()};function yb(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}yb.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new em(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};yb.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};yb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};yb.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};yb.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Of=yb;var Afe=Ki(yfe(),1);function bk(){this._tree=new Afe.default}function Dx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Dx.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};bk.prototype.insert=function(e,t){let n=Dx.fromRectangleAndId(e,t,new Dx);this._tree.insert(n)};function hXe(e,t){return e.id===t.id}var pXe=new Dx;bk.prototype.remove=function(e,t){let n=Dx.fromRectangleAndId(e,t,pXe);this._tree.remove(n,hXe)};var _Xe=new Dx;bk.prototype.collides=function(e){let t=Dx.fromRectangleAndId("",e,_Xe);return this._tree.collides(t)};var Ix=bk;var gXe=new z,yXe=new wt,AXe=new wt;function b_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new Ix}b_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};b_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};b_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return u(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};b_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)u(i)&&(u(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Oc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{u(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;u(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(u(i)&&i.ready){i.show=!0,u(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let l=s[o],f=this.geometry.get(l.id),d=this.attributes.get(f.id.id);if(u(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!l.fillMaterialProperty.isConstant||c){let A=l.fillMaterialProperty.color,x=q.getValueOrDefault(A,e,z.WHITE,gXe);z.equals(d._lastColor,x)||(d._lastColor=z.clone(x,d._lastColor),d.color=zt.toValue(x,d.color))}let p=l.entity.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=l.distanceDisplayConditionProperty;if(!q.isConstant(h)){let A=q.getValueOrDefault(h,e,AXe,yXe);wt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else u(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};b_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);u(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};b_.prototype.contains=function(e){return this.updaters.contains(e.id)};b_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return u(i)?(i.clone(t),ut.DONE):ut.FAILED};b_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;u(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;u(n)&&(e.remove(n),this.oldPrimitive=void 0)};function Ab(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Ab.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=q.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return u(o)||(o=new b_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};Ab.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};Ab.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let l=0;l<c;l++){n=a[l],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};Ab.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};Ab.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var xb=Ab;var xXe=new wt,CXe=new wt;function Mf(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Mf.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new Ix}Mf.prototype.onMaterialChanged=function(){this.invalidated=!0};Mf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Mf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:u(t)&&t.equals(n)};Mf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Mf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return u(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Mf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)u(n)&&(u(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Kr.getValue(e,this.materialProperty,this.material),n=new Oc({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{u(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;u(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(u(n)&&n.ready){n.show=!0,u(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Kr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],l=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);u(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let A=q.getValueOrDefault(h,e,CXe,xXe);wt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else u(n)&&!n.ready&&(t=!1);return t};Mf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);u(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,l=a.show[0]===1;c!==l&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Mf.prototype.contains=function(e){return this.updaters.contains(e.id)};Mf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!u(i)||!u(i.boundingSphere)||u(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Mf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;u(e)&&t.remove(e);let n=this.oldPrimitive;u(n)&&t.remove(n),this.removeMaterialSubscription()};function Cb(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}Cb.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=tu.shouldUseSphericalCoordinates(r.geometry.rectangle),s=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let l=n[c];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===o&&l.zIndex===s&&!l.overlapping(r.geometry.rectangle)){l.add(e,t,r);return}}let a=new Mf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};Cb.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};Cb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};Cb.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};Cb.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var mB=Cb;var TXe=new z,EXe=new wt,bXe=new wt,SXe=m.ZERO,vXe=new m;function S_(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.itemsToRemove=[],this.subscriptions=new Tt,this.showsUpdated=new Tt}S_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};S_.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return u(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};S_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)u(i)&&(u(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Sn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new sn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{u(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;u(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(u(i)&&i.ready){i.show=!0,u(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let l=s[o],f=this.geometry.get(l.id),d=this.attributes.get(f.id.id);if(u(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!l.outlineColorProperty.isConstant||c){let x=l.outlineColorProperty,C=q.getValueOrDefault(x,e,z.WHITE,TXe);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=l))}let p=l.entity.isShowing&&(l.hasConstantOutline||l.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=l.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,bXe,EXe);wt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}let A=l.terrainOffsetProperty;if(!q.isConstant(A)){let x=q.getValueOrDefault(A,e,SXe,vXe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Zi.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else u(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};S_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);u(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};S_.prototype.contains=function(e){return this.updaters.contains(e.id)};S_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!u(i)||!u(i.boundingSphere)||u(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};S_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;u(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;u(n)&&(e.remove(n),this.oldPrimitive=void 0)};function Tb(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Tt,this._translucentBatches=new Tt}Tb.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),u(o)||(o=new S_(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),u(o)||(o=new S_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};Tb.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};Tb.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,l,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),l=r.itemsToRemove;let p=l.length;if(p>0)for(d=!0,t=0;t<p;t++)i=l[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),l=r.itemsToRemove;let p=l.length;if(p>0)for(d=!0,t=0;t<p;t++)i=l[t],r.remove(i),this.add(e,i)}}while(d);return f};Tb.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ut.FAILED};Tb.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var Eb=Tb;var xfe={};function wXe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var DXe=new he,IXe=new he;function PXe(e,t,n,i){t=Sr(t,m.equalsEpsilon);let r=t.length;if(r<2)return;let o=u(i),s=u(n),a=new Array(r),c=new Array(r),l=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,DXe);s&&(d.height=n[0]),c[0]=d.height,o?l[0]=i[0]:l[0]=0;let p=c[0],g=l[0],h=p===g,A=1;for(let x=1;x<r;++x){let C=t[x],T=e.cartesianToCartographic(C,IXe);s&&(T.height=n[x]),h=h&&T.height===0,wXe(d,T)?d.height<T.height&&(c[A-1]=T.height):(a[A]=C,c[A]=T.height,o?l[A]=i[x]:l[A]=0,h=h&&c[A]===l[A],he.clone(T,d),++A)}if(!(h||A<2))return a.length=A,c.length=A,l.length=A,{positions:a,topHeights:c,bottomHeights:l}}var OXe=new Array(2),MXe=new Array(2),RXe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};xfe.computePositions=function(e,t,n,i,r,o){let s=PXe(e,t,n,i);if(!u(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,l,f,d=P.chordLength(r,e.maximumRadius),p=RXe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,h;for(h=0;h<a-1;h++)g+=Mi.numberOfPoints(t[h],t[h+1],d)+1;l=new Float64Array(g*3),f=new Float64Array(g*3);let A=OXe,x=MXe;p.positions=A,p.height=x;let C=0;for(h=0;h<a-1;h++){A[0]=t[h],A[1]=t[h+1],x[0]=n[h],x[1]=n[h+1];let T=Mi.generateArc(p);l.set(T,C),x[0]=i[h],x[1]=i[h+1],f.set(Mi.generateArc(p),C),C+=T.length}}else p.positions=t,p.height=n,l=new Float64Array(Mi.generateArc(p)),p.height=i,f=new Float64Array(Mi.generateArc(p));return{bottomPositions:f,topPositions:l,numCorners:c}};var Px=xfe;var KW=new m,Sk=new m,BXe=new m,Cfe=new m,LXe=new m,NXe=new m,FXe=new m;function Ox(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Pe.clone(r),this._granularity=o,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;u(i)&&(a+=i.length),u(n)&&(a+=n.length),this.packedLength=a+re.packedLength+Pe.packedLength+1}Ox.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=u(s)?s.length:0,t[n++]=o,u(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=u(a)?a.length:0,t[n++]=o,u(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._granularity,t};var Tfe=re.clone(re.UNIT_SPHERE),Efe=new Pe,hB={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Tfe,vertexFormat:Efe,granularity:void 0};Ox.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,Tfe);t+=re.packedLength;let l=Pe.unpack(e,t,Efe);t+=Pe.packedLength;let f=e[t];return u(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._vertexFormat=Pe.clone(l,n._vertexFormat),n._granularity=f,n):(hB.positions=o,hB.minimumHeights=s,hB.maximumHeights=a,hB.granularity=f,new Ox(hB))};Ox.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=u(r),a=u(o);if(s||a){let l=t.length;n=s?new Array(l):void 0,i=a?new Array(l):void 0;for(let f=0;f<l;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Ox(c)};Ox.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=Px.computePositions(s,t,i,n,o,!0);if(!u(a))return;let c=a.bottomPositions,l=a.topPositions,f=a.numCorners,d=l.length,p=d*2,g=r.position?new Float64Array(p):void 0,h=r.normal?new Float32Array(p):void 0,A=r.tangent?new Float32Array(p):void 0,x=r.bitangent?new Float32Array(p):void 0,C=r.st?new Float32Array(p/3*2):void 0,T=0,E=0,S=0,w=0,D=0,M=FXe,O=NXe,B=LXe,L=!0;d/=3;let _,b=0,v=1/(d-f-1);for(_=0;_<d;++_){let V=_*3,G=m.fromArray(l,V,KW),U=m.fromArray(c,V,Sk);if(r.position&&(g[T++]=U.x,g[T++]=U.y,g[T++]=U.z,g[T++]=G.x,g[T++]=G.y,g[T++]=G.z),r.st&&(C[D++]=b,C[D++]=0,C[D++]=b,C[D++]=1),r.normal||r.tangent||r.bitangent){let Y=m.clone(m.ZERO,Cfe),W=m.subtract(G,s.geodeticSurfaceNormal(G,Sk),Sk);if(_+1<d&&(Y=m.fromArray(l,V+3,Cfe)),L){let J=m.subtract(Y,G,BXe),j=m.subtract(W,G,KW);M=m.normalize(m.cross(j,J,M),M),L=!1}m.equalsEpsilon(G,Y,P.EPSILON10)?L=!0:(b+=v,r.tangent&&(O=m.normalize(m.subtract(Y,G,O),O)),r.bitangent&&(B=m.normalize(m.cross(M,O,B),B))),r.normal&&(h[E++]=M.x,h[E++]=M.y,h[E++]=M.z,h[E++]=M.x,h[E++]=M.y,h[E++]=M.z),r.tangent&&(A[w++]=O.x,A[w++]=O.y,A[w++]=O.z,A[w++]=O.x,A[w++]=O.y,A[w++]=O.z),r.bitangent&&(x[S++]=B.x,x[S++]=B.y,x[S++]=B.z,x[S++]=B.x,x[S++]=B.y,x[S++]=B.z)}}let I=new mn;r.position&&(I.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(I.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(I.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),r.bitangent&&(I.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),r.st&&(I.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}));let R=p/3;p-=6*(f+1);let F=Fe.createTypedArray(R,p),k=0;for(_=0;_<R-2;_+=2){let V=_,G=_+2,U=m.fromArray(g,V*3,KW),Y=m.fromArray(g,G*3,Sk);if(m.equalsEpsilon(U,Y,P.EPSILON10))continue;let W=_+1,J=_+3;F[k++]=W,F[k++]=V,F[k++]=J,F[k++]=J,F[k++]=V,F[k++]=G}return new dt({attributes:I,indices:F,primitiveType:Be.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var pB=Ox;var bfe=new m,Sfe=new m;function Mx(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=re.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;u(i)&&(s+=i.length),u(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}Mx.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=u(s)?s.length:0,t[n++]=o,u(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=u(a)?a.length:0,t[n++]=o,u(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var vfe=re.clone(re.UNIT_SPHERE),_B={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:vfe,granularity:void 0};Mx.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,vfe);t+=re.packedLength;let l=e[t];return u(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._granularity=l,n):(_B.positions=o,_B.minimumHeights=s,_B.maximumHeights=a,_B.granularity=l,new Mx(_B))};Mx.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=u(r),a=u(o);if(s||a){let l=t.length;n=s?new Array(l):void 0,i=a?new Array(l):void 0;for(let f=0;f<l;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Mx(c)};Mx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=Px.computePositions(o,t,i,n,r,!1);if(!u(s))return;let a=s.bottomPositions,c=s.topPositions,l=c.length,f=l*2,d=new Float64Array(f),p=0;l/=3;let g;for(g=0;g<l;++g){let T=g*3,E=m.fromArray(c,T,bfe),S=m.fromArray(a,T,Sfe);d[p++]=S.x,d[p++]=S.y,d[p++]=S.z,d[p++]=E.x,d[p++]=E.y,d[p++]=E.z}let h=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),A=f/3;f=2*A-4+A;let x=Fe.createTypedArray(A,f),C=0;for(g=0;g<A-2;g+=2){let T=g,E=g+2,S=m.fromArray(d,T*3,bfe),w=m.fromArray(d,E*3,Sfe);if(m.equalsEpsilon(S,w,P.EPSILON10))continue;let D=g+1,M=g+3;x[C++]=D,x[C++]=T,x[C++]=D,x[C++]=M,x[C++]=T,x[C++]=E}return x[C++]=A-2,x[C++]=A-1,new dt({attributes:h,indices:x,primitiveType:Be.LINES,boundingSphere:new ae.fromVertices(d)})};var gB=Mx;var wfe=new z;function UXe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function tm(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new UXe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}u(Object.create)&&(tm.prototype=Object.create(ci.prototype),tm.prototype.constructor=tm);tm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,wfe)),u(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ct({id:t,geometry:new pB(this._options),attributes:i})};tm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,wfe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ct({id:t,geometry:new gB(this._options),attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};tm.prototype._isHidden=function(e,t){return!u(t.positions)||ci.prototype._isHidden.call(this,e,t)};tm.prototype._getIsClosed=function(e){return!1};tm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};tm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Vt,s=this._options;s.vertexFormat=o?sn.VERTEX_FORMAT:ur.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ze.MINIMUM_VALUE,s.positions),s.minimumHeights=u(n)?n.getValue(ze.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=u(i)?i.getValue(ze.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=u(r)?r.getValue(ze.MINIMUM_VALUE):void 0};tm.DynamicGeometryUpdater=bb;function bb(e,t,n){ai.call(this,e,t,n)}u(Object.create)&&(bb.prototype=Object.create(ai.prototype),bb.prototype.constructor=bb);bb.prototype._isHidden=function(e,t,n){return!u(this._options.positions)||ai.prototype._isHidden.call(this,e,t,n)};bb.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var yB=tm;var VXe=[],Dfe=[HP,NR,DR,KR,ZR,eB,rB,fB,dB,yB];function AB(e,t){this.entity=e,this.scene=t;let n=new Array(Dfe.length),i=new _e;function r(s){i.raiseEvent(s)}let o=new Io;for(let s=0;s<n.length;s++){let a=new Dfe[s](e,t);o.add(a.geometryChanged,r),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(AB.prototype._onEntityPropertyChanged,this)}AB.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};AB.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};AB.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function Rf(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let r=xn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Jr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new Eb(n,e,s,!1),this._outlineBatches[r+s]=new Eb(n,e,s,!0),this._closedColorBatches[s]=new Pf(n,sn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Pf(n,sn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Of(n,ur,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Of(n,ur,void 0,!0,s,!1),this._openColorBatches[s]=new Pf(n,sn,void 0,!1,s,!0),this._openColorBatches[r+s]=new Pf(n,sn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Of(n,ur,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Of(n,ur,void 0,!1,s,!1);let a=zn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),l=[];if(o)for(s=0;s<a;++s)l.push(new mB(i,s,ur)),c[s]=new xb(i,s);else for(s=0;s<a;++s)c[s]=new xb(i,s);this._groundColorBatches=c,this._groundMaterialBatches=l,this._dynamicBatch=new Cx(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Tt,this._updaterSets=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(Rf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,VXe)}Rf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,l,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],l=c.id,f=this._updaterSets.get(l),f.entity===c?f.forEach(function(A){d._removeUpdater(A),d._insertUpdaterIntoBatch(e,A)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],l=c.id,f=this._updaterSets.get(l),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(l),this._subscriptions.get(l)(),this._subscriptions.remove(l);for(a=n.length-1;a>-1;a--)c=n[a],l=c.id,f=new AB(c,this._scene),this._updaterSets.set(l,f),f.forEach(function(A){d._insertUpdaterIntoBatch(e,A)}),this._subscriptions.set(l,f.geometryChanged.addEventListener(Rf._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a<h;a++)p=g[a].update(e)&&p;return p};var kXe=[],zXe=new ae;Rf.prototype.getBoundingSphere=function(e,t){let n=kXe,i=zXe,r=0,o=ut.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return ut.FAILED;let l=this._updaterSets.get(c).updaters;for(let f=0;f<l.length;f++){let d=l[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===ut.PENDING)return ut.PENDING;o===ut.DONE&&(n[r]=ae.clone(i,n[r]),r++)}}return r===0?ut.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),ut.DONE)};Rf.prototype.isDestroyed=function(){return!1};Rf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Rf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};Rf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Rf.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(u(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Vt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Vt?u(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):u(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Vt?u(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):u(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Rf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!u(t.get(r))&&!u(n.get(r))&&n.set(r,i)};Rf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var xB=Rf;var HXe=1,GXe="30px sans-serif",WXe=Hr.FILL,jXe=z.WHITE,qXe=z.BLACK,YXe=1,XXe=!1,KXe=new z(.165,.165,.165,.8),JXe=new H(7,5),ZXe=H.ZERO,QXe=m.ZERO,$Xe=je.NONE,eKe=gi.CENTER,tKe=On.CENTER,nKe=new m,iKe=new z,rKe=new z,oKe=new z,sKe=new H,aKe=new m,cKe=new H,lKe=new Bt,uKe=new Bt,fKe=new Bt,dKe=new wt;function Ife(e){this.entity=e,this.label=void 0,this.index=void 0}function Ey(e,t){t.collectionChanged.addEventListener(Ey.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Ey.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,l=o.label,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,nKe),c=q.getValueOrUndefined(a._text,e),f=u(d)&&u(c)),!f){JW(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=q.getValueOrDefault(a._heightReference,e,$Xe);u(l)||(l=n.getLabel(s),l.id=s,o.label=l,p=m.equals(l.position,d)&&l.heightReference===g),l.show=!0,l.position=d,l.text=c,l.scale=q.getValueOrDefault(a._scale,e,HXe),l.font=q.getValueOrDefault(a._font,e,GXe),l.style=q.getValueOrDefault(a._style,e,WXe),l.fillColor=q.getValueOrDefault(a._fillColor,e,jXe,iKe),l.outlineColor=q.getValueOrDefault(a._outlineColor,e,qXe,rKe),l.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,YXe),l.showBackground=q.getValueOrDefault(a._showBackground,e,XXe),l.backgroundColor=q.getValueOrDefault(a._backgroundColor,e,KXe,oKe),l.backgroundPadding=q.getValueOrDefault(a._backgroundPadding,e,JXe,sKe),l.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,ZXe,cKe),l.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,QXe,aKe),l.heightReference=g,l.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,eKe),l.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,tKe),l.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,lKe),l.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,uKe),l.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,fKe),l.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,dKe),l.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),p&&l._updateClamping()}return!0};Ey.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!u(n)||!u(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ut.DONE};Ey.prototype.isDestroyed=function(){return!1};Ey.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ey.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};Ey.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],u(o._label)&&u(o._position)&&s.set(o.id,new Ife(o));for(r=i.length-1;r>-1;r--)o=i[r],u(o._label)&&u(o._position)?s.contains(o.id)||s.set(o.id,new Ife(o)):(JW(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],JW(s.get(o.id),o,a),s.remove(o.id)};function JW(e,t,n){u(e)&&(e.label=void 0,n.removeLabel(t))}var CB=Ey;async function mKe(e,t,n){return await e._readyPromise,_Ke(e,t,n)}function hKe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let r=i.then(gKe(n)).catch(yKe(n));return e.shift(),t.push(r),!0}function pKe(e){return new Promise(function(t){setTimeout(t,e)})}function ZW(e,t){return e.length?hKe(e,t)?ZW(e,t):pKe(100).then(()=>ZW(e,t)):Promise.resolve()}function _Ke(e,t,n){let i=e.tilingScheme,r,o=[],s={};for(r=0;r<n.length;++r){let c=i.positionToTileXY(n[r],t);if(!u(c))continue;let l=c.toString();if(!s.hasOwnProperty(l)){let f={x:c.x,y:c.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};s[l]=f,o.push(f)}s[l].positions.push(n[r])}let a=[];return ZW(o,a).then(function(){return Promise.all(a).then(function(){return n})})}function Pfe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function gKe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!Pfe(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];Pfe(s,i,n)}}):Promise.resolve()}}function yKe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var TB=mKe;var QW=new H;async function Ofe(e,t){let n=[],i=[];await e._readyPromise;let r=e.availability,o=[];for(let a=0;a<t.length;++a){let c=t[a],l=r.computeMaximumLevelAtPosition(c);if(i[a]=l,l===0){e.tilingScheme.positionToTileXY(c,1,QW);let d=e.loadTileDataAvailability(QW.x,QW.y,1);u(d)&&o.push(d)}let f=n[l];u(f)||(n[l]=f=[]),f.push(c)}await Promise.all(o),await Promise.all(n.map(function(a,c){if(u(a))return TB(e,c,a)}));let s=[];for(let a=0;a<t.length;++a){let c=t[a];r.computeMaximumLevelAtPosition(c)!==i[a]&&s.push(c)}return s.length>0&&await Ofe(e,s),t}var v_=Ofe;var AKe=1,xKe=0,CKe=!0,TKe=!0,EKe=xn.ENABLED,bKe=je.NONE,SKe=z.RED,vKe=0,wKe=z.WHITE,DKe=$a.HIGHLIGHT,IKe=.5,PKe=new H(1,1),OKe=new N,MKe=new N,Mfe=new z,Rfe=new Array(4),RKe=new m;function hh(e,t){t.collectionChanged.addEventListener(hh.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}async function BKe(e,t,n,i){let r=e._primitives,o=e._modelHash;try{let s=await Bd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!u(o[t.id]))return;s.id=t,r.add(s),o[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{u(o[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(o[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!u(o[t.id]))return;console.log(s),o[t.id].loadFailed=!0}}hh.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,l=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,OKe),c=we.createIfNeeded(q.getValueOrUndefined(a._uri,e)),f=u(d)&&u(c)),!f){u(l)&&l.modelPrimitive&&(l.modelPrimitive.show=!1);continue}if(!u(l)||c.url!==l.url){u(l?.modelPrimitive)&&(i.removeAndDestroy(l.modelPrimitive),delete n[s.id]),l={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,awaitingSampleTerrain:!1,clampedBoundingSphere:void 0,sampleTerrainFailed:!1},n[s.id]=l;let h=q.getValueOrDefault(a._incrementallyLoadTextures,e,CKe);BKe(this,s,c,h)}let p=l.modelPrimitive;if(!u(p))continue;p.show=!0,p.scale=q.getValueOrDefault(a._scale,e,AKe),p.minimumPixelSize=q.getValueOrDefault(a._minimumPixelSize,e,xKe),p.maximumScale=q.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=N.clone(d,p.modelMatrix),p.shadows=q.getValueOrDefault(a._shadows,e,EKe),p.heightReference=q.getValueOrDefault(a._heightReference,e,bKe),p.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(a._silhouetteColor,e,SKe,Mfe),p.silhouetteSize=q.getValueOrDefault(a._silhouetteSize,e,vKe),p.color=q.getValueOrDefault(a._color,e,wKe,Mfe),p.colorBlendMode=q.getValueOrDefault(a._colorBlendMode,e,DKe),p.colorBlendAmount=q.getValueOrDefault(a._colorBlendAmount,e,IKe),p.clippingPlanes=q.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(a._clampAnimations,e,TKe),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(a._imageBasedLightingFactor,e,PKe);let g=q.getValueOrUndefined(a._lightColor,e);if(u(g)&&(z.pack(g,Rfe,0),g=m.unpack(Rfe,0,RKe)),p.lightColor=g,p.customShader=q.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let h=q.getValueOrDefault(a._runAnimations,e,!0);l.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:El.REPEAT}):p.activeAnimations.removeAll(),l.animationsRunning=h);let A=q.getValueOrUndefined(a._nodeTransformations,e,l.nodeTransformationsScratch);if(u(A)){let T=Object.keys(A);for(let E=0,S=T.length;E<S;++E){let w=T[E],D=A[w];if(!u(D))continue;let M=p.getNode(w);if(!u(M))continue;let O=N.fromTranslationRotationScale(D,MKe);M.matrix=N.multiply(M.originalMatrix,O,O)}}let x=!1,C=q.getValueOrUndefined(a._articulations,e,l.articulationsScratch);if(u(C)){let T=Object.keys(C);for(let E=0,S=T.length;E<S;++E){let w=T[E],D=C[w];u(D)&&(x=!0,p.setArticulationStage(w,D))}}x&&p.applyArticulations()}}return!0};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(hh.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)$W(this,e[i],t,n);return ue(this)};hh._sampleTerrainMostDetailed=v_;var Sb=new m,Bfe=new he;hh.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!u(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!u(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene.globe,s=u(o)?o.terrainProvider:void 0,a=i.heightReference!==je.NONE;if(u(o)&&a){let c=o.ellipsoid;if(!s._ready)return ut.PENDING;let l=i.modelMatrix;Sb.x=l[12],Sb.y=l[13],Sb.z=l[14];let f=c.cartesianToCartographic(Sb);if(!u(s.availability)){i.heightReference===je.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,ut.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,ut.FAILED):u(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,ut.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(he.clone(f,Bfe),this._modelHash[e.id].awaitingSampleTerrain=!0,hh._sampleTerrainMostDetailed(s,[Bfe]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let A=h[0];i.heightReference===je.RELATIVE_TO_GROUND&&(A.height+=f.height),c.cartographicToCartesian(A,Sb),ae.clone(i.boundingSphere,d),d.center=Sb,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),ut.PENDING)}return ae.clone(i.boundingSphere,t),ut.DONE};hh.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],u(o._model)&&u(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],u(o._model)&&u(o._position)?(LKe(o,a),s.set(o.id,o)):($W(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],$W(this,o,a,c),s.remove(o.id)};function $W(e,t,n,i){let r=n[t.id];u(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function LKe(e,t){let n=t[e.id];u(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var EB=hh;function by(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(by.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return u(this._value)?this._value.referenceFrame:ar.FIXED}}});by.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};by.prototype.setValue=function(e){this._value!==e&&(this._value=e,u(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),u(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};by.prototype.getValueInReferenceFrame=function(e,t,n){if(u(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),u(n)?re.WGS84.scaleToGeodeticSurface(n,n):void 0};by.prototype.equals=function(e){return this===e||e instanceof by&&this._value===e._value};by.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ph=by;var NKe=60,FKe=1,Ffe=new Tn,e7=new Tn,t7=new Tn;function Lfe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function UKe(e,t,n,i,r,o,s,a,c){let l=a,f;f=e.getValueInReferenceFrame(t,o,c[l]),u(f)&&(c[l++]=f);let d=!u(r)||ee.lessThanOrEquals(r,t)||ee.greaterThanOrEquals(r,n),p=0,g=i.length,h=i[p],A=n,x=!1,C,T,E;for(;p<g;){if(!d&&ee.greaterThanOrEquals(h,r)&&(f=e.getValueInReferenceFrame(r,o,c[l]),u(f)&&(c[l++]=f),d=!0),ee.greaterThan(h,t)&&ee.lessThan(h,A)&&!h.equals(r)&&(f=e.getValueInReferenceFrame(h,o,c[l]),u(f)&&(c[l++]=f)),p<g-1){if(s>0&&!x){let S=i[p+1],w=ee.secondsDifference(S,h);x=w>s,x&&(C=Math.ceil(w/s),T=0,E=w/Math.max(C,2),C=Math.max(C-1,1))}if(x&&T<C){h=ee.addSeconds(h,E,new ee),T++;continue}}x=!1,p++,h=i[p]}return f=e.getValueInReferenceFrame(n,o,c[l]),u(f)&&(c[l++]=f),l}function VKe(e,t,n,i,r,o,s,a){let c,l=0,f=s,d=t,p=Math.max(o,60),g=!u(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(d,n);)!g&&ee.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),u(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),u(c)&&(a[f]=c,f++),l++,d=ee.addSeconds(t,p*l,new ee);return c=e.getValueInReferenceFrame(n,r,a[f]),u(c)&&(a[f]=c,f++),f}function kKe(e,t,n,i,r,o,s,a){t7.start=t,t7.stop=n;let c=s,l=e.intervals;for(let f=0;f<l.length;f++){let d=l.get(f);if(!Tn.intersect(d,t7,Ffe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=ee.addSeconds(d.start,ee.secondsDifference(d.stop,d.start)/2,new ee));let g=e.getValueInReferenceFrame(p,r,a[c]);u(g)&&(a[c]=g,c++)}}return c}function zKe(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return u(c)&&(a[s++]=c),s}function HKe(e,t,n,i,r,o,s,a){e7.start=t,e7.stop=n;let c=s,l=e.intervals;for(let f=0;f<l.length;f++){let d=l.get(f);if(!Tn.intersect(d,e7,Ffe).isEmpty){let p=d.start,g=d.stop,h=t;ee.greaterThan(p,h)&&(h=p);let A=n;ee.lessThan(g,A)&&(A=g),c=Ufe(d.data,h,A,i,r,o,c,a)}}return c}function Ufe(e,t,n,i,r,o,s,a){for(;e instanceof A_;)e=e.resolvedProperty;if(e instanceof ra){let c=e._property._times;s=UKe(e,t,n,c,i,r,o,s,a)}else e instanceof na?s=HKe(e,t,n,i,r,o,s,a):e instanceof x_?s=kKe(e,t,n,i,r,o,s,a):e instanceof Rc||e instanceof ph&&q.isConstant(e)?s=zKe(e,t,n,i,r,o,s,a):s=VKe(e,t,n,i,r,o,s,a);return s}function Vfe(e,t,n,i,r,o,s){u(s)||(s=[]);let a=Ufe(e,t,n,i,r,o,0,s);return s.length=a,s}var Nfe=new Q;function bB(e,t){this._unusedIndexes=[],this._polylineCollection=new Fd,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}bB.prototype.update=function(e){if(this._referenceFrame===ar.INERTIAL){let t=Mt.computeIcrfToFixedMatrix(e,Nfe);u(t)||(t=Mt.computeTemeToPseudoFixedMatrix(e,Nfe)),N.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};bB.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,l=n.isShowing&&n.isAvailable(e)&&(!u(a)||a.getValue(e));if(l){let d=q.getValueOrUndefined(i._leadTime,e),p=q.getValueOrUndefined(i._trailTime,e),g=n._availability,h=u(g),A=u(d),x=u(p);if(l=h||A&&x,l){if(x&&(o=ee.addSeconds(e,-p,new ee)),A&&(s=ee.addSeconds(e,d,new ee)),h){let C=g.start,T=g.stop;(!x||ee.greaterThan(C,o))&&(o=C),(!A||ee.lessThan(T,s))&&(s=T)}l=ee.lessThan(o,s)}}if(!l){u(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!u(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,NKe);c.show=!0,c.positions=Vfe(r,o,s,e,this._referenceFrame,f,c.positions.slice()),c.material=Kr.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,FKe),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};bB.prototype.removeObject=function(e){let t=e.polyline;u(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};bB.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Sy(e,t){t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&u(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],a=o.entity._position,c=o.updater,l=ar.FIXED;this._scene.mode===ne.SCENE3D&&(l=a.referenceFrame);let f=this._updaters[l];if(c===f&&u(f)){f.updateObject(e,o);continue}u(c)&&c.removeObject(o),u(f)||(f=new bB(this._scene,l),f.update(e),this._updaters[l]=f),o.updater=f,u(f)&&f.updateObject(e,o)}return!0};Sy.prototype.isDestroyed=function(){return!1};Sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Sy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],u(o._path)&&u(o._position)&&a.set(o.id,new Lfe(o));for(r=i.length-1;r>-1;r--)o=i[r],u(o._path)&&u(o._position)?a.contains(o.id)||a.set(o.id,new Lfe(o)):(s=a.get(o.id),u(s)&&(u(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),u(s)&&(u(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};Sy._subSample=Vfe;var SB=Sy;var kfe=z.WHITE,zfe=z.BLACK,Hfe=0,Gfe=1,Wfe=0,jfe=new z,GKe=new m,qfe=new z,Yfe=new Bt,Xfe=new Bt,Kfe=new wt;function Jfe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function vy(e,t){t.collectionChanged.addEventListener(vy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}vy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,l=o.billboard,f=q.getValueOrDefault(a._heightReference,e,je.NONE),d=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),p;if(d&&(p=q.getValueOrUndefined(s._position,e,GKe),d=u(p)),!d){vB(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,h=!1;if(f!==je.NONE&&!u(l)?(u(c)&&(vB(o,s,n),c=void 0),l=n.getBillboard(s),l.id=s,l.image=void 0,o.billboard=l,g=!0,h=m.equals(l.position,p)&&l.heightReference===f):f===je.NONE&&!u(c)&&(u(l)&&(vB(o,s,n),l=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),u(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Yfe),c.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Xfe),c.color=q.getValueOrDefault(a._color,e,kfe,jfe),c.outlineColor=q.getValueOrDefault(a._outlineColor,e,zfe,qfe),c.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,Hfe),c.pixelSize=q.getValueOrDefault(a._pixelSize,e,Gfe),c.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Kfe),c.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Wfe);else if(u(l)){l.show=!0,l.position=p,l.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Yfe),l.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Xfe),l.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Kfe),l.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Wfe),l.heightReference=f;let A=q.getValueOrDefault(a._color,e,kfe,jfe),x=q.getValueOrDefault(a._outlineColor,e,zfe,qfe),C=Math.round(q.getValueOrDefault(a._outlineWidth,e,Hfe)),T=Math.max(1,Math.round(q.getValueOrDefault(a._pixelSize,e,Gfe)));if(C>0?(l.scale=1,g=g||C!==o.outlineWidth||T!==o.pixelSize||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)):(l.scale=T/50,T=50,g=g||C!==o.outlineWidth||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)),g){o.color=z.clone(A,o.color),o.outlineColor=z.clone(x,o.outlineColor),o.pixelSize=T,o.outlineWidth=C;let E=A.alpha,S=A.toCssColorString(),w=x.toCssColorString(),D=JSON.stringify([S,T,w,C]);l.setImage(D,WA(E,S,w,C,T))}h&&l._updateClamping()}}return!0};vy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!u(n)||!(u(n.pointPrimitive)||u(n.billboard)))return ut.FAILED;if(u(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!u(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};vy.prototype.isDestroyed=function(){return!1};vy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};vy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],u(o._point)&&u(o._position)&&s.set(o.id,new Jfe(o));for(r=i.length-1;r>-1;r--)o=i[r],u(o._point)&&u(o._position)?s.contains(o.id)||s.set(o.id,new Jfe(o)):(vB(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],vB(s.get(o.id),o,a),s.remove(o.id)};function vB(e,t,n){if(u(e)){let i=e.pointPrimitive;if(u(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;u(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var wB=vy;var tde=[];function WKe(e,t,n,i,r){let o=tde;o.length=r;let s,a=n.red,c=n.green,l=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let A=(d-a)/r,x=(p-c)/r,C=(g-l)/r,T=(h-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*A,c+s*x,l+s*C,f+s*T);return o}function DB(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),r=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*m.packedLength;o+=u(n)?1+n.length*z.packedLength:1,this.packedLength=o+re.packedLength+Pe.packedLength+4}DB.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=u(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var nde=re.clone(re.UNIT_SPHERE),ide=new Pe,Rx={positions:void 0,colors:void 0,ellipsoid:nde,vertexFormat:ide,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};DB.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t,nde);t+=re.packedLength;let c=Pe.unpack(e,t,ide);t+=Pe.packedLength;let l=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return u(n)?(n._positions=o,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._width=l,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(Rx.positions=o,Rx.colors=s,Rx.width=l,Rx.colorsPerVertex=f,Rx.arcType=d,Rx.granularity=p,new DB(Rx))};var Zfe=new m,Qfe=new m,$fe=new m,ede=new m;DB.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,l,f,d=[],p=Sr(e._positions,m.equalsEpsilon,!1,d);if(u(i)&&d.length>0){let R=0,F=d[0];i=i.filter(function(k,V){let G=!1;return r?G=V===F||V===0&&F===1:G=V+1===F,G?(R++,F=d[R],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===Jt.GEODESIC||o===Jt.RHUMB){let R,F;o===Jt.GEODESIC?(R=P.chordLength(s,a.maximumRadius),F=Mi.numberOfPoints):(R=s,F=Mi.numberOfPointsRhumbLine);let k=Mi.extractHeights(p,a);if(u(i)){let V=1;for(c=0;c<g-1;++c)V+=F(p[c],p[c+1],R);let G=new Array(V),U=0;for(c=0;c<g-1;++c){let Y=p[c],W=p[c+1],J=i[c],j=F(Y,W,R);if(r&&c<V){let K=i[c+1],Z=WKe(Y,W,J,K,j),me=Z.length;for(l=0;l<me;++l)G[U++]=Z[l]}else for(l=0;l<j;++l)G[U++]=z.clone(J)}G[U]=z.clone(i[i.length-1]),i=G,tde.length=0}o===Jt.GEODESIC?p=Mi.generateCartesianArc({positions:p,minDistance:R,ellipsoid:a,height:k}):p=Mi.generateCartesianRhumbArc({positions:p,granularity:R,ellipsoid:a,height:k})}g=p.length;let h=g*4-4,A=new Float64Array(h*3),x=new Float64Array(h*3),C=new Float64Array(h*3),T=new Float32Array(h*2),E=n.st?new Float32Array(h*2):void 0,S=u(i)?new Uint8Array(h*4):void 0,w=0,D=0,M=0,O=0,B;for(l=0;l<g;++l){l===0?(B=Zfe,m.subtract(p[0],p[1],B),m.add(p[0],B,B)):B=p[l-1],m.clone(B,$fe),m.clone(p[l],Qfe),l===g-1?(B=Zfe,m.subtract(p[g-1],p[g-2],B),m.add(p[g-1],B,B)):B=p[l+1],m.clone(B,ede);let R,F;u(S)&&(l!==0&&!r?R=i[l-1]:R=i[l],l!==g-1&&(F=i[l]));let k=l===0?2:0,V=l===g-1?2:4;for(f=k;f<V;++f){m.pack(Qfe,A,w),m.pack($fe,x,w),m.pack(ede,C,w),w+=3;let G=f-2<0?-1:1;if(T[D++]=2*(f%2)-1,T[D++]=G*t,n.st&&(E[M++]=l/(g-1),E[M++]=Math.max(T[D-2],0)),u(S)){let U=f<2?R:F;S[O++]=z.floatToByte(U.red),S[O++]=z.floatToByte(U.green),S[O++]=z.floatToByte(U.blue),S[O++]=z.floatToByte(U.alpha)}}}let L=new mn;L.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:A}),L.prevPosition=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),L.nextPosition=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),L.expandAndWidth=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(L.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:E})),u(S)&&(L.color=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Fe.createTypedArray(h,g*6-6),b=0,v=0,I=g-1;for(l=0;l<I;++l)_[v++]=b,_[v++]=b+2,_[v++]=b+1,_[v++]=b+1,_[v++]=b+2,_[v++]=b+3,b+=4;return new dt({attributes:L,indices:_,primitiveType:Be.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:Xu.POLYLINES})};var w_=DB;var jKe=new ei(0),vk={},rde=new z,qKe=new Vt(z.WHITE),YKe=new ei(!0),XKe=new ei(xn.DISABLED),KKe=new ei(new wt),JKe=new ei(zn.BOTH);function ZKe(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function QKe(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function nm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(nm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new ZKe,this._groundGeometryOptions=new QKe,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Jr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(nm.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!u(this._entity.availability)&&q.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});nm.prototype.isOutlineVisible=function(e){return!1};nm.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};nm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Vt&&(u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,rde)),u(a)||(a=z.WHITE),s.color=zt.fromColor(a)),this.clampToGround?new Ct({id:t,geometry:new Q0(this._groundGeometryOptions),attributes:s}):(u(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Vt&&(u(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,rde)),u(a)||(a=z.WHITE),s.depthFailColor=zt.fromColor(a)),new Ct({id:t,geometry:new w_(this._geometryOptions),attributes:s}))};nm.prototype.createOutlineGeometryInstance=function(e){};nm.prototype.isDestroyed=function(){return!1};nm.prototype.destroy=function(){this._entitySubscription(),ue(this)};nm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!u(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(u(s)&&s.isConstant&&!s.getValue(ze.MINIMUM_VALUE)||!u(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=y(r.material,qKe),l=c instanceof Vt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=y(s,YKe),this._shadowsProperty=y(r.shadows,XKe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,KKe),this._classificationTypeProperty=y(r.classificationType,JKe),this._fillEnabled=!0,this._zIndex=y(a,jKe);let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!q.isConstant(f)||!q.isConstant(d)||!q.isConstant(g)||!q.isConstant(p)||!q.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,A=o.getValue(ze.MINIMUM_VALUE,h.positions);if(!u(A)||A.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;l&&(!u(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Vt)?x=Go.VERTEX_FORMAT:x=Js.VERTEX_FORMAT,h.vertexFormat=x,h.positions=A,h.width=u(f)?f.getValue(ze.MINIMUM_VALUE):void 0,h.arcType=u(d)?d.getValue(ze.MINIMUM_VALUE):void 0,h.granularity=u(g)?g.getValue(ze.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=A,C.width=h.width,C.arcType=h.arcType,C.granularity=h.granularity,this._clampToGround=u(p)?p.getValue(ze.MINIMUM_VALUE):!1,!this._clampToGround&&u(a)&&Ot("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};nm.prototype.createDynamicUpdater=function(e,t){return new IB(e,t,this)};var vb={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function IB(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function ode(e){if(u(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=vk[t],i=e._primitives;!u(n)||n.isDestroyed()?(n=new Fd,vk[t]=n,i.add(n)):i.contains(n)||i.add(n);let r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}IB.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=q.getValueOrUndefined(r,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,Jt.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(u(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!u(o)||o.length<2)return;let f=t.fillMaterialProperty,d;if(f instanceof Vt)d=new Go;else{let p=Kr.getValue(e,f,this._material);d=new Js({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new md({geometryInstances:t.createFillGeometryInstance(e),appearance:d,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),u(this._line)&&(this._line.show=!1);return}let a=ode(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!u(o)||o.length<2){a.show=!1;return}let c=Jt.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let l=t._scene.globe;c!==Jt.NONE&&u(l)&&(vb.ellipsoid=l.ellipsoid,vb.positions=o,vb.granularity=q.getValueOrUndefined(i._granularity,e),vb.height=Mi.extractHeights(o,l.ellipsoid),c===Jt.GEODESIC?o=Mi.generateCartesianArc(vb):o=Mi.generateCartesianRhumbArc(vb)),a.show=!0,a.positions=o.slice(),a.material=Kr.getValue(e,t.fillMaterialProperty,a.material),a.width=q.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};IB.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(u(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(u(n)&&u(n.boundingSphere))return ae.clone(n.boundingSphere,e),ut.DONE}return u(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=ode(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};IB.prototype.isDestroyed=function(){return!1};IB.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=vk[t];u(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete vk[t])),u(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var PB=nm;var $Ke=new z,eJe=new wt,tJe=new wt;function im(e,t,n,i,r){let o;n instanceof Vt?o=Go:o=Js,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(im.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.zIndex=i,this._asynchronous=r}im.prototype.onMaterialChanged=function(){this.invalidated=!0};im.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:u(t)&&t.equals(n)};im.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};im.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return u(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};im.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)u(n)&&(u(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new md({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Js&&(this.material=Kr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{u(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;u(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(u(n)&&n.ready){n.show=!0,u(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Js&&(this.material=Kr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],l=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(u(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let A=c.fillMaterialProperty.color,x=q.getValueOrDefault(A,e,z.WHITE,$Ke);z.equals(d._lastColor,x)||(d._lastColor=z.clone(x,d._lastColor),d.color=zt.toValue(x,d.color))}let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let A=q.getValueOrDefault(h,e,tJe,eJe);wt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=wt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else u(n)&&!n.ready&&(t=!1);return t};im.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);u(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,l=a.show[0]===1;c!==l&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};im.prototype.contains=function(e){return this.updaters.contains(e.id)};im.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!u(i)||!u(i.boundingSphere)||u(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};im.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;u(e)&&t.remove(e);let n=this.oldPrimitive;u(n)&&t.remove(n),this.removeMaterialSubscription()};function wb(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}wb.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=q.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new im(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};wb.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};wb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};wb.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};wb.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var OB=wb;var nJe=[];function sde(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function ade(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;u(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Vt?1:2);let o;u(i)&&(o=i+r*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Vt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function _h(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let r,o=xn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new Pf(n,Go,void 0,!1,r),this._materialBatches[r]=new Of(n,Js,void 0,!1,r),this._colorBatches[r+o]=new Pf(n,Go,Go,!1,r),this._materialBatches[r+o]=new Of(n,Js,Go,!1,r),this._colorBatches[r+o*2]=new Pf(n,Go,Js,!1,r),this._materialBatches[r+o*2]=new Of(n,Js,Js,!1,r);this._dynamicBatch=new Cx(n,i);let s=zn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new OB(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Tt,this._updaters=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(_h.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,nJe)}_h.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,l,f;for(a=s.length-1;a>-1;a--)c=s[a],l=c.id,f=this._updaters.get(l),f.entity===c?(sde(this,f),ade(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],l=c.id,f=this._updaters.get(l),sde(this,f),f.destroy(),this._updaters.remove(l),this._subscriptions.get(l)(),this._subscriptions.remove(l);for(a=n.length-1;a>-1;a--)c=n[a],l=c.id,f=new PB(c,this._scene),this._updaters.set(l,f),ade(this,e,f),this._subscriptions.set(l,f.geometryChanged.addEventListener(_h._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var iJe=[],rJe=new ae;_h.prototype.getBoundingSphere=function(e,t){let n=iJe,i=rJe,r=0,o=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return ut.FAILED;for(let l=0;l<a;l++){if(o=s[l].getBoundingSphere(c,i),o===ut.PENDING)return ut.PENDING;o===ut.DONE&&(n[r]=ae.clone(i,n[r]),r++)}return r===0?ut.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),ut.DONE)};_h.prototype.isDestroyed=function(){return!1};_h.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_h.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};_h._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!u(t.get(r))&&!u(n.get(r))&&n.set(r,i)};_h.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var MB=_h;function Bf(e){Oc.initializeTerrainHeights(),md.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Io,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Bf.defaultVisualizersCallback);let i=!1,r=new Il,o=new Il;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let l=0,f=n.length;l<f;l++)this._onDataSourceAdded(n,n.get(l));let s=new RR;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let l=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),l._removeDefaultDataSourceListener=void 0,l._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}Bf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new SI(t,i),new xB(e,i,n._primitives,n._groundPrimitives),new CB(t,i),new EB(e,i),new AR(e,i),new wB(t,i),new SB(e,i),new MB(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(Bf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Bf.prototype.isDestroyed=function(){return!1};Bf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),u(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Bf.prototype.update=function(e){if(!si.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(u(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return this._ready=t,t};Bf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;u(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(u(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var oJe=[],sJe=new ae;Bf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ut.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!u(o))return ut.FAILED;let s=oJe,a=sJe,c=0,l=ut.DONE,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(u(p.getBoundingSphere)){if(l=f[i].getBoundingSphere(e,a),!t&&l===ut.PENDING)return ut.PENDING;l===ut.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),ut.DONE)};Bf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Il),s=r.add(new XR);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Bf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let l=0;l<c;l++)a[l].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};Bf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var RB=Bf;function n7(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}n7.clone=function(e,t){if(u(e))return u(t)||(t=new n7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Cu=n7;var cde=new Q,lde=new Q,ude=new Q,aJe=new N,wk=new m,fde=new m,i7=new m,r7=new m,dde=new m,mde=new m,Db=new ee,cJe=1.25;function lJe(e,t,n,i,r,o,s){let a=e.scene.mode,c=r.getValue(o,e._lastCartesian);if(u(c)){let l=!1,f=!1,d,p,g;if(a===ne.SCENE3D){ee.addSeconds(o,.001,Db);let T=r.getValue(Db,wk);if(u(T)||(ee.addSeconds(o,-.001,Db),T=r.getValue(Db,wk),f=!0),u(T)){let E=Mt.computeFixedToIcrfMatrix(o,cde),S=Mt.computeFixedToIcrfMatrix(Db,lde),w;!u(E)||!u(S)?(w=Mt.computeTemeToPseudoFixedMatrix(o,ude),E=Q.transpose(w,cde),S=Mt.computeTemeToPseudoFixedMatrix(Db,lde),Q.transpose(S,S)):w=Q.transpose(E,ude);let D=Q.multiplyByVector(E,c,dde),M=Q.multiplyByVector(S,T,mde);m.subtract(D,M,r7);let O=m.magnitude(r7)*1e3,B=P.GRAVITATIONALPARAMETER,L=-B/(O*O-2*B/m.magnitude(D));L<0||L>cJe*s.maximumRadius?(d=fde,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,i7),p=m.cross(g,d,wk),m.magnitude(p)>P.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,i7),m.normalize(g,g),l=!0)):m.equalsEpsilon(c,T,P.EPSILON7)||(g=fde,m.normalize(D,g),m.normalize(M,M),p=m.cross(g,M,i7),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,P.EPSILON7)||(d=m.cross(p,g,wk),Q.multiplyByVector(w,d,d),Q.multiplyByVector(w,p,p),Q.multiplyByVector(w,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),l=!0))}}u(e.boundingSphere)&&(c=e.boundingSphere.center);let h,A,x;i&&(h=m.clone(t.position,r7),A=m.clone(t.direction,dde),x=m.clone(t.up,mde));let C=aJe;l?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(A,t.direction),m.clone(x,t.up),m.cross(A,x,t.right))}if(n){let l=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,l)}}function BB(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,re.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(BB,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});BB.defaultOffset3D=new m(-14e3,3500,3500);var Dk=new Cu,uJe=new m;BB.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===ne.MORPHING)return;let o=this.entity,s=o.position;if(!u(s))return;let a=o!==this._lastEntity,c=r!==this._mode,l=n.camera,f=a||c,d=!0;if(a){let p=o.viewFrom,g=u(p);if(!g&&u(t)){Dk.pitch=-P.PI_OVER_FOUR,Dk.range=0;let h=s.getValue(e,uJe);if(u(h)){let A=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);Dk.pitch*=A}l.viewBoundingSphere(t,Dk),this.boundingSphere=t,f=!1,d=!1}else(!g||!u(p.getValue(e,this._offset3D)))&&m.clone(BB._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(l.position,this._offset3D);this._lastEntity=o,this._mode=r,lJe(this,l,f,d,s,e,i)};var LB=BB;function Lk(e){return Nk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function Nk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?Nk(n):n),[])}var hde=[0,1,2,3].concat(...Lk([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function lo(){let e=this;function t(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,l=e.stat_desc.max_length,f,d,p,g,h,A,x=0;for(g=0;g<=15;g++)r.bl_count[g]=0;for(o[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<573;f++)d=r.heap[f],g=o[o[d*2+1]*2+1]+1,g>l&&(g=l,x++),o[d*2+1]=g,!(d>e.max_code)&&(r.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),A=o[d*2],r.opt_len+=A*(g+h),s&&(r.static_len+=A*(s[d*2+1]+h)));if(x!==0){do{for(g=l-1;r.bl_count[g]===0;)g--;r.bl_count[g]--,r.bl_count[g+1]+=2,r.bl_count[l]--,x-=2}while(x>0);for(g=l;g!==0;g--)for(d=r.bl_count[g];d!==0;)p=r.heap[--f],!(p>e.max_code)&&(o[p*2+1]!=g&&(r.opt_len+=(g-o[p*2+1])*o[p*2],o[p*2+1]=g),d--)}}function n(r,o){let s=0;do s|=r&1,r>>>=1,s<<=1;while(--o>0);return s>>>1}function i(r,o,s){let a=[],c=0,l,f,d;for(l=1;l<=15;l++)a[l]=c=c+s[l-1]<<1;for(f=0;f<=o;f++)d=r[f*2+1],d!==0&&(r[f*2]=n(a[d]++,d))}e.build_tree=function(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,l,f=-1,d;for(r.heap_len=0,r.heap_max=573,c=0;c<a;c++)o[c*2]!==0?(r.heap[++r.heap_len]=f=c,r.depth[c]=0):o[c*2+1]=0;for(;r.heap_len<2;)d=r.heap[++r.heap_len]=f<2?++f:0,o[d*2]=1,r.depth[d]=0,r.opt_len--,s&&(r.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(r.heap_len/2);c>=1;c--)r.pqdownheap(o,c);d=a;do c=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),l=r.heap[1],r.heap[--r.heap_max]=c,r.heap[--r.heap_max]=l,o[d*2]=o[c*2]+o[l*2],r.depth[d]=Math.max(r.depth[c],r.depth[l])+1,o[c*2+1]=o[l*2+1]=d,r.heap[1]=d++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],t(r),i(o,e.max_code,r.bl_count)}}lo._length_code=[0,1,2,3,4,5,6,7].concat(...Lk([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));lo.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];lo.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];lo.d_code=function(e){return e<256?hde[e]:hde[256+(e>>>7)]};lo.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];lo.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];lo.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];lo.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wa(e,t,n,i,r){let o=this;o.static_tree=e,o.extra_bits=t,o.extra_base=n,o.elems=i,o.max_length=r}var fJe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],dJe=Lk([[144,8],[112,9],[24,7],[8,8]]);wa.static_ltree=Nk(fJe.map((e,t)=>[e,dJe[t]]));var mJe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],hJe=Lk([[30,5]]);wa.static_dtree=Nk(mJe.map((e,t)=>[e,hJe[t]]));wa.static_l_desc=new wa(wa.static_ltree,lo.extra_lbits,256+1,286,15);wa.static_d_desc=new wa(wa.static_dtree,lo.extra_dbits,0,30,15);wa.static_bl_desc=new wa(null,lo.extra_blbits,0,19,7);var pJe=9,_Je=8;function gh(e,t,n,i,r){let o=this;o.good_length=e,o.max_lazy=t,o.nice_length=n,o.max_chain=i,o.func=r}var _de=0,Rk=1,Bx=2,rm=[new gh(0,0,0,0,_de),new gh(4,4,8,4,Rk),new gh(4,5,16,8,Rk),new gh(4,6,32,32,Rk),new gh(4,4,16,16,Bx),new gh(8,16,32,32,Bx),new gh(8,16,128,128,Bx),new gh(8,32,128,256,Bx),new gh(32,128,258,1024,Bx),new gh(32,258,258,4096,Bx)],Ik=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Lf=0,Pk=1,NB=2,Ok=3,gJe=32,o7=42,Mk=113,FB=666,s7=8,yJe=0,a7=1,AJe=2,Co=3,Bk=258,Tu=Bk+Co+1;function pde(e,t,n,i){let r=e[t*2],o=e[n*2];return r<o||r==o&&i[t]<=i[n]}function xJe(){let e=this,t,n,i,r,o,s,a,c,l,f,d,p,g,h,A,x,C,T,E,S,w,D,M,O,B,L,_,b,v,I,R,F,k,V=new lo,G=new lo,U=new lo;e.depth=[];let Y,W,J,j,K,Z;e.bl_count=[],e.heap=[],R=[],F=[],k=[];function me(){l=2*o,d[g-1]=0;for(let Ue=0;Ue<g-1;Ue++)d[Ue]=0;L=rm[_].max_lazy,v=rm[_].good_length,I=rm[_].nice_length,B=rm[_].max_chain,w=0,C=0,M=0,T=O=Co-1,S=0,p=0}function ye(){let Ue;for(Ue=0;Ue<286;Ue++)R[Ue*2]=0;for(Ue=0;Ue<30;Ue++)F[Ue*2]=0;for(Ue=0;Ue<19;Ue++)k[Ue*2]=0;R[256*2]=1,e.opt_len=e.static_len=0,W=J=0}function se(){V.dyn_tree=R,V.stat_desc=wa.static_l_desc,G.dyn_tree=F,G.stat_desc=wa.static_d_desc,U.dyn_tree=k,U.stat_desc=wa.static_bl_desc,K=0,Z=0,j=8,ye()}e.pqdownheap=function(Ue,ot){let Ge=e.heap,Je=Ge[ot],it=ot<<1;for(;it<=e.heap_len&&(it<e.heap_len&&pde(Ue,Ge[it+1],Ge[it],e.depth)&&it++,!pde(Ue,Je,Ge[it],e.depth));)Ge[ot]=Ge[it],ot=it,it<<=1;Ge[ot]=Je};function pe(Ue,ot){let Ge=-1,Je,it=Ue[0*2+1],Lt=0,_n=7,mr=4;it===0&&(_n=138,mr=3),Ue[(ot+1)*2+1]=65535;for(let Er=0;Er<=ot;Er++)Je=it,it=Ue[(Er+1)*2+1],!(++Lt<_n&&Je==it)&&(Lt<mr?k[Je*2]+=Lt:Je!==0?(Je!=Ge&&k[Je*2]++,k[16*2]++):Lt<=10?k[17*2]++:k[18*2]++,Lt=0,Ge=Je,it===0?(_n=138,mr=3):Je==it?(_n=6,mr=3):(_n=7,mr=4))}function Ae(){let Ue;for(pe(R,V.max_code),pe(F,G.max_code),U.build_tree(e),Ue=19-1;Ue>=3&&k[lo.bl_order[Ue]*2+1]===0;Ue--);return e.opt_len+=3*(Ue+1)+5+5+4,Ue}function De(Ue){e.pending_buf[e.pending++]=Ue}function Ce(Ue){De(Ue&255),De(Ue>>>8&255)}function Re(Ue){De(Ue>>8&255),De(Ue&255&255)}function tt(Ue,ot){let Ge,Je=ot;Z>16-Je?(Ge=Ue,K|=Ge<<Z&65535,Ce(K),K=Ge>>>16-Z,Z+=Je-16):(K|=Ue<<Z&65535,Z+=Je)}function nt(Ue,ot){let Ge=Ue*2;tt(ot[Ge]&65535,ot[Ge+1]&65535)}function Wt(Ue,ot){let Ge,Je=-1,it,Lt=Ue[0*2+1],_n=0,mr=7,Er=4;for(Lt===0&&(mr=138,Er=3),Ge=0;Ge<=ot;Ge++)if(it=Lt,Lt=Ue[(Ge+1)*2+1],!(++_n<mr&&it==Lt)){if(_n<Er)do nt(it,k);while(--_n!==0);else it!==0?(it!=Je&&(nt(it,k),_n--),nt(16,k),tt(_n-3,2)):_n<=10?(nt(17,k),tt(_n-3,3)):(nt(18,k),tt(_n-11,7));_n=0,Je=it,Lt===0?(mr=138,Er=3):it==Lt?(mr=6,Er=3):(mr=7,Er=4)}}function un(Ue,ot,Ge){let Je;for(tt(Ue-257,5),tt(ot-1,5),tt(Ge-4,4),Je=0;Je<Ge;Je++)tt(k[lo.bl_order[Je]*2+1],3);Wt(R,Ue-1),Wt(F,ot-1)}function pt(){Z==16?(Ce(K),K=0,Z=0):Z>=8&&(De(K&255),K>>>=8,Z-=8)}function gn(){tt(a7<<1,3),nt(256,wa.static_ltree),pt(),1+j+10-Z<9&&(tt(a7<<1,3),nt(256,wa.static_ltree),pt()),j=7}function Bn(Ue,ot){let Ge,Je,it;if(e.dist_buf[W]=Ue,e.lc_buf[W]=ot&255,W++,Ue===0?R[ot*2]++:(J++,Ue--,R[(lo._length_code[ot]+256+1)*2]++,F[lo.d_code(Ue)*2]++),!(W&8191)&&_>2){for(Ge=W*8,Je=w-C,it=0;it<30;it++)Ge+=F[it*2]*(5+lo.extra_dbits[it]);if(Ge>>>=3,J<Math.floor(W/2)&&Ge<Math.floor(Je/2))return!0}return W==Y-1}function Ut(Ue,ot){let Ge,Je,it=0,Lt,_n;if(W!==0)do Ge=e.dist_buf[it],Je=e.lc_buf[it],it++,Ge===0?nt(Je,Ue):(Lt=lo._length_code[Je],nt(Lt+256+1,Ue),_n=lo.extra_lbits[Lt],_n!==0&&(Je-=lo.base_length[Lt],tt(Je,_n)),Ge--,Lt=lo.d_code(Ge),nt(Lt,ot),_n=lo.extra_dbits[Lt],_n!==0&&(Ge-=lo.base_dist[Lt],tt(Ge,_n)));while(it<W);nt(256,Ue),j=Ue[256*2+1]}function kt(){Z>8?Ce(K):Z>0&&De(K&255),K=0,Z=0}function Ee(Ue,ot,Ge){kt(),j=8,Ge&&(Ce(ot),Ce(~ot)),e.pending_buf.set(c.subarray(Ue,Ue+ot),e.pending),e.pending+=ot}function xe(Ue,ot,Ge){tt((yJe<<1)+(Ge?1:0),3),Ee(Ue,ot,!0)}function ft(Ue,ot,Ge){let Je,it,Lt=0;_>0?(V.build_tree(e),G.build_tree(e),Lt=Ae(),Je=e.opt_len+3+7>>>3,it=e.static_len+3+7>>>3,it<=Je&&(Je=it)):Je=it=ot+5,ot+4<=Je&&Ue!=-1?xe(Ue,ot,Ge):it==Je?(tt((a7<<1)+(Ge?1:0),3),Ut(wa.static_ltree,wa.static_dtree)):(tt((AJe<<1)+(Ge?1:0),3),un(V.max_code+1,G.max_code+1,Lt+1),Ut(R,F)),ye(),Ge&&kt()}function di(Ue){ft(C>=0?C:-1,w-C,Ue),C=w,t.flush_pending()}function Xe(){let Ue,ot,Ge,Je;do{if(Je=l-M-w,Je===0&&w===0&&M===0)Je=o;else if(Je==-1)Je--;else if(w>=o+o-Tu){c.set(c.subarray(o,o+o),0),D-=o,w-=o,C-=o,Ue=g,Ge=Ue;do ot=d[--Ge]&65535,d[Ge]=ot>=o?ot-o:0;while(--Ue!==0);Ue=o,Ge=Ue;do ot=f[--Ge]&65535,f[Ge]=ot>=o?ot-o:0;while(--Ue!==0);Je+=o}if(t.avail_in===0)return;Ue=t.read_buf(c,w+M,Je),M+=Ue,M>=Co&&(p=c[w]&255,p=(p<<x^c[w+1]&255)&A)}while(M<Tu&&t.avail_in!==0)}function Xi(Ue){let ot=65535,Ge;for(ot>i-5&&(ot=i-5);;){if(M<=1){if(Xe(),M===0&&Ue==0)return Lf;if(M===0)break}if(w+=M,M=0,Ge=C+ot,(w===0||w>=Ge)&&(M=w-Ge,w=Ge,di(!1),t.avail_out===0)||w-C>=o-Tu&&(di(!1),t.avail_out===0))return Lf}return di(Ue==4),t.avail_out===0?Ue==4?NB:Lf:Ue==4?Ok:Pk}function Or(Ue){let ot=B,Ge=w,Je,it,Lt=O,_n=w>o-Tu?w-(o-Tu):0,mr=I,Er=a,Cs=w+Bk,Ts=c[Ge+Lt-1],mo=c[Ge+Lt];O>=v&&(ot>>=2),mr>M&&(mr=M);do if(Je=Ue,!(c[Je+Lt]!=mo||c[Je+Lt-1]!=Ts||c[Je]!=c[Ge]||c[++Je]!=c[Ge+1])){Ge+=2,Je++;do;while(c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&c[++Ge]==c[++Je]&&Ge<Cs);if(it=Bk-(Cs-Ge),Ge=Cs-Bk,it>Lt){if(D=Ue,Lt=it,it>=mr)break;Ts=c[Ge+Lt-1],mo=c[Ge+Lt]}}while((Ue=f[Ue&Er]&65535)>_n&&--ot!==0);return Lt<=M?Lt:M}function Jo(Ue){let ot=0,Ge;for(;;){if(M<Tu){if(Xe(),M<Tu&&Ue==0)return Lf;if(M===0)break}if(M>=Co&&(p=(p<<x^c[w+(Co-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w),ot!==0&&(w-ot&65535)<=o-Tu&&b!=2&&(T=Or(ot)),T>=Co)if(Ge=Bn(w-D,T-Co),M-=T,T<=L&&M>=Co){T--;do w++,p=(p<<x^c[w+(Co-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w;while(--T!==0);w++}else w+=T,T=0,p=c[w]&255,p=(p<<x^c[w+1]&255)&A;else Ge=Bn(0,c[w]&255),M--,w++;if(Ge&&(di(!1),t.avail_out===0))return Lf}return di(Ue==4),t.avail_out===0?Ue==4?NB:Lf:Ue==4?Ok:Pk}function Uo(Ue){let ot=0,Ge,Je;for(;;){if(M<Tu){if(Xe(),M<Tu&&Ue==0)return Lf;if(M===0)break}if(M>=Co&&(p=(p<<x^c[w+(Co-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w),O=T,E=D,T=Co-1,ot!==0&&O<L&&(w-ot&65535)<=o-Tu&&(b!=2&&(T=Or(ot)),T<=5&&(b==1||T==Co&&w-D>4096)&&(T=Co-1)),O>=Co&&T<=O){Je=w+M-Co,Ge=Bn(w-1-E,O-Co),M-=O-1,O-=2;do++w<=Je&&(p=(p<<x^c[w+(Co-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w);while(--O!==0);if(S=0,T=Co-1,w++,Ge&&(di(!1),t.avail_out===0))return Lf}else if(S!==0){if(Ge=Bn(0,c[w-1]&255),Ge&&di(!1),w++,M--,t.avail_out===0)return Lf}else S=1,w++,M--}return S!==0&&(Ge=Bn(0,c[w-1]&255),S=0),di(Ue==4),t.avail_out===0?Ue==4?NB:Lf:Ue==4?Ok:Pk}function xs(Ue){return Ue.total_in=Ue.total_out=0,Ue.msg=null,e.pending=0,e.pending_out=0,n=Mk,r=0,se(),me(),0}e.deflateInit=function(Ue,ot,Ge,Je,it,Lt){return Je||(Je=s7),it||(it=_Je),Lt||(Lt=0),Ue.msg=null,ot==-1&&(ot=6),it<1||it>pJe||Je!=s7||Ge<9||Ge>15||ot<0||ot>9||Lt<0||Lt>2?-2:(Ue.dstate=e,s=Ge,o=1<<s,a=o-1,h=it+7,g=1<<h,A=g-1,x=Math.floor((h+Co-1)/Co),c=new Uint8Array(o*2),f=[],d=[],Y=1<<it+6,e.pending_buf=new Uint8Array(Y*4),i=Y*4,e.dist_buf=new Uint16Array(Y),e.lc_buf=new Uint8Array(Y),_=ot,b=Lt,xs(Ue))},e.deflateEnd=function(){return n!=o7&&n!=Mk&&n!=FB?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==Mk?-3:0)},e.deflateParams=function(Ue,ot,Ge){let Je=0;return ot==-1&&(ot=6),ot<0||ot>9||Ge<0||Ge>2?-2:(rm[_].func!=rm[ot].func&&Ue.total_in!==0&&(Je=Ue.deflate(1)),_!=ot&&(_=ot,L=rm[_].max_lazy,v=rm[_].good_length,I=rm[_].nice_length,B=rm[_].max_chain),b=Ge,Je)},e.deflateSetDictionary=function(Ue,ot,Ge){let Je=Ge,it,Lt=0;if(!ot||n!=o7)return-2;if(Je<Co)return 0;for(Je>o-Tu&&(Je=o-Tu,Lt=Ge-Je),c.set(ot.subarray(Lt,Lt+Je),0),w=Je,C=Je,p=c[0]&255,p=(p<<x^c[1]&255)&A,it=0;it<=Je-Co;it++)p=(p<<x^c[it+(Co-1)]&255)&A,f[it&a]=d[p],d[p]=it;return 0},e.deflate=function(Ue,ot){let Ge,Je,it,Lt,_n;if(ot>4||ot<0)return-2;if(!Ue.next_out||!Ue.next_in&&Ue.avail_in!==0||n==FB&&ot!=4)return Ue.msg=Ik[2- -2],-2;if(Ue.avail_out===0)return Ue.msg=Ik[2- -5],-5;if(t=Ue,Lt=r,r=ot,n==o7&&(Je=s7+(s-8<<4)<<8,it=(_-1&255)>>1,it>3&&(it=3),Je|=it<<6,w!==0&&(Je|=gJe),Je+=31-Je%31,n=Mk,Re(Je)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return r=-1,0}else if(t.avail_in===0&&ot<=Lt&&ot!=4)return t.msg=Ik[2- -5],-5;if(n==FB&&t.avail_in!==0)return Ue.msg=Ik[2- -5],-5;if(t.avail_in!==0||M!==0||ot!=0&&n!=FB){switch(_n=-1,rm[_].func){case _de:_n=Xi(ot);break;case Rk:_n=Jo(ot);break;case Bx:_n=Uo(ot);break;default:}if((_n==NB||_n==Ok)&&(n=FB),_n==Lf||_n==NB)return t.avail_out===0&&(r=-1),0;if(_n==Pk){if(ot==1)gn();else if(xe(0,0,!1),ot==3)for(Ge=0;Ge<g;Ge++)d[Ge]=0;if(t.flush_pending(),t.avail_out===0)return r=-1,0}}return ot!=4?0:1}}function gde(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}gde.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new xJe,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function CJe(e){let t=this,n=new gde,i=TJe(e&&e.chunkSize?e.chunkSize:64*1024),r=0,o=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=o,t.append=function(a,c){let l,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,l=n.deflate(r),l!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(o)):h.push(o.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(A){f.set(A,p),p+=A.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,l=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(o.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,l),l+=p.length}),c}}function TJe(e){return e+5*(Math.floor(e/16383)+1)}var yde=CJe;var Eu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Ude=1440,EJe=0,bJe=4,SJe=9,vJe=5,wJe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],DJe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],IJe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],PJe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],OJe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],MJe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wy=15;function f7(){let e=this,t,n,i,r,o,s;function a(l,f,d,p,g,h,A,x,C,T,E){let S,w,D,M,O,B,L,_,b,v,I,R,F,k,V;v=0,O=d;do i[l[f+v]]++,v++,O--;while(O!==0);if(i[0]==d)return A[0]=-1,x[0]=0,0;for(_=x[0],B=1;B<=wy&&i[B]===0;B++);for(L=B,_<B&&(_=B),O=wy;O!==0&&i[O]===0;O--);for(D=O,_>O&&(_=O),x[0]=_,k=1<<B;B<O;B++,k<<=1)if((k-=i[B])<0)return-3;if((k-=i[O])<0)return-3;for(i[O]+=k,s[1]=B=0,v=1,F=2;--O!==0;)s[F]=B+=i[v],F++,v++;O=0,v=0;do(B=l[f+v])!==0&&(E[s[B]++]=O),v++;while(++O<d);for(d=s[D],s[0]=O=0,v=0,M=-1,R=-_,o[0]=0,I=0,V=0;L<=D;L++)for(S=i[L];S--!==0;){for(;L>R+_;){if(M++,R+=_,V=D-R,V=V>_?_:V,(w=1<<(B=L-R))>S+1&&(w-=S+1,F=L,B<V))for(;++B<V&&!((w<<=1)<=i[++F]);)w-=i[F];if(V=1<<B,T[0]+V>Ude)return-3;o[M]=I=T[0],T[0]+=V,M!==0?(s[M]=O,r[0]=B,r[1]=_,B=O>>>R-_,r[2]=I-o[M-1]-B,C.set(r,(o[M-1]+B)*3)):A[0]=I}for(r[1]=L-R,v>=d?r[0]=128+64:E[v]<p?(r[0]=E[v]<256?0:32+64,r[2]=E[v++]):(r[0]=h[E[v]-p]+16+64,r[2]=g[E[v++]-p]),w=1<<L-R,B=O>>>R;B<V;B+=w)C.set(r,(I+B)*3);for(B=1<<L-1;O&B;B>>>=1)O^=B;for(O^=B,b=(1<<R)-1;(O&b)!=s[M];)M--,R-=_,b=(1<<R)-1}return k!==0&&D!=1?-5:0}function c(l){let f;for(t||(t=[],n=[],i=new Int32Array(wy+1),r=[],o=new Int32Array(wy),s=new Int32Array(wy+1)),n.length<l&&(n=[]),f=0;f<l;f++)n[f]=0;for(f=0;f<wy+1;f++)i[f]=0;for(f=0;f<3;f++)r[f]=0;o.set(i.subarray(0,wy),0),s.set(i.subarray(0,wy+1),0)}e.inflate_trees_bits=function(l,f,d,p,g){let h;return c(19),t[0]=0,h=a(l,0,19,19,null,null,d,f,p,t,n),h==-3?g.msg="oversubscribed dynamic bit lengths tree":(h==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(l,f,d,p,g,h,A,x,C){let T;return c(288),t[0]=0,T=a(d,0,l,257,IJe,PJe,h,p,x,t,n),T!=0||p[0]===0?(T==-3?C.msg="oversubscribed literal/length tree":T!=-4&&(C.msg="incomplete literal/length tree",T=-3),T):(c(288),T=a(d,l,f,0,OJe,MJe,A,g,x,t,n),T!=0||g[0]===0&&l>257?(T==-3?C.msg="oversubscribed distance tree":T==-5?(C.msg="incomplete distance tree",T=-3):T!=-4&&(C.msg="empty distance tree with lengths",T=-3),T):0)}}f7.inflate_trees_fixed=function(e,t,n,i){return e[0]=SJe,t[0]=vJe,n[0]=wJe,i[0]=DJe,0};var Fk=0,Ade=1,xde=2,Cde=3,Tde=4,Ede=5,bde=6,c7=7,Sde=8,Uk=9;function RJe(){let e=this,t,n=0,i,r=0,o=0,s=0,a=0,c=0,l=0,f=0,d,p=0,g,h=0;function A(x,C,T,E,S,w,D,M){let O,B,L,_,b,v,I,R,F,k,V,G,U,Y,W,J;I=M.next_in_index,R=M.avail_in,b=D.bitb,v=D.bitk,F=D.write,k=F<D.read?D.read-F-1:D.end-F,V=Eu[x],G=Eu[C];do{for(;v<20;)R--,b|=(M.read_byte(I++)&255)<<v,v+=8;if(O=b&V,B=T,L=E,J=(L+O)*3,(_=B[J])===0){b>>=B[J+1],v-=B[J+1],D.win[F++]=B[J+2],k--;continue}do{if(b>>=B[J+1],v-=B[J+1],_&16){for(_&=15,U=B[J+2]+(b&Eu[_]),b>>=_,v-=_;v<15;)R--,b|=(M.read_byte(I++)&255)<<v,v+=8;O=b&G,B=S,L=w,J=(L+O)*3,_=B[J];do if(b>>=B[J+1],v-=B[J+1],_&16){for(_&=15;v<_;)R--,b|=(M.read_byte(I++)&255)<<v,v+=8;if(Y=B[J+2]+(b&Eu[_]),b>>=_,v-=_,k-=U,F>=Y)W=F-Y,F-W>0&&2>F-W?(D.win[F++]=D.win[W++],D.win[F++]=D.win[W++],U-=2):(D.win.set(D.win.subarray(W,W+2),F),F+=2,W+=2,U-=2);else{W=F-Y;do W+=D.end;while(W<0);if(_=D.end-W,U>_){if(U-=_,F-W>0&&_>F-W)do D.win[F++]=D.win[W++];while(--_!==0);else D.win.set(D.win.subarray(W,W+_),F),F+=_,W+=_,_=0;W=0}}if(F-W>0&&U>F-W)do D.win[F++]=D.win[W++];while(--U!==0);else D.win.set(D.win.subarray(W,W+U),F),F+=U,W+=U,U=0;break}else if(!(_&64))O+=B[J+2],O+=b&Eu[_],J=(L+O)*3,_=B[J];else return M.msg="invalid distance code",U=M.avail_in-R,U=v>>3<U?v>>3:U,R+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,M.avail_in=R,M.total_in+=I-M.next_in_index,M.next_in_index=I,D.write=F,-3;while(!0);break}if(_&64)return _&32?(U=M.avail_in-R,U=v>>3<U?v>>3:U,R+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,M.avail_in=R,M.total_in+=I-M.next_in_index,M.next_in_index=I,D.write=F,1):(M.msg="invalid literal/length code",U=M.avail_in-R,U=v>>3<U?v>>3:U,R+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,M.avail_in=R,M.total_in+=I-M.next_in_index,M.next_in_index=I,D.write=F,-3);if(O+=B[J+2],O+=b&Eu[_],J=(L+O)*3,(_=B[J])===0){b>>=B[J+1],v-=B[J+1],D.win[F++]=B[J+2],k--;break}}while(!0)}while(k>=258&&R>=10);return U=M.avail_in-R,U=v>>3<U?v>>3:U,R+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,M.avail_in=R,M.total_in+=I-M.next_in_index,M.next_in_index=I,D.write=F,0}e.init=function(x,C,T,E,S,w){t=Fk,l=x,f=C,d=T,p=E,g=S,h=w,i=null},e.proc=function(x,C,T){let E,S,w,D=0,M=0,O=0,B,L,_,b;for(O=C.next_in_index,B=C.avail_in,D=x.bitb,M=x.bitk,L=x.write,_=L<x.read?x.read-L-1:x.end-L;;)switch(t){case Fk:if(_>=258&&B>=10&&(x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,T=A(l,f,d,p,g,h,x,C),O=C.next_in_index,B=C.avail_in,D=x.bitb,M=x.bitk,L=x.write,_=L<x.read?x.read-L-1:x.end-L,T!=0)){t=T==1?c7:Uk;break}o=l,i=d,r=p,t=Ade;case Ade:for(E=o;M<E;){if(B!==0)T=0;else return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);B--,D|=(C.read_byte(O++)&255)<<M,M+=8}if(S=(r+(D&Eu[E]))*3,D>>>=i[S+1],M-=i[S+1],w=i[S],w===0){s=i[S+2],t=bde;break}if(w&16){a=w&15,n=i[S+2],t=xde;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}if(w&32){t=c7;break}return t=Uk,C.msg="invalid literal/length code",T=-3,x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);case xde:for(E=a;M<E;){if(B!==0)T=0;else return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);B--,D|=(C.read_byte(O++)&255)<<M,M+=8}n+=D&Eu[E],D>>=E,M-=E,o=f,i=g,r=h,t=Cde;case Cde:for(E=o;M<E;){if(B!==0)T=0;else return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);B--,D|=(C.read_byte(O++)&255)<<M,M+=8}if(S=(r+(D&Eu[E]))*3,D>>=i[S+1],M-=i[S+1],w=i[S],w&16){a=w&15,c=i[S+2],t=Tde;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}return t=Uk,C.msg="invalid distance code",T=-3,x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);case Tde:for(E=a;M<E;){if(B!==0)T=0;else return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);B--,D|=(C.read_byte(O++)&255)<<M,M+=8}c+=D&Eu[E],D>>=E,M-=E,t=Ede;case Ede:for(b=L-c;b<0;)b+=x.end;for(;n!==0;){if(_===0&&(L==x.end&&x.read!==0&&(L=0,_=L<x.read?x.read-L-1:x.end-L),_===0&&(x.write=L,T=x.inflate_flush(C,T),L=x.write,_=L<x.read?x.read-L-1:x.end-L,L==x.end&&x.read!==0&&(L=0,_=L<x.read?x.read-L-1:x.end-L),_===0)))return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);x.win[L++]=x.win[b++],_--,b==x.end&&(b=0),n--}t=Fk;break;case bde:if(_===0&&(L==x.end&&x.read!==0&&(L=0,_=L<x.read?x.read-L-1:x.end-L),_===0&&(x.write=L,T=x.inflate_flush(C,T),L=x.write,_=L<x.read?x.read-L-1:x.end-L,L==x.end&&x.read!==0&&(L=0,_=L<x.read?x.read-L-1:x.end-L),_===0)))return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);T=0,x.win[L++]=s,_--,t=Fk;break;case c7:if(M>7&&(M-=8,B++,O--),x.write=L,T=x.inflate_flush(C,T),L=x.write,_=L<x.read?x.read-L-1:x.end-L,x.read!=x.write)return x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);t=Sde;case Sde:return T=1,x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);case Uk:return T=-3,x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T);default:return T=-2,x.bitb=D,x.bitk=M,C.avail_in=B,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=L,x.inflate_flush(C,T)}},e.free=function(){}}var vde=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ib=0,l7=1,wde=2,Dde=3,Ide=4,Pde=5,Vk=6,kk=7,Ode=8,Lx=9;function BJe(e,t){let n=this,i=Ib,r=0,o=0,s=0,a,c=[0],l=[0],f=new RJe,d=0,p=new Int32Array(Ude*3),g=0,h=new f7;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(A,x){x&&(x[0]=g),i==Vk&&f.free(A),i=Ib,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(A,x){let C,T,E;return T=A.next_out_index,E=n.read,C=(E<=n.write?n.write:n.end)-E,C>A.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C,E==n.end&&(E=0,n.write==n.end&&(n.write=0),C=n.write-E,C>A.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C),A.next_out_index=T,n.read=E,x},n.proc=function(A,x){let C,T,E,S,w,D,M,O;for(S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,M=D<n.read?n.read-D-1:n.end-D;;){let B,L,_,b,v,I,R,F;switch(i){case Ib:for(;E<3;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}switch(C=T&7,d=C&1,C>>>1){case 0:T>>>=3,E-=3,C=E&7,T>>>=C,E-=C,i=l7;break;case 1:B=[],L=[],_=[[]],b=[[]],f7.inflate_trees_fixed(B,L,_,b),f.init(B[0],L[0],_[0],0,b[0],0),T>>>=3,E-=3,i=Vk;break;case 2:T>>>=3,E-=3,i=Dde;break;case 3:return T>>>=3,E-=3,i=Lx,A.msg="invalid block type",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x)}break;case l7:for(;E<32;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if((~T>>>16&65535)!=(T&65535))return i=Lx,A.msg="invalid stored block lengths",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);r=T&65535,T=E=0,i=r!==0?wde:d!==0?kk:Ib;break;case wde:if(w===0||M===0&&(D==n.end&&n.read!==0&&(D=0,M=D<n.read?n.read-D-1:n.end-D),M===0&&(n.write=D,x=n.inflate_flush(A,x),D=n.write,M=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,M=D<n.read?n.read-D-1:n.end-D),M===0)))return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);if(x=0,C=r,C>w&&(C=w),C>M&&(C=M),n.win.set(A.read_buf(S,C),D),S+=C,w-=C,D+=C,M-=C,(r-=C)!==0)break;i=d!==0?kk:Ib;break;case Dde:for(;E<14;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(o=C=T&16383,(C&31)>29||(C>>5&31)>29)return i=Lx,A.msg="too many length or distance symbols",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(O=0;O<C;O++)a[O]=0;T>>>=14,E-=14,s=0,i=Ide;case Ide:for(;s<4+(o>>>10);){for(;E<3;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}a[vde[s++]]=T&7,T>>>=3,E-=3}for(;s<19;)a[vde[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,l,p,A),C!=0)return x=C,x==-3&&(a=null,i=Lx),n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);s=0,i=Pde;case Pde:for(;C=o,!(s>=258+(C&31)+(C>>5&31));){let k,V;for(C=c[0];E<C;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(C=p[(l[0]+(T&Eu[C]))*3+1],V=p[(l[0]+(T&Eu[C]))*3+2],V<16)T>>>=C,E-=C,a[s++]=V;else{for(O=V==18?7:V-14,k=V==18?11:3;E<C+O;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(T>>>=C,E-=C,k+=T&Eu[O],T>>>=O,E-=O,O=s,C=o,O+k>258+(C&31)+(C>>5&31)||V==16&&O<1)return a=null,i=Lx,A.msg="invalid bit length repeat",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);V=V==16?a[O-1]:0;do a[O++]=V;while(--k!==0);s=O}}if(l[0]=-1,v=[],I=[],R=[],F=[],v[0]=9,I[0]=6,C=o,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,v,I,R,F,p,A),C!=0)return C==-3&&(a=null,i=Lx),x=C,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);f.init(v[0],I[0],p,R[0],p,F[0]),i=Vk;case Vk:if(n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,(x=f.proc(n,A,x))!=1)return n.inflate_flush(A,x);if(x=0,f.free(A),S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,M=D<n.read?n.read-D-1:n.end-D,d===0){i=Ib;break}i=kk;case kk:if(n.write=D,x=n.inflate_flush(A,x),D=n.write,M=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);i=Ode;case Ode:return x=1,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);case Lx:return x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);default:return x=-2,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x)}}},n.free=function(A){n.reset(A,null),n.win=null,p=null},n.set_dictionary=function(A,x,C){n.win.set(A.subarray(x,x+C),0),n.read=n.write=C},n.sync_point=function(){return i==l7?1:0}}var LJe=32,NJe=8,FJe=0,Mde=1,Rde=2,Bde=3,Lde=4,Nde=5,u7=6,UB=7,Fde=12,Dy=13,UJe=[0,0,255,255];function VJe(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=UB,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new BJe(n,1<<i),t(n),0)},e.inflate=function(n,i){let r,o;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==bJe?-5:0,r=-5;;)switch(s.mode){case FJe:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=NJe){s.mode=Dy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Dy,n.msg="invalid win size",s.marker=5;break}s.mode=Mde;case Mde:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,o=n.read_byte(n.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=Dy,n.msg="incorrect header check",s.marker=5;break}if(!(o&LJe)){s.mode=UB;break}s.mode=Rde;case Rde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Bde;case Bde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Lde;case Lde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Nde;case Nde:return n.avail_in===0?r:(r=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=u7,2);case u7:return s.mode=Dy,n.msg="need dictionary",s.marker=0,-2;case UB:if(r=s.blocks.proc(n,r),r==-3){s.mode=Dy,s.marker=0;break}if(r==0&&(r=i),r!=1)return r;r=i,s.blocks.reset(n,s.was),s.mode=Fde;case Fde:return n.avail_in=0,1;case Dy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,r){let o=0,s=r;if(!n||!n.istate||n.istate.mode!=u7)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,o=r-s),a.blocks.set_dictionary(i,o,s),a.mode=UB,0},e.inflateSync=function(n){let i,r,o,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Dy&&(c.mode=Dy,c.marker=0),(i=n.avail_in)===0)return-5;for(r=n.next_in_index,o=c.marker;i!==0&&o<4;)n.read_byte(r)==UJe[o]?o++:n.read_byte(r)!==0?o=0:o=4-o,r++,i--;return n.total_in+=r-n.next_in_index,n.next_in_index=r,n.avail_in=i,c.marker=o,o!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=UB,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Vde(){}Vde.prototype={inflateInit:function(e){let t=this;return t.istate=new VJe,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function kJe(e){let t=this,n=new Vde,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,r=EJe,o=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=o,t.append=function(a,c){let l=[],f,d,p=0,g=0,h=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(r),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?l.push(new Uint8Array(o)):l.push(o.slice(0,n.next_out_index))),h+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return l.length>1?(d=new Uint8Array(h),l.forEach(function(A){d.set(A,g),g+=A.length})):d=l[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var kde=kJe;var zJe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},Ol=Object.assign({},zJe);function zk(){return Ol}function Pb(e){if(e.baseURL!==void 0&&(Ol.baseURL=e.baseURL),e.chunkSize!==void 0&&(Ol.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(Ol.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(Ol.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(Ol.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(Ol.Deflate=e.Deflate),e.Inflate!==void 0&&(Ol.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");Ol.workerScripts||(Ol.workerScripts={}),Ol.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");Ol.workerScripts||(Ol.workerScripts={}),Ol.workerScripts.inflate=e.workerScripts.inflate}}}var zde=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;zde[e]=t}var d7=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,r=t.length|0;i<r;i++)n=n>>>8^zde[(n^t[i])&255];this.crc=n}get(){return~this.crc}},Iy=d7;var VB=HJe;function HJe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Ml={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Ml.getPartial(n);return i===32?e.concat(t):Ml._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Ml.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Ml.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=Ml.getPartial(r);return i.push(Ml.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},m7={bytes:{fromBits(e){let n=Ml.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)o&3||(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Ml.partial(8*(n&3),i)),t}}},h7={};h7.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};h7.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=m7.utf8String.toBits(e));let n=t._buffer=Ml.concat(t._buffer,e),i=t._length,r=t._length=i+Ml.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=Ml.concat(t,[Ml.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let l=0;l<16;l++)i[l]=e[l];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let l=0;l<=79;l++){l>=16&&(i[l]=t._S(1,i[l-3]^i[l-8]^i[l-14]^i[l-16]));let f=t._S(5,r)+t._f(l,o,s,a)+c+i[l]+t._key[Math.floor(l/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var p7={};p7.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let l=s[o-1];(o%r===0||r===8&&o%r===4)&&(l=n[l>>>24]<<24^n[l>>16&255]<<16^n[l>>8&255]<<8^n[l&255],o%r===0&&(l=l<<8^l>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^l}for(let l=0;o;l++,o--){let f=s[l&3?o:o-4];o<=4||l<4?a[l]=f:a[l]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,l;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,l=r[c=r[a=r[f]]];let p=l*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],l=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],A=4,x,C,T;for(let E=0;E<i;E++)x=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^l[h&255]^n[A],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^l[d&255]^n[A+1],T=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^l[p&255]^n[A+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^l[g&255]^n[A+3],A+=4,d=x,p=C,g=T;for(let E=0;E<4;E++)r[t?3&-E:E]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[A++],x=d,d=p,p=g,g=h,h=x;return r}};var _7={};_7.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=Ml.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return Ml.clamp(t,r)}};var g7={};g7.hmacSha1=class{constructor(e){let t=this,n=t._hash=h7.sha1,i=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}};var Mb="Invalid pasword",Ob=16,GJe="raw",Hde={name:"PBKDF2"},WJe={name:"HMAC"},jJe="SHA-1",qJe=Object.assign({hash:WJe},Hde),YJe=Object.assign({iterations:1e3,hash:{name:jJe}},Hde),XJe=["deriveBits"],zB=[8,12,16],kB=[16,24,32],Py=10,Gde=[0,0,0,0],yh=m7.bytes,Wde=p7.aes,jde=_7.ctrGladman,qde=g7.hmacSha1,Hk=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let r=bu(t,0,zB[n.strength]+2);await KJe(n,r,n.password),n.password=null,n.aesCtrGladman=new jde(new Wde(n.keys.key),Array.from(Gde)),n.hmac=new qde(n.keys.authentication),t=bu(t,zB[n.strength]+2)}let i=new Uint8Array(t.length-Py-(t.length-Py)%Ob);return Yde(n,t,i,0,Py,!0)}flush(){let t=this,n=t.pendingInput,i=bu(n,0,n.length-Py),r=bu(n,n.length-Py),o=new Uint8Array(0);if(i.length){let a=yh.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);o=yh.fromBits(c)}let s=!0;if(t.signed){let a=bu(yh.fromBits(t.hmac.digest()),0,Py);for(let c=0;c<Py;c++)a[c]!=r[c]&&(s=!1)}return{valid:s,data:o}}},Gk=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await JJe(n,n.password),n.password=null,n.aesCtrGladman=new jde(new Wde(n.keys.key),Array.from(Gde)),n.hmac=new qde(n.keys.authentication));let r=new Uint8Array(i.length+t.length-t.length%Ob);return r.set(i,0),Yde(n,t,r,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let r=t.aesCtrGladman.update(yh.toBits(t.pendingInput));t.hmac.update(r),n=yh.fromBits(r)}let i=bu(yh.fromBits(t.hmac.digest()),0,Py);return{data:y7(n,i),signature:i}}};function Yde(e,t,n,i,r,o){let s=t.length-r;e.pendingInput.length&&(t=y7(e.pendingInput,t),n=ZJe(n,s-s%Ob));let a;for(a=0;a<=s-Ob;a+=Ob){let c=yh.toBits(bu(t,a,a+Ob));o&&e.hmac.update(c);let l=e.aesCtrGladman.update(c);o||e.hmac.update(l),n.set(yh.fromBits(l),a+i)}return e.pendingInput=bu(t,a),n}async function KJe(e,t,n){await Xde(e,n,bu(t,0,zB[e.strength]));let i=bu(t,zB[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new Error(Mb)}async function JJe(e,t){let n=crypto.getRandomValues(new Uint8Array(zB[e.strength]));return await Xde(e,t,n),y7(n,e.keys.passwordVerification)}async function Xde(e,t,n){let i=VB(t),r=await crypto.subtle.importKey(GJe,i,qJe,!1,XJe),o=await crypto.subtle.deriveBits(Object.assign({salt:n},YJe),r,8*(kB[e.strength]*2+2)),s=new Uint8Array(o);e.keys={key:yh.toBits(bu(s,0,kB[e.strength])),authentication:yh.toBits(bu(s,kB[e.strength],kB[e.strength]*2)),passwordVerification:bu(s,kB[e.strength]*2)}}function y7(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ZJe(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function bu(e,t,n){return e.subarray(t,n)}var Rb=12,Wk=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Qde(i,t)}append(t){let n=this;if(n.password){let i=Kde(n,t.subarray(0,Rb));if(n.password=null,i[Rb-1]!=n.passwordVerification)throw new Error(Mb);t=t.subarray(Rb)}return Kde(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},jk=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Qde(i,t)}append(t){let n=this,i,r;if(n.password){n.password=null;let o=crypto.getRandomValues(new Uint8Array(Rb));o[Rb-1]=n.passwordVerification,i=new Uint8Array(t.length+o.length),i.set(Jde(n,o),0),r=Rb}else i=new Uint8Array(t.length),r=0;return i.set(Jde(n,t),r),i}flush(){return{data:new Uint8Array(0)}}};function Kde(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=$de(e)^t[i],A7(e,n[i]);return n}function Jde(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=$de(e)^t[i],A7(e,t[i]);return n}function Qde(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new Iy(e.keys[0]),e.crcKey2=new Iy(e.keys[2]);for(let n=0;n<t.length;n++)A7(e,t.charCodeAt(n))}function A7(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=Zde(e.keys[1]+eme(e.keys[0])),e.keys[1]=Zde(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function $de(e){let t=e.keys[2]|2;return eme(Math.imul(t,t^1)>>>8)}function eme(e){return e&255}function Zde(e){return e&4294967295}var Yk="deflate",Xk="inflate",qk="Invalid signature",x7=class{constructor(t,{signature:n,password:i,signed:r,compressed:o,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:l}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:r,compressed:o,inflate:o&&new t({chunkSize:l}),crc32:r&&new Iy,zipCrypto:s,decrypt:f&&s?new Wk(i,a):new Hk(i,r,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let r=t.decrypt.flush();if(!r.valid)throw new Error(qk);i=r.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let r=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),r.setUint32(0,n),t.signature!=r.getUint32(0,!1))throw new Error(qk)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},C7=class{constructor(t,{encrypted:n,signed:i,compressed:r,level:o,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:l},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:r,deflate:r&&new t({level:o||5,chunkSize:f}),crc32:i&&new Iy,zipCrypto:s,encrypt:n&&s?new jk(a,c):new Gk(a,l)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let r=t.encrypt.flush();n=r.signature;let o=new Uint8Array(i.length+r.data.length);o.set(i,0),o.set(r.data,i.length),i=o}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function tme(e,t,n){if(t.codecType.startsWith(Yk))return new C7(e,t,n);if(t.codecType.startsWith(Xk))return new x7(e,t,n)}var nme="init",ime="append",T7="flush",QJe="message",rme=!0,Kk=(e,t,n,i,r,o,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,r(e)}}),o?eZe(e,i):$Je(e,i));function $Je(e,t){let n=tme(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(r){throw e.onTaskFinished(),r}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function eZe(e,t){let n,i={type:"module"};if(!e.interface){if(!rme)e.worker=r(i,t.baseURL);else try{e.worker=r({},t.baseURL)}catch{rme=!1,e.worker=r(i,t.baseURL)}e.worker.addEventListener(QJe,a,!1),e.interface={append(c){return o({type:ime,data:c})},flush(){return o({type:T7})},abort(){e.onTaskFinished()}}}return e.interface;function r(c,l){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,l)}catch{d=f}return new Worker(d,c)}async function o(c){if(!n){let l=e.options,f=e.scripts.slice(1);await s({scripts:f,type:nme,options:l,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let l=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,l.postMessage(c,[c.data])}catch{l.postMessage(c)}else l.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let l=c.data;if(n){let f=l.error,d=l.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==nme||d==T7||d==ime){let p=l.data;d==T7?(n.resolve({data:new Uint8Array(p),signature:l.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var Nx=[],E7=[];function Jk(e,t,n){let r=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),o=r&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Nx.length<n.maxWorkers){let a={};return Nx.push(a),Kk(a,e,t,n,s,r,o)}else{let a=Nx.find(c=>!c.busy);return a?(ome(a),Kk(a,e,t,n,s,r,o)):new Promise(c=>E7.push({resolve:c,codecConstructor:e,options:t,webWorker:r,scripts:o}))}function s(a){if(E7.length){let[{resolve:c,codecConstructor:l,options:f,webWorker:d,scripts:p}]=E7.splice(0,1);c(Kk(a,l,f,n,s,d,p))}else a.worker?(ome(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{Nx=Nx.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):Nx=Nx.filter(c=>c!=a)}}function ome(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var ame="Abort error";async function Zk(e,t,n,i,r,o,s){let a=Math.max(o.chunkSize,64);return c();async function c(l=0,f=0){let d=s.signal;if(l<r){b7(d,e);let p=await t.readUint8Array(l+i,Math.min(a,r-l)),g=p.length;b7(d,e);let h=await e.append(p);if(b7(d,e),f+=await sme(n,h),s.onprogress)try{s.onprogress(l+g,r)}catch{}return c(l+a,f)}else{let p=await e.flush();return f+=await sme(n,p.data),{signature:p.signature,length:f}}}}function b7(e,t){if(e&&e.aborted)throw t.abort(),new Error(ame)}async function sme(e,t){return t.length&&await e.writeUint8Array(t),t.length}var S7="text/plain";var Qk=class{constructor(){this.size=0}init(){this.initialized=!0}},$k=class extends Qk{},HB=class extends Qk{writeUint8Array(t){this.size+=t.length}},e4=class extends $k{constructor(t){super(),this.blobReader=new Fx(new Blob([t],{type:S7}))}async init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}async readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},t4=class extends HB{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:S7})}async writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:S7})}getData(){if(this.blob.text)return this.blob.text();{let t=new FileReader;return new Promise((n,i)=>{t.onload=r=>n(r.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var n4=class extends HB{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}async writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,r=this.pending.length;for(this.pending="",n=0;n<Math.floor((r+t.length)/3)*3-r;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},Fx=class extends $k{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(new Uint8Array(s.target.result)),i.onerror=()=>o(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},Bb=class extends HB{constructor(t){super(),this.contentType=t,this.arrayBuffers=[]}async writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.blob=new Blob(this.arrayBuffers,{type:this.contentType})),this.blob}};var Lb="/",v7=new Date(2107,11,31),w7=new Date(1980,0,1);var tZe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),cme=e=>{let t="";for(let n=0;n<e.length;n++)t+=tZe[e[n]];return t};var i4=nZe;async function nZe(e,t){if(t&&t.trim().toLowerCase()=="cp437")return cme(e);if(typeof TextDecoder>"u"){let n=new FileReader;return new Promise((i,r)=>{n.onload=o=>i(o.target.result),n.onerror=()=>r(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var iZe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],D_=class{constructor(t){iZe.forEach(n=>this[n]=t[n])}};var P7="File format is not recognized",aZe="End of central directory not found",cZe="End of Zip64 central directory not found",lZe="End of Zip64 central directory locator not found",uZe="Central directory header not found",fZe="Local file header not found",dZe="Zip64 extra field not found",mZe="File contains encrypted entry",hZe="Encryption method not supported",lme="Compression method not supported",ume="utf-8",fme="cp437",dme=["uncompressedSize","compressedSize","offset"],d4=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:zk()})}async getEntries(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(P7);let r=await AZe(i,101010256,i.size,22,65535*16);if(!r)throw new Error(aZe);let o=lc(r),s=sa(o,12),a=sa(o,16),c=Su(o,8),l=0;if(a==4294967295||s==4294967295||c==65535){let h=await Oy(i,r.offset-20,20),A=lc(h);if(sa(A,0)!=117853008)throw new Error(cZe);a=r4(A,8);let x=await Oy(i,a,56),C=lc(x),T=r.offset-20-56;if(sa(C,0)!=101075792&&a!=T){let E=a;a=T,l=a-E,x=await Oy(i,a,56),C=lc(x)}if(sa(C,0)!=101075792)throw new Error(lZe);c=r4(C,32),s=r4(C,40),a-=s}if(a<0||a>=i.size)throw new Error(P7);let f=0,d=await Oy(i,a,s),p=lc(d);if(s){let h=r.offset-s;if(sa(p,f)!=33639248&&a!=h){let A=a;a=h,l=a-A,d=await Oy(i,a,s),p=lc(d)}}if(a<0||a>=i.size)throw new Error(P7);let g=[];for(let h=0;h<c;h++){let A=new M7(i,n.config,n.options);if(sa(p,f)!=33639248)throw new Error(uZe);hme(A,p,f+6);let x=!!A.bitFlag.languageEncodingFlag,C=f+46,T=C+A.filenameLength,E=T+A.extraFieldLength,S=Su(p,f+4),w=(S&0)==0;Object.assign(A,{versionMadeBy:S,msDosCompatible:w,compressedSize:0,uncompressedSize:0,commentLength:Su(p,f+32),directory:w&&(Fb(p,f+38)&16)==16,offset:sa(p,f+42)+l,internalFileAttribute:sa(p,f+34),externalFileAttribute:sa(p,f+38),rawFilename:d.subarray(C,T),filenameUTF8:x,commentUTF8:x,rawExtraField:d.subarray(T,E)});let D=E+A.commentLength;A.rawComment=d.subarray(E,D);let M=Nb(n,t,"filenameEncoding"),O=Nb(n,t,"commentEncoding"),[B,L]=await Promise.all([i4(A.rawFilename,A.filenameUTF8?ume:M||fme),i4(A.rawComment,A.commentUTF8?ume:O||fme)]);A.filename=B,A.comment=L,!A.directory&&A.filename.endsWith(Lb)&&(A.directory=!0),await pme(A,A,p,f+6);let _=new D_(A);if(_.getData=(b,v)=>A.getData(b,_,v),g.push(_),f=D,t.onprogress)try{t.onprogress(h+1,c,new D_(A))}catch{}}return g}async close(){}};var M7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let r=this,{reader:o,offset:s,extraFieldAES:a,compressionMethod:c,config:l,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=r,h=r.localDirectory={};o.initialized||await o.init();let A=await Oy(o,s,30),x=lc(A),C=Nb(r,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(lme);if(c!=0&&c!=8)throw new Error(lme);if(sa(x,0)!=67324752)throw new Error(fZe);hme(h,x,4),A=await Oy(o,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=A.subarray(30+h.filenameLength),await pme(r,h,x,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let T=r.encrypted&&h.encrypted,E=T&&!a;if(T){if(!E&&a.strength===void 0)throw new Error(hZe);if(!C)throw new Error(mZe)}let S=await Jk(l.Inflate,{codecType:Xk,password:C,zipCrypto:E,encryptionStrength:a&&a.strength,signed:Nb(r,i,"checkSignature"),passwordVerification:E&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:T,useWebWorkers:Nb(r,i,"useWebWorkers")},l);t.initialized||await t.init();let w=Nb(r,i,"signal"),D=s+30+h.filenameLength+h.extraFieldLength;return await Zk(S,o,t,D,g,l,{onprogress:i.onprogress,signal:w}),t.getData()}};function hme(e,t,n){let i=e.rawBitFlag=Su(t,n+2),r=(i&1)==1,o=sa(t,n+6);Object.assign(e,{encrypted:r,version:Su(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:xZe(o),filenameLength:Su(t,n+22),extraFieldLength:Su(t,n+24)})}async function pme(e,t,n,i){let r=t.rawExtraField,o=t.extraField=new Map,s=lc(new Uint8Array(r)),a=0;try{for(;a<r.length;){let A=Su(s,a),x=Su(s,a+2);o.set(A,{type:A,data:r.slice(a+4,a+4+x)}),a+=4+x}}catch{}let c=Su(n,i+4);t.signature=sa(n,i+10),t.uncompressedSize=sa(n,i+18),t.compressedSize=sa(n,i+14);let l=o.get(1);l&&(pZe(l,t),t.extraFieldZip64=l);let f=o.get(28789);f&&(await mme(f,"filename","rawFilename",t,e),t.extraFieldUnicodePath=f);let d=o.get(25461);d&&(await mme(d,"comment","rawComment",t,e),t.extraFieldUnicodeComment=d);let p=o.get(39169);p?(_Ze(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let g=o.get(10);g&&(gZe(g,t),t.extraFieldNTFS=g);let h=o.get(21589);h&&(yZe(h,t),t.extraFieldExtendedTimestamp=h)}function pZe(e,t){t.zip64=!0;let n=lc(e.data);e.values=[];for(let r=0;r<Math.floor(e.data.length/8);r++)e.values.push(r4(n,0+r*8));let i=dme.filter(r=>t[r]==4294967295);for(let r=0;r<i.length;r++)e[i[r]]=e.values[r];dme.forEach(r=>{if(t[r]==4294967295)if(e[r]!==void 0)t[r]=e[r];else throw new Error(dZe)})}async function mme(e,t,n,i,r){let o=lc(e.data);e.version=Fb(o,0),e.signature=sa(o,1);let s=new Iy;s.append(r[n]);let a=lc(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await i4(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==sa(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function _Ze(e,t,n){let i=lc(e.data);e.vendorVersion=Fb(i,0),e.vendorId=Fb(i,2);let r=Fb(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Su(i,5)}function gZe(e,t){let n=lc(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=Su(n,i),s=Su(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(r&&r.length==24){let o=lc(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let l=O7(s),f=O7(a),d=O7(c),p={lastModDate:l,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function yZe(e,t){let n=lc(e.data),i=Fb(n,0),r=[],o=[];(i&1)==1&&(r.push("lastModDate"),o.push("rawLastModDate")),(i&2)==2&&(r.push("lastAccessDate"),o.push("rawLastAccessDate")),(i&4)==4&&(r.push("creationDate"),o.push("rawCreationDate"));let s=1;r.forEach((a,c)=>{if(e.data.length>=s+4){let l=sa(n,s);t[a]=e[a]=new Date(l*1e3);let f=o[c];e[f]=l}s+=4})}async function AZe(e,t,n,i,r){let o=new Uint8Array(4),s=lc(o);CZe(s,0,t);let a=i+r;return await c(i)||await c(Math.min(a,n));async function c(l){let f=n-l,d=await Oy(e,f,l);for(let p=d.length-i;p>=0;p--)if(d[p]==o[0]&&d[p+1]==o[1]&&d[p+2]==o[2]&&d[p+3]==o[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function Nb(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function xZe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function O7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Fb(e,t){return e.getUint8(t)}function Su(e,t){return e.getUint16(t,!0)}function sa(e,t){return e.getUint32(t,!0)}function r4(e,t){return Number(e.getBigUint64(t,!0))}function CZe(e,t,n){e.setUint32(t,n,!0)}function lc(e){return new DataView(e.buffer)}function Oy(e,t,n){return e.readUint8Array(t,n)}var vZe="File already exists",wZe="Zip file comment exceeds 64KB",DZe="File entry comment exceeds 64KB",IZe="File entry name exceeds 64KB",yme="Version exceeds 65535",PZe="The strength must equal 1, 2, or 3",OZe="Extra field type exceeds 65535",MZe="Extra field data exceeds 64KB",W7="Zip64 is not supported",Ame=new Uint8Array([7,0,2,0,65,69,3,0,0]),xme=24,H7=0,p4=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:zk(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[]})}async add(t="",n,i={}){let r=this;if(H7<r.config.maxWorkers){H7++;try{return await RZe(r,t,n,i)}finally{H7--;let o=r.pendingEntries.shift();o&&r.add(o.name,o.reader,o.options).then(o.resolve).catch(o.reject)}}else return new Promise((o,s)=>r.pendingEntries.push({name:t,reader:n,options:i,resolve:o,reject:s}))}async close(t=new Uint8Array(0),n={}){return await NZe(this,t,n),this.writer.getData()}};async function RZe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(Lb)?t+=Lb:i.directory=t.endsWith(Lb),e.files.has(t))throw new Error(vZe);let r=VB(t);if(r.length>65535)throw new Error(IZe);let o=i.comment||"",s=VB(o);if(s.length>65535)throw new Error(DZe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(yme);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(yme);let l=Da(e,i,"lastModDate")||new Date,f=Da(e,i,"lastAccessDate"),d=Da(e,i,"creationDate"),p=Da(e,i,"password"),g=Da(e,i,"encryptionStrength")||3,h=Da(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(PZe);let A=new Uint8Array(0),x=i.extraField;if(x){let F=0,k=0;x.forEach(V=>F+=4+V.length),A=new Uint8Array(F),x.forEach((V,G)=>{if(G>65535)throw new Error(OZe);if(V.length>65535)throw new Error(MZe);ca(A,new Uint16Array([G]),k),ca(A,new Uint16Array([V.length]),k+2),ca(A,V,k+4),k+=4+V.length})}let C=Da(e,i,"extendedTimestamp");C===void 0&&(C=!0);let T=0,E=Da(e,i,"keepOrder");E===void 0&&(E=!0);let S=0,w=Da(e,i,"msDosCompatible");w===void 0&&(w=!0);let D=Da(e,i,"internalFileAttribute")||0,M=Da(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,T=UZe(S));let O=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||T>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!E)throw new Error(W7);O=!0}e.pendingCompressedSize+=T,await Promise.resolve();let B=Da(e,i,"level"),L=Da(e,i,"useWebWorkers"),_=Da(e,i,"bufferedWrite"),b=Da(e,i,"dataDescriptor"),v=Da(e,i,"dataDescriptorSignature"),I=Da(e,i,"signal");b===void 0&&(b=!0),b&&v===void 0&&(v=!0);let R=await BZe(e,t,n,Object.assign({},i,{rawFilename:r,rawComment:s,version:a,versionMadeBy:c,lastModDate:l,lastAccessDate:f,creationDate:d,rawExtraField:A,zip64:O,password:p,level:B,useWebWorkers:L,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:E,dataDescriptor:b,dataDescriptorSignature:v,signal:I,msDosCompatible:w,internalFileAttribute:D,externalFileAttribute:M}));return T&&(e.pendingCompressedSize-=T),Object.assign(R,{name:t,comment:o,extraField:x}),new D_(R)}async function BZe(e,t,n,i){let r=e.files,o=e.writer,s=Array.from(r.values()).pop(),a={},c,l,f;r.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new Bb,p.init(),c=!0):(e.lockWrite=new Promise(h=>l=h),o.initialized||await o.init(),p=o),a=await LZe(n,p,e.config,i),a.lock=g,r.set(t,a),a.filename=t,c){let h=0,A=p.getData();await Promise.all([e.lockWrite,d]);let x;do x=Array.from(r.values()).find(C=>C.writingBufferedData),x&&await x.lock;while(x&&x.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let T=await Cme(A,0,26),E=new DataView(T);(!a.encrypted||i.zipCrypto)&&Ar(E,14,a.signature),a.zip64?(Ar(E,18,4294967295),Ar(E,22,4294967295)):(Ar(E,18,a.compressedSize),Ar(E,22,a.uncompressedSize)),await o.writeUint8Array(new Uint8Array(T)),h=26}await FZe(o,A,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=om(a.rawExtraFieldZip64);Rl(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(W7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),r.delete(t),d}finally{f(),l&&l()}}async function LZe(e,t,n,i){let{rawFilename:r,lastAccessDate:o,creationDate:s,password:a,level:c,zip64:l,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:A,rawComment:x,rawExtraField:C,useWebWorkers:T,onprogress:E,signal:S,encryptionStrength:w,extendedTimestamp:D,msDosCompatible:M,internalFileAttribute:O,externalFileAttribute:B}=i,L=!!(a&&a.length),_=c!==0&&!g,b;if(L&&!f){b=new Uint8Array(Ame.length+2);let Re=om(b);$r(Re,0,39169),ca(b,Ame,2),_4(Re,8,w)}else b=new Uint8Array(0);let v,I;if(D){I=new Uint8Array(9+(o?4:0)+(s?4:0));let Re=om(I);$r(Re,0,21589),$r(Re,2,I.length-4);let tt=1+(o?2:0)+(s?4:0);_4(Re,4,tt),Ar(Re,5,Math.floor(i.lastModDate.getTime()/1e3)),o&&Ar(Re,9,Math.floor(o.getTime()/1e3)),s&&Ar(Re,13,Math.floor(s.getTime()/1e3));try{v=new Uint8Array(36);let nt=om(v),Wt=G7(i.lastModDate);$r(nt,0,10),$r(nt,2,32),$r(nt,8,1),$r(nt,10,24),Rl(nt,12,Wt),Rl(nt,20,G7(o)||Wt),Rl(nt,28,G7(s)||Wt)}catch{v=new Uint8Array(0)}}else v=I=new Uint8Array(0);let R={version:h||20,versionMadeBy:A,zip64:l,directory:!!g,filenameUTF8:!0,rawFilename:r,commentUTF8:!0,rawComment:x,rawExtraFieldZip64:l?new Uint8Array(xme+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:v,rawExtraFieldAES:b,rawExtraField:C,extendedTimestamp:D,msDosCompatible:M,internalFileAttribute:O,externalFileAttribute:B},F=R.uncompressedSize=0,k=2048;d&&(k=k|8);let V=0;_&&(V=8),l&&(R.version=R.version>45?R.version:45),L&&(k=k|1,f||(R.version=R.version>51?R.version:51,V=99,_&&(R.rawExtraFieldAES[9]=8))),R.compressionMethod=V;let G=R.headerArray=new Uint8Array(26),U=om(G);$r(U,0,R.version),$r(U,2,k),$r(U,4,V);let Y=new Uint32Array(1),W=om(Y),J;i.lastModDate<w7?J=w7:i.lastModDate>v7?J=v7:J=i.lastModDate,$r(W,0,(J.getHours()<<6|J.getMinutes())<<5|J.getSeconds()/2),$r(W,2,(J.getFullYear()-1980<<4|J.getMonth()+1)<<5|J.getDate());let j=Y[0];Ar(U,6,j),$r(U,22,r.length);let K=b.length+I.length+v.length+R.rawExtraField.length;$r(U,24,K);let Z=new Uint8Array(30+r.length+K),me=om(Z);Ar(me,0,67324752),ca(Z,G,4),ca(Z,r,30),ca(Z,b,30+r.length),ca(Z,I,30+r.length+b.length),ca(Z,v,30+r.length+b.length+I.length),ca(Z,R.rawExtraField,30+r.length+b.length+I.length+v.length);let ye,se=0;if(e){F=R.uncompressedSize=e.size;let Re=await Jk(n.Deflate,{codecType:Yk,level:c,password:a,encryptionStrength:w,zipCrypto:L&&f,passwordVerification:L&&f&&j>>8&255,signed:!0,compressed:_,encrypted:L,useWebWorkers:T},n);await t.writeUint8Array(Z),R.dataWritten=!0,ye=await Zk(Re,e,t,0,F,n,{onprogress:E,signal:S}),se=ye.length}else await t.writeUint8Array(Z),R.dataWritten=!0;let pe=new Uint8Array(0),Ae,De=0;if(d&&(pe=new Uint8Array(l?p?24:20:p?16:12),Ae=om(pe),p&&(De=4,Ar(Ae,0,134695760))),e){let Re=ye.signature;if((!L||f)&&Re!==void 0&&(Ar(U,10,Re),R.signature=Re,d&&Ar(Ae,De,Re)),l){let tt=om(R.rawExtraFieldZip64);$r(tt,0,1),$r(tt,2,xme),Ar(U,14,4294967295),Rl(tt,12,BigInt(se)),Ar(U,18,4294967295),Rl(tt,4,BigInt(F)),d&&(Rl(Ae,De+4,BigInt(se)),Rl(Ae,De+12,BigInt(F)))}else Ar(U,14,se),Ar(U,18,F),d&&(Ar(Ae,De+4,se),Ar(Ae,De+8,F))}d&&await t.writeUint8Array(pe);let Ce=Z.length+se+pe.length;return Object.assign(R,{compressedSize:se,lastModDate:J,rawLastModDate:j,creationDate:s,lastAccessDate:o,encrypted:L,length:Ce}),R}async function NZe(e,t,n){let i=e.writer,r=e.files,o=0,s=0,a=e.offset,c=r.size;for(let[,p]of r)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let l=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(W7);l=!0}let f=new Uint8Array(s+(l?98:22)),d=om(f);if(t&&t.length)if(t.length<=65535)$r(d,o+20,t.length);else throw new Error(wZe);for(let[p,g]of Array.from(r.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:A,rawExtraFieldAES:x,rawExtraField:C,rawComment:T,versionMadeBy:E,headerArray:S,directory:w,zip64:D,msDosCompatible:M,internalFileAttribute:O,externalFileAttribute:B}=g,L,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,L=new Uint8Array(9);let v=om(L);$r(v,0,21589),$r(v,2,L.length-4),_4(v,4,1),Ar(v,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=L=new Uint8Array(0);let b=A.length+x.length+L.length+_.length+C.length;if(Ar(d,o,33639248),$r(d,o+4,E),ca(f,S,o+6),$r(d,o+30,b),$r(d,o+32,T.length),Ar(d,o+34,O),B?Ar(d,o+38,B):w&&M&&_4(d,o+38,16),D?Ar(d,o+42,4294967295):Ar(d,o+42,g.offset),ca(f,h,o+46),ca(f,A,o+46+h.length),ca(f,x,o+46+h.length+A.length),ca(f,L,o+46+h.length+A.length+x.length),ca(f,_,o+46+h.length+A.length+x.length+L.length),ca(f,C,o+46+h.length+A.length+x.length+L.length+_.length),ca(f,T,o+46+h.length+b),o+=46+h.length+b+T.length,n.onprogress)try{n.onprogress(p+1,r.size,new D_(g))}catch{}}l&&(Ar(d,o,101075792),Rl(d,o+4,BigInt(44)),$r(d,o+12,45),$r(d,o+14,45),Rl(d,o+24,BigInt(c)),Rl(d,o+32,BigInt(c)),Rl(d,o+40,BigInt(s)),Rl(d,o+48,BigInt(a)),Ar(d,o+56,117853008),Rl(d,o+64,BigInt(a)+BigInt(s)),Ar(d,o+72,1),c=65535,a=4294967295,s=4294967295,o+=76),Ar(d,o,101010256),$r(d,o+8,c),$r(d,o+10,c),Ar(d,o+12,s),Ar(d,o+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function Cme(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(s.target.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function FZe(e,t,n=0){await r();async function r(){if(n<t.size){let o=await Cme(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(o)),n+=536870912,await r()}}}function G7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Da(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function UZe(e){return e+5*(Math.floor(e/16383)+1)}function _4(e,t,n){e.setUint8(t,n)}function $r(e,t,n){e.setUint16(t,n,!0)}function Ar(e,t,n){e.setUint32(t,n,!0)}function Rl(e,t,n){e.setBigUint64(t,n,!0)}function ca(e,t,n){e.set(t,n)}function om(e){return new DataView(e.buffer)}Pb({Deflate:yde,Inflate:kde});var j7=32,VZe="http://www.opengis.net/kml/2.2",am="http://www.google.com/kml/ext/2.2",kZe="http://www.w3.org/2000/xmlns/";function g4(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var zZe=/^data:image\/([^,;]+)/;g4.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof we){if(e=we.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(zZe);n=`texture_${++this._count}`,u(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function HZe(e,t){return function(n){e._files[t]=n}}g4.prototype.model=function(e,t){let n=this._modelCallback;if(!u(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(HZe(this,o))}return r};Object.defineProperties(g4.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function y4(e){this._time=e}y4.prototype.get=function(e,t,n){let i;return u(e)&&(i=u(e.getValue)?e.getValue(this._time,n):e),y(i,t)};y4.prototype.getColor=function(e,t){let n=this.get(e,t);if(u(n))return Vx(n)};y4.prototype.getMaterialType=function(e){if(u(e))return e.getType(this._time)};function q7(){this._ids={},this._styles={},this._count=0}q7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(u(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};q7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Sme(){this._ids={}}Sme.prototype.get=function(e){if(!u(e))return this.get(jn());let t=this._ids;return u(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Y7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=Y7._createState(e),r=t.values.filter(function(l){return!u(l.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(kZe,"xmlns:gx",am);let a=o.createElement("Document");s.appendChild(a),wme(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?GZe(f,c.files):{kml:f,externalFiles:c.files}})}function GZe(e,t){let n=en("ThirdParty/Workers/z-worker-pako.js");Pb({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Bb,r=new p4(i);return r.add("doc.kml",new e4(e)).then(function(){let o=Object.keys(t);return vme(r,o,t,0)}).then(function(){return r.close()}).then(function(o){return{kmz:o}})}function vme(e,t,n,i){if(t.length===i)return;let r=t[i];return e.add(r,new Fx(n[r])).then(function(){return vme(e,t,n,i+1)})}Y7._createState=function(e){let t=e.entities,n=new q7,i=t.computeAvailability(),r=u(e.time)?e.time:i.start,o=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);o.start===ze.MINIMUM_VALUE?o.stop===ze.MAXIMUM_VALUE?o=new Tn:ee.addSeconds(o.stop,-10*s,o.start):o.stop===ze.MAXIMUM_VALUE&&ee.addSeconds(o.start,10*s,o.stop);let a=new g4(e.modelCallback);return{kmlDoc:document.implementation.createDocument(VZe,"kml"),ellipsoid:y(e.ellipsoid,re.WGS84),idManager:new Sme,styleCache:n,externalFileHandler:a,time:r,valueGetter:new y4(r),sampleDuration:s,defaultAvailability:new Oo([o])}};function wme(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,l,f;for(let d=0;d<a;++d){let p=n[d];c=[],l=[],f=[],WZe(e,p,l,f),jZe(e,p.polyline,l,f),bme(e,p.rectangle,l,f,c),bme(e,p.polygon,l,f,c),KZe(e,p,p.model,l,f);let g,h=p.availability;u(h)&&(g=i.createElement("TimeSpan"),ee.equals(h.start,ze.MINIMUM_VALUE)||g.appendChild(hn(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,ze.MAXIMUM_VALUE)||g.appendChild(hn(i,"end",ee.toIso8601(h.stop))));for(let C=0;C<c.length;++C){let T=c[C];T.setAttribute("id",s.get(p.id)),T.appendChild(hn(i,"name",p.name)),T.appendChild(hn(i,"visibility",p.show)),T.appendChild(hn(i,"description",p.description)),u(g)&&T.appendChild(g),t.appendChild(T)}let A=l.length;if(A>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let T=p.name,E=p.label;if(u(E)){let w=i.createElement("LabelStyle"),D=o.get(E.text);T=u(D)&&D.length>0?D:T;let M=o.getColor(E.fillColor);u(M)&&(w.appendChild(hn(i,"color",M)),w.appendChild(hn(i,"colorMode","normal")));let O=o.get(E.scale);u(O)&&w.appendChild(hn(i,"scale",O)),f.push(w)}C.appendChild(hn(i,"name",T)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),u(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let w=i.createElement("Style");for(let D=0;D<S;++D)w.appendChild(f[D]);C.appendChild(hn(i,"styleUrl",r.get(w)))}if(l.length===1)C.appendChild(l[0]);else if(l.length>1){let w=i.createElement("MultiGeometry");for(let D=0;D<A;++D)w.appendChild(l[D]);C.appendChild(w)}}let x=p._children;if(x.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(hn(i,"name",p.name)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),t.appendChild(C),wme(e,C,x)}}}var Bl=new m,Xc=new he,sm=new ee;function WZe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!u(a)&&!u(t.path))return;let c=t.position;if(!c.isConstant){Dme(e,t,a,n,i);return}s.get(c,void 0,Bl);let l=hn(r,"coordinates",Ux(Bl,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(kx(e,a.heightReference)),f.appendChild(d),f.appendChild(l),n.push(f);let p=a instanceof ja?Pme(e,a):Ime(e,a);i.push(p)}function Dme(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,l=t.position,f=!0;l instanceof na?(c=l.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof _p,p,g,h,A=[];for(p=0;p<c.length;++p){let C=c.get(p),T=f?l:C.data,E=o.createElement("altitudeMode");T instanceof ph?(T=T._value,E.appendChild(kx(e,je.CLAMP_TO_GROUND))):u(n)?E.appendChild(kx(e,n.heightReference)):E.appendChild(kx(e,je.NONE));let S=[],w=[];if(T.isConstant){a.get(T,void 0,Bl);let M=hn(o,"coordinates",Ux(Bl,s));S.push(ee.toIso8601(C.start)),w.push(M),S.push(ee.toIso8601(C.stop)),w.push(M)}else if(T instanceof ra)for(h=T._property._times,g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),T.getValueInReferenceFrame(h[g],ar.FIXED,Bl),w.push(Ux(Bl,s));else if(T instanceof _u){h=T._times;let M=T._values;for(g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),m.fromArray(M,g*3,Bl),w.push(Ux(Bl,s))}else{let M=e.sampleDuration;C.start.clone(sm),C.isStartIncluded||ee.addSeconds(sm,M,sm);let O=C.stop;for(;ee.lessThan(sm,O);)T.getValue(sm,Bl),S.push(ee.toIso8601(sm)),w.push(Ux(Bl,s)),ee.addSeconds(sm,M,sm);C.isStopIncluded&&ee.equals(sm,O)&&(T.getValue(sm,Bl),S.push(ee.toIso8601(sm)),w.push(Ux(Bl,s)))}let D=o.createElementNS(am,"Track");D.appendChild(E);for(let M=0;M<S.length;++M){let O=hn(o,"when",S[M]),B=hn(o,"coord",w[M],am);D.appendChild(O),D.appendChild(B)}d&&D.appendChild(Ome(e,n)),A.push(D)}if(A.length===1)i.push(A[0]);else if(A.length>1){let C=o.createElementNS(am,"MultiTrack");for(p=0;p<A.length;++p)C.appendChild(A[p]);i.push(C)}if(u(n)&&!d){let C=n instanceof ja?Pme(e,n):Ime(e,n);r.push(C)}let x=t.path;if(u(x)){let C=a.get(x.width),T=x.material;if(u(T)||u(C)){let E=o.createElement("LineStyle");u(C)&&E.appendChild(hn(o,"width",C)),X7(e,T,E),r.push(E)}}}function Ime(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);u(o)&&(r.appendChild(hn(n,"color",o)),r.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return u(s)&&r.appendChild(hn(n,"scale",s/j7)),r}function Pme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(u(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(hn(n,"href",s));let g=i.get(t.imageSubRegion);u(g)&&(p.appendChild(hn(n,"x",g.x,am)),p.appendChild(hn(n,"y",g.y,am)),p.appendChild(hn(n,"w",g.width,am)),p.appendChild(hn(n,"h",g.height,am))),o.appendChild(p)}let a=i.getColor(t.color);u(a)&&(o.appendChild(hn(n,"color",a)),o.appendChild(hn(n,"colorMode","normal")));let c=i.get(t.scale);u(c)&&o.appendChild(hn(n,"scale",c));let l=i.get(t.pixelOffset);if(u(l)){c=y(c,1),H.divideByScalar(l,c,l);let p=i.get(t.width,j7),g=i.get(t.height,j7),h=i.get(t.horizontalOrigin,gi.CENTER);h===gi.CENTER?l.x-=p*.5:h===gi.RIGHT&&(l.x-=p);let A=i.get(t.verticalOrigin,On.CENTER);A===On.TOP?l.y+=g:A===On.CENTER&&(l.y+=g*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-l.x),x.setAttribute("y",l.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),o.appendChild(x)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return u(f)&&m.equals(m.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),o.appendChild(hn(n,"heading",f))),o}function jZe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!u(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),l=s.get(t.clampToGround,!1),f;l?(a.appendChild(hn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=hn(r,"coordinates",Ux(p,o));a.appendChild(g);let h=s.get(t.zIndex);l&&u(h)&&a.appendChild(hn(r,"drawOrder",h,am)),n.push(a);let A=r.createElement("LineStyle"),x=s.get(t.width);u(x)&&A.appendChild(hn(r,"width",x)),X7(e,t.material,A),i.push(A)}function qZe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],l=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)l[g](a,Xc),c.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${o}`);let f=hn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Eme(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,Xc),s.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${i?Xc.height:n}`);let c=hn(r,"coordinates",s.join(" ")),l=r.createElement("LinearRing");return l.appendChild(c),l}function YZe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,l=r.get(c),f=Array.isArray(l)?l:l.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Eme(e,f,o,s)),a.push(d);let p=l.holes;if(u(p)){let g=p.length;for(let h=0;h<g;++h){let A=i.createElement("innerBoundaryIs");A.appendChild(Eme(e,p[h].positions,o,s)),a.push(A)}}return a}function bme(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!u(t))return;let a=t instanceof _d;if(a&&s.getMaterialType(t.material)==="Image"){XZe(e,t,r);return}let c=o.createElement("Polygon"),l=s.get(t.extrudedHeight,0);l>0&&c.appendChild(hn(o,"extrude",!0));let f=a?qZe(e,t,l):YZe(e,t,l),d=f.length;for(let x=0;x<d;++x)c.appendChild(f[x]);let p=o.createElement("altitudeMode");p.appendChild(kx(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&g.appendChild(hn(o,"fill",h)),X7(e,t.material,g);let A=s.get(t.outline,!1);if(A){g.appendChild(hn(o,"outline",A));let x=o.createElement("LineStyle"),C=s.get(t.outlineWidth,1);x.appendChild(hn(o,"width",C));let T=s.getColor(t.outlineColor,z.BLACK);x.appendChild(hn(o,"color",T)),x.appendChild(hn(o,"colorMode","normal")),i.push(x)}i.push(g)}function XZe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(kx(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);u(c)&&s.appendChild(hn(i,"altitude",c));let l=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(hn(i,"north",P.toDegrees(l.north))),f.appendChild(hn(i,"south",P.toDegrees(l.south))),f.appendChild(hn(i,"east",P.toDegrees(l.east))),f.appendChild(hn(i,"west",P.toDegrees(l.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(hn(i,"href",p)),s.appendChild(g);let h=d.color;u(h)&&s.appendChild(hn(i,"color",Vx(d.color))),n.push(s)}function Ome(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(u(s)){let l=n.createElement("scale");l.appendChild(hn(n,"x",s)),l.appendChild(hn(n,"y",s)),l.appendChild(hn(n,"z",s)),o.appendChild(l)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(hn(n,"href",c)),o.appendChild(a),o}function KZe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!u(n))return;let c=t.position;if(!c.isConstant){Dme(e,t,n,i,r);return}let l=Ome(e,n),f=o.createElement("altitudeMode");f.appendChild(kx(e,n.heightReference)),l.appendChild(f),a.get(c,void 0,Bl),he.fromCartesian(Bl,s,Xc);let d=o.createElement("Location");d.appendChild(hn(o,"longitude",P.toDegrees(Xc.longitude))),d.appendChild(hn(o,"latitude",P.toDegrees(Xc.latitude))),d.appendChild(hn(o,"altitude",Xc.height)),l.appendChild(d),i.push(l)}function X7(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!u(t))return;let o=r.get(t);if(!u(o))return;let s,a=r.getMaterialType(t),c,l;switch(a){case"Image":s=Vx(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=Vx(o.color);break;case"PolylineOutline":s=Vx(o.color),c=Vx(o.outlineColor),l=o.outlineWidth,n.appendChild(hn(i,"outerColor",c,am)),n.appendChild(hn(i,"outerWidth",l,am));break;case"Stripe":s=Vx(o.oddColor);break}u(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function kx(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,je.NONE),o;switch(r){case je.NONE:o=n.createTextNode("absolute");break;case je.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case je.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function Ux(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Xc),i.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${Xc.height}`);return i.join(" ")}function hn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let r=u(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function Vx(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var K7=Y7;function WB(){this._cache={}}WB.prototype.fromColor=function(e,t){return A4(void 0,void 0,e,t,this._cache)};WB.prototype.fromUrl=function(e,t,n){return A4(e,void 0,t,n,this._cache)};WB.prototype.fromMakiIconId=function(e,t,n){return A4(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};WB.prototype.fromText=function(e,t,n){return A4(void 0,e,t,n,this._cache)};var JZe=new z;function ZZe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,JZe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Mme(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var GB=new Array(4);function A4(e,t,n,i,r){GB[0]=e,GB[1]=t,GB[2]=n,GB[3]=i;let o=JSON.stringify(GB),s=r[o];if(u(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(ZZe(c,n,i),u(e)){let f=we.createIfNeeded(e).fetchImage().then(function(d){return Mme(c,d,i),r[o]=a,a});return r[o]=f,f}else if(u(t)){let l=qA(t,{font:`bold ${i}px sans-serif`});Mme(c,l,i)}return r[o]=a,a}var I_=WB;var Lme=Ki(Bme(),1);function C4(e){return m.fromDegrees(e[0],e[1],e[2])}var J7={"urn:ogc:def:crs:OGC:1.3:CRS84":C4,"EPSG:4326":C4,"urn:ogc:def:crs:EPSG::4326":C4},Nme={},Fme={},Z7=48,Q7,$7=z.ROYALBLUE,ej=z.YELLOW,tj=2,nj=z.fromBytes(255,255,0,100),ij=!1,QZe={small:24,medium:48,large:64},$Ze=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Ume(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||$Ze.indexOf(i)!==-1)continue;let r=e[i];u(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${Ume(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function eQe(e,t,n){let i;return function(r,o){return u(i)||(i=e(t,n)),i}}function tQe(e,t){return new gd(eQe(Ume,e,t),!0)}function T4(e,t,n){let i=e.id;if(!u(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;u(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(u(o)){r.properties=o;let s,a=o.title;if(u(a))r.name=a,s="title";else{let l=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(l>1&&d==="title"){l=1,s=f;break}else l>2&&d==="name"?(l=2,s=f):l>3&&/title/i.test(f)?(l=3,s=f):l>4&&/name/i.test(f)&&(l=4,s=f)}u(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=u(c)?new ei(c):n(o,s))}return r}function rj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Vme={Feature:zme,FeatureCollection:nQe,GeometryCollection:Hme,LineString:Yme,MultiLineString:Xme,MultiPoint:jme,MultiPolygon:Zme,Point:Wme,Polygon:Jme,Topology:Qme},kme={GeometryCollection:Hme,LineString:Yme,MultiLineString:Xme,MultiPoint:jme,MultiPolygon:Zme,Point:Wme,Polygon:Jme,Topology:Qme};function zme(e,t,n,i,r){if(t.geometry===null){T4(t,e._entityCollection,r.describe);return}if(!u(t.geometry))throw new de("feature.geometry is required.");let o=t.geometry.type,s=kme[o];if(!u(s))throw new de(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function nQe(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)zme(e,o[s],void 0,i,r)}function Hme(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],l=c.type,f=kme[l];if(!u(f))throw new de(`Unknown geometry type: ${l}`);f(e,t,c,i,r)}}function Gme(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(u(c)){let g=c["marker-color"];u(g)&&(s=z.fromCssColorString(g)),a=y(QZe[c["marker-size"]],a);let h=c["marker-symbol"];u(h)&&(o=h)}let l;u(o)?o.length===1?l=e._pinBuilder.fromText(o.toUpperCase(),s,a):l=e._pinBuilder.fromMakiIconId(o,s,a):l=e._pinBuilder.fromColor(s,a);let f=new ja;f.verticalOrigin=new ei(On.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=je.CLAMP_TO_GROUND);let d=T4(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Rc(n(i));let p=Promise.resolve(l).then(function(g){f.image=new ei(g)}).catch(function(){f.image=new ei(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Wme(e,t,n,i,r){Gme(e,t,i,n.coordinates,r)}function jme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Gme(e,t,i,o[s],r)}function qme(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(u(a)){let f=a["stroke-width"];u(f)&&(s=new ei(f));let d,p=a.stroke;u(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];u(g)&&g!==1&&(u(d)||(d=o.color.getValue().clone()),d.alpha=g),u(d)&&(o=new Vt(d))}let c=T4(t,e._entityCollection,r.describe),l=new Xa;c.polyline=l,l.clampToGround=r.clampToGround,l.material=o,l.width=s,l.positions=new ei(rj(i,n)),l.arcType=Jt.RHUMB}function Yme(e,t,n,i,r){qme(e,t,i,n.coordinates,r)}function Xme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)qme(e,t,i,o[s],r)}function Kme(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(u(c)){let g=c["stroke-width"];u(g)&&(a=new ei(g));let h,A=c.stroke;u(A)&&(h=z.fromCssColorString(A));let x=c["stroke-opacity"];u(x)&&x!==1&&(u(h)||(h=o.getValue().clone()),h.alpha=x),u(h)&&(o=new ei(h));let C,T=c.fill,E=s.color.getValue();u(T)&&(C=z.fromCssColorString(T),C.alpha=E.alpha),x=c["fill-opacity"],u(x)&&x!==E.alpha&&(u(C)||(C=E.clone()),C.alpha=x),u(C)&&(s=new Vt(C))}let l=new pd;l.outline=new ei(!0),l.outlineColor=o,l.outlineWidth=a,l.material=s,l.arcType=Jt.RHUMB;let f=[];for(let g=1,h=i.length;g<h;g++)f.push(new Bc(rj(i[g],n)));let d=i[0];l.hierarchy=new ei(new Bc(rj(d,n),f)),d[0].length>2?l.perPositionHeight=new ei(!0):r.clampToGround||(l.height=0);let p=T4(t,e._entityCollection,r.describe);p.polygon=l}function Jme(e,t,n,i,r){Kme(e,t,i,n.coordinates,r)}function Zme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Kme(e,t,i,o[s],r)}function Qme(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=Lme.feature(n,n.objects[o]),a=Vme[s.type];a(e,s,s,i,r)}}function My(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Ns(this),this._promises=[],this._pinBuilder=new I_,this._entityCluster=new du,this._credit=void 0,this._resourceCredits=[]}My.load=function(e,t){return new My().load(e,t)};Object.defineProperties(My,{markerSize:{get:function(){return Z7},set:function(e){Z7=e}},markerSymbol:{get:function(){return Q7},set:function(e){Q7=e}},markerColor:{get:function(){return $7},set:function(e){$7=e}},stroke:{get:function(){return ej},set:function(e){ej=e}},strokeWidth:{get:function(){return tj},set:function(e){tj=e}},fill:{get:function(){return nj},set:function(e){nj=e}},clampToGround:{get:function(){return ij},set:function(e){ij=e}},crsNames:{get:function(){return J7}},crsLinkHrefs:{get:function(){return Nme}},crsLinkTypes:{get:function(){return Fme}}});Object.defineProperties(My.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});My.prototype.load=function(e,t){return $me(this,e,t,!0)};My.prototype.process=function(e,t){return $me(this,e,t,!1)};function $me(e,t,n,i){Mo.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let r=n.credit;typeof r=="string"&&(r=new Dt(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),o=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(u(c)){let l=c.length;for(let f=0;f<l;f++)a.push(c[f])}}return n={describe:y(n.describe,tQe),markerSize:y(n.markerSize,Z7),markerSymbol:y(n.markerSymbol,Q7),markerColor:y(n.markerColor,$7),strokeWidthProperty:new ei(y(n.strokeWidth,tj)),strokeMaterialProperty:new Vt(y(n.stroke,ej)),fillMaterialProperty:new Vt(y(n.fill,nj)),clampToGround:y(n.clampToGround,ij)},Promise.resolve(o).then(function(a){return iQe(e,a,n,s,i)}).catch(function(a){throw Mo.setLoading(e,!1),e._error.raiseEvent(e,a),a})}My.prototype.update=function(e){return!0};function iQe(e,t,n,i,r){let o;u(i)&&(o=__(i)),u(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=Vme[t.type];if(!u(s))throw new de(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?C4:null;if(u(a)){if(!u(a.properties))throw new de("crs.properties is undefined.");let l=a.properties;if(a.type==="name"){if(c=J7[l.name],!u(c))throw new de(`Unknown crs name: ${l.name}`)}else if(a.type==="link"){let f=Nme[l.href];if(u(f)||(f=Fme[l.type]),!u(f))throw new de(`Unable to resolve crs link: ${JSON.stringify(l)}`);c=f(l)}else if(a.type==="EPSG"){if(c=J7[`EPSG:${l.code}`],!u(c))throw new de(`Unknown crs EPSG code: ${l.code}`)}else throw new de(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(l){return r&&e._entityCollection.removeAll(),l!==null&&s(e,t,t,l,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Mo.setLoading(e,!1),e})})}var jB=My;function rQe(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var In=rQe;var Phe=Ki(Sj(),1);var Ohe;typeof DOMParser<"u"&&(Ohe=new DOMParser);var _et=new Phe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),k4=32,The=2414016,Ehe=1,bhe=16093e3,She=.1,get=[null,void 0,"http://www.topografix.com/GPX/1/1"],Pr={gpx:get};function yet(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function vj(e,t){let n=KB(e,"id");return n=u(n)?n:jn(),t.getOrCreateEntity(n)}function wj(e){let t=vhe(e,"lon"),n=vhe(e,"lat"),i=YB(e,"ele",Pr.gpx);return m.fromDegrees(t,n,i)}function vhe(e,t){if(!u(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function KB(e,t){if(!u(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ny(e,t,n){if(!u(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Dj(e,t,n){if(!u(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function YB(e,t,n){let i=Ny(e,t,n);if(u(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ll(e,t,n){let i=Ny(e,t,n);if(u(i))return i.textContent.trim()}function Mhe(e){let t=new ja;return t.width=k4,t.height=k4,t.scaleByDistance=new Bt(The,Ehe,bhe,She),t.pixelOffsetScaleByDistance=new Bt(The,Ehe,bhe,She),t.verticalOrigin=new ei(On.BOTTOM),t.image=e,t}function Aet(){let e=new hd;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Hr.FILL_AND_OUTLINE,e}function Rhe(e){let t=new Xa;return t.width=4,t.material=new py,t.material.color=u(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var whe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},XB;typeof document<"u"&&(XB=document.createElement("div"));function Ij(e,t){let n,i="",r=Object.keys(whe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=whe[f];d.value=y(Ll(e,d.tag,Pr.gpx),""),u(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!u(i)||i==="")return;i=_et.link(i),XB.innerHTML=i;let s=XB.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,l='<div class="cesium-infoBox-description-lighter" style="';return l+="overflow:auto;",l+="word-wrap:break-word;",l+=`background-color:${a.toCssColorString()};`,l+=`color:${c.toCssColorString()};`,l+='">',l+=`${XB.innerHTML}</div>`,XB.innerHTML="",l}function Bhe(e,t,n,i){let r=wj(t),o=vj(t,n);o.position=r;let s=u(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,k4);o.billboard=Mhe(s);let a=Ll(t,"name",Pr.gpx);o.name=a,o.label=Aet(),o.label.text=a,o.description=Ij(t,o),i.clampToGround&&(o.billboard.heightReference=je.CLAMP_TO_GROUND,o.label.heightReference=je.CLAMP_TO_GROUND)}function xet(e,t,n,i){let r=vj(t,n);r.description=Ij(t,r);let o=Dj(t,"rtept",Pr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)Bhe(e,o[a],n,i),s[a]=wj(o[a]);r.polyline=Rhe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function Cet(e,t,n,i){let r=vj(t,n);r.description=Ij(t,r);let o=Dj(t,"trkseg",Pr.gpx),s=[],a=[],c,l=!0,f=new ra;for(let d=0;d<o.length;d++)c=Tet(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),l=l&&!0):l=!1;if(l){let d=u(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,k4);r.billboard=Mhe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=je.CLAMP_TO_GROUND),r.availability=new Oo,r.availability.addInterval(new Tn({start:a[0],stop:a[a.length-1]}))}r.polyline=Rhe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function Tet(e){let t={positions:[],times:[]},n=Dj(e,"trkpt",Pr.gpx),i;for(let r=0;r<n.length;r++){let o=wj(n[r]);t.positions.push(o),i=Ll(n[r],"time",Pr.gpx),u(i)&&t.times.push(ee.fromIso8601(i))}return t}function Eet(e){let t=Ny(e,"metadata",Pr.gpx);if(u(t)){let n={name:Ll(t,"name",Pr.gpx),desc:Ll(t,"desc",Pr.gpx),author:bet(t),copyright:wet(t),link:Lhe(t),time:Ll(t,"time",Pr.gpx),keywords:Ll(t,"keywords",Pr.gpx),bounds:Det(t)};if(u(n.name)||u(n.desc)||u(n.author)||u(n.copyright)||u(n.link)||u(n.time)||u(n.keywords)||u(n.bounds))return n}}function bet(e){let t=Ny(e,"author",Pr.gpx);if(u(t)){let n={name:Ll(t,"name",Pr.gpx),email:vet(t),link:Lhe(t)};if(u(n.name)||u(n.email)||u(n.link))return n}}function vet(e){let t=Ny(e,"email",Pr.gpx);if(u(t)){let n=Ll(t,"id",Pr.gpx),i=Ll(t,"domain",Pr.gpx);return`${n}@${i}`}}function Lhe(e){let t=Ny(e,"link",Pr.gpx);if(u(t)){let n={href:KB(t,"href"),text:Ll(t,"text",Pr.gpx),mimeType:Ll(t,"type",Pr.gpx)};if(u(n.href)||u(n.text)||u(n.mimeType))return n}}function wet(e){let t=Ny(e,"copyright",Pr.gpx);if(u(t)){let n={author:KB(t,"author"),year:Ll(t,"year",Pr.gpx),license:Ll(t,"license",Pr.gpx)};if(u(n.author)||u(n.year)||u(n.license))return n}}function Det(e){let t=Ny(e,"bounds",Pr.gpx);if(u(t)){let n={minLat:YB(t,"minlat",Pr.gpx),maxLat:YB(t,"maxlat",Pr.gpx),minLon:YB(t,"minlon",Pr.gpx),maxLon:YB(t,"maxlon",Pr.gpx)};if(u(n.minLat)||u(n.maxLat)||u(n.minLon)||u(n.maxLon))return n}}var Dhe={wpt:Bhe,rte:xet,trk:Cet};function Iet(e,t,n,i){let r=Object.keys(Dhe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Dhe[a],l=t.childNodes,f=l.length;for(let d=0;d<f;d++){let p=l[d];p.localName===a&&Pr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Ihe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=KB(r,"version"),s=KB(r,"creator"),a,c=Eet(r);u(c)&&(a=c.name),r.localName==="gpx"?Iet(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let l,f=i.computeAvailability(),d=f.start,p=f.stop,g=ee.equals(d,ze.MINIMUM_VALUE),h=ee.equals(p,ze.MAXIMUM_VALUE);if(!g||!h){let x;g&&(x=new Date,x.setHours(0,0,0,0),d=ee.fromDate(x)),h&&(x=new Date,x.setHours(24,0,0,0),p=ee.fromDate(x)),l=new Yd,l.startTime=d,l.stopTime=p,l.currentTime=ee.clone(d),l.clockRange=Bo.LOOP_STOP,l.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,l.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,d)/60,1),31556900))}let A=!1;return e._name!==a&&(e._name=a,A=!0),e._creator!==s&&(e._creator=s,A=!0),Pet(e._metadata,c)&&(e._metadata=c,A=!0),e._version!==o&&(e._version=o,A=!0),l!==e._clock&&(A=!0,e._clock=l),A&&e._changed.raiseEvent(e),Mo.setLoading(e,!1),e}function Pet(e,t){return!u(e)&&!u(t)?!1:u(e)&&u(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Oet(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(u(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?yet(o).then(function(s){let a,c;try{a=Ohe.parseFromString(s,"application/xml")}catch(l){c=l.toString()}if(u(c)||a.body||a.documentElement.tagName==="parsererror"){let l=u(c)?c:a.documentElement.firstChild.nodeValue;throw l||(l=a.body.innerText),new de(l)}return Ihe(e,a,i)}):Ihe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function Gb(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new Ns(this),this._entityCluster=new du,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new I_}Gb.load=function(e,t){return new Gb().load(e,t)};Object.defineProperties(Gb.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Gb.prototype.update=function(e){return!0};Gb.prototype.load=function(e,t){if(!u(e))throw new fe("data is required.");t=y(t,y.EMPTY_OBJECT),Mo.setLoading(this,!0);let n=this._name,i=this;return Oet(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,ze.MINIMUM_VALUE),l=ee.equals(a,ze.MAXIMUM_VALUE);if(!c||!l){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),l&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Yd,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=Bo.LOOP_STOP,r.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Mo.setLoading(i,!1),i}).catch(function(r){return Mo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var JB=Gb;function Met(e,t){this.position=e,this.headingPitchRoll=t}var ZB=Met;var npe=Ki(Sj(),1),iL=Ki(Yl(),1);function Ret(e,t){this.position=e,this.headingPitchRange=t}var QB=Ret;function z4(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}z4.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};z4.prototype.play=function(e,t){u(e.cesiumWidget)&&$("viewer","The viewer parameter has been deprecated in Cesium 1.99. It will be removed in 1.100. Instead of a Viewer, pass a CesiumWidget instead."),this.tourStart.raiseEvent();let n=this;Fhe.call(this,e,t,function(i){n.playlistIndex=0,i||Nhe(n._activeEntries),n.tourEnd.raiseEvent(i)})};z4.prototype.stop=function(){Nhe(this._activeEntries)};function Nhe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Fhe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=Bet.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else u(n)&&n(!1)}function Bet(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,Fhe.call(this,e,t,n)}}var $B=z4;var fr=Ki(Oj(),1),Net={LINEAR_NONE:fr.Easing.Linear.None,QUADRATIC_IN:fr.Easing.Quadratic.In,QUADRATIC_OUT:fr.Easing.Quadratic.Out,QUADRATIC_IN_OUT:fr.Easing.Quadratic.InOut,CUBIC_IN:fr.Easing.Cubic.In,CUBIC_OUT:fr.Easing.Cubic.Out,CUBIC_IN_OUT:fr.Easing.Cubic.InOut,QUARTIC_IN:fr.Easing.Quartic.In,QUARTIC_OUT:fr.Easing.Quartic.Out,QUARTIC_IN_OUT:fr.Easing.Quartic.InOut,QUINTIC_IN:fr.Easing.Quintic.In,QUINTIC_OUT:fr.Easing.Quintic.Out,QUINTIC_IN_OUT:fr.Easing.Quintic.InOut,SINUSOIDAL_IN:fr.Easing.Sinusoidal.In,SINUSOIDAL_OUT:fr.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:fr.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:fr.Easing.Exponential.In,EXPONENTIAL_OUT:fr.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:fr.Easing.Exponential.InOut,CIRCULAR_IN:fr.Easing.Circular.In,CIRCULAR_OUT:fr.Easing.Circular.Out,CIRCULAR_IN_OUT:fr.Easing.Circular.InOut,ELASTIC_IN:fr.Easing.Elastic.In,ELASTIC_OUT:fr.Easing.Elastic.Out,ELASTIC_IN_OUT:fr.Easing.Elastic.InOut,BACK_IN:fr.Easing.Back.In,BACK_OUT:fr.Easing.Back.Out,BACK_IN_OUT:fr.Easing.Back.InOut,BOUNCE_IN:fr.Easing.Bounce.In,BOUNCE_OUT:fr.Easing.Bounce.Out,BOUNCE_IN_OUT:fr.Easing.Bounce.InOut},Lo=Object.freeze(Net);function G4(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}G4.prototype.play=function(e,t,n){if(this.activeCamera=t,u(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(u(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ae(this.view.position);t.flyToBoundingSphere(r,i)}};G4.prototype.stop=function(){u(this.activeCamera)&&this.activeCamera.cancelFlight(),u(this.activeCallback)&&this.activeCallback(!0)};G4.prototype.getCameraOptions=function(e){let t={duration:this.duration};return u(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Lo.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),u(e)&&(t=_t(t,e)),t};var tL=G4;function Mj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Mj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Mj.prototype.stop=function(){clearTimeout(this.timeout),u(this.activeCallback)&&this.activeCallback(!0)};var nL=Mj;var ipe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=b0(t),ipe[t]}},Vj;typeof DOMParser<"u"&&(Vj=new DOMParser);var Fet=new npe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Uy=32,Yhe=2414016,Xhe=1,Khe=16093e3,Jhe=.1,Zhe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Qhe=["http://www.google.com/kml/ext/2.2"],Uet=["http://www.w3.org/2005/Atom"],Me={kml:Zhe,gx:Qhe,atom:Uet,kmlgx:Zhe.concat(Qhe)},kj={Document:mpe,Folder:itt,Placemark:rtt,NetworkLink:mtt,GroundOverlay:utt,PhotoOverlay:_pe,ScreenOverlay:ltt,Tour:stt};function bh(e){this._dataSource=e,this._deferred=Xs(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(bh.prototype,{dataSource:{get:function(){return this._dataSource}}});bh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};bh.prototype.addPromise=function(e){this._promises.push(e)};bh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};bh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Du._getTimestamp()),this._process(e)};bh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Du._getTimestamp(),e._process(!0)},0)};bh.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};bh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};bh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;u(i);){let r=kj[i.localName];if(u(r)&&(Me.kml.indexOf(i.namespaceURI)!==-1||Me.gx.indexOf(i.namespaceURI)!==-1)&&(r(t,i,n,this),this._timeoutSet||Du._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Vet(e){let t=e.slice(0,Math.min(4,e.size)),n=Xs(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function ket(e){let t=Xs(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function rpe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(u(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return u(n)&&(e=n+i),e}function ope(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}function zet(e,t){return Promise.resolve(e.getData(new t4)).then(function(n){n=rpe(n),n=ope(n),t.kml=Vj.parseFromString(n,"application/xml")})}function Rj(e,t){let n=y(ipe.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new n4(n))).then(function(i){t[e.filename]=i})}function vu(e,t,n,i){let r=i.keys,o=new iL.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],l=c.getAttribute(n);if(u(l)){let d=new iL.default(l).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function wu(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=zj(a,i);u(c)&&s.setAttribute(n,c.url)}}function spe(e,t,n){let i=hs(e,"id");i=u(i)&&i.length!==0?i:jn(),u(n)&&(i=n+i);let r=t.getById(i);return u(r)&&(i=jn(),u(n)&&(i=n+i)),r=t.add(new Jr({id:i})),u(r.kml)||(r.addProperty("kml"),r.kml=new gtt),r}function rL(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function Y4(e,t){if(!u(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!u(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,m.fromDegrees(i,r,o,t)}function W4(e,t){if(!u(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!u(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=Y4(n[s],t);return r}function Vy(e,t){if(!u(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function hs(e,t){if(!u(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Bi(e,t,n){if(!u(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function $he(e,t,n){if(!u(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function lm(e,t,n){if(!u(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ii(e,t,n){let i=Bi(e,t,n);if(u(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Pn(e,t,n){let i=Bi(e,t,n);if(u(i))return i.textContent.trim()}function um(e,t,n){let i=Bi(e,t,n);if(u(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function zj(e,t,n){if(!u(e))return;let i;if(u(n)){e=e.replace(/\\/g,"/");let r=n[e];if(u(r))i=new we({url:r});else{let o=new iL.default(t.getUrlComponent()),s=new iL.default(e);r=n[s.absoluteTo(o)],u(r)&&(i=new we({url:r}))}}return u(i)||(i=t.getDerivedResource({url:e})),i}var Nl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Fj(e,t){if(!u(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Nl.maximumRed=o,Nl.red=void 0):(Nl.maximumRed=void 0,Nl.red=0),r>0?(Nl.maximumGreen=r,Nl.green=void 0):(Nl.maximumGreen=void 0,Nl.green=0),i>0?(Nl.maximumBlue=i,Nl.blue=void 0):(Nl.maximumBlue=void 0,Nl.blue=0),Nl.alpha=n,z.fromRandom(Nl)):new z(o,r,i,n)}function Yx(e,t,n){let i=Pn(e,t,n);if(u(i))return Fj(i,Pn(e,"colorMode",n)==="random")}function Het(e){let t=Bi(e,"TimeStamp",Me.kmlgx),n=Pn(t,"when",Me.kmlgx);if(!u(t)||!u(n)||n.length===0)return;let i=ee.fromIso8601(n),r=new Oo;return r.addInterval(new Tn({start:i,stop:ze.MAXIMUM_VALUE})),r}function Get(e){let t=Bi(e,"TimeSpan",Me.kmlgx);if(!u(t))return;let n,i=Bi(t,"begin",Me.kmlgx),r=u(i)?ee.fromIso8601(i.textContent):void 0,o=Bi(t,"end",Me.kmlgx),s=u(o)?ee.fromIso8601(o.textContent):void 0;if(u(r)&&u(s)){if(ee.lessThan(s,r)){let a=r;r=s,s=a}n=new Oo,n.addInterval(new Tn({start:r,stop:s}))}else u(r)?(n=new Oo,n.addInterval(new Tn({start:r,stop:ze.MAXIMUM_VALUE}))):u(s)&&(n=new Oo,n.addInterval(new Tn({start:ze.MINIMUM_VALUE,stop:s})));return n}function ape(){let e=new ja;return e.width=Uy,e.height=Uy,e.scaleByDistance=new Bt(Yhe,Xhe,Khe,Jhe),e.pixelOffsetScaleByDistance=new Bt(Yhe,Xhe,Khe,Jhe),e}function Hj(){let e=new pd;return e.outline=!0,e.outlineColor=z.WHITE,e}function cpe(){let e=new hd;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Hr.FILL_AND_OUTLINE,e}function Gj(e,t,n,i,r){let o=Pn(e,"href",Me.kml);if(!u(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=y(ii(e,"x",Me.gx),0),l=y(ii(e,"y",Me.gx),0);c=Math.min(c/32,7),l=7-Math.min(l/32,7);let f=8*l+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=zj(o,n,i);if(r){let a=Pn(e,"refreshMode",Me.kml),c=Pn(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?Ot(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Ot(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let l=y(Pn(e,"viewBoundScale",Me.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Pn(e,"viewFormat",Me.kml),f),p=Pn(e,"httpQuery",Me.kml);u(d)&&s.setQueryParameters(Xl(q4(d))),u(p)&&s.setQueryParameters(Xl(q4(p)));let g=t._ellipsoid;return jj(s,t.camera,t.canvas,l,t._lastCameraView.bbox,g),s}return s}function Wet(e,t,n,i,r){let o=ii(t,"scale",Me.kml),s=ii(t,"heading",Me.kml),a=Yx(t,"color",Me.kml),c=Bi(t,"Icon",Me.kml),l=Gj(c,e,i,r,!1);u(c)&&!u(l)&&(l=!1);let f=ii(c,"x",Me.gx),d=ii(c,"y",Me.gx),p=ii(c,"w",Me.gx),g=ii(c,"h",Me.gx),h=Bi(t,"hotSpot",Me.kml),A=Vy(h,"x"),x=Vy(h,"y"),C=hs(h,"xunits"),T=hs(h,"yunits"),E=n.billboard;u(E)||(E=ape(),n.billboard=E),E.image=l,E.scale=o,E.color=a,(u(f)||u(d)||u(p)||u(g))&&(E.imageSubRegion=new Ye(f,d,p,g)),u(s)&&s!==0&&(E.rotation=P.toRadians(-s),E.alignedAxis=m.UNIT_Z),o=y(o,1);let S,w;u(A)&&(C==="pixels"?S=-A*o:C==="insetPixels"?S=(A-Uy)*o:C==="fraction"&&(S=-A*Uy*o),S+=Uy*.5*o),u(x)&&(T==="pixels"?w=x*o:T==="insetPixels"?w=(-x+Uy)*o:T==="fraction"&&(w=x*Uy*o),w-=Uy*.5*o),(u(S)||u(w))&&(E.pixelOffset=new H(S,w))}function j4(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")Wet(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;u(c)||(c=cpe(),n.label=c),c.scale=y(ii(a,"scale",Me.kml),c.scale),c.fillColor=y(Yx(a,"color",Me.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;u(c)||(c=new Xa,n.polyline=c),c.width=ii(a,"width",Me.kml),c.material=Yx(a,"color",Me.kml),u(Yx(a,"outerColor",Me.gx))&&Ot("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),u(ii(a,"outerWidth",Me.gx))&&Ot("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),u(ii(a,"physicalWidth",Me.gx))&&Ot("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),u(um(a,"labelVisibility",Me.gx))&&Ot("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;u(c)||(c=Hj(),n.polygon=c),c.material=y(Yx(a,"color",Me.kml),c.material),c.fill=y(um(a,"fill",Me.kml),c.fill),c.outline=y(um(a,"outline",Me.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(Fj(Pn(a,"bgColor",Me.kml)),z.WHITE),l=y(Fj(Pn(a,"textColor",Me.kml)),z.BLACK),f=Pn(a,"text",Me.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:l,text:f}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",Me.kml);(c==="radioFolder"||c==="checkOffOnly")&&Ot(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function jet(e,t,n,i,r){let o=new Jr,s,a=-1,c=t.childNodes,l=c.length;for(let d=0;d<l;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")j4(e,d,o,i,r);else{let p=lm(d,"Pair",Me.kml);for(let g=0;g<p.length;g++){let h=p[g],A=Pn(h,"key",Me.kml);if(A==="normal"){let x=Pn(h,"styleUrl",Me.kml);if(u(x))s=n.getById(x),u(s)||(s=n.getById(`#${x}`)),u(s)&&o.merge(s);else{let C=Bi(h,"Style",Me.kml);j4(e,C,o,i,r)}}else Ot(`kml-styleMap-${A}`,`KML - Unsupported StyleMap key: ${A}`)}}}let f=Pn(t,"styleUrl",Me.kml);if(u(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),u(s)||(s=n.getById(`#${d}`)),u(s)&&o.merge(s)}return o}function qet(e,t,n){return t.fetchXML().then(function(i){return lpe(e,i,n,t,!0)})}function lpe(e,t,n,i,r,o){let s,a,c,l,f=$he(t,"Style",Me.kml);if(u(f)){let A=f.length;for(s=0;s<A;s++)l=f[s],a=hs(l,"id"),u(a)&&(a=`#${a}`,r&&u(i)&&(a=i.getUrlComponent()+a),u(n.getById(a))||(c=new Jr({id:a}),n.add(c),j4(e,l,c,i,o)))}let d=$he(t,"StyleMap",Me.kml);if(u(d)){let A=d.length;for(s=0;s<A;s++){let x=d[s];if(a=hs(x,"id"),u(a)){let C=lm(x,"Pair",Me.kml);for(let T=0;T<C.length;T++){let E=C[T],S=Pn(E,"key",Me.kml);if(S==="normal"){if(a=`#${a}`,r&&u(i)&&(a=i.getUrlComponent()+a),!u(n.getById(a))){c=n.getOrCreateEntity(a);let w=Pn(E,"styleUrl",Me.kml);if(u(w)){w[0]!=="#"&&(w=`#${w}`),r&&u(i)&&(w=i.getUrlComponent()+w);let D=n.getById(w);u(D)&&c.merge(D)}else l=Bi(E,"Style",Me.kml),j4(e,l,c,i,o)}}else Ot(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),h=g.length;for(s=0;s<h;s++){let A=g[s].textContent;if(A[0]!=="#"){let x=A.split("#");if(x.length===2){let C=x[0],T=i.getDerivedResource({url:C});p.push(qet(e,T,n))}}}return p}function Wj(e,t,n){let i=new A_(e,t.id,["position"]),r=new ph(t.position);t.polyline=u(n.polyline)?n.polyline.clone():new Xa,t.polyline.positions=new y_([i,r])}function upe(e,t){return!u(e)&&!u(t)||e==="clampToGround"?je.CLAMP_TO_GROUND:e==="relativeToGround"?je.RELATIVE_TO_GROUND:e==="absolute"?je.NONE:t==="clampToSeaFloor"?(Ot("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),je.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Ot("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),je.RELATIVE_TO_GROUND):(u(e)?Ot("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Ot("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),je.CLAMP_TO_GROUND)}function Yet(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((u(t)&&t!=="clampToGround"||u(n)&&n!=="clampToSeaFloor")&&Ot("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new ph(e))}function Xet(e,t,n,i){if(!u(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(u(t)&&t!=="clampToGround"||u(n)&&n!=="clampToSeaFloor")&&Ot("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function X4(e,t,n,i){let r=t.label;u(r)||(r=u(n.label)?n.label.clone():cpe(),t.label=r),r.text=t.name;let o=t.billboard;u(o)||(o=u(n.billboard)?n.billboard.clone():ape(),t.billboard=o),u(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;u(o.scale)&&(s=o.scale.getValue(),s!==0?r.pixelOffset=new H(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)),u(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function fpe(e,t){let n=e.path;u(n)||(n=new gp,n.leadTime=0,e.path=n);let i=t.polyline;u(i)&&(n.material=i.material,n.width=i.width)}function Ket(e,t,n,i,r){let o=Pn(n,"coordinates",Me.kml),s=Pn(n,"altitudeMode",Me.kml),a=Pn(n,"altitudeMode",Me.gx),c=um(n,"extrude",Me.kml),l=e._ellipsoid,f=Y4(o,l);return i.position=f,X4(e,i,r,upe(s,a)),c&&rL(s,a)&&Wj(t,i,r),!0}function epe(e,t,n,i,r){let o=Bi(n,"coordinates",Me.kml),s=Pn(n,"altitudeMode",Me.kml),a=Pn(n,"altitudeMode",Me.gx),c=um(n,"extrude",Me.kml),l=um(n,"tessellate",Me.kml),f=rL(s,a),d=ii(n,"drawOrder",Me.gx),p=e._ellipsoid,g=W4(o,p),h=r.polyline;if(f&&c){let A=new yp;i.wall=A,A.positions=g;let x=r.polygon;u(x)&&(A.fill=x.fill,A.material=x.material),A.outline=!0,u(h)?(A.outlineColor=u(h.material)?h.material.color:z.WHITE,A.outlineWidth=h.width):u(x)&&(A.outlineColor=u(x.material)?x.material.color:z.WHITE)}else if(e._clampToGround&&!f&&l){let A=new Xa;A.clampToGround=!0,i.polyline=A,A.positions=g,u(h)?(A.material=u(h.material)?h.material.color.getValue(ze.MINIMUM_VALUE):z.WHITE,A.width=y(h.width,1)):(A.material=z.WHITE,A.width=1),A.zIndex=d}else u(d)&&Ot("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!l&&Ot("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=u(h)?h.clone():new Xa,i.polyline=h,h.positions=Xet(g,s,a,p),(!l||f)&&(h.arcType=Jt.NONE);return!0}function Jet(e,t,n,i,r){let o=Bi(n,"outerBoundaryIs",Me.kml),s=Bi(o,"LinearRing",Me.kml),a=Bi(s,"coordinates",Me.kml),c=e._ellipsoid,l=W4(a,c),f=um(n,"extrude",Me.kml),d=Pn(n,"altitudeMode",Me.kml),p=Pn(n,"altitudeMode",Me.gx),g=rL(d,p),h=u(r.polygon)?r.polygon.clone():Hj(),A=r.polyline;if(u(A)&&(h.outlineColor=u(A.material)?A.material.color:z.WHITE,h.outlineWidth=A.width),i.polygon=h,g?(h.perPositionHeight=!0,h.extrudedHeight=f?0:void 0):e._clampToGround||(h.height=0),u(l)){let x=new Bc(l),C=lm(n,"innerBoundaryIs",Me.kml);for(let T=0;T<C.length;T++){s=lm(C[T],"LinearRing",Me.kml);for(let E=0;E<s.length;E++)a=Bi(s[E],"coordinates",Me.kml),l=W4(a,c),u(l)&&x.holes.push(new Bc(l))}h.hierarchy=x}return!0}function Zet(e,t,n,i,r){let o=Pn(n,"altitudeMode",Me.kml),s=Pn(n,"altitudeMode",Me.gx),a=lm(n,"coord",Me.gx),c=lm(n,"angles",Me.gx),l=lm(n,"when",Me.kml),f=um(n,"extrude",Me.kml),d=rL(o,s),p=e._ellipsoid;c.length>0&&Ot("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,l.length),h=[],A=[];for(let C=0;C<g;C++){let T=Y4(a[C].textContent,p);h.push(T),A.push(ee.fromIso8601(l[C].textContent))}let x=new ra;return x.addSamples(A,h),i.position=x,X4(e,i,r,upe(o,s)),fpe(i,r),i.availability=new Oo,l.length>0&&i.availability.addInterval(new Tn({start:A[0],stop:A[A.length-1]})),d&&f&&Wj(t,i,r),!0}function tpe(e,t,n,i,r,o,s,a,c){let l=e[0],f=e[e.length-1],d=new ra;d.addSamples(e,t),n.intervals.addInterval(new Tn({start:l,stop:f,isStartIncluded:c,isStopIncluded:c,data:Yet(d,s,a)})),i.addInterval(new Tn({start:l,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Tn({start:l,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function Qet(e,t,n,i,r){let o=um(n,"interpolate",Me.gx),s=lm(n,"Track",Me.gx),a,c,l,f=!1,d=new C_,p=new Oo,g=new na,h=e._ellipsoid;for(let A=0,x=s.length;A<x;A++){let C=s[A],T=lm(C,"when",Me.kml),E=lm(C,"coord",Me.gx),S=Pn(C,"altitudeMode",Me.kml),w=Pn(C,"altitudeMode",Me.gx),D=rL(S,w),M=um(C,"extrude",Me.kml),O=Math.min(E.length,T.length),B=[];a=[];for(let L=0;L<O;L++){let _=Y4(E[L].textContent,h);B.push(_),a.push(ee.fromIso8601(T[L].textContent))}o&&(u(c)&&tpe([c,a[0]],[l,B[0]],g,p,d,!1,"absolute",void 0,!1),c=a[O-1],l=B[B.length-1]),tpe(a,B,g,p,d,D&&M,S,w,!0),f=f||D&&M}return i.availability=p,i.position=g,X4(e,i,r),fpe(i,r),f&&(Wj(t,i,r),i.polyline.show=d),!0}var dpe={Point:Ket,LineString:epe,LinearRing:epe,Polygon:Jet,Track:Zet,MultiTrack:Qet,MultiGeometry:$et,Model:ett};function $et(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,l=s.length;c<l;c++){let f=s.item(c),d=dpe[f.localName];if(u(d)){let p=spe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function ett(e,t,n,i,r){return Ot("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function ttt(e,t){let n=Bi(e,"ExtendedData",Me.kml);if(!u(n))return;u(Bi(n,"SchemaData",Me.kml))&&Ot("kml-schemaData","KML - SchemaData is unsupported"),u(hs(n,"xmlns:prefix"))&&Ot("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=lm(n,"Data",Me.kml);if(u(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=hs(a,"name");u(c)&&(i[c]={displayName:Pn(a,"displayName",Me.kml),value:Pn(a,"value",Me.kml)})}}t.kml.extendedData=i}var xr;typeof document<"u"&&(xr=document.createElement("div"));function ntt(e,t,n,i,r){let o,s,a,c=t.kml,l=c.extendedData,f=Pn(e,"description",Me.kml),d=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,g=z.BLACK,h=f;u(d)&&(p=y(d.bgColor,z.WHITE),g=y(d.textColor,z.BLACK),h=y(d.text,f));let A;if(u(h)){if(h=h.replace("$[name]",y(t.name,"")),h=h.replace("$[description]",y(f,"")),h=h.replace("$[address]",y(c.address,"")),h=h.replace("$[Snippet]",y(c.snippet,"")),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),u(l)){let T=h.match(/\$\[.+?\]/g);if(T!==null)for(o=0;o<T.length;o++){let E=T[o],S=E.substr(2,E.length-3),w=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),A=l[S],u(A)&&(A=w?A.displayName:A.value),u(A)&&(h=h.replace(E,y(A,"")))}}}else if(u(l)&&(a=Object.keys(l),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],A=l[s],h+=`<tr><th>${y(A.displayName,s)}</th><td>${y(A.value,"")}</td></tr>`;h+="</tbody></table>"}if(!u(h))return;h=Fet.link(h),xr.innerHTML=h;let x=xr.querySelectorAll("a");for(o=0;o<x.length;o++)x[o].setAttribute("target","_blank");u(i)&&i.keys.length>1&&(vu(xr,"a","href",i),vu(xr,"link","href",i),vu(xr,"area","href",i),vu(xr,"img","src",i),vu(xr,"iframe","src",i),vu(xr,"video","src",i),vu(xr,"audio","src",i),vu(xr,"source","src",i),vu(xr,"track","src",i),vu(xr,"input","src",i),vu(xr,"embed","src",i),vu(xr,"script","src",i),vu(xr,"video","poster",i)),wu(xr,"a","href",r),wu(xr,"link","href",r),wu(xr,"area","href",r),wu(xr,"img","src",r),wu(xr,"iframe","src",r),wu(xr,"video","src",r),wu(xr,"audio","src",r),wu(xr,"source","src",r),wu(xr,"track","src",r),wu(xr,"input","src",r),wu(xr,"embed","src",r),wu(xr,"script","src",r),wu(xr,"video","poster",r);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${xr.innerHTML}</div>`,xr.innerHTML="",t.description=C}function K4(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=spe(t,i,n.context),c=a.kml,l=jet(e,t,n.styleCollection,o,s),f=Pn(t,"name",Me.kml);a.name=f,a.parent=r;let d=Get(t);u(d)||(d=Het(t)),a.availability=d,Yj(a);function p(E){return E?E.show&&p(E.parent):!0}let g=um(t,"visibility",Me.kml);a.show=p(r)&&y(g,!0);let h=Bi(t,"author",Me.atom),A=c.author;A.name=Pn(h,"name",Me.atom),A.uri=Pn(h,"uri",Me.atom),A.email=Pn(h,"email",Me.atom);let x=Bi(t,"link",Me.atom),C=c.link;C.href=hs(x,"href"),C.hreflang=hs(x,"hreflang"),C.rel=hs(x,"rel"),C.type=hs(x,"type"),C.title=hs(x,"title"),C.length=hs(x,"length"),c.address=Pn(t,"address",Me.kml),c.phoneNumber=Pn(t,"phoneNumber",Me.kml),c.snippet=Pn(t,"Snippet",Me.kml),ttt(t,a),ntt(t,a,l,s,o);let T=e._ellipsoid;return ppe(t,a,T),hpe(t,a,T),u(Bi(t,"Region",Me.kml))&&Ot("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:l}}function mpe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function itt(e,t,n,i){let r=K4(e,t,n),o=We(n);o.parentEntity=r.entity,mpe(e,t,o,i)}function rtt(e,t,n,i){let r=K4(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let l=0,f=c.length;l<f&&!a;l++){let d=c.item(l),p=dpe[d.localName];u(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),X4(e,o,s))}var ott={FlyTo:ctt,Wait:att,SoundCue:Bj,AnimatedUpdate:Bj,TourControl:Bj};function stt(e,t,n,i){let r=Pn(t,"name",Me.kml),o=hs(t,"id"),s=new $B(r,o),a=Bi(t,"Playlist",Me.gx);if(a){let c=e._ellipsoid,l=a.childNodes;for(let f=0;f<l.length;f++){let d=l[f];if(d.localName){let p=ott[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function Bj(e,t){Ot(`KML Tour unsupported node ${t.localName}`)}function att(e,t){let n=ii(t,"duration",Me.gx);e.addPlaylistEntry(new nL(n))}function ctt(e,t,n){let i=ii(t,"duration",Me.gx),r=Pn(t,"flyToMode",Me.gx),o={kml:{}};ppe(t,o,n),hpe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new tL(i,r,s);e.addPlaylistEntry(a)}function hpe(e,t,n){let i=Bi(e,"Camera",Me.kml);if(u(i)){let r=y(ii(i,"longitude",Me.kml),0),o=y(ii(i,"latitude",Me.kml),0),s=y(ii(i,"altitude",Me.kml),0),a=y(ii(i,"heading",Me.kml),0),c=y(ii(i,"tilt",Me.kml),0),l=y(ii(i,"roll",Me.kml),0),f=m.fromDegrees(r,o,s,n),d=Ha.fromDegrees(a,c-90,l);t.kml.camera=new ZB(f,d)}}function ppe(e,t,n){let i=Bi(e,"LookAt",Me.kml);if(u(i)){let r=y(ii(i,"longitude",Me.kml),0),o=y(ii(i,"latitude",Me.kml),0),s=y(ii(i,"altitude",Me.kml),0),a=ii(i,"heading",Me.kml),c=ii(i,"tilt",Me.kml),l=y(ii(i,"range",Me.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new Cu(a,c-P.PI_OVER_TWO,l),d=m.fromDegrees(r,o,s,n);t.kml.lookAt=new QB(d,f)}}function ltt(e,t,n,i){let r=n.screenOverlayContainer;if(!u(r))return;let o=n.sourceResource,s=n.uriResolver,a=Bi(t,"Icon",Me.kml),c=Gj(a,e,o,s,!1);if(!u(c))return;let l=document.createElement("img");e._screenOverlays.push(l),l.src=c.url,l.onload=function(){let f=["position: absolute"],d=Bi(t,"screenXY",Me.kml),p=Bi(t,"overlayXY",Me.kml),g=Bi(t,"size",Me.kml),h,A,x,C,T,E;u(g)&&(h=Vy(g,"x"),A=Vy(g,"y"),x=hs(g,"xunits"),C=hs(g,"yunits"),u(h)&&h!==-1&&h!==0&&(x==="fraction"?T=`width: ${Math.floor(h*100)}%`:x==="pixels"&&(T=`width: ${h}px`),f.push(T)),u(A)&&A!==-1&&A!==0&&(C==="fraction"?E=`height: ${Math.floor(A*100)}%`:C==="pixels"&&(E=`height: ${A}px`),f.push(E))),l.style=f.join(";");let S=0,w=l.height;u(p)&&(h=Vy(p,"x"),A=Vy(p,"y"),x=hs(p,"xunits"),C=hs(p,"yunits"),u(h)&&(x==="fraction"?S=h*l.width:(x==="pixels"||x==="insetPixels")&&(S=h)),u(A)&&(C==="fraction"?w=A*l.height:(C==="pixels"||C==="insetPixels")&&(w=A))),u(d)&&(h=Vy(d,"x"),A=Vy(d,"y"),x=hs(d,"xunits"),C=hs(d,"yunits"),u(h)&&(x==="fraction"?T=`left: calc(${Math.floor(h*100)}% - ${S}px)`:x==="pixels"?T=`left: ${h-S}px`:x==="insetPixels"&&(T=`right: ${h-S}px`),f.push(T)),u(A)&&(C==="fraction"?E=`bottom: calc(${Math.floor(A*100)}% - ${w}px)`:C==="pixels"?E=`bottom: ${A-w}px`:C==="insetPixels"&&(E=`top: ${A-w}px`),f.push(E))),l.style=f.join(";")},r.appendChild(l)}function utt(e,t,n,i){let o=K4(e,t,n).entity,s,a=!1,c=e._ellipsoid,l=W4(Bi(t,"LatLonQuad",Me.gx),c),f=ii(t,"drawOrder",Me.kml);if(u(l))s=Hj(),s.hierarchy=new Bc(l),s.zIndex=f,o.polygon=s,a=!0;else{s=new _d,s.zIndex=f,o.rectangle=s;let h=Bi(t,"LatLonBox",Me.kml);if(u(h)){let A=ii(h,"west",Me.kml),x=ii(h,"south",Me.kml),C=ii(h,"east",Me.kml),T=ii(h,"north",Me.kml);u(A)&&(A=P.negativePiToPi(P.toRadians(A))),u(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),u(C)&&(C=P.negativePiToPi(P.toRadians(C))),u(T)&&(T=P.clampToLatitudeRange(P.toRadians(T))),s.coordinates=new ce(A,x,C,T);let E=ii(h,"rotation",Me.kml);if(u(E)){let S=P.toRadians(E);s.rotation=S,s.stRotation=S}}}let d=Bi(t,"Icon",Me.kml),p=Gj(d,e,n.sourceResource,n.uriResolver,!0);if(u(p)){a&&Ot("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ii(d,"x",Me.gx),A=ii(d,"y",Me.gx),x=ii(d,"w",Me.gx),C=ii(d,"h",Me.gx);(u(h)||u(A)||u(x)||u(C))&&Ot("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=Yx(t,"color",Me.kml),s.material.transparent=!0}else s.material=Yx(t,"color",Me.kml);let g=Pn(t,"altitudeMode",Me.kml);u(g)?g==="absolute"?(s.height=ii(t,"altitude",Me.kml),s.zIndex=void 0):g!=="clampToGround"&&Ot("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Pn(t,"altitudeMode",Me.gx),g==="relativeToSeaFloor"?(Ot("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ii(t,"altitude",Me.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Ot("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):u(g)&&Ot("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function _pe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Ot(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var ky={INTERVAL:0,EXPIRE:1,STOP:2};function q4(e){if(!u(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var ftt=new ce,jb=new he,Lj=new H,dtt=new m;function jj(e,t,n,i,r,o){function s(l){return l<-P.PI_OVER_TWO?-P.PI_OVER_TWO:l>P.PI_OVER_TWO?P.PI_OVER_TWO:l}function a(l){return l>P.PI?l-P.TWO_PI:l<-P.PI?l+P.TWO_PI:l}let c=D0(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),u(t)&&t._mode!==ne.MORPHING){let l,f;if(r=y(r,ftt),u(n)&&(Lj.x=n.clientWidth*.5,Lj.y=n.clientHeight*.5,l=t.pickEllipsoid(Lj,o,dtt)),u(l)?f=o.cartesianToCartographic(l,jb):(f=ce.center(r,jb),l=o.cartographicToCartesian(f)),u(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let C=r.width*i*.5,T=r.height*i*.5;r=new ce(a(f.longitude-C),s(f.latitude-T),a(f.longitude+C),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,l)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,jb),c=c.replace("[cameraLon]",P.toDegrees(jb.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(jb.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(jb.height).toString());let g=t.frustum,h=g.aspectRatio,A="",x="";if(u(h)){let C=P.toDegrees(g.fov);h>1?(A=C,x=C/h):(x=C,A=C*h)}c=c.replace("[horizFov]",A.toString()),c=c.replace("[vertFov]",x.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");u(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Xl(c))}function mtt(e,t,n,i){let o=K4(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Bi(t,"Link",Me.kml);if(u(c)||(c=Bi(t,"Url",Me.kml)),u(c)){let l=Pn(c,"href",Me.kml),f,d;if(u(l)){let p=l;if(l=zj(l,s,n.uriResolver),/^data:/.test(l.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=l.clone(),f=Pn(c,"viewRefreshMode",Me.kml),f==="onRegion"){Ot("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Pn(c,"viewBoundScale",Me.kml),1);let x=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Pn(c,"viewFormat",Me.kml),x),T=Pn(c,"httpQuery",Me.kml);u(C)&&l.setQueryParameters(Xl(q4(C))),u(T)&&l.setQueryParameters(Xl(q4(T)));let E=e._ellipsoid;jj(l,e.camera,e.canvas,d,e._lastCameraView.bbox,E)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},h=new Ns,A=qj(e,h,l,g).then(function(x){let C=e._entityCollection,T=h.values;C.suspendEvents();for(let w=0;w<T.length;w++){let D=T[w];u(D.parent)||(D.parent=o,Yj(D)),C.add(D)}C.resumeEvents();let E=Pn(c,"refreshMode",Me.kml),S=y(ii(c,"refreshInterval",Me.kml),0);if(E==="onInterval"&&S>0||E==="onExpire"||f==="onStop"){let w=Bi(x,"NetworkLinkControl",Me.kml),D=u(w),M=ee.now(),O={id:jn(),href:l,cookie:{},lastUpdated:M,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:M},B=0;if(D&&(O.cookie=Xl(y(Pn(w,"cookie",Me.kml),"")),B=y(ii(w,"minRefreshPeriod",Me.kml),0)),E==="onInterval")D&&(S=Math.max(B,S)),O.refreshMode=ky.INTERVAL,O.time=S;else if(E==="onExpire"){let L;if(D&&(L=Pn(w,"expires",Me.kml)),u(L))try{let _=ee.fromIso8601(L),b=ee.secondsDifference(_,M);b>0&&b<B&&ee.addSeconds(M,B,_),O.refreshMode=ky.EXPIRE,O.time=_}catch{Ot("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Ot("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else u(e.camera)?(O.refreshMode=ky.STOP,O.time=y(ii(c,"viewRefreshTime",Me.kml),0)):Ot("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");u(O.refreshMode)&&e._networkLinks.set(O.id,O)}}).catch(function(x){Ot(`An error occured during loading ${l.url}`),e._error.raiseEvent(e,x)});i.addPromise(A)}}}function htt(e,t,n,i){let r=kj[t.localName];return u(r)?r(e,t,n,i):_pe(e,t,n,i)}function Uj(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Bi(a,"Document",Me.kml),l=Pn(c,"name",Me.kml);u(l)||(l=__(i.getUrlComponent())),u(e._name)||(e._name=l);let f=new Du._DeferredLoading(e),d=new Ns(e);return Promise.all(lpe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let A=0;A<h.length;A++){let x=h[A];if(u(kj[x.localName])){p=x;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),htt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function ptt(e,t,n,i,r){let o=en("ThirdParty/Workers/z-worker-pako.js");Pb({workerScripts:{deflate:[o,"./pako_deflate.min.js"],inflate:[o,"./pako_inflate.min.js"]}});let s=new d4(new Fx(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],l={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!u(f)||!/\//i.test(p.filename))?(u(f)&&c.push(Rj(f,l)),f=p):c.push(Rj(p,l)))}return u(f)&&c.push(zet(f,l)),Promise.all(c).then(function(){if(s.close(),!u(l.kml))throw new de("KMZ file does not contain a KML document.");return l.keys=Object.keys(l),Uj(e,t,l.kml,i,l,r)})})}function qj(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),c=n.fetchBlob(),r=y(r,n.clone());let l=e._resourceCredits,f=n.credits;if(u(f)){let d=f.length;for(let p=0;p<d;p++)l.push(f[p])}}else r=y(r,we.DEFAULT.clone());return r=we.createIfNeeded(r),u(a)&&(a=In(a)),Promise.resolve(c).then(function(l){return l instanceof Blob?Vet(l).then(function(f){return f?ptt(e,t,l,r,a):ket(l).then(function(d){d=rpe(d),d=ope(d);let p,g;try{p=Vj.parseFromString(d,"application/xml")}catch(h){g=h.toString()}if(u(g)||p.body||p.documentElement.tagName==="parsererror"){let h=u(g)?g:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new de(h)}return Uj(e,t,p,r,o,a,s)})}):Uj(e,t,l,r,o,a,s)}).catch(function(l){return e._error.raiseEvent(e,l),console.log(l),Promise.reject(l)})}function Du(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new Ns(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new I_,this._networkLinks=new Tt,this._entityCluster=new du,this.canvas=n,this.camera=t,this._lastCameraView={position:u(t)?m.clone(t.positionWC):void 0,direction:u(t)?m.clone(t.directionWC):void 0,up:u(t)?m.clone(t.upWC):void 0,bbox:u(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,re.WGS84);let i=e.credit;typeof i=="string"&&(i=new Dt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Du.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Du(t).load(e,t)};Object.defineProperties(Du.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Du.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Mo.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return qj(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,ze.MINIMUM_VALUE),l=ee.equals(a,ze.MAXIMUM_VALUE);if(!c||!l){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),l&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Yd,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=Bo.LOOP_STOP,r.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Mo.setLoading(i,!1),i}).catch(function(r){return Mo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};Du.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function Yj(e){let t=e.parent;if(u(t)){let n=t.availability;if(u(n)){let i=e.availability;u(i)?i.intersect(n):e.availability=n}}}function _tt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Bi(o,"NetworkLinkControl",Me.kml),c=u(a),l=0;if(c){if(u(Bi(a,"Update",Me.kml))){Ot("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Xl(y(Pn(a,"cookie",Me.kml),"")),l=y(ii(a,"minRefreshPeriod",Me.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===ky.INTERVAL)u(a)&&(t.time=Math.max(l,t.time));else if(d===ky.EXPIRE){let M;if(u(a)&&(M=Pn(a,"expires",Me.kml)),u(M))try{let O=ee.fromIso8601(M),B=ee.secondsDifference(O,f);B>0&&B<l&&ee.addSeconds(f,l,O),t.time=O}catch{Ot("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Ot("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,h=n.values;function A(M){g.remove(M);let O=M._children,B=O.length;for(let L=0;L<B;++L)A(O[L])}g.suspendEvents();let x=g.values.slice(),C;for(C=0;C<x.length;++C){let M=x[C];M.parent===p&&(M.parent=void 0,A(M))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<h.length;C++){let M=h[C];u(M.parent)||(M.parent=p,Yj(M)),g.add(M)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let T=g.computeAvailability(),E=T.start,S=T.stop,w=ee.equals(E,ze.MINIMUM_VALUE),D=ee.equals(S,ze.MAXIMUM_VALUE);if(!w||!D){let M=e._clock;(M.startTime!==E||M.stopTime!==S)&&(M.startTime=E,M.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Nj=new Tt;Du.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;Nj.removeAll();function r(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let h=d[g];Nj.set(h.id,h),r(h)}}let o=!1,s=this._lastCameraView,a=this.camera;u(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),o=!0);let c=new Tt,l=!1;return t.values.forEach(function(f){let d=f.entity;if(!Nj.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===ky.INTERVAL?ee.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===ky.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===ky.STOP&&(o&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){r(d),f.updating=!0;let g=new Ns,h=f.href.clone();h.setQueryParameters(f.cookie);let A=y(i._ellipsoid,re.WGS84);jj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,A),qj(i,g,h,{context:d.id}).then(_tt(i,f,g,c,h)).catch(function(x){let C=`NetworkLink ${f.href} refresh failed: ${x}`;console.log(C),i._error.raiseEvent(i,C)}),l=!0}}c.set(f.id,f)}}),l&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function gtt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Du._DeferredLoading=bh;Du._getTimestamp=Ai;var oL=Du;function sL(){fe.throwInstantiationError()}sL.prototype.update=fe.throwInstantiationError;sL.prototype.getBoundingSphere=fe.throwInstantiationError;sL.prototype.isDestroyed=fe.throwInstantiationError;sL.prototype.destroy=fe.throwInstantiationError;var Xj=sL;var ytt={NONE:0,LERC:1},Ff=Object.freeze(ytt);var Att={NONE:0,BITS12:1},Vs=Object.freeze(Att);var Xx=new m,xtt=new m,Uf=new H,J4=new N,Ctt=new N,Ttt=Math.pow(2,12);function mc(e,t,n,i,r,o,s,a,c,l){let f=Vs.NONE,d,p;if(u(t)&&u(n)&&u(i)&&u(r)){let g=t.minimum,h=t.maximum,A=m.subtract(h,g,xtt),x=i-n;Math.max(m.maximumComponent(A),x)<Ttt-1?f=Vs.BITS12:f=Vs.NONE,d=N.inverseTransformation(r,new N);let T=m.negate(g,Xx);N.multiply(N.fromTranslation(T,J4),d,d);let E=Xx;E.x=1/A.x,E.y=1/A.y,E.z=1/A.z,N.multiply(N.fromScale(E,J4),d,d),p=N.clone(r),N.setTranslation(p,m.ZERO,p),r=N.clone(r,new N);let S=N.fromTranslation(g,J4),w=N.fromScale(A,Ctt),D=N.multiply(S,w,J4);N.multiply(r,D,r),N.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(l,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}mc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,l=i.y;if(this.quantization===Vs.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,Xx),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((r-this.minimumHeight)/f,0,1);H.fromElements(n.x,n.y,Uf);let p=Yn.compressTextureCoordinates(Uf);H.fromElements(n.z,d,Uf);let g=Yn.compressTextureCoordinates(Uf);H.fromElements(c,l,Uf);let h=Yn.compressTextureCoordinates(Uf);if(e[t++]=p,e[t++]=g,e[t++]=h,this.hasWebMercatorT){H.fromElements(s,0,Uf);let A=Yn.compressTextureCoordinates(Uf);e[t++]=A}}else m.subtract(n,this.center,Xx),e[t++]=Xx.x,e[t++]=Xx.y,e[t++]=Xx.z,e[t++]=r,e[t++]=c,e[t++]=l,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Yn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Ett=new m,gpe=new m;mc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,Ett),c=n.geodeticSurfaceNormal(a,gpe),l=s*o+this._offsetGeodeticSurfaceNormal;t[l]=c.x,t[l+1]=c.y,t[l+2]=c.z}};mc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};mc.prototype.decodePosition=function(e,t,n){if(u(n)||(n=new m),t*=this.stride,this.quantization===Vs.BITS12){let i=Yn.decompressTextureCoordinates(e[t],Uf);n.x=i.x,n.y=i.y;let r=Yn.decompressTextureCoordinates(e[t+1],Uf);return n.z=r.x,N.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};mc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,gpe),a=this.decodeHeight(e,t),c=Ic.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};mc.prototype.decodeTextureCoordinates=function(e,t,n){return u(n)||(n=new H),t*=this.stride,this.quantization===Vs.BITS12?Yn.decompressTextureCoordinates(e[t+2],n):H.fromElements(e[t+4],e[t+5],n)};mc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Vs.BITS12?Yn.decompressTextureCoordinates(e[t+1],Uf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};mc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Vs.BITS12?Yn.decompressTextureCoordinates(e[t+3],Uf).x:e[t+6]};mc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return H.fromElements(r,o,n)};mc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};mc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Vs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var Z4={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},Q4={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};mc.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===Vs.NONE){s(Z4.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(Z4.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(Z4.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(Q4.compressed0,a?4:3),c&&s(Q4.compressed1,1),this.hasGeodeticSurfaceNormals&&s(Q4.geodeticSurfaceNormal,3)}return o};mc.prototype.getAttributeLocations=function(){return this.quantization===Vs.NONE?Z4:Q4};mc.clone=function(e,t){if(u(e))return u(t)||(t=new mc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=N.clone(e.toScaledENU),t.fromScaledENU=N.clone(e.fromScaledENU),t.matrix=N.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var hc=mc;var Sh={};Sh.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Kj=new m,btt=new N,Stt=new m,vtt=new m;Sh.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,l=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,re.WGS84),A=1/h.maximumRadius,x=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),T,E,S,w;u(C)?(T=C.west,E=C.south,S=C.east,w=C.north):g?(T=a(x.west),E=a(x.south),S=a(x.east),w=a(x.north)):(T=x.west*A,E=s-2*r(o(-x.south*A)),S=x.east*A,w=s-2*r(o(-x.north*A)));let D=e.relativeToCenter,M=u(D);D=M?D:m.ZERO;let O=y(e.includeWebMercatorT,!1),B=y(e.exaggeration,1),L=y(e.exaggerationRelativeHeight,0),b=B!==1,v=y(e.structure,Sh.DEFAULT_STRUCTURE),I=y(v.heightScale,Sh.DEFAULT_STRUCTURE.heightScale),R=y(v.heightOffset,Sh.DEFAULT_STRUCTURE.heightOffset),F=y(v.elementsPerHeight,Sh.DEFAULT_STRUCTURE.elementsPerHeight),k=y(v.stride,Sh.DEFAULT_STRUCTURE.stride),V=y(v.elementMultiplier,Sh.DEFAULT_STRUCTURE.elementMultiplier),G=y(v.isBigEndian,Sh.DEFAULT_STRUCTURE.isBigEndian),U=ce.computeWidth(x),Y=ce.computeHeight(x),W=U/(l-1),J=Y/(f-1);g||(U*=A,Y*=A);let j=h.radiiSquared,K=j.x,Z=j.y,me=j.z,ye=65536,se=-65536,pe=Mt.eastNorthUpToFixedFrame(D,h),Ae=N.inverseTransformation(pe,btt),De,Ce;O&&(De=Oi.geodeticLatitudeToMercatorAngle(E),Ce=1/(Oi.geodeticLatitudeToMercatorAngle(w)-De));let Re=Stt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let tt=vtt;tt.x=Number.NEGATIVE_INFINITY,tt.y=Number.NEGATIVE_INFINITY,tt.z=Number.NEGATIVE_INFINITY;let nt=Number.POSITIVE_INFINITY,Wt=l*f,un=d>0?l*2+f*2:0,pt=Wt+un,gn=new Array(pt),Bn=new Array(pt),Ut=new Array(pt),kt=O?new Array(pt):[],Ee=b?new Array(pt):[],xe=0,ft=f,di=0,Xe=l;p&&(--xe,++ft,--di,++Xe);let Xi=1e-5;for(let Je=xe;Je<ft;++Je){let it=Je;it<0&&(it=0),it>=f&&(it=f-1);let Lt=x.north-J*it;g?Lt=a(Lt):Lt=s-2*r(o(-Lt*A));let _n=(Lt-E)/(w-E);_n=P.clamp(_n,0,1);let mr=Je===xe,Er=Je===ft-1;d>0&&(mr?Lt+=Xi*Y:Er&&(Lt-=Xi*Y));let Cs=t(Lt),Ts=n(Lt),mo=me*Ts,Di;O&&(Di=(Oi.geodeticLatitudeToMercatorAngle(Lt)-De)*Ce);for(let Vo=di;Vo<Xe;++Vo){let Gn=Vo;Gn<0&&(Gn=0),Gn>=l&&(Gn=l-1);let vn=it*(l*k)+Gn*k,Wn;if(F===1)Wn=c[vn];else{Wn=0;let xt;if(G)for(xt=0;xt<F;++xt)Wn=Wn*V+c[vn+xt];else for(xt=F-1;xt>=0;--xt)Wn=Wn*V+c[vn+xt]}Wn=Wn*I+R,se=Math.max(se,Wn),ye=Math.min(ye,Wn);let Ci=x.west+W*Gn;g?Ci=a(Ci):Ci=Ci*A;let Ws=(Ci-T)/(S-T);Ws=P.clamp(Ws,0,1);let Es=it*l+Gn;if(d>0){let xt=Vo===di,Hi=Vo===Xe-1,tr=mr||Er||xt||Hi;if((mr||Er)&&(xt||Hi))continue;tr&&(Wn-=d,xt?(Es=Wt+(f-it-1),Ci-=Xi*U):Er?Es=Wt+f+(l-Gn-1):Hi?(Es=Wt+f+l+it,Ci+=Xi*U):mr&&(Es=Wt+f+l+f+Gn))}let La=Cs*t(Ci),js=Cs*n(Ci),td=K*La,ha=Z*js,jr=1/i(td*La+ha*js+mo*Ts),zo=td*jr,rn=ha*jr,Se=mo*jr,ct=new m;ct.x=zo+La*Wn,ct.y=rn+js*Wn,ct.z=Se+Ts*Wn,N.multiplyByPoint(Ae,ct,Kj),m.minimumByComponent(Kj,Re,Re),m.maximumByComponent(Kj,tt,tt),nt=Math.min(nt,Wn),gn[Es]=ct,Ut[Es]=new H(Ws,_n),Bn[Es]=Wn,O&&(kt[Es]=Di),b&&(Ee[Es]=h.geodeticSurfaceNormal(ct))}}let Or=ae.fromPoints(gn),Jo;u(C)&&(Jo=Mn.fromRectangle(C,ye,se,h));let Uo;M&&(Uo=new h_(h).computeHorizonCullingPointPossiblyUnderEllipsoid(D,gn,ye));let xs=new ug(Re,tt,D),Ue=new hc(D,xs,nt,se,pe,!1,O,b,B,L),ot=new Float32Array(pt*Ue.stride),Ge=0;for(let Je=0;Je<pt;++Je)Ge=Ue.encode(ot,Ge,gn[Je],Ut[Je],Bn[Je],void 0,kt[Je],Ee[Je]);return{vertices:ot,maximumHeight:se,minimumHeight:ye,encoding:Ue,boundingSphere3D:Or,orientedBoundingBox:Jo,occludeePointInScaledSpace:Uo}};var qb=Sh;function zy(){fe.throwInstantiationError()}Object.defineProperties(zy.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});zy.prototype.interpolateHeight=fe.throwInstantiationError;zy.prototype.isChildAvailable=fe.throwInstantiationError;zy.prototype.createMesh=fe.throwInstantiationError;zy.prototype.upsample=fe.throwInstantiationError;zy.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;zy.maximumAsynchronousTasks=5;var fm=zy;function wtt(e,t,n,i,r,o,s,a,c,l,f,d,p,g,h,A){this.center=e,this.vertices=t,this.stride=y(l,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=A}var Vf=wtt;function Jc(){fe.throwInstantiationError()}Object.defineProperties(Jc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var ype=[];Jc.getRegularGridIndices=function(e,t){let n=ype[e];u(n)||(ype[e]=n=[]);let i=n[t];return u(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Tpe(e,t,i,0)),i};var Ape=[];Jc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Ape[e];u(n)||(Ape[e]=n=[]);let i=n[t];if(!u(i)){let r=Jc.getRegularGridIndices(e,t),o=Cpe(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,l=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:l}}return i};var xpe=[];Jc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=xpe[e];u(n)||(xpe[e]=n=[]);let i=n[t];if(!u(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,l=o+a,f=Cpe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,h=f.northIndicesWestToEast,A=Fe.createTypedArray(c,l);Tpe(e,t,A,0),Jc.addSkirtIndices(d,p,g,h,r,A,o),i=n[t]={indices:A,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:h,indexCountWithoutSkirts:o}}return i};Jc.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=$4(e,a,o,s),a+=e.length,s=$4(t,a,o,s),a+=t.length,s=$4(n,a,o,s),a+=n.length,$4(i,a,o,s)};function Cpe(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function Tpe(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,l=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=l,++r}++r}}function $4(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Jc.heightmapTerrainQuality=.25;Jc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Jc.heightmapTerrainQuality/(t*n)};Jc.prototype.requestTileGeometry=fe.throwInstantiationError;Jc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Jc.prototype.getTileDataAvailable=fe.throwInstantiationError;Jc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var Yo=Jc;function O_(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Ff.NONE);let t=qb.DEFAULT_STRUCTURE,n=e.structure;u(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Ff.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(O_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Epe="createVerticesFromHeightmap",Dtt=new _i(Epe),Itt=new _i(Epe,fm.maximumAsynchronousTasks);O_.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ce.center(f)),p=this._structure,h=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(h*4,1e3);let x=(a?Itt:Dtt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!u(x))return;let C=this;return Promise.resolve(x).then(function(T){let E;C._skirtHeight>0?E=Yo.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):E=Yo.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let S=T.gridWidth*T.gridHeight;return C._mesh=new Vf(d,new Float32Array(T.vertices),E.indices,E.indexCountWithoutSkirts,S,T.minimumHeight,T.maximumHeight,ae.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Mn.clone(T.orientedBoundingBox),hc.clone(T.encoding),E.westIndicesSouthToNorth,E.southIndicesEastToWest,E.eastIndicesNorthToSouth,E.northIndicesWestToEast),C._buffer=void 0,C._mesh})};O_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),l=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ce.center(l)),d=this._structure,g=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let h=qb.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:l,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let A;this._skirtHeight>0?A=Yo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):A=Yo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=h.gridWidth*h.gridHeight;return this._mesh=new Vf(f,h.vertices,A.indices,A.indexCountWithoutSkirts,x,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),this._mesh};O_.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,l=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=u(this._mesh),g=this._encoding===Ff.LERC;if(!p&&g)return;let A;if(p){let x=this._mesh.vertices,C=this._mesh.encoding;A=bpe(x,C,f,d,e,i,r,t,n)}else A=Ptt(this._buffer,a,c,s,l,e,i,r,t,n),A=A*d+f;return A};O_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!u(a))return;let c=this._width,l=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*l*d),g=a.vertices,h=a.encoding,A=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(r,o,s),C=f.heightOffset,T=f.heightScale,E=f.elementsPerHeight,S=f.elementMultiplier,w=f.isBigEndian,D=Math.pow(S,E-1);for(let M=0;M<l;++M){let O=P.lerp(x.north,x.south,M/(l-1));for(let B=0;B<c;++B){let L=P.lerp(x.west,x.east,B/(c-1)),_=bpe(g,h,C,T,A,c,l,L,O);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,Ott(p,E,S,D,d,w,M*c+B,_)}}return Promise.resolve(new O_({buffer:p,width:c,height:l,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};O_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};O_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Ptt(e,t,n,i,r,o,s,a,c,l){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(l-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let h=d|0,A=h+1;A>=a&&(A=a-1,h=a-2);let x=f-p,C=d-h;h=a-1-h,A=a-1-A;let T=ez(e,t,n,i,r,h*s+p),E=ez(e,t,n,i,r,h*s+g),S=ez(e,t,n,i,r,A*s+p),w=ez(e,t,n,i,r,A*s+g);return Spe(x,C,T,E,S,w)}function bpe(e,t,n,i,r,o,s,a,c){let l=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=l|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let A=l-d,x=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*o+d)-n)/i,T=(t.decodeHeight(e,g*o+p)-n)/i,E=(t.decodeHeight(e,h*o+d)-n)/i,S=(t.decodeHeight(e,h*o+p)-n)/i;return Spe(A,x,C,T,E,S)}function Spe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function ez(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function Ott(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Pa=O_;function Kb(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Kx=new ce;function Mtt(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}Kb.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)Mtt(e,g,p,s)||s.push(new Yb(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,Kx);let a=Kx.west,c=Kx.north;o.tileXYToRectangle(i,r,e,Kx);let l=Kx.east,f=Kx.south,d=new Ftt(e,a,f,l,c);for(let p=0;p<s.length;++p){let g=s[p];Jj(g.extent,d)&&Utt(this._maximumLevel,g,d)}};Kb.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Xb(i.extent,e)){t=i;break}}return u(t)?aL(void 0,t,e):-1};var Rtt=[],Btt=[],Ltt=new ce,Ntt=new ce;Kb.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Rtt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,Ltt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,Ntt))):t.push(e);let n=Btt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)cL(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(u(n[i])&&n[i].length===0)return i;return 0};var vpe=new he;Kb.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Kx);return ce.center(i,vpe),this.computeMaximumLevelAtPosition(vpe)>=e};Kb.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function Yb(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(Yb.prototype,{nw:{get:function(){return this._nw||(this._nw=new Yb(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Yb(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Yb(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Yb(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Ftt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function Jj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function Utt(e,t,n){for(;t.level<e;)if(tz(t.nw.extent,n))t=t.nw;else if(tz(t.ne.extent,n))t=t.ne;else if(tz(t.sw.extent,n))t=t.sw;else if(tz(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Mr(t.rectangles,n.level,Vtt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Vtt(e,t){return e.level-t}function tz(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Xb(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function aL(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&Xb(t._nw.extent,n),s=t._ne&&Xb(t._ne.extent,n),a=t._sw&&Xb(t._sw.extent,n),c=t._se&&Xb(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,aL(t,t._nw,n))),s&&(i=Math.max(i,aL(t,t._ne,n))),a&&(i=Math.max(i,aL(t,t._sw,n))),c&&(i=Math.max(i,aL(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];Xb(a,n)&&(i=a.level)}t=t.parent}return i}function cL(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||Jj(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=ktt(e[s.level],s)}cL(e,t._nw,n),cL(e,t._ne,n),cL(e,t._sw,n),cL(e,t._se,n)}function ktt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];Jj(r,t)?(r.west<t.west&&n.push(new ce(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ce(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ce(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ce(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var dm=Kb;function ztt(e){let t,n=e.name,i=e.message;u(n)&&u(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return u(r)&&(t+=` -${r}`),t}var vh=ztt;function nz(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=y(o,0),this.retry=!1,this.error=s}nz.reportError=function(e,t,n,i,r,o,s,a){let c=e;return u(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new nz(t,i,r,o,s,0,a),u(n)&&n.numberOfListeners>0?n.raiseEvent(c):u(t)&&console.log(`An error occurred in "${t.constructor.name}": ${vh(i)}`),c};nz.reportSuccess=function(e){u(e)&&(e.timesRetried=-1)};var xi=nz;function Hy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Oi(this._ellipsoid),u(e.rectangleSouthwestInMeters)&&u(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Hy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Hy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Hy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Hy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),r=n.project(ce.northeast(e));return u(t)?(t.west=i.x,t.south=i.y,t.east=r.x,t.north=r.y,t):new ce(i.x,i.y,r.x,r.y)};Hy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,l=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,f=this._rectangleNortheastInMeters.y-t*l,d=this._rectangleNortheastInMeters.y-(t+1)*l;return u(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ce(a,d,c,f)};Hy.prototype.tileXYToRectangle=function(e,t,n,i){let r=this.tileXYToNativeRectangle(e,t,n,i),o=this._projection,s=o.unproject(new H(r.west,r.south)),a=o.unproject(new H(r.east,r.north));return r.west=s.longitude,r.south=s.latitude,r.east=a.longitude,r.north=a.latitude,r};Hy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,l=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,h=p/a|0;h>=r&&(h=r-1);let A=g/l|0;return A>=o&&(A=o-1),u(n)?(n.x=h,n.y=A,n):new H(h,A)};var No=Hy;var Htt=15;function Zj(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Zj.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function Gtt(e,t){let n=t.copyrightText;u(n)&&(e.credit=new Dt(n));let i=t.spatialReference,r=y(i.latestWkid,i.wkid),o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ce.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new ji(s);else if(r===3857){let l=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>l&&(t.extent.xmax=l),t.extent.ymax>l&&(t.extent.ymax=l),t.extent.xmin<-l&&(t.extent.xmin=-l),t.extent.ymin<-l&&(t.extent.ymin=-l),s.rectangleSouthwestInMeters=new H(o.xmin,o.ymin),s.rectangleNortheastInMeters=new H(o.xmax,o.ymax),e.tilingScheme=new No(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!u(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Ff.LERC:Ff.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new dm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new dm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),u(t.minValues)&&u(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function wpe(e,t,n){try{let i=await t.fetchJson();Gtt(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw xi.reportError(void 0,n,u(n)?n._errorEvent:void 0,r),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function Gy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new _e,u(e.url)){$("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new Zj(e);this._readyPromise=Promise.resolve(e.url).then(async function(r){let o=we.createIfNeeded(r);o.appendForwardSlash(),u(t)&&(o=o.getDerivedResource({queryParameters:{token:t}})),n._resource=o;let s=o.getDerivedResource({queryParameters:{f:"pjson"}});return await wpe(i,s,n),i.build(n),!0})}}Object.defineProperties(Gy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Gy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash(),u(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new Zj(t);await wpe(r,i);let o=new Gy(t);return r.build(o),o._resource=n,o};Gy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!u(Qj(this,n+1,e*2,t*2))){let d=Dpe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!u(c)||!u(s))return;let l=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Pa({buffer:d[0],width:l._width,height:l._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):Htt,structure:l._terrainDataStructure,encoding:l._encoding})}).catch(function(d){return u(a)&&a.state===ti.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ti.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function Qj(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}Gy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Gy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Qj(this,n,e,t);if(u(i))return i;Dpe(this,n,e,t)};Gy.prototype.loadTileDataAvailability=function(e,t,n){};function Wtt(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},l=new H(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=l.x,g=d?l.y+1:l.y;if(!f){for(let h=e.y;h<g;++h)if(i[h*t+l.x]!==s){f=!0;break}f?(a.push(new H(l.x,e.y)),--l.x,--p,c.endX=l.x):l.x===r?(c.endX=l.x,f=!0):++l.x}if(!d){let h=l.y*t;for(let A=e.x;A<=p;++A)if(i[h+A]!==s){d=!0;break}d?(a.push(new H(e.x,l.y)),--l.y,c.endY=l.y):l.y===o?(c.endY=l.y,d=!0):++l.y}}return{endingIndices:a,range:c,value:s}}function jtt(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new H(0,0)];for(;a.length>0;){let c=a.pop(),l=Wtt(c,n,i,r);if(l.value===1){let d=l.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=l.endingIndices;f.length>0&&(a=a.concat(f))}return o}function Dpe(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(u(c[a]))return c[a];let l=new qr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:l}).fetchJson();return u(d)?(d=d.then(function(p){let g=jtt(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let h=e._tilesAvailable;for(let A=0;A<g.length;++A){let x=g[A];h.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return Qj(e,t,n,i)}),c[a]={promise:d,request:l},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:l}):{}}var $j=Gy;var Ipe="https://dev.virtualearth.net/REST/v1/Locations";function eq(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};u(e.culture)&&(n.culture=e.culture),this._resource=new we({url:Ipe,queryParameters:n}),this._credit=new Dt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(eq.prototype,{url:{get:function(){return Ipe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});eq.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],l=o[3];return{displayName:r.name,destination:ce.fromDegrees(a,s,l,c)}})})};var tq=eq;function nq(){}Object.defineProperties(nq.prototype,{credit:{get:function(){}}});nq.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:m.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var lL=nq;var qtt=new oe,Ppe=new m,Jb=new m;function Ytt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){u(c)||(c=new m);let l=(a-i)*r;return m.lerp(o,s,l,c)}}return function(i,r){u(r)||(r=new m);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=qtt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,l,f,d,p;return o===0?(c=t[0],l=t[1],f=e.firstTangent,d=m.subtract(t[2],c,Ppe),m.multiplyByScalar(d,.5,d),p=N.multiplyByVector(Vg.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],l=t[o+1],d=e.lastTangent,f=m.subtract(l,t[o-1],Ppe),m.multiplyByScalar(f,.5,f),p=N.multiplyByVector(Vg.hermiteCoefficientMatrix,a,a)):(c=t[o-1],l=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(Wy.catmullRomCoefficientMatrix,a,a)),r=m.multiplyByScalar(c,p.x,r),m.multiplyByScalar(l,p.y,Jb),m.add(r,Jb,r),m.multiplyByScalar(f,p.z,Jb),m.add(r,Jb,r),m.multiplyByScalar(d,p.w,Jb),m.add(r,Jb,r)}}var Xtt=new m,Ktt=new m;function Wy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(u(i)||(i=Xtt,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!u(r))){let o=t.length-1;r=Ktt,m.multiplyByScalar(t[o-1],2,r),m.subtract(t[o],r,r),m.add(r,t[o-2],r),m.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(r),this._evaluateFunction=Ytt(this),this._lastTimeIndex=0}Object.defineProperties(Wy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Wy.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Wy.prototype.findTimeInterval=lr.prototype.findTimeInterval;Wy.prototype.wrapTime=lr.prototype.wrapTime;Wy.prototype.clampTime=lr.prototype.clampTime;Wy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var iq=Wy;var iz={};iz.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){u(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let l=s+a+c,f,d,p,g,h,A;return l===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(h=(e-r)/(n-r),A=(e-r)/(i-r),o.push(0),o.push(1),A!==1&&(o.push(-1),o.push(2),o.push(1),o.push(A)),h!==1&&(o.push(-1),o.push(2),o.push(0),o.push(h))):l===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(h)):!a&&i!==e?(A=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(A),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):l!==3&&(o.push(0),o.push(1),o.push(2)),o};iz.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let l=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*l+f*p),h=t-a,A=e-s,x=(d*A+f*h)*g,C=(-p*A+l*h)*g,T=1-x-C;return u(c)?(c.x=x,c.y=C,c.z=T,c):new m(x,C,T)};iz.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let l=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=l/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return u(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var M_=iz;function jy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=oz(e.westIndices,r,t),this._southIndices=oz(e.southIndices,o,t),this._eastIndices=oz(e.eastIndices,r,t),this._northIndices=oz(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(jy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return u(this._mesh)}}});var rz=[];function oz(e,t,n){rz.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)rz[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(rz.sort(t),Fe.createTypedArray(n,rz)):e}var Ope="createVerticesFromQuantizedTerrainMesh",Jtt=new _i(Ope),Ztt=new _i(Ope,fm.maximumAsynchronousTasks);jy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,l=t.tileXYToRectangle(n,i,r),d=(a?Ztt:Jtt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:l,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!u(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,A=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Fe.createTypedArray(A,g.indices),C=new Float32Array(g.vertices),T=g.center,E=g.minimumHeight,S=g.maximumHeight,w=p._boundingSphere,D=p._orientedBoundingBox,M=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),O=g.vertexStride,B=hc.clone(g.encoding);return p._mesh=new Vf(T,C,x,g.indexCountWithoutSkirts,h,E,S,w,M,O,D,B,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Qtt=new _i("upsampleQuantizedTerrainMesh",fm.maximumAsynchronousTasks);jy.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!u(this._mesh))return;let c=t*2!==r,l=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Qtt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:l,childRectangle:d,ellipsoid:f});if(!u(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,A=l?g*.5:this._southSkirtHeight,x=c?this._eastSkirtHeight:g*.5,C=l?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(E){let S=new Uint16Array(E.vertices),w=Fe.createTypedArray(S.length/3,E.indices),D;return u(E.encodedNormals)&&(D=new Uint8Array(E.encodedNormals)),new jy({quantizedVertices:S,indices:w,encodedNormals:D,minimumHeight:E.minimumHeight,maximumHeight:E.maximumHeight,boundingSphere:ae.clone(E.boundingSphere),orientedBoundingBox:Mn.clone(E.orientedBoundingBox),horizonOcclusionPoint:m.clone(E.horizonOcclusionPoint),westIndices:E.westIndices,southIndices:E.southIndices,eastIndices:E.eastIndices,northIndices:E.northIndices,westSkirtHeight:h,southSkirtHeight:A,eastSkirtHeight:x,northSkirtHeight:C,childTileMask:0,credits:T,createdByUpsampling:!0})})};var rq=32767,Mpe=new m;jy.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=rq;let r=P.clamp((n-e.south)/e.height,0,1);return r*=rq,u(this._mesh)?nnt(this,i,r):int(this,i,r)};function Rpe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),l=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=l&&t>=f&&t<=d}var $tt=new H,ent=new H,tnt=new H;function nnt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,l,$tt),g=o.decodeTextureCoordinates(r,f,ent),h=o.decodeTextureCoordinates(r,d,tnt);if(Rpe(t,n,p.x,p.y,g.x,g.y,h.x,h.y)){let A=M_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,Mpe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,l),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}}function int(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],f=s[a+1],d=s[a+2],p=i[l],g=i[f],h=i[d],A=r[l],x=r[f],C=r[d];if(Rpe(t,n,p,A,g,x,h,C)){let T=M_.computeBarycentricCoordinates(t,n,p,A,g,x,h,C,Mpe);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let E=T.x*o[l]+T.y*o[f]+T.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,E/rq)}}}}jy.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};jy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Jx=jy;function rnt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function aq(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}aq.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=u(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata,e._ready=!0};async function Lpe(e,t,n){if(!t.format){let A="The tile format is not specified in the layer.json file.";throw e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,A),new de(A)}if(!t.tiles||t.tiles.length===0){let A="The layer.json file does not specify any tile URL templates.";throw e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,A),new de(A)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,u(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let A=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,A),new de(A)}let c=t.tiles,l=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,l),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new No({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let A=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,A),new de(A)}if(e.levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let A=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,A),new de(A)}let f;u(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:u(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),u(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),u(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(u(p)&&!u(d)){g=new dm(e.tilingScheme,p.length);for(let A=0;A<p.length;++A){let x=p[A],C=e.tilingScheme.getNumberOfYTilesAtLevel(A);u(e.overallAvailability[A])||(e.overallAvailability[A]=[]);for(let T=0;T<x.length;++T){let E=x[T],S=C-E.endY-1,w=C-E.startY-1;e.overallAvailability[A].push([E.startX,S,E.endX,w]),g.addAvailableTileRange(A,E.startX,S,E.endX,w)}}}else u(d)&&(f=new dm(e.tilingScheme,l),g=new dm(e.tilingScheme,l),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,u(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new rnt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return u(h)?u(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await sz(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function ont(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(u(t)&&(i+=` -${t.message}`),e.previousError=xi.reportError(e.previousError,n,u(n)?n._errorEvent:void 0,i),e.previousError.retry)return sz(e,n);throw new de(i)}async function snt(e,t,n){await Lpe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new dm(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new Dt(e.attribution);e.tileCredits.push(r)}return!0}async function sz(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=snt(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return u(n)&&n.statusCode===404?(await Lpe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),ont(e,n,t))}}function Iu(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new Dt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),u(e.url)&&($("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=Iu._initializeReadyPromise(e,this))}Iu._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new aq(e),r=we.createIfNeeded(n);return r.appendForwardSlash(),i.lastResource=r,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await sz(i,t),i.build(t),!0};var oq={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Bpe(e){return!u(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function ant(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Pa({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function cnt(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,l=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*l,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,A=Uint16Array.BYTES_PER_ELEMENT,x=A*h,C=new DataView(t),T=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let E=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let w=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let D=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let M=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=new Uint16Array(t,a,M*3);a+=M*g,M>64*1024&&(A=Uint32Array.BYTES_PER_ELEMENT,x=A*h);let B=O.subarray(0,M),L=O.subarray(M,2*M),_=O.subarray(M*2,3*M);Yn.zigZagDeltaDecode(B,L,_),a%A!==0&&(a+=A-a%A);let b=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=Fe.createTypedArrayFromArrayBuffer(M,t,a,b*h);a+=b*x;let I=0,R=v.length;for(let se=0;se<R;++se){let pe=v[se];v[se]=I-pe,pe===0&&++I}let F=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let k=Fe.createTypedArrayFromArrayBuffer(M,t,a,F);a+=F*A;let V=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Fe.createTypedArrayFromArrayBuffer(M,t,a,V);a+=V*A;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Fe.createTypedArrayFromArrayBuffer(M,t,a,U);a+=U*A;let W=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Fe.createTypedArrayFromArrayBuffer(M,t,a,W);a+=W*A;let j,K;for(;a<C.byteLength;){let se=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let pe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,se===oq.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,M*2);else if(se===oq.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,pe);else if(se===oq.METADATA&&e._requestMetadata){let Ae=C.getUint32(a,!0);if(Ae>0){let Ce=Br(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ae).available;if(u(Ce))for(let Re=0;Re<Ce.length;++Re){let tt=n+Re+1,nt=Ce[Re],Wt=e._tilingScheme.getNumberOfYTilesAtLevel(tt);for(let un=0;un<nt.length;++un){let pt=nt[un],gn=Wt-pt.endY-1,Bn=Wt-pt.startY-1;e.availability.addAvailableTileRange(tt,pt.startX,gn,pt.endX,Bn),o.availability.addAvailableTileRange(tt,pt.startX,gn,pt.endX,Bn)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=pe}let Z=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,r,n),ye=Mn.fromRectangle(me,E,S,e._tilingScheme.ellipsoid);return new Jx({center:T,minimumHeight:E,maximumHeight:S,boundingSphere:w,orientedBoundingBox:ye,horizonOcclusionPoint:D,quantizedVertices:O,encodedNormals:j,indices:v,westIndices:k,southIndices:G,eastIndices:Y,northIndices:J,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:K,credits:e._tileCredits})}Iu.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length;if(s===1)o=r[0];else for(let a=0;a<s;++a){let c=r[a];if(!u(c.availability)||c.availability.isTileAvailable(n,e,t)){o=c;break}}return Npe(this,e,t,n,o,i)};function Npe(e,t,n,i,r,o){if(!u(r))return Promise.reject(new de("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let l,f,d=s[(t+a+i)%s.length],p=r.resource;u(p._ionEndpoint)&&!u(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),l=Bpe(void 0)):l=Bpe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:l,request:o}).fetchArrayBuffer();if(u(g))return g.then(function(h){return u(h)?u(e._heightmapStructure)?ant(e,h,i,t,n):cnt(e,h,i,t,n,r):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(Iu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Iu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Iu.fromIonAssetId=async function(e,t){let n=await Qs.fromAssetId(e);return Iu.fromUrl(n,t)};Iu.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=new aq(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await sz(i);let r=new Iu(t);return i.build(r),r};Iu.prototype.getTileDataAvailable=function(e,t,n){if(!u(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(Fpe(this,e,t,n,i[o],o===0).result)return;return!1};Iu.prototype.loadTileDataAvailability=function(e,t,n){if(!u(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=Fpe(this,e,t,n,i[o],o===0);if(u(s.promise))return s.promise}};function sq(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function Fpe(e,t,n,i,r,o){if(!u(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,l=r.availability,f=sq(r,t,n,i);for(;u(f);){if(l.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!u(d))){let p=new qr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});d=Npe(e,f.x,f.y,f.level,r,p),u(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=sq(r,f.x,f.y,f.level)}return{result:!1}}Iu._getAvailabilityTile=sq;var qy=Iu;function R_(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Yc(n),this._workerName="createCircleGeometry"}R_.packedLength=Yc.packedLength;R_.pack=function(e,t,n){return Yc.pack(e._ellipseGeometry,t,n)};var lnt=new Yc({center:new m,semiMajorAxis:1,semiMinorAxis:1}),pc={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Pe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};R_.unpack=function(e,t,n){let i=Yc.unpack(e,t,lnt);return pc.center=m.clone(i._center,pc.center),pc.ellipsoid=re.clone(i._ellipsoid,pc.ellipsoid),pc.height=i._height,pc.extrudedHeight=i._extrudedHeight,pc.granularity=i._granularity,pc.vertexFormat=Pe.clone(i._vertexFormat,pc.vertexFormat),pc.stRotation=i._stRotation,pc.shadowVolume=i._shadowVolume,u(n)?(pc.semiMajorAxis=i._semiMajorAxis,pc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Yc(pc),n):(pc.radius=i._semiMajorAxis,new R_(pc))};R_.createGeometry=function(e){return Yc.createGeometry(e._ellipseGeometry)};R_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new R_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var cq=R_;function Zb(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new yu(n),this._workerName="createCircleOutlineGeometry"}Zb.packedLength=yu.packedLength;Zb.pack=function(e,t,n){return yu.pack(e._ellipseGeometry,t,n)};var unt=new yu({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Pu={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Zb.unpack=function(e,t,n){let i=yu.unpack(e,t,unt);return Pu.center=m.clone(i._center,Pu.center),Pu.ellipsoid=re.clone(i._ellipsoid,Pu.ellipsoid),Pu.height=i._height,Pu.extrudedHeight=i._extrudedHeight,Pu.granularity=i._granularity,Pu.numberOfVerticalLines=i._numberOfVerticalLines,u(n)?(Pu.semiMajorAxis=i._semiMajorAxis,Pu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new yu(Pu),n):(Pu.radius=i._semiMajorAxis,new Zb(Pu))};Zb.createGeometry=function(e){return yu.createGeometry(e._ellipseGeometry)};var lq=Zb;function fnt(e){$("createWorldTerrain","createWorldTerrain was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldTerrainAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=new qy({requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)});return t._readyPromise=qy._initializeReadyPromise({url:Qs.fromAssetId(1),requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)},t),t}var uq=fnt;function dnt(e){return e=y(e,y.EMPTY_OBJECT),qy.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)})}var Zx=dnt;function Qb(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,u(this._tilingScheme)||(this._tilingScheme=new ji({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new Dt(n)),this._credit=n,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(Qb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("CustomHeightmapTerrainProvider.ready","CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("CustomHeightmapTerrainProvider.readyPromise","CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Qb.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!u(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Pa({buffer:c,width:o,height:s})})};Qb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Qb.prototype.getTileDataAvailable=function(e,t,n){};Qb.prototype.loadTileDataAvailability=function(e,t,n){};var fq=Qb;var mnt=1953029805,hnt=2917034100;function dq(e,t){if(dq.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new de("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===mnt||r===hnt)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,l=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<l;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=l&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}dq.passThroughDataForTesting=!1;var uL=dq;function Upe(e){this.proxy=e}Upe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var mq=Upe;function mm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=u(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(mm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(u(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});mm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new mm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};mm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(u(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};mm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Vpe(this,t)};mm.prototype.insert=function(e){let t,n=this._maximumLength;if(u(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Vpe(this,i),t};mm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],kpe(this,0)),this._array[e-1]=void 0,t};mm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=hq(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&kpe(this,n)}return this._array[e-1]=void 0,t};mm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};mm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[hq(this,1,2)?1:2]};function az(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function fL(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function hq(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Vpe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=fL(e,t,i);for(r!==n&&(az(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(fL(e,t,o)!==r)break;az(e,t,o),t=o}}function kpe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){fL(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let l=0;l<c;l++){let f=a+l;fL(e,f,o)===i&&(o=f)}}if(fL(e,o,t)===i&&(az(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);hq(e,o,a)===i&&az(e,o,a)}t=o}}var Qx=mm;function $b(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,u(this._tilingScheme)||(this._tilingScheme=new ji({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties($b.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("EllipsoidTerrainProvider.ready","EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("EllipsoidTerrainProvider.readyPromise","EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});$b.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Pa({buffer:new Uint8Array(16*16),width:16,height:16}))};$b.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};$b.prototype.getTileDataAvailable=function(e,t,n){};$b.prototype.loadTileDataAvailability=function(e,t,n){};var $x=$b;function wh(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new es,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function pq(e){let t=e.top,n=e.bottom,i=e.right,r=e.left,o=e.near,s=e.far;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=N.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=N.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(wh.prototype,{projectionMatrix:{get:function(){return pq(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return pq(this),this._infinitePerspective}}});var pnt=new m,_nt=new m,gnt=new m,ynt=new m;wh.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,l=this.far,f=m.cross(t,n,pnt),d=_nt;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=gnt;m.multiplyByScalar(t,l,p),m.add(e,p,p);let g=ynt;m.multiplyByScalar(f,a,g),m.add(d,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let h=i[0];return u(h)||(h=i[0]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(f,s,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),h=i[1],u(h)||(h=i[1]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(f,g,g),m.normalize(g,g),h=i[2],u(h)||(h=i[2]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(g,f,g),m.normalize(g,g),h=i[3],u(h)||(h=i[3]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),h=i[4],u(h)||(h=i[4]=new oe),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,d),m.negate(t,g),h=i[5],u(h)||(h=i[5]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,p),this._cullingVolume};wh.prototype.getPixelDimensions=function(e,t,n,i,r){pq(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};wh.prototype.clone=function(e){return u(e)||(e=new wh),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};wh.prototype.equals=function(e){return u(e)&&e instanceof wh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};wh.prototype.equalsEpsilon=function(e,t,n){return e===this||u(e)&&e instanceof wh&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Zc=wh;function Fl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Zc,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Fl.packedLength=6;Fl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Fl.unpack=function(e,t,n){return t=y(t,0),u(n)||(n=new Fl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function hm(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(Fl.prototype,{projectionMatrix:{get:function(){return hm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return hm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return hm(this),this._fovy}},sseDenominator:{get:function(){return hm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return hm(this),this._offCenterFrustum}}});Fl.prototype.computeCullingVolume=function(e,t,n){return hm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Fl.prototype.getPixelDimensions=function(e,t,n,i,r){return hm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Fl.prototype.clone=function(e){return u(e)||(e=new Fl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Fl.prototype.equals=function(e){return!u(e)||!(e instanceof Fl)?!1:(hm(this),hm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Fl.prototype.equalsEpsilon=function(e,t,n){return!u(e)||!(e instanceof Fl)?!1:(hm(this),hm(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var wi=Fl;var cz=0,Ant=1;function eC(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e._drawNearPlane,!0),s,a;t instanceof wi?(s=cz,a=wi.packedLength):t instanceof tn&&(s=Ant,a=tn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Le.packedLength+Pe.packedLength}eC.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===cz?(wi.pack(r,t,n),n+=wi.packedLength):(tn.pack(r,t,n),n+=tn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var xnt=new wi,Cnt=new tn,Tnt=new Le,Ent=new m,bnt=new Pe;eC.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===cz?(r=wi.unpack(e,t,xnt),t+=wi.packedLength):(r=tn.unpack(e,t,Cnt),t+=tn.packedLength);let o=m.unpack(e,t,Ent);t+=m.packedLength;let s=Le.unpack(e,t,Tnt);t+=Le.packedLength;let a=Pe.unpack(e,t,bnt);t+=Pe.packedLength;let c=e[t]===1;if(!u(n))return new eC({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(l),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Pe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function eS(e,t,n,i,r,o,s,a){let c=e/3*2;for(let l=0;l<4;++l)u(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),u(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),u(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var Snt=new Q,vnt=new N,_q=new N,zpe=new m,Hpe=new m,Gpe=new m,wnt=new m,Dnt=new m,Int=new m,Yy=new Array(3),dL=new Array(4);dL[0]=new oe(-1,-1,1,1);dL[1]=new oe(1,-1,1,1);dL[2]=new oe(1,1,1,1);dL[3]=new oe(-1,1,1,1);var Wpe=new Array(4);for(let e=0;e<4;++e)Wpe[e]=new oe;eC._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=Q.fromQuaternion(t,Snt),l=y(o,zpe),f=y(s,Hpe),d=y(a,Gpe);l=Q.getColumn(c,0,l),f=Q.getColumn(c,1,f),d=Q.getColumn(c,2,d),m.normalize(l,l),m.normalize(f,f),m.normalize(d,d),m.negate(l,l);let p=N.computeView(e,d,f,l,vnt),g,h,A=i.projectionMatrix;if(n===cz){let x=N.multiply(A,p,_q);h=N.inverse(x,_q)}else g=N.inverseTransformation(p,_q);u(h)?(Yy[0]=i.near,Yy[1]=i.far):(Yy[0]=0,Yy[1]=i.near,Yy[2]=i.far);for(let x=0;x<2;++x)for(let C=0;C<4;++C){let T=oe.clone(dL[C],Wpe[C]);if(u(h)){T=N.multiplyByVector(h,T,T);let E=1/T.w;m.multiplyByScalar(T,E,T),m.subtract(T,e,T),m.normalize(T,T);let S=m.dot(d,T);m.multiplyByScalar(T,Yy[x]/S,T),m.add(T,e,T)}else{let E=i.offCenterFrustum;u(E)&&(i=E);let S=Yy[x],w=Yy[x+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(S-w)-S-w)*.5,T.w=1,N.multiplyByVector(g,T,T)}r[12*x+C*3]=T.x,r[12*x+C*3+1]=T.y,r[12*x+C*3+2]=T.z}};eC.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(3*4*6);eC._computeNearFarPlanes(i,r,t,n,c);let l=3*4*2;c[l]=c[3*4],c[l+1]=c[3*4+1],c[l+2]=c[3*4+2],c[l+3]=c[0],c[l+4]=c[1],c[l+5]=c[2],c[l+6]=c[3*3],c[l+7]=c[3*3+1],c[l+8]=c[3*3+2],c[l+9]=c[3*7],c[l+10]=c[3*7+1],c[l+11]=c[3*7+2],l+=3*4,c[l]=c[3*5],c[l+1]=c[3*5+1],c[l+2]=c[3*5+2],c[l+3]=c[3],c[l+4]=c[3+1],c[l+5]=c[3+2],c[l+6]=c[0],c[l+7]=c[1],c[l+8]=c[2],c[l+9]=c[3*4],c[l+10]=c[3*4+1],c[l+11]=c[3*4+2],l+=3*4,c[l]=c[3],c[l+1]=c[3+1],c[l+2]=c[3+2],c[l+3]=c[3*5],c[l+4]=c[3*5+1],c[l+5]=c[3*5+2],c[l+6]=c[3*6],c[l+7]=c[3*6+1],c[l+8]=c[3*6+2],c[l+9]=c[3*2],c[l+10]=c[3*2+1],c[l+11]=c[3*2+2],l+=3*4,c[l]=c[3*2],c[l+1]=c[3*2+1],c[l+2]=c[3*2+2],c[l+3]=c[3*6],c[l+4]=c[3*6+1],c[l+5]=c[3*6+2],c[l+6]=c[3*7],c[l+7]=c[3*7+1],c[l+8]=c[3*7+2],c[l+9]=c[3*3],c[l+10]=c[3*3+1],c[l+11]=c[3*3+2],o||(c=c.subarray(3*4));let f=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(u(s.normal)||u(s.tangent)||u(s.bitangent)||u(s.st)){let p=u(s.normal)?new Float32Array(12*a):void 0,g=u(s.tangent)?new Float32Array(3*4*a):void 0,h=u(s.bitangent)?new Float32Array(3*4*a):void 0,A=u(s.st)?new Float32Array(2*4*a):void 0,x=zpe,C=Hpe,T=Gpe,E=m.negate(x,wnt),S=m.negate(C,Dnt),w=m.negate(T,Int);l=0,o&&(eS(l,p,g,h,A,w,x,C),l+=3*4),eS(l,p,g,h,A,T,E,C),l+=3*4,eS(l,p,g,h,A,E,w,C),l+=3*4,eS(l,p,g,h,A,S,w,E),l+=3*4,eS(l,p,g,h,A,x,T,C),l+=3*4,eS(l,p,g,h,A,C,T,E),u(p)&&(f.normal=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),u(g)&&(f.tangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),u(h)&&(f.bitangent=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),u(A)&&(f.st=new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,h=p*4;d[g]=h,d[g+1]=h+1,d[g+2]=h+2,d[g+3]=h,d[g+4]=h+2,d[g+5]=h+3}return new dt({attributes:f,indices:d,primitiveType:Be.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var tC=eC;var gq=0,Pnt=1;function mL(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e._drawNearPlane,!0),o,s;t instanceof wi?(o=gq,s=wi.packedLength):t instanceof tn&&(o=Pnt,s=tn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Le.packedLength}mL.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===gq?(wi.pack(r,t,n),n+=wi.packedLength):(tn.pack(r,t,n),n+=tn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var Ont=new wi,Mnt=new tn,Rnt=new Le,Bnt=new m;mL.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===gq?(r=wi.unpack(e,t,Ont),t+=wi.packedLength):(r=tn.unpack(e,t,Mnt),t+=tn.packedLength);let o=m.unpack(e,t,Bnt);t+=m.packedLength;let s=Le.unpack(e,t,Rnt);t+=Le.packedLength;let a=e[t]===1;if(!u(n))return new mL({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};mL.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(3*4*2);tC._computeNearFarPlanes(i,r,t,n,s);let a=new mn({position:new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,l,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,l=p*4,d[c]=l,d[c+1]=l+1,d[c+2]=l+1,d[c+3]=l+2,d[c+4]=l+2,d[c+5]=l+3,d[c+6]=l+3,d[c+7]=l;for(p=0;p<2;++p)c=(f+p)*8,l=p*4,d[c]=l,d[c+1]=l+4,d[c+2]=l+1,d[c+3]=l+5,d[c+4]=l+2,d[c+5]=l+6,d[c+6]=l+3,d[c+7]=l+7;return new dt({attributes:a,indices:d,primitiveType:Be.LINES,boundingSphere:ae.fromVertices(s)})};var hL=mL;function lz(){fe.throwInstantiationError()}Object.defineProperties(lz.prototype,{credit:{get:fe.throwInstantiationError}});lz.getCreditsFromResult=function(e){if(u(e.attributions))return e.attributions.map(Dt.getIonCredit)};lz.prototype.geocode=fe.throwInstantiationError;var tS=lz;var Lnt={SEARCH:0,AUTOCOMPLETE:1},Xy=Object.freeze(Lnt);function jpe(){fe.throwInstantiationError()}jpe.createGeometry=function(e){fe.throwInstantiationError()};var yq=jpe;function Nnt(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var pL=Nnt;var Hnt=Ki(Aq(),1);function Fnt(e,t){return(e&t)!==0}var _c=Fnt;var Unt=[1,2,4,8],qpe=15,Vnt=16,knt=64,znt=128;function Dh(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}Dh.clone=function(e,t){return u(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Dh(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Dh.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Dh.prototype.hasSubtree=function(){return _c(this._bits,Vnt)};Dh.prototype.hasImagery=function(){return _c(this._bits,knt)};Dh.prototype.hasTerrain=function(){return _c(this._bits,znt)};Dh.prototype.hasChildren=function(){return _c(this._bits,qpe)};Dh.prototype.hasChild=function(e){return _c(this._bits,Unt[e])};Dh.prototype.getChildBitmask=function(){return this._bits&qpe};var _L=Dh;function Gnt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var Wnt=Gnt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Ou(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),u(e)){$("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof we)&&(t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=Xpe(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(r){let o=`An error occurred while accessing ${Eq(i,"",1).url}.`;return Promise.reject(new de(o))})}}Object.defineProperties(Ou.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});Ou.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof we)&&(t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash();let i=new Ou;i._resource=n;try{await Xpe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Eq(i,"",1).url}: ${r}`;throw new de(o)}return i};Ou.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;_c(t,o)?_c(e,o)&&(s|=1):(s|=2,_c(e,o)||(s|=1)),i+=s}return i};Ou.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];_c(s,2)?_c(s,1)||(t|=o):(n|=o,_c(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Ou.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(u(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),u(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Ype=new _i("decodeGoogleEarthEnterprisePacket");Ou.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let r=Eq(this,e,t,n).fetchArrayBuffer();if(!u(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return Ype.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(l){let f,d=-1;if(e!==""){d=e.length+1;let h=l[e];f=o[e],f._bits|=h._bits,delete l[e]}let p=Object.keys(l);p.sort(function(h,A){return h.length-A.length});let g=p.length;for(let h=0;h<g;++h){let A=p[h];if(l[A]!==null){let C=_L.clone(l[A]),T=A.length;if(T===d)C.setParent(f);else if(T>1){let E=o[A.substring(0,A.length-1)];C.setParent(E)}o[A]=C}else o[A]=null}})})};Ou.prototype.populateSubtree=function(e,t,n,i){let r=Ou.tileXYToQuadKey(e,t,n);return Tq(this,r,i)};function Tq(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(u(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(u(c))return c.then(function(){return s=new qr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Tq(e,t,s)});if(!u(o)||!o.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!u(c))return a[r]=c,c.then(function(){return s=new qr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Tq(e,t,s)}).finally(function(){delete a[r]})}Ou.prototype.getTileInformation=function(e,t,n){let i=Ou.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Ou.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Eq(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var xq,Cq;function Xpe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!u(Cq)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Cq=w0(n).then(function(){xq=window.cesiumGoogleEarthDbRootParser(Hnt),u(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Cq.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=xq.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return Ype.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=xq.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),u(i.endSnippet)&&u(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}u(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let r=e.providers,o=y(i.providerInfo,[]),s=o.length;for(let a=0;a<s;++a){let c=o[a],l=c.copyrightString;u(l)&&(r[c.providerId]=new Dt(l.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Wnt})}var pm=Ou;function nC(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(nC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Zpe="createVerticesFromGoogleEarthEnterpriseBuffer",jnt=new _i(Zpe),qnt=new _i(Zpe,fm.maximumAsynchronousTasks),Kpe=new ce,bq=new ce;nC.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,Kpe),t.tileXYToRectangle(n,i,r,bq);let l=c.cartographicToCartesian(ce.center(bq)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?qnt:jnt).scheduleTask({buffer:this._buffer,nativeRectangle:Kpe,rectangle:bq,relativeToCenter:l,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!u(g))return;let h=this;return g.then(function(A){return h._mesh=new Vf(l,new Float32Array(A.vertices),new Uint16Array(A.indices),A.indexCountWithoutSkirts,A.vertexCountWithoutSkirts,A.minimumHeight,A.maximumHeight,ae.clone(A.boundingSphere3D),m.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Mn.clone(A.orientedBoundingBox),hc.clone(A.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),h._minimumHeight=A.minimumHeight,h._maximumHeight=A.maximumHeight,h._buffer=void 0,h._mesh})};nC.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),r=P.clamp((n-e.south)/e.height,0,1);return u(this._mesh)?Znt(this,i,r):eit(this,i,r,e)};var Ynt=new _i("upsampleQuantizedTerrainMesh",fm.maximumAsynchronousTasks);nC.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!u(this._mesh))return;let c=t*2!==r,l=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Ynt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:l,childRectangle:d,ellipsoid:f});if(!u(p))return;let g=this;return p.then(function(h){let A=new Uint16Array(h.vertices),x=Fe.createTypedArray(A.length/3,h.indices),C=g._skirtHeight;return new Jx({quantizedVertices:A,indices:x,minimumHeight:h.minimumHeight,maximumHeight:h.maximumHeight,boundingSphere:ae.clone(h.boundingSphere),orientedBoundingBox:Mn.clone(h.orientedBoundingBox),horizonOcclusionPoint:m.clone(h.horizonOcclusionPoint),westIndices:h.westIndices,southIndices:h.southIndices,eastIndices:h.eastIndices,northIndices:h.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};nC.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};nC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Xnt=new H,Knt=new H,Jnt=new H,Qpe=new m;function Znt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,l,Xnt),g=o.decodeTextureCoordinates(r,f,Knt),h=o.decodeTextureCoordinates(r,d,Jnt),A=M_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,Qpe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,l),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}var Qnt=Uint16Array.BYTES_PER_ELEMENT,Jpe=Uint32Array.BYTES_PER_ELEMENT,Sq=Int32Array.BYTES_PER_ELEMENT,$nt=Float32Array.BYTES_PER_ELEMENT,vq=Float64Array.BYTES_PER_ELEMENT;function eit(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),l=0;for(let w=0;w<o;++w)l+=c.getUint32(l,!0),l+=Jpe;l+=Jpe,l+=2*vq;let f=P.toRadians(c.getFloat64(l,!0)*180);l+=vq;let d=P.toRadians(c.getFloat64(l,!0)*180);l+=vq;let p=i.width/f/2,g=i.height/d/2,h=c.getInt32(l,!0);l+=Sq;let A=c.getInt32(l,!0)*3;l+=Sq,l+=Sq;let x=new Array(h),C=new Array(h),T=new Array(h),E;for(E=0;E<h;++E)x[E]=s+c.getUint8(l++)*p,C[E]=a+c.getUint8(l++)*g,T[E]=c.getFloat32(l,!0)*6371010,l+=$nt;let S=new Array(A);for(E=0;E<A;++E)S[E]=c.getUint16(l,!0),l+=Qnt;for(E=0;E<A;E+=3){let w=S[E],D=S[E+1],M=S[E+2],O=x[w],B=x[D],L=x[M],_=C[w],b=C[D],v=C[M],I=M_.computeBarycentricCoordinates(t,n,O,_,B,b,L,v,Qpe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*T[w]+I.y*T[D]+I.z*T[M]}}var nS=nC;var kf={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},uz=new ee;function fz(){this._terrainCache={},this._lastTidy=ee.now()}fz.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};fz.prototype.get=function(e){let n=this._terrainCache[e];if(u(n))return delete this._terrainCache[e],n.buffer};fz.prototype.tidy=function(){if(ee.now(uz),ee.secondsDifference(uz,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];ee.secondsDifference(uz,o.timestamp)>10&&delete e[r]}ee.clone(uz,this._lastTidy)}};function Ky(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new Dt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new fz,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e,this._ready=!1,u(e.url)){$("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=we.createIfNeeded(e.url),i=this,r;this._readyPromise=pm.fromUrl(n).then(o=>{if(!o.terrainPresent){let s=new de(`The server ${o.url} doesn't have terrain`);return Promise.reject(s)}return xi.reportSuccess(r),i._metadata=o,i._ready=!0,!0}).catch(o=>{throw r=xi.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),o})}else if(u(e.metadata)){$("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(Ky.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Ky.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new Ky(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var tit=new _i("decodeGoogleEarthEnterprisePacket");function $pe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===kf.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());u(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}Ky.prototype.requestTileGeometry=function(e,t,n,i){let r=pm.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!u(a))return Promise.reject(new de("Terrain tile doesn't exist"));let c=a.terrainState;u(c)||(c=a.terrainState=kf.UNKNOWN);let l=o.get(r);if(u(l)){let C=s.providers[a.terrainProvider];return Promise.resolve(new nS({buffer:l,childTileMask:$pe(r,a,s),credits:u(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===kf.NONE)return Promise.reject(new de("Terrain tile doesn't exist"))}else return Promise.resolve(new Pa({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=r,p=-1;switch(c){case kf.SELF:p=a.terrainVersion;break;case kf.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case kf.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),u(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new de("Terrain tile doesn't exist"));let g=this._terrainPromises,h=this._terrainRequests,A,x;if(u(g[d]))A=g[d],x=h[d];else{x=i;let C=nit(this,d,p,x).fetchArrayBuffer();if(!u(C))return;A=C.then(function(T){return u(T)?tit.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(E){let S=s.getTileInformationFromQuadKey(d);S.terrainState=kf.SELF,o.add(d,E[0]);let w=S.terrainProvider,D=E.length-1;for(let M=0;M<D;++M){let O=d+M.toString(),B=s.getTileInformationFromQuadKey(O);u(B)&&(o.add(O,E[M+1]),B.terrainState=kf.PARENT,B.terrainProvider===0&&(B.terrainProvider=w))}}):Promise.reject(new de("Failed to load terrain."))}),g[d]=A,h[d]=x,A=A.finally(function(){delete g[d],delete h[d]})}return A.then(function(){let C=o.get(r);if(u(C)){let T=s.providers[a.terrainProvider];return new nS({buffer:C,childTileMask:$pe(r,a,s),credits:u(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new de("Failed to load terrain."))}).catch(function(C){return x.state===ti.CANCELLED?(i.state=x.state,Promise.reject(C)):(a.terrainState=kf.NONE,Promise.reject(C))})};Ky.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Ky.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=pm.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(u(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===kf.NONE)return!1;if((!u(s)||s===kf.UNKNOWN)&&(o.terrainState=kf.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!u(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new qr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};Ky.prototype.loadTileDataAvailability=function(e,t,n){};function nit(e,t,n,i){return n=u(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var wq=Ky;function iit(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var gL=iit;var m_e={},rit=32.184,oit=2451545,e_e=-.0529921,t_e=-.1059842,n_e=13.0120009,i_e=13.3407154,r_e=.9856003,o_e=26.4057084,s_e=13.064993,a_e=.3287146,c_e=1.7484877,l_e=-.1589763,u_e=.0036096,f_e=.1643573,d_e=12.9590088,Dq=new ee;m_e.ComputeMoon=function(e,t){u(e)||(e=ee.now()),Dq=ee.addSeconds(e,rit,Dq);let n=ee.totalDays(Dq)-oit,i=n/Qn.DAYS_PER_JULIAN_CENTURY,r=(125.045+e_e*n)*P.RADIANS_PER_DEGREE,o=(250.089+t_e*n)*P.RADIANS_PER_DEGREE,s=(260.008+n_e*n)*P.RADIANS_PER_DEGREE,a=(176.625+i_e*n)*P.RADIANS_PER_DEGREE,c=(357.529+r_e*n)*P.RADIANS_PER_DEGREE,l=(311.589+o_e*n)*P.RADIANS_PER_DEGREE,f=(134.963+s_e*n)*P.RADIANS_PER_DEGREE,d=(276.617+a_e*n)*P.RADIANS_PER_DEGREE,p=(34.226+c_e*n)*P.RADIANS_PER_DEGREE,g=(15.134+l_e*n)*P.RADIANS_PER_DEGREE,h=(119.743+u_e*n)*P.RADIANS_PER_DEGREE,A=(239.961+f_e*n)*P.RADIANS_PER_DEGREE,x=(25.053+d_e*n)*P.RADIANS_PER_DEGREE,C=Math.sin(r),T=Math.sin(o),E=Math.sin(s),S=Math.sin(a),w=Math.sin(c),D=Math.sin(l),M=Math.sin(f),O=Math.sin(d),B=Math.sin(p),L=Math.sin(g),_=Math.sin(h),b=Math.sin(A),v=Math.sin(x),I=Math.cos(r),R=Math.cos(o),F=Math.cos(s),k=Math.cos(a),V=Math.cos(c),G=Math.cos(l),U=Math.cos(f),Y=Math.cos(d),W=Math.cos(p),J=Math.cos(g),j=Math.cos(h),K=Math.cos(A),Z=Math.cos(x),me=(269.9949+.0031*i-3.8787*C-.1204*T+.07*E-.0172*S+.0072*D-.0052*L+.0043*v)*P.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*I+.0239*R-.0278*F+.0068*k-.0029*G+9e-4*U+8e-4*J-9e-4*Z)*P.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*T-.0642*E+.0158*S+.0252*w-.0066*D-.0047*M-.0046*O+.0028*B+.0052*L+.004*_+.0019*b-.0044*v)*P.RADIANS_PER_DEGREE,pe=(13.17635815-14e-13*(2*n)+3.561*I*e_e+.1208*R*t_e-.0642*F*n_e+.0158*k*i_e+.0252*V*r_e-.0066*G*o_e-.0047*U*s_e-.0046*Y*a_e+.0028*W*c_e+.0052*J*l_e+.004*j*u_e+.0019*K*f_e-.0044*Z*d_e)/86400*P.RADIANS_PER_DEGREE;return u(t)||(t=new gL),t.rightAscension=me,t.declination=ye,t.rotation=se,t.rotationRate=pe,t};var yL=m_e;function h_e(e){(!u(e)||typeof e!="function")&&(e=yL.ComputeMoon),this._computeFunction=e}var sit=new m,ait=new m,cit=new m;function lit(e,t,n){let i=sit;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=cit;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=m.cross(o,i,ait);return u(n)||(n=new Q),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var uit=new Q,fit=new Le;h_e.prototype.evaluate=function(e,t){u(e)||(e=ee.now());let n=this._computeFunction(e),i=lit(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(m.UNIT_Z,r,fit),s=Q.fromQuaternion(Le.conjugate(o,o),uit);return Q.multiply(s,i,i)};var AL=h_e;var xL={};xL.type=void 0;xL.getRequiredDataPoints=fe.throwInstantiationError;xL.interpolateOrderZero=fe.throwInstantiationError;xL.interpolate=fe.throwInstantiationError;var Iq=xL;function Pq(e){this._url=we.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Pq.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Pq.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Xy.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(u(s))o=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=m.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var CL=Pq;function Oq(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,Cd.defaultAccessToken),n=we.createIfNeeded(y(e.server,Cd.defaultServer));n.appendForwardSlash();let i=Cd.getDefaultTokenCredit(t);u(i)&&e.scene.frameState.creditDisplay.addStaticCredit(Dt.clone(i));let r=n.getDerivedResource({url:"v1/geocode"});u(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new CL(r)}Object.defineProperties(Oq.prototype,{credit:{get:function(){}}});Oq.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var TL=Oq;var dit={SHIFT:0,CTRL:1,ALT:2},la=Object.freeze(dit);function dz(){fe.throwInstantiationError()}Object.defineProperties(dz.prototype,{ellipsoid:{get:fe.throwInstantiationError}});dz.prototype.project=fe.throwInstantiationError;dz.prototype.unproject=fe.throwInstantiationError;var Mq=dz;var Rq=[],Bq=[];function mit(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Rq,l=Bq,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)l[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],h=l[d];f<s&&(d>=a||t(g,h,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=h,++d)}}function Lq(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Lq(e,t,n,i,o),Lq(e,t,n,o+1,r),mit(e,t,n,i,o,r)}function hit(e,t,n){let i=e.length,r=Math.ceil(i*.5);Rq.length=r,Bq.length=r,Lq(e,t,n,0,i-1),Rq.length=0,Bq.length=0}var B_=hit;function iS(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(iS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});iS.prototype.findTimeInterval=lr.prototype.findTimeInterval;iS.prototype.wrapTime=lr.prototype.wrapTime;iS.prototype.clampTime=lr.prototype.clampTime;iS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);u(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var Nq=iS;var pit={NONE:-1,PARTIAL:0,FULL:1},fo=Object.freeze(pit);function gc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var mz=new m;Object.defineProperties(gc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,mz),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=m.multiplyByScalar(t,n,mz);let a=r*r*n;s=m.add(e,m.multiplyByScalar(o,a,mz),mz)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});gc.fromBoundingSphere=function(e,t,n){return u(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new gc(e,t)};var __e=new m;gc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,__e),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var _it=new m;gc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,_it),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,__e),r=this._occluderRadius-n;if(r=m.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),r*r+n*n>m.magnitudeSquared(i)):!1;if(r>0){i=m.subtract(t,this._cameraPosition,i);let o=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var git=new m;gc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return fo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,git),r=this._occluderRadius-n,o=m.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return r*r+n*n<s?fo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?fo.FULL:fo.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?fo.PARTIAL:fo.FULL))}}return fo.NONE};var hz=new m;gc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),r=m.clone(e.center),o=e.radius,s=n.length,a=m.normalize(m.subtract(i,r,hz),hz),c=-m.dot(a,r),l=gc._anyRotationVector(r,a,c),f=gc._horizonToPlaneNormalDotProduct(e,a,c,l,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=gc._horizonToPlaneNormalDotProduct(e,a,c,l,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return m.add(r,m.multiplyByScalar(a,p,hz),hz)};var yit=[];gc.computeOccludeePointFromRectangle=function(e,t){t=y(t,re.WGS84);let n=ce.subsample(e,t,0,yit),i=ae.fromPoints(n),r=m.ZERO;if(!m.equals(r,i.center))return gc.computeOccludeePoint(new ae(r,t.minimumRadius),i.center,n)};var Ait=new m;gc._anyRotationVector=function(e,t,n){let i=m.abs(t,Ait),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new m,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,o),i),e,i),i)};var xit=new m;gc._rotationVector=function(e,t,n,i,r){let o=m.subtract(i,e,xit);if(o=m.normalize(o,o),m.dot(t,o)<.9999999847691291){let s=m.cross(t,o,o);if(m.magnitude(s)>P.EPSILON13)return m.normalize(s,new m)}return r};var Fq=new m,Cit=new m,pz=new m,p_e=new m;gc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=m.clone(r,Fq),s=m.clone(e.center,Cit),a=e.radius,c=m.subtract(s,o,pz),l=m.magnitudeSquared(c),f=a*a;if(l<f)return!1;let d=l-f,p=Math.sqrt(d),h=1/Math.sqrt(l),x=p*h*p;c=m.normalize(c,c);let C=m.add(o,m.multiplyByScalar(c,x,p_e),p_e),T=Math.sqrt(d-x*x),E=this._rotationVector(s,t,n,o,i),S=m.fromElements(E.x*E.x*c.x+(E.x*E.y-E.z)*c.y+(E.x*E.z+E.y)*c.z,(E.x*E.y+E.z)*c.x+E.y*E.y*c.y+(E.y*E.z-E.x)*c.z,(E.x*E.z-E.y)*c.x+(E.y*E.z+E.x)*c.y+E.z*E.z*c.z,Fq);S=m.normalize(S,S);let w=m.multiplyByScalar(S,T,Fq);E=m.normalize(m.subtract(m.add(C,w,pz),s,pz),pz);let D=m.dot(t,E);E=m.normalize(m.subtract(m.subtract(C,w,E),s,E),E);let M=m.dot(t,E);return D<M?D:M};var EL=gc;function Uq(e,t,n){e=we.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Dt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Uq.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Uq.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:_t(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(u(o))r=ce.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;r=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var Vq=Uq;var Tit={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},kq=Tit;var Eit={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},zq=Eit;var bit=new m;function Sit(e,t,n,i){let r=W0(e,t,n,i,bit);return u(r)?r.x>0&&r.y>0&&r.z>0:!1}var Hq=Sit;function g_e(){fe.throwInstantiationError()}g_e.prototype.getURL=fe.throwInstantiationError;var Gq=g_e;var vit={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(vit);function Jy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=(t.clientX-r.left)*(i.offsetWidth/r.width),n.y=(t.clientY-r.top)*(i.offsetHeight/r.height),n}function Kq(e,t){let n=e;return u(t)&&(n+=`+${t}`),n}function iC(e){if(e.shiftKey)return la.SHIFT;if(e.ctrlKey)return la.CTRL;if(e.altKey)return la.ALT}var ps={LEFT:0,MIDDLE:1,RIGHT:2};function Mu(e,t,n,i){function r(o){i(e,o)}Gt.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function wit(e){let t=e._element,n=u(t.disableRootEvents)?t:document;Gt.supportsPointerEvents()?(Mu(e,"pointerdown",t,Rit),Mu(e,"pointerup",t,w_e),Mu(e,"pointermove",t,Bit),Mu(e,"pointercancel",t,w_e)):(Mu(e,"mousedown",t,D_e),Mu(e,"mouseup",n,I_e),Mu(e,"mousemove",n,P_e),Mu(e,"touchstart",t,Oit),Mu(e,"touchend",n,T_e),Mu(e,"touchmove",n,Mit),Mu(e,"touchcancel",n,T_e)),Mu(e,"dblclick",t,Iit);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Mu(e,i,t,Pit)}function Dit(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var y_e={position:new H};function Jq(e){e._lastSeenTouchEvent=Ai()}function Zq(e){return Ai()-e._lastSeenTouchEvent>_m.mouseEmulationIgnoreMilliseconds}function Xq(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function D_e(e,t){if(!Zq(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ps.LEFT)i=Cn.LEFT_DOWN;else if(n===ps.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===ps.RIGHT)i=Cn.RIGHT_DOWN;else return;let r=Jy(e,t,e._primaryPosition);H.clone(r,e._primaryStartPosition),H.clone(r,e._primaryPreviousPosition);let o=iC(t),s=e.getInputAction(i,o);u(s)&&(H.clone(r,y_e.position),s(y_e),t.preventDefault())}var A_e={position:new H},x_e={position:new H};function Wq(e,t,n,i){let r=iC(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(u(o)||u(s)){let a=Jy(e,i,e._primaryPosition);if(u(o)&&(H.clone(a,A_e.position),o(A_e)),u(s)){let c=e._primaryStartPosition;Xq(c,a,e._clickPixelTolerance)&&(H.clone(a,x_e.position),s(x_e))}}}function I_e(e,t){if(!Zq(e))return;let n=t.button;n!==ps.LEFT&&n!==ps.MIDDLE&&n!==ps.RIGHT||(e._buttonDown[ps.LEFT]&&(Wq(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[ps.LEFT]=!1),e._buttonDown[ps.MIDDLE]&&(Wq(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[ps.MIDDLE]=!1),e._buttonDown[ps.RIGHT]&&(Wq(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[ps.RIGHT]=!1))}var jq={startPosition:new H,endPosition:new H};function P_e(e,t){if(!Zq(e))return;let n=iC(t),i=Jy(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(Cn.MOUSE_MOVE,n);u(o)&&(H.clone(r,jq.startPosition),H.clone(i,jq.endPosition),o(jq)),H.clone(i,r),(e._buttonDown[ps.LEFT]||e._buttonDown[ps.MIDDLE]||e._buttonDown[ps.RIGHT])&&t.preventDefault()}var C_e={position:new H};function Iit(e,t){let n=t.button,i;if(n===ps.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let r=iC(t),o=e.getInputAction(i,r);u(o)&&(Jy(e,t,C_e.position),o(C_e))}function Pit(e,t){let n;if(u(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!u(n))return;let i=iC(t),r=e.getInputAction(Cn.WHEEL,i);u(r)&&(r(n),t.preventDefault())}function Oit(e,t){Jq(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,Jy(e,o,new H));_z(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,H.clone(a.get(s)))}function T_e(e,t){Jq(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);_z(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var E_e={position:new H},qq={position1:new H,position2:new H},b_e={position:new H},S_e={position:new H},v_e={position:new H};function _z(e,t){let n=iC(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[ps.LEFT]){if(e._buttonDown[ps.LEFT]=!1,u(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(Cn.LEFT_UP,n),u(o)&&(H.clone(e._primaryPosition,b_e.position),o(b_e)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),u(s))){let c=e._primaryStartPosition,l=e._previousPositions.values[0];Xq(c,l,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,S_e.position),s(S_e))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(Cn.PINCH_END,n),u(o)&&o()),r===1&&!a){let c=i.values[0];H.clone(c,e._primaryPosition),H.clone(c,e._primaryStartPosition),H.clone(c,e._primaryPreviousPosition),e._buttonDown[ps.LEFT]=!0,o=e.getInputAction(Cn.LEFT_DOWN,n),u(o)&&(H.clone(c,E_e.position),o(E_e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),u(s))){let l=e._primaryStartPosition,f=e._previousPositions.values[0];Xq(l,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,v_e.position),s(v_e))}},_m.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(Cn.PINCH_START,n),u(o)&&(H.clone(i.values[0],qq.position1),H.clone(i.values[1],qq.position2),o(qq),t.preventDefault()))}function Mit(e,t){Jq(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let l=a.get(s);u(l)&&Jy(e,o,l)}O_e(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,H.clone(a.get(s),c.get(s))}var Yq={startPosition:new H,endPosition:new H},bL={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function O_e(e,t){let n=iC(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[ps.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),u(s)&&(H.clone(c,Yq.startPosition),H.clone(a,Yq.endPosition),s(Yq)),H.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),u(s))){let a=i.values[0],c=i.values[1],l=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,h=f.x-l.x,A=f.y-l.y,x=Math.sqrt(h*h+A*A)*.25,C=(c.y+a.y)*.125,T=(f.y+l.y)*.125,E=Math.atan2(p,d),S=Math.atan2(A,h);H.fromElements(0,x,bL.distance.startPosition),H.fromElements(0,g,bL.distance.endPosition),H.fromElements(S,T,bL.angleAndHeight.startPosition),H.fromElements(E,C,bL.angleAndHeight.endPosition),s(bL)}}function Rit(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Jy(e,t,new H)),_z(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else D_e(e,t)}function w_e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),_z(e,t),e._previousPositions.remove(i)}else I_e(e,t)}function Bit(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!u(r))return;Jy(e,t,r),O_e(e,t);let o=e._previousPositions;H.clone(n.get(i),o.get(i))}else P_e(e,t)}function _m(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-_m.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new Tt,this._previousPositions=new Tt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),wit(this)}_m.prototype.setInputAction=function(e,t,n){let i=Kq(t,n);this._inputEvents[i]=e};_m.prototype.getInputAction=function(e,t){let n=Kq(e,t);return this._inputEvents[n]};_m.prototype.removeInputAction=function(e,t){let n=Kq(e,t);delete this._inputEvents[n]};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return Dit(this),ue(this)};_m.mouseEmulationIgnoreMilliseconds=800;_m.touchHoldDelayMilliseconds=1500;var Ru=_m;function Lit(e,t,n,i,r,o,s){let a=Mi.numberOfPoints(e,t,r),c,l=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,h=i.green,A=i.blue,x=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(l),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let C=(g-l)/a,T=(h-f)/a,E=(A-d)/a,S=(x-p)/a,w=s;for(c=0;c<a;c++)o[w++]=z.floatToByte(l+c*C),o[w++]=z.floatToByte(f+c*T),o[w++]=z.floatToByte(d+c*E),o[w++]=z.floatToByte(p+c*S);return w}function SL(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._workerName="createSimplePolylineGeometry";let r=1+t.length*m.packedLength;r+=u(n)?1+n.length*z.packedLength:1,this.packedLength=r+re.packedLength+3}SL.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=u(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};SL.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let c=e[t++]===1,l=e[t++],f=e[t];return u(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=l,n._granularity=f,n):new SL({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:l,granularity:f})};var gz=new Array(2),yz=new Array(2),Nit={positions:gz,height:yz,ellipsoid:void 0,minDistance:void 0,granularity:void 0};SL.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=P.chordLength(o,s.maximumRadius),c=u(n)&&!i,l,f=t.length,d,p,g,h,A=0;if(r===Jt.GEODESIC||r===Jt.RHUMB){let S,w,D;r===Jt.GEODESIC?(S=P.chordLength(o,s.maximumRadius),w=Mi.numberOfPoints,D=Mi.generateArc):(S=o,w=Mi.numberOfPointsRhumbLine,D=Mi.generateRhumbArc);let M=Mi.extractHeights(t,s),O=Nit;if(r===Jt.GEODESIC?O.minDistance=a:O.granularity=o,O.ellipsoid=s,c){let B=0;for(l=0;l<f-1;l++)B+=w(t[l],t[l+1],S)+1;d=new Float64Array(B*3),g=new Uint8Array(B*4),O.positions=gz,O.height=yz;let L=0;for(l=0;l<f-1;++l){gz[0]=t[l],gz[1]=t[l+1],yz[0]=M[l],yz[1]=M[l+1];let _=D(O);if(u(n)){let b=_.length/3;h=n[l];for(let v=0;v<b;++v)g[L++]=z.floatToByte(h.red),g[L++]=z.floatToByte(h.green),g[L++]=z.floatToByte(h.blue),g[L++]=z.floatToByte(h.alpha)}d.set(_,A),A+=_.length}}else if(O.positions=t,O.height=M,d=new Float64Array(D(O)),u(n)){for(g=new Uint8Array(d.length/3*4),l=0;l<f-1;++l){let L=t[l],_=t[l+1],b=n[l],v=n[l+1];A=Lit(L,_,b,v,a,g,A)}let B=n[f-1];g[A++]=z.floatToByte(B.red),g[A++]=z.floatToByte(B.green),g[A++]=z.floatToByte(B.blue),g[A++]=z.floatToByte(B.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=u(n)?new Uint8Array(p*4):void 0;let S=0,w=0;for(l=0;l<f;++l){let D=t[l];if(c&&l>0&&(m.pack(D,d,S),S+=3,h=n[l-1],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha)),c&&l===f-1)break;m.pack(D,d,S),S+=3,u(n)&&(h=n[l],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha))}}let x=new mn;x.position=new Ie({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),u(n)&&(x.color=new Ie({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,T=Fe.createTypedArray(p,C),E=0;for(l=0;l<p-1;++l)T[E++]=l,T[E++]=l+1;return new dt({attributes:x,indices:T,primitiveType:Be.LINES,boundingSphere:ae.fromPoints(t)})};var Qq=SL;function rS(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Us(i),this._workerName="createSphereGeometry"}rS.packedLength=Us.packedLength;rS.pack=function(e,t,n){return Us.pack(e._ellipsoidGeometry,t,n)};var Fit=new Us,Zy={radius:void 0,radii:new m,vertexFormat:new Pe,stackPartitions:void 0,slicePartitions:void 0};rS.unpack=function(e,t,n){let i=Us.unpack(e,t,Fit);return Zy.vertexFormat=Pe.clone(i._vertexFormat,Zy.vertexFormat),Zy.stackPartitions=i._stackPartitions,Zy.slicePartitions=i._slicePartitions,u(n)?(m.clone(i._radii,Zy.radii),n._ellipsoidGeometry=new Us(Zy),n):(Zy.radius=i._radii.x,new rS(Zy))};rS.createGeometry=function(e){return Us.createGeometry(e._ellipsoidGeometry)};var $q=rS;var Uit={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=Uit;function Qy(e){}Object.defineProperties(Qy.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});Qy.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;Qy.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;Qy.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;Qy.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;Qy.prototype.tileXYToRectangle=fe.throwInstantiationError;Qy.prototype.positionToTileXY=fe.throwInstantiationError;var eY=Qy;function rC(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,ze.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(rC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(u(t)&&(this._clockSubscription(),this._clockSubscription=void 0),u(e)&&(this._clockSubscription=e.onTick.addEventListener(rC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(u(t)&&t.removeEventListener("seeked",this._seekFunction,!1),u(e)&&(this._seeking=!1,this._seekFunction=Vit(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});rC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};rC.prototype.isDestroyed=function(){return!1};rC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};rC.prototype._onTick=function(e){let t=this._element;if(!u(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=y(this.epoch,ze.MINIMUM_VALUE),s=ee.secondsDifference(r,o),a=t.duration,c,l=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-l)>f&&(this._seeking=!0,t.currentTime=c)};function Vit(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var tY=rC;function kit(e,t){this.rectangle=e,this.maxLevel=t}function nY(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}nY.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function zit(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new ji({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),l=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new kit(new ce(a,c,l,f),d))}}function Hit(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw u(t)&&u(t.message)&&(i=`${i}: ${t.message}`),xi.reportError(void 0,n,u(n)?n._errorEvent:void 0,i),new de(i)}async function M_e(e,t,n){try{let i=await t.fetchXML();zit(e,i)}catch(i){Hit(t,i,n)}}function $y(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;if(typeof t=="string"&&(t=new Dt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[],u(e.url)){$("VRTheWorldTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. VRTheWorldTerrainProvider.fromUrl instead.");let n=this,i=new nY(e),r=we.createIfNeeded(e.url);this._resource=r,this._readyPromise=M_e(i,r,n).then(()=>(i.build(n),!0))}}Object.defineProperties($y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});$y.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new nY(t),i=we.createIfNeeded(e);await M_e(n,i);let r=new $y(t);return n.build(r),r._resource=i,r};$y.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!u(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Pa({buffer:od(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Git(a,e,t,n),structure:a._terrainDataStructure})})};$y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var R_e=new ce;function Git(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let l=o[c];if(l.maxLevel<=i)continue;let f=l.rectangle,d=ce.intersection(f,s,R_e);u(d)&&(Az(r,f,t*2,n*2,i+1)&&(a|=4),Az(r,f,t*2+1,n*2,i+1)&&(a|=8),Az(r,f,t*2,n*2+1,i+1)&&(a|=1),Az(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function Az(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return u(ce.intersection(o,t,R_e))}$y.prototype.getTileDataAvailable=function(e,t,n){};$y.prototype.loadTileDataAvailability=function(e,t,n){};var iY=$y;var Wit={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},rY=Object.freeze(Wit);function jit(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var oY=jit;function qit(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var vL=qit;var Yit={SATELLITE:1,OCEANS:2,HILLSHADE:3},gm=Object.freeze(Yit);var sY,B_e="AAPKd815e334cb774973b7245e23a67f4d08Js7A8e8xvfBpgnZIzp1jbL3FWJTmx7AKG8wa87OwDcWEu4CxQCNiydpPbGpALiTf",oS={};oS.defaultAccessToken=B_e;oS.defaultWorldImageryServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});oS.defaultWorldHillshadeServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});oS.defaultWorldOceanServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});oS.getDefaultTokenCredit=function(e){if(e===B_e){if(!u(sY)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';sY=new Dt(t,!0)}return sY}};var Bu=oS;function aY(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=we.createIfNeeded(e.missingImageUrl),n=this;function i(o){u(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=od(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,l=e.pixelsToCheck;for(let f=0,d=l.length;a&&f<d;++f){let p=l[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}aY.prototype.isReady=function(){return this._isReady};aY.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!u(n)||u(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=od(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let l=0;l<4;++l){let f=c+l;if(i[f]!==n[f])return!1}}return!0};var wL=aY;function cY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}cY.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}u(n)&&(this.name=e[n])};cY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];u(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var ym=cY;function sS(){fe.throwInstantiationError()}Object.defineProperties(sS.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});sS.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};sS.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};sS.prototype.pickFeatures=function(e,t,n,i,r){fe.throwInstantiationError()};var Xit=/\.ktx2$/i;sS.loadImage=function(e,t){let n=we.createIfNeeded(t);return Xit.test(n.url)?cl(n):u(e)&&u(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Qc=sS;function lY(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new ji({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Dt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}lY.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!u(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new wL({missingImageUrl:N_e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Kit(e,t){let n=e.tileInfo;if(!u(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new No({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new ji({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,u(e.fullExtent)){if(u(e.fullExtent.spatialReference)&&u(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Oi,r=e.fullExtent,o=i.unproject(new m(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}u(e.copyrightText)&&e.copyrightText.length>0&&(u(t.credit)?t.tileCredits=[new Dt(e.copyrightText)]:t.credit=new Dt(e.copyrightText))}function Jit(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw u(t)&&u(t.message)&&(i+=`: ${t.message}`),xi.reportError(void 0,n,u(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function L_e(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let r=await i.fetchJson();Kit(r,t)}catch(r){Jit(e,r,n)}}function Ih(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new ji({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new Dt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new _e,this._ready=!1,u(e.url)){$("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=we.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,u(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new lY(e);i.useTiles?this._readyPromise=L_e(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}Ih.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,r;switch(e){case gm.SATELLITE:{n=y(t.token,Bu.defaultAccessToken),i=we.createIfNeeded(y(t.url,Bu.defaultWorldImageryServer)),i.appendForwardSlash();let o=Bu.getDefaultTokenCredit(n);u(o)&&(r=Dt.clone(o))}break;case gm.OCEANS:{n=y(t.token,Bu.defaultAccessToken),i=we.createIfNeeded(y(t.url,Bu.defaultWorldOceanServer)),i.appendForwardSlash();let o=Bu.getDefaultTokenCredit(n);u(o)&&(r=Dt.clone(o))}break;case gm.HILLSHADE:{n=y(t.token,Bu.defaultAccessToken),i=we.createIfNeeded(y(t.url,Bu.defaultWorldHillshadeServer)),i.appendForwardSlash();let o=Bu.getDefaultTokenCredit(n);u(o)&&(r=Dt.clone(o))}break;default:}return Ih.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function N_e(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ii?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(Ih.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ih.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=we.createIfNeeded(e);n.appendForwardSlash(),u(t.token)&&n.setQueryParameters({token:t.token});let i=new Ih(t);i._resource=n;let r=new lY(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await L_e(n,r),r.build(i),i._readyPromise=Promise.resolve(!0),i};Ih.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Ih.prototype.requestImage=function(e,t,n,i){return Qc.loadImage(this,N_e(this,e,t,n,i))};Ih.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ii)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let l="visible";u(this._layers)&&(l+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:l};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!u(h))return g;for(let A=0;A<h.length;++A){let x=h[A],C=new ym;if(C.data=x,C.name=x.value,C.properties=x.attributes,C.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let T=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)C.position=he.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(T===102100||T===900913||T===3857){let E=new Oi;C.position=E.unproject(new m(x.geometry.x,x.geometry.y,x.geometry.z))}}g.push(C)}return g})};Ih._metadataCache={};var Ph=Ih;function oC(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new mi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(oC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(u(e))return e[e.length-1].getColorTexture(0)}}});function F_e(e){let t=e._framebuffers;if(!u(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Zit(e,t){F_e(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new mi,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function U_e(e){let t=e._commands;if(!u(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Qit(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function $it(e,t){let n=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -float sampleTexture(vec2 offset) { -`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); - return czm_luminance(color.rgb); -`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r; -`,n+=`} +#ifdef FRAGMENT_DEPTH_CHECK + if (sizeInMeters) { + translate /= mpp; + dimensions /= mpp; + imageSize /= mpp; + } -`,n+=`uniform vec2 colorTextureDimensions; -uniform vec2 minMaxLuminance; -uniform sampler2D previousLuminance; -void main() { - float color = 0.0; - float xStep = 1.0 / colorTextureDimensions.x; - float yStep = 1.0 / colorTextureDimensions.y; - int count = 0; - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 3; ++j) { - vec2 offset; - offset.x = -xStep + float(i) * xStep; - offset.y = -yStep + float(j) * yStep; - if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { - continue; - } - color += sampleTexture(offset); - ++count; - } - } - if (count > 0) { - color /= float(count); - } -`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); - color = previous + (color - previous) / (60.0 * 1.5); - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); -`),n+=` out_FragColor = vec4(color); -} -`,n}function ert(e,t){U_e(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand($it(o,i),{framebuffer:n[o].framebuffer,uniformMap:Qit(e,o)});e._commands=r}oC.prototype.clear=function(e){let t=this._framebuffers;if(!u(t))return;let n=this._clearCommand;u(n)||(n=this._clearCommand=new ri({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};oC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Zit(this,e),ert(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};oC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!u(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};oC.prototype.isDestroyed=function(){return!1};oC.prototype.destroy=function(){return F_e(this),U_e(this),ue(this)};var DL=oC;var trt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},aS=Object.freeze(trt);function IL(e){}IL.prototype.isReady=function(){return!0};IL.prototype.shouldDiscardImage=function(e){return IL.EMPTY_IMAGE===e};var xz;Object.defineProperties(IL,{EMPTY_IMAGE:{get:function(){return u(xz)||(xz=new Image,xz.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),xz}}});var cS=IL;function uY(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}uY.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof Dt)break;r.credit=new Dt(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],l=c.bbox;c.bbox=new ce(P.toRadians(l[1]),P.toRadians(l[0]),P.toRadians(l[3]),P.toRadians(l[2]))}}e._ready=!0};function nrt(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function irt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw u(t)&&u(t.message)&&(i+=`: ${t.message}`),xi.reportError(void 0,n,u(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function V_e(e,t,n){let i=e.url,r=_s._metadataCache[i];u(r)||(r=e.fetchJsonp("jsonp"),_s._metadataCache[i]=r);try{let o=await r;return nrt(o,t)}catch(o){irt(e,o,n)}}function _s(e){if(e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,aS.AERIAL),this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,u(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new cS),this._proxy=e.proxy,this._credit=new Dt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${_s.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new No({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new _e,this._ready=!1,u(e.url)){$("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;u(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=we.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),r=new uY(e);this._readyPromise=V_e(i,r,this).then(()=>(r.build(this),!0))}}Object.defineProperties(_s.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});_s.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;u(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,aS.AERIAL),r=we.createIfNeeded(e);r.appendForwardSlash();let o=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new _s(t);s._resource=r;let a=new uY(t);return await V_e(o,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var rrt=new ce;_s.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,rrt);return art(this._attributionList,n,i)};_s.prototype.requestImage=function(e,t,n,i){let r=Qc.loadImage(this,ort(this,e,t,n,i));if(u(r))return r.catch(function(o){return u(o.blob)&&o.blob.size===0?cS.EMPTY_IMAGE:Promise.reject(o)})};_s.prototype.pickFeatures=function(e,t,n,i,r){};_s.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;e&o&&(s|=1),t&o&&(s|=2),i+=s}return i};_s.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];s&1&&(t|=o),s&2&&(n|=o)}return{x:t,y:n,level:i}};_s._logoUrl=void 0;Object.defineProperties(_s,{logoUrl:{get:function(){return u(_s._logoUrl)||(_s._logoUrl=en("Assets/Images/bing_maps_credit.png")),_s._logoUrl},set:function(e){_s._logoUrl=e}}});function ort(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:_s.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var srt=new ce;function art(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let l=0,f=s.coverageAreas.length;!c&&l<f;++l){let d=a[l];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,srt);u(p)&&(c=!0)}}c&&i.push(s.credit)}return i}_s._metadataCache={};var lS=_s;var crt=new m(1,1,1);function fY(e){e=y(e,crt),this._dimensions=m.clone(e)}Object.defineProperties(fY.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var lrt=new m;fY.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,lrt),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=m.fromElements(i,r,o,e.position),e.velocity=m.normalize(e.position,e.velocity)};var dY=fY;var PL=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; +#if defined(ROTATION) || defined(ALIGNED_AXIS) + v_rotationMatrix = rotationMatrix; +#else + v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); +#endif -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) + float enableDepthCheck = 0.0; + if (lengthSq < disableDepthTestDistance) { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); + enableDepthCheck = 1.0; } - return value; -} -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} + float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); + float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); -vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) -{ - float a = roughness * roughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} + float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); + float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); -float G1_Smith(float NdotV, float k) -{ - return NdotV / (NdotV * (1.0 - k) + k); -} + v_compressed.x = eyeDepth; + v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; + v_compressed.z = dw * SHIFT_LEFT12 + dh; + v_compressed.w = iw * SHIFT_LEFT12 + ih; + v_originTextureCoordinateAndTranslate.xy = depthOrigin; + v_originTextureCoordinateAndTranslate.zw = translate; + v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; + +#endif + +#ifdef SDF + vec4 outlineColor; + float outlineWidth; + + temp = sdf.x; + temp = temp * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); + + temp = sdf.y; + temp = temp * SHIFT_RIGHT8; + float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.a = floor(temp); + outlineColor /= 255.0; + + v_outlineWidth = outlineWidth / 255.0; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency; +#endif + + v_pickColor = pickColor; + + v_color = color; + v_color.a *= translucency; -float G_Smith(float roughness, float NdotV, float NdotL) -{ - float k = roughness * roughness / 2.0; - return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); } +`;function vi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(r)&&(r=Ot.clone(r)),l(o)&&(o=It.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,We.NONE),this._verticalOrigin=y(e.verticalOrigin,Rn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,yi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=qn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var doe=vi.SHOW_INDEX=0,DU=vi.POSITION_INDEX=1,goe=vi.PIXEL_OFFSET_INDEX=2,C4e=vi.EYE_OFFSET_INDEX=3,T4e=vi.HORIZONTAL_ORIGIN_INDEX=4,A4e=vi.VERTICAL_ORIGIN_INDEX=5,E4e=vi.SCALE_INDEX=6,RU=vi.IMAGE_INDEX_INDEX=7,moe=vi.COLOR_INDEX=8,S4e=vi.ROTATION_INDEX=9,v4e=vi.ALIGNED_AXIS_INDEX=10,w4e=vi.SCALE_BY_DISTANCE_INDEX=11,I4e=vi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,P4e=vi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,D4e=vi.DISTANCE_DISPLAY_CONDITION=14,R4e=vi.DISABLE_DEPTH_DISTANCE=15;vi.TEXTURE_COORDINATE_BOUNDS=16;var hoe=vi.SDF_INDEX=17;vi.NUMBER_OF_PROPERTIES=18;function zr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(vi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,zr(this,doe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),zr(this,DU))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),zr(this,DU))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),zr(this,goe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ot.equals(t,e)||(this._scaleByDistance=Ot.clone(e,t),zr(this,w4e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ot.equals(t,e)||(this._translucencyByDistance=Ot.clone(e,t),zr(this,I4e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ot.equals(t,e)||(this._pixelOffsetScaleByDistance=Ot.clone(e,t),zr(this,P4e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),zr(this,C4e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,zr(this,T4e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,zr(this,A4e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,zr(this,E4e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),zr(this,moe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,zr(this,S4e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),zr(this,v4e))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,zr(this,RU))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,zr(this,RU))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,zr(this,moe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),zr(this,D4e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,zr(this,R4e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Ie?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(qn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,zr(this,RU))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),zr(this,DU)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,zr(this,doe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),zr(this,hoe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,zr(this,hoe))}}});vi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};vi.prototype._updateClamping=function(){vi._updateClamping(this._billboardCollection,this)};var bO=new me,poe=new m;vi._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,r=i.ellipsoid,o=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===We.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===We.NONE||!l(t._position))return;let c=r.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===We.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=r.cartesianToCartographic(d,bO);p.height+=c.height,r.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=o.updateHeight(c,u),me.clone(c,bO);let f=i.getHeight(c);l(f)&&(bO.height=f),r.cartographicToCartesian(bO,poe),u(poe)};vi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,r,o=this;function s(a){if(o._imageId!==t||o._image!==n||!Ye.equals(o._imageSubRegion,i))return;let c=e.textureCoordinates[a];o._imageWidth=e.texture.width*c.width,o._imageHeight=e.texture.height*c.height,o._imageIndex=a,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,zr(o,RU)}l(n)&&(r=e.addImage(t,n)),l(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,l(r)&&r.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),o._imageIndexPromise=void 0})};vi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};vi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ye.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ye.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};vi.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),zr(this,goe))};vi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};vi.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),zr(this,DU)};var _oe=new oe;vi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(F.multiplyByPoint(i,t,_oe),Qi.computeActualWgs84Position(n,_oe))};var yoe=new m;vi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=F.multiplyByPoint(e,t,yoe),a=Qi.wgs84WithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return H.add(a,i,a),a};var PU=new H(0,0);vi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new H),H.clone(this._pixelOffset,PU),H.add(PU,this._translate,PU);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,bO);r=a.cartographicToCartesian(c,yoe),i=F.IDENTITY}return vi._computeScreenSpacePosition(i,r,this._eyeOffset,PU,e,t)};vi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===yi.RIGHT?s-=i:e.horizontalOrigin===yi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?a-=r:e.verticalOrigin===Rn.CENTER&&(a-=r*.5),l(n)||(n=new Ye),n.x=s,n.y=a,n.width=i,n.height=r,n};vi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ye.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ot.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};vi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var gr=vi;var O4e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Ir=Object.freeze(O4e);var M4e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Os=Object.freeze(M4e);function jp(e,t,n,i,r){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}var L4e=new H(16,16);function Kg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,L4e);this._context=e.context,this._pixelFormat=y(e.pixelFormat,ct.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=qn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Kg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Lt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function N4e(e,t){let n=e._context,i=e.numberOfImages,r=2,o=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=r*(s+t.width+o),u=r*(a+t.height+o),f=s/c,d=a/u,p=new jp(new H(s+o,o),new H(c,a)),g=new jp(new H,new H(c,a),e._root,p),h=new jp(new H(o,a+o),new H(c,u)),x=new jp(new H,new H(c,u),g,h);for(let A=0;A<e._textureCoordinates.length;A++){let T=e._textureCoordinates[A];l(T)&&(T.x*=f,T.y*=d,T.width*=f,T.height*=d)}let b=new Lt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),C=new ea({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=r*(t.width+2*o),a=r*(t.height+2*o);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Lt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new jp(new H(o,o),new H(s,a))}}function OU(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,r=t.topRight.y-t.bottomLeft.y,o=i-n.width,s=r-n.height;if(o<0||s<0)return;if(o===0&&s===0)return t;if(o>s){t.childNode1=new jp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new jp(new H(a,t.bottomLeft.y),new H(t.topRight.x,t.topRight.y)))}else{t.childNode1=new jp(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new jp(new H(t.bottomLeft.x,a),new H(t.topRight.x,t.topRight.y)))}return OU(e,t.childNode1,n)}return OU(e,t.childNode1,n)||OU(e,t.childNode2,n)}}function xoe(e,t,n){let i=OU(e,e._root,t);if(l(i)){i.imageIndex=n;let r=e._texture.width,o=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/r,u=i.bottomLeft.y/o,f=s/r,d=a/o;e._textureCoordinates[n]=new Ye(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else N4e(e,t),xoe(e,t,n);e._guid=qn()}function boe(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return xoe(e,t,n),n}Kg.prototype.getImageIndex=function(e){return this._indexHash[e]};Kg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=boe(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};Kg.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Ie)&&(t=Ie.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(r){let o=boe(i,r);return i._indexHash[e]=o,o}),this._idHash[e]=n,n};Kg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new de(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(r){if(r===-1)return-1;let o=i._texture.width,s=i._texture.height,a=i._textureCoordinates[r],c=a.x+t.x/o,u=a.y+t.y/s,f=t.width/o,d=t.height/s,p=i._textureCoordinates.push(new Ye(c,u,f,d))-1;return i._indexHash[e]=p,i._guid=qn(),p})};Kg.prototype.isDestroyed=function(){return!1};Kg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Jg=Kg;var F4e=gr.SHOW_INDEX,TO=gr.POSITION_INDEX,Coe=gr.PIXEL_OFFSET_INDEX,Toe=gr.EYE_OFFSET_INDEX,B4e=gr.HORIZONTAL_ORIGIN_INDEX,k4e=gr.VERTICAL_ORIGIN_INDEX,U4e=gr.SCALE_INDEX,CO=gr.IMAGE_INDEX_INDEX,Aoe=gr.COLOR_INDEX,V4e=gr.ROTATION_INDEX,z4e=gr.ALIGNED_AXIS_INDEX,Eoe=gr.SCALE_BY_DISTANCE_INDEX,Soe=gr.TRANSLUCENCY_BY_DISTANCE_INDEX,voe=gr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,woe=gr.DISTANCE_DISPLAY_CONDITION,H4e=gr.DISABLE_DEPTH_DISTANCE,G4e=gr.TEXTURE_COORDINATE_BOUNDS,Ioe=gr.SDF_INDEX,r9=gr.NUMBER_OF_PROPERTIES,Sr,W4e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},j4e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function uf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(r9),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(uf.prototype,{length:{get:function(){return o9(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Poe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}uf.prototype.add=function(e){let t=new gr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};uf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};uf.prototype.removeAll=function(){Poe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function o9(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}uf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};uf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};uf.prototype.get=function(e){return o9(this),this._billboards[e]};var $6;function q4e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s+0,r[o+4]=s+2,r[o+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Y4e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function X4e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}uf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<r9;++i){let r=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function K4e(e,t,n,i,r,o){let s=[{index:Sr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[TO]},{index:Sr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[TO]},{index:Sr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Coe]},{index:Sr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Soe]},{index:Sr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Aoe]},{index:Sr.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Toe]},{index:Sr.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Eoe]},{index:Sr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[voe]},{index:Sr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[woe]},{index:Sr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[G4e]}];i&&s.push({index:Sr.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:X4e(e)}),l(r)&&s.push({index:Sr.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),o&&s.push({index:Sr.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[Ioe]});let a=i?t:4*t;return new Wp(e,s,a,i)}var Q6=new Yn;function Doe(e,t,n,i,r){let o,s=i[Sr.positionHighAndScale],a=i[Sr.positionLowAndRotation],c=r._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(c,Q6);let u=r.scale,f=r.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=Q6.high,p=Q6.low;e._instanced?(o=r._index,s(o,d.x,d.y,d.z,u),a(o,p.x,p.y,p.z,f)):(o=r._index*4,s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u),a(o+0,p.x,p.y,p.z,f),a(o+1,p.x,p.y,p.z,f),a(o+2,p.x,p.y,p.z,f),a(o+3,p.x,p.y,p.z,f))}var lf=new H,cf=32768,hA=65536,e9=4096,th=256,J4e=128,Z4e=32,$4e=8,Roe=4,Q4e=1/256,Ooe=0,Moe=2,Loe=3,Noe=1;function Foe(e,t,n,i,r){let o,s=i[Sr.compressedAttribute0],a=r.pixelOffset,c=a.x,u=a.y,f=r._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=r.horizontalOrigin,h=r._verticalOrigin,x=r.show&&r.clusterShow;r.color.alpha===0&&(x=!1),h===Rn.BASELINE&&(h=Rn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===yi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&h===Rn.CENTER;let b=0,C=0,A=0,T=0,S=r._imageIndex;if(S!==-1){let V=n[S];b=V.x,C=V.y,A=V.width,T=V.height}let v=b+A,I=C+T,O=Math.floor(D.clamp(c,-cf,cf)+cf)*J4e;O+=(g+1)*Z4e,O+=(h+1)*$4e,O+=(x?1:0)*Roe;let R=Math.floor(D.clamp(u,-cf,cf)+cf)*th,L=Math.floor(D.clamp(d,-cf,cf)+cf)*th,N=(D.clamp(p,-cf,cf)+cf)*Q4e,_=Math.floor(N),E=Math.floor((N-_)*th);R+=_,L+=E,lf.x=b,lf.y=C;let w=Xn.compressTextureCoordinates(lf);lf.x=v;let P=Xn.compressTextureCoordinates(lf);lf.y=I;let M=Xn.compressTextureCoordinates(lf);lf.x=b;let B=Xn.compressTextureCoordinates(lf);e._instanced?(o=r._index,s(o,O,R,L,w)):(o=r._index*4,s(o+0,O+Ooe,R,L,w),s(o+1,O+Moe,R,L,P),s(o+2,O+Loe,R,L,M),s(o+3,O+Noe,R,L,B))}function Boe(e,t,n,i,r){let o,s=i[Sr.compressedAttribute1],a=r.alignedAxis;m.equals(a,m.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=r.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,h=r._imageIndex;h!==-1&&(g=n[h].width);let x=e._textureAtlas.texture.width,b=Math.round(y(r.width,x*g));e._maxSize=Math.max(e._maxSize,b);let C=D.clamp(b,0,hA),A=0;Math.abs(m.magnitudeSquared(a)-1)<D.EPSILON6&&(A=Xn.octEncodeFloat(a)),u=D.clamp(u,0,1),u=u===1?255:u*255|0,C=C*th+u,d=D.clamp(d,0,1),d=d===1?255:d*255|0,A=A*th+d,e._instanced?(o=r._index,s(o,C,A,c,f)):(o=r._index*4,s(o+0,C,A,c,f),s(o+1,C,A,c,f),s(o+2,C,A,c,f),s(o+3,C,A,c,f))}function n9(e,t,n,i,r){let o,s=i[Sr.compressedAttribute2],a=r.color,c=l(e._batchTable)?z.WHITE:r.getPickId(t.context).color,u=r.sizeInMeters?1:0,f=Math.abs(m.magnitudeSquared(r.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=r._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,h=Math.round(y(r.height,g.y*d));e._maxSize=Math.max(e._maxSize,h);let x=y(r._labelHorizontalOrigin,-2);x+=2;let b=h*Roe+x,C=z.floatToByte(a.red),A=z.floatToByte(a.green),T=z.floatToByte(a.blue),S=C*hA+A*th+T;C=z.floatToByte(c.red),A=z.floatToByte(c.green),T=z.floatToByte(c.blue);let v=C*hA+A*th+T,I=z.floatToByte(a.alpha)*hA+z.floatToByte(c.alpha)*th;I+=u*2+f,e._instanced?(o=r._index,s(o,S,v,I,b)):(o=r._index*4,s(o+0,S,v,I,b),s(o+1,S,v,I,b),s(o+2,S,v,I,b),s(o+3,S,v,I,b))}function i9(e,t,n,i,r){let o,s=i[Sr.eyeOffset],a=r.eyeOffset,c=a.z;if(r._heightReference!==We.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=r._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}lf.x=u,lf.y=f;let p=Xn.compressTextureCoordinates(lf);o=r._index,s(o,a.x,a.y,c,p)}else o=r._index*4,s(o+0,a.x,a.y,c,0),s(o+1,a.x,a.y,c,0),s(o+2,a.x,a.y,c,0),s(o+3,a.x,a.y,c,0)}function koe(e,t,n,i,r){let o,s=i[Sr.scaleByDistance],a=0,c=1,u=1,f=1,d=r.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function Uoe(e,t,n,i,r){let o,s=i[Sr.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=r.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function Voe(e,t,n,i,r){let o,s=i[Sr.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=r.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=r.disableDepthTestDistance,d=r.heightReference===We.CLAMP_TO_GROUND&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(r._labelDimensions))g=r._labelDimensions.x,p=r._labelDimensions.y;else{let C=0,A=0,T=r._imageIndex;if(T!==-1){let v=n[T];C=v.height,A=v.width}p=Math.round(y(r.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(r.width,S*A))}let h=Math.floor(D.clamp(g,0,e9)),x=Math.floor(D.clamp(p,0,e9)),b=h*e9+x;e._instanced?(o=r._index,s(o,a,c,f,b)):(o=r._index*4,s(o+0,a,c,f,b),s(o+1,a,c,f,b),s(o+2,a,c,f,b),s(o+3,a,c,f,b))}function zoe(e,t,n,i,r){if(r.heightReference===We.CLAMP_TO_GROUND){let h=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&C}let o,s=i[Sr.textureCoordinateBoundsOrLabelTranslate];if(Ht.maximumVertexTextureImageUnits>0){let h=0,x=0;l(r._labelTranslate)&&(h=r._labelTranslate.x,x=r._labelTranslate.y),e._instanced?(o=r._index,s(o,h,x,0,0)):(o=r._index*4,s(o+0,h,x,0,0),s(o+1,h,x,0,0),s(o+2,h,x,0,0),s(o+3,h,x,0,0));return}let a=0,c=0,u=0,f=0,d=r._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,u=h.width,f=h.height}let p=a+u,g=c+f;e._instanced?(o=r._index,s(o,a,c,p,g)):(o=r._index*4,s(o+0,a,c,p,g),s(o+1,a,c,p,g),s(o+2,a,c,p,g),s(o+3,a,c,p,g))}function eHe(e,t,n,i,r){if(!l(e._batchTable))return;let o=i[Sr.a_batchId],s=r._batchIndex,a;e._instanced?(a=r._index,o(a,s)):(a=r._index*4,o(a+0,s),o(a+1,s),o(a+2,s),o(a+3,s))}function Hoe(e,t,n,i,r){if(!e._sdf)return;let o,s=i[Sr.sdf],a=r.outlineColor,c=r.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*hA+f*th+d,g=c/Os.RADIUS,h=z.floatToByte(a.alpha)*hA+z.floatToByte(g)*th;e._instanced?(o=r._index,s(o,p,h)):(o=r._index*4,s(o+0,p+Ooe,h),s(o+1,p+Moe,h),s(o+2,p+Loe,h),s(o+3,p+Noe,h))}function tHe(e,t,n,i,r){Doe(e,t,n,i,r),Foe(e,t,n,i,r),Boe(e,t,n,i,r),n9(e,t,n,i,r),i9(e,t,n,i,r),koe(e,t,n,i,r),Uoe(e,t,n,i,r),Voe(e,t,n,i,r),zoe(e,t,n,i,r),eHe(e,t,n,i,r),Hoe(e,t,n,i,r)}function t9(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=gr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function nHe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(o,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&t9(e,i,i.length,t,o,!0)):n===ne.MORPHING?t9(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&t9(e,r,e._billboardsToUpdateIndex,t,o,!1)}function iHe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function rHe(e,t){let n=`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; +void main() +{ + out_FragColor = texture(billboard_texture, v_textureCoordinates); +} +`,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Ee.OVERLAY,i}var oHe=[];uf.prototype.update=function(e){if(o9(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,Sr=this._instanced?j4e:W4e,$6=this._instanced?Y4e:q4e;let r=this._textureAtlas;if(!l(r)){r=this._textureAtlas=new Jg({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let o=r.textureCoordinates;if(o.length===0)return;nHe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<r9;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=K4e(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let R=0;R<n;++R){let L=this._billboards[R];L._dirty=!1,tHe(this,e,o,d,L)}this._vaf.commit($6(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=oHe;R.length=0,(c[TO]||c[V4e]||c[U4e])&&R.push(Doe),(c[CO]||c[Coe]||c[B4e]||c[k4e]||c[F4e])&&(R.push(Foe),this._instanced&&R.push(i9)),(c[CO]||c[z4e]||c[Soe])&&(R.push(Boe),R.push(n9)),(c[CO]||c[Aoe])&&R.push(n9),c[Toe]&&R.push(i9),c[Eoe]&&R.push(koe),c[voe]&&R.push(Uoe),(c[woe]||c[H4e]||c[CO]||c[TO])&&R.push(Voe),(c[CO]||c[TO])&&R.push(zoe),c[Ioe]&&R.push(Hoe);let L=R.length;if(d=this._vaf.writers,a/n>.1){for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let E=0;E<L;++E)R[E](this,e,o,d,_)}this._vaf.commit($6(i))}else{for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let E=0;E<L;++E)R[E](this,e,o,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,x=F.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),iHe(this,e,h);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Ir.OPAQUE||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Ir.TRANSLUCENT;this._blendOption===Ir.TRANSLUCENT||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,A,T,S,v,I=Ht.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=xO,A=yO,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),T=new ze({defines:v,sources:[C]}),this._instanced&&T.defines.push("INSTANCED"),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?T.defines.push("VERTEX_DEPTH_CHECK"):T.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Os.CUTOFF;this._sdf&&T.defines.push("SDF");let L=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT&&(S=new ze({defines:["OPAQUE",L],sources:[A]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:Sr}),S=new ze({defines:["TRANSLUCENT",L],sources:[A]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:Sr})),this._blendOption===Ir.OPAQUE&&(S=new ze({defines:[L],sources:[A]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:Sr})),this._blendOption===Ir.TRANSLUCENT&&(S=new ze({defines:[L],sources:[A]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:Sr})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,L=this._blendOption===Ir.OPAQUE,N=this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,E=_.length,w=this._uniforms,P;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),P=this._batchTable.getPickId()):P="v_pickColor",R.length=E;let M=N?E*2:E;for(let B=0;B<M;++B){let V=R[B];l(V)||(V=R[B]=new tt);let U=L||N&&B%2===0;V.pass=U||!N?Ee.OPAQUE:Ee.TRANSLUCENT,V.owner=this;let G=N?Math.floor(B/2):B;V.boundingVolume=h,V.modelMatrix=x,V.count=_[G].indicesCount,V.shaderProgram=U?this._sp:this._spTranslucent,V.uniformMap=w,V.vertexArray=_[G].va,V.renderState=U?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId=P,this._instanced&&(V.count=6,V.instanceCount=n),O.push(V)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=rHe(this,e.context)),O.push(this.debugCommand))}};uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Poe(this._billboards),ue(this)};var au=uf;function sHe(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var Wx=sHe;function ta(e,t,n,i,r){this._content=e,this._billboard=n,this._label=i,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),pA(this)}var aHe=new me;Object.defineProperties(ta.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),pA(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,pA(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),pA(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,pA(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,aHe);i.height=i.height-t+e;let r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&pA(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ta.defaultColor=z.WHITE;ta.defaultPointOutlineColor=z.BLACK;ta.defaultPointOutlineWidth=0;ta.defaultPointSize=8;function pA(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ta.defaultColor),i=y(e._pointOutlineColor,ta.defaultPointOutlineColor),r=y(e._pointOutlineWidth,ta.defaultPointOutlineWidth),o=y(e._pointSize,ta.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,Wx(f,d,p,r,o))}ta.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ta.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ta.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ta.prototype.getPropertyInherited=function(e){return ws.getPropertyInherited(this._content,this._batchId,e)};ta.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ta.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ta.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ta.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var qp=ta;function cHe(e,t,n,i,r){let o=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=o.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),r&&(g.fillStyle="black",g.fillText(t,u/2,p));let h=g.getImageData(0,0,f,d).data,x=h.length,b=f*4,C,A,T,S;for(C=0;C<x;++C)if(h[C]!==255){T=C/b|0;break}for(C=x-1;C>=0;--C)if(h[C]!==255){S=C/b|0;break}let v=-1;for(C=0;C<f&&v===-1;++C)for(A=0;A<d;++A){let I=C*4+A*b;if(h[I]!==255||h[I+1]!==255||h[I+2]!==255||h[I+3]!==255){v=C;break}}return{width:o.width,height:S-T,ascent:p-T,descent:S-p,minx:v-u/2}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}var jx;function lHe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),r=y(t.fill,!0),o=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(jx)||(l(f.imageSmoothingEnabled)?jx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?jx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?jx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(jx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[jx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=cHe(f,e,n,i,r);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,h=d.height+c,x=h-d.ascent+a,b=h-x+c;if(u.width=g,u.height=h,f.font=n,f.lineJoin="round",f.lineWidth=o,f[jx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let C=y(t.strokeColor,z.BLACK);f.strokeStyle=C.toCssColorString(),f.strokeText(e,p+a,b)}if(r){let C=y(t.fillColor,z.WHITE);f.fillStyle=C.toCssColorString(),f.fillText(e,p+a,b)}return u}var qx=lHe;var Qoe=Ki(qoe(),1);var fHe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Hr=Object.freeze(fHe);var Yoe={},Xoe=0,dHe=256,mHe=new z(.165,.165,.165,.8),hHe=new H(7,5),is=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Yx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function EO(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function SO(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Joe(e){let t=Yoe[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(SO(n,"line-height"));isNaN(i)&&(i=void 0),t={family:SO(n,"font-family"),size:SO(n,"font-size").replace("px",""),style:SO(n,"font-style"),weight:SO(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Xoe<dHe&&(Yoe[e._font]=t,Xoe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Yp(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(r)&&(r=Ot.clone(r)),l(o)&&(o=It.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,mHe)),this._backgroundPadding=H.clone(y(e.backgroundPadding,hHe)),this._style=y(e.style,Hr.FILL),this._verticalOrigin=y(e.verticalOrigin,Rn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,yi.LEFT),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._position=m.clone(y(e.position,m.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=y(e.heightReference,We.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Joe(this),this._updateClamping()}Object.defineProperties(Yp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),EO(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=Yp.enableRightToLeftDetection?bHe(t):t,Yx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Yx(this),Joe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),Yx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Yx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Yx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Yx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;H.equals(t,e)||(H.clone(e,t),EO(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Yx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!H.equals(t,e)){H.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Ot.equals(t,e)){this._translucencyByDistance=Ot.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Ot.equals(t,e)){this._pixelOffsetScaleByDistance=Ot.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Ot.equals(t,e)){this._scaleByDistance=Ot.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,EO(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),EO(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),EO(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!It.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});Yp.prototype._updateClamping=function(){gr._updateClamping(this._labelCollection,this)};Yp.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new H);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return gr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Yp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,r=0,o=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?r-=s:e.verticalOrigin===Rn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let h=d[g],x=h.billboard;if(!l(x))continue;let b=t.x+x._translate.x,C=t.y-x._translate.y,A=h.dimensions.width*a,T=h.dimensions.height*a;e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?C-=T:e.verticalOrigin===Rn.CENTER&&(C-=T*.5),e._verticalOrigin===Rn.TOP?C+=Os.PADDING*a:(e._verticalOrigin===Rn.BOTTOM||e._verticalOrigin===Rn.BASELINE)&&(C-=Os.PADDING*a),i=Math.min(i,b),r=Math.min(r,C),u=Math.max(u,b+A),f=Math.max(f,C+T)}o=u-i,s=f-r}return l(n)||(n=new Ye),n.x=i,n.y=r,n.width=o,n.height=s,n};Yp.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&H.equals(this._backgroundPadding,e._backgroundPadding)&&H.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ot.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Yp.prototype.isDestroyed=function(){return!1};Yp.enableRightToLeftDetection=!1;function pHe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=is.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=is.RTL:n.test(f)?a=is.LTR:i.test(f)?a=is.BRACKETS:a=is.WEAK,u===0&&(s=a),s===a&&a!==is.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function _He(e){return e.split("").reverse().join("")}function vO(e,t,n){return e.slice(0,t)+n+e.slice(t)}function gHe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var yHe="\u05D0-\u05EA",xHe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Koe=new RegExp(`[${yHe}${xHe}]`);function bHe(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Koe.test(r.charAt(0)),s=pHe(r,Koe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===is.BRACKETS?gHe(f.Word):_He(f.Word);o?f.Type===is.RTL?(c=d+c,a=0):f.Type===is.LTR?(c=vO(c,a,f.Word),a+=f.Word.length):(f.Type===is.WEAK||f.Type===is.BRACKETS)&&(f.Type===is.WEAK&&s[u-1].Type===is.BRACKETS?c=d+c:s[u-1].Type===is.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===is.RTL?(c=d+c,a=0):(c=vO(c,a,f.Word),a+=f.Word.length):c=vO(c,0,d)):f.Type===is.RTL?c=vO(c,a,d):f.Type===is.LTR?(c+=f.Word,a=c.length):(f.Type===is.WEAK||f.Type===is.BRACKETS)&&(u>0&&s[u-1].Type===is.RTL?s.length>u+1?s[u+1].Type===is.RTL?c=vO(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var Zg=Yp;var ese=Ki(Zoe(),1);function THe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function AHe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var EHe=1.2,tse="ID_WHITE_PIXEL",s9=new H(4,4),SHe=new Ye(1,1,1,1);function vHe(e){let t=document.createElement("canvas");t.width=s9.x,t.height=s9.y;let n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(tse,t)}var ff={};function wHe(e,t,n,i,r,o,s){return ff.font=t,ff.fillColor=n,ff.strokeColor=i,ff.strokeWidth=r,ff.padding=Os.PADDING,s===Rn.CENTER?ff.textBaseline="middle":s===Rn.TOP?ff.textBaseline="top":ff.textBaseline="bottom",ff.fill=o===Hr.FILL||o===Hr.FILL_AND_OUTLINE,ff.stroke=o===Hr.OUTLINE||o===Hr.FILL_AND_OUTLINE,ff.backgroundColor=z.BLACK,qx(e,ff)}function a9(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function IHe(e,t,n,i){i.index=e.addImageSync(t,n)}var PHe=new ese.default;function DHe(e,t){let n=t._renderedText,i=PHe.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length,a,c,u;if(t._relativeSize=t._fontSize/Os.FONT_SIZE,r<s)for(c=r;c<s;++c)a9(e,o[c]);o.length=r;let f=t._showBackground&&n.split(` +`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:tse,imageSubRegion:SHe}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=yi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<r;++u){let h=i[u],x=t._verticalOrigin,b=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=g[b];if(!l(C)){let A=`${t._fontStyle} ${t._fontWeight} ${Os.FONT_SIZE}px ${t._fontFamily}`,T=wHe(h,A,z.WHITE,z.WHITE,0,Hr.FILL,x);if(C=new AHe(e,-1,T.dimensions),g[b]=C,T.width>0&&T.height>0){let S=(0,Qoe.default)(T,{cutoff:Os.CUTOFF,radius:Os.RADIUS}),v=T.getContext("2d"),I=T.width,O=T.height,R=v.getImageData(0,0,I,O);for(let L=0;L<I;L++)for(let N=0;N<O;N++){let _=N*I+L,E=S[_]*255,w=_*4;R.data[w+0]=E,R.data[w+1]=E,R.data[w+2]=E,R.data[w+3]=E}v.putImageData(R,0,0),h!==" "&&IHe(e._textureAtlas,b,T,C)}}if(a=o[u],l(a)?C.index===-1?a9(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new THe,o[u]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let A=a.billboard,T=e._spareBillboards;l(A)||(T.length>0?A=T.pop():(A=e._billboardCollection.add({collection:e}),A._labelDimensions=new H,A._labelTranslate=new H),a.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=yi.LEFT,A.verticalOrigin=t._verticalOrigin,A.heightReference=t._heightReference,A.scale=t.totalScale,A.pickPrimitive=t,A.id=t._id,A.image=b,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,A.scaleByDistance=t._scaleByDistance,A.distanceDisplayCondition=t._distanceDisplayCondition,A.disableDepthTestDistance=t._disableDepthTestDistance,A._batchIndex=t._batchIndex,A.outlineColor=t.outlineColor,t.style===Hr.FILL_AND_OUTLINE?(A.color=t._fillColor,A.outlineWidth=t.outlineWidth):t.style===Hr.FILL?(A.color=t._fillColor,A.outlineWidth=0):t.style===Hr.OUTLINE&&(A.color=z.TRANSPARENT,A.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function $oe(e,t,n){return t===yi.CENTER?-e/2:t===yi.RIGHT?-(e+n.x):n.x}var ao=new H,RHe=new H;function OHe(e){let t=e._glyphs,n=e._renderedText,i,r,o=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(l(g)?e._backgroundPadding:H.ZERO,RHe);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` +`?(a.push(o),++f,o=0):(i=t[d],r=i.dimensions,u=Math.max(u,r.height-r.descent),c=Math.max(c,r.descent),o+=r.width-r.minx,d<p-1&&(o+=t[d+1].dimensions.minx),s=Math.max(s,o));a.push(o);let x=u+c,b=e.totalScale,C=e._horizontalOrigin,A=e._verticalOrigin,T=0,S=a[T],v=$oe(S,C,h),I=(l(e._lineHeight)?e._lineHeight:EHe*e._fontSize)/e._relativeSize,O=I*(f-1),R=s,L=x+O;l(g)&&(R+=h.x*2,L+=h.y*2,g._labelHorizontalOrigin=C),ao.x=v*b,ao.y=0;let N=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` +`)++T,_+=I,S=a[T],v=$oe(S,C,h),ao.x=v*b,N=!0;else if(i=t[d],r=i.dimensions,A===Rn.TOP?(ao.y=r.height-u-h.y,ao.y+=Os.PADDING):A===Rn.CENTER?ao.y=(O+r.height-u)/2:A===Rn.BASELINE?(ao.y=O,ao.y-=Os.PADDING):(ao.y=O+c+h.y,ao.y-=Os.PADDING),ao.y=(ao.y-r.descent-_)*b,N&&(ao.x-=Os.PADDING*b,N=!1),l(i.billboard)&&(i.billboard._setTranslate(ao),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=L,i.billboard._labelHorizontalOrigin=C),d<p-1){let E=t[d+1];ao.x+=(r.width-r.minx+E.dimensions.minx)*b}if(l(g)&&n.split(` +`).join("").length>0&&(C===yi.CENTER?v=-s/2-h.x:C===yi.RIGHT?v=-(s+h.x*2):v=0,ao.x=v*b,A===Rn.TOP?ao.y=x-u-c:A===Rn.CENTER?ao.y=(x-u)/2-c:A===Rn.BASELINE?ao.y=-h.y-c:ao.y=0,ao.y=ao.y*b,g.width=R,g.height=L,g._setTranslate(ao),g._labelTranslate=H.clone(ao,g._labelTranslate)),e.heightReference===We.CLAMP_TO_GROUND)for(d=0;d<p;++d){i=t[d];let E=i.billboard;l(E)&&(E._labelTranslate=H.clone(ao,E._labelTranslate))}}function nse(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)a9(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function nh(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new au({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new au({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(nh.prototype,{length:{get:function(){return this._labels.length}}});nh.prototype.add=function(e){let t=new Zg(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};nh.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),nse(this,e),!0}return!1};nh.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)nse(this,e[t]);e.length=0};nh.prototype.contains=function(e){return l(e)&&e._labelCollection===this};nh.prototype.get=function(e){return this._labels[e]};nh.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new Jg({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Jg({context:i,initialSize:s9}),n.textureAtlas=this._backgroundTextureAtlas,vHe(this._backgroundTextureAtlas));let r=this._labelsToUpdate.length;for(let s=0;s<r;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(DHe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(OHe(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let o=n.length>0?Ir.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};nh.prototype.isDestroyed=function(){return!1};nh.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var ih=nh;var wO=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; -vec2 integrateBrdf(float roughness, float NdotV) +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; + +void main() { - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - for (int i = 0; i < NumSamples; i++) + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; + + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; + + if (width < 1.0) { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = G_Smith(roughness, NdotV, NdotL); - float G_Vis = G * VdotH / (NdotH * NdotV); - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } + show = 0.0; } - return vec2(A, B) / float(NumSamples); -} -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;function OL(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(OL.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function urt(e,t,n){let i=t.createViewportQuadCommand(PL,{framebuffer:n,renderState:Ve.fromCache({viewport:new Ye(0,0,256,256)})});e._drawCommand=i}OL.prototype.update=function(e){if(!u(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:fn.NEAREST});this._colorTexture=n;let i=new Ys({context:t,colorTextures:[n],destroyAttachments:!1});urt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};OL.prototype.isDestroyed=function(){return!1};OL.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var ML=OL;var frt=new H;function drt(e,t){let n=e.unionClippingRegions,i=e.length,r=cs.useFloatTexture(t),o=cs.getTextureResolution(e,t,frt),s=o.x,a=o.y,c=r?prt(s,a):_rt(s,a);return c+=` -`,c+=n?mrt(i):hrt(i),c}function mrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount; - float pixelWidth = czm_metersPerPixel(position); - bool breakAndDiscard = false; - for (int i = 0; i < ${e}; ++i) + vec4 pickColor = batchTable_getPickColor(batchTableIndex); + + vec4 p, prev, next; + if (czm_morphTime == 1.0) { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) - { - breakAndDiscard = true; - break; - } + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); } - if (breakAndDiscard) { - discard; + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } - return clipAmount; -} -`}function hrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - bool clipped = true; - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount = 0.0; - float pixelWidth = czm_metersPerPixel(position); - for (int i = 0; i < ${e}; ++i) + else { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - } - if (clipped) - { - discard; + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); } - return clipAmount; -} -`}function prt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) -{ - int pixY = clippingPlaneNumber / ${e}; - int pixX = clippingPlaneNumber - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -`}function _rt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) -{ - int clippingPlaneStartIndex = clippingPlaneNumber * 2; - int pixY = clippingPlaneStartIndex / ${e}; - int pixX = clippingPlaneStartIndex - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); - return czm_transformPlane(plane, transform); -} -`}var L_=drt;var RL=`// See Intersection.glsl for the definition of intersectScene -// See IntersectionUtils.glsl for the definition of nextIntersection -// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl -// for the definition of convertUvToShapeUvSpace. The appropriate function is -// selected based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See Octree.glsl for the definitions of TraversalData, SampleData, -// traverseOctreeFromBeginning, and traverseOctreeFromExisting -// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture -#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops -#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; -uniform float u_stepSize; + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } -#if defined(PICKING) - uniform vec4 u_pickColor; -#endif + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } + #endif -#if defined(JITTER) -float hash(vec2 p) -{ - vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale - p3 += dot(p3, p3.yzx + 19.19); - return fract((p3.x + p3.y) * p3.z); -} -#endif + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; -vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { -#if defined(SHAPE_BOX) - Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); - RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); - vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; - float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); - float dt = (exit - entry.w) * RAY_SCALE; - return vec4(normalize(entry.xyz), dt); -#else - float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); - return vec4(viewRay.dir, u_stepSize / dimAtLevel); -#endif + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; } +`;var zc={};zc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};zc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var MHe=new me;zc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,MHe).height}return i};var LHe=new F,NHe=new m,ise=new m,FHe=new un(m.UNIT_X,0),rse=new m,BHe=new un(m.UNIT_X,0),kHe=new m,UHe=new m,l9=[];function sse(e,t,n){let i=l9;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var NU=new me,LU=new me,$g=new m,u9=new m,VHe=new m,c9=new $u,IO=new xa;function zHe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,u9),u=i.scaleToGeodeticSurface(t,VHe),f=zc.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,NU),p=i.cartesianToCartographic(u,LU),g=sse(f,r,o);c9.setEndPoints(d,p);let h=c9.surfaceDistance/f,x=a;d.height=r;let b=i.cartographicToCartesian(d,$g);m.pack(b,s,x),x+=3;for(let C=1;C<f;C++){let A=c9.interpolateUsingSurfaceDistance(C*h,LU);A.height=g[C],b=i.cartographicToCartesian(A,$g),m.pack(b,s,x),x+=3}return x}function HHe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,NU),u=i.cartesianToCartographic(t,LU),f=zc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=sse(f,r,o);IO.ellipsoid.equals(i)||(IO=new xa(void 0,void 0,i)),IO.setEndPoints(c,u);let p=IO.surfaceDistance/f,g=a;c.height=r;let h=i.cartographicToCartesian(c,$g);m.pack(h,s,g),g+=3;for(let x=1;x<f;x++){let b=IO.interpolateUsingSurfaceDistance(x*p,LU);b.height=d[x],h=i.cartographicToCartesian(b,$g),m.pack(h,s,g),g+=3}return g}zc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let r=F.inverseTransformation(t,LHe),o=F.multiplyByPoint(r,m.ZERO,NHe),s=m.normalize(F.multiplyByPointAsVector(r,m.UNIT_Y,ise),ise),a=un.fromPointNormal(o,s,FHe),c=m.normalize(F.multiplyByPointAsVector(r,m.UNIT_X,rse),rse),u=un.fromPointNormal(o,c,BHe),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let h=e[g];if(un.getPointDistance(u,d)<0||un.getPointDistance(u,h)<0){let x=$i.lineSegmentPlane(d,h,a,kHe);if(l(x)){let b=m.multiplyByScalar(s,5e-9,UHe);un.getPointDistance(a,d)<0&&m.negate(b,b),n.push(m.add(x,b,new m)),i.push(f+1),m.negate(b,b),n.push(m.add(x,b,new m)),f=1}}n.push(m.clone(e[g])),f++,d=h}i.push(f)}return{positions:n,lengths:i}};zc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],u9);if(r=o?r[0]:r,r!==0){let b=i.geodeticSurfaceNormal(x,$g);m.multiplyByScalar(b,r,b),m.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,D.RADIANS_PER_DEGREE);s=D.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=zc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],C=o?r[c]:r,A=o?r[c+1]:r;d=zHe(x,b,s,i,C,A,f,d)}l9.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,NU);g.height=o?r[n-1]:r;let h=i.cartographicToCartesian(g,$g);return m.pack(h,f,u-3),f};var ose=new me,GHe=new me;zc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],u9);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(C,$g);m.multiplyByScalar(A,r,A),m.add(C,A,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,D.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],ose),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],GHe),a+=zc.numberOfPointsRhumbLine(u,f,s),u=me.clone(f,ose);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let C=t[c],A=t[c+1],T=o?r[c]:r,S=o?r[c+1]:r;g=HHe(C,A,s,i,T,S,p,g)}l9.length=0;let h=t[n-1],x=i.cartesianToCartographic(h,NU);x.height=o?r[n-1]:r;let b=i.cartographicToCartesian(x,$g);return m.pack(b,p,d-3),p};zc.generateCartesianArc=function(e){let t=zc.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};zc.generateCartesianRhumbArc=function(e){let t=zc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};var Oi=zc;function cu(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Wi.fromType(Wi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Er(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Oi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(cse),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var ase=cu.POSITION_INDEX=0,WHe=cu.SHOW_INDEX=1,jHe=cu.WIDTH_INDEX=2,qHe=cu.MATERIAL_INDEX=3,PO=cu.POSITION_SIZE_INDEX=4,YHe=cu.DISTANCE_DISPLAY_CONDITION=5,cse=cu.NUMBER_OF_PROPERTIES=6;function Xp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(cu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Xp(this,WHe))}},positions:{get:function(){return this._positions},set:function(e){let t=Er(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Xp(this,PO),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Xp(this,ase),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Xp(this,qHe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Xp(this,jHe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Xp(this,PO)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Xp(this,YHe))}}});cu.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[ase]>0||this._propertiesChanged[PO]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Oi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)Xp(this,PO);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){Xp(this,PO);break}}};cu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};cu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<cse-1;++t)e[t]=0};cu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var df=cu;var XHe=df.SHOW_INDEX,KHe=df.WIDTH_INDEX,d9=df.POSITION_INDEX,JHe=df.MATERIAL_INDEX,lse=df.POSITION_SIZE_INDEX,ZHe=df.DISTANCE_DISPLAY_CONDITION,_se=df.NUMBER_OF_PROPERTIES,Sl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Fd(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(_se),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Fd.prototype,{length:{get:function(){return m9(this),this._polylines.length}}});Fd.prototype.add=function(e){let t=new df(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Fd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Fd.prototype.removeAll=function(){h9(this),Cse(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Fd.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Fd.prototype.get=function(e){return m9(this),this._polylines[e]};function $He(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new z0(t,n,e._polylines.length)}var gse=new Yn,yse=new oe,xse=new H;Fd.prototype.update=function(e){if(m9(this),this._polylines.length===0||!this.show)return;rGe(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ht.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");$He(this,t),this._createBatchTable=!1}if(this._createVertexArray||eGe(this))dse(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[lse]||r[JHe])dse(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let h in f)if(f.hasOwnProperty(h)){if(f[h]===p){r[d9]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[h].lengthOfPositions}if((r[XHe]||r[KHe])&&this._batchTable.setBatchedAttribute(i._index,0,new H(i._width,i._show)),this._batchTable.attributes.length>2){if(r[d9]||r[lse]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Yn.fromCartesian(h.center,gse),b=oe.fromElements(x.low.x,x.low.y,x.low.z,h.radius,yse);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(r[ZHe]){let h=xse;h.x=0,h.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(h.x=x.near,h.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<_se;++c)r[c]=0;let o=F.IDENTITY;e.mode===ne.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ue.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ue.fromCache({blending:dn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;QHe(this,e,c,o)}};var DO=new ae,use=new ae;function QHe(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let h=0;h<g;++h){let x=u[h],b=x.buckets,C=b.length;for(let A=0;A<C;++A){let T=b[A],S=T.offset,v=T.bucket.shaderProgram,I=T.bucket.polylines,O=I.length,R,L,N=0,_,E;for(let w=0;w<O;++w){let P=I[w],M=nGe(P._material);if(M!==R){if(l(R)&&N>0){let G=L.isTranslucent();a>=s?(_=new tt({owner:e}),n.push(_)):_=n[a],++a,E=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(DO,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?Ee.TRANSLUCENT:Ee.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=N,_.offset=S,S+=N,N=0,c=!0,o.push(_)}L=P._material,L.update(r),R=M}let B=P._locatorBuckets,V=B.length;for(let G=0;G<V;++G){let k=B[G];k.locator===T&&(N+=k.count)}let U;t.mode===ne.SCENE3D?U=P._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?U=P._boundingVolume2D:t.mode===ne.SCENE2D?l(P._boundingVolume2D)&&(U=ae.clone(P._boundingVolume2D,use),U.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(U=ae.union(P._boundingVolumeWC,P._boundingVolume2D,use)),c?(c=!1,ae.clone(U,DO)):ae.union(U,DO,DO)}l(R)&&N>0&&(a>=s?(_=new tt({owner:e}),n.push(_)):_=n[a],++a,E=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(DO,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?Ee.TRANSLUCENT:Ee.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=N,_.offset=S,c=!0,o.push(_)),R=void 0}}n.length=a}Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return bse(this),h9(this),Cse(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function eGe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[d9]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var fse=[0,0,0];function dse(e,t,n){e._createVertexArray=!1,h9(e),bse(e),iGe(e);let i=[[]],r=i[0],o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),C,A=0,T=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,b,A,T,S,o,t,n),h===ne.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,A));let E=g.lengthOfPositions;A+=6*E*3,T+=E*4,S+=E*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,I=Fe.STATIC_DRAW;e._positionBuffer=mt.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(C)&&(O=mt.createVertexBuffer({context:t,typedArray:C,usage:v})),e._texCoordExpandAndBatchIndexBuffer=mt.createVertexBuffer({context:t,typedArray:b,usage:I});let R=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let E=0;E<_;++E)if(r=i[E],r.length>0){let w=new Uint16Array(r),P=mt.createIndexBuffer({context:t,typedArray:w,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT});N+=a[E];let M=6*(E*(R*D.SIXTY_FOUR_KILOBYTES)-N*R),B=R+M,V=R+B,U=R+V,G=R+U,k=R+G,Y=E*(L*D.SIXTY_FOUR_KILOBYTES)-N*L,j=[{index:Sl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Sl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Sl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Sl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Sl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Sl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Sl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Sl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Sl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Sl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Sl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Sl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Sl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:Y}],J,W,K,Z;h===ne.SCENE3D?(W=e._positionBuffer,J="vertexBuffer",K=fse,Z="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(W=fse,J="value",K=e._positionBuffer,Z="vertexBuffer"):(W=O,J="vertexBuffer",K=e._positionBuffer,Z="vertexBuffer"),j[0][J]=W,j[1][J]=W,j[2][Z]=K,j[3][Z]=K,j[4][J]=W,j[5][J]=W,j[6][Z]=K,j[7][Z]=K,j[8][J]=W,j[9][J]=W,j[10][Z]=K,j[11][Z]=K;let he=new si({context:t,attributes:j,indexBuffer:P});e._vertexArrays.push({va:he,buckets:u[E]})}}}function tGe(e,t){return t instanceof Lt?t.id:t}var FU=[];function nGe(e){let t=Wi._uniformList[e.type],n=t.length;FU.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];FU[i]=o,FU[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(FU,tGe)}`}function iGe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new rh(c,t,n)),u.addPolyline(a)}}}function rGe(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function m9(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function h9(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function bse(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Fd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Cse(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function f9(e,t,n){this.count=e,this.offset=t,this.bucket=n}function rh(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}rh.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};rh.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Wt.isInternetExplorer()||i.push("CLIP_POLYLINE");let r=new ze({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,$0]}),o=t.getVertexShaderCallback()(wO),s=new ze({defines:i,sources:[Ql,o]});this.shaderProgram=Jt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Sl})};function Tse(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(un.ORIGIN_ZX_PLANE)===en.INTERSECTING}rh.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!Tse(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var ds=new m,mf=new m,hf=new m,BU=new m,oGe=new oe,sGe=new H;rh.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],h=g.width,x=g.show&&h>0,b=g._index,C=this.getSegments(g,a),A=C.positions,T=C.lengths,S=A.length,v=g.getPickId(s).color,I=0,O=0,R;for(let V=0;V<S;++V){V===0?g._loop?R=A[S-2]:(R=BU,m.subtract(A[0],A[1],R),m.add(A[0],R,R)):R=A[V-1],m.clone(R,mf),m.clone(A[V],ds),V===S-1?g._loop?R=A[1]:(R=BU,m.subtract(A[S-1],A[S-2],R),m.add(A[S-1],R,R)):R=A[V+1],m.clone(R,hf);let U=T[I];V===O+U&&(O+=U,++I);let G=V-O===0,k=V===O+T[I]-1;c===ne.SCENE2D&&(mf.z=0,ds.z=0,hf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(ds.x)<1&&((ds.x<0&&mf.x>0||ds.x>0&&mf.x<0)&&m.clone(ds,mf),(ds.x<0&&hf.x>0||ds.x>0&&hf.x<0)&&m.clone(ds,hf));let Y=G?2:0,j=k?2:4;for(let J=Y;J<j;++J){Yn.writeElements(ds,e,n),Yn.writeElements(mf,e,n+6),Yn.writeElements(hf,e,n+12);let W=J-2<0?-1:1;t[r]=V/(S-1),t[r+1]=2*(J%2)-1,t[r+2]=W,t[r+3]=b,n+=6*3,r+=4}}let L=oGe;L.x=z.floatToByte(v.red),L.y=z.floatToByte(v.green),L.z=z.floatToByte(v.blue),L.w=z.floatToByte(v.alpha);let N=sGe;N.x=h,N.y=x?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,E=Yn.fromCartesian(_.center,gse),w=E.high,P=oe.fromElements(E.low.x,E.low.y,E.low.z,_.radius,yse),M=xse;M.x=0,M.y=Number.MAX_VALUE;let B=g.distanceDisplayCondition;l(B)&&(M.x=B.near,M.y=B.far),o.setBatchedAttribute(b,0,N),o.setBatchedAttribute(b,1,L),o.attributes.length>2&&(o.setBatchedAttribute(b,2,w),o.setBatchedAttribute(b,3,P),o.setBatchedAttribute(b,4,M))}};var aGe=new m,cGe=new m,lGe=new m,mse=new m;rh.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=mse,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,cGe);let h=F.multiplyByPoint(n,a[p],aGe),x;p===u-1?s._loop?x=a[1]:(x=mse,m.subtract(a[u-1],a[u-2],x),m.add(a[u-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,lGe);let b=c[f];p===d+b&&(d+=b,++f);let C=p-d===0,A=p===d+c[f]-1,T=C?2:0,S=A?2:4;for(let v=T;v<S;++v)Yn.writeElements(h,e,t),Yn.writeElements(g,e,t+6),Yn.writeElements(x,e,t+12),t+=6*3}}};var uGe=new Array(1);rh.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new f9(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=uGe;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let x=0;for(let b=0;b<h;++b){let C=g[b]-1;for(let A=0;A<C;++A)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new f9(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:x}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new f9(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};rh.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var _A={positions:void 0,lengths:void 0},hse=new Array(1),fGe=new m,dGe=new me;rh.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return hse[0]=n.length,_A.positions=n,_A.lengths=hse,_A;Tse(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=fGe;for(let u=0;u<s;++u)a=n[u],c=F.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,dGe)));if(r.length>0){e._boundingVolume2D=ae.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(u.z,u.x,u.y)}return _A.positions=r,_A.lengths=e._segments.lengths,_A};var pse;rh.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=pse,c=6*s*3;!l(a)||a.length<c?a=pse=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,h=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=BU,m.subtract(f[0],f[1],x),m.add(f[0],x,x)):x=f[b-1],m.clone(x,mf),m.clone(f[b],ds),b===s-1?t._loop?x=f[1]:(x=BU,m.subtract(f[s-1],f[s-2],x),m.add(f[s-1],x,x)):x=f[b+1],m.clone(x,hf);let C=d[g];b===h+C&&(h+=C,++g);let A=b-h===0,T=b===h+d[g]-1;r===ne.SCENE2D&&(mf.z=0,ds.z=0,hf.z=0),(r===ne.SCENE2D||r===ne.MORPHING)&&(A||T)&&o-Math.abs(ds.x)<1&&((ds.x<0&&mf.x>0||ds.x>0&&mf.x<0)&&m.clone(ds,mf),(ds.x<0&&hf.x>0||ds.x>0&&hf.x<0)&&m.clone(ds,hf));let S=A?2:0,v=T?2:4;for(let I=S;I<v;++I)Yn.writeElements(ds,a,p),Yn.writeElements(mf,a,p+6),Yn.writeElements(hf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Bd=Fd;function Qg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new au({batchTable:e.batchTable}),this._labelCollection=new ih({batchTable:e.batchTable}),this._polylineCollection=new Bd,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Qg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function mGe(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ce.packedLength+re.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ce.pack(n,s,a),a+=ce.packedLength,re.pack(t,s,a),s}var hGe=new bi("createVectorTilePoints",5),pGe=new m;function _Ge(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=mGe(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=hGe.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let h=d[g],x=m.unpack(n,g*3,pGe),b=c.add();b.position=x,b._batchIndex=h;let C=u.add();C.text=" ",C.position=x,C._batchIndex=h;let A=f.add();A.positions=[m.clone(x),m.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Qg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new qp(e,c,u,f,d)}};Qg.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function gGe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=qp.defaultPointSize,s.color=qp.defaultColor,s.pointOutlineColor=qp.defaultPointOutlineColor,s.pointOutlineWidth=qp.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Hr.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new H(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=yi.CENTER,s.verticalOrigin=Rn.CENTER,s.labelHorizontalOrigin=yi.RIGHT,s.labelVerticalOrigin=Rn.BASELINE}}var yGe=new z,xGe=new z,bGe=new z,CGe=new z,TGe=new z,AGe=new z,RO=new Ot,OO=new Ot,p9=new It;Qg.prototype.applyStyle=function(e,t){if(!l(e)){gGe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,yGe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,xGe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,bGe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,CGe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,TGe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(RO.near=a.x,RO.nearValue=a.y,RO.far=a.z,RO.farValue=a.w,s.scaleByDistance=RO):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(OO.near=a.x,OO.nearValue=a.y,OO.far=a.z,OO.farValue=a.w,s.translucencyByDistance=OO):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(p9.near=a.x,p9.far=a.y,s.distanceDisplayCondition=p9):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,AGe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Qg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=_Ge(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Qg.prototype.isDestroyed=function(){return!1};Qg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var MO=Qg;function Kp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,m.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Gn.BOTH}Object.defineProperties(Kp.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function EGe(e){let t=new Float64Array(3+m.packedLength+re.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,ce.pack(e._rectangle,t,n),t}function SGe(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=On.unpack(t,n),n+=On.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new qm({color:c,offset:u,count:f,batchIds:p})}}var vGe=new bi("createVectorTilePolygons",5),wGe=new z;function IGe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,h=s.length;for(let x=0;x<h;++x){let b=g.getColor(x,wGe);s[x]=b.toRgba()}a=e._packedBuffer=EGe(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=vGe.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),x=h[0];SGe(e,h),e._indices=Be.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),PGe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function PGe(e){l(e._primitive)||(e._primitive=new gx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Kp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Kp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Kp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Kp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Kp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=IGe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var LO=Kp;var NO=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; void main() { - vec4 fragCoord = gl_FragCoord; - vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] - vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); - vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case - vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case - vec3 viewPosUv = u_cameraPositionUv; - #if defined(SHAPE_BOX) - vec3 dInv = 1.0 / viewDirUv; - Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); - #else - Ray viewRayUv = Ray(viewPosUv, viewDirUv); - #endif + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - Intersections ix; - RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; - // Exit early if the scene was completely missed. - if (shapeIntersection.entry.w == NO_HIT) { - discard; - } + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; +} +`;function kd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(kd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function DGe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var RGe=new bi("createVectorTilePolylines",5),gA={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function OGe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=DGe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=RGe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Be.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),MGe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function MGe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=mt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=mt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),d=mt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),h=mt.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Be.UNSIGNED_SHORT:Be.UNSIGNED_INT}),x=[{index:gA.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:gA.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:gA.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:gA.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:gA.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:x,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var FO=new F,Ase=new m;function LGe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,FO),F.multiplyByPoint(FO,e._center,Ase),F.setTranslation(FO,Ase,FO),FO},u_highlightColor:function(){return e._highlightColor}})}function NGe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:dn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var FGe=`uniform vec4 u_highlightColor; +void main() +{ + out_FragColor = u_highlightColor; +} +`;function BGe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(NO),r=n.getFragmentShaderCallback(!1,void 0,!1)(FGe),o=new ze({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ql,i]}),s=new ze({defines:["VECTOR_TILE"],sources:[r]});e._sp=Jt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:gA})}function kGe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ee.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}kd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};kd.prototype.getPositions=function(e){return kd.getPolylinePositions(this,e)};kd.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ws(e,o)}};kd.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function UGe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var VGe=new z,zGe=z.WHITE,HGe=!0;kd.prototype.applyStyle=function(e,t){if(!l(e)){UGe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,VGe):zGe,s.show=l(e.show)?e.show.evaluate(s):HGe}};kd.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=OGe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}LGe(this,t),BGe(this,t),NGe(this);let n=e.passes;(n.render||n.pick)&&kGe(this,e)};kd.prototype.isDestroyed=function(){return!1};kd.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var Xx=kd;var BO=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; - float currT = shapeIntersection.entry.w * RAY_SCALE; - float endT = shapeIntersection.exit.w; - vec3 positionUv = viewPosUv + currT * viewDirUv; - vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; - // Traverse the tree from the start position - TraversalData traversalData; - SampleData sampleDatas[SAMPLE_COUNT]; - traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); - vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; - #if defined(JITTER) - float noise = hash(screenCoord); // [0,1] - currT += noise * step.w; - positionUv += noise * step.w * viewDirUv; - #endif +void main() +{ + // vertex corner IDs + // 3-----------7 + // /| left /| + // / | 1 / | + // 2-----------6 5 end + // | / | / + // start |/ right |/ + // 0-----------4 + // + float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end + float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - FragmentInput fragmentInput; - #if defined(STATISTICS) - setStatistics(fragmentInput.metadata.statistics); - #endif + vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; + vec3 right = normalize(cross(forward, startEllipsoidNormal)); - vec4 colorAccum =vec4(0.0); + vec4 position = vec4(startPositionAndHeight.xyz, 1.0); + position.xyz += forward * isEnd; - for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { - // Read properties from the megatexture based on the traversal state - Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); + v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - // Prepare the custom shader inputs - copyPropertiesToMetadata(properties, fragmentInput.metadata); - fragmentInput.voxel.positionUv = positionUv; - fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; - fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; - fragmentInput.voxel.viewDirUv = viewDirUv; - fragmentInput.voxel.viewDirWorld = viewDirWorld; - fragmentInput.voxel.surfaceNormal = step.xyz; - fragmentInput.voxel.travelDistance = step.w; + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - // Run the custom shader - czm_modelMaterial materialOutput; - fragmentMain(fragmentInput, materialOutput); + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; - // Sanitize the custom shader output - vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); - color.rgb = max(color.rgb, vec3(0.0)); - color.a = clamp(color.a, 0.0, 1.0); + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; - // Pre-multiplied alpha blend - colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - // Stop traversing if the alpha has been fully saturated - if (colorAccum.a > ALPHA_ACCUM_MAX) { - colorAccum.a = ALPHA_ACCUM_MAX; - break; - } + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - if (step.w == 0.0) { - // Shape is infinitely thin. The ray may have hit the edge of a - // foreground voxel. Step ahead slightly to check for more voxels - step.w == 0.00001; - } - - // Keep raymarching - currT += step.w; - positionUv += step.w * viewDirUv; - - // Check if there's more intersections. - if (currT > endT) { - #if (INTERSECTION_COUNT == 1) - break; - #else - shapeIntersection = nextIntersection(ix); - if (shapeIntersection.entry.w == NO_HIT) { - break; - } else { - // Found another intersection. Resume raymarching there - currT = shapeIntersection.entry.w * RAY_SCALE; - endT = shapeIntersection.exit.w; - positionUv = viewPosUv + currT * viewDirUv; - } - #endif - } - - // Traverse the tree from the current ray position. - // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. - positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); - traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); - step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); - } + gl_Position = czm_depthClamp(czm_projection * position); - // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] - colorAccum.a /= ALPHA_ACCUM_MAX; + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - #if defined(PICKING) - // If alpha is 0.0 there is nothing to pick - if (colorAccum.a == 0.0) { - discard; - } - out_FragColor = u_pickColor; - #else - out_FragColor = colorAccum; - #endif + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; } -`;var BL=`in vec2 position; +`;var kO=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; -uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; +uniform vec4 u_highlightColor; +void main() +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -void main() { - vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; - vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; - vec2 translation = 0.5 * (aabbMax + aabbMin); - vec2 scale = 0.5 * (aabbMax - aabbMin); - gl_Position = vec4(position * scale + translation, 0.0, 1.0); -} -`;var LL=`/* Intersection defines -#define INTERSECTION_COUNT ### -*/ + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } -#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -#define RAY_SHIFT (0.000003163) -#define RAY_SCALE (1.003163) + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; -struct Ray { - vec3 pos; - vec3 dir; -#if defined(SHAPE_BOX) - vec3 dInv; -#endif -}; + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); -struct RayShapeIntersection { - vec4 entry; - vec4 exit; -}; + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); -struct Intersections { - // Don't access these member variables directly - call the functions instead. + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - // Store an array of ray-surface intersections. Each intersection is composed of: - // .xyz for the surface normal at the intersection point - // .w for the T value - // The scale of the normal encodes the shape intersection type: - // length(intersection.xyz) = 1: positive shape entry - // length(intersection.xyz) = 2: positive shape exit - // length(intersection.xyz) = 3: negative shape entry - // length(intersection.xyz) = 4: negative shape exit - // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, - // so we need twice as many to track ray-*surface* intersections - vec4 intersections[INTERSECTION_COUNT * 2]; + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - #if (INTERSECTION_COUNT > 1) - // Maintain state for future nextIntersection calls - int index; - int surroundCount; - bool surroundIsPositive; - #endif -}; + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + out_FragColor = u_highlightColor; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ - return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); + czm_writeDepthClamp(); } +`;function Jp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(oi._defaultMinTerrainHeight,oi._defaultMaxTerrainHeight),this._boundingVolume=On.fromRectangle(e.rectangle,oi._defaultMinTerrainHeight,oi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Jp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function GGe(e,t,n){let i=oi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;On.fromRectangle(c,r,o,n,a)}function WGe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var jGe=new bi("createVectorTileClampedPolylines"),ey={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function qGe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=WGe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=jGe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Be.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),YGe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function YGe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=mt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),g=mt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),h=mt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),x=mt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),b=mt.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),C=mt.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),A=mt.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Be.UNSIGNED_SHORT:Be.UNSIGNED_INT}),T=[{index:ey.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:ey.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:ey.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ey.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ey.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ey.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ey.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:T,indexBuffer:A}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var UO=new F,Ese=new m;function XGe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,UO),F.multiplyByPoint(UO,e._center,Ese),F.setTranslation(UO,Ese,UO),UO},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Sse(e){return Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:dn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Wn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Wn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function KGe(e){l(e._rs)||(e._rs=Sse(!1),e._rs3DTiles=Sse(!0))}function JGe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(BO),r=n.getFragmentShaderCallback(!1,void 0,!0)(kO),o=new ze({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ql,i]}),s=new ze({defines:["VECTOR_TILE"],sources:[r]});e._sp=Jt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:ey})}function ZGe(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ee.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=tt.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Gn.TERRAIN||i===Gn.BOTH)&&t.commandList.push(n),(i===Gn.CESIUM_3D_TILE||i===Gn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Jp.prototype.getPositions=function(e){return Xx.getPolylinePositions(this,e)};Jp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ws(e,o)}};Jp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $Ge(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var QGe=new z,e8e=z.WHITE,t8e=!0;Jp.prototype.applyStyle=function(e,t){if(!l(e)){$Ge(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,QGe):e8e,s.show=l(e.show)?e.show.evaluate(s):t8e}};function n8e(e){return oi.initialize().then(function(){GGe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Jp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=n8e(this).then(qGe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}XGe(this,t),JGe(this,t),KGe(this);let n=e.passes;(n.render||n.pick)&&ZGe(this,e)};Jp.prototype.isDestroyed=function(){return!1};Jp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var VO=Jp;var _9=32767,i8e=new me,r8e=new m;function o8e(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);Xn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],h=D.lerp(t.west,t.east,d/_9),x=D.lerp(t.south,t.north,p/_9),b=D.lerp(n,i,g/_9),C=me.fromRadians(h,x,b,i8e),A=r.cartographicToCartesian(C,r8e);m.pack(A,u,f*3)}return u}var zO=o8e;function oh(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),u8e(this,i,r)}Object.defineProperties(oh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function s8e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function a8e(e,t){let n,i,r,o,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Ud=Uint32Array.BYTES_PER_ELEMENT;function c8e(e){return new Xx(e)}function l8e(e){return new VO(e)}function u8e(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=Ud;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Ud;let s=r.getUint32(n,!0);if(n+=Ud,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=Ud,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Ud;let u=r.getUint32(n,!0);n+=Ud;let f=r.getUint32(n,!0);n+=Ud;let d=r.getUint32(n,!0);n+=Ud;let p=r.getUint32(n,!0);n+=Ud;let g=r.getUint32(n,!0);n+=Ud;let h=r.getUint32(n,!0);n+=Ud;let x=Lr(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let C,A;u>0&&(C=Lr(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A),n+=f));let T=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),I=T+S+v,O=new Tp(e,I,C,A,s8e(e));if(e._batchTable=O,I===0)return;let R=new Rd(x,b),L=R.getGlobalProperty("REGION");if(!l(L))throw new de("Feature table global property: REGION must be defined");let N=ce.unpack(L),_=L[4],E=L[5],w=e._tile.computedTransform,P=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(P)?(P=m.unpack(P),F.multiplyByPoint(w,P,P)):(P=ce.center(N),P.height=D.lerp(_,E,.5),P=re.WGS84.cartographicToCartesian(P));let M=a8e(x,b);if(n+=(4-n%4)%4,T>0){R.featuresLength=T;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(V))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=B.reduce(function(W,K){return W+K*2},0),G=V.reduce(function(W,K){return W+K},0),k=new Uint32Array(t,n,G);n+=d;let Y=new Uint16Array(t,n,U);n+=p;let j,J;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(j=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new LO({positions:Y,counts:B,indexCounts:V,indices:k,minimumHeight:_,maximumHeight:E,polygonMinimumHeights:j,polygonMaximumHeights:J,center:P,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:M.polygons,modelMatrix:w})}if(S>0){R.featuresLength=S;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(S);for(let J=0;J<S;++J)V[J]=2}let U=B.reduce(function(J,W){return J+W*3},0),G=new Uint16Array(t,n,U);n+=g;let k=e._tileset,Y=k.examineVectorLinesFunction;if(l(Y)){let J=zO(new Uint16Array(G),N,_,E,re.WGS84);f8e(J,B,M.polylines,O,e.url,Y)}let j=c8e;l(k.classificationType)&&(j=l8e),e._polylines=j({positions:G,widths:V,counts:B,batchIds:M.polylines,minimumHeight:_,maximumHeight:E,center:P,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=h,e._points=new MO({positions:B,batchIds:M.points,minimumHeight:_,maximumHeight:E,rectangle:N,batchTable:O})}}function g9(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}oh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};oh.prototype.getFeature=function(e){return l(this._features)||g9(this),this._features[e]};oh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};oh.prototype.applyStyle=function(e){l(this._features)||g9(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};oh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||g9(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};oh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};oh.prototype.isDestroyed=function(){return!1};oh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function f8e(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var HO=oh;var vse={b3dm:function(e,t,n,i,r){return eh.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return eh.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return eh.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return GP.fromTileType(e,t,n,i,r,vse)},externalTileset:function(e,t,n,i){return gO.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new jP(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new HO(e,t,n,i,r)},subt:function(e,t,n,i,r){return qT.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return qT.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new de("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return eh.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return eh.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return eh.fromGeoJson(e,t,n,i)}},Kx=vse;var d8e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Gr=Object.freeze(d8e);var Vd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Vd.isBinaryFormat=function(e){switch(e){case Vd.BATCHED_3D_MODEL:case Vd.INSTANCED_3D_MODEL:case Vd.COMPOSITE:case Vd.POINT_CLOUD:case Vd.VECTOR:case Vd.GEOMETRY:case Vd.IMPLICIT_SUBTREE:case Vd.VOXEL_BINARY:case Vd.GLTF_BINARY:return!0;default:return!1}};var ms=Object.freeze(Vd);var m8e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},pf=Object.freeze(m8e);var Ms={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Zp=new Array(Ms.NUMBER_OF_PASSES);Zp[Ms.RENDER]=Object.freeze({pass:Ms.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Zp[Ms.PICK]=Object.freeze({pass:Ms.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Zp[Ms.SHADOW]=Object.freeze({pass:Ms.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Zp[Ms.PRELOAD]=Object.freeze({pass:Ms.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Ms.PRELOAD_FLIGHT]=Object.freeze({pass:Ms.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Ms.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ms.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Ms.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ms.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Zp[Ms.MOST_DETAILED_PICK]=Object.freeze({pass:Ms.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ms.getPassOptions=function(e){return Zp[e]};var Fr=Object.freeze(Ms);function $p(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties($p.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},readyPromise:{get:function(){return Q("Empty3DTileContent.readyPromise","Empty3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Empty3DTileContent.ready to return true instead."),Promise.resolve(this)}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});$p.prototype.hasProperty=function(e,t){return!1};$p.prototype.getFeature=function(e){};$p.prototype.applyDebugSettings=function(e,t){};$p.prototype.applyStyle=function(e){};$p.prototype.update=function(e,t){};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){return ue(this)};var yA=$p;function Qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var GO=Qp;function y9(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){y9._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new GO({content:n,class:r})}}y9._oneTimeWarning=Nt;var Jx=y9;function h8e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var Zx=h8e;function e_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var WO=e_;function x9(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){x9._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new WO({tile:n,class:r})}}x9._oneTimeWarning=Nt;var jO=x9;function p8e(e){let t=new Uint8Array(e),n=Cd(t);if(n==="glTF"&&(n="glb"),ms.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=_8e(t);if(l(i.root))return{contentType:ms.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ms.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ms.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ms.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ms.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function _8e(e){let t;try{t=Lr(e)}catch{throw new de("Invalid tile content.")}return t}var sh=p8e;function zd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let r=l(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let s=0;s<o;s++){let a=n.getDerivedResource({url:r[s].uri}),c=Ua.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(zd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},readyPromise:{get:function(){return Q("Multiple3DTileContent.readyPromise","Multiple3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Multiple3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function b9(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function wse(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}zd.prototype.requestInnerContents=function(){if(!g8e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;b9(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=y8e(this,n,t,this._tile._contentState);return x8e(this)};function g8e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Ua.serverHasOpenSlots(n,t[n]))return!1;return Ua.heapHasOpenSlots(e.length)}function y8e(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new jr({throttle:!0,throttleByServer:!0,type:$o.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ni.CANCELLED){wse(e,i);return}return b9(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ni.CANCELLED){wse(e,i);return}b9(e,-1),Ise(e,t,f)}})}async function x8e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>b8e(e,o,s)),r=await Promise.all(i);return e._contentsCreated=!0,e._contents=r.filter(l),r}async function b8e(e,t,n){if(l(t))try{let i=sh(t);if(i.contentType===ms.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ms.GEOMETRY||i.contentType===ms.VECTOR;let r=e._tileset,o=e._innerContentResources[n],s=e._tile,a,c=Kx[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Jx(r,u));let f=Zx(r,u);return l(f)&&(a.group=new mx({metadata:f})),a}catch(i){Ise(e,n,i)}}function Ise(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}zd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};zd.prototype.hasProperty=function(e,t){return!1};zd.prototype.getFeature=function(e){};zd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};zd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};zd.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};zd.prototype.isDestroyed=function(){return!1};zd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var qO=zd;var Bse=Ki(Mse(),1);var F8e=new m,B8e=new m,ty={};ty.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};ty.computeWindingOrder2D=function(e){return ty.computeArea2D(e)>0?es.COUNTER_CLOCKWISE:es.CLOCKWISE};ty.triangulate=function(e,t){let n=H.packArray(e);return(0,Bse.default)(n,t,2)};var kse=new m,Use=new m,Vse=new m,Lse=new m,Nse=new m,Fse=new m,t_=new m,zse=new H,Hse=new H,Gse=new H,bA=new H;ty.computeSubdivision=function(e,t,n,i,r){r=y(r,D.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],h={},x=e.maximumRadius,b=D.chordLength(r,x),C=b*b;for(;s.length>0;){let T=s.pop(),S=s.pop(),v=s.pop(),I=m.fromArray(u,v*3,kse),O=m.fromArray(u,S*3,Use),R=m.fromArray(u,T*3,Vse),L,N,_;o&&(L=H.fromArray(f,v*2,zse),N=H.fromArray(f,S*2,Hse),_=H.fromArray(f,T*2,Gse));let E=m.multiplyByScalar(m.normalize(I,Lse),x,Lse),w=m.multiplyByScalar(m.normalize(O,Nse),x,Nse),P=m.multiplyByScalar(m.normalize(R,Fse),x,Fse),M=m.magnitudeSquared(m.subtract(E,w,t_)),B=m.magnitudeSquared(m.subtract(w,P,t_)),V=m.magnitudeSquared(m.subtract(P,E,t_)),U=Math.max(M,B,V),G,k,Y;U>C?M===U?(G=`${Math.min(v,S)} ${Math.max(v,S)}`,a=h[G],l(a)||(k=m.add(I,O,t_),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,o&&(Y=H.add(L,N,bA),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(v,a,T),s.push(a,S,T)):B===U?(G=`${Math.min(S,T)} ${Math.max(S,T)}`,a=h[G],l(a)||(k=m.add(O,R,t_),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,o&&(Y=H.add(N,_,bA),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(S,a,v),s.push(a,T,v)):V===U&&(G=`${Math.min(T,v)} ${Math.max(T,v)}`,a=h[G],l(a)||(k=m.add(R,I,t_),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,o&&(Y=H.add(_,L,bA),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(T,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(T))}let A={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Le.TRIANGLES};return o&&(A.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(A)};var k8e=new me,U8e=new me,V8e=new me,S9=new me;ty.computeRhumbLineSubdivision=function(e,t,n,i,r){r=y(r,D.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let I=i[a];f[p++]=I.x,f[p++]=I.y}}let g=[],h={},x=e.maximumRadius,b=D.chordLength(r,x),C=new xa(void 0,void 0,e),A=new xa(void 0,void 0,e),T=new xa(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),I=s.pop(),O=s.pop(),R=m.fromArray(u,O*3,kse),L=m.fromArray(u,I*3,Use),N=m.fromArray(u,v*3,Vse),_,E,w;o&&(_=H.fromArray(f,O*2,zse),E=H.fromArray(f,I*2,Hse),w=H.fromArray(f,v*2,Gse));let P=e.cartesianToCartographic(R,k8e),M=e.cartesianToCartographic(L,U8e),B=e.cartesianToCartographic(N,V8e);C.setEndPoints(P,M);let V=C.surfaceDistance;A.setEndPoints(M,B);let U=A.surfaceDistance;T.setEndPoints(B,P);let G=T.surfaceDistance,k=Math.max(V,U,G),Y,j,J,W,K;k>b?V===k?(Y=`${Math.min(O,I)} ${Math.max(O,I)}`,a=h[Y],l(a)||(j=C.interpolateUsingFraction(.5,S9),J=(P.height+M.height)*.5,W=m.fromRadians(j.longitude,j.latitude,J,e,t_),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,o&&(K=H.add(_,E,bA),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,I,v)):U===k?(Y=`${Math.min(I,v)} ${Math.max(I,v)}`,a=h[Y],l(a)||(j=A.interpolateUsingFraction(.5,S9),J=(M.height+B.height)*.5,W=m.fromRadians(j.longitude,j.latitude,J,e,t_),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,o&&(K=H.add(E,w,bA),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(I,a,O),s.push(a,v,O)):G===k&&(Y=`${Math.min(v,O)} ${Math.max(v,O)}`,a=h[Y],l(a)||(j=T.interpolateUsingFraction(.5,S9),J=(B.height+P.height)*.5,W=m.fromRadians(j.longitude,j.latitude,J,e,t_),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,o&&(K=H.add(w,_,bA),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,I),s.push(a,O,I)):(g.push(O),g.push(I),g.push(v))}let S={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Le.TRIANGLES};return o&&(S.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new ft(S)};ty.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,re.WGS84);let r=F8e,o=B8e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),m.multiplyByScalar(r,t,r),m.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var fi=ty;var Wse=Math.cos,jse=Math.sin,z8e=Math.sqrt,w9={};w9.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Wse(f),p=jse(f),g=a.z*p,h=c.longitude+i*e.granYSin+r*e.granXCos,x=d*Wse(h),b=d*jse(h),C=a.x*x,A=a.y*b,T=z8e(C*x+A*b+g*p);if(o.x=C/T,o.y=A/T,o.z=g/T,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+r*e.stGranXSin,h=S.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(h-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var H8e=new ir,_f=new m,G8e=new me,HU=new m,v9=new Pi;function qse(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;_f=v9.project(e,_f),_f=m.subtract(_f,HU,_f);let g=ir.fromRotation(t,H8e);_f=ir.multiplyByVector(g,_f,_f),_f=m.add(_f,HU,_f),e=v9.unproject(_f,e),o-=1,s-=1;let h=e.latitude,x=h+o*p,b=h-c*s,C=h-c*s+o*p,A=Math.max(h,x,b,C),T=Math.min(h,x,b,C),S=e.longitude,v=S+o*u,I=S+s*d,O=S+s*d+o*u,R=Math.max(S,v,I,O),L=Math.min(S,v,I,O);return{north:A,south:T,east:R,west:L,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}w9.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,h=u-f;c>a?g=D.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,b=Math.ceil(h/t)+1,C=g/(x-1),A=h/(b-1),T=ce.northwest(e,o),S=ce.center(e,G8e);(n!==0||i!==0)&&(S.longitude<T.longitude&&(S.longitude+=D.TWO_PI),HU=v9.project(S,HU));let v=A,I=C,O=0,R=0,L=ce.clone(e,r),N={granYCos:v,granYSin:O,granXCos:I,granXSin:R,nwCorner:T,boundingRectangle:L,width:x,height:b,northCap:d,southCap:p};if(n!==0){let _=qse(T,n,C,A,S,x,b);u=_.north,f=_.south,a=_.east,c=_.west,N.granYCos=_.granYCos,N.granYSin=_.granYSin,N.granXCos=_.granXCos,N.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=c}if(i!==0){n=n-i;let _=ce.northwest(L,s),E=qse(_,n,C,A,S,x,b);N.stGranYCos=E.granYCos,N.stGranXCos=E.granXCos,N.stGranYSin=E.granYSin,N.stGranXSin=E.granXSin,N.stNwCorner=_,N.stWest=E.west,N.stSouth=E.south}return N};var hs=w9;var W8e=new ae,j8e=new ae,q8e=new m,Y8e=new ce;function Yse(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,h,x=q8e;if(o)hs.computePosition(t,n,!1,g,0,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;else for(h=0;h<r;h++)hs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(h=r-1,g=1;g<i;g++)hs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;if(g=i-1,!s)for(h=r-2;h>=0;h--)hs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(h=0,g=i-2;g>0;g--)hs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let b=d.length/3*2,C=Be.createTypedArray(d.length/3,b),A=0;for(let S=0;S<d.length/3-1;S++)C[A++]=S,C[A++]=S+1;C[A++]=d.length/3-1,C[A++]=0;let T=new ft({attributes:new pn,primitiveType:Le.LINES});return T.attributes.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=C,T}function X8e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=i,s=n,a=Yse(e,t),c=t.height,u=t.width,f=fi.scaleToGeodeticHeight(a.attributes.position.values,s,r,!1),d=f.length,p=new Float64Array(d*2);p.set(f);let g=fi.scaleToGeodeticHeight(a.attributes.position.values,o,r);p.set(g,d),a.attributes.position.values=p;let h=t.northCap,x=t.southCap,b=4;h&&(b-=1),x&&(b-=1);let C=(p.length/3+b)*2,A=Be.createTypedArray(p.length/3,C);d=p.length/6;let T=0;for(let v=0;v<d-1;v++)A[T++]=v,A[T++]=v+1,A[T++]=v+d,A[T++]=v+d+1;A[T++]=d-1,A[T++]=0,A[T++]=d+d-1,A[T++]=d,A[T++]=0,A[T++]=d;let S;if(h)S=c-1;else{let v=u-1;A[T++]=v,A[T++]=v+d,S=u+c-2}if(A[T++]=S,A[T++]=S+d,!x){let v=u+S-1;A[T++]=v,A[T]=v+d}return a.indices=A,a}function TA(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,D.RADIANS_PER_DEGREE),i=y(e.ellipsoid,re.WGS84),r=y(e.rotation,0),o=y(e.height,0),s=y(e.extrudedHeight,o);this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}TA.packedLength=ce.packedLength+re.packedLength+5;TA.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Xse=new ce,Kse=re.clone(re.UNIT_SPHERE),CA={rectangle:Xse,ellipsoid:Kse,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};TA.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,Xse);t+=ce.packedLength;let r=re.unpack(e,t,Kse);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(CA.granularity=o,CA.height=s,CA.rotation=a,CA.extrudedHeight=c,CA.offsetAttribute=u===-1?void 0:u,new TA(CA))};var K8e=new me;TA.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=hs.computeOptions(t,e._granularity,e._rotation,0,Y8e,K8e),r,o;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(r=X8e(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===sn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===sn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,j8e),d=ae.fromRectangle3D(t,n,a,W8e);o=ae.union(f,d)}else{if(r=Yse(e,i),r.attributes.position.values=fi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===sn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ae.fromRectangle3D(t,n,s)}return new ft({attributes:r.attributes,indices:r.indices,primitiveType:Le.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var Qx=TA;function EA(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=y(e.ellipsoid,re.WGS84);e5e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(EA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});EA.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=On.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var Jse=new m,GU=new m,Zse=new m,J8e=new m,Z8e=new m,$8e=new m,Q8e=new m,gf=new me,$se=new un(m.UNIT_X,0),AA=new vn;function e5e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),gf.longitude=t.west,gf.latitude=(t.south+t.north)*.5,gf.height=0;let i=n.cartographicToCartesian(gf,$8e),r=m.cross(i,m.UNIT_Z,J8e);m.normalize(r,e.westNormal),gf.longitude=t.east;let o=n.cartographicToCartesian(gf,Q8e),s=m.cross(m.UNIT_Z,o,Jse);m.normalize(s,e.eastNormal);let a=m.subtract(i,o,Jse);m.magnitude(a)===0&&(a=m.clone(r,a));let c=m.normalize(a,Z8e),u=t.south,f;if(u>0){gf.longitude=(t.west+t.east)*.5,gf.latitude=u;let x=n.cartographicToCartesian(gf,AA.origin);m.clone(c,AA.direction);let b=un.fromPointNormal(e.southwestCornerCartesian,e.westNormal,$se);$i.rayPlane(AA,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,GU)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),GU);let d=m.cross(f,a,Zse);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){gf.longitude=(t.west+t.east)*.5,gf.latitude=p;let x=n.cartographicToCartesian(gf,AA.origin);m.negate(c,AA.direction);let b=un.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,$se);$i.rayPlane(AA,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,GU)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),GU);let h=m.cross(a,g,Zse);m.normalize(h,e.northNormal)}var t5e=new m,n5e=new m,i5e=new m(0,-1,0),r5e=new m(0,0,-1),Qse=new m;function o5e(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ce.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),t5e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),n5e),f.z=f.y,f.y=f.x,f.x=0,d=i5e,g=m.UNIT_Y,p=r5e,h=m.UNIT_Z);let x=m.subtract(i,u,Qse),b=m.dot(x,d),C=m.dot(x,p),A=m.subtract(i,f,Qse),T=m.dot(A,g),S=m.dot(A,h);b>0?o+=b*b:T>0&&(o+=T*T),C>0?o+=C*C:S>0&&(o+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}EA.prototype.distanceToCamera=function(e){let t=o5e(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};EA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};EA.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Qx({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ct({geometry:n,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var yf=EA;var JO={},s5e=new m,eae=new m,tae=new m,nae=new m,iae=new On;JO.validOutline=function(e){let n=On.fromPoints(e,iae).halfAxes,i=$.getColumn(n,0,eae),r=$.getColumn(n,1,tae),o=$.getColumn(n,2,nae),s=m.magnitude(i),a=m.magnitude(r),c=m.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};JO.computeProjectTo2DArguments=function(e,t,n,i){let r=On.fromPoints(e,iae),o=r.halfAxes,s=$.getColumn(o,0,eae),a=$.getColumn(o,1,tae),c=$.getColumn(o,2,nae),u=m.magnitude(s),f=m.magnitude(a),d=m.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,h;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(h=a),(p===u||p===f)&&(h=c),m.normalize(g,n),m.normalize(h,i),m.clone(r.center,t),!0};function rae(e,t,n,i,r){let o=m.subtract(e,t,s5e),s=m.dot(n,o),a=m.dot(i,o);return H.fromElements(s,a,r)}JO.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=rae(i[o],e,t,n);return r}};JO.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return rae(i,e,t,n,r)}};var n_=JO;function ny(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ny.prototype,{length:{get:function(){return this._length}}});ny.prototype.enqueue=function(e){this._array.push(e),this._length++};ny.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ny.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ny.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ny.prototype.clear=function(){this._array.length=this._offset=this._length=0};ny.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var iy=ny;var co={};co.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};co.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};co.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=co.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var eb=new H;function cae(e,t,n,i){return H.subtract(t,e,eb),H.multiplyByScalar(eb,n/i,eb),H.add(e,eb,eb),[eb.x,eb.y]}var ry=new m;function a5e(e,t,n,i){return m.subtract(t,e,ry),m.multiplyByScalar(ry,n/i,ry),m.add(e,ry,ry),[ry.x,ry.y,ry.z]}co.subdivideLineCount=function(e,t,n){let r=m.distance(e,t)/n,o=Math.max(0,Math.ceil(D.log2(r)));return Math.pow(2,o)};var I9=new me,P9=new me,c5e=new me,l5e=new m,oae=new xa;co.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,I9),o=e.cartesianToCartographic(n,P9),a=new xa(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};co.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=co.subdivideLineCount(n,i,r),a=H.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=cae(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};co.subdivideLine=function(e,t,n,i){let r=co.subdivideLineCount(e,t,n),o=m.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=a5e(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};co.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,I9),c=n.cartesianToCartographic(r,P9);oae.setEndPoints(a,c);let u=oae.surfaceDistance/o,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=H.distance(e,t),g=p/d,h=s;h.length=d*2;let x=0;for(let b=0;b<d;b++){let C=cae(e,t,b*g,p);h[x++]=C[0],h[x++]=C[1]}return h};co.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,I9),s=e.cartesianToCartographic(n,P9),a=new xa(o,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(r)||(r=[]);let p=r;p.length=f*3;let g=0;for(let h=0;h<f;h++){let x=a.interpolateUsingSurfaceDistance(h*d,c5e),b=e.cartographicToCartesian(x,l5e);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var u5e=new m,f5e=new m,d5e=new m,m5e=new m;co.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=y(i,re.WGS84);let o=u5e,s=f5e,a=d5e,c=m5e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)m.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(o,n,s),s=m.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=m.clone(a,c)),s=m.multiplyByScalar(o,t,s),s=m.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};co.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new iy;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Er(u,m.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Er(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};co.polygonsFromHierarchy=function(e,t,n,i,r){let o=[],s=[],a=new iy;for(a.enqueue(e);a.length!==0;){let c=a.dequeue(),u=c.positions,f=c.holes,d,p;if(i)for(p=u.length,d=0;d<p;d++)r.scaleToGeodeticSurface(u[d],u[d]);if(t||(u=Er(u,m.equalsEpsilon,!0)),u.length<3)continue;let g=n(u);if(!l(g))continue;let h=[],x=fi.computeWindingOrder2D(g);x===es.CLOCKWISE&&(g.reverse(),u=u.slice().reverse());let b=u.slice(),C=l(f)?f.length:0,A=[],T;for(d=0;d<C;d++){let S=f[d],v=S.positions;if(i)for(p=v.length,T=0;T<p;++T)r.scaleToGeodeticSurface(v[T],v[T]);if(t||(v=Er(v,m.equalsEpsilon,!0)),v.length<3)continue;let I=n(v);if(!l(I))continue;x=fi.computeWindingOrder2D(I),x===es.CLOCKWISE&&(I.reverse(),v=v.slice().reverse()),A.push(v),h.push(b.length),b=b.concat(v),g=g.concat(I);let O=0;for(l(S.holes)&&(O=S.holes.length),T=0;T<O;T++)a.enqueue(S.holes[T])}o.push({outerRing:u,holes:A}),s.push({positions:b,positions2D:g,holes:h})}return{hierarchy:o,polygons:s}};var h5e=new H,p5e=new m,_5e=new Ne,g5e=new $;co.computeBoundingRectangle=function(e,t,n,i,r){let o=Ne.fromAxisAngle(e,i,_5e),s=$.fromQuaternion(o,g5e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=m.clone(n[p],p5e);$.multiplyByVector(s,g,g);let h=t(g,h5e);l(h)&&(a=Math.min(a,h.x),c=Math.max(c,h.x),u=Math.min(u,h.y),f=Math.max(f,h.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};co.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=fi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let b=0;b<d;b++){let C=c[b];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let h={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Le.TRIANGLES};u&&(h.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H.packArray(f)}));let x=new ft(h);return o.normal?Bn.computeNormal(x):x}if(s===Zt.GEODESIC)return fi.computeSubdivision(e,c,a,f,i);if(s===Zt.RHUMB)return fi.computeRhumbLineSubdivision(e,c,a,f,i)};var sae=[],aae=[],y5e=new m,x5e=new m;co.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,h,x=e.length,b=0,C=0,A=l(t),T=A?t.positions:void 0;if(r)for(a=x*3*2,s=new Array(a*2),A&&(h=x*2*2,g=new Array(h*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,A&&(d=T[c],p=T[(c+1)%x],g[C]=g[C+h]=d.x,++C,g[C]=g[C+h]=d.y,++C,g[C]=g[C+h]=p.x,++C,g[C]=g[C+h]=p.y,++C);else{let R=D.chordLength(i,n.maximumRadius),L=0;if(o===Zt.GEODESIC)for(c=0;c<x;c++)L+=co.subdivideLineCount(e[c],e[(c+1)%x],R);else if(o===Zt.RHUMB)for(c=0;c<x;c++)L+=co.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(L+x)*3,s=new Array(a*2),A&&(h=(L+x)*2,g=new Array(h*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let N,_;A&&(d=T[c],p=T[(c+1)%x]),o===Zt.GEODESIC?(N=co.subdivideLine(u,f,R,aae),A&&(_=co.subdivideTexcoordLine(d,p,u,f,R,sae))):o===Zt.RHUMB&&(N=co.subdivideRhumbLine(n,u,f,R,aae),A&&(_=co.subdivideTexcoordRhumbLine(d,p,n,u,f,R,sae)));let E=N.length;for(let w=0;w<E;++w,++b)s[b]=N[w],s[b+a]=N[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,A){let w=_.length;for(let P=0;P<w;++P,++C)g[C]=_[P],g[C+h]=_[P];g[C]=p.x,g[C+h]=p.x,++C,g[C]=p.y,g[C+h]=p.y,++C}}}x=s.length;let S=Be.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,L=R+1,N=R+x,_=N+1;u=m.fromArray(s,R*3,y5e),f=m.fromArray(s,L*3,x5e),!m.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(S[v++]=R,S[v++]=N,S[v++]=L,S[v++]=L,S[v++]=N,S[v++]=_)}let I={attributes:new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Le.TRIANGLES};return A&&(I.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new ft(I)};var Kn=co;function b5e(e){let t=e.length,n=new Float64Array(t*3),i=Be.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new ft({attributes:s,indices:i,primitiveType:Le.LINES})}function tb(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Kn.computeHierarchyPackedLength(t,m)+1}tb.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new tb(t)};tb.pack=function(e,t,n){return n=y(n,0),n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var C5e={polygonHierarchy:{}};tb.unpack=function(e,t,n){t=y(t,0);let i=Kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new tb(C5e)),n._polygonHierarchy=i,n.packedLength=r,n};tb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Er(n,m.equalsEpsilon,!0),n.length<3||!n_.validOutline(n))return;let r=Kn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Ct({geometry:b5e(r[c])});o.push(u)}let s=Bn.combineInstances(o)[0],a=ae.fromPoints(t.positions);return new ft({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var xf=tb;var WU=new me;function ZO(e){let t=vp.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),r=y(e.ellipsoid,re.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=D5e(t,n,i,r);this._boundingPlanes=o;let s=L5e(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=B9(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=B9(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=B9(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();WU=r.cartesianToCartographic(c,WU),WU.height=(i+n)/2,this.center=r.cartographicToCartesian(WU,c),this._boundingSphere=ae.fromPoints(s)}var T5e=new m,A5e=new me,E5e=new m,S5e=new me,v5e=new m,w5e=new m,I5e=new m,P5e=new m;function D5e(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,T5e),a=i.cartesianToCartographic(o,A5e);a.height=n;let c=i.cartographicToCartesian(a,E5e),u=un.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,h;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,h=i.cartesianToCartographic(g,S5e),h.height=t;let b=un.getPointDistance(u,i.cartographicToCartesian(h,v5e));b<f&&(f=b)}let x=un.clone(u);for(x.normal=m.negate(x.normal,x.normal),x.distance=x.distance*-1+f,r[1]=x,d=0;d<4;d++){g=p[d];let b=p[(d+1)%4],C=i.geodeticSurfaceNormal(g,w5e),A=m.subtract(b,g,P5e),T=m.cross(A,C,I5e);T=m.normalize(T,T),r[2+d]=un.fromPointNormal(g,T)}return r}var nb=new m,ib=new m,rb=new m,D9=new m,R9=new m,O9=new m,R5e=new m,O5e=new m,M5e=new m,M9=new m,L9=new m,N9=new m,oy=new m,ah=new $;function lae(e,t,n){nb=e.normal,ib=t.normal,rb=n.normal,D9=m.multiplyByScalar(e.normal,-e.distance,D9),R9=m.multiplyByScalar(t.normal,-t.distance,R9),O9=m.multiplyByScalar(n.normal,-n.distance,O9),M9=m.multiplyByScalar(m.cross(ib,rb,R5e),m.dot(D9,nb),M9),L9=m.multiplyByScalar(m.cross(rb,nb,O5e),m.dot(R9,ib),L9),N9=m.multiplyByScalar(m.cross(nb,ib,M5e),m.dot(O9,rb),N9),ah[0]=nb.x,ah[1]=ib.x,ah[2]=rb.x,ah[3]=nb.y,ah[4]=ib.y,ah[5]=rb.y,ah[6]=nb.z,ah[7]=ib.z,ah[8]=rb.z;let i=$.determinant(ah);return oy=m.add(M9,L9,oy),oy=m.add(oy,N9,oy),new m(oy.x/i,oy.y/i,oy.z/i)}function L5e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=lae(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=lae(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var F9=new m,SA=new m;function B9(e,t){let n=[];for(let i=0;i<4;i++)F9=m.subtract(t[(i+1)%4],t[i],F9),SA=m.cross(e.normal,F9,SA),SA=m.normalize(SA,SA),n[i]=m.clone(SA);return n}Object.defineProperties(ZO.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var k9=new m;ZO.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;un.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):un.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,un.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=U9(un.projectPointOntoPlane(c,t,k9),i[0],c,r),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=uae(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=U9(un.projectPointOntoPlane(c,t,k9),i[o],c,this._edgeNormals[n[o]]),d=m.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=U9(un.projectPointOntoPlane(this._boundingPlanes[1],t,k9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+u)%4]):m.distance(t,this._vertices[4+(n[1]-2+u)%4])};var N5e=new m,F5e=new m;function uae(e,t,n){let i=m.subtract(n,t,N5e),r=m.subtract(e,t,F5e),o=m.dot(i,r);if(o<=0)return t;let s=m.dot(i,i);return o>=s?n:(o=o/s,new m((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var B5e=new un(m.UNIT_X,0);function U9(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=un.fromPointNormal(t[c],i[c],B5e);un.getPointDistance(u,e)<0||(a=uae(e,t[c],t[(c+1)%4]),o=m.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}ZO.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?en.INSIDE:n===this._vertices.length?en.OUTSIDE:en.INTERSECTING};ZO.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new xf({polygonHierarchy:{positions:this._planeVertices[0]}}),i=xf.createGeometry(n),r=new Ct({geometry:i,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),o=new xf({polygonHierarchy:{positions:this._planeVertices[1]}}),s=xf.createGeometry(o),a=new Ct({geometry:s,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new xf({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=xf.createGeometry(f);c[u]=new Ct({geometry:d,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}})}return new wn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var $O=ZO;var k5e=new m(1,1,1),jU=Math.cos,qU=Math.sin;function vA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,k5e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,D.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,D.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}vA.packedLength=2*m.packedLength+8;vA.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var fae=new m,dae=new m,i_={radii:fae,innerRadii:dae,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};vA.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,fae);t+=m.packedLength;let r=m.unpack(e,t,dae);t+=m.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(i_.minimumClock=o,i_.maximumClock=s,i_.minimumCone=a,i_.maximumCone=c,i_.stackPartitions=u,i_.slicePartitions=f,i_.subdivisions=d,i_.offsetAttribute=p===-1?void 0:p,new vA(i_))};vA.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=re.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-o)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,x=!1;g&&(p=2,o>0&&(h=!0,d+=u),s<Math.PI&&(x=!0,d+=u));let b=a*p*(f+u),C=new Float64Array(b*3),A=2*(b+d-(u+f)*p),T=Be.createTypedArray(b,A),S,v,I,O,R=0,L=new Array(f),N=new Array(f);for(S=0;S<f;S++)O=o+S*(s-o)/(f-1),L[S]=qU(O),N[S]=jU(O);let _=new Array(a),E=new Array(a);for(S=0;S<a;S++)I=i+S*(r-i)/(a-1),_[S]=qU(I),E[S]=jU(I);for(S=0;S<f;S++)for(v=0;v<a;v++)C[R++]=t.x*L[S]*E[v],C[R++]=t.y*L[S]*_[v],C[R++]=t.z*N[S];if(g)for(S=0;S<f;S++)for(v=0;v<a;v++)C[R++]=n.x*L[S]*E[v],C[R++]=n.y*L[S]*_[v],C[R++]=n.z*N[S];for(L.length=a,N.length=a,S=0;S<a;S++)O=o+S*(s-o)/(a-1),L[S]=qU(O),N[S]=jU(O);for(_.length=u,E.length=u,S=0;S<u;S++)I=i+S*(r-i)/(u-1),_[S]=qU(I),E[S]=jU(I);for(S=0;S<a;S++)for(v=0;v<u;v++)C[R++]=t.x*L[S]*E[v],C[R++]=t.y*L[S]*_[v],C[R++]=t.z*N[S];if(g)for(S=0;S<a;S++)for(v=0;v<u;v++)C[R++]=n.x*L[S]*E[v],C[R++]=n.y*L[S]*_[v],C[R++]=n.z*N[S];for(R=0,S=0;S<f*p;S++){let M=S*a;for(v=0;v<a-1;v++)T[R++]=M+v,T[R++]=M+v+1}let w=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)T[R++]=w+S+v*u,T[R++]=w+S+(v+1)*u;if(g)for(w=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)T[R++]=w+S+v*u,T[R++]=w+S+(v+1)*u;if(g){let M=f*a*p,B=M+a*u;if(h)for(S=0;S<u;S++)T[R++]=M+S,T[R++]=B+S;if(x)for(M+=a*u-u,B+=a*u-u,S=0;S<u;S++)T[R++]=M+S,T[R++]=B+S}let P=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let M=C.length,B=e._offsetAttribute===sn.NONE?0:1,V=new Uint8Array(M/3).fill(B);P.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new ft({attributes:P,indices:T,primitiveType:Le.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var lu=vA;function wA(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new lu(i),this._workerName="createSphereOutlineGeometry"}wA.packedLength=lu.packedLength;wA.pack=function(e,t,n){return lu.pack(e._ellipsoidGeometry,t,n)};var U5e=new lu,ob={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};wA.unpack=function(e,t,n){let i=lu.unpack(e,t,U5e);return ob.stackPartitions=i._stackPartitions,ob.slicePartitions=i._slicePartitions,ob.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,ob.radii),n._ellipsoidGeometry=new lu(ob),n):(ob.radius=i._radii.x,new wA(ob))};wA.createGeometry=function(e){return lu.createGeometry(e._ellipsoidGeometry)};var r_=wA;function IA(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(IA.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});IA.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};IA.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};IA.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};IA.prototype.createDebugVolume=function(e){let t=new r_({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new Ct({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var o_=IA;var V5e=new m,z5e=new m,H5e=new m,G5e=new m;function sb(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,D.EPSILON7/i,n)}function V9(e,t){let n=m.normalize(e,G5e),i=m.equalsEpsilon(n,m.UNIT_X,D.EPSILON6)?m.UNIT_Y:m.UNIT_X;return sb(e,i,t)}function mae(e){let t=$.getColumn(e,0,V5e),n=$.getColumn(e,1,z5e),i=$.getColumn(e,2,H5e),r=m.equals(t,m.ZERO),o=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(r&&!o&&!s?t=sb(n,i,t):!r&&o&&!s?n=sb(t,i,n):!r&&!o&&s?i=sb(n,t,i):r?o?s||(t=V9(i,t),n=sb(i,t,n)):(t=V9(n,t),i=sb(n,t,i)):(n=V9(t,n),i=sb(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function PA(e,t){t=mae(t),this._orientedBoundingBox=new On(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(PA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});PA.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};PA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};PA.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=mae(t),$.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};PA.prototype.createDebugVolume=function(e){let t=new ad({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ct({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var bf=PA;function Zr(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||ii(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),u=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Zr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Vr.REPLACE:Vr.ADD):l(i)?p=i.refine:p=Vr.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,x,b,C;if(t=Ie.createIfNeeded(t),o)x=Gr.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(Zr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new yA(e,this),h=!0,x=Gr.READY):(x=Gr.UNLOADED,b=t.getDerivedResource({url:v}),C=Ua.getServerKey(b.getUrlComponent()))}else g=new yA(e,this),h=!0,x=Gr.READY;this._content=g,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=jO(e,n),this.cacheNode=void 0;let A=n.expire,T,S;l(A)&&(T=A.duration,l(A.date)&&(S=ee.fromIso8601(A.date))),this.expireDuration=T,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=pf.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zr._deprecationWarning=Q;Object.defineProperties(Zr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Gr.READY}},contentUnloaded:{get:function(){return this._contentState===Gr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Gr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Gr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var sy=new m;function W5e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,sy),c=m.add(s.positionWC,a,sy),u=m.subtract(c,o,sy);if(m.magnitude(u)>r){let S=m.normalize(u,sy),v=m.multiplyByScalar(S,r,sy),I=m.add(o,v,sy),O=m.subtract(I,s.positionWC,sy),R=m.normalize(O,sy);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Vr.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Fr.PRELOAD_FLIGHT||n._pass===Fr.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*h;if(e._foveatedFactor<=x)return!1;let b=h-x,C=D.clamp((e._foveatedFactor-x)/b,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-A<=T}var _ae=new ee;Zr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=y(n,1),o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===ne.SCENE2D||u instanceof nn){let g=u.offCenterFrustum;l(g)&&(u=g);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),h=u.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,C=D.fog(g,x)*b;p-=C}}return p/=e.pixelRatio,p};function j5e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,s=l(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function q5e(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}Zr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:ts.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==ts.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=q5e(n,this),this._priorityProgressiveResolution=j5e(n,this),this.priorityDeferred=W5e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(_ae);ee.lessThan(this.expireDate,e)&&(this._contentState=Gr.EXPIRED,this._expiredContent=this._content)}};function Y5e(e){if(!l(e.expireDuration))return;let t=ee.now(_ae);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function X5e(e){return function(){return e._priority}}Zr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?K5e(this):Z5e(this)};function K5e(e){let t=e._content,n=e._tileset;if(!l(t)){let r=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new qO(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Gr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Gr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Gr.FAILED,r})}async function J5e(e,t,n,i,r){let o=e._contentState;e._contentState=Gr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ni.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Gr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ni.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await $5e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Gr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Gr.FAILED,a}}function Z5e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new jr({throttle:!0,throttleByServer:!0,type:$o.TILES3D,priorityFunction:X5e(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return J5e(e,r,i,n,o)}async function $5e(e,t){let n=sh(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===ms.GEOMETRY||n.contentType===ms.VECTOR,(n.contentType===ms.IMPLICIT_SUBTREE||n.contentType===ms.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===ms.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r,o=Kx[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?r=await Promise.resolve(o(i,e,e._contentResource,n.binaryPayload.buffer,0)):r=await Promise.resolve(o(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=Jx(i,s));let a=Zx(i,s);return l(a)&&(r.group=new mx({metadata:a})),r}Zr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Gr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var gae=new ae;function H9(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,gae);e._boundingVolume2D=new o_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Q5e(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,gae);e._contentBoundingVolume2D=new o_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=H9(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==en.INSIDE,s===en.OUTSIDE)return ts.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return en.INSIDE;if(this._visibilityPlaneMask===ts.MASK_INSIDE)return en.INSIDE;let t=e.cullingVolume,n=Q5e(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let o=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=o!==en.INSIDE,o===en.OUTSIDE)return en.OUTSIDE}return t.computeVisibility(n)};Zr.prototype.distanceToTile=function(e){return H9(this,e).distanceToCamera(e)};var e6e=new m;Zr.prototype.distanceToTileCenter=function(e){let n=H9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,e6e);return m.dot(e.camera.directionWC,i)};Zr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var yae=new $,xae=new m,t6e=new $,bae=new m,Cae=new ce,n6e=new On,z9=new F;function i6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],bae),r=$.fromArray(e,3,t6e);i=F.multiplyByPoint(t,i,i);let o=F.getMatrix3(t,yae);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new bf(i,r)}function r6e(e,t,n,i){let r=ce.unpack(e,0,Cae),o=e[4],s=e[5],a=On.fromRectangle(r,o,s,re.WGS84,n6e),c=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,z9),z9),c=F.multiplyByPoint(t,c,c);let f=F.getMatrix3(t,yae);return u=$.multiply(f,u,u),l(i)&&i instanceof bf?(i.update(c,u),i):new bf(c,u)}function o6e(e,t,n,i){if(!F.equalsEpsilon(t,n,D.EPSILON8))return r6e(e,t,n,i);if(l(i))return i;let r=ce.unpack(e,0,Cae);return new yf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function s6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],bae),r=e[3];i=F.multiplyByPoint(t,i,i);let o=F.getScale(t,xae),s=m.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new o_(i,r)}Zr.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new de("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new $O(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:r,sphere:o}=e;if(l(i))return i6e(i,t,n);if(l(r))return o6e(r,t,this._initialTransform,n);if(l(o))return s6e(o,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};Zr.prototype.updateTransform=function(e){e=y(e,F.IDENTITY);let t=F.multiplyTransformation(e,this.transform,z9);if(!!F.equals(t,this.computedTransform))return;F.clone(t,this.computedTransform);let i=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zr.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,xae),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function a6e(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=zt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function c6e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Gr.FAILED,r}}function l6e(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Zr.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;l6e(this,e),a6e(this,e,t,n),c6e(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ee.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var hae=[];Zr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Y5e(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=Gr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=hae;try{this._content.update(e,t)}catch(i){throw this._contentState=Gr.FAILED,i}hae.length=0,t.commandList=n};function pae(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function YU(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}Zr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,h=o,x=Math.pow(10,g),b=g+h,C=Math.pow(10,b),A=YU(this._depth,n.depth,i.depth);A=t?1-A:A;let S=!e.isSkippingLevelOfDetail&&this.refine===Vr.REPLACE?YU(this._priorityHolder._distanceToCamera,n.distance,i.distance):YU(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=pae(S,a,s),I=this._priorityProgressiveResolution?0:p,O=YU(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=pae(O,u,c),L=this.priorityDeferred?x:0,N=e._pass===Fr.PRELOAD_FLIGHT?0:C;this._priority=A+v+I+R+L+N};Zr.prototype.isDestroyed=function(){return!1};Zr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Cf=Zr;function s_(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(s_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});s_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};s_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};s_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};s_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};s_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};s_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};s_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var DA=s_;function a_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(a_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});a_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};a_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};a_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};a_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};a_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};a_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};a_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var QO=a_;function Tae(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),r;l(i)&&(r=new QO({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new DA({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new DA({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Tae.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var ay=Tae;var Aae={},u6e=new m;Aae.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof bf||i instanceof yf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=pf.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof bf||a instanceof yf)){e._optimChildrenWithinParent=pf.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=m.subtract(c.center,r.center,u6e),f=m.magnitude(u);m.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=pf.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===pf.USE_OPTIMIZATION};var eM=Aae;function tM(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(tM.prototype,{length:{get:function(){return this._length}}});function f6e(e,t,n){this.item=e,this.previous=t,this.next=n}tM.prototype.add=function(e){let t=new f6e(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Eae(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}tM.prototype.remove=function(e){l(e)&&(Eae(this,e),--this._length)};tM.prototype.splice=function(e,t){if(e===t)return;Eae(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var nM=tM;function ab(){this._list=new nM,this._sentinel=this._list.add(),this._trimTiles=!1}ab.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};ab.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};ab.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};ab.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};ab.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=e.maximumMemoryUsage*1024*1024,o=this._sentinel,s=i.head;for(;s!==o&&(e.totalMemoryUsageInBytes>r||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};ab.prototype.trim=function(){this._trimTiles=!0};var iM=ab;function XU(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function W9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}XU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=W9(e,n),this._referenceMaximum[n]=W9(t,n)};function d6e(e,t){let n=e.tilePropertyName;if(l(n)){let i=W9(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var G9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];XU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=d6e(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+D.EPSILON7,c=D.clamp(i-r,0,s)/s,u=G9.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=G9[d],x=G9[p],b=z.clone(z.WHITE);b.red=D.lerp(h.red,x.red,g),b.green=D.lerp(h.green,x.green,g),b.blue=D.lerp(h.blue,x.blue,g),e._debugColor=b};XU.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var rM=XU;function RA(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}RA.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function KU(e,t,n,i){let r=t.innerContents,o=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-s:s),l(r)){let d=r.length;for(let p=0;p<d;++p)KU(e,r[p],n,i)}}RA.prototype.incrementSelectionCounts=function(e){KU(this,e,!1,!1)};RA.prototype.incrementLoadCounts=function(e){KU(this,e,!1,!0)};RA.prototype.decrementLoadCounts=function(e){KU(this,e,!0,!0)};RA.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var c_=RA;function oM(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(oM.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});oM.prototype.makeDirty=function(){this._styleDirty=!0};oM.prototype.resetDirty=function(){this._styleDirty=!1};oM.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var sM=oM;function m6e(e,t,n){let i=ii(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!ii(r,"3DTILES_bounding_volume_S2")&&!ii(r,"3DTILES_bounding_volume_cylinder"))throw new de("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new Ie({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=h6e(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(je(a,!0));let c=new Ie({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=p6e(t),this.subdivisionScheme=qo[i.subdivisionScheme],this.branchingFactor=qo.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function h6e(e){if(ii(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function p6e(e){let t=je(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var cy=m6e;var aM={};function Sae(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function j9(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function vae(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function q9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}aM.encode2D=function(e,t){return(Sae(e)|Sae(t)<<1)>>>0};aM.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=vae(e),t[1]=vae(e>>1),t};aM.encode3D=function(e,t,n){return j9(e)|j9(t)<<1|j9(n)<<2};aM.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=q9(e),t[1]=q9(e>>1),t[2]=q9(e>>2),t};var ly=aM;function Wr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===qo.OCTREE&&(this.z=e.z)}Object.defineProperties(Wr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===qo.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===qo.OCTREE?ly.encode3D(this.x,this.y,this.z):ly.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===qo.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Wr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===qo.OCTREE){let r=(this.z<<e.level)+e.z;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Wr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===qo.OCTREE){let o=Math.floor(this.z/t);return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};Wr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===qo.OCTREE){let o=e.z%n;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};Wr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===qo.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Wr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Wr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Wr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Wr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===qo.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};Wr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===qo.OCTREE?this.z===e.z:!0)};Wr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Wr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Wr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Wr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===qo.OCTREE&&(e.z=this.z),e};var wae=[0,0,0];Wr.fromMortonIndex=function(e,t,n,i){let r;return e===qo.OCTREE?(r=ly.decode3D(i,wae),new Wr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=ly.decode2D(i,wae),new Wr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};Wr.fromTileIndex=function(e,t,n){let i,r,o;return e===qo.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(D.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),Wr.fromMortonIndex(e,t,i,o)};var cb=Wr;function l_(){}l_.selectTiles=function(e,t){fe.throwInstantiationError()};l_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};l_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};l_.selectTile=function(e,t){if(e.contentVisibility(t)===en.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&i._selectedTilesToStyle.push(e),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};l_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};l_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};l_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!_6e(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function _6e(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}l_.updateTile=function(e,t){Iae(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,x6e(e),e._shouldSelect=!1,e._finalResolution=!0};function Iae(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];Iae(o,t),e._visible=o._visible;return}if(g6e(e,t)){e._visible=!1;return}let i=e.refine===Vr.REPLACE,r=e._optimChildrenWithinParent===pf.USE_OPTIMIZATION;if(i&&r&&n&&!y6e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function g6e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Vr.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function y6e(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function x6e(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ls=l_;function Pae(){}var cM={stack:new Nc,stackMaximumLength:0};Pae.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=Ls,s=cM.stack;for(s.push(i);s.length>0;){cM.stackMaximumLength=Math.max(cM.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Vr.ADD,u=a.refine===Vr.REPLACE,f=b6e(a);f&&C6e(a,s,t),(c||u&&!f)&&(T6e(e,a),r(a,t),A6e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return cM.stack.trim(cM.stackMaximumLength),n};function b6e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function C6e(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function T6e(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function A6e(e,t){e.contentAvailable&&e.contentVisibility(t)!==en.OUTSIDE&&e.tileset._selectedTiles.push(e)}var lM=Pae;function Dae(){}var uM={stack:new Nc,stackMaximumLength:0},fM={stack:new Nc,stackMaximumLength:0};Dae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ls.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;S6e(n,t),uM.stack.trim(uM.stackMaximumLength),fM.stack.trim(fM.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Y9(e,t){e.contentAvailable&&Ls.selectTile(e,t)}function E6e(e,t,n){let i=e.refine===Vr.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Ls;for(let h=0;h<o.length;++h)s(o[h],n);o.sort(Ls.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let h=0;h<o.length;++h){let x=o[h];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=h,g=x._foveatedFactor),d=!0):(u||r.loadSiblings)&&(x._foveatedFactor<g&&(p=h,g=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=v6e(x,n):b=!1,f=f&&b}}if(d||(f=!1),p!==-1&&i){let h=o[p];h._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(h._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(h._distanceToCamera,x._distanceToCamera);for(let b=0;b<o.length;++b)o[b]._priorityHolder=x}return f}function S6e(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Ls,a=uM.stack;for(a.push(e);a.length>0;){uM.stackMaximumLength=Math.max(uM.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?E6e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Vr.ADD?(Y9(c,t),r(c,t)):c.refine===Vr.REPLACE&&(r(c,t),d&&Y9(c,t)):(n._emptyTiles.push(c),r(c,t),d&&Y9(c,t)),o(c,t),s(c,t)}}function v6e(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Ls,s=!0,a=fM.stack;for(a.push(e);a.length>0;){fM.stackMaximumLength=Math.max(fM.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(r(c,t),o(c,t)),d)for(let g=0;g<f;++g){let h=u[g];a.push(h)}}return s}var dM=Dae;function Rae(){}var mM={stack:new Nc,stackMaximumLength:0},hM={stack:new Nc,stackMaximumLength:0},u_={stack:new Nc,stackMaximumLength:0,ancestorStack:new Nc,ancestorStackMaximumLength:0},w6e=2;Rae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ls.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;M6e(n,t),L6e(n,t),mM.stack.trim(mM.stackMaximumLength),hM.stack.trim(hM.stackMaximumLength),u_.stack.trim(u_.stackMaximumLength),u_.ancestorStack.trim(u_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function I6e(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Ls,o=hM.stack;for(o.push(e);o.length>0;){hM.stackMaximumLength=Math.max(hM.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<w6e&&o.push(u))}}}function JU(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:I6e(e,t)}function P6e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function D6e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function R6e(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Ls;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(Ls.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function O6e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function M6e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Ls,c=mM.stack;for(c.push(e);c.length>0;){mM.stackMaximumLength=Math.max(mM.stackMaximumLength,c.length);let u=c.pop();P6e(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?R6e(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Vr.ADD?(JU(u,t),o(u,t)):u.refine===Vr.REPLACE&&(O6e(u,i)?(o(u,t),p&&JU(u,t)):p?(JU(u,t),o(u,t)):D6e(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&JU(u,t)),s(u,t),a(u,t)}}function L6e(e,t){let{selectTile:n,canTraverse:i}=Ls,{stack:r,ancestorStack:o}=u_,s;for(r.push(e);r.length>0||o.length>0;){if(u_.stackMaximumLength=Math.max(u_.stackMaximumLength,r.length),u_.ancestorStackMaximumLength=Math.max(u_.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Vr.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var pM=Rae;function Co(e){e=y(e,y.EMPTY_OBJECT),this._marsOptions=y(e.marsOptions,{}),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new iM,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Nc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=y(e.maximumMemoryUsage,512),this._styleEngine=new sM,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._statistics=new c_,this._statisticsLast=new c_,this._statisticsPerPass=new Array(Fr.NUMBER_OF_PASSES);for(let i=0;i<Fr.NUMBER_OF_PASSES;++i)this._statisticsPerPass[i]=new c_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new rM(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=D.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,D.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,bn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=_l.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Zm(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Np,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new dx,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,Uc.NONE),this._projectTo2D=y(e.projectTo2D,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Nt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let t=y(e.featureIdLabel,"featureId_0");typeof t=="number"&&(t=`featureId_${t}`),this._featureIdLabel=t;let n=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");if(typeof n=="number"&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,l(e.url)){Q("Cesium3DTileset options.url","Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.");let i=this,r;this._readyPromise=Promise.resolve(e.url).then(function(o){let s;return r=Ie.createIfNeeded(o),i._resource=r,i._credits=r.credits,r.extension==="json"?s=r.getBaseUri(!0):r.isDataUri&&(s=""),i._url=r.url,i._basePath=s,Co.loadJson(r)}).then(function(o){if(!i.isDestroyed())return Nae(r,o).then(s=>(i._metadataExtension=s,o))}).then(function(o){if(i.isDestroyed())return;i._geometricError=o.geometricError,i._scaledGeometricError=o.geometricError,i._root=i.loadTileset(r,o);let s=l(o.asset.gltfUpAxis)?hr.fromName(o.asset.gltfUpAxis):hr.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,hr.X),u=o.asset;i._asset=u,i._properties=o.properties,i._extensionsUsed=o.extensionsUsed,i._extensions=o.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=o.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let h=f.cesium.credits,x=i._credits;l(x)||(x=[],i._credits=x);for(let b=0;b<h.length;++b){let C=h[b];x.push(new vt(C.html,i._showCreditsOnScreen))}}let p=i._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=i._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>oi._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=F.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(Co.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){us.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return Q("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),l(this._root)}},readyPromise:{get:function(){return Q("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Q("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});Co.fromIonAssetId=async function(e,t){let n=await Zs.fromAssetId(e);return Co.fromUrl(n,t)};Co.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ie.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await Co.loadJson(n),o=await Nae(n,r),s=new Co(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras;let c=n.credits;l(c)||(c=[]);let u=a.extras;if(l(u)&&l(u.cesium)&&l(u.cesium.credits)){let b=u.cesium.credits;for(let C=0;C<b.length;++C){let A=b[C];c.push(new vt(A.html,s._showCreditsOnScreen))}}s._credits=c;let f=l(r.asset.gltfUpAxis)?hr.fromName(r.asset.gltfUpAxis):hr.Y,d=y(t.modelUpAxis,f),p=y(t.modelForwardAxis,hr.X);s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=d,s._modelForwardAxis=p,s._root=s.loadTileset(n,r);let h=s._root.createBoundingVolume(r.root.boundingVolume,F.IDENTITY).boundingSphere.center,x=s._ellipsoid.cartesianToCartographic(h);return l(x)&&x.height>oi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};Co.loadJson=function(e){return Ie.createIfNeeded(e).fetchJson()};Co.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};Co.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&Co.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=Oae(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Vr.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=Oae(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&eM.checkChildrenWithinParent(c)}return s};function Oae(e,t,n,i){if(!(l(n.implicitTiling)||ii(n,"3DTILES_implicit_tiling")))return new Cf(e,t,n,i);let o=e.schema,s=new cy(t,n,o),a=new cb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=je(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Cf(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Nae(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=ki.getSchemaLoader({resource:e});else if(l(n.schema))i=ki.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new ay({schema:i.schema,metadataJson:n});return ki.unload(i),r}var Mae=new m,N6e=new me,F6e=new F,B6e=new m,k6e=new m,U6e=new m;function V6e(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof yf)n=m.normalize(a.positionWC,Mae),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,F6e),b=t.mapProjection.ellipsoid,C=u.boundingVolume,A=F.multiplyByPoint(x,C.center,B6e);if(m.magnitude(A)>b.minimumRadius){let T=me.fromCartesian(A,b,N6e);n=m.normalize(a.positionWC,Mae),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=F.multiplyByPoint(x,a.positionWC,k6e);if(n=m.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,U6e),i=m.normalize(i,i),r=T.z,u instanceof bf){let S=c._header.boundingVolume.box[11];o=A.z-S,s=A.z+S}else if(u instanceof o_){let S=C.radius;o=A.z-S,s=A.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=D.clamp((r-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function z6e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{Fae(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?J6e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function H6e(e,t){return e._priority-t._priority}Co.prototype.postPassesUpdate=function(e){l(this._root)&&(G6e(this,e),$6e(this,e),this._cache.unloadTiles(this,kae),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};Co.prototype.prePassesUpdate=function(e){if(!l(this._root))return;q6e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&V6e(this,e),e.newFrame&&this._cache.reset()};function G6e(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Gr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function W6e(e){let t=e._requestedTiles;t.sort(H6e);for(let n=0;n<t.length;++n)z6e(e,t[n])}function Fae(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`))}function j6e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Gr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}function q6e(e,t){j6e(e);let n=e._processingQueue,i=e._statistics,r;for(let o=0;o<n.length;++o){r=n[o];try{r.process(e,t),r.contentReady&&(--i.numberOfTilesProcessing,e.tileLoad.raiseEvent(r))}catch(s){--i.numberOfTilesProcessing,Fae(s,e,r)}}}var ZU=new m,Y6e={maximumFractionDigits:3};function Lae(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Y6e):Math.round(t).toLocaleString()}function X9(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=m.clone(i,ZU);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=m.normalize(i,ZU);o=m.multiplyByScalar(o,.75*n,ZU),r=m.add(o,i,ZU)}return r}function K9(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,r++),i+=` +Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${Lae(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${Lae(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` +- ${s[a]}`;r+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function X6e(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:X9(e.debugPickedTile),a=K9(e.debugPickedTile,e,s);a.pixelOffset=new H(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];K9(a,e,X9(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&K9(a,e,X9(a))}}e._tileDebugLabels.update(t)}function K6e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ee.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let h=0;h<s.length;++h){let x=s[h];f&&u.raiseEvent(x),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,x=h.length;i.length+=x;for(let b=g-1;b>=0;--b)i[d+x+b]=i[d+b];for(let b=0;b<x;++b)i[d+b]=h[b]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new ih),X6e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Bae=[];function J6e(e,t){let n=t,i=Bae;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(Z6e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function kae(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Z6e(e,t){e._cache.unloadTile(e,t,kae),t.destroy()}Co.prototype.trimLoadedTiles=function(){this._cache.trim()};function $6e(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;c_.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function Q6e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function e9e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function t9e(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,Q6e(e),e9e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&W6e(e),K6e(e,t,i),c_.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];c.showOnScreen=e._showCreditsOnScreen||c._isDefaultToken,t.creditDisplay.addCreditToNextFrame(c)}}return o}Co.prototype.getTraversal=function(e){let{pass:t}=e;return t===Fr.MOST_DETAILED_PRELOAD||t===Fr.MOST_DETAILED_PICK?lM:this.isSkippingLevelOfDetail?pM:dM};Co.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};Co.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Fr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=Fr.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;e.commandList=c,e.camera=y(t.camera,r),e.cullingVolume=y(t.cullingVolume,o);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=t9e(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};Co.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=Bae;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};Co.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};Co.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Co.supportedExtensions[e[t]])throw new de(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Ns=Co;var n9e=new F;function uy(e,t){t.collectionChanged.addEventListener(uy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}uy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,n9e),c=Ie.createIfNeeded(q.getValueOrUndefined(a._uri,e))),!f){l(u)&&(u.tilesetPrimitive.show=!1);continue}let p=l(u)?u.tilesetPrimitive:void 0;(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],i9e(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=q.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};uy.prototype.isDestroyed=function(){return!1};uy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(uy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)J9(this,e[i],t,n);return ue(this)};uy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};uy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(J9(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],J9(this,o,a,c),s.remove(o.id)};function J9(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function i9e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Ns.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var _M=uy;var r9e=z.WHITE,o9e=z.BLACK,s9e=new H(2,2);function OA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(OA.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});OA.prototype.getType=function(e){return"Checkerboard"};OA.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,r9e,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,o9e,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,s9e),t};OA.prototype.equals=function(e){return this===e||e instanceof OA&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var MA=OA;var Uae={id:void 0};function gM(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function tc(e){this._owner=e,this._entities=new Tt,this._addedEntities=new Tt,this._removedEntities=new Tt,this._changedEntities=new Tt,this._suspendCount=0,this._collectionChanged=new _e,this._id=qn(),this._show=!0,this._firing=!1,this._refire=!1}tc.prototype.suspendEvents=function(){this._suspendCount++};tc.prototype.resumeEvents=function(){this._suspendCount--,gM(this)};Object.defineProperties(tc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});tc.prototype.computeAvailability=function(){let e=Ve.MAXIMUM_VALUE,t=Ve.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;ee.lessThan(a,e)&&!a.equals(Ve.MINIMUM_VALUE)&&(e=a),ee.greaterThan(c,t)&&!c.equals(Ve.MAXIMUM_VALUE)&&(t=c)}}return Ve.MAXIMUM_VALUE.equals(e)&&(e=Ve.MINIMUM_VALUE),Ve.MINIMUM_VALUE.equals(t)&&(t=Ve.MAXIMUM_VALUE),new An({start:e,stop:t})};tc.prototype.add=function(e){e instanceof Kr||(e=new Kr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(tc.prototype._onEntityDefinitionChanged,this),gM(this),e};tc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};tc.prototype.contains=function(e){return this._entities.get(e.id)===e};tc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(tc.prototype._onEntityDefinitionChanged,this),gM(this),!0):!1};tc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(tc.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),gM(this)};tc.prototype.getById=function(e){return this._entities.get(e)};tc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Uae.id=e,t=new Kr(Uae),this.add(t)),t};tc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),gM(this)};var Fs=tc;var $U={id:void 0},LA=new Array(2);function Z9(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Vae(e,t,n,i){LA[0]=n,LA[1]=i.id,t[JSON.stringify(LA)]=i.definitionChanged.addEventListener(Po.prototype._onDefinitionChanged,e)}function zae(e,t,n,i){LA[0]=n,LA[1]=i.id;let r=JSON.stringify(LA);t[r](),t[r]=void 0}function fy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Fs(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(Po.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],zae(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(Po.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Vae(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?Z9(x):($U.id=s.id,x=new Kr($U)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(o=0;o<h.length;o++)f.add(h[o]);f.resumeEvents()}function Po(e,t){this._owner=t,this._composite=new Fs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=qn(),this._eventHash={},fy(this),this._shouldRecomposite=!1}Object.defineProperties(Po.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Po.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),fy(this)};Po.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),fy(this),!0):!1};Po.prototype.removeAllCollections=function(){this._collections.length=0,fy(this)};Po.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Po.prototype.contains=function(e){return this._composite.contains(e)};Po.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Po.prototype.getCollection=function(e){return this._collections[e]};Po.prototype.getCollectionsLength=function(){return this._collections.length};function QU(e,t){return e.indexOf(t)}function Hae(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,fy(e)}Po.prototype.raiseCollection=function(e){let t=QU(this._collections,e);Hae(this,t,t+1)};Po.prototype.lowerCollection=function(e){let t=QU(this._collections,e);Hae(this,t,t-1)};Po.prototype.raiseCollectionToTop=function(e){let t=QU(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),fy(this))};Po.prototype.lowerCollectionToBottom=function(e){let t=QU(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),fy(this))};Po.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Po.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(fy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Po.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Po.prototype.getById=function(e){return this._composite.getById(e)};Po.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let h=n[s];zae(this,d,p,h);let x=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=o.getById(x),Z9(u)),u.merge(c));l(u)||o.removeById(x),u=void 0}let g=t.length;for(s=0;s<g;s++){let h=t[s];Vae(this,d,p,h);let x=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=o.getById(x),l(u)?Z9(u):($U.id=x,u=new Kr($U),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};Po.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let h=g[t];if(l(h)){if(d)if(d=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var $9=Po;function Q9(){this._removalFunctions=[]}Q9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};Q9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Do=Q9;function nW(e,t){return ee.compare(e.start,t.start)}function Ro(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Ro.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Ro.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Ro))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!An.equals(n[o],i[o],t))return!1;return!0};Ro.prototype.get=function(e){return this._intervals[e]};Ro.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ro.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ro.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ro.prototype.contains=function(e){return this.indexOf(e)>=0};var eW=new An;Ro.prototype.indexOf=function(e){let t=this._intervals;eW.start=e,eW.stop=e;let n=Or(t,eW,nW);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&An.contains(t[n-1],e)?n-1:~n)};Ro.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};Ro.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Or(n,e,nW);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=ee.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new An({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new An({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=ee.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new An({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new An({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=ee.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new An({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new An({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ro.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Or(t,e,nW);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new An({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new An({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new An({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new An({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new An({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new An({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Ro.prototype.intersect=function(e,t,n){let i=new Ro,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(ee.lessThan(c.stop,u.start))++r;else if(ee.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=An.intersect(c,u,new An,n);f.isEmpty||i.addInterval(f,t)}ee.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};Ro.fromJulianDateArray=function(e,t){l(t)||(t=new Ro);let n=e.julianDates,i=n.length,r=e.dataCallback,o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new An({start:Ve.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new An({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new An({start:n[i-1],stop:Ve.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var nc=new Zh,yM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tW(e,t,n){l(n)||(n=new ee),ee.toGregorianDate(e,nc);let i=nc.millisecond+t.millisecond,r=nc.second+t.second,o=nc.minute+t.minute,s=nc.hour+t.hour,a=nc.day+t.day,c=nc.month+t.month,u=nc.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),yM[2]=$h(u)?29:28;a>yM[c]||c>=13;)a>yM[c]&&(a-=yM[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),yM[2]=$h(u)?29:28;return nc.millisecond=i,nc.second=r,nc.minute=o,nc.hour=s,nc.day=a,nc.month=c,nc.year=u,ee.fromGregorianDate(nc,n)}var a9e=new ee,c9e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Gae(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(c9e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,a9e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var xM=new Zh;Ro.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=[];if(!Gae(n[2],xM))o.push(i,r);else{let s=ee.clone(i);for(o.push(s);ee.compare(s,r)<0;)s=tW(s,xM),ee.compare(r,s)<=0&&ee.clone(r,s),o.push(s)}return Ro.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ro.fromIso8601DateArray=function(e,t){return Ro.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ro.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=y(e.relativeToPrevious,!1),o=[],s,a,c=i.length;for(let u=0;u<c;++u)(Gae(i[u],xM)||u===0)&&(r&&l(a)?s=tW(a,xM):s=tW(n,xM),o.push(s),a=s);return Ro.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Oo=Ro;function l9e(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function lb(){this._eventHelper=new Do,this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(lb.prototype._intervalsChanged,this)}Object.defineProperties(lb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});lb.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};lb.prototype.equals=function(e){return this===e||e instanceof lb&&this._intervals.equals(e._intervals,q.equals)};lb.prototype._intervalsChanged=function(){l9e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var ic=lb;function dy(){this._definitionChanged=new _e,this._composite=new ic,this._composite.definitionChanged.addEventListener(dy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(dy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});dy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};dy.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};dy.prototype.equals=function(e){return this===e||e instanceof dy&&this._composite.equals(e._composite,q.equals)};dy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var NA=dy;function my(e){this._referenceFrame=y(e,ar.FIXED),this._definitionChanged=new _e,this._composite=new ic,this._composite.definitionChanged.addEventListener(my.prototype._raiseDefinitionChanged,this)}Object.defineProperties(my.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});my.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};my.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};my.prototype.equals=function(e){return this===e||e instanceof my&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};my.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var na=my;var u9e={ROUNDED:0,MITERED:1,BEVELED:2},Mi=Object.freeze(u9e);var ia=[new m,new m],f9e=new m,d9e=new m,m9e=new m,h9e=new m,p9e=new m,_9e=new m,g9e=new m,y9e=new m,x9e=new m,FA=new m,eV=new m,bM={},iW=new me;function b9e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];iW=t.cartesianToCartographic(r,iW),n[i]=iW.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function rW(e,t,n,i){let r=e[0],o=e[1],s=m.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var tV=new m,nV=new m;function C9e(e,t,n,i){let r=new ya(n,i),o=r.projectPointOntoPlane(m.add(n,e,tV),tV),s=r.projectPointOntoPlane(m.add(n,t,nV),nV),a=H.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var T9e=new m(-1,0,0),ub=new F,A9e=new F,oW=new $,E9e=$.IDENTITY.clone(),S9e=new m,v9e=new oe,Wae=new m;function f_(e,t,n,i,r,o,s,a){let c=S9e,u=v9e;ub=Mt.eastNorthUpToFixedFrame(e,r,ub),c=F.multiplyByPointAsVector(ub,T9e,c),c=m.normalize(c,c);let f=C9e(c,t,e,r);oW=$.fromRotationZ(f,oW),Wae.z=o,ub=F.multiplyTransformation(ub,F.fromRotationTranslation(oW,Wae,A9e),ub);let d=E9e;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=m.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=F.multiplyByPoint(ub,u,u),i.push(u.x,u.y,u.z);return i}var w9e=new m;function sW(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,w9e);i=f_(c,t,n,i,r,o[a/3],s,1)}return i}function I9e(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s,i}function jae(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var qae=new Ne,Yae=new m,Xae=new $;function Kae(e,t,n,i,r,o,s,a,c,u){let f=m.angleBetween(m.subtract(t,e,FA),m.subtract(n,e,eV)),d=i===Mi.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Ne.fromAxisAngle(m.negate(e,FA),f/(d+1),qae),Xae):p=$.fromQuaternion(Ne.fromAxisAngle(e,f/(d+1),qae),Xae);let g,h;if(t=m.clone(t,Yae),d>0){let x=u?2:1;for(let b=0;b<d;b++)t=$.multiplyByVector(p,t,t),g=m.subtract(t,e,FA),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,eV),s=f_(h,g,a,s,o,c,1,x)}else g=m.subtract(t,e,FA),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,eV),s=f_(h,g,a,s,o,c,1,1),n=m.clone(n,Yae),g=m.subtract(n,e,FA),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(n,eV),s=f_(h,g,a,s,o,c,1,1);return s}bM.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];H.equals(o,s)||n.push(s)}return n};bM.angleIsGreaterThanPi=function(e,t,n,i){let r=new ya(n,i),o=r.projectPointOntoPlane(m.add(n,e,tV),tV),s=r.projectPointOntoPlane(m.add(n,t,nV),nV);return s.x*o.y-s.y*o.x>=0};var P9e=new m,D9e=new m;bM.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=b9e(e,o),a=i._granularity,c=i._cornerType,u=r?I9e(t,n):jae(t,n),f=r?jae(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],x=r?[]:void 0,b=f9e,C=d9e,A=m9e,T=h9e,S=p9e,v=_9e,I=g9e,O=y9e,R=x9e,L=e[0],N=e[1];T=o.geodeticSurfaceNormal(L,T),b=m.subtract(N,L,b),b=m.normalize(b,b),O=m.cross(T,b,O),O=m.normalize(O,O);let _=s[0],E=s[1];r&&(x=f_(L,O,f,x,o,_+d,1,1)),R=m.clone(L,R),L=N,C=m.negate(b,C);let w,P;for(let V=1;V<g-1;V++){let U=r?2:1;if(N=e[V+1],L.equals(N)){Nt("Positions are too close and are considered equivalent with rounding error.");continue}b=m.subtract(N,L,b),b=m.normalize(b,b),A=m.add(b,C,A),A=m.normalize(A,A),T=o.geodeticSurfaceNormal(L,T);let G=m.multiplyByScalar(T,m.dot(b,T),P9e);m.subtract(b,G,G),m.normalize(G,G);let k=m.multiplyByScalar(T,m.dot(C,T),D9e);if(m.subtract(C,k,k),m.normalize(k,k),!D.equalsEpsilon(Math.abs(m.dot(G,k)),1,D.EPSILON7)){A=m.cross(A,T,A),A=m.cross(T,A,A),A=m.normalize(A,A);let j=1/Math.max(.25,m.magnitude(m.cross(A,C,FA))),J=bM.angleIsGreaterThanPi(b,C,L,o);J?(S=m.add(L,m.multiplyByScalar(A,j*p,A),S),v=m.add(S,m.multiplyByScalar(O,p,v),v),ia[0]=m.clone(R,ia[0]),ia[1]=m.clone(v,ia[1]),w=rW(ia,_+d,E+d,a),P=Oi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=sW(P,O,u,h,o,w,1),O=m.cross(T,b,O),O=m.normalize(O,O),I=m.add(S,m.multiplyByScalar(O,p,I),I),c===Mi.ROUNDED||c===Mi.BEVELED?Kae(S,v,I,c,J,o,h,u,E+d,r):(A=m.negate(A,A),h=f_(L,A,u,h,o,E+d,j,U)),R=m.clone(I,R)):(S=m.add(L,m.multiplyByScalar(A,j*p,A),S),v=m.add(S,m.multiplyByScalar(O,-p,v),v),ia[0]=m.clone(R,ia[0]),ia[1]=m.clone(v,ia[1]),w=rW(ia,_+d,E+d,a),P=Oi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=sW(P,O,u,h,o,w,1),O=m.cross(T,b,O),O=m.normalize(O,O),I=m.add(S,m.multiplyByScalar(O,-p,I),I),c===Mi.ROUNDED||c===Mi.BEVELED?Kae(S,v,I,c,J,o,h,u,E+d,r):h=f_(L,A,u,h,o,E+d,j,U),R=m.clone(I,R)),C=m.negate(b,C)}else h=f_(R,O,u,h,o,_+d,1,1),R=L;_=E,E=s[V+1],L=N}ia[0]=m.clone(R,ia[0]),ia[1]=m.clone(L,ia[1]),w=rW(ia,_+d,E+d,a),P=Oi.generateArc({positions:ia,granularity:a,ellipsoid:o}),h=sW(P,O,u,h,o,w,1),r&&(x=f_(L,O,f,x,o,E+d,1,1)),g=h.length;let M=r?g+x.length:g,B=new Float64Array(M);return B.set(h),r&&B.set(x,g),B};var Hd=bM;var cW={},BA=new m,ece=new m,R9e=new m,Jae=new m,Hc=[new m,new m],tce=new m,nce=new m,ice=new m,O9e=new m,M9e=new m,L9e=new m,N9e=new m,F9e=new m,B9e=new m,k9e=new m,Zae=new Ne,$ae=new $;function iV(e,t,n,i,r){let o=m.angleBetween(m.subtract(t,e,BA),m.subtract(n,e,ece)),s=i===Mi.BEVELED?1:Math.ceil(o/D.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=$.fromQuaternion(Ne.fromAxisAngle(m.negate(e,BA),o/s,Zae),$ae):u=$.fromQuaternion(Ne.fromAxisAngle(e,o/s,Zae),$ae);let f=0;t=m.clone(t,BA);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function U9e(e){let t=tce,n=nce,i=ice,r=e[1];n=m.fromArray(e[1],r.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let o=iV(t,n,i,Mi.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(r,0,i),t=m.midpoint(n,i,t);let c=iV(t,n,i,Mi.ROUNDED,!1);return[o,c]}function Qae(e,t,n,i){let r=BA;return i?r=m.add(e,t,r):(t=m.negate(t,t),r=m.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function aW(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=m.multiplyByScalar(t,n,BA),a=m.negate(s,ece),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=m.fromArray(e,f,R9e),p=m.add(d,a,Jae);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=m.add(d,s,Jae);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}cW.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var V9e=new m,z9e=new m;cW.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=tce,c=nce,u=ice,f=O9e,d=M9e,p=L9e,g=N9e,h=F9e,x=B9e,b=k9e,C=[],A=s?[]:void 0,T=s?[]:void 0,S=n[0],v=n[1];c=m.normalize(m.subtract(v,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=m.normalize(m.cross(a,c,f),f),s&&(A.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=m.clone(S,g),S=v,u=m.negate(c,u);let I,O=[],R,L=n.length;for(R=1;R<L-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],c=m.normalize(m.subtract(v,S,c),c),d=m.normalize(m.add(c,u,d),d);let _=m.multiplyByScalar(a,m.dot(c,a),V9e);m.subtract(c,_,_),m.normalize(_,_);let E=m.multiplyByScalar(a,m.dot(u,a),z9e);if(m.subtract(u,E,E),m.normalize(E,E),!D.equalsEpsilon(Math.abs(m.dot(_,E)),1,D.EPSILON7)){d=m.cross(d,a,d),d=m.cross(a,d,d),d=m.normalize(d,d);let P=r/Math.max(.25,m.magnitude(m.cross(d,u,BA))),M=Hd.angleIsGreaterThanPi(c,u,S,i);d=m.multiplyByScalar(d,P,d),M?(h=m.add(S,d,h),b=m.add(h,m.multiplyByScalar(f,r,b),b),x=m.add(h,m.multiplyByScalar(f,r*2,x),x),Hc[0]=m.clone(g,Hc[0]),Hc[1]=m.clone(b,Hc[1]),I=Oi.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=aW(I,f,r,C),s&&(A.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=m.clone(x,p),f=m.normalize(m.cross(a,c,f),f),x=m.add(h,m.multiplyByScalar(f,r*2,x),x),g=m.add(h,m.multiplyByScalar(f,r,g),g),o===Mi.ROUNDED||o===Mi.BEVELED?O.push({leftPositions:iV(h,p,x,o,M)}):O.push({leftPositions:Qae(S,m.negate(d,d),x,M)})):(x=m.add(S,d,x),b=m.add(x,m.negate(m.multiplyByScalar(f,r,b),b),b),h=m.add(x,m.negate(m.multiplyByScalar(f,r*2,h),h),h),Hc[0]=m.clone(g,Hc[0]),Hc[1]=m.clone(b,Hc[1]),I=Oi.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=aW(I,f,r,C),s&&(A.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=m.clone(h,p),f=m.normalize(m.cross(a,c,f),f),h=m.add(x,m.negate(m.multiplyByScalar(f,r*2,h),h),h),g=m.add(x,m.negate(m.multiplyByScalar(f,r,g),g),g),o===Mi.ROUNDED||o===Mi.BEVELED?O.push({rightPositions:iV(x,p,h,o,M)}):O.push({rightPositions:Qae(S,d,h,M)})),u=m.negate(c,u)}S=v}a=i.geodeticSurfaceNormal(S,a),Hc[0]=m.clone(g,Hc[0]),Hc[1]=m.clone(S,Hc[1]),I=Oi.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=aW(I,f,r,C),s&&(A.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let N;return o===Mi.ROUNDED&&(N=U9e(C)),{positions:C,corners:O,lefts:A,normals:T,endPositions:N}};var Vi=cW;var sce=new m,ace=new m,rV=new m,oV=new m,H9e=new m,cce=new m,hy=new m,kA=new m;function lce(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Gd(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=m.normalize(m.cross(n,t,hy),hy);o.normal&&Vi.addAttribute(s,t,i,r),o.tangent&&Vi.addAttribute(a,u,i,r),o.bitangent&&Vi.addAttribute(c,n,i,r)}function uce(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new pn,u,f=0,d=0,p,g=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,f+=h,g+=h*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<r.length;p++){u=r[p];let Z=r[p].leftPositions;l(Z)?(h=Z.length,f+=h,g+=h):(h=r[p].rightPositions.length,d+=h,g+=h)}let x=l(o),b;x&&(b=o[0].length-3,f+=b,d+=b,b/=3,g+=b*6);let C=f+d,A=new Float64Array(C),T=t.normal?new Float32Array(C):void 0,S=t.tangent?new Float32Array(C):void 0,v=t.bitangent?new Float32Array(C):void 0,I={normals:T,tangents:S,bitangents:v},O=0,R=C-1,L,N,_,E,w=sce,P=ace,M,B,V=b/2,U=Be.createTypedArray(C/3,g),G=0;if(x){B=rV,M=oV;let Z=o[0];for(w=m.fromArray(a,0,w),P=m.fromArray(s,0,P),p=0;p<V;p++)B=m.fromArray(Z,(V-1-p)*3,B),M=m.fromArray(Z,(V+p)*3,M),Vi.addAttribute(A,M,O),Vi.addAttribute(A,B,void 0,R),Gd(I,w,P,O,R,t),N=O/3,E=N+1,L=(R-2)/3,_=L-1,U[G++]=L,U[G++]=N,U[G++]=_,U[G++]=_,U[G++]=N,U[G++]=E,O+=3,R-=3}let k=0,Y=0,j=i[k++],J=i[k++];A.set(j,O),A.set(J,R-J.length+1),P=m.fromArray(s,Y,P);let W,K;for(h=J.length-3,p=0;p<h;p+=3)W=n.geodeticSurfaceNormal(m.fromArray(j,p,hy),hy),K=n.geodeticSurfaceNormal(m.fromArray(J,h-p,kA),kA),w=m.normalize(m.add(W,K,w),w),Gd(I,w,P,O,R,t),N=O/3,E=N+1,L=(R-2)/3,_=L-1,U[G++]=L,U[G++]=N,U[G++]=_,U[G++]=_,U[G++]=N,U[G++]=E,O+=3,R-=3;for(W=n.geodeticSurfaceNormal(m.fromArray(j,h,hy),hy),K=n.geodeticSurfaceNormal(m.fromArray(J,h,kA),kA),w=m.normalize(m.add(W,K,w),w),Y+=3,p=0;p<r.length;p++){let Z;u=r[p];let he=u.leftPositions,ge=u.rightPositions,se,pe,xe=cce,Pe=rV,we=oV;if(w=m.fromArray(a,Y,w),l(he)){for(Gd(I,w,P,void 0,R,t),R-=3,se=E,pe=_,Z=0;Z<he.length/3;Z++)xe=m.fromArray(he,Z*3,xe),U[G++]=se,U[G++]=pe-Z-1,U[G++]=pe-Z,Vi.addAttribute(A,xe,void 0,R),Pe=m.fromArray(A,(pe-Z-1)*3,Pe),we=m.fromArray(A,se*3,we),P=m.normalize(m.subtract(Pe,we,P),P),Gd(I,w,P,void 0,R,t),R-=3;xe=m.fromArray(A,se*3,xe),Pe=m.subtract(m.fromArray(A,pe*3,Pe),xe,Pe),we=m.subtract(m.fromArray(A,(pe-Z)*3,we),xe,we),P=m.normalize(m.add(Pe,we,P),P),Gd(I,w,P,O,void 0,t),O+=3}else{for(Gd(I,w,P,O,void 0,t),O+=3,se=_,pe=E,Z=0;Z<ge.length/3;Z++)xe=m.fromArray(ge,Z*3,xe),U[G++]=se,U[G++]=pe+Z,U[G++]=pe+Z+1,Vi.addAttribute(A,xe,O),Pe=m.fromArray(A,se*3,Pe),we=m.fromArray(A,(pe+Z)*3,we),P=m.normalize(m.subtract(Pe,we,P),P),Gd(I,w,P,O,void 0,t),O+=3;xe=m.fromArray(A,se*3,xe),Pe=m.subtract(m.fromArray(A,(pe+Z)*3,Pe),xe,Pe),we=m.subtract(m.fromArray(A,pe*3,we),xe,we),P=m.normalize(m.negate(m.add(we,Pe,P),P),P),Gd(I,w,P,void 0,R,t),R-=3}for(j=i[k++],J=i[k++],j.splice(0,3),J.splice(J.length-3,3),A.set(j,O),A.set(J,R-J.length+1),h=J.length-3,Y+=3,P=m.fromArray(s,Y,P),Z=0;Z<J.length;Z+=3)W=n.geodeticSurfaceNormal(m.fromArray(j,Z,hy),hy),K=n.geodeticSurfaceNormal(m.fromArray(J,h-Z,kA),kA),w=m.normalize(m.add(W,K,w),w),Gd(I,w,P,O,R,t),E=O/3,N=E-1,_=(R-2)/3,L=_+1,U[G++]=L,U[G++]=N,U[G++]=_,U[G++]=_,U[G++]=N,U[G++]=E,O+=3,R-=3;O-=3,R+=3}if(w=m.fromArray(a,a.length-3,w),Gd(I,w,P,O,R,t),x){O+=3,R-=3,B=rV,M=oV;let Z=o[1];for(p=0;p<V;p++)B=m.fromArray(Z,(b-p-1)*3,B),M=m.fromArray(Z,p*3,M),Vi.addAttribute(A,B,void 0,R),Vi.addAttribute(A,M,O),Gd(I,w,P,O,R,t),E=O/3,N=E-1,_=(R-2)/3,L=_+1,U[G++]=L,U[G++]=N,U[G++]=_,U[G++]=_,U[G++]=N,U[G++]=E,O+=3,R-=3}if(c.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:A}),t.st){let Z=new Float32Array(C/3*2),he,ge,se=0;if(x){f/=3,d/=3;let pe=Math.PI/(b+1);ge=1/(f-b+1),he=1/(d-b+1);let xe,Pe=b/2;for(p=Pe+1;p<b+1;p++)xe=D.PI_OVER_TWO+pe*p,Z[se++]=he*(1+Math.cos(xe)),Z[se++]=.5*(1+Math.sin(xe));for(p=1;p<d-b+1;p++)Z[se++]=p*he,Z[se++]=0;for(p=b;p>Pe;p--)xe=D.PI_OVER_TWO-p*pe,Z[se++]=1-he*(1+Math.cos(xe)),Z[se++]=.5*(1+Math.sin(xe));for(p=Pe;p>0;p--)xe=D.PI_OVER_TWO-pe*p,Z[se++]=1-ge*(1+Math.cos(xe)),Z[se++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)Z[se++]=p*ge,Z[se++]=1;for(p=1;p<Pe+1;p++)xe=D.PI_OVER_TWO+pe*p,Z[se++]=ge*(1+Math.cos(xe)),Z[se++]=.5*(1+Math.sin(xe))}else{for(f/=3,d/=3,ge=1/(f-1),he=1/(d-1),p=0;p<d;p++)Z[se++]=p*he,Z[se++]=0;for(p=f;p>0;p--)Z[se++]=(p-1)*ge,Z[se++]=1}c.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Z})}return t.normal&&(c.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function G9e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=sce,h=ace,x=rV,b=oV,C=H9e,A=cce,T=c;for(u=0;u<s;u+=3){let S=T+c;g=m.fromArray(n,u,g),h=m.fromArray(n,u+s,h),x=m.fromArray(n,(u+3)%s,x),h=m.subtract(h,g,h),x=m.subtract(x,g,x),b=m.normalize(m.cross(h,x,b),b),t.normal&&(Vi.addAttribute(f,b,S),Vi.addAttribute(f,b,S+3),Vi.addAttribute(f,b,T),Vi.addAttribute(f,b,T+3)),(t.tangent||t.bitangent)&&(A=m.fromArray(i,u,A),t.bitangent&&(Vi.addAttribute(p,A,S),Vi.addAttribute(p,A,S+3),Vi.addAttribute(p,A,T),Vi.addAttribute(p,A,T+3)),t.tangent&&(C=m.normalize(m.cross(A,b,C),C),Vi.addAttribute(d,C,S),Vi.addAttribute(d,C,S+3),Vi.addAttribute(d,C,T),Vi.addAttribute(d,C,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;d.set(S),d.set(S,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let h=f[u],x=f[u+1];d[p++]=h,d[p++]=x,d[p++]=h,d[p++]=x}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function lW(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function W9e(e,t){let n=new Oe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=Vi.computePositions(e),o=uce(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let h=new Float64Array(d*4);f=fi.scaleToGeodeticHeight(f,s,i),h=lW(f,0,h),g=fi.scaleToGeodeticHeight(g,a,i),h=lW(g,d*2,h),p.set(f),p.set(g,d),p.set(h,d*2),c.position.values=p,c=G9e(c,t);let x,b=d/3;if(e.shadowVolume){let L=c.normal.values;d=L.length;let N=new Float32Array(d*6);for(x=0;x<d;x++)L[x]=-L[x];N.set(L,d),N=lW(L,d*4,N),c.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let L=new Uint8Array(b*6);if(e.offsetAttribute===sn.TOP)L=L.fill(1,0,b).fill(1,b*2,b*4);else{let N=e.offsetAttribute===sn.NONE?0:1;L=L.fill(N)}c.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let C=u.length,A=b+b,T=Be.createTypedArray(p.length/3,C*2+A*3);T.set(u);let S=C;for(x=0;x<C;x+=3){let L=u[x],N=u[x+1],_=u[x+2];T[S++]=_+b,T[S++]=N+b,T[S++]=L+b}let v,I,O,R;for(x=0;x<A;x+=2)v=x+A,I=v+A,O=v+1,R=I+1,T[S++]=v,T[S++]=I,T[S++]=O,T[S++]=O,T[S++]=I,T[S++]=R;return{attributes:c,indices:T}}var rce=new m,CM=new m,Af=new me;function oce(e,t,n,i,r,o){let s=m.subtract(t,e,rce);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,CM),c=m.cross(s,a,rce);m.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;m.add(e,c,CM),n.cartesianToCartographic(CM,Af);let g=Af.latitude,h=Af.longitude;u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),m.subtract(e,c,CM),n.cartesianToCartographic(CM,Af),g=Af.latitude,h=Af.longitude,u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Tf=new m,TM=new m,vl=new me,wl=new me;function fce(e,t,n,i,r){e=lce(e,t);let o=Er(e,m.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ce;let a=n*.5;vl.latitude=Number.POSITIVE_INFINITY,vl.longitude=Number.POSITIVE_INFINITY,wl.latitude=Number.NEGATIVE_INFINITY,wl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Mi.ROUNDED){let p=o[0];m.subtract(p,o[1],Tf),m.normalize(Tf,Tf),m.multiplyByScalar(Tf,a,Tf),m.add(p,Tf,TM),t.cartesianToCartographic(TM,Af),c=Af.latitude,u=Af.longitude,vl.latitude=Math.min(vl.latitude,c),vl.longitude=Math.min(vl.longitude,u),wl.latitude=Math.max(wl.latitude,c),wl.longitude=Math.max(wl.longitude,u)}for(let p=0;p<s-1;++p)oce(o[p],o[p+1],t,a,vl,wl);let f=o[s-1];m.subtract(f,o[s-2],Tf),m.normalize(Tf,Tf),m.multiplyByScalar(Tf,a,Tf),m.add(f,Tf,TM),oce(f,TM,t,a,vl,wl),i===Mi.ROUNDED&&(t.cartesianToCartographic(TM,Af),c=Af.latitude,u=Af.longitude,vl.latitude=Math.min(vl.latitude,c),vl.longitude=Math.min(vl.longitude,u),wl.latitude=Math.max(wl.latitude,c),wl.longitude=Math.max(wl.longitude,u));let d=l(r)?r:new ce;return d.north=wl.latitude,d.south=vl.latitude,d.east=wl.longitude,d.west=vl.longitude,d}function m_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+re.packedLength+Oe.packedLength+7}m_.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var dce=re.clone(re.UNIT_SPHERE),mce=new Oe,d_={positions:void 0,ellipsoid:dce,vertexFormat:mce,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};m_.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)r[h]=m.unpack(e,t);let o=re.unpack(e,t,dce);t+=re.packedLength;let s=Oe.unpack(e,t,mce);t+=Oe.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=Oe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(d_.positions=r,d_.width=a,d_.height=c,d_.extrudedHeight=u,d_.cornerType=f,d_.granularity=d,d_.shadowVolume=p,d_.offsetAttribute=g===-1?void 0:g,new m_(d_))};m_.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,r=y(e.ellipsoid,re.WGS84),o=y(e.cornerType,Mi.ROUNDED);return fce(n,r,i,o,t)};m_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=lce(t,i);let r=Er(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=W9e(u,c);else{let g=Vi.computePositions(u);if(f=uce(g,c,i),f.attributes.position.values=fi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let h=e._offsetAttribute===sn.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(h);f.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new ft({attributes:d,indices:f.indices,primitiveType:Le.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};m_.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new m_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(m_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=fce(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var fb=m_;var hce=new m,pce=new m,j9e=new m;function q9e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function _ce(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new pn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){a=r[f];let M=r[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),h;g&&(h=o[0].length-3,c+=h,u+=h,h/=3,d+=h*4);let x=c+u,b=new Float64Array(x),C=0,A=x-1,T,S,v,I,O,R,L=h/2,N=Be.createTypedArray(x/3,d+4),_=0;if(N[_++]=C/3,N[_++]=(A-2)/3,g){n.push(C/3),R=hce,O=pce;let M=o[0];for(f=0;f<L;f++)R=m.fromArray(M,(L-1-f)*3,R),O=m.fromArray(M,(L+f)*3,O),Vi.addAttribute(b,O,C),Vi.addAttribute(b,R,void 0,A),S=C/3,I=S+1,T=(A-2)/3,v=T-1,N[_++]=T,N[_++]=v,N[_++]=S,N[_++]=I,C+=3,A-=3}let E=0,w=i[E++],P=i[E++];for(b.set(w,C),b.set(P,A-P.length+1),p=P.length-3,n.push(C/3,(A-2)/3),f=0;f<p;f+=3)S=C/3,I=S+1,T=(A-2)/3,v=T-1,N[_++]=T,N[_++]=v,N[_++]=S,N[_++]=I,C+=3,A-=3;for(f=0;f<r.length;f++){let M;a=r[f];let B=a.leftPositions,V=a.rightPositions,U,G=j9e;if(l(B)){for(A-=3,U=v,n.push(I),M=0;M<B.length/3;M++)G=m.fromArray(B,M*3,G),N[_++]=U-M-1,N[_++]=U-M,Vi.addAttribute(b,G,void 0,A),A-=3;n.push(U-Math.floor(B.length/6)),t===Mi.BEVELED&&n.push((A-2)/3+1),C+=3}else{for(C+=3,U=I,n.push(v),M=0;M<V.length/3;M++)G=m.fromArray(V,M*3,G),N[_++]=U+M,N[_++]=U+M+1,Vi.addAttribute(b,G,C),C+=3;n.push(U+Math.floor(V.length/6)),t===Mi.BEVELED&&n.push(C/3-1),A-=3}for(w=i[E++],P=i[E++],w.splice(0,3),P.splice(P.length-3,3),b.set(w,C),b.set(P,A-P.length+1),p=P.length-3,M=0;M<P.length;M+=3)I=C/3,S=I-1,v=(A-2)/3,T=v+1,N[_++]=T,N[_++]=v,N[_++]=S,N[_++]=I,C+=3,A-=3;C-=3,A+=3,n.push(C/3,(A-2)/3)}if(g){C+=3,A-=3,R=hce,O=pce;let M=o[1];for(f=0;f<L;f++)R=m.fromArray(M,(h-f-1)*3,R),O=m.fromArray(M,f*3,O),Vi.addAttribute(b,R,void 0,A),Vi.addAttribute(b,O,C),I=C/3,S=I-1,v=(A-2)/3,T=v+1,N[_++]=T,N[_++]=v,N[_++]=S,N[_++]=I,C+=3,A-=3;n.push(C/3)}else n.push(C/3,(A-2)/3);return N[_++]=C/3,N[_++]=(A-2)/3,s.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:N,wallIndices:n}}function Y9e(e){let t=e.ellipsoid,n=Vi.computePositions(e),i=_ce(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=fi.scaleToGeodeticHeight(u,o,t),d=fi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===sn.TOP)T=T.fill(1,0,f);else{let S=e.offsetAttribute===sn.NONE?0:1;T=T.fill(S)}a.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,h=c.length,x=Be.createTypedArray(p.length/3,(h+r.length)*2);x.set(c);let b=h;for(g=0;g<h;g+=2){let T=c[g],S=c[g+1];x[b++]=T+f,x[b++]=S+f}let C,A;for(g=0;g<r.length;g++)C=r[g],A=C+f,x[b++]=C,x[b++]=A;return{attributes:a,indices:x}}function AM(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+re.packedLength+6}AM.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var gce=re.clone(re.UNIT_SPHERE),py={positions:void 0,ellipsoid:gce,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};AM.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)r[p]=m.unpack(e,t);let o=re.unpack(e,t,gce);t+=re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(py.positions=r,py.width=s,py.height=a,py.extrudedHeight=c,py.cornerType=u,py.granularity=f,py.offsetAttribute=d===-1?void 0:d,new AM(py))};AM.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=q9e(t,i);let r=Er(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=Y9e(c);else{let p=Vi.computePositions(c);if(u=_ce(p,c.cornerType),u.attributes.position.values=fi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,h=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(g/3).fill(h);u.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new ft({attributes:f,indices:u.indices,primitiveType:Le.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var EM=AM;var X9e=new ti(0);function Gc(e){ci.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Gc.prototype=Object.create(ci.prototype),Gc.prototype.constructor=Gc);Object.defineProperties(Gc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Ic.isSupported(this._scene)};Gc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Gc.prototype._computeCenter=fe.throwInstantiationError;Gc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&Nt(Nt.geometryZIndex),this._zIndex=y(r.zIndex,X9e),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new _d(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new ux(this._scene,a,o,s)}};Gc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ci.prototype.destroy.call(this)};Gc.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&Nt(Nt.geometryHeightReference);return}return t!==We.CLAMP_TO_GROUND?e:0};Gc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&Nt(Nt.geometryExtrudedHeightReference);return}return t!==We.CLAMP_TO_GROUND?e:Gc.CLAMP_TO_GROUND};Gc.CLAMP_TO_GROUND="clamp";Gc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return sn.ALL;if(r===1)return sn.TOP};var Jn=Gc;var yce=new z,xce=m.ZERO,bce=new m,Cce=new ce;function K9e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Wd(e,t){Jn.call(this,{entity:e,scene:t,geometryOptions:new K9e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Wd.prototype=Object.create(Jn.prototype),Wd.prototype.constructor=Wd);Wd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,yce)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,xce,bce))),new Ct({id:t,geometry:new fb(this._options),attributes:i})};Wd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,yce),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,xce,bce))),new Ct({id:t,geometry:new EM(this._options),attributes:r})};Wd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};Wd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ci.prototype._isHidden.call(this,e,t)};Wd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Wd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ve.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),r=q.getValueOrUndefined(t.extrudedHeight,Ve.MINIMUM_VALUE),o=q.getValueOrDefault(t.extrudedHeightReference,Ve.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ve.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ve.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,Ve.MINIMUM_VALUE),s.cornerType=q.getValueOrUndefined(t.cornerType,Ve.MINIMUM_VALUE),s.offsetAttribute=Jn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Jn.getGeometryHeight(n,i),r=Jn.getGeometryExtrudedHeight(r,o),r===Jn.CLAMP_TO_GROUND&&(r=oi.getMinimumMaximumHeights(fb.computeRectangle(s,Cce)).minimumTerrainHeight),s.extrudedHeight=r};Wd.DynamicGeometryUpdater=UA;function UA(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(UA.prototype=Object.create(ai.prototype),UA.prototype.constructor=UA);UA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ai.prototype._isHidden.call(this,e,t,n)};UA.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,We.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Jn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Jn.getGeometryHeight(r,o),s=Jn.getGeometryExtrudedHeight(s,a),s===Jn.CLAMP_TO_GROUND&&(s=oi.getMinimumMaximumHeights(fb.computeRectangle(i,Cce)).minimumTerrainHeight),i.extrudedHeight=s};var SM=Wd;function sV(){fe.throwInstantiationError()}Object.defineProperties(sV.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});sV.prototype.update=function(e){fe.throwInstantiationError()};sV.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Mo=sV;function ch(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(ch.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Tce=new m;ch.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Tce);return fW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};ch.prototype.isScaledSpacePointVisible=function(e){return fW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var J9e=new m;ch.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=J9e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),fW(e,r,i)};ch.prototype.computeHorizonCullingPoint=function(e,t,n){return Sce(this._ellipsoid,e,t,n)};var Ace=re.clone(re.UNIT_SPHERE);ch.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Ece(this._ellipsoid,n,Ace);return Sce(r,e,t,i)};ch.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return vce(this._ellipsoid,e,t,n,i,r)};ch.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Ece(this._ellipsoid,r,Ace);return vce(s,e,t,n,i,o)};var Z9e=[];ch.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,Z9e),r=ae.fromPoints(i);if(!(m.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var $9e=new m;function Ece(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,$9e);e=re.fromCartesian3(i,n)}return e}function Sce(e,t,n,i){l(i)||(i=new m);let r=Pce(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=wce(e,c,r);if(u<0)return;o=Math.max(o,u)}return Ice(r,o,i)}var aV=new m;function vce(e,t,n,i,r,o){l(o)||(o=new m),i=y(i,3),r=y(r,m.ZERO);let s=Pce(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){aV.x=n[c]+r.x,aV.y=n[c+1]+r.y,aV.z=n[c+2]+r.z;let f=wce(e,aV,s);if(f<0)return;a=Math.max(a,f)}return Ice(s,a,o)}function fW(e,t,n){let i=t,r=n,o=m.subtract(e,i,Tce),s=-m.dot(o,i);return!(r<0?s>0:s>r&&s*s/m.magnitudeSquared(o)>r)}var Q9e=new m,eWe=new m;function wce(e,t,n){let i=e.transformPositionToScaledSpace(t,Q9e),r=m.magnitudeSquared(i),o=Math.sqrt(r),s=m.divideByScalar(i,o,eWe);r=Math.max(1,r),o=Math.max(1,o);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function Ice(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var uW=new m;function Pce(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,uW),m.normalize(uW,uW))}var h_=ch;function Lo(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(r)&&(r=It.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var Dce=Lo.SHOW_INDEX=0,Mce=Lo.POSITION_INDEX=1,tWe=Lo.COLOR_INDEX=2,nWe=Lo.OUTLINE_COLOR_INDEX=3,iWe=Lo.OUTLINE_WIDTH_INDEX=4,rWe=Lo.PIXEL_SIZE_INDEX=5,oWe=Lo.SCALE_BY_DISTANCE_INDEX=6,sWe=Lo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,aWe=Lo.DISTANCE_DISPLAY_CONDITION_INDEX=8,cWe=Lo.DISABLE_DEPTH_DISTANCE_INDEX=9;Lo.NUMBER_OF_PROPERTIES=10;function Ef(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Lo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ef(this,Dce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Ef(this,Mce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ot.equals(t,e)||(this._scaleByDistance=Ot.clone(e,t),Ef(this,oWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ot.equals(t,e)||(this._translucencyByDistance=Ot.clone(e,t),Ef(this,sWe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Ef(this,rWe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Ef(this,tWe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Ef(this,nWe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ef(this,iWe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Ef(this,aWe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ef(this,cWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ef(this,Dce))}}});Lo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Lo.prototype._getActualPosition=function(){return this._actualPosition};Lo.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Ef(this,Mce)};var Rce=new oe;Lo._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(F.multiplyByPoint(n,e,Rce),Qi.computeActualWgs84Position(t,Rce))};var Oce=new oe;Lo._computeScreenSpacePosition=function(e,t,n,i){let r=F.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,Oce),Oce);return Qi.wgs84ToWindowCoordinates(n,r,i)};Lo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new H);let i=n.modelMatrix,r=Lo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};Lo.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new Ye),n.x=o,n.y=s,n.width=a,n.height=c,n};Lo.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Lo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Bs=Lo;var _y=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +void main() { - float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; - return vec4(intersection.xyz * scale, intersection.w); -} - -// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. -#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) -#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) -#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; -#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) - -#if (INTERSECTION_COUNT > 1) -void initializeIntersections(inout Intersections ix) { - // Sort the intersections from min T to max T with bubble sort. - // Note: If this sorting function changes, some of the intersection test may - // need to be updated. Search for "bubble sort" to find those areas. - const int sortPasses = INTERSECTION_COUNT * 2 - 1; - for (int n = sortPasses; n > 0; --n) { - for (int i = 0; i < sortPasses; ++i) { - // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= n) { break; } - - vec4 intersect0 = ix.intersections[i + 0]; - vec4 intersect1 = ix.intersections[i + 1]; + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - bool inOrder = intersect0.w <= intersect1.w; + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; - ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; - ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; - } +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 + { + discard; } +#else +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } +#endif +#endif - // Prepare initial state for nextIntersection - ix.index = 0; - ix.surroundCount = 0; - ix.surroundIsPositive = false; + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } -#endif +`;var vM=`uniform float u_maxTotalPointSize; -#if (INTERSECTION_COUNT > 1) -RayShapeIntersection nextIntersection(inout Intersections ix) { - vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); - RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance - const int passCount = INTERSECTION_COUNT * 2; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; - if (ix.index == passCount) { - return shapeIntersection; - } +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; - for (int i = 0; i < passCount; ++i) { - // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to continue instead. - if (i < ix.index) { - continue; - } +void main() +{ + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - ix.index = i + 1; + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - surfaceIntersection = ix.intersections[i]; - int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); - bool currShapeIsPositive = intersectionType < 2; - bool enter = intMod(intersectionType, 2) == 0; - - ix.surroundCount += enter ? +1 : -1; - ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; - - // entering positive or exiting negative - if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { - shapeIntersection.entry = surfaceIntersection; - } + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); - // exiting positive or entering negative after being inside positive - bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; - bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; - if (exitPositive || enterNegativeFromPositive) { - shapeIntersection.exit = surfaceIntersection; +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; - // entry and exit have been found, so the loop can stop - if (exitPositive) { - // After exiting positive shape there is nothing left to intersect, so jump to the end index. - ix.index = passCount; - } - break; - } - } + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - return shapeIntersection; -} + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var NL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersectionPair, INF_HIT, NO_HIT - -/* intersectDepth defines (set in Scene/VoxelRenderResources.js) -#define DEPTH_INTERSECTION_INDEX ### -*/ - -uniform mat4 u_transformPositionViewToUv; + /////////////////////////////////////////////////////////////////////////// -void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); - if (logDepthOrDepth != 0.0) { - // Calculate how far the ray must travel before it hits the depth buffer. - vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); - eyeCoordinateDepth /= eyeCoordinateDepth.w; - vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); - float t = dot(depthPositionUv - ray.pos, ray.dir); - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); - } else { - // There's no depth at this location. - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); - } -} -`;var FL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, -// NO_HIT, setIntersectionPair + vec4 color; + vec4 outlineColor; + vec4 pickColor; -/* Clipping plane defines (set in Scene/VoxelRenderResources.js) -#define CLIPPING_PLANES_UNION -#define CLIPPING_PLANES_COUNT -#define CLIPPING_PLANES_INTERSECTION_INDEX -*/ + // compressedAttribute0.z => pickColor.rgb -uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); -// Plane is in Hessian Normal Form -vec4 intersectPlane(in Ray ray, in vec4 plane) { - vec3 n = plane.xyz; // normal - float w = plane.w; // -dot(pointOnPlane, normal) + // compressedAttribute0.x => color.rgb - float a = dot(ray.pos, n); - float b = dot(ray.dir, n); - float t = -(w + a) / b; + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); - return vec4(n, t); -} + // compressedAttribute0.y => outlineColor.rgb -void intersectClippingPlanes(in Ray ray, inout Intersections ix) { - vec4 backSide = vec4(-ray.dir, -INF_HIT); - vec4 farSide = vec4(ray.dir, +INF_HIT); - RayShapeIntersection clippingVolume; + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); - #if (CLIPPING_PLANES_COUNT == 1) - // Union and intersection are the same when there's one clipping plane, and the code - // is more simplified. - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - bool reflects = dot(ray.dir, intersection.xyz) < 0.0; - clippingVolume.entry = reflects ? backSide : intersection; - clippingVolume.exit = reflects ? intersection : farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #elif defined(CLIPPING_PLANES_UNION) - vec4 firstTransmission = vec4(ray.dir, +INF_HIT); - vec4 lastReflection = vec4(-ray.dir, -INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; - } else { - lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; - } - } - clippingVolume.entry = backSide; - clippingVolume.exit = lastReflection; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); - clippingVolume.entry = firstTransmission; - clippingVolume.exit = farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); - #else // intersection - vec4 lastTransmission = vec4(ray.dir, -INF_HIT); - vec4 firstReflection = vec4(-ray.dir, +INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; - } else { - firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; - } - } - if (lastTransmission.w < firstReflection.w) { - clippingVolume.entry = lastTransmission; - clippingVolume.exit = firstReflection; - } else { - clippingVolume.entry = vec4(-ray.dir, NO_HIT); - clippingVolume.exit = vec4(ray.dir, NO_HIT); - } - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #endif -} -`;var UL=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT -// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a -/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_INTERSECTION_INDEX ### // always 0 -*/ + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; -uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; -struct Box { - vec3 p0; - vec3 p1; -}; + /////////////////////////////////////////////////////////////////////////// -Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) -{ - // Find the min/max cornerpoints of the voxel in tile coordinates - vec3 tileOrigin = vec3(octreeCoords.xyz); - vec3 numSamples = vec3(u_dimensions); - vec3 voxelSize = 1.0 / numSamples; - vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; - vec3 coordP1 = coordP0 + voxelSize; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; - // Transform to the UV coordinates of the scaled tileset - float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); - vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); - vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); + /////////////////////////////////////////////////////////////////////////// - return Box(p0, p1); -} +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif -vec3 getBoxNormal(in Box box, in Ray ray, in float t) -{ - vec3 hitPoint = ray.pos + t * ray.dir; - vec3 lower = step(hitPoint, box.p0); - vec3 upper = step(box.p1, hitPoint); - return normalize(upper - lower); -} +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } -// Find the distances along a ray at which the ray intersects an axis-aligned box -// See https://tavianator.com/2011/ray_box.html -RayShapeIntersection intersectBox(in Ray ray, in Box box) -{ - // Consider the box as the intersection of the space between 3 pairs of parallel planes - // Compute the distance along the ray to each plane - vec3 t0 = (box.p0 - ray.pos) * ray.dInv; - vec3 t1 = (box.p1 - ray.pos) * ray.dInv; + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) + { + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } - // Identify candidate entries/exits based on distance from ray.pos - vec3 entries = min(t0, t1); - vec3 exits = max(t0, t1); + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); + } +#endif - // The actual box intersection points are the furthest entry and the closest exit - float entryT = max(max(entries.x, entries.y), entries.z); - float exitT = min(min(exits.x, exits.y), exits.z); +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepth.x; + float farSq = distanceDisplayConditionAndDisableDepth.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif - vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); - vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); + gl_Position = czm_projection * positionEC; + czm_vertexLogDepth(); - if (entryT > exitT) { - entryT = NO_HIT; - exitT = NO_HIT; +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } - return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); -} - -void intersectShape(in Ray ray, inout Intersections ix) -{ - RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); - setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); -} -`;var VL=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, -// setIntersectionPair - -/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO - -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED - -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN -#define CYLINDER_INTERSECTION_INDEX_ANGLE -*/ - -// Cylinder uniforms -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - uniform vec3 u_cylinderUvToRenderBoundsScale; - uniform vec3 u_cylinderUvToRenderBoundsTranslate; -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - uniform float u_cylinderUvToRenderRadiusMin; + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); #endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) - uniform vec2 u_cylinderRenderAngleMinMax; + } + } #endif -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); - - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; - return vec4(-INF_HIT, t, t, +INF_HIT); + v_pickColor = pickColor; } +`;var lWe=Bs.SHOW_INDEX,hW=Bs.POSITION_INDEX,Lce=Bs.COLOR_INDEX,uWe=Bs.OUTLINE_COLOR_INDEX,fWe=Bs.OUTLINE_WIDTH_INDEX,dWe=Bs.PIXEL_SIZE_INDEX,Nce=Bs.SCALE_BY_DISTANCE_INDEX,Fce=Bs.TRANSLUCENCY_BY_DISTANCE_INDEX,Bce=Bs.DISTANCE_DISPLAY_CONDITION_INDEX,mWe=Bs.DISABLE_DEPTH_DISTANCE_INDEX,pW=Bs.NUMBER_OF_PROPERTIES,rc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Sf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(pW),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Sf.prototype,{length:{get:function(){return _W(this),this._pointPrimitives.length}}});function kce(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Sf.prototype.add=function(e){let t=new Bs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Sf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Sf.prototype.removeAll=function(){kce(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function _W(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}Sf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Sf.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Sf.prototype.get=function(e){return _W(this),this._pointPrimitives[e]};Sf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<pW;++i){let r=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function hWe(e,t,n){return new Wp(e,[{index:rc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[hW]},{index:rc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[hW]},{index:rc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lce]},{index:rc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Fce]},{index:rc.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Nce]},{index:rc.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:X.FLOAT,usage:n[Bce]}],t)}var dW=new Yn;function Uce(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(o,dW);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[rc.positionHighAndSize],u=dW.high;c(r,u.x,u.y,u.z,s);let f=n[rc.positionLowAndOutline],d=dW.low;f(r,d.x,d.y,d.z,a)}var cV=65536,wM=256;function Vce(e,t,n,i){let r=i._index,o=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(o.red),u=z.floatToByte(o.green),f=z.floatToByte(o.blue),d=c*cV+u*wM+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*cV+u*wM+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let g=c*cV+u*wM+f,h=z.floatToByte(o.alpha)*cV+z.floatToByte(a.alpha)*wM+z.floatToByte(s.alpha),x=n[rc.compressedAttribute0];x(r,d,p,g,h)}function zce(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*wM+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[rc.compressedAttribute1];g(r,d,p,o,a)}function Hce(e,t,n,i){let r=i._index,o=n[rc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function Gce(e,t,n,i){let r=i._index,o=n[rc.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(r,s,a,u)}function pWe(e,t,n,i){Uce(e,t,n,i),Vce(e,t,n,i),zce(e,t,n,i),Hce(e,t,n,i),Gce(e,t,n,i)}function mW(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Bs._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function _We(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(o,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&mW(e,i,i.length,t,o,!0)):n===ne.MORPHING?mW(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&mW(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function gWe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var yWe=[];Sf.prototype.update=function(e){if(_W(this),!this.show)return;this._maxTotalPointSize=Ht.maximumAliasedPointSize,_We(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<pW;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=hWe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let I=this._pointPrimitives[v];I._dirty=!1,pWe(this,c,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=yWe;v.length=0,(o[hW]||o[fWe]||o[dWe])&&v.push(Uce),(o[Lce]||o[uWe])&&v.push(Vce),(o[lWe]||o[Fce])&&v.push(zce),o[Nce]&&v.push(Hce),(o[Bce]||o[mWe])&&v.push(Gce);let I=v.length;if(a=this._vaf.writers,r/n>.1){for(let O=0;O<r;++O){let R=i[O];R._dirty=!1;for(let L=0;L<I;++L)v[L](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<r;++O){let R=i[O];R._dirty=!1;for(let L=0;L<I;++L)v[L](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=F.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),gWe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Ir.OPAQUE||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ir.TRANSLUCENT||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:dn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new ze({sources:[vM]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT&&(x=new ze({defines:["OPAQUE"],sources:[_y]}),this._sp=Jt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:rc}),x=new ze({defines:["TRANSLUCENT"],sources:[_y]}),this._spTranslucent=Jt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:rc})),this._blendOption===Ir.OPAQUE&&(x=new ze({sources:[_y]}),this._sp=Jt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:rc})),this._blendOption===Ir.TRANSLUCENT&&(x=new ze({sources:[_y]}),this._spTranslucent=Jt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:rc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,C,A,T,S=e.commandList;if(u.render||f){let v=this._colorCommands,I=this._blendOption===Ir.OPAQUE,O=this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,C=b.length,v.length=C;let R=O?C*2:C;for(T=0;T<R;++T){let L=I||O&&T%2===0;A=v[T],l(A)||(A=v[T]=new tt),A.primitiveType=Le.POINTS,A.pass=L||!O?Ee.OPAQUE:Ee.TRANSLUCENT,A.owner=this;let N=O?Math.floor(T/2):T;A.boundingVolume=d,A.modelMatrix=p,A.shaderProgram=L?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[N].va,A.renderState=L?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",S.push(A)}}};Sf.prototype.isDestroyed=function(){return!1};Sf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),kce(this._pointPrimitives),ue(this)};var VA=Sf;var Wce=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],gW=1,IM=8,db=class{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==gW)throw new Error(`Got v${r} data when expected v${gW}.`);let o=Wce[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new db(a,s,o,t)}constructor(t,n=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=Wce.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,IM,t),this.coords=new this.ArrayType(this.data,IM+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(IM+s+a+c),this.ids=new this.IndexArrayType(this.data,IM,t),this.coords=new this.ArrayType(this.data,IM+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(gW<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return xW(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let C=s[2*b],A=s[2*b+1];C>=t&&C<=i&&A>=n&&A<=r&&u.push(o[b])}continue}let g=p+d>>1,h=s[2*g],x=s[2*g+1];h>=t&&h<=i&&x>=n&&x<=r&&u.push(o[g]),(f===0?t<=h:n<=x)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:r>=x)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)jce(o[2*b],o[2*b+1],t,n)<=u&&c.push(r[b]);continue}let g=p+d>>1,h=o[2*g],x=o[2*g+1];jce(h,x,t,n)<=u&&c.push(r[g]),(f===0?t-i<=h:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=x)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function xW(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;qce(e,t,s,i,r,o),xW(e,t,n,i,s-1,1-o),xW(e,t,n,s+1,r,1-o)}function qce(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/u+g)),x=Math.min(r,Math.floor(n+(u-f)*p/u+g));qce(e,t,n,h,x,o)}let s=t[2*n+o],a=i,c=r;for(PM(e,t,i,n),t[2*r+o]>s&&PM(e,t,i,r);a<c;){for(PM(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?PM(e,t,i,c):(c++,PM(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function PM(e,t,n,i){yW(e,n,i),yW(t,2*n,2*i),yW(t,2*n+1,2*i+1)}function yW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function jce(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function jd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new _e,this.show=y(e.show,!0)}function Yce(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var xWe=new Ye;function Xce(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=Zg.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=gr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Bs.getScreenSpaceBoundingBox(e,t,r)),Yce(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Jce(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=Zg.getScreenSpaceBoundingBox(s,t,xWe);Yce(a,n),r=Ye.union(r,a,r)}return r}function bWe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Jce(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Kce(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function Jce(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function bW(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var CWe=new Ye,TWe=new Ye,AWe=new Ye;function EWe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new ih({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new au({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new VA;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,h=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,b=n.camera.positionWC,C=new h_(x,b),A=[];e._clusterLabels&&bW(i,A,n,C,e),e._clusterBillboards&&bW(r,A,n,C,e),e._clusterPoints&&bW(o,A,n,C,e);let T,S,v,I,O,R,L,N,_,E,w,P;if(A.length>0){let M=new db(A.length,64,Uint32Array);for(let B=0;B<A.length;++B)M.add(A[B].coord.x,A[B].coord.y);if(M.finish(),h<g)for(v=d.length,T=0;T<v;++T){let B=d[T];if(!C.isPointVisible(B.position))continue;let V=gr._computeScreenSpacePosition(F.IDENTITY,B.position,m.ZERO,H.ZERO,n);if(!l(V))continue;let U=1-h/g,G=B.width=B.width*U,k=B.height=B.height*U;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let Y=V.x-G*.5,j=V.y-k*.5,J=V.x+G,W=V.y+k;for(O=M.range(Y,j,J,W),R=O.length,E=0,_=[],S=0;S<R;++S)L=O[S],N=A[L],N.clustered||(++E,w=N.collection,P=N.index,_.push(w.get(P).id));if(E>=f)for(Kce(B.position,E,_,e),p.push(B),S=0;S<R;++S)A[O[S]].clustered=!0}for(v=A.length,T=0;T<v;++T){let B=A[T];if(B.clustered)continue;B.clustered=!0,w=B.collection,P=B.index;let V=w.get(P);I=Xce(V,B.coord,u,e,CWe);let U=Ye.clone(I,TWe);O=M.range(I.x,I.y,I.x+I.width,I.y+I.height),R=O.length;let G=m.clone(V.position);for(E=1,_=[V.id],S=0;S<R;++S)if(L=O[S],N=A[L],!N.clustered){let k=N.collection.get(N.index),Y=Xce(k,N.coord,u,e,AWe);m.add(k.position,G,G),Ye.union(U,Y,U),++E,_.push(k.id)}if(E>=f){let k=m.multiplyByScalar(G,1/E,G);for(Kce(k,E,_,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),S=0;S<R;++S)A[O[S]].clustered=!0}else bWe(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}jd.prototype._initialize=function(e){this._scene=e;let t=EWe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(jd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function TW(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.pop(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function AW(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}jd.prototype.getLabel=TW("_labelCollection",ih,"_unusedLabelIndices","labelIndex");jd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,AW(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};jd.prototype.getBillboard=TW("_billboardCollection",au,"_unusedBillboardIndices","billboardIndex");jd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,AW(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};jd.prototype.getPoint=TW("_pointCollection",VA,"_unusedPointIndices","pointIndex");jd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,AW(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function CW(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function SWe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,CW(e._labelCollection),CW(e._billboardCollection),CW(e._pointCollection))}jd.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,SWe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};jd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var uu=jd;function EW(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Fs(this),this._entityCluster=new uu}Object.defineProperties(EW.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Mo.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});EW.prototype.update=function(e){return!0};var DM=EW;var Zce={};Zce.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,h=r?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*D.TWO_PI,b=Math.cos(x),C=Math.sin(x),A=b*n,T=C*n,S=b*t,v=C*t;u[p+g]=A,u[p+g+1]=T,u[p+g+2]=s,u[p+h]=S,u[p+h+1]=v,u[p+h+2]=o,p+=3,r&&(u[d++]=A,u[d++]=T,u[d++]=s,u[d++]=S,u[d++]=v,u[d++]=o)}return u};var mb=Zce;var SW=new H,vWe=new m,wWe=new m,IWe=new m,PWe=new m;function p_(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Oe.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}p_.packedLength=Oe.packedLength+5;p_.pack=function(e,t,n){return n=y(n,0),Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var $ce=new Oe,zA={vertexFormat:$ce,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};p_.unpack=function(e,t,n){t=y(t,0);let i=Oe.unpack(e,t,$ce);t+=Oe.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Oe.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(zA.length=r,zA.topRadius=o,zA.bottomRadius=s,zA.slices=a,zA.offsetAttribute=c===-1?void 0:c,new p_(zA))};p_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=mb.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,h,x=r.normal||r.tangent||r.bitangent;if(x){let O=r.tangent||r.bitangent,R=0,L=0,N=0,_=Math.atan2(i-n,t),E=vWe;E.z=Math.sin(_);let w=Math.cos(_),P=IWe,M=wWe;for(h=0;h<o;h++){let B=h/o*D.TWO_PI,V=w*Math.cos(B),U=w*Math.sin(B);x&&(E.x=V,E.y=U,O&&(P=m.normalize(m.cross(m.UNIT_Z,E,P),P)),r.normal&&(d[R++]=E.x,d[R++]=E.y,d[R++]=E.z,d[R++]=E.x,d[R++]=E.y,d[R++]=E.z),r.tangent&&(p[L++]=P.x,p[L++]=P.y,p[L++]=P.z,p[L++]=P.x,p[L++]=P.y,p[L++]=P.z),r.bitangent&&(M=m.normalize(m.cross(E,P,M),M),g[N++]=M.x,g[N++]=M.y,g[N++]=M.z,g[N++]=M.x,g[N++]=M.y,g[N++]=M.z))}for(h=0;h<o;h++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),r.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(h=0;h<o;h++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),r.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let b=12*o-12,C=Be.createTypedArray(c,b),A=0,T=0;for(h=0;h<o-1;h++)C[A++]=T,C[A++]=T+2,C[A++]=T+3,C[A++]=T,C[A++]=T+3,C[A++]=T+1,T+=2;for(C[A++]=s-2,C[A++]=0,C[A++]=1,C[A++]=s-2,C[A++]=1,C[A++]=s-1,h=1;h<o-1;h++)C[A++]=s+h+1,C[A++]=s+h,C[A++]=s;for(h=1;h<o-1;h++)C[A++]=a,C[A++]=a+h,C[A++]=a+h+1;let S=0;if(r.st){let O=Math.max(n,i);for(h=0;h<c;h++){let R=m.fromArray(u,h*3,PWe);f[S++]=(R.x+O)/(2*O),f[S++]=(R.y+O)/(2*O)}}let v=new pn;r.position&&(v.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),SW.x=t*.5,SW.y=Math.max(i,n);let I=new ae(m.ZERO,H.magnitude(SW));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===sn.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new ft({attributes:v,indices:C,primitiveType:Le.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var vW;p_.getUnitCylinder=function(){return l(vW)||(vW=p_.createGeometry(new p_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Oe.POSITION_ONLY}))),vW};var RM=p_;var wW=new H;function HA(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.slices,128),o=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}HA.packedLength=6;HA.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var hb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};HA.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(hb.length=i,hb.topRadius=r,hb.bottomRadius=o,hb.slices=s,hb.numberOfVerticalLines=a,hb.offsetAttribute=c===-1?void 0:c,new HA(hb))};HA.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=mb.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let x=Math.min(o,r);u=Math.round(r/x),c+=x}let f=Be.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new pn;g.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),wW.x=t*.5,wW.y=Math.max(i,n);let h=new ae(m.ZERO,H.magnitude(wW));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===sn.NONE?0:1,b=new Uint8Array(t/3).fill(x);g.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new ft({attributes:g,indices:f,primitiveType:Le.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var OM=HA;var Qce=m.ZERO,ele=new m,DWe=new m,tle=new z;function RWe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function fu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new RWe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(fu.prototype=Object.create(ci.prototype),fu.prototype.constructor=fu);Object.defineProperties(fu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});fu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Hn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,tle)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qce,ele))),new Ct({id:t,geometry:new RM(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};fu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,tle),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qce,ele))),new Ct({id:t,geometry:new OM(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:o})};fu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};fu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ci.prototype._isHidden.call(this,e,t)};fu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};fu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ve.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ve.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ve.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,Ve.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ve.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?sn.ALL:void 0};fu.prototype._onEntityPropertyChanged=yp;fu.DynamicGeometryUpdater=GA;function GA(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(GA.prototype=Object.create(ai.prototype),GA.prototype.constructor=GA);GA.prototype._isHidden=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(e.position,n,DWe);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ai.prototype._isHidden.call(this,e,t,n)};GA.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=q.getValueOrUndefined(t.length,n),r.topRadius=q.getValueOrUndefined(t.topRadius,n),r.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),r.slices=q.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?sn.ALL:void 0};var MM=fu;var OWe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},No=Object.freeze(OWe);var MWe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},yr=Object.freeze(MWe);var LWe={NONE:0,HOLD:1,EXTRAPOLATE:2},du=Object.freeze(LWe);var nle=Ki(Xl(),1);function NWe(e){let t=new nle.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var __=NWe;var FWe=D.factorial;function IW(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=IW(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var lV={type:"Hermite"};lV.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};lV.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c,u,f,d=t.length,p=new Array(i);for(o=0;o<i;o++){r[o]=0;let b=new Array(d);for(p[o]=b,s=0;s<d;s++)b[s]=[]}let g=d,h=new Array(g);for(o=0;o<g;o++)h[o]=o;let x=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=h[s]*i+c,p[c][0].push(n[f]);for(o=1;o<g;o++){let b=!1;for(s=0;s<g-o;s++){let C=t[h[s]],A=t[h[s+o]],T;A-C<=0?(f=h[s]*i+i*o+c,T=n[f],p[c][o].push(T/FWe(o))):(T=p[c][o-1][s+1]-p[c][o-1][s],p[c][o].push(T/(A-C))),b=b||T!==0}b||(x=o-1)}}for(a=0,u=0;a<=u;a++)for(o=a;o<=x;o++){let b=IW(e,h,t,a,o,[]);for(c=0;c<i;c++){let C=p[c][o][0];r[c+a*i]+=C*b}}return r};var BWe=[];lV.interpolate=function(e,t,n,i,r,o,s){let a=i*(o+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,u=new Array(c*(r+1)),f;for(f=0;f<c;f++)for(let C=0;C<r+1;C++)u[f*(r+1)+C]=f;let d=u.length,p=BWe,g=kWe(p,u,t,n,i,r),h=[],x=d*(d+1)/2,b=Math.min(g,o);for(let C=0;C<=b;C++)for(f=C;f<=g;f++){h.length=0;let A=IW(e,u,t,C,f,h),T=Math.floor(f*(1-f)/2)+d*f;for(let S=0;S<i;S++){let v=Math.floor(S*x),I=p[v+T];s[S+C*i]+=I*A}}return s};function kWe(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let h=0,x=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let C=n[t[s]],A=n[t[s+g]],T,S;if(A-C<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],S=T/D.factorial(g),e[p+x+h]=S,h++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],S=T/(A-C),e[p+x+h]=S,h++}b=b||T!==0}b&&(c=Math.max(c,g))}}return c}var LM=lV;var PW={type:"Lagrange"};PW.getRequiredDataPoints=function(e){return Math.max(e+1,2)};PW.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a=t.length;for(o=0;o<i;o++)r[o]=0;for(o=0;o<a;o++){let c=1;for(s=0;s<a;s++)if(s!==o){let u=t[o]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)r[s]+=c*n[o*i+s]}return r};var NM=PW;var DW={type:"Linear"};DW.getRequiredDataPoints=function(e){return 2};DW.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c=t[0],u=t[1];for(o=0;o<i;o++)s=n[o],a=n[o+i],r[o]=((a-s)*e+u*s-c*a)/(u-c);return r};var pb=DW;function oc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}oc.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new oc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};oc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new oc(e.clock,e.cone,e.magnitude)};oc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new oc(e.clock,e.cone,1)};oc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};oc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};oc.prototype.equals=function(e){return oc.equals(this,e)};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.equalsEpsilon=function(e,t){return oc.equalsEpsilon(this,e,t)};oc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var FM=oc;var zM=Ki(Xl(),1);var RW;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?RW=function(){return performance.now()}:RW=function(){return Date.now()};var Ci=RW;function OW(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=ee.clone(t):l(n)?t=ee.clone(n):l(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),l(n)?n=ee.clone(n):n=ee.clone(t),l(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,No.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ci(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,yr.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(OW.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===yr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===yr.SYSTEM_CLOCK&&(this._clockStep=yr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});OW.prototype.tick=function(){let e=Ci(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===yr.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===yr.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===No.CLAMPED)ee.lessThan(t,o)?t=ee.clone(o,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(r===No.LOOP_STOP)for(ee.lessThan(t,o)&&(t=ee.clone(o,t));ee.greaterThan(t,s);)t=ee.addSeconds(o,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var qd=OW;function _b(){this._definitionChanged=new _e,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(_b.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:dl("startTime"),stopTime:dl("stopTime"),currentTime:dl("currentTime"),clockRange:dl("clockRange"),clockStep:dl("clockStep"),multiplier:dl("multiplier")});_b.prototype.clone=function(e){return l(e)||(e=new _b),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};_b.prototype.equals=function(e){return this===e||l(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};_b.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};_b.prototype.getValue=function(e){return l(e)||(e=new qd),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var Yd=_b;var UWe=z.WHITE,VWe=.1,zWe=new H(8,8),HWe=new H(0,0),GWe=new H(1,1);function WA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(WA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});WA.prototype.getType=function(e){return"Grid"};WA.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,UWe,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,VWe),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,zWe,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,GWe,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,HWe,t.lineOffset),t};WA.prototype.equals=function(e){return this===e||e instanceof WA&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var jA=WA;function qA(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(qA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});qA.prototype.getType=function(e){return"PolylineArrow"};qA.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};qA.prototype.equals=function(e){return this===e||e instanceof qA&&q.equals(this._color,e._color)};var YA=qA;var WWe=z.WHITE,jWe=z.TRANSPARENT,qWe=16,YWe=255;function XA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(XA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});XA.prototype.getType=function(e){return"PolylineDash"};XA.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,WWe,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,jWe,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,qWe,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,YWe,t.dashPattern),t};XA.prototype.equals=function(e){return this===e||e instanceof XA&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var KA=XA;var XWe=z.WHITE,KWe=.25,JWe=1;function JA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(JA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});JA.prototype.getType=function(e){return"PolylineGlow"};JA.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,XWe,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,KWe,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,JWe,t.taperPower),t};JA.prototype.equals=function(e){return this===e||e instanceof JA&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var ZA=JA;var ZWe=z.WHITE,$We=z.BLACK,QWe=1;function $A(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties($A.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});$A.prototype.getType=function(e){return"PolylineOutline"};$A.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,ZWe,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,$We,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,QWe),t};$A.prototype.equals=function(e){return this===e||e instanceof $A&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var gy=$A;function g_(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Do,this._referenceFrame=y(t,ar.FIXED),this.setValue(e)}Object.defineProperties(g_.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});g_.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};g_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};g_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,g_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};g_.prototype.equals=function(e){return this===e||e instanceof g_&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};g_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var y_=g_;function yy(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Do,this.setValue(e)}Object.defineProperties(yy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});yy.prototype.getValue=function(e,t){let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};yy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,yy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};yy.prototype.equals=function(e){return this===e||e instanceof yy&&q.arrayEquals(this._value,e._value)};yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var QA=yy;function gb(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(mu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function mu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(mu.prototype._onCollectionChanged,this)}Object.defineProperties(mu.prototype,{isConstant:{get:function(){return q.isConstant(gb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=gb(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return gb(this)}}});mu.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new mu(e,n,i)};mu.prototype.getValue=function(e,t){let n=gb(this);return l(n)?n.getValue(e,t):void 0};mu.prototype.getValueInReferenceFrame=function(e,t,n){let i=gb(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};mu.prototype.getType=function(e){let t=gb(this);return l(t)?t.getType(e):void 0};mu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};mu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};mu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(mu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=gb(this),l(i)&&this._definitionChanged.raiseEvent(this))};var x_=mu;var e7e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-D.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+D.TWO_PI:r}},vf=e7e;var ile={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function rle(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function ole(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var MW=[],LW=[];function uV(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=ole(i[o],e),c=Or(t,f,ee.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=ole(i[o],e),!(l(a)&&ee.compare(a,f)>=0||l(d)&&ee.compare(f,d)>=0));){for(MW[p++]=f,o=o+1,s=0;s<r;s++)LW[g++]=i[o],o=o+1;a=f}p>0&&(LW.length=g,rle(n,u,LW),MW.length=p,rle(t,c,MW))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Xd(e,t){let n=e;n===Number&&(n=ile);let i=n.packedLength,r=y(n.packedInterpolationLength,i),o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=ile);let f=u.packedLength;i+=f,r+=y(u.packedInterpolationLength,f),s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=pb,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new _e,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=du.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=du.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Xd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});Xd.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Or(n,e,ee.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===du.NONE||r!==0&&ee.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===du.HOLD)return o.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===du.NONE||r!==0&&ee.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===du.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,x=i-1;if(x-h+1>=g+1){let S=a-(g/2|0)-1;S<h&&(S=h);let v=S+g;v>x&&(v=x,S=v-g,S<h&&(S=h)),h=S,x=v}let C=x-h+1;for(let S=0;S<C;++S)c[S]=ee.secondsDifference(n[h+S],n[x]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,h,x,u);else{let S=0,v=this._packedLength,I=h*v,O=(x+1)*v;for(;I<O;)u[S]=s[I],I++,S++}let A=ee.secondsDifference(e,n[x]),T;if(p===0||!l(f.interpolate))T=f.interpolateOrderZero(A,c,u,d,this._interpolationResult);else{let S=Math.floor(d/(p+1));T=f.interpolate(A,c,u,S,p,p,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(T,s,h,x,t):o.unpack(T,0,t)}return o.unpack(s,a*this._packedLength,t)};Xd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Xd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}uV(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}uV(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.addSamplesPackedArray=function(e,t){uV(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.removeSample=function(e){let t=Or(this._times,e,ee.compare);return t<0?!1:(sle(this,t,1),!0)};function sle(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Xd.prototype.removeSamples=function(e){let t=this._times,n=Or(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Or(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,sle(this,n,i-n)};Xd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!ee.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};Xd._mergeNewSamples=uV;var hu=Xd;function wf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new hu(m,n),this._definitionChanged=new _e,this._referenceFrame=y(e,ar.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(wf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});wf.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};wf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return mp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};wf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};wf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};wf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};wf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};wf.prototype.removeSample=function(e){return this._property.removeSample(e)};wf.prototype.removeSamples=function(e){this._property.removeSamples(e)};wf.prototype.equals=function(e){return this===e||e instanceof wf&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ra=wf;var t7e={HORIZONTAL:0,VERTICAL:1},Kd=Object.freeze(t7e);var n7e=Kd.HORIZONTAL,i7e=z.WHITE,r7e=z.BLACK,o7e=0,s7e=1;function eE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(eE.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});eE.prototype.getType=function(e){return"Stripe"};eE.prototype.getValue=function(e,t){return l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,n7e)===Kd.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,i7e,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,r7e,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,o7e),t.repeat=q.getValueOrDefault(this._repeat,e,s7e),t};eE.prototype.equals=function(e){return this===e||e instanceof eE&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var tE=eE;function xy(e){this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(xy.prototype._intervalsChanged,this),this._referenceFrame=y(e,ar.FIXED)}Object.defineProperties(xy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});xy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};xy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return mp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};xy.prototype.equals=function(e){return this===e||e instanceof xy&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};xy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var b_=xy;function yb(){this._definitionChanged=new _e,this._intervals=new Oo,this._intervals.changedEvent.addEventListener(yb.prototype._intervalsChanged,this)}Object.defineProperties(yb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});yb.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};yb.prototype.equals=function(e){return this===e||e instanceof yb&&this._intervals.equals(e._intervals,q.equals)};yb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var C_=yb;function nE(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=y(t,!0),this.position=e}Object.defineProperties(nE.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var a7e=new m,ale=new m,cle=new ee,NW=1/60;nE.prototype.getValue=function(e,t){return this._getValue(e,t)};nE.prototype._getValue=function(e,t,n){l(t)||(t=new m);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let r=i.getValue(e,a7e),o=i.getValue(ee.addSeconds(e,NW,cle),ale);if(!l(r)||!l(o)&&(o=r,r=i.getValue(ee.addSeconds(e,-NW,cle),ale),!l(r)))return;if(m.equals(r,o))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&r.clone(n);let s=m.subtract(o,r,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,NW,t)};nE.prototype.equals=function(e){return this===e||e instanceof nE&&q.equals(this._position,e._position)};var xb=nE;function BM(e,t){this._velocityVectorProperty=new xb(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=y(t,re.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(BM.prototype,{isConstant:{get:function(){return q.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var lle=new m,c7e=new m,ule=new $;BM.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,c7e,lle);if(l(n))return Mt.rotationMatrixFromPositionVelocity(lle,n,this._ellipsoid,ule),Ne.fromRotationMatrix(ule,t)};BM.prototype.equals=function(e){return this===e||e instanceof BM&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var kM=BM;function by(){}by.packedLength=m.packedLength;by.unpack=m.unpack;by.pack=m.pack;var FW;function UM(e,t){return t[0]==="#"&&(t=FW+t),x_.fromString(e,t)}function fle(e,t,n){if(l(n.reference))return UM(t,n.reference);if(l(n.velocityReference)){let i=UM(t,n.velocityReference);switch(e){case m:case by:return new xb(i,e===by);case Ne:return new kM(i)}}throw new de(`${JSON.stringify(n)} is not valid CZML.`)}function l7e(e,t){return new _d(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var zi=new m,Wc=new FM,sc=new me,bb=new An,fV=new Ne;function u7e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function dle(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Ie.createIfNeeded(n)}function f7e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=D.toRadians(n[r+1]),t[r+2]=D.toRadians(n[r+2]),t[r+3]=D.toRadians(n[r+3]),t[r+4]=D.toRadians(n[r+4]);return t}function d7e(e){let t=e.length;if(Wc.magnitude=1,t===2)return Wc.clock=e[0],Wc.cone=e[1],m.fromSpherical(Wc,zi),[zi.x,zi.y,zi.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Wc.clock=e[i+1],Wc.cone=e[i+2],m.fromSpherical(Wc,zi),n[r+1]=zi.x,n[r+2]=zi.y,n[r+3]=zi.z;return n}function m7e(e){let t=e.length;if(t===3)return Wc.clock=e[0],Wc.cone=e[1],Wc.magnitude=e[2],m.fromSpherical(Wc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Wc.clock=e[i+1],Wc.cone=e[i+2],Wc.magnitude=e[i+3],m.fromSpherical(Wc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function h7e(e){let t=e.length;if(t===3)return sc.longitude=e[0],sc.latitude=e[1],sc.height=e[2],re.WGS84.cartographicToCartesian(sc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],sc.longitude=e[i+1],sc.latitude=e[i+2],sc.height=e[i+3],re.WGS84.cartographicToCartesian(sc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function p7e(e){let t=e.length;if(t===3)return sc.longitude=D.toRadians(e[0]),sc.latitude=D.toRadians(e[1]),sc.height=e[2],re.WGS84.cartographicToCartesian(sc,zi),[zi.x,zi.y,zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],sc.longitude=D.toRadians(e[i+1]),sc.latitude=D.toRadians(e[i+2]),sc.height=e[i+3],re.WGS84.cartographicToCartesian(sc,zi),n[i+1]=zi.x,n[i+2]=zi.y,n[i+3]=zi.z;return n}function BW(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return d7e(r);let o=e.spherical;if(l(o))return m7e(o);let s=e.cartographicRadians;if(l(s))return h7e(s);let a=e.cartographicDegrees;if(l(a))return p7e(a);throw new de(`${JSON.stringify(e)} is not a valid CZML interval.`)}function mle(e,t){m.unpack(e,t,zi),m.normalize(zi,zi),m.pack(zi,e,t)}function _7e(e){let t=BW(e);if(t.length===3)return mle(t,0),t;for(let n=1;n<t.length;n+=4)mle(t,n);return t}function hle(e,t){Ne.unpack(e,t,fV),Ne.normalize(fV,fV),Ne.pack(fV,e,t)}function g7e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return hle(t,0),t;for(let n=1;n<t.length;n+=5)hle(t,n)}return t}function ple(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ye:e.hasOwnProperty("cartesian2")?H:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?by:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?Zt:e.hasOwnProperty("classificationType")?Gn:e.hasOwnProperty("colorBlendMode")?Za:e.hasOwnProperty("cornerType")?Mi:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?yi:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?Hr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ot:e.hasOwnProperty("distanceDisplayCondition")?It:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("shadowMode")?bn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Kd:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?zM.default:e.hasOwnProperty("verticalOrigin")?Rn:Object}function y7e(e,t,n){switch(e){case Zt:return Zt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ye:return t.boundingRectangle;case H:return t.cartesian2;case m:return BW(t);case by:return _7e(t);case z:return u7e(t);case Gn:return Gn[y(t.classificationType,t)];case Za:return Za[y(t.colorBlendMode,t)];case Mi:return Mi[y(t.cornerType,t)];case We:return We[y(t.heightReference,t)];case yi:return yi[y(t.horizontalOrigin,t)];case Image:return dle(t,n);case ee:return ee.fromIso8601(y(t.date,t));case Hr:return Hr[y(t.labelStyle,t)];case Number:return y(t.number,t);case Ot:return t.nearFarScalar;case It:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Ne:return g7e(t);case vf:return y(t.number,t);case bn:return bn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Kd:return Kd[y(t.stripeOrientation,t)];case ce:return f7e(t);case zM.default:return dle(t,n);case Rn:return Rn[y(t.verticalOrigin,t)];default:throw new de(e)}}var x7e={HERMITE:LM,LAGRANGE:NM,LINEAR:pb};function dV(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:x7e[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=du[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=du[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var _le={iso8601:void 0};function lo(e){if(l(e))return _le.iso8601=e,An.fromIso8601(_le)}function kW(e){let t=Ve.MAXIMUM_INTERVAL.clone();return t.data=e,t}function gle(e){let t=new ic;return t.intervals.addInterval(kW(e)),t}function yle(e){let t=new na(e.referenceFrame);return t.intervals.addInterval(kW(e)),t}function mV(e,t,n,i,r,o,s){let a=lo(i.interval);l(r)&&(l(a)?a=An.intersect(a,r,bb):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ve.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Ple(t[n],a)}let g=!1;if(d){if(u=y7e(e,i,o),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let h=typeof e.unpack=="function"&&e!==vf;if(!g&&!p){d?t[n]=new ti(h?e.unpack(u,0):u):t[n]=fle(e,s,i);return}let x=t[n],b,C=i.epoch;if(l(C)&&(b=ee.fromIso8601(C)),g&&!p){x instanceof hu||(t[n]=x=new hu(e)),x.addSamplesPackedArray(u,b),dV(i,x);return}let A;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(u,0):u:a.data=fle(e,s,i),l(x)||(t[n]=x=d?new C_:new ic),d&&x instanceof C_?x.intervals.addInterval(a):x instanceof ic?(d&&(a.data=new ti(a.data)),x.intervals.addInterval(a)):(t[n]=x=gle(x),d&&(a.data=new ti(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new ic),x instanceof ic||(t[n]=x=gle(x));let T=x.intervals;A=T.findInterval(a),(!l(A)||!(A.data instanceof hu))&&(A=a.clone(),A.data=new hu(e),T.addInterval(A)),A.data.addSamplesPackedArray(u,b),dV(i,A.data)}function Ple(e,t){if(e instanceof hu){e.removeSamples(t);return}else if(e instanceof C_){e.intervals.removeInterval(t);return}else if(e instanceof ic){let n=e.intervals;for(let i=0;i<n.length;++i){let r=An.intersect(n.get(i),t,bb);r.isEmpty||Ple(r.data,t)}n.removeInterval(t);return}}function ye(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)mV(e,t,n,i[a],r,o,s);else mV(e,t,n,i,r,o,s)}function xle(e,t,n,i,r,o){let s=lo(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,bb):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(Ve.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Dle(e[t],s)}let g,h=!1;if(d&&(l(n.referenceFrame)&&(g=ar[n.referenceFrame]),g=y(g,ar.FIXED),u=BW(n),f=y(u.length,1),h=f>c),!h&&!p){d?e[t]=new Dc(m.unpack(u),g):e[t]=UM(o,n.reference);return}let x=e[t],b,C=n.epoch;if(l(C)&&(b=ee.fromIso8601(C)),h&&!p){(!(x instanceof ra)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ra(g,a)),x.addSamplesPackedArray(u,b),dV(n,x);return}let A;if(!h&&p){s=s.clone(),d?s.data=m.unpack(u):s.data=UM(o,n.reference),l(x)||(d?x=new b_(g):x=new na(g),e[t]=x),d&&x instanceof b_&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof na?(d&&(s.data=new Dc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=yle(x),d&&(s.data=new Dc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof na||(e[t]=x=yle(x)):e[t]=x=new na(g);let T=x.intervals;A=T.findInterval(s),(!l(A)||!(A.data instanceof ra)||l(g)&&A.data.referenceFrame!==g)&&(A=s.clone(),A.data=new ra(g,a),T.addInterval(A)),A.data.addSamplesPackedArray(u,b),dV(n,A.data)}function Dle(e,t){if(e instanceof ra){e.removeSamples(t);return}else if(e instanceof b_){e.intervals.removeInterval(t);return}else if(e instanceof na){let n=e.intervals;for(let i=0;i<n.length;++i){let r=An.intersect(n.get(i),t,bb);r.isEmpty||Dle(r.data,t)}n.removeInterval(t);return}}function Rle(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)xle(e,t,n[s],i,r,o);else xle(e,t,n,i,r,o)}function ble(e,t,n,i){l(n.references)?hV(e,t,n.references,n.interval,i,QA,ic):(l(n.cartesian2)?n.array=H.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=H.unpackArray(n.cartesian)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function Cle(e,t,n,i,r,o){let s=lo(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,bb):s=i);let a=e[t],c,u;if(l(s)){a instanceof NA||(a=new NA,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Vt||(c=new Vt),f=n.solidColor,ye(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof jA||(c=new jA),f=n.grid,ye(z,c,"color",f.color,void 0,r,o),ye(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),ye(H,c,"lineCount",f.lineCount,void 0,r,o),ye(H,c,"lineThickness",f.lineThickness,void 0,r,o),ye(H,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof pg||(c=new pg),f=n.image,ye(Image,c,"image",f.image,void 0,r,o),ye(H,c,"repeat",f.repeat,void 0,r,o),ye(z,c,"color",f.color,void 0,r,o),ye(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof tE||(c=new tE),f=n.stripe,ye(Kd,c,"orientation",f.orientation,void 0,r,o),ye(z,c,"evenColor",f.evenColor,void 0,r,o),ye(z,c,"oddColor",f.oddColor,void 0,r,o),ye(Number,c,"offset",f.offset,void 0,r,o),ye(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof gy||(c=new gy),f=n.polylineOutline,ye(z,c,"color",f.color,void 0,r,o),ye(z,c,"outlineColor",f.outlineColor,void 0,r,o),ye(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof ZA||(c=new ZA),f=n.polylineGlow,ye(z,c,"color",f.color,void 0,r,o),ye(Number,c,"glowPower",f.glowPower,void 0,r,o),ye(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof YA||(c=new YA),f=n.polylineArrow,ye(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof KA||(c=new KA),f=n.polylineDash,ye(z,c,"color",f.color,void 0,void 0,o),ye(z,c,"gapColor",f.gapColor,void 0,void 0,o),ye(Number,c,"dashLength",f.dashLength,void 0,r,o),ye(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof MA||(c=new MA),f=n.checkerboard,ye(z,c,"evenColor",f.evenColor,void 0,r,o),ye(z,c,"oddColor",f.oddColor,void 0,r,o),ye(H,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function pu(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Cle(e,t,n[s],i,r,o);else Cle(e,t,n,i,r,o)}function b7e(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function C7e(e,t,n,i){let r=t.description;l(r)&&ye(String,e,"description",r,void 0,i,n)}function T7e(e,t,n,i){let r=t.position;l(r)&&Rle(e,"position",r,void 0,i,n)}function A7e(e,t,n,i){let r=t.viewFrom;l(r)&&ye(m,e,"viewFrom",r,void 0,i,n)}function E7e(e,t,n,i){let r=t.orientation;l(r)&&ye(Ne,e,"orientation",r,void 0,i,n)}function S7e(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new ml);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)mV(ple(s[a]),e.properties,o,s[a],void 0,i,n);else mV(ple(s),e.properties,o,s,void 0,i,n)}}}function hV(e,t,n,i,r,o,s){let a=n.map(function(c){return UM(r,c)});if(l(i)){i=lo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(kW(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function Tle(e,t,n,i){let r=n.references;l(r)?hV(e,t,r,n.interval,i,QA,ic):ye(Array,e,t,n,void 0,void 0,i)}function Ale(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Tle(e,t,n[r],i);else Tle(e,t,n,i)}function Ele(e,t,n,i){let r=n.references;l(r)?hV(e,t,r,n.interval,i,y_,na):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function HM(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Ele(e,t,n[r],i);else Ele(e,t,n,i)}function v7e(e){return m.unpackArray(e)}function w7e(e){return m.fromRadiansArrayHeights(e)}function I7e(e){return m.fromDegreesArrayHeights(e)}function Sle(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return hV(a,"positions",s,n.interval,i,y_,na),a.positions});e[t]=new y_(o)}else l(n.cartesian)?n.array=n.cartesian.map(v7e):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(w7e):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(I7e)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i)}function P7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Sle(e,t,n[r],i);else Sle(e,t,n,i)}function D7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)ble(e,t,n[r],i);else ble(e,t,n,i)}function R7e(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Oo),o.addInterval(lo(r[s]));else o=new Oo,o.addInterval(lo(r));e.availability=o}function O7e(e,t,n,i,r){l(t)&&ye(by,e,"alignedAxis",t,n,i,r)}function M7e(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=lo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Na),ye(Boolean,s,"show",r.show,o,i,n),ye(Image,s,"image",r.image,o,i,n),ye(Number,s,"scale",r.scale,o,i,n),ye(H,s,"pixelOffset",r.pixelOffset,o,i,n),ye(m,s,"eyeOffset",r.eyeOffset,o,i,n),ye(yi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ye(Rn,s,"verticalOrigin",r.verticalOrigin,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(z,s,"color",r.color,o,i,n),ye(vf,s,"rotation",r.rotation,o,i,n),O7e(s,r.alignedAxis,o,i,n),ye(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),ye(Number,s,"width",r.width,o,i,n),ye(Number,s,"height",r.height,o,i,n),ye(Ot,s,"scaleByDistance",r.scaleByDistance,o,i,n),ye(Ot,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ye(Ot,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ye(Ye,s,"imageSubRegion",r.imageSubRegion,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function L7e(e,t,n,i){let r=t.box;if(!l(r))return;let o=lo(r.interval),s=e.box;l(s)||(e.box=s=new ex),ye(Boolean,s,"show",r.show,o,i,n),ye(m,s,"dimensions",r.dimensions,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function N7e(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=lo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new nx),ye(Boolean,s,"show",r.show,o,i,n),HM(s,"positions",r.positions,n),ye(Number,s,"width",r.width,o,i,n),ye(Number,s,"height",r.height,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ye(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ye(Mi,s,"cornerType",r.cornerType,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Gn,s,"classificationType",r.classificationType,o,i,n),ye(Number,s,"zIndex",r.zIndex,o,i,n)}function F7e(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=lo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new ix),ye(Boolean,s,"show",r.show,o,i,n),ye(Number,s,"length",r.length,o,i,n),ye(Number,s,"topRadius",r.topRadius,o,i,n),ye(Number,s,"bottomRadius",r.bottomRadius,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ye(Number,s,"slices",r.slices,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function B7e(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new de("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new de("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=y(r.interval,o.interval),o.currentTime=y(r.currentTime,o.currentTime),o.range=y(r.range,o.range),o.step=y(r.step,o.step),o.multiplier=y(r.multiplier,o.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function k7e(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=lo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new rx),ye(Boolean,s,"show",r.show,o,i,n),ye(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),ye(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),ye(Number,s,"height",r.height,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ye(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ye(vf,s,"rotation",r.rotation,o,i,n),ye(vf,s,"stRotation",r.stRotation,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Gn,s,"classificationType",r.classificationType,o,i,n),ye(Number,s,"zIndex",r.zIndex,o,i,n)}function U7e(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=lo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new ox),ye(Boolean,s,"show",r.show,o,i,n),ye(m,s,"radii",r.radii,o,i,n),ye(m,s,"innerRadii",r.innerRadii,o,i,n),ye(Number,s,"minimumClock",r.minimumClock,o,i,n),ye(Number,s,"maximumClock",r.maximumClock,o,i,n),ye(Number,s,"minimumCone",r.minimumCone,o,i,n),ye(Number,s,"maximumCone",r.maximumCone,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Number,s,"stackPartitions",r.stackPartitions,o,i,n),ye(Number,s,"slicePartitions",r.slicePartitions,o,i,n),ye(Number,s,"subdivisions",r.subdivisions,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function V7e(e,t,n,i){let r=t.label;if(!l(r))return;let o=lo(r.interval),s=e.label;l(s)||(e.label=s=new md),ye(Boolean,s,"show",r.show,o,i,n),ye(String,s,"text",r.text,o,i,n),ye(String,s,"font",r.font,o,i,n),ye(Hr,s,"style",r.style,o,i,n),ye(Number,s,"scale",r.scale,o,i,n),ye(Boolean,s,"showBackground",r.showBackground,o,i,n),ye(z,s,"backgroundColor",r.backgroundColor,o,i,n),ye(H,s,"backgroundPadding",r.backgroundPadding,o,i,n),ye(H,s,"pixelOffset",r.pixelOffset,o,i,n),ye(m,s,"eyeOffset",r.eyeOffset,o,i,n),ye(yi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ye(Rn,s,"verticalOrigin",r.verticalOrigin,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(z,s,"fillColor",r.fillColor,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Ot,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ye(Ot,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ye(Ot,s,"scaleByDistance",r.scaleByDistance,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function z7e(e,t,n,i){let r=t.model;if(!l(r))return;let o=lo(r.interval),s=e.model;l(s)||(e.model=s=new pp),ye(Boolean,s,"show",r.show,o,i,n),ye(zM.default,s,"uri",r.gltf,o,i,n),ye(Number,s,"scale",r.scale,o,i,n),ye(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),ye(Number,s,"maximumScale",r.maximumScale,o,i,n),ye(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),ye(Boolean,s,"runAnimations",r.runAnimations,o,i,n),ye(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),ye(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),ye(z,s,"color",r.color,o,i,n),ye(Za,s,"colorBlendMode",r.colorBlendMode,o,i,n),ye(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)vle(s,u[a],o,i,n);else vle(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)wle(s,f[a],o,i,n);else wle(s,f,o,i,n)}function vle(e,t,n,i,r){let o=lo(t.interval);l(n)&&(l(o)?o=An.intersect(o,n,bb):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new ml),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new sx),ye(m,p,"translation",d.translation,o,i,r),ye(Ne,p,"rotation",d.rotation,o,i,r),ye(m,p,"scale",d.scale,o,i,r)}}function wle(e,t,n,i,r){let o=lo(t.interval);l(n)&&(l(o)?o=An.intersect(o,n,bb):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new ml),s.hasProperty(f)||s.addProperty(f),ye(Number,s,f,d,o,i,r))}}function H7e(e,t,n,i){let r=t.path;if(!l(r))return;let o=lo(r.interval),s=e.path;l(s)||(e.path=s=new _p),ye(Boolean,s,"show",r.show,o,i,n),ye(Number,s,"leadTime",r.leadTime,o,i,n),ye(Number,s,"trailTime",r.trailTime,o,i,n),ye(Number,s,"width",r.width,o,i,n),ye(Number,s,"resolution",r.resolution,o,i,n),pu(s,"material",r.material,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function G7e(e,t,n,i){let r=t.point;if(!l(r))return;let o=lo(r.interval),s=e.point;l(s)||(e.point=s=new cx),ye(Boolean,s,"show",r.show,o,i,n),ye(Number,s,"pixelSize",r.pixelSize,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(z,s,"color",r.color,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Ot,s,"scaleByDistance",r.scaleByDistance,o,i,n),ye(Ot,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function VM(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(VM.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});VM.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Rc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Rc(n,i)};VM.prototype.equals=function(e){return this===e||e instanceof VM&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function W7e(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=lo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new hd),ye(Boolean,s,"show",r.show,o,i,n),HM(s,"_positions",r.positions,n),P7e(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new VM(s)),ye(Number,s,"height",r.height,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ye(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ye(vf,s,"stRotation",r.stRotation,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),ye(Boolean,s,"closeTop",r.closeTop,o,i,n),ye(Boolean,s,"closeBottom",r.closeBottom,o,i,n),ye(Zt,s,"arcType",r.arcType,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Gn,s,"classificationType",r.classificationType,o,i,n),ye(Number,s,"zIndex",r.zIndex,o,i,n)}function j7e(e){return e?Zt.GEODESIC:Zt.NONE}function q7e(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=lo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new qa),ye(Boolean,s,"show",r.show,o,i,n),HM(s,"positions",r.positions,n),ye(Number,s,"width",r.width,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),pu(s,"material",r.material,o,i,n),pu(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),ye(Zt,s,"arcType",r.arcType,o,i,n),ye(Boolean,s,"clampToGround",r.clampToGround,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Gn,s,"classificationType",r.classificationType,o,i,n),ye(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};ye(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=l7e(a.followSurface,j7e)}}function Y7e(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=lo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new lx),HM(s,"positions",r.positions,n),D7e(s,"shape",r.shape,n),ye(Boolean,s,"show",r.show,o,i,n),ye(Mi,s,"cornerType",r.cornerType,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function X7e(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=lo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new pd),ye(Boolean,s,"show",r.show,o,i,n),ye(ce,s,"coordinates",r.coordinates,o,i,n),ye(Number,s,"height",r.height,o,i,n),ye(We,s,"heightReference",r.heightReference,o,i,n),ye(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ye(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ye(vf,s,"rotation",r.rotation,o,i,n),ye(vf,s,"stRotation",r.stRotation,o,i,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ye(Gn,s,"classificationType",r.classificationType,o,i,n),ye(Number,s,"zIndex",r.zIndex,o,i,n)}function K7e(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=lo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new ax),ye(Boolean,s,"show",r.show,o,i,n),ye(zM.default,s,"uri",r.uri,o,i,n),ye(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function J7e(e,t,n,i){let r=t.wall;if(!l(r))return;let o=lo(r.interval),s=e.wall;l(s)||(e.wall=s=new gp),ye(Boolean,s,"show",r.show,o,i,n),HM(s,"positions",r.positions,n),Ale(s,"minimumHeights",r.minimumHeights,n),Ale(s,"maximumHeights",r.maximumHeights,n),ye(Number,s,"granularity",r.granularity,o,i,n),ye(Boolean,s,"fill",r.fill,o,i,n),pu(s,"material",r.material,o,i,n),ye(Boolean,s,"outline",r.outline,o,i,n),ye(z,s,"outlineColor",r.outlineColor,o,i,n),ye(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ye(bn,s,"shadows",r.shadows,o,i,n),ye(It,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Ile(e,t,n,i,r){let o=e.id;if(l(o)||(o=qn()),FW=o,!l(r._version)&&o!=="document")throw new de("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")B7e(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}FW=void 0}function Z7e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(Ve.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=ee.secondsDifference(s,o),c=Math.round(a/120);return t=new Yd,t.startTime=ee.clone(o),t.stopTime=ee.clone(s),t.clockRange=No.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(o),t.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Yd,t.startTime=Ve.MINIMUM_VALUE.clone(),t.stopTime=Ve.MAXIMUM_VALUE.clone(),t.currentTime=Ve.MINIMUM_VALUE.clone(),t.clockRange=No.LOOP_STOP,t.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=lo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(No[n.range],No.LOOP_STOP)),l(n.step)&&(t.clockStep=y(yr[n.step],yr.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Ole(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new vt(s)),e._credit=s,typeof t=="string"||t instanceof Ie){t=Ie.createIfNeeded(t),r=t.fetchJson(),o=y(o,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=Ie.createIfNeeded(o),Mo.setLoading(e,!0),Promise.resolve(r).then(function(a){return $7e(e,a,o,i)}).catch(function(a){return Mo.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function $7e(e,t,n,i){Mo.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Mle,r.removeAll()),Il._processCzml(t,r,n,void 0,e);let o=Z7e(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=__(n.getUrlComponent()),o=!0),Mo.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Mle(){this.name=void 0,this.clock=void 0}function Il(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new Mle,this._version=void 0,this._entityCollection=new Fs(this),this._entityCluster=new uu,this._credit=void 0,this._resourceCredits=[]}Il.load=function(e,t){return new Il().load(e,t)};Object.defineProperties(Il.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Il.updaters=[M7e,L7e,N7e,F7e,k7e,U7e,V7e,z7e,b7e,C7e,H7e,G7e,W7e,q7e,Y7e,S7e,X7e,T7e,K7e,A7e,J7e,E7e,R7e];Il.prototype.process=function(e,t){return Ole(this,e,t,!1)};Il.prototype.load=function(e,t){return Ole(this,e,t,!0)};Il.prototype.update=function(e){return!0};Il.processPacketData=ye;Il.processPositionPacketData=Rle;Il.processMaterialPacketData=pu;Il._processCzml=function(e,t,n,i,r){if(i=y(i,Il.updaters),Array.isArray(e))for(let o=0,s=e.length;o<s;++o)Ile(e[o],t,i,n,r);else Ile(e,t,i,n,r)};var GM=Il;function jc(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(jc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});jc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};jc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};jc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};jc.prototype.contains=function(e){return this.indexOf(e)!==-1};jc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};jc.prototype.get=function(e){return this._dataSources[e]};jc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function pV(e,t){return e.indexOf(t)}function Lle(e,t,n){let i=e._dataSources,r=i.length-1;if(t=D.clamp(t,0,r),n=D.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}jc.prototype.raise=function(e){let t=pV(this._dataSources,e);Lle(this,t,t+1)};jc.prototype.lower=function(e){let t=pV(this._dataSources,e);Lle(this,t,t-1)};jc.prototype.raiseToTop=function(e){let t=pV(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};jc.prototype.lowerToBottom=function(e){let t=pV(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var WM=jc;function oa(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=qn(),this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(oa.prototype,{length:{get:function(){return this._primitives.length}}});oa.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e};oa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1};oa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};oa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]};oa.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function _V(e,t){return e._primitives.indexOf(t)}oa.prototype.raise=function(e){if(l(e)){let t=_V(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};oa.prototype.raiseToTop=function(e){if(l(e)){let t=_V(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};oa.prototype.lower=function(e){if(l(e)){let t=_V(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};oa.prototype.lowerToBottom=function(e){if(l(e)){let t=_V(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};oa.prototype.get=function(e){return this._primitives[e]};oa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};oa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};oa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};oa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};oa.prototype.isDestroyed=function(){return!1};oa.prototype.destroy=function(){return this.removeAll(),ue(this)};var Pl=oa;function lh(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(lh.prototype,{length:{get:function(){return this._length}}});lh.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Pl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};lh.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};lh.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};lh.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};lh.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};lh.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){return this.removeAll(),ue(this)};var jM=lh;function iE(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Tt}iE.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};iE.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};iE.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};iE.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};iE.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var Cb=iE;var VW={},gV=new m,Nle=new m,Fle=new Ne,Ble=new $;function rE(e,t,n,i,r,o,s,a,c,u){let f=e+t;m.multiplyByScalar(i,Math.cos(f),gV),m.multiplyByScalar(n,Math.sin(f),Nle),m.add(gV,Nle,gV);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let h=o/Math.sqrt(s*d+r*p)/a;return Ne.fromAxisAngle(gV,h,Fle),$.fromQuaternion(Fle,Ble),$.multiplyByVector(Ble,c,u),m.normalize(u,u),m.multiplyByScalar(u,a,u),u}var kle=new m,Ule=new m,UW=new m,Q7e=new m;VW.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=m.fromArray(e,f,kle);i.scaleToGeodeticSurface(g,g);let h=m.clone(g,Ule),x=i.geodeticSurfaceNormal(g,Q7e),b=m.multiplyByScalar(x,r,UW);m.add(g,b,g),n&&(m.multiplyByScalar(x,o,b),m.add(h,b,h),a[f+u]=h.x,a[d+u]=h.y,a[p+u]=h.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var eje=new m,tje=new m,nje=new m;VW.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=m.magnitude(s),p=m.normalize(s,eje),g=m.cross(m.UNIT_Z,s,tje);g=m.normalize(g,g);let h=m.cross(p,g,nje),x=1+Math.ceil(D.PI_OVER_TWO/a),b=D.PI_OVER_TWO/(x-1),C=D.PI_OVER_TWO-x*b;C<0&&(x-=Math.ceil(Math.abs(C)/b));let A=2*(x*(x+2)),T=t?new Array(A*3):void 0,S=0,v=kle,I=Ule,O=x*4*3,R=O-1,L=0,N=n?new Array(O):void 0,_,E,w,P,M;for(C=D.PI_OVER_TWO,v=rE(C,o,h,g,c,f,u,d,p,v),t&&(T[S++]=v.x,T[S++]=v.y,T[S++]=v.z),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x),C=D.PI_OVER_TWO-b,_=1;_<x+1;++_){if(v=rE(C,o,h,g,c,f,u,d,p,v),I=rE(Math.PI-C,o,h,g,c,f,u,d,p,I),t){for(T[S++]=v.x,T[S++]=v.y,T[S++]=v.z,w=2*_+2,E=1;E<w-1;++E)P=E/(w-1),M=m.lerp(v,I,P,UW),T[S++]=M.x,T[S++]=M.y,T[S++]=M.z;T[S++]=I.x,T[S++]=I.y,T[S++]=I.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[L++]=I.x,N[L++]=I.y,N[L++]=I.z),C=D.PI_OVER_TWO-(_+1)*b}for(_=x;_>1;--_){if(C=D.PI_OVER_TWO-(_-1)*b,v=rE(-C,o,h,g,c,f,u,d,p,v),I=rE(C+Math.PI,o,h,g,c,f,u,d,p,I),t){for(T[S++]=v.x,T[S++]=v.y,T[S++]=v.z,w=2*(_-1)+2,E=1;E<w-1;++E)P=E/(w-1),M=m.lerp(v,I,P,UW),T[S++]=M.x,T[S++]=M.y,T[S++]=M.z;T[S++]=I.x,T[S++]=I.y,T[S++]=I.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[L++]=I.x,N[L++]=I.y,N[L++]=I.z)}C=D.PI_OVER_TWO,v=rE(-C,o,h,g,c,f,u,d,p,v);let B={};return t&&(T[S++]=v.x,T[S++]=v.y,T[S++]=v.z,B.positions=T,B.numPts=x),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,B.outerPositions=N),B};var Dl=VW;var oE=new m,zW=new m,HW=new m,Vle=new m,ps=new H,zle=new $,ije=new $,GW=new Ne,Hle=new m,Gle=new m,Wle=new m,bV=new me,jle=new m,qle=new H,Yle=new H;function Xle(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,h=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,C=Hle,A=Gle,T=Wle,S=new Pi(a),v=S.project(a.cartesianToCartographic(r,bV),jle),I=a.scaleToGeodeticSurface(r,oE);a.geodeticSurfaceNormal(I,I);let O=zle,R=ije;if(c!==0){let M=Ne.fromAxisAngle(I,c,GW);O=$.fromQuaternion(M,O),M=Ne.fromAxisAngle(I,-c,GW),R=$.fromQuaternion(M,R)}else O=$.clone($.IDENTITY,O),R=$.clone($.IDENTITY,R);let L=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,qle),N=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Yle),_=e.length,E=n?_:0,w=E/3*2;for(let M=0;M<_;M+=3){let B=M+1,V=M+2,U=m.fromArray(e,M,oE);if(i.st){let G=$.multiplyByVector(O,U,zW),k=S.project(a.cartesianToCartographic(G,bV),HW);m.subtract(k,v,k),ps.x=(k.x+o)/(2*o),ps.y=(k.y+s)/(2*s),L.x=Math.min(ps.x,L.x),L.y=Math.min(ps.y,L.y),N.x=Math.max(ps.x,N.x),N.y=Math.max(ps.y,N.y),n&&(d[b+w]=ps.x,d[b+1+w]=ps.y),d[b++]=ps.x,d[b++]=ps.y}(i.normal||i.tangent||i.bitangent||f)&&(C=a.geodeticSurfaceNormal(U,C),f&&(x[M+E]=-C.x,x[B+E]=-C.y,x[V+E]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(A=m.normalize(m.cross(m.UNIT_Z,C,A),A),$.multiplyByVector(R,A,A)),i.normal&&(p[M]=C.x,p[B]=C.y,p[V]=C.z,n&&(p[M+E]=-C.x,p[B+E]=-C.y,p[V+E]=-C.z)),i.tangent&&(g[M]=A.x,g[B]=A.y,g[V]=A.z,n&&(g[M+E]=-A.x,g[B+E]=-A.y,g[V+E]=-A.z)),i.bitangent&&(T=m.normalize(m.cross(C,A,T),T),h[M]=T.x,h[B]=T.y,h[V]=T.z,n&&(h[M+E]=T.x,h[B+E]=T.y,h[V+E]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-L.x)/(N.x-L.x),d[M+1]=(d[M+1]-L.y)/(N.y-L.y)}let P=new pn;if(i.position){let M=Dl.raisePositionsToHeight(e,t,n);P.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(P.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),f&&(P.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===sn.TOP)M=M.fill(1,0,u/2);else{let B=t.offsetAttribute===sn.NONE?0:1;M=M.fill(B)}P.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return P}function Kle(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Tb=new m;function rje(e){let t=e.center;Tb=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Tb),e.height,Tb),Tb=m.add(t,Tb,Tb);let n=new ae(Tb,e.semiMajorAxis),i=Dl.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=Xle(r,e,!1),a=Kle(o);return a=Be.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function oje(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,h=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,C=b?new Float32Array(f*3):void 0,A=0,T=Hle,S=Gle,v=Wle,I=new Pi(s),O=I.project(s.cartesianToCartographic(i,bV),jle),R=s.scaleToGeodeticSurface(i,oE);s.geodeticSurfaceNormal(R,R);let L=Ne.fromAxisAngle(R,u,GW),N=$.fromQuaternion(L,zle),_=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,qle),E=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Yle),w=e.length,P=w/3*2;for(let B=0;B<w;B+=3){let V=B+1,U=B+2,G=m.fromArray(e,B,oE),k;if(n.st){let j=$.multiplyByVector(N,G,zW),J=I.project(s.cartesianToCartographic(j,bV),HW);m.subtract(J,O,J),ps.x=(J.x+r)/(2*r),ps.y=(J.y+o)/(2*o),_.x=Math.min(ps.x,_.x),_.y=Math.min(ps.y,_.y),E.x=Math.max(ps.x,E.x),E.y=Math.max(ps.y,E.y),p[A+P]=ps.x,p[A+1+P]=ps.y,p[A++]=ps.x,p[A++]=ps.y}G=s.scaleToGeodeticSurface(G,G),k=m.clone(G,zW),T=s.geodeticSurfaceNormal(G,T),b&&(C[B+w]=-T.x,C[V+w]=-T.y,C[U+w]=-T.z);let Y=m.multiplyByScalar(T,a,Vle);if(G=m.add(G,Y,G),Y=m.multiplyByScalar(T,c,Y),k=m.add(k,Y,k),n.position&&(d[B+w]=k.x,d[V+w]=k.y,d[U+w]=k.z,d[B]=G.x,d[V]=G.y,d[U]=G.z),n.normal||n.tangent||n.bitangent){v=m.clone(T,v);let j=m.fromArray(e,(B+3)%w,Vle);m.subtract(j,G,j);let J=m.subtract(k,G,HW);T=m.normalize(m.cross(J,j,T),T),n.normal&&(g[B]=T.x,g[V]=T.y,g[U]=T.z,g[B+w]=T.x,g[V+w]=T.y,g[U+w]=T.z),n.tangent&&(S=m.normalize(m.cross(v,T,S),S),h[B]=S.x,h[V]=S.y,h[U]=S.z,h[B+w]=S.x,h[B+1+w]=S.y,h[B+2+w]=S.z),n.bitangent&&(x[B]=v.x,x[V]=v.y,x[U]=v.z,x[B+w]=v.x,x[V+w]=v.y,x[U+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-_.x)/(E.x-_.x),p[B+1]=(p[B+1]-_.y)/(E.y-_.y)}let M=new pn;if(n.position&&(M.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(M.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(M.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===sn.TOP)B=B.fill(1,0,f/2);else{let V=t.offsetAttribute===sn.NONE?0:1;B=B.fill(V)}M.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return M}function sje(e){let t=e.length/3,n=Be.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var yV=new ae,xV=new ae;function aje(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,oE),e.height,oE);yV.center=m.add(t,r,yV.center),yV.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),xV.center=m.add(t,r,xV.center),xV.radius=i;let o=Dl.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ae.union(yV,xV),f=Xle(s,e,!0),d=Kle(a),p=d.length;d.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)d[S+p]=d[S+2]+g,d[S+1+p]=d[S+1]+g,d[S+2+p]=d[S]+g;let h=Be.createTypedArray(g*2/3,d),x=new ft({attributes:f,indices:h,primitiveType:Le.TRIANGLES}),b=oje(c,e);d=sje(c);let C=Be.createTypedArray(c.length*2/3,d),A=new ft({attributes:b,indices:C,primitiveType:Le.TRIANGLES}),T=Bn.combineInstances([new Ct({geometry:x}),new Ct({geometry:A})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function Jle(e,t,n,i,r,o,s){let c=Dl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=m.fromArray(c,p*3);let d=ce.fromCartesianArray(f,o,s);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function fh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,D.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Oe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Oe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}fh.packedLength=m.packedLength+re.packedLength+Oe.packedLength+9;fh.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Zle=new m,$le=new re,Qle=new Oe,uh={center:Zle,ellipsoid:$le,vertexFormat:Qle,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};fh.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Zle);t+=m.packedLength;let r=re.unpack(e,t,$le);t+=re.packedLength;let o=Oe.unpack(e,t,Qle);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(uh.height=f,uh.extrudedHeight=p,uh.granularity=d,uh.stRotation=u,uh.rotation=c,uh.semiMajorAxis=s,uh.semiMinorAxis=a,uh.shadowVolume=g,uh.offsetAttribute=h===-1?void 0:h,new fh(uh))};fh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,re.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,s=y(e.granularity,D.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Jle(n,r,o,a,s,i,t)};fh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=aje(r);else if(o=rje(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ft({attributes:o.attributes,indices:o.indices,primitiveType:Le.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};fh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new fh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};function cje(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Dl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return ft._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(fh.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Jle(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=cje(this)),this._textureCoordinateRotationPoints}}});var qc=fh;var eue=new m,Ab=new m;function lje(e){let t=e.center;Ab=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Ab),e.height,Ab),Ab=m.add(t,Ab,Ab);let n=new ae(Ab,e.semiMajorAxis),i=Dl.computeEllipsePositions(e,!1,!0).outerPositions,r=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Dl.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=Be.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var CV=new ae,TV=new ae;function uje(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,eue),e.height,eue);CV.center=m.add(t,r,CV.center),CV.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),TV.center=m.add(t,r,TV.center),TV.radius=i;let o=Dl.computeEllipsePositions(e,!1,!0).outerPositions,s=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Dl.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ae.union(CV,TV),c=o.length/3;if(l(e.offsetAttribute)){let h=new Uint8Array(c);if(e.offsetAttribute===sn.TOP)h=h.fill(1,0,c/2);else{let x=e.offsetAttribute===sn.NONE?0:1;h=h.fill(x)}s.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let u=y(e.numberOfVerticalLines,16);u=D.clamp(u,0,c/2);let f=Be.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let h=Math.min(u,c);g=Math.round(c/h);let x=Math.min(g*u,c);for(p=0;p<x;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function sE(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,D.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}sE.packedLength=m.packedLength+re.packedLength+8;sE.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var tue=new m,nue=new re,T_={center:tue,ellipsoid:nue,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};sE.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,tue);t+=m.packedLength;let r=re.unpack(e,t,nue);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(T_.height=c,T_.extrudedHeight=f,T_.granularity=u,T_.rotation=a,T_.semiMajorAxis=o,T_.semiMinorAxis=s,T_.numberOfVerticalLines=d,T_.offsetAttribute=p===-1?void 0:p,new sE(T_))};sE.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=uje(r);else if(o=lje(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ft({attributes:o.attributes,indices:o.indices,primitiveType:Le.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var _u=sE;var iue=new z,rue=m.ZERO,oue=new m,sue=new ce;function fje(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Jd(e,t){Jn.call(this,{entity:e,scene:t,geometryOptions:new fje(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Jd.prototype=Object.create(Jn.prototype),Jd.prototype.constructor=Jd);Jd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,iue)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,rue,oue))),new Ct({id:t,geometry:new qc(this._options),attributes:i})};Jd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,iue),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,rue,oue))),new Ct({id:t,geometry:new _u(this._options),attributes:o})};Jd.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Jd.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ci.prototype._isHidden.call(this,e,t)};Jd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Jd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ve.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),r=q.getValueOrUndefined(t.extrudedHeight,Ve.MINIMUM_VALUE),o=q.getValueOrDefault(t.extrudedHeightReference,Ve.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ve.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ve.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ve.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=q.getValueOrUndefined(t.rotation,Ve.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,Ve.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,Ve.MINIMUM_VALUE),s.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ve.MINIMUM_VALUE),s.offsetAttribute=Jn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Jn.getGeometryHeight(n,i),r=Jn.getGeometryExtrudedHeight(r,o),r===Jn.CLAMP_TO_GROUND&&(r=oi.getMinimumMaximumHeights(qc.computeRectangle(s,sue)).minimumTerrainHeight),s.extrudedHeight=r};Jd.DynamicGeometryUpdater=aE;function aE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(aE.prototype=Object.create(ai.prototype),aE.prototype.constructor=aE);aE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ai.prototype._isHidden.call(this,e,t,n)};aE.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,We.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Jn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Jn.getGeometryHeight(r,o),s=Jn.getGeometryExtrudedHeight(s,a),s===Jn.CLAMP_TO_GROUND&&(s=oi.getMinimumMaximumHeights(qc.computeRectangle(i,sue)).minimumTerrainHeight),i.extrudedHeight=s};var qM=Jd;var dje=new m,mje=new m,hje=new m,pje=new m,_je=new m,gje=new m(1,1,1),aue=Math.cos,cue=Math.sin;function A_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,gje),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,D.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,D.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Oe.DEFAULT);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Oe.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}A_.packedLength=2*m.packedLength+Oe.packedLength+7;A_.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var lue=new m,uue=new m,fue=new Oe,Cy={radii:lue,innerRadii:uue,vertexFormat:fue,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};A_.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,lue);t+=m.packedLength;let r=m.unpack(e,t,uue);t+=m.packedLength;let o=Oe.unpack(e,t,fue);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(Cy.minimumClock=s,Cy.maximumClock=a,Cy.minimumCone=c,Cy.maximumCone=u,Cy.stackPartitions=f,Cy.slicePartitions=d,Cy.offsetAttribute=p===-1?void 0:p,new A_(Cy))};A_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-o)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],h=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)h.push(i+d*(r-i)/(c-1));h.push(r);let x=g.length,b=h.length,C=0,A=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,I=!1;T&&(A=2,o>0&&(S=!0,C+=c-1),s<Math.PI&&(v=!0,C+=c-1),(r-i)%D.TWO_PI?(I=!0,C+=(u-1)*2+1):C+=1);let O=b*x*A,R=new Float64Array(O*3),L=new Array(O).fill(!1),N=new Array(O).fill(!1),_=c*u*A,E=6*(_+C+1-(c+u)*A),w=Be.createTypedArray(_,E),P=a.normal?new Float32Array(O*3):void 0,M=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,V=a.st?new Float32Array(O*2):void 0,U=new Array(x),G=new Array(x);for(f=0;f<x;f++)U[f]=cue(g[f]),G[f]=aue(g[f]);let k=new Array(b),Y=new Array(b);for(d=0;d<b;d++)Y[d]=aue(h[d]),k[d]=cue(h[d]);for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=t.x*U[f]*Y[d],R[p++]=t.y*U[f]*k[d],R[p++]=t.z*G[f];let j=O/2;if(T)for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=n.x*U[f]*Y[d],R[p++]=n.y*U[f]*k[d],R[p++]=n.z*G[f],L[j]=!0,f>0&&f!==x-1&&d!==0&&d!==b-1&&(N[j]=!0),j++;p=0;let J,W;for(f=1;f<x-2;f++)for(J=f*b,W=(f+1)*b,d=1;d<b-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=J+d+1,w[p++]=W+d,w[p++]=J+d+1,w[p++]=J+d;if(T){let Ze=x*b;for(f=1;f<x-2;f++)for(J=Ze+f*b,W=Ze+(f+1)*b,d=1;d<b-2;d++)w[p++]=W+d,w[p++]=J+d,w[p++]=J+d+1,w[p++]=W+d,w[p++]=J+d+1,w[p++]=W+d+1}let K,Z;if(T){if(S)for(Z=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(K=x*b-b,Z=x*b*A-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=Z+f,w[p++]=K+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(I){for(f=1;f<x-2;f++)Z=b*x+b*f,K=b*f,w[p++]=Z,w[p++]=K+b,w[p++]=K,w[p++]=Z,w[p++]=Z+b,w[p++]=K+b;for(f=1;f<x-2;f++)Z=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=Z,w[p++]=K,w[p++]=K+b,w[p++]=Z+b,w[p++]=Z}let he=new pn;a.position&&(he.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let ge=0,se=0,pe=0,xe=0,Pe=O/2,we,Se=re.fromCartesian3(t),nt=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){we=L[f]?nt:Se;let Ze=m.fromArray(R,f*3,dje),Gt=we.geodeticSurfaceNormal(Ze,mje);if(N[f]&&m.negate(Gt,Gt),a.st){let fn=H.negate(Gt,_je);V[ge++]=Math.atan2(fn.y,fn.x)/D.TWO_PI+.5,V[ge++]=Math.asin(Gt.z)/Math.PI+.5}if(a.normal&&(P[se++]=Gt.x,P[se++]=Gt.y,P[se++]=Gt.z),a.tangent||a.bitangent){let fn=hje,pt=0,Tn;if(L[f]&&(pt=Pe),!S&&f>=pt&&f<pt+b*2?Tn=m.UNIT_X:Tn=m.UNIT_Z,m.cross(Tn,Gt,fn),m.normalize(fn,fn),a.tangent&&(M[pe++]=fn.x,M[pe++]=fn.y,M[pe++]=fn.z),a.bitangent){let Vn=m.cross(Gt,fn,pje);m.normalize(Vn,Vn),B[xe++]=Vn.x,B[xe++]=Vn.y,B[xe++]=Vn.z}}}a.st&&(he.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(he.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:P})),a.tangent&&(he.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(he.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let Ze=R.length,Gt=e._offsetAttribute===sn.NONE?0:1,fn=new Uint8Array(Ze/3).fill(Gt);he.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:fn})}return new ft({attributes:he,indices:w,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromEllipsoid(Se),offsetAttribute:e._offsetAttribute})};var WW;A_.getUnitEllipsoid=function(){return l(WW)||(WW=A_.createGeometry(new A_({radii:new m(1,1,1),vertexFormat:Oe.POSITION_ONLY}))),WW};var ks=A_;var yje=new Vt(z.WHITE),jW=m.ZERO,qW=new m,xje=new m,bje=new m,YW=new z,Cje=new m(1,1,1);function Tje(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function gu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new Tje(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(gu.prototype=Object.create(ci.prototype),gu.prototype.constructor=gu);Object.defineProperties(gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});gu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new xn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Hn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,YW)),l(f)||(f=z.WHITE),o=zt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,jW,qW))),new Ct({id:i,geometry:new ks(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:u})};gu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,YW),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(o),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,jW,qW))),new Ct({id:i,geometry:new lu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};gu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};gu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ci.prototype._isHidden.call(this,e,t)};gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};gu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ve.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,Ve.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,Ve.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,Ve.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,Ve.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,Ve.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,Ve.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,Ve.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?sn.ALL:void 0};gu.prototype._onEntityPropertyChanged=yp;gu.DynamicGeometryUpdater=YM;function YM(e,t,n){ai.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}l(Object.create)&&(YM.prototype=Object.create(ai.prototype),YM.prototype.constructor=YM);YM.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,xje),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=q.getValueOrDefault(n.fill,e,!0),s=q.getValueOrDefault(n.outline,e,!1),a=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,YW),c=Xr.getValue(e,y(n.material,yje),this._material),u=q.getValueOrUndefined(n.innerRadii,e,bje),f=q.getValueOrUndefined(n.minimumClock,e),d=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),g=q.getValueOrUndefined(n.maximumCone,e),h=q.getValueOrUndefined(n.stackPartitions,e),x=q.getValueOrUndefined(n.slicePartitions,e),b=q.getValueOrUndefined(n.subdivisions,e),C=q.getValueOrDefault(n.outlineWidth,e,1),A=q.getValueOrDefault(n.heightReference,e,We.NONE),T=A!==We.NONE?sn.ALL:void 0,S=this._scene.mode,v=S===ne.SCENE3D&&A===We.NONE,I=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,jW,qW);if(!v||this._lastSceneMode!==S||!l(this._primitive)||I.stackPartitions!==h||I.slicePartitions!==x||l(u)&&!m.equals(I.innerRadii!==u)||I.minimumClock!==f||I.maximumClock!==d||I.minimumCone!==p||I.maximumCone!==g||I.subdivisions!==b||this._lastOutlineWidth!==C||I.offsetAttribute!==T){let E=this._primitives;if(E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=C,I.stackPartitions=h,I.slicePartitions=x,I.subdivisions=b,I.offsetAttribute=T,I.radii=m.clone(v?Cje:i,I.radii),l(u))if(v){let B=m.magnitude(i);I.innerRadii=m.fromElements(u.x/B,u.y/B,u.z/B,I.innerRadii)}else I.innerRadii=m.clone(u,I.innerRadii);else I.innerRadii=void 0;I.minimumClock=f,I.maximumClock=d,I.minimumCone=p,I.maximumCone=g;let w=new fr({material:c,translucent:c.isTranslucent(),closed:!0});I.vertexFormat=w.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=E.add(new wn({geometryInstances:P,appearance:w,asynchronous:!1,shadows:O}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=E.add(new wn({geometryInstances:M,appearance:new an({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:O})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=m.clone(N,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,w=this._outlinePrimitive;E.show=!0,w.show=!0,E.appearance.material=c;let P=this._attributes;l(P)||(P=E.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=xn.toValue(o,P.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=w.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=xn.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=zt.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),It.equals(L,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=Hn.toValue(L,P.distanceDisplayCondition),M.distanceDisplayCondition=Hn.toValue(L,M.distanceDisplayCondition),It.clone(L,this._lastDistanceDisplayCondition)),m.equals(N,this._lastOffset)||(P.offset=Zi.toValue(N,P.offset),M.offset=Zi.toValue(N,P.offset),m.clone(N,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=F.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var XM=gu;function cE(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Oe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}cE.packedLength=Oe.packedLength;cE.pack=function(e,t,n){return n=y(n,0),Oe.pack(e._vertexFormat,t,n),t};var due=new Oe,Aje={vertexFormat:due};cE.unpack=function(e,t,n){t=y(t,0);let i=Oe.unpack(e,t,due);return l(n)?(n._vertexFormat=Oe.clone(i,n._vertexFormat),n):new cE(Aje)};var AV=new m(-.5,-.5,0),EV=new m(.5,.5,0);cE.createGeometry=function(e){let t=e._vertexFormat,n=new pn,i,r;if(t.position){if(r=new Float64Array(4*3),r[0]=AV.x,r[1]=AV.y,r[2]=0,r[3]=EV.x,r[4]=AV.y,r[5]=0,r[6]=EV.x,r[7]=EV.y,r[8]=0,r[9]=AV.x,r[10]=EV.y,r[11]=0,n.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ft({attributes:n,indices:i,primitiveType:Le.TRIANGLES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var KM=cE;function lE(){this._workerName="createPlaneOutlineGeometry"}lE.packedLength=0;lE.pack=function(e,t){return t};lE.unpack=function(e,t,n){return l(n)?n:new lE};var Ty=new m(-.5,-.5,0),SV=new m(.5,.5,0);lE.createGeometry=function(){let e=new pn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=Ty.x,n[1]=Ty.y,n[2]=Ty.z,n[3]=SV.x,n[4]=Ty.y,n[5]=Ty.z,n[6]=SV.x,n[7]=SV.y,n[8]=Ty.z,n[9]=Ty.x,n[10]=SV.y,n[11]=Ty.z,e.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new ft({attributes:e,indices:t,primitiveType:Le.LINES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var JM=lE;var Eje=new m,mue=new z;function Sje(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function If(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new Sje(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(If.prototype=Object.create(ci.prototype),If.prototype.constructor=If);If.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Hn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,mue)),l(g)||(g=z.WHITE),r=zt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=XW(d,p,f,f),new Ct({id:t,geometry:new KM(this._options),modelMatrix:f,attributes:i})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,mue),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=q.getValueOrDefault(o.plane,e,s.plane),u=q.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=XW(c,u,a,a),new Ct({id:t,geometry:new JM,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r)}})};If.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ci.prototype._isHidden.call(this,e,t)};If.prototype._getIsClosed=function(e){return!1};If.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};If.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ve.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ve.MINIMUM_VALUE,i.dimensions)};If.DynamicGeometryUpdater=uE;function uE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(uE.prototype=Object.create(ai.prototype),uE.prototype.constructor=uE);uE.prototype._isHidden=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(e.position,n,Eje);return!l(r)||!l(i.plane)||!l(i.dimensions)||ai.prototype._isHidden.call(this,e,t,n)};uE.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var vje=new m,wje=new m,Ije=new m,Pje=new m,Dje=new $,Rje=new $,Oje=new F;function XW(e,t,n,i){let r=e.normal,o=e.distance,s=m.multiplyByScalar(r,-o,Ije),a=m.clone(m.UNIT_Z,wje);D.equalsEpsilon(Math.abs(m.dot(a,r)),1,D.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,r,vje);a=m.cross(r,c,a),m.normalize(c,c),m.normalize(a,a);let u=Dje;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=m.fromElements(t.x,t.y,1,Pje),d=$.multiplyByScale(u,f,Rje),p=F.fromRotationTranslation(d,s,Oje);return F.multiplyTransformation(n,p,i)}If.createPrimitiveMatrix=XW;var ZM=If;var Mje=new m,Lje=new Ye,Nje=new H,Fje=new H,Bje=new m,kje=new m,Uje=new m,$M=new m,Vje=new m,zje=new m,hue=new Ne,Hje=new $,Gje=new $,Wje=new m;function jje(e,t,n,i,r,o,s,a,c){let u=e.positions,f=fi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Be.createTypedArray(u.length,f.length);d.set(f);let p=Hje;if(i!==0){let _=Ne.fromAxisAngle(s,i,hue);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Ne.fromAxisAngle(s,-i,hue);let E=$.fromQuaternion(_,Gje);a=m.normalize($.multiplyByVector(E,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=Fje;t.st&&(g.x=n.x,g.y=n.y);let h=u.length,x=h*3,b=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,A=t.tangent?new Float32Array(x):void 0,T=t.bitangent?new Float32Array(x):void 0,S=t.st?new Float32Array(h*2):void 0,v=0,I=0,O=0,R=0,L=0;for(let _=0;_<h;_++){let E=u[_];if(b[v++]=E.x,b[v++]=E.y,b[v++]=E.z,t.st)if(l(r)&&r.positions.length===h)S[L++]=r.positions[_].x,S[L++]=r.positions[_].y;else{let w=$.multiplyByVector(p,E,Mje),P=o(w,Nje);H.subtract(P,g,P);let M=D.clamp(P.x/n.width,0,1),B=D.clamp(P.y/n.height,0,1);S[L++]=M,S[L++]=B}t.normal&&(C[I++]=s.x,C[I++]=s.y,C[I++]=s.z),t.tangent&&(A[R++]=a.x,A[R++]=a.y,A[R++]=a.z),t.bitangent&&(T[O++]=c.x,T[O++]=c.y,T[O++]=c.z)}let N=new pn;return t.position&&(N.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(N.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(N.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(N.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(N.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new ft({attributes:N,indices:d,primitiveType:Le.TRIANGLES})}function Eb(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Oe.DEFAULT);this._vertexFormat=Oe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Kn.computeHierarchyPackedLength(t,m)+Oe.packedLength+re.packedLength+(l(n)?Kn.computeHierarchyPackedLength(n,H):1)+2}Eb.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Eb(t)};Eb.pack=function(e,t,n){return n=y(n,0),n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Kn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var qje=re.clone(re.UNIT_SPHERE),Yje=new Oe,Xje={polygonHierarchy:{}};Eb.unpack=function(e,t,n){t=y(t,0);let i=Kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,qje);t+=re.packedLength;let o=Oe.unpack(e,t,Yje);t+=Oe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Kn.unpackPolygonHierarchy(e,t,H);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Eb(Xje)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Eb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Er(s,m.equalsEpsilon,!0),s.length<3)return;let a=Bje,c=kje,u=Uje,f=Vje,d=zje;if(!n_.computeProjectTo2DArguments(s,$M,f,d))return;if(a=m.cross(f,d,a),a=m.normalize(a,a),!m.equalsEpsilon($M,m.ZERO,D.EPSILON6)){let L=e._ellipsoid.geodeticSurfaceNormal($M,Wje);m.dot(a,L)<0&&(a=m.negate(a,a),f=m.negate(f,f))}let g=n_.createProjectPointsTo2DFunction($M,f,d),h=n_.createProjectPointTo2DFunction($M,f,d);t.tangent&&(c=m.clone(f,c)),t.bitangent&&(u=m.clone(d,u));let x=Kn.polygonsFromHierarchy(n,o,g,!1),b=x.hierarchy,C=x.polygons,A=function(L){return L},T=o?Kn.polygonsFromHierarchy(r,!0,A,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=ae.fromPoints(s),v=Kn.computeBoundingRectangle(a,h,s,i,Lje),I=[];for(let L=0;L<C.length;L++){let N=new Ct({geometry:jje(C[L],t,v,i,o?T[L]:void 0,h,a,c,u)});I.push(N)}let O=Bn.combineInstances(I)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Be.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new ft({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:S})};var QM=Eb;var Kje=new me,pue=new me;function Jje(e,t,n,i){let o=i.cartesianToCartographic(e,Kje).height,s=i.cartesianToCartographic(t,pue);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,pue);a.height=o-100,i.cartographicToCartesian(a,n)}var Zje=new Ye,$je=new m,Qje=new m,eqe=new m,tqe=new m,nqe=new m,iqe=new m,vV=new m,dh=new m,fE=new m,rqe=new H,oqe=new H,sqe=new m,_ue=new Ne,aqe=new $,cqe=new $;function KW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.tangentPlane,p=e.ellipsoid,g=e.stRotation,h=e.perPositionHeight,x=rqe;x.x=f.x,x.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(h&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let A=t.tangent?new Float32Array(s):void 0,T=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,v=0,I=0,O=Qje,R=eqe,L=tqe,N=!0,_=aqe,E=cqe;if(g!==0){let M=Ne.fromAxisAngle(d._plane.normal,g,_ue);_=$.fromQuaternion(M,_),M=Ne.fromAxisAngle(d._plane.normal,-g,_ue),E=$.fromQuaternion(M,E)}else _=$.clone($.IDENTITY,_),E=$.clone($.IDENTITY,E);let w=0,P=0;c&&u&&(w=s/2,P=s/3,s/=2);for(let M=0;M<s;M+=3){let B=m.fromArray(r,M,sqe);if(t.st&&!l(o)){let V=$.multiplyByVector(_,B,$je);V=p.scaleToGeodeticSurface(V,V);let U=d.projectPointOntoPlane(V,oqe);H.subtract(U,x,U);let G=D.clamp(U.x/f.width,0,1),k=D.clamp(U.y/f.height,0,1);u&&(b[v+P]=G,b[v+1+P]=k),c&&(b[v]=G,b[v+1]=k),v+=2}if(t.normal||t.tangent||t.bitangent||i){let V=I+1,U=I+2;if(a){if(M+3<s){let G=m.fromArray(r,M+3,nqe);if(N){let k=m.fromArray(r,M+s,iqe);h&&Jje(B,G,k,p),m.subtract(G,B,G),m.subtract(k,B,k),O=m.normalize(m.cross(k,G,O),O),N=!1}m.equalsEpsilon(G,B,D.EPSILON10)&&(N=!0)}(t.tangent||t.bitangent)&&(L=p.geodeticSurfaceNormal(B,L),t.tangent&&(R=m.normalize(m.cross(L,O,R),R)))}else O=p.geodeticSurfaceNormal(B,O),(t.tangent||t.bitangent)&&(h&&(vV=m.fromArray(C,I,vV),dh=m.cross(m.UNIT_Z,vV,dh),dh=m.normalize($.multiplyByVector(E,dh,dh),dh),t.bitangent&&(fE=m.normalize(m.cross(vV,dh,fE),fE))),R=m.cross(m.UNIT_Z,O,R),R=m.normalize($.multiplyByVector(E,R,R),R),t.bitangent&&(L=m.normalize(m.cross(O,R,L),L)));t.normal&&(e.wall?(C[I+w]=O.x,C[V+w]=O.y,C[U+w]=O.z):u&&(C[I+w]=-O.x,C[V+w]=-O.y,C[U+w]=-O.z),(c&&!h||a)&&(C[I]=O.x,C[V]=O.y,C[U]=O.z)),i&&(a&&(O=p.geodeticSurfaceNormal(B,O)),S[I+w]=-O.x,S[V+w]=-O.y,S[U+w]=-O.z),t.tangent&&(e.wall?(A[I+w]=R.x,A[V+w]=R.y,A[U+w]=R.z):u&&(A[I+w]=-R.x,A[V+w]=-R.y,A[U+w]=-R.z),c&&(h?(A[I]=dh.x,A[V]=dh.y,A[U]=dh.z):(A[I]=R.x,A[V]=R.y,A[U]=R.z))),t.bitangent&&(u&&(T[I+w]=L.x,T[V+w]=L.y,T[U+w]=L.z),c&&(h?(T[I]=fE.x,T[V]=fE.y,T[U]=fE.z):(T[I]=L.x,T[V]=L.y,T[U]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(n.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),i&&(n.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===sn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===sn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var lqe=new me,uqe=new me,Ay={westOverIDL:0,eastOverIDL:0},dE=new $u;function xue(e,t,n,i,r){if(r=y(r,new ce),!l(e)||e.length<3)return r.west=0,r.north=0,r.south=0,r.east=0,r;if(n===Zt.RHUMB)return ce.fromCartesianArray(e,t,r);dE.ellipsoid.equals(t)||(dE=new $u(void 0,void 0,t)),r.west=Number.POSITIVE_INFINITY,r.east=Number.NEGATIVE_INFINITY,r.south=Number.POSITIVE_INFINITY,r.north=Number.NEGATIVE_INFINITY,Ay.westOverIDL=Number.POSITIVE_INFINITY,Ay.eastOverIDL=Number.NEGATIVE_INFINITY;let o=1/D.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],uqe),c=lqe,u;for(let f=1;f<s;f++)u=c,c=a,a=t.cartesianToCartographic(e[f],u),dE.setEndPoints(c,a),gue(dE,o,r,Ay);return u=c,c=a,a=t.cartesianToCartographic(e[0],u),dE.setEndPoints(c,a),gue(dE,o,r,Ay),r.east-r.west>Ay.eastOverIDL-Ay.westOverIDL&&(r.west=Ay.westOverIDL,r.east=Ay.eastOverIDL,r.east>D.PI&&(r.east=r.east-D.TWO_PI),r.west>D.PI&&(r.west=r.west-D.TWO_PI)),r}var fqe=new me;function gue(e,t,n,i){let r=e.surfaceDistance,o=Math.ceil(r*t),s=o>0?r/(o-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<o;c++){let u=e.interpolateUsingSurfaceDistance(a,fqe);a+=s;let f=u.longitude,d=u.latitude;n.west=Math.min(n.west,f),n.east=Math.max(n.east,f),n.south=Math.min(n.south,d),n.north=Math.max(n.north,d);let p=f>=0?f:f+D.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var yue=[];function dqe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let A=Kn.createGeometryFromPositions(e,t,n,i,o,c,u),T=A.attributes.position.values,S=A.indices,v,I;if(s&&a){let O=T.concat(T);v=O.length/3,I=Be.createTypedArray(v,S.length*2),I.set(S);let R=S.length,L=v/2;for(d=0;d<R;d+=3){let N=I[d]+L,_=I[d+1]+L,E=I[d+2]+L;I[d+R]=E,I[d+1+R]=_,I[d+2+R]=N}if(A.attributes.position.values=O,o&&c.normal){let N=A.attributes.normal.values;A.attributes.normal.values=new Float32Array(O.length),A.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=A.attributes.st.values;A.attributes.st.values=new Float32Array(v*2),A.attributes.st.values=N.concat(N)}A.indices=I}else if(a){for(v=T.length/3,I=Be.createTypedArray(v,S.length),d=0;d<S.length;d+=3)I[d]=S[d+2],I[d+1]=S[d+1],I[d+2]=S[d];A.indices=I}f.topAndBottom=new Ct({geometry:A})}let p=r.outerRing,g=ya.fromPoints(p,e),h=g.projectPointsOntoPlane(p,yue),x=fi.computeWindingOrder2D(h);x===es.CLOCKWISE&&(p=p.slice().reverse());let b=Kn.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Ct({geometry:b}));let C=r.holes;for(d=0;d<C.length;d++){let A=C[d];g=ya.fromPoints(A,e),h=g.projectPointsOntoPlane(A,yue),x=fi.computeWindingOrder2D(h),x===es.COUNTER_CLOCKWISE&&(A=A.slice().reverse()),b=Kn.computeWallGeometry(A,n,e,i,o,u),f.walls.push(new Ct({geometry:b}))}return f}function Zd(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Oe.DEFAULT),i=y(e.ellipsoid,re.WGS84),r=y(e.granularity,D.RADIANS_PER_DEGREE),o=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Oe.clone(n),this._ellipsoid=re.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Zt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Kn.computeHierarchyPackedLength(t,m)+re.packedLength+Oe.packedLength+(s?Kn.computeHierarchyPackedLength(s,H):1)+12}Zd.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Zd(t)};Zd.pack=function(e,t,n){return n=y(n,0),n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Kn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var mqe=re.clone(re.UNIT_SPHERE),hqe=new Oe,pqe={polygonHierarchy:{}};Zd.unpack=function(e,t,n){t=y(t,0);let i=Kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,mqe);t+=re.packedLength;let o=Oe.unpack(e,t,hqe);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,h=e[t++]===1,x=e[t++],b=e[t++],C=e[t]===-1?void 0:Kn.unpackPolygonHierarchy(e,t,H);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let A=e[t++];return l(n)||(n=new Zd(pqe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=h,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=C,n.packedLength=A,n};Zd.computeRectangle=function(e,t){let n=y(e.granularity,D.RADIANS_PER_DEGREE),i=y(e.arcType,Zt.GEODESIC),r=e.polygonHierarchy,o=y(e.ellipsoid,re.WGS84);return xue(r.positions,o,i,n,t)};Zd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=ya.fromPoints(p,n),h=Kn.polygonsFromHierarchy(o,d,g.projectPointsOntoPlane.bind(g),!s,n),x=h.hierarchy,b=h.polygons,C=function(w){return w},A=d?Kn.polygonsFromHierarchy(f,!0,C,!1).polygons:void 0;if(x.length===0)return;p=x[0].outerRing;let T=Kn.computeBoundingRectangle(g.plane.normal,g.projectPointOntoPlane.bind(g),p,r,Zje),S=[],v=e._height,I=e._extrudedHeight,O=e._perPositionHeightExtrude||!D.equalsEpsilon(v,I,0,D.EPSILON2),R={perPositionHeight:s,vertexFormat:t,geometry:void 0,tangentPlane:g,boundingRectangle:T,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(O)for(R.extrude=!0,R.top=a,R.bottom=c,R.shadowVolume=e._shadowVolume,R.offsetAttribute=e._offsetAttribute,L=0;L<b.length;L++){let w=dqe(n,b[L],d?A[L]:void 0,i,x[L],s,a,c,t,u),P;a&&c?(P=w.topAndBottom,R.geometry=Kn.scaleToGeodeticHeightExtruded(P.geometry,v,I,n,s)):a?(P=w.topAndBottom,P.geometry.attributes.position.values=fi.scaleToGeodeticHeight(P.geometry.attributes.position.values,v,n,!s),R.geometry=P.geometry):c&&(P=w.topAndBottom,P.geometry.attributes.position.values=fi.scaleToGeodeticHeight(P.geometry.attributes.position.values,I,n,!0),R.geometry=P.geometry),(a||c)&&(R.wall=!1,P.geometry=KW(R),S.push(P));let M=w.walls;R.wall=!0;for(let B=0;B<M.length;B++){let V=M[B];R.geometry=Kn.scaleToGeodeticHeightExtruded(V.geometry,v,I,n,s),V.geometry=KW(R),S.push(V)}}else for(L=0;L<b.length;L++){let w=new Ct({geometry:Kn.createGeometryFromPositions(n,b[L],d?A[L]:void 0,i,s,t,u)});if(w.geometry.attributes.position.values=fi.scaleToGeodeticHeight(w.geometry.attributes.position.values,v,n,!s),R.geometry=w.geometry,w.geometry=KW(R),l(e._offsetAttribute)){let P=w.geometry.attributes.position.values.length,M=e._offsetAttribute===sn.NONE?0:1,B=new Uint8Array(P/3).fill(M);w.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}S.push(w)}let N=Bn.combineInstances(S)[0];N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=Be.createTypedArray(N.attributes.position.values.length/3,N.indices);let _=N.attributes,E=ae.fromVertices(_.position.values);return t.position||delete _.position,new ft({attributes:_,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};Zd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Zd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function _qe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return ft._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(Zd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=xue(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=_qe(this)),this._textureCoordinateRotationPoints}}});var Sb=Zd;var bue=[],wV=[];function gqe(e,t,n,i,r){let s=ya.fromPoints(t,e).projectPointsOntoPlane(t,bue);fi.computeWindingOrder2D(s)===es.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let h=t[u],x=t[(u+1)%f];c[d++]=h.x,c[d++]=h.y,c[d++]=h.z,c[d++]=x.x,c[d++]=x.y,c[d++]=x.z}else{let h=0;if(r===Zt.GEODESIC)for(u=0;u<f;u++)h+=Kn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===Zt.RHUMB)for(u=0;u<f;u++)h+=Kn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(h*3),u=0;u<f;u++){let x;r===Zt.GEODESIC?x=Kn.subdivideLine(t[u],t[(u+1)%f],n,wV):r===Zt.RHUMB&&(x=Kn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,wV));let b=x.length;for(let C=0;C<b;++C)c[d++]=x[C]}}f=c.length/3;let p=f*2,g=Be.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new Ct({geometry:new ft({attributes:new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Le.LINES})})}function yqe(e,t,n,i,r){let s=ya.fromPoints(t,e).projectPointsOntoPlane(t,bue);fi.computeWindingOrder2D(s)===es.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let b=t[u],C=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let b=0;if(r===Zt.GEODESIC)for(u=0;u<f;u++)b+=Kn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===Zt.RHUMB)for(u=0;u<f;u++)b+=Kn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){d[u]=p/3;let C;r===Zt.GEODESIC?C=Kn.subdivideLine(t[u],t[(u+1)%f],n,wV):r===Zt.RHUMB&&(C=Kn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,wV));let A=C.length;for(let T=0;T<A;++T)c[p++]=C[T]}}f=c.length/(3*2);let g=d.length,h=(f*2+g)*2,x=Be.createTypedArray(f+g,h);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=d[u];x[p++]=b,x[p++]=b+f}return new Ct({geometry:new ft({attributes:new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Le.LINES})})}function vb(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,re.WGS84),i=y(e.granularity,D.RADIANS_PER_DEGREE),r=y(e.perPositionHeight,!1),o=r&&l(e.extrudedHeight),s=y(e.arcType,Zt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Kn.computeHierarchyPackedLength(t,m)+re.packedLength+8}vb.pack=function(e,t,n){return n=y(n,0),n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var xqe=re.clone(re.UNIT_SPHERE),bqe={polygonHierarchy:{}};vb.unpack=function(e,t,n){t=y(t,0);let i=Kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,xqe);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new vb(bqe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};vb.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new vb(t)};vb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Kn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,h;if(p)for(h=0;h<s.length;h++){if(a=yqe(t,s[h],u,r,o),a.geometry=Kn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,A=new Uint8Array(C);e._offsetAttribute===sn.TOP?A=A.fill(1,0,C/2):(g=e._offsetAttribute===sn.NONE?0:1,A=A.fill(g)),a.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}c.push(a)}else for(h=0;h<s.length;h++){if(a=gqe(t,s[h],u,r,o),a.geometry.attributes.position.values=fi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===sn.NONE?0:1;let A=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}c.push(a)}let x=Bn.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new ft({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var eL=vb;var Cue="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Tue="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Aue=new z,Eue=m.ZERO,Sue=new m,vue=new ce,Cqe=[],Tqe=new H;function Aqe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function yu(e,t){Jn.call(this,{entity:e,scene:t,geometryOptions:new Aqe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(yu.prototype=Object.create(Jn.prototype),yu.prototype.constructor=yu);yu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Aue)),l(s)||(s=z.WHITE),r.color=zt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Eue,Sue)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new QM(i):o=new Sb(i),new Ct({id:t,geometry:o,attributes:r})};yu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Aue),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(r),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Eue,Sue)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new xf(i):a=new eL(i),new Ct({id:t,geometry:a,attributes:s})};yu.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.mapProjection.ellipsoid,o=ya.fromPoints(i,r),s=o.projectPointsOntoPlane(i,Cqe),a=s.length,c=0,u=a-1,f=new H;for(let p=0;p<a;u=p++){let g=s[p],h=s[u],x=g.x*h.y-h.x*g.y,b=H.add(g,h,Tqe);b=H.multiplyByScalar(b,x,b),f=H.add(f,b,f),c+=x}let d=1/(c*3);return f=H.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};yu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ci.prototype._isHidden.call(this,e,t)};yu.prototype._isOnTerrain=function(e,t){let n=Jn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(Ve.MINIMUM_VALUE):!0);return n&&!r};yu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};yu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(Ve.MINIMUM_VALUE),o=q.getValueOrUndefined(t.height,Ve.MINIMUM_VALUE),s=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),a=q.getValueOrUndefined(t.extrudedHeight,Ve.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,Ve.MINIMUM_VALUE,We.NONE),u=q.getValueOrDefault(t.perPositionHeight,Ve.MINIMUM_VALUE,!1);o=Jn.getGeometryHeight(o,s);let f;u?(l(o)&&(o=void 0,Nt(Cue)),s!==We.NONE&&u&&(o=void 0,Nt(Tue))):(l(a)&&!l(o)&&(o=0),f=Jn.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=q.getValueOrUndefined(t.granularity,Ve.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,Ve.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,Ve.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,Ve.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,Ve.MINIMUM_VALUE,Zt.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,Ve.MINIMUM_VALUE),a=Jn.getGeometryExtrudedHeight(a,c),a===Jn.CLAMP_TO_GROUND&&(a=oi.getMinimumMaximumHeights(Sb.computeRectangle(i,vue)).minimumTerrainHeight),i.extrudedHeight=a};yu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};yu.DynamicGeometryUpdater=mE;function mE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(mE.prototype=Object.create(ai.prototype),mE.prototype.constructor=mE);mE.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ai.prototype._isHidden.call(this,e,t,n)};mE.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,We.NONE),s=q.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);r=Jn.getGeometryHeight(r,s);let u;c?(l(r)&&(r=void 0,Nt(Cue)),o!==We.NONE&&c&&(r=void 0,Nt(Tue))):(l(a)&&!l(r)&&(r=0),u=Jn.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,n,Zt.GEODESIC),a=Jn.getGeometryExtrudedHeight(a,s),a===Jn.CLAMP_TO_GROUND&&(a=oi.getMinimumMaximumHeights(Sb.computeRectangle(i,vue)).minimumTerrainHeight),i.extrudedHeight=a};var tL=yu;function Eqe(e,t,n,i){let r=new pn;i.position&&(r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=fi.triangulate(t),u=(a-1)*o*6+c.length*2,f=Be.createTypedArray(s,u),d,p,g,h,x,b,C=o*2,A=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,b=g+C,h=g+1,x=h+C,f[A++]=h,f[A++]=g,f[A++]=x,f[A++]=x,f[A++]=g,f[A++]=b;g=o*2-2+d*o*2,h=g+1,x=h+C,b=g+C,f[A++]=h,f[A++]=g,f[A++]=x,f[A++]=x,f[A++]=g,f[A++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),I=1/(a-1),O=1/n.height,R=n.height/2,L,N,_=0;for(d=0;d<a;d++){for(L=d*I,N=O*(t[0].y+R),v[_++]=L,v[_++]=N,p=1;p<o;p++)N=O*(t[p].y+R),v[_++]=L,v[_++]=N,v[_++]=L,v[_++]=N;N=O*(t[0].y+R),v[_++]=L,v[_++]=N}for(p=0;p<o;p++)L=0,N=O*(t[p].y+R),v[_++]=L,v[_++]=N;for(p=0;p<o;p++)L=(a-1)*I,N=O*(t[p].y+R),v[_++]=L,v[_++]=N;r.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,I=c[d+1]+T,O=c[d+2]+T;f[A++]=v,f[A++]=I,f[A++]=O,f[A++]=O+o,f[A++]=I+o,f[A++]=v+o}let S=new ft({attributes:r,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Le.TRIANGLES});if(i.normal&&(S=Bn.computeNormal(S)),i.tangent||i.bitangent){try{S=Bn.computeTangentAndBitangent(S)}catch{Nt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function iL(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+Oe.packedLength+2}iL.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var wue=re.clone(re.UNIT_SPHERE),Iue=new Oe,nL={polylinePositions:void 0,shapePositions:void 0,ellipsoid:wue,vertexFormat:Iue,cornerType:void 0,granularity:void 0};iL.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,wue);t+=re.packedLength;let c=Oe.unpack(e,t,Iue);t+=Oe.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Oe.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(nL.polylinePositions=o,nL.shapePositions=s,nL.cornerType=u,nL.granularity=f,new iL(nL))};var Sqe=new Ye;iL.createGeometry=function(e){let t=e._positions,n=Er(t,m.equalsEpsilon),i=e._shape;if(i=Hd.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===es.CLOCKWISE&&i.reverse();let r=Ye.fromPoints(i,Sqe),o=Hd.computePositions(n,i,r,e,!0);return Eqe(o,i,r,e._vertexFormat)};var rL=iL;function vqe(e,t){let n=new pn;n.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=Be.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,h=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+h}return new ft({attributes:n,indices:Be.createTypedArray(r,a),boundingSphere:ae.fromVertices(e),primitiveType:Le.LINES})}function sL(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+2}sL.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Pue=re.clone(re.UNIT_SPHERE),oL={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Pue,height:void 0,cornerType:void 0,granularity:void 0};sL.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,Pue);t+=re.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(oL.polylinePositions=o,oL.shapePositions=s,oL.cornerType=c,oL.granularity=u,new sL(oL))};var wqe=new Ye;sL.createGeometry=function(e){let t=e._positions,n=Er(t,m.equalsEpsilon),i=e._shape;if(i=Hd.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===es.CLOCKWISE&&i.reverse();let r=Ye.fromPoints(i,wqe),o=Hd.computePositions(n,i,r,e,!1);return vqe(o,i)};var aL=sL;var Due=new z;function Iqe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function mh(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new Iqe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(mh.prototype=Object.create(ci.prototype),mh.prototype.constructor=mh);mh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Hn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Due)),l(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ct({id:t,geometry:new rL(this._options),attributes:i})};mh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Due),r=this._distanceDisplayConditionProperty.getValue(e);return new Ct({id:t,geometry:new aL(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r)}})};mh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ci.prototype._isHidden.call(this,e,t)};mh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};mh.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Vt;r.vertexFormat=o?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(Ve.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(Ve.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(Ve.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(Ve.MINIMUM_VALUE):void 0};mh.DynamicGeometryUpdater=hE;function hE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(hE.prototype=Object.create(ai.prototype),hE.prototype.constructor=hE);hE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ai.prototype._isHidden.call(this,e,t,n)};hE.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var cL=mh;var JW=new m,Mue=new m,Lue=new m,Nue=new m,Fue=new ce,Pqe=new H,Dqe=new ae,Rqe=new ae;function Bue(e,t){let n=new ft({attributes:new pn,primitiveType:Le.TRIANGLES});return n.attributes.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Oqe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=Nue,f=Lue,d=Mue;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=m.fromArray(e,p,JW),h=c+1,x=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,d,f),$.multiplyByVector(i,f,f),m.normalize(f,f),t.bitangent&&m.normalize(m.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[h]=d.y,o[x]=d.z),t.tangent&&(s[c]=f.x,s[h]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[h]=u.y,a[x]=u.z),c+=3}return Bue(t,{positions:e,normals:o,tangents:s,bitangents:a})}var ZW=new m,kue=new m;function Mqe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=Nue,p=Lue,g=Mue;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let x=m.fromArray(e,h,JW),b=m.fromArray(e,(h+6)%i,ZW);if(f){let C=m.fromArray(e,(h+3)%i,kue);m.subtract(b,x,b),m.subtract(C,x,C),g=m.normalize(m.cross(C,b,g),g),f=!1}m.equalsEpsilon(b,x,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(x,d),t.tangent&&(p=m.normalize(m.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return Bue(t,{positions:e,normals:r,tangents:o,bitangents:s})}function Uue(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,h=0,x=0,b=JW,C=Pqe,A=Number.MAX_VALUE,T=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let w=0;w<o;++w)hs.computePosition(t,i,n.st,E,w,b,C),p[h++]=b.x,p[h++]=b.y,p[h++]=b.z,n.st&&(g[x++]=C.x,g[x++]=C.y,A=Math.min(A,C.x),T=Math.min(T,C.y),S=Math.max(S,C.x),v=Math.max(v,C.y));if(s&&(hs.computePosition(t,i,n.st,0,0,b,C),p[h++]=b.x,p[h++]=b.y,p[h++]=b.z,n.st&&(g[x++]=C.x,g[x++]=C.y,A=C.x,T=C.y,S=C.x,v=C.y)),a&&(hs.computePosition(t,i,n.st,r-1,0,b,C),p[h++]=b.x,p[h++]=b.y,p[h]=b.z,n.st&&(g[x++]=C.x,g[x]=C.y,A=Math.min(A,C.x),T=Math.min(T,C.y),S=Math.max(S,C.x),v=Math.max(v,C.y))),n.st&&(A<0||T<0||S>1||v>1))for(let E=0;E<g.length;E+=2)g[E]=(g[E]-A)/(S-A),g[E+1]=(g[E+1]-T)/(v-T);let I=Oqe(p,n,i,t.tangentRotationMatrix),O=6*(o-1)*(f-1);s&&(O+=3*(o-1)),a&&(O+=3*(o-1));let R=Be.createTypedArray(d,O),L=0,N=0,_;for(_=0;_<f-1;++_){for(let E=0;E<o-1;++E){let w=L,P=w+o,M=P+1,B=w+1;R[N++]=w,R[N++]=P,R[N++]=B,R[N++]=B,R[N++]=P,R[N++]=M,++L}++L}if(s||a){let E=d-1,w=d-1;s&&a&&(E=d-2);let P,M;if(L=0,s)for(_=0;_<o-1;_++)P=L,M=P+1,R[N++]=E,R[N++]=P,R[N++]=M,++L;if(a)for(L=(f-1)*o,_=0;_<o-1;_++)P=L,M=P+1,R[N++]=P,R[N++]=w,R[N++]=M,++L}return I.indices=R,n.st&&(I.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),I}function pE(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function _E(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var $W=new Oe;function Lqe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let pt=Oe.clone(r,$W);pt.normal=!0,e._vertexFormat=pt}let d=Uue(e,t);n&&(e._vertexFormat=r);let p=fi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,h=g*2,x=new Float64Array(h);x.set(p);let b=fi.scaleToGeodeticHeight(d.attributes.position.values,o,a);x.set(b,g),d.attributes.position.values=x;let C=r.normal?new Float32Array(h):void 0,A=r.tangent?new Float32Array(h):void 0,T=r.bitangent?new Float32Array(h):void 0,S=r.st?new Float32Array(h/3*2):void 0,v,I;if(r.normal){for(I=d.attributes.normal.values,C.set(I),f=0;f<g;f++)I[f]=-I[f];C.set(I,g),d.attributes.normal.values=C}if(n){I=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let pt=new Float32Array(h);for(f=0;f<g;f++)I[f]=-I[f];pt.set(I,g),d.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:pt})}let O,R=l(i);if(R){let pt=g/3*2,Tn=new Uint8Array(pt);i===sn.TOP?Tn=Tn.fill(1,0,pt/2):(O=i===sn.NONE?0:1,Tn=Tn.fill(O)),d.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Tn})}if(r.tangent){let pt=d.attributes.tangent.values;for(A.set(pt),f=0;f<g;f++)pt[f]=-pt[f];A.set(pt,g),d.attributes.tangent.values=A}if(r.bitangent){let pt=d.attributes.bitangent.values;T.set(pt),T.set(pt,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,S.set(v),S.set(v,g/3*2),d.attributes.st.values=S);let L=d.indices,N=L.length,_=g/3,E=Be.createTypedArray(h/3,N*2);for(E.set(L),f=0;f<N;f+=3)E[f+N]=L[f+2]+_,E[f+1+N]=L[f+1]+_,E[f+2+N]=L[f]+_;d.indices=E;let w=t.northCap,P=t.southCap,M=c,B=2,V=0,U=4,G=4;w&&(B-=1,M-=1,V+=1,U-=2,G-=1),P&&(B-=1,M-=1,V+=1,U-=2,G-=1),V+=B*u+2*M-U;let k=(V+G)*2,Y=new Float64Array(k*3),j=n?new Float32Array(k*3):void 0,J=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,K=i===sn.TOP;R&&!K&&(O=i===sn.ALL?1:0,J=J.fill(O));let Z=0,he=0,ge=0,se=0,pe=u*M,xe;for(f=0;f<pe;f+=u)xe=f*3,Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1);if(P){let pt=w?pe+1:pe;for(xe=pt*3,f=0;f<2;f++)Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,pt*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1)}else for(f=pe-u;f<pe;f++)xe=f*3,Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1);for(f=pe-1;f>0;f-=u)xe=f*3,Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1);if(w){let pt=pe;for(xe=pt*3,f=0;f<2;f++)Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,pt*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1)}else for(f=u-1;f>=0;f--)xe=f*3,Y=pE(Y,Z,xe,p,b),Z+=6,r.st&&(W=_E(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&(J[se++]=1,se+=1);let Pe=Mqe(Y,r,a);r.st&&(Pe.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:W})),n&&(Pe.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:j})),R&&(Pe.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let we=Be.createTypedArray(k,V*6),Se,nt,Ze,Gt;g=Y.length/3;let fn=0;for(f=0;f<g-1;f+=2){Se=f,Gt=(Se+2)%g;let pt=m.fromArray(Y,Se*3,ZW),Tn=m.fromArray(Y,Gt*3,kue);m.equalsEpsilon(pt,Tn,D.EPSILON10)||(nt=(Se+1)%g,Ze=(nt+2)%g,we[fn++]=Se,we[fn++]=nt,we[fn++]=Gt,we[fn++]=Gt,we[fn++]=nt,we[fn++]=Ze)}return Pe.indices=we,Pe=Bn.combineInstances([new Ct({geometry:d}),new Ct({geometry:Pe})]),Pe[0]}var Nqe=[new m,new m,new m,new m],Vue=new me,Fqe=new me;function QW(e,t,n,i,r){if(n===0)return ce.clone(e,r);let o=hs.computeOptions(e,t,n,0,Fue,Vue),s=o.height,a=o.width,c=Nqe;return hs.computePosition(o,i,!1,0,0,c[0]),hs.computePosition(o,i,!1,0,a-1,c[1]),hs.computePosition(o,i,!1,s-1,0,c[2]),hs.computePosition(o,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,r)}function hh(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ce.clone(t),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}hh.packedLength=ce.packedLength+re.packedLength+Oe.packedLength+7;hh.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var zue=new ce,Hue=re.clone(re.UNIT_SPHERE),Ey={rectangle:zue,ellipsoid:Hue,vertexFormat:$W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};hh.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,zue);t+=ce.packedLength;let r=re.unpack(e,t,Hue);t+=re.packedLength;let o=Oe.unpack(e,t,$W);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(Ey.granularity=s,Ey.height=a,Ey.rotation=c,Ey.stRotation=u,Ey.extrudedHeight=f,Ey.shadowVolume=d,Ey.offsetAttribute=p===-1?void 0:p,new hh(Ey))};hh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,D.RADIANS_PER_DEGREE),r=y(e.ellipsoid,re.WGS84),o=y(e.rotation,0);return QW(n,i,o,r,t)};var Bqe=new $,Rue=new Ne,kqe=new me;hh.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=hs.computeOptions(t,e._granularity,i,r,Fue,Vue,Fqe),a=Bqe;if(r!==0||i!==0){let g=ce.center(t,kqe),h=n.geodeticSurfaceNormalCartographic(g,ZW);Ne.fromAxisAngle(h,-r,Rue),$.fromQuaternion(Rue,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=Lqe(e,s);let g=ae.fromRectangle3D(t,n,c,Rqe),h=ae.fromRectangle3D(t,n,u,Dqe);p=ae.union(g,h)}else{if(d=Uue(e,s),d.attributes.position.values=fi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,h=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(g/3).fill(h);d.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new ft({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};hh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new hh({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};var Oue=new ce,Uqe=[new H,new H,new H],Vqe=new ir,zqe=new me;function Hqe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,Oue),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=QW(t,n,r,i,Oue),s=Uqe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=ir.fromRotation(e._stRotation,Vqe),u=ce.center(a,zqe);for(let h=0;h<3;++h){let x=s[h];x.x-=u.longitude,x.y-=u.latitude,ir.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return H.pack(f,g),H.pack(d,g,2),H.pack(p,g,4),g}Object.defineProperties(hh.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=QW(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Hqe(this)),this._textureCoordinateRotationPoints}}});var wb=hh;var Gue=new z,Wue=m.ZERO,jue=new m,que=new ce,Gqe=new ce,Wqe=new me;function jqe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function $d(e,t){Jn.call(this,{entity:e,scene:t,geometryOptions:new jqe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&($d.prototype=Object.create(Jn.prototype),$d.prototype.constructor=$d);$d.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Gue)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wue,jue))),new Ct({id:t,geometry:new wb(this._options),attributes:i})};$d.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Gue),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wue,jue))),new Ct({id:t,geometry:new Qx(this._options),attributes:o})};$d.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,Gqe);if(!l(n))return;let i=ce.center(n,Wqe);return me.toCartesian(i,re.WGS84,t)};$d.prototype._isHidden=function(e,t){return!l(t.coordinates)||ci.prototype._isHidden.call(this,e,t)};$d.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};$d.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=q.getValueOrUndefined(t.height,Ve.MINIMUM_VALUE),r=q.getValueOrDefault(t.heightReference,Ve.MINIMUM_VALUE,We.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Ve.MINIMUM_VALUE),s=q.getValueOrDefault(t.extrudedHeightReference,Ve.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ve.MINIMUM_VALUE,a.rectangle),a.granularity=q.getValueOrUndefined(t.granularity,Ve.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,Ve.MINIMUM_VALUE),a.rotation=q.getValueOrUndefined(t.rotation,Ve.MINIMUM_VALUE),a.offsetAttribute=Jn.computeGeometryOffsetAttribute(i,r,o,s),a.height=Jn.getGeometryHeight(i,r),o=Jn.getGeometryExtrudedHeight(o,s),o===Jn.CLAMP_TO_GROUND&&(o=oi.getMinimumMaximumHeights(wb.computeRectangle(a,que)).minimumTerrainHeight),a.extrudedHeight=o};$d.DynamicGeometryUpdater=gE;function gE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(gE.prototype=Object.create(ai.prototype),gE.prototype.constructor=gE);gE.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ai.prototype._isHidden.call(this,e,t,n)};gE.prototype._setOptions=function(e,t,n){let i=this._options,r=q.getValueOrUndefined(t.height,n),o=q.getValueOrDefault(t.heightReference,n,We.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Jn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Jn.getGeometryHeight(r,o),s=Jn.getGeometryExtrudedHeight(s,a),s===Jn.CLAMP_TO_GROUND&&(s=oi.getMinimumMaximumHeights(wb.computeRectangle(i,que)).minimumTerrainHeight),i.extrudedHeight=s};var lL=$d;var Yue=new z,qqe=new It,Yqe=new It,Xqe=m.ZERO,Kqe=new m;function Qd(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Qd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Qd.prototype.onMaterialChanged=function(){this.invalidated=!0};Qd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Qd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Qd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Qd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,Yue);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Vt&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,Yue);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,Yqe,qqe);It.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,Xqe,Kqe);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Qd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Qd.prototype.contains=function(e){return this.updaters.contains(e.id)};Qd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Qd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function yE(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}yE.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Qd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function Xue(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}yE.prototype.remove=function(e){Xue(this._solidItems,e)||Xue(this._translucentItems,e)};function Kue(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function IV(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}yE.prototype.update=function(e){let t=IV(this,this._solidItems,e,!0);t=IV(this,this._translucentItems,e,t)&&t;let n=Kue(this,this._solidItems,e),i=Kue(this,this._translucentItems,e);return(n||i)&&(t=IV(this,this._solidItems,e,t)&&t,t=IV(this,this._translucentItems,e,t)&&t),t};function Jue(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return ut.FAILED}yE.prototype.getBoundingSphere=function(e,t){let n=Jue(this._solidItems,e,t);return n===ut.FAILED?Jue(this._translucentItems,e,t):n};function Zue(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}yE.prototype.removeAllPrimitives=function(){Zue(this._solidItems),Zue(this._translucentItems)};var Pf=yE;var Jqe=new It,Zqe=new It,$qe=m.ZERO,Qqe=new m;function em(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(em.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt}em.prototype.onMaterialChanged=function(){this.invalidated=!0};em.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};em.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};em.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var eYe=new z;em.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new wn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=Xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Vt&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,eYe);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,Zqe,Jqe);It.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(b,d.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,$qe,Qqe);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};em.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};em.prototype.contains=function(e){return this.updaters.contains(e.id)};em.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};em.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function xE(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}xE.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new em(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};xE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};xE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};xE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};xE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Df=xE;var Que=Ki($ue(),1);function PV(){this._tree=new Que.default}function Ib(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Ib.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};PV.prototype.insert=function(e,t){let n=Ib.fromRectangleAndId(e,t,new Ib);this._tree.insert(n)};function tYe(e,t){return e.id===t.id}var nYe=new Ib;PV.prototype.remove=function(e,t){let n=Ib.fromRectangleAndId(e,t,nYe);this._tree.remove(n,tYe)};var iYe=new Ib;PV.prototype.collides=function(e){let t=Ib.fromRectangleAndId("",e,iYe);return this._tree.collides(t)};var Pb=PV;var rYe=new z,oYe=new It,sYe=new It;function E_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new Pb}E_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};E_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};E_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};E_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Ic({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,rYe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=zt.toValue(b,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,sYe,oYe);It.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};E_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};E_.prototype.contains=function(e){return this.updaters.contains(e.id)};E_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ut.DONE):ut.FAILED};E_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function bE(e,t){this._batches=[],this._primitives=e,this._classificationType=t}bE.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=q.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new E_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};bE.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};bE.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};bE.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};bE.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var CE=bE;var aYe=new It,cYe=new It;function Rf(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Rf.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new Pb}Rf.prototype.onMaterialChanged=function(){this.invalidated=!0};Rf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Rf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};Rf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Rf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Rf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Xr.getValue(e,this.materialProperty,this.material),n=new Ic({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,cYe,aYe);It.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Rf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Rf.prototype.contains=function(e){return this.updaters.contains(e.id)};Rf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Rf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function TE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}TE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=$l.shouldUseSphericalCoordinates(r.geometry.rectangle),s=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new Rf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};TE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};TE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};TE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};TE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var uL=TE;var lYe=new z,uYe=new It,fYe=new It,dYe=m.ZERO,mYe=new m;function S_(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.itemsToRemove=[],this.subscriptions=new Tt,this.showsUpdated=new Tt}S_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};S_.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};S_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,C=q.getValueOrDefault(b,e,z.WHITE,lYe);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,fYe,uYe);It.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,dYe,mYe);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};S_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};S_.prototype.contains=function(e){return this.updaters.contains(e.id)};S_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};S_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function AE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Tt,this._translucentBatches=new Tt}AE.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new S_(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new S_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};AE.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};AE.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};AE.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ut.FAILED};AE.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var EE=AE;var efe={};function hYe(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var pYe=new me,_Ye=new me;function gYe(e,t,n,i){t=Er(t,m.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,pYe);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],h=p===g,x=1;for(let b=1;b<r;++b){let C=t[b],A=e.cartesianToCartographic(C,_Ye);s&&(A.height=n[b]),h=h&&A.height===0,hYe(d,A)?d.height<A.height&&(c[x-1]=A.height):(a[x]=C,c[x]=A.height,o?u[x]=i[b]:u[x]=0,h=h&&c[x]===u[x],me.clone(A,d),++x)}if(!(h||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var yYe=new Array(2),xYe=new Array(2),bYe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};efe.computePositions=function(e,t,n,i,r,o){let s=gYe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=D.chordLength(r,e.maximumRadius),p=bYe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,h;for(h=0;h<a-1;h++)g+=Oi.numberOfPoints(t[h],t[h+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let x=yYe,b=xYe;p.positions=x,p.height=b;let C=0;for(h=0;h<a-1;h++){x[0]=t[h],x[1]=t[h+1],b[0]=n[h],b[1]=n[h+1];let A=Oi.generateArc(p);u.set(A,C),b[0]=i[h],b[1]=i[h+1],f.set(Oi.generateArc(p),C),C+=A.length}}else p.positions=t,p.height=n,u=new Float64Array(Oi.generateArc(p)),p.height=i,f=new Float64Array(Oi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var Db=efe;var n7=new m,DV=new m,CYe=new m,tfe=new m,TYe=new m,AYe=new m,EYe=new m;function Rb(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e.granularity,D.RADIANS_PER_DEGREE),s=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Oe.clone(r),this._granularity=o,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+re.packedLength+Oe.packedLength+1}Rb.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n]=e._granularity,t};var nfe=re.clone(re.UNIT_SPHERE),ife=new Oe,fL={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:nfe,vertexFormat:ife,granularity:void 0};Rb.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,nfe);t+=re.packedLength;let u=Oe.unpack(e,t,ife);t+=Oe.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._vertexFormat=Oe.clone(u,n._vertexFormat),n._granularity=f,n):(fL.positions=o,fL.minimumHeights=s,fL.maximumHeights=a,fL.granularity=f,new Rb(fL))};Rb.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Rb(c)};Rb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=Db.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,h=r.normal?new Float32Array(p):void 0,x=r.tangent?new Float32Array(p):void 0,b=r.bitangent?new Float32Array(p):void 0,C=r.st?new Float32Array(p/3*2):void 0,A=0,T=0,S=0,v=0,I=0,O=EYe,R=AYe,L=TYe,N=!0;d/=3;let _,E=0,w=1/(d-f-1);for(_=0;_<d;++_){let U=_*3,G=m.fromArray(u,U,n7),k=m.fromArray(c,U,DV);if(r.position&&(g[A++]=k.x,g[A++]=k.y,g[A++]=k.z,g[A++]=G.x,g[A++]=G.y,g[A++]=G.z),r.st&&(C[I++]=E,C[I++]=0,C[I++]=E,C[I++]=1),r.normal||r.tangent||r.bitangent){let Y=m.clone(m.ZERO,tfe),j=m.subtract(G,s.geodeticSurfaceNormal(G,DV),DV);if(_+1<d&&(Y=m.fromArray(u,U+3,tfe)),N){let J=m.subtract(Y,G,CYe),W=m.subtract(j,G,n7);O=m.normalize(m.cross(W,J,O),O),N=!1}m.equalsEpsilon(G,Y,D.EPSILON10)?N=!0:(E+=w,r.tangent&&(R=m.normalize(m.subtract(Y,G,R),R)),r.bitangent&&(L=m.normalize(m.cross(O,R,L),L))),r.normal&&(h[T++]=O.x,h[T++]=O.y,h[T++]=O.z,h[T++]=O.x,h[T++]=O.y,h[T++]=O.z),r.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),r.bitangent&&(b[S++]=L.x,b[S++]=L.y,b[S++]=L.z,b[S++]=L.x,b[S++]=L.y,b[S++]=L.z)}}let P=new pn;r.position&&(P.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(P.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),r.bitangent&&(P.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),r.st&&(P.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}));let M=p/3;p-=6*(f+1);let B=Be.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let U=_,G=_+2,k=m.fromArray(g,U*3,n7),Y=m.fromArray(g,G*3,DV);if(m.equalsEpsilon(k,Y,D.EPSILON10))continue;let j=_+1,J=_+3;B[V++]=j,B[V++]=U,B[V++]=J,B[V++]=J,B[V++]=U,B[V++]=G}return new ft({attributes:P,indices:B,primitiveType:Le.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var dL=Rb;var rfe=new m,ofe=new m;function Ob(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.granularity,D.RADIANS_PER_DEGREE),o=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=re.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}Ob.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var sfe=re.clone(re.UNIT_SPHERE),mL={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:sfe,granularity:void 0};Ob.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,sfe);t+=re.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._granularity=u,n):(mL.positions=o,mL.minimumHeights=s,mL.maximumHeights=a,mL.granularity=u,new Ob(mL))};Ob.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Ob(c)};Ob.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=Db.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let A=g*3,T=m.fromArray(c,A,rfe),S=m.fromArray(a,A,ofe);d[p++]=S.x,d[p++]=S.y,d[p++]=S.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let h=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),x=f/3;f=2*x-4+x;let b=Be.createTypedArray(x,f),C=0;for(g=0;g<x-2;g+=2){let A=g,T=g+2,S=m.fromArray(d,A*3,rfe),v=m.fromArray(d,T*3,ofe);if(m.equalsEpsilon(S,v,D.EPSILON10))continue;let I=g+1,O=g+3;b[C++]=I,b[C++]=A,b[C++]=I,b[C++]=O,b[C++]=A,b[C++]=T}return b[C++]=x-2,b[C++]=x-1,new ft({attributes:h,indices:b,primitiveType:Le.LINES,boundingSphere:new ae.fromVertices(d)})};var hL=Ob;var afe=new z;function SYe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function tm(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new SYe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(tm.prototype=Object.create(ci.prototype),tm.prototype.constructor=tm);tm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Hn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,afe)),l(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ct({id:t,geometry:new dL(this._options),attributes:i})};tm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,afe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ct({id:t,geometry:new hL(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:Hn.fromDistanceDisplayCondition(r)}})};tm.prototype._isHidden=function(e,t){return!l(t.positions)||ci.prototype._isHidden.call(this,e,t)};tm.prototype._getIsClosed=function(e){return!1};tm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};tm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Vt,s=this._options;s.vertexFormat=o?an.VERTEX_FORMAT:fr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ve.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ve.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ve.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(Ve.MINIMUM_VALUE):void 0};tm.DynamicGeometryUpdater=SE;function SE(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(SE.prototype=Object.create(ai.prototype),SE.prototype.constructor=SE);SE.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ai.prototype._isHidden.call(this,e,t,n)};SE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var pL=tm;var vYe=[],cfe=[MP,MM,SM,qM,XM,ZM,tL,cL,lL,pL];function _L(e,t){this.entity=e,this.scene=t;let n=new Array(cfe.length),i=new _e;function r(s){i.raiseEvent(s)}let o=new Do;for(let s=0;s<n.length;s++){let a=new cfe[s](e,t);o.add(a.geometryChanged,r),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(_L.prototype._onEntityPropertyChanged,this)}_L.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};_L.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};_L.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function Of(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let r=bn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Kr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new EE(n,e,s,!1),this._outlineBatches[r+s]=new EE(n,e,s,!0),this._closedColorBatches[s]=new Pf(n,an,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Pf(n,an,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Df(n,fr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Df(n,fr,void 0,!0,s,!1),this._openColorBatches[s]=new Pf(n,an,void 0,!1,s,!0),this._openColorBatches[r+s]=new Pf(n,an,void 0,!1,s,!1),this._openMaterialBatches[s]=new Df(n,fr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Df(n,fr,void 0,!1,s,!1);let a=Gn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new uL(i,s,fr)),c[s]=new CE(i,s);else for(s=0;s<a;++s)c[s]=new CE(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Cb(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Tt,this._updaterSets=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(Of.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,vYe)}Of.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new _L(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Of._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a<h;a++)p=g[a].update(e)&&p;return p};var wYe=[],IYe=new ae;Of.prototype.getBoundingSphere=function(e,t){let n=wYe,i=IYe,r=0,o=ut.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return ut.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===ut.PENDING)return ut.PENDING;o===ut.DONE&&(n[r]=ae.clone(i,n[r]),r++)}}return r===0?ut.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),ut.DONE)};Of.prototype.isDestroyed=function(){return!1};Of.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Of.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};Of.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Of.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=bn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Vt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Of._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Of.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var gL=Of;var PYe=1,DYe="30px sans-serif",RYe=Hr.FILL,OYe=z.WHITE,MYe=z.BLACK,LYe=1,NYe=!1,FYe=new z(.165,.165,.165,.8),BYe=new H(7,5),kYe=H.ZERO,UYe=m.ZERO,VYe=We.NONE,zYe=yi.CENTER,HYe=Rn.CENTER,GYe=new m,WYe=new z,jYe=new z,qYe=new z,YYe=new H,XYe=new m,KYe=new H,JYe=new Ot,ZYe=new Ot,$Ye=new Ot,QYe=new It;function lfe(e){this.entity=e,this.label=void 0,this.index=void 0}function Sy(e,t){t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,GYe),c=q.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){i7(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=q.getValueOrDefault(a._heightReference,e,VYe);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=m.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=q.getValueOrDefault(a._scale,e,PYe),u.font=q.getValueOrDefault(a._font,e,DYe),u.style=q.getValueOrDefault(a._style,e,RYe),u.fillColor=q.getValueOrDefault(a._fillColor,e,OYe,WYe),u.outlineColor=q.getValueOrDefault(a._outlineColor,e,MYe,jYe),u.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,LYe),u.showBackground=q.getValueOrDefault(a._showBackground,e,NYe),u.backgroundColor=q.getValueOrDefault(a._backgroundColor,e,FYe,qYe),u.backgroundPadding=q.getValueOrDefault(a._backgroundPadding,e,BYe,YYe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,kYe,KYe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,UYe,XYe),u.heightReference=g,u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,zYe),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,HYe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,JYe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,ZYe),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,$Ye),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,QYe),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};Sy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ut.DONE};Sy.prototype.isDestroyed=function(){return!1};Sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};Sy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new lfe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new lfe(o)):(i7(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],i7(s.get(o.id),o,a),s.remove(o.id)};function i7(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var yL=Sy;async function eXe(e,t,n){return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,iXe(e,t,n)}function tXe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let r=i.then(rXe(n)).catch(oXe(n));return e.shift(),t.push(r),!0}function nXe(e){return new Promise(function(t){setTimeout(t,e)})}function r7(e,t){return e.length?tXe(e,t)?r7(e,t):nXe(100).then(()=>r7(e,t)):Promise.resolve()}function iXe(e,t,n){let i=e.tilingScheme,r,o=[],s={};for(r=0;r<n.length;++r){let c=i.positionToTileXY(n[r],t);if(!l(c))continue;let u=c.toString();if(!s.hasOwnProperty(u)){let f={x:c.x,y:c.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};s[u]=f,o.push(f)}s[u].positions.push(n[r])}let a=[];return r7(o,a).then(function(){return Promise.all(a).then(function(){return n})})}function ufe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function rXe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!ufe(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];ufe(s,i,n)}}):Promise.resolve()}}function oXe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var xL=eXe;var o7=new H;async function ffe(e,t){let n=[],i=[];l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise;let r=e.availability,o=[];for(let a=0;a<t.length;++a){let c=t[a],u=r.computeMaximumLevelAtPosition(c);if(i[a]=u,u===0){e.tilingScheme.positionToTileXY(c,1,o7);let d=e.loadTileDataAvailability(o7.x,o7.y,1);l(d)&&o.push(d)}let f=n[u];l(f)||(n[u]=f=[]),f.push(c)}await Promise.all(o),await Promise.all(n.map(function(a,c){if(l(a))return xL(e,c,a)}));let s=[];for(let a=0;a<t.length;++a){let c=t[a];r.computeMaximumLevelAtPosition(c)!==i[a]&&s.push(c)}return s.length>0&&await ffe(e,s),t}var v_=ffe;var sXe=1,aXe=0,cXe=!0,lXe=!0,uXe=bn.ENABLED,fXe=We.NONE,dXe=z.RED,mXe=0,hXe=z.WHITE,pXe=Za.HIGHLIGHT,_Xe=.5,gXe=new H(1,1),yXe=new F,xXe=new F,dfe=new z,mfe=new Array(4),bXe=new m;function ph(e,t){t.collectionChanged.addEventListener(ph.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}async function CXe(e,t,n,i){let r=e._primitives,o=e._modelHash;try{let s=await Ld.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(o[t.id]))return;s.id=t,r.add(s),o[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(o[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(o[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(o[t.id]))return;console.log(s),o[t.id].loadFailed=!0}}ph.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,yXe),c=Ie.createIfNeeded(q.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,awaitingSampleTerrain:!1,clampedBoundingSphere:void 0,sampleTerrainFailed:!1},n[s.id]=u;let h=q.getValueOrDefault(a._incrementallyLoadTextures,e,cXe);CXe(this,s,c,h)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(a._scale,e,sXe),p.minimumPixelSize=q.getValueOrDefault(a._minimumPixelSize,e,aXe),p.maximumScale=q.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(d,p.modelMatrix),p.shadows=q.getValueOrDefault(a._shadows,e,uXe),p.heightReference=q.getValueOrDefault(a._heightReference,e,fXe),p.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(a._silhouetteColor,e,dXe,dfe),p.silhouetteSize=q.getValueOrDefault(a._silhouetteSize,e,mXe),p.color=q.getValueOrDefault(a._color,e,hXe,dfe),p.colorBlendMode=q.getValueOrDefault(a._colorBlendMode,e,pXe),p.colorBlendAmount=q.getValueOrDefault(a._colorBlendAmount,e,_Xe),p.clippingPlanes=q.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(a._clampAnimations,e,lXe),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(a._imageBasedLightingFactor,e,gXe);let g=q.getValueOrUndefined(a._lightColor,e);if(l(g)&&(z.pack(g,mfe,0),g=m.unpack(mfe,0,bXe)),p.lightColor=g,p.customShader=q.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let h=q.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:Tl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=h);let x=q.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let A=Object.keys(x);for(let T=0,S=A.length;T<S;++T){let v=A[T],I=x[v];if(!l(I))continue;let O=p.getNode(v);if(!l(O))continue;let R=F.fromTranslationRotationScale(I,xXe);O.matrix=F.multiply(O.originalMatrix,R,R)}}let b=!1,C=q.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(C)){let A=Object.keys(C);for(let T=0,S=A.length;T<S;++T){let v=A[T],I=C[v];l(I)&&(b=!0,p.setArticulationStage(v,I))}}b&&p.applyArticulations()}}return!0};ph.prototype.isDestroyed=function(){return!1};ph.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ph.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)s7(this,e[i],t,n);return ue(this)};ph._sampleTerrainMostDetailed=v_;var vE=new m,hfe=new me;ph.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene.globe,s=l(o)?o.terrainProvider:void 0,a=i.heightReference!==We.NONE;if(l(o)&&a){let c=o.ellipsoid;if(l(s)&&(l(s._ready)?!s._ready:l(s.ready)&&!s.ready))return ut.PENDING;let u=i.modelMatrix;vE.x=u[12],vE.y=u[13],vE.z=u[14];let f=c.cartesianToCartographic(vE);if(!l(s.availability)){i.heightReference===We.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,ut.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,ut.FAILED):l(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,ut.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(me.clone(f,hfe),this._modelHash[e.id].awaitingSampleTerrain=!0,ph._sampleTerrainMostDetailed(s,[hfe]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let x=h[0];i.heightReference===We.RELATIVE_TO_GROUND&&(x.height+=f.height),c.cartographicToCartesian(x,vE),ae.clone(i.boundingSphere,d),d.center=vE,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),ut.PENDING)}return ae.clone(i.boundingSphere,t),ut.DONE};ph.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(TXe(o,a),s.set(o.id,o)):(s7(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],s7(this,o,a,c),s.remove(o.id)};function s7(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function TXe(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var bL=ph;function vy(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(vy.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ar.FIXED}}});vy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ar.FIXED,t)};vy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};vy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?re.WGS84.scaleToGeodeticSurface(n,n):void 0};vy.prototype.equals=function(e){return this===e||e instanceof vy&&this._value===e._value};vy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _h=vy;var AXe=60,EXe=1,gfe=new An,a7=new An,c7=new An;function pfe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function SXe(e,t,n,i,r,o,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,o,c[u]),l(f)&&(c[u++]=f);let d=!l(r)||ee.lessThanOrEquals(r,t)||ee.greaterThanOrEquals(r,n),p=0,g=i.length,h=i[p],x=n,b=!1,C,A,T;for(;p<g;){if(!d&&ee.greaterThanOrEquals(h,r)&&(f=e.getValueInReferenceFrame(r,o,c[u]),l(f)&&(c[u++]=f),d=!0),ee.greaterThan(h,t)&&ee.lessThan(h,x)&&!h.equals(r)&&(f=e.getValueInReferenceFrame(h,o,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!b){let S=i[p+1],v=ee.secondsDifference(S,h);b=v>s,b&&(C=Math.ceil(v/s),A=0,T=v/Math.max(C,2),C=Math.max(C-1,1))}if(b&&A<C){h=ee.addSeconds(h,T,new ee),A++;continue}}b=!1,p++,h=i[p]}return f=e.getValueInReferenceFrame(n,o,c[u]),l(f)&&(c[u++]=f),u}function vXe(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(d,n);)!g&&ee.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=ee.addSeconds(t,p*u,new ee);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function wXe(e,t,n,i,r,o,s,a){c7.start=t,c7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,c7,gfe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=ee.addSeconds(d.start,ee.secondsDifference(d.stop,d.start)/2,new ee));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function IXe(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function PXe(e,t,n,i,r,o,s,a){a7.start=t,a7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,a7,gfe).isEmpty){let p=d.start,g=d.stop,h=t;ee.greaterThan(p,h)&&(h=p);let x=n;ee.lessThan(g,x)&&(x=g),c=yfe(d.data,h,x,i,r,o,c,a)}}return c}function yfe(e,t,n,i,r,o,s,a){for(;e instanceof x_;)e=e.resolvedProperty;if(e instanceof ra){let c=e._property._times;s=SXe(e,t,n,c,i,r,o,s,a)}else e instanceof na?s=PXe(e,t,n,i,r,o,s,a):e instanceof b_?s=wXe(e,t,n,i,r,o,s,a):e instanceof Dc||e instanceof _h&&q.isConstant(e)?s=IXe(e,t,n,i,r,o,s,a):s=vXe(e,t,n,i,r,o,s,a);return s}function xfe(e,t,n,i,r,o,s){l(s)||(s=[]);let a=yfe(e,t,n,i,r,o,0,s);return s.length=a,s}var _fe=new $;function CL(e,t){this._unusedIndexes=[],this._polylineCollection=new Bd,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}CL.prototype.update=function(e){if(this._referenceFrame===ar.INERTIAL){let t=Mt.computeIcrfToFixedMatrix(e,_fe);l(t)||(t=Mt.computeTemeToPseudoFixedMatrix(e,_fe)),F.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};CL.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=q.getValueOrUndefined(i._leadTime,e),p=q.getValueOrUndefined(i._trailTime,e),g=n._availability,h=l(g),x=l(d),b=l(p);if(u=h||x&&b,u){if(b&&(o=ee.addSeconds(e,-p,new ee)),x&&(s=ee.addSeconds(e,d,new ee)),h){let C=g.start,A=g.stop;(!b||ee.greaterThan(C,o))&&(o=C),(!x||ee.lessThan(A,s))&&(s=A)}u=ee.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,AXe);c.show=!0,c.positions=xfe(r,o,s,e,this._referenceFrame,f,c.positions.slice()),c.material=Xr.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,EXe),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};CL.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};CL.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function wy(e,t){t.collectionChanged.addEventListener(wy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}wy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],a=o.entity._position,c=o.updater,u=ar.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,o);continue}l(c)&&c.removeObject(o),l(f)||(f=new CL(this._scene,u),f.update(e),this._updaters[u]=f),o.updater=f,l(f)&&f.updateObject(e,o)}return!0};wy.prototype.isDestroyed=function(){return!1};wy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(wy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};wy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new pfe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new pfe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};wy._subSample=xfe;var TL=wy;var bfe=z.WHITE,Cfe=z.BLACK,Tfe=0,Afe=1,Efe=0,Sfe=new z,DXe=new m,vfe=new z,wfe=new Ot,Ife=new Ot,Pfe=new It;function Dfe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Iy(e,t){t.collectionChanged.addEventListener(Iy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Iy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=q.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),p;if(d&&(p=q.getValueOrUndefined(s._position,e,DXe),d=l(p)),!d){AL(o,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,h=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(AL(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,h=m.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(AL(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,wfe),c.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Ife),c.color=q.getValueOrDefault(a._color,e,bfe,Sfe),c.outlineColor=q.getValueOrDefault(a._outlineColor,e,Cfe,vfe),c.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,Tfe),c.pixelSize=q.getValueOrDefault(a._pixelSize,e,Afe),c.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Pfe),c.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Efe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,wfe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Ife),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Pfe),u.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Efe),u.heightReference=f;let x=q.getValueOrDefault(a._color,e,bfe,Sfe),b=q.getValueOrDefault(a._outlineColor,e,Cfe,vfe),C=Math.round(q.getValueOrDefault(a._outlineWidth,e,Tfe)),A=Math.max(1,Math.round(q.getValueOrDefault(a._pixelSize,e,Afe)));if(C>0?(u.scale=1,g=g||C!==o.outlineWidth||A!==o.pixelSize||!z.equals(x,o.color)||!z.equals(b,o.outlineColor)):(u.scale=A/50,A=50,g=g||C!==o.outlineWidth||!z.equals(x,o.color)||!z.equals(b,o.outlineColor)),g){o.color=z.clone(x,o.color),o.outlineColor=z.clone(b,o.outlineColor),o.pixelSize=A,o.outlineWidth=C;let T=x.alpha,S=x.toCssColorString(),v=b.toCssColorString(),I=JSON.stringify([S,A,v,C]);u.setImage(I,Wx(T,S,v,C,A))}h&&u._updateClamping()}}return!0};Iy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ut.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};Iy.prototype.isDestroyed=function(){return!1};Iy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Iy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Iy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Dfe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Dfe(o)):(AL(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],AL(s.get(o.id),o,a),s.remove(o.id)};function AL(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var EL=Iy;var Nfe=[];function RXe(e,t,n,i,r){let o=Nfe;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let x=(d-a)/r,b=(p-c)/r,C=(g-u)/r,A=(h-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*x,c+s*b,u+s*C,f+s*A);return o}function SL(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),r=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._arcType=y(e.arcType,Zt.GEODESIC),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+re.packedLength+Oe.packedLength+4}SL.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Ffe=re.clone(re.UNIT_SPHERE),Bfe=new Oe,Mb={positions:void 0,colors:void 0,ellipsoid:Ffe,vertexFormat:Bfe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};SL.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t,Ffe);t+=re.packedLength;let c=Oe.unpack(e,t,Bfe);t+=Oe.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Oe.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(Mb.positions=o,Mb.colors=s,Mb.width=u,Mb.colorsPerVertex=f,Mb.arcType=d,Mb.granularity=p,new SL(Mb))};var Rfe=new m,Ofe=new m,Mfe=new m,Lfe=new m;SL.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Er(e._positions,m.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,B=d[0];i=i.filter(function(V,U){let G=!1;return r?G=U===B||U===0&&B===1:G=U+1===B,G?(M++,B=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===Zt.GEODESIC||o===Zt.RHUMB){let M,B;o===Zt.GEODESIC?(M=D.chordLength(s,a.maximumRadius),B=Oi.numberOfPoints):(M=s,B=Oi.numberOfPointsRhumbLine);let V=Oi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=B(p[c],p[c+1],M);let G=new Array(U),k=0;for(c=0;c<g-1;++c){let Y=p[c],j=p[c+1],J=i[c],W=B(Y,j,M);if(r&&c<U){let K=i[c+1],Z=RXe(Y,j,J,K,W),he=Z.length;for(u=0;u<he;++u)G[k++]=Z[u]}else for(u=0;u<W;++u)G[k++]=z.clone(J)}G[k]=z.clone(i[i.length-1]),i=G,Nfe.length=0}o===Zt.GEODESIC?p=Oi.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=Oi.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:V})}g=p.length;let h=g*4-4,x=new Float64Array(h*3),b=new Float64Array(h*3),C=new Float64Array(h*3),A=new Float32Array(h*2),T=n.st?new Float32Array(h*2):void 0,S=l(i)?new Uint8Array(h*4):void 0,v=0,I=0,O=0,R=0,L;for(u=0;u<g;++u){u===0?(L=Rfe,m.subtract(p[0],p[1],L),m.add(p[0],L,L)):L=p[u-1],m.clone(L,Mfe),m.clone(p[u],Ofe),u===g-1?(L=Rfe,m.subtract(p[g-1],p[g-2],L),m.add(p[g-1],L,L)):L=p[u+1],m.clone(L,Lfe);let M,B;l(S)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(B=i[u]));let V=u===0?2:0,U=u===g-1?2:4;for(f=V;f<U;++f){m.pack(Ofe,x,v),m.pack(Mfe,b,v),m.pack(Lfe,C,v),v+=3;let G=f-2<0?-1:1;if(A[I++]=2*(f%2)-1,A[I++]=G*t,n.st&&(T[O++]=u/(g-1),T[O++]=Math.max(A[I-2],0)),l(S)){let k=f<2?M:B;S[R++]=z.floatToByte(k.red),S[R++]=z.floatToByte(k.green),S[R++]=z.floatToByte(k.blue),S[R++]=z.floatToByte(k.alpha)}}}let N=new pn;N.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),N.prevPosition=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),N.nextPosition=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),N.expandAndWidth=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A}),n.st&&(N.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T})),l(S)&&(N.color=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Be.createTypedArray(h,g*6-6),E=0,w=0,P=g-1;for(u=0;u<P;++u)_[w++]=E,_[w++]=E+2,_[w++]=E+1,_[w++]=E+1,_[w++]=E+2,_[w++]=E+3,E+=4;return new ft({attributes:N,indices:_,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:Yu.POLYLINES})};var w_=SL;var OXe=new ti(0),RV={},kfe=new z,MXe=new Vt(z.WHITE),LXe=new ti(!0),NXe=new ti(bn.DISABLED),FXe=new ti(new It),BXe=new ti(Gn.BOTH);function kXe(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function UXe(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function nm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(nm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new kXe,this._groundGeometryOptions=new UXe,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Kr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(nm.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});nm.prototype.isOutlineVisible=function(e){return!1};nm.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};nm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Hn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Vt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,kfe)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)),this.clampToGround?new Ct({id:t,geometry:new J0(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Vt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,kfe)),l(a)||(a=z.WHITE),s.depthFailColor=zt.fromColor(a)),new Ct({id:t,geometry:new w_(this._geometryOptions),attributes:s}))};nm.prototype.createOutlineGeometryInstance=function(e){};nm.prototype.isDestroyed=function(){return!1};nm.prototype.destroy=function(){this._entitySubscription(),ue(this)};nm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(Ve.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=y(r.material,MXe),u=c instanceof Vt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=y(s,LXe),this._shadowsProperty=y(r.shadows,NXe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,FXe),this._classificationTypeProperty=y(r.classificationType,BXe),this._fillEnabled=!0,this._zIndex=y(a,OXe);let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!q.isConstant(f)||!q.isConstant(d)||!q.isConstant(g)||!q.isConstant(p)||!q.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,x=o.getValue(Ve.MINIMUM_VALUE,h.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Vt)?b=Wo.VERTEX_FORMAT:b=Ks.VERTEX_FORMAT,h.vertexFormat=b,h.positions=x,h.width=l(f)?f.getValue(Ve.MINIMUM_VALUE):void 0,h.arcType=l(d)?d.getValue(Ve.MINIMUM_VALUE):void 0,h.granularity=l(g)?g.getValue(Ve.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=h.width,C.arcType=h.arcType,C.granularity=h.granularity,this._clampToGround=l(p)?p.getValue(Ve.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Nt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};nm.prototype.createDynamicUpdater=function(e,t){return new vL(e,t,this)};var wE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function vL(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Ufe(e){if(l(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=RV[t],i=e._primitives;!l(n)||n.isDestroyed()?(n=new Bd,RV[t]=n,i.add(n)):i.contains(n)||i.add(n);let r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}vL.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=q.getValueOrUndefined(r,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,Zt.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let f=t.fillMaterialProperty,d;if(f instanceof Vt)d=new Wo;else{let p=Xr.getValue(e,f,this._material);d=new Ks({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new dd({geometryInstances:t.createFillGeometryInstance(e),appearance:d,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Ufe(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=Zt.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe;c!==Zt.NONE&&l(u)&&(wE.ellipsoid=u.ellipsoid,wE.positions=o,wE.granularity=q.getValueOrUndefined(i._granularity,e),wE.height=Oi.extractHeights(o,u.ellipsoid),c===Zt.GEODESIC?o=Oi.generateCartesianArc(wE):o=Oi.generateCartesianRhumbArc(wE)),a.show=!0,a.positions=o.slice(),a.material=Xr.getValue(e,t.fillMaterialProperty,a.material),a.width=q.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};vL.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=Ufe(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};vL.prototype.isDestroyed=function(){return!1};vL.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=RV[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete RV[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var wL=nm;var VXe=new z,zXe=new It,HXe=new It;function im(e,t,n,i,r){let o;n instanceof Vt?o=Wo:o=Ks,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(im.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.zIndex=i,this._asynchronous=r}im.prototype.onMaterialChanged=function(){this.invalidated=!0};im.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};im.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};im.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};im.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new dd({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ks&&(this.material=Xr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ks&&(this.material=Xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,VXe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=zt.toValue(b,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=xn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,HXe,zXe);It.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=It.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Hn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};im.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};im.prototype.contains=function(e){return this.updaters.contains(e.id)};im.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};im.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function IE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}IE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=q.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new im(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};IE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};IE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};IE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return ut.FAILED};IE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var IL=IE;var GXe=[];function Vfe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function zfe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Vt?1:2);let o;l(i)&&(o=i+r*bn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Vt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function gh(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let r,o=bn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new Pf(n,Wo,void 0,!1,r),this._materialBatches[r]=new Df(n,Ks,void 0,!1,r),this._colorBatches[r+o]=new Pf(n,Wo,Wo,!1,r),this._materialBatches[r+o]=new Df(n,Ks,Wo,!1,r),this._colorBatches[r+o*2]=new Pf(n,Wo,Ks,!1,r),this._materialBatches[r+o*2]=new Df(n,Ks,Ks,!1,r);this._dynamicBatch=new Cb(n,i);let s=Gn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new IL(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Tt,this._updaters=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(gh.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,GXe)}gh.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Vfe(this,f),zfe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),Vfe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new wL(c,this._scene),this._updaters.set(u,f),zfe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(gh._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var WXe=[],jXe=new ae;gh.prototype.getBoundingSphere=function(e,t){let n=WXe,i=jXe,r=0,o=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return ut.FAILED;for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===ut.PENDING)return ut.PENDING;o===ut.DONE&&(n[r]=ae.clone(i,n[r]),r++)}return r===0?ut.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),ut.DONE)};gh.prototype.isDestroyed=function(){return!1};gh.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(gh.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};gh._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};gh.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var PL=gh;function Mf(e){Ic.initializeTerrainHeights(),dd.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Do,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Mf.defaultVisualizersCallback);let i=!1,r=new Pl,o=new Pl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new DM;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}Mf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new hv(t,i),new gL(e,i,n._primitives,n._groundPrimitives),new yL(t,i),new bL(e,i),new _M(e,i),new EL(t,i),new TL(e,i),new PL(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(Mf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Mf.prototype.update=function(e){if(!oi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return this._ready=t,t};Mf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var qXe=[],YXe=new ae;Mf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ut.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return ut.FAILED;let s=qXe,a=YXe,c=0,u=ut.DONE,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ut.PENDING)return ut.PENDING;u===ut.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),ut.DONE)};Mf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Pl),s=r.add(new jM);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Mf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};Mf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var DL=Mf;function l7(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}l7.clone=function(e,t){if(l(e))return l(t)||(t=new l7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var xu=l7;var Hfe=new $,Gfe=new $,Wfe=new $,XXe=new F,OV=new m,jfe=new m,u7=new m,f7=new m,qfe=new m,Yfe=new m,PE=new ee,KXe=1.25;function JXe(e,t,n,i,r,o,s){let a=e.scene.mode,c=r.getValue(o,e._lastCartesian);if(l(c)){let u=!1,f=!1,d,p,g;if(a===ne.SCENE3D){ee.addSeconds(o,.001,PE);let A=r.getValue(PE,OV);if(l(A)||(ee.addSeconds(o,-.001,PE),A=r.getValue(PE,OV),f=!0),l(A)){let T=Mt.computeFixedToIcrfMatrix(o,Hfe),S=Mt.computeFixedToIcrfMatrix(PE,Gfe),v;!l(T)||!l(S)?(v=Mt.computeTemeToPseudoFixedMatrix(o,Wfe),T=$.transpose(v,Hfe),S=Mt.computeTemeToPseudoFixedMatrix(PE,Gfe),$.transpose(S,S)):v=$.transpose(T,Wfe);let I=$.multiplyByVector(T,c,qfe),O=$.multiplyByVector(S,A,Yfe);m.subtract(I,O,f7);let R=m.magnitude(f7)*1e3,L=D.GRAVITATIONALPARAMETER,N=-L/(R*R-2*L/m.magnitude(I));N<0||N>KXe*s.maximumRadius?(d=jfe,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,u7),p=m.cross(g,d,OV),m.magnitude(p)>D.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,u7),m.normalize(g,g),u=!0)):m.equalsEpsilon(c,A,D.EPSILON7)||(g=jfe,m.normalize(I,g),m.normalize(O,O),p=m.cross(g,O,u7),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,D.EPSILON7)||(d=m.cross(p,g,OV),$.multiplyByVector(v,d,d),$.multiplyByVector(v,p,p),$.multiplyByVector(v,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,x,b;i&&(h=m.clone(t.position,f7),x=m.clone(t.direction,qfe),b=m.clone(t.up,Yfe));let C=XXe;u?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(x,t.direction),m.clone(b,t.up),m.cross(x,b,t.right))}if(n){let u=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function RL(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,re.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(RL,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});RL.defaultOffset3D=new m(-14e3,3500,3500);var MV=new xu,ZXe=new m;RL.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===ne.MORPHING)return;let o=this.entity,s=o.position;if(!l(s))return;let a=o!==this._lastEntity,c=r!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=o.viewFrom,g=l(p);if(!g&&l(t)){MV.pitch=-D.PI_OVER_FOUR,MV.range=0;let h=s.getValue(e,ZXe);if(l(h)){let x=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);MV.pitch*=x}u.viewBoundingSphere(t,MV),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&m.clone(RL._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(u.position,this._offset3D);this._lastEntity=o,this._mode=r,JXe(this,u,f,d,s,e,i)};var OL=RL;function VV(e){return zV(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function zV(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?zV(n):n),[])}var Xfe=[0,1,2,3].concat(...VV([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function uo(){let e=this;function t(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,h,x,b=0;for(g=0;g<=15;g++)r.bl_count[g]=0;for(o[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<573;f++)d=r.heap[f],g=o[o[d*2+1]*2+1]+1,g>u&&(g=u,b++),o[d*2+1]=g,!(d>e.max_code)&&(r.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),x=o[d*2],r.opt_len+=x*(g+h),s&&(r.static_len+=x*(s[d*2+1]+h)));if(b!==0){do{for(g=u-1;r.bl_count[g]===0;)g--;r.bl_count[g]--,r.bl_count[g+1]+=2,r.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(d=r.bl_count[g];d!==0;)p=r.heap[--f],!(p>e.max_code)&&(o[p*2+1]!=g&&(r.opt_len+=(g-o[p*2+1])*o[p*2],o[p*2+1]=g),d--)}}function n(r,o){let s=0;do s|=r&1,r>>>=1,s<<=1;while(--o>0);return s>>>1}function i(r,o,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=o;f++)d=r[f*2+1],d!==0&&(r[f*2]=n(a[d]++,d))}e.build_tree=function(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(r.heap_len=0,r.heap_max=573,c=0;c<a;c++)o[c*2]!==0?(r.heap[++r.heap_len]=f=c,r.depth[c]=0):o[c*2+1]=0;for(;r.heap_len<2;)d=r.heap[++r.heap_len]=f<2?++f:0,o[d*2]=1,r.depth[d]=0,r.opt_len--,s&&(r.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(r.heap_len/2);c>=1;c--)r.pqdownheap(o,c);d=a;do c=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),u=r.heap[1],r.heap[--r.heap_max]=c,r.heap[--r.heap_max]=u,o[d*2]=o[c*2]+o[u*2],r.depth[d]=Math.max(r.depth[c],r.depth[u])+1,o[c*2+1]=o[u*2+1]=d,r.heap[1]=d++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],t(r),i(o,e.max_code,r.bl_count)}}uo._length_code=[0,1,2,3,4,5,6,7].concat(...VV([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));uo.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];uo.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];uo.d_code=function(e){return e<256?Xfe[e]:Xfe[256+(e>>>7)]};uo.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];uo.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];uo.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];uo.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Sa(e,t,n,i,r){let o=this;o.static_tree=e,o.extra_bits=t,o.extra_base=n,o.elems=i,o.max_length=r}var $Xe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],QXe=VV([[144,8],[112,9],[24,7],[8,8]]);Sa.static_ltree=zV($Xe.map((e,t)=>[e,QXe[t]]));var eKe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],tKe=VV([[30,5]]);Sa.static_dtree=zV(eKe.map((e,t)=>[e,tKe[t]]));Sa.static_l_desc=new Sa(Sa.static_ltree,uo.extra_lbits,256+1,286,15);Sa.static_d_desc=new Sa(Sa.static_dtree,uo.extra_dbits,0,30,15);Sa.static_bl_desc=new Sa(null,uo.extra_blbits,0,19,7);var nKe=9,iKe=8;function yh(e,t,n,i,r){let o=this;o.good_length=e,o.max_lazy=t,o.nice_length=n,o.max_chain=i,o.func=r}var Jfe=0,kV=1,Lb=2,rm=[new yh(0,0,0,0,Jfe),new yh(4,4,8,4,kV),new yh(4,5,16,8,kV),new yh(4,6,32,32,kV),new yh(4,4,16,16,Lb),new yh(8,16,32,32,Lb),new yh(8,16,128,128,Lb),new yh(8,32,128,256,Lb),new yh(32,128,258,1024,Lb),new yh(32,258,258,4096,Lb)],LV=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Lf=0,NV=1,ML=2,FV=3,rKe=32,d7=42,BV=113,LL=666,m7=8,oKe=0,h7=1,sKe=2,To=3,UV=258,bu=UV+To+1;function Kfe(e,t,n,i){let r=e[t*2],o=e[n*2];return r<o||r==o&&i[t]<=i[n]}function aKe(){let e=this,t,n,i,r,o,s,a,c,u,f,d,p,g,h,x,b,C,A,T,S,v,I,O,R,L,N,_,E,w,P,M,B,V,U=new uo,G=new uo,k=new uo;e.depth=[];let Y,j,J,W,K,Z;e.bl_count=[],e.heap=[],M=[],B=[],V=[];function he(){u=2*o,d[g-1]=0;for(let ke=0;ke<g-1;ke++)d[ke]=0;N=rm[_].max_lazy,w=rm[_].good_length,P=rm[_].nice_length,L=rm[_].max_chain,v=0,C=0,O=0,A=R=To-1,S=0,p=0}function ge(){let ke;for(ke=0;ke<286;ke++)M[ke*2]=0;for(ke=0;ke<30;ke++)B[ke*2]=0;for(ke=0;ke<19;ke++)V[ke*2]=0;M[256*2]=1,e.opt_len=e.static_len=0,j=J=0}function se(){U.dyn_tree=M,U.stat_desc=Sa.static_l_desc,G.dyn_tree=B,G.stat_desc=Sa.static_d_desc,k.dyn_tree=V,k.stat_desc=Sa.static_bl_desc,K=0,Z=0,W=8,ge()}e.pqdownheap=function(ke,st){let Ke=e.heap,He=Ke[st],dt=st<<1;for(;dt<=e.heap_len&&(dt<e.heap_len&&Kfe(ke,Ke[dt+1],Ke[dt],e.depth)&&dt++,!Kfe(ke,He,Ke[dt],e.depth));)Ke[st]=Ke[dt],st=dt,dt<<=1;Ke[st]=He};function pe(ke,st){let Ke=-1,He,dt=ke[0*2+1],_t=0,hn=7,Hi=4;dt===0&&(hn=138,Hi=3),ke[(st+1)*2+1]=65535;for(let Rr=0;Rr<=st;Rr++)He=dt,dt=ke[(Rr+1)*2+1],!(++_t<hn&&He==dt)&&(_t<Hi?V[He*2]+=_t:He!==0?(He!=Ke&&V[He*2]++,V[16*2]++):_t<=10?V[17*2]++:V[18*2]++,_t=0,Ke=He,dt===0?(hn=138,Hi=3):He==dt?(hn=6,Hi=3):(hn=7,Hi=4))}function xe(){let ke;for(pe(M,U.max_code),pe(B,G.max_code),k.build_tree(e),ke=19-1;ke>=3&&V[uo.bl_order[ke]*2+1]===0;ke--);return e.opt_len+=3*(ke+1)+5+5+4,ke}function Pe(ke){e.pending_buf[e.pending++]=ke}function we(ke){Pe(ke&255),Pe(ke>>>8&255)}function Se(ke){Pe(ke>>8&255),Pe(ke&255&255)}function nt(ke,st){let Ke,He=st;Z>16-He?(Ke=ke,K|=Ke<<Z&65535,we(K),K=Ke>>>16-Z,Z+=He-16):(K|=ke<<Z&65535,Z+=He)}function Ze(ke,st){let Ke=ke*2;nt(st[Ke]&65535,st[Ke+1]&65535)}function Gt(ke,st){let Ke,He=-1,dt,_t=ke[0*2+1],hn=0,Hi=7,Rr=4;for(_t===0&&(Hi=138,Rr=3),Ke=0;Ke<=st;Ke++)if(dt=_t,_t=ke[(Ke+1)*2+1],!(++hn<Hi&&dt==_t)){if(hn<Rr)do Ze(dt,V);while(--hn!==0);else dt!==0?(dt!=He&&(Ze(dt,V),hn--),Ze(16,V),nt(hn-3,2)):hn<=10?(Ze(17,V),nt(hn-3,3)):(Ze(18,V),nt(hn-11,7));hn=0,He=dt,_t===0?(Hi=138,Rr=3):dt==_t?(Hi=6,Rr=3):(Hi=7,Rr=4)}}function fn(ke,st,Ke){let He;for(nt(ke-257,5),nt(st-1,5),nt(Ke-4,4),He=0;He<Ke;He++)nt(V[uo.bl_order[He]*2+1],3);Gt(M,ke-1),Gt(B,st-1)}function pt(){Z==16?(we(K),K=0,Z=0):Z>=8&&(Pe(K&255),K>>>=8,Z-=8)}function Tn(){nt(h7<<1,3),Ze(256,Sa.static_ltree),pt(),1+W+10-Z<9&&(nt(h7<<1,3),Ze(256,Sa.static_ltree),pt()),W=7}function Vn(ke,st){let Ke,He,dt;if(e.dist_buf[j]=ke,e.lc_buf[j]=st&255,j++,ke===0?M[st*2]++:(J++,ke--,M[(uo._length_code[st]+256+1)*2]++,B[uo.d_code(ke)*2]++),!(j&8191)&&_>2){for(Ke=j*8,He=v-C,dt=0;dt<30;dt++)Ke+=B[dt*2]*(5+uo.extra_dbits[dt]);if(Ke>>>=3,J<Math.floor(j/2)&&Ke<Math.floor(He/2))return!0}return j==Y-1}function Ut(ke,st){let Ke,He,dt=0,_t,hn;if(j!==0)do Ke=e.dist_buf[dt],He=e.lc_buf[dt],dt++,Ke===0?Ze(He,ke):(_t=uo._length_code[He],Ze(_t+256+1,ke),hn=uo.extra_lbits[_t],hn!==0&&(He-=uo.base_length[_t],nt(He,hn)),Ke--,_t=uo.d_code(Ke),Ze(_t,st),hn=uo.extra_dbits[_t],hn!==0&&(Ke-=uo.base_dist[_t],nt(Ke,hn)));while(dt<j);Ze(256,ke),W=ke[256*2+1]}function Pt(){Z>8?we(K):Z>0&&Pe(K&255),K=0,Z=0}function Ce(ke,st,Ke){Pt(),W=8,Ke&&(we(st),we(~st)),e.pending_buf.set(c.subarray(ke,ke+st),e.pending),e.pending+=st}function ve(ke,st,Ke){nt((oKe<<1)+(Ke?1:0),3),Ce(ke,st,!0)}function ot(ke,st,Ke){let He,dt,_t=0;_>0?(U.build_tree(e),G.build_tree(e),_t=xe(),He=e.opt_len+3+7>>>3,dt=e.static_len+3+7>>>3,dt<=He&&(He=dt)):He=dt=st+5,st+4<=He&&ke!=-1?ve(ke,st,Ke):dt==He?(nt((h7<<1)+(Ke?1:0),3),Ut(Sa.static_ltree,Sa.static_dtree)):(nt((sKe<<1)+(Ke?1:0),3),fn(U.max_code+1,G.max_code+1,_t+1),Ut(M,B)),ge(),Ke&&Pt()}function Kt(ke){ot(C>=0?C:-1,v-C,ke),C=v,t.flush_pending()}function _i(){let ke,st,Ke,He;do{if(He=u-O-v,He===0&&v===0&&O===0)He=o;else if(He==-1)He--;else if(v>=o+o-bu){c.set(c.subarray(o,o+o),0),I-=o,v-=o,C-=o,ke=g,Ke=ke;do st=d[--Ke]&65535,d[Ke]=st>=o?st-o:0;while(--ke!==0);ke=o,Ke=ke;do st=f[--Ke]&65535,f[Ke]=st>=o?st-o:0;while(--ke!==0);He+=o}if(t.avail_in===0)return;ke=t.read_buf(c,v+O,He),O+=ke,O>=To&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<bu&&t.avail_in!==0)}function Je(ke){let st=65535,Ke;for(st>i-5&&(st=i-5);;){if(O<=1){if(_i(),O===0&&ke==0)return Lf;if(O===0)break}if(v+=O,O=0,Ke=C+st,(v===0||v>=Ke)&&(O=v-Ke,v=Ke,Kt(!1),t.avail_out===0)||v-C>=o-bu&&(Kt(!1),t.avail_out===0))return Lf}return Kt(ke==4),t.avail_out===0?ke==4?ML:Lf:ke==4?FV:NV}function ho(ke){let st=L,Ke=v,He,dt,_t=R,hn=v>o-bu?v-(o-bu):0,Hi=P,Rr=a,ss=v+UV,As=c[Ke+_t-1],io=c[Ke+_t];R>=w&&(st>>=2),Hi>O&&(Hi=O);do if(He=ke,!(c[He+_t]!=io||c[He+_t-1]!=As||c[He]!=c[Ke]||c[++He]!=c[Ke+1])){Ke+=2,He++;do;while(c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&c[++Ke]==c[++He]&&Ke<ss);if(dt=UV-(ss-Ke),Ke=ss-UV,dt>_t){if(I=ke,_t=dt,dt>=Hi)break;As=c[Ke+_t-1],io=c[Ke+_t]}}while((ke=f[ke&Rr]&65535)>hn&&--st!==0);return _t<=O?_t:O}function vr(ke){let st=0,Ke;for(;;){if(O<bu){if(_i(),O<bu&&ke==0)return Lf;if(O===0)break}if(O>=To&&(p=(p<<b^c[v+(To-1)]&255)&x,st=d[p]&65535,f[v&a]=d[p],d[p]=v),st!==0&&(v-st&65535)<=o-bu&&E!=2&&(A=ho(st)),A>=To)if(Ke=Vn(v-I,A-To),O-=A,A<=N&&O>=To){A--;do v++,p=(p<<b^c[v+(To-1)]&255)&x,st=d[p]&65535,f[v&a]=d[p],d[p]=v;while(--A!==0);v++}else v+=A,A=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else Ke=Vn(0,c[v]&255),O--,v++;if(Ke&&(Kt(!1),t.avail_out===0))return Lf}return Kt(ke==4),t.avail_out===0?ke==4?ML:Lf:ke==4?FV:NV}function zo(ke){let st=0,Ke,He;for(;;){if(O<bu){if(_i(),O<bu&&ke==0)return Lf;if(O===0)break}if(O>=To&&(p=(p<<b^c[v+(To-1)]&255)&x,st=d[p]&65535,f[v&a]=d[p],d[p]=v),R=A,T=I,A=To-1,st!==0&&R<N&&(v-st&65535)<=o-bu&&(E!=2&&(A=ho(st)),A<=5&&(E==1||A==To&&v-I>4096)&&(A=To-1)),R>=To&&A<=R){He=v+O-To,Ke=Vn(v-1-T,R-To),O-=R-1,R-=2;do++v<=He&&(p=(p<<b^c[v+(To-1)]&255)&x,st=d[p]&65535,f[v&a]=d[p],d[p]=v);while(--R!==0);if(S=0,A=To-1,v++,Ke&&(Kt(!1),t.avail_out===0))return Lf}else if(S!==0){if(Ke=Vn(0,c[v-1]&255),Ke&&Kt(!1),v++,O--,t.avail_out===0)return Lf}else S=1,v++,O--}return S!==0&&(Ke=Vn(0,c[v-1]&255),S=0),Kt(ke==4),t.avail_out===0?ke==4?ML:Lf:ke==4?FV:NV}function os(ke){return ke.total_in=ke.total_out=0,ke.msg=null,e.pending=0,e.pending_out=0,n=BV,r=0,se(),he(),0}e.deflateInit=function(ke,st,Ke,He,dt,_t){return He||(He=m7),dt||(dt=iKe),_t||(_t=0),ke.msg=null,st==-1&&(st=6),dt<1||dt>nKe||He!=m7||Ke<9||Ke>15||st<0||st>9||_t<0||_t>2?-2:(ke.dstate=e,s=Ke,o=1<<s,a=o-1,h=dt+7,g=1<<h,x=g-1,b=Math.floor((h+To-1)/To),c=new Uint8Array(o*2),f=[],d=[],Y=1<<dt+6,e.pending_buf=new Uint8Array(Y*4),i=Y*4,e.dist_buf=new Uint16Array(Y),e.lc_buf=new Uint8Array(Y),_=st,E=_t,os(ke))},e.deflateEnd=function(){return n!=d7&&n!=BV&&n!=LL?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==BV?-3:0)},e.deflateParams=function(ke,st,Ke){let He=0;return st==-1&&(st=6),st<0||st>9||Ke<0||Ke>2?-2:(rm[_].func!=rm[st].func&&ke.total_in!==0&&(He=ke.deflate(1)),_!=st&&(_=st,N=rm[_].max_lazy,w=rm[_].good_length,P=rm[_].nice_length,L=rm[_].max_chain),E=Ke,He)},e.deflateSetDictionary=function(ke,st,Ke){let He=Ke,dt,_t=0;if(!st||n!=d7)return-2;if(He<To)return 0;for(He>o-bu&&(He=o-bu,_t=Ke-He),c.set(st.subarray(_t,_t+He),0),v=He,C=He,p=c[0]&255,p=(p<<b^c[1]&255)&x,dt=0;dt<=He-To;dt++)p=(p<<b^c[dt+(To-1)]&255)&x,f[dt&a]=d[p],d[p]=dt;return 0},e.deflate=function(ke,st){let Ke,He,dt,_t,hn;if(st>4||st<0)return-2;if(!ke.next_out||!ke.next_in&&ke.avail_in!==0||n==LL&&st!=4)return ke.msg=LV[2- -2],-2;if(ke.avail_out===0)return ke.msg=LV[2- -5],-5;if(t=ke,_t=r,r=st,n==d7&&(He=m7+(s-8<<4)<<8,dt=(_-1&255)>>1,dt>3&&(dt=3),He|=dt<<6,v!==0&&(He|=rKe),He+=31-He%31,n=BV,Se(He)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return r=-1,0}else if(t.avail_in===0&&st<=_t&&st!=4)return t.msg=LV[2- -5],-5;if(n==LL&&t.avail_in!==0)return ke.msg=LV[2- -5],-5;if(t.avail_in!==0||O!==0||st!=0&&n!=LL){switch(hn=-1,rm[_].func){case Jfe:hn=Je(st);break;case kV:hn=vr(st);break;case Lb:hn=zo(st);break;default:}if((hn==ML||hn==FV)&&(n=LL),hn==Lf||hn==ML)return t.avail_out===0&&(r=-1),0;if(hn==NV){if(st==1)Tn();else if(ve(0,0,!1),st==3)for(Ke=0;Ke<g;Ke++)d[Ke]=0;if(t.flush_pending(),t.avail_out===0)return r=-1,0}}return st!=4?0:1}}function Zfe(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Zfe.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new aKe,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function cKe(e){let t=this,n=new Zfe,i=lKe(e&&e.chunkSize?e.chunkSize:64*1024),r=0,o=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=o,t.append=function(a,c){let u,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(r),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(o)):h.push(o.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(x){f.set(x,p),p+=x.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(o.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function lKe(e){return e+5*(Math.floor(e/16383)+1)}var $fe=cKe;var Cu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],yde=1440,uKe=0,fKe=4,dKe=9,mKe=5,hKe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],pKe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],_Ke=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],gKe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],yKe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],xKe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Py=15;function y7(){let e=this,t,n,i,r,o,s;function a(u,f,d,p,g,h,x,b,C,A,T){let S,v,I,O,R,L,N,_,E,w,P,M,B,V,U;w=0,R=d;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==d)return x[0]=-1,b[0]=0,0;for(_=b[0],L=1;L<=Py&&i[L]===0;L++);for(N=L,_<L&&(_=L),R=Py;R!==0&&i[R]===0;R--);for(I=R,_>R&&(_=R),b[0]=_,V=1<<L;L<R;L++,V<<=1)if((V-=i[L])<0)return-3;if((V-=i[R])<0)return-3;for(i[R]+=V,s[1]=L=0,w=1,B=2;--R!==0;)s[B]=L+=i[w],B++,w++;R=0,w=0;do(L=u[f+w])!==0&&(T[s[L]++]=R),w++;while(++R<d);for(d=s[I],s[0]=R=0,w=0,O=-1,M=-_,o[0]=0,P=0,U=0;N<=I;N++)for(S=i[N];S--!==0;){for(;N>M+_;){if(O++,M+=_,U=I-M,U=U>_?_:U,(v=1<<(L=N-M))>S+1&&(v-=S+1,B=N,L<U))for(;++L<U&&!((v<<=1)<=i[++B]);)v-=i[B];if(U=1<<L,A[0]+U>yde)return-3;o[O]=P=A[0],A[0]+=U,O!==0?(s[O]=R,r[0]=L,r[1]=_,L=R>>>M-_,r[2]=P-o[O-1]-L,C.set(r,(o[O-1]+L)*3)):x[0]=P}for(r[1]=N-M,w>=d?r[0]=128+64:T[w]<p?(r[0]=T[w]<256?0:32+64,r[2]=T[w++]):(r[0]=h[T[w]-p]+16+64,r[2]=g[T[w++]-p]),v=1<<N-M,L=R>>>M;L<U;L+=v)C.set(r,(P+L)*3);for(L=1<<N-1;R&L;L>>>=1)R^=L;for(R^=L,E=(1<<M)-1;(R&E)!=s[O];)O--,M-=_,E=(1<<M)-1}return V!==0&&I!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(Py+1),r=[],o=new Int32Array(Py),s=new Int32Array(Py+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<Py+1;f++)i[f]=0;for(f=0;f<3;f++)r[f]=0;o.set(i.subarray(0,Py),0),s.set(i.subarray(0,Py+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let h;return c(19),t[0]=0,h=a(u,0,19,19,null,null,d,f,p,t,n),h==-3?g.msg="oversubscribed dynamic bit lengths tree":(h==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(u,f,d,p,g,h,x,b,C){let A;return c(288),t[0]=0,A=a(d,0,u,257,_Ke,gKe,h,p,b,t,n),A!=0||p[0]===0?(A==-3?C.msg="oversubscribed literal/length tree":A!=-4&&(C.msg="incomplete literal/length tree",A=-3),A):(c(288),A=a(d,u,f,0,yKe,xKe,x,g,b,t,n),A!=0||g[0]===0&&u>257?(A==-3?C.msg="oversubscribed distance tree":A==-5?(C.msg="incomplete distance tree",A=-3):A!=-4&&(C.msg="empty distance tree with lengths",A=-3),A):0)}}y7.inflate_trees_fixed=function(e,t,n,i){return e[0]=dKe,t[0]=mKe,n[0]=hKe,i[0]=pKe,0};var HV=0,Qfe=1,ede=2,tde=3,nde=4,ide=5,rde=6,p7=7,ode=8,GV=9;function bKe(){let e=this,t,n=0,i,r=0,o=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,h=0;function x(b,C,A,T,S,v,I,O){let R,L,N,_,E,w,P,M,B,V,U,G,k,Y,j,J;P=O.next_in_index,M=O.avail_in,E=I.bitb,w=I.bitk,B=I.write,V=B<I.read?I.read-B-1:I.end-B,U=Cu[b],G=Cu[C];do{for(;w<20;)M--,E|=(O.read_byte(P++)&255)<<w,w+=8;if(R=E&U,L=A,N=T,J=(N+R)*3,(_=L[J])===0){E>>=L[J+1],w-=L[J+1],I.win[B++]=L[J+2],V--;continue}do{if(E>>=L[J+1],w-=L[J+1],_&16){for(_&=15,k=L[J+2]+(E&Cu[_]),E>>=_,w-=_;w<15;)M--,E|=(O.read_byte(P++)&255)<<w,w+=8;R=E&G,L=S,N=v,J=(N+R)*3,_=L[J];do if(E>>=L[J+1],w-=L[J+1],_&16){for(_&=15;w<_;)M--,E|=(O.read_byte(P++)&255)<<w,w+=8;if(Y=L[J+2]+(E&Cu[_]),E>>=_,w-=_,V-=k,B>=Y)j=B-Y,B-j>0&&2>B-j?(I.win[B++]=I.win[j++],I.win[B++]=I.win[j++],k-=2):(I.win.set(I.win.subarray(j,j+2),B),B+=2,j+=2,k-=2);else{j=B-Y;do j+=I.end;while(j<0);if(_=I.end-j,k>_){if(k-=_,B-j>0&&_>B-j)do I.win[B++]=I.win[j++];while(--_!==0);else I.win.set(I.win.subarray(j,j+_),B),B+=_,j+=_,_=0;j=0}}if(B-j>0&&k>B-j)do I.win[B++]=I.win[j++];while(--k!==0);else I.win.set(I.win.subarray(j,j+k),B),B+=k,j+=k,k=0;break}else if(!(_&64))R+=L[J+2],R+=E&Cu[_],J=(N+R)*3,_=L[J];else return O.msg="invalid distance code",k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,P-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=P-O.next_in_index,O.next_in_index=P,I.write=B,-3;while(!0);break}if(_&64)return _&32?(k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,P-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=P-O.next_in_index,O.next_in_index=P,I.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,P-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=P-O.next_in_index,O.next_in_index=P,I.write=B,-3);if(R+=L[J+2],R+=E&Cu[_],J=(N+R)*3,(_=L[J])===0){E>>=L[J+1],w-=L[J+1],I.win[B++]=L[J+2],V--;break}}while(!0)}while(V>=258&&M>=10);return k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,P-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=P-O.next_in_index,O.next_in_index=P,I.write=B,0}e.init=function(b,C,A,T,S,v){t=HV,u=b,f=C,d=A,p=T,g=S,h=v,i=null},e.proc=function(b,C,A){let T,S,v,I=0,O=0,R=0,L,N,_,E;for(R=C.next_in_index,L=C.avail_in,I=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N;;)switch(t){case HV:if(_>=258&&L>=10&&(b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,A=x(u,f,d,p,g,h,b,C),R=C.next_in_index,L=C.avail_in,I=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N,A!=0)){t=A==1?p7:GV;break}o=u,i=d,r=p,t=Qfe;case Qfe:for(T=o;O<T;){if(L!==0)A=0;else return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);L--,I|=(C.read_byte(R++)&255)<<O,O+=8}if(S=(r+(I&Cu[T]))*3,I>>>=i[S+1],O-=i[S+1],v=i[S],v===0){s=i[S+2],t=rde;break}if(v&16){a=v&15,n=i[S+2],t=ede;break}if(!(v&64)){o=v,r=S/3+i[S+2];break}if(v&32){t=p7;break}return t=GV,C.msg="invalid literal/length code",A=-3,b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);case ede:for(T=a;O<T;){if(L!==0)A=0;else return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);L--,I|=(C.read_byte(R++)&255)<<O,O+=8}n+=I&Cu[T],I>>=T,O-=T,o=f,i=g,r=h,t=tde;case tde:for(T=o;O<T;){if(L!==0)A=0;else return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);L--,I|=(C.read_byte(R++)&255)<<O,O+=8}if(S=(r+(I&Cu[T]))*3,I>>=i[S+1],O-=i[S+1],v=i[S],v&16){a=v&15,c=i[S+2],t=nde;break}if(!(v&64)){o=v,r=S/3+i[S+2];break}return t=GV,C.msg="invalid distance code",A=-3,b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);case nde:for(T=a;O<T;){if(L!==0)A=0;else return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);L--,I|=(C.read_byte(R++)&255)<<O,O+=8}c+=I&Cu[T],I>>=T,O-=T,t=ide;case ide:for(E=N-c;E<0;)E+=b.end;for(;n!==0;){if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,A=b.inflate_flush(C,A),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);b.win[N++]=b.win[E++],_--,E==b.end&&(E=0),n--}t=HV;break;case rde:if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,A=b.inflate_flush(C,A),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);A=0,b.win[N++]=s,_--,t=HV;break;case p7:if(O>7&&(O-=8,L++,R--),b.write=N,A=b.inflate_flush(C,A),N=b.write,_=N<b.read?b.read-N-1:b.end-N,b.read!=b.write)return b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);t=ode;case ode:return A=1,b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);case GV:return A=-3,b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A);default:return A=-2,b.bitb=I,b.bitk=O,C.avail_in=L,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=N,b.inflate_flush(C,A)}},e.free=function(){}}var sde=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],DE=0,_7=1,ade=2,cde=3,lde=4,ude=5,WV=6,jV=7,fde=8,Nb=9;function CKe(e,t){let n=this,i=DE,r=0,o=0,s=0,a,c=[0],u=[0],f=new bKe,d=0,p=new Int32Array(yde*3),g=0,h=new y7;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=g),i==WV&&f.free(x),i=DE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let C,A,T;return A=x.next_out_index,T=n.read,C=(T<=n.write?n.write:n.end)-T,C>x.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(T,T+C),A),A+=C,T+=C,T==n.end&&(T=0,n.write==n.end&&(n.write=0),C=n.write-T,C>x.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(T,T+C),A),A+=C,T+=C),x.next_out_index=A,n.read=T,b},n.proc=function(x,b){let C,A,T,S,v,I,O,R;for(S=x.next_in_index,v=x.avail_in,A=n.bitb,T=n.bitk,I=n.write,O=I<n.read?n.read-I-1:n.end-I;;){let L,N,_,E,w,P,M,B;switch(i){case DE:for(;T<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}switch(C=A&7,d=C&1,C>>>1){case 0:A>>>=3,T-=3,C=T&7,A>>>=C,T-=C,i=_7;break;case 1:L=[],N=[],_=[[]],E=[[]],y7.inflate_trees_fixed(L,N,_,E),f.init(L[0],N[0],_[0],0,E[0],0),A>>>=3,T-=3,i=WV;break;case 2:A>>>=3,T-=3,i=cde;break;case 3:return A>>>=3,T-=3,i=Nb,x.msg="invalid block type",b=-3,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b)}break;case _7:for(;T<32;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}if((~A>>>16&65535)!=(A&65535))return i=Nb,x.msg="invalid stored block lengths",b=-3,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);r=A&65535,A=T=0,i=r!==0?ade:d!==0?jV:DE;break;case ade:if(v===0||O===0&&(I==n.end&&n.read!==0&&(I=0,O=I<n.read?n.read-I-1:n.end-I),O===0&&(n.write=I,b=n.inflate_flush(x,b),I=n.write,O=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,O=I<n.read?n.read-I-1:n.end-I),O===0)))return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);if(b=0,C=r,C>v&&(C=v),C>O&&(C=O),n.win.set(x.read_buf(S,C),I),S+=C,v-=C,I+=C,O-=C,(r-=C)!==0)break;i=d!==0?jV:DE;break;case cde:for(;T<14;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}if(o=C=A&16383,(C&31)>29||(C>>5&31)>29)return i=Nb,x.msg="too many length or distance symbols",b=-3,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(R=0;R<C;R++)a[R]=0;A>>>=14,T-=14,s=0,i=lde;case lde:for(;s<4+(o>>>10);){for(;T<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}a[sde[s++]]=A&7,A>>>=3,T-=3}for(;s<19;)a[sde[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,x),C!=0)return b=C,b==-3&&(a=null,i=Nb),n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);s=0,i=ude;case ude:for(;C=o,!(s>=258+(C&31)+(C>>5&31));){let V,U;for(C=c[0];T<C;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}if(C=p[(u[0]+(A&Cu[C]))*3+1],U=p[(u[0]+(A&Cu[C]))*3+2],U<16)A>>>=C,T-=C,a[s++]=U;else{for(R=U==18?7:U-14,V=U==18?11:3;T<C+R;){if(v!==0)b=0;else return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,A|=(x.read_byte(S++)&255)<<T,T+=8}if(A>>>=C,T-=C,V+=A&Cu[R],A>>>=R,T-=R,R=s,C=o,R+V>258+(C&31)+(C>>5&31)||U==16&&R<1)return a=null,i=Nb,x.msg="invalid bit length repeat",b=-3,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);U=U==16?a[R-1]:0;do a[R++]=U;while(--V!==0);s=R}}if(u[0]=-1,w=[],P=[],M=[],B=[],w[0]=9,P[0]=6,C=o,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,w,P,M,B,p,x),C!=0)return C==-3&&(a=null,i=Nb),b=C,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);f.init(w[0],P[0],p,M[0],p,B[0]),i=WV;case WV:if(n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),S=x.next_in_index,v=x.avail_in,A=n.bitb,T=n.bitk,I=n.write,O=I<n.read?n.read-I-1:n.end-I,d===0){i=DE;break}i=jV;case jV:if(n.write=I,b=n.inflate_flush(x,b),I=n.write,O=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);i=fde;case fde:return b=1,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);case Nb:return b=-3,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);default:return b=-2,n.bitb=A,n.bitk=T,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,C){n.win.set(x.subarray(b,b+C),0),n.read=n.write=C},n.sync_point=function(){return i==_7?1:0}}var TKe=32,AKe=8,EKe=0,dde=1,mde=2,hde=3,pde=4,_de=5,g7=6,NL=7,gde=12,Dy=13,SKe=[0,0,255,255];function vKe(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=NL,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new CKe(n,1<<i),t(n),0)},e.inflate=function(n,i){let r,o;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==fKe?-5:0,r=-5;;)switch(s.mode){case EKe:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=AKe){s.mode=Dy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Dy,n.msg="invalid win size",s.marker=5;break}s.mode=dde;case dde:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,o=n.read_byte(n.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=Dy,n.msg="incorrect header check",s.marker=5;break}if(!(o&TKe)){s.mode=NL;break}s.mode=mde;case mde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=hde;case hde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=pde;case pde:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=_de;case _de:return n.avail_in===0?r:(r=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=g7,2);case g7:return s.mode=Dy,n.msg="need dictionary",s.marker=0,-2;case NL:if(r=s.blocks.proc(n,r),r==-3){s.mode=Dy,s.marker=0;break}if(r==0&&(r=i),r!=1)return r;r=i,s.blocks.reset(n,s.was),s.mode=gde;case gde:return n.avail_in=0,1;case Dy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,r){let o=0,s=r;if(!n||!n.istate||n.istate.mode!=g7)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,o=r-s),a.blocks.set_dictionary(i,o,s),a.mode=NL,0},e.inflateSync=function(n){let i,r,o,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Dy&&(c.mode=Dy,c.marker=0),(i=n.avail_in)===0)return-5;for(r=n.next_in_index,o=c.marker;i!==0&&o<4;)n.read_byte(r)==SKe[o]?o++:n.read_byte(r)!==0?o=0:o=4-o,r++,i--;return n.total_in+=r-n.next_in_index,n.next_in_index=r,n.avail_in=i,c.marker=o,o!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=NL,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function xde(){}xde.prototype={inflateInit:function(e){let t=this;return t.istate=new vKe,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function wKe(e){let t=this,n=new xde,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,r=uKe,o=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=o,t.append=function(a,c){let u=[],f,d,p=0,g=0,h=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(r),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(o)):u.push(o.slice(0,n.next_out_index))),h+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(h),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var bde=wKe;var IKe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},Rl=Object.assign({},IKe);function qV(){return Rl}function RE(e){if(e.baseURL!==void 0&&(Rl.baseURL=e.baseURL),e.chunkSize!==void 0&&(Rl.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(Rl.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(Rl.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(Rl.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(Rl.Deflate=e.Deflate),e.Inflate!==void 0&&(Rl.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");Rl.workerScripts||(Rl.workerScripts={}),Rl.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");Rl.workerScripts||(Rl.workerScripts={}),Rl.workerScripts.inflate=e.workerScripts.inflate}}}var Cde=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Cde[e]=t}var x7=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,r=t.length|0;i<r;i++)n=n>>>8^Cde[(n^t[i])&255];this.crc=n}get(){return~this.crc}},Ry=x7;var FL=PKe;function PKe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Yc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Yc.getPartial(n);return i===32?e.concat(t):Yc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Yc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Yc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=Yc.getPartial(r);return i.push(Yc.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},BL={bytes:{fromBits(e){let n=Yc.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)o&3||(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Yc.partial(8*(n&3),i)),t}}},b7={};b7.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};b7.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=BL.utf8String.toBits(e));let n=t._buffer=Yc.concat(t._buffer,e),i=t._length,r=t._length=i+Yc.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=Yc.concat(t,[Yc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var C7={};C7.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],x=4,b,C,A;for(let T=0;T<i;T++)b=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[h&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^u[d&255]^n[x+1],A=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=b,p=C,g=A;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[x++],b=d,d=p,p=g,g=h,h=b;return r}};var Tde={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let r=987654321,o=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&o,i=18e3*(i&65535)+(i>>16)&o,(((r<<16)+i&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,r;i<e.length;i+=4){let o=n((r||Math.random())*4294967296);r=o()*987654071,t[i/4]=o()*4294967296|0}return e}},T7={};T7.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=Yc.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return Yc.clamp(t,r)}};var OE={importKey(e){return new OE.hmacSha1(BL.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=Yc;for(t=BL.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};OE.hmacSha1=class{constructor(e){let t=this,n=t._hash=b7.sha1,i=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var LE="Invalid pasword",ME=16,DKe="raw",Ade={name:"PBKDF2"},RKe={name:"HMAC"},OKe="SHA-1",MKe=Object.assign({hash:RKe},Ade),Ede=Object.assign({iterations:1e3,hash:{name:OKe}},Ade),LKe=["deriveBits"],UL=[8,12,16],kL=[16,24,32],Oy=10,Sde=[0,0,0,0],KV=typeof crypto<"u",vde=KV&&typeof crypto.subtle<"u",xh=BL.bytes,wde=C7.aes,Ide=T7.ctrGladman,Pde=OE.hmacSha1,YV=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let r=Tu(t,0,UL[n.strength]+2);await NKe(n,r,n.password),n.password=null,n.aesCtrGladman=new Ide(new wde(n.keys.key),Array.from(Sde)),n.hmac=new Pde(n.keys.authentication),t=Tu(t,UL[n.strength]+2)}let i=new Uint8Array(t.length-Oy-(t.length-Oy)%ME);return Dde(n,t,i,0,Oy,!0)}flush(){let t=this,n=t.pendingInput,i=Tu(n,0,n.length-Oy),r=Tu(n,n.length-Oy),o=new Uint8Array(0);if(i.length){let a=xh.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);o=xh.fromBits(c)}let s=!0;if(t.signed){let a=Tu(xh.fromBits(t.hmac.digest()),0,Oy);for(let c=0;c<Oy;c++)a[c]!=r[c]&&(s=!1)}return{valid:s,data:o}}},XV=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await FKe(n,n.password),n.password=null,n.aesCtrGladman=new Ide(new wde(n.keys.key),Array.from(Sde)),n.hmac=new Pde(n.keys.authentication));let r=new Uint8Array(i.length+t.length-t.length%ME);return r.set(i,0),Dde(n,t,r,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let r=t.aesCtrGladman.update(xh.toBits(t.pendingInput));t.hmac.update(r),n=xh.fromBits(r)}let i=Tu(xh.fromBits(t.hmac.digest()),0,Oy);return{data:A7(n,i),signature:i}}};function Dde(e,t,n,i,r,o){let s=t.length-r;e.pendingInput.length&&(t=A7(e.pendingInput,t),n=VKe(n,s-s%ME));let a;for(a=0;a<=s-ME;a+=ME){let c=xh.toBits(Tu(t,a,a+ME));o&&e.hmac.update(c);let u=e.aesCtrGladman.update(c);o||e.hmac.update(u),n.set(xh.fromBits(u),a+i)}return e.pendingInput=Tu(t,a),n}async function NKe(e,t,n){await Rde(e,n,Tu(t,0,UL[e.strength]));let i=Tu(t,UL[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new Error(LE)}async function FKe(e,t){let n=BKe(new Uint8Array(UL[e.strength]));return await Rde(e,t,n),A7(n,e.keys.passwordVerification)}async function Rde(e,t,n){let i=FL(t),r=await kKe(DKe,i,MKe,!1,LKe),o=await UKe(Object.assign({salt:n},Ede),r,8*(kL[e.strength]*2+2)),s=new Uint8Array(o);e.keys={key:xh.toBits(Tu(s,0,kL[e.strength])),authentication:xh.toBits(Tu(s,kL[e.strength],kL[e.strength]*2)),passwordVerification:Tu(s,kL[e.strength]*2)}}function BKe(e){return KV&&typeof crypto.getRandomValues=="function"?crypto.getRandomValues(e):Tde.getRandomValues(e)}function kKe(e,t,n,i,r){return KV&&vde&&typeof crypto.subtle.importKey=="function"?crypto.subtle.importKey(e,t,n,i,r):OE.importKey(t)}async function UKe(e,t,n){return KV&&vde&&typeof crypto.subtle.deriveBits=="function"?await crypto.subtle.deriveBits(e,t,n):OE.pbkdf2(t,e.salt,Ede.iterations,n)}function A7(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function VKe(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Tu(e,t,n){return e.subarray(t,n)}var NE=12,JV=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Nde(i,t)}append(t){let n=this;if(n.password){let i=Ode(n,t.subarray(0,NE));if(n.password=null,i[NE-1]!=n.passwordVerification)throw new Error(LE);t=t.subarray(NE)}return Ode(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},ZV=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Nde(i,t)}append(t){let n=this,i,r;if(n.password){n.password=null;let o=crypto.getRandomValues(new Uint8Array(NE));o[NE-1]=n.passwordVerification,i=new Uint8Array(t.length+o.length),i.set(Mde(n,o),0),r=NE}else i=new Uint8Array(t.length),r=0;return i.set(Mde(n,t),r),i}flush(){return{data:new Uint8Array(0)}}};function Ode(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Fde(e)^t[i],E7(e,n[i]);return n}function Mde(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Fde(e)^t[i],E7(e,t[i]);return n}function Nde(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new Ry(e.keys[0]),e.crcKey2=new Ry(e.keys[2]);for(let n=0;n<t.length;n++)E7(e,t.charCodeAt(n))}function E7(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=Lde(e.keys[1]+Bde(e.keys[0])),e.keys[1]=Lde(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function Fde(e){let t=e.keys[2]|2;return Bde(Math.imul(t,t^1)>>>8)}function Bde(e){return e&255}function Lde(e){return e&4294967295}var QV="deflate",ez="inflate",$V="Invalid signature",S7=class{constructor(t,{signature:n,password:i,signed:r,compressed:o,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:r,compressed:o,inflate:o&&new t({chunkSize:u}),crc32:r&&new Ry,zipCrypto:s,decrypt:f&&s?new JV(i,a):new YV(i,r,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let r=t.decrypt.flush();if(!r.valid)throw new Error($V);i=r.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let r=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),r.setUint32(0,n),t.signature!=r.getUint32(0,!1))throw new Error($V)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},v7=class{constructor(t,{encrypted:n,signed:i,compressed:r,level:o,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:r,deflate:r&&new t({level:o||5,chunkSize:f}),crc32:i&&new Ry,zipCrypto:s,encrypt:n&&s?new ZV(a,c):new XV(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let r=t.encrypt.flush();n=r.signature;let o=new Uint8Array(i.length+r.data.length);o.set(i,0),o.set(r.data,i.length),i=o}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function kde(e,t,n){if(t.codecType.startsWith(QV))return new v7(e,t,n);if(t.codecType.startsWith(ez))return new S7(e,t,n)}var Ude="init",Vde="append",w7="flush",zKe="message",zde=!0,tz=(e,t,n,i,r,o,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,r(e)}}),o?GKe(e,i):HKe(e,i));function HKe(e,t){let n=kde(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(r){throw e.onTaskFinished(),r}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function GKe(e,t){let n,i={type:"module"};if(!e.interface){if(!zde)e.worker=r(i,t.baseURL);else try{e.worker=r({},t.baseURL)}catch{zde=!1,e.worker=r(i,t.baseURL)}e.worker.addEventListener(zKe,a,!1),e.interface={append(c){return o({type:Vde,data:c})},flush(){return o({type:w7})},abort(){e.onTaskFinished()}}}return e.interface;function r(c,u){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,u)}catch{d=f}return new Worker(d,c)}async function o(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:Ude,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==Ude||d==w7||d==Vde){let p=u.data;d==w7?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var Fb=[],I7=[];function nz(e,t,n){let r=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),o=r&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Fb.length<n.maxWorkers){let a={};return Fb.push(a),tz(a,e,t,n,s,r,o)}else{let a=Fb.find(c=>!c.busy);return a?(Hde(a),tz(a,e,t,n,s,r,o)):new Promise(c=>I7.push({resolve:c,codecConstructor:e,options:t,webWorker:r,scripts:o}))}function s(a){if(I7.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=I7.splice(0,1);c(tz(a,u,f,n,s,d,p))}else a.worker?(Hde(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{Fb=Fb.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):Fb=Fb.filter(c=>c!=a)}}function Hde(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var Wde="Abort error";async function iz(e,t,n,i,r,o,s){let a=Math.max(o.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal,p=r();if(u<p){P7(d,e);let g=await t.readUint8Array(u+i,Math.min(a,p-u)),h=g.length;P7(d,e);let x=await e.append(g);if(P7(d,e),f+=await Gde(n,x),s.onprogress)try{s.onprogress(u+h,p)}catch{}return c(u+a,f)}else{let g=await e.flush();return f+=await Gde(n,g.data),{signature:g.signature,length:f}}}}function P7(e,t){if(e&&e.aborted)throw t.abort(),new Error(Wde)}async function Gde(e,t){return t.length&&await e.writeUint8Array(t),t.length}var D7="text/plain";var rz=class{constructor(){this.size=0}init(){this.initialized=!0}},oz=class extends rz{},VL=class extends rz{writeUint8Array(t){this.size+=t.length}},sz=class extends oz{constructor(t){super(),this.blobReader=new Bb(new Blob([t],{type:D7}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},az=class extends VL{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:D7})}writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:D7})}getData(){if(this.blob.text)return this.blob.text();{let t=new FileReader;return new Promise((n,i)=>{t.onload=r=>n(r.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var cz=class extends VL{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,r=this.pending.length;for(this.pending="",n=0;n<Math.floor((r+t.length)/3)*3-r;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},Bb=class extends oz{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(new Uint8Array(s.target.result)),i.onerror=()=>o(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},FE=class extends VL{constructor(t){super(),this.contentType=t,this.arrayBuffersMaxlength=8,jde(this)}writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.length==this.arrayBuffersMaxlength&&qde(this),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&qde(this),this.blob=this.pendingBlob,jde(this)),this.blob}};function jde(e){e.pendingBlob=new Blob([],{type:e.contentType}),e.arrayBuffers=[]}function qde(e){e.pendingBlob=new Blob([e.pendingBlob,...e.arrayBuffers],{type:e.contentType}),e.arrayBuffers=[]}var BE="/",R7=new Date(2107,11,31),O7=new Date(1980,0,1);var WKe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Yde=e=>{let t="";for(let n=0;n<e.length;n++)t+=WKe[e[n]];return t};var lz=jKe;function jKe(e,t){if(t&&t.trim().toLowerCase()=="cp437")return Yde(e);if(typeof TextDecoder>"u"){let n=new FileReader;return new Promise((i,r)=>{n.onload=o=>i(o.target.result),n.onerror=()=>r(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var qKe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],I_=class{constructor(t){qKe.forEach(n=>this[n]=t[n])}};var N7="File format is not recognized",JKe="End of central directory not found",ZKe="End of Zip64 central directory not found",$Ke="End of Zip64 central directory locator not found",QKe="Central directory header not found",eJe="Local file header not found",tJe="Zip64 extra field not found",nJe="File contains encrypted entry",iJe="Encryption method not supported",Xde="Compression method not supported",Kde="utf-8",Jde="cp437",Zde=["uncompressedSize","compressedSize","offset"],yz=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:qV()})}async*getEntriesGenerator(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(N7);let r=await cJe(i,101010256,i.size,22,65535*16);if(!r)throw new Error(JKe);let o=ac(r),s=sa(o,12),a=sa(o,16),c=Au(o,8),u=0;if(a==4294967295||s==4294967295||c==65535){let g=await My(i,r.offset-20,20),h=ac(g);if(sa(h,0)!=117853008)throw new Error(ZKe);a=uz(h,8);let x=await My(i,a,56),b=ac(x),C=r.offset-20-56;if(sa(b,0)!=101075792&&a!=C){let A=a;a=C,u=a-A,x=await My(i,a,56),b=ac(x)}if(sa(b,0)!=101075792)throw new Error($Ke);c=uz(b,32),s=uz(b,40),a-=s}if(a<0||a>=i.size)throw new Error(N7);let f=0,d=await My(i,a,s),p=ac(d);if(s){let g=r.offset-s;if(sa(p,f)!=33639248&&a!=g){let h=a;a=g,u=a-h,d=await My(i,a,s),p=ac(d)}}if(a<0||a>=i.size)throw new Error(N7);for(let g=0;g<c;g++){let h=new B7(i,n.config,n.options);if(sa(p,f)!=33639248)throw new Error(QKe);Qde(h,p,f+6);let x=!!h.bitFlag.languageEncodingFlag,b=f+46,C=b+h.filenameLength,A=C+h.extraFieldLength,T=Au(p,f+4),S=(T&0)==0;Object.assign(h,{versionMadeBy:T,msDosCompatible:S,compressedSize:0,uncompressedSize:0,commentLength:Au(p,f+32),directory:S&&(UE(p,f+38)&16)==16,offset:sa(p,f+42)+u,internalFileAttribute:sa(p,f+34),externalFileAttribute:sa(p,f+38),rawFilename:d.subarray(b,C),filenameUTF8:x,commentUTF8:x,rawExtraField:d.subarray(C,A)});let v=A+h.commentLength;h.rawComment=d.subarray(A,v);let I=kE(n,t,"filenameEncoding"),O=kE(n,t,"commentEncoding"),[R,L]=await Promise.all([lz(h.rawFilename,h.filenameUTF8?Kde:I||Jde),lz(h.rawComment,h.commentUTF8?Kde:O||Jde)]);h.filename=R,h.comment=L,!h.directory&&h.filename.endsWith(BE)&&(h.directory=!0),await eme(h,h,p,f+6);let N=new I_(h);if(N.getData=(_,E)=>h.getData(_,N,E),f=v,t.onprogress)try{t.onprogress(g+1,c,new I_(h))}catch{}yield N}return!0}async getEntries(t={}){let n=[],i=this.getEntriesGenerator(t),r=i.next();for(;!(await r).done;)n.push((await r).value),r=i.next();return n}async close(){}};var B7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let r=this,{reader:o,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=r,h=r.localDirectory={};o.initialized||await o.init();let x=await My(o,s,30),b=ac(x),C=kE(r,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(Xde);if(c!=0&&c!=8)throw new Error(Xde);if(sa(b,0)!=67324752)throw new Error(eJe);Qde(h,b,4),x=await My(o,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=x.subarray(30+h.filenameLength),await eme(r,h,b,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let A=r.encrypted&&h.encrypted,T=A&&!a;if(A){if(!T&&a.strength===void 0)throw new Error(iJe);if(!C)throw new Error(nJe)}let S=await nz(u.Inflate,{codecType:ez,password:C,zipCrypto:T,encryptionStrength:a&&a.strength,signed:kE(r,i,"checkSignature"),passwordVerification:T&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:A,useWebWorkers:kE(r,i,"useWebWorkers")},u);t.initialized||await t.init();let v=kE(r,i,"signal"),I=s+30+h.filenameLength+h.extraFieldLength;return await iz(S,o,t,I,()=>g,u,{onprogress:i.onprogress,signal:v}),t.getData()}};function Qde(e,t,n){let i=e.rawBitFlag=Au(t,n+2),r=(i&1)==1,o=sa(t,n+6);Object.assign(e,{encrypted:r,version:Au(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:lJe(o),filenameLength:Au(t,n+22),extraFieldLength:Au(t,n+24)})}async function eme(e,t,n,i){let r=t.rawExtraField,o=t.extraField=new Map,s=ac(new Uint8Array(r)),a=0;try{for(;a<r.length;){let x=Au(s,a),b=Au(s,a+2);o.set(x,{type:x,data:r.slice(a+4,a+4+b)}),a+=4+b}}catch{}let c=Au(n,i+4);t.signature=sa(n,i+10),t.uncompressedSize=sa(n,i+18),t.compressedSize=sa(n,i+14);let u=o.get(1);u&&(rJe(u,t),t.extraFieldZip64=u);let f=o.get(28789);f&&(await $de(f,"filename","rawFilename",t,e),t.extraFieldUnicodePath=f);let d=o.get(25461);d&&(await $de(d,"comment","rawComment",t,e),t.extraFieldUnicodeComment=d);let p=o.get(39169);p?(oJe(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let g=o.get(10);g&&(sJe(g,t),t.extraFieldNTFS=g);let h=o.get(21589);h&&(aJe(h,t),t.extraFieldExtendedTimestamp=h)}function rJe(e,t){t.zip64=!0;let n=ac(e.data);e.values=[];for(let r=0;r<Math.floor(e.data.length/8);r++)e.values.push(uz(n,0+r*8));let i=Zde.filter(r=>t[r]==4294967295);for(let r=0;r<i.length;r++)e[i[r]]=e.values[r];Zde.forEach(r=>{if(t[r]==4294967295)if(e[r]!==void 0)t[r]=e[r];else throw new Error(tJe)})}async function $de(e,t,n,i,r){let o=ac(e.data);e.version=UE(o,0),e.signature=sa(o,1);let s=new Ry;s.append(r[n]);let a=ac(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await lz(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==sa(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function oJe(e,t,n){let i=ac(e.data);e.vendorVersion=UE(i,0),e.vendorId=UE(i,2);let r=UE(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Au(i,5)}function sJe(e,t){let n=ac(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=Au(n,i),s=Au(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(r&&r.length==24){let o=ac(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=F7(s),f=F7(a),d=F7(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function aJe(e,t){let n=ac(e.data),i=UE(n,0),r=[],o=[];(i&1)==1&&(r.push("lastModDate"),o.push("rawLastModDate")),(i&2)==2&&(r.push("lastAccessDate"),o.push("rawLastAccessDate")),(i&4)==4&&(r.push("creationDate"),o.push("rawCreationDate"));let s=1;r.forEach((a,c)=>{if(e.data.length>=s+4){let u=sa(n,s);t[a]=e[a]=new Date(u*1e3);let f=o[c];e[f]=u}s+=4})}async function cJe(e,t,n,i,r){let o=new Uint8Array(4),s=ac(o);uJe(s,0,t);let a=i+r;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await My(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==o[0]&&d[p+1]==o[1]&&d[p+2]==o[2]&&d[p+3]==o[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function kE(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function lJe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function F7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function UE(e,t){return e.getUint8(t)}function Au(e,t){return e.getUint16(t,!0)}function sa(e,t){return e.getUint32(t,!0)}function uz(e,t){return Number(e.getBigUint64(t,!0))}function uJe(e,t,n){e.setUint32(t,n,!0)}function ac(e){return new DataView(e.buffer)}function My(e,t,n){return e.readUint8Array(t,n)}var pJe="File already exists",_Je="Zip file comment exceeds 64KB",gJe="File entry comment exceeds 64KB",yJe="File entry name exceeds 64KB",ime="Version exceeds 65535",xJe="The strength must equal 1, 2, or 3",bJe="Extra field type exceeds 65535",CJe="Extra field data exceeds 64KB",K7="Zip64 is not supported",rme=new Uint8Array([7,0,2,0,65,69,3,0,0]),ome=24,Y7=0,Cz=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:qV(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[],pendingAddFileCalls:new Set})}async add(t="",n,i={}){let r=this;if(Y7<r.config.maxWorkers){Y7++;let o;try{return o=TJe(r,t,n,i),this.pendingAddFileCalls.add(o),await o}finally{this.pendingAddFileCalls.delete(o),Y7--;let s=r.pendingEntries.shift();s&&r.add(s.name,s.reader,s.options).then(s.resolve).catch(s.reject)}}else return new Promise((o,s)=>r.pendingEntries.push({name:t,reader:n,options:i,resolve:o,reject:s}))}async close(t=new Uint8Array(0),n={}){for(;this.pendingAddFileCalls.size;)await Promise.all(Array.from(this.pendingAddFileCalls));return await SJe(this,t,n),this.writer.getData()}};async function TJe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(BE)?t+=BE:i.directory=t.endsWith(BE),e.files.has(t))throw new Error(pJe);let r=FL(t);if(r.length>65535)throw new Error(yJe);let o=i.comment||"",s=FL(o);if(s.length>65535)throw new Error(gJe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(ime);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(ime);let u=va(e,i,"lastModDate")||new Date,f=va(e,i,"lastAccessDate"),d=va(e,i,"creationDate"),p=va(e,i,"password"),g=va(e,i,"encryptionStrength")||3,h=va(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(xJe);let x=new Uint8Array(0),b=i.extraField;if(b){let B=0,V=0;b.forEach(U=>B+=4+U.length),x=new Uint8Array(B),b.forEach((U,G)=>{if(G>65535)throw new Error(bJe);if(U.length>65535)throw new Error(CJe);ca(x,new Uint16Array([G]),V),ca(x,new Uint16Array([U.length]),V+2),ca(x,U,V+4),V+=4+U.length})}let C=va(e,i,"extendedTimestamp");C===void 0&&(C=!0);let A=0,T=va(e,i,"keepOrder");T===void 0&&(T=!0);let S=0,v=va(e,i,"msDosCompatible");v===void 0&&(v=!0);let I=va(e,i,"internalFileAttribute")||0,O=va(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,A=wJe(S));let R=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||A>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!T)throw new Error(K7);R=!0}e.pendingCompressedSize+=A,await Promise.resolve();let L=va(e,i,"level"),N=va(e,i,"useWebWorkers"),_=va(e,i,"bufferedWrite"),E=va(e,i,"dataDescriptor"),w=va(e,i,"dataDescriptorSignature"),P=va(e,i,"signal");E===void 0&&(E=!0),E&&w===void 0&&(w=!1);let M=await AJe(e,t,n,Object.assign({},i,{rawFilename:r,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:x,zip64:R,password:p,level:L,useWebWorkers:N,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:T,dataDescriptor:E,dataDescriptorSignature:w,signal:P,msDosCompatible:v,internalFileAttribute:I,externalFileAttribute:O}));return A&&(e.pendingCompressedSize-=A),Object.assign(M,{name:t,comment:o,extraField:b}),new I_(M)}async function AJe(e,t,n,i){let r=e.files,o=e.writer,s=Array.from(r.values()).pop(),a={},c,u,f;r.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new FE,p.init(),c=!0):(e.lockWrite=new Promise(h=>u=h),o.initialized||await o.init(),p=o),a=await EJe(n,p,e.config,i),a.lock=g,r.set(t,a),a.filename=t,c){let h=0,x=p.getData();await Promise.all([e.lockWrite,d]);let b;do b=Array.from(r.values()).find(C=>C.writingBufferedData),b&&await b.lock;while(b&&b.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let A=await sme(x,0,26),T=new DataView(A);(!a.encrypted||i.zipCrypto)&&xr(T,14,a.signature),a.zip64?(xr(T,18,4294967295),xr(T,22,4294967295)):(xr(T,18,a.compressedSize),xr(T,22,a.uncompressedSize)),await o.writeUint8Array(new Uint8Array(A)),h=26}await vJe(o,x,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=om(a.rawExtraFieldZip64);Ol(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(K7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),r.delete(t),d}finally{f(),u&&u()}}async function EJe(e,t,n,i){let{rawFilename:r,lastAccessDate:o,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:x,rawComment:b,rawExtraField:C,useWebWorkers:A,onprogress:T,signal:S,encryptionStrength:v,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:L}=i,N=!!(a&&a.length),_=c!==0&&!g,E;if(N&&!f){E=new Uint8Array(rme.length+2);let Se=om(E);$r(Se,0,39169),ca(E,rme,2),Tz(Se,8,v)}else E=new Uint8Array(0);let w,P;if(I){P=new Uint8Array(9+(o?4:0)+(s?4:0));let Se=om(P);$r(Se,0,21589),$r(Se,2,P.length-4);let nt=1+(o?2:0)+(s?4:0);Tz(Se,4,nt),xr(Se,5,Math.floor(i.lastModDate.getTime()/1e3)),o&&xr(Se,9,Math.floor(o.getTime()/1e3)),s&&xr(Se,13,Math.floor(s.getTime()/1e3));try{w=new Uint8Array(36);let Ze=om(w),Gt=X7(i.lastModDate);$r(Ze,0,10),$r(Ze,2,32),$r(Ze,8,1),$r(Ze,10,24),Ol(Ze,12,Gt),Ol(Ze,20,X7(o)||Gt),Ol(Ze,28,X7(s)||Gt)}catch{w=new Uint8Array(0)}}else w=P=new Uint8Array(0);let M={version:h||20,versionMadeBy:x,zip64:u,directory:!!g,filenameUTF8:!0,rawFilename:r,commentUTF8:!0,rawComment:b,rawExtraFieldZip64:u?new Uint8Array(ome+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:P,rawExtraFieldNTFS:w,rawExtraFieldAES:E,rawExtraField:C,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:L},B=M.uncompressedSize=0,V=2048;d&&(V=V|8);let U=0;_&&(U=8),u&&(M.version=M.version>45?M.version:45),N&&(V=V|1,f||(M.version=M.version>51?M.version:51,U=99,_&&(M.rawExtraFieldAES[9]=8))),M.compressionMethod=U;let G=M.headerArray=new Uint8Array(26),k=om(G);$r(k,0,M.version),$r(k,2,V),$r(k,4,U);let Y=new Uint32Array(1),j=om(Y),J;i.lastModDate<O7?J=O7:i.lastModDate>R7?J=R7:J=i.lastModDate,$r(j,0,(J.getHours()<<6|J.getMinutes())<<5|J.getSeconds()/2),$r(j,2,(J.getFullYear()-1980<<4|J.getMonth()+1)<<5|J.getDate());let W=Y[0];xr(k,6,W),$r(k,22,r.length);let K=E.length+P.length+w.length+M.rawExtraField.length;$r(k,24,K);let Z=new Uint8Array(30+r.length+K),he=om(Z);xr(he,0,67324752),ca(Z,G,4),ca(Z,r,30),ca(Z,E,30+r.length),ca(Z,P,30+r.length+E.length),ca(Z,w,30+r.length+E.length+P.length),ca(Z,M.rawExtraField,30+r.length+E.length+P.length+w.length);let ge,se=0;if(e){let Se=await nz(n.Deflate,{codecType:QV,level:c,password:a,encryptionStrength:v,zipCrypto:N&&f,passwordVerification:N&&f&&W>>8&255,signed:!0,compressed:_,encrypted:N,useWebWorkers:A},n);await t.writeUint8Array(Z),M.dataWritten=!0,ge=await iz(Se,e,t,0,()=>e.size,n,{onprogress:T,signal:S}),B=M.uncompressedSize=e.size,se=ge.length}else await t.writeUint8Array(Z),M.dataWritten=!0;let pe=new Uint8Array(0),xe,Pe=0;if(d&&(pe=new Uint8Array(u?p?24:20:p?16:12),xe=om(pe),p&&(Pe=4,xr(xe,0,134695760))),e){let Se=ge.signature;if((!N||f)&&Se!==void 0&&(xr(k,10,Se),M.signature=Se,d&&xr(xe,Pe,Se)),u){let nt=om(M.rawExtraFieldZip64);$r(nt,0,1),$r(nt,2,ome),xr(k,14,4294967295),Ol(nt,12,BigInt(se)),xr(k,18,4294967295),Ol(nt,4,BigInt(B)),d&&(Ol(xe,Pe+4,BigInt(se)),Ol(xe,Pe+12,BigInt(B)))}else xr(k,14,se),xr(k,18,B),d&&(xr(xe,Pe+4,se),xr(xe,Pe+8,B))}d&&await t.writeUint8Array(pe);let we=Z.length+se+pe.length;return Object.assign(M,{compressedSize:se,lastModDate:J,rawLastModDate:W,creationDate:s,lastAccessDate:o,encrypted:N,length:we}),M}async function SJe(e,t,n){let i=e.writer,r=e.files,o=0,s=0,a=e.offset,c=r.size;for(let[,p]of r)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(K7);u=!0}let f=new Uint8Array(s+(u?98:22)),d=om(f);if(t&&t.length)if(t.length<=65535)$r(d,o+20,t.length);else throw new Error(_Je);for(let[p,g]of Array.from(r.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:x,rawExtraFieldAES:b,rawExtraField:C,rawComment:A,versionMadeBy:T,headerArray:S,directory:v,zip64:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:L}=g,N,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,N=new Uint8Array(9);let w=om(N);$r(w,0,21589),$r(w,2,N.length-4),Tz(w,4,1),xr(w,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=N=new Uint8Array(0);let E=x.length+b.length+N.length+_.length+C.length;if(xr(d,o,33639248),$r(d,o+4,T),ca(f,S,o+6),$r(d,o+30,E),$r(d,o+32,A.length),xr(d,o+34,R),L?xr(d,o+38,L):v&&O&&Tz(d,o+38,16),I?xr(d,o+42,4294967295):xr(d,o+42,g.offset),ca(f,h,o+46),ca(f,x,o+46+h.length),ca(f,b,o+46+h.length+x.length),ca(f,N,o+46+h.length+x.length+b.length),ca(f,_,o+46+h.length+x.length+b.length+N.length),ca(f,C,o+46+h.length+x.length+b.length+N.length+_.length),ca(f,A,o+46+h.length+E),o+=46+h.length+E+A.length,n.onprogress)try{n.onprogress(p+1,r.size,new I_(g))}catch{}}u&&(xr(d,o,101075792),Ol(d,o+4,BigInt(44)),$r(d,o+12,45),$r(d,o+14,45),Ol(d,o+24,BigInt(c)),Ol(d,o+32,BigInt(c)),Ol(d,o+40,BigInt(s)),Ol(d,o+48,BigInt(a)),xr(d,o+56,117853008),Ol(d,o+64,BigInt(a)+BigInt(s)),xr(d,o+72,1),c=65535,a=4294967295,s=4294967295,o+=76),xr(d,o,101010256),$r(d,o+8,c),$r(d,o+10,c),xr(d,o+12,s),xr(d,o+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function sme(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(s.target.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function vJe(e,t,n=0){await r();async function r(){if(n<t.size){let o=await sme(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(o)),n+=536870912,await r()}}}function X7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function va(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function wJe(e){return e+5*(Math.floor(e/16383)+1)}function Tz(e,t,n){e.setUint8(t,n)}function $r(e,t,n){e.setUint16(t,n,!0)}function xr(e,t,n){e.setUint32(t,n,!0)}function Ol(e,t,n){e.setBigUint64(t,n,!0)}function ca(e,t,n){e.set(t,n)}function om(e){return new DataView(e.buffer)}RE({Deflate:$fe,Inflate:bde});var J7=32,IJe="http://www.opengis.net/kml/2.2",am="http://www.google.com/kml/ext/2.2",PJe="http://www.w3.org/2000/xmlns/";function Az(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var DJe=/^data:image\/([^,;]+)/;Az.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ie){if(e=Ie.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(DJe);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function RJe(e,t){return function(n){e._files[t]=n}}Az.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(RJe(this,o))}return r};Object.defineProperties(Az.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function Ez(e){this._time=e}Ez.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};Ez.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Ub(n)};Ez.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Z7(){this._ids={},this._styles={},this._count=0}Z7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};Z7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function ume(){this._ids={}}ume.prototype.get=function(e){if(!l(e))return this.get(qn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function $7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=$7._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(PJe,"xmlns:gx",am);let a=o.createElement("Document");s.appendChild(a),dme(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?OJe(f,c.files):{kml:f,externalFiles:c.files}})}function OJe(e,t){let n=tn("ThirdParty/Workers/z-worker-pako.js");RE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new FE,r=new Cz(i);return r.add("doc.kml",new sz(e)).then(function(){let o=Object.keys(t);return fme(r,o,t,0)}).then(function(){return r.close()}).then(function(o){return{kmz:o}})}function fme(e,t,n,i){if(t.length===i)return;let r=t[i];return e.add(r,new Bb(n[r])).then(function(){return fme(e,t,n,i+1)})}$7._createState=function(e){let t=e.entities,n=new Z7,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);o.start===Ve.MINIMUM_VALUE?o.stop===Ve.MAXIMUM_VALUE?o=new An:ee.addSeconds(o.stop,-10*s,o.start):o.stop===Ve.MAXIMUM_VALUE&&ee.addSeconds(o.start,10*s,o.stop);let a=new Az(e.modelCallback);return{kmlDoc:document.implementation.createDocument(IJe,"kml"),ellipsoid:y(e.ellipsoid,re.WGS84),idManager:new ume,styleCache:n,externalFileHandler:a,time:r,valueGetter:new Ez(r),sampleDuration:s,defaultAvailability:new Oo([o])}};function dme(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],MJe(e,p,u,f),LJe(e,p.polyline,u,f),lme(e,p.rectangle,u,f,c),lme(e,p.polygon,u,f,c),kJe(e,p,p.model,u,f);let g,h=p.availability;l(h)&&(g=i.createElement("TimeSpan"),ee.equals(h.start,Ve.MINIMUM_VALUE)||g.appendChild(_n(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,Ve.MAXIMUM_VALUE)||g.appendChild(_n(i,"end",ee.toIso8601(h.stop))));for(let C=0;C<c.length;++C){let A=c[C];A.setAttribute("id",s.get(p.id)),A.appendChild(_n(i,"name",p.name)),A.appendChild(_n(i,"visibility",p.show)),A.appendChild(_n(i,"description",p.description)),l(g)&&A.appendChild(g),t.appendChild(A)}let x=u.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let A=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),I=o.get(T.text);A=l(I)&&I.length>0?I:A;let O=o.getColor(T.fillColor);l(O)&&(v.appendChild(_n(i,"color",O)),v.appendChild(_n(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(_n(i,"scale",R)),f.push(v)}C.appendChild(_n(i,"name",A)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let v=i.createElement("Style");for(let I=0;I<S;++I)v.appendChild(f[I]);C.appendChild(_n(i,"styleUrl",r.get(v)))}if(u.length===1)C.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let I=0;I<x;++I)v.appendChild(u[I]);C.appendChild(v)}}let b=p._children;if(b.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(_n(i,"name",p.name)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),t.appendChild(C),dme(e,C,b)}}}var Ml=new m,Xc=new me,sm=new ee;function MJe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){mme(e,t,a,n,i);return}s.get(c,void 0,Ml);let u=_n(r,"coordinates",kb(Ml,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(Vb(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Na?pme(e,a):hme(e,a);i.push(p)}function mme(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof na?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof pp,p,g,h,x=[];for(p=0;p<c.length;++p){let C=c.get(p),A=f?u:C.data,T=o.createElement("altitudeMode");A instanceof _h?(A=A._value,T.appendChild(Vb(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(Vb(e,n.heightReference)):T.appendChild(Vb(e,We.NONE));let S=[],v=[];if(A.isConstant){a.get(A,void 0,Ml);let O=_n(o,"coordinates",kb(Ml,s));S.push(ee.toIso8601(C.start)),v.push(O),S.push(ee.toIso8601(C.stop)),v.push(O)}else if(A instanceof ra)for(h=A._property._times,g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),A.getValueInReferenceFrame(h[g],ar.FIXED,Ml),v.push(kb(Ml,s));else if(A instanceof hu){h=A._times;let O=A._values;for(g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),m.fromArray(O,g*3,Ml),v.push(kb(Ml,s))}else{let O=e.sampleDuration;C.start.clone(sm),C.isStartIncluded||ee.addSeconds(sm,O,sm);let R=C.stop;for(;ee.lessThan(sm,R);)A.getValue(sm,Ml),S.push(ee.toIso8601(sm)),v.push(kb(Ml,s)),ee.addSeconds(sm,O,sm);C.isStopIncluded&&ee.equals(sm,R)&&(A.getValue(sm,Ml),S.push(ee.toIso8601(sm)),v.push(kb(Ml,s)))}let I=o.createElementNS(am,"Track");I.appendChild(T);for(let O=0;O<S.length;++O){let R=_n(o,"when",S[O]),L=_n(o,"coord",v[O],am);I.appendChild(R),I.appendChild(L)}d&&I.appendChild(_me(e,n)),x.push(I)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=o.createElementNS(am,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!d){let C=n instanceof Na?pme(e,n):hme(e,n);r.push(C)}let b=t.path;if(l(b)){let C=a.get(b.width),A=b.material;if(l(A)||l(C)){let T=o.createElement("LineStyle");l(C)&&T.appendChild(_n(o,"width",C)),Q7(e,A,T),r.push(T)}}}function hme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(_n(n,"color",o)),r.appendChild(_n(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(_n(n,"scale",s/J7)),r}function pme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(_n(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(_n(n,"x",g.x,am)),p.appendChild(_n(n,"y",g.y,am)),p.appendChild(_n(n,"w",g.width,am)),p.appendChild(_n(n,"h",g.height,am))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(_n(n,"color",a)),o.appendChild(_n(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(_n(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),H.divideByScalar(u,c,u);let p=i.get(t.width,J7),g=i.get(t.height,J7),h=i.get(t.horizontalOrigin,yi.CENTER);h===yi.CENTER?u.x-=p*.5:h===yi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,Rn.CENTER);x===Rn.TOP?u.y+=g:x===Rn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),o.appendChild(b)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&m.equals(m.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),o.appendChild(_n(n,"heading",f))),o}function LJe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(_n(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=_n(r,"coordinates",kb(p,o));a.appendChild(g);let h=s.get(t.zIndex);u&&l(h)&&a.appendChild(_n(r,"drawOrder",h,am)),n.push(a);let x=r.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(_n(r,"width",b)),Q7(e,t.material,x),i.push(x)}function NJe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,Xc),c.push(`${D.toDegrees(Xc.longitude)},${D.toDegrees(Xc.latitude)},${o}`);let f=_n(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function cme(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)me.fromCartesian(t[f],o,Xc),s.push(`${D.toDegrees(Xc.longitude)},${D.toDegrees(Xc.latitude)},${i?Xc.height:n}`);let c=_n(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function FJe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(cme(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let h=0;h<g;++h){let x=i.createElement("innerBoundaryIs");x.appendChild(cme(e,p[h].positions,o,s)),a.push(x)}}return a}function lme(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof pd;if(a&&s.getMaterialType(t.material)==="Image"){BJe(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(_n(o,"extrude",!0));let f=a?NJe(e,t,u):FJe(e,t,u),d=f.length;for(let b=0;b<d;++b)c.appendChild(f[b]);let p=o.createElement("altitudeMode");p.appendChild(Vb(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&g.appendChild(_n(o,"fill",h)),Q7(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(_n(o,"outline",x));let b=o.createElement("LineStyle"),C=s.get(t.outlineWidth,1);b.appendChild(_n(o,"width",C));let A=s.getColor(t.outlineColor,z.BLACK);b.appendChild(_n(o,"color",A)),b.appendChild(_n(o,"colorMode","normal")),i.push(b)}i.push(g)}function BJe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(Vb(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(_n(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(_n(i,"north",D.toDegrees(u.north))),f.appendChild(_n(i,"south",D.toDegrees(u.south))),f.appendChild(_n(i,"east",D.toDegrees(u.east))),f.appendChild(_n(i,"west",D.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(_n(i,"href",p)),s.appendChild(g);let h=d.color;l(h)&&s.appendChild(_n(i,"color",Ub(d.color))),n.push(s)}function _me(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(_n(n,"x",s)),u.appendChild(_n(n,"y",s)),u.appendChild(_n(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(_n(n,"href",c)),o.appendChild(a),o}function kJe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){mme(e,t,n,i,r);return}let u=_me(e,n),f=o.createElement("altitudeMode");f.appendChild(Vb(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Ml),me.fromCartesian(Ml,s,Xc);let d=o.createElement("Location");d.appendChild(_n(o,"longitude",D.toDegrees(Xc.longitude))),d.appendChild(_n(o,"latitude",D.toDegrees(Xc.latitude))),d.appendChild(_n(o,"altitude",Xc.height)),u.appendChild(d),i.push(u)}function Q7(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=Ub(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=Ub(o.color);break;case"PolylineOutline":s=Ub(o.color),c=Ub(o.outlineColor),u=o.outlineWidth,n.appendChild(_n(i,"outerColor",c,am)),n.appendChild(_n(i,"outerWidth",u,am));break;case"Stripe":s=Ub(o.oddColor);break}l(s)&&(n.appendChild(_n(i,"color",s)),n.appendChild(_n(i,"colorMode","normal")))}function Vb(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function kb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)me.fromCartesian(e[r],t,Xc),i.push(`${D.toDegrees(Xc.longitude)},${D.toDegrees(Xc.latitude)},${Xc.height}`);return i.join(" ")}function _n(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function Ub(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var ej=$7;function HL(){this._cache={}}HL.prototype.fromColor=function(e,t){return Sz(void 0,void 0,e,t,this._cache)};HL.prototype.fromUrl=function(e,t,n){return Sz(e,void 0,t,n,this._cache)};HL.prototype.fromMakiIconId=function(e,t,n){return Sz(tn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};HL.prototype.fromText=function(e,t,n){return Sz(void 0,e,t,n,this._cache)};var UJe=new z;function VJe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,UJe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function gme(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var zL=new Array(4);function Sz(e,t,n,i,r){zL[0]=e,zL[1]=t,zL[2]=n,zL[3]=i;let o=JSON.stringify(zL),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(VJe(c,n,i),l(e)){let f=Ie.createIfNeeded(e).fetchImage().then(function(d){return gme(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=qx(t,{font:`bold ${i}px sans-serif`});gme(c,u,i)}return r[o]=a,a}var P_=HL;var bme=Ki(xme(),1);function wz(e){return m.fromDegrees(e[0],e[1],e[2])}var tj={"urn:ogc:def:crs:OGC:1.3:CRS84":wz,"EPSG:4326":wz,"urn:ogc:def:crs:EPSG::4326":wz},Cme={},Tme={},nj=48,ij,rj=z.ROYALBLUE,oj=z.YELLOW,sj=2,aj=z.fromBytes(255,255,0,100),cj=!1,zJe={small:24,medium:48,large:64},HJe=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Ame(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||HJe.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${Ame(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function GJe(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function WJe(e,t){return new _d(GJe(Ame,e,t),!0)}function Iz(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=qn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new ti(c):n(o,s))}return r}function lj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Eme={Feature:vme,FeatureCollection:jJe,GeometryCollection:wme,LineString:Ome,MultiLineString:Mme,MultiPoint:Dme,MultiPolygon:Fme,Point:Pme,Polygon:Nme,Topology:Bme},Sme={GeometryCollection:wme,LineString:Ome,MultiLineString:Mme,MultiPoint:Dme,MultiPolygon:Fme,Point:Pme,Polygon:Nme,Topology:Bme};function vme(e,t,n,i,r){if(t.geometry===null){Iz(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new de("feature.geometry is required.");let o=t.geometry.type,s=Sme[o];if(!l(s))throw new de(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function jJe(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)vme(e,o[s],void 0,i,r)}function wme(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=Sme[u];if(!l(f))throw new de(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function Ime(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=y(zJe[c["marker-size"]],a);let h=c["marker-symbol"];l(h)&&(o=h)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Na;f.verticalOrigin=new ti(Rn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=Iz(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Dc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new ti(g)}).catch(function(){f.image=new ti(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Pme(e,t,n,i,r){Ime(e,t,i,n.coordinates,r)}function Dme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Ime(e,t,i,o[s],r)}function Rme(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new ti(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Vt(d))}let c=Iz(t,e._entityCollection,r.describe),u=new qa;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new ti(lj(i,n)),u.arcType=Zt.RHUMB}function Ome(e,t,n,i,r){Rme(e,t,i,n.coordinates,r)}function Mme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Rme(e,t,i,o[s],r)}function Lme(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new ti(g));let h,x=c.stroke;l(x)&&(h=z.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(h)||(h=o.getValue().clone()),h.alpha=b),l(h)&&(o=new ti(h));let C,A=c.fill,T=s.color.getValue();l(A)&&(C=z.fromCssColorString(A),C.alpha=T.alpha),b=c["fill-opacity"],l(b)&&b!==T.alpha&&(l(C)||(C=T.clone()),C.alpha=b),l(C)&&(s=new Vt(C))}let u=new hd;u.outline=new ti(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=Zt.RHUMB;let f=[];for(let g=1,h=i.length;g<h;g++)f.push(new Rc(lj(i[g],n)));let d=i[0];u.hierarchy=new ti(new Rc(lj(d,n),f)),d[0].length>2?u.perPositionHeight=new ti(!0):r.clampToGround||(u.height=0);let p=Iz(t,e._entityCollection,r.describe);p.polygon=u}function Nme(e,t,n,i,r){Lme(e,t,i,n.coordinates,r)}function Fme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Lme(e,t,i,o[s],r)}function Bme(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=bme.feature(n,n.objects[o]),a=Eme[s.type];a(e,s,s,i,r)}}function Ly(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Fs(this),this._promises=[],this._pinBuilder=new P_,this._entityCluster=new uu,this._credit=void 0,this._resourceCredits=[]}Ly.load=function(e,t){return new Ly().load(e,t)};Object.defineProperties(Ly,{markerSize:{get:function(){return nj},set:function(e){nj=e}},markerSymbol:{get:function(){return ij},set:function(e){ij=e}},markerColor:{get:function(){return rj},set:function(e){rj=e}},stroke:{get:function(){return oj},set:function(e){oj=e}},strokeWidth:{get:function(){return sj},set:function(e){sj=e}},fill:{get:function(){return aj},set:function(e){aj=e}},clampToGround:{get:function(){return cj},set:function(e){cj=e}},crsNames:{get:function(){return tj}},crsLinkHrefs:{get:function(){return Cme}},crsLinkTypes:{get:function(){return Tme}}});Object.defineProperties(Ly.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Ly.prototype.load=function(e,t){return kme(this,e,t,!0)};Ly.prototype.process=function(e,t){return kme(this,e,t,!1)};function kme(e,t,n,i){Mo.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let r=n.credit;typeof r=="string"&&(r=new vt(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ie){t=Ie.createIfNeeded(t),o=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,WJe),markerSize:y(n.markerSize,nj),markerSymbol:y(n.markerSymbol,ij),markerColor:y(n.markerColor,rj),strokeWidthProperty:new ti(y(n.strokeWidth,sj)),strokeMaterialProperty:new Vt(y(n.stroke,oj)),fillMaterialProperty:new Vt(y(n.fill,aj)),clampToGround:y(n.clampToGround,cj)},Promise.resolve(o).then(function(a){return qJe(e,a,n,s,i)}).catch(function(a){throw Mo.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Ly.prototype.update=function(e){return!0};function qJe(e,t,n,i,r){let o;l(i)&&(o=__(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=Eme[t.type];if(!l(s))throw new de(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?wz:null;if(l(a)){if(!l(a.properties))throw new de("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=tj[u.name],!l(c))throw new de(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Cme[u.href];if(l(f)||(f=Tme[u.type]),!l(f))throw new de(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=tj[`EPSG:${u.code}`],!l(c))throw new de(`Unknown crs EPSG code: ${u.code}`)}else throw new de(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Mo.setLoading(e,!1),e})})}var GL=Ly;function YJe(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Pn=YJe;var Lhe=Ki(Ij(),1);var Nhe;typeof DOMParser<"u"&&(Nhe=new DOMParser);var W$e=new Lhe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Kz=32,vhe=2414016,whe=1,Ihe=16093e3,Phe=.1,j$e=[null,void 0,"http://www.topografix.com/GPX/1/1"],Dr={gpx:j$e};function q$e(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Pj(e,t){let n=qL(e,"id");return n=l(n)?n:qn(),t.getOrCreateEntity(n)}function Dj(e){let t=Dhe(e,"lon"),n=Dhe(e,"lat"),i=WL(e,"ele",Dr.gpx);return m.fromDegrees(t,n,i)}function Dhe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function qL(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ky(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Rj(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function WL(e,t,n){let i=ky(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ll(e,t,n){let i=ky(e,t,n);if(l(i))return i.textContent.trim()}function Fhe(e){let t=new Na;return t.width=Kz,t.height=Kz,t.scaleByDistance=new Ot(vhe,whe,Ihe,Phe),t.pixelOffsetScaleByDistance=new Ot(vhe,whe,Ihe,Phe),t.verticalOrigin=new ti(Rn.BOTTOM),t.image=e,t}function Y$e(){let e=new md;return e.translucencyByDistance=new Ot(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=Hr.FILL_AND_OUTLINE,e}function Bhe(e){let t=new qa;return t.width=4,t.material=new gy,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var Rhe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},jL;typeof document<"u"&&(jL=document.createElement("div"));function Oj(e,t){let n,i="",r=Object.keys(Rhe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=Rhe[f];d.value=y(Ll(e,d.tag,Dr.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=W$e.link(i),jL.innerHTML=i;let s=jL.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${jL.innerHTML}</div>`,jL.innerHTML="",u}function khe(e,t,n,i){let r=Dj(t),o=Pj(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Kz);o.billboard=Fhe(s);let a=Ll(t,"name",Dr.gpx);o.name=a,o.label=Y$e(),o.label.text=a,o.description=Oj(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function X$e(e,t,n,i){let r=Pj(t,n);r.description=Oj(t,r);let o=Rj(t,"rtept",Dr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)khe(e,o[a],n,i),s[a]=Dj(o[a]);r.polyline=Bhe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function K$e(e,t,n,i){let r=Pj(t,n);r.description=Oj(t,r);let o=Rj(t,"trkseg",Dr.gpx),s=[],a=[],c,u=!0,f=new ra;for(let d=0;d<o.length;d++)c=J$e(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Kz);r.billboard=Fhe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Oo,r.availability.addInterval(new An({start:a[0],stop:a[a.length-1]}))}r.polyline=Bhe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function J$e(e){let t={positions:[],times:[]},n=Rj(e,"trkpt",Dr.gpx),i;for(let r=0;r<n.length;r++){let o=Dj(n[r]);t.positions.push(o),i=Ll(n[r],"time",Dr.gpx),l(i)&&t.times.push(ee.fromIso8601(i))}return t}function Z$e(e){let t=ky(e,"metadata",Dr.gpx);if(l(t)){let n={name:Ll(t,"name",Dr.gpx),desc:Ll(t,"desc",Dr.gpx),author:$$e(t),copyright:eQe(t),link:Uhe(t),time:Ll(t,"time",Dr.gpx),keywords:Ll(t,"keywords",Dr.gpx),bounds:tQe(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function $$e(e){let t=ky(e,"author",Dr.gpx);if(l(t)){let n={name:Ll(t,"name",Dr.gpx),email:Q$e(t),link:Uhe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Q$e(e){let t=ky(e,"email",Dr.gpx);if(l(t)){let n=Ll(t,"id",Dr.gpx),i=Ll(t,"domain",Dr.gpx);return`${n}@${i}`}}function Uhe(e){let t=ky(e,"link",Dr.gpx);if(l(t)){let n={href:qL(t,"href"),text:Ll(t,"text",Dr.gpx),mimeType:Ll(t,"type",Dr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function eQe(e){let t=ky(e,"copyright",Dr.gpx);if(l(t)){let n={author:qL(t,"author"),year:Ll(t,"year",Dr.gpx),license:Ll(t,"license",Dr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function tQe(e){let t=ky(e,"bounds",Dr.gpx);if(l(t)){let n={minLat:WL(t,"minlat",Dr.gpx),maxLat:WL(t,"maxlat",Dr.gpx),minLon:WL(t,"minlon",Dr.gpx),maxLon:WL(t,"maxlon",Dr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Ohe={wpt:khe,rte:X$e,trk:K$e};function nQe(e,t,n,i){let r=Object.keys(Ohe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Ohe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Dr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Mhe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=qL(r,"version"),s=qL(r,"creator"),a,c=Z$e(r);l(c)&&(a=c.name),r.localName==="gpx"?nQe(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=ee.equals(d,Ve.MINIMUM_VALUE),h=ee.equals(p,Ve.MAXIMUM_VALUE);if(!g||!h){let b;g&&(b=new Date,b.setHours(0,0,0,0),d=ee.fromDate(b)),h&&(b=new Date,b.setHours(24,0,0,0),p=ee.fromDate(b)),u=new Yd,u.startTime=d,u.stopTime=p,u.currentTime=ee.clone(d),u.clockRange=No.LOOP_STOP,u.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,d)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),iQe(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==o&&(e._version=o,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),Mo.setLoading(e,!1),e}function iQe(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function rQe(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=n;if(typeof n=="string"||n instanceof Ie){n=Ie.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?q$e(o).then(function(s){let a,c;try{a=Nhe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new de(u)}return Mhe(e,a,i)}):Mhe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function qE(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new Fs(this),this._entityCluster=new uu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new P_}qE.load=function(e,t){return new qE().load(e,t)};Object.defineProperties(qE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});qE.prototype.update=function(e){return!0};qE.prototype.load=function(e,t){if(!l(e))throw new fe("data is required.");t=y(t,y.EMPTY_OBJECT),Mo.setLoading(this,!0);let n=this._name,i=this;return rQe(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,Ve.MINIMUM_VALUE),u=ee.equals(a,Ve.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Yd,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=No.LOOP_STOP,r.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Mo.setLoading(i,!1),i}).catch(function(r){return Mo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var YL=qE;function oQe(e,t){this.position=e,this.headingPitchRoll=t}var XL=oQe;var spe=Ki(Ij(),1),eN=Ki(Xl(),1);function sQe(e,t){this.position=e,this.headingPitchRange=t}var KL=sQe;function Jz(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}Jz.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};Jz.prototype.play=function(e,t){l(e.cesiumWidget)&&Q("viewer","The viewer parameter has been deprecated in Cesium 1.99. It will be removed in 1.100. Instead of a Viewer, pass a CesiumWidget instead."),this.tourStart.raiseEvent();let n=this;zhe.call(this,e,t,function(i){n.playlistIndex=0,i||Vhe(n._activeEntries),n.tourEnd.raiseEvent(i)})};Jz.prototype.stop=function(){Vhe(this._activeEntries)};function Vhe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function zhe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=aQe.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function aQe(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,zhe.call(this,e,t,n)}}var JL=Jz;var dr=Ki(Lj(),1),lQe={LINEAR_NONE:dr.Easing.Linear.None,QUADRATIC_IN:dr.Easing.Quadratic.In,QUADRATIC_OUT:dr.Easing.Quadratic.Out,QUADRATIC_IN_OUT:dr.Easing.Quadratic.InOut,CUBIC_IN:dr.Easing.Cubic.In,CUBIC_OUT:dr.Easing.Cubic.Out,CUBIC_IN_OUT:dr.Easing.Cubic.InOut,QUARTIC_IN:dr.Easing.Quartic.In,QUARTIC_OUT:dr.Easing.Quartic.Out,QUARTIC_IN_OUT:dr.Easing.Quartic.InOut,QUINTIC_IN:dr.Easing.Quintic.In,QUINTIC_OUT:dr.Easing.Quintic.Out,QUINTIC_IN_OUT:dr.Easing.Quintic.InOut,SINUSOIDAL_IN:dr.Easing.Sinusoidal.In,SINUSOIDAL_OUT:dr.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:dr.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:dr.Easing.Exponential.In,EXPONENTIAL_OUT:dr.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:dr.Easing.Exponential.InOut,CIRCULAR_IN:dr.Easing.Circular.In,CIRCULAR_OUT:dr.Easing.Circular.Out,CIRCULAR_IN_OUT:dr.Easing.Circular.InOut,ELASTIC_IN:dr.Easing.Elastic.In,ELASTIC_OUT:dr.Easing.Elastic.Out,ELASTIC_IN_OUT:dr.Easing.Elastic.InOut,BACK_IN:dr.Easing.Back.In,BACK_OUT:dr.Easing.Back.Out,BACK_IN_OUT:dr.Easing.Back.InOut,BOUNCE_IN:dr.Easing.Bounce.In,BOUNCE_OUT:dr.Easing.Bounce.Out,BOUNCE_IN_OUT:dr.Easing.Bounce.InOut},Fo=Object.freeze(lQe);function $z(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}$z.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ae(this.view.position);t.flyToBoundingSphere(r,i)}};$z.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};$z.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Fo.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=gt(t,e)),t};var $L=$z;function Nj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Nj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Nj.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var QL=Nj;var ape={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=S0(t),ape[t]}},Hj;typeof DOMParser<"u"&&(Hj=new DOMParser);var uQe=new spe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Vy=32,Zhe=2414016,$he=1,Qhe=16093e3,epe=.1,tpe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],npe=["http://www.google.com/kml/ext/2.2"],fQe=["http://www.w3.org/2005/Atom"],Me={kml:tpe,gx:npe,atom:fQe,kmlgx:tpe.concat(npe)},Gj={Document:gpe,Folder:DQe,Placemark:RQe,NetworkLink:VQe,GroundOverlay:BQe,PhotoOverlay:bpe,ScreenOverlay:FQe,Tour:MQe};function Sh(e){this._dataSource=e,this._deferred=Ys(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Sh.prototype,{dataSource:{get:function(){return this._dataSource}}});Sh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Sh.prototype.addPromise=function(e){this._promises.push(e)};Sh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Sh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=vu._getTimestamp()),this._process(e)};Sh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=vu._getTimestamp(),e._process(!0)},0)};Sh.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Sh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Sh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let r=Gj[i.localName];if(l(r)&&(Me.kml.indexOf(i.namespaceURI)!==-1||Me.gx.indexOf(i.namespaceURI)!==-1)&&(r(t,i,n,this),this._timeoutSet||vu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function dQe(e){let t=e.slice(0,Math.min(4,e.size)),n=Ys(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function mQe(e){let t=Ys(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function cpe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function lpe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}function hQe(e,t){return Promise.resolve(e.getData(new az)).then(function(n){n=cpe(n),n=lpe(n),t.kml=Hj.parseFromString(n,"application/xml")})}function Fj(e,t){let n=y(ape.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new cz(n))).then(function(i){t[e.filename]=i})}function Eu(e,t,n,i){let r=i.keys,o=new eN.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new eN.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Su(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=Wj(a,i);l(c)&&s.setAttribute(n,c.url)}}function upe(e,t,n){let i=gs(e,"id");i=l(i)&&i.length!==0?i:qn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=qn(),l(n)&&(i=n+i)),r=t.add(new Kr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new WQe),r}function tN(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function n4(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,m.fromDegrees(i,r,o,t)}function Qz(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=n4(n[s],t);return r}function zy(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function gs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Li(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function ipe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function lm(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ri(e,t,n){let i=Li(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Dn(e,t,n){let i=Li(e,t,n);if(l(i))return i.textContent.trim()}function um(e,t,n){let i=Li(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Wj(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new Ie({url:r});else{let o=new eN.default(t.getUrlComponent()),s=new eN.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new Ie({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Nl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Vj(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Nl.maximumRed=o,Nl.red=void 0):(Nl.maximumRed=void 0,Nl.red=0),r>0?(Nl.maximumGreen=r,Nl.green=void 0):(Nl.maximumGreen=void 0,Nl.green=0),i>0?(Nl.maximumBlue=i,Nl.blue=void 0):(Nl.maximumBlue=void 0,Nl.blue=0),Nl.alpha=n,z.fromRandom(Nl)):new z(o,r,i,n)}function Yb(e,t,n){let i=Dn(e,t,n);if(l(i))return Vj(i,Dn(e,"colorMode",n)==="random")}function pQe(e){let t=Li(e,"TimeStamp",Me.kmlgx),n=Dn(t,"when",Me.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),r=new Oo;return r.addInterval(new An({start:i,stop:Ve.MAXIMUM_VALUE})),r}function _Qe(e){let t=Li(e,"TimeSpan",Me.kmlgx);if(!l(t))return;let n,i=Li(t,"begin",Me.kmlgx),r=l(i)?ee.fromIso8601(i.textContent):void 0,o=Li(t,"end",Me.kmlgx),s=l(o)?ee.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(ee.lessThan(s,r)){let a=r;r=s,s=a}n=new Oo,n.addInterval(new An({start:r,stop:s}))}else l(r)?(n=new Oo,n.addInterval(new An({start:r,stop:Ve.MAXIMUM_VALUE}))):l(s)&&(n=new Oo,n.addInterval(new An({start:Ve.MINIMUM_VALUE,stop:s})));return n}function fpe(){let e=new Na;return e.width=Vy,e.height=Vy,e.scaleByDistance=new Ot(Zhe,$he,Qhe,epe),e.pixelOffsetScaleByDistance=new Ot(Zhe,$he,Qhe,epe),e}function jj(){let e=new hd;return e.outline=!0,e.outlineColor=z.WHITE,e}function dpe(){let e=new md;return e.translucencyByDistance=new Ot(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=Hr.FILL_AND_OUTLINE,e}function qj(e,t,n,i,r){let o=Dn(e,"href",Me.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=y(ri(e,"x",Me.gx),0),u=y(ri(e,"y",Me.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=Wj(o,n,i);if(r){let a=Dn(e,"refreshMode",Me.kml),c=Dn(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?Nt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Nt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Dn(e,"viewBoundScale",Me.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Dn(e,"viewFormat",Me.kml),f),p=Dn(e,"httpQuery",Me.kml);l(d)&&s.setQueryParameters(Kl(t4(d))),l(p)&&s.setQueryParameters(Kl(t4(p)));let g=t._ellipsoid;return Xj(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function gQe(e,t,n,i,r){let o=ri(t,"scale",Me.kml),s=ri(t,"heading",Me.kml),a=Yb(t,"color",Me.kml),c=Li(t,"Icon",Me.kml),u=qj(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=ri(c,"x",Me.gx),d=ri(c,"y",Me.gx),p=ri(c,"w",Me.gx),g=ri(c,"h",Me.gx),h=Li(t,"hotSpot",Me.kml),x=zy(h,"x"),b=zy(h,"y"),C=gs(h,"xunits"),A=gs(h,"yunits"),T=n.billboard;l(T)||(T=fpe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new Ye(f,d,p,g)),l(s)&&s!==0&&(T.rotation=D.toRadians(-s),T.alignedAxis=m.UNIT_Z),o=y(o,1);let S,v;l(x)&&(C==="pixels"?S=-x*o:C==="insetPixels"?S=(x-Vy)*o:C==="fraction"&&(S=-x*Vy*o),S+=Vy*.5*o),l(b)&&(A==="pixels"?v=b*o:A==="insetPixels"?v=(-b+Vy)*o:A==="fraction"&&(v=b*Vy*o),v-=Vy*.5*o),(l(S)||l(v))&&(T.pixelOffset=new H(S,v))}function e4(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")gQe(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=dpe(),n.label=c),c.scale=y(ri(a,"scale",Me.kml),c.scale),c.fillColor=y(Yb(a,"color",Me.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new qa,n.polyline=c),c.width=ri(a,"width",Me.kml),c.material=Yb(a,"color",Me.kml),l(Yb(a,"outerColor",Me.gx))&&Nt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ri(a,"outerWidth",Me.gx))&&Nt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ri(a,"physicalWidth",Me.gx))&&Nt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(um(a,"labelVisibility",Me.gx))&&Nt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=jj(),n.polygon=c),c.material=y(Yb(a,"color",Me.kml),c.material),c.fill=y(um(a,"fill",Me.kml),c.fill),c.outline=y(um(a,"outline",Me.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(Vj(Dn(a,"bgColor",Me.kml)),z.WHITE),u=y(Vj(Dn(a,"textColor",Me.kml)),z.BLACK),f=Dn(a,"text",Me.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Dn(a,"listItemType",Me.kml);(c==="radioFolder"||c==="checkOffOnly")&&Nt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function yQe(e,t,n,i,r){let o=new Kr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")e4(e,d,o,i,r);else{let p=lm(d,"Pair",Me.kml);for(let g=0;g<p.length;g++){let h=p[g],x=Dn(h,"key",Me.kml);if(x==="normal"){let b=Dn(h,"styleUrl",Me.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&o.merge(s);else{let C=Li(h,"Style",Me.kml);e4(e,C,o,i,r)}}else Nt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Dn(t,"styleUrl",Me.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function xQe(e,t,n){return t.fetchXML().then(function(i){return mpe(e,i,n,t,!0)})}function mpe(e,t,n,i,r,o){let s,a,c,u,f=ipe(t,"Style",Me.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=gs(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Kr({id:a}),n.add(c),e4(e,u,c,i,o)))}let d=ipe(t,"StyleMap",Me.kml);if(l(d)){let x=d.length;for(s=0;s<x;s++){let b=d[s];if(a=gs(b,"id"),l(a)){let C=lm(b,"Pair",Me.kml);for(let A=0;A<C.length;A++){let T=C[A],S=Dn(T,"key",Me.kml);if(S==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Dn(T,"styleUrl",Me.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let I=n.getById(v);l(I)&&c.merge(I)}else u=Li(T,"Style",Me.kml),e4(e,u,c,i,o)}}else Nt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),h=g.length;for(s=0;s<h;s++){let x=g[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let C=b[0],A=i.getDerivedResource({url:C});p.push(xQe(e,A,n))}}}return p}function Yj(e,t,n){let i=new x_(e,t.id,["position"]),r=new _h(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new qa,t.polyline.positions=new y_([i,r])}function hpe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(Nt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Nt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?Nt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Nt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function bQe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new _h(e))}function CQe(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function i4(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():dpe(),t.label=r),r.text=t.name;let o=t.billboard;l(o)||(o=l(n.billboard)?n.billboard.clone():fpe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(o.scale)&&(s=o.scale.getValue(),s!==0?r.pixelOffset=new H(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function ppe(e,t){let n=e.path;l(n)||(n=new _p,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function TQe(e,t,n,i,r){let o=Dn(n,"coordinates",Me.kml),s=Dn(n,"altitudeMode",Me.kml),a=Dn(n,"altitudeMode",Me.gx),c=um(n,"extrude",Me.kml),u=e._ellipsoid,f=n4(o,u);return i.position=f,i4(e,i,r,hpe(s,a)),c&&tN(s,a)&&Yj(t,i,r),!0}function rpe(e,t,n,i,r){let o=Li(n,"coordinates",Me.kml),s=Dn(n,"altitudeMode",Me.kml),a=Dn(n,"altitudeMode",Me.gx),c=um(n,"extrude",Me.kml),u=um(n,"tessellate",Me.kml),f=tN(s,a),d=ri(n,"drawOrder",Me.gx),p=e._ellipsoid,g=Qz(o,p),h=r.polyline;if(f&&c){let x=new gp;i.wall=x,x.positions=g;let b=r.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(h)?(x.outlineColor=l(h.material)?h.material.color:z.WHITE,x.outlineWidth=h.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let x=new qa;x.clampToGround=!0,i.polyline=x,x.positions=g,l(h)?(x.material=l(h.material)?h.material.color.getValue(Ve.MINIMUM_VALUE):z.WHITE,x.width=y(h.width,1)):(x.material=z.WHITE,x.width=1),x.zIndex=d}else l(d)&&Nt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&Nt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=l(h)?h.clone():new qa,i.polyline=h,h.positions=CQe(g,s,a,p),(!u||f)&&(h.arcType=Zt.NONE);return!0}function AQe(e,t,n,i,r){let o=Li(n,"outerBoundaryIs",Me.kml),s=Li(o,"LinearRing",Me.kml),a=Li(s,"coordinates",Me.kml),c=e._ellipsoid,u=Qz(a,c),f=um(n,"extrude",Me.kml),d=Dn(n,"altitudeMode",Me.kml),p=Dn(n,"altitudeMode",Me.gx),g=tN(d,p),h=l(r.polygon)?r.polygon.clone():jj(),x=r.polyline;if(l(x)&&(h.outlineColor=l(x.material)?x.material.color:z.WHITE,h.outlineWidth=x.width),i.polygon=h,g?(h.perPositionHeight=!0,h.extrudedHeight=f?0:void 0):e._clampToGround||(h.height=0),l(u)){let b=new Rc(u),C=lm(n,"innerBoundaryIs",Me.kml);for(let A=0;A<C.length;A++){s=lm(C[A],"LinearRing",Me.kml);for(let T=0;T<s.length;T++)a=Li(s[T],"coordinates",Me.kml),u=Qz(a,c),l(u)&&b.holes.push(new Rc(u))}h.hierarchy=b}return!0}function EQe(e,t,n,i,r){let o=Dn(n,"altitudeMode",Me.kml),s=Dn(n,"altitudeMode",Me.gx),a=lm(n,"coord",Me.gx),c=lm(n,"angles",Me.gx),u=lm(n,"when",Me.kml),f=um(n,"extrude",Me.kml),d=tN(o,s),p=e._ellipsoid;c.length>0&&Nt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),h=[],x=[];for(let C=0;C<g;C++){let A=n4(a[C].textContent,p);h.push(A),x.push(ee.fromIso8601(u[C].textContent))}let b=new ra;return b.addSamples(x,h),i.position=b,i4(e,i,r,hpe(o,s)),ppe(i,r),i.availability=new Oo,u.length>0&&i.availability.addInterval(new An({start:x[0],stop:x[x.length-1]})),d&&f&&Yj(t,i,r),!0}function ope(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new ra;d.addSamples(e,t),n.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:bQe(d,s,a)})),i.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function SQe(e,t,n,i,r){let o=um(n,"interpolate",Me.gx),s=lm(n,"Track",Me.gx),a,c,u,f=!1,d=new C_,p=new Oo,g=new na,h=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let C=s[x],A=lm(C,"when",Me.kml),T=lm(C,"coord",Me.gx),S=Dn(C,"altitudeMode",Me.kml),v=Dn(C,"altitudeMode",Me.gx),I=tN(S,v),O=um(C,"extrude",Me.kml),R=Math.min(T.length,A.length),L=[];a=[];for(let N=0;N<R;N++){let _=n4(T[N].textContent,h);L.push(_),a.push(ee.fromIso8601(A[N].textContent))}o&&(l(c)&&ope([c,a[0]],[u,L[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=L[L.length-1]),ope(a,L,g,p,d,I&&O,S,v,!0),f=f||I&&O}return i.availability=p,i.position=g,i4(e,i,r),ppe(i,r),f&&(Yj(t,i,r),i.polyline.show=d),!0}var _pe={Point:TQe,LineString:rpe,LinearRing:rpe,Polygon:AQe,Track:EQe,MultiTrack:SQe,MultiGeometry:vQe,Model:wQe};function vQe(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=_pe[f.localName];if(l(d)){let p=upe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function wQe(e,t,n,i,r){return Nt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function IQe(e,t){let n=Li(e,"ExtendedData",Me.kml);if(!l(n))return;l(Li(n,"SchemaData",Me.kml))&&Nt("kml-schemaData","KML - SchemaData is unsupported"),l(gs(n,"xmlns:prefix"))&&Nt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=lm(n,"Data",Me.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=gs(a,"name");l(c)&&(i[c]={displayName:Dn(a,"displayName",Me.kml),value:Dn(a,"value",Me.kml)})}}t.kml.extendedData=i}var br;typeof document<"u"&&(br=document.createElement("div"));function PQe(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Dn(e,"description",Me.kml),d=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,g=z.BLACK,h=f;l(d)&&(p=y(d.bgColor,z.WHITE),g=y(d.textColor,z.BLACK),h=y(d.text,f));let x;if(l(h)){if(h=h.replace("$[name]",y(t.name,"")),h=h.replace("$[description]",y(f,"")),h=h.replace("$[address]",y(c.address,"")),h=h.replace("$[Snippet]",y(c.snippet,"")),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),l(u)){let A=h.match(/\$\[.+?\]/g);if(A!==null)for(o=0;o<A.length;o++){let T=A[o],S=T.substr(2,T.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),x=u[S],l(x)&&(x=v?x.displayName:x.value),l(x)&&(h=h.replace(T,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],x=u[s],h+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;h+="</tbody></table>"}if(!l(h))return;h=uQe.link(h),br.innerHTML=h;let b=br.querySelectorAll("a");for(o=0;o<b.length;o++)b[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Eu(br,"a","href",i),Eu(br,"link","href",i),Eu(br,"area","href",i),Eu(br,"img","src",i),Eu(br,"iframe","src",i),Eu(br,"video","src",i),Eu(br,"audio","src",i),Eu(br,"source","src",i),Eu(br,"track","src",i),Eu(br,"input","src",i),Eu(br,"embed","src",i),Eu(br,"script","src",i),Eu(br,"video","poster",i)),Su(br,"a","href",r),Su(br,"link","href",r),Su(br,"area","href",r),Su(br,"img","src",r),Su(br,"iframe","src",r),Su(br,"video","src",r),Su(br,"audio","src",r),Su(br,"source","src",r),Su(br,"track","src",r),Su(br,"input","src",r),Su(br,"embed","src",r),Su(br,"script","src",r),Su(br,"video","poster",r);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${br.innerHTML}</div>`,br.innerHTML="",t.description=C}function r4(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=upe(t,i,n.context),c=a.kml,u=yQe(e,t,n.styleCollection,o,s),f=Dn(t,"name",Me.kml);a.name=f,a.parent=r;let d=_Qe(t);l(d)||(d=pQe(t)),a.availability=d,Jj(a);function p(T){return T?T.show&&p(T.parent):!0}let g=um(t,"visibility",Me.kml);a.show=p(r)&&y(g,!0);let h=Li(t,"author",Me.atom),x=c.author;x.name=Dn(h,"name",Me.atom),x.uri=Dn(h,"uri",Me.atom),x.email=Dn(h,"email",Me.atom);let b=Li(t,"link",Me.atom),C=c.link;C.href=gs(b,"href"),C.hreflang=gs(b,"hreflang"),C.rel=gs(b,"rel"),C.type=gs(b,"type"),C.title=gs(b,"title"),C.length=gs(b,"length"),c.address=Dn(t,"address",Me.kml),c.phoneNumber=Dn(t,"phoneNumber",Me.kml),c.snippet=Dn(t,"Snippet",Me.kml),IQe(t,a),PQe(t,a,u,s,o);let A=e._ellipsoid;return xpe(t,a,A),ype(t,a,A),l(Li(t,"Region",Me.kml))&&Nt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function gpe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function DQe(e,t,n,i){let r=r4(e,t,n),o=je(n);o.parentEntity=r.entity,gpe(e,t,o,i)}function RQe(e,t,n,i){let r=r4(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=_pe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),i4(e,o,s))}var OQe={FlyTo:NQe,Wait:LQe,SoundCue:Bj,AnimatedUpdate:Bj,TourControl:Bj};function MQe(e,t,n,i){let r=Dn(t,"name",Me.kml),o=gs(t,"id"),s=new JL(r,o),a=Li(t,"Playlist",Me.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=OQe[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function Bj(e,t){Nt(`KML Tour unsupported node ${t.localName}`)}function LQe(e,t){let n=ri(t,"duration",Me.gx);e.addPlaylistEntry(new QL(n))}function NQe(e,t,n){let i=ri(t,"duration",Me.gx),r=Dn(t,"flyToMode",Me.gx),o={kml:{}};xpe(t,o,n),ype(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new $L(i,r,s);e.addPlaylistEntry(a)}function ype(e,t,n){let i=Li(e,"Camera",Me.kml);if(l(i)){let r=y(ri(i,"longitude",Me.kml),0),o=y(ri(i,"latitude",Me.kml),0),s=y(ri(i,"altitude",Me.kml),0),a=y(ri(i,"heading",Me.kml),0),c=y(ri(i,"tilt",Me.kml),0),u=y(ri(i,"roll",Me.kml),0),f=m.fromDegrees(r,o,s,n),d=za.fromDegrees(a,c-90,u);t.kml.camera=new XL(f,d)}}function xpe(e,t,n){let i=Li(e,"LookAt",Me.kml);if(l(i)){let r=y(ri(i,"longitude",Me.kml),0),o=y(ri(i,"latitude",Me.kml),0),s=y(ri(i,"altitude",Me.kml),0),a=ri(i,"heading",Me.kml),c=ri(i,"tilt",Me.kml),u=y(ri(i,"range",Me.kml),0);c=D.toRadians(y(c,0)),a=D.toRadians(y(a,0));let f=new xu(a,c-D.PI_OVER_TWO,u),d=m.fromDegrees(r,o,s,n);t.kml.lookAt=new KL(d,f)}}function FQe(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=Li(t,"Icon",Me.kml),c=qj(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Li(t,"screenXY",Me.kml),p=Li(t,"overlayXY",Me.kml),g=Li(t,"size",Me.kml),h,x,b,C,A,T;l(g)&&(h=zy(g,"x"),x=zy(g,"y"),b=gs(g,"xunits"),C=gs(g,"yunits"),l(h)&&h!==-1&&h!==0&&(b==="fraction"?A=`width: ${Math.floor(h*100)}%`:b==="pixels"&&(A=`width: ${h}px`),f.push(A)),l(x)&&x!==-1&&x!==0&&(C==="fraction"?T=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(T=`height: ${x}px`),f.push(T))),u.style=f.join(";");let S=0,v=u.height;l(p)&&(h=zy(p,"x"),x=zy(p,"y"),b=gs(p,"xunits"),C=gs(p,"yunits"),l(h)&&(b==="fraction"?S=h*u.width:(b==="pixels"||b==="insetPixels")&&(S=h)),l(x)&&(C==="fraction"?v=x*u.height:(C==="pixels"||C==="insetPixels")&&(v=x))),l(d)&&(h=zy(d,"x"),x=zy(d,"y"),b=gs(d,"xunits"),C=gs(d,"yunits"),l(h)&&(b==="fraction"?A=`left: calc(${Math.floor(h*100)}% - ${S}px)`:b==="pixels"?A=`left: ${h-S}px`:b==="insetPixels"&&(A=`right: ${h-S}px`),f.push(A)),l(x)&&(C==="fraction"?T=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:C==="pixels"?T=`bottom: ${x-v}px`:C==="insetPixels"&&(T=`top: ${x-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function BQe(e,t,n,i){let o=r4(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=Qz(Li(t,"LatLonQuad",Me.gx),c),f=ri(t,"drawOrder",Me.kml);if(l(u))s=jj(),s.hierarchy=new Rc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new pd,s.zIndex=f,o.rectangle=s;let h=Li(t,"LatLonBox",Me.kml);if(l(h)){let x=ri(h,"west",Me.kml),b=ri(h,"south",Me.kml),C=ri(h,"east",Me.kml),A=ri(h,"north",Me.kml);l(x)&&(x=D.negativePiToPi(D.toRadians(x))),l(b)&&(b=D.clampToLatitudeRange(D.toRadians(b))),l(C)&&(C=D.negativePiToPi(D.toRadians(C))),l(A)&&(A=D.clampToLatitudeRange(D.toRadians(A))),s.coordinates=new ce(x,b,C,A);let T=ri(h,"rotation",Me.kml);if(l(T)){let S=D.toRadians(T);s.rotation=S,s.stRotation=S}}}let d=Li(t,"Icon",Me.kml),p=qj(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Nt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ri(d,"x",Me.gx),x=ri(d,"y",Me.gx),b=ri(d,"w",Me.gx),C=ri(d,"h",Me.gx);(l(h)||l(x)||l(b)||l(C))&&Nt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=Yb(t,"color",Me.kml),s.material.transparent=!0}else s.material=Yb(t,"color",Me.kml);let g=Dn(t,"altitudeMode",Me.kml);l(g)?g==="absolute"?(s.height=ri(t,"altitude",Me.kml),s.zIndex=void 0):g!=="clampToGround"&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Dn(t,"altitudeMode",Me.gx),g==="relativeToSeaFloor"?(Nt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ri(t,"altitude",Me.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Nt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function bpe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Nt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Hy={INTERVAL:0,EXPIRE:1,STOP:2};function t4(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var kQe=new ce,XE=new me,kj=new H,UQe=new m;function Xj(e,t,n,i,r,o){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=P0(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(r=y(r,kQe),l(n)&&(kj.x=n.clientWidth*.5,kj.y=n.clientHeight*.5,u=t.pickEllipsoid(kj,o,UQe)),l(u)?f=o.cartesianToCartographic(u,XE):(f=ce.center(r,XE),u=o.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let C=r.width*i*.5,A=r.height*i*.5;r=new ce(a(f.longitude-C),s(f.latitude-A),a(f.longitude+C),s(f.latitude+A))}c=c.replace("[bboxWest]",D.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(r.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,XE),c=c.replace("[cameraLon]",D.toDegrees(XE.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(XE.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(XE.height).toString());let g=t.frustum,h=g.aspectRatio,x="",b="";if(l(h)){let C=D.toDegrees(g.fov);h>1?(x=C,b=C/h):(b=C,x=C*h)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Kl(c))}function VQe(e,t,n,i){let o=r4(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Li(t,"Link",Me.kml);if(l(c)||(c=Li(t,"Url",Me.kml)),l(c)){let u=Dn(c,"href",Me.kml),f,d;if(l(u)){let p=u;if(u=Wj(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(c,"viewRefreshMode",Me.kml),f==="onRegion"){Nt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Dn(c,"viewBoundScale",Me.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Dn(c,"viewFormat",Me.kml),b),A=Dn(c,"httpQuery",Me.kml);l(C)&&u.setQueryParameters(Kl(t4(C))),l(A)&&u.setQueryParameters(Kl(t4(A)));let T=e._ellipsoid;Xj(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},h=new Fs,x=Kj(e,h,u,g).then(function(b){let C=e._entityCollection,A=h.values;C.suspendEvents();for(let v=0;v<A.length;v++){let I=A[v];l(I.parent)||(I.parent=o,Jj(I)),C.add(I)}C.resumeEvents();let T=Dn(c,"refreshMode",Me.kml),S=y(ri(c,"refreshInterval",Me.kml),0);if(T==="onInterval"&&S>0||T==="onExpire"||f==="onStop"){let v=Li(b,"NetworkLinkControl",Me.kml),I=l(v),O=ee.now(),R={id:qn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:O},L=0;if(I&&(R.cookie=Kl(y(Dn(v,"cookie",Me.kml),"")),L=y(ri(v,"minRefreshPeriod",Me.kml),0)),T==="onInterval")I&&(S=Math.max(L,S)),R.refreshMode=Hy.INTERVAL,R.time=S;else if(T==="onExpire"){let N;if(I&&(N=Dn(v,"expires",Me.kml)),l(N))try{let _=ee.fromIso8601(N),E=ee.secondsDifference(_,O);E>0&&E<L&&ee.addSeconds(O,L,_),R.refreshMode=Hy.EXPIRE,R.time=_}catch{Nt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=Hy.STOP,R.time=y(ri(c,"viewRefreshTime",Me.kml),0)):Nt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){Nt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function zQe(e,t,n,i){let r=Gj[t.localName];return l(r)?r(e,t,n,i):bpe(e,t,n,i)}function zj(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Li(a,"Document",Me.kml),u=Dn(c,"name",Me.kml);l(u)||(u=__(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new vu._DeferredLoading(e),d=new Fs(e);return Promise.all(mpe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let x=0;x<h.length;x++){let b=h[x];if(l(Gj[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),zQe(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function HQe(e,t,n,i,r){let o=tn("ThirdParty/Workers/z-worker-pako.js");RE({workerScripts:{deflate:[o,"./pako_deflate.min.js"],inflate:[o,"./pako_inflate.min.js"]}});let s=new yz(new Bb(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(Fj(f,u)),f=p):c.push(Fj(p,u)))}return l(f)&&c.push(hQe(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new de("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),zj(e,t,u.kml,i,u,r)})})}function Kj(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ie){n=Ie.createIfNeeded(n),c=n.fetchBlob(),r=y(r,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=y(r,Ie.DEFAULT.clone());return r=Ie.createIfNeeded(r),l(a)&&(a=Pn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?dQe(u).then(function(f){return f?HQe(e,t,u,r,a):mQe(u).then(function(d){d=cpe(d),d=lpe(d);let p,g;try{p=Hj.parseFromString(d,"application/xml")}catch(h){g=h.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let h=l(g)?g:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new de(h)}return zj(e,t,p,r,o,a,s)})}):zj(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function vu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new Fs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new P_,this._networkLinks=new Tt,this._entityCluster=new uu,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,re.WGS84);let i=e.credit;typeof i=="string"&&(i=new vt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}vu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new vu(t).load(e,t)};Object.defineProperties(vu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});vu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Mo.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return Kj(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,Ve.MINIMUM_VALUE),u=ee.equals(a,Ve.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Yd,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=No.LOOP_STOP,r.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Mo.setLoading(i,!1),i}).catch(function(r){return Mo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};vu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function Jj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function GQe(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Li(o,"NetworkLinkControl",Me.kml),c=l(a),u=0;if(c){if(l(Li(a,"Update",Me.kml))){Nt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Kl(y(Dn(a,"cookie",Me.kml),"")),u=y(ri(a,"minRefreshPeriod",Me.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===Hy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Hy.EXPIRE){let O;if(l(a)&&(O=Dn(a,"expires",Me.kml)),l(O))try{let R=ee.fromIso8601(O),L=ee.secondsDifference(R,f);L>0&&L<u&&ee.addSeconds(f,u,R),t.time=R}catch{Nt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,h=n.values;function x(O){g.remove(O);let R=O._children,L=R.length;for(let N=0;N<L;++N)x(R[N])}g.suspendEvents();let b=g.values.slice(),C;for(C=0;C<b.length;++C){let O=b[C];O.parent===p&&(O.parent=void 0,x(O))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<h.length;C++){let O=h[C];l(O.parent)||(O.parent=p,Jj(O)),g.add(O)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let A=g.computeAvailability(),T=A.start,S=A.stop,v=ee.equals(T,Ve.MINIMUM_VALUE),I=ee.equals(S,Ve.MAXIMUM_VALUE);if(!v||!I){let O=e._clock;(O.startTime!==T||O.stopTime!==S)&&(O.startTime=T,O.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Uj=new Tt;vu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;Uj.removeAll();function r(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let h=d[g];Uj.set(h.id,h),r(h)}}let o=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,D.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,D.EPSILON7)&&a.upWC.equalsEpsilon(s.up,D.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),o=!0);let c=new Tt,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!Uj.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===Hy.INTERVAL?ee.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===Hy.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Hy.STOP&&(o&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){r(d),f.updating=!0;let g=new Fs,h=f.href.clone();h.setQueryParameters(f.cookie);let x=y(i._ellipsoid,re.WGS84);Xj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),Kj(i,g,h,{context:d.id}).then(GQe(i,f,g,c,h)).catch(function(b){let C=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function WQe(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}vu._DeferredLoading=Sh;vu._getTimestamp=Ci;var nN=vu;function iN(){fe.throwInstantiationError()}iN.prototype.update=fe.throwInstantiationError;iN.prototype.getBoundingSphere=fe.throwInstantiationError;iN.prototype.isDestroyed=fe.throwInstantiationError;iN.prototype.destroy=fe.throwInstantiationError;var Zj=iN;var jQe={NONE:0,LERC:1},Ff=Object.freeze(jQe);var qQe={NONE:0,BITS12:1},Us=Object.freeze(qQe);var Xb=new m,YQe=new m,Bf=new H,o4=new F,XQe=new F,KQe=Math.pow(2,12);function fc(e,t,n,i,r,o,s,a,c,u){let f=Us.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,h=t.maximum,x=m.subtract(h,g,YQe),b=i-n;Math.max(m.maximumComponent(x),b)<KQe-1?f=Us.BITS12:f=Us.NONE,d=F.inverseTransformation(r,new F);let A=m.negate(g,Xb);F.multiply(F.fromTranslation(A,o4),d,d);let T=Xb;T.x=1/x.x,T.y=1/x.y,T.z=1/x.z,F.multiply(F.fromScale(T,o4),d,d),p=F.clone(r),F.setTranslation(p,m.ZERO,p),r=F.clone(r,new F);let S=F.fromTranslation(g,o4),v=F.fromScale(x,XQe),I=F.multiply(S,v,o4);F.multiply(r,I,r),F.multiply(p,I,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}fc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===Us.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,Xb),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((r-this.minimumHeight)/f,0,1);H.fromElements(n.x,n.y,Bf);let p=Xn.compressTextureCoordinates(Bf);H.fromElements(n.z,d,Bf);let g=Xn.compressTextureCoordinates(Bf);H.fromElements(c,u,Bf);let h=Xn.compressTextureCoordinates(Bf);if(e[t++]=p,e[t++]=g,e[t++]=h,this.hasWebMercatorT){H.fromElements(s,0,Bf);let x=Xn.compressTextureCoordinates(Bf);e[t++]=x}}else m.subtract(n,this.center,Xb),e[t++]=Xb.x,e[t++]=Xb.y,e[t++]=Xb.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Xn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var JQe=new m,Cpe=new m;fc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,JQe),c=n.geodeticSurfaceNormal(a,Cpe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};fc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};fc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===Us.BITS12){let i=Xn.decompressTextureCoordinates(e[t],Bf);n.x=i.x,n.y=i.y;let r=Xn.decompressTextureCoordinates(e[t+1],Bf);return n.z=r.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};fc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Cpe),a=this.decodeHeight(e,t),c=vc.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};fc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new H),t*=this.stride,this.quantization===Us.BITS12?Xn.decompressTextureCoordinates(e[t+2],n):H.fromElements(e[t+4],e[t+5],n)};fc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Us.BITS12?Xn.decompressTextureCoordinates(e[t+1],Bf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};fc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Us.BITS12?Xn.decompressTextureCoordinates(e[t+3],Bf).x:e[t+6]};fc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return H.fromElements(r,o,n)};fc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};fc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Us.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var s4={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},a4={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};fc.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===Us.NONE){s(s4.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(s4.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(s4.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(a4.compressed0,a?4:3),c&&s(a4.compressed1,1),this.hasGeodeticSurfaceNormals&&s(a4.geodeticSurfaceNormal,3)}return o};fc.prototype.getAttributeLocations=function(){return this.quantization===Us.NONE?s4:a4};fc.clone=function(e,t){if(l(e))return l(t)||(t=new fc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var dc=fc;var vh={};vh.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var $j=new m,ZQe=new F,$Qe=new m,QQe=new m;vh.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,re.WGS84),x=1/h.maximumRadius,b=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),A,T,S,v;l(C)?(A=C.west,T=C.south,S=C.east,v=C.north):g?(A=a(b.west),T=a(b.south),S=a(b.east),v=a(b.north)):(A=b.west*x,T=s-2*r(o(-b.south*x)),S=b.east*x,v=s-2*r(o(-b.north*x)));let I=e.relativeToCenter,O=l(I);I=O?I:m.ZERO;let R=y(e.includeWebMercatorT,!1),L=y(e.exaggeration,1),N=y(e.exaggerationRelativeHeight,0),E=L!==1,w=y(e.structure,vh.DEFAULT_STRUCTURE),P=y(w.heightScale,vh.DEFAULT_STRUCTURE.heightScale),M=y(w.heightOffset,vh.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,vh.DEFAULT_STRUCTURE.elementsPerHeight),V=y(w.stride,vh.DEFAULT_STRUCTURE.stride),U=y(w.elementMultiplier,vh.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,vh.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(b),Y=ce.computeHeight(b),j=k/(u-1),J=Y/(f-1);g||(k*=x,Y*=x);let W=h.radiiSquared,K=W.x,Z=W.y,he=W.z,ge=65536,se=-65536,pe=Mt.eastNorthUpToFixedFrame(I,h),xe=F.inverseTransformation(pe,ZQe),Pe,we;R&&(Pe=Ri.geodeticLatitudeToMercatorAngle(T),we=1/(Ri.geodeticLatitudeToMercatorAngle(v)-Pe));let Se=$Qe;Se.x=Number.POSITIVE_INFINITY,Se.y=Number.POSITIVE_INFINITY,Se.z=Number.POSITIVE_INFINITY;let nt=QQe;nt.x=Number.NEGATIVE_INFINITY,nt.y=Number.NEGATIVE_INFINITY,nt.z=Number.NEGATIVE_INFINITY;let Ze=Number.POSITIVE_INFINITY,Gt=u*f,fn=d>0?u*2+f*2:0,pt=Gt+fn,Tn=new Array(pt),Vn=new Array(pt),Ut=new Array(pt),Pt=R?new Array(pt):[],Ce=E?new Array(pt):[],ve=0,ot=f,Kt=0,_i=u;p&&(--ve,++ot,--Kt,++_i);let Je=1e-5;for(let He=ve;He<ot;++He){let dt=He;dt<0&&(dt=0),dt>=f&&(dt=f-1);let _t=b.north-J*dt;g?_t=a(_t):_t=s-2*r(o(-_t*x));let hn=(_t-T)/(v-T);hn=D.clamp(hn,0,1);let Hi=He===ve,Rr=He===ot-1;d>0&&(Hi?_t+=Je*Y:Rr&&(_t-=Je*Y));let ss=t(_t),As=n(_t),io=he*As,Xi;R&&(Xi=(Ri.geodeticLatitudeToMercatorAngle(_t)-Pe)*we);for(let Ao=Kt;Ao<_i;++Ao){let jn=Ao;jn<0&&(jn=0),jn>=u&&(jn=u-1);let Fn=dt*(u*V)+jn*V,Ln;if(B===1)Ln=c[Fn];else{Ln=0;let rt;if(G)for(rt=0;rt<B;++rt)Ln=Ln*U+c[Fn+rt];else for(rt=B-1;rt>=0;--rt)Ln=Ln*U+c[Fn+rt]}Ln=Ln*P+M,se=Math.max(se,Ln),ge=Math.min(ge,Ln);let gi=b.west+j*jn;g?gi=a(gi):gi=gi*x;let Ws=(gi-A)/(S-A);Ws=D.clamp(Ws,0,1);let as=dt*u+jn;if(d>0){let rt=Ao===Kt,Ft=Ao===_i-1,tr=Hi||Rr||rt||Ft;if((Hi||Rr)&&(rt||Ft))continue;tr&&(Ln-=d,rt?(as=Gt+(f-dt-1),gi-=Je*k):Rr?as=Gt+f+(u-jn-1):Ft?(as=Gt+f+u+dt,gi+=Je*k):Hi&&(as=Gt+f+u+f+jn))}let td=ss*t(gi),La=ss*n(gi),ha=K*td,nd=Z*La,$_=1/i(ha*td+nd*La+io*As),po=ha*$_,Ho=nd*$_,on=io*$_,Ae=new m;Ae.x=po+td*Ln,Ae.y=Ho+La*Ln,Ae.z=on+As*Ln,F.multiplyByPoint(xe,Ae,$j),m.minimumByComponent($j,Se,Se),m.maximumByComponent($j,nt,nt),Ze=Math.min(Ze,Ln),Tn[as]=Ae,Ut[as]=new H(Ws,hn),Vn[as]=Ln,R&&(Pt[as]=Xi),E&&(Ce[as]=h.geodeticSurfaceNormal(Ae))}}let ho=ae.fromPoints(Tn),vr;l(C)&&(vr=On.fromRectangle(C,ge,se,h));let zo;O&&(zo=new h_(h).computeHorizonCullingPointPossiblyUnderEllipsoid(I,Tn,ge));let os=new lg(Se,nt,I),ke=new dc(I,os,Ze,se,pe,!1,R,E,L,N),st=new Float32Array(pt*ke.stride),Ke=0;for(let He=0;He<pt;++He)Ke=ke.encode(st,Ke,Tn[He],Ut[He],Vn[He],void 0,Pt[He],Ce[He]);return{vertices:st,maximumHeight:se,minimumHeight:ge,encoding:ke,boundingSphere3D:ho,orientedBoundingBox:vr,occludeePointInScaledSpace:zo}};var KE=vh;function Gy(){fe.throwInstantiationError()}Object.defineProperties(Gy.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});Gy.prototype.interpolateHeight=fe.throwInstantiationError;Gy.prototype.isChildAvailable=fe.throwInstantiationError;Gy.prototype.createMesh=fe.throwInstantiationError;Gy.prototype.upsample=fe.throwInstantiationError;Gy.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;Gy.maximumAsynchronousTasks=5;var fm=Gy;function eet(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=x}var kf=eet;function Jc(){fe.throwInstantiationError()}Object.defineProperties(Jc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var Tpe=[];Jc.getRegularGridIndices=function(e,t){let n=Tpe[e];l(n)||(Tpe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),vpe(e,t,i,0)),i};var Ape=[];Jc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Ape[e];l(n)||(Ape[e]=n=[]);let i=n[t];if(!l(i)){let r=Jc.getRegularGridIndices(e,t),o=Spe(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Epe=[];Jc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Epe[e];l(n)||(Epe[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=Spe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,h=f.northIndicesWestToEast,x=Be.createTypedArray(c,u);vpe(e,t,x,0),Jc.addSkirtIndices(d,p,g,h,r,x,o),i=n[t]={indices:x,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:h,indexCountWithoutSkirts:o}}return i};Jc.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=c4(e,a,o,s),a+=e.length,s=c4(t,a,o,s),a+=t.length,s=c4(n,a,o,s),a+=n.length,c4(i,a,o,s)};function Spe(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function vpe(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function c4(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Jc.heightmapTerrainQuality=.25;Jc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Jc.heightmapTerrainQuality/(t*n)};Jc.prototype.requestTileGeometry=fe.throwInstantiationError;Jc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Jc.prototype.getTileDataAvailable=fe.throwInstantiationError;Jc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var Xo=Jc;function R_(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Ff.NONE);let t=KE.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Ff.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(R_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var wpe="createVerticesFromHeightmap",tet=new bi(wpe),net=new bi(wpe,fm.maximumAsynchronousTasks);R_.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ce.center(f)),p=this._structure,h=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(h*4,1e3);let b=(a?net:tet).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let C=this;return Promise.resolve(b).then(function(A){let T;C._skirtHeight>0?T=Xo.getRegularGridAndSkirtIndicesAndEdgeIndices(A.gridWidth,A.gridHeight):T=Xo.getRegularGridIndicesAndEdgeIndices(A.gridWidth,A.gridHeight);let S=A.gridWidth*A.gridHeight;return C._mesh=new kf(d,new Float32Array(A.vertices),T.indices,T.indexCountWithoutSkirts,S,A.minimumHeight,A.maximumHeight,ae.clone(A.boundingSphere3D),m.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,On.clone(A.orientedBoundingBox),dc.clone(A.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),C._buffer=void 0,C._mesh})};R_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ce.center(u)),d=this._structure,g=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let h=KE.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=Xo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=Xo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=h.gridWidth*h.gridHeight;return this._mesh=new kf(f,h.vertices,x.indices,x.indexCountWithoutSkirts,b,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};R_.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===Ff.LERC;if(!p&&g)return;let x;if(p){let b=this._mesh.vertices,C=this._mesh.encoding;x=Ipe(b,C,f,d,e,i,r,t,n)}else x=iet(this._buffer,a,c,s,u,e,i,r,t,n),x=x*d+f;return x};R_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,h=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(r,o,s),C=f.heightOffset,A=f.heightScale,T=f.elementsPerHeight,S=f.elementMultiplier,v=f.isBigEndian,I=Math.pow(S,T-1);for(let O=0;O<u;++O){let R=D.lerp(b.north,b.south,O/(u-1));for(let L=0;L<c;++L){let N=D.lerp(b.west,b.east,L/(c-1)),_=Ipe(g,h,C,A,x,c,u,N,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,ret(p,T,S,I,d,v,O*c+L,_)}}return Promise.resolve(new R_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};R_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};R_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function iet(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let h=d|0,x=h+1;x>=a&&(x=a-1,h=a-2);let b=f-p,C=d-h;h=a-1-h,x=a-1-x;let A=l4(e,t,n,i,r,h*s+p),T=l4(e,t,n,i,r,h*s+g),S=l4(e,t,n,i,r,x*s+p),v=l4(e,t,n,i,r,x*s+g);return Ppe(b,C,A,T,S,v)}function Ipe(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let x=u-d,b=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*o+d)-n)/i,A=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,h*o+d)-n)/i,S=(t.decodeHeight(e,h*o+p)-n)/i;return Ppe(x,b,C,A,T,S)}function Ppe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function l4(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function ret(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Ia=R_;function $E(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Kb=new ce;function oet(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}$E.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)oet(e,g,p,s)||s.push(new JE(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,Kb);let a=Kb.west,c=Kb.north;o.tileXYToRectangle(i,r,e,Kb);let u=Kb.east,f=Kb.south,d=new fet(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];Qj(g.extent,d)&&det(this._maximumLevel,g,d)}};$E.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(ZE(i.extent,e)){t=i;break}}return l(t)?rN(void 0,t,e):-1};var set=[],aet=[],cet=new ce,uet=new ce;$E.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=set;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,cet)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,uet))):t.push(e);let n=aet;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)oN(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Dpe=new me;$E.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Kb);return ce.center(i,Dpe),this.computeMaximumLevelAtPosition(Dpe)>=e};$E.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function JE(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(JE.prototype,{nw:{get:function(){return this._nw||(this._nw=new JE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new JE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new JE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new JE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function fet(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function Qj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function det(e,t,n){for(;t.level<e;)if(u4(t.nw.extent,n))t=t.nw;else if(u4(t.ne.extent,n))t=t.ne;else if(u4(t.sw.extent,n))t=t.sw;else if(u4(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Or(t.rectangles,n.level,met);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function met(e,t){return e.level-t}function u4(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function ZE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function rN(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&ZE(t._nw.extent,n),s=t._ne&&ZE(t._ne.extent,n),a=t._sw&&ZE(t._sw.extent,n),c=t._se&&ZE(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,rN(t,t._nw,n))),s&&(i=Math.max(i,rN(t,t._ne,n))),a&&(i=Math.max(i,rN(t,t._sw,n))),c&&(i=Math.max(i,rN(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];ZE(a,n)&&(i=a.level)}t=t.parent}return i}function oN(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||Qj(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=het(e[s.level],s)}oN(e,t._nw,n),oN(e,t._ne,n),oN(e,t._sw,n),oN(e,t._se,n)}function het(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];Qj(r,t)?(r.west<t.west&&n.push(new ce(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ce(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ce(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ce(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var dm=$E;function pet(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` +${r}`),t}var wh=pet;function f4(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=y(o,0),this.retry=!1,this.error=s}f4.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new f4(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${wh(i)}`),c};f4.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Ti=f4;function Wy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Ri(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Wy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Wy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Wy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Wy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),r=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=r.x,t.north=r.y,t):new ce(i.x,i.y,r.x,r.y)};Wy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ce(a,d,c,f)};Wy.prototype.tileXYToRectangle=function(e,t,n,i){let r=this.tileXYToNativeRectangle(e,t,n,i),o=this._projection,s=o.unproject(new H(r.west,r.south)),a=o.unproject(new H(r.east,r.north));return r.west=s.longitude,r.south=s.latitude,r.east=a.longitude,r.north=a.latitude,r};Wy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,h=p/a|0;h>=r&&(h=r-1);let x=g/u|0;return x>=o&&(x=o-1),l(n)?(n.x=h,n.y=x,n):new H(h,x)};var Bo=Wy;var _et=15;function eq(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}eq.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function get(e,t){let n=t.copyrightText;l(n)&&(e.credit=new vt(n));let i=t.spatialReference,r=y(i.latestWkid,i.wkid),o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ce.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new ji(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(o.xmin,o.ymin),s.rectangleNortheastInMeters=new H(o.xmax,o.ymax),e.tilingScheme=new Bo(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Ff.LERC:Ff.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new dm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new dm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Rpe(e,t,n){try{let i=await t.fetchJson();get(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function jy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new _e,l(e.url)){Q("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new eq(e);this._readyPromise=Promise.resolve(e.url).then(async function(r){let o=Ie.createIfNeeded(r);o.appendForwardSlash(),l(t)&&(o=o.getDerivedResource({queryParameters:{token:t}})),n._resource=o;let s=o.getDerivedResource({queryParameters:{f:"pjson"}});return await Rpe(i,s,n),i.build(n),!0})}}Object.defineProperties(jy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});jy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ie.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new eq(t);await Rpe(r,i);let o=new jy(t);return r.build(o),o._resource=n,o};jy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(tq(this,n+1,e*2,t*2))){let d=Ope(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Ia({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):_et,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===ni.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ni.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function tq(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}jy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=tq(this,n,e,t);if(l(i))return i;Ope(this,n,e,t)};jy.prototype.loadTileDataAvailability=function(e,t,n){};function yet(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new H(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let h=e.y;h<g;++h)if(i[h*t+u.x]!==s){f=!0;break}f?(a.push(new H(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let h=u.y*t;for(let x=e.x;x<=p;++x)if(i[h+x]!==s){d=!0;break}d?(a.push(new H(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function xet(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new H(0,0)];for(;a.length>0;){let c=a.pop(),u=yet(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function Ope(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new jr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=xet(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let h=e._tilesAvailable;for(let x=0;x<g.length;++x){let b=g[x];h.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return tq(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var nq=jy;var Mpe="https://dev.virtualearth.net/REST/v1/Locations";function iq(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ie({url:Mpe,queryParameters:n}),this._credit=new vt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(iq.prototype,{url:{get:function(){return Mpe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});iq.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ce.fromDegrees(a,s,u,c)}})})};var rq=iq;function oq(){}Object.defineProperties(oq.prototype,{credit:{get:function(){}}});oq.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:m.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var sN=oq;var bet=new oe,Lpe=new m,QE=new m;function Cet(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let u=(a-i)*r;return m.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new m);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=bet;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=m.subtract(t[2],c,Lpe),m.multiplyByScalar(d,.5,d),p=F.multiplyByVector(zg.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=m.subtract(u,t[o-1],Lpe),m.multiplyByScalar(f,.5,f),p=F.multiplyByVector(zg.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=F.multiplyByVector(qy.catmullRomCoefficientMatrix,a,a)),r=m.multiplyByScalar(c,p.x,r),m.multiplyByScalar(u,p.y,QE),m.add(r,QE,r),m.multiplyByScalar(f,p.z,QE),m.add(r,QE,r),m.multiplyByScalar(d,p.w,QE),m.add(r,QE,r)}}var Tet=new m,Aet=new m;function qy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=Tet,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=Aet,m.multiplyByScalar(t[o-1],2,r),m.subtract(t[o],r,r),m.add(r,t[o-2],r),m.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(r),this._evaluateFunction=Cet(this),this._lastTimeIndex=0}Object.defineProperties(qy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});qy.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);qy.prototype.findTimeInterval=lr.prototype.findTimeInterval;qy.prototype.wrapTime=lr.prototype.wrapTime;qy.prototype.clampTime=lr.prototype.clampTime;qy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var sq=qy;var d4={};d4.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,h,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(h=(e-r)/(n-r),x=(e-r)/(i-r),o.push(0),o.push(1),x!==1&&(o.push(-1),o.push(2),o.push(1),o.push(x)),h!==1&&(o.push(-1),o.push(2),o.push(0),o.push(h))):u===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(h)):!a&&i!==e?(x=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(x),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};d4.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),h=t-a,x=e-s,b=(d*x+f*h)*g,C=(-p*x+u*h)*g,A=1-b-C;return l(c)?(c.x=b,c.y=C,c.z=A,c):new m(b,C,A)};d4.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var O_=d4;function Yy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=h4(e.westIndices,r,t),this._southIndices=h4(e.southIndices,o,t),this._eastIndices=h4(e.eastIndices,r,t),this._northIndices=h4(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Yy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var m4=[];function h4(e,t,n){m4.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)m4[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(m4.sort(t),Be.createTypedArray(n,m4)):e}var Npe="createVerticesFromQuantizedTerrainMesh",Eet=new bi(Npe),vet=new bi(Npe,fm.maximumAsynchronousTasks);Yy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?vet:Eet).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,x=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Be.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),A=g.center,T=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,I=p._orientedBoundingBox,O=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=g.vertexStride,L=dc.clone(g.encoding);return p._mesh=new kf(A,C,b,g.indexCountWithoutSkirts,h,T,S,v,O,R,I,L,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var wet=new bi("upsampleQuantizedTerrainMesh",fm.maximumAsynchronousTasks);Yy.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=wet.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:g*.5,C=u?this._northSkirtHeight:g*.5,A=this._credits;return Promise.resolve(p).then(function(T){let S=new Uint16Array(T.vertices),v=Be.createTypedArray(S.length/3,T.indices),I;return l(T.encodedNormals)&&(I=new Uint8Array(T.encodedNormals)),new Yy({quantizedVertices:S,indices:v,encodedNormals:I,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ae.clone(T.boundingSphere),orientedBoundingBox:On.clone(T.orientedBoundingBox),horizonOcclusionPoint:m.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:h,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:C,childTileMask:0,credits:A,createdByUpsampling:!0})})};var aq=32767,Fpe=new m;Yy.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=aq;let r=D.clamp((n-e.south)/e.height,0,1);return r*=aq,l(this._mesh)?Ret(this,i,r):Oet(this,i,r)};function Bpe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var Iet=new H,Pet=new H,Det=new H;function Ret(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,Iet),g=o.decodeTextureCoordinates(r,f,Pet),h=o.decodeTextureCoordinates(r,d,Det);if(Bpe(t,n,p.x,p.y,g.x,g.y,h.x,h.y)){let x=O_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,Fpe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=o.decodeHeight(r,u),C=o.decodeHeight(r,f),A=o.decodeHeight(r,d);return x.x*b+x.y*C+x.z*A}}}}function Oet(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],h=i[d],x=r[u],b=r[f],C=r[d];if(Bpe(t,n,p,x,g,b,h,C)){let A=O_.computeBarycentricCoordinates(t,n,p,x,g,b,h,C,Fpe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let T=A.x*o[u]+A.y*o[f]+A.z*o[d];return D.lerp(e._minimumHeight,e._maximumHeight,T/aq)}}}}Yy.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Yy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Jb=Yy;function Met(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function uq(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}uq.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata,e._ready=!0};async function Upe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Bo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(e.levelZeroMaximumGeometricError=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new dm(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let A=0;A<b.length;++A){let T=b[A],S=C-T.endY-1,v=C-T.startY-1;e.overallAvailability[x].push([T.startX,S,T.endX,v]),g.addAvailableTileRange(x,T.startX,S,T.endX,v)}}}else l(d)&&(f=new dm(e.tilingScheme,u),g=new dm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Met({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await p4(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Let(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return p4(e,n);throw new de(i)}async function Net(e,t,n){await Upe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new dm(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new vt(e.attribution);e.tileCredits.push(r)}return!0}async function p4(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=Net(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return l(n)&&n.statusCode===404?(await Upe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),Let(e,n,t))}}function wu(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new vt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),l(e.url)&&(Q("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=wu._initializeReadyPromise(e,this))}wu._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new uq(e),r=Ie.createIfNeeded(n);return r.appendForwardSlash(),i.lastResource=r,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await p4(i,t),i.build(t),!0};var cq={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function kpe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Fet(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Ia({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Bet(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*h,C=new DataView(t),A=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let T=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let O=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*g,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*h);let L=R.subarray(0,O),N=R.subarray(O,2*O),_=R.subarray(O*2,3*O);Xn.zigZagDeltaDecode(L,N,_),a%x!==0&&(a+=x-a%x);let E=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Be.createTypedArrayFromArrayBuffer(O,t,a,E*h);a+=E*b;let P=0,M=w.length;for(let se=0;se<M;++se){let pe=w[se];w[se]=P-pe,pe===0&&++P}let B=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=Be.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Be.createTypedArrayFromArrayBuffer(O,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Be.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let j=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Be.createTypedArrayFromArrayBuffer(O,t,a,j);a+=j*x;let W,K;for(;a<C.byteLength;){let se=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let pe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,se===cq.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,O*2);else if(se===cq.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,pe);else if(se===cq.METADATA&&e._requestMetadata){let xe=C.getUint32(a,!0);if(xe>0){let we=Lr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(we))for(let Se=0;Se<we.length;++Se){let nt=n+Se+1,Ze=we[Se],Gt=e._tilingScheme.getNumberOfYTilesAtLevel(nt);for(let fn=0;fn<Ze.length;++fn){let pt=Ze[fn],Tn=Gt-pt.endY-1,Vn=Gt-pt.startY-1;e.availability.addAvailableTileRange(nt,pt.startX,Tn,pt.endX,Vn),o.availability.addAvailableTileRange(nt,pt.startX,Tn,pt.endX,Vn)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=pe}let Z=e.getLevelMaximumGeometricError(n)*5,he=e._tilingScheme.tileXYToRectangle(i,r,n),ge=On.fromRectangle(he,T,S,e._tilingScheme.ellipsoid);return new Jb({center:A,minimumHeight:T,maximumHeight:S,boundingSphere:v,orientedBoundingBox:ge,horizonOcclusionPoint:I,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:G,eastIndices:Y,northIndices:J,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:K,credits:e._tileCredits})}wu.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=fq(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>this.requestTileGeometry(e,t,n,i)):Vpe(this,e,t,n,o,i)};function Vpe(e,t,n,i,r,o){if(!l(r))return Promise.reject(new de("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=kpe(void 0)):u=kpe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(h){return l(h)?l(e._heightmapStructure)?Fet(e,h,i,t,n):Bet(e,h,i,t,n,r):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(wu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});wu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};wu.fromIonAssetId=async function(e,t){let n=await Zs.fromAssetId(e);return wu.fromUrl(n,t)};wu.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ie.createIfNeeded(e);n.appendForwardSlash();let i=new uq(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await p4(i);let r=new wu(t);return i.build(r),r};wu.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(fq(this,e,t,n,i[o],o===0).result)return;return!1};wu.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=fq(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function lq(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function fq(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=lq(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new jr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});d=Vpe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=lq(r,f.x,f.y,f.level)}return{result:!1}}wu._getAvailabilityTile=lq;var Xy=wu;function M_(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new qc(n),this._workerName="createCircleGeometry"}M_.packedLength=qc.packedLength;M_.pack=function(e,t,n){return qc.pack(e._ellipseGeometry,t,n)};var ket=new qc({center:new m,semiMajorAxis:1,semiMinorAxis:1}),mc={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Oe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};M_.unpack=function(e,t,n){let i=qc.unpack(e,t,ket);return mc.center=m.clone(i._center,mc.center),mc.ellipsoid=re.clone(i._ellipsoid,mc.ellipsoid),mc.height=i._height,mc.extrudedHeight=i._extrudedHeight,mc.granularity=i._granularity,mc.vertexFormat=Oe.clone(i._vertexFormat,mc.vertexFormat),mc.stRotation=i._stRotation,mc.shadowVolume=i._shadowVolume,l(n)?(mc.semiMajorAxis=i._semiMajorAxis,mc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new qc(mc),n):(mc.radius=i._semiMajorAxis,new M_(mc))};M_.createGeometry=function(e){return qc.createGeometry(e._ellipseGeometry)};M_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new M_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(M_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var dq=M_;function eS(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new _u(n),this._workerName="createCircleOutlineGeometry"}eS.packedLength=_u.packedLength;eS.pack=function(e,t,n){return _u.pack(e._ellipseGeometry,t,n)};var Uet=new _u({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Iu={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};eS.unpack=function(e,t,n){let i=_u.unpack(e,t,Uet);return Iu.center=m.clone(i._center,Iu.center),Iu.ellipsoid=re.clone(i._ellipsoid,Iu.ellipsoid),Iu.height=i._height,Iu.extrudedHeight=i._extrudedHeight,Iu.granularity=i._granularity,Iu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Iu.semiMajorAxis=i._semiMajorAxis,Iu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new _u(Iu),n):(Iu.radius=i._semiMajorAxis,new eS(Iu))};eS.createGeometry=function(e){return _u.createGeometry(e._ellipseGeometry)};var mq=eS;function Vet(e){Q("createWorldTerrain","createWorldTerrain was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldTerrainAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=new Xy({requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)});return t._readyPromise=Xy._initializeReadyPromise({url:Zs.fromAssetId(1),requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)},t),t}var hq=Vet;function zet(e){return e=y(e,y.EMPTY_OBJECT),Xy.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)})}var Zb=zet;function tS(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ji({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new vt(n)),this._credit=n,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(tS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("CustomHeightmapTerrainProvider.ready","CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("CustomHeightmapTerrainProvider.readyPromise","CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});tS.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Ia({buffer:c,width:o,height:s})})};tS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};tS.prototype.getTileDataAvailable=function(e,t,n){};tS.prototype.loadTileDataAvailability=function(e,t,n){};var pq=tS;var Het=1953029805,Get=2917034100;function _q(e,t){if(_q.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new de("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===Het||r===Get)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}_q.passThroughDataForTesting=!1;var aN=_q;function zpe(e){this.proxy=e}zpe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var gq=zpe;function mm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(mm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});mm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new mm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};mm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};mm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Hpe(this,t)};mm.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Hpe(this,i),t};mm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Gpe(this,0)),this._array[e-1]=void 0,t};mm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=yq(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Gpe(this,n)}return this._array[e-1]=void 0,t};mm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};mm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[yq(this,1,2)?1:2]};function _4(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function cN(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function yq(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Hpe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=cN(e,t,i);for(r!==n&&(_4(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(cN(e,t,o)!==r)break;_4(e,t,o),t=o}}function Gpe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){cN(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;cN(e,f,o)===i&&(o=f)}}if(cN(e,o,t)===i&&(_4(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);yq(e,o,a)===i&&_4(e,o,a)}t=o}}var $b=mm;function nS(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ji({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._levelZeroMaximumGeometricError=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(nS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("EllipsoidTerrainProvider.ready","EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("EllipsoidTerrainProvider.readyPromise","EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});nS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Ia({buffer:new Uint8Array(16*16),width:16,height:16}))};nS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nS.prototype.getTileDataAvailable=function(e,t,n){};nS.prototype.loadTileDataAvailability=function(e,t,n){};var Qb=nS;function Ih(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ts,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function xq(e){let t=e.top,n=e.bottom,i=e.right,r=e.left,o=e.near,s=e.far;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(Ih.prototype,{projectionMatrix:{get:function(){return xq(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return xq(this),this._infinitePerspective}}});var Wet=new m,jet=new m,qet=new m,Yet=new m;Ih.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,Wet),d=jet;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=qet;m.multiplyByScalar(t,u,p),m.add(e,p,p);let g=Yet;m.multiplyByScalar(f,a,g),m.add(d,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let h=i[0];return l(h)||(h=i[0]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(f,s,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),h=i[1],l(h)||(h=i[1]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(f,g,g),m.normalize(g,g),h=i[2],l(h)||(h=i[2]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(g,f,g),m.normalize(g,g),h=i[3],l(h)||(h=i[3]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),h=i[4],l(h)||(h=i[4]=new oe),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,d),m.negate(t,g),h=i[5],l(h)||(h=i[5]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,p),this._cullingVolume};Ih.prototype.getPixelDimensions=function(e,t,n,i,r){xq(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};Ih.prototype.clone=function(e){return l(e)||(e=new Ih),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ih.prototype.equals=function(e){return l(e)&&e instanceof Ih&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ih.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ih&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Zc=Ih;function Fl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Zc,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Fl.packedLength=6;Fl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Fl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Fl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function hm(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(Fl.prototype,{projectionMatrix:{get:function(){return hm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return hm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return hm(this),this._fovy}},sseDenominator:{get:function(){return hm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return hm(this),this._offCenterFrustum}}});Fl.prototype.computeCullingVolume=function(e,t,n){return hm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Fl.prototype.getPixelDimensions=function(e,t,n,i,r){return hm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Fl.prototype.clone=function(e){return l(e)||(e=new Fl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Fl.prototype.equals=function(e){return!l(e)||!(e instanceof Fl)?!1:(hm(this),hm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Fl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Fl)?!1:(hm(this),hm(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ii=Fl;var g4=0,Xet=1;function eC(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e._drawNearPlane,!0),s,a;t instanceof Ii?(s=g4,a=Ii.packedLength):t instanceof nn&&(s=Xet,a=nn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Ne.packedLength+Oe.packedLength}eC.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===g4?(Ii.pack(r,t,n),n+=Ii.packedLength):(nn.pack(r,t,n),n+=nn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Ket=new Ii,Jet=new nn,Zet=new Ne,$et=new m,Qet=new Oe;eC.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===g4?(r=Ii.unpack(e,t,Ket),t+=Ii.packedLength):(r=nn.unpack(e,t,Jet),t+=nn.packedLength);let o=m.unpack(e,t,$et);t+=m.packedLength;let s=Ne.unpack(e,t,Zet);t+=Ne.packedLength;let a=Oe.unpack(e,t,Qet);t+=Oe.packedLength;let c=e[t]===1;if(!l(n))return new eC({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Ne.clone(s,n._orientation),n._vertexFormat=Oe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function iS(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var ett=new $,ttt=new F,bq=new F,Wpe=new m,jpe=new m,qpe=new m,ntt=new m,itt=new m,rtt=new m,Ky=new Array(3),lN=new Array(4);lN[0]=new oe(-1,-1,1,1);lN[1]=new oe(1,-1,1,1);lN[2]=new oe(1,1,1,1);lN[3]=new oe(-1,1,1,1);var Ype=new Array(4);for(let e=0;e<4;++e)Ype[e]=new oe;eC._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,ett),u=y(o,Wpe),f=y(s,jpe),d=y(a,qpe);u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),m.normalize(u,u),m.normalize(f,f),m.normalize(d,d),m.negate(u,u);let p=F.computeView(e,d,f,u,ttt),g,h,x=i.projectionMatrix;if(n===g4){let b=F.multiply(x,p,bq);h=F.inverse(b,bq)}else g=F.inverseTransformation(p,bq);l(h)?(Ky[0]=i.near,Ky[1]=i.far):(Ky[0]=0,Ky[1]=i.near,Ky[2]=i.far);for(let b=0;b<2;++b)for(let C=0;C<4;++C){let A=oe.clone(lN[C],Ype[C]);if(l(h)){A=F.multiplyByVector(h,A,A);let T=1/A.w;m.multiplyByScalar(A,T,A),m.subtract(A,e,A),m.normalize(A,A);let S=m.dot(d,A);m.multiplyByScalar(A,Ky[b]/S,A),m.add(A,e,A)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let S=Ky[b],v=Ky[b+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(S-v)-S-v)*.5,A.w=1,F.multiplyByVector(g,A,A)}r[12*b+C*3]=A.x,r[12*b+C*3+1]=A.y,r[12*b+C*3+2]=A.z}};eC.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(3*4*6);eC._computeNearFarPlanes(i,r,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[3+1],c[u+5]=c[3+2],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[3+1],c[u+2]=c[3+2],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],o||(c=c.subarray(3*4));let f=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,h=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=Wpe,C=jpe,A=qpe,T=m.negate(b,ntt),S=m.negate(C,itt),v=m.negate(A,rtt);u=0,o&&(iS(u,p,g,h,x,v,b,C),u+=3*4),iS(u,p,g,h,x,A,T,C),u+=3*4,iS(u,p,g,h,x,T,v,C),u+=3*4,iS(u,p,g,h,x,S,v,T),u+=3*4,iS(u,p,g,h,x,b,A,C),u+=3*4,iS(u,p,g,h,x,C,A,T),l(p)&&(f.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),l(h)&&(f.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),l(x)&&(f.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,h=p*4;d[g]=h,d[g+1]=h+1,d[g+2]=h+2,d[g+3]=h,d[g+4]=h+2,d[g+5]=h+3}return new ft({attributes:f,indices:d,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var tC=eC;var Cq=0,ott=1;function uN(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e._drawNearPlane,!0),o,s;t instanceof Ii?(o=Cq,s=Ii.packedLength):t instanceof nn&&(o=ott,s=nn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Ne.packedLength}uN.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===Cq?(Ii.pack(r,t,n),n+=Ii.packedLength):(nn.pack(r,t,n),n+=nn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var stt=new Ii,att=new nn,ctt=new Ne,ltt=new m;uN.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===Cq?(r=Ii.unpack(e,t,stt),t+=Ii.packedLength):(r=nn.unpack(e,t,att),t+=nn.packedLength);let o=m.unpack(e,t,ltt);t+=m.packedLength;let s=Ne.unpack(e,t,ctt);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new uN({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Ne.clone(s,n._orientation),n._drawNearPlane=a,n};uN.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(3*4*2);tC._computeNearFarPlanes(i,r,t,n,s);let a=new pn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new ft({attributes:a,indices:d,primitiveType:Le.LINES,boundingSphere:ae.fromVertices(s)})};var fN=uN;function y4(){fe.throwInstantiationError()}Object.defineProperties(y4.prototype,{credit:{get:fe.throwInstantiationError}});y4.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(vt.getIonCredit)};y4.prototype.geocode=fe.throwInstantiationError;var rS=y4;var utt={SEARCH:0,AUTOCOMPLETE:1},Jy=Object.freeze(utt);function Xpe(){fe.throwInstantiationError()}Xpe.createGeometry=function(e){fe.throwInstantiationError()};var Tq=Xpe;function ftt(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var dN=ftt;var gtt=Ki(Aq(),1);function dtt(e,t){return(e&t)!==0}var hc=dtt;var mtt=[1,2,4,8],Kpe=15,htt=16,ptt=64,_tt=128;function Ph(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}Ph.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Ph(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Ph.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Ph.prototype.hasSubtree=function(){return hc(this._bits,htt)};Ph.prototype.hasImagery=function(){return hc(this._bits,ptt)};Ph.prototype.hasTerrain=function(){return hc(this._bits,_tt)};Ph.prototype.hasChildren=function(){return hc(this._bits,Kpe)};Ph.prototype.hasChild=function(e){return hc(this._bits,mtt[e])};Ph.prototype.getChildBitmask=function(){return this._bits&Kpe};var mN=Ph;function ytt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var xtt=ytt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB +\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Pu(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),l(e)){Q("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof Ie)&&(t=e.url);let n=Ie.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=Zpe(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(r){let o=`An error occurred while accessing ${wq(i,"",1).url}.`;return Promise.reject(new de(o))})}}Object.defineProperties(Pu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});Pu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ie)&&(t=e.url);let n=Ie.createIfNeeded(t);n.appendForwardSlash();let i=new Pu;i._resource=n;try{await Zpe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${wq(i,"",1).url}: ${r}`;throw new de(o)}return i};Pu.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;hc(t,o)?hc(e,o)&&(s|=1):(s|=2,hc(e,o)||(s|=1)),i+=s}return i};Pu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];hc(s,2)?hc(s,1)||(t|=o):(n|=o,hc(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Pu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Jpe=new bi("decodeGoogleEarthEnterprisePacket");Pu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let r=wq(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return Jpe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let h=u[e];f=o[e],f._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,x){return h.length-x.length});let g=p.length;for(let h=0;h<g;++h){let x=p[h];if(u[x]!==null){let C=mN.clone(u[x]),A=x.length;if(A===d)C.setParent(f);else if(A>1){let T=o[x.substring(0,x.length-1)];C.setParent(T)}o[x]=C}else o[x]=null}})})};Pu.prototype.populateSubtree=function(e,t,n,i){let r=Pu.tileXYToQuadKey(e,t,n);return vq(this,r,i)};function vq(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new jr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),vq(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new jr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),vq(e,t,s)}).finally(function(){delete a[r]})}Pu.prototype.getTileInformation=function(e,t,n){let i=Pu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Pu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function wq(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Eq,Sq;function Zpe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Sq)){let n=tn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Sq=I0(n).then(function(){Eq=window.cesiumGoogleEarthDbRootParser(gtt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Sq.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Eq.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return Jpe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Eq.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let r=e.providers,o=y(i.providerInfo,[]),s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new vt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=xtt})}var pm=Pu;function nC(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(nC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var e_e="createVerticesFromGoogleEarthEnterpriseBuffer",btt=new bi(e_e),Ctt=new bi(e_e,fm.maximumAsynchronousTasks),$pe=new ce,Iq=new ce;nC.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,$pe),t.tileXYToRectangle(n,i,r,Iq);let u=c.cartographicToCartesian(ce.center(Iq)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?Ctt:btt).scheduleTask({buffer:this._buffer,nativeRectangle:$pe,rectangle:Iq,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let h=this;return g.then(function(x){return h._mesh=new kf(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),m.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,On.clone(x.orientedBoundingBox),dc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),h._minimumHeight=x.minimumHeight,h._maximumHeight=x.maximumHeight,h._buffer=void 0,h._mesh})};nC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),r=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?vtt(this,i,r):Ptt(this,i,r,e)};var Ttt=new bi("upsampleQuantizedTerrainMesh",fm.maximumAsynchronousTasks);nC.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Ttt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(h){let x=new Uint16Array(h.vertices),b=Be.createTypedArray(x.length/3,h.indices),C=g._skirtHeight;return new Jb({quantizedVertices:x,indices:b,minimumHeight:h.minimumHeight,maximumHeight:h.maximumHeight,boundingSphere:ae.clone(h.boundingSphere),orientedBoundingBox:On.clone(h.orientedBoundingBox),horizonOcclusionPoint:m.clone(h.horizonOcclusionPoint),westIndices:h.westIndices,southIndices:h.southIndices,eastIndices:h.eastIndices,northIndices:h.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};nC.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};nC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Att=new H,Ett=new H,Stt=new H,t_e=new m;function vtt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,Att),g=o.decodeTextureCoordinates(r,f,Ett),h=o.decodeTextureCoordinates(r,d,Stt),x=O_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,t_e);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=o.decodeHeight(r,u),C=o.decodeHeight(r,f),A=o.decodeHeight(r,d);return x.x*b+x.y*C+x.z*A}}}var wtt=Uint16Array.BYTES_PER_ELEMENT,Qpe=Uint32Array.BYTES_PER_ELEMENT,Pq=Int32Array.BYTES_PER_ELEMENT,Itt=Float32Array.BYTES_PER_ELEMENT,Dq=Float64Array.BYTES_PER_ELEMENT;function Ptt(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=Qpe;u+=Qpe,u+=2*Dq;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=Dq;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=Dq;let p=i.width/f/2,g=i.height/d/2,h=c.getInt32(u,!0);u+=Pq;let x=c.getInt32(u,!0)*3;u+=Pq,u+=Pq;let b=new Array(h),C=new Array(h),A=new Array(h),T;for(T=0;T<h;++T)b[T]=s+c.getUint8(u++)*p,C[T]=a+c.getUint8(u++)*g,A[T]=c.getFloat32(u,!0)*6371010,u+=Itt;let S=new Array(x);for(T=0;T<x;++T)S[T]=c.getUint16(u,!0),u+=wtt;for(T=0;T<x;T+=3){let v=S[T],I=S[T+1],O=S[T+2],R=b[v],L=b[I],N=b[O],_=C[v],E=C[I],w=C[O],P=O_.computeBarycentricCoordinates(t,n,R,_,L,E,N,w,t_e);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*A[v]+P.y*A[I]+P.z*A[O]}}var oS=nC;var Uf={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},x4=new ee;function b4(){this._terrainCache={},this._lastTidy=ee.now()}b4.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};b4.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};b4.prototype.tidy=function(){if(ee.now(x4),ee.secondsDifference(x4,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];ee.secondsDifference(x4,o.timestamp)>10&&delete e[r]}ee.clone(x4,this._lastTidy)}};function Zy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new vt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new b4,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=Ie.createIfNeeded(e.url),i=this,r;this._readyPromise=pm.fromUrl(n).then(o=>{if(!o.terrainPresent){let s=new de(`The server ${o.url} doesn't have terrain`);return Promise.reject(s)}return Ti.reportSuccess(r),i._metadata=o,i._ready=!0,!0}).catch(o=>{throw r=Ti.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),o})}else if(l(e.metadata)){Q("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(Zy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Zy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new Zy(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var Dtt=new bi("decodeGoogleEarthEnterprisePacket");function n_e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Uf.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}Zy.prototype.requestTileGeometry=function(e,t,n,i){let r=pm.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new de("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Uf.UNKNOWN);let u=o.get(r);if(l(u)){let C=s.providers[a.terrainProvider];return Promise.resolve(new oS({buffer:u,childTileMask:n_e(r,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Uf.NONE)return Promise.reject(new de("Terrain tile doesn't exist"))}else return Promise.resolve(new Ia({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=r,p=-1;switch(c){case Uf.SELF:p=a.terrainVersion;break;case Uf.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Uf.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new de("Terrain tile doesn't exist"));let g=this._terrainPromises,h=this._terrainRequests,x,b;if(l(g[d]))x=g[d],b=h[d];else{b=i;let C=Rtt(this,d,p,b).fetchArrayBuffer();if(!l(C))return;x=C.then(function(A){return l(A)?Dtt.scheduleTask({buffer:A,type:"Terrain",key:s.key},[A]).then(function(T){let S=s.getTileInformationFromQuadKey(d);S.terrainState=Uf.SELF,o.add(d,T[0]);let v=S.terrainProvider,I=T.length-1;for(let O=0;O<I;++O){let R=d+O.toString(),L=s.getTileInformationFromQuadKey(R);l(L)&&(o.add(R,T[O+1]),L.terrainState=Uf.PARENT,L.terrainProvider===0&&(L.terrainProvider=v))}}):Promise.reject(new de("Failed to load terrain."))}),g[d]=x,h[d]=b,x=x.finally(function(){delete g[d],delete h[d]})}return x.then(function(){let C=o.get(r);if(l(C)){let A=s.providers[a.terrainProvider];return new oS({buffer:C,childTileMask:n_e(r,a,s),credits:l(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new de("Failed to load terrain."))}).catch(function(C){return b.state===ni.CANCELLED?(i.state=b.state,Promise.reject(C)):(a.terrainState=Uf.NONE,Promise.reject(C))})};Zy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Zy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=pm.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===Uf.NONE)return!1;if((!l(s)||s===Uf.UNKNOWN)&&(o.terrainState=Uf.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new jr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};Zy.prototype.loadTileDataAvailability=function(e,t,n){};function Rtt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Rq=Zy;var C4,i_e="AIzaSyBqCv5lozjjhtIQ_pZuj2obyAL9bTJdY28",T4={};T4.defaultApiKey=i_e;T4.mapTilesApiEndpoint=new Ie({url:"https://tile.googleapis.com/v1/"});T4.getDefaultApiKeyCredit=function(e){if(e===i_e){if(!l(C4)){let t=`<b> This application is using CesiumJS's default Google Maps API key. Please assign <i>Cesium.GoogleMaps.defaultApiKey</i> with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>`;C4=new vt(t,!0),C4._isDefaultToken=!0}return C4}};var iC=T4;function Ott(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var hN=Ott;var g_e={},Mtt=32.184,Ltt=2451545,r_e=-.0529921,o_e=-.1059842,s_e=13.0120009,a_e=13.3407154,c_e=.9856003,l_e=26.4057084,u_e=13.064993,f_e=.3287146,d_e=1.7484877,m_e=-.1589763,h_e=.0036096,p_e=.1643573,__e=12.9590088,Oq=new ee;g_e.ComputeMoon=function(e,t){l(e)||(e=ee.now()),Oq=ee.addSeconds(e,Mtt,Oq);let n=ee.totalDays(Oq)-Ltt,i=n/Qn.DAYS_PER_JULIAN_CENTURY,r=(125.045+r_e*n)*D.RADIANS_PER_DEGREE,o=(250.089+o_e*n)*D.RADIANS_PER_DEGREE,s=(260.008+s_e*n)*D.RADIANS_PER_DEGREE,a=(176.625+a_e*n)*D.RADIANS_PER_DEGREE,c=(357.529+c_e*n)*D.RADIANS_PER_DEGREE,u=(311.589+l_e*n)*D.RADIANS_PER_DEGREE,f=(134.963+u_e*n)*D.RADIANS_PER_DEGREE,d=(276.617+f_e*n)*D.RADIANS_PER_DEGREE,p=(34.226+d_e*n)*D.RADIANS_PER_DEGREE,g=(15.134+m_e*n)*D.RADIANS_PER_DEGREE,h=(119.743+h_e*n)*D.RADIANS_PER_DEGREE,x=(239.961+p_e*n)*D.RADIANS_PER_DEGREE,b=(25.053+__e*n)*D.RADIANS_PER_DEGREE,C=Math.sin(r),A=Math.sin(o),T=Math.sin(s),S=Math.sin(a),v=Math.sin(c),I=Math.sin(u),O=Math.sin(f),R=Math.sin(d),L=Math.sin(p),N=Math.sin(g),_=Math.sin(h),E=Math.sin(x),w=Math.sin(b),P=Math.cos(r),M=Math.cos(o),B=Math.cos(s),V=Math.cos(a),U=Math.cos(c),G=Math.cos(u),k=Math.cos(f),Y=Math.cos(d),j=Math.cos(p),J=Math.cos(g),W=Math.cos(h),K=Math.cos(x),Z=Math.cos(b),he=(269.9949+.0031*i-3.8787*C-.1204*A+.07*T-.0172*S+.0072*I-.0052*N+.0043*w)*D.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*P+.0239*M-.0278*B+.0068*V-.0029*G+9e-4*k+8e-4*J-9e-4*Z)*D.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*A-.0642*T+.0158*S+.0252*v-.0066*I-.0047*O-.0046*R+.0028*L+.0052*N+.004*_+.0019*E-.0044*w)*D.RADIANS_PER_DEGREE,pe=(13.17635815-14e-13*(2*n)+3.561*P*r_e+.1208*M*o_e-.0642*B*s_e+.0158*V*a_e+.0252*U*c_e-.0066*G*l_e-.0047*k*u_e-.0046*Y*f_e+.0028*j*d_e+.0052*J*m_e+.004*W*h_e+.0019*K*p_e-.0044*Z*__e)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new hN),t.rightAscension=he,t.declination=ge,t.rotation=se,t.rotationRate=pe,t};var pN=g_e;function y_e(e){(!l(e)||typeof e!="function")&&(e=pN.ComputeMoon),this._computeFunction=e}var Ntt=new m,Ftt=new m,Btt=new m;function ktt(e,t,n){let i=Ntt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=Btt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=m.cross(o,i,Ftt);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var Utt=new $,Vtt=new Ne;y_e.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=ktt(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Ne.fromAxisAngle(m.UNIT_Z,r,Vtt),s=$.fromQuaternion(Ne.conjugate(o,o),Utt);return $.multiply(s,i,i)};var _N=y_e;var gN={};gN.type=void 0;gN.getRequiredDataPoints=fe.throwInstantiationError;gN.interpolateOrderZero=fe.throwInstantiationError;gN.interpolate=fe.throwInstantiationError;var Mq=gN;function Lq(e){this._url=Ie.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Lq.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Lq.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Jy.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=m.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var yN=Lq;function Nq(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,bd.defaultAccessToken),n=Ie.createIfNeeded(y(e.server,bd.defaultServer));n.appendForwardSlash();let i=bd.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(vt.clone(i));let r=n.getDerivedResource({url:"v1/geocode"});l(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new yN(r)}Object.defineProperties(Nq.prototype,{credit:{get:function(){}}});Nq.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var xN=Nq;var ztt={SHIFT:0,CTRL:1,ALT:2},la=Object.freeze(ztt);function A4(){fe.throwInstantiationError()}Object.defineProperties(A4.prototype,{ellipsoid:{get:fe.throwInstantiationError}});A4.prototype.project=fe.throwInstantiationError;A4.prototype.unproject=fe.throwInstantiationError;var Fq=A4;var Bq=[],kq=[];function Htt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Bq,u=kq,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],h=u[d];f<s&&(d>=a||t(g,h,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=h,++d)}}function Uq(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Uq(e,t,n,i,o),Uq(e,t,n,o+1,r),Htt(e,t,n,i,o,r)}function Gtt(e,t,n){let i=e.length,r=Math.ceil(i*.5);Bq.length=r,kq.length=r,Uq(e,t,n,0,i-1),Bq.length=0,kq.length=0}var L_=Gtt;function sS(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(sS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});sS.prototype.findTimeInterval=lr.prototype.findTimeInterval;sS.prototype.wrapTime=lr.prototype.wrapTime;sS.prototype.clampTime=lr.prototype.clampTime;sS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var Vq=sS;var Wtt={NONE:-1,PARTIAL:0,FULL:1},mo=Object.freeze(Wtt);function pc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var E4=new m;Object.defineProperties(pc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,E4),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=m.multiplyByScalar(t,n,E4);let a=r*r*n;s=m.add(e,m.multiplyByScalar(o,a,E4),E4)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});pc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new pc(e,t)};var b_e=new m;pc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,b_e),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var jtt=new m;pc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,jtt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,b_e),r=this._occluderRadius-n;if(r=m.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),r*r+n*n>m.magnitudeSquared(i)):!1;if(r>0){i=m.subtract(t,this._cameraPosition,i);let o=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var qtt=new m;pc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return mo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,qtt),r=this._occluderRadius-n,o=m.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return r*r+n*n<s?mo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?mo.FULL:mo.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?mo.PARTIAL:mo.FULL))}}return mo.NONE};var S4=new m;pc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),r=m.clone(e.center),o=e.radius,s=n.length,a=m.normalize(m.subtract(i,r,S4),S4),c=-m.dot(a,r),u=pc._anyRotationVector(r,a,c),f=pc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=pc._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return m.add(r,m.multiplyByScalar(a,p,S4),S4)};var Ytt=[];pc.computeOccludeePointFromRectangle=function(e,t){t=y(t,re.WGS84);let n=ce.subsample(e,t,0,Ytt),i=ae.fromPoints(n),r=m.ZERO;if(!m.equals(r,i.center))return pc.computeOccludeePoint(new ae(r,t.minimumRadius),i.center,n)};var Xtt=new m;pc._anyRotationVector=function(e,t,n){let i=m.abs(t,Xtt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new m,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,o),i),e,i),i)};var Ktt=new m;pc._rotationVector=function(e,t,n,i,r){let o=m.subtract(i,e,Ktt);if(o=m.normalize(o,o),m.dot(t,o)<.9999999847691291){let s=m.cross(t,o,o);if(m.magnitude(s)>D.EPSILON13)return m.normalize(s,new m)}return r};var zq=new m,Jtt=new m,v4=new m,x_e=new m;pc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=m.clone(r,zq),s=m.clone(e.center,Jtt),a=e.radius,c=m.subtract(s,o,v4),u=m.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),h=1/Math.sqrt(u),b=p*h*p;c=m.normalize(c,c);let C=m.add(o,m.multiplyByScalar(c,b,x_e),x_e),A=Math.sqrt(d-b*b),T=this._rotationVector(s,t,n,o,i),S=m.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,zq);S=m.normalize(S,S);let v=m.multiplyByScalar(S,A,zq);T=m.normalize(m.subtract(m.add(C,v,v4),s,v4),v4);let I=m.dot(t,T);T=m.normalize(m.subtract(m.subtract(C,v,T),s,T),T);let O=m.dot(t,T);return I<O?I:O};var bN=pc;function Hq(e,t,n){e=Ie.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new vt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Hq.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Hq.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:gt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ce.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;r=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var Gq=Hq;var Ztt={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},Wq=Ztt;var $tt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},jq=$tt;var Qtt=new m;function ent(e,t,n,i){let r=H0(e,t,n,i,Qtt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var qq=ent;function C_e(){fe.throwInstantiationError()}C_e.prototype.getURL=fe.throwInstantiationError;var Yq=C_e;var tnt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(tnt);function $y(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=(t.clientX-r.left)*(i.offsetWidth/r.width),n.y=(t.clientY-r.top)*(i.offsetHeight/r.height),n}function Qq(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function rC(e){if(e.shiftKey)return la.SHIFT;if(e.ctrlKey)return la.CTRL;if(e.altKey)return la.ALT}var ys={LEFT:0,MIDDLE:1,RIGHT:2};function Du(e,t,n,i){function r(o){i(e,o)}Wt.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function nnt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Wt.supportsPointerEvents()?(Du(e,"pointerdown",t,cnt),Du(e,"pointerup",t,R_e),Du(e,"pointermove",t,lnt),Du(e,"pointercancel",t,R_e)):(Du(e,"mousedown",t,O_e),Du(e,"mouseup",n,M_e),Du(e,"mousemove",n,L_e),Du(e,"touchstart",t,snt),Du(e,"touchend",n,v_e),Du(e,"touchmove",n,ant),Du(e,"touchcancel",n,v_e)),Du(e,"dblclick",t,rnt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Du(e,i,t,ont)}function int(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var T_e={position:new H};function eY(e){e._lastSeenTouchEvent=Ci()}function tY(e){return Ci()-e._lastSeenTouchEvent>_m.mouseEmulationIgnoreMilliseconds}function $q(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function O_e(e,t){if(!tY(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ys.LEFT)i=Cn.LEFT_DOWN;else if(n===ys.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===ys.RIGHT)i=Cn.RIGHT_DOWN;else return;let r=$y(e,t,e._primaryPosition);H.clone(r,e._primaryStartPosition),H.clone(r,e._primaryPreviousPosition);let o=rC(t),s=e.getInputAction(i,o);l(s)&&(H.clone(r,T_e.position),s(T_e),t.preventDefault())}var A_e={position:new H},E_e={position:new H};function Xq(e,t,n,i){let r=rC(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=$y(e,i,e._primaryPosition);if(l(o)&&(H.clone(a,A_e.position),o(A_e)),l(s)){let c=e._primaryStartPosition;$q(c,a,e._clickPixelTolerance)&&(H.clone(a,E_e.position),s(E_e))}}}function M_e(e,t){if(!tY(e))return;let n=t.button;n!==ys.LEFT&&n!==ys.MIDDLE&&n!==ys.RIGHT||(e._buttonDown[ys.LEFT]&&(Xq(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[ys.LEFT]=!1),e._buttonDown[ys.MIDDLE]&&(Xq(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[ys.MIDDLE]=!1),e._buttonDown[ys.RIGHT]&&(Xq(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[ys.RIGHT]=!1))}var Kq={startPosition:new H,endPosition:new H};function L_e(e,t){if(!tY(e))return;let n=rC(t),i=$y(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(Cn.MOUSE_MOVE,n);l(o)&&(H.clone(r,Kq.startPosition),H.clone(i,Kq.endPosition),o(Kq)),H.clone(i,r),(e._buttonDown[ys.LEFT]||e._buttonDown[ys.MIDDLE]||e._buttonDown[ys.RIGHT])&&t.preventDefault()}var S_e={position:new H};function rnt(e,t){let n=t.button,i;if(n===ys.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let r=rC(t),o=e.getInputAction(i,r);l(o)&&($y(e,t,S_e.position),o(S_e))}function ont(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=rC(t),r=e.getInputAction(Cn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function snt(e,t){eY(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,$y(e,o,new H));w4(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,H.clone(a.get(s)))}function v_e(e,t){eY(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);w4(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var w_e={position:new H},Jq={position1:new H,position2:new H},I_e={position:new H},P_e={position:new H},D_e={position:new H};function w4(e,t){let n=rC(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[ys.LEFT]){if(e._buttonDown[ys.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(Cn.LEFT_UP,n),l(o)&&(H.clone(e._primaryPosition,I_e.position),o(I_e)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];$q(c,u,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,P_e.position),s(P_e))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(Cn.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];H.clone(c,e._primaryPosition),H.clone(c,e._primaryStartPosition),H.clone(c,e._primaryPreviousPosition),e._buttonDown[ys.LEFT]=!0,o=e.getInputAction(Cn.LEFT_DOWN,n),l(o)&&(H.clone(c,w_e.position),o(w_e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];$q(u,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,D_e.position),s(D_e))}},_m.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(Cn.PINCH_START,n),l(o)&&(H.clone(i.values[0],Jq.position1),H.clone(i.values[1],Jq.position2),o(Jq),t.preventDefault()))}function ant(e,t){eY(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&$y(e,o,u)}N_e(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,H.clone(a.get(s),c.get(s))}var Zq={startPosition:new H,endPosition:new H},CN={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function N_e(e,t){let n=rC(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[ys.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),l(s)&&(H.clone(c,Zq.startPosition),H.clone(a,Zq.endPosition),s(Zq)),H.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,h=f.x-u.x,x=f.y-u.y,b=Math.sqrt(h*h+x*x)*.25,C=(c.y+a.y)*.125,A=(f.y+u.y)*.125,T=Math.atan2(p,d),S=Math.atan2(x,h);H.fromElements(0,b,CN.distance.startPosition),H.fromElements(0,g,CN.distance.endPosition),H.fromElements(S,A,CN.angleAndHeight.startPosition),H.fromElements(T,C,CN.angleAndHeight.endPosition),s(CN)}}function cnt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,$y(e,t,new H)),w4(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else O_e(e,t)}function R_e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),w4(e,t),e._previousPositions.remove(i)}else M_e(e,t)}function lnt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;$y(e,t,r),N_e(e,t);let o=e._previousPositions;H.clone(n.get(i),o.get(i))}else L_e(e,t)}function _m(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-_m.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new Tt,this._previousPositions=new Tt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),nnt(this)}_m.prototype.setInputAction=function(e,t,n){let i=Qq(t,n);this._inputEvents[i]=e};_m.prototype.getInputAction=function(e,t){let n=Qq(e,t);return this._inputEvents[n]};_m.prototype.removeInputAction=function(e,t){let n=Qq(e,t);delete this._inputEvents[n]};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return int(this),ue(this)};_m.mouseEmulationIgnoreMilliseconds=800;_m.touchHoldDelayMilliseconds=1500;var Ru=_m;var nY={};function unt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var fnt=32.184,dnt=2451545;function ege(e,t){t=ee.addSeconds(e,fnt,t);let n=ee.totalDays(t)-dnt;return t=ee.addSeconds(t,unt(n),t),t}var I4=new ee(2451545,0,Zn.TAI),mnt=1e3,Vf=D.RADIANS_PER_DEGREE,Ou=D.RADIANS_PER_ARCSECOND,Pa=14959787e4,F_e=new $;function tge(e,t,n,i,r,o,s){n<0&&(n=-n,r+=D.PI);let a=e*(1-t),c=i-r,u=r,f=pnt(o-i,t),d=hnt(t,0);bnt(c,n,u,F_e);let p=a*(1+t),g=Math.cos(f),h=Math.sin(f),x=1+t*g,b=p/x;return l(s)?(s.x=b*g,s.y=b*h,s.z=0):s=new m(b*g,b*h,0),$.multiplyByVector(F_e,s,s)}function hnt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function pnt(e,t){let n=ynt(e,t);return xnt(n,t)}var _nt=50,gnt=D.EPSILON8;function ynt(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<_nt&&Math.abs(r-i)>gnt;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*D.TWO_PI,r}function xnt(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=D.zeroToTwoPi(o),e<0&&(o-=D.TWO_PI),o+=n*D.TWO_PI,o}function bnt(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var Cnt=1.0000010178*Pa,Tnt=100.46645683*Vf,Ant=129597742283429e-5*Ou,B_e=16002,k_e=21863,U_e=32004,V_e=10931,z_e=14529,H_e=16368,G_e=15318,W_e=32794,Ent=64*1e-7*Pa,Snt=-152*1e-7*Pa,vnt=62*1e-7*Pa,wnt=-8*1e-7*Pa,Int=32*1e-7*Pa,Pnt=-41*1e-7*Pa,Dnt=19*1e-7*Pa,Rnt=-11*1e-7*Pa,Ont=-150*1e-7*Pa,Mnt=-46*1e-7*Pa,Lnt=68*1e-7*Pa,Nnt=54*1e-7*Pa,Fnt=14*1e-7*Pa,Bnt=24*1e-7*Pa,knt=-28*1e-7*Pa,Unt=22*1e-7*Pa,j_e=10,q_e=16002,Y_e=21863,X_e=10931,K_e=1473,J_e=32004,Z_e=4387,$_e=73,Vnt=-325*1e-7,znt=-322*1e-7,Hnt=-79*1e-7,Gnt=232*1e-7,Wnt=-52*1e-7,jnt=97*1e-7,qnt=55*1e-7,Ynt=-41*1e-7,Xnt=-105*1e-7,Knt=-137*1e-7,Jnt=258*1e-7,Znt=35*1e-7,$nt=-116*1e-7,Qnt=-88*1e-7,eit=-112*1e-7,tit=-80*1e-7,aS=new ee(0,0,Zn.TAI);function nit(e,t){ege(e,aS);let i=(aS.dayNumber-I4.dayNumber+(aS.secondsOfDay-I4.secondsOfDay)/Qn.SECONDS_PER_DAY)/(Qn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=Cnt+Ent*Math.cos(B_e*r)+Ont*Math.sin(B_e*r)+Snt*Math.cos(k_e*r)+Mnt*Math.sin(k_e*r)+vnt*Math.cos(U_e*r)+Lnt*Math.sin(U_e*r)+wnt*Math.cos(V_e*r)+Nnt*Math.sin(V_e*r)+Int*Math.cos(z_e*r)+Fnt*Math.sin(z_e*r)+Pnt*Math.cos(H_e*r)+Bnt*Math.sin(H_e*r)+Dnt*Math.cos(G_e*r)+knt*Math.sin(G_e*r)+Rnt*Math.cos(W_e*r)+Unt*Math.sin(W_e*r),s=Tnt+Ant*i+Vnt*Math.cos(j_e*r)+Xnt*Math.sin(j_e*r)+znt*Math.cos(q_e*r)+Knt*Math.sin(q_e*r)+Hnt*Math.cos(Y_e*r)+Jnt*Math.sin(Y_e*r)+Gnt*Math.cos(X_e*r)+Znt*Math.sin(X_e*r)+Wnt*Math.cos(K_e*r)+$nt*Math.sin(K_e*r)+jnt*Math.cos(J_e*r)+Qnt*Math.sin(J_e*r)+qnt*Math.cos(Z_e*r)+eit*Math.sin(Z_e*r)+Ynt*Math.cos($_e*r)+tit*Math.sin($_e*r),a=.0167086342-.0004203654*i,c=102.93734808*Vf+11612.3529*Ou*i,u=469.97289*Ou*i,f=174.87317577*Vf-8679.27034*Ou*i;return tge(o,a,u,c,f,s,t)}function nge(e,t){ege(e,aS);let i=(aS.dayNumber-I4.dayNumber+(aS.secondsOfDay-I4.secondsOfDay)/Qn.SECONDS_PER_DAY)/Qn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Vf,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Vf,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Vf,h=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,x=218.31664563*Vf,b=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,C=297.85019547*Vf+Ou*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),A=93.27209062*Vf+Ou*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Vf+Ou*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),S=357.52910918*Vf+Ou*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Vf-Ou*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),I=2*C,O=4*C,R=6*C,L=2*T,N=3*T,_=4*T,E=2*A;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-T)-235.6*Math.cos(T)+218.1*Math.cos(I-S)+181*Math.cos(I+T),c+=.014216*Math.cos(I-T)+.008551*Math.cos(I-L)-.001383*Math.cos(T)+.001356*Math.cos(I+T)-.001147*Math.cos(O-N)-914e-6*Math.cos(O-L)+869e-6*Math.cos(I-S-T)-627e-6*Math.cos(I)-394e-6*Math.cos(O-_)+282e-6*Math.cos(I-S-L)-279e-6*Math.cos(C-T)-236e-6*Math.cos(L)+231e-6*Math.cos(O)+229e-6*Math.cos(R-_)-201e-6*Math.cos(L-E),f+=486.26*Math.cos(I-E)-40.13*Math.cos(I)+37.51*Math.cos(E)+25.73*Math.cos(L-E)+19.97*Math.cos(I-S-E),p+=-55609*Math.sin(I-T)-34711*Math.sin(I-L)-9792*Math.sin(T)+9385*Math.sin(O-N)+7505*Math.sin(O-L)+5318*Math.sin(I+T)+3484*Math.sin(O-_)-3417*Math.sin(I-S-T)-2530*Math.sin(R-_)-2376*Math.sin(I)-2075*Math.sin(I-N)-1883*Math.sin(L)-1736*Math.sin(R-5*T)+1626*Math.sin(S)-1370*Math.sin(R-N),h+=-5392*Math.sin(I-E)-540*Math.sin(S)-441*Math.sin(I)+423*Math.sin(E)-288*Math.sin(L-E),b+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-T)-662.5*Math.sin(S)+396.3*Math.sin(T)-218*Math.sin(I-S);let w=2*v,P=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(I-E+v)*i+.614*Math.cos(I-E-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(I-E+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(w)*o;let M=2.116*Math.sin(v)*i-.111*Math.sin(I-E-v)*i-.0015*Math.sin(v)*r;p+=M,b+=M,h+=-520.77*Math.sin(v)*i+13.66*Math.sin(I-E+v)*i+1.12*Math.sin(I-v)*i-1.06*Math.sin(E-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(I-E+w)*r-.015*Math.sin(I-E+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(w)*o,a*=mnt;let B=u+f*Ou,V=d+p*Ou,U=x+b*Ou,G=g+h*Ou;return tge(a,c,B,V,G,U,t)}var Q_e=.012300034,iit=Q_e/(Q_e+1)*-1;function rit(e,t){return t=nge(e,t),m.multiplyByScalar(t,iit,t)}var ige=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),TN=new m;nY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),TN=nit(e,TN),t=m.negate(TN,t),rit(e,TN),m.subtract(t,TN,t),$.multiplyByVector(ige,t,t),t};nY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=nge(e,t),$.multiplyByVector(ige,t,t),t};var Qy=nY;function oit(e,t,n,i,r,o,s){let a=Oi.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,h=i.green,x=i.blue,b=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let C=(g-u)/a,A=(h-f)/a,T=(x-d)/a,S=(b-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*C),o[v++]=z.floatToByte(f+c*A),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*S);return v}function AN(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Zt.GEODESIC),this._granularity=y(e.granularity,D.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._workerName="createSimplePolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+re.packedLength+3}AN.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};AN.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new AN({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var P4=new Array(2),D4=new Array(2),sit={positions:P4,height:D4,ellipsoid:void 0,minDistance:void 0,granularity:void 0};AN.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=D.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,h,x=0;if(r===Zt.GEODESIC||r===Zt.RHUMB){let S,v,I;r===Zt.GEODESIC?(S=D.chordLength(o,s.maximumRadius),v=Oi.numberOfPoints,I=Oi.generateArc):(S=o,v=Oi.numberOfPointsRhumbLine,I=Oi.generateRhumbArc);let O=Oi.extractHeights(t,s),R=sit;if(r===Zt.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let L=0;for(u=0;u<f-1;u++)L+=v(t[u],t[u+1],S)+1;d=new Float64Array(L*3),g=new Uint8Array(L*4),R.positions=P4,R.height=D4;let N=0;for(u=0;u<f-1;++u){P4[0]=t[u],P4[1]=t[u+1],D4[0]=O[u],D4[1]=O[u+1];let _=I(R);if(l(n)){let E=_.length/3;h=n[u];for(let w=0;w<E;++w)g[N++]=z.floatToByte(h.red),g[N++]=z.floatToByte(h.green),g[N++]=z.floatToByte(h.blue),g[N++]=z.floatToByte(h.alpha)}d.set(_,x),x+=_.length}}else if(R.positions=t,R.height=O,d=new Float64Array(I(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let N=t[u],_=t[u+1],E=n[u],w=n[u+1];x=oit(N,_,E,w,a,g,x)}let L=n[f-1];g[x++]=z.floatToByte(L.red),g[x++]=z.floatToByte(L.green),g[x++]=z.floatToByte(L.blue),g[x++]=z.floatToByte(L.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let I=t[u];if(c&&u>0&&(m.pack(I,d,S),S+=3,h=n[u-1],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha)),c&&u===f-1)break;m.pack(I,d,S),S+=3,l(n)&&(h=n[u],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha))}}let b=new pn;b.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,A=Be.createTypedArray(p,C),T=0;for(u=0;u<p-1;++u)A[T++]=u,A[T++]=u+1;return new ft({attributes:b,indices:A,primitiveType:Le.LINES,boundingSphere:ae.fromPoints(t)})};var iY=AN;function cS(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new ks(i),this._workerName="createSphereGeometry"}cS.packedLength=ks.packedLength;cS.pack=function(e,t,n){return ks.pack(e._ellipsoidGeometry,t,n)};var ait=new ks,e0={radius:void 0,radii:new m,vertexFormat:new Oe,stackPartitions:void 0,slicePartitions:void 0};cS.unpack=function(e,t,n){let i=ks.unpack(e,t,ait);return e0.vertexFormat=Oe.clone(i._vertexFormat,e0.vertexFormat),e0.stackPartitions=i._stackPartitions,e0.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,e0.radii),n._ellipsoidGeometry=new ks(e0),n):(e0.radius=i._radii.x,new cS(e0))};cS.createGeometry=function(e){return ks.createGeometry(e._ellipsoidGeometry)};var rY=cS;var cit={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=cit;function t0(e){}Object.defineProperties(t0.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});t0.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;t0.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;t0.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;t0.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;t0.prototype.tileXYToRectangle=fe.throwInstantiationError;t0.prototype.positionToTileXY=fe.throwInstantiationError;var oY=t0;function oC(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Ve.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(oC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(oC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=lit(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});oC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};oC.prototype.isDestroyed=function(){return!1};oC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};oC.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=y(this.epoch,Ve.MINIMUM_VALUE),s=ee.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function lit(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var sY=oC;function uit(e,t){this.rectangle=e,this.maxLevel=t}function aY(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}aY.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function fit(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new ji({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Xo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new uit(new ce(a,c,u,f),d))}}function dit(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function rge(e,t,n){try{let i=await t.fetchXML();fit(e,i)}catch(i){dit(t,i,n)}}function n0(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;if(typeof t=="string"&&(t=new vt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[],l(e.url)){Q("VRTheWorldTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. VRTheWorldTerrainProvider.fromUrl instead.");let n=this,i=new aY(e),r=Ie.createIfNeeded(e.url);this._resource=r,this._readyPromise=rge(i,r,n).then(()=>(i.build(n),!0))}}Object.defineProperties(n0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});n0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new aY(t),i=Ie.createIfNeeded(e);await rge(n,i);let r=new n0(t);return n.build(r),r._resource=i,r};n0.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Ia({buffer:sd(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:mit(a,e,t,n),structure:a._terrainDataStructure})})};n0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var oge=new ce;function mit(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ce.intersection(f,s,oge);l(d)&&(R4(r,f,t*2,n*2,i+1)&&(a|=4),R4(r,f,t*2+1,n*2,i+1)&&(a|=8),R4(r,f,t*2,n*2+1,i+1)&&(a|=1),R4(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function R4(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ce.intersection(o,t,oge))}n0.prototype.getTileDataAvailable=function(e,t,n){};n0.prototype.loadTileDataAvailability=function(e,t,n){};var cY=n0;var hit={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},lY=Object.freeze(hit);function pit(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var uY=pit;function _it(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var EN=_it;var sC=`in vec4 position; +in vec2 textureCoordinates; -#define POSITIVE_HIT vec2(t, +INF_HIT); -#define NEGATIVE_HIT vec2(-INF_HIT, t); +out vec2 v_textureCoordinates; -vec2 intersectHalfSpace(Ray ray, float angle) +void main() { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); + gl_Position = position; + v_textureCoordinates = textureCoordinates; +} +`;function O4(e){this._context=e}var SN,git=new tt({primitiveType:Le.TRIANGLES}),yit=new li({color:new z(0,0,0,0)});function xit(e,t){return new ea({context:e,colorTextures:[t],destroyAttachments:!1})}function bit(e,t){return Jt.fromCache({context:e,vertexShaderSource:sC,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Cit(e,t){return(!l(SN)||SN.viewport.width!==e||SN.viewport.height!==t)&&(SN=Ue.fromCache({viewport:new Ye(0,0,e,t)})),SN}O4.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:bit(r,e.fragmentShaderSource),a=xit(r,t),c=Cit(n,i),u=e.uniformMap,f=yit;f.framebuffer=a,f.renderState=c,f.execute(r);let d=git;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};O4.prototype.isDestroyed=function(){return!1};O4.prototype.destroy=function(){return ue(this)};var vN=O4;function Tit(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var _c=Tit;function gm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(gm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});gm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function Ait(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}gm.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new ze({sources:[t]})),typeof n=="string"&&(n=new ze({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?Ait(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Jt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};gm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){fY(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};gm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};gm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new ze({sources:[o]})),typeof s=="string"&&(s=new ze({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Jt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function fY(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];fY(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}gm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];fY(this,n),--this._numberOfShaders}this._shadersToRelease={}};gm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var wN=gm;function aC(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(aC.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});aC.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};aC.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};aC.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};aC.prototype.isDestroyed=function(){return!1};aC.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var IN=aC;function Eit(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var N_=Eit;function lS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ye,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Yn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(lS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ye.equals(e,this._viewport)){Ye.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return sge(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return sge(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return dY(this),this._view3D}},viewRotation:{get:function(){return dY(this),this._viewRotation}},viewRotation3D:{get:function(){return dY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return lge(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return lge(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return Lit(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return Nit(this),this._modelView}},modelView3D:{get:function(){return Fit(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Hit(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Bit(this),this._inverseModelView}},inverseModelView3D:{get:function(){return kit(this),this._inverseModelView3D}},viewProjection:{get:function(){return Uit(this),this._viewProjection}},inverseViewProjection:{get:function(){return Vit(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return zit(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Git(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Wit(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return jit(this),this._modelViewInfiniteProjection}},normal:{get:function(){return qit(this),this._normal}},normal3D:{get:function(){return Yit(this),this._normal3D}},inverseNormal:{get:function(){return Xit(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Kit(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return cge(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return cge(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,re.WGS84)}}});function Sit(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function vit(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function wit(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function Iit(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function Pit(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var PN=new $,Dit=new me;function Rit(e,t){l(Mt.computeIcrfToFixedMatrix(t.time,PN))||(PN=Mt.computeTemeToPseudoFixedMatrix(t.time,PN));let n=Qy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(PN,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Qy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(PN,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,Dit);i.project(o,e._sunPositionColumbusView)}lS.prototype.updateCamera=function(e){Sit(this,e.viewMatrix),vit(this,e.inverseViewMatrix),Pit(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof nn};lS.prototype.updateFrustum=function(e){wit(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&Iit(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};lS.prototype.updatePass=function(e){this._pass=e};var Oit=[],Mit=new N_;lS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),Rit(this,e);let n=y(e.light,Mit);n instanceof N_?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=m.multiplyByScalar(r,n.intensity,r);let o=m.maximumComponent(r);o>1?m.divideByScalar(r,o,this._lightColor):m.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,Oit),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function sge(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function Lit(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function Nit(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function Fit(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function Bit(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function kit(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function Uit(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function Vit(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function zit(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function Hit(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function Git(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Wit(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function jit(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function qit(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.getRotation(t,t),$.transpose(t,t)}}function Yit(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.getRotation(t,t),$.transpose(t,t)}}function Xit(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,F.getMatrix3(e.inverseModelView,e._inverseNormal),$.getRotation(e._inverseNormal,e._inverseNormal))}function Kit(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,F.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),$.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var age=new m;function cge(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,age),Yn.fromCartesian(age,e._encodedCameraPositionMC))}var Jit=new m,Zit=new m,$it=new m,Qit=new m,ert=new me,trt=new m,nrt=new F;function irt(e,t,n,i,r,o,s,a){let c=Jit;c.x=e.y,c.y=e.z,c.z=e.x;let u=Zit;u.x=n.y,u.y=n.z,u.z=n.x;let f=$it;f.x=i.y,f.y=i.z,f.z=i.x;let d=Qit;d.x=t.y,d.y=t.z,d.z=t.x,o===ne.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,ert);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,trt),x=Mt.eastNorthUpToFixedFrame(h,g,nrt);return F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,f,f),F.multiplyByPointAsVector(x,d,d),l(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function dY(e){e._view3DDirty&&(e._mode===ne.SCENE3D?F.clone(e._view,e._view3D):irt(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function lge(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var DN=lS;function Mu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0}=y(t,{});r.alpha=y(r.alpha,!1),r.stencil=y(r.stencil,!0),r.powerPreference=y(r.powerPreference,"high-performance");let s=l(n)?n(e,r):rrt(e,r,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=qn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new wN(this),this._textureCache=new IN;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Ht._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ht._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Ht._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Ht._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Ht._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Ht._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Ht._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Ht._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Ht._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ht._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Ht._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Ht._minimumAliasedLineWidth=f[0],Ht._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Ht._minimumAliasedPointSize=d[0],Ht._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Ht._maximumViewportWidth=p[0],Ht._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Ht._highpFloatSupported=g.precision!==0;let h=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Ht._highpIntSupported=h.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Uo(u,["OES_standard_derivatives"]),this._blendMinmax=!!Uo(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Uo(u,["OES_element_index_uint"]),this._depthTexture=!!Uo(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Uo(u,["EXT_frag_depth"]),this._debugShaders=Uo(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Uo(u,["OES_texture_float"]),this._textureHalfFloat=!!Uo(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Uo(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Uo(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Uo(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Uo(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Uo(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Uo(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Uo(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Uo(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Uo(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Uo(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Uo(u,["EXT_texture_compression_bptc"]),ll.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=o?Uo(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Ht._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,C,A,T,S,v,I,O,R,L;if(c){let w=this;b=function(){return w._gl.createVertexArray()},C=function(P){w._gl.bindVertexArray(P)},A=function(P){w._gl.deleteVertexArray(P)},T=function(P,M,B,V,U){u.drawElementsInstanced(P,M,B,V,U)},S=function(P,M,B,V){u.drawArraysInstanced(P,M,B,V)},v=function(P,M){u.vertexAttribDivisor(P,M)},I=function(P){u.drawBuffers(P)}}else O=Uo(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},C=function(w){O.bindVertexArrayOES(w)},A=function(w){O.deleteVertexArrayOES(w)}),R=Uo(u,["ANGLE_instanced_arrays"]),l(R)&&(T=function(w,P,M,B,V){R.drawElementsInstancedANGLE(w,P,M,B,V)},S=function(w,P,M,B){R.drawArraysInstancedANGLE(w,P,M,B)},v=function(w,P){R.vertexAttribDivisorANGLE(w,P)}),L=Uo(u,["WEBGL_draw_buffers"]),l(L)&&(I=function(w){L.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=C,this.glDeleteVertexArray=A,this.glDrawElementsInstanced=T,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=I,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!L,Ht._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Ht._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new DN,_=new _c(this),E=Ue.fromCache();this._defaultPassState=_,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=E,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Ht._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o},this.cache={},Ue.apply(u,E,_)}function rrt(e,t,n){if(typeof WebGLRenderingContext>"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new de("The browser supports WebGL, but initialization failed.");return o}function ort(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function srt(e,t,n,i){let r=`${ort(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function art(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new de(srt(e,t,n,i))}function crt(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function lrt(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,crt(e,r,t))}return i}function Uo(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var urt={};Object.defineProperties(Mu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=lrt(this._originalGLContext,e?art:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Lt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Lt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Lt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ha({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return urt}}});function uge(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,r,t,o,n,i)}var mY;typeof WebGLRenderingContext<"u"&&(mY=[te.BACK]);function hY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=mY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var frt=new li;Mu.prototype.clear=function(e,t){e=y(e,frt),t=y(t,this._defaultPassState);let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);uge(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);hY(this,c),n.clear(i)};function drt(e,t,n,i,r){hY(e,t),uge(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function mrt(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(a=y(a,o.numberOfVertices),c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Mu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let r=y(e._framebuffer,t.framebuffer),o=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),drt(this,r,t,n,o),mrt(this,e,n,i)};Mu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=mY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Mu.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),r=y(e.width,t.drawingBufferWidth),o=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Xe.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=ct.createTypedArray(ct.RGBA,a,r,o);return hY(this,s),t.readPixels(n,i,r,o,ct.RGBA,Xe.toWebGLConstant(a,this),c),c};var fge={position:0,textureCoordinates:1};Mu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ft({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Le.TRIANGLES});e=si.fromGeometry({context:this,geometry:t,attributeLocations:fge,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Mu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new tt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Le.TRIANGLES,renderState:t.renderState,shaderProgram:Jt.fromCache({context:this,vertexShaderSource:sC,fragmentShaderSource:e,attributeLocations:fge}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Mu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function pY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(pY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});pY.prototype.destroy=function(){delete this._pickObjects[this.key]};Mu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new pY(this._pickObjects,t,z.fromRgba(t))};Mu.prototype.isDestroyed=function(){return!1};Mu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Mu._deprecationWarning=Q;var RN=Mu;function hrt(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[Ie.createIfNeeded(t.positiveX).fetchImage(i),Ie.createIfNeeded(t.negativeX).fetchImage(i),Ie.createIfNeeded(t.positiveY).fetchImage(i),Ie.createIfNeeded(t.negativeY).fetchImage(i),Ie.createIfNeeded(t.positiveZ).fetchImage(i),Ie.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new Ha({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var ON=hrt;var uS=`#ifdef MRT +layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1; +#else +layout (location = 0) out vec4 out_FragColor; +#endif - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); +uniform vec4 u_bgColor; +uniform sampler2D u_depthTexture; - // Half space cuts right through the camera, pick the side to intersect - if (a == 0.0) { - if (b >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; - } - } +in vec2 v_textureCoordinates; - if (t >= 0.0 != s >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; +void main() +{ + if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) + { +#ifdef MRT + out_FragData_0 = u_bgColor; + out_FragData_1 = vec4(u_bgColor.a); +#else + out_FragColor = u_bgColor; +#endif + return; } + + discard; } +`;var F_=`uniform vec3 u_radiiAndDynamicAtmosphereColor; -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); - - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); - - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); - - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; - - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; +uniform float u_atmosphereLightIntensity; +uniform float u_atmosphereRayleighScaleHeight; +uniform float u_atmosphereMieScaleHeight; +uniform float u_atmosphereMieAnisotropy; +uniform vec3 u_atmosphereRayleighCoefficient; +uniform vec3 u_atmosphereMieCoefficient; - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); -} +const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. +const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. +const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); +/** + * Rational approximation to tanh(x) +*/ +float approximateTanh(float x) { + float x2 = x * x; + return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); } -vec2 intersectUnitCylinder(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; - - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; +/** + * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as + * the transmittance value for the ray. + * + * @param {czm_ray} primaryRay The ray from the camera to the position. + * @param {float} primaryRayLength The length of the primary ray. + * @param {vec3} lightDirection The direction of the light to calculate the scattering from. + * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. + * @param {vec3} mieColor The variable the Mie scattering will be written to. + * @param {float} opacity The variable the transmittance will be written to. + * @glslFunction + */ +void computeScattering( + czm_ray primaryRay, + float primaryRayLength, + vec3 lightDirection, + float atmosphereInnerRadius, + out vec3 rayleighColor, + out vec3 mieColor, + out float opacity +) { - if (det < 0.0) { - return vec2(NO_HIT); - } + // Initialize the default scattering amounts to 0. + rayleighColor = vec3(0.0); + mieColor = vec3(0.0); + opacity = 0.0; - det = sqrt(det); - float ta = (-b - det) / a; - float tb = (-b + det) / a; - float t1 = min(ta, tb); - float t2 = max(ta, tb); + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - float z1 = o.z + t1 * d.z; - float z2 = o.z + t2 * d.z; + vec3 origin = vec3(0.0); - if (abs(z1) >= 1.0) - { - float tCap = (sign(z1) - o.z) / d.z; - t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; - } + // Calculate intersection from the camera to the outer ring of the atmosphere. + czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); - if (abs(z2) >= 1.0) - { - float tCap = (sign(z2) - o.z) / d.z; - t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; + // Return empty colors if no intersection with the atmosphere geometry. + if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { + return; } - return vec2(t1, t2); -} - -vec2 intersectUnitCircle(Ray ray) { - vec3 o = ray.pos; - vec3 d = ray.dir; + // To deal with smaller values of PRIMARY_STEPS (e.g. 4) + // we implement a split strategy: sky or horizon. + // For performance reasons, instead of a if/else branch + // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 + float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); + // Value close to 0.0: close to the horizon + // Value close to 1.0: above in the sky + float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); + + // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. + float start_0 = primaryRayAtmosphereIntersect.start; + primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); + // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. + primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); - float t = -o.z / d.z; - vec2 zPlanePos = o.xy + d.xy * t; - float distSqr = dot(zPlanePos, zPlanePos); + // For the number of ray steps, distinguish inside or outside atmosphere (outer space) + // (1) from outer space we have to use more ray steps to get a realistic rendering + // (2) within atmosphere we need fewer steps for faster rendering + float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters + float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); + int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. + int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - if (distSqr > 1.0) { - return vec2(NO_HIT); - } + // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. + float rayPositionLength = primaryRayAtmosphereIntersect.start; + // (1) Outside the atmosphere: constant rayStepLength + // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps + float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; + float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); + float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); - return vec2(t, t); -} + vec3 rayleighAccumulation = vec3(0.0); + vec3 mieAccumulation = vec3(0.0); + vec2 opticalDepth = vec2(0.0); + vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); -vec2 intersectInfiniteUnitCylinder(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + // Sample positions on the primary ray. + for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; + // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= PRIMARY_STEPS) { + break; + } - if (det < 0.0) { - return vec2(NO_HIT); - } + // Calculate sample position along viewpoint ray. + vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + // Calculate height of sample position above ellipsoid. + float sampleHeight = length(samplePosition) - atmosphereInnerRadius; - return vec2(tmin, tmax); -} + // Calculate and accumulate density of particles at the sample position. + vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; + opticalDepth += sampleDensity; -void intersectShape(Ray ray, inout Intersections ix) -{ - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; - ray.dir *= u_cylinderUvToRenderBoundsScale; - #else - // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. - // Direction is scaled as well to be in sync with position. - ray.pos = ray.pos * 2.0 - 1.0; - ray.dir *= 2.0; - #endif + // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. + czm_ray lightRay = czm_ray(samplePosition, lightDirection); + czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); - #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - vec2 outerIntersect = intersectUnitCircle(ray); - #else - vec2 outerIntersect = intersectUnitCylinder(ray); - #endif + float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); + float lightPositionLength = 0.0; - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + vec2 lightOpticalDepth = vec2(0.0); - if (outerIntersect.x == NO_HIT) { - return; - } + // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. + for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - // When the cylinder is perfectly thin it's necessary to sandwich the - // inner cylinder intersection inside the outer cylinder intersection. + // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (j >= LIGHT_STEPS) { + break; + } - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the cylinder to be invisible because it will think the ray - // is still inside the inner (negative) cylinder after exiting the - // outer (positive) cylinder. + // Calculate sample position along light ray. + vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + // Calculate height of the light sample position above ellipsoid. + float lightHeight = length(lightPosition) - atmosphereInnerRadius; - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) - Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); - vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); - #endif + // Calculate density of photons at the light sample position. + lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; - #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #endif -} -`;var kL=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersection, setIntersectionPair, INF_HIT, NO_HIT + // Increment distance on light ray. + lightPositionLength += lightStepLength; + } -/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN -*/ + // Compute attenuation via the primary ray and the light ray. + vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidRenderLongitudeMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) - uniform float u_ellipsoidInverseOuterScaleUv; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - uniform float u_ellipsoidInverseInnerScaleUv; -#endif + // Accumulate the scattering. + rayleighAccumulation += sampleDensity.x * attenuation; + mieAccumulation += sampleDensity.y * attenuation; -vec2 intersectZPlane(Ray ray) -{ - float o = ray.pos.z; - float d = ray.dir.z; - float t = -o / d; - float s = sign(o); + // Increment distance on primary ray. + rayPositionLength += (rayStepLength += rayStepLengthIncrease); + } - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); + // Compute the scattering amount. + rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; + mieColor = u_atmosphereMieCoefficient * mieAccumulation; + + // Compute the transmittance i.e. how much light is passing through the atmosphere. + opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); +vec4 computeAtmosphereColor( + vec3 positionWC, + vec3 lightDirection, + vec3 rayleighColor, + vec3 mieColor, + float opacity +) { + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; + float cosAngle = dot(cameraToPositionWCDirection, lightDirection); + float cosAngleSq = cosAngle * cosAngle; - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + float G = u_atmosphereMieAnisotropy; + float GSq = G * G; - return vec4(-INF_HIT, t, t, +INF_HIT); + // The Rayleigh phase function. + float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); + // The Mie phase function. + float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); + + // The final color is generated by combining the effects of the Rayleigh and Mie scattering. + vec3 rayleigh = rayleighPhase * rayleighColor; + vec3 mie = miePhase * mieColor; + + vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; + + return vec4(color, opacity); } +`;var MN=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; -vec2 intersectHalfSpace(Ray ray, float angle) +float vdcRadicalInverse(int i) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); - - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); - - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; } -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +vec2 hammersley2D(int i, int N) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); - - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); - - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); - - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; - - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; - - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); + return vec2(float(i) / float(N), vdcRadicalInverse(i)); } -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) { - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); + float a = roughness * roughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; } -vec2 intersectUnitSphere(Ray ray) +float G1_Smith(float NdotV, float k) { - vec3 o = ray.pos; - vec3 d = ray.dir; + return NdotV / (NdotV * (1.0 - k) + k); +} - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - c; +float G_Smith(float roughness, float NdotV, float NdotL) +{ + float k = roughness * roughness / 2.0; + return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); +} - if (det < 0.0) { - return vec2(NO_HIT); +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = G_Smith(roughness, NdotV, NdotL); + float G_Vis = G * VdotH / (NdotH * NdotV); + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } } - - det = sqrt(det); - float t1 = -b - det; - float t2 = -b + det; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - - return vec2(tmin, tmax); + return vec2(A, B) / float(NumSamples); } -vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) +void main() { - vec3 o = ray.pos; - vec3 d = ray.dir; - - float a = dot(d, d); - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - a * c; + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +} +`;var LN=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; - if (det < 0.0) { - return vec2(NO_HIT); +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); } + return mod(value, rangeLength); +} - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - - return vec2(tmin, tmax); +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); } -vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; - float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; - float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; - float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; - float det = b * b - a * c; +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - if (det < 0.0) { - return vec2(NO_HIT); - } + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - return vec2(tmin, tmax); + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; } -vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} - if (intersect.x == NO_HIT) { - return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - } +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - // One interval - if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); - else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); - // Two intervals - else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); } -vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; - if (intersect.x == NO_HIT) { - return vec2(NO_HIT); + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } } - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; +} - if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); - else if (zmin < 0.0) return vec2(tmax, +INF_HIT); - else if (zmax < 0.0) return vec2(-INF_HIT, tmin); - else return vec2(tmin, tmax); +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } + + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; + } + return intersected; } -void intersectShape(in Ray ray, inout Intersections ix) { - // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. - // Direction is scaled as well to be in sync with position. - ray.pos = ray.pos * 2.0 - 1.0; - ray.dir *= 2.0; +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); +} - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) - Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); - #else - Ray outerRay = ray; - #endif +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +} - // Outer ellipsoid - vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; - // Exit early if the outer ellipsoid was missed. - if (outerIntersect.x == NO_HIT) { - return; +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); } + return k * sum.x * sum.y; +} - // Inner ellipsoid - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - // When the ellipsoid is perfectly thin it's necessary to sandwich the - // inner ellipsoid intersection inside the outer ellipsoid intersection. +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the ellipsoid to be invisible because it will think the ray - // is still inside the inner (negative) ellipsoid after exiting the - // outer (positive) ellipsoid. +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); - vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); + } - if (innerIntersect == vec2(NO_HIT)) { - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); - } else { - // When the ellipsoid is very large and thin it's possible for floating - // point math to cause the ray to intersect the inner ellipsoid before - // the outer ellipsoid. To prevent this from happening, clamp innerIntersect - // to outerIntersect and sandwhich the intersections like described above. - // - // In theory a similar fix is needed for cylinders, however it's more - // complicated to implement because the inner shape is allowed to be - // intersected first. - innerIntersect.x = max(innerIntersect.x, outerIntersect.x); - innerIntersect.y = min(innerIntersect.y, outerIntersect.y); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - } - #endif + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - // Flip the ray because the intersection function expects a cone growing towards +Z. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - Ray flippedRay = outerRay; - flippedRay.dir.z *= -1.0; - flippedRay.pos.z *= -1.0; - #endif + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; - // Bottom cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) - vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) - vec2 bottomConeIntersection = intersectZPlane(flippedRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) - vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); - #endif + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. - // Top cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) - vec2 topConeIntersection = intersectZPlane(ray); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #endif + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; - // Wedge - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #endif -} -`;var sC=`// Main intersection function for Voxel scenes. -// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl -// for the definition of intersectShape. The appropriate function is selected -// based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. -// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, -// getFirstIntersection, initializeIntersections, nextIntersection. + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; -/* Intersection defines (set in Scene/VoxelRenderResources.js) -#define INTERSECTION_COUNT ### -*/ + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. -RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { - // Do a ray-shape intersection to find the exact starting and ending points. - intersectShape(ray, ix); + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); - // Exit early if the positive shape was completely missed or behind the ray. - RayShapeIntersection intersection = getFirstIntersection(ix); - if (intersection.entry.w == NO_HIT) { - // Positive shape was completely missed - so exit early. - return intersection; - } + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; - // Clipping planes - #if defined(CLIPPING_PLANES) - intersectClippingPlanes(ray, ix); - #endif + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - // Depth - #if defined(DEPTH_TEST) - intersectDepth(screenCoord, ray, ix); - #endif + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); - // Find the first intersection that's in front of the ray - #if (INTERSECTION_COUNT > 1) - initializeIntersections(ix); - for (int i = 0; i < INTERSECTION_COUNT; ++i) { - intersection = nextIntersection(ix); - if (intersection.exit.w > 0.0) { - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - break; - } - } - #else - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - #endif - - return intersection; + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; } -`;var zL=`/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_HAS_SHAPE_BOUNDS -*/ -#if defined(BOX_HAS_SHAPE_BOUNDS) - uniform vec3 u_boxUvToShapeUvScale; - uniform vec3 u_boxUvToShapeUvTranslate; +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); #endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else - return positionUv; -#endif -} + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } #else - return shapeUv; -#endif -} -`;var HL=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED -*/ - -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; + } + out_FragColor = cloud; #endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - uniform vec2 u_cylinderShapeUvAngleMinMax; #endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - uniform float u_cylinderShapeUvAngleRangeZeroMid; +} +`;var NN=`#ifdef INSTANCED +in vec2 direction; #endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; - // Compute radius - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) - float radius = 1.0; - #else - float radius = length(positionLocal.xy); // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset - #endif - #endif +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - // Compute height - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - float height = 1.0; - #else - float height = positionUv.z; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset - #endif - #endif + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; - // Compute angle - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - float angle = 1.0; - #else - float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. - angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); - #endif +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) - angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; - #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; - #endif + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; - angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset - #endif - #endif + v_offset = offset; + v_maximumSize = maximumSize; + v_color = color; + v_slice = slice; + v_brightness = brightness; +} +`;var FN=`uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +uniform vec3 u_noiseOffset; +in vec2 v_position; - return vec3(radius, height, angle); +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); } -`;var GL=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_IS_SPHERE -*/ -uniform vec3 u_ellipsoidRadiiUv; // [0,1] -#if !defined(ELLIPSOID_IS_SPHERE) - uniform vec3 u_ellipsoidInverseRadiiSquaredUv; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - uniform float u_ellipsoidInverseHeightDifferenceUv; - uniform vec2 u_ellipseInnerRadiiUv; // [0,1] -#endif +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} -// robust iterative solution without trig functions -// https://github.com/0xfaded/ellipse_demo/issues/1 -// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse -// Pro: Good when radii.x ~= radii.y -// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse -// Con: Inaccurate with exterior points and thin ellipses -float ellipseDistanceIterative (vec2 pos, vec2 radii) { - vec2 p = abs(pos); - vec2 invRadii = 1.0 / radii; - vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; - vec2 t = vec2(0.70710678118); // sqrt(2) / 2 - vec2 v = radii * t; +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); +} - const int iterations = 3; - for (int i = 0; i < iterations; ++i) { - vec2 e = a * pow(t, vec2(3.0)); - vec2 q = normalize(p - e) * length(v - e); - t = normalize((q + e) * invRadii); - v = radii * t; - } - return length(v * sign(pos) - pos) * sign(p.y - v.y); +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; } -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - // Compute position and normal. - // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). - // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. - vec3 positionLocal = positionUv * 2.0 - 1.0; - #if defined(ELLIPSOID_IS_SPHERE) - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; - vec3 normal = normalize(posEllipsoid); - #else - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; - vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal - #endif +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; - // Compute longitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - float longitude = 1.0; - #else - float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; - - // Correct the angle when max < min - // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); - #endif - - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) - longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; - #endif - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) - longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; - #endif - - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; - #endif - #endif - - // Compute latitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) - float latitude = 1.0; - #else - float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; - #endif - #endif + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); - // Compute height - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - // TODO: This breaks down when minBounds == maxBounds. To fix it, this - // function would have to know if ray is intersecting the front or back of the shape - // and set the shape space position to 1 (front) or 0 (back) accordingly. - float height = 1.0; - #else - #if defined(ELLIPSOID_IS_SPHERE) - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; - #else - float height = length(posEllipsoid); - #endif - #else - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). - // This is an optimization so that math can be done with ellipses instead of ellipsoids. - vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); - float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; - #else - // TODO: this is probably not correct - float height = length(posEllipsoid); - #endif - #endif - #endif + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } + } + } - return vec3(longitude, latitude, height); + return shortestDistance; } -`;var WL=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js -#define OCTREE_FLAG_INTERNAL 0 -#define OCTREE_FLAG_LEAF 1 -#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 - -#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops -uniform sampler2D u_octreeInternalNodeTexture; -uniform vec2 u_octreeInternalNodeTexelSizeUv; -uniform int u_octreeInternalNodeTilesPerRow; -#if (SAMPLE_COUNT > 1) -uniform sampler2D u_octreeLeafNodeTexture; -uniform vec2 u_octreeLeafNodeTexelSizeUv; -uniform int u_octreeLeafNodeTilesPerRow; -#endif +const float MAX_FBM_ITERATIONS = 10.0; -struct OctreeNodeData { - int data; - int flag; -}; +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } -struct TraversalData { - ivec4 octreeCoords; - int parentOctreeIndex; -}; + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; + } + return noise; +} -struct SampleData { - int megatextureIndex; - ivec4 tileCoords; - vec3 tileUv; - #if (SAMPLE_COUNT > 1) - float weight; - #endif -}; +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; -// Integer mod: For WebGL1 only -int intMod(in int a, in int b) { - return a - (b * (a / b)); -} -int normU8_toInt(in float value) { - return int(value * 255.0); -} -int normU8x2_toInt(in vec2 value) { - return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { - return float(normU8x2_toInt(value)) / 65535.0; + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); } +`;var BN=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { - vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); +out vec2 v_position; - OctreeNodeData data; - data.data = normU8x2_toInt(texData.xy); - data.flag = normU8x2_toInt(texData.zw); - return data; -} +void main() +{ + gl_Position = vec4(position, 0.1, 1.0); -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { - int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; - int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; - int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - return getOctreeNodeData(octreeUv); + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; } +`;var kN=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; -int getOctreeParentIndex(in int octreeIndex) { - int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; - int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); - int parentOctreeIndex = normU8x2_toInt(parentData.xy); - return parentOctreeIndex; -} +in vec2 v_textureCoordinates; -/** -* Convert a position in the uv-space of the tileset bounding shape -* into the uv-space of a tile within the tileset -*/ -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { - // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) - float dimAtLevel = pow(2.0, float(octreeCoords.w)); - return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +void main() +{ + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); } +`;var UN=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ -void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { - sampleData.megatextureIndex = data.data; - sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; -} +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { - int leafIndex = data.data; - int leafNodeTexelCount = 2; - // Adding 0.5 moves to the center of the texel - float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; - float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +in vec2 v_textureCoordinates; - // Get an interpolation weight and a flag to determine whether to read the parent texture - vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); - vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); - float lerp = normU8x2_toFloat(leafData0.xy); - sampleDatas[0].weight = 1.0 - lerp; - sampleDatas[1].weight = lerp; - // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT - sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; - sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; +void main() +{ + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; - // Get megatexture indices for both samples - vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); - vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); - sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); - sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); -} +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); +#else + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); #endif -OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { - float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); - vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; - vec3 end = start + vec3(sizeAtLevel); - OctreeNodeData childData; + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - // Find out which octree child contains the position - // 0 if before center, 1 if after - vec3 center = 0.5 * (start + end); - vec3 childCoord = step(center, shapePosition); + if (opaque != czm_backgroundColor) + { + out_FragColor.a = 1.0; + } +} +`;var VN=`in vec4 positionEC; - // Get octree coords for the next level down - ivec4 octreeCoords = traversalData.octreeCoords; - traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); +void main() +{ + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } - childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); + czm_ray ray = czm_ray(position, direction); - if (childData.flag != OCTREE_FLAG_INTERNAL) { - // leaf tile - stop traversing - break; - } + vec3 ellipsoid_center = czm_view[3].xyz; - // interior tile - keep going deeper - start = mix(start, center, childCoord); - end = mix(center, end, childCoord); - traversalData.parentOctreeIndex = childData.data; + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) + { + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + } + else + { + discard; } - return childData; + czm_writeLogDepth(); } +`;var zN=`in vec4 position; -/** -* Transform a given position to an octree tile coordinate and a position within that tile, -* and find the corresponding megatexture index and texture coordinates -*/ -void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { - traversalData.octreeCoords = ivec4(0); - traversalData.parentOctreeIndex = 0; +out vec4 positionEC; - OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); - if (nodeData.flag != OCTREE_FLAG_LEAF) { - nodeData = traverseOctreeDownwards(shapePosition, traversalData); - } +void main() +{ + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); - #endif + czm_vertexLogDepth(); } +`;var fS=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; -bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { - return clamp(v, minVal, maxVal) == v; -} +in vec3 v_positionEC; -bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { - vec3 tileUv = getTileUv(shapePosition, octreeCoords); - bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); - // Assume (!) the position is always inside the root tile. - return inside || octreeCoords.w == 0; -} +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes -void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { - if (insideTile(shapePosition, traversalData.octreeCoords)) { - for (int i = 0; i < SAMPLE_COUNT; i++) { - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - } - return; - } + vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; - // Go up tree until we find a parent tile containing shapePosition - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - traversalData.octreeCoords.xyz /= 2; - traversalData.octreeCoords.w -= 1; + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); - if (insideTile(shapePosition, traversalData.octreeCoords)) { - break; - } +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); +#else + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} - traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); - } +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. - // Go down tree - OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); - #endif -} -`;var jL=`// See Octree.glsl for the definitions of SampleData and intMod + float t1 = -1.0; + float t2 = -1.0; -/* Megatexture defines (set in Scene/VoxelRenderResources.js) -#define SAMPLE_COUNT ### -#define NEAREST_SAMPLING -#define PADDING -*/ + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; -uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions -uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; + } -uniform ivec3 u_dimensions; // does not include padding -#if defined(PADDING) - uniform ivec3 u_paddingBefore; - uniform ivec3 u_paddingAfter; -#endif + if (t1 < 0.0 && t2 < 0.0) { + discard; + } -// Integer min, max, clamp: For WebGL1 only -int intMin(int a, int b) { - return a <= b ? a : b; -} -int intMax(int a, int b) { - return a >= b ? a : b; -} -int intClamp(int v, int minVal, int maxVal) { - return intMin(intMax(v, minVal), maxVal); -} + float t = min(t1, t2); + if (t < 0.0) { + t = 0.0; + } -vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) -{ - int indexX = intMod(index, dimensions.x); - int indexY = index / dimensions.x; - return vec2(indexX, indexY) * uvScale; -} + // March ray forward to intersection with larger sphere and find + czm_ray ray = czm_ray(t * direction, direction); -/* - How is 3D data stored in a 2D megatexture? + vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); - In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). - The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and - the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). - Note that there could be empty space in the megatexture because it's a power of two. + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); - 0 1 2 3 - +---+---+---+---+ - | | | | | 3 - +---+---+---+---+ - | | | | | 2 - +-------+-------+ - |010|110|011|111| 1 - |--- ---|--- ---| - |000|100|001|101| 0 - +-------+-------+ + if (czm_isEmpty(intersection)) + { + discard; + } - When doing linear interpolation the megatexture needs to be sampled twice: once for - the Z slice above the voxel coordinate and once for the slice below. The two slices - are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is - halfway between two Z slices so the interpolation factor is 0.5. Below is a side view - of the 3D voxel grid with voxel coordinates on the left side. + // If the viewer is outside, compute outsideFaceColor, with normals facing outward. + vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - 2 +---+ - |001| - 1 +-z-+ - |000| - 0 +---+ + // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. + vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); - When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. -*/ + out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); + out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); -Properties getPropertiesFromMegatexture(in SampleData sampleData) { - vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? - int tileIndex = sampleData.megatextureIndex; - vec3 voxelCoord = tileUv * vec3(u_dimensions); - ivec3 voxelDimensions = u_dimensions; +#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + t = (intersection.start != 0.0) ? intersection.start : intersection.stop; + vec3 positionEC = czm_pointAlongRay(ray, t); + vec4 positionCC = czm_projection * vec4(positionEC, 1.0); +#ifdef LOG_DEPTH + czm_writeLogDepth(1.0 + positionCC.w); +#else + float z = positionCC.z / positionCC.w; - #if defined(PADDING) - voxelDimensions += u_paddingBefore + u_paddingAfter; - voxelCoord += vec3(u_paddingBefore); - #endif + float n = czm_depthRange.near; + float f = czm_depthRange.far; - #if defined(NEAREST_SAMPLING) - // Round to the center of the nearest voxel - voxelCoord = floor(voxelCoord) + vec3(0.5); - #endif + gl_FragDepth = (z * (f - n) + f + n) * 0.5; +#endif +#endif +} +`;var dS=`in vec3 position; - // Tile location - vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); +uniform vec3 u_radii; - // Slice location - float slice = voxelCoord.z - 0.5; - int sliceIndex = int(floor(slice)); - int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); - vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); - - // Voxel location - vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; - - // Final location in the megatexture - vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; - - #if defined(NEAREST_SAMPLING) - return getPropertiesFromMegatextureAtUv(uv0); - #else - float sliceLerp = fract(slice); - int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); - vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); - vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; - Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); - Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); - return mixProperties(properties0, properties1, sliceLerp); - #endif -} - -// Convert an array of sample datas to a final weighted properties. -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { - #if (SAMPLE_COUNT == 1) - return getPropertiesFromMegatexture(sampleDatas[0]); - #else - // When more than one sample is taken the accumulator needs to start at 0 - Properties properties = clearProperties(); - for (int i = 0; i < SAMPLE_COUNT; ++i) { - float weight = sampleDatas[i].weight; +out vec3 v_positionEC; - // Avoid reading the megatexture when the weight is 0 as it can be costly. - if (weight > 0.0) { - Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); - tempProperties = scaleProperties(tempProperties, weight); - properties = sumProperties(properties, tempProperties); - } - } - return properties; - #endif -} -`;function grt(e){let t=new F0;this.shaderBuilder=t;let n=e._customShader,i=_t(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let p in r)if(r.hasOwnProperty(p)){let g=r[p];t.addUniform(g.type,p,be.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",be.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=u(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s,t.addVertexLines([BL]),t.addFragmentLines([n.fragmentShaderText,"#line 0",WL,LL,jL]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,be.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,be.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,be.FRAGMENT),t.addFragmentLines([FL])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,be.FRAGMENT),t.addFragmentLines([NL]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,be.FRAGMENT),t.addFragmentLines([zL,UL,sC])):a==="CYLINDER"?t.addFragmentLines([VL,sC,HL]):a==="ELLIPSOID"&&t.addFragmentLines([kL,sC,GL]),t.addFragmentLines([RL]);let c=e._shape,l=c.shaderDefines;for(let p in l)if(l.hasOwnProperty(p)){let g=l[p];u(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,be.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,be.FRAGMENT),s===1?f+=1:o.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,be.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,be.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,be.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,be.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,be.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,be.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,be.FRAGMENT)}var qL=grt;function yrt(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,l=u(s)&&u(a);n.addDefine("METADATA_COUNT",c,be.FRAGMENT),l&&n.addDefine("STATISTICS",void 0,be.FRAGMENT);for(let O=0;O<c;O++){let B=i[O],L=r[O],_=`PropertyStatistics_${B}`,b=`PropertyStatistics_${B}`;n.addStruct(_,b,be.FRAGMENT);let v=Cz(L);n.addStructField(_,v,"min"),n.addStructField(_,v,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,be.FRAGMENT);for(let O=0;O<c;O++){let B=i[O],L=`PropertyStatistics_${B}`,_=B;n.addStructField(f,L,_)}let g="Metadata",h="Metadata",A="metadata";n.addStruct(g,h,be.FRAGMENT),n.addStructField(g,d,p);for(let O=0;O<c;O++){let B=i[O],L=r[O],_=Cz(L);n.addStructField(g,_,B)}for(let O=0;O<c;O++){let B=i[O],L=r[O],_=xrt(L),b=`VoxelProperty_${B}`,v=`VoxelProperty_${B}`;n.addStruct(b,v,be.FRAGMENT),n.addStructField(b,_,"partialDerivativeLocal"),n.addStructField(b,_,"partialDerivativeWorld"),n.addStructField(b,_,"partialDerivativeView"),n.addStructField(b,_,"partialDerivativeValid")}let x="Voxel",C="Voxel",T="voxel";n.addStruct(x,C,be.FRAGMENT);for(let O=0;O<c;O++){let B=i[O],L=`VoxelProperty_${B}`;n.addStructField(x,L,B)}n.addStructField(x,"vec3","positionEC"),n.addStructField(x,"vec3","positionUv"),n.addStructField(x,"vec3","positionShapeUv"),n.addStructField(x,"vec3","positionUvLocal"),n.addStructField(x,"vec3","viewDirUv"),n.addStructField(x,"vec3","viewDirWorld"),n.addStructField(x,"vec3","surfaceNormal"),n.addStructField(x,"float","travelDistance");let E="FragmentInput",S="FragmentInput";n.addStruct(E,S,be.FRAGMENT),n.addStructField(E,h,A),n.addStructField(E,C,T);let w="Properties",D="Properties",M="properties";n.addStruct(w,D,be.FRAGMENT);for(let O=0;O<c;O++){let B=i[O],L=r[O],_=Cz(L);n.addStructField(w,_,B)}{let O="clearProperties";n.addFunction(O,`${D} clearProperties()`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${M};`]);for(let B=0;B<c;B++){let L=i[B],_=r[B],b=o[B],v=Cz(_,b);n.addFunctionLines(O,[`${M}.${L} = ${v}(0.0);`])}n.addFunctionLines(O,[`return ${M};`])}{let O="sumProperties";n.addFunction(O,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${M};`]);for(let B=0;B<c;B++){let L=i[B];n.addFunctionLines(O,[`${M}.${L} = propertiesA.${L} + propertiesB.${L};`])}n.addFunctionLines(O,[`return ${M};`])}{let O="scaleProperties";n.addFunction(O,`${D} scaleProperties(${D} ${M}, float scale)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} scaledProperties = ${M};`]);for(let B=0;B<c;B++){let L=i[B];n.addFunctionLines(O,[`scaledProperties.${L} *= scale;`])}n.addFunctionLines(O,["return scaledProperties;"])}{let O="mixProperties";n.addFunction(O,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${M};`]);for(let B=0;B<c;B++){let L=i[B];n.addFunctionLines(O,[`${M}.${L} = mix(propertiesA.${L}, propertiesB.${L}, mixFactor);`])}n.addFunctionLines(O,[`return ${M};`])}{let O="copyPropertiesToMetadata";n.addFunction(O,`void copyPropertiesToMetadata(in ${D} ${M}, inout ${h} ${A})`,be.FRAGMENT);for(let B=0;B<c;B++){let L=i[B];n.addFunctionLines(O,[`${A}.${L} = ${M}.${L};`])}}if(l){let O="setStatistics";n.addFunction(O,`void setStatistics(inout ${d} ${p})`,be.FRAGMENT);for(let B=0;B<c;B++){let L=i[B],_=r[B],b=qt.getComponentCount(_);for(let v=0;v<b;v++){let I=Crt(_,v),R=s[B][v],F=a[B][v];n.addFunctionLines(O,[`${p}.${L}.min${I} = ${k_e(R)};`,`${p}.${L}.max${I} = ${k_e(F)};`])}}}{let O="getPropertiesFromMegatextureAtUv";n.addFunction(O,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${M};`]);for(let B=0;B<c;B++){let L=i[B],_=r[B],b=o[B],v=Art(_,b);n.addFunctionLines(O,[`properties.${L} = texture(u_megatextureTextures[${B}], texcoord)${v};`])}n.addFunctionLines(O,[`return ${M};`])}}function Cz(e){if(e===qt.SCALAR)return"float";if(e===qt.VEC2)return"vec2";if(e===qt.VEC3)return"vec3";if(e===qt.VEC4)return"vec4"}function Art(e){if(e===qt.SCALAR)return".r";if(e===qt.VEC2)return".ra";if(e===qt.VEC3)return".rgb";if(e===qt.VEC4)return""}function xrt(e){if(e===qt.SCALAR)return"vec3";if(e===qt.VEC2)return"mat2";if(e===qt.VEC3)return"mat3";if(e===qt.VEC4)return"mat4"}function k_e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Crt(e,t){return e===qt.SCALAR?"":`[${t}]`}var YL=yrt;function Trt(e,t){let n=new qL(e);YL(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o}=n;if(o>0){let h="getClippingPlane",A=L_(r,t),x=0,C=A.indexOf(")")+1,T=A.indexOf("{",C)+1,E=A.indexOf("}",T),S=A.slice(x,C),w=A.slice(T,E);i.addFunction(h,S,be.FRAGMENT),i.addFunctionLines(h,[w])}let s=i.clone();s.addDefine("PICKING",void 0,be.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),l=Ve.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new et({vertexArray:f,primitiveType:Be.TRIANGLES,renderState:l,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:ve.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=et.shallowClone(p,new et);if(g.shaderProgram=c,g.pickOnly=!0,u(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(u(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var XL=Trt;var W_e={};function Ert(e,t,n){let i,r,o;if(e instanceof wi){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Zc)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var brt=new m,z_e=new m;function j_e(e,t,n,i){if(u(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(l){let f=n(l);if(l<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function hY(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!u(o)){let a=e.position,c=t,l=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,brt),g=m.magnitude(m.multiplyByScalar(l,m.dot(p,l),z_e)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),z_e));o=Math.min(Ert(d,g,h)*.2,1e9)}if(s<o){let l=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-l)+l;return-Math.pow(p,8)/1e6+o}}return function(a){return P.lerp(n,i,a)}}function KL(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var q_e=new m;function Srt(e,t,n,i,r,o,s,a){let c=e.camera,l=m.clone(c.position,q_e),f=c.pitch,d=KL(c.heading,i),p=KL(c.roll,o),g=hY(c,n,l.z,n.z,s),h=j_e(f,r,g,a);function A(x){let C=x.time/t;c.setView({orientation:{heading:P.lerp(d,i,C),pitch:h(C),roll:P.lerp(p,o,C)}}),H.lerp(l,n,C,c.position),c.position.z=g(C)}return A}function vrt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function wrt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var Drt=new he,Irt=new he;function Prt(e,t,n,i,r,o,s,a,c,l){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,Drt),h=f.pitch,A=KL(f.heading,i),x=KL(f.roll,o),C=p.cartesianToCartographic(n,Irt);g.longitude=P.zeroToTwoPi(g.longitude),C.longitude=P.zeroToTwoPi(C.longitude);let T=!1;if(u(a)){let D=P.zeroToTwoPi(a),M=Math.min(g.longitude,C.longitude),O=Math.max(g.longitude,C.longitude),B=D>=M&&D<=O;if(u(c)){let L=Math.abs(g.longitude-C.longitude),_=P.TWO_PI-L;(B?L:_)<(B?_:L)*c&&!B&&(T=!0)}else B||(T=!0)}T?vrt(g,C):wrt(g,C);let E=hY(f,n,g.height,C.height,s),S=j_e(h,r,E,l);function w(){let D=g.longitude,M=C.longitude,O=g.latitude,B=C.latitude;return function(_){let b=_.time/t,v=m.fromRadians(P.lerp(D,M,b),P.lerp(O,B,b),E(b),p);f.setView({destination:v,orientation:{heading:P.lerp(A,i,b),pitch:S(b),roll:P.lerp(x,o,b)}})}}return w()}function Ort(e,t,n,i,r,o,s){let a=e.camera,c=m.clone(a.position,q_e),l=KL(a.heading,i),f=a.frustum.right-a.frustum.left,d=hY(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:P.lerp(l,i,h)}}),H.lerp(c,n,h,a.position);let A=d(h),x=a.frustum,C=x.top/x.right,T=(A-(x.right-x.left))*.5;x.right+=T,x.left-=T,x.top=C*x.right,x.bottom=-x.top}return p}var H_e=new he,Mrt=new m;function mY(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function G_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}W_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return mY();let r=y(t.convert,!0),o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,l=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,H_e),n=o.project(H_e,Mrt));let p=e.camera,g=t.endTransform;u(g)&&p._setTransform(g);let h=t.duration;u(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let A=y(t.heading,0),x=y(t.pitch,-P.PI_OVER_TWO),C=y(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let E=G_e(T,t.complete),S=G_e(T,t.cancel),w=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&H.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(w.right-w.left,w.top-w.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(C),P.negativePiToPi(p.roll),P.EPSILON10),D)return mY(E,S);let M=new Array(4);if(M[ne.SCENE2D]=Ort,M[ne.SCENE3D]=Prt,M[ne.COLUMBUS_VIEW]=Srt,h<=0)return mY(function(){M[i](e,1,n,A,x,C,a,c,l,f)({time:1}),typeof E=="function"&&E()},S);let O=M[i](e,h,n,A,x,C,a,c,l,f);if(!u(d)){let B=p.positionCartographic.height,L=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;B>L&&B>11500?d=Lo.CUBIC_OUT:d=Lo.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:O,complete:E,cancel:S}};var JL=W_e;var Rrt={ROTATE:0,INFINITE_SCROLL:1},Ul=Object.freeze(Rrt);function Qt(e){this._scene=e,this._transform=N.clone(N.IDENTITY),this._invTransform=N.clone(N.IDENTITY),this._actualTransform=N.clone(N.IDENTITY),this._actualInvTransform=N.clone(N.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new _e,this._moveEnd=new _e,this._changed=new _e,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new N,this._invViewMatrix=new N,ege(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,dge(this,Qt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*Qt.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}Qt.TRANSFORM_2D=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Qt.TRANSFORM_2D_INVERSE=N.inverseTransformation(Qt.TRANSFORM_2D,new N);Qt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Qt.DEFAULT_VIEW_FACTOR=.5;Qt.DEFAULT_OFFSET=new Cu(0,-P.PI_OVER_FOUR,0);function ege(e){N.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),N.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),N.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Brt(e){if(!u(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ai()):e.timeSinceMoved=Math.max(Ai()-e._lastMovedTimestamp,0)/1e3}}Qt.prototype.canPreloadFlight=function(){return u(this._currentFlight)&&this._mode!==ne.SCENE2D};Qt.prototype._updateCameraChanged=function(){let e=this;if(Brt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;u(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===ne.SCENE2D){if(!u(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let l=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=l.x+d.left,h=l.x+d.right,A=f.x+p.left,x=f.x+p.right,C=l.y+d.bottom,T=l.y+d.top,E=f.y+p.bottom,S=f.y+p.top,w=Math.max(g,A),D=Math.min(h,x),M=Math.max(C,E),O=Math.min(T,S),B;if(w>=D||M>=T)B=1;else{let L=p;g<A&&h>x&&C<E&&T>S&&(L=d),B=1-(D-w)*(O-M)/((L.right-L.left)*(L.top-L.bottom))}B>t&&(e._changed.raiseEvent(B),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!u(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let o=P.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;u(e.frustum.fovy)?s=o/(e.frustum.fovy*.5):s=o;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Lrt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Nrt=new he,Frt=new m,Tz=new m,Urt=new oe,Vrt=new oe,krt=new oe,zrt=new oe,Hrt=new oe;function Grt(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,Urt),r=n.cartesianToCartographic(i,Nrt),o=t.project(r,Frt),s=Vrt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=oe.clone(oe.UNIT_X,Hrt),c=oe.add(N.getColumn(e._transform,0,Tz),i,Tz);n.cartesianToCartographic(c,r),t.project(r,o);let l=krt;l.x=o.z,l.y=o.x,l.z=o.y,l.w=0,m.subtract(l,s,l),l.x=0;let f=zrt;if(m.magnitudeSquared(l)>P.EPSILON10)m.cross(a,l,f);else{let d=oe.add(N.getColumn(e._transform,1,Tz),i,Tz);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,l),oe.clone(oe.UNIT_Z,f))}m.cross(f,a,l),m.normalize(l,l),m.cross(a,l,f),m.normalize(f,f),N.setColumn(e._actualTransform,0,l,e._actualTransform),N.setColumn(e._actualTransform,1,f,e._actualTransform),N.setColumn(e._actualTransform,2,a,e._actualTransform),N.setColumn(e._actualTransform,3,s,e._actualTransform)}var pY=new m;function Ac(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!m.equals(r,e.position)||n;o&&(r=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,l=!m.equals(c,e.up);l&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let f=e._right,d=!m.equals(f,e.right);d&&(m.normalize(e.right,e.right),f=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(N.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?N.equals(N.IDENTITY,e._transform)?N.clone(Qt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?Lrt(e):Grt(e):N.clone(e._transform,e._actualTransform),N.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=N.multiplyByPoint(g,r,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=pY;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===ne.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||l||d){let h=m.dot(s,m.cross(c,f,pY));if(Math.abs(1-h)>P.EPSILON2){let A=1/m.magnitudeSquared(c),x=m.dot(c,s)*A,C=m.multiplyByScalar(s,x,pY);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=N.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(l||p)&&(e._upWC=N.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=N.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(o||a||l||d||p)&&ege(e)}function tge(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function nge(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function ige(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var Sz=new N,vz=new N;Object.defineProperties(Qt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Ac(this),this._invTransform}},viewMatrix:{get:function(){return Ac(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Ac(this),this._invViewMatrix}},positionCartographic:{get:function(){return Ac(this),this._positionCartographic}},positionWC:{get:function(){return Ac(this),this._positionWC}},directionWC:{get:function(){return Ac(this),this._directionWC}},upWC:{get:function(){return Ac(this),this._upWC}},rightWC:{get:function(){return Ac(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Sz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vz);this._setTransform(n);let i=tge(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Sz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vz);this._setTransform(n);let i=nge(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Sz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vz);this._setTransform(n);let i=ige(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Qt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&age(this,this.position)};var Wrt=new m,jrt=new m,qrt=new m;Qt.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Wrt),n=m.clone(this.upWC,jrt),i=m.clone(this.directionWC,qrt);N.clone(e,this._transform),this._transformChanged=!0,Ac(this);let r=this._actualInvTransform;N.multiplyByPoint(r,t,this.position),N.multiplyByPointAsVector(r,i,this.direction),N.multiplyByPointAsVector(r,n,this.up),m.cross(this.direction,this.up,this.right),Ac(this)};var Yrt=new H,Xrt=new Dn,Krt=new m,Jrt=new m;function rge(e){if(!N.equals(N.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Yrt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let r;if(u(n)){let a=e.getPickRay(i,Xrt);r=n.pickWorldCoordinates(a,t,!0,Krt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,Jrt));let s;if(u(r)||u(o)){let a=u(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=u(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Qt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof tn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=rge(this)))};var wz=new m,xY=new N,Zrt=new N,CY=new Le,TY=new Q,oge=new he;function Qrt(e,t,n){let i=N.clone(e.transform,xY),r=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Zrt);e._setTransform(r),m.clone(m.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,CY),s=Q.fromQuaternion(o,TY);Q.getColumn(s,0,e.direction),Q.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function $rt(e,t,n,i){let r=N.clone(e.transform,xY);if(e._setTransform(N.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,oge);t=a.project(c,wz)}m.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,CY),s=Q.fromQuaternion(o,TY);Q.getColumn(s,0,e.direction),Q.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function eot(e,t,n,i){let r=N.clone(e.transform,xY);if(e._setTransform(N.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,l=c.ellipsoid.cartesianToCartographic(t,oge);t=c.project(l,wz)}H.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ul.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,CY),s=Q.fromQuaternion(o,TY);Q.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(r)}var tot=new m,not=new m,iot=new m;function sge(e,t,n,i){let r=m.clone(n.direction,tot),o=m.clone(n.up,not);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,Sz),l=N.inverseTransformation(c,vz);N.multiplyByPointAsVector(l,r,r),N.multiplyByPointAsVector(l,o,o)}let s=m.cross(r,o,iot);return i.heading=tge(r,o),i.pitch=nge(r),i.roll=ige(r,o,s),i}var AY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},uS=new Ha;Qt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;u(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),r=y(e.destination,m.clone(this.positionWC,wz));u(r)&&u(r.west)&&(r=this.getRectangleCameraCoordinates(r,wz),i=!1),u(t.direction)&&(t=sge(this,r,t,AY.orientation)),uS.heading=y(t.heading,0),uS.pitch=y(t.pitch,-P.PI_OVER_TWO),uS.roll=y(t.roll,0),n===ne.SCENE3D?Qrt(this,r,uS):n===ne.SCENE2D?eot(this,r,uS,i):$rt(this,r,uS,i)};var rot=new m;Qt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Qt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:N.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Qt.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*Qt.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:N.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,rot).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};Qt.prototype.worldToCameraCoordinates=function(e,t){return u(t)||(t=new oe),Ac(this),N.multiplyByVector(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesPoint=function(e,t){return u(t)||(t=new m),Ac(this),N.multiplyByPoint(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesVector=function(e,t){return u(t)||(t=new m),Ac(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};Qt.prototype.cameraToWorldCoordinates=function(e,t){return u(t)||(t=new oe),Ac(this),N.multiplyByVector(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return u(t)||(t=new m),Ac(this),N.multiplyByPoint(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesVector=function(e,t){return u(t)||(t=new m),Ac(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function age(e,t){let n=e._scene.mapMode2D===Ul.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var Y_e=new m;Qt.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,Y_e),m.add(n,Y_e,n),this._mode===ne.SCENE2D&&age(this,n),this._adjustOrthographicFrustum(!0)};Qt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?Dz(this,e):this.move(this.direction,e)};Qt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?Dz(this,-e):this.move(this.direction,-e)};Qt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Qt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Qt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Qt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Qt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Qt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Qt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Qt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var oot=new Le,sot=new Q;Qt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Le.fromAxisAngle(e,-n,oot),r=Q.fromQuaternion(i,sot),o=this.direction,s=this.up,a=this.right;Q.multiplyByVector(r,o,o),Q.multiplyByVector(r,s,s),Q.multiplyByVector(r,a,a)};Qt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Qt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var aot=new Le,cot=new Q;Qt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Le.fromAxisAngle(e,-n,aot),r=Q.fromQuaternion(i,cot);Q.multiplyByVector(r,this.position,this.position),Q.multiplyByVector(r,this.direction,this.direction),Q.multiplyByVector(r,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Qt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),cge(this,e)};Qt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),cge(this,-e)};var lot=new m,uot=new m,fot=new m,X_e=new m;function cge(e,t){let n=e.position;if(u(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,P.EPSILON2)){let i=m.normalize(n,lot),r=m.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=m.equalsEpsilon(i,m.negate(e.constrainedAxis,X_e),P.EPSILON2);if(!r&&!o){let s=m.normalize(e.constrainedAxis,uot),a=m.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=m.dot(i,m.negate(s,X_e)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let l=m.cross(s,i,fot);e.rotate(l,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Qt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),lge(this,-e)};Qt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),lge(this,e)};function lge(e,t){u(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function Dz(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ul.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ul.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function uge(e,t){e.move(e.direction,t)}Qt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?Dz(this,e):uge(this,e)};Qt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?Dz(this,-e):uge(this,-e)};Qt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var dot=new N;Qt.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,re.WGS84,dot);this.lookAtTransform(n,t)};var mot=new m,hot=new Le,pot=new Le,_ot=new Q;function fge(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Le.fromAxisAngle(m.UNIT_Y,-t,hot),r=Le.fromAxisAngle(m.UNIT_Z,-e,pot),o=Le.multiply(r,i,r),s=Q.fromQuaternion(o,_ot),a=m.clone(m.UNIT_X,mot);return Q.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}Qt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!u(t))return;let n;if(u(t.heading)?n=fge(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<P.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(N.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<P.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var ZL=new he,got=new he,yot=new m,Aot=new m,xot=new m,Cot=new m,Tot=new m,Eot=new m,bot=new m,_Y=new m,Sot={direction:new m,right:new m,up:new m},K_e;function yc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function dge(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:Sot,s=t.north,a=t.south,c=t.east,l=t.west;l>c&&(c+=P.TWO_PI);let f=(l+c)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let B=ZL;B.longitude=f,B.latitude=s,B.height=0;let L=got;L.longitude=f,L.latitude=a,L.height=0;let _=K_e;(!u(_)||_.ellipsoid!==r)&&(K_e=_=new tf(void 0,void 0,r)),_.setEndPoints(B,L),d=_.interpolateUsingFraction(.5,ZL).latitude}let p=ZL;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,bot),h=ZL;h.longitude=c,h.latitude=s;let A=r.cartographicToCartesian(h,yot);h.longitude=l;let x=r.cartographicToCartesian(h,xot);h.longitude=f;let C=r.cartographicToCartesian(h,Tot);h.latitude=a;let T=r.cartographicToCartesian(h,Eot);h.longitude=c;let E=r.cartographicToCartesian(h,Cot);h.longitude=l;let S=r.cartographicToCartesian(h,Aot);m.subtract(x,g,x),m.subtract(E,g,E),m.subtract(A,g,A),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(T,g,T);let w=r.geodeticSurfaceNormal(g,o.direction);m.negate(w,w);let D=m.cross(w,m.UNIT_Z,o.right);m.normalize(D,D);let M=m.cross(D,w,o.up),O;if(e.frustum instanceof tn){let B=Math.max(m.distance(A,x),m.distance(E,S)),L=Math.max(m.distance(A,E),m.distance(x,S)),_,b,v=e.frustum._offCenterFrustum,I=v.right/v.top,R=L*I;B>R?(_=B,b=_/I):(b=L,_=R),O=Math.max(_,b)}else{let B=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*B;if(O=Math.max(yc(w,M,x,B),yc(w,M,E,B),yc(w,M,A,B),yc(w,M,S,B),yc(w,M,C,B),yc(w,M,T,B),yc(w,D,x,L),yc(w,D,E,L),yc(w,D,A,L),yc(w,D,S,L),yc(w,D,C,L),yc(w,D,T,L)),a<0&&s>0){let _=ZL;_.longitude=l,_.latitude=0,_.height=0;let b=r.cartographicToCartesian(_,_Y);m.subtract(b,g,b),O=Math.max(O,yc(w,M,b,B),yc(w,D,b,L)),_.longitude=c,b=r.cartographicToCartesian(_,_Y),m.subtract(b,g,b),O=Math.max(O,yc(w,M,b,B),yc(w,D,b,L))}}return m.add(g,m.multiplyByScalar(w,-O,_Y),n)}var vot=new he,wot=new m,Dot=new m;function Iot(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=vot;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,wot);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Dot);if(N.multiplyByPoint(r,c,c),N.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,u(e.frustum.fovy)){let l=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*l;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/l)*.5}else{let l=a.x-c.x,f=a.y-c.y;n.z=Math.max(l,f)}return n}var Pot=new he,Oot=new m,Mot=new m;function Rot(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Ul.INFINITE_SCROLL?r+=P.TWO_PI:(t=ce.MAX_VALUE,r=t.east));let o=Pot;o.longitude=r,o.latitude=t.north;let s=i.project(o,Oot);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,Mot),c=Math.abs(s.x-a.x)*.5,l=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=l*p;return c>g?(f=c,d=f/p):(d=l,f=g),l=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=l,n=i.project(o,n),n}Qt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(u(t)||(t=new m),n===ne.SCENE3D)return dge(this,e,t);if(n===ne.COLUMBUS_VIEW)return Iot(this,e,t);if(n===ne.SCENE2D)return Rot(this,e,t)};var Bot=new Dn;function Lot(e,t,n,i){n=y(n,re.WGS84);let r=e.getPickRay(t,Bot),o=Qi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return Dn.getPoint(r,s,i)}var Not=new Dn;function Fot(e,t,n,i){let o=e.getPickRay(t,Not).origin;o=m.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Uot=new Dn;function Vot(e,t,n,i){let r=e.getPickRay(t,Uot),o=-r.origin.x/r.direction.x;Dn.getPoint(r,o,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Qt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(u(n)||(n=new m),t=y(t,re.WGS84),this._mode===ne.SCENE3D)n=Lot(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Fot(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=Vot(this,e,this._projection,n);else return;return n}};var kot=new m,zot=new m,Hot=new m;function Got(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,l=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,kot);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,l*c*a,zot),h=m.multiplyByScalar(e.upWC,f*c*s,Hot),A=m.add(p,g,n.direction);return m.add(A,h,A),m.subtract(A,d,A),m.normalize(A,A),n}var Ez=new m;function Wot(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;u(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let l=2/o*(o-t.y)-1;l*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,Ez),m.add(Ez,f,f),m.multiplyByScalar(e.up,l,Ez),m.add(Ez,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Qt.prototype.getPickRay=function(e,t){u(t)||(t=new Dn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return u(i.aspectRatio)&&u(i.fov)&&u(i.near)?Got(this,e,t):Wot(this,e,t)};var jot=new m,qot=new m;Qt.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,jot),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),qot);return Math.max(0,m.magnitude(n)-e.radius)};var Yot=new H;Qt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Yot);return Math.max(r.x,r.y)};function Xot(e,t,n,i,r,o){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let l=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(l,e.position)}return{easingFunction:Lo.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Kot=new m,J_e=new m,Jot=new m,Zot=new m;function Qot(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(m.UNIT_X,Kot),o=-m.dot(r,n)/m.dot(r,i),s=m.add(n,m.multiplyByScalar(i,o,J_e),J_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Jot);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,l=m.magnitude(m.subtract(n,s,Zot)),f=c*l,d=a*l,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),A=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-A||n.y>A){let x=s.y<-h||s.y>h,C=s.z<-A||s.z>A;if(x||C)return Xot(e,n,s,h,A,t)}}Qt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Qot(this,e)};var $ot=new m,ks={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Qt.prototype.cancelFlight=function(){u(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Qt.prototype.completeFlight=function(){if(u(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ks.destination,e.orientation.heading=ks.heading,e.orientation.pitch=ks.pitch,e.orientation.roll=ks.roll,this.setView(e),u(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Qt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,$ot));let r=y(e.orientation,y.EMPTY_OBJECT);if(u(r.direction)&&(r=sge(this,t,r,AY.orientation)),u(e.duration)&&e.duration<=0){let f=AY;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;ks.destination=t,ks.heading=r.heading,ks.pitch=r.pitch,ks.roll=r.roll,ks.duration=e.duration,ks.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),u(e.complete)&&e.complete()},ks.cancel=e.cancel,ks.endTransform=e.endTransform,ks.convert=i?!1:e.convert,ks.maximumHeight=e.maximumHeight,ks.pitchAdjustHeight=e.pitchAdjustHeight,ks.flyOverLongitude=e.flyOverLongitude,ks.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ks.easingFunction=e.easingFunction;let a=this._scene,c=JL.createTween(a,ks);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let l=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(u(l)||(l=Qt.clone(this)),l.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC))};function est(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function tst(e,t){let n=e.frustum,i=n.offCenterFrustum;u(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var nst=100;function mge(e,t,n){n=Cu.clone(u(n)?n:Qt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!u(o)||o===0){let s=t.radius;s===0?n.range=nst:e.frustum instanceof tn||e._mode===ne.SCENE2D?n.range=tst(e,s):n.range=est(e,s),n.range=P.clamp(n.range,i,r)}return n}Qt.prototype.viewBoundingSphere=function(e,t){t=mge(this,e,t),this.lookAt(e.center,t)};var ist=new N,rst=new m,ost=new m,sst=new m,ast=new m,cst=new oe,lst=new Le,ust=new Q;Qt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(N.IDENTITY);let i=mge(this,e,t.offset),r;n?r=m.multiplyByScalar(m.UNIT_Z,i.range,rst):r=fge(i.heading,i.pitch,i.range);let o=Mt.eastNorthUpToFixedFrame(e.center,re.WGS84,ist);N.multiplyByPoint(o,r,r);let s,a;if(!n){if(s=m.subtract(e.center,r,ost),m.normalize(s,s),a=N.multiplyByPointAsVector(o,m.UNIT_Z,sst),1-Math.abs(m.dot(s,a))<P.EPSILON6){let l=Le.fromAxisAngle(s,i.heading,lst),f=Q.fromQuaternion(l,ust);m.fromCartesian4(N.getColumn(o,1,cst),a),Q.multiplyByVector(f,a,a)}let c=m.cross(s,a,ast);m.cross(c,s,a),m.normalize(a,a)}this.flyTo({destination:r,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Z_e=new m,Q_e=new m,gY=new m,$_e=new m,QL=[new m,new m,new m,new m];function fst(e,t){let n=t.radii,i=e.positionWC,r=m.multiplyComponents(t.oneOverRadii,i,Z_e),o=m.magnitude(r),s=m.normalize(r,Q_e),a,c;m.equalsEpsilon(s,m.UNIT_Z,P.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,gY),gY),c=m.normalize(m.cross(s,a,$_e),$_e));let l=Math.sqrt(m.magnitudeSquared(r)-1),f=m.multiplyByScalar(s,1/o,Z_e),d=l/o,p=m.multiplyByScalar(a,d,Q_e),g=m.multiplyByScalar(c,d,gY),h=m.add(f,g,QL[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let A=m.subtract(f,g,QL[1]);m.subtract(A,p,A),m.multiplyComponents(n,A,A);let x=m.subtract(f,g,QL[2]);m.add(x,p,x),m.multiplyComponents(n,x,x);let C=m.add(f,g,QL[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),QL}var yY=new H,dst=new m,e0=[new he,new he,new he,new he];function bz(e,t,n,i,r,o){yY.x=e,yY.y=t;let s=i.pickEllipsoid(yY,r,dst);return u(s)?(e0[n]=r.cartesianToCartographic(s,e0[n]),1):(e0[n]=r.cartesianToCartographic(o[n],e0[n]),0)}Qt.prototype.computeViewRectangle=function(e,t){e=y(e,re.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,l=fst(this,e);if(c+=bz(0,0,0,this,e,l),c+=bz(0,a,1,this,e,l),c+=bz(s,a,2,this,e,l),c+=bz(s,0,3,this,e,l),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(e0,t);let f=0,d=e0[3].longitude;for(let p=0;p<4;++p){let g=e0[p].longitude,h=Math.abs(g-d);h>P.PI?f+=P.TWO_PI-h:f+=h,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,e0[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};Qt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof wi)return;let e=this._scene;this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};Qt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof tn)return;let e=rge(this),t=this._scene;this.frustum=new tn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Qt.clone=function(e,t){return u(t)||(t=new Qt(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),N.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var dr=Qt;var mst={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Li=Object.freeze(mst);function xc(e,t){let n=e;return u(t)&&(n+=`+${t}`),n}function hst(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function hge(e,t,n){let i=xc(Li.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new H;let l=e._movement[i];u(l)||(l=e._movement[i]={}),l.distance={startPosition:new H,endPosition:new H},l.angleAndHeight={startPosition:new H,endPosition:new H},l.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(hst(f,l),r[i]=!1,l.prevAngle=l.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,l.distance.endPosition),H.clone(f.angleAndHeight.endPosition,l.angleAndHeight.endPosition));let d=l.angleAndHeight.endPosition.x,p=l.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;l.angleAndHeight.endPosition.x=-d*n.clientWidth/12,l.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function pge(e,t){let n=xc(Li.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];u(s)||(s=e._movement[n]={});let a=e._lastMovement[n];u(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(c){let l=7.5*P.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=l,H.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},Cn.WHEEL,t)}function fS(e,t,n){let i=xc(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;r[i]=!1,o[i]=new H;let c=e._lastMovement[i];u(c)||(c=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let l,f;n===Li.LEFT_DRAG?(l=Cn.LEFT_DOWN,f=Cn.LEFT_UP):n===Li.RIGHT_DRAG?(l=Cn.RIGHT_DOWN,f=Cn.RIGHT_UP):n===Li.MIDDLE_DRAG&&(l=Cn.MIDDLE_DOWN,f=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,r[i]=!0,s[i]=new Date,H.clone(d.position,o[i])},l,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,a[i]=new Date},f,t)}function _ge(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function gge(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in Li)if(Li.hasOwnProperty(s)){let a=Li[s];if(u(a)){let c=xc(a,t);n[c]=!0,u(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new H,endPosition:new H,valid:!1}),u(e._movement[c])||(e._movement[c]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Li)if(Li.hasOwnProperty(a)){let c=Li[a];if(u(c)){let l=xc(c,t);o[l]&&(n[l]?(_ge(i[l],r[l]),r[l].valid=!0,_ge(s,i[l]),n[l]=!1):H.clone(s.endPosition,i[l].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function zf(e){this._eventHandler=new Ru(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,pge(this,void 0),hge(this,void 0,e),fS(this,void 0,Li.LEFT_DRAG),fS(this,void 0,Li.RIGHT_DRAG),fS(this,void 0,Li.MIDDLE_DRAG),gge(this,void 0);for(let t in la)if(la.hasOwnProperty(t)){let n=la[t];u(n)&&(pge(this,n),hge(this,n,e),fS(this,n,Li.LEFT_DRAG),fS(this,n,Li.RIGHT_DRAG),fS(this,n,Li.MIDDLE_DRAG),gge(this,n))}}Object.defineProperties(zf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[xc(Li.WHEEL)]||!this._update[xc(Li.WHEEL,la.SHIFT)]||!this._update[xc(Li.WHEEL,la.CTRL)]||!this._update[xc(Li.WHEEL,la.ALT)];return this._buttonsDown>0||e}}});zf.prototype.isMoving=function(e,t){let n=xc(e,t);return!this._update[n]};zf.prototype.getMovement=function(e,t){let n=xc(e,t);return this._movement[n]};zf.prototype.getLastMovement=function(e,t){let n=xc(e,t),i=this._lastMovement[n];if(i.valid)return i};zf.prototype.isButtonDown=function(e,t){let n=xc(e,t);return this._isDown[n]};zf.prototype.getStartMousePosition=function(e,t){if(e===Li.WHEEL)return this._currentMousePosition;let n=xc(e,t);return this._eventStartPosition[n]};zf.prototype.getButtonPressTime=function(e,t){let n=xc(e,t);return this._pressTime[n]};zf.prototype.getButtonReleaseTime=function(e,t){let n=xc(e,t);return this._releaseTime[n]};zf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var $L=zf;function N_(){this.featurePropertiesDirty=!1}Object.defineProperties(N_.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});N_.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};N_.prototype.getFeature=function(e){fe.throwInstantiationError()};N_.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};N_.prototype.applyStyle=function(e){fe.throwInstantiationError()};N_.prototype.update=function(e,t){fe.throwInstantiationError()};N_.prototype.isDestroyed=function(){fe.throwInstantiationError()};N_.prototype.destroy=function(){fe.throwInstantiationError()};var EY=N_;function pst(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Hf=pst;function dS(e,t){this._conditionsExpression=We(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,gst(this,t)}Object.defineProperties(dS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function _st(e,t){this.condition=e,this.expression=t}function gst(e,t){let n=[],i=e._conditions;if(!u(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new _st(new of(a,t),new of(c,t)))}e._runtimeConditions=n}dS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!u(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};dS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!u(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};dS.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!u(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],l=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${l}) - { - return ${f}; - } -`}return o=`${i} ${e} +void main() { -${o} return ${i}(1.0); -} -`,o};dS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!u(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];e.push.apply(e,r.condition.getVariables()),e.push.apply(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var eN=dS;function t0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,yst(this,e)}function yst(e,t){t=y(We(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(u(t.meta)){let i=t.defines,r=y(t.meta,y.EMPTY_OBJECT);for(let o in r)r.hasOwnProperty(o)&&(n[o]=new of(r[o],i))}e._meta=n,e._ready=!0}function eo(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(u(t)){if(typeof t=="boolean"||typeof t=="number")return new of(String(t));if(typeof t=="string")return new of(t,n);if(u(t.conditions))return new eN(t,n)}else return;return t}function to(e){if(u(e)){if(u(e.expression))return e.expression;if(u(e.conditionsExpression))return We(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(t0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=eo(this,e),this._style.show=to(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=eo(this,e),this._style.color=to(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=eo(this,e),this._style.pointSize=to(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=eo(this,e),this._style.pointOutlineColor=to(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=eo(this,e),this._style.pointOutlineWidth=to(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=eo(this,e),this._style.labelColor=to(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=eo(this,e),this._style.labelOutlineColor=to(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=eo(this,e),this._style.labelOutlineWidth=to(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=eo(this,e),this._style.font=to(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=eo(this,e),this._style.labelStyle=to(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=eo(this,e),this._style.labelText=to(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=eo(this,e),this._style.backgroundColor=to(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=eo(this,e),this._style.backgroundPadding=to(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=eo(this,e),this._style.backgroundEnabled=to(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=eo(this,e),this._style.scaleByDistance=to(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=eo(this,e),this._style.translucencyByDistance=to(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=eo(this,e),this._style.distanceDisplayCondition=to(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=eo(this,e),this._style.heightOffset=to(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=eo(this,e),this._style.anchorLineEnabled=to(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=eo(this,e),this._style.anchorLineColor=to(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=eo(this,e),this._style.image=to(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=eo(this,e),this._style.disableDepthTestDistance=to(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=eo(this,e),this._style.horizontalOrigin=to(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=eo(this,e),this._style.verticalOrigin=to(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=eo(this,e),this._style.labelHorizontalOrigin=to(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=eo(this,e),this._style.labelVerticalOrigin=to(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});t0.fromUrl=function(e){return we.createIfNeeded(e).fetchJson(e).then(function(n){return new t0(n)})};t0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,u(this.color)&&u(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};t0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,u(this.show)&&u(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};t0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,u(this.pointSize)&&u(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};t0.prototype.getVariables=function(){let e=[];return u(this.color)&&u(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),u(this.show)&&u(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),u(this.pointSize)&&u(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var F_=t0;function tN(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new Qx({comparator:tN.comparator})}tN.prototype.addSubtree=function(e){let t=new Ast(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};tN.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};tN.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function Ast(e,t){this.subtree=e,this.stamp=t}var nN=tN;function Vl(){this.orientedBoundingBox=new Mn,this.boundingSphere=new ae,this.boundTransform=new N,this.shapeTransform=new N,this._minBounds=m.clone(Vl.DefaultMinBounds,new m),this._maxBounds=m.clone(Vl.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var xst=new m,bY=new m,Cst=new Q,Tst=new m,Est=new m,bst=new m,Sst=new m,yge=N.fromRotationTranslation(Q.fromUniformScale(.5,new Q),new m(.5,.5,.5),new N);Vl.prototype.update=function(e,t,n,i,r){i=y(i,Vl.DefaultMinBounds),r=y(r,Vl.DefaultMaxBounds);let o=Vl.DefaultMinBounds,s=Vl.DefaultMaxBounds;t=this._minBounds=m.clamp(t,o,s,this._minBounds),n=this._maxBounds=m.clamp(n,o,s,this._maxBounds),i=m.clamp(i,o,s,Tst),r=m.clamp(r,o,s,Est);let a=m.clamp(t,i,r,bst),c=m.clamp(n,i,r,Sst),l=N.getScale(e,bY);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>r.x||i.y>r.y||i.z>r.z||l.x===0||l.y===0||l.z===0)return!1;this.shapeTransform=N.clone(e,this.shapeTransform),this.orientedBoundingBox=Age(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=N.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,o)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=N.multiplyByPoint(yge,a,f.renderMinBounds),f.renderMaxBounds=N.multiplyByPoint(yge,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,A=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===A.x?1:A.x-h.x),2/(h.y===A.y?1:A.y-h.y),2/(h.z===A.z?1:A.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var vst=new m,wst=new m;Vl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),vst),l=m.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),wst);return Age(c,l,this.shapeTransform,r)};Vl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};Vl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));Vl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function Age(e,t,n,i){let r=Vl.DefaultMinBounds,o=Vl.DefaultMaxBounds;if(m.equals(e,r)&&m.equals(t,o))i.center=N.getTranslation(n,i.center),i.halfAxes=N.getMatrix3(n,i.halfAxes);else{let a=N.getScale(n,bY),c=m.midpoint(e,t,xst);i.center=N.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),bY);let l=N.getRotation(n,Cst);i.halfAxes=Q.setScale(l,a,i.halfAxes)}return i}var Oh=Vl;function Iz(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(Iz.prototype,{metadataTable:{get:function(){return this._metadataTable}}});Iz.fromJson=async function(e,t,n,i){let r;u(t)?r={json:t,binary:void 0}:r=Ist(n);let o=await Dst(e,r.json,r.binary),s={},a=r.json.bufferViews.length;for(let d=0;d<a;++d){let p=r.json.bufferViews[d],g=p.byteOffset,h=g+p.byteLength,x=o[p.buffer].subarray(g,h);s[d]=x}let c=r.json.voxelTable,l=r.json.propertyTables[c],f=new Iz(e);return f._metadataTable=new yl({count:l.count,properties:l.properties,class:i.classes[l.class],bufferViews:s}),f};function Dst(e,t,n){let i=t.buffers.length,r=new Array(i);for(let o=0;o<i;o++){let s=t.buffers[o];if(u(s.uri)){let c=e.getDerivedResource({url:s.uri});r[o]=c.fetchArrayBuffer().then(function(l){return new Uint8Array(l)})}else r[o]=Promise.resolve(n)}return Promise.all(r)}function Ist(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Br(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}var iN=Iz;function Xo(){this.orientedBoundingBox=new Mn,this.boundingSphere=new ae,this.boundTransform=new N,this.shapeTransform=new N,this._minimumRadius=Xo.DefaultMinBounds.x,this._maximumRadius=Xo.DefaultMaxBounds.x,this._minimumHeight=Xo.DefaultMinBounds.y,this._maximumHeight=Xo.DefaultMaxBounds.y,this._minimumAngle=Xo.DefaultMinBounds.z,this._maximumAngle=Xo.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new m,cylinderUvToRenderBoundsTranslate:new m,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvHeight:new H,cylinderUvToShapeUvAngle:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var Cge=new m,Pst=new m,Ost=new m,Mst=new Q,Rst=new N,Bst=new N,Lst=N.fromRotationTranslation(Q.fromUniformScale(2,new Q),new m(-1,-1,-1),new N);Xo.prototype.update=function(e,t,n,i,r){i=y(i,Xo.DefaultMinBounds),r=y(r,Xo.DefaultMaxBounds);let o=Xo.DefaultMinBounds.x,s=Xo.DefaultMaxBounds.x,a=Xo.DefaultMinBounds.y,c=Xo.DefaultMaxBounds.y,l=Xo.DefaultMinBounds.z,f=Xo.DefaultMaxBounds.z,d=f-l,p=.5*d,g=P.EPSILON10,h=P.EPSILON3,A=P.EPSILON10,x=P.clamp(t.x,o,s),C=P.clamp(n.x,o,s),T=P.clamp(i.x,o,s),E=P.clamp(r.x,o,s),S=Math.max(x,T),w=Math.min(C,E),D=P.clamp(t.y,a,c),M=P.clamp(n.y,a,c),O=P.clamp(i.y,a,c),B=P.clamp(r.y,a,c),L=Math.max(D,O),_=Math.min(M,B),b=P.negativePiToPi(t.z),v=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),R=P.negativePiToPi(r.z),F=Math.max(b,I),k=Math.min(v,R),V=N.getScale(e,Cge);if(w===0||S>w||L>_||P.equalsEpsilon(V.x,0,void 0,g)||P.equalsEpsilon(V.y,0,void 0,g)||P.equalsEpsilon(V.z,0,void 0,g))return!1;this._minimumRadius=x,this._maximumRadius=C,this._minimumHeight=D,this._maximumHeight=M,this._minimumAngle=b,this._maximumAngle=v,this.shapeTransform=N.clone(e,this.shapeTransform),this.orientedBoundingBox=vY(S,w,L,_,F,k,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=N.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Y=x===o&&C===s,W=D===a&&M===c,J=v<b,j=v-b+J*d,K=j>p+A&&j<d-A,Z=j>A&&j<p-A,me=j>=p-A&&j<=p+A,ye=j<=A,se=K||Z||me||ye,pe=P.equalsEpsilon(b,l,void 0,h),Ae=P.equalsEpsilon(v,f,void 0,h),De=w===s,Ce=S===o,Re=L===a&&_===c,tt=k<F,nt=k-F+tt*d,Wt=nt>p+A&&nt<d-A,un=nt>A&&nt<p-A,pt=nt>=p-A&&nt<=p+A,gn=nt<=A,Bn=Wt||un||pt||gn,Ut=this.shaderUniforms,kt=this.shaderDefines;for(let xe in kt)kt.hasOwnProperty(xe)&&(kt[xe]=void 0);let Ee=0;if(kt.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Ee,Ee+=1,Ce||(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,kt.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Ee,Ee+=1,Ut.cylinderUvToRenderRadiusMin=w/S),De||(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===w&&(kt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Re||(kt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),L===_&&(kt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),D===M&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),x===C&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!Y){kt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let xe=1/(C-x),ft=x/(x-C);Ut.cylinderUvToShapeUvRadius=H.fromElements(xe,ft,Ut.cylinderUvToShapeUvRadius)}if(!W){kt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let xe=2/(M-D),ft=(D+1)/(D-M);Ut.cylinderUvToShapeUvHeight=H.fromElements(xe,ft,Ut.cylinderUvToShapeUvHeight)}if(!De||!Re){let xe=.5*(_-L),ft=m.fromElements(1/w,1/w,1/(xe===0?1:xe),Ost),di=m.fromElements(0,0,-ft.z*.5*(L+_),Pst),Xe=N.fromRotationTranslation(Q.fromScale(ft,Mst),di,Rst),Xi=N.multiplyTransformation(Xe,Lst,Bst);Ut.cylinderUvToRenderBoundsScale=N.getScale(Xi,Ut.cylinderUvToRenderBoundsScale),Ut.cylinderUvToRenderBoundsTranslate=N.getTranslation(Xi,Ut.cylinderUvToRenderBoundsTranslate)}if(J&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Bn&&(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,kt.CYLINDER_INTERSECTION_INDEX_ANGLE=Ee,Wt?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Ee+=1):un?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Ee+=2):pt?(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,Ee+=1):gn&&(kt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Ee+=2),Ut.cylinderRenderAngleMinMax=H.fromElements(F,k,Ut.cylinderAngleMinMax)),se){kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ye&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),pe&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),Ae&&(kt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let xe=(b-l)/d,ft=(v-l)/d,di=1-j/d;Ut.cylinderShapeUvAngleMinMax=H.fromElements(xe,ft,Ut.cylinderShapeUvAngleMinMax),Ut.cylinderShapeUvAngleRangeZeroMid=(ft+.5*di)%1;let Xe=d/j,Xi=-(b-l)/j;Ut.cylinderUvToShapeUvAngle=H.fromElements(Xe,Xi,Ut.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=Ee,!0};Xo.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,l=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(o,s,t*d),g=P.lerp(o,s,(t+1)*d),h=P.lerp(a,c,n*d),A=P.lerp(a,c,(n+1)*d),x=P.lerp(l,f,i*d),C=P.lerp(l,f,(i+1)*d);return vY(p,g,h,A,x,C,this.shapeTransform,r)};var Nst=new Mn,Fst=new m,Ust=new m,Vst=new m;Xo.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,r=this._minimumHeight,o=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,l=1-1/e.y,f=1-1/e.z,d=P.lerp(n,i,c),p=P.lerp(r,o,l),g=P.lerp(s,a,f),C=vY(d,i,p,o,g,a,t,Nst),T=Q.getScale(C.halfAxes,Fst),E=N.getScale(t,Ust),S=m.divideComponents(T,E,Vst);return m.minimumComponent(S)};Xo.DefaultMinBounds=Object.freeze(new m(0,-1,-P.PI));Xo.DefaultMaxBounds=Object.freeze(new m(1,1,+P.PI));var kst=5,zst=new Array(kst),Hst=new m,Gst=new Q,Wst=new N,jst=new N,qst=new N,SY=new N,Yst=new m,Xst=new m,Kst=new m,Tge=new Array(8);for(let e=0;e<8;e++)Tge[e]=new m;function xge(e,t,n){return Math.abs(oe.dot(e,t))<n}function Jst(e){let t=N.getColumn(e,0,Yst),n=N.getColumn(e,1,Xst),i=N.getColumn(e,2,Kst),r=P.EPSILON4;return xge(t,n,r)&&xge(n,i,r)}function Zst(e,t){let n=Tge;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)N.multiplyByPoint(e,n[i],n[i]);return Mn.fromPoints(n,t)}function vY(e,t,n,i,r,o,s,a){let c=Xo.DefaultMinBounds,l=Xo.DefaultMaxBounds,f=c.x,d=l.x,p=c.y,g=l.y,h=c.z,A=l.z;if(e===f&&t===d&&n===p&&i===g&&r===h&&o===A)return a.center=N.getTranslation(s,a.center),a.halfAxes=N.getMatrix3(s,a.halfAxes),a;o<r&&(o+=P.TWO_PI);let C=o-r,T=r+C*.5,E=zst,S=0;E[S++]=r,E[S++]=o,E[S++]=T,C>P.PI&&(E[S++]=T-P.PI_OVER_TWO,E[S++]=T+P.PI_OVER_TWO);let w=1,D=1,M=-1,O=-1;for(let J=0;J<S;++J){let j=E[J]-T,K=Math.cos(j),Z=Math.sin(j),me=K*e,ye=Z*e,se=K*t,pe=Z*t;w=Math.min(w,me),D=Math.min(D,ye),w=Math.min(w,se),D=Math.min(D,pe),M=Math.max(M,me),O=Math.max(O,ye),M=Math.max(M,se),O=Math.max(O,pe)}let B=M-w,L=O-D,_=i-n,b=(w+M)*.5,v=(D+O)*.5,I=(n+i)*.5,R=m.fromElements(b,v,I,Hst),F=Q.fromRotationZ(T,Gst),k=m.fromElements(B,L,_,Cge),V=N.fromScale(k,qst),G=N.fromRotation(F,jst),U=N.fromTranslation(R,Wst),Y=N.multiplyTransformation(G,N.multiplyTransformation(U,V,SY),SY),W=N.multiplyTransformation(s,Y,SY);return Jst(W)?Mn.fromTransformation(W,a):Zst(W,a)}var Mh=Xo;function kl(){this.orientedBoundingBox=new Mn,this.boundingSphere=new ae,this.boundTransform=new N,this.shapeTransform=new N,this._rectangle=new ce,this._minimumHeight=kl.DefaultMinBounds.z,this._maximumHeight=kl.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new m,this._rotation=new Q,this.shaderUniforms={ellipsoidRadiiUv:new m,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeCosSqrHalfMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new H,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Qst=new m,$st=new Q,Ege=new m,bge=new m,Sge=new m,vge=new m,eat=new ce;kl.prototype.update=function(e,t,n,i,r){i=y(i,kl.DefaultMinBounds),r=y(r,kl.DefaultMaxBounds);let o=kl.DefaultMinBounds.x,s=kl.DefaultMaxBounds.x,a=s-o,c=.5*a,l=kl.DefaultMinBounds.y,f=kl.DefaultMaxBounds.y,d=f-l,p=P.EPSILON10,g=P.EPSILON3,h=P.EPSILON10,A=P.EPSILON10,x=P.EPSILON3,C=P.clamp(t.x,o,s),T=P.clamp(n.x,o,s),E=P.clamp(i.x,o,s),S=P.clamp(r.x,o,s),w=Math.max(C,E),D=Math.min(T,S),M=P.clamp(t.y,l,f),O=P.clamp(n.y,l,f),B=P.clamp(i.y,l,f),L=P.clamp(r.y,l,f),_=Math.max(M,B),b=Math.min(O,L),v=N.getScale(e,Qst),I=v.x===v.y&&v.y===v.z,R=m.minimumComponent(v),F=Math.max(t.z,-R),k=Math.max(n.z,-R),V=Math.max(i.z,-R),G=Math.max(r.z,-R),U=Math.max(F,V),Y=Math.min(k,G),W=m.add(v,m.fromElements(F,F,F,bge),bge),J=m.add(v,m.fromElements(k,k,k,Ege),Ege),j=m.maximumComponent(J),K=m.add(v,m.fromElements(U,U,U,vge),vge),Z=m.add(v,m.fromElements(Y,Y,Y,Sge),Sge);if(_>b||_===f||b===l||U>Y||P.equalsEpsilon(Z,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,M,T,O),this._translation=N.getTranslation(e,this._translation),this._rotation=N.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(v,this._ellipsoid),this._minimumHeight=F,this._maximumHeight=k;let me=ce.fromRadians(w,_,D,b,eat);this.orientedBoundingBox=wge(me,U,Y,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=N.fromRotationTranslation(Q.setScale(this._rotation,J,$st),this._translation,this.shapeTransform),this.boundTransform=N.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ye=D<w,se=D-w+ye*a,pe=se<=h,Ae=se>c+h&&se<a-h,De=se>=c-h&&se<=c+h,Ce=se>h&&se<c-h,Re=pe||Ae||De||Ce,tt=T<C,nt=T-C+tt*a,Wt=nt<=h,un=nt>c+h&&nt<a-h,pt=nt>=c-h&&nt<=c+h,gn=nt>h&&nt<c-h,Bn=Wt||un||pt||gn,Ut=b<-x,kt=b>=-x&&b<=+x,Ee=b>+x&&b<f-A,xe=Ut||kt||Ee,ft=_>l+A&&_<-x,di=_>=-x&&_<=+x,Xe=_>+x,Xi=ft||di||Xe,Or=xe||Xi,Jo=O-M,Uo=O<-x,xs=O>=-x&&O<=+x,Ue=O>+x&&O<f-A,ot=Uo||xs||Ue,Ge=M>l+A&&M<-x,Je=M>=-x&&M<=+x,it=M>+x,_n=ot||(Ge||Je||it),mr=!m.equals(K,m.ZERO),Er=!m.equals(Z,m.ZERO),Cs=mr||Er,Ts=Y-U,mo=!m.equals(W,m.ZERO),Di=!m.equals(J,m.ZERO),Vo=mo||Di,Gn=this.shaderUniforms,vn=this.shaderDefines;for(let Ci in vn)vn.hasOwnProperty(Ci)&&(vn[Ci]=void 0);Gn.ellipsoidRadiiUv=m.divideByScalar(J,j,Gn.ellipsoidRadiiUv),Gn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Gn.ellipsoidRadiiUv,Gn.ellipsoidRadiiUv,Gn.ellipsoidInverseRadiiSquaredUv),Gn.ellipsoidInverseRadiiSquaredUv);let Wn=0;if(vn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Wn,Wn+=1,Cs&&(Ts===0&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),mr&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,vn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Wn,Wn+=1,Gn.ellipsoidInverseInnerScaleUv=j/(j-(k-U))),Er&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Gn.ellipsoidInverseOuterScaleUv=j/(j-(k-Y)))),Vo){if(mo){vn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let Ci=(k-F)/j;Gn.ellipsoidInverseHeightDifferenceUv=1/Ci,Gn.ellipseInnerRadiiUv=H.fromElements(Gn.ellipsoidRadiiUv.x*(1-Ci),Gn.ellipsoidRadiiUv.z*(1-Ci),Gn.ellipseInnerRadiiUv)}F===k&&(vn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Re&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,vn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Wn,Ae?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Wn+=1):Ce?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Wn+=2):De?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,Wn+=1):pe&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Wn+=2),Gn.ellipsoidRenderLongitudeMinMax=H.fromElements(w,D,Gn.ellipsoidRenderLongitudeMinMax)),Bn){vn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,T<C&&(vn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let Ws=a/nt,Es=-(C-o)/nt;Gn.ellipsoidUvToShapeUvLongitude=H.fromElements(Ws,Es,Gn.ellipsoidUvToShapeUvLongitude)}if(Re){let Ci=P.equalsEpsilon(w,o,void 0,g),Ws=P.equalsEpsilon(D,s,void 0,g);Ci&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Ws&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Es=(C-o)/a,La=(T-o)/a,js=(D-o)/a,td=1-se/a,ha=(js+.5*td)%1;Gn.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(Es,La,ha,Gn.ellipsoidShapeUvLongitudeMinMaxMid)}if(Or){vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,Xi&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,vn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Wn,ft?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Wn+=1):di?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Wn+=1):Xe&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Wn+=2)),xe&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,vn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Wn,Ut?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Wn+=2):kt?(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Wn+=1):Ee&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Wn+=1)),_===b&&(vn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let Ci=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(_)),2),Ws=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(b)),2);Gn.ellipsoidRenderLatitudeCosSqrHalfMinMax=H.fromElements(Ci,Ws,Gn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(_n){vn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,M===O&&(vn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let Ci=d/Jo,Ws=(l-M)/Jo;Gn.ellipsoidUvToShapeUvLatitude=H.fromElements(Ci,Ws,Gn.ellipsoidUvToShapeUvLatitude)}return I&&(vn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=Wn,!0};var tat=new ce;kl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,l=(n+1)*o,f=i*o,d=(i+1)*o,p=ce.subsection(this._rectangle,s,c,a,l,tat),g=P.lerp(this._minimumHeight,this._maximumHeight,f),h=P.lerp(this._minimumHeight,this._maximumHeight,d);return wge(p,g,h,this._ellipsoid,this._translation,this._rotation,r)};kl.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,r=this._maximumHeight;return .5*((r-i)/(n+r))/e.z};function wge(e,t,n,i,r,o,s){return s=Mn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,r,s.center),s.halfAxes=Q.multiply(s.halfAxes,o,s.halfAxes),s}kl.DefaultMinBounds=Object.freeze(new m(-P.PI,-P.PI_OVER_TWO,-Number.MAX_VALUE));kl.DefaultMaxBounds=Object.freeze(new m(+P.PI,+P.PI_OVER_TWO,+Number.MAX_VALUE));var aC=kl;var Lu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Lu.getMinBounds=function(e){switch(e){case Lu.BOX:return Oh.DefaultMinBounds;case Lu.ELLIPSOID:return aC.DefaultMinBounds;case Lu.CYLINDER:return Mh.DefaultMinBounds}};Lu.getMaxBounds=function(e){switch(e){case Lu.BOX:return Oh.DefaultMaxBounds;case Lu.ELLIPSOID:return aC.DefaultMaxBounds;case Lu.CYLINDER:return Mh.DefaultMaxBounds}};Lu.getShapeConstructor=function(e){switch(e){case Lu.BOX:return Oh;case Lu.ELLIPSOID:return aC;case Lu.CYLINDER:return Mh}};var qi=Object.freeze(Lu);function rN(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new nN;let t=this,n;u(e.url)&&($("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(e.url).then(function(i){let r=we.createIfNeeded(i);return r.fetchJson().then(function(o){return n=o,Pge(n),Mge(n,r).load()}).then(function(o){let s=n.root,a=s.content.extensions["3DTILES_content_voxels"],c=a.class,l=ni(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,f=o.schema,d=new oy({metadataJson:l,schema:f});Rge(t,d,c);let p=new sy(r,s,f),{shape:g,minBounds:h,maxBounds:A,shapeTransform:x,globalTransform:C}=Oge(s);t.shape=g,t.minBounds=h,t.maxBounds=A,t.dimensions=m.unpack(a.dimensions),t.shapeTransform=x,t.globalTransform=C,t.maximumTileCount=Ige(d);let T,E;return u(a.padding)&&(T=m.unpack(a.padding.before),E=m.unpack(a.padding.after)),t.paddingBefore=T,t.paddingAfter=E,t._implicitTileset=p,Ui.unload(o),t._ready=!0,t})}))}Object.defineProperties(rN.prototype,{readyPromise:{get:function(){return $("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return $("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});rN.fromUrl=async function(e){let t=we.createIfNeeded(e),n=await t.fetchJson();Pge(n);let i=Mge(n,t);await i.load();let r=n.root,o=r.content.extensions["3DTILES_content_voxels"],s=o.class,a=ni(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,l=new oy({metadataJson:a,schema:c}),f=new rN;Rge(f,l,s);let d=new sy(t,r,c),{shape:p,minBounds:g,maxBounds:h,shapeTransform:A,globalTransform:x}=Oge(r);f.shape=p,f.minBounds=g,f.maxBounds=h,f.dimensions=m.unpack(o.dimensions),f.shapeTransform=A,f.globalTransform=x,f.maximumTileCount=Ige(l);let C,T;return u(o.padding)&&(C=m.unpack(o.padding.before),T=m.unpack(o.padding.after)),f.paddingBefore=C,f.paddingAfter=T,f._implicitTileset=d,Ui.unload(i),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function Ige(e){if(u(e.tileset))return e.tileset.getPropertyBySemantic(MA.TILESET_TILE_COUNT)}function Pge(e){let t=e.root;if(!u(t.content))throw new de("Root must have content");if(!ni(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!ni(t,"3DTILES_implicit_tiling")&&!u(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!u(e.schema)&&!u(e.schemaUri)&&!ni(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function Oge(e){let t=e.boundingVolume,n;if(u(e.transform)?n=N.unpack(e.transform):n=N.clone(N.IDENTITY),u(t.box))return iat(t.box,n);if(u(t.region))return nat(t.region);if(ni(t,"3DTILES_bounding_volume_cylinder"))return rat(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function nat(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=N.fromScale(re.WGS84.radii),c=t,l=i,f=n,d=r,p=o,g=s,h=new m(c,f,p),A=new m(l,d,g);return{shape:qi.ELLIPSOID,minBounds:h,maxBounds:A,shapeTransform:a,globalTransform:N.clone(N.IDENTITY)}}function iat(e,t){let n=Mn.unpack(e),i=N.fromRotationTranslation(n.halfAxes,n.center);return{shape:qi.BOX,minBounds:m.clone(Oh.DefaultMinBounds),maxBounds:m.clone(Oh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function rat(e,t){let n=Mn.unpack(e),i=N.fromRotationTranslation(n.halfAxes,n.center);return{shape:qi.CYLINDER,minBounds:m.clone(Mh.DefaultMinBounds),maxBounds:m.clone(Mh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Mge(e,t){let{schemaUri:n,schema:i}=e;return u(n)?Ui.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ui.getSchemaLoader({schema:i})}function Rge(e,t,n){let{schema:i,statistics:r}=t,o=r?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:h}=p,A=o?.properties[d].min,x=o?.properties[d].max,C=qt.getComponentCount(g),T=Dge(A,C),E=Dge(x,C);return{id:d,type:g,componentType:h,minValue:T,maxValue:E}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),l=a.map(d=>d.maxValue),f=c.some(u);e.minimumValues=f?c:void 0,e.maximumValues=f?l:void 0}function Dge(e,t){if(!u(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function oat(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),r=await i.fetchArrayBuffer(),o=oh(r);return await iN.fromJson(i,o.jsonPayload,o.binaryPayload,e.metadataSchema)}async function sat(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(u(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),u(r))return r;let c=oh(a);return r=await OA.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}rN.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),r=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new cx({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),l=c.isSubtreeRoot()&&c.level>0,f=l?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return sat(this,f).then(function(p){return(l?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?oat(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var wY=rN;function DY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(DY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});DY.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=m.fromElements(i,r,o,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var oN=DY;var IY={CUMULUS:0};IY.validate=function(e){return e===IY.CUMULUS};var mS=Object.freeze(IY);var sN=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. + // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, + // but doing it here allows us to change the radii without rewriting the vertex data, and + // allows all ellipsoids to reuse the same vertex data. + vec4 p = vec4(u_radii * position, 1.0); - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); + v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates + gl_Position = czm_modelViewProjection * p; // position in clip coordinates - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} + // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums + // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the + // ellipsoid (does not write depth) that was rendered in the farther frustum. + // + // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates + // artifacts since some fragments can be alpha blended twice. This is solved by only rendering + // the ellipsoid in the closest frustum to the viewer. + gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); + czm_vertexLogDepth(); } +`;/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */var HN=`/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ -vec4 sampleNoiseTexture(vec3 position) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); - - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); +// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples +// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); -} +// Steps used to integrate into Cesium: +// * The following defines are set: +// #define FXAA_PC 1 +// #define FXAA_WEBGL_1 1 +// #define FXAA_GREEN_AS_LUMA 1 +// #define FXAA_EARLY_EXIT 1 +// #define FXAA_GLSL_120 1 +// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. +// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace +// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. +// * There are no implicit conversions from ivec* to vec* so replace: +// #define FxaaInt2 ivec2 +// with +// #define FxaaInt2 vec2 +// * The texture2DLod function is only available in vertex shaders so replace: +// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +// with +// #define FxaaTexTop(t, p) texture(t, p) +// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) +// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. +// * The following parameters to FxaaPixelShader are unused and can be removed: +// fxaaConsolePosPos +// fxaaConsoleRcpFrameOpt +// fxaaConsoleRcpFrameOpt2 +// fxaaConsole360RcpFrameOpt2 +// fxaaConsoleEdgeSharpness +// fxaaConsoleEdgeThreshold +// fxaaConsoleEdgeThresholdMi +// fxaaConsole360ConstDir -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +//#define FXAA_QUALITY_PRESET 12 - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; - } - } - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; -} - -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } - - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; - } - return intersected; -} - -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} - -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} - -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; - -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; -} - -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection - -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} - -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); - -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } - - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; - - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. - - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; - - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; - - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. - - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); - - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; - - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); - - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} - -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#if (FXAA_QUALITY_PRESET == 10) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 3.0 + #define FXAA_QUALITY_P2 12.0 #endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; - - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); - - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } -#else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; +#if (FXAA_QUALITY_PRESET == 11) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 3.0 + #define FXAA_QUALITY_P3 12.0 #endif +#if (FXAA_QUALITY_PRESET == 12) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 4.0 + #define FXAA_QUALITY_P4 12.0 #endif -} -`;var aN=`#ifdef INSTANCED -in vec2 direction; +#if (FXAA_QUALITY_PRESET == 13) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 4.0 + #define FXAA_QUALITY_P5 12.0 #endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; - -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; - -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; - -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; +#if (FXAA_QUALITY_PRESET == 14) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 4.0 + #define FXAA_QUALITY_P6 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 15) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 20) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 2.0 + #define FXAA_QUALITY_P2 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 21) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 22) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 23) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 24) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 3.0 + #define FXAA_QUALITY_P6 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 25) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 26) + #define FXAA_QUALITY_PS 9 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 4.0 + #define FXAA_QUALITY_P8 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 27) + #define FXAA_QUALITY_PS 10 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 4.0 + #define FXAA_QUALITY_P9 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 28) + #define FXAA_QUALITY_PS 11 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 4.0 + #define FXAA_QUALITY_P10 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 29) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 39) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.0 + #define FXAA_QUALITY_P2 1.0 + #define FXAA_QUALITY_P3 1.0 + #define FXAA_QUALITY_P4 1.0 + #define FXAA_QUALITY_P5 1.5 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 #endif - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; - - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var cN=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} - -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; -} - -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; - - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); - - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } - - return shortestDistance; -} - -const float MAX_FBM_ITERATIONS = 10.0; - -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } - - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; -} - -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var lN=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; +#define FxaaBool bool +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 vec2 +#define FxaaTex sampler2D -out vec2 v_position; +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTexTop(t, p) texture(t, p) +#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;function Am(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!u(e.scale)&&u(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var aat=Am.SHOW_INDEX=0,cat=Am.POSITION_INDEX=1,lat=Am.SCALE_INDEX=2,uat=Am.MAXIMUM_SIZE_INDEX=3,fat=Am.SLICE_INDEX=4,dat=Am.BRIGHTNESS_INDEX=5,mat=Am.COLOR_INDEX=6;Am.NUMBER_OF_PROPERTIES=7;function cC(e,t){let n=e._cloudCollection;u(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Am.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,cC(this,aat))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),cC(this,cat))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),cC(this,lat))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),cC(this,uat))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),cC(this,mat))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,cC(this,fat))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,cC(this,dat))}}});Am.prototype._destroy=function(){this._cloudCollection=void 0};var Nu=Am;var Fu,Pz=new m,hat={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},pat={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},_at=Nu.SHOW_INDEX,gat=Nu.POSITION_INDEX,yat=Nu.SCALE_INDEX,Aat=Nu.MAXIMUM_SIZE_INDEX,xat=Nu.SLICE_INDEX,Cat=Nu.BRIGHTNESS_INDEX,Tat=Nu.NUMBER_OF_PROPERTIES,Eat=Nu.COLOR_INDEX;function xm(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Tat),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:Bge(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function Bge(e){return function(){return Pz.x=e._textureSliceWidth,Pz.y=e._noiseTextureRows,Pz.z=1/e._noiseTextureRows,Pz}}Object.defineProperties(xm.prototype,{length:{get:function(){return OY(this),this._clouds.length}}});function Lge(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}xm.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,mS.CUMULUS),n;return t===mS.CUMULUS&&(n=new Nu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};xm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};xm.prototype.removeAll=function(){Lge(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function OY(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];u(s)&&(n._index=o++,t.push(s))}e._clouds=t}}xm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};xm.prototype.contains=function(e){return u(e)&&e._cloudCollection===this};xm.prototype.get=function(e){return OY(this),this._clouds[e]};var bat=new Float32Array([-1,-1,1,-1,1,1,-1,1]),Sat=new Uint16Array([0,1,2,0,2,3]);function vat(e){let t=mt.createVertexBuffer({context:e,typedArray:bat,usage:Ne.STATIC_DRAW}),n=mt.createIndexBuffer({context:e,typedArray:Sat,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new oi({context:e,attributes:i,indexBuffer:n})}var MY;function wat(e){let n=e.cache.cloudCollection_indexBufferBatched;if(u(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function Dat(e){let t=e.cache.cloudCollection_indexBufferInstanced;return u(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function Iat(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return u(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function Pat(e,t,n){let i=[{index:Fu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Ne.STATIC_DRAW},{index:Fu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Ne.STATIC_DRAW},{index:Fu.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Ne.STATIC_DRAW},{index:Fu.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Ne.STATIC_DRAW},{index:Fu.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:Fu.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Iat(e)});let r=n?t:4*t;return new ap(e,i,r,n)}var PY=new qn;function Nge(e,t,n,i){let r,o=n[Fu.positionHighAndScaleX],s=n[Fu.positionLowAndScaleY],a=i.position;qn.fromCartesian(a,PY);let c=i.scale,l=PY.high,f=PY.low;e._instanced?(r=i._index,o(r,l.x,l.y,l.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,l.x,l.y,l.z,c.x),o(r+1,l.x,l.y,l.z,c.x),o(r+2,l.x,l.y,l.z,c.x),o(r+3,l.x,l.y,l.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function Fge(e,t,n,i){let r,o=n[Fu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function Uge(e,t,n,i){let r,o=n[Fu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function Vge(e,t,n,i){let r,o=n[Fu.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),l=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,l,f)):(r=i._index*4,o(r+0,a,c,l,f),o(r+1,a,c,l,f),o(r+2,a,c,l,f),o(r+3,a,c,l,f))}function Oat(e,t,n,i){Nge(e,t,n,i),Fge(e,t,n,i),Uge(e,t,n,i),Vge(e,t,n,i)}function Mat(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=vat(a),r._spNoise=Kt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,l=r.noiseOffset;r._noiseTexture=new Rt({context:a,width:o*o/s,height:o*s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:at.RGBA,sampler:new fn({wrapS:wn.REPEAT,wrapT:wn.REPEAT,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})});let f=new Yu({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:Bge(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return l}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function Rat(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=Pat(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];Oat(e,t,s,c)}n._vaf.commit(MY(i))}}var Bat=[];function Lat(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,l=Bat;l.length=0,(c[gat]||c[yat])&&l.push(Nge),(c[_at]||c[Cat])&&l.push(Fge),(c[Aat]||c[xat])&&l.push(Uge),c[Eat]&&l.push(Vge);let f=l.length,d=i._vaf.writers,p,g,h;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,h=0;h<f;++h)l[h](e,t,d,g);i._vaf.commit(MY(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,h=0;h<f;++h)l[h](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Nat(e,t,n,i){let r=t.context,o=e,s=new ke({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new ke({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Kt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Fu}),o._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:dn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function Fat(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let l=0;l<c;l++){let f=s[l];u(f)||(f=s[l]=new et),f.pass=ve.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[l].indicesCount,f.vertexArray=a[l].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}xm.prototype.update=function(e){if(OY(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:u(this._noiseTexture),!this._ready&&!this._loading&&!t&&Mat(this,e,lN,cN),this._instanced=e.context.instancedArrays,Fu=this._instanced?pat:hat,MY=this._instanced?Dat:wat;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?Rat(this,e):o>0&&Lat(this,e),o>i*1.5&&(r.length=i),!(!u(this._vaf)||!u(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Nat(this,e,aN,sN),Fat(this,e))};xm.prototype.isDestroyed=function(){return!1};xm.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Lge(this._clouds),ue(this)};var RY=xm;async function BY(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!u(n))return o;await n._readyPromise;let a=n.availability;if(!u(a)||t.mode===ne.SCENE2D)return o;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],l=await BY._sampleTerrainMostDetailed(n,c),f=!1,d=l.reduce(function(g,h){return u(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}BY._sampleTerrainMostDetailed=v_;var lC=BY;var Uat=P.toRadians(30);function LY(e){this._angle=y(e,Uat)}Object.defineProperties(LY.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});LY.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=m.fromElements(r,o,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var NY=LY;var Vat=new z,kat=new z,zat=new z,Hat=new z,kge=new oe,uN=new Uint8Array(4);function zge(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function Oz(e,t){return{height:e,color:z.clone(t)}}function Hge(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function Gat(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],h=P.clamp(g.height,zl._minimumHeight,zl._maximumHeight),A=z.clone(g.color,Vat);A.red*=A.alpha,A.green*=A.alpha,A.blue*=A.alpha,c.push(Oz(h,A))}let l=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],h=c[n+1];l=l&&g.height<=h.height,f=f&&g.height>=h.height}f?c=c.reverse():l||B_(c,function(g,h){return P.sign(g.height-h.height)});let d=y(o.extendDownwards,!1),p=y(o.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,Oz(zl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,Oz(zl._maximumHeight,c[c.length-1].color)),c=Hge(c),i.push(c)}return i}function Wat(e){let t=Gat(e),n=[],i=[],r;function o(l,f){n.push(Oz(l,f))}function s(l,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Hat);p=z.add(p,f,p),o(l,p)}let a=t.length;for(r=0;r<a;r++){let l=t[r],f=0,d=0;i=n,n=[];let p=l.length,g=i.length;for(;f<p||d<g;){let h=f<p?l[f]:void 0,A=f>0?l[f-1]:void 0,x=f<p-1?l[f+1]:void 0,C=d<g?i[d]:void 0,T=d>0?i[d-1]:void 0,E=d<g-1?i[d+1]:void 0;if(u(h)&&u(C)&&h.height===C.height){let S=u(E)&&C.height===E.height,w=!u(T),D=!u(E),M=u(x)&&h.height===x.height,O=!u(A),B=!u(x);S?M?(s(h.height,h.color,C.color),s(h.height,x.color,E.color)):O?(o(h.height,C.color),s(h.height,h.color,E.color)):B?(s(h.height,h.color,C.color),o(h.height,E.color)):(s(h.height,h.color,C.color),s(h.height,h.color,E.color)):w?M?(o(h.height,h.color),s(h.height,x.color,C.color)):B?(o(h.height,h.color),o(h.height,C.color)):(O||o(h.height,h.color),s(h.height,h.color,C.color)):D?M?(s(h.height,h.color,C.color),o(h.height,x.color)):O?(o(h.height,C.color),o(h.height,h.color)):B?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),o(h.height,h.color)):M?(s(h.height,h.color,C.color),s(h.height,x.color,C.color)):O?(o(h.height,C.color),s(h.height,h.color,C.color)):B?(s(h.height,h.color,C.color),o(h.height,C.color)):s(h.height,h.color,C.color),f+=M?2:1,d+=S?2:1}else if(u(h)&&u(C)&&u(T)&&h.height<C.height){let S=zge(h.height,T,C,zat);u(A)?u(x)?s(h.height,h.color,S):(s(h.height,h.color,S),o(h.height,S)):(o(h.height,S),s(h.height,h.color,S)),f++}else if(u(C)&&u(h)&&u(A)&&C.height<h.height){let S=zge(C.height,A,h,kat);u(T)?u(E)?s(C.height,S,C.color):(s(C.height,S,C.color),o(C.height,S)):(o(C.height,S),s(C.height,S,C.color)),d++}else u(h)&&(!u(C)||h.height<C.height)?(u(C)&&!u(T)&&!u(x)?(o(h.height,h.color),o(h.height,zl._emptyColor),o(C.height,zl._emptyColor)):(!u(C)&&u(T)&&!u(A)&&(o(T.height,zl._emptyColor),o(h.height,zl._emptyColor)),o(h.height,h.color)),f++):u(C)&&(!u(h)||C.height<h.height)&&(o(C.height,C.color),d++)}}return Hge(n)}function zl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,r=Wat(n),o=r.length,s,a,c;if(!zl._useFloatTexture(i)){a=Ke.UNSIGNED_BYTE,c=at.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)oe.packFloat(r[g].height,kge),oe.pack(kge,s,g*4)}else{a=Ke.FLOAT,c=i.webgl2?at.RED:at.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Rt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(uN),d[g*4+0]=uN[0],d[g*4+1]=uN[1],d[g*4+2]=uN[2],d[g*4+3]=uN[3];let p=Rt.create({context:i,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})});return Wi.fromType("ElevationBand",{heights:f,colors:p})}zl._useFloatTexture=function(e){return e.floatingPointTexture};zl._maximumHeight=5906376425472;zl._minimumHeight=-5906376425472;zl._emptyColor=new z(0,0,0,0);var FY=zl;function jat(e){$("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),e=_t(e,{url:Qs.fromAssetId(96188)});let t=new va(e),n=e.style;if(!u(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new F_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var UY=jat;async function qat(e){let t=await va.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!u(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new F_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var VY=qat;function Yat(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!u(n.attributes)||!u(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=N.clone(y(e.modelMatrix,N.IDENTITY)),o=y(e.length,1e4);if(u(i.normal)&&t.push(new Ct({geometry:Nn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new zt(1,0,0,1)},modelMatrix:r})),u(i.tangent)&&t.push(new Ct({geometry:Nn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new zt(0,1,0,1)},modelMatrix:r})),u(i.bitangent)&&t.push(new Ct({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new zt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Sn({asynchronous:!1,geometryInstances:t,appearance:new sn({flat:!0,translucent:!1})})}var kY=Yat;var Gge=/{[^}]+}/g,GY={x:Jat,y:Qat,z:tct,s:nct,reverseX:Zat,reverseY:$at,reverseZ:ect,westDegrees:ict,southDegrees:rct,eastDegrees:oct,northDegrees:sct,westProjected:act,southProjected:cct,eastProjected:lct,northProjected:uct,width:fct,height:dct},Wge=_t(GY,{i:mct,j:hct,reverseI:pct,reverseJ:_ct,longitudeDegrees:yct,latitudeDegrees:Act,longitudeProjected:xct,latitudeProjected:Cct,format:Ect});function uC(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,u(e.then)){this._reinitialize(e);return}let t=we.createIfNeeded(e.url),n=we.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():u(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new No({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new Dt(r)),this._credit=r,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let o=e.customTags,s=_t(GY,o),a=_t(Wge,o);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(uC.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready&&u(this._resource)}},readyPromise:{get:function(){return $("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});uC.prototype.reinitialize=function(e){return $("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._reinitialize(e)};uC.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,r=_t(GY,i),o=_t(Wge,i),s=we.createIfNeeded(n.url),a=we.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():u(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new No({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new Dt(c)),t._credit=c,t._resource=s,t._tags=r,t._pickFeaturesResource=a,t._pickFeaturesTags=o,t._ready=!0,!0})};uC.prototype.getTileCredits=function(e,t,n){};uC.prototype.requestImage=function(e,t,n,i){return Qc.loadImage(this,Xat(this,e,t,n,i))};uC.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!u(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(l,f){return l.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let l=s._getFeatureInfoFormats[o],f=Kat(s,e,t,n,i,r,l.format);return++o,l.type==="json"?f.fetchJson().then(l.callback).catch(c):l.type==="xml"?f.fetchXML().then(l.callback).catch(c):l.type==="text"||l.type==="html"?f.fetchText().then(l.callback).catch(c):f.fetch({responseType:l.format}).then(a.bind(void 0,l)).catch(c)}return c()};var Mz=!1,Uu=new ce,Rz=!1,fN=new ce;function Xat(e,t,n,i,r){Mz=!1,Rz=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},l=s.match(Gge);return u(l)&&l.forEach(function(f){let d=f.substring(1,f.length-1);u(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var zY=!1,pS=new H,HY=!1;function Kat(e,t,n,i,r,o,s){Mz=!1,Rz=!1,zY=!1,HY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),l=e._pickFeaturesTags,f={},d=c.match(Gge);return u(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);u(l[g])&&(f[g]=l[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function _S(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Jat(e,t,n,i){return _S(e,"{x}",t)}function Zat(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return _S(e,"{reverseX}",r)}function Qat(e,t,n,i){return _S(e,"{y}",n)}function $at(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return _S(e,"{reverseY}",r)}function ect(e,t,n,i){let r=e.maximumLevel,o=u(r)&&i<r?r-i-1:i;return _S(e,"{reverseZ}",o)}function tct(e,t,n,i){return _S(e,"{z}",i)}function nct(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function Bz(e,t,n,i){Mz||(e.tilingScheme.tileXYToRectangle(t,n,i,Uu),Uu.west=P.toDegrees(Uu.west),Uu.south=P.toDegrees(Uu.south),Uu.east=P.toDegrees(Uu.east),Uu.north=P.toDegrees(Uu.north),Mz=!0)}function ict(e,t,n,i){return Bz(e,t,n,i),Uu.west}function rct(e,t,n,i){return Bz(e,t,n,i),Uu.south}function oct(e,t,n,i){return Bz(e,t,n,i),Uu.east}function sct(e,t,n,i){return Bz(e,t,n,i),Uu.north}function Lz(e,t,n,i){Rz||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,fN),Rz=!0)}function act(e,t,n,i){return Lz(e,t,n,i),fN.west}function cct(e,t,n,i){return Lz(e,t,n,i),fN.south}function lct(e,t,n,i){return Lz(e,t,n,i),fN.east}function uct(e,t,n,i){return Lz(e,t,n,i),fN.north}function fct(e,t,n,i){return e.tileWidth}function dct(e,t,n,i){return e.tileHeight}function mct(e,t,n,i,r,o,s){return Nz(e,t,n,i,r,o),pS.x}function hct(e,t,n,i,r,o,s){return Nz(e,t,n,i,r,o),pS.y}function pct(e,t,n,i,r,o,s){return Nz(e,t,n,i,r,o),e.tileWidth-pS.x-1}function _ct(e,t,n,i,r,o,s){return Nz(e,t,n,i,r,o),e.tileHeight-pS.y-1}var gct=new ce,hS=new m;function Nz(e,t,n,i,r,o,s){if(zY)return;WY(e,t,n,i,r,o);let a=hS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,gct);pS.x=e.tileWidth*(a.x-c.west)/c.width|0,pS.y=e.tileHeight*(c.north-a.y)/c.height|0,zY=!0}function yct(e,t,n,i,r,o,s){return P.toDegrees(r)}function Act(e,t,n,i,r,o,s){return P.toDegrees(o)}function xct(e,t,n,i,r,o,s){return WY(e,t,n,i,r,o),hS.x}function Cct(e,t,n,i,r,o,s){return WY(e,t,n,i,r,o),hS.y}var Tct=new he;function WY(e,t,n,i,r,o,s){if(!HY){if(e.tilingScheme.projection instanceof Ii)hS.x=P.toDegrees(r),hS.y=P.toDegrees(o);else{let a=Tct;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,hS)}HY=!0}}function Ect(e,t,n,i,r,o,s){return s}var zs=uC;function Vu(e){if(e=y(e,y.EMPTY_OBJECT),u(e.url)){$("TileMapServiceImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use TileMapServiceImageryProvider.fromUrl instead."),this._metadataError=void 0,this._ready=!1;let t,n=this,i=Promise.resolve(e.url).then(function(r){return t=we.createIfNeeded(r),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),Vu._requestMetadata(e,n._tmsResource,n._xmlResource,n)}).catch(r=>Promise.reject(r));zs.call(this,i),this._promise=i}}Vu._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Vu._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof Rm)return Vu._metadataFailure(e,t);throw r}};Vu.fromUrl=async function(e,t){let n=we.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let o=await Vu._requestMetadata(t,i,r),s=new Vu;return zs.call(s,o),s};u(Object.create)&&(Vu.prototype=Object.create(zs.prototype),Vu.prototype.constructor=Vu);function jge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function qge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),r=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Vu._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,l,f,d,p=[],g=e.childNodes[0].childNodes;for(let O=0;O<g.length;O++)if(o.test(g.item(O).nodeName))l=g.item(O);else if(a.test(g.item(O).nodeName)){d=g.item(O);let B=g.item(O).childNodes;for(let L=0;L<B.length;L++)s.test(B.item(L).nodeName)&&p.push(B.item(L))}else c.test(g.item(O).nodeName)&&(f=g.item(O));let h;if(!u(d)||!u(f))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,u(r)&&xi.reportError(void 0,r,r.errorEvent,h),new de(h);let A=y(t.fileExtension,l.getAttribute("extension")),x=y(t.tileWidth,parseInt(l.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(l.getAttribute("height"),10)),T=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),E=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=d.getAttribute("profile"),w=t.tilingScheme;if(!u(w))if(S==="geodetic"||S==="global-geodetic")w=new ji({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")w=new No({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${S}.`,u(r)&&xi.reportError(void 0,r,r.errorEvent,h),new de(h);let D=ce.clone(t.rectangle);if(!u(D)){let O,B,L,_;y(t.flipXY,!1)?(L=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let v=S==="geodetic"||S==="mercator";if(w.projection instanceof Ii||v)O=he.fromDegrees(L.x,L.y),B=he.fromDegrees(_.x,_.y);else{let I=w.projection;O=I.unproject(L),B=I.unproject(_)}D=new ce(O.longitude,O.latitude,B.longitude,B.latitude)}return D=jge(D,w),T=qge(w,D,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${A}`}),tilingScheme:w,rectangle:D,tileWidth:x,tileHeight:C,minimumLevel:T,maximumLevel:E,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Vu._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),r=y(e.tileHeight,256),o=e.maximumLevel,s=u(e.tilingScheme)?e.tilingScheme:new No({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=jge(a,s);let c=qge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Rh=Vu;function jY(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}jY.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function bct(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!u(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(r)}if(!u(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new de(r)}if(t.version=i.version,u(n.projection)&&n.projection==="flat")t.tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!u(n.projection)||n.projection==="mercator")t.tilingScheme=new No({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new de(r)}return!0}function Sct(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw u(e)&&u(e.message)&&(i+=`: ${e.message}`),xi.reportError(void 0,n,u(n)?n._errorEvent:void 0,i),new de(i)}async function Yge(e,t,n){try{let i=await e.fetchText();bct(i,t)}catch(i){Sct(i,e,n)}}function Hl(e){if(e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Dt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Hl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new _e,u(e.url)||u(e.channel)){$("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=we.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=new jY(e);this._readyPromise=Yge(r,o,this).then(()=>(o.build(this),this._ready=!0,!0))}}Object.defineProperties(Hl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Hl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),r=we.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new jY(n);s.channel=t,await Yge(o,s);let a=new Hl(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=r,a._url=e,a._path=i,a};Hl.prototype.getTileCredits=function(e,t,n){};Hl.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Qc.loadImage(this,r)};Hl.prototype.pickFeatures=function(e,t,n,i,r){};Hl._logoUrl=void 0;Object.defineProperties(Hl,{logoUrl:{get:function(){return u(Hl._logoUrl)||(Hl._logoUrl=en("Assets/Images/google_earth_credit.png")),Hl._logoUrl},set:function(e){Hl._logoUrl=e}}});var gS=Hl;var vct=/\/$/,Xge=new Dt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function yS(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=we.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=y(e.format,"png");/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();vct.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;u(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Dt(s))):s=Xge,this._resource=i,this._imageryProvider=new zs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(yS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});yS.prototype.getTileCredits=function(e,t,n){};yS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};yS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};yS._defaultCredit=Xge;var AS=yS;function fC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new ji({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new _e,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new Dt(i)),this._credit=i;let r=we.createIfNeeded(e.url);if(this._resource=r,u(e.tileWidth)||u(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}$("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=Fz(r,this).then(o=>(xi.reportSuccess(this._errorEvent),this._image=o,this._tileWidth=o.width,this._tileHeight=o.height,this._ready=!0,!0))}Object.defineProperties(fC.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function wct(e,t,n,i){let r=`Failed to load image ${e.url}`;u(t)&&u(t.message)&&(r+=`: ${t.message}`);let o=xi.reportError(i,n,u(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return Fz(e,n,o);throw u(n)&&(n._hasError=!0),new de(r)}async function Fz(e,t,n){try{return await Qc.loadImage(null,e)}catch(i){return wct(e,i,t,n)}}fC.fromUrl=async function(e,t){let n=we.createIfNeeded(e),i=await Fz(n);t=y(t,y.EMPTY_OBJECT);let r=new fC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};fC.prototype.getTileCredits=function(e,t,n){};fC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!u(this._image)){let r=await Fz(this._resource,this);return this._image=r,xi.reportSuccess(this._errorEvent),r}return this._image};fC.prototype.pickFeatures=function(e,t,n,i,r){};var xS=fC;function Dct(e,t,n){this.type=e,u(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,u(n)||(e==="json"?n=Ict:e==="xml"?n=Rct:(e==="html"||e==="text")&&(n=Kge)),this.callback=n}function Ict(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new ym;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),u(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var qY="http://www.mapinfo.com/mxp",Pct="http://www.esri.com/wms",Oct="http://www.opengis.net/wfs",Mct="http://www.opengis.net/gml";function Rct(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===qY)return Bct(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Pct)return Lct(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Oct)return Nct(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Fct(e):Uct(e)}function Bct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(qY,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(qY,"Val");for(let l=0;l<a.length;++l){let f=a[l];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new ym;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Lct(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let l=a[c];i[l.name]=l.value}n.push(Uz(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let l=0;l<c.length;++l){let f=c[l];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(Uz(a,i))}}return n}function Nct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Mct,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};YY(o,s),t.push(Uz(o,s))}return t}function Fct(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!u(n))throw new de("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};YY(s,a),t.push(Uz(s,a))}}return t}function YY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&YY(r,t)&&(t[r.localName]=r.textContent)}return n}function Uz(e,t){let n=new ym;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Uct(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new ym;return r.data=e,r.description=n.innerHTML,[r]}var Vct=/<body>\s*<\/body>/im,kct=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,zct=/<title>([\s\S]*)<\/title>/im;function Kge(e){if(Vct.test(e)||kct.test(e))return;let t,n=zct.exec(e);n&&n.length>1&&(t=n[1]);let i=new ym;return i.name=t,i.description=e,i.data=e,[i]}var dC=Dct;function dN(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(dN.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});dN.prototype.getFromCache=function(e,t,n,i){let r=Jge(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(u(s)&&u(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};dN.prototype.checkApproachingInterval=function(e,t,n,i){let r=Jge(e,t,n),o=this._tilesRequestedForInterval,s=Zge(this),a={key:r,priorityFunction:i.priorityFunction};(!u(s)||!Qge(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};dN.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=Zge(this);if(u(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Qge(this,c,o),a||s.push(c)}}};function Jge(e,t,n){return`${e}-${t}-${n}`}function Hct(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Zge(e){let t=e._times;if(!u(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function Qge(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];u(o)||(o=r[i]={});let s=t.key;if(u(o[s]))return!0;let a=Hct(s),c=new qr({throttle:!1,throttleByServer:!0,type:$o.IMAGERY,priorityFunction:t.priorityFunction}),l=e._requestImageFunction(a.x,a.y,a.level,c,n);return u(l)?(o[s]={promise:l,request:c},!0):!1}var mC=dN;var Gct=[3034,3035,3042,3043,3044],Wct=[4471,4559];function Cm(e){if(e=y(e,y.EMPTY_OBJECT),u(e.times)&&!u(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=we.createIfNeeded(e.url),n=we.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Cm.DefaultParameters,!0),n.setQueryParameters(Cm.GetFeatureInfoDefaultParameters,!0),u(e.parameters)&&t.setQueryParameters($ge(e.parameters)),u(e.getFeatureInfoParameters)&&n.setQueryParameters($ge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,u(e.times)&&(this._timeDynamicImagery=new mC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,l,f){return eye(i,s,a,c,l,f)},reloadFunction:function(){u(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Wct.includes(a)||Gct.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new zs({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new ji({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Cm.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function eye(e,t,n,i,r,o){let s=u(o)?o.data:void 0,a=e._tileProvider;return u(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function jct(e,t,n,i,r,o,s){let a=u(s)?s.data:void 0,c=e._tileProvider;return u(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Cm.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return $("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return $("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Cm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Cm.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return u(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),u(r)||(r=eye(this,e,t,n,i,s)),u(r)&&u(o)&&o.checkApproachingInterval(e,t,n,i),r};Cm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=u(o)?o.currentInterval:void 0;return jct(this,e,t,n,i,r,s)};Cm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Cm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Cm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new dC("json","application/json")),Object.freeze(new dC("xml","text/xml")),Object.freeze(new dC("text","text/html"))]);function $ge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var CS=Cm;var qct=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function mN(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=we.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!u(o)||o.length===1&&/{s}/.test(r))t.setQueryParameters(qct),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=u(e.tilingScheme)?e.tilingScheme:new No({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,u(e.times)&&(this._timeDynamicImagery=new mC({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,A){return tye(s,d,p,g,h,A)},reloadFunction:function(){u(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),l=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new _e;let f=e.credit;this._credit=typeof f=="string"?new Dt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():u(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function tye(e,t,n,i,r,o){let s=e._tileMatrixLabels,a=u(s)?s[i]:i.toString(),c=e._subdomains,l=e._dimensions,f=u(o)?o.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(p),u(l)&&d.setTemplateValues(l),u(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,u(l)&&(g=_t(g,l)),u(f)&&(g=_t(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:r}),d.setTemplateValues(p)}return Qc.loadImage(e,d)}Object.defineProperties(mN.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return $("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,u(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});mN.prototype.getTileCredits=function(e,t,n){};mN.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return u(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),u(r)||(r=tye(this,e,t,n,i,s)),u(r)&&u(o)&&o.checkApproachingInterval(e,t,n,i),r};mN.prototype.pickFeatures=function(e,t,n,i,r){};var TS=mN;function U_(e){return function(t){return new e(t)}}var Yct={ARCGIS_MAPSERVER:U_(Ph),BING:U_(lS),GOOGLE_EARTH:U_(gS),MAPBOX:U_(AS),SINGLE_TILE:U_(xS),TMS:U_(Rh),URL_TEMPLATE:U_(zs),WMS:U_(CS),WMTS:U_(TS)},Xct={ARCGIS_MAPSERVER:Ph.fromUrl,BING:async(e,t)=>lS.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,gS.fromUrl(e,n,t)},MAPBOX:(e,t)=>new AS({url:e,...t}),SINGLE_TILE:xS.fromUrl,TMS:Rh.fromUrl,URL_TEMPLATE:(e,t)=>new zs({url:e,...t}),WMS:(e,t)=>new CS({url:e,...t}),WMTS:(e,t)=>new TS({url:e,...t})};function Gl(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new _e;let t=e.assetId;u(t)&&($("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),Gl._initialize(this,t,e))}Object.defineProperties(Gl.prototype,{ready:{get:function(){return $("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return $("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return $("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Gl._initialize=function(e,t,n){let i=Qs._createEndpointResource(t,n),r=t.toString()+n.accessToken+n.server,o=Gl._endpointCache[r];u(o)||(o=i.fetchJson(),Gl._endpointCache[r]=o),e._readyPromise=o.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!u(c))a=new Rh({url:new Qs(s,i)});else{let l=Yct[c];if(!u(l))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=l(s.options)}return e._tileCredits=Qs.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(l){l.provider=e,e._errorEvent.raiseEvent(l)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};Gl.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Qs._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Gl._endpointCache[i];u(r)||(r=n.fetchJson(),Gl._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=o.externalType;if(!u(a))s=await Rh.fromUrl(new Qs(o,n));else{let l=Xct[a];if(!u(l))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...o.options},d=f.url;delete f.url,s=await l(d,f)}let c=new Gl(t);return s.errorEvent.addEventListener(function(l){l.provider=c,c._errorEvent.raiseEvent(l)}),c._tileCredits=Qs.getCreditsFromEndpoint(o,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};Gl.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return u(i)?this._tileCredits.concat(i):this._tileCredits};Gl.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Gl.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Gl._endpointCache={};var Gf=Gl;var Kct={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Tm=Object.freeze(Kct);function Jct(e){$("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Tm.AERIAL),n=new Gf;return Gf._initialize(n,t,e),n}var XY=Jct;function Zct(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Tm.AERIAL);return Gf.fromAssetId(t)}var V_=Zct;var sye=Ki(Yl(),1),nye=576,Qct=100,hN="#ffffff",KY="#48b";function aye(e,t){this.credit=e,this.count=y(t,1)}function cye(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(Dt.equals(r,t))return!0}return!1}function $ct(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Dt.equals(n,t)||(u(t)&&e._cesiumCreditContainer.removeChild(t.element),u(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var lye="cesium-credit-delimiter";function iye(e){let t=document.createElement("span");return t.textContent=e,t.className=lye,t}function rye(e,t){if(u(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function oye(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(u(a)){if(o=s,u(n)&&(o*=2,s>0)){let l=o-1;if(r.length<=l)e.appendChild(iye(n));else{let f=r[l];f.className!==lye&&e.replaceChild(iye(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(rye(c,i));else{let l=r[o];l._creditId!==a._id&&e.replaceChild(rye(c,i),l)}}}for(++o;o<r.length;)e.removeChild(r[o])}function elt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<nye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=nye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Cc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } -`,n}function tlt(e){let t="";t+=Cc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=Cc(".cesium-credit-lightbox",{"background-color":"#303336",color:hN,position:"relative","min-height":`${Qct}px`,margin:"auto"}),t+=Cc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:hN}),t+=Cc(".cesium-credit-lightbox > ul > li a:hover",{color:KY}),t+=Cc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=Cc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=Cc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=Cc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:hN}),t+=Cc(".cesium-credit-lightbox-close:hover",{color:KY}),t+=Cc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=Cc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=Cc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=Cc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:hN}),t+=Cc(".cesium-credit-expand-link:hover",{color:KY}),t+=Cc(".cesium-credit-text",{color:hN}),t+=Cc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Fr(e,t,n){let i=this;n=y(n,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function s(h){o.contains(h.target)||i.hideLightbox()}r.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",o.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let l=document.createElement("ul");o.appendChild(l);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),tlt(e);let g=Dt.clone(Fr.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=l,this._lightbox=r,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Tt,lightboxCredits:new Tt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function uye(e,t,n,i){i=y(i,1);let r=t.get(n.id);if(u(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new aye(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Fr.prototype.addCredit=function(e){$("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};Fr.prototype.addCreditToNextFrame=function(e){if(e._isIon){u(this._defaultCredit)||(this._defaultCredit=Dt.clone(fye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,uye(this,t,e)};Fr.prototype.addDefaultCredit=function(e){$("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;cye(t,e)||(e.showOnScreen=!0,t.push(e))};Fr.prototype.addStaticCredit=function(e){let t=this._staticCredits;cye(t,e)||t.push(e)};Fr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Fr.prototype.removeDefaultCredit=function(e){$("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};Fr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Fr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Fr.prototype.update=function(){this._expanded&&elt(this)};Fr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o._isIon&&Dt.equals(Fr.cesiumCredit,this._cesiumCredit)||uye(this,s,o,Number.MAX_VALUE)}Dt.equals(Fr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Dt.clone(Fr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Fr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;oye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",oye(this._creditList,t,void 0,"li"),$ct(this)};Fr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Fr.prototype.isDestroyed=function(){return!1};Fr._cesiumCredit=void 0;Fr._cesiumCreditInitialized=!1;var Vz;function fye(){if(!u(Vz)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new sye.default(e).path()),Vz=new Dt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return Fr._cesiumCreditInitialized||(Fr._cesiumCredit=Vz,Fr._cesiumCreditInitialized=!0),Vz}Object.defineProperties(Fr,{cesiumCredit:{get:function(){return fye(),Fr._cesiumCredit},set:function(e){Fr._cesiumCredit=e,Fr._cesiumCreditInitialized=!0}}});Fr.CreditDisplayElement=aye;var pN=Fr;function _N(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;u(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } -`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } -`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } -`;break;case"vec4":o=`vec4 getColor() { return ${r}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${r}; -${o} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=or.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(_N.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});_N.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;_N.prototype.isTranslucent=or.prototype.isTranslucent;_N.prototype.getRenderState=or.prototype.getRenderState;var JY=_N;function kz(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var nlt=new m,ilt=new Q,rlt=new Le,olt=new wi,slt=new Zc,alt=new tn,clt=new bo,llt=new z,ult=[1,1e5];kz.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof wi?a=olt:s instanceof Zc?a=slt:s instanceof tn?a=alt:a=clt,a=s.clone(a);let c,l=this._frustumSplits;!u(l)||l.length<=1?(l=ult,l[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,c=1):c=l.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=m.negate(g,nlt);let h=ilt;Q.setColumn(h,0,g,h),Q.setColumn(h,1,p,h),Q.setColumn(h,2,d,h);let A=Le.fromRotationMatrix(h,rlt);for(t.length=n.length=c,i=0;i<c;++i)a.near=l[i],a.far=l[i+1],t[i]=new Sn({geometryInstances:new Ct({geometry:new tC({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(z.fromAlpha(this._color,.1,llt))},id:this.id,pickPrimitive:this}),appearance:new sn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Sn({geometryInstances:new Ct({geometry:new hL({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};kz.prototype.isDestroyed=function(){return!1};kz.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var Bh=kz;function dye(){this._cachedShowFrustumsShaders={}}function flt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function dlt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=ke.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",r.sources.push(a);let l=flt(i);return Kt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:l})}var gN=new z;function mlt(e,t){let n;return u(t.uniformMap)?n=t.uniformMap:n={},u(n.debugShowCommandsColor)||u(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(u(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(gN.red=t.debugOverlappingFrustums&1<<0?1:0,gN.green=t.debugOverlappingFrustums&1<<1?1:0,gN.blue=t.debugOverlappingFrustums&1<<2?1:0,gN.alpha=1,gN):z.WHITE}),n}var hlt=new et;dye.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];u(r)||(r=dlt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=et.shallowClone(t,hlt);o.shaderProgram=r,o.uniformMap=mlt(e,t),o.execute(e.context,n)};var yN=dye;function zz(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.id=e.id,this._id=void 0,this._primitive=void 0}zz.prototype.update=function(e){if(this.show){if(!u(this._primitive)||!N.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=N.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,u(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:Go.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Jt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:Go.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Jt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:Go.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Jt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this});this._primitive=new Sn({geometryInstances:[t,n,i],appearance:new Go,asynchronous:!1})}this._primitive.update(e)}};zz.prototype.isDestroyed=function(){return!1};zz.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var AN=zz;var xN=`in vec4 positionEC; - -void main() -{ - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) - { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); - } - - czm_ray ray = czm_ray(position, direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) - { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); - } - else - { - discard; - } - - czm_writeLogDepth(); -} -`;var CN=`in vec4 position; - -out vec4 positionEC; - -void main() -{ - positionEC = czm_modelView * position; - gl_Position = czm_projection * positionEC; - - czm_vertexLogDepth(); -} -`;function EN(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var TN=Gt.supportsTypedArrays()?new Float32Array(12):[],mye=new m,hye=new m,ZY=new m,pye=new m,Hz=new m;function plt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof tn)r=m.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,mye),g=m.normalize(p,hye),h=m.normalize(m.cross(m.UNIT_Z,p,ZY),ZY),A=m.normalize(m.cross(g,h,pye),pye),x=m.magnitude(p),C=Math.sqrt(x*x-1);r=m.multiplyByScalar(g,1/x,mye);let T=C/x;o=m.multiplyByScalar(h,T,hye),s=m.multiplyByScalar(A,T,ZY)}let a=m.add(r,s,Hz);m.subtract(a,o,a),m.multiplyComponents(n,a,a),m.pack(a,TN,0);let c=m.subtract(r,s,Hz);m.subtract(c,o,c),m.multiplyComponents(n,c,c),m.pack(c,TN,3);let l=m.add(r,s,Hz);m.add(l,o,l),m.multiplyComponents(n,l,l),m.pack(l,TN,6);let f=m.subtract(r,s,Hz);return m.add(f,o,f),m.multiplyComponents(n,f,f),m.pack(f,TN,9),TN}EN.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(u(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new et({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:ve.OPAQUE,owner:this})),!u(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new ke({sources:[CN]}),a=new ke({sources:[xN]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Kt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=plt(i,e);if(u(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new dt({attributes:{position:new Ie({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Be.TRIANGLES});this._va=oi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};EN.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};EN.prototype.isDestroyed=function(){return!1};EN.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var bN=EN;function SN(){}var _lt=/\bgl_FragDepth\b/,glt=/\bdiscard\b/;function ylt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!u(n)){let i=t._attributeLocations,r=t.fragmentShaderSource,o,s=!1,a=r.sources,c=a.length;for(o=0;o<c;++o)if(_lt.test(a[o])||glt.test(a[o])){s=!0;break}let l=!1,f=r.defines;for(c=f.length,o=0;o<c;++o)if(f[o]==="LOG_DEPTH"){l=!0;break}let d;!s&&!l?(d=`void main() -{ - out_FragColor = vec4(1.0); -} -`,r=new ke({sources:[d]})):!s&&l&&(d=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`,r=new ke({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}function Alt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!u(i)){let r=Ve.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ve.fromCache(r),n[t.id]=i}return i}SN.createDepthOnlyDerivedCommand=function(e,t,n,i){u(i)||(i={});let r,o;return u(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=et.shallowClone(t,i.depthOnlyCommand),!u(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=ylt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Alt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var xlt=/\s+czm_writeLogDepth\(/,Clt=/\s+czm_vertexLogDepth\(/;function Tlt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!u(i)){let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=u(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=u(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,l=!1,f=o.sources,d=f.length;for(a=0;a<d;++a)if(Clt.test(f[a])){l=!0;break}if(!l){for(a=0;a<d;++a)f[a]=ke.replaceMain(f[a],"czm_log_depth_main");c=` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`,f.push(c)}for(f=s.sources,d=f.length,l=!1,a=0;a<d;++a)xlt.test(f[a])&&(l=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(l=!0);let p="";if(!l){for(a=0;a<d;a++)f[a]=ke.replaceMain(f[a],"czm_log_depth_main");p+=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}return i}SN.createLogDepthCommand=function(e,t,n){u(n)||(n={});let i;return u(n.command)&&(i=n.command.shaderProgram),n.command=et.shallowClone(e,n.command),!u(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Tlt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Elt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!u(i)){let r=t._attributeLocations,o=t.fragmentShaderSource,s=o.sources,a=s.length,c=`void main() -{ - czm_non_pick_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = ${n}; -} -`,l=new Array(a+1);for(let f=0;f<a;++f)l[f]=ke.replaceMain(s[f],"czm_non_pick_main");l[a]=c,o=new ke({sources:l,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}function blt(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!u(i)){let r=Ve.getState(t);r.blending.enabled=!1,r.depthMask=!0,i=Ve.fromCache(r),n[t.id]=i}return i}SN.createPickDerivedCommand=function(e,t,n,i){u(i)||(i={});let r,o;return u(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=et.shallowClone(t,i.pickCommand),!u(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Elt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=blt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};function Slt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!u(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=u(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=u(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}SN.createHdrCommand=function(e,t,n){u(n)||(n={});let i;return u(n.command)&&(i=n.command.shaderProgram),n.command=et.shallowClone(e,n.command),!u(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Slt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var k_=SN;function Gz(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!u(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var vlt=new Le,_ye=new Le,wlt=new Q;function Dlt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,_ye),c=Le.fromAxisAngle(o,i,vlt),l=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,_ye);Le.multiply(f,l,l);let d=Q.fromQuaternion(l,wlt);Q.multiplyByVector(d,o,o),Q.multiplyByVector(d,s,s),Q.multiplyByVector(d,r,r)}Gz.prototype.update=function(){if(!u(this._alpha))return;u(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Dlt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Gz.prototype.isDestroyed=function(){return!1};Gz.prototype.destroy=function(){return this._removeListener(),ue(this)};var vN=Gz;function Ilt(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var QY=Ilt;var ES=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; - -in vec3 v_positionEC; - -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes - - vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; - - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} - -void main() -{ - // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii - // in the vertex shader. Only when it is larger than some constant, march along the ray. - // Otherwise perform one intersection test which will be the common case. - - // Test if the ray intersects a sphere with the ellipsoid's maximum radius. - // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test - // may cause false negatives. This will discard fragments before marching the ray forward. - float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; - vec3 direction = normalize(v_positionEC); - vec3 ellipsoidCenter = czm_modelView[3].xyz; - - float t1 = -1.0; - float t2 = -1.0; - - float b = -2.0 * dot(direction, ellipsoidCenter); - float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; - - float discriminant = b * b - 4.0 * c; - if (discriminant >= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; - } - - if (t1 < 0.0 && t2 < 0.0) { - discard; - } - - float t = min(t1, t2); - if (t < 0.0) { - t = 0.0; - } - - // March ray forward to intersection with larger sphere and find - czm_ray ray = czm_ray(t * direction, direction); - - vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); - - if (czm_isEmpty(intersection)) - { - discard; - } - - // If the viewer is outside, compute outsideFaceColor, with normals facing outward. - vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - - // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. - vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); - - out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); - out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); - -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - t = (intersection.start != 0.0) ? intersection.start : intersection.stop; - vec3 positionEC = czm_pointAlongRay(ray, t); - vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH - czm_writeLogDepth(1.0 + positionCC.w); -#else - float z = positionCC.z / positionCC.w; - - float n = czm_depthRange.near; - float f = czm_depthRange.far; - - gl_FragDepth = (z * (f - n) + f + n) * 0.5; -#endif -#endif -} -`;var bS=`in vec3 position; - -uniform vec3 u_radii; - -out vec3 v_positionEC; - -void main() -{ - // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. - // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, - // but doing it here allows us to change the radii without rewriting the vertex data, and - // allows all ellipsoids to reuse the same vertex data. - vec4 p = vec4(u_radii * position, 1.0); - - v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates - gl_Position = czm_modelViewProjection * p; // position in clip coordinates - - // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums - // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the - // ellipsoid (does not write depth) that was rendered in the farther frustum. - // - // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates - // artifacts since some fragments can be alpha blended twice. This is solved by only rendering - // the ellipsoid in the closest frustum to the viewer. - gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); - - czm_vertexLogDepth(); -} -`;var $Y={position:0};function Wz(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this._computedModelMatrix=new N,this.show=y(e.show,!0),this.material=y(e.material,Wi.fromType(Wi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new et({owner:y(e._owner,this)}),this._pickCommand=new et({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Plt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(u(t))return t;let n=fl.createGeometry(fl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Pe.POSITION_ONLY}));return t=oi.fromGeometry({context:e,geometry:n,attributeLocations:$Y,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}Wz.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!u(this.center)||!u(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!u(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?dn.ALPHA_BLEND:void 0})),u(this._va)||(this._va=Plt(t));let r=!1,o=this.radii;if(!m.equals(this._radii,o)){m.clone(o,this._radii);let A=this._oneOverEllipsoidRadiiSquared;A.x=1/(o.x*o.x),A.y=1/(o.y*o.y),A.z=1/(o.z*o.z),r=!0}(!N.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(N.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),N.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(o),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,l=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||l)&&(d=new ke({sources:[bS]}),p=new ke({sources:[this.material.shaderSource,ES]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Kt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:$Y}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=_t(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?ve.TRANSLUCENT:ve.OPAQUE,g.push(f)),h.pick){let A=this._pickCommand;(!u(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!u(this._pickSP)||l)&&(d=new ke({sources:[bS]}),p=new ke({sources:[this.material.shaderSource,ES],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Kt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:$Y}),A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._pickSP,A.uniformMap=_t(_t(this._uniforms,this._pickUniforms),this.material._uniforms),A.executeInClosestFrustum=n),A.boundingVolume=this._boundingSphere,A.modelMatrix=this._computedModelMatrix,A.pass=n?ve.TRANSLUCENT:ve.OPAQUE,g.push(A)}};Wz.prototype.isDestroyed=function(){return!1};Wz.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var wN=Wz;var DN=`in vec3 v_positionMC; -in vec3 v_positionEC; -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - materialInput.s = v_st.s; - materialInput.st = v_st; - materialInput.str = vec3(v_st, 0.0); - - // Convert tangent space material normal to eye space - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); - - // Convert view vector to world space - vec3 positionToEyeEC = -v_positionEC; - materialInput.positionToEyeEC = positionToEyeEC; - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var IN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec2 st; -in float batchId; - -out vec3 v_positionMC; -out vec3 v_positionEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionMC = position3DHigh + position3DLow; // position in model coordinates - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function hC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=u(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,IN),this._fragmentShaderSource=y(e.fragmentShaderSource,DN),this._renderState=or.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(hC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return hC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});hC.VERTEX_FORMAT=Pe.POSITION_AND_ST;hC.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;hC.prototype.isTranslucent=or.prototype.isTranslucent;hC.prototype.getRenderState=or.prototype.getRenderState;var eX=hC;function gye(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var jz=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],Lh=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<Lh.length;++e)Lh[e]*=1e6;var yye=Lh[1],tX=Lh[Lh.length-1];for(let e=0;e<Lh.length;++e)Lh[e]=(Lh[e]-tX)/(yye-tX);var ua=0;function Olt(e){let t=jz,n=t.length;if(e<t[0])return ua=0,ua;if(e>t[n-1])return ua=n-2,ua;if(e>=t[ua]){if(ua+1<n&&e<t[ua+1])return ua;if(ua+2<n&&e<t[ua+2])return++ua,ua}else if(ua-1>=0&&e>=t[ua-1])return--ua,ua;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ua=i,ua}var Mlt=new m;gye.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!u(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let r=i.height,o=Olt(r),s=P.clamp((r-jz[o])/(jz[o+1]-jz[o]),0,1),a=P.lerp(Lh[o],Lh[o+1],s),c=this.density*1e6,l=c/yye*tX;a=a*(c-l)*1e-6;let f=m.normalize(n.positionWC,Mlt),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var PN=gye;function Wl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Wl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Wl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Wl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Wl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Wl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new _e,this._nominalFrameRate=new _e,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){Rlt(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){Blt(t)}this._visibilityChangeRemoveListener=void 0,u(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Wl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Wl.fromScene=function(e){return(!u(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Wl({scene:e})),e._frameRateMonitor};Object.defineProperties(Wl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Wl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Wl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this._preUpdateRemoveListener(),u(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function Rlt(e,t){if(e._pauseCount>0)return;let n=Ai();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function Blt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var ON=Wl;function Llt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var MN=Llt;function Nlt(e,t){this.near=y(e,0),this.far=y(t,0);let n=ve.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var RN=Nlt;function Flt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = ${n}.rgb; - float clippingPlanesEdgeWidth = ${n}.a; - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) - { - out_FragColor = clippingPlanesEdgeColor; - } -`}var BN=Flt;var LN=`uniform vec4 u_initialColor; - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP -uniform sampler2D u_mars_clip_area; -uniform bool u_mars_clip_enabled; -uniform bool u_mars_clip_only; -uniform mat4 u_mars_clip_inverMatrix; -uniform vec4 u_mars_clip_rect; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; - -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; -#endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D -uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_FILTER_COLOR_MARS3D -uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif - -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif - -#ifdef SHOW_REFLECTIVE_OCEAN -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif - -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif - -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif - -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif - -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif - -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; // Hue, saturation, brightness -#endif - -#ifdef HIGHLIGHT_FILL_TILE -uniform vec4 u_fillHighlightColor; -#endif - -#ifdef TRANSLUCENT -uniform vec4 u_frontFaceAlphaByDistance; -uniform vec4 u_backFaceAlphaByDistance; -uniform vec4 u_translucencyRectangle; -#endif - -#ifdef UNDERGROUND_COLOR -uniform vec4 u_undergroundColor; -uniform vec4 u_undergroundColorAlphaByDistance; -#endif - -#ifdef ENABLE_VERTEX_LIGHTING -uniform float u_lambertDiffuseMultiplier; -uniform float u_vertexShadowDarkness; -#endif - -in vec3 v_positionMC; -in vec3 v_positionEC; -in vec3 v_textureCoordinates; -in vec3 v_normalMC; -in vec3 v_normalEC; - -#ifdef APPLY_MATERIAL -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -uniform bool u_mars_flood_globe; - -uniform sampler2D u_mars_flood_area; -uniform bool u_mars_flood_emabled; -uniform bool u_showFloodOnly; -uniform mat4 u_mars_flood_inverMatrix; -uniform vec4 u_mars_flood_rect; -uniform bool u_mars_flood_showElse; -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - -in float v_height; -in float v_slope; -in float v_aspect; -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; -#endif - -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT -uniform int u_mars_uplift_RectangleWidth; -uniform int u_mars_uplift_RectangleHeight; -uniform highp sampler2D u_mars_uplift_RampRectangle; -uniform float u_mars_inverseTileWidth; -uniform vec2 u_mars_cartographicTileRectangle; -uniform bool u_mars_uplift_enabled; -uniform bool u_mars_uplift_hideInsideOrOutside; - -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); - float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); - vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, 0.0); -} - -bool inSlopeRampRectangle() { - for(int h = 0; h < 100000; h++) { - if(h >= u_mars_uplift_RectangleWidth) - break; - - vec4 first = getRegions(0, h); - float currentLength = first.z; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++) { - if(float(w) >= currentLength) - break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { - if(v_textureCoordinates.y <= max(p1.y, p2.y)) { - if(p1.x != p2.x) { - xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { - counter += 1.0; - } - } - } - } - - } - if((mod(counter, 2.0) != 0.0)) { - return true; - } - } - - return false; -} -#endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); -} -#endif - -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ - return - v_textureCoordinates.x > u_translucencyRectangle.x && - v_textureCoordinates.x < u_translucencyRectangle.z && - v_textureCoordinates.y > u_translucencyRectangle.y && - v_textureCoordinates.y < u_translucencyRectangle.w; -} -#endif - -vec4 sampleAndBlend( - vec4 previousColor, - sampler2D textureToSample, - vec2 tileTextureCoordinates, - vec4 textureCoordinateRectangle, - vec4 textureCoordinateTranslationAndScale, - float textureAlpha, - float textureNightAlpha, - float textureDayAlpha, - float textureBrightness, - float textureContrast, - float textureHue, - float textureSaturation, - float textureOneOverGamma, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - bool textureInvertColor, - vec3 texturefilterColor, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - float split, - vec4 colorToAlpha, - float nightBlend) -{ - // This crazy step stuff sets the alpha to 0.0 if this following condition is true: - // tileTextureCoordinates.s < textureCoordinateRectangle.s || - // tileTextureCoordinates.s > textureCoordinateRectangle.p || - // tileTextureCoordinates.t < textureCoordinateRectangle.t || - // tileTextureCoordinates.t > textureCoordinateRectangle.q - // In other words, the alpha is zero if the fragment is outside the rectangle - // covered by this texture. Would an actual 'if' yield better performance? - vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - - alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif - - vec2 translation = textureCoordinateTranslationAndScale.xy; - vec2 scale = textureCoordinateTranslationAndScale.zw; - vec2 textureCoordinates = tileTextureCoordinates * scale + translation; - vec4 value = texture(textureToSample, textureCoordinates); - vec3 color = value.rgb; - float alpha = value.a; - -#ifdef APPLY_COLOR_TO_ALPHA - vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); - colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); - alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif - -#if !defined(APPLY_GAMMA) - vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); - color = tempColor.rgb; - alpha = tempColor.a; -#else - color = pow(color, vec3(textureOneOverGamma)); -#endif - -#ifdef APPLY_SPLIT - float splitPosition = czm_splitPosition; - // Split to the left - if (split < 0.0 && gl_FragCoord.x > splitPosition) { - alpha = 0.0; - } - // Split to the right - else if (split > 0.0 && gl_FragCoord.x < splitPosition) { - alpha = 0.0; - } -#endif - -#ifdef APPLY_BRIGHTNESS - color = mix(vec3(0.0), color, textureBrightness); -#endif - -#ifdef APPLY_CONTRAST - color = mix(vec3(0.5), color, textureContrast); -#endif - -#ifdef APPLY_HUE - color = czm_hue(color, textureHue); -#endif - -#ifdef APPLY_SATURATION - color = czm_saturation(color, textureSaturation); -#endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D - if(textureInvertColor) { - color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); - } -#endif - -#ifdef APPLY_FILTER_COLOR_MARS3D - if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { - color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - - float sourceAlpha = alpha * textureAlpha; - float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); - outAlpha += sign(outAlpha) - 1.0; - - vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; - - // When rendering imagery for a tile in multiple passes, - // some GPU/WebGL implementation combinations will not blend fragments in - // additional passes correctly if their computation includes an unmasked - // divide-by-zero operation, - // even if it's not in the output or if the output has alpha zero. - // - // For example, without sanitization for outAlpha, - // this renders without artifacts: - // if (outAlpha == 0.0) { outColor = vec3(0.0); } - // - // but using czm_branchFreeTernary will cause portions of the tile that are - // alpha-zero in the additional pass to render as black instead of blending - // with the previous pass: - // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); - // - // So instead, sanitize against divide-by-zero, - // store this state on the sign of outAlpha, and correct on return. - - return vec4(outColor, max(outAlpha, 0.0)); -} - -vec3 colorCorrect(vec3 rgb) { -#ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - rgb = czm_HSBToRGB(hsb); -#endif - return rgb; -} - -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); - -const float fExposure = 2.0; - -vec3 computeEllipsoidPosition() -{ - float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); - vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); - xy *= czm_viewport.zw * mpp * 0.5; - - vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); - czm_ray ray = czm_ray(vec3(0.0), direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - - vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); - return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; -} - -void main() -{ -#ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) - { - discard; - } -#endif - -#ifdef ENABLE_CLIPPING_PLANES - float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif - -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) - vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates - vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes -#endif - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); -#else - float nightBlend = 0.0; -#endif - - // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 - // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the - // fragments on the edges of tiles even though the vertex shader is outputting - // coordinates strictly in the 0-1 range. - vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); - -#ifdef SHOW_TILE_BOUNDARIES - if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || - v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) - { - color = vec4(1.0, 0.0, 0.0, 1.0); - } -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) - float cameraDist; - if (czm_sceneMode == czm_sceneMode2D) - { - cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; - } - else if (czm_sceneMode == czm_sceneModeColumbusView) - { - cameraDist = -czm_view[3].z; - } - else - { - cameraDist = length(czm_view[3]); - } - float fadeOutDist = u_lightingFadeDistance.x; - float fadeInDist = u_lightingFadeDistance.y; - if (czm_sceneMode != czm_sceneMode3D) { - vec3 radii = czm_ellipsoidRadii; - float maxRadii = max(radii.x, max(radii.y, radii.z)); - fadeOutDist -= maxRadii; - fadeInDist -= maxRadii; - } - float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else - float fade = 0.0; -#endif - -#ifdef SHOW_REFLECTIVE_OCEAN - vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; - vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; - vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; - waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; - - float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; - - if (mask > 0.0) - { - mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); - - vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); - vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); - - vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); - - color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); - } -#endif - -#ifdef APPLY_MATERIAL - czm_materialInput materialInput; - materialInput.st = v_textureCoordinates.st; - materialInput.normalEC = normalize(v_normalEC); - materialInput.positionToEyeEC = -v_positionEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); - materialInput.slope = v_slope; - materialInput.height = v_height; - materialInput.aspect = v_aspect; - czm_material material = czm_getMaterial(materialInput); - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 - - vec4 materialColor = vec4(material.diffuse, material.alpha); - if(u_mars_flood_emabled) { - if(u_mars_flood_globe) { - vec4 materialColor = vec4(material.diffuse, material.alpha); - color = alphaBlend(materialColor, color); - } else { - vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); - vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; - vec4 ymColor = texture(u_mars_flood_area, newuv); - if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { - color.xyz = mix(color.xyz, material.diffuse, material.alpha); - } else { - if(!u_mars_flood_showElse) { - discard; - } - } - } - } - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#endif - -#ifdef ENABLE_VERTEX_LIGHTING - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); - diffuseIntensity = mix(1.0, diffuseIntensity, fade); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else - vec4 finalColor = color; -#endif - -#ifdef ENABLE_CLIPPING_PLANES - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; - - if (clipDistance < clippingPlanesEdgeWidth) - { - finalColor = clippingPlanesEdgeColor; - } -#endif - -#ifdef HIGHLIGHT_FILL_TILE - finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); -#endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) - if (!czm_backFacing()) - { - bool dynamicLighting = false; - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. - // Otherwise, the scattering is computed in the vertex shader. - #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE - positionWC = computeEllipsoidPosition(); - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - computeAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - #else - positionWC = v_positionMC; - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - #endif - - rayleighColor = colorCorrect(rayleighColor); - mieColor = colorCorrect(mieColor); - - vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - // Fog is applied to tiles selected for fog, close to the Earth. - #ifdef FOG - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is lighting, apply that to the fog. - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); - fogColor *= darken; - #endif - - #ifndef HDR - fogColor.rgb = czm_acesTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - const float modifier = 0.15; - finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); - - #else - // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. - // This value is larger near the "circumference", as it is further away from the camera. We use it to - // brighten up that area of the ground atmosphere. - const float transmittanceModifier = 0.5; - float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); - - vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float fadeInDist = u_nightFadeDistance.x; - float fadeOutDist = u_nightFadeDistance.y; - - float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); - float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); - vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); - - finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); - #endif - - #ifndef HDR - finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); - #else - finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); - #endif - - finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); - #endif - } -#endif - -#ifdef UNDERGROUND_COLOR - if (czm_backFacing()) - { - float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); - float distance = max(v_distance - distanceFromEllipsoid, 0.0); - float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); - vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); - finalColor = alphaBlend(undergroundColor, finalColor); - } -#endif - -#ifdef TRANSLUCENT - if (inTranslucencyRectangle()) - { - vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; - finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); - } -#endif - -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP - if(u_mars_clip_enabled) { - vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); - vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; - vec4 tColor = texture(u_mars_clip_area, tuv); - if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { - if(u_mars_clip_only) { - discard; - } - } else { - if(!u_mars_clip_only) { - discard; - } - } - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT - if(u_mars_uplift_enabled) { - bool isInSlopeRampRectangle = inSlopeRampRectangle(); - if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { - discard; - } - } -#endif - - out_FragColor = finalColor; -} - - -#ifdef SHOW_REFLECTIVE_OCEAN - -float waveFade(float edge0, float edge1, float x) -{ - float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return pow(1.0 - y, 5.0); -} - -float linearFade(float edge0, float edge1, float x) -{ - return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} - -// Based on water rendering by Jonas Wagner: -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -// low altitude wave settings -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; - -// high altitude wave settings -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; - -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ - vec3 positionToEyeEC = -positionEyeCoordinates; - float positionToEyeECLength = length(positionToEyeEC); - - // The double normalize below works around a bug in Firefox on Android devices. - vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); - - // Fade out the waves as the camera moves far from the surface. - float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); - -#ifdef SHOW_OCEAN_WAVES - // high altitude waves - float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; - vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); - vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); - - // low altitude waves - time = czm_frameNumber * oceanAnimationSpeedLowAltitude; - noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); - vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); - - // blend the 2 wave layers based on distance to surface - float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); - float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); - vec3 normalTangentSpace = - (highAltitudeFade * normalTangentSpaceHighAltitude) + - (lowAltitudeFade * normalTangentSpaceLowAltitude); - normalTangentSpace = normalize(normalTangentSpace); - - // fade out the normal perturbation as we move farther from the water surface - normalTangentSpace.xy *= waveIntensity; - normalTangentSpace = normalize(normalTangentSpace); -#else - vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif - - vec3 normalEC = enuToEye * normalTangentSpace; - - const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); - - // Use diffuse light to highlight the waves - float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; - vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); - -#ifdef SHOW_OCEAN_WAVES - // Where diffuse light is low or non-existent, use wave highlights based solely on - // the wave bumpiness and no particular light direction. - float tsPerturbationRatio = normalTangentSpace.z; - vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else - vec3 nonDiffuseHighlight = vec3(0.0); -#endif - - // Add specular highlights in 3D, and in all modes when zoomed in. - float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); - float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); - float specular = specularIntensity * surfaceReflectance; - -#ifdef HDR - specular *= 1.4; - - float e = 0.2; - float d = 3.3; - float c = 1.7; - - vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); -#else - vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; -#endif - - return vec4(color, imageryColor.a); -} - -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var NN=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; -#else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; -#endif - -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; -#endif - -#ifdef EXAGGERATION -uniform vec2 u_terrainExaggerationAndRelativeHeight; -#endif - -uniform vec3 u_center3D; -uniform mat4 u_modifiedModelView; -uniform mat4 u_modifiedModelViewProjection; -uniform vec4 u_tileRectangle; - -// Uniforms for 2D Mercator projection -uniform vec2 u_southAndNorthLatitude; -uniform vec2 u_southMercatorYAndOneOverHeight; - -out vec3 v_positionMC; -out vec3 v_positionEC; - -out vec3 v_textureCoordinates; -out vec3 v_normalMC; -out vec3 v_normalEC; - -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT -uniform bool u_mars_flat_enabled; -uniform int u_mars_flat_AreaWidth; -uniform int u_mars_flat_AreaHeight; -uniform highp float u_mars_inverseTileWidth; -uniform highp vec2 u_mars_cartographicTileRectangle; -uniform highp sampler2D u_mars_flat_AreaTexture; -const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C - -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); - float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); - vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, point.w); -} - -float inRectangle(vec2 textureCoordinates) { - for(int h = 0; h < 100000; h++){ - if(h >= u_mars_flat_AreaWidth) break; - - vec4 first = getRegions(0, h); - float currentLength = first.z; - float height = first.w; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++){ - if(float(w) >= currentLength) break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ - if (textureCoordinates.y <= max(p1.y, p2.y)){ - if (p1.x != p2.x){ - xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if (p1.y == p2.y || textureCoordinates.y <= xinters) - { - counter += 1.0; - } - } - } - } - - } - if((mod(counter, 2.0) != 0.0)) { - return height; - } - } - - return invalidValue; -} -#endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 - -#ifdef APPLY_MATERIAL -out float v_slope; -out float v_aspect; -out float v_height; -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; -#endif - -// These functions are generated at runtime. -vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); -float get2DYPositionFraction(vec2 textureCoordinates); - -vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return u_modifiedModelViewProjection * vec4(position, 1.0); -} - -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ - // The width of a tile at level 11, in radians and assuming a single root tile, is - // 2.0 * czm_pi / pow(2.0, 11.0) - // We want to just linearly interpolate the 2D position from the texture coordinates - // when we're at this level or higher. The constant below is the expression - // above evaluated and then rounded up at the 4th significant digit. - const float maxTileWidth = 0.003068; - float positionFraction = textureCoordinates.y; - float southLatitude = u_southAndNorthLatitude.x; - float northLatitude = u_southAndNorthLatitude.y; - if (northLatitude - southLatitude > maxTileWidth) - { - float southMercatorY = u_southMercatorYAndOneOverHeight.x; - float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; - - float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); - currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); - positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); - } - return positionFraction; -} - -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ - return textureCoordinates.y; -} - -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) -{ - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - return u_modifiedModelViewProjection * rtcPosition2D; -} - -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, 0.0, textureCoordinates); -} - -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, height, textureCoordinates); -} - -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ - // We do not do RTC while morphing, so there is potential for jitter. - // This is unlikely to be noticeable, though. - vec3 position3DWC = position + u_center3D; - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); - return czm_modelViewProjection * morphPosition; -} - -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; -#endif - -void main() -{ -#ifdef QUANTIZATION_BITS12 - vec2 xy = czm_decompressTextureCoordinates(compressed0.x); - vec2 zh = czm_decompressTextureCoordinates(compressed0.y); - vec3 position = vec3(xy, zh.x); - float height = zh.y; - vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); - - height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; - position = (u_scaleAndBias * vec4(position, 1.0)).xyz; - -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = compressed1; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = 0.0; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = compressed0.w; -#else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; -#endif - -#else - // A single float per element - vec3 position = position3DAndHeight.xyz; - float height = position3DAndHeight.w; - vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; - -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = textureCoordAndEncodedNormals.w; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = textureCoordAndEncodedNormals.z; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = 0.0; -#else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; -#endif - -#endif - - vec3 position3DWC = position + u_center3D; - -#ifdef GEODETIC_SURFACE_NORMALS - vec3 ellipsoidNormal = geodeticSurfaceNormal; -#else - vec3 ellipsoidNormal = normalize(position3DWC); -#endif - -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - float exaggeration = u_terrainExaggerationAndRelativeHeight.x; - float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; - float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; - - // stop from going through center of earth - float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); - newHeight = max(newHeight, -minRadius); - - vec3 offset = ellipsoidNormal * (newHeight - height); - position += offset; - position3DWC += offset; - height = newHeight; -#endif - - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT - if(u_mars_flat_enabled){ - float isInside = inRectangle(textureCoordinates); - if(isInside != invalidValue){ - vec3 offset = (isInside - height) * ellipsoidNormal; - position += offset; - position3DWC += offset; - height = isInside; - // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; - } - } -#endif - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 - - gl_Position = getPosition(position, height, textureCoordinates); - - v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; - v_positionMC = position3DWC; // position in model coordinates - - v_textureCoordinates = vec3(textureCoordinates, webMercatorT); - -#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - vec3 normalMC = czm_octDecode(encodedNormal); - -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; - vec3 rejection = normalMC - projection; - normalMC = normalize(projection + rejection * exaggeration); -#endif - - v_normalMC = normalMC; - v_normalEC = czm_normal3D * v_normalMC; -#endif - -#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) - - bool dynamicLighting = false; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - - vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); - - computeAtmosphereScattering( - position3DWC, - lightDirection, - v_atmosphereRayleighColor, - v_atmosphereMieColor, - v_atmosphereOpacity - ); -#endif - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) - v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); -#endif - -#ifdef APPLY_MATERIAL - float northPoleZ = czm_ellipsoidRadii.z; - vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); - vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); - float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); - v_slope = acos(dotProd); - vec3 normalRejected = ellipsoidNormal * dotProd; - vec3 normalProjected = v_normalMC - normalRejected; - vec3 aspectVector = normalize(normalProjected); - v_aspect = acos(dot(aspectVector, vectorEastMC)); - float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); - v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); - v_height = height; -#endif -} -`;var z_=`uniform vec3 u_radiiAndDynamicAtmosphereColor; - -uniform float u_atmosphereLightIntensity; -uniform float u_atmosphereRayleighScaleHeight; -uniform float u_atmosphereMieScaleHeight; -uniform float u_atmosphereMieAnisotropy; -uniform vec3 u_atmosphereRayleighCoefficient; -uniform vec3 u_atmosphereMieCoefficient; - -const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. -const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. -const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - -/** - * Rational approximation to tanh(x) -*/ -float approximateTanh(float x) { - float x2 = x * x; - return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); -} - -/** - * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as - * the transmittance value for the ray. - * - * @param {czm_ray} primaryRay The ray from the camera to the position. - * @param {float} primaryRayLength The length of the primary ray. - * @param {vec3} lightDirection The direction of the light to calculate the scattering from. - * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. - * @param {vec3} mieColor The variable the Mie scattering will be written to. - * @param {float} opacity The variable the transmittance will be written to. - * @glslFunction - */ -void computeScattering( - czm_ray primaryRay, - float primaryRayLength, - vec3 lightDirection, - float atmosphereInnerRadius, - out vec3 rayleighColor, - out vec3 mieColor, - out float opacity -) { - - // Initialize the default scattering amounts to 0. - rayleighColor = vec3(0.0); - mieColor = vec3(0.0); - opacity = 0.0; - - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - - vec3 origin = vec3(0.0); - - // Calculate intersection from the camera to the outer ring of the atmosphere. - czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); - - // Return empty colors if no intersection with the atmosphere geometry. - if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { - return; - } - - // To deal with smaller values of PRIMARY_STEPS (e.g. 4) - // we implement a split strategy: sky or horizon. - // For performance reasons, instead of a if/else branch - // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 - float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); - // Value close to 0.0: close to the horizon - // Value close to 1.0: above in the sky - float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); - - // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. - float start_0 = primaryRayAtmosphereIntersect.start; - primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); - // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. - primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); - - // For the number of ray steps, distinguish inside or outside atmosphere (outer space) - // (1) from outer space we have to use more ray steps to get a realistic rendering - // (2) within atmosphere we need fewer steps for faster rendering - float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters - float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); - int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. - int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. - - // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. - float rayPositionLength = primaryRayAtmosphereIntersect.start; - // (1) Outside the atmosphere: constant rayStepLength - // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps - float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; - float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); - float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); - - vec3 rayleighAccumulation = vec3(0.0); - vec3 mieAccumulation = vec3(0.0); - vec2 opticalDepth = vec2(0.0); - vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); - - // Sample positions on the primary ray. - for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { - - // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= PRIMARY_STEPS) { - break; - } - - // Calculate sample position along viewpoint ray. - vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); - - // Calculate height of sample position above ellipsoid. - float sampleHeight = length(samplePosition) - atmosphereInnerRadius; - - // Calculate and accumulate density of particles at the sample position. - vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; - opticalDepth += sampleDensity; - - // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. - czm_ray lightRay = czm_ray(samplePosition, lightDirection); - czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); - - float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); - float lightPositionLength = 0.0; - - vec2 lightOpticalDepth = vec2(0.0); - - // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. - for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { - - // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (j >= LIGHT_STEPS) { - break; - } - - // Calculate sample position along light ray. - vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); - - // Calculate height of the light sample position above ellipsoid. - float lightHeight = length(lightPosition) - atmosphereInnerRadius; - - // Calculate density of photons at the light sample position. - lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; - - // Increment distance on light ray. - lightPositionLength += lightStepLength; - } - - // Compute attenuation via the primary ray and the light ray. - vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); - - // Accumulate the scattering. - rayleighAccumulation += sampleDensity.x * attenuation; - mieAccumulation += sampleDensity.y * attenuation; - - // Increment distance on primary ray. - rayPositionLength += (rayStepLength += rayStepLengthIncrease); - } - - // Compute the scattering amount. - rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; - mieColor = u_atmosphereMieCoefficient * mieAccumulation; - - // Compute the transmittance i.e. how much light is passing through the atmosphere. - opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); -} - -vec4 computeAtmosphereColor( - vec3 positionWC, - vec3 lightDirection, - vec3 rayleighColor, - vec3 mieColor, - float opacity -) { - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - - float cosAngle = dot(cameraToPositionWCDirection, lightDirection); - float cosAngleSq = cosAngle * cosAngle; - - float G = u_atmosphereMieAnisotropy; - float GSq = G * G; - - // The Rayleigh phase function. - float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); - // The Mie phase function. - float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); - - // The final color is generated by combining the effects of the Rayleigh and Mie scattering. - vec3 rayleigh = rayleighPhase * rayleighColor; - vec3 mie = miePhase * mieColor; - - vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; - - return vec4(color, opacity); -} -`;var SS=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { - - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - float atmosphereInnerRadius = length(positionWC); - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); -} -`;function Ult(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function nX(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Vlt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case ne.SCENE3D:r=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:r=n;break;case ne.MORPHING:r=i;break}return r}function klt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}nX.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,l=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,A=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,D=e.enableClippingPlanes,M=e.clippingPlanes,O=e.clippedByBoundaries,B=e.hasImageryLayerCutout,L=e.colorCorrect,_=e.highlightFillTile,b=e.colorToAlpha,v=e.hasGeodeticSurfaceNormals,I=e.hasExaggeration,R=e.showUndergroundColor,F=e.translucent,k=e.marsOptions||{},V=0,G="",Y=n.renderedMesh.encoding;Y.quantization===Vs.BITS12&&(V=1,G="QUANTIZATION_BITS12");let J=0,j="";O&&(J=1,j="TILE_LIMIT_RECTANGLE");let K=0,Z="";B&&(K=1,Z="APPLY_IMAGERY_CUTOUT");let me=t.mode,ye=me|r<<2|o<<3|s<<4|a<<5|c<<6|l<<7|p<<8|g<<9|h<<10|A<<11|x<<12|C<<13|T<<14|E<<15|S<<16|w<<17|V<<18|d<<19|D<<20|J<<21|K<<22|L<<23|_<<24|b<<25|v<<26|I<<27|R<<28|F<<29|f<<30,se=0;u(M)&&M.length>0&&(se=D?M.clippingPlanesState:0);let pe=n.surfaceShader;if(u(pe)&&pe.numberOfDayTextures===i&&pe.flags===ye&&pe.material===this.material&&pe.clippingShaderState===se)return pe.shaderProgram;let Ae=this._shadersByTexturesFlags[i];if(u(Ae)||(Ae=this._shadersByTexturesFlags[i]=[]),pe=Ae[ye],k.enableClip||!u(pe)||pe.material!==this.material||pe.clippingShaderState!==se){let De=this.baseVertexShaderSource.clone(),Ce=this.baseFragmentShaderSource.clone();se!==0&&Ce.sources.unshift(L_(M,t.context)),k.enableClip&&Ce.defines.push("APPLY_MARS3D_CLIP"),k.enableUplift&&Ce.defines.push("APPLY_MARS3D_UPLIFT"),k.enableFlat&&De.defines.push("APPLY_MARS3D_FLAT"),De.defines.push(G),Ce.defines.push(`TEXTURE_UNITS ${i}`,j,Z),r&&Ce.defines.push("APPLY_BRIGHTNESS"),o&&Ce.defines.push("APPLY_CONTRAST"),s&&Ce.defines.push("APPLY_HUE"),a&&Ce.defines.push("APPLY_SATURATION"),c&&Ce.defines.push("APPLY_GAMMA"),k.invertColor&&Ce.defines.push("APPLY_INVERT_COLOR_MARS3D"),k.filterColor&&Ce.defines.push("APPLY_FILTER_COLOR_MARS3D"),l&&Ce.defines.push("APPLY_ALPHA"),f&&Ce.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Ce.defines.push("SHOW_REFLECTIVE_OCEAN"),De.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&Ce.defines.push("SHOW_OCEAN_WAVES"),b&&Ce.defines.push("APPLY_COLOR_TO_ALPHA"),R&&(De.defines.push("UNDERGROUND_COLOR"),Ce.defines.push("UNDERGROUND_COLOR")),F&&(De.defines.push("TRANSLUCENT"),Ce.defines.push("TRANSLUCENT")),h&&(E?(De.defines.push("ENABLE_VERTEX_LIGHTING"),Ce.defines.push("ENABLE_VERTEX_LIGHTING")):(De.defines.push("ENABLE_DAYNIGHT_SHADING"),Ce.defines.push("ENABLE_DAYNIGHT_SHADING"))),A&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ce.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ce.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(De.defines.push("GROUND_ATMOSPHERE"),Ce.defines.push("GROUND_ATMOSPHERE"),T&&(De.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ce.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),De.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ce.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(De.defines.push("FOG"),Ce.defines.push("FOG")),d&&Ce.defines.push("APPLY_SPLIT"),D&&Ce.defines.push("ENABLE_CLIPPING_PLANES"),L&&Ce.defines.push("COLOR_CORRECT"),_&&Ce.defines.push("HIGHLIGHT_FILL_TILE"),v&&De.defines.push("GEODETIC_SURFACE_NORMALS"),I&&De.defines.push("EXAGGERATION");let Re=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;B&&(Re+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let nt=0;nt<i;++nt)B?Re+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${nt}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Re+=` color = sampleAndBlend( -`,Re+=` color, - u_dayTextures[${nt}], - u_dayTextureUseWebMercatorT[${nt}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${nt}], - u_dayTextureTranslationAndScale[${nt}], - ${l?`u_dayTextureAlpha[${nt}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${nt}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${nt}]`:"1.0"}, -${r?`u_dayTextureBrightness[${nt}]`:"0.0"}, - ${o?`u_dayTextureContrast[${nt}]`:"0.0"}, - ${s?`u_dayTextureHue[${nt}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${nt}]`:"0.0"}, - ${c?`u_dayTextureOneOverGamma[${nt}]`:"0.0"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${k.invertColor?`u_mars3dTextureInvertColor[${nt}]`:"false"}, - ${k.filterColor?`u_mars3dTextureFilterColor[${nt}]`:"vec3(1.0)"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${d?`u_dayTextureSplit[${nt}]`:"0.0"}, - ${b?`u_colorsToAlpha[${nt}]`:"vec4(0.0)"}, - nightBlend ); -`,B&&(Re+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Re+=` return color; - }`,Ce.sources.push(Re),De.sources.push(Vlt(me)),De.sources.push(klt(S));let tt=Kt.fromCache({context:t.context,vertexShaderSource:De,fragmentShaderSource:Ce,attributeLocations:Y.getAttributeLocations()});pe=Ae[ye]=new Ult(i,ye,this.material,tt,se)}return n.surfaceShader=pe,pe.shaderProgram};nX.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];if(!u(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],u(t)&&t.shaderProgram.destroy())}return ue(this)};var FN=nX;var zlt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},fi=Object.freeze(zlt);var Hlt={START:0,LOADING:1,DONE:2,FAILED:3},Hs=Object.freeze(Hlt);var Glt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Cr=Object.freeze(Glt);function no(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Cr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(no.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Cr.RECEIVING||e===Cr.TRANSFORMING),i=this.imagery;for(let r=0,o=i.length;n&&r<o;++r){let s=i[r];n=!u(s.loadingImagery)||s.loadingImagery.state!==fi.TRANSITIONING}return n}},renderedMesh:{get:function(){if(u(this.vertexArray))return this.mesh;if(u(this.fill))return this.fill.mesh}}});var Wlt=new he;function iX(e,t,n,i,r,o){let s=e.getExaggeratedPosition(i,r,o);if(u(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Wlt);s=n.project(c,o),s=m.fromElements(s.z,s.x,s.y,o)}return s}var jlt=new m,qlt=new m,Ylt=new m;no.prototype.pick=function(e,t,n,i,r){let o=this.renderedMesh;if(!u(o))return;let s=o.vertices,a=o.indices,c=o.encoding,l=a.length,f=Number.MAX_VALUE;for(let d=0;d<l;d+=3){let p=a[d],g=a[d+1],h=a[d+2],A=iX(c,t,n,s,p,jlt),x=iX(c,t,n,s,g,qlt),C=iX(c,t,n,s,h,Ylt),T=Qi.rayTriangleParametric(e,A,x,C,i);u(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?Dn.getPoint(e,f,r):void 0};no.prototype.freeResources=function(){u(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=Cr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};no.prototype.freeVertexArray=function(){no._freeVertexArray(this.vertexArray),this.vertexArray=void 0,no._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};no.initialize=function(e,t,n){let i=e.data;u(i)||(i=e.data=new no),e.state===Hs.START&&(Xlt(e,t,n),e.state=Hs.LOADING)};no.processStateMachine=function(e,t,n,i,r,o,s){no.initialize(e,n,i);let a=e.data;if(e.state===Hs.LOADING&&Klt(e,t,n,i,r,o),s)return;let c=e.renderable;e.renderable=u(a.vertexArray);let l=a.terrainState===Cr.READY;e.upsampledFromParent=u(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(l&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=Hs.DONE}c&&(e.renderable=!0)};no.prototype.processImagery=function(e,t,n,i){let r=e.data,o=e.upsampledFromParent,s=!1,a=!0,c=r.imagery,l,f;for(l=0,f=c.length;l<f;++l){let d=c[l];if(!u(d.loadingImagery)){o=!1;continue}if(d.loadingImagery.state===fi.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready&&g.imageryProvider._ready){d.freeResources(),c.splice(l,1),g._createTileImagerySkeletons(e,t,l),--l,f=c.length;continue}else o=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||u(d.readyImagery),o=o&&u(d.loadingImagery)&&(d.loadingImagery.state===fi.FAILED||d.loadingImagery.state===fi.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(s||a),a};function Aye(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=hc.clone(s);c.hasGeodeticSurfaceNormals=t,c=hc.clone(c);let l=c.stride,f=new Float32Array(a*l);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=l,r!==e.mesh?(no._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=no._createVertexArrayForMesh(i.context,r)):(no._freeVertexArray(e.vertexArray),e.vertexArray=no._createVertexArrayForMesh(i.context,r)),no._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}no.prototype.addGeodeticSurfaceNormals=function(e,t){Aye(this,!0,e,t)};no.prototype.removeGeodeticSurfaceNormals=function(e){Aye(this,!1,void 0,e)};no.prototype.updateExaggeration=function(e,t,n){let i=this,r=i.renderedMesh;if(r===void 0)return;let o=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=o!==1,c=r.encoding,l=c.exaggeration!==o,f=c.exaggerationRelativeHeight!==s;if(l||f){if(l)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function Xlt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!u(i)&&u(e.parent)){let r=e.parent,o=r.data;u(o)&&u(o.terrainData)&&(i=o.terrainData.isChildAvailable(r.x,r.y,e.x,e.y))}i===!1&&(e.data.terrainState=Cr.FAILED);for(let r=0,o=n.length;r<o;++r){let s=n.get(r);s.show&&s._createTileImagerySkeletons(e,t)}}function Klt(e,t,n,i,r,o){let s=e.data,a=e.parent;if(s.terrainState===Cr.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||no.processStateMachine(a,t,n,i,r,o,!0)),s.terrainState===Cr.FAILED&&Jlt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Cr.UNLOADED&&Zlt(s,n,e.x,e.y,e.level),s.terrainState===Cr.RECEIVED&&$lt(s,t,n,e.x,e.y,e.level),s.terrainState===Cr.TRANSFORMED&&(eut(s,t.context,n,e.x,e.y,e.level,o),s.updateExaggeration(e,t,r)),s.terrainState>=Cr.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)nut(t.context,s);else{let l=s._findAncestorTileWithTerrainData(e);u(l)&&u(l.data.waterMaskTexture)&&(s.waterMaskTexture=l.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,l,s.waterMaskTranslationAndScale))}}function Jlt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Hs.FAILED;return}let c=a.data.terrainData,l=a.x,f=a.y,d=a.level;if(!u(c))return;let p=c.upsample(i.tilingScheme,l,f,d,r,o,s);u(p)&&(e.terrainState=Cr.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=Cr.RECEIVED}).catch(function(){e.terrainState=Cr.FAILED}))}function Zlt(e,t,n,i,r){function o(c){e.terrainData=c,e.terrainState=Cr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ti.CANCELLED){e.terrainData=void 0,e.terrainState=Cr.UNLOADED,e.request=void 0;return}e.terrainState=Cr.FAILED,e.request=void 0;let l=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=xi.reportError(t._requestError,t,t.errorEvent,l,n,i,r),t._requestError.retry&&a()}function a(){let c=new qr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});e.request=c;let l=t.requestTileGeometry(n,i,r,c);u(l)?(e.terrainState=Cr.RECEIVING,Promise.resolve(l).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=Cr.UNLOADED,e.request=void 0)}a()}var Qlt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function $lt(e,t,n,i,r,o){let s=n.tilingScheme,a=Qlt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let l=e.terrainData.createMesh(a);u(l)&&(e.terrainState=Cr.TRANSFORMING,Promise.resolve(l).then(function(f){e.mesh=f,e.terrainState=Cr.TRANSFORMED}).catch(function(){e.terrainState=Cr.FAILED}))}no._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=mt.createVertexBuffer({context:e,typedArray:n,usage:Ne.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{},s=o[e.id];if(!u(s)||s.isDestroyed()){let a=t.indices;s=mt.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,o[e.id]=s,t.indices.indexBuffers=o}else++s.referenceCount;return new oi({context:e,attributes:r,indexBuffer:s})};no._freeVertexArray=function(e){if(u(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),u(t)&&!t.isDestroyed()&&u(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function eut(e,t,n,i,r,o,s){e.vertexArray=no._createVertexArrayForMesh(t,e.mesh),e.terrainState=Cr.READY,e.fill=e.fill&&e.fill.destroy(s)}function tut(e){let t=e.cache.tile_waterMaskData;if(!u(t)){let n=Rt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function nut(e,t){let n=t.terrainData.waterMask,i=tut(e),r,o=n.length;if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Rt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}no.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;u(t)&&(!u(t.data)||!u(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};no.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,r=e.rectangle,o=r.width,s=r.height,a=o/i.width,c=s/i.height;return n.x=a*(r.west-i.west)/o,n.y=c*(r.south-i.south)/s,n.z=a,n.w=c,n};var Wf=no;var UN=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var VN=`in vec4 position; -in float webMercatorT; - -uniform vec2 u_textureDimensions; - -out vec2 v_textureCoordinates; - -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;function vS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=fi.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!u(r)&&e.ready&&e.imageryProvider._ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}vS.createPlaceholder=function(e){let t=new vS(e,0,0,0);return t.addReference(),t.state=fi.PLACEHOLDER,t};vS.prototype.addReference=function(){++this.referenceCount};vS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),u(this.parent)&&this.parent.releaseReference(),u(this.image)&&u(this.image.destroy)&&this.image.destroy(),u(this.texture)&&this.texture.destroy(),u(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};vS.prototype.processStateMachine=function(e,t,n){this.state===fi.UNLOADED&&!n&&(this.state=fi.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===fi.RECEIVED&&(this.state=fi.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===fi.READY&&t&&!this.texture;(this.state===fi.TEXTURE_LOADED||i)&&(this.state=fi.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var wS=vS;function rX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}rX.prototype.freeResources=function(){u(this.readyImagery)&&this.readyImagery.releaseReference(),u(this.loadingImagery)&&this.loadingImagery.releaseReference()};rX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===fi.READY)return u(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;u(o)&&(o.state!==fi.READY||!this.useWebMercatorT&&!u(o.texture));)o.state!==fi.FAILED&&o.state!==fi.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(u(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,u(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===fi.FAILED||i.state===fi.INVALID?u(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var DS=rX;function pi(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,pi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,pi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,pi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,pi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,pi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,pi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,pi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,pi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new DS(wS.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(pi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return u(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});pi.DEFAULT_BRIGHTNESS=1;pi.DEFAULT_CONTRAST=1;pi.DEFAULT_HUE=0;pi.DEFAULT_SATURATION=1;pi.DEFAULT_GAMMA=1;pi.DEFAULT_SPLIT=zc.NONE;pi.DEFAULT_MINIFICATION_FILTER=cn.LINEAR;pi.DEFAULT_MAGNIFICATION_FILTER=Ti.LINEAR;pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;pi.fromProviderAsync=function(e,t){let n=new pi(void 0,t);return aut(n,Promise.resolve(e)),n};pi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),pi.fromProviderAsync(V_({style:e.style}),e)};pi.prototype.isBaseLayer=function(){return this._isBaseLayer};pi.prototype.isDestroyed=function(){return!1};pi.prototype.destroy=function(){return ue(this)};var Tye=new ce,xye=new ce,oX=new ce,Eye=new ce;pi.prototype.getViewableRectangle=async function(){$("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return await e._readyPromise,ce.intersection(e.rectangle,t)};pi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};pi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!u(t)||u(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||u(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;u(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready||!r._ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof Oi&&e.rectangle.north<Oi.MaximumLatitude&&e.rectangle.south>-Oi.MaximumLatitude,s=ce.intersection(r.rectangle,this._rectangle,Tye),a=ce.intersection(e.rectangle,s,xye);if(!u(a)){if(!this.isBaseLayer())return!1;let v=s,I=e.rectangle;a=xye,I.south>=v.north?a.north=a.south=v.north:I.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(I.south,v.south),a.north=Math.min(I.north,v.north)),I.west>=v.east?a.west=a.east=v.east:I.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(I.west,v.west),a.east=Math.min(I.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=out(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),u(r.minimumLevel)){let v=r.minimumLevel;d<v&&(d=v)}let g=r.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),A=g.positionToTileXY(ce.southeast(a),d),x=e.rectangle.width/512,C=e.rectangle.height/512,T=g.tileXYToRectangle(h.x,h.y,d);Math.abs(T.south-e.rectangle.north)<C&&h.y<A.y&&++h.y,Math.abs(T.east-e.rectangle.west)<x&&h.x<A.x&&++h.x;let E=g.tileXYToRectangle(A.x,A.y,d);Math.abs(E.north-e.rectangle.south)<C&&A.y>h.y&&--A.y,Math.abs(E.west-e.rectangle.east)<x&&A.x>h.x&&--A.x;let S=ce.clone(e.rectangle,Eye),w=g.tileXYToRectangle(h.x,h.y,d),D=ce.intersection(w,s,oX),M;o?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),M=g.tileXYToNativeRectangle.bind(g),x=S.width/512,C=S.height/512):M=g.tileXYToRectangle.bind(g);let O,B=0,L=1,_;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=x&&(B=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=C&&(L=Math.max(0,(D.north-S.south)/S.height));let b=L;for(let v=h.x;v<=A.x;v++)if(O=B,w=M(v,h.y,d),D=ce.simpleIntersection(w,s,oX),!!u(D)){B=Math.min(1,(D.east-S.west)/S.width),v===A.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<x)&&(B=1),L=b;for(let I=h.y;I<=A.y;I++){if(_=L,w=M(v,I,d),D=ce.simpleIntersection(w,s,oX),!u(D))continue;L=Math.max(0,(D.south-S.south)/S.height),I===A.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<C)&&(L=0);let R=new oe(O,L,B,_),F=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new DS(F,R,o)),++n}}return!0};pi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Tye),i=c.rectangleToNativeRectangle(i,Eye)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new oe(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};pi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!u(s))return r();e.image=s,e.state=fi.RECEIVED,e.request=void 0,xi.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function r(s){if(e.request.state===ti.CANCELLED){e.state=fi.UNLOADED,e.request=void 0;return}e.state=fi.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=xi.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function o(){let s=new qr({throttle:!1,throttleByServer:!0,type:$o.IMAGERY});e.request=s,e.state=fi.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!u(a)){e.state=fi.UNLOADED,e.request=void 0;return}u(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){r(c)}):i(a)}o()};pi.prototype._createTextureWebGL=function(e,t){let n=new fn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return u(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?at.RGBA:at.RGB,sampler:n})};pi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(u(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(u(o)){if(!o.isReady()){t.state=fi.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=fi.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Oi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=fi.TEXTURE_LOADED};function Cye(e,t,n){return`${e}:${t}:${n}`}pi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===cn.LINEAR&&i===Ti.LINEAR&&!at.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=cn.LINEAR_MIPMAP_LINEAR;let o=Ht.maximumTextureFilterAnisotropy,s=Math.min(o,y(this._maximumAnisotropy,o)),a=Cye(n,i,s),c=e.cache.imageryLayerMipmapSamplers;u(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let l=c[a];u(l)||(l=c[a]=new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Fm.NICEST),t.sampler=l}else{let o=Cye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;u(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];u(a)||(a=s[o]=new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};pi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ii)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new Yu({persists:!0,owner:this,preExecute:function(c){rut(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=fi.READY,t.releaseReference()},canceled:function(){t.state=fi.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=fi.READY};pi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};pi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){u(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};pi.prototype.getImageryFromCache=function(e,t,n,i){let r=bye(e,t,n),o=this._imageryCache[r];return u(o)||(o=new wS(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};pi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=bye(e.x,e.y,e.level);delete this._imageryCache[t]};function bye(e,t,n){return JSON.stringify([e,t,n])}var qz={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},iut=Gt.supportsTypedArrays()?new Float32Array(2*64):void 0;function rut(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!u(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){u(this.framebuffer)&&this.framebuffer.destroy(),u(this.vertexArray)&&this.vertexArray.destroy(),u(this.shaderProgram)&&this.shaderProgram.destroy()}};let x=new Float32Array(2*64*2),C=0;for(let D=0;D<64;++D){let M=D/63;x[C++]=0,x[C++]=M,x[C++]=1,x[C++]=M}let T={position:0,webMercatorT:1},E=Yo.getRegularGridIndices(2,64),S=mt.createIndexBuffer({context:t,typedArray:E,usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});r.vertexArray=new oi({context:t,attributes:[{index:T.position,vertexBuffer:mt.createVertexBuffer({context:t,typedArray:x,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:mt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let w=new ke({sources:[VN]});r.shaderProgram=Kt.fromCache({context:t,vertexShaderSource:w,fragmentShaderSource:UN,attributeLocations:T}),r.sampler=new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;qz.textureDimensions.x=o,qz.textureDimensions.y=s,qz.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Rt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(Fm.NICEST);let p=i.south,g=i.north,h=iut,A=0;for(let x=0;x<64;++x){let C=x/63,T=P.lerp(p,g,C);a=Math.sin(T);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[A++]=S,h[A++]=S}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=qz,e.vertexArray=r.vertexArray}function out(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ii?1:Math.cos(n),a=r.rectangle,l=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(l)/Math.log(2);return Math.round(f)|0}function sut(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function aut(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){sut(e._errorEvent,i)}}var Gs=pi;var Sye={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Sye.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},$n=Sye;function PS(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}PS.prototype.update=function(e,t,n){this.changedThisFrame&&(Mye(e,t,this.tile,n),this.changedThisFrame=!1)};PS.prototype.destroy=function(e){this._destroyVertexArray(e),u(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};PS.prototype._destroyVertexArray=function(e){u(this.vertexArray)&&(u(e)?e.push(this.vertexArray):Wf._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var cut=new ty;PS.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=cut;a.clear();for(let l=0;l<t.length;++l){let f=t[l];u(f.data.vertexArray)&&a.enqueue(t[l])}let c=a.dequeue();for(;c!==void 0;){let l=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);gs(e,n,c,l,s,yn.EAST,!1,a,i),gs(e,n,c,f,s,yn.NORTH,!1,a,i),gs(e,n,c,d,s,yn.WEST,!1,a,i),gs(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=l.findTileToNorth(o),h=l.findTileToSouth(o),A=d.findTileToNorth(o),x=d.findTileToSouth(o);gs(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),gs(e,n,c,A,s,yn.SOUTHWEST,!1,a,i),gs(e,n,c,h,s,yn.NORTHEAST,!1,a,i),gs(e,n,c,x,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function gs(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let l=i;for(;l&&(l._lastSelectionResultFrame!==r||$n.wasKicked(l._lastSelectionResult)||$n.originalResult(l._lastSelectionResult)===$n.CULLED);){if(s)return;let f=l.parent;if(o>=yn.NORTHWEST&&f!==void 0)switch(o){case yn.NORTHWEST:l=l===f.northwestChild?f:void 0;break;case yn.NORTHEAST:l=l===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:l=l===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:l=l===f.southeastChild?f:void 0;break}else l=f}if(l!==void 0){if(l._lastSelectionResult===$n.RENDERED){if(u(l.data.vertexArray))return;lut(e,t,n,l,o,r,a,c);return}if($n.originalResult(i._lastSelectionResult)!==$n.CULLED)switch(o){case yn.WEST:gs(e,t,n,i.northwestChild,r,o,!0,a,c),gs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.EAST:gs(e,t,n,i.southeastChild,r,o,!0,a,c),gs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTH:gs(e,t,n,i.southwestChild,r,o,!0,a,c),gs(e,t,n,i.southeastChild,r,o,!0,a,c);break;case yn.NORTH:gs(e,t,n,i.northeastChild,r,o,!0,a,c),gs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHWEST:gs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHEAST:gs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTHWEST:gs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.SOUTHEAST:gs(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new fe("Invalid edge")}}}function lut(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new PS(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),uut(e,t,n,i,r,a)}function uut(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;u(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Mye(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let l,f;switch(r){case yn.WEST:l=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:l=s.southMeshes,f=s.southTiles;break;case yn.EAST:l=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:l=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||l[0]!==a||l.length!==1,l[0]=a,f[0]=n,l.length=1,f.length=1;return}let d,p,g,h,A=n.rectangle,x,C=i.rectangle;switch(r){case yn.WEST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.north,h.south,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.south,h.north,x));++p);break;case yn.SOUTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.west,h.east,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.east,h.west,x));++p);break;case yn.EAST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.south,h.north,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.north,h.south,x));++p);break;case yn.NORTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.east,h.west,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.west,h.east,x));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||l[d]!==a,l[d]=a,f[d]=n):(s.changedThisFrame=!0,l.splice(d,p-d,a),f.splice(d,p-d,n))}var pC=new he,fut=new he,IS=new m,lX=new m,sX=new H,aX=new H,ku=new H;function $z(){this.height=0,this.encodedNormal=new H}function Yz(e,t,n,i,r,o,s,a,c){if(u(r))return r;let l;if(u(o)&&u(s))l=(o.height+s.height)*.5;else if(u(o))l=o.height;else if(u(s))l=s.height;else if(u(a))l=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;u(d)&&(p=d.minimumHeight,g=d.maximumHeight),l=(p+g)*.5}return Rye(e,t,n,i,l,c),c}var dut={minimumHeight:0,maximumHeight:0},mut=new m,vye=new $z,wye=new $z,Dye=new $z,Iye=new $z,hut=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,put={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Mye(e,t,n,i){Wf.initialize(n,e.terrainProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,l=a!==1,f=n.tilingScheme.ellipsoid,d=Kz(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,Dye),p=Kz(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,vye),g=Kz(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,wye),h=Kz(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Iye);d=Yz(o,f,0,1,d,p,h,g,Dye),p=Yz(o,f,0,0,p,d,g,h,vye),g=Yz(o,f,1,1,g,p,h,d,wye),h=Yz(o,f,1,1,h,g,d,p,Iye);let A=p.height,x=g.height,C=d.height,T=h.height,E=Math.min(A,x,C,T),S=Math.max(A,x,C,T),w=(E+S)*.5,D,M,O=e.getLevelMaximumGeometricError(n.level),B=f.maximumRadius-O,L=Math.acos(B/f.maximumRadius)*4;if(L*=1.5,s.width>L&&S-E<=O){let v=new Pa({width:9,height:9,buffer:hut,structure:{heightOffset:S}}),I=put;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,o.mesh=v._createMeshSync(I)}else{let v=l,I=ce.center(s,fut);I.height=w;let R=f.cartographicToCartesian(I,mut),F=new hc(R,void 0,void 0,void 0,void 0,!0,!0,v,a,c),k=5,V;for(V=o.westMeshes,D=0,M=V.length;D<M;++D)k+=V[D].eastIndicesNorthToSouth.length;for(V=o.southMeshes,D=0,M=V.length;D<M;++D)k+=V[D].northIndicesWestToEast.length;for(V=o.eastMeshes,D=0,M=V.length;D<M;++D)k+=V[D].westIndicesSouthToNorth.length;for(V=o.northMeshes,D=0,M=V.length;D<M;++D)k+=V[D].southIndicesEastToWest.length;let G=dut;G.minimumHeight=E,G.maximumHeight=S;let U=F.stride,Y=new Float32Array(k*U),W=0,J=W;W=Xz(f,s,F,Y,W,0,1,d.height,d.encodedNormal,1,G),W=Zz(o,f,F,Y,W,o.westTiles,o.westMeshes,yn.EAST,G);let j=W;W=Xz(f,s,F,Y,W,0,0,p.height,p.encodedNormal,0,G),W=Zz(o,f,F,Y,W,o.southTiles,o.southMeshes,yn.NORTH,G);let K=W;W=Xz(f,s,F,Y,W,1,0,g.height,g.encodedNormal,0,G),W=Zz(o,f,F,Y,W,o.eastTiles,o.eastMeshes,yn.WEST,G);let Z=W;W=Xz(f,s,F,Y,W,1,1,h.height,h.encodedNormal,1,G),W=Zz(o,f,F,Y,W,o.northTiles,o.northMeshes,yn.SOUTH,G),E=G.minimumHeight,S=G.maximumHeight;let me=Mn.fromRectangle(s,E,S,n.tilingScheme.ellipsoid),ye=Oi.geodeticLatitudeToMercatorAngle(s.south),se=1/(Oi.geodeticLatitudeToMercatorAngle(s.north)-ye),pe=(Oi.geodeticLatitudeToMercatorAngle(I.latitude)-ye)*se,Ae=f.geodeticSurfaceNormalCartographic(pC,lX),De=Yn.octEncode(Ae,sX),Ce=W;F.encode(Y,W*U,me.center,H.fromElements(.5,.5,ku),w,De,pe,Ae),++W;let Re=W,tt=Re<256?1:2,nt=(Re-1)*3,Wt=nt*tt,un=(Y.length-Re*U)*Float32Array.BYTES_PER_ELEMENT,pt;if(un>=Wt){let xe=Re*U*Float32Array.BYTES_PER_ELEMENT;pt=Re<256?new Uint8Array(Y.buffer,xe,nt):new Uint16Array(Y.buffer,xe,nt)}else pt=Re<256?new Uint8Array(nt):new Uint16Array(nt);Y=new Float32Array(Y.buffer,0,Re*U);let gn=0;for(D=0;D<Re-2;++D)pt[gn++]=Ce,pt[gn++]=D,pt[gn++]=D+1;pt[gn++]=Ce,pt[gn++]=D,pt[gn++]=0;let Bn=[];for(D=j;D>=J;--D)Bn.push(D);let Ut=[];for(D=K;D>=j;--D)Ut.push(D);let kt=[];for(D=Z;D>=K;--D)kt.push(D);let Ee=[];for(Ee.push(0),D=Ce-1;D>=Z;--D)Ee.push(D);o.mesh=new Vf(F.center,Y,pt,nt,Re,E,S,ae.fromOrientedBoundingBox(me),Tut(e,me.center,s,E,S),F.stride,me,F,Bn,Ut,kt,Ee)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Wf._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let b=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=r._findAncestorTileWithTerrainData(n);u(v)&&u(v.data.waterMaskTexture)&&(o.waterMaskTexture=v.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,v,o.waterMaskTranslationAndScale))}u(b)&&(--b.referenceCount,b.referenceCount===0&&b.destroy())}function Xz(e,t,n,i,r,o,s,a,c,l,f){let d=pC;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,IS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,lX));let h=aX;return h.x=o,h.y=s,n.encode(i,r*n.stride,p,h,a,c,l,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var Qz=new ce;function kN(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ce.clone(e.rectangle,Qz),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ce.clone(e.rectangle,Qz),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,l=r.north-r.south,f=(o.south-r.south)/l,d=(o.north-r.south)/l,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var _ut=new H;function cX(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var gut=new H,yut=new m;function Aut(e,t,n,i,r,o,s,a,c,l){let f=i.encoding,d=i.vertices,p=kN(t,n,f.decodeTextureCoordinates(d,r,ku),ku),g=kN(t,n,f.decodeTextureCoordinates(d,o,aX),aX),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let A=f.decodeHeight(d,r),x=f.decodeHeight(d,o),C=n.rectangle;pC.longitude=P.lerp(C.west,C.east,s),pC.latitude=P.lerp(C.south,C.north,a),l.height=pC.height=P.lerp(A,x,h);let T;if(f.hasVertexNormals){let E=f.getOctEncodedNormal(d,r,_ut),S=f.getOctEncodedNormal(d,o,gut),w=Yn.octDecode(E.x,E.y,IS),D=Yn.octDecode(S.x,S.y,yut);T=m.lerp(w,D,h,IS),m.normalize(T,T),Yn.octEncode(T,l.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(pC,IS),Yn.octEncode(T,l.encodedNormal)}function Rye(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(pC,IS);Yn.octEncode(s,o.encodedNormal)}function Kz(e,t,n,i,r,o,s,a,c,l,f){if(Oye(e,t,a,s,!1,n,i,f)||Oye(e,t,l,c,!0,n,i,f))return f;let p;if(uX(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],cX(o,p,n,i,f),f;let g;if(n===0?i===0?g=Jz(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=Jz(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=Jz(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=Jz(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),u(g))return Rye(e,t,n,i,g,f),f}function Jz(e,t,n,i,r,o,s,a){let c=Pye(e,t,!1,n,s,a),l=Pye(i,r,!0,o,s,a);return u(c)&&u(l)?(c+l)*.5:u(c)?c:l}function Zz(e,t,n,i,r,o,s,a,c){for(let l=0;l<o.length;++l)r=xut(e,t,n,i,r,o[l],s[l],a,c);return r}function xut(e,t,n,i,r,o,s,a,c){let l=o.rectangle;a===yn.EAST&&e.tile.x===0?(l=ce.clone(o.rectangle,Qz),l.west-=P.TWO_PI,l.east-=P.TWO_PI):a===yn.WEST&&o.x===0&&(l=ce.clone(o.rectangle,Qz),l.west+=P.TWO_PI,l.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,ku),d=ku.x,p=ku.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let A=o,x=e.tile,C=s.encoding,T=s.vertices,E=n.stride,S,w;C.hasWebMercatorT&&(S=Oi.geodeticLatitudeToMercatorAngle(f.south),w=1/(Oi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<g.length;++D){let M=g[D],O=C.decodeTextureCoordinates(T,M,ku);kN(A,x,O,O);let B=O.x,L=O.y,_=h?B:L;if(_<0||_>1||Math.abs(B-d)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let b=Math.abs(B)<P.EPSILON5||Math.abs(B-1)<P.EPSILON5,v=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(b&&v)continue;let I=C.decodePosition(T,M,IS),R=C.decodeHeight(T,M),F;C.hasVertexNormals?F=C.getOctEncodedNormal(T,M,sX):(F=sX,F.x=0,F.y=0);let k=L;if(C.hasWebMercatorT){let G=P.lerp(f.south,f.north,L);k=(Oi.geodeticLatitudeToMercatorAngle(G)-S)*w}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,lX)),n.encode(i,r*E,I,O,R,F,k,V),c.minimumHeight=Math.min(c.minimumHeight,R),c.maximumHeight=Math.max(c.maximumHeight,R),++r}return r}function Pye(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let l=s;l!==a;l+=c){let f=e[l],d=t[l];if(!uX(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(u(g))return f.encoding.decodeHeight(f.vertices,g)}}function uX(e,t){return u(t)&&(!u(e.data.fill)||!e.data.fill.changedThisFrame)}function Oye(e,t,n,i,r,o,s,a){let c,l,f,d,p,g=i[r?0:n.length-1],h=n[r?0:n.length-1];if(uX(g,h)&&(o===0?s===0?(c=r?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,l=r,f=r):(c=r?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,l=!r,f=!1):s===0?(c=r?h.westIndicesSouthToNorth:h.northIndicesWestToEast,l=!r,f=!0):(c=r?h.southIndicesEastToWest:h.westIndicesSouthToNorth,l=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,ku);let A=kN(g,e.tile,ku,ku);if(A.x===o&&A.y===s)return cX(h,p,o,s,a),!0;if(d=Mr(c,l?o:s,function(x,C){h.encoding.decodeTextureCoordinates(h.vertices,x,ku);let T=kN(g,e.tile,ku,ku);return f?l?T.x-o:T.y-s:l?o-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return Aut(t,g,e.tile,h,c[d-1],c[d],o,s,l,a),!0}else return cX(h,c[d],o,s,a),!0}return!1}var Cut=[new m,new m,new m,new m];function Tut(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Cut;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var OS=PS;function io(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(io.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(io.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(io.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(io.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(io.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return u(this._terrainProvider)&&this._terrainProvider._ready&&(this._imageryLayers.length===0||this._imageryLayers.get(0).ready&&this._imageryLayers.get(0).imageryProvider._ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,u(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}}});function Eut(e,t){let n=e.loadingImagery;u(n)||(n=e.readyImagery);let i=t.loadingImagery;return u(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}io.prototype.update=function(e){this._imageryLayers._update()};function but(e,t){let n=t.creditDisplay;u(e._terrainProvider)&&e._terrainProvider._ready&&u(e._terrainProvider.credit)&&n.addCreditToNextFrame(e._terrainProvider.credit);let i=e._imageryLayers;for(let r=0,o=i.length;r<o;++r){let s=i.get(r);s.ready&&s.imageryProvider._ready&&u(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}io.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Eut)})),but(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Wf._freeVertexArray(t[i]);t.length=0};io.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,r=t.length;i<r;++i){let o=t[i];u(o)&&(o.length=0)}let n=this._clippingPlanes;u(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};io.prototype.endUpdate=function(e){if(!u(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:qa.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:qa.LESS_OR_EQUAL},blending:dn.ALPHA_BLEND});let s=We(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=We(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&OS.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let o=this._tilesToRenderByTextureCount;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(u(c))for(let l=0,f=c.length;l<f;++l){let d=c[l],p=d.data.tileBoundingRegion;Uye(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){Uye(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Vye(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}io.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Vye(t[n],e)};io.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};io.prototype.getLevelMaximumGeometricError=function(e){return u(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};io.prototype.loadTile=function(e,t){let n=t.data,i=!0,r;u(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===$n.CULLED_BUT_NEEDED,r=n.terrainState),Wf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&r!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==fo.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Wf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Sut=new ae,kye=new ce,vut=new ce,wut=new he;function tH(e,t){if(t.west<t.east)return t;let n=ce.clone(t,vut);return ce.center(e,wut).longitude>0?n.east=P.PI:n.west=-P.PI,n}function zye(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(u(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}io.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let r=zye(this,t);if(t.fog.enabled&&!r&&P.fog(i,t.fog.density)>=1)return fo.NONE;let o=e.data,s=o.tileBoundingRegion;if(o.boundingVolumeSourceTile===void 0)return fo.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;u(c)||(c=s.boundingSphere),o.clippedByBoundaries=!1;let l=tH(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(l,e.rectangle,kye);if(!u(f))return fo.NONE;if(ce.equals(f,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Sut,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&u(o.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!u(c))return fo.PARTIAL;let d=this._clippingPlanes;if(u(d)&&d.enabled){let A=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=A!==$t.INSIDE,A===$t.OUTSIDE)return fo.NONE}let p,g=a.computeVisibility(c);if(g===$t.OUTSIDE?p=fo.NONE:g===$t.INTERSECTING?p=fo.PARTIAL:g===$t.INSIDE&&(p=fo.FULL),p===fo.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof tn;if(t.mode===ne.SCENE3D&&!h&&u(n)&&!r){let A=o.occludeePointInScaledSpace;return!u(A)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(A,s.minimumHeight)?p:fo.NONE}return p};io.prototype.canRefine=function(e){return u(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Dut=[],Iut=[];io.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Dut;i.length=this._imageryLayers.length;let r=!1,o=!1,s;u(n)&&(r=n.terrainState===Cr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(u(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!u(p)||p.state===fi.FAILED||p.state===fi.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let l=this.quadtree._lastSelectionFrameNumber,f=Iut;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===l?d._lastSelectionResult:$n.NONE;if(p===$n.RENDERED){let g=d.data;if(!u(g))continue;if(!r&&d.data.terrainState===Cr.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let A=h[a],x=A.loadingImagery,C=!u(x)||x.state===fi.FAILED||x.state===fi.INVALID,T=(A.loadingImagery||A.readyImagery).imageryLayer._layerIndex;if(C&&!i[T])return!1}}else p===$n.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var Put=new m;io.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,s=m.subtract(i.center,r,Put),a=m.magnitude(s);return a<P.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,o))*e._distance)};var Bye=new N,eH=new N,Out=new oe,Mut=new oe,Rut=new oe,But=new m,Lye=new m,Lut=new m,Nut=new m;io.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let l=i[a];u(l.readyImagery)&&l.readyImagery.imageryLayer.alpha!==0&&++n}let r=this._tilesToRenderByTextureCount[n];u(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);let o=e.data;u(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Fut=[new m,new m,new m,new m];function Nye(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Fut;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}io.prototype.computeDistanceToTile=function(e,t){Uut(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let r=n.tileBoundingRegion,o=r.minimumHeight,s=r.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,l=Math.abs(c-o),f=Math.abs(c-s);l>f?(r.minimumHeight=o,r.maximumHeight=o):(r.minimumHeight=s,r.maximumHeight=s)}let a=r.distanceToCamera(t);return r.minimumHeight=o,r.maximumHeight=s,a};function Uut(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Wf);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Af({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,l=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let x=0;x<d.rectangles.length;x++)if(ce.intersection(e.rectangle,d.rectangles[x])){f=d.heights[x];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let x=0;x<p.rectangles.length;x++)if(ce.intersection(o.rectangle,p.rectangles[x])){g=p.height;break}}let h=i.mesh,A=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)o.minimumHeight=h.minimumHeight,o.maximumHeight=h.maximumHeight,c=!0;else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0)o.minimumHeight=A._minimumHeight,o.maximumHeight=A._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let x=e.parent;for(;x!==void 0;){let C=x.data;if(C!==void 0){let T=C.mesh,E=C.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0){o.minimumHeight=T.minimumHeight,o.maximumHeight=T.maximumHeight;break}else if(E!==void 0&&E._minimumHeight!==void 0&&E._maximumHeight!==void 0){o.minimumHeight=E._minimumHeight,o.maximumHeight=E._maximumHeight;break}}x=x.parent}l=x}if(o.maximumHeight+=g,o.maximumHeight<f&&(o.maximumHeight=f),o.minimumHeight>f&&(o.minimumHeight=f),l!==void 0){let x=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((x!==1||f!==0)&&(c=!1,o.minimumHeight=Ic.getHeight(o.minimumHeight,x,C),o.maximumHeight=Ic.getHeight(o.maximumHeight,x,C)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=Mn.clone(h.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ae.clone(h.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),u(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Nye(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let E=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||E)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=Nye(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=l,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function Vut(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,l;for(l=0;l<c;++l)if(r=a[l],o=y(r.readyImagery,r.loadingImagery),o.imageryLayer===t){s=l;break}if(s!==-1){let f=s+e;if(r=a[f],o=u(r)?y(r.readyImagery,r.loadingImagery):void 0,!u(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(l=s;l<f;++l)a[l].freeResources();a.splice(s,e)}return!0}}io.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,r=this._imageryLayersUpdatedEvent,o=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(u(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,l=c.length,f=-1,d=0;for(a=0;a<l;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Vut(d,e,n),s.state=Hs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=o}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Hs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==$n.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}};io.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,r=-1,o=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],l=c.loadingImagery;if(u(l)||(l=c.readyImagery),l.imageryLayer===e)r===-1&&(r=s),c.freeResources(),++o;else if(r!==-1)break}r!==-1&&i.splice(r,o)}),u(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};io.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};io.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var kut=new N,zut=new N;function Fye(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=N.multiplyByPoint(i,this.properties.rtc,Lye);return N.setTranslation(i,r,Bye),Bye},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,Lye);return N.setTranslation(i,o,eH),N.multiply(r,eH,eH),eH},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return u(i)&&u(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=u(i)?N.multiply(e.context.uniformState.view,i.modelMatrix,kut):N.IDENTITY;return N.inverseTranspose(r,zut)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return u(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return u(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new N,tileRectangle:new oe,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new H,scaleAndBias:new N,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&u(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=_t(n,i)}return u(t.materialUniformMap)?_t(n,t.materialUniformMap):n}function Hut(e,t,n){let i=n.data,r,o;if(u(i.vertexArray)?(r=i.mesh,o=i.vertexArray):u(i.fill)&&u(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),!(!u(r)||!u(o))){if(u(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Gut(e,o,r),i.wireframeVertexArray.mesh=r}}function Gut(e,t,n){let r={indices:n.indices,primitiveType:Be.TRIANGLES};Nn.toWireframe(r);let o=r.indices,s=mt.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new oi({context:e,attributes:t._attributes,indexBuffer:s})}var Hye,Gye,nH;(function(){let e=new Ct({geometry:ld.fromDimensions({dimensions:new m(2,2,2)})}),t=new Ct({geometry:new r_({radius:1})}),n=new N,i,r;function o(s){return new Sn({geometryInstances:s,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})}Hye=function(s,a){return s===i||(nH(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=zt.fromColor(a),r=o(e)),r},Gye=function(s,a){return s===i||(nH(),i=s,n=N.fromTranslation(s.center,n),n=N.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=zt.fromColor(a),r=o(t)),r},nH=function(){u(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Wut=new oe(0,0,0,0),jut={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},qut=z.TRANSPARENT,Yut=new Bt;function Uye(e,t,n,i){let r=t.data;u(r.vertexArray)||(r.fill===void 0&&(r.fill=new OS(t)),r.fill.update(e,n));let o=n.creditDisplay,s=r.terrainData;if(u(s)&&u(s.credits)){let xe=s.credits;for(let ft=0,di=xe.length;ft<di;++ft)o.addCreditToNextFrame(xe[ft])}let a=Ht.maximumTextureImageUnits,c=r.waterMaskTexture,l=r.waterMaskTranslationAndScale;!u(c)&&u(r.fill)&&(c=r.fill.waterMaskTexture,l=r.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,A=d.rectangle,x=y(e.undergroundColor,qut),C=y(e.undergroundColorAlphaByDistance,Yut),T=zye(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(C.nearValue>0||C.farValue>0),E=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,w=e.hasWaterMask&&u(c),D=e.oceanNormalMap,M=w&&u(D),O=u(e.terrainProvider)&&e.terrainProvider._ready&&e.terrainProvider.hasVertexNormals,B=n.fog.enabled&&n.fog.renderable&&!f,L=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,_=xn.castShadows(e.shadows)&&!p,b=xn.receiveShadows(e.shadows)&&!p,v=e.hueShift,I=e.saturationShift,R=e.brightnessShift,F=!(P.equalsEpsilon(v,0,P.EPSILON7)&&P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(R,0,P.EPSILON7)),k=!1;if(L){let xe=m.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;k=xe>ft}w&&--a,M&&--a,u(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,u(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let V=r.renderedMesh,G=V.center,U=V.encoding,Y=r.tileBoundingRegion,W=n.terrainExaggeration,J=n.terrainExaggerationRelativeHeight,j=e.marsOptions?.uplift;i&&j&&(J=n.terrainExaggerationRelativeHeight-j.height/(W-1));let K=W!==1,Z=U.hasGeodeticSurfaceNormals,me=Out,ye=0,se=0,pe=0,Ae=0,De=!1;if(n.mode!==ne.SCENE3D){let xe=n.mapProjection,ft=xe.project(ce.southwest(t.rectangle),Lut),di=xe.project(ce.northeast(t.rectangle),Nut);if(me.x=ft.x,me.y=ft.y,me.z=di.x,me.w=di.y,n.mode!==ne.MORPHING&&(G=But,G.x=0,G.y=(me.z+me.x)*.5,G.z=(me.w+me.y)*.5,me.x-=G.y,me.y-=G.z,me.z-=G.y,me.w-=G.z),n.mode===ne.SCENE2D&&U.quantization===Vs.BITS12){let Xe=1/(Math.pow(2,12)-1)*.5,Xi=(me.z-me.x)*Xe,Or=(me.w-me.y)*Xe;me.x-=Xi,me.y-=Or,me.z+=Xi,me.w+=Or}xe instanceof Oi&&(ye=t.rectangle.south,se=t.rectangle.north,pe=Oi.geodeticLatitudeToMercatorAngle(ye),Ae=1/(Oi.geodeticLatitudeToMercatorAngle(se)-pe),De=!0)}let Ce=jut;Ce.frameState=n,Ce.surfaceTile=r,Ce.showReflectiveOcean=w,Ce.showOceanWaves=M,Ce.enableLighting=e.enableLighting,Ce.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ce.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ce.showGroundAtmosphere=L,Ce.atmosphereLightIntensity=e.atmosphereLightIntensity,Ce.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ce.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ce.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ce.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ce.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ce.perFragmentGroundAtmosphere=k,Ce.hasVertexNormals=O,Ce.useWebMercatorProjection=De,Ce.clippedByBoundaries=r.clippedByBoundaries,Ce.hasGeodeticSurfaceNormals=Z,Ce.hasExaggeration=K;let Re=r.imagery,tt=0,nt=Re.length,Wt=e.showSkirts&&!f&&!p,un=e.backFaceCulling&&!f&&!p,pt=un?e._renderState:e._disableCullingRenderState,gn=un?e._blendRenderState:e._disableCullingBlendRenderState,Bn=pt,Ut=e._firstPassInitialColor,kt=n.context;if(u(e._debug.boundingSphereTile)||nH(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let xe=e._drawCommands.length;for(let ft=0;ft<xe;++ft)e._uniformMaps[ft]=Fye(n,e)}do{let xe=0,ft,di;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new et,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ae,ft.orientedBoundingBox=void 0,di=Fye(n,e),e._drawCommands.push(ft),e._uniformMaps.push(di)):(ft=e._drawCommands[e._usedDrawCommands],di=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let jr=Y.boundingVolume,zo=Y.boundingSphere;u(jr)?Hye(jr,z.RED).update(n):u(zo)&&Gye(zo,z.RED).update(n)}let Xe=di.properties;oe.clone(Ut,Xe.initialColor),Xe.oceanNormalMap=D,Xe.lightingFadeDistance.x=e.lightingFadeOutDistance,Xe.lightingFadeDistance.y=e.lightingFadeInDistance,Xe.nightFadeDistance.x=e.nightFadeOutDistance,Xe.nightFadeDistance.y=e.nightFadeInDistance,Xe.atmosphereLightIntensity=e.atmosphereLightIntensity,Xe.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Xe.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Xe.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Xe.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Xe.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Xe.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let Xi=f?h:g,Or=f?g:h;u(Xi)&&(oe.fromElements(Xi.near,Xi.nearValue,Xi.far,Xi.farValue,Xe.frontFaceAlphaByDistance),oe.fromElements(Or.near,Or.nearValue,Or.far,Or.farValue,Xe.backFaceAlphaByDistance)),oe.fromElements(C.near,C.nearValue,C.far,C.farValue,Xe.undergroundColorAlphaByDistance),z.clone(x,Xe.undergroundColor),Xe.lambertDiffuseMultiplier=E,Xe.vertexShadowDarkness=S;let Jo=!u(r.vertexArray)&&u(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Jo&&z.clone(e.fillHighlightColor,Xe.fillHighlightColor),Xe.terrainExaggerationAndRelativeHeight.x=W,Xe.terrainExaggerationAndRelativeHeight.y=J,Xe.center3D=V.center,m.clone(G,Xe.rtc),oe.clone(me,Xe.tileRectangle),Xe.southAndNorthLatitude.x=ye,Xe.southAndNorthLatitude.y=se,Xe.southMercatorYAndOneOverHeight.x=pe,Xe.southMercatorYAndOneOverHeight.y=Ae;let Uo=Mut,xs=tH(t.rectangle,e.cartographicLimitRectangle),Ue=Rut,ot=tH(t.rectangle,A);m.fromElements(v,I,R,Xe.hsbShift);let Ge=t.rectangle,Je=1/Ge.width,it=1/Ge.height;Uo.x=(xs.west-Ge.west)*Je,Uo.y=(xs.south-Ge.south)*it,Uo.z=(xs.east-Ge.west)*Je,Uo.w=(xs.north-Ge.south)*it,oe.clone(Uo,Xe.localizedCartographicLimitRectangle),Ue.x=(ot.west-Ge.west)*Je,Ue.y=(ot.south-Ge.south)*it,Ue.z=(ot.east-Ge.west)*Je,Ue.w=(ot.north-Ge.south)*it;let Lt=e.marsOptions?.flat;if(Lt){let jr=Lt.areas,zo=0;jr?(jr.forEach(rn=>{zo<rn.length&&(zo=rn.length)}),Xe.mars_flat_AreaWidth=jr.length):Xe.mars_flat_AreaWidth=0,Xe.mars_flat_AreaHeight=zo,Xe.mars_flat_AreaTexture=Lt.texture,Xe.mars_flat_enabled=Lt.enabled}else Xe.mars_flat_enabled=!1,Xe.mars_flat_AreaWidth=0,Xe.mars_flat_AreaHeight=0,Xe.mars_flat_AreaTexture=void 0;Xe.inverseTileWidth=Je,Xe.cartographicTileRectangle=new H(Ge.west,Ge.south);let _n=e.marsOptions?.uplift;if(_n){let jr=_n.areas,zo=0;jr?(jr.forEach(rn=>{zo<rn.length&&(zo=rn.length)}),Xe.mars_uplift_RectangleWidth=jr.length):Xe.mars_uplift_RectangleWidth=0,Xe.mars_uplift_RectangleHeight=zo,Xe.mars_uplift_RampRectangle=_n.texture,Xe.mars_uplift_enabled=(!_n.showUp||_n.enabled&&e._topographicUpliftHeight!==0)&&u(_n.rectangles)&&_n.rectangles.length>0,Xe.mars_uplift_hideInsideOrOutside=!i}else Xe.mars_uplift_enabled=!1,Xe.mars_uplift_hideInsideOrOutside=!1,Xe.mars_uplift_RectangleWidth=0,Xe.mars_uplift_RectangleHeight=0,Xe.mars_uplift_RampRectangle=void 0;oe.clone(Ue,Xe.localizedTranslucencyRectangle);let mr=B&&P.fog(t._distance,n.fog.density)>P.EPSILON3;F=F&&(mr||L);let Er=!1,Cs=!1,Ts=!1,mo=!1,Di=!1,Vo=!1,Gn=!1,vn=!1,Wn=!1,Ci=!1,Ws=!1,Es=!1;for(;xe<a&&tt<nt;){let jr=Re[tt],zo=jr.readyImagery;if(++tt,!u(zo)||zo.imageryLayer.alpha===0)continue;let rn=jr.useWebMercatorT?zo.textureWebMercator:zo.texture,Se=zo.imageryLayer;u(jr.textureTranslationAndScale)||(jr.textureTranslationAndScale=Se._calculateTextureTranslationAndScale(t,jr)),Xe.dayTextures[xe]=rn,Xe.dayTextureTranslationAndScale[xe]=jr.textureTranslationAndScale,Xe.dayTextureTexCoordsRectangle[xe]=jr.textureCoordinateRectangle,Xe.dayTextureUseWebMercatorT[xe]=jr.useWebMercatorT,Xe.dayTextureAlpha[xe]=Se.alpha,Vo=Vo||Xe.dayTextureAlpha[xe]!==1,Xe.dayTextureNightAlpha[xe]=Se.nightAlpha,Gn=Gn||Xe.dayTextureNightAlpha[xe]!==1,Xe.dayTextureDayAlpha[xe]=Se.dayAlpha,Gn=Gn||Xe.dayTextureDayAlpha[xe]!==1,Xe.dayTextureBrightness[xe]=Se.brightness,Er=Er||Xe.dayTextureBrightness[xe]!==Gs.DEFAULT_BRIGHTNESS,Xe.dayTextureContrast[xe]=Se.contrast,Cs=Cs||Xe.dayTextureContrast[xe]!==Gs.DEFAULT_CONTRAST,Xe.dayTextureHue[xe]=Se.hue,Ts=Ts||Xe.dayTextureHue[xe]!==Gs.DEFAULT_HUE,Xe.dayTextureSaturation[xe]=Se.saturation,mo=mo||Xe.dayTextureSaturation[xe]!==Gs.DEFAULT_SATURATION,Xe.dayTextureOneOverGamma[xe]=1/Se.gamma,Di=Di||Xe.dayTextureOneOverGamma[xe]!==1/Gs.DEFAULT_GAMMA,Xe.dayTextureSplit[xe]=Se.splitDirection,vn=vn||Xe.dayTextureSplit[xe]!==0,Ws=Ws||!!Se.invertColor,Xe.mars3dTextureInvertColor[xe]=!!Se.invertColor,Es=Es||!!Se.filterColor,Se.filterColor?Xe.mars3dTextureFilterColor[xe]=new m(Se.filterColor.red,Se.filterColor.green,Se.filterColor.blue):Xe.mars3dTextureFilterColor[xe]=new m(1,1,1);let ct=Xe.dayTextureCutoutRectangles[xe];if(u(ct)||(ct=Xe.dayTextureCutoutRectangles[xe]=new oe),oe.clone(oe.ZERO,ct),u(Se.cutoutRectangle)){let tr=tH(Ge,Se.cutoutRectangle),bs=ce.simpleIntersection(tr,Ge,kye);Wn=u(bs)||Wn,ct.x=(tr.west-Ge.west)*Je,ct.y=(tr.south-Ge.south)*it,ct.z=(tr.east-Ge.west)*Je,ct.w=(tr.north-Ge.south)*it}let xt=Xe.colorsToAlpha[xe];u(xt)||(xt=Xe.colorsToAlpha[xe]=new oe);let Hi=u(Se.colorToAlpha)&&Se.colorToAlphaThreshold>0;if(Ci=Ci||Hi,Hi){let tr=Se.colorToAlpha;xt.x=tr.red,xt.y=tr.green,xt.z=tr.blue,xt.w=Se.colorToAlphaThreshold}else xt.w=-1;if(u(zo.credits)){let tr=zo.credits;for(let bs=0,ro=tr.length;bs<ro;++bs)o.addCreditToNextFrame(tr[bs])}++xe}Xe.dayTextures.length=xe,Xe.waterMask=c,oe.clone(l,Xe.waterMaskTranslationAndScale),Xe.minMaxHeight.x=U.minimumHeight,Xe.minMaxHeight.y=U.maximumHeight,N.clone(U.matrix,Xe.scaleAndBias);let La=e._clippingPlanes,js=u(La)&&La.enabled&&t.isClipped;js&&(Xe.clippingPlanesEdgeColor=z.clone(La.edgeColor,Xe.clippingPlanesEdgeColor),Xe.clippingPlanesEdgeWidth=La.edgeWidth),Ce.numberOfDayTextures=xe,Ce.applyBrightness=Er,Ce.applyContrast=Cs,Ce.applyHue=Ts,Ce.applySaturation=mo,Ce.applyGamma=Di,Ce.applyAlpha=Vo,Ce.applyDayNightAlpha=Gn,Ce.applySplit=vn,Ce.enableFog=mr,Ce.enableClippingPlanes=js,Ce.clippingPlanes=La,Ce.hasImageryLayerCutout=Wn,Ce.colorCorrect=F,Ce.highlightFillTile=Jo,Ce.colorToAlpha=Ci,Ce.showUndergroundColor=T,Ce.translucent=p,Ce.marsOptions={invertColor:Ws,filterColor:Es,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let td=r.renderedMesh.indices.length;Wt||(td=r.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ce),ft.castShadows=_,ft.receiveShadows=b,ft.renderState=Bn,ft.primitiveType=Be.TRIANGLES,ft.vertexArray=r.vertexArray||r.fill.vertexArray,ft.count=td,ft.uniformMap=di,ft.pass=ve.GLOBE,e._debug.wireframe&&(Hut(kt,e,t),u(r.wireframeVertexArray)&&(ft.vertexArray=r.wireframeVertexArray,ft.primitiveType=Be.LINES,ft.count=td*2));let ha=ft.boundingVolume,ov=ft.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Y.minimumHeight,Y.maximumHeight,ha),m.fromElements(ha.center.z,ha.center.x,ha.center.y,ha.center),n.mode===ne.MORPHING&&(ha=ae.union(Y.boundingSphere,ha,ha))):(ft.boundingVolume=ae.clone(Y.boundingSphere,ha),ft.orientedBoundingBox=Mn.clone(Y.boundingVolume,ov)),ft.dirty=!0,p&&d.updateDerivedCommands(ft,n),Vye(ft,n),Bn=gn,Ut=Wut}while(tt<nt)}var zN=io;function Wye(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(Wye.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){u(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var HN=Wye;function ys(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(ys.prototype,{length:{get:function(){return this._layers.length}}});ys.prototype.add=function(e,t){u(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ys.prototype.addImageryProvider=function(e,t){let n=new Gs(e);return this.add(n,t),n};ys.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ys.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};ys.prototype.contains=function(e){return this.indexOf(e)!==-1};ys.prototype.indexOf=function(e){return this._layers.indexOf(e)};ys.prototype.get=function(e){return this._layers[e]};function iH(e,t){return e.indexOf(t)}function jye(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}ys.prototype.raise=function(e){let t=iH(this._layers,e);jye(this,t,t+1)};ys.prototype.lower=function(e){let t=iH(this._layers,e);jye(this,t,t-1)};ys.prototype.raiseToTop=function(e){let t=iH(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};ys.prototype.lowerToBottom=function(e){let t=iH(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Xut=new ce;function qye(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!u(o)&&a<r.length;++a){let c=r[a];ce.contains(c.rectangle,t)&&(o=c)}if(!u(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],l=c.readyImagery;if(!u(l)||!l.imageryLayer.ready)continue;let f=l.imageryLayer.imageryProvider;if(n&&!u(f.pickFeatures)||!ce.contains(l.rectangle,t))continue;let d=Xut,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(l)}}ys.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!u(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];if(qye(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};ys.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!u(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];if(qye(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);u(c)&&(r.push(c),o.push(s.imageryLayer))}),r.length!==0)return Promise.all(r).then(function(s){let a=[];for(let c=0;c<s.length;++c){let l=s[c],f=o[c];if(u(l)&&l.length>0)for(let d=0;d<l.length;++d){let p=l[d];p.imageryLayer=f,u(p.position)||(p.position=i),a.push(p)}}return a})};ys.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ys.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ys.prototype.isDestroyed=function(){return!1};ys.prototype.destroy=function(){return this.removeAll(!0),ue(this)};ys.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(u(i._show)&&(u(n)||(n=[]),n.push(i)),i._show=i.show);if(u(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var GN=ys;function Yye(e){this._ellipsoid=new h_(e.ellipsoid,m.ZERO)}Object.defineProperties(Yye.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var WN=Yye;function $c(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=$n.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Hs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}$c.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),r=0;for(let o=0;o<n;++o)for(let s=0;s<t;++s)i[r++]=new $c({tilingScheme:e,x:s,y:o,level:0});return i};$c.prototype._updateCustomData=function(e,t,n){let i=this.customData,r,o,s;if(u(t)&&u(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,r=0;r<t.length;++r)o=t[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=e}else{let a=this._parent;if(u(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(r=0;r<c.length;++r)o=c[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=a._frameUpdated}}};Object.defineProperties($c.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return u(this._southwestChild)||(this._southwestChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return u(this._southeastChild)||(this._southeastChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return u(this._northwestChild)||(this._northwestChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return u(this._northeastChild)||(this._northeastChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Hs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return u(this.data)&&(e=this.data.eligibleForUnloading,u(e)||(e=!0)),e}}});$c.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(r){return r.x===t&&r.y===n})[0]};$c.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};$c.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};$c.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};$c.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};$c.prototype.freeResources=function(){this.state=Hs.START,this.renderable=!1,this.upsampledFromParent=!1,u(this.data)&&u(this.data.freeResources)&&this.data.freeResources(),rH(this._southwestChild),this._southwestChild=void 0,rH(this._southeastChild),this._southeastChild=void 0,rH(this._northwestChild),this._northwestChild=void 0,rH(this._northeastChild),this._northeastChild=void 0};function rH(e){u(e)&&e.freeResources()}var jN=$c;function oH(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}oH.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};oH.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&u(this._lastBeforeStartOfFrame)&&this.count>e&&u(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Xye(this,t)),t=i}};function Xye(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}oH.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!u(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(u(e.replacementPrevious)||u(e.replacementNext))&&Xye(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var qN=oH;function jf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new qN,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new WN({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(jf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});jf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Kut(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Jye(e);let n=e._levelZeroTiles;if(u(n))for(let i=0;i<n.length;++i){let o=n[i].customData,s=o.length;for(let a=0;a<s;++a){let c=o[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}jf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;u(t);)t.state!==Hs.START&&e(t),t=t.replacementNext};jf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};jf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let s=0;s<o;++s)if(r[s]===i){r.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};jf.prototype.update=function(e){u(this._tileProvider.update)&&this._tileProvider.update(e)};function Jye(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}jf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Kut(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Jye(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};jf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),$ut(this,e),lft(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Jut(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=_e.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}jf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(oft(this,e),cft(this,e),Jut(this,e))};jf.prototype.isDestroyed=function(){return!1};jf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var XN,Kye=new he;function Zut(e,t){let n=ce.center(e.rectangle,Kye),i=n.longitude-XN.longitude,r=n.latitude-XN.latitude;n=ce.center(t.rectangle,Kye);let o=n.longitude-XN.longitude,s=n.latitude-XN.latitude;return i*i+r*r-(o*o+s*s)}var Qut=new m,YN=[];function $ut(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r,o=e._tileProvider;if(!u(e._levelZeroTiles))if(o.ready){let A=o.tilingScheme;e._levelZeroTiles=jN.createLevelZeroTiles(A);let x=e._levelZeroTiles.length;if(YN.length<x)for(YN=new Array(x),r=0;r<x;++r)YN[r]===void 0&&(YN[r]=new KN)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;XN=t.camera.positionCartographic,a.sort(Zut);let l=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(l.length>0||f.length>0){for(r=0,p=a.length;r<p;++r)s=a[r],s._updateCustomData(d,l,f);l.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=N.getTranslation(g.transform,Qut);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),r=0,p=a.length;r<p;++r)s=a[r],e._tileReplacementQueue.markTileRendered(s),s.renderable?Oa(e,s,o,t,c,!1,YN[r]):(H_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function H_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function KN(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Zye(){this.southwest=new KN,this.southeast=new KN,this.northwest=new KN,this.northeast=new KN}Zye.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var mX=new Array(31);for(let e=0;e<mX.length;++e)mX[e]=new Zye;function eft(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=ift(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,l=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:$n.NONE,g=e.tileProvider;if(s||i){let h=$n.originalResult(p)===$n.RENDERED,A=$n.originalResult(p)===$n.CULLED||p===$n.NONE,x=n.state===Hs.DONE,C=h||A||x;if(C||u(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&H_(e,e._tileLoadQueueMedium,n,t),sH(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===$n.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&H_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&l.upsampledFromParent&&f.upsampledFromParent){sH(e,n),H_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===$n.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.REFINED;let A=e._tilesToRender.length,x=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,E=e._tileToUpdateHeights.length;if(tft(e,a,c,l,f,t,i,r),A!==e._tilesToRender.length){let S=r.allAreRenderable,w=r.anyWereRenderedLastFrame,D=r.notYetRenderableCount,M=!1;if(!S&&!w){let O=e._tilesToRender;for(let L=A;L<O.length;++L){let _=O[L];for(;_!==void 0&&_._lastSelectionResult!==$n.KICKED&&_!==n;)_._lastSelectionResult=$n.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=A,e._tileToUpdateHeights.length=E,sH(e,n),n._lastSelectionResult=$n.RENDERED;let B=p===$n.RENDERED;!B&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=T,H_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,M=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=B,B||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!M&&H_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,sH(e,n),H_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===$n.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function tft(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,l=e._tileProvider,f=e._occluders,d=mX[t.level],p=d.southwest,g=d.southeast,h=d.northwest,A=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Oa(e,t,l,o,f,s,p),Oa(e,n,l,o,f,s,g),Oa(e,i,l,o,f,s,h),Oa(e,r,l,o,f,s,A)):(Oa(e,i,l,o,f,s,h),Oa(e,t,l,o,f,s,p),Oa(e,r,l,o,f,s,A),Oa(e,n,l,o,f,s,g)):c.latitude<t.rectangle.north?(Oa(e,n,l,o,f,s,g),Oa(e,t,l,o,f,s,p),Oa(e,r,l,o,f,s,A),Oa(e,i,l,o,f,s,h)):(Oa(e,r,l,o,f,s,A),Oa(e,i,l,o,f,s,h),Oa(e,n,l,o,f,s,g),Oa(e,t,l,o,f,s,p)),d.combine(a)}function nft(e,t){let n=t.rectangle;return u(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||u(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Oa(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==fo.NONE)return eft(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,nft(e,t)){(!u(t.data)||!u(t.data.vertexArray))&&H_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:$n.NONE;c!==$n.CULLED_BUT_NEEDED&&c!==$n.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=$n.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(H_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=$n.CULLED):t._lastSelectionResult=$n.CULLED;t._lastSelectionResultFrame=i.frameNumber}function ift(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof tn||t.camera.frustum instanceof bo)return rft(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function rft(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;u(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=l/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function sH(e,t){e._tilesToRender.push(t)}function oft(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=Ai()+e._loadQueueTimeSlice,s=e._tileProvider,a=fX(e,t,s,o,n,!1);a=fX(e,t,s,o,i,a),fX(e,t,s,o,r,a)}function sft(e,t){return e._loadPriority-t._loadPriority}function fX(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(sft);for(let s=0,a=r.length;s<a&&(Ai()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var MS=new Dn,dX=new he,n0=new m,aft=[];function cft(e,t){if(!e.tileProvider.ready)return;let n=aft;n.length=0;let i=e._tileToUpdateHeights,r=Ai(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,l=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!u(d.data)||!u(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:$n.NONE;(A===$n.RENDERED||A===$n.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let A=p[f],x=d.data.terrainData,C=u(x)&&x.wasCreatedByUpsampling();if(d.level>A.level&&!C){if(u(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=m.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,l)),a===ne.SCENE3D){let E=l.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,MS.direction),S=l.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,MS.origin);if(!u(S)){let w=0;u(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(w,-11500),M=m.multiplyByScalar(E,Math.abs(D)+1,n0);m.subtract(A.positionOnEllipsoidSurface,M,MS.origin)}}else he.clone(A.positionCartographic,dX),dX.height=-11500,c.project(dX,n0),m.fromElements(n0.z,n0.x,n0.y,n0),m.clone(n0,MS.origin),m.clone(m.UNIT_X,MS.direction);let T=d.data.pick(MS,a,c,!1,n0);u(T)&&(u(A.callback)&&A.callback(T),A.level=d.level)}if(Ai()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function lft(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var JN=jf;function Em(e){e=y(e,re.WGS84);let t=new $x({ellipsoid:e}),n=new GN;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new FN,this._material=void 0,this._surface=new JN({tileProvider:new zN({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new HN,pX(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new we({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Em.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return u(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){u(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),u(this._material)&&pX(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,pX(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function pX(e){let t=[],n=u(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[z_,SS];u(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(LN),e._surfaceShaderSet.baseVertexShaderSource=new ke({sources:[z_,SS,NN],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ke({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function uft(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),r=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var fft=[],dft={start:0,stop:0};Em.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let r=t.mode,o=t.mapProjection,s=fft;s.length=0;let a=this._surface._tilesToRender,c=a.length,l,f;for(f=0;f<c;++f){l=a[f];let p=l.data;if(!u(p))continue;let g=p.pickBoundingSphere;if(r!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(l.rectangle,o,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(u(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=Qi.raySphere(e,g,dft);u(h)&&s.push(p)}s.sort(uft(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!u(d));++f);return d};var mft=new he;Em.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),u(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,mft);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var hft=new m,Qye=new m,pft=new he,_ft=new Dn;function hX(e,t){return u(e)&&ce.contains(e.rectangle,t)?e:void 0}Em.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!u(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;u(n);)n=hX(n._southwestChild,e)||hX(n._southeastChild,e)||hX(n._northwestChild,e)||n._northeastChild,u(n)&&u(n.data)&&u(n.data.renderedMesh)&&(o=n);if(n=o,!u(n)||!u(n.data)||!u(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,hft),l=_ft,f=a.geodeticSurfaceNormal(c,l.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,l.origin);if(!u(d)){let g;u(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),A=m.multiplyByScalar(f,Math.abs(h)+1,Qye);m.subtract(c,A,l.origin)}let p=n.data.pick(l,void 0,s,!1,Qye);if(u(p))return a.cartesianToCartographic(p,pft).height};Em.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Em.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=this.showWaterEffect&&u(i)&&i.hasWaterMask&&i._ready&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(u(c)){let l=this;a.fetchImage().then(function(f){c===l._oceanNormalMapResource.url&&(l._oceanNormalMap=l._oceanNormalMap&&l._oceanNormalMap.destroy(),l._oceanNormalMap=new Rt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Em.prototype.render=function(e){this.show&&(u(this._material)&&this._material.update(e.context),this._surface.render(e))};Em.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var ZN=Em;var jl=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var i0=`uniform highp sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function Nh(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new mi,this._tempCopyDepthFramebuffer=new mi,this._updateDepthFramebuffer=new mi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ye,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Nh.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function gft(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function $ye(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ye.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ye.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ye.clone(r.viewport,e._scissorRectangle),s=!0),(!u(e._rs)||!Ye.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Hn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.NEVER,reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})),u(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,u(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,u(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,u(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,u(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ri({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Nh.prototype.update=function(e,t,n,i,r,o){let s=n.width,a=n.height,c=r?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),$ye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o};Nh.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Nh.prototype.executeCopyDepth=function(e,t){u(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Nh.prototype.executeUpdateDepth=function(e,t,n,i){let r=u(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(u(this._updateDepthCommand)){if(!u(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,o,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,o,s),$ye(this,e,o,s,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}u(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Nh.prototype.executeCopyColor=function(e,t){u(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Nh.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;u(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){return gft(this),u(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),u(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),u(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),u(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var QN=Nh;function _C(){this._framebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new mi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ye,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(_C.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function yft(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Aft(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function xft(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ye.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ye.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ye.clone(r.viewport,e._scissorRectangle),s=!0),(!u(e._renderState)||!Ye.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),u(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(i0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),u(e._clearCommand)||(e._clearCommand=new ri({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}_C.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;Aft(this,n,r,o,e),xft(this,n,r,o,i),this._useHdr=e};_C.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};_C.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return yft(this),ue(this)};var $N=_C;var fa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},gC=fa.DERIVED_COMMANDS_MAXIMUM_LENGTH,l0e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function yC(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(gC),this._derivedBlendCommandTypes=new Array(gC),this._derivedPickCommandTypes=new Array(gC),this._derivedCommandTypesToUpdate=new Array(gC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(yC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});yC.prototype.update=function(e){let t=e.globe;if(!u(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=e0e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=e0e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=t0e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=t0e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=bft(this,e,t),this._sunVisibleThroughGlobe=Cft(this,e),this._environmentVisible=Tft(this,e),this._useDepthPlane=Eft(this,e),this._numberOfTextureUniforms=Sft(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),vft(this,e)};function e0e(e,t,n,i){return e?u(n)?(Bt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function t0e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Cft(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Tft(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Eft(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function bft(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function Sft(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function vft(e,t){e._derivedCommandsLength=_X(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=_X(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=_X(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<gC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!u(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=zft())}function _X(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,l=e._requiresManualDepthTest,f=i?fa.PICK_FRONT_FACE:l?fa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_FRONT_FACE,d=i?fa.PICK_BACK_FACE:l?fa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(r[o++]=fa.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=fa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=fa.DEPTH_ONLY_BACK_FACE),r[o++]=fa.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=fa.DEPTH_ONLY_FRONT_FACE),r[o++]=fa.OPAQUE_BACK_FACE,r[o++]=f),o)}function qf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function n0e(e,t){return e.indexOf(t)>-1}function wft(e,t){qf(e.defines,"TRANSLUCENT"),qf(t.defines,"TRANSLUCENT")}function Dft(e,t){qf(e.defines,"GROUND_ATMOSPHERE"),qf(t.defines,"GROUND_ATMOSPHERE"),qf(e.defines,"FOG"),qf(t.defines,"FOG"),qf(e.defines,"TRANSLUCENT"),qf(t.defines,"TRANSLUCENT")}function gX(e,t){if(n0e(t.defines,"TILE_LIMIT_RECTANGLE")||n0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function yX(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=ke.replaceMain(n[o],"czm_globe_translucency_main");let r=` - -uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; -#ifdef MANUAL_DEPTH_TEST - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - if (logDepthOrDepth != 0.0) - { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } - } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) - { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; - } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`;n.push(r)}function u0e(e,t){yX(e,t),qf(e.defines,"GROUND_ATMOSPHERE"),qf(t.defines,"GROUND_ATMOSPHERE"),qf(e.defines,"FOG"),qf(t.defines,"FOG")}function Ift(e,t){yX(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Pft(e,t){u0e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function i0e(e,t){let n=`uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; - vec4 pickColor = texture(u_classificationTexture, st); - if (pickColor == vec4(0.0)) - { - discard; - } - out_FragColor = pickColor; -} -`;t.sources=[n]}function Oft(e,t,n,i,r,o){if(!u(r))return t;if(!i&&u(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!u(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),l=t.fragmentShaderSource.clone();c.defines=u(c.defines)?c.defines.slice(0):[],l.defines=u(l.defines)?l.defines.slice(0):[],r(c,l),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:a})}return s}function Mft(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function Rft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function Bft(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Lft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Nft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function r0e(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function o0e(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function Fft(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Uft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Vft(e,t,n,i,r){if(!u(i))return e;if(!n&&u(t))return t;let o=r[e.id];if(!u(o)){let s=Ve.getState(e);i(s),o=Ve.fromCache(s),r[e.id]=o}return o}function RS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function kft(e,t,n,i,r){return u(r)?!i&&u(n)?n:_t(t,r(e),!1):t}function bm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function zft(){return[new bm({pass:ve.GLOBE,pickOnly:!1,getShaderProgramFunction:wft,getRenderStateFunction:Mft,getUniformMapFunction:void 0}),new bm({pass:ve.GLOBE,pickOnly:!1,getShaderProgramFunction:Dft,getRenderStateFunction:Rft,getUniformMapFunction:void 0}),new bm({pass:ve.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:Bft,getUniformMapFunction:void 0}),new bm({pass:ve.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:Lft,getUniformMapFunction:void 0}),new bm({pass:ve.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:Nft,getUniformMapFunction:void 0}),new bm({pass:ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:yX,getRenderStateFunction:r0e,getUniformMapFunction:RS}),new bm({pass:ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:u0e,getRenderStateFunction:o0e,getUniformMapFunction:RS}),new bm({pass:ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Ift,getRenderStateFunction:r0e,getUniformMapFunction:RS}),new bm({pass:ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Pft,getRenderStateFunction:o0e,getUniformMapFunction:RS}),new bm({pass:ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:i0e,getRenderStateFunction:Fft,getUniformMapFunction:RS}),new bm({pass:ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:i0e,getRenderStateFunction:Uft,getUniformMapFunction:RS})]}var s0e=new Array(gC),a0e=new Array(gC);yC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)a0e[r]=this._derivedCommandPacks[n[r]],s0e[r]=l0e[n[r]];Hft(this,e,i,n,s0e,a0e,t)}};function Hft(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!u(a)||c){t.dirty=!1,u(a)||(a={},t.derivedCommands.globeTranslucency=a);let l=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,A=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=l),h&&(a.shaderProgramDirtyFrame=l),A&&(a.renderStateDirtyFrame=l),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let C=o[x],T=i[x],E=r[x],S=a[E],w,D,M;u(S)?(w=S.uniformMap,D=S.shaderProgram,M=S.renderState):(w=void 0,D=void 0,M=void 0),S=et.shallowClone(t,S),a[E]=S;let O=y(S.derivedCommands.uniformMapDirtyFrame,0),B=y(S.derivedCommands.shaderProgramDirtyFrame,0),L=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||O<f,b=h||B<d,v=A||L<p;_&&(S.derivedCommands.uniformMapDirtyFrame=l),b&&(S.derivedCommands.shaderProgramDirtyFrame=l),v&&(S.derivedCommands.renderStateDirtyFrame=l),S.derivedCommands.type=T,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=kft(e,t.uniformMap,w,_,C.getUniformMapFunction),S.shaderProgram=Oft(s.context,t.shaderProgram,D,b,C.getShaderProgramFunction,E),S.renderState=Vft(t.renderState,M,v,C.getRenderStateFunction,C.renderStateCache)}}}yC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=l0e[r[a]];n.commandList.push(s[c])}};function f0e(e,t,n,i,r,o,s){for(let a=0;a<t;++a){let c=e[a],l=c.derivedCommands.type;(!u(s)||s.indexOf(l)>-1)&&n(c,i,r,o)}}function c0e(e,t,n,i,r,o){for(let s=0;s<t;++s)n(e[s],i,r,o)}var Gft=[fa.OPAQUE_FRONT_FACE,fa.OPAQUE_BACK_FACE],Wft=[fa.DEPTH_ONLY_FRONT_FACE,fa.DEPTH_ONLY_BACK_FACE,fa.DEPTH_ONLY_FRONT_AND_BACK_FACE];yC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[ve.GLOBE],a=e.indices[ve.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),f0e(s,a,t,i,o,r,Gft))};yC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[ve.GLOBE],a=e.indices[ve.GLOBE],c=e.commands[ve.TERRAIN_CLASSIFICATION],l=e.indices[ve.TERRAIN_CLASSIFICATION];if(a===0||l===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&c0e(c,l,t,i,o,r),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=o.uniformState.globeDepthTexture,g=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,f0e(s,a,t,i,o,r,Wft),o.depthTexture){let h=n.packDepth(o,r);o.uniformState.globeDepthTexture=h}c0e(c,l,t,i,o,r),o.uniformState.globeDepthTexture=p,r.framebuffer=g};var eF=yC;var d0e=Ki(Aq(),1);function AX(){this._image=new Image}AX.prototype.isReady=function(){return!0};AX.prototype.shouldDiscardImage=function(e){return e===this._image};function AC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Dt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,u(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new AX),this._errorEvent=new _e,this._ready=!1;let n=this,i,r;if(u(e.url)){$("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let o=we.createIfNeeded(e.url);r=new pm(o)}u(e.metadata)&&($("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),r=e.metadata),this._metadata=r,u(r)&&(this._readyPromise=r.readyPromise.then(function(o){if(!r.imageryPresent){let s=new de(`The server ${r.url} doesn't have imagery`);return i=xi.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return xi.reportSuccess(i),n._ready=o,o}).catch(function(o){return i=xi.reportError(i,n,n._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)}))}Object.defineProperties(AC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});AC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new AC(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};AC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(u(r)){let o=i.providers[r.imageryProvider];if(u(o))return[o]}};AC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=pm.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!u(a)){if(o.isValid(s)){let l=new qr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,l);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=jft(this,a,e,t,n,i).fetchArrayBuffer();if(u(c))return c.then(function(l){uL(o.key,l);let f=new Uint8Array(l),d,p=o.protoImagery;if((!u(p)||!p)&&(d=qft(f)),!u(d)&&(!u(p)||p)){let g=Yft(f);d=g.imageType,f=g.imageData}return!u(d)||!u(f)?r:bA({uint8Array:f,format:d,flipY:!0})})};AC.prototype.pickFeatures=function(e,t,n,i,r){};function jft(e,t,n,i,r,o){let s=pm.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=u(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function qft(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Yft(e){let t=d0e.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,u(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(u(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return u(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var xX=AC;var Xft=new z(1,1,1,.4),Kft=new z(0,1,0,.05),Jft=new z(0,.5,0,.2);function xC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=u(e.tilingScheme)?e.tilingScheme:new ji({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,Xft),this._glowColor=y(e.glowColor,Kft),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,Jft),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(xC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});xC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};xC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};xC.prototype.getTileCredits=function(e,t,n){};xC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};xC.prototype.pickFeatures=function(e,t,n,i,r){};var CX=xC;function TX(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,u(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(TX.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});TX.prototype.load=async function(){return this._data=await CC.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var tF=TX;function BS(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;u(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(BS.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return u(this._values)&&u(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Zft(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}BS.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let r=e._parseHeader(n),o=Zft(e._storageInfo.attributeValues.valueType);o>0&&(r=Math.ceil(r/o)*o),e._parseBody(n,r)}})};BS.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};BS.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};BS.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=this._storageInfo[i];if(u(r)){this._values[i]=[];for(let o=0;o<this._header.count;++o)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[o],a="";for(let c=0;c<s;++c){let l=this._parseValue(e,r.valueType,t);l.value.charCodeAt(0)!==0&&(a+=l.value),t=l.offset}this._values[i].push(a)}}}};var nF=BS;function iF(e,t){let n=e._dataProvider,i=e._layer,r;u(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(iF.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});iF.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Qft=new m,$ft=new m,edt=new m,tdt=new m,ndt=new m;function EX(e,t,n,i){let r=m.subtract(i,n,Qft),o=m.cross(r,m.subtract(e,n,$ft),tdt),s=m.cross(r,m.subtract(t,n,edt),ndt);return m.dot(o,s)>=0}var idt=new m,rdt=new m,odt=new m,sdt=new m,adt=new m,cdt=new m,ldt=new m,udt=new m,fdt=new m,ddt=new m;iF.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(u(this._customAttributes)&&u(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Q.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,l=this._customAttributes.positions,f=this._customAttributes.indices,d;u(f)?d=f.length:d=l.length/3;for(let p=0;p<d;p++){let g,h,A;u(f)?(g=f[p],h=f[p+1],A=f[p+2]):(g=p*3,h=p*3+1,A=p*3+2);let x=m.fromElements(l[g*3],l[g*3+1],l[g*3+2],idt),C=m.fromElements(l[h*3],l[h*3+1],l[h*3+2],rdt),T=new m(l[A*3],l[A*3+1],l[A*3+2],odt);if(!EX(i,x,C,T)||!EX(i,C,x,T)||!EX(i,T,x,C))continue;let E=m.subtract(C,x,sdt),S=m.subtract(T,x,adt),w=m.cross(E,S,cdt);if(m.magnitude(w)===0)continue;let D=m.normalize(w,ldt),M=m.subtract(i,x,udt),O=Math.abs(m.dot(M,D));if(O<r){r=O,o=p;let B=m.magnitudeSquared(m.subtract(i,x,M)),L=m.magnitudeSquared(m.subtract(i,C,fdt)),_=m.magnitudeSquared(m.subtract(i,T,ddt));B<L&&B<_?(a=g,c=x,s=B):L<_?(a=h,c=C,s=L):(a=A,c=T,s=_)}}if(u(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};iF.prototype._generateGltf=function(e,t,n,i,r,o){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,l="";if(u(this._parent._data.mesh)&&u(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[A],s=c,u(s.pbrMetallicRoughness)&&u(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(u(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let T=this._layer._data.textureSetDefinitions[C];for(let E=0;E<T.formats.length;E++){let S=T.formats[E];if(S.format==="jpg"){x=S.name;break}}}u(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(l=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${x}`}).url)}}else u(this._parent._data.textureData)&&(a=!0,l=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:l}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var LS=iF;function ql(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(ql.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});ql.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Tf(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!u(this._nodeIndex)){let r=await CC.loadJson(this._resource,this._dataProvider._traceFetches);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":u(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),u(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};ql.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(r,o){let s=new nF(t,r[o]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(u(e))for(let r=0;r<e.length;r++)i.push(n(e,r));return Promise.all(i)};ql.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!u(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};ql.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};ql.prototype._loadChildren=function(){let e=this;if(u(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(u(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new ql(e,y(i.href,i),!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};ql.prototype._loadGeometryData=function(){let e=[];if(u(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new LS(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(u(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new LS(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};ql.prototype._loadFeatureData=function(){let e=[];if(u(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new tF(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};ql.prototype._clearGeometryData=function(){this._geometryData=[]};ql.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!u(e)&&!u(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(u(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),u(this._dataProvider._geoidDataList)&&u(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let T=this._dataProvider._geoidDataList[C],E=T.projection.project(n);if(E.x>T.nativeExtent.west&&E.x<T.nativeExtent.east&&E.y>T.nativeExtent.south&&E.y<T.nativeExtent.north){n.height+=hdt(E.x,E.y,T);break}}let i={},r,o=0;u(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=re.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(u(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=o/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(u(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ha(0,0,0),l=Mt.headingPitchRollQuaternion(r,c);u(this._data.obb)&&(l=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Q.fromQuaternion(l),d=Q.inverse(f,new Q),p=new N(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=N.inverse(p,new N),h=N.clone(p);u(this._parent._globalTransform)&&N.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let A=[];for(let C=0;C<this._children.length;C++)A.push(this._children[C]._create3DTileDefinition());return{children:A,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:u(this._resource)?this._resource.url:void 0},geometricError:a}};ql.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,r=0,o=0,s=0;u(n.obb)?(r=n.obb.center[0],o=n.obb.center[1],s=n.obb.center[2]):u(n.mbs)&&(r=n.mbs[0],o=n.mbs[1],s=n.mbs[2]);let a=Q.fromRotationX(-P.PI_OVER_TWO),c=new Q;Q.multiply(a,i,c);let l=he.fromDegrees(r,o,s),f=re.WGS84.cartographicToCartesian(l),d={binaryData:t.geometryData._data,featureData:u(t.featureData)&&u(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:l,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};ql.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let r=Promise.resolve();if(u(i._geometryData)&&i._geometryData.length>0){let o={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,o);if(!u(s))return;r=s.then(function(a){e=o.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return r.then(function(){let o=i._dataProvider._binarizeGltf(e),s=new Blob([o],{type:"application/binary"});return URL.createObjectURL(s)})})};Tf.prototype._hookedRequestContent=Tf.prototype.requestContent;Tf.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!u(e)){this._isLoading=!1;return}return this._contentResource=new we({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function mdt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function aH(e,t,n,i){let r=e+t*n;return i[r]}function hdt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,l=a<n.height?a+1:a;a=n.height-1-a,l=n.height-1-l;let f=aH(s,a,n.width,n.buffer),d=aH(c,a,n.width,n.buffer),p=aH(s,l,n.width,n.buffer),g=aH(c,l,n.width,n.buffer),h=mdt(r,o,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(Tf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var NS=ql;function Yf(e,t,n){this._dataProvider=e,u(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),r="";i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new we({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Yf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(u(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Yf.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Yf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],u(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(u(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let l=0;l<c.length;l++)s.push(c[l])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Yf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(u(n))for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}return 0};Yf.prototype._loadRootNode=function(){if(u(this._data.nodePages)){let e=0;u(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new NS(this,e,!0)}else this._rootNode=new NS(this,this._data.store.rootNode,!0);return this._rootNode.load()};Yf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};Yf._fetchJson=function(e){return e.fetchJson()};Yf.prototype._loadNodePage=function(e){let t=this;if(!u(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Yf._fetchJson(n).then(function(r){return u(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Yf.prototype._computeExtent=function(){u(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):u(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Yf.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(u(this._dataProvider._cesium3dTilesetOptions))for(let r in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(r)&&(i[r]=this._dataProvider._cesium3dTilesetOptions[r]);this._tileset=await va.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){u(r._i3sNode)&&r._i3sNode._loadChildren()})};var r0=Yf;var h0e=Ki(m0e(),1);function rs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,u(e.url)&&($("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=we.createIfNeeded(e.url),this._load())}Object.defineProperties(rs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)u(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return $("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return $("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});rs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)u(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};rs.prototype.isDestroyed=function(){return!1};rs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)u(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};rs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)u(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};rs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)u(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};rs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)u(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};rs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=we.createIfNeeded(e),i=await rs.loadJson(n),r=new rs(t);if(r._resource=n,r._data=i,u(i.layers))for(let s=0;s<i.layers.length;s++){let a=new r0(r,i.layers[s],s);r._layers.push(a)}else{let s=new r0(r,i,i.id);r._layers.push(s)}r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load());return await Promise.all(o),r._ready=!0,r._readyPromise=Promise.resolve(r),r};rs.prototype._load=function(){let e=this;return this._readyPromise=rs.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,u(t.layers))for(let i=0;i<t.layers.length;i++){let r=new r0(e,t.layers[i],i);e._layers.push(r)}else{let i=new r0(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};rs._fetchJson=function(e){return e.fetchJson()};rs.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await rs._fetchJson(e);if(u(n.error)){if(console.error("Failed to fetch I3S ",e.url),u(n.error.message)&&console.error(n.error.message),u(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};rs.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};rs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]="g".charCodeAt(),r.magic[1]="l".charCodeAt(),r.magic[2]="T".charCodeAt(),r.magic[3]="F".charCodeAt(),r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};rs.prototype.getDecoderTaskProcessor=function(){if(u(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!u(this._decoderTaskProcessor)){let e=new _i("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function pdt(e,t){return gdt(e,t)}var _dt=new H;function gdt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),l=n.positionToTileXY(a,o);for(let d=c.x;d<=l.x;d++)for(let p=c.y;p<=l.y;p++){let g=H.fromElements(d,p,_dt),h=g.toString();if(!r.hasOwnProperty(h)){let A={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[h]=A,i.push(A)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},A=d[g],x="Geographic";n._projection instanceof Oi&&(x="WebMercator");let C={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:A._height,width:A._width,scale:A._structure.heightScale,offset:A._structure.heightOffset};if(A._encoding===Ff.LERC){let T=h0e.default.decode(A._buffer);C.buffer=T.pixels[0]}else C.buffer=A._buffer;p.push(C)}return p})}async function ydt(e){let t=e._geoidTiledTerrainProvider;if(!u(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await pdt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}rs.prototype.loadGeoidData=async function(){return u(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=ydt(this),this._geoidDataPromise)};rs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(u(this._layers[t]._extent)){let n=this._layers[t]._extent;u(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var CC=rs;function Fh(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new mi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new mi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ri({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ri({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Fh.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Fh.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Adt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Hn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},xdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},Cdt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ft.setCesium3DTileBit(),stencilMask:Ft.CESIUM_3D_TILE_MASK,blending:dn.ALPHA_BLEND},Tdt=`uniform sampler2D colorTexture; -uniform sampler2D depthTexture; -uniform sampler2D classifiedTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) - { - discard; - } - bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); -#ifdef UNCLASSIFIED - vec4 highlightColor = czm_invertClassificationColor; - if (isClassified) - { - discard; - } -#else - vec4 highlightColor = vec4(1.0); - if (!isClassified) - { - discard; - } -#endif - out_FragColor = color * highlightColor; - gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; -} -`,Edt=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) - { - discard; - } -#ifdef UNCLASSIFIED - out_FragColor = color * czm_invertClassificationColor; -#else - out_FragColor = color; -#endif -} -`;Fh.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!u(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),u(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Zl({context:e,width:s,height:a,format:bc.DEPTH24_STENCIL8,numSamples:t})))),!u(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let l,f;u(this._previousFramebuffer)?(l=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(l=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(l),u(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),u(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(l),this._fboClassified.update(e,s,a))}if(u(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(Adt),this._rsClassified=Ve.fromCache(xdt),this._rsDefault=Ve.fromCache(Cdt)),!u(this._unclassifiedCommand)||r||o){u(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let l=u(this._previousFramebuffer)?Edt:Tdt,f=new ke({defines:["UNCLASSIFIED"],sources:[l]}),d=new ke({sources:[l]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:u(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:u(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),u(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),u(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(jl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Fh.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Fh.prototype.clear=function(e,t){u(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Fh.prototype.executeClassified=function(e,t){if(!u(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Fh.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Fh.prototype.isDestroyed=function(){return!1};Fh.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),u(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var FS=Fh;function lH(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(lH.prototype,{total:{get:function(){return this._total}}});function o0(e){let t=new Array(Ta.NUMBER_OF_JOB_TYPES);t[Ta.TEXTURE]=new lH(u(e)?e[Ta.TEXTURE]:10),t[Ta.PROGRAM]=new lH(u(e)?e[Ta.PROGRAM]:10),t[Ta.BUFFER]=new lH(u(e)?e[Ta.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}o0.getTimestamp=Ai;Object.defineProperties(o0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});o0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};o0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};o0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,l;for(l=0;l<c&&(o=n[l],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++l);if(l===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=o0.getTimestamp();e.execute();let a=o0.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var rF=o0;var p0e=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function uH(e,t){this.spatialNode=e,this.keyframe=t,this.state=p0e.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}uH.priorityComparator=function(e,t){return e.priority-t.priority};uH.searchComparator=function(e,t){return e.keyframe-t.keyframe};uH.LoadState=p0e;var er=uH;function _0e(){}Object.defineProperties(_0e.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var bX=_0e;var bdt=/\/$/,g0e=new Dt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function US(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=we.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let r=y(e.tilesize,512);this._tilesize=r;let o=y(e.username,"mapbox");this._username=o;let s=u(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();bdt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;u(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Dt(c))):c=g0e,this._resource=i,this._imageryProvider=new zs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(US.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});US.prototype.getTileCredits=function(e,t,n){};US.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};US.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};US._defaultCredit=g0e;var SX=US;function s0(e,t,n,i,r){i===nn.UNSIGNED_SHORT&&(i=nn.FLOAT32);let o=e.floatingPointTexture;if(i===nn.FLOAT32&&!o)throw new de("Floating point texture not supported");let s;i===nn.FLOAT32||i===nn.FLOAT64?s=Ke.FLOAT:i===nn.UINT8&&(s=Ke.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?at.RED:at.LUMINANCE:n===2?a=e.webgl2?at.RG:at.LUMINANCE_ALPHA:n===3?a=at.RGB:n===4&&(a=at.RGBA);let c=512*1024*1024,l=128*1024*1024;r=Math.min(y(r,l),c);let f=Ht.maximumTextureSize,d=nn.getSizeInBytes(i),p=Math.floor(r/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),A=Math.ceil(t.z/h),x=h*t.x,C=A*t.y,T=Math.floor(g/x),E=Math.floor(g/C);if(T===0||E===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=T*E,this.regionCountPerMegatexture=new H(T,E),this.voxelCountPerRegion=new H(x,C),this.sliceCountPerRegion=new H(h,A),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(x/g,C/g),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})});let S=nn.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,x*C*n),this.nodes=new Array(this.maximumTileCount);for(let w=0;w<this.maximumTileCount;w++)this.nodes[w]=new Sdt(w);for(let w=0;w<this.maximumTileCount;w++){let D=this.nodes[w];D.previousNode=w>0?this.nodes[w-1]:void 0,D.nextNode=w<this.maximumTileCount-1?this.nodes[w+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Sdt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}s0.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,u(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,u(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};s0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];u(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),u(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,u(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};s0.prototype.isFull=function(){return this.emptyList===void 0};s0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===nn.UNSIGNED_SHORT&&(i=nn.FLOAT32);let r=nn.getSizeInBytes(i),o=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,l=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(o)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/l);if(p*g>=e)break;f*=2}return f*f*n*r};s0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,r=this.sliceCountPerRegion,o=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let A=0;A<i.z;A++){let x=A%r.x*i.x,C=Math.floor(A/r.x)*i.y;for(let T=0;T<i.y;T++)for(let E=0;E<i.x;E++){let S=A*i.y*i.x+T*i.x+E,w=(C+T)*o.x+(x+E);for(let D=0;D<s;D++)a[w*s+D]=n[S*s+D]}}let c=this.regionCountPerMegatexture,l=o.x,f=o.y,d=e%c.x*o.x,p=Math.floor(e/c.x)*o.y,h={source:{arrayBufferView:a,width:l,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};s0.prototype.isDestroyed=function(){return!1};s0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var VS=s0;function oF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;u(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,re.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new wN({radii:this.ellipsoid.radii,material:Wi.fromType(Wi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new AL}Object.defineProperties(oF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var fH=new Q,vdt=new Q,wdt=new m,dH=[];oF.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;u(Mt.computeIcrfToFixedMatrix(n,fH))||Mt.computeTemeToPseudoFixedMatrix(n,fH);let i=this._axes.evaluate(n,vdt);Q.transpose(i,i),Q.multiply(fH,i,i);let r=sg.computeMoonPositionInEarthInertialFrame(n,wdt);Q.multiplyByVector(fH,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=dH,dH.length=0,t.update(e),e.commandList=o,dH.length===1?dH[0]:void 0};oF.prototype.isDestroyed=function(){return!1};oF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var sF=oF;function vX(e){}vX.prototype.isReady=function(){return!0};vX.prototype.shouldDiscardImage=function(e){return!1};var wX=vX;var kS=`#ifdef MRT -layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1; -#else -layout (location = 0) out vec4 out_FragColor; -#endif - -uniform vec4 u_bgColor; -uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) - { -#ifdef MRT - out_FragData_0 = u_bgColor; - out_FragData_1 = vec4(u_bgColor.a); -#else - out_FragColor = u_bgColor; -#endif - return; - } - - discard; -} -`;var aF=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ - -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; - -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif - - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;function G_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new mi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new mi({createColorAttachments:!1}),this._opaqueClearCommand=new ri({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ri({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ri({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ri({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ye,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function y0e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function DX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function A0e(e){y0e(e),DX(e)}function Ddt(e,t,n,i){y0e(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:at.RGBA,pixelDatatype:Ke.FLOAT});let r=new Float32Array(n*i*4);e._revealageTexture=new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ke.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}function Idt(e,t){DX(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(DX(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,l=e._adjustAlphaFBO.status===n;(!s||!a||!c||!l)&&(A0e(e),e._translucentMultipassSupport=!1,i=!1)}return i}G_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!u(a)||a.width!==o||a.height!==s||i!==this._useHDR,l=this._numSamples!==r;if((c||l)&&(this._numSamples=r,Ddt(this,e,o,s)),(!u(this._translucentFBO.framebuffer)||c||l)&&!Idt(this,e))return;this._useHDR=i;let f=this,d,p;u(this._compositeCommand)||(d=new ke({sources:[aF]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),u(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new ke({defines:["MRT"],sources:[kS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new ke({sources:[kS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!Ye.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ye.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ye.clone(t.viewport,this._scissorRectangle),h=!0),(!u(this._rs)||!Ye.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),u(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),u(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Pdt={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.ONE,functionDestinationRgb:wr.ONE,functionSourceAlpha:wr.ZERO,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA},Odt={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.ONE,functionDestinationRgb:wr.ONE,functionSourceAlpha:wr.ONE,functionDestinationAlpha:wr.ONE},Mdt={enabled:!0,color:new z(0,0,0,0),equationRgb:ya.ADD,equationAlpha:ya.ADD,functionSourceRgb:wr.ZERO,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:wr.ZERO,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA};function IX(e,t,n,i){let r=n[i.id];if(!u(r)){let o=Ve.getState(i);o.depthMask=!1,o.blending=t,r=Ve.fromCache(o),n[i.id]=r}return r}function Rdt(e,t,n){return IX(t,Pdt,e._translucentRenderStateCache,n)}function Bdt(e,t,n){return IX(t,Odt,e._translucentRenderStateCache,n)}function Ldt(e,t,n){return IX(t,Mdt,e._alphaRenderStateCache,n)}var Ndt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragData_0 = vec4(Ci * wzi, ai); - out_FragData_1 = vec4(ai * wzi); -`,Fdt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragColor = vec4(Ci, ai) * wzi; -`,Udt=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function PX(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(u(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return ke.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; -bool czm_discard = false; -`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],l="";for(let f=0;f<c.length;f++){let d=c[f];l=`layout (location = ${d[1]}) out vec4 ${d[0]}; -${l}`}return a.sources.push(l),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; - } -${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Vdt(e,t){return PX(e,t,"translucentMRT",Ndt)}function kdt(e,t){return PX(e,t,"translucentMultipass",Fdt)}function zdt(e,t){return PX(e,t,"alphaMultipass",Udt)}G_.prototype.createDerivedCommands=function(e,t,n){if(u(n)||(n={}),this._translucentMRTSupport){let a,c;return u(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=et.shallowClone(e,n.translucentCommand),!u(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Vdt(t,e.shaderProgram),n.translucentCommand.renderState=Rdt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return u(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=et.shallowClone(e,n.translucentCommand),n.alphaCommand=et.shallowClone(e,n.alphaCommand),!u(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=kdt(t,e.shaderProgram),n.translucentCommand.renderState=Bdt(this,t,e.renderState),n.alphaCommand.shaderProgram=zdt(t,e.shaderProgram),n.alphaCommand.renderState=Ldt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function Hdt(e,t,n,i,r,o){let s,a,c,{context:l,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,A=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(l,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(l,i);let x=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,l,i,x);for(u(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,l,i,x)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,l,i,x);u(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,l,i,x)),i.framebuffer=h}function Gdt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:l}=a,f=t._hdr,d=i.framebuffer,p=l.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,A;for(let x=0;x<r.length;++x)h=r[x],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g);u(o)&&(h=o.unclassifiedCommand,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g)),i.framebuffer=d}G_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){Gdt(this,e,t,n,i,r);return}Hdt(this,e,t,n,i,r)};G_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};G_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};G_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};G_.prototype.isDestroyed=function(){return!1};G_.prototype.destroy=function(){return A0e(this),u(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),u(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),u(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var cF=G_;var Wdt=new Dt("MapQuest, Open Street Map and contributors, CC-BY-SA");function mH(e){e=y(e,y.EMPTY_OBJECT);let t=we.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new No({ellipsoid:e.ellipsoid}),i=256,r=256,o=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),o),l=n.positionToTileXY(ce.northeast(a),o),f=(Math.abs(l.x-c.x)+1)*(Math.abs(l.y-c.y)+1),d=y(e.credit,Wdt);typeof d=="string"&&(d=new Dt(d)),zs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}u(Object.create)&&(mH.prototype=Object.create(zs.prototype),mH.prototype.constructor=mH);var TC=mH;var jdt=new H(1,1);function OX(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,jdt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(OX.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var x0e=new m;OX.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,x0e),m.add(this.position,x0e,this.position),u(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var zS=OX;function C0e(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(C0e.prototype,{complete:{get:function(){return this._complete}}});var MX=C0e;function T0e(e){}T0e.prototype.emit=function(e){fe.throwInstantiationError()};var RX=T0e;var E0e=new H(1,1);function lF(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;u(t)||(t=new oN(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._emitterModelMatrix=N.clone(y(e.emitterModelMatrix,N.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new N,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,E0e))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,E0e))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(lF.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._modelMatrix,e),N.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._emitterModelMatrix,e),N.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function qdt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(u(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,l=e._particlePool,f=Math.max(a-c.length-l.length,0);for(let d=0;d<f;++d){let p=new zS;p._billboard=o.add({image:s,show:!1}),l.push(p)}e._particleEstimate=a}function Ydt(e){let t=e._particlePool.pop();return u(t)||(t=new zS),t}function Xdt(e,t){e._particlePool.push(t)}function Kdt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let l=n[c];i.remove(l._billboard)}n.length=a}function Jdt(e){u(e._billboard)&&(e._billboard.show=!1)}function b0e(e,t){let n=t._billboard;u(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function Zdt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Qdt(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),u(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;u(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var hH=new m;lF.prototype.update=function(e){if(!this.show)return;u(this._billboardCollection)||(this._billboardCollection=new lu),this._updateParticlePool&&(qdt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?b0e(this,s):(Jdt(s),Xdt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=Qdt(this,t);if(c>0&&u(i)){this._matrixDirty&&(this._combinedMatrix=N.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let l=this._combinedMatrix;for(o=0;o<c;o++)s=Ydt(this),this._emitter.emit(s),m.add(s.position,s.velocity,hH),N.multiplyByPoint(l,hH,hH),s.position=N.multiplyByPoint(l,s.position,s.position),m.subtract(hH,s.position,s.velocity),m.normalize(s.velocity,s.velocity),Zdt(this,s),b0e(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let l=this.bursts.length;for(o=0;o<l;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&Kdt(this)};lF.prototype.isDestroyed=function(){return!1};lF.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var BX=lF;function pH(e){e=y(e,y.EMPTY_OBJECT);let t=In(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ai(),this._lastMsSampleTime=Ai(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(pH.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});pH.prototype.update=function(e){let t=Ai(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};pH.prototype.destroy=function(){return ue(this)};var W_=pH;function EC(){this._framebuffer=new mi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(EC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function $dt(e,t,n){let i=n.width,r=n.height;e._framebuffer.update(t,i,r)}function emt(e,t,n){if(!u(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); -} -`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:Ve.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}EC.prototype.update=function(e,t){$dt(this,e,t),emt(this,e,t)};var tmt=new oe,nmt=new oe(1,1/255,1/65025,1/16581375);EC.prototype.getDepth=function(e,t,n){if(!u(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=oe.unpack(i,0,tmt);return oe.divideByScalar(r,255,r),oe.dot(r,nmt)};EC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};EC.prototype.isDestroyed=function(){return!1};EC.prototype.destroy=function(){return this._framebuffer.destroy(),u(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=u(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var uF=EC;function fF(){this._framebuffer=new mi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(fF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function imt(e){e._framebuffer.destroy()}function rmt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Wa(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Ye},r.viewport=new Ye,e._passState=r}fF.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&rmt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};fF.prototype.isDestroyed=function(){return!1};fF.prototype.destroy=function(){return imt(this),ue(this)};var dF=fF;function hF(e){let t=new Wa(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ye},t.viewport=new Ye,this._context=e,this._fb=new mi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hF.prototype.begin=function(e,t){let n=this._context,i=t.width,r=t.height;return Ye.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};var mF=new z;hF.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),s=o*o,a=Math.floor(t*.5),c=Math.floor(n*.5),l=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=l&&l<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+l+a);mF.red=z.byteToFloat(r[h]),mF.green=z.byteToFloat(r[h+1]),mF.blue=z.byteToFloat(r[h+2]),mF.alpha=z.byteToFloat(r[h+3]);let A=i.getObjectByPickColor(mF);if(u(A))return A}if(l===f||l<0&&-l===f||l>0&&l===1-f){let h=d;d=-p,p=h}l+=d,f+=p}};hF.prototype.isDestroyed=function(){return!1};hF.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var pF=hF;function j_(){this._numSamples=1,this._colorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ri({color:new z(0,0,0,0),depth:1,owner:this})}function omt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(j_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});j_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};j_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};j_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};j_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};j_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};j_.prototype.isDestroyed=function(){return!1};j_.prototype.destroy=function(){return omt(this),ue(this)};var bC=j_;function SC(){}SC.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};SC.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=ke.findPositionVarying(e),s=u(o);if(t&&!s){let a=r.length;for(let l=0;l<a;++l)r[l]=ke.replaceMain(r[l],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`;r.push(c)}return new ke({defines:i,sources:r})};SC.createShadowCastFragmentShader=function(e,t,n,i){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let s=ke.findPositionVarying(e),a=u(s);a||(s="v_positionEC");let c=o.length;for(let f=0;f<c;++f)o[f]=ke.replaceMain(o[f],"czm_shadow_cast_main");let l="";return t&&(a||(l+=`in vec3 v_positionEC; -`),l+=`uniform vec4 shadowMap_lightPositionEC; -`),i?l+=`void main() -{ -`:l+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?l+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?l+=` out_FragColor = vec4(1.0); -`:l+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,l+=`} -`,o.push(l),new ke({defines:r,sources:o})};SC.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,l=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${l}${f}${t}${n}${i}`};SC.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new ke({defines:i,sources:r})};SC.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=ke.findNormalVarying(e),s=!i&&u(o)||i&&r,a=ke.findPositionVarying(e),c=u(a),l=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,A=t.softShadows,x=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),T=e.sources.slice(0),E=T.length;for(let D=0;D<E;++D)T[D]=ke.replaceMain(T[D],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):l&&C.push("USE_SHADOW_DEPTH_TEXTURE"),A&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; -`:S+=`uniform sampler2D shadowMap_texture; -`;let w;return c?w=` return vec4(${a}, 1.0); -`:w=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,S+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${w}} -vec3 getNormalEC() -{ -${s?` return normalize(${o}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${x.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,S+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,S+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; - float distance = length(directionEC); - directionEC = normalize(directionEC); - float radius = shadowMap_lightPositionEC.w; - // Stop early if the fragment is beyond the point light radius - if (distance > radius) - { - return; - } - vec3 directionWC = czm_inverseViewRotation * directionEC; - shadowParameters.depth = distance / radius; - shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - shadowParameters.texCoords = directionWC; - float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); -`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${h?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,S+=` out_FragColor.rgb *= visibility; -} -`,T.push(S),new ke({defines:C,sources:T})};var Uh=SC;function Vh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Gt.isInternetExplorer()||Gt.isEdge()||(Gt.isChrome()||Gt.isFirefox())&&Gt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new N,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new _H,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new bo:u(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new N,new N,new N,new N],this._cascadeDistances=new oe;let r;this._isPointLight?r=6:this._cascadesEnabled?r=this._numberOfCascades:r=1,this._passes=new Array(r);for(let o=0;o<r;++o)this._passes[o]=new smt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,NX(this),this._clearCommand=new ri({depth:1,color:new z}),this._clearPassState=new Wa(t),this._size=y(e.size,2048),this.size=this._size}Vh.MAXIMUM_DISTANCE=2e4;function smt(e){this.camera=new _H,this.passState=new Wa(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function LX(e,t){return Ve.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function NX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=LX(t,e._primitiveBias),e._terrainRenderState=LX(t,e._terrainBias),e._pointRenderState=LX(t,e._pointBias)}Vh.prototype.debugCreateRenderStates=function(){NX(this)};Object.defineProperties(Vh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){dmt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function FX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;u(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function amt(e,t){let n=new Zl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:bc.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:fn.NEAREST}),r=new Ys({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function cmt(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:fn.NEAREST}),i=new Ys({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function lmt(e,t){let n=new Zl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:bc.DEPTH_COMPONENT16}),i=new Ga({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:fn.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new Ys({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function w0e(e,t){e._isPointLight?lmt(e,t):e._usesDepthTexture?cmt(e,t):amt(e,t)}function umt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,NX(e),FX(e),w0e(e,t))}function fmt(e,t){(!u(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(FX(e),w0e(e,t),umt(e,t),D0e(e,t))}function D0e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function dmt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ht.maximumCubeMapSize>=t?t:Ht.maximumCubeMapSize,r.x=t,r.y=t;let o=new Ye(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ht.maximumTextureSize>=t?t:Ht.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Ye(0,0,t,t)):i===4&&(t=Ht.maximumTextureSize>=t*2?t:Ht.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new Ye(0,0,t,t),n[1].passState.viewport=new Ye(t,0,t,t),n[2].passState.viewport=new Ye(0,t,t,t),n[3].passState.viewport=new Ye(t,t,t,t));e._clearPassState.viewport=new Ye(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,l=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new N(f,0,0,c,0,d,0,l,0,0,1,0,0,0,0,1)}}var mmt=new Ye;function hmt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; -in vec2 v_textureCoordinates; -void main() -{ - vec2 uv = v_textureCoordinates; - vec3 dir; - - if (uv.y < 0.5) - { - if (uv.x < 0.333) - { - dir.x = -1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 1.0; - } - else if (uv.x < 0.666) - { - dir.y = -1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 1.0; - } - else - { - dir.z = -1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 1.0; - } - } - else - { - if (uv.x < 0.333) - { - dir.x = 1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 3.0; - } - else if (uv.x < 0.666) - { - dir.y = 1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 3.0; - } - else - { - dir.z = 1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 3.0; - } - } - - float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); - out_FragColor = vec4(vec3(shadow), 1.0); -} -`:n=`uniform sampler2D shadowMap_texture; -in vec2 v_textureCoordinates; -void main() -{ -${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; -`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); -`} out_FragColor = vec4(vec3(shadow), 1.0); -} -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=ve.OVERLAY,i}function pmt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=mmt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;u(a)||(a=hmt(e,n),e._debugShadowViewCommand=a),(!u(a.renderState)||!Ye.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:Ye.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var kh=new Array(8);kh[0]=new oe(-1,-1,-1,1);kh[1]=new oe(1,-1,-1,1);kh[2]=new oe(1,1,-1,1);kh[3]=new oe(-1,1,-1,1);kh[4]=new oe(-1,-1,1,1);kh[5]=new oe(1,-1,1,1);kh[6]=new oe(1,1,1,1);kh[7]=new oe(-1,1,1,1);var a0=new N,UX=new Array(8);for(let e=0;e<8;++e)UX[e]=new oe;function _mt(e,t){let n=new Ct({geometry:new ld({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:zt.fromColor(t)}}),i=new Ct({geometry:new r_({radius:.5}),attributes:{color:zt.fromColor(t)}});return new Sn({geometryInstances:[n,i],appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var gmt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],ymt=new m;function Amt(e,t){pmt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Bh({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Bh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Bh({camera:e._passes[i].camera,color:gmt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!u(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=m.fromElements(o,o,o,ymt),a=N.fromTranslationQuaternionRotationScale(i,r,s,a0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=_mt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!u(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Bh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function _H(){this.viewMatrix=new N,this.inverseViewMatrix=new N,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new N}_H.prototype.clone=function(e){N.clone(e.viewMatrix,this.viewMatrix),N.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var xmt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_H.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(xmt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Cmt=new Array(5),Tmt=new wi,Emt=new Array(4),I0e=new m,P0e=new m;function bmt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,l=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=Emt,g=Cmt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(l,L),b=r+c*L,v=P.lerp(b,_,f);g[a+1]=v,p[a]=v-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let h=n.frustum,A=h.left,x=h.right,C=h.bottom,T=h.top,E=h.near,S=h.far,w=n.positionWC,D=n.directionWC,M=n.upWC,O=i.frustum.clone(Tmt),B=n.getViewProjection();for(a=0;a<s;++a){O.near=g[a],O.far=g[a+1];let L=N.multiply(O.projectionMatrix,i.viewMatrix,a0),_=N.inverse(L,a0),b=N.multiply(B,_,a0),v=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,I0e),I=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,P0e);for(let G=0;G<8;++G){let U=oe.clone(kh[G],UX[G]);N.multiplyByVector(b,U,U),m.divideByScalar(U,U.w,U),m.minimumByComponent(U,v,v),m.maximumByComponent(U,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let R=e._passes[a],F=R.camera;F.clone(n);let k=F.frustum;k.left=A+v.x*(x-A),k.right=A+I.x*(x-A),k.bottom=C+v.y*(T-C),k.top=C+I.y*(T-C),k.near=E+v.z*(S-E),k.far=E+I.z*(S-E),R.cullingVolume=F.frustum.computeCullingVolume(w,D,M);let V=e._cascadeMatrices[a];N.multiply(F.getViewProjection(),i.inverseViewMatrix,V),N.multiply(R.textureOffsets,V,V)}}var Smt=new N,vmt=new m,wmt=new m,S0e=new m;function Dmt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,a0),o=N.inverse(r,a0),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,vmt);a=m.cross(c,s,wmt),m.normalize(a,a),m.normalize(c,c);let l=m.fromElements(0,0,0,S0e),f=N.computeView(l,s,a,c,Smt),d=N.multiply(f,o,a0),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,I0e),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,P0e);for(let S=0;S<8;++S){let w=oe.clone(kh[S],UX[S]);N.multiplyByVector(d,w,w),m.divideByScalar(w,w.w,w),m.minimumByComponent(w,p,p),m.maximumByComponent(w,g,g)}g.z+=1e3,p.z-=10;let h=S0e;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let A=N.fromTranslation(h,a0);f=N.multiply(A,f,f);let x=.5*(g.x-p.x),C=.5*(g.y-p.y),T=g.z-p.z,E=n.frustum;E.left=-x,E.right=x,E.bottom=-C,E.top=C,E.near=.01,E.far=T,N.clone(f,n.viewMatrix),N.inverse(f,n.inverseViewMatrix),N.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var Imt=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],Pmt=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],Omt=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Mmt(e,t){let n=new wi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=Imt[i],r.upWC=Pmt[i],r.rightWC=Omt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var Rmt=new m,Bmt=new m,O0e=new ae,v0e=O0e.center;function Lmt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=O0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Rmt),s=m.negate(i.directionWC,Bmt),a=m.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,o,v0e),v0e);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere)}}function Nmt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,o.directionWC):e._isPointLight?m.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;N.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),m.normalize(s,s),m.negate(s,s),N.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=dr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Lmt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Vh.prototype.update=function(e){if(Nmt(this,e),this._needsUpdate)if(fmt(this,e.context),this._isPointLight&&Mmt(this,e),this._cascadesEnabled&&(Dmt(this,e),this._numberOfCascades>1&&bmt(this,e)),this._isPointLight)this._shadowMapCullingVolume=es.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;N.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Amt(this,e)};Vh.prototype.updatePass=function(e,t){D0e(this,e,t)};var Fmt=new H;function M0e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=Fmt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,oe.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return _t(t,r,!1)}function Umt(e,t,n,i,r,o){let s,a,c;if(u(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=et.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!u(s)||r!==n.shaderProgram.id||t){let l=n.shaderProgram,f=n.pass===ve.GLOBE,d=n.pass!==ve.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Uh.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(l,h),!u(s)){let x=l.vertexShaderSource,C=l.fragmentShaderSource,T=Uh.createShadowCastVertexShader(x,p,f),E=Uh.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(l,h,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:l._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=We(a,!1),a.cull=We(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=M0e(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}Vh.createReceiveDerivedCommand=function(e,t,n,i,r){u(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,l=t.pass===ve.GLOBE,f=!1;if(l&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;u(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=et.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,h=r.receiveShaderProgramId!==t.shaderProgram.id;if(!u(d)||h||n||g){let A=Uh.getShadowReceiveShaderKeyword(e[0],t.castShadows,l,f);if(d=i.shaderCache.getDerivedShaderProgram(s,A),!u(d)){let x=Uh.createShadowReceiveVertexShader(a,l,f),C=Uh.createShadowReceiveFragmentShader(c,e[0],t.castShadows,l,f);d=i.shaderCache.createDerivedShaderProgram(s,A,{vertexShaderSource:x,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=M0e(e[0],t.uniformMap,l)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};Vh.createCastDerivedCommand=function(e,t,n,i,r){if(u(r)||(r={}),t.castShadows){let o=r.castCommands;u(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=Umt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};Vh.prototype.isDestroyed=function(){return!1};Vh.prototype.destroy=function(){FX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var q_=Vh;var _F=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); -} -`;var vC=`uniform sampler2D colorTexture; - -#ifdef DEBUG_SHOW_DEPTH -uniform sampler2D u_packedTranslucentDepth; -#endif - -in vec2 v_textureCoordinates; - -void main() -{ -#ifdef DEBUG_SHOW_DEPTH - if (v_textureCoordinates.x < 0.5) - { - out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); - out_FragColor.a = 1.0; - } -#else - vec4 color = texture(colorTexture, v_textureCoordinates); - -#ifdef PICK - if (color == vec4(0.0)) - { - discard; - } -#else - // Reverse premultiplication process to get the correct composited result of the classification primitives - color.rgb /= color.a; -#endif - out_FragColor = color; -#endif -} -`;var Vmt=!1;function c0(e){this._drawClassificationFBO=new mi({createDepthAttachments:!1}),this._accumulationFBO=new mi({createDepthAttachments:!1}),this._packFBO=new mi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ri({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ri({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ye,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(c0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function R0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function B0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function kmt(e,t,n,i){R0e(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:fn.NEAREST})}function zmt(e,t,n,i){B0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Hmt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(kmt(e,t,r,o),zmt(e,t,r,o));let s,a;if(u(e._packDepthCommand)||(s=new ke({sources:[_F]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!u(e._compositeCommand)){s=new ke({sources:[vC]}),a={colorTexture:function(){return e._textureToComposite}},Vmt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new ke({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=et.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}u(e._copyCommand)||(s=new ke({sources:[vC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),u(e._accumulateCommand)||(s=new ke({sources:[vC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!Ye.equals(e._viewport,n.viewport),l=c!==e._useScissorTest;e._useScissorTest=c,Ye.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ye.clone(n.viewport,e._scissorRectangle),l=!0),(!u(e._rsDepth)||!Ye.equals(e._viewport,e._rsDepth.viewport)||l)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),u(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!u(e._rsAccumulate)||!Ye.equals(e._viewport,e._rsAccumulate.viewport)||l)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Hn.EQUAL,reference:Ft.CESIUM_3D_TILE_MASK}})),u(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!u(e._rsComp)||!Ye.equals(e._viewport,e._rsComp.viewport)||l)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND})),u(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}c0.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=i.length,s,a,c=e.frameState.useLogDepth,l=e.context,f=n.framebuffer;for(a=0;a<o;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(Hmt(this,l,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(l,n),a=0;a<o;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,l,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(l,n)),n.framebuffer=f}};c0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(ve.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[ve.CESIUM_3D_TILE_CLASSIFICATION],l=i.indices[ve.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<l;++f)t(c[f],e,r,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};c0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Gmt(this,e,t)};function Gmt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}c0.prototype.isSupported=function(){return this._supported};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){return R0e(this),B0e(this),u(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),u(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var gF=c0;function Wmt(){this.command=void 0,this.near=void 0,this.far=void 0}function gH(e,t,n){let i=e.context,r;i.depthTexture&&(r=new QN);let o;e._useOIT&&i.depthTexture&&(o=new cF(i));let s=new Wa(i);s.viewport=Ye.clone(n),this.camera=t,this._cameraClone=dr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new pF(i),this.pickDepthFramebuffer=new dF,this.sceneFramebuffer=new bC,this.globeDepth=r,this.globeTranslucencyFramebuffer=new $N,this.oit=o,this.translucentTileClassification=new gF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var L0e=new m,N0e=new m;function jmt(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}function qmt(e,t,n){let i=1/Math.max(1,jmt(e.position,t.position));return m.multiplyByScalar(e.position,i,L0e),m.multiplyByScalar(t.position,i,N0e),m.equalsEpsilon(L0e,N0e,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&N.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}gH.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return qmt(t,n,P.EPSILON15)?(this._cameraStartFired&&Ai()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ai(),dr.clone(t,n),!0)};function Ymt(e,t,n,i){let r=t.frameState,o=r.camera,s=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),isNaN(n)&&(n=o.frustum.near),isNaN(i)&&(i=o.frustum.far);let l;a?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),l=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):l=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=l;for(let d=0;d<l;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];u(h)?(h.near=p,h.far=g):h=f[d]=new RN(p,g)}}function Xmt(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let o=e.frustumCommandsList,s=o.length;for(let a=0;a<s;++a){let c=o[a],l=c.near,f=c.far;if(i>f)continue;if(r<l)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=u(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var F0e=new es,Kmt=new vc;gH.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,l=c.length,f=ve.NUMBER_OF_PASSES;for(let b=0;b<l;++b)for(let v=0;v<f;++v)c[b].indices[v]=0;o.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,A=-Number.MAX_VALUE,x=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,T=-Number.MAX_VALUE,E=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,w=t.cullingVolume,D=F0e.planes;for(let b=0;b<5;++b)D[b]=w.planes[b];w=F0e;let M=a.length;for(let b=0;b<M;++b){let v=a[b],I=v.pass;if(I===ve.COMPUTE)o.push(v);else if(I===ve.OVERLAY)s.push(v);else{let R,F,k=v.boundingVolume;if(u(k)){if(!e.isVisible(v,w,S))continue;let G=k.computePlaneDistances(r,i,Kmt);if(R=G.start,F=G.stop,h=Math.min(h,R),A=Math.max(A,F),x&&v.receiveShadows&&R<q_.MAXIMUM_DISTANCE&&!(I===ve.GLOBE&&R<-100&&F>100)){let U=F-R;I!==ve.GLOBE&&R<100&&(E=Math.min(E,U)),C=Math.min(C,R),T=Math.max(T,F)}}else v instanceof ri?(R=n.frustum.near,F=n.frustum.far):(R=n.frustum.near,F=n.frustum.far,h=Math.min(h,R),A=Math.max(A,F));let V=d[g];u(V)||(V=d[g]=new Wmt),V.command=v,V.near=R,V.far=F,g++}}x&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),T=Math.max(Math.min(T,n.frustum.far),C)),x&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=T,t.shadowState.closestObjectSize=E),Ymt(this,e,h,A);let O,B;for(O=0;O<g;O++)B=d[O],Xmt(this,e,B.command,B.near,B.far);if(g<p)for(O=g;O<p&&(B=d[O],!!u(B.command));O++)B.command=void 0;let L=c.length,_=t.frustumSplits;_.length=L+1;for(let b=0;b<L;++b)_[b]=c[b].near,b===L-1&&(_[b+1]=c[b].far)};gH.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var wC=gH;var V0e=.1,Jmt=new Hf({pass:Nr.MOST_DETAILED_PRELOAD}),Zmt=new Hf({pass:Nr.MOST_DETAILED_PICK}),VX=new Hf({pass:Nr.PICK});function Ma(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ye(0,0,1,1),n=new dr(e);n.frustum=new tn({width:V0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new wC(e,n,t)}Ma.prototype.update=function(){this._pickPositionCacheDirty=!0};Ma.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return u(i)||(i=new uF,n[t]=i),i};var Qmt=new bo,$mt=new m,yH=new m,eht=new H,tht=new N;function nht(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;u(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let l=2*(r.height-t.y-r.y)/r.height-1;l*=(s.top-s.bottom)*.5;let f=N.clone(o.transform,tht);o._setTransform(N.IDENTITY);let d=m.clone(o.position,$mt);m.multiplyByScalar(o.right,c,yH),m.add(yH,d,d),m.multiplyByScalar(o.up,l,yH),m.add(yH,d,d),o._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,eht),g=Qmt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var iht=new Zc,rht=new H;function oht(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),l=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*l,g=d*a*c,h=s.getPixelDimensions(r.width,r.height,1,1,rht),A=h.x*n*.5,x=h.y*i*.5,C=iht;return C.top=g+x,C.bottom=g-x,C.right=p+A,C.left=p-A,C.near=a,C.far=s.far,C.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function k0e(e,t,n,i,r){let o=e.camera.frustum;return o instanceof tn||o instanceof bo?nht(e,t,n,i,r):oht(e,t,n,i,r)}var HS=3,yF=3,zh=new Ye(0,0,HS,yF),z0e=new H,kX=new z(0,0,0,0);Ma.prototype.pick=function(e,t,n,i){HS=y(n,3),yF=y(i,HS);let r=e.context,o=r.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let l=a.passState;l.viewport=Ye.clone(c,l.viewport);let f=$i.transformWindowToDrawingBuffer(e,t,z0e);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=k0e(e,f,HS,yF,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=VX,o.update(s),e.updateEnvironment(),zh.x=f.x-(HS-1)*.5,zh.y=e.drawingBufferHeight-f.y-(yF-1)*.5,zh.width=HS,zh.height=yF,l=a.pickFramebuffer.begin(zh,a.viewport),e.updateAndExecuteCommands(l,kX),e.resolveFramebuffers(l);let d=a.pickFramebuffer.end(zh);return r.endFrame(),d};function sht(e,t){let n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=o.passState;a.viewport=Ye.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=k0e(e,t,1,1,s),i.tilesetPassState=VX,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,a=o.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,kX),e.resolveFramebuffers(a),n.endFrame()}var aht=new wi,cht=new Zc,lht=new tn,uht=new bo;Ma.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let r=e.frameState,o=e.context,s=o.uniformState,a=e.defaultView;e.view=a;let c=$i.transformWindowToDrawingBuffer(e,t,z0e);e.pickTranslucentDepth?sht(e,c):(e.updateFrameState(),s.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let l=e.camera,f;u(l.frustum.fov)?f=l.frustum.clone(aht):u(l.frustum.infiniteProjectionMatrix)?f=l.frustum.clone(cht):u(l.frustum.width)?f=l.frustum.clone(lht):f=l.frustum.clone(uht);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let A=this.getPickDepth(e,g).getDepth(o,c.x,c.y);if(u(A)&&A>0&&A<1){let x=d[g],C;return e.mode===ne.SCENE2D?(C=l.position.z,l.position.z=C-x.near+1,f.far=Math.max(1,x.far-x.near),f.near=1,s.update(r),s.updateFrustum(f)):(f.near=x.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=x.far,s.updateFrustum(f)),n=$i.drawingBufferToWgs84Coordinates(e,c,A,n),e.mode===ne.SCENE2D&&(l.position.z=C,s.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var fht=new he;Ma.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),u(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,fht);r.cartographicToCartesian(o,n)}return n};function H0e(e,t){let n,i,r=[],o=[],s=[],a=[];u(e)||(e=Number.MAX_VALUE);let c=t();for(;u(c);){let l=c.object,f=c.position,d=c.exclude;if(u(f)&&!u(l)){r.push(c);break}if(!u(l)||!u(l.primitive)||!d&&(r.push(c),0>=--e))break;let p=l.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&u(l.id)&&(i=p.getGeometryInstanceAttributes(l.id),u(i)&&u(i.show)&&(g=!0,i.show=An.toValue(!1,i.show),s.push(i))),l instanceof Is&&(g=!0,l.show=!1,a.push(l)),g||(p.show=!1,o.push(p)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=An.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return r}Ma.prototype.drillPick=function(e,t,n,i,r){let o=this;return H0e(n,function(){let c=o.pick(e,t,i,r);if(u(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var U0e=new m,dht=new m;function mht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function G0e(e,t,n,i){let r=t.direction,o=m.mostOrthogonalAxis(r,U0e),s=m.cross(r,o,U0e),a=m.cross(r,s,dht);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=y(n,V0e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function hht(e,t,n){let i=t.frameState,r=n.ray,o=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=G0e(e,r,o,a),l=Jmt;l.camera=a,l.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,l),f=f&&l.ready)}return f&&n._completePick(),f}Ma.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)hht(this,e,t[n])&&t.splice(n--,1)};function W0e(e,t,n){let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);o.show&&(u(o.isCesium3DTileset)?(!u(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Il&&W0e(o,t,n))}}function AH(e,t,n,i,r,o){let s=[];if(W0e(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new mht(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function pht(e,t){return!u(e)||!u(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function _ht(e,t,n,i,r,o,s){let a=t.context,c=a.uniformState,l=t.frameState,f=e._pickOffscreenView;t.view=f,G0e(e,n,r,f.camera),zh=Ye.clone(f.viewport,zh);let d=f.pickFramebuffer.begin(zh,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=Zmt:l.tilesetPassState=VX,c.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(d,kX),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(zh);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let A=0;A<h;++A){let C=e.getPickDepth(t,A).getDepth(a,0,0);if(u(C)&&C>0&&C<1){let T=f.frustumCommandsList[A],E=T.near*(A!==0?t.opaqueFrustumNearOffset:1),S=T.far,w=E+C*(S-E);p=Dn.getPoint(n,w);break}}}if(t.view=t.defaultView,a.endFrame(),u(g)||u(p))return{object:g,position:p,exclude:!u(p)&&o||pht(g,i)}}function j0e(e,t,n,i,r,o,s,a){return H0e(i,function(){return _ht(e,t,n,r,o,s,a)})}function GS(e,t,n,i,r,o,s){let a=j0e(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function q0e(e,t,n,i,r,o,s,a){return j0e(e,t,n,i,r,o,s,a)}function xH(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Ma.prototype.pickFromRay=function(e,t,n,i){return GS(this,e,t,n,i,!1,!1)};Ma.prototype.drillPickFromRay=function(e,t,n,i,r){return q0e(this,e,t,n,i,r,!1,!1)};Ma.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=Dn.clone(t),n=u(n)?n.slice():n,xH(e,AH(r,e,t,n,i,function(){return GS(r,e,t,n,i,!1,!0)}))};Ma.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=Dn.clone(t),i=u(i)?i.slice():i,xH(e,AH(o,e,t,i,r,function(){return q0e(o,e,t,n,i,r,!1,!0)}))};var ght=new m,yht=new m,Aht=new Dn,Y0e=new he;function zX(e,t){let n=e.globe,i=u(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=si._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,yht),s=he.toCartesian(t,i,ght),a=Aht;a.origin=s,a.direction=o;let c=new Dn;return Dn.getPoint(a,r,c.origin),m.negate(o,c.direction),c}function X0e(e,t){let n=e.globe,i=u(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=he.fromCartesian(t,i,Y0e);return zX(e,r)}function K0e(e,t){let n=e.globe,i=u(n)?n.ellipsoid:e.mapProjection.ellipsoid;return he.fromCartesian(t,i,Y0e).height}function xht(e,t,n,i,r){let o=zX(t,n);return AH(e,t,o,i,r,function(){let s=GS(e,t,o,i,r,!0,!0);if(u(s))return K0e(t,s.position)})}function Cht(e,t,n,i,r,o){let s=X0e(t,n);return AH(e,t,s,i,r,function(){let a=GS(e,t,s,i,r,!0,!0);if(u(a))return m.clone(a.position,o)})}Ma.prototype.sampleHeight=function(e,t,n,i){let r=zX(e,t),o=GS(this,e,r,n,i,!0,!1);if(u(o))return K0e(e,o.position)};Ma.prototype.clampToHeight=function(e,t,n,i,r){let o=X0e(e,t),s=GS(this,e,o,n,i,!0,!1);if(u(s))return m.clone(s.position,r)};Ma.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=u(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=xht(this,e,t[s],n,i);return xH(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ma.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=u(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=Cht(this,e,t[s],n,i,t[s]);return xH(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ma.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var AF=Ma;var Q0e=Ki(y3(),1);var Tht={modifyFragmentShader:function(t){return t=ke.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},WS=Tht;var DC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function xF(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=DC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,ve.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,zc.NONE),this._splittingEnabled=!1,this._error=void 0,Eht(this,e)}Object.defineProperties(xF.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(u(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function Eht(e,t){let n=GA.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&u(n.batchTableBinary)&&(n.styleableProperties=Ep.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),u(n.draco)){let a=n.draco;e._decodingState=DC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;u(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;u(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;u(o)&&(u(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;u(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var bht=new m,Sht=new m,vht=new m,J0e,CH;function wht(e){if(!u(CH)){J0e=new Q0e.default(0),CH=new Array(e);for(let t=0;t<e;++t)CH[t]=J0e.random()}return CH}function Dht(e){let n=e.length/3,i=Math.min(n,20),r=wht(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(o,o,o,bht),c=m.fromElements(s,s,s,Sht);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=m.unpack(e,d*3,vht);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let l=ae.fromCornerPoints(a,c);return l.radius+=P.EPSILON2,l}function Z0e(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Ot("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var Iht=new oe,Pht=new oe,Oht=new z,$0e=0,TH=1,qX=2,eAe=3,Mht=4,HX=new N,Rht=new N;function Bht(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,l=i.styleableProperties,f=u(l),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,A=e._quantizedRange,x=e._octEncodedRange,C=e._isRGB565,T=e._isTranslucent,E=e._hasColors,S=e._hasNormals,w=e._hasBatchIds,D,M,O=[],B={};if(e._styleableShaderAttributes=B,f){let V=Mht;for(let G in l)if(l.hasOwnProperty(G)){let U=l[G],Y=Z0e(U.typedArray,G);D=U.componentCount,M=X.fromTypedArray(Y);let W=mt.createVertexBuffer({context:n,typedArray:Y,usage:Ne.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let J={index:V,vertexBuffer:W,componentsPerAttribute:D,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0};O.push(J),B[G]={location:V,componentCount:D},++V}}let L=mt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;E&&(_=mt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let b;S&&(b=mt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let v;w&&(c.typedArray=Z0e(c.typedArray,"batchIds"),v=mt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?M=X.UNSIGNED_SHORT:p?M=A<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:M=X.FLOAT,I.push({index:$0e,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=Dht(o.typedArray)),E)if(C)I.push({index:TH,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=T?4:3;I.push({index:TH,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(D=2,M=X.UNSIGNED_BYTE):h?(D=2,M=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,M=X.FLOAT),I.push({index:qX,vertexBuffer:b,componentsPerAttribute:D,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0})),w&&I.push({index:eAe,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(O));let R=new oi({context:n,attributes:I}),F={depthTest:{enabled:!0}},k={depthTest:{enabled:!0},depthMask:!1,blending:dn.ALPHA_BLEND};e._opaquePass===ve.CESIUM_3D_TILE&&(F.stencilTest=Ft.setCesium3DTileBit(),F.stencilMask=Ft.CESIUM_3D_TILE_MASK,k.stencilTest=Ft.setCesium3DTileBit(),k.stencilMask=Ft.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(F),e._translucentRenderState=Ve.fromCache(k),e._drawCommand=new et({boundingVolume:new ae,cull:e._cull,modelMatrix:new N,primitiveType:Be.POINTS,vertexArray:R,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?ve.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function Lht(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Iht;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,l;t.mode===ne.SCENE2D||c instanceof tn?l=Number.POSITIVE_INFINITY:l=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=l}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!u(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,Oht);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!u(a))return N.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);N.multiply(n.uniformState.view3D,c,HX);let l=N.multiply(HX,a.modelMatrix,HX);return N.inverseTranspose(l,Rht)}};WS.addUniforms(e,s),(i||r||o)&&(s=_t(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=Pht;if(u(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),u(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function GX(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function WX(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function jX(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Nht={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function Fht(e,t,n){let i,r,o,s=t.context,a=u(n),c=e._isQuantized,l=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,A=e._hasNormals,x=e._hasBatchIds,C=e._backFaceCulling,T=e._normalShading,E=e._drawCommand.vertexArray,S=e.clippingPlanes,w=e._attenuation,D,M,O,B=g,L=We(Nht),_={},b=e._styleableShaderAttributes;for(r in b)b.hasOwnProperty(r)&&(o=b[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let se={translucent:!1},pe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${pe}`,L,se),M=n.getShowShaderFunction(`getShowFromStyle${pe}`,L,se),O=n.getPointSizeShaderFunction(`getPointSizeFromStyle${pe}`,L,se),u(D)&&se.translucent&&(B=!0)}e._styleTranslucent=B;let v=u(D),I=u(M),R=u(O),F=e.isClipped,k=[],V=[];v&&(GX(D,k),WX(D,V)),I&&(GX(M,k),WX(M,V)),R&&(GX(O,k),WX(O,V));let G=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!A)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(r in b)if(b.hasOwnProperty(r)){o=b[r];let se=k.indexOf(o.location)>=0,pe=jX(E,o.location);pe.enabled=se}let Y=h&&(!v||G);if(h){let se=jX(E,TH);se.enabled=Y}let W=A&&(T||C||U);if(A){let se=jX(E,qX);se.enabled=W}let J={a_position:$0e};Y&&(J.a_color=TH),W&&(J.a_normal=qX),x&&(J.a_batchId=eAe);let j="",K=k.length;for(i=0;i<K;++i){let se=k[i];o=_[se];let pe=o.componentCount,Ae=`czm_3dtiles_property_${se}`,De;pe===1?De="float":De=`vec${pe}`,j+=`in ${De} ${Ae}; -`,J[Ae]=o.location}Lht(e,t);let Z=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;Z+=`float u_pointSize; -float tiles3d_tileset_time; -`,w&&(Z+=`float u_geometricError; -float u_depthMultiplier; -`),Z+=j,Y&&(g?Z+=`in vec4 a_color; -`:p?Z+=`in float a_color; -const float SHIFT_RIGHT_11 = 1.0 / 2048.0; -const float SHIFT_RIGHT_5 = 1.0 / 32.0; -const float SHIFT_LEFT_11 = 2048.0; -const float SHIFT_LEFT_5 = 32.0; -const float NORMALIZE_6 = 1.0 / 64.0; -const float NORMALIZE_5 = 1.0 / 32.0; -`:Z+=`in vec3 a_color; -`),W&&(f||d?Z+=`in vec2 a_normal; -`:Z+=`in vec3 a_normal; -`),x&&(Z+=`in float a_batchId; -`),(c||l||d)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),v&&(Z+=D),I&&(Z+=M),R&&(Z+=O),Z+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,w&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),Y?g?Z+=` vec4 color = a_color; -`:p?Z+=` float compressed = a_color; - float r = floor(compressed * SHIFT_RIGHT_11); - compressed -= r * SHIFT_LEFT_11; - float g = floor(compressed * SHIFT_RIGHT_5); - compressed -= g * SHIFT_LEFT_5; - float b = compressed; - vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); - vec4 color = vec4(rgb, 1.0); -`:Z+=` vec4 color = vec4(a_color, 1.0); -`:Z+=` vec4 color = u_constantColor; -`,c||l?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:Z+=` vec3 position = a_position; -`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,W?(f?Z+=` vec3 normal = czm_octDecode(a_normal); -`:d?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:Z+=` vec3 normal = a_normal; -`,Z+=` vec3 normalEC = czm_normal * normal; -`):Z+=` vec3 normal = vec3(1.0); -`,v&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),R?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:w?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:Z+=` gl_PointSize = u_pointSize; -`,Z+=` color = color * u_highlightColor; -`,W&&T&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),Z+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,W&&C&&(Z+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(Z+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),Z+=`} -`;let me=`in vec4 v_color; -`;F&&(me+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,me+=` -`,me+=L_(S,s),me+=` -`),me+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,F&&(me+=BN("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} -`,e.splitDirection!==zc.NONE&&(me=WS.modifyFragmentShader(me)),u(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),u(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let ye=e._drawCommand;u(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=Kt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:me,attributeLocations:J});try{ye.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Uht(e,t){if(e._decodingState===DC.READY)return!1;if(e._decodingState===DC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Op.decodePointCloud(i,t);u(r)&&(e._decodingState=DC.DECODING,r.then(function(o){e._decodingState=DC.READY;let s=u(o.POSITION)?o.POSITION.array:void 0,a=u(o.RGB)?o.RGB.array:void 0,c=u(o.RGBA)?o.RGBA.array:void 0,l=u(o.NORMAL)?o.NORMAL.array:void 0,f=u(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=u(s)&&u(o.POSITION.data.quantization),p=u(l)&&u(o.NORMAL.data.quantization);if(d){let x=o.POSITION.data.quantization,C=x.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let x in h)if(h.hasOwnProperty(x)){let C=o[x];u(g)||(g={}),g[x]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}u(s)&&(n.positions={typedArray:s});let A=y(c,a);u(A)&&(n.colors={typedArray:A}),u(l)&&(n.normals={typedArray:l}),u(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=DC.FAILED,e._error=o}))}return!0}var Vht=new oe,kht=new m;xF.prototype.update=function(e){let t=e.context;if(u(this._error)){let l=this._error;throw this._error=void 0,l}if(Uht(this,t))return;let i=!1,r=!N.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),u(this._drawCommand)||(Bht(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){N.clone(this.modelMatrix,this._modelMatrix);let l=this._drawCommand.modelMatrix;if(N.clone(this._modelMatrix,l),u(this._rtcCenter)&&N.multiplyByTranslation(l,this._rtcCenter,l),u(this._quantizedVolumeOffset)&&N.multiplyByTranslation(l,this._quantizedVolumeOffset,l),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=N.getColumn(l,3,Vht);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(d,l,l)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(l,d,d);let p=N.getScale(l,kht);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==zc.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&Fht(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?ve.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};xF.prototype.isDestroyed=function(){return!1};xF.prototype.destroy=function(){let e=this._drawCommand;return u(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var CF=xF;var zht={NEAREST:0,LINEAR:1},zu=zht;function IC(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,at.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,zu.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new Wa;r.scissorTest={enabled:!0,rectangle:u(e.scissorRectangle)?Ye.clone(e.scissorRectangle):new Ye},this._passState=r,this._ready=!1;let o=e.name;u(o)||(o=jn()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(IC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(u(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(u(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Hht=/uniform\s+sampler2D\s+depthTexture/g;IC.prototype._isSupported=function(e){return!Hht.test(this._fragmentShader)||e.depthTexture};function Ght(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];u(a)&&a!==o&&a instanceof Rt&&!u(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Rt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function Wht(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function jht(e,t){return function(){let n=e[t]();if(u(n))return n.dimensions}}function qht(e){if(u(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i)if(i.hasOwnProperty(o)){typeof i[o]!="function"?(t[o]=Wht(e,o),n[o]=Ght(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=jht(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=_t(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Yht(e,t){if(u(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(u(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE -uniform sampler2D czm_idTexture; -uniform sampler2D czm_selectedIdTexture; -uniform float czm_selectedIdTextureStep; -in vec2 v_textureCoordinates; -bool czm_selected(vec2 offset) -{ - bool selected = false; - vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); - for (int i = 0; i < ${r}; ++i) - { - vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); - if (all(equal(id, selectedId))) - { - return true; - } - } - return false; -} - -bool czm_selected() -{ - return czm_selected(vec2(0.0)); -} - -${n}`}let i=new ke({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Xht(e){let t=e._sampleMode,n,i;t===zu.LINEAR?(n=cn.LINEAR,i=Ti.LINEAR):(n=cn.NEAREST,i=Ti.NEAREST);let r=e._sampler;(!u(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new fn({wrapS:wn.CLAMP_TO_EDGE,wrapT:wn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Kht(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Jht(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Zht(e,t){let n,i,r,o=e._texturesToRelease,s=o.length;for(n=0;n<s;++n)i=o[n],i=i&&i.destroy();o.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];r=d.name;let p=d.source;e._actualUniforms[r]=new Rt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!u(e._texturePromise)){e._ready=!0;return}if(c.length===0||u(e._texturePromise))return;s=c.length;let l=e._uniforms,f=[];for(n=0;n<s;++n){r=c[n];let d=l[r],p=e._textureCache.getStageByName(d);if(u(p))e._actualUniforms[r]=Jht(e,d);else if(typeof d=="string"){let g=new we({url:d});f.push(g.fetchImage().then(Kht(e,r)))}else e._texturesToCreate.push({name:r,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function tAe(e){u(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!u(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i)i.hasOwnProperty(r)&&i[r]instanceof Rt&&(u(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}function Qht(e){let t=u(e._selected)?e._selected.length:0,n=u(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,u(e._selected)&&u(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):u(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&u(e._combinedSelected)){if(!u(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function $ht(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!u(n))return;let i,r,o=0,s=n.length;for(i=0;i<s;++i)r=n[i],u(r.pickIds)?o+=r.pickIds.length:u(r.pickId)&&++o;if(s===0||o===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:fn.NEAREST});return}let a,c=0,l=new Uint8Array(o*4);for(i=0;i<s;++i)if(r=n[i],u(r.pickIds)){let f=r.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,l[c]=z.floatToByte(a.red),l[c+1]=z.floatToByte(a.green),l[c+2]=z.floatToByte(a.blue),l[c+3]=z.floatToByte(a.alpha),c+=4}else u(r.pickId)&&(a=r.pickId.color,l[c]=z.floatToByte(a.red),l[c+1]=z.floatToByte(a.green),l[c+2]=z.floatToByte(a.blue),l[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:l,width:o,height:1},sampler:fn.NEAREST})}IC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&tAe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Qht(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=u(this._selected)?this._selected.length:0,this._parentSelectedLength=u(this._parentSelected)?this._parentSelected.length:0,$ht(this,e),qht(this),Zht(this,e),Yht(this,e),Xht(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!u(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!u(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new Ye(0,0,i.width,i.height)}))),this._command.renderState=r};IC.prototype.execute=function(e,t,n,i){if(!u(this._command)||!u(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,fn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;u(r)&&(r.context=e),this._command.execute(e,r)};IC.prototype.isDestroyed=function(){return!1};IC.prototype.destroy=function(){return tAe(this),ue(this)};var Tr=IC;var TF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; - -#ifdef AUTO_EXPOSURE - color /= texture(autoExposure, vec2(0.5)).r; -#endif - color = czm_acesTonemapping(color); - color = czm_inverseGamma(color); - - out_FragColor = vec4(color, fragmentColor.a); -} -`;var EF=`uniform sampler2D randomTexture; -uniform sampler2D depthTexture; -uniform float intensity; -uniform float bias; -uniform float lengthCap; -uniform float stepSize; -uniform float frustumLength; - -in vec2 v_textureCoordinates; - -vec4 clipToEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); - posEC = posEC / posEC.w; - return posEC; -} - -//Reconstruct Normal Without Edge Removation -vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) -{ - vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); - vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); - vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); - vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); - - vec3 up = posInCamera.xyz - posInCameraUp.xyz; - vec3 down = posInCameraDown.xyz - posInCamera.xyz; - vec3 left = posInCamera.xyz - posInCameraLeft.xyz; - vec3 right = posInCameraRight.xyz - posInCamera.xyz; - - vec3 DX = length(left) < length(right) ? left : right; - vec3 DY = length(up) < length(down) ? up : down; - - return normalize(cross(DY, DX)); -} - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = clipToEye(v_textureCoordinates, depth); - - if (posInCamera.z > frustumLength) - { - out_FragColor = vec4(1.0); - return; - } - - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); - float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); - float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); - float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); - vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); - - float ao = 0.0; - vec2 sampleDirection = vec2(1.0, 0.0); - float gapAngle = 90.0 * czm_radiansPerDegree; - - // RandomNoise - float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; - - //Loop for each direction - for (int i = 0; i < 4; i++) - { - float newGapAngle = gapAngle * (float(i) + randomVal); - float cosVal = cos(newGapAngle); - float sinVal = sin(newGapAngle); - - //Rotate Sampling Direction - vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); - float localAO = 0.0; - float localStepSize = stepSize; - - //Loop for each step - for (int j = 0; j < 6; j++) - { - vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; - - //Exception Handling - if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) - { - break; - } - - float stepDepthInfo = czm_readDepth(depthTexture, newCoords); - vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); - vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; - float len = length(diffVec); - - if (len > lengthCap) - { - break; - } - - float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); - float weight = len / lengthCap; - weight = 1.0 - weight * weight; - - if (dotVal < bias) - { - dotVal = 0.0; - } - - localAO = max(localAO, dotVal * weight); - localStepSize += stepSize; - } - ao += localAO; - } - - ao /= 4.0; - ao = 1.0 - clamp(ao, 0.0, 1.0); - ao = pow(ao, intensity); - out_FragColor = vec4(vec3(ao), 1.0); -} -`;var bF=`uniform sampler2D colorTexture; -uniform sampler2D ambientOcclusionTexture; -uniform bool ambientOcclusionOnly; -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); - out_FragColor = ambientOcclusionOnly ? ao : ao * color; -} -`;var SF=`uniform sampler2D colorTexture; -uniform float gradations; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = vec4(rgb, 1.0); - return; - } -#endif - float luminance = czm_luminance(rgb); - float darkness = luminance * gradations; - darkness = (darkness - fract(darkness)) / gradations; - out_FragColor = vec4(vec3(darkness), 1.0); -} -`;var vF=`uniform sampler2D colorTexture; -uniform sampler2D bloomTexture; -uniform bool glowOnly; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = color; - return; - } -#endif - - vec4 bloom = texture(bloomTexture, v_textureCoordinates); - out_FragColor = glowOnly ? bloom : bloom + color; -} -`;var wF=`uniform sampler2D colorTexture; -uniform float brightness; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 target = vec3(0.0); - out_FragColor = vec4(mix(target, rgb, brightness), 1.0); -} -`;var DF=`uniform sampler2D colorTexture; -uniform float contrast; -uniform float brightness; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; - sceneColor = czm_RGBToHSB(sceneColor); - sceneColor.z += brightness; - sceneColor = czm_HSBToRGB(sceneColor); - - float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); - sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); - out_FragColor = vec4(sceneColor, 1.0); -} -`;var IF=`uniform sampler2D colorTexture; -uniform sampler2D blurTexture; -uniform sampler2D depthTexture; -uniform float focalDistance; - -in vec2 v_textureCoordinates; - -vec4 toEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); - posInCamera = posInCamera / posInCamera.w; - return posInCamera; -} - -float computeDepthBlur(float depth) -{ - float f; - if (depth < focalDistance) - { - f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); - } - else - { - f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); - f = pow(f, 0.1); - } - f *= f; - f = clamp(f, 0.0, 1.0); - return pow(f, 0.5); -} - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = toEye(v_textureCoordinates, depth); - float d = computeDepthBlur(-posInCamera.z); - out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); -} -`;var PF=`uniform sampler2D depthTexture; - -in vec2 v_textureCoordinates; - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - out_FragColor = vec4(vec3(depth), 1.0); -} -`;var OF=`uniform sampler2D depthTexture; -uniform float length; -uniform vec4 color; - -in vec2 v_textureCoordinates; - -void main(void) -{ - float directions[3]; - directions[0] = -1.0; - directions[1] = 0.0; - directions[2] = 1.0; - - float scalars[3]; - scalars[0] = 3.0; - scalars[1] = 10.0; - scalars[2] = 3.0; - - float padx = czm_pixelRatio / czm_viewport.z; - float pady = czm_pixelRatio / czm_viewport.w; - -#ifdef CZM_SELECTED_FEATURE - bool selected = false; - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - selected = selected || czm_selected(vec2(-padx, dir * pady)); - selected = selected || czm_selected(vec2(padx, dir * pady)); - selected = selected || czm_selected(vec2(dir * padx, -pady)); - selected = selected || czm_selected(vec2(dir * padx, pady)); - if (selected) - { - break; - } - } - if (!selected) - { - out_FragColor = vec4(color.rgb, 0.0); - return; - } -#endif - - float horizEdge = 0.0; - float vertEdge = 0.0; - - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - float scale = scalars[i]; - - horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; - horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; - - vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; - vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; - } - - float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); - out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); -} -`;var MF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See slides 142 and 143: -// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; - -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - - const float A = 0.22; // shoulder strength - const float B = 0.30; // linear strength - const float C = 0.10; // linear angle - const float D = 0.20; // toe strength - const float E = 0.01; // toe numerator - const float F = 0.30; // toe denominator - - const float white = 11.2; // linear white point value - - vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; - float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; - - c = czm_inverseGamma(c / w); - out_FragColor = vec4(c, fragmentColor.a); -} -`;var RF=`in vec2 v_textureCoordinates; - -uniform sampler2D colorTexture; - -const float fxaaQualitySubpix = 0.5; -const float fxaaQualityEdgeThreshold = 0.125; -const float fxaaQualityEdgeThresholdMin = 0.0833; - -void main() -{ - vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; - vec4 color = FxaaPixelShader( - v_textureCoordinates, - colorTexture, - fxaaQualityRcpFrame, - fxaaQualitySubpix, - fxaaQualityEdgeThreshold, - fxaaQualityEdgeThresholdMin); - float alpha = texture(colorTexture, v_textureCoordinates).a; - out_FragColor = vec4(color.rgb, alpha); -} -`;var l0=`#define SAMPLES 8 - -uniform float delta; -uniform float sigma; -uniform float direction; // 0.0 for x direction, 1.0 for y direction - -uniform sampler2D colorTexture; - -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif - -in vec2 v_textureCoordinates; - -// Incremental Computation of the Gaussian: -// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html - -void main() -{ - vec2 st = v_textureCoordinates; - vec2 dir = vec2(1.0 - direction, direction); - -#ifdef USE_STEP_SIZE - vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); -#else - vec2 step = step; -#endif - - vec3 g; - g.x = 1.0 / (sqrt(czm_twoPi) * sigma); - g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); - g.z = g.y * g.y; - - vec4 result = texture(colorTexture, st) * g.x; - for (int i = 1; i < SAMPLES; ++i) - { - g.xy *= g.yz; - - vec2 offset = float(i) * dir * step; - result += texture(colorTexture, st - offset) * g.x; - result += texture(colorTexture, st + offset) * g.x; - } - - out_FragColor = result; -} -`;var BF=`uniform sampler2D colorTexture; -uniform sampler2D dirtTexture; -uniform sampler2D starTexture; -uniform vec2 dirtTextureDimensions; -uniform float distortion; -uniform float ghostDispersal; -uniform float haloWidth; -uniform float dirtAmount; -uniform float earthRadius; -uniform float intensity; - -in vec2 v_textureCoordinates; - -// whether it is in space or not -// 6500000.0 is empirical value -#define DISTANCE_TO_SPACE 6500000.0 - -// return ndc from world coordinate biased earthRadius -vec4 getNDCFromWC(vec3 WC, float earthRadius) -{ - vec4 positionEC = czm_view * vec4(WC, 1.0); - positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); -} - -// Check if current pixel is included Earth -// if then mask it gradually -float isInEarth(vec2 texcoord, vec2 sceneSize) -{ - vec2 NDC = texcoord * 2.0 - 1.0; - vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); - vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); - NDC.xy -= earthPosSC.xy; - - float X = abs(NDC.x) * sceneSize.x; - float Y = abs(NDC.y) * sceneSize.y; - - return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); -} - -// For Chromatic effect -vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) -{ - vec2 sceneSize = czm_viewport.zw; - vec3 color; - if(isSpace) - { - color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; - color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; - color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; - } - else - { - color.r = texture(tex, texcoord + direction * distortion.r).r; - color.g = texture(tex, texcoord + direction * distortion.g).g; - color.b = texture(tex, texcoord + direction * distortion.b).b; - } - return vec4(clamp(color, 0.0, 1.0), 0.0); -} - -void main(void) -{ - vec4 originalColor = texture(colorTexture, v_textureCoordinates); - vec3 rgb = originalColor.rgb; - bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; - - // Sun position - vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); - vec4 sunPositionEC = czm_view * sunPos; - vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); - sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); - - // If sun is not in the screen space, use original color. - if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) - { - // Lens flare is disabled when not in space until #5932 is fixed. - // https://github.com/CesiumGS/cesium/issues/5932 - out_FragColor = originalColor; - return; - } - - vec2 texcoord = vec2(1.0) - v_textureCoordinates; - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - vec2 invPixelSize = 1.0 / pixelSize; - vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); - - // ghost vector to image centre: - vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; - vec3 direction = normalize(vec3(ghostVec, 0.0)); - - // sample ghosts: - vec4 result = vec4(0.0); - vec4 ghost = vec4(0.0); - for (int i = 0; i < 4; ++i) - { - vec2 offset = fract(texcoord + ghostVec * float(i)); - // Only bright spots from the centre of the source image - ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); - } - result += ghost; - - // sample halo - vec2 haloVec = normalize(ghostVec) * haloWidth; - float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); - weightForHalo = pow(1.0 - weightForHalo, 5.0); - - result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; - - // dirt on lens - vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; - if (dirtTexCoords.x > 1.0) - { - dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); - } - if (dirtTexCoords.y > 1.0) - { - dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); - } - result += dirtAmount * texture(dirtTexture, dirtTexCoords); - - // Rotating starburst texture's coordinate - // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) - float camrot = czm_view[0].z + czm_view[1].y; - float cosValue = cos(camrot); - float sinValue = sin(camrot); - mat3 rotation = mat3( - cosValue, -sinValue, 0.0, - sinValue, cosValue, 0.0, - 0.0, 0.0, 1.0 - ); - - vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); - vec3 st2 = vec3((rotation * st1).xy, 1.0); - vec3 st3 = st2 * 0.5 + vec3(0.5); - vec2 lensStarTexcoord = st3.xy; - float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); - float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); - - if (!isSpace) - { - result *= oneMinusWeightForLensFlare * intensity * 0.2; - } - else - { - result *= oneMinusWeightForLensFlare * intensity; - result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; - } - - result += texture(colorTexture, v_textureCoordinates); - - out_FragColor = result; -} -`;var LF=`uniform sampler2D colorTexture; -uniform vec3 white; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See equation 4: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = (color * (1.0 + color / white)) / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var NF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); -} - -void main(void) -{ - float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 green = vec3(0.0, 1.0, 0.0); - out_FragColor = vec4((noiseValue + rgb) * green, 1.0); -} -`;var FF=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif - -// See equation 3: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf - -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = color / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var UF=`uniform sampler2D colorTexture; -uniform sampler2D silhouetteTexture; - -in vec2 v_textureCoordinates; - -void main(void) -{ - vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); - vec4 color = texture(colorTexture, v_textureCoordinates); - out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); -} -`;/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var VF=`/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples -// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - -// Steps used to integrate into Cesium: -// * The following defines are set: -// #define FXAA_PC 1 -// #define FXAA_WEBGL_1 1 -// #define FXAA_GREEN_AS_LUMA 1 -// #define FXAA_EARLY_EXIT 1 -// #define FXAA_GLSL_120 1 -// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. -// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace -// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. -// * There are no implicit conversions from ivec* to vec* so replace: -// #define FxaaInt2 ivec2 -// with -// #define FxaaInt2 vec2 -// * The texture2DLod function is only available in vertex shaders so replace: -// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) -// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) -// with -// #define FxaaTexTop(t, p) texture(t, p) -// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. -// * The following parameters to FxaaPixelShader are unused and can be removed: -// fxaaConsolePosPos -// fxaaConsoleRcpFrameOpt -// fxaaConsoleRcpFrameOpt2 -// fxaaConsole360RcpFrameOpt2 -// fxaaConsoleEdgeSharpness -// fxaaConsoleEdgeThreshold -// fxaaConsoleEdgeThresholdMi -// fxaaConsole360ConstDir - -// -// Choose the quality preset. -// This needs to be compiled into the shader as it effects code. -// Best option to include multiple presets is to -// in each shader define the preset, then include this file. -// -// OPTIONS -// ----------------------------------------------------------------------- -// 10 to 15 - default medium dither (10=fastest, 15=highest quality) -// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) -// 39 - no dither, very expensive -// -// NOTES -// ----------------------------------------------------------------------- -// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) -// 13 = about same speed as FXAA 3.9 and better than 12 -// 23 = closest to FXAA 3.9 visually and performance wise -// _ = the lowest digit is directly related to performance -// _ = the highest digit is directly related to style -// -//#define FXAA_QUALITY_PRESET 12 - - -#if (FXAA_QUALITY_PRESET == 10) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 3.0 - #define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 3.0 - #define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 4.0 - #define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 4.0 - #define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 4.0 - #define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 2.0 - #define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 3.0 - #define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) - #define FXAA_QUALITY_PS 9 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 4.0 - #define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) - #define FXAA_QUALITY_PS 10 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 4.0 - #define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) - #define FXAA_QUALITY_PS 11 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 4.0 - #define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.0 - #define FXAA_QUALITY_P2 1.0 - #define FXAA_QUALITY_P3 1.0 - #define FXAA_QUALITY_P4 1.0 - #define FXAA_QUALITY_P5 1.5 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif - -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D - -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - -FxaaFloat4 FxaaPixelShader( +FxaaFloat4 FxaaPixelShader( // // Use noperspective interpolation here (turn off perspective interpolation). // {xy} = center of pixel @@ -14598,478 +10236,4802 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 11) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; + #if (FXAA_QUALITY_PS > 11) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 12) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 12) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; /*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;var GN=`uniform vec4 u_initialColor; + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP +uniform sampler2D u_mars_clip_area; +uniform bool u_mars_clip_enabled; +uniform bool u_mars_clip_only; +uniform mat4 u_mars_clip_inverMatrix; +uniform vec4 u_mars_clip_rect; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +#if TEXTURE_UNITS > 0 +uniform sampler2D u_dayTextures[TEXTURE_UNITS]; +uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; +uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; + +#ifdef APPLY_ALPHA +uniform float u_dayTextureAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_DAY_NIGHT_ALPHA +uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; +uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_CONTRAST +uniform float u_dayTextureContrast[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_HUE +uniform float u_dayTextureHue[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SATURATION +uniform float u_dayTextureSaturation[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D +uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D +uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; +#endif + +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN +uniform sampler2D u_waterMask; +uniform vec4 u_waterMaskTranslationAndScale; +uniform float u_zoomedOutOceanSpecularIntensity; +#endif + +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; +#endif + +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; +#endif + +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; +#endif + +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; +#endif + +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; // Hue, saturation, brightness +#endif + +#ifdef HIGHLIGHT_FILL_TILE +uniform vec4 u_fillHighlightColor; +#endif + +#ifdef TRANSLUCENT +uniform vec4 u_frontFaceAlphaByDistance; +uniform vec4 u_backFaceAlphaByDistance; +uniform vec4 u_translucencyRectangle; +#endif + +#ifdef UNDERGROUND_COLOR +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; +#endif + +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; +#endif + +in vec3 v_positionMC; +in vec3 v_positionEC; +in vec3 v_textureCoordinates; +in vec3 v_normalMC; +in vec3 v_normalEC; + +#ifdef APPLY_MATERIAL +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +uniform bool u_mars_flood_globe; + +uniform sampler2D u_mars_flood_area; +uniform bool u_mars_flood_emabled; +uniform bool u_showFloodOnly; +uniform mat4 u_mars_flood_inverMatrix; +uniform vec4 u_mars_flood_rect; +uniform bool u_mars_flood_showElse; +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +in float v_height; +in float v_slope; +in float v_aspect; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +in float v_distance; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +in vec3 v_atmosphereRayleighColor; +in vec3 v_atmosphereMieColor; +in float v_atmosphereOpacity; +#endif + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT +uniform int u_mars_uplift_RectangleWidth; +uniform int u_mars_uplift_RectangleHeight; +uniform highp sampler2D u_mars_uplift_RampRectangle; +uniform float u_mars_inverseTileWidth; +uniform vec2 u_mars_cartographicTileRectangle; +uniform bool u_mars_uplift_enabled; +uniform bool u_mars_uplift_hideInsideOrOutside; + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); + float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); + vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, 0.0); +} + +bool inSlopeRampRectangle() { + for(int h = 0; h < 100000; h++) { + if(h >= u_mars_uplift_RectangleWidth) + break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++) { + if(float(w) >= currentLength) + break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { + if(v_textureCoordinates.y <= max(p1.y, p2.y)) { + if(p1.x != p2.x) { + xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { + counter += 1.0; + } } - #endif -/*--------------------------------------------------------------------------*/ } - #endif -/*--------------------------------------------------------------------------*/ } + + } + if((mod(counter, 2.0) != 0.0)) { + return true; + } + } + + return false; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} +#endif + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +{ + return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); +} +#endif + +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() +{ + return + v_textureCoordinates.x > u_translucencyRectangle.x && + v_textureCoordinates.x < u_translucencyRectangle.z && + v_textureCoordinates.y > u_translucencyRectangle.y && + v_textureCoordinates.y < u_translucencyRectangle.w; +} +#endif + +vec4 sampleAndBlend( + vec4 previousColor, + sampler2D textureToSample, + vec2 tileTextureCoordinates, + vec4 textureCoordinateRectangle, + vec4 textureCoordinateTranslationAndScale, + float textureAlpha, + float textureNightAlpha, + float textureDayAlpha, + float textureBrightness, + float textureContrast, + float textureHue, + float textureSaturation, + float textureOneOverGamma, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + bool textureInvertColor, + vec3 texturefilterColor, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + float split, + vec4 colorToAlpha, + float nightBlend) +{ + // This crazy step stuff sets the alpha to 0.0 if this following condition is true: + // tileTextureCoordinates.s < textureCoordinateRectangle.s || + // tileTextureCoordinates.s > textureCoordinateRectangle.p || + // tileTextureCoordinates.t < textureCoordinateRectangle.t || + // tileTextureCoordinates.t > textureCoordinateRectangle.q + // In other words, the alpha is zero if the fragment is outside the rectangle + // covered by this texture. Would an actual 'if' yield better performance? + vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + + alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); +#endif + + vec2 translation = textureCoordinateTranslationAndScale.xy; + vec2 scale = textureCoordinateTranslationAndScale.zw; + vec2 textureCoordinates = tileTextureCoordinates * scale + translation; + vec4 value = texture(textureToSample, textureCoordinates); + vec3 color = value.rgb; + float alpha = value.a; + +#ifdef APPLY_COLOR_TO_ALPHA + vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); + colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); + alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); +#endif + +#if !defined(APPLY_GAMMA) + vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); + color = tempColor.rgb; + alpha = tempColor.a; +#else + color = pow(color, vec3(textureOneOverGamma)); +#endif + +#ifdef APPLY_SPLIT + float splitPosition = czm_splitPosition; + // Split to the left + if (split < 0.0 && gl_FragCoord.x > splitPosition) { + alpha = 0.0; + } + // Split to the right + else if (split > 0.0 && gl_FragCoord.x < splitPosition) { + alpha = 0.0; + } +#endif + +#ifdef APPLY_BRIGHTNESS + color = mix(vec3(0.0), color, textureBrightness); +#endif + +#ifdef APPLY_CONTRAST + color = mix(vec3(0.5), color, textureContrast); +#endif + +#ifdef APPLY_HUE + color = czm_hue(color, textureHue); +#endif + +#ifdef APPLY_SATURATION + color = czm_saturation(color, textureSaturation); +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D + if(textureInvertColor) { + color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); + } +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D + if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { + color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + + float sourceAlpha = alpha * textureAlpha; + float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); + outAlpha += sign(outAlpha) - 1.0; + + vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; + + // When rendering imagery for a tile in multiple passes, + // some GPU/WebGL implementation combinations will not blend fragments in + // additional passes correctly if their computation includes an unmasked + // divide-by-zero operation, + // even if it's not in the output or if the output has alpha zero. + // + // For example, without sanitization for outAlpha, + // this renders without artifacts: + // if (outAlpha == 0.0) { outColor = vec3(0.0); } + // + // but using czm_branchFreeTernary will cause portions of the tile that are + // alpha-zero in the additional pass to render as black instead of blending + // with the previous pass: + // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); + // + // So instead, sanitize against divide-by-zero, + // store this state on the sign of outAlpha, and correct on return. + + return vec4(outColor, max(outAlpha, 0.0)); +} + +vec3 colorCorrect(vec3 rgb) { +#ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + rgb = czm_HSBToRGB(hsb); +#endif + return rgb; +} + +vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); + +const float fExposure = 2.0; + +vec3 computeEllipsoidPosition() +{ + float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); + vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); + xy *= czm_viewport.zw * mpp * 0.5; + + vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); + czm_ray ray = czm_ray(vec3(0.0), direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + + vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); + return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; +} + +void main() +{ +#ifdef TILE_LIMIT_RECTANGLE + if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || + v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) + { + discard; + } +#endif + +#ifdef ENABLE_CLIPPING_PLANES + float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); +#endif + +#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) + vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates + vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes +#endif + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); +#else + float nightBlend = 0.0; +#endif + + // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 + // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the + // fragments on the edges of tiles even though the vertex shader is outputting + // coordinates strictly in the 0-1 range. + vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); + +#ifdef SHOW_TILE_BOUNDARIES + if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || + v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) + { + color = vec4(1.0, 0.0, 0.0, 1.0); + } +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) + float cameraDist; + if (czm_sceneMode == czm_sceneMode2D) + { + cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; + } + else if (czm_sceneMode == czm_sceneModeColumbusView) + { + cameraDist = -czm_view[3].z; + } + else + { + cameraDist = length(czm_view[3]); + } + float fadeOutDist = u_lightingFadeDistance.x; + float fadeInDist = u_lightingFadeDistance.y; + if (czm_sceneMode != czm_sceneMode3D) { + vec3 radii = czm_ellipsoidRadii; + float maxRadii = max(radii.x, max(radii.y, radii.z)); + fadeOutDist -= maxRadii; + fadeInDist -= maxRadii; + } + float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else + float fade = 0.0; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN + vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; + vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; + vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; + waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; + + float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; + + if (mask > 0.0) + { + mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); + + vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); + vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); + + vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); + + color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); + } +#endif + +#ifdef APPLY_MATERIAL + czm_materialInput materialInput; + materialInput.st = v_textureCoordinates.st; + materialInput.normalEC = normalize(v_normalEC); + materialInput.positionToEyeEC = -v_positionEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); + materialInput.slope = v_slope; + materialInput.height = v_height; + materialInput.aspect = v_aspect; + czm_material material = czm_getMaterial(materialInput); + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 + + vec4 materialColor = vec4(material.diffuse, material.alpha); + if(u_mars_flood_emabled) { + if(u_mars_flood_globe) { + vec4 materialColor = vec4(material.diffuse, material.alpha); + color = alphaBlend(materialColor, color); + } else { + vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); + vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; + vec4 ymColor = texture(u_mars_flood_area, newuv); + if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { + color.xyz = mix(color.xyz, material.diffuse, material.alpha); + } else { + if(!u_mars_flood_showElse) { + discard; + } + } + } + } + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#endif + +#ifdef ENABLE_VERTEX_LIGHTING + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#elif defined(ENABLE_DAYNIGHT_SHADING) + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); + diffuseIntensity = mix(1.0, diffuseIntensity, fade); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#else + vec4 finalColor = color; +#endif + +#ifdef ENABLE_CLIPPING_PLANES + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; + + if (clipDistance < clippingPlanesEdgeWidth) + { + finalColor = clippingPlanesEdgeColor; + } +#endif + +#ifdef HIGHLIGHT_FILL_TILE + finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +#endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) + if (!czm_backFacing()) + { + bool dynamicLighting = false; + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + + vec3 rayleighColor; + vec3 mieColor; + float opacity; + + vec3 positionWC; + vec3 lightDirection; + + // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. + // Otherwise, the scattering is computed in the vertex shader. + #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE + positionWC = computeEllipsoidPosition(); + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + computeAtmosphereScattering( + positionWC, + lightDirection, + rayleighColor, + mieColor, + opacity + ); + #else + positionWC = v_positionMC; + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + rayleighColor = v_atmosphereRayleighColor; + mieColor = v_atmosphereMieColor; + opacity = v_atmosphereOpacity; + #endif + + rayleighColor = colorCorrect(rayleighColor); + mieColor = colorCorrect(mieColor); + + vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + + // Fog is applied to tiles selected for fog, close to the Earth. + #ifdef FOG + vec3 fogColor = groundAtmosphereColor.rgb; + + // If there is lighting, apply that to the fog. + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); + fogColor *= darken; + #endif + + #ifndef HDR + fogColor.rgb = czm_acesTonemapping(fogColor.rgb); + fogColor.rgb = czm_inverseGamma(fogColor.rgb); + #endif + + const float modifier = 0.15; + finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); + + #else + // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. + // This value is larger near the "circumference", as it is further away from the camera. We use it to + // brighten up that area of the ground atmosphere. + const float transmittanceModifier = 0.5; + float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); + + vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float fadeInDist = u_nightFadeDistance.x; + float fadeOutDist = u_nightFadeDistance.y; + + float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); + float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); + vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); + + finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); + #endif + + #ifndef HDR + finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); + #else + finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); + #endif + + finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); + #endif + } +#endif + +#ifdef UNDERGROUND_COLOR + if (czm_backFacing()) + { + float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); + float distance = max(v_distance - distanceFromEllipsoid, 0.0); + float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); + vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); + finalColor = alphaBlend(undergroundColor, finalColor); + } +#endif + +#ifdef TRANSLUCENT + if (inTranslucencyRectangle()) + { + vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; + finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); + } +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP + if(u_mars_clip_enabled) { + vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); + vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; + vec4 tColor = texture(u_mars_clip_area, tuv); + if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { + if(u_mars_clip_only) { + discard; + } + } else { + if(!u_mars_clip_only) { + discard; + } + } + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT + if(u_mars_uplift_enabled) { + bool isInSlopeRampRectangle = inSlopeRampRectangle(); + if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { + discard; + } + } +#endif + + out_FragColor = finalColor; +} + + +#ifdef SHOW_REFLECTIVE_OCEAN + +float waveFade(float edge0, float edge1, float x) +{ + float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return pow(1.0 - y, 5.0); +} + +float linearFade(float edge0, float edge1, float x) +{ + return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} + +// Based on water rendering by Jonas Wagner: +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +// low altitude wave settings +const float oceanFrequencyLowAltitude = 825000.0; +const float oceanAnimationSpeedLowAltitude = 0.004; +const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; +const float oceanSpecularIntensity = 0.5; + +// high altitude wave settings +const float oceanFrequencyHighAltitude = 125000.0; +const float oceanAnimationSpeedHighAltitude = 0.008; +const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; + +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) +{ + vec3 positionToEyeEC = -positionEyeCoordinates; + float positionToEyeECLength = length(positionToEyeEC); + + // The double normalize below works around a bug in Firefox on Android devices. + vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); + + // Fade out the waves as the camera moves far from the surface. + float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); + +#ifdef SHOW_OCEAN_WAVES + // high altitude waves + float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; + vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); + vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); + + // low altitude waves + time = czm_frameNumber * oceanAnimationSpeedLowAltitude; + noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); + vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); + + // blend the 2 wave layers based on distance to surface + float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); + float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); + vec3 normalTangentSpace = + (highAltitudeFade * normalTangentSpaceHighAltitude) + + (lowAltitudeFade * normalTangentSpaceLowAltitude); + normalTangentSpace = normalize(normalTangentSpace); + + // fade out the normal perturbation as we move farther from the water surface + normalTangentSpace.xy *= waveIntensity; + normalTangentSpace = normalize(normalTangentSpace); +#else + vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); +#endif + + vec3 normalEC = enuToEye * normalTangentSpace; + + const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); + + // Use diffuse light to highlight the waves + float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; + vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); + +#ifdef SHOW_OCEAN_WAVES + // Where diffuse light is low or non-existent, use wave highlights based solely on + // the wave bumpiness and no particular light direction. + float tsPerturbationRatio = normalTangentSpace.z; + vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); +#else + vec3 nonDiffuseHighlight = vec3(0.0); +#endif + + // Add specular highlights in 3D, and in all modes when zoomed in. + float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); + float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); + float specular = specularIntensity * surfaceReflectance; + +#ifdef HDR + specular *= 1.4; + + float e = 0.2; + float d = 3.3; + float c = 1.7; + + vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); +#else + vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; +#endif + + return vec4(color, imageryColor.a); +} + +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var WN=`#ifdef QUANTIZATION_BITS12 +in vec4 compressed0; +in float compressed1; +#else +in vec4 position3DAndHeight; +in vec4 textureCoordAndEncodedNormals; +#endif + +#ifdef GEODETIC_SURFACE_NORMALS +in vec3 geodeticSurfaceNormal; +#endif + +#ifdef EXAGGERATION +uniform vec2 u_terrainExaggerationAndRelativeHeight; +#endif + +uniform vec3 u_center3D; +uniform mat4 u_modifiedModelView; +uniform mat4 u_modifiedModelViewProjection; +uniform vec4 u_tileRectangle; + +// Uniforms for 2D Mercator projection +uniform vec2 u_southAndNorthLatitude; +uniform vec2 u_southMercatorYAndOneOverHeight; + +out vec3 v_positionMC; +out vec3 v_positionEC; + +out vec3 v_textureCoordinates; +out vec3 v_normalMC; +out vec3 v_normalEC; + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT +uniform bool u_mars_flat_enabled; +uniform int u_mars_flat_AreaWidth; +uniform int u_mars_flat_AreaHeight; +uniform highp float u_mars_inverseTileWidth; +uniform highp vec2 u_mars_cartographicTileRectangle; +uniform highp sampler2D u_mars_flat_AreaTexture; +const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); + float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); + vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, point.w); +} + +float inRectangle(vec2 textureCoordinates) { + for(int h = 0; h < 100000; h++){ + if(h >= u_mars_flat_AreaWidth) break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float height = first.w; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++){ + if(float(w) >= currentLength) break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ + if (textureCoordinates.y <= max(p1.y, p2.y)){ + if (p1.x != p2.x){ + xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if (p1.y == p2.y || textureCoordinates.y <= xinters) + { + counter += 1.0; + } + } + } + } + + } + if((mod(counter, 2.0) != 0.0)) { + return height; + } + } + + return invalidValue; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + +#ifdef APPLY_MATERIAL +out float v_slope; +out float v_aspect; +out float v_height; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +out float v_distance; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) +out vec3 v_atmosphereRayleighColor; +out vec3 v_atmosphereMieColor; +out float v_atmosphereOpacity; +#endif + +// These functions are generated at runtime. +vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); +float get2DYPositionFraction(vec2 textureCoordinates); + +vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return u_modifiedModelViewProjection * vec4(position, 1.0); +} + +float get2DMercatorYPositionFraction(vec2 textureCoordinates) +{ + // The width of a tile at level 11, in radians and assuming a single root tile, is + // 2.0 * czm_pi / pow(2.0, 11.0) + // We want to just linearly interpolate the 2D position from the texture coordinates + // when we're at this level or higher. The constant below is the expression + // above evaluated and then rounded up at the 4th significant digit. + const float maxTileWidth = 0.003068; + float positionFraction = textureCoordinates.y; + float southLatitude = u_southAndNorthLatitude.x; + float northLatitude = u_southAndNorthLatitude.y; + if (northLatitude - southLatitude > maxTileWidth) + { + float southMercatorY = u_southMercatorYAndOneOverHeight.x; + float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; + + float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); + currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); + positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); + } + return positionFraction; +} + +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ + return textureCoordinates.y; +} + +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + return u_modifiedModelViewProjection * rtcPosition2D; +} + +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} + +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, height, textureCoordinates); +} + +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ + // We do not do RTC while morphing, so there is potential for jitter. + // This is unlikely to be noticeable, though. + vec3 position3DWC = position + u_center3D; + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); + return czm_modelViewProjection * morphPosition; +} + +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif + +void main() +{ +#ifdef QUANTIZATION_BITS12 + vec2 xy = czm_decompressTextureCoordinates(compressed0.x); + vec2 zh = czm_decompressTextureCoordinates(compressed0.y); + vec3 position = vec3(xy, zh.x); + float height = zh.y; + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); + + height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; + position = (u_scaleAndBias * vec4(position, 1.0)).xyz; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = compressed0.w; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#else + // A single float per element + vec3 position = position3DAndHeight.xyz; + float height = position3DAndHeight.w; + vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = textureCoordAndEncodedNormals.w; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = textureCoordAndEncodedNormals.z; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = 0.0; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#endif + + vec3 position3DWC = position + u_center3D; + +#ifdef GEODETIC_SURFACE_NORMALS + vec3 ellipsoidNormal = geodeticSurfaceNormal; +#else + vec3 ellipsoidNormal = normalize(position3DWC); +#endif + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + float exaggeration = u_terrainExaggerationAndRelativeHeight.x; + float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; + float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; + + // stop from going through center of earth + float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); + newHeight = max(newHeight, -minRadius); + + vec3 offset = ellipsoidNormal * (newHeight - height); + position += offset; + position3DWC += offset; + height = newHeight; +#endif + + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT + if(u_mars_flat_enabled){ + float isInside = inRectangle(textureCoordinates); + if(isInside != invalidValue){ + vec3 offset = (isInside - height) * ellipsoidNormal; + position += offset; + position3DWC += offset; + height = isInside; + // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; + } + } +#endif + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + + gl_Position = getPosition(position, height, textureCoordinates); + + v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; + v_positionMC = position3DWC; // position in model coordinates + + v_textureCoordinates = vec3(textureCoordinates, webMercatorT); + +#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + vec3 normalMC = czm_octDecode(encodedNormal); + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; + vec3 rejection = normalMC - projection; + normalMC = normalize(projection + rejection * exaggeration); +#endif + + v_normalMC = normalMC; + v_normalEC = czm_normal3D * v_normalMC; +#endif + +#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) + + bool dynamicLighting = false; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + + vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); + + computeAtmosphereScattering( + position3DWC, + lightDirection, + v_atmosphereRayleighColor, + v_atmosphereMieColor, + v_atmosphereOpacity + ); +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) + v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif + +#ifdef APPLY_MATERIAL + float northPoleZ = czm_ellipsoidRadii.z; + vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); + vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); + float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); + v_slope = acos(dotProd); + vec3 normalRejected = ellipsoidNormal * dotProd; + vec3 normalProjected = v_normalMC - normalRejected; + vec3 aspectVector = normalize(normalProjected); + v_aspect = acos(dot(aspectVector, vectorEastMC)); + float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); + v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); + v_height = height; +#endif +} +`;var mS=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { + + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + float atmosphereInnerRadius = length(positionWC); + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); +} +`;var jN=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var qN=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;var hS=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +vec3 getLightDirection(vec3 positionWC) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = + positionWC * float(lightEnum == 0.0) + + czm_lightDirectionWC * float(lightEnum == 1.0) + + czm_sunDirectionWC * float(lightEnum == 2.0); + return normalize(lightDirection); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var YN=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + vec3 lightDirection = getLightDirection(v_outerPositionWC); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_acesTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(color.rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + color.rgb = czm_HSBToRGB(hsb); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var XN=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + vec3 lightDirection = getLightDirection(positionWC.xyz); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;var KN=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var JN=`in vec3 position; + +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;var ZN=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var $N=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var QN=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;var eF=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;var prt=new H;function _rt(e,t){let n=e.unionClippingRegions,i=e.length,r=us.useFloatTexture(t),o=us.getTextureResolution(e,t,prt),s=o.x,a=o.y,c=r?xrt(s,a):brt(s,a);return c+=` +`,c+=n?grt(i):yrt(i),c}function grt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount; + float pixelWidth = czm_metersPerPixel(position); + bool breakAndDiscard = false; + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) + { + breakAndDiscard = true; + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; +} +`}function yrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + bool clipped = true; + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount = 0.0; + float pixelWidth = czm_metersPerPixel(position); + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + } + if (clipped) + { + discard; + } + return clipAmount; +} +`}function xrt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +`}function brt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); + return czm_transformPlane(plane, transform); +} +`}var B_=_rt;function Crt(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function _Y(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Trt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case ne.SCENE3D:r=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:r=n;break;case ne.MORPHING:r=i;break}return r}function Art(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}_Y.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,x=e.dynamicAtmosphereLighting,b=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,A=e.perFragmentGroundAtmosphere,T=e.hasVertexNormals,S=e.useWebMercatorProjection,v=e.enableFog,I=e.enableClippingPlanes,O=e.clippingPlanes,R=e.clippedByBoundaries,L=e.hasImageryLayerCutout,N=e.colorCorrect,_=e.highlightFillTile,E=e.colorToAlpha,w=e.hasGeodeticSurfaceNormals,P=e.hasExaggeration,M=e.showUndergroundColor,B=e.translucent,V=e.marsOptions||{},U=0,G="",Y=n.renderedMesh.encoding;Y.quantization===Us.BITS12&&(U=1,G="QUANTIZATION_BITS12");let J=0,W="";R&&(J=1,W="TILE_LIMIT_RECTANGLE");let K=0,Z="";L&&(K=1,Z="APPLY_IMAGERY_CUTOUT");let he=t.mode,ge=he|r<<2|o<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|h<<10|x<<11|b<<12|C<<13|A<<14|T<<15|S<<16|v<<17|U<<18|d<<19|I<<20|J<<21|K<<22|N<<23|_<<24|E<<25|w<<26|P<<27|M<<28|B<<29|f<<30,se=0;l(O)&&O.length>0&&(se=I?O.clippingPlanesState:0);let pe=n.surfaceShader;if(l(pe)&&pe.numberOfDayTextures===i&&pe.flags===ge&&pe.material===this.material&&pe.clippingShaderState===se)return pe.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(l(xe)||(xe=this._shadersByTexturesFlags[i]=[]),pe=xe[ge],V.enableClip||!l(pe)||pe.material!==this.material||pe.clippingShaderState!==se){let Pe=this.baseVertexShaderSource.clone(),we=this.baseFragmentShaderSource.clone();se!==0&&we.sources.unshift(B_(O,t.context)),V.enableClip&&we.defines.push("APPLY_MARS3D_CLIP"),V.enableUplift&&we.defines.push("APPLY_MARS3D_UPLIFT"),V.enableFlat&&Pe.defines.push("APPLY_MARS3D_FLAT"),Pe.defines.push(G),we.defines.push(`TEXTURE_UNITS ${i}`,W,Z),r&&we.defines.push("APPLY_BRIGHTNESS"),o&&we.defines.push("APPLY_CONTRAST"),s&&we.defines.push("APPLY_HUE"),a&&we.defines.push("APPLY_SATURATION"),c&&we.defines.push("APPLY_GAMMA"),V.invertColor&&we.defines.push("APPLY_INVERT_COLOR_MARS3D"),V.filterColor&&we.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&we.defines.push("APPLY_ALPHA"),f&&we.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(we.defines.push("SHOW_REFLECTIVE_OCEAN"),Pe.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&we.defines.push("SHOW_OCEAN_WAVES"),E&&we.defines.push("APPLY_COLOR_TO_ALPHA"),M&&(Pe.defines.push("UNDERGROUND_COLOR"),we.defines.push("UNDERGROUND_COLOR")),B&&(Pe.defines.push("TRANSLUCENT"),we.defines.push("TRANSLUCENT")),h&&(T?(Pe.defines.push("ENABLE_VERTEX_LIGHTING"),we.defines.push("ENABLE_VERTEX_LIGHTING")):(Pe.defines.push("ENABLE_DAYNIGHT_SHADING"),we.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Pe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),b&&(Pe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(Pe.defines.push("GROUND_ATMOSPHERE"),we.defines.push("GROUND_ATMOSPHERE"),A&&(Pe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),we.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Pe.defines.push("INCLUDE_WEB_MERCATOR_Y"),we.defines.push("INCLUDE_WEB_MERCATOR_Y"),v&&(Pe.defines.push("FOG"),we.defines.push("FOG")),d&&we.defines.push("APPLY_SPLIT"),I&&we.defines.push("ENABLE_CLIPPING_PLANES"),N&&we.defines.push("COLOR_CORRECT"),_&&we.defines.push("HIGHLIGHT_FILL_TILE"),w&&Pe.defines.push("GEODETIC_SURFACE_NORMALS"),P&&Pe.defines.push("EXAGGERATION");let Se=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;L&&(Se+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let Ze=0;Ze<i;++Ze)L?Se+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Ze}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:Se+=` color = sampleAndBlend( +`,Se+=` color, + u_dayTextures[${Ze}], + u_dayTextureUseWebMercatorT[${Ze}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${Ze}], + u_dayTextureTranslationAndScale[${Ze}], + ${u?`u_dayTextureAlpha[${Ze}]`:"1.0"}, + ${f?`u_dayTextureNightAlpha[${Ze}]`:"1.0"}, +${f?`u_dayTextureDayAlpha[${Ze}]`:"1.0"}, +${r?`u_dayTextureBrightness[${Ze}]`:"0.0"}, + ${o?`u_dayTextureContrast[${Ze}]`:"0.0"}, + ${s?`u_dayTextureHue[${Ze}]`:"0.0"}, + ${a?`u_dayTextureSaturation[${Ze}]`:"0.0"}, + ${c?`u_dayTextureOneOverGamma[${Ze}]`:"0.0"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${V.invertColor?`u_mars3dTextureInvertColor[${Ze}]`:"false"}, + ${V.filterColor?`u_mars3dTextureFilterColor[${Ze}]`:"vec3(1.0)"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${d?`u_dayTextureSplit[${Ze}]`:"0.0"}, + ${E?`u_colorsToAlpha[${Ze}]`:"vec4(0.0)"}, + nightBlend ); +`,L&&(Se+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);Se+=` return color; + }`,we.sources.push(Se),Pe.sources.push(Trt(he)),Pe.sources.push(Art(S));let nt=Jt.fromCache({context:t.context,vertexShaderSource:Pe,fragmentShaderSource:we,attributeLocations:Y.getAttributeLocations()});pe=xe[ge]=new Crt(i,ge,this.material,nt,se)}return n.surfaceShader=pe,pe.shaderProgram};_Y.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];if(!l(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var tF=_Y;var Ert={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},di=Object.freeze(Ert);var Srt={START:0,LOADING:1,DONE:2,FAILED:3},Vs=Object.freeze(Srt);var vrt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Cr=Object.freeze(vrt);function Qr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Cr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Qr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Cr.RECEIVING||e===Cr.TRANSFORMING),i=this.imagery;for(let r=0,o=i.length;n&&r<o;++r){let s=i[r];n=!l(s.loadingImagery)||s.loadingImagery.state!==di.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var wrt=new me;function gY(e,t,n,i,r,o){let s=e.getExaggeratedPosition(i,r,o);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,wrt);s=n.project(c,o),s=m.fromElements(s.z,s.x,s.y,o)}return s}var Irt=new m,Prt=new m,Drt=new m;Qr.prototype.pick=function(e,t,n,i,r){let o=this.renderedMesh;if(!l(o))return;let s=o.vertices,a=o.indices,c=o.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],h=a[d+2],x=gY(c,t,n,s,p,Irt),b=gY(c,t,n,s,g,Prt),C=gY(c,t,n,s,h,Drt),A=$i.rayTriangleParametric(e,x,b,C,i);l(A)&&A<f&&A>=0&&(f=A)}return f!==Number.MAX_VALUE?vn.getPoint(e,f,r):void 0};Qr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=Cr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Qr.prototype.freeVertexArray=function(){Qr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Qr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Qr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Qr),e.state===Vs.START&&(Rrt(e,t,n),e.state=Vs.LOADING)};Qr.processStateMachine=function(e,t,n,i,r,o,s){Qr.initialize(e,n,i);let a=e.data;if(e.state===Vs.LOADING&&Ort(e,t,n,i,r,o),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===Cr.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=Vs.DONE}c&&(e.renderable=!0)};Qr.prototype.processImagery=function(e,t,n,i){let r=e.data,o=e.upsampledFromParent,s=!1,a=!0,c=r.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){o=!1;continue}if(d.loadingImagery.state===di.PLACEHOLDER){let g=d.loadingImagery.imageryLayer,h=g.imageryProvider;if(g.ready&&(l(h._ready)?h._ready:!l(h.ready)||h.ready)){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else o=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),o=o&&l(d.loadingImagery)&&(d.loadingImagery.state===di.FAILED||d.loadingImagery.state===di.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(s||a),a};function dge(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=dc.clone(s);c.hasGeodeticSurfaceNormals=t,c=dc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(Qr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Qr._createVertexArrayForMesh(i.context,r)):(Qr._freeVertexArray(e.vertexArray),e.vertexArray=Qr._createVertexArrayForMesh(i.context,r)),Qr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Qr.prototype.addGeodeticSurfaceNormals=function(e,t){dge(this,!0,e,t)};Qr.prototype.removeGeodeticSurfaceNormals=function(e){dge(this,!1,void 0,e)};Qr.prototype.updateExaggeration=function(e,t,n){let i=this,r=i.renderedMesh;if(r===void 0)return;let o=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=o!==1,c=r.encoding,u=c.exaggeration!==o,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function Rrt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let r=e.parent,o=r.data;l(o)&&l(o.terrainData)&&(i=o.terrainData.isChildAvailable(r.x,r.y,e.x,e.y))}i===!1&&(e.data.terrainState=Cr.FAILED);for(let r=0,o=n.length;r<o;++r){let s=n.get(r);s.show&&s._createTileImagerySkeletons(e,t)}}function Ort(e,t,n,i,r,o){let s=e.data,a=e.parent;if(s.terrainState===Cr.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Qr.processStateMachine(a,t,n,i,r,o,!0)),s.terrainState===Cr.FAILED&&Mrt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Cr.UNLOADED&&Lrt(s,n,e.x,e.y,e.level),s.terrainState===Cr.RECEIVED&&Frt(s,t,n,e.x,e.y,e.level),s.terrainState===Cr.TRANSFORMED&&(Brt(s,t.context,n,e.x,e.y,e.level,o),s.updateExaggeration(e,t,r)),s.terrainState>=Cr.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Urt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Mrt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Vs.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,r,o,s);l(p)&&(e.terrainState=Cr.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=Cr.RECEIVED}).catch(function(){e.terrainState=Cr.FAILED}))}function Lrt(e,t,n,i,r){function o(c){e.terrainData=c,e.terrainState=Cr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ni.CANCELLED){e.terrainData=void 0,e.terrainState=Cr.UNLOADED,e.request=void 0;return}e.terrainState=Cr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Ti.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new jr({throttle:!1,throttleByServer:!0,type:$o.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=Cr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=Cr.UNLOADED,e.request=void 0)}a()}var Nrt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Frt(e,t,n,i,r,o){let s=n.tilingScheme,a=Nrt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=Cr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Cr.TRANSFORMED}).catch(function(){e.terrainState=Cr.FAILED}))}Qr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=mt.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{},s=o[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=mt.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Be.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,o[e.id]=s,t.indices.indexBuffers=o}else++s.referenceCount;return new si({context:e,attributes:r,indexBuffer:s})};Qr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Brt(e,t,n,i,r,o,s){e.vertexArray=Qr._createVertexArrayForMesh(t,e.mesh),e.terrainState=Cr.READY,e.fill=e.fill&&e.fill.destroy(s)}function krt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Lt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Xe.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.LINEAR,magnificationFilter:Ai.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Urt(e,t){let n=t.terrainData.waterMask,i=krt(e),r,o=n.length;if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Lt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Xe.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Qr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Qr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,r=e.rectangle,o=r.width,s=r.height,a=o/i.width,c=s/i.height;return n.x=a*(r.west-i.west)/o,n.y=c*(r.south-i.south)/s,n.z=a,n.w=c,n};var zf=Qr;var M4,mge="AAPKac82a6d80f1340a4aa9587f789d07e96a_Jj1a4fbA59cggYHArDizxxA2U4QDofLUm36VivpUsSRyK7O1JjRPwy916Y-7ld",pS={};pS.defaultAccessToken=mge;pS.defaultWorldImageryServer=new Ie({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});pS.defaultWorldHillshadeServer=new Ie({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});pS.defaultWorldOceanServer=new Ie({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});pS.getDefaultTokenCredit=function(e){if(e===mge){if(!l(M4)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';M4=new vt(t,!0),M4._isDefaultToken=!0}return M4}};var Lu=pS;function yY(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ie.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=sd(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}yY.prototype.isReady=function(){return this._isReady};yY.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=sd(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var nF=yY;function xY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}xY.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};xY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var ym=xY;function _S(){fe.throwInstantiationError()}Object.defineProperties(_S.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});_S.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};_S.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};_S.prototype.pickFeatures=function(e,t,n,i,r){fe.throwInstantiationError()};var Vrt=/\.ktx2$/i;_S.loadImage=function(e,t){let n=Ie.createIfNeeded(t);return Vrt.test(n.url)?ll(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var $c=_S;var zrt={SATELLITE:1,OCEANS:2,HILLSHADE:3},xm=Object.freeze(zrt);function bY(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new ji({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new vt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}bY.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new nF({missingImageUrl:pge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Hrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Bo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new ji({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ri,r=e.fullExtent,o=i.unproject(new m(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new vt(e.copyrightText)]:t.credit=new vt(e.copyrightText))}function Grt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function hge(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let r=await i.fetchJson();Hrt(r,t)}catch(r){Grt(e,r,n)}}function Dh(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new ji({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new vt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=Ie.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,l(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new bY(e);i.useTiles?this._readyPromise=hge(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}Dh.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,r;switch(e){case xm.SATELLITE:{n=y(t.token,Lu.defaultAccessToken),i=Ie.createIfNeeded(y(t.url,Lu.defaultWorldImageryServer)),i.appendForwardSlash();let o=Lu.getDefaultTokenCredit(n);l(o)&&(r=vt.clone(o))}break;case xm.OCEANS:{n=y(t.token,Lu.defaultAccessToken),i=Ie.createIfNeeded(y(t.url,Lu.defaultWorldOceanServer)),i.appendForwardSlash();let o=Lu.getDefaultTokenCredit(n);l(o)&&(r=vt.clone(o))}break;case xm.HILLSHADE:{n=y(t.token,Lu.defaultAccessToken),i=Ie.createIfNeeded(y(t.url,Lu.defaultWorldHillshadeServer)),i.appendForwardSlash();let o=Lu.getDefaultTokenCredit(n);l(o)&&(r=vt.clone(o))}break;default:}return Dh.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function pge(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Pi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(Dh.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Dh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ie.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Dh(t);i._resource=n;let r=new bY(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await hge(n,r),r.build(i),i._readyPromise=Promise.resolve(!0),i};Dh.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Dh.prototype.requestImage=function(e,t,n,i){return $c.loadImage(this,pge(this,e,t,n,i))};Dh.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Pi)s=D.toDegrees(i),a=D.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!l(h))return g;for(let x=0;x<h.length;++x){let b=h[x],C=new ym;if(C.data=b,C.name=b.value,C.properties=b.attributes,C.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let A=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(A===4326||A===4283)C.position=me.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(A===102100||A===900913||A===3857){let T=new Ri;C.position=T.unproject(new m(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(C)}return g})};Dh._metadataCache={};var Rh=Dh;var Wrt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},gS=Object.freeze(Wrt);function iF(e){}iF.prototype.isReady=function(){return!0};iF.prototype.shouldDiscardImage=function(e){return iF.EMPTY_IMAGE===e};var L4;Object.defineProperties(iF,{EMPTY_IMAGE:{get:function(){return l(L4)||(L4=new Image,L4.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),L4}}});var yS=iF;function CY(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}CY.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof vt)break;r.credit=new vt(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ce(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}e._ready=!0};function jrt(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function qrt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function _ge(e,t,n){let i=e.url,r=xs._metadataCache[i];l(r)||(r=e.fetchJsonp("jsonp"),xs._metadataCache[i]=r);try{let o=await r;return jrt(o,t)}catch(o){qrt(e,o,n)}}function xs(e){if(e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,gS.AERIAL),this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new yS),this._proxy=e.proxy,this._credit=new vt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${xs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;l(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=Ie.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),r=new CY(e);this._readyPromise=_ge(i,r,this).then(()=>(r.build(this),!0))}}Object.defineProperties(xs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,gS.AERIAL),r=Ie.createIfNeeded(e);r.appendForwardSlash();let o=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new xs(t);s._resource=r;let a=new CY(t);return await _ge(o,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var Yrt=new ce;xs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Yrt);return Jrt(this._attributionList,n,i)};xs.prototype.requestImage=function(e,t,n,i){let r=$c.loadImage(this,Xrt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?yS.EMPTY_IMAGE:Promise.reject(o)})};xs.prototype.pickFeatures=function(e,t,n,i,r){};xs.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;e&o&&(s|=1),t&o&&(s|=2),i+=s}return i};xs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];s&1&&(t|=o),s&2&&(n|=o)}return{x:t,y:n,level:i}};xs._logoUrl=void 0;Object.defineProperties(xs,{logoUrl:{get:function(){return l(xs._logoUrl)||(xs._logoUrl=tn("Assets/Images/bing_maps_credit.png")),xs._logoUrl},set:function(e){xs._logoUrl=e}}});function Xrt(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:xs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Krt=new ce;function Jrt(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,Krt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}xs._metadataCache={};var xS=xs;var gge=/{[^}]+}/g,EY={x:Qrt,y:tot,z:rot,s:oot,reverseX:eot,reverseY:not,reverseZ:iot,westDegrees:sot,southDegrees:aot,eastDegrees:cot,northDegrees:lot,westProjected:uot,southProjected:fot,eastProjected:dot,northProjected:mot,width:hot,height:pot},yge=gt(EY,{i:_ot,j:got,reverseI:yot,reverseJ:xot,longitudeDegrees:Cot,latitudeDegrees:Tot,longitudeProjected:Aot,latitudeProjected:Eot,format:vot});function cC(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,l(e.then)){this._reinitialize(e);return}let t=Ie.createIfNeeded(e.url),n=Ie.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Bo({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new vt(r)),this._credit=r,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let o=e.customTags,s=gt(EY,o),a=gt(yge,o);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(cC.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready&&l(this._resource)}},readyPromise:{get:function(){return Q("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});cC.prototype.reinitialize=function(e){return Q("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._reinitialize(e)};cC.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,r=gt(EY,i),o=gt(yge,i),s=Ie.createIfNeeded(n.url),a=Ie.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new Bo({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new vt(c)),t._credit=c,t._resource=s,t._tags=r,t._pickFeaturesResource=a,t._pickFeaturesTags=o,t._ready=!0,!0})};cC.prototype.getTileCredits=function(e,t,n){};cC.prototype.requestImage=function(e,t,n,i){return $c.loadImage(this,Zrt(this,e,t,n,i))};cC.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=$rt(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var N4=!1,Nu=new ce,F4=!1,rF=new ce;function Zrt(e,t,n,i,r){N4=!1,F4=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(gge);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var TY=!1,CS=new H,AY=!1;function $rt(e,t,n,i,r,o,s){N4=!1,F4=!1,TY=!1,AY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(gge);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function TS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Qrt(e,t,n,i){return TS(e,"{x}",t)}function eot(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return TS(e,"{reverseX}",r)}function tot(e,t,n,i){return TS(e,"{y}",n)}function not(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return TS(e,"{reverseY}",r)}function iot(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return TS(e,"{reverseZ}",o)}function rot(e,t,n,i){return TS(e,"{z}",i)}function oot(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function B4(e,t,n,i){N4||(e.tilingScheme.tileXYToRectangle(t,n,i,Nu),Nu.west=D.toDegrees(Nu.west),Nu.south=D.toDegrees(Nu.south),Nu.east=D.toDegrees(Nu.east),Nu.north=D.toDegrees(Nu.north),N4=!0)}function sot(e,t,n,i){return B4(e,t,n,i),Nu.west}function aot(e,t,n,i){return B4(e,t,n,i),Nu.south}function cot(e,t,n,i){return B4(e,t,n,i),Nu.east}function lot(e,t,n,i){return B4(e,t,n,i),Nu.north}function k4(e,t,n,i){F4||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,rF),F4=!0)}function uot(e,t,n,i){return k4(e,t,n,i),rF.west}function fot(e,t,n,i){return k4(e,t,n,i),rF.south}function dot(e,t,n,i){return k4(e,t,n,i),rF.east}function mot(e,t,n,i){return k4(e,t,n,i),rF.north}function hot(e,t,n,i){return e.tileWidth}function pot(e,t,n,i){return e.tileHeight}function _ot(e,t,n,i,r,o,s){return U4(e,t,n,i,r,o),CS.x}function got(e,t,n,i,r,o,s){return U4(e,t,n,i,r,o),CS.y}function yot(e,t,n,i,r,o,s){return U4(e,t,n,i,r,o),e.tileWidth-CS.x-1}function xot(e,t,n,i,r,o,s){return U4(e,t,n,i,r,o),e.tileHeight-CS.y-1}var bot=new ce,bS=new m;function U4(e,t,n,i,r,o,s){if(TY)return;SY(e,t,n,i,r,o);let a=bS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,bot);CS.x=e.tileWidth*(a.x-c.west)/c.width|0,CS.y=e.tileHeight*(c.north-a.y)/c.height|0,TY=!0}function Cot(e,t,n,i,r,o,s){return D.toDegrees(r)}function Tot(e,t,n,i,r,o,s){return D.toDegrees(o)}function Aot(e,t,n,i,r,o,s){return SY(e,t,n,i,r,o),bS.x}function Eot(e,t,n,i,r,o,s){return SY(e,t,n,i,r,o),bS.y}var Sot=new me;function SY(e,t,n,i,r,o,s){if(!AY){if(e.tilingScheme.projection instanceof Pi)bS.x=D.toDegrees(r),bS.y=D.toDegrees(o);else{let a=Sot;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,bS)}AY=!0}}function vot(e,t,n,i,r,o,s){return s}var zs=cC;function Fu(e){if(e=y(e,y.EMPTY_OBJECT),l(e.url)){Q("TileMapServiceImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use TileMapServiceImageryProvider.fromUrl instead."),this._metadataError=void 0,this._ready=!1;let t,n=this,i=Promise.resolve(e.url).then(function(r){return t=Ie.createIfNeeded(r),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),Fu._requestMetadata(e,n._tmsResource,n._xmlResource,n)}).catch(r=>Promise.reject(r));zs.call(this,i),this._promise=i}}Fu._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Fu._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof Rm)return Fu._metadataFailure(e,t);throw r}};Fu.fromUrl=async function(e,t){let n=Ie.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let o=await Fu._requestMetadata(t,i,r),s=new Fu;return zs.call(s,o),s};l(Object.create)&&(Fu.prototype=Object.create(zs.prototype),Fu.prototype.constructor=Fu);function xge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function bge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),r=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Fu._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let L=g.item(R).childNodes;for(let N=0;N<L.length;N++)s.test(L.item(N).nodeName)&&p.push(L.item(N))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let h;if(!l(d)||!l(f))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&Ti.reportError(void 0,r,r.errorEvent,h),new de(h);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),A=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),T=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(S==="geodetic"||S==="global-geodetic")v=new ji({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new Bo({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(r)&&Ti.reportError(void 0,r,r.errorEvent,h),new de(h);let I=ce.clone(t.rectangle);if(!l(I)){let R,L,N,_;y(t.flipXY,!1)?(N=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=S==="geodetic"||S==="mercator";if(v.projection instanceof Pi||w)R=me.fromDegrees(N.x,N.y),L=me.fromDegrees(_.x,_.y);else{let P=v.projection;R=P.unproject(N),L=P.unproject(_)}I=new ce(R.longitude,R.latitude,L.longitude,L.latitude)}return I=xge(I,v),A=bge(v,I,A),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:I,tileWidth:b,tileHeight:C,minimumLevel:A,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Fu._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),r=y(e.tileHeight,256),o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Bo({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=xge(a,s);let c=bge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Oh=Fu;function vY(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}vY.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function wot(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new de(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new de(r)}return!0}function Iot(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function Cge(e,t,n){try{let i=await e.fetchText();wot(i,t)}catch(i){Iot(i,e,n)}}function Bl(e){if(e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new vt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Bl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new _e,l(e.url)||l(e.channel)){Q("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=Ie.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=new vY(e);this._readyPromise=Cge(r,o,this).then(()=>(o.build(this),this._ready=!0,!0))}}Object.defineProperties(Bl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Bl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),r=Ie.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new vY(n);s.channel=t,await Cge(o,s);let a=new Bl(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=r,a._url=e,a._path=i,a};Bl.prototype.getTileCredits=function(e,t,n){};Bl.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return $c.loadImage(this,r)};Bl.prototype.pickFeatures=function(e,t,n,i,r){};Bl._logoUrl=void 0;Object.defineProperties(Bl,{logoUrl:{get:function(){return l(Bl._logoUrl)||(Bl._logoUrl=tn("Assets/Images/google_earth_credit.png")),Bl._logoUrl},set:function(e){Bl._logoUrl=e}}});var AS=Bl;var Pot=/\/$/,Tge=new vt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ES(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ie.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=y(e.format,"png");/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Pot.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new vt(s))):s=Tge,this._resource=i,this._imageryProvider=new zs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(ES.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ES.prototype.getTileCredits=function(e,t,n){};ES.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ES.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};ES._defaultCredit=Tge;var SS=ES;function lC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new ji({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new _e,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new vt(i)),this._credit=i;let r=Ie.createIfNeeded(e.url);if(this._resource=r,l(e.tileWidth)||l(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}Q("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=V4(r,this).then(o=>(Ti.reportSuccess(this._errorEvent),this._image=o,this._tileWidth=o.width,this._tileHeight=o.height,this._ready=!0,!0))}Object.defineProperties(lC.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function Dot(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Ti.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return V4(e,n,o);throw l(n)&&(n._hasError=!0),new de(r)}async function V4(e,t,n){try{return await $c.loadImage(null,e)}catch(i){return Dot(e,i,t,n)}}lC.fromUrl=async function(e,t){let n=Ie.createIfNeeded(e),i=await V4(n);t=y(t,y.EMPTY_OBJECT);let r=new lC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};lC.prototype.getTileCredits=function(e,t,n){};lC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await V4(this._resource,this);return this._image=r,Ti.reportSuccess(this._errorEvent),r}return this._image};lC.prototype.pickFeatures=function(e,t,n,i,r){};var vS=lC;function Rot(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Oot:e==="xml"?n=Fot:(e==="html"||e==="text")&&(n=Age)),this.callback=n}function Oot(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new ym;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=me.fromDegrees(s,a)}t.push(o)}return t}var wY="http://www.mapinfo.com/mxp",Mot="http://www.esri.com/wms",Lot="http://www.opengis.net/wfs",Not="http://www.opengis.net/gml";function Fot(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===wY)return Bot(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Mot)return kot(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Lot)return Uot(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Vot(e):zot(e)}function Bot(e){let t=[],i=e.documentElement.getElementsByTagNameNS(wY,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(wY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new ym;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function kot(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(z4(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(z4(a,i))}}return n}function Uot(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Not,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};IY(o,s),t.push(z4(o,s))}return t}function Vot(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new de("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};IY(s,a),t.push(z4(s,a))}}return t}function IY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&IY(r,t)&&(t[r.localName]=r.textContent)}return n}function z4(e,t){let n=new ym;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function zot(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new ym;return r.data=e,r.description=n.innerHTML,[r]}var Hot=/<body>\s*<\/body>/im,Got=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Wot=/<title>([\s\S]*)<\/title>/im;function Age(e){if(Hot.test(e)||Got.test(e))return;let t,n=Wot.exec(e);n&&n.length>1&&(t=n[1]);let i=new ym;return i.name=t,i.description=e,i.data=e,[i]}var uC=Rot;function oF(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(oF.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});oF.prototype.getFromCache=function(e,t,n,i){let r=Ege(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};oF.prototype.checkApproachingInterval=function(e,t,n,i){let r=Ege(e,t,n),o=this._tilesRequestedForInterval,s=Sge(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!vge(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};oF.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=Sge(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=vge(this,c,o),a||s.push(c)}}};function Ege(e,t,n){return`${e}-${t}-${n}`}function jot(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Sge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function vge(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=jot(s),c=new jr({throttle:!1,throttleByServer:!0,type:$o.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var fC=oF;var qot=[3034,3035,3042,3043,3044],Yot=[4471,4559];function bm(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Ie.createIfNeeded(e.url),n=Ie.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(bm.DefaultParameters,!0),n.setQueryParameters(bm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(wge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(wge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Ige(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Ri?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Yot.includes(a)||qot.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Ri?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new zs({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new ji({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,bm.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function Ige(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Xot(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(bm.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return Q("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return Q("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});bm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};bm.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Ige(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};bm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Xot(this,e,t,n,i,r,s)};bm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});bm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});bm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new uC("json","application/json")),Object.freeze(new uC("xml","text/xml")),Object.freeze(new uC("text","text/html"))]);function wge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var wS=bm;var Kot=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function sF(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ie.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!l(o)||o.length===1&&/{s}/.test(r))t.setQueryParameters(Kot),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Bo({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fC({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,x){return Pge(s,d,p,g,h,x)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new _e;let f=e.credit;this._credit=typeof f=="string"?new vt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Pge(e,t,n,i,r,o){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(o)?o.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=gt(g,u)),l(f)&&(g=gt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:r}),d.setTemplateValues(p)}return $c.loadImage(e,d)}Object.defineProperties(sF.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return Q("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});sF.prototype.getTileCredits=function(e,t,n){};sF.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Pge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};sF.prototype.pickFeatures=function(e,t,n,i,r){};var IS=sF;function k_(e){return function(t){return new e(t)}}var Jot={ARCGIS_MAPSERVER:k_(Rh),BING:k_(xS),GOOGLE_EARTH:k_(AS),MAPBOX:k_(SS),SINGLE_TILE:k_(vS),TMS:k_(Oh),URL_TEMPLATE:k_(zs),WMS:k_(wS),WMTS:k_(IS)},Zot={ARCGIS_MAPSERVER:Rh.fromUrl,BING:async(e,t)=>xS.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,AS.fromUrl(e,n,t)},MAPBOX:(e,t)=>new SS({url:e,...t}),SINGLE_TILE:vS.fromUrl,TMS:Oh.fromUrl,URL_TEMPLATE:(e,t)=>new zs({url:e,...t}),WMS:(e,t)=>new wS({url:e,...t}),WMTS:(e,t)=>new IS({url:e,...t})};function kl(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new _e;let t=e.assetId;l(t)&&(Q("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),kl._initialize(this,t,e))}Object.defineProperties(kl.prototype,{ready:{get:function(){return Q("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return Q("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});kl._initialize=function(e,t,n){let i=Zs._createEndpointResource(t,n),r=t.toString()+n.accessToken+n.server,o=kl._endpointCache[r];l(o)||(o=i.fetchJson(),kl._endpointCache[r]=o),e._readyPromise=o.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new Oh({url:new Zs(s,i)});else{let u=Jot[c];if(!l(u))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return e._tileCredits=Zs.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=e,e._errorEvent.raiseEvent(u)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};kl.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Zs._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=kl._endpointCache[i];l(r)||(r=n.fetchJson(),kl._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=o.externalType;if(!l(a))s=await Oh.fromUrl(new Zs(o,n));else{let u=Zot[a];if(!l(u))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...o.options},d=f.url;delete f.url,s=await u(d,f)}let c=new kl(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Zs.getCreditsFromEndpoint(o,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};kl.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};kl.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};kl.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};kl._endpointCache={};var Hf=kl;var $ot={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Cm=Object.freeze($ot);function Qot(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Cm.AERIAL);return Hf.fromAssetId(t)}var U_=Qot;function PS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let s=t/2|0,a=n/2|0,c=i-1;this.parent=e.getImageryFromCache(s,a,c)}this.state=di.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0;let o=e.imageryProvider;!l(r)&&e.ready&&(l(o._ready)?o._ready:!l(o.ready)||o.ready)&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}PS.createPlaceholder=function(e){let t=new PS(e,0,0,0);return t.addReference(),t.state=di.PLACEHOLDER,t};PS.prototype.addReference=function(){++this.referenceCount};PS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};PS.prototype.processStateMachine=function(e,t,n){this.state===di.UNLOADED&&!n&&(this.state=di.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===di.RECEIVED&&(this.state=di.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===di.READY&&t&&!this.texture;(this.state===di.TEXTURE_LOADED||i)&&(this.state=di.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var DS=PS;function PY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}PY.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};PY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===di.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==di.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==di.FAILED&&o.state!==di.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===di.FAILED||i.state===di.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var RS=PY;function pi(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,pi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,pi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,pi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,pi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,pi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,pi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,pi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,pi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new RS(DS.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(pi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});pi.DEFAULT_BRIGHTNESS=1;pi.DEFAULT_CONTRAST=1;pi.DEFAULT_HUE=0;pi.DEFAULT_SATURATION=1;pi.DEFAULT_GAMMA=1;pi.DEFAULT_SPLIT=Uc.NONE;pi.DEFAULT_MINIFICATION_FILTER=ln.LINEAR;pi.DEFAULT_MAGNIFICATION_FILTER=Ai.LINEAR;pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;pi.fromProviderAsync=function(e,t){let n=new pi(void 0,t);return rst(n,Promise.resolve(e)),n};pi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),pi.fromProviderAsync(U_({style:e.style}),e)};pi.prototype.isBaseLayer=function(){return this._isBaseLayer};pi.prototype.isDestroyed=function(){return!1};pi.prototype.destroy=function(){return ue(this)};var Oge=new ce,Dge=new ce,DY=new ce,Mge=new ce;pi.prototype.getViewableRectangle=async function(){Q("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,ce.intersection(e.rectangle,t)};pi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};pi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready||(l(r._ready)?!r._ready:l(r.ready)&&!r.ready))return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof Ri&&e.rectangle.north<Ri.MaximumLatitude&&e.rectangle.south>-Ri.MaximumLatitude,s=ce.intersection(r.rectangle,this._rectangle,Oge),a=ce.intersection(e.rectangle,s,Dge);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=Dge,P.south>=w.north?a.north=a.south=w.north:P.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(P.south,w.south),a.north=Math.min(P.north,w.north)),P.west>=w.east?a.west=a.east=w.east:P.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(P.west,w.west),a.east=Math.min(P.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=nst(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),x=g.positionToTileXY(ce.southeast(a),d),b=e.rectangle.width/512,C=e.rectangle.height/512,A=g.tileXYToRectangle(h.x,h.y,d);Math.abs(A.south-e.rectangle.north)<C&&h.y<x.y&&++h.y,Math.abs(A.east-e.rectangle.west)<b&&h.x<x.x&&++h.x;let T=g.tileXYToRectangle(x.x,x.y,d);Math.abs(T.north-e.rectangle.south)<C&&x.y>h.y&&--x.y,Math.abs(T.west-e.rectangle.east)<b&&x.x>h.x&&--x.x;let S=ce.clone(e.rectangle,Mge),v=g.tileXYToRectangle(h.x,h.y,d),I=ce.intersection(v,s,DY),O;o?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),O=g.tileXYToNativeRectangle.bind(g),b=S.width/512,C=S.height/512):O=g.tileXYToRectangle.bind(g);let R,L=0,N=1,_;!this.isBaseLayer()&&Math.abs(I.west-S.west)>=b&&(L=Math.min(1,(I.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(I.north-S.north)>=C&&(N=Math.max(0,(I.north-S.south)/S.height));let E=N;for(let w=h.x;w<=x.x;w++)if(R=L,v=O(w,h.y,d),I=ce.simpleIntersection(v,s,DY),!!l(I)){L=Math.min(1,(I.east-S.west)/S.width),w===x.x&&(this.isBaseLayer()||Math.abs(I.east-S.east)<b)&&(L=1),N=E;for(let P=h.y;P<=x.y;P++){if(_=N,v=O(w,P,d),I=ce.simpleIntersection(v,s,DY),!l(I))continue;N=Math.max(0,(I.south-S.south)/S.height),P===x.y&&(this.isBaseLayer()||Math.abs(I.south-S.south)<C)&&(N=0);let M=new oe(R,N,L,_),B=this.getImageryFromCache(w,P,d);i.imagery.splice(n,0,new RS(B,M,o)),++n}}return!0};pi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Oge),i=c.rectangleToNativeRectangle(i,Mge)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new oe(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};pi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=di.RECEIVED,e.request=void 0,Ti.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function r(s){if(e.request.state===ni.CANCELLED){e.state=di.UNLOADED,e.request=void 0;return}e.state=di.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Ti.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function o(){let s=new jr({throttle:!1,throttleByServer:!0,type:$o.IMAGERY});e.request=s,e.state=di.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=di.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){r(c)}):i(a)}o()};pi.prototype._createTextureWebGL=function(e,t){let n=new mn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Lt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Lt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ct.RGBA:ct.RGB,sampler:n})};pi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=di.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=di.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ri?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=di.TEXTURE_LOADED};function Rge(e,t,n){return`${e}:${t}:${n}`}pi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===ln.LINEAR&&i===Ai.LINEAR&&!ct.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=ln.LINEAR_MIPMAP_LINEAR;let o=Ht.maximumTextureFilterAnisotropy,s=Math.min(o,y(this._maximumAnisotropy,o)),a=Rge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Fm.NICEST),t.sampler=u}else{let o=Rge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};pi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Pi)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new ef({persists:!0,owner:this,preExecute:function(c){tst(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=di.READY,t.releaseReference()},canceled:function(){t.state=di.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=di.READY};pi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};pi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};pi.prototype.getImageryFromCache=function(e,t,n,i){let r=Lge(e,t,n),o=this._imageryCache[r];return l(o)||(o=new DS(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};pi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=Lge(e.x,e.y,e.level);delete this._imageryCache[t]};function Lge(e,t,n){return JSON.stringify([e,t,n])}var H4={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},est=Wt.supportsTypedArrays()?new Float32Array(2*64):void 0;function tst(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let O=I/63;b[C++]=0,b[C++]=O,b[C++]=1,b[C++]=O}let A={position:0,webMercatorT:1},T=Xo.getRegularGridIndices(2,64),S=mt.createIndexBuffer({context:t,typedArray:T,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT});r.vertexArray=new si({context:t,attributes:[{index:A.position,vertexBuffer:mt.createVertexBuffer({context:t,typedArray:b,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:A.webMercatorT,vertexBuffer:mt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new ze({sources:[qN]});r.shaderProgram=Jt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:jN,attributeLocations:A}),r.sampler=new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.LINEAR,magnificationFilter:Ai.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;H4.textureDimensions.x=o,H4.textureDimensions.y=s,H4.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Lt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(o)&&D.isPowerOfTwo(s)&&d.generateMipmap(Fm.NICEST);let p=i.south,g=i.north,h=est,x=0;for(let b=0;b<64;++b){let C=b/63,A=D.lerp(p,g,C);a=Math.sin(A);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[x++]=S,h[x++]=S}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=H4,e.vertexArray=r.vertexArray}function nst(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Pi?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function ist(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function rst(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){ist(e._errorEvent,i)}}var Hs=pi;var Nge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Nge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},ei=Nge;function MS(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}MS.prototype.update=function(e,t,n){this.changedThisFrame&&(Hge(e,t,this.tile,n),this.changedThisFrame=!1)};MS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};MS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):zf._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var ost=new iy;MS.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=ost;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);bs(e,n,c,u,s,yn.EAST,!1,a,i),bs(e,n,c,f,s,yn.NORTH,!1,a,i),bs(e,n,c,d,s,yn.WEST,!1,a,i),bs(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),h=u.findTileToSouth(o),x=d.findTileToNorth(o),b=d.findTileToSouth(o);bs(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),bs(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),bs(e,n,c,h,s,yn.NORTHEAST,!1,a,i),bs(e,n,c,b,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function bs(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||ei.wasKicked(u._lastSelectionResult)||ei.originalResult(u._lastSelectionResult)===ei.CULLED);){if(s)return;let f=u.parent;if(o>=yn.NORTHWEST&&f!==void 0)switch(o){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===ei.RENDERED){if(l(u.data.vertexArray))return;sst(e,t,n,u,o,r,a,c);return}if(ei.originalResult(i._lastSelectionResult)!==ei.CULLED)switch(o){case yn.WEST:bs(e,t,n,i.northwestChild,r,o,!0,a,c),bs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.EAST:bs(e,t,n,i.southeastChild,r,o,!0,a,c),bs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTH:bs(e,t,n,i.southwestChild,r,o,!0,a,c),bs(e,t,n,i.southeastChild,r,o,!0,a,c);break;case yn.NORTH:bs(e,t,n,i.northeastChild,r,o,!0,a,c),bs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHWEST:bs(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHEAST:bs(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTHWEST:bs(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.SOUTHEAST:bs(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new fe("Invalid edge")}}}function sst(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new MS(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),ast(e,t,n,i,r,a)}function ast(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Hge(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,h,x=n.rectangle,b,C=i.rectangle;switch(r){case yn.WEST:for(b=(C.north-C.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!D.greaterThan(x.north,h.south,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!D.greaterThanOrEquals(x.south,h.north,b));++p);break;case yn.SOUTH:for(b=(C.east-C.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!D.lessThan(x.west,h.east,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!D.lessThanOrEquals(x.east,h.west,b));++p);break;case yn.EAST:for(b=(C.north-C.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!D.lessThan(x.south,h.north,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!D.lessThanOrEquals(x.north,h.south,b));++p);break;case yn.NORTH:for(b=(C.east-C.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!D.greaterThan(x.east,h.west,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!D.greaterThanOrEquals(x.west,h.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var dC=new me,cst=new me,OS=new m,LY=new m,RY=new H,OY=new H,Bu=new H;function K4(){this.height=0,this.encodedNormal=new H}function G4(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return Gge(e,t,n,i,u,c),c}var lst={minimumHeight:0,maximumHeight:0},ust=new m,Fge=new K4,Bge=new K4,kge=new K4,Uge=new K4,fst=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,dst={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Hge(e,t,n,i){zf.initialize(n,e.terrainProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=j4(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,kge),p=j4(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,Fge),g=j4(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,Bge),h=j4(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Uge);d=G4(o,f,0,1,d,p,h,g,kge),p=G4(o,f,0,0,p,d,g,h,Fge),g=G4(o,f,1,1,g,p,h,d,Bge),h=G4(o,f,1,1,h,g,d,p,Uge);let x=p.height,b=g.height,C=d.height,A=h.height,T=Math.min(x,b,C,A),S=Math.max(x,b,C,A),v=(T+S)*.5,I,O,R=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-R,N=Math.acos(L/f.maximumRadius)*4;if(N*=1.5,s.width>N&&S-T<=R){let w=new Ia({width:9,height:9,buffer:fst,structure:{heightOffset:S}}),P=dst;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=a,P.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(P)}else{let w=u,P=ce.center(s,cst);P.height=v;let M=f.cartographicToCartesian(P,ust),B=new dc(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,U;for(U=o.westMeshes,I=0,O=U.length;I<O;++I)V+=U[I].eastIndicesNorthToSouth.length;for(U=o.southMeshes,I=0,O=U.length;I<O;++I)V+=U[I].northIndicesWestToEast.length;for(U=o.eastMeshes,I=0,O=U.length;I<O;++I)V+=U[I].westIndicesSouthToNorth.length;for(U=o.northMeshes,I=0,O=U.length;I<O;++I)V+=U[I].southIndicesEastToWest.length;let G=lst;G.minimumHeight=T,G.maximumHeight=S;let k=B.stride,Y=new Float32Array(V*k),j=0,J=j;j=W4(f,s,B,Y,j,0,1,d.height,d.encodedNormal,1,G),j=Y4(o,f,B,Y,j,o.westTiles,o.westMeshes,yn.EAST,G);let W=j;j=W4(f,s,B,Y,j,0,0,p.height,p.encodedNormal,0,G),j=Y4(o,f,B,Y,j,o.southTiles,o.southMeshes,yn.NORTH,G);let K=j;j=W4(f,s,B,Y,j,1,0,g.height,g.encodedNormal,0,G),j=Y4(o,f,B,Y,j,o.eastTiles,o.eastMeshes,yn.WEST,G);let Z=j;j=W4(f,s,B,Y,j,1,1,h.height,h.encodedNormal,1,G),j=Y4(o,f,B,Y,j,o.northTiles,o.northMeshes,yn.SOUTH,G),T=G.minimumHeight,S=G.maximumHeight;let he=On.fromRectangle(s,T,S,n.tilingScheme.ellipsoid),ge=Ri.geodeticLatitudeToMercatorAngle(s.south),se=1/(Ri.geodeticLatitudeToMercatorAngle(s.north)-ge),pe=(Ri.geodeticLatitudeToMercatorAngle(P.latitude)-ge)*se,xe=f.geodeticSurfaceNormalCartographic(dC,LY),Pe=Xn.octEncode(xe,RY),we=j;B.encode(Y,j*k,he.center,H.fromElements(.5,.5,Bu),v,Pe,pe,xe),++j;let Se=j,nt=Se<256?1:2,Ze=(Se-1)*3,Gt=Ze*nt,fn=(Y.length-Se*k)*Float32Array.BYTES_PER_ELEMENT,pt;if(fn>=Gt){let ve=Se*k*Float32Array.BYTES_PER_ELEMENT;pt=Se<256?new Uint8Array(Y.buffer,ve,Ze):new Uint16Array(Y.buffer,ve,Ze)}else pt=Se<256?new Uint8Array(Ze):new Uint16Array(Ze);Y=new Float32Array(Y.buffer,0,Se*k);let Tn=0;for(I=0;I<Se-2;++I)pt[Tn++]=we,pt[Tn++]=I,pt[Tn++]=I+1;pt[Tn++]=we,pt[Tn++]=I,pt[Tn++]=0;let Vn=[];for(I=W;I>=J;--I)Vn.push(I);let Ut=[];for(I=K;I>=W;--I)Ut.push(I);let Pt=[];for(I=Z;I>=K;--I)Pt.push(I);let Ce=[];for(Ce.push(0),I=we-1;I>=Z;--I)Ce.push(I);o.mesh=new kf(B.center,Y,pt,Ze,Se,T,S,ae.fromOrientedBoundingBox(he),xst(e,he.center,s,T,S),B.stride,he,B,Vn,Ut,Pt,Ce)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=zf._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let E=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function W4(e,t,n,i,r,o,s,a,c,u,f){let d=dC;d.longitude=D.lerp(t.west,t.east,o),d.latitude=D.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,OS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,LY));let h=OY;return h.x=o,h.y=s,n.encode(i,r*n.stride,p,h,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var X4=new ce;function aF(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ce.clone(e.rectangle,X4),r.west-=D.TWO_PI,r.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ce.clone(e.rectangle,X4),r.west+=D.TWO_PI,r.east+=D.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var mst=new H;function MY(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var hst=new H,pst=new m;function _st(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=aF(t,n,f.decodeTextureCoordinates(d,r,Bu),Bu),g=aF(t,n,f.decodeTextureCoordinates(d,o,OY),OY),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,r),b=f.decodeHeight(d,o),C=n.rectangle;dC.longitude=D.lerp(C.west,C.east,s),dC.latitude=D.lerp(C.south,C.north,a),u.height=dC.height=D.lerp(x,b,h);let A;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,mst),S=f.getOctEncodedNormal(d,o,hst),v=Xn.octDecode(T.x,T.y,OS),I=Xn.octDecode(S.x,S.y,pst);A=m.lerp(v,I,h,OS),m.normalize(A,A),Xn.octEncode(A,u.encodedNormal)}else A=e.geodeticSurfaceNormalCartographic(dC,OS),Xn.octEncode(A,u.encodedNormal)}function Gge(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(dC,OS);Xn.octEncode(s,o.encodedNormal)}function j4(e,t,n,i,r,o,s,a,c,u,f){if(zge(e,t,a,s,!1,n,i,f)||zge(e,t,u,c,!0,n,i,f))return f;let p;if(NY(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],MY(o,p,n,i,f),f;let g;if(n===0?i===0?g=q4(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=q4(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=q4(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=q4(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return Gge(e,t,n,i,g,f),f}function q4(e,t,n,i,r,o,s,a){let c=Vge(e,t,!1,n,s,a),u=Vge(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function Y4(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=gst(e,t,n,i,r,o[u],s[u],a,c);return r}function gst(e,t,n,i,r,o,s,a,c){let u=o.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(o.rectangle,X4),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===yn.WEST&&o.x===0&&(u=ce.clone(o.rectangle,X4),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Bu),d=Bu.x,p=Bu.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let x=o,b=e.tile,C=s.encoding,A=s.vertices,T=n.stride,S,v;C.hasWebMercatorT&&(S=Ri.geodeticLatitudeToMercatorAngle(f.south),v=1/(Ri.geodeticLatitudeToMercatorAngle(f.north)-S));for(let I=0;I<g.length;++I){let O=g[I],R=C.decodeTextureCoordinates(A,O,Bu);aF(x,b,R,R);let L=R.x,N=R.y,_=h?L:N;if(_<0||_>1||Math.abs(L-d)<D.EPSILON5&&Math.abs(N-p)<D.EPSILON5)continue;let E=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5,w=Math.abs(N)<D.EPSILON5||Math.abs(N-1)<D.EPSILON5;if(E&&w)continue;let P=C.decodePosition(A,O,OS),M=C.decodeHeight(A,O),B;C.hasVertexNormals?B=C.getOctEncodedNormal(A,O,RY):(B=RY,B.x=0,B.y=0);let V=N;if(C.hasWebMercatorT){let G=D.lerp(f.south,f.north,N);V=(Ri.geodeticLatitudeToMercatorAngle(G)-S)*v}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(P,LY)),n.encode(i,r*T,P,R,M,B,V,U),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function Vge(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!NY(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function NY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function zge(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],h=n[r?0:n.length-1];if(NY(g,h)&&(o===0?s===0?(c=r?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=r,f=r):(c=r?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!r,f=!0):(c=r?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,Bu);let x=aF(g,e.tile,Bu,Bu);if(x.x===o&&x.y===s)return MY(h,p,o,s,a),!0;if(d=Or(c,u?o:s,function(b,C){h.encoding.decodeTextureCoordinates(h.vertices,b,Bu);let A=aF(g,e.tile,Bu,Bu);return f?u?A.x-o:A.y-s:u?o-A.x:s-A.y}),d<0){if(d=~d,d>0&&d<c.length)return _st(t,g,e.tile,h,c[d-1],c[d],o,s,u,a),!0}else return MY(h,c[d],o,s,a),!0}return!1}var yst=[new m,new m,new m,new m];function xst(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=yst;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var LS=MS;function eo(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=bn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(eo.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(eo.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(eo.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(eo.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(eo.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){let e=this._terrainProvider;if(!l(e)||(l(e._ready)?!e._ready:l(e.ready)&&!e.ready))return!1;if(this._imageryLayers.length===0)return!0;let t=this._imageryLayers.get(0);if(!t.ready)return!1;let n=t.imageryProvider;return l(n._ready)?n._ready:!l(n.ready)||n.ready}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){us.setOwner(e,this,"_clippingPlanes")}}});function bst(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}eo.prototype.update=function(e){this._imageryLayers._update()};function Cst(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);if(a.ready){let c=a.imageryProvider;(l(c._ready)?c._ready:!l(c.ready)||c.ready)&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}}eo.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(bst)})),Cst(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)zf._freeVertexArray(t[i]);t.length=0};eo.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,r=t.length;i<r;++i){let o=t[i];l(o)&&(o.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};eo.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Wa.LESS_OR_EQUAL},blending:dn.ALPHA_BLEND});let s=je(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=je(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&LS.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let o=this._tilesToRenderByTextureCount;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;Xge(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){Xge(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Kge(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}eo.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Kge(t[n],e)};eo.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};eo.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};eo.prototype.loadTile=function(e,t){let n=t.data,i=!0,r;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===ei.CULLED_BUT_NEEDED,r=n.terrainState),zf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&r!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==mo.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,zf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Tst=new ae,Jge=new ce,Ast=new ce,Est=new me;function Z4(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Ast);return ce.center(e,Est).longitude>0?n.east=D.PI:n.west=-D.PI,n}function Zge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}eo.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let r=Zge(this,t);if(t.fog.enabled&&!r&&D.fog(i,t.fog.density)>=1)return mo.NONE;let o=e.data,s=o.tileBoundingRegion;if(o.boundingVolumeSourceTile===void 0)return mo.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),o.clippedByBoundaries=!1;let u=Z4(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Jge);if(!l(f))return mo.NONE;if(ce.equals(f,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Tst,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(o.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return mo.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let x=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==en.INSIDE,x===en.OUTSIDE)return mo.NONE}let p,g=a.computeVisibility(c);if(g===en.OUTSIDE?p=mo.NONE:g===en.INTERSECTING?p=mo.PARTIAL:g===en.INSIDE&&(p=mo.FULL),p===mo.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof nn;if(t.mode===ne.SCENE3D&&!h&&l(n)&&!r){let x=o.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:mo.NONE}return p};eo.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Sst=[],vst=[];eo.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Sst;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===Cr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===di.FAILED||p.state===di.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,f=vst;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:ei.NONE;if(p===ei.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===Cr.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let x=h[a],b=x.loadingImagery,C=!l(b)||b.state===di.FAILED||b.state===di.INVALID,A=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[A])return!1}}else p===ei.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var wst=new m;eo.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,s=m.subtract(i.center,r,wst),a=m.magnitude(s);return a<D.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,o))*e._distance)};var Wge=new F,J4=new F,Ist=new oe,Pst=new oe,Dst=new oe,Rst=new m,jge=new m,Ost=new m,Mst=new m;eo.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let r=this._tilesToRenderByTextureCount[n];l(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);let o=e.data;l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Lst=[new m,new m,new m,new m];function qge(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Lst;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}eo.prototype.computeDistanceToTile=function(e,t){Nst(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let r=n.tileBoundingRegion,o=r.minimumHeight,s=r.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-o),f=Math.abs(c-s);u>f?(r.minimumHeight=o,r.maximumHeight=o):(r.minimumHeight=s,r.maximumHeight=s)}let a=r.distanceToCamera(t);return r.minimumHeight=o,r.maximumHeight=s,a};function Nst(e,t,n){let i=e.data;i===void 0&&(i=e.data=new zf);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new yf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let b=0;b<d.rectangles.length;b++)if(ce.intersection(e.rectangle,d.rectangles[b])){f=d.heights[b];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let b=0;b<p.rectangles.length;b++)if(ce.intersection(o.rectangle,p.rectangles[b])){g=p.height;break}}let h=i.mesh,x=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)o.minimumHeight=h.minimumHeight,o.maximumHeight=h.maximumHeight,c=!0;else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0)o.minimumHeight=x._minimumHeight,o.maximumHeight=x._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let b=e.parent;for(;b!==void 0;){let C=b.data;if(C!==void 0){let A=C.mesh,T=C.terrainData;if(A!==void 0&&A.minimumHeight!==void 0&&A.maximumHeight!==void 0){o.minimumHeight=A.minimumHeight,o.maximumHeight=A.maximumHeight;break}else if(T!==void 0&&T._minimumHeight!==void 0&&T._maximumHeight!==void 0){o.minimumHeight=T._minimumHeight,o.maximumHeight=T._maximumHeight;break}}b=b.parent}u=b}if(o.maximumHeight+=g,o.maximumHeight<f&&(o.maximumHeight=f),o.minimumHeight>f&&(o.minimumHeight=f),u!==void 0){let b=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((b!==1||f!==0)&&(c=!1,o.minimumHeight=vc.getHeight(o.minimumHeight,b,C),o.maximumHeight=vc.getHeight(o.maximumHeight,b,C)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=On.clone(h.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ae.clone(h.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=qge(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let T=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||T)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=qge(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}eo.prototype.isDestroyed=function(){return!1};eo.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function Fst(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=y(r.readyImagery,r.loadingImagery),o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?y(r.readyImagery,r.loadingImagery):void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}eo.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,r=this._imageryLayersUpdatedEvent,o=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Fst(d,e,n),s.state=Vs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=o}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Vs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==ei.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}};eo.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,r=-1,o=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)r===-1&&(r=s),c.freeResources(),++o;else if(r!==-1)break}r!==-1&&i.splice(r,o)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};eo.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};eo.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Bst=new F,kst=new F;function Yge(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=F.multiplyByPoint(i,this.properties.rtc,jge);return F.setTranslation(i,r,Wge),Wge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=F.multiplyByPoint(i,this.properties.rtc,jge);return F.setTranslation(i,o,J4),F.multiply(r,J4,J4),J4},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,Bst):F.IDENTITY;return F.inverseTranspose(r,kst)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return l(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return l(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new F,tileRectangle:new oe,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new H,scaleAndBias:new F,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=gt(n,i)}return l(t.materialUniformMap)?gt(n,t.materialUniformMap):n}function Ust(e,t,n){let i=n.data,r,o;if(l(i.vertexArray)?(r=i.mesh,o=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),!(!l(r)||!l(o))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Vst(e,o,r),i.wireframeVertexArray.mesh=r}}function Vst(e,t,n){let r={indices:n.indices,primitiveType:Le.TRIANGLES};Bn.toWireframe(r);let o=r.indices,s=mt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Be.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new si({context:e,attributes:t._attributes,indexBuffer:s})}var $ge,Qge,$4;(function(){let e=new Ct({geometry:ad.fromDimensions({dimensions:new m(2,2,2)})}),t=new Ct({geometry:new r_({radius:1})}),n=new F,i,r;function o(s){return new wn({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}$ge=function(s,a){return s===i||($4(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=zt.fromColor(a),r=o(e)),r},Qge=function(s,a){return s===i||($4(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=zt.fromColor(a),r=o(t)),r},$4=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var zst=new oe(0,0,0,0),Hst={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Gst=z.TRANSPARENT,Wst=new Ot;function Xge(e,t,n,i){let r=t.data;l(r.vertexArray)||(r.fill===void 0&&(r.fill=new LS(t)),r.fill.update(e,n));let o=n.creditDisplay,s=r.terrainData;if(l(s)&&l(s.credits)){let ot=s.credits;for(let Kt=0,_i=ot.length;Kt<_i;++Kt)o.addCreditToNextFrame(ot[Kt])}let a=Ht.maximumTextureImageUnits,c=r.waterMaskTexture,u=r.waterMaskTranslationAndScale;!l(c)&&l(r.fill)&&(c=r.fill.waterMaskTexture,u=r.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,x=d.rectangle,b=y(e.undergroundColor,Gst),C=y(e.undergroundColorAlphaByDistance,Wst),A=Zge(e,n)&&n.mode===ne.SCENE3D&&b.alpha>0&&(C.nearValue>0||C.farValue>0),T=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,v=e.hasWaterMask&&l(c),I=e.oceanNormalMap,O=v&&l(I),R=e.terrainProvider,L=l(R)&&(l(R._ready)?R._ready:!l(R.ready)||R.ready)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!f,_=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=bn.castShadows(e.shadows)&&!p,w=bn.receiveShadows(e.shadows)&&!p,P=e.hueShift,M=e.saturationShift,B=e.brightnessShift,V=!(D.equalsEpsilon(P,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(B,0,D.EPSILON7)),U=!1;if(_){let ot=m.magnitude(n.camera.positionWC),Kt=e.nightFadeOutDistance;U=ot>Kt}v&&--a,O&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let G=r.renderedMesh,k=G.center,Y=G.encoding,j=r.tileBoundingRegion,J=n.terrainExaggeration,W=n.terrainExaggerationRelativeHeight,K=e.marsOptions?.uplift;i&&K&&(W=n.terrainExaggerationRelativeHeight-K.height/(J-1));let Z=J!==1,he=Y.hasGeodeticSurfaceNormals,ge=Ist,se=0,pe=0,xe=0,Pe=0,we=!1;if(n.mode!==ne.SCENE3D){let ot=n.mapProjection,Kt=ot.project(ce.southwest(t.rectangle),Ost),_i=ot.project(ce.northeast(t.rectangle),Mst);if(ge.x=Kt.x,ge.y=Kt.y,ge.z=_i.x,ge.w=_i.y,n.mode!==ne.MORPHING&&(k=Rst,k.x=0,k.y=(ge.z+ge.x)*.5,k.z=(ge.w+ge.y)*.5,ge.x-=k.y,ge.y-=k.z,ge.z-=k.y,ge.w-=k.z),n.mode===ne.SCENE2D&&Y.quantization===Us.BITS12){let Je=1/(Math.pow(2,12)-1)*.5,ho=(ge.z-ge.x)*Je,vr=(ge.w-ge.y)*Je;ge.x-=ho,ge.y-=vr,ge.z+=ho,ge.w+=vr}ot instanceof Ri&&(se=t.rectangle.south,pe=t.rectangle.north,xe=Ri.geodeticLatitudeToMercatorAngle(se),Pe=1/(Ri.geodeticLatitudeToMercatorAngle(pe)-xe),we=!0)}let Se=Hst;Se.frameState=n,Se.surfaceTile=r,Se.showReflectiveOcean=v,Se.showOceanWaves=O,Se.enableLighting=e.enableLighting,Se.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Se.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Se.showGroundAtmosphere=_,Se.atmosphereLightIntensity=e.atmosphereLightIntensity,Se.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Se.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Se.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Se.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Se.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Se.perFragmentGroundAtmosphere=U,Se.hasVertexNormals=L,Se.useWebMercatorProjection=we,Se.clippedByBoundaries=r.clippedByBoundaries,Se.hasGeodeticSurfaceNormals=he,Se.hasExaggeration=Z;let nt=r.imagery,Ze=0,Gt=nt.length,fn=e.showSkirts&&!f&&!p,pt=e.backFaceCulling&&!f&&!p,Tn=pt?e._renderState:e._disableCullingRenderState,Vn=pt?e._blendRenderState:e._disableCullingBlendRenderState,Ut=Tn,Pt=e._firstPassInitialColor,Ce=n.context;if(l(e._debug.boundingSphereTile)||$4(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ot=e._drawCommands.length;for(let Kt=0;Kt<ot;++Kt)e._uniformMaps[Kt]=Yge(n,e)}do{let ot=0,Kt,_i;if(e._drawCommands.length<=e._usedDrawCommands?(Kt=new tt,Kt.owner=t,Kt.cull=!1,Kt.boundingVolume=new ae,Kt.orientedBoundingBox=void 0,_i=Yge(n,e),e._drawCommands.push(Kt),e._uniformMaps.push(_i)):(Kt=e._drawCommands[e._usedDrawCommands],_i=e._uniformMaps[e._usedDrawCommands]),Kt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let po=j.boundingVolume,Ho=j.boundingSphere;l(po)?$ge(po,z.RED).update(n):l(Ho)&&Qge(Ho,z.RED).update(n)}let Je=_i.properties;oe.clone(Pt,Je.initialColor),Je.oceanNormalMap=I,Je.lightingFadeDistance.x=e.lightingFadeOutDistance,Je.lightingFadeDistance.y=e.lightingFadeInDistance,Je.nightFadeDistance.x=e.nightFadeOutDistance,Je.nightFadeDistance.y=e.nightFadeInDistance,Je.atmosphereLightIntensity=e.atmosphereLightIntensity,Je.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Je.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Je.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Je.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Je.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Je.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ho=f?h:g,vr=f?g:h;l(ho)&&(oe.fromElements(ho.near,ho.nearValue,ho.far,ho.farValue,Je.frontFaceAlphaByDistance),oe.fromElements(vr.near,vr.nearValue,vr.far,vr.farValue,Je.backFaceAlphaByDistance)),oe.fromElements(C.near,C.nearValue,C.far,C.farValue,Je.undergroundColorAlphaByDistance),z.clone(b,Je.undergroundColor),Je.lambertDiffuseMultiplier=T,Je.vertexShadowDarkness=S;let zo=!l(r.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;zo&&z.clone(e.fillHighlightColor,Je.fillHighlightColor),Je.terrainExaggerationAndRelativeHeight.x=J,Je.terrainExaggerationAndRelativeHeight.y=W,Je.center3D=G.center,m.clone(k,Je.rtc),oe.clone(ge,Je.tileRectangle),Je.southAndNorthLatitude.x=se,Je.southAndNorthLatitude.y=pe,Je.southMercatorYAndOneOverHeight.x=xe,Je.southMercatorYAndOneOverHeight.y=Pe;let os=Pst,ke=Z4(t.rectangle,e.cartographicLimitRectangle),st=Dst,Ke=Z4(t.rectangle,x);m.fromElements(P,M,B,Je.hsbShift);let He=t.rectangle,dt=1/He.width,_t=1/He.height;os.x=(ke.west-He.west)*dt,os.y=(ke.south-He.south)*_t,os.z=(ke.east-He.west)*dt,os.w=(ke.north-He.south)*_t,oe.clone(os,Je.localizedCartographicLimitRectangle),st.x=(Ke.west-He.west)*dt,st.y=(Ke.south-He.south)*_t,st.z=(Ke.east-He.west)*dt,st.w=(Ke.north-He.south)*_t;let hn=e.marsOptions?.flat;if(hn){let po=hn.areas,Ho=0;po?(po.forEach(on=>{Ho<on.length&&(Ho=on.length)}),Je.mars_flat_AreaWidth=po.length):Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=Ho,Je.mars_flat_AreaTexture=hn.texture,Je.mars_flat_enabled=hn.enabled}else Je.mars_flat_enabled=!1,Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=0,Je.mars_flat_AreaTexture=void 0;Je.inverseTileWidth=dt,Je.cartographicTileRectangle=new H(He.west,He.south);let Hi=e.marsOptions?.uplift;if(Hi){let po=Hi.areas,Ho=0;po?(po.forEach(on=>{Ho<on.length&&(Ho=on.length)}),Je.mars_uplift_RectangleWidth=po.length):Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=Ho,Je.mars_uplift_RampRectangle=Hi.texture,Je.mars_uplift_enabled=(!Hi.showUp||Hi.enabled&&e._topographicUpliftHeight!==0)&&l(Hi.rectangles)&&Hi.rectangles.length>0,Je.mars_uplift_hideInsideOrOutside=!i}else Je.mars_uplift_enabled=!1,Je.mars_uplift_hideInsideOrOutside=!1,Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=0,Je.mars_uplift_RampRectangle=void 0;oe.clone(st,Je.localizedTranslucencyRectangle);let Rr=N&&D.fog(t._distance,n.fog.density)>D.EPSILON3;V=V&&(Rr||_);let ss=!1,As=!1,io=!1,Xi=!1,Ao=!1,jn=!1,Fn=!1,Ln=!1,gi=!1,Ws=!1,as=!1,td=!1;for(;ot<a&&Ze<Gt;){let po=nt[Ze],Ho=po.readyImagery;if(++Ze,!l(Ho)||Ho.imageryLayer.alpha===0)continue;let on=po.useWebMercatorT?Ho.textureWebMercator:Ho.texture,Ae=Ho.imageryLayer;l(po.textureTranslationAndScale)||(po.textureTranslationAndScale=Ae._calculateTextureTranslationAndScale(t,po)),Je.dayTextures[ot]=on,Je.dayTextureTranslationAndScale[ot]=po.textureTranslationAndScale,Je.dayTextureTexCoordsRectangle[ot]=po.textureCoordinateRectangle,Je.dayTextureUseWebMercatorT[ot]=po.useWebMercatorT,Je.dayTextureAlpha[ot]=Ae.alpha,jn=jn||Je.dayTextureAlpha[ot]!==1,Je.dayTextureNightAlpha[ot]=Ae.nightAlpha,Fn=Fn||Je.dayTextureNightAlpha[ot]!==1,Je.dayTextureDayAlpha[ot]=Ae.dayAlpha,Fn=Fn||Je.dayTextureDayAlpha[ot]!==1,Je.dayTextureBrightness[ot]=Ae.brightness,ss=ss||Je.dayTextureBrightness[ot]!==Hs.DEFAULT_BRIGHTNESS,Je.dayTextureContrast[ot]=Ae.contrast,As=As||Je.dayTextureContrast[ot]!==Hs.DEFAULT_CONTRAST,Je.dayTextureHue[ot]=Ae.hue,io=io||Je.dayTextureHue[ot]!==Hs.DEFAULT_HUE,Je.dayTextureSaturation[ot]=Ae.saturation,Xi=Xi||Je.dayTextureSaturation[ot]!==Hs.DEFAULT_SATURATION,Je.dayTextureOneOverGamma[ot]=1/Ae.gamma,Ao=Ao||Je.dayTextureOneOverGamma[ot]!==1/Hs.DEFAULT_GAMMA,Je.dayTextureSplit[ot]=Ae.splitDirection,Ln=Ln||Je.dayTextureSplit[ot]!==0,as=as||!!Ae.invertColor,Je.mars3dTextureInvertColor[ot]=!!Ae.invertColor,td=td||!!Ae.filterColor,Ae.filterColor?Je.mars3dTextureFilterColor[ot]=new m(Ae.filterColor.red,Ae.filterColor.green,Ae.filterColor.blue):Je.mars3dTextureFilterColor[ot]=new m(1,1,1);let rt=Je.dayTextureCutoutRectangles[ot];if(l(rt)||(rt=Je.dayTextureCutoutRectangles[ot]=new oe),oe.clone(oe.ZERO,rt),l(Ae.cutoutRectangle)){let ur=Z4(He,Ae.cutoutRectangle),js=ce.simpleIntersection(ur,He,Jge);gi=l(js)||gi,rt.x=(ur.west-He.west)*dt,rt.y=(ur.south-He.south)*_t,rt.z=(ur.east-He.west)*dt,rt.w=(ur.north-He.south)*_t}let Ft=Je.colorsToAlpha[ot];l(Ft)||(Ft=Je.colorsToAlpha[ot]=new oe);let tr=l(Ae.colorToAlpha)&&Ae.colorToAlphaThreshold>0;if(Ws=Ws||tr,tr){let ur=Ae.colorToAlpha;Ft.x=ur.red,Ft.y=ur.green,Ft.z=ur.blue,Ft.w=Ae.colorToAlphaThreshold}else Ft.w=-1;if(l(Ho.credits)){let ur=Ho.credits;for(let js=0,ro=ur.length;js<ro;++js)o.addCreditToNextFrame(ur[js])}++ot}Je.dayTextures.length=ot,Je.waterMask=c,oe.clone(u,Je.waterMaskTranslationAndScale),Je.minMaxHeight.x=Y.minimumHeight,Je.minMaxHeight.y=Y.maximumHeight,F.clone(Y.matrix,Je.scaleAndBias);let La=e._clippingPlanes,ha=l(La)&&La.enabled&&t.isClipped;ha&&(Je.clippingPlanesEdgeColor=z.clone(La.edgeColor,Je.clippingPlanesEdgeColor),Je.clippingPlanesEdgeWidth=La.edgeWidth),Se.numberOfDayTextures=ot,Se.applyBrightness=ss,Se.applyContrast=As,Se.applyHue=io,Se.applySaturation=Xi,Se.applyGamma=Ao,Se.applyAlpha=jn,Se.applyDayNightAlpha=Fn,Se.applySplit=Ln,Se.enableFog=Rr,Se.enableClippingPlanes=ha,Se.clippingPlanes=La,Se.hasImageryLayerCutout=gi,Se.colorCorrect=V,Se.highlightFillTile=zo,Se.colorToAlpha=Ws,Se.showUndergroundColor=A,Se.translucent=p,Se.marsOptions={invertColor:as,filterColor:td,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let nd=r.renderedMesh.indices.length;fn||(nd=r.renderedMesh.indexCountWithoutSkirts),Kt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Se),Kt.castShadows=E,Kt.receiveShadows=w,Kt.renderState=Ut,Kt.primitiveType=Le.TRIANGLES,Kt.vertexArray=r.vertexArray||r.fill.vertexArray,Kt.count=nd,Kt.uniformMap=_i,Kt.pass=Ee.GLOBE,e._debug.wireframe&&(Ust(Ce,e,t),l(r.wireframeVertexArray)&&(Kt.vertexArray=r.wireframeVertexArray,Kt.primitiveType=Le.LINES,Kt.count=nd*2));let ql=Kt.boundingVolume,$_=Kt.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,j.minimumHeight,j.maximumHeight,ql),m.fromElements(ql.center.z,ql.center.x,ql.center.y,ql.center),n.mode===ne.MORPHING&&(ql=ae.union(j.boundingSphere,ql,ql))):(Kt.boundingVolume=ae.clone(j.boundingSphere,ql),Kt.orientedBoundingBox=On.clone(j.boundingVolume,$_)),Kt.dirty=!0,p&&d.updateDerivedCommands(Kt,n),Kge(Kt,n),Ut=Vn,Pt=zst}while(Ze<Gt)}var cF=eo;function eye(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(eye.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Ot.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Ot.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var lF=eye;function Cs(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(Cs.prototype,{length:{get:function(){return this._layers.length}}});Cs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Cs.prototype.addImageryProvider=function(e,t){let n=new Hs(e);return this.add(n,t),n};Cs.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Cs.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};Cs.prototype.contains=function(e){return this.indexOf(e)!==-1};Cs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Cs.prototype.get=function(e){return this._layers[e]};function Q4(e,t){return e.indexOf(t)}function tye(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}Cs.prototype.raise=function(e){let t=Q4(this._layers,e);tye(this,t,t+1)};Cs.prototype.lower=function(e){let t=Q4(this._layers,e);tye(this,t,t-1)};Cs.prototype.raiseToTop=function(e){let t=Q4(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Cs.prototype.lowerToBottom=function(e){let t=Q4(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var jst=new ce;function nye(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ce.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let d=jst,p=1/1024;d.west=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(u)}}Cs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];if(nye(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};Cs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];if(nye(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(r.push(c),o.push(s.imageryLayer))}),r.length!==0)return Promise.all(r).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=o[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Cs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Cs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Cs.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var uF=Cs;function iye(e){this._ellipsoid=new h_(e.ellipsoid,m.ZERO)}Object.defineProperties(iye.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var fF=iye;function Qc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=ei.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Vs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Qc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),r=0;for(let o=0;o<n;++o)for(let s=0;s<t;++s)i[r++]=new Qc({tilingScheme:e,x:s,y:o,level:0});return i};Qc.prototype._updateCustomData=function(e,t,n){let i=this.customData,r,o,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,r=0;r<t.length;++r)o=t[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(r=0;r<c.length;++r)o=c[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Qc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Vs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Qc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(r){return r.x===t&&r.y===n})[0]};Qc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Qc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Qc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Qc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Qc.prototype.freeResources=function(){this.state=Vs.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),eH(this._southwestChild),this._southwestChild=void 0,eH(this._southeastChild),this._southeastChild=void 0,eH(this._northwestChild),this._northwestChild=void 0,eH(this._northeastChild),this._northeastChild=void 0};function eH(e){l(e)&&e.freeResources()}var dF=Qc;function tH(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}tH.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};tH.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),rye(this,t)),t=i}};function rye(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}tH.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&rye(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var mF=tH;function Gf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new mF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new fF({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Gf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Gf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function qst(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,sye(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData,s=o.length;for(let a=0;a<s;++a){let c=o[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Gf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Vs.START&&e(t),t=t.replacementNext};Gf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Gf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let s=0;s<o;++s)if(r[s]===i){r.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Gf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function sye(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Gf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(qst(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),sye(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Gf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Jst(this,e),sat(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Yst(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=_e.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Gf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(nat(this,e),oat(this,e),Yst(this,e))};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var pF,oye=new me;function Xst(e,t){let n=ce.center(e.rectangle,oye),i=n.longitude-pF.longitude,r=n.latitude-pF.latitude;n=ce.center(t.rectangle,oye);let o=n.longitude-pF.longitude,s=n.latitude-pF.latitude;return i*i+r*r-(o*o+s*s)}var Kst=new m,hF=[];function Jst(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r,o=e._tileProvider;if(!l(e._levelZeroTiles))if(o.ready){let x=o.tilingScheme;e._levelZeroTiles=dF.createLevelZeroTiles(x);let b=e._levelZeroTiles.length;if(hF.length<b)for(hF=new Array(b),r=0;r<b;++r)hF[r]===void 0&&(hF[r]=new _F)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;pF=t.camera.positionCartographic,a.sort(Xst);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(r=0,p=a.length;r<p;++r)s=a[r],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=F.getTranslation(g.transform,Kst);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),r=0,p=a.length;r<p;++r)s=a[r],e._tileReplacementQueue.markTileRendered(s),s.renderable?Da(e,s,o,t,c,!1,hF[r]):(V_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function V_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function _F(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function aye(){this.southwest=new _F,this.southeast=new _F,this.northwest=new _F,this.northeast=new _F}aye.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var kY=new Array(31);for(let e=0;e<kY.length;++e)kY[e]=new aye;function Zst(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=eat(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:ei.NONE,g=e.tileProvider;if(s||i){let h=ei.originalResult(p)===ei.RENDERED,x=ei.originalResult(p)===ei.CULLED||p===ei.NONE,b=n.state===Vs.DONE,C=h||x||b;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&V_(e,e._tileLoadQueueMedium,n,t),nH(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===ei.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ei.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&V_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){nH(e,n),V_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===ei.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ei.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ei.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,A=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if($st(e,a,c,u,f,t,i,r),x!==e._tilesToRender.length){let S=r.allAreRenderable,v=r.anyWereRenderedLastFrame,I=r.notYetRenderableCount,O=!1;if(!S&&!v){let R=e._tilesToRender;for(let N=x;N<R.length;++N){let _=R[N];for(;_!==void 0&&_._lastSelectionResult!==ei.KICKED&&_!==n;)_._lastSelectionResult=ei.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=T,nH(e,n),n._lastSelectionResult=ei.RENDERED;let L=p===ei.RENDERED;!L&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=A,V_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,O=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!O&&V_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ei.RENDERED,nH(e,n),V_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===ei.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function $st(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=kY[t.level],p=d.southwest,g=d.southeast,h=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Da(e,t,u,o,f,s,p),Da(e,n,u,o,f,s,g),Da(e,i,u,o,f,s,h),Da(e,r,u,o,f,s,x)):(Da(e,i,u,o,f,s,h),Da(e,t,u,o,f,s,p),Da(e,r,u,o,f,s,x),Da(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Da(e,n,u,o,f,s,g),Da(e,t,u,o,f,s,p),Da(e,r,u,o,f,s,x),Da(e,i,u,o,f,s,h)):(Da(e,r,u,o,f,s,x),Da(e,i,u,o,f,s,h),Da(e,n,u,o,f,s,g),Da(e,t,u,o,f,s,p)),d.combine(a)}function Qst(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Da(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==mo.NONE)return Zst(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Qst(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&V_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:ei.NONE;c!==ei.CULLED_BUT_NEEDED&&c!==ei.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=ei.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(V_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=ei.CULLED):t._lastSelectionResult=ei.CULLED;t._lastSelectionResultFrame=i.frameNumber}function eat(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof nn||t.camera.frustum instanceof vo)return tat(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=D.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function tat(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function nH(e,t){e._tilesToRender.push(t)}function nat(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=Ci()+e._loadQueueTimeSlice,s=e._tileProvider,a=FY(e,t,s,o,n,!1);a=FY(e,t,s,o,i,a),FY(e,t,s,o,r,a)}function iat(e,t){return e._loadPriority-t._loadPriority}function FY(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(iat);for(let s=0,a=r.length;s<a&&(Ci()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var NS=new vn,BY=new me,i0=new m,rat=[];function oat(e,t){if(!e.tileProvider.ready)return;let n=rat;n.length=0;let i=e._tileToUpdateHeights,r=Ci(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:ei.NONE;(x===ei.RENDERED||x===ei.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],b=d.data.terrainData,C=l(b)&&b.wasCreatedByUpsampling();if(d.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let T=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,NS.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,NS.origin);if(!l(S)){let v=0;l(d.data.tileBoundingRegion)&&(v=d.data.tileBoundingRegion.minimumHeight);let I=Math.min(v,-11500),O=m.multiplyByScalar(T,Math.abs(I)+1,i0);m.subtract(x.positionOnEllipsoidSurface,O,NS.origin)}}else me.clone(x.positionCartographic,BY),BY.height=-11500,c.project(BY,i0),m.fromElements(i0.z,i0.x,i0.y,i0),m.clone(i0,NS.origin),m.clone(m.UNIT_X,NS.direction);let A=d.data.pick(NS,a,c,!1,i0);l(A)&&(l(x.callback)&&x.callback(A),x.level=d.level)}if(Ci()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function sat(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var gF=Gf;function Tm(e){e=y(e,re.WGS84);let t=new Qb({ellipsoid:e}),n=new uF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new tF,this._material=void 0,this._surface=new gF({tileProvider:new cF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Ot(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new lF,VY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ie({url:tn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=bn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Tm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&VY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,VY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ot.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function VY(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[F_,mS];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(GN),e._surfaceShaderSet.baseVertexShaderSource=new ze({sources:[F_,mS,WN],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ze({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function aat(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),r=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var cat=[],lat={start:0,stop:0};Tm.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let r=t.mode,o=t.mapProjection,s=cat;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(r!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,o,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=$i.raySphere(e,g,lat);l(h)&&s.push(p)}s.sort(aat(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var uat=new me;Tm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,uat);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var fat=new m,cye=new m,dat=new me,mat=new vn;function UY(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}Tm.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=UY(n._southwestChild,e)||UY(n._southeastChild,e)||UY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,fat),u=mat,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),x=m.multiplyByScalar(f,Math.abs(h)+1,cye);m.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,cye);if(l(p))return a.cartesianToCartographic(p,dat).height};Tm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Tm.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready),o=this.showWaterEffect&&r&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let c=this._oceanNormalMapResource,u=c.url;if(l(u)){let f=this;c.fetchImage().then(function(d){u===f._oceanNormalMapResource.url&&(f._oceanNormalMap=f._oceanNormalMap&&f._oceanNormalMap.destroy(),f._oceanNormalMap=new Lt({context:e.context,source:d}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let s=e.passes,a=e.mode;s.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=a===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Tm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Tm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Tm.prototype.isDestroyed=function(){return!1};Tm.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var yF=Tm;var zY={position:0};function iH(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Wi.fromType(Wi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new tt({owner:y(e._owner,this)}),this._pickCommand=new tt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function hat(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=cl.createGeometry(cl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Oe.POSITION_ONLY}));return t=si.fromGeometry({context:e,geometry:n,attributeLocations:zY,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}iH.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?dn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=hat(t));let r=!1,o=this.radii;if(!m.equals(this._radii,o)){m.clone(o,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(o.x*o.x),x.y=1/(o.y*o.y),x.z=1/(o.z*o.z),r=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(o),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new ze({sources:[dS]}),p=new ze({sources:[this.material.shaderSource,fS]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:zY}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=gt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(f)),h.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new ze({sources:[dS]}),p=new ze({sources:[this.material.shaderSource,fS],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Jt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:zY}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=gt(gt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(x)}};iH.prototype.isDestroyed=function(){return!1};iH.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var xF=iH;function bF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=tn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,re.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new xF({radii:this.ellipsoid.radii,material:Wi.fromType(Wi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new _N}Object.defineProperties(bF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var rH=new $,pat=new $,_at=new m,oH=[];bF.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,rH))||Mt.computeTemeToPseudoFixedMatrix(n,rH);let i=this._axes.evaluate(n,pat);$.transpose(i,i),$.multiply(rH,i,i);let r=Qy.computeMoonPositionInEarthInertialFrame(n,_at);$.multiplyByVector(rH,r,r),F.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=oH,oH.length=0,t.update(e),e.commandList=o,oH.length===1?oH[0]:void 0};bF.prototype.isDestroyed=function(){return!1};bF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var CF=bF;function TF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(TF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function gat(e,t,n){let i=t.createViewportQuadCommand(MN,{framebuffer:n,renderState:Ue.fromCache({viewport:new Ye(0,0,256,256)})});e._drawCommand=i}TF.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Lt({context:t,width:256,height:256,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,sampler:mn.NEAREST});this._colorTexture=n;let i=new ea({context:t,colorTextures:[n],destroyAttachments:!1});gat(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};TF.prototype.isDestroyed=function(){return!1};TF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var AF=TF;var dye={};function yat(e,t,n){let i,r,o;if(e instanceof Ii){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Zc)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var xat=new m,lye=new m;function mye(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-o)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(r){return D.lerp(e,t,r)}}function GY(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,xat),g=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),lye)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),lye));o=Math.min(yat(d,g,h)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return D.lerp(n,i,a)}}function EF(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var hye=new m;function bat(e,t,n,i,r,o,s,a){let c=e.camera,u=m.clone(c.position,hye),f=c.pitch,d=EF(c.heading,i),p=EF(c.roll,o),g=GY(c,n,u.z,n.z,s),h=mye(f,r,g,a);function x(b){let C=b.time/t;c.setView({orientation:{heading:D.lerp(d,i,C),pitch:h(C),roll:D.lerp(p,o,C)}}),H.lerp(u,n,C,c.position),c.position.z=g(C)}return x}function Cat(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function Tat(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var Aat=new me,Eat=new me;function Sat(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=me.clone(f.positionCartographic,Aat),h=f.pitch,x=EF(f.heading,i),b=EF(f.roll,o),C=p.cartesianToCartographic(n,Eat);g.longitude=D.zeroToTwoPi(g.longitude),C.longitude=D.zeroToTwoPi(C.longitude);let A=!1;if(l(a)){let I=D.zeroToTwoPi(a),O=Math.min(g.longitude,C.longitude),R=Math.max(g.longitude,C.longitude),L=I>=O&&I<=R;if(l(c)){let N=Math.abs(g.longitude-C.longitude),_=D.TWO_PI-N;(L?N:_)<(L?_:N)*c&&!L&&(A=!0)}else L||(A=!0)}A?Cat(g,C):Tat(g,C);let T=GY(f,n,g.height,C.height,s),S=mye(h,r,T,u);function v(){let I=g.longitude,O=C.longitude,R=g.latitude,L=C.latitude;return function(_){let E=_.time/t,w=m.fromRadians(D.lerp(I,O,E),D.lerp(R,L,E),T(E),p);f.setView({destination:w,orientation:{heading:D.lerp(x,i,E),pitch:S(E),roll:D.lerp(b,o,E)}})}}return v()}function vat(e,t,n,i,r,o,s){let a=e.camera,c=m.clone(a.position,hye),u=EF(a.heading,i),f=a.frustum.right-a.frustum.left,d=GY(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:D.lerp(u,i,h)}}),H.lerp(c,n,h,a.position);let x=d(h),b=a.frustum,C=b.top/b.right,A=(x-(b.right-b.left))*.5;b.right+=A,b.left-=A,b.top=C*b.right,b.bottom=-b.top}return p}var uye=new me,wat=new m;function HY(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function fye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}dye.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return HY();let r=y(t.convert,!0),o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,uye),n=o.project(uye,wat));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let h=t.duration;l(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let x=y(t.heading,0),b=y(t.pitch,-D.PI_OVER_TWO),C=y(t.roll,0),A=e.screenSpaceCameraController;A.enableInputs=!1;let T=fye(A,t.complete),S=fye(A,t.cancel),v=p.frustum,I=e.mode===ne.SCENE2D;if(I=I&&H.equalsEpsilon(p.position,n,D.EPSILON6),I=I&&D.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,D.EPSILON6),I=I||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,D.EPSILON10),I=I&&D.equalsEpsilon(D.negativePiToPi(x),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(C),D.negativePiToPi(p.roll),D.EPSILON10),I)return HY(T,S);let O=new Array(4);if(O[ne.SCENE2D]=vat,O[ne.SCENE3D]=Sat,O[ne.COLUMBUS_VIEW]=bat,h<=0)return HY(function(){O[i](e,1,n,x,b,C,a,c,u,f)({time:1}),typeof T=="function"&&T()},S);let R=O[i](e,h,n,x,b,C,a,c,u,f);if(!l(d)){let L=p.positionCartographic.height,N=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>N&&L>11500?d=Fo.CUBIC_OUT:d=Fo.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:R,complete:T,cancel:S}};var SF=dye;var Iat={ROTATE:0,INFINITE_SCROLL:1},Ul=Object.freeze(Iat);function Qt(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new _e,this._moveEnd=new _e,this._changed=new _e,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Tye(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,Lye(this,Qt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*Qt.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}Qt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Qt.TRANSFORM_2D_INVERSE=F.inverseTransformation(Qt.TRANSFORM_2D,new F);Qt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Qt.DEFAULT_VIEW_FACTOR=.5;Qt.DEFAULT_OFFSET=new xu(0,-D.PI_OVER_FOUR,0);function Tye(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Pat(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ci()):e.timeSinceMoved=Math.max(Ci()-e._lastMovedTimestamp,0)/1e3}}Qt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};Qt.prototype._updateCameraChanged=function(){let e=this;if(Pat(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,h=u.x+d.right,x=f.x+p.left,b=f.x+p.right,C=u.y+d.bottom,A=u.y+d.top,T=f.y+p.bottom,S=f.y+p.top,v=Math.max(g,x),I=Math.min(h,b),O=Math.max(C,T),R=Math.min(A,S),L;if(v>=I||O>=A)L=1;else{let N=p;g<x&&h>b&&C<T&&A>S&&(N=d),L=1-(I-v)*(R-O)/((N.right-N.left)*(N.top-N.bottom))}L>t&&(e._changed.raiseEvent(L),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let o=D.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=o/(e.frustum.fovy*.5):s=o;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Dat(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Rat=new me,Oat=new m,sH=new m,Mat=new oe,Lat=new oe,Nat=new oe,Fat=new oe,Bat=new oe;function kat(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Mat),r=n.cartesianToCartographic(i,Rat),o=t.project(r,Oat),s=Lat;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=oe.clone(oe.UNIT_X,Bat),c=oe.add(F.getColumn(e._transform,0,sH),i,sH);n.cartesianToCartographic(c,r),t.project(r,o);let u=Nat;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,m.subtract(u,s,u),u.x=0;let f=Fat;if(m.magnitudeSquared(u)>D.EPSILON10)m.cross(a,u,f);else{let d=oe.add(F.getColumn(e._transform,1,sH),i,sH);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)<D.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}m.cross(f,a,u),m.normalize(u,u),m.cross(a,u,f),m.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var WY=new m;function yc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!m.equals(r,e.position)||n;o&&(r=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,u=!m.equals(c,e.up);u&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let f=e._right,d=!m.equals(f,e.right);d&&(m.normalize(e.right,e.right),f=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(Qt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?Dat(e):kat(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=F.multiplyByPoint(g,r,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=WY;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===ne.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||u||d){let h=m.dot(s,m.cross(c,f,WY));if(Math.abs(1-h)>D.EPSILON2){let x=1/m.magnitudeSquared(c),b=m.dot(c,s)*x,C=m.multiplyByScalar(s,b,WY);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=F.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&Tye(e)}function Aye(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function Eye(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function Sye(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var lH=new F,uH=new F;Object.defineProperties(Qt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return yc(this),this._invTransform}},viewMatrix:{get:function(){return yc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return yc(this),this._invViewMatrix}},positionCartographic:{get:function(){return yc(this),this._positionCartographic}},positionWC:{get:function(){return yc(this),this._positionWC}},directionWC:{get:function(){return yc(this),this._directionWC}},upWC:{get:function(){return yc(this),this._upWC}},rightWC:{get:function(){return yc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,lH),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,uH);this._setTransform(n);let i=Aye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,lH),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,uH);this._setTransform(n);let i=Eye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,lH),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,uH);this._setTransform(n);let i=Sye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Qt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&Pye(this,this.position)};var Uat=new m,Vat=new m,zat=new m;Qt.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Uat),n=m.clone(this.upWC,Vat),i=m.clone(this.directionWC,zat);F.clone(e,this._transform),this._transformChanged=!0,yc(this);let r=this._actualInvTransform;F.multiplyByPoint(r,t,this.position),F.multiplyByPointAsVector(r,i,this.direction),F.multiplyByPointAsVector(r,n,this.up),m.cross(this.direction,this.up,this.right),yc(this)};var Hat=new H,Gat=new vn,Wat=new m,jat=new m;function vye(e){if(!F.equals(F.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Hat;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let r;if(l(n)){let a=e.getPickRay(i,Gat);r=n.pickWorldCoordinates(a,t,!0,Wat)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,jat));let s;if(l(r)||l(o)){let a=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Qt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof nn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=vye(this)))};var fH=new m,KY=new F,qat=new F,JY=new Ne,ZY=new $,wye=new me;function Yat(e,t,n){let i=F.clone(e.transform,KY),r=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,qat);e._setTransform(r),m.clone(m.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Ne.fromHeadingPitchRoll(n,JY),s=$.fromQuaternion(o,ZY);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Xat(e,t,n,i){let r=F.clone(e.transform,KY);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,wye);t=a.project(c,fH)}m.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Ne.fromHeadingPitchRoll(n,JY),s=$.fromQuaternion(o,ZY);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function Kat(e,t,n,i){let r=F.clone(e.transform,KY);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,wye);t=c.project(u,fH)}H.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ul.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Ne.fromHeadingPitchRoll(n,JY),s=$.fromQuaternion(o,ZY);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(r)}var Jat=new m,Zat=new m,$at=new m;function Iye(e,t,n,i){let r=m.clone(n.direction,Jat),o=m.clone(n.up,Zat);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,lH),u=F.inverseTransformation(c,uH);F.multiplyByPointAsVector(u,r,r),F.multiplyByPointAsVector(u,o,o)}let s=m.cross(r,o,$at);return i.heading=Aye(r,o),i.pitch=Eye(r),i.roll=Sye(r,o,s),i}var XY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},FS=new za;Qt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),r=y(e.destination,m.clone(this.positionWC,fH));l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,fH),i=!1),l(t.direction)&&(t=Iye(this,r,t,XY.orientation)),FS.heading=y(t.heading,0),FS.pitch=y(t.pitch,-D.PI_OVER_TWO),FS.roll=y(t.roll,0),n===ne.SCENE3D?Yat(this,r,FS):n===ne.SCENE2D?Kat(this,r,FS,i):Xat(this,r,FS,i)};var Qat=new m;Qt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Qt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Qt.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*Qt.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Qat).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};Qt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),yc(this),F.multiplyByVector(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),yc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),yc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};Qt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),yc(this),F.multiplyByVector(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),yc(this),F.multiplyByPoint(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),yc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function Pye(e,t){let n=e._scene.mapMode2D===Ul.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var pye=new m;Qt.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,pye),m.add(n,pye,n),this._mode===ne.SCENE2D&&Pye(this,n),this._adjustOrthographicFrustum(!0)};Qt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?dH(this,e):this.move(this.direction,e)};Qt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?dH(this,-e):this.move(this.direction,-e)};Qt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Qt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Qt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Qt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Qt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Qt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Qt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Qt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var ect=new Ne,tct=new $;Qt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Ne.fromAxisAngle(e,-n,ect),r=$.fromQuaternion(i,tct),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};Qt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Qt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var nct=new Ne,ict=new $;Qt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Ne.fromAxisAngle(e,-n,nct),r=$.fromQuaternion(i,ict);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Qt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Dye(this,e)};Qt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Dye(this,-e)};var rct=new m,oct=new m,sct=new m,_ye=new m;function Dye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,D.EPSILON2)){let i=m.normalize(n,rct),r=m.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=m.equalsEpsilon(i,m.negate(e.constrainedAxis,_ye),D.EPSILON2);if(!r&&!o){let s=m.normalize(e.constrainedAxis,oct),a=m.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=m.dot(i,m.negate(s,_ye)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=m.cross(s,i,sct);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Qt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Rye(this,-e)};Qt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Rye(this,e)};function Rye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function dH(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ul.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ul.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function Oye(e,t){e.move(e.direction,t)}Qt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?dH(this,e):Oye(this,e)};Qt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?dH(this,-e):Oye(this,-e)};Qt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var act=new F;Qt.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,re.WGS84,act);this.lookAtTransform(n,t)};var cct=new m,lct=new Ne,uct=new Ne,fct=new $;function Mye(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Ne.fromAxisAngle(m.UNIT_Y,-t,lct),r=Ne.fromAxisAngle(m.UNIT_Z,-e,uct),o=Ne.multiply(r,i,r),s=$.fromQuaternion(o,fct),a=m.clone(m.UNIT_X,cct);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}Qt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Mye(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<D.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(F.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<D.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var vF=new me,dct=new me,mct=new m,hct=new m,pct=new m,_ct=new m,gct=new m,yct=new m,xct=new m,jY=new m,bct={direction:new m,right:new m,up:new m},gye;function gc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Lye(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:bct,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=D.TWO_PI);let f=(u+c)*.5,d;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let L=vF;L.longitude=f,L.latitude=s,L.height=0;let N=dct;N.longitude=f,N.latitude=a,N.height=0;let _=gye;(!l(_)||_.ellipsoid!==r)&&(gye=_=new $u(void 0,void 0,r)),_.setEndPoints(L,N),d=_.interpolateUsingFraction(.5,vF).latitude}let p=vF;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,xct),h=vF;h.longitude=c,h.latitude=s;let x=r.cartographicToCartesian(h,mct);h.longitude=u;let b=r.cartographicToCartesian(h,pct);h.longitude=f;let C=r.cartographicToCartesian(h,gct);h.latitude=a;let A=r.cartographicToCartesian(h,yct);h.longitude=c;let T=r.cartographicToCartesian(h,_ct);h.longitude=u;let S=r.cartographicToCartesian(h,hct);m.subtract(b,g,b),m.subtract(T,g,T),m.subtract(x,g,x),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(A,g,A);let v=r.geodeticSurfaceNormal(g,o.direction);m.negate(v,v);let I=m.cross(v,m.UNIT_Z,o.right);m.normalize(I,I);let O=m.cross(I,v,o.up),R;if(e.frustum instanceof nn){let L=Math.max(m.distance(x,b),m.distance(T,S)),N=Math.max(m.distance(x,T),m.distance(b,S)),_,E,w=e.frustum._offCenterFrustum,P=w.right/w.top,M=N*P;L>M?(_=L,E=_/P):(E=N,_=M),R=Math.max(_,E)}else{let L=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*L;if(R=Math.max(gc(v,O,b,L),gc(v,O,T,L),gc(v,O,x,L),gc(v,O,S,L),gc(v,O,C,L),gc(v,O,A,L),gc(v,I,b,N),gc(v,I,T,N),gc(v,I,x,N),gc(v,I,S,N),gc(v,I,C,N),gc(v,I,A,N)),a<0&&s>0){let _=vF;_.longitude=u,_.latitude=0,_.height=0;let E=r.cartographicToCartesian(_,jY);m.subtract(E,g,E),R=Math.max(R,gc(v,O,E,L),gc(v,I,E,N)),_.longitude=c,E=r.cartographicToCartesian(_,jY),m.subtract(E,g,E),R=Math.max(R,gc(v,O,E,L),gc(v,I,E,N))}}return m.add(g,m.multiplyByScalar(v,-R,jY),n)}var Cct=new me,Tct=new m,Act=new m;function Ect(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=Cct;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Tct);F.multiplyByPoint(r,a,a),F.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Act);if(F.multiplyByPoint(r,c,c),F.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var Sct=new me,vct=new m,wct=new m;function Ict(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Ul.INFINITE_SCROLL?r+=D.TWO_PI:(t=ce.MAX_VALUE,r=t.east));let o=Sct;o.longitude=r,o.latitude=t.north;let s=i.project(o,vct);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,wct),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}Qt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===ne.SCENE3D)return Lye(this,e,t);if(n===ne.COLUMBUS_VIEW)return Ect(this,e,t);if(n===ne.SCENE2D)return Ict(this,e,t)};var Pct=new vn;function Dct(e,t,n,i){n=y(n,re.WGS84);let r=e.getPickRay(t,Pct),o=$i.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return vn.getPoint(r,s,i)}var Rct=new vn;function Oct(e,t,n,i){let o=e.getPickRay(t,Rct).origin;o=m.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Mct=new vn;function Lct(e,t,n,i){let r=e.getPickRay(t,Mct),o=-r.origin.x/r.direction.x;vn.getPoint(r,o,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Qt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,re.WGS84),this._mode===ne.SCENE3D)n=Dct(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Oct(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=Lct(this,e,this._projection,n);else return;return n}};var Nct=new m,Fct=new m,Bct=new m;function kct(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,Nct);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,u*c*a,Fct),h=m.multiplyByScalar(e.upWC,f*c*s,Bct),x=m.add(p,g,n.direction);return m.add(x,h,x),m.subtract(x,d,x),m.normalize(x,x),n}var aH=new m;function Uct(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,aH),m.add(aH,f,f),m.multiplyByScalar(e.up,u,aH),m.add(aH,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Qt.prototype.getPickRay=function(e,t){l(t)||(t=new vn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?kct(this,e,t):Uct(this,e,t)};var Vct=new m,zct=new m;Qt.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Vct),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),zct);return Math.max(0,m.magnitude(n)-e.radius)};var Hct=new H;Qt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Hct);return Math.max(r.x,r.y)};function Gct(e,t,n,i,r,o){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Fo.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Wct=new m,yye=new m,jct=new m,qct=new m;function Yct(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(m.UNIT_X,Wct),o=-m.dot(r,n)/m.dot(r,i),s=m.add(n,m.multiplyByScalar(i,o,yye),yye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,jct);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=m.magnitude(m.subtract(n,s,qct)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-x||n.y>x){let b=s.y<-h||s.y>h,C=s.z<-x||s.z>x;if(b||C)return Gct(e,n,s,h,x,t)}}Qt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Yct(this,e)};var Xct=new m,Gs={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Qt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Qt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Gs.destination,e.orientation.heading=Gs.heading,e.orientation.pitch=Gs.pitch,e.orientation.roll=Gs.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Qt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Xct));let r=y(e.orientation,y.EMPTY_OBJECT);if(l(r.direction)&&(r=Iye(this,t,r,XY.orientation)),l(e.duration)&&e.duration<=0){let f=XY;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Gs.destination=t,Gs.heading=r.heading,Gs.pitch=r.pitch,Gs.roll=r.roll,Gs.duration=e.duration,Gs.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Gs.cancel=e.cancel,Gs.endTransform=e.endTransform,Gs.convert=i?!1:e.convert,Gs.maximumHeight=e.maximumHeight,Gs.pitchAdjustHeight=e.pitchAdjustHeight,Gs.flyOverLongitude=e.flyOverLongitude,Gs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Gs.easingFunction=e.easingFunction;let a=this._scene,c=SF.createTween(a,Gs);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=Qt.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Kct(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function Jct(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var Zct=100;function Nye(e,t,n){n=xu.clone(l(n)?n:Qt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=Zct:e.frustum instanceof nn||e._mode===ne.SCENE2D?n.range=Jct(e,s):n.range=Kct(e,s),n.range=D.clamp(n.range,i,r)}return n}Qt.prototype.viewBoundingSphere=function(e,t){t=Nye(this,e,t),this.lookAt(e.center,t)};var $ct=new F,Qct=new m,elt=new m,tlt=new m,nlt=new m,ilt=new oe,rlt=new Ne,olt=new $;Qt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=Nye(this,e,t.offset),r;n?r=m.multiplyByScalar(m.UNIT_Z,i.range,Qct):r=Mye(i.heading,i.pitch,i.range);let o=Mt.eastNorthUpToFixedFrame(e.center,re.WGS84,$ct);F.multiplyByPoint(o,r,r);let s,a;if(!n){if(s=m.subtract(e.center,r,elt),m.normalize(s,s),a=F.multiplyByPointAsVector(o,m.UNIT_Z,tlt),1-Math.abs(m.dot(s,a))<D.EPSILON6){let u=Ne.fromAxisAngle(s,i.heading,rlt),f=$.fromQuaternion(u,olt);m.fromCartesian4(F.getColumn(o,1,ilt),a),$.multiplyByVector(f,a,a)}let c=m.cross(s,a,nlt);m.cross(c,s,a),m.normalize(a,a)}this.flyTo({destination:r,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var xye=new m,bye=new m,qY=new m,Cye=new m,wF=[new m,new m,new m,new m];function slt(e,t){let n=t.radii,i=e.positionWC,r=m.multiplyComponents(t.oneOverRadii,i,xye),o=m.magnitude(r),s=m.normalize(r,bye),a,c;m.equalsEpsilon(s,m.UNIT_Z,D.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,qY),qY),c=m.normalize(m.cross(s,a,Cye),Cye));let u=Math.sqrt(m.magnitudeSquared(r)-1),f=m.multiplyByScalar(s,1/o,xye),d=u/o,p=m.multiplyByScalar(a,d,bye),g=m.multiplyByScalar(c,d,qY),h=m.add(f,g,wF[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let x=m.subtract(f,g,wF[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let b=m.subtract(f,g,wF[2]);m.add(b,p,b),m.multiplyComponents(n,b,b);let C=m.add(f,g,wF[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),wF}var YY=new H,alt=new m,r0=[new me,new me,new me,new me];function cH(e,t,n,i,r,o){YY.x=e,YY.y=t;let s=i.pickEllipsoid(YY,r,alt);return l(s)?(r0[n]=r.cartesianToCartographic(s,r0[n]),1):(r0[n]=r.cartesianToCartographic(o[n],r0[n]),0)}Qt.prototype.computeViewRectangle=function(e,t){e=y(e,re.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===en.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=slt(this,e);if(c+=cH(0,0,0,this,e,u),c+=cH(0,a,1,this,e,u),c+=cH(s,a,2,this,e,u),c+=cH(s,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(r0,t);let f=0,d=r0[3].longitude;for(let p=0;p<4;++p){let g=r0[p].longitude,h=Math.abs(g-d);h>D.PI?f+=D.TWO_PI-h:f+=h,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,r0[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};Qt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Ii)return;let e=this._scene;this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};Qt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof nn)return;let e=vye(this),t=this._scene;this.frustum=new nn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Qt.clone=function(e,t){return l(t)||(t=new Qt(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var mr=Qt;function clt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Wf=clt;var Vye=Ki(Xl(),1),Fye=576,llt=100,IF="#ffffff",$Y="#48b";function zye(e,t){this.credit=e,this.count=y(t,1)}function Hye(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(vt.equals(r,t))return!0}return!1}function ult(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;vt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Gye="cesium-credit-delimiter";function Bye(e){let t=document.createElement("span");return t.textContent=e,t.className=Gye,t}function kye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Uye(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(Bye(n));else{let f=r[u];f.className!==Gye&&e.replaceChild(Bye(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(kye(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(kye(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function flt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Fye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Fye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function xc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } +`,n}function dlt(e){let t="";t+=xc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=xc(".cesium-credit-lightbox",{"background-color":"#303336",color:IF,position:"relative","min-height":`${llt}px`,margin:"auto"}),t+=xc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:IF}),t+=xc(".cesium-credit-lightbox > ul > li a:hover",{color:$Y}),t+=xc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=xc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=xc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=xc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:IF}),t+=xc(".cesium-credit-lightbox-close:hover",{color:$Y}),t+=xc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=xc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=xc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=xc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:IF}),t+=xc(".cesium-credit-expand-link:hover",{color:$Y}),t+=xc(".cesium-credit-text",{color:IF}),t+=xc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Br(e,t,n){let i=this;n=y(n,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function s(h){o.contains(h.target)||i.hideLightbox()}r.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",o.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let u=document.createElement("ul");o.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),dlt(e);let g=vt.clone(Br.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=r,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Tt,lightboxCredits:new Tt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Wye(e,t,n,i){i=y(i,1);let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new zye(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Br.prototype.addCredit=function(e){Q("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};Br.prototype.addCreditToNextFrame=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=vt.clone(jye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Wye(this,t,e)};Br.prototype.addDefaultCredit=function(e){Q("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;Hye(t,e)||(e.showOnScreen=!0,t.push(e))};Br.prototype.addStaticCredit=function(e){let t=this._staticCredits;Hye(t,e)||t.push(e)};Br.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Br.prototype.removeDefaultCredit=function(e){Q("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};Br.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Br.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Br.prototype.update=function(){this._expanded&&flt(this)};Br.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o._isIon&&vt.equals(Br.cesiumCredit,this._cesiumCredit)||Wye(this,s,o,Number.MAX_VALUE)}vt.equals(Br.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=vt.clone(Br.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Br.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Uye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Uye(this._creditList,t,void 0,"li"),ult(this)};Br.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Br.prototype.isDestroyed=function(){return!1};Br._cesiumCredit=void 0;Br._cesiumCreditInitialized=!1;var mH;function jye(){if(!l(mH)){let e=tn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Vye.default(e).path()),mH=new vt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return Br._cesiumCreditInitialized||(Br._cesiumCredit=mH,Br._cesiumCreditInitialized=!0),mH}Object.defineProperties(Br,{cesiumCredit:{get:function(){return jye(),Br._cesiumCredit},set:function(e){Br._cesiumCredit=e,Br._cesiumCreditInitialized=!0}}});Br.CreditDisplayElement=zye;var PF=Br;function hH(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var mlt=new m,hlt=new $,plt=new Ne,_lt=new Ii,glt=new Zc,ylt=new nn,xlt=new vo,blt=new z,Clt=[1,1e5];hH.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof Ii?a=_lt:s instanceof Zc?a=glt:s instanceof nn?a=ylt:a=xlt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Clt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=m.negate(g,mlt);let h=hlt;$.setColumn(h,0,g,h),$.setColumn(h,1,p,h),$.setColumn(h,2,d,h);let x=Ne.fromRotationMatrix(h,plt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new wn({geometryInstances:new Ct({geometry:new tC({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(z.fromAlpha(this._color,.1,blt))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new wn({geometryInstances:new Ct({geometry:new fN({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};hH.prototype.isDestroyed=function(){return!1};hH.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var Mh=hH;function RF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var DF=Wt.supportsTypedArrays()?new Float32Array(12):[],qye=new m,Yye=new m,QY=new m,Xye=new m,pH=new m;function Tlt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof nn)r=m.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,qye),g=m.normalize(p,Yye),h=m.normalize(m.cross(m.UNIT_Z,p,QY),QY),x=m.normalize(m.cross(g,h,Xye),Xye),b=m.magnitude(p),C=Math.sqrt(b*b-1);r=m.multiplyByScalar(g,1/b,qye);let A=C/b;o=m.multiplyByScalar(h,A,Yye),s=m.multiplyByScalar(x,A,QY)}let a=m.add(r,s,pH);m.subtract(a,o,a),m.multiplyComponents(n,a,a),m.pack(a,DF,0);let c=m.subtract(r,s,pH);m.subtract(c,o,c),m.multiplyComponents(n,c,c),m.pack(c,DF,3);let u=m.add(r,s,pH);m.add(u,o,u),m.multiplyComponents(n,u,u),m.pack(u,DF,6);let f=m.subtract(r,s,pH);return m.add(f,o,f),m.multiplyComponents(n,f,f),m.pack(f,DF,9),DF}RF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new tt({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:Ee.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new ze({sources:[zN]}),a=new ze({sources:[VN]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Jt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=Tlt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new ft({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Le.TRIANGLES});this._va=si.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};RF.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};RF.prototype.isDestroyed=function(){return!1};RF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var OF=RF;function MF(){}var Alt=/\bgl_FragDepth\b/,Elt=/\bdiscard\b/;function Slt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource,o,s=!1,a=r.sources,c=a.length;for(o=0;o<c;++o)if(Alt.test(a[o])||Elt.test(a[o])){s=!0;break}let u=!1,f=r.defines;for(c=f.length,o=0;o<c;++o)if(f[o]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main() +{ + out_FragColor = vec4(1.0); +} +`,r=new ze({sources:[d]})):!s&&u&&(d=`void main() +{ + out_FragColor = vec4(1.0); + czm_writeLogDepth(); +} +`,r=new ze({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}function vlt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let r=Ue.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ue.fromCache(r),n[t.id]=i}return i}MF.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=tt.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Slt(n,t.shaderProgram),i.depthOnlyCommand.renderState=vlt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var wlt=/\s+czm_writeLogDepth\(/,Ilt=/\s+czm_vertexLogDepth\(/;function Plt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,u=!1,f=o.sources,d=f.length;for(a=0;a<d;++a)if(Ilt.test(f[a])){u=!0;break}if(!u){for(a=0;a<d;++a)f[a]=ze.replaceMain(f[a],"czm_log_depth_main");c=` + +void main() +{ + czm_log_depth_main(); + czm_vertexLogDepth(); +} +`,f.push(c)}for(f=s.sources,d=f.length,u=!1,a=0;a<d;++a)wlt.test(f[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<d;a++)f[a]=ze.replaceMain(f[a],"czm_log_depth_main");p+=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); +} +`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}return i}MF.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Plt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Dlt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let r=t._attributeLocations,o=t.fragmentShaderSource,s=o.sources,a=s.length;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${z.floatToByte(n.color.red)}, ${z.floatToByte(n.color.green)}, ${z.floatToByte(n.color.blue)}, ${z.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let c=`void main() +{ + czm_non_pick_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = ${n}; +} +`,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=ze.replaceMain(s[f],"czm_non_pick_main");u[a]=c,o=new ze({sources:u,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}function Rlt(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let r=Ue.getState(t);r.blending.enabled=!1,r.depthMask=!0,i=Ue.fromCache(r),n[t.id]=i}return i}MF.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=tt.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Dlt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Rlt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};function Olt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}MF.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Olt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var z_=MF;function _H(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(r),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Mlt=new Ne,Kye=new Ne,Llt=new $;function Nlt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Ne.fromAxisAngle(r,n,Kye),c=Ne.fromAxisAngle(o,i,Mlt),u=Ne.multiply(c,a,c),f=Ne.fromAxisAngle(s,t,Kye);Ne.multiply(f,u,u);let d=$.fromQuaternion(u,Llt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}_H.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Nlt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};_H.prototype.isDestroyed=function(){return!1};_H.prototype.destroy=function(){return this._removeListener(),ue(this)};var LF=_H;function Jye(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var gH=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],Lh=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<Lh.length;++e)Lh[e]*=1e6;var Zye=Lh[1],eX=Lh[Lh.length-1];for(let e=0;e<Lh.length;++e)Lh[e]=(Lh[e]-eX)/(Zye-eX);var ua=0;function Flt(e){let t=gH,n=t.length;if(e<t[0])return ua=0,ua;if(e>t[n-1])return ua=n-2,ua;if(e>=t[ua]){if(ua+1<n&&e<t[ua+1])return ua;if(ua+2<n&&e<t[ua+2])return++ua,ua}else if(ua-1>=0&&e>=t[ua-1])return--ua,ua;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ua=i,ua}var Blt=new m;Jye.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let r=i.height,o=Flt(r),s=D.clamp((r-gH[o])/(gH[o+1]-gH[o]),0,1),a=D.lerp(Lh[o],Lh[o+1],s),c=this.density*1e6,u=c/Zye*eX;a=a*(c-u)*1e-6;let f=m.normalize(n.positionWC,Blt),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var NF=Jye;function klt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var FF=klt;var fa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},mC=fa.DERIVED_COMMANDS_MAXIMUM_LENGTH,a0e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function hC(){this._frontFaceAlphaByDistance=new Ot(0,1,0,1),this._backFaceAlphaByDistance=new Ot(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(mC),this._derivedBlendCommandTypes=new Array(mC),this._derivedPickCommandTypes=new Array(mC),this._derivedCommandTypesToUpdate=new Array(mC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(hC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});hC.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=$ye(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=$ye(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Qye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Qye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Hlt(this,e,t),this._sunVisibleThroughGlobe=Ult(this,e),this._environmentVisible=Vlt(this,e),this._useDepthPlane=zlt(this,e),this._numberOfTextureUniforms=Glt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Wlt(this,e)};function $ye(e,t,n,i){return e?l(n)?(Ot.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function Qye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Ult(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Vlt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function zlt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Hlt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function Glt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Wlt(e,t){e._derivedCommandsLength=tX(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=tX(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=tX(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<mC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=out())}function tX(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?fa.PICK_FRONT_FACE:u?fa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_FRONT_FACE,d=i?fa.PICK_BACK_FACE:u?fa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(r[o++]=fa.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=fa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=fa.DEPTH_ONLY_BACK_FACE),r[o++]=fa.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=fa.DEPTH_ONLY_FRONT_FACE),r[o++]=fa.OPAQUE_BACK_FACE,r[o++]=f),o)}function jf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function e0e(e,t){return e.indexOf(t)>-1}function jlt(e,t){jf(e.defines,"TRANSLUCENT"),jf(t.defines,"TRANSLUCENT")}function qlt(e,t){jf(e.defines,"GROUND_ATMOSPHERE"),jf(t.defines,"GROUND_ATMOSPHERE"),jf(e.defines,"FOG"),jf(t.defines,"FOG"),jf(e.defines,"TRANSLUCENT"),jf(t.defines,"TRANSLUCENT")}function nX(e,t){if(e0e(t.defines,"TILE_LIMIT_RECTANGLE")||e0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function iX(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=ze.replaceMain(n[o],"czm_globe_translucency_main");let r=` + +uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; +#ifdef MANUAL_DEPTH_TEST + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + if (logDepthOrDepth != 0.0) + { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + float depthEC = eyeCoordinate.z / eyeCoordinate.w; + if (v_positionEC.z < depthEC) + { + discard; + } + } +#endif + czm_globe_translucency_main(); + vec4 classificationColor = texture(u_classificationTexture, st); + if (classificationColor.a > 0.0) + { + // Reverse premultiplication process to get the correct composited result of the classification primitives + classificationColor.rgb /= classificationColor.a; + } + out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); +} +`;n.push(r)}function c0e(e,t){iX(e,t),jf(e.defines,"GROUND_ATMOSPHERE"),jf(t.defines,"GROUND_ATMOSPHERE"),jf(e.defines,"FOG"),jf(t.defines,"FOG")}function Ylt(e,t){iX(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Xlt(e,t){c0e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function t0e(e,t){let n=`uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; + vec4 pickColor = texture(u_classificationTexture, st); + if (pickColor == vec4(0.0)) + { + discard; + } + out_FragColor = pickColor; +} +`;t.sources=[n]}function Klt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Jlt(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Zlt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function $lt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Qlt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function eut(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function n0e(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function i0e(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=dn.ALPHA_BLEND}function tut(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function nut(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function iut(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ue.getState(e);i(s),o=Ue.fromCache(s),r[e.id]=o}return o}function BS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function rut(e,t,n,i,r){return l(r)?!i&&l(n)?n:gt(t,r(e),!1):t}function Am(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function out(){return[new Am({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:jlt,getRenderStateFunction:Jlt,getUniformMapFunction:void 0}),new Am({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:qlt,getRenderStateFunction:Zlt,getUniformMapFunction:void 0}),new Am({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:nX,getRenderStateFunction:$lt,getUniformMapFunction:void 0}),new Am({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:nX,getRenderStateFunction:Qlt,getUniformMapFunction:void 0}),new Am({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:nX,getRenderStateFunction:eut,getUniformMapFunction:void 0}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:iX,getRenderStateFunction:n0e,getUniformMapFunction:BS}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:c0e,getRenderStateFunction:i0e,getUniformMapFunction:BS}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Ylt,getRenderStateFunction:n0e,getUniformMapFunction:BS}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Xlt,getRenderStateFunction:i0e,getUniformMapFunction:BS}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:t0e,getRenderStateFunction:tut,getUniformMapFunction:BS}),new Am({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:t0e,getRenderStateFunction:nut,getUniformMapFunction:BS})]}var r0e=new Array(mC),o0e=new Array(mC);hC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)o0e[r]=this._derivedCommandPacks[n[r]],r0e[r]=a0e[n[r]];sut(this,e,i,n,r0e,o0e,t)}};function sut(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let C=o[b],A=i[b],T=r[b],S=a[T],v,I,O;l(S)?(v=S.uniformMap,I=S.shaderProgram,O=S.renderState):(v=void 0,I=void 0,O=void 0),S=tt.shallowClone(t,S),a[T]=S;let R=y(S.derivedCommands.uniformMapDirtyFrame,0),L=y(S.derivedCommands.shaderProgramDirtyFrame,0),N=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||R<f,E=h||L<d,w=x||N<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),w&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=A,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=rut(e,t.uniformMap,v,_,C.getUniformMapFunction),S.shaderProgram=Klt(s.context,t.shaderProgram,I,E,C.getShaderProgramFunction,T),S.renderState=iut(t.renderState,O,w,C.getRenderStateFunction,C.renderStateCache)}}}hC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=a0e[r[a]];n.commandList.push(s[c])}};function l0e(e,t,n,i,r,o,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,r,o)}}function s0e(e,t,n,i,r,o){for(let s=0;s<t;++s)n(e[s],i,r,o)}var aut=[fa.OPAQUE_FRONT_FACE,fa.OPAQUE_BACK_FACE],cut=[fa.DEPTH_ONLY_FRONT_FACE,fa.DEPTH_ONLY_BACK_FACE,fa.DEPTH_ONLY_FRONT_AND_BACK_FACE];hC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ee.GLOBE],a=e.indices[Ee.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),l0e(s,a,t,i,o,r,aut))};hC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ee.GLOBE],a=e.indices[Ee.GLOBE],c=e.commands[Ee.TERRAIN_CLASSIFICATION],u=e.indices[Ee.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&s0e(c,u,t,i,o,r),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=o.uniformState.globeDepthTexture,g=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,l0e(s,a,t,i,o,r,cut),o.depthTexture){let h=n.packDepth(o,r);o.uniformState.globeDepthTexture=h}s0e(c,u,t,i,o,r),o.uniformState.globeDepthTexture=p,r.framebuffer=g};var BF=hC;var Vl=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;function Nh(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Nh.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Nh.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var lut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Wn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Wn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},uut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Wn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Wn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:dn.ALPHA_BLEND},fut={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:dn.ALPHA_BLEND},dut=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } + bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); +#ifdef UNCLASSIFIED + vec4 highlightColor = czm_invertClassificationColor; + if (isClassified) + { + discard; + } +#else + vec4 highlightColor = vec4(1.0); + if (!isClassified) + { + discard; + } +#endif + out_FragColor = color * highlightColor; + gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; +} +`,mut=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } +#ifdef UNCLASSIFIED + out_FragColor = color * czm_invertClassificationColor; +#else + out_FragColor = color; +#endif +} +`;Nh.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Lt({context:e,width:s,height:a,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Xe.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new ou({context:e,width:s,height:a,format:kc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(lut),this._rsClassified=Ue.fromCache(uut),this._rsDefault=Ue.fromCache(fut)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?mut:dut,f=new ze({defines:["UNCLASSIFIED"],sources:[u]}),d=new ze({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Vl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Nh.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Nh.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Nh.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Nh.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var kS=Nh;function yH(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(yH.prototype,{total:{get:function(){return this._total}}});function o0(e){let t=new Array(Ca.NUMBER_OF_JOB_TYPES);t[Ca.TEXTURE]=new yH(l(e)?e[Ca.TEXTURE]:10),t[Ca.PROGRAM]=new yH(l(e)?e[Ca.PROGRAM]:10),t[Ca.BUFFER]=new yH(l(e)?e[Ca.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}o0.getTimestamp=Ci;Object.defineProperties(o0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});o0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};o0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};o0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=o0.getTimestamp();e.execute();let a=o0.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var kF=o0;function xH(e){e=y(e,y.EMPTY_OBJECT);let t=Pn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ci(),this._lastMsSampleTime=Ci(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(xH.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});xH.prototype.update=function(e){let t=Ci(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};xH.prototype.destroy=function(){return ue(this)};var H_=xH;function pC(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(pC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function hut(e,t,n){let i=n.width,r=n.height;e._framebuffer.update(t,i,r)}function put(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ + out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); +} +`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:Ue.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}pC.prototype.update=function(e,t){hut(this,e,t),put(this,e,t)};var _ut=new oe,gut=new oe(1,1/255,1/65025,1/16581375);pC.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=oe.unpack(i,0,_ut);return oe.divideByScalar(r,255,r),oe.dot(r,gut)};pC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var UF=pC;function yut(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ee.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var VF=yut;var s0=`uniform highp sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); +} +`;function Fh(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ye,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Fh.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function xut(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function u0e(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ye.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ye.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ye.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ye.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Wn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Wn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(s0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Vl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(s0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Vl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new li({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Fh.prototype.update=function(e,t,n,i,r,o){let s=n.width,a=n.height,c=r?e.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT:Xe.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),u0e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o};Fh.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Fh.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Fh.prototype.executeUpdateDepth=function(e,t,n,i){let r=l(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,o,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,o,s),u0e(this,e,o,s,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Fh.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Fh.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Fh.prototype.isDestroyed=function(){return!1};Fh.prototype.destroy=function(){return xut(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var zF=Fh;function _C(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ye,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(_C.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function but(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Cut(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT:Xe.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function Tut(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ye.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ye.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ye.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ye.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(s0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}_C.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;Cut(this,n,r,o,e),Tut(this,n,r,o,i),this._useHdr=e};_C.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};_C.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return but(this),ue(this)};var HF=_C;function G_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ye,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function f0e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function rX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function d0e(e){f0e(e),rX(e)}function Aut(e,t,n,i){f0e(e),e._accumulationTexture=new Lt({context:t,width:n,height:i,pixelFormat:ct.RGBA,pixelDatatype:Xe.FLOAT});let r=new Float32Array(n*i*4);e._revealageTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Xe.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}function Eut(e,t){rX(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(rX(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(d0e(e),e._translucentMultipassSupport=!1,i=!1)}return i}G_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,Aut(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Eut(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new ze({sources:[UN]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new ze({defines:["MRT"],sources:[uS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new ze({sources:[uS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!Ye.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ye.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ye.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Ye.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Ue.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Sut={enabled:!0,color:new z(0,0,0,0),equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.ONE,functionDestinationRgb:wr.ONE,functionSourceAlpha:wr.ZERO,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA},vut={enabled:!0,color:new z(0,0,0,0),equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.ONE,functionDestinationRgb:wr.ONE,functionSourceAlpha:wr.ONE,functionDestinationAlpha:wr.ONE},wut={enabled:!0,color:new z(0,0,0,0),equationRgb:_a.ADD,equationAlpha:_a.ADD,functionSourceRgb:wr.ZERO,functionDestinationRgb:wr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:wr.ZERO,functionDestinationAlpha:wr.ONE_MINUS_SOURCE_ALPHA};function oX(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ue.getState(i);o.depthMask=!1,o.blending=t,r=Ue.fromCache(o),n[i.id]=r}return r}function Iut(e,t,n){return oX(t,Sut,e._translucentRenderStateCache,n)}function Put(e,t,n){return oX(t,vut,e._translucentRenderStateCache,n)}function Dut(e,t,n){return oX(t,wut,e._alphaRenderStateCache,n)}var Rut=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragData_0 = vec4(Ci * wzi, ai); + out_FragData_1 = vec4(ai * wzi); +`,Out=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragColor = vec4(Ci, ai) * wzi; +`,Mut=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function sX(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return ze.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +bool czm_discard = false; +`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; +${u}`}return a.sources.push(u),a.sources.push(`void main() +{ + czm_translucent_main(); + if (czm_discard) + { + discard; + } +${i}} +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Lut(e,t){return sX(e,t,"translucentMRT",Rut)}function Nut(e,t){return sX(e,t,"translucentMultipass",Out)}function Fut(e,t){return sX(e,t,"alphaMultipass",Mut)}G_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=tt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Lut(t,e.shaderProgram),n.translucentCommand.renderState=Iut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=tt.shallowClone(e,n.translucentCommand),n.alphaCommand=tt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Nut(t,e.shaderProgram),n.translucentCommand.renderState=Put(this,t,e.renderState),n.alphaCommand.shaderProgram=Fut(t,e.shaderProgram),n.alphaCommand.renderState=Dut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function But(e,t,n,i,r,o){let s,a,c,{context:u,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let b=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b);for(l(o)&&(s=o.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b);l(o)&&(s=o.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b)),i.framebuffer=h}function kut(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,x;for(let b=0;b<r.length;++b)h=r[b],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g);l(o)&&(h=o.unclassifiedCommand,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g)),i.framebuffer=d}G_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){kut(this,e,t,n,i,r);return}But(this,e,t,n,i,r)};G_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};G_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};G_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};G_.prototype.isDestroyed=function(){return!1};G_.prototype.destroy=function(){return d0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var GF=G_;function WF(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(WF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Uut(e){e._framebuffer.destroy()}function Vut(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new _c(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Ye},r.viewport=new Ye,e._passState=r}WF.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&Vut(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};WF.prototype.isDestroyed=function(){return!1};WF.prototype.destroy=function(){return Uut(this),ue(this)};var jF=WF;function YF(e){let t=new _c(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ye},t.viewport=new Ye,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}YF.prototype.begin=function(e,t){let n=this._context,i=t.width,r=t.height;return Ye.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};var qF=new z;YF.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),s=o*o,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+u+a);qF.red=z.byteToFloat(r[h]),qF.green=z.byteToFloat(r[h+1]),qF.blue=z.byteToFloat(r[h+2]),qF.alpha=z.byteToFloat(r[h+3]);let x=i.getObjectByPickColor(qF);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let h=d;d=-p,p=h}u+=d,f+=p}};YF.prototype.isDestroyed=function(){return!1};YF.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var XF=YF;function W_(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,owner:this})}function zut(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(W_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});W_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT:Xe.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};W_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};W_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};W_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};W_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};W_.prototype.isDestroyed=function(){return!1};W_.prototype.destroy=function(){return zut(this),ue(this)};var gC=W_;function yC(){}yC.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};yC.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=ze.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=ze.replaceMain(r[u],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; +void main() +{ + czm_shadow_cast_main(); + v_positionEC = (czm_inverseProjection * gl_Position).xyz; +}`;r.push(c)}return new ze({defines:i,sources:r})};yC.createShadowCastFragmentShader=function(e,t,n,i){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let s=ze.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=o.length;for(let f=0;f<c;++f)o[f]=ze.replaceMain(o[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; +`),u+=`uniform vec4 shadowMap_lightPositionEC; +`),i?u+=`void main() +{ +`:u+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) + { + discard; + } +`,t?u+=` float distance = length(${s}); + if (distance >= shadowMap_lightPositionEC.w) + { + discard; + } + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?u+=` out_FragColor = vec4(1.0); +`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,u+=`} +`,o.push(u),new ze({defines:r,sources:o})};yC.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};yC.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new ze({defines:i,sources:r})};yC.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=ze.findNormalVarying(e),s=!i&&l(o)||i&&r,a=ze.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,x=t.softShadows,b=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),A=e.sources.slice(0),T=A.length;for(let I=0;I<T;++I)A[I]=ze.replaceMain(A[I],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; +`:S+=`uniform sampler2D shadowMap_texture; +`;let v;return c?v=` return vec4(${a}, 1.0); +`:v=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,S+=`uniform mat4 shadowMap_matrix; +uniform vec3 shadowMap_lightDirectionEC; +uniform vec4 shadowMap_lightPositionEC; +uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; +uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; +#ifdef LOG_DEPTH +in vec3 v_logPositionEC; +#endif +vec4 getPositionEC() +{ +${v}} +vec3 getNormalEC() +{ +${s?` return normalize(${o}); +`:` return vec3(1.0); +`}} +void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) +{ +${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; + float normalOffsetScale = 1.0 - nDotL; + vec3 offset = normalOffset * normalOffsetScale * normalEC; + positionEC.xyz += offset; +`:""}} +`,S+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,S+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; + float distance = length(directionEC); + directionEC = normalize(directionEC); + float radius = shadowMap_lightPositionEC.w; + // Stop early if the fragment is beyond the point light radius + if (distance > radius) + { + return; + } + vec3 directionWC = czm_inverseViewRotation * directionEC; + shadowParameters.depth = distance / radius; + shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + shadowParameters.texCoords = directionWC; + float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); +`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); + float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Spot light uses a perspective projection, so perform the perspective divide + shadowPosition /= shadowPosition.w; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; + // Stop early if the eye depth exceeds the last cascade + if (depth > maxDepth) + { + return; + } + // Get the cascade based on the eye-space depth + vec4 weights = czm_cascadeWeights(depth); + // Apply normal offset + float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + // Transform position into the cascade + vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; + // Get visibility + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); + // Fade out shadows that are far away + float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; + float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); + visibility = mix(visibility, 1.0, fade); +${h?` // Draw cascade colors for debugging + out_FragColor *= czm_cascadeColor(weights); +`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`,S+=` out_FragColor.rgb *= visibility; +} +`,A.push(S),new ze({defines:C,sources:A})};var Bh=yC;function kh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Wt.isInternetExplorer()||Wt.isEdge()||(Wt.isChrome()||Wt.isFirefox())&&Wt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new bH,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new vo:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new oe;let r;this._isPointLight?r=6:this._cascadesEnabled?r=this._numberOfCascades:r=1,this._passes=new Array(r);for(let o=0;o<r;++o)this._passes[o]=new Hut(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,cX(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new _c(t),this._size=y(e.size,2048),this.size=this._size}kh.MAXIMUM_DISTANCE=2e4;function Hut(e){this.camera=new bH,this.passState=new _c(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function aX(e,t){return Ue.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function cX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=aX(t,e._primitiveBias),e._terrainRenderState=aX(t,e._terrainBias),e._pointRenderState=aX(t,e._pointBias)}kh.prototype.debugCreateRenderStates=function(){cX(this)};Object.defineProperties(kh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Xut(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function lX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Gut(e,t){let n=new ou({context:t,width:e._textureSize.x,height:e._textureSize.y,format:kc.DEPTH_COMPONENT16}),i=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,sampler:mn.NEAREST}),r=new ea({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Wut(e,t){let n=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Xe.UNSIGNED_INT_24_8,sampler:mn.NEAREST}),i=new ea({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function jut(e,t){let n=new ou({context:t,width:e._textureSize.x,height:e._textureSize.y,format:kc.DEPTH_COMPONENT16}),i=new Ha({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,sampler:mn.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new ea({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function p0e(e,t){e._isPointLight?jut(e,t):e._usesDepthTexture?Wut(e,t):Gut(e,t)}function qut(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,cX(e),lX(e),p0e(e,t))}function Yut(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(lX(e),p0e(e,t),qut(e,t),_0e(e,t))}function _0e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Xut(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ht.maximumCubeMapSize>=t?t:Ht.maximumCubeMapSize,r.x=t,r.y=t;let o=new Ye(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ht.maximumTextureSize>=t?t:Ht.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Ye(0,0,t,t)):i===4&&(t=Ht.maximumTextureSize>=t*2?t:Ht.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new Ye(0,0,t,t),n[1].passState.viewport=new Ye(t,0,t,t),n[2].passState.viewport=new Ye(0,t,t,t),n[3].passState.viewport=new Ye(t,t,t,t));e._clearPassState.viewport=new Ye(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new F(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Kut=new Ye;function Jut(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +in vec2 v_textureCoordinates; +void main() +{ + vec2 uv = v_textureCoordinates; + vec3 dir; + + if (uv.y < 0.5) + { + if (uv.x < 0.333) + { + dir.x = -1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 1.0; + } + else if (uv.x < 0.666) + { + dir.y = -1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 1.0; + } + else + { + dir.z = -1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 1.0; + } + } + else + { + if (uv.x < 0.333) + { + dir.x = 1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 3.0; + } + else if (uv.x < 0.666) + { + dir.y = 1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 3.0; + } + else + { + dir.z = 1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 3.0; + } + } + + float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); + out_FragColor = vec4(vec3(shadow), 1.0); +} +`:n=`uniform sampler2D shadowMap_texture; +in vec2 v_textureCoordinates; +void main() +{ +${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; +`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); +`} out_FragColor = vec4(vec3(shadow), 1.0); +} +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ee.OVERLAY,i}function Zut(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=Kut;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=Jut(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ye.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:Ye.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Uh=new Array(8);Uh[0]=new oe(-1,-1,-1,1);Uh[1]=new oe(1,-1,-1,1);Uh[2]=new oe(1,1,-1,1);Uh[3]=new oe(-1,1,-1,1);Uh[4]=new oe(-1,-1,1,1);Uh[5]=new oe(1,-1,1,1);Uh[6]=new oe(1,1,1,1);Uh[7]=new oe(-1,1,1,1);var a0=new F,uX=new Array(8);for(let e=0;e<8;++e)uX[e]=new oe;function $ut(e,t){let n=new Ct({geometry:new ad({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:zt.fromColor(t)}}),i=new Ct({geometry:new r_({radius:.5}),attributes:{color:zt.fromColor(t)}});return new wn({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Qut=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],eft=new m;function tft(e,t){Zut(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Mh({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Mh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Mh({camera:e._passes[i].camera,color:Qut[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Ne.IDENTITY,o=e._pointLightRadius*2,s=m.fromElements(o,o,o,eft),a=F.fromTranslationQuaternionRotationScale(i,r,s,a0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=$ut(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Mh({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function bH(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new F}bH.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var nft=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);bH.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(nft,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var ift=new Array(5),rft=new Ii,oft=new Array(4),g0e=new m,y0e=new m;function sft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=oft,g=ift;for(g[0]=r,g[s]=o,a=0;a<s;++a){let N=(a+1)/s,_=r*Math.pow(u,N),E=r+c*N,w=D.lerp(E,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let h=n.frustum,x=h.left,b=h.right,C=h.bottom,A=h.top,T=h.near,S=h.far,v=n.positionWC,I=n.directionWC,O=n.upWC,R=i.frustum.clone(rft),L=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let N=F.multiply(R.projectionMatrix,i.viewMatrix,a0),_=F.inverse(N,a0),E=F.multiply(L,_,a0),w=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,g0e),P=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,y0e);for(let G=0;G<8;++G){let k=oe.clone(Uh[G],uX[G]);F.multiplyByVector(E,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,w,w),m.maximumByComponent(k,P,P)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let M=e._passes[a],B=M.camera;B.clone(n);let V=B.frustum;V.left=x+w.x*(b-x),V.right=x+P.x*(b-x),V.bottom=C+w.y*(A-C),V.top=C+P.y*(A-C),V.near=T+w.z*(S-T),V.far=T+P.z*(S-T),M.cullingVolume=B.frustum.computeCullingVolume(v,I,O);let U=e._cascadeMatrices[a];F.multiply(B.getViewProjection(),i.inverseViewMatrix,U),F.multiply(M.textureOffsets,U,U)}}var aft=new F,cft=new m,lft=new m,m0e=new m;function uft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,a0),o=F.inverse(r,a0),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,cft);a=m.cross(c,s,lft),m.normalize(a,a),m.normalize(c,c);let u=m.fromElements(0,0,0,m0e),f=F.computeView(u,s,a,c,aft),d=F.multiply(f,o,a0),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,g0e),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,y0e);for(let S=0;S<8;++S){let v=oe.clone(Uh[S],uX[S]);F.multiplyByVector(d,v,v),m.divideByScalar(v,v.w,v),m.minimumByComponent(v,p,p),m.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let h=m0e;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let x=F.fromTranslation(h,a0);f=F.multiply(x,f,f);let b=.5*(g.x-p.x),C=.5*(g.y-p.y),A=g.z-p.z,T=n.frustum;T.left=-b,T.right=b,T.bottom=-C,T.top=C,T.near=.01,T.far=A,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var fft=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],dft=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],mft=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function hft(e,t){let n=new Ii;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=fft[i],r.upWC=dft[i],r.rightWC=mft[i],F.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),F.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var pft=new m,_ft=new m,x0e=new ae,h0e=x0e.center;function gft(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=x0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,pft),s=m.negate(i.directionWC,_ft),a=m.dot(o,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===en.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,o,h0e),h0e);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===en.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere)}}function yft(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,o.directionWC):e._isPointLight?m.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),m.normalize(s,s),m.negate(s,s),F.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=mr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,gft(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}kh.prototype.update=function(e){if(yft(this,e),this._needsUpdate)if(Yut(this,e.context),this._isPointLight&&hft(this,e),this._cascadesEnabled&&(uft(this,e),this._numberOfCascades>1&&sft(this,e)),this._isPointLight)this._shadowMapCullingVolume=ts.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&tft(this,e)};kh.prototype.updatePass=function(e,t){_0e(this,e,t)};var xft=new H;function b0e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=xft;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,oe.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return gt(t,r,!1)}function bft(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=tt.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ee.GLOBE,d=n.pass!==Ee.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Bh.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let b=u.vertexShaderSource,C=u.fragmentShaderSource,A=Bh.createShadowCastVertexShader(b,p,f),T=Bh.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:A,fragmentShaderSource:T,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=je(a,!1),a.cull=je(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=b0e(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}kh.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ee.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=tt.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,h=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||h||n||g){let x=Bh.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let b=Bh.createShadowReceiveVertexShader(a,u,f),C=Bh.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=b0e(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};kh.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=bft(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};kh.prototype.isDestroyed=function(){return!1};kh.prototype.destroy=function(){lX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var j_=kh;var xC=`uniform sampler2D colorTexture; + +#ifdef DEBUG_SHOW_DEPTH +uniform sampler2D u_packedTranslucentDepth; +#endif + +in vec2 v_textureCoordinates; + +void main() +{ +#ifdef DEBUG_SHOW_DEPTH + if (v_textureCoordinates.x < 0.5) + { + out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); + out_FragColor.a = 1.0; + } +#else + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef PICK + if (color == vec4(0.0)) + { + discard; + } +#else + // Reverse premultiplication process to get the correct composited result of the classification primitives + color.rgb /= color.a; +#endif + out_FragColor = color; +#endif +} +`;var Cft=!1;function c0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ye,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(c0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function C0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function T0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Tft(e,t,n,i){C0e(e),e._translucentDepthStencilTexture=new Lt({context:t,width:n,height:i,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Xe.UNSIGNED_INT_24_8,sampler:mn.NEAREST})}function Aft(e,t,n,i){T0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Eft(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(Tft(e,t,r,o),Aft(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new ze({sources:[kN]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new ze({sources:[xC]}),a={colorTexture:function(){return e._textureToComposite}},Cft&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new ze({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=tt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new ze({sources:[xC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new ze({sources:[xC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!Ye.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Ye.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ye.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Ye.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ye.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Wn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ye.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:dn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}c0.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<o;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(Eft(this,u,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<o;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};c0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,r,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};c0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Sft(this,e,t)};function Sft(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}c0.prototype.isSupported=function(){return this._supported};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){return C0e(this),T0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var KF=c0;function vft(){this.command=void 0,this.near=void 0,this.far=void 0}function CH(e,t,n){let i=e.context,r;i.depthTexture&&(r=new zF);let o;e._useOIT&&i.depthTexture&&(o=new GF(i));let s=new _c(i);s.viewport=Ye.clone(n),this.camera=t,this._cameraClone=mr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new XF(i),this.pickDepthFramebuffer=new jF,this.sceneFramebuffer=new gC,this.globeDepth=r,this.globeTranslucencyFramebuffer=new HF,this.oit=o,this.translucentTileClassification=new KF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var A0e=new m,E0e=new m;function wft(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}function Ift(e,t,n){let i=1/Math.max(1,wft(e.position,t.position));return m.multiplyByScalar(e.position,i,A0e),m.multiplyByScalar(t.position,i,E0e),m.equalsEpsilon(A0e,E0e,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}CH.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Ift(t,n,D.EPSILON15)?(this._cameraStartFired&&Ci()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ci(),mr.clone(t,n),!0)};function Pft(e,t,n,i){let r=t.frameState,o=r.camera,s=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),isNaN(n)&&(n=o.frustum.near),isNaN(i)&&(i=o.frustum.far);let u;a?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];l(h)?(h.near=p,h.far=g):h=f[d]=new VF(p,g)}}function Dft(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let o=e.frustumCommandsList,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.near,f=c.far;if(i>f)continue;if(r<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var S0e=new ts,Rft=new Ac;CH.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Ee.NUMBER_OF_PASSES;for(let E=0;E<u;++E)for(let w=0;w<f;++w)c[E].indices[w]=0;o.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,x=-Number.MAX_VALUE,b=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,A=-Number.MAX_VALUE,T=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,v=t.cullingVolume,I=S0e.planes;for(let E=0;E<5;++E)I[E]=v.planes[E];v=S0e;let O=a.length;for(let E=0;E<O;++E){let w=a[E],P=w.pass;if(P===Ee.COMPUTE)o.push(w);else if(P===Ee.OVERLAY)s.push(w);else{let M,B,V=w.boundingVolume;if(l(V)){if(!e.isVisible(w,v,S))continue;let G=V.computePlaneDistances(r,i,Rft);if(M=G.start,B=G.stop,h=Math.min(h,M),x=Math.max(x,B),b&&w.receiveShadows&&M<j_.MAXIMUM_DISTANCE&&!(P===Ee.GLOBE&&M<-100&&B>100)){let k=B-M;P!==Ee.GLOBE&&M<100&&(T=Math.min(T,k)),C=Math.min(C,M),A=Math.max(A,B)}}else w instanceof li?(M=n.frustum.near,B=n.frustum.far):(M=n.frustum.near,B=n.frustum.far,h=Math.min(h,M),x=Math.max(x,B));let U=d[g];l(U)||(U=d[g]=new vft),U.command=w,U.near=M,U.far=B,g++}}b&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),A=Math.max(Math.min(A,n.frustum.far),C)),b&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=A,t.shadowState.closestObjectSize=T),Pft(this,e,h,x);let R,L;for(R=0;R<g;R++)L=d[R],Dft(this,e,L.command,L.near,L.far);if(g<p)for(R=g;R<p&&(L=d[R],!!l(L.command));R++)L.command=void 0;let N=c.length,_=t.frustumSplits;_.length=N+1;for(let E=0;E<N;++E)_[E]=c[E].near,E===N-1&&(_[E+1]=c[E].far)};CH.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var bC=CH;var w0e=.1,Oft=new Wf({pass:Fr.MOST_DETAILED_PRELOAD}),Mft=new Wf({pass:Fr.MOST_DETAILED_PICK}),fX=new Wf({pass:Fr.PICK});function Ra(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ye(0,0,1,1),n=new mr(e);n.frustum=new nn({width:w0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new bC(e,n,t)}Ra.prototype.update=function(){this._pickPositionCacheDirty=!0};Ra.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new UF,n[t]=i),i};var Lft=new vo,Nft=new m,TH=new m,Fft=new H,Bft=new F;function kft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(o.transform,Bft);o._setTransform(F.IDENTITY);let d=m.clone(o.position,Nft);m.multiplyByScalar(o.right,c,TH),m.add(TH,d,d),m.multiplyByScalar(o.up,u,TH),m.add(TH,d,d),o._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,Fft),g=Lft;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var Uft=new Zc,Vft=new H;function zft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,h=s.getPixelDimensions(r.width,r.height,1,1,Vft),x=h.x*n*.5,b=h.y*i*.5,C=Uft;return C.top=g+b,C.bottom=g-b,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function I0e(e,t,n,i,r){let o=e.camera.frustum;return o instanceof nn||o instanceof vo?kft(e,t,n,i,r):zft(e,t,n,i,r)}var US=3,JF=3,Vh=new Ye(0,0,US,JF),P0e=new H,dX=new z(0,0,0,0);Ra.prototype.pick=function(e,t,n,i){US=y(n,3),JF=y(i,US);let r=e.context,o=r.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let u=a.passState;u.viewport=Ye.clone(c,u.viewport);let f=Qi.transformWindowToDrawingBuffer(e,t,P0e);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=I0e(e,f,US,JF,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=fX,o.update(s),e.updateEnvironment(),Vh.x=f.x-(US-1)*.5,Vh.y=e.drawingBufferHeight-f.y-(JF-1)*.5,Vh.width=US,Vh.height=JF,u=a.pickFramebuffer.begin(Vh,a.viewport),e.updateAndExecuteCommands(u,dX),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(Vh);return r.endFrame(),d};function Hft(e,t){let n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=o.passState;a.viewport=Ye.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=I0e(e,t,1,1,s),i.tilesetPassState=fX,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,a=o.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,dX),e.resolveFramebuffers(a),n.endFrame()}var Gft=new Ii,Wft=new Zc,jft=new nn,qft=new vo;Ra.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let r=e.frameState,o=e.context,s=o.uniformState,a=e.defaultView;e.view=a;let c=Qi.transformWindowToDrawingBuffer(e,t,P0e);e.pickTranslucentDepth?Hft(e,c):(e.updateFrameState(),s.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(Gft):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(Wft):l(u.frustum.width)?f=u.frustum.clone(jft):f=u.frustum.clone(qft);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,c.x,c.y);if(l(x)&&x>0&&x<1){let b=d[g],C;return e.mode===ne.SCENE2D?(C=u.position.z,u.position.z=C-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,s.update(r),s.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,s.updateFrustum(f)),n=Qi.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===ne.SCENE2D&&(u.position.z=C,s.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Yft=new me;Ra.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,Yft);r.cartographicToCartesian(o,n)}return n};function D0e(e,t){let n,i,r=[],o=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){r.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(r.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),u instanceof ws&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,o.push(p)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return r}Ra.prototype.drillPick=function(e,t,n,i,r){let o=this;return D0e(n,function(){let c=o.pick(e,t,i,r);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var v0e=new m,Xft=new m;function Kft(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function R0e(e,t,n,i){let r=t.direction,o=m.mostOrthogonalAxis(r,v0e),s=m.cross(r,o,v0e),a=m.cross(r,s,Xft);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=y(n,w0e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Jft(e,t,n){let i=t.frameState,r=n.ray,o=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=R0e(e,r,o,a),u=Oft;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ra.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Jft(this,e,t[n])&&t.splice(n--,1)};function O0e(e,t,n){let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Pl&&O0e(o,t,n))}}function AH(e,t,n,i,r,o){let s=[];if(O0e(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new Kft(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function Zft(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function $ft(e,t,n,i,r,o,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,R0e(e,n,r,f.camera),Vh=Ye.clone(f.viewport,Vh);let d=f.pickFramebuffer.begin(Vh,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=Mft:u.tilesetPassState=fX,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,dX),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(Vh);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let x=0;x<h;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let A=f.frustumCommandsList[x],T=A.near*(x!==0?t.opaqueFrustumNearOffset:1),S=A.far,v=T+C*(S-T);p=vn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&o||Zft(g,i)}}function M0e(e,t,n,i,r,o,s,a){return D0e(i,function(){return $ft(e,t,n,r,o,s,a)})}function VS(e,t,n,i,r,o,s){let a=M0e(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function L0e(e,t,n,i,r,o,s,a){return M0e(e,t,n,i,r,o,s,a)}function EH(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Ra.prototype.pickFromRay=function(e,t,n,i){return VS(this,e,t,n,i,!1,!1)};Ra.prototype.drillPickFromRay=function(e,t,n,i,r){return L0e(this,e,t,n,i,r,!1,!1)};Ra.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=vn.clone(t),n=l(n)?n.slice():n,EH(e,AH(r,e,t,n,i,function(){return VS(r,e,t,n,i,!1,!0)}))};Ra.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=vn.clone(t),i=l(i)?i.slice():i,EH(e,AH(o,e,t,i,r,function(){return L0e(o,e,t,n,i,r,!1,!0)}))};var Qft=new m,edt=new m,tdt=new vn,N0e=new me;function mX(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=oi._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,edt),s=me.toCartesian(t,i,Qft),a=tdt;a.origin=s,a.direction=o;let c=new vn;return vn.getPoint(a,r,c.origin),m.negate(o,c.direction),c}function F0e(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=me.fromCartesian(t,i,N0e);return mX(e,r)}function B0e(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return me.fromCartesian(t,i,N0e).height}function ndt(e,t,n,i,r){let o=mX(t,n);return AH(e,t,o,i,r,function(){let s=VS(e,t,o,i,r,!0,!0);if(l(s))return B0e(t,s.position)})}function idt(e,t,n,i,r,o){let s=F0e(t,n);return AH(e,t,s,i,r,function(){let a=VS(e,t,s,i,r,!0,!0);if(l(a))return m.clone(a.position,o)})}Ra.prototype.sampleHeight=function(e,t,n,i){let r=mX(e,t),o=VS(this,e,r,n,i,!0,!1);if(l(o))return B0e(e,o.position)};Ra.prototype.clampToHeight=function(e,t,n,i,r){let o=F0e(e,t),s=VS(this,e,o,n,i,!0,!1);if(l(s))return m.clone(s.position,r)};Ra.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=ndt(this,e,t[s],n,i);return EH(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ra.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=idt(this,e,t[s],n,i,t[s]);return EH(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ra.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var ZF=Ra;var $F=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + color /= texture(autoExposure, vec2(0.5)).r; +#endif + color = czm_acesTonemapping(color); + color = czm_inverseGamma(color); + + out_FragColor = vec4(color, fragmentColor.a); +} +`;var QF=`uniform sampler2D randomTexture; +uniform sampler2D depthTexture; +uniform float intensity; +uniform float bias; +uniform float lengthCap; +uniform float stepSize; +uniform float frustumLength; + +in vec2 v_textureCoordinates; + +vec4 clipToEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); + posEC = posEC / posEC.w; + return posEC; +} + +//Reconstruct Normal Without Edge Removation +vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) +{ + vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); + vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); + vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); + vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); + + vec3 up = posInCamera.xyz - posInCameraUp.xyz; + vec3 down = posInCameraDown.xyz - posInCamera.xyz; + vec3 left = posInCamera.xyz - posInCameraLeft.xyz; + vec3 right = posInCameraRight.xyz - posInCamera.xyz; + + vec3 DX = length(left) < length(right) ? left : right; + vec3 DY = length(up) < length(down) ? up : down; + + return normalize(cross(DY, DX)); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = clipToEye(v_textureCoordinates, depth); + + if (posInCamera.z > frustumLength) + { + out_FragColor = vec4(1.0); + return; + } + + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); + float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); + float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); + float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); + vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); + + float ao = 0.0; + vec2 sampleDirection = vec2(1.0, 0.0); + float gapAngle = 90.0 * czm_radiansPerDegree; + + // RandomNoise + float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; + + //Loop for each direction + for (int i = 0; i < 4; i++) + { + float newGapAngle = gapAngle * (float(i) + randomVal); + float cosVal = cos(newGapAngle); + float sinVal = sin(newGapAngle); + + //Rotate Sampling Direction + vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); + float localAO = 0.0; + float localStepSize = stepSize; + + //Loop for each step + for (int j = 0; j < 6; j++) + { + vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; + + //Exception Handling + if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) + { + break; + } + + float stepDepthInfo = czm_readDepth(depthTexture, newCoords); + vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); + vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; + float len = length(diffVec); + + if (len > lengthCap) + { + break; + } + + float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); + float weight = len / lengthCap; + weight = 1.0 - weight * weight; + + if (dotVal < bias) + { + dotVal = 0.0; + } + + localAO = max(localAO, dotVal * weight); + localStepSize += stepSize; + } + ao += localAO; + } + + ao /= 4.0; + ao = 1.0 - clamp(ao, 0.0, 1.0); + ao = pow(ao, intensity); + out_FragColor = vec4(vec3(ao), 1.0); +} +`;var e2=`uniform sampler2D colorTexture; +uniform sampler2D ambientOcclusionTexture; +uniform bool ambientOcclusionOnly; +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); + out_FragColor = ambientOcclusionOnly ? ao : ao * color; +} +`;var t2=`uniform sampler2D colorTexture; +uniform float gradations; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = vec4(rgb, 1.0); + return; + } +#endif + float luminance = czm_luminance(rgb); + float darkness = luminance * gradations; + darkness = (darkness - fract(darkness)) / gradations; + out_FragColor = vec4(vec3(darkness), 1.0); +} +`;var n2=`uniform sampler2D colorTexture; +uniform sampler2D bloomTexture; +uniform bool glowOnly; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = color; + return; + } +#endif + + vec4 bloom = texture(bloomTexture, v_textureCoordinates); + out_FragColor = glowOnly ? bloom : bloom + color; +} +`;var i2=`uniform sampler2D colorTexture; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 target = vec3(0.0); + out_FragColor = vec4(mix(target, rgb, brightness), 1.0); +} +`;var r2=`uniform sampler2D colorTexture; +uniform float contrast; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; + sceneColor = czm_RGBToHSB(sceneColor); + sceneColor.z += brightness; + sceneColor = czm_HSBToRGB(sceneColor); + + float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); + sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); + out_FragColor = vec4(sceneColor, 1.0); +} +`;var o2=`uniform sampler2D colorTexture; +uniform sampler2D blurTexture; +uniform sampler2D depthTexture; +uniform float focalDistance; + +in vec2 v_textureCoordinates; + +vec4 toEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); + posInCamera = posInCamera / posInCamera.w; + return posInCamera; +} + +float computeDepthBlur(float depth) +{ + float f; + if (depth < focalDistance) + { + f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); + } + else + { + f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); + f = pow(f, 0.1); + } + f *= f; + f = clamp(f, 0.0, 1.0); + return pow(f, 0.5); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = toEye(v_textureCoordinates, depth); + float d = computeDepthBlur(-posInCamera.z); + out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); +} +`;var s2=`uniform sampler2D depthTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + out_FragColor = vec4(vec3(depth), 1.0); +} +`;var a2=`uniform sampler2D depthTexture; +uniform float length; +uniform vec4 color; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float directions[3]; + directions[0] = -1.0; + directions[1] = 0.0; + directions[2] = 1.0; + + float scalars[3]; + scalars[0] = 3.0; + scalars[1] = 10.0; + scalars[2] = 3.0; + + float padx = czm_pixelRatio / czm_viewport.z; + float pady = czm_pixelRatio / czm_viewport.w; + +#ifdef CZM_SELECTED_FEATURE + bool selected = false; + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + selected = selected || czm_selected(vec2(-padx, dir * pady)); + selected = selected || czm_selected(vec2(padx, dir * pady)); + selected = selected || czm_selected(vec2(dir * padx, -pady)); + selected = selected || czm_selected(vec2(dir * padx, pady)); + if (selected) + { + break; + } + } + if (!selected) + { + out_FragColor = vec4(color.rgb, 0.0); + return; + } +#endif + + float horizEdge = 0.0; + float vertEdge = 0.0; + + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + float scale = scalars[i]; + + horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; + horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; + + vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; + vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; + } + + float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); + out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); +} +`;var c2=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See slides 142 and 143: +// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + + const float A = 0.22; // shoulder strength + const float B = 0.30; // linear strength + const float C = 0.10; // linear angle + const float D = 0.20; // toe strength + const float E = 0.01; // toe numerator + const float F = 0.30; // toe denominator + + const float white = 11.2; // linear white point value + + vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; + float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; + + c = czm_inverseGamma(c / w); + out_FragColor = vec4(c, fragmentColor.a); +} +`;var l2=`in vec2 v_textureCoordinates; + +uniform sampler2D colorTexture; + +const float fxaaQualitySubpix = 0.5; +const float fxaaQualityEdgeThreshold = 0.125; +const float fxaaQualityEdgeThresholdMin = 0.0833; + +void main() +{ + vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; + vec4 color = FxaaPixelShader( + v_textureCoordinates, + colorTexture, + fxaaQualityRcpFrame, + fxaaQualitySubpix, + fxaaQualityEdgeThreshold, + fxaaQualityEdgeThresholdMin); + float alpha = texture(colorTexture, v_textureCoordinates).a; + out_FragColor = vec4(color.rgb, alpha); +} +`;var l0=`#define SAMPLES 8 + +uniform float delta; +uniform float sigma; +uniform float direction; // 0.0 for x direction, 1.0 for y direction + +uniform sampler2D colorTexture; + +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif + +in vec2 v_textureCoordinates; + +// Incremental Computation of the Gaussian: +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html + +void main() +{ + vec2 st = v_textureCoordinates; + vec2 dir = vec2(1.0 - direction, direction); + +#ifdef USE_STEP_SIZE + vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); +#else + vec2 step = step; +#endif + + vec3 g; + g.x = 1.0 / (sqrt(czm_twoPi) * sigma); + g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); + g.z = g.y * g.y; + + vec4 result = texture(colorTexture, st) * g.x; + for (int i = 1; i < SAMPLES; ++i) + { + g.xy *= g.yz; + + vec2 offset = float(i) * dir * step; + result += texture(colorTexture, st - offset) * g.x; + result += texture(colorTexture, st + offset) * g.x; + } + + out_FragColor = result; +} +`;var u2=`uniform sampler2D colorTexture; +uniform sampler2D dirtTexture; +uniform sampler2D starTexture; +uniform vec2 dirtTextureDimensions; +uniform float distortion; +uniform float ghostDispersal; +uniform float haloWidth; +uniform float dirtAmount; +uniform float earthRadius; +uniform float intensity; + +in vec2 v_textureCoordinates; + +// whether it is in space or not +// 6500000.0 is empirical value +#define DISTANCE_TO_SPACE 6500000.0 + +// return ndc from world coordinate biased earthRadius +vec4 getNDCFromWC(vec3 WC, float earthRadius) +{ + vec4 positionEC = czm_view * vec4(WC, 1.0); + positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); +} + +// Check if current pixel is included Earth +// if then mask it gradually +float isInEarth(vec2 texcoord, vec2 sceneSize) +{ + vec2 NDC = texcoord * 2.0 - 1.0; + vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); + vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); + NDC.xy -= earthPosSC.xy; + + float X = abs(NDC.x) * sceneSize.x; + float Y = abs(NDC.y) * sceneSize.y; + + return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); +} + +// For Chromatic effect +vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) +{ + vec2 sceneSize = czm_viewport.zw; + vec3 color; + if(isSpace) + { + color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; + color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; + color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; + } + else + { + color.r = texture(tex, texcoord + direction * distortion.r).r; + color.g = texture(tex, texcoord + direction * distortion.g).g; + color.b = texture(tex, texcoord + direction * distortion.b).b; + } + return vec4(clamp(color, 0.0, 1.0), 0.0); +} + +void main(void) +{ + vec4 originalColor = texture(colorTexture, v_textureCoordinates); + vec3 rgb = originalColor.rgb; + bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; + + // Sun position + vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); + vec4 sunPositionEC = czm_view * sunPos; + vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); + sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); + + // If sun is not in the screen space, use original color. + if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) + { + // Lens flare is disabled when not in space until #5932 is fixed. + // https://github.com/CesiumGS/cesium/issues/5932 + out_FragColor = originalColor; + return; + } + + vec2 texcoord = vec2(1.0) - v_textureCoordinates; + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + vec2 invPixelSize = 1.0 / pixelSize; + vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); + + // ghost vector to image centre: + vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; + vec3 direction = normalize(vec3(ghostVec, 0.0)); + + // sample ghosts: + vec4 result = vec4(0.0); + vec4 ghost = vec4(0.0); + for (int i = 0; i < 4; ++i) + { + vec2 offset = fract(texcoord + ghostVec * float(i)); + // Only bright spots from the centre of the source image + ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); + } + result += ghost; + + // sample halo + vec2 haloVec = normalize(ghostVec) * haloWidth; + float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); + weightForHalo = pow(1.0 - weightForHalo, 5.0); + + result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; + + // dirt on lens + vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; + if (dirtTexCoords.x > 1.0) + { + dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); + } + if (dirtTexCoords.y > 1.0) + { + dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); + } + result += dirtAmount * texture(dirtTexture, dirtTexCoords); + + // Rotating starburst texture's coordinate + // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) + float camrot = czm_view[0].z + czm_view[1].y; + float cosValue = cos(camrot); + float sinValue = sin(camrot); + mat3 rotation = mat3( + cosValue, -sinValue, 0.0, + sinValue, cosValue, 0.0, + 0.0, 0.0, 1.0 + ); + + vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); + vec3 st2 = vec3((rotation * st1).xy, 1.0); + vec3 st3 = st2 * 0.5 + vec3(0.5); + vec2 lensStarTexcoord = st3.xy; + float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); + float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); + + if (!isSpace) + { + result *= oneMinusWeightForLensFlare * intensity * 0.2; + } + else + { + result *= oneMinusWeightForLensFlare * intensity; + result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; + } + + result += texture(colorTexture, v_textureCoordinates); + + out_FragColor = result; +} +`;var f2=`uniform sampler2D colorTexture; +uniform vec3 white; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 4: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = (color * (1.0 + color / white)) / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var d2=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 green = vec3(0.0, 1.0, 0.0); + out_FragColor = vec4((noiseValue + rgb) * green, 1.0); +} +`;var m2=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 3: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = color / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var h2=`uniform sampler2D colorTexture; +uniform sampler2D silhouetteTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); + vec4 color = texture(colorTexture, v_textureCoordinates); + out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); +} +`;function CC(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(CC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function k0e(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function rdt(e,t){k0e(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function U0e(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function odt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function sdt(e,t){let n=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +float sampleTexture(vec2 offset) { +`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); + return czm_luminance(color.rgb); +`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r; +`,n+=`} + +`,n+=`uniform vec2 colorTextureDimensions; +uniform vec2 minMaxLuminance; +uniform sampler2D previousLuminance; +void main() { + float color = 0.0; + float xStep = 1.0 / colorTextureDimensions.x; + float yStep = 1.0 / colorTextureDimensions.y; + int count = 0; + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + vec2 offset; + offset.x = -xStep + float(i) * xStep; + offset.y = -yStep + float(j) * yStep; + if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { + continue; + } + color += sampleTexture(offset); + ++count; + } + } + if (count > 0) { + color /= float(count); + } +`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); + color = previous + (color - previous) / (60.0 * 1.5); + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); +`),n+=` out_FragColor = vec4(color); +} +`,n}function adt(e,t){U0e(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(sdt(o,i),{framebuffer:n[o].framebuffer,uniformMap:odt(e,o)});e._commands=r}CC.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};CC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,rdt(this,e),adt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};CC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};CC.prototype.isDestroyed=function(){return!1};CC.prototype.destroy=function(){return k0e(this),U0e(this),ue(this)};var p2=CC;var cdt={NEAREST:0,LINEAR:1},ku=cdt;function TC(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,ct.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,ku.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Xe.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new _c;r.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ye.clone(e.scissorRectangle):new Ye},this._passState=r,this._ready=!1;let o=e.name;l(o)||(o=qn()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(TC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var ldt=/uniform\s+sampler2D\s+depthTexture/g;TC.prototype._isSupported=function(e){return!ldt.test(this._fragmentShader)||e.depthTexture};function udt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Lt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Lt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function fdt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function ddt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function mdt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i)if(i.hasOwnProperty(o)){typeof i[o]!="function"?(t[o]=fdt(e,o),n[o]=udt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Lt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=ddt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=gt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function hdt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE +uniform sampler2D czm_idTexture; +uniform sampler2D czm_selectedIdTexture; +uniform float czm_selectedIdTextureStep; +in vec2 v_textureCoordinates; +bool czm_selected(vec2 offset) +{ + bool selected = false; + vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); + for (int i = 0; i < ${r}; ++i) + { + vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); + if (all(equal(id, selectedId))) + { + return true; + } + } + return false; +} + +bool czm_selected() +{ + return czm_selected(vec2(0.0)); +} + +${n}`}let i=new ze({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function pdt(e){let t=e._sampleMode,n,i;t===ku.LINEAR?(n=ln.LINEAR,i=Ai.LINEAR):(n=ln.NEAREST,i=Ai.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function _dt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function gdt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ydt(e,t){let n,i,r,o=e._texturesToRelease,s=o.length;for(n=0;n<s;++n)i=o[n],i=i&&i.destroy();o.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];r=d.name;let p=d.source;e._actualUniforms[r]=new Lt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){r=c[n];let d=u[r],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[r]=gdt(e,d);else if(typeof d=="string"){let g=new Ie({url:d});f.push(g.fetchImage().then(_dt(e,r)))}else e._texturesToCreate.push({name:r,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function V0e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i)i.hasOwnProperty(r)&&i[r]instanceof Lt&&(l(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}function xdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function bdt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,r,o=0,s=n.length;for(i=0;i<s;++i)r=n[i],l(r.pickIds)?o+=r.pickIds.length:l(r.pickId)&&++o;if(s===0||o===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:mn.NEAREST});return}let a,c=0,u=new Uint8Array(o*4);for(i=0;i<s;++i)if(r=n[i],l(r.pickIds)){let f=r.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(r.pickId)&&(a=r.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,source:{arrayBufferView:u,width:o,height:1},sampler:mn.NEAREST})}TC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&V0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=xdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,bdt(this,e),mdt(this),ydt(this,e),hdt(this,e),pdt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ue.fromCache({viewport:new Ye(0,0,i.width,i.height)}))),this._command.renderState=r};TC.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,mn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){return V0e(this),ue(this)};var Tr=TC;function AC(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=qn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(AC.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});AC.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};AC.prototype.get=function(e){return this._stages[e]};function Cdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}AC.prototype.update=function(e,t){this._selectedDirty=Cdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var el=AC;var Vo={};function SH(e){let r=`#define USE_STEP_SIZE +${l0}`,o=new Tr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ku.LINEAR}),s=new Tr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ku.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new el({name:e,stages:[o,s],uniforms:a})}Vo.createBlurStage=function(){return SH("czm_blur")};Vo.createDepthOfFieldStage=function(){let e=SH("czm_depth_of_field_blur"),t=new Tr({name:"czm_depth_of_field_composite",fragmentShader:o2,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new el({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Vo.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Vo.createEdgeDetectionStage=function(){let e=qn();return new Tr({name:`czm_edge_detection_${e}`,fragmentShader:a2,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Vo.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Tdt(e){if(!l(e))return Vo.createEdgeDetectionStage();let t=new el({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +`,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); + if (edge${a}.a > 0.0) + { + color = edge${a}; + break; + } +`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; +void main() { + vec4 color = vec4(0.0); + for (int i = 0; i < ${e.length}; i++) + { +${r} } + out_FragColor = color; +} +`,s=new Tr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new el({name:"czm_edge_detection_composite",stages:[t,s]})}Vo.createSilhouetteStage=function(e){let t=Tdt(e),n=new Tr({name:"czm_silhouette_color_edges",fragmentShader:h2,uniforms:{silhouetteTexture:t.name}});return new el({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Vo.isSilhouetteSupported=function(e){return e.context.depthTexture};Vo.createBloomStage=function(){let e=new Tr({name:"czm_bloom_contrast_bias",fragmentShader:r2,uniforms:{contrast:128,brightness:-.3}}),t=SH("czm_bloom_blur"),n=new el({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Tr({name:"czm_bloom_generate_composite",fragmentShader:n2,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new el({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Vo.createAmbientOcclusionStage=function(){let e=new Tr({name:"czm_ambient_occlusion_generate",fragmentShader:QF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=SH("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new el({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new Tr({name:"czm_ambient_occlusion_composite",fragmentShader:e2,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(o){e.uniforms.intensity=o}},bias:{get:function(){return e.uniforms.bias},set:function(o){e.uniforms.bias=o}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(o){e.uniforms.lengthCap=o}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(o){e.uniforms.stepSize=o}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(o){e.uniforms.frustumLength=o}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(o){e.uniforms.randomTexture=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(o){i.uniforms.ambientOcclusionOnly=o}}}),new el({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Vo.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Adt=`#define FXAA_QUALITY_PRESET 39 +${HN} +${l2}`;Vo.createFXAAStage=function(){return new Tr({name:"czm_FXAA",fragmentShader:Adt,sampleMode:ku.LINEAR})};Vo.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=$F,new Tr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Vo.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=c2,new Tr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Vo.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=m2,new Tr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Vo.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=f2,new Tr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Vo.createAutoExposureStage=function(){return new p2};Vo.createBlackAndWhiteStage=function(){return new Tr({name:"czm_black_and_white",fragmentShader:t2,uniforms:{gradations:5}})};Vo.createBrightnessStage=function(){return new Tr({name:"czm_brightness",fragmentShader:i2,uniforms:{brightness:.5}})};Vo.createNightVisionStage=function(){return new Tr({name:"czm_night_vision",fragmentShader:d2})};Vo.createDepthViewStage=function(){return new Tr({name:"czm_depth_view",fragmentShader:s2})};Vo.createLensFlareStage=function(){return new Tr({name:"czm_lens_flare",fragmentShader:u2,uniforms:{dirtTexture:tn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:tn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var qf=Vo;function q_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function g2(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function hX(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[g2(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[g2(d)]=!0)}}}return i.name}function _2(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=_2(e,t,n,p,r):a=hX(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=g2(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=g2(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[g2(i.get(p))]=!0}return a}function Edt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=_2(e,t,n,i,void 0);a=_2(e,t,n,r,a),a=hX(e,t,n,o,a),a=_2(e,t,n,e,a),hX(e,t,n,s,a)}else _2(e,t,n,e,void 0);return n}function Sdt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let h=d.stages,x=h.length,b=!1;for(let C=0;C<x;++C)if(n[h[C]]){b=!0;break}if(!b)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function vdt(e,t){let n=Edt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Sdt(e,i,n[i]))}function pX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function wdt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}q_.prototype.updateDependencies=function(){this._updateDependencies=!0};q_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(pX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&vdt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,pX(this),wdt(this,e))};q_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};q_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};q_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};q_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};q_.prototype.isDestroyed=function(){return!1};q_.prototype.destroy=function(){return pX(this),ue(this)};var EC=q_;var y2={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===y2.REINHARD||e===y2.MODIFIED_REINHARD||e===y2.FILMIC||e===y2.ACES}},u0=Object.freeze(y2);var _X=[];function tl(){let e=qf.createFXAAStage(),t=qf.createAmbientOcclusionStage(),n=qf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=qf.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=u0.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new EC(this),o={},s=_X;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(tl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return gX(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case u0.REINHARD:n=qf.createReinhardTonemappingStage(t);break;case u0.MODIFIED_REINHARD:n=qf.createModifiedReinhardTonemappingStage(t);break;case u0.FILMIC:n=qf.createFilmicTonemappingStage(t);break;default:n=qf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function gX(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._stages=t}tl.prototype.add=function(e){let t=this._stageNames,n=_X;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};tl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=_X;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};tl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};tl.prototype.get=function(e){return gX(this),this._stages[e]};tl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};tl.prototype.getStageByName=function(e){return this._stageNames[e]};tl.prototype.update=function(e,t,n){gX(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages,s=r.length=o.length,a,c,u=0;for(a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&(r[u++]=c);r.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(r[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,x=this._fxaa;h.enabled=n;let b=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),A=h.enabled&&h._isSupported(e),T=x.enabled&&x._isSupported(e);if((f||this._textureCacheDirty||b!==this._aoEnabled||C!==this._bloomEnabled||A!==this._tonemappingEnabled||T!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=C,this._tonemappingEnabled=A,this._fxaaEnabled=T,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Lt({context:e,pixelFormat:ct.RGB,pixelDatatype:Xe.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new mn({wrapS:In.REPEAT,wrapT:In.REPEAT,minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=o.length,a=0;a<s;++a)o[a].update(e,t);for(u=0,a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==r.length,f&&this.update(e,t,n)};tl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function SC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}tl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return SC(t)};function zh(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}let o=e.length,s;if(e.inputPreviousStageTexture)for(zh(e.get(0),t,n,i,r),s=1;s<o;++s)zh(e.get(s),t,SC(e.get(s-1)),i,r);else for(s=0;s<o;++s)zh(e.get(s),t,n,i,r)}tl.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!h&&o===0)return;let b=t;d&&a.ready&&(zh(a,e,b,n,i),b=SC(a)),p&&c.ready&&(zh(c,e,b,n,i),b=SC(c)),g&&u.ready&&zh(u,e,b,n,i),h&&f.ready&&(zh(f,e,b,n,i),b=SC(f));let C=b;if(o>0){zh(r[0],e,b,n,i);for(let A=1;A<o;++A)zh(r[A],e,SC(r[A-1]),n,i);C=SC(r[o-1])}x&&s.ready&&zh(s,e,C,n,i)};tl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Vl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var x2=tl;function vC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}vC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};vC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof nn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?smt(this,e):mmt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Idt=new m,Pdt=new m,Ddt=new m,Rdt=new m,Odt=new m,Mdt=new m,Ldt=new m,Ndt=new me,Fdt=new F,Bdt=new Ii,kdt=new nn,Udt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};vC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=Idt,r=Pdt,o=Ddt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,r),r),m.cross(m.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,m.negate(m.UNIT_Z,r),m.clone(m.UNIT_Y,o);else{m.clone(u.positionWC,i),m.clone(u.directionWC,r),m.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,Ldt),d=Mt.eastNorthUpToFixedFrame(f,t,Fdt);F.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,Ndt),i),F.multiplyByPointAsVector(d,r,r),F.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=kdt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Bdt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=Udt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=pmt(a);b2(this,c),this._previousMode===ne.SCENE2D?hmt(this,e,a,c):(a.position2D=F.multiplyByPoint(mr.TRANSFORM_2D,i,Rdt),a.direction2D=F.multiplyByPointAsVector(mr.TRANSFORM_2D,r,Odt),a.up2D=F.multiplyByPointAsVector(mr.TRANSFORM_2D,o,Mdt),n._mode=ne.MORPHING,Z0e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var bX={position:new m,direction:new m,up:new m,frustum:void 0},H0e=new Ii;vC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.SCENE2D)Jdt(this,e,t);else{let i;e>0?(i=bX,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=G0e(this,t);let r,o=n.camera;o.frustum instanceof nn?r=o.frustum.clone():(r=H0e,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=Q0e(i);b2(this,s),xX(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return vH(this),ue(this)};function b2(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ru(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function vH(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Vdt=new me,zdt=new m,Hdt=new F;function G0e(e,t){let n=e._scene,i=n.camera,r=bX,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,Vdt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,zdt),f=Mt.eastNorthUpToFixedFrame(u,t,Hdt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),r}var Gdt=new m,Wdt=new m,jdt=new m,qdt=new m,Ydt=new m,Xdt=new m;function xX(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(o.position,Gdt),a=m.clone(o.direction,Wdt),c=m.clone(o.up,jdt),u=F.multiplyByPoint(mr.TRANSFORM_2D_INVERSE,n.position,qdt),f=F.multiplyByPointAsVector(mr.TRANSFORM_2D_INVERSE,n.direction,Ydt),d=F.multiplyByPointAsVector(mr.TRANSFORM_2D_INVERSE,n.up,Xdt);function p(h){Yf(s,u,h.time,o.position),Yf(a,f,h.time,o.direction),Yf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){$0e(e,r,0,1,t,i)}});e._currentTweens.push(g)}var Kdt=new nn,W0e=new m,j0e=new m,q0e=new m,CX=new m,Y0e=new m,X0e=new m;function Jdt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=bX,m.fromDegrees(0,0,5*n.maximumRadius,n,o.position),m.negate(o.position,o.direction),m.normalize(o.direction,o.direction),m.clone(m.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=G0e(e,n));let s;e._morphToOrthographic?(s=Kdt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=H0e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=Q0e(o);b2(e,a);let c;e._morphToOrthographic?c=function(){xX(e,t,o,a)}:c=function(){J0e(e,t,o,function(){xX(e,t,o,a)})},t>0?(i._mode=ne.SCENE2D,r.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,CX),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Yf(e,t,n,i){return m.lerp(e,t,n,i)}function K0e(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof nn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=D.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var Zdt=new m,$dt=new m,Qdt=new m,yX=new m,emt=new m,tmt=new m,nmt=new vo,imt=new vn,rmt=new m,omt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function smt(e,t){t*=.5;let n=e._scene,i=n.camera,r=m.clone(i.position,Zdt),o=m.clone(i.direction,$dt),s=m.clone(i.up,Qdt),a=m.negate(m.UNIT_Z,emt),c=m.clone(m.UNIT_Y,tmt),u=yX;if(t>0)m.clone(m.ZERO,yX),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(r,yX);let b=imt;F.multiplyByPoint(mr.TRANSFORM_2D,r,b.origin),F.multiplyByPointAsVector(mr.TRANSFORM_2D,o,b.direction);let C=n.globe;if(l(C)){let A=C.pickWorldCoordinates(b,n,!0,rmt);l(A)&&(F.multiplyByPoint(mr.TRANSFORM_2D_INVERSE,A,u),u.z+=m.distance(r,u))}}let f=nmt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=omt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=exe(d);b2(e,p);function g(b){Yf(r,u,b.time,i.position),Yf(o,a,b.time,i.direction),Yf(s,c,b.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(b,C){b.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){K0e(e,t,d,h,p)}});e._currentTweens.push(x)}var z0e=new me,amt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new vo},cmt={position:new m,direction:new m,up:new m,frustum:void 0},lmt=new m,umt=new vn,fmt=new F,dmt=new m;function mmt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=amt;if(t>0)m.clone(m.ZERO,o.position),o.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,z0e),i.mapProjection.project(z0e,o.position),m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);let d=umt;m.clone(o.position2D,d.origin);let p=m.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,dmt),h=Mt.eastNorthUpToFixedFrame(g,n,fmt);F.inverseTransformation(h,h),F.multiplyByPointAsVector(h,p,p),F.multiplyByPointAsVector(mr.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(d,i,!0,lmt);if(l(b)){let C=m.distance(o.position2D,b);b.x+=C,m.clone(b,o.position2D)}}}function s(d,p){d.position.x=p}F.multiplyByPoint(mr.TRANSFORM_2D,o.position,o.position2D),F.multiplyByPointAsVector(mr.TRANSFORM_2D,o.direction,o.direction2D),F.multiplyByPointAsVector(mr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=cmt;F.multiplyByPoint(mr.TRANSFORM_2D_INVERSE,o.position2D,c.position),m.clone(o.direction,c.direction),m.clone(o.up,c.up),c.frustum=a;let u=exe(c);b2(e,u);function f(){K0e(e,t,o,s,u)}Z0e(e,t,o,f)}function J0e(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=D.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function hmt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(n.position,CX),a=m.clone(n.direction,Y0e),c=m.clone(n.up,X0e);r._mode=ne.MORPHING;function u(){o.frustum=n.frustum.clone();let f=m.clone(o.position,W0e),d=m.clone(o.direction,j0e),p=m.clone(o.up,q0e);f.z=s.z;function g(x){Yf(f,s,x.time,o.position),Yf(d,a,x.time,o.direction),Yf(p,c,x.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let h=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():J0e(e,0,n,u)}function Z0e(e,t,n,i){let r=e._scene,o=r.camera,s=m.clone(o.position,W0e),a=m.clone(o.direction,j0e),c=m.clone(o.up,q0e),u=m.clone(n.position2D,CX),f=m.clone(n.direction2D,Y0e),d=m.clone(n.up2D,X0e);function p(h){Yf(s,u,h.time,o.position),Yf(a,f,h.time,o.direction),Yf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){$0e(e,r,1,0,t,i)}});e._currentTweens.push(g)}function $0e(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Fo.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Q0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),vH(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,o)}}function exe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),vH(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,r)}}function pmt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),vH(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,o)}}var C2=vC;var _mt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ni=Object.freeze(_mt);function bc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function gmt(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function txe(e,t,n){let i=bc(Ni.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new H;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(gmt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function nxe(e,t){let n=bc(Ni.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},Cn.WHEEL,t)}function zS(e,t,n){let i=bc(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;r[i]=!1,o[i]=new H;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let u,f;n===Ni.LEFT_DRAG?(u=Cn.LEFT_DOWN,f=Cn.LEFT_UP):n===Ni.RIGHT_DRAG?(u=Cn.RIGHT_DOWN,f=Cn.RIGHT_UP):n===Ni.MIDDLE_DRAG&&(u=Cn.MIDDLE_DOWN,f=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,r[i]=!0,s[i]=new Date,H.clone(d.position,o[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,a[i]=new Date},f,t)}function ixe(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function rxe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in Ni)if(Ni.hasOwnProperty(s)){let a=Ni[s];if(l(a)){let c=bc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new H,endPosition:new H,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Ni)if(Ni.hasOwnProperty(a)){let c=Ni[a];if(l(c)){let u=bc(c,t);o[u]&&(n[u]?(ixe(i[u],r[u]),r[u].valid=!0,ixe(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function Xf(e){this._eventHandler=new Ru(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,nxe(this,void 0),txe(this,void 0,e),zS(this,void 0,Ni.LEFT_DRAG),zS(this,void 0,Ni.RIGHT_DRAG),zS(this,void 0,Ni.MIDDLE_DRAG),rxe(this,void 0);for(let t in la)if(la.hasOwnProperty(t)){let n=la[t];l(n)&&(nxe(this,n),txe(this,n,e),zS(this,n,Ni.LEFT_DRAG),zS(this,n,Ni.RIGHT_DRAG),zS(this,n,Ni.MIDDLE_DRAG),rxe(this,n))}}Object.defineProperties(Xf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[bc(Ni.WHEEL)]||!this._update[bc(Ni.WHEEL,la.SHIFT)]||!this._update[bc(Ni.WHEEL,la.CTRL)]||!this._update[bc(Ni.WHEEL,la.ALT)];return this._buttonsDown>0||e}}});Xf.prototype.isMoving=function(e,t){let n=bc(e,t);return!this._update[n]};Xf.prototype.getMovement=function(e,t){let n=bc(e,t);return this._movement[n]};Xf.prototype.getLastMovement=function(e,t){let n=bc(e,t),i=this._lastMovement[n];if(i.valid)return i};Xf.prototype.isButtonDown=function(e,t){let n=bc(e,t);return this._isDown[n]};Xf.prototype.getStartMousePosition=function(e,t){if(e===Ni.WHEEL)return this._currentMousePosition;let n=bc(e,t);return this._eventStartPosition[n]};Xf.prototype.getButtonPressTime=function(e,t){let n=bc(e,t);return this._pressTime[n]};Xf.prototype.getButtonReleaseTime=function(e,t){let n=bc(e,t);return this._releaseTime[n]};Xf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Xf.prototype.isDestroyed=function(){return!1};Xf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var T2=Xf;var oxe=Ki(Lj(),1);function wH(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=je(n),this._stopObject=je(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(wH.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});wH.prototype.cancelTween=function(){this._tweens.remove(this)};function Em(){this._tweens=[]}Object.defineProperties(Em.prototype,{length:{get:function(){return this._tweens.length}}});Em.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new wH(this);let t=e.duration/Qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Qn.SECONDS_PER_MILLISECOND,r=y(e.easingFunction,Fo.LINEAR_NONE),o=e.startObject,s=new oxe.Tween(o);s.to(je(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new wH(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Em.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Em.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Em.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Em.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Em.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Em.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Em.prototype.get=function(e){return this._tweens[e]};Em.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Qn.SECONDS_PER_MILLISECOND:Ci();n<t.length;){let i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var wC=Em;function E2(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Ni.LEFT_DRAG,this.zoomEventTypes=[Ni.RIGHT_DRAG,Ni.WHEEL,Ni.PINCH],this.rotateEventTypes=Ni.LEFT_DRAG,this.tiltEventTypes=[Ni.MIDDLE_DRAG,Ni.PINCH,{eventType:Ni.LEFT_DRAG,modifier:la.CTRL},{eventType:Ni.RIGHT_DRAG,modifier:la.CTRL}],this.lookEventTypes={eventType:Ni.LEFT_DRAG,modifier:la.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new T2(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new wC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new H,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new me(Math.PI,D.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function ymt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function xmt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var bmt=.4;function Cmt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<bmt){let g=ymt(p,i),h=e.getLastMovement(t,n);if(!l(h)||xmt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);r(o,x,a)}}}function Tmt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var sxe=[];function nl(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(sxe[0]=n,n=sxe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),Tmt(e,o)):r<1&&Cmt(s,f,d,r,i,e,o))}}var IH=new vn,Amt=new m,Emt=new H,Smt=new m,vmt=new H,wmt=new m,Imt=new m,Pmt=new m,Dmt=new m,yxe=new m,Rmt=new m,Omt=new m,Mmt=new m,Lmt=new m,Nmt=new m,Fmt=new m,Bmt=new m,kmt=new m,Umt=new m,Vmt=new m,IC=new m,axe=new m,cxe=new m,TX={orientation:new za};function DX(e,t,n,i,r,o){let s=1;l(o)&&(s=D.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(r-u)<1||h<0&&Math.abs(r-f)<1)return;r-h<u?h=r-u-1:r-h>f&&(h=r-f)}let x=e._scene,b=x.camera,C=x.mode,A=TX.orientation;if(A.heading=b.heading,A.pitch=b.pitch,A.roll=b.roll,b.frustum instanceof nn){Math.abs(h)>0&&(b.zoomIn(h),b._adjustOrthographicFrustum(!0));return}let T=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,v=e._rotatingZoom,I;if(T||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),l(e._globe)&&C===ne.SCENE2D?(I=b.getPickRay(t,IH).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=Y_(e,t,Amt)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(h);return}let O=C===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!T||v){if(C===ne.SCENE2D){let R=e._zoomWorldPosition,L=b.position;if(!m.equals(R,L)&&b.positionCartographic.height<e._maxCoord.x*2){let N=b.position.x,_=m.subtract(R,L,Smt);m.normalize(_,_);let E=m.distance(R,L)*h/(b.getMagnitude()*.5);b.move(_,E*.5),(b.position.x<0&&N>0||b.position.x>0&&N<0)&&(I=b.getPickRay(t,IH).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let R=m.normalize(b.position,yxe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(m.dot(b.direction,R))<.6)O=!0;else{let L=x.canvas,N=vmt;N.x=L.clientWidth/2,N.y=L.clientHeight/2;let _=Y_(e,N,wmt);if(!l(_))O=!0;else if(b.positionCartographic.height<1e6)if(m.dot(b.direction,R)>=-.5)O=!0;else{let E=Omt;m.clone(b.position,E);let w=e._zoomWorldPosition,P=Rmt;if(P=m.normalize(w,P),m.dot(P,R)<0)return;let M=Vmt,B=Nmt;m.clone(b.direction,B),m.add(E,m.multiplyByScalar(B,1e3,IC),M);let V=Fmt,U=Bmt;m.subtract(w,E,V),m.normalize(V,U);let G=m.dot(R,U);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),Y=m.magnitude(E),j=m.magnitude(w),J=Y-h,W=m.magnitude(V),K=Math.asin(D.clamp(W/j*Math.sin(k),-1,1)),Z=Math.asin(D.clamp(J/j*Math.sin(k),-1,1)),he=K-Z+k,ge=Mmt;m.normalize(E,ge);let se=Lmt;se=m.cross(U,ge,se),se=m.normalize(se,se),m.normalize(m.cross(ge,se,IC),B),m.multiplyByScalar(m.normalize(M,IC),m.magnitude(M)-h,M),m.normalize(E,E),m.multiplyByScalar(E,J,E);let pe=kmt;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,axe),m.multiplyByScalar(B,Math.sin(he),cxe),IC),J,pe),m.add(E,pe,E),m.normalize(M,ge),m.normalize(m.cross(ge,se,IC),B);let xe=Umt;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,axe),m.multiplyByScalar(B,Math.sin(he),cxe),IC),m.magnitude(M),xe),m.add(M,xe,M),m.clone(E,b.position),m.normalize(m.subtract(M,E,IC),b.direction),m.clone(b.direction,b.direction),m.cross(b.direction,b.up,b.right),m.cross(b.right,b.direction,b.up),b.setView(TX);return}else{let E=m.normalize(_,Imt),w=m.normalize(e._zoomWorldPosition,Pmt),P=m.dot(w,E);if(P>0&&P<1){let M=D.acosClamped(P),B=m.cross(w,E,Dmt),V=Math.abs(M)>D.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-h,U=h/V;b.rotate(B,M*U)}}}}e._rotatingZoom=!O}if(!T&&O||S){let R,L=Qi.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,Emt);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&l(L)?R=b.getPickRay(L,IH):R=b.getPickRay(t,IH);let N=R.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),b.move(N,h),e._zoomingOnVector=!0}else b.zoomIn(h);e._cameraUnderground||b.setView(TX)}var zmt=new vn,Hmt=new vn,Gmt=new m;function Wmt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,zmt).origin,s=r.getPickRay(n.endPosition,Hmt).origin;o=m.fromElements(o.y,o.z,o.x,o),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(o,s,Gmt),c=m.magnitude(a);c>0&&(m.normalize(a,a),r.move(a,c))}function lxe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;DX(e,t,n,e._zoomFactor,r.getMagnitude())}var jmt=new H,qmt=new H;function uxe(e,t,n){if(l(n.angleAndHeight)){Ymt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=jmt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let u=qmt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;r.twistRight(p)}function Ymt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function Xmt(e){let t=e._scene.mapMode2D===Ul.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(nl(e,e.enableTranslate,e.translateEventTypes,Wmt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),nl(e,e.enableZoom,e.zoomEventTypes,lxe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&nl(e,e.enableRotate,e.tiltEventTypes,uxe,e.inertiaSpin,"_lastInertiaTiltMovement")):(nl(e,e.enableZoom,e.zoomEventTypes,lxe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&nl(e,e.enableRotate,e.translateEventTypes,uxe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var xxe=new vn,Kmt=new m,Jmt=new m;function Y_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Kmt)),!l(r))return m.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,xxe),u=r.pickWorldCoordinates(c,i,a,Jmt),f=l(s)?m.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?m.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(s,n):m.clone(u,n)}var Zmt=new me;function NH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,Zmt);l(c)&&(o=c.height)}else o=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-o)}var $mt=new m;function bxe(e,t){let n=t.origin,i=t.direction,r=NH(e),o=m.normalize(n,$mt),s=Math.abs(m.dot(o,i));return s=Math.max(s,.5)*2,r*s}function Cxe(e,t,n,i){let r=m.distance(t.origin,n),o=NH(e),s=D.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),vn.getPoint(t,r,i)}function Txe(e,t,n,i){let r;return l(n)?(r=m.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=NH(e))):r=NH(e),vn.getPoint(t,r,i)}var Qmt=new H;function Axe(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,Qmt),r=e._strafeEndMousePosition;H.add(r,i,r),t.endPosition=r,RX(e,t,e._strafeStartPosition),t.endPosition=n}var fxe=new vn,eht=new vn,AX=new m,tht=new m,nht=new m,iht=new m,rht=new un(m.UNIT_X,0),oht=new H,sht=new H;function aht(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Vu(e,t,n);return}if(e._strafing){Axe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=H.clone(n.startPosition,oht),a=H.clone(n.endPosition,sht),c=r.getPickRay(s,fxe),u=m.clone(m.ZERO,iht),f=m.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=Y_(e,s,AX),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=Txe(e,c,d,AX)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(T,e._strafeStartPosition),e._strafing=!0,RX(e,n,e._strafeStartPosition);return}let p=un.fromPointNormal(u,f,rht);c=r.getPickRay(s,fxe);let g=$i.rayPlane(c,p,AX),h=r.getPickRay(a,eht),x=$i.rayPlane(h,p,tht);if(!l(g)||!l(x)){e._looking=!0,Vu(e,t,n),H.clone(t,e._translateMousePosition);return}let b=m.subtract(g,x,nht),C=b.x;b.x=b.y,b.y=b.z,b.z=C;let A=m.magnitude(b);A>D.EPSILON6&&(m.normalize(b,b),r.move(b,A))}var Exe=new H,RH=new vn,OH=new m,cht=new m,Sxe=new F,lht=new F,uht=new m,fht=new un(m.UNIT_X,0),EX=new m,wX=new me,vxe=new F,dht=new Ne,mht=new $,MH=new m;function hht(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Vu(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,pht(e,t,n)):_ht(e,t,n)}function pht(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=Exe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,RH),c=m.UNIT_X,u=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-m.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Vu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,OH);m.add(u,g,g);let h=i.mapProjection,x=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let b=h.unproject(g,wX);x.cartographicToCartesian(b,g);let C=Mt.eastNorthUpToFixedFrame(g,x,Sxe),A=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=F.clone(r.transform,vxe);r._setTransform(C),Uu(e,t,n,m.UNIT_Z),r._setTransform(S),e._globe=A,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function _ht(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,OH);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=Y_(e,t,OH)),!l(s)){a=r.getPickRay(t,RH);let _=a.origin,E=a.direction,w,P=m.dot(c,E);if(Math.abs(P)>D.EPSILON6&&(w=-m.dot(c,_)/P),!l(w)||w<=0){e._looking=!0,Vu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(E,w,OH),m.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,RH)),Cxe(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let u=i.canvas,f=Exe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,RH);let d=m.clone(m.ZERO,uht);d.x=s.x;let p=un.fromPointNormal(d,c,fht),g=$i.rayPlane(a,p,cht),h=r._projection,x=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let b=h.unproject(s,wX);x.cartographicToCartesian(b,s);let C=Mt.eastNorthUpToFixedFrame(s,x,Sxe),A;l(g)?(m.fromElements(g.y,g.z,g.x,g),b=h.unproject(g,wX),x.cartographicToCartesian(b,g),A=Mt.eastNorthUpToFixedFrame(g,x,lht)):A=C;let T=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=F.clone(r.transform,vxe);r._setTransform(C);let O=m.cross(m.UNIT_Z,m.normalize(r.position,EX),EX),R=m.dot(r.right,O);if(Uu(e,t,n,v,!1,!0),r._setTransform(A),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Uu(e,t,n,v,!0,!1),r.constrainedAxis=E}else Uu(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,MH);m.equalsEpsilon(_,m.ZERO,D.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=T,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(r.positionWC,EX);if(e.enableCollisionDetection&&LX(e),!m.equals(r.positionWC,N)){r._setTransform(A),r.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let E=m.angleBetween(N,r.position),w=m.cross(N,r.position,N);m.normalize(w,w);let P=Ne.fromAxisAngle(w,E,dht),M=$.fromQuaternion(P,mht);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var wxe=new H,Ixe=new vn,Pxe=new m;function ght(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=wxe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,Ixe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Y_(e,a,Pxe));let g;if(l(p)&&(g=m.distance(u,p)),s){let h=bxe(e,c,d);l(g)?g=Math.min(g,h):g=h}if(!l(g)){let h=m.UNIT_X;g=-m.dot(h,u)/m.dot(h,f)}DX(e,t,n,e._zoomFactor,g)}function yht(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))nl(e,e.enableRotate,e.rotateEventTypes,Uu,e.inertiaSpin,"_lastInertiaSpinMovement"),nl(e,e.enableZoom,e.zoomEventTypes,Rxe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),nl(e,e.enableTilt,e.tiltEventTypes,hht,e.inertiaSpin,"_lastInertiaTiltMovement"),nl(e,e.enableTranslate,e.translateEventTypes,aht,e.inertiaTranslate,"_lastInertiaTranslateMovement"),nl(e,e.enableZoom,e.zoomEventTypes,ght,e.inertiaZoom,"_lastInertiaZoomMovement"),nl(e,e.enableLook,e.lookEventTypes,Vu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var xht=new vn,bht=new un(m.UNIT_X,0),Cht=new m,Tht=new m;function RX(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,xht),s=m.clone(r.direction,Tht);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=un.fromPointNormal(n,s,bht),c=$i.rayPlane(o,a,Cht);l(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(r.position,s,r.position))}var dxe=new m,Dxe=new me,IX=new m,PX=new re,Aht=new m,Eht=new m,Sht=new m;function vht(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(r.transform,F.IDENTITY)){Uu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,Aht);if(H.equals(t,e._rotateMousePosition)){if(e._looking)Vu(e,t,n,u);else if(e._rotating)Uu(e,t,n);else if(e._strafing)Axe(e,n);else{if(m.magnitude(r.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=IX,c.x=c.y=c.z=a,s=re.fromCartesian3(c,PX),vX(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,Dxe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Y_(e,n.startPosition,Sht);if(l(p)){let g=!1,h=r.getPickRay(n.startPosition,xxe);if(o)g=!0,Txe(e,h,p,p);else{let x=s.geodeticSurfaceNormal(p,Eht);Math.abs(m.dot(h.direction,x))<.05?g=!0:g=m.magnitude(r.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,RX(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=IX,c.x=c.y=c.z=a,s=re.fromCartesian3(c,PX),vX(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Vu(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,dxe))?(vX(e,t,n,e._ellipsoid),m.clone(dxe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Uu(e,t,n)):(e._looking=!0,Vu(e,t,n,u));H.clone(t,e._rotateMousePosition)}function Uu(e,t,n,i,r,o){r=y(r,!1),o=y(o,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,x=d*g*Math.PI;r||a.rotateRight(h),o||a.rotateUp(x),a.constrainedAxis=u}var SX=oe.clone(oe.UNIT_W),mxe=oe.clone(oe.UNIT_W),PH=new m,HS=new m,DH=new m,hxe=new m,wht=new H,Iht=new H,Pht=new H,Dht=new H,Rht=new vn;function vX(e,t,n,i){let r=e._scene,o=r.camera,s=H.clone(n.startPosition,wht),a=H.clone(n.endPosition,Iht),c=i.cartesianToCartographic(o.positionWC,Dxe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=m.clone(e._panLastWorldPosition,SX),!l(e._globe)&&!H.equalsEpsilon(s,e._panLastMousePosition)&&(u=Y_(e,s,SX)),!l(e._globe)&&l(u))){let d=m.subtract(u,o.positionWC,HS),p=m.multiplyByScalar(o.directionWC,m.dot(o.directionWC,d),HS),g=m.magnitude(p),h=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,Dht),x=H.subtract(a,s,Pht),b=m.multiplyByScalar(o.rightWC,x.x*h.x,HS),C=m.normalize(o.positionWC,yxe),A=o.getPickRay(a,Rht).direction,T=m.subtract(A,m.projectVector(A,o.rightWC,DH),DH),S=m.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let I=Math.abs(m.dot(o.directionWC,C)),O=-x.y*h.y*2/Math.sqrt(v)*(1-I),R=m.multiplyByScalar(A,O,DH);I=Math.abs(m.dot(o.upWC,C));let L=m.multiplyByScalar(o.upWC,-x.y*(1-I)*h.y,hxe);f=m.add(u,b,mxe),f=m.add(f,R,f),f=m.add(f,L,f),m.clone(f,e._panLastWorldPosition),H.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,SX),f=o.pickEllipsoid(a,i,mxe)),!l(u)||!l(f)){e._rotating=!0,Uu(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=m.mostOrthogonalAxis(d,PH);m.cross(p,d,p),m.normalize(p,p);let g=m.cross(d,p,HS),h=m.magnitude(u),x=m.dot(d,u),b=Math.acos(x/h),C=m.multiplyByScalar(d,x,DH);m.subtract(u,C,C),m.normalize(C,C);let A=m.magnitude(f),T=m.dot(d,f),S=Math.acos(T/A),v=m.multiplyByScalar(d,T,hxe);m.subtract(f,v,v),m.normalize(v,v);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=D.TWO_PI-I);let O=Math.acos(m.dot(v,p));m.dot(v,g)<0&&(O=D.TWO_PI-O);let R=I-O,L;m.equalsEpsilon(d,o.position,D.EPSILON2)?L=o.right:L=m.cross(d,o.position,PH);let N=m.cross(d,L,PH),_=m.dot(N,m.subtract(u,d,HS)),E=m.dot(N,m.subtract(f,d,HS)),w;_>0&&E>0?w=S-b:_>0&&E<=0?m.dot(o.position,d)>0?w=-b-S:w=b+S:w=b-S,o.rotateRight(R),o.rotateUp(w)}else{m.normalize(u,u),m.normalize(f,f);let d=m.dot(u,f),p=m.cross(u,f,PH);if(d<1&&!m.equalsEpsilon(p,m.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var Oht=new m,Mht=new me,pxe=0;function Rxe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=wxe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,Ixe),d,p=r.cartesianToCartographic(s.position,Mht).height,g=Math.abs(pxe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Y_(e,u,Pxe));let x;if(l(d)&&(x=m.distance(f.origin,d),pxe=x),c){let C=bxe(e,f,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let b=m.normalize(s.position,Oht);DX(e,t,n,e._zoomFactor,x,m.dot(b,s.direction))}var Oxe=new H,LH=new vn,A2=new m,Lht=new m,Mxe=new F,Nht=new F,Lxe=new F,Fht=new Ne,Bht=new $,OX=new me,MX=new m;function kht(e,t,n){let r=e._scene.camera;if(!F.equals(r.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,MX);Vu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,OX);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Vht(e,t,n)):zht(e,t,n)}var Uht=new me;function Vht(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,Uht).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=Oxe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,LH),d,p=$i.rayEllipsoid(f,i);if(l(p))d=vn.getPoint(f,p.start,A2);else if(a>e._minimumTrackBallHeight){let A=$i.grazingAltitudeLocation(f,i);if(!l(A))return;let T=i.cartesianToCartographic(A,OX);T.height=0,d=i.cartographicToCartesian(T,A2)}else{e._looking=!0;let A=e._ellipsoid.geodeticSurfaceNormal(o.position,MX);Vu(e,t,n,A),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,Mxe),h=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(o.transform,Lxe);o._setTransform(g),Uu(e,t,n,m.UNIT_Z),o._setTransform(b),e._globe=h,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function zht(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,A2);else{if(a=Y_(e,t,A2),!l(a)){if(c=o.getPickRay(t,LH),u=$i.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,OX).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(o.position,MX);Vu(e,t,n,E),H.clone(t,e._tiltCenterMousePosition)}return}a=vn.getPoint(c,u.start,A2)}s&&(l(c)||(c=o.getPickRay(t,LH)),Cxe(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=r.canvas,d=Oxe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,LH);let p=m.magnitude(a),g=m.fromElements(p,p,p,IX),h=re.fromCartesian3(g,PX);if(u=$i.rayEllipsoid(c,h),!l(u))return;let x=m.magnitude(c.origin)>p?u.start:u.stop,b=vn.getPoint(c,x,Lht),C=Mt.eastNorthUpToFixedFrame(a,i,Mxe),A=Mt.eastNorthUpToFixedFrame(b,h,Nht),T=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=F.clone(o.transform,Lxe);o._setTransform(A);let O=m.cross(b,o.positionWC,MH);if(m.dot(o.rightWC,O)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Uu(e,t,n,v,!0,!1),o.constrainedAxis=E}else Uu(e,t,n,v,!0,!1);if(o._setTransform(C),Uu(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,MH);m.equalsEpsilon(_,m.ZERO,D.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=T,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(o.positionWC,MH);if(e.enableCollisionDetection&&LX(e),!m.equals(o.positionWC,N)){o._setTransform(A),o.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let E=m.angleBetween(N,o.position),w=m.cross(N,o.position,N);m.normalize(w,w);let P=Ne.fromAxisAngle(w,E,Fht),M=$.fromQuaternion(P,Bht);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var Hht=new H,Ght=new H,_xe=new vn,gxe=new vn,Wht=new m,jht=new m;function Vu(e,t,n,i){let o=e._scene.camera,s=Hht;s.x=n.startPosition.x,s.y=0;let a=Ght;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,_xe),u=o.getPickRay(a,gxe),f=0,d,p;o.frustum instanceof nn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(h)?o.look(h,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,_xe),u=o.getPickRay(a,gxe),f=0,o.frustum instanceof nn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),l(i)){let x=o.direction,b=m.negate(i,Wht),C=m.equalsEpsilon(x,i,D.EPSILON2),A=m.equalsEpsilon(x,b,D.EPSILON2);if(!C&&!A){g=m.dot(x,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=m.dot(x,b),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let S=m.cross(i,x,jht);o.look(S,f)}else(C&&f<0||A&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function qht(e){nl(e,e.enableRotate,e.rotateEventTypes,vht,e.inertiaSpin,"_lastInertiaSpinMovement"),nl(e,e.enableZoom,e.zoomEventTypes,Rxe,e.inertiaZoom,"_lastInertiaZoomMovement"),nl(e,e.enableTilt,e.tiltEventTypes,kht,e.inertiaSpin,"_lastInertiaTiltMovement"),nl(e,e.enableLook,e.lookEventTypes,Vu)}var Yht=new F,Xht=new me;function LX(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let r=t.camera,o=i.ellipsoid,s=t.mapProjection,a,c;F.equals(r.transform,F.IDENTITY)||(a=F.clone(r.transform,Yht),c=m.magnitude(r.position),r._setTransform(F.IDENTITY));let u=Xht;n===ne.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===ne.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0)}}l(a)&&(r._setTransform(a),f&&(m.normalize(r.position,r.position),m.negate(r.position,r.direction),m.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),m.normalize(r.direction,r.direction),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up)))}E2.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Kht=new m,Jht=new m;E2.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let r=l(this._globe)?this._globe.terrainExaggeration:1,o=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=vc.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=vc.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=vc.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,Kht),c=m.clone(t.directionWC,Jht);i===ne.SCENE2D?Xmt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,yht(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,qht(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&LX(this),this._aggregator.reset()};E2.prototype.isDestroyed=function(){return!1};E2.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var S2=E2;var v2=`uniform sampler2D colorTexture; +uniform sampler2D colorTexture2; + +uniform vec2 center; +uniform float radius; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color0 = texture(colorTexture, v_textureCoordinates); + vec4 color1 = texture(colorTexture2, v_textureCoordinates); + + float x = length(gl_FragCoord.xy - center) / radius; + float t = smoothstep(0.5, 0.8, x); + out_FragColor = mix(color0 + color1, color1, t); +} +`;var w2=`uniform sampler2D colorTexture; + +uniform float avgLuminance; +uniform float threshold; +uniform float offset; + +in vec2 v_textureCoordinates; + +float key(float avg) +{ + float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); + return max(0.0, guess) + 0.1; +} + +// See section 9. "The bright-pass filter" of Realtime HDR Rendering +// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf + +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec3 xyz = czm_RGBToXYZ(color.rgb); + float luminance = xyz.r; + + float scaledLum = key(avgLuminance) * luminance / avgLuminance; + float brightLum = max(scaledLum - threshold, 0.0); + float brightness = brightLum / (offset + brightLum); + + xyz.r = brightness; + out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); +} +`;function X_(){this._sceneFramebuffer=new gC;let e=.125,t=new Array(6);t[0]=new Tr({fragmentShader:Vl,textureScale:e,forcePowerOfTwo:!0,sampleMode:ku.LINEAR});let n=t[1]=new Tr({fragmentShader:w2,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new Tr({fragmentShader:l0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Tr({fragmentShader:l0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Tr({fragmentShader:Vl,sampleMode:ku.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new Tr({fragmentShader:v2,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new el({stages:t});let r=new EC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}X_.prototype.get=function(e){return this._stages.get(e)};X_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Zht=new oe,Nxe=new H,$ht=new H,Fxe=new F;function Qht(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,Fxe),u=F.multiplyByPoint(o,r,Zht),f=Mt.pointToGLWindowCoordinates(s,c,r,Nxe);u.x+=D.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=H.magnitude(H.subtract(d,f,d))*30*2,g=$ht;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,C=b.get(0),A=C.outputTexture.width,T=C.outputTexture.height,S=new Ye;S.width=A,S.height=T,c=F.computeViewportTransformation(S,0,1,Fxe),f=Mt.pointToGLWindowCoordinates(s,c,r,Nxe),g.x*=A/h,g.y*=T/x;let v=C.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,h),v.height=Math.min(g.y,x);for(let I=1;I<4;++I)Ye.clone(v,b.get(I).scissorRectangle)}X_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};X_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Qht(this,t,n),r};X_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};X_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Vl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};X_.prototype.isDestroyed=function(){return!1};X_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var I2=X_;function Bxe(){this._cachedShowFrustumsShaders={}}function ept(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function tpt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=ze.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`,a+=`uniform vec3 debugShowFrustumsColor; +`,a+=`void main() +{ + czm_Debug_main(); +`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; +`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; +`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; +`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; +`;a+="}",r.sources.push(a);let u=ept(i);return Jt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var P2=new z;function npt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(P2.red=t.debugOverlappingFrustums&1?1:0,P2.green=t.debugOverlappingFrustums&2?1:0,P2.blue=t.debugOverlappingFrustums&4?1:0,P2.alpha=1,P2):z.WHITE}),n}var ipt=new tt;Bxe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=tpt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=tt.shallowClone(t,ipt);o.shaderProgram=r,o.uniformMap=npt(e,t),o.execute(e.context,n)};var D2=Bxe;var BH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function qi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=je(e.contextOptions),o=l(n),s=new RN(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=qn(),this._jobScheduler=new kF,this._frameState=new FF(s,new PF(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new vN(s),this._globe=void 0,this._globeTranslucencyState=new BF,this._primitives=new Pl,this._groundPrimitives=new Pl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new wC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new OF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new z,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:Ue.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new C2(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new D2,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Pi,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new NF,this._shadowMapCamera=new mr(this),this.shadowMap=new j_({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new kS,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new x2,this._brdfLutGenerator=new AF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new S2(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Ul.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Ua.requestCompletedEvent.addEventListener(BH(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(BH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ye(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new mr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new mr(this),this.preloadFlightCullingVolume=void 0,this._picking=new ZF(this),this._defaultView=new bC(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new N_,zxe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function rpt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(BH(e))),n.push(t.terrainProviderChanged.addEventListener(BH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(qi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ht.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ht.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return xd.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,rpt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new mr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new LF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ht.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});qi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function kxe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=z_.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=z_.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=z_.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=j_.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ee.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}qi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);let o=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=o&&!c,p=s&&!u,g=(!o||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=j_.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=z_.createLogDepthCommand(e,n,a.logDepth),kxe(this,a.logDepth.command,i)),(f||g)&&kxe(this,e,i)}};var opt=new Wf({pass:Fr.RENDER}),NX=new Wf({pass:Fr.PRELOAD}),FX=new Wf({pass:Fr.PRELOAD_FLIGHT}),spt=new Wf({pass:Fr.REQUEST_RENDER_MODE_DEFER_CHECK}),Uxe=new ae,BX;function apt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Uxe.radius=n.minimumRadius+i,BX=bN.fromBoundingSphere(Uxe,e.camera.positionWC,BX),BX}}qi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function zxe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}qi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=apt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof nn||this.camera.frustum instanceof vo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),kS.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};qi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==en.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var FH=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);FH=F.inverseTransformation(FH,FH);function cpt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(r.mode!==ne.SCENE3D){c=F.multiplyByPoint(FH,c,c);let p=r.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=Bn.toWireframe(ks.createGeometry(new ks({radii:new m(p,p,p),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new wn({geometryInstances:new Ct({geometry:a,modelMatrix:F.fromTranslation(c),attributes:{color:new zt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Bn.toWireframe(cl.createGeometry(cl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT}))),t._debugVolume=new wn({geometryInstances:new Ct({geometry:a,modelMatrix:F.fromRotationTranslation(p,c,new F),attributes:{color:new zt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1})}let u=r.commandList,f=r.commandList=[];t._debugVolume.update(r),e=f[0],r.useLogDepth&&(e=z_.createLogDepthCommand(e,o).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(d)&&(n.framebuffer=d),r.commandList=u}function Oa(e,t,n,i,r){let o=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&cpt(e,t,i,r),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function R2(e,t,n,i){let r=t._frameState,o=e.derivedCommands;l(o)&&(r.useLogDepth&&l(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,l(o.picking)?(e=o.picking.pickCommand,e.execute(n,i)):l(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(n,i)))}function Hxe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function lpt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function upt(e,t,n,i,r){let o=e.context;L_(i,Hxe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function fpt(e,t,n,i,r){let o=e.context;L_(i,lpt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function dpt(e,t,n,i){let r=e.context;L_(i,Hxe,e.camera.positionWC);let o=i.length;for(let s=0;s<o;++s)t(i[s],e,r,n)}var mpt=new Ii,hpt=new Zc,ppt=new nn,_pt=new vo;function kX(e,t){let n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;o.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(mpt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(hpt):l(n.frustum.width)?s=n.frustum.clone(ppt):s=n.frustum.clone(_pt),s.near=n.frustum.near,s.far=n.frustum.far,o.updateFrustum(s),o.updatePass(Ee.ENVIRONMENT);let a=r.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let E=u.skyBoxCommand;if(l(E)&&Oa(E,e,i,t),u.isSkyAtmosphereVisible&&Oa(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let w;u.useGlobeDepthFramebuffer?w=f.globeDepth.framebuffer:u.usePostProcess?w=f.sceneFramebuffer.framebuffer:w=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,w),t.framebuffer=w}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(E,w,P,M,B){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(E,w,P,M,B)}),g=e._executeOITFunction):a.render?g=upt:g=fpt;let h=f.frustumCommandsList,x=h.length,b=u.clearGlobeDepth,C=u.useDepthPlane,A=e._globeTranslucencyState,T=A.translucent,S=e._view.globeTranslucencyFramebuffer,v=e._depthClearCommand,I=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,L=u.usePostProcessSelected,N=n.position.z,_;for(let E=0;E<x;++E){let w=x-E-1,P=h[w];e.mode===ne.SCENE2D?(n.position.z=N-P.near+1,s.far=Math.max(1,P.far-P.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&I.execute(i,t),o.updatePass(Ee.GLOBE);let M=P.commands[Ee.GLOBE],B=P.indices[Ee.GLOBE];if(T)A.executeGlobeCommands(P,Oa,S,e,t);else for(_=0;_<B;++_)Oa(M[_],e,i,t);let V=f.globeDepth;if(l(V)&&u.useGlobeDepthFramebuffer&&V.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(o.updatePass(Ee.TERRAIN_CLASSIFICATION),M=P.commands[Ee.TERRAIN_CLASSIFICATION],B=P.indices[Ee.TERRAIN_CLASSIFICATION],T)A.executeGlobeClassificationCommands(P,Oa,S,e,t);else for(_=0;_<B;++_)Oa(M[_],e,i,t);if(b&&(v.execute(i,t),C&&R.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Ee.CESIUM_3D_TILE),M=P.commands[Ee.CESIUM_3D_TILE],B=P.indices[Ee.CESIUM_3D_TILE],_=0;_<B;++_)Oa(M[_],e,i,t);if(B>0&&(l(V)&&u.useGlobeDepthFramebuffer&&(V.prepareColorTextures(i,b),V.executeUpdateDepth(i,t,b,V.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(o.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION),M=P.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],B=P.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)Oa(M[_],e,i,t)}else{e._invertClassification.clear(i,t);let Y=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(Ee.CESIUM_3D_TILE),M=P.commands[Ee.CESIUM_3D_TILE],B=P.indices[Ee.CESIUM_3D_TILE],_=0;_<B;++_)Oa(M[_],e,i,t);for(l(V)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),V.executeUpdateDepth(i,t,b,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),M=P.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],B=P.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<B;++_)Oa(M[_],e,i,t);for(t.framebuffer=Y,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),B>0&&i.stencilBuffer&&O.execute(i,t),o.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION),M=P.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],B=P.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)Oa(M[_],e,i,t)}for(B>0&&i.stencilBuffer&&I.execute(i,t),o.updatePass(Ee.VOXELS),M=P.commands[Ee.VOXELS],B=P.indices[Ee.VOXELS],M.length=B,dpt(e,Oa,t,M),o.updatePass(Ee.OPAQUE),M=P.commands[Ee.OPAQUE],B=P.indices[Ee.OPAQUE],_=0;_<B;++_)Oa(M[_],e,i,t);w!==0&&e.mode!==ne.SCENE2D&&(s.near=P.near,o.updateFrustum(s));let U;if(!c&&u.useInvertClassification&&r.invertClassificationColor.alpha<1&&(U=e._invertClassification),o.updatePass(Ee.TRANSLUCENT),M=P.commands[Ee.TRANSLUCENT],M.length=P.indices[Ee.TRANSLUCENT],g(e,Oa,t,M,U),P.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,Oa,t,M,V.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,Oa,t,P)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let Y=V.depthStencilTexture,j=e._picking.getPickDepth(e,w);j.update(i,Y),j.executeCopyDepth(i,t)}if(c||!L)continue;let k=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s),o.updatePass(Ee.GLOBE),M=P.commands[Ee.GLOBE],B=P.indices[Ee.GLOBE],T)A.executeGlobeCommands(P,R2,S,e,t);else for(_=0;_<B;++_)R2(M[_],e,i,t);for(b&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),b&&C&&R.execute(i,t),o.updatePass(Ee.CESIUM_3D_TILE),M=P.commands[Ee.CESIUM_3D_TILE],B=P.indices[Ee.CESIUM_3D_TILE],_=0;_<B;++_)R2(M[_],e,i,t);for(o.updatePass(Ee.OPAQUE),M=P.commands[Ee.OPAQUE],B=P.indices[Ee.OPAQUE],_=0;_<B;++_)R2(M[_],e,i,t);for(o.updatePass(Ee.TRANSLUCENT),M=P.commands[Ee.TRANSLUCENT],B=P.indices[Ee.TRANSLUCENT],_=0;_<B;++_)R2(M[_],e,i,t);t.framebuffer=k}}function Gxe(e){e.context.uniformState.updatePass(Ee.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,r=i.length;for(let o=0;o<r;++o)i[o].execute(e._computeEngine)}function gpt(e,t){e.context.uniformState.updatePass(Ee.OVERLAY);let i=e.context,r=e._overlayCommandList,o=r.length;for(let s=0;s<o;++s)r[s].execute(i,t)}function ypt(e,t,n){let i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,s=o.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Ee.GLOBE||u.pass===Ee.CESIUM_3D_TILE||u.pass===Ee.OPAQUE||u.pass===Ee.TRANSLUCENT)&&e.isVisible(u,i))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(u,p))o[d].commandList.push(u),f=!0;else if(f)break}}}}function Wxe(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;ypt(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];o.updateCamera(p.camera),a.updatePass(r,d);let g=p.commandList.length;for(let h=0;h<g;++h){let x=p.commandList[h];o.updatePass(x.pass),Oa(x.derivedCommands.shadows.castCommands[s],e,r,p.passState)}}}}var xpt=new m;qi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?bpt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===Ul.ROTATE?(Cpt(this,e),f0(!0,this,e,t)):(UX(this,e,t),Dpt(this,e))};function bpt(e,t,n){let i=e._view,r=i.camera,s=e._environmentState.renderTranslucentDepthForPick;UX(e,t,n),jxe(e),i.createPotentiallyVisibleSet(e),Gxe(e),s||Wxe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=mr.clone(r,e._cameraVR);c.frustum=r.frustum;let u=r.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,xpt);r.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;m.add(c.position,p,r.position),r.frustum.xOffset=g,kX(e,t),a.x=a.width,m.subtract(c.position,p,r.position),r.frustum.xOffset=-g,kX(e,t),mr.clone(c,r)}function Cpt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var Tpt=new me(Math.PI,D.PI_OVER_TWO),Apt=new m,Ept=new m,Spt=new F,vpt=new F,wpt=new m,Ipt=new m,Ppt=new Ye;function Dpt(e,t){let n=e.context,i=e.frameState,r=e.camera,o=t.viewport,s=Ye.clone(o,Ppt);t.viewport=s;let a=Tpt,c=Apt;e.mapProjection.project(a,c);let f=m.clone(r.position,Ept),d=F.clone(r.transform,vpt),p=r.frustum.clone();r._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,Spt),h=r.frustum.projectionMatrix,x=r.positionWC.y,b=m.fromElements(D.sign(x)*c.x-x,0,-r.positionWC.x,wpt),C=Mt.pointToGLWindowCoordinates(h,g,b,Ipt);C.x=Math.floor(C.x);let A=s.x,T=s.width;if(x===0||C.x<=A||C.x>=A+T)f0(!0,e,t);else if(Math.abs(A+T*.5-C.x)<1)s.width=C.x-s.x,r.position.x*=D.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!0,e,t),s.x=C.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!1,e,t);else if(C.x>A+T*.5){s.width=C.x-A;let S=r.frustum.right;r.frustum.right=c.x-x,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!0,e,t),s.x=C.x,s.width=A+T-C.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=S-r.frustum.right*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!1,e,t)}else{s.x=C.x,s.width=A+T-C.x;let S=r.frustum.left;r.frustum.left=-c.x-x,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!0,e,t),s.x=A,s.width=C.x-A,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=S-r.frustum.left*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),f0(!1,e,t)}r._setTransform(d),m.clone(f,r.position),r.frustum=p.clone(),t.viewport=o}function f0(e,t,n,i){let r=t._environmentState,o=t._view,s=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),jxe(t),o.createPotentiallyVisibleSet(t),e&&(l(i)&&UX(t,n,i),Gxe(t),s||Wxe(t)),kX(t,n)}var Vxe=new ts;qi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof nn||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(o)?(l(s)&&(o.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(x)?x.drawCommand:void 0,n.sunComputeCommand=l(x)?x.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!r;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=Vxe.planes;for(let x=0;x<5;++x)p[x]=d.planes[x];d=Vxe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;l(g)&&(!l(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new xd(g)):!l(g)&&l(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function Rpt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Mh({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Opt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,!!r){for(let o=0;o<i;++o)if(n[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let o=0;o<i;++o){let s=n[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function jxe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Rpt(e),Opt(e),e._globe&&e._globe.render(t)}function UX(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new I2:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let h=e.postProcessStages,x=o.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(o.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,r.useLogDepth,e._hdr),h.clear(i),x=o.usePostProcess=h.ready,o.usePostProcessSelected=x&&h.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&o.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let A=e._invertClassification.unclassifiedCommand,T=A.derivedCommands;T.oit=p.createDerivedCommands(A,i,T.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}qi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;l(r)&&r.prepareColorTextures(t);let o=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?r.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!o&&(g=u);let h=this.postProcessStages,x=g.getColorTexture(0),b=d.getColorTexture(0),C=y(u,f).getDepthStencilTexture();h.execute(t,x,C,b),h.copy(t,c)}!o&&!a&&s&&(e.framebuffer=c,r.executeCopyColor(t,e))};function Mpt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function Lpt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function Npt(e){let t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!l(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return l(s)&&o.height<s}qi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=Lpt(this),this._cameraUnderground=Npt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Fpt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new H_({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Bpt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function kpt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),Ua.update()}var Upt=new z;function Vpt(e){let t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=opt;let o=y(e.backgroundColor,z.BLACK);e._hdr&&(o=z.clone(o,Upt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof N_?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ye.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,gpt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function PC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function zpt(e){return e._picking.updateMostDetailedRayPicks(e)}qi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=D.incrementWrap(t.frameNumber,15e6,1);zxe(this,r,e),t.newFrame=!0}PC(this,Bpt),this.primitives.show&&(PC(this,zpt),PC(this,Hpt),PC(this,Gpt),i||PC(this,Wpt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),PC(this,Vpt)),Fpt(this,i),PC(this,kpt),Mpt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};qi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};qi.prototype.requestRender=function(){this._renderRequested=!0};qi.prototype.clampLineWidth=function(e){return Math.max(Ht.minimumAliasedLineWidth,Math.min(e,Ht.maximumAliasedLineWidth))};qi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};qi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};qi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};qi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Hpt(e){let t=e._frameState;NX.camera=t.camera,NX.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,NX)}function Gpt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;FX.camera=e.preloadFlightCamera,FX.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,FX)}function Wpt(e){e.primitives.updateForPass(e._frameState,spt)}qi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};qi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};qi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};qi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};qi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};qi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};qi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};qi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};qi.prototype.cartesianToCanvasCoordinates=function(e,t){return Qi.wgs84ToWindowCoordinates(this,e,t)};qi.prototype.completeMorph=function(){this._transitioner.completeMorph()};qi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};qi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};qi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function jpt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}qi.prototype.setTerrain=function(e){return jpt(this,e),e};qi.prototype.isDestroyed=function(){return!1};qi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var O2=qi;function GS(e){e=y(e,re.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new tt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(GS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});GS.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var VX=new F;GS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,VX),r=F.multiplyTransformation(i,hr.Y_UP_TO_Z_UP,VX),o=F.multiply(this._scaleMatrix,r,VX);F.clone(o,this._modelMatrix);let s=e.context,a=qpt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ks.createGeometry(new ks({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Oe.POSITION_ONLY}));f.vertexArray=si.fromGeometry({context:s,geometry:p,attributeLocations:Bn.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:dn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new ze({defines:p,sources:[F_,hS,XN]}),h=new ze({defines:p,sources:[F_,hS,YN]});this._spSkyAtmosphere=Jt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function qpt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}GS.prototype.isDestroyed=function(){return!1};GS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var M2=GS;function kH(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new tt({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}kH.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let o=this.sources;typeof o.positiveX=="string"?ON(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ha({context:i,source:o}))}let r=this._command;if(!l(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};let o=cl.createGeometry(cl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Oe.POSITION_ONLY})),s=this._attributeLocations=Bn.createAttributeLocations(o);r.vertexArray=si.fromGeometry({context:i,geometry:o,attributeLocations:s,bufferUsage:Fe.STATIC_DRAW}),r.renderState=Ue.fromCache({blending:dn.ALPHA_BLEND})}if(!l(r.shaderProgram)||this._useHdr!==t){let o=new ze({defines:[t?"HDR":""],sources:[KN]});r.shaderProgram=Jt.fromCache({context:i,vertexShaderSource:JN,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return r};kH.prototype.isDestroyed=function(){return!1};kH.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var L2=kH;function F2(){this.show=!0,this._drawCommand=new tt({primitiveType:Le.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(F2.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Ypt=new H,Xpt=new H,Kpt=new oe,N2=new oe;F2.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(o,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?r.halfFloatingPointTexture?Xe.HALF_FLOAT:Xe.FLOAT:Xe.UNSIGNED_BYTE;this._texture=new Lt({context:r,width:S,height:S,pixelFormat:ct.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,O={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new ef({fragmentShaderSource:$N,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let I=mt.createVertexBuffer({context:r,typedArray:v,usage:Fe.STATIC_DRAW}),O=[{index:S.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=mt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT});a.vertexArray=new si({context:r,attributes:O,indexBuffer:R}),a.shaderProgram=Jt.fromCache({context:r,vertexShaderSource:QN,fragmentShaderSource:ZN,attributeLocations:S}),a.renderState=Ue.fromCache({blending:dn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=Qi.computeActualWgs84Position(e,c,N2),g=m.magnitude(m.subtract(p,e.camera.position,N2)),h=r.uniformState.projection,x=Kpt;x.x=0,x.y=0,x.z=-g,x.w=1;let b=F.multiplyByVector(h,x,N2),C=Qi.clipToGLWindowCoordinates(t.viewport,b,Ypt);x.x=D.SOLAR_RADIUS;let A=F.multiplyByVector(h,x,N2),T=Qi.clipToGLWindowCoordinates(t.viewport,A,Xpt);return this._size=H.magnitude(H.subtract(T,C,N2)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};F2.prototype.isDestroyed=function(){return!1};F2.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var B2=F2;function WS(e){return tn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Jpt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let o="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(o,void 0,r)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function qxe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Yxe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=qxe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function Xxe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function DC(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=Wt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=Wt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Pn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Pn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new qd,Yxe(this);try{let p=new O2({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,qxe(this),Xxe(this);let g=y(p.mapProjection.ellipsoid,re.WGS84),h=t.globe;l(h)||(h=new yF(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,bn.RECEIVE_ONLY));let x=t.skyBox;l(x)||(x=new L2({sources:{positiveX:WS("px"),negativeX:WS("mx"),positiveY:WS("py"),negativeY:WS("my"),positiveZ:WS("pz"),negativeZ:WS("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new B2,p.moon=new CF);let b=t.skyAtmosphere;l(b)||(b=new M2(g)),b!==!1&&(p.skyAtmosphere=b),l(t.imageryProvider)&&Q("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(l(t.imageryProvider)&&!l(C)&&(C=new Hs(t.imageryProvider)),l(C)||(C=Hs.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new Ru(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let A=this;this._onRenderError=function(T,S){if(A._useDefaultRenderLoop=!1,A._renderLoopRunning=!1,A._showRenderLoopErrors){let v="An error occurred while rendering. Rendering has stopped.";A.showErrorPanel(v,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(DC.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Jpt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});DC.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=wh(n);u||(typeof n=="string"&&(n=new Error(n)),t=wh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${h}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(C){x.removeChild(b),x.appendChild(document.createTextNode(h)),x.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};DC.prototype.isDestroyed=function(){return!1};DC.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};DC.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Yxe(this),Xxe(this),this._scene.requestRender())};DC.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var k2=DC;var Zpt=new m(1,1,1);function zX(e){e=y(e,Zpt),this._dimensions=m.clone(e)}Object.defineProperties(zX.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var $pt=new m;zX.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,$pt),i=D.randomBetween(-n.x,n.x),r=D.randomBetween(-n.y,n.y),o=D.randomBetween(-n.z,n.z);e.position=m.fromElements(i,r,o,e.position),e.velocity=m.normalize(e.position,e.velocity)};var HX=zX;var U2=`// See Intersection.glsl for the definition of intersectScene +// See IntersectionUtils.glsl for the definition of nextIntersection +// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl +// for the definition of convertUvToShapeUvSpace. The appropriate function is +// selected based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See Octree.glsl for the definitions of TraversalData, SampleData, +// traverseOctreeFromBeginning, and traverseOctreeFromExisting +// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture + +#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 + +uniform mat3 u_transformDirectionViewToLocal; +uniform vec3 u_cameraPositionUv; +uniform float u_stepSize; + +#if defined(PICKING) + uniform vec4 u_pickColor; +#endif + +#if defined(JITTER) +float hash(vec2 p) +{ + vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); +} +#endif + +vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { +#if defined(SHAPE_BOX) + Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); + RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); + vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; + float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); + float dt = (exit - entry.w) * RAY_SCALE; + return vec4(normalize(entry.xyz), dt); +#else + float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); + return vec4(viewRay.dir, u_stepSize / dimAtLevel); +#endif +} + +void main() +{ + vec4 fragCoord = gl_FragCoord; + vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] + vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); + vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case + vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case + vec3 viewPosUv = u_cameraPositionUv; + #if defined(SHAPE_BOX) + vec3 dInv = 1.0 / viewDirUv; + Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); + #else + Ray viewRayUv = Ray(viewPosUv, viewDirUv); + #endif + + Intersections ix; + RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); + + // Exit early if the scene was completely missed. + if (shapeIntersection.entry.w == NO_HIT) { + discard; + } + + float currT = shapeIntersection.entry.w * RAY_SCALE; + float endT = shapeIntersection.exit.w; + vec3 positionUv = viewPosUv + currT * viewDirUv; + vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + + // Traverse the tree from the start position + TraversalData traversalData; + SampleData sampleDatas[SAMPLE_COUNT]; + traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); + vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + + #if defined(JITTER) + float noise = hash(screenCoord); // [0,1] + currT += noise * step.w; + positionUv += noise * step.w * viewDirUv; + #endif + + FragmentInput fragmentInput; + #if defined(STATISTICS) + setStatistics(fragmentInput.metadata.statistics); + #endif + + vec4 colorAccum =vec4(0.0); + + for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { + // Read properties from the megatexture based on the traversal state + Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); + + // Prepare the custom shader inputs + copyPropertiesToMetadata(properties, fragmentInput.metadata); + fragmentInput.voxel.positionUv = positionUv; + fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; + fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; + fragmentInput.voxel.viewDirUv = viewDirUv; + fragmentInput.voxel.viewDirWorld = viewDirWorld; + fragmentInput.voxel.surfaceNormal = step.xyz; + fragmentInput.voxel.travelDistance = step.w; + + // Run the custom shader + czm_modelMaterial materialOutput; + fragmentMain(fragmentInput, materialOutput); + + // Sanitize the custom shader output + vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); + color.rgb = max(color.rgb, vec3(0.0)); + color.a = clamp(color.a, 0.0, 1.0); + + // Pre-multiplied alpha blend + colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); + + // Stop traversing if the alpha has been fully saturated + if (colorAccum.a > ALPHA_ACCUM_MAX) { + colorAccum.a = ALPHA_ACCUM_MAX; + break; + } + + if (step.w == 0.0) { + // Shape is infinitely thin. The ray may have hit the edge of a + // foreground voxel. Step ahead slightly to check for more voxels + step.w == 0.00001; + } + + // Keep raymarching + currT += step.w; + positionUv += step.w * viewDirUv; + + // Check if there's more intersections. + if (currT > endT) { + #if (INTERSECTION_COUNT == 1) + break; + #else + shapeIntersection = nextIntersection(ix); + if (shapeIntersection.entry.w == NO_HIT) { + break; + } else { + // Found another intersection. Resume raymarching there + currT = shapeIntersection.entry.w * RAY_SCALE; + endT = shapeIntersection.exit.w; + positionUv = viewPosUv + currT * viewDirUv; + } + #endif + } + + // Traverse the tree from the current ray position. + // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. + positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); + step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + } + + // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] + colorAccum.a /= ALPHA_ACCUM_MAX; + + #if defined(PICKING) + // If alpha is 0.0 there is nothing to pick + if (colorAccum.a == 0.0) { + discard; + } + out_FragColor = u_pickColor; + #else + out_FragColor = colorAccum; + #endif +} +`;var V2=`in vec2 position; + +uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; + +void main() { + vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; + vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; + vec2 translation = 0.5 * (aabbMax + aabbMin); + vec2 scale = 0.5 * (aabbMax - aabbMin); + gl_Position = vec4(position * scale + translation, 0.0, 1.0); +} +`;var z2=`/* Intersection defines +#define INTERSECTION_COUNT ### +*/ + +#define NO_HIT (-czm_infinity) +#define INF_HIT (czm_infinity * 0.5) +#define RAY_SHIFT (0.000003163) +#define RAY_SCALE (1.003163) + +struct Ray { + vec3 pos; + vec3 dir; +#if defined(SHAPE_BOX) + vec3 dInv; +#endif +}; + +struct RayShapeIntersection { + vec4 entry; + vec4 exit; +}; + +struct Intersections { + // Don't access these member variables directly - call the functions instead. + + // Store an array of ray-surface intersections. Each intersection is composed of: + // .xyz for the surface normal at the intersection point + // .w for the T value + // The scale of the normal encodes the shape intersection type: + // length(intersection.xyz) = 1: positive shape entry + // length(intersection.xyz) = 2: positive shape exit + // length(intersection.xyz) = 3: negative shape entry + // length(intersection.xyz) = 4: negative shape exit + // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, + // so we need twice as many to track ray-*surface* intersections + vec4 intersections[INTERSECTION_COUNT * 2]; + + #if (INTERSECTION_COUNT > 1) + // Maintain state for future nextIntersection calls + int index; + int surroundCount; + bool surroundIsPositive; + #endif +}; + +RayShapeIntersection getFirstIntersection(in Intersections ix) +{ + return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +} + +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +{ + float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; + return vec4(intersection.xyz * scale, intersection.w); +} + +// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. +#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) +#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) +#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; +#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) + +#if (INTERSECTION_COUNT > 1) +void initializeIntersections(inout Intersections ix) { + // Sort the intersections from min T to max T with bubble sort. + // Note: If this sorting function changes, some of the intersection test may + // need to be updated. Search for "bubble sort" to find those areas. + const int sortPasses = INTERSECTION_COUNT * 2 - 1; + for (int n = sortPasses; n > 0; --n) { + for (int i = 0; i < sortPasses; ++i) { + // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= n) { break; } + + vec4 intersect0 = ix.intersections[i + 0]; + vec4 intersect1 = ix.intersections[i + 1]; + + bool inOrder = intersect0.w <= intersect1.w; + + ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; + ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; + } + } + + // Prepare initial state for nextIntersection + ix.index = 0; + ix.surroundCount = 0; + ix.surroundIsPositive = false; +} +#endif + +#if (INTERSECTION_COUNT > 1) +RayShapeIntersection nextIntersection(inout Intersections ix) { + vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); + RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); + + const int passCount = INTERSECTION_COUNT * 2; + + if (ix.index == passCount) { + return shapeIntersection; + } + + for (int i = 0; i < passCount; ++i) { + // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to continue instead. + if (i < ix.index) { + continue; + } + + ix.index = i + 1; + + surfaceIntersection = ix.intersections[i]; + int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); + bool currShapeIsPositive = intersectionType < 2; + bool enter = intMod(intersectionType, 2) == 0; + + ix.surroundCount += enter ? +1 : -1; + ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; + + // entering positive or exiting negative + if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { + shapeIntersection.entry = surfaceIntersection; + } + + // exiting positive or entering negative after being inside positive + bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; + bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; + if (exitPositive || enterNegativeFromPositive) { + shapeIntersection.exit = surfaceIntersection; + + // entry and exit have been found, so the loop can stop + if (exitPositive) { + // After exiting positive shape there is nothing left to intersect, so jump to the end index. + ix.index = passCount; + } + break; + } + } + + return shapeIntersection; +} +#endif + +// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 +`;var H2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersectionPair, INF_HIT, NO_HIT + +/* intersectDepth defines (set in Scene/VoxelRenderResources.js) +#define DEPTH_INTERSECTION_INDEX ### +*/ + +uniform mat4 u_transformPositionViewToUv; + +void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); + if (logDepthOrDepth != 0.0) { + // Calculate how far the ray must travel before it hits the depth buffer. + vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); + eyeCoordinateDepth /= eyeCoordinateDepth.w; + vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); + float t = dot(depthPositionUv - ray.pos, ray.dir); + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); + } else { + // There's no depth at this location. + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); + } +} +`;var G2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +// NO_HIT, setIntersectionPair + +/* Clipping plane defines (set in Scene/VoxelRenderResources.js) +#define CLIPPING_PLANES_UNION +#define CLIPPING_PLANES_COUNT +#define CLIPPING_PLANES_INTERSECTION_INDEX +*/ + +uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; + +// Plane is in Hessian Normal Form +vec4 intersectPlane(in Ray ray, in vec4 plane) { + vec3 n = plane.xyz; // normal + float w = plane.w; // -dot(pointOnPlane, normal) + + float a = dot(ray.pos, n); + float b = dot(ray.dir, n); + float t = -(w + a) / b; + + return vec4(n, t); +} + +void intersectClippingPlanes(in Ray ray, inout Intersections ix) { + vec4 backSide = vec4(-ray.dir, -INF_HIT); + vec4 farSide = vec4(ray.dir, +INF_HIT); + RayShapeIntersection clippingVolume; + + #if (CLIPPING_PLANES_COUNT == 1) + // Union and intersection are the same when there's one clipping plane, and the code + // is more simplified. + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + bool reflects = dot(ray.dir, intersection.xyz) < 0.0; + clippingVolume.entry = reflects ? backSide : intersection; + clippingVolume.exit = reflects ? intersection : farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #elif defined(CLIPPING_PLANES_UNION) + vec4 firstTransmission = vec4(ray.dir, +INF_HIT); + vec4 lastReflection = vec4(-ray.dir, -INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; + } else { + lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; + } + } + clippingVolume.entry = backSide; + clippingVolume.exit = lastReflection; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); + clippingVolume.entry = firstTransmission; + clippingVolume.exit = farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); + #else // intersection + vec4 lastTransmission = vec4(ray.dir, -INF_HIT); + vec4 firstReflection = vec4(-ray.dir, +INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; + } else { + firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; + } + } + if (lastTransmission.w < firstReflection.w) { + clippingVolume.entry = lastTransmission; + clippingVolume.exit = firstReflection; + } else { + clippingVolume.entry = vec4(-ray.dir, NO_HIT); + clippingVolume.exit = vec4(ray.dir, NO_HIT); + } + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #endif +} +`;var W2=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT +// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace + +/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_INTERSECTION_INDEX ### // always 0 +*/ + +uniform vec3 u_renderMinBounds; +uniform vec3 u_renderMaxBounds; + +struct Box { + vec3 p0; + vec3 p1; +}; + +Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) +{ + // Find the min/max cornerpoints of the voxel in tile coordinates + vec3 tileOrigin = vec3(octreeCoords.xyz); + vec3 numSamples = vec3(u_dimensions); + vec3 voxelSize = 1.0 / numSamples; + vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; + vec3 coordP1 = coordP0 + voxelSize; + + // Transform to the UV coordinates of the scaled tileset + float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); + vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); + vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); + + return Box(p0, p1); +} + +vec3 getBoxNormal(in Box box, in Ray ray, in float t) +{ + vec3 hitPoint = ray.pos + t * ray.dir; + vec3 lower = step(hitPoint, box.p0); + vec3 upper = step(box.p1, hitPoint); + return normalize(upper - lower); +} + +// Find the distances along a ray at which the ray intersects an axis-aligned box +// See https://tavianator.com/2011/ray_box.html +RayShapeIntersection intersectBox(in Ray ray, in Box box) +{ + // Consider the box as the intersection of the space between 3 pairs of parallel planes + // Compute the distance along the ray to each plane + vec3 t0 = (box.p0 - ray.pos) * ray.dInv; + vec3 t1 = (box.p1 - ray.pos) * ray.dInv; + + // Identify candidate entries/exits based on distance from ray.pos + vec3 entries = min(t0, t1); + vec3 exits = max(t0, t1); + + // The actual box intersection points are the furthest entry and the closest exit + float entryT = max(max(entries.x, entries.y), entries.z); + float exitT = min(min(exits.x, exits.y), exits.z); + + vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); + vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); + + if (entryT > exitT) { + entryT = NO_HIT; + exitT = NO_HIT; + } + + return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); +} + +void intersectShape(in Ray ray, inout Intersections ix) +{ + RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); + setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +} +`;var j2=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, +// setIntersectionPair + +/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO + +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED + +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN +#define CYLINDER_INTERSECTION_INDEX_ANGLE +*/ + +// Cylinder uniforms +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + uniform vec3 u_cylinderUvToRenderBoundsScale; + uniform vec3 u_cylinderUvToRenderBoundsTranslate; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + uniform float u_cylinderUvToRenderRadiusMin; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) + uniform vec2 u_cylinderRenderAngleMinMax; +#endif + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +#define POSITIVE_HIT vec2(t, +INF_HIT); +#define NEGATIVE_HIT vec2(-INF_HIT, t); + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + // Half space cuts right through the camera, pick the side to intersect + if (a == 0.0) { + if (b >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } + } + + if (t >= 0.0 != s >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float ta = (-b - det) / a; + float tb = (-b + det) / a; + float t1 = min(ta, tb); + float t2 = max(ta, tb); + + float z1 = o.z + t1 * d.z; + float z2 = o.z + t2 * d.z; + + if (abs(z1) >= 1.0) + { + float tCap = (sign(z1) - o.z) / d.z; + t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + if (abs(z2) >= 1.0) + { + float tCap = (sign(z2) - o.z) / d.z; + t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + return vec2(t1, t2); +} + +vec2 intersectUnitCircle(Ray ray) { + vec3 o = ray.pos; + vec3 d = ray.dir; + + float t = -o.z / d.z; + vec2 zPlanePos = o.xy + d.xy * t; + float distSqr = dot(zPlanePos, zPlanePos); + + if (distSqr > 1.0) { + return vec2(NO_HIT); + } + + return vec2(t, t); +} + +vec2 intersectInfiniteUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +void intersectShape(Ray ray, inout Intersections ix) +{ + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; + ray.dir *= u_cylinderUvToRenderBoundsScale; + #else + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + vec2 outerIntersect = intersectUnitCircle(ray); + #else + vec2 outerIntersect = intersectUnitCylinder(ray); + #endif + + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + + if (outerIntersect.x == NO_HIT) { + return; + } + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + // When the cylinder is perfectly thin it's necessary to sandwich the + // inner cylinder intersection inside the outer cylinder intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the cylinder to be invisible because it will think the ray + // is still inside the inner (negative) cylinder after exiting the + // outer (positive) cylinder. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) + Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); + vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #endif +} +`;var q2=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersection, setIntersectionPair, INF_HIT, NO_HIT + +/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN +*/ + +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidRenderLongitudeMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + uniform float u_ellipsoidInverseOuterScaleUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + uniform float u_ellipsoidInverseInnerScaleUv; +#endif + +vec2 intersectZPlane(Ray ray) +{ + float o = ray.pos.z; + float d = ray.dir.z; + float t = -o / d; + float s = sign(o); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitSphere(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = -b - det; + float t2 = -b + det; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d, d); + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; + float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; + float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + return vec2(tmin, tmax); +} + +vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + // One interval + if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); + else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); + // Two intervals + else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); +} + +vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec2(NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); + else if (zmin < 0.0) return vec2(tmax, +INF_HIT); + else if (zmax < 0.0) return vec2(-INF_HIT, tmin); + else return vec2(tmin, tmax); +} + +void intersectShape(in Ray ray, inout Intersections ix) { + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); + #else + Ray outerRay = ray; + #endif + + // Outer ellipsoid + vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); + + // Exit early if the outer ellipsoid was missed. + if (outerIntersect.x == NO_HIT) { + return; + } + + // Inner ellipsoid + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + // When the ellipsoid is perfectly thin it's necessary to sandwich the + // inner ellipsoid intersection inside the outer ellipsoid intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the ellipsoid to be invisible because it will think the ray + // is still inside the inner (negative) ellipsoid after exiting the + // outer (positive) ellipsoid. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); + vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); + + if (innerIntersect == vec2(NO_HIT)) { + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); + } else { + // When the ellipsoid is very large and thin it's possible for floating + // point math to cause the ray to intersect the inner ellipsoid before + // the outer ellipsoid. To prevent this from happening, clamp innerIntersect + // to outerIntersect and sandwhich the intersections like described above. + // + // In theory a similar fix is needed for cylinders, however it's more + // complicated to implement because the inner shape is allowed to be + // intersected first. + innerIntersect.x = max(innerIntersect.x, outerIntersect.x); + innerIntersect.y = min(innerIntersect.y, outerIntersect.y); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + } + #endif + + // Flip the ray because the intersection function expects a cone growing towards +Z. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + Ray flippedRay = outerRay; + flippedRay.dir.z *= -1.0; + flippedRay.pos.z *= -1.0; + #endif + + // Bottom cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) + vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) + vec2 bottomConeIntersection = intersectZPlane(flippedRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) + vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); + #endif + + // Top cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) + vec2 topConeIntersection = intersectZPlane(ray); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #endif + + // Wedge + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #endif +} +`;var RC=`// Main intersection function for Voxel scenes. +// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl +// for the definition of intersectShape. The appropriate function is selected +// based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. +// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, +// getFirstIntersection, initializeIntersections, nextIntersection. + +/* Intersection defines (set in Scene/VoxelRenderResources.js) +#define INTERSECTION_COUNT ### +*/ + +RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { + // Do a ray-shape intersection to find the exact starting and ending points. + intersectShape(ray, ix); + + // Exit early if the positive shape was completely missed or behind the ray. + RayShapeIntersection intersection = getFirstIntersection(ix); + if (intersection.entry.w == NO_HIT) { + // Positive shape was completely missed - so exit early. + return intersection; + } + + // Clipping planes + #if defined(CLIPPING_PLANES) + intersectClippingPlanes(ray, ix); + #endif + + // Depth + #if defined(DEPTH_TEST) + intersectDepth(screenCoord, ray, ix); + #endif + + // Find the first intersection that's in front of the ray + #if (INTERSECTION_COUNT > 1) + initializeIntersections(ix); + for (int i = 0; i < INTERSECTION_COUNT; ++i) { + intersection = nextIntersection(ix); + if (intersection.exit.w > 0.0) { + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + break; + } + } + #else + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + #endif + + return intersection; +} +`;var Y2=`/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_HAS_SHAPE_BOUNDS +*/ + +#if defined(BOX_HAS_SHAPE_BOUNDS) + uniform vec3 u_boxUvToShapeUvScale; + uniform vec3 u_boxUvToShapeUvTranslate; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; +#else + return positionUv; +#endif +} + +vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; +#else + return shapeUv; +#endif +} +`;var X2=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED +*/ + +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + uniform vec2 u_cylinderShapeUvAngleMinMax; +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + uniform float u_cylinderShapeUvAngleRangeZeroMid; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] + + // Compute radius + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) + float radius = 1.0; + #else + float radius = length(positionLocal.xy); // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset + #endif + #endif + + // Compute height + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + float height = 1.0; + #else + float height = positionUv.z; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset + #endif + #endif + + // Compute angle + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + float angle = 1.0; + #else + float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. + angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) + angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; + #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; + #endif + + angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset + #endif + #endif + + return vec3(radius, height, angle); +} +`;var K2=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_IS_SPHERE +*/ + +uniform vec3 u_ellipsoidRadiiUv; // [0,1] +#if !defined(ELLIPSOID_IS_SPHERE) + uniform vec3 u_ellipsoidInverseRadiiSquaredUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + uniform float u_ellipsoidInverseHeightDifferenceUv; + uniform vec2 u_ellipseInnerRadiiUv; // [0,1] +#endif + +// robust iterative solution without trig functions +// https://github.com/0xfaded/ellipse_demo/issues/1 +// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse +// Pro: Good when radii.x ~= radii.y +// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse +// Con: Inaccurate with exterior points and thin ellipses +float ellipseDistanceIterative (vec2 pos, vec2 radii) { + vec2 p = abs(pos); + vec2 invRadii = 1.0 / radii; + vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; + vec2 t = vec2(0.70710678118); // sqrt(2) / 2 + vec2 v = radii * t; + + const int iterations = 3; + for (int i = 0; i < iterations; ++i) { + vec2 e = a * pow(t, vec2(3.0)); + vec2 q = normalize(p - e) * length(v - e); + t = normalize((q + e) * invRadii); + v = radii * t; + } + return length(v * sign(pos) - pos) * sign(p.y - v.y); +} + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + // Compute position and normal. + // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). + // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. + vec3 positionLocal = positionUv * 2.0 - 1.0; + #if defined(ELLIPSOID_IS_SPHERE) + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; + vec3 normal = normalize(posEllipsoid); + #else + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; + vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal + #endif + + // Compute longitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + float longitude = 1.0; + #else + float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; + + // Correct the angle when max < min + // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) + longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; + #endif + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) + longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; + #endif + + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; + #endif + #endif + + // Compute latitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) + float latitude = 1.0; + #else + float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; + #endif + #endif + + // Compute height + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + // TODO: This breaks down when minBounds == maxBounds. To fix it, this + // function would have to know if ray is intersecting the front or back of the shape + // and set the shape space position to 1 (front) or 0 (back) accordingly. + float height = 1.0; + #else + #if defined(ELLIPSOID_IS_SPHERE) + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; + #else + float height = length(posEllipsoid); + #endif + #else + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). + // This is an optimization so that math can be done with ellipses instead of ellipsoids. + vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); + float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; + #else + // TODO: this is probably not correct + float height = length(posEllipsoid); #endif -/*--------------------------------------------------------------------------*/ - } #endif -/*--------------------------------------------------------------------------*/ - } #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); -} -`;function PC(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;u(t)||(t=jn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(PC.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});PC.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};PC.prototype.get=function(e){return this._stages[e]};function ept(e){let t=u(e._selected)?e._selected.length:0,n=u(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,u(e._selected)&&u(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):u(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&u(e._combinedSelected)){if(!u(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}PC.prototype.update=function(e,t){this._selectedDirty=ept(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=u(this._selected)?this._selected.length:0,this._parentSelectedLength=u(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};PC.prototype.isDestroyed=function(){return!1};PC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var el=PC;var Fo={};function EH(e){let r=`#define USE_STEP_SIZE -${l0}`,o=new Tr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:zu.LINEAR}),s=new Tr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:zu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let l=o.uniforms,f=s.uniforms;l.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let l=o.uniforms,f=s.uniforms;l.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let l=o.uniforms,f=s.uniforms;l.stepSize=f.stepSize=c}}}),new el({name:e,stages:[o,s],uniforms:a})}Fo.createBlurStage=function(){return EH("czm_blur")};Fo.createDepthOfFieldStage=function(){let e=EH("czm_depth_of_field_blur"),t=new Tr({name:"czm_depth_of_field_composite",fragmentShader:IF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new el({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Fo.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Fo.createEdgeDetectionStage=function(){let e=jn();return new Tr({name:`czm_edge_detection_${e}`,fragmentShader:OF,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Fo.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function tpt(e){if(!u(e))return Fo.createEdgeDetectionStage();let t=new el({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; -`,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); - if (edge${a}.a > 0.0) - { - color = edge${a}; - break; - } -`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; -void main() { - vec4 color = vec4(0.0); - for (int i = 0; i < ${e.length}; i++) - { -${r} } - out_FragColor = color; -} -`,s=new Tr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new el({name:"czm_edge_detection_composite",stages:[t,s]})}Fo.createSilhouetteStage=function(e){let t=tpt(e),n=new Tr({name:"czm_silhouette_color_edges",fragmentShader:UF,uniforms:{silhouetteTexture:t.name}});return new el({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Fo.isSilhouetteSupported=function(e){return e.context.depthTexture};Fo.createBloomStage=function(){let e=new Tr({name:"czm_bloom_contrast_bias",fragmentShader:DF,uniforms:{contrast:128,brightness:-.3}}),t=EH("czm_bloom_blur"),n=new el({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Tr({name:"czm_bloom_generate_composite",fragmentShader:vF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new el({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Fo.createAmbientOcclusionStage=function(){let e=new Tr({name:"czm_ambient_occlusion_generate",fragmentShader:EF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=EH("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new el({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new Tr({name:"czm_ambient_occlusion_composite",fragmentShader:bF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(o){e.uniforms.intensity=o}},bias:{get:function(){return e.uniforms.bias},set:function(o){e.uniforms.bias=o}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(o){e.uniforms.lengthCap=o}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(o){e.uniforms.stepSize=o}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(o){e.uniforms.frustumLength=o}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(o){e.uniforms.randomTexture=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(o){i.uniforms.ambientOcclusionOnly=o}}}),new el({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Fo.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var npt=`#define FXAA_QUALITY_PRESET 39 -${VF} -${RF}`;Fo.createFXAAStage=function(){return new Tr({name:"czm_FXAA",fragmentShader:npt,sampleMode:zu.LINEAR})};Fo.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=TF,new Tr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fo.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=MF,new Tr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fo.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=FF,new Tr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Fo.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=LF,new Tr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Fo.createAutoExposureStage=function(){return new DL};Fo.createBlackAndWhiteStage=function(){return new Tr({name:"czm_black_and_white",fragmentShader:SF,uniforms:{gradations:5}})};Fo.createBrightnessStage=function(){return new Tr({name:"czm_brightness",fragmentShader:wF,uniforms:{brightness:.5}})};Fo.createNightVisionStage=function(){return new Tr({name:"czm_night_vision",fragmentShader:NF})};Fo.createDepthViewStage=function(){return new Tr({name:"czm_depth_view",fragmentShader:PF})};Fo.createLensFlareStage=function(){return new Tr({name:"czm_lens_flare",fragmentShader:BF,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var Xf=Fo;function Y_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function zF(e){for(;u(e.length);)e=e.get(e.length-1);return e.name}function YX(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(u(r)){let a=e.getStageByName(r);o[zF(a)]=!0}let s=i.uniforms;if(u(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let l=0;l<c;++l){let f=s[a[l]];if(typeof f=="string"){let d=e.getStageByName(f);u(d)&&(o[zF(d)]=!0)}}}return i.name}function kF(e,t,n,i,r){if(u(i.enabled)&&!i.enabled||u(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!u(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);u(p.length)?a=kF(e,t,n,p,r):a=YX(e,t,n,p,r),s&&(r=a)}let l,f;if(s)for(l=1;l<c;++l)f=zF(i.get(l)),u(n[f])||(n[f]={}),n[f][o]=!0;else for(l=1;l<c;++l){f=zF(i.get(l));let d=n[f];for(let p=0;p<l;++p)d[zF(i.get(p))]=!0}return a}function ipt(e,t){let n={};if(u(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=kF(e,t,n,i,void 0);a=kF(e,t,n,r,a),a=YX(e,t,n,o,a),a=kF(e,t,n,e,a),YX(e,t,n,s,a)}else kF(e,t,n,e,void 0);return n}function rpt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,l=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(l,d.clearColor))continue;let h=d.stages,A=h.length,x=!1;for(let C=0;C<A;++C)if(n[h[C]]){x=!0;break}if(!x)break}return u(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:l,stages:[t],buffer:new mi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function opt(e,t){let n=ipt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=rpt(e,i,n[i]))}function XX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function spt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,l=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(l,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),l=d,f=d),a.buffer.update(t,l,f),a.clear=new ri({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}Y_.prototype.updateDependencies=function(){this._updateDependencies=!0};Y_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=u(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=u(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=u(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=u(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!u(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(XX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&opt(this,e);let c=e.drawingBufferWidth,l=e.drawingBufferHeight,f=this._width!==c||this._height!==l;!n&&!f||(this._width=c,this._height=l,this._updateDependencies=!1,XX(this),spt(this,e))};Y_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Y_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Y_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Y_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(u(t))return t.buffer.framebuffer};Y_.prototype.isDestroyed=function(){return!1};Y_.prototype.destroy=function(){return XX(this),ue(this)};var OC=Y_;var HF={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===HF.REINHARD||e===HF.MODIFIED_REINHARD||e===HF.FILMIC||e===HF.ACES}},u0=Object.freeze(HF);var KX=[];function tl(){let e=Xf.createFXAAStage(),t=Xf.createAmbientOcclusionStage(),n=Xf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Xf.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=u0.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new OC(this),o={},s=KX;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let l=c.length;if(u(l))for(let f=0;f<l;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(tl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return JX(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(u(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!u(t))continue;if(u(t.selected))return!0;let n=t.length;if(u(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;u(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case u0.REINHARD:n=Xf.createReinhardTonemappingStage(t);break;case u0.MODIFIED_REINHARD:n=Xf.createModifiedReinhardTonemappingStage(t);break;case u0.FILMIC:n=Xf.createFilmicTonemappingStage(t);break;default:n=Xf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,u(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function JX(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._stages=t}tl.prototype.add=function(e){let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(u(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};tl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(u(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};tl.prototype.contains=function(e){return u(e)&&u(e._index)&&e._textureCache===this._textureCache};tl.prototype.get=function(e){return JX(this),this._stages[e]};tl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};tl.prototype.getStageByName=function(e){return this._stageNames[e]};tl.prototype.update=function(e,t,n){JX(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages,s=r.length=o.length,a,c,l=0;for(a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&(r[l++]=c);r.length=l;let f=l!==i.length;if(!f){for(a=0;a<l;++a)if(r[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,A=this._fxaa;h.enabled=n;let x=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),T=h.enabled&&h._isSupported(e),E=A.enabled&&A._isSupported(e);if((f||this._textureCacheDirty||x!==this._aoEnabled||C!==this._bloomEnabled||T!==this._tonemappingEnabled||E!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=x,this._bloomEnabled=C,this._tonemappingEnabled=T,this._fxaaEnabled=E,this._textureCacheDirty=!1),u(this._randomTexture)&&!x&&(this._randomTexture.destroy(),this._randomTexture=void 0),!u(this._randomTexture)&&x){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:at.RGB,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new fn({wrapS:wn.REPEAT,wrapT:wn.REPEAT,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})})}for(this._textureCache.update(e),A.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=o.length,a=0;a<s;++a)o[a].update(e,t);for(l=0,a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&l++;f=l!==r.length,f&&this.update(e,t,n)};tl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function MC(e){for(;u(e.length);)e=e.get(e.length-1);return e.outputTexture}tl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(u(t))return MC(t)};function Hh(e,t,n,i,r){if(u(e.execute)){e.execute(t,n,i,r);return}let o=e.length,s;if(e.inputPreviousStageTexture)for(Hh(e.get(0),t,n,i,r),s=1;s<o;++s)Hh(e.get(s),t,MC(e.get(s-1)),i,r);else for(s=0;s<o;++s)Hh(e.get(s),t,n,i,r)}tl.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,l=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),A=s.enabled&&s._isSupported(e);if(!A&&!d&&!p&&!h&&o===0)return;let x=t;d&&a.ready&&(Hh(a,e,x,n,i),x=MC(a)),p&&c.ready&&(Hh(c,e,x,n,i),x=MC(c)),g&&l.ready&&Hh(l,e,x,n,i),h&&f.ready&&(Hh(f,e,x,n,i),x=MC(f));let C=x;if(o>0){Hh(r[0],e,x,n,i);for(let T=1;T<o;++T)Hh(r[T],e,MC(r[T-1]),n,i);C=MC(r[o-1])}A&&s.ready&&Hh(s,e,C,n,i)};tl.prototype.copy=function(e,t){if(!u(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var GF=tl;function Hu(){fe.throwInstantiationError()}Hu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Hu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Hu.prototype.update=fe.throwInstantiationError;Hu.prototype.beginUpdate=fe.throwInstantiationError;Hu.prototype.endUpdate=fe.throwInstantiationError;Hu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Hu.prototype.loadTile=fe.throwInstantiationError;Hu.prototype.computeTileVisibility=fe.throwInstantiationError;Hu.prototype.showTileThisFrame=fe.throwInstantiationError;Hu.prototype.computeDistanceToTile=fe.throwInstantiationError;Hu.prototype.isDestroyed=fe.throwInstantiationError;Hu.prototype.destroy=fe.throwInstantiationError;var ZX=Hu;function RC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}RC.prototype.completeMorph=function(){u(this._completeMorph)&&this._completeMorph()};RC.prototype.morphTo2D=function(e,t){u(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof tn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?Vpt(this,e):qpt(this,e,t),e===0&&u(this._completeMorph)&&this._completeMorph())};var apt=new m,cpt=new m,lpt=new m,upt=new m,fpt=new m,dpt=new m,mpt=new m,hpt=new he,ppt=new N,_pt=new wi,gpt=new tn,ypt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};RC.prototype.morphToColumbusView=function(e,t){u(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(N.IDENTITY);let i=apt,r=cpt,o=lpt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,r),r),m.cross(m.UNIT_X,r,o);else{let l=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(l.position,i),i.z=l.frustum.right-l.frustum.left,m.negate(m.UNIT_Z,r),m.clone(m.UNIT_Y,o);else{m.clone(l.positionWC,i),m.clone(l.directionWC,r),m.clone(l.upWC,o);let f=t.scaleToGeodeticSurface(i,mpt),d=Mt.eastNorthUpToFixedFrame(f,t,ppt);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,hpt),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=gpt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=_pt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=ypt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=Xpt(a);WF(this,c),this._previousMode===ne.SCENE2D?Ypt(this,e,a,c):(a.position2D=N.multiplyByPoint(dr.TRANSFORM_2D,i,upt),a.direction2D=N.multiplyByPointAsVector(dr.TRANSFORM_2D,r,fpt),a.up2D=N.multiplyByPointAsVector(dr.TRANSFORM_2D,o,dpt),n._mode=ne.MORPHING,dAe(this,e,a,c)),e===0&&u(this._completeMorph)&&this._completeMorph()};var eK={position:new m,direction:new m,up:new m,frustum:void 0},iAe=new wi;RC.prototype.morphTo3D=function(e,t){u(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===ne.SCENE2D)Ipt(this,e,t);else{let i;e>0?(i=eK,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=rAe(this,t);let r,o=n.camera;o.frustum instanceof tn?r=o.frustum.clone():(r=iAe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=hAe(i);WF(this,s),$X(this,e,i,s)}e===0&&u(this._completeMorph)&&this._completeMorph()}};RC.prototype.isDestroyed=function(){return!1};RC.prototype.destroy=function(){return bH(this),ue(this)};function WF(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ru(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function bH(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Apt=new he,xpt=new m,Cpt=new N;function rAe(e,t){let n=e._scene,i=n.camera,r=eK,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,Apt);t.cartographicToCartesian(c,o);let l=t.scaleToGeodeticSurface(o,xpt),f=Mt.eastNorthUpToFixedFrame(l,t,Cpt);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var Tpt=new m,Ept=new m,bpt=new m,Spt=new m,vpt=new m,wpt=new m;function $X(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(o.position,Tpt),a=m.clone(o.direction,Ept),c=m.clone(o.up,bpt),l=N.multiplyByPoint(dr.TRANSFORM_2D_INVERSE,n.position,Spt),f=N.multiplyByPointAsVector(dr.TRANSFORM_2D_INVERSE,n.direction,vpt),d=N.multiplyByPointAsVector(dr.TRANSFORM_2D_INVERSE,n.up,wpt);function p(h){Kf(s,l,h.time,o.position),Kf(a,f,h.time,o.direction),Kf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){mAe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var Dpt=new tn,oAe=new m,sAe=new m,aAe=new m,tK=new m,cAe=new m,lAe=new m;function Ipt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=eK,m.fromDegrees(0,0,5*n.maximumRadius,n,o.position),m.negate(o.position,o.direction),m.normalize(o.direction,o.direction),m.clone(m.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=rAe(e,n));let s;e._morphToOrthographic?(s=Dpt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=iAe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=hAe(o);WF(e,a);let c;e._morphToOrthographic?c=function(){$X(e,t,o,a)}:c=function(){fAe(e,t,o,function(){$X(e,t,o,a)})},t>0?(i._mode=ne.SCENE2D,r.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,tK),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Kf(e,t,n,i){return m.lerp(e,t,n,i)}function uAe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof tn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,l=n.position.z*Math.tan(a*.5);s.frustum.far=l/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=l/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var Ppt=new m,Opt=new m,Mpt=new m,QX=new m,Rpt=new m,Bpt=new m,Lpt=new bo,Npt=new Dn,Fpt=new m,Upt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Vpt(e,t){t*=.5;let n=e._scene,i=n.camera,r=m.clone(i.position,Ppt),o=m.clone(i.direction,Opt),s=m.clone(i.up,Mpt),a=m.negate(m.UNIT_Z,Rpt),c=m.clone(m.UNIT_Y,Bpt),l=QX;if(t>0)m.clone(m.ZERO,QX),l.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(r,QX);let x=Npt;N.multiplyByPoint(dr.TRANSFORM_2D,r,x.origin),N.multiplyByPointAsVector(dr.TRANSFORM_2D,o,x.direction);let C=n.globe;if(u(C)){let T=C.pickWorldCoordinates(x,n,!0,Fpt);u(T)&&(N.multiplyByPoint(dr.TRANSFORM_2D_INVERSE,T,l),l.z+=m.distance(r,l))}}let f=Lpt;f.right=l.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=Upt;d.position=l,d.direction=a,d.up=c,d.frustum=f;let p=pAe(d);WF(e,p);function g(x){Kf(r,l,x.time,i.position),Kf(o,a,x.time,i.direction),Kf(s,c,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(x,C){x.position.z=C}let A=n.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){uAe(e,t,d,h,p)}});e._currentTweens.push(A)}var nAe=new he,kpt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new bo},zpt={position:new m,direction:new m,up:new m,frustum:void 0},Hpt=new m,Gpt=new Dn,Wpt=new N,jpt=new m;function qpt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=kpt;if(t>0)m.clone(m.ZERO,o.position),o.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,nAe),i.mapProjection.project(nAe,o.position),m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);let d=Gpt;m.clone(o.position2D,d.origin);let p=m.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,jpt),h=Mt.eastNorthUpToFixedFrame(g,n,Wpt);N.inverseTransformation(h,h),N.multiplyByPointAsVector(h,p,p),N.multiplyByPointAsVector(dr.TRANSFORM_2D,p,p);let A=i.globe;if(u(A)){let x=A.pickWorldCoordinates(d,i,!0,Hpt);if(u(x)){let C=m.distance(o.position2D,x);x.x+=C,m.clone(x,o.position2D)}}}function s(d,p){d.position.x=p}N.multiplyByPoint(dr.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(dr.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(dr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=zpt;N.multiplyByPoint(dr.TRANSFORM_2D_INVERSE,o.position2D,c.position),m.clone(o.direction,c.direction),m.clone(o.up,c.up),c.frustum=a;let l=pAe(c);WF(e,l);function f(){uAe(e,t,o,s,l)}dAe(e,t,o,f)}function fAe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,l=s*Math.tan(a*.5);o.frustum.far=l/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=l/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Ypt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(n.position,tK),a=m.clone(n.direction,cAe),c=m.clone(n.up,lAe);r._mode=ne.MORPHING;function l(){o.frustum=n.frustum.clone();let f=m.clone(o.position,oAe),d=m.clone(o.direction,sAe),p=m.clone(o.up,aAe);f.z=s.z;function g(A){Kf(f,s,A.time,o.position),Kf(d,a,A.time,o.direction),Kf(p,c,A.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let h=r.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?l():fAe(e,0,n,l)}function dAe(e,t,n,i){let r=e._scene,o=r.camera,s=m.clone(o.position,oAe),a=m.clone(o.direction,sAe),c=m.clone(o.up,aAe),l=m.clone(n.position2D,tK),f=m.clone(n.direction2D,cAe),d=m.clone(n.up2D,lAe);function p(h){Kf(s,l,h.time,o.position),Kf(a,f,h.time,o.direction),Kf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Lo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){mAe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function mAe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Lo.QUARTIC_OUT};u(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function hAe(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),bH(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=u(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,o)}}function pAe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),bH(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=u(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,r)}}function Xpt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),bH(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=u(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,o)}}var jF=RC;var _Ae=Ki(Oj(),1);function SH(e,t,n,i,r,o,s,a,c,l){this._tweens=e,this._tweenjs=t,this._startObject=We(n),this._stopObject=We(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=l,this.needsStart=!0}Object.defineProperties(SH.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});SH.prototype.cancelTween=function(){this._tweens.remove(this)};function Sm(){this._tweens=[]}Object.defineProperties(Sm.prototype,{length:{get:function(){return this._tweens.length}}});Sm.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return u(e.complete)&&e.complete(),new SH(this);let t=e.duration/Qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Qn.SECONDS_PER_MILLISECOND,r=y(e.easingFunction,Lo.LINEAR_NONE),o=e.startObject,s=new _Ae.Tween(o);s.to(We(e.stopObject),t),s.delay(i),s.easing(r),u(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new SH(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Sm.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Sm.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&u(t.uniforms[r])&&u(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Sm.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Sm.prototype.remove=function(e){if(!u(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),u(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Sm.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),u(n.cancel)&&n.cancel()}e.length=0};Sm.prototype.contains=function(e){return u(e)&&this._tweens.indexOf(e)!==-1};Sm.prototype.get=function(e){return this._tweens[e]};Sm.prototype.update=function(e){let t=this._tweens,n=0;for(e=u(e)?e/Qn.SECONDS_PER_MILLISECOND:Ai();n<t.length;){let i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var BC=Sm;function YF(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Li.LEFT_DRAG,this.zoomEventTypes=[Li.RIGHT_DRAG,Li.WHEEL,Li.PINCH],this.rotateEventTypes=Li.LEFT_DRAG,this.tiltEventTypes=[Li.MIDDLE_DRAG,Li.PINCH,{eventType:Li.LEFT_DRAG,modifier:la.CTRL},{eventType:Li.RIGHT_DRAG,modifier:la.CTRL}],this.lookEventTypes={eventType:Li.LEFT_DRAG,modifier:la.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new $L(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new BC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Kpt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Jpt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Zpt=.4;function Qpt(e,t,n,i,r,o,s){let a=o[s];u(a)||(a=o[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),l=e.getButtonReleaseTime(t,n),f=c&&l&&(l.getTime()-c.getTime())/1e3,p=l&&(new Date().getTime()-l.getTime())/1e3;if(c&&l&&f<Zpt){let g=Kpt(p,i),h=e.getLastMovement(t,n);if(!u(h)||Jpt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let A=e.getStartMousePosition(t,n);r(o,A,a)}}}function $pt(e,t){if(u(t)){let n=e[t];u(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(u(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],u(n)&&(n.inertiaEnabled=!1)}}}var gAe=[];function nl(e,t,n,i,r,o){if(!u(n))return;let s=e._aggregator;Array.isArray(n)||(gAe[0]=n,n=gAe);let a=n.length;for(let c=0;c<a;++c){let l=n[c],f=u(l.eventType)?l.eventType:l,d=l.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),$pt(e,o)):r<1&&Qpt(s,f,d,r,i,e,o))}}var vH=new Dn,e_t=new m,t_t=new H,n_t=new m,i_t=new H,r_t=new m,o_t=new m,s_t=new m,a_t=new m,c_t=new m,l_t=new m,u_t=new m,f_t=new m,d_t=new m,m_t=new m,h_t=new m,p_t=new m,__t=new m,g_t=new m,y_t=new m,LC=new m,yAe=new m,AAe=new m,nK={orientation:new Ha};function uK(e,t,n,i,r,o){let s=1;u(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,l=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-l,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!u(e._globe)){if(h>0&&Math.abs(r-l)<1||h<0&&Math.abs(r-f)<1)return;r-h<l?h=r-l-1:r-h>f&&(h=r-f)}let A=e._scene,x=A.camera,C=A.mode,T=nK.orientation;if(T.heading=x.heading,T.pitch=x.pitch,T.roll=x.roll,x.frustum instanceof tn){Math.abs(h)>0&&(x.zoomIn(h),x._adjustOrthographicFrustum(!0));return}let E=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,w=e._rotatingZoom,D;if(E||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),u(e._globe)&&(C===ne.SCENE2D?(D=x.getPickRay(t,vH).origin,D=m.fromElements(D.y,D.z,D.x)):D=f0(e,t,e_t)),u(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,w=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(h);return}let M=C===ne.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(w=!0),!E||w){if(C===ne.SCENE2D){let O=e._zoomWorldPosition,B=x.position;if(!m.equals(O,B)&&x.positionCartographic.height<e._maxCoord.x*2){let L=x.position.x,_=m.subtract(O,B,n_t);m.normalize(_,_);let b=m.distance(O,B)*h/(x.getMagnitude()*.5);x.move(_,b*.5),(x.position.x<0&&L>0||x.position.x>0&&L<0)&&(D=x.getPickRay(t,vH).origin,D=m.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let O=m.normalize(x.position,c_t);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,O))<.6)M=!0;else{let B=A.canvas,L=i_t;L.x=B.clientWidth/2,L.y=B.clientHeight/2;let _=f0(e,L,r_t);if(!u(_))M=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,O)>=-.5)M=!0;else{let b=u_t;m.clone(x.position,b);let v=e._zoomWorldPosition,I=l_t;if(I=m.normalize(v,I),m.dot(I,O)<0)return;let R=y_t,F=m_t;m.clone(x.direction,F),m.add(b,m.multiplyByScalar(F,1e3,LC),R);let k=h_t,V=p_t;m.subtract(v,b,k),m.normalize(k,V);let G=m.dot(O,V);if(G>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-G),Y=m.magnitude(b),W=m.magnitude(v),J=Y-h,j=m.magnitude(k),K=Math.asin(P.clamp(j/W*Math.sin(U),-1,1)),Z=Math.asin(P.clamp(J/W*Math.sin(U),-1,1)),me=K-Z+U,ye=f_t;m.normalize(b,ye);let se=d_t;se=m.cross(V,ye,se),se=m.normalize(se,se),m.normalize(m.cross(ye,se,LC),F),m.multiplyByScalar(m.normalize(R,LC),m.magnitude(R)-h,R),m.normalize(b,b),m.multiplyByScalar(b,J,b);let pe=__t;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,yAe),m.multiplyByScalar(F,Math.sin(me),AAe),LC),J,pe),m.add(b,pe,b),m.normalize(R,ye),m.normalize(m.cross(ye,se,LC),F);let Ae=g_t;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,yAe),m.multiplyByScalar(F,Math.sin(me),AAe),LC),m.magnitude(R),Ae),m.add(R,Ae,R),m.clone(b,x.position),m.normalize(m.subtract(R,b,LC),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(nK);return}else{let b=m.normalize(_,o_t),v=m.normalize(e._zoomWorldPosition,s_t),I=m.dot(v,b);if(I>0&&I<1){let R=P.acosClamped(I),F=m.cross(v,b,a_t),k=Math.abs(R)>P.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-h,V=h/k;x.rotate(F,R*V)}}}}e._rotatingZoom=!M}if(!E&&M||S){let O,B=$i.wgs84ToWindowCoordinates(A,e._zoomWorldPosition,t_t);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&u(B)?O=x.getPickRay(B,vH):O=x.getPickRay(t,vH);let L=O.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(L.y,L.z,L.x,L),x.move(L,h),e._zoomingOnVector=!0}else x.zoomIn(h);e._cameraUnderground||x.setView(nK)}var A_t=new Dn,x_t=new Dn,C_t=new m;function T_t(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,A_t).origin,s=r.getPickRay(n.endPosition,x_t).origin;o=m.fromElements(o.y,o.z,o.x,o),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(o,s,C_t),c=m.magnitude(a);c>0&&(m.normalize(a,a),r.move(a,c))}function xAe(e,t,n){u(n.distance)&&(n=n.distance);let r=e._scene.camera;uK(e,t,n,e._zoomFactor,r.getMagnitude())}var E_t=new H,b_t=new H;function CAe(e,t,n){if(u(n.angleAndHeight)){S_t(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=E_t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let l=b_t;l.x=2/s*n.endPosition.x-1,l.y=2/a*(a-n.endPosition.y)-1,l=H.normalize(l,l);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(l.x);l.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function S_t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function v_t(e){let t=e._scene.mapMode2D===Ul.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(nl(e,e.enableTranslate,e.translateEventTypes,T_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),nl(e,e.enableZoom,e.zoomEventTypes,xAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&nl(e,e.enableRotate,e.tiltEventTypes,CAe,e.inertiaSpin,"_lastInertiaTiltMovement")):(nl(e,e.enableZoom,e.zoomEventTypes,xAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&nl(e,e.enableRotate,e.translateEventTypes,CAe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var wAe=new Dn,w_t=new m,D_t=new m;function f0(e,t,n){let i=e._scene,r=e._globe,o=i.camera;if(!u(r))return;let s=!e._cameraUnderground,a;i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,w_t));let c=o.getPickRay(t,wAe),l=r.pickWorldCoordinates(c,i,s,D_t),f=u(a)?m.distance(a,o.positionWC):Number.POSITIVE_INFINITY,d=u(l)?m.distance(l,o.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(a,n):m.clone(l,n)}var I_t=new he;function MH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,I_t);u(c)&&(o=c.height)}else o=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-o)}var P_t=new m;function DAe(e,t){let n=t.origin,i=t.direction,r=MH(e),o=m.normalize(n,P_t),s=Math.abs(m.dot(o,i));return s=Math.max(s,.5)*2,r*s}function IAe(e,t,n,i){let r=m.distance(t.origin,n),o=MH(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),Dn.getPoint(t,r,i)}function PAe(e,t,n,i){let r;return u(n)?(r=m.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=MH(e))):r=MH(e),Dn.getPoint(t,r,i)}var O_t=new H;function OAe(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,O_t),r=e._strafeEndMousePosition;H.add(r,i,r),t.endPosition=r,fK(e,t,e._strafeStartPosition),t.endPosition=n}var TAe=new Dn,M_t=new Dn,iK=new m,R_t=new m,B_t=new m,L_t=new m,N_t=new ln(m.UNIT_X,0),F_t=new H,U_t=new H;function V_t(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Wu(e,t,n);return}if(e._strafing){OAe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=H.clone(n.startPosition,F_t),a=H.clone(n.endPosition,U_t),c=r.getPickRay(s,TAe),l=m.clone(m.ZERO,L_t),f=m.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=f0(e,s,iK),u(d)&&(l.x=d.x)),o||l.x>r.position.z&&u(d)){let E=d;o&&(E=PAe(e,c,d,iK)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(E,e._strafeStartPosition),e._strafing=!0,fK(e,n,e._strafeStartPosition);return}let p=ln.fromPointNormal(l,f,N_t);c=r.getPickRay(s,TAe);let g=Qi.rayPlane(c,p,iK),h=r.getPickRay(a,M_t),A=Qi.rayPlane(h,p,R_t);if(!u(g)||!u(A)){e._looking=!0,Wu(e,t,n),H.clone(t,e._translateMousePosition);return}let x=m.subtract(g,A,B_t),C=x.x;x.x=x.y,x.y=x.z,x.z=C;let T=m.magnitude(x);T>P.EPSILON6&&(m.normalize(x,x),r.move(x,T))}var MAe=new H,DH=new Dn,IH=new m,k_t=new m,RAe=new N,z_t=new N,H_t=new m,G_t=new ln(m.UNIT_X,0),rK=new m,aK=new he,BAe=new N,W_t=new Le,j_t=new Q,PH=new m;function q_t(e,t,n){if(u(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Wu(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Y_t(e,t,n)):X_t(e,t,n)}function Y_t(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=MAe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,DH),c=m.UNIT_X,l=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-m.dot(c,l)/p),!u(d)||d<=0){e._looking=!0,Wu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,IH);m.add(l,g,g);let h=i.mapProjection,A=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let x=h.unproject(g,aK);A.cartographicToCartesian(x,g);let C=Mt.eastNorthUpToFixedFrame(g,A,RAe),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=N.clone(r.transform,BAe);r._setTransform(C),Gu(e,t,n,m.UNIT_Z),r._setTransform(S),e._globe=T,e._ellipsoid=E;let w=E.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w}function X_t(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,IH);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=f0(e,t,IH)),!u(s)){a=r.getPickRay(t,DH);let _=a.origin,b=a.direction,v,I=m.dot(c,b);if(Math.abs(I)>P.EPSILON6&&(v=-m.dot(c,_)/I),!u(v)||v<=0){e._looking=!0,Wu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(b,v,IH),m.add(_,s,s)}o&&(u(a)||(a=r.getPickRay(t,DH)),IAe(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let l=i.canvas,f=MAe;f.x=l.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,DH);let d=m.clone(m.ZERO,H_t);d.x=s.x;let p=ln.fromPointNormal(d,c,G_t),g=Qi.rayPlane(a,p,k_t),h=r._projection,A=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=h.unproject(s,aK);A.cartographicToCartesian(x,s);let C=Mt.eastNorthUpToFixedFrame(s,A,RAe),T;u(g)?(m.fromElements(g.y,g.z,g.x,g),x=h.unproject(g,aK),A.cartographicToCartesian(x,g),T=Mt.eastNorthUpToFixedFrame(g,A,z_t)):T=C;let E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=N.clone(r.transform,BAe);r._setTransform(C);let M=m.cross(m.UNIT_Z,m.normalize(r.position,rK),rK),O=m.dot(r.right,M);if(Gu(e,t,n,w,!1,!0),r._setTransform(T),O<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(w=void 0);let b=r.constrainedAxis;r.constrainedAxis=void 0,Gu(e,t,n,w,!0,!1),r.constrainedAxis=b}else Gu(e,t,n,w,!0,!1);if(u(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,PH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(D),e._globe=E,e._ellipsoid=S;let B=S.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=m.clone(r.positionWC,rK);if(e.enableCollisionDetection&&hK(e),!m.equals(r.positionWC,L)){r._setTransform(T),r.worldToCameraCoordinatesPoint(L,L);let _=m.magnitudeSquared(L);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let b=m.angleBetween(L,r.position),v=m.cross(L,r.position,L);m.normalize(v,v);let I=Le.fromAxisAngle(v,b,W_t),R=Q.fromQuaternion(I,j_t);Q.multiplyByVector(R,r.direction,r.direction),Q.multiplyByVector(R,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(D)}}var LAe=new H,NAe=new Dn,FAe=new m;function K_t(e,t,n){u(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=LAe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,NAe),l=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=f0(e,a,FAe));let g;if(u(p)&&(g=m.distance(l,p)),s){let h=DAe(e,c,d);u(g)?g=Math.min(g,h):g=h}if(!u(g)){let h=m.UNIT_X;g=-m.dot(h,l)/m.dot(h,f)}uK(e,t,n,e._zoomFactor,g)}function J_t(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))nl(e,e.enableRotate,e.rotateEventTypes,Gu,e.inertiaSpin,"_lastInertiaSpinMovement"),nl(e,e.enableZoom,e.zoomEventTypes,UAe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),nl(e,e.enableTilt,e.tiltEventTypes,q_t,e.inertiaSpin,"_lastInertiaTiltMovement"),nl(e,e.enableTranslate,e.translateEventTypes,V_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),nl(e,e.enableZoom,e.zoomEventTypes,K_t,e.inertiaZoom,"_lastInertiaZoomMovement"),nl(e,e.enableLook,e.lookEventTypes,Wu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);u(r)&&(e._tween=i.add(r))}i.update()}}var Z_t=new Dn,Q_t=new ln(m.UNIT_X,0),$_t=new m,egt=new m,tgt=new m;function fK(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,Z_t),s=m.clone(r.direction,egt);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=ln.fromPointNormal(n,s,Q_t),c=Qi.rayPlane(o,a,$_t);u(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(r.position,s,r.position))}var EAe=new m,ngt=new he,cK=new m,lK=new re,igt=new m,rgt=new m;function ogt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){Gu(e,t,n);return}let a,c,l=s.geodeticSurfaceNormal(r.position,igt);if(H.equals(t,e._rotateMousePosition)){if(e._looking)Wu(e,t,n,l);else if(e._rotating)Gu(e,t,n);else if(e._strafing)OAe(e,n);else{if(m.magnitude(r.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=cK,c.x=c.y=c.z=a,s=re.fromCartesian3(c,lK),sK(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,ngt).height,d=e._globe;if(u(d)&&f<e._minimumPickingTerrainHeight){let p=f0(e,n.startPosition,tgt);if(u(p)){let g=!1,h=r.getPickRay(n.startPosition,wAe);if(o)g=!0,PAe(e,h,p,p);else{let A=s.geodeticSurfaceNormal(p,rgt);Math.abs(m.dot(h.direction,A))<.05?g=!0:g=m.magnitude(r.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,fK(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=cK,c.x=c.y=c.z=a,s=re.fromCartesian3(c,lK),sK(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Wu(e,t,n,l)}else u(r.pickEllipsoid(n.startPosition,e._ellipsoid,EAe))?(sK(e,t,n,e._ellipsoid),m.clone(EAe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Gu(e,t,n)):(e._looking=!0,Wu(e,t,n,l));H.clone(t,e._rotateMousePosition)}function Gu(e,t,n,i,r,o){r=y(r,!1),o=y(o,!1);let s=e._scene,a=s.camera,c=s.canvas,l=a.constrainedAxis;u(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,A=d*g*Math.PI;r||a.rotateRight(h),o||a.rotateUp(A),a.constrainedAxis=l}var sgt=oe.clone(oe.UNIT_W),agt=oe.clone(oe.UNIT_W),wH=new m,oK=new m,cgt=new m,lgt=new m,ugt=new H,fgt=new H;function sK(e,t,n,i){let o=e._scene.camera,s=H.clone(n.startPosition,ugt),a=H.clone(n.endPosition,fgt),c=o.pickEllipsoid(s,i,sgt),l=o.pickEllipsoid(a,i,agt);if(!u(c)||!u(l)){e._rotating=!0,Gu(e,t,n);return}if(c=o.worldToCameraCoordinates(c,c),l=o.worldToCameraCoordinates(l,l),u(o.constrainedAxis)){let f=o.constrainedAxis,d=m.mostOrthogonalAxis(f,wH);m.cross(d,f,d),m.normalize(d,d);let p=m.cross(f,d,oK),g=m.magnitude(c),h=m.dot(f,c),A=Math.acos(h/g),x=m.multiplyByScalar(f,h,cgt);m.subtract(c,x,x),m.normalize(x,x);let C=m.magnitude(l),T=m.dot(f,l),E=Math.acos(T/C),S=m.multiplyByScalar(f,T,lgt);m.subtract(l,S,S),m.normalize(S,S);let w=Math.acos(m.dot(x,d));m.dot(x,p)<0&&(w=P.TWO_PI-w);let D=Math.acos(m.dot(S,d));m.dot(S,p)<0&&(D=P.TWO_PI-D);let M=w-D,O;m.equalsEpsilon(f,o.position,P.EPSILON2)?O=o.right:O=m.cross(f,o.position,wH);let B=m.cross(f,O,wH),L=m.dot(B,m.subtract(c,f,oK)),_=m.dot(B,m.subtract(l,f,oK)),b;L>0&&_>0?b=E-A:L>0&&_<=0?m.dot(o.position,f)>0?b=-A-E:b=A+E:b=A-E,o.rotateRight(M),o.rotateUp(b)}else{m.normalize(c,c),m.normalize(l,l);let f=m.dot(c,l),d=m.cross(c,l,wH);if(f<1&&!m.equalsEpsilon(d,m.ZERO,P.EPSILON14)){let p=Math.acos(f);o.rotate(d,p)}}}var dgt=new m,mgt=new he,bAe=0;function UAe(e,t,n){u(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,l;c?l=t:(l=LAe,l.x=a.clientWidth/2,l.y=a.clientHeight/2);let f=s.getPickRay(l,NAe),d,p=r.cartesianToCartographic(s.position,mgt).height,g=Math.abs(bAe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=f0(e,l,FAe));let A;if(u(d)&&(A=m.distance(f.origin,d),bAe=A),c){let C=DAe(e,f,p);u(A)?A=Math.min(A,C):A=C}u(A)||(A=p);let x=m.normalize(s.position,dgt);uK(e,t,n,e._zoomFactor,A,m.dot(x,s.direction))}var VAe=new H,OH=new Dn,qF=new m,hgt=new m,kAe=new N,pgt=new N,zAe=new N,_gt=new Le,ggt=new Q,dK=new he,mK=new m;function ygt(e,t,n){let r=e._scene.camera;if(!N.equals(r.transform,N.IDENTITY))return;if(u(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,mK);Wu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,dK);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,xgt(e,t,n)):Cgt(e,t,n)}var Agt=new he;function xgt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,Agt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,l=VAe;l.x=c.clientWidth/2,l.y=c.clientHeight/2;let f=o.getPickRay(l,OH),d,p=Qi.rayEllipsoid(f,i);if(u(p))d=Dn.getPoint(f,p.start,qF);else if(a>e._minimumTrackBallHeight){let T=Qi.grazingAltitudeLocation(f,i);if(!u(T))return;let E=i.cartesianToCartographic(T,dK);E.height=0,d=i.cartographicToCartesian(E,qF)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(o.position,mK);Wu(e,t,n,T),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,kAe),h=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=N.clone(o.transform,zAe);o._setTransform(g),Gu(e,t,n,m.UNIT_Z),o._setTransform(x),e._globe=h,e._ellipsoid=A;let C=A.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Cgt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,l;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,qF);else{if(a=f0(e,t,qF),!u(a)){if(c=o.getPickRay(t,OH),l=Qi.rayEllipsoid(c,i),!u(l)){if(i.cartesianToCartographic(o.position,dK).height<=e._minimumTrackBallHeight){e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(o.position,mK);Wu(e,t,n,b),H.clone(t,e._tiltCenterMousePosition)}return}a=Dn.getPoint(c,l.start,qF)}s&&(u(c)||(c=o.getPickRay(t,OH)),IAe(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=r.canvas,d=VAe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,OH);let p=m.magnitude(a),g=m.fromElements(p,p,p,cK),h=re.fromCartesian3(g,lK);if(l=Qi.rayEllipsoid(c,h),!u(l))return;let A=m.magnitude(c.origin)>p?l.start:l.stop,x=Dn.getPoint(c,A,hgt),C=Mt.eastNorthUpToFixedFrame(a,i,kAe),T=Mt.eastNorthUpToFixedFrame(x,h,pgt),E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=N.clone(o.transform,zAe);o._setTransform(T);let M=m.cross(x,o.positionWC,PH);if(m.dot(o.rightWC,M)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(w=void 0);let b=o.constrainedAxis;o.constrainedAxis=void 0,Gu(e,t,n,w,!0,!1),o.constrainedAxis=b}else Gu(e,t,n,w,!0,!1);if(o._setTransform(C),Gu(e,t,n,w,!1,!0),u(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,PH);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(D),e._globe=E,e._ellipsoid=S;let B=S.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=m.clone(o.positionWC,PH);if(e.enableCollisionDetection&&hK(e),!m.equals(o.positionWC,L)){o._setTransform(T),o.worldToCameraCoordinatesPoint(L,L);let _=m.magnitudeSquared(L);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let b=m.angleBetween(L,o.position),v=m.cross(L,o.position,L);m.normalize(v,v);let I=Le.fromAxisAngle(v,b,_gt),R=Q.fromQuaternion(I,ggt);Q.multiplyByVector(R,o.direction,o.direction),Q.multiplyByVector(R,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(D)}}var Tgt=new H,Egt=new H,SAe=new Dn,vAe=new Dn,bgt=new m,Sgt=new m;function Wu(e,t,n,i){let o=e._scene.camera,s=Tgt;s.x=n.startPosition.x,s.y=0;let a=Egt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,SAe),l=o.getPickRay(a,vAe),f=0,d,p;o.frustum instanceof tn?(d=c.origin,p=l.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=l.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(u(i)?o.look(i,-f):u(h)?o.look(h,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,SAe),l=o.getPickRay(a,vAe),f=0,o.frustum instanceof tn?(d=c.origin,p=l.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=l.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),u(i)){let A=o.direction,x=m.negate(i,bgt),C=m.equalsEpsilon(A,i,P.EPSILON2),T=m.equalsEpsilon(A,x,P.EPSILON2);if(!C&&!T){g=m.dot(A,i);let E=P.acosClamped(g);f>0&&f>E&&(f=E-P.EPSILON4),g=m.dot(A,x),E=P.acosClamped(g),f<0&&-f>E&&(f=-E+P.EPSILON4);let S=m.cross(i,A,Sgt);o.look(S,f)}else(C&&f<0||T&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function vgt(e){nl(e,e.enableRotate,e.rotateEventTypes,ogt,e.inertiaSpin,"_lastInertiaSpinMovement"),nl(e,e.enableZoom,e.zoomEventTypes,UAe,e.inertiaZoom,"_lastInertiaZoomMovement"),nl(e,e.enableTilt,e.tiltEventTypes,ygt,e.inertiaSpin,"_lastInertiaTiltMovement"),nl(e,e.enableLook,e.lookEventTypes,Wu)}var wgt=new N,Dgt=new he;function hK(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!u(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let r=t.camera,o=i.ellipsoid,s=t.mapProjection,a,c;N.equals(r.transform,N.IDENTITY)||(a=N.clone(r.transform,wgt),c=m.magnitude(r.position),r._setTransform(N.IDENTITY));let l=Dgt;n===ne.SCENE3D?o.cartesianToCartographic(r.position,l):s.unproject(r.position,l);let f=!1;if(l.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(u(d)){let p=d+e.minimumZoomDistance;l.height<p&&(l.height=p,n===ne.SCENE3D?o.cartographicToCartesian(l,r.position):s.project(l,r.position),f=!0)}}u(a)&&(r._setTransform(a),f&&(m.normalize(r.position,r.position),m.negate(r.position,r.direction),m.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),m.normalize(r.direction,r.direction),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up)))}YF.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Igt=new m,Pgt=new m;YF.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;N.equals(t.transform,N.IDENTITY)?(this._globe=n,this._ellipsoid=u(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let r=u(this._globe)?this._globe.terrainExaggeration:1,o=u(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=Ic.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Ic.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Ic.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&u(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,Igt),c=m.clone(t.directionWC,Pgt);i===ne.SCENE2D?v_t(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,J_t(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,vgt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&hK(this),this._aggregator.reset()};YF.prototype.isDestroyed=function(){return!1};YF.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var XF=YF;var KF=`uniform sampler2D colorTexture; -uniform sampler2D colorTexture2; -uniform vec2 center; -uniform float radius; + return vec3(longitude, latitude, height); +} +`;var J2=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +#define OCTREE_FLAG_INTERNAL 0 +#define OCTREE_FLAG_LEAF 1 +#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 -in vec2 v_textureCoordinates; +#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops -void main() -{ - vec4 color0 = texture(colorTexture, v_textureCoordinates); - vec4 color1 = texture(colorTexture2, v_textureCoordinates); +uniform sampler2D u_octreeInternalNodeTexture; +uniform vec2 u_octreeInternalNodeTexelSizeUv; +uniform int u_octreeInternalNodeTilesPerRow; +#if (SAMPLE_COUNT > 1) +uniform sampler2D u_octreeLeafNodeTexture; +uniform vec2 u_octreeLeafNodeTexelSizeUv; +uniform int u_octreeLeafNodeTilesPerRow; +#endif - float x = length(gl_FragCoord.xy - center) / radius; - float t = smoothstep(0.5, 0.8, x); - out_FragColor = mix(color0 + color1, color1, t); -} -`;var JF=`uniform sampler2D colorTexture; +struct OctreeNodeData { + int data; + int flag; +}; -uniform float avgLuminance; -uniform float threshold; -uniform float offset; +struct TraversalData { + ivec4 octreeCoords; + int parentOctreeIndex; +}; -in vec2 v_textureCoordinates; +struct SampleData { + int megatextureIndex; + ivec4 tileCoords; + vec3 tileUv; + #if (SAMPLE_COUNT > 1) + float weight; + #endif +}; -float key(float avg) -{ - float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); - return max(0.0, guess) + 0.1; +// Integer mod: For WebGL1 only +int intMod(in int a, in int b) { + return a - (b * (a / b)); +} +int normU8_toInt(in float value) { + return int(value * 255.0); +} +int normU8x2_toInt(in vec2 value) { + return int(value.x * 255.0) + 256 * int(value.y * 255.0); +} +float normU8x2_toFloat(in vec2 value) { + return float(normU8x2_toInt(value)) / 65535.0; } -// See section 9. "The bright-pass filter" of Realtime HDR Rendering -// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf - -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec3 xyz = czm_RGBToXYZ(color.rgb); - float luminance = xyz.r; - - float scaledLum = key(avgLuminance) * luminance / avgLuminance; - float brightLum = max(scaledLum - threshold, 0.0); - float brightness = brightLum / (offset + brightLum); +OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { + vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); - xyz.r = brightness; - out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); + OctreeNodeData data; + data.data = normU8x2_toInt(texData.xy); + data.flag = normU8x2_toInt(texData.zw); + return data; } -`;function X_(){this._sceneFramebuffer=new bC;let e=.125,t=new Array(6);t[0]=new Tr({fragmentShader:jl,textureScale:e,forcePowerOfTwo:!0,sampleMode:zu.LINEAR});let n=t[1]=new Tr({fragmentShader:JF,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new Tr({fragmentShader:l0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Tr({fragmentShader:l0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Tr({fragmentShader:jl,sampleMode:zu.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new Tr({fragmentShader:KF,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new el({stages:t});let r=new OC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}X_.prototype.get=function(e){return this._stages.get(e)};X_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Ogt=new oe,HAe=new H,Mgt=new H,GAe=new N;function Rgt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=N.computeViewportTransformation(n,0,1,GAe),l=N.multiplyByPoint(o,r,Ogt),f=Mt.pointToGLWindowCoordinates(s,c,r,HAe);l.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,l,l),p=H.magnitude(H.subtract(d,f,d))*30*2,g=Mgt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,A=t.drawingBufferHeight,x=e._stages,C=x.get(0),T=C.outputTexture.width,E=C.outputTexture.height,S=new Ye;S.width=T,S.height=E,c=N.computeViewportTransformation(S,0,1,GAe),f=Mt.pointToGLWindowCoordinates(s,c,r,HAe),g.x*=T/h,g.y*=E/A;let w=C.scissorRectangle;w.x=Math.max(f.x-g.x*.5,0),w.y=Math.max(f.y-g.y*.5,0),w.width=Math.min(g.x,h),w.height=Math.min(g.y,A);for(let D=1;D<4;++D)Ye.clone(w,x.get(D).scissorRectangle)}X_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};X_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Rgt(this,t,n),r};X_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};X_.prototype.copy=function(e,t){if(!u(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};X_.prototype.isDestroyed=function(){return!1};X_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var ZF=X_;var BH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Yi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=We(e.contextOptions),o=u(n),s=new yI(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),u(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new rF,this._frameState=new MN(s,new pN(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new mv(s),this._globe=void 0,this._globeTranslucencyState=new eF,this._primitives=new Il,this._groundPrimitives=new Il,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new BC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new bN(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ri({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ri({depth:1,owner:this}),this._stencilClearCommand=new ri({stencil:0}),this._classificationStencilClearCommand=new ri({stencil:0,renderState:Ve.fromCache({stencilMask:Ft.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new jF(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new yN,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=u(e.mapProjection)?e.mapProjection:new Ii,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new PN,this._shadowMapCamera=new dr(this),this.shadowMap=new q_({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new FS,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new GF,this._brdfLutGenerator=new ML,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new XF(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Ul.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=ka.requestCompletedEvent.addEventListener(BH(this)),this._removeTaskProcessorListenerCallback=_i.taskCompletedEvent.addEventListener(BH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ye(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new dr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new dr(this),this.preloadFlightCullingVolume=void 0,this._picking=new AF(this),this._defaultView=new wC(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new op,YAe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function Bgt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];u(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(BH(e))),n.push(t.terrainProviderChanged.addEventListener(BH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Yi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ht.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ht.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return xd.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Bgt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(u(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(u(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),u(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(u(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new dr(this),u(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new vN(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ht.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Yi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function WAe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;u(t.pickId)&&(c.picking=k_.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=k_.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=k_.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=q_.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===ve.TRANSLUCENT&&u(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=u(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Yi.prototype.updateDerivedCommands=function(e){if(!u(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);let o=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=u(a.logDepth),l=u(a.hdr),f=u(a.originalCommand),d=o&&!c,p=s&&!l,g=(!o||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=q_.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=k_.createLogDepthCommand(e,n,a.logDepth),WAe(this,a.logDepth.command,i)),(f||g)&&WAe(this,e,i)}};var Lgt=new Hf({pass:Nr.RENDER}),pK=new Hf({pass:Nr.PRELOAD}),_K=new Hf({pass:Nr.PRELOAD_FLIGHT}),Ngt=new Hf({pass:Nr.REQUEST_RENDER_MODE_DEFER_CHECK}),jAe=new ae,gK;function Fgt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&u(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return jAe.radius=n.minimumRadius+i,gK=EL.fromBoundingSphere(jAe,e.camera.positionWC,gK),gK}}Yi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function YAe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Yi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Fgt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof tn||this.camera.frustum instanceof bo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,u(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),u(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),FS.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,u(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Yi.prototype.isVisible=function(e,t,n){return u(e)&&(!u(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==$t.OUTSIDE&&(!u(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var RH=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);RH=N.inverseTransformation(RH,RH);function Ugt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;u(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(r.mode!==ne.SCENE3D){c=N.multiplyByPoint(RH,c,c);let p=r.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(u(s.radius)){let p=s.radius;a=Nn.toWireframe(Us.createGeometry(new Us({radii:new m(p,p,p),vertexFormat:sn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Sn({geometryInstances:new Ct({geometry:a,modelMatrix:N.fromTranslation(c),attributes:{color:new zt(1,0,0,1)}}),appearance:new sn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Nn.toWireframe(fl.createGeometry(fl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:sn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Sn({geometryInstances:new Ct({geometry:a,modelMatrix:N.fromRotationTranslation(p,c,new N),attributes:{color:new zt(1,0,0,1)}}),appearance:new sn({flat:!0,translucent:!1}),asynchronous:!1})}let l=r.commandList,f=r.commandList=[];t._debugVolume.update(r),e=f[0],r.useLogDepth&&(e=k_.createLogDepthCommand(e,o).command);let d;u(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),u(d)&&(n.framebuffer=d),r.commandList=l}function Ra(e,t,n,i,r){let o=t._frameState;if(u(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ri){e.execute(n,i);return}e.debugShowBoundingVolume&&u(e.boundingVolume)&&Ugt(e,t,i,r),o.useLogDepth&&u(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.depth&&t._hdr&&u(e.derivedCommands)&&u(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&u(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(u(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&u(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function QF(e,t,n,i){let r=t._frameState,o=e.derivedCommands;u(o)&&(r.useLogDepth&&u(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,u(o.picking)?(e=o.picking.pickCommand,e.execute(n,i)):u(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(n,i)))}function XAe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Vgt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function kgt(e,t,n,i,r){let o=e.context;B_(i,XAe,e.camera.positionWC),u(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function zgt(e,t,n,i,r){let o=e.context;B_(i,Vgt,e.camera.positionWC),u(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function Hgt(e,t,n,i){let r=e.context;B_(i,XAe,e.camera.positionWC);let o=i.length;for(let s=0;s<o;++s)t(i[s],e,r,n)}var Ggt=new wi,Wgt=new Zc,jgt=new tn,qgt=new bo;function yK(e,t){let n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;o.updateCamera(n);let s;u(n.frustum.fov)?s=n.frustum.clone(Ggt):u(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Wgt):u(n.frustum.width)?s=n.frustum.clone(jgt):s=n.frustum.clone(qgt),s.near=n.frustum.near,s.far=n.frustum.far,o.updateFrustum(s),o.updatePass(ve.ENVIRONMENT);let a=r.passes,c=a.pick,l=e._environmentState,f=e._view,d=l.renderTranslucentDepthForPick,p=l.useWebVR;if(!c){let b=l.skyBoxCommand;if(u(b)&&Ra(b,e,i,t),l.isSkyAtmosphereVisible&&Ra(l.skyAtmosphereCommand,e,i,t),l.isSunVisible&&(l.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let v;l.useGlobeDepthFramebuffer?v=f.globeDepth.framebuffer:l.usePostProcess?v=f.sceneFramebuffer.framebuffer:v=l.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,v),t.framebuffer=v}l.isMoonVisible&&l.moonCommand.execute(i,t)}let g;l.useOIT?(u(e._executeOITFunction)||(e._executeOITFunction=function(b,v,I,R,F){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(b,v,I,R,F)}),g=e._executeOITFunction):a.render?g=kgt:g=zgt;let h=f.frustumCommandsList,A=h.length,x=l.clearGlobeDepth,C=l.useDepthPlane,T=e._globeTranslucencyState,E=T.translucent,S=e._view.globeTranslucencyFramebuffer,w=e._depthClearCommand,D=e._stencilClearCommand,M=e._classificationStencilClearCommand,O=e._depthPlane,B=l.usePostProcessSelected,L=n.position.z,_;for(let b=0;b<A;++b){let v=A-b-1,I=h[v];e.mode===ne.SCENE2D?(n.position.z=L-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s)),w.execute(i,t),i.stencilBuffer&&D.execute(i,t),o.updatePass(ve.GLOBE);let R=I.commands[ve.GLOBE],F=I.indices[ve.GLOBE];if(E)T.executeGlobeCommands(I,Ra,S,e,t);else for(_=0;_<F;++_)Ra(R[_],e,i,t);let k=f.globeDepth;if(u(k)&&l.useGlobeDepthFramebuffer&&k.executeCopyDepth(i,t),!l.renderTranslucentDepthForPick)if(o.updatePass(ve.TERRAIN_CLASSIFICATION),R=I.commands[ve.TERRAIN_CLASSIFICATION],F=I.indices[ve.TERRAIN_CLASSIFICATION],E)T.executeGlobeClassificationCommands(I,Ra,S,e,t);else for(_=0;_<F;++_)Ra(R[_],e,i,t);if(x&&(w.execute(i,t),C&&O.execute(i,t)),!l.useInvertClassification||c||l.renderTranslucentDepthForPick){for(o.updatePass(ve.CESIUM_3D_TILE),R=I.commands[ve.CESIUM_3D_TILE],F=I.indices[ve.CESIUM_3D_TILE],_=0;_<F;++_)Ra(R[_],e,i,t);if(F>0&&(u(k)&&l.useGlobeDepthFramebuffer&&(k.prepareColorTextures(i,x),k.executeUpdateDepth(i,t,x,k.depthStencilTexture)),!l.renderTranslucentDepthForPick))for(o.updatePass(ve.CESIUM_3D_TILE_CLASSIFICATION),R=I.commands[ve.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[ve.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)Ra(R[_],e,i,t)}else{e._invertClassification.clear(i,t);let Y=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(ve.CESIUM_3D_TILE),R=I.commands[ve.CESIUM_3D_TILE],F=I.indices[ve.CESIUM_3D_TILE],_=0;_<F;++_)Ra(R[_],e,i,t);for(u(k)&&l.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),k.executeUpdateDepth(i,t,x,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),R=I.commands[ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],F=I.indices[ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<F;++_)Ra(R[_],e,i,t);for(t.framebuffer=Y,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),F>0&&i.stencilBuffer&&M.execute(i,t),o.updatePass(ve.CESIUM_3D_TILE_CLASSIFICATION),R=I.commands[ve.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[ve.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)Ra(R[_],e,i,t)}for(F>0&&i.stencilBuffer&&D.execute(i,t),o.updatePass(ve.VOXELS),R=I.commands[ve.VOXELS],F=I.indices[ve.VOXELS],R.length=F,Hgt(e,Ra,t,R),o.updatePass(ve.OPAQUE),R=I.commands[ve.OPAQUE],F=I.indices[ve.OPAQUE],_=0;_<F;++_)Ra(R[_],e,i,t);v!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,o.updateFrustum(s));let V;if(!c&&l.useInvertClassification&&r.invertClassificationColor.alpha<1&&(V=e._invertClassification),o.updatePass(ve.TRANSLUCENT),R=I.commands[ve.TRANSLUCENT],R.length=I.indices[ve.TRANSLUCENT],g(e,Ra,t,R,V),I.indices[ve.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,Ra,t,R,k.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,Ra,t,I)),i.depthTexture&&e.useDepthPicking&&(l.useGlobeDepthFramebuffer||d)){let Y=k.depthStencilTexture,W=e._picking.getPickDepth(e,v);W.update(i,Y),W.executeCopyDepth(i,t)}if(c||!B)continue;let U=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s),o.updatePass(ve.GLOBE),R=I.commands[ve.GLOBE],F=I.indices[ve.GLOBE],E)T.executeGlobeCommands(I,QF,S,e,t);else for(_=0;_<F;++_)QF(R[_],e,i,t);for(x&&(w.framebuffer=t.framebuffer,w.execute(i,t),w.framebuffer=void 0),x&&C&&O.execute(i,t),o.updatePass(ve.CESIUM_3D_TILE),R=I.commands[ve.CESIUM_3D_TILE],F=I.indices[ve.CESIUM_3D_TILE],_=0;_<F;++_)QF(R[_],e,i,t);for(o.updatePass(ve.OPAQUE),R=I.commands[ve.OPAQUE],F=I.indices[ve.OPAQUE],_=0;_<F;++_)QF(R[_],e,i,t);for(o.updatePass(ve.TRANSLUCENT),R=I.commands[ve.TRANSLUCENT],F=I.indices[ve.TRANSLUCENT],_=0;_<F;++_)QF(R[_],e,i,t);t.framebuffer=U}}function KAe(e){e.context.uniformState.updatePass(ve.COMPUTE);let n=e._environmentState.sunComputeCommand;u(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,r=i.length;for(let o=0;o<r;++o)i[o].execute(e._computeEngine)}function Ygt(e,t){e.context.uniformState.updatePass(ve.OVERLAY);let i=e.context,r=e._overlayCommandList,o=r.length;for(let s=0;s<o;++s)r[s].execute(i,t)}function Xgt(e,t,n){let i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,s=o.length,a=t.length;for(let c=0;c<a;++c){let l=t[c];if(e.updateDerivedCommands(l),l.castShadows&&(l.pass===ve.GLOBE||l.pass===ve.CESIUM_3D_TILE||l.pass===ve.OPAQUE||l.pass===ve.TRANSLUCENT)&&e.isVisible(l,i))if(r)for(let f=0;f<s;++f)o[f].commandList.push(l);else if(s===1)o[0].commandList.push(l);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(l,p))o[d].commandList.push(l),f=!0;else if(f)break}}}}function JAe(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,l=c.length;for(let d=0;d<l;++d)c[d].commandList.length=0;let f=e.frameState.commandList;Xgt(e,f,a);for(let d=0;d<l;++d){let p=a.passes[d];o.updateCamera(p.camera),a.updatePass(r,d);let g=p.commandList.length;for(let h=0;h<g;++h){let A=p.commandList[h];o.updatePass(A.pass),Ra(A.derivedCommands.shadows.castCommands[s],e,r,p.passState)}}}}var Kgt=new m;Yi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?Jgt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===Ul.ROTATE?(Zgt(this,e),d0(!0,this,e,t)):(AK(this,e,t),syt(this,e))};function Jgt(e,t,n){let i=e._view,r=i.camera,s=e._environmentState.renderTranslucentDepthForPick;AK(e,t,n),ZAe(e),i.createPotentiallyVisibleSet(e),KAe(e),s||JAe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=dr.clone(r,e._cameraVR);c.frustum=r.frustum;let l=r.frustum.near,f=l*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,Kgt);r.frustum.aspectRatio=a.width/a.height;let g=.5*d*l/f;m.add(c.position,p,r.position),r.frustum.xOffset=g,yK(e,t),a.x=a.width,m.subtract(c.position,p,r.position),r.frustum.xOffset=-g,yK(e,t),dr.clone(c,r)}function Zgt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var Qgt=new he(Math.PI,P.PI_OVER_TWO),$gt=new m,eyt=new m,tyt=new N,nyt=new N,iyt=new m,ryt=new m,oyt=new Ye;function syt(e,t){let n=e.context,i=e.frameState,r=e.camera,o=t.viewport,s=Ye.clone(o,oyt);t.viewport=s;let a=Qgt,c=$gt;e.mapProjection.project(a,c);let f=m.clone(r.position,eyt),d=N.clone(r.transform,nyt),p=r.frustum.clone();r._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,tyt),h=r.frustum.projectionMatrix,A=r.positionWC.y,x=m.fromElements(P.sign(A)*c.x-A,0,-r.positionWC.x,iyt),C=Mt.pointToGLWindowCoordinates(h,g,x,ryt);C.x=Math.floor(C.x);let T=s.x,E=s.width;if(A===0||C.x<=T||C.x>=T+E)d0(!0,e,t);else if(Math.abs(T+E*.5-C.x)<1)s.width=C.x-s.x,r.position.x*=P.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!0,e,t),s.x=C.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!1,e,t);else if(C.x>T+E*.5){s.width=C.x-T;let S=r.frustum.right;r.frustum.right=c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!0,e,t),s.x=C.x,s.width=T+E-C.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=S-r.frustum.right*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!1,e,t)}else{s.x=C.x,s.width=T+E-C.x;let S=r.frustum.left;r.frustum.left=-c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!0,e,t),s.x=T,s.width=C.x-T,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=S-r.frustum.left*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),d0(!1,e,t)}r._setTransform(d),m.clone(f,r.position),r.frustum=p.clone(),t.viewport=o}function d0(e,t,n,i){let r=t._environmentState,o=t._view,s=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),ZAe(t),o.createPotentiallyVisibleSet(t),e&&(u(i)&&AK(t,n,i),KAe(t),s||JAe(t)),yK(t,n)}var qAe=new es;Yi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof tn||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{u(o)?(u(s)&&(o.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,s),u(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=u(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=u(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=u(A)?A.drawCommand:void 0,n.sunComputeCommand=u(A)?A.computeCommand:void 0,n.moonCommand=u(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=u(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!r;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=qAe.planes;for(let A=0;A<5;++A)p[A]=d.planes[A];d=qAe,n.isSkyAtmosphereVisible=u(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;u(g)&&(!u(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new xd(g)):!u(g)&&u(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),u(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function ayt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Bh({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),u(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function cyt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,!!r){for(let o=0;o<i;++o)if(n[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let o=0;o<i;++o){let s=n[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function ZAe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),ayt(e),cyt(e),e._globe&&e._globe.render(t)}function AK(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,c=e._frameState.passes.pick;u(s.globeDepth)&&(s.globeDepth.picking=c);let l=o.useWebVR;o.originalFramebuffer=t.framebuffer,u(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new ZF:u(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!u(e.sun)&&u(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=u(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&u(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let h=e.postProcessStages,A=o.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(o.usePostProcessSelected=!1,A&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,r.useLogDepth,e._hdr),h.clear(i),A=o.usePostProcess=h.ready,o.usePostProcessSelected=A&&h.hasSelected),o.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:A&&(t.framebuffer=s.sceneFramebuffer.framebuffer),u(t.framebuffer)&&f.execute(i,t),o.useInvertClassification=!c&&u(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&o.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),u(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,E=T.derivedCommands;E.oit=p.createDerivedCommands(T,i,E.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Yi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;u(r)&&r.prepareColorTextures(t);let o=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,l=s?r.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!o&&(g=l);let h=this.postProcessStages,A=g.getColorTexture(0),x=d.getColorTexture(0),C=y(l,f).getDepthStencilTexture();h.execute(t,A,C,x),h.copy(t,c)}!o&&!a&&s&&(e.framebuffer=c,r.executeCopyColor(t,e))};function lyt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function uyt(e){let t=e._globe,i=e.camera.positionCartographic;if(u(t)&&t.show&&u(i))return t.getHeight(i)}function fyt(e){let t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!u(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!u(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return u(s)&&o.height<s}Yi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=uyt(this),this._cameraUnderground=fyt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),u(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function dyt(e,t){if(e.debugShowFramesPerSecond){if(!u(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new W_({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else u(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function myt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),u(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function hyt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),ka.update()}var pyt=new z;function _yt(e){let t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Lgt;let o=y(e.backgroundColor,z.BLACK);e._hdr&&(o=z.clone(o,pyt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);let s=e.shadowMap;u(s)&&s.enabled&&(!u(e.light)||e.light instanceof op?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ye.clone(a,c.viewport),u(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,Ygt(e,c),u(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function NC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function gyt(e){return e._picking.updateMostDetailedRayPicks(e)}Yi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,u(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&u(this.maximumRenderTimeChange)&&u(this._lastRenderTime)){let r=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,15e6,1);YAe(this,r,e),t.newFrame=!0}NC(this,myt),this.primitives.show&&(NC(this,gyt),NC(this,yyt),NC(this,Ayt),i||NC(this,xyt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),NC(this,_yt)),dyt(this,i),NC(this,hyt),lyt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Yi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Yi.prototype.requestRender=function(){this._renderRequested=!0};Yi.prototype.clampLineWidth=function(e){return Math.max(Ht.minimumAliasedLineWidth,Math.min(e,Ht.maximumAliasedLineWidth))};Yi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Yi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Yi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Yi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function yyt(e){let t=e._frameState;pK.camera=t.camera,pK.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,pK)}function Ayt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;_K.camera=e.preloadFlightCamera,_K.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,_K)}function xyt(e){e.primitives.updateForPass(e._frameState,Ngt)}Yi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Yi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Yi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Yi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Yi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Yi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Yi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Yi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Yi.prototype.cartesianToCanvasCoordinates=function(e,t){return $i.wgs84ToWindowCoordinates(this,e,t)};Yi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Yi.prototype.morphTo2D=function(e){let t,n=this.globe;u(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Yi.prototype.morphToColumbusView=function(e){let t,n=this.globe;u(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Yi.prototype.morphTo3D=function(e){let t,n=this.globe;u(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function Cyt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){u(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{u(e)&&u(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Yi.prototype.setTerrain=function(e){return Cyt(this,e),e};Yi.prototype.isDestroyed=function(){return!1};Yi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),u(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var $F=Yi;var jS=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); + +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { + int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; + int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; + int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + return getOctreeNodeData(octreeUv); } -vec3 getLightDirection(vec3 positionWC) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = - positionWC * float(lightEnum == 0.0) + - czm_lightDirectionWC * float(lightEnum == 1.0) + - czm_sunDirectionWC * float(lightEnum == 2.0); - return normalize(lightDirection); +int getOctreeParentIndex(in int octreeIndex) { + int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; + int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); + int parentOctreeIndex = normU8x2_toInt(parentData.xy); + return parentOctreeIndex; } -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; +/** +* Convert a position in the uv-space of the tileset bounding shape +* into the uv-space of a tile within the tileset +*/ +vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { + // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) + float dimAtLevel = pow(2.0, float(octreeCoords.w)); + return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +} - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); +void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { + sampleData.megatextureIndex = data.data; + sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; +} - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; +#if (SAMPLE_COUNT > 1) +void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { + int leafIndex = data.data; + int leafNodeTexelCount = 2; + // Adding 0.5 moves to the center of the texel + float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; + float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + // Get an interpolation weight and a flag to determine whether to read the parent texture + vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); + vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); + float lerp = normU8x2_toFloat(leafData0.xy); + sampleDatas[0].weight = 1.0 - lerp; + sampleDatas[1].weight = lerp; + // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT + sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; + sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; - underTranslucentGlobe = 0.0; + // Get megatexture indices for both samples + vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); + vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); + sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); + sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); +} +#endif - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) +OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { + float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); + vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; + vec3 end = start + vec3(sizeAtLevel); + OctreeNodeData childData; - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + // Find out which octree child contains the position + // 0 if before center, 1 if after + vec3 center = 0.5 * (start + end); + vec3 childCoord = step(center, shapePosition); - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + // Get octree coords for the next level down + ivec4 octreeCoords = traversalData.octreeCoords; + traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); + childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; + if (childData.flag != OCTREE_FLAG_INTERNAL) { + // leaf tile - stop traversing + break; } - #endif - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + // interior tile - keep going deeper + start = mix(start, center, childCoord); + end = mix(center, end, childCoord); + traversalData.parentOctreeIndex = childData.data; + } - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); + return childData; } -`;var e2=`in vec3 v_outerPositionWC; - -uniform vec3 u_hsbShift; -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif +/** +* Transform a given position to an octree tile coordinate and a position within that tile, +* and find the corresponding megatexture index and texture coordinates +*/ +void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { + traversalData.octreeCoords = ivec4(0); + traversalData.parentOctreeIndex = 0; -void main (void) -{ - vec3 lightDirection = getLightDirection(v_outerPositionWC); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; + OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); + if (nodeData.flag != OCTREE_FLAG_LEAF) { + nodeData = traverseOctreeDownwards(shapePosition, traversalData); + } - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); #endif +} - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); - - #ifndef HDR - color.rgb = czm_acesTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif +bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { + return clamp(v, minVal, maxVal) == v; +} - #ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(color.rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - color.rgb = czm_HSBToRGB(hsb); - #endif +bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { + vec3 tileUv = getTileUv(shapePosition, octreeCoords); + bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); + // Assume (!) the position is always inside the root tile. + return inside || octreeCoords.w == 0; +} - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); +void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { + if (insideTile(shapePosition, traversalData.octreeCoords)) { + for (int i = 0; i < SAMPLE_COUNT; i++) { + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + } + return; } - out_FragColor = color; -} -`;var t2=`in vec4 position; + // Go up tree until we find a parent tile containing shapePosition + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + traversalData.octreeCoords.xyz /= 2; + traversalData.octreeCoords.w -= 1; -out vec3 v_outerPositionWC; + if (insideTile(shapePosition, traversalData.octreeCoords)) { + break; + } -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif + traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); + } -void main(void) -{ - vec4 positionWC = czm_model * position; - vec3 lightDirection = getLightDirection(positionWC.xyz); + // Go down tree + OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + #else + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; } -`;function qS(e){e=y(e,re.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=N.fromScale(n),this._modelMatrix=new N,this._command=new et({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(qS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});qS.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var xK=new N;qS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=N.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,xK),r=N.multiplyTransformation(i,hr.Y_UP_TO_Z_UP,xK),o=N.multiply(this._scaleMatrix,r,xK);N.clone(o,this._modelMatrix);let s=e.context,a=Tyt(this),c=e.globeTranslucencyState.translucent,l=this.perFragmentAtmosphere||c||!u(t)||!t.show,f=this._command;if(!u(f.vertexArray)){let p=Us.createGeometry(new Us({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Pe.POSITION_ONLY}));f.vertexArray=oi.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:dn.ALPHA_BLEND,depthMask:!1})}let d=a|l<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),l&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new ke({defines:p,sources:[z_,jS,t2]}),h=new ke({defines:p,sources:[z_,jS,e2]});this._spSkyAtmosphere=Kt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function Tyt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}qS.prototype.isDestroyed=function(){return!1};qS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var n2=qS;var i2=`uniform samplerCube u_cubeMap; +`;var Z2=`// See Octree.glsl for the definitions of SampleData and intMod -in vec3 v_texCoord; +/* Megatexture defines (set in Scene/VoxelRenderResources.js) +#define SAMPLE_COUNT ### +#define NEAREST_SAMPLING +#define PADDING +*/ -void main() +uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions +uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions +uniform vec2 u_megatextureVoxelSizeUv; +uniform vec2 u_megatextureSliceSizeUv; +uniform vec2 u_megatextureTileSizeUv; + +uniform ivec3 u_dimensions; // does not include padding +#if defined(PADDING) + uniform ivec3 u_paddingBefore; + uniform ivec3 u_paddingAfter; +#endif + +// Integer min, max, clamp: For WebGL1 only +int intMin(int a, int b) { + return a <= b ? a : b; +} +int intMax(int a, int b) { + return a >= b ? a : b; +} +int intClamp(int v, int minVal, int maxVal) { + return intMin(intMax(v, minVal), maxVal); +} + +vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) { - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); + int indexX = intMod(index, dimensions.x); + int indexY = index / dimensions.x; + return vec2(indexX, indexY) * uvScale; } -`;var r2=`in vec3 position; -out vec3 v_texCoord; +/* + How is 3D data stored in a 2D megatexture? + + In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). + The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and + the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). + Note that there could be empty space in the megatexture because it's a power of two. + + 0 1 2 3 + +---+---+---+---+ + | | | | | 3 + +---+---+---+---+ + | | | | | 2 + +-------+-------+ + |010|110|011|111| 1 + |--- ---|--- ---| + |000|100|001|101| 0 + +-------+-------+ + + When doing linear interpolation the megatexture needs to be sampled twice: once for + the Z slice above the voxel coordinate and once for the slice below. The two slices + are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is + halfway between two Z slices so the interpolation factor is 0.5. Below is a side view + of the 3D voxel grid with voxel coordinates on the left side. + + 2 +---+ + |001| + 1 +-z-+ + |000| + 0 +---+ + + When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. +*/ + +Properties getPropertiesFromMegatexture(in SampleData sampleData) { + vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? + int tileIndex = sampleData.megatextureIndex; + vec3 voxelCoord = tileUv * vec3(u_dimensions); + ivec3 voxelDimensions = u_dimensions; + + #if defined(PADDING) + voxelDimensions += u_paddingBefore + u_paddingAfter; + voxelCoord += vec3(u_paddingBefore); + #endif + + #if defined(NEAREST_SAMPLING) + // Round to the center of the nearest voxel + voxelCoord = floor(voxelCoord) + vec3(0.5); + #endif + + // Tile location + vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;function LH(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new et({modelMatrix:N.clone(N.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}LH.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let o=this.sources;typeof o.positiveX=="string"?CI(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ga({context:i,source:o}))}let r=this._command;if(!u(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};let o=fl.createGeometry(fl.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Pe.POSITION_ONLY})),s=this._attributeLocations=Nn.createAttributeLocations(o);r.vertexArray=oi.fromGeometry({context:i,geometry:o,attributeLocations:s,bufferUsage:Ne.STATIC_DRAW}),r.renderState=Ve.fromCache({blending:dn.ALPHA_BLEND})}if(!u(r.shaderProgram)||this._useHdr!==t){let o=new ke({defines:[t?"HDR":""],sources:[i2]});r.shaderProgram=Kt.fromCache({context:i,vertexShaderSource:r2,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t}if(u(this._cubeMap))return r};LH.prototype.isDestroyed=function(){return!1};LH.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var o2=LH;function Jf(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Mn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o,s)}var Eyt=new m;Jf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=Q.getScale(this.orientedBoundingBox.halfAxes,Eyt),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};Jf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:r,z:o}=this,s=i*2,a=r*2,c=o*2,l=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,l,c],[p,f,l,c],[p,s,a,d],[p,f,a,d],[p,s,l,d],[p,f,l,d]];this.children=g.map(([h,A,x,C])=>new Jf(h,A,x,C,this,e,t))};Jf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Jf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var QAe={keyframe:0};function s2(e,t){return QAe.keyframe=e,Mr(t,QAe,er.searchComparator)}Jf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;u(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=byt(i,d),g=d[p],h=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),A=d[h],x=i-g.keyframe,C=$Ae(n-t.level,x);C<a&&(a=C,o=g);let T=A.keyframe-r,E=$Ae(n-t.level,T);if(E<c&&(c=E,s=A),x===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!u(o)||!u(s))return;let l=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=l===f?0:P.clamp((e-l)/(f-l),0,1)};function byt(e,t){let n=s2(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function $Ae(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Jf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Jf.prototype.createKeyframeNode=function(e){let t=s2(e,this.keyframeNodes);if(t<0){t=~t;let n=new er(this,e);this.keyframeNodes.splice(t,0,n)}};Jf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=s2(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=s2(n,this.renderableKeyframeNodes);if(r<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.spatialNode=void 0,e.state=er.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Jf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==er.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let r=0;r<t.length;r++){let o=t[r];e.megatextureIndex=o.add(e.metadatas[r]),e.metadatas[r]=void 0}e.state=er.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=s2(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};Jf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return u(t)&&u(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var a2=Jf;function CK(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(CK.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});CK.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(r,o,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var TK=CK;function c2(){}c2.prototype.evaluate=function(e,t){fe.throwInstantiationError()};c2.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};c2.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};c2.prototype.getVariables=function(){fe.throwInstantiationError()};var EK=c2;var l2=`uniform sampler2D u_texture; + // Slice location + float slice = voxelCoord.z - 0.5; + int sliceIndex = int(floor(slice)); + int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); + vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); -in vec2 v_textureCoordinates; + // Voxel location + vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); + // Final location in the megatexture + vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; + + #if defined(NEAREST_SAMPLING) + return getPropertiesFromMegatextureAtUv(uv0); + #else + float sliceLerp = fract(slice); + int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); + vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); + vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; + Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); + Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); + return mixProperties(properties0, properties1, sliceLerp); + #endif } -`;var u2=`uniform float u_radiusTS; -in vec2 v_textureCoordinates; +// Convert an array of sample datas to a final weighted properties. +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { + #if (SAMPLE_COUNT == 1) + return getPropertiesFromMegatexture(sampleDatas[0]); + #else + // When more than one sample is taken the accumulator needs to start at 0 + Properties properties = clearProperties(); + for (int i = 0; i < SAMPLE_COUNT; ++i) { + float weight = sampleDatas[i].weight; -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); + // Avoid reading the megatexture when the weight is 0 as it can be costly. + if (weight > 0.0) { + Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); + tempProperties = scaleProperties(tempProperties, weight); + properties = sumProperties(properties, tempProperties); + } + } + return properties; + #endif } - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +`;function Qpt(e){let t=new zx;this.shaderBuilder=t;let n=e._customShader,i=gt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let p in r)if(r.hasOwnProperty(p)){let g=r[p];t.addUniform(g.type,p,Te.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",Te.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s,t.addVertexLines([V2]),t.addFragmentLines([n.fragmentShaderText,"#line 0",J2,z2,Z2]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,Te.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,Te.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,Te.FRAGMENT),t.addFragmentLines([G2])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,Te.FRAGMENT),t.addFragmentLines([H2]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,Te.FRAGMENT),t.addFragmentLines([Y2,W2,RC])):a==="CYLINDER"?t.addFragmentLines([j2,RC,X2]):a==="ELLIPSOID"&&t.addFragmentLines([q2,RC,K2]),t.addFragmentLines([U2]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,Te.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,Te.FRAGMENT),s===1?f+=1:o.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,Te.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,Te.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,Te.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,Te.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,Te.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,Te.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,Te.FRAGMENT)}var $2=Qpt;function e_t(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,Te.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,Te.FRAGMENT);for(let R=0;R<c;R++){let L=i[R],N=r[R],_=`PropertyStatistics_${L}`,E=`PropertyStatistics_${L}`;n.addStruct(_,E,Te.FRAGMENT);let w=UH(N);n.addStructField(_,w,"min"),n.addStructField(_,w,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,Te.FRAGMENT);for(let R=0;R<c;R++){let L=i[R],N=`PropertyStatistics_${L}`,_=L;n.addStructField(f,N,_)}let g="Metadata",h="Metadata",x="metadata";n.addStruct(g,h,Te.FRAGMENT),n.addStructField(g,d,p);for(let R=0;R<c;R++){let L=i[R],N=r[R],_=UH(N);n.addStructField(g,_,L)}for(let R=0;R<c;R++){let L=i[R],N=r[R],_=n_t(N),E=`VoxelProperty_${L}`,w=`VoxelProperty_${L}`;n.addStruct(E,w,Te.FRAGMENT),n.addStructField(E,_,"partialDerivativeLocal"),n.addStructField(E,_,"partialDerivativeWorld"),n.addStructField(E,_,"partialDerivativeView"),n.addStructField(E,_,"partialDerivativeValid")}let b="Voxel",C="Voxel",A="voxel";n.addStruct(b,C,Te.FRAGMENT);for(let R=0;R<c;R++){let L=i[R],N=`VoxelProperty_${L}`;n.addStructField(b,N,L)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance");let T="FragmentInput",S="FragmentInput";n.addStruct(T,S,Te.FRAGMENT),n.addStructField(T,h,x),n.addStructField(T,C,A);let v="Properties",I="Properties",O="properties";n.addStruct(v,I,Te.FRAGMENT);for(let R=0;R<c;R++){let L=i[R],N=r[R],_=UH(N);n.addStructField(v,_,L)}{let R="clearProperties";n.addFunction(R,`${I} clearProperties()`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let L=0;L<c;L++){let N=i[L],_=r[L],E=o[L],w=UH(_,E);n.addFunctionLines(R,[`${O}.${N} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(R,[`${O}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${I} scaleProperties(${I} ${O}, float scale)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} scaledProperties = ${O};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(R,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(R,[`${O}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${I} ${O}, inout ${h} ${x})`,Te.FRAGMENT);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(R,[`${x}.${N} = ${O}.${N};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${d} ${p})`,Te.FRAGMENT);for(let L=0;L<c;L++){let N=i[L],_=r[L],E=qt.getComponentCount(_);for(let w=0;w<E;w++){let P=i_t(_,w),M=s[L][w],B=a[L][w];n.addFunctionLines(R,[`${p}.${N}.min${P} = ${Kxe(M)};`,`${p}.${N}.max${P} = ${Kxe(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let L=0;L<c;L++){let N=i[L],_=r[L],E=o[L],w=t_t(_,E);n.addFunctionLines(R,[`properties.${N} = texture(u_megatextureTextures[${L}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function UH(e){if(e===qt.SCALAR)return"float";if(e===qt.VEC2)return"vec2";if(e===qt.VEC3)return"vec3";if(e===qt.VEC4)return"vec4"}function t_t(e){if(e===qt.SCALAR)return".r";if(e===qt.VEC2)return".ra";if(e===qt.VEC3)return".rgb";if(e===qt.VEC4)return""}function n_t(e){if(e===qt.SCALAR)return"vec3";if(e===qt.VEC2)return"mat2";if(e===qt.VEC3)return"mat3";if(e===qt.VEC4)return"mat4"}function Kxe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function i_t(e,t){return e===qt.SCALAR?"":`[${t}]`}var Q2=e_t;function r_t(e,t){let n=new $2(e);Q2(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o}=n;if(o>0){let h="getClippingPlane",x=B_(r,t),b=0,C=x.indexOf(")")+1,A=x.indexOf("{",C)+1,T=x.indexOf("}",A),S=x.slice(b,C),v=x.slice(A,T);i.addFunction(h,S,Te.FRAGMENT),i.addFunctionLines(h,[v])}let s=i.clone();s.addDefine("PICKING",void 0,Te.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),u=Ue.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:dn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new tt({vertexArray:f,primitiveType:Le.TRIANGLES,renderState:u,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ee.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=tt.shallowClone(p,new tt);if(g.shaderProgram=c,g.pickOnly=!0,l(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(l(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var eB=r_t;function K_(){this.featurePropertiesDirty=!1}Object.defineProperties(K_.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});K_.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};K_.prototype.getFeature=function(e){fe.throwInstantiationError()};K_.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};K_.prototype.applyStyle=function(e){fe.throwInstantiationError()};K_.prototype.update=function(e,t){fe.throwInstantiationError()};K_.prototype.isDestroyed=function(){fe.throwInstantiationError()};K_.prototype.destroy=function(){fe.throwInstantiationError()};var GX=K_;function jS(e,t){this._conditionsExpression=je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,s_t(this,t)}Object.defineProperties(jS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function o_t(e,t){this.condition=e,this.expression=t}function s_t(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new o_t(new rf(a,t),new rf(c,t)))}e._runtimeConditions=n}jS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};jS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};jS.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) + { + return ${f}; + } +`}return o=`${i} ${e} { - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); +${o} return ${i}(1.0); } - +`,o};jS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];e.push.apply(e,r.condition.getVariables()),e.push.apply(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var tB=jS;function d0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,a_t(this,e)}function a_t(e,t){t=y(je(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,r=y(t.meta,y.EMPTY_OBJECT);for(let o in r)r.hasOwnProperty(o)&&(n[o]=new rf(r[o],i))}e._meta=n,e._ready=!0}function to(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new rf(String(t));if(typeof t=="string")return new rf(t,n);if(l(t.conditions))return new tB(t,n)}else return;return t}function no(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(d0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=to(this,e),this._style.show=no(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=to(this,e),this._style.color=no(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=to(this,e),this._style.pointSize=no(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=to(this,e),this._style.pointOutlineColor=no(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=to(this,e),this._style.pointOutlineWidth=no(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=to(this,e),this._style.labelColor=no(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=to(this,e),this._style.labelOutlineColor=no(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=to(this,e),this._style.labelOutlineWidth=no(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=to(this,e),this._style.font=no(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=to(this,e),this._style.labelStyle=no(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=to(this,e),this._style.labelText=no(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=to(this,e),this._style.backgroundColor=no(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=to(this,e),this._style.backgroundPadding=no(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=to(this,e),this._style.backgroundEnabled=no(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=to(this,e),this._style.scaleByDistance=no(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=to(this,e),this._style.translucencyByDistance=no(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=to(this,e),this._style.distanceDisplayCondition=no(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=to(this,e),this._style.heightOffset=no(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=to(this,e),this._style.anchorLineEnabled=no(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=to(this,e),this._style.anchorLineColor=no(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=to(this,e),this._style.image=no(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=to(this,e),this._style.disableDepthTestDistance=no(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=to(this,e),this._style.horizontalOrigin=no(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=to(this,e),this._style.verticalOrigin=no(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=to(this,e),this._style.labelHorizontalOrigin=no(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=to(this,e),this._style.labelVerticalOrigin=no(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});d0.fromUrl=function(e){return Ie.createIfNeeded(e).fetchJson(e).then(function(n){return new d0(n)})};d0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};d0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};d0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};d0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var J_=d0;function nB(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new $b({comparator:nB.comparator})}nB.prototype.addSubtree=function(e){let t=new c_t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};nB.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};nB.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function c_t(e,t){this.subtree=e,this.stamp=t}var iB=nB;function zl(){this.orientedBoundingBox=new On,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=m.clone(zl.DefaultMinBounds,new m),this._maxBounds=m.clone(zl.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var l_t=new m,WX=new m,u_t=new $,f_t=new m,d_t=new m,m_t=new m,h_t=new m,Jxe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new F);zl.prototype.update=function(e,t,n,i,r){i=y(i,zl.DefaultMinBounds),r=y(r,zl.DefaultMaxBounds);let o=zl.DefaultMinBounds,s=zl.DefaultMaxBounds;t=this._minBounds=m.clamp(t,o,s,this._minBounds),n=this._maxBounds=m.clamp(n,o,s,this._maxBounds),i=m.clamp(i,o,s,f_t),r=m.clamp(r,o,s,d_t);let a=m.clamp(t,i,r,m_t),c=m.clamp(n,i,r,h_t),u=F.getScale(e,WX);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>r.x||i.y>r.y||i.z>r.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=Zxe(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,o)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=F.multiplyByPoint(Jxe,a,f.renderMinBounds),f.renderMaxBounds=F.multiplyByPoint(Jxe,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,x=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===x.x?1:x.x-h.x),2/(h.y===x.y?1:x.y-h.y),2/(h.z===x.z?1:x.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var p_t=new m,__t=new m;zl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(D.lerp(o.x,s.x,a*t),D.lerp(o.y,s.y,a*n),D.lerp(o.z,s.z,a*i),p_t),u=m.fromElements(D.lerp(o.x,s.x,a*(t+1)),D.lerp(o.y,s.y,a*(n+1)),D.lerp(o.z,s.z,a*(i+1)),__t);return Zxe(c,u,this.shapeTransform,r)};zl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};zl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));zl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function Zxe(e,t,n,i){let r=zl.DefaultMinBounds,o=zl.DefaultMaxBounds;if(m.equals(e,r)&&m.equals(t,o))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,WX),c=m.midpoint(e,t,l_t);i.center=F.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),WX);let u=F.getRotation(n,u_t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var Hh=zl;function VH(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(VH.prototype,{metadataTable:{get:function(){return this._metadataTable}}});VH.fromJson=async function(e,t,n,i){let r;l(t)?r={json:t,binary:void 0}:r=y_t(n);let o=await g_t(e,r.json,r.binary),s={},a=r.json.bufferViews.length;for(let d=0;d<a;++d){let p=r.json.bufferViews[d],g=p.byteOffset,h=g+p.byteLength,b=o[p.buffer].subarray(g,h);s[d]=b}let c=r.json.voxelTable,u=r.json.propertyTables[c],f=new VH(e);return f._metadataTable=new gl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function g_t(e,t,n){let i=t.buffers.length,r=new Array(i);for(let o=0;o<i;o++){let s=t.buffers[o];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});r[o]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else r[o]=Promise.resolve(n)}return Promise.all(r)}function y_t(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Lr(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}var rB=VH;function Ko(){this.orientedBoundingBox=new On,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=Ko.DefaultMinBounds.x,this._maximumRadius=Ko.DefaultMaxBounds.x,this._minimumHeight=Ko.DefaultMinBounds.y,this._maximumHeight=Ko.DefaultMaxBounds.y,this._minimumAngle=Ko.DefaultMinBounds.z,this._maximumAngle=Ko.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new m,cylinderUvToRenderBoundsTranslate:new m,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvHeight:new H,cylinderUvToShapeUvAngle:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var Qxe=new m,x_t=new m,b_t=new m,C_t=new $,T_t=new F,A_t=new F,E_t=F.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new F);Ko.prototype.update=function(e,t,n,i,r){i=y(i,Ko.DefaultMinBounds),r=y(r,Ko.DefaultMaxBounds);let o=Ko.DefaultMinBounds.x,s=Ko.DefaultMaxBounds.x,a=Ko.DefaultMinBounds.y,c=Ko.DefaultMaxBounds.y,u=Ko.DefaultMinBounds.z,f=Ko.DefaultMaxBounds.z,d=f-u,p=.5*d,g=D.EPSILON10,h=D.EPSILON3,x=D.EPSILON10,b=D.clamp(t.x,o,s),C=D.clamp(n.x,o,s),A=D.clamp(i.x,o,s),T=D.clamp(r.x,o,s),S=Math.max(b,A),v=Math.min(C,T),I=D.clamp(t.y,a,c),O=D.clamp(n.y,a,c),R=D.clamp(i.y,a,c),L=D.clamp(r.y,a,c),N=Math.max(I,R),_=Math.min(O,L),E=D.negativePiToPi(t.z),w=D.negativePiToPi(n.z),P=D.negativePiToPi(i.z),M=D.negativePiToPi(r.z),B=Math.max(E,P),V=Math.min(w,M),U=F.getScale(e,Qxe);if(v===0||S>v||N>_||D.equalsEpsilon(U.x,0,void 0,g)||D.equalsEpsilon(U.y,0,void 0,g)||D.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=b,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=O,this._minimumAngle=E,this._maximumAngle=w,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=qX(S,v,N,_,B,V,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Y=b===o&&C===s,j=I===a&&O===c,J=w<E,W=w-E+J*d,K=W>p+x&&W<d-x,Z=W>x&&W<p-x,he=W>=p-x&&W<=p+x,ge=W<=x,se=K||Z||he||ge,pe=D.equalsEpsilon(E,u,void 0,h),xe=D.equalsEpsilon(w,f,void 0,h),Pe=v===s,we=S===o,Se=N===a&&_===c,nt=V<B,Ze=V-B+nt*d,Gt=Ze>p+x&&Ze<d-x,fn=Ze>x&&Ze<p-x,pt=Ze>=p-x&&Ze<=p+x,Tn=Ze<=x,Vn=Gt||fn||pt||Tn,Ut=this.shaderUniforms,Pt=this.shaderDefines;for(let ve in Pt)Pt.hasOwnProperty(ve)&&(Pt[ve]=void 0);let Ce=0;if(Pt.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Ce,Ce+=1,we||(Pt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Pt.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Ce,Ce+=1,Ut.cylinderUvToRenderRadiusMin=v/S),Pe||(Pt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===v&&(Pt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Se||(Pt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),N===_&&(Pt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),I===O&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),b===C&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!Y){Pt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let ve=1/(C-b),ot=b/(b-C);Ut.cylinderUvToShapeUvRadius=H.fromElements(ve,ot,Ut.cylinderUvToShapeUvRadius)}if(!j){Pt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let ve=2/(O-I),ot=(I+1)/(I-O);Ut.cylinderUvToShapeUvHeight=H.fromElements(ve,ot,Ut.cylinderUvToShapeUvHeight)}if(!Pe||!Se){let ve=.5*(_-N),ot=m.fromElements(1/v,1/v,1/(ve===0?1:ve),b_t),Kt=m.fromElements(0,0,-ot.z*.5*(N+_),x_t),_i=F.fromRotationTranslation($.fromScale(ot,C_t),Kt,T_t),Je=F.multiplyTransformation(_i,E_t,A_t);Ut.cylinderUvToRenderBoundsScale=F.getScale(Je,Ut.cylinderUvToRenderBoundsScale),Ut.cylinderUvToRenderBoundsTranslate=F.getTranslation(Je,Ut.cylinderUvToRenderBoundsTranslate)}if(J&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Vn&&(Pt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Pt.CYLINDER_INTERSECTION_INDEX_ANGLE=Ce,Gt?(Pt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Ce+=1):fn?(Pt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Ce+=2):pt?(Pt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,Ce+=1):Tn&&(Pt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Ce+=2),Ut.cylinderRenderAngleMinMax=H.fromElements(B,V,Ut.cylinderAngleMinMax)),se){Pt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ge&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),pe&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(Pt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let ve=(E-u)/d,ot=(w-u)/d,Kt=1-W/d;Ut.cylinderShapeUvAngleMinMax=H.fromElements(ve,ot,Ut.cylinderShapeUvAngleMinMax),Ut.cylinderShapeUvAngleRangeZeroMid=(ot+.5*Kt)%1;let _i=d/W,Je=-(E-u)/W;Ut.cylinderUvToShapeUvAngle=H.fromElements(_i,Je,Ut.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=Ce,!0};Ko.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=D.lerp(o,s,t*d),g=D.lerp(o,s,(t+1)*d),h=D.lerp(a,c,n*d),x=D.lerp(a,c,(n+1)*d),b=D.lerp(u,f,i*d),C=D.lerp(u,f,(i+1)*d);return qX(p,g,h,x,b,C,this.shapeTransform,r)};var S_t=new On,v_t=new m,w_t=new m,I_t=new m;Ko.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,r=this._minimumHeight,o=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,u=1-1/e.y,f=1-1/e.z,d=D.lerp(n,i,c),p=D.lerp(r,o,u),g=D.lerp(s,a,f),C=qX(d,i,p,o,g,a,t,S_t),A=$.getScale(C.halfAxes,v_t),T=F.getScale(t,w_t),S=m.divideComponents(A,T,I_t);return m.minimumComponent(S)};Ko.DefaultMinBounds=Object.freeze(new m(0,-1,-D.PI));Ko.DefaultMaxBounds=Object.freeze(new m(1,1,+D.PI));var P_t=5,D_t=new Array(P_t),R_t=new m,O_t=new $,M_t=new F,L_t=new F,N_t=new F,jX=new F,F_t=new m,B_t=new m,k_t=new m,ebe=new Array(8);for(let e=0;e<8;e++)ebe[e]=new m;function $xe(e,t,n){return Math.abs(oe.dot(e,t))<n}function U_t(e){let t=F.getColumn(e,0,F_t),n=F.getColumn(e,1,B_t),i=F.getColumn(e,2,k_t),r=D.EPSILON4;return $xe(t,n,r)&&$xe(n,i,r)}function V_t(e,t){let n=ebe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return On.fromPoints(n,t)}function qX(e,t,n,i,r,o,s,a){let c=Ko.DefaultMinBounds,u=Ko.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,h=c.z,x=u.z;if(e===f&&t===d&&n===p&&i===g&&r===h&&o===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;o<r&&(o+=D.TWO_PI);let C=o-r,A=r+C*.5,T=D_t,S=0;T[S++]=r,T[S++]=o,T[S++]=A,C>D.PI&&(T[S++]=A-D.PI_OVER_TWO,T[S++]=A+D.PI_OVER_TWO);let v=1,I=1,O=-1,R=-1;for(let J=0;J<S;++J){let W=T[J]-A,K=Math.cos(W),Z=Math.sin(W),he=K*e,ge=Z*e,se=K*t,pe=Z*t;v=Math.min(v,he),I=Math.min(I,ge),v=Math.min(v,se),I=Math.min(I,pe),O=Math.max(O,he),R=Math.max(R,ge),O=Math.max(O,se),R=Math.max(R,pe)}let L=O-v,N=R-I,_=i-n,E=(v+O)*.5,w=(I+R)*.5,P=(n+i)*.5,M=m.fromElements(E,w,P,R_t),B=$.fromRotationZ(A,O_t),V=m.fromElements(L,N,_,Qxe),U=F.fromScale(V,N_t),G=F.fromRotation(B,L_t),k=F.fromTranslation(M,M_t),Y=F.multiplyTransformation(G,F.multiplyTransformation(k,U,jX),jX),j=F.multiplyTransformation(s,Y,jX);return U_t(j)?On.fromTransformation(j,a):V_t(j,a)}var Gh=Ko;function Hl(){this.orientedBoundingBox=new On,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new ce,this._minimumHeight=Hl.DefaultMinBounds.z,this._maximumHeight=Hl.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new m,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new m,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeCosSqrHalfMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new H,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var z_t=new m,H_t=new $,tbe=new m,nbe=new m,ibe=new m,rbe=new m,G_t=new ce;Hl.prototype.update=function(e,t,n,i,r){i=y(i,Hl.DefaultMinBounds),r=y(r,Hl.DefaultMaxBounds);let o=Hl.DefaultMinBounds.x,s=Hl.DefaultMaxBounds.x,a=s-o,c=.5*a,u=Hl.DefaultMinBounds.y,f=Hl.DefaultMaxBounds.y,d=f-u,p=D.EPSILON10,g=D.EPSILON3,h=D.EPSILON10,x=D.EPSILON10,b=D.EPSILON3,C=D.clamp(t.x,o,s),A=D.clamp(n.x,o,s),T=D.clamp(i.x,o,s),S=D.clamp(r.x,o,s),v=Math.max(C,T),I=Math.min(A,S),O=D.clamp(t.y,u,f),R=D.clamp(n.y,u,f),L=D.clamp(i.y,u,f),N=D.clamp(r.y,u,f),_=Math.max(O,L),E=Math.min(R,N),w=F.getScale(e,z_t),P=w.x===w.y&&w.y===w.z,M=m.minimumComponent(w),B=Math.max(t.z,-M),V=Math.max(n.z,-M),U=Math.max(i.z,-M),G=Math.max(r.z,-M),k=Math.max(B,U),Y=Math.min(V,G),j=m.add(w,m.fromElements(B,B,B,nbe),nbe),J=m.add(w,m.fromElements(V,V,V,tbe),tbe),W=m.maximumComponent(J),K=m.add(w,m.fromElements(k,k,k,rbe),rbe),Z=m.add(w,m.fromElements(Y,Y,Y,ibe),ibe);if(_>E||_===f||E===u||k>Y||D.equalsEpsilon(Z,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,O,A,R),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(w,this._ellipsoid),this._minimumHeight=B,this._maximumHeight=V;let he=ce.fromRadians(v,_,I,E,G_t);this.orientedBoundingBox=obe(he,k,Y,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,J,H_t),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ge=I<v,se=I-v+ge*a,pe=se<=h,xe=se>c+h&&se<a-h,Pe=se>=c-h&&se<=c+h,we=se>h&&se<c-h,Se=pe||xe||Pe||we,nt=A<C,Ze=A-C+nt*a,Gt=Ze<=h,fn=Ze>c+h&&Ze<a-h,pt=Ze>=c-h&&Ze<=c+h,Tn=Ze>h&&Ze<c-h,Vn=Gt||fn||pt||Tn,Ut=E<-b,Pt=E>=-b&&E<=+b,Ce=E>+b&&E<f-x,ve=Ut||Pt||Ce,ot=_>u+x&&_<-b,Kt=_>=-b&&_<=+b,_i=_>+b,Je=ot||Kt||_i,ho=ve||Je,vr=R-O,zo=R<-b,os=R>=-b&&R<=+b,ke=R>+b&&R<f-x,st=zo||os||ke,Ke=O>u+x&&O<-b,He=O>=-b&&O<=+b,dt=O>+b,hn=st||(Ke||He||dt),Hi=!m.equals(K,m.ZERO),Rr=!m.equals(Z,m.ZERO),ss=Hi||Rr,As=Y-k,io=!m.equals(j,m.ZERO),Xi=!m.equals(J,m.ZERO),Ao=io||Xi,jn=this.shaderUniforms,Fn=this.shaderDefines;for(let gi in Fn)Fn.hasOwnProperty(gi)&&(Fn[gi]=void 0);jn.ellipsoidRadiiUv=m.divideByScalar(J,W,jn.ellipsoidRadiiUv),jn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(jn.ellipsoidRadiiUv,jn.ellipsoidRadiiUv,jn.ellipsoidInverseRadiiSquaredUv),jn.ellipsoidInverseRadiiSquaredUv);let Ln=0;if(Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ln,Ln+=1,ss&&(As===0&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),Hi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ln,Ln+=1,jn.ellipsoidInverseInnerScaleUv=W/(W-(V-k))),Rr&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,jn.ellipsoidInverseOuterScaleUv=W/(W-(V-Y)))),Ao){if(io){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let gi=(V-B)/W;jn.ellipsoidInverseHeightDifferenceUv=1/gi,jn.ellipseInnerRadiiUv=H.fromElements(jn.ellipsoidRadiiUv.x*(1-gi),jn.ellipsoidRadiiUv.z*(1-gi),jn.ellipseInnerRadiiUv)}B===V&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Se&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ln,xe?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ln+=1):we?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ln+=2):Pe?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,Ln+=1):pe&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ln+=2),jn.ellipsoidRenderLongitudeMinMax=H.fromElements(v,I,jn.ellipsoidRenderLongitudeMinMax)),Vn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,A<C&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let Ws=a/Ze,as=-(C-o)/Ze;jn.ellipsoidUvToShapeUvLongitude=H.fromElements(Ws,as,jn.ellipsoidUvToShapeUvLongitude)}if(Se){let gi=D.equalsEpsilon(v,o,void 0,g),Ws=D.equalsEpsilon(I,s,void 0,g);gi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Ws&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let as=(C-o)/a,td=(A-o)/a,La=(I-o)/a,ha=1-se/a,nd=(La+.5*ha)%1;jn.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(as,td,nd,jn.ellipsoidShapeUvLongitudeMinMaxMid)}if(ho){Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,Je&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ln,ot?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ln+=1):Kt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ln+=1):_i&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ln+=2)),ve&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ln,Ut?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ln+=2):Pt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ln+=1):Ce&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ln+=1)),_===E&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let gi=Math.pow(Math.cos(D.PI_OVER_TWO-Math.abs(_)),2),Ws=Math.pow(Math.cos(D.PI_OVER_TWO-Math.abs(E)),2);jn.ellipsoidRenderLatitudeCosSqrHalfMinMax=H.fromElements(gi,Ws,jn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(hn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,O===R&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let gi=d/vr,Ws=(u-O)/vr;jn.ellipsoidUvToShapeUvLatitude=H.fromElements(gi,Ws,jn.ellipsoidUvToShapeUvLatitude)}return P&&(Fn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=Ln,!0};var W_t=new ce;Hl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ce.subsection(this._rectangle,s,c,a,u,W_t),g=D.lerp(this._minimumHeight,this._maximumHeight,f),h=D.lerp(this._minimumHeight,this._maximumHeight,d);return obe(p,g,h,this._ellipsoid,this._translation,this._rotation,r)};Hl.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,r=this._maximumHeight;return .5*((r-i)/(n+r))/e.z};function obe(e,t,n,i,r,o,s){return s=On.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Hl.DefaultMinBounds=Object.freeze(new m(-D.PI,-D.PI_OVER_TWO,-Number.MAX_VALUE));Hl.DefaultMaxBounds=Object.freeze(new m(+D.PI,+D.PI_OVER_TWO,+Number.MAX_VALUE));var OC=Hl;var zu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};zu.getMinBounds=function(e){switch(e){case zu.BOX:return Hh.DefaultMinBounds;case zu.ELLIPSOID:return OC.DefaultMinBounds;case zu.CYLINDER:return Gh.DefaultMinBounds}};zu.getMaxBounds=function(e){switch(e){case zu.BOX:return Hh.DefaultMaxBounds;case zu.ELLIPSOID:return OC.DefaultMaxBounds;case zu.CYLINDER:return Gh.DefaultMaxBounds}};zu.getShapeConstructor=function(e){switch(e){case zu.BOX:return Hh;case zu.ELLIPSOID:return OC;case zu.CYLINDER:return Gh}};var Yi=Object.freeze(zu);function oB(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new iB;let t=this,n;l(e.url)&&(Q("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(e.url).then(function(i){let r=Ie.createIfNeeded(i);return r.fetchJson().then(function(o){return n=o,cbe(n),ube(n,r).load()}).then(function(o){let s=n.root,a=s.content.extensions["3DTILES_content_voxels"],c=a.class,u=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,f=o.schema,d=new ay({metadataJson:u,schema:f});fbe(t,d,c);let p=new cy(r,s,f),{shape:g,minBounds:h,maxBounds:x,shapeTransform:b,globalTransform:C}=lbe(s);t.shape=g,t.minBounds=h,t.maxBounds=x,t.dimensions=m.unpack(a.dimensions),t.shapeTransform=b,t.globalTransform=C,t.maximumTileCount=abe(d);let A,T;return l(a.padding)&&(A=m.unpack(a.padding.before),T=m.unpack(a.padding.after)),t.paddingBefore=A,t.paddingAfter=T,t._implicitTileset=p,ki.unload(o),t._ready=!0,t})}))}Object.defineProperties(oB.prototype,{readyPromise:{get:function(){return Q("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});oB.fromUrl=async function(e){let t=Ie.createIfNeeded(e),n=await t.fetchJson();cbe(n);let i=ube(n,t);await i.load();let r=n.root,o=r.content.extensions["3DTILES_content_voxels"],s=o.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new ay({metadataJson:a,schema:c}),f=new oB;fbe(f,u,s);let d=new cy(t,r,c),{shape:p,minBounds:g,maxBounds:h,shapeTransform:x,globalTransform:b}=lbe(r);f.shape=p,f.minBounds=g,f.maxBounds=h,f.dimensions=m.unpack(o.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=abe(u);let C,A;return l(o.padding)&&(C=m.unpack(o.padding.before),A=m.unpack(o.padding.after)),f.paddingBefore=C,f.paddingAfter=A,f._implicitTileset=d,ki.unload(i),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function abe(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Dx.TILESET_TILE_COUNT)}function cbe(e){let t=e.root;if(!l(t.content))throw new de("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function lbe(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return q_t(t.box,n);if(l(t.region))return j_t(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return Y_t(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function j_t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=F.fromScale(re.WGS84.radii),c=t,u=i,f=n,d=r,p=o,g=s,h=new m(c,f,p),x=new m(u,d,g);return{shape:Yi.ELLIPSOID,minBounds:h,maxBounds:x,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function q_t(e,t){let n=On.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Yi.BOX,minBounds:m.clone(Hh.DefaultMinBounds),maxBounds:m.clone(Hh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Y_t(e,t){let n=On.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Yi.CYLINDER,minBounds:m.clone(Gh.DefaultMinBounds),maxBounds:m.clone(Gh.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function ube(e,t){let{schemaUri:n,schema:i}=e;return l(n)?ki.getSchemaLoader({resource:t.getDerivedResource({url:n})}):ki.getSchemaLoader({schema:i})}function fbe(e,t,n){let{schema:i,statistics:r}=t,o=r?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:h}=p,x=o?.properties[d].min,b=o?.properties[d].max,C=qt.getComponentCount(g),A=sbe(x,C),T=sbe(b,C);return{id:d,type:g,componentType:h,minValue:A,maxValue:T}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function sbe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function X_t(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),r=await i.fetchArrayBuffer(),o=sh(r);return await rB.fromJson(i,o.jsonPayload,o.binaryPayload,e.metadataSchema)}async function K_t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=sh(a);return r=await Px.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}oB.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),r=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new cb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return K_t(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?X_t(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var YX=oB;function XX(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(XX.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});XX.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=m.fromElements(i,r,o,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var sB=XX;var KX={CUMULUS:0};KX.validate=function(e){return e===KX.CUMULUS};var qS=Object.freeze(KX);function Sm(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var J_t=Sm.SHOW_INDEX=0,Z_t=Sm.POSITION_INDEX=1,$_t=Sm.SCALE_INDEX=2,Q_t=Sm.MAXIMUM_SIZE_INDEX=3,egt=Sm.SLICE_INDEX=4,tgt=Sm.BRIGHTNESS_INDEX=5,ngt=Sm.COLOR_INDEX=6;Sm.NUMBER_OF_PROPERTIES=7;function MC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Sm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,MC(this,J_t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),MC(this,Z_t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),MC(this,$_t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),MC(this,Q_t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),MC(this,ngt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,MC(this,egt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,MC(this,tgt))}}});Sm.prototype._destroy=function(){this._cloudCollection=void 0};var Hu=Sm;var Gu,zH=new m,igt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},rgt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},ogt=Hu.SHOW_INDEX,sgt=Hu.POSITION_INDEX,agt=Hu.SCALE_INDEX,cgt=Hu.MAXIMUM_SIZE_INDEX,lgt=Hu.SLICE_INDEX,ugt=Hu.BRIGHTNESS_INDEX,fgt=Hu.NUMBER_OF_PROPERTIES,dgt=Hu.COLOR_INDEX;function vm(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(fgt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:dbe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function dbe(e){return function(){return zH.x=e._textureSliceWidth,zH.y=e._noiseTextureRows,zH.z=1/e._noiseTextureRows,zH}}Object.defineProperties(vm.prototype,{length:{get:function(){return ZX(this),this._clouds.length}}});function mbe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}vm.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,qS.CUMULUS),n;return t===qS.CUMULUS&&(n=new Hu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};vm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};vm.prototype.removeAll=function(){mbe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function ZX(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}vm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};vm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};vm.prototype.get=function(e){return ZX(this),this._clouds[e]};var mgt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),hgt=new Uint16Array([0,1,2,0,2,3]);function pgt(e){let t=mt.createVertexBuffer({context:e,typedArray:mgt,usage:Fe.STATIC_DRAW}),n=mt.createIndexBuffer({context:e,typedArray:hgt,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new si({context:e,attributes:i,indexBuffer:n})}var $X;function _gt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function ggt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Be.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function ygt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function xgt(e,t,n){let i=[{index:Gu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Gu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Gu.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Gu.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Gu.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:Gu.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:ygt(e)});let r=n?t:4*t;return new Wp(e,i,r,n)}var JX=new Yn;function hbe(e,t,n,i){let r,o=n[Gu.positionHighAndScaleX],s=n[Gu.positionLowAndScaleY],a=i.position;Yn.fromCartesian(a,JX);let c=i.scale,u=JX.high,f=JX.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function pbe(e,t,n,i){let r,o=n[Gu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function _be(e,t,n,i){let r,o=n[Gu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function gbe(e,t,n,i){let r,o=n[Gu.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function bgt(e,t,n,i){hbe(e,t,n,i),pbe(e,t,n,i),_be(e,t,n,i),gbe(e,t,n,i)}function Cgt(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=pgt(a),r._spNoise=Jt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Lt({context:a,width:o*o/s,height:o*s,pixelDatatype:Xe.UNSIGNED_BYTE,pixelFormat:ct.RGBA,sampler:new mn({wrapS:In.REPEAT,wrapT:In.REPEAT,minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST})});let f=new ef({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:dbe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function Tgt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=xgt(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];bgt(e,t,s,c)}n._vaf.commit($X(i))}}var Agt=[];function Egt(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=Agt;u.length=0,(c[sgt]||c[agt])&&u.push(hbe),(c[ogt]||c[ugt])&&u.push(pbe),(c[cgt]||c[lgt])&&u.push(_be),c[dgt]&&u.push(gbe);let f=u.length,d=i._vaf.writers,p,g,h;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._vaf.commit($X(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Sgt(e,t,n,i){let r=t.context,o=e,s=new ze({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new ze({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Jt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Gu}),o._rs=Ue.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:dn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function vgt(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new tt),f.pass=Ee.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}vm.prototype.update=function(e){if(ZX(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&Cgt(this,e,BN,FN),this._instanced=e.context.instancedArrays,Gu=this._instanced?rgt:igt,$X=this._instanced?ggt:_gt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?Tgt(this,e):o>0&&Egt(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Sgt(this,e,NN,LN),vgt(this,e))};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),mbe(this._clouds),ue(this)};var QX=vm;async function eK(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;l(n._readyPromise)?await n._readyPromise:l(n.readyPromise)&&await n.readyPromise;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return o;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await eK._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,h){return l(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}eK._sampleTerrainMostDetailed=v_;var LC=eK;var wgt=D.toRadians(30);function tK(e){this._angle=y(e,wgt)}Object.defineProperties(tK.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});tK.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=m.fromElements(r,o,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var nK=tK;var Igt=new z,Pgt=new z,Dgt=new z,Rgt=new z,ybe=new oe,aB=new Uint8Array(4);function xbe(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function HH(e,t){return{height:e,color:z.clone(t)}}function bbe(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function Ogt(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],h=D.clamp(g.height,Gl._minimumHeight,Gl._maximumHeight),x=z.clone(g.color,Igt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(HH(h,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],h=c[n+1];u=u&&g.height<=h.height,f=f&&g.height>=h.height}f?c=c.reverse():u||L_(c,function(g,h){return D.sign(g.height-h.height)});let d=y(o.extendDownwards,!1),p=y(o.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,HH(Gl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,HH(Gl._maximumHeight,c[c.length-1].color)),c=bbe(c),i.push(c)}return i}function Mgt(e){let t=Ogt(e),n=[],i=[],r;function o(u,f){n.push(HH(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Rgt);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let h=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,C=d<g?i[d]:void 0,A=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(h)&&l(C)&&h.height===C.height){let S=l(T)&&C.height===T.height,v=!l(A),I=!l(T),O=l(b)&&h.height===b.height,R=!l(x),L=!l(b);S?O?(s(h.height,h.color,C.color),s(h.height,b.color,T.color)):R?(o(h.height,C.color),s(h.height,h.color,T.color)):L?(s(h.height,h.color,C.color),o(h.height,T.color)):(s(h.height,h.color,C.color),s(h.height,h.color,T.color)):v?O?(o(h.height,h.color),s(h.height,b.color,C.color)):L?(o(h.height,h.color),o(h.height,C.color)):(R||o(h.height,h.color),s(h.height,h.color,C.color)):I?O?(s(h.height,h.color,C.color),o(h.height,b.color)):R?(o(h.height,C.color),o(h.height,h.color)):L?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),o(h.height,h.color)):O?(s(h.height,h.color,C.color),s(h.height,b.color,C.color)):R?(o(h.height,C.color),s(h.height,h.color,C.color)):L?(s(h.height,h.color,C.color),o(h.height,C.color)):s(h.height,h.color,C.color),f+=O?2:1,d+=S?2:1}else if(l(h)&&l(C)&&l(A)&&h.height<C.height){let S=xbe(h.height,A,C,Dgt);l(x)?l(b)?s(h.height,h.color,S):(s(h.height,h.color,S),o(h.height,S)):(o(h.height,S),s(h.height,h.color,S)),f++}else if(l(C)&&l(h)&&l(x)&&C.height<h.height){let S=xbe(C.height,x,h,Pgt);l(A)?l(T)?s(C.height,S,C.color):(s(C.height,S,C.color),o(C.height,S)):(o(C.height,S),s(C.height,S,C.color)),d++}else l(h)&&(!l(C)||h.height<C.height)?(l(C)&&!l(A)&&!l(b)?(o(h.height,h.color),o(h.height,Gl._emptyColor),o(C.height,Gl._emptyColor)):(!l(C)&&l(A)&&!l(x)&&(o(A.height,Gl._emptyColor),o(h.height,Gl._emptyColor)),o(h.height,h.color)),f++):l(C)&&(!l(h)||C.height<h.height)&&(o(C.height,C.color),d++)}}return bbe(n)}function Gl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,r=Mgt(n),o=r.length,s,a,c;if(!Gl._useFloatTexture(i)){a=Xe.UNSIGNED_BYTE,c=ct.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)oe.packFloat(r[g].height,ybe),oe.pack(ybe,s,g*4)}else{a=Xe.FLOAT,c=i.webgl2?ct.RED:ct.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Lt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(aB),d[g*4+0]=aB[0],d[g*4+1]=aB[1],d[g*4+2]=aB[2],d[g*4+3]=aB[3];let p=Lt.create({context:i,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.LINEAR,magnificationFilter:Ai.LINEAR})});return Wi.fromType("ElevationBand",{heights:f,colors:p})}Gl._useFloatTexture=function(e){return e.floatingPointTexture};Gl._maximumHeight=5906376425472;Gl._minimumHeight=-5906376425472;Gl._emptyColor=new z(0,0,0,0);var iK=Gl;async function Lgt(e,t){e=y(e,iC.defaultApiKey);let n,i=iC.getDefaultApiKeyCredit(e);l(i)&&(n=[i]),t=y(t,{}),t.showCreditsOnScreen=!0;let r=new Ie({url:`${iC.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return Ns.fromUrl(r,t)}var rK=Lgt;function Ngt(e){Q("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),e=gt(e,{url:Zs.fromAssetId(96188)});let t=new Ns(e),n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new J_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var oK=Ngt;async function Fgt(e){let t=await Ns.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new J_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var sK=Fgt;function Bgt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=F.clone(y(e.modelMatrix,F.IDENTITY)),o=y(e.length,1e4);if(l(i.normal)&&t.push(new Ct({geometry:Bn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new zt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Ct({geometry:Bn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new zt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Ct({geometry:Bn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new zt(0,0,1,1)},modelMatrix:r})),t.length>0)return new wn({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var aK=Bgt;function kgt(e){Q("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Cm.AERIAL),n=new Hf;return Hf._initialize(n,t,e),n}var cK=kgt;function cB(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } +`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } +`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } +`;break;case"vec4":o=`vec4 getColor() { return ${r}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${r}; void main() { - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${r}; +${o} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=or.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(cB.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});cB.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;cB.prototype.isTranslucent=or.prototype.isTranslucent;cB.prototype.getRenderState=or.prototype.getRenderState;var lK=cB;function GH(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}GH.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:Wo.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Zt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:Wo.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Zt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new Ct({geometry:new w_({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:Wo.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Zt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new wn({geometryInstances:[t,n,i],appearance:new Wo,asynchronous:!1})}this._primitive.update(e)}};GH.prototype.isDestroyed=function(){return!1};GH.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var lB=GH;function Ugt(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var uK=Ugt;var uB=`in vec3 v_positionMC; +in vec3 v_positionEC; +in vec2 v_st; - vec4 burst = vec4(0.0); +void main() +{ + czm_materialInput materialInput; - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} + vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + materialInput.s = v_st.s; + materialInput.st = v_st; + materialInput.str = vec3(v_st, 0.0); - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + // Convert tangent space material normal to eye space + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); - // End of manual loop unrolling. + // Convert view vector to world space + vec3 positionToEyeEC = -v_positionEC; + materialInput.positionToEyeEC = positionToEyeEC; - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + czm_material material = czm_getMaterial(materialInput); - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif } -`;var f2=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; +`;var fB=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec2 st; +in float batchId; -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;function m2(){this.show=!0,this._drawCommand=new et({primitiveType:Be.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(m2.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Syt=new H,vyt=new H,wyt=new oe,d2=new oe;m2.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!u(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(o,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let w=n?r.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._texture=new Rt({context:r,width:S,height:S,pixelFormat:at.RGBA,pixelDatatype:w}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,M={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new Yu({fragmentShaderSource:u2,outputTexture:this._texture,uniformMap:M,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!u(a.vertexArray)){let S={direction:0},w=new Uint8Array(4*2);w[0]=0,w[1]=0,w[2]=255,w[3]=0,w[4]=255,w[5]=255,w[6]=0,w[7]=255;let D=mt.createVertexBuffer({context:r,typedArray:w,usage:Ne.STATIC_DRAW}),M=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],O=mt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new oi({context:r,attributes:M,indexBuffer:O}),a.shaderProgram=Kt.fromCache({context:r,vertexShaderSource:f2,fragmentShaderSource:l2,attributeLocations:S}),a.renderState=Ve.fromCache({blending:dn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,l=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=l.z,d.center.y=l.x,d.center.z=l.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=$i.computeActualWgs84Position(e,c,d2),g=m.magnitude(m.subtract(p,e.camera.position,d2)),h=r.uniformState.projection,A=wyt;A.x=0,A.y=0,A.z=-g,A.w=1;let x=N.multiplyByVector(h,A,d2),C=$i.clipToGLWindowCoordinates(t.viewport,x,Syt);A.x=P.SOLAR_RADIUS;let T=N.multiplyByVector(h,A,d2),E=$i.clipToGLWindowCoordinates(t.viewport,T,vyt);return this._size=H.magnitude(H.subtract(E,C,d2)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};m2.prototype.isDestroyed=function(){return!1};m2.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var h2=m2;function NH(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,Iyt(this,e)}Object.defineProperties(NH.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});NH.fromWorldTerrain=function(e){return new NH(Zx(e))};function Dyt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Iyt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){Dyt(e._errorEvent,i)}}var p2=NH;function YS(){}YS.prototype.boundingVolume=void 0;YS.prototype.boundingSphere=void 0;YS.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};YS.prototype.intersectPlane=function(e){fe.throwInstantiationError()};YS.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var bK=YS;function _2(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=u(e.tilingScheme)?e.tilingScheme:new ji({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(_2.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});_2.prototype.getTileCredits=function(e,t,n){};_2.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};_2.prototype.pickFeatures=function(e,t,n,i,r){};var g2=_2;function SK(e){fe.throwInstantiationError()}SK.prototype.isReady=fe.throwInstantiationError;SK.prototype.shouldDiscardImage=fe.throwInstantiationError;var vK=SK;var Pyt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},wK=Object.freeze(Pyt);function UC(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.shadows=y(e.shadows,xn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Jm(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Np,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(UC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(u(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return $("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function Oyt(e){return`uniform vec4 czm_pickColor; -${e}`}function Myt(e){return function(t){return _t(t,{czm_pickColor:function(){return e._pickId.color}})}}function Ryt(){return"czm_pickColor"}UC.prototype.makeStyleDirty=function(){this._styleDirty=!0};UC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Byt=new ee;function IK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function FC(e,t){return e._intervals.indexOf(t.start)}function Lyt(e,t){let n=e._intervals,i=e._clock,r=IK(e);if(r===0)return;let o=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,o*r,Byt),a=n.indexOf(s),c=FC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function Nyt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function Fyt(e,t,n){let i=IK(e),r=FC(e,t),o=FC(e,n);return i>=0?r>=o:r<=o}function txe(e,t){return function(n){let i=u(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Uyt(e,t,n){let i=FC(e,t),r=e._frames,o=r[i];if(!u(o)){let s=t.data.transform,a=u(s)?N.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:Ai(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,we.fetchArrayBuffer({url:c}).then(function(l){o.pointCloud=new CF({arrayBuffer:l,cull:!0,fragmentShaderLoaded:Oyt,uniformMapLoaded:Myt(e),pickIdLoaded:Ryt})}).catch(txe(e,c))}return o}function Vyt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function kyt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(u(r)&&!t.ready){let o=i.commandList,s=o.length;if(nxe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(Ai()-t.timestamp)/1e3;Vyt(e,a)}}t.touchedFrameNumber=i.frameNumber}var zyt=new N;function Hyt(e,t){let n=e.shading;return u(n)&&u(n.baseResolution)?n.baseResolution:u(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Gyt(e){let t=e.shading;return u(t)&&u(t.maximumAttenuation)?t.maximumAttenuation:10}var Wyt=new Jm;function nxe(e,t,n,i){let r=y(e.shading,Wyt),o=t.pointCloud,s=y(t.transform,N.IDENTITY);o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,zyt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=Hyt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=Gyt(e);try{o.update(i)}catch(a){txe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function DK(e,t,n,i){let r=Uyt(e,t,i);kyt(e,r,n,i)}function jyt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function ixe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(u(o)&&(!u(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),u(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function qyt(e,t){let n=FC(e,t),i=e._frames[n];if(u(i)&&i.ready)return i}function exe(e,t,n,i,r){return u(n)?n.ready?!0:(DK(e,t,i,r),n.ready):!1}function Yyt(e,t,n,i,r){let o,s,a,c=e._intervals,l=e._frames,f=FC(e,n),d=FC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=l[o],exe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=l[o],exe(e,s,a,i,r))return s;return t}function Xyt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];u(s)&&u(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var XS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};UC.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;u(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),u(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=u(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&Xyt(this,r,s),XS.timeSinceLoad=t,XS.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,l=e.commandList,f=l.length,d=this._previousInterval,p=this._nextInterval,g=Nyt(this);if(!u(g))return;let h=!1,A=IK(this),x=A===0;A!==this._clockMultiplier&&(h=!0,this._clockMultiplier=A),(!u(d)||x)&&(d=g),(!u(p)||h||Fyt(this,g,p))&&(p=Lyt(this,g)),d=Yyt(this,d,g,XS,e);let C=qyt(this,d);u(C)||(DK(this,d,XS,e),C=this._lastRenderedFrame),u(C)&&nxe(this,C,XS,e),u(p)&&DK(this,p,XS,e);let T=this;u(C)&&!u(this._lastRenderedFrame)&&e.afterRender.push(function(){return T._resolveReadyPromise(T),!0}),u(C)&&C!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let E=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;E>S&&ixe(this,jyt(e));let D=l.length-f;u(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};UC.prototype.isDestroyed=function(){return!1};UC.prototype.destroy=function(){return ixe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var KS=UC;var y2=` -in vec2 v_textureCoordinates; +out vec3 v_positionMC; +out vec3 v_positionEC; +out vec2 v_st; void main() { - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); + vec4 p = czm_computePosition(); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); + v_positionMC = position3DHigh + position3DLow; // position in model coordinates + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function FH(e,t){this.show=!0,u(e)||(e=new Ye),this.rectangle=Ye.clone(e),u(t)||(t=Wi.fromType(Wi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}FH.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!u(t)||!Ye.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:dn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!u(this._overlayCommand)){this._material=this.material,u(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new ke({sources:[this._material.shaderSource,y2]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=ve.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};FH.prototype.isDestroyed=function(){return!1};FH.prototype.destroy=function(){return u(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var PK=FH;function m0(e,t,n,i,r,o,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let A=0;A<a;A++){let x=i[A],C=qt.getComponentCount(x),T=r[A];this.megatextures[A]=new VS(t,n,C,T,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let l=e._shape;this.rootNode=new a2(0,0,0,0,void 0,l,n),this._priorityQueue=new Qx({maximumLength:c,comparator:er.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=o,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(o);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[o-1]=0,OK(f,1,o-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Rt({context:t,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new fn({minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function OK(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,OK(e,t,r-1,i+1),OK(e,r+1,n,i+1)}m0.simultaneousRequestCountMaximum=50;m0.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,l=c>0,f=a>1,d=(l?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!u(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Rt({context:o,pixelFormat:at.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new fn({minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&u(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&rxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ai();Zyt(this,e);let h=Ai();$yt(this,d,c);let A=Ai();if(this._debugPrint){let x=h-g,C=A-h,T=A-g;Qyt(this,x,C,T)}};m0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function rxe(e,t){let n=e._primitive,i=n._shape,r=n._provider.dimensions;if(t.computeBoundingVolumes(i,r),u(t.children))for(let o=0;o<8;o++){let s=t.children[o];rxe(e,s)}}function Kyt(e,t){if(e._simultaneousRequestCount>=m0.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function r(l){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!u(l))t.state=er.LoadState.UNAVAILABLE;else if(l===er.LoadState.FAILED)t.state=er.LoadState.FAILED;else if(!Array.isArray(l)||l.length!==f)t.state=er.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x:A,y:x,z:C}=g,T=A*x*C,E=l[p],S=T*h;if(E.length===S)t.metadatas[p]=E,t.state=er.LoadState.RECEIVED;else{t.state=er.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=er.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});u(c)?(e._simultaneousRequestCount++,t.state=er.LoadState.RECEIVING,c.then(r).catch(o)):t.state=er.LoadState.FAILED}function Jyt(e){return e/(1+e)}function Zyt(e,t){let n=e._frameNumber,i=e._primitive,r=i._shape,{dimensions:o}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,l=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:A}=d,C=p.drawingBufferHeight/g/A.sseDenominator;function T(b,v,I){let R=Math.min(Math.abs(v-b),Math.abs(v-I)),F=Math.max(b,l-I-1,1),k=Math.pow(1-R/F,4),V=Math.exp(-e._binaryTreeKeyframeWeighting[v]);return P.lerp(V,k,.15+.85*k)}function E(b,v){if(b.computeScreenSpaceError(h,C),v=b.visibility(t,v),v===es.MASK_OUTSIDE)return;b.visitedFrameNumber=n;let I=P.clamp(Math.floor(c),0,l-2),R=I+1;if(l===1)b.createKeyframeNode(0);else if(b.keyframeNodes.length!==l)for(let U=0;U<l;U++)b.createKeyframeNode(U);let F=Jyt(b.screenSpaceError),k=!1,V=b.keyframeNodes;for(let U=0;U<V.length;U++){let Y=V[U];Y.priority=10*F+T(I,Y.keyframe,R),Y.state!==er.LoadState.UNAVAILABLE&&Y.state!==er.LoadState.FAILED&&Y.priority!==-Number.MAX_VALUE&&a.insert(Y),Y.state===er.LoadState.LOADED&&(k=!0)}if(b.screenSpaceError<s||!k){b.children=void 0;return}u(b.children)||b.constructChildNodes(r,o);for(let U=0;U<8;U++){let Y=b.children[U];E(Y,v)}}a.reset(),E(f,es.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,w=0,D;for(;a.length>0;)D=a.removeMaximum(),D.highPriorityFrameNumber=n,S[w]=D,w++;let M=e._keyframeNodesInMegatexture,O=e.megatextures[0],B=O.occupiedCount;M.length=B,M.sort(function(b,v){return b.highPriorityFrameNumber===v.highPriorityFrameNumber?v.priority-b.priority:v.highPriorityFrameNumber-b.highPriorityFrameNumber});let L=0,_=0;for(let b=0;b<w;b++)if(D=S[b],!(D.state===er.LoadState.LOADED||D.spatialNode===void 0)&&(D.state===er.LoadState.UNLOADED&&Kyt(e,D),D.state===er.LoadState.RECEIVED)){let v=0;if(O.isFull()){v=B-1-L,L++;let I=M[v];I.spatialNode.destroyKeyframeNode(I,e.megatextures)}else v=B+_,_++;D.spatialNode.addKeyframeNodeToMegatextures(D,e.megatextures),M[v]=D}}function Qyt(e,t,n,i){let r=e._keyframeCount,o=e.rootNode,s=Object.keys(er.LoadState).length,a=new Array(s),c=new Array(s),l=0;for(let C=0;C<s;C++){let T=new Array(r);a[C]=T;for(let E=0;E<r;E++)T[E]=0;c[C]=0}function f(C){let T=C.keyframeNodes;for(let E=0;E<T.length;E++){let S=T[E],w=S.keyframe,D=S.state;a[D][w]+=1,c[D]+=1,l++}if(u(C.children))for(let E=0;E<8;E++){let S=C.children[E];f(S)}}f(o);let d=`KEYFRAMES: ${a[er.LoadState.LOADED]}`,p=`UNLOADED: ${c[er.LoadState.UNLOADED]} | RECEIVING: ${c[er.LoadState.RECEIVING]} | RECEIVED: ${c[er.LoadState.RECEIVED]} | LOADED: ${c[er.LoadState.LOADED]} | FAILED: ${c[er.LoadState.FAILED]} | UNAVAILABLE: ${c[er.LoadState.UNAVAILABLE]} | TOTAL: ${l}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,A=Math.round(i*100)/100,x=`LOAD: ${g} | OCT: ${h} | ALL: ${A}`;console.log(`${d} || ${p} || ${x}`)}var UH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function $yt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,l=[],f=[];function d(g,h,A,x,C){let T=!1;if(u(g.children))for(let E=0;E<8;E++){let S=g.children[E];S.computeSurroundingRenderableKeyframeNodes(r),S.isRenderable(o)&&(T=!0)}if(T){l[C]=UH.INTERNAL<<16|h,l[A]=x,a++,x=h,C=x*9+1;for(let E=0;E<8;E++){let S=g.children[E];h=a,A=h*9+0,d(S,h,A,x,C+E)}}else{if(s){let E=c*5,S=g.renderableKeyframeNodePrevious,w=g.level-S.spatialNode.level,D=S.spatialNode.parent,M=u(D)?D.renderableKeyframeNodePrevious:S,O=e0t(g,i,n),B=w,L=1,_=S.megatextureIndex,b=M.megatextureIndex;f[E+0]=O,f[E+1]=B,f[E+2]=L,f[E+3]=_,f[E+4]=b,l[C]=UH.LEAF<<16|c}else{let E=g.renderableKeyframeNodePrevious,w=g.level-E.spatialNode.level===0?UH.LEAF:UH.PACKED_LEAF_FROM_PARENT;l[C]=w<<16|E.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),t0t(l,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&n0t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function e0t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function t0t(e,t,n,i){let r=at.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let h=0;h<r;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function n0t(e,t,n,i){let r=at.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),l=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],h=e[p*o+1],A=e[p*o+2],x=e[p*o+3],C=e[p*o+4],T=P.clamp(Math.floor(65536*g),0,65535);l[p*8+0]=T>>>0&255,l[p*8+1]=T>>>8&255,l[p*8+2]=h&255,l[p*8+3]=A&255,l[p*8+4]=x>>>0&255,l[p*8+5]=x>>>8&255,l[p*8+6]=C>>>0&255,l[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:l,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}m0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let r=0,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=i[s],l=qt.getComponentCount(a);r+=VS.getApproximateTextureMemoryByteLength(e,t,l,c)}return r};var JS=m0;var i0t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},ZS=Object.freeze(i0t);function QS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}QS.prototype.getTexture=function(e){return this._textures[e]};function r0t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];u(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}QS.prototype.loadTexture2D=function(e,t){u(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):r0t(this,e,t)};function o0t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?VH(r,o,n):s0t(r,o,n),a=e._textures[i];u(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function VH(e,t,n){let{typedArray:i,sampler:r}=e,o=u(i)?sxe(e,n):new Rt({context:n,source:t,sampler:r});return oxe(r)&&o.generateMipmap(),o}function s0t(e,t,n){let{typedArray:i,sampler:r}=e,o=oxe(r),s=r.wrapS===wn.REPEAT||r.wrapS===wn.MIRRORED_REPEAT||r.wrapT===wn.REPEAT||r.wrapT===wn.MIRRORED_REPEAT,{width:a,height:c}=u(i)?e:t,l=[a,c].every(P.isPowerOfTwo);if((o||s)&&!l)if(u(i)){if(e.pixelDatatype===Ke.UNSIGNED_BYTE){let d=pL(i,a,c),p=Og(d);return VH({sampler:r},p,n)}}else{let d=Og(t);return VH(e,d,n)}else return VH(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),sxe(e,n)}function oxe(e){return[cn.NEAREST_MIPMAP_NEAREST,cn.NEAREST_MIPMAP_LINEAR,cn.LINEAR_MIPMAP_NEAREST,cn.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function sxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}QS.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];o0t(this,r,t)}n.length=0};QS.prototype.isDestroyed=function(){return!1};QS.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var A2=QS;function x2(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Wp.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Gg.INHERIT),this._textureManager=new A2,this._defaultTexture=void 0,this.uniformMap=a0t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},u0t(this),f0t(this)}function a0t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===ZS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=c0t(e,i)):n[i]=l0t(e,i)}return n}function c0t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function l0t(e,t){return function(){return e.uniforms[t].value}}function VC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function u0t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,r,o=e.vertexShaderText;u(o)&&(r=e.usedVariablesVertex.attributeSet,VC(o,t,r),r=e.usedVariablesVertex.featureIdSet,VC(o,n,r),r=e.usedVariablesVertex.metadataSet,VC(o,i,r));let s=e.fragmentShaderText;if(u(s)){r=e.usedVariablesFragment.attributeSet,VC(s,t,r),r=e.usedVariablesFragment.featureIdSet,VC(s,n,r),r=e.usedVariablesFragment.metadataSet,VC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;VC(s,a,c)}}function axe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Tc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${axe(t)} is not available in the ${i} shader. Did you mean ${axe(n)} instead?`;throw new fe(r)}}function f0t(e){let t=e.usedVariablesVertex.attributeSet;Tc(t,"position","positionMC","vertex"),Tc(t,"normal","normalMC","vertex"),Tc(t,"tangent","tangentMC","vertex"),Tc(t,"bitangent","bitangentMC","vertex"),Tc(t,"positionWC","positionMC","vertex"),Tc(t,"positionEC","positionMC","vertex"),Tc(t,"normalEC","normalMC","vertex"),Tc(t,"tangentEC","tangentMC","vertex"),Tc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Tc(n,"position","positionEC","fragment"),Tc(n,"normal","normalEC","fragment"),Tc(n,"tangent","tangentEC","fragment"),Tc(n,"bitangent","bitangentEC","fragment"),Tc(n,"normalMC","normalEC","fragment"),Tc(n,"tangentMC","tangentEC","fragment"),Tc(n,"bitangentMC","bitangentEC","fragment")}x2.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===ZS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):u(t.clone)?n.value=t.clone(n.value):n.value=t};x2.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};x2.prototype.isDestroyed=function(){return!1};x2.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var kC=x2;function Gh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Gh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._compoundModelMatrix=new N,this._compoundModelMatrixOld=new N,this._customShader=y(e.customShader,Gh.DefaultCustomShader),this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new N,this._transformPositionUvToWorld=new N,this._transformDirectionWorldToLocal=new Q,this._transformNormalLocalToWorld=new Q,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Fd,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new N,transformPositionUvToView:new N,transformDirectionViewToLocal:new Q,transformNormalLocalToWorld:new Q,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new N,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let r in t)if(t.hasOwnProperty(r)){let o=`u_${r}`;n[o]=function(){return t[r]}}let i=this._provider;this._completeLoad=function(r,o){},this._readyPromise=d0t(this,i)}async function d0t(e,t){let n=new Promise(function(a){e._completeLoad=function(c,l){l.afterRender.push(function(){return c._ready=!0,a(c),!0})}});u(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:r=qi.getMinBounds(i),maxBounds:o=qi.getMaxBounds(i)}=t;e.minBounds=r,e.maxBounds=o,e.minClippingBounds=qi.getMinBounds(i),e.maxClippingBounds=qi.getMaxBounds(i),lxe(e,t);let s=qi.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=uxe(e,e._shape,t),n}Object.defineProperties(Gh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){cs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];u(e)?this._customShader=e:this._customShader=Gh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var m0t=new m,h0t=new oe,p0t=new oe,_0t=new m,g0t=new m,y0t=new Q,A0t=new Q,x0t=new N,C0t=new N,T0t=new N,E0t=N.fromRotationTranslation(Q.fromUniformScale(.5,new Q),new m(.5,.5,.5),new N),b0t=N.fromRotationTranslation(Q.fromUniformScale(2,new Q),new m(-1,-1,-1),new N);Gh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),u(t._ready)&&!t._ready||!u(this._shape))return;let n=e.context;if(!this._ready){S0t(this,t,n),this._completeLoad(this,e);return}let i=lxe(this,t),r=this._shape;if(i&&(this._shapeVisible=uxe(this,r,t),D0t(this,r)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let o=I0t(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,o,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&F0t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),P0t(this,e)&&(this._shaderDirty=!0);let l=s.leafNodeTexture,f=this._uniforms;u(l)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(XL(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=r.orientedBoundingBox,g=R0t(p,d,p0t);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let A=n.uniformState.inverseView;f.transformPositionViewToUv=N.multiplyTransformation(this._transformPositionWorldToUv,A,f.transformPositionViewToUv);let x=n.uniformState.view;f.transformPositionUvToView=N.multiplyTransformation(x,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Q.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Q.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=N.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let E=e.passes.pick?this._drawCommandPick:this._drawCommand;E.boundingVolume=r.boundingSphere,e.commandList.push(E)};function S0t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:r,shaderUniforms:o}=e._shape;e._shapeDefinesOld=We(r,!0);let s=e._uniformMap;for(let a in o)if(o.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return o[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=v0t(e,t,n),w0t(e._traversal,i)}function lxe(e,t){let n=y(t.shapeTransform,N.IDENTITY),i=y(t.globalTransform,N.IDENTITY);return N.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),N.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),C2(e,"_compoundModelMatrix","_compoundModelMatrixOld")+C2(e,"_minBounds","_minBoundsOld")+C2(e,"_maxBounds","_maxBoundsOld")+C2(e,"_minClippingBounds","_minClippingBoundsOld")+C2(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function C2(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}function uxe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let r=t.shapeTransform,o=N.inverse(r,x0t),s=N.getRotation(r,y0t),a=N.getScale(r,_0t),c=m.maximumComponent(a),l=m.divideByScalar(a,c,g0t),f=Q.multiplyByScale(s,l,A0t),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=N.multiplyTransformation(E0t,o,e._transformPositionWorldToUv),e._transformPositionUvToWorld=N.multiplyTransformation(r,b0t,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=N.getMatrix3(o,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Q.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function v0t(e,t,n){let i=m.clone(t.dimensions,m0t);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let r=t.maximumTileCount,o=u(r)?JS.getApproximateTextureMemoryByteLength(r,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new JS(e,n,i,t.types,t.componentTypes,s,o)}function w0t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],r=n.length;t.megatextureTextures=new Array(r);for(let o=0;o<r;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function D0t(e,t){let n=t.shaderDefines,i=Object.keys(n).some(r=>n[r]!==e._shapeDefinesOld[r]);return i&&(e._shapeDefinesOld=We(n,!0)),i}function I0t(e,t){if(!u(e)||!u(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/o;return r+a}function P0t(e,t){let n=e.clippingPlanes;if(!u(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=N.transpose(N.multiplyTransformation(N.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionUvToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}Gh.prototype.isDestroyed=function(){return!1};Gh.prototype.destroy=function(){let e=this._drawCommand;u(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return u(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var cxe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),O0t=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),M0t=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function R0t(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,C0t),r=N.multiply(t,i,T0t),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,l,f=M0t,d=cxe.length;for(l=0;l<d;l++)N.multiplyByVector(r,cxe[l],f[l]);for(l=0;l<d;l++){let p=f[l];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=O0t[l*3+g],A=f[h];if(A.z>=-A.w){let x=p.z+p.w,C=A.z+A.w,T=x/(x-C),E=oe.lerp(p,A,T,h0t),S=E.x/E.w,w=E.y/E.w;o=Math.min(o,S),s=Math.max(s,S),a=Math.min(a,w),c=Math.max(c,w)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(o,a,s,c,n),n}var MK=3e7,B0t=new m(MK,0,0),L0t=new m(0,MK,0),N0t=new m(0,0,MK);function F0t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,l,f,d){i.add({positions:[c,l],width:d,material:Wi.fromType("Color",{color:f})})}function o(c,l,f){let d=c.computeCorners();r(d[0],d[1],l,f),r(d[2],d[3],l,f),r(d[4],d[5],l,f),r(d[6],d[7],l,f),r(d[0],d[2],l,f),r(d[4],d[6],l,f),r(d[1],d[3],l,f),r(d[5],d[7],l,f),r(d[0],d[4],l,f),r(d[2],d[6],l,f),r(d[1],d[5],l,f),r(d[3],d[7],l,f)}function s(c){if(!n.isRenderable(c))return;let l=c.level,d=Math.max(1,5/Math.pow(2,l)),g=[z.RED,z.LIME,z.BLUE][l%3];if(o(c.orientedBoundingBox,g,d),u(c.children))for(let h=0;h<8;h++)s(c.children[h])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(m.ZERO,B0t,z.RED,a),r(m.ZERO,L0t,z.LIME,a),r(m.ZERO,N0t,z.BLUE,a),i.update(t)}Gh.DefaultCustomShader=new kC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function NC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Wi.fromType(Wi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,fB),this._fragmentShaderSource=y(e.fragmentShaderSource,uB),this._renderState=or.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(NC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return NC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});NC.VERTEX_FORMAT=Oe.POSITION_AND_ST;NC.prototype.getFragmentShaderSource=or.prototype.getFragmentShaderSource;NC.prototype.isTranslucent=or.prototype.isTranslucent;NC.prototype.getRenderState=or.prototype.getRenderState;var fK=NC;function Wl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Wl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Wl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Wl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Wl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Wl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new _e,this._nominalFrameRate=new _e,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){Vgt(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){zgt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Wl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Wl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Wl({scene:e})),e._frameRateMonitor};Object.defineProperties(Wl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Wl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Wl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function Vgt(e,t){if(e._pauseCount>0)return;let n=Ci();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function zgt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var dB=Wl;function Hgt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = ${n}.rgb; + float clippingPlanesEdgeWidth = ${n}.a; + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) + { + out_FragColor = clippingPlanesEdgeColor; + } +`}var mB=Hgt;var Cbe=Ki(Aq(),1);function dK(){this._image=new Image}dK.prototype.isReady=function(){return!0};dK.prototype.shouldDiscardImage=function(e){return e===this._image};function FC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new vt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new dK),this._errorEvent=new _e,this._ready=!1;let n=this,i,r;if(l(e.url)){Q("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let o=Ie.createIfNeeded(e.url);r=new pm(o)}l(e.metadata)&&(Q("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),r=e.metadata),this._metadata=r,l(r)&&(this._readyPromise=r.readyPromise.then(function(o){if(!r.imageryPresent){let s=new de(`The server ${r.url} doesn't have imagery`);return i=Ti.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return Ti.reportSuccess(i),n._ready=o,o}).catch(function(o){return i=Ti.reportError(i,n,n._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)}))}Object.defineProperties(FC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});FC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new FC(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};FC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};FC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=pm.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new jr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=Ggt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){aN(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Wgt(f)),!l(d)&&(!l(p)||p)){let g=jgt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Tx({uint8Array:f,format:d,flipY:!0})})};FC.prototype.pickFeatures=function(e,t,n,i,r){};function Ggt(e,t,n,i,r,o){let s=pm.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function Wgt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function jgt(e){let t=Cbe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var mK=FC;var qgt=new z(1,1,1,.4),Ygt=new z(0,1,0,.05),Xgt=new z(0,.5,0,.2);function BC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ji({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,qgt),this._glowColor=y(e.glowColor,Ygt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,Xgt),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(BC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});BC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};BC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};BC.prototype.getTileCredits=function(e,t,n){};BC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};BC.prototype.pickFeatures=function(e,t,n,i,r){};var hK=BC;function pK(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(pK.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});pK.prototype.load=async function(){return this._data=await kC.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var hB=pK;function YS(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(YS.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Kgt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}YS.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let r=e._parseHeader(n),o=Kgt(e._storageInfo.attributeValues.valueType);o>0&&(r=Math.ceil(r/o)*o),e._parseBody(n,r)}})};YS.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};YS.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};YS.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=this._storageInfo[i];if(l(r)){this._values[i]=[];for(let o=0;o<this._header.count;++o)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[o],a="";for(let c=0;c<s;++c){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(a+=u.value),t=u.offset}this._values[i].push(a)}}}};var pB=YS;function _B(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(_B.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});_B.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Jgt=new m,Zgt=new m,$gt=new m,Qgt=new m,eyt=new m;function _K(e,t,n,i){let r=m.subtract(i,n,Jgt),o=m.cross(r,m.subtract(e,n,Zgt),Qgt),s=m.cross(r,m.subtract(t,n,$gt),eyt);return m.dot(o,s)>=0}var tyt=new m,nyt=new m,iyt=new m,ryt=new m,oyt=new m,syt=new m,ayt=new m,cyt=new m,lyt=new m,uyt=new m;_B.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,h,x;l(f)?(g=f[p],h=f[p+1],x=f[p+2]):(g=p*3,h=p*3+1,x=p*3+2);let b=m.fromElements(u[g*3],u[g*3+1],u[g*3+2],tyt),C=m.fromElements(u[h*3],u[h*3+1],u[h*3+2],nyt),A=new m(u[x*3],u[x*3+1],u[x*3+2],iyt);if(!_K(i,b,C,A)||!_K(i,C,b,A)||!_K(i,A,b,C))continue;let T=m.subtract(C,b,ryt),S=m.subtract(A,b,oyt),v=m.cross(T,S,syt);if(m.magnitude(v)===0)continue;let I=m.normalize(v,ayt),O=m.subtract(i,b,cyt),R=Math.abs(m.dot(O,I));if(R<r){r=R,o=p;let L=m.magnitudeSquared(m.subtract(i,b,O)),N=m.magnitudeSquared(m.subtract(i,C,lyt)),_=m.magnitudeSquared(m.subtract(i,A,uyt));L<N&&L<_?(a=g,c=b,s=L):N<_?(a=h,c=C,s=N):(a=x,c=A,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};_B.prototype._generateGltf=function(e,t,n,i,r,o){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,u="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let x=this._parent._data.mesh.material.definition;if(x>=0&&x<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[x],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let b="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let A=this._layer._data.textureSetDefinitions[C];for(let T=0;T<A.formats.length;T++){let S=A.formats[T];if(S.format==="jpg"){b=S.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(u=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${b}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,u=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:u}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var XS=_B;function jl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(jl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});jl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Cf(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await kC.loadJson(this._resource,this._dataProvider._traceFetches);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};jl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(r,o){let s=new pB(t,r[o]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let r=0;r<e.length;r++)i.push(n(e,r));return Promise.all(i)};jl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};jl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};jl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new jl(e,y(i.href,i),!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};jl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new XS(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new XS(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};jl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new hB(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};jl.prototype._clearGeometryData=function(){this._geometryData=[]};jl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=me.fromDegrees(e.center[0],e.center[1],e.center[2]):n=me.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let A=this._dataProvider._geoidDataList[C],T=A.projection.project(n);if(T.x>A.nativeExtent.west&&T.x<A.nativeExtent.east&&T.y>A.nativeExtent.south&&T.y<A.nativeExtent.north){n.height+=dyt(T.x,T.y,A);break}}let i={},r,o=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=re.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=o/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new za(0,0,0),u=Mt.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Ne(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=F.inverse(p,new F),h=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};jl.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,r=0,o=0,s=0;l(n.obb)?(r=n.obb.center[0],o=n.obb.center[1],s=n.obb.center[2]):l(n.mbs)&&(r=n.mbs[0],o=n.mbs[1],s=n.mbs[2]);let a=$.fromRotationX(-D.PI_OVER_TWO),c=new $;$.multiply(a,i,c);let u=me.fromDegrees(r,o,s),f=re.WGS84.cartographicToCartesian(u),d={binaryData:t.geometryData._data,featureData:l(t.featureData)&&l(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:u,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};jl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let r=Promise.resolve();if(l(i._geometryData)&&i._geometryData.length>0){let o={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,o);if(!l(s))return;r=s.then(function(a){e=o.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return r.then(function(){let o=i._dataProvider._binarizeGltf(e),s=new Blob([o],{type:"application/binary"});return URL.createObjectURL(s)})})};Cf.prototype._hookedRequestContent=Cf.prototype.requestContent;Cf.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new Ie({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function fyt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function WH(e,t,n,i){let r=e+t*n;return i[r]}function dyt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=WH(s,a,n.width,n.buffer),d=WH(c,a,n.width,n.buffer),p=WH(s,u,n.width,n.buffer),g=WH(c,u,n.width,n.buffer),h=fyt(r,o,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(Cf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var KS=jl;function Kf(e,t,n){this._dataProvider=e,l(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),r="";i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new Ie({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Kf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Kf.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Kf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Kf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}return 0};Kf.prototype._loadRootNode=function(){if(l(this._data.nodePages)){let e=0;l(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new KS(this,e,!0)}else this._rootNode=new KS(this,this._data.store.rootNode,!0);return this._rootNode.load()};Kf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};Kf._fetchJson=function(e){return e.fetchJson()};Kf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Kf._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Kf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Kf.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(l(this._dataProvider._cesium3dTilesetOptions))for(let r in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(r)&&(i[r]=this._dataProvider._cesium3dTilesetOptions[r]);this._tileset=await Ns.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};var m0=Kf;var Abe=Ki(Tbe(),1);function rs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,l(e.url)&&(Q("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=Ie.createIfNeeded(e.url),this._load())}Object.defineProperties(rs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return Q("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});rs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};rs.prototype.isDestroyed=function(){return!1};rs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};rs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};rs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};rs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};rs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ie.createIfNeeded(e),i=await rs.loadJson(n),r=new rs(t);if(r._resource=n,r._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new m0(r,i.layers[s],s);r._layers.push(a)}else{let s=new m0(r,i,i.id);r._layers.push(s)}r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load());return await Promise.all(o),r._ready=!0,r._readyPromise=Promise.resolve(r),r};rs.prototype._load=function(){let e=this;return this._readyPromise=rs.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,l(t.layers))for(let i=0;i<t.layers.length;i++){let r=new m0(e,t.layers[i],i);e._layers.push(r)}else{let i=new m0(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};rs._fetchJson=function(e){return e.fetchJson()};rs.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await rs._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};rs.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};rs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]="g".charCodeAt(),r.magic[1]="l".charCodeAt(),r.magic[2]="T".charCodeAt(),r.magic[3]="F".charCodeAt(),r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};rs.prototype.getDecoderTaskProcessor=function(){if(l(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!l(this._decoderTaskProcessor)){let e=new bi("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function myt(e,t){return pyt(e,t)}var hyt=new H;function pyt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=me.fromRadians(t.west,t.north),a=me.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=H.fromElements(d,p,hyt),h=g.toString();if(!r.hasOwnProperty(h)){let x={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[h]=x,i.push(x)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=d[g],b="Geographic";n._projection instanceof Ri&&(b="WebMercator");let C={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===Ff.LERC){let A=Abe.default.decode(x._buffer);C.buffer=A.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function _yt(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await myt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}rs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=_yt(this),this._geoidDataPromise)};rs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var kC=rs;var Ebe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function qH(e,t){this.spatialNode=e,this.keyframe=t,this.state=Ebe.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}qH.priorityComparator=function(e,t){return e.priority-t.priority};qH.searchComparator=function(e,t){return e.keyframe-t.keyframe};qH.LoadState=Ebe;var er=qH;function Sbe(){}Object.defineProperties(Sbe.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var gK=Sbe;var gyt=/\/$/,vbe=new vt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function JS(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ie.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let r=y(e.tilesize,512);this._tilesize=r;let o=y(e.username,"mapbox");this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();gyt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new vt(c))):c=vbe,this._resource=i,this._imageryProvider=new zs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(JS.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});JS.prototype.getTileCredits=function(e,t,n){};JS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};JS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};JS._defaultCredit=vbe;var yK=JS;function h0(e,t,n,i,r){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let o=e.floatingPointTexture;if(i===rn.FLOAT32&&!o)throw new de("Floating point texture not supported");let s;i===rn.FLOAT32||i===rn.FLOAT64?s=Xe.FLOAT:i===rn.UINT8&&(s=Xe.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?ct.RED:ct.LUMINANCE:n===2?a=e.webgl2?ct.RG:ct.LUMINANCE_ALPHA:n===3?a=ct.RGB:n===4&&(a=ct.RGBA);let c=512*1024*1024,u=128*1024*1024;r=Math.min(y(r,u),c);let f=Ht.maximumTextureSize,d=rn.getSizeInBytes(i),p=Math.floor(r/(n*d)),g=Math.min(f,D.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/h),b=h*t.x,C=x*t.y,A=Math.floor(g/b),T=Math.floor(g/C);if(A===0||T===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=A*T,this.regionCountPerMegatexture=new H(A,T),this.voxelCountPerRegion=new H(b,C),this.sliceCountPerRegion=new H(h,x),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(b/g,C/g),this.texture=new Lt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new mn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:ln.LINEAR,magnificationFilter:Ai.LINEAR})});let S=rn.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,b*C*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new yyt(v);for(let v=0;v<this.maximumTileCount;v++){let I=this.nodes[v];I.previousNode=v>0?this.nodes[v-1]:void 0,I.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function yyt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}h0.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};h0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};h0.prototype.isFull=function(){return this.emptyList===void 0};h0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let r=rn.getSizeInBytes(i),o=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=D.previousPowerOfTwo(Math.floor(Math.sqrt(o)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*r};h0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,r=this.sliceCountPerRegion,o=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%r.x*i.x,C=Math.floor(x/r.x)*i.y;for(let A=0;A<i.y;A++)for(let T=0;T<i.x;T++){let S=x*i.y*i.x+A*i.x+T,v=(C+A)*o.x+(b+T);for(let I=0;I<s;I++)a[v*s+I]=n[S*s+I]}}let c=this.regionCountPerMegatexture,u=o.x,f=o.y,d=e%c.x*o.x,p=Math.floor(e/c.x)*o.y,h={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};h0.prototype.isDestroyed=function(){return!1};h0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var ZS=h0;function xK(e){}xK.prototype.isReady=function(){return!0};xK.prototype.shouldDiscardImage=function(e){return!1};var bK=xK;var xyt=new vt("MapQuest, Open Street Map and contributors, CC-BY-SA");function YH(e){e=y(e,y.EMPTY_OBJECT);let t=Ie.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new Bo({ellipsoid:e.ellipsoid}),i=256,r=256,o=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),o),u=n.positionToTileXY(ce.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,xyt);typeof d=="string"&&(d=new vt(d)),zs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(YH.prototype=Object.create(zs.prototype),YH.prototype.constructor=YH);var UC=YH;var byt=new H(1,1);function CK(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,byt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(CK.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var wbe=new m;CK.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,wbe),m.add(this.position,wbe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var $S=CK;function Ibe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(Ibe.prototype,{complete:{get:function(){return this._complete}}});var TK=Ibe;function Pbe(e){}Pbe.prototype.emit=function(e){fe.throwInstantiationError()};var AK=Pbe;var Dbe=new H(1,1);function gB(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new sB(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,Dbe))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,Dbe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(gB.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function Cyt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new $S;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function Tyt(e){let t=e._particlePool.pop();return l(t)||(t=new $S),t}function Ayt(e,t){e._particlePool.push(t)}function Eyt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function Syt(e){l(e._billboard)&&(e._billboard.show=!1)}function Rbe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function vyt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function wyt(e,t){if(e._isComplete)return 0;t=D.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var XH=new m;gB.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new au),this._updateParticlePool&&(Cyt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?Rbe(this,s):(Syt(s),Ayt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=wyt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=Tyt(this),this._emitter.emit(s),m.add(s.position,s.velocity,XH),F.multiplyByPoint(u,XH,XH),s.position=F.multiplyByPoint(u,s.position,s.position),m.subtract(XH,s.position,s.velocity),m.normalize(s.velocity,s.velocity),vyt(this,s),Rbe(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&Eyt(this)};gB.prototype.isDestroyed=function(){return!1};gB.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var EK=gB;var Lbe=Ki(E3(),1);var Iyt={modifyFragmentShader:function(t){return t=ze.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +void main() +{ +#ifndef SHADOW_MAP + if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},QS=Iyt;var VC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function yB(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=VC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=bn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Uc.NONE),this._splittingEnabled=!1,this._error=void 0,Pyt(this,e)}Object.defineProperties(yB.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function Pyt(e,t){let n=Gx.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Tp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=VC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var Dyt=new m,Ryt=new m,Oyt=new m,Obe,KH;function Myt(e){if(!l(KH)){Obe=new Lbe.default(0),KH=new Array(e);for(let t=0;t<e;++t)KH[t]=Obe.random()}return KH}function Lyt(e){let n=e.length/3,i=Math.min(n,20),r=Myt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(o,o,o,Dyt),c=m.fromElements(s,s,s,Ryt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=m.unpack(e,d*3,Oyt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function Mbe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Nt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var Nyt=new oe,Fyt=new oe,Byt=new z,Nbe=0,JH=1,PK=2,Fbe=3,kyt=4,SK=new F,Uyt=new F;function Vyt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,C=e._isRGB565,A=e._isTranslucent,T=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,I,O,R=[],L={};if(e._styleableShaderAttributes=L,f){let U=kyt;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],Y=Mbe(k.typedArray,G);I=k.componentCount,O=X.fromTypedArray(Y);let j=mt.createVertexBuffer({context:n,typedArray:Y,usage:Fe.STATIC_DRAW});e._geometryByteLength+=j.sizeInBytes;let J={index:U,vertexBuffer:j,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(J),L[G]={location:U,componentCount:I},++U}}let N=mt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;T&&(_=mt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let E;S&&(E=mt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let w;v&&(c.typedArray=Mbe(c.typedArray,"batchIds"),w=mt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let P=[];if(d?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,P.push({index:Nbe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=Lyt(o.typedArray)),T)if(C)P.push({index:JH,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=A?4:3;P.push({index:JH,vertexBuffer:_,componentsPerAttribute:U,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(I=2,O=X.UNSIGNED_BYTE):h?(I=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(I=3,O=X.FLOAT),P.push({index:PK,vertexBuffer:E,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:Fbe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(R));let M=new si({context:n,attributes:P}),B={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:dn.ALPHA_BLEND};e._opaquePass===Ee.CESIUM_3D_TILE&&(B.stencilTest=kt.setCesium3DTileBit(),B.stencilMask=kt.CESIUM_3D_TILE_MASK,V.stencilTest=kt.setCesium3DTileBit(),V.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(B),e._translucentRenderState=Ue.fromCache(V),e._drawCommand=new tt({boundingVolume:new ae,cull:e._cull,modelMatrix:new F,primitiveType:Le.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:A?e._translucentRenderState:e._opaqueRenderState,pass:A?Ee.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function zyt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Nyt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof nn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,Byt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,SK);let u=F.multiply(SK,a.modelMatrix,SK);return F.inverseTranspose(u,Uyt)}};QS.addUniforms(e,s),(i||r||o)&&(s=gt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=Fyt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function vK(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function wK(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function IK(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Hyt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function Gyt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,C=e._backFaceCulling,A=e._normalShading,T=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,I,O,R,L=g,N=je(Hyt),_={},E=e._styleableShaderAttributes;for(r in E)E.hasOwnProperty(r)&&(o=E[r],N[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let se={translucent:!1},pe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${pe}`,N,se),O=n.getShowShaderFunction(`getShowFromStyle${pe}`,N,se),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${pe}`,N,se),l(I)&&se.translucent&&(L=!0)}e._styleTranslucent=L;let w=l(I),P=l(O),M=l(R),B=e.isClipped,V=[],U=[];w&&(vK(I,V),wK(I,U)),P&&(vK(O,V),wK(O,U)),M&&(vK(R,V),wK(R,U));let G=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(r in E)if(E.hasOwnProperty(r)){o=E[r];let se=V.indexOf(o.location)>=0,pe=IK(T,o.location);pe.enabled=se}let Y=h&&(!w||G);if(h){let se=IK(T,JH);se.enabled=Y}let j=x&&(A||C||k);if(x){let se=IK(T,PK);se.enabled=j}let J={a_position:Nbe};Y&&(J.a_color=JH),j&&(J.a_normal=PK),b&&(J.a_batchId=Fbe);let W="",K=V.length;for(i=0;i<K;++i){let se=V[i];o=_[se];let pe=o.componentCount,xe=`czm_3dtiles_property_${se}`,Pe;pe===1?Pe="float":Pe=`vec${pe}`,W+=`in ${Pe} ${xe}; +`,J[xe]=o.location}zyt(e,t);let Z=`in vec3 a_position; +out vec4 v_color; +uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; +uniform vec4 u_constantColor; +uniform vec4 u_highlightColor; +`;Z+=`float u_pointSize; +float tiles3d_tileset_time; +`,v&&(Z+=`float u_geometricError; +float u_depthMultiplier; +`),Z+=W,Y&&(g?Z+=`in vec4 a_color; +`:p?Z+=`in float a_color; +const float SHIFT_RIGHT_11 = 1.0 / 2048.0; +const float SHIFT_RIGHT_5 = 1.0 / 32.0; +const float SHIFT_LEFT_11 = 2048.0; +const float SHIFT_LEFT_5 = 32.0; +const float NORMALIZE_6 = 1.0 / 64.0; +const float NORMALIZE_5 = 1.0 / 32.0; +`:Z+=`in vec3 a_color; +`),j&&(f||d?Z+=`in vec2 a_normal; +`:Z+=`in vec3 a_normal; +`),b&&(Z+=`in float a_batchId; +`),(c||u||d)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),w&&(Z+=I),P&&(Z+=O),M&&(Z+=R),Z+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,v&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),Y?g?Z+=` vec4 color = a_color; +`:p?Z+=` float compressed = a_color; + float r = floor(compressed * SHIFT_RIGHT_11); + compressed -= r * SHIFT_LEFT_11; + float g = floor(compressed * SHIFT_RIGHT_5); + compressed -= g * SHIFT_LEFT_5; + float b = compressed; + vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); + vec4 color = vec4(rgb, 1.0); +`:Z+=` vec4 color = vec4(a_color, 1.0); +`:Z+=` vec4 color = u_constantColor; +`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; +`:Z+=` vec3 position = a_position; +`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); +`,j?(f?Z+=` vec3 normal = czm_octDecode(a_normal); +`:d?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; +`:Z+=` vec3 normal = a_normal; +`,Z+=` vec3 normalEC = czm_normal * normal; +`):Z+=` vec3 normal = vec3(1.0); +`,w&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),P&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),M?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:v?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); + float depth = -positionEC.z; + gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); +`:Z+=` gl_PointSize = u_pointSize; +`,Z+=` color = color * u_highlightColor; +`,j&&A&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); + diffuseStrength = max(diffuseStrength, 0.4); + color.xyz *= diffuseStrength * czm_lightColor; +`),Z+=` v_color = color; + gl_Position = czm_modelViewProjection * vec4(position, 1.0); +`,j&&C&&(Z+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),P&&(Z+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),Z+=`} +`;let he=`in vec4 v_color; +`;B&&(he+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,he+=` +`,he+=B_(S,s),he+=` +`),he+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,B&&(he+=mB("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),he+=`} +`,e.splitDirection!==Uc.NONE&&(he=QS.modifyFragmentShader(he)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(he=e._fragmentShaderLoaded(he));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=Jt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:he,attributeLocations:J});try{ge.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Wyt(e,t){if(e._decodingState===VC.READY)return!1;if(e._decodingState===VC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Dp.decodePointCloud(i,t);l(r)&&(e._decodingState=VC.DECODING,r.then(function(o){e._decodingState=VC.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let b=o.POSITION.data.quantization,C=b.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let b in h)if(h.hasOwnProperty(b)){let C=o[b];l(g)||(g={}),g[b]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=VC.FAILED,e._error=o}))}return!0}var jyt=new oe,qyt=new m;yB.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(Wyt(this,t))return;let i=!1,r=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(Vyt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),l(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=F.getColumn(u,3,jyt);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;F.multiplyByPoint(u,d,d);let p=F.getScale(u,qyt);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==Uc.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&Gyt(this,e,this._style),this._drawCommand.castShadows=bn.castShadows(this.shadows),this._drawCommand.receiveShadows=bn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ee.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};yB.prototype.isDestroyed=function(){return!1};yB.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var xB=yB;function Wu(){fe.throwInstantiationError()}Wu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Wu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Wu.prototype.update=fe.throwInstantiationError;Wu.prototype.beginUpdate=fe.throwInstantiationError;Wu.prototype.endUpdate=fe.throwInstantiationError;Wu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Wu.prototype.loadTile=fe.throwInstantiationError;Wu.prototype.computeTileVisibility=fe.throwInstantiationError;Wu.prototype.showTileThisFrame=fe.throwInstantiationError;Wu.prototype.computeDistanceToTile=fe.throwInstantiationError;Wu.prototype.isDestroyed=fe.throwInstantiationError;Wu.prototype.destroy=fe.throwInstantiationError;var DK=Wu;function Jf(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new On,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o,s)}var Yyt=new m;Jf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=$.getScale(this.orientedBoundingBox.halfAxes,Yyt),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};Jf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:r,z:o}=this,s=i*2,a=r*2,c=o*2,u=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,u,c],[p,f,u,c],[p,s,a,d],[p,f,a,d],[p,s,u,d],[p,f,u,d]];this.children=g.map(([h,x,b,C])=>new Jf(h,x,b,C,this,e,t))};Jf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Jf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var Bbe={keyframe:0};function bB(e,t){return Bbe.keyframe=e,Or(t,Bbe,er.searchComparator)}Jf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=Xyt(i,d),g=d[p],h=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),x=d[h],b=i-g.keyframe,C=kbe(n-t.level,b);C<a&&(a=C,o=g);let A=x.keyframe-r,T=kbe(n-t.level,A);if(T<c&&(c=T,s=x),b===0&&A===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function Xyt(e,t){let n=bB(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function kbe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Jf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Jf.prototype.createKeyframeNode=function(e){let t=bB(e,this.keyframeNodes);if(t<0){t=~t;let n=new er(this,e);this.keyframeNodes.splice(t,0,n)}};Jf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=bB(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=bB(n,this.renderableKeyframeNodes);if(r<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.spatialNode=void 0,e.state=er.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Jf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==er.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let r=0;r<t.length;r++){let o=t[r];e.megatextureIndex=o.add(e.metadatas[r]),e.metadatas[r]=void 0}e.state=er.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=bB(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};Jf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var CB=Jf;function RK(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(RK.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});RK.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(r,o,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var OK=RK;function TB(){}TB.prototype.evaluate=function(e,t){fe.throwInstantiationError()};TB.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};TB.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};TB.prototype.getVariables=function(){fe.throwInstantiationError()};var MK=TB;function ZH(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,Jyt(this,e)}Object.defineProperties(ZH.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});ZH.fromWorldTerrain=function(e){return new ZH(Zb(e))};function Kyt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Jyt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){Kyt(e._errorEvent,i)}}var AB=ZH;function ev(){}ev.prototype.boundingVolume=void 0;ev.prototype.boundingSphere=void 0;ev.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};ev.prototype.intersectPlane=function(e){fe.throwInstantiationError()};ev.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var LK=ev;function EB(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ji({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(EB.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});EB.prototype.getTileCredits=function(e,t,n){};EB.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};EB.prototype.pickFeatures=function(e,t,n,i,r){};var SB=EB;function NK(e){fe.throwInstantiationError()}NK.prototype.isReady=fe.throwInstantiationError;NK.prototype.shouldDiscardImage=fe.throwInstantiationError;var FK=NK;var Zyt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},BK=Object.freeze(Zyt);function HC(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,bn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Zm(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Np,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(HC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){us.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return Q("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function $yt(e){return`uniform vec4 czm_pickColor; +${e}`}function Qyt(e){return function(t){return gt(t,{czm_pickColor:function(){return e._pickId.color}})}}function e0t(){return"czm_pickColor"}HC.prototype.makeStyleDirty=function(){this._styleDirty=!0};HC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var t0t=new ee;function UK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function zC(e,t){return e._intervals.indexOf(t.start)}function n0t(e,t){let n=e._intervals,i=e._clock,r=UK(e);if(r===0)return;let o=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,o*r,t0t),a=n.indexOf(s),c=zC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function i0t(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function r0t(e,t,n){let i=UK(e),r=zC(e,t),o=zC(e,n);return i>=0?r>=o:r<=o}function Vbe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function o0t(e,t,n){let i=zC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:Ci(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,Ie.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new xB({arrayBuffer:u,cull:!0,fragmentShaderLoaded:$yt,uniformMapLoaded:Qyt(e),pickIdLoaded:e0t})}).catch(Vbe(e,c))}return o}function s0t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function a0t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(zbe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(Ci()-t.timestamp)/1e3;s0t(e,a)}}t.touchedFrameNumber=i.frameNumber}var c0t=new F;function l0t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function u0t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var f0t=new Zm;function zbe(e,t,n,i){let r=y(e.shading,f0t),o=t.pointCloud,s=y(t.transform,F.IDENTITY);o.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,c0t),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=l0t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=u0t(e);try{o.update(i)}catch(a){Vbe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function kK(e,t,n,i){let r=o0t(e,t,i);a0t(e,r,n,i)}function d0t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Hbe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function m0t(e,t){let n=zC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function Ube(e,t,n,i,r){return l(n)?n.ready?!0:(kK(e,t,i,r),n.ready):!1}function h0t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=zC(e,n),d=zC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],Ube(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],Ube(e,s,a,i,r))return s;return t}function p0t(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var tv={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};HC.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&p0t(this,r,s),tv.timeSinceLoad=t,tv.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=i0t(this);if(!l(g))return;let h=!1,x=UK(this),b=x===0;x!==this._clockMultiplier&&(h=!0,this._clockMultiplier=x),(!l(d)||b)&&(d=g),(!l(p)||h||r0t(this,g,p))&&(p=n0t(this,g)),d=h0t(this,d,g,tv,e);let C=m0t(this,d);l(C)||(kK(this,d,tv,e),C=this._lastRenderedFrame),l(C)&&zbe(this,C,tv,e),l(p)&&kK(this,p,tv,e);let A=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return A._resolveReadyPromise(A),!0}),l(C)&&C!==this._lastRenderedFrame&&A.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return A.frameChanged.raiseEvent(A),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let T=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;T>S&&Hbe(this,d0t(e));let I=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,f,a,this.boundingSphere)};HC.prototype.isDestroyed=function(){return!1};HC.prototype.destroy=function(){return Hbe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var nv=HC;function $H(e,t){this.show=!0,l(e)||(e=new Ye),this.rectangle=Ye.clone(e),l(t)||(t=Wi.fromType(Wi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}$H.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ye.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:dn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new ze({sources:[this._material.shaderSource,eF]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ee.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};$H.prototype.isDestroyed=function(){return!1};$H.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var VK=$H;function p0(e,t,n,i,r,o,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let x=0;x<a;x++){let b=i[x],C=qt.getComponentCount(b),A=r[x];this.megatextures[x]=new ZS(t,n,C,A,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let u=e._shape;this.rootNode=new CB(0,0,0,0,void 0,u,n),this._priorityQueue=new $b({maximumLength:c,comparator:er.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=o,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(o);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[o-1]=0,zK(f,1,o-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Lt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new mn({minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function zK(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,zK(e,t,r-1,i+1),zK(e,r+1,n,i+1)}p0.simultaneousRequestCountMaximum=50;p0.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let A=Math.floor(512),T=Math.ceil(s/A);this.leafNodeTexture=new Lt({context:o,pixelFormat:ct.RGBA,pixelDatatype:Xe.UNSIGNED_BYTE,flipY:!1,width:1024,height:T,sampler:new mn({minificationFilter:ln.NEAREST,magnificationFilter:Ai.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/T,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=A}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&Gbe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ci();y0t(this,e);let h=Ci();b0t(this,d,c);let x=Ci();if(this._debugPrint){let b=h-g,C=x-h,A=x-g;x0t(this,b,C,A)}};p0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function Gbe(e,t){let n=e._primitive,i=n._shape,r=n._provider.dimensions;if(t.computeBoundingVolumes(i,r),l(t.children))for(let o=0;o<8;o++){let s=t.children[o];Gbe(e,s)}}function _0t(e,t){if(e._simultaneousRequestCount>=p0.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function r(u){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!l(u))t.state=er.LoadState.UNAVAILABLE;else if(u===er.LoadState.FAILED)t.state=er.LoadState.FAILED;else if(!Array.isArray(u)||u.length!==f)t.state=er.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x,y:b,z:C}=g,A=x*b*C,T=u[p],S=A*h;if(T.length===S)t.metadatas[p]=T,t.state=er.LoadState.RECEIVED;else{t.state=er.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=er.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=er.LoadState.RECEIVING,c.then(r).catch(o)):t.state=er.LoadState.FAILED}function g0t(e){return e/(1+e)}function y0t(e,t){let n=e._frameNumber,i=e._primitive,r=i._shape,{dimensions:o}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,u=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:x}=d,C=p.drawingBufferHeight/g/x.sseDenominator;function A(E,w,P){let M=Math.min(Math.abs(w-E),Math.abs(w-P)),B=Math.max(E,u-P-1,1),V=Math.pow(1-M/B,4),U=Math.exp(-e._binaryTreeKeyframeWeighting[w]);return D.lerp(U,V,.15+.85*V)}function T(E,w){if(E.computeScreenSpaceError(h,C),w=E.visibility(t,w),w===ts.MASK_OUTSIDE)return;E.visitedFrameNumber=n;let P=D.clamp(Math.floor(c),0,u-2),M=P+1;if(u===1)E.createKeyframeNode(0);else if(E.keyframeNodes.length!==u)for(let k=0;k<u;k++)E.createKeyframeNode(k);let B=g0t(E.screenSpaceError),V=!1,U=E.keyframeNodes;for(let k=0;k<U.length;k++){let Y=U[k];Y.priority=10*B+A(P,Y.keyframe,M),Y.state!==er.LoadState.UNAVAILABLE&&Y.state!==er.LoadState.FAILED&&Y.priority!==-Number.MAX_VALUE&&a.insert(Y),Y.state===er.LoadState.LOADED&&(V=!0)}if(E.screenSpaceError<s||!V){E.children=void 0;return}l(E.children)||E.constructChildNodes(r,o);for(let k=0;k<8;k++){let Y=E.children[k];T(Y,w)}}a.reset(),T(f,ts.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,v=0,I;for(;a.length>0;)I=a.removeMaximum(),I.highPriorityFrameNumber=n,S[v]=I,v++;let O=e._keyframeNodesInMegatexture,R=e.megatextures[0],L=R.occupiedCount;O.length=L,O.sort(function(E,w){return E.highPriorityFrameNumber===w.highPriorityFrameNumber?w.priority-E.priority:w.highPriorityFrameNumber-E.highPriorityFrameNumber});let N=0,_=0;for(let E=0;E<v;E++)if(I=S[E],!(I.state===er.LoadState.LOADED||I.spatialNode===void 0)&&(I.state===er.LoadState.UNLOADED&&_0t(e,I),I.state===er.LoadState.RECEIVED)){let w=0;if(R.isFull()){w=L-1-N,N++;let P=O[w];P.spatialNode.destroyKeyframeNode(P,e.megatextures)}else w=L+_,_++;I.spatialNode.addKeyframeNodeToMegatextures(I,e.megatextures),O[w]=I}}function x0t(e,t,n,i){let r=e._keyframeCount,o=e.rootNode,s=Object.keys(er.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let A=new Array(r);a[C]=A;for(let T=0;T<r;T++)A[T]=0;c[C]=0}function f(C){let A=C.keyframeNodes;for(let T=0;T<A.length;T++){let S=A[T],v=S.keyframe,I=S.state;a[I][v]+=1,c[I]+=1,u++}if(l(C.children))for(let T=0;T<8;T++){let S=C.children[T];f(S)}}f(o);let d=`KEYFRAMES: ${a[er.LoadState.LOADED]}`,p=`UNLOADED: ${c[er.LoadState.UNLOADED]} | RECEIVING: ${c[er.LoadState.RECEIVING]} | RECEIVED: ${c[er.LoadState.RECEIVED]} | LOADED: ${c[er.LoadState.LOADED]} | FAILED: ${c[er.LoadState.FAILED]} | UNAVAILABLE: ${c[er.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${g} | OCT: ${h} | ALL: ${x}`;console.log(`${d} || ${p} || ${b}`)}var QH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function b0t(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,h,x,b,C){let A=!1;if(l(g.children))for(let T=0;T<8;T++){let S=g.children[T];S.computeSurroundingRenderableKeyframeNodes(r),S.isRenderable(o)&&(A=!0)}if(A){u[C]=QH.INTERNAL<<16|h,u[x]=b,a++,b=h,C=b*9+1;for(let T=0;T<8;T++){let S=g.children[T];h=a,x=h*9+0,d(S,h,x,b,C+T)}}else{if(s){let T=c*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,I=S.spatialNode.parent,O=l(I)?I.renderableKeyframeNodePrevious:S,R=C0t(g,i,n),L=v,N=1,_=S.megatextureIndex,E=O.megatextureIndex;f[T+0]=R,f[T+1]=L,f[T+2]=N,f[T+3]=_,f[T+4]=E,u[C]=QH.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?QH.LEAF:QH.PACKED_LEAF_FROM_PARENT;u[C]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),T0t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&A0t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function C0t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return D.clamp(s,0,1)}function T0t(e,t,n,i){let r=ct.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let h=0;h<r;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function A0t(e,t,n,i){let r=ct.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],h=e[p*o+1],x=e[p*o+2],b=e[p*o+3],C=e[p*o+4],A=D.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=A>>>0&255,u[p*8+1]=A>>>8&255,u[p*8+2]=h&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}p0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let r=0,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=i[s],u=qt.getComponentCount(a);r+=ZS.getApproximateTextureMemoryByteLength(e,t,u,c)}return r};var iv=p0;var E0t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},rv=Object.freeze(E0t);function ov(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}ov.prototype.getTexture=function(e){return this._textures[e]};function S0t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}ov.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):S0t(this,e,t)};function v0t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?eG(r,o,n):w0t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function eG(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?jbe(e,n):new Lt({context:n,source:t,sampler:r});return Wbe(r)&&o.generateMipmap(),o}function w0t(e,t,n){let{typedArray:i,sampler:r}=e,o=Wbe(r),s=r.wrapS===In.REPEAT||r.wrapS===In.MIRRORED_REPEAT||r.wrapT===In.REPEAT||r.wrapT===In.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===Xe.UNSIGNED_BYTE){let d=dN(i,a,c),p=Mg(d);return eG({sampler:r},p,n)}}else{let d=Mg(t);return eG(e,d,n)}else return eG(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),jbe(e,n)}function Wbe(e){return[ln.NEAREST_MIPMAP_NEAREST,ln.NEAREST_MIPMAP_LINEAR,ln.LINEAR_MIPMAP_NEAREST,ln.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function jbe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Lt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}ov.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];v0t(this,r,t)}n.length=0};ov.prototype.isDestroyed=function(){return!1};ov.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var vB=ov;function wB(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Gp.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,jg.INHERIT),this._textureManager=new vB,this._defaultTexture=void 0,this.uniformMap=I0t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},R0t(this),O0t(this)}function I0t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===rv.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=P0t(e,i)):n[i]=D0t(e,i)}return n}function P0t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function D0t(e,t){return function(){return e.uniforms[t].value}}function GC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function R0t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,GC(o,t,r),r=e.usedVariablesVertex.featureIdSet,GC(o,n,r),r=e.usedVariablesVertex.metadataSet,GC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,GC(s,t,r),r=e.usedVariablesFragment.featureIdSet,GC(s,n,r),r=e.usedVariablesFragment.metadataSet,GC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;GC(s,a,c)}}function qbe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Cc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${qbe(t)} is not available in the ${i} shader. Did you mean ${qbe(n)} instead?`;throw new fe(r)}}function O0t(e){let t=e.usedVariablesVertex.attributeSet;Cc(t,"position","positionMC","vertex"),Cc(t,"normal","normalMC","vertex"),Cc(t,"tangent","tangentMC","vertex"),Cc(t,"bitangent","bitangentMC","vertex"),Cc(t,"positionWC","positionMC","vertex"),Cc(t,"positionEC","positionMC","vertex"),Cc(t,"normalEC","normalMC","vertex"),Cc(t,"tangentEC","tangentMC","vertex"),Cc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Cc(n,"position","positionEC","fragment"),Cc(n,"normal","normalEC","fragment"),Cc(n,"tangent","tangentEC","fragment"),Cc(n,"bitangent","bitangentEC","fragment"),Cc(n,"normalMC","normalEC","fragment"),Cc(n,"tangentMC","tangentEC","fragment"),Cc(n,"bitangentMC","bitangentEC","fragment")}wB.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===rv.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};wB.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};wB.prototype.isDestroyed=function(){return!1};wB.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var WC=wB;function Wh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Wh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,Wh.DefaultCustomShader),this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Bd,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let r in t)if(t.hasOwnProperty(r)){let o=`u_${r}`;n[o]=function(){return t[r]}}let i=this._provider;this._completeLoad=function(r,o){},this._readyPromise=M0t(this,i)}async function M0t(e,t){let n=new Promise(function(a){e._completeLoad=function(c,u){u.afterRender.push(function(){return c._ready=!0,a(c),!0})}});l(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:r=Yi.getMinBounds(i),maxBounds:o=Yi.getMaxBounds(i)}=t;e.minBounds=r,e.maxBounds=o,e.minClippingBounds=Yi.getMinBounds(i),e.maxClippingBounds=Yi.getMaxBounds(i),Xbe(e,t);let s=Yi.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=Kbe(e,e._shape,t),n}Object.defineProperties(Wh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){us.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];l(e)?this._customShader=e:this._customShader=Wh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var L0t=new m,N0t=new oe,F0t=new oe,B0t=new m,k0t=new m,U0t=new $,V0t=new $,z0t=new F,H0t=new F,G0t=new F,W0t=F.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new F),j0t=F.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new F);Wh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),l(t._ready)&&!t._ready||!l(this._shape))return;let n=e.context;if(!this._ready){q0t(this,t,n),this._completeLoad(this,e);return}let i=Xbe(this,t),r=this._shape;if(i&&(this._shapeVisible=Kbe(this,r,t),K0t(this,r)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let o=J0t(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,o,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&rxt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Z0t(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(eB(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=r.orientedBoundingBox,g=ext(p,d,F0t);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let A=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,A,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let T=e.passes.pick?this._drawCommandPick:this._drawCommand;T.boundingVolume=r.boundingSphere,e.commandList.push(T)};function q0t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:r,shaderUniforms:o}=e._shape;e._shapeDefinesOld=je(r,!0);let s=e._uniformMap;for(let a in o)if(o.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return o[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=Y0t(e,t,n),X0t(e._traversal,i)}function Xbe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),IB(e,"_compoundModelMatrix","_compoundModelMatrixOld")+IB(e,"_minBounds","_minBoundsOld")+IB(e,"_maxBounds","_maxBoundsOld")+IB(e,"_minClippingBounds","_minClippingBoundsOld")+IB(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function IB(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}function Kbe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let r=t.shapeTransform,o=F.inverse(r,z0t),s=F.getRotation(r,U0t),a=F.getScale(r,B0t),c=m.maximumComponent(a),u=m.divideByScalar(a,c,k0t),f=$.multiplyByScale(s,u,V0t),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=F.multiplyTransformation(W0t,o,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(r,j0t,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(o,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Y0t(e,t,n){let i=m.clone(t.dimensions,L0t);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let r=t.maximumTileCount,o=l(r)?iv.getApproximateTextureMemoryByteLength(r,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new iv(e,n,i,t.types,t.componentTypes,s,o)}function X0t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],r=n.length;t.megatextureTextures=new Array(r);for(let o=0;o<r;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function K0t(e,t){let n=t.shaderDefines,i=Object.keys(n).some(r=>n[r]!==e._shapeDefinesOld[r]);return i&&(e._shapeDefinesOld=je(n,!0)),i}function J0t(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/o;return r+a}function Z0t(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionUvToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var Ybe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),$0t=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Q0t=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function ext(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,H0t),r=F.multiply(t,i,G0t),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Q0t,d=Ybe.length;for(u=0;u<d;u++)F.multiplyByVector(r,Ybe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=$0t[u*3+g],x=f[h];if(x.z>=-x.w){let b=p.z+p.w,C=x.z+x.w,A=b/(b-C),T=oe.lerp(p,x,A,N0t),S=T.x/T.w,v=T.y/T.w;o=Math.min(o,S),s=Math.max(s,S),a=Math.min(a,v),c=Math.max(c,v)}}}return o=D.clamp(o,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=oe.fromElements(o,a,s,c,n),n}var HK=3e7,txt=new m(HK,0,0),nxt=new m(0,HK,0),ixt=new m(0,0,HK);function rxt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:Wi.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(m.ZERO,txt,z.RED,a),r(m.ZERO,nxt,z.LIME,a),r(m.ZERO,ixt,z.BLUE,a),i.update(t)}Wh.DefaultCustomShader=new WC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function fxe(){this.ready=!0,this.shape=qi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[qt.SCALAR],this.componentTypes=[nn.FLOAT32],this.maximumTileCount=1}fxe.prototype.requestData=function(e){if(!((u(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Gh.DefaultProvider=new fxe;var $S=Gh;function RK(){fe.throwInstantiationError()}Object.defineProperties(RK.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});RK.prototype.requestData=fe.throwInstantiationError;var BK=RK;function zC(){fe.throwInstantiationError()}Object.defineProperties(zC.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});zC.prototype.update=fe.throwInstantiationError;zC.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;zC.prototype.computeApproximateStepSize=fe.throwInstantiationError;zC.DefaultMinBounds=fe.throwInstantiationError;zC.DefaultMaxBounds=fe.throwInstantiationError;var LK=zC;function ev(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function U0t(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!u(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let o="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(o,void 0,r)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function dxe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,u(e._scene)&&(e._scene.pixelRatio=t),t}function mxe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=dxe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function hxe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;u(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function HC(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=Gt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=Gt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=u(t.creditContainer)?In(t.creditContainer):n;c.appendChild(a);let l=u(t.creditViewport)?In(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=u(t.clock)?t.clock:new qd,mxe(this);try{let p=new $F({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,dxe(this),hxe(this);let g=y(p.mapProjection.ellipsoid,re.WGS84),h=t.globe;u(h)||(h=new ZN(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,xn.RECEIVE_ONLY));let A=t.skyBox;u(A)||(A=new o2({sources:{positiveX:ev("px"),negativeX:ev("mx"),positiveY:ev("py"),negativeY:ev("my"),positiveZ:ev("pz"),negativeZ:ev("mz")}})),A!==!1&&(p.skyBox=A,p.sun=new h2,p.moon=new sF);let x=t.skyAtmosphere;u(x)||(x=new n2(g)),x!==!1&&(p.skyAtmosphere=x),u(t.imageryProvider)&&$("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(u(t.imageryProvider)&&!u(C)&&(C=new Gs(t.imageryProvider)),u(C)||(C=Gs.fromWorldImagery()),p.imageryLayers.add(C)),u(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),u(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new Ru(i),u(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(E,S){if(T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors){let w="An error occurred while rendering. Rendering has stopped.";T.showErrorPanel(w,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(HC.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&U0t(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});HC.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),u(window.addEventListener)&&window.addEventListener("resize",c,!1);let l=u(t),f=u(n);if(l||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=vh(n);l||(typeof n=="string"&&(n=new Error(n)),t=vh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${h}`);let A=document.createElement("div");A.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),A.appendChild(x),A.onclick=function(C){A.removeChild(x),A.appendChild(document.createTextNode(h)),A.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",A.onclick=void 0},a.appendChild(A)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){u(c)&&u(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};HC.prototype.isDestroyed=function(){return!1};HC.prototype.destroy=function(){u(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};HC.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,mxe(this),hxe(this),this._scene.requestRender())};HC.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var T2=HC;function V0t(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,at.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=we.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?wn.REPEAT:wn.CLAMP_TO_EDGE;this.sampler=new fn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var NK=V0t;var k0t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},FK=Object.freeze(k0t);var UK=`uniform sampler2D u_depthTexture; +}`});function Jbe(){this.ready=!0,this.shape=Yi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[qt.SCALAR],this.componentTypes=[rn.FLOAT32],this.maximumTileCount=1}Jbe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Wh.DefaultProvider=new Jbe;var sv=Wh;function GK(){fe.throwInstantiationError()}Object.defineProperties(GK.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});GK.prototype.requestData=fe.throwInstantiationError;var WK=GK;function jC(){fe.throwInstantiationError()}Object.defineProperties(jC.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});jC.prototype.update=fe.throwInstantiationError;jC.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;jC.prototype.computeApproximateStepSize=fe.throwInstantiationError;jC.DefaultMinBounds=fe.throwInstantiationError;jC.DefaultMaxBounds=fe.throwInstantiationError;var jK=jC;var qK=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15083,38 +15045,38 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;function z0t(e,t,n){let i;try{return i=e(t,n),i}catch(r){return Promise.reject(r)}}function H0t(e){let t;return function(n){let i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(z0t(e,i.parameters,r)).then(function(s){o.result=s}).catch(function(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}).finally(function(){u(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${vh(s)} - with responseMessage: ${JSON.stringify(o)}`,t(o)}})}}var VK=H0t;globalThis.CESIUM_VERSION="1.105";var E2;typeof ko<"u"&&(E2=ko);(function(){/*! +`;function oxt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,ct.RGBA),this.pixelDatatype=y(e.pixelDatatype,Xe.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ie.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?In.REPEAT:In.CLAMP_TO_EDGE;this.sampler=new mn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var YK=oxt;var sxt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},XK=Object.freeze(sxt);function axt(e,t,n){let i;try{return i=e(t,n),i}catch(r){return Promise.reject(r)}}function cxt(e){let t;return function(n){let i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(axt(e,i.parameters,r)).then(function(s){o.result=s}).catch(function(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${wh(s)} + with responseMessage: ${JSON.stringify(o)}`,t(o)}})}}var KK=cxt;globalThis.CESIUM_VERSION="1.106.1";var PB;typeof ko<"u"&&(PB=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,b){return _===null||typeof _ in A?_===b:!1}function l(_,b){var v;return function(){v||(v=h.a.setTimeout(function(){v=e,_()},b))}}function f(_,b){var v;return function(){clearTimeout(v),v=h.a.setTimeout(_,b)}}function d(_,b){b&&b!=="change"?b==="beforeChange"?this.pc(_):this.gb(_,b):this.qc(_)}function p(_,b){b!==null&&b.s&&b.s()}function g(_,b){var v=this.qd,I=v[S];I.ra||(this.Qb&&this.mb[b]?(v.uc(b,_,this.mb[b]),this.mb[b]=null,--this.Qb):I.I[b]||v.uc(b,_,I.J?{da:_}:v.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,b){for(var v=_.split("."),I=h,R=0;R<v.length-1;R++)I=I[v[R]];I[v[v.length-1]]=b},h.L=function(_,b,v){_[b]=v},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(j,K){for(var Z in j)R.call(j,Z)&&K(Z,j[Z])}function b(j,K){if(K)for(var Z in K)R.call(K,Z)&&(j[Z]=K[Z]);return j}function v(j,K){return j.__proto__=K,j}function I(j,K,Z,me){var ye=j[K].match(W)||[];h.a.D(Z.match(W),function(se){h.a.Na(ye,se,me)}),j[K]=ye.join(" ")}var R=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,k=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(j,K){if(K.length)for(var Z=0,me=K.length;Z<me;Z++)G[K[Z]]=j});var U={propertychange:!0},Y=n&&function(){for(var j=3,K=n.createElement("div"),Z=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",Z[0];);return 4<j?j:e}(),W=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,K,Z){for(var me=0,ye=j.length;me<ye;me++)K.call(Z,j[me],me,j)},A:typeof Array.prototype.indexOf=="function"?function(j,K){return Array.prototype.indexOf.call(j,K)}:function(j,K){for(var Z=0,me=j.length;Z<me;Z++)if(j[Z]===K)return Z;return-1},Lb:function(j,K,Z){for(var me=0,ye=j.length;me<ye;me++)if(K.call(Z,j[me],me,j))return j[me];return e},Pa:function(j,K){var Z=h.a.A(j,K);0<Z?j.splice(Z,1):Z===0&&j.shift()},wc:function(j){var K=[];return j&&h.a.D(j,function(Z){0>h.a.A(K,Z)&&K.push(Z)}),K},Mb:function(j,K,Z){var me=[];if(j)for(var ye=0,se=j.length;ye<se;ye++)me.push(K.call(Z,j[ye],ye));return me},jb:function(j,K,Z){var me=[];if(j)for(var ye=0,se=j.length;ye<se;ye++)K.call(Z,j[ye],ye)&&me.push(j[ye]);return me},Nb:function(j,K){if(K instanceof Array)j.push.apply(j,K);else for(var Z=0,me=K.length;Z<me;Z++)j.push(K[Z]);return j},Na:function(j,K,Z){var me=h.a.A(h.a.bc(j),K);0>me?Z&&j.push(K):Z||j.splice(me,1)},Ba:F,extend:b,setPrototypeOf:v,Ab:F?v:b,P:_,Ga:function(j,K,Z){if(!j)return j;var me={},ye;for(ye in j)R.call(j,ye)&&(me[ye]=K.call(Z,j[ye],ye,j));return me},Tb:function(j){for(;j.firstChild;)h.removeNode(j.firstChild)},Yb:function(j){j=h.a.la(j);for(var K=(j[0]&&j[0].ownerDocument||n).createElement("div"),Z=0,me=j.length;Z<me;Z++)K.appendChild(h.oa(j[Z]));return K},Ca:function(j,K){for(var Z=0,me=j.length,ye=[];Z<me;Z++){var se=j[Z].cloneNode(!0);ye.push(K?h.oa(se):se)}return ye},va:function(j,K){if(h.a.Tb(j),K)for(var Z=0,me=K.length;Z<me;Z++)j.appendChild(K[Z])},Xc:function(j,K){var Z=j.nodeType?[j]:j;if(0<Z.length){for(var me=Z[0],ye=me.parentNode,se=0,pe=K.length;se<pe;se++)ye.insertBefore(K[se],me);for(se=0,pe=Z.length;se<pe;se++)h.removeNode(Z[se])}},Ua:function(j,K){if(j.length){for(K=K.nodeType===8&&K.parentNode||K;j.length&&j[0].parentNode!==K;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==K;)j.length--;if(1<j.length){var Z=j[0],me=j[j.length-1];for(j.length=0;Z!==me;)j.push(Z),Z=Z.nextSibling;j.push(me)}}return j},Zc:function(j,K){7>Y?j.setAttribute("selected",K):j.selected=K},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,K){return j=j||"",K.length>j.length?!1:j.substring(0,K.length)===K},vd:function(j,K){if(j===K)return!0;if(j.nodeType===11)return!1;if(K.contains)return K.contains(j.nodeType!==1?j.parentNode:j);if(K.compareDocumentPosition)return(K.compareDocumentPosition(j)&16)==16;for(;j&&j!=K;)j=j.parentNode;return!!j},Sb:function(j){return h.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!h.a.Lb(j,h.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return h.onError?function(){try{return j.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:j},setTimeout:function(j,K){return setTimeout(h.a.Ac(j),K)},Gc:function(j){setTimeout(function(){throw h.onError&&h.onError(j),j},0)},B:function(j,K,Z){var me=h.a.Ac(Z);if(Z=U[K],h.options.useOnlyNativeEvents||Z||!r)if(Z||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var ye=function(pe){me.call(j,pe)},se="on"+K;j.attachEvent(se,ye),h.a.K.za(j,function(){j.detachEvent(se,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener(K,me,!1);else J||(J=typeof r(j).on=="function"?"on":"bind"),r(j)[J](K,me)},Fb:function(j,K){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(h.a.R(j)==="input"&&j.type&&K.toLowerCase()=="click"?(Z=j.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,h.options.useOnlyNativeEvents||!r||Z)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")Z=n.createEvent(G[K]||"HTMLEvents"),Z.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else r(j).trigger(K)},f:function(j){return h.O(j)?j():j},bc:function(j){return h.O(j)?j.v():j},Eb:function(j,K,Z){var me;K&&(typeof j.classList=="object"?(me=j.classList[Z?"add":"remove"],h.a.D(K.match(W),function(ye){me.call(j.classList,ye)})):typeof j.className.baseVal=="string"?I(j.className,"baseVal",K,Z):I(j,"className",K,Z))},Bb:function(j,K){var Z=h.a.f(K);(Z===null||Z===e)&&(Z="");var me=h.h.firstChild(j);!me||me.nodeType!=3||h.h.nextSibling(me)?h.h.va(j,[j.ownerDocument.createTextNode(Z)]):me.data=Z,h.a.Ad(j)},Yc:function(j,K){if(j.name=K,7>=Y)try{var Z=j.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(j){9<=Y&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(Y){var K=j.style.width;j.style.width=0,j.style.width=K}},Pd:function(j,K){j=h.a.f(j),K=h.a.f(K);for(var Z=[],me=j;me<=K;me++)Z.push(me);return Z},la:function(j){for(var K=[],Z=0,me=j.length;Z<me;Z++)K.push(j[Z]);return K},Da:function(j){return k?Symbol(j):j},Zd:Y===6,$d:Y===7,W:Y,Lc:function(j,K){for(var Z=h.a.la(j.getElementsByTagName("input")).concat(h.a.la(j.getElementsByTagName("textarea"))),me=typeof K=="string"?function(pe){return pe.name===K}:function(pe){return K.test(pe.name)},ye=[],se=Z.length-1;0<=se;se--)me(Z[se])&&ye.push(Z[se]);return ye},Nd:function(j){return typeof j=="string"&&(j=h.a.Db(j))?o&&o.parse?o.parse(j):new Function("return "+j)():null},hc:function(j,K,Z){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(h.a.f(j),K,Z)},Od:function(j,K,Z){Z=Z||{};var me=Z.params||{},ye=Z.includeFields||this.Jc,se=j;if(typeof j=="object"&&h.a.R(j)==="form")for(var se=j.action,pe=ye.length-1;0<=pe;pe--)for(var Ae=h.a.Lc(j,ye[pe]),De=Ae.length-1;0<=De;De--)me[Ae[De].name]=Ae[De].value;K=h.a.f(K);var Ce=n.createElement("form");Ce.style.display="none",Ce.action=se,Ce.method="post";for(var Re in K)j=n.createElement("input"),j.type="hidden",j.name=Re,j.value=h.a.hc(h.a.f(K[Re])),Ce.appendChild(j);_(me,function(tt,nt){var Wt=n.createElement("input");Wt.type="hidden",Wt.name=tt,Wt.value=nt,Ce.appendChild(Wt)}),n.body.appendChild(Ce),Z.submitter?Z.submitter(Ce):Ce.submit(),setTimeout(function(){Ce.parentNode.removeChild(Ce)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var b=this;if(arguments.length===1)return function(){return b.apply(_,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),b.apply(_,I)}}),h.a.g=new function(){var _=0,b="__ko__"+new Date().getTime(),v={},I,R;return h.a.W?(I=function(F,k){var V=F[b];if(!V||V==="null"||!v[V]){if(!k)return e;V=F[b]="ko"+_++,v[V]={}}return v[V]},R=function(F){var k=F[b];return k?(delete v[k],F[b]=null,!0):!1}):(I=function(F,k){var V=F[b];return!V&&k&&(V=F[b]={}),V},R=function(F){return F[b]?(delete F[b],!0):!1}),{get:function(F,k){var V=I(F,!1);return V&&V[k]},set:function(F,k,V){(F=I(F,V!==e))&&(F[k]=V)},Ub:function(F,k,V){return F=I(F,!0),F[k]||(F[k]=V)},clear:R,Z:function(){return _+++b}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(k,V){var G=h.a.g.get(k,I);return G===e&&V&&(G=[],h.a.g.set(k,I,G)),G}function b(k){var V=_(k,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](k);h.a.g.clear(k),h.a.K.cleanExternalData(k),F[k.nodeType]&&v(k.childNodes,!0)}function v(k,V){for(var G=[],U,Y=0;Y<k.length;Y++)if((!V||k[Y].nodeType===8)&&(b(G[G.length]=U=k[Y]),k[Y]!==U))for(;Y--&&h.a.A(G,k[Y])==-1;);}var I=h.a.g.Z(),R={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(k,V){if(typeof V!="function")throw Error("Callback must be a function");_(k,!0).push(V)},yb:function(k,V){var G=_(k,!1);G&&(h.a.Pa(G,V),G.length==0&&h.a.g.set(k,I,e))},oa:function(k){return h.u.G(function(){R[k.nodeType]&&(b(k),F[k.nodeType]&&v(k.getElementsByTagName("*")))}),k},removeNode:function(k){h.oa(k),k.parentNode&&k.parentNode.removeChild(k)},cleanExternalData:function(k){r&&typeof r.cleanData=="function"&&r.cleanData([k])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],b=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],R={thead:b,tbody:b,tfoot:b,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},F=8>=h.a.W;h.a.ua=function(k,V){var G;if(r){if(r.parseHTML)G=r.parseHTML(k,V)||[];else if((G=r.clean([k],V))&&G[0]){for(var U=G[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(G=V)||(G=n);var U=G.parentWindow||G.defaultView||t,Y=h.a.Db(k).toLowerCase(),W=G.createElement("div"),J;for(J=(Y=Y.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&R[Y[1]]||_,Y=J[0],J="ignored<div>"+J[1]+k+J[2]+"</div>",typeof U.innerShiv=="function"?W.appendChild(U.innerShiv(J)):(F&&G.body.appendChild(W),W.innerHTML=J,F&&W.parentNode.removeChild(W));Y--;)W=W.lastChild;G=h.a.la(W.lastChild.childNodes)}return G},h.a.Md=function(k,V){var G=h.a.ua(k,V);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(k,V){if(h.a.Tb(k),V=h.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),r)r(k).html(V);else for(var G=h.a.ua(V,k.ownerDocument),U=0;U<G.length;U++)k.appendChild(G[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(v,I){if(v){if(v.nodeType==8){var R=h.aa.Uc(v.nodeValue);R!=null&&I.push({ud:v,Kd:R})}else if(v.nodeType==1)for(var R=0,F=v.childNodes,k=F.length;R<k;R++)_(F[R],I)}}var b={};return{Xb:function(v){if(typeof v!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return b[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var R=b[v];if(R===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return R.apply(null,I||[]),!0}finally{delete b[v]}},cd:function(v,I){var R=[];_(v,R);for(var F=0,k=R.length;F<k;F++){var V=R[F].ud,G=[V];I&&h.a.Nb(G,I),h.aa.bd(R[F].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(R){for(var V=R,G=0,U;k<R;)if(U=I[k++]){if(k>V){if(5e3<=++G){k=R,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=R}try{U()}catch(Y){h.a.Gc(Y)}}}}function b(){_(),k=R=I.length=0}var v,I=[],R=0,F=1,k=0;return t.MutationObserver?v=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(b):v=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:v,zb:function(V){return R||h.na.scheduler(b),I[R++]=V,F++},cancel:function(V){V=V-(F-R),V>=k&&V<R&&(I[V]=null)},resetForTesting:function(){var V=R-k;return k=R=I.length=0,V},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,b){_.throttleEvaluation=b;var v=null;return h.$({read:_,write:function(I){clearTimeout(v),v=h.a.setTimeout(function(){_(I)},b)}})},rateLimit:function(_,b){var v,I,R;typeof b=="number"?v=b:(v=b.timeout,I=b.method),_.Hb=!1,R=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:l,_.ub(function(F){return R(F,v,b)})},deferred:function(_,b){if(b!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(v){var I,R=!1;return function(){if(!R){h.na.cancel(I),I=h.na.zb(v);try{R=!0,_.notifySubscribers(e,"dirty")}finally{R=!1}}}}))},notify:function(_,b){_.equalityComparer=b=="always"?null:c}};var A={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,b,v){this.da=_,this.lc=b,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,x),x.qb(this)};var x={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,b,v){var I=this;v=v||"change";var R=new h.ic(I,b?_.bind(b):_,function(){h.a.Pa(I.U[v],R),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(R),R},notifySubscribers:function(_,b){if(b=b||"change",b==="change"&&this.Gb(),this.Wa(b)){var v=b==="change"&&this.ed||this.U[b].slice(0);try{h.u.xc();for(var I=0,R;R=v[I];++I)R.Ib||R.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var b=this,v=h.O(b),I,R,F,k,V;b.gb||(b.gb=b.notifySubscribers,b.notifySubscribers=d);var G=_(function(){b.Ja=!1,v&&k===b&&(k=b.nc?b.nc():b());var U=R||V&&b.sb(F,k);V=R=I=!1,U&&b.gb(F=k)});b.qc=function(U,Y){Y&&b.Ja||(V=!Y),b.ed=b.U.change.slice(0),b.Ja=I=!0,k=U,G()},b.pc=function(U){I||(F=U,b.gb(U,"beforeChange"))},b.rc=function(){V=!0},b.gd=function(){b.sb(F,b.v(!0))&&(R=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var b=0;return h.a.P(this.U,function(v,I){v!=="dirty"&&(b+=I.length)}),b},sb:function(_,b){return!this.equalityComparer||!this.equalityComparer(_,b)},toString:function(){return"[object Object]"},extend:function(_){var b=this;return _&&h.a.P(_,function(v,I){var R=h.Ta[v];typeof R=="function"&&(b=R(b,I)||b)}),b}};h.L(x,"init",x.qb),h.L(x,"subscribe",x.subscribe),h.L(x,"extend",x.extend),h.L(x,"getSubscriptionsCount",x.Bd),h.a.Ba&&h.a.setPrototypeOf(x,Function.prototype),h.T.fn=x,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(F){v.push(I),I=F}function b(){I=v.pop()}var v=[],I,R=0;return{xc:_,end:b,cc:function(F){if(I){if(!h.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++R))}},G:function(F,k,V){try{return _(),F.apply(k,V||[])}finally{b()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function b(){return 0<arguments.length?(b.sb(b[C],arguments[0])&&(b.ya(),b[C]=arguments[0],b.xa()),this):(h.u.cc(b),b[C])}return b[C]=_,h.a.Ba||h.a.extend(b,h.T.fn),h.T.fn.qb(b),h.a.Ab(b,T),h.options.deferUpdates&&h.Ta.deferred(b,!0),b};var T={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(T,h.T.fn);var E=h.ta.Ma="__ko_proto__";T[E]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[E])&&_!==T[E]&&_!==h.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[E]===T[E]||_[E]===h.o.fn[E]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",T),h.L(T,"peek",T.v),h.L(T,"valueHasMutated",T.xa),h.L(T,"valueWillMutate",T.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var b=this.v(),v=[],I=typeof _!="function"||h.O(_)?function(k){return k===_}:_,R=0;R<b.length;R++){var F=b[R];if(I(F)){if(v.length===0&&this.ya(),b[R]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),b.splice(R,1),R--}}return v.length&&this.xa(),v},removeAll:function(_){if(_===e){var b=this.v(),v=b.slice(0);return this.ya(),b.splice(0,b.length),this.xa(),v}return _?this.remove(function(I){return 0<=h.a.A(_,I)}):[]},destroy:function(_){var b=this.v(),v=typeof _!="function"||h.O(_)?function(F){return F===_}:_;this.ya();for(var I=b.length-1;0<=I;I--){var R=b[I];v(R)&&(R._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(b){return 0<=h.a.A(_,b)}):[]},indexOf:function(_){var b=this();return h.a.A(b,_)},replace:function(_,b){var v=this.indexOf(_);0<=v&&(this.ya(),this.v()[v]=b,this.xa())},sorted:function(_){var b=this().slice(0);return _?b.sort(_):b.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var b=this.v();this.ya(),this.zc(b,_,arguments);var v=b[_].apply(b,arguments);return this.xa(),v===b?this:v}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var b=this();return b[_].apply(b,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,b){function v(){function W(){if(V){var J=[].concat(_.v()||[]),j;_.Wa("arrayChange")&&((!R||1<V)&&(R=h.a.Pb(G,J,_.Ob)),j=R),G=J,R=null,V=0,j&&j.length&&_.notifySubscribers(j,"arrayChange")}}I?W():(I=!0,k=_.subscribe(function(){++V},null,"spectate"),G=[].concat(_.v()||[]),R=null,F=_.subscribe(W))}if(_.Ob={},b&&typeof b=="object"&&h.a.extend(_.Ob,b),_.Ob.sparse=!0,!_.zc){var I=!1,R=null,F,k,V=0,G,U=_.Qa,Y=_.hb;_.Qa=function(W){U&&U.call(_,W),W==="arrayChange"&&v()},_.hb=function(W){Y&&Y.call(_,W),W!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),k&&k.s(),k=F=null,I=!1,G=e)},_.zc=function(W,J,j){function K(Ce,Re,tt){return Z[Z.length]={status:Ce,value:Re,index:tt}}if(I&&!V){var Z=[],me=W.length,ye=j.length,se=0;switch(J){case"push":se=me;case"unshift":for(J=0;J<ye;J++)K("added",j[J],se+J);break;case"pop":se=me-1;case"shift":me&&K("deleted",W[se],se);break;case"splice":J=Math.min(Math.max(0,0>j[0]?me+j[0]:j[0]),me);for(var me=ye===1?me:Math.min(J+(j[1]||0),me),ye=J+ye-2,se=Math.max(me,ye),pe=[],Ae=[],De=2;J<se;++J,++De)J<me&&Ae.push(K("deleted",W[J],J)),J<ye&&pe.push(K("added",j[De],J));h.a.Kc(Ae,pe);break;default:return}R=Z}}}};var S=h.a.Da("_state");h.o=h.$=function(_,b,v){function I(){if(0<arguments.length){if(typeof R=="function")R.apply(F.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return F.ra||h.u.cc(I),(F.ka||F.J&&I.Xa())&&I.ha(),F.X}if(typeof _=="object"?v=_:(v=v||{},_&&(v.read=_)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var R=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:b||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=F,I.Nc=typeof R=="function",h.a.Ba||h.a.extend(I,h.T.fn),h.T.fn.qb(I),h.a.Ab(I,w),v.pure?(F.wb=!0,F.J=!0,h.a.extend(I,D)):v.deferEvaluation&&h.a.extend(I,M),h.options.deferUpdates&&h.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||I.ha(),F.l&&I.ja()&&h.a.K.za(F.l,F.Rb=function(){I.s()}),I};var w={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(b,v){_[v.Ka]=v.da}),_},Vb:function(_){if(!this[S].V)return!1;var b=this.Va();return h.a.A(b,_)!==-1?!0:!!h.a.Lb(b,function(v){return v.Vb&&v.Vb(_)})},uc:function(_,b,v){if(this[S].wb&&b===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=v,v.Ka=this[S].V++,v.La=b.ob()},Xa:function(){var _,b,v=this[S].I;for(_ in v)if(Object.prototype.hasOwnProperty.call(v,_)&&(b=v[_],this.Ia&&b.da.Ja||b.da.Dd(b.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var b=_.subscribe(this.Jd,this,"dirty"),v=_.subscribe(this.Rd,this);return{da:_,s:function(){b.s(),v.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,b=_.throttleEvaluation;b&&0<=b?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},b)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var b=this[S],v=b.Sa,I=!1;if(!b.rb&&!b.ra){if(b.l&&!h.a.Sb(b.l)||v&&v()){if(!b.jc){this.s();return}}else b.jc=!1;b.rb=!0;try{I=this.zd(_)}finally{b.rb=!1}return I}},zd:function(_){var b=this[S],I=!1,v=b.wb?e:!b.V,I={qd:this,mb:b.I,Qb:b.V};h.u.xc({pd:I,od:g,o:this,Ya:v}),b.I={},b.V=0;var R=this.yd(b,I);return b.V?I=this.sb(b.X,R):(this.s(),I=!0),I&&(b.J?this.Gb():this.notifySubscribers(b.X,"beforeChange"),b.X=R,this.notifySubscribers(b.X,"spectate"),!b.J&&_&&this.notifySubscribers(b.X),this.rc&&this.rc()),v&&this.notifySubscribers(b.X,"awake"),I},yd:function(_,b){try{var v=_.Wc;return _.nb?v.call(_.nb):v()}finally{h.u.end(),b.Qb&&!_.J&&h.a.P(b.mb,p),_.sa=_.ka=!1}},v:function(_){var b=this[S];return(b.ka&&(_||!b.V)||b.J&&this.Xa())&&this.ha(),b.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(b){this.pc(this[S].X),this[S].ka=!0,b&&(this[S].sa=!0),this.qc(this,!b)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(b,v){v.s&&v.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var b=this,v=b[S];if(!v.ra&&v.J&&_=="change"){if(v.J=!1,v.sa||b.Xa())v.I=null,v.V=0,b.ha()&&b.Gb();else{var I=[];h.a.P(v.I,function(R,F){I[F.Ka]=R}),h.a.D(I,function(R,F){var k=v.I[R],V=b.$c(k.da);V.Ka=F,V.La=k.La,v.I[R]=V}),b.Xa()&&b.ha()&&b.Gb()}v.ra||b.notifySubscribers(v.X,"awake")}},hb:function(_){var b=this[S];b.ra||_!="change"||this.Wa("change")||(h.a.P(b.I,function(v,I){I.s&&(b.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),b.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},M={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(w,h.T.fn);var O=h.ta.Ma;w[O]=h.o,h.Oc=function(_){return typeof _=="function"&&_[O]===w[O]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",w),h.L(w,"peek",w.v),h.L(w,"dispose",w.s),h.L(w,"isActive",w.ja),h.L(w,"getDependenciesCount",w.qa),h.L(w,"getDependencies",w.Va),h.xb=function(_,b){return typeof _=="function"?h.o(_,b,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,b))},h.b("pureComputed",h.xb),function(){function _(I,R,F){if(F=F||new v,I=R(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var k=I instanceof Array?[]:{};return F.save(I,k),b(I,function(V){var G=R(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":k[V]=G;break;case"object":case"undefined":var U=F.get(G);k[V]=U!==e?U:_(G,R,F)}}),k}function b(I,R){if(I instanceof Array){for(var F=0;F<I.length;F++)R(F);typeof I.toJSON=="function"&&R("toJSON")}else for(F in I)R(F)}function v(){this.keys=[],this.values=[]}h.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(R){for(var F=0;h.O(R)&&10>F;F++)R=R();return R})},h.toJSON=function(I,R,F){return I=h.ad(I),h.a.hc(I,R,F)},v.prototype={constructor:v,save:function(I,R){var F=h.a.A(this.keys,I);0<=F?this.values[F]=R:(this.keys.push(I),this.values.push(R))},get:function(I){return I=h.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,b,v){function I(R){var F=h.xb(_,v).extend({ma:"always"}),k=F.subscribe(function(V){V&&(k.s(),R(V))});return F.notifySubscribers(F.v()),k}return typeof Promise!="function"||b?I(b.bind(v)):new Promise(I)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,b,v){switch(h.a.R(_)){case"option":typeof b=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=b):(h.a.g.set(_,h.c.options.$b,b),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof b=="number"?b:"");break;case"select":(b===""||b===null)&&(b=e);for(var I=-1,R=0,F=_.options.length,k;R<F;++R)if(k=h.w.M(_.options[R]),k==b||k===""&&b===e){I=R;break}(v||0<=I||b===e&&1<_.size)&&(_.selectedIndex=I,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(b===null||b===e)&&(b=""),_.value=b}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(V){V=h.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var G=[],U=V.match(I),Y,W=[],J=0;if(1<U.length){for(var j=0,K;K=U[j];++j){var Z=K.charCodeAt(0);if(Z===44){if(0>=J){G.push(Y&&W.length?{key:Y,value:W.join("")}:{unknown:Y||W.join("")}),Y=J=0,W=[];continue}}else if(Z===58){if(!J&&!Y&&W.length===1){Y=W.pop();continue}}else{if(Z===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Z===47&&j&&1<K.length?(Z=U[j-1].match(R))&&!F[Z[0]]&&(V=V.substr(V.indexOf(K)+1),U=V.match(I),j=-1,K="/"):Z===40||Z===123||Z===91?++J:Z===41||Z===125||Z===93?--J:Y||W.length||Z!==34&&Z!==39||(K=K.slice(1,-1))}W.push(K)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var b=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),R=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},k={};return{Ra:[],wa:k,ac:_,vb:function(V,G){function U(Z,me){var ye;if(!j){var se=h.getBindingHandler(Z);if(se&&se.preprocess&&!(me=se.preprocess(me,Z,U)))return;(se=k[Z])&&(ye=me,0<=h.a.A(b,ye)?ye=!1:(se=ye.match(v),ye=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ye),se=ye),se&&W.push("'"+(typeof k[Z]=="string"?k[Z]:Z)+"':function(_z){"+ye+"=_z}")}J&&(me="function(){return "+me+" }"),Y.push("'"+Z+"':"+me)}G=G||{};var Y=[],W=[],J=G.valueAccessors,j=G.bindingParams,K=typeof V=="string"?_(V):V;return h.a.D(K,function(Z){U(Z.key||Z.unknown,Z.value)}),W.length&&U("_ko_property_writers","{"+W.join(",")+" }"),Y.join(",")},Id:function(V,G){for(var U=0;U<V.length;U++)if(V[U].key==G)return!0;return!1},eb:function(V,G,U,Y,W){V&&h.O(V)?!h.Za(V)||W&&V.v()===Y||V(Y):(V=G.get("_ko_property_writers"))&&V[U]&&V[U](Y)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(U){return U.nodeType==8&&F.test(R?U.text:U.nodeValue)}function b(U){return U.nodeType==8&&k.test(R?U.text:U.nodeValue)}function v(U,Y){for(var W=U,J=1,j=[];W=W.nextSibling;){if(b(W)&&(h.a.g.set(W,G,!0),J--,J===0))return j;j.push(W),_(W)&&J++}if(!Y)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,Y){var W=v(U,Y);return W?0<W.length?W[W.length-1].nextSibling:U.nextSibling:null}var R=n&&n.createComment("test").text==="<!--test-->",F=R?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=R?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return _(U)?v(U):U.childNodes},Ea:function(U){if(_(U)){U=h.h.childNodes(U);for(var Y=0,W=U.length;Y<W;Y++)h.removeNode(U[Y])}else h.a.Tb(U)},va:function(U,Y){if(_(U)){h.h.Ea(U);for(var W=U.nextSibling,J=0,j=Y.length;J<j;J++)W.parentNode.insertBefore(Y[J],W)}else h.a.va(U,Y)},Vc:function(U,Y){var W;_(U)?(W=U.nextSibling,U=U.parentNode):W=U.firstChild,W?Y!==W&&U.insertBefore(Y,W):U.appendChild(Y)},Wb:function(U,Y,W){W?(W=W.nextSibling,_(U)&&(U=U.parentNode),W?Y!==W&&U.insertBefore(Y,W):U.appendChild(Y)):h.h.Vc(U,Y)},firstChild:function(U){if(_(U))return!U.nextSibling||b(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&b(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&b(U.nextSibling)){var Y=U.nextSibling;if(b(Y)&&!h.a.g.get(Y,G))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(R?U.text:U.nodeValue).match(F))?U[1]:null},Sc:function(U){if(V[h.a.R(U)]){var Y=U.firstChild;if(Y)do if(Y.nodeType===1){var W;W=Y.firstChild;var J=null;if(W)do if(J)J.push(W);else if(_(W)){var j=I(W,!0);j?W=j:J=[W]}else b(W)&&(J=[W]);while(W=W.nextSibling);if(W=J)for(J=Y.nextSibling,j=0;j<W.length;j++)J?U.insertBefore(W[j],J):U.appendChild(W[j])}while(Y=Y.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_):null;return h.j.tc(v,_,b,!1)},getBindingAccessors:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_,{valueAccessors:!0}):null;return h.j.tc(v,_,b,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,b,v,I){try{var R=this.nd,F=_+(I&&I.valueAccessors||""),k;if(!(k=R[F])){var V,G="with($context){with($data||{}){return{"+h.m.vb(_,I)+"}}}";V=new Function("$context","$element",G),k=R[F]=V}return k(b,v)}catch(U){throw U.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,E){return _===null||typeof _ in x?_===E:!1}function u(_,E){var w;return function(){w||(w=h.a.setTimeout(function(){w=e,_()},E))}}function f(_,E){var w;return function(){clearTimeout(w),w=h.a.setTimeout(_,E)}}function d(_,E){E&&E!=="change"?E==="beforeChange"?this.pc(_):this.gb(_,E):this.qc(_)}function p(_,E){E!==null&&E.s&&E.s()}function g(_,E){var w=this.qd,P=w[S];P.ra||(this.Qb&&this.mb[E]?(w.uc(E,_,this.mb[E]),this.mb[E]=null,--this.Qb):P.I[E]||w.uc(E,_,P.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,E){for(var w=_.split("."),P=h,M=0;M<w.length-1;M++)P=P[w[M]];P[w[w.length-1]]=E},h.L=function(_,E,w){_[E]=w},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(W,K){for(var Z in W)M.call(W,Z)&&K(Z,W[Z])}function E(W,K){if(K)for(var Z in K)M.call(K,Z)&&(W[Z]=K[Z]);return W}function w(W,K){return W.__proto__=K,W}function P(W,K,Z,he){var ge=W[K].match(j)||[];h.a.D(Z.match(j),function(se){h.a.Na(ge,se,he)}),W[K]=ge.join(" ")}var M=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,V=typeof Symbol=="function",U={},G={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(U,function(W,K){if(K.length)for(var Z=0,he=K.length;Z<he;Z++)G[K[Z]]=W});var k={propertychange:!0},Y=n&&function(){for(var W=3,K=n.createElement("div"),Z=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",Z[0];);return 4<W?W:e}(),j=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,Z){for(var he=0,ge=W.length;he<ge;he++)K.call(Z,W[he],he,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var Z=0,he=W.length;Z<he;Z++)if(W[Z]===K)return Z;return-1},Lb:function(W,K,Z){for(var he=0,ge=W.length;he<ge;he++)if(K.call(Z,W[he],he,W))return W[he];return e},Pa:function(W,K){var Z=h.a.A(W,K);0<Z?W.splice(Z,1):Z===0&&W.shift()},wc:function(W){var K=[];return W&&h.a.D(W,function(Z){0>h.a.A(K,Z)&&K.push(Z)}),K},Mb:function(W,K,Z){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)he.push(K.call(Z,W[ge],ge));return he},jb:function(W,K,Z){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)K.call(Z,W[ge],ge)&&he.push(W[ge]);return he},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var Z=0,he=K.length;Z<he;Z++)W.push(K[Z]);return W},Na:function(W,K,Z){var he=h.a.A(h.a.bc(W),K);0>he?Z&&W.push(K):Z||W.splice(he,1)},Ba:B,extend:E,setPrototypeOf:w,Ab:B?w:E,P:_,Ga:function(W,K,Z){if(!W)return W;var he={},ge;for(ge in W)M.call(W,ge)&&(he[ge]=K.call(Z,W[ge],ge,W));return he},Tb:function(W){for(;W.firstChild;)h.removeNode(W.firstChild)},Yb:function(W){W=h.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),Z=0,he=W.length;Z<he;Z++)K.appendChild(h.oa(W[Z]));return K},Ca:function(W,K){for(var Z=0,he=W.length,ge=[];Z<he;Z++){var se=W[Z].cloneNode(!0);ge.push(K?h.oa(se):se)}return ge},va:function(W,K){if(h.a.Tb(W),K)for(var Z=0,he=K.length;Z<he;Z++)W.appendChild(K[Z])},Xc:function(W,K){var Z=W.nodeType?[W]:W;if(0<Z.length){for(var he=Z[0],ge=he.parentNode,se=0,pe=K.length;se<pe;se++)ge.insertBefore(K[se],he);for(se=0,pe=Z.length;se<pe;se++)h.removeNode(Z[se])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var Z=W[0],he=W[W.length-1];for(W.length=0;Z!==he;)W.push(Z),Z=Z.nextSibling;W.push(he)}}return W},Zc:function(W,K){7>Y?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return h.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!h.a.Lb(W,h.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return h.onError?function(){try{return W.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(h.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw h.onError&&h.onError(W),W},0)},B:function(W,K,Z){var he=h.a.Ac(Z);if(Z=k[K],h.options.useOnlyNativeEvents||Z||!r)if(Z||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ge=function(pe){he.call(W,pe)},se="on"+K;W.attachEvent(se,ge),h.a.K.za(W,function(){W.detachEvent(se,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,he,!1);else J||(J=typeof r(W).on=="function"?"on":"bind"),r(W)[J](K,he)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(h.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(Z=W.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,h.options.useOnlyNativeEvents||!r||Z)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")Z=n.createEvent(G[K]||"HTMLEvents"),Z.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else r(W).trigger(K)},f:function(W){return h.O(W)?W():W},bc:function(W){return h.O(W)?W.v():W},Eb:function(W,K,Z){var he;K&&(typeof W.classList=="object"?(he=W.classList[Z?"add":"remove"],h.a.D(K.match(j),function(ge){he.call(W.classList,ge)})):typeof W.className.baseVal=="string"?P(W.className,"baseVal",K,Z):P(W,"className",K,Z))},Bb:function(W,K){var Z=h.a.f(K);(Z===null||Z===e)&&(Z="");var he=h.h.firstChild(W);!he||he.nodeType!=3||h.h.nextSibling(he)?h.h.va(W,[W.ownerDocument.createTextNode(Z)]):he.data=Z,h.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=Y)try{var Z=W.name.replace(/[&<>'"]/g,function(he){return"&#"+he.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(W){9<=Y&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(Y){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=h.a.f(W),K=h.a.f(K);for(var Z=[],he=W;he<=K;he++)Z.push(he);return Z},la:function(W){for(var K=[],Z=0,he=W.length;Z<he;Z++)K.push(W[Z]);return K},Da:function(W){return V?Symbol(W):W},Zd:Y===6,$d:Y===7,W:Y,Lc:function(W,K){for(var Z=h.a.la(W.getElementsByTagName("input")).concat(h.a.la(W.getElementsByTagName("textarea"))),he=typeof K=="string"?function(pe){return pe.name===K}:function(pe){return K.test(pe.name)},ge=[],se=Z.length-1;0<=se;se--)he(Z[se])&&ge.push(Z[se]);return ge},Nd:function(W){return typeof W=="string"&&(W=h.a.Db(W))?o&&o.parse?o.parse(W):new Function("return "+W)():null},hc:function(W,K,Z){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(h.a.f(W),K,Z)},Od:function(W,K,Z){Z=Z||{};var he=Z.params||{},ge=Z.includeFields||this.Jc,se=W;if(typeof W=="object"&&h.a.R(W)==="form")for(var se=W.action,pe=ge.length-1;0<=pe;pe--)for(var xe=h.a.Lc(W,ge[pe]),Pe=xe.length-1;0<=Pe;Pe--)he[xe[Pe].name]=xe[Pe].value;K=h.a.f(K);var we=n.createElement("form");we.style.display="none",we.action=se,we.method="post";for(var Se in K)W=n.createElement("input"),W.type="hidden",W.name=Se,W.value=h.a.hc(h.a.f(K[Se])),we.appendChild(W);_(he,function(nt,Ze){var Gt=n.createElement("input");Gt.type="hidden",Gt.name=nt,Gt.value=Ze,we.appendChild(Gt)}),n.body.appendChild(we),Z.submitter?Z.submitter(we):we.submit(),setTimeout(function(){we.parentNode.removeChild(we)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var E=this;if(arguments.length===1)return function(){return E.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var P=w.slice(0);return P.push.apply(P,arguments),E.apply(_,P)}}),h.a.g=new function(){var _=0,E="__ko__"+new Date().getTime(),w={},P,M;return h.a.W?(P=function(B,V){var U=B[E];if(!U||U==="null"||!w[U]){if(!V)return e;U=B[E]="ko"+_++,w[U]={}}return w[U]},M=function(B){var V=B[E];return V?(delete w[V],B[E]=null,!0):!1}):(P=function(B,V){var U=B[E];return!U&&V&&(U=B[E]={}),U},M=function(B){return B[E]?(delete B[E],!0):!1}),{get:function(B,V){var U=P(B,!1);return U&&U[V]},set:function(B,V,U){(B=P(B,U!==e))&&(B[V]=U)},Ub:function(B,V,U){return B=P(B,!0),B[V]||(B[V]=U)},clear:M,Z:function(){return _+++E}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(V,U){var G=h.a.g.get(V,P);return G===e&&U&&(G=[],h.a.g.set(V,P,G)),G}function E(V){var U=_(V,!1);if(U)for(var U=U.slice(0),G=0;G<U.length;G++)U[G](V);h.a.g.clear(V),h.a.K.cleanExternalData(V),B[V.nodeType]&&w(V.childNodes,!0)}function w(V,U){for(var G=[],k,Y=0;Y<V.length;Y++)if((!U||V[Y].nodeType===8)&&(E(G[G.length]=k=V[Y]),V[Y]!==k))for(;Y--&&h.a.A(G,V[Y])==-1;);}var P=h.a.g.Z(),M={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(V,U){if(typeof U!="function")throw Error("Callback must be a function");_(V,!0).push(U)},yb:function(V,U){var G=_(V,!1);G&&(h.a.Pa(G,U),G.length==0&&h.a.g.set(V,P,e))},oa:function(V){return h.u.G(function(){M[V.nodeType]&&(E(V),B[V.nodeType]&&w(V.getElementsByTagName("*")))}),V},removeNode:function(V){h.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){r&&typeof r.cleanData=="function"&&r.cleanData([V])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],E=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],P=[1,"<select multiple='multiple'>","</select>"],M={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:P,optgroup:P},B=8>=h.a.W;h.a.ua=function(V,U){var G;if(r){if(r.parseHTML)G=r.parseHTML(V,U)||[];else if((G=r.clean([V],U))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=U)||(G=n);var k=G.parentWindow||G.defaultView||t,Y=h.a.Db(V).toLowerCase(),j=G.createElement("div"),J;for(J=(Y=Y.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[Y[1]]||_,Y=J[0],J="ignored<div>"+J[1]+V+J[2]+"</div>",typeof k.innerShiv=="function"?j.appendChild(k.innerShiv(J)):(B&&G.body.appendChild(j),j.innerHTML=J,B&&j.parentNode.removeChild(j));Y--;)j=j.lastChild;G=h.a.la(j.lastChild.childNodes)}return G},h.a.Md=function(V,U){var G=h.a.ua(V,U);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(V,U){if(h.a.Tb(V),U=h.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),r)r(V).html(U);else for(var G=h.a.ua(U,V.ownerDocument),k=0;k<G.length;k++)V.appendChild(G[k])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(w,P){if(w){if(w.nodeType==8){var M=h.aa.Uc(w.nodeValue);M!=null&&P.push({ud:w,Kd:M})}else if(w.nodeType==1)for(var M=0,B=w.childNodes,V=B.length;M<V;M++)_(B[M],P)}}var E={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var P=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[P]=w,"<!--[ko_memo:"+P+"]-->"},bd:function(w,P){var M=E[w];if(M===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return M.apply(null,P||[]),!0}finally{delete E[w]}},cd:function(w,P){var M=[];_(w,M);for(var B=0,V=M.length;B<V;B++){var U=M[B].ud,G=[U];P&&h.a.Nb(G,P),h.aa.bd(M[B].Kd,G),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(M){for(var U=M,G=0,k;V<M;)if(k=P[V++]){if(V>U){if(5e3<=++G){V=M,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}U=M}try{k()}catch(Y){h.a.Gc(Y)}}}}function E(){_(),V=M=P.length=0}var w,P=[],M=0,B=1,V=0;return t.MutationObserver?w=function(U){var G=n.createElement("div");return new MutationObserver(U).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(E):w=n&&"onreadystatechange"in n.createElement("script")?function(U){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,U()},n.documentElement.appendChild(G)}:function(U){setTimeout(U,0)},{scheduler:w,zb:function(U){return M||h.na.scheduler(E),P[M++]=U,B++},cancel:function(U){U=U-(B-M),U>=V&&U<M&&(P[U]=null)},resetForTesting:function(){var U=M-V;return V=M=P.length=0,U},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,E){_.throttleEvaluation=E;var w=null;return h.$({read:_,write:function(P){clearTimeout(w),w=h.a.setTimeout(function(){_(P)},E)}})},rateLimit:function(_,E){var w,P,M;typeof E=="number"?w=E:(w=E.timeout,P=E.method),_.Hb=!1,M=typeof P=="function"?P:P=="notifyWhenChangesStop"?f:u,_.ub(function(B){return M(B,w,E)})},deferred:function(_,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var P,M=!1;return function(){if(!M){h.na.cancel(P),P=h.na.zb(w);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,E){_.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,E,w){this.da=_,this.lc=E,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,E,w){var P=this;w=w||"change";var M=new h.ic(P,E?_.bind(E):_,function(){h.a.Pa(P.U[w],M),P.hb&&P.hb(w)});return P.Qa&&P.Qa(w),P.U[w]||(P.U[w]=[]),P.U[w].push(M),M},notifySubscribers:function(_,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var w=E==="change"&&this.ed||this.U[E].slice(0);try{h.u.xc();for(var P=0,M;M=w[P];++P)M.Ib||M.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var E=this,w=h.O(E),P,M,B,V,U;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var G=_(function(){E.Ja=!1,w&&V===E&&(V=E.nc?E.nc():E());var k=M||U&&E.sb(B,V);U=M=P=!1,k&&E.gb(B=V)});E.qc=function(k,Y){Y&&E.Ja||(U=!Y),E.ed=E.U.change.slice(0),E.Ja=P=!0,V=k,G()},E.pc=function(k){P||(B=k,E.gb(k,"beforeChange"))},E.rc=function(){U=!0},E.gd=function(){E.sb(B,E.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var E=0;return h.a.P(this.U,function(w,P){w!=="dirty"&&(E+=P.length)}),E},sb:function(_,E){return!this.equalityComparer||!this.equalityComparer(_,E)},toString:function(){return"[object Object]"},extend:function(_){var E=this;return _&&h.a.P(_,function(w,P){var M=h.Ta[w];typeof M=="function"&&(E=M(E,P)||E)}),E}};h.L(b,"init",b.qb),h.L(b,"subscribe",b.subscribe),h.L(b,"extend",b.extend),h.L(b,"getSubscriptionsCount",b.Bd),h.a.Ba&&h.a.setPrototypeOf(b,Function.prototype),h.T.fn=b,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(B){w.push(P),P=B}function E(){P=w.pop()}var w=[],P,M=0;return{xc:_,end:E,cc:function(B){if(P){if(!h.Qc(B))throw Error("Only subscribable things can act as dependencies");P.od.call(P.pd,B,B.fd||(B.fd=++M))}},G:function(B,V,U){try{return _(),B.apply(V,U||[])}finally{E()}},qa:function(){if(P)return P.o.qa()},Va:function(){if(P)return P.o.Va()},Ya:function(){if(P)return P.Ya},o:function(){if(P)return P.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function E(){return 0<arguments.length?(E.sb(E[C],arguments[0])&&(E.ya(),E[C]=arguments[0],E.xa()),this):(h.u.cc(E),E[C])}return E[C]=_,h.a.Ba||h.a.extend(E,h.T.fn),h.T.fn.qb(E),h.a.Ab(E,A),h.options.deferUpdates&&h.Ta.deferred(E,!0),E};var A={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(A,h.T.fn);var T=h.ta.Ma="__ko_proto__";A[T]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==A[T]&&_!==h.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[T]===A[T]||_[T]===h.o.fn[T]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",A),h.L(A,"peek",A.v),h.L(A,"valueHasMutated",A.xa),h.L(A,"valueWillMutate",A.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var E=this.v(),w=[],P=typeof _!="function"||h.O(_)?function(V){return V===_}:_,M=0;M<E.length;M++){var B=E[M];if(P(B)){if(w.length===0&&this.ya(),E[M]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),E.splice(M,1),M--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var E=this.v(),w=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),w}return _?this.remove(function(P){return 0<=h.a.A(_,P)}):[]},destroy:function(_){var E=this.v(),w=typeof _!="function"||h.O(_)?function(B){return B===_}:_;this.ya();for(var P=E.length-1;0<=P;P--){var M=E[P];w(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(E){return 0<=h.a.A(_,E)}):[]},indexOf:function(_){var E=this();return h.a.A(E,_)},replace:function(_,E){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=E,this.xa())},sorted:function(_){var E=this().slice(0);return _?E.sort(_):E.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var E=this.v();this.ya(),this.zc(E,_,arguments);var w=E[_].apply(E,arguments);return this.xa(),w===E?this:w}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var E=this();return E[_].apply(E,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,E){function w(){function j(){if(U){var J=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<U)&&(M=h.a.Pb(G,J,_.Ob)),W=M),G=J,M=null,U=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}P?j():(P=!0,V=_.subscribe(function(){++U},null,"spectate"),G=[].concat(_.v()||[]),M=null,B=_.subscribe(j))}if(_.Ob={},E&&typeof E=="object"&&h.a.extend(_.Ob,E),_.Ob.sparse=!0,!_.zc){var P=!1,M=null,B,V,U=0,G,k=_.Qa,Y=_.hb;_.Qa=function(j){k&&k.call(_,j),j==="arrayChange"&&w()},_.hb=function(j){Y&&Y.call(_,j),j!=="arrayChange"||_.Wa("arrayChange")||(B&&B.s(),V&&V.s(),V=B=null,P=!1,G=e)},_.zc=function(j,J,W){function K(we,Se,nt){return Z[Z.length]={status:we,value:Se,index:nt}}if(P&&!U){var Z=[],he=j.length,ge=W.length,se=0;switch(J){case"push":se=he;case"unshift":for(J=0;J<ge;J++)K("added",W[J],se+J);break;case"pop":se=he-1;case"shift":he&&K("deleted",j[se],se);break;case"splice":J=Math.min(Math.max(0,0>W[0]?he+W[0]:W[0]),he);for(var he=ge===1?he:Math.min(J+(W[1]||0),he),ge=J+ge-2,se=Math.max(he,ge),pe=[],xe=[],Pe=2;J<se;++J,++Pe)J<he&&xe.push(K("deleted",j[J],J)),J<ge&&pe.push(K("added",W[Pe],J));h.a.Kc(xe,pe);break;default:return}M=Z}}}};var S=h.a.Da("_state");h.o=h.$=function(_,E,w){function P(){if(0<arguments.length){if(typeof M=="function")M.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||h.u.cc(P),(B.ka||B.J&&P.Xa())&&P.ha(),B.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:E||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return P[S]=B,P.Nc=typeof M=="function",h.a.Ba||h.a.extend(P,h.T.fn),h.T.fn.qb(P),h.a.Ab(P,v),w.pure?(B.wb=!0,B.J=!0,h.a.extend(P,I)):w.deferEvaluation&&h.a.extend(P,O),h.options.deferUpdates&&h.Ta.deferred(P,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||P.ha(),B.l&&P.ja()&&h.a.K.za(B.l,B.Rb=function(){P.s()}),P};var v={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(E,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[S].V)return!1;var E=this.Va();return h.a.A(E,_)!==-1?!0:!!h.a.Lb(E,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,E,w){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=w,w.Ka=this[S].V++,w.La=E.ob()},Xa:function(){var _,E,w=this[S].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(E=w[_],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var E=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){E.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,E=_.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},E)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var E=this[S],w=E.Sa,P=!1;if(!E.rb&&!E.ra){if(E.l&&!h.a.Sb(E.l)||w&&w()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{P=this.zd(_)}finally{E.rb=!1}return P}},zd:function(_){var E=this[S],P=!1,w=E.wb?e:!E.V,P={qd:this,mb:E.I,Qb:E.V};h.u.xc({pd:P,od:g,o:this,Ya:w}),E.I={},E.V=0;var M=this.yd(E,P);return E.V?P=this.sb(E.X,M):(this.s(),P=!0),P&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=M,this.notifySubscribers(E.X,"spectate"),!E.J&&_&&this.notifySubscribers(E.X),this.rc&&this.rc()),w&&this.notifySubscribers(E.X,"awake"),P},yd:function(_,E){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{h.u.end(),E.Qb&&!_.J&&h.a.P(E.mb,p),_.sa=_.ka=!1}},v:function(_){var E=this[S];return(E.ka&&(_||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(E,w){w.s&&w.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},I={Qa:function(_){var E=this,w=E[S];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||E.Xa())w.I=null,w.V=0,E.ha()&&E.Gb();else{var P=[];h.a.P(w.I,function(M,B){P[B.Ka]=M}),h.a.D(P,function(M,B){var V=w.I[M],U=E.$c(V.da);U.Ka=B,U.La=V.La,w.I[M]=U}),E.Xa()&&E.ha()&&E.Gb()}w.ra||E.notifySubscribers(w.X,"awake")}},hb:function(_){var E=this[S];E.ra||_!="change"||this.Wa("change")||(h.a.P(E.I,function(w,P){P.s&&(E.I[w]={da:P.da,Ka:P.Ka,La:P.La},P.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},O={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(v,h.T.fn);var R=h.ta.Ma;v[R]=h.o,h.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",v),h.L(v,"peek",v.v),h.L(v,"dispose",v.s),h.L(v,"isActive",v.ja),h.L(v,"getDependenciesCount",v.qa),h.L(v,"getDependencies",v.Va),h.xb=function(_,E){return typeof _=="function"?h.o(_,E,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,E))},h.b("pureComputed",h.xb),function(){function _(P,M,B){if(B=B||new w,P=M(P),typeof P!="object"||P===null||P===e||P instanceof RegExp||P instanceof Date||P instanceof String||P instanceof Number||P instanceof Boolean)return P;var V=P instanceof Array?[]:{};return B.save(P,V),E(P,function(U){var G=M(P[U]);switch(typeof G){case"boolean":case"number":case"string":case"function":V[U]=G;break;case"object":case"undefined":var k=B.get(G);V[U]=k!==e?k:_(G,M,B)}}),V}function E(P,M){if(P instanceof Array){for(var B=0;B<P.length;B++)M(B);typeof P.toJSON=="function"&&M("toJSON")}else for(B in P)M(B)}function w(){this.keys=[],this.values=[]}h.ad=function(P){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(P,function(M){for(var B=0;h.O(M)&&10>B;B++)M=M();return M})},h.toJSON=function(P,M,B){return P=h.ad(P),h.a.hc(P,M,B)},w.prototype={constructor:w,save:function(P,M){var B=h.a.A(this.keys,P);0<=B?this.values[B]=M:(this.keys.push(P),this.values.push(M))},get:function(P){return P=h.a.A(this.keys,P),0<=P?this.values[P]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,E,w){function P(M){var B=h.xb(_,w).extend({ma:"always"}),V=B.subscribe(function(U){U&&(V.s(),M(U))});return B.notifySubscribers(B.v()),V}return typeof Promise!="function"||E?P(E.bind(w)):new Promise(P)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,E,w){switch(h.a.R(_)){case"option":typeof E=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=E):(h.a.g.set(_,h.c.options.$b,E),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var P=-1,M=0,B=_.options.length,V;M<B;++M)if(V=h.w.M(_.options[M]),V==E||V===""&&E===e){P=M;break}(w||0<=P||E===e&&1<_.size)&&(_.selectedIndex=P,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=P},0));break;default:(E===null||E===e)&&(E=""),_.value=E}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(U){U=h.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=` +,`;var G=[],k=U.match(P),Y,j=[],J=0;if(1<k.length){for(var W=0,K;K=k[W];++W){var Z=K.charCodeAt(0);if(Z===44){if(0>=J){G.push(Y&&j.length?{key:Y,value:j.join("")}:{unknown:Y||j.join("")}),Y=J=0,j=[];continue}}else if(Z===58){if(!J&&!Y&&j.length===1){Y=j.pop();continue}}else{if(Z===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Z===47&&W&&1<K.length?(Z=k[W-1].match(M))&&!B[Z[0]]&&(U=U.substr(U.indexOf(K)+1),k=U.match(P),W=-1,K="/"):Z===40||Z===123||Z===91?++J:Z===41||Z===125||Z===93?--J:Y||j.length||Z!==34&&Z!==39||(K=K.slice(1,-1))}j.push(K)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var E=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,P=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(U,G){function k(Z,he){var ge;if(!W){var se=h.getBindingHandler(Z);if(se&&se.preprocess&&!(he=se.preprocess(he,Z,k)))return;(se=V[Z])&&(ge=he,0<=h.a.A(E,ge)?ge=!1:(se=ge.match(w),ge=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ge),se=ge),se&&j.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+ge+"=_z}")}J&&(he="function(){return "+he+" }"),Y.push("'"+Z+"':"+he)}G=G||{};var Y=[],j=[],J=G.valueAccessors,W=G.bindingParams,K=typeof U=="string"?_(U):U;return h.a.D(K,function(Z){k(Z.key||Z.unknown,Z.value)}),j.length&&k("_ko_property_writers","{"+j.join(",")+" }"),Y.join(",")},Id:function(U,G){for(var k=0;k<U.length;k++)if(U[k].key==G)return!0;return!1},eb:function(U,G,k,Y,j){U&&h.O(U)?!h.Za(U)||j&&U.v()===Y||U(Y):(U=G.get("_ko_property_writers"))&&U[k]&&U[k](Y)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(k){return k.nodeType==8&&B.test(M?k.text:k.nodeValue)}function E(k){return k.nodeType==8&&V.test(M?k.text:k.nodeValue)}function w(k,Y){for(var j=k,J=1,W=[];j=j.nextSibling;){if(E(j)&&(h.a.g.set(j,G,!0),J--,J===0))return W;W.push(j),_(j)&&J++}if(!Y)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function P(k,Y){var j=w(k,Y);return j?0<j.length?j[j.length-1].nextSibling:k.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",B=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=h.h.childNodes(k);for(var Y=0,j=k.length;Y<j;Y++)h.removeNode(k[Y])}else h.a.Tb(k)},va:function(k,Y){if(_(k)){h.h.Ea(k);for(var j=k.nextSibling,J=0,W=Y.length;J<W;J++)j.parentNode.insertBefore(Y[J],j)}else h.a.va(k,Y)},Vc:function(k,Y){var j;_(k)?(j=k.nextSibling,k=k.parentNode):j=k.firstChild,j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)},Wb:function(k,Y,j){j?(j=j.nextSibling,_(k)&&(k=k.parentNode),j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)):h.h.Vc(k,Y)},firstChild:function(k){if(_(k))return!k.nextSibling||E(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&E(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=P(k)),k.nextSibling&&E(k.nextSibling)){var Y=k.nextSibling;if(E(Y)&&!h.a.g.get(Y,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(M?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(U[h.a.R(k)]){var Y=k.firstChild;if(Y)do if(Y.nodeType===1){var j;j=Y.firstChild;var J=null;if(j)do if(J)J.push(j);else if(_(j)){var W=P(j,!0);W?j=W:J=[j]}else E(j)&&(J=[j]);while(j=j.nextSibling);if(j=J)for(J=Y.nextSibling,W=0;W<j.length;W++)J?k.insertBefore(j[W],J):k.appendChild(j[W])}while(Y=Y.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_):null;return h.j.tc(w,_,E,!1)},getBindingAccessors:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_,{valueAccessors:!0}):null;return h.j.tc(w,_,E,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,E,w,P){try{var M=this.nd,B=_+(P&&P.valueAccessors||""),V;if(!(V=M[B])){var U,G="with($context){with($data||{}){return{"+h.m.vb(_,P)+"}}}";U=new Function("$context","$element",G),V=M[B]=U}return V(E,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var pe=(se=h.a.g.get(se,ye))&&se.N;pe&&(se.N=null,pe.Tc())}function b(se,pe,Ae){this.node=se,this.yc=pe,this.kb=[],this.H=!1,pe.N||h.a.K.za(se,_),Ae&&Ae.N&&(Ae.N.kb.push(se),this.Kb=Ae)}function v(se){return function(){return se}}function I(se){return se()}function R(se){return h.a.Ga(h.u.G(se),function(pe,Ae){return function(){return se()[Ae]}})}function F(se,pe,Ae){return typeof se=="function"?R(se.bind(null,pe,Ae)):h.a.Ga(se,v)}function k(se,pe){return R(this.getBindings.bind(this,se,pe))}function V(se,pe){var Ae=h.h.firstChild(pe);if(Ae){var De,Ce=h.ga.instance,Re=Ce.preprocessNode;if(Re){for(;De=Ae;)Ae=h.h.nextSibling(De),Re.call(Ce,De);Ae=h.h.firstChild(pe)}for(;De=Ae;)Ae=h.h.nextSibling(De),G(se,De)}h.i.ma(pe,h.i.H)}function G(se,pe){var Ae=se,De=pe.nodeType===1;De&&h.h.Sc(pe),(De||h.ga.instance.nodeHasBindings(pe))&&(Ae=Y(pe,null,se).bindingContextForDescendants),Ae&&!Z[h.a.R(pe)]&&V(Ae,pe)}function U(se){var pe=[],Ae={},De=[];return h.a.P(se,function Ce(Re){if(!Ae[Re]){var tt=h.getBindingHandler(Re);tt&&(tt.after&&(De.push(Re),h.a.D(tt.after,function(nt){if(se[nt]){if(h.a.A(De,nt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ce(nt)}}),De.length--),pe.push({key:Re,Mc:tt})),Ae[Re]=!0}}),pe}function Y(se,pe,Ae){var De=h.a.g.Ub(se,ye,{}),Ce=De.hd;if(!pe){if(Ce)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ce||(De.context=Ae),De.Zb||(De.Zb={});var Re;if(pe&&typeof pe!="function")Re=pe;else{var tt=h.ga.instance,nt=tt.getBindingAccessors||k,Wt=h.$(function(){return(Re=pe?pe(Ae,se):nt.call(tt,se,Ae))&&(Ae[J]&&Ae[J](),Ae[K]&&Ae[K]()),Re},null,{l:se});Re&&Wt.ja()||(Wt=null)}var un=Ae,pt;if(Re){var gn=function(){return h.a.Ga(Wt?Wt():Re,I)},Bn=Wt?function(Ut){return function(){return I(Wt()[Ut])}}:function(Ut){return Re[Ut]};gn.get=function(Ut){return Re[Ut]&&I(Bn(Ut))},gn.has=function(Ut){return Ut in Re},h.i.H in Re&&h.i.subscribe(se,h.i.H,function(){var Ut=(0,Re[h.i.H])();if(Ut){var kt=h.h.childNodes(se);kt.length&&Ut(kt,h.Ec(kt[0]))}}),h.i.pa in Re&&(un=h.i.Cb(se,Ae),h.i.subscribe(se,h.i.pa,function(){var Ut=(0,Re[h.i.pa])();Ut&&h.h.firstChild(se)&&Ut(se)})),De=U(Re),h.a.D(De,function(Ut){var kt=Ut.Mc.init,Ee=Ut.Mc.update,xe=Ut.key;if(se.nodeType===8&&!h.h.ea[xe])throw Error("The binding '"+xe+"' cannot be used with virtual elements");try{typeof kt=="function"&&h.u.G(function(){var ft=kt(se,Bn(xe),gn,un.$data,un);if(ft&&ft.controlsDescendantBindings){if(pt!==e)throw Error("Multiple bindings ("+pt+" and "+xe+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");pt=xe}}),typeof Ee=="function"&&h.$(function(){Ee(se,Bn(xe),gn,un.$data,un)},null,{l:se})}catch(ft){throw ft.message='Unable to process binding "'+xe+": "+Re[xe]+`" -Message: `+ft.message,ft}})}return De=pt===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&un}}function W(se,pe){return se&&se instanceof h.fa?se:new h.fa(se,e,e,pe)}var J=h.a.Da("_subscribable"),j=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var Z={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var me={};h.fa=function(se,pe,Ae,De,Ce){function Re(){var Bn=un?Wt():Wt,Ut=h.a.f(Bn);return pe?(h.a.extend(tt,pe),j in pe&&(tt[j]=pe[j])):(tt.$parents=[],tt.$root=Ut,tt.ko=h),tt[J]=pt,nt?Ut=tt.$data:(tt.$rawData=Bn,tt.$data=Ut),Ae&&(tt[Ae]=Ut),De&&De(tt,pe,Ut),pe&&pe[J]&&!h.S.o().Vb(pe[J])&&pe[J](),gn&&(tt[K]=gn),tt.$data}var tt=this,nt=se===me,Wt=nt?e:se,un=typeof Wt=="function"&&!h.O(Wt),pt,gn=Ce&&Ce.dataDependency;Ce&&Ce.exportDependencies?Re():(pt=h.xb(Re),pt.v(),pt.ja()?pt.equalityComparer=null:tt[J]=e)},h.fa.prototype.createChildContext=function(se,pe,Ae,De){if(!De&&pe&&typeof pe=="object"&&(De=pe,pe=De.as,Ae=De.extend),pe&&De&&De.noChildContext){var Ce=typeof se=="function"&&!h.O(se);return new h.fa(me,this,null,function(Re){Ae&&Ae(Re),Re[pe]=Ce?se():se},De)}return new h.fa(se,this,pe,function(Re,tt){Re.$parentContext=tt,Re.$parent=tt.$data,Re.$parents=(tt.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),Ae&&Ae(Re)},De)},h.fa.prototype.extend=function(se,pe){return new h.fa(me,this,null,function(Ae){h.a.extend(Ae,typeof se=="function"?se(Ae):se)},pe)};var ye=h.a.g.Z();b.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},b.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},b.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,pe,Ae,De,Ce){var Re=h.a.g.Ub(se,ye,{});return Re.Fa||(Re.Fa=new h.T),Ce&&Ce.notifyImmediately&&Re.Zb[pe]&&h.u.G(Ae,De,[se]),Re.Fa.subscribe(Ae,De,pe)},ma:function(se,pe){var Ae=h.a.g.get(se,ye);if(Ae&&(Ae.Zb[pe]=!0,Ae.Fa&&Ae.Fa.notifySubscribers(se,pe),pe==h.i.H)){if(Ae.N)Ae.N.Cc();else if(Ae.N===e&&Ae.Fa&&Ae.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,pe){var Ae=h.a.g.Ub(se,ye,{});return Ae.N||(Ae.N=new b(se,Ae,pe[j])),pe[j]==Ae?pe:pe.extend(function(De){De[j]=Ae})}},h.Td=function(se){return(se=h.a.g.get(se,ye))&&se.context},h.ib=function(se,pe,Ae){return se.nodeType===1&&h.h.Sc(se),Y(se,pe,W(Ae))},h.ld=function(se,pe,Ae){return Ae=W(Ae),h.ib(se,F(pe,Ae,se),Ae)},h.Oa=function(se,pe){pe.nodeType!==1&&pe.nodeType!==8||V(W(se),pe)},h.vc=function(se,pe,Ae){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(pe=n.body,!pe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!pe||pe.nodeType!==1&&pe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(W(se,Ae),pe)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function b(k,V){var G=Object.prototype.hasOwnProperty.call(R,k)?R[k]:_,U;G?G.subscribe(V):(G=R[k]=new h.T,G.subscribe(V),v(k,function(Y,W){var J=!(!W||!W.synchronous);F[k]={definition:Y,Gd:J},delete R[k],U||J?G.notifySubscribers(Y):h.na.zb(function(){G.notifySubscribers(Y)})}),U=!0)}function v(k,V){I("getConfig",[k],function(G){G?I("loadComponent",[k,G],function(U){V(U,G)}):V(null,null)})}function I(k,V,G,U){U||(U=h.j.loaders.slice(0));var Y=U.shift();if(Y){var W=Y[k];if(W){var J=!1;if(W.apply(Y,V.concat(function(j){J?G(null):j!==null?G(j):I(k,V,G,U)}))!==_&&(J=!0,!Y.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(k,V,G,U)}else G(null)}var R={},F={};h.j={get:function(k,V){var G=Object.prototype.hasOwnProperty.call(F,k)?F[k]:_;G?G.Gd?h.u.G(function(){V(G.definition)}):h.na.zb(function(){V(G.definition)}):b(k,V)},Bc:function(k){delete F[k]},oc:I},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,U,Y,W){function J(){--K===0&&W(j)}var j={},K=2,Z=Y.template;Y=Y.viewModel,Z?R(U,Z,function(me){h.j.oc("loadTemplate",[G,me],function(ye){j.template=ye,J()})}):J(),Y?R(U,Y,function(me){h.j.oc("loadViewModel",[G,me],function(ye){j[V]=ye,J()})}):J()}function b(G,U,Y){if(typeof U=="function")Y(function(J){return new U(J)});else if(typeof U[V]=="function")Y(U[V]);else if("instance"in U){var W=U.instance;Y(function(){return W})}else"viewModel"in U?b(G,U.viewModel,Y):G("Unknown viewModel value: "+U)}function v(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(I(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function R(G,U,Y){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(W){W&&typeof W=="object"&&W.Xd&&W.default&&(W=W.default),Y(W)}):G("Uses require, but no AMD loader is present"):Y(U)}function F(G){return function(U){throw Error("Component '"+G+"': "+U)}}var k={};h.j.register=function(G,U){if(!U)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");k[G]=U},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(k,G)},h.j.unregister=function(G){delete k[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,U){U(h.j.tb(G)?k[G]:null)},loadComponent:function(G,U,Y){var W=F(G);R(W,U,function(J){_(G,W,J,Y)})},loadTemplate:function(G,U,Y){if(G=F(G),typeof U=="string")Y(h.a.ua(U));else if(U instanceof Array)Y(U);else if(I(U))Y(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)Y(v(U));else if(typeof U=="string"){var W=n.getElementById(U);W?Y(v(W)):G("Cannot find element with ID "+U)}else G("Unknown element type: "+U);else G("Unknown template value: "+U)},loadViewModel:function(G,U,Y){b(F(G),U,Y)}};var V="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=k}(),function(){function _(v,I){var R=v.getAttribute("params");if(R){var R=b.parseBindingsString(R,I,v,{valueAccessors:!0,bindingParams:!0}),R=h.a.Ga(R,function(V){return h.o(V,null,{l:v})}),F=h.a.Ga(R,function(V){var G=V.v();return V.ja()?h.o({read:function(){return h.a.f(V())},write:h.Za(G)&&function(U){V()(U)},l:v}):G});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=R),F}return{$raw:{}}}h.j.getComponentNameForNode=function(v){var I=h.a.R(v);if(h.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=h.a.W&&v.tagName===I))return I},h.j.tc=function(v,I,R,F){if(I.nodeType===1){var k=h.j.getComponentNameForNode(I);if(k){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:k,params:_(I,R)};v.component=F?function(){return V}:V}}return v};var b=new h.ga;9>h.a.W&&(h.j.register=function(v){return function(I){return v.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(v){return function(){var I=v(),R=h.j.dd,F;for(F in R);return I}}(n.createDocumentFragment))}(),function(){function _(I,R,F){if(R=R.template,!R)throw Error("Component '"+I+"' has no template");I=h.a.Ca(R),h.h.va(F,I)}function b(I,R,F){var k=I.createViewModel;return k?k.call(I,R,F):R}var v=0;h.c.component={init:function(I,R,F,k,V){function G(){var j=U&&U.dispose;typeof j=="function"&&j.call(U),W&&W.s(),Y=U=W=null}var U,Y,W,J=h.a.la(h.h.childNodes(I));return h.h.Ea(I),h.a.K.za(I,G),h.o(function(){var j=h.a.f(R()),K,Z;if(typeof j=="string"?K=j:(K=h.a.f(j.name),Z=h.a.f(j.params)),!K)throw Error("No component name specified");var me=h.i.Cb(I,V),ye=Y=++v;h.j.get(K,function(se){if(Y===ye){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,I);var pe=b(se,Z,{element:I,templateNodes:J});se=me.createChildContext(pe,{extend:function(Ae){Ae.$component=pe,Ae.$componentTemplateNodes=J}}),pe&&pe.koDescendantsComplete&&(W=h.i.subscribe(I,h.i.pa,pe.koDescendantsComplete,pe)),U=pe,h.Oa(se,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var B={class:"className",for:"htmlFor"};h.c.attr={update:function(_,b){var v=h.a.f(b())||{};h.a.P(v,function(I,R){R=h.a.f(R);var F=I.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(I.substr(0,F)),k=R===!1||R===null||R===e;k?F?_.removeAttributeNS(F,I):_.removeAttribute(I):R=R.toString(),8>=h.a.W&&I in B?(I=B[I],k?_.removeAttribute(I):_[I]=R):k||(F?_.setAttributeNS(F,I,R):_.setAttribute(I,R)),I==="name"&&h.a.Yc(_,k?"":R)})}},function(){h.c.checked={after:["value","attr"],init:function(_,b,v){function I(){var j=_.checked,K=F();if(!h.S.Ya()&&(j||!V&&!h.S.qa())){var Z=h.u.G(b);if(U){var me=Y?Z.v():Z,ye=J;J=K,ye!==K?j&&(h.a.Na(me,K,!0),h.a.Na(me,ye,!1)):h.a.Na(me,K,j),Y&&h.Za(Z)&&Z(me)}else k&&(K===e?K=j:j||(K=e)),h.m.eb(Z,v,"checked",K,!0)}}function R(){var j=h.a.f(b()),K=F();U?(_.checked=0<=h.a.A(j,K),J=K):_.checked=k&&K===e?!!j:F()===j}var F=h.xb(function(){if(v.has("checkedValue"))return h.a.f(v.get("checkedValue"));if(W)return v.has("value")?h.a.f(v.get("value")):_.value}),k=_.type=="checkbox",V=_.type=="radio";if(k||V){var G=b(),U=k&&h.a.f(G)instanceof Array,Y=!(U&&G.push&&G.splice),W=V||U,J=U?F():e;V&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(I,null,{l:_}),h.a.B(_,"click",I),h.o(R,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,b){_.value=h.a.f(b())}}}(),h.c.class={update:function(_,b){var v=h.a.Db(h.a.f(b()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=v,h.a.Eb(_,v,!0)}},h.c.css={update:function(_,b){var v=h.a.f(b());v!==null&&typeof v=="object"?h.a.P(v,function(I,R){R=h.a.f(R),h.a.Eb(_,I,R)}):h.c.class.update(_,b)}},h.c.enable={update:function(_,b){var v=h.a.f(b());v&&_.disabled?_.removeAttribute("disabled"):v||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,b){h.c.enable.update(_,function(){return!h.a.f(b())})}},h.c.event={init:function(_,b,v,I,R){var F=b()||{};h.a.P(F,function(k){typeof k=="string"&&h.a.B(_,k,function(V){var G,U=b()[k];if(U){try{var Y=h.a.la(arguments);I=R.$data,Y.unshift(I),G=U.apply(I,Y)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}v.get(k+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var b=_(),v=h.a.bc(b);return!v||typeof v.length=="number"?{foreach:b,templateEngine:h.ba.Ma}:(h.a.f(b),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:h.ba.Ma})}},init:function(_,b){return h.c.template.init(_,h.c.foreach.Rc(b))},update:function(_,b,v,I,R){return h.c.template.update(_,h.c.foreach.Rc(b),v,I,R)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,b,v){function I(k){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}k=G===_}V=b(),h.m.eb(V,v,"hasfocus",k,!0),_.__ko_hasfocusLastValue=k,_.__ko_hasfocusUpdating=!1}var R=I.bind(null,!0),F=I.bind(null,!1);h.a.B(_,"focus",R),h.a.B(_,"focusin",R),h.a.B(_,"blur",F),h.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,b){var v=!!h.a.f(b());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===v||(v?_.focus():_.blur(),!v&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,v?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.fc(_,b())}},function(){function _(b,v,I){h.c[b]={init:function(R,F,k,V,G){var U,Y,W={},J,j,K;if(v){V=k.get("as");var Z=k.get("noChildContext");K=!(V&&Z),W={as:V,noChildContext:Z,exportDependencies:K}}return j=(J=k.get("completeOn")=="render")||k.has(h.i.pa),h.o(function(){var me=h.a.f(F()),ye=!I!=!me,se=!Y,pe;(K||ye!==U)&&(j&&(G=h.i.Cb(R,G)),ye&&((!v||K)&&(W.dataDependency=h.S.o()),pe=v?G.createChildContext(typeof me=="function"?me:F,W):h.S.qa()?G.extend(null,W):G),se&&h.S.qa()&&(Y=h.a.Ca(h.h.childNodes(R),!0)),ye?(se||h.h.va(R,h.a.Ca(Y)),h.Oa(pe,R)):(h.h.Ea(R),J||h.i.ma(R,h.i.H)),U=ye)},null,{l:R}),{controlsDescendantBindings:!0}}},h.m.Ra[b]=!1,h.h.ea[b]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,b,v,I,R){return b=R.extend(b),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var L={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,b,v){function I(){return h.a.jb(_.options,function(Z){return Z.selected})}function R(Z,me,ye){var se=typeof me;return se=="function"?me(Z):se=="string"?Z[me]:ye}function F(Z,me){if(j&&U)h.i.ma(_,h.i.H);else if(J.length){var ye=0<=h.a.A(J,h.w.M(me[0]));h.a.Zc(me[0],ye),j&&!ye&&h.u.G(h.a.Fb,null,[_,"change"])}}var k=_.multiple,V=_.length!=0&&k?_.scrollTop:null,G=h.a.f(b()),U=v.get("valueAllowUnset")&&v.has("value"),Y=v.get("optionsIncludeDestroyed");b={};var W,J=[];U||(k?J=h.a.Mb(I(),h.w.M):0<=_.selectedIndex&&J.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),W=h.a.jb(G,function(Z){return Y||Z===e||Z===null||!h.a.f(Z._destroy)}),v.has("optionsCaption")&&(G=h.a.f(v.get("optionsCaption")),G!==null&&G!==e&&W.unshift(L)));var j=!1;if(b.beforeRemove=function(Z){_.removeChild(Z)},G=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(G=function(Z,me){F(0,me),h.u.G(v.get("optionsAfterRender"),null,[me[0],Z!==L?Z:e])}),h.a.ec(_,W,function(Z,me,ye){return ye.length&&(J=!U&&ye[0].selected?[h.w.M(ye[0])]:[],j=!0),me=_.ownerDocument.createElement("option"),Z===L?(h.a.Bb(me,v.get("optionsCaption")),h.w.cb(me,e)):(ye=R(Z,v.get("optionsValue"),Z),h.w.cb(me,h.a.f(ye)),Z=R(Z,v.get("optionsText"),ye),h.a.Bb(me,Z)),[me]},b,G),!U){var K;k?K=J.length&&I().length<J.length:K=J.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==J[0]:J.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(U||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,b,v){function I(){var k=b(),V=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&V.push(h.w.M(G))}),h.m.eb(k,v,"selectedOptions",V)}function R(){var k=h.a.f(b()),V=_.scrollTop;k&&typeof k.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var U=0<=h.a.A(k,h.w.M(G));G.selected!=U&&h.a.Zc(G,U)}),_.scrollTop=V}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;h.i.subscribe(_,h.i.H,function(){F?I():(h.a.B(_,"change",I),F=h.o(R,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,b){var v=h.a.f(b()||{});h.a.P(v,function(I,R){if(R=h.a.f(R),(R===null||R===e||R===!1)&&(R=""),r)r(_).css(I,R);else if(/^--/.test(I))_.style.setProperty(I,R);else{I=I.replace(/-(\w)/g,function(k,V){return V.toUpperCase()});var F=_.style[I];_.style[I]=R,R===F||_.style[I]!=F||isNaN(R)||(_.style[I]=R+"px")}})}},h.c.submit={init:function(_,b,v,I,R){if(typeof b()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(F){var k,V=b();try{k=V.call(R.$data,_)}finally{k!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.Bb(_,b())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(W){if(W)return parseFloat(W[1])},b=t.navigator.userAgent,v,I,R,F,k;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(k=_(b.match(/Edge\/([^ ]+)$/)))||_(b.match(/Chrome\/([^ ]+)/))||(I=_(b.match(/Version\/([^ ]+) Safari/)))||(R=_(b.match(/Firefox\/([^ ]+)/)))||(F=h.a.W||_(b.match(/MSIE ([^ ]+)/)))||(F=_(b.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var V=h.a.g.Z(),G=h.a.g.Z(),U=function(W){var J=this.activeElement;(J=J&&h.a.g.get(J,G))&&J(W)},Y=function(W,J){var j=W.ownerDocument;h.a.g.get(j,V)||(h.a.g.set(j,V,!0),h.a.B(j,"selectionchange",U)),h.a.g.set(W,G,J)};h.c.textInput={init:function(W,J,j){function K(Re,tt){h.a.B(W,Re,tt)}function Z(){var Re=h.a.f(J());(Re===null||Re===e)&&(Re=""),Ae!==e&&Re===Ae?h.a.setTimeout(Z,4):W.value!==Re&&(Ce=!0,W.value=Re,Ce=!1,se=W.value)}function me(){pe||(Ae=W.value,pe=h.a.setTimeout(ye,4))}function ye(){clearTimeout(pe),Ae=pe=e;var Re=W.value;se!==Re&&(se=Re,h.m.eb(J(),j,"textInput",Re))}var se=W.value,pe,Ae,De=h.a.W==9?me:ye,Ce=!1;F&&K("keypress",ye),11>F&&K("propertychange",function(Re){Ce||Re.propertyName!=="value"||De(Re)}),F==8&&(K("keyup",ye),K("keydown",ye)),Y&&(Y(W,De),K("dragend",me)),(!F||9<=F)&&K("input",De),5>I&&h.a.R(W)==="textarea"?(K("keydown",me),K("paste",me),K("cut",me)):11>v?K("keydown",me):4>R?(K("DOMAutoComplete",ye),K("dragdrop",ye),K("drop",ye)):k&&W.type==="number"&&K("keydown",me),K("change",ye),K("blur",ye),h.o(Z,null,{l:W})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(W,J,j){j("textInput",W)}}}(),h.c.uniqueName={init:function(_,b){if(b()){var v="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,v)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,b,v,I,R){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),b=R.createChildContext(b,F),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,b,v){var I=h.a.R(_),R=I=="input";if(!R||_.type!="checkbox"&&_.type!="radio"){var F=[],k=v.get("valueUpdate"),V=!1,G=null;k&&(typeof k=="string"?F=[k]:F=h.a.wc(k),h.a.Pa(F,"change"));var U=function(){G=null,V=!1;var J=b(),j=h.w.M(_);h.m.eb(J,v,"value",j)};!h.a.W||!R||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(F,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){V=!0}),h.a.B(_,"focus",function(){V=!1}),h.a.B(_,"blur",function(){V&&U()})),h.a.D(F,function(J){var j=U;h.a.Ud(J,"after")&&(j=function(){G=h.w.M(_),h.a.setTimeout(U,0)},J=J.substring(5)),h.a.B(_,J,j)});var Y;if(Y=R&&_.type=="file"?function(){var J=h.a.f(b());J===null||J===e||J===""?_.value="":h.u.G(U)}:function(){var J=h.a.f(b()),j=h.w.M(_);G!==null&&J===G?h.a.setTimeout(Y,0):(J!==j||j===e)&&(I==="select"?(j=v.get("valueAllowUnset"),h.w.cb(_,J,j),j||J===h.w.M(_)||h.u.G(U)):h.w.cb(_,J))},I==="select"){var W;h.i.subscribe(_,h.i.H,function(){W?v.get("valueAllowUnset")?Y():U():(h.a.B(_,"change",U),W=h.o(Y,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",U),h.o(Y,null,{l:_})}else h.ib(_,{checkedValue:b})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,b){var v=h.a.f(b()),I=_.style.display!="none";v&&!I?_.style.display="":!v&&I&&(_.style.display="none")}},h.c.hidden={update:function(_,b){h.c.visible.update(_,function(){return!h.a.f(b())})}},function(_){h.c[_]={init:function(b,v,I,R,F){return h.c.event.init.call(this,b,function(){var k={};return k[_]=v(),k},I,R,F)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,b){if(typeof _=="string"){b=b||n;var v=b.getElementById(_);if(!v)throw Error("Cannot find template with ID "+_);return new h.C.F(v)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,b,v,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,b,v,I)},h.ca.prototype.isTemplateRewritten=function(_,b){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,b).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,b,v){_=this.makeTemplateSource(_,v),b=b(_.text()),_.text(b),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(I,R,F,k){I=h.m.ac(I);for(var V=h.m.Ra,G=0;G<I.length;G++){var U=I[G].key;if(Object.prototype.hasOwnProperty.call(V,U)){var Y=V[U];if(typeof Y=="function"){if(U=Y(I[G].value))throw Error(U)}else if(!Y)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",k.createJavaScriptEvaluatorBlock(F)+R}var b=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,R,F){R.isTemplateRewritten(I,F)||R.rewriteTemplate(I,function(k){return h.kc.Ld(k,R)},F)},Ld:function(I,R){return I.replace(b,function(F,k,V,G,U){return _(U,k,V,R)}).replace(v,function(F,k){return _(k,"<!-- ko -->","#comment",R)})},md:function(I,R){return h.aa.Xb(function(F,k){var V=F.nextSibling;V&&V.nodeName.toLowerCase()===R&&h.ib(V,I,k)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(v){if(this.F=v){var I=h.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?h.a.fc(this.F,I):this.F[v]=I};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(v){if(arguments.length===1)return h.a.g.get(this.F,_+v);h.a.g.set(this.F,_+v,arguments[1])};var b=h.a.g.Z();h.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=h.a.g.get(v,b)||{},R=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!R||I.jd){var F=this.text();F&&F!==I.bb&&(R=h.a.Md(F,v.ownerDocument),h.a.g.set(v,b,{lb:R,bb:F,jd:!0}))}return R}I=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(v,b,{lb:I})},h.C.ia=function(v){this.F=v},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var v=h.a.g.get(this.F,b)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}h.a.g.set(this.F,b,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,U,Y){var W;for(U=h.h.nextSibling(U);G&&(W=G)!==U;)G=h.h.nextSibling(W),Y(W,G)}function b(G,U){if(G.length){var Y=G[0],W=G[G.length-1],J=Y.parentNode,j=h.ga.instance,K=j.preprocessNode;if(K){if(_(Y,W,function(Z,me){var ye=Z.previousSibling,se=K.call(j,Z);se&&(Z===Y&&(Y=se[0]||me),Z===W&&(W=se[se.length-1]||ye))}),G.length=0,!Y)return;Y===W?G.push(Y):(G.push(Y,W),h.a.Ua(G,J))}_(Y,W,function(Z){Z.nodeType!==1&&Z.nodeType!==8||h.vc(U,Z)}),_(Y,W,function(Z){Z.nodeType!==1&&Z.nodeType!==8||h.aa.cd(Z,[U])}),h.a.Ua(G,J)}}function v(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,U,Y,W,J){J=J||{};var j=(G&&v(G)||Y||{}).ownerDocument,K=J.templateEngine||F;if(h.kc.xd(Y,K,j),Y=K.renderTemplate(Y,W,J,j),typeof Y.length!="number"||0<Y.length&&typeof Y[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,U){case"replaceChildren":h.h.va(G,Y),j=!0;break;case"replaceNode":h.a.Xc(G,Y),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return j&&(b(Y,W),J.afterRender&&h.u.G(J.afterRender,null,[Y,W[J.as||"$data"]]),U=="replaceChildren"&&h.i.ma(G,h.i.H)),Y}function R(G,U,Y){return h.O(G)?G():typeof G=="function"?G(U,Y):G}var F;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=G},h.dc=function(G,U,Y,W,J){if(Y=Y||{},(Y.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",W){var j=v(W);return h.$(function(){var Z=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),K=R(G,Z.$data,Z),Z=I(W,J,K,Z,Y);J=="replaceNode"&&(W=Z,j=v(W))},null,{Sa:function(){return!j||!h.a.Sb(j)},l:j&&J=="replaceNode"?j.parentNode:j})}return h.aa.Xb(function(K){h.dc(G,U,Y,K,"replaceNode")})},h.Qd=function(G,U,Y,W,J){function j(Ae,De){h.u.G(h.a.ec,null,[W,Ae,Z,Y,K,De]),h.i.ma(W,h.i.H)}function K(Ae,De){b(De,me),Y.afterRender&&Y.afterRender(De,Ae),me=null}function Z(Ae,De){me=J.createChildContext(Ae,{as:ye,noChildContext:Y.noChildContext,extend:function(Re){Re.$index=De,ye&&(Re[ye+"Index"]=De)}});var Ce=R(G,Ae,me);return I(W,"ignoreTargetNode",Ce,me,Y)}var me,ye=Y.as,se=Y.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!Y.includeDestroyed;if(se||Y.beforeRemove||!h.Pc(U))return h.$(function(){var Ae=h.a.f(U)||[];typeof Ae.length>"u"&&(Ae=[Ae]),se&&(Ae=h.a.jb(Ae,function(De){return De===e||De===null||!h.a.f(De._destroy)})),j(Ae)},null,{l:W});j(U.v());var pe=U.subscribe(function(Ae){j(U(),Ae)},null,"arrayChange");return pe.l(W),pe};var k=h.a.g.Z(),V=h.a.g.Z();h.c.template={init:function(G,U){var Y=h.a.f(U());if(typeof Y=="string"||"name"in Y)h.h.Ea(G);else if("nodes"in Y){if(Y=Y.nodes||[],h.O(Y))throw Error('The "nodes" option must be a plain, non-observable array.');var W=Y[0]&&Y[0].parentNode;W&&h.a.g.get(W,V)||(W=h.a.Yb(Y),h.a.g.set(W,V,!0)),new h.C.ia(G).nodes(W)}else if(Y=h.h.childNodes(G),0<Y.length)W=h.a.Yb(Y),new h.C.ia(G).nodes(W);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,U,Y,W,J){var j=U();U=h.a.f(j),Y=!0,W=null,typeof U=="string"?U={}:(j="name"in U?U.name:G,"if"in U&&(Y=h.a.f(U.if)),Y&&"ifnot"in U&&(Y=!h.a.f(U.ifnot)),Y&&!j&&(Y=!1)),"foreach"in U?W=h.Qd(j,Y&&U.foreach||[],U,G,J):Y?(Y=J,"data"in U&&(Y=J.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),W=h.dc(j,Y,U,G)):h.h.Ea(G),J=W,(U=h.a.g.get(G,k))&&typeof U.s=="function"&&U.s(),h.a.g.set(G,k,!J||J.ja&&!J.ja()?e:J)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,b,v){if(_.length&&b.length){var I,R,F,k,V;for(I=R=0;(!v||I<v)&&(k=_[R]);++R){for(F=0;V=b[F];++F)if(k.value===V.value){k.moved=V.index,V.moved=k.index,b.splice(F,1),I=F=0;break}I+=F}}},h.a.Pb=function(){function _(b,v,I,R,F){var k=Math.min,V=Math.max,G=[],U,Y=b.length,W,J=v.length,j=J-Y||1,K=Y+J+1,Z,me,ye;for(U=0;U<=Y;U++)for(me=Z,G.push(Z=[]),ye=k(J,U+j),W=V(0,U-1);W<=ye;W++)Z[W]=W?U?b[U-1]===v[W-1]?me[W-1]:k(me[W]||K,Z[W-1]||K)+1:W+1:U+1;for(k=[],V=[],j=[],U=Y,W=J;U||W;)J=G[U][W]-1,W&&J===G[U][W-1]?V.push(k[k.length]={status:I,value:v[--W],index:W}):U&&J===G[U-1][W]?j.push(k[k.length]={status:R,value:b[--U],index:U}):(--W,--U,F.sparse||k.push({status:"retained",value:v[W]}));return h.a.Kc(j,V,!F.dontLimitMoves&&10*Y),k.reverse()}return function(b,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},b=b||[],v=v||[],b.length<v.length?_(b,v,"added","deleted",I):_(v,b,"deleted","added",I)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(I,R,F,k,V){var G=[],U=h.$(function(){var Y=R(F,V,h.a.Ua(G,I))||[];0<G.length&&(h.a.Xc(G,Y),k&&h.u.G(k,null,[F,Y,V])),G.length=0,h.a.Nb(G,Y)},null,{l:I,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:U.ja()?U:e}}var b=h.a.g.Z(),v=h.a.g.Z();h.a.ec=function(I,R,F,k,V,G){function U(Ut){Ce={Aa:Ut,pb:h.ta(me++)},K.push(Ce),j||De.push(Ce)}function Y(Ut){Ce=J[Ut],me!==Ce.pb.v()&&Ae.push(Ce),Ce.pb(me++),h.a.Ua(Ce.Y,I),K.push(Ce)}function W(Ut,kt){if(Ut)for(var Ee=0,xe=kt.length;Ee<xe;Ee++)h.a.D(kt[Ee].Y,function(ft){Ut(ft,Ee,kt[Ee].Aa)})}R=R||[],typeof R.length>"u"&&(R=[R]),k=k||{};var J=h.a.g.get(I,b),j=!J,K=[],Z=0,me=0,ye=[],se=[],pe=[],Ae=[],De=[],Ce,Re=0;if(j)h.a.D(R,U);else{if(!G||J&&J._countWaitingForRemove){var tt=h.a.Mb(J,function(Ut){return Ut.Aa});G=h.a.Pb(tt,R,{dontLimitMoves:k.dontLimitMoves,sparse:!0})}for(var tt=0,nt,Wt,un;nt=G[tt];tt++)switch(Wt=nt.moved,un=nt.index,nt.status){case"deleted":for(;Z<un;)Y(Z++);Wt===e&&(Ce=J[Z],Ce.$&&(Ce.$.s(),Ce.$=e),h.a.Ua(Ce.Y,I).length&&(k.beforeRemove&&(K.push(Ce),Re++,Ce.Aa===v?Ce=null:pe.push(Ce)),Ce&&ye.push.apply(ye,Ce.Y))),Z++;break;case"added":for(;me<un;)Y(Z++);Wt!==e?(se.push(K.length),Y(Wt)):U(nt.value)}for(;me<R.length;)Y(Z++);K._countWaitingForRemove=Re}h.a.g.set(I,b,K),W(k.beforeMove,Ae),h.a.D(ye,k.beforeRemove?h.oa:h.removeNode);var pt,gn,Bn;try{Bn=I.ownerDocument.activeElement}catch{}if(se.length)for(;(tt=se.shift())!=e;){for(Ce=K[tt],pt=e;tt;)if((gn=K[--tt].Y)&&gn.length){pt=gn[gn.length-1];break}for(R=0;Z=Ce.Y[R];pt=Z,R++)h.h.Wb(I,Z,pt)}for(tt=0;Ce=K[tt];tt++){for(Ce.Y||h.a.extend(Ce,_(I,F,Ce.Aa,V,Ce.pb)),R=0;Z=Ce.Y[R];pt=Z,R++)h.h.Wb(I,Z,pt);!Ce.Ed&&V&&(V(Ce.Aa,Ce.Y,Ce.pb),Ce.Ed=!0,pt=Ce.Y[Ce.Y.length-1])}for(Bn&&I.ownerDocument.activeElement!=Bn&&Bn.focus(),W(k.beforeRemove,pe),tt=0;tt<pe.length;++tt)pe[tt].Aa=v;W(k.afterMove,Ae),W(k.afterAdd,De)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,b,v,I){return(b=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(b.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,I))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var b=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(v,I,R,F){if(F=F||n,R=R||{},2>b)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var k=v.data("precompiled");return k||(k=v.text()||"",k=r.template(null,"{{ko_with $item.koBindingContext}}"+k+"{{/ko_with}}"),v.data("precompiled",k)),v=[I.$data],I=r.extend({koBindingContext:I},R.templateOptions),I=r.tmpl(k,v,I),I.appendTo(F.createElement("div")),r.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"</script>")},0<b&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var G0t=ko;typeof window<"u"?(ko=window.ko,typeof E2<"u"?window.ko=E2:delete window.ko):(ko=global.ko,typeof E2<"u"?global.ko=E2:delete global.ko);var GC=G0t;/** +Message: `+k.message,k}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var pe=(se=h.a.g.get(se,ge))&&se.N;pe&&(se.N=null,pe.Tc())}function E(se,pe,xe){this.node=se,this.yc=pe,this.kb=[],this.H=!1,pe.N||h.a.K.za(se,_),xe&&xe.N&&(xe.N.kb.push(se),this.Kb=xe)}function w(se){return function(){return se}}function P(se){return se()}function M(se){return h.a.Ga(h.u.G(se),function(pe,xe){return function(){return se()[xe]}})}function B(se,pe,xe){return typeof se=="function"?M(se.bind(null,pe,xe)):h.a.Ga(se,w)}function V(se,pe){return M(this.getBindings.bind(this,se,pe))}function U(se,pe){var xe=h.h.firstChild(pe);if(xe){var Pe,we=h.ga.instance,Se=we.preprocessNode;if(Se){for(;Pe=xe;)xe=h.h.nextSibling(Pe),Se.call(we,Pe);xe=h.h.firstChild(pe)}for(;Pe=xe;)xe=h.h.nextSibling(Pe),G(se,Pe)}h.i.ma(pe,h.i.H)}function G(se,pe){var xe=se,Pe=pe.nodeType===1;Pe&&h.h.Sc(pe),(Pe||h.ga.instance.nodeHasBindings(pe))&&(xe=Y(pe,null,se).bindingContextForDescendants),xe&&!Z[h.a.R(pe)]&&U(xe,pe)}function k(se){var pe=[],xe={},Pe=[];return h.a.P(se,function we(Se){if(!xe[Se]){var nt=h.getBindingHandler(Se);nt&&(nt.after&&(Pe.push(Se),h.a.D(nt.after,function(Ze){if(se[Ze]){if(h.a.A(Pe,Ze)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));we(Ze)}}),Pe.length--),pe.push({key:Se,Mc:nt})),xe[Se]=!0}}),pe}function Y(se,pe,xe){var Pe=h.a.g.Ub(se,ge,{}),we=Pe.hd;if(!pe){if(we)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}we||(Pe.context=xe),Pe.Zb||(Pe.Zb={});var Se;if(pe&&typeof pe!="function")Se=pe;else{var nt=h.ga.instance,Ze=nt.getBindingAccessors||V,Gt=h.$(function(){return(Se=pe?pe(xe,se):Ze.call(nt,se,xe))&&(xe[J]&&xe[J](),xe[K]&&xe[K]()),Se},null,{l:se});Se&&Gt.ja()||(Gt=null)}var fn=xe,pt;if(Se){var Tn=function(){return h.a.Ga(Gt?Gt():Se,P)},Vn=Gt?function(Ut){return function(){return P(Gt()[Ut])}}:function(Ut){return Se[Ut]};Tn.get=function(Ut){return Se[Ut]&&P(Vn(Ut))},Tn.has=function(Ut){return Ut in Se},h.i.H in Se&&h.i.subscribe(se,h.i.H,function(){var Ut=(0,Se[h.i.H])();if(Ut){var Pt=h.h.childNodes(se);Pt.length&&Ut(Pt,h.Ec(Pt[0]))}}),h.i.pa in Se&&(fn=h.i.Cb(se,xe),h.i.subscribe(se,h.i.pa,function(){var Ut=(0,Se[h.i.pa])();Ut&&h.h.firstChild(se)&&Ut(se)})),Pe=k(Se),h.a.D(Pe,function(Ut){var Pt=Ut.Mc.init,Ce=Ut.Mc.update,ve=Ut.key;if(se.nodeType===8&&!h.h.ea[ve])throw Error("The binding '"+ve+"' cannot be used with virtual elements");try{typeof Pt=="function"&&h.u.G(function(){var ot=Pt(se,Vn(ve),Tn,fn.$data,fn);if(ot&&ot.controlsDescendantBindings){if(pt!==e)throw Error("Multiple bindings ("+pt+" and "+ve+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");pt=ve}}),typeof Ce=="function"&&h.$(function(){Ce(se,Vn(ve),Tn,fn.$data,fn)},null,{l:se})}catch(ot){throw ot.message='Unable to process binding "'+ve+": "+Se[ve]+`" +Message: `+ot.message,ot}})}return Pe=pt===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&fn}}function j(se,pe){return se&&se instanceof h.fa?se:new h.fa(se,e,e,pe)}var J=h.a.Da("_subscribable"),W=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var Z={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var he={};h.fa=function(se,pe,xe,Pe,we){function Se(){var Vn=fn?Gt():Gt,Ut=h.a.f(Vn);return pe?(h.a.extend(nt,pe),W in pe&&(nt[W]=pe[W])):(nt.$parents=[],nt.$root=Ut,nt.ko=h),nt[J]=pt,Ze?Ut=nt.$data:(nt.$rawData=Vn,nt.$data=Ut),xe&&(nt[xe]=Ut),Pe&&Pe(nt,pe,Ut),pe&&pe[J]&&!h.S.o().Vb(pe[J])&&pe[J](),Tn&&(nt[K]=Tn),nt.$data}var nt=this,Ze=se===he,Gt=Ze?e:se,fn=typeof Gt=="function"&&!h.O(Gt),pt,Tn=we&&we.dataDependency;we&&we.exportDependencies?Se():(pt=h.xb(Se),pt.v(),pt.ja()?pt.equalityComparer=null:nt[J]=e)},h.fa.prototype.createChildContext=function(se,pe,xe,Pe){if(!Pe&&pe&&typeof pe=="object"&&(Pe=pe,pe=Pe.as,xe=Pe.extend),pe&&Pe&&Pe.noChildContext){var we=typeof se=="function"&&!h.O(se);return new h.fa(he,this,null,function(Se){xe&&xe(Se),Se[pe]=we?se():se},Pe)}return new h.fa(se,this,pe,function(Se,nt){Se.$parentContext=nt,Se.$parent=nt.$data,Se.$parents=(nt.$parents||[]).slice(0),Se.$parents.unshift(Se.$parent),xe&&xe(Se)},Pe)},h.fa.prototype.extend=function(se,pe){return new h.fa(he,this,null,function(xe){h.a.extend(xe,typeof se=="function"?se(xe):se)},pe)};var ge=h.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,pe,xe,Pe,we){var Se=h.a.g.Ub(se,ge,{});return Se.Fa||(Se.Fa=new h.T),we&&we.notifyImmediately&&Se.Zb[pe]&&h.u.G(xe,Pe,[se]),Se.Fa.subscribe(xe,Pe,pe)},ma:function(se,pe){var xe=h.a.g.get(se,ge);if(xe&&(xe.Zb[pe]=!0,xe.Fa&&xe.Fa.notifySubscribers(se,pe),pe==h.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,pe){var xe=h.a.g.Ub(se,ge,{});return xe.N||(xe.N=new E(se,xe,pe[W])),pe[W]==xe?pe:pe.extend(function(Pe){Pe[W]=xe})}},h.Td=function(se){return(se=h.a.g.get(se,ge))&&se.context},h.ib=function(se,pe,xe){return se.nodeType===1&&h.h.Sc(se),Y(se,pe,j(xe))},h.ld=function(se,pe,xe){return xe=j(xe),h.ib(se,B(pe,xe,se),xe)},h.Oa=function(se,pe){pe.nodeType!==1&&pe.nodeType!==8||U(j(se),pe)},h.vc=function(se,pe,xe){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(pe=n.body,!pe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!pe||pe.nodeType!==1&&pe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(j(se,xe),pe)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function E(V,U){var G=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;G?G.subscribe(U):(G=M[V]=new h.T,G.subscribe(U),w(V,function(Y,j){var J=!(!j||!j.synchronous);B[V]={definition:Y,Gd:J},delete M[V],k||J?G.notifySubscribers(Y):h.na.zb(function(){G.notifySubscribers(Y)})}),k=!0)}function w(V,U){P("getConfig",[V],function(G){G?P("loadComponent",[V,G],function(k){U(k,G)}):U(null,null)})}function P(V,U,G,k){k||(k=h.j.loaders.slice(0));var Y=k.shift();if(Y){var j=Y[V];if(j){var J=!1;if(j.apply(Y,U.concat(function(W){J?G(null):W!==null?G(W):P(V,U,G,k)}))!==_&&(J=!0,!Y.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(V,U,G,k)}else G(null)}var M={},B={};h.j={get:function(V,U){var G=Object.prototype.hasOwnProperty.call(B,V)?B[V]:_;G?G.Gd?h.u.G(function(){U(G.definition)}):h.na.zb(function(){U(G.definition)}):E(V,U)},Bc:function(V){delete B[V]},oc:P},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,k,Y,j){function J(){--K===0&&j(W)}var W={},K=2,Z=Y.template;Y=Y.viewModel,Z?M(k,Z,function(he){h.j.oc("loadTemplate",[G,he],function(ge){W.template=ge,J()})}):J(),Y?M(k,Y,function(he){h.j.oc("loadViewModel",[G,he],function(ge){W[U]=ge,J()})}):J()}function E(G,k,Y){if(typeof k=="function")Y(function(J){return new k(J)});else if(typeof k[U]=="function")Y(k[U]);else if("instance"in k){var j=k.instance;Y(function(){return j})}else"viewModel"in k?E(G,k.viewModel,Y):G("Unknown viewModel value: "+k)}function w(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(P(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function P(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function M(G,k,Y){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(j){j&&typeof j=="object"&&j.Xd&&j.default&&(j=j.default),Y(j)}):G("Uses require, but no AMD loader is present"):Y(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var V={};h.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");V[G]=k},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(V,G)},h.j.unregister=function(G){delete V[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,k){k(h.j.tb(G)?V[G]:null)},loadComponent:function(G,k,Y){var j=B(G);M(j,k,function(J){_(G,j,J,Y)})},loadTemplate:function(G,k,Y){if(G=B(G),typeof k=="string")Y(h.a.ua(k));else if(k instanceof Array)Y(k);else if(P(k))Y(h.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)Y(w(k));else if(typeof k=="string"){var j=n.getElementById(k);j?Y(w(j)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,Y){E(B(G),k,Y)}};var U="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=V}(),function(){function _(w,P){var M=w.getAttribute("params");if(M){var M=E.parseBindingsString(M,P,w,{valueAccessors:!0,bindingParams:!0}),M=h.a.Ga(M,function(U){return h.o(U,null,{l:w})}),B=h.a.Ga(M,function(U){var G=U.v();return U.ja()?h.o({read:function(){return h.a.f(U())},write:h.Za(G)&&function(k){U()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=M),B}return{$raw:{}}}h.j.getComponentNameForNode=function(w){var P=h.a.R(w);if(h.j.tb(P)&&(P.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=h.a.W&&w.tagName===P))return P},h.j.tc=function(w,P,M,B){if(P.nodeType===1){var V=h.j.getComponentNameForNode(P);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:V,params:_(P,M)};w.component=B?function(){return U}:U}}return w};var E=new h.ga;9>h.a.W&&(h.j.register=function(w){return function(P){return w.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(w){return function(){var P=w(),M=h.j.dd,B;for(B in M);return P}}(n.createDocumentFragment))}(),function(){function _(P,M,B){if(M=M.template,!M)throw Error("Component '"+P+"' has no template");P=h.a.Ca(M),h.h.va(B,P)}function E(P,M,B){var V=P.createViewModel;return V?V.call(P,M,B):M}var w=0;h.c.component={init:function(P,M,B,V,U){function G(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),j&&j.s(),Y=k=j=null}var k,Y,j,J=h.a.la(h.h.childNodes(P));return h.h.Ea(P),h.a.K.za(P,G),h.o(function(){var W=h.a.f(M()),K,Z;if(typeof W=="string"?K=W:(K=h.a.f(W.name),Z=h.a.f(W.params)),!K)throw Error("No component name specified");var he=h.i.Cb(P,U),ge=Y=++w;h.j.get(K,function(se){if(Y===ge){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,P);var pe=E(se,Z,{element:P,templateNodes:J});se=he.createChildContext(pe,{extend:function(xe){xe.$component=pe,xe.$componentTemplateNodes=J}}),pe&&pe.koDescendantsComplete&&(j=h.i.subscribe(P,h.i.pa,pe.koDescendantsComplete,pe)),k=pe,h.Oa(se,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};h.c.attr={update:function(_,E){var w=h.a.f(E())||{};h.a.P(w,function(P,M){M=h.a.f(M);var B=P.indexOf(":"),B="lookupNamespaceURI"in _&&0<B&&_.lookupNamespaceURI(P.substr(0,B)),V=M===!1||M===null||M===e;V?B?_.removeAttributeNS(B,P):_.removeAttribute(P):M=M.toString(),8>=h.a.W&&P in L?(P=L[P],V?_.removeAttribute(P):_[P]=M):V||(B?_.setAttributeNS(B,P,M):_.setAttribute(P,M)),P==="name"&&h.a.Yc(_,V?"":M)})}},function(){h.c.checked={after:["value","attr"],init:function(_,E,w){function P(){var W=_.checked,K=B();if(!h.S.Ya()&&(W||!U&&!h.S.qa())){var Z=h.u.G(E);if(k){var he=Y?Z.v():Z,ge=J;J=K,ge!==K?W&&(h.a.Na(he,K,!0),h.a.Na(he,ge,!1)):h.a.Na(he,K,W),Y&&h.Za(Z)&&Z(he)}else V&&(K===e?K=W:W||(K=e)),h.m.eb(Z,w,"checked",K,!0)}}function M(){var W=h.a.f(E()),K=B();k?(_.checked=0<=h.a.A(W,K),J=K):_.checked=V&&K===e?!!W:B()===W}var B=h.xb(function(){if(w.has("checkedValue"))return h.a.f(w.get("checkedValue"));if(j)return w.has("value")?h.a.f(w.get("value")):_.value}),V=_.type=="checkbox",U=_.type=="radio";if(V||U){var G=E(),k=V&&h.a.f(G)instanceof Array,Y=!(k&&G.push&&G.splice),j=U||k,J=k?B():e;U&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(P,null,{l:_}),h.a.B(_,"click",P),h.o(M,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,E){_.value=h.a.f(E())}}}(),h.c.class={update:function(_,E){var w=h.a.Db(h.a.f(E()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,h.a.Eb(_,w,!0)}},h.c.css={update:function(_,E){var w=h.a.f(E());w!==null&&typeof w=="object"?h.a.P(w,function(P,M){M=h.a.f(M),h.a.Eb(_,P,M)}):h.c.class.update(_,E)}},h.c.enable={update:function(_,E){var w=h.a.f(E());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,E){h.c.enable.update(_,function(){return!h.a.f(E())})}},h.c.event={init:function(_,E,w,P,M){var B=E()||{};h.a.P(B,function(V){typeof V=="string"&&h.a.B(_,V,function(U){var G,k=E()[V];if(k){try{var Y=h.a.la(arguments);P=M.$data,Y.unshift(P),G=k.apply(P,Y)}finally{G!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}w.get(V+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var E=_(),w=h.a.bc(E);return!w||typeof w.length=="number"?{foreach:E,templateEngine:h.ba.Ma}:(h.a.f(E),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:h.ba.Ma})}},init:function(_,E){return h.c.template.init(_,h.c.foreach.Rc(E))},update:function(_,E,w,P,M){return h.c.template.update(_,h.c.foreach.Rc(E),w,P,M)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,E,w){function P(V){_.__ko_hasfocusUpdating=!0;var U=_.ownerDocument;if("activeElement"in U){var G;try{G=U.activeElement}catch{G=U.body}V=G===_}U=E(),h.m.eb(U,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=P.bind(null,!0),B=P.bind(null,!1);h.a.B(_,"focus",M),h.a.B(_,"focusin",M),h.a.B(_,"blur",B),h.a.B(_,"focusout",B),_.__ko_hasfocusLastValue=!1},update:function(_,E){var w=!!h.a.f(E());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,w?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.fc(_,E())}},function(){function _(E,w,P){h.c[E]={init:function(M,B,V,U,G){var k,Y,j={},J,W,K;if(w){U=V.get("as");var Z=V.get("noChildContext");K=!(U&&Z),j={as:U,noChildContext:Z,exportDependencies:K}}return W=(J=V.get("completeOn")=="render")||V.has(h.i.pa),h.o(function(){var he=h.a.f(B()),ge=!P!=!he,se=!Y,pe;(K||ge!==k)&&(W&&(G=h.i.Cb(M,G)),ge&&((!w||K)&&(j.dataDependency=h.S.o()),pe=w?G.createChildContext(typeof he=="function"?he:B,j):h.S.qa()?G.extend(null,j):G),se&&h.S.qa()&&(Y=h.a.Ca(h.h.childNodes(M),!0)),ge?(se||h.h.va(M,h.a.Ca(Y)),h.Oa(pe,M)):(h.h.Ea(M),J||h.i.ma(M,h.i.H)),k=ge)},null,{l:M}),{controlsDescendantBindings:!0}}},h.m.Ra[E]=!1,h.h.ea[E]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,E,w,P,M){return E=M.extend(E),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var N={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,E,w){function P(){return h.a.jb(_.options,function(Z){return Z.selected})}function M(Z,he,ge){var se=typeof he;return se=="function"?he(Z):se=="string"?Z[he]:ge}function B(Z,he){if(W&&k)h.i.ma(_,h.i.H);else if(J.length){var ge=0<=h.a.A(J,h.w.M(he[0]));h.a.Zc(he[0],ge),W&&!ge&&h.u.G(h.a.Fb,null,[_,"change"])}}var V=_.multiple,U=_.length!=0&&V?_.scrollTop:null,G=h.a.f(E()),k=w.get("valueAllowUnset")&&w.has("value"),Y=w.get("optionsIncludeDestroyed");E={};var j,J=[];k||(V?J=h.a.Mb(P(),h.w.M):0<=_.selectedIndex&&J.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),j=h.a.jb(G,function(Z){return Y||Z===e||Z===null||!h.a.f(Z._destroy)}),w.has("optionsCaption")&&(G=h.a.f(w.get("optionsCaption")),G!==null&&G!==e&&j.unshift(N)));var W=!1;if(E.beforeRemove=function(Z){_.removeChild(Z)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(Z,he){B(0,he),h.u.G(w.get("optionsAfterRender"),null,[he[0],Z!==N?Z:e])}),h.a.ec(_,j,function(Z,he,ge){return ge.length&&(J=!k&&ge[0].selected?[h.w.M(ge[0])]:[],W=!0),he=_.ownerDocument.createElement("option"),Z===N?(h.a.Bb(he,w.get("optionsCaption")),h.w.cb(he,e)):(ge=M(Z,w.get("optionsValue"),Z),h.w.cb(he,h.a.f(ge)),Z=M(Z,w.get("optionsText"),ge),h.a.Bb(he,Z)),[he]},E,G),!k){var K;V?K=J.length&&P().length<J.length:K=J.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==J[0]:J.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(k||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),U&&20<Math.abs(U-_.scrollTop)&&(_.scrollTop=U)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,E,w){function P(){var V=E(),U=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&U.push(h.w.M(G))}),h.m.eb(V,w,"selectedOptions",U)}function M(){var V=h.a.f(E()),U=_.scrollTop;V&&typeof V.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var k=0<=h.a.A(V,h.w.M(G));G.selected!=k&&h.a.Zc(G,k)}),_.scrollTop=U}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;h.i.subscribe(_,h.i.H,function(){B?P():(h.a.B(_,"change",P),B=h.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,E){var w=h.a.f(E()||{});h.a.P(w,function(P,M){if(M=h.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(P,M);else if(/^--/.test(P))_.style.setProperty(P,M);else{P=P.replace(/-(\w)/g,function(V,U){return U.toUpperCase()});var B=_.style[P];_.style[P]=M,M===B||_.style[P]!=B||isNaN(M)||(_.style[P]=M+"px")}})}},h.c.submit={init:function(_,E,w,P,M){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(B){var V,U=E();try{V=U.call(M.$data,_)}finally{V!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.Bb(_,E())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(j){if(j)return parseFloat(j[1])},E=t.navigator.userAgent,w,P,M,B,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(E.match(/Edge\/([^ ]+)$/)))||_(E.match(/Chrome\/([^ ]+)/))||(P=_(E.match(/Version\/([^ ]+) Safari/)))||(M=_(E.match(/Firefox\/([^ ]+)/)))||(B=h.a.W||_(E.match(/MSIE ([^ ]+)/)))||(B=_(E.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var U=h.a.g.Z(),G=h.a.g.Z(),k=function(j){var J=this.activeElement;(J=J&&h.a.g.get(J,G))&&J(j)},Y=function(j,J){var W=j.ownerDocument;h.a.g.get(W,U)||(h.a.g.set(W,U,!0),h.a.B(W,"selectionchange",k)),h.a.g.set(j,G,J)};h.c.textInput={init:function(j,J,W){function K(Se,nt){h.a.B(j,Se,nt)}function Z(){var Se=h.a.f(J());(Se===null||Se===e)&&(Se=""),xe!==e&&Se===xe?h.a.setTimeout(Z,4):j.value!==Se&&(we=!0,j.value=Se,we=!1,se=j.value)}function he(){pe||(xe=j.value,pe=h.a.setTimeout(ge,4))}function ge(){clearTimeout(pe),xe=pe=e;var Se=j.value;se!==Se&&(se=Se,h.m.eb(J(),W,"textInput",Se))}var se=j.value,pe,xe,Pe=h.a.W==9?he:ge,we=!1;B&&K("keypress",ge),11>B&&K("propertychange",function(Se){we||Se.propertyName!=="value"||Pe(Se)}),B==8&&(K("keyup",ge),K("keydown",ge)),Y&&(Y(j,Pe),K("dragend",he)),(!B||9<=B)&&K("input",Pe),5>P&&h.a.R(j)==="textarea"?(K("keydown",he),K("paste",he),K("cut",he)):11>w?K("keydown",he):4>M?(K("DOMAutoComplete",ge),K("dragdrop",ge),K("drop",ge)):V&&j.type==="number"&&K("keydown",he),K("change",ge),K("blur",ge),h.o(Z,null,{l:j})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(j,J,W){W("textInput",j)}}}(),h.c.uniqueName={init:function(_,E){if(E()){var w="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,w)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,E,w,P,M){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),E=M.createChildContext(E,B),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,E,w){var P=h.a.R(_),M=P=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var B=[],V=w.get("valueUpdate"),U=!1,G=null;V&&(typeof V=="string"?B=[V]:B=h.a.wc(V),h.a.Pa(B,"change"));var k=function(){G=null,U=!1;var J=E(),W=h.w.M(_);h.m.eb(J,w,"value",W)};!h.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(B,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){U=!0}),h.a.B(_,"focus",function(){U=!1}),h.a.B(_,"blur",function(){U&&k()})),h.a.D(B,function(J){var W=k;h.a.Ud(J,"after")&&(W=function(){G=h.w.M(_),h.a.setTimeout(k,0)},J=J.substring(5)),h.a.B(_,J,W)});var Y;if(Y=M&&_.type=="file"?function(){var J=h.a.f(E());J===null||J===e||J===""?_.value="":h.u.G(k)}:function(){var J=h.a.f(E()),W=h.w.M(_);G!==null&&J===G?h.a.setTimeout(Y,0):(J!==W||W===e)&&(P==="select"?(W=w.get("valueAllowUnset"),h.w.cb(_,J,W),W||J===h.w.M(_)||h.u.G(k)):h.w.cb(_,J))},P==="select"){var j;h.i.subscribe(_,h.i.H,function(){j?w.get("valueAllowUnset")?Y():k():(h.a.B(_,"change",k),j=h.o(Y,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",k),h.o(Y,null,{l:_})}else h.ib(_,{checkedValue:E})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,E){var w=h.a.f(E()),P=_.style.display!="none";w&&!P?_.style.display="":!w&&P&&(_.style.display="none")}},h.c.hidden={update:function(_,E){h.c.visible.update(_,function(){return!h.a.f(E())})}},function(_){h.c[_]={init:function(E,w,P,M,B){return h.c.event.init.call(this,E,function(){var V={};return V[_]=w(),V},P,M,B)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,E){if(typeof _=="string"){E=E||n;var w=E.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new h.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,E,w,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,E,w,P)},h.ca.prototype.isTemplateRewritten=function(_,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,E).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,E,w){_=this.makeTemplateSource(_,w),E=E(_.text()),_.text(E),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(P,M,B,V){P=h.m.ac(P);for(var U=h.m.Ra,G=0;G<P.length;G++){var k=P[G].key;if(Object.prototype.hasOwnProperty.call(U,k)){var Y=U[k];if(typeof Y=="function"){if(k=Y(P[G].value))throw Error(k)}else if(!Y)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(P,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(B)+M}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,M,B){M.isTemplateRewritten(P,B)||M.rewriteTemplate(P,function(V){return h.kc.Ld(V,M)},B)},Ld:function(P,M){return P.replace(E,function(B,V,U,G,k){return _(k,V,U,M)}).replace(w,function(B,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(P,M){return h.aa.Xb(function(B,V){var U=B.nextSibling;U&&U.nodeName.toLowerCase()===M&&h.ib(U,P,V)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(w){if(this.F=w){var P=h.a.R(w);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&w.content&&w.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var P=arguments[0];w==="innerHTML"?h.a.fc(this.F,P):this.F[w]=P};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(w){if(arguments.length===1)return h.a.g.get(this.F,_+w);h.a.g.set(this.F,_+w,arguments[1])};var E=h.a.g.Z();h.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var P=h.a.g.get(w,E)||{},M=P.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||P.jd){var B=this.text();B&&B!==P.bb&&(M=h.a.Md(B,w.ownerDocument),h.a.g.set(w,E,{lb:M,bb:B,jd:!0}))}return M}P=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(w,E,{lb:P})},h.C.ia=function(w){this.F=w},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var w=h.a.g.get(this.F,E)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}h.a.g.set(this.F,E,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,k,Y){var j;for(k=h.h.nextSibling(k);G&&(j=G)!==k;)G=h.h.nextSibling(j),Y(j,G)}function E(G,k){if(G.length){var Y=G[0],j=G[G.length-1],J=Y.parentNode,W=h.ga.instance,K=W.preprocessNode;if(K){if(_(Y,j,function(Z,he){var ge=Z.previousSibling,se=K.call(W,Z);se&&(Z===Y&&(Y=se[0]||he),Z===j&&(j=se[se.length-1]||ge))}),G.length=0,!Y)return;Y===j?G.push(Y):(G.push(Y,j),h.a.Ua(G,J))}_(Y,j,function(Z){Z.nodeType!==1&&Z.nodeType!==8||h.vc(k,Z)}),_(Y,j,function(Z){Z.nodeType!==1&&Z.nodeType!==8||h.aa.cd(Z,[k])}),h.a.Ua(G,J)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function P(G,k,Y,j,J){J=J||{};var W=(G&&w(G)||Y||{}).ownerDocument,K=J.templateEngine||B;if(h.kc.xd(Y,K,W),Y=K.renderTemplate(Y,j,J,W),typeof Y.length!="number"||0<Y.length&&typeof Y[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":h.h.va(G,Y),W=!0;break;case"replaceNode":h.a.Xc(G,Y),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(E(Y,j),J.afterRender&&h.u.G(J.afterRender,null,[Y,j[J.as||"$data"]]),k=="replaceChildren"&&h.i.ma(G,h.i.H)),Y}function M(G,k,Y){return h.O(G)?G():typeof G=="function"?G(k,Y):G}var B;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},h.dc=function(G,k,Y,j,J){if(Y=Y||{},(Y.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",j){var W=w(j);return h.$(function(){var Z=k&&k instanceof h.fa?k:new h.fa(k,null,null,null,{exportDependencies:!0}),K=M(G,Z.$data,Z),Z=P(j,J,K,Z,Y);J=="replaceNode"&&(j=Z,W=w(j))},null,{Sa:function(){return!W||!h.a.Sb(W)},l:W&&J=="replaceNode"?W.parentNode:W})}return h.aa.Xb(function(K){h.dc(G,k,Y,K,"replaceNode")})},h.Qd=function(G,k,Y,j,J){function W(xe,Pe){h.u.G(h.a.ec,null,[j,xe,Z,Y,K,Pe]),h.i.ma(j,h.i.H)}function K(xe,Pe){E(Pe,he),Y.afterRender&&Y.afterRender(Pe,xe),he=null}function Z(xe,Pe){he=J.createChildContext(xe,{as:ge,noChildContext:Y.noChildContext,extend:function(Se){Se.$index=Pe,ge&&(Se[ge+"Index"]=Pe)}});var we=M(G,xe,he);return P(j,"ignoreTargetNode",we,he,Y)}var he,ge=Y.as,se=Y.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!Y.includeDestroyed;if(se||Y.beforeRemove||!h.Pc(k))return h.$(function(){var xe=h.a.f(k)||[];typeof xe.length>"u"&&(xe=[xe]),se&&(xe=h.a.jb(xe,function(Pe){return Pe===e||Pe===null||!h.a.f(Pe._destroy)})),W(xe)},null,{l:j});W(k.v());var pe=k.subscribe(function(xe){W(k(),xe)},null,"arrayChange");return pe.l(j),pe};var V=h.a.g.Z(),U=h.a.g.Z();h.c.template={init:function(G,k){var Y=h.a.f(k());if(typeof Y=="string"||"name"in Y)h.h.Ea(G);else if("nodes"in Y){if(Y=Y.nodes||[],h.O(Y))throw Error('The "nodes" option must be a plain, non-observable array.');var j=Y[0]&&Y[0].parentNode;j&&h.a.g.get(j,U)||(j=h.a.Yb(Y),h.a.g.set(j,U,!0)),new h.C.ia(G).nodes(j)}else if(Y=h.h.childNodes(G),0<Y.length)j=h.a.Yb(Y),new h.C.ia(G).nodes(j);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,Y,j,J){var W=k();k=h.a.f(W),Y=!0,j=null,typeof k=="string"?k={}:(W="name"in k?k.name:G,"if"in k&&(Y=h.a.f(k.if)),Y&&"ifnot"in k&&(Y=!h.a.f(k.ifnot)),Y&&!W&&(Y=!1)),"foreach"in k?j=h.Qd(W,Y&&k.foreach||[],k,G,J):Y?(Y=J,"data"in k&&(Y=J.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),j=h.dc(W,Y,k,G)):h.h.Ea(G),J=j,(k=h.a.g.get(G,V))&&typeof k.s=="function"&&k.s(),h.a.g.set(G,V,!J||J.ja&&!J.ja()?e:J)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,E,w){if(_.length&&E.length){var P,M,B,V,U;for(P=M=0;(!w||P<w)&&(V=_[M]);++M){for(B=0;U=E[B];++B)if(V.value===U.value){V.moved=U.index,U.moved=V.index,E.splice(B,1),P=B=0;break}P+=B}}},h.a.Pb=function(){function _(E,w,P,M,B){var V=Math.min,U=Math.max,G=[],k,Y=E.length,j,J=w.length,W=J-Y||1,K=Y+J+1,Z,he,ge;for(k=0;k<=Y;k++)for(he=Z,G.push(Z=[]),ge=V(J,k+W),j=U(0,k-1);j<=ge;j++)Z[j]=j?k?E[k-1]===w[j-1]?he[j-1]:V(he[j]||K,Z[j-1]||K)+1:j+1:k+1;for(V=[],U=[],W=[],k=Y,j=J;k||j;)J=G[k][j]-1,j&&J===G[k][j-1]?U.push(V[V.length]={status:P,value:w[--j],index:j}):k&&J===G[k-1][j]?W.push(V[V.length]={status:M,value:E[--k],index:k}):(--j,--k,B.sparse||V.push({status:"retained",value:w[j]}));return h.a.Kc(W,U,!B.dontLimitMoves&&10*Y),V.reverse()}return function(E,w,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},E=E||[],w=w||[],E.length<w.length?_(E,w,"added","deleted",P):_(w,E,"deleted","added",P)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(P,M,B,V,U){var G=[],k=h.$(function(){var Y=M(B,U,h.a.Ua(G,P))||[];0<G.length&&(h.a.Xc(G,Y),V&&h.u.G(V,null,[B,Y,U])),G.length=0,h.a.Nb(G,Y)},null,{l:P,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var E=h.a.g.Z(),w=h.a.g.Z();h.a.ec=function(P,M,B,V,U,G){function k(Ut){we={Aa:Ut,pb:h.ta(he++)},K.push(we),W||Pe.push(we)}function Y(Ut){we=J[Ut],he!==we.pb.v()&&xe.push(we),we.pb(he++),h.a.Ua(we.Y,P),K.push(we)}function j(Ut,Pt){if(Ut)for(var Ce=0,ve=Pt.length;Ce<ve;Ce++)h.a.D(Pt[Ce].Y,function(ot){Ut(ot,Ce,Pt[Ce].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var J=h.a.g.get(P,E),W=!J,K=[],Z=0,he=0,ge=[],se=[],pe=[],xe=[],Pe=[],we,Se=0;if(W)h.a.D(M,k);else{if(!G||J&&J._countWaitingForRemove){var nt=h.a.Mb(J,function(Ut){return Ut.Aa});G=h.a.Pb(nt,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var nt=0,Ze,Gt,fn;Ze=G[nt];nt++)switch(Gt=Ze.moved,fn=Ze.index,Ze.status){case"deleted":for(;Z<fn;)Y(Z++);Gt===e&&(we=J[Z],we.$&&(we.$.s(),we.$=e),h.a.Ua(we.Y,P).length&&(V.beforeRemove&&(K.push(we),Se++,we.Aa===w?we=null:pe.push(we)),we&&ge.push.apply(ge,we.Y))),Z++;break;case"added":for(;he<fn;)Y(Z++);Gt!==e?(se.push(K.length),Y(Gt)):k(Ze.value)}for(;he<M.length;)Y(Z++);K._countWaitingForRemove=Se}h.a.g.set(P,E,K),j(V.beforeMove,xe),h.a.D(ge,V.beforeRemove?h.oa:h.removeNode);var pt,Tn,Vn;try{Vn=P.ownerDocument.activeElement}catch{}if(se.length)for(;(nt=se.shift())!=e;){for(we=K[nt],pt=e;nt;)if((Tn=K[--nt].Y)&&Tn.length){pt=Tn[Tn.length-1];break}for(M=0;Z=we.Y[M];pt=Z,M++)h.h.Wb(P,Z,pt)}for(nt=0;we=K[nt];nt++){for(we.Y||h.a.extend(we,_(P,B,we.Aa,U,we.pb)),M=0;Z=we.Y[M];pt=Z,M++)h.h.Wb(P,Z,pt);!we.Ed&&U&&(U(we.Aa,we.Y,we.pb),we.Ed=!0,pt=we.Y[we.Y.length-1])}for(Vn&&P.ownerDocument.activeElement!=Vn&&Vn.focus(),j(V.beforeRemove,pe),nt=0;nt<pe.length;++nt)pe[nt].Aa=w;j(V.afterMove,xe),j(V.afterAdd,Pe)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,E,w,P){return(E=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(E.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,P))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var E=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,P,M,B){if(B=B||n,M=M||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[P.$data],P=r.extend({koBindingContext:P},M.templateOptions),P=r.tmpl(V,w,P),P.appendTo(B.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,P){n.write("<script type='text/html' id='"+w+"'>"+P+"</script>")},0<E&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var lxt=ko;typeof window<"u"?(ko=window.ko,typeof PB<"u"?window.ko=PB:delete window.ko):(ko=global.ko,typeof PB<"u"?global.ko=PB:delete global.ko);var qC=lxt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var kK="__knockoutObservables",zK="__knockoutSubscribable";function pxe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=_xe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===kK||r===zK)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&j0t(n,a)}}),e}function _xe(e,t){var n=e[kK];return!n&&t&&(n={},Object.defineProperty(e,kK,{value:n})),n}function W0t(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),pxe.call(i,e,[t]),e}function j0t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=q0t(e,t,i))})}function q0t(e,t,n){var i=Y0t(e,n);return i.subscribe(t)}function Y0t(e,t){var n=t[zK];if(!n){n=new e.subscribable,Object.defineProperty(t,zK,{value:n});var i={};X0t(t,n,i),K0t(e,t,n,i)}return n}function X0t(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function K0t(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function gxe(e,t){if(!e)return null;var n=_xe(e,!1);return n&&n[t]||null}function J0t(e,t){var n=gxe(e,t);n&&n.valueHasMutated()}function Z0t(e){e.track=pxe,e.getObservable=gxe,e.valueHasMutated=J0t,e.defineProperty=W0t}var b2={attachToKo:Z0t};var yxe="http://www.w3.org/2000/svg",Axe="cesium-svgPath-svg",Q0t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(yxe,"svg:svg");i.setAttribute("class",Axe);let r=document.createElementNS(yxe,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${Axe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},S2=Q0t;b2.attachToKo(GC);S2.register(GC);var Te=GC;function v2(e){u(e)||(e=new qd),this._clock=e,this._eventHelper=new Io,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(v2.prototype,{clock:{get:function(){return this._clock}}});v2.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};v2.prototype.isDestroyed=function(){return!1};v2.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var w2=v2;function $0t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var HK=$0t;function eAt(e,t){t=y(t,!0);let n=new _e,i=new _e;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Te.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var En=eAt;var D2={};D2.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return u(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};D2.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};D2.createRangeInput=function(e,t,n,i,r,o){o=y(o,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(r,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let l=document.createElement("div");return l.className="cesium-cesiumInspector-slider",l.appendChild(document.createTextNode(e)),l.appendChild(s),l.appendChild(c),l};D2.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return u(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Ba=D2;function tAt(e,t,n,i,r){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,r)}var da=tAt;function xxe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Te.track(this,["toggled","tooltip"])}Object.defineProperties(xxe.prototype,{command:{get:function(){return this._command}}});var h0=xxe;var WC="http://www.w3.org/2000/svg",Exe="http://www.w3.org/1999/xlink",kH,I2=z.fromCssColorString("rgba(247,250,255,0.384)"),zH=z.fromCssColorString("rgba(143,191,255,0.216)"),GK=z.fromCssColorString("rgba(153,197,255,0.098)"),HH=z.fromCssColorString("rgba(255,255,255,0.086)"),nAt=z.fromCssColorString("rgba(255,255,255,0.267)"),iAt=z.fromCssColorString("rgba(255,255,255,0)"),Cxe=z.fromCssColorString("rgba(66,67,68,0.3)"),Txe=z.fromCssColorString("rgba(0,0,0,0.5)");function p0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var P2={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function vm(e){let t=document.createElementNS(WC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(vm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Exe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function WK(e,t,n){let i=document.createElementNS(WC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(WC,"tspan");return r.textContent=n,i.appendChild(r),i}function rAt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var GH=new z;function Ko(e,t){let n=t.alpha,i=1-n;return GH.red=e.red*i+t.red*n,GH.green=e.green*i+t.green*n,GH.blue=e.blue*i+t.blue*n,GH.toCssColorString()}function jK(e,t,n){let i=P2[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return vm(r)}function oAt(e,t,n){let i=P2[n],r=P2.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return vm(o)}function sAt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&kH!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,l;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,l=t.touches[0].clientY):(c=t.clientX,l=t.clientY),!i&&(c>a.right||c<a.left||l<a.top||l>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=l-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&l>f.top&&l<f.bottom?(kH=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===kH&&(kH=void 0),n.shuttleRingDragging=!1}function K_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[da(t,"toggled",this.setToggled,this),da(t,"tooltip",this.setTooltip,this),da(t.command,"canExecute",this.setEnabled,this)]}K_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};K_.prototype.isDestroyed=function(){return!1};K_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};K_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};K_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function tv(e,t){e=In(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(WC,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Exe);let s=document.createElementNS(WC,"g");this._topG=s,this._realtimeSVG=new K_(oAt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new K_(jK(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new K_(jK(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new K_(jK(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(WC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=vm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let l=P2.animation_pathSwooshFX,f=P2.animation_pathPointer,d=vm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:l.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:l.d},{tagName:l.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:l.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=vm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=vm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=vm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=vm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=WK(0,-24,""),this._knobTime=WK(0,-7,""),this._knobStatus=WK(0,-41,"");let A=vm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(WC,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(A),o.appendChild(s),e.appendChild(o);let C=this;function T(M){sAt(C,M)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let E=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],w=this._knobStatus.childNodes[0],D;this._subscriptions=[da(t.pauseViewModel,"toggled",function(M){D!==M&&(D=M,D?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),da(t,"shuttleRingAngle",function(M){rAt(C._shuttleRingPointer,C._knobOuter,M)}),da(t,"dateLabel",function(M){S.textContent!==M&&(S.textContent=M)}),da(t,"timeLabel",function(M){E.textContent!==M&&(E.textContent=M)}),da(t,"multiplierLabel",function(M){w.textContent!==M&&(w.textContent=M)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(tv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tv.prototype.isDestroyed=function(){return!1};tv.prototype.destroy=function(){u(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,r=n.length;i<r;i++)n[i].dispose();return ue(this)};tv.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};tv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(u(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=p0(this._themeNormal),n=p0(this._themeHover),i=p0(this._themeSelect),r=p0(this._themeDisabled),o=p0(this._themeKnob),s=p0(this._themePointer),a=p0(this._themeSwoosh),c=p0(this._themeSwooshHover),l=vm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ko(t,I2)},{tagName:"stop",offset:"12%","stop-color":Ko(t,zH)},{tagName:"stop",offset:"46%","stop-color":Ko(t,GK)},{tagName:"stop",offset:"81%","stop-color":Ko(t,HH)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ko(n,I2)},{tagName:"stop",offset:"12%","stop-color":Ko(n,zH)},{tagName:"stop",offset:"46%","stop-color":Ko(n,GK)},{tagName:"stop",offset:"81%","stop-color":Ko(n,HH)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ko(i,I2)},{tagName:"stop",offset:"12%","stop-color":Ko(i,zH)},{tagName:"stop",offset:"46%","stop-color":Ko(i,GK)},{tagName:"stop",offset:"81%","stop-color":Ko(i,HH)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ko(r,nAt)},{tagName:"stop",offset:"75%","stop-color":Ko(r,iAt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Ko(s,Txe)},{tagName:"stop",offset:"100%","stop-color":Ko(s,Txe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Ko(o,I2)},{tagName:"stop",offset:"60%","stop-color":Ko(o,Cxe)},{tagName:"stop",offset:"85%","stop-color":Ko(o,zH)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Ko(o,Cxe)},{tagName:"stop",offset:"60%","stop-color":Ko(o,I2)},{tagName:"stop",offset:"85%","stop-color":Ko(o,HH)}]}]});u(this._defsElement)?this._svgNode.replaceChild(l,this._defsElement):this._svgNode.appendChild(l),this._defsElement=l};var O2=tv;var aAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_0=15,nv=105;function bxe(e,t){return e-t}function qK(e,t){let n=Mr(t,e,bxe);return n<0?~n:n}function cAt(e,t){if(Math.abs(e)<=_0)return e/_0;let n=_0,i=nv,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function lAt(e,t,n){if(n.clockStep===yr.SYSTEM_CLOCK)return _0;if(Math.abs(e)<=1)return e*_0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=_0,o=nv,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Zf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Zf.defaultDateFormatter,this._timeFormatter=Zf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Zf.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===yr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return lAt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,nv),-nv);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===nv){c.multiplier=s>0?a[a.length-1]:a[0];return}let l=cAt(s,a);if(t.snapToTicks)l=a[qK(l,a)];else if(l!==0){let f=Math.abs(l);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);l=Math.round(l/p)*p|0}else f>_0?l=Math.round(l):f>1?l=+l.toFixed(1):f>0&&(l=+l.toFixed(2))}c.multiplier=l}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Bo.UNBOUNDED)return!0;let c=s.multiplier,l=s.currentTime,f=s.startTime,d=!1;if(a===Bo.LOOP_STOP)d=ee.greaterThan(l,f)||l.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(l,f)&&ee.lessThan(l,p)||l.equals(f)&&c>0||l.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Bo.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new h0(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new h0(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new h0(r,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==yr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=En(function(){t._clockViewModel.clockStep=yr.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new h0(o,{toggled:Te.computed(function(){return e.clockStep===yr.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,l=qK(c,a)-1;l>=0&&(s.multiplier=a[l])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,l=qK(c,a)+1;l<a.length&&(s.multiplier=a[l])})}Zf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${aAt[n.month-1]} ${n.day} ${n.year}`};Zf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Zf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Zf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Zf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(bxe);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,o),this._allShuttleRingTicks=s};Object.defineProperties(Zf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Zf._maxShuttleRingAngle=nv;Zf._realtimeShuttleRingAngle=_0;var M2=Zf;function Sxe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Te.getObservable(this,"imageryProviderViewModels"),o=Te.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;u(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._imageryProviders=o;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;u(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=u(d)?d.name:void 0,h=u(p)?p.name:void 0;return u(g)&&u(h)?`${g} -${h}`:u(g)?g:h}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(u(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,A=this._globe.imageryLayers,x=!1;for(p=0;p<h;p++){let C=A.length;for(let T=0;T<C;T++){let E=A.get(T);if(E===g[p]){A.remove(E),x=!0;break}}}if(u(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let T=C.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let E=Gs.fromProviderAsync(C[p]);A.add(E,0),this._currentImageryLayers.push(E)}}else{this._currentImageryLayers=[];let T=Gs.fromProviderAsync(C);if(T.name=d.name,x)A.add(T,0);else{let E=A.get(0);u(E)&&A.remove(E),A.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let l=Te.observable();Te.defineProperty(this,"selectedTerrain",{get:function(){return l()},set:function(d){if(l()===d){this.dropDownVisible=!1;return}let p;u(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),x=new p2(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,x()}});l(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(Sxe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var R2=Sxe;function WH(e,t){e=In(e);let n=new R2(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let l=document.createElement("div");l.className="cesium-baseLayerPicker-categoryTitle",l.setAttribute("data-bind","text: name"),c.appendChild(l);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",o.appendChild(h);let A=document.createElement("div");A.className="cesium-baseLayerPicker-section",A.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(A);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",A.appendChild(x);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),x.appendChild(C);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),x.appendChild(T);let E=document.createElement("div");E.className="cesium-baseLayerPicker-item",E.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(E);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),E.appendChild(S);let w=document.createElement("div");w.className="cesium-baseLayerPicker-itemLabel",w.setAttribute("data-bind","text: name"),E.appendChild(w),Te.applyBindings(n,i),Te.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(D){i.contains(D.target)||o.contains(D.target)||(n.dropDownVisible=!1)},Gt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(WH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WH.prototype.isDestroyed=function(){return!1};WH.prototype.destroy=function(){return Gt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var B2=WH;function vxe(e){let t=e.creationFunction;u(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(vxe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var As=vxe;function uAt(){let e=[];return e.push(new As({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return V_({style:Tm.AERIAL})}})),e.push(new As({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return V_({style:Tm.AERIAL_WITH_LABELS})}})),e.push(new As({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return V_({style:Tm.ROAD})}})),e.push(new As({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Ph.fromBasemapType(gm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new As({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Ph.fromBasemapType(gm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new As({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Ph.fromBasemapType(gm.OCEANS,{enablePickFeatures:!1})}})),e.push(new As({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new TC({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new As({name:"Stamen Watercolor",iconUrl:en("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new TC({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new As({name:"Stamen Toner",iconUrl:en("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new TC({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new As({name:"Sentinel-2",iconUrl:en("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Gf.fromAssetId(3954)}})),e.push(new As({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Gf.fromAssetId(3845)}})),e.push(new As({name:"Earth at night",iconUrl:en("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Gf.fromAssetId(3812)}})),e.push(new As({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Rh.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e}var L2=uAt;function fAt(){let e=[];return e.push(new As({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new $x}})),e.push(new As({name:"Cesium World Terrain",iconUrl:en("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return Zx({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var N2=fAt;function dAt(e){return function(t){let n=e._scene.pick(t.position);u(n)&&n.primitive instanceof va&&(e.tileset=n.primitive),e.pickActive=!1}}function Dxe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);u(i)&&i.primitive instanceof va&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var mAt={maximumFractionDigits:3};function F2(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,mAt):Math.round(t).toLocaleString()}function U2(e,t){if(!u(e))return"";let n=t?e._statisticsPerPass[Nr.PICK]:e._statisticsPerPass[Nr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${F2(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${F2(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${F2(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function Ixe(){let e=Ui.statistics;return` + */var JK="__knockoutObservables",ZK="__knockoutSubscribable";function Zbe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=$be(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===JK||r===ZK)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&fxt(n,a)}}),e}function $be(e,t){var n=e[JK];return!n&&t&&(n={},Object.defineProperty(e,JK,{value:n})),n}function uxt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),Zbe.call(i,e,[t]),e}function fxt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=dxt(e,t,i))})}function dxt(e,t,n){var i=mxt(e,n);return i.subscribe(t)}function mxt(e,t){var n=t[ZK];if(!n){n=new e.subscribable,Object.defineProperty(t,ZK,{value:n});var i={};hxt(t,n,i),pxt(e,t,n,i)}return n}function hxt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function pxt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function Qbe(e,t){if(!e)return null;var n=$be(e,!1);return n&&n[t]||null}function _xt(e,t){var n=Qbe(e,t);n&&n.valueHasMutated()}function gxt(e){e.track=Zbe,e.getObservable=Qbe,e.valueHasMutated=_xt,e.defineProperty=uxt}var DB={attachToKo:gxt};var eCe="http://www.w3.org/2000/svg",tCe="cesium-svgPath-svg",yxt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(eCe,"svg:svg");i.setAttribute("class",tCe);let r=document.createElementNS(eCe,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${tCe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},RB=yxt;DB.attachToKo(qC);RB.register(qC);var be=qC;function OB(e){l(e)||(e=new qd),this._clock=e,this._eventHelper=new Do,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=be.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=be.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=be.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=be.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=be.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=be.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=be.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=be.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=be.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),be.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(OB.prototype,{clock:{get:function(){return this._clock}}});OB.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};OB.prototype.isDestroyed=function(){return!1};OB.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var MB=OB;function xxt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var $K=xxt;function bxt(e,t){t=y(t,!0);let n=new _e,i=new _e;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,be.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var En=bxt;var LB={};LB.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};LB.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};LB.createRangeInput=function(e,t,n,i,r,o){o=y(o,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(r,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};LB.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Ma=LB;function Cxt(e,t,n,i,r){return n.call(i,e[t]),be.getObservable(e,t).subscribe(n,i,r)}var da=Cxt;function nCe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),be.track(this,["toggled","tooltip"])}Object.defineProperties(nCe.prototype,{command:{get:function(){return this._command}}});var _0=nCe;function iCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,be.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=be.getObservable(this,"imageryProviderViewModels"),o=be.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=o;let s=be.getObservable(this,"terrainProviderViewModels"),a=be.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,be.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,h=l(p)?p.name:void 0;return l(g)&&l(h)?`${g} +${h}`:l(g)?g:h}),this.buttonImageUrl=void 0,be.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=be.observable();this._currentImageryLayers=[],be.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<h;p++){let C=x.length;for(let A=0;A<C;A++){let T=x.get(A);if(T===g[p]){x.remove(T),b=!0;break}}}if(l(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let A=C.length;for(this._currentImageryLayers=[],p=A-1;p>=0;p--){let T=Hs.fromProviderAsync(C[p]);x.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let A=Hs.fromProviderAsync(C);if(A.name=d.name,b)x.add(A,0);else{let T=x.get(0);l(T)&&x.remove(T),x.add(A,0)}this._currentImageryLayers.push(A)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=be.observable();be.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),b=new AB(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,b()}});u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(iCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var NB=iCe;function tG(e,t){e=Pn(e);let n=new NB(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",o.appendChild(h);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),b.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-choices",A.setAttribute("data-bind","foreach: providers"),b.appendChild(A);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),A.appendChild(T);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),T.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),be.applyBindings(n,i),be.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(I){i.contains(I.target)||o.contains(I.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(tG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tG.prototype.isDestroyed=function(){return!1};tG.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._element),be.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var FB=tG;function rCe(e){let t=e.creationFunction;l(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,be.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(rCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Ts=rCe;function Txt(){let e=[];return e.push(new Ts({name:"Bing Maps Aerial",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return U_({style:Cm.AERIAL})}})),e.push(new Ts({name:"Bing Maps Aerial with Labels",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return U_({style:Cm.AERIAL_WITH_LABELS})}})),e.push(new Ts({name:"Bing Maps Roads",iconUrl:tn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return U_({style:Cm.ROAD})}})),e.push(new Ts({name:"ArcGIS World Imagery",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Rh.fromBasemapType(xm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new Ts({name:"ArcGIS World Hillshade",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Rh.fromBasemapType(xm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new Ts({name:"Esri World Ocean",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Rh.fromBasemapType(xm.OCEANS,{enablePickFeatures:!1})}})),e.push(new Ts({name:"Open\xADStreet\xADMap",iconUrl:tn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new UC({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new Ts({name:"Stamen Watercolor",iconUrl:tn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new UC({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ts({name:"Stamen Toner",iconUrl:tn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new UC({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ts({name:"Sentinel-2",iconUrl:tn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Hf.fromAssetId(3954)}})),e.push(new Ts({name:"Blue Marble",iconUrl:tn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Hf.fromAssetId(3845)}})),e.push(new Ts({name:"Earth at night",iconUrl:tn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Hf.fromAssetId(3812)}})),e.push(new Ts({name:"Natural Earth\xA0II",iconUrl:tn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Oh.fromUrl(tn("Assets/Textures/NaturalEarthII"))}})),e}var BB=Txt;function Axt(){let e=[];return e.push(new Ts({name:"WGS84 Ellipsoid",iconUrl:tn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Qb}})),e.push(new Ts({name:"Cesium World Terrain",iconUrl:tn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return Zb({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var kB=Axt;var YC="http://www.w3.org/2000/svg",aCe="http://www.w3.org/1999/xlink",nG,UB=z.fromCssColorString("rgba(247,250,255,0.384)"),iG=z.fromCssColorString("rgba(143,191,255,0.216)"),QK=z.fromCssColorString("rgba(153,197,255,0.098)"),rG=z.fromCssColorString("rgba(255,255,255,0.086)"),Ext=z.fromCssColorString("rgba(255,255,255,0.267)"),Sxt=z.fromCssColorString("rgba(255,255,255,0)"),oCe=z.fromCssColorString("rgba(66,67,68,0.3)"),sCe=z.fromCssColorString("rgba(0,0,0,0.5)");function g0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var VB={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function wm(e){let t=document.createElementNS(YC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(wm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(aCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function eJ(e,t,n){let i=document.createElementNS(YC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(YC,"tspan");return r.textContent=n,i.appendChild(r),i}function vxt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var oG=new z;function Jo(e,t){let n=t.alpha,i=1-n;return oG.red=e.red*i+t.red*n,oG.green=e.green*i+t.green*n,oG.blue=e.blue*i+t.blue*n,oG.toCssColorString()}function tJ(e,t,n){let i=VB[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return wm(r)}function wxt(e,t,n){let i=VB[n],r=VB.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return wm(o)}function Ixt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&nG!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(nG=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===nG&&(nG=void 0),n.shuttleRingDragging=!1}function Z_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[da(t,"toggled",this.setToggled,this),da(t,"tooltip",this.setTooltip,this),da(t.command,"canExecute",this.setEnabled,this)]}Z_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Z_.prototype.isDestroyed=function(){return!1};Z_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Z_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Z_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function av(e,t){e=Pn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(YC,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",aCe);let s=document.createElementNS(YC,"g");this._topG=s,this._realtimeSVG=new Z_(wxt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Z_(tJ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Z_(tJ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Z_(tJ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(YC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=wm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=VB.animation_pathSwooshFX,f=VB.animation_pathPointer,d=wm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=wm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=wm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=wm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=wm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=eJ(0,-24,""),this._knobTime=eJ(0,-7,""),this._knobStatus=eJ(0,-41,"");let x=wm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(YC,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),o.appendChild(s),e.appendChild(o);let C=this;function A(O){Ixt(C,O)}this._mouseCallback=A,c.addEventListener("mousedown",A,!0),c.addEventListener("touchstart",A,!0),d.addEventListener("mousedown",A,!0),d.addEventListener("touchstart",A,!0),n.addEventListener("mousemove",A,!0),n.addEventListener("touchmove",A,!0),n.addEventListener("mouseup",A,!0),n.addEventListener("touchend",A,!0),n.addEventListener("touchcancel",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);let T=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],I;this._subscriptions=[da(t.pauseViewModel,"toggled",function(O){I!==O&&(I=O,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),da(t,"shuttleRingAngle",function(O){vxt(C._shuttleRingPointer,C._knobOuter,O)}),da(t,"dateLabel",function(O){S.textContent!==O&&(S.textContent=O)}),da(t,"timeLabel",function(O){T.textContent!==O&&(T.textContent=O)}),da(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(av.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});av.prototype.isDestroyed=function(){return!1};av.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,r=n.length;i<r;i++)n[i].dispose();return ue(this)};av.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};av.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=g0(this._themeNormal),n=g0(this._themeHover),i=g0(this._themeSelect),r=g0(this._themeDisabled),o=g0(this._themeKnob),s=g0(this._themePointer),a=g0(this._themeSwoosh),c=g0(this._themeSwooshHover),u=wm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jo(t,UB)},{tagName:"stop",offset:"12%","stop-color":Jo(t,iG)},{tagName:"stop",offset:"46%","stop-color":Jo(t,QK)},{tagName:"stop",offset:"81%","stop-color":Jo(t,rG)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jo(n,UB)},{tagName:"stop",offset:"12%","stop-color":Jo(n,iG)},{tagName:"stop",offset:"46%","stop-color":Jo(n,QK)},{tagName:"stop",offset:"81%","stop-color":Jo(n,rG)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jo(i,UB)},{tagName:"stop",offset:"12%","stop-color":Jo(i,iG)},{tagName:"stop",offset:"46%","stop-color":Jo(i,QK)},{tagName:"stop",offset:"81%","stop-color":Jo(i,rG)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jo(r,Ext)},{tagName:"stop",offset:"75%","stop-color":Jo(r,Sxt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Jo(s,sCe)},{tagName:"stop",offset:"100%","stop-color":Jo(s,sCe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jo(o,UB)},{tagName:"stop",offset:"60%","stop-color":Jo(o,oCe)},{tagName:"stop",offset:"85%","stop-color":Jo(o,iG)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jo(o,oCe)},{tagName:"stop",offset:"60%","stop-color":Jo(o,UB)},{tagName:"stop",offset:"85%","stop-color":Jo(o,rG)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var zB=av;var Pxt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y0=15,cv=105;function cCe(e,t){return e-t}function nJ(e,t){let n=Or(t,e,cCe);return n<0?~n:n}function Dxt(e,t){if(Math.abs(e)<=y0)return e/y0;let n=y0,i=cv,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function Rxt(e,t,n){if(n.clockStep===yr.SYSTEM_CLOCK)return y0;if(Math.abs(e)<=1)return e*y0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=y0,o=cv,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Zf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Zf.defaultDateFormatter,this._timeFormatter=Zf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,be.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Zf.defaultTicks),this.timeLabel=void 0,be.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,be.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,be.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===yr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,be.defineProperty(this,"shuttleRingAngle",{get:function(){return Rxt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,cv),-cv);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=yr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===cv){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=Dxt(s,a);if(t.snapToTicks)u=a[nJ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>y0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,be.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===No.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===No.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,be.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===No.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,be.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new _0(n,{toggled:be.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new _0(i,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new _0(r,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==yr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=En(function(){t._clockViewModel.clockStep=yr.SYSTEM_CLOCK},be.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new _0(o,{toggled:be.computed(function(){return e.clockStep===yr.SYSTEM_CLOCK}),tooltip:be.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=nJ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=nJ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Zf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${Pxt[n.month-1]} ${n.day} ${n.year}`};Zf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Zf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Zf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Zf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(cCe);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,o),this._allShuttleRingTicks=s};Object.defineProperties(Zf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Zf._maxShuttleRingAngle=cv;Zf._realtimeShuttleRingAngle=y0;var HB=Zf;function Oxt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ns&&(e.tileset=n.primitive),e.pickActive=!1}}function uCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ns&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var Mxt={maximumFractionDigits:3};function GB(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Mxt):Math.round(t).toLocaleString()}function WB(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Fr.PICK]:e._statisticsPerPass[Fr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${GB(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${GB(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${GB(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function fCe(){let e=ki.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${F2(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${F2(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${GB(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${GB(e.texturesByteLength)}</li> </ul> - `}var hAt=[{text:"Highlight",value:gl.HIGHLIGHT},{text:"Replace",value:gl.REPLACE},{text:"Mix",value:gl.MIX}],wxe=new z(1,1,0,.4),pAt=new z,jH=new z;function ma(e,t){let n=this,i=e.canvas;this._eventHandler=new Ru(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new W_({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Te.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let U=[],Y=n._properties();for(let W in Y)Y.hasOwnProperty(W)&&U.push(W);return U});let r=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(U){r(U),u(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let o=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(U){o(U),u(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=gl.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(Y){let W=e.pick(Y.endPosition);if(W instanceof Is?(n.feature=W,n.tile=W.content.tile):u(W)&&u(W.content)?(n.feature=void 0,n.tile=W.content.tile):(n.feature=void 0,n.tile=void 0),!!u(n._tileset)){if(s&&u(W)&&u(W.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(Y.endPosition),u(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=W.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),u(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let l=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return l()},set:function(U){l(U),u(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),u(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(U){d(U),u(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),u(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),u(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),u(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),u(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let A=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return A()},set:function(U){A(U),u(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(U){x(U),u(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),u(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let T=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(U){U=Number(U),isNaN(U)||(T(U),u(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let E=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),u(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(E(),1/6)},set:function(U){E(Math.pow(U,6))}});let S=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),u(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=4;let w=dAt(this),D=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return D()},set:function(U){D(U),U?n._eventHandler.setInputAction(w,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let M=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(U){M(U),u(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let O=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(U){U=Number(U),isNaN(U)||(O(U),u(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let B=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return B()},set:function(U){U=Number(U),isNaN(U)||(B(U),u(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let L=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),u(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),u(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let b=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return b()},set:function(U){U=Number(U),isNaN(U)||(b(U),u(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let v=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(U){U=Number(U),isNaN(U)||(v(U),u(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),u(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let R=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),u(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let F=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),u(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let k=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),u(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),u(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(U){G(U),u(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),u(this._tileset)||Dxe(this,!0)}Object.defineProperties(ma.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return hAt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,u(e)){let t=this;e._readyPromise.then(function(o){t.isDestroyed()||t._properties(o.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let o=0;o<i;++o){let s=n[o];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=U2(e,!1),this._pickStatisticsText=U2(e,!0),this._resourceCacheStatisticsText=Ixe(),Dxe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;u(t)&&!t.content.isDestroyed()&&(!this.colorize&&u(this._style)?t.color=u(this._style.color)?this._style.color.evaluateColor(t,pAt):z.WHITE:t.color=jH,this._scene.requestRender()),u(e)&&(z.clone(e.color,jH),e.color=wxe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;u(t)&&!t.isDestroyed()&&!YK(t.content)&&(t.color=jH,this._scene.requestRender()),u(e)&&!YK(e.content)&&(z.clone(e.color,jH),e.color=wxe,this._scene.requestRender()),this._tile=e}}});function YK(e){if(!u(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(u(t)){let n=t.length;for(let i=0;i<n;++i)if(!YK(t[i]))return!1;return!0}return!1}ma.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ma.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ma.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ma.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ma.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ma.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ma.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ma.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ma.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ma.prototype.trimTilesCache=function(){u(this._tileset)&&this._tileset.trimLoadedTiles()};ma.prototype.compileStyle=function(){let e=this._tileset;if(!(!u(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new F_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ma.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,l;if(t.shiftKey)for(l=0;l<c;++l)a[l][0]===" "&&(a[l][1]===" "?(a[l]=a[l].substr(2),o-=2):(a[l]=a[l].substr(1),o-=1));else for(l=0;l<c;++l)a[l]=` ${a[l]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ma.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),u(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=U2(e,!1),this._pickStatisticsText=U2(e,!0),this._resourceCacheStatisticsText=Ixe())};ma.prototype.isDestroyed=function(){return!1};ma.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};ma.getStatistics=U2;var V2=ma;function qH(e,t){e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new V2(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ba.createSection,c=Ba.createCheckbox,l=Ba.createRangeInput,f=Ba.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),A=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let E=document.createElement("label");E.className="field-label",E.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),T.appendChild(E),T.appendChild(S),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let w=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",w.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let M=document.createElement("div");M.setAttribute("data-bind","visible: pointCloudShading"),M.appendChild(l("Geometric Error Scale","geometricErrorScale",0,2,.01)),M.appendChild(l("Maximum Attenuation","maximumAttenuation",0,32,1)),M.appendChild(l("Base Resolution","baseResolution",0,1,.01)),M.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(M);let O=document.createElement("div");O.setAttribute("data-bind","visible: eyeDomeLighting"),O.appendChild(l("EDL Strength","eyeDomeLightingStrength",0,2,.1)),O.appendChild(l("EDL Radius","eyeDomeLightingRadius",0,4,.1)),M.appendChild(O),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let B=document.createElement("div");B.appendChild(l("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(B);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(l("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(l("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(L),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(b),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(v);let I=document.createElement("div");x.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let R=document.createElement("select");R.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(R);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let k=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(k);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),A.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),A.appendChild(c("Geometric Error","showGeometricError")),A.appendChild(c("Rendering Statistics","showRenderingStatistics")),A.appendChild(c("Memory Usage (MB)","showMemoryUsage")),A.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(l("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let U=document.createElement("div");U.appendChild(l("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let Y=document.createElement("div");Y.appendChild(l("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(Y),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(r,n)}Object.defineProperties(qH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qH.prototype.isDestroyed=function(){return!1};qH.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var k2=qH;function _At(e){let t;if(u(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function XK(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var gAt=new Dn,yAt=new m;function z2(e,t){let n=this,i=e.canvas,r=new Ru(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Te.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(l){n._scene.debugShowFrustums=l,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(l){n._scene.debugShowFrustumPlanes=l,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(l){l?n._performanceDisplay=new W_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let l=n._primitive.modelMatrix;n._modelMatrixPrimitive=new AN({modelMatrix:l}),n._scene.primitives.add(n._modelMatrixPrimitive)}else u(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(l){return u(n._modelMatrixPrimitive)&&l.owner===n._modelMatrixPrimitive._primitive?!0:u(n._primitive)?l.owner===n._primitive||l.owner===n._primitive._billboardCollection||l.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(l){o._surface.tileProvider._debug.wireframe=l,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(l){n._scene.debugShowDepthFrustum=l,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let l=n.depthFrustum+1;return n.depthFrustum=XK(1,n._numberOfFrustums,l),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let l=n.depthFrustum-1;return n.depthFrustum=XK(1,n._numberOfFrustums,l),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(l){o._surface._debug.suspendLodUpdate=l,l||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!u(s)?s=e.imageryLayers.addImageryProvider(new g2({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&u(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],u(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(l){let f=n._scene.pick({x:l.position.x,y:l.position.y});u(f)&&(n.primitive=u(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(l){l?r.setInputAction(a,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)});function c(l){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(l.position,gAt),g=o.pick(p,n._scene,yAt);if(u(g)){let h=d.cartesianToCartographic(g),A=o._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!f&&x<A.length;++x){let C=A[x];if(u(C))for(let T=0;!f&&T<C.length;++T){let E=C[T];ce.contains(E.rectangle,h)&&(f=E)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(l){l?r.setInputAction(c,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(z2.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,u(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,u(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(u(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;u(n)&&u(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});z2.prototype._update=function(){this.frustums&&(this.frustumStatisticText=_At(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=XK(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};z2.prototype.isDestroyed=function(){return!1};z2.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var H2=z2;function YH(e,t){e=In(e);let n=document.createElement("div"),i=new H2(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Ba.createSection,c=Ba.createCheckbox,l=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),l.appendChild(f),l.appendChild(c("Show Frustum Planes","frustumPlanes")),l.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",l.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),l.appendChild(p);let g=document.createElement("div");l.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(A);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(x);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",T.appendChild(E);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let w=document.createElement("div");w.className="cesium-cesiumInspector-center",w.appendChild(S),E.appendChild(w),E.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),E.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),E.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),M=document.createElement("div");M.className="cesium-cesiumInspector-pickSection",D.appendChild(M);let O=document.createElement("input");O.type="button",O.value="Pick a tile",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),w=document.createElement("div"),w.appendChild(O),w.className="cesium-cesiumInspector-center",M.appendChild(w);let B=document.createElement("div");M.appendChild(B);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let b=document.createElement("input");b.type="button",b.value="NE",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let R=document.createElement("div");R.className="cesium-cesiumInspector-tileText",B.className="cesium-cesiumInspector-frustumStatistics",B.appendChild(R),B.setAttribute("data-bind","visible: hasPickedTile"),R.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",B.appendChild(F);let k=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),U=document.createElement("td");U.appendChild(L);let Y=document.createElement("td");Y.appendChild(_);let W=document.createElement("td");W.appendChild(b),V.appendChild(U),V.appendChild(Y),V.appendChild(W);let J=document.createElement("td"),j=document.createElement("td");j.appendChild(v);let K=document.createElement("td");K.appendChild(I),G.appendChild(J),G.appendChild(j),G.appendChild(K),k.appendChild(V),k.appendChild(G),B.appendChild(k),M.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),M.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(YH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YH.prototype.isDestroyed=function(){return!1};YH.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var G2=YH;function XH(e,t){u(t)||(t=document.body),t=In(t);let n=this,i=Te.observable(ho.fullscreen),r=Te.observable(ho.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&ho.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){ho.fullscreen?ho.exitFullscreen():ho.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(In(e),o.body),this._callback=function(){i(ho.fullscreen)},o.addEventListener(ho.changeEventName,this._callback)}Object.defineProperties(XH.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});XH.prototype.isDestroyed=function(){return!1};XH.prototype.destroy=function(){document.removeEventListener(ho.changeEventName,this._callback),ue(this)};var W2=XH;var AAt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",xAt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function KH(e,t){e=In(e);let n=new W2(t,e);n._exitFullScreenPath=xAt,n._enterFullScreenPath=AAt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(KH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KH.prototype.isDestroyed=function(){return!1};KH.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j2=KH;function Pxe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(Pxe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var q2=Pxe;function JH(e,t,n){e=In(e);let i=new q2(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Te.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(JH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JH.prototype.isDestroyed=function(){return!1};JH.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Y2=JH;var Oxe=1e3;function Qf(e){u(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new lL,new TL({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=Rxe,this._handleArrowUp=Mxe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let r=Te.getObservable(t,"_suggestions")().length>0,o=Te.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=En(function(i){if(i=y(i,Xy.SEARCH),t._focusTextbox=!1,u(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)vAt(t);else return bAt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?Mxe(t):o?Rxe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;Nxe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Qf.flyToDestination),this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Qf._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Qf.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Qf.prototype.destroy=function(){this._suggestionSubscription.dispose()};function Mxe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Qf._adjustSuggestionsScroll(e,n)}function Rxe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Qf._adjustSuggestionsScroll(e,i)}function CAt(e,t){let n=u(t)?t.availability:void 0;return u(n)?v_(t,[e]).then(function(i){return e=i[0],e.height+=Oxe,e}):(e.height+=Oxe,Promise.resolve(e))}function TAt(e,t){let n=e._scene,r=n.mapProjection.ellipsoid,o=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ce.center(t):c=lC(t,n):t=r.cartesianToCartographic(t),u(c)||(c=CAt(t,s)),c.then(function(l){a=r.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:N.IDENTITY})})}async function EAt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function bAt(e,t,n){let i=e._searchText;if(Lxe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await EAt(t[r],i,n),u(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,JK(e);let s=o.value;if(o.state==="fulfilled"&&u(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=Bxe(e,tS.getCreditsFromResult(s[0]));u(a)||KK(e,t[r].credit);return}e._searchText=`${i} (not found)`}function KK(e,t){u(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function Bxe(e,t){return u(t)&&t.forEach(n=>KK(e,n)),t}function JK(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function SAt(e,t){let n=In(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function vAt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function Lxe(e){return/^\s*$/.test(e)}function Nxe(e){Te.getObservable(e,"_suggestions").removeAll()}async function wAt(e){if(!e.autoComplete)return;let t=e._searchText;if(Nxe(e),JK(e),!Lxe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Xy.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=tS.getCreditsFromResult(o);r=r&&!u(s),Bxe(e,s)}),r&&KK(e,n.credit)}if(e._suggestions.length>=5)return}}Qf.flyToDestination=TAt;Qf._updateSearchSuggestions=wAt;Qf._adjustSuggestionsScroll=SAt;Qf.prototype.isDestroyed=function(){return!1};Qf.prototype.destroy=function(){return JK(this),ue(this)};var X2=Qf;var DAt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",IAt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function ZH(e){let t=In(e.container),n=new X2(e);n._startSearchPath=DAt,n._stopSearchPath=IAt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(l){let f=l.target;typeof l.composedPath=="function"&&(f=l.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(l){n._focusTextbox=!0,n.showSuggestions()},Gt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(ZH.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});ZH.prototype.isDestroyed=function(){return!1};ZH.prototype.destroy=function(){let e=this._container;return Gt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var K2=ZH;function Fxe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(Fxe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var J2=Fxe;function QH(e){let t=In(e.container),n=new J2,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let l=document.createElement("button");l.type="button",l.className="cesium-navigation-button cesium-navigation-button-right",l.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=en("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",l.appendChild(f),l.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(l);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Te.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},Gt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(QH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QH.prototype.isDestroyed=function(){return!1};QH.prototype.destroy=function(){return Gt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Z2=QH;var PAt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",OAt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function ZK(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?OAt:PAt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!u(this.description)||this.description.length===0}})}ZK.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(ZK.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Q2=ZK;function $H(e){e=In(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let s=new Q2;Te.applyBindings(s,t),this._container=e,this._element=t,this._frame=o,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;o.addEventListener("load",function(){let c=o.contentDocument,l=c.createElement("link");l.href=en("Widgets/InfoBox/InfoBoxDescription.css"),l.rel="stylesheet",l.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(l),c.body.appendChild(f),a._descriptionSubscription=da(s,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let A=window.getComputedStyle(g);if(A!==null){let x=A["background-color"],C=z.fromCssColorString(x);u(C)&&C.alpha!==0&&(p=A["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;o.style.height=`${h}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties($H.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});$H.prototype.isDestroyed=function(){return!1};$H.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),u(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var $2=$H;function eG(e){this._scene=e,this._orthographic=e.camera.frustum instanceof tn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Io,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===ne.SCENE2D||t._scene.camera.frustum instanceof tn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=u(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(eG.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});eG.prototype.isDestroyed=function(){return!1};eG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var e3=eG;var MAt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",RAt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function tG(e,t){e=In(e);let n=new e3(t);n._perspectivePath=MAt,n._orthographicPath=RAt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Gt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(tG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tG.prototype.isDestroyed=function(){return!1};tG.prototype.destroy=function(){return this._viewModel.destroy(),Gt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var t3=tG;function QK(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=ON.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(QK.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});QK.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var n3=QK;function nG(e){let t=In(e.container),n=new n3(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(nG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nG.prototype.isDestroyed=function(){return!1};nG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var i3=nG;function iG(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Io,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===ne.SCENE2D?n.tooltip2D:r===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(iG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});iG.prototype.isDestroyed=function(){return!1};iG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var r3=iG;var BAt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",LAt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",NAt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function rG(e,t,n){e=In(e);let i=new r3(t,n);i._globePath=BAt,i._flatMapPath=LAt,i._columbusViewPath=NAt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),Te.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(l){r.contains(l.target)||(i.dropDownVisible=!1)},Gt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(rG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});rG.prototype.isDestroyed=function(){return!1};rG.prototype.destroy=function(){return this._viewModel.destroy(),Gt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var o3=rG;var FAt=new H,oG="-1000px";function s3(e,t,n){this._scene=e,this._screenPositionX=oG,this._screenPositionY=oG,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&u(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return $i.wgs84ToWindowCoordinates(e,i,r)}}s3.prototype.update=function(){if(this.showSelection&&u(this.position)){let e=this.computeScreenSpacePosition(this.position,FAt);if(!u(e))this._screenPositionX=oG,this._screenPositionY=oG;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};s3.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Lo.EXPONENTIAL_OUT})};s3.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Lo.EXPONENTIAL_OUT})};Object.defineProperties(s3.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var a3=s3;function sG(e,t){e=In(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new a3(t,this._element,this._container);this._viewModel=c,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(sG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sG.prototype.isDestroyed=function(){return!1};sG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),ue(this)};var c3=sG;function jC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}jC.prototype.getHeight=function(){return this._height};jC.prototype.getBase=function(){return this._base};jC.prototype.getStartTime=function(){return this._start};jC.prototype.getStopTime=function(){return this._stop};jC.prototype.setRange=function(e,t){this._start=e,this._stop=t};jC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=ee.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var l3=jC;function Uxe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}Uxe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,r)&&ee.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,o)&&ee.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let l=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!u(a)&&ee.greaterThanOrEquals(l,n)?a=s:!u(c)&&ee.greaterThanOrEquals(l,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),u(a)&&(u(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var u3=Uxe;var $K=1e12,$f={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},il={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},g0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],UAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function rl(e,t){e=In(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=$f.none,this._touchMode=il.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=VAt(this),this._onMouseUp=kAt(this),this._onMouseMove=zAt(this),this._onMouseWheel=HAt(this),this._onTouchStart=GAt(this),this._onTouchMove=jAt(this),this._onTouchEnd=WAt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}rl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};rl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};rl.prototype.isDestroyed=function(){return!1};rl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};rl.prototype.addHighlightRange=function(e,t,n){let i=new l3(e,t,n);return this._highlightRanges.push(i),this.resize(),i};rl.prototype.addTrack=function(e,t,n,i){let r=new u3(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};rl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Bo.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=ee.secondsDifference(r,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=r,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};rl.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function eJ(e){return e<10?`0${e.toString()}`:e.toString()}rl.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${UAt[t.month-1]} ${t.day} ${t.year} ${eJ(t.hour)}:${eJ(t.minute)}:${eJ(t.second)}${i}`};rl.prototype.smallestTicInPixels=7;rl.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,l=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),A,x=ee.toGregorianDate(g);d>31536e4?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):d>31536e3?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):d>86400?A=ee.fromDate(new Date(Date.UTC(x.year,0))):A=ee.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(A,h,new ee)),T=C+d;this._epochJulian=A;function E(U){return Math.floor(C/U)*U}function S(U,Y){return Math.ceil(U/Y+.5)*Y}function w(U){return(U-C)/d}function D(U,Y){return U-Y*Math.round(U/Y)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let M=this._rulerEle.offsetWidth+20;M<30&&(M=180);let O=f;f-=l;let B={startTime:C,startJulian:g,epochJulian:A,duration:d,timeBarWidth:p,getAlpha:w};this._highlightRanges.forEach(function(U){s+=U.render(B)});let L=0,_=0,b=0,v=M/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,R=-1,F=g0.length,k;for(k=0;k<F;++k){let U=g0[k];if(++I,L=U,U>v&&U>f)break;R<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(L,g0[I]))<1e-5){g0[I]>=f&&(_=g0[I]);break}if(R>=0)for(;R<I;){if(Math.abs(D(_,g0[R]))<1e-5&&g0[R]>=f){b=g0[R];break}++R}}f=O,f>l&&b<1e-5&&Math.abs(f-L)>l&&(b=f,f<=L+l&&(_=0));let V=-999999,G;if(p*(b/this._timeBarSecondsSpan)>=3)for(r=E(b);r<=T;r=S(r,b))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=E(_);r<=T;r=S(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,T+=L,r=E(L);let U=ee.computeTaiMinusUtc(A);for(;r<=T;){let Y=ee.addSeconds(g,r-C,new ee);if(L>2.1){let K=ee.computeTaiMinusUtc(Y);Math.abs(K-U)>.1&&(r+=K-U,Y=ee.addSeconds(g,r-C,new ee))}let W=Math.round(p*w(r)),J=this.makeLabel(Y);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=M);let j=W-(G/2-1);j>V?(V=j+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${W.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${W.toString()}px;"></span>`,r=S(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),B.y=0,this._trackList.forEach(function(U){U.render(o._context,B),B.y+=U.height})};rl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(u(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}u(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};rl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function VAt(e){return function(t){e._mouseMode!==$f.touchOnly&&(t.button===0?(e._mouseMode=$f.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=$f.zoom:e._mouseMode=$f.slide)),t.preventDefault()}}function kAt(e){return function(t){e._mouseMode=$f.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function zAt(e){return function(t){let n;if(e._mouseMode===$f.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===$f.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===$f.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function HAt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;$K=Math.max(Math.min(Math.abs(n),$K),1),n/=$K,e.zoomFrom(Math.pow(1.05,-n))}}function GAt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=$f.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=il.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=il.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=il.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=il.ignore}}function WAt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===il.singleTap?(e._touchMode=il.scrub,e._onTouchMove(t)):e._touchMode===il.scrub&&e._onTouchMove(t),e._mouseMode=$f.touchOnly,n!==1?e._touchMode=n>0?il.ignore:il.none:e._touchMode===il.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function jAt(e){return function(t){let n,i,r,o,s,a,c=1,l=e._topDiv.getBoundingClientRect().left;e._touchMode===il.singleTap&&(e._touchMode=il.slideZoom),e._mouseMode=$f.touchOnly,e._touchMode===il.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-l,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===il.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-l,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-l,s=0),u(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-o,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=o,e._touchState.spanX=s))}}rl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var f3=rl;var kxe=Ki(Vxe(),1);function qAt(e){let t=!1,n=window.screen;return u(n)&&(u(n.lockOrientation)?t=n.lockOrientation(e):u(n.mozLockOrientation)?t=n.mozLockOrientation(e):u(n.msLockOrientation)?t=n.msLockOrientation(e):u(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function zxe(){let e=window.screen;u(e)&&(u(e.unlockOrientation)?e.unlockOrientation():u(e.mozUnlockOrientation)?e.mozUnlockOrientation():u(e.msUnlockOrientation)?e.msUnlockOrientation():u(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function YAt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(zxe(),e._locked=!1),e._noSleep.disable(),ho.exitFullscreen(),n(!1)):(ho.fullscreen||ho.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=qAt("landscape")),t.useWebVR=!0,n(!0)))}function aG(e,t){let n=this,i=Te.observable(ho.enabled),r=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&ho.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Io,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof tn)}),this._locked=!1,this._noSleep=new kxe.default,this._command=En(function(){YAt(n,e,r,o)},Te.getObservable(this,"isVREnabled")),this._vrElement=y(In(t),document.body),this._callback=function(){!ho.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(zxe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(ho.changeEventName,this._callback)}Object.defineProperties(aG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});aG.prototype.isDestroyed=function(){return!1};aG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ho.changeEventName,this._callback),ue(this)};var m3=aG;var XAt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",KAt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function cG(e,t,n){e=In(e);let i=new m3(t,n);i._exitVRPath=KAt,i._enterVRPath=XAt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),Te.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(cG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cG.prototype.isDestroyed=function(){return!1};cG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var h3=cG;var y0=new ae;function Wxe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function JAt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);u(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function ZAt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(u(o)&&o!=="")return o}return"Unnamed Feature"}function Hxe(e,t){let n=e.scene.pick(t.position);if(u(n)){let i=y(n.id,n.primitive.id);if(i instanceof Jr)return i;if(n instanceof Is)return new Jr({name:ZAt(n),description:JAt(n),feature:n})}if(u(e.scene.globe))return ext(e,t.position)}var QAt=new ee;function jxe(e,t,n){if(u(n)){let i=n.clock;if(u(i)&&(i.getValue(t),u(e))){let r=i.startTime,o=i.stopTime;ee.equals(r,o)&&(o=ee.addSeconds(r,P.EPSILON2,QAt)),e.updateFromClock(),e.zoomTo(r,o)}}}var $At=new m;function ext(e,t){let n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!u(r))return;let o=new Jr({id:"Loading...",description:"Loading feature information..."});return r.then(function(s){if(e.selectedEntity!==o)return;if(!u(s)||s.length===0){e.selectedEntity=Gxe();return}let a=s[0],c=new Jr({id:a.name,description:a.description});if(u(a.position)){let l=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,$At);c.position=new Rc(l)}e.selectedEntity=c},function(){e.selectedEntity===o&&(e.selectedEntity=Gxe())}),o}function Gxe(){return new Jr({id:"None",description:"No features found."})}function txt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,l=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(u(n)&&(n.container.style.visibility=p),u(i)&&(i.container.style.visibility=p),u(r)&&(r.container.style.visibility=p),u(o)&&(o.container.style.visibility=p),u(s)&&(s.container.style.visibility=p),u(a)&&(a.container.style.visibility=p),u(c)&&(c.container.style.visibility=p),u(l)&&l.viewModel.isFullscreenEnabled&&(l.container.style.visibility=p),u(f)&&(f.container.style.visibility=p),u(d)&&(d.container.style.visibility=p),e._container){let g=t||!u(l)?0:l.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ni(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=(!u(t.globe)||t.globe!==!1)&&(!u(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=y(t.scene3DOnly,!1),c,l,f=!1;u(t.clockViewModel)?(l=t.clockViewModel,c=l.clock):(c=new qd,l=new w2(c),f=!0),u(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new T2(o,{baseLayer:n||u(t.baseLayer)||u(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:u(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;u(p)||(p=new YR,g=!0);let h=d.scene,A=new RB({scene:h,dataSourceCollection:p}),x=new Io;x.add(c.onTick,Ni.prototype._onTick,this),x.add(h.morphStart,Ni.prototype._clearTrackedObject,this);let C;if(!u(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(W),C=new c3(W,h)}let T;if(!u(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",r.appendChild(W),T=new $2(W);let J=T.viewModel;x.add(J.cameraClicked,Ni.prototype._onInfoBoxCameraClicked,this),x.add(J.closeClicked,Ni.prototype._onInfoBoxClockClicked,this)}let E=document.createElement("div");E.className="cesium-viewer-toolbar",r.appendChild(E);let S;if(!u(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",E.appendChild(W);let J;u(t.geocoder)&&typeof t.geocoder!="boolean"&&(J=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new K2({container:W,geocoderServices:J,scene:h}),x.add(S.viewModel.search.beforeExecute,Ni.prototype._clearObjects,this)}let w;(!u(t.homeButton)||t.homeButton!==!1)&&(w=new Y2(E,h),u(S)&&x.add(w.viewModel.command.afterExecute,function(){let W=S.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),x.add(w.viewModel.command.beforeExecute,Ni.prototype._clearTrackedObject,this));let D;!a&&(!u(t.sceneModePicker)||t.sceneModePicker!==!1)&&(D=new o3(E,h));let M;t.projectionPicker&&(M=new t3(E,h));let O,B;if(n){let W=y(t.imageryProviderViewModels,L2()),J=y(t.terrainProviderViewModels,N2());O=new B2(E,{globe:h.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:J,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),B=E.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}u(t.imageryProvider)&&t.imageryProvider!==!1&&($("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),u(t.baseLayer)&&t.baseLayer!==!1&&(n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),u(t.terrainProvider)&&(n&&(O.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),u(t.terrain)&&(n&&(O.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let L;if(!u(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(u(window.localStorage)){let J=window.localStorage.getItem("cesium-hasSeenNavHelp");u(J)&&J?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}L=new Z2({container:E,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,W)})}let _;if(!u(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",r.appendChild(W),_=new O2(W,new M2(l))}let b;if(!u(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",r.appendChild(W),b=new f3(W,c),b.addEventListener("settime",Wxe,!1),b.zoomTo(c.startTime,c.stopTime)}let v,I,R;(!u(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",r.appendChild(R),v=new j2(R,t.fullscreenElement),I=da(v.viewModel,"isFullscreenEnabled",function(W){R.style.display=W?"block":"none",u(b)&&(b.container.style.right=`${R.clientWidth}px`,b.resize())}));let F,k,V;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",r.appendChild(W),F=new h3(W,h,t.fullScreenElement),k=da(F.viewModel,"isVREnabled",function(J){W.style.display=J?"block":"none",u(v)&&(W.style.right=`${R.clientWidth}px`),u(b)&&(b.container.style.right=`${W.clientWidth}px`,b.resize())}),V=da(F.viewModel,"isVRMode",function(J){txt(i,J)})}this._baseLayerPickerDropDown=B,this._fullscreenSubscription=I,this._vrSubscription=k,this._vrModeSubscription=V,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=T,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=A,this._clockViewModel=l,this._destroyClockViewModel=f,this._toolbar=E,this._homeButton=w,this._sceneModePicker=D,this._projectionPicker=M,this._baseLayerPicker=O,this._navigationHelpButton=L,this._animation=_,this._timeline=b,this._fullscreenButton=v,this._vrButton=F,this._geocoder=S,this._eventHelper=x,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=u(T)||u(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new _e,this._trackedEntityChanged=new _e,Te.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),x.add(p.dataSourceAdded,Ni.prototype._onDataSourceAdded,this),x.add(p.dataSourceRemoved,Ni.prototype._onDataSourceRemoved,this),x.add(h.postUpdate,Ni.prototype.resize,this),x.add(h.postRender,Ni.prototype._postRender,this);let G=p.length;for(let W=0;W<G;W++)this._dataSourceAdded(p,p.get(W));this._dataSourceAdded(void 0,A.defaultDataSource),x.add(p.dataSourceAdded,Ni.prototype._dataSourceAdded,this),x.add(p.dataSourceRemoved,Ni.prototype._dataSourceRemoved,this);function U(W){let J=Hxe(i,W);u(J)?q.getValueOrUndefined(J.position,i.clock.currentTime)?i.trackedEntity=J:i.zoomTo(J):u(i.trackedEntity)&&(i.trackedEntity=void 0)}function Y(W){i.selectedEntity=Hxe(i,W)}d.screenSpaceEventHandler.setInputAction(Y,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(U,Cn.LEFT_DOUBLE_CLICK)}Object.defineProperties(Ni.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,lG(this);let t=this.scene,n=t.mode;!u(e)||!u(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(N.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=u(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;u(e)?u(t)&&t.animateAppear():u(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,jxe(this._timeline,this.clock,e))}}});Ni.prototype.extend=function(e,t){e(this,t)};Ni.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=u(this._animation),o=u(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(u(a)&&(a.style.maxHeight=`${s}px`),u(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}u(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,l,f=0,d=0,p=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;l=this._animation.container,n>900?(f=169,g<=900&&(l.style.width="169px",l.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(l.style.width="136px",l.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(l.style.width="106px",l.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,A=c.container,x=A.style;p=A.clientHeight+3,x.left=`${f}px`;let C=0;u(g)&&(C+=g.container.clientWidth),u(h)&&(C+=h.container.clientWidth),x.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Ni.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ni.prototype.render=function(){this._cesiumWidget.render()};Ni.prototype.isDestroyed=function(){return!1};Ni.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),u(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),u(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),u(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),u(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),u(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),u(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),u(this._timeline)&&(this._timeline.removeEventListener("settime",Wxe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),u(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),u(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),u(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),u(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ni.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ni.prototype._onEntityCollectionChanged,this)};Ni.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ni.prototype._onEntityCollectionChanged,this),u(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),u(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ni.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(u(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,y0)===ut.DONE&&i.update(t,y0)}let r,o=!1,s=this.selectedEntity,a=u(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,y0)!==ut.FAILED?r=y0.center:u(s.position)&&(r=s.position.getValue(t,r)),o=u(r));let c=u(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;u(c)&&(c.position=m.clone(r,c.position),c.showSelection=a&&o,c.update());let l=u(this._infoBox)?this._infoBox.viewModel:void 0;u(l)&&(l.showInfo=a,l.enableCamera=o,l.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(l.titleText=y(s.name,s.id),l.description=q.getValueOrDefault(s.description,t,"")):(l.titleText="",l.description=""))};Ni.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}};Ni.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;u(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ni.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ni.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ni.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ni.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&jxe(this.timeline,this.clock,e)};Ni.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ni.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ni.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Ni.prototype.zoomTo=function(e,t){return qxe(this,e,{offset:t},!1)};Ni.prototype.flyTo=function(e,t){return qxe(this,e,t,!0)};function qxe(e,t,n,i){lG(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Gs){let s;u(o.imageryProvider)?s=o.imageryProvider._readyPromise.then(()=>o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return lC(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof va||o instanceof KS||o instanceof $S){e._zoomTarget=o;return}if(o.isLoading&&u(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=y(o.values,o),u(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function iv(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function lG(e){let t=e._zoomPromise;u(t)&&(iv(e),e._completeZoom(!1))}Ni.prototype._postRender=function(){nxt(this),ixt(this)};function nxt(e){let t=e._zoomTarget;if(!u(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,r=y(e._zoomOptions,{}),o;if(t instanceof va||t instanceof $S)return t._readyPromise.then(function(){let l=t.boundingSphere;u(r.offset)||(r.offset=new Cu(0,-.5,l.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(l,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),iv(e)}).catch(()=>{lG(e)});if(t instanceof KS)return t._readyPromise.then(function(){let l=t.boundingSphere;u(r.offset)||(r.offset=new Cu(0,-.5,l.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(l,o):(i.viewBoundingSphere(l,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),iv(e)});if(t instanceof he){o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),iv(e);return}let s=t,a=[];for(let l=0,f=s.length;l<f;l++){let d=e._dataSourceDisplay.getBoundingSphere(s[l],!1,y0);if(d===ut.PENDING)return;d!==ut.FAILED&&a.push(ae.clone(y0))}if(a.length===0){lG(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(iv(e),i.flyToBoundingSphere(c,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(c,r.offset),i.lookAtTransform(N.IDENTITY),iv(e),e._completeZoom(!0))}function ixt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!u(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,y0);if(o===ut.PENDING)return;let s=r.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==ut.FAILED?y0:void 0;e._entityView=new LB(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var nJ=Ni;function rxt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new k2(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var iJ=rxt;function oxt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new G2(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var rJ=oxt;function sxt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),r=new _e,o=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){Yxe(s,l),s=f,oJ(s,l)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?oJ(s,l):Yxe(s,l),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function l(f){qC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],A=new FileReader;A.onload=axt(e,h,c,a),A.onerror=cxt(e,h),A.readAsText(h)}}oJ(s,l),e.destroy=vL(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=l}function qC(e){e.stopPropagation(),e.preventDefault()}function Yxe(e,t){let n=e;u(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",qC,!1),n.removeEventListener("dragover",qC,!1),n.removeEventListener("dragexit",qC,!1))}function oJ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",qC,!1),e.addEventListener("dragover",qC,!1),e.addEventListener("dragexit",qC,!1)}function axt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=qR.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=jB.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=oL.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=JB.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}u(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function cxt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var sJ=sxt;function lxt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new i3({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var aJ=lxt;function Xxe(e){let t=e.split(` + `}var Lxt=[{text:"Highlight",value:_l.HIGHLIGHT},{text:"Replace",value:_l.REPLACE},{text:"Mix",value:_l.MIX}],lCe=new z(1,1,0,.4),Nxt=new z,sG=new z;function ma(e,t){let n=this,i=e.canvas;this._eventHandler=new Ru(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new H_({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,be.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=be.observable({}),this.properties=[],be.defineProperty(this,"properties",function(){let k=[],Y=n._properties();for(let j in Y)Y.hasOwnProperty(j)&&k.push(j);return k});let r=be.observable();be.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=be.observable();be.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=_l.HIGHLIGHT;let s=be.observable(),a=be.observable();be.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(Y){let j=e.pick(Y.endPosition);if(j instanceof ws?(n.feature=j,n.tile=j.content.tile):l(j)&&l(j.content)?(n.feature=void 0,n.tile=j.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(j)&&l(j.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(Y.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=j.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=be.observable();be.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=be.observable();be.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=be.observable();be.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=be.observable();be.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=be.observable();be.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=be.observable();be.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,be.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=be.observable();be.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=be.observable();be.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=be.observable();be.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=be.observable();be.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let A=be.observable();be.defineProperty(this,"maximumScreenSpaceError",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,be.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){T(Math.pow(k,6))}});let S=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=4;let v=Oxt(this),I=be.observable();be.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(v,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let O=be.observable();be.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=be.observable();be.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let L=be.observable();be.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let N=be.observable();be.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=be.observable();be.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let E=be.observable();be.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=be.observable();be.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=be.observable();be.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(k){P(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=be.observable();be.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=be.observable();be.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=be.observable();be.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=be.observable();be.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=be.observable();be.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||uCe(this,!0)}Object.defineProperties(ma.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return Lxt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e._readyPromise.then(function(o){t.isDestroyed()||t._properties(o.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let o=0;o<i;++o){let s=n[o];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=WB(e,!1),this._pickStatisticsText=WB(e,!0),this._resourceCacheStatisticsText=fCe(),uCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,Nxt):z.WHITE:t.color=sG,this._scene.requestRender()),l(e)&&(z.clone(e.color,sG),e.color=lCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!iJ(t.content)&&(t.color=sG,this._scene.requestRender()),l(e)&&!iJ(e.content)&&(z.clone(e.color,sG),e.color=lCe,this._scene.requestRender()),this._tile=e}}});function iJ(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!iJ(t[i]))return!1;return!0}return!1}ma.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ma.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ma.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ma.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ma.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ma.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ma.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ma.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ma.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ma.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ma.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new J_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ma.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ma.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=WB(e,!1),this._pickStatisticsText=WB(e,!0),this._resourceCacheStatisticsText=fCe())};ma.prototype.isDestroyed=function(){return!1};ma.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};ma.getStatistics=WB;var jB=ma;function aG(e,t){e=Pn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new jB(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ma.createSection,c=Ma.createCheckbox,u=Ma.createRangeInput,f=Ma.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),A=document.createElement("div");A.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),A.appendChild(T),A.appendChild(S),d.appendChild(A),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(N),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(E),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(w);let P=document.createElement("div");b.appendChild(P),P.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),P.appendChild(M);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(B);let V=f("Compile (Ctrl+Enter)","compileStyle");P.appendChild(V);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),P.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let Y=document.createElement("div");Y.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(Y),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),be.applyBindings(r,n)}Object.defineProperties(aG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aG.prototype.isDestroyed=function(){return!1};aG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var qB=aG;function Fxt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function rJ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var Bxt=new vn,kxt=new m;function YB(e,t){let n=this,i=e.canvas,r=new Ru(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",be.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=be.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=be.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=be.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new H_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=be.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new lB({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=be.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=be.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=be.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=be.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let u=n.depthFrustum+1;return n.depthFrustum=rJ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let u=n.depthFrustum-1;return n.depthFrustum=rJ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=be.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new SB({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=be.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=be.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=be.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=be.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,Bxt),g=o.pick(p,n._scene,kxt);if(l(g)){let h=d.cartesianToCartographic(g),x=o._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let C=x[b];if(l(C))for(let A=0;!f&&A<C.length;++A){let T=C[A];ce.contains(T.rectangle,h)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=be.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(YB.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});YB.prototype._update=function(){this.frustums&&(this.frustumStatisticText=Fxt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=rJ(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};YB.prototype.isDestroyed=function(){return!1};YB.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var XB=YB;function cG(e,t){e=Pn(e);let n=document.createElement("div"),i=new XB(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Ma.createSection,c=Ma.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let A=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",A.appendChild(T);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",I.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let L=document.createElement("div");O.appendChild(L);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(M),L.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",L.appendChild(B);let V=document.createElement("table"),U=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(N);let Y=document.createElement("td");Y.appendChild(_);let j=document.createElement("td");j.appendChild(E),U.appendChild(k),U.appendChild(Y),U.appendChild(j);let J=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let K=document.createElement("td");K.appendChild(P),G.appendChild(J),G.appendChild(W),G.appendChild(K),V.appendChild(U),V.appendChild(G),L.appendChild(V),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),be.applyBindings(i,this._element)}Object.defineProperties(cG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cG.prototype.isDestroyed=function(){return!1};cG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var KB=cG;function lG(e,t){l(t)||(t=document.body),t=Pn(t);let n=this,i=be.observable(_o.fullscreen),r=be.observable(_o.enabled),o=t.ownerDocument;this.isFullscreen=void 0,be.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,be.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&_o.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){_o.fullscreen?_o.exitFullscreen():_o.requestFullscreen(n._fullscreenElement)},be.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Pn(e),o.body),this._callback=function(){i(_o.fullscreen)},o.addEventListener(_o.changeEventName,this._callback)}Object.defineProperties(lG.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});lG.prototype.isDestroyed=function(){return!1};lG.prototype.destroy=function(){document.removeEventListener(_o.changeEventName,this._callback),ue(this)};var JB=lG;var Uxt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",Vxt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function uG(e,t){e=Pn(e);let n=new JB(t,e);n._exitFullScreenPath=Vxt,n._enterFullScreenPath=Uxt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),be.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(uG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uG.prototype.isDestroyed=function(){return!1};uG.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var ZB=uG;var dCe=1e3;function $f(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new sN,new xN({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=hCe,this._handleArrowUp=mCe;let t=this;this._suggestionsVisible=be.pureComputed(function(){let r=be.getObservable(t,"_suggestions")().length>0,o=be.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=En(function(i){if(i=y(i,Jy.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)qxt(t);else return Wxt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?mCe(t):o?hCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;gCe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,$f.flyToDestination),this._focusTextbox=!1,be.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=be.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){$f._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,be.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,be.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,be.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties($f.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});$f.prototype.destroy=function(){this._suggestionSubscription.dispose()};function mCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],$f._adjustSuggestionsScroll(e,n)}function hCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],$f._adjustSuggestionsScroll(e,i)}function zxt(e,t){let n=l(t)?t.availability:void 0;return l(n)?v_(t,[e]).then(function(i){return e=i[0],e.height+=dCe,e}):(e.height+=dCe,Promise.resolve(e))}function Hxt(e,t){let n=e._scene,r=n.mapProjection.ellipsoid,o=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ce.center(t):c=LC(t,n):t=r.cartesianToCartographic(t),l(c)||(c=zxt(t,s)),c.then(function(u){a=r.cartographicToCartesian(u)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function Gxt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function Wxt(e,t,n){let i=e._searchText;if(_Ce(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await Gxt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,sJ(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=pCe(e,rS.getCreditsFromResult(s[0]));l(a)||oJ(e,t[r].credit);return}e._searchText=`${i} (not found)`}function oJ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function pCe(e,t){return l(t)&&t.forEach(n=>oJ(e,n)),t}function sJ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function jxt(e,t){let n=Pn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function qxt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function _Ce(e){return/^\s*$/.test(e)}function gCe(e){be.getObservable(e,"_suggestions").removeAll()}async function Yxt(e){if(!e.autoComplete)return;let t=e._searchText;if(gCe(e),sJ(e),!_Ce(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Jy.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=rS.getCreditsFromResult(o);r=r&&!l(s),pCe(e,s)}),r&&oJ(e,n.credit)}if(e._suggestions.length>=5)return}}$f.flyToDestination=Hxt;$f._updateSearchSuggestions=Yxt;$f._adjustSuggestionsScroll=jxt;$f.prototype.isDestroyed=function(){return!1};$f.prototype.destroy=function(){return sJ(this),ue(this)};var $B=$f;var Xxt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",Kxt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function fG(e){let t=Pn(e.container),n=new $B(e);n._startSearchPath=Xxt,n._stopSearchPath=Kxt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),be.applyBindings(n,i),be.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Wt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(fG.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});fG.prototype.isDestroyed=function(){return!1};fG.prototype.destroy=function(){let e=this._container;return Wt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),be.cleanNode(this._form),be.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var QB=fG;function yCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",be.track(this,["tooltip"])}Object.defineProperties(yCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var e3=yCe;function dG(e,t,n){e=Pn(e);let i=new e3(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),be.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(dG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dG.prototype.isDestroyed=function(){return!1};dG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var t3=dG;var Jxt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",Zxt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function aJ(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",be.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,be.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?Zxt:Jxt}}),be.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}aJ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(aJ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var n3=aJ;function mG(e){e=Pn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let s=new n3;be.applyBindings(s,t),this._container=e,this._element=t,this._frame=o,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;o.addEventListener("load",function(){let c=o.contentDocument,u=c.createElement("link");u.href=tn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=da(s,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let b=x["background-color"],C=z.fromCssColorString(b);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;o.style.height=`${h}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties(mG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});mG.prototype.isDestroyed=function(){return!1};mG.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var i3=mG;function xCe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",be.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(xCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var r3=xCe;function hG(e){let t=Pn(e.container),n=new r3,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=tn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=tn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),be.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(hG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hG.prototype.isDestroyed=function(){return!1};hG.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var o3=hG;function cJ(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,be.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=dB.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(cJ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});cJ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var s3=cJ;function pG(e){let t=Pn(e.container),n=new s3(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),be.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(pG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pG.prototype.isDestroyed=function(){return!1};pG.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var a3=pG;function _G(e){this._scene=e,this._orthographic=e.camera.frustum instanceof nn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,be.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;be.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Do,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===ne.SCENE2D||t._scene.camera.frustum instanceof nn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(_G.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});_G.prototype.isDestroyed=function(){return!1};_G.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var c3=_G;var $xt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Qxt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function gG(e,t){e=Pn(e);let n=new c3(t);n._perspectivePath=$xt,n._orthographicPath=Qxt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),be.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(gG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gG.prototype.isDestroyed=function(){return!1};gG.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var l3=gG;function yG(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Do,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",be.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,be.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===ne.SCENE2D?n.tooltip2D:r===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(yG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});yG.prototype.isDestroyed=function(){return!1};yG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var u3=yG;var ebt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",tbt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",nbt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function xG(e,t,n){e=Pn(e);let i=new u3(t,n);i._globePath=ebt,i._flatMapPath=tbt,i._columbusViewPath=nbt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),be.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(xG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});xG.prototype.isDestroyed=function(){return!1};xG.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var f3=xG;var ibt=new H,bG="-1000px";function d3(e,t,n){this._scene=e,this._screenPositionX=bG,this._screenPositionY=bG,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,be.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,be.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),be.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return Qi.wgs84ToWindowCoordinates(e,i,r)}}d3.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,ibt);if(!l(e))this._screenPositionX=bG,this._screenPositionY=bG;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};d3.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Fo.EXPONENTIAL_OUT})};d3.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Fo.EXPONENTIAL_OUT})};Object.defineProperties(d3.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var m3=d3;function CG(e,t){e=Pn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new m3(t,this._element,this._container);this._viewModel=c,be.applyBindings(this._viewModel,this._element)}Object.defineProperties(CG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});CG.prototype.isDestroyed=function(){return!1};CG.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),ue(this)};var h3=CG;function XC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}XC.prototype.getHeight=function(){return this._height};XC.prototype.getBase=function(){return this._base};XC.prototype.getStartTime=function(){return this._start};XC.prototype.getStopTime=function(){return this._stop};XC.prototype.setRange=function(e,t){this._start=e,this._stop=t};XC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=ee.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var p3=XC;function bCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}bCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,r)&&ee.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,o)&&ee.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var _3=bCe;var lJ=1e12,Qf={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},il={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},x0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],rbt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function rl(e,t){e=Pn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Qf.none,this._touchMode=il.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=obt(this),this._onMouseUp=sbt(this),this._onMouseMove=abt(this),this._onMouseWheel=cbt(this),this._onTouchStart=lbt(this),this._onTouchMove=fbt(this),this._onTouchEnd=ubt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}rl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};rl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};rl.prototype.isDestroyed=function(){return!1};rl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};rl.prototype.addHighlightRange=function(e,t,n){let i=new p3(e,t,n);return this._highlightRanges.push(i),this.resize(),i};rl.prototype.addTrack=function(e,t,n,i){let r=new _3(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};rl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==No.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=ee.secondsDifference(r,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=r,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};rl.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function uJ(e){return e<10?`0${e.toString()}`:e.toString()}rl.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${rbt[t.month-1]} ${t.day} ${t.year} ${uJ(t.hour)}:${uJ(t.minute)}:${uJ(t.second)}${i}`};rl.prototype.smallestTicInPixels=7;rl.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),x,b=ee.toGregorianDate(g);d>31536e4?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?x=ee.fromDate(new Date(Date.UTC(b.year,0))):x=ee.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(x,h,new ee)),A=C+d;this._epochJulian=x;function T(k){return Math.floor(C/k)*k}function S(k,Y){return Math.ceil(k/Y+.5)*Y}function v(k){return(k-C)/d}function I(k,Y){return k-Y*Math.round(k/Y)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let L={startTime:C,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(L)});let N=0,_=0,E=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let P=-1,M=-1,B=x0.length,V;for(V=0;V<B;++V){let k=x0[V];if(++P,N=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=P)}if(P>0){for(;P>0;)if(--P,Math.abs(I(N,x0[P]))<1e-5){x0[P]>=f&&(_=x0[P]);break}if(M>=0)for(;M<P;){if(Math.abs(I(_,x0[M]))<1e-5&&x0[M]>=f){E=x0[M];break}++M}}f=R,f>u&&E<1e-5&&Math.abs(f-N)>u&&(E=f,f<=N+u&&(_=0));let U=-999999,G;if(p*(E/this._timeBarSecondsSpan)>=3)for(r=T(E);r<=A;r=S(r,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=A;r=S(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,A+=N,r=T(N);let k=ee.computeTaiMinusUtc(x);for(;r<=A;){let Y=ee.addSeconds(g,r-C,new ee);if(N>2.1){let K=ee.computeTaiMinusUtc(Y);Math.abs(K-k)>.1&&(r+=K-k,Y=ee.addSeconds(g,r-C,new ee))}let j=Math.round(p*v(r)),J=this.makeLabel(Y);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=O);let W=j-(G/2-1);W>U?(U=W+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${j.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${j.toString()}px;"></span>`,r=S(r,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),L.y=0,this._trackList.forEach(function(k){k.render(o._context,L),L.y+=k.height})};rl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};rl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function obt(e){return function(t){e._mouseMode!==Qf.touchOnly&&(t.button===0?(e._mouseMode=Qf.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Qf.zoom:e._mouseMode=Qf.slide)),t.preventDefault()}}function sbt(e){return function(t){e._mouseMode=Qf.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function abt(e){return function(t){let n;if(e._mouseMode===Qf.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Qf.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Qf.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function cbt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;lJ=Math.max(Math.min(Math.abs(n),lJ),1),n/=lJ,e.zoomFrom(Math.pow(1.05,-n))}}function lbt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Qf.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=il.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=il.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=il.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=il.ignore}}function ubt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===il.singleTap?(e._touchMode=il.scrub,e._onTouchMove(t)):e._touchMode===il.scrub&&e._onTouchMove(t),e._mouseMode=Qf.touchOnly,n!==1?e._touchMode=n>0?il.ignore:il.none:e._touchMode===il.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function fbt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===il.singleTap&&(e._touchMode=il.slideZoom),e._mouseMode=Qf.touchOnly,e._touchMode===il.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===il.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-o,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=o,e._touchState.spanX=s))}}rl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var g3=rl;var TCe=Ki(CCe(),1);function dbt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ACe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function mbt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ACe(),e._locked=!1),e._noSleep.disable(),_o.exitFullscreen(),n(!1)):(_o.fullscreen||_o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=dbt("landscape")),t.useWebVR=!0,n(!0)))}function TG(e,t){let n=this,i=be.observable(_o.enabled),r=be.observable(!1);this.isVRMode=void 0,be.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,be.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&_o.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=be.observable(!1);this._isOrthographic=void 0,be.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Do,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof nn)}),this._locked=!1,this._noSleep=new TCe.default,this._command=En(function(){mbt(n,e,r,o)},be.getObservable(this,"isVREnabled")),this._vrElement=y(Pn(t),document.body),this._callback=function(){!_o.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(ACe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(_o.changeEventName,this._callback)}Object.defineProperties(TG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});TG.prototype.isDestroyed=function(){return!1};TG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(_o.changeEventName,this._callback),ue(this)};var x3=TG;var hbt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",pbt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function AG(e,t,n){e=Pn(e);let i=new x3(t,n);i._exitVRPath=pbt,i._enterVRPath=hbt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),be.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(AG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});AG.prototype.isDestroyed=function(){return!1};AG.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var b3=AG;var b0=new ae;function vCe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function _bt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function gbt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function ECe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof Kr)return i;if(n instanceof ws)return new Kr({name:gbt(n),description:_bt(n),feature:n})}if(l(e.scene.globe))return bbt(e,t.position)}var ybt=new ee;function wCe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let r=i.startTime,o=i.stopTime;ee.equals(r,o)&&(o=ee.addSeconds(r,D.EPSILON2,ybt)),e.updateFromClock(),e.zoomTo(r,o)}}}var xbt=new m;function bbt(e,t){let n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(r))return;let o=new Kr({id:"Loading...",description:"Loading feature information..."});return r.then(function(s){if(e.selectedEntity!==o)return;if(!l(s)||s.length===0){e.selectedEntity=SCe();return}let a=s[0],c=new Kr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,xbt);c.position=new Dc(u)}e.selectedEntity=c},function(){e.selectedEntity===o&&(e.selectedEntity=SCe())}),o}function SCe(){return new Kr({id:"None",description:"No features found."})}function Cbt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Fi(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new qd,u=new MB(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new k2(o,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new WM,g=!0);let h=d.scene,x=new DL({scene:h,dataSourceCollection:p}),b=new Do;b.add(c.onTick,Fi.prototype._onTick,this),b.add(h.morphStart,Fi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(j),C=new h3(j,h)}let A;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",r.appendChild(j),A=new i3(j);let J=A.viewModel;b.add(J.cameraClicked,Fi.prototype._onInfoBoxCameraClicked,this),b.add(J.closeClicked,Fi.prototype._onInfoBoxClockClicked,this)}let T=document.createElement("div");T.className="cesium-viewer-toolbar",r.appendChild(T);let S;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",T.appendChild(j);let J;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(J=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new QB({container:j,geocoderServices:J,scene:h}),b.add(S.viewModel.search.beforeExecute,Fi.prototype._clearObjects,this)}let v;(!l(t.homeButton)||t.homeButton!==!1)&&(v=new t3(T,h),l(S)&&b.add(v.viewModel.command.afterExecute,function(){let j=S.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),b.add(v.viewModel.command.beforeExecute,Fi.prototype._clearTrackedObject,this));let I;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new f3(T,h));let O;t.projectionPicker&&(O=new l3(T,h));let R,L;if(n){let j=y(t.imageryProviderViewModels,BB()),J=y(t.terrainProviderViewModels,kB());R=new FB(T,{globe:h.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:J,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),L=T.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&(Q("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(R.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(R.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let N;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let J=window.localStorage.getItem("cesium-hasSeenNavHelp");l(J)&&J?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}N=new o3({container:T,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,j)})}let _;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",r.appendChild(j),_=new zB(j,new HB(u))}let E;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",r.appendChild(j),E=new g3(j,c),E.addEventListener("settime",vCe,!1),E.zoomTo(c.startTime,c.stopTime)}let w,P,M;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",r.appendChild(M),w=new ZB(M,t.fullscreenElement),P=da(w.viewModel,"isFullscreenEnabled",function(j){M.style.display=j?"block":"none",l(E)&&(E.container.style.right=`${M.clientWidth}px`,E.resize())}));let B,V,U;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",r.appendChild(j),B=new b3(j,h,t.fullScreenElement),V=da(B.viewModel,"isVREnabled",function(J){j.style.display=J?"block":"none",l(w)&&(j.style.right=`${M.clientWidth}px`),l(E)&&(E.container.style.right=`${j.clientWidth}px`,E.resize())}),U=da(B.viewModel,"isVRMode",function(J){Cbt(i,J)})}this._baseLayerPickerDropDown=L,this._fullscreenSubscription=P,this._vrSubscription=V,this._vrModeSubscription=U,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=A,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=T,this._homeButton=v,this._sceneModePicker=I,this._projectionPicker=O,this._baseLayerPicker=R,this._navigationHelpButton=N,this._animation=_,this._timeline=E,this._fullscreenButton=w,this._vrButton=B,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(A)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new _e,this._trackedEntityChanged=new _e,be.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),b.add(p.dataSourceAdded,Fi.prototype._onDataSourceAdded,this),b.add(p.dataSourceRemoved,Fi.prototype._onDataSourceRemoved,this),b.add(h.postUpdate,Fi.prototype.resize,this),b.add(h.postRender,Fi.prototype._postRender,this);let G=p.length;for(let j=0;j<G;j++)this._dataSourceAdded(p,p.get(j));this._dataSourceAdded(void 0,x.defaultDataSource),b.add(p.dataSourceAdded,Fi.prototype._dataSourceAdded,this),b.add(p.dataSourceRemoved,Fi.prototype._dataSourceRemoved,this);function k(j){let J=ECe(i,j);l(J)?q.getValueOrUndefined(J.position,i.clock.currentTime)?i.trackedEntity=J:i.zoomTo(J):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function Y(j){i.selectedEntity=ECe(i,j)}d.screenSpaceEventHandler.setInputAction(Y,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(k,Cn.LEFT_DOUBLE_CLICK)}Object.defineProperties(Fi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,EG(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,wCe(this._timeline,this.clock,e))}}});Fi.prototype.extend=function(e,t){e(this,t)};Fi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,x=c.container,b=x.style;p=x.clientHeight+3,b.left=`${f}px`;let C=0;l(g)&&(C+=g.container.clientWidth),l(h)&&(C+=h.container.clientWidth),b.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Fi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Fi.prototype.render=function(){this._cesiumWidget.render()};Fi.prototype.isDestroyed=function(){return!1};Fi.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",vCe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Fi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Fi.prototype._onEntityCollectionChanged,this)};Fi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Fi.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Fi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,b0)===ut.DONE&&i.update(t,b0)}let r,o=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,b0)!==ut.FAILED?r=b0.center:l(s.position)&&(r=s.position.getValue(t,r)),o=l(r));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=m.clone(r,c.position),c.showSelection=a&&o,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=o,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=q.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Fi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}};Fi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Fi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Fi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Fi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Fi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&wCe(this.timeline,this.clock,e)};Fi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Fi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Fi.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Fi.prototype.zoomTo=function(e,t){return ICe(this,e,{offset:t},!1)};Fi.prototype.flyTo=function(e,t){return ICe(this,e,t,!0)};function ICe(e,t,n,i){EG(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Hs){let s;if(l(o.imageryProvider)){let a=Promise.resolve();l(o.imageryProvider._readyPromise)?a=o.imageryProvider._readyPromise:l(o.imageryProvider.readyPromise)&&(a=o.imageryProvider.readyPromise),s=a.then(()=>o.getImageryRectangle())}else s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})});s.then(function(a){return LC(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Ns||o instanceof nv||o instanceof sv){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=y(o.values,o),l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function lv(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function EG(e){let t=e._zoomPromise;l(t)&&(lv(e),e._completeZoom(!1))}Fi.prototype._postRender=function(){Tbt(this),Abt(this)};function Tbt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,r=y(e._zoomOptions,{}),o;if(t instanceof Ns||t instanceof sv)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new xu(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),lv(e)}).catch(()=>{EG(e)});if(t instanceof nv)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new xu(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),lv(e)});if(t instanceof me){o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),lv(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,b0);if(d===ut.PENDING)return;d!==ut.FAILED&&a.push(ae.clone(b0))}if(a.length===0){EG(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(lv(e),i.flyToBoundingSphere(c,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(c,r.offset),i.lookAtTransform(F.IDENTITY),lv(e),e._completeZoom(!0))}function Abt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,b0);if(o===ut.PENDING)return;let s=r.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==ut.FAILED?b0:void 0;e._entityView=new OL(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var dJ=Fi;function Ebt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new qB(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var mJ=Ebt;function Sbt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new KB(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var hJ=Sbt;function vbt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),r=new _e,o=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Pn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){PCe(s,u),s=f,pJ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?pJ(s,u):PCe(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){KC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],x=new FileReader;x.onload=wbt(e,h,c,a),x.onerror=Ibt(e,h),x.readAsText(h)}}pJ(s,u),e.destroy=EN(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function KC(e){e.stopPropagation(),e.preventDefault()}function PCe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",KC,!1),n.removeEventListener("dragover",KC,!1),n.removeEventListener("dragexit",KC,!1))}function pJ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",KC,!1),e.addEventListener("dragover",KC,!1),e.addEventListener("dragexit",KC,!1)}function wbt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=GM.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=GL.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=nN.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=YL.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function Ibt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var _J=vbt;function Pbt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new a3({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var gJ=Pbt;function DCe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function ed(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),u(c)&&t._getPrimitiveFunctions.push(c);let l=Te.observable();return Te.defineProperty(t,o,{get:function(){return l()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),l(f),u(a)&&u(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,l}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Xxe(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===qi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===qi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===qi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.translationX=N.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.translationY=N.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.translationZ=N.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.scaleX=N.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.scaleY=N.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)},getPrimitiveFunction:function(){t.scaleZ=N.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Wh(t)}})}var uxt=new m,fxt=new m,dxt=new Ha,mxt=new Q;function Wh(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,uxt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,fxt),i=dxt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=Q.fromHeadingPitchRoll(i,mxt),o=Q.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ed.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(u(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),u(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Xxe(i),u(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Wh(t)})}}}});ed.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ed.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ed.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ed.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ed.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ed.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ed.prototype.compileShader=function(){u(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new kC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ed.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,l;if(t.shiftKey)for(l=0;l<c;++l)a[l][0]===" "&&(a[l][1]===" "?(a[l]=a[l].substr(2),o-=2):(a[l]=a[l].substr(1),o-=1));else for(l=0;l<c;++l)a[l]=` ${a[l]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};var p3=ed;function uG(e,t){e=In(e);let n=document.createElement("div"),i=new p3(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let s=Ba.createSection,a=Ba.createCheckbox,c=Ba.createRangeInput,l=Ba.createButton,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Bounds","boundsVisible","toggleBounds"),g=s(o,"Clipping","clippingVisible","toggleClipping"),h=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let A=10,x=10,C=P.PI;d.appendChild(c("Translation X","translationX",-A,+A)),d.appendChild(c("Translation Y","translationY",-A,+A)),d.appendChild(c("Translation Z","translationZ",-A,+A)),d.appendChild(c("Scale X","scaleX",0,+x)),d.appendChild(c("Scale Y","scaleY",0,+x)),d.appendChild(c("Scale Z","scaleZ",0,+x)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let T=qi.getMinBounds(qi.BOX),E=qi.getMaxBounds(qi.BOX),S=m.fromElements(qi.getMinBounds(qi.ELLIPSOID).x,qi.getMinBounds(qi.ELLIPSOID).y,-re.WGS84.maximumRadius,new m),w=m.fromElements(qi.getMaxBounds(qi.ELLIPSOID).x,qi.getMaxBounds(qi.ELLIPSOID).y,1e7,new m),D=qi.getMinBounds(qi.CYLINDER),M=qi.getMaxBounds(qi.CYLINDER);rv("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",T,E,"shapeIsBox",p),rv("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,w,"shapeIsEllipsoid",p),rv("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,M,"shapeIsCylinder",p),rv("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",T,E,"shapeIsBox",g),rv("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,w,"shapeIsEllipsoid",g),rv("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,M,"shapeIsCylinder",g);let O=document.createElement("div");h.appendChild(O);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),O.className="cesium-cesiumInspector-styleEditor",O.appendChild(B);let L=l("Compile (Ctrl+Enter)","compileShader");O.appendChild(L);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),O.appendChild(_),Te.applyBindings(i,n)}Object.defineProperties(uG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uG.prototype.isDestroyed=function(){return!1};uG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function rv(e,t,n,i,r,o,s,a,c,l,f,d,p,g,h,A){let x=Ba.createRangeInput,C=p,T=g,E=A.appendChild(document.createElement("div"));E.setAttribute("data-bind",`if: ${h}`),E.appendChild(x(e,s,C.x,T.x)),E.appendChild(x(t,a,C.x,T.x)),E.appendChild(x(n,c,C.y,T.y)),E.appendChild(x(i,l,C.y,T.y)),E.appendChild(x(r,f,C.z,T.z)),E.appendChild(x(o,d,C.z,T.z))}var _3=uG;function hxt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new _3(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var cJ=hxt;globalThis.CESIUM_VERSION="1.105";var pxt="1.105";0&&(module.exports={AlphaMode,AlphaPipelineStage,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SDataProvider,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3dmLoader,I3dmParser,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Mars3DEx,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelFeature,ModelFeatureTable,ModelGraphics,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OctahedralProjectedCubeMap,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainExaggeration,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersContrastBias,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctahedralProjectionAtlasFS,_shadersOctahedralProjectionFS,_shadersOctahedralProjectionVS,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelVS,_shadersWater,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapproximateSphericalCoordinates,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputePosition,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdefaultPbrMaterial,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidWgs84TextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersfromCartesian,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetFloodRect,_shadersgetIndexMat,_shadersgetLambertDiffuse,_shadersgetMaxIndex,_shadersgetMaxIndexVal,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shadersisInEllipsoid,_shadersisInObliq,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmagnitude,_shadersmagnitudeSquared,_shadersmaterial,_shadersmaterialInput,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyComponents,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrMetallicRoughnessMaterial,_shaderspbrParameters,_shaderspbrSpecularGlossinessMaterial,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssampleOctahedralProjection,_shaderssaturation,_shadersscaleToGeodeticSurface,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildDrawCommand,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGuid,createMaterialPropertyDescriptor,createOsmBuildings,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldImagery,createWorldImageryAsync,createWorldTerrain,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseBoundingVolumeSemantics,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); +`}return i}function ed(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=be.observable();return be.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=DCe(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Yi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Yi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Yi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&jh(t)}})}var Dbt=new m,Rbt=new m,Obt=new za,Mbt=new $;function jh(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,Dbt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,Rbt),i=Obt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,Mbt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ed.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=DCe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,jh(t)})}}}});ed.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ed.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ed.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ed.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ed.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ed.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ed.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new WC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ed.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};var C3=ed;function SG(e,t){e=Pn(e);let n=document.createElement("div"),i=new C3(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let s=Ma.createSection,a=Ma.createCheckbox,c=Ma.createRangeInput,u=Ma.createButton,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Bounds","boundsVisible","toggleBounds"),g=s(o,"Clipping","clippingVisible","toggleClipping"),h=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,C=D.PI;d.appendChild(c("Translation X","translationX",-x,+x)),d.appendChild(c("Translation Y","translationY",-x,+x)),d.appendChild(c("Translation Z","translationZ",-x,+x)),d.appendChild(c("Scale X","scaleX",0,+b)),d.appendChild(c("Scale Y","scaleY",0,+b)),d.appendChild(c("Scale Z","scaleZ",0,+b)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let A=Yi.getMinBounds(Yi.BOX),T=Yi.getMaxBounds(Yi.BOX),S=m.fromElements(Yi.getMinBounds(Yi.ELLIPSOID).x,Yi.getMinBounds(Yi.ELLIPSOID).y,-re.WGS84.maximumRadius,new m),v=m.fromElements(Yi.getMaxBounds(Yi.ELLIPSOID).x,Yi.getMaxBounds(Yi.ELLIPSOID).y,1e7,new m),I=Yi.getMinBounds(Yi.CYLINDER),O=Yi.getMaxBounds(Yi.CYLINDER);uv("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",A,T,"shapeIsBox",p),uv("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,v,"shapeIsEllipsoid",p),uv("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,O,"shapeIsCylinder",p),uv("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",A,T,"shapeIsBox",g),uv("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,v,"shapeIsEllipsoid",g),uv("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,O,"shapeIsCylinder",g);let R=document.createElement("div");h.appendChild(R);let L=document.createElement("textarea");L.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(L);let N=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(N);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(_),be.applyBindings(i,n)}Object.defineProperties(SG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SG.prototype.isDestroyed=function(){return!1};SG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function uv(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,x){let b=Ma.createRangeInput,C=p,A=g,T=x.appendChild(document.createElement("div"));T.setAttribute("data-bind",`if: ${h}`),T.appendChild(b(e,s,C.x,A.x)),T.appendChild(b(t,a,C.x,A.x)),T.appendChild(b(n,c,C.y,A.y)),T.appendChild(b(i,u,C.y,A.y)),T.appendChild(b(r,f,C.z,A.z)),T.appendChild(b(o,d,C.z,A.z))}var T3=SG;function Lbt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new T3(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var yJ=Lbt;globalThis.CESIUM_VERSION="1.106.1";var Nbt="1.106.1";0&&(module.exports={AlphaMode,AlphaPipelineStage,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SDataProvider,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3dmLoader,I3dmParser,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Mars3DEx,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelFeature,ModelFeatureTable,ModelGraphics,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OctahedralProjectedCubeMap,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainExaggeration,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersContrastBias,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctahedralProjectionAtlasFS,_shadersOctahedralProjectionFS,_shadersOctahedralProjectionVS,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelVS,_shadersWater,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapproximateSphericalCoordinates,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputePosition,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdefaultPbrMaterial,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidWgs84TextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersfromCartesian,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetFloodRect,_shadersgetIndexMat,_shadersgetLambertDiffuse,_shadersgetMaxIndex,_shadersgetMaxIndexVal,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shadersisInEllipsoid,_shadersisInObliq,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmagnitude,_shadersmagnitudeSquared,_shadersmaterial,_shadersmaterialInput,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyComponents,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrMetallicRoughnessMaterial,_shaderspbrParameters,_shaderspbrSpecularGlossinessMaterial,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssampleOctahedralProjection,_shaderssaturation,_shadersscaleToGeodeticSurface,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildDrawCommand,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildings,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldImagery,createWorldImageryAsync,createWorldTerrain,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseBoundingVolumeSemantics,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); diff --git a/public/lib/Cesium/index.js b/public/lib/Cesium/index.js index 7586fe34..f710f435 100644 --- a/public/lib/Cesium/index.js +++ b/public/lib/Cesium/index.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.105 + * Version 1.106.1 * * Copyright 2011-2022 Cesium Contributors * @@ -23,11 +23,11 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var vxe=Object.create;var DX=Object.defineProperty;var wxe=Object.getOwnPropertyDescriptor;var Dxe=Object.getOwnPropertyNames;var Ixe=Object.getPrototypeOf,Pxe=Object.prototype.hasOwnProperty;var qI=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var sc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Oxe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Dxe(t))!Pxe.call(e,r)&&r!==n&&DX(e,r,{get:()=>t[r],enumerable:!(i=wxe(t,r))||i.enumerable});return e};var co=(e,t,n)=>(n=e!=null?vxe(Ixe(e)):{},Oxe(t||!e||!e.__esModule?DX(n,"default",{value:e,enumerable:!0}):n,e));var XI=sc((d0t,PX)=>{var Eh=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Eh.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Eh.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Eh.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Eh.prototype.random_int31=function(){return this.random_int()>>>1};Eh.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Eh.prototype.random=function(){return this.random_int()*(1/4294967296)};Eh.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Eh.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};PX.exports=Eh});var JK=sc((wx,Dx)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof wx=="object"&&wx&&!wx.nodeType&&wx,n=typeof Dx=="object"&&Dx&&!Dx.nodeType&&Dx,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",h=/^xn--/,A=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,E=Math.floor,S=String.fromCharCode,w;function D(V){throw new RangeError(C[V])}function R(V,G){for(var U=V.length,q=[];U--;)q[U]=G(V[U]);return q}function O(V,G){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(x,".");var Y=V.split("."),Q=R(Y,G).join(".");return q+Q}function L(V){for(var G=[],U=0,q=V.length,Y,Q;U<q;)Y=V.charCodeAt(U++),Y>=55296&&Y<=56319&&U<q?(Q=V.charCodeAt(U++),(Q&64512)==56320?G.push(((Y&1023)<<10)+(Q&1023)+65536):(G.push(Y),U--)):G.push(Y);return G}function N(V){return R(V,function(G){var U="";return G>65535&&(G-=65536,U+=S(G>>>10&1023|55296),G=56320|G&1023),U+=S(G),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function b(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function v(V,G,U){var q=0;for(V=U?E(V/f):V>>1,V+=E(V/G);V>T*c>>1;q+=s)V=E(V/T);return E(q+(T+1)*V/(V+u))}function I(V){var G=[],U=V.length,q,Y=0,Q=p,W=d,K,J,me,ye,se,pe,xe,we,Ee;for(K=V.lastIndexOf(g),K<0&&(K=0),J=0;J<K;++J)V.charCodeAt(J)>=128&&D("not-basic"),G.push(V.charCodeAt(J));for(me=K>0?K+1:0;me<U;){for(ye=Y,se=1,pe=s;me>=U&&D("invalid-input"),xe=_(V.charCodeAt(me++)),(xe>=s||xe>E((o-Y)/se))&&D("overflow"),Y+=xe*se,we=pe<=W?a:pe>=W+c?c:pe-W,!(xe<we);pe+=s)Ee=s-we,se>E(o/Ee)&&D("overflow"),se*=Ee;q=G.length+1,W=v(Y-ye,q,ye==0),E(Y/q)>o-Q&&D("overflow"),Q+=E(Y/q),Y%=q,G.splice(Y++,0,Q)}return N(G)}function M(V){var G,U,q,Y,Q,W,K,J,me,ye,se,pe=[],xe,we,Ee,Be;for(V=L(V),xe=V.length,G=p,U=0,Q=d,W=0;W<xe;++W)se=V[W],se<128&&pe.push(S(se));for(q=Y=pe.length,Y&&pe.push(g);q<xe;){for(K=o,W=0;W<xe;++W)se=V[W],se>=G&&se<K&&(K=se);for(we=q+1,K-G>E((o-U)/we)&&D("overflow"),U+=(K-G)*we,G=K,W=0;W<xe;++W)if(se=V[W],se<G&&++U>o&&D("overflow"),se==G){for(J=U,me=s;ye=me<=Q?a:me>=Q+c?c:me-Q,!(J<ye);me+=s)Be=J-ye,Ee=s-ye,pe.push(S(b(ye+Be%Ee,0))),J=E(Be/Ee);pe.push(S(b(J,0))),Q=v(U,we,q==Y),U=0,++q}++U,++G}return pe.join("")}function F(V){return O(V,function(G){return h.test(G)?I(G.slice(4).toLowerCase()):G})}function k(V){return O(V,function(G){return A.test(G)?"xn--"+M(G):G})}if(r={version:"1.3.2",ucs2:{decode:L,encode:N},decode:I,encode:M,toASCII:k,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(Dx.exports==t)n.exports=r;else for(w in r)r.hasOwnProperty(w)&&(t[w]=r[w]);else e.punycode=r})(wx)});var QK=sc((ZK,bP)=>{/*! +var Hbe=Object.create;var FX=Object.defineProperty;var Gbe=Object.getOwnPropertyDescriptor;var Wbe=Object.getOwnPropertyNames;var jbe=Object.getPrototypeOf,qbe=Object.prototype.hasOwnProperty;var $1=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Vc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ybe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wbe(t))!qbe.call(e,o)&&o!==n&&FX(e,o,{get:()=>t[o],enumerable:!(i=Gbe(t,o))||i.enumerable});return e};var ur=(e,t,n)=>(n=e!=null?Hbe(jbe(e)):{},Ybe(t||!e||!e.__esModule?FX(n,"default",{value:e,enumerable:!0}):n,e));var Q1=Vc((H0t,kX)=>{var Ah=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Ah.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Ah.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Ah.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Ah.prototype.random_int31=function(){return this.random_int()>>>1};Ah.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Ah.prototype.random=function(){return this.random_int()*(1/4294967296)};Ah.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Ah.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};kX.exports=Ah});var xK=Vc((Ib,Db)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof Ib=="object"&&Ib&&!Ib.nodeType&&Ib,n=typeof Db=="object"&&Db&&!Db.nodeType&&Db,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",h=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,A=Math.floor,S=String.fromCharCode,v;function I(U){throw new RangeError(C[U])}function O(U,G){for(var k=U.length,Y=[];k--;)Y[k]=G(U[k]);return Y}function R(U,G){var k=U.split("@"),Y="";k.length>1&&(Y=k[0]+"@",U=k[1]),U=U.replace(b,".");var j=U.split("."),$=O(j,G).join(".");return Y+$}function N(U){for(var G=[],k=0,Y=U.length,j,$;k<Y;)j=U.charCodeAt(k++),j>=55296&&j<=56319&&k<Y?($=U.charCodeAt(k++),($&64512)==56320?G.push(((j&1023)<<10)+($&1023)+65536):(G.push(j),k--)):G.push(j);return G}function F(U){return O(U,function(G){var k="";return G>65535&&(G-=65536,k+=S(G>>>10&1023|55296),G=56320|G&1023),k+=S(G),k}).join("")}function _(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function E(U,G){return U+22+75*(U<26)-((G!=0)<<5)}function w(U,G,k){var Y=0;for(U=k?A(U/f):U>>1,U+=A(U/G);U>T*c>>1;Y+=s)U=A(U/T);return A(Y+(T+1)*U/(U+u))}function D(U){var G=[],k=U.length,Y,j=0,$=p,W=d,K,J,he,ge,se,pe,xe,De,Se;for(K=U.lastIndexOf(g),K<0&&(K=0),J=0;J<K;++J)U.charCodeAt(J)>=128&&I("not-basic"),G.push(U.charCodeAt(J));for(he=K>0?K+1:0;he<k;){for(ge=j,se=1,pe=s;he>=k&&I("invalid-input"),xe=_(U.charCodeAt(he++)),(xe>=s||xe>A((r-j)/se))&&I("overflow"),j+=xe*se,De=pe<=W?a:pe>=W+c?c:pe-W,!(xe<De);pe+=s)Se=s-De,se>A(r/Se)&&I("overflow"),se*=Se;Y=G.length+1,W=w(j-ge,Y,ge==0),A(j/Y)>r-$&&I("overflow"),$+=A(j/Y),j%=Y,G.splice(j++,0,$)}return F(G)}function M(U){var G,k,Y,j,$,W,K,J,he,ge,se,pe=[],xe,De,Se,we;for(U=N(U),xe=U.length,G=p,k=0,$=d,W=0;W<xe;++W)se=U[W],se<128&&pe.push(S(se));for(Y=j=pe.length,j&&pe.push(g);Y<xe;){for(K=r,W=0;W<xe;++W)se=U[W],se>=G&&se<K&&(K=se);for(De=Y+1,K-G>A((r-k)/De)&&I("overflow"),k+=(K-G)*De,G=K,W=0;W<xe;++W)if(se=U[W],se<G&&++k>r&&I("overflow"),se==G){for(J=k,he=s;ge=he<=$?a:he>=$+c?c:he-$,!(J<ge);he+=s)we=J-ge,Se=s-ge,pe.push(S(E(ge+we%Se,0))),J=A(we/Se);pe.push(S(E(J,0))),$=w(k,De,Y==j),k=0,++Y}++k,++G}return pe.join("")}function B(U){return R(U,function(G){return h.test(G)?D(G.slice(4).toLowerCase()):G})}function V(U){return R(U,function(G){return x.test(G)?"xn--"+M(G):G})}if(o={version:"1.3.2",ucs2:{decode:N,encode:F},decode:D,encode:M,toASCII:V,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(Db.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(Ib)});var CK=Vc((bK,CD)=>{/*! * URI.js - Mutating URLs * IPv6 Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -35,11 +35,11 @@ var vxe=Object.create;var DX=Object.defineProperty;var wxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof bP=="object"&&bP.exports?bP.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(ZK,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,A=0,x=-1,C=!1;for(d=0;d<c;d++)C?s[d]==="0"?A+=1:(C=!1,A>h&&(g=x,h=A)):s[d]==="0"&&(C=!0,x=d,A=1);A>h&&(g=x,h=A),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d<a&&(T+=s[d],d!==a-1);d++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var eJ=sc(($K,SP)=>{/*! + */(function(e,t){"use strict";typeof CD=="object"&&CD.exports?CD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(bK,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,x=0,b=-1,C=!1;for(d=0;d<c;d++)C?s[d]==="0"?x+=1:(C=!1,x>h&&(g=b,h=x)):s[d]==="0"&&(C=!0,b=d,x=1);x>h&&(g=b,h=x),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d<a&&(T+=s[d],d!==a-1);d++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var AK=Vc((TK,TD)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -47,10 +47,10 @@ var vxe=Object.create;var DX=Object.defineProperty;var wxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof SP=="object"&&SP.exports?SP.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})($K,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var wl=sc((tJ,vP)=>{/*! + */(function(e,t){"use strict";typeof TD=="object"&&TD.exports?TD.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(TK,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Dl=Vc((EK,AD)=>{/*! * URI.js - Mutating URLs * - * Version: 1.19.10 + * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ @@ -58,12863 +58,8645 @@ var vxe=Object.create;var DX=Object.defineProperty;var wxe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof vP=="object"&&vP.exports?vP.exports=t(JK(),QK(),eJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(tJ,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(b,v){var I=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return I?M?new o(b,v):new o(b):new o;if(b===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(b),v!==void 0?this.absoluteTo(v):this}function s(b){return/^[0-9]+$/.test(b)}o.version="1.19.10";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function d(b){return f(b)==="Array"}function p(b,v){var I={},M,F;if(f(v)==="RegExp")I=null;else if(d(v))for(M=0,F=v.length;M<F;M++)I[v[M]]=!0;else I[v]=!0;for(M=0,F=b.length;M<F;M++){var k=I&&I[b[M]]!==void 0||!I&&v.test(b[M]);k&&(b.splice(M,1),F--,M--)}return b}function g(b,v){var I,M;if(d(v)){for(I=0,M=v.length;I<M;I++)if(!g(b,v[I]))return!1;return!0}var F=f(v);for(I=0,M=b.length;I<M;I++)if(F==="RegExp"){if(typeof b[I]=="string"&&b[I].match(v))return!0}else if(b[I]===v)return!0;return!1}function h(b,v){if(!d(b)||!d(v)||b.length!==v.length)return!1;b.sort(),v.sort();for(var I=0,M=b.length;I<M;I++)if(b[I]!==v[I])return!1;return!0}function A(b){var v=/^\/+|\/+$/g;return b.replace(v,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(b){if(!(!b||!b.nodeName)){var v=b.nodeName.toLowerCase();if(!(v==="input"&&b.type!=="image"))return o.domAttributes[v]}};function x(b){return escape(b)}function C(b){return encodeURIComponent(b).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}o.encode=C,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=C,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(b,v){var I=o.encode(b+"");return v===void 0&&(v=o.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},o.decodeQuery=function(b,v){b+="",v===void 0&&(v=o.escapeQuerySpace);try{return o.decode(v?b.replace(/\+/g,"%20"):b)}catch{return b}};var T={encode:"encode",decode:"decode"},E,S=function(b,v){return function(I){try{return o[v](I+"").replace(o.characters[b][v].expression,function(M){return o.characters[b][v].map[M]})}catch{return I}}};for(E in T)o[E+"PathSegment"]=S("pathname",T[E]),o[E+"UrnPathSegment"]=S("urnpath",T[E]);var w=function(b,v,I){return function(M){var F;I?F=function(U){return o[v](o[I](U))}:F=o[v];for(var k=(M+"").split(b),V=0,G=k.length;V<G;V++)k[V]=F(k[V]);return k.join(b)}};o.decodePath=w("/","decodePathSegment"),o.decodeUrnPath=w(":","decodeUrnPathSegment"),o.recodePath=w("/","encodePathSegment","decode"),o.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),o.encodeReserved=S("reserved","encode"),o.parse=function(b,v){var I;return v||(v={preventInvalidHostname:o.preventInvalidHostname}),b=b.replace(o.leading_whitespace_expression,""),I=b.indexOf("#"),I>-1&&(v.fragment=b.substring(I+1)||null,b=b.substring(0,I)),I=b.indexOf("?"),I>-1&&(v.query=b.substring(I+1)||null,b=b.substring(0,I)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b.substring(0,2)==="//"?(v.protocol=null,b=b.substring(2),b=o.parseAuthority(b,v)):(I=b.indexOf(":"),I>-1&&(v.protocol=b.substring(0,I)||null,v.protocol&&!v.protocol.match(o.protocol_expression)?v.protocol=void 0:b.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(b=b.substring(I+3),b=o.parseAuthority(b,v)):(b=b.substring(I+1),v.urn=!0))),v.path=b,v},o.parseHost=function(b,v){b||(b=""),b=b.replace(/\\/g,"/");var I=b.indexOf("/"),M,F;if(I===-1&&(I=b.length),b.charAt(0)==="[")M=b.indexOf("]"),v.hostname=b.substring(1,M)||null,v.port=b.substring(M+2,I)||null,v.port==="/"&&(v.port=null);else{var k=b.indexOf(":"),V=b.indexOf("/"),G=b.indexOf(":",k+1);G!==-1&&(V===-1||G<V)?(v.hostname=b.substring(0,I)||null,v.port=null):(F=b.substring(0,I).split(":"),v.hostname=F[0]||null,v.port=F[1]||null)}return v.hostname&&b.substring(I).charAt(0)!=="/"&&(I++,b="/"+b),v.preventInvalidHostname&&o.ensureValidHostname(v.hostname,v.protocol),v.port&&o.ensureValidPort(v.port),b.substring(I)||"/"},o.parseAuthority=function(b,v){return b=o.parseUserinfo(b,v),o.parseHost(b,v)},o.parseUserinfo=function(b,v){var I=b,M=b.indexOf("\\");M!==-1&&(b=b.replace(/\\/g,"/"));var F=b.indexOf("/"),k=b.lastIndexOf("@",F>-1?F:b.length-1),V;return k>-1&&(F===-1||k<F)?(V=b.substring(0,k).split(":"),v.username=V[0]?o.decode(V[0]):null,V.shift(),v.password=V[0]?o.decode(V.join(":")):null,b=I.substring(k+1)):(v.username=null,v.password=null),b},o.parseQuery=function(b,v){if(!b)return{};if(b=b.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!b)return{};for(var I={},M=b.split("&"),F=M.length,k,V,G,U=0;U<F;U++)k=M[U].split("="),V=o.decodeQuery(k.shift(),v),G=k.length?o.decodeQuery(k.join("="),v):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},o.build=function(b){var v="",I=!1;return b.protocol&&(v+=b.protocol+":"),!b.urn&&(v||b.hostname)&&(v+="//",I=!0),v+=o.buildAuthority(b)||"",typeof b.path=="string"&&(b.path.charAt(0)!=="/"&&I&&(v+="/"),v+=b.path),typeof b.query=="string"&&b.query&&(v+="?"+b.query),typeof b.fragment=="string"&&b.fragment&&(v+="#"+b.fragment),v},o.buildHost=function(b){var v="";if(b.hostname)o.ip6_expression.test(b.hostname)?v+="["+b.hostname+"]":v+=b.hostname;else return"";return b.port&&(v+=":"+b.port),v},o.buildAuthority=function(b){return o.buildUserinfo(b)+o.buildHost(b)},o.buildUserinfo=function(b){var v="";return b.username&&(v+=o.encode(b.username)),b.password&&(v+=":"+o.encode(b.password)),v&&(v+="@"),v},o.buildQuery=function(b,v,I){var M="",F,k,V,G;for(k in b)if(k!=="__proto__"&&c.call(b,k))if(d(b[k]))for(F={},V=0,G=b[k].length;V<G;V++)b[k][V]!==void 0&&F[b[k][V]+""]===void 0&&(M+="&"+o.buildQueryParameter(k,b[k][V],I),v!==!0&&(F[b[k][V]+""]=!0));else b[k]!==void 0&&(M+="&"+o.buildQueryParameter(k,b[k],I));return M.substring(1)},o.buildQueryParameter=function(b,v,I){return o.encodeQuery(b,I)+(v!==null?"="+o.encodeQuery(v,I):"")},o.addQuery=function(b,v,I){if(typeof v=="object")for(var M in v)c.call(v,M)&&o.addQuery(b,M,v[M]);else if(typeof v=="string"){if(b[v]===void 0){b[v]=I;return}else typeof b[v]=="string"&&(b[v]=[b[v]]);d(I)||(I=[I]),b[v]=(b[v]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(b,v,I){if(typeof v=="object")for(var M in v)c.call(v,M)&&o.setQuery(b,M,v[M]);else if(typeof v=="string")b[v]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(b,v,I){var M,F,k;if(d(v))for(M=0,F=v.length;M<F;M++)b[v[M]]=void 0;else if(f(v)==="RegExp")for(k in b)v.test(k)&&(b[k]=void 0);else if(typeof v=="object")for(k in v)c.call(v,k)&&o.removeQuery(b,k,v[k]);else if(typeof v=="string")I!==void 0?f(I)==="RegExp"?!d(b[v])&&I.test(b[v])?b[v]=void 0:b[v]=p(b[v],I):b[v]===String(I)&&(!d(I)||I.length===1)?b[v]=void 0:d(b[v])&&(b[v]=p(b[v],I)):b[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(b,v,I,M){switch(f(v)){case"String":break;case"RegExp":for(var F in b)if(c.call(b,F)&&v.test(F)&&(I===void 0||o.hasQuery(b,F,I)))return!0;return!1;case"Object":for(var k in v)if(c.call(v,k)&&!o.hasQuery(b,k,v[k]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return v in b;case"Boolean":var V=!!(d(b[v])?b[v].length:b[v]);return I===V;case"Function":return!!I(b[v],v,b);case"Array":if(!d(b[v]))return!1;var G=M?g:h;return G(b[v],I);case"RegExp":return d(b[v])?M?g(b[v],I):!1:!!(b[v]&&b[v].match(I));case"Number":I=String(I);case"String":return d(b[v])?M?g(b[v],I):!1:b[v]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var b=[],v=[],I=0,M=0;M<arguments.length;M++){var F=new o(arguments[M]);b.push(F);for(var k=F.segment(),V=0;V<k.length;V++)typeof k[V]=="string"&&v.push(k[V]),k[V]&&I++}if(!v.length||!I)return new o("");var G=new o("").segment(v);return(b[0].path()===""||b[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},o.commonPath=function(b,v){var I=Math.min(b.length,v.length),M;for(M=0;M<I;M++)if(b.charAt(M)!==v.charAt(M)){M--;break}return M<1?b.charAt(0)===v.charAt(0)&&b.charAt(0)==="/"?"/":"":((b.charAt(M)!=="/"||v.charAt(M)!=="/")&&(M=b.substring(0,M).lastIndexOf("/")),b.substring(0,M+1))},o.withinString=function(b,v,I){I||(I={});var M=I.start||o.findUri.start,F=I.end||o.findUri.end,k=I.trim||o.findUri.trim,V=I.parens||o.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var U=M.exec(b);if(!U)break;var q=U.index;if(I.ignoreHtml){var Y=b.slice(Math.max(q-3,0),q);if(Y&&G.test(Y))continue}for(var Q=q+b.slice(q).search(F),W=b.slice(q,Q),K=-1;;){var J=V.exec(W);if(!J)break;var me=J.index+J[0].length;K=Math.max(K,me)}if(K>-1?W=W.slice(0,K)+W.slice(K).replace(k,""):W=W.replace(k,""),!(W.length<=U[0].length)&&!(I.ignore&&I.ignore.test(W))){Q=q+W.length;var ye=v(W,q,Q,b);if(ye===void 0){M.lastIndex=Q;continue}ye=String(ye),b=b.slice(0,q)+ye+b.slice(Q),M.lastIndex=q+ye.length}}return M.lastIndex=0,b},o.ensureValidHostname=function(b,v){var I=!!b,M=!!v,F=!1;if(M&&(F=g(o.hostProtocols,v)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(b&&b.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(b){if(b){var v=Number(b);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},o.noConflict=function(b){if(b){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=r);return this},a.build=function(b){return b===!0?this._deferred_build=!0:(b===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(b){return function(v,I){return v===void 0?this._parts[b]||"":(this._parts[b]=v||null,this.build(!I),this)}}function R(b,v){return function(I,M){return I===void 0?this._parts[b]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[b]=I,this.build(!M),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=R("query","?"),a.fragment=R("fragment","#"),a.search=function(b,v){var I=this.query(b,v);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(b,v){var I=this.fragment(b,v);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(b,v){if(b===void 0||b===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?o.decodeUrnPath:o.decodePath)(I):I}else return this._parts.urn?this._parts.path=b?o.recodeUrnPath(b):"":this._parts.path=b?o.recodePath(b):"/",this.build(!v),this},a.path=a.pathname,a.href=function(b,v){var I;if(b===void 0)return this.toString();this._string="",this._parts=o._parts();var M=b instanceof o,F=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var k=o.getDomAttribute(b);b=b[k]||"",F=!1}if(!M&&F&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=o.parse(String(b),this._parts);else if(M||F){var V=M?b._parts:b;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},a.is=function(b){var v=!1,I=!1,M=!1,F=!1,k=!1,V=!1,G=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),v=I||M,F=!v,k=F&&n&&n.has(this._parts.hostname),V=F&&o.idn_expression.test(this._parts.hostname),G=F&&o.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return F;case"sld":return k;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return M;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var O=a.protocol,L=a.port,N=a.hostname;a.protocol=function(b,v){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(o.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,b,v)},a.scheme=a.protocol,a.port=function(b,v){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),o.ensureValidPort(b))),L.call(this,b,v))},a.hostname=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(b,I);if(M!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=I.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(b,this._parts.protocol)}return N.call(this,b,v)},a.origin=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=this.protocol(),M=this.authority();return M?(I?I+"://":"")+this.authority():""}else{var F=o(b);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var I=o.parseHost(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var I=o.parseAuthority(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=o.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),o.parseUserinfo(b,this._parts),this.build(!v),this},a.resource=function(b,v){var I;return b===void 0?this.path()+this.search()+this.hash():(I=o.parse(b),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},a.subdomain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),k=new RegExp("^"+u(F));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&o.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(k,b),this.build(!v),this}},a.domain=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(v).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,b)}return this.build(!v),this}},a.tld=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(v=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var F;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b);else throw new TypeError('TLD "'+b+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return b?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,k=this._parts.path.substring(0,F),V=new RegExp("^"+u(k));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=o.recodePath(b),this._parts.path=this._parts.path.replace(V,b),this.build(!v),this}},a.filename=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(I+1);return b?o.decodePathSegment(M):M}else{var F=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(F=!0);var k=new RegExp(u(this.filename())+"$");return b=o.recodePath(b),this._parts.path=this._parts.path.replace(k,b),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(b,v){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),M=I.lastIndexOf("."),F,k;return M===-1?"":(F=I.substring(M+1),k=/^[a-z0-9%]+$/i.test(F)?F:"",b?o.decodePathSegment(k):k)}else{b.charAt(0)==="."&&(b=b.substring(1));var V=this.suffix(),G;if(V)b?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!b)return this;this._parts.path+="."+o.recodePath(b)}return G&&(b=o.recodePath(b),this._parts.path=this._parts.path.replace(G,b)),this.build(!v),this}},a.segment=function(b,v,I){var M=this._parts.urn?":":"/",F=this.path(),k=F.substring(0,1)==="/",V=F.split(M);if(b!==void 0&&typeof b!="number"&&(I=v,v=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(k&&V.shift(),b<0&&(b=Math.max(V.length+b,0)),v===void 0)return b===void 0?V:V[b];if(b===null||V[b]===void 0)if(d(v)){V=[];for(var G=0,U=v.length;G<U;G++)!v[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(A(v[G])))}else(v||typeof v=="string")&&(v=A(v),V[V.length-1]===""?V[V.length-1]=v:V.push(v));else v?V[b]=A(v):V.splice(b,1);return k&&V.unshift(""),this.path(V.join(M),I)},a.segmentCoded=function(b,v,I){var M,F,k;if(typeof b!="number"&&(I=v,v=b,b=void 0),v===void 0){if(M=this.segment(b,v,I),!d(M))M=M!==void 0?o.decode(M):void 0;else for(F=0,k=M.length;F<k;F++)M[F]=o.decode(M[F]);return M}if(!d(v))v=typeof v=="string"||v instanceof String?o.encode(v):v;else for(F=0,k=v.length;F<k;F++)v[F]=o.encode(v[F]);return this.segment(b,v,I)};var _=a.query;return a.query=function(b,v){if(b===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="function"){var I=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=b.call(this,I);return this._parts.query=o.buildQuery(M||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return b!==void 0&&typeof b!="string"?(this._parts.query=o.buildQuery(b,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):_.call(this,b,v)},a.setQuery=function(b,v,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="string"||b instanceof String)M[b]=v!==void 0?v:null;else if(typeof b=="object")for(var F in b)c.call(b,F)&&(M[F]=b[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.addQuery=function(b,v,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,b,v===void 0?null:v),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.removeQuery=function(b,v,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,b,v),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(I=v),this.build(!I),this},a.hasQuery=function(b,v,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,b,v,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(b){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!b)),this},a.normalizeHostname=function(b){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!b)),this},a.normalizePort=function(b){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!b)),this},a.normalizePath=function(b){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!b),this;if(this._parts.path==="/")return this;v=o.recodePath(v);var I,M="",F,k;for(v.charAt(0)!=="/"&&(I=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(M=v.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));F=v.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){v=v.substring(3);continue}k=v.substring(0,F).lastIndexOf("/"),k===-1&&(k=F),v=v.substring(0,k)+v.substring(F+3)}return I&&this.is("relative")&&(v=M+v.substring(1)),this._parts.path=v,this.build(!b),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(b){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!b)),this},a.normalizeFragment=function(b){return this._parts.fragment||(this._parts.fragment=null,this.build(!b)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var b=o.encode,v=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=b,o.decode=v}return this},a.unicode=function(){var b=o.encode,v=o.decode;o.encode=C,o.decode=unescape;try{this.normalize()}finally{o.encode=b,o.decode=v}return this},a.readable=function(){var b=this.clone();b.username("").password("").normalize();var v="";if(b._parts.protocol&&(v+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&e?(v+=e.toUnicode(b._parts.hostname),b._parts.port&&(v+=":"+b._parts.port)):v+=b.host()),b._parts.hostname&&b._parts.path&&b._parts.path.charAt(0)!=="/"&&(v+="/"),v+=b.path(!0),b._parts.query){for(var I="",M=0,F=b._parts.query.split("&"),k=F.length;M<k;M++){var V=(F[M]||"").split("=");I+="&"+o.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+o.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}v+="?"+I.substring(1)}return v+=o.decodeQuery(b.hash(),!0),v},a.absoluteTo=function(b){var v=this.clone(),I=["protocol","username","password","hostname","port"],M,F,k;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b instanceof o||(b=new o(b)),v._parts.protocol||(v._parts.protocol=b._parts.protocol,this._parts.hostname))return v;for(F=0;k=I[F];F++)v._parts[k]=b._parts[k];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(M=b.directory(),M=M||(b.path().indexOf("/")===0?"/":""),v._parts.path=(M?M+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=b._parts.path,v._parts.query||(v._parts.query=b._parts.query)),v.build(),v},a.relativeTo=function(b){var v=this.clone().normalize(),I,M,F,k,V;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b=new o(b).normalize(),I=v._parts,M=b._parts,k=v.path(),V=b.path(),k.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===M.protocol&&(I.protocol=null),I.username!==M.username||I.password!==M.password||I.protocol!==null||I.username!==null||I.password!==null)return v.build();if(I.hostname===M.hostname&&I.port===M.port)I.hostname=null,I.port=null;else return v.build();if(k===V)return I.path="",v.build();if(F=o.commonPath(k,V),!F)return v.build();var G=M.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(F.length)||"./",v.build()},a.equals=function(b){var v=this.clone(),I=new o(b),M={},F={},k={},V,G,U;if(v.normalize(),I.normalize(),v.toString()===I.toString())return!0;if(V=v.query(),G=I.query(),v.query(""),I.query(""),v.toString()!==I.toString()||V.length!==G.length)return!1;M=o.parseQuery(V,this._parts.escapeQuerySpace),F=o.parseQuery(G,this._parts.escapeQuerySpace);for(U in M)if(c.call(M,U)){if(d(M[U])){if(!h(M[U],F[U]))return!1}else if(M[U]!==F[U])return!1;k[U]=!0}for(U in F)if(c.call(F,U)&&!k[U])return!1;return!0},a.preventInvalidHostname=function(b){return this._parts.preventInvalidHostname=!!b,this},a.duplicateQueryParameters=function(b){return this._parts.duplicateQueryParameters=!!b,this},a.escapeQuerySpace=function(b){return this._parts.escapeQuerySpace=!!b,this},o})});var eee=sc((r5,o5)=>{/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */(function(e,t){typeof r5=="object"&&typeof o5<"u"?o5.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(r5,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:r}=Object,{freeze:o,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;c||(c=function(Pe,ft,_t){return Pe.apply(ft,_t)}),o||(o=function(Pe){return Pe}),s||(s=function(Pe){return Pe}),u||(u=function(Pe,ft){return new Pe(...ft)});let f=w(Array.prototype.forEach),d=w(Array.prototype.pop),p=w(Array.prototype.push),g=w(String.prototype.toLowerCase),h=w(String.prototype.toString),A=w(String.prototype.match),x=w(String.prototype.replace),C=w(String.prototype.indexOf),T=w(String.prototype.trim),E=w(RegExp.prototype.test),S=D(TypeError);function w(ke){return function(Pe){for(var ft=arguments.length,_t=new Array(ft>1?ft-1:0),rt=1;rt<ft;rt++)_t[rt-1]=arguments[rt];return c(ke,Pe,_t)}}function D(ke){return function(){for(var Pe=arguments.length,ft=new Array(Pe),_t=0;_t<Pe;_t++)ft[_t]=arguments[_t];return u(ke,ft)}}function R(ke,Pe,ft){ft=ft||g,t&&t(ke,null);let _t=Pe.length;for(;_t--;){let rt=Pe[_t];if(typeof rt=="string"){let dn=ft(rt);dn!==rt&&(n(Pe)||(Pe[_t]=dn),rt=dn)}ke[rt]=!0}return ke}function O(ke){let Pe=a(null);for(let[ft,_t]of e(ke))Pe[ft]=_t;return Pe}function L(ke,Pe){for(;ke!==null;){let _t=r(ke,Pe);if(_t){if(_t.get)return w(_t.get);if(typeof _t.value=="function")return w(_t.value)}ke=i(ke)}function ft(_t){return console.warn("fallback value for",_t),null}return ft}let N=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),b=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),v=o(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),F=o(["#text"]),k=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),G=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Y=s(/<%[\w\W]*|[\w\W]*%>/gm),Q=s(/\${[\w\W]*}/gm),W=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),J=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),me=s(/^(?:\w+script|data):/i),ye=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=s(/^html$/i);var pe=Object.freeze({__proto__:null,MUSTACHE_EXPR:q,ERB_EXPR:Y,TMPLIT_EXPR:Q,DATA_ATTR:W,ARIA_ATTR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:ye,DOCTYPE_NAME:se});let xe=()=>typeof window>"u"?null:window,we=function(Pe,ft){if(typeof Pe!="object"||typeof Pe.createPolicy!="function")return null;let _t=null,rt="data-tt-policy-suffix";ft.currentScript&&ft.currentScript.hasAttribute(rt)&&(_t=ft.currentScript.getAttribute(rt));let dn="dompurify"+(_t?"#"+_t:"");try{return Pe.createPolicy(dn,{createHTML(In){return In},createScriptURL(In){return In}})}catch{return console.warn("TrustedTypes policy "+dn+" could not be created."),null}};function Ee(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe(),Pe=Tn=>Ee(Tn);if(Pe.version="3.0.2",Pe.removed=[],!ke||!ke.document||ke.document.nodeType!==9)return Pe.isSupported=!1,Pe;let ft=ke.document,{document:_t}=ke,{DocumentFragment:rt,HTMLTemplateElement:dn,Node:In,Element:Ht,NodeFilter:Ft,NamedNodeMap:Te=ke.NamedNodeMap||ke.MozNamedAttrMap,HTMLFormElement:Ae,DOMParser:ut,trustedTypes:ti}=ke,Je=Ht.prototype,or=L(Je,"cloneNode"),Qo=L(Je,"nextSibling"),va=L(Je,"childNodes"),Io=L(Je,"parentNode");if(typeof dn=="function"){let Tn=_t.createElement("template");Tn.content&&Tn.content.ownerDocument&&(_t=Tn.content.ownerDocument)}let Dr=we(ti,ft),Ve=Dr?Dr.createHTML(""):"",{implementation:ot,createNodeIterator:je,createDocumentFragment:Ze,getElementsByTagName:mt}=_t,{importNode:kt}=ft,Jt={};Pe.isSupported=typeof e=="function"&&typeof Io=="function"&&ot&&typeof ot.createHTMLDocument<"u";let{MUSTACHE_EXPR:$i,ERB_EXPR:dr,TMPLIT_EXPR:$o,DATA_ATTR:Is,ARIA_ATTR:ao,IS_SCRIPT_OR_DATA:ki,ATTR_WHITESPACE:Ho}=pe,{IS_ALLOWED_URI:Fn}=pe,sn=null,Wn=R({},[...N,..._,...b,...I,...F]),vn=null,Ps=R({},[...k,...V,...G,...U]),mi=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oa=null,bu=null,Of=!0,Os=!0,Vb=!1,Vr=!0,Ir=!1,sa=!1,xr=!1,Rs=!1,Pr=!1,Rf=!1,ds=!1,xh=!0,HI=!1,gxe="user-content-",kH=!0,kb=!1,mx={},hx=null,hX=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),pX=null,_X=R({},["audio","video","img","source","image","track"]),zH=null,gX=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),GI="http://www.w3.org/1998/Math/MathML",WI="http://www.w3.org/2000/svg",Ch="http://www.w3.org/1999/xhtml",px=Ch,HH=!1,GH=null,yxe=R({},[GI,WI,Ch],h),Vy,Axe=["application/xhtml+xml","text/html"],xxe="text/html",Ms,_x=null,Cxe=_t.createElement("form"),yX=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},WH=function(Ie){_x&&_x===Ie||((!Ie||typeof Ie!="object")&&(Ie={}),Ie=O(Ie),Vy=Axe.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?Vy=xxe:Vy=Ie.PARSER_MEDIA_TYPE,Ms=Vy==="application/xhtml+xml"?h:g,sn="ALLOWED_TAGS"in Ie?R({},Ie.ALLOWED_TAGS,Ms):Wn,vn="ALLOWED_ATTR"in Ie?R({},Ie.ALLOWED_ATTR,Ms):Ps,GH="ALLOWED_NAMESPACES"in Ie?R({},Ie.ALLOWED_NAMESPACES,h):yxe,zH="ADD_URI_SAFE_ATTR"in Ie?R(O(gX),Ie.ADD_URI_SAFE_ATTR,Ms):gX,pX="ADD_DATA_URI_TAGS"in Ie?R(O(_X),Ie.ADD_DATA_URI_TAGS,Ms):_X,hx="FORBID_CONTENTS"in Ie?R({},Ie.FORBID_CONTENTS,Ms):hX,oa="FORBID_TAGS"in Ie?R({},Ie.FORBID_TAGS,Ms):{},bu="FORBID_ATTR"in Ie?R({},Ie.FORBID_ATTR,Ms):{},mx="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,Of=Ie.ALLOW_ARIA_ATTR!==!1,Os=Ie.ALLOW_DATA_ATTR!==!1,Vb=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,Vr=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ir=Ie.SAFE_FOR_TEMPLATES||!1,sa=Ie.WHOLE_DOCUMENT||!1,Pr=Ie.RETURN_DOM||!1,Rf=Ie.RETURN_DOM_FRAGMENT||!1,ds=Ie.RETURN_TRUSTED_TYPE||!1,Rs=Ie.FORCE_BODY||!1,xh=Ie.SANITIZE_DOM!==!1,HI=Ie.SANITIZE_NAMED_PROPS||!1,kH=Ie.KEEP_CONTENT!==!1,kb=Ie.IN_PLACE||!1,Fn=Ie.ALLOWED_URI_REGEXP||J,px=Ie.NAMESPACE||Ch,mi=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&yX(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(mi.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&yX(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(mi.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(mi.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ir&&(Os=!1),Rf&&(Pr=!0),mx&&(sn=R({},[...F]),vn=[],mx.html===!0&&(R(sn,N),R(vn,k)),mx.svg===!0&&(R(sn,_),R(vn,V),R(vn,U)),mx.svgFilters===!0&&(R(sn,b),R(vn,V),R(vn,U)),mx.mathMl===!0&&(R(sn,I),R(vn,G),R(vn,U))),Ie.ADD_TAGS&&(sn===Wn&&(sn=O(sn)),R(sn,Ie.ADD_TAGS,Ms)),Ie.ADD_ATTR&&(vn===Ps&&(vn=O(vn)),R(vn,Ie.ADD_ATTR,Ms)),Ie.ADD_URI_SAFE_ATTR&&R(zH,Ie.ADD_URI_SAFE_ATTR,Ms),Ie.FORBID_CONTENTS&&(hx===hX&&(hx=O(hx)),R(hx,Ie.FORBID_CONTENTS,Ms)),kH&&(sn["#text"]=!0),sa&&R(sn,["html","head","body"]),sn.table&&(R(sn,["tbody"]),delete oa.tbody),o&&o(Ie),_x=Ie)},AX=R({},["mi","mo","mn","ms","mtext"]),xX=R({},["foreignobject","desc","title","annotation-xml"]),Txe=R({},["title","style","font","a","script"]),jI=R({},_);R(jI,b),R(jI,v);let jH=R({},I);R(jH,M);let Exe=function(Ie){let Ct=Io(Ie);(!Ct||!Ct.tagName)&&(Ct={namespaceURI:px,tagName:"template"});let Kt=g(Ie.tagName),Er=g(Ct.tagName);return GH[Ie.namespaceURI]?Ie.namespaceURI===WI?Ct.namespaceURI===Ch?Kt==="svg":Ct.namespaceURI===GI?Kt==="svg"&&(Er==="annotation-xml"||AX[Er]):!!jI[Kt]:Ie.namespaceURI===GI?Ct.namespaceURI===Ch?Kt==="math":Ct.namespaceURI===WI?Kt==="math"&&xX[Er]:!!jH[Kt]:Ie.namespaceURI===Ch?Ct.namespaceURI===WI&&!xX[Er]||Ct.namespaceURI===GI&&!AX[Er]?!1:!jH[Kt]&&(Txe[Kt]||!jI[Kt]):!!(Vy==="application/xhtml+xml"&&GH[Ie.namespaceURI]):!1},ky=function(Ie){p(Pe.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},YH=function(Ie,Ct){try{p(Pe.removed,{attribute:Ct.getAttributeNode(Ie),from:Ct})}catch{p(Pe.removed,{attribute:null,from:Ct})}if(Ct.removeAttribute(Ie),Ie==="is"&&!vn[Ie])if(Pr||Rf)try{ky(Ct)}catch{}else try{Ct.setAttribute(Ie,"")}catch{}},CX=function(Ie){let Ct,Kt;if(Rs)Ie="<remove></remove>"+Ie;else{let Su=A(Ie,/^[\r\n\t ]+/);Kt=Su&&Su[0]}Vy==="application/xhtml+xml"&&px===Ch&&(Ie='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ie+"</body></html>");let Er=Dr?Dr.createHTML(Ie):Ie;if(px===Ch)try{Ct=new ut().parseFromString(Er,Vy)}catch{}if(!Ct||!Ct.documentElement){Ct=ot.createDocument(px,"template",null);try{Ct.documentElement.innerHTML=HH?Ve:Er}catch{}}let Bs=Ct.body||Ct.documentElement;return Ie&&Kt&&Bs.insertBefore(_t.createTextNode(Kt),Bs.childNodes[0]||null),px===Ch?mt.call(Ct,sa?"html":"body")[0]:sa?Ct.documentElement:Bs},TX=function(Ie){return je.call(Ie.ownerDocument||Ie,Ie,Ft.SHOW_ELEMENT|Ft.SHOW_COMMENT|Ft.SHOW_TEXT,null,!1)},bxe=function(Ie){return Ie instanceof Ae&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof Te)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},YI=function(Ie){return typeof In=="object"?Ie instanceof In:Ie&&typeof Ie=="object"&&typeof Ie.nodeType=="number"&&typeof Ie.nodeName=="string"},Th=function(Ie,Ct,Kt){Jt[Ie]&&f(Jt[Ie],Er=>{Er.call(Pe,Ct,Kt,_x)})},EX=function(Ie){let Ct;if(Th("beforeSanitizeElements",Ie,null),bxe(Ie))return ky(Ie),!0;let Kt=Ms(Ie.nodeName);if(Th("uponSanitizeElement",Ie,{tagName:Kt,allowedTags:sn}),Ie.hasChildNodes()&&!YI(Ie.firstElementChild)&&(!YI(Ie.content)||!YI(Ie.content.firstElementChild))&&E(/<[/\w]/g,Ie.innerHTML)&&E(/<[/\w]/g,Ie.textContent))return ky(Ie),!0;if(!sn[Kt]||oa[Kt]){if(!oa[Kt]&&SX(Kt)&&(mi.tagNameCheck instanceof RegExp&&E(mi.tagNameCheck,Kt)||mi.tagNameCheck instanceof Function&&mi.tagNameCheck(Kt)))return!1;if(kH&&!hx[Kt]){let Er=Io(Ie)||Ie.parentNode,Bs=va(Ie)||Ie.childNodes;if(Bs&&Er){let Su=Bs.length;for(let _o=Su-1;_o>=0;--_o)Er.insertBefore(or(Bs[_o],!0),Qo(Ie))}}return ky(Ie),!0}return Ie instanceof Ht&&!Exe(Ie)||(Kt==="noscript"||Kt==="noembed")&&E(/<\/no(script|embed)/i,Ie.innerHTML)?(ky(Ie),!0):(Ir&&Ie.nodeType===3&&(Ct=Ie.textContent,Ct=x(Ct,$i," "),Ct=x(Ct,dr," "),Ct=x(Ct,$o," "),Ie.textContent!==Ct&&(p(Pe.removed,{element:Ie.cloneNode()}),Ie.textContent=Ct)),Th("afterSanitizeElements",Ie,null),!1)},bX=function(Ie,Ct,Kt){if(xh&&(Ct==="id"||Ct==="name")&&(Kt in _t||Kt in Cxe))return!1;if(!(Os&&!bu[Ct]&&E(Is,Ct))){if(!(Of&&E(ao,Ct))){if(!vn[Ct]||bu[Ct]){if(!(SX(Ie)&&(mi.tagNameCheck instanceof RegExp&&E(mi.tagNameCheck,Ie)||mi.tagNameCheck instanceof Function&&mi.tagNameCheck(Ie))&&(mi.attributeNameCheck instanceof RegExp&&E(mi.attributeNameCheck,Ct)||mi.attributeNameCheck instanceof Function&&mi.attributeNameCheck(Ct))||Ct==="is"&&mi.allowCustomizedBuiltInElements&&(mi.tagNameCheck instanceof RegExp&&E(mi.tagNameCheck,Kt)||mi.tagNameCheck instanceof Function&&mi.tagNameCheck(Kt))))return!1}else if(!zH[Ct]){if(!E(Fn,x(Kt,Ho,""))){if(!((Ct==="src"||Ct==="xlink:href"||Ct==="href")&&Ie!=="script"&&C(Kt,"data:")===0&&pX[Ie])){if(!(Vb&&!E(ki,x(Kt,Ho,"")))){if(Kt)return!1}}}}}}return!0},SX=function(Ie){return Ie.indexOf("-")>0},vX=function(Ie){let Ct,Kt,Er,Bs;Th("beforeSanitizeAttributes",Ie,null);let{attributes:Su}=Ie;if(!Su)return;let _o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:vn};for(Bs=Su.length;Bs--;){Ct=Su[Bs];let{name:Kd,namespaceURI:qH}=Ct;if(Kt=Kd==="value"?Ct.value:T(Ct.value),Er=Ms(Kd),_o.attrName=Er,_o.attrValue=Kt,_o.keepAttr=!0,_o.forceKeepAttr=void 0,Th("uponSanitizeAttribute",Ie,_o),Kt=_o.attrValue,_o.forceKeepAttr||(YH(Kd,Ie),!_o.keepAttr))continue;if(!Vr&&E(/\/>/i,Kt)){YH(Kd,Ie);continue}Ir&&(Kt=x(Kt,$i," "),Kt=x(Kt,dr," "),Kt=x(Kt,$o," "));let wX=Ms(Ie.nodeName);if(bX(wX,Er,Kt)){if(HI&&(Er==="id"||Er==="name")&&(YH(Kd,Ie),Kt=gxe+Kt),Dr&&typeof ti=="object"&&typeof ti.getAttributeType=="function"&&!qH)switch(ti.getAttributeType(wX,Er)){case"TrustedHTML":Kt=Dr.createHTML(Kt);break;case"TrustedScriptURL":Kt=Dr.createScriptURL(Kt);break}try{qH?Ie.setAttributeNS(qH,Kd,Kt):Ie.setAttribute(Kd,Kt),d(Pe.removed)}catch{}}}Th("afterSanitizeAttributes",Ie,null)},Sxe=function Tn(Ie){let Ct,Kt=TX(Ie);for(Th("beforeSanitizeShadowDOM",Ie,null);Ct=Kt.nextNode();)Th("uponSanitizeShadowNode",Ct,null),!EX(Ct)&&(Ct.content instanceof rt&&Tn(Ct.content),vX(Ct));Th("afterSanitizeShadowDOM",Ie,null)};return Pe.sanitize=function(Tn){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ct,Kt,Er,Bs;if(HH=!Tn,HH&&(Tn="<!-->"),typeof Tn!="string"&&!YI(Tn)){if(typeof Tn.toString!="function")throw S("toString is not a function");if(Tn=Tn.toString(),typeof Tn!="string")throw S("dirty is not a string, aborting")}if(!Pe.isSupported)return Tn;if(xr||WH(Ie),Pe.removed=[],typeof Tn=="string"&&(kb=!1),kb){if(Tn.nodeName){let Kd=Ms(Tn.nodeName);if(!sn[Kd]||oa[Kd])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(Tn instanceof In)Ct=CX("<!---->"),Kt=Ct.ownerDocument.importNode(Tn,!0),Kt.nodeType===1&&Kt.nodeName==="BODY"||Kt.nodeName==="HTML"?Ct=Kt:Ct.appendChild(Kt);else{if(!Pr&&!Ir&&!sa&&Tn.indexOf("<")===-1)return Dr&&ds?Dr.createHTML(Tn):Tn;if(Ct=CX(Tn),!Ct)return Pr?null:ds?Ve:""}Ct&&Rs&&ky(Ct.firstChild);let Su=TX(kb?Tn:Ct);for(;Er=Su.nextNode();)EX(Er)||(Er.content instanceof rt&&Sxe(Er.content),vX(Er));if(kb)return Tn;if(Pr){if(Rf)for(Bs=Ze.call(Ct.ownerDocument);Ct.firstChild;)Bs.appendChild(Ct.firstChild);else Bs=Ct;return(vn.shadowroot||vn.shadowrootmod)&&(Bs=kt.call(ft,Bs,!0)),Bs}let _o=sa?Ct.outerHTML:Ct.innerHTML;return sa&&sn["!doctype"]&&Ct.ownerDocument&&Ct.ownerDocument.doctype&&Ct.ownerDocument.doctype.name&&E(se,Ct.ownerDocument.doctype.name)&&(_o="<!DOCTYPE "+Ct.ownerDocument.doctype.name+`> -`+_o),Ir&&(_o=x(_o,$i," "),_o=x(_o,dr," "),_o=x(_o,$o," ")),Dr&&ds?Dr.createHTML(_o):_o},Pe.setConfig=function(Tn){WH(Tn),xr=!0},Pe.clearConfig=function(){_x=null,xr=!1},Pe.isValidAttribute=function(Tn,Ie,Ct){_x||WH({});let Kt=Ms(Tn),Er=Ms(Ie);return bX(Kt,Er,Ct)},Pe.addHook=function(Tn,Ie){typeof Ie=="function"&&(Jt[Tn]=Jt[Tn]||[],p(Jt[Tn],Ie))},Pe.removeHook=function(Tn){if(Jt[Tn])return d(Jt[Tn])},Pe.removeHooks=function(Tn){Jt[Tn]&&(Jt[Tn]=[])},Pe.removeAllHooks=function(){Jt={}},Pe}var Be=Ee();return Be})});var lre=sc((ypn,cre)=>{cre.exports=DHe;function DHe(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}});var mre=sc((Apn,dre)=>{"use strict";var IHe=lre();dre.exports=PHe;var Ov=1e20;function PHe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,h,A;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),h=0,A=u.length;h<A;h++)c[h]=u[h*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var x=Array(o*s),C=Array(o*s),T=Array(a),E=Array(a),S=Array(a+1),w=Array(a);for(h=0,A=o*s;h<A;h++){var D=c[h];x[h]=D===1?0:D===0?Ov:Math.pow(Math.max(0,.5-D),2),C[h]=D===1?Ov:D===0?0:Math.pow(Math.max(0,D-.5),2)}ure(x,o,s,T,E,w,S),ure(C,o,s,T,E,w,S);var R=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(h=0,A=o*s;h<A;h++)R[h]=IHe(1-((x[h]-C[h])/i+n),0,1);return R}function ure(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(fre(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(fre(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function fre(e,t,n,i,r){n[0]=0,i[0]=-Ov,i[1]=+Ov;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+Ov}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var yre=sc((Npn,jN)=>{function zHe(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,A=15,x=16,C=17,T=0,E=1,S=2,w=3,D=4;function R(_,b){return 55296<=_.charCodeAt(b)&&_.charCodeAt(b)<=56319&&56320<=_.charCodeAt(b+1)&&_.charCodeAt(b+1)<=57343}function O(_,b){b===void 0&&(b=0);var v=_.charCodeAt(b);if(55296<=v&&v<=56319&&b<_.length-1){var I=v,M=_.charCodeAt(b+1);return 56320<=M&&M<=57343?(I-55296)*1024+(M-56320)+65536:I}if(56320<=v&&v<=57343&&b>=1){var I=_.charCodeAt(b-1),M=v;return 55296<=I&&I<=56319?(I-55296)*1024+(M-56320)+65536:M}return v}function L(_,b,v){var I=[_].concat(b).concat([v]),M=I[I.length-2],F=v,k=I.lastIndexOf(h);if(k>1&&I.slice(1,k).every(function(U){return U==i})&&[i,g,C].indexOf(_)==-1)return S;var V=I.lastIndexOf(r);if(V>0&&I.slice(1,V).every(function(U){return U==r})&&[p,r].indexOf(M)==-1)return I.filter(function(U){return U==r}).length%2==1?w:D;if(M==e&&F==t)return T;if(M==n||M==e||M==t)return F==h&&b.every(function(U){return U==i})?S:E;if(F==n||F==e||F==t)return E;if(M==s&&(F==s||F==a||F==u||F==f))return T;if((M==u||M==a)&&(F==a||F==c))return T;if((M==f||M==c)&&F==c)return T;if(F==i||F==A)return T;if(F==o)return T;if(M==p)return T;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,C].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(U){return U==i})&&F==h||M==A&&[x,C].indexOf(F)!=-1?T:b.indexOf(r)!=-1?S:M==r&&F==r?T:E}this.nextBreak=function(_,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=_.length-1)return _.length;for(var v=N(O(_,b)),I=[],M=b+1;M<_.length;M++)if(!R(_,M-1)){var F=N(O(_,M));if(L(v,I,F))return M;I.push(F)}return _.length},this.splitGraphemes=function(_){for(var b=[],v=0,I;(I=this.nextBreak(_,v))<_.length;)b.push(_.slice(v,I)),v=I;return v<_.length&&b.push(_.slice(v)),b},this.iterateGraphemes=function(_){var b=0,v={next:function(){var I,M;return(M=this.nextBreak(_,b))<_.length?(I=_.slice(b,M),b=M,{value:I,done:!1}):b<_.length?(I=_.slice(b),b=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(_){for(var b=0,v=0,I;(I=this.nextBreak(_,v))<_.length;)v=I,b++;return v<_.length&&b++,b};function N(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?A:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?x:128102<=_&&_<=128105?C:d}return this}typeof jN<"u"&&jN.exports&&(jN.exports=zHe)});var eoe=sc((bAn,G6)=>{"use strict";G6.exports=fF;G6.exports.default=fF;function fF(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,o=Zre(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;var a,c,u,f,d,p,g;if(i&&(o=j8e(e,t,o,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;h<r;h+=n)d=e[h],p=e[h+1],d<a&&(a=d),p<c&&(c=p),d>u&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return Gv(o,s,n,a,c,g,0),s}function Zre(e,t,n,i,r){var o,s;if(r===H6(e,t,n,i)>0)for(o=t;o<n;o+=i)s=Jre(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=Jre(o,e[o],e[o+1],s);return s&&dF(s,s.next)&&(jv(s),s=s.next),s}function z0(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(dF(n,n.next)||bo(n.prev,n,n.next)===0)){if(jv(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Gv(e,t,n,i,r,o,s){if(e){!s&&o&&J8e(e,i,r,o);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,o?H8e(e,i,r,o):z8e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),jv(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=G8e(z0(e),t,n),Gv(e,t,n,i,r,o,2)):s===2&&W8e(e,t,n,i,r,o):Gv(z0(e),t,n,i,r,o,1);break}}}}function z8e(e){var t=e.prev,n=e,i=e.next;if(bo(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=r<o?r<s?r:s:o<s?o:s,d=a<c?a<u?a:u:c<u?c:u,p=r>o?r>s?r:s:o>s?o:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&pT(r,a,o,c,s,u,h.x,h.y)&&bo(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function H8e(e,t,n,i){var r=e.prev,o=e,s=e.next;if(bo(r,o,s)>=0)return!1;for(var a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=a<c?a<u?a:u:c<u?c:u,h=f<d?f<p?f:p:d<p?d:p,A=a>c?a>u?a:u:c>u?c:u,x=f>d?f>p?f:p:d>p?d:p,C=k6(g,h,t,n,i),T=k6(A,x,t,n,i),E=e.prevZ,S=e.nextZ;E&&E.z>=C&&S&&S.z<=T;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&pT(a,f,c,d,u,p,E.x,E.y)&&bo(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&pT(a,f,c,d,u,p,S.x,S.y)&&bo(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=C;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==r&&E!==s&&pT(a,f,c,d,u,p,E.x,E.y)&&bo(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==r&&S!==s&&pT(a,f,c,d,u,p,S.x,S.y)&&bo(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function G8e(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!dF(r,o)&&Qre(r,i,i.next,o)&&Wv(r,o)&&Wv(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),jv(i),jv(i.next),i=e=o),i=i.next}while(i!==e);return z0(i)}function W8e(e,t,n,i,r,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&$8e(s,a)){var c=$re(s,a);s=z0(s,s.next),c=z0(c,c.next),Gv(s,t,n,i,r,o,0),Gv(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function j8e(e,t,n,i){var r=[],o,s,a,c,u;for(o=0,s=t.length;o<s;o++)a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Zre(e,a,c,i,!1),u===u.next&&(u.steiner=!0),r.push(Q8e(u));for(r.sort(Y8e),o=0;o<r.length;o++)n=q8e(r[o],n);return n}function Y8e(e,t){return e.x-t.x}function q8e(e,t){var n=X8e(e,t);if(!n)return t;var i=$re(n,e);return z0(i,i.next),z0(n,n.next)}function X8e(e,t){var n=t,i=e.x,r=e.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>o&&(o=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,u=s.x,f=s.y,d=1/0,p;n=s;do i>=n.x&&n.x>=u&&i!==n.x&&pT(r<f?i:o,r,u,f,r<f?o:i,r,n.x,n.y)&&(p=Math.abs(r-n.y)/(i-n.x),Wv(n,e)&&(p<d||p===d&&(n.x>s.x||n.x===s.x&&K8e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function K8e(e,t){return bo(e.prev,e,t.prev)<0&&bo(t.next,e,e.next)<0}function J8e(e,t,n,i){var r=e;do r.z===0&&(r.z=k6(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,Z8e(r)}function Z8e(e){var t,n,i,r,o,s,a,c,u=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<u&&(a++,i=i.nextZ,!!i);t++);for(c=u;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1);return e}function k6(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Q8e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function pT(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function $8e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!e5e(e,t)&&(Wv(e,t)&&Wv(t,e)&&t5e(e,t)&&(bo(e.prev,e,t.prev)||bo(e,t.prev,t))||dF(e,t)&&bo(e.prev,e,e.next)>0&&bo(t.prev,t,t.next)>0)}function bo(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function dF(e,t){return e.x===t.x&&e.y===t.y}function Qre(e,t,n,i){var r=uF(bo(e,t,n)),o=uF(bo(e,t,i)),s=uF(bo(n,i,e)),a=uF(bo(n,i,t));return!!(r!==o&&s!==a||r===0&&lF(e,n,t)||o===0&&lF(e,i,t)||s===0&&lF(n,e,i)||a===0&&lF(n,t,i))}function lF(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function uF(e){return e>0?1:e<0?-1:0}function e5e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Wv(e,t){return bo(e.prev,e,e.next)<0?bo(e,t,e.next)>=0&&bo(e,e.prev,t)>=0:bo(e,t,e.prev)<0||bo(e,e.next,t)<0}function t5e(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function $re(e,t){var n=new z6(e.i,e.x,e.y),i=new z6(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Jre(e,t,n,i){var r=new z6(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function jv(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function z6(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}fF.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(H6(e,0,o,n));if(r)for(var a=0,c=t.length;a<c;a++){var u=t[a]*n,f=a<c-1?t[a+1]*n:e.length;s-=Math.abs(H6(e,u,f,n))}var d=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,g=i[a+1]*n,h=i[a+2]*n;d+=Math.abs((e[p]-e[h])*(e[g+1]-e[p+1])-(e[p]-e[g])*(e[h+1]-e[p+1]))}return s===0&&d===0?0:Math.abs((d-s)/s)};function H6(e,t,n,i){for(var r=0,o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}fF.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var s=0;s<t;s++)n.vertices.push(e[r][o][s]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}});var xle=sc((yW,AW)=>{(function(e,t){typeof yW=="object"&&typeof AW<"u"?AW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(yW,function(){"use strict";function e(x,C,T,E,S){(function w(D,R,O,L,N){for(;L>O;){if(L-O>600){var _=L-O+1,b=R-O+1,v=Math.log(_),I=.5*Math.exp(2*v/3),M=.5*Math.sqrt(v*I*(_-I)/_)*(b-_/2<0?-1:1),F=Math.max(O,Math.floor(R-b*I/_+M)),k=Math.min(L,Math.floor(R+(_-b)*I/_+M));w(D,R,F,k,N)}var V=D[R],G=O,U=L;for(t(D,O,R),N(D[L],V)>0&&t(D,O,L);G<U;){for(t(D,G,U),G++,U--;N(D[G],V)<0;)G++;for(;N(D[U],V)>0;)U--}N(D[O],V)===0?t(D,O,U):t(D,++U,L),U<=R&&(O=U+1),R<=U&&(L=U-1)}})(x,C,T||0,E||x.length-1,S||n)}function t(x,C,T){var E=x[C];x[C]=x[T],x[T]=E}function n(x,C){return x<C?-1:x>C?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(x,C,T){if(!T)return C.indexOf(x);for(var E=0;E<C.length;E++)if(T(x,C[E]))return E;return-1}function o(x,C){s(x,0,x.children.length,C,x)}function s(x,C,T,E,S){S||(S=h(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var w=C;w<T;w++){var D=x.children[w];a(S,x.leaf?E(D):D)}return S}function a(x,C){return x.minX=Math.min(x.minX,C.minX),x.minY=Math.min(x.minY,C.minY),x.maxX=Math.max(x.maxX,C.maxX),x.maxY=Math.max(x.maxY,C.maxY),x}function c(x,C){return x.minX-C.minX}function u(x,C){return x.minY-C.minY}function f(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function d(x){return x.maxX-x.minX+(x.maxY-x.minY)}function p(x,C){return x.minX<=C.minX&&x.minY<=C.minY&&C.maxX<=x.maxX&&C.maxY<=x.maxY}function g(x,C){return C.minX<=x.maxX&&C.minY<=x.maxY&&C.maxX>=x.minX&&C.maxY>=x.minY}function h(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(x,C,T,E,S){for(var w=[C,T];w.length;)if(!((T=w.pop())-(C=w.pop())<=E)){var D=C+Math.ceil((T-C)/E/2)*E;e(x,D,C,T,S),w.push(C,D,D,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var C=this.data,T=[];if(!g(x,C))return T;for(var E=this.toBBox,S=[];C;){for(var w=0;w<C.children.length;w++){var D=C.children[w],R=C.leaf?E(D):D;g(x,R)&&(C.leaf?T.push(D):p(x,R)?this._all(D,T):S.push(D))}C=S.pop()}return T},i.prototype.collides=function(x){var C=this.data;if(!g(x,C))return!1;for(var T=[];C;){for(var E=0;E<C.children.length;E++){var S=C.children[E],w=C.leaf?this.toBBox(S):S;if(g(x,w)){if(C.leaf||p(x,w))return!0;T.push(S)}}C=T.pop()}return!1},i.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var C=0;C<x.length;C++)this.insert(x[C]);return this}var T=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var E=this.data;this.data=T,T=E}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},i.prototype.clear=function(){return this.data=h([]),this},i.prototype.remove=function(x,C){if(!x)return this;for(var T,E,S,w=this.data,D=this.toBBox(x),R=[],O=[];w||R.length;){if(w||(w=R.pop(),E=R[R.length-1],T=O.pop(),S=!0),w.leaf){var L=r(x,w.children,C);if(L!==-1)return w.children.splice(L,1),R.push(w),this._condense(R),this}S||w.leaf||!p(w,D)?E?(T++,w=E.children[T],S=!1):w=null:(R.push(w),O.push(T),T=0,E=w,w=w.children[0])}return this},i.prototype.toBBox=function(x){return x},i.prototype.compareMinX=function(x,C){return x.minX-C.minX},i.prototype.compareMinY=function(x,C){return x.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(x){return this.data=x,this},i.prototype._all=function(x,C){for(var T=[];x;)x.leaf?C.push.apply(C,x.children):T.push.apply(T,x.children),x=T.pop();return C},i.prototype._build=function(x,C,T,E){var S,w=T-C+1,D=this._maxEntries;if(w<=D)return o(S=h(x.slice(C,T+1)),this.toBBox),S;E||(E=Math.ceil(Math.log(w)/Math.log(D)),D=Math.ceil(w/Math.pow(D,E-1))),(S=h([])).leaf=!1,S.height=E;var R=Math.ceil(w/D),O=R*Math.ceil(Math.sqrt(D));A(x,C,T,O,this.compareMinX);for(var L=C;L<=T;L+=O){var N=Math.min(L+O-1,T);A(x,L,N,R,this.compareMinY);for(var _=L;_<=N;_+=R){var b=Math.min(_+R-1,N);S.children.push(this._build(x,_,b,E-1))}}return o(S,this.toBBox),S},i.prototype._chooseSubtree=function(x,C,T,E){for(;E.push(C),!C.leaf&&E.length-1!==T;){for(var S=1/0,w=1/0,D=void 0,R=0;R<C.children.length;R++){var O=C.children[R],L=f(O),N=(_=x,b=O,(Math.max(b.maxX,_.maxX)-Math.min(b.minX,_.minX))*(Math.max(b.maxY,_.maxY)-Math.min(b.minY,_.minY))-L);N<w?(w=N,S=L<S?L:S,D=O):N===w&&L<S&&(S=L,D=O)}C=D||C.children[0]}var _,b;return C},i.prototype._insert=function(x,C,T){var E=T?x:this.toBBox(x),S=[],w=this._chooseSubtree(E,this.data,C,S);for(w.children.push(x),a(w,E);C>=0&&S[C].children.length>this._maxEntries;)this._split(S,C),C--;this._adjustParentBBoxes(E,S,C)},i.prototype._split=function(x,C){var T=x[C],E=T.children.length,S=this._minEntries;this._chooseSplitAxis(T,S,E);var w=this._chooseSplitIndex(T,S,E),D=h(T.children.splice(w,T.children.length-w));D.height=T.height,D.leaf=T.leaf,o(T,this.toBBox),o(D,this.toBBox),C?x[C-1].children.push(D):this._splitRoot(T,D)},i.prototype._splitRoot=function(x,C){this.data=h([x,C]),this.data.height=x.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,C,T){for(var E,S,w,D,R,O,L,N=1/0,_=1/0,b=C;b<=T-C;b++){var v=s(x,0,b,this.toBBox),I=s(x,b,T,this.toBBox),M=(S=v,w=I,D=void 0,R=void 0,O=void 0,L=void 0,D=Math.max(S.minX,w.minX),R=Math.max(S.minY,w.minY),O=Math.min(S.maxX,w.maxX),L=Math.min(S.maxY,w.maxY),Math.max(0,O-D)*Math.max(0,L-R)),F=f(v)+f(I);M<N?(N=M,E=b,_=F<_?F:_):M===N&&F<_&&(_=F,E=b)}return E||T-C},i.prototype._chooseSplitAxis=function(x,C,T){var E=x.leaf?this.compareMinX:c,S=x.leaf?this.compareMinY:u;this._allDistMargin(x,C,T,E)<this._allDistMargin(x,C,T,S)&&x.children.sort(E)},i.prototype._allDistMargin=function(x,C,T,E){x.children.sort(E);for(var S=this.toBBox,w=s(x,0,C,S),D=s(x,T-C,T,S),R=d(w)+d(D),O=C;O<T-C;O++){var L=x.children[O];a(w,x.leaf?S(L):L),R+=d(w)}for(var N=T-C-1;N>=C;N--){var _=x.children[N];a(D,x.leaf?S(_):_),R+=d(D)}return R},i.prototype._adjustParentBBoxes=function(x,C,T){for(var E=T;E>=0;E--)a(C[E],x)},i.prototype._condense=function(x){for(var C=x.length-1,T=void 0;C>=0;C--)x[C].children.length===0?C>0?(T=x[C-1].children).splice(T.indexOf(x[C]),1):this.clear():o(x[C],this.toBBox)},i})});var Sj=sc((exports,module)=>{/*! - * protobuf.js v7.1.0 (c) 2016, daniel wirtz - * compiled thu, 22 sep 2022 17:16:10 utc + */(function(e,t){"use strict";typeof AD=="object"&&AD.exports?AD.exports=t(xK(),CK(),AK()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(EK,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,w){var D=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof r))return D?M?new r(E,w):new r(E):new r;if(E===void 0){if(D)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&D)throw new TypeError("null is not a valid argument for URI");return this.href(E),w!==void 0?this.absoluteTo(w):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,w){var D={},M,B;if(f(w)==="RegExp")D=null;else if(d(w))for(M=0,B=w.length;M<B;M++)D[w[M]]=!0;else D[w]=!0;for(M=0,B=E.length;M<B;M++){var V=D&&D[E[M]]!==void 0||!D&&w.test(E[M]);V&&(E.splice(M,1),B--,M--)}return E}function g(E,w){var D,M;if(d(w)){for(D=0,M=w.length;D<M;D++)if(!g(E,w[D]))return!1;return!0}var B=f(w);for(D=0,M=E.length;D<M;D++)if(B==="RegExp"){if(typeof E[D]=="string"&&E[D].match(w))return!0}else if(E[D]===w)return!0;return!1}function h(E,w){if(!d(E)||!d(w)||E.length!==w.length)return!1;E.sort(),w.sort();for(var D=0,M=E.length;D<M;D++)if(E[D]!==w[D])return!1;return!0}function x(E){var w=/^\/+|\/+$/g;return E.replace(w,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var w=E.nodeName.toLowerCase();if(!(w==="input"&&E.type!=="image"))return r.domAttributes[w]}};function b(E){return escape(E)}function C(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(E,w){var D=r.encode(E+"");return w===void 0&&(w=r.escapeQuerySpace),w?D.replace(/%20/g,"+"):D},r.decodeQuery=function(E,w){E+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?E.replace(/\+/g,"%20"):E)}catch{return E}};var T={encode:"encode",decode:"decode"},A,S=function(E,w){return function(D){try{return r[w](D+"").replace(r.characters[E][w].expression,function(M){return r.characters[E][w].map[M]})}catch{return D}}};for(A in T)r[A+"PathSegment"]=S("pathname",T[A]),r[A+"UrnPathSegment"]=S("urnpath",T[A]);var v=function(E,w,D){return function(M){var B;D?B=function(k){return r[w](r[D](k))}:B=r[w];for(var V=(M+"").split(E),U=0,G=V.length;U<G;U++)V[U]=B(V[U]);return V.join(E)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(E,w){var D;return w||(w={preventInvalidHostname:r.preventInvalidHostname}),E=E.replace(r.leading_whitespace_expression,""),E=E.replace(r.ascii_tab_whitespace,""),D=E.indexOf("#"),D>-1&&(w.fragment=E.substring(D+1)||null,E=E.substring(0,D)),D=E.indexOf("?"),D>-1&&(w.query=E.substring(D+1)||null,E=E.substring(0,D)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(w.protocol=null,E=E.substring(2),E=r.parseAuthority(E,w)):(D=E.indexOf(":"),D>-1&&(w.protocol=E.substring(0,D)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:E.substring(D+1,D+3).replace(/\\/g,"/")==="//"?(E=E.substring(D+3),E=r.parseAuthority(E,w)):(E=E.substring(D+1),w.urn=!0))),w.path=E,w},r.parseHost=function(E,w){E||(E=""),E=E.replace(/\\/g,"/");var D=E.indexOf("/"),M,B;if(D===-1&&(D=E.length),E.charAt(0)==="[")M=E.indexOf("]"),w.hostname=E.substring(1,M)||null,w.port=E.substring(M+2,D)||null,w.port==="/"&&(w.port=null);else{var V=E.indexOf(":"),U=E.indexOf("/"),G=E.indexOf(":",V+1);G!==-1&&(U===-1||G<U)?(w.hostname=E.substring(0,D)||null,w.port=null):(B=E.substring(0,D).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&E.substring(D).charAt(0)!=="/"&&(D++,E="/"+E),w.preventInvalidHostname&&r.ensureValidHostname(w.hostname,w.protocol),w.port&&r.ensureValidPort(w.port),E.substring(D)||"/"},r.parseAuthority=function(E,w){return E=r.parseUserinfo(E,w),r.parseHost(E,w)},r.parseUserinfo=function(E,w){var D=E,M=E.indexOf("\\");M!==-1&&(E=E.replace(/\\/g,"/"));var B=E.indexOf("/"),V=E.lastIndexOf("@",B>-1?B:E.length-1),U;return V>-1&&(B===-1||V<B)?(U=E.substring(0,V).split(":"),w.username=U[0]?r.decode(U[0]):null,U.shift(),w.password=U[0]?r.decode(U.join(":")):null,E=D.substring(V+1)):(w.username=null,w.password=null),E},r.parseQuery=function(E,w){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var D={},M=E.split("&"),B=M.length,V,U,G,k=0;k<B;k++)V=M[k].split("="),U=r.decodeQuery(V.shift(),w),G=V.length?r.decodeQuery(V.join("="),w):null,U!=="__proto__"&&(c.call(D,U)?((typeof D[U]=="string"||D[U]===null)&&(D[U]=[D[U]]),D[U].push(G)):D[U]=G);return D},r.build=function(E){var w="",D=!1;return E.protocol&&(w+=E.protocol+":"),!E.urn&&(w||E.hostname)&&(w+="//",D=!0),w+=r.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&D&&(w+="/"),w+=E.path),typeof E.query=="string"&&E.query&&(w+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(w+="#"+E.fragment),w},r.buildHost=function(E){var w="";if(E.hostname)r.ip6_expression.test(E.hostname)?w+="["+E.hostname+"]":w+=E.hostname;else return"";return E.port&&(w+=":"+E.port),w},r.buildAuthority=function(E){return r.buildUserinfo(E)+r.buildHost(E)},r.buildUserinfo=function(E){var w="";return E.username&&(w+=r.encode(E.username)),E.password&&(w+=":"+r.encode(E.password)),w&&(w+="@"),w},r.buildQuery=function(E,w,D){var M="",B,V,U,G;for(V in E)if(V!=="__proto__"&&c.call(E,V))if(d(E[V]))for(B={},U=0,G=E[V].length;U<G;U++)E[V][U]!==void 0&&B[E[V][U]+""]===void 0&&(M+="&"+r.buildQueryParameter(V,E[V][U],D),w!==!0&&(B[E[V][U]+""]=!0));else E[V]!==void 0&&(M+="&"+r.buildQueryParameter(V,E[V],D));return M.substring(1)},r.buildQueryParameter=function(E,w,D){return r.encodeQuery(E,D)+(w!==null?"="+r.encodeQuery(w,D):"")},r.addQuery=function(E,w,D){if(typeof w=="object")for(var M in w)c.call(w,M)&&r.addQuery(E,M,w[M]);else if(typeof w=="string"){if(E[w]===void 0){E[w]=D;return}else typeof E[w]=="string"&&(E[w]=[E[w]]);d(D)||(D=[D]),E[w]=(E[w]||[]).concat(D)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(E,w,D){if(typeof w=="object")for(var M in w)c.call(w,M)&&r.setQuery(E,M,w[M]);else if(typeof w=="string")E[w]=D===void 0?null:D;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(E,w,D){var M,B,V;if(d(w))for(M=0,B=w.length;M<B;M++)E[w[M]]=void 0;else if(f(w)==="RegExp")for(V in E)w.test(V)&&(E[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&r.removeQuery(E,V,w[V]);else if(typeof w=="string")D!==void 0?f(D)==="RegExp"?!d(E[w])&&D.test(E[w])?E[w]=void 0:E[w]=p(E[w],D):E[w]===String(D)&&(!d(D)||D.length===1)?E[w]=void 0:d(E[w])&&(E[w]=p(E[w],D)):E[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(E,w,D,M){switch(f(w)){case"String":break;case"RegExp":for(var B in E)if(c.call(E,B)&&w.test(B)&&(D===void 0||r.hasQuery(E,B,D)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!r.hasQuery(E,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(D)){case"Undefined":return w in E;case"Boolean":var U=!!(d(E[w])?E[w].length:E[w]);return D===U;case"Function":return!!D(E[w],w,E);case"Array":if(!d(E[w]))return!1;var G=M?g:h;return G(E[w],D);case"RegExp":return d(E[w])?M?g(E[w],D):!1:!!(E[w]&&E[w].match(D));case"Number":D=String(D);case"String":return d(E[w])?M?g(E[w],D):!1:E[w]===D;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var E=[],w=[],D=0,M=0;M<arguments.length;M++){var B=new r(arguments[M]);E.push(B);for(var V=B.segment(),U=0;U<V.length;U++)typeof V[U]=="string"&&w.push(V[U]),V[U]&&D++}if(!w.length||!D)return new r("");var G=new r("").segment(w);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},r.commonPath=function(E,w){var D=Math.min(E.length,w.length),M;for(M=0;M<D;M++)if(E.charAt(M)!==w.charAt(M)){M--;break}return M<1?E.charAt(0)===w.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(M)!=="/"||w.charAt(M)!=="/")&&(M=E.substring(0,M).lastIndexOf("/")),E.substring(0,M+1))},r.withinString=function(E,w,D){D||(D={});var M=D.start||r.findUri.start,B=D.end||r.findUri.end,V=D.trim||r.findUri.trim,U=D.parens||r.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var k=M.exec(E);if(!k)break;var Y=k.index;if(D.ignoreHtml){var j=E.slice(Math.max(Y-3,0),Y);if(j&&G.test(j))continue}for(var $=Y+E.slice(Y).search(B),W=E.slice(Y,$),K=-1;;){var J=U.exec(W);if(!J)break;var he=J.index+J[0].length;K=Math.max(K,he)}if(K>-1?W=W.slice(0,K)+W.slice(K).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(D.ignore&&D.ignore.test(W))){$=Y+W.length;var ge=w(W,Y,$,E);if(ge===void 0){M.lastIndex=$;continue}ge=String(ge),E=E.slice(0,Y)+ge+E.slice($),M.lastIndex=Y+ge.length}}return M.lastIndex=0,E},r.ensureValidHostname=function(E,w){var D=!!E,M=!!w,B=!1;if(M&&(B=g(r.hostProtocols,w)),B&&!D)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var w=Number(E);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(E){return function(w,D){return w===void 0?this._parts[E]||"":(this._parts[E]=w||null,this.build(!D),this)}}function O(E,w){return function(D,M){return D===void 0?this._parts[E]||"":(D!==null&&(D=D+"",D.charAt(0)===w&&(D=D.substring(1))),this._parts[E]=D,this.build(!M),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(E,w){var D=this.query(E,w);return typeof D=="string"&&D.length?"?"+D:D},a.hash=function(E,w){var D=this.fragment(E,w);return typeof D=="string"&&D.length?"#"+D:D},a.pathname=function(E,w){if(E===void 0||E===!0){var D=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(D):D}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!w),this},a.path=a.pathname,a.href=function(E,w){var D;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var M=E instanceof r,B=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var V=r.getDomAttribute(E);E=E[V]||"",B=!1}if(!M&&B&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(M||B){var U=M?E._parts:E;for(D in U)D!=="query"&&c.call(this._parts,D)&&(this._parts[D]=U[D]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(E){var w=!1,D=!1,M=!1,B=!1,V=!1,U=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,D=r.ip4_expression.test(this._parts.hostname),M=r.ip6_expression.test(this._parts.hostname),w=D||M,B=!w,V=B&&n&&n.has(this._parts.hostname),U=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return D;case"ip6":case"ipv6":case"inet6":return M;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,N=a.port,F=a.hostname;a.protocol=function(E,w){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,E,w)},a.scheme=a.protocol,a.port=function(E,w){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),N.call(this,E,w))},a.hostname=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var D={preventInvalidHostname:this._parts.preventInvalidHostname},M=r.parseHost(E,D);if(M!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=D.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return F.call(this,E,w)},a.origin=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var D=this.protocol(),M=this.authority();return M?(D?D+"://":"")+this.authority():""}else{var B=r(E);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var D=r.parseHost(E,this._parts);if(D!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var D=r.parseAuthority(E,this._parts);if(D!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var D=r.buildUserinfo(this._parts);return D&&D.substring(0,D.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!w),this},a.resource=function(E,w){var D;return E===void 0?this.path()+this.search()+this.hash():(D=r.parse(E),this._parts.path=D.path,this._parts.query=D.query,this._parts.fragment=D.fragment,this.build(!w),this)},a.subdomain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,D)||""}else{var M=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(B));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,E),this.build(!w),this}},a.domain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.match(/\./g);if(D&&D.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,E)}return this.build(!w),this}},a.tld=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(D+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var B;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var D=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,D)||(this._parts.hostname?"/":"");return E?r.decodePath(M):M}else{var B=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,B),U=new RegExp("^"+u(V));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(U,E),this.build(!w),this}},a.filename=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var D=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(D+1);return E?r.decodePathSegment(M):M}else{var B=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(B=!0);var V=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(V,E),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var D=this.filename(),M=D.lastIndexOf("."),B,V;return M===-1?"":(B=D.substring(M+1),V=/^[a-z0-9%]+$/i.test(B)?B:"",E?r.decodePathSegment(V):V)}else{E.charAt(0)==="."&&(E=E.substring(1));var U=this.suffix(),G;if(U)E?G=new RegExp(u(U)+"$"):G=new RegExp(u("."+U)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return G&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(G,E)),this.build(!w),this}},a.segment=function(E,w,D){var M=this._parts.urn?":":"/",B=this.path(),V=B.substring(0,1)==="/",U=B.split(M);if(E!==void 0&&typeof E!="number"&&(D=w,w=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(V&&U.shift(),E<0&&(E=Math.max(U.length+E,0)),w===void 0)return E===void 0?U:U[E];if(E===null||U[E]===void 0)if(d(w)){U=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),U[U.length-1]===""?U[U.length-1]=w:U.push(w));else w?U[E]=x(w):U.splice(E,1);return V&&U.unshift(""),this.path(U.join(M),D)},a.segmentCoded=function(E,w,D){var M,B,V;if(typeof E!="number"&&(D=w,w=E,E=void 0),w===void 0){if(M=this.segment(E,w,D),!d(M))M=M!==void 0?r.decode(M):void 0;else for(B=0,V=M.length;B<V;B++)M[B]=r.decode(M[B]);return M}if(!d(w))w=typeof w=="string"||w instanceof String?r.encode(w):w;else for(B=0,V=w.length;B<V;B++)w[B]=r.encode(w[B]);return this.segment(E,w,D)};var _=a.query;return a.query=function(E,w){if(E===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var D=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=E.call(this,D);return this._parts.query=r.buildQuery(M||D,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=r.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,E,w)},a.setQuery=function(E,w,D){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)M[E]=w!==void 0?w:null;else if(typeof E=="object")for(var B in E)c.call(E,B)&&(M[B]=E[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(D=w),this.build(!D),this},a.addQuery=function(E,w,D){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(M,E,w===void 0?null:w),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(D=w),this.build(!D),this},a.removeQuery=function(E,w,D){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(M,E,w),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(D=w),this.build(!D),this},a.hasQuery=function(E,w,D){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(M,E,w,D)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;w=r.recodePath(w);var D,M="",B,V;for(w.charAt(0)!=="/"&&(D=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),D&&(M=w.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}V=w.substring(0,B).lastIndexOf("/"),V===-1&&(V=B),w=w.substring(0,V)+w.substring(B+3)}return D&&this.is("relative")&&(w=M+w.substring(1)),this._parts.path=w,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=r.encode,w=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.unicode=function(){var E=r.encode,w=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var w="";if(E._parts.protocol&&(w+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(w+=e.toUnicode(E._parts.hostname),E._parts.port&&(w+=":"+E._parts.port)):w+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(w+="/"),w+=E.path(!0),E._parts.query){for(var D="",M=0,B=E._parts.query.split("&"),V=B.length;M<V;M++){var U=(B[M]||"").split("=");D+="&"+r.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(D+="="+r.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+D.substring(1)}return w+=r.decodeQuery(E.hash(),!0),w},a.absoluteTo=function(E){var w=this.clone(),D=["protocol","username","password","hostname","port"],M,B,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof r||(E=new r(E)),w._parts.protocol||(w._parts.protocol=E._parts.protocol,this._parts.hostname))return w;for(B=0;V=D[B];B++)w._parts[V]=E._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(M=E.directory(),M=M||(E.path().indexOf("/")===0?"/":""),w._parts.path=(M?M+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=E._parts.path,w._parts.query||(w._parts.query=E._parts.query)),w.build(),w},a.relativeTo=function(E){var w=this.clone().normalize(),D,M,B,V,U;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new r(E).normalize(),D=w._parts,M=E._parts,V=w.path(),U=E.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(D.protocol===M.protocol&&(D.protocol=null),D.username!==M.username||D.password!==M.password||D.protocol!==null||D.username!==null||D.password!==null)return w.build();if(D.hostname===M.hostname&&D.port===M.port)D.hostname=null,D.port=null;else return w.build();if(V===U)return D.path="",w.build();if(B=r.commonPath(V,U),!B)return w.build();var G=M.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return D.path=G+D.path.substring(B.length)||"./",w.build()},a.equals=function(E){var w=this.clone(),D=new r(E),M={},B={},V={},U,G,k;if(w.normalize(),D.normalize(),w.toString()===D.toString())return!0;if(U=w.query(),G=D.query(),w.query(""),D.query(""),w.toString()!==D.toString()||U.length!==G.length)return!1;M=r.parseQuery(U,this._parts.escapeQuerySpace),B=r.parseQuery(G,this._parts.escapeQuerySpace);for(k in M)if(c.call(M,k)){if(d(M[k])){if(!h(M[k],B[k]))return!1}else if(M[k]!==B[k])return!1;V[k]=!0}for(k in B)if(c.call(B,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},r})});var OQ=Vc((o5,r5)=>{/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */(function(e,t){typeof o5=="object"&&typeof r5<"u"?r5.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(o5,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;c||(c=function(Oe,ft,Ct){return Oe.apply(ft,Ct)}),r||(r=function(Oe){return Oe}),s||(s=function(Oe){return Oe}),u||(u=function(Oe,ft){return new Oe(...ft)});let f=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),g=v(String.prototype.toLowerCase),h=v(String.prototype.toString),x=v(String.prototype.match),b=v(String.prototype.replace),C=v(String.prototype.indexOf),T=v(String.prototype.trim),A=v(RegExp.prototype.test),S=I(TypeError);function v(ze){return function(Oe){for(var ft=arguments.length,Ct=new Array(ft>1?ft-1:0),ot=1;ot<ft;ot++)Ct[ot-1]=arguments[ot];return c(ze,Oe,Ct)}}function I(ze){return function(){for(var Oe=arguments.length,ft=new Array(Oe),Ct=0;Ct<Oe;Ct++)ft[Ct]=arguments[Ct];return u(ze,ft)}}function O(ze,Oe,ft){var Ct;ft=(Ct=ft)!==null&&Ct!==void 0?Ct:g,t&&t(ze,null);let ot=Oe.length;for(;ot--;){let sn=Oe[ot];if(typeof sn=="string"){let wn=ft(sn);wn!==sn&&(n(Oe)||(Oe[ot]=wn),sn=wn)}ze[sn]=!0}return ze}function R(ze){let Oe=a(null);for(let[ft,Ct]of e(ze))Oe[ft]=Ct;return Oe}function N(ze,Oe){for(;ze!==null;){let Ct=o(ze,Oe);if(Ct){if(Ct.get)return v(Ct.get);if(typeof Ct.value=="function")return v(Ct.value)}ze=i(ze)}function ft(Ct){return console.warn("fallback value for",Ct),null}return ft}let F=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),E=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),w=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=r(["#text"]),V=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),U=r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),G=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),k=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),j=s(/<%[\w\W]*|[\w\W]*%>/gm),$=s(/\${[\w\W]*}/gm),W=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),J=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),he=s(/^(?:\w+script|data):/i),ge=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=s(/^html$/i);var pe=Object.freeze({__proto__:null,MUSTACHE_EXPR:Y,ERB_EXPR:j,TMPLIT_EXPR:$,DATA_ATTR:W,ARIA_ATTR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ge,DOCTYPE_NAME:se});let xe=()=>typeof window>"u"?null:window,De=function(Oe,ft){if(typeof Oe!="object"||typeof Oe.createPolicy!="function")return null;let Ct=null,ot="data-tt-policy-suffix";ft&&ft.hasAttribute(ot)&&(Ct=ft.getAttribute(ot));let sn="dompurify"+(Ct?"#"+Ct:"");try{return Oe.createPolicy(sn,{createHTML(wn){return wn},createScriptURL(wn){return wn}})}catch{return console.warn("TrustedTypes policy "+sn+" could not be created."),null}};function Se(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe(),Oe=An=>Se(An);if(Oe.version="3.0.3",Oe.removed=[],!ze||!ze.document||ze.document.nodeType!==9)return Oe.isSupported=!1,Oe;let ft=ze.document,Ct=ft.currentScript,{document:ot}=ze,{DocumentFragment:sn,HTMLTemplateElement:wn,Node:zt,Element:Bt,NodeFilter:be,NamedNodeMap:Ee=ze.NamedNodeMap||ze.MozNamedAttrMap,HTMLFormElement:at,DOMParser:Jt,trustedTypes:ri}=ze,Ze=Bt.prototype,zr=N(Ze,"cloneNode"),Hr=N(Ze,"nextSibling"),sa=N(Ze,"childNodes"),$r=N(Ze,"parentNode");if(typeof wn=="function"){let An=ot.createElement("template");An.content&&An.content.ownerDocument&&(ot=An.content.ownerDocument)}let Ne,rt="",{implementation:$e,createNodeIterator:He,createDocumentFragment:mt,getElementsByTagName:Ut}=ot,{importNode:xn}=ft,Zn={};Oe.isSupported=typeof e=="function"&&typeof $r=="function"&&$e&&$e.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:To,ERB_EXPR:Qr,TMPLIT_EXPR:es,DATA_ATTR:ar,ARIA_ATTR:zi,IS_SCRIPT_OR_DATA:ts,ATTR_WHITESPACE:Wn}=pe,{IS_ALLOWED_URI:Fn}=pe,fn=null,pi=O({},[...F,..._,...E,...D,...B]),Hi=null,ns=O({},[...V,...U,...G,...k]),ao=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),aa=null,Of=null,Rf=!0,Uc=!0,i_=!1,cr=!0,Po=!1,ca=!1,Gi=!1,lr=!1,Os=!1,bh=!1,Rs=!1,o_=!0,Y1=!1,Mbe="user-content-",ZH=!0,WE=!1,pb={},_b=null,TX=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),AX=null,EX=O({},["audio","video","img","source","image","track"]),$H=null,SX=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),X1="http://www.w3.org/1998/Math/MathML",K1="http://www.w3.org/2000/svg",Ch="http://www.w3.org/1999/xhtml",gb=Ch,QH=!1,eG=null,Lbe=O({},[X1,K1,Ch],h),zy,Nbe=["application/xhtml+xml","text/html"],Fbe="text/html",Ms,yb=null,Bbe=ot.createElement("form"),vX=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},tG=function(Ie){if(!(yb&&yb===Ie)){if((!Ie||typeof Ie!="object")&&(Ie={}),Ie=R(Ie),zy=Nbe.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?zy=Fbe:zy=Ie.PARSER_MEDIA_TYPE,Ms=zy==="application/xhtml+xml"?h:g,fn="ALLOWED_TAGS"in Ie?O({},Ie.ALLOWED_TAGS,Ms):pi,Hi="ALLOWED_ATTR"in Ie?O({},Ie.ALLOWED_ATTR,Ms):ns,eG="ALLOWED_NAMESPACES"in Ie?O({},Ie.ALLOWED_NAMESPACES,h):Lbe,$H="ADD_URI_SAFE_ATTR"in Ie?O(R(SX),Ie.ADD_URI_SAFE_ATTR,Ms):SX,AX="ADD_DATA_URI_TAGS"in Ie?O(R(EX),Ie.ADD_DATA_URI_TAGS,Ms):EX,_b="FORBID_CONTENTS"in Ie?O({},Ie.FORBID_CONTENTS,Ms):TX,aa="FORBID_TAGS"in Ie?O({},Ie.FORBID_TAGS,Ms):{},Of="FORBID_ATTR"in Ie?O({},Ie.FORBID_ATTR,Ms):{},pb="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,Rf=Ie.ALLOW_ARIA_ATTR!==!1,Uc=Ie.ALLOW_DATA_ATTR!==!1,i_=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,cr=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Po=Ie.SAFE_FOR_TEMPLATES||!1,ca=Ie.WHOLE_DOCUMENT||!1,Os=Ie.RETURN_DOM||!1,bh=Ie.RETURN_DOM_FRAGMENT||!1,Rs=Ie.RETURN_TRUSTED_TYPE||!1,lr=Ie.FORCE_BODY||!1,o_=Ie.SANITIZE_DOM!==!1,Y1=Ie.SANITIZE_NAMED_PROPS||!1,ZH=Ie.KEEP_CONTENT!==!1,WE=Ie.IN_PLACE||!1,Fn=Ie.ALLOWED_URI_REGEXP||J,gb=Ie.NAMESPACE||Ch,ao=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&vX(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ao.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&vX(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ao.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ao.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Po&&(Uc=!1),bh&&(Os=!0),pb&&(fn=O({},[...B]),Hi=[],pb.html===!0&&(O(fn,F),O(Hi,V)),pb.svg===!0&&(O(fn,_),O(Hi,U),O(Hi,k)),pb.svgFilters===!0&&(O(fn,E),O(Hi,U),O(Hi,k)),pb.mathMl===!0&&(O(fn,D),O(Hi,G),O(Hi,k))),Ie.ADD_TAGS&&(fn===pi&&(fn=R(fn)),O(fn,Ie.ADD_TAGS,Ms)),Ie.ADD_ATTR&&(Hi===ns&&(Hi=R(Hi)),O(Hi,Ie.ADD_ATTR,Ms)),Ie.ADD_URI_SAFE_ATTR&&O($H,Ie.ADD_URI_SAFE_ATTR,Ms),Ie.FORBID_CONTENTS&&(_b===TX&&(_b=R(_b)),O(_b,Ie.FORBID_CONTENTS,Ms)),ZH&&(fn["#text"]=!0),ca&&O(fn,["html","head","body"]),fn.table&&(O(fn,["tbody"]),delete aa.tbody),Ie.TRUSTED_TYPES_POLICY){if(typeof Ie.TRUSTED_TYPES_POLICY.createHTML!="function")throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ie.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Ne=Ie.TRUSTED_TYPES_POLICY,rt=Ne.createHTML("")}else Ne===void 0&&(Ne=De(ri,Ct)),Ne!==null&&typeof rt=="string"&&(rt=Ne.createHTML(""));r&&r(Ie),yb=Ie}},wX=O({},["mi","mo","mn","ms","mtext"]),IX=O({},["foreignobject","desc","title","annotation-xml"]),kbe=O({},["title","style","font","a","script"]),J1=O({},_);O(J1,E),O(J1,w);let nG=O({},D);O(nG,M);let Ube=function(Ie){let bt=$r(Ie);(!bt||!bt.tagName)&&(bt={namespaceURI:gb,tagName:"template"});let Kt=g(Ie.tagName),So=g(bt.tagName);return eG[Ie.namespaceURI]?Ie.namespaceURI===K1?bt.namespaceURI===Ch?Kt==="svg":bt.namespaceURI===X1?Kt==="svg"&&(So==="annotation-xml"||wX[So]):!!J1[Kt]:Ie.namespaceURI===X1?bt.namespaceURI===Ch?Kt==="math":bt.namespaceURI===K1?Kt==="math"&&IX[So]:!!nG[Kt]:Ie.namespaceURI===Ch?bt.namespaceURI===K1&&!IX[So]||bt.namespaceURI===X1&&!wX[So]?!1:!nG[Kt]&&(kbe[Kt]||!J1[Kt]):!!(zy==="application/xhtml+xml"&&eG[Ie.namespaceURI]):!1},Hy=function(Ie){p(Oe.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},iG=function(Ie,bt){try{p(Oe.removed,{attribute:bt.getAttributeNode(Ie),from:bt})}catch{p(Oe.removed,{attribute:null,from:bt})}if(bt.removeAttribute(Ie),Ie==="is"&&!Hi[Ie])if(Os||bh)try{Hy(bt)}catch{}else try{bt.setAttribute(Ie,"")}catch{}},DX=function(Ie){let bt,Kt;if(lr)Ie="<remove></remove>"+Ie;else{let Su=x(Ie,/^[\r\n\t ]+/);Kt=Su&&Su[0]}zy==="application/xhtml+xml"&&gb===Ch&&(Ie='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ie+"</body></html>");let So=Ne?Ne.createHTML(Ie):Ie;if(gb===Ch)try{bt=new Jt().parseFromString(So,zy)}catch{}if(!bt||!bt.documentElement){bt=$e.createDocument(gb,"template",null);try{bt.documentElement.innerHTML=QH?rt:So}catch{}}let Ls=bt.body||bt.documentElement;return Ie&&Kt&&Ls.insertBefore(ot.createTextNode(Kt),Ls.childNodes[0]||null),gb===Ch?Ut.call(bt,ca?"html":"body")[0]:ca?bt.documentElement:Ls},PX=function(Ie){return He.call(Ie.ownerDocument||Ie,Ie,be.SHOW_ELEMENT|be.SHOW_COMMENT|be.SHOW_TEXT,null,!1)},Vbe=function(Ie){return Ie instanceof at&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof Ee)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},Z1=function(Ie){return typeof zt=="object"?Ie instanceof zt:Ie&&typeof Ie=="object"&&typeof Ie.nodeType=="number"&&typeof Ie.nodeName=="string"},Th=function(Ie,bt,Kt){Zn[Ie]&&f(Zn[Ie],So=>{So.call(Oe,bt,Kt,yb)})},OX=function(Ie){let bt;if(Th("beforeSanitizeElements",Ie,null),Vbe(Ie))return Hy(Ie),!0;let Kt=Ms(Ie.nodeName);if(Th("uponSanitizeElement",Ie,{tagName:Kt,allowedTags:fn}),Ie.hasChildNodes()&&!Z1(Ie.firstElementChild)&&(!Z1(Ie.content)||!Z1(Ie.content.firstElementChild))&&A(/<[/\w]/g,Ie.innerHTML)&&A(/<[/\w]/g,Ie.textContent))return Hy(Ie),!0;if(!fn[Kt]||aa[Kt]){if(!aa[Kt]&&MX(Kt)&&(ao.tagNameCheck instanceof RegExp&&A(ao.tagNameCheck,Kt)||ao.tagNameCheck instanceof Function&&ao.tagNameCheck(Kt)))return!1;if(ZH&&!_b[Kt]){let So=$r(Ie)||Ie.parentNode,Ls=sa(Ie)||Ie.childNodes;if(Ls&&So){let Su=Ls.length;for(let yr=Su-1;yr>=0;--yr)So.insertBefore(zr(Ls[yr],!0),Hr(Ie))}}return Hy(Ie),!0}return Ie instanceof Bt&&!Ube(Ie)||(Kt==="noscript"||Kt==="noembed")&&A(/<\/no(script|embed)/i,Ie.innerHTML)?(Hy(Ie),!0):(Po&&Ie.nodeType===3&&(bt=Ie.textContent,bt=b(bt,To," "),bt=b(bt,Qr," "),bt=b(bt,es," "),Ie.textContent!==bt&&(p(Oe.removed,{element:Ie.cloneNode()}),Ie.textContent=bt)),Th("afterSanitizeElements",Ie,null),!1)},RX=function(Ie,bt,Kt){if(o_&&(bt==="id"||bt==="name")&&(Kt in ot||Kt in Bbe))return!1;if(!(Uc&&!Of[bt]&&A(ar,bt))){if(!(Rf&&A(zi,bt))){if(!Hi[bt]||Of[bt]){if(!(MX(Ie)&&(ao.tagNameCheck instanceof RegExp&&A(ao.tagNameCheck,Ie)||ao.tagNameCheck instanceof Function&&ao.tagNameCheck(Ie))&&(ao.attributeNameCheck instanceof RegExp&&A(ao.attributeNameCheck,bt)||ao.attributeNameCheck instanceof Function&&ao.attributeNameCheck(bt))||bt==="is"&&ao.allowCustomizedBuiltInElements&&(ao.tagNameCheck instanceof RegExp&&A(ao.tagNameCheck,Kt)||ao.tagNameCheck instanceof Function&&ao.tagNameCheck(Kt))))return!1}else if(!$H[bt]){if(!A(Fn,b(Kt,Wn,""))){if(!((bt==="src"||bt==="xlink:href"||bt==="href")&&Ie!=="script"&&C(Kt,"data:")===0&&AX[Ie])){if(!(i_&&!A(ts,b(Kt,Wn,"")))){if(Kt)return!1}}}}}}return!0},MX=function(Ie){return Ie.indexOf("-")>0},LX=function(Ie){let bt,Kt,So,Ls;Th("beforeSanitizeAttributes",Ie,null);let{attributes:Su}=Ie;if(!Su)return;let yr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Hi};for(Ls=Su.length;Ls--;){bt=Su[Ls];let{name:Kd,namespaceURI:oG}=bt;if(Kt=Kd==="value"?bt.value:T(bt.value),So=Ms(Kd),yr.attrName=So,yr.attrValue=Kt,yr.keepAttr=!0,yr.forceKeepAttr=void 0,Th("uponSanitizeAttribute",Ie,yr),Kt=yr.attrValue,yr.forceKeepAttr||(iG(Kd,Ie),!yr.keepAttr))continue;if(!cr&&A(/\/>/i,Kt)){iG(Kd,Ie);continue}Po&&(Kt=b(Kt,To," "),Kt=b(Kt,Qr," "),Kt=b(Kt,es," "));let NX=Ms(Ie.nodeName);if(RX(NX,So,Kt)){if(Y1&&(So==="id"||So==="name")&&(iG(Kd,Ie),Kt=Mbe+Kt),Ne&&typeof ri=="object"&&typeof ri.getAttributeType=="function"&&!oG)switch(ri.getAttributeType(NX,So)){case"TrustedHTML":{Kt=Ne.createHTML(Kt);break}case"TrustedScriptURL":{Kt=Ne.createScriptURL(Kt);break}}try{oG?Ie.setAttributeNS(oG,Kd,Kt):Ie.setAttribute(Kd,Kt),d(Oe.removed)}catch{}}}Th("afterSanitizeAttributes",Ie,null)},zbe=function An(Ie){let bt,Kt=PX(Ie);for(Th("beforeSanitizeShadowDOM",Ie,null);bt=Kt.nextNode();)Th("uponSanitizeShadowNode",bt,null),!OX(bt)&&(bt.content instanceof sn&&An(bt.content),LX(bt));Th("afterSanitizeShadowDOM",Ie,null)};return Oe.sanitize=function(An){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bt,Kt,So,Ls;if(QH=!An,QH&&(An="<!-->"),typeof An!="string"&&!Z1(An))if(typeof An.toString=="function"){if(An=An.toString(),typeof An!="string")throw S("dirty is not a string, aborting")}else throw S("toString is not a function");if(!Oe.isSupported)return An;if(Gi||tG(Ie),Oe.removed=[],typeof An=="string"&&(WE=!1),WE){if(An.nodeName){let Kd=Ms(An.nodeName);if(!fn[Kd]||aa[Kd])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(An instanceof zt)bt=DX("<!---->"),Kt=bt.ownerDocument.importNode(An,!0),Kt.nodeType===1&&Kt.nodeName==="BODY"||Kt.nodeName==="HTML"?bt=Kt:bt.appendChild(Kt);else{if(!Os&&!Po&&!ca&&An.indexOf("<")===-1)return Ne&&Rs?Ne.createHTML(An):An;if(bt=DX(An),!bt)return Os?null:Rs?rt:""}bt&&lr&&Hy(bt.firstChild);let Su=PX(WE?An:bt);for(;So=Su.nextNode();)OX(So)||(So.content instanceof sn&&zbe(So.content),LX(So));if(WE)return An;if(Os){if(bh)for(Ls=mt.call(bt.ownerDocument);bt.firstChild;)Ls.appendChild(bt.firstChild);else Ls=bt;return(Hi.shadowroot||Hi.shadowrootmod)&&(Ls=xn.call(ft,Ls,!0)),Ls}let yr=ca?bt.outerHTML:bt.innerHTML;return ca&&fn["!doctype"]&&bt.ownerDocument&&bt.ownerDocument.doctype&&bt.ownerDocument.doctype.name&&A(se,bt.ownerDocument.doctype.name)&&(yr="<!DOCTYPE "+bt.ownerDocument.doctype.name+`> +`+yr),Po&&(yr=b(yr,To," "),yr=b(yr,Qr," "),yr=b(yr,es," ")),Ne&&Rs?Ne.createHTML(yr):yr},Oe.setConfig=function(An){tG(An),Gi=!0},Oe.clearConfig=function(){yb=null,Gi=!1},Oe.isValidAttribute=function(An,Ie,bt){yb||tG({});let Kt=Ms(An),So=Ms(Ie);return RX(Kt,So,bt)},Oe.addHook=function(An,Ie){typeof Ie=="function"&&(Zn[An]=Zn[An]||[],p(Zn[An],Ie))},Oe.removeHook=function(An){if(Zn[An])return d(Zn[An])},Oe.removeHooks=function(An){Zn[An]&&(Zn[An]=[])},Oe.removeAllHooks=function(){Zn={}},Oe}var we=Se();return we})});var jie=Vc((ehn,Wie)=>{"use strict";Wie.exports=Zze;var Rv=1e20;function Zze(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,g,h,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),h=0,x=Math.floor(u.length/f);h<x;h++)c[h]=u[h*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),C=Array(r*s),T=Array(a),A=Array(a),S=Array(a+1),v=Array(a);for(h=0,x=r*s;h<x;h++){var I=c[h];b[h]=I===1?0:I===0?Rv:Math.pow(Math.max(0,.5-I),2),C[h]=I===1?Rv:I===0?0:Math.pow(Math.max(0,I-.5),2)}Hie(b,r,s,T,A,v,S),Hie(C,r,s,T,A,v,S);var O=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(h=0,x=r*s;h<x;h++)O[h]=Math.min(Math.max(1-((b[h]-C[h])/i+n),0),1);return O}function Hie(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Gie(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Gie(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Gie(e,t,n,i,o){n[0]=0,i[0]=-Rv,i[1]=+Rv;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+Rv}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Jie=Vc((ghn,GF)=>{function c4e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,x=15,b=16,C=17,T=0,A=1,S=2,v=3,I=4;function O(_,E){return 55296<=_.charCodeAt(E)&&_.charCodeAt(E)<=56319&&56320<=_.charCodeAt(E+1)&&_.charCodeAt(E+1)<=57343}function R(_,E){E===void 0&&(E=0);var w=_.charCodeAt(E);if(55296<=w&&w<=56319&&E<_.length-1){var D=w,M=_.charCodeAt(E+1);return 56320<=M&&M<=57343?(D-55296)*1024+(M-56320)+65536:D}if(56320<=w&&w<=57343&&E>=1){var D=_.charCodeAt(E-1),M=w;return 55296<=D&&D<=56319?(D-55296)*1024+(M-56320)+65536:M}return w}function N(_,E,w){var D=[_].concat(E).concat([w]),M=D[D.length-2],B=w,V=D.lastIndexOf(h);if(V>1&&D.slice(1,V).every(function(k){return k==i})&&[i,g,C].indexOf(_)==-1)return S;var U=D.lastIndexOf(o);if(U>0&&D.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(M)==-1)return D.filter(function(k){return k==o}).length%2==1?v:I;if(M==e&&B==t)return T;if(M==n||M==e||M==t)return B==h&&E.every(function(k){return k==i})?S:A;if(B==n||B==e||B==t)return A;if(M==s&&(B==s||B==a||B==u||B==f))return T;if((M==u||M==a)&&(B==a||B==c))return T;if((M==f||M==c)&&B==c)return T;if(B==i||B==x)return T;if(B==r)return T;if(M==p)return T;var G=D.indexOf(i)!=-1?D.lastIndexOf(i)-1:D.length-2;return[g,C].indexOf(D[G])!=-1&&D.slice(G+1,-1).every(function(k){return k==i})&&B==h||M==x&&[b,C].indexOf(B)!=-1?T:E.indexOf(o)!=-1?S:M==o&&B==o?T:A}this.nextBreak=function(_,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=_.length-1)return _.length;for(var w=F(R(_,E)),D=[],M=E+1;M<_.length;M++)if(!O(_,M-1)){var B=F(R(_,M));if(N(w,D,B))return M;D.push(B)}return _.length},this.splitGraphemes=function(_){for(var E=[],w=0,D;(D=this.nextBreak(_,w))<_.length;)E.push(_.slice(w,D)),w=D;return w<_.length&&E.push(_.slice(w)),E},this.iterateGraphemes=function(_){var E=0,w={next:function(){var D,M;return(M=this.nextBreak(_,E))<_.length?(D=_.slice(E,M),E=M,{value:D,done:!1}):E<_.length?(D=_.slice(E),E=_.length,{value:D,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var E=0,w=0,D;(D=this.nextBreak(_,w))<_.length;)w=D,E++;return w<_.length&&E++,E};function F(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?h:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?C:d}return this}typeof GF<"u"&&GF.exports&&(GF.exports=c4e)});var Roe=Vc((r0n,Y6)=>{"use strict";Y6.exports=l2;Y6.exports.default=l2;function l2(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=Doe(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,u,f,d,p,g;if(i&&(r=dGe(e,t,r,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;h<o;h+=n)d=e[h],p=e[h+1],d<a&&(a=d),p<c&&(c=p),d>u&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return Wv(r,s,n,a,c,g,0),s}function Doe(e,t,n,i,o){var r,s;if(o===q6(e,t,n,i)>0)for(r=t;r<n;r+=i)s=Ioe(r,e[r],e[r+1],s);else for(r=n-i;r>=t;r-=i)s=Ioe(r,e[r],e[r+1],s);return s&&u2(s,s.next)&&(qv(s),s=s.next),s}function z0(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(u2(n,n.next)||Er(n.prev,n,n.next)===0)){if(qv(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Wv(e,t,n,i,o,r,s){if(e){!s&&r&&gGe(e,i,o,r);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,r?lGe(e,i,o,r):cGe(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),qv(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=uGe(z0(e),t,n),Wv(e,t,n,i,o,r,2)):s===2&&fGe(e,t,n,i,o,r):Wv(z0(e),t,n,i,o,r,1);break}}}}function cGe(e){var t=e.prev,n=e,i=e.next;if(Er(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=o<r?o<s?o:s:r<s?r:s,d=a<c?a<u?a:u:c<u?c:u,p=o>r?o>s?o:s:r>s?r:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&hT(o,a,r,c,s,u,h.x,h.y)&&Er(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function lGe(e,t,n,i){var o=e.prev,r=e,s=e.next;if(Er(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,g=a<c?a<u?a:u:c<u?c:u,h=f<d?f<p?f:p:d<p?d:p,x=a>c?a>u?a:u:c>u?c:u,b=f>d?f>p?f:p:d>p?d:p,C=W6(g,h,t,n,i),T=W6(x,b,t,n,i),A=e.prevZ,S=e.nextZ;A&&A.z>=C&&S&&S.z<=T;){if(A.x>=g&&A.x<=x&&A.y>=h&&A.y<=b&&A!==o&&A!==s&&hT(a,f,c,d,u,p,A.x,A.y)&&Er(A.prev,A,A.next)>=0||(A=A.prevZ,S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==o&&S!==s&&hT(a,f,c,d,u,p,S.x,S.y)&&Er(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;A&&A.z>=C;){if(A.x>=g&&A.x<=x&&A.y>=h&&A.y<=b&&A!==o&&A!==s&&hT(a,f,c,d,u,p,A.x,A.y)&&Er(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=x&&S.y>=h&&S.y<=b&&S!==o&&S!==s&&hT(a,f,c,d,u,p,S.x,S.y)&&Er(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function uGe(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!u2(o,r)&&Poe(o,i,i.next,r)&&jv(o,r)&&jv(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),qv(i),qv(i.next),i=e=r),i=i.next}while(i!==e);return z0(i)}function fGe(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&bGe(s,a)){var c=Ooe(s,a);s=z0(s,s.next),c=z0(c,c.next),Wv(s,t,n,i,o,r,0),Wv(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function dGe(e,t,n,i){var o=[],r,s,a,c,u;for(r=0,s=t.length;r<s;r++)a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=Doe(e,a,c,i,!1),u===u.next&&(u.steiner=!0),o.push(xGe(u));for(o.sort(mGe),r=0;r<o.length;r++)n=hGe(o[r],n);return n}function mGe(e,t){return e.x-t.x}function hGe(e,t){var n=pGe(e,t);if(!n)return t;var i=Ooe(n,e);return z0(i,i.next),z0(n,n.next)}function pGe(e,t){var n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,u=s.x,f=s.y,d=1/0,p;n=s;do i>=n.x&&n.x>=u&&i!==n.x&&hT(o<f?i:r,o,u,f,o<f?r:i,o,n.x,n.y)&&(p=Math.abs(o-n.y)/(i-n.x),jv(n,e)&&(p<d||p===d&&(n.x>s.x||n.x===s.x&&_Ge(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function _Ge(e,t){return Er(e.prev,e,t.prev)<0&&Er(t.next,e,e.next)<0}function gGe(e,t,n,i){var o=e;do o.z===0&&(o.z=W6(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,yGe(o)}function yGe(e){var t,n,i,o,r,s,a,c,u=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t<u&&(a++,i=i.nextZ,!!i);t++);for(c=u;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(s>1);return e}function W6(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function xGe(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function hT(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function bGe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!CGe(e,t)&&(jv(e,t)&&jv(t,e)&&TGe(e,t)&&(Er(e.prev,e,t.prev)||Er(e,t.prev,t))||u2(e,t)&&Er(e.prev,e,e.next)>0&&Er(t.prev,t,t.next)>0)}function Er(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function u2(e,t){return e.x===t.x&&e.y===t.y}function Poe(e,t,n,i){var o=c2(Er(e,t,n)),r=c2(Er(e,t,i)),s=c2(Er(n,i,e)),a=c2(Er(n,i,t));return!!(o!==r&&s!==a||o===0&&a2(e,n,t)||r===0&&a2(e,i,t)||s===0&&a2(n,e,i)||a===0&&a2(n,t,i))}function a2(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function c2(e){return e>0?1:e<0?-1:0}function CGe(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Poe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function jv(e,t){return Er(e.prev,e,e.next)<0?Er(e,t,e.next)>=0&&Er(e,e.prev,t)>=0:Er(e,t,e.prev)<0||Er(e,e.next,t)<0}function TGe(e,t){var n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Ooe(e,t){var n=new j6(e.i,e.x,e.y),i=new j6(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Ioe(e,t,n,i){var o=new j6(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function qv(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function j6(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}l2.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(q6(e,0,r,n));if(o)for(var a=0,c=t.length;a<c;a++){var u=t[a]*n,f=a<c-1?t[a+1]*n:e.length;s-=Math.abs(q6(e,u,f,n))}var d=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,g=i[a+1]*n,h=i[a+2]*n;d+=Math.abs((e[p]-e[h])*(e[g+1]-e[p+1])-(e[p]-e[g])*(e[h+1]-e[p+1]))}return s===0&&d===0?0:Math.abs((d-s)/s)};function q6(e,t,n,i){for(var o=0,r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}l2.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,o=0;o<e.length;o++){for(var r=0;r<e[o].length;r++)for(var s=0;s<t;s++)n.vertices.push(e[o][r][s]);o>0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var $ce=Vc((TW,AW)=>{(function(e,t){typeof TW=="object"&&typeof AW<"u"?AW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(TW,function(){"use strict";function e(b,C,T,A,S){(function v(I,O,R,N,F){for(;N>R;){if(N-R>600){var _=N-R+1,E=O-R+1,w=Math.log(_),D=.5*Math.exp(2*w/3),M=.5*Math.sqrt(w*D*(_-D)/_)*(E-_/2<0?-1:1),B=Math.max(R,Math.floor(O-E*D/_+M)),V=Math.min(N,Math.floor(O+(_-E)*D/_+M));v(I,O,B,V,F)}var U=I[O],G=R,k=N;for(t(I,R,O),F(I[N],U)>0&&t(I,R,N);G<k;){for(t(I,G,k),G++,k--;F(I[G],U)<0;)G++;for(;F(I[k],U)>0;)k--}F(I[R],U)===0?t(I,R,k):t(I,++k,N),k<=O&&(R=k+1),O<=k&&(N=k-1)}})(b,C,T||0,A||b.length-1,S||n)}function t(b,C,T){var A=b[C];b[C]=b[T],b[T]=A}function n(b,C){return b<C?-1:b>C?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,C,T){if(!T)return C.indexOf(b);for(var A=0;A<C.length;A++)if(T(b,C[A]))return A;return-1}function r(b,C){s(b,0,b.children.length,C,b)}function s(b,C,T,A,S){S||(S=h(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var v=C;v<T;v++){var I=b.children[v];a(S,b.leaf?A(I):I)}return S}function a(b,C){return b.minX=Math.min(b.minX,C.minX),b.minY=Math.min(b.minY,C.minY),b.maxX=Math.max(b.maxX,C.maxX),b.maxY=Math.max(b.maxY,C.maxY),b}function c(b,C){return b.minX-C.minX}function u(b,C){return b.minY-C.minY}function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function d(b){return b.maxX-b.minX+(b.maxY-b.minY)}function p(b,C){return b.minX<=C.minX&&b.minY<=C.minY&&C.maxX<=b.maxX&&C.maxY<=b.maxY}function g(b,C){return C.minX<=b.maxX&&C.minY<=b.maxY&&C.maxX>=b.minX&&C.maxY>=b.minY}function h(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(b,C,T,A,S){for(var v=[C,T];v.length;)if(!((T=v.pop())-(C=v.pop())<=A)){var I=C+Math.ceil((T-C)/A/2)*A;e(b,I,C,T,S),v.push(C,I,I,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var C=this.data,T=[];if(!g(b,C))return T;for(var A=this.toBBox,S=[];C;){for(var v=0;v<C.children.length;v++){var I=C.children[v],O=C.leaf?A(I):I;g(b,O)&&(C.leaf?T.push(I):p(b,O)?this._all(I,T):S.push(I))}C=S.pop()}return T},i.prototype.collides=function(b){var C=this.data;if(!g(b,C))return!1;for(var T=[];C;){for(var A=0;A<C.children.length;A++){var S=C.children[A],v=C.leaf?this.toBBox(S):S;if(g(b,v)){if(C.leaf||p(b,v))return!0;T.push(S)}}C=T.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var C=0;C<b.length;C++)this.insert(b[C]);return this}var T=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var A=this.data;this.data=T,T=A}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=h([]),this},i.prototype.remove=function(b,C){if(!b)return this;for(var T,A,S,v=this.data,I=this.toBBox(b),O=[],R=[];v||O.length;){if(v||(v=O.pop(),A=O[O.length-1],T=R.pop(),S=!0),v.leaf){var N=o(b,v.children,C);if(N!==-1)return v.children.splice(N,1),O.push(v),this._condense(O),this}S||v.leaf||!p(v,I)?A?(T++,v=A.children[T],S=!1):v=null:(O.push(v),R.push(T),T=0,A=v,v=v.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,C){return b.minX-C.minX},i.prototype.compareMinY=function(b,C){return b.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,C){for(var T=[];b;)b.leaf?C.push.apply(C,b.children):T.push.apply(T,b.children),b=T.pop();return C},i.prototype._build=function(b,C,T,A){var S,v=T-C+1,I=this._maxEntries;if(v<=I)return r(S=h(b.slice(C,T+1)),this.toBBox),S;A||(A=Math.ceil(Math.log(v)/Math.log(I)),I=Math.ceil(v/Math.pow(I,A-1))),(S=h([])).leaf=!1,S.height=A;var O=Math.ceil(v/I),R=O*Math.ceil(Math.sqrt(I));x(b,C,T,R,this.compareMinX);for(var N=C;N<=T;N+=R){var F=Math.min(N+R-1,T);x(b,N,F,O,this.compareMinY);for(var _=N;_<=F;_+=O){var E=Math.min(_+O-1,F);S.children.push(this._build(b,_,E,A-1))}}return r(S,this.toBBox),S},i.prototype._chooseSubtree=function(b,C,T,A){for(;A.push(C),!C.leaf&&A.length-1!==T;){for(var S=1/0,v=1/0,I=void 0,O=0;O<C.children.length;O++){var R=C.children[O],N=f(R),F=(_=b,E=R,(Math.max(E.maxX,_.maxX)-Math.min(E.minX,_.minX))*(Math.max(E.maxY,_.maxY)-Math.min(E.minY,_.minY))-N);F<v?(v=F,S=N<S?N:S,I=R):F===v&&N<S&&(S=N,I=R)}C=I||C.children[0]}var _,E;return C},i.prototype._insert=function(b,C,T){var A=T?b:this.toBBox(b),S=[],v=this._chooseSubtree(A,this.data,C,S);for(v.children.push(b),a(v,A);C>=0&&S[C].children.length>this._maxEntries;)this._split(S,C),C--;this._adjustParentBBoxes(A,S,C)},i.prototype._split=function(b,C){var T=b[C],A=T.children.length,S=this._minEntries;this._chooseSplitAxis(T,S,A);var v=this._chooseSplitIndex(T,S,A),I=h(T.children.splice(v,T.children.length-v));I.height=T.height,I.leaf=T.leaf,r(T,this.toBBox),r(I,this.toBBox),C?b[C-1].children.push(I):this._splitRoot(T,I)},i.prototype._splitRoot=function(b,C){this.data=h([b,C]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,C,T){for(var A,S,v,I,O,R,N,F=1/0,_=1/0,E=C;E<=T-C;E++){var w=s(b,0,E,this.toBBox),D=s(b,E,T,this.toBBox),M=(S=w,v=D,I=void 0,O=void 0,R=void 0,N=void 0,I=Math.max(S.minX,v.minX),O=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),N=Math.min(S.maxY,v.maxY),Math.max(0,R-I)*Math.max(0,N-O)),B=f(w)+f(D);M<F?(F=M,A=E,_=B<_?B:_):M===F&&B<_&&(_=B,A=E)}return A||T-C},i.prototype._chooseSplitAxis=function(b,C,T){var A=b.leaf?this.compareMinX:c,S=b.leaf?this.compareMinY:u;this._allDistMargin(b,C,T,A)<this._allDistMargin(b,C,T,S)&&b.children.sort(A)},i.prototype._allDistMargin=function(b,C,T,A){b.children.sort(A);for(var S=this.toBBox,v=s(b,0,C,S),I=s(b,T-C,T,S),O=d(v)+d(I),R=C;R<T-C;R++){var N=b.children[R];a(v,b.leaf?S(N):N),O+=d(v)}for(var F=T-C-1;F>=C;F--){var _=b.children[F];a(I,b.leaf?S(_):_),O+=d(I)}return O},i.prototype._adjustParentBBoxes=function(b,C,T){for(var A=T;A>=0;A--)a(C[A],b)},i.prototype._condense=function(b){for(var C=b.length-1,T=void 0;C>=0;C--)b[C].children.length===0?C>0?(T=b[C-1].children).splice(T.indexOf(b[C]),1):this.clear():r(b[C],this.toBBox)},i})});var Ij=Vc((exports,module)=>{/*! + * protobuf.js v7.2.3 (c) 2016, daniel wirtz + * compiled mon, 27 mar 2023 18:08:22 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function r(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},r,a,a.exports),a.exports}var o=r(i[0]);o.util.global.protobuf=o,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(o.util.Long=s,o.configure()),o}),typeof module=="object"&&module&&module.exports&&(module.exports=o)})({1:[function(e,t,n){"use strict";t.exports=i;function i(r,o){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(h){if(u)if(u=!1,h)p(h);else{for(var A=new Array(arguments.length-1),x=0;x<A.length;)A[x++]=arguments[x];d.apply(null,A)}};try{r.apply(o||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],h=0,A=0,x;f<d;){var C=u[f++];switch(A){case 0:g[h++]=r[C>>2],x=(C&3)<<4,A=1;break;case 1:g[h++]=r[x|C>>4],x=(C&15)<<2,A=2;break;case 2:g[h++]=r[x|C>>6],g[h++]=r[C&63],A=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return A&&(g[h++]=r[x],g[h++]=61,A===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,A=0;A<u.length;){var x=u.charCodeAt(A++);if(x===61&&g>1)break;if((x=o[x])===undefined)throw Error(a);switch(g){case 0:h=x,g=1;break;case 1:f[d++]=h<<2|(x&48)>>4,h=x,g=2;break;case 2:f[d++]=(h&15)<<4|(x&60)>>2,h=x,g=3;break;case 3:f[d++]=(h&3)<<6|x,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(o,s,a){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(o,s){if(o===undefined)this._listeners={};else if(s===undefined)this._listeners[o]=[];else for(var a=this._listeners[o],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(o){var s=this._listeners[o];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(x,C,T){u[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3]}function g(x,C,T){u[0]=x,C[T]=f[3],C[T+1]=f[2],C[T+2]=f[1],C[T+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],u[0]}function A(x,C){return f[3]=x[C],f[2]=x[C+1],f[1]=x[C+2],f[0]=x[C+3],u[0]}c.readFloatLE=d?h:A,c.readFloatBE=d?A:h}():function(){function u(d,p,g,h){var A=p<0?1:0;if(A&&(p=-p),p===0)d(1/p>0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((A<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((A<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var x=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-x)*8388608)&8388607;d((A<<31|x+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,r),c.writeFloatBE=u.bind(null,o);function f(d,p,g){var h=d(p,g),A=(h>>31)*2+1,x=h>>>23&255,C=h&8388607;return x===255?C?NaN:A*(1/0):x===0?A*1401298464324817e-60*C:A*Math.pow(2,x-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(x,C,T){u[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(x,C,T){u[0]=x,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],f[4]=x[C+4],f[5]=x[C+5],f[6]=x[C+6],f[7]=x[C+7],u[0]}function A(x,C){return f[7]=x[C],f[6]=x[C+1],f[5]=x[C+2],f[4]=x[C+3],f[3]=x[C+4],f[2]=x[C+5],f[1]=x[C+6],f[0]=x[C+7],u[0]}c.readDoubleLE=d?h:A,c.readDoubleBE=d?A:h}():function(){function u(d,p,g,h,A,x){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,A,x+p),d(1/h>0?0:2147483648,A,x+g);else if(isNaN(h))d(0,A,x+p),d(2146959360,A,x+g);else if(h>17976931348623157e292)d(0,A,x+p),d((C<<31|2146435072)>>>0,A,x+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,A,x+p),d((C<<31|T/4294967296)>>>0,A,x+g);else{var E=Math.floor(Math.log(h)/Math.LN2);E===1024&&(E=1023),T=h*Math.pow(2,-E),d(T*4503599627370496>>>0,A,x+p),d((C<<31|E+1023<<20|T*1048576&1048575)>>>0,A,x+g)}}}c.writeDoubleLE=u.bind(null,r,0,4),c.writeDoubleBE=u.bind(null,o,4,0);function f(d,p,g,h,A){var x=d(h,A+p),C=d(h,A+g),T=(C>>31)*2+1,E=C>>>20&2047,S=4294967296*(C&1048575)+x;return E===2047?S?NaN:T*(1/0):E===0?T*5e-324*S:T*Math.pow(2,E-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function r(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function o(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(r,o,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return r(p);f+p>a&&(u=r(a),f=0);var g=o.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(o){for(var s=0,a=0,c=0;c<o.length;++c)a=o.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(o.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(o,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=o[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|o[s++]&63:p>239&&p<365?(p=((p&7)<<18|(o[s++]&63)<<12|(o[s++]&63)<<6|o[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(o[s++]&63)<<6|o[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(o,s,a){for(var c=a,u,f,d=0;d<o.length;++d)u=o.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=o.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),r,o=i.LongBits,s=i.utf8;function a(h,A){return RangeError("index out of range: "+h.pos+" + "+(A||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(A){if(A instanceof Uint8Array||Array.isArray(A))return new c(A);throw Error("illegal buffer")}:function(A){if(Array.isArray(A))return new c(A);throw Error("illegal buffer")},f=function(){return i.Buffer?function(x){return(c.create=function(T){return i.Buffer.isBuffer(T)?new r(T):u(T)})(x)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var A=4294967295;return function(){if(A=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(A=(A|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return A;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return A}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var A=this.uint32();return A>>>1^-(A&1)|0};function d(){var h=new o(0,0),A=0;if(this.len-this.pos>4){for(;A<4;++A)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<A*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;A=0}else{for(;A<3;++A){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<A*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<A*7)>>>0,h}if(this.len-this.pos>4){for(;A<5;++A)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<A*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;A<5;++A){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<A*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,A){return(h[A-4]|h[A-3]<<8|h[A-2]<<16|h[A-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var A=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,A},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var A=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,A},c.prototype.bytes=function(){var A=this.uint32(),x=this.pos,C=this.pos+A;if(C>this.len)throw a(this,A);return this.pos+=A,Array.isArray(this.buf)?this.buf.slice(x,C):x===C?new this.buf.constructor(0):this._slice.call(this.buf,x,C)},c.prototype.string=function(){var A=this.bytes();return s.read(A,0,A.length)},c.prototype.skip=function(A){if(typeof A=="number"){if(this.pos+A>this.len)throw a(this,A);this.pos+=A}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){r=h,c.create=f(),r._configure();var A=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[A](!1)},uint64:function(){return d.call(this)[A](!0)},sint64:function(){return d.call(this).zzDecode()[A](!1)},fixed64:function(){return g.call(this)[A](!0)},sfixed64:function(){return g.call(this)[A](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(s){i.call(this,s)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},o._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=r;var i=e(15);(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r;function r(o,s,a){if(typeof o!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!s,this.responseDelimited=!!a}r.prototype.rpcCall=function o(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(o,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(A){return d.emit("error",A,s),f(A)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=r;var i=e(15);function r(c,u){this.lo=c>>>0,this.hi=u>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return o;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new r(d,p)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):o},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;r.fromHash=function(u){return u===s?o:new r((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function r(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=r,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function o(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&r(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=o,i.ProtocolError=o("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),r,o=i.LongBits,s=i.base64,a=i.utf8;function c(E,S,w){this.fn=E,this.len=S,this.next=undefined,this.val=w}function u(){}function f(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=p(),d.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(S,w,D){return this.tail=this.tail.next=new c(S,w,D),this.len+=w,this};function g(E,S,w){S[w]=E&255}function h(E,S,w){for(;E>127;)S[w++]=E&127|128,E>>>=7;S[w]=E}function A(E,S){this.len=E,this.next=undefined,this.val=S}A.prototype=Object.create(c.prototype),A.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new A((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(x,10,o.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function x(E,S,w){for(;E.hi;)S[w++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[w++]=E.lo&127|128,E.lo=E.lo>>>7;S[w++]=E.lo}d.prototype.uint64=function(S){var w=o.from(S);return this._push(x,w.length(),w)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var w=o.from(S).zzEncode();return this._push(x,w.length(),w)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(E,S,w){S[w]=E&255,S[w+1]=E>>>8&255,S[w+2]=E>>>16&255,S[w+3]=E>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var w=o.from(S);return this._push(C,4,w.lo)._push(C,4,w.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,w,D){w.set(S,D)}:function(S,w,D){for(var R=0;R<S.length;++R)w[D+R]=S[R]};d.prototype.bytes=function(S){var w=S.length>>>0;if(!w)return this._push(g,1,0);if(i.isString(S)){var D=d.alloc(w=s.length(S));s.decode(S,D,0),S=D}return this.uint32(w)._push(T,w,S)},d.prototype.string=function(S){var w=a.length(S);return w?this.uint32(w)._push(a.write,w,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,w=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=w,this.len+=D),this},d.prototype.finish=function(){for(var S=this.head.next,w=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,w,D),D+=S.len,S=S.next;return w},d._configure=function(E){r=E,d.create=p(),r._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=o;var i=e(16);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(){i.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},o.prototype.bytes=function(c){r.isString(c)&&(c=r._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(o.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?r.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}o.prototype.string=function(c){var u=r.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},o._configure()},{15:15,16:16}]},{},[8])})()});var aye=sc((yyi,t4)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,A=o(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),x={width:g.width,height:g.height,pixelData:A.resultPixels,minValue:A.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return A.resultMask&&(x.maskData=A.resultMask),d.returnEncodedMask&&g.mask&&(x.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(x.fileInfo=s(g),d.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(g))),x};var o=function(f,d,p,g,h){var A=0,x=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/x),E=Math.floor(f.height/C),S=2*f.maxZError,w=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var R,O;R=new d(f.width*f.height),h&&p&&(O=new Uint8Array(f.width*f.height));for(var L=new Float32Array(T*E),N,_,b=0;b<=C;b++){var v=b!==C?E:f.height%C;if(v!==0)for(var I=0;I<=x;I++){var M=I!==x?T:f.width%x;if(M!==0){var F=b*f.width*E+I*T,k=f.width-M,V=f.pixels.blocks[A],G,U,q;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),G=L),U=0):V.encoding===2?q=0:q=V.offset;var Y;if(p)for(_=0;_<v;_++){for(F&7&&(Y=p[F>>3],Y<<=F&7),N=0;N<M;N++)F&7||(Y=p[F>>3]),Y&128?(O&&(O[F]=1),D=V.encoding<2?G[U++]:q,w=w>D?D:w,R[F++]=D):(O&&(O[F]=0),R[F++]=g),Y<<=1;F+=k}else if(V.encoding<2)for(_=0;_<v;_++){for(N=0;N<M;N++)D=G[U++],w=w>D?D:w,R[F++]=D;F+=k}else for(w=w>q?q:w,_=0;_<v;_++){for(N=0;N<M;N++)R[F++]=q;F+=k}if(V.encoding===1&&U!==V.numValidPixels)throw"Block and Mask do not match";A++}}}return{resultPixels:R,resultMask:O,minValue:w}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var h=f.pixels.blocks[g];h.encoding===0?p.float32=!0:h.encoding===1?p[h.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},h=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,h),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var A=new DataView(f,d,24);if(g.fileVersion=A.getInt32(0,!0),g.imageType=A.getInt32(4,!0),g.height=A.getUint32(8,!0),g.width=A.getUint32(12,!0),g.maxZError=A.getFloat64(16,!0),d+=24,!p)if(A=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=A.getUint32(0,!0),g.mask.numBlocksX=A.getUint32(4,!0),g.mask.numBytes=A.getUint32(8,!0),g.mask.maxValue=A.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var x=new Uint8Array(Math.ceil(g.width*g.height/8));A=new DataView(f,d,g.mask.numBytes);var C=A.getInt16(0,!0),T=2,E=0;do{if(C>0)for(;C--;)x[E++]=A.getUint8(T++);else{var S=A.getUint8(T++);for(C=-C;C--;)x[E++]=S}C=A.getInt16(T,!0),T+=2}while(T<g.mask.numBytes);if(C!==-32768||E<x.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=x,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));A=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=A.getUint32(0,!0),g.pixels.numBlocksX=A.getUint32(4,!0),g.pixels.numBytes=A.getUint32(8,!0),g.pixels.maxValue=A.getFloat32(12,!0),d+=16;var w=g.pixels.numBlocksX,D=g.pixels.numBlocksY,R=w+(g.width%w>0?1:0),O=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(R*O);for(var L=0,N=0;N<O;N++)for(var _=0;_<R;_++){var b=0,v=f.byteLength-d;A=new DataView(f,d,Math.min(10,v));var I={};g.pixels.blocks[L++]=I;var M=A.getUint8(0);if(b++,I.encoding=M&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,I.offsetType=M,M===2)I.offset=A.getInt8(1),b++;else if(M===1)I.offset=A.getInt16(1,!0),b+=2;else if(M===0)I.offset=A.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(I.encoding===1)if(M=A.getUint8(b),b++,I.bitsPerPixel=M&63,M>>=6,I.numValidPixelsType=M,M===2)I.numValidPixels=A.getUint8(b),b++;else if(M===1)I.numValidPixels=A.getUint16(b,!0),b+=2;else if(M===0)I.numValidPixels=A.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(d+=b,I.encoding!==3){var F,k;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";F=new ArrayBuffer(V*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,V*4));var G=new Float32Array(F);I.rawData=G,d+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);F=new ArrayBuffer(q*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,U)),I.stuffedData=new Uint32Array(F),d+=U}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,A,x){var C=(1<<d)-1,T=0,E,S=0,w,D,R=Math.ceil((x-g)/h),O=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*O,E=0;E<p;E++){if(S===0&&(D=f[T++],S=32),S>=d)w=D>>>S-d&C,S-=d;else{var L=d-S;w=(D&C)<<L&C,D=f[T++],S=32-L,w+=D>>>S}A[E]=w<R?g+w*h:x}return A};return r}(),t=function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,h,A){var x=(1<<f)-1,C=0,T,E=0,S,w,D,R,O=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*O,p)for(T=0;T<d;T++)E===0&&(w=c[C++],E=32),E>=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<<D&x,w=c[C++],E=32-D,S+=w>>>E),u[T]=p[S];else for(R=Math.ceil((A-g)/h),T=0;T<d;T++)E===0&&(w=c[C++],E=32),E>=f?(S=w>>>E-f&x,E-=f):(D=f-E,S=(w&x)<<D&x,w=c[C++],E=32-D,S+=w>>>E),u[T]=S<R?g+S*h:A},unstuffLUT:function(c,u,f,d,p,g){var h=(1<<u)-1,A=0,x=0,C=0,T=0,E=0,S,w=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var R=Math.ceil((g-d)/p);for(x=0;x<f;x++)T===0&&(S=c[A++],T=32),T>=u?(E=S>>>T-u&h,T-=u):(C=u-T,E=(S&h)<<C&h,S=c[A++],T=32-C,E+=S>>>T),w[x]=E<R?d+E*p:g;return w.unshift(d),w},unstuff2:function(c,u,f,d,p,g,h,A){var x=(1<<f)-1,C=0,T,E=0,S=0,w,D,R;if(p)for(T=0;T<d;T++)E===0&&(D=c[C++],E=32,S=0),E>=f?(w=D>>>S&x,E-=f,S+=f):(R=f-E,w=D>>>S&x,D=c[C++],E=32-R,w|=(D&(1<<R)-1)<<f-R,S=R),u[T]=p[w];else{var O=Math.ceil((A-g)/h);for(T=0;T<d;T++)E===0&&(D=c[C++],E=32,S=0),E>=f?(w=D>>>S&x,E-=f,S+=f):(R=f-E,w=D>>>S&x,D=c[C++],E=32-R,w|=(D&(1<<R)-1)<<f-R,S=R),u[T]=w<O?g+w*h:A}return u},unstuffLUT2:function(c,u,f,d,p,g){var h=(1<<u)-1,A=0,x=0,C=0,T=0,E=0,S=0,w,D=[],R=Math.ceil((g-d)/p);for(x=0;x<f;x++)T===0&&(w=c[A++],T=32,S=0),T>=u?(E=w>>>S&h,T-=u,S+=u):(C=u-T,E=w>>>S&h,w=c[A++],T=32-C,E|=(w&(1<<C)-1)<<u-C,S=C),D[x]=E<R?d+E*p:g;return D.unshift(d),D},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,h,A=0,x,C,T,E=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*E,h=0;h<d;h++)A===0&&(C=c[g++],A=32),A>=f?(x=C>>>A-f&p,A-=f):(T=f-A,x=(C&p)<<T&p,C=c[g++],A=32-T,x+=C>>>A),u[h]=x;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,h,A=0,x=0,C,T,E;for(h=0;h<d;h++)A===0&&(T=c[g++],A=32,x=0),A>=f?(C=T>>>x&p,A-=f,x+=f):(E=f-A,C=T>>>x&p,T=c[g++],A=32-E,C|=(T&(1<<E)-1)<<f-E,x=E),u[h]=C;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var h=p>=359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var A,x;if(h>=3&&(x=h>=4?52:48,A=this.computeChecksumFletcher32(new Uint8Array(c,f-x,p.blobSize-14)),A!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var A,x=!0;for(A=0;A<f.numDims;A++)if(g[A]!==h[A]){x=!1;break}return f.minValues=g,f.maxValues=h,x},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),h=new Uint8Array(g);h.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,h=new DataView(c,f,4),A={};if(A.numBytes=h.getUint32(0,!0),f+=4,(g===0||p===g)&&A.numBytes!==0)throw"invalid mask";var x,C;if(g===0)x=new Uint8Array(Math.ceil(p/8)),A.bitset=x,C=new Uint8Array(p),u.pixels.resultMask=C,f+=A.numBytes;else if(A.numBytes>0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,A.numBytes);var T=h.getInt16(0,!0),E=2,S=0,w=0;do{if(T>0)for(;T--;)x[S++]=h.getUint8(E++);else for(w=h.getUint8(E++),T=-T;T--;)x[S++]=w;T=h.getInt16(E,!0),E+=2}while(E<A.numBytes);if(T!==-32768||S<x.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var D=0,R=0;for(R=0;R<p;R++)R&7?(D=x[R>>3],D<<=R&7):D=x[R>>3],D&128&&(C[R]=1);u.pixels.resultMask=C,A.bitset=x,f+=A.numBytes}return u.ptr=f,u.mask=A,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,A=p.imageType,x=p.numValidPixel*o.getDataTypeSize(A)*g,C,T=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,x);else{var E=new ArrayBuffer(x),S=new Uint8Array(E);S.set(new Uint8Array(c,d,x)),C=new f(E)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var w=0,D=0,R=0,O=0;if(g>1)for(R=0;R<g;R++)for(O=R*h,D=0;D<h;D++)T[D]&&(u.pixels.resultPixels[O+D]=C[w++]);else for(D=0;D<h;D++)T[D]&&(u.pixels.resultPixels[D]=C[w++])}return d+=x,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),h=d.getInt32(8,!0),A=d.getInt32(12,!0);if(h>=A)return!1;var x=new Uint32Array(A-h);o.decodeBits(c,u,x);var C=[],T,E,S,w;for(T=h;T<A;T++)E=T-(T<g?0:g),C[E]={first:x[T-h],second:null};var D=c.byteLength-u.ptr,R=Math.ceil(D/4),O=new ArrayBuffer(R*4),L=new Uint8Array(O);L.set(new Uint8Array(c,u.ptr,D));var N=new Uint32Array(O),_=0,b,v=0;for(b=N[0],T=h;T<A;T++)E=T-(T<g?0:g),w=C[E].first,w>0&&(C[E].second=b<<_>>>32-w,32-_>=w?(_+=w,_===32&&(_=0,v++,b=N[v])):(_+=w-32,v++,b=N[v],C[E].second|=b>>>32-_));var I=0,M=0,F=new s;for(T=0;T<C.length;T++)C[T]!==void 0&&(I=Math.max(I,C[T].first));I>=f?M=f:M=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var k=[],V,G,U,q,Y,Q;for(T=h;T<A;T++)if(E=T-(T<g?0:g),w=C[E].first,w>0)if(V=[w,E],w<=M)for(G=C[E].second<<M-w,U=1<<M-w,S=0;S<U;S++)k[G|S]=V;else for(G=C[E].second,Q=F,q=w-1;q>=0;q--)Y=G>>>q&1,Y?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),q===0&&!Q.val&&(Q.val=V[1]);return{decodeLut:k,numBitsLUTQick:M,numBitsLUT:I,tree:F,stuffedData:N,srcPtr:v,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,A=h*g,x=this.readHuffmanTree(c,u),C=x.decodeLut,T=x.tree,E=x.stuffedData,S=x.srcPtr,w=x.bitPos,D=x.numBitsLUTQick,R=x.numBitsLUT,O=u.headerInfo.imageType===0?128:0,L,N,_,b=u.pixels.resultMask,v,I,M,F,k,V,G,U=0;w>0&&(S++,w=0);var q=E[S],Y=u.encodeMode===1,Q=new f(A*p),W=Q,K;for(K=0;K<d.numDims;K++){if(p>1&&(W=new f(Q.buffer,A*K,A),U=0),u.headerInfo.numValidPixel===h*g)for(V=0,F=0;F<g;F++)for(k=0;k<h;k++,V++){if(N=0,v=q<<w>>>32-D,I=v,32-w<D&&(v|=E[S+1]>>>64-w-D,I=v),C[I])N=C[I][1],w+=C[I][0];else for(v=q<<w>>>32-R,I=v,32-w<R&&(v|=E[S+1]>>>64-w-R,I=v),L=T,G=0;G<R;G++)if(M=v>>>R-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,w=w+G+1;break}w>=32&&(w-=32,S++,q=E[S]),_=N-O,Y?(k>0?_+=U:F>0?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}else for(V=0,F=0;F<g;F++)for(k=0;k<h;k++,V++)if(b[V]){if(N=0,v=q<<w>>>32-D,I=v,32-w<D&&(v|=E[S+1]>>>64-w-D,I=v),C[I])N=C[I][1],w+=C[I][0];else for(v=q<<w>>>32-R,I=v,32-w<R&&(v|=E[S+1]>>>64-w-R,I=v),L=T,G=0;G<R;G++)if(M=v>>>R-G-1&1,L=M?L.right:L.left,!(L.left||L.right)){N=L.val,w=w+G+1;break}w>=32&&(w-=32,S++,q=E[S]),_=N-O,Y?(k>0&&b[V-1]?_+=U:F>0&&b[V-h]?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}u.ptr=u.ptr+(S+1)*4+(w>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,A=0,x=new DataView(c,u.ptr,5),C=x.getUint8(0);A++;var T=C>>6,E=T===0?4:3-T,S=(C&32)>0,w=C&31,D=0;if(E===1)D=x.getUint8(A),A++;else if(E===2)D=x.getUint16(A,!0),A+=2;else if(E===4)D=x.getUint32(A,!0),A+=4;else throw"Invalid valid pixel count type";var R=2*g.maxZError,O,L,N,_,b,v,I,M,F,k,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,M=x.getUint8(A),F=w,A++,_=Math.ceil((M-1)*w/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),u.ptr+=A,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,k=0;M-1>>>k;)k++;_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(L),u.ptr+=_,h>=3?v=r.unstuffLUT2(I,w,M-1,d,R,V):v=r.unstuffLUT(I,w,M-1,d,R,V),h>=3?r.unstuff2(O,f,k,D,v):r.unstuff(O,f,k,D,v)}else u.counter.bitstuffer++,k=w,u.ptr+=A,k>0&&(_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(L),u.ptr+=_,h>=3?d==null?r.originalUnstuff2(O,f,k,D):r.unstuff2(O,f,k,D,!1,d,R,V):d==null?r.originalUnstuff(O,f,k,D):r.unstuff(O,f,k,D,!1,d,R,V))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,A=d.imageType,x=o.getDataTypeSize(A),C=Math.ceil(p/h),T=Math.ceil(g/h);u.pixels.numBlocksY=T,u.pixels.numBlocksX=C,u.pixels.ptr=0;var E=0,S=0,w=0,D=0,R=0,O=0,L=0,N=0,_=0,b=0,v=0,I=0,M=0,F=0,k=0,V=0,G,U,q,Y,Q,W,K=new f(h*h),J=g%h||h,me=p%h||h,ye,se,pe=d.numDims,xe,we=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(w=0;w<T;w++)for(R=w!==T-1?h:J,D=0;D<C;D++)for(O=D!==C-1?h:me,v=w*p*h+D*h,I=p-O,xe=0;xe<pe;xe++){if(pe>1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*xe*x,p*g)),L=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,L)),U={},V=0,N=G.getUint8(0),V++,_=N>>6&255,b=N>>2&15,b!==(D*h>>3&15))throw"integrity issue";if(W=N&3,W>3)throw u.ptr+=V,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=V;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=V,M=R*O*x,F=c.byteLength-u.ptr,M=M<F?M:F,q=new ArrayBuffer(M%x===0?M:M+x-M%x),Y=new Uint8Array(q),Y.set(new Uint8Array(c,u.ptr,M)),Q=new f(q),k=0,we)for(E=0;E<R;E++){for(S=0;S<O;S++)we[v]&&(Ee[v]=Q[k++]),v++;v+=I}else for(E=0;E<R;E++){for(S=0;S<O;S++)Ee[v++]=Q[k++];v+=I}u.ptr+=k*x}else if(ye=o.getDataTypeUsed(A,_),se=o.getOnePixel(U,V,ye,G),V+=o.getDataTypeSize(ye),W===3)if(u.ptr+=V,u.counter.constantoffset++,we)for(E=0;E<R;E++){for(S=0;S<O;S++)we[v]&&(Ee[v]=se),v++;v+=I}else for(E=0;E<R;E++){for(S=0;S<O;S++)Ee[v++]=se;v+=I}else if(u.ptr+=V,o.decodeBits(c,u,K,se,xe),V=0,we)for(E=0;E<R;E++){for(S=0;S<O;S++)we[v]&&(Ee[v]=K[V++]),v++;v+=I}else for(E=0;E<R;E++){for(S=0;S<O;S++)Ee[v++]=K[V++];v+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,h=0,A=0,x=c.pixels.resultMask;if(x)if(f>1)for(g=0;g<f;g++)for(A=g*d,h=0;h<d;h++)x[h]&&(c.pixels.resultPixels[A+h]=u);else for(h=0;h<d;h++)x[h]&&(c.pixels.resultPixels[h]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(h=0;h<p;h++)c.pixels.resultPixels[h]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,A=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var x=g.width*g.height;if(p.pixels.resultPixels=new A(x*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(h>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)o.readDataOneSweep(c,p,A);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=C.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||h<4&&E>1)throw"Invalid Huffman flag "+E;E?o.readHuffman(c,p,A):o.readTiles(c,p,A)}else o.readTiles(c,p,A)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var w={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d<x;d++)D[d]||(w.pixelData[d]=f);w.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(w.fileInfo=o.formatFileInfo(p)),w}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1}(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,h=[],A,x,C={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var T=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:x,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=T.fileInfo.eofOffset,d===0&&(g=T.encodedMaskData,x=T.maskData,C.width=T.width,C.height=T.height,C.dimCount=T.dimCount||1,C.pixelType=T.pixelType||T.fileInfo.pixelType,C.mask=T.maskData),f>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var E,S,w;if(f>1&&h.length>1){for(w=C.width*C.height,C.bandMasks=h,x=new Uint8Array(w),x.set(h[0]),E=1;E<h.length;E++)for(A=h[E],S=0;S<w;S++)x[S]=x[S]&A[S];C.maskData=x}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof t4<"u"&&t4.exports?t4.exports=i:this.Lerc=i})()});var $Ae=sc((Vqi,QAe)=>{QAe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var txe=sc((kqi,exe)=>{var{webm:Oyt,mp4:Ryt}=$Ae(),uX=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,fX=()=>"wakeLock"in navigator,dX=class{constructor(){if(this.enabled=!1,fX()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else uX()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",Oyt),this._addSourceToVideo(this.noSleepVideo,"mp4",Ryt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return fX()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):uX()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(h){if(u)if(u=!1,h)p(h);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];d.apply(null,x)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],h=0,x=0,b;f<d;){var C=u[f++];switch(x){case 0:g[h++]=o[C>>2],b=(C&3)<<4,x=1;break;case 1:g[h++]=o[b|C>>4],b=(C&15)<<2,x=2;break;case 2:g[h++]=o[b|C>>6],g[h++]=o[C&63],x=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return x&&(g[h++]=o[b],g[h++]=61,x===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:h=b,g=1;break;case 1:f[d++]=h<<2|(b&48)>>4,h=b,g=2;break;case 2:f[d++]=(h&15)<<4|(b&60)>>2,h=b,g=3;break;case 3:f[d++]=(h&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(b,C,T){u[0]=b,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3]}function g(b,C,T){u[0]=b,C[T]=f[3],C[T+1]=f[2],C[T+2]=f[1],C[T+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function h(b,C){return f[0]=b[C],f[1]=b[C+1],f[2]=b[C+2],f[3]=b[C+3],u[0]}function x(b,C){return f[3]=b[C],f[2]=b[C+1],f[1]=b[C+2],f[0]=b[C+3],u[0]}c.readFloatLE=d?h:x,c.readFloatBE=d?x:h}():function(){function u(d,p,g,h){var x=p<0?1:0;if(x&&(p=-p),p===0)d(1/p>0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var b=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((x<<31|b+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,g){var h=d(p,g),x=(h>>31)*2+1,b=h>>>23&255,C=h&8388607;return b===255?C?NaN:x*(1/0):b===0?x*1401298464324817e-60*C:x*Math.pow(2,b-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,C,T){u[0]=b,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(b,C,T){u[0]=b,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(b,C){return f[0]=b[C],f[1]=b[C+1],f[2]=b[C+2],f[3]=b[C+3],f[4]=b[C+4],f[5]=b[C+5],f[6]=b[C+6],f[7]=b[C+7],u[0]}function x(b,C){return f[7]=b[C],f[6]=b[C+1],f[5]=b[C+2],f[4]=b[C+3],f[3]=b[C+4],f[2]=b[C+5],f[1]=b[C+6],f[0]=b[C+7],u[0]}c.readDoubleLE=d?h:x,c.readDoubleBE=d?x:h}():function(){function u(d,p,g,h,x,b){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,x,b+p),d(1/h>0?0:2147483648,x,b+g);else if(isNaN(h))d(0,x,b+p),d(2146959360,x,b+g);else if(h>17976931348623157e292)d(0,x,b+p),d((C<<31|2146435072)>>>0,x,b+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,x,b+p),d((C<<31|T/4294967296)>>>0,x,b+g);else{var A=Math.floor(Math.log(h)/Math.LN2);A===1024&&(A=1023),T=h*Math.pow(2,-A),d(T*4503599627370496>>>0,x,b+p),d((C<<31|A+1023<<20|T*1048576&1048575)>>>0,x,b+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,g,h,x){var b=d(h,x+p),C=d(h,x+g),T=(C>>31)*2+1,A=C>>>20&2047,S=4294967296*(C&1048575)+b;return A===2047?S?NaN:T*(1/0):A===0?T*5e-324*S:T*Math.pow(2,A-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=r[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d<r.length;++d)u=r.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,x){return RangeError("index out of range: "+h.pos+" + "+(x||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):u(T)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var h=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,h}if(this.len-this.pos>4){for(;x<5;++x)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,x){return(h[x-4]|h[x-3]<<8|h[x-2]<<16|h[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);return this.pos+=x,Array.isArray(this.buf)?this.buf.slice(b,C):b===C?new this.buf.constructor(0):this._slice.call(this.buf,b,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){o=h,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(A,S,v){this.fn=A,this.len=S,this.next=undefined,this.val=v}function u(){}function f(A){this.head=A.head,this.tail=A.tail,this.len=A.len,this.next=A.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new o})()}:function(){return new d}};d.create=p(),d.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(S,v,I){return this.tail=this.tail.next=new c(S,v,I),this.len+=v,this};function g(A,S,v){S[v]=A&255}function h(A,S,v){for(;A>127;)S[v++]=A&127|128,A>>>=7;S[v]=A}function x(A,S){this.len=A,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(A,S,v){for(;A.hi;)S[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)S[v++]=A.lo&127|128,A.lo=A.lo>>>7;S[v++]=A.lo}d.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(A,S,v){S[v]=A&255,S[v+1]=A>>>8&255,S[v+2]=A>>>16&255,S[v+3]=A>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var v=r.from(S);return this._push(C,4,v.lo)._push(C,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,v,I){v.set(S,I)}:function(S,v,I){for(var O=0;O<S.length;++O)v[I+O]=S[O]};d.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var I=d.alloc(v=s.length(S));s.decode(S,I,0),S=I}return this.uint32(v)._push(T,v,S)},d.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,v=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=S.next,this.tail=v,this.len+=I),this},d.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),I=0;S;)S.fn(S.val,v,I),I+=S.len,S=S.next;return v},d._configure=function(A){o=A,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var K0e=Vc((Zwi,w4)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,x=r(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),b={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return x.resultMask&&(b.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(g),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,d,p,g,h){var x=0,b=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/b),A=Math.floor(f.height/C),S=2*f.maxZError,v=Number.MAX_VALUE,I;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new d(f.width*f.height),h&&p&&(R=new Uint8Array(f.width*f.height));for(var N=new Float32Array(T*A),F,_,E=0;E<=C;E++){var w=E!==C?A:f.height%C;if(w!==0)for(var D=0;D<=b;D++){var M=D!==b?T:f.width%b;if(M!==0){var B=E*f.width*A+D*T,V=f.width-M,U=f.pixels.blocks[x],G,k,Y;U.encoding<2?(U.encoding===0?G=U.rawData:(u(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,S,N,f.pixels.maxValue),G=N),k=0):U.encoding===2?Y=0:Y=U.offset;var j;if(p)for(_=0;_<w;_++){for(B&7&&(j=p[B>>3],j<<=B&7),F=0;F<M;F++)B&7||(j=p[B>>3]),j&128?(R&&(R[B]=1),I=U.encoding<2?G[k++]:Y,v=v>I?I:v,O[B++]=I):(R&&(R[B]=0),O[B++]=g),j<<=1;B+=V}else if(U.encoding<2)for(_=0;_<w;_++){for(F=0;F<M;F++)I=G[k++],v=v>I?I:v,O[B++]=I;B+=V}else for(v=v>Y?Y:v,_=0;_<w;_++){for(F=0;F<M;F++)O[B++]=Y;B+=V}if(U.encoding===1&&k!==U.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var h=f.pixels.blocks[g];h.encoding===0?p.float32=!0:h.encoding===1?p[h.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},h=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,h),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var x=new DataView(f,d,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),d+=24,!p)if(x=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var C=x.getInt16(0,!0),T=2,A=0;do{if(C>0)for(;C--;)b[A++]=x.getUint8(T++);else{var S=x.getUint8(T++);for(C=-C;C--;)b[A++]=S}C=x.getInt16(T,!0),T+=2}while(T<g.mask.numBytes);if(C!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,I=g.pixels.numBlocksY,O=v+(g.width%v>0?1:0),R=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(O*R);for(var N=0,F=0;F<R;F++)for(var _=0;_<O;_++){var E=0,w=f.byteLength-d;x=new DataView(f,d,Math.min(10,w));var D={};g.pixels.blocks[N++]=D;var M=x.getUint8(0);if(E++,D.encoding=M&63,D.encoding>3)throw"Invalid block encoding ("+D.encoding+")";if(D.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,D.offsetType=M,M===2)D.offset=x.getInt8(1),E++;else if(M===1)D.offset=x.getInt16(1,!0),E+=2;else if(M===0)D.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(D.encoding===1)if(M=x.getUint8(E),E++,D.bitsPerPixel=M&63,M>>=6,D.numValidPixelsType=M,M===2)D.numValidPixels=x.getUint8(E),E++;else if(M===1)D.numValidPixels=x.getUint16(E,!0),E+=2;else if(M===0)D.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,D.encoding!==3){var B,V;if(D.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";B=new ArrayBuffer(U*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,U*4));var G=new Float32Array(B);D.rawData=G,d+=U*4}else if(D.encoding===1){var k=Math.ceil(D.numValidPixels*D.bitsPerPixel/8),Y=Math.ceil(k/4);B=new ArrayBuffer(Y*4),V=new Uint8Array(B),V.set(new Uint8Array(f,d,k)),D.stuffedData=new Uint32Array(B),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,x,b){var C=(1<<d)-1,T=0,A,S=0,v,I,O=Math.ceil((b-g)/h),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,A=0;A<p;A++){if(S===0&&(I=f[T++],S=32),S>=d)v=I>>>S-d&C,S-=d;else{var N=d-S;v=(I&C)<<N&C,I=f[T++],S=32-N,v+=I>>>S}x[A]=v<O?g+v*h:b}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,d,p,g,h,x){var b=(1<<f)-1,C=0,T,A=0,S,v,I,O,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(T=0;T<d;T++)A===0&&(v=c[C++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(I=f-A,S=(v&b)<<I&b,v=c[C++],A=32-I,S+=v>>>A),u[T]=p[S];else for(O=Math.ceil((x-g)/h),T=0;T<d;T++)A===0&&(v=c[C++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(I=f-A,S=(v&b)<<I&b,v=c[C++],A=32-I,S+=v>>>A),u[T]=S<O?g+S*h:x},unstuffLUT:function(c,u,f,d,p,g){var h=(1<<u)-1,x=0,b=0,C=0,T=0,A=0,S,v=[],I=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*I;var O=Math.ceil((g-d)/p);for(b=0;b<f;b++)T===0&&(S=c[x++],T=32),T>=u?(A=S>>>T-u&h,T-=u):(C=u-T,A=(S&h)<<C&h,S=c[x++],T=32-C,A+=S>>>T),v[b]=A<O?d+A*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,h,x){var b=(1<<f)-1,C=0,T,A=0,S=0,v,I,O;if(p)for(T=0;T<d;T++)A===0&&(I=c[C++],A=32,S=0),A>=f?(v=I>>>S&b,A-=f,S+=f):(O=f-A,v=I>>>S&b,I=c[C++],A=32-O,v|=(I&(1<<O)-1)<<f-O,S=O),u[T]=p[v];else{var R=Math.ceil((x-g)/h);for(T=0;T<d;T++)A===0&&(I=c[C++],A=32,S=0),A>=f?(v=I>>>S&b,A-=f,S+=f):(O=f-A,v=I>>>S&b,I=c[C++],A=32-O,v|=(I&(1<<O)-1)<<f-O,S=O),u[T]=v<R?g+v*h:x}return u},unstuffLUT2:function(c,u,f,d,p,g){var h=(1<<u)-1,x=0,b=0,C=0,T=0,A=0,S=0,v,I=[],O=Math.ceil((g-d)/p);for(b=0;b<f;b++)T===0&&(v=c[x++],T=32,S=0),T>=u?(A=v>>>S&h,T-=u,S+=u):(C=u-T,A=v>>>S&h,v=c[x++],T=32-C,A|=(v&(1<<C)-1)<<u-C,S=C),I[b]=A<O?d+A*p:g;return I.unshift(d),I},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,h,x=0,b,C,T,A=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*A,h=0;h<d;h++)x===0&&(C=c[g++],x=32),x>=f?(b=C>>>x-f&p,x-=f):(T=f-x,b=(C&p)<<T&p,C=c[g++],x=32-T,b+=C>>>x),u[h]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,h,x=0,b=0,C,T,A;for(h=0;h<d;h++)x===0&&(T=c[g++],x=32,b=0),x>=f?(C=T>>>b&p,x-=f,b+=f):(A=f-x,C=T>>>b&p,T=c[g++],x=32-A,C|=(T&(1<<A)-1)<<f-A,b=A),u[h]=C;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var h=p>=359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(h>=3&&(b=h>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(g[x]!==h[x]){b=!1;break}return f.minValues=g,f.maxValues=h,b},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),h=new Uint8Array(g);h.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,h=new DataView(c,f,4),x={};if(x.numBytes=h.getUint32(0,!0),f+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var b,C;if(g===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,C=new Uint8Array(p),u.pixels.resultMask=C,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,x.numBytes);var T=h.getInt16(0,!0),A=2,S=0,v=0;do{if(T>0)for(;T--;)b[S++]=h.getUint8(A++);else for(v=h.getUint8(A++),T=-T;T--;)b[S++]=v;T=h.getInt16(A,!0),A+=2}while(A<x.numBytes);if(T!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var I=0,O=0;for(O=0;O<p;O++)O&7?(I=b[O>>3],I<<=O&7):I=b[O>>3],I&128&&(C[O]=1);u.pixels.resultMask=C,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*g,C,T=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,b);else{var A=new ArrayBuffer(b),S=new Uint8Array(A);S.set(new Uint8Array(c,d,b)),C=new f(A)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var v=0,I=0,O=0,R=0;if(g>1)for(O=0;O<g;O++)for(R=O*h,I=0;I<h;I++)T[I]&&(u.pixels.resultPixels[R+I]=C[v++]);else for(I=0;I<h;I++)T[I]&&(u.pixels.resultPixels[I]=C[v++])}return d+=b,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),h=d.getInt32(8,!0),x=d.getInt32(12,!0);if(h>=x)return!1;var b=new Uint32Array(x-h);r.decodeBits(c,u,b);var C=[],T,A,S,v;for(T=h;T<x;T++)A=T-(T<g?0:g),C[A]={first:b[T-h],second:null};var I=c.byteLength-u.ptr,O=Math.ceil(I/4),R=new ArrayBuffer(O*4),N=new Uint8Array(R);N.set(new Uint8Array(c,u.ptr,I));var F=new Uint32Array(R),_=0,E,w=0;for(E=F[0],T=h;T<x;T++)A=T-(T<g?0:g),v=C[A].first,v>0&&(C[A].second=E<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,E=F[w])):(_+=v-32,w++,E=F[w],C[A].second|=E>>>32-_));var D=0,M=0,B=new s;for(T=0;T<C.length;T++)C[T]!==void 0&&(D=Math.max(D,C[T].first));D>=f?M=f:M=D,D>=30&&console.log("WARning, large NUM LUT BITS IS "+D);var V=[],U,G,k,Y,j,$;for(T=h;T<x;T++)if(A=T-(T<g?0:g),v=C[A].first,v>0)if(U=[v,A],v<=M)for(G=C[A].second<<M-v,k=1<<M-v,S=0;S<k;S++)V[G|S]=U;else for(G=C[A].second,$=B,Y=v-1;Y>=0;Y--)j=G>>>Y&1,j?($.right||($.right=new s),$=$.right):($.left||($.left=new s),$=$.left),Y===0&&!$.val&&($.val=U[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:D,tree:B,stuffedData:F,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,x=h*g,b=this.readHuffmanTree(c,u),C=b.decodeLut,T=b.tree,A=b.stuffedData,S=b.srcPtr,v=b.bitPos,I=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,N,F,_,E=u.pixels.resultMask,w,D,M,B,V,U,G,k=0;v>0&&(S++,v=0);var Y=A[S],j=u.encodeMode===1,$=new f(x*p),W=$,K;for(K=0;K<d.numDims;K++){if(p>1&&(W=new f($.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===h*g)for(U=0,B=0;B<g;B++)for(V=0;V<h;V++,U++){if(F=0,w=Y<<v>>>32-I,D=w,32-v<I&&(w|=A[S+1]>>>64-v-I,D=w),C[D])F=C[D][1],v+=C[D][0];else for(w=Y<<v>>>32-O,D=w,32-v<O&&(w|=A[S+1]>>>64-v-O,D=w),N=T,G=0;G<O;G++)if(M=w>>>O-G-1&1,N=M?N.right:N.left,!(N.left||N.right)){F=N.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=A[S]),_=F-R,j?(V>0?_+=k:B>0?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}else for(U=0,B=0;B<g;B++)for(V=0;V<h;V++,U++)if(E[U]){if(F=0,w=Y<<v>>>32-I,D=w,32-v<I&&(w|=A[S+1]>>>64-v-I,D=w),C[D])F=C[D][1],v+=C[D][0];else for(w=Y<<v>>>32-O,D=w,32-v<O&&(w|=A[S+1]>>>64-v-O,D=w),N=T,G=0;G<O;G++)if(M=w>>>O-G-1&1,N=M?N.right:N.left,!(N.left||N.right)){F=N.val,v=v+G+1;break}v>=32&&(v-=32,S++,Y=A[S]),_=F-R,j?(V>0&&E[U-1]?_+=k:B>0&&E[U-h]?_+=W[U-h]:_+=k,_&=255,W[U]=_,k=_):W[U]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=$},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,x=0,b=new DataView(c,u.ptr,5),C=b.getUint8(0);x++;var T=C>>6,A=T===0?4:3-T,S=(C&32)>0,v=C&31,I=0;if(A===1)I=b.getUint8(x),x++;else if(A===2)I=b.getUint16(x,!0),x+=2;else if(A===4)I=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,R,N,F,_,E,w,D,M,B,V,U=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,M=b.getUint8(x),B=v,x++,_=Math.ceil((M-1)*v/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),u.ptr+=x,F.set(new Uint8Array(c,u.ptr,_)),D=new Uint32Array(N),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(I*V/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),F.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(N),u.ptr+=_,h>=3?w=o.unstuffLUT2(D,v,M-1,d,O,U):w=o.unstuffLUT(D,v,M-1,d,O,U),h>=3?o.unstuff2(R,f,V,I,w):o.unstuff(R,f,V,I,w)}else u.counter.bitstuffer++,V=v,u.ptr+=x,V>0&&(_=Math.ceil(I*V/8),E=Math.ceil(_/4),N=new ArrayBuffer(E*4),F=new Uint8Array(N),F.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(N),u.ptr+=_,h>=3?d==null?o.originalUnstuff2(R,f,V,I):o.unstuff2(R,f,V,I,!1,d,O,U):d==null?o.originalUnstuff(R,f,V,I):o.unstuff(R,f,V,I,!1,d,O,U))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,x=d.imageType,b=r.getDataTypeSize(x),C=Math.ceil(p/h),T=Math.ceil(g/h);u.pixels.numBlocksY=T,u.pixels.numBlocksX=C,u.pixels.ptr=0;var A=0,S=0,v=0,I=0,O=0,R=0,N=0,F=0,_=0,E=0,w=0,D=0,M=0,B=0,V=0,U=0,G,k,Y,j,$,W,K=new f(h*h),J=g%h||h,he=p%h||h,ge,se,pe=d.numDims,xe,De=u.pixels.resultMask,Se=u.pixels.resultPixels;for(v=0;v<T;v++)for(O=v!==T-1?h:J,I=0;I<C;I++)for(R=I!==C-1?h:he,w=v*p*h+I*h,D=p-R,xe=0;xe<pe;xe++){if(pe>1&&(Se=new f(u.pixels.resultPixels.buffer,p*g*xe*b,p*g)),N=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,N)),k={},U=0,F=G.getUint8(0),U++,_=F>>6&255,E=F>>2&15,E!==(I*h>>3&15))throw"integrity issue";if(W=F&3,W>3)throw u.ptr+=U,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=U;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=U,M=O*R*b,B=c.byteLength-u.ptr,M=M<B?M:B,Y=new ArrayBuffer(M%b===0?M:M+b-M%b),j=new Uint8Array(Y),j.set(new Uint8Array(c,u.ptr,M)),$=new f(Y),V=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Se[w]=$[V++]),w++;w+=D}else for(A=0;A<O;A++){for(S=0;S<R;S++)Se[w++]=$[V++];w+=D}u.ptr+=V*b}else if(ge=r.getDataTypeUsed(x,_),se=r.getOnePixel(k,U,ge,G),U+=r.getDataTypeSize(ge),W===3)if(u.ptr+=U,u.counter.constantoffset++,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Se[w]=se),w++;w+=D}else for(A=0;A<O;A++){for(S=0;S<R;S++)Se[w++]=se;w+=D}else if(u.ptr+=U,r.decodeBits(c,u,K,se,xe),U=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Se[w]=K[U++]),w++;w+=D}else for(A=0;A<O;A++){for(S=0;S<R;S++)Se[w++]=K[U++];w+=D}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,h=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(x=g*d,h=0;h<d;h++)b[h]&&(c.pixels.resultPixels[x+h]=u);else for(h=0;h<d;h++)b[h]&&(c.pixels.resultPixels[h]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(h=0;h<p;h++)c.pixels.resultPixels[h]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new x(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,x);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var A=C.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||h<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var I=p.pixels.resultMask;for(d=0;d<b;d++)I[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,g,h=[],x,b,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var T=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=T.fileInfo.eofOffset,d===0&&(g=T.encodedMaskData,b=T.maskData,C.width=T.width,C.height=T.height,C.dimCount=T.dimCount||1,C.pixelType=T.pixelType||T.fileInfo.pixelType,C.mask=T.maskData),f>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var A,S,v;if(f>1&&h.length>1){for(v=C.width*C.height,C.bandMasks=h,b=new Uint8Array(v),b.set(h[0]),A=1;A<h.length;A++)for(x=h[A],S=0;S<v;S++)b[S]=b[S]&x[S];C.maskData=b}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof w4<"u"&&w4.exports?w4.exports=i:this.Lerc=i})()});var pbe=Vc((fXi,hbe)=>{hbe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var gbe=Vc((dXi,_be)=>{var{webm:jyt,mp4:qyt}=pbe(),yX=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,xX=()=>"wakeLock"in navigator,bX=class{constructor(){if(this.enabled=!1,xX()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else yX()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",jyt),this._addSourceToVideo(this.noSleepVideo,"mp4",qyt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return xX()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):yX()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. - `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){fX()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):uX()?this.noSleepTimer&&(console.warn(` + `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){xX()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):yX()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};exe.exports=dX});var gx={},Rxe={addCache:function(e,t){return gx[e]=t,t},removeCache:function(e){delete gx[e]},getCache:function(e){return gx[e]},getCacheOrAdd:function(e){return gx[e]||(gx[e]={}),gx[e]}},n_=Rxe;function Mxe(e){return e!=null}var l=Mxe;function zy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(zy.prototype=Object.create(Error.prototype),zy.prototype.constructor=zy);zy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};zy.throwInstantiationError=function(){throw new zy("This function defines an interface and should not be called directly.")};var fe=zy;var es={};es.typeOf={};function Bxe(e){return`${e} is required, actual value was undefined`}function yx(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}es.defined=function(e,t){if(!l(t))throw new fe(Bxe(e))};es.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(yx(typeof t,"function",e))};es.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(yx(typeof t,"string",e))};es.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(yx(typeof t,"number",e))};es.typeOf.number.lessThan=function(e,t,n){if(es.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};es.typeOf.number.lessThanOrEquals=function(e,t,n){if(es.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};es.typeOf.number.greaterThan=function(e,t,n){if(es.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};es.typeOf.number.greaterThanOrEquals=function(e,t,n){if(es.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};es.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(yx(typeof t,"object",e))};es.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(yx(typeof t,"boolean",e))};es.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(yx(typeof t,"bigint",e))};es.typeOf.number.equals=function(e,t,n,i){if(es.typeOf.number(e,n),es.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var vl=es;function IX(e,t){return e??t}IX.EMPTY_OBJECT=Object.freeze({});var y=IX;var XH=co(XI(),1);var at={};at.EPSILON1=.1;at.EPSILON2=.01;at.EPSILON3=.001;at.EPSILON4=1e-4;at.EPSILON5=1e-5;at.EPSILON6=1e-6;at.EPSILON7=1e-7;at.EPSILON8=1e-8;at.EPSILON9=1e-9;at.EPSILON10=1e-10;at.EPSILON11=1e-11;at.EPSILON12=1e-12;at.EPSILON13=1e-13;at.EPSILON14=1e-14;at.EPSILON15=1e-15;at.EPSILON16=1e-16;at.EPSILON17=1e-17;at.EPSILON18=1e-18;at.EPSILON19=1e-19;at.EPSILON20=1e-20;at.EPSILON21=1e-21;at.GRAVITATIONALPARAMETER=3986004418e5;at.SOLAR_RADIUS=6955e5;at.LUNAR_RADIUS=1737400;at.SIXTY_FOUR_KILOBYTES=64*1024;at.FOUR_GIGABYTES=4*1024*1024*1024;at.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});at.signNotZero=function(e){return e<0?-1:1};at.toSNorm=function(e,t){return t=y(t,255),Math.round((at.clamp(e,-1,1)*.5+.5)*t)};at.fromSNorm=function(e,t){return t=y(t,255),at.clamp(e,0,t)/t*2-1};at.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:at.clamp((e-t)/n,0,1)};at.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});at.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});at.lerp=function(e,t,n){return(1-n)*e+n*t};at.PI=Math.PI;at.ONE_OVER_PI=1/Math.PI;at.PI_OVER_TWO=Math.PI/2;at.PI_OVER_THREE=Math.PI/3;at.PI_OVER_FOUR=Math.PI/4;at.PI_OVER_SIX=Math.PI/6;at.THREE_PI_OVER_TWO=3*Math.PI/2;at.TWO_PI=2*Math.PI;at.ONE_OVER_TWO_PI=1/(2*Math.PI);at.RADIANS_PER_DEGREE=Math.PI/180;at.DEGREES_PER_RADIAN=180/Math.PI;at.RADIANS_PER_ARCSECOND=at.RADIANS_PER_DEGREE/3600;at.toRadians=function(e){return e*at.RADIANS_PER_DEGREE};at.toDegrees=function(e){return e*at.DEGREES_PER_RADIAN};at.convertLongitudeRange=function(e){let t=at.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};at.clampToLatitudeRange=function(e){return at.clamp(e,-1*at.PI_OVER_TWO,at.PI_OVER_TWO)};at.negativePiToPi=function(e){return e>=-at.PI&&e<=at.PI?e:at.zeroToTwoPi(e+at.PI)-at.PI};at.zeroToTwoPi=function(e){if(e>=0&&e<=at.TWO_PI)return e;let t=at.mod(e,at.TWO_PI);return Math.abs(t)<at.EPSILON14&&Math.abs(e)>at.EPSILON14?at.TWO_PI:t};at.mod=function(e,t){return at.sign(e)===at.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};at.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};at.lessThan=function(e,t,n){return e-t<-n};at.lessThanOrEquals=function(e,t,n){return e-t<n};at.greaterThan=function(e,t,n){return e-t>n};at.greaterThanOrEquals=function(e,t,n){return e-t>-n};var KI=[1];at.factorial=function(e){let t=KI.length;if(e>=t){let n=KI[t-1];for(let i=t;i<=e;i++){let r=n*i;KI.push(r),n=r}}return KI[e]};at.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};at.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};at.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};at.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};at.clamp=function(e,t,n){return e<t?t:e>n?n:e};var OX=new XH.default;at.setRandomNumberSeed=function(e){OX=new XH.default(e)};at.nextRandomNumber=function(){return OX.random()};at.randomBetween=function(e,t){return at.nextRandomNumber()*(t-e)+e};at.acosClamped=function(e){return Math.acos(at.clamp(e,-1,1))};at.asinClamped=function(e){return Math.asin(at.clamp(e,-1,1))};at.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};at.logBase=function(e,t){return Math.log(e)/Math.log(t)};at.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});at.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});at.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};at.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};at.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=at.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?at.PI_OVER_TWO-i:i,i=e<0?at.PI-i:i,i=t<0?-i:i,i};var P=at;function et(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,r=y(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t};et.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)et.pack(e[r],t,r*3);return t};et.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let r=i/3;t[r]=et.unpack(e,i,t[r])}return t};et.fromArray=et.unpack;et.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};et.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};et.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};et.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};et.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=r,i.y=o,i.z=s,i};et.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};et.magnitude=function(e){return Math.sqrt(et.magnitudeSquared(e))};var ZI=new et;et.distance=function(e,t){return et.subtract(e,t,ZI),et.magnitude(ZI)};et.distanceSquared=function(e,t){return et.subtract(e,t,ZI),et.magnitudeSquared(ZI)};et.normalize=function(e,t){let n=et.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};et.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};et.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};et.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};et.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};et.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};et.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};et.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};et.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};et.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var RX=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,RX),i=et.multiplyByScalar(e,1-n,i),et.add(RX,i,i)};var JI=new et,KH=new et;et.angleBetween=function(e,t){et.normalize(e,JI),et.normalize(t,KH);let n=et.dot(JI,KH),i=et.magnitude(et.cross(JI,KH,JI));return Math.atan2(i,n)};var Lxe=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,Lxe);return et.abs(n,n),n.x<=n.y?n.x<=n.z?t=et.clone(et.UNIT_X,t):t=et.clone(et.UNIT_Z,t):n.y<=n.z?t=et.clone(et.UNIT_Y,t):t=et.clone(et.UNIT_Z,t),t};et.projectVector=function(e,t,n){let i=et.dot(e,t)/et.dot(t,t);return et.multiplyByScalar(t,i,n)};et.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};et.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};et.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};et.cross=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=t.x,a=t.y,c=t.z,u=r*c-o*a,f=o*s-i*c,d=i*a-r*s;return n.x=u,n.y=f,n.z=d,n};et.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};et.fromDegrees=function(e,t,n,i,r){return e=P.toRadians(e),t=P.toRadians(t),et.fromRadians(e,t,n,i,r)};var vu=new et,Ax=new et,Nxe=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,r){n=y(n,0);let o=l(i)?i.radiiSquared:Nxe,s=Math.cos(t);vu.x=s*Math.cos(e),vu.y=s*Math.sin(e),vu.z=Math.sin(t),vu=et.normalize(vu,vu),et.multiplyComponents(o,vu,Ax);let a=Math.sqrt(et.dot(vu,Ax));return Ax=et.divideByScalar(Ax,a,Ax),vu=et.multiplyByScalar(vu,n,vu),l(r)||(r=new et),et.add(Ax,vu,r)};et.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=et.fromDegrees(o,s,0,t,n[a])}return n};et.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=et.fromRadians(o,s,0,t,n[a])}return n};et.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=et.fromDegrees(o,s,a,t,n[c])}return n};et.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=et.fromRadians(o,s,a,t,n[c])}return n};et.ZERO=Object.freeze(new et(0,0,0));et.ONE=Object.freeze(new et(1,1,1));et.UNIT_X=Object.freeze(new et(1,0,0));et.UNIT_Y=Object.freeze(new et(0,1,0));et.UNIT_Z=Object.freeze(new et(0,0,1));et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.prototype.equalsEpsilon=function(e,t,n){return et.equalsEpsilon(this,e,t,n)};et.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=et;function At(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}At.fromElements=function(e,t,n,i,r){return l(r)?(r.x=e,r.y=t,r.z=n,r.w=i,r):new At(e,t,n,i)};At.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new At(e.red,e.green,e.blue,e.alpha)};At.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new At(e.x,e.y,e.z,e.w)};At.packedLength=4;At.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};At.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new At),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};At.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)At.pack(e[r],t,r*4);return t};At.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=At.unpack(e,i,t[r])}return t};At.fromArray=At.unpack;At.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};At.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};At.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};At.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};At.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=r,i.y=o,i.z=s,i.w=a,i};At.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};At.magnitude=function(e){return Math.sqrt(At.magnitudeSquared(e))};var QI=new At;At.distance=function(e,t){return At.subtract(e,t,QI),At.magnitude(QI)};At.distanceSquared=function(e,t){return At.subtract(e,t,QI),At.magnitudeSquared(QI)};At.normalize=function(e,t){let n=At.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};At.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};At.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};At.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};At.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};At.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};At.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};At.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};At.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};At.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var MX=new At;At.lerp=function(e,t,n,i){return At.multiplyByScalar(t,n,MX),i=At.multiplyByScalar(e,1-n,i),At.add(MX,i,i)};var Fxe=new At;At.mostOrthogonalAxis=function(e,t){let n=At.normalize(e,Fxe);return At.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=At.clone(At.UNIT_X,t):t=At.clone(At.UNIT_W,t):n.z<=n.w?t=At.clone(At.UNIT_Z,t):t=At.clone(At.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=At.clone(At.UNIT_Y,t):t=At.clone(At.UNIT_W,t):n.z<=n.w?t=At.clone(At.UNIT_Z,t):t=At.clone(At.UNIT_W,t),t};At.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};At.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};At.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};At.ZERO=Object.freeze(new At(0,0,0,0));At.ONE=Object.freeze(new At(1,1,1,1));At.UNIT_X=Object.freeze(new At(1,0,0,0));At.UNIT_Y=Object.freeze(new At(0,1,0,0));At.UNIT_Z=Object.freeze(new At(0,0,1,0));At.UNIT_W=Object.freeze(new At(0,0,0,1));At.prototype.clone=function(e){return At.clone(this,e)};At.prototype.equals=function(e){return At.equals(this,e)};At.prototype.equalsEpsilon=function(e,t,n){return At.equalsEpsilon(this,e,t,n)};At.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var JH=new Float32Array(1),wa=new Uint8Array(JH.buffer),Uxe=new Uint32Array([287454020]),Vxe=new Uint8Array(Uxe.buffer),BX=Vxe[0]===68;At.packFloat=function(e,t){return l(t)||(t=new At),JH[0]=e,BX?(t.x=wa[0],t.y=wa[1],t.z=wa[2],t.w=wa[3]):(t.x=wa[3],t.y=wa[2],t.z=wa[1],t.w=wa[0]),t};At.unpackFloat=function(e){return BX?(wa[0]=e.x,wa[1]=e.y,wa[2]=e.z,wa[3]=e.w):(wa[0]=e.w,wa[1]=e.z,wa[2]=e.y,wa[3]=e.x),JH[0]};var oe=At;function tt(e,t,n,i,r,o,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(o,0),this[8]=y(c,0)}tt.packedLength=9;tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};tt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)tt.pack(e[r],t,r*9);return t};tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let r=i/9;t[r]=tt.unpack(e,i,t[r])}return t};tt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,r=e.x*e.z,o=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),h=2*(r+c),A=2*(i+f),x=-n+s-u+d,C=2*(a-o),T=2*(r-c),E=2*(a+o),S=-n-s+u+d;return l(t)?(t[0]=p,t[1]=A,t[2]=T,t[3]=g,t[4]=x,t[5]=E,t[6]=h,t[7]=C,t[8]=S,t):new tt(p,g,h,A,x,C,T,E,S)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),r=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-r*s+a*o*i,f=a*s+r*o*i,d=n*s,p=r*i+a*o*s,g=-a*i+r*o*s,h=-o,A=a*n,x=r*n;return l(t)?(t[0]=c,t[1]=d,t[2]=h,t[3]=u,t[4]=p,t[5]=A,t[6]=f,t[7]=g,t[8]=x,t):new tt(c,u,f,d,p,g,h,A,x)};tt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};tt.getElementIndex=function(e,t){return e*3+t};tt.getColumn=function(e,t,n){let i=t*3,r=e[i],o=e[i+1],s=e[i+2];return n.x=r,n.y=o,n.z=s,n};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let r=t*3;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i};tt.getRow=function(e,t,n){let i=e[t],r=e[t+3],o=e[t+6];return n.x=i,n.y=r,n.z=o,n};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var kxe=new m;tt.setScale=function(e,t,n){let i=tt.getScale(e,kxe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var zxe=new m;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,zxe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var ZH=new m;tt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],ZH)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],ZH)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],ZH)),t};var LX=new m;tt.getMaximumScale=function(e){return tt.getScale(e,LX),m.maximumComponent(LX)};var Hxe=new m;tt.setRotation=function(e,t,n){let i=tt.getScale(e,Hxe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var Gxe=new m;tt.getRotation=function(e,t){let n=tt.getScale(e,Gxe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};tt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};tt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};tt.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[3]*r+e[6]*o,a=e[1]*i+e[4]*r+e[7]*o,c=e[2]*i+e[5]*r+e[8]*o;return n.x=s,n.y=a,n.z=c,n};tt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};tt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};tt.transpose=function(e,t){let n=e[0],i=e[3],r=e[6],o=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function Wxe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var QH=[1,0,0],$H=[2,2,1];function jxe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex($H[n],QH[n])];t+=2*i*i}return Math.sqrt(t)}function Yxe(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex($H[u],QH[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=QH[r],c=$H[r];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=o,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var $I=new tt,NX=new tt;tt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,r=0,o=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*Wxe(a);for(;o<i&&jxe(a)>c;)Yxe(a,$I),tt.transpose($I,NX),tt.multiply(a,$I,a),tt.multiply(NX,a,a),tt.multiply(s,$I,s),++r>2&&(++o,r=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(o*u-c*s)+r*(c*i-n*u)+a*(n*s-o*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*r-i*f,t[2]=i*a-s*r,t[3]=c*a-o*f,t[4]=n*f-c*r,t[5]=o*r-n*a,t[6]=o*u-c*s,t[7]=c*i-n*u,t[8]=n*s-o*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var qxe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,qxe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};_be.exports=bX});var xb={},Xbe={addCache:function(e,t){return xb[e]=t,t},removeCache:function(e){delete xb[e]},getCache:function(e){return xb[e]},getCacheOrAdd:function(e){return xb[e]||(xb[e]={}),xb[e]}},r_=Xbe;function BX(e,t){return e??t}BX.EMPTY_OBJECT=Object.freeze({});var y=BX;function Kbe(e){return e!=null}var l=Kbe;function Gy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Gy.prototype=Object.create(Error.prototype),Gy.prototype.constructor=Gy);Gy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};Gy.throwInstantiationError=function(){throw new Gy("This function defines an interface and should not be called directly.")};var fe=Gy;var is={};is.typeOf={};function Jbe(e){return`${e} is required, actual value was undefined`}function bb(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}is.defined=function(e,t){if(!l(t))throw new fe(Jbe(e))};is.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(bb(typeof t,"function",e))};is.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(bb(typeof t,"string",e))};is.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(bb(typeof t,"number",e))};is.typeOf.number.lessThan=function(e,t,n){if(is.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};is.typeOf.number.lessThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};is.typeOf.number.greaterThan=function(e,t,n){if(is.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};is.typeOf.number.greaterThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};is.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(bb(typeof t,"object",e))};is.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(bb(typeof t,"boolean",e))};is.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(bb(typeof t,"bigint",e))};is.typeOf.number.equals=function(e,t,n,i){if(is.typeOf.number(e,n),is.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var wl=is;function jE(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(jE.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});jE.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};jE.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function Zbe(e,t){return t-e}jE.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(Zbe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var _e=jE;function s_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(s_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});s_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};s_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};s_.prototype.equals=function(e){return this===e||e instanceof s_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};s_.prototype.valueOf=function(){return this._value};s_.prototype.toString=function(){return String(this._value)};var ei=s_;function $be(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function Qbe(e){return new ei(e)}function eCe(e,t,n){return $be(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,Qbe))}var le=eCe;function qE(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(qE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});qE.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new qE(this)};qE.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var sc=qE;function Wy(){this._array=[],this._hash={}}Object.defineProperties(Wy.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Wy.prototype.contains=function(e){return l(this._hash[e])};Wy.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Wy.prototype.get=function(e){return this._hash[e]};Wy.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Wy.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var At=Wy;var rG=ur(Q1(),1);var ct={};ct.EPSILON1=.1;ct.EPSILON2=.01;ct.EPSILON3=.001;ct.EPSILON4=1e-4;ct.EPSILON5=1e-5;ct.EPSILON6=1e-6;ct.EPSILON7=1e-7;ct.EPSILON8=1e-8;ct.EPSILON9=1e-9;ct.EPSILON10=1e-10;ct.EPSILON11=1e-11;ct.EPSILON12=1e-12;ct.EPSILON13=1e-13;ct.EPSILON14=1e-14;ct.EPSILON15=1e-15;ct.EPSILON16=1e-16;ct.EPSILON17=1e-17;ct.EPSILON18=1e-18;ct.EPSILON19=1e-19;ct.EPSILON20=1e-20;ct.EPSILON21=1e-21;ct.GRAVITATIONALPARAMETER=3986004418e5;ct.SOLAR_RADIUS=6955e5;ct.LUNAR_RADIUS=1737400;ct.SIXTY_FOUR_KILOBYTES=64*1024;ct.FOUR_GIGABYTES=4*1024*1024*1024;ct.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});ct.signNotZero=function(e){return e<0?-1:1};ct.toSNorm=function(e,t){return t=y(t,255),Math.round((ct.clamp(e,-1,1)*.5+.5)*t)};ct.fromSNorm=function(e,t){return t=y(t,255),ct.clamp(e,0,t)/t*2-1};ct.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ct.clamp((e-t)/n,0,1)};ct.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});ct.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});ct.lerp=function(e,t,n){return(1-n)*e+n*t};ct.PI=Math.PI;ct.ONE_OVER_PI=1/Math.PI;ct.PI_OVER_TWO=Math.PI/2;ct.PI_OVER_THREE=Math.PI/3;ct.PI_OVER_FOUR=Math.PI/4;ct.PI_OVER_SIX=Math.PI/6;ct.THREE_PI_OVER_TWO=3*Math.PI/2;ct.TWO_PI=2*Math.PI;ct.ONE_OVER_TWO_PI=1/(2*Math.PI);ct.RADIANS_PER_DEGREE=Math.PI/180;ct.DEGREES_PER_RADIAN=180/Math.PI;ct.RADIANS_PER_ARCSECOND=ct.RADIANS_PER_DEGREE/3600;ct.toRadians=function(e){return e*ct.RADIANS_PER_DEGREE};ct.toDegrees=function(e){return e*ct.DEGREES_PER_RADIAN};ct.convertLongitudeRange=function(e){let t=ct.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ct.clampToLatitudeRange=function(e){return ct.clamp(e,-1*ct.PI_OVER_TWO,ct.PI_OVER_TWO)};ct.negativePiToPi=function(e){return e>=-ct.PI&&e<=ct.PI?e:ct.zeroToTwoPi(e+ct.PI)-ct.PI};ct.zeroToTwoPi=function(e){if(e>=0&&e<=ct.TWO_PI)return e;let t=ct.mod(e,ct.TWO_PI);return Math.abs(t)<ct.EPSILON14&&Math.abs(e)>ct.EPSILON14?ct.TWO_PI:t};ct.mod=function(e,t){return ct.sign(e)===ct.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};ct.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};ct.lessThan=function(e,t,n){return e-t<-n};ct.lessThanOrEquals=function(e,t,n){return e-t<n};ct.greaterThan=function(e,t,n){return e-t>n};ct.greaterThanOrEquals=function(e,t,n){return e-t>-n};var eD=[1];ct.factorial=function(e){let t=eD.length;if(e>=t){let n=eD[t-1];for(let i=t;i<=e;i++){let o=n*i;eD.push(o),n=o}}return eD[e]};ct.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};ct.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ct.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ct.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};ct.clamp=function(e,t,n){return e<t?t:e>n?n:e};var UX=new rG.default;ct.setRandomNumberSeed=function(e){UX=new rG.default(e)};ct.nextRandomNumber=function(){return UX.random()};ct.randomBetween=function(e,t){return ct.nextRandomNumber()*(t-e)+e};ct.acosClamped=function(e){return Math.acos(ct.clamp(e,-1,1))};ct.asinClamped=function(e){return Math.asin(ct.clamp(e,-1,1))};ct.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ct.logBase=function(e,t){return Math.log(e)/Math.log(t)};ct.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});ct.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});ct.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ct.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ct.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=ct.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ct.PI_OVER_TWO-i:i,i=e<0?ct.PI-i:i,i=t<0?-i:i,i};var P=ct;function Ot(e,t){this.x=y(e,0),this.y=y(t,0)}Ot.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ot(e,t)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ot(e.x,e.y)};Ot.fromCartesian3=Ot.clone;Ot.fromCartesian4=Ot.clone;Ot.packedLength=2;Ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ot),n.x=e[t++],n.y=e[t],n};Ot.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ot.pack(e[o],t,o*2);return t};Ot.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ot.unpack(e,i,t[o])}return t};Ot.fromArray=Ot.unpack;Ot.maximumComponent=function(e){return Math.max(e.x,e.y)};Ot.minimumComponent=function(e){return Math.min(e.x,e.y)};Ot.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ot.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ot.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ot.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ot.magnitude=function(e){return Math.sqrt(Ot.magnitudeSquared(e))};var tD=new Ot;Ot.distance=function(e,t){return Ot.subtract(e,t,tD),Ot.magnitude(tD)};Ot.distanceSquared=function(e,t){return Ot.subtract(e,t,tD),Ot.magnitudeSquared(tD)};Ot.normalize=function(e,t){let n=Ot.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Ot.dot=function(e,t){return e.x*t.x+e.y*t.y};Ot.cross=function(e,t){return e.x*t.y-e.y*t.x};Ot.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Ot.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Ot.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Ot.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Ot.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Ot.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Ot.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Ot.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var VX=new Ot;Ot.lerp=function(e,t,n,i){return Ot.multiplyByScalar(t,n,VX),i=Ot.multiplyByScalar(e,1-n,i),Ot.add(VX,i,i)};var zX=new Ot,HX=new Ot;Ot.angleBetween=function(e,t){return Ot.normalize(e,zX),Ot.normalize(t,HX),P.acosClamped(Ot.dot(zX,HX))};var tCe=new Ot;Ot.mostOrthogonalAxis=function(e,t){let n=Ot.normalize(e,tCe);return Ot.abs(n,n),n.x<=n.y?t=Ot.clone(Ot.UNIT_X,t):t=Ot.clone(Ot.UNIT_Y,t),t};Ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Ot.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ot.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Ot.ZERO=Object.freeze(new Ot(0,0));Ot.ONE=Object.freeze(new Ot(1,1));Ot.UNIT_X=Object.freeze(new Ot(1,0));Ot.UNIT_Y=Object.freeze(new Ot(0,1));Ot.prototype.clone=function(e){return Ot.clone(this,e)};Ot.prototype.equals=function(e){return Ot.equals(this,e)};Ot.prototype.equalsEpsilon=function(e,t,n){return Ot.equalsEpsilon(this,e,t,n)};Ot.prototype.toString=function(){return`(${this.x}, ${this.y})`};var H=Ot;function et(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};et.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)et.pack(e[o],t,o*3);return t};et.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=et.unpack(e,i,t[o])}return t};et.fromArray=et.unpack;et.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};et.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};et.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};et.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};et.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};et.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};et.magnitude=function(e){return Math.sqrt(et.magnitudeSquared(e))};var iD=new et;et.distance=function(e,t){return et.subtract(e,t,iD),et.magnitude(iD)};et.distanceSquared=function(e,t){return et.subtract(e,t,iD),et.magnitudeSquared(iD)};et.normalize=function(e,t){let n=et.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};et.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};et.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};et.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};et.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};et.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};et.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};et.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};et.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};et.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var GX=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,GX),i=et.multiplyByScalar(e,1-n,i),et.add(GX,i,i)};var nD=new et,sG=new et;et.angleBetween=function(e,t){et.normalize(e,nD),et.normalize(t,sG);let n=et.dot(nD,sG),i=et.magnitude(et.cross(nD,sG,nD));return Math.atan2(i,n)};var nCe=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,nCe);return et.abs(n,n),n.x<=n.y?n.x<=n.z?t=et.clone(et.UNIT_X,t):t=et.clone(et.UNIT_Z,t):n.y<=n.z?t=et.clone(et.UNIT_Y,t):t=et.clone(et.UNIT_Z,t),t};et.projectVector=function(e,t,n){let i=et.dot(e,t)/et.dot(t,t);return et.multiplyByScalar(t,i,n)};et.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};et.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};et.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};et.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,d=i*a-o*s;return n.x=u,n.y=f,n.z=d,n};et.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};et.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),et.fromRadians(e,t,n,i,o)};var vu=new et,Cb=new et,iCe=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:iCe,s=Math.cos(t);vu.x=s*Math.cos(e),vu.y=s*Math.sin(e),vu.z=Math.sin(t),vu=et.normalize(vu,vu),et.multiplyComponents(r,vu,Cb);let a=Math.sqrt(et.dot(vu,Cb));return Cb=et.divideByScalar(Cb,a,Cb),vu=et.multiplyByScalar(vu,n,vu),l(o)||(o=new et),et.add(Cb,vu,o)};et.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromDegrees(r,s,0,t,n[a])}return n};et.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromRadians(r,s,0,t,n[a])}return n};et.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromDegrees(r,s,a,t,n[c])}return n};et.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromRadians(r,s,a,t,n[c])}return n};et.ZERO=Object.freeze(new et(0,0,0));et.ONE=Object.freeze(new et(1,1,1));et.UNIT_X=Object.freeze(new et(1,0,0));et.UNIT_Y=Object.freeze(new et(0,1,0));et.UNIT_Z=Object.freeze(new et(0,0,1));et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.prototype.equalsEpsilon=function(e,t,n){return et.equalsEpsilon(this,e,t,n)};et.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=et;var oCe=new m,rCe=new m;function sCe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=s*s*u*u,g=a*a*f*f,h=d+p+g,x=Math.sqrt(1/h),b=m.multiplyByScalar(e,x,oCe);if(h<i)return isFinite(x)?m.clone(b,o):void 0;let C=n.x,T=n.y,A=n.z,S=rCe;S.x=b.x*C*2,S.y=b.y*T*2,S.z=b.z*A*2;let v=(1-x)*m.magnitude(e)/(.5*m.magnitude(S)),I=0,O,R,N,F,_,E,w,D,M,B,V;do{v-=I,N=1/(1+v*C),F=1/(1+v*T),_=1/(1+v*A),E=N*N,w=F*F,D=_*_,M=E*N,B=w*F,V=D*_,O=d*E+p*w+g*D-1,R=d*M*C+p*B*T+g*V*A;let U=-2*R;I=O/U}while(Math.abs(O)>P.EPSILON12);return l(o)?(o.x=r*N,o.y=s*F,o.z=a*_,o):new m(r*N,s*F,a*_)}var Tb=sCe;function Gr(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Gr.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Gr(e,t,n)};Gr.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Gr.fromRadians(e,t,n,i)};var aCe=new m,cCe=new m,lCe=new m,uCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),fCe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),dCe=P.EPSILON1;Gr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:uCe,o=l(t)?t.oneOverRadiiSquared:fCe,r=l(t)?t._centerToleranceSquared:dCe,s=Tb(e,i,o,r,cCe);if(!l(s))return;let a=m.multiplyComponents(s,o,aCe);a=m.normalize(a,a);let c=m.subtract(e,s,lCe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Gr(u,f,d)};Gr.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Gr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Gr(e.longitude,e.latitude,e.height)};Gr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Gr.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Gr.ZERO=Object.freeze(new Gr(0,0,0));Gr.prototype.clone=function(e){return Gr.clone(this,e)};Gr.prototype.equals=function(e){return Gr.equals(this,e)};Gr.prototype.equalsEpsilon=function(e,t){return Gr.equalsEpsilon(this,e,t)};Gr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=Gr;function jX(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ki(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,jX(this,e,t,n)}Object.defineProperties(Ki.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Ki.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ki(n.x,n.y,n.z)};Ki.fromCartesian3=function(e,t){return l(t)||(t=new Ki),l(e)&&jX(t,e.x,e.y,e.z),t};Ki.WGS84=Object.freeze(new Ki(6378137,6378137,6356752314245179e-9));Ki.UNIT_SPHERE=Object.freeze(new Ki(1,1,1));Ki.MOON=Object.freeze(new Ki(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Ki.prototype.clone=function(e){return Ki.clone(this,e)};Ki.packedLength=m.packedLength;Ki.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};Ki.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return Ki.fromCartesian3(i,n)};Ki.prototype.geocentricSurfaceNormal=m.normalize;Ki.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};Ki.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var mCe=new m,hCe=new m;Ki.prototype.cartographicToCartesian=function(e,t){let n=mCe,i=hCe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};Ki.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var pCe=new m,_Ce=new m,gCe=new m;Ki.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,_Ce);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,pCe),o=m.subtract(e,n,gCe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(m.dot(o,e))*m.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new me(r,s,a)};Ki.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};Ki.prototype.scaleToGeodeticSurface=function(e,t){return Tb(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Ki.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return m.multiplyByScalar(e,s,t)};Ki.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};Ki.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};Ki.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};Ki.prototype.toString=function(){return this._radii.toString()};Ki.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var yCe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],xCe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function WX(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*yCe[s];r+=xCe[s]*(n(i+a)+n(i-a))}return r*=o,r}Ki.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return WX(i,o,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*WX(t,n,function(g){let h=Math.cos(g),x=Math.sin(g);return Math.sqrt(u*p*p+c*(a*h*h+s*x*x)*d*d)})})};var oe=Ki;function oD(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(oD.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});oD.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};oD.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var Di=oD;var bCe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},tn=Object.freeze(bCe);function kn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(kn.prototype,{width:{get:function(){return kn.computeWidth(this)}},height:{get:function(){return kn.computeHeight(this)}}});kn.packedLength=4;kn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};kn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new kn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};kn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};kn.computeHeight=function(e){return e.north-e.south};kn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new kn(e,t,n,i)};kn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new kn(e,t,n,i)};kn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new kn(n,s,i,a)};kn.fromCartesianArray=function(e,t,n){t=y(t,oe.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new kn(i,a,o,c)};kn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new kn(e.west,e.south,e.east,e.north)};kn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};kn.prototype.clone=function(e){return kn.clone(this,e)};kn.prototype.equals=function(e){return kn.equals(this,e)};kn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};kn.prototype.equalsEpsilon=function(e,t){return kn.equalsEpsilon(this,e,t)};kn.validate=function(e){};kn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};kn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};kn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};kn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};kn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new me(o,r)};kn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new kn(a,u,c,f)};kn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new kn(i,o,r,s)};kn.union=function(e,t,n){l(n)||(n=new kn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};kn.expand=function(e,t,n){return l(n)||(n=new kn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};kn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var CCe=new me;kn.subsample=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=CCe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,kn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};kn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new kn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};kn.MAX_VALUE=Object.freeze(new kn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ce=kn;function xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}xr.packedLength=4;xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};xr.fromPoints=function(e,t){if(l(t)||(t=new xr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var TCe=new Di,ACe=new me,ECe=new me;xr.fromRectangle=function(e,t,n){if(l(n)||(n=new xr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=y(t,TCe);let i=t.project(ce.southwest(e,ACe)),o=t.project(ce.northeast(e,ECe));return H.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};xr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new xr(e.x,e.y,e.width,e.height)};xr.union=function(e,t,n){l(n)||(n=new xr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};xr.expand=function(e,t,n){n=xr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?tn.OUTSIDE:tn.INTERSECTING};xr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};xr.prototype.clone=function(e){return xr.clone(this,e)};xr.prototype.intersect=function(e){return xr.intersect(this,e)};xr.prototype.equals=function(e){return xr.equals(this,e)};var Ke=xr;var a_,br={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},zc={};Object.defineProperties(zc,{element:{get:function(){if(zc.supportsFullscreen())return document[br.fullscreenElement]}},changeEventName:{get:function(){if(zc.supportsFullscreen())return br.fullscreenchange}},errorEventName:{get:function(){if(zc.supportsFullscreen())return br.fullscreenerror}},enabled:{get:function(){if(zc.supportsFullscreen())return document[br.fullscreenEnabled]}},fullscreen:{get:function(){if(zc.supportsFullscreen())return zc.element!==null}}});zc.supportsFullscreen=function(){if(l(a_))return a_;a_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return br.requestFullscreen="requestFullscreen",br.exitFullscreen="exitFullscreen",br.fullscreenEnabled="fullscreenEnabled",br.fullscreenElement="fullscreenElement",br.fullscreenchange="fullscreenchange",br.fullscreenerror="fullscreenerror",a_=!0,a_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(br.requestFullscreen=n,a_=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(br.requestFullscreen=n,a_=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?br.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(br.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?br.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(br.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?br.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(br.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),br.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),br.fullscreenerror=n)}return a_};zc.requestFullscreen=function(e,t){zc.supportsFullscreen()&&e[br.requestFullscreen]({vrDisplay:t})};zc.exitFullscreen=function(){zc.supportsFullscreen()&&document[br.exitFullscreen]()};zc._names=br;var Cr=zc;var Ia;typeof navigator<"u"?Ia=navigator:Ia={};function jy(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var rD,qX;function dG(){if(!l(rD)&&(rD=!1,!fD())){let e=/ Chrome\/([\.0-9]+)/.exec(Ia.userAgent);e!==null&&(rD=!0,qX=jy(e[1]))}return rD}function SCe(){return dG()&&qX}var sD,YX;function XX(){if(!l(sD)&&(sD=!1,!dG()&&!fD()&&/ Safari\/[\.0-9]+/.test(Ia.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ia.userAgent);e!==null&&(sD=!0,YX=jy(e[1]))}return sD}function vCe(){return XX()&&YX}var aD,uG;function KX(){if(!l(aD)){aD=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ia.userAgent);e!==null&&(aD=!0,uG=jy(e[1]),uG.isNightly=!!e[2])}return aD}function wCe(){return KX()&&uG}var YE,fG;function JX(){if(!l(YE)){YE=!1;let e;Ia.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ia.userAgent),e!==null&&(YE=!0,fG=jy(e[1]))):Ia.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ia.userAgent),e!==null&&(YE=!0,fG=jy(e[1])))}return YE}function ICe(){return JX()&&fG}var cD,ZX;function fD(){if(!l(cD)){cD=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ia.userAgent);e!==null&&(cD=!0,ZX=jy(e[1]))}return cD}function DCe(){return fD()&&ZX}var lD,$X;function mG(){if(!l(lD)){lD=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ia.userAgent);e!==null&&(lD=!0,$X=jy(e[1]))}return lD}var aG;function PCe(){return l(aG)||(aG=/Windows/i.test(Ia.appVersion)),aG}var cG;function OCe(){return l(cG)||(cG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),cG}function RCe(){return mG()&&$X}var lG;function MCe(){return l(lG)||(lG=!mG()&&typeof PointerEvent<"u"&&(!l(Ia.pointerEnabled)||Ia.pointerEnabled)),lG}var QX,uD;function eK(){if(!l(uD)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;uD=l(t)&&t!=="",uD&&(QX=t)}return uD}function LCe(){return eK()?QX:void 0}function ac(){return ac._result}ac._promise=void 0;ac._result=void 0;ac.initialize=function(){return l(ac._promise)||(ac._promise=new Promise(e=>{let t=new Image;t.onload=function(){ac._result=t.width>0&&t.height>0,e(ac._result)},t.onerror=function(){ac._result=!1,e(ac._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ac._promise};Object.defineProperties(ac,{initialized:{get:function(){return l(ac._result)}}});var Ab=[];typeof ArrayBuffer<"u"&&(Ab.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Ab.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Ab.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Ab.push(BigInt64Array),typeof BigUint64Array<"u"&&Ab.push(BigUint64Array));var Mf={isChrome:dG,chromeVersion:SCe,isSafari:XX,safariVersion:vCe,isWebkit:KX,webkitVersion:wCe,isInternetExplorer:JX,internetExplorerVersion:ICe,isEdge:fD,edgeVersion:DCe,isFirefox:mG,firefoxVersion:RCe,isWindows:PCe,isIPadOrIOS:OCe,hardwareConcurrency:y(Ia.hardwareConcurrency,3),supportsPointerEvents:MCe,supportsImageRenderingPixelated:eK,supportsWebP:ac,imageRenderingValue:LCe,typedArrayTypes:Ab};Mf.supportsBasis=function(e){return Mf.supportsWebAssembly()&&e.context.supportsBasis};Mf.supportsFullscreen=function(){return Cr.supportsFullscreen()};Mf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Mf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Mf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Mf.supportsBigInt=function(){return typeof BigInt<"u"};Mf.supportsWebWorkers=function(){return typeof Worker<"u"};Mf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Mf.supportsWebgl2=function(e){return e.context.webgl2};var Wt=Mf;function hG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var pG,_G,Eh;Wt.supportsTypedArrays()&&(pG=new ArrayBuffer(4),_G=new Uint32Array(pG),Eh=new Uint8Array(pG));ie.fromRgba=function(e,t){return _G[0]=e,ie.fromBytes(Eh[0],Eh[1],Eh[2],Eh[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=hG(u,c,e+1/3),s=hG(u,c,e),a=hG(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var NCe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,FCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,BCe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,kCe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=NCe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=FCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=BCe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=kCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return Eh[0]=ie.floatToByte(this.red),Eh[1]=ie.floatToByte(this.green),Eh[2]=ie.floatToByte(this.blue),Eh[3]=ie.floatToByte(this.alpha),_G[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function UCe(){return!0}function VCe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=UCe}var ue=VCe;function Il(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Il.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Il.packedLength=2;Il.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Il.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Il),n.near=e[t++],n.far=e[t],n};Il.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Il.clone=function(e,t){if(l(e))return l(t)||(t=new Il),t.near=e.near,t.far=e.far,t};Il.prototype.clone=function(e){return Il.clone(this,e)};Il.prototype.equals=function(e){return Il.equals(this,e)};var Dt=Il;function wu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}wu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new wu(e.near,e.nearValue,e.far,e.farValue)};wu.packedLength=4;wu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};wu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new wu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};wu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};wu.prototype.clone=function(e){return wu.clone(this,e)};wu.prototype.equals=function(e){return wu.equals(this,e)};var Rt=wu;var zCe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qe=Object.freeze(zCe);var HCe={CENTER:0,LEFT:1,RIGHT:-1},_i=Object.freeze(HCe);var GCe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Ln=Object.freeze(GCe);var WCe={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(WCe);function Lf(){fe.throwInstantiationError()}Object.defineProperties(Lf.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});Lf.prototype.getValue=fe.throwInstantiationError;Lf.prototype.equals=fe.throwInstantiationError;Lf.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Lf.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Lf.equals(e[i],t[i]))return!1;return!0};Lf.isConstant=function(e){return!l(e)||e.isConstant};Lf.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Lf.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};Lf.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var q=Lf;var jCe=z.WHITE,qCe=m.ZERO,YCe=qe.NONE,XCe=H.ZERO,KCe=1,JCe=0,ZCe=m.ZERO,$Ce=_i.CENTER,QCe=Ln.CENTER,eTe=!1,tTe=new m,nTe=new z,iTe=new m,oTe=new H,rTe=new Rt,sTe=new Rt,aTe=new Rt,cTe=new Ke,lTe=new Dt;function tK(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function c_(e,t){t.collectionChanged.addEventListener(c_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}c_.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,tTe),c=q.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){gG(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u),u.show=f,(!l(u.image)||r.textureValue!==c)&&(u.image=c,r.textureValue=c),u.position=d,u.color=q.getValueOrDefault(a._color,e,jCe,nTe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,qCe,iTe),u.heightReference=q.getValueOrDefault(a._heightReference,e,YCe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,XCe,oTe),u.scale=q.getValueOrDefault(a._scale,e,KCe),u.rotation=q.getValueOrDefault(a._rotation,e,JCe),u.alignedAxis=q.getValueOrDefault(a._alignedAxis,e,ZCe),u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,$Ce),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,QCe),u.width=q.getValueOrUndefined(a._width,e),u.height=q.getValueOrUndefined(a._height,e),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,rTe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,sTe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,aTe),u.sizeInMeters=q.getValueOrDefault(a._sizeInMeters,e,eTe),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,lTe),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e);let p=q.getValueOrUndefined(a._imageSubRegion,e,cTe);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};c_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===qe.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};c_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new tK(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new tK(r)):(gG(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],gG(s.get(r.id),r,a),s.remove(r.id)};function gG(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var dD=c_;function uTe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Hc=uTe;function tt(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}tt.packedLength=9;tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};tt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),h=2*(o+c),x=2*(i+f),b=-n+s-u+d,C=2*(a-r),T=2*(o-c),A=2*(a+r),S=-n-s+u+d;return l(t)?(t[0]=p,t[1]=x,t[2]=T,t[3]=g,t[4]=b,t[5]=A,t[6]=h,t[7]=C,t[8]=S,t):new tt(p,g,h,x,b,C,T,A,S)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,d=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,h=-r,x=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=d,t[2]=h,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=g,t[8]=b,t):new tt(c,u,f,d,p,g,h,x,b)};tt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};tt.getElementIndex=function(e,t){return e*3+t};tt.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var fTe=new m;tt.setScale=function(e,t,n){let i=tt.getScale(e,fTe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var dTe=new m;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,dTe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var yG=new m;tt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],yG)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],yG)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],yG)),t};var nK=new m;tt.getMaximumScale=function(e){return tt.getScale(e,nK),m.maximumComponent(nK)};var mTe=new m;tt.setRotation=function(e,t,n){let i=tt.getScale(e,mTe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var hTe=new m;tt.getRotation=function(e,t){let n=tt.getScale(e,hTe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};tt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};tt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};tt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};tt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};tt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};tt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function pTe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var xG=[1,0,0],bG=[2,2,1];function _Te(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(bG[n],xG[n])];t+=2*i*i}return Math.sqrt(t)}function gTe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(bG[u],xG[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=xG[o],c=bG[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var mD=new tt,iK=new tt;tt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*pTe(a);for(;r<i&&_Te(a)>c;)gTe(a,mD),tt.transpose(mD,iK),tt.multiply(a,mD,a),tt.multiply(iK,a,a),tt.multiply(s,mD,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var yTe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,yTe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var Z=tt;function zb(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(zb.prototype=Object.create(Error.prototype),zb.prototype.constructor=zb);zb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var de=zb;function $e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){this[0]=y(e,0),this[1]=y(r,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(o,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(A,0)}$e.packedLength=16;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)$e.pack(e[r],t,r*16);return t};$e.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let r=i/16;t[r]=$e.unpack(e,i,t[r])}return t};$e.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new $e(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};$e.fromArray=$e.unpack;$e.fromColumnMajorArray=function(e,t){return $e.clone(e,t)};$e.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new $e(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};$e.fromRotationTranslation=function(e,t,n){return t=y(t,m.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new $e(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};$e.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new $e);let r=n.x,o=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,h=t.z*t.z,A=t.z*t.w,x=t.w*t.w,C=a-d-h+x,T=2*(c-A),E=2*(u+g),S=2*(c+A),w=-a+d-h+x,D=2*(p-f),R=2*(u-g),O=2*(p+f),L=-a-d+h+x;return i[0]=C*r,i[1]=S*r,i[2]=R*r,i[3]=0,i[4]=T*o,i[5]=w*o,i[6]=O*o,i[7]=0,i[8]=E*s,i[9]=D*s,i[10]=L*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};$e.fromTranslationRotationScale=function(e,t){return $e.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};$e.fromTranslation=function(e,t){return $e.fromRotationTranslation(Z.IDENTITY,e,t)};$e.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};$e.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};$e.fromRotation=function(e,t){return l(t)||(t=new $e),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var xx=new m,Cx=new m,Hb=new m;$e.fromCamera=function(e,t){let n=e.position,i=e.direction,r=e.up;m.normalize(i,xx),m.normalize(m.cross(xx,r,Cx),Cx),m.normalize(m.cross(Cx,xx,Hb),Hb);let o=Cx.x,s=Cx.y,a=Cx.z,c=xx.x,u=xx.y,f=xx.z,d=Hb.x,p=Hb.y,g=Hb.z,h=n.x,A=n.y,x=n.z,C=o*-h+s*-A+a*-x,T=d*-h+p*-A+g*-x,E=c*h+u*A+f*x;return l(t)?(t[0]=o,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=C,t[13]=T,t[14]=E,t[15]=1,t):new $e(o,s,a,C,d,p,g,T,-c,-u,-f,E,0,0,0,1)};$e.computePerspectiveFieldOfView=function(e,t,n,i,r){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=-1,r[12]=0,r[13]=0,r[14]=u,r[15]=0,r};$e.computeOrthographicOffCenter=function(e,t,n,i,r,o,s){let a=1/(t-e),c=1/(i-n),u=1/(o-r),f=-(t+e)*a,d=-(i+n)*c,p=-(o+r)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};$e.computePerspectiveOffCenter=function(e,t,n,i,r,o,s){let a=2*r/(t-e),c=2*r/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(o+r)/(o-r),p=-1,g=-2*o*r/(o-r);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};$e.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,o){let s=2*r/(t-e),a=2*r/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*r;return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=c,o[9]=u,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=p,o[15]=0,o};$e.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new $e),e=y(e,y.EMPTY_OBJECT);let r=y(e.x,0),o=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,h=r+c,A=o+u,x=t+f,C=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=h,i[13]=A,i[14]=x,i[15]=C,i};$e.computeView=function(e,t,n,i,r){return r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-m.dot(i,e),r[13]=-m.dot(n,e),r[14]=m.dot(t,e),r[15]=1,r};$e.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};$e.getElementIndex=function(e,t){return e*4+t};$e.getColumn=function(e,t,n){let i=t*4,r=e[i],o=e[i+1],s=e[i+2],a=e[i+3];return n.x=r,n.y=o,n.z=s,n.w=a,n};$e.setColumn=function(e,t,n,i){i=$e.clone(e,i);let r=t*4;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i};$e.getRow=function(e,t,n){let i=e[t],r=e[t+4],o=e[t+8],s=e[t+12];return n.x=i,n.y=r,n.z=o,n.w=s,n};$e.setRow=function(e,t,n,i){return i=$e.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};$e.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Xxe=new m;$e.setScale=function(e,t,n){let i=$e.getScale(e,Xxe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Kxe=new m;$e.setUniformScale=function(e,t,n){let i=$e.getScale(e,Kxe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var eG=new m;$e.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],eG)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],eG)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],eG)),t};var FX=new m;$e.getMaximumScale=function(e){return $e.getScale(e,FX),m.maximumComponent(FX)};var Jxe=new m;$e.setRotation=function(e,t,n){let i=$e.getScale(e,Jxe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Zxe=new m;$e.getRotation=function(e,t){let n=$e.getScale(e,Zxe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};$e.multiply=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],h=e[11],A=e[12],x=e[13],C=e[14],T=e[15],E=t[0],S=t[1],w=t[2],D=t[3],R=t[4],O=t[5],L=t[6],N=t[7],_=t[8],b=t[9],v=t[10],I=t[11],M=t[12],F=t[13],k=t[14],V=t[15],G=i*E+a*S+d*w+A*D,U=r*E+c*S+p*w+x*D,q=o*E+u*S+g*w+C*D,Y=s*E+f*S+h*w+T*D,Q=i*R+a*O+d*L+A*N,W=r*R+c*O+p*L+x*N,K=o*R+u*O+g*L+C*N,J=s*R+f*O+h*L+T*N,me=i*_+a*b+d*v+A*I,ye=r*_+c*b+p*v+x*I,se=o*_+u*b+g*v+C*I,pe=s*_+f*b+h*v+T*I,xe=i*M+a*F+d*k+A*V,we=r*M+c*F+p*k+x*V,Ee=o*M+u*F+g*k+C*V,Be=s*M+f*F+h*k+T*V;return n[0]=G,n[1]=U,n[2]=q,n[3]=Y,n[4]=Q,n[5]=W,n[6]=K,n[7]=J,n[8]=me,n[9]=ye,n[10]=se,n[11]=pe,n[12]=xe,n[13]=we,n[14]=Ee,n[15]=Be,n};$e.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};$e.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};$e.multiplyTransformation=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],h=e[14],A=t[0],x=t[1],C=t[2],T=t[4],E=t[5],S=t[6],w=t[8],D=t[9],R=t[10],O=t[12],L=t[13],N=t[14],_=i*A+s*x+u*C,b=r*A+a*x+f*C,v=o*A+c*x+d*C,I=i*T+s*E+u*S,M=r*T+a*E+f*S,F=o*T+c*E+d*S,k=i*w+s*D+u*R,V=r*w+a*D+f*R,G=o*w+c*D+d*R,U=i*O+s*L+u*N+p,q=r*O+a*L+f*N+g,Y=o*O+c*L+d*N+h;return n[0]=_,n[1]=b,n[2]=v,n[3]=0,n[4]=I,n[5]=M,n[6]=F,n[7]=0,n[8]=k,n[9]=V,n[10]=G,n[11]=0,n[12]=U,n[13]=q,n[14]=Y,n[15]=1,n};$e.multiplyByMatrix3=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],h=t[2],A=t[3],x=t[4],C=t[5],T=t[6],E=t[7],S=t[8],w=i*p+s*g+u*h,D=r*p+a*g+f*h,R=o*p+c*g+d*h,O=i*A+s*x+u*C,L=r*A+a*x+f*C,N=o*A+c*x+d*C,_=i*T+s*E+u*S,b=r*T+a*E+f*S,v=o*T+c*E+d*S;return n[0]=w,n[1]=D,n[2]=R,n[3]=0,n[4]=O,n[5]=L,n[6]=N,n[7]=0,n[8]=_,n[9]=b,n[10]=v,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByTranslation=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=i*e[0]+r*e[4]+o*e[8]+e[12],a=i*e[1]+r*e[5]+o*e[9]+e[13],c=i*e[2]+r*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};$e.multiplyByScale=function(e,t,n){let i=t.x,r=t.y,o=t.z;return i===1&&r===1&&o===1?$e.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=e[7],n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};$e.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=t.w,a=e[0]*i+e[4]*r+e[8]*o+e[12]*s,c=e[1]*i+e[5]*r+e[9]*o+e[13]*s,u=e[2]*i+e[6]*r+e[10]*o+e[14]*s,f=e[3]*i+e[7]*r+e[11]*o+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};$e.multiplyByPointAsVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o,a=e[1]*i+e[5]*r+e[9]*o,c=e[2]*i+e[6]*r+e[10]*o;return n.x=s,n.y=a,n.z=c,n};$e.multiplyByPoint=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o+e[12],a=e[1]*i+e[5]*r+e[9]*o+e[13],c=e[2]*i+e[6]*r+e[10]*o+e[14];return n.x=s,n.y=a,n.z=c,n};$e.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};$e.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};$e.transpose=function(e,t){let n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=s,t[14]=a,t[15]=e[15],t};$e.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};$e.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};$e.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};$e.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};$e.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Qxe=new Z,$xe=new Z,eCe=new oe,tCe=new oe(0,0,0,1);$e.inverse=function(e,t){let n=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],h=e[3],A=e[7],x=e[11],C=e[15],T=p*C,E=g*x,S=d*C,w=g*A,D=d*x,R=p*A,O=f*C,L=g*h,N=f*x,_=p*h,b=f*A,v=d*h,I=T*a+w*c+D*u-(E*a+S*c+R*u),M=E*s+O*c+_*u-(T*s+L*c+N*u),F=S*s+L*a+b*u-(w*s+O*a+v*u),k=R*s+N*a+v*c-(D*s+_*a+b*c),V=E*i+S*r+R*o-(T*i+w*r+D*o),G=T*n+L*r+N*o-(E*n+O*r+_*o),U=w*n+O*i+v*o-(S*n+L*i+b*o),q=D*n+_*i+b*r-(R*n+N*i+v*r);T=r*u,E=o*c,S=i*u,w=o*a,D=i*c,R=r*a,O=n*u,L=o*s,N=n*c,_=r*s,b=n*a,v=i*s;let Y=T*A+w*x+D*C-(E*A+S*x+R*C),Q=E*h+O*x+_*C-(T*h+L*x+N*C),W=S*h+L*A+b*C-(w*h+O*A+v*C),K=R*h+N*A+v*x-(D*h+_*A+b*x),J=S*p+R*g+E*d-(D*g+T*d+w*p),me=N*g+T*f+L*p-(O*p+_*g+E*f),ye=O*d+v*g+w*f-(b*g+S*f+L*d),se=b*p+D*f+_*d-(N*d+v*p+R*f),pe=n*I+i*M+r*F+o*k;if(Math.abs(pe)<P.EPSILON21){if(Z.equalsEpsilon($e.getMatrix3(e,Qxe),$xe,P.EPSILON7)&&oe.equals($e.getRow(e,3,eCe),tCe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new de("matrix is not invertible because its determinate is zero.")}return pe=1/pe,t[0]=I*pe,t[1]=M*pe,t[2]=F*pe,t[3]=k*pe,t[4]=V*pe,t[5]=G*pe,t[6]=U*pe,t[7]=q*pe,t[8]=Y*pe,t[9]=Q*pe,t[10]=W*pe,t[11]=K*pe,t[12]=J*pe,t[13]=me*pe,t[14]=ye*pe,t[15]=se*pe,t};$e.inverseTransformation=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],h=-n*d-i*p-r*g,A=-o*d-s*p-a*g,x=-c*d-u*p-f*g;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=r,t[9]=a,t[10]=f,t[11]=0,t[12]=h,t[13]=A,t[14]=x,t[15]=1,t};var nCe=new $e;$e.inverseTranspose=function(e,t){return $e.inverse($e.transpose(e,nCe),t)};$e.IDENTITY=Object.freeze(new $e(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));$e.ZERO=Object.freeze(new $e(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));$e.COLUMN0ROW0=0;$e.COLUMN0ROW1=1;$e.COLUMN0ROW2=2;$e.COLUMN0ROW3=3;$e.COLUMN1ROW0=4;$e.COLUMN1ROW1=5;$e.COLUMN1ROW2=6;$e.COLUMN1ROW3=7;$e.COLUMN2ROW0=8;$e.COLUMN2ROW1=9;$e.COLUMN2ROW2=10;$e.COLUMN2ROW3=11;$e.COLUMN3ROW0=12;$e.COLUMN3ROW1=13;$e.COLUMN3ROW2=14;$e.COLUMN3ROW3=15;Object.defineProperties($e.prototype,{length:{get:function(){return $e.packedLength}}});$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};$e.prototype.equalsEpsilon=function(e,t){return $e.equalsEpsilon(this,e,t)};$e.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`};var Z=tt;function yt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}yt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new yt(e,t,n,i)};yt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new yt(e.red,e.green,e.blue,e.alpha)};yt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new yt(e.x,e.y,e.z,e.w)};yt.packedLength=4;yt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};yt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new yt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};yt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)yt.pack(e[o],t,o*4);return t};yt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=yt.unpack(e,i,t[o])}return t};yt.fromArray=yt.unpack;yt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};yt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};yt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};yt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};yt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};yt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};yt.magnitude=function(e){return Math.sqrt(yt.magnitudeSquared(e))};var hD=new yt;yt.distance=function(e,t){return yt.subtract(e,t,hD),yt.magnitude(hD)};yt.distanceSquared=function(e,t){return yt.subtract(e,t,hD),yt.magnitudeSquared(hD)};yt.normalize=function(e,t){let n=yt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};yt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};yt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};yt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};yt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};yt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};yt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};yt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};yt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};yt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var oK=new yt;yt.lerp=function(e,t,n,i){return yt.multiplyByScalar(t,n,oK),i=yt.multiplyByScalar(e,1-n,i),yt.add(oK,i,i)};var xTe=new yt;yt.mostOrthogonalAxis=function(e,t){let n=yt.normalize(e,xTe);return yt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=yt.clone(yt.UNIT_X,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=yt.clone(yt.UNIT_Y,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t),t};yt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};yt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};yt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};yt.ZERO=Object.freeze(new yt(0,0,0,0));yt.ONE=Object.freeze(new yt(1,1,1,1));yt.UNIT_X=Object.freeze(new yt(1,0,0,0));yt.UNIT_Y=Object.freeze(new yt(0,1,0,0));yt.UNIT_Z=Object.freeze(new yt(0,0,1,0));yt.UNIT_W=Object.freeze(new yt(0,0,0,1));yt.prototype.clone=function(e){return yt.clone(this,e)};yt.prototype.equals=function(e){return yt.equals(this,e)};yt.prototype.equalsEpsilon=function(e,t,n){return yt.equalsEpsilon(this,e,t,n)};yt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var CG=new Float32Array(1),Da=new Uint8Array(CG.buffer),bTe=new Uint32Array([287454020]),CTe=new Uint8Array(bTe.buffer),rK=CTe[0]===68;yt.packFloat=function(e,t){return l(t)||(t=new yt),CG[0]=e,rK?(t.x=Da[0],t.y=Da[1],t.z=Da[2],t.w=Da[3]):(t.x=Da[3],t.y=Da[2],t.z=Da[1],t.w=Da[0]),t};yt.unpackFloat=function(e){return rK?(Da[0]=e.x,Da[1]=e.y,Da[2]=e.z,Da[3]=e.w):(Da[0]=e.w,Da[1]=e.z,Da[2]=e.y,Da[3]=e.x),CG[0]};var re=yt;function XE(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(XE.prototype=Object.create(Error.prototype),XE.prototype.constructor=XE);XE.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var de=XE;function Qe(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(x,0)}Qe.packedLength=16;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Qe.pack(e[o],t,o*16);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Qe(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Qe.fromArray=Qe.unpack;Qe.fromColumnMajorArray=function(e,t){return Qe.clone(e,t)};Qe.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Qe(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Qe.fromRotationTranslation=function(e,t,n){return t=y(t,m.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Qe(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Qe.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Qe);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,h=t.z*t.z,x=t.z*t.w,b=t.w*t.w,C=a-d-h+b,T=2*(c-x),A=2*(u+g),S=2*(c+x),v=-a+d-h+b,I=2*(p-f),O=2*(u-g),R=2*(p+f),N=-a-d+h+b;return i[0]=C*o,i[1]=S*o,i[2]=O*o,i[3]=0,i[4]=T*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=A*s,i[9]=I*s,i[10]=N*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Qe.fromTranslationRotationScale=function(e,t){return Qe.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Qe.fromTranslation=function(e,t){return Qe.fromRotationTranslation(Z.IDENTITY,e,t)};Qe.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Qe.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Qe.fromRotation=function(e,t){return l(t)||(t=new Qe),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var Eb=new m,Sb=new m,KE=new m;Qe.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;m.normalize(i,Eb),m.normalize(m.cross(Eb,o,Sb),Sb),m.normalize(m.cross(Sb,Eb,KE),KE);let r=Sb.x,s=Sb.y,a=Sb.z,c=Eb.x,u=Eb.y,f=Eb.z,d=KE.x,p=KE.y,g=KE.z,h=n.x,x=n.y,b=n.z,C=r*-h+s*-x+a*-b,T=d*-h+p*-x+g*-b,A=c*h+u*x+f*b;return l(t)?(t[0]=r,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=C,t[13]=T,t[14]=A,t[15]=1,t):new Qe(r,s,a,C,d,p,g,T,-c,-u,-f,A,0,0,0,1)};Qe.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};Qe.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,d=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};Qe.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};Qe.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=d,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};Qe.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Qe),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,h=o+c,x=r+u,b=t+f,C=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=h,i[13]=x,i[14]=b,i[15]=C,i};Qe.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-m.dot(i,e),o[13]=-m.dot(n,e),o[14]=m.dot(t,e),o[15]=1,o};Qe.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Qe.getElementIndex=function(e,t){return e*4+t};Qe.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};Qe.setColumn=function(e,t,n,i){i=Qe.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};Qe.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};Qe.setRow=function(e,t,n,i){return i=Qe.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Qe.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var TTe=new m;Qe.setScale=function(e,t,n){let i=Qe.getScale(e,TTe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var ATe=new m;Qe.setUniformScale=function(e,t,n){let i=Qe.getScale(e,ATe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var TG=new m;Qe.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],TG)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],TG)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],TG)),t};var sK=new m;Qe.getMaximumScale=function(e){return Qe.getScale(e,sK),m.maximumComponent(sK)};var ETe=new m;Qe.setRotation=function(e,t,n){let i=Qe.getScale(e,ETe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var STe=new m;Qe.getRotation=function(e,t){let n=Qe.getScale(e,STe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Qe.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],h=e[11],x=e[12],b=e[13],C=e[14],T=e[15],A=t[0],S=t[1],v=t[2],I=t[3],O=t[4],R=t[5],N=t[6],F=t[7],_=t[8],E=t[9],w=t[10],D=t[11],M=t[12],B=t[13],V=t[14],U=t[15],G=i*A+a*S+d*v+x*I,k=o*A+c*S+p*v+b*I,Y=r*A+u*S+g*v+C*I,j=s*A+f*S+h*v+T*I,$=i*O+a*R+d*N+x*F,W=o*O+c*R+p*N+b*F,K=r*O+u*R+g*N+C*F,J=s*O+f*R+h*N+T*F,he=i*_+a*E+d*w+x*D,ge=o*_+c*E+p*w+b*D,se=r*_+u*E+g*w+C*D,pe=s*_+f*E+h*w+T*D,xe=i*M+a*B+d*V+x*U,De=o*M+c*B+p*V+b*U,Se=r*M+u*B+g*V+C*U,we=s*M+f*B+h*V+T*U;return n[0]=G,n[1]=k,n[2]=Y,n[3]=j,n[4]=$,n[5]=W,n[6]=K,n[7]=J,n[8]=he,n[9]=ge,n[10]=se,n[11]=pe,n[12]=xe,n[13]=De,n[14]=Se,n[15]=we,n};Qe.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Qe.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Qe.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],h=e[14],x=t[0],b=t[1],C=t[2],T=t[4],A=t[5],S=t[6],v=t[8],I=t[9],O=t[10],R=t[12],N=t[13],F=t[14],_=i*x+s*b+u*C,E=o*x+a*b+f*C,w=r*x+c*b+d*C,D=i*T+s*A+u*S,M=o*T+a*A+f*S,B=r*T+c*A+d*S,V=i*v+s*I+u*O,U=o*v+a*I+f*O,G=r*v+c*I+d*O,k=i*R+s*N+u*F+p,Y=o*R+a*N+f*F+g,j=r*R+c*N+d*F+h;return n[0]=_,n[1]=E,n[2]=w,n[3]=0,n[4]=D,n[5]=M,n[6]=B,n[7]=0,n[8]=V,n[9]=U,n[10]=G,n[11]=0,n[12]=k,n[13]=Y,n[14]=j,n[15]=1,n};Qe.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],h=t[2],x=t[3],b=t[4],C=t[5],T=t[6],A=t[7],S=t[8],v=i*p+s*g+u*h,I=o*p+a*g+f*h,O=r*p+c*g+d*h,R=i*x+s*b+u*C,N=o*x+a*b+f*C,F=r*x+c*b+d*C,_=i*T+s*A+u*S,E=o*T+a*A+f*S,w=r*T+c*A+d*S;return n[0]=v,n[1]=I,n[2]=O,n[3]=0,n[4]=R,n[5]=N,n[6]=F,n[7]=0,n[8]=_,n[9]=E,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Qe.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?Qe.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Qe.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Qe.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Qe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Qe.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};Qe.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Qe.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Qe.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var vTe=new Z,wTe=new Z,ITe=new re,DTe=new re(0,0,0,1);Qe.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],h=e[3],x=e[7],b=e[11],C=e[15],T=p*C,A=g*b,S=d*C,v=g*x,I=d*b,O=p*x,R=f*C,N=g*h,F=f*b,_=p*h,E=f*x,w=d*h,D=T*a+v*c+I*u-(A*a+S*c+O*u),M=A*s+R*c+_*u-(T*s+N*c+F*u),B=S*s+N*a+E*u-(v*s+R*a+w*u),V=O*s+F*a+w*c-(I*s+_*a+E*c),U=A*i+S*o+O*r-(T*i+v*o+I*r),G=T*n+N*o+F*r-(A*n+R*o+_*r),k=v*n+R*i+w*r-(S*n+N*i+E*r),Y=I*n+_*i+E*o-(O*n+F*i+w*o);T=o*u,A=r*c,S=i*u,v=r*a,I=i*c,O=o*a,R=n*u,N=r*s,F=n*c,_=o*s,E=n*a,w=i*s;let j=T*x+v*b+I*C-(A*x+S*b+O*C),$=A*h+R*b+_*C-(T*h+N*b+F*C),W=S*h+N*x+E*C-(v*h+R*x+w*C),K=O*h+F*x+w*b-(I*h+_*x+E*b),J=S*p+O*g+A*d-(I*g+T*d+v*p),he=F*g+T*f+N*p-(R*p+_*g+A*f),ge=R*d+w*g+v*f-(E*g+S*f+N*d),se=E*p+I*f+_*d-(F*d+w*p+O*f),pe=n*D+i*M+o*B+r*V;if(Math.abs(pe)<P.EPSILON21){if(Z.equalsEpsilon(Qe.getMatrix3(e,vTe),wTe,P.EPSILON7)&&re.equals(Qe.getRow(e,3,ITe),DTe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new de("matrix is not invertible because its determinate is zero.")}return pe=1/pe,t[0]=D*pe,t[1]=M*pe,t[2]=B*pe,t[3]=V*pe,t[4]=U*pe,t[5]=G*pe,t[6]=k*pe,t[7]=Y*pe,t[8]=j*pe,t[9]=$*pe,t[10]=W*pe,t[11]=K*pe,t[12]=J*pe,t[13]=he*pe,t[14]=ge*pe,t[15]=se*pe,t};Qe.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],h=-n*d-i*p-o*g,x=-r*d-s*p-a*g,b=-c*d-u*p-f*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=h,t[13]=x,t[14]=b,t[15]=1,t};var PTe=new Qe;Qe.inverseTranspose=function(e,t){return Qe.inverse(Qe.transpose(e,PTe),t)};Qe.IDENTITY=Object.freeze(new Qe(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Qe.ZERO=Object.freeze(new Qe(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Qe.COLUMN0ROW0=0;Qe.COLUMN0ROW1=1;Qe.COLUMN0ROW2=2;Qe.COLUMN0ROW3=3;Qe.COLUMN1ROW0=4;Qe.COLUMN1ROW1=5;Qe.COLUMN1ROW2=6;Qe.COLUMN1ROW3=7;Qe.COLUMN2ROW0=8;Qe.COLUMN2ROW1=9;Qe.COLUMN2ROW2=10;Qe.COLUMN2ROW3=11;Qe.COLUMN3ROW0=12;Qe.COLUMN3ROW1=13;Qe.COLUMN3ROW2=14;Qe.COLUMN3ROW3=15;Object.defineProperties(Qe.prototype,{length:{get:function(){return Qe.packedLength}}});Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var B=$e;var iCe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(iCe);var rCe=new m;function Wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ls={};Ls[te.FLOAT]="float";Ls[te.FLOAT_VEC2]="vec2";Ls[te.FLOAT_VEC3]="vec3";Ls[te.FLOAT_VEC4]="vec4";Ls[te.INT]="int";Ls[te.INT_VEC2]="ivec2";Ls[te.INT_VEC3]="ivec3";Ls[te.INT_VEC4]="ivec4";Ls[te.BOOL]="bool";Ls[te.BOOL_VEC2]="bvec2";Ls[te.BOOL_VEC3]="bvec3";Ls[te.BOOL_VEC4]="bvec4";Ls[te.FLOAT_MAT2]="mat2";Ls[te.FLOAT_MAT3]="mat3";Ls[te.FLOAT_MAT4]="mat4";Ls[te.SAMPLER_2D]="sampler2D";Ls[te.SAMPLER_CUBE]="samplerCube";Wt.prototype.getDeclaration=function(e){let t=`uniform ${Ls[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var oCe={czm_viewport:new Wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new Wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return B.getTranslation(e.inverseView,rCe)}}),czm_frameNumber:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Wt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new Wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Wt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},i_=oCe;function sCe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var jn=sCe;function aCe(){return!0}function cCe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=aCe}var ue=cCe;var ms={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ms.getSizeInBytes=function(e){switch(e){case ms.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ms.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ms.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ms.fromSizeInBytes=function(e){switch(e){case 2:return ms.UNSIGNED_SHORT;case 4:return ms.UNSIGNED_INT;case 1:return ms.UNSIGNED_BYTE}};ms.validate=function(e){return l(e)&&(e===ms.UNSIGNED_BYTE||e===ms.UNSIGNED_SHORT||e===ms.UNSIGNED_INT)};ms.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ms.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ms.fromTypedArray=function(e){if(e instanceof Uint8Array)return ms.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ms.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ms.UNSIGNED_INT};var Ue=Object.freeze(ms);var eP={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===eP.STREAM_DRAW||e===eP.STATIC_DRAW||e===eP.DYNAMIC_DRAW}},Fe=Object.freeze(eP);function wu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}wu.createVertexBuffer=function(e){return new wu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};wu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),r=new wu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(wu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});wu.prototype._getBuffer=function(){return this._buffer};wu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};wu.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};wu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};wu.prototype.isDestroyed=function(){return!1};wu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var ht=wu;var r_,go={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Vc={};Object.defineProperties(Vc,{element:{get:function(){if(Vc.supportsFullscreen())return document[go.fullscreenElement]}},changeEventName:{get:function(){if(Vc.supportsFullscreen())return go.fullscreenchange}},errorEventName:{get:function(){if(Vc.supportsFullscreen())return go.fullscreenerror}},enabled:{get:function(){if(Vc.supportsFullscreen())return document[go.fullscreenEnabled]}},fullscreen:{get:function(){if(Vc.supportsFullscreen())return Vc.element!==null}}});Vc.supportsFullscreen=function(){if(l(r_))return r_;r_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return go.requestFullscreen="requestFullscreen",go.exitFullscreen="exitFullscreen",go.fullscreenEnabled="fullscreenEnabled",go.fullscreenElement="fullscreenElement",go.fullscreenchange="fullscreenchange",go.fullscreenerror="fullscreenerror",r_=!0,r_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(go.requestFullscreen=n,r_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(go.requestFullscreen=n,r_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?go.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(go.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?go.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(go.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?go.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(go.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),go.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),go.fullscreenerror=n)}return r_};Vc.requestFullscreen=function(e,t){Vc.supportsFullscreen()&&e[go.requestFullscreen]({vrDisplay:t})};Vc.exitFullscreen=function(){Vc.supportsFullscreen()&&document[go.exitFullscreen]()};Vc._names=go;var yo=Vc;var Da;typeof navigator<"u"?Da=navigator:Da={};function Hy(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var tP,UX;function sG(){if(!l(tP)&&(tP=!1,!aP())){let e=/ Chrome\/([\.0-9]+)/.exec(Da.userAgent);e!==null&&(tP=!0,UX=Hy(e[1]))}return tP}function lCe(){return sG()&&UX}var nP,VX;function kX(){if(!l(nP)&&(nP=!1,!sG()&&!aP()&&/ Safari\/[\.0-9]+/.test(Da.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Da.userAgent);e!==null&&(nP=!0,VX=Hy(e[1]))}return nP}function uCe(){return kX()&&VX}var iP,rG;function zX(){if(!l(iP)){iP=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Da.userAgent);e!==null&&(iP=!0,rG=Hy(e[1]),rG.isNightly=!!e[2])}return iP}function fCe(){return zX()&&rG}var Gb,oG;function HX(){if(!l(Gb)){Gb=!1;let e;Da.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Da.userAgent),e!==null&&(Gb=!0,oG=Hy(e[1]))):Da.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Da.userAgent),e!==null&&(Gb=!0,oG=Hy(e[1])))}return Gb}function dCe(){return HX()&&oG}var rP,GX;function aP(){if(!l(rP)){rP=!1;let e=/ Edg\/([\.0-9]+)/.exec(Da.userAgent);e!==null&&(rP=!0,GX=Hy(e[1]))}return rP}function mCe(){return aP()&&GX}var oP,WX;function aG(){if(!l(oP)){oP=!1;let e=/Firefox\/([\.0-9]+)/.exec(Da.userAgent);e!==null&&(oP=!0,WX=Hy(e[1]))}return oP}var tG;function hCe(){return l(tG)||(tG=/Windows/i.test(Da.appVersion)),tG}var nG;function pCe(){return l(nG)||(nG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),nG}function _Ce(){return aG()&&WX}var iG;function gCe(){return l(iG)||(iG=!aG()&&typeof PointerEvent<"u"&&(!l(Da.pointerEnabled)||Da.pointerEnabled)),iG}var jX,sP;function YX(){if(!l(sP)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;sP=l(t)&&t!=="",sP&&(jX=t)}return sP}function yCe(){return YX()?jX:void 0}function ac(){return ac._result}ac._promise=void 0;ac._result=void 0;ac.initialize=function(){return l(ac._promise)||(ac._promise=new Promise(e=>{let t=new Image;t.onload=function(){ac._result=t.width>0&&t.height>0,e(ac._result)},t.onerror=function(){ac._result=!1,e(ac._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ac._promise};Object.defineProperties(ac,{initialized:{get:function(){return l(ac._result)}}});var Tx=[];typeof ArrayBuffer<"u"&&(Tx.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Tx.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Tx.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Tx.push(BigInt64Array),typeof BigUint64Array<"u"&&Tx.push(BigUint64Array));var Mf={isChrome:sG,chromeVersion:lCe,isSafari:kX,safariVersion:uCe,isWebkit:zX,webkitVersion:fCe,isInternetExplorer:HX,internetExplorerVersion:dCe,isEdge:aP,edgeVersion:mCe,isFirefox:aG,firefoxVersion:_Ce,isWindows:hCe,isIPadOrIOS:pCe,hardwareConcurrency:y(Da.hardwareConcurrency,3),supportsPointerEvents:gCe,supportsImageRenderingPixelated:YX,supportsWebP:ac,imageRenderingValue:yCe,typedArrayTypes:Tx};Mf.supportsBasis=function(e){return Mf.supportsWebAssembly()&&e.context.supportsBasis};Mf.supportsFullscreen=function(){return yo.supportsFullscreen()};Mf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Mf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Mf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Mf.supportsBigInt=function(){return typeof BigInt<"u"};Mf.supportsWebWorkers=function(){return typeof Worker<"u"};Mf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Mf.supportsWebgl2=function(e){return e.context.webgl2};var jt=Mf;function cG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,r){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var lG,uG,bh;jt.supportsTypedArrays()&&(lG=new ArrayBuffer(4),uG=new Uint32Array(lG),bh=new Uint8Array(lG));ie.fromRgba=function(e,t){return uG[0]=e,ie.fromBytes(bh[0],bh[1],bh[2],bh[3],t)};ie.fromHsl=function(e,t,n,i,r){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let o=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;o=cG(u,c,e+1/3),s=cG(u,c,e),a=cG(u,c,e-1/3)}return l(r)?(r.red=o,r.green=s,r.blue=a,r.alpha=i,r):new ie(o,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let r=e.blue;if(!l(r)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);r=s+P.nextRandomNumber()*(a-s)}let o=e.alpha;if(!l(o)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);o=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new ie(n,i,r,o)};var ACe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,xCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,CCe=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,TCe=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.replace(/\s/g,"");let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=ACe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=xCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=CCe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=TCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),r=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]};ie.prototype.toRgba=function(){return bh[0]=ie.floatToByte(this.red),bh[1]=ie.floatToByte(this.green),bh[2]=ie.floatToByte(this.blue),bh[3]=ie.floatToByte(this.alpha),uG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function cP(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}cP.ALL=Object.freeze(new cP({color:new z(0,0,0,0),depth:1,stencil:0}));cP.prototype.execute=function(e,t){e.clear(this,t)};var oi=cP;var ECe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Se=Object.freeze(ECe);function qX(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Se.COMPUTE,this.owner=e.owner}qX.prototype.execute=function(e){e.execute(this)};var Bf=qX;function Ot(e,t){this.x=y(e,0),this.y=y(t,0)}Ot.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ot(e,t)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ot(e.x,e.y)};Ot.fromCartesian3=Ot.clone;Ot.fromCartesian4=Ot.clone;Ot.packedLength=2;Ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ot),n.x=e[t++],n.y=e[t],n};Ot.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Ot.pack(e[r],t,r*2);return t};Ot.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let r=i/2;t[r]=Ot.unpack(e,i,t[r])}return t};Ot.fromArray=Ot.unpack;Ot.maximumComponent=function(e){return Math.max(e.x,e.y)};Ot.minimumComponent=function(e){return Math.min(e.x,e.y)};Ot.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ot.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ot.clamp=function(e,t,n,i){let r=P.clamp(e.x,t.x,n.x),o=P.clamp(e.y,t.y,n.y);return i.x=r,i.y=o,i};Ot.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ot.magnitude=function(e){return Math.sqrt(Ot.magnitudeSquared(e))};var lP=new Ot;Ot.distance=function(e,t){return Ot.subtract(e,t,lP),Ot.magnitude(lP)};Ot.distanceSquared=function(e,t){return Ot.subtract(e,t,lP),Ot.magnitudeSquared(lP)};Ot.normalize=function(e,t){let n=Ot.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Ot.dot=function(e,t){return e.x*t.x+e.y*t.y};Ot.cross=function(e,t){return e.x*t.y-e.y*t.x};Ot.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Ot.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Ot.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Ot.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Ot.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Ot.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Ot.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Ot.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var XX=new Ot;Ot.lerp=function(e,t,n,i){return Ot.multiplyByScalar(t,n,XX),i=Ot.multiplyByScalar(e,1-n,i),Ot.add(XX,i,i)};var KX=new Ot,JX=new Ot;Ot.angleBetween=function(e,t){return Ot.normalize(e,KX),Ot.normalize(t,JX),P.acosClamped(Ot.dot(KX,JX))};var bCe=new Ot;Ot.mostOrthogonalAxis=function(e,t){let n=Ot.normalize(e,bCe);return Ot.abs(n,n),n.x<=n.y?t=Ot.clone(Ot.UNIT_X,t):t=Ot.clone(Ot.UNIT_Y,t),t};Ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Ot.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ot.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Ot.ZERO=Object.freeze(new Ot(0,0));Ot.ONE=Object.freeze(new Ot(1,1));Ot.UNIT_X=Object.freeze(new Ot(1,0));Ot.UNIT_Y=Object.freeze(new Ot(0,1));Ot.prototype.clone=function(e){return Ot.clone(this,e)};Ot.prototype.equals=function(e){return Ot.equals(this,e)};Ot.prototype.equalsEpsilon=function(e,t,n){return Ot.equalsEpsilon(this,e,t,n)};Ot.prototype.toString=function(){return`(${this.x}, ${this.y})`};var H=Ot;var SCe=new m,vCe=new m;function wCe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,h=d+p+g,A=Math.sqrt(1/h),x=m.multiplyByScalar(e,A,SCe);if(h<i)return isFinite(A)?m.clone(x,r):void 0;let C=n.x,T=n.y,E=n.z,S=vCe;S.x=x.x*C*2,S.y=x.y*T*2,S.z=x.z*E*2;let w=(1-A)*m.magnitude(e)/(.5*m.magnitude(S)),D=0,R,O,L,N,_,b,v,I,M,F,k;do{w-=D,L=1/(1+w*C),N=1/(1+w*T),_=1/(1+w*E),b=L*L,v=N*N,I=_*_,M=b*L,F=v*N,k=I*_,R=d*b+p*v+g*I-1,O=d*M*C+p*F*T+g*k*E;let V=-2*O;D=R/V}while(Math.abs(R)>P.EPSILON12);return l(r)?(r.x=o*L,r.y=s*N,r.z=a*_,r):new m(o*L,s*N,a*_)}var Ex=wCe;function Go(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Go.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Go(e,t,n)};Go.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Go.fromRadians(e,t,n,i)};var DCe=new m,ICe=new m,PCe=new m,OCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),RCe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),MCe=P.EPSILON1;Go.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:OCe,r=l(t)?t.oneOverRadiiSquared:RCe,o=l(t)?t._centerToleranceSquared:MCe,s=Ex(e,i,r,o,ICe);if(!l(s))return;let a=m.multiplyComponents(s,r,DCe);a=m.normalize(a,a);let c=m.subtract(e,s,PCe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Go(u,f,d)};Go.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Go.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Go(e.longitude,e.latitude,e.height)};Go.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Go.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Go.ZERO=Object.freeze(new Go(0,0,0));Go.prototype.clone=function(e){return Go.clone(this,e)};Go.prototype.equals=function(e){return Go.equals(this,e)};Go.prototype.equalsEpsilon=function(e,t){return Go.equalsEpsilon(this,e,t)};Go.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Go;function QX(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Yi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,QX(this,e,t,n)}Object.defineProperties(Yi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Yi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Yi(n.x,n.y,n.z)};Yi.fromCartesian3=function(e,t){return l(t)||(t=new Yi),l(e)&&QX(t,e.x,e.y,e.z),t};Yi.WGS84=Object.freeze(new Yi(6378137,6378137,6356752314245179e-9));Yi.UNIT_SPHERE=Object.freeze(new Yi(1,1,1));Yi.MOON=Object.freeze(new Yi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Yi.prototype.clone=function(e){return Yi.clone(this,e)};Yi.packedLength=m.packedLength;Yi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};Yi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return Yi.fromCartesian3(i,n)};Yi.prototype.geocentricSurfaceNormal=m.normalize;Yi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),s=r*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=o,t.y=s,t.z=a,m.normalize(t,t)};Yi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var BCe=new m,LCe=new m;Yi.prototype.cartographicToCartesian=function(e,t){let n=BCe,i=LCe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let r=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,r,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};Yi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var NCe=new m,FCe=new m,UCe=new m;Yi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,FCe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,NCe),r=m.subtract(e,n,UCe),o=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(m.dot(r,e))*m.magnitude(r);return l(t)?(t.longitude=o,t.latitude=s,t.height=a,t):new he(o,s,a)};Yi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};Yi.prototype.scaleToGeodeticSurface=function(e,t){return Ex(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Yi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,r=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return m.multiplyByScalar(e,s,t)};Yi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};Yi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};Yi.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};Yi.prototype.toString=function(){return this._radii.toString()};Yi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var VCe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],kCe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function ZX(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*VCe[s];o+=kCe[s]*(n(i+a)+n(i-a))}return o*=r,o}Yi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,r=e.north;for(;n<t;)n+=P.TWO_PI;let o=this._radiiSquared,s=o.x,a=o.y,c=o.z,u=s*a;return ZX(i,r,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*ZX(t,n,function(g){let h=Math.cos(g),A=Math.sin(g);return Math.sqrt(u*p*p+c*(a*h*h+s*A*A)*d*d)})})};var re=Yi;function uP(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(uP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});uP.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=e.latitude*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};uP.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=e.y*n,o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new he(i,r,o)};var Di=uP;var zCe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},tn=Object.freeze(zCe);function Un(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Un.prototype,{width:{get:function(){return Un.computeWidth(this)}},height:{get:function(){return Un.computeHeight(this)}}});Un.packedLength=4;Un.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Un.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Un),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Un.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};Un.computeHeight=function(e){return e.north-e.south};Un.fromDegrees=function(e,t,n,i,r){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(r)?(r.west=e,r.south=t,r.east=n,r.north=i,r):new Un(e,t,n,i)};Un.fromRadians=function(e,t,n,i,r){return l(r)?(r.west=y(e,0),r.south=y(t,0),r.east=y(n,0),r.north=y(i,0),r):new Un(e,t,n,i)};Un.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;r=Math.min(r,d),o=Math.max(o,d)}return i-n>o-r&&(n=r,i=o,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Un(n,s,i,a)};Un.fromCartesianArray=function(e,t,n){t=y(t,re.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new Un(i,a,r,c)};Un.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Un(e.west,e.south,e.east,e.north)};Un.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Un.prototype.clone=function(e){return Un.clone(this,e)};Un.prototype.equals=function(e){return Un.equals(this,e)};Un.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Un.prototype.equalsEpsilon=function(e,t){return Un.equalsEpsilon(this,e,t)};Un.validate=function(e){};Un.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Un.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Un.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Un.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Un.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let r=P.negativePiToPi((i+n)*.5),o=(e.south+e.north)*.5;return l(t)?(t.longitude=r,t.latitude=o,t.height=0,t):new he(r,o)};Un.intersection=function(e,t,n){let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=P.TWO_PI:o<s&&i>0&&(o+=P.TWO_PI),i<r&&s<0?s+=P.TWO_PI:o<s&&r<0&&(r+=P.TWO_PI);let a=P.negativePiToPi(Math.max(r,s)),c=P.negativePiToPi(Math.min(i,o));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new Un(a,u,c,f)};Un.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(r>=s||i>=o))return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new Un(i,r,o,s)};Un.union=function(e,t,n){l(n)||(n=new Un);let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=P.TWO_PI:o<s&&i>0&&(o+=P.TWO_PI),i<r&&s<0?s+=P.TWO_PI:o<s&&r<0&&(r+=P.TWO_PI);let a=P.negativePiToPi(Math.min(r,s)),c=P.negativePiToPi(Math.max(i,o));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Un.expand=function(e,t,n){return l(n)||(n=new Un),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Un.contains=function(e,t){let n=t.longitude,i=t.latitude,r=e.west,o=e.east;return o<r&&(o+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>r||P.equalsEpsilon(n,r,P.EPSILON14))&&(n<o||P.equalsEpsilon(n,o,P.EPSILON14))&&i>=e.south&&i<=e.north};var HCe=new he;Un.subsample=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,0),l(i)||(i=[]);let r=0,o=e.north,s=e.south,a=e.east,c=e.west,u=HCe;u.height=n,u.longitude=c,u.latitude=o,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.latitude=s,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,o<0?u.latitude=o:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,Un.contains(e,u)&&(i[r]=t.cartographicToCartesian(u,i[r]),r++);return u.latitude===0&&(u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++),i.length=r,i};Un.subsection=function(e,t,n,i,r,o){if(l(o)||(o=new Un),e.west<=e.east){let a=e.east-e.west;o.west=e.west+t*a,o.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;o.west=P.negativePiToPi(e.west+t*a),o.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return o.south=e.south+n*s,o.north=e.south+r*s,t===1&&(o.west=e.east),i===1&&(o.east=e.east),n===1&&(o.south=e.north),r===1&&(o.north=e.north),o};Un.MAX_VALUE=Object.freeze(new Un(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ce=Un;function Ao(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Ao.packedLength=4;Ao.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Ao.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ao),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Ao.fromPoints=function(e,t){if(l(t)||(t=new Ao),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var GCe=new Di,WCe=new he,jCe=new he;Ao.fromRectangle=function(e,t,n){if(l(n)||(n=new Ao),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=y(t,GCe);let i=t.project(ce.southwest(e,WCe)),r=t.project(ce.northeast(e,jCe));return H.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};Ao.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Ao(e.x,e.y,e.width,e.height)};Ao.union=function(e,t,n){l(n)||(n=new Ao);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};Ao.expand=function(e,t,n){n=Ao.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Ao.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?tn.OUTSIDE:tn.INTERSECTING};Ao.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Ao.prototype.clone=function(e){return Ao.clone(this,e)};Ao.prototype.intersect=function(e){return Ao.intersect(this,e)};Ao.prototype.equals=function(e){return Ao.equals(this,e)};var Ke=Ao;var aa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};aa.isLines=function(e){return e===aa.LINES||e===aa.LINE_LOOP||e===aa.LINE_STRIP};aa.isTriangles=function(e){return e===aa.TRIANGLES||e===aa.TRIANGLE_STRIP||e===aa.TRIANGLE_FAN};aa.validate=function(e){return e===aa.POINTS||e===aa.LINES||e===aa.LINE_LOOP||e===aa.LINE_STRIP||e===aa.TRIANGLES||e===aa.TRIANGLE_STRIP||e===aa.TRIANGLE_FAN};var Le=Object.freeze(aa);var bx=`in vec4 position; -in vec2 textureCoordinates; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var L=Qe;function _n(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var SG=new m,vG=new m,wG=new m,IG=new m,DG=new m,PG=new m,OG=new m,Ns=new m,RG=new m,MG=new m,LG=new m,NG=new m,OTe=4/3*P.PI;_n.fromPoints=function(e,t){if(l(t)||(t=new _n),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],OG),i=m.clone(n,SG),o=m.clone(n,vG),r=m.clone(n,wG),s=m.clone(n,IG),a=m.clone(n,DG),c=m.clone(n,PG),u=e.length,f;for(f=1;f<u;f++){m.clone(e[f],n);let R=n.x,N=n.y,F=n.z;R<i.x&&m.clone(n,i),R>s.x&&m.clone(n,s),N<o.y&&m.clone(n,o),N>a.y&&m.clone(n,a),F<r.z&&m.clone(n,r),F>c.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,Ns)),p=m.magnitudeSquared(m.subtract(a,o,Ns)),g=m.magnitudeSquared(m.subtract(c,r,Ns)),h=i,x=s,b=d;p>b&&(b=p,h=o,x=a),g>b&&(b=g,h=r,x=c);let C=RG;C.x=(h.x+x.x)*.5,C.y=(h.y+x.y)*.5,C.z=(h.z+x.z)*.5;let T=m.magnitudeSquared(m.subtract(x,C,Ns)),A=Math.sqrt(T),S=MG;S.x=i.x,S.y=o.y,S.z=r.z;let v=LG;v.x=s.x,v.y=a.y,v.z=c.z;let I=m.midpoint(S,v,NG),O=0;for(f=0;f<u;f++){m.clone(e[f],n);let R=m.magnitude(m.subtract(n,I,Ns));R>O&&(O=R);let N=m.magnitudeSquared(m.subtract(n,C,Ns));if(N>T){let F=Math.sqrt(N);A=(A+F)*.5,T=A*A;let _=F-A;C.x=(A*C.x+_*n.x)/F,C.y=(A*C.y+_*n.y)/F,C.z=(A*C.z+_*n.z)/F}}return A<O?(m.clone(C,t.center),t.radius=A):(m.clone(I,t.center),t.radius=O),t};var RTe=new Di,MTe=new m,LTe=new m,AG=new me,EG=new me;_n.fromRectangle2D=function(e,t,n){return _n.fromRectangleWithHeights2D(e,t,0,0,n)};_n.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new _n),!l(e))return o.center=m.clone(m.ZERO,o.center),o.radius=0,o;t=y(t,RTe),ce.southwest(e,AG),AG.height=n,ce.northeast(e,EG),EG.height=i;let r=t.project(AG,MTe),s=t.project(EG,LTe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var NTe=[];_n.fromRectangle3D=function(e,t,n,i){if(t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=new _n),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,NTe);return _n.fromPoints(o,i)};_n.fromVertices=function(e,t,n,i){if(l(i)||(i=new _n),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=y(t,m.ZERO),n=y(n,3);let o=OG;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=m.clone(o,SG),s=m.clone(o,vG),a=m.clone(o,wG),c=m.clone(o,IG),u=m.clone(o,DG),f=m.clone(o,PG),d=e.length,p;for(p=0;p<d;p+=n){let F=e[p]+t.x,_=e[p+1]+t.y,E=e[p+2]+t.z;o.x=F,o.y=_,o.z=E,F<r.x&&m.clone(o,r),F>c.x&&m.clone(o,c),_<s.y&&m.clone(o,s),_>u.y&&m.clone(o,u),E<a.z&&m.clone(o,a),E>f.z&&m.clone(o,f)}let g=m.magnitudeSquared(m.subtract(c,r,Ns)),h=m.magnitudeSquared(m.subtract(u,s,Ns)),x=m.magnitudeSquared(m.subtract(f,a,Ns)),b=r,C=c,T=g;h>T&&(T=h,b=s,C=u),x>T&&(T=x,b=a,C=f);let A=RG;A.x=(b.x+C.x)*.5,A.y=(b.y+C.y)*.5,A.z=(b.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,A,Ns)),v=Math.sqrt(S),I=MG;I.x=r.x,I.y=s.y,I.z=a.z;let O=LG;O.x=c.x,O.y=u.y,O.z=f.z;let R=m.midpoint(I,O,NG),N=0;for(p=0;p<d;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let F=m.magnitude(m.subtract(o,R,Ns));F>N&&(N=F);let _=m.magnitudeSquared(m.subtract(o,A,Ns));if(_>S){let E=Math.sqrt(_);v=(v+E)*.5,S=v*v;let w=E-v;A.x=(v*A.x+w*o.x)/E,A.y=(v*A.y+w*o.y)/E,A.z=(v*A.z+w*o.z)/E}}return v<N?(m.clone(A,i.center),i.radius=v):(m.clone(R,i.center),i.radius=N),i};_n.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new _n),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=OG;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=m.clone(i,SG),r=m.clone(i,vG),s=m.clone(i,wG),a=m.clone(i,IG),c=m.clone(i,DG),u=m.clone(i,PG),f=e.length,d;for(d=0;d<f;d+=3){let N=e[d]+t[d],F=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=N,i.y=F,i.z=_,N<o.x&&m.clone(i,o),N>a.x&&m.clone(i,a),F<r.y&&m.clone(i,r),F>c.y&&m.clone(i,c),_<s.z&&m.clone(i,s),_>u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,o,Ns)),g=m.magnitudeSquared(m.subtract(c,r,Ns)),h=m.magnitudeSquared(m.subtract(u,s,Ns)),x=o,b=a,C=p;g>C&&(C=g,x=r,b=c),h>C&&(C=h,x=s,b=u);let T=RG;T.x=(x.x+b.x)*.5,T.y=(x.y+b.y)*.5,T.z=(x.z+b.z)*.5;let A=m.magnitudeSquared(m.subtract(b,T,Ns)),S=Math.sqrt(A),v=MG;v.x=o.x,v.y=r.y,v.z=s.z;let I=LG;I.x=a.x,I.y=c.y,I.z=u.z;let O=m.midpoint(v,I,NG),R=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let N=m.magnitude(m.subtract(i,O,Ns));N>R&&(R=N);let F=m.magnitudeSquared(m.subtract(i,T,Ns));if(F>A){let _=Math.sqrt(F);S=(S+_)*.5,A=S*S;let E=_-S;T.x=(S*T.x+E*i.x)/_,T.y=(S*T.y+E*i.y)/_,T.z=(S*T.z+E*i.z)/_}}return S<R?(m.clone(T,n.center),n.radius=S):(m.clone(O,n.center),n.radius=R),n};_n.fromCornerPoints=function(e,t,n){l(n)||(n=new _n);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};_n.fromEllipsoid=function(e,t){return l(t)||(t=new _n),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var FTe=new m;_n.fromBoundingSpheres=function(e,t){if(l(t)||(t=new _n),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return _n.clone(e[0],t);if(n===2)return _n.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=_n.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,m.distance(r,a.center,FTe)+a.radius)}return t.radius=s,t};var BTe=new m,kTe=new m,UTe=new m;_n.fromOrientedBoundingBox=function(e,t){l(t)||(t=new _n);let n=e.halfAxes,i=Z.getColumn(n,0,BTe),o=Z.getColumn(n,1,kTe),r=Z.getColumn(n,2,UTe);return m.add(i,o,i),m.add(i,r,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var VTe=new m,zTe=new m;_n.fromTransformation=function(e,t){l(t)||(t=new _n);let n=L.getTranslation(e,VTe),i=L.getScale(e,zTe),o=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=o,t};_n.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new _n(e.center,e.radius)};_n.packedLength=4;_n.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};_n.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new _n);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var HTe=new m,GTe=new m;_n.union=function(e,t,n){l(n)||(n=new _n);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=m.subtract(r,i,HTe),c=m.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=m.multiplyByScalar(a,(-o+u)/c,GTe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var WTe=new m;_n.expand=function(e,t,n){n=_n.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,WTe));return i>n.radius&&(n.radius=i),n};_n.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?tn.OUTSIDE:r<i?tn.INTERSECTING:tn.INSIDE};_n.transform=function(e,t,n){return l(n)||(n=new _n),n.center=L.multiplyByPoint(t,e.center,n.center),n.radius=L.getMaximumScale(t)*e.radius,n};var jTe=new m;_n.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,jTe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};_n.transformWithoutScale=function(e,t,n){return l(n)||(n=new _n),n.center=L.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var qTe=new m;_n.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Hc);let o=m.subtract(e.center,t,qTe),r=m.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var aK=new m,YTe=new m,XTe=new m,KTe=new m,JTe=new m,ZTe=new me,cK=new Array(8);for(let e=0;e<8;++e)cK[e]=new m;var $Te=new Di;_n.projectTo2D=function(e,t,n){t=y(t,$Te);let i=t.ellipsoid,o=e.center,r=e.radius,s;m.equals(o,m.ZERO)?s=m.clone(m.UNIT_X,aK):s=i.geodeticSurfaceNormal(o,aK);let a=m.cross(m.UNIT_Z,s,YTe);m.normalize(a,a);let c=m.cross(s,a,XTe);m.normalize(c,c),m.multiplyByScalar(s,r,s),m.multiplyByScalar(c,r,c),m.multiplyByScalar(a,r,a);let u=m.negate(c,JTe),f=m.negate(a,KTe),d=cK,p=d[0];m.add(s,c,p),m.add(p,a,p),p=d[1],m.add(s,c,p),m.add(p,f,p),p=d[2],m.add(s,u,p),m.add(p,f,p),p=d[3],m.add(s,u,p),m.add(p,a,p),m.negate(s,s),p=d[4],m.add(s,c,p),m.add(p,a,p),p=d[5],m.add(s,c,p),m.add(p,f,p),p=d[6],m.add(s,u,p),m.add(p,f,p),p=d[7],m.add(s,u,p),m.add(p,a,p);let g=d.length;for(let C=0;C<g;++C){let T=d[C];m.add(o,T,T);let A=i.cartesianToCartographic(T,ZTe);t.project(A,T)}n=_n.fromPoints(d,n),o=n.center;let h=o.x,x=o.y,b=o.z;return o.x=b,o.y=h,o.z=x,n};_n.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};_n.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};_n.prototype.intersectPlane=function(e){return _n.intersectPlane(this,e)};_n.prototype.distanceSquaredTo=function(e){return _n.distanceSquaredTo(this,e)};_n.prototype.computePlaneDistances=function(e,t,n){return _n.computePlaneDistances(this,e,t,n)};_n.prototype.isOccluded=function(e){return _n.isOccluded(this,e)};_n.prototype.equals=function(e){return _n.equals(this,e)};_n.prototype.clone=function(e){return _n.clone(this,e)};_n.prototype.volume=function(){let e=this.radius;return OTe*e*e*e};var ae=_n;var QTe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(QTe);var En={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};En.getSizeInBytes=function(e){switch(e){case En.BYTE:return Int8Array.BYTES_PER_ELEMENT;case En.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case En.SHORT:return Int16Array.BYTES_PER_ELEMENT;case En.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case En.INT:return Int32Array.BYTES_PER_ELEMENT;case En.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case En.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case En.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};En.fromTypedArray=function(e){if(e instanceof Int8Array)return En.BYTE;if(e instanceof Uint8Array)return En.UNSIGNED_BYTE;if(e instanceof Int16Array)return En.SHORT;if(e instanceof Uint16Array)return En.UNSIGNED_SHORT;if(e instanceof Int32Array)return En.INT;if(e instanceof Uint32Array)return En.UNSIGNED_INT;if(e instanceof Float32Array)return En.FLOAT;if(e instanceof Float64Array)return En.DOUBLE};En.validate=function(e){return l(e)&&(e===En.BYTE||e===En.UNSIGNED_BYTE||e===En.SHORT||e===En.UNSIGNED_SHORT||e===En.INT||e===En.UNSIGNED_INT||e===En.FLOAT||e===En.DOUBLE)};En.createTypedArray=function(e,t){switch(e){case En.BYTE:return new Int8Array(t);case En.UNSIGNED_BYTE:return new Uint8Array(t);case En.SHORT:return new Int16Array(t);case En.UNSIGNED_SHORT:return new Uint16Array(t);case En.INT:return new Int32Array(t);case En.UNSIGNED_INT:return new Uint32Array(t);case En.FLOAT:return new Float32Array(t);case En.DOUBLE:return new Float64Array(t)}};En.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/En.getSizeInBytes(e)),e){case En.BYTE:return new Int8Array(t,n,i);case En.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case En.SHORT:return new Int16Array(t,n,i);case En.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case En.INT:return new Int32Array(t,n,i);case En.UNSIGNED_INT:return new Uint32Array(t,n,i);case En.FLOAT:return new Float32Array(t,n,i);case En.DOUBLE:return new Float64Array(t,n,i)}};En.fromName=function(e){switch(e){case"BYTE":return En.BYTE;case"UNSIGNED_BYTE":return En.UNSIGNED_BYTE;case"SHORT":return En.SHORT;case"UNSIGNED_SHORT":return En.UNSIGNED_SHORT;case"INT":return En.INT;case"UNSIGNED_INT":return En.UNSIGNED_INT;case"FLOAT":return En.FLOAT;case"DOUBLE":return En.DOUBLE}};var X=Object.freeze(En);var eAe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Nf=Object.freeze(eAe);function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Xt.pack(e[o],t,o*4);return t};Xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Xt.unpack(e,i,t[o])}return t};Xt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var tAe=new H;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,tAe),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var nAe=new H;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,nAe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var lK=new H;Xt.getScale=function(e,t){return t.x=H.magnitude(H.fromElements(e[0],e[1],lK)),t.y=H.magnitude(H.fromElements(e[2],e[3],lK)),t};var uK=new H;Xt.getMaximumScale=function(e){return Xt.getScale(e,uK),H.maximumComponent(uK)};var iAe=new H;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,iAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var oAe=new H;Xt.getRotation=function(e,t){let n=Xt.getScale(e,oAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`};var no=Xt;var la={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};la.isLines=function(e){return e===la.LINES||e===la.LINE_LOOP||e===la.LINE_STRIP};la.isTriangles=function(e){return e===la.TRIANGLES||e===la.TRIANGLE_STRIP||e===la.TRIANGLE_FAN};la.validate=function(e){return e===la.POINTS||e===la.LINES||e===la.LINE_LOOP||e===la.LINE_STRIP||e===la.TRIANGLES||e===la.TRIANGLE_STRIP||e===la.TRIANGLE_FAN};var Fe=Object.freeze(la);function it(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var JE=new m;it.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);JE=m.normalize(e,JE);let r=JE.x*o,s=JE.y*o,a=JE.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new it(r,s,a,c)};var rAe=[1,2,0],sAe=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[Z.COLUMN0ROW0],c=e[Z.COLUMN1ROW1],u=e[Z.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,o=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,r=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=rAe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(g,g)]-e[Z.getElementIndex(h,h)]+1);let x=sAe;x[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(h,g)]-e[Z.getElementIndex(g,h)])*n,x[g]=(e[Z.getElementIndex(g,p)]+e[Z.getElementIndex(p,g)])*n,x[h]=(e[Z.getElementIndex(h,p)]+e[Z.getElementIndex(p,h)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new it(i,o,r,s)};var fK=new it,dK=new it,FG=new it,mK=new it;it.fromHeadingPitchRoll=function(e,t){return mK=it.fromAxisAngle(m.UNIT_X,e.roll,fK),FG=it.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=it.multiply(FG,mK,FG),dK=it.fromAxisAngle(m.UNIT_Z,-e.heading,fK),it.multiply(dK,t,t)};var pD=new m,BG=new m,Ff=new it,hK=new it,_D=new it;it.packedLength=4;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,_D),it.conjugate(_D,_D);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;it.unpack(e,(t+o)*4,Ff),it.multiply(Ff,_D,Ff),Ff.w<0&&it.negate(Ff,Ff),it.computeAxis(Ff,pD);let a=it.computeAngle(Ff);l(i)||(i=[]),i[s]=pD.x*a,i[s+1]=pD.y*a,i[s+2]=pD.z*a}};it.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new it),m.fromArray(e,0,BG);let r=m.magnitude(BG);return it.unpack(t,i*4,hK),r===0?it.clone(it.IDENTITY,Ff):it.fromAxisAngle(BG,r,Ff),it.multiply(Ff,hK,o)};it.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};it.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,g=s*u+i*c-o*a+r*f,h=s*f-i*a-o*c-r*u;return n.x=d,n.y=p,n.z=g,n.w=h,n};it.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};it.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};it.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var kG=new it;it.lerp=function(e,t,n,i){return kG=it.multiplyByScalar(t,n,kG),i=it.multiplyByScalar(e,1-n,i),it.add(kG,i,i)};var pK=new it,UG=new it,VG=new it;it.slerp=function(e,t,n,i){let o=it.dot(e,t),r=t;if(o<0&&(o=-o,r=pK=it.negate(t,pK)),1-o<P.EPSILON6)return it.lerp(e,r,n,i);let s=Math.acos(o);return UG=it.multiplyByScalar(e,Math.sin((1-n)*s),UG),VG=it.multiplyByScalar(r,Math.sin(n*s),VG),i=it.add(UG,VG,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var aAe=new m,cAe=new m,ZE=new it,vb=new it;it.computeInnerQuadrangle=function(e,t,n,i){let o=it.conjugate(t,ZE);it.multiply(o,n,vb);let r=it.log(vb,aAe);it.multiply(o,e,vb);let s=it.log(vb,cAe);return m.add(r,s,r),m.multiplyByScalar(r,.25,r),m.negate(r,r),it.exp(r,ZE),it.multiply(t,ZE,i)};it.squad=function(e,t,n,i,o,r){let s=it.slerp(e,t,o,ZE),a=it.slerp(n,i,o,vb);return it.slerp(s,a,2*o*(1-o),r)};var lAe=new it,_K=1.9011074535173003,gD=Wt.supportsTypedArrays()?new Float32Array(8):[],yD=Wt.supportsTypedArrays()?new Float32Array(8):[],Sh=Wt.supportsTypedArrays()?new Float32Array(8):[],vh=Wt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;gD[e]=1/(t*n),yD[e]=t/n}gD[7]=_K/(8*17);yD[7]=_K*8/17;it.fastSlerp=function(e,t,n,i){let o=it.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)Sh[g]=(gD[g]*c-yD[g])*s,vh[g]=(gD[g]*u-yD[g])*s;let f=r*n*(1+Sh[0]*(1+Sh[1]*(1+Sh[2]*(1+Sh[3]*(1+Sh[4]*(1+Sh[5]*(1+Sh[6]*(1+Sh[7])))))))),d=a*(1+vh[0]*(1+vh[1]*(1+vh[2]*(1+vh[3]*(1+vh[4]*(1+vh[5]*(1+vh[6]*(1+vh[7])))))))),p=it.multiplyByScalar(e,d,lAe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,o,r){let s=it.fastSlerp(e,t,o,ZE),a=it.fastSlerp(n,i,o,vb);return it.fastSlerp(s,a,2*o*(1-o),r)};it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Be=it;function uAe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Oo=uAe;function fAe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var qy=fAe;function dAe(e,t,n,i,o,r,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a}var l_=dAe;function mAe(e){return e%4===0&&e%100!==0||e%400===0}var u_=mAe;function hAe(e,t){this.julianDate=e,this.offset=t}var Wi=hAe;var pAe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},$n=Object.freeze(pAe);var _Ae={UTC:0,TAI:1},Jn=Object.freeze(_Ae);var yK=new l_,zG=[31,28,31,30,31,30,31,31,30,31,30,31],HG=29;function GG(e,t){return vt.compare(e.julianDate,t.julianDate)}var wb=new Wi;function bD(e){wb.julianDate=e;let t=vt.leapSeconds,n=Oo(t,wb,GG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function gK(e,t){wb.julianDate=e;let n=vt.leapSeconds,i=Oo(n,wb,GG);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let o=vt.secondsDifference(n[i].julianDate,e);if(o===0)return vt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return vt.addSeconds(e,-n[--i].offset,t)}function f_(e,t,n){let i=t/$n.SECONDS_PER_DAY|0;return e+=i,t-=$n.SECONDS_PER_DAY*i,t<0&&(e--,t+=$n.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function WG(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*$n.SECONDS_PER_HOUR+o*$n.SECONDS_PER_MINUTE+s*$n.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var gAe=/^(\d{4})$/,yAe=/^(\d{4})-(\d{2})$/,xAe=/^(\d{4})-?(\d{3})$/,bAe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,CAe=/^(\d{4})-?(\d{2})-?(\d{2})$/,jG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,TAe=/^(\d{2})(\.\d+)?/.source+jG.source,AAe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+jG.source,EAe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+jG.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Jn.UTC);let i=e|0;t=t+(e-i)*$n.SECONDS_PER_DAY,f_(i,t,this),n===Jn.UTC&&bD(this)}vt.fromGregorianDate=function(e,t){let n=WG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(f_(n[0],n[1],t),bD(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromDate=function(e,t){let n=WG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(f_(n[0],n[1],t),bD(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(CAe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(yAe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(gAe),n!==null)i=+n[1];else{let C;if(n=f.match(xAe),n!==null)i=+n[1],C=+n[2],g=u_(i);else if(n=f.match(bAe),n!==null){i=+n[1];let T=+n[2],A=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+A-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=u_(i);let h;if(l(d)){n=d.match(EAe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(AAe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(TAe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],A=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-A;break;case"-":s=s+T,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?HG:zG[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?HG:zG[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?HG:zG[o-1],r+=p;let b=WG(i,o,r,s,a,c,u);return l(t)?(f_(b[0],b[1],t),bD(t)):t=new vt(b[0],b[1],Jn.UTC),x&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var xD=new vt(0,0,Jn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=gK(e,xD);l(i)||(vt.addSeconds(e,-1,xD),i=gK(xD,xD),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=r/$n.SECONDS_PER_HOUR|0,h=r-g*$n.SECONDS_PER_HOUR,x=h/$n.SECONDS_PER_MINUTE|0;h=h-x*$n.SECONDS_PER_MINUTE;let b=h|0,C=(h-b)/$n.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=b,t.millisecond=C,t.isLeapSecond=n,t):new l_(p,d,f,g,x,b,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,yK),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,yK),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Jn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/$n.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*$n.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/$n.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){wb.julianDate=e;let t=vt.leapSeconds,n=Oo(t,wb,GG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return f_(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*$n.SECONDS_PER_MINUTE;return f_(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*$n.SECONDS_PER_HOUR;return f_(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return f_(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new Wi(new vt(2441317,43210,Jn.TAI),10),new Wi(new vt(2441499,43211,Jn.TAI),11),new Wi(new vt(2441683,43212,Jn.TAI),12),new Wi(new vt(2442048,43213,Jn.TAI),13),new Wi(new vt(2442413,43214,Jn.TAI),14),new Wi(new vt(2442778,43215,Jn.TAI),15),new Wi(new vt(2443144,43216,Jn.TAI),16),new Wi(new vt(2443509,43217,Jn.TAI),17),new Wi(new vt(2443874,43218,Jn.TAI),18),new Wi(new vt(2444239,43219,Jn.TAI),19),new Wi(new vt(2444786,43220,Jn.TAI),20),new Wi(new vt(2445151,43221,Jn.TAI),21),new Wi(new vt(2445516,43222,Jn.TAI),22),new Wi(new vt(2446247,43223,Jn.TAI),23),new Wi(new vt(2447161,43224,Jn.TAI),24),new Wi(new vt(2447892,43225,Jn.TAI),25),new Wi(new vt(2448257,43226,Jn.TAI),26),new Wi(new vt(2448804,43227,Jn.TAI),27),new Wi(new vt(2449169,43228,Jn.TAI),28),new Wi(new vt(2449534,43229,Jn.TAI),29),new Wi(new vt(2450083,43230,Jn.TAI),30),new Wi(new vt(2450630,43231,Jn.TAI),31),new Wi(new vt(2451179,43232,Jn.TAI),32),new Wi(new vt(2453736,43233,Jn.TAI),33),new Wi(new vt(2454832,43234,Jn.TAI),34),new Wi(new vt(2456109,43235,Jn.TAI),35),new Wi(new vt(2457204,43236,Jn.TAI),36),new Wi(new vt(2457754,43237,Jn.TAI),37)];var ee=vt;var kK=ur(Dl(),1);function SAe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var ED=SAe;function SK(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=SK(o,t)),n[i]=o}return n}var Ye=SK;function vK(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=vK(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var _t=vK;function vAe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var ua=vAe;var wK=ur(Dl(),1);function qG(e,t){let n;return typeof document<"u"&&(n=document),qG._implementation(e,t,n)}qG._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new wK.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var d_=qG;var IK=ur(Dl(),1);function wAe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new IK.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var SD=wAe;var DK=ur(Dl(),1);function IAe(e){let t=new DK.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var Pb=IAe;var PK={};function DAe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=PK[t];l(i)||(i={},PK[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Jd=DAe;var PAe=/^blob:/i;function OAe(e){return PAe.test(e)}var Ob=OAe;var Zd;function RAe(e){l(Zd)||(Zd=document.createElement("a")),Zd.href=window.location.href;let t=Zd.host,n=Zd.protocol;return Zd.href=e,Zd.href=Zd.href,n!==Zd.protocol||t!==Zd.host}var Rb=RAe;var MAe=/^data:/i;function LAe(e){return MAe.test(e)}var m_=LAe;function NAe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var Mb=NAe;function FAe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var Lb=FAe;function BAe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Iu=BAe;var kAe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ni=Object.freeze(kAe);var UAe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},os=Object.freeze(UAe);function vD(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,os.OTHER),this.serverKey=e.serverKey,this.state=ni.UNISSUED,this.deferred=void 0,this.cancelled=!1}vD.prototype.cancel=function(){this.cancelled=!0};vD.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ni.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new vD(this)};var Qo=vD;function VAe(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var wD=VAe;function OK(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=wD(this.responseHeaders))}OK.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var wh=OK;var DD=ur(Dl(),1);function Yy(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Yy.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function YG(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Yy.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};Yy.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(YG(i,o,e),e=o):r=!1}};Yy.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Yy.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)YG(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};Yy.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return YG(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var ID=Yy;function zAe(e,t){return e.priority-t.priority}var Ji={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Nb=20,Pa=new ID({comparator:zAe});Pa.maximumLength=Nb;Pa.reserve(Nb);var $d=[],Ih={},HAe=typeof document<"u"?new DD.default(document.location.href):new DD.default,PD=new _e;function Vo(){}Vo.maximumRequests=50;Vo.maximumRequestsPerServer=6;Vo.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18};Vo.throttleRequests=!0;Vo.debugShowStatistics=!1;Vo.requestCompletedEvent=PD;Object.defineProperties(Vo,{statistics:{get:function(){return Ji}},priorityHeapLength:{get:function(){return Nb},set:function(e){if(e<Nb)for(;Pa.length>e;){let t=Pa.pop();Xy(t)}Nb=e,Pa.maximumLength=e,Pa.reserve(e)}}});function RK(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Vo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Vo.requestsByServer[e],Vo.maximumRequestsPerServer);return Ih[e]+t<=n};Vo.heapHasOpenSlots=function(e){return Pa.length+e<=Nb};function MK(e){return e.state===ni.UNISSUED&&(e.state=ni.ISSUED,e.deferred=ua()),e.deferred.promise}function GAe(e){return function(t){if(e.state===ni.CANCELLED)return;let n=e.deferred;--Ji.numberOfActiveRequests,--Ih[e.serverKey],PD.raiseEvent(),e.state=ni.RECEIVED,e.deferred=void 0,n.resolve(t)}}function WAe(e){return function(t){e.state!==ni.CANCELLED&&(++Ji.numberOfFailedRequests,--Ji.numberOfActiveRequests,--Ih[e.serverKey],PD.raiseEvent(t),e.state=ni.FAILED,e.deferred.reject(t))}}function LK(e){let t=MK(e);return e.state=ni.ACTIVE,$d.push(e),++Ji.numberOfActiveRequests,++Ji.numberOfActiveRequestsEver,++Ih[e.serverKey],e.requestFunction().then(GAe(e)).catch(WAe(e)),t}function Xy(e){let t=e.state===ni.ACTIVE;if(e.state=ni.CANCELLED,++Ji.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Ji.numberOfActiveRequests,--Ih[e.serverKey],++Ji.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Vo.update=function(){let e,t,n=0,i=$d.length;for(e=0;e<i;++e){if(t=$d[e],t.cancelled&&Xy(t),t.state!==ni.ACTIVE){++n;continue}n>0&&($d[e-n]=t)}$d.length-=n;let o=Pa.internalArray,r=Pa.length;for(e=0;e<r;++e)RK(o[e]);Pa.resort();let s=Math.max(Vo.maximumRequests-$d.length,0),a=0;for(;a<s&&Pa.length>0;){if(t=Pa.pop(),t.cancelled){Xy(t);continue}if(t.throttleByServer&&!Vo.serverHasOpenSlots(t.serverKey)){Xy(t);continue}LK(t),++a}jAe()};Vo.getServerKey=function(e){let t=new DD.default(e);t.scheme()===""&&(t=t.absoluteTo(HAe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Ih[n];return l(i)||(Ih[n]=0),n};Vo.request=function(e){if(m_(e.url)||Ob(e.url))return PD.raiseEvent(),e.state=ni.RECEIVED,e.requestFunction();if(++Ji.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Vo.getServerKey(e.url)),Vo.throttleRequests&&e.throttleByServer&&!Vo.serverHasOpenSlots(e.serverKey))return;if(!Vo.throttleRequests||!e.throttle)return LK(e);if($d.length>=Vo.maximumRequests)return;RK(e);let t=Pa.insert(e);if(l(t)){if(t===e)return;Xy(t)}return MK(e)};function jAe(){Vo.debugShowStatistics&&(Ji.numberOfActiveRequests===0&&Ji.lastNumberOfActiveRequests>0&&(Ji.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ji.numberOfAttemptedRequests}`),Ji.numberOfAttemptedRequests=0),Ji.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ji.numberOfCancelledRequests}`),Ji.numberOfCancelledRequests=0),Ji.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ji.numberOfCancelledActiveRequests}`),Ji.numberOfCancelledActiveRequests=0),Ji.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ji.numberOfFailedRequests}`),Ji.numberOfFailedRequests=0)),Ji.lastNumberOfActiveRequests=Ji.numberOfActiveRequests)}Vo.clearForSpecs=function(){for(;Pa.length>0;){let t=Pa.pop();Xy(t)}let e=$d.length;for(let t=0;t<e;++t)Xy($d[t]);$d.length=0,Ih={},Ji.numberOfAttemptedRequests=0,Ji.numberOfActiveRequests=0,Ji.numberOfCancelledRequests=0,Ji.numberOfCancelledActiveRequests=0,Ji.numberOfFailedRequests=0,Ji.numberOfActiveRequestsEver=0,Ji.lastNumberOfActiveRequests=0};Vo.numberOfActiveRequestsByServer=function(e){return Ih[e]};Vo.requestHeap=Pa;var cc=Vo;var NK=ur(Dl(),1);var $E={},Fb={};$E.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(Fb[n])||(Fb[n]=!0)};$E.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(Fb[n])&&delete Fb[n]};function qAe(e){let t=new NK.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}$E.contains=function(e){let t=qAe(e);return!!(l(t)&&l(Fb[t]))};$E.clear=function(){Fb={}};var QE=$E;var UK=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function St(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Qd(e.templateValues,{}),this._queryParameters=Qd(e.queryParameters,{}),this.headers=Qd(e.headers,{}),this.request=y(e.request,new Qo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Qd(e,t){return l(e)?Ye(e):t}St.createIfNeeded=function(e){return e instanceof St?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new St({url:e})};var Bb;St.supportsImageBitmapOptions=function(){if(l(Bb))return Bb;if(typeof createImageBitmap!="function")return Bb=Promise.resolve(!1),Bb;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return Bb=St.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Jd(t[0]),i=Jd(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),Bb};Object.defineProperties(St,{isBlobSupported:{get:function(){return UK}}});Object.defineProperties(St.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Pb(this._url)}},isDataUri:{get:function(){return m_(this._url)}},isBlobUri:{get:function(){return Ob(this._url)}},isCrossOriginUrl:{get:function(){return Rb(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});St.prototype.toString=function(){return this.getUrlComponent(!0,!0)};St.prototype.parseUrl=function(e,t,n,i){let o=new kK.default(e),r=YAe(o.query());this._queryParameters=t?RD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(d_(i))),this._url=o.toString()};function YAe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Iu(e)}function RD(e,t,n){if(!n)return _t(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}St.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${XAe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function XAe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Lb(e)}`}St.prototype.setQueryParameters=function(e,t){t?this._queryParameters=RD(this._queryParameters,e,!1):this._queryParameters=RD(e,this._queryParameters,!1)};St.prototype.appendQueryParameters=function(e){this._queryParameters=RD(e,this._queryParameters,!0)};St.prototype.setTemplateValues=function(e,t){t?this._templateValues=_t(this._templateValues,e):this._templateValues=_t(e,this._templateValues)};St.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=_t(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=_t(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=_t(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};St.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};St.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new St({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};St.prototype.getBaseUri=function(e){return SD(this.getUrlComponent(e),e)};St.prototype.appendForwardSlash=function(){this._url=ED(this._url)};St.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};St.fetchArrayBuffer=function(e){return new St(e).fetchArrayBuffer()};St.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};St.fetchBlob=function(e){return new St(e).fetchBlob()};St.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(KG(this.request),!UK||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return XG({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return St.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return St.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new St({url:d}),XG({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function XG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=ua();return St._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=cc.request(r);if(l(s))return s.catch(function(a){return r.state!==ni.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=ni.UNISSUED,r.deferred=void 0,XG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}St.fetchImage=function(e){return new St(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};St.prototype.fetchText=function(){return this.fetch({responseType:"text"})};St.fetchText=function(e){return new St(e).fetchText()};St.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};St.fetchJson=function(e){return new St(e).fetchJson()};St.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};St.fetchXML=function(e){return new St(e).fetchXML()};St.prototype.fetchJsonp=function(e){e=y(e,"callback"),KG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return VK(this,e,t)};function VK(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=ua();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},St._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=cc.request(o);if(l(s))return s.catch(function(a){return o.state!==ni.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=ni.UNISSUED,o.deferred=void 0,VK(e,t,n)):Promise.reject(a)})})}St.fetchJsonp=function(e){return new St(e).fetchJsonp(e.callbackParameterName)};St.prototype._makeRequest=function(e){let t=this;KG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=_t(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=ua(),d=St._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=cc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ni.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ni.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function KG(e){if(e.state===ni.ISSUED||e.state===ni.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ni.UNISSUED,e.deferred=void 0}var KAe=/^data:(.*?)(;base64)?,(.*)$/;function OD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function FK(e,t){let n=OD(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function JAe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return OD(i,o);case"arraybuffer":return FK(i,o);case"blob":return r=FK(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(OD(i,o),n);case"json":return JSON.parse(OD(i,o));default:}}St.prototype.fetch=function(e){return e=Qd(e,{}),e.method="GET",this._makeRequest(e)};St.fetch=function(e){return new St(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.delete=function(e){return e=Qd(e,{}),e.method="DELETE",this._makeRequest(e)};St.delete=function(e){return new St(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};St.prototype.head=function(e){return e=Qd(e,{}),e.method="HEAD",this._makeRequest(e)};St.head=function(e){return new St(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.options=function(e){return e=Qd(e,{}),e.method="OPTIONS",this._makeRequest(e)};St.options=function(e){return new St(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.post=function(e,t){return wl.defined("data",e),t=Qd(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};St.post=function(e){return new St(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.put=function(e,t){return wl.defined("data",e),t=Qd(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};St.put=function(e){return new St(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.patch=function(e,t){return wl.defined("data",e),t=Qd(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};St.patch=function(e){return new St(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St._Implementations={};St._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(QE.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};St._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;St.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){St._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=ua(),d=St._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new de(`Successfully retrieved ${s} but it contained no content.`));return}return St.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};St.createImageBitmapFromBlob=function(e,t){return wl.defined("options",t),wl.typeOf.bool("options.flipY",t.flipY),wl.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),wl.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function BK(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function ZAe(e,t,n,i,o,r,s){let a,c;Promise.all([import("url"),import("zlib")]).then(([u,f])=>(a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:o};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){r.reject(new wh(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,x){h?r.reject(new de("Error decompressing response.")):r.resolve(BK(x,t))}):r.resolve(BK(g,t))})}).on("error",function(d){r.reject(new wh)}).end()})}var $Ae=typeof XMLHttpRequest>"u";St._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=KAe.exec(e);if(a!==null){r.resolve(JAe(a,t));return}if($Ae){ZAe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(QE.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new wh(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(x){let b=x.split(": "),C=b.shift();h[C]=b.join(": ")}),r.resolve(h);return}if(c.status===204)r.resolve();else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new wh)},c.send(i),c};St._Implementations.loadAndExecuteScript=function(e,t,n){return Mb(e,t).catch(function(i){n.reject(i)})};St._DefaultImplementations={};St._DefaultImplementations.createImage=St._Implementations.createImage;St._DefaultImplementations.loadWithXhr=St._Implementations.loadWithXhr;St._DefaultImplementations.loadAndExecuteScript=St._Implementations.loadAndExecuteScript;St.DEFAULT=Object.freeze(new St({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=St;function tS(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?zK(this,e.data):zK(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}tS.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new tS({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};tS.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new qy(0,0,0,0,0),t}});tS.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new qy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,GK(this,n,this._samples,e,o,r,t),t}let s=Oo(n,e,ee.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,GK(this,n,this._samples,e,o,r,t),t};function QAe(e,t){return ee.compare(e.julianDate,t)}function zK(e,t){if(!l(t.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,h=u.length;g<h;g+=e._columnCount){let x=u[g+n],b=u[g+c],C=x+$n.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new ee(C,b,Jn.TAI);if(f.push(T),p){if(b!==d&&l(d)){let A=ee.leapSeconds,S=Oo(A,T,QAe);if(S<0){let v=new Wi(T,b);A.splice(~S,0,v)}}d=b}}}function HK(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function eS(e,t,n){return t+e*(n-t)}function GK(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return HK(e,n,o,a,s),s;if(i.equals(u))return HK(e,n,r,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=o*a,p=r*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],x=h-g;if(x>.5||x<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];b!==C&&(u.equals(i)?g=h:h-=C-b)}return s.xPoleWander=eS(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=eS(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=eS(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=eS(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=eS(f,g,h),s}var MD=tS;function Oa(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Oa.fromQuaternion=function(e,t){l(t)||(t=new Oa);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};Oa.fromDegrees=function(e,t,n,i){return l(i)||(i=new Oa),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Oa.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Oa(e.heading,e.pitch,e.roll)};Oa.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Oa.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Oa.prototype.clone=function(e){return Oa.clone(this,e)};Oa.prototype.equals=function(e){return Oa.equals(this,e)};Oa.prototype.equalsEpsilon=function(e,t,n){return Oa.equalsEpsilon(this,e,t,n)};Oa.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var lc=Oa;var WK=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function eEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=WK.exec(i);if(o!==null)return o[1]}}var kb;function jK(e){return typeof document>"u"?e:(l(kb)||(kb=document.createElement("a")),kb.href=e,kb.href=kb.href,kb.href)}var Ky;function qK(){if(l(Ky))return Ky;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($1.toUrl)?e=d_("..",Jy("Core/buildModuleUrl.js")):e=eEe(),Ky=new ve({url:jK(e)}),Ky.appendForwardSlash(),Ky}function tEe(e){return jK($1.toUrl(`../${e}`))}function YK(e){return qK().getDerivedResource({url:e}).url}var LD;function Jy(e){return l(LD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($1.toUrl)?LD=tEe:LD=YK),LD(e)}Jy._cesiumScriptRegex=WK;Jy._buildModuleUrlFromBaseUrl=YK;Jy._clearBaseResource=function(){Ky=void 0};Jy.setBaseUrl=function(e){Ky=ve.DEFAULT.getDerivedResource({url:e})};Jy.getCesiumBaseUrl=qK;var nn=Jy;function nEe(e,t,n){this.x=e,this.y=t,this.s=n}var Ub=nEe;function $G(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var iEe=new ee(0,0,Jn.TAI);function JG(e,t,n){let i=iEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}$G.prototype.preload=function(e,t,n,i){let o=JG(this,e,t),r=JG(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(ZG(this,d));return Promise.all(f)};$G.prototype.computeXysRadians=function(e,t,n){let i=JG(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(ZG(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(ZG(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new Ub(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,x,b;for(x=0;x<=r;++x)d[x]=f-h[x];for(x=0;x<=r;++x){for(g[x]=1,b=0;b<=r;++b)b!==x&&(g[x]*=d[b]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*u[C++],n.y+=g[x]*u[C++],n.s+=g[x]*u[C]}return n};function ZG(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ve({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var ND=$G;var ji={},QG={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Vb={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},e8={},Gc={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},h_=new m,p_=new m,__=new m;ji.localFrameToFixedFrameGenerator=function(e,t){if(!QG.hasOwnProperty(e)||!QG[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=QG[e][t],i,o=e+t;return l(e8[o])?i=e8[o]:(i=function(r,s,a){if(l(a)||(a=new L),m.equalsEpsilon(r,m.ZERO,P.EPSILON14))m.unpack(Vb[e],0,h_),m.unpack(Vb[t],0,p_),m.unpack(Vb[n],0,__);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);m.unpack(Vb[e],0,h_),e!=="east"&&e!=="west"&&m.multiplyByScalar(h_,c,h_),m.unpack(Vb[t],0,p_),t!=="east"&&t!=="west"&&m.multiplyByScalar(p_,c,p_),m.unpack(Vb[n],0,__),n!=="east"&&n!=="west"&&m.multiplyByScalar(__,c,__)}else{s=y(s,oe.WGS84),s.geodeticSurfaceNormal(r,Gc.up);let c=Gc.up,u=Gc.east;u.x=-r.y,u.y=r.x,u.z=0,m.normalize(u,Gc.east),m.cross(c,u,Gc.north),m.multiplyByScalar(Gc.up,-1,Gc.down),m.multiplyByScalar(Gc.east,-1,Gc.west),m.multiplyByScalar(Gc.north,-1,Gc.south),h_=Gc[e],p_=Gc[t],__=Gc[n]}return a[0]=h_.x,a[1]=h_.y,a[2]=h_.z,a[3]=0,a[4]=p_.x,a[5]=p_.y,a[6]=p_.z,a[7]=0,a[8]=__.x,a[9]=__.y,a[10]=__.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},e8[o]=i),i};ji.eastNorthUpToFixedFrame=ji.localFrameToFixedFrameGenerator("east","north");ji.northEastDownToFixedFrame=ji.localFrameToFixedFrameGenerator("north","east");ji.northUpEastToFixedFrame=ji.localFrameToFixedFrameGenerator("north","up");ji.northWestUpToFixedFrame=ji.localFrameToFixedFrameGenerator("north","west");var oEe=new Be,rEe=new m(1,1,1),sEe=new L;ji.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ji.eastNorthUpToFixedFrame);let r=Be.fromHeadingPitchRoll(t,oEe),s=L.fromTranslationQuaternionRotationScale(m.ZERO,r,rEe,sEe);return o=i(e,n,o),L.multiply(o,s,o)};var aEe=new L,cEe=new Z;ji.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ji.headingPitchRollToFixedFrame(e,t,n,i,aEe),s=L.getMatrix3(r,cEe);return Be.fromRotationMatrix(s,o)};var lEe=new m(1,1,1),uEe=new m,XK=new L,fEe=new L,dEe=new Z,mEe=new Be;ji.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,ji.eastNorthUpToFixedFrame),l(i)||(i=new lc);let o=L.getTranslation(e,uEe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=L.inverseTransformation(n(o,t,XK),XK),s=L.setScale(e,lEe,fEe);s=L.setTranslation(s,m.ZERO,s),r=L.multiply(r,s,r);let a=Be.fromRotationMatrix(L.getMatrix3(r,dEe),mEe);return a=Be.normalize(a,a),lc.fromQuaternion(a,i)};var hEe=6*3600+41*60+50.54841,pEe=8640184812866e-6,_Ee=.093104,gEe=-62e-7,yEe=11772758384668e-32,xEe=72921158553e-15,bEe=P.TWO_PI/86400,FD=new ee;ji.computeTemeToPseudoFixedMatrix=function(e,t){FD=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),FD);let n=FD.dayNumber,i=FD.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/$n.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/$n.DAYS_PER_JULIAN_CENTURY;let a=(hEe+o*(pEe+o*(_Ee+o*gEe)))*bEe%P.TWO_PI,c=xEe+yEe*(n-24515455e-1),u=(i+$n.SECONDS_PER_DAY*.5)%$n.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};ji.iau2006XysData=new ND;ji.earthOrientationParameters=MD.NONE;var i8=32.184,CEe=2451545;ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+i8,i=e.stop.dayNumber,o=e.stop.secondsOfDay+i8;return ji.iau2006XysData.preload(t,n,i,o)};ji.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=ji.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var TEe=new Ub(0,0,0),AEe=new qy(0,0,0,0,0,0),t8=new Z,n8=new Z;ji.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=ji.earthOrientationParameters.compute(e,AEe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+i8,r=ji.iau2006XysData.computeXysRadians(i,o,TEe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=t8;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-r.s,n8),d=Z.multiply(u,f,t8),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,x=g/$n.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(h+x);b=b%1*P.TWO_PI;let C=Z.fromRotationZ(b,n8),T=Z.multiply(d,C,t8),A=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),O=i-CEe+o/$n.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,N=Math.cos(R),F=Math.sin(R),_=n8;return _[0]=A*N,_[1]=A*F,_[2]=v,_[3]=-S*F+I*v*N,_[4]=S*N+I*v*F,_[5]=-I*A,_[6]=-I*F-S*v*N,_[7]=I*N-S*v*F,_[8]=S*A,Z.multiply(T,_,t)};var EEe=new re;ji.pointToWindowCoordinates=function(e,t,n,i){return i=ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ji.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let o=EEe;return L.multiplyByVector(e,re.fromElements(n.x,n.y,n.z,1,o),o),re.multiplyByScalar(o,1/o.w,o),L.multiplyByVector(t,o,o),H.fromCartesian4(o,i)};var SEe=new m,vEe=new m,wEe=new m;ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,oe.WGS84).geodeticSurfaceNormal(e,SEe),r=m.cross(t,o,vEe);m.equalsEpsilon(r,m.ZERO,P.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,wEe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new Z),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var KK=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),JK=new me,ZK=new m,IEe=new m,DEe=new Z,o8=new L,$K=new L;ji.basisTo2D=function(e,t,n){let i=L.getTranslation(t,IEe),o=e.ellipsoid,r=o.cartesianToCartographic(i,JK),s=e.project(r,ZK);m.fromElements(s.z,s.x,s.y,s);let a=ji.eastNorthUpToFixedFrame(i,o,o8),c=L.inverseTransformation(a,$K),u=L.getMatrix3(t,DEe),f=L.multiplyByMatrix3(c,u,n);return L.multiply(KK,f,n),L.setTranslation(n,s,n),n};ji.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ji.eastNorthUpToFixedFrame(t,i,o8),r=L.inverseTransformation(o,$K),s=i.cartesianToCartographic(t,JK),a=e.project(s,ZK);m.fromElements(a.z,a.x,a.y,a);let c=L.fromTranslation(a,o8);return L.multiply(KK,r,n),L.multiply(c,n,n),n};var Mt=ji;function r8(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Fe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Nf.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}r8.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var PEe=new me,OEe=new m,QK=new L,REe=[new me,new me,new me],MEe=[new H,new H,new H],LEe=[new H,new H,new H],NEe=new m,FEe=new Be,BEe=new L,kEe=new no;r8._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,PEe),s=me.toCartesian(r,n,OEe),a=Mt.eastNorthUpToFixedFrame(s,n,QK),c=L.inverse(a,QK),u=MEe,f=REe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=NEe;for(o=0;o<3;o++)me.toCartesian(f[o],n,d),d=L.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Be.fromAxisAngle(m.UNIT_Z,-t,FEe),g=Z.fromQuaternion(p,BEe),h=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o<h;o++)d=L.multiplyByPointAsVector(c,e[o],d),d=Z.multiplyByVector(g,d,d),x=Math.min(x,d.x),b=Math.min(b,d.y),C=Math.max(C,d.x),T=Math.max(T,d.y);let A=no.fromRotation(t,kEe),S=LEe;S[0].x=x,S[0].y=b,S[1].x=x,S[1].y=T,S[2].x=C,S[2].y=b;let v=u[0],I=u[2].x-v.x,O=u[1].y-v.y;for(o=0;o<3;o++){let E=S[o];no.multiplyByVector(A,E,E),E.x=(E.x-v.x)/I,E.y=(E.y-v.y)/O}let R=S[0],N=S[1],F=S[2],_=new Array(6);return H.pack(R,_),H.pack(N,_,2),H.pack(F,_,4),_};var dt=r8;function UEe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Pe=UEe;function VEe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var gn=VEe;var zEe={NONE:0,TOP:1,ALL:2},an=Object.freeze(zEe);function Wr(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}Wr.POSITION_ONLY=Object.freeze(new Wr({position:!0}));Wr.POSITION_AND_NORMAL=Object.freeze(new Wr({position:!0,normal:!0}));Wr.POSITION_NORMAL_AND_ST=Object.freeze(new Wr({position:!0,normal:!0,st:!0}));Wr.POSITION_AND_ST=Object.freeze(new Wr({position:!0,st:!0}));Wr.POSITION_AND_COLOR=Object.freeze(new Wr({position:!0,color:!0}));Wr.ALL=Object.freeze(new Wr({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Wr.DEFAULT=Wr.POSITION_NORMAL_AND_ST;Wr.packedLength=6;Wr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Wr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Wr),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Wr.clone=function(e,t){if(l(e))return l(t)||(t=new Wr),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Me=Wr;var HEe=new m;function Pl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Me.DEFAULT);this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Pl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Pl({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Pl.fromAxisAlignedBoundingBox=function(e){return new Pl({minimum:e.minimum,maximum:e.maximum})};Pl.packedLength=2*m.packedLength+Me.packedLength+1;Pl.pack=function(e,t,n){return n=y(n,0),m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Me.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Me.packedLength]=y(e._offsetAttribute,-1),t};var tJ=new m,nJ=new m,iJ=new Me,eJ={minimum:tJ,maximum:nJ,vertexFormat:iJ,offsetAttribute:void 0};Pl.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,tJ),o=m.unpack(e,t+m.packedLength,nJ),r=Me.unpack(e,t+2*m.packedLength,iJ),s=e[t+2*m.packedLength+Me.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(o,n._maximum),n._vertexFormat=Me.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(eJ.offsetAttribute=s===-1?void 0:s,new Pl(eJ))};Pl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let o=new gn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=4+2,r[7]=4+1,r[8]=4+0,r[9]=4+3,r[10]=4+2,r[11]=4+0,r[12]=8+0,r[13]=8+1,r[14]=8+2,r[15]=8+0,r[16]=8+2,r[17]=8+3,r[18]=12+2,r[19]=12+1,r[20]=12+0,r[21]=12+3,r[22]=12+2,r[23]=12+0,r[24]=16+2,r[25]=16+1,r[26]=16+0,r[27]=16+3,r[28]=16+2,r[29]=16+0,r[30]=20+0,r[31]=20+1,r[32]=20+2,r[33]=20+0,r[34]=20+2,r[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=m.subtract(n,t,HEe),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===an.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new dt({attributes:o,indices:r,primitiveType:Fe.TRIANGLES,boundingSphere:new ae(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var s8;Pl.getUnitBox=function(){return l(s8)||(s8=Pl.createGeometry(Pl.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Me.POSITION_ONLY}))),s8};var Ol=Pl;var GEe=new m;function em(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}em.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new em({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};em.fromAxisAlignedBoundingBox=function(e){return new em({minimum:e.minimum,maximum:e.maximum})};em.packedLength=2*m.packedLength+1;em.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var rJ=new m,sJ=new m,oJ={minimum:rJ,maximum:sJ,offsetAttribute:void 0};em.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,rJ),o=m.unpack(e,t+m.packedLength,sJ),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(oJ.offsetAttribute=r===-1?void 0:r,new em(oJ))};em.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new gn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,GEe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===an.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new dt({attributes:i,indices:o,primitiveType:Fe.LINES,boundingSphere:new ae(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var tm=em;function zb(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(zb.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});zb.fromColor=function(e){return new zb(e.red,e.green,e.blue,e.alpha)};zb.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};zb.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Ht=zb;function nS(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(nS.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});nS.fromDistanceDisplayCondition=function(e){return new nS(e.near,e.far)};nS.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var zn=nS;function WEe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Tt=WEe;function zo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?ee.clone(e.start):new ee,this.stop=l(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(zo.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var Hb={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};zo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(Hb.start=i,Hb.stop=o,Hb.isStartIncluded=r,Hb.isStopIncluded=s,Hb.data=a,new zo(Hb))};zo.toIso8601=function(e,t){return`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};zo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new zo(e)};zo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};zo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};zo.intersect=function(e,t,n,i){if(!l(t))return zo.clone(zo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=ee.greaterThanOrEquals(s,o)&&ee.greaterThanOrEquals(r,s),u=!c&&ee.lessThanOrEquals(s,o)&&ee.lessThanOrEquals(o,a);if(!c&&!u)return zo.clone(zo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,h=ee.lessThan(r,a);return l(n)||(n=new zo),n.start=c?s:o,n.isStartIncluded=f&&p||!ee.equals(s,o)&&(c&&p||u&&f),n.stop=h?r:a,n.isStopIncluded=h?d:d&&g||!ee.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};zo.contains=function(e,t){if(e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};zo.prototype.clone=function(e){return zo.clone(this,e)};zo.prototype.equals=function(e,t){return zo.equals(this,e,t)};zo.prototype.equalsEpsilon=function(e,t,n){return zo.equalsEpsilon(this,e,t,n)};zo.prototype.toString=function(){return zo.toIso8601(this)};zo.EMPTY=Object.freeze(new zo({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var Sn=zo;var aJ=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),cJ=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),jEe=Object.freeze(new Sn({start:aJ,stop:cJ})),qEe={MINIMUM_VALUE:aJ,MAXIMUM_VALUE:cJ,MAXIMUM_INTERVAL:jEe},Ge=qEe;function iS(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(iS.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});iS.fromCartesian3=function(e){return new iS(e.x,e.y,e.z)};iS.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Zi=iS;function BD(e){e=y(e,!0),this.value=BD.toValue(e)}Object.defineProperties(BD.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});BD.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var bn=BD;var kD=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; -out vec2 v_textureCoordinates; +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -void main() + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = tangentToEyeMatrix; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var UD=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; + +void main() { - gl_Position = position; - v_textureCoordinates = textureCoordinates; + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_tangentEC = czm_normal * tangent; // tangent in eye coordinates + v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var lo={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function Wb(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Le.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ia(e,t){return(e._flags&t)===t}function o_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(Wb.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ia(this,lo.CULL)},set:function(e){Ia(this,lo.CULL)!==e&&(o_(this,lo.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ia(this,lo.OCCLUDE)},set:function(e){Ia(this,lo.OCCLUDE)!==e&&(o_(this,lo.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ia(this,lo.CAST_SHADOWS)},set:function(e){Ia(this,lo.CAST_SHADOWS)!==e&&(o_(this,lo.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ia(this,lo.RECEIVE_SHADOWS)},set:function(e){Ia(this,lo.RECEIVE_SHADOWS)!==e&&(o_(this,lo.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ia(this,lo.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ia(this,lo.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(o_(this,lo.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ia(this,lo.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ia(this,lo.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(o_(this,lo.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Ia(this,lo.PICK_ONLY)},set:function(e){Ia(this,lo.PICK_ONLY)!==e&&(o_(this,lo.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ia(this,lo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ia(this,lo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(o_(this,lo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});Wb.shallowClone=function(e,t){if(l(e))return l(t)||(t=new Wb),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};Wb.prototype.execute=function(e,t){e.draw(this,t)};var nt=Wb;var Ei={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Ei.toWebGLConstant=function(e,t){switch(e){case Ei.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Ei.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Ei.UNSIGNED_INT:return te.UNSIGNED_INT;case Ei.FLOAT:return te.FLOAT;case Ei.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Ei.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Ei.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Ei.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Ei.UNSIGNED_SHORT_5_6_5:return Ei.UNSIGNED_SHORT_5_6_5}};Ei.isPacked=function(e){return e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};Ei.sizeInBytes=function(e){switch(e){case Ei.UNSIGNED_BYTE:return 1;case Ei.UNSIGNED_SHORT:case Ei.UNSIGNED_SHORT_4_4_4_4:case Ei.UNSIGNED_SHORT_5_5_5_1:case Ei.UNSIGNED_SHORT_5_6_5:case Ei.HALF_FLOAT:return 2;case Ei.UNSIGNED_INT:case Ei.FLOAT:case Ei.UNSIGNED_INT_24_8:return 4}};Ei.validate=function(e){return e===Ei.UNSIGNED_BYTE||e===Ei.UNSIGNED_SHORT||e===Ei.UNSIGNED_INT||e===Ei.FLOAT||e===Ei.HALF_FLOAT||e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};var Qe=Object.freeze(Ei);var st={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let r=st.componentsLength(e);return Qe.isPacked(t)&&(r=1),r*Qe.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let r,o=Qe.sizeInBytes(t);o===Uint8Array.BYTES_PER_ELEMENT?r=Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?r=Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===Qe.FLOAT?r=Float32Array:r=Uint32Array;let s=st.componentsLength(e)*n*i;return new r(s)};st.flipY=function(e,t,n,i,r){if(r===1)return e;let o=st.createTypedArray(t,n,i,r),s=st.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===Qe.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Qe.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Qe.FLOAT)switch(e){case st.RGBA:return te.RGBA32F;case st.RGB:return te.RGB32F;case st.RG:return te.RG32F;case st.RED:return te.R32F}if(t===Qe.HALF_FLOAT)switch(e){case st.RGBA:return te.RGBA16F;case st.RGB:return te.RGB16F;case st.RG:return te.RG16F;case st.RED:return te.R16F}return e};var ct=Object.freeze(st);var uo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(uo,{maximumCombinedTextureImageUnits:{get:function(){return uo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return uo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return uo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return uo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return uo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return uo._maximumTextureSize}},maximumVaryingVectors:{get:function(){return uo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return uo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return uo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return uo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return uo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return uo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return uo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return uo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return uo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return uo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return uo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return uo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return uo._maximumColorAttachments}},maximumSamples:{get:function(){return uo._maximumSamples}},highpFloatSupported:{get:function(){return uo._highpFloatSupported}},highpIntSupported:{get:function(){return uo._highpIntSupported}}});var Gt=uo;function fG(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function fP(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Lf(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Gt.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0);let r=l(e.depthTexture)||l(e.depthRenderbuffer),o=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);this._bind();let s,a,c,u,f;if(l(e.colorTextures)){let d=e.colorTextures;for(u=this._colorTextures.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)s=d[c],f=this._gl.COLOR_ATTACHMENT0+c,fG(this,f,s),this._activeColorAttachments[c]=f,this._colorTextures[c]=s}if(l(e.colorRenderbuffers)){let d=e.colorRenderbuffers;for(u=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)a=d[c],f=this._gl.COLOR_ATTACHMENT0+c,fP(this,f,a),this._activeColorAttachments[c]=f,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,fG(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,fP(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,fP(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,fG(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,fP(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(Lf.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Lf.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Lf.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Lf.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Lf.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Lf.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Lf.prototype.getColorTexture=function(e){return this._colorTextures[e]};Lf.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Lf.prototype.isDestroyed=function(){return!1};Lf.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let r=t[e];l(r)&&r.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let r=i[e];l(r)&&r.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var ca=Lf;var dP={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};dP.validate=function(e){return e===dP.CLOCKWISE||e===dP.COUNTER_CLOCKWISE};var ts=Object.freeze(dP);function $X(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=$X(e[t]));return Object.freeze(e)}var eK=$X;function Zd(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),r=y(t.scissorTest,y.EMPTY_OBJECT),o=y(r.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),h=y(t.sampleCoverage,y.EMPTY_OBJECT),A=t.viewport;this.frontFace=y(t.frontFace,ts.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(r.enabled,!1),rectangle:Ke.clone(o)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(h.enabled,!1),value:y(h.value,1),invert:y(h.invert,!1)},this.viewport=l(A)?new Ke(A.x,A.y,A.width,A.height):void 0,this.id=0,this._applyFunctions=[]}var YCe=0,Jd={};Zd.fromCache=function(e){let t=JSON.stringify(e),n=Jd[t];if(l(n))return++n.referenceCount,n.state;let i=new Zd(e),r=JSON.stringify(i);return n=Jd[r],l(n)||(i.id=YCe++,n={referenceCount:0,state:i},Jd[r]=n),++n.referenceCount,Jd[t]={referenceCount:1,state:n.state},n.state};Zd.removeFromCache=function(e){let t=new Zd(e),n=JSON.stringify(t),i=Jd[n],r=JSON.stringify(e),o=Jd[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Jd[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Jd[n]};Zd.getCache=function(){return Jd};Zd.clearCache=function(){Jd={}};function Gy(e,t,n){n?e.enable(t):e.disable(t)}function tK(e,t){e.frontFace(t.frontFace)}function nK(e,t){let n=t.cull,i=n.enabled;Gy(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function iK(e,t){e.lineWidth(t.lineWidth)}function rK(e,t){let n=t.polygonOffset,i=n.enabled;Gy(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function oK(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Gy(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function sK(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function aK(e,t){let n=t.depthTest,i=n.enabled;Gy(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function cK(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function lK(e,t){e.depthMask(t.depthMask)}function uK(e,t){e.stencilMask(t.stencilMask)}function qCe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function fK(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Gy(e,e.BLEND,r),r&&(qCe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function dK(e,t){let n=t.stencilTest,i=n.enabled;if(Gy(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,h=p.zFail,A=p.zPass;e.stencilOpSeparate(e.BACK,g,h,A)}}function mK(e,t){let n=t.sampleCoverage,i=n.enabled;Gy(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var XCe=new Ke;function hK(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=XCe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Zd.apply=function(e,t,n){tK(e,t),nK(e,t),iK(e,t),rK(e,t),sK(e,t),aK(e,t),cK(e,t),lK(e,t),uK(e,t),dK(e,t),mK(e,t),oK(e,t,n),fK(e,t,n),hK(e,t,n)};function KCe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(tK),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(nK),e.lineWidth!==t.lineWidth&&n.push(iK),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(rK),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(sK),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(aK),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(cK),e.depthMask!==t.depthMask&&n.push(lK),e.stencilMask!==t.stencilMask&&n.push(uK),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(dK),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(mK),n}Zd.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=KCe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&oK(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&fK(e,n,r),(t!==n||i!==r||i.context!==r.context)&&hK(e,n,r)};Zd.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ke.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Ke.clone(e.viewport):void 0}};var ze=Zd;function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Xt.pack(e[r],t,r*4);return t};Xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=Xt.unpack(e,i,t[r])}return t};Xt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,r=e[i],o=e[i+1];return n.x=r,n.y=o,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let r=t*2;return i[r]=n.x,i[r+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],r=e[t+2];return n.x=i,n.y=r,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var JCe=new H;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,JCe),r=t.x/i.x,o=t.y/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var ZCe=new H;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,ZCe),r=t/i.x,o=t/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var pK=new H;Xt.getScale=function(e,t){return t.x=H.magnitude(H.fromElements(e[0],e[1],pK)),t.y=H.magnitude(H.fromElements(e[2],e[3],pK)),t};var _K=new H;Xt.getMaximumScale=function(e){return Xt.getScale(e,_K),H.maximumComponent(_K)};var QCe=new H;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,QCe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var $Ce=new H;Xt.getRotation=function(e,t){let n=Xt.getScale(e,$Ce);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],r=e[1],o=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var er=Xt;function eTe(e,t,n,i){switch(t.type){case e.FLOAT:return new gK(e,t,n,i);case e.FLOAT_VEC2:return new yK(e,t,n,i);case e.FLOAT_VEC3:return new AK(e,t,n,i);case e.FLOAT_VEC4:return new xK(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new dG(e,t,n,i);case e.INT:case e.BOOL:return new CK(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new TK(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new EK(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new bK(e,t,n,i);case e.FLOAT_MAT2:return new SK(e,t,n,i);case e.FLOAT_MAT3:return new vK(e,t,n,i);case e.FLOAT_MAT4:return new wK(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function gK(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}gK.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function yK(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}yK.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function AK(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}AK.prototype.set=function(){let e=this.value;e&&(l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function xK(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}xK.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function dG(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}dG.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};dG.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function CK(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}CK.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function TK(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}TK.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function EK(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}EK.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function bK(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}bK.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var tTe=new Float32Array(4);function SK(e,t,n,i){this.name=n,this.value=void 0,this._value=new er,this._gl=e,this._location=i}SK.prototype.set=function(){if(!er.equalsArray(this.value,this._value,0)){er.clone(this.value,this._value);let e=er.toArray(this.value,tTe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var nTe=new Float32Array(9);function vK(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}vK.prototype.set=function(){if(!Z.equalsArray(this.value,this._value,0)){Z.clone(this.value,this._value);let e=Z.toArray(this.value,nTe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var iTe=new Float32Array(16);function wK(e,t,n,i){this.name=n,this.value=void 0,this._value=new B,this._gl=e,this._location=i}wK.prototype.set=function(){if(!B.equalsArray(this.value,this._value,0)){B.clone(this.value,this._value);let e=B.toArray(this.value,iTe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var mP=eTe;function rTe(e,t,n,i){switch(t.type){case e.FLOAT:return new DK(e,t,n,i);case e.FLOAT_VEC2:return new IK(e,t,n,i);case e.FLOAT_VEC3:return new PK(e,t,n,i);case e.FLOAT_VEC4:return new OK(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new mG(e,t,n,i);case e.INT:case e.BOOL:return new RK(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new MK(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new BK(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new LK(e,t,n,i);case e.FLOAT_MAT2:return new NK(e,t,n,i);case e.FLOAT_MAT3:return new FK(e,t,n,i);case e.FLOAT_MAT4:return new UK(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function DK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._location=i[0]}DK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function IK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*2),this._gl=e,this._location=i[0]}IK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2fv(this._location,n)};function PK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*3),this._gl=e,this._location=i[0]}PK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?(s.red!==n[r]||s.green!==n[r+1]||s.blue!==n[r+2])&&(n[r]=s.red,n[r+1]=s.green,n[r+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0)),r+=3}i&&this._gl.uniform3fv(this._location,n)};function OK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}OK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?z.equalsArray(s,n,r)||(z.pack(s,n,r),i=!0):l(s.x)&&(oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0)),r+=4}i&&this._gl.uniform4fv(this._location,n)};function mG(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}mG.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let r=0;r<i;++r){let o=n[r];e.activeTexture(t+r),e.bindTexture(o._target,o._texture)}};mG.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let r=e+i;this._gl.uniform1i(t[i],r)}return e+n};function RK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r),this._gl=e,this._location=i[0]}RK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function MK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*2),this._gl=e,this._location=i[0]}MK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];H.equalsArray(s,n,r)||(H.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2iv(this._location,n)};function BK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*3),this._gl=e,this._location=i[0]}BK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];m.equalsArray(s,n,r)||(m.pack(s,n,r),i=!0),r+=3}i&&this._gl.uniform3iv(this._location,n)};function LK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*4),this._gl=e,this._location=i[0]}LK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];oe.equalsArray(s,n,r)||(oe.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniform4iv(this._location,n)};function NK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}NK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];er.equalsArray(s,n,r)||(er.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function FK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*9),this._gl=e,this._location=i[0]}FK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];Z.equalsArray(s,n,r)||(Z.pack(s,n,r),i=!0),r+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function UK(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*16),this._gl=e,this._location=i[0]}UK.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];B.equalsArray(s,n,r)||(B.pack(s,n,r),i=!0),r+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var hP=rTe;var oTe=0;function Sh(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=sTe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=oTe++}Sh.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Sh.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Sh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return pP(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return pP(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return pP(this),this._uniformsByName}}});function VK(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function sTe(e,t){let n={};if(!Gt.highpFloatSupported||!Gt.highpIntSupported){let i,r,o,s,a=VK(e),c=VK(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Qd="[Cesium WebGL] ";function aTe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Qd}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Qd}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Qd}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Qd}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Qd}Vertex shader compile log: ${c}`),console.error(`${Qd} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Qd}Fragment shader compile log: ${c}`),console.error(`${Qd} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${Qd}${g} shader translation failed.`);return}console.error(`${Qd}Translated ${g} shaderSource: -${h}`)}}function cTe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function lTe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=mP(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,h=u.indexOf("[");if(h>=0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let A=0;A<a.size;++A)g=e.getUniformLocation(t,`${u}[${A}]`),g!==null&&d.push(g);f=hP(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function uTe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=i_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function fTe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function pP(e){l(e._program)||kK(e)}function kK(e){let t=e._program,n=e._gl,i=aTe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=lTe(n,i),s=uTe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=cTe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=fTe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{kK(e),u(e._program)}catch(h){e._vertexShaderText=d,e._fragmentShaderText=p;let x=/(?:Compile|Link) error: ([^]*)/.exec(h.message);f(x?x[1]:h.message)}})}Sh.prototype._bind=function(){pP(this),this._gl.useProgram(this._program)};Sh.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Sh.prototype.isDestroyed=function(){return!1};Sh.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Sh.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=Sh;function _P(e){this._context=e}var jb,dTe=new nt({primitiveType:Le.TRIANGLES}),mTe=new oi({color:new z(0,0,0,0)});function hTe(e,t){return new ca({context:e,colorTextures:[t],destroyAttachments:!1})}function pTe(e,t){return Qt.fromCache({context:e,vertexShaderSource:bx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function _Te(e,t){return(!l(jb)||jb.viewport.width!==e||jb.viewport.height!==t)&&(jb=ze.fromCache({viewport:new Ke(0,0,e,t)})),jb}_P.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:pTe(r,e.fragmentShaderSource),a=hTe(r,t),c=_Te(n,i),u=e.uniformMap,f=mTe;f.framebuffer=a,f.renderState=c,f.execute(r);let d=dTe;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};_P.prototype.isDestroyed=function(){return!1};_P.prototype.destroy=function(){return ue(this)};var gP=_P;var En={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};En.getSizeInBytes=function(e){switch(e){case En.BYTE:return Int8Array.BYTES_PER_ELEMENT;case En.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case En.SHORT:return Int16Array.BYTES_PER_ELEMENT;case En.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case En.INT:return Int32Array.BYTES_PER_ELEMENT;case En.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case En.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case En.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};En.fromTypedArray=function(e){if(e instanceof Int8Array)return En.BYTE;if(e instanceof Uint8Array)return En.UNSIGNED_BYTE;if(e instanceof Int16Array)return En.SHORT;if(e instanceof Uint16Array)return En.UNSIGNED_SHORT;if(e instanceof Int32Array)return En.INT;if(e instanceof Uint32Array)return En.UNSIGNED_INT;if(e instanceof Float32Array)return En.FLOAT;if(e instanceof Float64Array)return En.DOUBLE};En.validate=function(e){return l(e)&&(e===En.BYTE||e===En.UNSIGNED_BYTE||e===En.SHORT||e===En.UNSIGNED_SHORT||e===En.INT||e===En.UNSIGNED_INT||e===En.FLOAT||e===En.DOUBLE)};En.createTypedArray=function(e,t){switch(e){case En.BYTE:return new Int8Array(t);case En.UNSIGNED_BYTE:return new Uint8Array(t);case En.SHORT:return new Int16Array(t);case En.UNSIGNED_SHORT:return new Uint16Array(t);case En.INT:return new Int32Array(t);case En.UNSIGNED_INT:return new Uint32Array(t);case En.FLOAT:return new Float32Array(t);case En.DOUBLE:return new Float64Array(t)}};En.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/En.getSizeInBytes(e)),e){case En.BYTE:return new Int8Array(t,n,i);case En.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case En.SHORT:return new Int16Array(t,n,i);case En.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case En.INT:return new Int32Array(t,n,i);case En.UNSIGNED_INT:return new Uint32Array(t,n,i);case En.FLOAT:return new Float32Array(t,n,i);case En.DOUBLE:return new Float64Array(t,n,i)}};En.fromName=function(e){switch(e){case"BYTE":return En.BYTE;case"UNSIGNED_BYTE":return En.UNSIGNED_BYTE;case"SHORT":return En.SHORT;case"UNSIGNED_SHORT":return En.UNSIGNED_SHORT;case"INT":return En.INT;case"UNSIGNED_INT":return En.UNSIGNED_INT;case"FLOAT":return En.FLOAT;case"DOUBLE":return En.DOUBLE}};var X=Object.freeze(En);var zK={};function Yb(e,t){l(zK[e])||(zK[e]=!0,console.warn(y(t,e)))}Yb.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";Yb.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Yb.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Yb.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Rt=Yb;function gTe(e,t){Rt(e,t)}var $=gTe;var yTe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Nf=Object.freeze(yTe);function it(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var qb=new m;it.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);qb=m.normalize(e,qb);let o=qb.x*r,s=qb.y*r,a=qb.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new it(o,s,a,c)};var ATe=[1,2,0],xTe=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[Z.COLUMN0ROW0],c=e[Z.COLUMN1ROW1],u=e[Z.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,r=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,o=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=ATe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(g,g)]-e[Z.getElementIndex(h,h)]+1);let A=xTe;A[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(h,g)]-e[Z.getElementIndex(g,h)])*n,A[g]=(e[Z.getElementIndex(g,p)]+e[Z.getElementIndex(p,g)])*n,A[h]=(e[Z.getElementIndex(h,p)]+e[Z.getElementIndex(p,h)])*n,i=-A[0],r=-A[1],o=-A[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new it(i,r,o,s)};var HK=new it,GK=new it,hG=new it,WK=new it;it.fromHeadingPitchRoll=function(e,t){return WK=it.fromAxisAngle(m.UNIT_X,e.roll,HK),hG=it.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=it.multiply(hG,WK,hG),GK=it.fromAxisAngle(m.UNIT_Z,-e.heading,HK),it.multiply(GK,t,t)};var yP=new m,pG=new m,Ff=new it,jK=new it,AP=new it;it.packedLength=4;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,AP),it.conjugate(AP,AP);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;it.unpack(e,(t+r)*4,Ff),it.multiply(Ff,AP,Ff),Ff.w<0&&it.negate(Ff,Ff),it.computeAxis(Ff,yP);let a=it.computeAngle(Ff);l(i)||(i=[]),i[s]=yP.x*a,i[s+1]=yP.y*a,i[s+2]=yP.z*a}};it.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new it),m.fromArray(e,0,pG);let o=m.magnitude(pG);return it.unpack(t,i*4,jK),o===0?it.clone(it.IDENTITY,Ff):it.fromAxisAngle(pG,o,Ff),it.multiply(Ff,jK,r)};it.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};it.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,h=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=h,n};it.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};it.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};it.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var _G=new it;it.lerp=function(e,t,n,i){return _G=it.multiplyByScalar(t,n,_G),i=it.multiplyByScalar(e,1-n,i),it.add(_G,i,i)};var YK=new it,gG=new it,yG=new it;it.slerp=function(e,t,n,i){let r=it.dot(e,t),o=t;if(r<0&&(r=-r,o=YK=it.negate(t,YK)),1-r<P.EPSILON6)return it.lerp(e,o,n,i);let s=Math.acos(r);return gG=it.multiplyByScalar(e,Math.sin((1-n)*s),gG),yG=it.multiplyByScalar(o,Math.sin(n*s),yG),i=it.add(gG,yG,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var CTe=new m,TTe=new m,Xb=new it,Sx=new it;it.computeInnerQuadrangle=function(e,t,n,i){let r=it.conjugate(t,Xb);it.multiply(r,n,Sx);let o=it.log(Sx,CTe);it.multiply(r,e,Sx);let s=it.log(Sx,TTe);return m.add(o,s,o),m.multiplyByScalar(o,.25,o),m.negate(o,o),it.exp(o,Xb),it.multiply(t,Xb,i)};it.squad=function(e,t,n,i,r,o){let s=it.slerp(e,t,r,Xb),a=it.slerp(n,i,r,Sx);return it.slerp(s,a,2*r*(1-r),o)};var ETe=new it,qK=1.9011074535173003,xP=jt.supportsTypedArrays()?new Float32Array(8):[],CP=jt.supportsTypedArrays()?new Float32Array(8):[],vh=jt.supportsTypedArrays()?new Float32Array(8):[],wh=jt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;xP[e]=1/(t*n),CP[e]=t/n}xP[7]=qK/(8*17);CP[7]=qK*8/17;it.fastSlerp=function(e,t,n,i){let r=it.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)vh[g]=(xP[g]*c-CP[g])*s,wh[g]=(xP[g]*u-CP[g])*s;let f=o*n*(1+vh[0]*(1+vh[1]*(1+vh[2]*(1+vh[3]*(1+vh[4]*(1+vh[5]*(1+vh[6]*(1+vh[7])))))))),d=a*(1+wh[0]*(1+wh[1]*(1+wh[2]*(1+wh[3]*(1+wh[4]*(1+wh[5]*(1+wh[6]*(1+wh[7])))))))),p=it.multiplyByScalar(e,d,ETe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,r,o){let s=it.fastSlerp(e,t,r,Xb),a=it.fastSlerp(n,i,r,Sx);return it.fastSlerp(s,a,2*r*(1-r),o)};it.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=it;function bTe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Or=bTe;function STe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var Wy=STe;function vTe(e,t,n,i,r,o,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a}var s_=vTe;function wTe(e){return e%4===0&&e%100!==0||e%400===0}var a_=wTe;function DTe(e,t){this.julianDate=e,this.offset=t}var zi=DTe;var ITe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Zn=Object.freeze(ITe);var PTe={UTC:0,TAI:1},Jn=Object.freeze(PTe);var KK=new s_,AG=[31,28,31,30,31,30,31,31,30,31,30,31],xG=29;function CG(e,t){return vt.compare(e.julianDate,t.julianDate)}var vx=new zi;function EP(e){vx.julianDate=e;let t=vt.leapSeconds,n=Or(t,vx,CG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function XK(e,t){vx.julianDate=e;let n=vt.leapSeconds,i=Or(n,vx,CG);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let r=vt.secondsDifference(n[i].julianDate,e);if(r===0)return vt.addSeconds(e,-n[i].offset,t);if(!(r<=1))return vt.addSeconds(e,-n[--i].offset,t)}function c_(e,t,n){let i=t/Zn.SECONDS_PER_DAY|0;return e+=i,t-=Zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function TG(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Zn.SECONDS_PER_HOUR+r*Zn.SECONDS_PER_MINUTE+s*Zn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var OTe=/^(\d{4})$/,RTe=/^(\d{4})-(\d{2})$/,MTe=/^(\d{4})-?(\d{3})$/,BTe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,LTe=/^(\d{4})-?(\d{2})-?(\d{2})$/,EG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,NTe=/^(\d{2})(\.\d+)?/.source+EG.source,FTe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+EG.source,UTe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+EG.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Jn.UTC);let i=e|0;t=t+(e-i)*Zn.SECONDS_PER_DAY,c_(i,t,this),n===Jn.UTC&&EP(this)}vt.fromGregorianDate=function(e,t){let n=TG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(c_(n[0],n[1],t),EP(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromDate=function(e,t){let n=TG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(c_(n[0],n[1],t),EP(t),t):new vt(n[0],n[1],Jn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,r=1,o=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(LTe),n!==null)i=+n[1],r=+n[2],o=+n[3];else if(n=f.match(RTe),n!==null)i=+n[1],r=+n[2];else if(n=f.match(OTe),n!==null)i=+n[1];else{let C;if(n=f.match(MTe),n!==null)i=+n[1],C=+n[2],g=a_(i);else if(n=f.match(BTe),n!==null){i=+n[1];let T=+n[2],E=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+E-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),r=p.getUTCMonth()+1,o=p.getUTCDate()}g=a_(i);let h;if(l(d)){n=d.match(UTe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(FTe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(NTe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],E=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-E;break;case"-":s=s+T,a=a+E;break;case"Z":break;default:a=a+new Date(Date.UTC(i,r-1,o,s,a)).getTimezoneOffset();break}}let A=c===60;for(A&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,o++;for(p=g&&r===2?xG:AG[r-1];o>p;)o-=p,r++,r>12&&(r-=12,i++),p=g&&r===2?xG:AG[r-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,o--;for(;o<1;)r--,r<1&&(r+=12,i--),p=g&&r===2?xG:AG[r-1],o+=p;let x=TG(i,r,o,s,a,c,u);return l(t)?(c_(x[0],x[1],t),EP(t)):t=new vt(x[0],x[1],Jn.UTC),A&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var TP=new vt(0,0,Jn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=XK(e,TP);l(i)||(vt.addSeconds(e,-1,TP),i=XK(TP,TP),n=!0);let r=i.dayNumber,o=i.secondsOfDay;o>=43200&&(r+=1);let s=r+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=o/Zn.SECONDS_PER_HOUR|0,h=o-g*Zn.SECONDS_PER_HOUR,A=h/Zn.SECONDS_PER_MINUTE|0;h=h-A*Zn.SECONDS_PER_MINUTE;let x=h|0,C=(h-x)/Zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(x+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=A,t.second=x,t.millisecond=C,t.isLeapSecond=n,t):new s_(p,d,f,g,A,x,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,KK),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,KK),i=n.year,r=n.month,o=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&r===1&&o===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,r=12,o=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Jn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Zn.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Zn.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){vx.julianDate=e;let t=vt.leapSeconds,n=Or(t,vx,CG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return c_(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_MINUTE;return c_(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_HOUR;return c_(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return c_(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new zi(new vt(2441317,43210,Jn.TAI),10),new zi(new vt(2441499,43211,Jn.TAI),11),new zi(new vt(2441683,43212,Jn.TAI),12),new zi(new vt(2442048,43213,Jn.TAI),13),new zi(new vt(2442413,43214,Jn.TAI),14),new zi(new vt(2442778,43215,Jn.TAI),15),new zi(new vt(2443144,43216,Jn.TAI),16),new zi(new vt(2443509,43217,Jn.TAI),17),new zi(new vt(2443874,43218,Jn.TAI),18),new zi(new vt(2444239,43219,Jn.TAI),19),new zi(new vt(2444786,43220,Jn.TAI),20),new zi(new vt(2445151,43221,Jn.TAI),21),new zi(new vt(2445516,43222,Jn.TAI),22),new zi(new vt(2446247,43223,Jn.TAI),23),new zi(new vt(2447161,43224,Jn.TAI),24),new zi(new vt(2447892,43225,Jn.TAI),25),new zi(new vt(2448257,43226,Jn.TAI),26),new zi(new vt(2448804,43227,Jn.TAI),27),new zi(new vt(2449169,43228,Jn.TAI),28),new zi(new vt(2449534,43229,Jn.TAI),29),new zi(new vt(2450083,43230,Jn.TAI),30),new zi(new vt(2450630,43231,Jn.TAI),31),new zi(new vt(2451179,43232,Jn.TAI),32),new zi(new vt(2453736,43233,Jn.TAI),33),new zi(new vt(2454832,43234,Jn.TAI),34),new zi(new vt(2456109,43235,Jn.TAI),35),new zi(new vt(2457204,43236,Jn.TAI),36),new zi(new vt(2457754,43237,Jn.TAI),37)];var ee=vt;var pJ=co(wl(),1);function VTe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var wP=VTe;function nJ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=nJ(r,t)),n[i]=r}return n}var Ye=nJ;function iJ(e,t,n){n=y(n,!1);let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=iJ(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var gt=iJ;function kTe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var la=kTe;var rJ=co(wl(),1);function bG(e,t){let n;return typeof document<"u"&&(n=document),bG._implementation(e,t,n)}bG._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new rJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var l_=bG;var oJ=co(wl(),1);function zTe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new oJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var DP=zTe;var sJ=co(wl(),1);function HTe(e){let t=new sJ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var Ix=HTe;var aJ={};function GTe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=aJ[t];l(i)||(i={},aJ[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var $d=GTe;var WTe=/^blob:/i;function jTe(e){return WTe.test(e)}var Px=jTe;var em;function YTe(e){l(em)||(em=document.createElement("a")),em.href=window.location.href;let t=em.host,n=em.protocol;return em.href=e,em.href=em.href,n!==em.protocol||t!==em.host}var Ox=YTe;var qTe=/^data:/i;function XTe(e){return qTe.test(e)}var u_=XTe;function KTe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var Rx=KTe;function JTe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var Mx=JTe;function ZTe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Du=ZTe;var QTe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ni=Object.freeze(QTe);var $Te={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ns=Object.freeze($Te);function IP(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ns.OTHER),this.serverKey=e.serverKey,this.state=ni.UNISSUED,this.deferred=void 0,this.cancelled=!1}IP.prototype.cancel=function(){this.cancelled=!0};IP.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ni.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new IP(this)};var $r=IP;function eEe(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var PP=eEe;function cJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=PP(this.responseHeaders))}cJ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Dh=cJ;var RP=co(wl(),1);function Kb(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Kb.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});Kb.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};Kb.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,r=-1;for(let o=0;o<n.length;o++)if(n[o]===e&&i[o]===t){r=o;break}return r!==-1?(this._insideRaiseEvent?(this._toRemove.push(r),n[r]=void 0,i[r]=void 0):(n.splice(r,1),i.splice(r,1)),!0):!1};function tEe(e,t){return t-e}Kb.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let o=t[e];l(o)&&t[e].apply(n[e],arguments)}let r=this._toRemove;if(i=r.length,i>0){for(r.sort(tEe),e=0;e<i;e++){let o=r[e];t.splice(o,1),n.splice(o,1)}r.length=0}this._insideRaiseEvent=!1};var _e=Kb;function jy(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(jy.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function SG(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}jy.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};jy.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,r=-1,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(SG(i,r,e),e=r):o=!1}};jy.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};jy.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)SG(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};jy.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return SG(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var OP=jy;function nEe(e,t){return e.priority-t.priority}var qi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Bx=20,Pa=new OP({comparator:nEe});Pa.maximumLength=Bx;Pa.reserve(Bx);var tm=[],Ih={},iEe=typeof document<"u"?new RP.default(document.location.href):new RP.default,MP=new _e;function kr(){}kr.maximumRequests=50;kr.maximumRequestsPerServer=6;kr.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18};kr.throttleRequests=!0;kr.debugShowStatistics=!1;kr.requestCompletedEvent=MP;Object.defineProperties(kr,{statistics:{get:function(){return qi}},priorityHeapLength:{get:function(){return Bx},set:function(e){if(e<Bx)for(;Pa.length>e;){let t=Pa.pop();Yy(t)}Bx=e,Pa.maximumLength=e,Pa.reserve(e)}}});function lJ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}kr.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(kr.requestsByServer[e],kr.maximumRequestsPerServer);return Ih[e]+t<=n};kr.heapHasOpenSlots=function(e){return Pa.length+e<=Bx};function uJ(e){return e.state===ni.UNISSUED&&(e.state=ni.ISSUED,e.deferred=la()),e.deferred.promise}function rEe(e){return function(t){if(e.state===ni.CANCELLED)return;let n=e.deferred;--qi.numberOfActiveRequests,--Ih[e.serverKey],MP.raiseEvent(),e.state=ni.RECEIVED,e.deferred=void 0,n.resolve(t)}}function oEe(e){return function(t){e.state!==ni.CANCELLED&&(++qi.numberOfFailedRequests,--qi.numberOfActiveRequests,--Ih[e.serverKey],MP.raiseEvent(t),e.state=ni.FAILED,e.deferred.reject(t))}}function fJ(e){let t=uJ(e);return e.state=ni.ACTIVE,tm.push(e),++qi.numberOfActiveRequests,++qi.numberOfActiveRequestsEver,++Ih[e.serverKey],e.requestFunction().then(rEe(e)).catch(oEe(e)),t}function Yy(e){let t=e.state===ni.ACTIVE;if(e.state=ni.CANCELLED,++qi.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--qi.numberOfActiveRequests,--Ih[e.serverKey],++qi.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}kr.update=function(){let e,t,n=0,i=tm.length;for(e=0;e<i;++e){if(t=tm[e],t.cancelled&&Yy(t),t.state!==ni.ACTIVE){++n;continue}n>0&&(tm[e-n]=t)}tm.length-=n;let r=Pa.internalArray,o=Pa.length;for(e=0;e<o;++e)lJ(r[e]);Pa.resort();let s=Math.max(kr.maximumRequests-tm.length,0),a=0;for(;a<s&&Pa.length>0;){if(t=Pa.pop(),t.cancelled){Yy(t);continue}if(t.throttleByServer&&!kr.serverHasOpenSlots(t.serverKey)){Yy(t);continue}fJ(t),++a}sEe()};kr.getServerKey=function(e){let t=new RP.default(e);t.scheme()===""&&(t=t.absoluteTo(iEe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Ih[n];return l(i)||(Ih[n]=0),n};kr.request=function(e){if(u_(e.url)||Px(e.url))return MP.raiseEvent(),e.state=ni.RECEIVED,e.requestFunction();if(++qi.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=kr.getServerKey(e.url)),kr.throttleRequests&&e.throttleByServer&&!kr.serverHasOpenSlots(e.serverKey))return;if(!kr.throttleRequests||!e.throttle)return fJ(e);if(tm.length>=kr.maximumRequests)return;lJ(e);let t=Pa.insert(e);if(l(t)){if(t===e)return;Yy(t)}return uJ(e)};function sEe(){kr.debugShowStatistics&&(qi.numberOfActiveRequests===0&&qi.lastNumberOfActiveRequests>0&&(qi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${qi.numberOfAttemptedRequests}`),qi.numberOfAttemptedRequests=0),qi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${qi.numberOfCancelledRequests}`),qi.numberOfCancelledRequests=0),qi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${qi.numberOfCancelledActiveRequests}`),qi.numberOfCancelledActiveRequests=0),qi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${qi.numberOfFailedRequests}`),qi.numberOfFailedRequests=0)),qi.lastNumberOfActiveRequests=qi.numberOfActiveRequests)}kr.clearForSpecs=function(){for(;Pa.length>0;){let t=Pa.pop();Yy(t)}let e=tm.length;for(let t=0;t<e;++t)Yy(tm[t]);tm.length=0,Ih={},qi.numberOfAttemptedRequests=0,qi.numberOfActiveRequests=0,qi.numberOfCancelledRequests=0,qi.numberOfCancelledActiveRequests=0,qi.numberOfFailedRequests=0,qi.numberOfActiveRequestsEver=0,qi.lastNumberOfActiveRequests=0};kr.numberOfActiveRequestsByServer=function(e){return Ih[e]};kr.requestHeap=Pa;var cc=kr;var dJ=co(wl(),1);var Jb={},Lx={};Jb.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(Lx[n])||(Lx[n]=!0)};Jb.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(Lx[n])&&delete Lx[n]};function aEe(e){let t=new dJ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}Jb.contains=function(e){let t=aEe(e);return!!(l(t)&&l(Lx[t]))};Jb.clear=function(){Lx={}};var Zb=Jb;var _J=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function St(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=nm(e.templateValues,{}),this._queryParameters=nm(e.queryParameters,{}),this.headers=nm(e.headers,{}),this.request=y(e.request,new $r),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url}function nm(e,t){return l(e)?Ye(e):t}St.createIfNeeded=function(e){return e instanceof St?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new St({url:e})};var Nx;St.supportsImageBitmapOptions=function(){if(l(Nx))return Nx;if(typeof createImageBitmap!="function")return Nx=Promise.resolve(!1),Nx;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return Nx=St.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=$d(t[0]),i=$d(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),Nx};Object.defineProperties(St,{isBlobSupported:{get:function(){return _J}}});Object.defineProperties(St.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Ix(this._url)}},isDataUri:{get:function(){return u_(this._url)}},isBlobUri:{get:function(){return Px(this._url)}},isCrossOriginUrl:{get:function(){return Ox(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}});St.prototype.toString=function(){return this.getUrlComponent(!0,!0)};St.prototype.parseUrl=function(e,t,n,i){let r=new pJ.default(e),o=cEe(r.query());this._queryParameters=t?LP(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(l_(i))),this._url=r.toString()};function cEe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Du(e)}function LP(e,t,n){if(!n)return gt(e,t);let i=Ye(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}St.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${lEe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function lEe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Mx(e)}`}St.prototype.setQueryParameters=function(e,t){t?this._queryParameters=LP(this._queryParameters,e,!1):this._queryParameters=LP(e,this._queryParameters,!1)};St.prototype.appendQueryParameters=function(e){this._queryParameters=LP(e,this._queryParameters,!0)};St.prototype.setTemplateValues=function(e,t){t?this._templateValues=gt(this._templateValues,e):this._templateValues=gt(e,this._templateValues)};St.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=gt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=gt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=gt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};St.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};St.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new St({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1})};St.prototype.getBaseUri=function(e){return DP(this.getUrlComponent(e),e)};St.prototype.appendForwardSlash=function(){this._url=wP(this._url)};St.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};St.fetchArrayBuffer=function(e){return new St(e).fetchArrayBuffer()};St.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};St.fetchBlob=function(e){return new St(e).fetchBlob()};St.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1);if(wG(this.request),!_J||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return vG({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return St.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return St.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new St({url:d}),vG({resource:c,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function vG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=la();return St._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=cc.request(o);if(l(s))return s.catch(function(a){return o.state!==ni.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=ni.UNISSUED,o.deferred=void 0,vG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})}St.fetchImage=function(e){return new St(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};St.prototype.fetchText=function(){return this.fetch({responseType:"text"})};St.fetchText=function(e){return new St(e).fetchText()};St.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};St.fetchJson=function(e){return new St(e).fetchJson()};St.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};St.fetchXML=function(e){return new St(e).fetchXML()};St.prototype.fetchJsonp=function(e){e=y(e,"callback"),wG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return gJ(this,e,t)};function gJ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=la();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},St._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=cc.request(r);if(l(s))return s.catch(function(a){return r.state!==ni.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=ni.UNISSUED,r.deferred=void 0,gJ(e,t,n)):Promise.reject(a)})})}St.fetchJsonp=function(e){return new St(e).fetchJsonp(e.callbackParameterName)};St.prototype._makeRequest=function(e){let t=this;wG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=gt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=la(),d=St._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=cc.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==ni.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=ni.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function wG(e){if(e.state===ni.ISSUED||e.state===ni.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ni.UNISSUED,e.deferred=void 0}var uEe=/^data:(.*?)(;base64)?,(.*)$/;function BP(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function mJ(e,t){let n=BP(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function fEe(e,t){t=y(t,"");let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return BP(i,r);case"arraybuffer":return mJ(i,r);case"blob":return o=mJ(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(BP(i,r),n);case"json":return JSON.parse(BP(i,r));default:}}St.prototype.fetch=function(e){return e=nm(e,{}),e.method="GET",this._makeRequest(e)};St.fetch=function(e){return new St(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.delete=function(e){return e=nm(e,{}),e.method="DELETE",this._makeRequest(e)};St.delete=function(e){return new St(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};St.prototype.head=function(e){return e=nm(e,{}),e.method="HEAD",this._makeRequest(e)};St.head=function(e){return new St(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.options=function(e){return e=nm(e,{}),e.method="OPTIONS",this._makeRequest(e)};St.options=function(e){return new St(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.post=function(e,t){return vl.defined("data",e),t=nm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};St.post=function(e){return new St(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.put=function(e,t){return vl.defined("data",e),t=nm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};St.put=function(e){return new St(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St.prototype.patch=function(e,t){return vl.defined("data",e),t=nm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};St.patch=function(e){return new St(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};St._Implementations={};St._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(Zb.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};St._Implementations.createImage=function(e,t,n,i,r,o){let s=e.url;St.supportsImageBitmapOptions().then(function(a){if(!(a&&o)){St._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=la(),d=St._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new de(`Successfully retrieved ${s} but it contained no content.`));return}return St.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};St.createImageBitmapFromBlob=function(e,t){return vl.defined("options",t),vl.typeOf.bool("options.flipY",t.flipY),vl.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),vl.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function hJ(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function dEe(e,t,n,i,r,o,s){let a,c;Promise.all([import("url"),import("zlib")]).then(([u,f])=>(a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:r};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){o.reject(new Dh(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,A){h?o.reject(new de("Error decompressing response.")):o.resolve(hJ(A,t))}):o.resolve(hJ(g,t))})}).on("error",function(d){o.reject(new Dh)}).end()})}var mEe=typeof XMLHttpRequest>"u";St._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=uEe.exec(e);if(a!==null){o.resolve(fEe(a,t));return}if(mEe){dEe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(Zb.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new Dh(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(A){let x=A.split(": "),C=x.shift();h[C]=x.join(": ")}),o.resolve(h);return}if(c.status===204)o.resolve();else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new Dh)},c.send(i),c};St._Implementations.loadAndExecuteScript=function(e,t,n){return Rx(e,t).catch(function(i){n.reject(i)})};St._DefaultImplementations={};St._DefaultImplementations.createImage=St._Implementations.createImage;St._DefaultImplementations.loadWithXhr=St._Implementations.loadWithXhr;St._DefaultImplementations.loadAndExecuteScript=St._Implementations.loadAndExecuteScript;St.DEFAULT=Object.freeze(new St({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=St;function $b(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?yJ(this,e.data):yJ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}$b.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new $b({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};$b.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Wy(0,0,0,0,0),t}});$b.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Wy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r=0,o=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,xJ(this,n,this._samples,e,r,o,t),t}let s=Or(n,e,ee.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,xJ(this,n,this._samples,e,r,o,t),t};function hEe(e,t){return ee.compare(e.julianDate,t)}function yJ(e,t){if(!l(t.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,h=u.length;g<h;g+=e._columnCount){let A=u[g+n],x=u[g+c],C=A+Zn.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new ee(C,x,Jn.TAI);if(f.push(T),p){if(x!==d&&l(d)){let E=ee.leapSeconds,S=Or(E,T,hEe);if(S<0){let w=new zi(T,x);E.splice(~S,0,w)}}d=x}}}function AJ(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function Qb(e,t,n){return t+e*(n-t)}function xJ(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return AJ(e,n,r,a,s),s;if(i.equals(u))return AJ(e,n,o,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],A=h-g;if(A>.5||A<-.5){let x=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];x!==C&&(u.equals(i)?g=h:h-=C-x)}return s.xPoleWander=Qb(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=Qb(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Qb(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Qb(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Qb(f,g,h),s}var NP=$b;function Oa(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Oa.fromQuaternion=function(e,t){l(t)||(t=new Oa);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};Oa.fromDegrees=function(e,t,n,i){return l(i)||(i=new Oa),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Oa.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Oa(e.heading,e.pitch,e.roll)};Oa.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Oa.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Oa.prototype.clone=function(e){return Oa.clone(this,e)};Oa.prototype.equals=function(e){return Oa.equals(this,e)};Oa.prototype.equalsEpsilon=function(e,t,n){return Oa.equalsEpsilon(this,e,t,n)};Oa.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var lc=Oa;var CJ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function pEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=CJ.exec(i);if(r!==null)return r[1]}}var Fx;function TJ(e){return typeof document>"u"?e:(l(Fx)||(Fx=document.createElement("a")),Fx.href=e,Fx.href=Fx.href,Fx.href)}var qy;function EJ(){if(l(qy))return qy;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(qI.toUrl)?e=l_("..",Xy("Core/buildModuleUrl.js")):e=pEe(),qy=new ve({url:TJ(e)}),qy.appendForwardSlash(),qy}function _Ee(e){return TJ(qI.toUrl(`../${e}`))}function bJ(e){return EJ().getDerivedResource({url:e}).url}var FP;function Xy(e){return l(FP)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(qI.toUrl)?FP=_Ee:FP=bJ),FP(e)}Xy._cesiumScriptRegex=CJ;Xy._buildModuleUrlFromBaseUrl=bJ;Xy._clearBaseResource=function(){qy=void 0};Xy.setBaseUrl=function(e){qy=ve.DEFAULT.getDerivedResource({url:e})};Xy.getCesiumBaseUrl=EJ;var nn=Xy;function gEe(e,t,n){this.x=e,this.y=t,this.s=n}var Ux=gEe;function PG(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var yEe=new ee(0,0,Jn.TAI);function DG(e,t,n){let i=yEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}PG.prototype.preload=function(e,t,n,i){let r=DG(this,e,t),o=DG(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(IG(this,d));return Promise.all(f)};PG.prototype.computeXysRadians=function(e,t,n){let i=DG(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(IG(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(IG(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new Ux(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,A,x;for(A=0;A<=o;++A)d[A]=f-h[A];for(A=0;A<=o;++A){for(g[A]=1,x=0;x<=o;++x)x!==A&&(g[A]*=d[x]);g[A]*=p[A];let C=(s+A)*3;n.x+=g[A]*u[C++],n.y+=g[A]*u[C++],n.s+=g[A]*u[C]}return n};function IG(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ve({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=n.fetchJson().then(function(o){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=o.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=r,r}var UP=PG;var Hi={},OG={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Vx={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},RG={},kc={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},f_=new m,d_=new m,m_=new m;Hi.localFrameToFixedFrameGenerator=function(e,t){if(!OG.hasOwnProperty(e)||!OG[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=OG[e][t],i,r=e+t;return l(RG[r])?i=RG[r]:(i=function(o,s,a){if(l(a)||(a=new B),m.equalsEpsilon(o,m.ZERO,P.EPSILON14))m.unpack(Vx[e],0,f_),m.unpack(Vx[t],0,d_),m.unpack(Vx[n],0,m_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);m.unpack(Vx[e],0,f_),e!=="east"&&e!=="west"&&m.multiplyByScalar(f_,c,f_),m.unpack(Vx[t],0,d_),t!=="east"&&t!=="west"&&m.multiplyByScalar(d_,c,d_),m.unpack(Vx[n],0,m_),n!=="east"&&n!=="west"&&m.multiplyByScalar(m_,c,m_)}else{s=y(s,re.WGS84),s.geodeticSurfaceNormal(o,kc.up);let c=kc.up,u=kc.east;u.x=-o.y,u.y=o.x,u.z=0,m.normalize(u,kc.east),m.cross(c,u,kc.north),m.multiplyByScalar(kc.up,-1,kc.down),m.multiplyByScalar(kc.east,-1,kc.west),m.multiplyByScalar(kc.north,-1,kc.south),f_=kc[e],d_=kc[t],m_=kc[n]}return a[0]=f_.x,a[1]=f_.y,a[2]=f_.z,a[3]=0,a[4]=d_.x,a[5]=d_.y,a[6]=d_.z,a[7]=0,a[8]=m_.x,a[9]=m_.y,a[10]=m_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},RG[r]=i),i};Hi.eastNorthUpToFixedFrame=Hi.localFrameToFixedFrameGenerator("east","north");Hi.northEastDownToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","east");Hi.northUpEastToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","up");Hi.northWestUpToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","west");var AEe=new Ne,xEe=new m(1,1,1),CEe=new B;Hi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=y(i,Hi.eastNorthUpToFixedFrame);let o=Ne.fromHeadingPitchRoll(t,AEe),s=B.fromTranslationQuaternionRotationScale(m.ZERO,o,xEe,CEe);return r=i(e,n,r),B.multiply(r,s,r)};var TEe=new B,EEe=new Z;Hi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Hi.headingPitchRollToFixedFrame(e,t,n,i,TEe),s=B.getMatrix3(o,EEe);return Ne.fromRotationMatrix(s,r)};var bEe=new m(1,1,1),SEe=new m,SJ=new B,vEe=new B,wEe=new Z,DEe=new Ne;Hi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,re.WGS84),n=y(n,Hi.eastNorthUpToFixedFrame),l(i)||(i=new lc);let r=B.getTranslation(e,SEe);if(m.equals(r,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=B.inverseTransformation(n(r,t,SJ),SJ),s=B.setScale(e,bEe,vEe);s=B.setTranslation(s,m.ZERO,s),o=B.multiply(o,s,o);let a=Ne.fromRotationMatrix(B.getMatrix3(o,wEe),DEe);return a=Ne.normalize(a,a),lc.fromQuaternion(a,i)};var IEe=6*3600+41*60+50.54841,PEe=8640184812866e-6,OEe=.093104,REe=-62e-7,MEe=11772758384668e-32,BEe=72921158553e-15,LEe=P.TWO_PI/86400,VP=new ee;Hi.computeTemeToPseudoFixedMatrix=function(e,t){VP=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),VP);let n=VP.dayNumber,i=VP.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Zn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Zn.DAYS_PER_JULIAN_CENTURY;let a=(IEe+r*(PEe+r*(OEe+r*REe)))*LEe%P.TWO_PI,c=BEe+MEe*(n-24515455e-1),u=(i+Zn.SECONDS_PER_DAY*.5)%Zn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};Hi.iau2006XysData=new UP;Hi.earthOrientationParameters=NP.NONE;var LG=32.184,NEe=2451545;Hi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+LG,i=e.stop.dayNumber,r=e.stop.secondsOfDay+LG;return Hi.iau2006XysData.preload(t,n,i,r)};Hi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=Hi.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var FEe=new Ux(0,0,0),UEe=new Wy(0,0,0,0,0,0),MG=new Z,BG=new Z;Hi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=Hi.earthOrientationParameters.compute(e,UEe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+LG,o=Hi.iau2006XysData.computeXysRadians(i,r,FEe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=MG;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-o.s,BG),d=Z.multiply(u,f,MG),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,A=g/Zn.SECONDS_PER_DAY,x=.779057273264+A+.00273781191135448*(h+A);x=x%1*P.TWO_PI;let C=Z.fromRotationZ(x,BG),T=Z.multiply(d,C,MG),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),R=i-NEe+r/Zn.SECONDS_PER_DAY;R/=36525;let O=-47e-6*R*P.RADIANS_PER_DEGREE/3600,L=Math.cos(O),N=Math.sin(O),_=BG;return _[0]=E*L,_[1]=E*N,_[2]=w,_[3]=-S*N+D*w*L,_[4]=S*L+D*w*N,_[5]=-D*E,_[6]=-D*N-S*w*L,_[7]=D*L-S*w*N,_[8]=S*E,Z.multiply(T,_,t)};var VEe=new oe;Hi.pointToWindowCoordinates=function(e,t,n,i){return i=Hi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Hi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let r=VEe;return B.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,r),r),oe.multiplyByScalar(r,1/r.w,r),B.multiplyByVector(t,r,r),H.fromCartesian4(r,i)};var kEe=new m,zEe=new m,HEe=new m;Hi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=y(n,re.WGS84).geodeticSurfaceNormal(e,kEe),o=m.cross(t,r,zEe);m.equalsEpsilon(o,m.ZERO,P.EPSILON6)&&(o=m.clone(m.UNIT_X,o));let s=m.cross(o,t,HEe);return m.normalize(s,s),m.cross(t,s,o),m.negate(o,o),m.normalize(o,o),l(i)||(i=new Z),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var vJ=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),wJ=new he,DJ=new m,GEe=new m,WEe=new Z,NG=new B,IJ=new B;Hi.basisTo2D=function(e,t,n){let i=B.getTranslation(t,GEe),r=e.ellipsoid,o=r.cartesianToCartographic(i,wJ),s=e.project(o,DJ);m.fromElements(s.z,s.x,s.y,s);let a=Hi.eastNorthUpToFixedFrame(i,r,NG),c=B.inverseTransformation(a,IJ),u=B.getMatrix3(t,WEe),f=B.multiplyByMatrix3(c,u,n);return B.multiply(vJ,f,n),B.setTranslation(n,s,n),n};Hi.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Hi.eastNorthUpToFixedFrame(t,i,NG),o=B.inverseTransformation(r,IJ),s=i.cartesianToCartographic(t,wJ),a=e.project(s,DJ);m.fromElements(a.z,a.x,a.y,a);let c=B.fromTranslation(a,NG);return B.multiply(vJ,o,n),B.multiply(c,n,n),n};var Mt=Hi;function FG(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Le.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Nf.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}FG.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var jEe=new he,YEe=new m,PJ=new B,qEe=[new he,new he,new he],XEe=[new H,new H,new H],KEe=[new H,new H,new H],JEe=new m,ZEe=new Ne,QEe=new B,$Ee=new er;FG._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ce.center(i,jEe),s=he.toCartesian(o,n,YEe),a=Mt.eastNorthUpToFixedFrame(s,n,PJ),c=B.inverse(a,PJ),u=XEe,f=qEe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=JEe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=B.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Ne.fromAxisAngle(m.UNIT_Z,-t,ZEe),g=Z.fromQuaternion(p,QEe),h=e.length,A=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(r=0;r<h;r++)d=B.multiplyByPointAsVector(c,e[r],d),d=Z.multiplyByVector(g,d,d),A=Math.min(A,d.x),x=Math.min(x,d.y),C=Math.max(C,d.x),T=Math.max(T,d.y);let E=er.fromRotation(t,$Ee),S=KEe;S[0].x=A,S[0].y=x,S[1].x=A,S[1].y=T,S[2].x=C,S[2].y=x;let w=u[0],D=u[2].x-w.x,R=u[1].y-w.y;for(r=0;r<3;r++){let b=S[r];er.multiplyByVector(E,b,b),b.x=(b.x-w.x)/D,b.y=(b.y-w.y)/R}let O=S[0],L=S[1],N=S[2],_=new Array(6);return H.pack(O,_),H.pack(L,_,2),H.pack(N,_,4),_};var dt=FG;function ebe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var De=ebe;function kx(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(kx.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});kx.clone=function(e){if(l(e))return new kx(e._format,e._datatype,e._width,e._height,e._buffer)};kx.prototype.clone=function(){return kx.clone(this)};var kP=kx;var OJ=co(wl(),1);function RJ(){if(!l(ua._canTransferArrayBuffer)){let e=new Worker(BJ("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ua._canTransferArrayBuffer=!1,ua._canTransferArrayBuffer}let i=la();e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i.resolve(s),e.terminate(),ua._canTransferArrayBuffer=s},ua._canTransferArrayBuffer=i.promise}return ua._canTransferArrayBuffer}var VG=new _e;function MJ(e,t){--e._activeTasks;let n=t.id;if(!l(n))return;let i=e._deferreds,r=i[n];if(l(t.error)){let o=t.error;o.name==="RuntimeError"?(o=new de(t.error.message),o.stack=t.error.stack):o.name==="DeveloperError"&&(o=new fe(t.error.message),o.stack=t.error.stack),VG.raiseEvent(o),r.reject(o)}else VG.raiseEvent(),r.resolve(t.result);delete i[n]}function BJ(e){let t=nn(e);if(Ox(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var UG;function tbe(){return l(UG)||(UG=BJ("Workers/cesiumWorkerBootstrapper.js")),UG}function LJ(e){let t=new Worker(tbe());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:nn("Workers")},baseUrl:nn.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){MJ(e,i.data)},t}function nbe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!jt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=nn(t.modulePath),n.wasmBinaryFile=nn(t.wasmBinaryFile),ve.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function ua(e,t){let n=new OJ.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:ua._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var ibe=[];ua.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=LJ(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(RJ()).then(function(i){l(t)?i||(t.length=0):t=ibe;let r=n._nextID++,o=la();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise})};ua.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=LJ(this));let t=la(),n=this,i=this._worker;return nbe(this,e).then(function(r){return Promise.resolve(RJ()).then(function(o){let s,a=r.wasmBinary;l(a)&&o&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){MJ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:r},s)})}),t.promise};ua.prototype.isDestroyed=function(){return!1};ua.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};ua.taskCompletedEvent=VG;ua._defaultWorkerModulePrefix="Workers/";ua._workerModulePrefix=ua._defaultWorkerModulePrefix;ua._canTransferArrayBuffer=void 0;var pi=ua;function Ph(){}Ph._transcodeTaskProcessor=new pi("transcodeKTX2",Number.POSITIVE_INFINITY);Ph._readyPromise=void 0;function rbe(){let e=Ph._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return Ph._transcodeTaskProcessor});Ph._readyPromise=e}Ph.transcode=function(e,t){return l(Ph._readyPromise)||rbe(),Ph._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]),o=r.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<o;c++){let u=a[r[c]];a[r[c]]=new kP(u.internalFormat,u.datatype,u.width,u.height,u.levelBuffer)}}if(o===1){for(s=0;s<i;++s)n[s]=n[s][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var zP=Ph;var NJ;FJ.setKTX2SupportedFormats=function(e,t,n,i,r,o){NJ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function FJ(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ve.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return zP.transcode(n,NJ)})}var Dl=FJ;function HP(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(HP.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});HP.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context._gl,o=this._textureTarget,s=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._size,d=this._pixelFormat,p=this._internalFormat,g=this._pixelDatatype,h=this._preMultiplyAlpha,A=this._flipY,x=y(e.skipColorSpaceConversion,!1),C=4;l(u)&&(C=ct.alignmentInBytes(d,g,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,C),x?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===f)l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),A&&(u=ct.flipY(u,d,g,f,f)),r.texImage2D(s,0,p,f,f,0,d,Qe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A),r.texImage2D(s,0,p,d,Qe.toWebGLConstant(g,this._context),i)),T=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let E=ct.createTypedArray(d,g,f,f);r.texImage2D(s,0,p,f,f,0,d,Qe.toWebGLConstant(g,this._context),E)}this._initialized=!0}T||(l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),A&&(u=ct.flipY(u,d,g,a,c)),r.texSubImage2D(s,0,t,n,a,c,d,Qe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A),r.texSubImage2D(s,0,t,n,d,Qe.toWebGLConstant(g,this._context),i))),r.bindTexture(o,null)};HP.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._size),o=y(o,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};var Oh=HP;var GP={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===GP.DONT_CARE||e===GP.FASTEST||e===GP.NICEST}},Rh=Object.freeze(GP);var WP={NEAREST:te.NEAREST,LINEAR:te.LINEAR};WP.validate=function(e){return e===WP.NEAREST||e===WP.LINEAR};var bi=Object.freeze(WP);var h_={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};h_.validate=function(e){return e===h_.NEAREST||e===h_.LINEAR||e===h_.NEAREST_MIPMAP_NEAREST||e===h_.LINEAR_MIPMAP_NEAREST||e===h_.NEAREST_MIPMAP_LINEAR||e===h_.LINEAR_MIPMAP_LINEAR};var un=Object.freeze(h_);var jP={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===jP.CLAMP_TO_EDGE||e===jP.REPEAT||e===jP.MIRRORED_REPEAT}},Pn=Object.freeze(jP);function eS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.wrapS,Pn.CLAMP_TO_EDGE),n=y(e.wrapT,Pn.CLAMP_TO_EDGE),i=y(e.minificationFilter,un.LINEAR),r=y(e.magnificationFilter,bi.LINEAR),o=l(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=r,this._maximumAnisotropy=o}Object.defineProperties(eS.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});eS.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};eS.NEAREST=Object.freeze(new eS({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST}));var mn=eS;function tS(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.source,i,r;if(l(n)){let T=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=T[0].width,r=T[0].height}else i=e.width,r=e.height;let o=i,s=y(e.pixelDatatype,Qe.UNSIGNED_BYTE),a=y(e.pixelFormat,ct.RGBA),c=ct.toInternalFormat(a,s,t),u=ct.textureSizeInBytes(a,s,o,o)*6,f=e.preMultiplyAlpha||a===ct.RGB||a===ct.LUMINANCE,d=y(e.flipY,!0),p=y(e.skipColorSpaceConversion,!1),g=t._gl,h=g.TEXTURE_CUBE_MAP,A=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,A);function x(T,E,S,w,D){let R=E.arrayBufferView;l(R)||(R=E.bufferView);let O=4;l(R)&&(O=ct.alignmentInBytes(a,s,i)),g.pixelStorei(g.UNPACK_ALIGNMENT,O),D?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(R)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),w&&(R=ct.flipY(R,a,s,o,o)),g.texImage2D(T,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),R)):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,w),g.texImage2D(T,0,c,a,Qe.toWebGLConstant(s,t),E))}l(n)?(x(g.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,f,d,p),x(g.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,f,d,p),x(g.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,f,d,p),x(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,f,d,p)):(g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,o,o,0,a,Qe.toWebGLConstant(s,t),null)),g.bindTexture(h,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=A,this._pixelFormat=a,this._pixelDatatype=s,this._size=o,this._hasMipmap=!1,this._sizeInBytes=u,this._preMultiplyAlpha=f,this._flipY=d,this._sampler=void 0;let C=l(n);this._positiveX=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,o,f,d,C),this._negativeX=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,o,f,d,C),this._positiveY=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,o,f,d,C),this._negativeY=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,o,f,d,C),this._positiveZ=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,o,f,d,C),this._negativeZ=new Oh(t,A,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,o,f,d,C),this.sampler=l(e.sampler)?e.sampler:new mn}Object.defineProperties(tS.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===un.NEAREST_MIPMAP_NEAREST||t===un.NEAREST_MIPMAP_LINEAR||t===un.LINEAR_MIPMAP_NEAREST||t===un.LINEAR_MIPMAP_LINEAR,r=this._context,o=this._pixelDatatype;(o===Qe.FLOAT&&!r.textureFloatLinear||o===Qe.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=i?un.NEAREST_MIPMAP_NEAREST:un.NEAREST,n=bi.NEAREST);let s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});tS.prototype.generateMipmap=function(e){e=y(e,Rh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};tS.prototype.isDestroyed=function(){return!1};tS.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var uc=tS;function obe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var fc=obe;var YP=`/** - * A built-in GLSL floating-point constant for converting radians to degrees. - * - * @alias czm_degreesPerRadian - * @glslConstant - * - * @see CesiumMath.DEGREES_PER_RADIAN - * - * @example - * // GLSL declaration - * const float czm_degreesPerRadian = ...; - * - * // Example - * float deg = czm_degreesPerRadian * rad; - */ -const float czm_degreesPerRadian = 57.29577951308232; -`;var qP=`/** - * A built-in GLSL vec2 constant for defining the depth range. - * This is a workaround to a bug where IE11 does not implement gl_DepthRange. - * - * @alias czm_depthRange - * @glslConstant - * - * @example - * // GLSL declaration - * float depthRangeNear = czm_depthRange.near; - * float depthRangeFar = czm_depthRange.far; - * - */ -const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var XP=`/** - * 0.1 - * - * @name czm_epsilon1 - * @glslConstant - */ -const float czm_epsilon1 = 0.1; -`;var KP=`/** - * 0.01 - * - * @name czm_epsilon2 - * @glslConstant - */ -const float czm_epsilon2 = 0.01; -`;var JP=`/** - * 0.001 - * - * @name czm_epsilon3 - * @glslConstant - */ -const float czm_epsilon3 = 0.001; -`;var ZP=`/** - * 0.0001 - * - * @name czm_epsilon4 - * @glslConstant - */ -const float czm_epsilon4 = 0.0001; -`;var QP=`/** - * 0.00001 - * - * @name czm_epsilon5 - * @glslConstant - */ -const float czm_epsilon5 = 0.00001; -`;var $P=`/** - * 0.000001 - * - * @name czm_epsilon6 - * @glslConstant - */ -const float czm_epsilon6 = 0.000001; -`;var e1=`/** - * 0.0000001 - * - * @name czm_epsilon7 - * @glslConstant - */ -const float czm_epsilon7 = 0.0000001; -`;var t1=`/** - * DOC_TBA - * - * @name czm_infinity - * @glslConstant - */ -const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp? -`;var n1=`/** - * A built-in GLSL floating-point constant for <code>1/pi</code>. - * - * @alias czm_oneOverPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverPi = ...; - * - * // Example - * float pi = 1.0 / czm_oneOverPi; - */ -const float czm_oneOverPi = 0.3183098861837907; -`;var i1=`/** - * A built-in GLSL floating-point constant for <code>1/2pi</code>. - * - * @alias czm_oneOverTwoPi - * @glslConstant - * - * @see CesiumMath.ONE_OVER_TWO_PI - * - * @example - * // GLSL declaration - * const float czm_oneOverTwoPi = ...; - * - * // Example - * float pi = 2.0 * czm_oneOverTwoPi; - */ -const float czm_oneOverTwoPi = 0.15915494309189535; -`;var r1=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} - * - * @name czm_passCesium3DTile - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTile = 4.0; -`;var o1=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} - * - * @name czm_passCesium3DTileClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassification = 5.0; -`;var s1=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} - * - * @name czm_passCesium3DTileClassificationIgnoreShow - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var a1=`/** - * The automatic GLSL constant for {@link Pass#CLASSIFICATION} - * - * @name czm_passClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passClassification = 7.0; -`;var c1=`/** - * The automatic GLSL constant for {@link Pass#COMPUTE} - * - * @name czm_passCompute - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCompute = 1.0; -`;var l1=`/** - * The automatic GLSL constant for {@link Pass#ENVIRONMENT} - * - * @name czm_passEnvironment - * @glslConstant - * - * @see czm_pass - */ -const float czm_passEnvironment = 0.0; -`;var u1=`/** - * The automatic GLSL constant for {@link Pass#GLOBE} - * - * @name czm_passGlobe - * @glslConstant - * - * @see czm_pass - */ -const float czm_passGlobe = 2.0; -`;var f1=`/** - * The automatic GLSL constant for {@link Pass#OPAQUE} - * - * @name czm_passOpaque - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOpaque = 7.0; -`;var d1=`/** - * The automatic GLSL constant for {@link Pass#OVERLAY} - * - * @name czm_passOverlay - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOverlay = 10.0; -`;var m1=`/** - * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} - * - * @name czm_passTerrainClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTerrainClassification = 3.0; -`;var h1=`/** - * The automatic GLSL constant for {@link Pass#TRANSLUCENT} - * - * @name czm_passTranslucent - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTranslucent = 8.0; -`;var p1=`/** - * The automatic GLSL constant for {@link Pass#VOXELS} - * - * @name czm_passVoxels - * @glslConstant - * - * @see czm_pass - */ -const float czm_passVoxels = 9.0; -`;var _1=`/** - * A built-in GLSL floating-point constant for <code>Math.PI</code>. - * - * @alias czm_pi - * @glslConstant - * - * @see CesiumMath.PI - * - * @example - * // GLSL declaration - * const float czm_pi = ...; - * - * // Example - * float twoPi = 2.0 * czm_pi; - */ -const float czm_pi = 3.141592653589793; -`;var g1=`/** - * A built-in GLSL floating-point constant for <code>pi/4</code>. - * - * @alias czm_piOverFour - * @glslConstant - * - * @see CesiumMath.PI_OVER_FOUR - * - * @example - * // GLSL declaration - * const float czm_piOverFour = ...; - * - * // Example - * float pi = 4.0 * czm_piOverFour; - */ -const float czm_piOverFour = 0.7853981633974483; -`;var y1=`/** - * A built-in GLSL floating-point constant for <code>pi/6</code>. - * - * @alias czm_piOverSix - * @glslConstant - * - * @see CesiumMath.PI_OVER_SIX - * - * @example - * // GLSL declaration - * const float czm_piOverSix = ...; - * - * // Example - * float pi = 6.0 * czm_piOverSix; - */ -const float czm_piOverSix = 0.5235987755982988; -`;var A1=`/** - * A built-in GLSL floating-point constant for <code>pi/3</code>. - * - * @alias czm_piOverThree - * @glslConstant - * - * @see CesiumMath.PI_OVER_THREE - * - * @example - * // GLSL declaration - * const float czm_piOverThree = ...; - * - * // Example - * float pi = 3.0 * czm_piOverThree; - */ -const float czm_piOverThree = 1.0471975511965976; -`;var x1=`/** - * A built-in GLSL floating-point constant for <code>pi/2</code>. - * - * @alias czm_piOverTwo - * @glslConstant - * - * @see CesiumMath.PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_piOverTwo = ...; - * - * // Example - * float pi = 2.0 * czm_piOverTwo; - */ -const float czm_piOverTwo = 1.5707963267948966; -`;var C1=`/** - * A built-in GLSL floating-point constant for converting degrees to radians. - * - * @alias czm_radiansPerDegree - * @glslConstant - * - * @see CesiumMath.RADIANS_PER_DEGREE - * - * @example - * // GLSL declaration - * const float czm_radiansPerDegree = ...; - * - * // Example - * float rad = czm_radiansPerDegree * deg; - */ -const float czm_radiansPerDegree = 0.017453292519943295; -`;var T1=`/** - * The constant identifier for the 2D {@link SceneMode} - * - * @name czm_sceneMode2D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode2D = 2.0; -`;var E1=`/** - * The constant identifier for the 3D {@link SceneMode} - * - * @name czm_sceneMode3D - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneModeMorphing - */ -const float czm_sceneMode3D = 3.0; -`;var b1=`/** - * The constant identifier for the Columbus View {@link SceneMode} - * - * @name czm_sceneModeColumbusView - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneMode3D - * @see czm_sceneModeMorphing - */ -const float czm_sceneModeColumbusView = 1.0; -`;var S1=`/** - * The constant identifier for the Morphing {@link SceneMode} - * - * @name czm_sceneModeMorphing - * @glslConstant - * @see czm_sceneMode - * @see czm_sceneMode2D - * @see czm_sceneModeColumbusView - * @see czm_sceneMode3D - */ -const float czm_sceneModeMorphing = 0.0; -`;var v1=`/** - * A built-in GLSL floating-point constant for one solar radius. - * - * @alias czm_solarRadius - * @glslConstant - * - * @see CesiumMath.SOLAR_RADIUS - * - * @example - * // GLSL declaration - * const float czm_solarRadius = ...; - */ -const float czm_solarRadius = 695500000.0; -`;var w1=`/** - * A built-in GLSL floating-point constant for <code>3pi/2</code>. - * - * @alias czm_threePiOver2 - * @glslConstant - * - * @see CesiumMath.THREE_PI_OVER_TWO - * - * @example - * // GLSL declaration - * const float czm_threePiOver2 = ...; - * - * // Example - * float pi = (2.0 / 3.0) * czm_threePiOver2; - */ -const float czm_threePiOver2 = 4.71238898038469; -`;var D1=`/** - * A built-in GLSL floating-point constant for <code>2pi</code>. - * - * @alias czm_twoPi - * @glslConstant - * - * @see CesiumMath.TWO_PI - * - * @example - * // GLSL declaration - * const float czm_twoPi = ...; - * - * // Example - * float pi = czm_twoPi / 2.0; - */ -const float czm_twoPi = 6.283185307179586; -`;var I1=`/** - * The maximum latitude, in radians, both North and South, supported by a Web Mercator - * (EPSG:3857) projection. Technically, the Mercator projection is defined - * for any latitude up to (but not including) 90 degrees, but it makes sense - * to cut it off sooner because it grows exponentially with increasing latitude. - * The logic behind this particular cutoff value, which is the one used by - * Google Maps, Bing Maps, and Esri, is that it makes the projection - * square. That is, the rectangle is equal in the X and Y directions. - * - * The constant value is computed as follows: - * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) - * - * @name czm_webMercatorMaxLatitude - * @glslConstant - */ -const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var P1=`/** - * @name czm_depthRangeStruct - * @glslStruct - */ -struct czm_depthRangeStruct +`;var VD=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() { - float near; - float far; -}; -`;var O1=`/** - * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} specular Intensity of incoming light reflecting in a single direction. - * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - */ -struct czm_material + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var zD=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() { - vec3 diffuse; - float specular; - float shininess; - vec3 normal; - vec3 emission; - float alpha; -}; -`;var R1=`/** - * Used as input to every material's czm_getMaterial function. - * - * @name czm_materialInput - * @glslStruct - * - * @property {float} s 1D texture coordinates. - * @property {vec2} st 2D texture coordinates. - * @property {vec3} str 3D texture coordinates. - * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. - * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. - * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. - * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. - * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. - * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. - */ -struct czm_materialInput -{ - float s; - vec2 st; - vec3 str; - vec3 normalEC; - mat3 tangentToEyeMatrix; - vec3 positionToEyeEC; - float height; - float slope; - float aspect; -}; -`;var M1=`/** - * Struct for representing a material for a {@link Model}. The model - * rendering pipeline will pass this struct between material, custom shaders, - * and lighting stages. This is not to be confused with {@link czm_material} - * which is used by the older Fabric materials system, although they are similar. - * <p> - * All color values (diffuse, specular, emissive) are in linear color space. - * </p> - * - * @name czm_modelMaterial - * @glslStruct - * - * @property {vec3} diffuse Incoming light that scatters evenly in all directions. - * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. - * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. - * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. - * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. - * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. - * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. - */ -struct czm_modelMaterial { - vec3 diffuse; - float alpha; - vec3 specular; - float roughness; - vec3 normalEC; - float occlusion; - vec3 emissive; -}; -`;var B1=`/** - * Struct for representing the output of a custom vertex shader. - * - * @name czm_modelVertexOutput - * @glslStruct - * - * @see {@link CustomShader} - * @see {@link Model} - * - * @property {vec3} positionMC The position of the vertex in model coordinates - * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. - */ -struct czm_modelVertexOutput { - vec3 positionMC; - float pointSize; -}; -`;var L1=`/** - * Parameters for {@link czm_pbrLighting} - * - * @name czm_material - * @glslStruct - * - * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation - * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. - * @property {vec3} f0 The reflectance of the material at normal incidence - */ -struct czm_pbrParameters -{ - vec3 diffuseColor; - float roughness; - vec3 f0; -}; -`;var N1=`/** - * DOC_TBA - * - * @name czm_ray - * @glslStruct - */ -struct czm_ray -{ - vec3 origin; - vec3 direction; -}; -`;var F1=`/** - * DOC_TBA - * - * @name czm_raySegment - * @glslStruct - */ -struct czm_raySegment -{ - float start; - float stop; -}; + vec4 p = czm_computePosition(); -/** - * DOC_TBA - * - * @name czm_emptyRaySegment - * @glslConstant - */ -const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates -/** - * DOC_TBA - * - * @name czm_fullRaySegment - * @glslConstant - */ -const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var U1=`struct czm_shadowParameters + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var HD=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() { -#ifdef USE_CUBE_MAP_SHADOW - vec3 texCoords; -#else - vec2 texCoords; -#endif + vec3 positionToEyeEC = -v_positionEC; - float depthBias; - float depth; - float nDotL; - vec2 texelStepSize; - float normalShadingSmooth; - float darkness; -}; -`;var V1=`// See: -// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif -vec3 czm_acesTonemapping(vec3 color) { - float g = 0.985; - float a = 0.065; - float b = 0.0001; - float c = 0.433; - float d = 0.238; + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); - color = (color * (color + a) - b) / (color * (g * color + c) + d); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var GD=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; - color = clamp(color, 0.0, 1.0); +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; - return color; -} -`;var k1=`/** - * @private - */ -float czm_alphaWeight(float a) +void main() { - float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 p = czm_computePosition(); - // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: - // http://jcgt.org/published/0002/02/09/ - return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var z1=`/** - * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. - * - * @name czm_antialias - * @glslFunction - * - * @param {vec4} color1 The color on one side of the edge. - * @param {vec4} color2 The color on the other side of the edge. - * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>. - * @param {float} dist The distance to the edge in texture coordinates. - * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. - * @returns {vec4} The anti-aliased color. - * - * @example - * // GLSL declarations - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); - * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); - * - * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space - * float dist = abs(textureCoordinates.t - 0.5); - * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); - * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); - */ -vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var YEe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},Ra=Object.freeze(YEe);var XEe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},vo=Object.freeze(XEe);var KEe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE,functionDestinationAlpha:vo.ONE})},mn=Object.freeze(KEe);var JEe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},gi=Object.freeze(JEe);function Gb(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(Gb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});Gb.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};Gb.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Gb.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=mn.ALPHA_BLEND):t.depthMask=!0,t};Gb.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=mn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:gi.BACK}),l(n)&&(i=_t(n,i,!0)),i};var io=Gb;function ZEe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var jn=ZEe;function Wb(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(Wb.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});Wb.clone=function(e){if(l(e))return new Wb(e._format,e._datatype,e._width,e._height,e._buffer)};Wb.prototype.clone=function(){return Wb.clone(this)};var WD=Wb;var lJ=ur(Dl(),1);function uJ(){if(!l(fa._canTransferArrayBuffer)){let e=new Worker(dJ("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return fa._canTransferArrayBuffer=!1,fa._canTransferArrayBuffer}let i=ua();e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i.resolve(s),e.terminate(),fa._canTransferArrayBuffer=s},fa._canTransferArrayBuffer=i.promise}return fa._canTransferArrayBuffer}var c8=new _e;function fJ(e,t){--e._activeTasks;let n=t.id;if(!l(n))return;let i=e._deferreds,o=i[n];if(l(t.error)){let r=t.error;r.name==="RuntimeError"?(r=new de(t.error.message),r.stack=t.error.stack):r.name==="DeveloperError"&&(r=new fe(t.error.message),r.stack=t.error.stack),c8.raiseEvent(r),o.reject(r)}else c8.raiseEvent(),o.resolve(t.result);delete i[n]}function dJ(e){let t=nn(e);if(Rb(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var a8;function $Ee(){return l(a8)||(a8=dJ("Workers/cesiumWorkerBootstrapper.js")),a8}function mJ(e){let t=new Worker($Ee());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:nn("Workers")},baseUrl:nn.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){fJ(e,i.data)},t}function QEe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Wt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=nn(t.modulePath),n.wasmBinaryFile=nn(t.wasmBinaryFile),ve.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function fa(e,t){let n=new lJ.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:fa._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var eSe=[];fa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=mJ(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(uJ()).then(function(i){l(t)?i||(t.length=0):t=eSe;let o=n._nextID++,r=ua();return n._deferreds[o]=r,n._worker.postMessage({id:o,parameters:e,canTransferArrayBuffer:i},t),r.promise})};fa.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=mJ(this));let t=ua(),n=this,i=this._worker;return QEe(this,e).then(function(o){return Promise.resolve(uJ()).then(function(r){let s,a=o.wasmBinary;l(a)&&r&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){fJ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:o},s)})}),t.promise};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};fa.taskCompletedEvent=c8;fa._defaultWorkerModulePrefix="Workers/";fa._workerModulePrefix=fa._defaultWorkerModulePrefix;fa._canTransferArrayBuffer=void 0;var yi=fa;function Dh(){}Dh._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);Dh._readyPromise=void 0;function tSe(){let e=Dh._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return Dh._transcodeTaskProcessor});Dh._readyPromise=e}Dh.transcode=function(e,t){return l(Dh._readyPromise)||tSe(),Dh._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<r;c++){let u=a[o[c]];a[o[c]]=new WD(u.internalFormat,u.datatype,u.width,u.height,u.levelBuffer)}}if(r===1){for(s=0;s<i;++s)n[s]=n[s][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var jD=Dh;var hJ;pJ.setKTX2SupportedFormats=function(e,t,n,i,o,r){hJ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function pJ(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ve.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return jD.transcode(n,hJ)})}var Rl=pJ;var Ei={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Ei.toWebGLConstant=function(e,t){switch(e){case Ei.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Ei.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Ei.UNSIGNED_INT:return te.UNSIGNED_INT;case Ei.FLOAT:return te.FLOAT;case Ei.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Ei.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Ei.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Ei.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Ei.UNSIGNED_SHORT_5_6_5:return Ei.UNSIGNED_SHORT_5_6_5}};Ei.isPacked=function(e){return e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};Ei.sizeInBytes=function(e){switch(e){case Ei.UNSIGNED_BYTE:return 1;case Ei.UNSIGNED_SHORT:case Ei.UNSIGNED_SHORT_4_4_4_4:case Ei.UNSIGNED_SHORT_5_5_5_1:case Ei.UNSIGNED_SHORT_5_6_5:case Ei.HALF_FLOAT:return 2;case Ei.UNSIGNED_INT:case Ei.FLOAT:case Ei.UNSIGNED_INT_24_8:return 4}};Ei.validate=function(e){return e===Ei.UNSIGNED_BYTE||e===Ei.UNSIGNED_SHORT||e===Ei.UNSIGNED_INT||e===Ei.FLOAT||e===Ei.HALF_FLOAT||e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};var Je=Object.freeze(Ei);var st={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let o=st.componentsLength(e);return Je.isPacked(t)&&(o=1),o*Je.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let o,r=Je.sizeInBytes(t);r===Uint8Array.BYTES_PER_ELEMENT?o=Uint8Array:r===Uint16Array.BYTES_PER_ELEMENT?o=Uint16Array:r===Float32Array.BYTES_PER_ELEMENT&&t===Je.FLOAT?o=Float32Array:o=Uint32Array;let s=st.componentsLength(e)*n*i;return new o(s)};st.flipY=function(e,t,n,i,o){if(o===1)return e;let r=st.createTypedArray(t,n,i,o),s=st.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let d=0;d<a;++d)r[f+d]=e[u+d]}return r};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===Je.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Je.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Je.FLOAT)switch(e){case st.RGBA:return te.RGBA32F;case st.RGB:return te.RGB32F;case st.RG:return te.RG32F;case st.RED:return te.R32F}if(t===Je.HALF_FLOAT)switch(e){case st.RGBA:return te.RGBA16F;case st.RGB:return te.RGB16F;case st.RG:return te.RG16F;case st.RED:return te.R16F}return e};var lt=Object.freeze(st);var fr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(fr,{maximumCombinedTextureImageUnits:{get:function(){return fr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return fr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return fr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return fr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return fr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return fr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return fr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return fr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return fr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return fr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return fr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return fr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return fr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return fr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return fr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return fr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return fr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return fr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return fr._maximumColorAttachments}},maximumSamples:{get:function(){return fr._maximumSamples}},highpFloatSupported:{get:function(){return fr._highpFloatSupported}},highpIntSupported:{get:function(){return fr._highpIntSupported}}});var Gt=fr;function qD(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(qD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});qD.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,o=this._context._gl,r=this._textureTarget,s=this._targetFace;o.activeTexture(o.TEXTURE0),o.bindTexture(r,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._size,d=this._pixelFormat,p=this._internalFormat,g=this._pixelDatatype,h=this._preMultiplyAlpha,x=this._flipY,b=y(e.skipColorSpaceConversion,!1),C=4;l(u)&&(C=lt.alignmentInBytes(d,g,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,C),b?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===f)l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=lt.flipY(u,d,g,f,f)),o.texImage2D(s,0,p,f,f,0,d,Je.toWebGLConstant(g,this._context),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texImage2D(s,0,p,d,Je.toWebGLConstant(g,this._context),i)),T=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let A=lt.createTypedArray(d,g,f,f);o.texImage2D(s,0,p,f,f,0,d,Je.toWebGLConstant(g,this._context),A)}this._initialized=!0}T||(l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=lt.flipY(u,d,g,a,c)),o.texSubImage2D(s,0,t,n,a,c,d,Je.toWebGLConstant(g,this._context),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texSubImage2D(s,0,t,n,d,Je.toWebGLConstant(g,this._context),i))),o.bindTexture(r,null)};qD.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};var Ph=qD;var YD={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===YD.DONT_CARE||e===YD.FASTEST||e===YD.NICEST}},Oh=Object.freeze(YD);var XD={NEAREST:te.NEAREST,LINEAR:te.LINEAR};XD.validate=function(e){return e===XD.NEAREST||e===XD.LINEAR};var Si=Object.freeze(XD);var g_={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};g_.validate=function(e){return e===g_.NEAREST||e===g_.LINEAR||e===g_.NEAREST_MIPMAP_NEAREST||e===g_.LINEAR_MIPMAP_NEAREST||e===g_.NEAREST_MIPMAP_LINEAR||e===g_.LINEAR_MIPMAP_LINEAR};var un=Object.freeze(g_);var KD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===KD.CLAMP_TO_EDGE||e===KD.REPEAT||e===KD.MIRRORED_REPEAT}},On=Object.freeze(KD);function oS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.wrapS,On.CLAMP_TO_EDGE),n=y(e.wrapT,On.CLAMP_TO_EDGE),i=y(e.minificationFilter,un.LINEAR),o=y(e.magnificationFilter,Si.LINEAR),r=l(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(oS.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});oS.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};oS.NEAREST=Object.freeze(new oS({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST}));var hn=oS;function rS(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.source,i,o;if(l(n)){let T=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=T[0].width,o=T[0].height}else i=e.width,o=e.height;let r=i,s=y(e.pixelDatatype,Je.UNSIGNED_BYTE),a=y(e.pixelFormat,lt.RGBA),c=lt.toInternalFormat(a,s,t),u=lt.textureSizeInBytes(a,s,r,r)*6,f=e.preMultiplyAlpha||a===lt.RGB||a===lt.LUMINANCE,d=y(e.flipY,!0),p=y(e.skipColorSpaceConversion,!1),g=t._gl,h=g.TEXTURE_CUBE_MAP,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,x);function b(T,A,S,v,I){let O=A.arrayBufferView;l(O)||(O=A.bufferView);let R=4;l(O)&&(R=lt.alignmentInBytes(a,s,i)),g.pixelStorei(g.UNPACK_ALIGNMENT,R),I?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(O)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),v&&(O=lt.flipY(O,a,s,r,r)),g.texImage2D(T,0,c,r,r,0,a,Je.toWebGLConstant(s,t),O)):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,v),g.texImage2D(T,0,c,a,Je.toWebGLConstant(s,t),A))}l(n)?(b(g.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,f,d,p),b(g.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,f,d,p),b(g.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,f,d,p),b(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,f,d,p)):(g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null)),g.bindTexture(h,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=x,this._pixelFormat=a,this._pixelDatatype=s,this._size=r,this._hasMipmap=!1,this._sizeInBytes=u,this._preMultiplyAlpha=f,this._flipY=d,this._sampler=void 0;let C=l(n);this._positiveX=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,r,f,d,C),this._negativeX=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,r,f,d,C),this._positiveY=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,r,f,d,C),this._negativeY=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,r,f,d,C),this._positiveZ=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,r,f,d,C),this._negativeZ=new Ph(t,x,h,g.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,r,f,d,C),this.sampler=l(e.sampler)?e.sampler:new hn}Object.defineProperties(rS.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===un.NEAREST_MIPMAP_NEAREST||t===un.NEAREST_MIPMAP_LINEAR||t===un.LINEAR_MIPMAP_NEAREST||t===un.LINEAR_MIPMAP_LINEAR,o=this._context,r=this._pixelDatatype;(r===Je.FLOAT&&!o.textureFloatLinear||r===Je.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(t=i?un.NEAREST_MIPMAP_NEAREST:un.NEAREST,n=Si.NEAREST);let s=o._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});rS.prototype.generateMipmap=function(e){e=y(e,Oh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};rS.prototype.isDestroyed=function(){return!1};rS.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var uc=rS;function Bf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,o=e.source;l(o)&&(l(n)||(n=y(o.videoWidth,o.width)),l(i)||(i=y(o.videoHeight,o.height)));let r=y(e.pixelFormat,lt.RGBA),s=y(e.pixelDatatype,Je.UNSIGNED_BYTE),a=lt.toInternalFormat(r,s,t),c=lt.isCompressedFormat(a),u=e.preMultiplyAlpha||r===lt.RGB||r===lt.LUMINANCE,f=y(e.flipY,!0),d=y(e.skipColorSpaceConversion,!1),p=!0,g=t._gl,h=g.TEXTURE_2D,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,x);let b=4;if(l(o)&&l(o.arrayBufferView)&&!c&&(b=lt.alignmentInBytes(r,s,n)),g.pixelStorei(g.UNPACK_ALIGNMENT,b),d?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(o))if(l(o.arrayBufferView)){g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1);let T=o.arrayBufferView,A,S,v;if(c){if(g.compressedTexImage2D(h,0,a,n,i,0,T),l(o.mipLevels))for(S=n,v=i,A=0;A<o.mipLevels.length;++A)S=Math.floor(S/2)|0,S<1&&(S=1),v=Math.floor(v/2)|0,v<1&&(v=1),g.compressedTexImage2D(h,A+1,a,S,v,0,o.mipLevels[A])}else if(f&&(T=lt.flipY(T,r,s,n,i)),g.texImage2D(h,0,a,n,i,0,r,Je.toWebGLConstant(s,t),T),l(o.mipLevels))for(S=n,v=i,A=0;A<o.mipLevels.length;++A)S=Math.floor(S/2)|0,S<1&&(S=1),v=Math.floor(v/2)|0,v<1&&(v=1),g.texImage2D(h,A+1,a,S,v,0,r,Je.toWebGLConstant(s,t),o.mipLevels[A])}else l(o.framebuffer)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._bind(),g.copyTexImage2D(h,0,a,o.xOffset,o.yOffset,n,i,0),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._unBind()):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,f),g.texImage2D(h,0,a,r,Je.toWebGLConstant(s,t),o));else g.texImage2D(h,0,a,n,i,0,r,Je.toWebGLConstant(s,t),null),p=!1;g.bindTexture(h,null);let C;c?C=lt.compressedTextureSizeInBytes(r,n,i):C=lt.textureSizeInBytes(r,s,n,i),this._id=jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=x,this._internalFormat=a,this._pixelFormat=r,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new H(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=u,this._flipY=f,this._initialized=p,this._sampler=void 0,this.sampler=l(e.sampler)?e.sampler:new hn}Bf.create=function(e){return new Bf(e)};Bf.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=y(e.pixelFormat,lt.RGB),o=y(e.framebufferXOffset,0),r=y(e.framebufferYOffset,0),s=y(e.width,n.drawingBufferWidth),a=y(e.height,n.drawingBufferHeight),c=e.framebuffer;return new Bf({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Bf.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,o=this._pixelFormat,r=this._pixelDatatype,s=t===un.NEAREST_MIPMAP_NEAREST||t===un.NEAREST_MIPMAP_LINEAR||t===un.LINEAR_MIPMAP_NEAREST||t===un.LINEAR_MIPMAP_LINEAR;(r===Je.FLOAT&&!i.textureFloatLinear||r===Je.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?un.NEAREST_MIPMAP_NEAREST:un.NEAREST,n=Si.NEAREST),i.webgl2&<.isDepthFormat(o)&&(t=un.NEAREST,n=Si.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});Bf.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,o=this._context,r=o._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._width,d=this._height,p=this._internalFormat,g=this._pixelFormat,h=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,C=y(e.skipColorSpaceConversion,!1),T=4;l(u)&&(T=lt.alignmentInBytes(g,h,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,T),C?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===d)l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),b&&(u=lt.flipY(u,g,h,f,d)),r.texImage2D(s,0,p,f,d,0,g,Je.toWebGLConstant(h,o),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b),r.texImage2D(s,0,p,g,Je.toWebGLConstant(h,o),i)),A=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let S=lt.createTypedArray(g,h,f,d);r.texImage2D(s,0,p,f,d,0,g,Je.toWebGLConstant(h,o),S)}this._initialized=!0}A||(l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),b&&(u=lt.flipY(u,g,h,a,c)),r.texSubImage2D(s,0,t,n,a,c,g,Je.toWebGLConstant(h,o),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b),r.texSubImage2D(s,0,t,n,g,Je.toWebGLConstant(h,o),i))),r.bindTexture(s,null)};Bf.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Bf.prototype.generateMipmap=function(e){e=y(e,Oh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Bf.prototype.isDestroyed=function(){return!1};Bf.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Lt=Bf;var JD=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); - float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); - val1 = val1 * (1.0 - val2); - val1 = val1 * val1 * (3.0 - (2.0 * val1)); - val1 = pow(val1, 0.5); //makes the transition nicer - - vec4 midColor = (color1 + color2) * 0.5; - return mix(midColor, currentColor, val1); + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } +`;var ZD=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; -vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) +czm_material czm_getMaterial(czm_materialInput materialInput) { - return czm_antialias(color1, color2, currentColor, dist, 0.1); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + vec2 centerPixel = fract(repeat * st); + float centerBump = texture(image, centerPixel).channel; + + float imageWidth = float(imageDimensions.x); + vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); + float rightBump = texture(image, rightPixel).channel; + + float imageHeight = float(imageDimensions.y); + vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); + float topBump = texture(image, leftPixel).channel; + + vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + material.diffuse = vec3(0.01); + + return material; } -`;var H1=`/** - * Approximately computes spherical coordinates given a normal. - * Uses approximate inverse trigonometry for speed and consistency, - * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. - * - * @name czm_approximateSphericalCoordinates - * @glslFunction - * - * @param {vec3} normal arbitrary-length normal. - * - * @returns {vec2} Approximate latitude and longitude spherical coordinates. - */ -vec2 czm_approximateSphericalCoordinates(vec3 normal) { - // Project into plane with vertical for latitude - float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); - float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); - return vec2(latitudeApproximation, longitudeApproximation); -} -`;var G1=`/** - * Determines if the fragment is back facing - * - * @name czm_backFacing - * @glslFunction - * - * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>. - */ -bool czm_backFacing() +`;var $D=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. - return gl_FrontFacing == false; -} -`;var W1=`/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a float expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {float} a Value to return if the comparison is true. - * @param {float} b Value to return if the comparison is false. - * - * @returns {float} equivalent of comparison ? a : b - */ -float czm_branchFreeTernary(bool comparison, float a, float b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + czm_material material = czm_getDefaultMaterial(materialInput); -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec2 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec2} a Value to return if the comparison is true. - * @param {vec2} b Value to return if the comparison is false. - * - * @returns {vec2} equivalent of comparison ? a : b - */ -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + vec2 st = materialInput.st; -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec3 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); -} + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 -/** - * Branchless ternary operator to be used when it's inexpensive to explicitly - * evaluate both possibilities for a vec4 expression. - * - * @name czm_branchFreeTernary - * @glslFunction - * - * @param {bool} comparison A comparison statement - * @param {vec3} a Value to return if the comparison is true. - * @param {vec3} b Value to return if the comparison is false. - * - * @returns {vec3} equivalent of comparison ? a : b - */ -vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { - float useA = float(comparison); - return a * useA + b * (1.0 - useA); + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var j1=` -vec4 czm_cascadeColor(vec4 weights) +`;var QD=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + - vec4(0.0, 1.0, 0.0, 1.0) * weights.y + - vec4(0.0, 0.0, 1.0, 1.0) * weights.z + - vec4(1.0, 0.0, 1.0, 1.0) * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var Y1=` -uniform vec4 shadowMap_cascadeDistances; +`;var eP=`uniform sampler2D heights; +uniform sampler2D colors; -float czm_cascadeDistance(vec4 weights) +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) { - return dot(shadowMap_cascadeDistances, weights); + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif } -`;var q1=` -uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +czm_material czm_getMaterial(czm_materialInput materialInput) { - return shadowMap_cascadeMatrices[0] * weights.x + - shadowMap_cascadeMatrices[1] * weights.y + - shadowMap_cascadeMatrices[2] * weights.z + - shadowMap_cascadeMatrices[3] * weights.w; + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; + } + + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var X1=` -uniform vec4 shadowMap_cascadeSplits[2]; +`;var tP=`uniform vec4 color; +uniform float spacing; +uniform float width; -vec4 czm_cascadeWeights(float depthEye) +czm_material czm_getMaterial(czm_materialInput materialInput) { - // One component is set to 1.0 and all others set to 0.0. - vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); - vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); - return near * far; + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } -`;var K1=`/** - * DOC_TBA - * - * @name czm_columbusViewMorph - * @glslFunction - */ -vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var nP=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - // Just linear for now. - vec3 p = mix(position2D.xyz, position3D.xyz, time); - return vec4(p, 1.0); -} -`;var J1=`/** - * Returns a position in model coordinates relative to eye taking into - * account the current scene mode: 3D, 2D, or Columbus view. - * <p> - * This uses standard position attributes, <code>position3DHigh</code>, - * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, - * and should be used when writing a vertex shader for an {@link Appearance}. - * </p> - * - * @name czm_computePosition - * @glslFunction - * - * @returns {vec4} The position relative to eye. - * - * @example - * vec4 p = czm_computePosition(); - * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * - * @see czm_translateRelativeToEye - */ -vec4 czm_computePosition(); -`;var Z1=`/** - * @private - */ -vec2 cordic(float angle) -{ -// Scale the vector by the appropriate factor for the 24 iterations to follow. - vec2 vector = vec2(6.0725293500888267e-1, 0.0); -// Iteration 1 - float sense = (angle < 0.0) ? -1.0 : 1.0; - // float factor = sense * 1.0; // 2^-0 - mat2 rotation = mat2(1.0, sense, -sense, 1.0); - vector = rotation * vector; - angle -= sense * 7.8539816339744828e-1; // atan(2^-0) -// Iteration 2 - sense = (angle < 0.0) ? -1.0 : 1.0; - float factor = sense * 5.0e-1; // 2^-1 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.6364760900080609e-1; // atan(2^-1) -// Iteration 3 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.5e-1; // 2^-2 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4497866312686414e-1; // atan(2^-2) -// Iteration 4 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.25e-1; // 2^-3 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2435499454676144e-1; // atan(2^-3) -// Iteration 5 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.25e-2; // 2^-4 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.2418809995957350e-2; // atan(2^-4) -// Iteration 6 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.125e-2; // 2^-5 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.1239833430268277e-2; // atan(2^-5) -// Iteration 7 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.5625e-2; // 2^-6 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5623728620476831e-2; // atan(2^-6) -// Iteration 8 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.8125e-3; // 2^-7 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.8123410601011111e-3; // atan(2^-7) -// Iteration 9 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.90625e-3; // 2^-8 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.9062301319669718e-3; // atan(2^-8) -// Iteration 10 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.953125e-3; // 2^-9 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9531225164788188e-3; // atan(2^-9) -// Iteration 11 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.765625e-4; // 2^-10 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.7656218955931946e-4; // atan(2^-10) -// Iteration 12 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.8828125e-4; // 2^-11 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.8828121119489829e-4; // atan(2^-11) -// Iteration 13 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.44140625e-4; // 2^-12 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.4414062014936177e-4; // atan(2^-12) -// Iteration 14 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.220703125e-4; // 2^-13 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.2207031189367021e-4; // atan(2^-13) -// Iteration 15 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 6.103515625e-5; // 2^-14 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 6.1035156174208773e-5; // atan(2^-14) -// Iteration 16 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.0517578125e-5; // 2^-15 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.0517578115526096e-5; // atan(2^-15) -// Iteration 17 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.52587890625e-5; // 2^-16 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.5258789061315762e-5; // atan(2^-16) -// Iteration 18 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 7.62939453125e-6; // 2^-17 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 7.6293945311019700e-6; // atan(2^-17) -// Iteration 19 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 3.814697265625e-6; // 2^-18 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 3.8146972656064961e-6; // atan(2^-18) -// Iteration 20 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.9073486328125e-6; // 2^-19 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 1.9073486328101870e-6; // atan(2^-19) -// Iteration 21 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 9.5367431640625e-7; // 2^-20 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 9.5367431640596084e-7; // atan(2^-20) -// Iteration 22 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 4.76837158203125e-7; // 2^-21 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 4.7683715820308884e-7; // atan(2^-21) -// Iteration 23 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 2.384185791015625e-7; // 2^-22 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; - angle -= sense * 2.3841857910155797e-7; // atan(2^-22) -// Iteration 24 - sense = (angle < 0.0) ? -1.0 : 1.0; - factor = sense * 1.1920928955078125e-7; // 2^-23 - rotation[0][1] = factor; - rotation[1][0] = -factor; - vector = rotation * vector; -// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) - - return vector; + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } +`;var iP=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; -/** - * Computes the cosine and sine of the provided angle using the CORDIC algorithm. - * - * @name czm_cosineAndSine - * @glslFunction - * - * @param {float} angle The angle in radians. - * - * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). - * - * @example - * vec2 v = czm_cosineAndSine(czm_piOverSix); - * float cosine = v.x; - * float sine = v.y; - */ -vec2 czm_cosineAndSine(float angle) +float getTime(float t, float coord) { - if (angle < -czm_piOverTwo || angle > czm_piOverTwo) - { - if (angle < 0.0) - { - return -cordic(angle + czm_pi); - } - else - { - return -cordic(angle - czm_pi); - } - } - else + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) { - return cordic(angle); + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); } + return clamp(q, 0.0, 1.0); } -`;var Q1=`/** - * Decompresses texture coordinates that were packed into a single float. - * - * @name czm_decompressTextureCoordinates - * @glslFunction - * - * @param {float} encoded The compressed texture coordinates. - * @returns {vec2} The decompressed texture coordinates. - */ - vec2 czm_decompressTextureCoordinates(float encoded) - { - float temp = encoded / 4096.0; - float xZeroTo4095 = floor(temp); - float stx = xZeroTo4095 / 4095.0; - float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; - return vec2(stx, sty); - } -`;var $1=`/** - * Get default parameters for physically based rendering. These defaults - * describe a rough dielectric (non-metal) surface (e.g. rough plastic). - * - * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} - */ -czm_pbrParameters czm_defaultPbrMaterial() + +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_pbrParameters results; - results.diffuseColor = vec3(1.0); - results.roughness = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - results.f0 = REFLECTANCE_DIELECTRIC; - return results; + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; } -`;var eO=`// emulated noperspective -#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif +`;var oP=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; -/** - * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. - * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, - * capping the shadow volume. More information here: - * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. - * - * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring - * no geometry gets clipped by setting the clip space z value to 0.0 and then - * sending the unaltered screen space z value (using emulated noperspective - * interpolation) to the frag shader where it is clamped to [0,1] and then - * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: - * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. - * - * When GL_EXT_frag_depth is not available, which is the case on some mobile - * devices, we must attempt to fix this only in the vertex shader. - * The approach is to clamp the z value to the far plane, which closes the - * shadow volume but also distorts the geometry, so there can still be artifacts - * on frustum seams. - * - * @name czm_depthClamp - * @glslFunction - * - * @param {vec4} coords The vertex in clip coordinates. - * @returns {vec4} The modified vertex. - * - * @example - * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); - * - * @see czm_writeDepthClamp - */ -vec4 czm_depthClamp(vec4 coords) +czm_material czm_getMaterial(czm_materialInput materialInput) { -#ifndef LOG_DEPTH -#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) - v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; - coords.z = 0.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); #else - coords.z = min(coords.z, coords.w); -#endif + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); #endif - return coords; -} -`;var tO=`/** - * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system - * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the - * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. - * <br /><br /> - * The ellipsoid is assumed to be centered at the model coordinate's origin. - * - * @name czm_eastNorthUpToEyeCoordinates - * @glslFunction - * - * @param {vec3} positionMC The position on the ellipsoid in model coordinates. - * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates. - * - * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. - * - * @example - * // Transform a vector defined in the east-north-up coordinate - * // system, (0, 0, 1) which is the surface normal, to eye - * // coordinates. - * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); - */ -mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) -{ - vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates - vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes - vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates - return mat3( - tangentEC.x, tangentEC.y, tangentEC.z, - bitangentEC.x, bitangentEC.y, bitangentEC.z, - normalEC.x, normalEC.y, normalEC.z); + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; } -`;var nO=`/** - * DOC_TBA - * - * @name czm_ellipsoidContainsPoint - * @glslFunction - * - */ -bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var rP=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; - return (dot(scaled, scaled) <= 1.0); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; } -`;var iO=`/** - * DOC_TBA - * - * @name czm_ellipsoidWgs84TextureCoordinates - * @glslFunction - */ -vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +`;var sP=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) { - return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var rO=`/** - * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code> - * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs - * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s, - * <code>vec3</code>s, or <code>vec4</code>s. - * - * @name czm_equalsEpsilon - * @glslFunction - * - * @param {} left The first vector. - * @param {} right The second vector. - * @param {float} epsilon The epsilon to use for equality testing. - * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise. - * - * @example - * // GLSL declarations - * bool czm_equalsEpsilon(float left, float right, float epsilon); - * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); - * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); - * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); - */ -bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec4(epsilon))); + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; } -bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec3(epsilon))); -} +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); -bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { - return all(lessThanEqual(abs(left - right), vec2(epsilon))); -} + vec2 st = materialInput.st; -bool czm_equalsEpsilon(float left, float right, float epsilon) { - return (abs(left - right) <= epsilon); -} -`;var oO=`/** - * DOC_TBA - * - * @name czm_eyeOffset - * @glslFunction - * - * @param {vec4} positionEC DOC_TBA. - * @param {vec3} eyeOffset DOC_TBA. - * - * @returns {vec4} DOC_TBA. - */ -vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) -{ - // This equation is approximate in x and y. - vec4 p = positionEC; - vec4 zEyeOffset = normalize(p) * eyeOffset.z; - p.xy += eyeOffset.xy + zEyeOffset.xy; - p.z += zEyeOffset.z; - return p; -} -`;var sO=`/** - * Transforms a position from eye to window coordinates. The transformation - * from eye to clip coordinates is done using {@link czm_projection}. - * The transform from normalized device coordinates to window coordinates is - * done using {@link czm_viewportTransformation}, which assumes a depth range - * of <code>near = 0</code> and <code>far = 1</code>. - * <br /><br /> - * This transform is useful when there is a need to manipulate window coordinates - * in a vertex shader as done by {@link BillboardCollection}. - * - * @name czm_eyeToWindowCoordinates - * @glslFunction - * - * @param {vec4} position The position in eye coordinates to transform. - * - * @returns {vec4} The transformed position in window coordinates. - * - * @see czm_modelToWindowCoordinates - * @see czm_projection - * @see czm_viewportTransformation - * @see BillboardCollection - * - * @example - * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - */ -vec4 czm_eyeToWindowCoordinates(vec4 positionEC) -{ - vec4 q = czm_projection * positionEC; // clip coordinates - q.xyz /= q.w; // normalized device coordinates - q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates - return q; +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; } -`;var aO=`/** - * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. - * - * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on - * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. - * Adapted from ShaderFastLibs under MIT License. - * - * Chosen for the following characteristics over range [0, 1]: - * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) - * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) - * - * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); - * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between 0 and 1 inclusive. - * - * @returns {float} Approximation of atan(x) - */ -float czm_fastApproximateAtan(float x) { - return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +`;var aP=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); } -/** - * Approximation of atan2. - * - * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html - * However, we replaced their atan curve with Michael Drobot's (see above). - * - * @name czm_fastApproximateAtan - * @glslFunction - * - * @param {float} x Value between -1 and 1 inclusive. - * @param {float} y Value between -1 and 1 inclusive. - * - * @returns {float} Approximation of atan2(x, y) - */ -float czm_fastApproximateAtan(float x, float y) { - // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. - // So range-reduce using abs and by flipping whether x or y is on top. - float t = abs(x); // t used as swap and atan result. - float opposite = abs(y); - float adjacent = max(t, opposite); - opposite = min(t, opposite); +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); - t = czm_fastApproximateAtan(opposite / adjacent); + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - // Undo range reduction - t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); - t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); - t = czm_branchFreeTernary(y < 0.0, -t, t); - return t; + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; } -`;var cO=`/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var cP=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-(scalar * scalar)); - return mix(color, fogColor, fog); + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; } +`;var lP=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; -/** - * Gets the color with fog at a distance from the camera. - * - * @name czm_fog - * @glslFunction - * - * @param {float} distanceToCamera The distance to the camera in meters. - * @param {vec3} color The original color. - * @param {vec3} fogColor The color of the fog. - * @param {float} fogModifierConstant A constant to modify the appearance of fog. - * - * @returns {vec3} The color adjusted for fog at the distance from the camera. - */ -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float scalar = distanceToCamera * czm_fogDensity; - float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); - return mix(color, fogColor, fog); -} -`;var lO=`/** - * Converts a color from RGB space to linear space. - * - * @name czm_gammaCorrect - * @glslFunction - * - * @param {vec3} color The color in RGB space. - * @returns {vec3} The color in linear space. - */ -vec3 czm_gammaCorrect(vec3 color) { -#ifdef HDR - color = pow(color, vec3(czm_gamma)); -#endif - return color; -} + czm_material material = czm_getDefaultMaterial(materialInput); -vec4 czm_gammaCorrect(vec4 color) { -#ifdef HDR - color.rgb = pow(color.rgb, vec3(czm_gamma)); -#endif - return color; + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; } -`;var uO=`/** - * DOC_TBA - * - * @name czm_geodeticSurfaceNormal - * @glslFunction - * - * @param {vec3} positionOnEllipsoid DOC_TBA - * @param {vec3} ellipsoidCenter DOC_TBA - * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA - * - * @returns {vec3} DOC_TBA. - */ -vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) -{ - return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); -} -`;var fO=`/** - * An czm_material with default values. Every material's czm_getMaterial - * should use this default material as a base for the material it returns. - * The default normal value is given by materialInput.normalEC. - * - * @name czm_getDefaultMaterial - * @glslFunction - * - * @param {czm_materialInput} input The input used to construct the default material. - * - * @returns {czm_material} The default material. - * - * @see czm_materialInput - * @see czm_material - * @see czm_getMaterial - */ -czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +`;var uP=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - czm_material material; - material.diffuse = vec3(0.0); - material.specular = 0.0; - material.shininess = 1.0; - material.normal = materialInput.normalEC; - material.emission = vec3(0.0); - material.alpha = 1.0; + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + return material; } -`;var dO=`/** - * Calculates the intensity of diffusely reflected light. - * - * @name czm_getLambertDiffuse - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * - * @returns {float} The intensity of the diffuse reflection. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var fP=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - return max(dot(lightDirectionEC, normalEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; } -`;var mO=`/** - * Calculates the specular intensity of reflected light. - * - * @name czm_getSpecular - * @glslFunction - * - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. - * - * @returns {float} The intensity of the specular highlight. - * - * @see czm_phong - * - * @example - * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); - * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); - * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); - */ -float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var dP=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); - float specular = max(dot(toReflectedLight, toEyeEC), 0.0); + czm_material material = czm_getDefaultMaterial(materialInput); - // pow has undefined behavior if both parameters <= 0. - // Prevent this by making sure shininess is at least czm_epsilon2. - return pow(specular, max(shininess, czm_epsilon2)); + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; } -`;var hO=`/** - * @private - */ -vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var mP=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) { - float cosAngle = cos(angleInRadians); - float sinAngle = sin(angleInRadians); + czm_material material = czm_getDefaultMaterial(materialInput); - // time dependent sampling directions - vec2 s0 = vec2(1.0/17.0, 0.0); - vec2 s1 = vec2(-1.0/29.0, 0.0); - vec2 s2 = vec2(1.0/101.0, 1.0/59.0); - vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); + float time = czm_frameNumber * animationSpeed; - // rotate sampling direction by specified angle - s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); - s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); - s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); - s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - vec2 uv0 = (uv/103.0) + (time * s0); - vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); - vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); - vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); + float specularMapValue = texture(specularMap, materialInput.st).r; - uv0 = fract(uv0); - uv1 = fract(uv1); - uv2 = fract(uv2); - uv3 = fract(uv3); - vec4 noise = (texture(normalMap, uv0)) + - (texture(normalMap, uv1)) + - (texture(normalMap, uv2)) + - (texture(normalMap, uv3)); + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - // average and scale to between -1 and 1 - return ((noise / 4.0) - 0.5) * 2.0; -} -`;var pO=`/** - * Converts an HSB color (hue, saturation, brightness) to RGB - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} - * - * @name czm_HSBToRGB - * @glslFunction - * - * @param {vec3} hsb The color in HSB. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); - */ + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; -const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); -vec3 czm_HSBToRGB(vec3 hsb) -{ - vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); - return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); -} -`;var _O=`/** - * Converts an HSL color (hue, saturation, lightness) to RGB - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} - * - * @name czm_HSLToRGB - * @glslFunction - * - * @param {vec3} rgb The color in HSL. - * - * @returns {vec3} The color in RGB. - * - * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); - */ + normalTangentSpace = normalize(normalTangentSpace); -vec3 hueToRGB(float hue) + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function Xe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,un.LINEAR),this._magnificationFilter=y(e.magnificationFilter,Si.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,nSe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Xe._uniformList[this.type])||(Xe._uniformList[this.type]=Object.keys(this._uniforms))}Xe._uniformList={};Xe.fromType=function(e,t){let n=new Xe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Xe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};Xe.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let d=new hn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Lt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Lt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let h=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let x=this.uniforms[h];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new uc({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new hn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};Xe.prototype.isDestroyed=function(){return!1};Xe.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function nSe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ye(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ye(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ye(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Xe._materialCache.getMaterial(t.type);if(l(i)){let r=Ye(i.fabric,!0);t._template=_t(t._template,r,!0),n=i.translucent}sSe(t),l(i)||Xe._materialCache.addMaterial(t.type,t),cSe(t),dSe(t),hSe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function l8(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function _J(e,t){}function iSe(e,t){}var oSe=["type","materials","uniforms","components","source"],rSe=["diffuse","specular","shininess","normal","emission","alpha"];function sSe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;l8(t,oSe,_J,!0),l8(o,rSe,_J,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);l8(n,r,iSe,!1)}function aSe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function cSe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { - float r = abs(hue * 6.0 - 3.0) - 1.0; - float g = 2.0 - abs(hue * 6.0 - 2.0); - float b = 2.0 - abs(hue * 6.0 - 4.0); - return clamp(vec3(r, g, b), 0.0, 1.0); +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&aSe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${o} = ${t[o]}; +`}e.shaderSource+=`return material; } +`}}var gJ={mat2:no,mat3:Z,mat4:L},lSe=/\.ktx2$/i;function uSe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Xe.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new hn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Lt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Lt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof ve;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:ve.createIfNeeded(r),g;lSe.test(p.url)?g=Rl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function fSe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof uc){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Xe.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function dSe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&yJ(e,n)}function yJ(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=mSe(o),s;if(r==="channels")s=sS(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;pSe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},yJ(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=sS(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(uSe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(fSe(t));else if(r.indexOf("mat")!==-1){let u=new gJ[r];e._uniforms[c]=function(){return gJ[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function mSe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Xe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function hSe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Xe({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=_t(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;sS(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=sS(e,i,a)}}function sS(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function pSe(e,t,n){return sS(e,t,t,n)}Xe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Xe.DefaultImageId="czm_defaultImage";Xe.DefaultCubeMapId="czm_defaultCubeMap";Xe.ColorType="Color";Xe._materialCache.addMaterial(Xe.ColorType,{fabric:{type:Xe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.ImageType="Image";Xe._materialCache.addMaterial(Xe.ImageType,{fabric:{type:Xe.ImageType,uniforms:{image:Xe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.DiffuseMapType="DiffuseMap";Xe._materialCache.addMaterial(Xe.DiffuseMapType,{fabric:{type:Xe.DiffuseMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.AlphaMapType="AlphaMap";Xe._materialCache.addMaterial(Xe.AlphaMapType,{fabric:{type:Xe.AlphaMapType,uniforms:{image:Xe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Xe.SpecularMapType="SpecularMap";Xe._materialCache.addMaterial(Xe.SpecularMapType,{fabric:{type:Xe.SpecularMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Xe.EmissionMapType="EmissionMap";Xe._materialCache.addMaterial(Xe.EmissionMapType,{fabric:{type:Xe.EmissionMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.BumpMapType="BumpMap";Xe._materialCache.addMaterial(Xe.BumpMapType,{fabric:{type:Xe.BumpMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:ZD},translucent:!1});Xe.NormalMapType="NormalMap";Xe._materialCache.addMaterial(Xe.NormalMapType,{fabric:{type:Xe.NormalMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:rP},translucent:!1});Xe.GridType="Grid";Xe._materialCache.addMaterial(Xe.GridType,{fabric:{type:Xe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:oP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Xe.StripeType="Stripe";Xe._materialCache.addMaterial(Xe.StripeType,{fabric:{type:Xe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:dP},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Xe.CheckerboardType="Checkerboard";Xe._materialCache.addMaterial(Xe.CheckerboardType,{fabric:{type:Xe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:$D},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.DotType="Dot";Xe._materialCache.addMaterial(Xe.DotType,{fabric:{type:Xe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:QD},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.WaterType="Water";Xe._materialCache.addMaterial(Xe.WaterType,{fabric:{type:Xe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Xe.DefaultImageId,normalMap:Xe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:mP},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Xe.RimLightingType="RimLighting";Xe._materialCache.addMaterial(Xe.RimLightingType,{fabric:{type:Xe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:uP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Xe.FadeType="Fade";Xe._materialCache.addMaterial(Xe.FadeType,{fabric:{type:Xe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:iP},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Xe.PolylineArrowType="PolylineArrow";Xe._materialCache.addMaterial(Xe.PolylineArrowType,{fabric:{type:Xe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:sP},translucent:!0});Xe.PolylineDashType="PolylineDash";Xe._materialCache.addMaterial(Xe.PolylineDashType,{fabric:{type:Xe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:aP},translucent:!0});Xe.PolylineGlowType="PolylineGlow";Xe._materialCache.addMaterial(Xe.PolylineGlowType,{fabric:{type:Xe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:cP},translucent:!0});Xe.PolylineOutlineType="PolylineOutline";Xe._materialCache.addMaterial(Xe.PolylineOutlineType,{fabric:{type:Xe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:lP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Xe.ElevationContourType="ElevationContour";Xe._materialCache.addMaterial(Xe.ElevationContourType,{fabric:{type:Xe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:tP},translucent:!1});Xe.ElevationRampType="ElevationRamp";Xe._materialCache.addMaterial(Xe.ElevationRampType,{fabric:{type:Xe.ElevationRampType,uniforms:{image:Xe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:nP},translucent:!1});Xe.SlopeRampMaterialType="SlopeRamp";Xe._materialCache.addMaterial(Xe.SlopeRampMaterialType,{fabric:{type:Xe.SlopeRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:fP},translucent:!1});Xe.AspectRampMaterialType="AspectRamp";Xe._materialCache.addMaterial(Xe.AspectRampMaterialType,{fabric:{type:Xe.AspectRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:JD},translucent:!1});Xe.ElevationBandType="ElevationBand";Xe._materialCache.addMaterial(Xe.ElevationBandType,{fabric:{type:Xe.ElevationBandType,uniforms:{heights:Xe.DefaultImageId,colors:Xe.DefaultImageId},source:eP},translucent:!0});var qi=Xe;function Zy(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Zy.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Zy.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Zy.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Zy.prototype.isTranslucent=io.prototype.isTranslucent;Zy.prototype.getRenderState=io.prototype.getRenderState;Zy.MaterialSupport={BASIC:Object.freeze({vertexFormat:Me.POSITION_AND_NORMAL,vertexShaderSource:zD,fragmentShaderSource:VD}),TEXTURED:Object.freeze({vertexFormat:Me.POSITION_NORMAL_AND_ST,vertexShaderSource:GD,fragmentShaderSource:HD}),ALL:Object.freeze({vertexFormat:Me.ALL,vertexShaderSource:UD,fragmentShaderSource:kD})};var co=Zy;var hP=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; -vec3 czm_HSLToRGB(vec3 hsl) +void main() { - vec3 rgb = hueToRGB(hsl.x); - float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; - return (rgb - 0.5) * c + hsl.z; -} -`;var gO=`/** - * Adjusts the hue of a color. - * - * @name czm_hue - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the hue of the color in radians. - * - * @returns {float} The color with the hue adjusted. - * - * @example - * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) - */ -vec3 czm_hue(vec3 rgb, float adjustment) + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var pP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() { - const mat3 toYIQ = mat3(0.299, 0.587, 0.114, - 0.595716, -0.274453, -0.321263, - 0.211456, -0.522591, 0.311135); - const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, - 1.0, -0.2721, -0.6474, - 1.0, -1.107, 1.7046); - - vec3 yiq = toYIQ * rgb; - float hue = atan(yiq.z, yiq.y) + adjustment; - float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); - - vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); - return toRGB * color; + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var yO=`/** - * Converts a color in linear space to RGB space. +`;var jb=`in vec4 v_color; + +void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +} +`;var _P=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Rh(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?_P:pP,r=i?jb:hP,s=i?Rh.FLAT_VERTEX_FORMAT:Rh.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Rh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Rh.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;Rh.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;Rh.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Rh.prototype.isTranslucent=io.prototype.isTranslucent;Rh.prototype.getRenderState=io.prototype.getRenderState;var cn=Rh;function qb(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(qb.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});qb.prototype.getType=function(e){return"Color"};qb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};qb.prototype.equals=function(e){return this===e||e instanceof qb&&q.equals(this._color,e._color)};var Vt=qb;function y_(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Di(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(y_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});y_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};y_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};y_.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};y_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};y_.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,d=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new ce(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};y_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var Yi=y_;var xJ=new m,bJ=new m,CJ=new me,u8=new m,_Se=new m,TJ=new ae,gSe=new Yi,aS=[new me,new me,new me,new me],cS=new H,Pr={};Pr.initialize=function(){let e=Pr._initPromise;return l(e)||(e=ve.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Pr._terrainHeights=t}),Pr._initPromise=e),e};Pr.getMinimumMaximumHeights=function(e,t){t=y(t,oe.WGS84);let n=AJ(e),i=Pr._defaultMinTerrainHeight,o=Pr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Pr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,CJ),xJ),t.cartographicToCartesian(ce.southwest(e,CJ),bJ),m.midpoint(bJ,xJ,u8);let a=t.scaleToGeodeticSurface(u8,_Se);if(l(a)){let c=m.distance(u8,a);i=Math.min(i,-c)}else i=Pr._defaultMinTerrainHeight}return i=Math.max(Pr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Pr.getBoundingSphere=function(e,t){t=y(t,oe.WGS84);let n=AJ(e),i=Pr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Pr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,TJ),ae.union(o,TJ,o)};function AJ(e){me.fromRadians(e.east,e.north,0,aS[0]),me.fromRadians(e.west,e.north,0,aS[1]),me.fromRadians(e.east,e.south,0,aS[2]),me.fromRadians(e.west,e.south,0,aS[3]);let t=0,n=0,i=0,o=0,r=Pr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=aS[c];if(gSe.positionToTileXY(u,s,cS),c===0)i=cS.x,o=cS.y;else if(i!==cS.x||o!==cS.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Pr._terrainHeightsMaxLevel=6;Pr._defaultMaxTerrainHeight=9e3;Pr._defaultMinTerrainHeight=-1e5;Pr._terrainHeights=void 0;Pr._initPromise=void 0;Object.defineProperties(Pr,{initialized:{get:function(){return l(Pr._terrainHeights)}}});var si=Pr;var EJ={};function lS(e,t){l(EJ[e])||(EJ[e]=!0,console.warn(y(t,e)))}lS.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";lS.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";lS.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";lS.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Nt=lS;function ySe(e,t){Nt(e,t)}var Q=ySe;function fc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}fc.fromCorners=function(e,t,n){return l(n)||(n=new fc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};fc.fromPoints=function(e,t){if(l(t)||(t=new fc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,h=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(h,i),s=Math.max(h,s),o=Math.min(x,o),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=m.midpoint(u,f,t.center),t};fc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new fc(e.minimum,e.maximum,e.center)};fc.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var gP=new m;fc.intersectPlane=function(e,t){gP=m.subtract(e.maximum,e.minimum,gP);let n=m.multiplyByScalar(gP,.5,gP),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=m.dot(e.center,i)+t.distance;return r-o>0?tn.INSIDE:r+o<0?tn.OUTSIDE:tn.INTERSECTING};fc.prototype.clone=function(e){return fc.clone(this,e)};fc.prototype.intersectPlane=function(e){return fc.intersectPlane(this,e)};fc.prototype.equals=function(e){return fc.equals(this,e)};var $y=fc;var f8={};f8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function SJ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}f8.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=SJ(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*SJ(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Wc=f8;var m8={};m8.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function d8(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,g=o*a-r*s,h=r*a-d,x=4*p*h-g*g,b,C;if(x<0){let Y,j,$;f*u>=c*d?(Y=o,j=p,$=-2*r*p+o*g):(Y=a,j=h,$=-a*g+2*s*h);let K=-($<0?-1:1)*Math.abs(Y)*Math.sqrt(-x);C=-$+K;let J=C/2,he=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),ge=C===K?-he:-j/he;return b=j<=0?he+ge:-$/(he*he+ge*ge+j),f*u>=c*d?[(b-r)/o]:[-a/(b+s)]}let T=p,A=-2*r*p+o*g,S=h,v=-a*g+2*s*h,I=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*I,-A)/3);b=2*Math.sqrt(-T);let N=Math.cos(R);C=b*N;let F=b*(-N/2-O*Math.sin(R)),_=C+F>2*r?C-r:F-r,E=o,w=_/E;R=Math.abs(Math.atan2(a*I,-v)/3),b=2*Math.sqrt(-S),N=Math.cos(R),C=b*N,F=b*(-N/2-O*Math.sin(R));let D=-a,M=C+F<2*s?C+s:F+s,B=D/M,V=E*M,U=-_*M-E*D,G=_*D,k=(s*U-r*G)/(-r*U+s*V);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}m8.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Wc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Wc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return d8(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):d8(e,t,0,i);if(i===0)return o=Wc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return d8(e,t,n,i)};var Yb=m8;var h8={};h8.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,h=g*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*h+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function kf(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=Yb.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=Wc.computeRealRoots(1,r,a);if(d.length===2){let p=d[0],g=d[1],h;if(p>=0&&g>=0){let x=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,g=(r+f+s/d)/2,h=Wc.computeRealRoots(1,d,p),x=Wc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,h[1]<=x[0]?[h[0],h[1],x[0],x[1]]:x[1]<=h[0]?[x[0],x[1],h[0],h[1]]:h[0]>=x[0]&&h[1]<=x[1]?[x[0],h[0],h[1],x[1]]:x[0]>=h[0]&&x[1]<=h[1]?[h[0],x[0],x[1],h[1]]:h[0]>x[0]&&h[0]<x[1]?[x[0],h[0],x[1],h[1]]:[h[0],x[0],h[1],x[1]]):h):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function uS(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=Yb.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,h=e/2,x=p/2,b=g-4*i,C=g+4*Math.abs(i),T=s-4*d,A=s+4*Math.abs(d),S,v;if(d<0||b*A<T*C){let E=Math.sqrt(T);S=E/2,v=E===0?0:(e*x-n)/E}else{let E=Math.sqrt(b);S=E===0?0:(e*x-n)/E,v=E/2}let I,O;h===0&&S===0?(I=0,O=0):P.sign(h)===P.sign(S)?(I=h+S,O=d/I):(O=h-S,I=d/O);let R,N;x===0&&v===0?(R=0,N=0):P.sign(x)===P.sign(v)?(R=x+v,N=i/R):(N=x-v,R=i/N);let F=Wc.computeRealRoots(1,I,R),_=Wc.computeRealRoots(1,O,N);if(F.length!==0)return _.length!==0?F[1]<=_[0]?[F[0],F[1],_[0],_[1]]:_[1]<=F[0]?[_[0],_[1],F[0],F[1]]:F[0]>=_[0]&&F[1]<=_[1]?[_[0],F[0],F[1],_[1]]:_[0]>=F[0]&&_[1]<=F[1]?[F[0],_[0],_[1],F[1]]:F[0]>_[0]&&F[0]<_[1]?[_[0],F[0],_[1],F[1]]:[F[0],_[0],F[1],_[1]]:F;if(_.length!==0)return _}return[]}h8.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return Yb.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return kf(r,s,a,c);case 1:return uS(r,s,a,c);case 2:return uS(r,s,a,c);case 3:return kf(r,s,a,c);case 4:return kf(r,s,a,c);case 5:return uS(r,s,a,c);case 6:return kf(r,s,a,c);case 7:return kf(r,s,a,c);case 8:return uS(r,s,a,c);case 9:return kf(r,s,a,c);case 10:return kf(r,s,a,c);case 11:return uS(r,s,a,c);case 12:return kf(r,s,a,c);case 13:return kf(r,s,a,c);case 14:return kf(r,s,a,c);case 15:return kf(r,s,a,c);default:return}};var yP=h8;function xP(e,t){t=m.clone(y(t,m.ZERO)),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(y(e,m.ZERO)),this.direction=t}xP.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new xP(e.origin,e.direction)};xP.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var In=xP;var er={};er.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,o=e.direction,r=t.normal,s=m.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-m.dot(r,i))/s;if(!(a<0))return n=m.multiplyByScalar(o,a,n),m.add(i,n,n)};var xSe=new m,bSe=new m,MJ=new m,vJ=new m,wJ=new m;er.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=m.subtract(n,t,xSe),c=m.subtract(i,t,bSe),u=m.cross(s,c,MJ),f=m.dot(a,u),d,p,g,h,x;if(o){if(f<P.EPSILON6||(d=m.subtract(r,t,vJ),g=m.dot(d,u),g<0||g>f)||(p=m.cross(d,a,wJ),h=m.dot(s,p),h<0||g+h>f))return;x=m.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let b=1/f;if(d=m.subtract(r,t,vJ),g=m.dot(d,u)*b,g<0||g>1||(p=m.cross(d,a,wJ),h=m.dot(s,p)*b,h<0||g+h>1))return;x=m.dot(c,p)*b}return x};er.rayTriangle=function(e,t,n,i,o,r){let s=er.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var CSe=new In;er.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=CSe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=er.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function TSe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var ASe={root0:0,root1:0};function LJ(e,t,n){l(n)||(n=new Hc);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=m.subtract(i,r,MJ),c=m.dot(o,o),u=2*m.dot(o,a),f=m.magnitudeSquared(a)-s,d=TSe(c,u,f,ASe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}er.raySphere=function(e,t,n){if(n=LJ(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var ESe=new In;er.lineSegmentSphere=function(e,t,n,i){let o=ESe;m.clone(e,o.origin);let r=m.subtract(t,e,o.direction),s=m.magnitude(r);if(m.normalize(r,r),i=LJ(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var SSe=new m,vSe=new m;er.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,SSe),o=m.multiplyComponents(n,e.direction,vSe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,x=a/d;return h<x?new Hc(h,x):{start:x,stop:h}}let g=Math.sqrt(a/c);return new Hc(g,g)}else if(r<1)return a=r-1,c=m.magnitudeSquared(o),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Hc(0,d/c);if(s<0)return c=m.magnitudeSquared(o),new Hc(0,-s/c)};function Qy(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function wSe(e,t,n,i,o){let r=i*i,s=o*o,a=(e[Z.COLUMN1ROW1]-e[Z.COLUMN2ROW2])*s,c=o*(i*Qy(e[Z.COLUMN1ROW0],e[Z.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[Z.COLUMN0ROW0]*r+e[Z.COLUMN2ROW2]*s+i*t.x+n,f=s*Qy(e[Z.COLUMN2ROW1],e[Z.COLUMN1ROW2],P.EPSILON15),d=o*(i*Qy(e[Z.COLUMN2ROW0],e[Z.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Wc.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],N=Math.sqrt(Math.max(1-R*R,0));if(g.push(new m(i,o*R,o*-N)),g.push(new m(i,o*R,o*N)),p.length===2){let F=p[1],_=Math.sqrt(Math.max(1-F*F,0));g.push(new m(i,o*F,o*-_)),g.push(new m(i,o*F,o*_))}return g}let h=d*d,x=f*f,b=a*a,C=d*f,T=b+x,A=2*(c*a+C),S=2*u*a+c*c-x+h,v=2*(u*c-C),I=u*u-h;if(T===0&&A===0&&S===0&&v===0)return g;p=yP.computeRealRoots(T,A,S,v,I);let O=p.length;if(O===0)return g;for(let R=0;R<O;++R){let N=p[R],F=N*N,_=Math.max(1-F,0),E=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=Qy(a*F+u,c*N,P.EPSILON12):P.sign(u)===P.sign(c*N)?w=Qy(a*F,c*N+u,P.EPSILON12):w=Qy(a*F+c*N,u,P.EPSILON12);let D=Qy(f*N,d,P.EPSILON15),M=w*D;M<0?g.push(new m(i,o*N,o*E)):M>0?g.push(new m(i,o*N,o*-E)):E!==0?(g.push(new m(i,o*N,o*-E)),g.push(new m(i,o*N,o*E)),++R):g.push(new m(i,o*N,o*E))}return g}var p8=new m,IJ=new m,DJ=new m,bP=new m,ISe=new m,DSe=new Z,PSe=new Z,OSe=new Z,RSe=new Z,MSe=new Z,PJ=new Z,OJ=new Z,RJ=new m,LSe=new m,NSe=new me;er.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,p8);if(m.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,p8),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,bP),c=m.normalize(m.cross(a,s,IJ),IJ),u=m.normalize(m.cross(s,c,DJ),DJ),f=DSe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,PSe),p=Z.fromScale(t.radii,OSe),g=Z.fromScale(t.oneOverRadii,RSe),h=MSe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let x=Z.multiply(Z.multiply(d,g,PJ),h,PJ),b=Z.multiply(Z.multiply(x,p,OJ),f,OJ),C=Z.multiplyByVector(x,n,ISe),T=wSe(b,m.negate(C,p8),0,0,1),A,S,v=T.length;if(v>0){let I=m.clone(m.ZERO,LSe),O=Number.NEGATIVE_INFINITY;for(let N=0;N<v;++N){A=Z.multiplyByVector(p,Z.multiplyByVector(f,T[N],RJ),RJ);let F=m.normalize(m.subtract(A,n,bP),bP),_=m.dot(F,i);_>O&&(O=_,I=m.clone(A,I))}let R=t.cartesianToCartographic(I,NSe);return O=P.clamp(O,0,1),S=m.magnitude(m.subtract(I,n,bP))*Math.sqrt(1-O*O),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new m)}};var FSe=new m;er.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,FSe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=m.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};er.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return er.lineSegmentPlane(e,t,i,f),er.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return er.lineSegmentPlane(t,n,i,f),er.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return er.lineSegmentPlane(n,e,i,f),er.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return er.lineSegmentPlane(e,n,i,f),er.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return er.lineSegmentPlane(n,t,i,f),er.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return er.lineSegmentPlane(t,e,i,f),er.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var $i=er;function ps(e,t){this.normal=m.clone(e),this.distance=t}ps.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new ps(t,i)};var BSe=new m;ps.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,BSe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new ps(n,i)};ps.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var kSe=new m;ps.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=ps.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,kSe);return m.subtract(t,o,n)};var USe=new L,VSe=new re,zSe=new m;ps.transform=function(e,t,n){let i=e.normal,o=e.distance,r=L.inverseTranspose(t,USe),s=re.fromElements(i.x,i.y,i.z,o,VSe);s=L.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,zSe);return s=re.divideByScalar(s,m.magnitude(a),s),ps.fromCartesian4(s,n)};ps.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new ps(e.normal,e.distance)};ps.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};ps.ORIGIN_XY_PLANE=Object.freeze(new ps(m.UNIT_Z,0));ps.ORIGIN_YZ_PLANE=Object.freeze(new ps(m.UNIT_X,0));ps.ORIGIN_ZX_PLANE=Object.freeze(new ps(m.UNIT_Y,0));var dn=ps;var _8=new re;function nm(e,t){t=y(t,oe.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(L.getColumn(n,0,_8)),this._yAxis=m.fromCartesian4(L.getColumn(n,1,_8));let i=m.fromCartesian4(L.getColumn(n,2,_8));this._plane=dn.fromPointNormal(e,i)}Object.defineProperties(nm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var HSe=new $y;nm.fromPoints=function(e,t){let n=$y.fromPoints(e,HSe);return new nm(n.center,t)};var NJ=new In,CP=new m;nm.prototype.projectPointOntoPlane=function(e,t){let n=NJ;n.origin=e,m.normalize(e,n.direction);let i=$i.rayPlane(n,this._plane,CP);if(l(i)||(m.negate(n.direction,n.direction),i=$i.rayPlane(n,this._plane,CP)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new H(r,s)}};nm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};nm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new H);let n=NJ;n.origin=e,m.clone(this._plane.normal,n.direction);let i=$i.rayPlane(n,this._plane,CP);l(i)||(m.negate(n.direction,n.direction),i=$i.rayPlane(n,this._plane,CP));let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return t.x=r,t.y=s,t};nm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var GSe=new m;nm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=GSe;return m.multiplyByScalar(o,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(r,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};nm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Ma=nm;function Pi(e,t){this.center=m.clone(y(e,m.ZERO)),this.halfAxes=Z.clone(y(t,Z.ZERO))}Pi.packedLength=m.packedLength+Z.packedLength;Pi.pack=function(e,t,n){return n=y(n,0),m.pack(e.center,t,n),Z.pack(e.halfAxes,t,n+m.packedLength),t};Pi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Pi),m.unpack(e,t,n.center),Z.unpack(e,t+m.packedLength,n.halfAxes),n};var WSe=new m,jSe=new m,qSe=new m,YSe=new m,XSe=new m,KSe=new m,JSe=new Z,ZSe={unitary:new Z,diagonal:new Z};Pi.fromPoints=function(e,t){if(l(t)||(t=new Pi),!l(e)||e.length===0)return t.halfAxes=Z.ZERO,t.center=m.ZERO,t;let n,i=e.length,o=m.clone(e[0],WSe);for(n=1;n<i;n++)m.add(o,e[n],o);let r=1/i;m.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],o,jSe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,d*=r;let g=JSe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let h=Z.computeEigenDecomposition(g,ZSe),x=Z.clone(h.unitary,t.halfAxes),b=Z.getColumn(x,0,YSe),C=Z.getColumn(x,1,XSe),T=Z.getColumn(x,2,KSe),A=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,I=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],A=Math.max(m.dot(b,p),A),S=Math.max(m.dot(C,p),S),v=Math.max(m.dot(T,p),v),I=Math.min(m.dot(b,p),I),O=Math.min(m.dot(C,p),O),R=Math.min(m.dot(T,p),R);b=m.multiplyByScalar(b,.5*(I+A),b),C=m.multiplyByScalar(C,.5*(O+S),C),T=m.multiplyByScalar(T,.5*(R+v),T);let N=m.add(b,C,t.center);m.add(N,T,N);let F=qSe;return F.x=A-I,F.y=S-O,F.z=v-R,m.multiplyByScalar(F,.5,F),Z.multiplyByScale(t.halfAxes,F,t.halfAxes),t};var zJ=new m,$Se=new m;function FJ(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Pi);let d=f.halfAxes;Z.setColumn(d,0,t,d),Z.setColumn(d,1,n,d),Z.setColumn(d,2,i,d);let p=zJ;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=$Se;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-c)/2;let h=f.center;return p=Z.multiplyByVector(d,p,p),m.add(e,p,h),Z.multiplyByScale(d,g,d),f}var BJ=new me,QSe=new m,eve=new me,tve=new me,nve=new me,ive=new me,ove=new me,rve=new m,kJ=new m,sve=new m,UJ=new m,ave=new m,cve=new H,lve=new H,uve=new H,fve=new H,dve=new H,mve=new m,hve=new m,pve=new m,_ve=new m,gve=new H,yve=new m,xve=new m,bve=new m,Cve=new dn(m.UNIT_X,0);Pi.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,oe.WGS84);let r,s,a,c,u,f,d;if(e.width<=P.PI){let O=ce.center(e,BJ),R=i.cartographicToCartesian(O,QSe),N=new Ma(R,i);d=N.plane;let F=O.longitude,_=e.south<0&&e.north>0?0:O.latitude,E=me.fromRadians(F,e.north,n,eve),w=me.fromRadians(e.west,e.north,n,tve),D=me.fromRadians(e.west,_,n,nve),M=me.fromRadians(e.west,e.south,n,ive),B=me.fromRadians(F,e.south,n,ove),V=i.cartographicToCartesian(E,rve),U=i.cartographicToCartesian(w,kJ),G=i.cartographicToCartesian(D,sve),k=i.cartographicToCartesian(M,UJ),Y=i.cartographicToCartesian(B,ave),j=N.projectPointToNearestOnPlane(V,cve),$=N.projectPointToNearestOnPlane(U,lve),W=N.projectPointToNearestOnPlane(G,uve),K=N.projectPointToNearestOnPlane(k,fve),J=N.projectPointToNearestOnPlane(Y,dve);return r=Math.min($.x,W.x,K.x),s=-r,c=Math.max($.y,j.y),a=Math.min(K.y,J.y),w.height=M.height=t,U=i.cartographicToCartesian(w,kJ),k=i.cartographicToCartesian(M,UJ),u=Math.min(dn.getPointDistance(d,U),dn.getPointDistance(d,k)),f=n,FJ(N.origin,N.xAxis,N.yAxis,N.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,x=ce.center(e,BJ).longitude,b=m.fromRadians(x,h,n,i,mve);b.z=0;let T=Math.abs(b.x)<P.EPSILON10&&Math.abs(b.y)<P.EPSILON10?m.UNIT_X:m.normalize(b,hve),A=m.UNIT_Z,S=m.cross(T,A,pve);d=dn.fromPointNormal(b,T,Cve);let v=m.fromRadians(x+P.PI_OVER_TWO,h,n,i,_ve);s=m.dot(dn.projectPointOntoPlane(d,v,gve),S),r=-s,c=m.fromRadians(0,e.north,g?t:n,i,yve).z,a=m.fromRadians(0,e.south,p?t:n,i,xve).z;let I=m.fromRadians(e.east,h,n,i,bve);return u=dn.getPointDistance(d,I),f=0,FJ(b,S,A,T,r,s,a,c,u,f,o)};Pi.fromTransformation=function(e,t){return l(t)||(t=new Pi),t.center=L.getTranslation(e,t.center),t.halfAxes=L.getMatrix3(e,t.halfAxes),t.halfAxes=Z.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Pi.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),Z.clone(e.halfAxes,t.halfAxes),t):new Pi(e.center,e.halfAxes)};Pi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[Z.COLUMN0ROW0]+s*o[Z.COLUMN0ROW1]+a*o[Z.COLUMN0ROW2])+Math.abs(r*o[Z.COLUMN1ROW0]+s*o[Z.COLUMN1ROW1]+a*o[Z.COLUMN1ROW2])+Math.abs(r*o[Z.COLUMN2ROW0]+s*o[Z.COLUMN2ROW1]+a*o[Z.COLUMN2ROW2]),u=m.dot(i,n)+t.distance;return u<=-c?tn.OUTSIDE:u>=c?tn.INSIDE:tn.INTERSECTING};var HJ=new m,GJ=new m,WJ=new m,Tve=new m,VJ=new m,Ave=new m;Pi.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,zJ),i=e.halfAxes,o=Z.getColumn(i,0,HJ),r=Z.getColumn(i,1,GJ),s=Z.getColumn(i,2,WJ),a=m.magnitude(o),c=m.magnitude(r),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(o,a,o):f=!1,c>0?m.divideByScalar(r,c,r):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,x,b;if(g===1){let S=o;h=r,x=s,d?p||(S=s,x=o):(S=r,h=o),b=m.cross(h,x,VJ),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){h=o,d?h=r:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),x=m.cross(h,S,Tve),m.normalize(x,x),b=m.cross(h,x,VJ),m.normalize(b,b),h===o?(r=x,s=b):h===r?(s=x,o=b):h===s&&(o=x,r=b)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=Ave;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let T=0,A;return C.x<-a?(A=C.x+a,T+=A*A):C.x>a&&(A=C.x-a,T+=A*A),C.y<-c?(A=C.y+c,T+=A*A):C.y>c&&(A=C.y-c,T+=A*A),C.z<-u?(A=C.z+u,T+=A*A):C.z>u&&(A=C.z-u,T+=A*A),T};var Eve=new m,Sve=new m;Pi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Hc);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,HJ),u=Z.getColumn(a,1,GJ),f=Z.getColumn(a,2,WJ),d=m.add(c,u,Eve);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,Sve),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var vve=new m,wve=new m,Ive=new m;Pi.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=Z.getColumn(i,0,vve),r=Z.getColumn(i,1,wve),s=Z.getColumn(i,2,Ive);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var Dve=new Z;Pi.computeTransformation=function(e,t){l(t)||(t=new L);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,Dve);return L.fromRotationTranslation(i,n,t)};var Pve=new ae;Pi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,Pve);return!t.isBoundingSphereVisible(n)};Pi.prototype.intersectPlane=function(e){return Pi.intersectPlane(this,e)};Pi.prototype.distanceSquaredTo=function(e){return Pi.distanceSquaredTo(this,e)};Pi.prototype.computePlaneDistances=function(e,t,n){return Pi.computePlaneDistances(this,e,t,n)};Pi.prototype.computeCorners=function(e){return Pi.computeCorners(this,e)};Pi.prototype.computeTransformation=function(e){return Pi.computeTransformation(this,e)};Pi.prototype.isOccluded=function(e){return Pi.isOccluded(this,e)};Pi.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Pi.prototype.clone=function(e){return Pi.clone(this,e)};Pi.prototype.equals=function(e){return Pi.equals(this,e)};var Nn=Pi;var TP={};TP.getHeight=function(e,t,n){return(e-n)*t+n};var Ove=new m;TP.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Ove),s=TP.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var jc=TP;var dr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function fS(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Fe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function La(e,t){return(e._flags&t)===t}function x_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(fS.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return La(this,dr.CULL)},set:function(e){La(this,dr.CULL)!==e&&(x_(this,dr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return La(this,dr.OCCLUDE)},set:function(e){La(this,dr.OCCLUDE)!==e&&(x_(this,dr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return La(this,dr.CAST_SHADOWS)},set:function(e){La(this,dr.CAST_SHADOWS)!==e&&(x_(this,dr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return La(this,dr.RECEIVE_SHADOWS)},set:function(e){La(this,dr.RECEIVE_SHADOWS)!==e&&(x_(this,dr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return La(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){La(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(x_(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return La(this,dr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){La(this,dr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(x_(this,dr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return La(this,dr.PICK_ONLY)},set:function(e){La(this,dr.PICK_ONLY)!==e&&(x_(this,dr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return La(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){La(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(x_(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});fS.shallowClone=function(e,t){if(l(e))return l(t)||(t=new fS),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};fS.prototype.execute=function(e,t){e.draw(this,t)};var nt=fS;var Rve={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ae=Object.freeze(Rve);var AP={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};AP.validate=function(e){return e===AP.CLOCKWISE||e===AP.COUNTER_CLOCKWISE};var rs=Object.freeze(AP);function jJ(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=jJ(e[t]));return Object.freeze(e)}var qJ=jJ;function om(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),h=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,rs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:Ke.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(h.enabled,!1),value:y(h.value,1),invert:y(h.invert,!1)},this.viewport=l(x)?new Ke(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var Mve=0,im={};om.fromCache=function(e){let t=JSON.stringify(e),n=im[t];if(l(n))return++n.referenceCount,n.state;let i=new om(e),o=JSON.stringify(i);return n=im[o],l(n)||(i.id=Mve++,n={referenceCount:0,state:i},im[o]=n),++n.referenceCount,im[t]={referenceCount:1,state:n.state},n.state};om.removeFromCache=function(e){let t=new om(e),n=JSON.stringify(t),i=im[n],o=JSON.stringify(e),r=im[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete im[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete im[n]};om.getCache=function(){return im};om.clearCache=function(){im={}};function e0(e,t,n){n?e.enable(t):e.disable(t)}function YJ(e,t){e.frontFace(t.frontFace)}function XJ(e,t){let n=t.cull,i=n.enabled;e0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function KJ(e,t){e.lineWidth(t.lineWidth)}function JJ(e,t){let n=t.polygonOffset,i=n.enabled;e0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function ZJ(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(e0(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function $J(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function QJ(e,t){let n=t.depthTest,i=n.enabled;e0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function eZ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function tZ(e,t){e.depthMask(t.depthMask)}function nZ(e,t){e.stencilMask(t.stencilMask)}function Lve(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function iZ(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;e0(e,e.BLEND,o),o&&(Lve(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function oZ(e,t){let n=t.stencilTest,i=n.enabled;if(e0(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,h=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,h,x)}}function rZ(e,t){let n=t.sampleCoverage,i=n.enabled;e0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Nve=new Ke;function sZ(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=Nve,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}om.apply=function(e,t,n){YJ(e,t),XJ(e,t),KJ(e,t),JJ(e,t),$J(e,t),QJ(e,t),eZ(e,t),tZ(e,t),nZ(e,t),oZ(e,t),rZ(e,t),ZJ(e,t,n),iZ(e,t,n),sZ(e,t,n)};function Fve(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(YJ),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(XJ),e.lineWidth!==t.lineWidth&&n.push(KJ),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(JJ),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push($J),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(QJ),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(eZ),e.depthMask!==t.depthMask&&n.push(tZ),e.stencilMask!==t.stencilMask&&n.push(nZ),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(oZ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(rZ),n}om.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Fve(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&ZJ(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&iZ(e,n,o),(t!==n||i!==o||i.context!==o.context)&&sZ(e,n,o)};om.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ke.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Ke.clone(e.viewport):void 0}};var Ve=om;var Bve=new m;function jt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Fs={};Fs[te.FLOAT]="float";Fs[te.FLOAT_VEC2]="vec2";Fs[te.FLOAT_VEC3]="vec3";Fs[te.FLOAT_VEC4]="vec4";Fs[te.INT]="int";Fs[te.INT_VEC2]="ivec2";Fs[te.INT_VEC3]="ivec3";Fs[te.INT_VEC4]="ivec4";Fs[te.BOOL]="bool";Fs[te.BOOL_VEC2]="bvec2";Fs[te.BOOL_VEC3]="bvec3";Fs[te.BOOL_VEC4]="bvec4";Fs[te.FLOAT_MAT2]="mat2";Fs[te.FLOAT_MAT3]="mat3";Fs[te.FLOAT_MAT4]="mat4";Fs[te.SAMPLER_2D]="sampler2D";Fs[te.SAMPLER_CUBE]="samplerCube";jt.prototype.getDeclaration=function(e){let t=`uniform ${Fs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var kve={czm_viewport:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new jt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return L.getTranslation(e.inverseView,Bve)}}),czm_frameNumber:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new jt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new jt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new jt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new jt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new jt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new jt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new jt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new jt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},b_=kve;function Uve(e,t,n,i){switch(t.type){case e.FLOAT:return new aZ(e,t,n,i);case e.FLOAT_VEC2:return new cZ(e,t,n,i);case e.FLOAT_VEC3:return new lZ(e,t,n,i);case e.FLOAT_VEC4:return new uZ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new g8(e,t,n,i);case e.INT:case e.BOOL:return new fZ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new dZ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new mZ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new hZ(e,t,n,i);case e.FLOAT_MAT2:return new pZ(e,t,n,i);case e.FLOAT_MAT3:return new _Z(e,t,n,i);case e.FLOAT_MAT4:return new gZ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function aZ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}aZ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function cZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}cZ.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function lZ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}lZ.prototype.set=function(){let e=this.value;e&&(l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function uZ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}uZ.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(re.equals(e,this._value)||(this._value=re.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function g8(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}g8.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};g8.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function fZ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}fZ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function dZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}dZ.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function mZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}mZ.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function hZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new re,this._gl=e,this._location=i}hZ.prototype.set=function(){let e=this.value;re.equals(e,this._value)||(re.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Vve=new Float32Array(4);function pZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new no,this._gl=e,this._location=i}pZ.prototype.set=function(){if(!no.equalsArray(this.value,this._value,0)){no.clone(this.value,this._value);let e=no.toArray(this.value,Vve);this._gl.uniformMatrix2fv(this._location,!1,e)}};var zve=new Float32Array(9);function _Z(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}_Z.prototype.set=function(){if(!Z.equalsArray(this.value,this._value,0)){Z.clone(this.value,this._value);let e=Z.toArray(this.value,zve);this._gl.uniformMatrix3fv(this._location,!1,e)}};var Hve=new Float32Array(16);function gZ(e,t,n,i){this.name=n,this.value=void 0,this._value=new L,this._gl=e,this._location=i}gZ.prototype.set=function(){if(!L.equalsArray(this.value,this._value,0)){L.clone(this.value,this._value);let e=L.toArray(this.value,Hve);this._gl.uniformMatrix4fv(this._location,!1,e)}};var EP=Uve;function Gve(e,t,n,i){switch(t.type){case e.FLOAT:return new yZ(e,t,n,i);case e.FLOAT_VEC2:return new xZ(e,t,n,i);case e.FLOAT_VEC3:return new bZ(e,t,n,i);case e.FLOAT_VEC4:return new CZ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new y8(e,t,n,i);case e.INT:case e.BOOL:return new TZ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new AZ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new EZ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new SZ(e,t,n,i);case e.FLOAT_MAT2:return new vZ(e,t,n,i);case e.FLOAT_MAT3:return new wZ(e,t,n,i);case e.FLOAT_MAT4:return new IZ(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function yZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}yZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function xZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}xZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function bZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}bZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function CZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}CZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0):l(s.x)&&(re.equalsArray(s,n,o)||(re.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function y8(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}y8.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};y8.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function TZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}TZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function AZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}AZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function EZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}EZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function SZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}SZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];re.equalsArray(s,n,o)||(re.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function vZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}vZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];no.equalsArray(s,n,o)||(no.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function wZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}wZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Z.equalsArray(s,n,o)||(Z.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function IZ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}IZ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];L.equalsArray(s,n,o)||(L.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var SP=Gve;var Wve=0;function Mh(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=jve(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Wve++}Mh.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Mh.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Mh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return vP(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return vP(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return vP(this),this._uniformsByName}}});function DZ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function jve(e,t){let n={};if(!Gt.highpFloatSupported||!Gt.highpIntSupported){let i,o,r,s,a=DZ(e),c=DZ(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var rm="[Cesium WebGL] ";function qve(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${rm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${rm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${rm}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${rm}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${rm}Vertex shader compile log: ${c}`),console.error(`${rm} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${rm}Fragment shader compile log: ${c}`),console.error(`${rm} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${rm}${g} shader translation failed.`);return}console.error(`${rm}Translated ${g} shaderSource: +${h}`)}}function Yve(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function Xve(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=EP(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,g,h=u.indexOf("[");if(h>=0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${u}[${x}]`),g!==null&&d.push(g);f=SP(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Kve(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=b_[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function Jve(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function vP(e){l(e._program)||PZ(e)}function PZ(e){let t=e._program,n=e._gl,i=qve(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=Xve(n,i),s=Kve(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Yve(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Jve(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{PZ(e),u(e._program)}catch(h){e._vertexShaderText=d,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(h.message);f(b?b[1]:h.message)}})}Mh.prototype._bind=function(){vP(this),this._gl.useProgram(this._program)};Mh.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Mh.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var $t=Mh;var wP=`/** + * A built-in GLSL floating-point constant for converting radians to degrees. * - * @name czm_inverseGamma - * @glslFunction + * @alias czm_degreesPerRadian + * @glslConstant * - * @param {vec3} color The color in linear space. - * @returns {vec3} The color in RGB space. + * @see CesiumMath.DEGREES_PER_RADIAN + * + * @example + * // GLSL declaration + * const float czm_degreesPerRadian = ...; + * + * // Example + * float deg = czm_degreesPerRadian * rad; */ -vec3 czm_inverseGamma(vec3 color) { - return pow(color, vec3(1.0 / czm_gamma)); -} -`;var AO=`/** - * Determines if a time interval is empty. +const float czm_degreesPerRadian = 57.29577951308232; +`;var IP=`/** + * A built-in GLSL vec2 constant for defining the depth range. + * This is a workaround to a bug where IE11 does not implement gl_DepthRange. * - * @name czm_isEmpty - * @glslFunction - * - * @param {czm_raySegment} interval The interval to test. - * - * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * @alias czm_depthRange + * @glslConstant * * @example - * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true - * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false - * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + * // GLSL declaration + * float depthRangeNear = czm_depthRange.near; + * float depthRangeFar = czm_depthRange.far; + * */ -bool czm_isEmpty(czm_raySegment interval) -{ - return (interval.stop < 0.0); -} -`;var xO=`/** - * Determines if a time interval is empty. +const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var DP=`/** + * 0.1 * - * @name czm_isFull - * @glslFunction - * - * @param {czm_raySegment} interval The interval to test. - * - * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * @name czm_epsilon1 + * @glslConstant + */ +const float czm_epsilon1 = 0.1; +`;var PP=`/** + * 0.01 * - * @example - * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true - * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false - * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + * @name czm_epsilon2 + * @glslConstant */ -bool czm_isFull(czm_raySegment interval) -{ - return (interval.start == 0.0 && interval.stop == czm_infinity); -} -`;var CO=`/** - * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. +const float czm_epsilon2 = 0.01; +`;var OP=`/** + * 0.001 * - * @name czm_latitudeToWebMercatorFraction - * @glslFunction + * @name czm_epsilon3 + * @glslConstant + */ +const float czm_epsilon3 = 0.001; +`;var RP=`/** + * 0.0001 * - * @param {float} latitude The geodetic latitude, in radians. - * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. - * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * @name czm_epsilon4 + * @glslConstant + */ +const float czm_epsilon4 = 0.0001; +`;var MP=`/** + * 0.00001 * - * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern - * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return - * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. - */ -float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) -{ - float sinLatitude = sin(latitude); - float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); - - return (mercatorY - southMercatorY) * oneOverMercatorHeight; -} -`;var TO=`/** - * Converts a linear RGB color to an sRGB color. + * @name czm_epsilon5 + * @glslConstant + */ +const float czm_epsilon5 = 0.00001; +`;var LP=`/** + * 0.000001 * - * @param {vec3|vec4} linearIn The color in linear color space. - * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + * @name czm_epsilon6 + * @glslConstant */ -vec3 czm_linearToSrgb(vec3 linearIn) -{ - return pow(linearIn, vec3(1.0/2.2)); -} - -vec4 czm_linearToSrgb(vec4 linearIn) -{ - vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); - return vec4(srgbOut, linearIn.a); -} -`;var EO=`/** - * Computes distance from an point in 2D to a line in 2D. +const float czm_epsilon6 = 0.000001; +`;var NP=`/** + * 0.0000001 * - * @name czm_lineDistance - * @glslFunction + * @name czm_epsilon7 + * @glslConstant + */ +const float czm_epsilon7 = 0.0000001; +`;var FP=`/** + * DOC_TBA * - * param {vec2} point1 A point along the line. - * param {vec2} point2 A point along the line. - * param {vec2} point A point that may or may not be on the line. - * returns {float} The distance from the point to the line. + * @name czm_infinity + * @glslConstant */ -float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { - return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); -} -`;var bO=`/** - * Computes the luminance of a color. +const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp? +`;var BP=`/** + * A built-in GLSL floating-point constant for <code>1/pi</code>. * - * @name czm_luminance - * @glslFunction + * @alias czm_oneOverPi + * @glslConstant * - * @param {vec3} rgb The color. - * - * @returns {float} The luminance. + * @see CesiumMath.ONE_OVER_PI * * @example - * float light = czm_luminance(vec3(0.0)); // 0.0 - * float dark = czm_luminance(vec3(1.0)); // ~1.0 - */ -float czm_luminance(vec3 rgb) -{ - // Algorithm from Chapter 10 of Graphics Shaders. - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - return dot(rgb, W); -} -`;var SO=`/** - * Computes the size of a pixel in meters at a distance from the eye. - * <p> - * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. - * </p> - * @name czm_metersPerPixel - * @glslFunction - * - * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. - * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * // GLSL declaration + * const float czm_oneOverPi = ...; * - * @returns {float} The meters per pixel at positionEC. + * // Example + * float pi = 1.0 / czm_oneOverPi; */ -float czm_metersPerPixel(vec4 positionEC, float pixelRatio) -{ - float width = czm_viewport.z; - float height = czm_viewport.w; - float pixelWidth; - float pixelHeight; - - float top = czm_frustumPlanes.x; - float bottom = czm_frustumPlanes.y; - float left = czm_frustumPlanes.z; - float right = czm_frustumPlanes.w; - - if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) - { - float frustumWidth = right - left; - float frustumHeight = top - bottom; - pixelWidth = frustumWidth / width; - pixelHeight = frustumHeight / height; - } - else - { - float distanceToPixel = -positionEC.z; - float inverseNear = 1.0 / czm_currentFrustum.x; - float tanTheta = top * inverseNear; - pixelHeight = 2.0 * distanceToPixel * tanTheta / height; - tanTheta = right * inverseNear; - pixelWidth = 2.0 * distanceToPixel * tanTheta / width; - } - - return max(pixelWidth, pixelHeight) * pixelRatio; -} - -/** - * Computes the size of a pixel in meters at a distance from the eye. - * <p> - * Use this version when scaling by pixel ratio. - * </p> - * @name czm_metersPerPixel - * @glslFunction - * - * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. +const float czm_oneOverPi = 0.3183098861837907; +`;var kP=`/** + * A built-in GLSL floating-point constant for <code>1/2pi</code>. * - * @returns {float} The meters per pixel at positionEC. - */ -float czm_metersPerPixel(vec4 positionEC) -{ - return czm_metersPerPixel(positionEC, czm_pixelRatio); -} -`;var vO=`/** - * Transforms a position from model to window coordinates. The transformation - * from model to clip coordinates is done using {@link czm_modelViewProjection}. - * The transform from normalized device coordinates to window coordinates is - * done using {@link czm_viewportTransformation}, which assumes a depth range - * of <code>near = 0</code> and <code>far = 1</code>. - * <br /><br /> - * This transform is useful when there is a need to manipulate window coordinates - * in a vertex shader as done by {@link BillboardCollection}. - * <br /><br /> - * This function should not be confused with {@link czm_viewportOrthographic}, - * which is an orthographic projection matrix that transforms from window - * coordinates to clip coordinates. + * @alias czm_oneOverTwoPi + * @glslConstant * - * @name czm_modelToWindowCoordinates - * @glslFunction + * @see CesiumMath.ONE_OVER_TWO_PI * - * @param {vec4} position The position in model coordinates to transform. + * @example + * // GLSL declaration + * const float czm_oneOverTwoPi = ...; * - * @returns {vec4} The transformed position in window coordinates. + * // Example + * float pi = 2.0 * czm_oneOverTwoPi; + */ +const float czm_oneOverTwoPi = 0.15915494309189535; +`;var UP=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} * - * @see czm_eyeToWindowCoordinates - * @see czm_modelViewProjection - * @see czm_viewportTransformation - * @see czm_viewportOrthographic - * @see BillboardCollection + * @name czm_passCesium3DTile + * @glslConstant * - * @example - * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + * @see czm_pass */ -vec4 czm_modelToWindowCoordinates(vec4 position) -{ - vec4 q = czm_modelViewProjection * position; // clip coordinates - q.xyz /= q.w; // normalized device coordinates - q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates - return q; -} -`;var wO=`/** - * DOC_TBA +const float czm_passCesium3DTile = 4.0; +`;var VP=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} * - * @name czm_multiplyWithColorBalance - * @glslFunction + * @name czm_passCesium3DTileClassification + * @glslConstant + * + * @see czm_pass */ -vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) -{ - // Algorithm from Chapter 10 of Graphics Shaders. - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - - vec3 target = left * right; - float leftLuminance = dot(left, W); - float rightLuminance = dot(right, W); - float targetLuminance = dot(target, W); - - return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; -} -`;var DO=`/** - * Computes a value that scales with distance. The scaling is clamped at the near and - * far distances, and does not extrapolate. This function works with the - * {@link NearFarScalar} JavaScript class. +const float czm_passCesium3DTileClassification = 5.0; +`;var zP=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} * - * @name czm_nearFarScalar - * @glslFunction + * @name czm_passCesium3DTileClassificationIgnoreShow + * @glslConstant * - * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). - * @param {float} cameraDistSq The square of the current distance from the camera. + * @see czm_pass + */ +const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; +`;var HP=`/** + * The automatic GLSL constant for {@link Pass#CLASSIFICATION} * - * @returns {float} The value at this distance. + * @name czm_passClassification + * @glslConstant + * + * @see czm_pass */ -float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) -{ - float valueAtMin = nearFarScalar.y; - float valueAtMax = nearFarScalar.w; - float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; - float farDistanceSq = nearFarScalar.z * nearFarScalar.z; - - float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); - - t = pow(clamp(t, 0.0, 1.0), 0.2); - - return mix(valueAtMin, valueAtMax, t); -} -`;var IO=` /** - * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ - * - * @name czm_octDecode - * @param {vec2} encoded The oct-encoded, unit-length vector - * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. - * @returns {vec3} The decoded and normalized vector - */ - vec3 czm_octDecode(vec2 encoded, float range) - { - if (encoded.x == 0.0 && encoded.y == 0.0) { - return vec3(0.0, 0.0, 0.0); - } - - encoded = encoded / range * 2.0 - 1.0; - vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); - if (v.z < 0.0) - { - v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); - } - - return normalize(v); - } - -/** - * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passClassification = 7.0; +`;var GP=`/** + * The automatic GLSL constant for {@link Pass#COMPUTE} * - * @name czm_octDecode - * @param {vec2} encoded The oct-encoded, unit-length vector - * @returns {vec3} The decoded and normalized vector + * @name czm_passCompute + * @glslConstant + * + * @see czm_pass */ - vec3 czm_octDecode(vec2 encoded) - { - return czm_octDecode(encoded, 255.0); - } - - /** - * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passCompute = 1.0; +`;var WP=`/** + * The automatic GLSL constant for {@link Pass#ENVIRONMENT} * - * @name czm_octDecode - * @param {float} encoded The oct-encoded, unit-length vector - * @returns {vec3} The decoded and normalized vector + * @name czm_passEnvironment + * @glslConstant + * + * @see czm_pass */ - vec3 czm_octDecode(float encoded) - { - float temp = encoded / 256.0; - float x = floor(temp); - float y = (temp - x) * 256.0; - return czm_octDecode(vec2(x, y)); - } - -/** - * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. - * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", - * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ +const float czm_passEnvironment = 0.0; +`;var jP=`/** + * The automatic GLSL constant for {@link Pass#GLOBE} * - * @name czm_octDecode - * @param {vec2} encoded The packed oct-encoded, unit-length vectors. - * @param {vec3} vector1 One decoded and normalized vector. - * @param {vec3} vector2 One decoded and normalized vector. - * @param {vec3} vector3 One decoded and normalized vector. + * @name czm_passGlobe + * @glslConstant + * + * @see czm_pass */ - void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) - { - float temp = encoded.x / 65536.0; - float x = floor(temp); - float encodedFloat1 = (temp - x) * 65536.0; - - temp = encoded.y / 65536.0; - float y = floor(temp); - float encodedFloat2 = (temp - y) * 65536.0; - - vector1 = czm_octDecode(encodedFloat1); - vector2 = czm_octDecode(encodedFloat2); - vector3 = czm_octDecode(vec2(x, y)); - } - -`;var PO=`/** - * Packs a depth value into a vec3 that can be represented by unsigned bytes. +const float czm_passGlobe = 2.0; +`;var qP=`/** + * The automatic GLSL constant for {@link Pass#OPAQUE} * - * @name czm_packDepth - * @glslFunction + * @name czm_passOpaque + * @glslConstant * - * @param {float} depth The floating-point depth. - * @returns {vec3} The packed depth. + * @see czm_pass */ -vec4 czm_packDepth(float depth) -{ - // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; - enc = fract(enc); - enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); - return enc; -} -`;var OO=`vec3 lambertianDiffuse(vec3 diffuseColor) -{ - return diffuseColor / czm_pi; -} - -vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - -float smithVisibilityG1(float NdotV, float roughness) -{ - // this is the k value for direct lighting. - // for image based lighting it will be roughness^2 / 2 - float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; - return NdotV / (NdotV * (1.0 - k) + k); -} - -float smithVisibilityGGX(float roughness, float NdotL, float NdotV) -{ - return ( - smithVisibilityG1(NdotL, roughness) * - smithVisibilityG1(NdotV, roughness) - ); -} - -float GGX(float roughness, float NdotH) -{ - float roughnessSquared = roughness * roughness; - float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; - return roughnessSquared / (czm_pi * f * f); -} - -/** - * Compute the diffuse and specular contributions using physically based - * rendering. This function only handles direct lighting. - * <p> - * This function only handles the lighting calculations. Metallic/roughness - * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} - * </p> - * - * @name czm_pbrlighting - * @glslFunction +const float czm_passOpaque = 7.0; +`;var YP=`/** + * The automatic GLSL constant for {@link Pass#OVERLAY} * - * @param {vec3} positionEC The position of the fragment in eye coordinates - * @param {vec3} normalEC The surface normal in eye coordinates - * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. - * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. - * @param {czm_pbrParameters} The computed PBR parameters. - * @return {vec3} The computed HDR color + * @name czm_passOverlay + * @glslConstant * - * @example - * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( - * baseColor, - * metallic, - * roughness - * ); - * vec3 color = czm_pbrlighting( - * positionEC, - * normalEC, - * lightDirectionEC, - * lightColorHdr, - * pbrParameters); + * @see czm_pass */ -vec3 czm_pbrLighting( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) -{ - vec3 v = -normalize(positionEC); - vec3 l = normalize(lightDirectionEC); - vec3 h = normalize(v + l); - vec3 n = normalEC; - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = abs(dot(n, v)) + 0.001; - float NdotH = clamp(dot(n, h), 0.0, 1.0); - float LdotH = clamp(dot(l, h), 0.0, 1.0); - float VdotH = clamp(dot(v, h), 0.0, 1.0); - - vec3 f0 = pbrParameters.f0; - float reflectance = max(max(f0.r, f0.g), f0.b); - vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(f0, f90, VdotH); - - float alpha = pbrParameters.roughness; - float G = smithVisibilityGGX(alpha, NdotL, NdotV); - float D = GGX(alpha, NdotH); - vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - - vec3 diffuseColor = pbrParameters.diffuseColor; - // F here represents the specular contribution - vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - - // Lo = (diffuse + specular) * Li * NdotL - return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; -} -`;var RO=`/** - * Compute parameters for physically based rendering using the - * metallic/roughness workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passOverlay = 10.0; +`;var XP=`/** + * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * - * @name czm_pbrMetallicRoughnessMaterial - * @glslFunction + * @name czm_passTerrainClassification + * @glslConstant * - * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) - * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); - * @param {float} roughness A value between 0.0 and 1.0 - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrMetallicRoughnessMaterial( - vec3 baseColor, - float metallic, - float roughness -) -{ - czm_pbrParameters results; - - // roughness is authored as perceptual roughness - // square it to get material roughness - roughness = clamp(roughness, 0.0, 1.0); - results.roughness = roughness * roughness; - - // dielectrics use f0 = 0.04, metals use albedo as f0 - metallic = clamp(metallic, 0.0, 1.0); - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); - results.f0 = f0; - - // diffuse only applies to dielectrics. - results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); - - return results; -} -`;var MO=`/** - * Compute parameters for physically based rendering using the - * specular/glossy workflow. All inputs are linear; sRGB texture values must - * be decoded beforehand +const float czm_passTerrainClassification = 3.0; +`;var KP=`/** + * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * - * @name czm_pbrSpecularGlossinessMaterial - * @glslFunction + * @name czm_passTranslucent + * @glslConstant * - * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) - * @param {vec3} specular The reflectance at normal incidence (f0) - * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. - * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + * @see czm_pass */ -czm_pbrParameters czm_pbrSpecularGlossinessMaterial( - vec3 diffuse, - vec3 specular, - float glossiness -) -{ - czm_pbrParameters results; - - // glossiness is the opposite of roughness, but easier for artists to use. - float roughness = 1.0 - glossiness; - results.roughness = roughness * roughness; - - results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); - results.f0 = specular; - - return results; -} -`;var BO=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) -{ - return czm_getLambertDiffuse(lightDirectionEC, material.normal); -} - -float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) -{ - return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); -} - -/** - * Computes a color using the Phong lighting model. +const float czm_passTranslucent = 8.0; +`;var JP=`/** + * The automatic GLSL constant for {@link Pass#VOXELS} * - * @name czm_phong - * @glslFunction + * @name czm_passVoxels + * @glslConstant * - * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. - * @param {czm_material} material The fragment's material. + * @see czm_pass + */ +const float czm_passVoxels = 9.0; +`;var ZP=`/** + * A built-in GLSL floating-point constant for <code>Math.PI</code>. * - * @returns {vec4} The computed color. + * @alias czm_pi + * @glslConstant + * + * @see CesiumMath.PI * * @example - * vec3 positionToEyeEC = // ... - * czm_material material = // ... - * vec3 lightDirectionEC = // ... - * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * // GLSL declaration + * const float czm_pi = ...; * - * @see czm_getMaterial + * // Example + * float twoPi = 2.0 * czm_pi; */ -vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - // Diffuse from directional light sources at eye (for top-down) - float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); - } - - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; - - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} - -vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ - float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); - float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - - vec3 ambient = vec3(0.0); - vec3 color = ambient + material.emission; - color += material.diffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; - - return vec4(color, material.alpha); -} -`;var LO=`/** - * Computes distance from a point to a plane. +const float czm_pi = 3.141592653589793; +`;var $P=`/** + * A built-in GLSL floating-point constant for <code>pi/4</code>. * - * @name czm_planeDistance - * @glslFunction + * @alias czm_piOverFour + * @glslConstant * - * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. - */ -float czm_planeDistance(vec4 plane, vec3 point) { - return (dot(plane.xyz, point) + plane.w); -} - -/** - * Computes distance from a point to a plane. + * @see CesiumMath.PI_OVER_FOUR * - * @name czm_planeDistance - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverFour = ...; * - * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js - * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js - * param {vec3} point A point in the same space as the plane. - * returns {float} The distance from the point to the plane. + * // Example + * float pi = 4.0 * czm_piOverFour; */ -float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { - return (dot(planeNormal, point) + planeDistance); -} -`;var NO=`/** - * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero. +const float czm_piOverFour = 0.7853981633974483; +`;var QP=`/** + * A built-in GLSL floating-point constant for <code>pi/6</code>. * - * @name czm_pointAlongRay - * @glslFunction + * @alias czm_piOverSix + * @glslConstant + * + * @see CesiumMath.PI_OVER_SIX * - * @param {czm_ray} ray The ray to compute the point along. - * @param {float} time The time along the ray. - * - * @returns {vec3} The point along the ray at the given time. - * * @example - * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction - * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) - */ -vec3 czm_pointAlongRay(czm_ray ray, float time) -{ - return ray.origin + (time * ray.direction); -} -`;var FO=`/** - * DOC_TBA + * // GLSL declaration + * const float czm_piOverSix = ...; * - * @name czm_rayEllipsoidIntersectionInterval - * @glslFunction + * // Example + * float pi = 6.0 * czm_piOverSix; */ -czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) -{ - // ray and ellipsoid center in eye coordinates. radii in model coordinates. - vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; - vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - - q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - - float q2 = dot(q, q); - float qw = dot(q, w); - - if (q2 > 1.0) // Outside ellipsoid. - { - if (qw >= 0.0) // Looking outward or tangent (0 intersections). - { - return czm_emptyRaySegment; - } - else // qw < 0.0. - { - float qw2 = qw * qw; - float difference = q2 - 1.0; // Positively valued. - float w2 = dot(w, w); - float product = w2 * difference; - - if (qw2 < product) // Imaginary roots (0 intersections). - { - return czm_emptyRaySegment; - } - else if (qw2 > product) // Distinct roots (2 intersections). - { - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Avoid cancellation. - float root0 = temp / w2; - float root1 = difference / temp; - if (root0 < root1) - { - czm_raySegment i = czm_raySegment(root0, root1); - return i; - } - else - { - czm_raySegment i = czm_raySegment(root1, root0); - return i; - } - } - else // qw2 == product. Repeated roots (2 intersections). - { - float root = sqrt(difference / w2); - czm_raySegment i = czm_raySegment(root, root); - return i; - } - } - } - else if (q2 < 1.0) // Inside ellipsoid (2 intersections). - { - float difference = q2 - 1.0; // Negatively valued. - float w2 = dot(w, w); - float product = w2 * difference; // Negatively valued. - float discriminant = qw * qw - product; - float temp = -qw + sqrt(discriminant); // Positively valued. - czm_raySegment i = czm_raySegment(0.0, temp / w2); - return i; - } - else // q2 == 1.0. On ellipsoid. - { - if (qw < 0.0) // Looking inward. - { - float w2 = dot(w, w); - czm_raySegment i = czm_raySegment(0.0, -qw / w2); - return i; - } - else // qw >= 0.0. Looking outward or tangent. - { - return czm_emptyRaySegment; - } - } -} -`;var UO=`/** - * Compute the intersection interval of a ray with a sphere. +const float czm_piOverSix = 0.5235987755982988; +`;var eO=`/** + * A built-in GLSL floating-point constant for <code>pi/3</code>. * - * @name czm_raySphereIntersectionInterval - * @glslFunction + * @alias czm_piOverThree + * @glslConstant * - * @param {czm_ray} ray The ray. - * @param {vec3} center The center of the sphere. - * @param {float} radius The radius of the sphere. - * @return {czm_raySegment} The intersection interval of the ray with the sphere. - */ -czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) -{ - vec3 o = ray.origin; - vec3 d = ray.direction; - - vec3 oc = o - center; - - float a = dot(d, d); - float b = 2.0 * dot(d, oc); - float c = dot(oc, oc) - (radius * radius); - - float det = (b * b) - (4.0 * a * c); - - if (det < 0.0) { - return czm_emptyRaySegment; - } - - float sqrtDet = sqrt(det); - - float t0 = (-b - sqrtDet) / (2.0 * a); - float t1 = (-b + sqrtDet) / (2.0 * a); - - czm_raySegment result = czm_raySegment(t0, t1); - return result; -} -`;var VO=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) -{ - return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var kO=`/** - * Reads a value previously transformed with {@link czm_writeNonPerspective} - * by dividing it by \`w\`, the value used in the perspective divide. - * This function is intended to be called in a fragment shader to access a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The value should have been - * previously written in the vertex shader with a call to - * {@link czm_writeNonPerspective}. + * @see CesiumMath.PI_OVER_THREE * - * @name czm_readNonPerspective - * @glslFunction + * @example + * // GLSL declaration + * const float czm_piOverThree = ...; * - * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. - * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. - * @returns {float|vec2|vec3|vec4} The usable value. + * // Example + * float pi = 3.0 * czm_piOverThree; */ -float czm_readNonPerspective(float value, float oneOverW) { - return value * oneOverW; -} - -vec2 czm_readNonPerspective(vec2 value, float oneOverW) { - return value * oneOverW; -} - -vec3 czm_readNonPerspective(vec3 value, float oneOverW) { - return value * oneOverW; -} - -vec4 czm_readNonPerspective(vec4 value, float oneOverW) { - return value * oneOverW; -} -`;var zO=`float czm_reverseLogDepth(float logZ) -{ -#ifdef LOG_DEPTH - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - return far * (1.0 - near / (depthFromNear + near)) / (far - near); -#endif - return logZ; -} -`;var HO=`/** - * Converts an RGB color to HSB (hue, saturation, brightness) - * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} +const float czm_piOverThree = 1.0471975511965976; +`;var tO=`/** + * A built-in GLSL floating-point constant for <code>pi/2</code>. * - * @name czm_RGBToHSB - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * @alias czm_piOverTwo + * @glslConstant * - * @returns {vec3} The color in HSB. + * @see CesiumMath.PI_OVER_TWO * * @example - * vec3 hsb = czm_RGBToHSB(rgb); - * hsb.z *= 0.1; - * rgb = czm_HSBToRGB(hsb); - */ - -const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - -vec3 czm_RGBToHSB(vec3 rgb) -{ - vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); - vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); - - float d = q.x - min(q.w, q.y); - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); -} -`;var GO=`/** - * Converts an RGB color to HSL (hue, saturation, lightness) - * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * // GLSL declaration + * const float czm_piOverTwo = ...; * - * @name czm_RGBToHSL - * @glslFunction - * - * @param {vec3} rgb The color in RGB. + * // Example + * float pi = 2.0 * czm_piOverTwo; + */ +const float czm_piOverTwo = 1.5707963267948966; +`;var nO=`/** + * A built-in GLSL floating-point constant for converting degrees to radians. * - * @returns {vec3} The color in HSL. + * @alias czm_radiansPerDegree + * @glslConstant + * + * @see CesiumMath.RADIANS_PER_DEGREE * * @example - * vec3 hsl = czm_RGBToHSL(rgb); - * hsl.z *= 0.1; - * rgb = czm_HSLToRGB(hsl); + * // GLSL declaration + * const float czm_radiansPerDegree = ...; + * + * // Example + * float rad = czm_radiansPerDegree * deg; */ - -vec3 RGBtoHCV(vec3 rgb) -{ - // Based on work by Sam Hocevar and Emil Persson - vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); - vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); - float c = q.x - min(q.w, q.y); - float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); - return vec3(h, c, q.x); -} - -vec3 czm_RGBToHSL(vec3 rgb) -{ - vec3 hcv = RGBtoHCV(rgb); - float l = hcv.z - hcv.y * 0.5; - float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); - return vec3(hcv.x, s, l); -} -`;var WO=`/** - * Converts an RGB color to CIE Yxy. - * <p>The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - * </p> - * - * @name czm_RGBToXYZ - * @glslFunction - * - * @param {vec3} rgb The color in RGB. +const float czm_radiansPerDegree = 0.017453292519943295; +`;var iO=`/** + * The constant identifier for the 2D {@link SceneMode} * - * @returns {vec3} The color in CIE Yxy. + * @name czm_sceneMode2D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing + */ +const float czm_sceneMode2D = 2.0; +`;var oO=`/** + * The constant identifier for the 3D {@link SceneMode} * - * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * @name czm_sceneMode3D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneModeMorphing */ -vec3 czm_RGBToXYZ(vec3 rgb) -{ - const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, - 0.3576, 0.7152, 0.1192, - 0.1805, 0.0722, 0.9505); - vec3 xyz = RGB2XYZ * rgb; - vec3 Yxy; - Yxy.r = xyz.g; - float temp = dot(vec3(1.0), xyz); - Yxy.gb = xyz.rg / temp; - return Yxy; -} -`;var jO=`/** - * Round a floating point value. This function exists because round() doesn't - * exist in GLSL 1.00. +const float czm_sceneMode3D = 3.0; +`;var rO=`/** + * The constant identifier for the Columbus View {@link SceneMode} * - * @param {float|vec2|vec3|vec4} value The value to round - * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + * @name czm_sceneModeColumbusView + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing */ -float czm_round(float value) { - return floor(value + 0.5); -} - -vec2 czm_round(vec2 value) { - return floor(value + 0.5); -} - -vec3 czm_round(vec3 value) { - return floor(value + 0.5); -} - -vec4 czm_round(vec4 value) { - return floor(value + 0.5); -} -`;var YO=`/** - * Samples the 4 neighboring pixels and return the weighted average. +const float czm_sceneModeColumbusView = 1.0; +`;var sO=`/** + * The constant identifier for the Morphing {@link SceneMode} * - * @private + * @name czm_sceneModeMorphing + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D */ -vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) -{ - direction /= dot(vec3(1.0), abs(direction)); - vec2 rev = abs(direction.zx) - vec2(1.0); - vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, - direction.z < 0.0 ? rev.y : -rev.y); - vec2 uv = direction.y < 0.0 ? neg : direction.xz; - vec2 coord = 0.5 * uv + vec2(0.5); - vec2 pixel = 1.0 / textureSize; - - if (lod > 0.0) - { - // Each subseqeuent mip level is half the size - float scale = 1.0 / pow(2.0, lod); - float offset = ((textureSize.y + 1.0) / textureSize.x); - - coord.x *= offset; - coord *= scale; - - coord.x += offset + pixel.x; - coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; - } - else - { - coord.x *= (textureSize.y / textureSize.x); - } - - // Do bilinear filtering - #ifndef OES_texture_float_linear - vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; - vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; - vec3 color3 = texture(projectedMap, coord + pixel).rgb; - vec3 color4 = texture(projectedMap, coord).rgb; - - vec2 texturePosition = coord * textureSize; - - float fu = fract(texturePosition.x); - float fv = fract(texturePosition.y); - - vec3 average1 = mix(color4, color2, fu); - vec3 average2 = mix(color1, color3, fu); - - vec3 color = mix(average1, average2, fv); - #else - vec3 color = texture(projectedMap, coord).rgb; - #endif - - return color; -} - - -/** - * Samples from a cube map that has been projected using an octahedral projection from the given direction. +const float czm_sceneModeMorphing = 0.0; +`;var aO=`/** + * A built-in GLSL floating-point constant for one solar radius. * - * @name czm_sampleOctahedralProjection - * @glslFunction + * @alias czm_solarRadius + * @glslConstant * - * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. - * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. - * @param {vec3} direction The normalized direction used to sample the cube map. - * @param {float} lod The level of detail to sample. - * @param {float} maxLod The maximum level of detail. - * @returns {vec3} The color of the cube map at the direction. + * @see CesiumMath.SOLAR_RADIUS + * + * @example + * // GLSL declaration + * const float czm_solarRadius = ...; */ -vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { - float currentLod = floor(lod + 0.5); - float nextLod = min(currentLod + 1.0, maxLod); - - vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); - vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); - - return mix(colorNextLod, colorCurrentLod, nextLod - lod); -} -`;var qO=`/** - * Adjusts the saturation of a color. - * - * @name czm_saturation - * @glslFunction - * - * @param {vec3} rgb The color. - * @param {float} adjustment The amount to adjust the saturation of the color. +const float czm_solarRadius = 695500000.0; +`;var cO=`/** + * A built-in GLSL floating-point constant for <code>3pi/2</code>. * - * @returns {float} The color with the saturation adjusted. + * @alias czm_threePiOver2 + * @glslConstant + * + * @see CesiumMath.THREE_PI_OVER_TWO * * @example - * vec3 greyScale = czm_saturation(color, 0.0); - * vec3 doubleSaturation = czm_saturation(color, 2.0); + * // GLSL declaration + * const float czm_threePiOver2 = ...; + * + * // Example + * float pi = (2.0 / 3.0) * czm_threePiOver2; */ -vec3 czm_saturation(vec3 rgb, float adjustment) -{ - // Algorithm from Chapter 16 of OpenGL Shading Language - const vec3 W = vec3(0.2125, 0.7154, 0.0721); - vec3 intensity = vec3(dot(rgb, W)); - return mix(intensity, rgb, adjustment); -} -`;var XO=` -float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) -{ - return czm_unpackDepth(czm_textureCube(shadowMap, d)); -} - -float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) -{ -#ifdef USE_SHADOW_DEPTH_TEXTURE - return texture(shadowMap, uv).r; -#else - return czm_unpackDepth(texture(shadowMap, uv)); -#endif -} - -float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} - -float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) -{ - return step(depth, czm_sampleShadowMap(shadowMap, uv)); -} -`;var KO=` -float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) -{ -#ifdef USE_NORMAL_SHADING -#ifdef USE_NORMAL_SHADING_SMOOTH - float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); -#else - float strength = step(0.0, nDotL); -#endif - visibility *= strength; -#endif - - visibility = max(visibility, darkness); - return visibility; -} - -#ifdef USE_CUBE_MAP_SHADOW -float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec3 uvw = shadowParameters.texCoords; - - depth -= depthBias; - float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#else -float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) -{ - float depthBias = shadowParameters.depthBias; - float depth = shadowParameters.depth; - float nDotL = shadowParameters.nDotL; - float normalShadingSmooth = shadowParameters.normalShadingSmooth; - float darkness = shadowParameters.darkness; - vec2 uv = shadowParameters.texCoords; - - depth -= depthBias; -#ifdef USE_SOFT_SHADOWS - vec2 texelStepSize = shadowParameters.texelStepSize; - float radius = 1.0; - float dx0 = -texelStepSize.x * radius; - float dy0 = -texelStepSize.y * radius; - float dx1 = texelStepSize.x * radius; - float dy1 = texelStepSize.y * radius; - float visibility = ( - czm_shadowDepthCompare(shadowMap, uv, depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + - czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) - ) * (1.0 / 9.0); -#else - float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); -#endif - - return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); -} -#endif -`;var JO=`/** - * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL - * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0. - * - * @name czm_signNotZero - * @glslFunction +const float czm_threePiOver2 = 4.71238898038469; +`;var lO=`/** + * A built-in GLSL floating-point constant for <code>2pi</code>. * - * @param {} value The value for which to determine the sign. - * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. - */ -float czm_signNotZero(float value) -{ - return value >= 0.0 ? 1.0 : -1.0; -} - -vec2 czm_signNotZero(vec2 value) -{ - return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); -} - -vec3 czm_signNotZero(vec3 value) -{ - return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); -} - -vec4 czm_signNotZero(vec4 value) -{ - return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); -} -`;var ZO=`/** - * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. - * <p> - * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. - * </p> + * @alias czm_twoPi + * @glslConstant * - * @name czm_sphericalHarmonics - * @glslFunction + * @see CesiumMath.TWO_PI * - * @param {vec3} normal The normalized direction. - * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. - * @returns {vec3} The color at the direction. + * @example + * // GLSL declaration + * const float czm_twoPi = ...; * - * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + * // Example + * float pi = czm_twoPi / 2.0; */ -vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) -{ - vec3 L00 = coefficients[0]; - vec3 L1_1 = coefficients[1]; - vec3 L10 = coefficients[2]; - vec3 L11 = coefficients[3]; - vec3 L2_2 = coefficients[4]; - vec3 L2_1 = coefficients[5]; - vec3 L20 = coefficients[6]; - vec3 L21 = coefficients[7]; - vec3 L22 = coefficients[8]; - - float x = normal.x; - float y = normal.y; - float z = normal.z; - - return - L00 - + L1_1 * y - + L10 * z - + L11 * x - + L2_2 * (y * x) - + L2_1 * (y * z) - + L20 * (3.0 * z * z - 1.0) - + L21 * (z * x) - + L22 * (x * x - y * y); -} -`;var QO=`/** - * Converts an sRGB color to a linear RGB color. +const float czm_twoPi = 6.283185307179586; +`;var uO=`/** + * The maximum latitude, in radians, both North and South, supported by a Web Mercator + * (EPSG:3857) projection. Technically, the Mercator projection is defined + * for any latitude up to (but not including) 90 degrees, but it makes sense + * to cut it off sooner because it grows exponentially with increasing latitude. + * The logic behind this particular cutoff value, which is the one used by + * Google Maps, Bing Maps, and Esri, is that it makes the projection + * square. That is, the rectangle is equal in the X and Y directions. * - * @param {vec3|vec4} srgbIn The color in sRGB space - * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + * The constant value is computed as follows: + * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) + * + * @name czm_webMercatorMaxLatitude + * @glslConstant */ -vec3 czm_srgbToLinear(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -vec4 czm_srgbToLinear(vec4 srgbIn) +const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var fO=`/** + * @name czm_depthRangeStruct + * @glslStruct + */ +struct czm_depthRangeStruct { - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} -`;var $O=`/** - * Creates a matrix that transforms vectors from tangent space to eye space. - * - * @name czm_tangentToEyeSpaceMatrix - * @glslFunction - * - * @param {vec3} normalEC The normal vector in eye coordinates. - * @param {vec3} tangentEC The tangent vector in eye coordinates. - * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + float near; + float far; +}; +`;var dO=`/** + * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * - * @returns {mat3} The matrix that transforms from tangent space to eye space. + * @name czm_material + * @glslStruct * - * @example - * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); - * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} specular Intensity of incoming light reflecting in a single direction. + * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. */ -mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +struct czm_material { - vec3 normal = normalize(normalEC); - vec3 tangent = normalize(tangentEC); - vec3 bitangent = normalize(bitangentEC); - return mat3(tangent.x , tangent.y , tangent.z, - bitangent.x, bitangent.y, bitangent.z, - normal.x , normal.y , normal.z); -} -`;var eR=`/** - * A wrapper around the texture (WebGL2) / textureCube (WebGL1) - * function to allow for WebGL 1 support. - * - * @name czm_textureCube - * @glslFunction + vec3 diffuse; + float specular; + float shininess; + vec3 normal; + vec3 emission; + float alpha; +}; +`;var mO=`/** + * Used as input to every material's czm_getMaterial function. * - * @param {samplerCube} sampler The sampler. - * @param {vec3} p The coordinates to sample the texture at. - */ -vec4 czm_textureCube(samplerCube sampler, vec3 p) { -#if __VERSION__ == 300 - return texture(sampler, p); -#else - return textureCube(sampler, p); -#endif -}`;var tR=`/** - * Transforms a plane. - * - * @name czm_transformPlane - * @glslFunction + * @name czm_materialInput + * @glslStruct * - * @param {vec4} plane The plane in Hessian Normal Form. - * @param {mat4} transform The inverse-transpose of a transformation matrix. + * @property {float} s 1D texture coordinates. + * @property {vec2} st 2D texture coordinates. + * @property {vec3} str 3D texture coordinates. + * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. + * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. + * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. + * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. + * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. + * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. */ -vec4 czm_transformPlane(vec4 plane, mat4 transform) { - vec4 transformedPlane = transform * plane; - // Convert the transformed plane to Hessian Normal Form - float normalMagnitude = length(transformedPlane.xyz); - return transformedPlane / normalMagnitude; -} -`;var nR=`/** - * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3}, - * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to - * be relative to the eye. As shown in the example, the position can then be transformed in eye - * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, - * respectively. +struct czm_materialInput +{ + float s; + vec2 st; + vec3 str; + vec3 normalEC; + mat3 tangentToEyeMatrix; + vec3 positionToEyeEC; + float height; + float slope; + float aspect; +}; +`;var hO=`/** + * Struct for representing a material for a {@link Model}. The model + * rendering pipeline will pass this struct between material, custom shaders, + * and lighting stages. This is not to be confused with {@link czm_material} + * which is used by the older Fabric materials system, although they are similar. * <p> - * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as - * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + * All color values (diffuse, specular, emissive) are in linear color space. * </p> * - * @name czm_translateRelativeToEye - * @glslFunction + * @name czm_modelMaterial + * @glslStruct * - * @param {vec3} high The position's high bits. - * @param {vec3} low The position's low bits. - * @returns {vec3} The position translated to be relative to the camera's position. + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. + * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. + * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. + * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. + * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + */ +struct czm_modelMaterial { + vec3 diffuse; + float alpha; + vec3 specular; + float roughness; + vec3 normalEC; + float occlusion; + vec3 emissive; +}; +`;var pO=`/** + * Struct for representing the output of a custom vertex shader. + * + * @name czm_modelVertexOutput + * @glslStruct * - * @example - * in vec3 positionHigh; - * in vec3 positionLow; + * @see {@link CustomShader} + * @see {@link Model} * - * void main() - * { - * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - * gl_Position = czm_modelViewProjectionRelativeToEye * p; - * } + * @property {vec3} positionMC The position of the vertex in model coordinates + * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. + */ +struct czm_modelVertexOutput { + vec3 positionMC; + float pointSize; +}; +`;var _O=`/** + * Parameters for {@link czm_pbrLighting} * - * @see czm_modelViewRelativeToEye - * @see czm_modelViewProjectionRelativeToEye - * @see czm_computePosition - * @see EncodedCartesian3 + * @name czm_material + * @glslStruct + * + * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation + * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. + * @property {vec3} f0 The reflectance of the material at normal incidence */ -vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +struct czm_pbrParameters { - vec3 highDifference = high - czm_encodedCameraPositionMCHigh; - vec3 lowDifference = low - czm_encodedCameraPositionMCLow; + vec3 diffuseColor; + float roughness; + vec3 f0; +}; +`;var gO=`/** + * DOC_TBA + * + * @name czm_ray + * @glslStruct + */ +struct czm_ray +{ + vec3 origin; + vec3 direction; +}; +`;var yO=`/** + * DOC_TBA + * + * @name czm_raySegment + * @glslStruct + */ +struct czm_raySegment +{ + float start; + float stop; +}; - return vec4(highDifference + lowDifference, 1.0); -} -`;var iR=`/** - * @private +/** + * DOC_TBA + * + * @name czm_emptyRaySegment + * @glslConstant */ -vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + +/** + * DOC_TBA + * + * @name czm_fullRaySegment + * @glslConstant + */ +const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); +`;var xO=`struct czm_shadowParameters { - // Diffuse from directional light sources at eye (for top-down and horizon views) - float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +#ifdef USE_CUBE_MAP_SHADOW + vec3 texCoords; +#else + vec2 texCoords; +#endif - if (czm_sceneMode == czm_sceneMode3D) { - // (and horizon views in 3D) - diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); - } + float depthBias; + float depth; + float nDotL; + vec2 texelStepSize; + float normalShadingSmooth; + float darkness; +}; +`;var bO=`// See: +// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ - diffuse = clamp(diffuse, 0.0, 1.0); +vec3 czm_acesTonemapping(vec3 color) { + float g = 0.985; + float a = 0.065; + float b = 0.0001; + float c = 0.433; + float d = 0.238; - float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); + color = (color * (color + a) - b) / (color * (g * color + c) + d); - // Temporary workaround for adding ambient. - vec3 materialDiffuse = material.diffuse * 0.5; + color = clamp(color, 0.0, 1.0); - vec3 ambient = materialDiffuse; - vec3 color = ambient + material.emission; - color += materialDiffuse * diffuse * czm_lightColor; - color += material.specular * specular * czm_lightColor; + return color; +} +`;var CO=`/** + * @private + */ +float czm_alphaWeight(float a) +{ + float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - return vec4(color, material.alpha); + // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: + // http://jcgt.org/published/0002/02/09/ + return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } -`;var rR=`/** - * Returns the transpose of the matrix. The input <code>matrix</code> can be - * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>. +`;var TO=`/** + * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * - * @name czm_transpose + * @name czm_antialias * @glslFunction * - * @param {} matrix The matrix to transpose. - * - * @returns {} The transposed matrix. + * @param {vec4} color1 The color on one side of the edge. + * @param {vec4} color2 The color on the other side of the edge. + * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>. + * @param {float} dist The distance to the edge in texture coordinates. + * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. + * @returns {vec4} The anti-aliased color. * * @example * // GLSL declarations - * mat2 czm_transpose(mat2 matrix); - * mat3 czm_transpose(mat3 matrix); - * mat4 czm_transpose(mat4 matrix); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); * - * // Transpose a 3x3 rotation matrix to find its inverse. - * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( - * positionMC, normalEC); - * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space + * float dist = abs(textureCoordinates.t - 0.5); + * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); + * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); */ -mat2 czm_transpose(mat2 matrix) -{ - return mat2( - matrix[0][0], matrix[1][0], - matrix[0][1], matrix[1][1]); -} - -mat3 czm_transpose(mat3 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { - return mat3( - matrix[0][0], matrix[1][0], matrix[2][0], - matrix[0][1], matrix[1][1], matrix[2][1], - matrix[0][2], matrix[1][2], matrix[2][2]); + float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); + float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); + val1 = val1 * (1.0 - val2); + val1 = val1 * val1 * (3.0 - (2.0 * val1)); + val1 = pow(val1, 0.5); //makes the transition nicer + + vec4 midColor = (color1 + color2) * 0.5; + return mix(midColor, currentColor, val1); } -mat4 czm_transpose(mat4 matrix) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { - return mat4( - matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], - matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], - matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], - matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); + return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var oR=`/** - * Unpacks a vec4 depth value to a float in [0, 1) range. +`;var AO=`/** + * Approximately computes spherical coordinates given a normal. + * Uses approximate inverse trigonometry for speed and consistency, + * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. * - * @name czm_unpackDepth + * @name czm_approximateSphericalCoordinates * @glslFunction * - * @param {vec4} packedDepth The packed depth. + * @param {vec3} normal arbitrary-length normal. * - * @returns {float} The floating-point depth in [0, 1) range. + * @returns {vec2} Approximate latitude and longitude spherical coordinates. */ - float czm_unpackDepth(vec4 packedDepth) - { - // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); - } -`;var sR=`/** - * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. - * - * @name czm_unpackFloat - * @glslFunction - * - * @param {vec4} packedFloat The packed float. +vec2 czm_approximateSphericalCoordinates(vec3 normal) { + // Project into plane with vertical for latitude + float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); + float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); + return vec2(latitudeApproximation, longitudeApproximation); +} +`;var EO=`/** + * Determines if the fragment is back facing * - * @returns {float} The floating-point depth in arbitrary range. + * @name czm_backFacing + * @glslFunction + * + * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>. */ -float czm_unpackFloat(vec4 packedFloat) +bool czm_backFacing() { - // Convert to [0.0, 255.0] and round to integer - packedFloat = floor(packedFloat * 255.0 + 0.5); - float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; - float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; - if (exponent == -127.0) - { - return 0.0; - } - float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); - float result = sign * exp2(exponent - 23.0) * mantissa; - return result; + // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. + return gl_FrontFacing == false; } -`;var aR=`/** - * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, - * so the return value is an int. - * <p> - * There are also precision limitations in WebGL 1. highp int is still limited - * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. - * </p> +`;var SO=`/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a float expression. * - * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * @name czm_branchFreeTernary + * @glslFunction * - * @return {int} The unpacked value. - */ - int czm_unpackUint(float packedValue) { - float rounded = czm_round(packedValue * 255.0); - return int(rounded); - } - - int czm_unpackUint(vec2 packedValue) { - vec2 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec2(1.0, 256.0))); - } - - int czm_unpackUint(vec3 packedValue) { - vec3 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); - } - - int czm_unpackUint(vec4 packedValue) { - vec4 rounded = czm_round(packedValue * 255.0); - return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); - } -`;var cR=`/** - * Transform metadata values following the EXT_structural_metadata spec - * by multiplying by scale and adding the offset. Operations are always - * performed component-wise, even for matrices. - * - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply - * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * @param {bool} comparison A comparison statement + * @param {float} a Value to return if the comparison is true. + * @param {float} b Value to return if the comparison is false. * - * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + * @returns {float} equivalent of comparison ? a : b */ -float czm_valueTransform(float offset, float scale, float value) { - return scale * value + offset; +float czm_branchFreeTernary(bool comparison, float a, float b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec2 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec2} a Value to return if the comparison is true. + * @param {vec2} b Value to return if the comparison is false. + * + * @returns {vec2} equivalent of comparison ? a : b + */ +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec3 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } -vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { - return scale * value + offset; +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec4 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); } - -mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { - return matrixCompMult(scale, value) + offset; +`;var vO=` +vec4 czm_cascadeColor(vec4 weights) +{ + return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + + vec4(0.0, 1.0, 0.0, 1.0) * weights.y + + vec4(0.0, 0.0, 1.0, 1.0) * weights.z + + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } +`;var wO=` +uniform vec4 shadowMap_cascadeDistances; -mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { - return matrixCompMult(scale, value) + offset; +float czm_cascadeDistance(vec4 weights) +{ + return dot(shadowMap_cascadeDistances, weights); } +`;var IO=` +uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { - return matrixCompMult(scale, value) + offset; +mat4 czm_cascadeMatrix(vec4 weights) +{ + return shadowMap_cascadeMatrices[0] * weights.x + + shadowMap_cascadeMatrices[1] * weights.y + + shadowMap_cascadeMatrices[2] * weights.z + + shadowMap_cascadeMatrices[3] * weights.w; } -`;var lR=`#ifdef LOG_DEPTH -// 1.0 at the near plane, increasing linearly from there. -out float v_depthFromNearPlusOne; -#ifdef SHADOW_MAP -out vec3 v_logPositionEC; -#endif -#endif - -vec4 czm_updatePositionDepth(vec4 coords) { -#if defined(LOG_DEPTH) - -#ifdef SHADOW_MAP - vec3 logPositionEC = (czm_inverseProjection * coords).xyz; - v_logPositionEC = logPositionEC; -#endif - - // With the very high far/near ratios used with the logarithmic depth - // buffer, floating point rounding errors can cause linear depth values - // to end up on the wrong side of the far plane, even for vertices that - // are really nowhere near it. Since we always write a correct logarithmic - // depth value in the fragment shader anyway, we just need to make sure - // such errors don't cause the primitive to be clipped entirely before - // we even get to the fragment shader. - coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; -#endif +`;var DO=` +uniform vec4 shadowMap_cascadeSplits[2]; - return coords; +vec4 czm_cascadeWeights(float depthEye) +{ + // One component is set to 1.0 and all others set to 0.0. + vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); + vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); + return near * far; } - -/** - * Writes the logarithmic depth to gl_Position using the already computed gl_Position. +`;var PO=`/** + * DOC_TBA * - * @name czm_vertexLogDepth + * @name czm_columbusViewMorph * @glslFunction */ -void czm_vertexLogDepth() +vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; - gl_Position = czm_updatePositionDepth(gl_Position); -#endif + // Just linear for now. + vec3 p = mix(position2D.xyz, position3D.xyz, time); + return vec4(p, 1.0); } - -/** - * Writes the logarithmic depth to gl_Position using the provided clip coordinates. +`;var OO=`/** + * Returns a position in model coordinates relative to eye taking into + * account the current scene mode: 3D, 2D, or Columbus view. * <p> - * An example use case for this function would be moving the vertex in window coordinates - * before converting back to clip coordinates. Use the original vertex clip coordinates. + * This uses standard position attributes, <code>position3DHigh</code>, + * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, + * and should be used when writing a vertex shader for an {@link Appearance}. * </p> - * @name czm_vertexLogDepth + * + * @name czm_computePosition * @glslFunction * - * @param {vec4} clipCoords The vertex in clip coordinates. + * @returns {vec4} The position relative to eye. * * @example - * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + * vec4 p = czm_computePosition(); + * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * + * @see czm_translateRelativeToEye */ -void czm_vertexLogDepth(vec4 clipCoords) -{ -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; - czm_updatePositionDepth(clipCoords); -#endif -} -`;var uR=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +vec4 czm_computePosition(); +`;var RO=`/** + * @private + */ +vec2 cordic(float angle) { - // Reconstruct NDC coordinates - float x = 2.0 * screenCoordinate.x - 1.0; - float y = 2.0 * screenCoordinate.y - 1.0; - float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; - vec4 q = vec4(x, y, z, 1.0); - - // Reverse the perspective division to obtain clip coordinates. - q /= screenCoordinate.w; - - // Reverse the projection transformation to obtain eye coordinates. - if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s - { - q = czm_inverseProjection * q; - } - else - { - float top = czm_frustumPlanes.x; - float bottom = czm_frustumPlanes.y; - float left = czm_frustumPlanes.z; - float right = czm_frustumPlanes.w; - - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - - q.x = (q.x * (right - left) + left + right) * 0.5; - q.y = (q.y * (top - bottom) + bottom + top) * 0.5; - q.z = (q.z * (near - far) - near - far) * 0.5; - q.w = 1.0; - } +// Scale the vector by the appropriate factor for the 24 iterations to follow. + vec2 vector = vec2(6.0725293500888267e-1, 0.0); +// Iteration 1 + float sense = (angle < 0.0) ? -1.0 : 1.0; + // float factor = sense * 1.0; // 2^-0 + mat2 rotation = mat2(1.0, sense, -sense, 1.0); + vector = rotation * vector; + angle -= sense * 7.8539816339744828e-1; // atan(2^-0) +// Iteration 2 + sense = (angle < 0.0) ? -1.0 : 1.0; + float factor = sense * 5.0e-1; // 2^-1 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.6364760900080609e-1; // atan(2^-1) +// Iteration 3 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.5e-1; // 2^-2 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4497866312686414e-1; // atan(2^-2) +// Iteration 4 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.25e-1; // 2^-3 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2435499454676144e-1; // atan(2^-3) +// Iteration 5 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.25e-2; // 2^-4 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.2418809995957350e-2; // atan(2^-4) +// Iteration 6 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.125e-2; // 2^-5 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.1239833430268277e-2; // atan(2^-5) +// Iteration 7 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.5625e-2; // 2^-6 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5623728620476831e-2; // atan(2^-6) +// Iteration 8 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.8125e-3; // 2^-7 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.8123410601011111e-3; // atan(2^-7) +// Iteration 9 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.90625e-3; // 2^-8 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.9062301319669718e-3; // atan(2^-8) +// Iteration 10 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.953125e-3; // 2^-9 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9531225164788188e-3; // atan(2^-9) +// Iteration 11 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.765625e-4; // 2^-10 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.7656218955931946e-4; // atan(2^-10) +// Iteration 12 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.8828125e-4; // 2^-11 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.8828121119489829e-4; // atan(2^-11) +// Iteration 13 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.44140625e-4; // 2^-12 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4414062014936177e-4; // atan(2^-12) +// Iteration 14 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.220703125e-4; // 2^-13 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2207031189367021e-4; // atan(2^-13) +// Iteration 15 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.103515625e-5; // 2^-14 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.1035156174208773e-5; // atan(2^-14) +// Iteration 16 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.0517578125e-5; // 2^-15 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.0517578115526096e-5; // atan(2^-15) +// Iteration 17 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.52587890625e-5; // 2^-16 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5258789061315762e-5; // atan(2^-16) +// Iteration 18 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.62939453125e-6; // 2^-17 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.6293945311019700e-6; // atan(2^-17) +// Iteration 19 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.814697265625e-6; // 2^-18 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.8146972656064961e-6; // atan(2^-18) +// Iteration 20 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.9073486328125e-6; // 2^-19 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9073486328101870e-6; // atan(2^-19) +// Iteration 21 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.5367431640625e-7; // 2^-20 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.5367431640596084e-7; // atan(2^-20) +// Iteration 22 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.76837158203125e-7; // 2^-21 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.7683715820308884e-7; // atan(2^-21) +// Iteration 23 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.384185791015625e-7; // 2^-22 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.3841857910155797e-7; // atan(2^-22) +// Iteration 24 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.1920928955078125e-7; // 2^-23 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; +// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) - return q; + return vector; } /** - * Transforms a position from window to eye coordinates. - * The transform from window to normalized device coordinates is done using components - * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating - * the inverse of <code>czm_viewportTransformation</code>. The transformation from - * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>, - * which is expected to be the scalar used in the perspective divide. The transformation - * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * Computes the cosine and sine of the provided angle using the CORDIC algorithm. * - * @name czm_windowToEyeCoordinates + * @name czm_cosineAndSine * @glslFunction * - * @param {vec4} fragmentCoordinate The position in window coordinates to transform. - * - * @returns {vec4} The transformed position in eye coordinates. + * @param {float} angle The angle in radians. * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation + * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). * * @example - * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + * vec2 v = czm_cosineAndSine(czm_piOverSix); + * float cosine = v.x; + * float sine = v.y; */ -vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +vec2 czm_cosineAndSine(float angle) { - vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); + if (angle < -czm_piOverTwo || angle > czm_piOverTwo) + { + if (angle < 0.0) + { + return -cordic(angle + czm_pi); + } + else + { + return -cordic(angle - czm_pi); + } + } + else + { + return cordic(angle); + } } - -vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) -{ - // See reverseLogDepth.glsl. This is separate to re-use the pow. -#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) - float near = czm_currentFrustum.x; - float far = czm_currentFrustum.y; - float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; - float depthFromNear = pow(2.0, log2Depth) - 1.0; - float depthFromCamera = depthFromNear + near; - vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); - eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision - return eyeCoordinate; -#else - vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); - vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); -#endif - return eyeCoordinate; -} - -/** - * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. - * This function produces more accurate results for window positions with log depth than - * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version - * of czm_windowToEyeCoordinates. +`;var MO=`/** + * Decompresses texture coordinates that were packed into a single float. * - * @name czm_windowToEyeCoordinates + * @name czm_decompressTextureCoordinates * @glslFunction * - * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. - * @param {float} depthOrLogDepth A depth or log depth for the fragment. - * - * @see czm_modelToWindowCoordinates - * @see czm_eyeToWindowCoordinates - * @see czm_inverseProjection - * @see czm_viewport - * @see czm_viewportTransformation + * @param {float} encoded The compressed texture coordinates. + * @returns {vec2} The decompressed texture coordinates. + */ + vec2 czm_decompressTextureCoordinates(float encoded) + { + float temp = encoded / 4096.0; + float xZeroTo4095 = floor(temp); + float stx = xZeroTo4095 / 4095.0; + float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; + return vec2(stx, sty); + } +`;var LO=`/** + * Get default parameters for physically based rendering. These defaults + * describe a rough dielectric (non-metal) surface (e.g. rough plastic). * - * @returns {vec4} The transformed position in eye coordinates. + * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} */ -vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +czm_pbrParameters czm_defaultPbrMaterial() { - vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; - return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); + czm_pbrParameters results; + results.diffuseColor = vec3(1.0); + results.roughness = 1.0; + + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + results.f0 = REFLECTANCE_DIELECTRIC; + return results; } -`;var fR=`// emulated noperspective -#if !defined(LOG_DEPTH) -in float v_WindowZ; +`;var NO=`// emulated noperspective +#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; #endif /** - * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane - * by writing the fragment's depth. See czm_depthClamp for more details. + * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. + * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, + * capping the shadow volume. More information here: + * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. * - * @name czm_writeDepthClamp + * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring + * no geometry gets clipped by setting the clip space z value to 0.0 and then + * sending the unaltered screen space z value (using emulated noperspective + * interpolation) to the frag shader where it is clamped to [0,1] and then + * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: + * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. + * + * When GL_EXT_frag_depth is not available, which is the case on some mobile + * devices, we must attempt to fix this only in the vertex shader. + * The approach is to clamp the z value to the far plane, which closes the + * shadow volume but also distorts the geometry, so there can still be artifacts + * on frustum seams. + * + * @name czm_depthClamp * @glslFunction * + * @param {vec4} coords The vertex in clip coordinates. + * @returns {vec4} The modified vertex. + * * @example - * out_FragColor = color; - * czm_writeDepthClamp(); + * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); * - * @see czm_depthClamp + * @see czm_writeDepthClamp */ -void czm_writeDepthClamp() +vec4 czm_depthClamp(vec4 coords) { -#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); -#endif -} -`;var dR=`#ifdef LOG_DEPTH -in float v_depthFromNearPlusOne; - -#ifdef POLYGON_OFFSET -uniform vec2 u_polygonOffset; -#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) + v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; + coords.z = 0.0; +#else + coords.z = min(coords.z, coords.w); #endif - #endif - -/** - * Writes the fragment depth to the logarithmic depth buffer. - * <p> - * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when - * ray-casting geometry using a full screen quad. - * </p> - * @name czm_writeLogDepth + return coords; +} +`;var FO=`/** + * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system + * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the + * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. + * <br /><br /> + * The ellipsoid is assumed to be centered at the model coordinate's origin. + * + * @name czm_eastNorthUpToEyeCoordinates * @glslFunction * - * @param {float} depth The depth coordinate, where 1.0 is on the near plane and - * depth increases in eye-space units from there + * @param {vec3} positionMC The position on the ellipsoid in model coordinates. + * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates. + * + * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. * * @example - * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + * // Transform a vector defined in the east-north-up coordinate + * // system, (0, 0, 1) which is the surface normal, to eye + * // coordinates. + * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); */ -void czm_writeLogDepth(float depth) +mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { -#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - // Discard the vertex if it's not between the near and far planes. - // We allow a bit of epsilon on the near plane comparison because a 1.0 - // from the vertex shader (indicating the vertex should be _on_ the near - // plane) will not necessarily come here as exactly 1.0. - if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { - discard; - } - -#ifdef POLYGON_OFFSET - // Polygon offset: m * factor + r * units - float factor = u_polygonOffset[0]; - float units = u_polygonOffset[1]; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // This factor doesn't work in IE 10 - if (factor != 0.0) { - // m = sqrt(dZdX^2 + dZdY^2); - float x = dFdx(depth); - float y = dFdy(depth); - float m = sqrt(x * x + y * y); - - // Apply the factor before computing the log depth. - depth += m * factor; - } -#endif - -#endif - - gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; - -#ifdef POLYGON_OFFSET - // Apply the units after the log depth. - gl_FragDepth += czm_epsilon7 * units; -#endif + vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates + vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes + vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates -#endif + return mat3( + tangentEC.x, tangentEC.y, tangentEC.z, + bitangentEC.x, bitangentEC.y, bitangentEC.z, + normalEC.x, normalEC.y, normalEC.z); } - -/** - * Writes the fragment depth to the logarithmic depth buffer. - * <p> - * Use this when the vertex shader calls {@link czm_vertexlogDepth}. - * </p> +`;var BO=`/** + * DOC_TBA * - * @name czm_writeLogDepth + * @name czm_ellipsoidContainsPoint * @glslFunction + * */ -void czm_writeLogDepth() { -#ifdef LOG_DEPTH - czm_writeLogDepth(v_depthFromNearPlusOne); -#endif +bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +{ + vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; + return (dot(scaled, scaled) <= 1.0); } -`;var mR=`/** - * Transforms a value for non-perspective interpolation by multiplying - * it by w, the value used in the perspective divide. This function is - * intended to be called in a vertex shader to compute the value of a - * \`varying\` that should not be subject to perspective interpolation. - * For example, screen-space texture coordinates. The fragment shader - * must call {@link czm_readNonPerspective} to retrieve the final - * non-perspective value. +`;var kO=`/** + * DOC_TBA * - * @name czm_writeNonPerspective + * @name czm_ellipsoidWgs84TextureCoordinates + * @glslFunction + */ +vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +{ + return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); +} +`;var UO=`/** + * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code> + * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs + * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s, + * <code>vec3</code>s, or <code>vec4</code>s. + * + * @name czm_equalsEpsilon * @glslFunction * - * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. - * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. - * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the - * fragment shader with {@link czm_readNonPerspective}. + * @param {} left The first vector. + * @param {} right The second vector. + * @param {float} epsilon The epsilon to use for equality testing. + * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise. + * + * @example + * // GLSL declarations + * bool czm_equalsEpsilon(float left, float right, float epsilon); + * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); + * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); + * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); */ -float czm_writeNonPerspective(float value, float w) { - return value * w; +bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec4(epsilon))); } -vec2 czm_writeNonPerspective(vec2 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec3(epsilon))); } -vec3 czm_writeNonPerspective(vec3 value, float w) { - return value * w; +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec2(epsilon))); } -vec4 czm_writeNonPerspective(vec4 value, float w) { - return value * w; +bool czm_equalsEpsilon(float left, float right, float epsilon) { + return (abs(left - right) <= epsilon); } -`;var hR=`/** - * Converts a CIE Yxy color to RGB. - * <p>The conversion is described in - * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} - * </p> - * - * @name czm_XYZToRGB - * @glslFunction - * - * @param {vec3} Yxy The color in CIE Yxy. +`;var VO=`/** + * DOC_TBA * - * @returns {vec3} The color in RGB. + * @name czm_eyeOffset + * @glslFunction + * + * @param {vec4} positionEC DOC_TBA. + * @param {vec3} eyeOffset DOC_TBA. + * + * @returns {vec4} DOC_TBA. + */ +vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +{ + // This equation is approximate in x and y. + vec4 p = positionEC; + vec4 zEyeOffset = normalize(p) * eyeOffset.z; + p.xy += eyeOffset.xy + zEyeOffset.xy; + p.z += zEyeOffset.z; + return p; +} +`;var zO=`/** + * Transforms a position from eye to window coordinates. The transformation + * from eye to clip coordinates is done using {@link czm_projection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of <code>near = 0</code> and <code>far = 1</code>. + * <br /><br /> + * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * + * @name czm_eyeToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in eye coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_projection + * @see czm_viewportTransformation + * @see BillboardCollection * * @example - * vec3 xyz = czm_RGBToXYZ(rgb); - * xyz.x = max(xyz.x - luminanceThreshold, 0.0); - * rgb = czm_XYZToRGB(xyz); + * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); */ -vec3 czm_XYZToRGB(vec3 Yxy) +vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { - const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, - -1.5371, 1.8760, -0.2040, - -0.4985, 0.0416, 1.0572); - vec3 xyz; - xyz.r = Yxy.r * Yxy.g / Yxy.b; - xyz.g = Yxy.r; - xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; - - return XYZ2RGB * xyz; + vec4 q = czm_projection * positionEC; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var HO=`/** + * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. + * + * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on + * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + * Adapted from ShaderFastLibs under MIT License. + * + * Chosen for the following characteristics over range [0, 1]: + * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) + * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) + * + * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); + * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between 0 and 1 inclusive. + * + * @returns {float} Approximation of atan(x) + */ +float czm_fastApproximateAtan(float x) { + return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } -`;var pR=`vec3 czm_fromCartesian(vec3 position) { - vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); - vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); - float centerToleranceSquared = 0.1; - - vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); - - vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); - n = normalize(n); - - vec3 h = p - position; - - float longitude = atan(n.y, n.x); - float latitude = asin(n.z); - - float dotNum = dot(h, position); - // float height = MathSign(dotNum)*czm_magnitude(h); - float height = czm_magnitude(h); - vec3 result; - result.x = longitude; - result.y = latitude; - result.z = height; - return result; -}`;var _R=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ - for(int i=0;i<=16;i++){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ - if(xyxy[0][0]<minx){ - minx = xyxy[0][0]; - } - if(xyxy[0][0]>maxx){ - maxx = xyxy[0][0]; - } +/** + * Approximation of atan2. + * + * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html + * However, we replaced their atan curve with Michael Drobot's (see above). + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between -1 and 1 inclusive. + * @param {float} y Value between -1 and 1 inclusive. + * + * @returns {float} Approximation of atan2(x, y) + */ +float czm_fastApproximateAtan(float x, float y) { + // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. + // So range-reduce using abs and by flipping whether x or y is on top. + float t = abs(x); // t used as swap and atan result. + float opposite = abs(y); + float adjacent = max(t, opposite); + opposite = min(t, opposite); - if(xyxy[0][1]<miny){ - miny = xyxy[0][1]; - } - if(xyxy[0][1]>maxy){ - maxy = xyxy[0][1]; - } + t = czm_fastApproximateAtan(opposite / adjacent); - if(xyxy[0][2]<minz){ - minz = xyxy[0][2]; - } - if(xyxy[0][2]>maxz){ - maxz = xyxy[0][2]; - } - } - } - return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); + // Undo range reduction + t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); + t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); + t = czm_branchFreeTernary(y < 0.0, -t, t); + return t; +} +`;var GO=`/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-(scalar * scalar)); + return mix(color, fogColor, fog); } +/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * @param {float} fogModifierConstant A constant to modify the appearance of fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); + return mix(color, fogColor, fog); +} +`;var WO=`/** + * Converts a color from RGB space to linear space. + * + * @name czm_gammaCorrect + * @glslFunction + * + * @param {vec3} color The color in RGB space. + * @returns {vec3} The color in linear space. + */ +vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR + color = pow(color, vec3(czm_gamma)); +#endif + return color; +} - -`;var gR=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); - if(index==0){ - return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); - } - if(index==1){ - return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); - } - if(index==2){ - return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); - } - if(index==3){ - return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); - } - if(index==4){ - return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); - } - if(index==5){ - return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); - } - if(index==6){ - return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); - } - if(index==7){ - return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); - } - if(index==8){ - return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); - } - if(index==9){ - return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); - } - if(index==10){ - return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); - } - if(index==11){ - return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); - } - if(index==12){ - return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); - } - if(index==13){ - return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); - } - if(index==14){ - return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); - } - if(index==15){ - return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); - } -}`;var yR=`int czm_getMaxIndex(mat4 yp_mat_x){ - if(yp_mat_x[3][3]!=0.0){ - return 16; - } - if(yp_mat_x[3][2]!=0.0){ - return 15; - } - if(yp_mat_x[3][1]!=0.0){ - return 14; - } - if(yp_mat_x[3][0]!=0.0){ - return 15; - } - if(yp_mat_x[2][3]!=0.0){ - return 12; - } - if(yp_mat_x[2][2]!=0.0){ - return 11; - } - if(yp_mat_x[2][1]!=0.0){ - return 10; - } - if(yp_mat_x[2][0]!=0.0){ - return 9; - } - if(yp_mat_x[1][3]!=0.0){ - return 8; - } - if(yp_mat_x[1][2]!=0.0){ - return 7; - } - if(yp_mat_x[1][1]!=0.0){ - return 6; - } - if(yp_mat_x[1][0]!=0.0){ - return 5; - } - if(yp_mat_x[0][3]!=0.0){ - return 4; - } - if(yp_mat_x[0][2]!=0.0){ - return 3; - } - if(yp_mat_x[0][1]!=0.0){ - return 2; - } - if(yp_mat_x[0][0]!=0.0){ - return 1; - } -}`;var AR=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ - if(yp_max_index==0){ - return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); - } - if(yp_max_index==1){ - return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); - } - if(yp_max_index==2){ - return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); - } - if(yp_max_index==3){ - return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); - } - if(yp_max_index==4){ - return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); - } - if(yp_max_index==5){ - return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); - } - if(yp_max_index==6){ - return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); - } - if(yp_max_index==7){ - return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); - } - if(yp_max_index==8){ - return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); - } - if(yp_max_index==9){ - return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); - } - if(yp_max_index==10){ - return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); - } - if(yp_max_index==11){ - return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); - } - if(yp_max_index==12){ - return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); - } - if(yp_max_index==13){ - return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); - } - if(yp_max_index==14){ - return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); - } - if(yp_max_index==15){ - return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); - } -}`;var xR=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - float pz = position.z; - if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ - vec3 lonlat = czm_fromCartesian(position); - px = lonlat.x; - py = lonlat.y; - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); - vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); - vec3 llh1 = czm_fromCartesian(pos1); - vec3 llh2 = czm_fromCartesian(pos2); - float sx = llh1.x; - float sy = llh1.y; - float tx = llh2.x; - float ty = llh2.y; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - return isIn ? true : false; -}`;var CR=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { - bool isIn = false; - float px = position.x; - float py = position.y; - if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ - for(int i = 0;i <= 16; i++){ - vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); - if(currVal.x!=0.0&&currVal.y!=0.0){ - mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); - float sx = xyxy[0][0]; - float sy = xyxy[0][1]; - float tx = xyxy[1][0]; - float ty = xyxy[1][1]; - if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - float x = sx + (py - sy) * (tx - sx) / (ty - sy); - if(x == px) { - return true; - } - if(x > px) { - isIn = !isIn; - } - } - } - } - } - } - return isIn ? true : false; -}`;var TR=`float czm_magnitude(vec3 cartesian3) { - return sqrt(czm_magnitudeSquared(cartesian3)); -}`;var ER=`float czm_magnitudeSquared (vec3 cartesian4) { - return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; -}`;var bR=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { - vec3 result; - result.x = left.x * right.x; - result.y = left.y * right.y; - result.z = left.z * right.z; - return result; -}`;var SR=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { - - float positionX = cartesian1.x; - float positionY = cartesian1.y; - float positionZ = cartesian1.z; - - float oneOverRadiiX = oneOverRadii.x; - float oneOverRadiiY = oneOverRadii.y; - float oneOverRadiiZ = oneOverRadii.z; - - float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; - float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; - float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; - - // Compute the squared ellipsoid norm. - float squaredNorm = x2 + y2 + z2; - float ratio = sqrt(1.0 / squaredNorm); - - // As an initial approximation, assume that the radial intersection is the projection point. - vec3 intersection = cartesian1*ratio; - - - float oneOverRadiiSquaredX = oneOverRadiiSquared.x; - float oneOverRadiiSquaredY = oneOverRadiiSquared.y; - float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; - - // Use the gradient at the intersection point in place of the true unit normal. - // The difference in magnitude will be absorbed in the multiplier. - vec3 gradient; - gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; - gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; - gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - - // Compute the initial guess at the normal vector multiplier, lambda. - float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); - float correction = 0.0; - - float func; - float denominator; - float xMultiplier; - float yMultiplier; - float zMultiplier; - float xMultiplier2; - float yMultiplier2; - float zMultiplier2; - float xMultiplier3; - float yMultiplier3; - float zMultiplier3; - func = 1.0; - for(int i=0;i<9;i++){ - if(abs(func) > 0.000000000001){ - lambda -= correction; - - xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); - yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); - zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); - - xMultiplier2 = xMultiplier * xMultiplier; - yMultiplier2 = yMultiplier * yMultiplier; - zMultiplier2 = zMultiplier * zMultiplier; - - xMultiplier3 = xMultiplier2 * xMultiplier; - yMultiplier3 = yMultiplier2 * yMultiplier; - zMultiplier3 = zMultiplier2 * zMultiplier; - - func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - - // "denominator" here refers to the use of this expression in the velocity and acceleration - // computations in the sections to follow. - denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - - float derivative = -2.0 * denominator; - - correction = func / derivative; - - }else{ - break; - } - } - - vec3 result; - result.x = positionX * xMultiplier; - result.y = positionY * yMultiplier; - result.z = positionZ * zMultiplier; - return result; -}`;var zx={czm_degreesPerRadian:YP,czm_depthRange:qP,czm_epsilon1:XP,czm_epsilon2:KP,czm_epsilon3:JP,czm_epsilon4:ZP,czm_epsilon5:QP,czm_epsilon6:$P,czm_epsilon7:e1,czm_infinity:t1,czm_oneOverPi:n1,czm_oneOverTwoPi:i1,czm_passCesium3DTile:r1,czm_passCesium3DTileClassification:o1,czm_passCesium3DTileClassificationIgnoreShow:s1,czm_passClassification:a1,czm_passCompute:c1,czm_passEnvironment:l1,czm_passGlobe:u1,czm_passOpaque:f1,czm_passOverlay:d1,czm_passTerrainClassification:m1,czm_passTranslucent:h1,czm_passVoxels:p1,czm_pi:_1,czm_piOverFour:g1,czm_piOverSix:y1,czm_piOverThree:A1,czm_piOverTwo:x1,czm_radiansPerDegree:C1,czm_sceneMode2D:T1,czm_sceneMode3D:E1,czm_sceneModeColumbusView:b1,czm_sceneModeMorphing:S1,czm_solarRadius:v1,czm_threePiOver2:w1,czm_twoPi:D1,czm_webMercatorMaxLatitude:I1,czm_depthRangeStruct:P1,czm_material:O1,czm_materialInput:R1,czm_modelMaterial:M1,czm_modelVertexOutput:B1,czm_pbrParameters:L1,czm_ray:N1,czm_raySegment:F1,czm_shadowParameters:U1,czm_acesTonemapping:V1,czm_alphaWeight:k1,czm_antialias:z1,czm_approximateSphericalCoordinates:H1,czm_backFacing:G1,czm_branchFreeTernary:W1,czm_cascadeColor:j1,czm_cascadeDistance:Y1,czm_cascadeMatrix:q1,czm_cascadeWeights:X1,czm_columbusViewMorph:K1,czm_computePosition:J1,czm_cosineAndSine:Z1,czm_decompressTextureCoordinates:Q1,czm_defaultPbrMaterial:$1,czm_depthClamp:eO,czm_eastNorthUpToEyeCoordinates:tO,czm_ellipsoidContainsPoint:nO,czm_ellipsoidWgs84TextureCoordinates:iO,czm_equalsEpsilon:rO,czm_eyeOffset:oO,czm_eyeToWindowCoordinates:sO,czm_fastApproximateAtan:aO,czm_fog:cO,czm_gammaCorrect:lO,czm_geodeticSurfaceNormal:uO,czm_getDefaultMaterial:fO,czm_getLambertDiffuse:dO,czm_getSpecular:mO,czm_getWaterNoise:hO,czm_HSBToRGB:pO,czm_HSLToRGB:_O,czm_hue:gO,czm_inverseGamma:yO,czm_isEmpty:AO,czm_isFull:xO,czm_latitudeToWebMercatorFraction:CO,czm_linearToSrgb:TO,czm_lineDistance:EO,czm_luminance:bO,czm_metersPerPixel:SO,czm_modelToWindowCoordinates:vO,czm_multiplyWithColorBalance:wO,czm_nearFarScalar:DO,czm_octDecode:IO,czm_packDepth:PO,czm_pbrLighting:OO,czm_pbrMetallicRoughnessMaterial:RO,czm_pbrSpecularGlossinessMaterial:MO,czm_phong:BO,czm_planeDistance:LO,czm_pointAlongRay:NO,czm_rayEllipsoidIntersectionInterval:FO,czm_raySphereIntersectionInterval:UO,czm_readDepth:VO,czm_readNonPerspective:kO,czm_reverseLogDepth:zO,czm_RGBToHSB:HO,czm_RGBToHSL:GO,czm_RGBToXYZ:WO,czm_round:jO,czm_sampleOctahedralProjection:YO,czm_saturation:qO,czm_shadowDepthCompare:XO,czm_shadowVisibility:KO,czm_signNotZero:JO,czm_sphericalHarmonics:ZO,czm_srgbToLinear:QO,czm_tangentToEyeSpaceMatrix:$O,czm_textureCube:eR,czm_transformPlane:tR,czm_translateRelativeToEye:nR,czm_translucentPhong:iR,czm_transpose:rR,czm_unpackDepth:oR,czm_unpackFloat:sR,czm_unpackUint:aR,czm_valueTransform:cR,czm_vertexLogDepth:lR,czm_windowToEyeCoordinates:uR,czm_writeDepthClamp:fR,czm_writeLogDepth:dR,czm_writeNonPerspective:mR,czm_XYZToRGB:hR,czm_fromCartesian:pR,czm_getFloodRect:_R,czm_getIndexMat:gR,czm_getMaxIndex:yR,czm_getMaxIndexVal:AR,czm_isInEllipsoid:xR,czm_isInObliq:CR,czm_magnitude:TR,czm_magnitudeSquared:ER,czm_multiplyComponents:bR,czm_scaleToGeodeticSurface:SR};function sbe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable -${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable -${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT"))):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var vR=sbe;function UJ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` -`;return i})}function VJ(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=UJ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function kJ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&hs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=VJ(i,hs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),kJ(r,t)}}))}function abe(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function cbe(e){let t=[],n=VJ("main",e,t);kJ(n,t),abe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} -`;return i.replace(n.glslSource,"")}function zJ(e,t,n){let i,r,o="",s=e.sources;if(l(s))for(i=0,r=s.length;i<r;++i)o+=` -#line 0 -${s[i]}`;o=UJ(o);let a;o=o.replace(/#version\s+(.*?)\n/gm,function(A,x){return a=x,` -`});let c=[];o=o.replace(/#extension.*\n/gm,function(A){return c.push(A),` -`}),o=o.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;l(u)&&(o=hs.createPickFragmentShaderSource(o,u));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp int; -#else - precision mediump float; - precision mediump int; - #define highp mediump -#endif - -`);let p=e.defines;if(l(p))for(i=0,r=p.length;i<r;++i){let A=p[i];A.length!==0&&(f+=`#define ${A} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear - -`),n.floatingPointTexture&&(f+=`#define OES_texture_float - -`);let g="";e.includeBuiltIns&&(g=cbe(o)),f+=` -#line 0 -`;let h=g+o;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(h)&&!/czm_out_FragColor/g.test(h)&&/out_FragColor/g.test(h)&&(f+=`layout(location = 0) out vec4 out_FragColor; - -`),f+=g,f+=o,n.webgl2?f=`#version 300 es -${f}`:f=vR(f,t),f}function hs(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}hs.prototype.clone=function(){return new hs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};hs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};hs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(` -`);return`${t}:${n}:${i}:${r}`};hs.prototype.createCombinedVertexShader=function(e){return zJ(this,!1,e)};hs.prototype.createCombinedFragmentShader=function(e){return zJ(this,!0,e)};hs._czmBuiltinsAndUniforms={};for(let e in zx)zx.hasOwnProperty(e)&&(hs._czmBuiltinsAndUniforms[e]=zx[e]);for(let e in i_)if(i_.hasOwnProperty(e)){let t=i_[e];typeof t.getDeclaration=="function"&&(hs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}hs.createPickVertexShaderSource=function(e){return`${hs.replaceMain(e,"czm_old_main")} -in vec4 pickColor; -out vec4 czm_pickColor; -void main() -{ - czm_old_main(); - czm_pickColor = pickColor; -}`};hs.createPickFragmentShaderSource=function(e,t){let n=hs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; -void main() -{ - czm_old_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = czm_pickColor; -}`;return`${n} -${i}`};function lbe(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function HJ(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function GJ(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(HJ(e,r))return r}}var ube=["v_normalEC","v_normal"];hs.findNormalVarying=function(e){return HJ(e,"#ifdef HAS_NORMALS")?lbe(e,"HAS_NORMALS")?"v_normalEC":void 0:GJ(e,ube)};var fbe=["v_positionEC"];hs.findPositionVarying=function(e){return GJ(e,fbe)};var He=hs;function Uf(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Uf.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Uf.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function dbe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Uf.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new He({sources:[t]})),typeof n=="string"&&(n=new He({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?dbe(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Uf.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){kG(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Uf.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};Uf.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new He({sources:[o]})),typeof s=="string"&&(s=new He({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function kG(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];kG(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Uf.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];kG(this,n),--this._numberOfShaders}this._shadersToRelease={}};Uf.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Uf.prototype.isDestroyed=function(){return!1};Uf.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var wR=Uf;function Vf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,r=e.source;l(r)&&(l(n)||(n=y(r.videoWidth,r.width)),l(i)||(i=y(r.videoHeight,r.height)));let o=y(e.pixelFormat,ct.RGBA),s=y(e.pixelDatatype,Qe.UNSIGNED_BYTE),a=ct.toInternalFormat(o,s,t),c=ct.isCompressedFormat(a),u=e.preMultiplyAlpha||o===ct.RGB||o===ct.LUMINANCE,f=y(e.flipY,!0),d=y(e.skipColorSpaceConversion,!1),p=!0,g=t._gl,h=g.TEXTURE_2D,A=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(h,A);let x=4;if(l(r)&&l(r.arrayBufferView)&&!c&&(x=ct.alignmentInBytes(o,s,n)),g.pixelStorei(g.UNPACK_ALIGNMENT,x),d?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(r))if(l(r.arrayBufferView)){g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1);let T=r.arrayBufferView,E,S,w;if(c){if(g.compressedTexImage2D(h,0,a,n,i,0,T),l(r.mipLevels))for(S=n,w=i,E=0;E<r.mipLevels.length;++E)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.compressedTexImage2D(h,E+1,a,S,w,0,r.mipLevels[E])}else if(f&&(T=ct.flipY(T,o,s,n,i)),g.texImage2D(h,0,a,n,i,0,o,Qe.toWebGLConstant(s,t),T),l(r.mipLevels))for(S=n,w=i,E=0;E<r.mipLevels.length;++E)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.texImage2D(h,E+1,a,S,w,0,o,Qe.toWebGLConstant(s,t),r.mipLevels[E])}else l(r.framebuffer)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._bind(),g.copyTexImage2D(h,0,a,r.xOffset,r.yOffset,n,i,0),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._unBind()):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,f),g.texImage2D(h,0,a,o,Qe.toWebGLConstant(s,t),r));else g.texImage2D(h,0,a,n,i,0,o,Qe.toWebGLConstant(s,t),null),p=!1;g.bindTexture(h,null);let C;c?C=ct.compressedTextureSizeInBytes(o,n,i):C=ct.textureSizeInBytes(o,s,n,i),this._id=jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=h,this._texture=A,this._internalFormat=a,this._pixelFormat=o,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new H(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=u,this._flipY=f,this._initialized=p,this._sampler=void 0,this.sampler=l(e.sampler)?e.sampler:new mn}Vf.create=function(e){return new Vf(e)};Vf.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=y(e.pixelFormat,ct.RGB),r=y(e.framebufferXOffset,0),o=y(e.framebufferYOffset,0),s=y(e.width,n.drawingBufferWidth),a=y(e.height,n.drawingBufferHeight),c=e.framebuffer;return new Vf({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:r,yOffset:o,width:s,height:a}})};Object.defineProperties(Vf.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,r=this._pixelFormat,o=this._pixelDatatype,s=t===un.NEAREST_MIPMAP_NEAREST||t===un.NEAREST_MIPMAP_LINEAR||t===un.LINEAR_MIPMAP_NEAREST||t===un.LINEAR_MIPMAP_LINEAR;(o===Qe.FLOAT&&!i.textureFloatLinear||o===Qe.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?un.NEAREST_MIPMAP_NEAREST:un.NEAREST,n=bi.NEAREST),i.webgl2&&ct.isDepthFormat(r)&&(t=un.NEAREST,n=bi.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});Vf.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context,o=r._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._width,d=this._height,p=this._internalFormat,g=this._pixelFormat,h=this._pixelDatatype,A=this._preMultiplyAlpha,x=this._flipY,C=y(e.skipColorSpaceConversion,!1),T=4;l(u)&&(T=ct.alignmentInBytes(g,h,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,T),C?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let E=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===d)l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,g,h,f,d)),o.texImage2D(s,0,p,f,d,0,g,Qe.toWebGLConstant(h,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texImage2D(s,0,p,g,Qe.toWebGLConstant(h,r),i)),E=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let S=ct.createTypedArray(g,h,f,d);o.texImage2D(s,0,p,f,d,0,g,Qe.toWebGLConstant(h,r),S)}this._initialized=!0}E||(l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,g,h,a,c)),o.texSubImage2D(s,0,t,n,a,c,g,Qe.toWebGLConstant(h,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texSubImage2D(s,0,t,n,g,Qe.toWebGLConstant(h,r),i))),o.bindTexture(s,null)};Vf.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._width),o=y(o,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};Vf.prototype.generateMipmap=function(e){e=y(e,Rh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Bt=Vf;function Ky(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Ky.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Ky.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Ky.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Ky.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Ky.prototype.isDestroyed=function(){return!1};Ky.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var DR=Ky;function im(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}im.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Mh={high:0,low:0};im.fromCartesian=function(e,t){l(t)||(t=new im);let n=t.high,i=t.low;return im.encode(e.x,Mh),n.x=Mh.high,i.x=Mh.low,im.encode(e.y,Mh),n.y=Mh.high,i.y=Mh.low,im.encode(e.z,Mh),n.z=Mh.high,i.z=Mh.low,t};var zG=new im;im.writeElements=function(e,t,n){im.fromCartesian(e,zG);let i=zG.high,r=zG.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Yn=im;function ps(e,t){this.normal=m.clone(e),this.distance=t}ps.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new ps(t,i)};var mbe=new m;ps.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,mbe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new ps(n,i)};ps.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var hbe=new m;ps.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=ps.getPointDistance(e,t),r=m.multiplyByScalar(e.normal,i,hbe);return m.subtract(t,r,n)};var pbe=new B,_be=new oe,gbe=new m;ps.transform=function(e,t,n){let i=e.normal,r=e.distance,o=B.inverseTranspose(t,pbe),s=oe.fromElements(i.x,i.y,i.z,r,_be);s=B.multiplyByVector(o,s,s);let a=m.fromCartesian4(s,gbe);return s=oe.divideByScalar(s,m.magnitude(a),s),ps.fromCartesian4(s,n)};ps.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new ps(e.normal,e.distance)};ps.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};ps.ORIGIN_XY_PLANE=Object.freeze(new ps(m.UNIT_Z,0));ps.ORIGIN_YZ_PLANE=Object.freeze(new ps(m.UNIT_X,0));ps.ORIGIN_ZX_PLANE=Object.freeze(new ps(m.UNIT_Y,0));var fn=ps;function Iu(e){this.planes=y(e,[])}var nS=[new m,new m,new m];m.clone(m.UNIT_X,nS[0]);m.clone(m.UNIT_Y,nS[1]);m.clone(m.UNIT_Z,nS[2]);var p_=new m,ybe=new m,WJ=new fn(new m(1,0,0),0);Iu.fromBoundingSphere=function(e,t){l(t)||(t=new Iu);let n=nS.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=nS[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),m.multiplyByScalar(c,-o,p_),m.add(r,p_,p_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-m.dot(c,p_),m.multiplyByScalar(c,o,p_),m.add(r,p_,p_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-m.dot(m.negate(c,ybe),p_),s+=2}return t};Iu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(fn.fromCartesian4(t[i],WJ));if(o===tn.OUTSIDE)return tn.OUTSIDE;o===tn.INTERSECTING&&(n=!0)}return n?tn.INTERSECTING:tn.INSIDE};Iu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Iu.MASK_OUTSIDE||t===Iu.MASK_INSIDE)return t;let n=Iu.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&!(t&s))continue;let a=e.intersectPlane(fn.fromCartesian4(i[r],WJ));if(a===tn.OUTSIDE)return Iu.MASK_OUTSIDE;a===tn.INTERSECTING&&(n|=s)}return n};Iu.MASK_OUTSIDE=4294967295;Iu.MASK_INSIDE=0;Iu.MASK_INDETERMINATE=2147483647;var is=Iu;function rm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new is,this._orthographicMatrix=new B}function jJ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=B.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(rm.prototype,{projectionMatrix:{get:function(){return jJ(this),this._orthographicMatrix}}});var Abe=new m,xbe=new m,Cbe=new m,HG=new m;rm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,Abe);m.normalize(f,f);let d=xbe;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=Cbe;m.multiplyByScalar(f,a,p),m.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new oe),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-m.dot(f,p),m.multiplyByScalar(f,s,p),m.add(d,p,p),g=i[1],l(g)||(g=i[1]=new oe),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-m.dot(m.negate(f,HG),p),m.multiplyByScalar(n,o,p),m.add(d,p,p),g=i[2],l(g)||(g=i[2]=new oe),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,r,p),m.add(d,p,p),g=i[3],l(g)||(g=i[3]=new oe),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,HG),p),g=i[4],l(g)||(g=i[4]=new oe),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,d),m.multiplyByScalar(t,u,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new oe),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,HG),p),this._cullingVolume};rm.prototype.getPixelDimensions=function(e,t,n,i,r){jJ(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};rm.prototype.clone=function(e){return l(e)||(e=new rm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};rm.prototype.equals=function(e){return l(e)&&e instanceof rm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};rm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof rm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Po=rm;function zc(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Po,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}zc.packedLength=4;zc.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};zc.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new zc),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function __(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(zc.prototype,{projectionMatrix:{get:function(){return __(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return __(this),this._offCenterFrustum}}});zc.prototype.computeCullingVolume=function(e,t,n){return __(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};zc.prototype.getPixelDimensions=function(e,t,n,i,r){return __(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};zc.prototype.clone=function(e){return l(e)||(e=new zc),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};zc.prototype.equals=function(e){return!l(e)||!(e instanceof zc)?!1:(__(this),__(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};zc.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof zc)?!1:(__(this),__(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var rn=zc;var GG={};function Tbe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var Ebe=32.184,bbe=2451545;function uZ(e,t){t=ee.addSeconds(e,Ebe,t);let n=ee.totalDays(t)-bbe;return t=ee.addSeconds(t,Tbe(n),t),t}var IR=new ee(2451545,0,Jn.TAI),Sbe=1e3,Pu=P.RADIANS_PER_DEGREE,Il=P.RADIANS_PER_ARCSECOND,fa=14959787e4,YJ=new Z;function fZ(e,t,n,i,r,o,s){n<0&&(n=-n,r+=P.PI);let a=e*(1-t),c=i-r,u=r,f=wbe(o-i,t),d=vbe(t,0);Rbe(c,n,u,YJ);let p=a*(1+t),g=Math.cos(f),h=Math.sin(f),A=1+t*g,x=p/A;return l(s)?(s.x=x*g,s.y=x*h,s.z=0):s=new m(x*g,x*h,0),Z.multiplyByVector(YJ,s,s)}function vbe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function wbe(e,t){let n=Pbe(e,t);return Obe(n,t)}var Dbe=50,Ibe=P.EPSILON8;function Pbe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<Dbe&&Math.abs(r-i)>Ibe;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function Obe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function Rbe(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var Mbe=1.0000010178*fa,Bbe=100.46645683*Pu,Lbe=129597742283429e-5*Il,qJ=16002,XJ=21863,KJ=32004,JJ=10931,ZJ=14529,QJ=16368,$J=15318,eZ=32794,Nbe=64*1e-7*fa,Fbe=-152*1e-7*fa,Ube=62*1e-7*fa,Vbe=-8*1e-7*fa,kbe=32*1e-7*fa,zbe=-41*1e-7*fa,Hbe=19*1e-7*fa,Gbe=-11*1e-7*fa,Wbe=-150*1e-7*fa,jbe=-46*1e-7*fa,Ybe=68*1e-7*fa,qbe=54*1e-7*fa,Xbe=14*1e-7*fa,Kbe=24*1e-7*fa,Jbe=-28*1e-7*fa,Zbe=22*1e-7*fa,tZ=10,nZ=16002,iZ=21863,rZ=10931,oZ=1473,sZ=32004,aZ=4387,cZ=73,Qbe=-325*1e-7,$be=-322*1e-7,eSe=-79*1e-7,tSe=232*1e-7,nSe=-52*1e-7,iSe=97*1e-7,rSe=55*1e-7,oSe=-41*1e-7,sSe=-105*1e-7,aSe=-137*1e-7,cSe=258*1e-7,lSe=35*1e-7,uSe=-116*1e-7,fSe=-88*1e-7,dSe=-112*1e-7,mSe=-80*1e-7,Hx=new ee(0,0,Jn.TAI);function hSe(e,t){uZ(e,Hx);let i=(Hx.dayNumber-IR.dayNumber+(Hx.secondsOfDay-IR.secondsOfDay)/Zn.SECONDS_PER_DAY)/(Zn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=Mbe+Nbe*Math.cos(qJ*r)+Wbe*Math.sin(qJ*r)+Fbe*Math.cos(XJ*r)+jbe*Math.sin(XJ*r)+Ube*Math.cos(KJ*r)+Ybe*Math.sin(KJ*r)+Vbe*Math.cos(JJ*r)+qbe*Math.sin(JJ*r)+kbe*Math.cos(ZJ*r)+Xbe*Math.sin(ZJ*r)+zbe*Math.cos(QJ*r)+Kbe*Math.sin(QJ*r)+Hbe*Math.cos($J*r)+Jbe*Math.sin($J*r)+Gbe*Math.cos(eZ*r)+Zbe*Math.sin(eZ*r),s=Bbe+Lbe*i+Qbe*Math.cos(tZ*r)+sSe*Math.sin(tZ*r)+$be*Math.cos(nZ*r)+aSe*Math.sin(nZ*r)+eSe*Math.cos(iZ*r)+cSe*Math.sin(iZ*r)+tSe*Math.cos(rZ*r)+lSe*Math.sin(rZ*r)+nSe*Math.cos(oZ*r)+uSe*Math.sin(oZ*r)+iSe*Math.cos(sZ*r)+fSe*Math.sin(sZ*r)+rSe*Math.cos(aZ*r)+dSe*Math.sin(aZ*r)+oSe*Math.cos(cZ*r)+mSe*Math.sin(cZ*r),a=.0167086342-.0004203654*i,c=102.93734808*Pu+11612.3529*Il*i,u=469.97289*Il*i,f=174.87317577*Pu-8679.27034*Il*i;return fZ(o,a,u,c,f,s,t)}function dZ(e,t){uZ(e,Hx);let i=(Hx.dayNumber-IR.dayNumber+(Hx.secondsOfDay-IR.secondsOfDay)/Zn.SECONDS_PER_DAY)/Zn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Pu,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Pu,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Pu,h=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,A=218.31664563*Pu,x=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,C=297.85019547*Pu+Il*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),T=93.27209062*Pu+Il*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),E=134.96340251*Pu+Il*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),S=357.52910918*Pu+Il*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),w=310.17137918*Pu-Il*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),D=2*C,R=4*C,O=6*C,L=2*E,N=3*E,_=4*E,b=2*T;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-E)-235.6*Math.cos(E)+218.1*Math.cos(D-S)+181*Math.cos(D+E),c+=.014216*Math.cos(D-E)+.008551*Math.cos(D-L)-.001383*Math.cos(E)+.001356*Math.cos(D+E)-.001147*Math.cos(R-N)-914e-6*Math.cos(R-L)+869e-6*Math.cos(D-S-E)-627e-6*Math.cos(D)-394e-6*Math.cos(R-_)+282e-6*Math.cos(D-S-L)-279e-6*Math.cos(C-E)-236e-6*Math.cos(L)+231e-6*Math.cos(R)+229e-6*Math.cos(O-_)-201e-6*Math.cos(L-b),f+=486.26*Math.cos(D-b)-40.13*Math.cos(D)+37.51*Math.cos(b)+25.73*Math.cos(L-b)+19.97*Math.cos(D-S-b),p+=-55609*Math.sin(D-E)-34711*Math.sin(D-L)-9792*Math.sin(E)+9385*Math.sin(R-N)+7505*Math.sin(R-L)+5318*Math.sin(D+E)+3484*Math.sin(R-_)-3417*Math.sin(D-S-E)-2530*Math.sin(O-_)-2376*Math.sin(D)-2075*Math.sin(D-N)-1883*Math.sin(L)-1736*Math.sin(O-5*E)+1626*Math.sin(S)-1370*Math.sin(O-N),h+=-5392*Math.sin(D-b)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(b)-288*Math.sin(L-b),x+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(D-S);let v=2*w,I=3*w;f+=46.997*Math.cos(w)*i-.614*Math.cos(D-b+w)*i+.614*Math.cos(D-b-w)*i-.0297*Math.cos(v)*r-.0335*Math.cos(w)*r+.0012*Math.cos(D-b+v)*r-16e-5*Math.cos(w)*o+4e-5*Math.cos(I)*o+4e-5*Math.cos(v)*o;let M=2.116*Math.sin(w)*i-.111*Math.sin(D-b-w)*i-.0015*Math.sin(w)*r;p+=M,x+=M,h+=-520.77*Math.sin(w)*i+13.66*Math.sin(D-b+w)*i+1.12*Math.sin(D-w)*i-1.06*Math.sin(b-w)*i+.66*Math.sin(v)*r+.371*Math.sin(w)*r-.035*Math.sin(D-b+v)*r-.015*Math.sin(D-b+w)*r+.0014*Math.sin(w)*o-.0011*Math.sin(I)*o-9e-4*Math.sin(v)*o,a*=Sbe;let F=u+f*Il,k=d+p*Il,V=A+x*Il,G=g+h*Il;return fZ(a,c,F,k,G,V,t)}var lZ=.012300034,pSe=lZ/(lZ+1)*-1;function _Se(e,t){return t=dZ(e,t),m.multiplyByScalar(t,pSe,t)}var mZ=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),iS=new m;GG.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),iS=hSe(e,iS),t=m.negate(iS,t),_Se(e,iS),m.subtract(t,iS,t),Z.multiplyByVector(mZ,t,t),t};GG.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=dZ(e,t),Z.multiplyByVector(mZ,t,t),t};var Jy=GG;var PR={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};PR.getMorphTime=function(e){return e===PR.SCENE3D?1:e===PR.MORPHING?void 0:0};var ne=Object.freeze(PR);function gSe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var g_=gSe;function Gx(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=B.clone(B.IDENTITY),this._viewportTransformation=B.clone(B.IDENTITY),this._model=B.clone(B.IDENTITY),this._view=B.clone(B.IDENTITY),this._inverseView=B.clone(B.IDENTITY),this._projection=B.clone(B.IDENTITY),this._infiniteProjection=B.clone(B.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.clone(B.IDENTITY),this._view3DDirty=!0,this._view3D=new B,this._inverseView3DDirty=!0,this._inverseView3D=new B,this._inverseModelDirty=!0,this._inverseModel=new B,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,this._inverseProjectionDirty=!0,this._inverseProjection=new B,this._modelViewDirty=!0,this._modelView=new B,this._modelView3DDirty=!0,this._modelView3D=new B,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new B,this._inverseModelViewDirty=!0,this._inverseModelView=new B,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new B,this._viewProjectionDirty=!0,this._viewProjection=new B,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new B,this._modelViewProjectionDirty=!0,this._modelViewProjection=new B,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new B,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new B,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new B,this._normalDirty=!0,this._normal=new Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Yn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(Gx.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return hZ(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return hZ(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){B.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,B.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,B.getMatrix3(this.inverseModel,e),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return WG(this),this._view3D}},viewRotation:{get:function(){return WG(this),this._viewRotation}},viewRotation3D:{get:function(){return WG(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return gZ(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return gZ(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return wSe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return DSe(this),this._modelView}},modelView3D:{get:function(){return ISe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return LSe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return PSe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return OSe(this),this._inverseModelView3D}},viewProjection:{get:function(){return RSe(this),this._viewProjection}},inverseViewProjection:{get:function(){return MSe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return BSe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return NSe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return FSe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return USe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return VSe(this),this._normal}},normal3D:{get:function(){return kSe(this),this._normal3D}},inverseNormal:{get:function(){return zSe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return HSe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return _Z(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return _Z(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,re.WGS84)}}});function ySe(e,t){B.clone(t,e._view),B.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function ASe(e,t){B.clone(t,e._inverseView),B.getMatrix3(t,e._inverseViewRotation)}function xSe(e,t){B.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function CSe(e,t){B.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function TSe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var rS=new Z,ESe=new he;function bSe(e,t){l(Mt.computeIcrfToFixedMatrix(t.time,rS))||(rS=Mt.computeTemeToPseudoFixedMatrix(t.time,rS));let n=Jy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(rS,n,n),m.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Jy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(rS,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,ESe);i.project(o,e._sunPositionColumbusView)}Gx.prototype.updateCamera=function(e){ySe(this,e.viewMatrix),ASe(this,e.inverseViewMatrix),TSe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof rn};Gx.prototype.updateFrustum=function(e){xSe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&CSe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};Gx.prototype.updatePass=function(e){this._pass=e};var SSe=[],vSe=new g_;Gx.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),bSe(this,e);let n=y(e.light,vSe);n instanceof g_?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=m.multiplyByScalar(r,n.intensity,r);let o=m.maximumComponent(r);o>1?m.divideByScalar(r,o,this._lightColor):m.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,SSe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function hZ(e){if(e._viewportDirty){let t=e._viewport;B.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),B.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function wSe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?B.inverse(e._projection,e._inverseProjection):B.clone(B.ZERO,e._inverseProjection))}function DSe(e){e._modelViewDirty&&(e._modelViewDirty=!1,B.multiplyTransformation(e._view,e._model,e._modelView))}function ISe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,B.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function PSe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,B.inverse(e.modelView,e._inverseModelView))}function OSe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,B.inverse(e.modelView3D,e._inverseModelView3D))}function RSe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,B.multiply(e._projection,e._view,e._viewProjection))}function MSe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,B.inverse(e.viewProjection,e._inverseViewProjection))}function BSe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,B.multiply(e._projection,e.modelView,e._modelViewProjection))}function LSe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function NSe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,B.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function FSe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,B.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function USe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,B.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function VSe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;B.getMatrix3(e.inverseModelView,t),Z.getRotation(t,t),Z.transpose(t,t)}}function kSe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;B.getMatrix3(e.inverseModelView3D,t),Z.getRotation(t,t),Z.transpose(t,t)}}function zSe(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,B.getMatrix3(e.inverseModelView,e._inverseNormal),Z.getRotation(e._inverseNormal,e._inverseNormal))}function HSe(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,B.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Z.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var pZ=new m;function _Z(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,B.multiplyByPoint(e.inverseModel,e._cameraPosition,pZ),Yn.fromCartesian(pZ,e._encodedCameraPositionMC))}var GSe=new m,WSe=new m,jSe=new m,YSe=new m,qSe=new he,XSe=new m,KSe=new B;function JSe(e,t,n,i,r,o,s,a){let c=GSe;c.x=e.y,c.y=e.z,c.z=e.x;let u=WSe;u.x=n.y,u.y=n.z,u.z=n.x;let f=jSe;f.x=i.y,f.y=i.z,f.z=i.x;let d=YSe;d.x=t.y,d.y=t.z,d.z=t.x,o===ne.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,qSe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,XSe),A=Mt.eastNorthUpToFixedFrame(h,g,KSe);return B.multiplyByPointAsVector(A,u,u),B.multiplyByPointAsVector(A,f,f),B.multiplyByPointAsVector(A,d,d),l(a)||(a=new B),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function WG(e){e._view3DDirty&&(e._mode===ne.SCENE3D?B.clone(e._view,e._view3D):JSe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),B.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function gZ(e){e._inverseView3DDirty&&(B.inverseTransformation(e.view3D,e._inverseView3D),B.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var OR=Gx;function ZSe(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function AZ(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Bh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)ZSe(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),AZ(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function yZ(e){return e.values.length/e.componentsPerAttribute}function QSe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function $Se(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=yZ(e[r[0]]),t=1;t<s;++t){let u=yZ(e[r[t]]);if(u!==o)throw new de(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=QSe(i);if(a>0){let u=X.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let h=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/h,strideInComponentType:a/h}}for(t=0;t<o;++t)for(let h=0;h<s;++h){n=r[h],i=e[n];let A=i.values,x=g[n],C=x.pointer,T=i.componentsPerAttribute;for(let E=0;E<T;++E)C[x.index+E]=A[t*T+E];x.index+=x.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Bh.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),r=y(e.attributeLocations,y.EMPTY_OBJECT),o=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let h=$Se(d);if(l(h)){u=ht.createVertexBuffer({context:t,typedArray:h.buffer,usage:i});let A=h.offsetsInBytes,x=h.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:A[a],strideInBytes:x}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let h=c.componentDatatype;h===X.DOUBLE&&(h=X.FLOAT),u=void 0,l(c.values)&&(u=ht.createVertexBuffer({context:t,typedArray:X.createTypedArray(h,c.values),usage:i})),f.push({index:r[a],vertexBuffer:u,value:c.value,componentDatatype:h,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(dt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ht.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=ht.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new Bh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Bh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Bh.prototype.getAttribute=function(e){return this._attributes[e]};function eve(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Gt.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function tve(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Bh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&eve(this),this._hasConstantAttributes&&tve(this,this._gl)):AZ(this._gl,this._attributes,this._indexBuffer)};Bh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Bh.prototype.isDestroyed=function(){return!1};Bh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var si=Bh;function Pl(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0}=y(t,{});r.alpha=y(r.alpha,!1),r.stencil=y(r.stencil,!0),r.powerPreference=y(r.powerPreference,"high-performance");let s=l(n)?n(e,r):nve(e,r,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new wR(this),this._textureCache=new DR;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Gt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Gt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Gt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Gt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Gt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Gt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Gt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Gt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Gt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Gt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Gt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Gt._minimumAliasedLineWidth=f[0],Gt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Gt._minimumAliasedPointSize=d[0],Gt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Gt._maximumViewportWidth=p[0],Gt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Gt._highpFloatSupported=g.precision!==0;let h=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Gt._highpIntSupported=h.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!xo(u,["OES_standard_derivatives"]),this._blendMinmax=!!xo(u,["EXT_blend_minmax"]),this._elementIndexUint=!!xo(u,["OES_element_index_uint"]),this._depthTexture=!!xo(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!xo(u,["EXT_frag_depth"]),this._debugShaders=xo(u,["WEBGL_debug_shaders"]),this._textureFloat=!!xo(u,["OES_texture_float"]),this._textureHalfFloat=!!xo(u,["OES_texture_half_float"]),this._textureFloatLinear=!!xo(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!xo(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!xo(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!xo(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!xo(u,["EXT_color_buffer_half_float"]),this._s3tc=!!xo(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!xo(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!xo(u,["WEBGL_compressed_texture_astc"]),this._etc=!!xo(u,["WEBG_compressed_texture_etc"]),this._etc1=!!xo(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!xo(u,["EXT_texture_compression_bptc"]),Dl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?xo(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Gt._maximumTextureFilterAnisotropy=l(A)?u.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,C,T,E,S,w,D,R,O,L;if(c){let v=this;x=function(){return v._gl.createVertexArray()},C=function(I){v._gl.bindVertexArray(I)},T=function(I){v._gl.deleteVertexArray(I)},E=function(I,M,F,k,V){u.drawElementsInstanced(I,M,F,k,V)},S=function(I,M,F,k){u.drawArraysInstanced(I,M,F,k)},w=function(I,M){u.vertexAttribDivisor(I,M)},D=function(I){u.drawBuffers(I)}}else R=xo(u,["OES_vertex_array_object"]),l(R)&&(x=function(){return R.createVertexArrayOES()},C=function(v){R.bindVertexArrayOES(v)},T=function(v){R.deleteVertexArrayOES(v)}),O=xo(u,["ANGLE_instanced_arrays"]),l(O)&&(E=function(v,I,M,F,k){O.drawElementsInstancedANGLE(v,I,M,F,k)},S=function(v,I,M,F){O.drawArraysInstancedANGLE(v,I,M,F)},w=function(v,I){O.vertexAttribDivisorANGLE(v,I)}),L=xo(u,["WEBGL_draw_buffers"]),l(L)&&(D=function(v){L.drawBuffersWEBGL(v)});this.glCreateVertexArray=x,this.glBindVertexArray=C,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=w,this.glDrawBuffers=D,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,Gt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Gt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new OR,_=new fc(this),b=ze.fromCache();this._defaultPassState=_,this._defaultRenderState=b,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=b,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<Gt._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o},this.cache={},ze.apply(u,b,_)}function nve(e,t,n){if(typeof WebGLRenderingContext>"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new de("The browser supports WebGL, but initialization failed.");return o}function ive(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function rve(e,t,n,i){let r=`${ive(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function ove(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new de(rve(e,t,n,i))}function sve(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function ave(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,sve(e,r,t))}return i}function xo(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var cve={};Object.defineProperties(Pl.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=ave(this._originalGLContext,e?ove:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Bt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Bt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Bt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new uc({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return cve}}});function xZ(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,r,t,o,n,i)}var jG;typeof WebGLRenderingContext<"u"&&(jG=[te.BACK]);function YG(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=jG;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var lve=new oi;Pl.prototype.clear=function(e,t){e=y(e,lve),t=y(t,this._defaultPassState);let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);xZ(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);YG(this,c),n.clear(i)};function uve(e,t,n,i,r){YG(e,t),xZ(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function fve(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,B.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(a=y(a,o.numberOfVertices),c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Pl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let r=y(e._framebuffer,t.framebuffer),o=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),uve(this,r,t,n,o),fve(this,e,n,i)};Pl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=jG;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Pl.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),r=y(e.width,t.drawingBufferWidth),o=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Qe.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=ct.createTypedArray(ct.RGBA,a,r,o);return YG(this,s),t.readPixels(n,i,r,o,ct.RGBA,Qe.toWebGLConstant(a,this),c),c};var CZ={position:0,textureCoordinates:1};Pl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new dt({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Le.TRIANGLES});e=si.fromGeometry({context:this,geometry:t,attributeLocations:CZ,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Pl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Le.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:bx,fragmentShaderSource:e,attributeLocations:CZ}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Pl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function qG(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(qG.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});qG.prototype.destroy=function(){delete this._pickObjects[this.key]};Pl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new qG(this._pickObjects,t,z.fromRgba(t))};Pl.prototype.isDestroyed=function(){return!1};Pl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Pl._deprecationWarning=$;var RR=Pl;function Wx(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let r=e.colorRenderbuffers,o=e.colorTextures;if(l(r)!==l(o))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new ca({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new ca({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}Wx.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Wx.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Wx.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};Wx.prototype.isDestroyed=function(){return!1};Wx.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var MR=Wx;var Hc={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Hc.RGBA4||e===Hc.RGBA8||e===Hc.RGBA16F||e===Hc.RGBA32F||e===Hc.RGB5_A1||e===Hc.RGB565||e===Hc.DEPTH_COMPONENT16||e===Hc.STENCIL_INDEX8||e===Hc.DEPTH_STENCIL||e===Hc.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Hc.RGBA32F:e===te.HALF_FLOAT_OES?Hc.RGBA16F:Hc.RGBA8}},Gc=Object.freeze(Hc);function oS(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Gt.maximumRenderbufferSize,r=y(e.format,Gc.RGBA4),o=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(oS.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});oS.prototype._getRenderbuffer=function(){return this._renderbuffer};oS.prototype.isDestroyed=function(){return!1};oS.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Ou=oS;function rs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(rs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});rs.prototype.isDirty=function(e,t,n,i,r){n=y(n,1);let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};rs.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?y(i,1):1,r=y(r,this._color?y(this._pixelDatatype,Qe.UNSIGNED_BYTE):void 0),o=y(o,this._color?y(this._pixelFormat,ct.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Bt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:mn.NEAREST}),this._numSamples>1){let a=Gc.getColorFormat(r);this._colorRenderbuffers[s]=new Ou({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Bt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Qe.UNSIGNED_INT_24_8,sampler:mn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Ou({context:e,width:t,height:n,format:Gc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Ou({context:e,width:t,height:n,format:Gc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Bt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_COMPONENT,pixelDatatype:Qe.UNSIGNED_INT,sampler:mn.NEAREST}):this._depthRenderbuffer=new Ou({context:e,width:t,height:n,format:Gc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new MR({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new ca({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};rs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};rs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};rs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};rs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};rs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};rs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};rs.prototype.getDepthTexture=function(){return this._depthTexture};rs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};rs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};rs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};rs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};rs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};rs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};rs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};rs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};rs.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&l(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),l(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),l(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=rs;function dve(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[ve.createIfNeeded(t.positiveX).fetchImage(i),ve.createIfNeeded(t.negativeX).fetchImage(i),ve.createIfNeeded(t.positiveY).fetchImage(i),ve.createIfNeeded(t.negativeY).fetchImage(i),ve.createIfNeeded(t.positiveZ).fetchImage(i),ve.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new uc({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var BR=dve;var Zy={VERTEX:0,FRAGMENT:1,BOTH:2};Zy.includesVertexShader=function(e){return e===Zy.VERTEX||e===Zy.BOTH};Zy.includesFragmentShader=function(e){return e===Zy.FRAGMENT||e===Zy.BOTH};var be=Object.freeze(Zy);function XG(e){this.name=e,this.fields=[]}XG.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};XG.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var LR=XG;function KG(e){this.signature=e,this.body=[]}KG.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};KG.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var NR=KG;function dc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(dc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});dc.prototype.addDefine=function(e,t,n){n=y(n,be.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),be.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};dc.prototype.addStruct=function(e,t,n){this._structs[e]=new LR(t),be.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};dc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};dc.prototype.addFunction=function(e,t,n){this._functions[e]=new NR(t),be.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),be.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};dc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};dc.prototype.addUniform=function(e,t,n){n=y(n,be.BOTH);let i=`uniform ${e} ${t};`;be.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),be.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};dc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};dc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=hve(e),i};dc.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};dc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};dc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};dc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=mve(this),i=pve(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),o=new He({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new He({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};dc.prototype.clone=function(){return Ye(this,!0)};function mve(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function hve(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function pve(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var jx=dc;function _s(e,t,n,i){let r=_s._verifyAttributes(t);n=y(n,0);let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=_s._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:_s._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}_s._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:y(r.index,i),enabled:y(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:y(r.componentDatatype,X.FLOAT),normalize:y(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:y(r.usage,Fe.STATIC_DRAW)};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};_s._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};_s._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};_s.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];_s._resize(r,this._size),_s._appendWriters(this.writers,r)}JG(this)};_s._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var _ve=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];_s._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=_ve[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};_s.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=gve(this,i)||t;if(t||!l(this.va)){JG(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);_s._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new si({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function gve(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=ht.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}_s._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};_s.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)yve(n[i],e,t)};function yve(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}_s.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function JG(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}_s.prototype.isDestroyed=function(){return!1};_s.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return JG(this),ue(this)};var y_=_s;function A_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(A_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});A_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};A_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};A_.prototype.equals=function(e){return this===e||e instanceof A_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};A_.prototype.valueOf=function(){return this._value};A_.prototype.toString=function(){return String(this._value)};var $n=A_;function Ave(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function xve(e){return new $n(e)}function Cve(e,t,n){return Ave(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,xve))}var le=Cve;function sS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});sS.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new sS(this)};sS.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var mc=sS;function Qy(){this._array=[],this._hash={}}Object.defineProperties(Qy.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Qy.prototype.contains=function(e){return l(this._hash[e])};Qy.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Qy.prototype.get=function(e){return this._hash[e]};Qy.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Qy.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Et=Qy;function Ol(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Ol.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Ol.packedLength=2;Ol.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Ol.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ol),n.near=e[t++],n.far=e[t],n};Ol.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Ol.clone=function(e,t){if(l(e))return l(t)||(t=new Ol),t.near=e.near,t.far=e.far,t};Ol.prototype.clone=function(e){return Ol.clone(this,e)};Ol.prototype.equals=function(e){return Ol.equals(this,e)};var Dt=Ol;function Ru(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Ru.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Ru(e.near,e.nearValue,e.far,e.farValue)};Ru.packedLength=4;Ru.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Ru.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ru),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Ru.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Ru.prototype.clone=function(e){return Ru.clone(this,e)};Ru.prototype.equals=function(e){return Ru.equals(this,e)};var Lt=Ru;var Tve={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qe=Object.freeze(Tve);var Eve={CENTER:0,LEFT:1,RIGHT:-1},_i=Object.freeze(Eve);var bve={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Bn=Object.freeze(bve);var Sve={DONE:0,PENDING:1,FAILED:2},lt=Object.freeze(Sve);function kf(){fe.throwInstantiationError()}Object.defineProperties(kf.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});kf.prototype.getValue=fe.throwInstantiationError;kf.prototype.equals=fe.throwInstantiationError;kf.equals=function(e,t){return e===t||l(e)&&e.equals(t)};kf.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!kf.equals(e[i],t[i]))return!1;return!0};kf.isConstant=function(e){return!l(e)||e.isConstant};kf.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};kf.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};kf.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var j=kf;var vve=z.WHITE,wve=m.ZERO,Dve=qe.NONE,Ive=H.ZERO,Pve=1,Ove=0,Rve=m.ZERO,Mve=_i.CENTER,Bve=Bn.CENTER,Lve=!1,Nve=new m,Fve=new z,Uve=new m,Vve=new H,kve=new Lt,zve=new Lt,Hve=new Lt,Gve=new Ke,Wve=new Dt;function TZ(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function x_(e,t){t.collectionChanged.addEventListener(x_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}x_.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),d;if(f&&(d=j.getValueOrUndefined(s._position,e,Nve),c=j.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){ZG(o,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u),u.show=f,(!l(u.image)||o.textureValue!==c)&&(u.image=c,o.textureValue=c),u.position=d,u.color=j.getValueOrDefault(a._color,e,vve,Fve),u.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,wve,Uve),u.heightReference=j.getValueOrDefault(a._heightReference,e,Dve),u.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,Ive,Vve),u.scale=j.getValueOrDefault(a._scale,e,Pve),u.rotation=j.getValueOrDefault(a._rotation,e,Ove),u.alignedAxis=j.getValueOrDefault(a._alignedAxis,e,Rve),u.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,Mve),u.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,Bve),u.width=j.getValueOrUndefined(a._width,e),u.height=j.getValueOrUndefined(a._height,e),u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,kve),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,zve),u.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Hve),u.sizeInMeters=j.getValueOrDefault(a._sizeInMeters,e,Lve),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,Wve),u.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e);let p=j.getValueOrUndefined(a._imageSubRegion,e,Gve);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};x_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return lt.FAILED;let i=n.billboard;if(i.heightReference===qe.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return lt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};x_.prototype.isDestroyed=function(){return!1};x_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(x_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};x_.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new TZ(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new TZ(o)):(ZG(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],ZG(s.get(o.id),o,a),s.remove(o.id)};function ZG(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var FR=x_;function jve(e,t){this.start=y(e,0),this.stop=y(t,0)}var Wc=jve;function _n(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var e8=new m,t8=new m,n8=new m,i8=new m,r8=new m,o8=new m,s8=new m,Ns=new m,a8=new m,c8=new m,l8=new m,u8=new m,Yve=4/3*P.PI;_n.fromPoints=function(e,t){if(l(t)||(t=new _n),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],s8),i=m.clone(n,e8),r=m.clone(n,t8),o=m.clone(n,n8),s=m.clone(n,i8),a=m.clone(n,r8),c=m.clone(n,o8),u=e.length,f;for(f=1;f<u;f++){m.clone(e[f],n);let O=n.x,L=n.y,N=n.z;O<i.x&&m.clone(n,i),O>s.x&&m.clone(n,s),L<r.y&&m.clone(n,r),L>a.y&&m.clone(n,a),N<o.z&&m.clone(n,o),N>c.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,Ns)),p=m.magnitudeSquared(m.subtract(a,r,Ns)),g=m.magnitudeSquared(m.subtract(c,o,Ns)),h=i,A=s,x=d;p>x&&(x=p,h=r,A=a),g>x&&(x=g,h=o,A=c);let C=a8;C.x=(h.x+A.x)*.5,C.y=(h.y+A.y)*.5,C.z=(h.z+A.z)*.5;let T=m.magnitudeSquared(m.subtract(A,C,Ns)),E=Math.sqrt(T),S=c8;S.x=i.x,S.y=r.y,S.z=o.z;let w=l8;w.x=s.x,w.y=a.y,w.z=c.z;let D=m.midpoint(S,w,u8),R=0;for(f=0;f<u;f++){m.clone(e[f],n);let O=m.magnitude(m.subtract(n,D,Ns));O>R&&(R=O);let L=m.magnitudeSquared(m.subtract(n,C,Ns));if(L>T){let N=Math.sqrt(L);E=(E+N)*.5,T=E*E;let _=N-E;C.x=(E*C.x+_*n.x)/N,C.y=(E*C.y+_*n.y)/N,C.z=(E*C.z+_*n.z)/N}}return E<R?(m.clone(C,t.center),t.radius=E):(m.clone(D,t.center),t.radius=R),t};var qve=new Di,Xve=new m,Kve=new m,QG=new he,$G=new he;_n.fromRectangle2D=function(e,t,n){return _n.fromRectangleWithHeights2D(e,t,0,0,n)};_n.fromRectangleWithHeights2D=function(e,t,n,i,r){if(l(r)||(r=new _n),!l(e))return r.center=m.clone(m.ZERO,r.center),r.radius=0,r;t=y(t,qve),ce.southwest(e,QG),QG.height=n,ce.northeast(e,$G),$G.height=i;let o=t.project(QG,Xve),s=t.project($G,Kve),a=s.x-o.x,c=s.y-o.y,u=s.z-o.z;r.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=r.center;return f.x=o.x+a*.5,f.y=o.y+c*.5,f.z=o.z+u*.5,r};var Jve=[];_n.fromRectangle3D=function(e,t,n,i){if(t=y(t,re.WGS84),n=y(n,0),l(i)||(i=new _n),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let r=ce.subsample(e,t,n,Jve);return _n.fromPoints(r,i)};_n.fromVertices=function(e,t,n,i){if(l(i)||(i=new _n),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=y(t,m.ZERO),n=y(n,3);let r=s8;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let o=m.clone(r,e8),s=m.clone(r,t8),a=m.clone(r,n8),c=m.clone(r,i8),u=m.clone(r,r8),f=m.clone(r,o8),d=e.length,p;for(p=0;p<d;p+=n){let N=e[p]+t.x,_=e[p+1]+t.y,b=e[p+2]+t.z;r.x=N,r.y=_,r.z=b,N<o.x&&m.clone(r,o),N>c.x&&m.clone(r,c),_<s.y&&m.clone(r,s),_>u.y&&m.clone(r,u),b<a.z&&m.clone(r,a),b>f.z&&m.clone(r,f)}let g=m.magnitudeSquared(m.subtract(c,o,Ns)),h=m.magnitudeSquared(m.subtract(u,s,Ns)),A=m.magnitudeSquared(m.subtract(f,a,Ns)),x=o,C=c,T=g;h>T&&(T=h,x=s,C=u),A>T&&(T=A,x=a,C=f);let E=a8;E.x=(x.x+C.x)*.5,E.y=(x.y+C.y)*.5,E.z=(x.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,E,Ns)),w=Math.sqrt(S),D=c8;D.x=o.x,D.y=s.y,D.z=a.z;let R=l8;R.x=c.x,R.y=u.y,R.z=f.z;let O=m.midpoint(D,R,u8),L=0;for(p=0;p<d;p+=n){r.x=e[p]+t.x,r.y=e[p+1]+t.y,r.z=e[p+2]+t.z;let N=m.magnitude(m.subtract(r,O,Ns));N>L&&(L=N);let _=m.magnitudeSquared(m.subtract(r,E,Ns));if(_>S){let b=Math.sqrt(_);w=(w+b)*.5,S=w*w;let v=b-w;E.x=(w*E.x+v*r.x)/b,E.y=(w*E.y+v*r.y)/b,E.z=(w*E.z+v*r.z)/b}}return w<L?(m.clone(E,i.center),i.radius=w):(m.clone(O,i.center),i.radius=L),i};_n.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new _n),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=s8;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let r=m.clone(i,e8),o=m.clone(i,t8),s=m.clone(i,n8),a=m.clone(i,i8),c=m.clone(i,r8),u=m.clone(i,o8),f=e.length,d;for(d=0;d<f;d+=3){let L=e[d]+t[d],N=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=L,i.y=N,i.z=_,L<r.x&&m.clone(i,r),L>a.x&&m.clone(i,a),N<o.y&&m.clone(i,o),N>c.y&&m.clone(i,c),_<s.z&&m.clone(i,s),_>u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,r,Ns)),g=m.magnitudeSquared(m.subtract(c,o,Ns)),h=m.magnitudeSquared(m.subtract(u,s,Ns)),A=r,x=a,C=p;g>C&&(C=g,A=o,x=c),h>C&&(C=h,A=s,x=u);let T=a8;T.x=(A.x+x.x)*.5,T.y=(A.y+x.y)*.5,T.z=(A.z+x.z)*.5;let E=m.magnitudeSquared(m.subtract(x,T,Ns)),S=Math.sqrt(E),w=c8;w.x=r.x,w.y=o.y,w.z=s.z;let D=l8;D.x=a.x,D.y=c.y,D.z=u.z;let R=m.midpoint(w,D,u8),O=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let L=m.magnitude(m.subtract(i,R,Ns));L>O&&(O=L);let N=m.magnitudeSquared(m.subtract(i,T,Ns));if(N>E){let _=Math.sqrt(N);S=(S+_)*.5,E=S*S;let b=_-S;T.x=(S*T.x+b*i.x)/_,T.y=(S*T.y+b*i.y)/_,T.z=(S*T.z+b*i.z)/_}}return S<O?(m.clone(T,n.center),n.radius=S):(m.clone(R,n.center),n.radius=O),n};_n.fromCornerPoints=function(e,t,n){l(n)||(n=new _n);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};_n.fromEllipsoid=function(e,t){return l(t)||(t=new _n),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var Zve=new m;_n.fromBoundingSpheres=function(e,t){if(l(t)||(t=new _n),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return _n.clone(e[0],t);if(n===2)return _n.union(e[0],e[1],t);let i=[],r;for(r=0;r<n;r++)i.push(e[r].center);t=_n.fromPoints(i,t);let o=t.center,s=t.radius;for(r=0;r<n;r++){let a=e[r];s=Math.max(s,m.distance(o,a.center,Zve)+a.radius)}return t.radius=s,t};var Qve=new m,$ve=new m,ewe=new m;_n.fromOrientedBoundingBox=function(e,t){l(t)||(t=new _n);let n=e.halfAxes,i=Z.getColumn(n,0,Qve),r=Z.getColumn(n,1,$ve),o=Z.getColumn(n,2,ewe);return m.add(i,r,i),m.add(i,o,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var twe=new m,nwe=new m;_n.fromTransformation=function(e,t){l(t)||(t=new _n);let n=B.getTranslation(e,twe),i=B.getScale(e,nwe),r=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=r,t};_n.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new _n(e.center,e.radius)};_n.packedLength=4;_n.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};_n.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new _n);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var iwe=new m,rwe=new m;_n.union=function(e,t,n){l(n)||(n=new _n);let i=e.center,r=e.radius,o=t.center,s=t.radius,a=m.subtract(o,i,iwe),c=m.magnitude(a);if(r>=c+s)return e.clone(n),n;if(s>=c+r)return t.clone(n),n;let u=(r+c+s)*.5,f=m.multiplyByScalar(a,(-r+u)/c,rwe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var owe=new m;_n.expand=function(e,t,n){n=_n.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,owe));return i>n.radius&&(n.radius=i),n};_n.intersectPlane=function(e,t){let n=e.center,i=e.radius,r=t.normal,o=m.dot(r,n)+t.distance;return o<-i?tn.OUTSIDE:o<i?tn.INTERSECTING:tn.INSIDE};_n.transform=function(e,t,n){return l(n)||(n=new _n),n.center=B.multiplyByPoint(t,e.center,n.center),n.radius=B.getMaximumScale(t)*e.radius,n};var swe=new m;_n.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,swe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};_n.transformWithoutScale=function(e,t,n){return l(n)||(n=new _n),n.center=B.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var awe=new m;_n.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Wc);let r=m.subtract(e.center,t,awe),o=m.dot(n,r);return i.start=o-e.radius,i.stop=o+e.radius,i};var EZ=new m,cwe=new m,lwe=new m,uwe=new m,fwe=new m,dwe=new he,bZ=new Array(8);for(let e=0;e<8;++e)bZ[e]=new m;var mwe=new Di;_n.projectTo2D=function(e,t,n){t=y(t,mwe);let i=t.ellipsoid,r=e.center,o=e.radius,s;m.equals(r,m.ZERO)?s=m.clone(m.UNIT_X,EZ):s=i.geodeticSurfaceNormal(r,EZ);let a=m.cross(m.UNIT_Z,s,cwe);m.normalize(a,a);let c=m.cross(s,a,lwe);m.normalize(c,c),m.multiplyByScalar(s,o,s),m.multiplyByScalar(c,o,c),m.multiplyByScalar(a,o,a);let u=m.negate(c,fwe),f=m.negate(a,uwe),d=bZ,p=d[0];m.add(s,c,p),m.add(p,a,p),p=d[1],m.add(s,c,p),m.add(p,f,p),p=d[2],m.add(s,u,p),m.add(p,f,p),p=d[3],m.add(s,u,p),m.add(p,a,p),m.negate(s,s),p=d[4],m.add(s,c,p),m.add(p,a,p),p=d[5],m.add(s,c,p),m.add(p,f,p),p=d[6],m.add(s,u,p),m.add(p,f,p),p=d[7],m.add(s,u,p),m.add(p,a,p);let g=d.length;for(let C=0;C<g;++C){let T=d[C];m.add(r,T,T);let E=i.cartesianToCartographic(T,dwe);t.project(E,T)}n=_n.fromPoints(d,n),r=n.center;let h=r.x,A=r.y,x=r.z;return r.x=x,r.y=h,r.z=A,n};_n.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};_n.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};_n.prototype.intersectPlane=function(e){return _n.intersectPlane(this,e)};_n.prototype.distanceSquaredTo=function(e){return _n.distanceSquaredTo(this,e)};_n.prototype.computePlaneDistances=function(e,t,n){return _n.computePlaneDistances(this,e,t,n)};_n.prototype.isOccluded=function(e){return _n.isOccluded(this,e)};_n.prototype.equals=function(e){return _n.equals(this,e)};_n.prototype.clone=function(e){return _n.clone(this,e)};_n.prototype.volume=function(){let e=this.radius;return Yve*e*e*e};var ae=_n;function hwe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var gn=hwe;var pwe={NONE:0,TOP:1,ALL:2},an=Object.freeze(pwe);function Wo(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}Wo.POSITION_ONLY=Object.freeze(new Wo({position:!0}));Wo.POSITION_AND_NORMAL=Object.freeze(new Wo({position:!0,normal:!0}));Wo.POSITION_NORMAL_AND_ST=Object.freeze(new Wo({position:!0,normal:!0,st:!0}));Wo.POSITION_AND_ST=Object.freeze(new Wo({position:!0,st:!0}));Wo.POSITION_AND_COLOR=Object.freeze(new Wo({position:!0,color:!0}));Wo.ALL=Object.freeze(new Wo({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Wo.DEFAULT=Wo.POSITION_NORMAL_AND_ST;Wo.packedLength=6;Wo.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Wo.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Wo),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Wo.clone=function(e,t){if(l(e))return l(t)||(t=new Wo),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Oe=Wo;var _we=new m;function Rl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Oe.DEFAULT);this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Rl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new Rl({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Rl.fromAxisAlignedBoundingBox=function(e){return new Rl({minimum:e.minimum,maximum:e.maximum})};Rl.packedLength=2*m.packedLength+Oe.packedLength+1;Rl.pack=function(e,t,n){return n=y(n,0),m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Oe.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Oe.packedLength]=y(e._offsetAttribute,-1),t};var vZ=new m,wZ=new m,DZ=new Oe,SZ={minimum:vZ,maximum:wZ,vertexFormat:DZ,offsetAttribute:void 0};Rl.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,vZ),r=m.unpack(e,t+m.packedLength,wZ),o=Oe.unpack(e,t+2*m.packedLength,DZ),s=e[t+2*m.packedLength+Oe.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(r,n._maximum),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(SZ.offsetAttribute=s===-1?void 0:s,new Rl(SZ))};Rl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let r=new gn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(6*2*3),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=4+2,o[7]=4+1,o[8]=4+0,o[9]=4+3,o[10]=4+2,o[11]=4+0,o[12]=8+0,o[13]=8+1,o[14]=8+2,o[15]=8+0,o[16]=8+2,o[17]=8+3,o[18]=12+2,o[19]=12+1,o[20]=12+0,o[21]=12+3,o[22]=12+2,o[23]=12+0,o[24]=16+2,o[25]=16+1,o[26]=16+0,o[27]=16+3,o[28]=16+2,o[29]=16+0,o[30]=20+0,o[31]=20+1,o[32]=20+2,o[33]=20+0,o[34]=20+2,o[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(6*2*3),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=m.subtract(n,t,_we),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===an.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new dt({attributes:r,indices:o,primitiveType:Le.TRIANGLES,boundingSphere:new ae(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var f8;Rl.getUnitBox=function(){return l(f8)||(f8=Rl.createGeometry(Rl.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Oe.POSITION_ONLY}))),f8};var Ml=Rl;var gwe=new m;function om(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}om.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new om({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};om.fromAxisAlignedBoundingBox=function(e){return new om({minimum:e.minimum,maximum:e.maximum})};om.packedLength=2*m.packedLength+1;om.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var PZ=new m,OZ=new m,IZ={minimum:PZ,maximum:OZ,offsetAttribute:void 0};om.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,PZ),r=m.unpack(e,t+m.packedLength,OZ),o=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(IZ.offsetAttribute=o===-1?void 0:o,new om(IZ))};om.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new gn,r=new Uint16Array(12*2),o=new Float64Array(8*3);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=m.subtract(n,t,gwe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===an.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new dt({attributes:i,indices:r,primitiveType:Le.LINES,boundingSphere:new ae(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var sm=om;function Yx(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(Yx.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Yx.fromColor=function(e){return new Yx(e.red,e.green,e.blue,e.alpha)};Yx.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Yx.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var zt=Yx;function aS(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(aS.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});aS.fromDistanceDisplayCondition=function(e){return new aS(e.near,e.far)};aS.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var zn=aS;function ywe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Tt=ywe;function zr(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?ee.clone(e.start):new ee,this.stop=l(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(zr.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var qx={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};zr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(qx.start=i,qx.stop=r,qx.isStartIncluded=o,qx.isStopIncluded=s,qx.data=a,new zr(qx))};zr.toIso8601=function(e,t){return`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};zr.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new zr(e)};zr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};zr.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};zr.intersect=function(e,t,n,i){if(!l(t))return zr.clone(zr.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=ee.greaterThanOrEquals(s,r)&&ee.greaterThanOrEquals(o,s),u=!c&&ee.lessThanOrEquals(s,r)&&ee.lessThanOrEquals(r,a);if(!c&&!u)return zr.clone(zr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,h=ee.lessThan(o,a);return l(n)||(n=new zr),n.start=c?s:r,n.isStartIncluded=f&&p||!ee.equals(s,r)&&(c&&p||u&&f),n.stop=h?o:a,n.isStopIncluded=h?d:d&&g||!ee.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};zr.contains=function(e,t){if(e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};zr.prototype.clone=function(e){return zr.clone(this,e)};zr.prototype.equals=function(e,t){return zr.equals(this,e,t)};zr.prototype.equalsEpsilon=function(e,t,n){return zr.equalsEpsilon(this,e,t,n)};zr.prototype.toString=function(){return zr.toIso8601(this)};zr.EMPTY=Object.freeze(new zr({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var bn=zr;var RZ=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),MZ=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),Awe=Object.freeze(new bn({start:RZ,stop:MZ})),xwe={MINIMUM_VALUE:RZ,MAXIMUM_VALUE:MZ,MAXIMUM_INTERVAL:Awe},Ge=xwe;function cS(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(cS.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});cS.fromCartesian3=function(e){return new cS(e.x,e.y,e.z)};cS.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Xi=cS;function UR(e){e=y(e,!0),this.value=UR.toValue(e)}Object.defineProperties(UR.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});UR.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var An=UR;var VR=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = tangentToEyeMatrix; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var kR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var zR=`in vec3 v_positionEC; -in vec3 v_normalEC; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var HR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var GR=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var WR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Cwe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},Ra=Object.freeze(Cwe);var Twe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},br=Object.freeze(Twe);var Ewe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.SOURCE_ALPHA,functionSourceAlpha:br.ONE,functionDestinationRgb:br.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:br.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.ONE,functionSourceAlpha:br.ONE,functionDestinationRgb:br.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:br.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.SOURCE_ALPHA,functionSourceAlpha:br.ONE,functionDestinationRgb:br.ONE,functionDestinationAlpha:br.ONE})},hn=Object.freeze(Ewe);var bwe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},gi=Object.freeze(bwe);function Xx(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(Xx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});Xx.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};Xx.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Xx.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=hn.ALPHA_BLEND):t.depthMask=!0,t};Xx.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=hn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:gi.BACK}),l(n)&&(i=gt(n,i,!0)),i};var tr=Xx;var jR=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var YR=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; -} -`;var qR=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var XR=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var KR=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. - -float getHeight(int idx, float invTexSize) -{ - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } - - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); - - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } - } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) - { - color.rgb /= color.a; - } - - color.rgb = czm_gammaCorrect(color.rgb); - - material.diffuse = color.rgb; - material.alpha = color.a; - return material; -} -`;var JR=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif - -uniform vec4 color; -uniform float spacing; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var ZR=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var QR=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) -{ - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; - - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); - - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; - - return material; -} -`;var $R=`#ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable -#endif - -uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; - - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; - - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; - - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif - - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); - - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; - - return material; -} -`;var eM=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; -} -`;var tM=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif - -uniform vec4 color; - -float getPointOnLine(vec2 p0, vec2 p1, float x) -{ - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif - - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); - - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); - - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); - - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var nM=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; - -const float maskLength = 16.0; - -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } - - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; -} -`;var iM=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; -} -`;var rM=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); - - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); - - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var oM=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); - - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); - - return material; -} -`;var sM=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var aM=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); - - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var cM=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); - - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; - - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); - - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); - - material.diffuse = material.diffuse; - - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); - - material.specular = specularIntensity; - material.shininess = 10.0; - - return material; -} -`;function Xe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,un.LINEAR),this._magnificationFilter=y(e.magnificationFilter,bi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,Swe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Xe._uniformList[this.type])||(Xe._uniformList[this.type]=Object.keys(this._uniforms))}Xe._uniformList={};Xe.fromType=function(e,t){let n=new Xe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Xe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};Xe.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(A){return A.bufferView}),u=u[0]);let d=new mn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Bt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Bt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let h=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let A=this.uniforms[h];A.x=p._width,A.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new uc({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new mn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};Xe.prototype.isDestroyed=function(){return!1};Xe.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function Swe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ye(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ye(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ye(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Xe._materialCache.getMaterial(t.type);if(l(i)){let o=Ye(i.fabric,!0);t._template=gt(t._template,o,!0),n=i.translucent}Iwe(t),l(i)||Xe._materialCache.addMaterial(t.type,t),Owe(t),Lwe(t),Fwe(t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,r),n=y(e.translucent,n),l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function d8(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function BZ(e,t){}function vwe(e,t){}var wwe=["type","materials","uniforms","components","source"],Dwe=["diffuse","specular","shininess","normal","emission","alpha"];function Iwe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;d8(t,wwe,BZ,!0),d8(r,Dwe,BZ,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);d8(n,o,vwe,!1)}function Pwe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function Owe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&Pwe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; -`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${r} = ${t[r]}; -`}e.shaderSource+=`return material; -} -`}}var LZ={mat2:er,mat3:Z,mat4:B},Rwe=/\.ktx2$/i;function Mwe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===Xe.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new mn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Bt({context:i,source:o,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Bt&&o!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),a)return;let d=o instanceof ve;if(!l(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if(typeof o=="string"||d){let p=d?o:ve.createIfNeeded(o),g;Rwe.test(p.url)?g=Dl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}function Bwe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof uc){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Xe.DefaultCubeMapId)return;let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){let o=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(o).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=r}}}function Lwe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&NZ(e,n)}function NZ(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=Nwe(r),s;if(o==="channels")s=lS(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;Uwe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},NZ(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=lS(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Mwe(t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Bwe(t));else if(o.indexOf("mat")!==-1){let u=new LZ[o];e._uniforms[c]=function(){return LZ[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Nwe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Xe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function Fwe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new Xe({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=gt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;lS(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=lS(e,i,a)}}function lS(e,t,n,i){i=y(i,!0);let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function Uwe(e,t,n){return lS(e,t,t,n)}Xe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Xe.DefaultImageId="czm_defaultImage";Xe.DefaultCubeMapId="czm_defaultCubeMap";Xe.ColorType="Color";Xe._materialCache.addMaterial(Xe.ColorType,{fabric:{type:Xe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.ImageType="Image";Xe._materialCache.addMaterial(Xe.ImageType,{fabric:{type:Xe.ImageType,uniforms:{image:Xe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.DiffuseMapType="DiffuseMap";Xe._materialCache.addMaterial(Xe.DiffuseMapType,{fabric:{type:Xe.DiffuseMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.AlphaMapType="AlphaMap";Xe._materialCache.addMaterial(Xe.AlphaMapType,{fabric:{type:Xe.AlphaMapType,uniforms:{image:Xe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Xe.SpecularMapType="SpecularMap";Xe._materialCache.addMaterial(Xe.SpecularMapType,{fabric:{type:Xe.SpecularMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Xe.EmissionMapType="EmissionMap";Xe._materialCache.addMaterial(Xe.EmissionMapType,{fabric:{type:Xe.EmissionMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.BumpMapType="BumpMap";Xe._materialCache.addMaterial(Xe.BumpMapType,{fabric:{type:Xe.BumpMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:YR},translucent:!1});Xe.NormalMapType="NormalMap";Xe._materialCache.addMaterial(Xe.NormalMapType,{fabric:{type:Xe.NormalMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:eM},translucent:!1});Xe.GridType="Grid";Xe._materialCache.addMaterial(Xe.GridType,{fabric:{type:Xe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:$R},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Xe.StripeType="Stripe";Xe._materialCache.addMaterial(Xe.StripeType,{fabric:{type:Xe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:aM},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Xe.CheckerboardType="Checkerboard";Xe._materialCache.addMaterial(Xe.CheckerboardType,{fabric:{type:Xe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:qR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.DotType="Dot";Xe._materialCache.addMaterial(Xe.DotType,{fabric:{type:Xe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:XR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.WaterType="Water";Xe._materialCache.addMaterial(Xe.WaterType,{fabric:{type:Xe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Xe.DefaultImageId,normalMap:Xe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:cM},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Xe.RimLightingType="RimLighting";Xe._materialCache.addMaterial(Xe.RimLightingType,{fabric:{type:Xe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:oM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Xe.FadeType="Fade";Xe._materialCache.addMaterial(Xe.FadeType,{fabric:{type:Xe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:QR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Xe.PolylineArrowType="PolylineArrow";Xe._materialCache.addMaterial(Xe.PolylineArrowType,{fabric:{type:Xe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:tM},translucent:!0});Xe.PolylineDashType="PolylineDash";Xe._materialCache.addMaterial(Xe.PolylineDashType,{fabric:{type:Xe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:nM},translucent:!0});Xe.PolylineGlowType="PolylineGlow";Xe._materialCache.addMaterial(Xe.PolylineGlowType,{fabric:{type:Xe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:iM},translucent:!0});Xe.PolylineOutlineType="PolylineOutline";Xe._materialCache.addMaterial(Xe.PolylineOutlineType,{fabric:{type:Xe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:rM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Xe.ElevationContourType="ElevationContour";Xe._materialCache.addMaterial(Xe.ElevationContourType,{fabric:{type:Xe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:JR},translucent:!1});Xe.ElevationRampType="ElevationRamp";Xe._materialCache.addMaterial(Xe.ElevationRampType,{fabric:{type:Xe.ElevationRampType,uniforms:{image:Xe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:ZR},translucent:!1});Xe.SlopeRampMaterialType="SlopeRamp";Xe._materialCache.addMaterial(Xe.SlopeRampMaterialType,{fabric:{type:Xe.SlopeRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:sM},translucent:!1});Xe.AspectRampMaterialType="AspectRamp";Xe._materialCache.addMaterial(Xe.AspectRampMaterialType,{fabric:{type:Xe.AspectRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:jR},translucent:!1});Xe.ElevationBandType="ElevationBand";Xe._materialCache.addMaterial(Xe.ElevationBandType,{fabric:{type:Xe.ElevationBandType,uniforms:{heights:Xe.DefaultImageId,colors:Xe.DefaultImageId},source:KR},translucent:!0});var Gi=Xe;function $y(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,$y.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Gi.fromType(Gi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=tr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties($y.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});$y.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;$y.prototype.isTranslucent=tr.prototype.isTranslucent;$y.prototype.getRenderState=tr.prototype.getRenderState;$y.MaterialSupport={BASIC:Object.freeze({vertexFormat:Oe.POSITION_AND_NORMAL,vertexShaderSource:HR,fragmentShaderSource:zR}),TEXTURED:Object.freeze({vertexFormat:Oe.POSITION_NORMAL_AND_ST,vertexShaderSource:WR,fragmentShaderSource:GR}),ALL:Object.freeze({vertexFormat:Oe.ALL,vertexShaderSource:kR,fragmentShaderSource:VR})};var sr=$y;var lM=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var uM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Kx=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var fM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function Lh(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),r=i?fM:uM,o=i?Kx:lM,s=i?Lh.FLAT_VERTEX_FORMAT:Lh.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,r),this._fragmentShaderSource=y(e.fragmentShaderSource,o),this._renderState=tr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Lh.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Lh.VERTEX_FORMAT=Oe.POSITION_AND_NORMAL;Lh.FLAT_VERTEX_FORMAT=Oe.POSITION_ONLY;Lh.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;Lh.prototype.isTranslucent=tr.prototype.isTranslucent;Lh.prototype.getRenderState=tr.prototype.getRenderState;var cn=Lh;function Jx(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Jx.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});Jx.prototype.getType=function(e){return"Color"};Jx.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Jx.prototype.equals=function(e){return this===e||e instanceof Jx&&j.equals(this._color,e._color)};var Vt=Jx;function C_(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Di(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(C_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});C_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};C_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};C_.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),r=P.toDegrees(e.east),o=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=r,t.north=o,t):new ce(n,i,r,o)};C_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.tileXYToRectangle(e,t,n,i);return r.west=P.toDegrees(r.west),r.south=P.toDegrees(r.south),r.east=P.toDegrees(r.east),r.north=P.toDegrees(r.north),r};C_.prototype.tileXYToRectangle=function(e,t,n,i){let r=this._rectangle,o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=e*a+r.west,u=(e+1)*a+r.west,f=r.height/s,d=r.north-t*f,p=r.north-(t+1)*f;return l(i)||(i=new ce(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};C_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),s=i.width/r,a=i.height/o,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=r&&(u=r-1);let f=(i.north-e.latitude)/a|0;return f>=o&&(f=o-1),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var Wi=C_;var FZ=new m,UZ=new m,VZ=new he,m8=new m,Vwe=new m,kZ=new ae,kwe=new Wi,uS=[new he,new he,new he,new he],fS=new H,Oo={};Oo.initialize=function(){let e=Oo._initPromise;return l(e)||(e=ve.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Oo._terrainHeights=t}),Oo._initPromise=e),e};Oo.getMinimumMaximumHeights=function(e,t){t=y(t,re.WGS84);let n=zZ(e),i=Oo._defaultMinTerrainHeight,r=Oo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Oo._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ce.northeast(e,VZ),FZ),t.cartographicToCartesian(ce.southwest(e,VZ),UZ),m.midpoint(UZ,FZ,m8);let a=t.scaleToGeodeticSurface(m8,Vwe);if(l(a)){let c=m.distance(m8,a);i=Math.min(i,-c)}else i=Oo._defaultMinTerrainHeight}return i=Math.max(Oo._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Oo.getBoundingSphere=function(e,t){t=y(t,re.WGS84);let n=zZ(e),i=Oo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Oo._terrainHeights[o];l(s)&&(i=s[1])}let r=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,kZ),ae.union(r,kZ,r)};function zZ(e){he.fromRadians(e.east,e.north,0,uS[0]),he.fromRadians(e.west,e.north,0,uS[1]),he.fromRadians(e.east,e.south,0,uS[2]),he.fromRadians(e.west,e.south,0,uS[3]);let t=0,n=0,i=0,r=0,o=Oo._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=uS[c];if(kwe.positionToTileXY(u,s,fS),c===0)i=fS.x,r=fS.y;else if(i!==fS.x||r!==fS.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Oo._terrainHeightsMaxLevel=6;Oo._defaultMaxTerrainHeight=9e3;Oo._defaultMinTerrainHeight=-1e5;Oo._terrainHeights=void 0;Oo._initPromise=void 0;Object.defineProperties(Oo,{initialized:{get:function(){return l(Oo._terrainHeights)}}});var ai=Oo;function hc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}hc.fromCorners=function(e,t,n){return l(n)||(n=new hc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};hc.fromPoints=function(e,t){if(l(t)||(t=new hc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,h=p.y,A=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(h,i),s=Math.max(h,s),r=Math.min(A,r),a=Math.max(A,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=m.midpoint(u,f,t.center),t};hc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new hc(e.minimum,e.maximum,e.center)};hc.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var dM=new m;hc.intersectPlane=function(e,t){dM=m.subtract(e.maximum,e.minimum,dM);let n=m.multiplyByScalar(dM,.5,dM),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=m.dot(e.center,i)+t.distance;return o-r>0?tn.INSIDE:o+r<0?tn.OUTSIDE:tn.INTERSECTING};hc.prototype.clone=function(e){return hc.clone(this,e)};hc.prototype.intersectPlane=function(e){return hc.intersectPlane(this,e)};hc.prototype.equals=function(e){return hc.equals(this,e)};var e0=hc;var h8={};h8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function HZ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}h8.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=HZ(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*HZ(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var jc=h8;var _8={};_8.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function p8(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,h=o*a-d,A=4*p*h-g*g,x,C;if(A<0){let q,Y,Q;f*u>=c*d?(q=r,Y=p,Q=-2*o*p+r*g):(q=a,Y=h,Q=-a*g+2*s*h);let K=-(Q<0?-1:1)*Math.abs(q)*Math.sqrt(-A);C=-Q+K;let J=C/2,me=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),ye=C===K?-me:-Y/me;return x=Y<=0?me+ye:-Q/(me*me+ye*ye+Y),f*u>=c*d?[(x-o)/r]:[-a/(x+s)]}let T=p,E=-2*o*p+r*g,S=h,w=-a*g+2*s*h,D=Math.sqrt(A),R=Math.sqrt(3)/2,O=Math.abs(Math.atan2(r*D,-E)/3);x=2*Math.sqrt(-T);let L=Math.cos(O);C=x*L;let N=x*(-L/2-R*Math.sin(O)),_=C+N>2*o?C-o:N-o,b=r,v=_/b;O=Math.abs(Math.atan2(a*D,-w)/3),x=2*Math.sqrt(-S),L=Math.cos(O),C=x*L,N=x*(-L/2-R*Math.sin(O));let I=-a,M=C+N<2*s?C+s:N+s,F=I/M,k=b*M,V=-_*M-b*I,G=_*I,U=(s*V-o*G)/(-o*V+s*k);return v<=U?v<=F?U<=F?[v,U,F]:[v,F,U]:[F,v,U]:v<=F?[U,v,F]:U<=F?[U,F,v]:[F,U,v]}_8.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return jc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=jc.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return p8(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):p8(e,t,0,i);if(i===0)return r=jc.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return p8(e,t,n,i)};var Zx=_8;var g8={};g8.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,h=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*h+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function zf(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=Zx.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=jc.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],h;if(p>=0&&g>=0){let A=Math.sqrt(p),x=Math.sqrt(g);return[u-x,u-A,u+A,u+x]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,h=jc.computeRealRoots(1,d,p),A=jc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,A.length!==0?(A[0]+=u,A[1]+=u,h[1]<=A[0]?[h[0],h[1],A[0],A[1]]:A[1]<=h[0]?[A[0],A[1],h[0],h[1]]:h[0]>=A[0]&&h[1]<=A[1]?[A[0],h[0],h[1],A[1]]:A[0]>=h[0]&&A[1]<=h[1]?[h[0],A[0],A[1],h[1]]:h[0]>A[0]&&h[0]<A[1]?[A[0],h[0],A[1],h[1]]:[h[0],A[0],h[1],A[1]]):h):A.length!==0?(A[0]+=u,A[1]+=u,A):[]}}return[]}function dS(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=Zx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,h=e/2,A=p/2,x=g-4*i,C=g+4*Math.abs(i),T=s-4*d,E=s+4*Math.abs(d),S,w;if(d<0||x*E<T*C){let b=Math.sqrt(T);S=b/2,w=b===0?0:(e*A-n)/b}else{let b=Math.sqrt(x);S=b===0?0:(e*A-n)/b,w=b/2}let D,R;h===0&&S===0?(D=0,R=0):P.sign(h)===P.sign(S)?(D=h+S,R=d/D):(R=h-S,D=d/R);let O,L;A===0&&w===0?(O=0,L=0):P.sign(A)===P.sign(w)?(O=A+w,L=i/O):(L=A-w,O=i/L);let N=jc.computeRealRoots(1,D,O),_=jc.computeRealRoots(1,R,L);if(N.length!==0)return _.length!==0?N[1]<=_[0]?[N[0],N[1],_[0],_[1]]:_[1]<=N[0]?[_[0],_[1],N[0],N[1]]:N[0]>=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}g8.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return Zx.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return zf(o,s,a,c);case 1:return dS(o,s,a,c);case 2:return dS(o,s,a,c);case 3:return zf(o,s,a,c);case 4:return zf(o,s,a,c);case 5:return dS(o,s,a,c);case 6:return zf(o,s,a,c);case 7:return zf(o,s,a,c);case 8:return dS(o,s,a,c);case 9:return zf(o,s,a,c);case 10:return zf(o,s,a,c);case 11:return dS(o,s,a,c);case 12:return zf(o,s,a,c);case 13:return zf(o,s,a,c);case 14:return zf(o,s,a,c);case 15:return zf(o,s,a,c);default:return}};var mM=g8;function hM(e,t){t=m.clone(y(t,m.ZERO)),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(y(e,m.ZERO)),this.direction=t}hM.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new hM(e.origin,e.direction)};hM.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var On=hM;var eo={};eo.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,r=e.direction,o=t.normal,s=m.dot(o,r);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-m.dot(o,i))/s;if(!(a<0))return n=m.multiplyByScalar(r,a,n),m.add(i,n,n)};var zwe=new m,Hwe=new m,JZ=new m,GZ=new m,WZ=new m;eo.rayTriangleParametric=function(e,t,n,i,r){r=y(r,!1);let o=e.origin,s=e.direction,a=m.subtract(n,t,zwe),c=m.subtract(i,t,Hwe),u=m.cross(s,c,JZ),f=m.dot(a,u),d,p,g,h,A;if(r){if(f<P.EPSILON6||(d=m.subtract(o,t,GZ),g=m.dot(d,u),g<0||g>f)||(p=m.cross(d,a,WZ),h=m.dot(s,p),h<0||g+h>f))return;A=m.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let x=1/f;if(d=m.subtract(o,t,GZ),g=m.dot(d,u)*x,g<0||g>1||(p=m.cross(d,a,WZ),h=m.dot(s,p)*x,h<0||g+h>1))return;A=m.dot(c,p)*x}return A};eo.rayTriangle=function(e,t,n,i,r,o){let s=eo.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new m),m.multiplyByScalar(e.direction,s,o),m.add(e.origin,o,o)};var Gwe=new On;eo.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=Gwe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=eo.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function Wwe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var jwe={root0:0,root1:0};function ZZ(e,t,n){l(n)||(n=new Wc);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=m.subtract(i,o,JZ),c=m.dot(r,r),u=2*m.dot(r,a),f=m.magnitudeSquared(a)-s,d=Wwe(c,u,f,jwe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}eo.raySphere=function(e,t,n){if(n=ZZ(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var Ywe=new On;eo.lineSegmentSphere=function(e,t,n,i){let r=Ywe;m.clone(e,r.origin);let o=m.subtract(t,e,r.direction),s=m.magnitude(o);if(m.normalize(o,o),i=ZZ(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var qwe=new m,Xwe=new m;eo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,qwe),r=m.multiplyComponents(n,e.direction,Xwe),o=m.magnitudeSquared(i),s=m.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=m.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,A=a/d;return h<A?new Wc(h,A):{start:A,stop:h}}let g=Math.sqrt(a/c);return new Wc(g,g)}else if(o<1)return a=o-1,c=m.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Wc(0,d/c);if(s<0)return c=m.magnitudeSquared(r),new Wc(0,-s/c)};function t0(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function Kwe(e,t,n,i,r){let o=i*i,s=r*r,a=(e[Z.COLUMN1ROW1]-e[Z.COLUMN2ROW2])*s,c=r*(i*t0(e[Z.COLUMN1ROW0],e[Z.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[Z.COLUMN0ROW0]*o+e[Z.COLUMN2ROW2]*s+i*t.x+n,f=s*t0(e[Z.COLUMN2ROW1],e[Z.COLUMN1ROW2],P.EPSILON15),d=r*(i*t0(e[Z.COLUMN2ROW0],e[Z.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=jc.computeRealRoots(a,c,u),p.length===0)return g;let O=p[0],L=Math.sqrt(Math.max(1-O*O,0));if(g.push(new m(i,r*O,r*-L)),g.push(new m(i,r*O,r*L)),p.length===2){let N=p[1],_=Math.sqrt(Math.max(1-N*N,0));g.push(new m(i,r*N,r*-_)),g.push(new m(i,r*N,r*_))}return g}let h=d*d,A=f*f,x=a*a,C=d*f,T=x+A,E=2*(c*a+C),S=2*u*a+c*c-A+h,w=2*(u*c-C),D=u*u-h;if(T===0&&E===0&&S===0&&w===0)return g;p=mM.computeRealRoots(T,E,S,w,D);let R=p.length;if(R===0)return g;for(let O=0;O<R;++O){let L=p[O],N=L*L,_=Math.max(1-N,0),b=Math.sqrt(_),v;P.sign(a)===P.sign(u)?v=t0(a*N+u,c*L,P.EPSILON12):P.sign(u)===P.sign(c*L)?v=t0(a*N,c*L+u,P.EPSILON12):v=t0(a*N+c*L,u,P.EPSILON12);let I=t0(f*L,d,P.EPSILON15),M=v*I;M<0?g.push(new m(i,r*L,r*b)):M>0?g.push(new m(i,r*L,r*-b)):b!==0?(g.push(new m(i,r*L,r*-b)),g.push(new m(i,r*L,r*b)),++O):g.push(new m(i,r*L,r*b))}return g}var y8=new m,jZ=new m,YZ=new m,pM=new m,Jwe=new m,Zwe=new Z,Qwe=new Z,$we=new Z,eDe=new Z,tDe=new Z,qZ=new Z,XZ=new Z,KZ=new m,nDe=new m,iDe=new he;eo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let D=t.geodeticSurfaceNormal(n,y8);if(m.dot(i,D)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,y8),s=m.normalize(o,o),a=m.mostOrthogonalAxis(o,pM),c=m.normalize(m.cross(a,s,jZ),jZ),u=m.normalize(m.cross(s,c,YZ),YZ),f=Zwe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,Qwe),p=Z.fromScale(t.radii,$we),g=Z.fromScale(t.oneOverRadii,eDe),h=tDe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let A=Z.multiply(Z.multiply(d,g,qZ),h,qZ),x=Z.multiply(Z.multiply(A,p,XZ),f,XZ),C=Z.multiplyByVector(A,n,Jwe),T=Kwe(x,m.negate(C,y8),0,0,1),E,S,w=T.length;if(w>0){let D=m.clone(m.ZERO,nDe),R=Number.NEGATIVE_INFINITY;for(let L=0;L<w;++L){E=Z.multiplyByVector(p,Z.multiplyByVector(f,T[L],KZ),KZ);let N=m.normalize(m.subtract(E,n,pM),pM),_=m.dot(N,i);_>R&&(R=_,D=m.clone(E,D))}let O=t.cartesianToCartographic(D,iDe);return R=P.clamp(R,0,1),S=m.magnitude(m.subtract(D,n,pM))*Math.sqrt(1-R*R),S=r?-S:S,O.height=S,t.cartographicToCartesian(O,new m)}};var rDe=new m;eo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let r=m.subtract(t,e,rDe),o=n.normal,s=m.dot(o,r);if(Math.abs(s)<P.EPSILON6)return;let a=m.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(r,c,i),m.add(e,i,i),i};eo.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=m.dot(r,e)+o<0,a=m.dot(r,t)+o<0,c=m.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return eo.lineSegmentPlane(e,t,i,f),eo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return eo.lineSegmentPlane(t,n,i,f),eo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return eo.lineSegmentPlane(n,e,i,f),eo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return eo.lineSegmentPlane(e,n,i,f),eo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return eo.lineSegmentPlane(n,t,i,f),eo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return eo.lineSegmentPlane(t,e,i,f),eo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var Ki=eo;var A8=new oe;function am(e,t){t=y(t,re.WGS84),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(B.getColumn(n,0,A8)),this._yAxis=m.fromCartesian4(B.getColumn(n,1,A8));let i=m.fromCartesian4(B.getColumn(n,2,A8));this._plane=fn.fromPointNormal(e,i)}Object.defineProperties(am.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var oDe=new e0;am.fromPoints=function(e,t){let n=e0.fromPoints(e,oDe);return new am(n.center,t)};var QZ=new On,_M=new m;am.prototype.projectPointOntoPlane=function(e,t){let n=QZ;n.origin=e,m.normalize(e,n.direction);let i=Ki.rayPlane(n,this._plane,_M);if(l(i)||(m.negate(n.direction,n.direction),i=Ki.rayPlane(n,this._plane,_M)),l(i)){let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new H(o,s)}};am.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};am.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new H);let n=QZ;n.origin=e,m.clone(this._plane.normal,n.direction);let i=Ki.rayPlane(n,this._plane,_M);l(i)||(m.negate(n.direction,n.direction),i=Ki.rayPlane(n,this._plane,_M));let r=m.subtract(i,this._origin,i),o=m.dot(this._xAxis,r),s=m.dot(this._yAxis,r);return t.x=o,t.y=s,t};am.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var sDe=new m;am.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=sDe;return m.multiplyByScalar(r,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(o,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};am.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Ma=am;function Ii(e,t){this.center=m.clone(y(e,m.ZERO)),this.halfAxes=Z.clone(y(t,Z.ZERO))}Ii.packedLength=m.packedLength+Z.packedLength;Ii.pack=function(e,t,n){return n=y(n,0),m.pack(e.center,t,n),Z.pack(e.halfAxes,t,n+m.packedLength),t};Ii.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ii),m.unpack(e,t,n.center),Z.unpack(e,t+m.packedLength,n.halfAxes),n};var aDe=new m,cDe=new m,lDe=new m,uDe=new m,fDe=new m,dDe=new m,mDe=new Z,hDe={unitary:new Z,diagonal:new Z};Ii.fromPoints=function(e,t){if(l(t)||(t=new Ii),!l(e)||e.length===0)return t.halfAxes=Z.ZERO,t.center=m.ZERO,t;let n,i=e.length,r=m.clone(e[0],aDe);for(n=1;n<i;n++)m.add(r,e[n],r);let o=1/i;m.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],r,cDe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=mDe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let h=Z.computeEigenDecomposition(g,hDe),A=Z.clone(h.unitary,t.halfAxes),x=Z.getColumn(A,0,uDe),C=Z.getColumn(A,1,fDe),T=Z.getColumn(A,2,dDe),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE,D=Number.MAX_VALUE,R=Number.MAX_VALUE,O=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],E=Math.max(m.dot(x,p),E),S=Math.max(m.dot(C,p),S),w=Math.max(m.dot(T,p),w),D=Math.min(m.dot(x,p),D),R=Math.min(m.dot(C,p),R),O=Math.min(m.dot(T,p),O);x=m.multiplyByScalar(x,.5*(D+E),x),C=m.multiplyByScalar(C,.5*(R+S),C),T=m.multiplyByScalar(T,.5*(O+w),T);let L=m.add(x,C,t.center);m.add(L,T,L);let N=lDe;return N.x=E-D,N.y=S-R,N.z=w-O,m.multiplyByScalar(N,.5,N),Z.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var rQ=new m,pDe=new m;function $Z(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new Ii);let d=f.halfAxes;Z.setColumn(d,0,t,d),Z.setColumn(d,1,n,d),Z.setColumn(d,2,i,d);let p=rQ;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=pDe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let h=f.center;return p=Z.multiplyByVector(d,p,p),m.add(e,p,h),Z.multiplyByScale(d,g,d),f}var eQ=new he,_De=new m,gDe=new he,yDe=new he,ADe=new he,xDe=new he,CDe=new he,TDe=new m,tQ=new m,EDe=new m,nQ=new m,bDe=new m,SDe=new H,vDe=new H,wDe=new H,DDe=new H,IDe=new H,PDe=new m,ODe=new m,RDe=new m,MDe=new m,BDe=new H,LDe=new m,NDe=new m,FDe=new m,UDe=new fn(m.UNIT_X,0);Ii.fromRectangle=function(e,t,n,i,r){t=y(t,0),n=y(n,0),i=y(i,re.WGS84);let o,s,a,c,u,f,d;if(e.width<=P.PI){let R=ce.center(e,eQ),O=i.cartographicToCartesian(R,_De),L=new Ma(O,i);d=L.plane;let N=R.longitude,_=e.south<0&&e.north>0?0:R.latitude,b=he.fromRadians(N,e.north,n,gDe),v=he.fromRadians(e.west,e.north,n,yDe),I=he.fromRadians(e.west,_,n,ADe),M=he.fromRadians(e.west,e.south,n,xDe),F=he.fromRadians(N,e.south,n,CDe),k=i.cartographicToCartesian(b,TDe),V=i.cartographicToCartesian(v,tQ),G=i.cartographicToCartesian(I,EDe),U=i.cartographicToCartesian(M,nQ),q=i.cartographicToCartesian(F,bDe),Y=L.projectPointToNearestOnPlane(k,SDe),Q=L.projectPointToNearestOnPlane(V,vDe),W=L.projectPointToNearestOnPlane(G,wDe),K=L.projectPointToNearestOnPlane(U,DDe),J=L.projectPointToNearestOnPlane(q,IDe);return o=Math.min(Q.x,W.x,K.x),s=-o,c=Math.max(Q.y,Y.y),a=Math.min(K.y,J.y),v.height=M.height=t,V=i.cartographicToCartesian(v,tQ),U=i.cartographicToCartesian(M,nQ),u=Math.min(fn.getPointDistance(d,V),fn.getPointDistance(d,U)),f=n,$Z(L.origin,L.xAxis,L.yAxis,L.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,A=ce.center(e,eQ).longitude,x=m.fromRadians(A,h,n,i,PDe);x.z=0;let T=Math.abs(x.x)<P.EPSILON10&&Math.abs(x.y)<P.EPSILON10?m.UNIT_X:m.normalize(x,ODe),E=m.UNIT_Z,S=m.cross(T,E,RDe);d=fn.fromPointNormal(x,T,UDe);let w=m.fromRadians(A+P.PI_OVER_TWO,h,n,i,MDe);s=m.dot(fn.projectPointOntoPlane(d,w,BDe),S),o=-s,c=m.fromRadians(0,e.north,g?t:n,i,LDe).z,a=m.fromRadians(0,e.south,p?t:n,i,NDe).z;let D=m.fromRadians(e.east,h,n,i,FDe);return u=fn.getPointDistance(d,D),f=0,$Z(x,S,E,T,o,s,a,c,u,f,r)};Ii.fromTransformation=function(e,t){return l(t)||(t=new Ii),t.center=B.getTranslation(e,t.center),t.halfAxes=B.getMatrix3(e,t.halfAxes),t.halfAxes=Z.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Ii.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),Z.clone(e.halfAxes,t.halfAxes),t):new Ii(e.center,e.halfAxes)};Ii.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[Z.COLUMN0ROW0]+s*r[Z.COLUMN0ROW1]+a*r[Z.COLUMN0ROW2])+Math.abs(o*r[Z.COLUMN1ROW0]+s*r[Z.COLUMN1ROW1]+a*r[Z.COLUMN1ROW2])+Math.abs(o*r[Z.COLUMN2ROW0]+s*r[Z.COLUMN2ROW1]+a*r[Z.COLUMN2ROW2]),u=m.dot(i,n)+t.distance;return u<=-c?tn.OUTSIDE:u>=c?tn.INSIDE:tn.INTERSECTING};var oQ=new m,sQ=new m,aQ=new m,VDe=new m,iQ=new m,kDe=new m;Ii.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,rQ),i=e.halfAxes,r=Z.getColumn(i,0,oQ),o=Z.getColumn(i,1,sQ),s=Z.getColumn(i,2,aQ),a=m.magnitude(r),c=m.magnitude(o),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(r,a,r):f=!1,c>0?m.divideByScalar(o,c,o):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,A,x;if(g===1){let S=r;h=o,A=s,d?p||(S=s,A=r):(S=o,h=r),x=m.cross(h,A,iQ),S===r?r=x:S===o?o=x:S===s&&(s=x)}else if(g===2){h=r,d?h=o:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),A=m.cross(h,S,VDe),m.normalize(A,A),x=m.cross(h,A,iQ),m.normalize(x,x),h===r?(o=A,s=x):h===o?(s=A,r=x):h===s&&(r=A,o=x)}else g===3&&(r=m.UNIT_X,o=m.UNIT_Y,s=m.UNIT_Z);let C=kDe;C.x=m.dot(n,r),C.y=m.dot(n,o),C.z=m.dot(n,s);let T=0,E;return C.x<-a?(E=C.x+a,T+=E*E):C.x>a&&(E=C.x-a,T+=E*E),C.y<-c?(E=C.y+c,T+=E*E):C.y>c&&(E=C.y-c,T+=E*E),C.z<-u?(E=C.z+u,T+=E*E):C.z>u&&(E=C.z-u,T+=E*E),T};var zDe=new m,HDe=new m;Ii.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Wc);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,oQ),u=Z.getColumn(a,1,sQ),f=Z.getColumn(a,2,aQ),d=m.add(c,u,zDe);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,HDe),g=m.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var GDe=new m,WDe=new m,jDe=new m;Ii.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,r=Z.getColumn(i,0,GDe),o=Z.getColumn(i,1,WDe),s=Z.getColumn(i,2,jDe);return m.clone(n,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],r,t[1]),m.subtract(t[1],o,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],r,t[2]),m.add(t[2],o,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],r,t[3]),m.add(t[3],o,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],r,t[4]),m.subtract(t[4],o,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],r,t[5]),m.subtract(t[5],o,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],r,t[6]),m.add(t[6],o,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],r,t[7]),m.add(t[7],o,t[7]),m.add(t[7],s,t[7]),t};var YDe=new Z;Ii.computeTransformation=function(e,t){l(t)||(t=new B);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,YDe);return B.fromRotationTranslation(i,n,t)};var qDe=new ae;Ii.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,qDe);return!t.isBoundingSphereVisible(n)};Ii.prototype.intersectPlane=function(e){return Ii.intersectPlane(this,e)};Ii.prototype.distanceSquaredTo=function(e){return Ii.distanceSquaredTo(this,e)};Ii.prototype.computePlaneDistances=function(e,t,n){return Ii.computePlaneDistances(this,e,t,n)};Ii.prototype.computeCorners=function(e){return Ii.computeCorners(this,e)};Ii.prototype.computeTransformation=function(e){return Ii.computeTransformation(this,e)};Ii.prototype.isOccluded=function(e){return Ii.isOccluded(this,e)};Ii.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Ii.prototype.clone=function(e){return Ii.clone(this,e)};Ii.prototype.equals=function(e){return Ii.equals(this,e)};var Ln=Ii;var gM={};gM.getHeight=function(e,t,n){return(e-n)*t+n};var XDe=new m;gM.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,XDe),s=gM.getHeight(o.height,n,i);return m.fromRadians(o.longitude,o.latitude,s,t,r)};var Yc=gM;var yM=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; - -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -void main() -{ - vec4 position = czm_computePosition(); - -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); - - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D - - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; - - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; - - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif - - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var n0=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); -} -`;var cQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};cQ.NUMBER_OF_CLASSIFICATION_TYPES=3;var Hn=Object.freeze(cQ);var KDe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},pc=Object.freeze(KDe);function JDe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var AM=JDe;function Nh(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=ZDe(t),r=e.floatingPointTexture,o=i===Qe.FLOAT&&!r,s=QDe(t,o),a=$De(s,t,o),c=Math.floor(Gt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,h=1/d,A=h*.5;this._textureDimensions=new H(f,d),this._textureStep=new oe(p,g,h,A),this._pixelDatatype=o?Qe.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let x=4*f*d;this._batchValues=i===Qe.FLOAT&&!o?new Float32Array(x):new Uint8Array(x),this._batchValuesDirty=!1}Object.defineProperties(Nh.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function ZDe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Qe.FLOAT:Qe.UNSIGNED_BYTE}function uQ(e,t){let n=e[t].componentsPerAttribute;return n===2?H:n===3?m:n===4?oe:Number}function QDe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function $De(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?r+4:r+1}var mS=new oe;function eIe(e,t,n){let i=oe.unpack(e,t,mS),r=oe.unpackFloat(i);i=oe.unpack(e,t+4,mS);let o=oe.unpackFloat(i);i=oe.unpack(e,t+8,mS);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,mS);let a=oe.unpackFloat(i);return oe.fromElements(r,o,s,a,n)}function tIe(e,t,n){let i=oe.packFloat(e.x,mS);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var lQ=new oe;Nh.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==Qe.UNSIGNED_BYTE?a=eIe(this._batchValues,s,lQ):a=oe.unpack(this._batchValues,s,lQ);let c=uQ(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var nIe=[void 0,void 0,new H,new m,new oe],iIe=new oe;Nh.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=nIe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=uQ(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=iIe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Qe.UNSIGNED_BYTE?tIe(c,this._batchValues,d):oe.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function rIe(e,t){let n=e._textureDimensions;e._texture=new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:mn.NEAREST,flipY:!1})}function oIe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Nh.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||rIe(this,e.context),oIe(this))};Nh.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:gt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function sIe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function aIe(e){return e===1?"float":`vec${e}`}function cIe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function lIe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=aIe(r),a=cIe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==Qe.UNSIGNED_BYTE?u+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:u+=` vec4 textureValue = texture(batchTexture, st); -`,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Qe.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===Qe.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; -`),u+=` return value; -} -`,u}Nh.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${sIe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=lIe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} -${t} -${s}`}};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Qx=Nh;var Ji={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ji.getMathType=function(e){switch(e){case Ji.SCALAR:return Number;case Ji.VEC2:return H;case Ji.VEC3:return m;case Ji.VEC4:return oe;case Ji.MAT2:return er;case Ji.MAT3:return Z;case Ji.MAT4:return B}};Ji.getNumberOfComponents=function(e){switch(e){case Ji.SCALAR:return 1;case Ji.VEC2:return 2;case Ji.VEC3:return 3;case Ji.VEC4:case Ji.MAT2:return 4;case Ji.MAT3:return 9;case Ji.MAT4:return 16}};Ji.getAttributeLocationCount=function(e){switch(e){case Ji.SCALAR:case Ji.VEC2:case Ji.VEC3:case Ji.VEC4:return 1;case Ji.MAT2:return 2;case Ji.MAT3:return 3;case Ji.MAT4:return 4}};Ji.getGlslType=function(e){switch(e){case Ji.SCALAR:return"float";case Ji.VEC2:return"vec2";case Ji.VEC3:return"vec3";case Ji.VEC4:return"vec4";case Ji.MAT2:return"mat2";case Ji.MAT3:return"mat3";case Ji.MAT4:return"mat4"}};var ln=Object.freeze(Ji);var fQ=1/256,dQ=256,mr={};mr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(r)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};mr.octEncode=function(e,t){return mr.octEncodeInRange(e,255,t)};var hS=new H,mQ=new Uint8Array(1);function xM(e){return mQ[0]=e,mQ[0]}mr.octEncodeToCartesian4=function(e,t){return mr.octEncodeInRange(e,65535,hS),t.x=xM(hS.x*fQ),t.y=xM(hS.x),t.z=xM(hS.y*fQ),t.w=xM(hS.y),t};mr.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(r),i.y=(1-Math.abs(r))*P.signNotZero(i.y)}return m.normalize(i,i)};mr.octDecode=function(e,t,n){return mr.octDecodeInRange(e,t,255,n)};mr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*dQ+i,a=r*dQ+o;return mr.octDecodeInRange(s,a,65535,t)};mr.octPackFloat=function(e){return 256*e.x+e.y};var C8=new H;mr.octEncodeFloat=function(e){return mr.octEncode(e,C8),mr.octPackFloat(C8)};mr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return mr.octDecode(i,r,t)};mr.octPack=function(e,t,n,i){let r=mr.octEncodeFloat(e),o=mr.octEncodeFloat(t),s=mr.octEncode(n,C8);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};mr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;mr.octDecodeFloat(s,t),mr.octDecodeFloat(c,n),mr.octDecode(o,a,i)};mr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};mr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function x8(e){return e>>1^-(e&1)}mr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=x8(e[a]),o+=x8(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=x8(n[a]),n[a]=s)};mr.dequantize=function(e,t,n,i){let r=ln.getNumberOfComponents(n),o;switch(t){case X.BYTE:o=127;break;case X.UNSIGNED_BYTE:o=255;break;case X.SHORT:o=32767;break;case X.UNSIGNED_SHORT:o=65535;break;case X.INT:o=2147483647;break;case X.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};mr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=(1<<5)-1,r=(1<<6)-1,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var qn=mr;var hQ=new m,pQ=new m,_Q=new m;function uIe(e,t,n,i,r){l(r)||(r=new m);let o,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=m.subtract(n,t,hQ),s=m.subtract(i,t,pQ),a=m.subtract(e,t,_Q),c=m.dot(o,o),u=m.dot(o,s),f=m.dot(o,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,r);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,r);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,r);o=H.subtract(n,t,hQ),s=H.subtract(i,t,pQ),a=H.subtract(e,t,_Q),c=H.dot(o,o),u=H.dot(o,s),f=H.dot(o,a),d=H.dot(s,s),p=H.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var $x=uIe;var T8={};T8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};T8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r;function o(_,b,v,I){for(;b.length>=1;){let M=b[b.length-1];if(b.splice(b.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<I;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,b,v,I,M,F,k){let V=-1,G,U=-1,q=0;for(;q<v.length;){let Y=v[q];I[Y].numLiveTriangles&&(G=0,M-I[Y].timeStamp+2*I[Y].numLiveTriangles<=b&&(G=M-I[Y].timeStamp),(G>U||U===-1)&&(U=G,V=Y)),++q}return V===-1?o(I,F,_,k):V}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let h=0;for(;u<d;)p[t[u]].vertexTriangles.push(h),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(h),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(h),++p[t[u+2]].numLiveTriangles,++h,u+=3;let A=0,x=i+1;r=1;let C=[],T=[],E,S,w=0,D=[],R=a/3,O=[];for(g=0;g<R;g++)O[g]=!1;let L,N;for(;A!==-1;){C=[],S=p[A],N=S.vertexTriangles.length;for(let _=0;_<N;++_)if(h=S.vertexTriangles[_],!O[h]){O[h]=!0,u=h+h+h;for(let b=0;b<3;++b)L=t[u],C.push(L),T.push(L),D[w]=L,++w,E=p[L],--E.numLiveTriangles,x-E.timeStamp>i&&(E.timeStamp=x,++x),++u}A=s(t,i,C,p,x,T,c)}return D};var CM=T8;var _c={};function DM(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function fIe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)DM(i,r,e[o],e[o+1],e[o+2]);return i}function dIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);DM(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)DM(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function mIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)DM(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}_c.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Le.TRIANGLES:e.indices=fIe(t);break;case Le.TRIANGLE_STRIP:e.indices=dIe(t);break;case Le.TRIANGLE_FAN:e.indices=mIe(t);break}e.primitiveType=Le.LINES}return e};_c.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new dt({attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Le.LINES,boundingSphere:c})};_c.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};_c.reorderForPreVertexCache=function(e){let t=dt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=Ue.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],h=g.values,A=0,x=g.componentsPerAttribute,C=X.createTypedArray(g.componentDatatype,u*x);for(;A<t;){let T=i[A];if(T!==-1)for(let E=0;E<x;E++)C[x*T+E]=h[x*A+E];++A}g.values=C}}return e};_c.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Le.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=CM.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function gQ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new De({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function hIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}_c.fitToUnsignedShortIndices=function(e){let t=[],n=dt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=gQ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Le.TRIANGLES?u=3:e.primitiveType===Le.LINES?u=2:e.primitiveType===Le.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,hIe(s,e.attributes,p)),r.push(g)}o+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=gQ(e.attributes))}r.length!==0&&t.push(new dt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var yQ=new m,pIe=new he;_c.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Di;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=m.fromArray(a,f,yQ),p=s.cartesianToCartographic(d,pIe),g=r.project(p,yQ);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var E8={high:0,low:0};_c.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Yn.encode(o[f],E8),a[f]=E8.high,c[f]=E8.low;let u=r.componentsPerAttribute;return e.attributes[n]=new De({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new De({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Gf=new m;function b8(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,Gf),B.multiplyByPoint(e,Gf,Gf),m.pack(Gf,n,r)}}function S8(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)m.unpack(n,r,Gf),Z.multiplyByVector(e,Gf,Gf),Gf=m.normalize(Gf,Gf),m.pack(Gf,n,r)}}var TM=new B,EM=new Z;_c.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(B.equals(t,B.IDENTITY))return e;let n=e.geometry.attributes;b8(t,n.position),b8(t,n.prevPosition),b8(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(B.inverse(t,TM),B.transpose(TM,TM),B.getMatrix3(TM,EM),S8(EM,n.normal),S8(EM,n.tangent),S8(EM,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=B.clone(B.IDENTITY),e};function _Ie(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new De({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var gIe=new m;function v8(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=_Ie(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let h;if(c){let T=0;for(r=0;r<n;++r)T+=e[r][t].indices.length;let E=dt.computeNumberOfVertices(new dt({attributes:f,primitiveType:Le.POINTS})),S=Ue.createTypedArray(E,T),w=0,D=0;for(r=0;r<n;++r){let R=e[r][t].indices,O=R.length;for(s=0;s<O;++s)S[w++]=D+R[s];D+=dt.computeNumberOfVertices(e[r][t])}h=S}let A=new m,x=0,C;for(r=0;r<n;++r){if(C=e[r][t].boundingSphere,!l(C)){A=void 0;break}m.add(C.center,A,A)}if(l(A))for(m.divideByScalar(A,n,A),r=0;r<n;++r){C=e[r][t].boundingSphere;let T=m.magnitude(m.subtract(C.center,A,gIe))+C.radius;T>x&&(x=T)}return new dt({attributes:f,indices:h,primitiveType:u,boundingSphere:l(A)?new ae(A,x):void 0})}_c.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(v8(t,"geometry")),n.length>0&&(r.push(v8(n,"westHemisphereGeometry")),r.push(v8(n,"eastHemisphereGeometry"))),r};var Mu=new m,pS=new m,eC=new m,tC=new m;_c.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let h=t[u],A=t[u+1],x=t[u+2],C=h*3,T=A*3,E=x*3;pS.x=i[C],pS.y=i[C+1],pS.z=i[C+2],eC.x=i[T],eC.y=i[T+1],eC.z=i[T+2],tC.x=i[E],tC.y=i[E+1],tC.z=i[E+2],s[h].count++,s[A].count++,s[x].count++,m.subtract(eC,pS,eC),m.subtract(tC,pS,tC),a[f]=m.cross(eC,tC,new m),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let h=p.indexOffset+p.currentCount;c[h]=f,p.currentCount++,p=s[t[u+1]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,p=s[t[u+2]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let h=u*3;if(p=s[u],m.clone(m.ZERO,Mu),p.count>0){for(f=0;f<p.count;f++)m.add(Mu,a[c[p.indexOffset+f]],Mu);m.equalsEpsilon(m.ZERO,Mu,P.EPSILON10)&&m.clone(a[c[p.indexOffset]],Mu)}m.equalsEpsilon(m.ZERO,Mu,P.EPSILON10)&&(Mu.z=1),m.normalize(Mu,Mu),g[h]=Mu.x,g[h+1]=Mu.y,g[h+2]=Mu.z}return e.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var yIe=new m,AQ=new m,AIe=new m;_c.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let A=n[u],x=n[u+1],C=n[u+2];f=A*3,d=x*3,p=C*3;let T=A*2,E=x*2,S=C*2,w=i[f],D=i[f+1],R=i[f+2],O=o[T],L=o[T+1],N=o[E+1]-L,_=o[S+1]-L,b=1/((o[E]-O)*_-(o[S]-O)*N),v=(_*(i[d]-w)-N*(i[p]-w))*b,I=(_*(i[d+1]-D)-N*(i[p+1]-D))*b,M=(_*(i[d+2]-R)-N*(i[p+2]-R))*b;c[f]+=v,c[f+1]+=I,c[f+2]+=M,c[d]+=v,c[d+1]+=I,c[d+2]+=M,c[p]+=v,c[p+1]+=I,c[p+2]+=M}let g=new Float32Array(s*3),h=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let A=m.fromArray(r,f,yIe),x=m.fromArray(c,f,AIe),C=m.dot(A,x);m.multiplyByScalar(A,C,AQ),m.normalize(m.subtract(x,AQ,x),x),g[f]=x.x,g[d]=x.y,g[p]=x.z,m.normalize(m.cross(A,x,x),x),h[f]=x.x,h[d]=x.y,h[p]=x.z}return e.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h}),e};var _S=new H,Hf=new m,xQ=new m,CQ=new m,bM=new H;_c.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let R=new Float32Array(i*2),O=0;for(n=0;n<i;++n){if(m.fromArray(D,n*3,Hf),m.equals(Hf,m.ZERO)){O+=2;continue}bM=qn.octEncodeInRange(Hf,65535,bM),R[O++]=bM.x,R[O++]=bM.y}return e.attributes.compressedAttributes=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:R}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,h,A;s&&(p=r.values),a&&(g=o.values),f&&(h=c.values),d&&(A=u.values),i=(s?p.length:g.length)/(s?3:2);let T=i,E=a&&s?2:1;E+=f||d?1:0,T*=E;let S=new Float32Array(T),w=0;for(n=0;n<i;++n){a&&(H.fromArray(g,n*2,_S),S[w++]=qn.compressTextureCoordinates(_S));let D=n*3;s&&l(h)&&l(A)?(m.fromArray(p,D,Hf),m.fromArray(h,D,xQ),m.fromArray(A,D,CQ),qn.octPack(Hf,xQ,CQ,_S),S[w++]=_S.x,S[w++]=_S.y):(s&&(m.fromArray(p,D,Hf),S[w++]=qn.octEncodeFloat(Hf)),f&&(m.fromArray(h,D,Hf),S[w++]=qn.octEncodeFloat(Hf)),d&&(m.fromArray(A,D,Hf),S[w++]=qn.octEncodeFloat(Hf)))}return e.attributes.compressedAttributes=new De({componentDatatype:X.FLOAT,componentsPerAttribute:E,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function xIe(e){if(l(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function CIe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Le.TRIANGLES,e}function TIe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Le.TRIANGLES,e}function EIe(e){if(l(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function bIe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Le.LINES,e}function SIe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Le.LINES,e}function vIe(e){switch(e.primitiveType){case Le.TRIANGLE_FAN:return CIe(e);case Le.TRIANGLE_STRIP:return TIe(e);case Le.TRIANGLES:return xIe(e);case Le.LINE_STRIP:return bIe(e);case Le.LINE_LOOP:return SIe(e);case Le.LINES:return EIe(e)}return e}function T_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function wIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){T_(e,e.y<0),T_(t,t.y<0),T_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;T_(e,a),T_(t,a),T_(n,a)}var TQ=new m;function Bu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,TQ),e.y/(e.y-t.y),TQ),n),m.clone(n,i),T_(n,!0),T_(i,!1)}var i0=new m,r0=new m,o0=new m,s0=new m,w8={positions:new Array(7),indices:new Array(3*3)};function DIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;wIe(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=w8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Bu(e,t,i0,o0),Bu(e,n,r0,s0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Bu(t,n,i0,o0),Bu(t,e,r0,s0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Bu(n,e,i0,o0),Bu(n,t,r0,s0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Bu(n,e,i0,o0),Bu(n,t,r0,s0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Bu(t,n,i0,o0),Bu(t,e,r0,s0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Bu(e,t,i0,o0),Bu(e,n,r0,s0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=w8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=i0,c[4]=r0,c[5]=o0,c[6]=s0,c.length=7),w8}function EQ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=X.createTypedArray(o.componentDatatype,o.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function iC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new De({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function O8(e,t,n){let i=l(e.geometry.boundingSphere);t=EQ(t,i),n=EQ(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function R8(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),h=e.fromArray(u,s*t,i),A=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(A,c.z,A);let x=e.add(g,h,g);e.add(x,A,x),p&&e.normalize(x,x),e.pack(x,f,d*t)}}var IIe=R8(oe,4),wM=R8(m,3),IQ=R8(H,2),PIe=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>P.EPSILON6?1:0},gS=new m,D8=new m,I8=new m,OIe=new m;function SM(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let x=m.fromArray(r,e*3,gS),C=m.fromArray(r,t*3,D8),T=m.fromArray(r,n*3,I8),E=$x(i,x,C,T,OIe);if(l(E)){if(l(o)&&wM(e,t,n,E,o,d.normal.values,A,!0),l(u)){let S=m.fromArray(u,e*3,gS),w=m.fromArray(u,t*3,D8),D=m.fromArray(u,n*3,I8);m.multiplyByScalar(S,E.x,S),m.multiplyByScalar(w,E.y,w),m.multiplyByScalar(D,E.z,D);let R;!m.equals(S,m.ZERO)||!m.equals(w,m.ZERO)||!m.equals(D,m.ZERO)?(R=m.add(S,w,S),m.add(R,D,R),m.normalize(R,R)):(R=gS,R.x=0,R.y=0,R.z=0),m.pack(R,d.extrudeDirection.values,A*3)}if(l(f)&&PIe(e,t,n,E,f,d.applyOffset.values,A),l(s)&&wM(e,t,n,E,s,d.tangent.values,A,!0),l(a)&&wM(e,t,n,E,a,d.bitangent.values,A,!0),l(c)&&IQ(e,t,n,E,c,d.st.values,A),g>0)for(let S=0;S<g;S++){let w=p[S];RIe(e,t,n,E,A,h[w],d[w])}}}function RIe(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:IIe(e,t,n,i,c,u,r,!1);break;case 3:wM(e,t,n,i,c,u,r,!1);break;case 2:IQ(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function cm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var MIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function bQ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let R in n)n.hasOwnProperty(R)&&!MIe[R]&&l(n[R])&&d.push(R);let p=d.length,g=iC(t),h=iC(t),A,x,C,T,E,S=[];S.length=i.length/3;let w=[];for(w.length=i.length/3,E=0;E<S.length;++E)S[E]=-1,w[E]=-1;let D=f.length;for(E=0;E<D;E+=3){let R=f[E],O=f[E+1],L=f[E+2],N=m.fromArray(i,R*3),_=m.fromArray(i,O*3),b=m.fromArray(i,L*3),v=DIe(N,_,b);if(l(v)&&v.positions.length>3){let I=v.positions,M=v.indices,F=M.length;for(let k=0;k<F;++k){let V=M[k],G=I[V];G.y<0?(A=h.attributes,x=h.indices,C=S):(A=g.attributes,x=g.indices,C=w),T=cm(A,x,C,f,V<3?E+V:-1,G),SM(R,O,L,G,i,r,s,o,a,c,u,A,d,p,n,T)}}else l(v)&&(N=v.positions[0],_=v.positions[1],b=v.positions[2]),N.y<0?(A=h.attributes,x=h.indices,C=S):(A=g.attributes,x=g.indices,C=w),T=cm(A,x,C,f,E,N),SM(R,O,L,N,i,r,s,o,a,c,u,A,d,p,n,T),T=cm(A,x,C,f,E+1,_),SM(R,O,L,_,i,r,s,o,a,c,u,A,d,p,n,T),T=cm(A,x,C,f,E+2,b),SM(R,O,L,b,i,r,s,o,a,c,u,A,d,p,n,T)}O8(e,h,g)}var PQ=fn.fromPointNormal(m.ZERO,m.UNIT_Y),BIe=new m,LIe=new m;function nC(e,t,n,i,r,o,s){if(!l(s))return;let a=m.fromArray(i,e*3,gS);m.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function SQ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=iC(t),a=iC(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],h=m.fromArray(i,p*3,gS),A=m.fromArray(i,g*3,D8),x;Math.abs(h.y)<P.EPSILON6&&(h.y<0?h.y=-P.EPSILON6:h.y=P.EPSILON6),Math.abs(A.y)<P.EPSILON6&&(A.y<0?A.y=-P.EPSILON6:A.y=P.EPSILON6);let C=s.attributes,T=s.indices,E=d,S=a.attributes,w=a.indices,D=f,R=Ki.lineSegmentPlane(h,A,PQ,I8);if(l(R)){let O=m.multiplyByScalar(m.UNIT_Y,5*P.EPSILON9,BIe);h.y<0&&(m.negate(O,O),C=a.attributes,T=a.indices,E=f,S=s.attributes,w=s.indices,D=d);let L=m.add(R,O,LIe);x=cm(C,T,E,o,c,h),nC(p,g,h,i,x,C,r),x=cm(C,T,E,o,-1,L),nC(p,g,L,i,x,C,r),m.negate(O,O),m.add(R,O,L),x=cm(S,w,D,o,-1,L),nC(p,g,L,i,x,S,r),x=cm(S,w,D,o,c+1,A),nC(p,g,A,i,x,S,r)}else{let O,L,N;h.y<0?(O=a.attributes,L=a.indices,N=f):(O=s.attributes,L=s.indices,N=d),x=cm(O,L,N,o,c,h),nC(p,g,h,i,x,O,r),x=cm(O,L,N,o,c+1,A),nC(p,g,A,i,x,O,r)}}O8(e,a,s)}var vQ=new H,NIe=new H,OQ=new m,RQ=new m,P8=new m,FIe=new m,UIe=new m,VIe=new m,wQ=new oe;function DQ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=m.unpack(n,s,OQ);if(a.x>0)continue;let c=m.unpack(i,s,RQ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(r,s,P8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):m.pack(a,r,s))}}var kIe=5*P.EPSILON9,vM=P.EPSILON6;function zIe(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=iC(t),f=iC(t),d,p,g,h=!1,A=i.length/3;for(d=0;d<A;d+=4){let x=d,C=d+2,T=m.fromArray(i,x*3,OQ),E=m.fromArray(i,C*3,RQ);if(Math.abs(T.y)<vM)for(T.y=vM*(E.y<0?-1:1),i[d*3+1]=T.y,i[(d+1)*3+1]=T.y,p=x*3;p<x*3+4*3;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(E.y)<vM)for(E.y=vM*(T.y<0?-1:1),i[(d+2)*3+1]=E.y,i[(d+3)*3+1]=E.y,p=x*3;p<x*3+4*3;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let S=u.attributes,w=u.indices,D=f.attributes,R=f.indices,O=Ki.lineSegmentPlane(T,E,PQ,FIe);if(l(O)){h=!0;let L=m.multiplyByScalar(m.UNIT_Y,kIe,UIe);T.y<0&&(m.negate(L,L),S=f.attributes,w=f.indices,D=u.attributes,R=u.indices);let N=m.add(O,L,VIe);S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.position.values.push(N.x,N.y,N.z),S.position.values.push(N.x,N.y,N.z),S.prevPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),S.prevPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]),S.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),S.nextPosition.values.push(N.x,N.y,N.z),m.negate(L,L),m.add(O,L,N),D.position.values.push(N.x,N.y,N.z),D.position.values.push(N.x,N.y,N.z),D.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.nextPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),D.nextPosition.values.push(o[C*3],o[C*3+1],o[C*3+2]),D.nextPosition.values.push(o[C*3+3],o[C*3+4],o[C*3+5]);let _=H.fromArray(s,x*2,vQ),b=Math.abs(_.y);S.expandAndWidth.values.push(-1,b,1,b),S.expandAndWidth.values.push(-1,-b,1,-b),D.expandAndWidth.values.push(-1,b,1,b),D.expandAndWidth.values.push(-1,-b,1,-b);let v=m.magnitudeSquared(m.subtract(O,T,P8));if(v/=m.magnitudeSquared(m.subtract(E,T,P8)),l(c)){let I=oe.fromArray(c,x*4,wQ),M=oe.fromArray(c,C*4,wQ),F=P.lerp(I.x,M.x,v),k=P.lerp(I.y,M.y,v),V=P.lerp(I.z,M.z,v),G=P.lerp(I.w,M.w,v);for(p=x*4;p<x*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(F,k,V,G),S.color.values.push(F,k,V,G),D.color.values.push(F,k,V,G),D.color.values.push(F,k,V,G),p=C*4;p<C*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let I=H.fromArray(a,x*2,vQ),M=H.fromArray(a,(d+3)*2,NIe),F=P.lerp(I.x,M.x,v);for(p=x*2;p<x*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(F,I.y),S.st.values.push(F,M.y),D.st.values.push(F,I.y),D.st.values.push(F,M.y),p=C*2;p<C*2+2*2;++p)D.st.values.push(a[p])}g=S.position.values.length/3-4,w.push(g,g+2,g+1),w.push(g+1,g+2,g+3),g=D.position.values.length/3-4,R.push(g,g+2,g+1),R.push(g+1,g+2,g+3)}else{let L,N;for(T.y<0?(L=f.attributes,N=f.indices):(L=u.attributes,N=u.indices),L.position.values.push(T.x,T.y,T.z),L.position.values.push(T.x,T.y,T.z),L.position.values.push(E.x,E.y,E.z),L.position.values.push(E.x,E.y,E.z),p=d*3;p<d*3+4*3;++p)L.prevPosition.values.push(r[p]),L.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+4*2;++p)L.expandAndWidth.values.push(s[p]),l(a)&&L.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)L.color.values.push(c[p]);g=L.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}h&&(DQ(f),DQ(u)),O8(e,f,u)}_c.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING))return e;if(t.geometryType!==Nf.NONE)switch(t.geometryType){case Nf.POLYLINES:zIe(e);break;case Nf.TRIANGLES:bQ(e);break;case Nf.LINES:SQ(e);break}else vIe(t),t.primitiveType===Le.TRIANGLES?bQ(e):t.primitiveType===Le.LINES&&SQ(e);return e};var Vn=_c;function qc(e){this._ellipsoid=y(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(qc.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});qc.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};qc.geodeticLatitudeToMercatorAngle=function(e){e>qc.MaximumLatitude?e=qc.MaximumLatitude:e<-qc.MaximumLatitude&&(e=-qc.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};qc.MaximumLatitude=qc.mercatorAngleToGeodeticLatitude(Math.PI);qc.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=qc.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new m(i,r,o)};qc.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=qc.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new he(i,r,o)};var Pi=qc;function HIe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!B.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Vn.transformToWorldCoordinates(e[o]);else B.multiplyTransformation(t,e[0].modelMatrix,t)}function M8(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new De({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function GIe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?M8(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(M8(i.westHemisphereGeometry,n),M8(i.eastHemisphereGeometry,n))}}function WIe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(HIe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Vn.splitLongitude(t[c]);if(GIe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Vn.reorderForPostVertexCache(g.geometry),Vn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Vn.reorderForPostVertexCache(g.westHemisphereGeometry),Vn.reorderForPreVertexCache(g.westHemisphereGeometry),Vn.reorderForPostVertexCache(g.eastHemisphereGeometry),Vn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Vn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let h in g)g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE&&Vn.encodeAttribute(u,h,`${h}3DHigh`,`${h}3DLow`);else for(let h in g)if(g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE){let A=`${h}3D`,x=`${h}2D`;Vn.projectTo2D(u,h,A,x,n),l(u.boundingSphere)&&h==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Vn.encodeAttribute(u,A,`${A}High`,`${A}Low`),Vn.encodeAttribute(u,x,`${x}High`,`${x}Low`)}s&&Vn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Vn.fitToUnsignedShortIndices(u));p=g}return p}function B8(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function jIe(e,t){let n=[];return B8(e,"geometry",t,n),B8(e,"westHemisphereGeometry",t,n),B8(e,"eastHemisphereGeometry",t,n),n}var Fh={};Fh.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=WIe(e),t.length>0&&(n=Vn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=jIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,h=d.westHemisphereGeometry;l(g)&&l(h)&&(l(g.boundingSphere)&&l(h.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,h.boundingSphere)),l(g.boundingSphereCV)&&l(h.boundingSphereCV)&&(u[f]=ae.union(g.boundingSphereCV,h.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function YIe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function qIe(e,t){let n=e.length;for(let i=0;i<n;++i)YIe(e[i],t)}function XIe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ae.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}Fh.packCreateGeometryResults=function(e,t){let n=new Float64Array(XIe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let A in p)p.hasOwnProperty(A)&&l(p[A])&&(g.push(A),l(r[A])||(r[A]=i.length,i.push(A)));n[s++]=g.length;for(let A=0;A<g.length;A++){let x=g[A],C=p[x];n[s++]=r[x],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let h=l(c.indices)?c.indices.length:0;n[s++]=h,h>0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};Fh.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let A,x,C,T=new gn,E=n[s++];for(i=0;i<E;i++){let w=t[n[s++]],D=n[s++];C=n[s++];let R=n[s++]!==0;A=n[s++],x=X.createTypedArray(D,A);for(let O=0;O<A;O++)x[O]=n[s++];T[w]=new De({componentDatatype:D,componentsPerAttribute:C,normalize:R,values:x})}let S;if(A=n[s++],A>0){let w=x.length/C;for(S=Ue.createTypedArray(w,A),i=0;i<A;i++)S[i]=n[s++]}r[o++]=new dt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:S,attributes:T,offsetAttribute:f})}return r};function KIe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(B.pack(s.modelMatrix,i,r),r+=B.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function JIe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=B.unpack(t,r),s;r+=B.packedLength,l(t[r])&&(s={offset:new Xi(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}Fh.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:KIe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Di,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Fh.unpackCombineGeometryParameters=function(e){let t=JIe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=Fh.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=re.clone(e.ellipsoid),s=e.isGeographic?new Di(o):new Pi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:B.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function MQ(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ae.pack(e[o],i,r)):i[r++]=0,r+=ae.packedLength}return i}function BQ(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}Fh.packCombineGeometryResults=function(e,t){l(e.geometries)&&qIe(e.geometries,t);let n=MQ(e.boundingSpheres),i=MQ(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Fh.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:BQ(e.boundingSpheres),boundingSpheresCV:BQ(e.boundingSpheresCV)}};var rC=Fh;var ZIe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Co=Object.freeze(ZIe);var Bl={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Bl.NUMBER_OF_SHADOW_MODES=4;Bl.castShadows=function(e){return e===Bl.ENABLED||e===Bl.CAST_ONLY};Bl.receiveShadows=function(e){return e===Bl.ENABLED||e===Bl.RECEIVE_ONLY};Bl.fromCastReceive=function(e,t){return e&&t?Bl.ENABLED:e?Bl.CAST_ONLY:t?Bl.RECEIVE_ONLY:Bl.DISABLED};var xn=Object.freeze(Bl);function fo(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=new B,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,xn.DISABLED),this._translucent=void 0,this._state=Co.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoad=(r,o,s)=>{this._error=s,this._state=o,r.afterRender.push(function(){if(t._ready=t._state===Co.COMPLETE||t._state===Co.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(fo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function QIe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var $Ie=new H,ePe=new m,GQ=new oe;function WQ(e){let t=e.length;if(t===1)return e[0];if(t===2)return H.unpack(e,0,$Ie);if(t===3)return m.unpack(e,0,ePe);if(t===4)return oe.unpack(e,0,GQ)}function tPe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=QIe(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,h,A;for(g=0;g<s;++g)h=o[g],A=p[h],c[h]=g,a.push({functionName:`czm_batchTable_${h}`,componentDatatype:A.componentDatatype,componentsPerAttribute:A.componentsPerAttribute,normalize:A.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let x=a.length,C=new Qx(t,a,r);for(g=0;g<r;++g){let T=i[g];p=T.attributes;for(let R=0;R<s;++R){h=o[R],A=p[h];let O=WQ(A.value),L=c[h];C.setBatchedAttribute(g,L,O)}let E={primitive:y(T.pickPrimitive,e)};l(T.id)&&(E.id=T.id);let S=t.createPickId(E);e._pickIds.push(S);let w=S.color,D=GQ;D.x=z.floatToByte(w.red),D.y=z.floatToByte(w.green),D.z=z.floatToByte(w.blue),D.w=z.floatToByte(w.alpha),C.setBatchedAttribute(g,x-1,D)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function nPe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new De({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function iPe(e){let t=e.attributes,n=new gn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=nPe(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new dt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function rPe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:B.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var oPe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;fo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=oPe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; -`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView; -`,o+=`in vec4 position; -`,s+=`${c} -{ - return u_modifiedModelView * position; -} - -`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} -{ - return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); -} - -`:(o+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; -} - -`)}return[r,o,t,s].join(` -`)};fo._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${He.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};fo._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function LQ(e){return`${He.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function NQ(e){return`in vec4 v_pickColor; -${e}`}fo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};fo._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; -`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition(); -`;return r+=` if (czm_sceneMode == czm_sceneMode3D) -`,r+=` { -`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` } -`,r+=` else -`,r+=` { -`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` } -`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};fo._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=He.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${r}`};function FQ(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); -`}n&&r&&o?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),r&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),o&&(f+=`vec3 bitangent; -`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,g].join(` -`)}function sPe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function aPe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function UQ(e,t){let n=e.vertexAttributes}function cPe(e,t){return function(){return e[t]}}var L8=Math.max(jt.hardwareConcurrency-1,1),IM,lPe=new pi("combineGeometry");function uPe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===Co.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,geometry:i});if(!l(IM))for(IM=new Array(L8),r=0;r<L8;r++)IM[r]=new pi("createGeometry");let f;for(u=AM(u,L8),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let h;if(d>0){let A=new Float64Array(d);for(h=[A.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,A,f.offset),f.geometry=A)}c.push(IM[r].scheduleTask({subTasks:u[r]},h))}e._state=Co.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Co.CREATED}).catch(function(d){AS(e,t,Co.FAILED,d)})}else if(e._state===Co.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=lPe.scheduleTask(rC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Co.COMBINING,Promise.resolve(f).then(function(d){let p=rC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=B.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Co.COMBINED):AS(e,t,Co.FAILED,void 0)}).catch(function(d){AS(e,t,Co.FAILED,d)})}}function fPe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=iPe(p):g=p.constructor.createGeometry(p),r[c++]=rPe(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=rC.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=B.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Co.COMBINED):AS(e,t,Co.FAILED,void 0)}function dPe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let A=a[i],x=e._batchTable.getBatchedAttribute(i,n,new m);A=o[i].clone(A),XQ(A,x,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let A=a[i];A.center.x-A.radius>0||ae.intersectPlane(A,fn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING?c.push(A):(u.push(A),f.push(A))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)g=ae.union(g,u[i]);let h=[];for(l(d)&&h.push(d),l(p)&&h.push(p),l(g)&&h.push(g),i=0;i<h.length;i++){let A=h[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=A,e._boundingSphereCV[i]=ae.projectTo2D(A,t.mapProjection,e._boundingSphereCV[i])}fo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var VQ=new Yn,jQ=new he,YQ=new m,qQ=new ae;function mPe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let h=0;h<g;++h){let A=p[h];if(!l(A))continue;let x=e.modelMatrix;l(x)&&(A=ae.transform(A,x,qQ));let C=A.center,T=A.radius,E=Yn.fromCartesian(C,VQ);if(d.setBatchedAttribute(h,r,E.high),d.setBatchedAttribute(h,o,E.low),!t.scene3DOnly){let S=f.cartesianToCartographic(C,jQ),w=u.project(S,YQ);E=Yn.fromCartesian(w,VQ),d.setBatchedAttribute(h,s,E.high),d.setBatchedAttribute(h,a,E.low)}d.setBatchedAttribute(h,c,T)}e._batchTableBoundingSpheresUpdated=!0}var N8=new m,hPe=new m;function kQ(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(m.equals(d,m.ZERO)){s.setBatchedAttribute(u,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,qQ));let g=f.center;g=o.scaleToGeodeticSurface(g,hPe);let h=o.cartesianToCartographic(g,jQ),A=r.project(h,YQ),x=m.add(d,g,N8);h=o.cartesianToCartographic(x,h);let C=r.project(h,N8),T=m.subtract(C,A,N8),E=T.x;T.x=T.z,T.z=T.y,T.y=E,s.setBatchedAttribute(u,i,T)}e._batchTableOffsetsUpdated=!0}function pPe(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(si.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,AS(e,t,Co.COMPLETE,void 0)}function _Pe(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ye(r,!1),o.cull={enabled:!0,face:gi.BACK},e._frontFaceRS=ze.fromCache(o),o.cull.face=gi.FRONT,e._backFaceRS=ze.fromCache(o)):(e._frontFaceRS=ze.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Ye(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Ye(r,!1),o.depthTest.func=pc.GREATER,i?(o.cull={enabled:!0,face:gi.BACK},e._frontFaceDepthFailRS=ze.fromCache(o),o.cull.face=gi.FRONT,e._backFaceDepthFailRS=ze.fromCache(o)):(e._frontFaceDepthFailRS=ze.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function gPe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=fo._appendOffsetToShader(e,o),o=fo._appendShowToShader(e,o),o=fo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=LQ(o),o=fo._updateColorAttribute(e,o,!1),o=FQ(e,o),o=fo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=NQ(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),UQ(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=fo._appendShowToShader(e,o),o=fo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=LQ(o),o=fo._updateColorAttribute(e,o,!0),o=FQ(e,o),o=fo._modifyShaderPosition(e,o,t.scene3DOnly),o=sPe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=NQ(s),s=aPe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),UQ(e._spDepthFail,r))}var yS=new B,zQ=new m;function HQ(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=cPe(s,c));let a=gt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return B.multiply(c,e._modelMatrix,yS),B.multiplyByPoint(yS,e.rtcCenter,zQ),B.setTranslation(yS,zQ,yS),yS}),a}function yPe(e,t,n,i,r,o,s,a){let c=HQ(e,t,n,a),u;l(e._depthFailAppearance)&&(u=HQ(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Se.TRANSLUCENT:Se.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let h=0;h<p;++h){let A;r&&(A=o[h],l(A)||(A=o[h]=new nt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,++h),A=o[h],l(A)||(A=o[h]=new nt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,l(e._depthFailAppearance)&&(r&&(++h,A=o[h],l(A)||(A=o[h]=new nt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=u,A.pass=f),++h,A=o[h],l(A)||(A=o[h]=new nt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=u,A.pass=f),++g}}fo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!B.equals(n,e._modelMatrix))for(B.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ae.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ae.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphere2D[r].center.x=0,e._boundingSphereMorph[r]=ae.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function APe(e,t,n,i,r,o,s,a){fo._updateBoundingVolumes(e,t,r);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=xn.castShadows(e.shadows),g=xn.receiveShadows(e.shadows),h=n.length,A=a?2:1;A*=l(e._depthFailAppearance)?2:1;for(let x=0;x<h;++x){let C=Math.floor(x/A),T=n[x];T.modelMatrix=r,T.boundingVolume=c[C],T.cull=o,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=g,d?T.pickId="v_pickColor":T.pickId=void 0,u.push(T)}}}fo.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Co.FAILED)return;let t=e.context;if(l(this._batchTable)||tPe(this,t),this._batchTable.attributes.length>0){if(Gt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Co.COMPLETE&&this._state!==Co.COMBINED&&(this.asynchronous?uPe(this,e):fPe(this,e)),this._state===Co.COMBINED&&(mPe(this,e),kQ(this,e),pPe(this,e)),!this.show||this._state!==Co.COMPLETE)return;this._batchTableOffsetsUpdated||kQ(this,e),this._recomputeBoundingSpheres&&dPe(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&y(this._createRenderStatesFunction,_Pe)(this,t,n,u),o&&y(this._createShaderProgramFunction,gPe)(this,e,n),(r||o)&&y(this._createCommandsFunction,yPe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,APe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var xPe=new ae,CPe=new ae;function XQ(e,t,n){if(n===an.TOP){let i=ae.clone(e,xPe),r=ae.clone(e,CPe);r.center=m.add(r.center,t,r.center),e=ae.union(i,r,e)}else n===an.ALL&&(e.center=m.add(e.center,t,e.center));return e}function TPe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=X.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function EPe(e,t,n,i,r){return function(o){let s=WQ(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var bPe=new m;function SPe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&XQ(i,m.fromArray(o.get(),0,bPe),e._offsetInstanceExtend[n]),l(r)&&(i=ae.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function vPe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}fo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:TPe(s,n,f),set:EPe(s,n,f,this,u)}}return SPe(this,c,n),vPe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};fo.prototype.isDestroyed=function(){return!1};fo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function AS(e,t,n,i){e._completeLoad(t,n,i)}var wn=fo;function wPe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var gc=wPe;var xS=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); - return eyeCoordinate.xyz / eyeCoordinate.w; -} - -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { - vec2 glFragCoordXY = gl_FragCoord.xy; - // Sample depths at both offset and negative offset - float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); - float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); - // Explicitly evaluate both paths - // Necessary for multifrustum and for edges of the screen - bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); - float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC - -void main(void) -{ -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif - -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; -#endif - -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } -#endif - -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif - - -#ifdef PER_INSTANCE_COLOR - - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#else // PER_INSTANCE_COLOR - - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. - - czm_materialInput materialInput; - -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif - -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif - -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif - -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK -} -`;function Lu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new F8;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new F8;if(r.requiresTextureCoordinates=e,n instanceof cn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Lu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof cn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof cn||(r=t.material.shaderSource),new He({defines:i,sources:[r,xS]})};Lu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new He({defines:n,sources:[xS],pickColorQualifier:"in"})};Lu.prototype.createVertexShader=function(e,t,n,i){return n$(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Lu.prototype.createPickVertexShader=function(e,t,n,i){return n$(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var KQ=new m,JQ=new he,ZQ={high:0,low:0};function n$(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=JQ;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,KQ),d=Yn.encode(f.x,ZQ);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=JQ;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,KQ);d=Yn.encode(g.x,ZQ),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof cn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new He({defines:c,sources:[r]})}function F8(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(F8.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function QQ(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var DPe=[new H,new H,new H,new H];function i$(e,t){let n=DPe,i=H.unpack(t,0,n[0]),r=H.unpack(t,2,n[1]),o=H.unpack(t,4,n[2]);e.uMaxVmax=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/QQ(i,r,o),a=1/QQ(i,o,r);e.uvMinAndExtents=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var r$=new he,o$=new m,IPe=new m,PPe=new m,PM={high:0,low:0};function s$(e,t,n){let i=r$;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,o$);i.latitude=e.north;let o=t.project(i,IPe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,PPe),a=[0,0,0,0],c=[0,0,0,0],u=Yn.encode(r.x,PM);a[0]=u.high,c[0]=u.low,u=Yn.encode(r.y,PM),a[1]=u.high,c[1]=u.low,u=Yn.encode(o.y,PM),a[2]=u.high,c[2]=u.low,u=Yn.encode(s.x,PM),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var OPe=new B,RPe=new B,$Q=new m,MPe=new he,BPe=[new he,new he,new he,new he,new he,new he,new he,new he];function LPe(e,t,n,i,r,o){let s=ce.center(e,MPe);s.height=n;let a=he.toCartesian(s,t,$Q),c=Mt.eastNorthUpToFixedFrame(a,t,OPe),u=B.inverse(c,RPe),f=e.west,d=e.east,p=e.north,g=e.south,h=BPe;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let A=(f+d)*.5,x=(p+g)*.5;h[4].latitude=g,h[4].longitude=A,h[5].latitude=p,h[5].longitude=A,h[6].latitude=x,h[6].longitude=f,h[7].latitude=x,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let O=0;O<8;O++){h[O].height=n;let L=he.toCartesian(h[O],t,$Q);B.multiplyByPoint(u,L,L),L.z=0,C=Math.min(C,L.x),T=Math.max(T,L.x),E=Math.min(E,L.y),S=Math.max(S,L.y)}let w=i;w.x=C,w.y=E,w.z=0,B.multiplyByPoint(c,w,w);let D=r;D.x=T,D.y=E,D.z=0,B.multiplyByPoint(c,D,D),m.subtract(D,w,r);let R=o;R.x=C,R.y=S,R.z=0,B.multiplyByPoint(c,R,R),m.subtract(R,w,o)}var NPe=new m,FPe=new m,UPe=new Yn;Lu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=o$,s=NPe,a=FPe;LPe(e,n,y(r,0),o,s,a);let c={};i$(c,t);let u=Yn.fromCartesian(o,UPe);return c.southWest_HIGH=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new gc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),s$(e,i,c),c};var VPe=new m;function e$(e,t,n,i){let r=r$;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,VPe),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var t$=new H;Lu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=e$(e.south,e.west,n,t$),o=r.x,s=r.y,a=e$(e.north,e.east,n,t$),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new gc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new gc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return i$(g,t),s$(e,i,g),g};Lu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Lu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function kPe(e){return Math.max(e.width,e.height)>Lu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Lu.shouldUseSphericalCoordinates=function(e){return kPe(e)};Lu.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Nu=Lu;var zPe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Gn=Object.freeze(zPe);var HPe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},pt=Object.freeze(HPe);var OM={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};OM.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Gn.ALWAYS,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},backFunction:Gn.ALWAYS,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},reference:OM.CESIUM_3D_TILE_MASK,mask:OM.CESIUM_3D_TILE_MASK}};var Ut=Object.freeze(OM);function a0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(a0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});a0.isSupported=function(e){return e.context.stencilBuffer};function oC(e,t){let n=t?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:n,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:pc.LESS_OR_EQUAL},depthMask:!1}}function V8(e){return{stencilTest:{enabled:e,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND}}var GPe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function WPe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(oC(r,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(oC(r,!0)),e._rsColorPass=ze.fromCache(V8(r,!1)),e._rsPickPass=ze.fromCache(GPe)}function jPe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; -`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=He.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function YPe(e,t){let n=t.context,i=e._primitive,r=yM;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=wn._appendDistanceDisplayConditionToShader(i,r),r=wn._modifyShaderPosition(e,r,t.scene3DOnly),r=wn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=jPe(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new He({defines:[a],sources:[r]}),u=new He({sources:[n0]}),f=e._primitive._attributeLocations,d=new Nu(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=He.createPickVertexShaderSource(r);h=wn._appendShowToShader(i,h),h=wn._updatePickColorAttribute(h);let A=d.createPickFragmentShader(!1),x=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let T=d.createPickFragmentShader(!0),E=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=wn._appendShowToShader(i,r),c=new He({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let A=d.createFragmentShader(!0),x=d.createVertexShader([a],r,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f})}e._spColor2D=h}}function qPe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new nt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Se.TERRAIN_CLASSIFICATION,s=nt.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new nt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Se.TERRAIN_CLASSIFICATION;let A=e.appearance.material;if(l(A)&&(c=gt(c,A._uniforms)),o.uniformMap=c,s=nt.shallowClone(o,o.derivedCommands.tileset),s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let x=nt.shallowClone(o,o.derivedCommands.appearance2D);x.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=x,x=nt.shallowClone(s,s.derivedCommands.appearance2D),x.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=x}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let h=f[g]=nt.shallowClone(t[p],f[g]);h.shaderProgram=d,h.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function XPe(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let h=i._va[d++];if(n&&(a=o[s++],h=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let A=nt.shallowClone(u,u.derivedCommands.pick2D);A.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=A,A=nt.shallowClone(f,f.derivedCommands.pick2D),A.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=A}}}function KPe(e,t,n,i,r,o,s){qPe(e,o),XPe(e,s)}function a$(e,t){return Math.floor(e%t/2)}function U8(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function c$(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function JPe(e,t,n,i,r,o,s,a){let c=e._primitive;wn._updateBoundingVolumes(c,t,r);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Hn.CESIUM_3D_TILE,p=f!==Hn.TERRAIN,g=t.passes,h,A,x;if(g.render){let C=n.length;for(h=0;h<C;++h)A=u[a$(h,C)],d&&(x=n[h],U8(x,t,r,o,A,s)),p&&(x=n[h].derivedCommands.tileset,U8(x,t,r,o,A,s));if(t.invertClassification){let T=e._commandsIgnoreShow,E=T.length;for(h=0;h<E;++h)A=u[h],x=T[h],U8(x,t,r,o,A,s)}}if(g.pick){let C=i.length,T=c._pickOffsets;for(h=0;h<C;++h){let E=T[a$(h,C)];A=u[E.index],d&&(x=i[h],c$(x,t,r,o,A)),p&&(x=i[h].derivedCommands.tileset,c$(x,t,r,o,A))}}}a0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=Nu.hasAttributesForSphericalExtents(c),g=Nu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let A=a.attributes.color;l(A)&&(u=!0),f=f&&l(A)&&zt.equals(d,A)}if(!f&&!p&&!g)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new cn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let h=new Array(o);for(s=0;s<o;++s)a=r[s],h[s]=new Tt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=h,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(A,x){n._createBoundingVolumeFunction(A,x)}),i._createRenderStatesFunction=function(A,x,C,T){WPe(n,x)},i._createShaderProgramFunction=function(A,x,C){YPe(n,x)},i._createCommandsFunction=function(A,x,C,T,E,S,w){KPe(n,void 0,void 0,!0,!1,S,w)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){n._updateAndQueueCommandsFunction(A,x,C,T,E,S,w,D)}:i._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){JPe(n,x,C,T,E,S,w,D)},this._primitive=new wn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(oC(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(oC(!1,!0)),this._rsColorPass=ze.fromCache(V8(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(oC(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(oC(!0,!0)),this._rsColorPass=ze.fromCache(V8(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};a0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var CS=a0;var ZPe={u_globeMinimumAltitude:function(){return 55e3}};function Xc(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){let c=o[a].attributes;if(l(c)&&l(c.color)){t=new cn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;let i=this;this._readyPromise=new Promise((o,s)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):o(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ai._defaultMaxTerrainHeight,this._minTerrainHeight=ai._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let r=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:r,_extruded:!0,_uniformMap:ZPe}}Object.defineProperties(Xc.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});Xc.isSupported=CS.isSupported;function l$(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function u$(e){return function(t,n){return e._minHeight}}var QPe=new m,$Pe=new m,e1e=new m,t1e=new he,n1e=new ce;function RM(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=m.unpack(i,d,QPe),g=m.unpack(r,d,$Pe),h=m.add(p,g,e1e),A=n.cartesianToCartographic(h,t1e),x=A.latitude,C=A.longitude;s=Math.min(s,x),a=Math.min(a,C),c=Math.max(c,x),u=Math.max(u,C)}let f=n1e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function i1e(e,t,n){let i=ai.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function r1e(e,t,n){let i=t.mapProjection.ellipsoid,r=RM(t,n),o=Ln.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function k8(e,t){return Math.floor(e%t/2)}function z8(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function f$(e,t,n,i,r,o){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function o1e(e,t,n,i,r,o,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Hn.CESIUM_3D_TILE,d=u!==Hn.TERRAIN,p=t.passes,g=e._primitive,h,A,x;if(p.render){let C=n.length;for(h=0;h<C;++h)A=c[k8(h,C)],f&&(x=n[h],z8(e,x,t,r,o,A,s)),d&&(x=n[h].derivedCommands.tileset,z8(e,x,t,r,o,A,s));if(t.invertClassification){let T=g._commandsIgnoreShow,E=T.length;for(h=0;h<E;++h)A=c[h],x=T[h],z8(e,x,t,r,o,A,s)}}if(p.pick){let C=i.length,T;for(e._useFragmentCulling||(T=g._primitive._pickOffsets),h=0;h<C;++h){if(A=c[k8(h,C)],!e._useFragmentCulling){let E=T[k8(h,C)];A=c[E.index]}f&&(x=i[h],f$(e,x,t,r,o,A)),d&&(x=i[h].derivedCommands.tileset,f$(e,x,t,r,o,A))}}}Xc.initializeTerrainHeights=function(){return ai.initialize()};Xc.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ai.initialized){Xc.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let A=RM(e,o);l(d)?l(A)&&ce.union(d,A,d):d=ce.clone(A);let x=r.id;if(l(x)&&l(A)){let C=ai.getBoundingSphere(A,i);this._boundingSpheresKeys.push(x),this._boundingSpheres.push(C)}s=o.constructor,!l(s)||l(s.createShadowVolume)}i1e(this,d,i);let p=e.terrainExaggeration,g=e.terrainExaggerationRelativeHeight;this._minHeight=Yc.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Yc.getHeight(this._maxTerrainHeight,p,g);let h=Xc._supportsMaterials(e.context);if(this._useFragmentCulling=h,h){let A,x=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=RM(e,o),Nu.shouldUseSphericalCoordinates(d)){x=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let C=RM(e,o),T=o.textureCoordinateRotationPoints;x?A=Nu.getPlanarTextureCoordinateAttributes(C,T,i,e.mapProjection,this._maxHeight):A=Nu.getSphericalExtentGeometryInstanceAttributes(C,T,i,e.mapProjection);let E=r.attributes;for(let S in E)E.hasOwnProperty(S)&&(A[S]=E[S]);u[f]=new Tt({geometry:s.createShadowVolume(o,u$(this),l$(this)),attributes:A,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Tt({geometry:s.createShadowVolume(o,u$(this),l$(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(A,x){r1e(t,A,x)},n._updateAndQueueCommandsFunction=function(A,x,C,T,E,S,w,D){o1e(t,x,C,T,E,S,w,D)},this._primitive=new CS(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};Xc.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Xc.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Xc.prototype.isDestroyed=function(){return!1};Xc.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Xc._supportsMaterials=function(e){return e.depthTexture};Xc.supportsMaterials=function(e){return Xc._supportsMaterials(e.frameState.context)};var Kc=Xc;function sC(){fe.throwInstantiationError()}Object.defineProperties(sC.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});sC.prototype.getType=fe.throwInstantiationError;sC.prototype.getValue=fe.throwInstantiationError;sC.prototype.equals=fe.throwInstantiationError;sC.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Gi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Gi.ColorType)&&(n=Gi.fromType(Gi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var to=sC;function c0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}c0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};c0.prototype._setOptions=fe.throwInstantiationError;c0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Vt,d,p=t._getIsClosed(c);if(f)d=new cn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=to.getValue(e,u,this._material);this._material=g,d=new sr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=cn.VERTEX_FORMAT,this._primitive=r.add(new Kc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new wn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=j.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new wn({geometryInstances:u,appearance:new cn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};c0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),lt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ae.clone(r.boundingSphere,e),lt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?lt.PENDING:lt.FAILED};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ci=c0;var s1e={NONE:0,GEODESIC:1,RHUMB:2},$t=Object.freeze(s1e);var d$=P.EPSILON10;function a1e(e,t,n,i){if(!l(e))return;n=y(n,!1);let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,d$)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],d$)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Cr=a1e;function c1e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,h=Math.sqrt(g),A=t/4,x=A*A,C=x*A,T=x*x,E=1+A-3*x/4+5*C/4-175*T/64,S=1-A+15*x/8-35*C/8,w=1-3*A+35*x/4,D=1-5*A,R=E*f-S*Math.sin(2*f)*A/2-w*Math.sin(4*f)*x/16-D*Math.sin(6*f)*C/48-Math.sin(8*f)*5*T/512,O=e._constants;O.a=n,O.b=i,O.f=r,O.cosineHeading=o,O.sineHeading=s,O.tanU=a,O.cosineU=c,O.sineU=u,O.sigma=f,O.sineAlpha=d,O.sineSquaredAlpha=p,O.cosineSquaredAlpha=g,O.cosineAlpha=h,O.u2Over4=A,O.u4Over16=x,O.u6Over64=C,O.u8Over256=T,O.a0=E,O.a1=S,O.a2=w,O.a3=D,O.distanceRatio=R}function l1e(e,t){return e*t*(4+e*(4-3*t))/16}function m$(e,t,n,i,r,o,s){let a=l1e(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function u1e(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),h=Math.sin(f),A=d*g,x=d*h,C=p*h,T=p*g,E=c,S=P.TWO_PI,w=Math.cos(E),D=Math.sin(E),R,O,L,N,_;do{w=Math.cos(E),D=Math.sin(E);let U=x-T*w;L=Math.sqrt(g*g*D*D+U*U),O=C+A*w,R=Math.atan2(L,O);let q;L===0?(q=0,N=1):(q=A*D/L,N=1-q*q),S=E,_=O-2*C/N,isFinite(_)||(_=0),E=c+m$(a,q,N,R,L,O,_)}while(Math.abs(E-S)>P.EPSILON12);let b=N*(t*t-n*n)/(n*n),v=1+b*(4096+b*(b*(320-175*b)-768))/16384,I=b*(256+b*(b*(74-47*b)-128))/1024,M=_*_,F=I*L*(_+I*(O*(2*M-1)-I*_*(4*L*L-3)*(4*M-3)/6)/4),k=n*v*(R-F),V=Math.atan2(g*D,x-T*w),G=Math.atan2(d*D,x*w-T);e._distance=k,e._startHeading=V,e._endHeading=G,e._uSquared=b}var f1e=new m,H8=new m;function h$(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,H8),f1e),o=m.normalize(i.cartographicToCartesian(n,H8),H8);u1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,c1e(e)}function TS(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&h$(this,e,t,i)}Object.defineProperties(TS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});TS.prototype.setEndPoints=function(e,t){h$(this,e,t,this._ellipsoid)};TS.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};TS.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,A=n.u6Over64,x=n.u4Over16,C=2*p*g*r/3+i*(1-h+7*x/4-15*A/4+579*g/64-(x-15*A/4+187*g/16)*r-(5*A/4-115*g/16)*o-29*g*s/16)+(h/2-x+71*A/32-85*g/16)*a+(5*x/16-5*A/4+383*g/96)*c-d*((A-11*g/2)*a+5*g*c/2)+(29*A/96-29*g/16)*u+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),w=Math.sin(C),D=Math.cos(C),R=n.cosineU*D,O=n.sineU*w,N=Math.atan2(w*n.sineHeading,R-O*n.cosineHeading)-m$(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,w,D,S);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=E,t.height=0,t):new he(this._start.longitude+N,E,0)};var Wf=TS;function W8(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),A=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*A)}function d1e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),A=Math.cos(2*i),x=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),w=Math.cos(8*i),D=Math.sin(10*i),R=Math.cos(10*i),O=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*A+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*w+8011*i*g/1048576*R+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*x+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*S+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*O}function aC(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function m1e(e,t,n,i,r){let o=aC(e._ellipticity,n),s=aC(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function h1e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=W8(e._ellipticity,t,r);u=(W8(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var p1e=new m,G8=new m;function p$(e,t,n,i){let r=m.normalize(i.cartographicToCartesian(t,G8),p1e),o=m.normalize(i.cartographicToCartesian(n,G8),G8),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=m1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=h1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function _$(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=W8(r,i,e.latitude),d=n*Math.cos(t),p=f+d;c=d1e(p,r,i);let g=aC(r,e.latitude),h=aC(r,c);u=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function Uh(e,t,n){let i=y(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&p$(this,e,t,i)}Object.defineProperties(Uh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Uh.fromStartHeadingDistance=function(e,t,n,i,r){let o=y(i,re.WGS84),s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=_$(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new Uh(e,d,o):(r.setEndPoints(e,d),r)};Uh.prototype.setEndPoints=function(e,t){p$(this,e,t,this._ellipsoid)};Uh.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Uh.prototype.interpolateUsingSurfaceDistance=function(e,t){return _$(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Uh.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Uh.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=aC(n,r.latitude),s=aC(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Ba=Uh;var Q8=[Di,Pi],_1e=Q8.length,N$=Math.cos(P.toRadians(30)),g$=Math.cos(P.toRadians(150)),F$=0,U$=1e3;function b_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,$t.GEODESIC),this._ellipsoid=re.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(b_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});b_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<_1e;i++)if(t instanceof Q8[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var g1e=new m,y$=new m,A$=new m;function Z8(e,t,n,i,r){let o=yc(i,e,0,g1e),s=yc(i,e,n,y$),a=yc(i,t,0,A$),c=Vh(s,o,y$),u=Vh(a,o,A$);return m.cross(u,c,r),m.normalize(r,r)}var y1e=new he,A1e=new m,x1e=new m,C1e=new m;function j8(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===$t.GEODESIC?d=new Wf(e,t,s):o===$t.RHUMB&&(d=new Ba(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=Z8(e,t,i,s,C1e),h=Math.ceil(p/r),A=p/h,x=A,C=h-1,T=a.length;for(let E=0;E<C;E++){let S=d.interpolateUsingSurfaceDistance(x,y1e),w=yc(s,S,n,A1e),D=yc(s,S,i,x1e);m.pack(g,a,T),m.pack(w,c,T),m.pack(D,u,T),f.push(S.latitude),f.push(S.longitude),T+=3,x+=A}}var Y8=new he;function yc(e,t,n,i){return he.clone(t,Y8),Y8.height=n,he.toCartesian(Y8,e,i)}b_.pack=function(e,t,n){let i=y(n,0),r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,re.pack(e._ellipsoid,t,i),i+=re.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};b_.unpack=function(e,t,n){let i=y(t,0),r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=re.unpack(e,i);i+=re.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new b_({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function Vh(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function x$(e,t,n,i){return i=Vh(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var T1e=new m,E1e=new m,b1e=new m,V$=new m,S1e=0,v1e=-1;function q8(e,t,n,i,r){let o=Vh(n,t,V$),s=x$(e,t,o,T1e),a=x$(i,t,o,E1e);if(P.equalsEpsilon(m.dot(s,a),v1e,P.EPSILON5))return r=m.cross(o,s,r),r=m.normalize(r,r),r;r=m.add(a,s,r),r=m.normalize(r,r);let c=m.cross(o,r,b1e);return m.dot(a,c)<S1e&&(r=m.negate(r,r)),r}var NM=fn.fromPointNormal(m.ZERO,m.UNIT_Y),w1e=new m,D1e=new m,I1e=new m,P1e=new m,O1e=new m,MM=new m,BM=new he,C$=new he,T$=new he;b_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new Q8[e._projectionIndex](i),a=F$,c=U$,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,h,A,x,C=new Ba(void 0,void 0,i),T,E,S,w=[d[0]];for(f=0;f<p-1;f++)g=d[f],h=d[f+1],T=Ki.lineSegmentPlane(g,h,NM,MM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===$t.GEODESIC?w.push(m.clone(T)):e.arcType===$t.RHUMB&&(S=i.cartesianToCartographic(T,BM).longitude,A=i.cartesianToCartographic(g,BM),x=i.cartesianToCartographic(h,C$),C.setEndPoints(A,x),E=C.findIntersectionWithLongitude(S,T$),T=i.cartographicToCartesian(E,MM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&w.push(m.clone(T)))),w.push(h);n&&(g=d[p-1],h=d[0],T=Ki.lineSegmentPlane(g,h,NM,MM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===$t.GEODESIC?w.push(m.clone(T)):e.arcType===$t.RHUMB&&(S=i.cartesianToCartographic(T,BM).longitude,A=i.cartesianToCartographic(g,BM),x=i.cartesianToCartographic(h,C$),C.setEndPoints(A,x),E=C.findIntersectionWithLongitude(S,T$),T=i.cartographicToCartesian(E,MM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&w.push(m.clone(T)))));let D=w.length,R=new Array(D);for(f=0;f<D;f++){let Y=he.fromCartesian(w[f],i);Y.height=0,R[f]=Y}if(R=Cr(R,he.equalsEpsilon),D=R.length,D<2)return;let O=[],L=[],N=[],_=[],b=w1e,v=D1e,I=I1e,M=P1e,F=O1e,k=R[0],V=R[1],G=R[D-1];for(b=yc(i,G,a,b),M=yc(i,V,a,M),v=yc(i,k,a,v),I=yc(i,k,c,I),n?F=q8(b,v,I,M,F):F=Z8(k,V,c,i,F),m.pack(F,L,0),m.pack(v,N,0),m.pack(I,_,0),O.push(k.latitude),O.push(k.longitude),j8(k,V,a,c,r,o,i,L,N,_,O),f=1;f<D-1;++f){b=m.clone(v,b),v=m.clone(M,v);let Y=R[f];yc(i,Y,c,I),yc(i,R[f+1],a,M),q8(b,v,I,M,F),u=L.length,m.pack(F,L,u),m.pack(v,N,u),m.pack(I,_,u),O.push(Y.latitude),O.push(Y.longitude),j8(R[f],R[f+1],a,c,r,o,i,L,N,_,O)}let U=R[D-1],q=R[D-2];if(v=yc(i,U,a,v),I=yc(i,U,c,I),n){let Y=R[0];b=yc(i,q,a,b),M=yc(i,Y,a,M),F=q8(b,v,I,M,F)}else F=Z8(q,U,c,i,F);if(u=L.length,m.pack(F,L,u),m.pack(v,N,u),m.pack(I,_,u),O.push(U.latitude),O.push(U.longitude),n){for(j8(U,k,a,c,r,o,i,L,N,_,O),u=L.length,f=0;f<3;++f)L[u+f]=L[f],N[u+f]=N[f],_[u+f]=_[f];O.push(k.latitude),O.push(k.longitude)}return iOe(n,s,N,_,L,O,t)};var R1e=new m,M1e=new Z,B1e=new Ne;function E$(e,t,n,i){let r=Vh(n,t,R1e),o=m.dot(r,e);if(o>N$||o<g$){let s=Vh(i,n,V$),a=o<g$?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Ne.fromAxisAngle(s,a,B1e),u=Z.fromQuaternion(c,M1e);return Z.multiplyByVector(u,e,e),!0}return!1}var b$=new he,L1e=new m,S$=new m;function ES(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,L1e),s=m.add(o,n,S$),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,b$);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=m.subtract(o,n,S$),u=c.cartesianToCartographic(s,b$)),u.height=0;let f=e.project(u,r);return r=m.subtract(f,i,r),r.z=0,r=m.normalize(r,r),a&&m.negate(r,r),r}var N1e=new m,v$=new m;function w$(e,t,n,i,r,o){let s=m.subtract(t,e,N1e);m.normalize(s,s);let a=n-F$,c=m.multiplyByScalar(s,a,v$);m.add(e,c,r);let u=i-U$;c=m.multiplyByScalar(s,u,v$),m.add(t,c,o)}var F1e=new m;function LM(e,t){let n=fn.getPointDistance(NM,e),i=fn.getPointDistance(NM,t),r=F1e;P.equalsEpsilon(n,0,P.EPSILON2)?(r=Vh(t,e,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=Vh(e,t,r),m.multiplyByScalar(r,P.EPSILON2,r),m.add(t,r,t))}function U1e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var k$=new he,z$=new he,D$=new m,X8=new m,I$=new m,P$=new m,V1e=new m,O$=new m,k1e=[k$,z$],z1e=new ce,H1e=new m,G1e=new m,W1e=new m,j1e=new m,Y1e=new m,q1e=new m,K8=new m,J8=new m,X1e=new m,K1e=new m,J1e=new m,R$=new m,Z1e=new m,Q1e=new m,$1e=new Yn,eOe=new Yn,M$=new m,tOe=new m,B$=new m,nOe=[new ae,new ae],H$=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],L$=H$.length;function iOe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),A=new Float64Array(d*3),x=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),w,D,R,O;s&&(w=new Float32Array(p),D=new Float32Array(p),R=new Float32Array(p),O=new Float32Array(d*2));let L=o.length/2,N=0,_=k$;_.height=0;let b=z$;b.height=0;let v=D$,I=X8;if(s)for(c=0,a=1;a<L;a++)_.latitude=o[c],_.longitude=o[c+1],b.latitude=o[c+2],b.longitude=o[c+3],v=t.project(_,v),I=t.project(b,I),N+=m.distance(v,I),c+=2;let M=i.length/3;I=m.unpack(i,0,I);let F=0;for(c=3,a=1;a<M;a++)v=m.clone(I,v),I=m.unpack(i,c,I),F+=m.distance(v,I),c+=3;let k;c=3;let V=0,G=0,U=0,q=0,Y=!1,Q=m.unpack(n,0,P$),W=m.unpack(i,0,X8),K=m.unpack(r,0,O$);if(e){let Ee=m.unpack(n,n.length-6,I$);E$(K,Ee,Q,W)&&(K=m.negate(K,K))}let J=0,me=0,ye=0;for(a=0;a<f;a++){let Ee=m.clone(Q,I$),Be=m.clone(W,D$),ke=m.clone(K,V1e);Y&&(ke=m.negate(ke,ke)),Q=m.unpack(n,c,P$),W=m.unpack(i,c,X8),K=m.unpack(r,c,O$),Y=E$(K,Ee,Q,W),_.latitude=o[V],_.longitude=o[V+1],b.latitude=o[V+2],b.longitude=o[V+3];let Pe,ft,_t,rt;if(s){let ki=U1e(_,b);Pe=t.project(_,Y1e),ft=t.project(b,q1e);let Ho=Vh(ft,Pe,M$);Ho.y=Math.abs(Ho.y),_t=K8,rt=J8,ki===0||m.dot(Ho,m.UNIT_Y)>N$?(_t=ES(t,_,ke,Pe,K8),rt=ES(t,b,K,ft,J8)):ki===1?(rt=ES(t,b,K,ft,J8),_t.x=0,_t.y=P.sign(_.longitude-Math.abs(b.longitude)),_t.z=0):(_t=ES(t,_,ke,Pe,K8),rt.x=0,rt.y=P.sign(_.longitude-b.longitude),rt.z=0)}let dn=m.distance(Be,W),In=Yn.fromCartesian(Ee,$1e),Ht=m.subtract(Q,Ee,X1e),Ft=m.normalize(Ht,R$),Te=m.subtract(Be,Ee,K1e);Te=m.normalize(Te,Te);let Ae=m.cross(Ft,Te,R$);Ae=m.normalize(Ae,Ae);let ut=m.cross(Te,ke,Z1e);ut=m.normalize(ut,ut);let ti=m.subtract(W,Q,J1e);ti=m.normalize(ti,ti);let Je=m.cross(K,ti,Q1e);Je=m.normalize(Je,Je);let or=dn/F,Qo=J/F,va=0,Io,Dr,Ve,ot=0,je=0;if(s){va=m.distance(Pe,ft),Io=Yn.fromCartesian(Pe,eOe),Dr=m.subtract(ft,Pe,M$),Ve=m.normalize(Dr,tOe);let ki=Ve.x;Ve.x=Ve.y,Ve.y=-ki,ot=va/N,je=me/N}for(k=0;k<8;k++){let ki=q+k*4,Ho=G+k*2,Fn=ki+3,sn=k<4?1:-1,Wn=k===2||k===3||k===6||k===7?1:-1;m.pack(In.high,x,ki),x[Fn]=Ht.x,m.pack(In.low,C,ki),C[Fn]=Ht.y,m.pack(ut,T,ki),T[Fn]=Ht.z,m.pack(Je,E,ki),E[Fn]=or*sn,m.pack(Ae,S,ki);let vn=Qo*Wn;vn===0&&Wn<0&&(vn=9),S[Fn]=vn,s&&(w[ki]=Io.high.x,w[ki+1]=Io.high.y,w[ki+2]=Io.low.x,w[ki+3]=Io.low.y,R[ki]=-_t.y,R[ki+1]=_t.x,R[ki+2]=rt.y,R[ki+3]=-rt.x,D[ki]=Dr.x,D[ki+1]=Dr.y,D[ki+2]=Ve.x,D[ki+3]=Ve.y,O[Ho]=ot*sn,vn=je*Wn,vn===0&&Wn<0&&(vn=9),O[Ho+1]=vn)}let Ze=W1e,mt=j1e,kt=H1e,Jt=G1e,$i=ce.fromCartographicArray(k1e,z1e),dr=ai.getMinimumMaximumHeights($i,u),$o=dr.minimumTerrainHeight,Is=dr.maximumTerrainHeight;ye+=$o,ye+=Is,w$(Ee,Be,$o,Is,Ze,kt),w$(Q,W,$o,Is,mt,Jt);let ao=m.multiplyByScalar(Ae,P.EPSILON5,B$);m.add(Ze,ao,Ze),m.add(mt,ao,mt),m.add(kt,ao,kt),m.add(Jt,ao,Jt),LM(Ze,mt),LM(kt,Jt),m.pack(Ze,A,U),m.pack(mt,A,U+3),m.pack(Jt,A,U+6),m.pack(kt,A,U+9),ao=m.multiplyByScalar(Ae,-2*P.EPSILON5,B$),m.add(Ze,ao,Ze),m.add(mt,ao,mt),m.add(kt,ao,kt),m.add(Jt,ao,Jt),LM(Ze,mt),LM(kt,Jt),m.pack(Ze,A,U+12),m.pack(mt,A,U+15),m.pack(Jt,A,U+18),m.pack(kt,A,U+21),V+=2,c+=3,G+=16,U+=24,q+=32,J+=dn,me+=va}c=0;let se=0;for(a=0;a<f;a++){for(k=0;k<L$;k++)h[c+k]=H$[k]+se;se+=8,c+=L$}let pe=nOe;ae.fromVertices(n,m.ZERO,3,pe[0]),ae.fromVertices(i,m.ZERO,3,pe[1]);let xe=ae.fromBoundingSpheres(pe);xe.radius+=ye/(f*2);let we={position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:A}),startHiAndForwardOffsetX:E_(x),startLoAndForwardOffsetY:E_(C),startNormalAndForwardOffsetZ:E_(T),endNormalAndTextureCoordinateNormalizationX:E_(E),rightNormalAndTextureCoordinateNormalizationY:E_(S)};return s&&(we.startHiLo2D=E_(w),we.offsetAndRight2D=E_(D),we.startEndNormals2D=E_(R),we.texcoordNormalization2D=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:O})),new dt({attributes:we,indices:h,boundingSphere:xe})}function E_(e){return new De({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}b_._projectNormal=ES;var cC=b_;var FM=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; // Technically can compute distance for this here -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -void main(void) -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. - - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; - - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); - - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - - czm_writeDepthClamp(); -} -`;var UM=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; -#endif - -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); -} - -void main(void) -{ - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); - - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); - - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -} -`;var VM=`in vec3 position3DHigh; -in vec3 position3DLow; - -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; - -in float batchId; - -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; -#endif - -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() -{ - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); - - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); - - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates - - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR - -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#endif - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. - - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var kM=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif - -in float batchId; - -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif - -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; - - vec3 forwardDirectionEC = normalize(offset); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; - -#endif // COLUMBUS_VIEW_2D - - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); - - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; - - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; -#endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); -#else - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -#endif - - positionEC.xyz += width * normalEC; - gl_Position = czm_depthClamp(czm_projection * positionEC); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var zM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_color = color; -} -`;var Fu=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var $8=`${Fu} -${zM}`,rOe=Kx;jt.isInternetExplorer()||($8=`#define CLIP_POLYLINE -${$8}`);function l0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=l0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,$8),this._fragmentShaderSource=y(e.fragmentShaderSource,rOe),this._renderState=tr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(l0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});l0.VERTEX_FORMAT=Oe.POSITION_ONLY;l0.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;l0.prototype.isTranslucent=tr.prototype.isTranslucent;l0.prototype.getRenderState=tr.prototype.getRenderState;var jo=l0;var HM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; - -out float v_width; -out vec2 v_st; -out float v_polylineAngle; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_width = width; - v_st.s = st.s; - v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); - v_polylineAngle = angle; -} -`;var lC=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; -#endif - - czm_writeLogDepth(); -} -`;var e5=`${Fu} -${HM}`,oOe=lC;jt.isInternetExplorer()||(e5=`#define CLIP_POLYLINE -${e5}`);function u0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=u0.VERTEX_FORMAT;this.material=l(e.material)?e.material:Gi.fromType(Gi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,e5),this._fragmentShaderSource=y(e.fragmentShaderSource,oOe),this._renderState=tr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(u0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});u0.VERTEX_FORMAT=Oe.POSITION_AND_ST;u0.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;u0.prototype.isTranslucent=tr.prototype.isTranslucent;u0.prototype.getRenderState=tr.prototype.getRenderState;var da=u0;function kh(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new da),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=G$(!1),this._renderState3DTiles=G$(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(kh.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});kh.initializeTerrainHeights=function(){return ai.initialize()};function sOe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(kM);s=wn._appendShowToShader(r,s),s=wn._appendDistanceDisplayConditionToShader(r,s),s=wn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(VM);a=wn._appendShowToShader(r,a),a=wn._appendDistanceDisplayConditionToShader(r,a),a=wn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(FM),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[s]}),h=new He({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:o});let A=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(A)){let C=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:o})}e._sp2D=A;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(x)){let C=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${ai._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(UM);let T=new He({defines:p,sources:[d,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:o})}e._spMorph=x}function G$(e){return ze.fromCache({cull:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function aOe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof jo?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new nt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Se.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let h=nt.shallowClone(g,g.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=h;let A=nt.shallowClone(g,g.derivedCommands.color2D);A.shaderProgram=e._sp2D,g.derivedCommands.color2D=A;let x=nt.shallowClone(h,h.derivedCommands.color2D);x.shaderProgram=e._sp2D,h.derivedCommands.color2D=x;let C=nt.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function W$(e,t,n,i,r,o,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function cOe(e,t,n,i,r,o,s){let a=e._primitive;wn._updateBoundingVolumes(a,t,r);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==Hn.CESIUM_3D_TILE,p=f!==Hn.TERRAIN&&!u,g,h=t.passes;if(h.render||h.pick&&a.allowPicking){let A=n.length;for(let x=0;x<A;++x){let C=c[x];d&&(g=n[x],W$(e,g,t,r,o,C,s)),p&&(g=n[x].derivedCommands.tileset,W$(e,g,t,r,o,C,s))}}}kh.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ai.initialized){kh.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new gc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,cC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Tt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){sOe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,h){aOe(n,u,f,d,g,h)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,h,A){cOe(n,u,f,d,p,g,h)},this._primitive=new wn(i)}if(this.appearance instanceof jo&&!this._hasPerInstanceColors)throw new fe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};kh.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};kh.isSupported=function(e){return e.frameState.context.depthTexture};kh.prototype.isDestroyed=function(){return!1};kh.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var lm=kh;var lOe=new H(1,1),uOe=!1,fOe=z.WHITE;function uC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(uC.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});uC.prototype.getType=function(e){return"Image"};uC.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,lOe,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,fOe,t.color),j.getValueOrDefault(this._transparent,e,uOe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};uC.prototype.equals=function(e){return this===e||e instanceof uC&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var f0=uC;function dOe(e){if(e instanceof z)return new Vt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new f0;return t.image=e,t}}function mOe(e,t){return le(e,t,dOe)}var Rr=mOe;function bS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});bS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new bS(this)};bS.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var fC=bS;var hOe={FIXED:0,INERTIAL:1},nr=Object.freeze(hOe);function dC(){fe.throwInstantiationError()}Object.defineProperties(dC.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});dC.prototype.getValue=fe.throwInstantiationError;dC.prototype.getValueInReferenceFrame=fe.throwInstantiationError;dC.prototype.equals=fe.throwInstantiationError;var t5=new Z;dC.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new m),n===i)return m.clone(t,r);let o=Mt.computeIcrfToFixedMatrix(e,t5);if(l(o)||(o=Mt.computeTemeToPseudoFixedMatrix(e,t5)),n===nr.INERTIAL)return Z.multiplyByVector(o,t,r);if(n===nr.FIXED)return Z.multiplyByVector(Z.transpose(o,t5),t,r)};var S_=dC;function d0(e,t){this._definitionChanged=new _e,this._value=m.clone(e),this._referenceFrame=y(t,nr.FIXED)}Object.defineProperties(d0.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===nr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});d0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};d0.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};d0.prototype.getValueInReferenceFrame=function(e,t,n){return S_.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};d0.prototype.equals=function(e){return this===e||e instanceof d0&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Jc=d0;function SS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(SS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});SS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new SS(this)};SS.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var mC=SS;function pOe(e){return e}function _Oe(e,t){return le(e,t,pOe)}var Ll=_Oe;function vS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});vS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new vS(this)};vS.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var hC=vS;function wS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});wS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new wS(this)};wS.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var pC=wS;function DS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(DS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});DS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new DS(this)};DS.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var _C=DS;function IS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(IS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});IS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new IS(this)};IS.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var um=IS;var gOe=new m(1,1,1),yOe=m.ZERO,AOe=Ne.IDENTITY;function j$(e,t,n){this.translation=m.clone(y(e,yOe)),this.rotation=Ne.clone(y(t,AOe)),this.scale=m.clone(y(n,gOe))}j$.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var m0=j$;var n5=new m0;function PS(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(PS.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});PS.prototype.getValue=function(e,t){return l(t)||(t=new m0),t.translation=j.getValueOrClonedDefault(this._translation,e,n5.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,n5.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,n5.scale,t.scale),t};PS.prototype.equals=function(e){return this===e||e instanceof PS&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var gC=PS;function zh(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(zh.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!j.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});zh.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function xOe(e){return new $n(e)}zh.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,xOe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};zh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};zh.prototype.getValue=function(e,t){l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=j.getValueOrUndefined(this[o],e,t[o])}return t};zh.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function COe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!j.equals(e[s],t[s]))return!1}return!0}zh.prototype.equals=function(e){return this===e||e instanceof zh&&COe(this,e)};var Nl=zh;function Y$(e){return new gC(e)}function TOe(e){return new Nl(e,Y$)}function EOe(e){return new Nl(e)}function OS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(OS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,TOe),articulations:le("articulations",void 0,EOe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});OS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new OS(this)};OS.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Nl(t,Y$)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Nl(n)}};var v_=OS;function RS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(RS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});RS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new RS(this)};RS.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var yC=RS;function MS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(MS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Rr("material"),distanceDisplayCondition:le("distanceDisplayCondition")});MS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new MS(this)};MS.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var w_=MS;function BS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(BS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});BS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new BS(this)};BS.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var GM=BS;function LS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(LS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});LS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new LS(this)};LS.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var AC=LS;function bOe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Zc=bOe;function SOe(e){return Array.isArray(e)&&(e=new Zc(e)),new $n(e)}function NS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(NS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,SOe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});NS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new NS(this)};NS.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var fm=NS;function FS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Rr("material"),depthFailMaterial:Rr("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});FS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new FS(this)};FS.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ac=FS;function US(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(US.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});US.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new US(this)};US.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var xC=US;function VS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(VS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});VS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new VS(this)};VS.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var dm=VS;function kS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(kS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Rr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});kS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new kS(this)};kS.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var D_=kS;var vOe=new he;function wOe(e){return new Jc(e)}function DOe(e){return le(e,void 0,wOe)}function Fs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function mm(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function i5(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&i5(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(mm.prototype,{availability:Ll("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Ll("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&i5(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&i5(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Fs("billboard",mc),box:Fs("box",fC),corridor:Fs("corridor",mC),cylinder:Fs("cylinder",hC),description:le("description"),ellipse:Fs("ellipse",pC),ellipsoid:Fs("ellipsoid",_C),label:Fs("label",um),model:Fs("model",v_),tileset:Fs("tileset",yC),orientation:le("orientation"),path:Fs("path",w_),plane:Fs("plane",GM),point:Fs("point",AC),polygon:Fs("polygon",fm),polyline:Fs("polyline",Ac),polylineVolume:Fs("polylineVolume",xC),properties:Fs("properties",Nl),position:DOe("position"),rectangle:Fs("rectangle",dm),viewFrom:le("viewFrom"),wall:Fs("wall",D_)});mm.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};mm.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Ll(e,!0))};mm.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};mm.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var q$=new Z,X$=new m,K$=new Ne;mm.prototype.computeModelMatrix=function(e,t){let n=j.getValueOrUndefined(this._position,e,X$);if(!l(n))return;let i=j.getValueOrUndefined(this._orientation,e,K$);return l(i)?t=B.fromRotationTranslation(Z.fromQuaternion(i,q$),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};mm.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=j.getValueOrDefault(t,e,qe.NONE),s=j.getValueOrUndefined(this._position,e,X$);if(o===qe.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,vOe);o===qe.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=j.getValueOrUndefined(this._orientation,e,K$);return l(c)?r=B.fromRotationTranslation(Z.fromQuaternion(c,q$),s,r):r=Mt.eastNorthUpToFixedFrame(s,void 0,r),r};mm.supportsMaterialsforEntitiesOnTerrain=function(e){return Kc.supportsMaterials(e)};mm.supportsPolylinesOnTerrain=function(e){return lm.isSupported(e)};var no=mm;var IOe=new Vt(z.WHITE),POe=new $n(!0),OOe=new $n(!0),ROe=new $n(!1),MOe=new $n(z.BLACK),BOe=new $n(xn.DISABLED),LOe=new $n(new Dt),NOe=new $n(Hn.BOTH);function xc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=no.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(xc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)&&j.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)&&j.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});xc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};xc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};xc.prototype.createFillGeometryInstance=fe.throwInstantiationError;xc.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;xc.prototype.isDestroyed=function(){return!1};xc.prototype.destroy=function(){ue(this)};xc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};xc.prototype._isOnTerrain=function(e,t){return!1};xc.prototype._getIsClosed=function(e){return!0};xc.prototype._isDynamic=fe.throwInstantiationError;xc.prototype._setStaticOptions=fe.throwInstantiationError;xc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(Ge.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ge.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(r.material,IOe),this._fillProperty=y(o,OOe),this._showProperty=y(u,POe),this._showOutlineProperty=y(r.outline,ROe),this._outlineColorProperty=c?y(r.outlineColor,MOe):void 0,this._shadowsProperty=y(r.shadows,BOe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,LOe),this._classificationTypeProperty=y(r.classificationType,NOe),this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Vt);if(c&&f&&(Rt(Rt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};xc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var li=xc;function CC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(CC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});CC.prototype.getValue=function(e,t){return this._callback(e,t)};CC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};CC.prototype.equals=function(e){return this===e||e instanceof CC&&this._callback===e._callback&&this._isConstant===e._isConstant};var hm=CC;var J$=new m,FOe=new he;function TC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new he,this._normal=new m,this._definitionChanged=new _e,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(Ge.MINIMUM_VALUE,J$);if(!l(o)||m.equals(o,m.ZERO)||!l(e.globe))return;this._position=m.clone(o,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});TC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!l(t)||m.equals(n,m.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,r=t._surface,o=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);l(a)?this._terrainHeight=a:this._terrainHeight=0;function c(u){if(e.mode===ne.SCENE3D){let f=i.cartesianToCartographic(u,FOe);o._terrainHeight=f.height}else o._terrainHeight=u.x;o.definitionChanged.raiseEvent()}this._removeCallbackFunc=r.updateHeight(s,c)};TC.prototype.getValue=function(e,t){let n=j.getValueOrDefault(this._heightReference,e,qe.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,qe.NONE);if(n===qe.NONE&&i!==qe.RELATIVE_TO_GROUND)return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,J$);if(!l(o)||m.equals(o,m.ZERO)||!l(r.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,o,P.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(o,this._position),this._updateClamping();let s=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var EC=TC;function UOe(e,t,n,i){if(li.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new hm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new EC(this._scene,s,o)}}var I_=UOe;var Z$=m.ZERO,Q$=new m,VOe=new m,$$=new z;function kOe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Fl(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new kOe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Fl.prototype=Object.create(li.prototype),Fl.prototype.constructor=Fl);Object.defineProperties(Fl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Fl.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=zn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,$$)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Z$,Q$))),new Tt({id:t,geometry:Ml.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};Fl.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,$$),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Z$,Q$))),new Tt({id:t,geometry:sm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:o})};Fl.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Fl.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||li.prototype._isHidden.call(this,e,t)};Fl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};Fl.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};Fl.prototype._onEntityPropertyChanged=I_;Fl.DynamicGeometryUpdater=bC;function bC(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(bC.prototype=Object.create(ci.prototype),bC.prototype.constructor=bC);bC.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,VOe),r=this._options.dimensions;return!l(i)||!l(r)||ci.prototype._isHidden.call(this,e,t,n)};bC.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,qe.NONE),r=this._options;r.dimensions=j.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==qe.NONE?an.ALL:void 0};var WM=Fl;var tee=co(eee(),1);var zOe=0,s5={};function Hh(e,t){let n,i=e;l(s5[i])?n=s5[i]:(n=zOe++,s5[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Hh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=tee.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Hh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Hh.prototype.equals=function(e){return Hh.equals(this,e)};Hh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible,n=new Hh(e.html,t);return n._isIon=n.html.indexOf("ion-credit.png")!==-1,n};Hh.clone=function(e){if(l(e))return new Hh(e.html,e.showOnScreen)};var It=Hh;var jM=`in vec2 v_textureCoordinates; - -uniform float originalSize; -uniform sampler2D texture0; -uniform sampler2D texture1; -uniform sampler2D texture2; -uniform sampler2D texture3; -uniform sampler2D texture4; -uniform sampler2D texture5; - -const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); -const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); -const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); -const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); - -void main() -{ - vec2 uv = v_textureCoordinates; - vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); - vec2 pixel = 1.0 / textureSize; - - float mipLevel = 0.0; - - if (uv.x - pixel.x > (textureSize.y / textureSize.x)) - { - mipLevel = 1.0; - if (uv.y - pixel.y > yMipLevel1) - { - mipLevel = 2.0; - if (uv.y - pixel.y * 3.0 > yMipLevel2) - { - mipLevel = 3.0; - if (uv.y - pixel.y * 5.0 > yMipLevel3) - { - mipLevel = 4.0; - if (uv.y - pixel.y * 7.0 > yMipLevel4) - { - mipLevel = 5.0; - } - } - } - } - } - - if (mipLevel > 0.0) - { - float scale = pow(2.0, mipLevel); - - uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); - uv.x *= ((textureSize.x - 2.0) / textureSize.y); - - uv.x -= 1.0 + pixel.x; - uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); - uv *= scale; - } - else - { - uv.x *= (textureSize.x / textureSize.y); - } - - if(mipLevel == 0.0) - { - out_FragColor = texture(texture0, uv); - } - else if(mipLevel == 1.0) - { - out_FragColor = texture(texture1, uv); - } - else if(mipLevel == 2.0) - { - out_FragColor = texture(texture2, uv); - } - else if(mipLevel == 3.0) - { - out_FragColor = texture(texture3, uv); - } - else if(mipLevel == 4.0) - { - out_FragColor = texture(texture4, uv); - } - else if(mipLevel == 5.0) - { - out_FragColor = texture(texture5, uv); - } - else - { - out_FragColor = vec4(0.0); - } -} -`;var YM=`in vec3 v_cubeMapCoordinates; -uniform samplerCube cubeMap; - -void main() -{ - vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); - #ifdef RGBA_NORMALIZED - out_FragColor = vec4(rgba.rgb, 1.0); - #else - float m = rgba.a * 16.0; - vec3 r = rgba.rgb * m; - out_FragColor = vec4(r * r, 1.0); - #endif -} -`;var qM=`in vec4 position; -in vec3 cubeMapCoordinates; - -out vec3 v_cubeMapCoordinates; - -void main() -{ - gl_Position = position; - v_cubeMapCoordinates = cubeMapCoordinates; -} -`;function h0(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new _e}Object.defineProperties(h0.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});h0.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var HOe=new m(1,0,0),GOe=new m(0,0,1),WOe=new m(-1,0,0),jOe=new m(0,0,-1),XM=new m(0,1,0),YOe=new m(0,-1,0),ree=[XM,WOe,GOe,YOe,HOe,XM,jOe,XM,XM],oee=ree.length,see=new Float32Array(oee*3),nee=0;for(let e=0;e<oee;++e,nee+=3)m.pack(ree[e],see,nee);var qOe=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),XOe=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function KOe(e){let t=ht.createVertexBuffer({context:e,typedArray:qOe,usage:Fe.STATIC_DRAW}),n=ht.createVertexBuffer({context:e,typedArray:see,usage:Fe.STATIC_DRAW}),i=ht.createIndexBuffer({context:e,typedArray:XOe,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),r=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:X.FLOAT}];return new si({context:e,attributes:r,indexBuffer:i})}function iee(e){return function(){return e}}function a5(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let r=e._mipTextures;if(l(r))for(n=r.length,t=0;t<n;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}h0.prototype.update=function(e){let t=e.context;if(!h0.isSupported(t)||(l(this._texture)&&l(this._va)&&a5(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let g=e.context.textureCache.getTexture(this._url);l(g)&&(a5(this),this._texture=g,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let g=this;Dl(this._url).then(function(h){g._cubeMapBuffers=h,g._loading=!1}).catch(function(h){g.isDestroyed()||g._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],r=n[0].positiveX.pixelDatatype;l(r)?i.push("RGBA_NORMALIZED"):r=t.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT;let o=ct.RGBA,s=new He({defines:i,sources:[YM]});this._va=KOe(t),this._sp=Qt.fromCache({context:t,vertexShaderSource:qM,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let g=0;g<a;++g){let h=n[g].positiveY;n[g].positiveY=n[g].negativeY,n[g].negativeY=h;let A=c[g]=new uc({context:t,source:n[g],pixelDatatype:r}),x=c[g].width*2,C=u[g]=new Bt({context:t,width:x,height:x,pixelDatatype:r,pixelFormat:o}),T=new Bf({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:iee(A)},outputTexture:C,persists:!0,owner:this});e.commandList.push(T),d[`texture${g}`]=iee(C)}this._texture=new Bt({context:t,width:f*1.5+2,height:f,pixelDatatype:r,pixelFormat:o}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Bf({fragmentShaderSource:jM,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};h0.prototype.isDestroyed=function(){return!1};h0.prototype.destroy=function(){return a5(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var pm=h0;function zS(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?H.clone(e.imageBasedLightingFactor):new H(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=H.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(zS.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=H.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function JOe(e,t){if(pm.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new pm(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}zS.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(JOe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};zS.prototype.isDestroyed=function(){return!1};zS.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var SC=zS;var l5=co(wl(),1);var c5,aee="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU",KM={};KM.defaultAccessToken=aee;KM.defaultServer=new ve({url:"https://api.cesium.com/"});KM.getDefaultTokenCredit=function(e){if(e===aee){if(!l(c5)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;c5=new It(t,!0)}return c5}};var _m=KM;function Cc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:ZOe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new l5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}l(Object.create)&&(Cc.prototype=Object.create(ve.prototype),Cc.prototype.constructor=Cc);Cc.fromAssetId=function(e,t){let n=Cc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Cc(i,n)})};Object.defineProperties(Cc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Cc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Cc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=_m.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Cc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Cc(t._ionEndpoint,t._ionEndpointResource)),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Cc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};Cc.prototype._makeRequest=function(e){return this._isExternal||new l5.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),ve.prototype._makeRequest.call(this,e))};Cc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,_m.defaultServer),i=y(t.accessToken,_m.defaultAccessToken);n=ve.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};function ZOe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){return n._ionEndpoint=o,o}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var ma=Cc;function gm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(gm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});gm.prototype.get=function(e){return this._array[e]};gm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};gm.prototype.peek=function(){return this._array[this._length-1]};gm.prototype.push=function(e){let t=this.length++;this._array[t]=e};gm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};gm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};gm.prototype.resize=function(e){this.length=e};gm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Qc=gm;var Gh={X:0,Y:1,Z:2};Gh.Y_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));Gh.Z_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));Gh.X_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));Gh.Z_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));Gh.X_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));Gh.Y_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));Gh.fromName=function(e){return Gh[e]};var hr=Object.freeze(Gh);function cee(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(cee.prototype,{metadata:{get:function(){return this._metadata}}});var vC=cee;function P_(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),P_.decode(e)}P_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};P_.decodeWithFromCharCode=function(e){let t="",n=QOe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function HS(e,t,n){return t<=e&&e<=n}function QOe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(HS(u,0,127)){s.push(u);continue}if(HS(u,194,223)){i=1,t=u&31;continue}if(HS(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(HS(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new de("String decoding failed.")}if(!HS(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?P_.decode=P_.decodeWithTextDecoder:P_.decode=P_.decodeWithFromCharCode;var Ul=P_;function $Oe(e,t){return t=y(t,0),Ul(e,t,Math.min(4,e.length))}var ym=$Oe;function jf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r})}Object.defineProperties(jf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Composite3DTileContent.readyPromise","Composite3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Composite3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var GS=Uint32Array.BYTES_PER_ELEMENT;jf.fromTileType=async function(e,t,n,i,r,o){r=y(r,0);let s=new Uint8Array(i),a=new DataView(i);r+=GS;let c=a.getUint32(r,!0);if(c!==1)throw new de(`Only Composite Tile version 1 is supported. Version ${c} is not.`);r+=GS,r+=GS;let u=a.getUint32(r,!0);r+=GS;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let h=0;h<u;++h){let A=ym(s,r),x=a.getUint32(r+GS*2,!0),C=o[A],T=`${f}${h}`,E=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(C))d[h]=Promise.resolve(C(e,t,E,i,r));else throw new de(`Unknown tile content type, ${A}, inside Composite tile`);r+=x}let p=await Promise.all(d);return new jf(e,t,n,p)};jf.prototype.hasProperty=function(e,t){return!1};jf.prototype.getFeature=function(e){};jf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};jf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};jf.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};jf.prototype.isDestroyed=function(){return!1};jf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var JM=jf;function eRe(e,t,n){return JSON.parse(Ul(e,t,n))}var Mr=eRe;function La(e){this._id=jn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Gt.maximumTextureSize),o=Math.ceil(t/Gt.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new H(r,o),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(La.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});La.DEFAULT_COLOR_VALUE=z.WHITE;La.DEFAULT_SHOW_VALUE=!0;function lee(e){let t=e._textureDimensions;return t.x*t.y*4}function uee(e){if(!l(e._batchValues)){let t=lee(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function fee(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}La.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=fee(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=uee(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};La.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};La.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var tRe=new Array(4);La.prototype.setColor=function(e,t){if(z.equals(t,La.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(tRe),i=n[3],r=uee(this),o=e*4,s=fee(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};La.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};La.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(La.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};La.prototype.getPickColor=function(e){return this._pickIds[e]};function dee(e,t,n){let i=e._textureDimensions;return new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:mn.NEAREST})}function nRe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=lee(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=dee(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function iRe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}La.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&nRe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=dee(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),iRe(this))};La.prototype.isDestroyed=function(){return!1};La.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var $c=La;var rRe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},oRe={SCALAR:void 0,VEC2:H,VEC3:m,VEC4:oe,MAT2:er,MAT3:Z,MAT4:B};function sRe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=rRe[e.type],r=oRe[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return X.createArrayBufferView(n,o,s,i*a)}}}var Uu=sRe;function Wh(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,aRe(this,e.extension,e.binaryBody)}Object.defineProperties(Wh.prototype,{byteLength:{get:function(){return this._byteLength}}});function aRe(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=ln.SCALAR,o=Uu(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=ln.SCALAR,o=Uu(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=ln.SCALAR,o=Uu(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let h=a.length;for(i=0;i<h;++i){let C=a[i].length,T=a[i].instances,E=cRe(C,T,n);p+=lRe(E),a[i].instances=gt(E,T)}let A=new Array(h).fill(0),x=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],x[i]=A[r],++A[r];p+=x.byteLength,e._classes=a,e._classIds=c,e._classIndexes=x,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function cRe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${r} requires a batch table binary.`);let u=Uu(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function lRe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var uRe=[],fRe=[],dRe=0;function mRe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=uRe;c.length=Math.max(c.length,a);let u=++dRe,f=fRe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let h=0;h<p;++h){let A=o[g+h];A!==t&&f.push(A)}}}function hRe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function WS(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return mRe(e,t,n)}else return n(e,t);return hRe(e,t,n)}Wh.prototype.hasProperty=function(e,t){let n=WS(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Wh.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Wh.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,WS(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Wh.prototype.getProperty=function(e,t){return WS(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?pRe(a,s):Ye(a[s],!0)})};function pRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Wh.prototype.setProperty=function(e,t,n){let i=WS(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?_Re(u,c,n):u[c]=Ye(n,!0),!0});return l(i)};function _Re(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Wh.prototype.isClass=function(e,t){let n=WS(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Wh.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var wC=Wh;var gRe={HIGHLIGHT:0,REPLACE:1,MIX:2},Vl=Object.freeze(gRe);var u5=$c.DEFAULT_COLOR_VALUE,f5=$c.DEFAULT_SHOW_VALUE;function ar(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=y(o,{});let s=yRe(n);this._properties=s,this._batchTableHierarchy=ARe(this,n,i);let a=hee(t,s,i);this._binaryPropertiesByteLength=xRe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new $c({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}ar._deprecationWarning=$;Object.defineProperties(ar.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function yRe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function ARe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(ar._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new wC({extension:i,binaryBody:n})}function hee(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${r} requires a batch table binary.`);let u=Uu(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function xRe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}ar.getBinaryProperties=function(e,t,n){return hee(e,t,n)};ar.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ar.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ar.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ar.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ar.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ar.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ar.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var CRe=new z;ar.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(u5),this.setAllShow(f5);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?y(e.color.evaluateColor(r,CRe),u5):u5,s=l(e.show)?y(e.show.evaluate(r),f5):f5;this.setColor(i,o),this.setShow(i,s)}};function TRe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function ERe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}ar.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};ar.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};ar.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};ar.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};ar.prototype.hasPropertyBySemantic=function(){return!1};ar.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};ar.prototype.getPropertyBySemantic=function(e,t){};ar.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return TRe(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};ar.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){ERe(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Ye(n,!0)};function bRe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}ar.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=pee(r,n,!1),s;return Gt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${bRe(i)}${s}`}};function mee(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function SRe(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function pee(e,t,n){if(!l(t))return mee(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return mee(e,n);let o=r[0],s=r[2];e=He.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=SRe(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}ar.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=pee(i,t,!0),Gt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};ar.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=He.replaceMain(e,"tile_main"),Gt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function vRe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Vl.HIGHLIGHT)return 0;if(n===Vl.REPLACE)return 1;if(n===Vl.MIX)return P.clamp(i,P.EPSILON4,1)}ar.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return gt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return vRe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};ar.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var O_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};ar.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=wRe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Se.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=DRe(f),f.dirty=!1);let p=d.originalCommand;c!==O_.ALL_OPAQUE&&f.pass!==Se.TRANSLUCENT&&(l(d.translucent)||(d.translucent=IRe(p))),c!==O_.ALL_TRANSLUCENT&&f.pass!==Se.TRANSLUCENT&&(l(d.opaque)||(d.opaque=PRe(p)),a&&(o||(l(d.zback)||(d.zback=RRe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==BRe(d.stencil))&&(f.renderState.depthMask?d.stencil=MRe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,h=d.translucent;f.pass!==Se.TRANSLUCENT?(c===O_.ALL_OPAQUE&&(n[u]=g),c===O_.ALL_TRANSLUCENT&&(n[u]=h),c===O_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(h))):n[u]=p}};function wRe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?O_.ALL_OPAQUE:t===e.featuresLength?O_.ALL_TRANSLUCENT:O_.OPAQUE_AND_TRANSLUCENT}function DRe(e){let t=nt.shallowClone(e),n=t.pass===Se.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function IRe(e){let t=nt.shallowClone(e);return t.pass=Se.TRANSLUCENT,t.renderState=LRe(e.renderState),t}function PRe(e){let t=nt.shallowClone(e);return t.renderState=NRe(e.renderState),t}function ORe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),i.sources.unshift(`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -`),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function RRe(e,t){let n=nt.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=gi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let r=new H(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=ORe(e,t.shaderProgram),n}function MRe(e,t){let n=nt.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ut.SKIP_LOD_MASK,i.stencilTest.reference=Ut.CESIUM_3D_TILE_MASK|t<<Ut.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Gn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=pt.REPLACE,i.stencilTest.backFunction=Gn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=pt.REPLACE,i.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function BRe(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function LRe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=hn.ALPHA_BLEND,t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function NRe(e){let t=Ye(e,!0);return t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,ze.fromCache(t)}ar.prototype.update=function(e,t){this._batchTexture.update(e,t)};ar.prototype.isDestroyed=function(){return!1};ar.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var R_=ar;function FRe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var jh=FRe;var jS=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;function Vu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Vu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Vu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Vu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Vu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Vu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let r=e.metadata;if(l(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}let o=e.tile,s=o.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(o.implicitSubtree)&&(a=o.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Vu.prototype.getPropertyInherited=function(e){return Vu.getPropertyInherited(this._content,this._batchId,e)};Vu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Vu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Vu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Vu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Us=Vu;var d5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},m5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},We=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+We.version}static addUnaryOp(t){return We.max_unop_len=Math.max(t.length,We.max_unop_len),We.unary_ops[t]=1,We}static addBinaryOp(t,n,i){return We.max_binop_len=Math.max(t.length,We.max_binop_len),We.binary_ops[t]=n,i?We.right_associative.add(t):We.right_associative.delete(t),We}static addIdentifierChar(t){return We.additional_identifier_chars.add(t),We}static addLiteral(t,n){return We.literals[t]=n,We}static removeUnaryOp(t){return delete We.unary_ops[t],t.length===We.max_unop_len&&(We.max_unop_len=We.getMaxKeyLen(We.unary_ops)),We}static removeAllUnaryOps(){return We.unary_ops={},We.max_unop_len=0,We}static removeIdentifierChar(t){return We.additional_identifier_chars.delete(t),We}static removeBinaryOp(t){return delete We.binary_ops[t],t.length===We.max_binop_len&&(We.max_binop_len=We.getMaxKeyLen(We.binary_ops)),We.right_associative.delete(t),We}static removeAllBinaryOps(){return We.binary_ops={},We.max_binop_len=0,We}static removeLiteral(t){return delete We.literals[t],We}static removeAllLiterals(){return We.literals={},We}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new We(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return We.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!We.binary_ops[String.fromCharCode(t)]||We.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return We.isIdentifierStart(t)||We.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(We.hooks[t]){let i={context:this,node:n};return We.hooks.run(t,i),i.node}return n}searchHook(t){if(We.hooks[t]){let n={context:this};return We.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===We.SPACE_CODE||t===We.TAB_CODE||t===We.LF_CODE||t===We.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:We.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===We.SEMCOL_CODE||i===We.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,We.max_binop_len),n=t.length;for(;n>0;){if(We.binary_ops.hasOwnProperty(t)&&(!We.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!We.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:We.binaryPrecedence(n),right_a:We.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=We.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:We.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:We.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:We.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,We.isDecimalDigit(t)||t===We.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===We.SQUOTE_CODE||t===We.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===We.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,We.max_unop_len),i=n.length;i>0;){if(We.unary_ops.hasOwnProperty(n)&&(!We.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!We.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:We.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}We.isIdentifierStart(t)?(r=this.gobbleIdentifier(),We.literals.hasOwnProperty(r.name)?r={type:We.LITERAL,value:We.literals[r.name],raw:r.name}:r.name===We.this_str&&(r={type:We.THIS_EXP})):t===We.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===We.PERIOD_CODE||n===We.OBRACK_CODE||n===We.OPAREN_CODE||n===We.QUMARK_CODE;){let i;if(n===We.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==We.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===We.OBRACK_CODE?(t={type:We.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==We.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===We.OPAREN_CODE?t={type:We.CALL_EXP,arguments:this.gobbleArguments(We.CPAREN_CODE),callee:t}:(n===We.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:We.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;We.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===We.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);We.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));We.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);We.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,We.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===We.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===We.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:We.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:We.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(We.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,We.isIdentifierPart(t));)this.index++;return{type:We.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===We.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===We.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===We.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===We.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===We.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(We.CPAREN_CODE);if(this.code===We.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:We.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:We.ARRAY_EXP,elements:this.gobbleArguments(We.CBRACK_CODE)}}},URe=new d5;Object.assign(We,{hooks:URe,plugins:new m5(We),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});We.max_unop_len=We.getMaxKeyLen(We.unary_ops);We.max_binop_len=We.getMaxKeyLen(We.binary_ops);var M_=e=>new We(e).parse(),VRe=Object.getOwnPropertyNames(We);VRe.forEach(e=>{M_[e]===void 0&&e!=="prototype"&&(M_[e]=We[e])});M_.Jsep=We;var kRe="ConditionalExpression",zRe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:kRe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};M_.plugins.register(zRe);var HRe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},yt=Object.freeze(HRe);function Yf(e,t){this._expression=e,e=tMe(e,t),e=iMe(nMe(e)),M_.addBinaryOp("=~",0),M_.addBinaryOp("!~",0);let n;try{n=M_(e)}catch(i){throw new de(i)}this._runtimeAst=yi(this,n)}Object.defineProperties(Yf.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};Yf.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof oe?n.clone(t):n};Yf.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Yf.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} -{ - return ${r}; -} -`,r};Yf.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Yf.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var GRe=["!","-","+"],_ee=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],$M=/\${(.*?)}/g,WRe=/\\/g,jRe="@#%",YRe=/@#%/g,eB=new z,tB={abs:gs(Math.abs),sqrt:gs(Math.sqrt),cos:gs(Math.cos),sin:gs(Math.sin),tan:gs(Math.tan),acos:gs(Math.acos),asin:gs(Math.asin),atan:gs(Math.atan),radians:gs(P.toRadians),degrees:gs(P.toDegrees),sign:gs(P.sign),floor:gs(Math.floor),ceil:gs(Math.ceil),round:gs(Math.round),exp:gs(Math.exp),exp2:gs(XRe),log:gs(Math.log),log2:gs(KRe),fract:gs(qRe),length:JRe,normalize:ZRe},nB={atan2:ZM(Math.atan2,!1),pow:ZM(Math.pow,!1),min:ZM(Math.min,!0),max:ZM(Math.max,!0),distance:QRe,dot:$Re,cross:eMe},_5={clamp:gee(P.clamp,!0),mix:gee(P.lerp,!0)};function qRe(e){return e-Math.floor(e)}function XRe(e){return Math.pow(2,e)}function KRe(e){return P.log2(e)}function gs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function ZM(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof H)return H.fromElements(e(i.x,r),e(i.y,r),Rn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Rn.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Rn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x),e(i.y,r.y),Rn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function gee(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof H&&r instanceof H)return H.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Rn.getCartesian2());if(i instanceof m&&r instanceof m)return m.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof H&&r instanceof H&&o instanceof H)return H.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Rn.getCartesian2());if(i instanceof m&&r instanceof m&&o instanceof m)return m.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Rn.getCartesian3());if(i instanceof oe&&r instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function JRe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function ZRe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof m)return m.normalize(t,Rn.getCartesian3());if(t instanceof oe)return oe.normalize(t,Rn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function QRe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function $Re(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function eMe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Rn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,mMe(this)}function tMe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function nMe(e){return e.replace(WRe,jRe)}function p5(e){return e.replace(YRe,"\\")}function iMe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new de("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function rMe(e){let t=typeof e.value;if(e.value===null)return new xt(yt.LITERAL_NULL,null);if(t==="boolean")return new xt(yt.LITERAL_BOOLEAN,e.value);if(t==="number")return new xt(yt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new xt(yt.VARIABLE_IN_STRING,e.value):new xt(yt.LITERAL_STRING,p5(e.value))}function oMe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${r} is not a function.`);return i===0?r==="test"?new xt(yt.LITERAL_BOOLEAN,!1):new xt(yt.LITERAL_NULL,null):(s=yi(e,c),a=yi(e,n[0]),new xt(yt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=yi(e,c),new xt(yt.FUNCTION_CALL,r,o);throw new de(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new xt(yt.LITERAL_COLOR,r);if(o=yi(e,n[0]),l(n[1])){let c=yi(e,n[1]);return new xt(yt.LITERAL_COLOR,r,[o,c])}return new xt(yt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new de(`${r} requires three arguments.`);return o=[yi(e,n[0]),yi(e,n[1]),yi(e,n[2])],new xt(yt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new de(`${r} requires four arguments.`);return o=[yi(e,n[0]),yi(e,n[1]),yi(e,n[2]),yi(e,n[3])],new xt(yt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=yi(e,n[c]);return new xt(yt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new xt(yt.LITERAL_BOOLEAN,!0):new xt(yt.LITERAL_BOOLEAN,!1):(o=yi(e,n[0]),new xt(yt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new de(`${r} requires exactly one argument.`);return o=yi(e,n[0]),new xt(yt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new de(`${r} does not take any argument.`);return new xt(yt.UNARY,r)}else if(l(tB[r])){if(i!==1)throw new de(`${r} requires exactly one argument.`);return o=yi(e,n[0]),new xt(yt.UNARY,r,o)}else if(l(nB[r])){if(i!==2)throw new de(`${r} requires exactly two arguments.`);return s=yi(e,n[0]),a=yi(e,n[1]),new xt(yt.BINARY,r,s,a)}else if(l(_5[r])){if(i!==3)throw new de(`${r} requires exactly three arguments.`);s=yi(e,n[0]),a=yi(e,n[1]);let c=yi(e,n[2]);return new xt(yt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new xt(yt.LITERAL_BOOLEAN,!1):(o=yi(e,n[0]),new xt(yt.UNARY,r,o));if(r==="Number")return i===0?new xt(yt.LITERAL_NUMBER,0):(o=yi(e,n[0]),new xt(yt.UNARY,r,o));if(r==="String")return i===0?new xt(yt.LITERAL_STRING,""):(o=yi(e,n[0]),new xt(yt.UNARY,r,o));if(r==="regExp")return sMe(e,t)}}throw new de(`Unexpected function call "${r}".`)}function sMe(e,t){let n=t.arguments;if(n.length===0)return new xt(yt.LITERAL_REGEX,new RegExp);let i=yi(e,n[0]),r;if(n.length>1){let o=yi(e,n[1]);if(h5(i)&&h5(o)){try{r=new RegExp(p5(String(i._value)),o._value)}catch(s){throw new de(s)}return new xt(yt.LITERAL_REGEX,r)}return new xt(yt.REGEX,i,o)}if(h5(i)){try{r=new RegExp(p5(String(i._value)))}catch(o){throw new de(o)}return new xt(yt.LITERAL_REGEX,r)}return new xt(yt.REGEX,i)}function aMe(e){if(fMe(e.name)){let t=dMe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(yt.BUILTIN_VARIABLE,t):new xt(yt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(yt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(yt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(yt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function cMe(e){let t=e.property.name;if(t==="PI")return new xt(yt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(yt.LITERAL_NUMBER,Math.E)}function lMe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(yt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function uMe(e,t){if(t.object.name==="Math")return cMe(t);if(t.object.name==="Number")return lMe(t);let n,i=yi(e,t.object);return t.computed?(n=yi(e,t.property),new xt(yt.MEMBER,"brackets",i,n)):(n=new xt(yt.LITERAL_STRING,t.property.name),new xt(yt.MEMBER,"dot",i,n))}function h5(e){return e._type>=yt.LITERAL_NULL}function fMe(e){return e.substr(0,4)==="czm_"}function dMe(e){return e.substr(4)}function yi(e,t){let n,i,r,o;if(t.type==="Literal")n=rMe(t);else if(t.type==="CallExpression")n=oMe(e,t);else if(t.type==="Identifier")n=aMe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=yi(e,t.argument);if(GRe.indexOf(i)>-1)n=new xt(yt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=yi(e,t.left),o=yi(e,t.right),_ee.indexOf(i)>-1)n=new xt(yt.BINARY,i,r,o);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=yi(e,t.left),o=yi(e,t.right),_ee.indexOf(i)>-1&&(n=new xt(yt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=yi(e,t.test);r=yi(e,t.consequent),o=yi(e,t.alternate),n=new xt(yt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=uMe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=yi(e,t.elements[a]);n=new xt(yt.ARRAY,s)}else throw t.type==="Compound"?new de("Provide exactly one expression."):new de("Cannot parse expression.");return n}function mMe(e){e._type===yt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===yt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===yt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(tB[e._value])&&(e.evaluate=pMe(e._value)):e._type===yt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(nB[e._value])&&(e.evaluate=_Me(e._value)):e._type===yt.TERNARY?e.evaluate=gMe(e._value):e._type===yt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===yt.ARRAY?e.evaluate=e._evaluateArray:e._type===yt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===yt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===yt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===yt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===yt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===yt.REGEX?e.evaluate=e._evaluateRegExp:e._type===yt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=hMe):e.evaluate=e._evaluateLiteral}function hMe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function pMe(e){let t=tB[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function _Me(e){let t=nB[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function gMe(e){let t=_5[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function iB(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=eB,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Rn.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof H)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new de(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new de(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Rn.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=$M.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=iB(e,r);l(o)||(o=""),t=t.replace(i,o),n=$M.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return iB(e,this._value)};function p0(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(p0(this._left))return iB(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(p0(this._left))return iB(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};xt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};xt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof H)return H.negate(t,Rn.getCartesian2());if(t instanceof m)return m.negate(t,Rn.getCartesian3());if(t instanceof oe)return oe.negate(t,Rn.getCartesian4());if(typeof t=="number")return-t;throw new de(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};xt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof H||t instanceof m||t instanceof oe||typeof t=="number"))throw new de(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};xt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};xt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};xt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Rn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Rn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new de(r)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof oe)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function yee(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==yt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,eB)}function Aee(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==yt.LITERAL_NUMBER)return;let i=eB;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function B_(e){return e%1===0?e.toFixed(1):e.toString()}function yMe(e){let t=B_(e.red),n=B_(e.green),i=B_(e.blue);return`vec3(${t}, ${n}, ${i})`}function QM(e){let t=B_(e.red),n=B_(e.green),i=B_(e.blue),r=B_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function xee(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function Cee(e,t){return l(t[e])?t[e]:Yf.NULL_SENTINEL}Yf.NULL_SENTINEL="czm_infinity";xt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=xee(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=xee(this._value,e,t,this));let u,f,d;switch(a){case yt.VARIABLE:return p0(this)?void 0:Cee(c,e);case yt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(tB[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new de(`Error generating style shader: "${c}" is not supported.`);return c+r;case yt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(nB[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case yt.TERNARY:if(l(_5[c]))return`${c}(${r}, ${o}, ${s})`;break;case yt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case yt.MEMBER:return p0(this._left)?Cee(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case yt.FUNCTION_CALL:throw new de(`Error generating style shader: "${c}" is not supported.`);case yt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new de("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case yt.REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case yt.VARIABLE_IN_STRING:throw new de("Error generating style shader: Converting a variable to a string is not supported.");case yt.LITERAL_NULL:return Yf.NULL_SENTINEL;case yt.LITERAL_BOOLEAN:return c?"true":"false";case yt.LITERAL_NUMBER:return B_(c);case yt.LITERAL_STRING:if(l(n)&&n._type===yt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||p0(n._left)))return c;if(i=z.fromCssColorString(c,eB),l(i))return yMe(i);throw new de("Error generating style shader: String literals are not supported.");case yt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Aee(this),l(i)?QM(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Aee(this),l(i)?QM(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=yee(this),l(i)?QM(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=yee(this),l(i)?(i.alpha!==1&&(t.translucent=!0),QM(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case yt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case yt.LITERAL_REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case yt.LITERAL_UNDEFINED:return Yf.NULL_SENTINEL;case yt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};xt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case yt.VARIABLE:p0(this)||e.push(s);break;case yt.VARIABLE_IN_STRING:for(a=$M.exec(s);a!==null;)e.push(a[1]),a=$M.exec(s);break;case yt.LITERAL_STRING:l(t)&&t._type===yt.MEMBER&&p0(t._left)&&e.push(s);break}};var qf=Yf;function Yh(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,m.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,Hn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Yh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var AMe={position:0,a_batchId:1};function xMe(e,t){if(l(e._va))return;let n=ht.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=ht.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),r=ht.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new si({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new si({context:t,attributes:o,indexBuffer:ht.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function CMe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,AMe),r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=He.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(jS),c=n.getFragmentShaderCallback(!1,void 0,!0)(n0);r=n.getPickId();let u=new He({sources:[a]}),f=new He({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new He({sources:[jS]}),f=new He({defines:["VECTOR_TILE"],sources:[n0]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=He.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`;let d=new He({sources:[a]}),p=new He({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Tee(e){let t=e?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:t,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:pc.LESS_OR_EQUAL},depthMask:!1}}var TMe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND},EMe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function bMe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(Tee(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(Tee(!0)),e._rsColorPass=ze.fromCache(TMe),e._rsPickPass=ze.fromCache(EMe))}var _0=new B,Eee=new m;function SMe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return B.clone(i,_0),B.multiplyByPoint(_0,e._center,Eee),B.setTranslation(_0,Eee,_0),B.multiply(r,_0,_0),_0},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function g5(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],h=new e.constructor(e.buffer,a*p,g);t.set(h,n),i[d]=n,n+=g}return n}function vMe(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=g5(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=g5(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=g5(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function y5(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function wMe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=y5(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=y5(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=y5(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function DMe(e,t){return t.color.toRgba()-e.color.toRgba()}function IMe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(DMe),t.webgl2?wMe(e,n):vMe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function PMe(e,t){let n=IMe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,B.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,h=r[p].count,A=i[p*2];l(A)||(A=i[p*2]=new nt({owner:e})),A.vertexArray=a,A.modelMatrix=u,A.offset=g,A.count=h,A.renderState=e._rsStencilDepthPass,A.shaderProgram=c,A.uniformMap=f,A.boundingVolume=d,A.cull=!1,A.pass=Se.TERRAIN_CLASSIFICATION;let x=nt.shallowClone(A,A.derivedCommands.tileset);x.renderState=e._rsStencilDepthPass3DTiles,x.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=x;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new nt({owner:e})),C.vertexArray=a,C.modelMatrix=u,C.offset=g,C.count=h,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=d,C.cull=!1,C.pass=Se.TERRAIN_CLASSIFICATION;let T=nt.shallowClone(C,C.derivedCommands.tileset);T.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=T}e._commandsDirty=!0}function OMe(e,t){if(e.classificationType===Hn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=nt.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function RMe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=y(e._modelMatrix,B.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Se.TERRAIN_CLASSIFICATION;let g=nt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let h=n[c*2+1];l(h)||(h=n[c*2+1]=new nt({owner:e,pickOnly:!0})),h.vertexArray=i,h.modelMatrix=s,h.offset=u,h.count=f,h.renderState=e._rsPickPass,h.shaderProgram=o,h.uniformMap=a,h.boundingVolume=d,h.pass=Se.TERRAIN_CLASSIFICATION;let A=nt.shallowClone(h,h.derivedCommands.tileset);A.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=A}e._pickCommandsDirty=!1}Yh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Us(e,o)}};Yh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function MMe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var BMe=new z,LMe=z.WHITE,NMe=!0,FMe=/\$/;Yh.prototype.applyStyle=function(e,t){if(!l(e)){MMe(this,t);return}let n=e.color,i=n instanceof qf&&!FMe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,BMe):LMe,c.show=l(e.show)?e.show.evaluate(c):NMe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Yh.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let A=c[f].offset,x=c[f].count;if(s>=A&&s<A+x)break}c.push(new jh({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,h=g.length;for(let A=0;A<h;++A){let x=g[A];if(x===e)continue;let C=n[x];r[C]<s?d.push(x):p.push(x)}p.length!==0&&c.push(new jh({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function bee(e,t,n,i){let r=e.classificationType,o=r!==Hn.CESIUM_3D_TILE,s=r!==Hn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Se.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function UMe(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Se.OPAQUE,n.push(o)}}function VMe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Le.LINES):(n=e._rsColorPass,i=Le.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Yh.prototype.update=function(e){let t=e.context;xMe(this,t),CMe(this,t),bMe(this),SMe(this,t);let n=e.passes;n.render&&(PMe(this,t),OMe(this,e),VMe(this),this._debugWireframe?UMe(e,this._commands):bee(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(RMe(this),bee(this,e,this._pickCommands))};Yh.prototype.isDestroyed=function(){return!1};Yh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var DC=Yh;function kl(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Hn.BOTH}Object.defineProperties(kl.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});kl.packedBoxLength=B.packedLength+m.packedLength;kl.packedCylinderLength=B.packedLength+2;kl.packedEllipsoidLength=B.packedLength+m.packedLength;kl.packedSphereLength=m.packedLength+1;function kMe(e){let t=new Float64Array(B.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,B.pack(e._modelMatrix,t,n),t}function zMe(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let h=0;h<p;++h)g[h]=t[n++];a[c]=new jh({color:u,offset:f,count:d,batchIds:g})}return i}var HMe=new pi("createVectorTileGeometries",5),GMe=new z;function WMe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let h=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),h+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),h+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),h+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),h+=c.length),u=e._batchTableColors=new Uint32Array(h);let A=e._batchTable;for(let x=0;x<h;++x){let C=A.getColor(x,GMe);u[x]=C.toRgba()}f=e._packedBuffer=kMe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=HMe.scheduleTask(p,d);return l(g)?g.then(function(h){if(e.isDestroyed())return;let A=new Float64Array(h.packedBuffer);zMe(e,A)===2?e._indices=new Uint16Array(h.indices):e._indices=new Uint32Array(h.indices),e._indexOffsets=new Uint32Array(h.indexOffsets),e._indexCounts=new Uint32Array(h.indexCounts),e._positions=new Float32Array(h.positions),e._vertexBatchIds=new Uint16Array(h.vertexBatchIds),e._batchIds=new Uint16Array(h.batchIds),jMe(e),e._ready=!0}).catch(h=>{e.isDestroyed()||(e._error=h)}):void 0}}function jMe(e){l(e._primitive)||(e._primitive=new DC({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}kl.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};kl.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};kl.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};kl.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};kl.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=WMe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};kl.prototype.isDestroyed=function(){return!1};kl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var L_=kl;function qh(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),XMe(this,i,r)}Object.defineProperties(qh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function YMe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function qMe(e,t){let n,i,r,o,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=h++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=h++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=h++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=h++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var g0=Uint32Array.BYTES_PER_ELEMENT;function XMe(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=g0;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=g0;let s=r.getUint32(n,!0);if(n+=g0,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=g0,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=g0;let u=r.getUint32(n,!0);n+=g0;let f=r.getUint32(n,!0);n+=g0;let d=Mr(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,h;u>0&&(g=Mr(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let A=y(d.BOXES_LENGTH,0),x=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),E=A+x+C+T,S=new R_(e,E,g,h,YMe(e));if(e._batchTable=S,E===0)return;let w=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=m.unpack(d.RTC_CENTER),B.multiplyByPoint(w,D,D));let R=qMe(d,p);if(A>0||x>0||C>0||T>0){let O,L,N,_;if(A>0){let b=p.byteOffset+d.BOXES.byteOffset;O=new Float32Array(p.buffer,b,L_.packedBoxLength*A)}if(x>0){let b=p.byteOffset+d.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,b,L_.packedCylinderLength*x)}if(C>0){let b=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,b,L_.packedEllipsoidLength*C)}if(T>0){let b=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,b,L_.packedSphereLength*T)}return e._geometries=new L_({boxes:O,boxBatchIds:R.boxes,cylinders:L,cylinderBatchIds:R.cylinders,ellipsoids:N,ellipsoidBatchIds:R.ellipsoids,spheres:_,sphereBatchIds:R.spheres,center:D,modelMatrix:w,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function See(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}qh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};qh.prototype.getFeature=function(e){return See(this),this._features[e]};qh.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};qh.prototype.applyStyle=function(e){See(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};qh.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var rB=qh;var A5={};A5.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),vee(i,r,o,s);return c};A5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),vee(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function vee(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var YS=A5;var y0=30,KMe=1<<y0,JMe=1<<y0+1>>>0,x5=2*y0+1,N_=4,Iee=[],Pee=[],ZMe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],F_=1,IC=2,oB=[F_,0,0,F_|IC];function Ro(e){if(!jt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Ro.getLevel(e)}Ro.fromToken=function(e){return new Ro(Ro.getIdFromToken(e))};Ro.isValidId=function(e){return!(e<=0||e>>BigInt(x5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ro.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ro.isValidId(Ro.getIdFromToken(e)):!1};Ro.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ro.getTokenFromId=function(e){let t=Math.floor(aBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ro.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return y0-(t>>1)};Ro.prototype.getChild=function(e){let t=Mee(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ro(n)};Ro.prototype.getParent=function(){let e=Mee(this._cellId)<<BigInt(2);return new Ro(this._cellId&~e+BigInt(1)|e)};Ro.prototype.getParentAtLevel=function(e){let t=oBe(e);return new Ro(this._cellId&-t|t)};Ro.prototype.getCenter=function(e){e=y(e,re.WGS84);let t=QMe(this._cellId,this._level);t=m.normalize(t,t);let n=new he.fromCartesian(t,re.UNIT_SPHERE);return he.toCartesian(n,e,new m)};Ro.prototype.getVertex=function(e,t){t=y(t,re.WGS84);let n=$Me(this._cellId,this._level,e);n=m.normalize(n,n);let i=new he.fromCartesian(n,re.UNIT_SPHERE);return he.toCartesian(i,t,new m)};Ro.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(x5-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Ro(a)};function QMe(e,t){let n=eBe(e,t);return tBe(n[0],n[1],n[2])}function $Me(e,t,n){let i=Oee(e,t),r=nBe([i[1],i[2]],t),o=n>>1&1;return Ree(i[0],r[0][o^n&1],r[1][o])}function eBe(e,t){let n=Oee(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function Oee(e){Iee.length===0&&rBe();let t=Number(e>>BigInt(x5)),n=t&F_,i=(1<<N_)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?y0-7*N_:N_))-1;n+=Number(e>>BigInt(s*2*N_+1)&BigInt(c))<<2,n=Pee[n];let u=s*N_;r+=n>>N_+2<<u,o+=(n>>2&i)<<u,n&=F_|IC}return[t,r,o]}function tBe(e,t,n){let i=wee(t),r=wee(n),o=sB(i),s=sB(r);return Ree(e,o,s)}function Ree(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function sB(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function wee(e){return 1/JMe*e}function nBe(e,t){let n=[[],[]],i=iBe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=sB(Dee(o)),n[r][1]=sB(Dee(s))}return n}function iBe(e){return 1<<y0-e>>>0}function Dee(e){return 1/KMe*e}function U_(e,t,n,i,r,o){if(e===N_){let s=(t<<N_)+n;Iee[(s<<2)+i]=(r<<2)+o,Pee[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=ZMe[o];U_(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^oB[0]),U_(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^oB[1]),U_(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^oB[2]),U_(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^oB[3])}}function rBe(){U_(0,0,0,0,0,0),U_(0,0,0,F_,0,F_),U_(0,0,0,IC,0,IC),U_(0,0,0,F_|IC,0,F_|IC)}function Mee(e){return e&~e+BigInt(1)}function oBe(e){return BigInt(1)<<BigInt(2*(y0-e))}var sBe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function aBe(e){return sBe[(-e&e)%BigInt(67)]}var V_=Ro;function cBe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ii=cBe;function C5(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new de(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=lBe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function lBe(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(C5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});C5.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var qS=C5;function Xh(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(Xh.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Xh.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Xh.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Xh.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Xh.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Xh.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Xh.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Xh.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var XS=Xh;var aB={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};aB.getBranchingFactor=function(e){switch(e){case aB.OCTREE:return 8;case aB.QUADTREE:return 4}};var Yo=Object.freeze(aB);function Vs(){}Object.defineProperties(Vs.prototype,{class:{get:function(){fe.throwInstantiationError()}}});Vs.prototype.hasProperty=function(e){fe.throwInstantiationError()};Vs.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};Vs.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};Vs.prototype.getProperty=function(e){fe.throwInstantiationError()};Vs.prototype.setProperty=function(e,t){fe.throwInstantiationError()};Vs.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};Vs.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};Vs.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};Vs.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Vs.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};Vs.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};Vs.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;l(o)&&(r=o[e]);let s=!0;return l(r)&&(t=r.packVectorAndMatrixTypes(t,s),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};Vs.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Vs.getProperty(r.id,t,n)};Vs.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Vs.setProperty(o.id,t,n,i):!1};var kn=Vs;function Kh(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Kh.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kh.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Kh.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Kh.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Kh.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Kh.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Kh.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Kh.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var cB=Kh;var Pt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Pt.getMinimum=function(e){switch(e){case Pt.INT8:return-128;case Pt.UINT8:return 0;case Pt.INT16:return-32768;case Pt.UINT16:return 0;case Pt.INT32:return-2147483648;case Pt.UINT32:return 0;case Pt.INT64:return jt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Pt.UINT64:return jt.supportsBigInt()?BigInt(0):0;case Pt.FLOAT32:return-34028234663852886e22;case Pt.FLOAT64:return-Number.MAX_VALUE}};Pt.getMaximum=function(e){switch(e){case Pt.INT8:return 127;case Pt.UINT8:return 255;case Pt.INT16:return 32767;case Pt.UINT16:return 65535;case Pt.INT32:return 2147483647;case Pt.UINT32:return 4294967295;case Pt.INT64:return jt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Pt.UINT64:return jt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Pt.FLOAT32:return 34028234663852886e22;case Pt.FLOAT64:return Number.MAX_VALUE}};Pt.isIntegerType=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.INT64:case Pt.UINT64:return!0;default:return!1}};Pt.isUnsignedIntegerType=function(e){switch(e){case Pt.UINT8:case Pt.UINT16:case Pt.UINT32:case Pt.UINT64:return!0;default:return!1}};Pt.isVectorCompatible=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.FLOAT32:case Pt.FLOAT64:return!0;default:return!1}};Pt.normalize=function(e,t){return Math.max(Number(e)/Number(Pt.getMaximum(t)),-1)};Pt.unnormalize=function(e,t){let n=Pt.getMaximum(t),i=Pt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Pt.INT64||t===Pt.UINT64)&&jt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Pt.applyValueTransform=function(e,t,n){return n*e+t};Pt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Pt.getSizeInBytes=function(e){switch(e){case Pt.INT8:case Pt.UINT8:return 1;case Pt.INT16:case Pt.UINT16:return 2;case Pt.INT32:case Pt.UINT32:return 4;case Pt.INT64:case Pt.UINT64:return 8;case Pt.FLOAT32:return 4;case Pt.FLOAT64:return 8}};Pt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Pt.INT8;case X.UNSIGNED_BYTE:return Pt.UINT8;case X.SHORT:return Pt.INT16;case X.UNSIGNED_SHORT:return Pt.UINT16;case X.INT:return Pt.INT32;case X.UNSIGNED_INT:return Pt.UINT32;case X.FLOAT:return Pt.FLOAT32;case X.DOUBLE:return Pt.FLOAT64}};Pt.toComponentDatatype=function(e){switch(e){case Pt.INT8:return X.BYTE;case Pt.UINT8:return X.UNSIGNED_BYTE;case Pt.INT16:return X.SHORT;case Pt.UINT16:return X.UNSIGNED_SHORT;case Pt.INT32:return X.INT;case Pt.UINT32:return X.UNSIGNED_INT;case Pt.FLOAT32:return X.FLOAT;case Pt.FLOAT64:return X.DOUBLE}};var on=Object.freeze(Pt);var Br={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Br.isVectorType=function(e){switch(e){case Br.VEC2:case Br.VEC3:case Br.VEC4:return!0;default:return!1}};Br.isMatrixType=function(e){switch(e){case Br.MAT2:case Br.MAT3:case Br.MAT4:return!0;default:return!1}};Br.getComponentCount=function(e){switch(e){case Br.SCALAR:case Br.STRING:case Br.ENUM:case Br.BOOLEAN:return 1;case Br.VEC2:return 2;case Br.VEC3:return 3;case Br.VEC4:return 4;case Br.MAT2:return 4;case Br.MAT3:return 9;case Br.MAT4:return 16}};Br.getMathType=function(e){switch(e){case Br.VEC2:return H;case Br.VEC3:return m;case Br.VEC4:return oe;case Br.MAT2:return er;case Br.MAT3:return Z;case Br.MAT4:return B;default:return}};var Yt=Object.freeze(Br);function ha(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&on.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=o;let s=Ye(e.offset,!0),a=Ye(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=y(e.required,!0),this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}ha.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=uBe(n),r=fBe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=y(n.required,!1):o=!1,new ha({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(ha.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function uBe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Yt.SCALAR||Yt.isMatrixType(t)||Yt.isVectorType(t))return!1;if(l(on[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function fBe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===Yt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===Yt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===Yt.SCALAR||Yt.isMatrixType(n)||Yt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===Yt.BOOLEAN||n===Yt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===Yt.BOOLEAN||i===Yt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(on[i]))return{type:Yt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(on[n]))return{type:Yt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}ha.prototype.normalize=function(e){return this._normalized?T5(e,this._valueType,on.normalize):e};ha.prototype.unnormalize=function(e){return this._normalized?T5(e,this._valueType,on.unnormalize):e};ha.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ha.valueTransformInPlace(e,this._offset,this._scale,on.applyValueTransform)};ha.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ha.valueTransformInPlace(e,this._offset,this._scale,on.unapplyValueTransform)};ha.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,r=Yt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};ha.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Fee(e,t))return e};function Fee(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Fee(e[n],t[n]))return!1;return!0}ha.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Yt.getMathType(this._type),i=this._isArray,r=Yt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};ha.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Yt.getMathType(this._type),i=this._isArray,r=Yt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};ha.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?dBe(this,e):Uee(this,e)};function dBe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=Uee(e,t[i]);if(l(r))return r}}function Uee(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return Yt.isVectorType(n)?mBe(t,n,i):Yt.isMatrixType(n)?hBe(t,n,i):n===Yt.STRING?pBe(t):n===Yt.BOOLEAN?_Be(t):n===Yt.ENUM?gBe(t,r):yBe(t,i,o)}function mBe(e,t,n){if(!on.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Yt.VEC2&&!(e instanceof H))return`vector value ${e} must be a Cartesian2`;if(t===Yt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===Yt.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function hBe(e,t,n){if(!on.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Yt.MAT2&&!(e instanceof er))return`matrix value ${e} must be a Matrix2`;if(t===Yt.MAT3&&!(e instanceof Z))return`matrix value ${e} must be a Matrix3`;if(t===Yt.MAT4&&!(e instanceof B))return`matrix value ${e} must be a Matrix4`}function pBe(e){if(typeof e!="string")return lB(e,Yt.STRING)}function _Be(e){if(typeof e!="boolean")return lB(e,Yt.BOOLEAN)}function gBe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function yBe(e,t,n){let i=typeof e;switch(t){case on.INT8:case on.UINT8:case on.INT16:case on.UINT16:case on.INT32:case on.UINT32:case on.FLOAT32:case on.FLOAT64:return i!=="number"?lB(e,t):isFinite(e)?Lee(e,t,n):Nee(e,t);case on.INT64:case on.UINT64:return i!=="number"&&i!=="bigint"?lB(e,t):i==="number"&&!isFinite(e)?Nee(e,t):Lee(e,t,n)}}function lB(e,t){return`value ${e} does not match type ${t}`}function Bee(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Lee(e,t,n){if(n){let i=on.isUnsignedIntegerType(t)?0:-1,r=1;return e<i||e>r?Bee(e,t,n):void 0}if(e<on.getMinimum(t)||e>on.getMaximum(t))return Bee(e,t,n)}function Nee(e,t){return`value ${e} of type ${t} must be finite`}function T5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=T5(e[i],t,n);return e}ha.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=ha.valueTransformInPlace(e[r],t[r],n[r],i);return e};var A0=ha;function KS(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===Yt.STRING,d=o===Yt.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(on[_],on.UINT32);let b=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new E5(r[b],_,t+1),p+=g.typedArray.byteLength}let h=Yt.getComponentCount(o),A;a?A=g.get(t)-g.get(0):s?A=t*i.arrayLength:A=t;let x=h*A,C;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(on[_],on.UINT32);let b=y(n.stringOffsets,n.stringOffsetBufferView);C=new E5(r[b],_,x+1),p+=C.typedArray.byteLength}(f||d)&&(c=on.UINT8);let T;f?T=C.get(x)-C.get(0):d?T=Math.ceil(x/8):T=x;let E=y(n.values,n.bufferView),S=new E5(r[E],c,T);p+=S.typedArray.byteLength;let w=n.offset,D=n.scale,R=i.hasValueTransform||l(w)||l(D);w=y(w,i.offset),D=y(D,i.scale),w=Vee(w),D=Vee(D);let O,L,N=this;f?O=function(_){return CBe(_,N._values,N._stringOffsets)}:d?(O=function(_){return TBe(_,N._values)},L=function(_,b){EBe(_,N._values,b)}):l(u)?(O=function(_){let b=N._values.get(_);return u.namesByValue[b]},L=function(_,b){let v=u.valuesByName[b];N._values.set(_,v)}):(O=function(_){return N._values.get(_)},L=function(_,b){N._values.set(_,b)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=h,this._min=n.min,this._max=n.max,this._offset=w,this._scale=D,this._hasValueTransform=R,this._getValue=O,this._setValue=L,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(KS.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});KS.prototype.get=function(e){let t=ABe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=OBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};KS.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=RBe(this,t),t=n.unnormalize(t),xBe(this,e,t)};KS.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Vee(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function ABe(e,t){zee(e)&&Hee(e);let n=e._classProperty,i=n.isArray,r=n.type,o=Yt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ye(s,!0):s}return!i&&o===1?e._getValue(t):kee(e,n,t)}function kee(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=Yt.getComponentCount(t.type);i*=s,r*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function xBe(e,t,n){IBe(e,t,n)&&Hee(e);let i=e._classProperty,r=i.isArray,o=i.type,s=Yt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Ye(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function CBe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Ul(t.typedArray,i,r)}function TBe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function EBe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function bBe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function SBe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function vBe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function wBe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function DBe(e){switch(e){case on.INT8:return X.BYTE;case on.UINT8:return X.UNSIGNED_BYTE;case on.INT16:return X.SHORT;case on.UINT16:return X.UNSIGNED_SHORT;case on.INT32:return X.INT;case on.UINT32:return X.UNSIGNED_INT;case on.FLOAT32:return X.FLOAT;case on.FLOAT64:return X.DOUBLE}}function zee(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Yt.STRING||i===on.INT64&&!jt.supportsBigInt64Array()||i===on.UINT64&&!jt.supportsBigUint64Array()}function IBe(e,t,n){if(zee(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Hee(e){e._unpackedValues=PBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function PBe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=Yt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=kee(e,i,a);return n}function OBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:A0.valueTransformInPlace(t,e._offset,e._scale,on.applyValueTransform)}function RBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:A0.valueTransformInPlace(t,e._offset,e._scale,on.unapplyValueTransform)}function E5(e,t,n){let i=this,r,o,s;if(t===on.INT64)jt.supportsBigInt()?jt.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return SBe(a,i)}):(Rt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return bBe(a,i)});else if(t===on.UINT64)jt.supportsBigInt()?jt.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return wBe(a,i)}):(Rt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return vBe(a,i)});else{let a=DBe(t);r=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var uB=KS;function Xf(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new uB({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Xf.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Xf.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Xf.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Xf.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Xf.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=MBe(this._class,t),i};Xf.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Xf.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Xf.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Xf.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Xf.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function MBe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Ye(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var zl=Xf;function k_(){}Object.defineProperties(k_.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});k_.prototype.load=function(){fe.throwInstantiationError()};k_.prototype.unload=function(){};k_.prototype.process=function(e){return!1};k_.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` -${t.message}`);let n=new de(e);return l(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};k_.prototype.isDestroyed=function(){return!1};k_.prototype.destroy=function(){return this.unload(),ue(this)};var ir=k_;var BBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},wt=Object.freeze(BBe);function Jh(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Jh.prototype=Object.create(ir.prototype),Jh.prototype.constructor=Jh);Object.defineProperties(Jh.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Jh.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=LBe(this),this._promise)};async function LBe(e){let t=e._resource;e._state=wt.LOADING;try{let n=await Jh._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=wt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=wt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Jh._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Jh.prototype.unload=function(){this._typedArray=void 0};var PC=Jh;var aYt=function(){"use strict";var e="B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gVUUUUUB9gLUUUUB9gIUUUEU9gD99UE99I8ayDILEVLEVLOOOOORRVBWWBEdddLVE9wEIIVIEBEOWEUEC+g/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBV8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBOe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBRA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBWl9tw79o9v9wT9fw9u9j9v9kws9p2Twv9P9jTBdk9tw79o9v9wT9fw9u9j9v9kws9p2Twv9R919hTBQl9tw79o9v9wT9fw9u9j9v9kws9p2Twvt949wBKe9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9owBpA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9ow9TTv9p9wBSA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBZL79iv9rBhdWEBCEKDxcQ+1tyDBK/hKEyU8jJJJJBCJO9rGV8kJJJJBCBHODNALCEFAE0MBABCBrB+Q+KJJBC+gEv86BBAVCJDFCBCJDZ+TJJJB8aDNAItMBAVCJDFADALZmJJJB8aKABAEFHRABCEFHWAVALFCBCBCJDAL9rALCfE0eZ+TJJJB8aAVAVCJDFALZmJJJBHdCJ/ABAL9uHEDNDNALtMBAEC/wfBgGECJDAECJD6eHQCBHKINAKAI9PMEAdCJLFCBCJDZ+TJJJB8aAQAIAK9rAKAQFAI6eGXCSFGECL4CIFCD4HMADAKAL2FHpDNDNDNDNDNAEC9wgGStMBCBHZCEHhApHoAWHaXEKDNAXtMBCBHaCEHhApHcINAdAaFrBBHxAcHECBHOINAdCJLFAOFAErBBGqAx9rGxCETAxCkTCk91CR4786BBAEALFHEAqHxAOCEFGOAX9HMBKARAW9rAM6MIAWCBAMZ+TJJJBGEtMIAEAMFHWAcCEFHcAaCEFGaAL6HhAaAL9HMBXVKKARAW9rAM6MOAWCBAMZ+TJJJB8aCEHEINAWGxAMFHWALAEGOsMLDNARAW9rAM6MBAOCEFHEAWCBAMZ+TJJJB8aAxMEKKCBHWAOAL6MOXIKINDNAXtMBAdAZFrBBHxCBHEAoHOINAdCJLFAEFAOrBBGqAx9rGxCETAxCkTCk91CR4786BBAOALFHOAqHxAECEFGEAX9HMBKKARAa9rAM6MEARAaCBAMZ+TJJJBGlAMFGW9rCk6MDCBHkAdCJLFHcINAdCJLFAkFHyCWH8aCZHaCEHqINDNDNAqCE9HMBCUHOAyrBBMECBHODNINAOGECSsMEAECEFHOAcAEFCEFrBBtMBKKCUCBAECS6eHOXEKAqCETC/+fffEgHOCUAqTCU7CfEgHxCBHEINAOAxAcAEFrBB9NFHOAECEFGECZ9HMBKKAOAaAOAa6GEeHaAqA8aAEeH8aAqCETGqCW6MBKDNDNDNDNA8aCUFpDIEBKAlAkCO4FGEAErBBCDCIA8aCLseAkCI4COgTv86BBA8aCW9HMEAWAy8pBB83BBAWCWFAyCWF8pBB83BBAWCZFHWXDKAlAkCO4FGEAErBBCEAkCI4COgTv86BBKDNCWA8a9tGeMBINAWCB86BBAWCEFHWXBKKCUA8aTCU7HqCBH3AcH5INA5HEAeHxCBHOINAErBBGaAqAaAqCfEgGy6eAOCfEgA8aTvHOAECEFHEAxCUFGxMBKAWAO86BBA5AeFH5AWCEFHWA3AeFG3CZ6MBKCBHEINDNAcAEFrBBGOAy6MBAWAO86BBAWCEFHWKAECEFGECZ9HMBKKDNAkCZFGkAS9PMBAcCZFHcARAW9rCl0MEKKAkAS6MEAWtMEAoCEFHoAZCEFGZAL6HhAWHaAZALsMIXBKKCBHWAhCEgtMEXLKCBHWAhCEgMIKAdApAXCUFAL2FALZmJJJB8aAXAKFHKAWMBKCBHOXDKCBHOARAW9rCAALALCA6e6MEDNALC8f0MBAWCBCAAL9rGEZ+TJJJBAEFHWKAWAdCJDFALZmJJJBALFAB9rHOXEKCBHOKAVCJOF8kJJJJBAOK9HEEUAECAAECA0eABCJ/ABAE9uC/wfBgGDCJDADCJD6eGDFCUFAD9uAE2ADCL4CIFCD4ADv2FCEFKMBCBABbD+Q+KJJBK/YSE3U8jJJJJBC/AE9rGL8kJJJJBCBHVDNAICI9uGOChFAE0MBABCBYDn+KJJBGVC/gEv86BBALC/ABFCfECJEZ+TJJJB8aALCuFGR9CU83IBALC8wFGW9CU83IBALCYFGd9CU83IBALCAFGQ9CU83IBALCkFGK9CU83IBALCZFGX9CU83IBAL9CU83IWAL9CU83IBABAEFC9wFHMABCEFGpAOFHEDNAItMBCMCSAVCB9KGSeHZAVCE9IHhCBHoCBHaCBHcCBHxCBHqINDNAEAM9NMBCBHVXIKAqCUFHVADAcCDTFGOYDBHlAOCWFYDBHkAOCLFYDBHyCBH8aDNDNINALC/ABFAVCSgCITFGOYDLHeDNDNDNAOYDBGOAl9HMBAeAysMEKDNAOAy9HMBAeAk9HMBA8aCEFH8aXEKAOAk9HMEAeAl9HMEA8aCDFH8aKA8aC870MDAxCUFHVADA8aCIgCX2GOC+Y1JJBFYDBAcFCDTFYDBHeADAOCn1JJBFYDBAcFCDTFYDBHkADAOC+Q1JJBFYDBAcFCDTFYDBHlCBHODNINDNALAVCSgCDTFYDBAe9HMBAOHyXDKCUHyAVCUFHVAOCEFGOCZ9HMBKKAyCB9KAyAZ9IgGVCU7AeAosGOgH3DNDNDNDNDNAyCBCSAOeAVeGVCS9HMBAhMBAeAeAaAeCEFAasGVeGaCEFsMECMCSAVeHVKApAVA8aCDTC/wEgv86BBAVCS9HMEAeAa9rGVCETAVC8f917HVINAEAVCfB0CRTAVCfBgv86BBAECEFHEAVCJE6HOAVCR4HVAOtMBKAeHaXDKCpHVApA8aCDTCpv86BBAeHaKAVtMBAVAZ9IMEKALAxCDTFAebDBAxCEFCSgHxKAoA3FHoALC/ABFAqCITFGVAkbDLAVAebDBALC/ABFAqCEFCSgGVCITFGOAebDLAOAlbDBAVCEFHOXIKAVCUFHVA8aCLFG8aC/AB9HMBKKDNADCEAkAosCETAyAoseCX2GVC+Q1JJBFYDBAcFCDTFYDBGltADAVCn1JJBFYDBAcFCDTFYDBG8aCEsgADAVC+Y1JJBFYDBAcFCDTFYDBGyCDsgAoCB9HgASgG5CE9HMBAR9CU83IBAW9CU83IBAd9CU83IBAQ9CU83IBAK9CU83IBAX9CU83IBAL9CU83IWAL9CU83IBCBHoKCBHeAxCUFGVHODNINDNALAOCSgCDTFYDBA8a9HMBAeHkXDKCUHkAOCUFHOAeCEFGeCZ9HMBKKCBHODNINDNALAVCSgCDTFYDBAy9HMBAOHeXDKCUHeAVCUFHVAOCEFGOCZ9HMBKKAoAlAosG8eFH3DNDNAkCM0MBAkCEFHkXEKCBCSA8aA3sGVeHkA3AVFH3KDNDNAeCM0MBAeCEFHeXEKCBCSAyA3sGVeHeA3AVFH3KC9+CUA8eeH8fAeAkCLTvHOCBHVDNDNDNINAVCJ1JJBFrBBAOCfEgsMEAVCEFGVCZ9HMBXDKKAlAo9HAVCM0vA5vMBApAVC/wEv86BBXEKApA8f86BBAEAO86BBAECEFHEKDNA8eMBAlAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKAlHaKDNAkCS9HMBA8aAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKA8aHaKDNAeCS9HMBAyAa9rGVCETAVC8f917HVINAEAVCfB0GOCRTAVCfBgv86BBAVCR4HVAECEFHEAOMBKAyHaKALAxCDTFAlbDBAxCEFCSgHVDNDNAkpZBEEEEEEEEEEEEEEBEKALAVCDTFA8abDBAxCDFCSgHVKDNDNAepZBEEEEEEEEEEEEEEBEKALAVCDTFAybDBAVCEFCSgHVKALC/ABFAqCITFGOAlbDLAOA8abDBALC/ABFAqCEFCSgCITFGOA8abDLAOAybDBALC/ABFAqCDFCSgCITFGOAybDLAOAlbDBAqCIFHOAVHxA3HoKApCEFHpAOCSgHqAcCIFGcAI6MBKKCBHVAEAM0MBCBHVINAEAVFAVCJ1JJBFrBB86BBAVCEFGVCZ9HMBKAEAB9rAVFHVKALC/AEF8kJJJJBAVKzEEUCBHDDNINADCEFGDC8f0MECEADTAE6MBKKADCRFCfEgCR9uCI2CDFABCI9u2ChFKMBCBABbDn+KJJBK+cDEWU8jJJJJBCZ9rHLCBHVDNAICVFAE0MBCBHOABCBrBn+KJJBC/QEv86BBAL9CB83IWABCEFHRABAEFC98FHWDNAItMBCBHdINDNARAW6MBCBSKADAdCDTFYDBGQALCWFAOAQALCWFAOCDTFYDB9rGEAEC8f91GEFAE7C507GOCDTFGKYDB9rGEC8e91C9+gAECDT7AOvHEINARAECfB0GVCRTAECfBgv86BBAECR4HEARCEFHRAVMBKAKAQbDBAdCEFGdAI9HMBKKCBHVARAW0MBARCBbBBARAB9rCLFHVKAVKbEEUCBHDDNINADCEFGDC8f0MECEADTAE6MBKKADCWFCfEgCR9uAB2CVFK+DVLI99DUI99LUDNAEtMBCUADCETCUFTCU7+yHVDNDNCUAICUFTCU7+yGOjBBBzmGR+LjBBB9P9dtMBAR+oHWXEKCJJJJ94HWKCBHICBHdINALCLFiDBGRjBBBBjBBJzALiDBGQ+LAR+LmALCWFiDBGK+LmGR+VARjBBBB9beGRnHXAQARnHRALCXFiDBHQDNDNAKjBBBB9gtMBAXHKXEKjBBJzAR+L+TGKAK+MAXjBBBB9geHKjBBJzAX+L+TGXAX+MARjBBBB9geHRKDNDNAQjBBJ+/AQjBBJ+/9geGXjBBJzAXjBBJz9feAVnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHMXEKCJJJJ94HMKDNDNAKjBBJ+/AKjBBJ+/9geGQjBBJzAQjBBJz9feAOnjBBBzjBBB+/AKjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHpXEKCJJJJ94HpKDNDNARjBBJ+/ARjBBJ+/9geGQjBBJzAQjBBJz9feAOnjBBBzjBBB+/ARjBBBB9gemGR+LjBBB9P9dtMBAR+oHSXEKCJJJJ94HSKDNDNADCL9HMBABAdFGZAS86BBAZCIFAM86BBAZCDFAW86BBAZCEFAp86BBXEKABAIFGZAS87EBAZCOFAM87EBAZCLFAW87EBAZCDFAp87EBKALCZFHLAICWFHIAdCLFHdAECUFGEMBKKK/KLLD99EUD99EUDNAEtMBDNDNCUAICUFTCU7+yGVjBBBzmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKAIC/8fIgHRINABCOFCICDALCLFiDB+LALiDB+L9eGIALCWFiDB+LALAICDTFiDB+L9eeGIALCXFiDB+LALAICDTFiDB+L9eeGIARv87EBDNDNALAICEFCIgCDTFiDBj/zL+1znjBBJ+/jBBJzALAICDTFiDBjBBBB9deGOnGWjBBJ+/AWjBBJ+/9geGdjBBJzAdjBBJz9feAVnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHQXEKCJJJJ94HQKABAQ87EBDNDNAOALAICDFCIgCDTFiDBj/zL+1znnGWjBBJ+/AWjBBJ+/9geGdjBBJzAdjBBJz9feAVnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHQXEKCJJJJ94HQKABCDFAQ87EBDNDNAOALAICUFCIgCDTFiDBj/zL+1znnGOjBBJ+/AOjBBJ+/9geGWjBBJzAWjBBJz9feAVnjBBBzjBBB+/AOjBBBB9gemGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKABCLFAI87EBABCWFHBALCZFHLAECUFGEMBKKK+7DDWUE998jJJJJBCZ9rGV8kJJJJBDNAEtMBADCL6MBCEAI9rHOADCD4GDCEADCE0eHRADCDTHWCBHdINC+cUHDALHIARHQINAIiDBAVCXFZ+XJJJB8aAVYDXGKADADAK9IeHDAICLFHIAQCUFGQMBKAOADFGICkTHKCBHDCBAI9rHXARHIINDNDNALADFiDBGMAXZ+WJJJBjBBBzjBBB+/AMjBBBB9gemGM+LjBBB9P9dtMBAM+oHQXEKCJJJJ94HQKABADFAQCfffRgAKvbDBADCLFHDAICUFGIMBKABAWFHBALAWFHLAdCEFGdAE9HMBKKAVCZF8kJJJJBK/tKDcUI998jJJJJBC+QD9rGV8kJJJJBAVC+oEFCBC/kBZ+TJJJB8aCBHODNADtMBCBHOAItMBDNABAE9HMBAVCUADCDTGOADCffffI0eCBYD1+KJJBhJJJJBBGEbD+oEAVCEbD1DAEABAOZmJJJB8aKAVC+YEFCWFCBbDBAV9CB83I+YEAVC+YEFAEADAIAVC+oEFZ+NJJJBCUAICDTGRAICffffI0eGWCBYD1+KJJBhJJJJBBHOAVC+oEFAVYD1DGdCDTFAObDBAVAdCEFGQbD1DAOAVYD+YEGKARZmJJJBHXAVC+oEFAQCDTFADCI9uGMCBYD1+KJJBhJJJJBBGObDBAVAdCDFGRbD1DAOCBAMZ+TJJJBHpAVC+oEFARCDTFAWCBYD1+KJJBhJJJJBBGSbDBAVAdCIFGQbD1DAXHOASHRINARALiDBALAOYDBGWCWAWCW6eCDTFC/EBFiDBmuDBAOCLFHOARCLFHRAICUFGIMBKAVC+oEFAQCDTFCUAMCDTADCffff970eCBYD1+KJJBhJJJJBBGQbDBAVAdCLFbD1DDNADCI6MBAMCEAMCE0eHIAEHOAQHRINARASAOYDBCDTFiDBASAOCLFYDBCDTFiDBmASAOCWFYDBCDTFiDBmuDBAOCXFHOARCLFHRAICUFGIMBKKAVC/MBFHZAVYD+cEHhAVYD+gEHoAVHOCBHWCBHRCBHaCEHcINAOHxCIHqAEARCI2GlCDTFGOCWFYDBHkAOYDBHDABAaCX2FGICLFAOCLFYDBGdbDBAIADbDBAICWFAkbDBApARFCE86BBAZAkbDWAZAdbDLAZADbDBAQARCDTFCBbDBDNAWtMBCIHqAxHIINDNAIYDBGOADsMBAOAdsMBAOAksMBAZAqCDTFAObDBAqCEFHqKAICLFHIAWCUFGWMBKKAaCEFHaAXADCDTFGOAOYDBCUFbDBAXAdCDTFGOAOYDBCUFbDBAXAkCDTFGOAOYDBCUFbDBCBHWINAoAhAEAWAlFCDTFYDBCDTGIFYDBCDTFGkHOAKAIFGdYDBGDHIDNADtMBDNINAOYDBARsMEAOCLFHOAICUFGItMDXBKKAOADCDTAkFC98FYDBbDBAdAdYDBCUFbDBKAWCEFGWCI9HMBKDNDNDNAqtMBCUHRjBBBBHyCBHOINASAZAOCDTFYDBCDTGIFGWiDBH8aAWALCBAOCEFGdAOCS0eCDTFiDBALAXAIFYDBGOCWAOCW6eCDTFC/EBFiDBmGeuDBDNAKAIFYDBGWtMBAeA8a+THeAoAhAIFYDBCDTFHOAWCDTHIINAQAOYDBGWCDTFGDAeADiDBmG8auDBA8aAyAyA8a9dGDeHyAWARADeHRAOCLFHOAIC98FGIMBKKAdHOAdAq9HMBKARCU9HMEKAcAM9PMEINDNApAcFrBBMBAcHRXDKAMAcCEFGc9HMBXDKKAqCZAqCZ6eHWAZHOAxHZARCU9HMEKKAVYD1DHOKAOCDTAVC+oEFFC98FHRDNINAOtMEARYDBCBYD+E+KJJBh+BJJJBBARC98FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var A=p.charCodeAt(h);g[h]=A>96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h<p.length;++h)g[x++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,x)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g,h){var A=n.exports.sbrk,x=A(p.length*4),C=A(g*4),T=new Uint8Array(n.exports.memory.buffer),E=s(p);T.set(E,x),h&&h(x,x,p.length,g);var S=n.exports.meshopt_optimizeVertexFetchRemap(C,x,p.length,g);T=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(g);new Uint8Array(w.buffer).set(T.subarray(C,C+g*4)),E.set(T.subarray(x,x+p.length*4)),A(x-A(0));for(var D=0;D<p.length;++D)p[D]=w[p[D]];return[w,S]}function c(p,g,h,A,x){var C=n.exports.sbrk,T=C(g),E=C(A*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(h),E);var w=p(T,g,E,A,x),D=new Uint8Array(w);return D.set(S.subarray(T,T+w)),C(T-C(0)),D}function u(p){for(var g=0,h=0;h<p.length;++h){var A=p[h];g=g<A?A:g}return g}function f(p,g){if(o(g==2||g==4),g==4)return new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4);var h=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2);return new Uint32Array(h)}function d(p,g,h,A,x,C){var T=n.exports.sbrk,E=T(h*A),S=T(h*C),w=new Uint8Array(n.exports.memory.buffer);w.set(s(g),S),p(E,h,A,x,S);var D=new Uint8Array(h*A);return D.set(w.subarray(E,E+h*A)),T(E-T(0)),D}return{ready:i,supported:!0,reorderMesh:function(p,g,h){var A=g?h?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(p,u(p)+1,A)},encodeVertexBuffer:function(p,g,h){o(h>0&&h<=256),o(h%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,A,p,g,h)},encodeIndexBuffer:function(p,g,h){o(h==2||h==4),o(g%3==0);var A=f(p,h),x=n.exports.meshopt_encodeIndexBufferBound(g,u(A)+1);return c(n.exports.meshopt_encodeIndexBuffer,x,A,g,4)},encodeIndexSequence:function(p,g,h){o(h==2||h==4);var A=f(p,h),x=n.exports.meshopt_encodeIndexSequenceBound(g,u(A)+1);return c(n.exports.meshopt_encodeIndexSequence,x,A,g,4)},encodeGltfBuffer:function(p,g,h,A){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](p,g,h)},encodeFilterOct:function(p,g,h,A){return o(h==4||h==8),o(A>=1&&A<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,A,16)},encodeFilterQuat:function(p,g,h,A){return o(h==8),o(A>=4&&A<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,A,16)},encodeFilterExp:function(p,g,h,A){return o(h>0&&h%4==0),o(A>=1&&A<=24),d(n.exports.meshopt_encodeFilterExp,p,g,h,A,h)}}}();var Gee=function(){"use strict";var e="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+p8yQDBK/3SEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAQAE9PMEAdAEAQ9rAQAdFAE6eGKCSFGOCL4CIFCD4HXDNDNDNDNAOC9wgGMtMBCBHpCEHSAWCJDFHZALHhINARAh9rAX6MIDNARAhAXFGL9rCk6MBCZHOINAWCJ/CBFAOGIFGOC9wFHoDNDNDNDNDNAhAIC9wFGaCO4FrBBAaCI4COg4CIgpLBEDIBKAo9CB83IBAoCWF9CB83IBXIKAoALrBLALrBBGaCO4GcAcCIsGce86BBAOCgFALCLFAcFGorBBAaCL4CIgGcAcCIsGce86BBAOCvFAoAcFGorBBAaCD4CIgGcAcCIsGce86BBAOC7FAoAcFGorBBAaCIgGaAaCIsGae86BBAOCTFAoAaFGarBBALrBEGoCO4GcAcCIsGce86BBAOC91FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC4FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC93FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC94FAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOC95FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC96FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC97FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC98FAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOC99FAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOC9+FAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCUFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAoALrBWALrBBGaCL4GcAcCSsGce86BBAOCgFALCWFAcFGorBBAaCSgGaAaCSsGae86BBAOCvFAoAaFGorBBALrBEGaCL4GcAcCSsGce86BBAOC7FAoAcFGorBBAaCSgGaAaCSsGae86BBAOCTFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOC91FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC4FAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOC93FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC94FAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOC95FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC96FAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOC97FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC98FAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOC99FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC9+FAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCUFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAoAL8pBB83BBAoCWFALCWF8pBB83BBALCZFHLKDNAIAM9PMBAICZFHOARAL9rCl0MEKKAIAM6MIALtMIDNAKtMBAWApFrBBHoCBHOAZHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKKAZCEFHZApCEFGpAD6HSALHhApAD9HMEXVKKCBHLASCEgMDXIKALAXAD2FHcDNAKtMBCBHhCEHSAWCJDFHMINARAL9rAX6MIALtMDALAXFHLAWAhFrBBHoCBHOAMHIINAIAWCJ/CBFAOFrBBGaCE4CBAaCEg9r7AoFGo86BBAIADFHIAOCEFGOAK9HMBKAMCEFHMAhCEFGhAD6HSAhAD9HMBKAcHLXIKCBHOCEHSINARAL9rAX6MDALtMEALAXFHLAOCEFGOAD6HSADAO9HMBKAcHLXDKCBHLASCEgtMEKC9+HOXIKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aAKAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK/YZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBB/+9CAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI86BBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD86BBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjB/+fsAWAWnjBBBBAWAWjBBBB9gGdeGQ+MGKAQAICB9IeALmGWAWnAKAQAOCB9IeARmGQAQnmm+R+VGLnjBBBzjBBB+/AdemGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKADAI87EBDNDNAQALnjBBBzjBBB+/AQjBBBB9gemGQ+LjBBB9P9dtMBAQ+oHDXEKCJJJJ94HDKAVAD87EBDNDNAWALnjBBBzjBBB+/AWjBBBB9gemGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK9MBDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCE91CJJJ/8IFCJJJ98g++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",t="B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBRl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBWL79iv9rBdQ/T9TQLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK/H8jLhUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHWCBHdINAdAE9PMEAWAEAd9rAdAWFAE6eGQCSFGOC9wgGKCI2HXAKCETHMAOCL4CIFCD4HpABAdAD2FHSCBHZDNINCEHhALHoCBHaDNINARAo9rAp6MIAVCJ/CBFAaAK2FHcAoApFHLCBHIDNAKC/AB6MBARAL9rC/gB6MBCBHOINAcAOFHIDNDNDNDNDNAoAOCO4FrBBGxCIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLBXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLBALCZFHLKDNDNDNDNDNAxCD4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLZXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLZALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLZALCZFHLKDNDNDNDNDNAxCL4CIgpLBEDIBKAIPXBBBBBBBBBBBBBBBBPKLAXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLAALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAIALPBBBPKLAALCZFHLKDNDNDNDNDNAxCO4pLBEDIBKAIPXBBBBBBBBBBBBBBBBPKL8wXIKAIALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCLFAyPqBFAxC+Q+YJJBFrBBFHLXDKAIALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBAxC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGxCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKL8wALCWFAyPqBFAxC+Q+YJJBFrBBFHLXEKAIALPBBBPKL8wALCZFHLKAOC/ABFHIAOCJEFAK0MEAIHOARAL9rC/fB0MBKKDNDNAIAK9PMBAICI4HOINARAL9rCk6MDAcAIFHxDNDNDNDNDNAoAICO4FrBBAOCOg4CIgpLBEDIBKAxPXBBBBBBBBBBBBBBBBPKLBXIKAxALPBBLALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlGqCDP+MEAqPMBZEhDoIaLcVxOqRlPXIIIIIIIIIIIIIIIIP9OGlPXIIIIIIIIIIIIIIIIP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCLFAyPqBFAkC+Q+YJJBFrBBFHLXDKAxALPBBWALPBBBGqCLP+MEAqPMBZEhDoIaLcVxOqRlPXSSSSSSSSSSSSSSSSP9OGlPXSSSSSSSSSSSSSSSSP8jGqP5B9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBAkC+Q+YJJBFPBBBGyAyPMBBBBBBBBBBBBBBBBAqP5E9CJf/8/4/w/g/AB9+9Cu1+nGkCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAlAqP9SPKLBALCWFAyPqBFAkC+Q+YJJBFrBBFHLXEKAxALPBBBPKLBALCZFHLKAOCDFHOAICZFGIAK6MBKKALtMBAaCI6HhALHoAaCEFGOHaAOCLsMDXEKKCBHLAhCEgMDKDNAKtMBAVCJDFAZFHIAVAZFPBDBHyCBHxINAIAVCJ/CBFAxFGOPBLBGlCEP9tAlPXEEEEEEEEEEEEEEEEGqP9OP9hP9RGlAOAKFPBLBG8aCEP9tA8aAqP9OP9hP9RG8aPMBZEhDoIaLcVxOqRlGeAOAMFPBLBG3CEP9tA3AqP9OP9hP9RG3AOAXFPBLBG5CEP9tA5AqP9OP9hP9RG5PMBZEhDoIaLcVxOqRlG8ePMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIAyP9uGyP9aDBBAIADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAeA8ePMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWkdyQ8aKeX3M5p8eS8fGlA3A5PMWkdyQ8aKeX3M5p8eS8fG8aPMBEZhDIoaLVcxORqlGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFGOAyAlA8aPMWdkyQK8aeXM35pS8e8fGqAqPMBEDIBEDIBEDIBEDIP9uGyP9aDBBAOADFGOAyAqAqPMLVORLVORLVORLVORP9uGyP9aDBBAOADFGOAyAqAqPMWdQKWdQKWdQKWdQKP9uGyP9aDBBAOADFGOAyAqAqPMXMpSXMpSXMpSXMpSP9uGyP9aDBBAOADFHIAxCZFGxAK6MBKKAZCLFGZAD6MBKASAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBAQAdFHdC9+HOALMEXIKKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK/UZEhU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoFHXXEKAXCBAOrBBGZeGaARC/+EsGRFHSAZCSgHcAZCL4HxDNDNAZCS0MBASCEFHoXEKASHoAVAIAx9rCSgCDTFYDBHSKDNDNAcMBAoCEFHXXEKAoHXAVAIAZ9rCSgCDTFYDBHoKDNDNARtMBAOCEFHRXEKAOCDFHRAO8sBEGhCfEgHpDNAhCU9KMBAOCOFHaApCfBgHpCRHODNINAR8sBBGhCfBgAOTApvHpAhCU9KMEARCEFHRAOCRFGOC8j9HMBKAaHRXEKARCEFHRKApCE4CBApCEg9r7AMFGMHaKDNDNAxCSsMBARHpXEKARCEFHpAR8sBBGOCfEgHhDNAOCU9KMBARCVFHSAhCfBgHhCRHODNINAp8sBBGRCfBgAOTAhvHhARCU9KMEApCEFHpAOCRFGOC8j9HMBKASHpXEKApCEFHpKAhCE4CBAhCEg9r7AMFGMHSKDNDNAcCSsMBApHOXEKApCEFHOAp8sBBGRCfEgHhDNARCU9KMBApCVFHoAhCfBgHhCRHRDNINAO8sBBGpCfBgARTAhvHhApCU9KMEAOCEFHOARCRFGRC8j9HMBKAoHOXEKAOCEFHOKAhCE4CBAhCEg9r7AMFGMHoKDNDNADCD9HMBABAdCETFGRAa87EBARCDFAS87EBARCLFAo87EBXEKABAdCDTFGRAabDBARCLFASbDBARCWFAobDBKAVC/ABFALCITFGRASbDBARAabDLAVAICDTFAabDBAVC/ABFALCEFCSgCITFGRAobDBARASbDLAVAICEFGICSgCDTFASbDBAVC/ABFALCDFCSgCITFGRAabDBARAobDLAVAIAZCZ6AxCSsvFGICSgCDTFAobDBAIActAcCSsvFHIALCIFHLKAWCEFHWALCSgHLAICSgHIAdCIFGdAE6MBKKCBC99AOAQseHOKAVC/AEF8kJJJJBAOK+LLEVU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHRAIALFC98FHWDNAEtMBDNADCDsMBCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCDTFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGLbDBAOALbDBAdCEFGdAE9HMBXDKKCBHdINDNARAW6MBC9+SKARCEFHOAR8sBBGLCfEgHIDNDNALCU9MMBAOHRXEKARCVFHRAICfBgHICRHLDNINAO8sBBGDCfBgALTAIvHIADCU9KMEAOCEFHOALCRFGLC8j9HMBXDKKAOCEFHRKABAdCETFAICD4CBAICE4CEg9r7AVCWFAICEgCDTvGOYDBFGL87EBAOALbDBAdCEFGdAE9HMBKKCBC99ARAWseHOKAOK+epLIUO97EUE978jJJJJBCA9rHIDNDNADCL9HMBDNAEC98gGLtMBCBHVABHDINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdPXBBBBBBBBBBBBBBBBP+2EGQARPXBBBJBBBJBBBJBBBJGKP9OP9RP/kEGRPXBB/+9CBB/+9CBB/+9CBB/+9CARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEPXBBN0BBN0BBN0BBN0GQP/kEPXfBBBfBBBfBBBfBBBP9OAOPXBBBfBBBfBBBfBBBfP9OP9QARAWP/mEAQP/kECWP+rEPXBfBBBfBBBfBBBfBBP9OP9QAdAWP/mEAQP/kECZP+rEPXBBfBBBfBBBfBBBfBP9OP9QPKLBKALAIAD/8QBBSKDNAEC98gGXtMBCBHVABHDINADCZFGLALPBBBGOPXBBBBBBffBBBBBBffGKP9OADPBBBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKBBADAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKBBADCAFHDAVCLFGVAX6MBKKAXAE9PMBAIAECIgGVCITGDFCBCAAD9r/8KBAIABAXCITFGLAD/8QBBDNAVtMBAIAIPBLZGOPXBBBBBBffBBBBBBffGKP9OAIPBLBGdAOPMLVORXMpScxql358e8fPXfUBBfUBBfUBBfUBBP9OP/6EAdAOPMBEDIWdQKZhoaky8aeGOCZP+sEP/6EGRP/gEAOCZP+rECZP+sEP/6EGWP/gEP/kEP/lEGOPXB/+fsB/+fsB/+fsB/+fsAWAOPXBBBBBBBBBBBBBBBBP+2EGQAWPXBBBJBBBJBBBJBBBJGMP9OP9RP/kEGWAWP/mEAOAOP/mEARAQARAMP9OP9RP/kEGOAOP/mEP/kEP/kEP/jEP/nEGRP/mEPXBBN0BBN0BBN0BBN0GQP/kECZP+rEAWARP/mEAQP/kEPXffBBffBBffBBffBBP9OP9QGWAOARP/mEAQP/kEPXffBBffBBffBBffBBP9OGOPMWdkyQK8aeXM35pS8e8fP9QPKLZAIAdAKP9OAWAOPMBEZhDIoaLVcxORqlP9QPKLBKALAIAD/8QBBKK/4WLLUE97EUV978jJJJJBC8w9rHIDNAEC98gGLtMBCBHVABHOINAIAOPBBBGRAOCZFGWPBBBGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLBAOPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLBPeB+t+J83IBAOCWFARP5EAIPBLBPeE+t+J83IBAWAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLBPeD+t+J83IBAOCkFAKP5EAIPBLBPeI+t+J83IBAOCAFHOAVCLFGVAL6MBKKDNALAE9PMBAIAECIgGVCITGOFCBCAAO9r/8KBAIABALCITFGWAO/8QBBDNAVtMBAIAIPBLBGRAIPBLZGdPMLVORXMpScxql358e8fGQCZP+sEGKCLP+rEPKLAAIPXBBJzBBJzBBJzBBJzPX/zL81z/zL81z/zL81z/zL81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLAPeB+t+J83IBAIARP5EAIPBLAPeE+t+J83IWAIAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLAPeD+t+J83IZAIAKP5EAIPBLAPeI+t+J83IkKAWAIAO/8QBBKK+pDDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=e;WebAssembly.validate(n)&&(r=t);var o,s=WebAssembly.instantiate(a(r),{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function a(d){for(var p=new Uint8Array(d.length),g=0;g<d.length;++g){var h=d.charCodeAt(g);p[g]=h>96?h-71:h>64?h-65:h>47?h+4:h>46?63:62}for(var A=0,g=0;g<d.length;++g)p[A++]=p[g]<60?i[p[g]]:(p[g]-60)*64+p[++g];return p.buffer.slice(0,A)}function c(d,p,g,h,A,x){var C=o.exports.sbrk,T=g+3&-4,E=C(T*h),S=C(A.length),w=new Uint8Array(o.exports.memory.buffer);w.set(A,S);var D=d(E,g,h,S,A.length);if(D==0&&x&&x(E,T,h),p.set(w.subarray(E,E+g*h)),C(E-C(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var u={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:s,supported:!0,decodeVertexBuffer:function(d,p,g,h,A){c(o.exports.meshopt_decodeVertexBuffer,d,p,g,h,o.exports[u[A]])},decodeIndexBuffer:function(d,p,g,h){c(o.exports.meshopt_decodeIndexBuffer,d,p,g,h)},decodeIndexSequence:function(d,p,g,h){c(o.exports.meshopt_decodeIndexSequence,d,p,g,h)},decodeGltfBuffer:function(d,p,g,h,A,x){c(o.exports[f[A]],d,p,g,h,o.exports[u[x]])}}}();var uYt=function(){"use strict";var e="B9h79tEBBBECd9gEUEU9gEUB9gBB9gQUUUUUUU99UUEU9gVUUUUUB9gLUUUUE999gIUUUE999gLUUUUEU9gIUUUEUIMXDILVORBWWBEWLVE9wEIIVIEBEOWEUECJ/JEKR7OO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BBZ9tw79o9v9wT9f79p9t9w29p9m95BEx9tw79o9v9wT9f79p9t9w29p9m959T9j9h2wBLA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBVL79iv9rBOdWEBCEKDdQQ+stXDBK/48yIkUp99hU8jJJJJBCJ/BB9rGQ8kJJJJBAQCkFCBC/kBZ1JJJB8aCUALCDTGKALCffffI0eGXCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQAMbDWAQApCEFbD94AXCBYD/s1JJBhJJJJBBHSAQCkFAQYD94GpCDTFASbDBAQASbDXAQApCEFbD94CUADCITADCffffE0eCBYD/s1JJBhJJJJBBHZAQCkFAQYD94GpCDTFAZbDBAQAZbDZAQApCEFbD94AQCWFAEADALCBZ+CJJJBAXCBYD/s1JJBhJJJJBBHhAQCkFAQYD94GpCDTFAhbDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHoAQCkFAQYD94GpCDTFAobDBAQApCEFbD94ALCD4ALFHaCEHcINAcGpCETHcApAa6MBKCBHxCUApCDTGaApCffffI0eCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94AcCfEAaZ1JJJBHlDNALtMBAVCD4HkApCUFHqINAIAxAk2CDTFGyYDLGpCh4Ap7C+f+B+dd2AyYDBGpCh4Ap7C/d/o+b8j27AyYDWGpCh4Ap7C+3f/n8n27HaCBHpDNDNINAlAaAqgGaCDTFG8aYDBGcCUsMEAIAcAk2CDTFAyCXZ+LJJJBtMDApCEFGpAaFHaApAq9NMBXDKKA8aAxbDBAxHcKAhAxCDTFAcbDBAxCEFGxAL9HMBKCBHpAoHcINAcApbDBAcCLFHcALApCEFGp9HMBKCBHpAhHcAoHaINDNApAcYDBGqsMBAaAoAqCDTFGqYDBbDBAqApbDBKAcCLFHcAaCLFHaALApCEFGp9HMBKKCBHaALCBYD/s1JJBhJJJJBBHyAQCkFAQYD94GpCDTFAybDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GcCDTFApbDBAQAcCEFbD94AXCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94ApCfEAKZ1JJJBHeAcCfEAKZ1JJJBH3DNALtMBAZCWFH5INDNAMAaCDTGpFYDBG8etMBAZASApFYDBCITFH8fA3ApFHAAeApFHxCBHkINDNDNA8fAkCITFYDBGlAa9HMBAxAabDBAAAabDBXEKDNAMAlCDTGKFYDBGHtMBAZASAKFYDBCITGpFYDBAasMEAHCUFH8aA5ApFHcCBHpINA8aApsMEApCEFHpAcYDBHqAcCWFHcAqAa9HMBKApAH6MEKA3AKFGpAaAlApYDBCUsebDBAxAlAaAxYDBCUsebDBKAkCEFGkA8e9HMBKKAaCEFGaAL9HMBKAhHcAoHaA3HqAeHkCBHpINDNDNApAcYDBG8a9HMBDNApAaYDBG8a9HMBAkYDBH8aDNAqYDBGlCU9HMBA8aCU9HMBAyApFCB86BBXIKAyApFHxDNApAlsMBApA8asMBAxCE86BBXIKAxCL86BBXDKDNApAoA8aCDTGlFYDB9HMBDNAqYDBGxCUsMBApAxsMBAkYDBGKCUsMBApAKsMBA3AlFYDBG8eCUsMBA8eA8asMBAeAlFYDBGlCUsMBAlA8asMBDNAhAxCDTFYDBAhAlCDTFYDB9HMBAhAKCDTFYDBAhA8eCDTFYDB9HMBAyApFCD86BBXLKAyApFCL86BBXIKAyApFCL86BBXDKAyApFCL86BBXEKAyApFAyA8aFrBB86BBKAcCLFHcAaCLFHaAqCLFHqAkCLFHkALApCEFGp9HMBKAWCEgtMBAyHpALHcINDNAprBBCE9HMBApCL86BBKApCEFHpAcCUFGcMBKKCBHkCUALCX2ALC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQApCEFbD94AMAIALAVZ+DJJJB8aCUALC8s2GcALC/d/o/F8u0eCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GaCDTFApbDBAQAaCEFbD94ApCBAcZ1JJJBHZDNADtMBAEHcINDNAMAcCLFYDBG8aCX2FGpiDBAMAcYDBGlCX2FGaiDBGG+TG8jAMAcCWFYDBGxCX2FGqCLFiDBAaCLFiDBG8k+TG8lnAqiDBAG+TG8mApCLFiDBA8k+TG8nn+TGYAYnA8nAqCWFiDBAaCWFiDBG8p+TGinA8lApCWFiDBA8p+TG8nn+TG8lA8lnA8nA8mnAiA8jn+TG8jA8jnmm+RG8mjBBBB9etMBAYA8m+VHYA8jA8m+VH8jA8lA8m+VH8lKAZAhAlCDTFYDBC8s2FGpA8lA8m+RG8mA8lnnG8nApiDBmuDBApA8jA8mA8jnG8rnGiApiDLmuDLApAYA8mAYnG8snGrApiDWmuDWApA8rA8lnG8rApiDXmuDXApA8sA8lnG8uApiDZmuDZApA8sA8jnG8sApiDcmuDcApA8lA8mAYA8pnA8lAGnA8kA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApAYAGnGYApiDAmuDAApAGA8knGGApiD8kmuD8kApA8mApiDYmuDYAZAhA8aCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAZAhAxCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAcCXFHcAkCIFGkAD6MBKCBH8aAEHxINCBHcINAyAEAcC+81JJBFYDBGlA8aFCDTFYDBGaFrBBHpDNDNAyAxAcFYDBGqFrBBGkC99FCfEgCPE0MBApCEsMBApCD9HMEKDNAkCUFCfEgCE0MBAeAqCDTFYDBAa9HMEKDNApCUFCfEgCE0MBA3AaCDTFYDBAq9HMEKDNAkCV2ApFC+g1JJBFrBBtMBAhAaCDTFYDBAhAqCDTFYDB0MEKjBBACjBBJzApCEseH8mAkCEsHKAEAlCDTC+81JJBFYDBA8aFCDTFYDBHlDNAMAaCX2FGpCWFiDBAMAqCX2FGkCWFiDBG8k+TG8lA8lnApiDBAkiDBG8p+TG8jA8jnApCLFiDBAkCLFiDBG8n+TGYAYnmm+RGGjBBBB9etMBA8lAG+VH8lAYAG+VHYA8jAG+VH8jKjBBACA8mAKeH8sDNAMAlCX2FGpiDWA8k+TG8mA8lA8mA8lnApiDBA8p+TGrA8jnAYApiDLA8n+TG8rnmmGin+TG8mA8mnArA8jAin+TG8lA8lnA8rAYAin+TG8jA8jnmm+RGYjBBBB9etMBA8mAY+VH8mA8jAY+VH8jA8lAY+VH8lKAZAhAqCDTFYDBC8s2FGpA8lA8sAGnGYA8lnnGiApiDBmuDBApA8jAYA8jnG8snGrApiDLmuDLApA8mAYA8mnGGnG8rApiDWmuDWApA8sA8lnG8sApiDXmuDXApAGA8lnG8uApiDZmuDZApAGA8jnG8vApiDcmuDcApA8lAYA8mA8knA8lA8pnA8nA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApA8mAGnG8mApiDAmuDAApAGA8knGGApiD8kmuD8kApAYApiDYmuDYAZAhAaCDTFYDBC8s2FGpAiApiDBmuDBApArApiDLmuDLApA8rApiDWmuDWApA8sApiDXmuDXApA8uApiDZmuDZApA8vApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApA8mApiDAmuDAApAGApiD8kmuD8kApAYApiDYmuDYKAcCLFGcCX9HMBKAxCXFHxA8aCIFG8aAD6MBKKDNABAEsMBABAEADCDTZ+HJJJB8aKCUADCX2ADC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHAAQCkFAQYD94GpCDTFAAbDBAQApCEFbD94CUADCDTADCffffI0eCBYD/s1JJBhJJJJBBH5AQCkFAQYD94GpCDTFA5bDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHIAQCkFAQYD94GpCDTFAIbDBAQApCEFbD94ALCBYD/s1JJBhJJJJBBH8wAQCkFAQYD94GpCDTFA8wbDBAQApCEFbD94jBBBBHrDNADAO9NMBARARnH8sAACWFH8xAQYDZH8yAQYDXH8zAQYDWH80jBBBBHrINAQCWFABADGSALAhZ+CJJJBCBHHABHxCBHKINCBHpINDNAhAxApFYDBGaCDTGEFYDBGkAhABApC+81JJBFYDBAKFCDTFYDBGcCDTFYDBG8asMBAyAcFrBBGlCV2AyAaFrBBGqFC/Q1JJBFrBBGDAqCV2AlFG8eC/Q1JJBFrBBG8fvCfEgtMBDNA8eC+g1JJBFrBBtMBA8aAk0MEKDNAqAl9HMBAqCUFCfEgCE0MBAeAEFYDBAc9HMEKAAAHCX2FGqAcAaA8fCfEgGkebDLAqAaAcAkebDBAqADA8fgCfEgCB9HbDWAHCEFHHKApCLFGpCX9HMBKAxCXFHxAKCIFGKAS6MBKDNDNAHtMBAAHcAHH8aINAcCWFGljBBBBjBBJzAZAhAcYDBGaCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAcCLFGEYDBGqCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnGYjBBBBjBBJzAZAhAqAaAlYDBGkeGlCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAaAqAkeGxCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnG8lAYA8l9fGpeuDBAEAqAxApebDBAcAaAlApebDBAcCXFHcA8aCUFG8aMBKAQCJEFCBCJ/ABZ1JJJB8aA8xHpAHHcINAQCJEFApYDBCo4C/8zgFGaAaYDBCEFbDBApCXFHpAcCUFGcMBKCBHpCBHcINAQCJEFApFGaYDBHqAaAcbDBAqAcFHcApCLFGpCJ/AB9HMBKCBHpA8xHcINAQCJEFAcYDBCo4C/8zgFGaAaYDBGaCEFbDBA5AaCDTFApbDBAcCXFHcAHApCEFGp9HMBKASAO9rGaCI9uH81DNALtMBCBHpAIHcINAcApbDBAcCLFHcALApCEFGp9HMBKKCBHbA8wCBALZ1JJJBH83AaCo9uHuA81CE4H85CBH86CBHKDNINAAA5AKCDTFYDBCX2FGxiDWG8jA8s9eMEA86A819PMEjffUUH8lDNA85AH9PMBAAA5A85CDTFYDBCX2FiDWjBB/AznH8lKDNA8jA8l9etMBA86Au0MDKDNA83AhAxYDLG87CDTG88FYDBGaFG89rBBA83AhAxYDBGECDTG8+FYDBGzFGNrBBvMBDNA80AzCDTGpFYDBGqtMBA8yA8zApFYDBCITFHpAMAaCX2FG8eCWFHDA8eCLFHXAMAzCX2FG8fCWFHVA8fCLFHWCBHcCEHlDNINDNAIApYDBCDTFYDBGkAasMBAIApCLFYDBCDTFYDBG8aAasMBAMA8aCX2FG8aiDBAMAkCX2FGkiDBG8m+TG8lAWiDBAkCLFiDBGY+TGGnA8fiDBA8m+TG8kA8aCLFiDBAY+TG8jn+TA8lAXiDBAY+TG8pnA8eiDBA8m+TG8nA8jn+TnA8jAViDBAkCWFiDBGY+TGinAGA8aCWFiDBAY+TG8mn+TA8jADiDBAY+TGYnA8pA8mn+TnA8mA8knAiA8ln+TA8mA8nnAYA8ln+TnmmjBBBB9dMDKApCWFHpAcCEFGcAq6HlAqAc9HMBKKAlCEgtMBA85CEFH85XEKAxCWFHqAZAaC8s2FGpAZAzC8s2FGciDBApiDBmuDBApAciDLApiDLmuDLApAciDWApiDWmuDWApAciDXApiDXmuDXApAciDZApiDZmuDZApAciDcApiDcmuDcApAciDkApiDkmuDkApAciD3ApiD3muD3ApAciDAApiDAmuDAApAciD8kApiD8kmuD8kApAciDYApiDYmuDYDNDNDNDNAyAEFGcrBBC9+FpDEBDKAEHpINAIApCDTGpFAabDBAoApFYDBGpAE9HMBXIKKAoA88FYDBHpAoA8+FYDBHEAIA8+FA87bDBApH87KAIAECDTFA87bDBKANCE86BBA89CE86BBAqiDBG8lArArA8l9deHrAbCEFHbCECDAcrBBCEseA86FH86KAKCEFGKAH9HMBKKAbtMBDNALtMBCBHcAeHpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBAeAqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKCBHcA3HpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBA3AqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKKCBHDABHpCBHkINDNAIApYDBCDTFYDBGcAIApCLFYDBCDTFYDBGasMBAcAIApCWFYDBCDTFYDBGqsMBAaAqsMBABADCDTFG8aAcbDBA8aCLFAabDBA8aCWFAqbDBADCIFHDKApCXFHpAkCIFGkAS9PMDXBKKASHDXDKADAO0MBKKDNAdtMBAdAr+RuDBKAQYD94GpCDTAQCkFFC98FHhDNINAptMEAhYDBCBYD/w1JJBh+BJJJBBAhC98FHhApCUFHpXBKKAQCJ/BBF8kJJJJBADK/PLEOUABYDBCBAICDTZ1JJJB8aADCI9uHVDNADtMBABYDBHODNALtMBAEHRADHWINAOALARYDBCDTFYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBXDKKAEHRADHWINAOARYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBKKDNAItMBABYDBHRABYDLHWCBHdAIHOINAWAdbDBAWCLFHWARYDBAdFHdARCLFHRAOCUFGOMBKKDNADCI6MBAVCEAVCE0eHQABYDLHVABYDWHRINAECWFYDBHWAECLFYDBHdAEYDBHODNALtMBALAWCDTFYDBHWALAdCDTFYDBHdALAOCDTFYDBHOKARAVAOCDTFGDYDBCITFAdbDBARADYDBCITFAWbDLADADYDBCEFbDBARAVAdCDTFGDYDBCITFAWbDBARADYDBCITFAObDLADADYDBCEFbDBARAVAWCDTFGWYDBCITFAObDBARAWYDBCITFAdbDLAWAWYDBCEFbDBAECXFHEAQCUFGQMBKKDNAItMBABYDLHRABYDBHWINARARYDBAWYDB9rbDBAWCLFHWARCLFHRAICUFGIMBKKK+3LDOUV998jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNADtMBAICD4HVDNABtMBAVCDTHOCBHRAEHWINABARCX2FGIAEARAV2CDTFGdiDBuDBAIAdiDLuDLAIAdiDWuDWCBHIINALCZFAIFGdAWAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAWAOFHWARCEFGRAD9HMBXDKKAVCDTHRCBHWINCBHIINALCZFAIFGdAEAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAEARFHEAWCEFGWAD9HMBKKALiDBALiDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function r(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var A=p.charCodeAt(h);g[h]=A>96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}for(var x=0,h=0;h<p.length;++h)g[x++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,x)}function o(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g){var h=n.exports.sbrk,A=h(p.length*4),x=h(g*4),C=new Uint8Array(n.exports.memory.buffer),T=s(p);C.set(T,A);var E=n.exports.meshopt_optimizeVertexFetchRemap(x,A,p.length,g);C=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(g);new Uint8Array(S.buffer).set(C.subarray(x,x+g*4)),T.set(C.subarray(A,A+p.length*4)),h(A-h(0));for(var w=0;w<p.length;++w)p[w]=S[p[w]];return[S,E]}function c(p){for(var g=0,h=0;h<p.length;++h){var A=p[h];g=g<A?A:g}return g}function u(p,g,h,A,x,C,T,E,S){var w=n.exports.sbrk,D=w(4),R=w(h*4),O=w(x*C),L=w(h*4),N=new Uint8Array(n.exports.memory.buffer);N.set(s(A),O),N.set(s(g),L);var _=p(R,L,h,O,x,C,T,E,S,D);N=new Uint8Array(n.exports.memory.buffer);var b=new Uint32Array(_);s(b).set(N.subarray(R,R+_*4));var v=new Float32Array(1);return s(v).set(N.subarray(D,D+4)),w(D-w(0)),[b,v[0]]}function f(p,g,h,A){var x=n.exports.sbrk,C=x(h*A),T=new Uint8Array(n.exports.memory.buffer);T.set(s(g),C);var E=p(C,h,A);return x(C-x(0)),E}var d={LockBorder:1};return{ready:i,supported:!0,compactMesh:function(p){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0);var g=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return a(g,c(p)+1)},simplify:function(p,g,h,A,x,C){o(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),o(p.length%3==0),o(g instanceof Float32Array),o(g.length%h==0),o(h>=3),o(A%3==0);for(var T=0,E=0;E<(C?C.length:0);++E)T|=d[C[E]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),w=u(n.exports.meshopt_simplify,S,p.length,g,g.length,h*4,A,x,T);return w[0]=p instanceof Uint32Array?w[0]:new p.constructor(w[0]),w},getScale:function(p,g){return o(p instanceof Float32Array),o(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length,g*4)}}}();function x0(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,h,A;if(ii(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,A=y(C.filter,"NONE")}let x=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=A,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=x,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(x0.prototype=Object.create(ir.prototype),x0.prototype.constructor=x0);Object.defineProperties(x0.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function NBe(e){try{let t=FBe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);Gee.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=wt.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}x0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=NBe(this),this._promise)};function FBe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}x0.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var JS=x0;function Na(){}Na._maxDecodingConcurrency=Math.max(jt.hardwareConcurrency-1,1);Na._decoderTaskProcessor=void 0;Na._taskProcessorReady=!1;Na._getDecoderTaskProcessor=function(){if(!l(Na._decoderTaskProcessor)){let e=new pi("decodeDraco",Na._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Na._taskProcessorReady=!0}),Na._decoderTaskProcessor=e}return Na._decoderTaskProcessor};Na.decodePointCloud=function(e){let t=Na._getDecoderTaskProcessor();if(Na._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Na.decodeBufferView=function(e){let t=Na._getDecoderTaskProcessor();if(Na._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var z_=Na;function H_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=wt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(H_.prototype=Object.create(ir.prototype),H_.prototype.constructor=H_);Object.defineProperties(H_.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function UBe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=wt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Wee(e,n)}}H_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=UBe(this),this._promise)};function Wee(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function VBe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=wt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}H_.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.PROCESSING||(l(this._dracoError)&&Wee(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,r=t.bufferView,o=i[r],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:o,compressedAttributes:s,dequantizeInShader:!0},c=z_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=VBe(this,c)};H_.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var ZS=H_;function kBe(e){let t=e.uint8Array,n=e.format,i=e.request,r=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new ve({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var OC=kBe;function Zh(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(Zh.prototype=Object.create(ir.prototype),Zh.prototype.constructor=Zh);Object.defineProperties(Zh.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Zh.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=zBe(this),this._promise):(this._promise=HBe(this),this._promise)};function jee(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function zBe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await WBe(i);if(e.isDestroyed())return;let o=jee(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(n){return e.isDestroyed()?void 0:Yee(e,n,"Failed to load embedded image")}}async function HBe(e){e._state=wt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await YBe(i);if(e.isDestroyed())return;let o=jee(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=wt.READY,e}catch(r){return e.isDestroyed()?void 0:Yee(e,r,`Failed to load image: ${n}`)}}function Yee(e,t,n){return e.unload(),e._state=wt.FAILED,Promise.reject(e.getError(n,t))}function GBe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function WBe(e){let t=GBe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Dl(n)}return Zh._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var jBe=/(^data:image\/ktx2)|(\.ktx2$)/i;function YBe(e){let t=e.getUrlComponent(!1,!0);return jBe.test(t)?Dl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Zh.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Zh._loadImageFromTypedArray=OC;var QS=Zh;var qBe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Fa=Object.freeze(qBe);function G_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(G_.prototype=Object.create(ir.prototype),G_.prototype.constructor=G_);Object.defineProperties(G_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var XBe=new S5;G_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=KBe(this),this._promise):(this._promise=JBe(this),this._promise)};async function KBe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=wt.LOADED,e)}catch(n){if(e.isDestroyed())return;b5(e,n)}}async function JBe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=wt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=ZBe(e,a),e._state=wt.PROCESSING,e}catch(s){if(e.isDestroyed())return;b5(e,s)}}function ZBe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=Ue.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,$("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function b5(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function S5(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}S5.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};S5.prototype.execute=function(){this.buffer=qee(this.typedArray,this.indexDatatype,this.context)};function qee(e,t,n){let i=ht.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}G_.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(r){b5(this,r)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let r=XBe;if(r.set(t,n,e.context),!e.jobScheduler.execute(r,Fa.BUFFER))return!1;i=r.buffer}else this._loadBuffer&&(i=qee(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=wt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};G_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var $S=G_;function QBe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ys=QBe;function $Be(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var To=$Be;function qt(){}qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?qt.objectLegacy(i,n):qt.object(i,n)};qt.accessor=function(e,t){return qt.topLevel(e,"accessors",t)};qt.accessorWithSemantic=function(e,t,n){let i={};return qt.mesh(e,function(r){return qt.meshPrimitive(r,function(o){let s=qt.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:qt.meshPrimitiveTarget(o,function(a){return qt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};qt.accessorContainingVertexAttributeData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(r){let o=qt.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:qt.meshPrimitiveTarget(r,function(s){return qt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};qt.accessorContainingIndexData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};qt.animation=function(e,t){return qt.topLevel(e,"animations",t)};qt.animationChannel=function(e,t){let n=e.channels;return qt.object(n,t)};qt.animationSampler=function(e,t){let n=e.samplers;return qt.object(n,t)};qt.buffer=function(e,t){return qt.topLevel(e,"buffers",t)};qt.bufferView=function(e,t){return qt.topLevel(e,"bufferViews",t)};qt.camera=function(e,t){return qt.topLevel(e,"cameras",t)};qt.image=function(e,t){return qt.topLevel(e,"images",t)};qt.material=function(e,t){return qt.topLevel(e,"materials",t)};qt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};qt.mesh=function(e,t){return qt.topLevel(e,"meshes",t)};qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};qt.node=function(e,t){return qt.topLevel(e,"nodes",t)};qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=qt.nodeInTree(e,u,n),l(c)))return c}}}};qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return qt.nodeInTree(e,i,n)};qt.program=function(e,t){return To(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.programs,t):qt.topLevel(e,"programs",t)};qt.sampler=function(e,t){return qt.topLevel(e,"samplers",t)};qt.scene=function(e,t){return qt.topLevel(e,"scenes",t)};qt.shader=function(e,t){return To(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.shaders,t):qt.topLevel(e,"shaders",t)};qt.skin=function(e,t){return qt.topLevel(e,"skins",t)};qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};qt.technique=function(e,t){return To(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.techniques,t):qt.topLevel(e,"techniques",t)};qt.texture=function(e,t){return qt.topLevel(e,"textures",t)};var Re=qt;function eLe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ku=eLe;function tLe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*ku(t.type)}var Hl=tLe;function nLe(e){Re.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Re.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=ys(e.materials,r)}})}),Re.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=y(i.normalized,!1),l(r)){let o=e.bufferViews[r];o.byteStride=Hl(e,i),o.target=te.ARRAY_BUFFER}}),Re.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Re.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),r.transparent=y(r.transparent,!1),r.doubleSided=y(r.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let o=i.KHR_techniques_webgl;l(o)&&Re.materialValue(n,function(c){l(c.index)&&C0(c)}),C0(n.emissiveTexture),C0(n.normalTexture),C0(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),C0(s.baseColorTexture),C0(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),C0(a.specularGlossinessTexture))}),Re.animation(e,function(n){Re.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=iLe(e);return Re.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Re.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function iLe(e){let t={};return Re.animation(e,function(n){Re.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function C0(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var fB=nLe;function rLe(e){return Re.shader(e,function(t){dB(t)}),Re.buffer(e,function(t){dB(t)}),Re.image(e,function(t){dB(t)}),dB(e),e}function dB(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var T0=rLe;function oLe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var mB=oLe;function sLe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),mB(e,t),n.length===0&&delete e.extensionsUsed}}var RC=sLe;var aLe=4;function cLe(e){if(ym(e)!=="glTF")throw new de("File is not valid binary glTF");let n=Xee(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?lLe(e,n):uLe(e,n)}function Xee(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*aLe,!0);return r}function lLe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new de("Binary glTF scene format is not JSON");let o=20,s=o+i,a=Ul(e,o,i),c=JSON.parse(a);T0(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return RC(c,"KHR_binary_glTF"),c}function uLe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Xee(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Ul(u);r=JSON.parse(f),T0(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var hB=cLe;function fLe(e){return Re.shader(e,function(t){pB(t)}),Re.buffer(e,function(t){pB(t)}),Re.image(e,function(t){pB(t)}),pB(e),e}function pB(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var _B=fLe;function dLe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ys(n,t,!0)}var Kf=dLe;function mLe(e){switch(e){case X.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case X.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case X.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case X.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case X.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case X.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case X.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var W_=mLe;function hLe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ku(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=Hl(e,t),h=t.byteOffset+c.byteOffset+d.byteOffset,A=t.componentType,x=X.getSizeInBytes(A),C=new DataView(d.buffer),T=new Array(o),E=W_(A);for(let S=0;S<p;S++){E(C,h,o,x,T);for(let w=0;w<o;w++){let D=T[w];s[w]=Math.min(s[w],D),a[w]=Math.max(a[w],D)}h+=g}return{min:s,max:a}}var MC=hLe;var pLe=[te.FUNC_ADD,te.FUNC_ADD],_Le=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Kee(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var gLe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function yLe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(gLe.indexOf(e[n])===-1)return t;return e}function ALe(e){let t={},n={},i=e.techniques;return l(i)&&(Re.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(Kee(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:y(c.blendEquationSeparate,pLe),blendFactors:yLe(c.blendFuncSeparate,_Le)})}Kee(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Kf(e,"KHR_blend")),Re.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Re.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var gB=ALe;function xLe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ys(n,t,!0),Kf(e,t)}var yB=xLe;function CLe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Re.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Re.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Re.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=ys(o.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=ys(o.shaders,h,!0),u.program=ys(o.programs,p),r[a.program]=u.program}i[c]=ys(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Kf(e,"KHR_techniques_webgl"),yB(e,"KHR_techniques_webgl"))}return Re.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Re.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var AB=CLe;function TLe(e,t){vl.typeOf.object("material",e),vl.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,o=t(r.index,r);if(l(o))return o}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,o=t(r.index,r);if(l(o))return o}}if(l(e.extensions)){let r=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let s=r.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(r.specularGlossinessTexture)){let s=r.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let o=e.extensions.KHR_materials_common;if(l(o)&&l(o.values)){let s=o.values.diffuse,a=o.values.ambient,c=o.values.emission,u=o.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Re.materialValue(e,function(r){if(l(r.index)){let o=t(r.index,r);if(l(o))return o}});if(l(i))return i;if(l(e.emissiveTexture)){let r=e.emissiveTexture,o=t(r.index,r);if(l(o))return o}if(l(e.normalTexture)){let r=e.normalTexture,o=t(r.index,r);if(l(o))return o}if(l(e.occlusionTexture)){let r=e.occlusionTexture,o=t(r.index,r);if(l(o))return o}}var ev=TLe;var Jee=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function ELe(e,t){return t=y(t,Jee),Jee.forEach(function(n){t.indexOf(n)>-1&&SLe(e,n)}),e}var bLe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function SLe(e,t){let n=bLe[t],i=e[n];if(l(i)){let r=0,o=xm[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Am[t](e,a-r),r++)}}function Am(){}Am.accessor=function(e,t){e.accessors.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){Re.meshPrimitiveAttribute(r,function(s,a){s>t&&r.attributes[a]--}),Re.meshPrimitiveTarget(r,function(s){Re.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let o=r.indices;l(o)&&o>t&&r.indices--})}),Re.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Re.animation(e,function(i){Re.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Am.buffer=function(e,t){e.buffers.splice(t,1),Re.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Am.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Re.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),To(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),To(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(To(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Am.image=function(e,t){e.images.splice(t,1),Re.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Am.mesh=function(e,t){e.meshes.splice(t,1),Re.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Am.node=function(e,t){e.nodes.splice(t,1),Re.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Re.animation(e,function(i){Re.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Re.technique(e,function(i){Re.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Re.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Re.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Am.material=function(e,t){e.materials.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Am.sampler=function(e,t){e.samplers.splice(t,1),Re.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Am.texture=function(e,t){if(e.textures.splice(t,1),Re.material(e,function(i){ev(i,function(r,o){o.index>t&&--o.index})}),To(e,"EXT_feature_metadata")){Re.mesh(e,function(o){Re.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(To(e,"EXT_mesh_features")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),To(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function xm(){}xm.accessor=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Re.meshPrimitiveTarget(i,function(o){Re.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Re.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Re.animation(e,function(n){Re.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),To(e,"EXT_mesh_gpu_instancing")&&Re.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),t};xm.buffer=function(e){let t={};return Re.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};xm.bufferView=function(e){let t={};if(Re.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),To(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),To(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(To(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};xm.image=function(e){let t={};return Re.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};xm.mesh=function(e){let t={};return Re.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Zee(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!Zee(e,r,n)}).length===0}xm.node=function(e){let t={};return Re.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Re.skinJoint(n,function(i){t[i]=!0})}),Re.animation(e,function(n){Re.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Re.technique(e,function(n){Re.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Re.node(e,function(n,i){Zee(e,i,t)||(t[i]=!0)}),t};xm.material=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};xm.texture=function(e){let t={};if(Re.material(e,function(n){ev(n,function(i){t[i]=!0})}),To(e,"EXT_feature_metadata")){Re.mesh(e,function(r){Re.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(To(e,"EXT_mesh_features")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),To(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};xm.sampler=function(e){let t={};return Re.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var xB=ELe;function vLe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:ys(e.buffers,n),byteOffset:0,byteLength:t.length};return ys(e.bufferViews,r)}var CB=vLe;function wLe(e,t){let n=Hl(e,t),i=X.getSizeInBytes(t.componentType),r=ku(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=W_(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let h=0;h<r;++h)s[g*r+h]=d[h];u+=n}return s}var TB=wLe;function DLe(e){let t;return Re.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?EB(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&EB(e,i,X.UNSIGNED_SHORT)}),Re.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?EB(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&EB(e,i,X.UNSIGNED_SHORT)}),e}function EB(e,t,n){let i=X.createTypedArray(n,TB(e,t)),r=new Uint8Array(i.buffer);t.bufferView=CB(e,r),t.componentType=n,t.byteOffset=0}var bB=DLe;function ILe(e,t){return RC(e,t),t==="CESIUM_RTC"&&PLe(e),v5(e,t)}function PLe(e){Re.technique(e,function(t){Re.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function v5(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)v5(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&v5(e[r],t);return i}}var BC=ILe;var SB={.8:NLe,"1.0":iNe,"2.0":void 0};function OLe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(SB,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(SB,i)||(i="1.0"));let r=SB[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=SB[i];return t.keepLegacyExtensions||(sNe(e),aNe(e)),e}function $ee(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function RLe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function MLe(e){let t=e.nodes,n=new m,i=new Ne;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;m.fromArray(a,0,n),Ne.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function BLe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new m,a=new Ne;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let h=0;h<g;++h){let A=f[h];if(A.target.path==="rotation"){let x=d[p[A.sampler].output];if(l(o[x]))continue;o[x]=!0;let C=n[x],T=i[C.bufferView],S=r[T.buffer].extras._pipeline.source,w=S.byteOffset+T.byteOffset+C.byteOffset,D=C.componentType,R=C.count,O=ku(C.type),L=C.count*O,N=X.createArrayBufferView(D,S.buffer,w,L);for(let _=0;_<R;_++){let b=_*O;m.unpack(N,b,s);let v=N[b+3];Ne.fromAxisAngle(s,v,a),Ne.pack(a,N,b)}}}}}}function LLe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function NLe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,$ee(e),RLe(e),MLe(e),BLe(e),LLe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Kf(e,"KHR_materials_common")}}function FLe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function Qee(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function ULe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Qee(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Re.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Re.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Re.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Re.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Re.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Re.mesh(e,function(s){Re.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Re.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Re.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=ys(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Re.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Re.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Re.animation(e,function(s){let a={};s.samplers=Qee(s.samplers,a),Re.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Re.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Re.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Re.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Re.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Re.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function VLe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){delete n.name})})}function kLe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Re.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function zLe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var HLe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function GLe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(HLe[r])&&e.extensionsRequired.push(r)}}}function WLe(e){Re.buffer(e,function(t){delete t.type})}function jLe(e){Re.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function YLe(e){Re.mesh(e,function(t){Re.meshPrimitive(t,function(n){Re.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Re.technique(e,function(t){Re.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var qLe={POSITION:!0,NORMAL:!0,TANGENT:!0},XLe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function KLe(e){let t={};Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=XLe[a];l(f)?(u=f+c,t[o]=u):l(qLe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Re.technique(e,function(n){Re.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function JLe(e){Re.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function w5(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Hl(e,t)}function ZLe(e){Re.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Re.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=w5(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(y(i.byteLength,0),o)}})}function QLe(e){let t,n,i,r=e.bufferViews,o={};Re.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Re.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=w5(e,p),h=p.byteOffset,A=p.count*g;delete p.byteStride;let x=t<d-1,C=x?w5(e,c[t+1]):void 0;if(g!==C){let T=Ye(i,!0);o[a]&&(T.byteStride=g),T.byteOffset+=u,T.byteLength=h+A-u;let E=ys(r,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=E,p.byteOffset=p.byteOffset-u;u=x?c[t+1].byteOffset:void 0,f=t+1}}}xB(e,["accessor","bufferView","buffer"])}function $Le(e){Re.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=MC(e,n);n.min=i.min,n.max=i.max}})}function ete(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||B.fromColumnMajorArray(e.matrix).equals(B.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function tte(e,t){Re.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Re.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),ete(n)&&tte(e,i))}}),delete e.nodes[t]}function eNe(e){return Re.node(e,function(t,n){ete(t)&&tte(e,n)}),e}function tNe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=MC(e,i);i.min=r.min,i.max=r.max}})})}function nNe(e){Re.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=MC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function iNe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",$ee(e),FLe(e),eNe(e),ULe(e),VLe(e),zLe(e),GLe(e),ZLe(e),QLe(e),$Le(e),tNe(e),nNe(e),WLe(e),jLe(e),YLe(e),KLe(e),bB(e),JLe(e),gB(e),AB(e),kLe(e)}var rNe=["u_tex","u_diffuse","u_emission"],oNe=["u_diffuse"];function D5(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function vB(e){return l(e.index)}function wB(e){return Array.isArray(e)&&e.length===4}function nte(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function sNe(e){Re.material(e,function(t){Re.materialValue(t,function(n,i){rNe.indexOf(i)!==-1&&vB(n)?(D5(t),t.pbrMetallicRoughness.baseColorTexture=n):oNe.indexOf(i)!==-1&&wB(n)&&(D5(t),t.pbrMetallicRoughness.baseColorFactor=nte(n))})}),BC(e,"KHR_techniques_webgl"),BC(e,"KHR_blend")}function aNe(e){Re.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(Kf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let r=l(n.values)?n.values:{},o=r.ambient,s=r.diffuse,a=r.emission,c=r.transparency,u=n.doubleSided,f=n.transparent;D5(t),l(o)&&(wB(o)?t.emissiveFactor=o.slice(0,3):vB(o)&&(t.emissiveTexture=o)),l(s)&&(wB(s)?t.pbrMetallicRoughness.baseColorFactor=nte(s):vB(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(wB(a)?t.emissiveFactor=a.slice(0,3):vB(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),BC(e,"KHR_materials_common")}var DB=OLe;var ri={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function cNe(e){switch(e){case ri.POSITION:return"positionMC";case ri.NORMAL:return"normalMC";case ri.TANGENT:return"tangentMC";case ri.TEXCOORD:return"texCoord";case ri.COLOR:return"color";case ri.JOINTS:return"joints";case ri.WEIGHTS:return"weights";case ri.FEATURE_ID:return"featureId"}}ri.hasSetIndex=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return!1;case ri.TEXCOORD:case ri.COLOR:case ri.JOINTS:case ri.WEIGHTS:case ri.FEATURE_ID:return!0}};ri.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ri.POSITION;case"NORMAL":return ri.NORMAL;case"TANGENT":return ri.TANGENT;case"TEXCOORD":return ri.TEXCOORD;case"COLOR":return ri.COLOR;case"JOINTS":return ri.JOINTS;case"WEIGHTS":return ri.WEIGHTS;case"_FEATURE_ID":return ri.FEATURE_ID}};ri.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ri.POSITION;case"RGBA":case"RGB":case"RGB565":return ri.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ri.NORMAL;case"BATCH_ID":return ri.FEATURE_ID}};ri.getGlslType=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return"vec3";case ri.TEXCOORD:return"vec2";case ri.COLOR:return"vec4";case ri.JOINTS:return"ivec4";case ri.WEIGHTS:return"vec4";case ri.FEATURE_ID:return"int"}};ri.getVariableName=function(e,t){let n=cNe(e);return l(t)&&(n+=`_${t}`),n};var bt=Object.freeze(ri);function Ua(){}Ua.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let r=new de(i);return l(n)&&(r.stack=`Original stack: -${n.stack} -Handler stack: -${r.stack}`),r};Ua.getNodeTransform=function(e){return l(e.matrix)?e.matrix:B.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Ne.IDENTITY,l(e.scale)?e.scale:m.ONE)};Ua.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Ua.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Ua.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Ua.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Ua.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=bt.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=ln.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":ln.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var lNe=new m,uNe=new m;Ua.getPositionMinMax=function(e,t,n){let i=Ua.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=m.add(o,t,uNe),r=m.add(r,n,lNe)),{min:o,max:r}};Ua.getAxisCorrectionMatrix=function(e,t,n){return n=B.clone(B.IDENTITY,n),e===hr.Y?n=B.clone(hr.Y_UP_TO_Z_UP,n):e===hr.X&&(n=B.clone(hr.X_UP_TO_Z_UP,n)),t===hr.Z&&(n=B.multiplyTransformation(n,hr.Z_UP_TO_X_UP,n)),n};var fNe=new Z;Ua.getCullFace=function(e,t){if(!Le.isTriangles(t))return gi.BACK;let n=B.getMatrix3(e,fNe);return Z.determinant(n)<0?gi.FRONT:gi.BACK};Ua.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Ua.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Ua.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Ua.supportedExtensions[i])throw new de(`Unsupported glTF Extension: ${i}`)}};var en=Ua;function j_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,r=e.typedArray,o=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=r,this._gltfJson=o,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(j_.prototype=Object.create(ir.prototype),j_.prototype.constructor=j_);Object.defineProperties(j_.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});j_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,l(this._gltfJson)?(this._promise=ite(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=rte(this,this._typedArray),this._promise):(this._promise=dNe(this),this._promise))};async function dNe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;I5(e,n)}return rte(e,t)}function I5(e,t){e.unload(),e._state=wt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function mNe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!To(t,"KHR_techniques_webgl")&&!To(t,"KHR_materials_common"))return Promise.resolve();let n=[];Re.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),DB(t)}function hNe(e){let t=[];return Re.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&u_(i)&&(delete n.uri,t.push(ve.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function pNe(e,t){let n=[];return Re.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function ite(e,t){try{T0(t),await hNe(t),await mNe(e,t),fB(t),await pNe(e,t),_B(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new de(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&en.checkSupportedExtensions(i),e._gltf=t,e._state=wt.READY,e}catch(n){if(e.isDestroyed())return;I5(e,n)}}async function rte(e,t){let n;try{ym(t)==="glTF"?n=hB(t):n=Mr(t)}catch(i){if(e.isDestroyed())return;I5(e,i)}return ite(e,n)}j_.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};j_.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var tv=j_;var _Ne={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Qh=Object.freeze(_Ne);var Hr={};function gNe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function yNe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function ANe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function xNe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function CNe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function TNe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function ENe(){this.attributes=[]}function bNe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function SNe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function vNe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function wNe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function DNe(){this.nodes=[]}var INe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function PNe(){this.input=[],this.interpolation=void 0,this.output=[]}function ONe(){this.node=void 0,this.path=void 0}function RNe(){this.sampler=void 0,this.target=void 0}function MNe(){this.name=void 0,this.samplers=[],this.channels=[]}function BNe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function LNe(){this.name=void 0,this.stages=[]}function ote(){this.credits=[]}function NNe(){this.asset=new ote,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=B.clone(B.IDENTITY)}function FNe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.channels=void 0}function Y_(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(Y_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Y_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Y_.DEFAULT_ROUGHNESS_FACTOR}Y_.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;Y_.DEFAULT_METALLIC_FACTOR=1;Y_.DEFAULT_ROUGHNESS_FACTOR=1;function E0(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(E0.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(E0.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=E0.DEFAULT_GLOSSINESS_FACTOR}E0.DEFAULT_DIFFUSE_FACTOR=oe.ONE;E0.DEFAULT_SPECULAR_FACTOR=m.ONE;E0.DEFAULT_GLOSSINESS_FACTOR=1;function P5(){this.metallicRoughness=new Y_,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(P5.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Qh.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}P5.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Hr.Quantization=gNe;Hr.Attribute=yNe;Hr.Indices=ANe;Hr.FeatureIdAttribute=xNe;Hr.FeatureIdTexture=TNe;Hr.FeatureIdImplicitRange=CNe;Hr.MorphTarget=ENe;Hr.Primitive=bNe;Hr.Instances=SNe;Hr.Skin=vNe;Hr.Node=wNe;Hr.Scene=DNe;Hr.AnimatedPropertyType=Object.freeze(INe);Hr.AnimationSampler=PNe;Hr.AnimationTarget=ONe;Hr.AnimationChannel=RNe;Hr.Animation=MNe;Hr.ArticulationStage=BNe;Hr.Articulation=LNe;Hr.Asset=ote;Hr.Components=NNe;Hr.TextureReader=FNe;Hr.MetallicRoughness=Y_;Hr.SpecularGlossiness=E0;Hr.Material=P5;var Nt=Hr;var IB={};IB.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};IB.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=y(e.compressedTextureNoMipmap,!1),r=Pn.REPEAT,o=Pn.REPEAT,s=un.LINEAR,a=bi.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let g=t.samplers[f];r=y(g.wrapS,r),o=y(g.wrapT,o),s=y(g.minFilter,s),a=y(g.magFilter,a)}let d=!1,p=n.extensions;return l(p)&&l(p.KHR_texture_transform)&&(d=!0),(i||d)&&s!==un.LINEAR&&s!==un.NEAREST&&(s===un.NEAREST_MIPMAP_NEAREST||s===un.NEAREST_MIPMAP_LINEAR?s=un.NEAREST:s=un.LINEAR),new mn({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var UNe=new H(1,1);IB.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,r=y(t.texCoord,0),o,s=y(t.extensions,y.EMPTY_OBJECT).KHR_texture_transform;if(l(s)){r=y(s.texCoord,r);let c=l(s.offset)?H.unpack(s.offset):H.ZERO,u=y(s.rotation,0),f=l(s.scale)?H.unpack(s.scale):UNe;u=-u,o=new Z(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new Nt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=r,a.transform=o,a.channels=n,a};var Gl=IB;function VNe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var b0=VNe;function q_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=Gl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=r,this._baseResource=o,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(q_.prototype=Object.create(ir.prototype),q_.prototype.constructor=q_);Object.defineProperties(q_.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var kNe=new O5;async function zNe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=wt.LOADED,e)}catch(n){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let i="Failed to load texture";throw e.getError(i,n)}}q_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=zNe(this),this._promise)};function O5(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}O5.prototype.set=function(e,t,n,i,r){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=r};O5.prototype.execute=function(){this.texture=ste(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function ste(e,t,n,i,r){let o=n.internalFormat,s=!1;ct.isCompressedFormat(o)&&!l(i)&&(s=!0);let a=Gl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,u=a.wrapS,f=a.wrapT,d=c===un.NEAREST_MIPMAP_NEAREST||c===un.NEAREST_MIPMAP_LINEAR||c===un.LINEAR_MIPMAP_NEAREST||c===un.LINEAR_MIPMAP_LINEAR,p=!l(o)&&d,g=p||u===Pn.REPEAT||u===Pn.MIRRORED_REPEAT||f===Pn.REPEAT||f===Pn.MIRRORED_REPEAT,h=!P.isPowerOfTwo(n.width)||!P.isPowerOfTwo(n.height),A=g&&h,x;return l(o)?(!r.webgl2&&ct.isCompressedFormat(o)&&h&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),x=Bt.create({context:r,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(A&&(n=b0(n)),x=Bt.create({context:r,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&x.generateMipmap(),x}q_.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=wt.PROCESSING;let t;if(this._asynchronous){let n=kNe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Fa.TEXTURE))return;t=n.texture}else t=ste(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=wt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};q_.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var nv=q_;function X_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,r=e.baseResource,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=r,this._gltf=n,this._bufferViewId=o,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(X_.prototype=Object.create(ir.prototype),X_.prototype.constructor=X_);Object.defineProperties(X_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function HNe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}X_.prototype.load=async function(){return l(this._promise)?this._promise:HNe(this._draco,this._attributeSemantic)?(this._promise=WNe(this),this._promise):(this._promise=YNe(this),this._promise)};function GNe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Nt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=ln.VEC2,a.normalizationRange=o;else{let c=ln.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function WNe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=wt.LOADED,e)}catch{if(e.isDestroyed())return;R5(e)}}function jNe(e){e._state=wt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=GNe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function YNe(e){e._state=wt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=wt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;R5(e,n)}}function R5(e,t){e.unload(),e._state=wt.FAILED;let n="Failed to load vertex buffer";throw e.getError(n,t)}function M5(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}M5.prototype.set=function(e,t){this.typedArray=e,this.context=t};M5.prototype.execute=function(){this.buffer=ate(this.typedArray,this.context)};function ate(e,t){let n=ht.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var qNe=new M5;X_.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED&&this._state!==wt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){R5(this,i)}jNe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=qNe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Fa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=ate(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=wt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};X_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var iv=X_;function rv(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}rv.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=A0.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new rv({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(rv.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});rv.BATCH_TABLE_CLASS_NAME="_batchTable";var Cm=rv;function PB(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}PB.fromJson=function(e){return new PB({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(PB.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var OB=PB;function RB(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=y(e.valueType,on.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}RB.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(r){return OB.fromJson(r)});return new RB({id:t,values:i,valueType:on[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(RB.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var MB=RB;function BB(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}BB.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=MB.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Cm.fromJson({id:i,class:e.classes[i],enums:t}));return new BB({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(BB.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Tm=BB;function S0(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Tm.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(S0.prototype=Object.create(ir.prototype),S0.prototype.constructor=S0);Object.defineProperties(S0.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});S0.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=XNe(this),this._promise)};async function XNe(e){let t=e._resource;e._state=wt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Tm.fromJson(n),e._state=wt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=wt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}S0.prototype.unload=function(){this._schema=void 0};var ov=S0;var Jf={};function sv(e){return l_(e.url)}function LB(e){let t=e.byteOffset,n=e.byteLength;if(ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function KNe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,r=e.type,o=e.count;return`${n}-${i}-${r}-${o}`}function cte(e){return sv(e)}function lte(e,t){return`${sv(e)}-buffer-id-${t}`}function av(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return cte(r)}return lte(n,t)}function B5(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=av(a,s,n,i),u=LB(o);return`${c}-range-${u}`}function ute(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return sv(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=av(u,c,n,i),d=LB(a);return`${f}-range-${d}`}function JNe(e,t){let n=Gl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Jf.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${sv(n)}`};Jf.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${cte(t)}`};Jf.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${lte(t,n)}`};Jf.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${sv(t)}`};Jf.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s];ii(o,"EXT_meshopt_compression")&&(s=o.extensions.EXT_meshopt_compression.buffer);let c=av(a,s,i,r),u=LB(o);return`buffer-view:${c}-range-${u}`};Jf.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;return`draco:${B5(t,n,i,r)}`};Jf.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=y(e.dequantize,!1),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${r.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${B5(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[o],g=p.buffer,h=t.buffers[g],A=av(h,g,n,i),x=LB(p);return`vertex-buffer:${A}-range-${x}${d}`};Jf.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.loadBuffer,!1),c=y(e.loadTypedArray,!1),u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${B5(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,h=t.buffers[g],A=av(h,g,i,r),x=KNe(f,p);return`index-buffer:${A}-accessor-${x}${u}`};Jf.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;return`image:${ute(t,n,i,r)}`};Jf.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=n.index,c=Gl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=ute(t,c,i,r),f=JNe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Wl=Jf;function cv(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}cv.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};cv.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};cv.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};cv.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var NB=cv;function Nn(){}Nn.cacheEntries={};Nn.statistics=new NB;function ZNe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new ZNe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=Wl.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new ov({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,r=Wl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new PC({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource,n=Wl.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new PC({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=e.gltfJson,o=Wl.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new tv({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=Wl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new JS({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource,o=Wl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new ZS({resourceCache:Nn,gltf:t,draco:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.frameState,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=y(e.asynchronous,!0),f=y(e.dequantize,!1),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1),g=Wl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),h=Nn.get(g);return l(h)?h:(h=new iv({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:u,dequantize:f,loadBuffer:d,loadTypedArray:p}),Nn.add(h))};Nn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.frameState,s=e.draco,a=y(e.asynchronous,!0),c=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),f=Wl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:c,loadTypedArray:u}),d=Nn.get(f);return l(d)?d:(d=new $S({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Nn.add(d))};Nn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource,o=Wl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new QS({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=y(e.asynchronous,!0),c=Wl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new nv({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[iv,$S,ZS,nv,QS,JS,PC,ov,tv],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Fi=Nn;function ks(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ks.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ks.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ks.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ks.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ks.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ks.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ks.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ks.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ks.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Yo.OCTREE&&(t=3),e>>t};ks.fromSubtreeJson=async function(e,t,n,i,r){let o=new ks(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=QNe(n);let a=s.json;o._subtreeJson=a;let c;if(ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let E=0;E<T;E++){let S=a.contentMetadata[E];u.push(a.propertyTables[S])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let T=p.class,E=d.classes[T];f=new cB({subtreeMetadata:p,class:E})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ii(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let h=$Ne(a.buffers),A=eFe(a.bufferViews,h);tFe(a,A),l(c)&&fte(c,A);for(let T=0;T<u.length;T++){let E=u[T];fte(E,A)}let x=await nFe(o,h,s.binary),C=rFe(A,x);return oFe(o,a,i,C),l(c)&&(sFe(o,i,C),cFe(o)),aFe(o,i,C),lFe(o),o._ready=!0,o};function QNe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Mr(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function $Ne(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function eFe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function tFe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function fte(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=y(o.values,o.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(o.stringOffsets,o.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(o.arrayOffsets,o.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function nFe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=iFe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function iFe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Fi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function rFe(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function oFe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=ii(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=L5(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=L5(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=L5(t.childSubtreeAvailability,i,a)}function L5(e,t,n,i){if(l(e.constant))return new qS({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new qS({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function sFe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new zl({class:a,count:r,properties:i.properties,bufferViews:n})}function aFe(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new zl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function dte(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function cFe(e){let t=dte(e._tileAvailability);e._tileJumpBuffer=t}function lFe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=dte(r);t.push(o)}}ks.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new de("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ks.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new de("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function uFe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function fFe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}ks.prototype.getTileMetadataView=function(e){let t=uFe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new XS({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ks.prototype.getContentMetadataView=function(e,t){let n=fFe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new XS({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};ks.prototype.isDestroyed=function(){return!1};ks.prototype.destroy=function(){return l(this._bufferLoader)&&Fi.unload(this._bufferLoader),ue(this)};var LC=ks;var dFe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},NC=Object.freeze(dFe);function mFe(e){return{tile:{boundingVolume:mte("TILE",e),minimumHeight:hte("TILE",e),maximumHeight:pte("TILE",e)},content:{boundingVolume:mte("CONTENT",e),minimumHeight:hte("CONTENT",e),maximumHeight:pte("CONTENT",e)}}}function mte(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}}function hte(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function pte(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}var FB=mFe;function el(e,t,n){let i=t.implicitTileset,r=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let o=r.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o});this._url=s.getUrlComponent(!0),this._ready=!1,this._readyPromise=void 0}Object.defineProperties(el.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Implicit3DTileContent.readyPromise","Implicit3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Implicit3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});el.fromSubtreeJson=async function(e,t,n,i,r,o){o=y(o,0);let s;l(r)&&(s=new Uint8Array(r,o));let a=t.implicitTileset,c=t.implicitCoordinates,u=await LC.fromSubtreeJson(n,i,s,a,c),f=new el(e,t,n);return f._implicitSubtree=u,hFe(f,u),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function hFe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=_Fe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=pFe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=SFe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function pFe(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function _Fe(e,t,n,i){let s=_te(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let h=0;h<g;h++){let A=p+h;if(!t.tileIsAvailableAtIndex(A)){u.push(void 0);continue}let x=t.getParentMortonIndex(h),C=c[x],T=h%f.branchingFactor,E=_te(e,t,C,T,A);C.children.push(E),a.numberOfTilesTotal++,u.push(E)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function gte(e,t,n){let i=NC.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function _te(e,t,n,i,r,o){let s=e._implicitTileset,a;y(o,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=FB(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){g=!0;break}let h=AFe(s,a,i,o,n,u),A=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(r,D))continue;let L={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},N=xFe(h,f);l(N)&&(L.boundingVolume=N),A.push(gt(L,s.contentHeaders[D]))}let x=gte(c,s,a),C={boundingVolume:h,geometricError:x,refine:s.refine,contents:A},T=!0,E=Ye(s.tileHeader,T);delete E.boundingVolume,delete E.transform;let S=gt(C,E,T),w=Tte(e,s.baseResource,S,n);return w.implicitCoordinates=a,w.implicitSubtree=t,w.metadata=c,w.hasImplicitContentMetadata=g,w}function UB(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function F5(e,t){l(t)&&(ii(e,"3DTILES_bounding_volume_S2")?yFe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&gFe(e.region,t.minimumHeight,t.maximumHeight))}function gFe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function yFe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function AFe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!UB(o.boundingVolume,o)&&UB(e.boundingVolume,o)?s=yte(e,t,n,y(i,!1),r):s=o.boundingVolume,F5(s,o),s}function xFe(e,t){let n;return l(t)&&(n=t.boundingVolume),UB(n,t)?F5(n,t):UB(e,t)&&(n=Ye(e,!0),F5(n,t)),n}function yte(e,t,n,i,r){let o=e.boundingVolume;return ii(o,"3DTILES_bounding_volume_S2")?Ate(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:Cte(o.region,t.level,t.x,t.y,t.z)}:{box:xte(o.box,t.level,t.x,t.y,t.z)}}function Ate(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:V_.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?YS.encode2D(i,r,o):YS.encode2D(i,o,r),f=V_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:V_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var CFe=new m,TFe=new m,N5=new m,EFe=new Z;function xte(e,t,n,i,r){if(t===0)return e;let o=m.unpack(e,0,TFe),s=Z.unpack(e,3,EFe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,CFe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=m.fromElements(c,u,f,N5);p=Z.multiplyByVector(s,p,N5),p=m.add(p,o,N5);let g=Z.clone(s);g=Z.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),Z.pack(g,h,3),h}var bFe=new ce;function Cte(e,t,n,i,r){if(t===0)return e.slice();let o=ce.unpack(e,0,bFe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=P.negativePiToPi(o.west+n*u),d=P.negativePiToPi(f+u),p=c*o.height,g=P.negativePiToPi(o.south+i*p),h=P.negativePiToPi(g+p),A=s,x=a;if(l(r)){let C=c*(a-s);A+=r*C,x=A+C}return[f,g,d,h,A,x]}function SFe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=yte(i,r,n,!1,t),s=gte(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Tte(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Tte(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}el.prototype.hasProperty=function(e,t){return!1};el.prototype.getFeature=function(e){};el.prototype.applyDebugSettings=function(e,t){};el.prototype.applyStyle=function(e){};el.prototype.update=function(e,t){};el.prototype.isDestroyed=function(){return!1};el.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};el._deriveBoundingBox=xte;el._deriveBoundingRegion=Cte;el._deriveBoundingVolumeS2=Ate;var lv=el;var vFe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},jl=Object.freeze(vFe);function FC(e,t){this._distance=t,this._normal=new Ete(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(FC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});FC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new FC(e.normal,e.distance),t};FC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new FC(e.normal,e.distance)};function Ete(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Ete.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var UC=FC;function Va(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Dte:Ite,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function Dte(e){return e===tn.OUTSIDE}function Ite(e){return e===tn.INSIDE}Object.defineProperties(Va.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Dte:Ite)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function bte(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Va.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){bte(n,i)},e.index=t,bte(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Va.prototype.get=function(e){return this._planes[e]};function Pte(e,t){let n=e.length;for(let i=0;i<n;++i)if(fn.equals(e[i],t))return i;return-1}Va.prototype.contains=function(e){return Pte(this._planes,e)!==-1};Va.prototype.remove=function(e){let t=this._planes,n=Pte(t,e);if(n===-1)return!1;e instanceof UC&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof UC&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Va.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof UC&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var wFe=new oe,DFe=new oe;function Ste(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=qn.octEncodeToCartesian4(a.normal,DFe);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=oe.packFloat(a.distance,wFe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function vte(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function Ote(e,t){let n=Gt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var IFe=new H;Va.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Va.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Ote(r,IFe);s.y*=2,i?(t=new Bt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:Qe.FLOAT,sampler:mn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Bt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,sampler:mn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(vte(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Ste(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),vte(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),Ste(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var PFe=new B,wte=new fn(m.UNIT_X,0);Va.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=B.multiply(t,r,PFe));let o=tn.INSIDE;!this.unionClippingRegions&&i>0&&(o=tn.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];fn.transform(a,r,wte);let c=e.intersectPlane(wte);if(c===tn.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};Va.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Va.useFloatTexture=function(e){return e.floatingPointTexture};Va.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=Va.useFloatTexture(t)?e.length:e.length*2,o=Ote(r,n);return o.y*=2,o};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var As=Va;var uv={HIGHLIGHT:0,REPLACE:1,MIX:2};uv.getColorBlend=function(e,t){if(e===uv.HIGHLIGHT)return 0;if(e===uv.REPLACE)return 1;if(e===uv.MIX)return P.clamp(t,P.EPSILON4,1)};var Tc=Object.freeze(uv);var OFe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Ec=Object.freeze(OFe);var RFe={STEP:0,LINEAR:1,CUBICSPLINE:2},Em=Object.freeze(RFe);var Rte={};function fv(e){this._count=e.count,this._properties=Ye(e.properties,!0)}fv.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,Rte)};fv.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,Rte,e)};fv.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};fv.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var K_=fv;function ka(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(ka.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});ka.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};ka.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};ka.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};ka.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var U5=[];ka.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(U5)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,U5)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(U5)),t};ka.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};ka.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new K_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};ka.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};ka.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};ka.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};ka.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};ka.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};ka.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};ka.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var tl=ka;function dv(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=Gl.createModelTextureReader({textureInfo:o,channels:LFe(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(dv.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});dv.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===Yt.SCALAR&&n===on.UINT8:Yt.isVectorType(t)||t===Yt.SCALAR?n===on.UINT8:!1};var MFe=[void 0,"float","vec2","vec3","vec4"],BFe=[void 0,"int","ivec2","ivec3","ivec4"];dv.prototype.getGlslType=function(){let e=this._classProperty,t=Yt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?MFe[t]:BFe[t]};dv.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function LFe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var VB=dv;function V5(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new VB({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(V5.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});V5.prototype.getProperty=function(e){return this._properties[e]};var VC=V5;function Mte(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=y(i,n.offset),r=y(r,n.scale),i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Mte.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var kB=Mte;function k5(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new kB({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(k5.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});k5.prototype.getProperty=function(e){return this._properties[e]};var kC=k5;function mv(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(mv.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});mv.prototype.getPropertyTable=function(e){return this._propertyTables[e]};mv.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};mv.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var za=mv;function NFe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new zl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new tl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new VC({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new kC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new za({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var zB=NFe;function FFe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new zl({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new tl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new VC({id:a,propertyTexture:UFe(c),class:n.classes[c.class],textures:e.textures}))}return new za({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function UFe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:VFe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=gt(r.texture,o,!0)}return t}function VFe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var HB=FFe;function J_(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,u=y(e.asynchronous,!0);this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=wt.UNLOADED,this._promise=void 0}l(Object.create)&&(J_.prototype=Object.create(ir.prototype),J_.prototype.constructor=J_);Object.defineProperties(J_.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function kFe(e){try{let t=jFe(e),n=JFe(e),i=ZFe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=wt.LOADED,e)}catch(t){if(e.isDestroyed())return;e.unload(),e._state=wt.FAILED;let n="Failed to load structural metadata";throw e.getError(n,t)}}J_.prototype.load=function(){return l(this._promise)?this._promise:(this._state=wt.LOADING,this._promise=kFe(this),this._promise)};function zFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function HFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function GFe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];zFe(r.properties,n)}return n}function WFe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&HFe(o,n)}}return n}async function jFe(e){let t;l(e._extension)?t=GFe(e._extension):t=WFe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Fi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function YFe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&qFe(o,t)}return t}function qFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function XFe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&KFe(o,t)}}return t}function KFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function JFe(e){let t;l(e._extension)?t=YFe(e._extension):t=XFe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Fi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function ZFe(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Fi.getSchemaLoader({resource:i})}else n=Fi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}J_.prototype.process=function(e){if(this._state===wt.READY)return!0;if(this._state!==wt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let r=this._schemaLoader.schema,o={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);o[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=zB({extension:this._extension,schema:r,bufferViews:o,textures:s}):this._structuralMetadata=HB({extension:this._extensionLegacy,schema:r,bufferViews:o,textures:s}),Bte(this),this._state=wt.READY,!0};function Bte(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function QFe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}J_.prototype.unload=function(){Bte(this),QFe(this),l(this._schemaLoader)&&Fi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var GB=J_;var zC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};zC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return zC.TRANSLATION;case"ROTATION":return zC.ROTATION;case"SCALE":return zC.SCALE;case"_FEATURE_ID":return zC.FEATURE_ID}};var qo=Object.freeze(zC);var $Fe=65534,e2e=255;function WB(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Fte(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],t2e(this)}Object.defineProperties(WB.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function t2e(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),h=d||n.hasEdge(f,c),A=Lte(i,c,u,f,p,g,h);for(;l(A);){let x=s[A];if(!l(x)){x=o+r.length;let C=A;for(;C>=o;)C=r[C-o];r.push(C),s[A]=x}x>$Fe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>e2e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),A===c?(c=x,t[a]=x):A===u?(u=x,t[a+1]=x):(f=x,t[a+2]=x),A=Lte(i,c,u,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Lte(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=z5(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,h=z5(e,n,d,p,g);if(h===0)return n;let A=s?1:0,x=0,C=o?1:0,T=z5(e,i,A,x,C);if(T===0)return i;let E=f&h&T,S,w,D;if(E&1<<0)S=0,w=1,D=2;else if(E&1<<1)S=0,D=1,w=2;else if(E&1<<2)w=0,S=1,D=2;else if(E&1<<3)w=0,D=1,S=2;else if(E&1<<4)D=0,S=1,w=2;else if(E&1<<5)D=0,w=1,S=2;else{let N=H5(f),_=H5(h),b=H5(T);return N<_&&N<b?t:_<b?n:i}let R=t*3;e[R+S]=a,e[R+w]=c,e[R+D]=u;let O=n*3;e[O+S]=d,e[O+w]=p,e[O+D]=g;let L=i*3;e[L+S]=A,e[L+w]=x,e[L+D]=C}function z5(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function H5(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}WB.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};WB.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Gt.maximumTextureSize),i=n,r=Nte(i),o=[];for(;i>1;)i>>=1,o.push(Nte(i));let s=new Bt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:ct.LUMINANCE,sampler:new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR_MIPMAP_LINEAR,magnificationFilter:bi.LINEAR})});return t.outlineTexture=s,s};function Nte(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Fte(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}Fte.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var HC=WB;function Ute(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function n2e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function jB(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}jB.prototype.postProcess=function(e){this.needsOutlines&&(i2e(this),o2e(this,e))};function i2e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new HC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let o=r2e(r.outlineCoordinates),s=new Ute(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function r2e(e){let t=new Nt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=ln.VEC3,t.normalized=!1,t.count=e.length/3,t}function o2e(e,t){s2e(e.attributePlans,t),l(e.indicesPlan)&&a2e(e.indicesPlan,t)}function s2e(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=ht.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function a2e(e,t){let n=e.indices;if(e.loadBuffer){let i=ht.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}jB.AttributeLoadPlan=Ute;jB.IndicesLoadPlan=n2e;var GC=jB;function c2e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var YB=c2e;var l2e=Nt.Attribute,u2e=Nt.Indices,Vte=Nt.FeatureIdAttribute,kte=Nt.FeatureIdTexture,zte=Nt.FeatureIdImplicitRange,f2e=Nt.MorphTarget,d2e=Nt.Primitive,m2e=Nt.Instances,h2e=Nt.Skin,p2e=Nt.Node,_2e=Nt.AnimatedPropertyType,g2e=Nt.AnimationSampler,y2e=Nt.AnimationTarget,A2e=Nt.AnimationChannel,x2e=Nt.Animation,C2e=Nt.ArticulationStage,T2e=Nt.Articulation,E2e=Nt.Asset,b2e=Nt.Scene,S2e=Nt.Components,v2e=Nt.MetallicRoughness,w2e=Nt.SpecularGlossiness,D2e=Nt.Material,Sr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Zf(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=y(e.releaseGltfJson,!1),o=y(e.asynchronous,!0),s=y(e.incrementallyLoadTextures,!0),a=y(e.upAxis,hr.Y),c=y(e.forwardAxis,hr.Z),u=y(e.loadAttributesAsTypedArray,!1),f=y(e.loadAttributesFor2D,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.loadForClassification,!1),h=y(e.renameBatchIdSemantic,!1);n=l(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=h,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Sr.NOT_LOADED,this._textureState=Sr.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Zf.prototype=Object.create(ir.prototype),Zf.prototype.constructor=Zf);Object.defineProperties(Zf.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function I2e(e){e._state=Sr.LOADING,e._textureState=Sr.LOADING;try{let t=Fi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Sr.LOADED,e._textureState=Sr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Sr.FAILED,e._textureState=Sr.FAILED,qB(e,t)}}async function P2e(e,t){jt.supportsWebP.initialized||await jt.supportsWebP.initialize();let n=new YB({webp:jt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,r=w3e(e,i,n,t);return e._state=Sr.PROCESSING,e._textureState=Sr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Fi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),r}Zf.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=I2e(this),this._promise)};function qB(e,t){e.unload();let n="Failed to load glTF";throw e.getError(n,t)}function O2e(e,t){let n,i=!0,r=e._geometryLoaders,o=r.length;for(n=0;n<o;++n){let a=r[n].process(t);a&&l(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(l(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=Sr.POST_PROCESSING)}function R2e(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.postProcess(t),o.needsOutlines&&M2e(e,o)}}function M2e(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes,s=o.length;for(let c=0;c<s;c++){let u=o[c];l(u.buffer)&&n.push(u.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}Zf.prototype._process=function(e){return this._state===Sr.READY?!0:(this._state===Sr.PROCESSING&&O2e(this,e),this._resourcesLoaded&&this._state===Sr.POST_PROCESSING&&(R2e(this,e.context),this._state=Sr.PROCESSED),this._resourcesLoaded&&this._state===Sr.PROCESSED?(Jte(this),this._typedArray=void 0,this._state=Sr.READY,!0):!1)};Zf.prototype._processTextures=function(e){if(this._textureState===Sr.READY)return!0;if(this._textureState!==Sr.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,r=i.length;for(t=0;t<r;++t){let o=i[t].process(e);o&&l(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&o}return n?(this._textureState=Sr.READY,this._texturesLoaded=!0,!0):!1};Zf.prototype.process=function(e){if(this._state===Sr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=P2e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=Sr.FAILED;let r=this._processError;this._processError=void 0,qB(this,r)}let t=this._textureErrors.pop();if(l(t)){let r=this.getError("Failed to load glTF texture",t);throw r.name="TextureError",r}if(this._state===Sr.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(r){this._state=Sr.FAILED,qB(this,r)}let i=!1;try{i=this._processTextures(e)}catch(r){this._textureState=Sr.FAILED,qB(this,r)}return this._incrementallyLoadTextures?n:n&&i};function B2e(e,t,n,i,r,o,s,a){let u=t.accessors[n].bufferView;return Fi.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:s})}function L2e(e,t,n,i,r,o,s){return Fi.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function N2e(e,t,n){let i=Fi.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function Hte(e,t,n){let i=t.byteOffset,r=Hl(e,t),o=t.count,s=ku(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=W_(t.componentType);i=n.byteOffset+i;for(let A=0;A<o;++A){h(p,i,s,c,g);for(let x=0;x<s;++x)d[A*s+x]=g[x];i+=r}return d}function F2e(e,t){let n=e.type;if(n===ln.SCALAR)return t.fill(0);let i=ln.getMathType(n);return t.fill(i.clone(i.ZERO))}function U2e(e,t,n,i){let r=e.type,o=e.count;if(r===ln.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===ln.VEC4&&i)for(let s=0;s<o;s++)n[s]=Ne.unpack(t,s*4);else{let s=ln.getMathType(r),a=ln.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function V2e(e,t,n,i,r,o){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=Hte(n,i,s);r=y(r,!1),U2e(i,a,o,r)}function XB(e,t,n,i){let r=t.accessors[n],o=r.count,s=new Array(o),a=r.bufferView;if(l(a)){let c=N2e(e,t,a),u=V2e(e,c,t,r,i,s);return e._loaderPromises.push(u),s}return F2e(r,s)}function zu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function k2e(e){return e===Number?0:new e}function z2e(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var H2e={VEC2:new H(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function G2e(e,t){let n=z2e(e.componentDatatype),i=H2e[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function W2e(e,t,n){let i=e.decodeMatrix,r=zu(n,e.decodedMin),o=zu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new Nt.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new H(i[6],i[7]),s.quantizedVolumeStepSize=new H(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function j2e(e,t,n,i,r){let o=e.accessors[t],s=ln.getMathType(o.type),a=y(o.normalized,!1),c=new l2e;c.name=n,c.semantic=i,c.setIndex=r,c.constant=k2e(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=zu(s,o.min),c.max=zu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=Hl(e,o),ii(o,"WEB3D_quantized_attributes")&&W2e(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===bt.POSITION||c.semantic===bt.NORMAL||c.semantic===bt.TANGENT||c.semantic===bt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&G2e(c,s),c}function Gte(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var Y2e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function G5(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=Y2e;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function q2e(e){let t=e===bt.POSITION,n=e===bt.FEATURE_ID,i=e===bt.TEXCOORD;return t||n||i}function X2e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(r,t.typedArray.buffer)}}function K2e(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=Hte(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function Wte(e,t,n,i,r,o,s,a){let c=t.accessors[n],u=c.bufferView,f=i.gltfSemantic,d=i.renamedSemantic,p=i.modelSemantic,g=l(p)?Gte(d):void 0,A=j2e(t,n,f,p,g);if(!l(r)&&!l(u))return A;let x=B2e(e,t,n,f,r,o,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(x);let T=x.load();return e._loaderPromises.push(T),e._geometryCallbacks[C]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[f])?X2e(A,x,o,s):K2e(t,c,A,x,o,s)},A}function jte(e,t,n,i,r,o,s,a){let c=i.modelSemantic,u=c===bt.POSITION,f=c===bt.FEATURE_ID,d=u&&!o&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,A=g||d||p,T=Wte(e,t,n,i,r,s?!1:h,s?!0:A,a),E=new GC.AttributeLoadPlan(T);return E.loadBuffer=h,E.loadTypedArray=A,E}function J2e(e,t,n,i,r,o){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=G5(e,qo,r),u=c.modelSemantic,f=u===qo.TRANSLATION||u===qo.ROTATION||u===qo.SCALE,d=u===qo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!o.scene3DOnly;return Wte(e,t,n,c,void 0,g,p||d&&(!a||h),o)}function Z2e(e,t,n,i,r,o,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new u2e;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&r,h=!f,A=f||d||p,T=L2e(e,t,n,i,o?!1:h,o?!0:A,s),E=e._geometryLoaders.length;e._geometryLoaders.push(T);let S=T.load();e._loaderPromises.push(S),e._geometryCallbacks[E]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let w=new GC.IndicesLoadPlan(u);return w.loadBuffer=h,w.loadTypedArray=A,w}function $h(e,t,n,i,r,o){let s=Gl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=Fi.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:r,asynchronous:e._asynchronous}),c=Gl.createModelTextureReader({textureInfo:n}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Sr.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{c.texture=a.texture,l(o)&&(c.texture.sampler=o)},c}function Q2e(e,t,n,i,r){let o=new D2e,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(o.unlit=l(s.KHR_materials_unlit),l(a)){let u=new w2e;o.specularGlossiness=u,l(a.diffuseTexture)&&(u.diffuseTexture=$h(e,t,a.diffuseTexture,i,r)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(u.specularGlossinessTexture=$h(e,t,a.specularGlossinessTexture,i,r)),u.diffuseFactor=zu(oe,a.diffuseFactor),u.specularFactor=zu(m,a.specularFactor),u.glossinessFactor=a.glossinessFactor,o.pbrSpecularGlossiness=a}else if(l(c)){let u=new v2e;l(c.baseColorTexture)&&(u.baseColorTexture=$h(e,t,c.baseColorTexture,i,r)),l(c.metallicRoughnessTexture)&&(u.metallicRoughnessTexture=$h(e,t,c.metallicRoughnessTexture,i,r)),u.baseColorFactor=zu(oe,c.baseColorFactor),u.metallicFactor=c.metallicFactor,u.roughnessFactor=c.roughnessFactor,o.metallicRoughness=u}return l(n.emissiveTexture)&&(o.emissiveTexture=$h(e,t,n.emissiveTexture,i,r)),l(n.normalTexture)&&!e._loadForClassification&&(o.normalTexture=$h(e,t,n.normalTexture,i,r)),l(n.occlusionTexture)&&(o.occlusionTexture=$h(e,t,n.occlusionTexture,i,r)),o.emissiveFactor=zu(m,n.emissiveFactor),o.alphaMode=n.alphaMode,o.alphaCutoff=n.alphaCutoff,o.doubleSided=n.doubleSided,o}function Yte(e,t){let n=new Vte;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function qte(e,t,n,i){let r=new Vte,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Gte(o.attribute),r.positionalLabel=i,r}function Xte(e,t){let n=new zte;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Kte(e,t,n,i){let r=new zte,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=y(o.constant,0);let s=y(o.divisor,0);return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function $2e(e,t,n,i,r,o){let s=new kte;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=o;let a=n.texture;s.textureReader=$h(e,t,a,i,r,mn.NEAREST);let u=(l(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=u,s}function e3e(e,t,n,i,r,o,s,a){let c=new kte,u=n.featureIds,f=u.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=$h(e,t,f,r,o,mn.NEAREST),c.textureReader.channels=u.channels,c.positionalLabel=a,c}function t3e(e,t,n,i,r,o){let s=new f2e,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=G5(e,bt,u),p=jte(e,t,f,d,a,c,i,o);s.attributes.push(p.attribute),r.attributePlans.push(p)}return s}function n3e(e,t,n,i,r,o){let s=new d2e,a=new GC(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=Q2e(e,t,t.materials[c],r,o));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=i3e(e,t,d,a));let p=e._loadForClassification,g=u.KHR_draco_mesh_compression,h=!1,A=n.attributes;if(l(A)){for(let R in A)if(A.hasOwnProperty(R)){let O=A[R],L=G5(e,bt,R),N=L.modelSemantic;if(p&&!q2e(N))continue;N===bt.FEATURE_ID&&(h=!0);let _=jte(e,t,O,L,g,i,f,o);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let x=n.targets;if(l(x)&&!p){let R=x.length;for(let O=0;O<R;++O)s.morphTargets.push(t3e(e,t,x[O],f,a,o))}let C=n.indices;if(l(C)){let R=Z2e(e,t,C,g,h,f,o);l(R)&&(a.indicesPlan=R,s.indices=R.indices)}let T=u.EXT_structural_metadata,E=u.EXT_mesh_features,S=u.EXT_feature_metadata,w=l(S);l(E)?r3e(e,t,s,E,r,o):w&&o3e(e,t,s,S,r,o),l(T)?s3e(s,T):w&&a3e(e,s,S);let D=n.mode;if(p&&D!==Le.TRIANGLES)throw new de("Only triangle meshes can be used for classification.");return s.primitiveType=D,s}function i3e(e,t,n){let i=n.indices;return XB(e,t,i,!1)}function r3e(e,t,n,i,r,o){let s;l(i)&&l(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],u=`featureId_${a}`,f;l(c.texture)?f=$2e(e,t,c,r,o,u):l(c.attribute)?f=Yte(c,u):f=Xte(c,u),n.featureIds.push(f)}}function o3e(e,t,n,i,r,o){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(l(c)){let f=c.length;for(let d=0;d<f;++d){let p=c[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),A=s[g].count,x=`featureId_${a}`;a++;let C;l(p.featureIds.attribute)?C=qte(p,h,A,x):C=Kte(p,h,A,x),n.featureIds.push(C)}}let u=i.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),A=s[g].count,x=`featureId_${a}`;a++;let C=e3e(e,t,p,h,r,o,A,x);n.featureIds.push(C)}}}function s3e(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function a3e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function c3e(e,t,n,i){let r=n.EXT_mesh_gpu_instancing,o=new m2e,s=r.attributes;if(l(s)){for(let f in s)if(s.hasOwnProperty(f)){let d=s[f];o.attributes.push(J2e(e,t,d,s,f,i))}}let a=y(r.extensions,y.EMPTY_OBJECT),c=n.EXT_instance_features,u=a.EXT_feature_metadata;return l(c)?l3e(o,c):l(u)&&u3e(t,o,u,e._sortedPropertyTableIds),o}function l3e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=Yte(r,o):s=Xte(r,o),e.featureIds.push(s)}}function u3e(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o)){let s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.featureTable,f=i.indexOf(u),d=r[u].count,p=`instanceFeatureId_${a}`,g;l(c.featureIds.attribute)?g=qte(c,f,d,p):g=Kte(c,f,d,p),t.featureIds.push(g)}}}function f3e(e,t,n,i,r){let o=new p2e;o.name=n.name,o.matrix=zu(B,n.matrix),o.translation=zu(m,n.translation),o.rotation=zu(Ne,n.rotation),o.scale=zu(m,n.scale);let s=y(n.extensions,y.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(l(a)){if(e._loadForClassification)throw new de("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");o.instances=c3e(e,t,s,r)}l(c)&&(o.articulationName=c.articulationName);let u=n.mesh;if(l(u)){let f=t.meshes[u],d=f.primitives,p=d.length;for(let x=0;x<p;++x)o.primitives.push(n3e(e,t,d[x],l(o.instances),i,r));let g=y(n.weights,f.weights),A=o.primitives[0].morphTargets.length;o.morphWeights=l(g)?g.slice():new Array(A).fill(0)}return o}function d3e(e,t,n,i){if(!l(t.nodes))return[];let r,o,s=t.nodes.length,a=new Array(s);for(r=0;r<s;++r){let c=f3e(e,t,t.nodes[r],n,i);c.index=r,a[r]=c}for(r=0;r<s;++r){let c=t.nodes[r].children;if(l(c)){let u=c.length;for(o=0;o<u;++o)a[r].children.push(a[c[o]])}}return a}function m3e(e,t,n,i){let r=new h2e,o=n.joints,s=o.length,a=new Array(s);for(let u=0;u<s;++u)a[u]=i[o[u]];r.joints=a;let c=n.inverseBindMatrices;return l(c)?r.inverseBindMatrices=XB(e,t,c):r.inverseBindMatrices=new Array(s).fill(B.IDENTITY),r}function h3e(e,t,n){let i=t.skins;if(e._loadForClassification||!l(i))return[];let r=t.skins.length,o=new Array(r);for(let a=0;a<r;++a){let c=m3e(e,t,t.skins[a],n);c.index=a,o[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;l(c)&&(n[a].skin=o[c])}return o}async function p3e(e,t,n,i,r,o){let s=new GB({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:r,frameState:o,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function _3e(e,t,n){let i=new g2e,r=n.input;i.input=XB(e,t,r);let o=n.interpolation;i.interpolation=y(Em[o],Em.LINEAR);let s=n.output;return i.output=XB(e,t,s,!0),i}function g3e(e,t){let n=new y2e,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=_2e[r],n}function y3e(e,t,n){let i=new A2e,r=e.sampler;return i.sampler=t[r],i.target=g3e(e.target,n),i}function A3e(e,t,n,i){let r,o=new x2e;o.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(r=0;r<a;r++){let p=_3e(e,t,s[r]);p.index=r,c[r]=p}let u=n.channels,f=u.length,d=new Array(f);for(r=0;r<f;r++)d[r]=y3e(u[r],c,i);return o.samplers=c,o.channels=d,o}function x3e(e,t,n){let i=t.animations;if(e._loadForClassification||!l(i))return[];let r=t.animations.length,o=new Array(r);for(let s=0;s<r;++s){let a=A3e(e,t,t.animations[s],n);a.index=s,o[s]=a}return o}function C3e(e){let t=new C2e;t.name=e.name;let n=e.type.toUpperCase();return t.type=Ec[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function T3e(e){let t=new T2e;t.name=e.name;let n=e.stages,i=n.length,r=new Array(i);for(let o=0;o<i;o++){let s=C3e(n[o]);r[o]=s}return t.stages=r,t}function E3e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations;if(!l(n))return[];let i=n.articulations;if(!l(i))return[];let r=i.length,o=new Array(r);for(let s=0;s<r;s++){let a=T3e(i[s]);o[s]=a}return o}function b3e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function S3e(e,t){let n=new b2e,i=b3e(e);return n.nodes=i.map(function(r){return t[r]}),n}var v3e=new m;function w3e(e,t,n,i){let r=y(t.extensions,y.EMPTY_OBJECT),o=r.EXT_structural_metadata,s=r.EXT_feature_metadata,a=r.CESIUM_RTC;if(l(s)){let C=s.featureTables,T=s.featureTextures,E=l(C)?C:[],S=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let c=d3e(e,t,n,i),u=h3e(e,t,c),f=x3e(e,t,c),d=E3e(t),p=S3e(t,c),g=new S2e,h=new E2e,A=t.asset.copyright;if(l(A)){let C=A.split(";").map(function(T){return new It(T.trim())});h.credits=C}if(g.asset=h,g.scene=p,g.nodes=c,g.skins=u,g.animations=f,g.articulations=d,g.upAxis=e._upAxis,g.forwardAxis=e._forwardAxis,l(a)){let C=m.fromArray(a.center,0,v3e);g.transform=B.fromTranslation(C,g.transform)}if(e._components=g,l(o)||l(s)){let C=p3e(e,t,o,s,n,i);e._loaderPromises.push(C)}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function D3e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Fi.unload(t[i]);e._textureLoaders.length=0}function Jte(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Fi.unload(t[i]);e._bufferViewLoaders.length=0}function I3e(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Fi.unload(t[i]);e._geometryLoaders.length=0}function P3e(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}function O3e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Zf.prototype.isUnloaded=function(){return this._state===Sr.UNLOADED};Zf.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Fi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,D3e(this),Jte(this),I3e(this),P3e(this),O3e(this),this._components=void 0,this._typedArray=void 0,this._state=Sr.UNLOADED};var ep=Zf;var KB=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; - -vec2 neighborContribution(float log2Depth, vec2 offset) -{ - float dist = u_distanceAndEdlStrength.x; - vec2 texCoordOrig = v_textureCoordinates + offset * dist; - vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); - vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); - - float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); - float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); - - // ignore depth values that are the clear depth - if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { - return vec2(0.0); - } - - // interpolate the two adjacent depth values - float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); - return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); -} - -void main() -{ - float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); - eyeCoordinate /= eyeCoordinate.w; - - float log2Depth = log2(-eyeCoordinate.z); - - if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer - { - discard; - } - - vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); - - // sample from neighbors left, right, down, up - vec2 texelSize = 1.0 / czm_viewport.zw; - - vec2 responseAndCount = vec2(0.0); - - responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); - - float response = responseAndCount.x / responseAndCount.y; - float strength = u_distanceAndEdlStrength.y; - float shade = exp(-response * 300.0 * strength); - color.rgb *= shade; - out_FragColor = vec4(color); - - // Input and output depth are the same. - gl_FragDepth = depthOrLogDepth; -} -`;function WC(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(WC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function R3e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var W5=new H;function M3e(e,t){let n=new He({defines:["LOG_DEPTH_WRITE"],sources:[KB]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return W5.x=e._radius,W5.y=e._strength,W5}},r=ze.fromCache({blending:hn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Se.CESIUM_3D_TILE,owner:e}),e._clearCommand=new oi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Se.CESIUM_3D_TILE,owner:e})}function B3e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),M3e(e,t)}function Zte(e){return e.drawBuffers&&e.fragmentDepth}WC.isSupported=Zte;function L3e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=He.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}WC.prototype.update=function(e,t,n,i){if(!Zte(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,B3e(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Le.POINTS||u.pass===Se.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=nt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=L3e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};WC.prototype.isDestroyed=function(){return!1};WC.prototype.destroy=function(){return R3e(this),ue(this)};var Z_=WC;function Qte(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Qte.isSupported=function(e){return Z_.isSupported(e.context)};var tp=Qte;var pa={},N3e=new oe(0,0,0,1),Ha=new oe,F3e=new Ke,j5=new H,Y5=new H;pa.wgs84ToWindowCoordinates=function(e,t,n){return pa.wgs84WithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var $te=new oe,ene=new m;function hv(e,t,n,i){let r=n.viewMatrix,o=B.multiplyByVector(r,oe.fromElements(e.x,e.y,e.z,1,$te),$te),s=m.multiplyComponents(t,m.normalize(o,ene),ene);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,B.multiplyByVector(n.frustum.projectionMatrix,o,i)}var U3e=new he(Math.PI,P.PI_OVER_TWO),V3e=new m,k3e=new m;pa.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=pa.computeActualWgs84Position(r,t,N3e);if(!l(o))return;let s=e.canvas,a=F3e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===ne.SCENE2D){let f=e.mapProjection,d=U3e,p=f.project(d,V3e),g=m.clone(c.position,k3e),h=c.frustum.clone(),A=B.computeViewportTransformation(a,0,1,new B),x=c.frustum.projectionMatrix,C=c.positionWC.y,T=m.fromElements(P.sign(C)*p.x-C,0,-c.positionWC.x),E=Mt.pointToGLWindowCoordinates(x,A,T);if(C===0||E.x<=0||E.x>=s.clientWidth)u=!0;else{if(E.x>s.clientWidth*.5){a.width=E.x,c.frustum.right=p.x-C,Ha=hv(o,n,c,Ha),pa.clipToGLWindowCoordinates(a,Ha,j5),a.x+=E.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,Ha=hv(o,n,c,Ha),pa.clipToGLWindowCoordinates(a,Ha,Y5)}else{a.x+=E.x,a.width-=E.x,c.frustum.left=-p.x-C,Ha=hv(o,n,c,Ha),pa.clipToGLWindowCoordinates(a,Ha,j5),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,Ha=hv(o,n,c,Ha),pa.clipToGLWindowCoordinates(a,Ha,Y5)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(j5,i),(i.x<0||i.x>s.clientWidth)&&(i.x=Y5.x)}}if(r.mode!==ne.SCENE2D||u){if(Ha=hv(o,n,c,Ha),Ha.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof Po))return;i=pa.clipToGLWindowCoordinates(a,Ha,i)}return i.y=s.clientHeight-i.y,i};pa.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=pa.wgs84ToWindowCoordinates(e,t,n),!!l(n))return pa.transformWindowToDrawingBuffer(e,n,n)};var np=new m,z3e=new he;pa.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,z3e);if(!l(o))return;if(r.project(o,np),i===ne.COLUMBUS_VIEW)return m.fromElements(np.z,np.x,np.y,n);if(i===ne.SCENE2D)return m.fromElements(0,np.x,np.y,n);let s=e.morphTime;return m.fromElements(P.lerp(np.z,t.x,s),P.lerp(np.x,t.y,s),P.lerp(np.y,t.z,s),n)};var tne=new m,nne=new m,ine=new B;pa.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,tne),B.computeViewportTransformation(e,0,1,ine),B.multiplyByPoint(ine,tne,nne),H.fromCartesian3(nne,n)};pa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*r,t.y*o,n)};var H3e=new oe,rne=new oe;pa.drawingBufferToWgs84Coordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,H3e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=B.multiplyByVector(o.inverseViewProjection,f,rne);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=rne,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=B.multiplyByVector(o.inverseView,d,d)}return m.fromCartesian4(d,i)};var Zi=pa;var G3e={LEFT:-1,NONE:0,RIGHT:1},nl=Object.freeze(G3e);var jC={};jC._deprecationWarning=$;var ip=Uint32Array.BYTES_PER_ELEMENT;jC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=ip;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=ip;let s=r.getUint32(t,!0);t+=ip;let a=r.getUint32(t,!0);t+=ip;let c=r.getUint32(t,!0);t+=ip;let u=r.getUint32(t,!0);t+=ip;let f=r.getUint32(t,!0);t+=ip;let d;u>=570425344?(t-=ip*2,d=a,u=c,f=0,a=0,c=0,jC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=ip,d=u,u=a,f=c,a=0,c=0,jC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Mr(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,A;u>0&&(h=Mr(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(jC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var JB=jC;function pv(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function one(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function W3e(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=X.createTypedArray(n,i),r[t]=o),o}pv.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),one(this,e,t,n,1,i.byteOffset)):i};pv.prototype.hasProperty=function(e){return l(this.json[e])};pv.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),one(this,e,t,n,this.featuresLength,i.byteOffset)):W3e(this,e,t,i)};pv.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var bm=pv;function _v(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=y(e.parseAsPropertyAttributes,!1),o=e.customAttributeOutput,s=j3e(n),a;l(s.jsonProperties)&&(a=new K_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new wC({extension:s.hierarchy,binaryBody:i}));let u=Cm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let x=q3e(t,u,f,i,o);g=x.transcodedSchema,p=[new kC({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=Y3e(t,u,f,i);g=x.transcodedSchema;let C=x.featureTableJson;d=new zl({count:C.count,properties:C.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),p=[]}let h=[];if(l(d)||l(a)||l(c)){let x=new tl({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});h.push(x)}let A={schema:g,propertyTables:h,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new za(A)}function j3e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(_v._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function Y3e(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new de(`Property ${d} requires a batch table binary.`);let p=n[d],g=Uu(p);o[d]={bufferView:a},r[d]=sne(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Tm.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function q3e(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new de(`Property ${d} requires a batch table binary.`);let g=en.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let h=sne(p);h.name=d,o[g]=h;let A=g.toUpperCase();A.startsWith("_")||(A=`_${A}`);let x=p.typedArray;l(x)||(x=Uu(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Nt.Attribute;C.name=A,C.count=e,C.type=p.type;let T=X.fromTypedArray(x);(T===X.INT||T===X.UNSIGNED_INT||T===X.DOUBLE)&&(_v._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${A}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),x=new Float32Array(x)),C.componentDatatype=X.fromTypedArray(x),C.typedArray=x,r.push(C),s[g]={attribute:A}}let c={classes:{}};c.classes[t]={properties:o};let u=Tm.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function sne(e){let t=X3e(e.componentType);return{type:e.type,componentType:t}}function X3e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}_v._deprecationWarning=$;_v._oneTimeWarning=Rt;var Q_=_v;var v0={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},K3e=Nt.FeatureIdAttribute;function $_(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),u=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.loadIndicesForWireframe,!1),g=y(e.loadPrimitiveOutline,!0),h=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=h,this._state=v0.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=B.IDENTITY}l(Object.create)&&($_.prototype=Object.create(ir.prototype),$_.prototype.constructor=$_);Object.defineProperties($_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});$_.prototype.load=function(){if(l(this._promise))return this._promise;let e=JB.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,s=new bm(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=B.fromTranslation(m.fromArray(a))),this._batchTable={json:r,binary:o};let c=new ep({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=v0.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=v0.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return J3e(u,f)}),this._promise};function J3e(e,t){e.unload(),e._state=v0.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}$_.prototype.process=function(e){if(this._state===v0.READY)return!0;if(this._state!==v0.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=B.multiplyTransformation(this._transform,n.transform,n.transform),Z3e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=v0.READY,!0};function Z3e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new tl({name:Cm.BATCH_TABLE_CLASS_NAME,count:i});r=new za({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)ane(o[a]);t.structuralMetadata=r}function ane(e){let t=e.children.length;for(let i=0;i<t;i++)ane(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=en.getAttributeBySemantic(r,bt.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new K3e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}$_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var ZB=$_;function eg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(eg.prototype=Object.create(ir.prototype),eg.prototype.constructor=eg);Object.defineProperties(eg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});eg.prototype.load=function(){return Promise.resolve(this)};eg.prototype.process=function(e){return l(this._components)||(this._components=uUe(this._geoJson,e),this._geoJson=void 0),!0};function Q3e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function $3e(){this.features=[]}function q5(e){let t=e[0],n=e[1],i=y(e[2],0);return new m(t,n,i)}function X5(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=q5(e[r]);return[n]}function eUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=X5(e[i])[0];return n}function cne(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=X5(e[i])[0];return n}function tUe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,cne(e[i]));return n}function nUe(e){return[q5(e)]}function iUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=q5(e[i]);return n}var rUe={LineString:X5,MultiLineString:eUe,MultiPolygon:tUe,Polygon:cne,MultiPoint:iUe,Point:nUe},oUe={LineString:Le.LINES,MultiLineString:Le.LINES,MultiPolygon:Le.LINES,Polygon:Le.LINES,MultiPoint:Le.POINTS,Point:Le.POINTS};function lne(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=rUe[n],r=oUe[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Q3e;r===Le.LINES?s.lines=i(o):r===Le.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function sUe(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)lne(n[r],t)}var aUe={FeatureCollection:sUe,Feature:lne},QB=new m;function cUe(e,t,n){let i=0,r=0,o=e.length;for(let L=0;L<o;L++){let N=e[L];if(l(N.lines)){let _=N.lines.length;for(let b=0;b<_;b++){let v=N.lines[b];i+=v.length,r+=(v.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ue.createTypedArray(i,r),u=Ue.fromTypedArray(c),f=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let L=0;L<o;L++){let N=e[L];if(!l(N.lines))continue;let _=N.lines.length;for(let b=0;b<_;b++){let v=N.lines[b],I=v.length;for(let M=0;M<I;M++){let F=v[M],k=m.fromDegrees(F.x,F.y,F.z,re.WGS84,QB),V=B.multiplyByPoint(t,k,QB);m.minimumByComponent(f,V,f),m.maximumByComponent(d,V,d),m.pack(V,s,p*3),a[p]=L,M<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let h=ht.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let A=ht.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});A.vertexArrayDestroyable=!1;let x=ht.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});x.vertexArrayDestroyable=!1;let C=new Nt.Attribute;C.semantic=bt.POSITION,C.componentDatatype=X.FLOAT,C.type=ln.VEC3,C.count=i,C.min=f,C.max=d,C.buffer=h;let T=new Nt.Attribute;T.semantic=bt.FEATURE_ID,T.setIndex=0,T.componentDatatype=X.FLOAT,T.type=ln.SCALAR,T.count=i,T.buffer=A;let E=[C,T],S=new Nt.Material;S.unlit=!0;let w=new Nt.Indices;w.indexDatatype=u,w.count=c.length,w.buffer=x;let D=new Nt.FeatureIdAttribute;D.featureCount=o,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let R=[D],O=new Nt.Primitive;return O.attributes=E,O.indices=w,O.featureIds=R,O.primitiveType=Le.LINES,O.material=S,O}function lUe(e,t,n){let i=0,r=e.length;for(let E=0;E<r;E++){let S=e[E];l(S.points)&&(i+=S.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let E=0;E<r;E++){let S=e[E];if(!l(S.points))continue;let w=S.points.length;for(let D=0;D<w;D++){let R=S.points[D],O=m.fromDegrees(R.x,R.y,R.z,re.WGS84,QB),L=B.multiplyByPoint(t,O,QB);m.minimumByComponent(a,L,a),m.maximumByComponent(c,L,c),m.pack(L,o,u*3),s[u]=E,u++}}let f=ht.createVertexBuffer({typedArray:o,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=ht.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Nt.Attribute;p.semantic=bt.POSITION,p.componentDatatype=X.FLOAT,p.type=ln.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Nt.Attribute;g.semantic=bt.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=ln.SCALAR,g.count=i,g.buffer=d;let h=[p,g],A=new Nt.Material;A.unlit=!0;let x=new Nt.FeatureIdAttribute;x.featureCount=r,x.propertyTableId=0,x.setIndex=0,x.positionalLabel="featureId_0";let C=[x],T=new Nt.Primitive;return T.attributes=h,T.featureIds=C,T.primitiveType=Le.POINTS,T.material=A,T}function uUe(e,t){let n=new $3e,i=aUe[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new de("GeoJSON must have at least one feature");let s={};for(let L=0;L<o;L++){let N=r[L],_=y(N.properties,y.EMPTY_OBJECT);for(let b in _)_.hasOwnProperty(b)&&(l(s[b])||(s[b]=new Array(o)))}for(let L=0;L<o;L++){let N=r[L];for(let _ in s)if(s.hasOwnProperty(_)){let b=y(N.properties[_],"");s[_][L]=b}}let a=new K_({count:o,properties:s}),u=[new tl({id:0,count:o,jsonMetadataTable:a})],f=Tm.fromJson({}),d=new za({schema:f,propertyTables:u}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),h=!1,A=!1;for(let L=0;L<o;L++){let N=r[L];if(l(N.lines)){h=!0;let _=N.lines.length;for(let b=0;b<_;b++){let v=N.lines[b],I=v.length;for(let M=0;M<I;M++)m.minimumByComponent(p,v[M],p),m.maximumByComponent(g,v[M],g)}}if(l(N.points)){A=!0;let _=N.points.length;for(let b=0;b<_;b++){let v=N.points[b];m.minimumByComponent(p,v,p),m.maximumByComponent(g,v,g)}}}let x=m.midpoint(p,g,new m),C=m.fromDegrees(x.x,x.y,x.z,re.WGS84,new m),T=Mt.eastNorthUpToFixedFrame(C,re.WGS84,new B),E=B.inverseTransformation(T,new B),S=[];h&&S.push(cUe(r,E,t)),A&&S.push(lUe(r,E,t));let w=new Nt.Node;w.index=0,w.primitives=S;let D=[w],R=new Nt.Scene;R.nodes=D;let O=new Nt.Components;return O.scene=R,O.nodes=D,O.transform=T,O.structuralMetadata=d,O}eg.prototype.unload=function(){this._components=void 0};var $B=eg;var eL={};eL._deprecationWarning=$;var tg=Uint32Array.BYTES_PER_ELEMENT;eL.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=tg;let o=r.getUint32(t,!0);if(o!==1)throw new de(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=tg;let s=r.getUint32(t,!0);t+=tg;let a=r.getUint32(t,!0);if(a===0)throw new de("featureTableJsonByteLength is zero, the feature table must be defined.");t+=tg;let c=r.getUint32(t,!0);t+=tg;let u=r.getUint32(t,!0);t+=tg;let f=r.getUint32(t,!0);t+=tg;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new de(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=tg;let p=Mr(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let h,A;u>0&&(h=Mr(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let x=n+s-t;if(x===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,x):(eL._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:A,gltf:C}};var tL=eL;var rp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},nL=Nt.Attribute,fUe=Nt.FeatureIdAttribute,fne=Nt.Instances;function op(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,hr.Y),u=y(e.forwardAxis,hr.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=rp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(op.prototype=Object.create(ir.prototype),op.prototype.constructor=op);Object.defineProperties(op.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});op.prototype.load=function(){if(l(this._promise))return this._promise;let e=tL.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,s=new bm(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=B.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(o===0){let d=Ul(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new ep(u);return this._gltfLoader=f,this._state=rp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=rp.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw dUe(this,d)}),this._promise};function dUe(e,t){e.unload(),e._state=rp.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}op.prototype.process=function(e){if(this._state===rp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===rp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=B.multiplyTransformation(this._transform,i.transform,i.transform),pUe(this,i,e),mUe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=rp.READY,!0};function mUe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new tl({name:Cm.BATCH_TABLE_CLASS_NAME,count:i});r=new za({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var iL=new m,K5=new Array(4),hUe=new B;function pUe(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=gUe(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),h=m.unpackArray(f),A=new m,x=new m,C=new m,T=new m,E=new Z,S=new Ne,w=new Array(4),D=new m,R=new Array(3),O=new B;if(!l(s)){let V=ae.fromPoints(h);for(i=0;i<h.length;i++)m.subtract(h[i],V.center,iL),f[3*i+0]=iL.x,f[3*i+1]=iL.y,f[3*i+2]=iL.z;let G=B.fromTranslation(V.center,hUe);t.transform=B.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<o;i++){A=m.clone(h[i]),l(s)&&m.add(A,m.unpack(s),A),c&&(yUe(r,a,i,S,A,C,x,T,E,O),Ne.pack(S,w,0),d[4*i+0]=w[0],d[4*i+1]=w[1],d[4*i+2]=w[2],d[4*i+3]=w[3]),u&&(AUe(r,i,D),m.pack(D,R,0),p[3*i+0]=R[0],p[3*i+1]=R[1],p[3*i+2]=R[2]);let V=r.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(V)||(V=i),g[i]=V}let L=new fne;L.transformInWorldSpace=!0;let N=e._buffers,_=new nL;if(_.name="Instance Translation",_.semantic=qo.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=ln.VEC3,_.count=o,_.typedArray=f,!c){let V=ht.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});V.vertexArrayDestroyable=!1,N.push(V),_.buffer=V}if(L.attributes.push(_),c){let V=new nL;V.name="Instance Rotation",V.semantic=qo.ROTATION,V.componentDatatype=X.FLOAT,V.type=ln.VEC4,V.count=o,V.typedArray=d,L.attributes.push(V)}if(u){let V=new nL;if(V.name="Instance Scale",V.semantic=qo.SCALE,V.componentDatatype=X.FLOAT,V.type=ln.VEC3,V.count=o,c)V.typedArray=p;else{let G=ht.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,N.push(G),V.buffer=G}L.attributes.push(V)}let b=new nL;b.name="Instance Feature ID",b.setIndex=0,b.semantic=qo.FEATURE_ID,b.componentDatatype=X.FLOAT,b.type=ln.SCALAR,b.count=o;let v=ht.createVertexBuffer({context:n.context,typedArray:g,usage:Fe.STATIC_DRAW});v.vertexArrayDestroyable=!1,N.push(v),b.buffer=v,L.attributes.push(b);let I=new fUe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",L.featureIds.push(I);let M=t.nodes,F=M.length,k=!1;for(i=0;i<F;i++){let V=M[i];V.primitives.length>0&&(V.instances=k?_Ue(L):L,k=!0)}}function _Ue(e){let t=new fne;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Ye(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function gUe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(r))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new de("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var une=new Array(4);function yUe(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,K5),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,une),p=!1;if(l(f)){if(!l(d))throw new de("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(f,0,o),m.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,K5),h=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,une);if(l(g)){if(!l(h))throw new de("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");qn.octDecodeInRange(g[0],g[1],65535,o),qn.octDecodeInRange(h[0],h[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(r,re.WGS84,u),B.getMatrix3(u,c)):Z.clone(Z.IDENTITY,c)}p&&(m.cross(s,o,a),m.normalize(a,a),Z.setColumn(c,0,s,c),Z.setColumn(c,1,o,c),Z.setColumn(c,2,a,c)),Ne.fromRotationMatrix(c,i)}function AUe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,K5);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function xUe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}op.prototype.isUnloaded=function(){return this._state===rp.UNLOADED};op.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),xUe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=rp.UNLOADED};var rL=op;var CUe={STOPPED:0,ANIMATING:1},Sm=Object.freeze(CUe);function YC(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}YC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Ne)return Ne};YC.prototype.evaluate=fe.throwInstantiationError;YC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};YC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};YC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var rr=YC;function qC(e){this._value=e,this._valueType=rr.getPointType(e)}Object.defineProperties(qC.prototype,{value:{get:function(){return this._value}}});qC.prototype.findTimeInterval=function(e){};qC.prototype.wrapTime=function(e){return 0};qC.prototype.clampTime=function(e){return 0};qC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var oL=qC;function XC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=rr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(XC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});XC.prototype.findTimeInterval=rr.prototype.findTimeInterval;XC.prototype.wrapTime=rr.prototype.wrapTime;XC.prototype.clampTime=rr.prototype.clampTime;XC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new m),m.lerp(n[r],n[r+1],o,t))};var w0=XC;var dne={};dne.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new m,s[a]=new m;r[0]=n[0]/t[0],o[0]=m.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=m.subtract(i[a],m.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=m.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(o[a],m.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var gv=dne;var mne=[],hne=[],pne=[],_ne=[];function TUe(e,t,n){let i=mne,r=pne,o=hne,s=_ne;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),gv.solve(i,o,r,s)}function EUe(e){let t=mne,n=pne,i=hne,r=_ne;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new m),m.subtract(e[o+1],e[o-1],s),m.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new m),m.subtract(e[o],e[o-1],s),m.multiplyByScalar(s,3,s),gv.solve(t,i,n,r)}function il(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=rr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(il.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});il.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new il({times:t,points:n,inTangents:o,outTangents:r})};il.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new w0({points:n,times:t});let i=EUe(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new il({times:t,points:n,inTangents:o,outTangents:r})};il.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=rr.getPointType(n[0]);if(n.length<3)return new w0({points:n,times:t});let s=TUe(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new il({times:t,points:n,inTangents:c,outTangents:a})};il.hermiteCoefficientMatrix=new B(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);il.prototype.findTimeInterval=rr.prototype.findTimeInterval;var bUe=new oe,KC=new m;il.prototype.wrapTime=rr.prototype.wrapTime;il.prototype.clampTime=rr.prototype.clampTime;il.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=bUe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=B.multiplyByVector(il.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,KC),d.add(t,KC,t),d.multiplyByScalar(o[s],f.z,KC),d.add(t,KC,t),d.multiplyByScalar(r[s],f.w,KC),d.add(t,KC,t))};var D0=il;function JC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=rr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(JC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});JC.prototype.findTimeInterval=rr.prototype.findTimeInterval;JC.prototype.wrapTime=rr.prototype.wrapTime;JC.prototype.clampTime=rr.prototype.clampTime;JC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var sL=JC;function SUe(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Ne);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Ne.fastSlerp(a,c,s,r)}}function ZC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=SUe(this),this._lastTimeIndex=0}Object.defineProperties(ZC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ZC.prototype.findTimeInterval=rr.prototype.findTimeInterval;ZC.prototype.wrapTime=rr.prototype.wrapTime;ZC.prototype.clampTime=rr.prototype.clampTime;ZC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var aL=ZC;var I0=Nt.AnimatedPropertyType;function Z5(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,DUe(this)}Object.defineProperties(Z5.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function vUe(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new D0({times:e,points:n,inTangents:i,outTangents:r})}function gne(e,t,n,i){if(e.length===1&&t.length===1)return new oL(t[0]);switch(n){case Em.STEP:return new sL({times:e,points:t});case Em.CUBICSPLINE:return vUe(e,t);case Em.LINEAR:return i===I0.ROTATION?new aL({times:e,points:t}):new w0({times:e,points:t})}}function wUe(e,t,n,i,r){let o=[];if(i===I0.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===Em.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(gne(e,f,n,i))}}else o.push(gne(e,t,n,i));return o}var J5;function DUe(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=wUe(i,r,o,a,u);switch(e._splines=f,e._path=a,a){case I0.TRANSLATION:case I0.SCALE:J5=new m;break;case I0.ROTATION:J5=new Ne;break;case I0.WEIGHTS:break}}Z5.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===I0.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);r[n]=o.evaluate(s,J5)}}};var cL=Z5;function Q5(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ee.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,jl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Sm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,IUe(this)}Object.defineProperties(Q5.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function IUe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new cL({channel:u,runtimeAnimation:e,runtimeNode:p}),h=u.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}Q5.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var lL=Q5;function sp(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(sp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function $5(e,t,n){let i=e._model,r=new lL(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}sp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return $5(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return $5(this,n[i],e)};sp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=$5(this,n[o],e);i.push(s)}return i};sp.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};sp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};sp.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};sp.prototype.get=function(e){return this._runtimeAnimations[e]};var uL=[];function PUe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}sp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,r),a.delay,new ee)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=ee.lessThanOrEquals(c,r),p=l(f)&&ee.greaterThan(r,f),g=0;if(u!==0){let x=ee.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,x):x/u}let h=a.loop===jl.REPEAT||a.loop===jl.MIRRORED_REPEAT,A=(d||h&&!l(a.startTime))&&(g<=1||h)&&!p;if(g===a._prevAnimationDelta){let x=a._state===Sm.STOPPED;if(A!==x)continue}if(a._prevAnimationDelta=g,A||a._state===Sm.ANIMATING){if(A&&a._state===Sm.STOPPED&&(a._state=Sm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===jl.REPEAT)g=g-Math.floor(g);else if(a.loop===jl.MIRRORED_REPEAT){let C=Math.floor(g),T=g-C;g=C%2===1?1-T:T}a.reverse&&(g=1-g);let x=g*u*a.multiplier;x=P.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,A||(a._state=Sm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&uL.push(a))}}n=uL.length;for(let s=0;s<n;++s){let a=uL[s];t.splice(t.indexOf(a),1),e.afterRender.push(PUe(this,o,a))}return uL.length=0,i};var fL=sp;function P0(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(P0.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});P0.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};P0.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};P0.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};P0.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};P0.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var dL=P0;var yv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};yv.getStyleCommandsNeeded=function(e,t){return t===0?yv.ALL_OPAQUE:t===e?yv.ALL_TRANSLUCENT:yv.OPAQUE_AND_TRANSLUCENT};var vm=Object.freeze(yv);var ng={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ng.is3DTiles=function(e){switch(e){case ng.TILE_GLTF:case ng.TILE_B3DM:case ng.TILE_I3DM:case ng.TILE_PNTS:case ng.TILE_GEOJSON:return!0;case ng.GLTF:return!1}};var Gr=Object.freeze(ng);function Eo(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=vm.ALL_OPAQUE,OUe(this)}Object.defineProperties(Eo.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function OUe(e){let t=e._model,n=Gr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new Us(s,r)}else for(r=0;r<i;r++)o[r]=new dL({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new $c({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Eo.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=vm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Eo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Eo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Eo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Eo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Eo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Eo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Eo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Eo.prototype.getFeature=function(e){return this._features[e]};Eo.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Eo.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Eo.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Eo.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Eo.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Eo.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Eo.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Eo.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Eo.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var RUe=new z;Eo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor($c.DEFAULT_COLOR_VALUE),this.setAllShow($c.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,RUe),$c.DEFAULT_COLOR_VALUE):$c.DEFAULT_COLOR_VALUE,r=l(e.show)?y(e.show.evaluate(n),$c.DEFAULT_SHOW_VALUE):$c.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Eo.prototype.isDestroyed=function(){return!1};Eo.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var mL=Eo;var hL=`#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT) - #ifdef GL_OES_standard_derivatives - #extension GL_OES_standard_derivatives : enable - #endif -#endif - -czm_modelMaterial defaultModelMaterial() -{ - czm_modelMaterial material; - material.diffuse = vec3(0.0); - material.specular = vec3(1.0); - material.roughness = 1.0; - material.occlusion = 1.0; - material.normalEC = vec3(0.0, 0.0, 1.0); - material.emissive = vec3(0.0); - material.alpha = 1.0; - return material; -} - -vec4 handleAlpha(vec3 color, float alpha) -{ - #ifdef ALPHA_MODE_MASK - if (alpha < u_alphaCutoff) { - discard; - } - #endif - - return vec4(color, alpha); -} - -SelectedFeature selectedFeature; - -void main() -{ - #ifdef HAS_MODEL_SPLITTER - modelSplitterStage(); - #endif - - czm_modelMaterial material = defaultModelMaterial(); - - ProcessedAttributes attributes; - geometryStage(attributes); - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - selectedFeatureIdStage(selectedFeature, featureIds); - #endif - - #ifndef CUSTOM_SHADER_REPLACE_MATERIAL - materialStage(material, attributes, selectedFeature); - #endif - - #ifdef HAS_CUSTOM_FRAGMENT_SHADER - customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - lightingStage(material, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - cpuStylingStage(material, selectedFeature); - #endif - - #ifdef HAS_MODEL_COLOR - modelColorStage(material); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(material); - #endif - - vec4 color = handleAlpha(material.diffuse, material.alpha); - - #ifdef HAS_CLIPPING_PLANES - modelClippingPlanesStage(color); - #endif - - #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) - silhouetteStage(color); - #endif - - out_FragColor = color; -} -`;var pL=`precision highp float; - -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { - czm_modelVertexOutput vsOutput; - vsOutput.positionMC = positionMC; - vsOutput.pointSize = 1.0; - return vsOutput; -} - -void main() -{ - // Initialize the attributes struct with all - // attributes except quantized ones. - ProcessedAttributes attributes; - initializeAttributes(attributes); - - // Dequantize the quantized ones and add them to the - // attributes struct. - #ifdef USE_DEQUANTIZATION - dequantizationStage(attributes); - #endif - - #ifdef HAS_MORPH_TARGETS - morphTargetsStage(attributes); - #endif - - #ifdef HAS_SKINNING - skinningStage(attributes); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(); - #endif - - // Compute the bitangent according to the formula in the glTF spec. - // Normal and tangents can be affected by morphing and skinning, so - // the bitangent should not be computed until their values are finalized. - #ifdef HAS_BITANGENTS - attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); - #endif - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - SelectedFeature feature; - selectedFeatureIdStage(feature, featureIds); - // Handle any show properties that come from the style. - cpuStylingStage(attributes.positionMC, feature); - #endif - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - // The scene mode 2D pipeline stage and instancing stage add a different - // model view matrix to accurately project the model to 2D. However, the - // output positions and normals should be transformed by the 3D matrices - // to keep the data the same for the fragment shader. - mat4 modelView = czm_modelView3D; - mat3 normal = czm_normal3D; - #else - // These are used for individual model projection because they will - // automatically change based on the scene mode. - mat4 modelView = czm_modelView; - mat3 normal = czm_normal; - #endif - - // Update the position for this instance in place - #ifdef HAS_INSTANCING - - // The legacy instance stage is used when rendering i3dm models that - // encode instances transforms in world space, as opposed to glTF models - // that use EXT_mesh_gpu_instancing, where instance transforms are encoded - // in object space. - #ifdef USE_LEGACY_INSTANCING - mat4 instanceModelView; - mat3 instanceModelViewInverseTranspose; - - legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); - - modelView = instanceModelView; - normal = instanceModelViewInverseTranspose; - #else - instancingStage(attributes); - #endif - - #ifdef USE_PICKING - v_pickColor = a_pickColor; - #endif - - #endif - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - #ifdef HAS_CUSTOM_VERTEX_SHADER - czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); - customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - // Compute the final position in each coordinate system needed. - // This returns the value that will be assigned to gl_Position. - vec4 positionClip = geometryStage(attributes, modelView, normal); - - #ifdef HAS_SILHOUETTE - silhouetteStage(attributes, positionClip); - #endif - - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - float show = pointCloudShowStylingStage(attributes, metadata); - #else - float show = 1.0; - #endif - - #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING - show *= pointCloudBackFaceCullingStage(); - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); - #endif - - #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif - - gl_PointSize *= show; - #endif - - gl_Position = show * positionClip; -} -`;function t6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Hn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Hn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],NUe(this)}function MUe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:e,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:pc.LESS_OR_EQUAL},depthMask:!1}}var BUe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND},LUe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},xne=[];function NUe(e){let t=e._command,n=xne;if(e._useDebugWireframe){t.pass=Se.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Av(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Se.TERRAIN_CLASSIFICATION,s=e6(t,o),a=yne(t,o);n.length=0,n.push(s,a),e._commandListTerrain=Av(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=Ane(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Se.CESIUM_3D_TILE_CLASSIFICATION,s=e6(t,o),a=yne(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=Av(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=Ane(e,n,e._commandList3DTilesPicking))}}function Av(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=nt.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function e6(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Se.TERRAIN_CLASSIFICATION?Gn.ALWAYS:Gn.EQUAL,r=MUe(i);return n.renderState=ze.fromCache(r),n}function yne(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(BUe),n}var FUe=[];function Ane(e,t,n){let i=ze.fromCache(LUe),r=t[0],o=t[1],s=nt.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=nt.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=FUe;return c.length=0,c.push(s,a),Av(e,c,n)}Object.defineProperties(t6.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});t6.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=e6(this._command,r),s=xne;s.length=0,s.push(o),this._commandListIgnoreShow=Av(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var _L=t6;function gL(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r;let o=t.pass===Se.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c;this._command=t,this._modelMatrix=B.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new B,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,UUe(this)}function ap(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}ap.clone=function(e){return new ap({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function UUe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;e._originalCommand=new ap({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new ap({command:jUe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new ap({command:ZUe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new ap({command:QUe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new ap({command:YUe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new ap({command:qUe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand))}Object.defineProperties(gL.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,kUe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,zUe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,HUe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,GUe(this))}}});function VUe(e,t){let n=e._modelMatrix;e._modelMatrix2D=B.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function kUe(e){let t=e.shadows,n=xn.castShadows(t),i=xn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function zUe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Ye(o.renderState,!0);s.cull.enabled=t,o.renderState=ze.fromCache(s)}}}function HUe(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Ye(o.renderState,!0);s.cull.face=t,o.renderState=ze.fromCache(s)}}}function GUe(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}gL.prototype.pushCommands=function(e,t){let n=Cne(this,e);n&&!this._has2DCommands&&(WUe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(VUe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==vm.ALL_OPAQUE&&$C(t,this._translucentCommand,n),i===vm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||$C(r._backfaceCommands,this._skipLodBackfaceCommand,n),XUe(this,o,n),$C(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){$C(t,this._silhouetteModelCommand,n);return}return $C(t,this._originalCommand,n),t}};gL.prototype.pushSilhouetteCommands=function(e,t){let n=Cne(this,e);return $C(t,this._silhouetteColorCommand,n),t};function $C(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Cne(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return r<s&&o>s||r<-s&&o>-s}function QC(e,t){if(!l(t))return;let n=ap.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function WUe(e){QC(e,e._originalCommand),QC(e,e._translucentCommand),QC(e,e._skipLodBackfaceCommand),QC(e,e._skipLodStencilCommand),QC(e,e._silhouetteModelCommand),QC(e,e._silhouetteColorCommand)}function jUe(e){let t=nt.shallowClone(e);t.pass=Se.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=hn.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function YUe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(r),i}function qUe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(e.renderState,!0);r.cull.enabled=!1,(e.pass===Se.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Se.TRANSLUCENT,r.depthMask=!1,r.blending=hn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function XUe(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=KUe(r);if(o!==s){let a=JUe(o),c=Ye(r.renderState,!0);c.stencilTest.reference=a,r.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function KUe(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function JUe(e){return Ut.CESIUM_3D_TILE_MASK|e<<Ut.SKIP_LOD_BIT_SHIFT}function ZUe(e){let t=nt.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=gi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),r=new H(5,5);return i.u_polygonOffset=function(){return r},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function QUe(e){let t=nt.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ut.SKIP_LOD_MASK,i.reference=Ut.CESIUM_3D_TILE_MASK,i.frontFunction=Gn.GREATER_OR_EQUAL,i.frontOperation.zPass=pt.REPLACE,i.backFunction=Gn.GREATER_OR_EQUAL,i.backOperation.zPass=pt.REPLACE,n.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var yL=gL;function $Ue(e,t){let n=e.shaderBuilder;n.addVertexLines(pL),n.addFragmentLines(hL);let i=eVe(e),r=new si({context:t.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=n.buildShaderProgram(t.context);o._pipelineResources.push(s);let a=e.alphaOptions.pass,c=o.sceneGraph,u=t.mode===ne.SCENE3D,f,d;if(!u&&!t.scene3DOnly&&o._projectTo2D)f=B.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new B),d=e.runtimePrimitive.boundingSphere2D;else{let T=u?c._computedModelMatrix:c._computedModelMatrix2D;f=B.multiplyTransformation(T,e.runtimeNode.computedTransform,new B),d=ae.transform(e.boundingSphere,f,e.boundingSphere)}let p=Ye(ze.fromCache(e.renderStateOptions),!0);p.cull.face=en.getCullFace(f,e.primitiveType),p=ze.fromCache(p);let g=l(o.classificationType),h=g?!1:xn.castShadows(o.shadows),A=g?!1:xn.receiveShadows(o.shadows),x=g?void 0:e.pickId,C=new nt({boundingVolume:d,modelMatrix:f,uniformMap:e.uniformMap,renderState:p,vertexArray:r,shaderProgram:s,cull:o.cull,pass:a,count:e.count,owner:o,pickId:x,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:h,receiveShadows:A});return g?new _L({primitiveRenderResources:e,command:C}):new yL({primitiveRenderResources:e,command:C})}function eVe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var AL=$Ue;var Tne={name:"TilesetPipelineStage"};Tne.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,be.FRAGMENT);let o={u_polygonOffset:function(){return H.ZERO}};e.uniformMap=gt(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK};var xL=Tne;var CL=`vec3 proceduralIBL( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) { - vec3 v = -positionEC; - vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); - vec3 vWC = -normalize(positionWC); - vec3 l = normalize(lightDirectionEC); - vec3 n = normalEC; - vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); - - float NdotL = clamp(dot(n, l), 0.001, 1.0); - float NdotV = abs(dot(n, v)) + 0.001; - - // Figure out if the reflection vector hits the ellipsoid - float vertexRadius = length(positionWC); - float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); - float reflectionDotNadir = dot(r, normalize(positionWC)); - // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. - r.x = -r.x; - r = -normalize(czm_temeToPseudoFixed * r); - r.x = -r.x; - - vec3 diffuseColor = pbrParameters.diffuseColor; - float roughness = pbrParameters.roughness; - vec3 specularColor = pbrParameters.f0; - - float inverseRoughness = 1.04 - roughness; - inverseRoughness *= inverseRoughness; - vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness; - - float atmosphereHeight = 0.05; - float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); - float blendRegionOffset = roughness * -1.0; - float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); - float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); - float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); - float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); - vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); - vec3 nadirColor = belowHorizonColor * 0.5; - vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); - vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); - vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); - vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); - float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; - float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); - vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); - float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); - vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); - specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); - specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); - - // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf - #ifdef USE_SUN_LUMINANCE - // Angle between sun and zenith - float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); - float S = acos(LdotZenith); - // Angle between zenith and current pixel - float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); - // Angle between sun and current pixel - float gamma = acos(NdotL); - float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); - float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); - float luminance = model_luminanceAtZenith * (numerator / denominator); - #endif - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); - float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); - vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); - iblColor *= lightColor; - - #ifdef USE_SUN_LUMINANCE - iblColor *= luminance; - #endif - - return iblColor; -} - -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - czm_pbrParameters pbrParameters -) { - vec3 diffuseColor = pbrParameters.diffuseColor; - float roughness = pbrParameters.roughness; - vec3 specularColor = pbrParameters.f0; - - vec3 v = -positionEC; - vec3 n = normalEC; - vec3 l = normalize(lightDirectionEC); - vec3 h = normalize(v + l); - - float NdotV = abs(dot(n, v)) + 0.001; - float VdotH = clamp(dot(v, h), 0.0, 1.0); - - const mat3 yUpToZUp = mat3( - -1.0, 0.0, 0.0, - 0.0, 0.0, -1.0, - 0.0, 1.0, 0.0 - ); - vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); - - #ifdef DIFFUSE_IBL - #ifdef CUSTOM_SPHERICAL_HARMONICS - vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); - #else - vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); - #endif - #else - vec3 diffuseIrradiance = vec3(0.0); - #endif - - #ifdef SPECULAR_IBL - vec3 r0 = specularColor.rgb; - float reflectance = max(max(r0.r, r0.g), r0.b); - vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); - vec3 F = fresnelSchlick2(r0, r90, VdotH); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - #ifdef CUSTOM_SPECULAR_IBL - vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); - #else - vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); - #endif - specularIBL *= F * brdfLut.x + brdfLut.y; - #else - vec3 specularIBL = vec3(0.0); - #endif - - return diffuseColor * diffuseIrradiance + specularColor * specularIBL; -} -#endif - -vec3 imageBasedLightingStage( - vec3 positionEC, - vec3 normalEC, - vec3 lightDirectionEC, - vec3 lightColorHdr, - czm_pbrParameters pbrParameters -) { - #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) - // Environment maps were provided, use them for IBL - return textureIBL( - positionEC, - normalEC, - lightDirectionEC, - pbrParameters - ); - #else - // Use the procedural IBL if there are no environment maps - return proceduralIBL( - positionEC, - normalEC, - lightDirectionEC, - lightColorHdr, - pbrParameters - ); - #endif -}`;var Ene={name:"ImageBasedLightingPipelineStage"};Ene.process=function(e,t,n){let i=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,be.FRAGMENT),r.addUniform("vec2","model_iblFactor",be.FRAGMENT),pm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",be.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,be.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",be.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,be.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,be.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",be.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",be.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",be.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,be.FRAGMENT)),l(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,be.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",be.FRAGMENT)),r.addFragmentLines(CL);let o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=gt(o,e.uniformMap)};var TL=Ene;var tVe=P.EPSILON16;function i6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(i6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,tVe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var nVe=new m,n6=new Z;i6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=nVe,r;switch(t){case Ec.XROTATE:r=Z.fromRotationX(P.toRadians(n),n6),e=B.multiplyByMatrix3(e,r,e);break;case Ec.YROTATE:r=Z.fromRotationY(P.toRadians(n),n6),e=B.multiplyByMatrix3(e,r,e);break;case Ec.ZROTATE:r=Z.fromRotationZ(P.toRadians(n),n6),e=B.multiplyByMatrix3(e,r,e);break;case Ec.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case Ec.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case Ec.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=B.multiplyByTranslation(e,i,e);break;case Ec.XSCALE:i.x=n,i.y=1,i.z=1,e=B.multiplyByScale(e,i,e);break;case Ec.YSCALE:i.x=1,i.y=n,i.z=1,e=B.multiplyByScale(e,i,e);break;case Ec.ZSCALE:i.x=1,i.y=1,i.z=n,e=B.multiplyByScale(e,i,e);break;case Ec.UNIFORMSCALE:e=B.multiplyByUniformScale(e,n,e);break;default:break}return e};var EL=i6;function bL(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,iVe(this)}Object.defineProperties(bL.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function iVe(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new EL({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}bL.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var rVe=new B,oVe=new B;bL.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=B.clone(B.IDENTITY,rVe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=B.multiplyTransformation(s.originalTransform,e,oVe);s.transform=a}};var SL=bL;var vL=`void modelColorStage(inout czm_modelMaterial material) -{ - material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); - material.alpha *= model_color.a; -}`;var eT={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};eT.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,be.FRAGMENT),i.addFragmentLines(vL);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Se.TRANSLUCENT),i.addUniform("vec4",eT.COLOR_UNIFORM_NAME,be.FRAGMENT),r[eT.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",eT.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),r[eT.COLOR_BLEND_UNIFORM_NAME]=function(){return Tc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=gt(r,e.uniformMap)};var O0=eT;var wL=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -#else -// Handle uint8 clipping texture instead -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each - int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); - return czm_transformPlane(plane, transform); -} -#endif - -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float pixelWidth = czm_metersPerPixel(position); - - #ifdef UNION_CLIPPING_REGIONS - float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. - #else - float clipAmount = 0.0; - bool clipped = true; - #endif - - for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - - #ifdef UNION_CLIPPING_REGIONS - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) { - discard; - } - #else - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - #endif - } - - #ifndef UNION_CLIPPING_REGIONS - if (clipped) { - discard; - } - #endif - - return clipAmount; -} - -void modelClippingPlanesStage(inout vec4 color) -{ - float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; - - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } -} -`;var bne={name:"ModelClippingPlanesPipelineStage"},sVe=new H;bne.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,be.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,be.FRAGMENT),As.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,be.FRAGMENT);let s=As.getTextureResolution(i,r,sVe);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,be.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,be.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",be.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",be.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",be.FRAGMENT),o.addFragmentLines(wL);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=gt(a,e.uniformMap)};var DL=bne;function Sne(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Sne.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var IL=Sne;var PL=`mat4 getInstancingTransform() -{ - mat4 instancingTransform; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif - - return instancingTransform; -} - -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ - mat4 instancingTransform2D; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif - - return instancingTransform2D; -} -#endif -`;var OL=`void instancingStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var RL=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var ML=new B,aVe=new B,cVe=new B,wne={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Rne,_transformsToTypedArray:o6};wne.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(PL);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];EVe(e,n,i,f,u),vVe(e,n,i,f);let d={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",be.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",be.VERTEX),d.u_instance_modifiedModelView=function(){let p=B.multiplyTransformation(s.modelMatrix,a.components.transform,ML);return u?B.multiplyTransformation(n.context.uniformState.view3D,p,ML):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,ML)),B.multiplyTransformation(n.context.uniformState.view,p,ML))},d.u_instance_nodeTransform=function(){return B.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,aVe)},o.addVertexLines(RL)):o.addVertexLines(OL),u){o.addDefine("USE_2D_INSTANCING",void 0,be.VERTEX),o.addUniform("mat4","u_modelView2D",be.VERTEX);let p=n.context,g=B.fromTranslation(c.instancingReferencePoint2D,new B);d.u_modelView2D=function(){return B.multiplyTransformation(p.uniformState.view,g,cVe)}}e.uniformMap=gt(d,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,f)};var xv=new B,lVe=new m;function uVe(e,t,n,i,r){let o=B.multiplyTransformation(t,e,xv);return o=B.multiplyTransformation(o,n,xv),r=Mt.basisTo2D(i.mapProjection,o,r),r}function fVe(e,t,n,i,r){let o=B.fromTranslation(e,xv),s=B.multiplyTransformation(t,o,xv);s=B.multiplyTransformation(s,n,xv);let a=B.getTranslation(s,lVe);return r=Zi.computeActualWgs84Position(i,a,r),r}function Dne(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=B.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=B.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=B.clone(r.computedModelMatrix,t),t=B.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=B.clone(B.IDENTITY,n))}var Ine=new B,Pne=new B,dVe=new B,mVe=new m;function hVe(e,t,n,i){let r=Ine,o=Pne;Dne(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=uVe(f,r,o,n,dVe),p=B.getTranslation(d,mVe),g=m.subtract(p,a,p);i[u]=B.setTranslation(d,g,i[u])}return i}function pVe(e,t,n,i){let r=Ine,o=Pne;Dne(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=fVe(f,r,o,n,f);i[u]=m.subtract(d,a,i[u])}return i}var _Ve=new m,gVe=new m;function One(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=B.multiplyByPoint(i,n.instancingTranslationMin,_Ve),o=Zi.computeActualWgs84Position(t,r,r),s=B.multiplyByPoint(i,n.instancingTranslationMax,gVe),a=Zi.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=m.lerp(o,a,.5,new m)}function o6(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function yVe(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var AVe=new m,xVe=new Ne,CVe=new m;function Rne(e,t,n){let i=new Array(t),r=en.getAttributeBySemantic(e,qo.TRANSLATION),o=en.getAttributeBySemantic(e,qo.ROTATION),s=en.getAttributeBySemantic(e,qo.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=qn.dequantize(g,o.componentDatatype,o.type,t));let h;d?h=s.typedArray:(h=new Float32Array(t*3),h.fill(1));for(let x=0;x<t;x++){let C=new m(p[x*3],p[x*3+1],p[x*3+2],AVe);m.maximumByComponent(a,C,a),m.minimumByComponent(c,C,c);let T=new Ne(g[x*4],g[x*4+1],g[x*4+2],f?g[x*4+3]:1,xVe),E=new m(h[x*3],h[x*3+1],h[x*3+2],CVe),S=B.fromTranslationQuaternionRotationScale(C,T,E,new B);i[x]=S}let A=n.runtimeNode;return A.instancingTranslationMin=c,A.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function TVe(e,t,n){let i=new Array(t),r=e.typedArray,o=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new m(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,m.minimumByComponent(o,u,o),m.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function s6(e,t){let n=ht.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function EVe(e,t,n,i,r){let o=en.getAttributeBySemantic(n,qo.ROTATION);l(o)?bVe(e,n,i,t,r):SVe(e,n,i,t,r)}function bVe(e,t,n,i,r){let o=e.shaderBuilder,s=t.attributes[0].count,a=e.model,c=e.runtimeNode;o.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",f,d=c.instancingTransformsBuffer;if(!l(d)){f=Rne(t,s,e);let A=o6(f);d=s6(A,i),a._modelResources.push(d),c.instancingTransformsBuffer=d}if(vne(e,d,n,u),!r)return;let p=Ye(i);p.mode=ne.COLUMBUS_VIEW,One(e,p);let g=c.instancingTransformsBuffer2D;if(!l(g)){let A=hVe(f,e,p,f),x=o6(A);g=s6(x,i),a._modelResources.push(g),c.instancingTransformsBuffer2D=g}vne(e,g,n,"Transform2D")}function SVe(e,t,n,i,r){let o=e.shaderBuilder,s=e.runtimeNode,a=en.getAttributeBySemantic(t,qo.TRANSLATION),c=en.getAttributeBySemantic(t,qo.SCALE);if(l(c)){o.addDefine("HAS_INSTANCE_SCALE");let C="Scale";r6(e,c.buffer,c.byteOffset,c.byteStride,n,C)}if(!l(a))return;let u,f=a.typedArray;l(f)?u=TVe(a,a.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=a.min,s.instancingTranslationMax=a.max),o.addDefine("HAS_INSTANCE_TRANSLATION");let d="Translation";if(r6(e,a.buffer,a.byteOffset,a.byteStride,n,d),!r)return;let p=Ye(i);p.mode=ne.COLUMBUS_VIEW,One(e,p);let g=s.instancingTranslationBuffer2D;if(!l(g)){let C=pVe(u,e,p,u),T=yVe(C);g=s6(T,i),e.model._modelResources.push(g),s.instancingTranslationBuffer2D=g}r6(e,g,0,void 0,n,"Translation2D")}function vne(e,t,n,i){let o=X.getSizeInBytes(X.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function r6(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function vVe(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===qo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:ln.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var BL=wne;var a6={};a6.name="ModelMatrixUpdateStage";a6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;Mne(e,t,r,e.transformToRoot),e._transformDirty=!1}};function Mne(e,t,n,i){let r;i=B.multiplyTransformation(i,e.transform,new B),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let c=e.runtimePrimitives[r].drawCommand;c.modelMatrix=B.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=en.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(r=0;r<s;r++){let a=t._runtimeNodes[e.children[r]];a._transformToRoot=B.clone(i,a._transformToRoot),Mne(a,t,n,i),a._transformDirty=!1}}var LL=a6;var Bne={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Lne,_countGeneratedBuffers:Nne};Bne.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;Lne(i,r),Nne(i,o)};function Lne(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Nne(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var NL=Bne;function tT(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=B.clone(n,this._originalTransform),this._transform=B.clone(n,this._transform),this._transformToRoot=B.clone(i,this._transformToRoot),this._computedTransform=new B,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,wVe(this)}Object.defineProperties(tT.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=B.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),c6(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Ne.equals(n,e)||(t.rotation=Ne.clone(e,t.rotation),c6(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),c6(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function wVe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=B.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new m0(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function c6(e,t){e._transformDirty=!0,e._transform=B.fromTranslationRotationScale(t,e._transform)}tT.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};tT.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(BL),t.push(NL),n.push(LL)};tT.prototype.updateComputedTransform=function(){this._computedTransform=B.multiply(this._transformToRoot,this._transform,this._computedTransform)};tT.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new B);let o=B.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=B.inverseTransformation(o,t[r]);t[r]=B.multiplyTransformation(s,n[r],t[r])}};var FL=tT;var Fne={name:"AlphaPipelineStage"};Fne.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=y(i.pass,r.opaquePass);let o=e.renderStateOptions;i.pass===Se.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=hn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,be.FRAGMENT),s.addUniform("float","u_alphaCutoff",be.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var UL=Fne;var Une={name:"BatchTexturePipelineStage"};Une.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=gt(r,e.uniformMap)};var VL=Une;var Vne={name:"ClassificationPipelineStage"};Vne.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,be.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||DVe(t,r)};function DVe(e,t){let n=en.getAttributeBySemantic(e,bt.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=en.getAttributeBySemantic(e,bt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let A=1;A<s;A++){let x=o?i[A]:A,C=c[x];if(C!==p){let T=A-g,E=A;u.push(T),f.push(E),g=E,p=C}}let h=s-g;u.push(h),t.batchLengths=u,t.batchOffsets=f}var kL=Vne;var zL=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - positionMC *= float(model_silhouettePass); - #else - positionMC *= 0.0; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - positionMC *= 0.0; - } -} - -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ - float show = ceil(feature.color.a); - positionMC *= show; - - #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) - filterByPassType(positionMC, feature.color); - #endif -} -`;var HL=`void filterByPassType(vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - if(!model_silhouettePass) { - discard; - } - #else - discard; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - discard; - } -} - -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ - vec4 featureColor = feature.color; - if (featureColor.a == 0.0) - { - discard; - } - - // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. - // So, we only apply in in the fragment shader if the feature ID texture is used. - #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) - filterByPassType(featureColor); - #endif - - featureColor = czm_gammaCorrect(featureColor); - - // Classification models compute the diffuse differently. - #ifdef HAS_CLASSIFICATION - material.diffuse = featureColor.rgb * featureColor.a; - #else - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); - #endif - - material.alpha *= featureColor.a; -} -`;var kne={name:"CPUStylingPipelineStage"};kne.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(zL),r.addFragmentLines(HL),r.addDefine("USE_CPU_STYLING",void 0,be.BOTH),l(i.color)||(r.addUniform("float",O0.COLOR_BLEND_UNIFORM_NAME,be.FRAGMENT),e.uniformMap[O0.COLOR_BLEND_UNIFORM_NAME]=function(){return Tc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",be.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Se.TRANSLUCENT}};var GL=kne;var zne={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};zne.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var ig=Object.freeze(zne);var WL=`void customShaderStage( - inout czm_modelVertexOutput vsOutput, - inout ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // VertexInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - VertexInput vsInput; - initializeInputStruct(vsInput, attributes); - vsInput.featureIds = featureIds; - vsInput.metadata = metadata; - vsInput.metadataClass = metadataClass; - vsInput.metadataStatistics = metadataStatistics; - vertexMain(vsInput, vsOutput); - attributes.positionMC = vsOutput.positionMC; -} -`;var jL=`void customShaderStage( - inout czm_modelMaterial material, - ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // FragmentInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - FragmentInput fsInput; - initializeInputStruct(fsInput, attributes); - fsInput.featureIds = featureIds; - fsInput.metadata = metadata; - fsInput.metadataClass = metadataClass; - fsInput.metadataStatistics = metadataStatistics; - fragmentMain(fsInput, material); -} -`;var YL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var qL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Oi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Oi.process=function(e,t,n){let i=e.shaderBuilder;IVe(i);let r=e.runtimeNode.node.instances;l(r)&&PVe(e,r,n),OVe(e,t,n),i.addVertexLines(qL),i.addFragmentLines(YL)};function IVe(e){e.addStruct(Oi.STRUCT_ID_FEATURE_IDS_VS,Oi.STRUCT_NAME_FEATURE_IDS,be.VERTEX),e.addStruct(Oi.STRUCT_ID_FEATURE_IDS_FS,Oi.STRUCT_NAME_FEATURE_IDS,be.FRAGMENT),e.addFunction(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Oi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.VERTEX),e.addFunction(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Oi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,be.FRAGMENT),e.addFunction(Oi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Oi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.VERTEX),e.addFunction(Oi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Oi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,be.FRAGMENT),e.addFunction(Oi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Oi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,be.VERTEX)}function PVe(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Nt.FeatureIdAttribute?RVe(e,s,a):Hne(e,s,a,r,1,n);let c=s.label;l(c)&&Gne(e,a,c,be.BOTH)}}function OVe(e,t,n){let i=t.featureIds,o=en.getAttributeBySemantic(t,bt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=be.BOTH;a instanceof Nt.FeatureIdAttribute?MVe(e,a,c):a instanceof Nt.FeatureIdImplicitRange?Hne(e,a,c,o,void 0,n):(BVe(e,a,c,s,n),u=be.FRAGMENT);let f=a.label;l(f)&&Gne(e,c,f,u)}}function RVe(e,t,n){let i=e.shaderBuilder;i.addStructField(Oi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Oi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Oi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function MVe(e,t,n){let i=e.shaderBuilder;i.addStructField(Oi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Oi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Hne(e,t,n,i,r,o){LVe(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Oi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Oi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Oi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function BVe(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return y(a.texture,r.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Oi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,be.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,d=`texture(${o}, ${f}).${c}`,p=`featureIds.${n} = czm_unpackUint(${d});`;u.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Gne(e,t,n,i){let r=e.shaderBuilder,o=be.includesVertexShader(i);o&&r.addStructField(Oi.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(Oi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(Oi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function LVe(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=NVe(t,n);s=ht.createVertexBuffer({context:r.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s);let f=!1;o.statistics.addBuffer(s,f)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function NVe(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var R0=Oi;var XL=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); -} -`;var KL=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); - setMetadataVaryings(); -} -`;var Ai={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ai.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=FVe(o.propertyAttributes,t,a),u=VVe(o.propertyTextures,a),f=c.concat(u);zVe(i,f),WVe(i),i.addVertexLines(KL),i.addFragmentLines(XL);for(let d=0;d<c.length;d++){let p=c[d];jVe(e,p)}for(let d=0;d<u.length;d++){let p=u[d];qVe(e,p)}};function FVe(e,t,n){return l(e)?e.flatMap(i=>UVe(i,t,n)):[]}function UVe(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=en,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:h,variableName:A}=r(g);u[f]={metadataVariable:o(d),property:p,type:p.classProperty.type,glslType:h,variableName:A,propertyStatistics:a?.properties[d],shaderDestination:be.BOTH}}return u}function VVe(e,t){return l(e)?e.flatMap(n=>kVe(n,t)):[]}function kVe(e,t){let{sanitizeGlslIdentifier:n}=en,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:be.FRAGMENT}}return s}function zVe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==Yt.ENUM&&i.add(u)}let r=Ai.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Ai.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,be.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?GVe(c):c;e.addStructField(a,p,d)}}}var HVe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function GVe(e){let t=HVe[e];return l(t)?t:e}function WVe(e){e.addStruct(Ai.STRUCT_ID_METADATA_VS,Ai.STRUCT_NAME_METADATA,be.VERTEX),e.addStruct(Ai.STRUCT_ID_METADATA_FS,Ai.STRUCT_NAME_METADATA,be.FRAGMENT),e.addStruct(Ai.STRUCT_ID_METADATA_CLASS_VS,Ai.STRUCT_NAME_METADATA_CLASS,be.VERTEX),e.addStruct(Ai.STRUCT_ID_METADATA_CLASS_FS,Ai.STRUCT_NAME_METADATA_CLASS,be.FRAGMENT),e.addStruct(Ai.STRUCT_ID_METADATA_STATISTICS_VS,Ai.STRUCT_NAME_METADATA_STATISTICS,be.VERTEX),e.addStruct(Ai.STRUCT_ID_METADATA_STATISTICS_FS,Ai.STRUCT_NAME_METADATA_STATISTICS,be.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,Ai.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.VERTEX),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,Ai.FUNCTION_SIGNATURE_INITIALIZE_METADATA,be.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_SET_METADATA_VARYINGS,Ai.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,be.VERTEX)}function jVe(e,t){YVe(e,t),Wne(e.shaderBuilder,t),jne(e.shaderBuilder,t)}function YVe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=qne({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:be.BOTH,property:r});n.addStructField(Ai.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ai.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function qVe(e,t){XVe(e,t),Wne(e.shaderBuilder,t),jne(e.shaderBuilder,t)}function XVe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:r,glslType:o,property:s}=t,{texCoord:a,channels:c,index:u,texture:f}=s.textureReader,d=`u_propertyTexture_${u}`;i.hasOwnProperty(d)||(n.addUniform("sampler2D",d,be.FRAGMENT),i[d]=()=>f),n.addStructField(Ai.STRUCT_ID_METADATA_FS,o,r);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),A=qne({valueExpression:h,renderResources:e,glslType:o,metadataVariable:r,shaderDestination:be.FRAGMENT,property:s}),x=`metadata.${r} = ${A};`;n.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,[x])}function Wne(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=Yne(Ai.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Ai.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,s),be.includesVertexShader(o)&&(e.addStructField(Ai.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function jne(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===Yt.ENUM)return;let s=Ai.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Yne(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Ai.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_FS,c),be.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ai.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Yne(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function qne(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}var Qf=Ai;var KVe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},M0=Object.freeze(KVe);var Xo={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Rt};Xo.process=function(e,t,n){let i=e.model.customShader;if(i&&Xo.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let r=n_.getCache(e.model._marsOptions.customShaders);for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&Xo.process_original(e,t,n,r[o])}};Xo.process_original=function(e,t,n,i){let r=e.shaderBuilder;l(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let o=e.alphaOptions;i.translucencyMode===M0.TRANSLUCENT?o.pass=Se.TRANSLUCENT:i.translucencyMode===M0.OPAQUE&&(o.pass=void 0);let s=ike(i,t);if(!s.customShaderEnabled)return;if(ake(r,i,s),s.shouldComputePositionWC&&r.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,be.BOTH),l(i.vertexShaderText)&&r.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,be.VERTEX),l(i.fragmentShaderText)){r.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,be.FRAGMENT);let u=ig.getDefineName(i.mode);r.addDefine(u,void 0,be.FRAGMENT)}let a=i.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];r.addUniform(f.type,u)}let c=i.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];r.addVarying(f,u)}e.uniformMap=gt(e.uniformMap,i.uniformMap)};function JVe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n],r=en.getAttributeInfo(i);t[r.variableName]=r}return t}var ZVe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},QVe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Xne(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=ZVe[t],i=QVe[t];if(l(n))return{attributeField:[n,e],value:i}}function $Ve(e,t,n){let i=Kne(t,e.usedVariablesVertex.attributeSet,!1),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let d=[r[s].glslType,s];c.push(d),a=`vsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let f=0;f<o.length;f++){s=o[f];let d=Xne(s);if(!l(d)){Xo._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${s}, disabling custom vertex shader`);return}c.push(d.attributeField),a=`vsInput.attributes.${s} = ${d.value};`,u.push(a)}n.enabled=!0,n.attributeFields=c,n.initializationLines=u}function eke(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function tke(e,t,n){let i=Kne(t,e.usedVariablesFragment.attributeSet,!0),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let p=[r[s].glslType,s];c.push(p),a=`fsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let d=0;d<o.length;d++){s=o[d];let p=Xne(s);if(!l(p)){Xo._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${s}, disabling custom fragment shader.`);return}c.push(p.attributeField),a=`fsInput.attributes.${s} = ${p.value};`,u.push(a)}let f=eke(e);n.enabled=!0,n.attributeFields=c.concat(f.attributeFields),n.initializationLines=f.initializationLines.concat(u)}var nke={positionWC:!0,positionEC:!0};function Kne(e,t,n){let i,r,o={};for(r in e)if(e.hasOwnProperty(r)){let a=e[r];i=r,n&&r==="normalMC"?i="normalEC":n&&r==="tangentMC"&&(i="tangentEC"),t.hasOwnProperty(i)&&(o[i]=a)}let s=[];for(r in t)if(t.hasOwnProperty(r)){if(nke.hasOwnProperty(r))continue;i=r,n&&r==="normalEC"?i="normalMC":n&&r==="tangentEC"&&(i="tangentMC"),e.hasOwnProperty(i)||s.push(r)}return{addToShader:o,missingAttributes:s}}function ike(e,t){let n={enabled:!1},i={enabled:!1},r=JVe(t.attributes);l(e.vertexShaderText)&&$Ve(e,r,n),l(e.fragmentShaderText)&&tke(e,r,i);let s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:s}}function rke(e,t){let n,i=Xo.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,Xo.STRUCT_NAME_ATTRIBUTES,be.VERTEX);let r=t.attributeFields;for(n=0;n<r.length;n++){let a=r[n],c=a[0],u=a[1];e.addStructField(i,c,u)}i=Xo.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,Xo.STRUCT_NAME_VERTEX_INPUT,be.VERTEX),e.addStructField(i,Xo.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,R0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Qf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Qf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,Qf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Xo.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Xo.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,be.VERTEX);let s=t.initializationLines;e.addFunctionLines(o,s)}function oke(e,t){let n,i=Xo.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,Xo.STRUCT_NAME_ATTRIBUTES,be.FRAGMENT);let r,o,s,a=t.attributeFields;for(n=0;n<a.length;n++)r=a[n],o=r[0],s=r[1],e.addStructField(i,o,s);i=Xo.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,Xo.STRUCT_NAME_FRAGMENT_INPUT,be.FRAGMENT),e.addStructField(i,Xo.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,R0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Qf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Qf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,Qf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let c=Xo.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,Xo.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,be.FRAGMENT);let u=t.initializationLines;e.addFunctionLines(c,u)}var ske=[];function ake(e,t,n){let i=n.vertexLines,r=ske;i.enabled&&(rke(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,WL),e.addVertexLines(r));let o=n.fragmentLines;o.enabled&&(oke(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,jL),e.addFragmentLines(r))}var JL=Xo;var Cv={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Cv.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,be.VERTEX),i.addFunction(Cv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Cv.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,be.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===bt.POSITION,d=c.semantic===bt.TEXCOORD;if(o&&!f&&!d)continue;let p=en.getAttributeInfo(c);lke(i,p),cke(e,p)}};function cke(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,be.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,be.VERTEX),n.addUniform(c,a,be.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=Jne(u,0),f=Jne(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Jne(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function lke(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=uke(n,i):r=fke(n),e.addFunctionLines(Cv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function uke(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function fke(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var ZL=Cv;var QL=`void geometryStage(out ProcessedAttributes attributes) -{ - attributes.positionMC = v_positionMC; - attributes.positionEC = v_positionEC; - - #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER - attributes.positionWC = v_positionWC; - #endif - - #ifdef HAS_NORMALS - // renormalize after interpolation - attributes.normalEC = normalize(v_normalEC); - #endif - - #ifdef HAS_TANGENTS - attributes.tangentEC = normalize(v_tangentEC); - #endif - - #ifdef HAS_BITANGENTS - attributes.bitangentEC = normalize(v_bitangentEC); - #endif - - // Everything else is dynamically generated in GeometryPipelineStage - setDynamicVaryings(attributes); -} -`;var $L=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ - vec4 computedPosition; - - // Compute positions in different coordinate systems - vec3 positionMC = attributes.positionMC; - v_positionMC = positionMC; - v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - vec3 position2D = attributes.position2D; - vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; - computedPosition = czm_projection * vec4(positionEC, 1.0); - #else - computedPosition = czm_projection * vec4(v_positionEC, 1.0); - #endif - - // Sometimes the custom shader and/or style needs this - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) - // Note that this is a 32-bit position which may result in jitter on small - // scales. - v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - #endif - - #ifdef HAS_NORMALS - v_normalEC = normalize(normal * attributes.normalMC); - #endif - - #ifdef HAS_TANGENTS - v_tangentEC = normalize(normal * attributes.tangentMC); - #endif - - #ifdef HAS_BITANGENTS - v_bitangentEC = normalize(normal * attributes.bitangentMC); - #endif - - // All other varyings need to be dynamically generated in - // GeometryPipelineStage - setDynamicVaryings(attributes); - - return computedPosition; -} -`;var Tv=`vec2 computeSt(float featureId) -{ - float stepX = model_textureStep.x; - float centerX = model_textureStep.y; - - #ifdef MULTILINE_BATCH_TEXTURE - float stepY = model_textureStep.z; - float centerY = model_textureStep.w; - - float xId = mod(featureId, model_textureDimensions.x); - float yId = floor(featureId / model_textureDimensions.x); - - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); - #else - return vec2(centerX + (featureId * stepX), 0.5); - #endif -} - -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) -{ - int featureId = featureIds.SELECTED_FEATURE_ID; - - - if (featureId < model_featuresLength) - { - vec2 featureSt = computeSt(float(featureId)); - - feature.id = featureId; - feature.st = featureSt; - feature.color = texture(model_batchTexture, featureSt); - } - // Floating point comparisons can be unreliable in GLSL, so we - // increment the feature ID to make sure it's always greater - // then the model_featuresLength - a condition we check for in the - // pick ID, to avoid sampling the pick texture if the feature ID is - // greater than the number of features. - else - { - feature.id = model_featuresLength + 1; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - - #ifdef HAS_NULL_FEATURE_ID - if (featureId == model_nullFeatureId) { - feature.id = featureId; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - #endif -} -`;var Ev={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};Ev.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=dke(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),mke(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===be.BOTH&&i.addVertexLines(Tv),i.addFragmentLines(Tv)};function Zne(e){return e instanceof Nt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Qne(e){return e instanceof Nt.FeatureIdTexture?be.FRAGMENT:be.BOTH}function dke(e,t,n){let i,r;return l(t.instances)&&(r=en.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Qne(r),featureIdDefine:Zne(r)}):(r=en.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Qne(r),featureIdDefine:Zne(r)})}function mke(e){e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var B0=Ev;var xs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};xs.process=function(e,t,n){let i=e.shaderBuilder,r=e.model;i.addStruct(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",be.VERTEX),i.addStruct(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",be.FRAGMENT),i.addStruct(B0.STRUCT_ID_SELECTED_FEATURE,B0.STRUCT_NAME_SELECTED_FEATURE,be.BOTH),i.addFunction(xs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,xs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,be.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,xs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.VERTEX),i.addFunction(xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,xs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,be.FRAGMENT),r.type===Gr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,be.FRAGMENT);let s=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,u=t.attributes.length;for(let f=0;f<u;f++){let d=t.attributes[f],p=ln.getAttributeLocationCount(d.type),g=d.semantic===bt.POSITION,h;p>1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,hke(e,d,h,p,s,a)}Eke(i,t.attributes),t.primitiveType===Le.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines($L),i.addFragmentLines(QL)};function hke(e,t,n,i,r,o){let s=e.shaderBuilder,a=en.getAttributeInfo(t),c=r&&!o;i>1?gke(e,t,n,i):_ke(e,t,n,c),Ake(s,a,c),yke(s,a),l(t.semantic)&&pke(s,t),xke(s,a,r),Cke(s,a,c),Tke(s,a)}function pke(e,t){let n=t.semantic,i=t.setIndex;switch(n){case bt.NORMAL:e.addDefine("HAS_NORMALS");break;case bt.TANGENT:e.addDefine("HAS_TANGENTS");break;case bt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case bt.TEXCOORD:case bt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function _ke(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===bt.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===bt.POSITION,f=u?0:n,d=ln.getNumberOfComponents(o),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function gke(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.normalized,u=ln.getNumberOfComponents(o)/i,f=X.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let h=t.byteOffset+g*d,A={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:h,strideInBytes:p,normalize:a};e.attributes.push(A)}}function yke(e,t){let n=t.variableName,i=`v_${n}`,r;n==="normalMC"?(i="v_normalEC",r=t.glslType):n==="tangentMC"?(r="vec3",i="v_tangentEC"):r=t.glslType,e.addVarying(r,i)}function Ake(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===bt.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function xke(e,t,n){let i=xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,o=t.variableName;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,t.glslType,o),e.addStructField(r,t.glslType,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function Cke(e,t,n){let i=xs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function Tke(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(l(n)&&!l(i))return;let r=xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Eke(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===bt.NORMAL?n=!0:o.semantic===bt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var eN=xs;var tN=`#ifdef LIGHTING_PBR -vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes) -{ - czm_pbrParameters pbrParameters; - pbrParameters.diffuseColor = inputMaterial.diffuse; - pbrParameters.f0 = inputMaterial.specular; - pbrParameters.roughness = inputMaterial.roughness; - - #ifdef USE_CUSTOM_LIGHT_COLOR - vec3 lightColorHdr = model_lightColorHdr; - #else - vec3 lightColorHdr = czm_lightColorHdr; - #endif - - vec3 color = inputMaterial.diffuse; - #ifdef HAS_NORMALS - color = czm_pbrLighting( - attributes.positionEC, - inputMaterial.normalEC, - czm_lightDirectionEC, - lightColorHdr, - pbrParameters - ); - - #ifdef USE_IBL_LIGHTING - color += imageBasedLightingStage( - attributes.positionEC, - inputMaterial.normalEC, - czm_lightDirectionEC, - lightColorHdr, - pbrParameters - ); - #endif - #endif - - color *= inputMaterial.occlusion; - color += inputMaterial.emissive; - - // In HDR mode, the frame buffer is in linear color space. The - // post-processing stages (see PostProcessStageCollection) will handle - // tonemapping. However, if HDR is not enabled, we must tonemap else large - // values may be clamped to 1.0 - #ifndef HDR - color = czm_acesTonemapping(color); - #endif - - return color; -} -#endif - -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) -{ - // Even though the lighting will only set the diffuse color, - // pass all other properties so further stages have access to them. - vec3 color = vec3(0.0); - - #ifdef LIGHTING_PBR - color = computePbrLighting(material, attributes); - #else // unlit - color = material.diffuse; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - // The colors resulting from point cloud styles are adjusted differently. - color = czm_gammaCorrect(color); - #elif !defined(HDR) - // If HDR is not enabled, the frame buffer stores sRGB colors rather than - // linear colors so the linear value must be converted. - color = czm_linearToSrgb(color); - #endif - - material.diffuse = color; -} -`;var bke={UNLIT:0,PBR:1},cp=Object.freeze(bke);var $ne={name:"LightingPipelineStage"};$ne.process=function(e,t){let n=e.model,i=e.lightingOptions,r=e.shaderBuilder;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,be.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",be.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===cp.PBR?r.addDefine("LIGHTING_PBR",void 0,be.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,be.FRAGMENT),r.addFragmentLines(tN)};var nN=$ne;var iN=`// If the style color is white, it implies the feature has not been styled. -bool isDefaultStyleColor(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} - -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) -{ - vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); - vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; - return color; -} - -vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) -{ - return vec2(textureTransform * vec3(texCoord, 1.0)); -} - -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) -{ - // Geometry normal. This is already normalized - vec3 ng = attributes.normalEC; - - vec3 normal = ng; - #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) - vec2 normalTexCoords = TEXCOORD_NORMAL; - #ifdef HAS_NORMAL_TEXTURE_TRANSFORM - normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform); - #endif - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - // If derivatives are available (not IE 10), compute tangents - vec3 positionEC = attributes.positionEC; - vec3 pos_dx = dFdx(positionEC); - vec3 pos_dy = dFdy(positionEC); - vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0)); - vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0)); - vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); - t = normalize(t - ng * dot(ng, t)); - vec3 b = normalize(cross(ng, t)); - mat3 tbn = mat3(t, b, ng); - vec3 n = texture(u_normalTexture, normalTexCoords).rgb; - normal = normalize(tbn * (2.0 * n - 1.0)); - #endif - #endif - - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - normal = -normal; - } - #endif - - return normal; -} -#endif - -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) -{ - #ifdef HAS_NORMALS - material.normalEC = computeNormal(attributes); - #endif - - vec4 baseColorWithAlpha = vec4(1.0); - // Regardless of whether we use PBR, set a base color - #ifdef HAS_BASE_COLOR_TEXTURE - vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - - #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM - baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); - #endif - - baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); - - #ifdef HAS_BASE_COLOR_FACTOR - baseColorWithAlpha *= u_baseColorFactor; - #endif - #elif defined(HAS_BASE_COLOR_FACTOR) - baseColorWithAlpha = u_baseColorFactor; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - baseColorWithAlpha = v_pointCloudColor; - #elif defined(HAS_COLOR_0) - vec4 color = attributes.color_0; - // .pnts files store colors in the sRGB color space - #ifdef HAS_SRGB_COLOR - color = czm_srgbToLinear(color); - #endif - baseColorWithAlpha *= color; - #endif - - material.diffuse = baseColorWithAlpha.rgb; - material.alpha = baseColorWithAlpha.a; - - #ifdef USE_CPU_STYLING - material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); - #endif - - #ifdef HAS_OCCLUSION_TEXTURE - vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; - #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM - occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); - #endif - material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; - #endif - - #ifdef HAS_EMISSIVE_TEXTURE - vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; - #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM - emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); - #endif - - vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); - #ifdef HAS_EMISSIVE_FACTOR - emissive *= u_emissiveFactor; - #endif - material.emissive = emissive; - #elif defined(HAS_EMISSIVE_FACTOR) - material.emissive = u_emissiveFactor; - #endif - - #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE - vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM - specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); - #endif - - vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); - vec3 specular = specularGlossiness.rgb; - float glossiness = specularGlossiness.a; - #ifdef HAS_SPECULAR_FACTOR - specular *= u_specularFactor; - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - glossiness *= u_glossinessFactor; - #endif - #else - #ifdef HAS_SPECULAR_FACTOR - vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); - #else - vec3 specular = vec3(1.0); - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); - #else - float glossiness = 1.0; - #endif - #endif - - #ifdef HAS_DIFFUSE_TEXTURE - vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; - #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM - diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); - #endif - - vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); - #ifdef HAS_DIFFUSE_FACTOR - diffuse *= u_diffuseFactor; - #endif - #elif defined(HAS_DIFFUSE_FACTOR) - vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); - #else - vec4 diffuse = vec4(1.0); - #endif - czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial( - diffuse.rgb, - specular, - glossiness - ); - material.diffuse = parameters.diffuseColor; - // the specular glossiness extension's alpha overrides anything set - // by the base material. - material.alpha = diffuse.a; - material.specular = parameters.f0; - material.roughness = parameters.roughness; - #elif defined(LIGHTING_PBR) - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE - vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM - metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); - #endif - - vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; - float metalness = clamp(metallicRoughness.b, 0.0, 1.0); - float roughness = clamp(metallicRoughness.g, 0.04, 1.0); - #ifdef HAS_METALLIC_FACTOR - metalness *= u_metallicFactor; - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - roughness *= u_roughnessFactor; - #endif - #else - #ifdef HAS_METALLIC_FACTOR - float metalness = clamp(u_metallicFactor, 0.0, 1.0); - #else - float metalness = 1.0; - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - float roughness = clamp(u_roughnessFactor, 0.04, 1.0); - #else - float roughness = 1.0; - #endif - #endif - czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial( - material.diffuse, - metalness, - roughness - ); - material.diffuse = parameters.diffuseColor; - material.specular = parameters.f0; - material.roughness = parameters.roughness; - #endif -} -`;var Ske=Nt.Material,l6=Nt.MetallicRoughness,u6=Nt.SpecularGlossiness,eie={name:"MaterialPipelineStage",_processTexture:rg,_processTextureTransform:tie};eie.process=function(e,t,n){let i=t.material,r=e.model,o=l(r.classificationType),s=o,a=e.uniformMap,c=e.shaderBuilder,u=n.context.defaultTexture,f=n.context.defaultNormalTexture,d=n.context.defaultEmissiveTexture;vke(i,a,c,u,f,d,s),l(i.specularGlossiness)?wke(i,a,c,u,s):Dke(i,a,c,u,s);let p=en.getAttributeBySemantic(t,bt.NORMAL),g=e.lightingOptions;i.unlit||!p||o?g.lightingModel=cp.UNLIT:g.lightingModel=cp.PBR;let h=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let A=e.alphaOptions;i.alphaMode===Qh.BLEND?A.pass=Se.TRANSLUCENT:i.alphaMode===Qh.MASK&&(A.alphaCutoff=i.alphaCutoff),c.addFragmentLines(iN),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,be.BOTH)};function tie(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,be.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,be.FRAGMENT),t[s]=function(){return n.transform}}function rg(e,t,n,i,r,o){e.addUniform("sampler2D",i,be.FRAGMENT),t[i]=function(){return y(n.texture,o)};let s=`HAS_${r}_TEXTURE`;e.addDefine(s,void 0,be.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${r}`;e.addDefine(u,c,be.FRAGMENT);let f=n.transform;l(f)&&!Z.equals(f,Z.IDENTITY)&&tie(e,t,n,i,r)}function vke(e,t,n,i,r,o,s){let a=e.emissiveFactor;if(l(a)&&!m.equals(a,Ske.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",be.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,be.FRAGMENT);let f=e.emissiveTexture;l(f)&&!s&&rg(n,t,f,"u_emissiveTexture","EMISSIVE",o)}let c=e.normalTexture;l(c)&&!s&&rg(n,t,c,"u_normalTexture","NORMAL",r);let u=e.occlusionTexture;l(u)&&!s&&rg(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function wke(e,t,n,i,r){let o=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,be.FRAGMENT);let s=o.diffuseTexture;l(s)&&!r&&rg(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=o.diffuseFactor;l(a)&&!oe.equals(a,u6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",be.FRAGMENT),t.u_diffuseFactor=function(){return o.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,be.FRAGMENT));let c=o.specularGlossinessTexture;l(c)&&!r&&rg(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let u=o.specularFactor;l(u)&&!m.equals(u,u6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",be.FRAGMENT),t.u_specularFactor=function(){return o.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,be.FRAGMENT));let f=o.glossinessFactor;l(f)&&f!==u6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",be.FRAGMENT),t.u_glossinessFactor=function(){return o.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,be.FRAGMENT))}function Dke(e,t,n,i,r){let o=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,be.FRAGMENT);let s=o.baseColorTexture;l(s)&&!r&&rg(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=o.baseColorFactor;l(a)&&!oe.equals(a,l6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",be.FRAGMENT),t.u_baseColorFactor=function(){return o.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,be.FRAGMENT));let c=o.metallicRoughnessTexture;l(c)&&!r&&rg(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=o.metallicFactor;l(u)&&u!==l6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",be.FRAGMENT),t.u_metallicFactor=function(){return o.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,be.FRAGMENT));let f=o.roughnessFactor;l(f)&&f!==l6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",be.FRAGMENT),t.u_roughnessFactor=function(){return o.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,be.FRAGMENT))}var rN=eie;var oN=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - attributes.positionMC = getMorphedPosition(positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = getMorphedNormal(normalMC); - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = getMorphedTangent(tangentMC); - #endif -}`;var _a={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};_a.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,be.VERTEX),Bke(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==bt.POSITION&&p!==bt.NORMAL&&p!==bt.TANGENT||(Pke(e,d,e.attributeIndex,a),e.attributeIndex++)}}Lke(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,be.VERTEX),n.addVertexLines(oN);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=gt(s,e.uniformMap)};var Ike={attributeString:void 0,functionId:void 0};function Pke(e,t,n,i){let r=e.shaderBuilder;Oke(e,t,n);let o=Rke(t,Ike);Mke(r,o,i)}function Oke(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:ln.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Rke(e,t){switch(e.semantic){case bt.POSITION:t.attributeString="Position",t.functionId=_a.FUNCTION_ID_GET_MORPHED_POSITION;break;case bt.NORMAL:t.attributeString="Normal",t.functionId=_a.FUNCTION_ID_GET_MORPHED_NORMAL;break;case bt.TANGENT:t.attributeString="Tangent",t.functionId=_a.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Mke(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function Bke(e){e.addFunction(_a.FUNCTION_ID_GET_MORPHED_POSITION,_a.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,be.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(_a.FUNCTION_ID_GET_MORPHED_NORMAL,_a.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,be.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(_a.FUNCTION_ID_GET_MORPHED_TANGENT,_a.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,be.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function Lke(e){let t="return morphedPosition;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(_a.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var sN=_a;var nie={name:"PickingPipelineStage"};nie.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)Nke(e,t,a,i);else if(l(a))Fke(e,i);else{let c=iie(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",be.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function iie(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Gr.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function Nke(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=en.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=en.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",be.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function Fke(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=iie(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let h=g.color;r[d*4+0]=z.floatToByte(h.red),r[d*4+1]=z.floatToByte(h.green),r[d*4+2]=z.floatToByte(h.blue),r[d*4+3]=z.floatToByte(h.alpha)}o._pickIds=i;let a=ht.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;o.statistics.addBuffer(a,c),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,be.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var aN=nie;var Uke={ADD:0,REPLACE:1},Wr=Object.freeze(Uke);var cN=`float getPointSizeFromAttenuation(vec3 positionEC) { - // Variables are packed into a single vector to minimize gl.uniformXXX() calls - float pointSize = model_pointCloudParameters.x; - float geometricError = model_pointCloudParameters.y; - float depthMultiplier = model_pointCloudParameters.z; - - float depth = -positionEC.z; - return min((geometricError / depth) * depthMultiplier, pointSize); -} - -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#endif - -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); -} -#endif - -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - return getPointSizeFromAttenuation(v_positionEC); -} -#endif - -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { - #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) - // This needs to be computed in eye coordinates so we can't use attributes.normalMC - return step(-v_normalEC.z, 0.0); - #else - return 1.0; - #endif -} -#endif`;var Vke=new oe,oie={name:"PointCloudStylingPipelineStage"};oie.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let A=Gke(a),x=Wke(o,A);jke(i,x);let T=Yke(x).indexOf("normalMC")>=0,E=en.getAttributeBySemantic(t,bt.NORMAL);if(T&&!E)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,be.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Se.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,be.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,be.VERTEX);let d,p,g;Gr.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Wr.ADD),i.addUniform("vec4","model_pointCloudParameters",be.VERTEX),i.addVertexLines(cN);let h=e.uniformMap;h.model_pointCloudParameters=function(){let A=Vke,x=1;p&&(x=g?5:d.tileset.maximumScreenSpaceError),A.x=y(f.maximumAttenuation,x),A.x*=n.pixelRatio;let C=kke(e,t,f,d);A.y=C*f.geometricErrorScale;let T=n.context,E=n.camera.frustum,S;return n.mode===ne.SCENE2D||E instanceof rn?S=Number.POSITIVE_INFINITY:S=T.drawingBufferHeight/n.camera.frustum.sseDenominator,A.z=S,p&&(A.w=d.tileset.timeSinceLoad),A}};var rie=new m;function kke(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=en.getAttributeBySemantic(t,bt.POSITION),o=r.count,s=e.runtimeNode.transform,a=m.subtract(r.max,r.min,rie);a=B.multiplyByPointAsVector(s,a,rie);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var zke={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Hke={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Gke(e){let t=Ye(Hke);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var f6="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Wke(e,t){let n=zke,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${f6})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${f6})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${f6})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function jke(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,be.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,be.VERTEX),e.addVertexLines(i));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,be.VERTEX),e.addVertexLines(r))}function d6(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Yke(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&d6(t,r),l(n)&&d6(n,r),l(i)&&d6(i,r),r}var lN=oie;var uN=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var fN=`void primitiveOutlineStage(inout czm_modelMaterial material) { - if (!model_showOutline) { - return; - } - - float outlineX = - texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; - float outlineY = - texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; - float outlineZ = - texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; - float outlineness = max(outlineX, max(outlineY, outlineZ)); - - material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); -} - -`;var sie={name:"PrimitiveOutlinePipelineStage"};sie.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,be.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:ln.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",be.FRAGMENT);let a=HC.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",be.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",be.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(uN),i.addFragmentLines(fN)};var dN=sie;var aie={name:"PrimitiveStatisticsPipelineStage",_countGeometry:cie,_count2DPositions:lie,_countMorphTargetAttributes:uie,_countMaterialTextures:fie,_countFeatureIdTextures:die,_countBinaryMetadata:mie};aie.process=function(e,t,n){let i=e.model,r=i.statistics;cie(r,t),lie(r,e.runtimePrimitive),uie(r,t),fie(r,t.material),die(r,t.featureIds),mie(r,i)};function cie(e,t){let n=l(t.indices)?t.indices.count:en.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Le.POINTS?e.pointsLength+=n:Le.isTriangles(i)&&(e.trianglesLength+=qke(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function qke(e,t){switch(e){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function lie(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function uie(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function fie(e,t){let n=Xke(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function Xke(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function die(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Nt.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function mie(e,t){let n=t.structuralMetadata;l(n)&&(Kke(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function Kke(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var mN=aie;var Jke=new B,Zke=new B,hie={name:"SceneMode2DPipelineStage"};hie.process=function(e,t,n){let i=en.getAttributeBySemantic(t,bt.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=B.multiplyTransformation(s,a,Jke),u=e4e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let A=i4e(i,c,u,n);f.positionBuffer2D=A,o._modelResources.push(A),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,be.VERTEX),r.addUniform("mat4","u_modelView2D",be.VERTEX);let p=B.fromTranslation(u.center,new B),g=n.context,h={u_modelView2D:function(){return B.multiplyTransformation(g.uniformState.view,p,Zke)}};e.uniformMap=gt(h,e.uniformMap)};var Qke=new m,$ke=new m;function e4e(e,t,n){let i=B.multiplyByPoint(t,e.positionMin,Qke),r=Zi.computeActualWgs84Position(n,i,i),o=B.multiplyByPoint(t,e.positionMax,$ke),s=Zi.computeActualWgs84Position(n,o,o);return ae.fromCornerPoints(r,s,new ae)}var pie=new m;function t4e(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,pie),c=m.multiplyComponents(a,o,a),u=m.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function n4e(e,t,n,i){let r;l(e.quantization)?r=t4e(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=m.fromArray(r,c,pie);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=B.multiplyByPoint(t,u,u),d=Zi.computeActualWgs84Position(i,f,f),p=m.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function i4e(e,t,n,i){let r=Ye(i);r.mode=ne.COLUMBUS_VIEW;let o=n.center,s=n4e(e,t,o,r),a=ht.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var hN=hie;var pN=`void skinningStage(inout ProcessedAttributes attributes) -{ - mat4 skinningMatrix = getSkinningMatrix(); - mat3 skinningMatrixMat3 = mat3(skinningMatrix); - - vec4 positionMC = vec4(attributes.positionMC, 1.0); - attributes.positionMC = vec3(skinningMatrix * positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = skinningMatrixMat3 * normalMC; - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = skinningMatrixMat3 * tangentMC; - #endif -}`;var L0={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};L0.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,be.VERTEX),o4e(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,be.VERTEX),n.addVertexLines(pN);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=gt(o,e.uniformMap)};function r4e(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===bt.JOINTS||o.semantic===bt.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function o4e(e,t){e.addFunction(L0.FUNCTION_ID_GET_SKINNING_MATRIX,L0.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,be.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(L0.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,r,o=["x","y","z","w"],s=r4e(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(L0.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}let a="return skinnedMatrix;";e.addFunctionLines(L0.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var _N=L0;var m6={};function s4e(e){let t=Ue.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function a4e(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function c4e(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function l4e(e,t){let i=t.length-2,r=2+i*4,o=Ue.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function u4e(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function f4e(e,t){let i=t.length-2,r=2+i*4,o=Ue.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}m6.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Le.TRIANGLES)return i?a4e(t,n):s4e(t);if(e===Le.TRIANGLE_STRIP)return i?l4e(t,n):c4e(t);if(e===Le.TRIANGLE_FAN)return i?f4e(t,n):u4e(t)};m6.getWireframeIndicesCount=function(e,t){return e===Le.TRIANGLES?t*2:e===Le.TRIANGLE_STRIP||e===Le.TRIANGLE_FAN?2+(t-2)*4:t};var bv=m6;var _ie={name:"WireframePipelineStage"};_ie.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,be.FRAGMENT);let r=e.model,o=d4e(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o;let s=!1;r.statistics.addBuffer(o,s);let a=e.primitiveType,c=e.count;e.primitiveType=Le.LINES,e.count=bv.getWireframeIndicesCount(a,c)};function d4e(e,t,n){let r=en.getAttributeBySemantic(e,bt.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):Ue.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=bv.createWireframeIndices(a,r,s),u=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return ht.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var gN=_ie;function gie(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}gie.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader;if(l(r._marsOptions)&&l(r._marsOptions.customShaders)){let O=n_.getCache(r._marsOptions.customShaders);for(let L in O)if(Object.prototype.hasOwnProperty.call(O,L)){o=O[L];break}}let s=r.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=l(n.morphTargets)&&n.morphTargets.length>0,d=l(i.skin),p=l(o),h=!(p&&l(o.fragmentShaderText))||o.mode!==ig.REPLACE_MATERIAL,A=en.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Le.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),C=r.pointCloudShading,T=l(C)&&C.attenuation,E=l(C)&&C.backFaceCulling,S=n.primitiveType===Le.POINTS&&(l(s)||T||E),w=r._enableShowOutline&&l(n.outlineCoordinates),D=m4e(r,i,n),R=l(r.classificationType);u&&t.push(hN),t.push(eN),x&&t.push(gN),R&&t.push(kL),f&&t.push(sN),d&&t.push(_N),S&&t.push(lN),A&&t.push(ZL),h&&t.push(rN),t.push(R0),t.push(Qf),D.hasPropertyTable&&(t.push(B0),t.push(VL),t.push(GL)),p&&t.push(JL),t.push(nN),r.allowPicking&&t.push(aN),w&&t.push(dN),t.push(UL),t.push(mN)};function m4e(e,t,n){let i;return l(t.instances)&&(i=en.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=en.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var yN=gie;function h6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],h4e(this)}Object.defineProperties(h6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function h4e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=yie(f,d,new B);a.push(p)}}function yie(e,t,n){let i=B.multiplyTransformation(e.transformToRoot,e.transform,n);return n=B.multiplyTransformation(i,t,n),n}h6.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=yie(i,r,e[n])}};var AN=h6;function p4e(){this.pass=void 0,this.alphaCutoff=void 0}var xN=p4e;function _4e(e){this.shaderBuilder=new jx,this.model=e,this.uniformMap={},this.alphaOptions=new xN,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:pc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var CN=_4e;var TN=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var EN=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { - #ifdef HAS_NORMALS - if(model_silhouettePass) { - vec3 normal = normalize(czm_normal3D * attributes.normalMC); - normal.x *= czm_projection[0][0]; - normal.y *= czm_projection[1][1]; - positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; - } - #endif -} -`;var bN={name:"ModelSilhouettePipelineStage"};bN.silhouettesLength=0;bN.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++bN.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,be.BOTH),i.addVertexLines(EN),i.addFragmentLines(TN),i.addUniform("vec4","model_silhouetteColor",be.FRAGMENT),i.addUniform("float","model_silhouetteSize",be.VERTEX),i.addUniform("bool","model_silhouettePass",be.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=gt(r,e.uniformMap),e.hasSilhouette=!0};var SN=bN;var vN=`void modelSplitterStage() -{ - // Don't split when rendering the shadow map, because it is rendered from - // the perspective of a totally different camera. -#ifndef SHADOW_MAP - if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var wN={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};wN.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,be.FRAGMENT),i.addFragmentLines(vN);let r={};i.addUniform("float",wN.SPLIT_DIRECTION_UNIFORM_NAME,be.FRAGMENT),r[wN.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=gt(r,e.uniformMap)};var DN=wN;function g4e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var IN=g4e;function y4e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,cp.UNLIT)}var PN=y4e;function A4e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:en.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=en.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new PN,this.pickId=void 0}var ON=A4e;function Yl(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=B.clone(B.IDENTITY),this._computedModelMatrix2D=B.clone(B.IDENTITY),this._axisCorrectionMatrix=en.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new B),this._runtimeArticulations={},x4e(this)}Object.defineProperties(Yl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function x4e(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;Aie(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let E=o[T],S=new SL({articulation:E,sceneGraph:e}),w=S.name;a[w]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=B.IDENTITY;for(let T=0;T<d;T++){let E=n.nodes[T],S=xie(e,E,p);e._rootNodes.push(S)}let g=t.skins,h=e._runtimeSkins,A=g.length;for(let T=0;T<A;T++){let E=g[T];h.push(new AN({skin:E,sceneGraph:e}))}let x=e._skinnedNodes,C=x.length;for(let T=0;T<C;T++){let E=x[T],S=e._runtimeNodes[E],D=c[E].skin.index;S._runtimeSkin=h[D],S.updateJointMatrices()}e.applyArticulations()}function Aie(e,t){let n=e._components,i=e._model;e._computedModelMatrix=B.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=B.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=B.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var C4e=new m;function T4e(e,t){let n=e._computedModelMatrix,i=B.getTranslation(n,C4e);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=Mt.wgs84To2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=B.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function xie(e,t,n){let i=[],r=en.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=B.multiplyTransformation(n,r,new B),g=xie(e,d,p);i.push(g)}let s=new FL({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new yN({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new IL(f,s);f._nodesByName[u]=d}return c}var E4e=new m,b4e=new m,S4e=new m,v4e=new m;Yl.prototype.buildDrawCommands=function(e){let t=this._model,n=new CN(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,r,o,s;for(r=0;r<i.length;r++)i[r].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,E4e),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,b4e);for(r=0;r<this._runtimeNodes.length;r++){let u=this._runtimeNodes[r];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new IN(n,u);for(o=0;o<f.length;o++)f[o].process(d,u.node,e);let p=u.computedTransform;for(o=0;o<u.runtimePrimitives.length;o++){let g=u.runtimePrimitives[o];g.configurePipeline(e);let h=g.pipelineStages,A=new ON(d,g);for(s=0;s<h.length;s++)h[s].process(A,g.primitive,e);g.boundingSphere=ae.clone(A.boundingSphere,new ae);let x=B.multiplyByPoint(p,A.positionMin,S4e),C=B.multiplyByPoint(p,A.positionMax,v4e);m.minimumByComponent(a,x,a),m.maximumByComponent(c,C,c);let T=AL(A,e);g.drawCommand=T}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Yl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;l(n.color)&&t.push(O0),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(TL),n.isClippingEnabled()&&t.push(DL),n.hasSilhouette(e)&&t.push(SN),l(n.splitDirection)&&n.splitDirection!==nl.NONE&&t.push(DN),Gr.is3DTiles(n.type)&&t.push(xL))};Yl.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};Yl.prototype.updateModelMatrix=function(e,t){Aie(this,e),t.mode!==ne.SCENE3D&&T4e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};Yl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Cie(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);Cie(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function RN(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];Cie(e,c,t,n,i)}}var w4e={backFaceCulling:void 0};Yl.prototype.updateBackFaceCulling=function(e){let t=w4e;t.backFaceCulling=e,RN(this,!1,D4e,t)};function D4e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var I4e={shadowMode:void 0};Yl.prototype.updateShadows=function(e){let t=I4e;t.shadowMode=e,RN(this,!1,P4e,t)};function P4e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var O4e={debugShowBoundingVolume:void 0};Yl.prototype.updateShowBoundingVolume=function(e){let t=O4e;t.debugShowBoundingVolume=e,RN(this,!1,R4e,t)};function R4e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Tie=[],M4e={frameState:void 0,hasSilhouette:void 0};Yl.prototype.pushDrawCommands=function(e){let t=Tie;t.length=0;let n=M4e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,RN(this,!0,B4e,n),e.commandList.push.apply(e.commandList,t)};function B4e(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=Tie,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!r.pick&&s.pushSilhouetteCommands(n,o)}Yl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};Yl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var MN=Yl;function nT(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Et}Object.defineProperties(nT.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});nT.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};nT.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};nT.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};nT.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var BN=nT;var vie=co(XI(),1);var Eie={},N0=Uint32Array.BYTES_PER_ELEMENT;Eie.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=N0;let r=i.getUint32(t,!0);if(r!==1)throw new de(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=N0,t+=N0;let o=i.getUint32(t,!0);if(o===0)throw new de("Feature table must have a byte length greater than zero");t+=N0;let s=i.getUint32(t,!0);t+=N0;let a=i.getUint32(t,!0);t+=N0;let c=i.getUint32(t,!0);t+=N0;let u=Mr(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Mr(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new bm(u,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!l(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let A=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(A)&&(A=m.unpack(A));let x=L4e(g,d);if(x.rtcCenter=A,x.pointsLength=h,!x.hasPositions){let C=N4e(g);x.positions=C,x.hasPositions=x.hasPositions||l(C)}if(!x.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let C=U4e(g);x.normals=C,x.hasNormals=x.hasNormals||l(C)}if(!x.hasColors){let C=F4e(g);x.colors=C,x.hasColors=x.hasColors||l(C),x.hasConstantColor=l(x.constantColor),x.isTranslucent=l(C)&&C.isTranslucent}if(!x.hasBatchIds){let C=V4e(g);x.batchIds=C,x.hasBatchIds=x.hasBatchIds||l(C)}if(x.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=C}return l(p)&&(p=new Uint8Array(p),x.batchTableJson=d,x.batchTableBinary=p),x};function L4e(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let h=s.byteOffset,A=s.byteLength;if(!l(r)||!l(h)||!l(A))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+A),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:gt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function N4e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:bt.POSITION,semantic:bt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:ln.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=(1<<16)-1,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(o))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:bt.POSITION,semantic:bt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:ln.VEC3,quantizedRange:r,quantizedVolumeOffset:m.unpack(o),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:ln.VEC3}}}function F4e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:bt.COLOR,semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:ln.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:bt.COLOR,semantic:bt.COLOR,setIndex:0,constantColor:o,componentDatatype:X.FLOAT,type:ln.VEC4,isQuantized:!1,isTranslucent:s}}}function U4e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:bt.NORMAL,semantic:bt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:ln.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:bt.NORMAL,semantic:bt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:ln.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:ln.VEC3}}}function V4e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:bt.FEATURE_ID,semantic:bt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:ln.SCALAR}}}var iT=Eie;var k4e=Nt.Components,z4e=Nt.Scene,H4e=Nt.Node,G4e=Nt.Primitive,W4e=Nt.Attribute,bie=Nt.Quantization,j4e=Nt.FeatureIdAttribute,Y4e=Nt.Material,q4e=Nt.MetallicRoughness;function og(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=wt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY}l(Object.create)&&(og.prototype=Object.create(ir.prototype),og.prototype.constructor=og);Object.defineProperties(og.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});og.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=iT.parse(this._arrayBuffer,this._byteOffset),this._state=wt.PROCESSING,this._promise=Promise.resolve(this)};og.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===wt.READY)return!0;if(this._state===wt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=X4e(this,e.context)}return!1};function X4e(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=z_.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&K4e(e,i,o),sze(e,t),e._state=wt.READY,e}).catch(function(o){e.unload(),e._state=wt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function K4e(e,t,n){e._state=wt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:bt.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:ln.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=m.fromElements(c,c,c),f=m.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,r.quantizedType=ln.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:bt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:ln.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=X.UNSIGNED_BYTE,r.quantizedType=ln.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:bt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:bt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:ln.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:J4e(u.componentsPerAttribute),componentType:Z4e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function J4e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Z4e(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function Sv(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new bie,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new bie;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new W4e;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=y(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=qn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=ht.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===bt.POSITION&&s&&(o.typedArray=i),o}var Sie,LN;function Q4e(e){if(!l(LN)){Sie=new vie.default(0),LN=new Array(e);for(let t=0;t<e;++t)LN[t]=Sie.random()}return LN}var $4e=new m,eze=new m,tze=new m;function nze(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Q4e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,$4e),u=m.fromElements(a,a,a,eze),f,d,p;if(e.isQuantized)c=m.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=m.unpack(t,d*3,tze),m.minimumByComponent(c,p,c),m.maximumByComponent(u,p,u);e.min=m.clone(c),e.max=m.clone(u)}var ize={name:bt.COLOR,semantic:bt.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:ln.VEC4,isQuantized:!1,isTranslucent:!1};function rze(e,t,n){let i=[],r,o=t.positions;return l(o)&&(nze(o),r=Sv(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=Sv(e,t.normals,n),i.push(r)),l(t.colors)?(r=Sv(e,t.colors,n),i.push(r)):(r=Sv(e,ize,n),i.push(r)),l(t.batchIds)&&(r=Sv(e,t.batchIds,n),i.push(r)),i}function oze(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableBinary,o=!l(e.batchIds);if(l(r)||e.hasDracoBatchTable){let s=y(n,i);return Q_({count:s,batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t})}return new za({schema:{},propertyTables:[]})}function sze(e,t){let n=e._parsedContent,i=new q4e;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Y4e;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Qh.BLEND);let s=!l(n.normals);r.unlit=s;let a=new G4e;if(a.attributes=rze(e,n,t),a.primitiveType=Le.POINTS,a.material=r,l(n.batchIds)){let g=new j4e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new H4e;c.index=0,c.primitives=[a];let u=new z4e;u.nodes=[c],u.upAxis=hr.Z,u.forwardAxis=hr.X;let f=new k4e;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=oze(n,d),d.length>0&&aze(e,a,d,t),l(n.rtcCenter)&&(f.transform=B.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=B.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function aze(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=ht.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}og.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var vv=og;function cr(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,Gr.GLTF),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=B.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=Z.clone(Z.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new fL(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Tc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Se.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,qe.NONE),this._heightDirty=this._heightReference!==qe.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new tp(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?As.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=B.clone(B.IDENTITY),this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new SC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,xn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Gr.GLTF&&Rt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new It(a)),this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,nl.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new BN,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._texturesLoadedPromise=void 0,this._completeLoad=void 0,this._rejectLoad=void 0,this._completeTexturesLoad=void 0,this._rejectTexturesLoad=void 0,l(this._loader._promise)?(this._readyPromise=Promise.resolve(this),this._texturesLoadedPromise=Promise.resolve(this)):(this._readyPromise=new Promise((c,u)=>{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(u(f),!1)}),this._loader instanceof vv?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,u)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(u(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!l(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad(en.getError("model",this._resource,c)))})),this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function NN(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function cze(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new mL({model:e,propertyTable:s});n.push(a)}return n}function lze(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=en.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=en.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function _6(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(cr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},readyPromise:{get:function(){return $("Model.readyPromise","Model.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.readyEvent instead."),this._readyPromise}},texturesLoadedPromise:{get:function(){return $("Model.texturesLoadedPromise","Model.texturesLoadedPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.texturesReadyEvent instead."),this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){_6(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=_6(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Iie(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Gr.GLTF&&Rt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(As.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});cr.prototype.getNode=function(e){return this._nodesByName[e]};cr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};cr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};cr.prototype.makeStyleDirty=function(){this._styleDirty=!0};cr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var uze=new B,fze=new Z,dze=new B;cr.prototype.update=function(e){let t=!1;try{t=mze(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")NN(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=en.getError("model",this._resource,n);NN(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=en.getError("model",this._resource,n);NN(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(pze(this,e),hze(this,e),_ze(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let o=en.getError("model",this._resource,new de("Failed to load model."));NN(o),this._rejectLoad=this._rejectLoad&&this._rejectLoad(o)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&cze(this,i);let r=new MN({model:this,modelComponents:n});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(gze(this),yze(this),Aze(this,e),xze(this),Cze(this,e),Tze(this,e),Eze(this,e),bze(this,e),this._defaultTexture=e.context.defaultTexture,Sze(this,e),vze(this,e),wze(this),Dze(this,e),Oze(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),Pze(this),Rze(this,e),Mze(this),Bze(this,e)}};function mze(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function hze(e,t){l(e._customShader)&&e._customShader.update(t)}function pze(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=n_.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function _ze(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function gze(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=lze(t,e),e._styleDirty=!0,e.resetDrawCommands())}function yze(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Aze(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&Die(e)}function Die(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=vm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function xze(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function Cze(e,t){e._silhouetteDirty&&(Pie(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Tze(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Eze(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function bze(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Sze(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function vze(e,t){B.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=B.clone(e.modelMatrix,e._modelMatrix))}var wm=new m,FN=new he;function wze(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===qe.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,r=e.modelMatrix;wm.x=r[12],wm.y=r[13],wm.z=r[14];let o=i.cartesianToCartographic(wm);if(!l(o)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=B.clone(r,new B));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(o,wie(e,i,o));let a=n.getHeight(o);if(l(a)){let c=wie(e,i,o);he.clone(o,FN),FN.height=a,i.cartographicToCartesian(FN,wm),c(wm)}e._heightDirty=!1,e._updateModelMatrix=!0}function Dze(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Iie(e,n),Ize(e,n,t)}function Iie(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function Ize(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);B.getTranslation(t,wm),e._sceneMode!==ne.SCENE3D&&Zi.computeActualWgs84Position(n,wm,wm);let s=e._boundingSphere.radius,a=Lze(wm,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Pze(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}function Oze(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let s=fze,a=uze;a=B.multiply(r.uniformState.view3D,i,a),s=B.getMatrix3(a,s),s=Z.getRotation(s,s),e._iblReferenceFrameMatrix=Z.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=dze;s=B.multiply(r.uniformState.view3D,i,s),s=B.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=B.inverseTranspose(s,e._clippingPlanesMatrix)}}function Rze(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Mze(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;let t=e._showCreditsOnScreen;l(e._credit)&&(e._credit.showOnScreen=t);let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++)n[s].showOnScreen=t;let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++)r[s].showOnScreen=t}function Bze(e,t){let n=Fze(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Uze(e,t),e._sceneGraph.pushDrawCommands(t))}var p6=new ae;function Lze(e,t,n){return p6.center=e,p6.radius=t,n.camera.getPixelSize(p6,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function wie(e,t,n){return function(i){if(e.heightReference===qe.RELATIVE_TO_GROUND){let o=t.cartesianToCartographic(i,FN);o.height+=n.height,t.cartographicToCartesian(o,i)}let r=e._clampedModelMatrix;B.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightDirty=!0}}var Nze=new m;function Fze(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=B.getTranslation(e.modelMatrix,Nze);Zi.computeActualWgs84Position(t,s,s),o=m.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Uze(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCreditToNextFrame(i);let r=e._resourceCredits,o=r.length;for(let c=0;c<o;c++)n.addCreditToNextFrame(r[c]);let s=e._gltfCredits,a=s.length;for(let c=0;c<a;c++)n.addCreditToNextFrame(s[c])}cr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};cr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Pie(e){return e.context.stencilBuffer}cr.prototype.hasSilhouette=function(e){return Pie(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};cr.prototype.hasSkipLevelOfDetail=function(e){if(!Gr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};cr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};cr.prototype.isDestroyed=function(){return!1};cr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let r=0;r<i;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};cr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};cr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};cr.fromGltf=function(e){$("Model.fromGltf","Model.fromGltf was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),r=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=ve.createIfNeeded(t);let o=new ep(n),a=l(e.content)?Gr.TILE_GLTF:Gr.GLTF,c=rT(o,a,e);return c.resource=n.gltfResource,new cr(c)};cr.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),r=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=ve.createIfNeeded(t);let o=new ep(n),a=l(e.content)?Gr.TILE_GLTF:Gr.GLTF,c=n.gltfResource,u=rT(o,a,e);u.resource=c;try{await o.load()}catch(g){throw o.destroy(),en.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new cr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let h=0;h<g;h++)d._resourceCredits.push(p[h])}return d};cr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new ZB(t);try{await n.load();let i=rT(n,Gr.TILE_B3DM,e);return new cr(i)}catch(i){throw n.destroy(),i}};cr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new vv(t);try{await n.load();let i=rT(n,Gr.TILE_PNTS,e);return new cr(i)}catch(i){throw n.destroy(),i}};cr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new rL(t);try{await n.load();let i=rT(n,Gr.TILE_I3DM,e);return new cr(i)}catch(i){throw n.destroy(),i}};cr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new $B(t),i=rT(n,Gr.TILE_GEOJSON,e);return new cr(i)};cr.prototype.applyColorAndShow=function(e){let t=this._color,n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,_6(t,this._color)&&this.resetDrawCommands()};cr.prototype.applyStyle=function(e){let t=this.type===Gr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Die(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function rT(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Dm=cr;function Cs(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Cs.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Cs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Cs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Cs.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Cs.prototype.applyStyle=function(e){this._model.style=e};Cs.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),l(r)&&l(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:jl.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Cs.fromGltf=async function(e,t,n,i){let r=new Cs(e,t,n),s=wv(e,t,r,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Dm.fromGltfAsync(s);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};Cs.fromB3dm=async function(e,t,n,i,r){let o=new Cs(e,t,n),a=wv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Dm.fromB3dm(a);return o._model=u,o._readyPromise=new Promise(f=>{o._resolveContent=f}),o};Cs.fromI3dm=async function(e,t,n,i,r){let o=new Cs(e,t,n),a=wv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Dm.fromI3dm(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Cs.fromPnts=async function(e,t,n,i,r){let o=new Cs(e,t,n),a=wv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=await Dm.fromPnts(a);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Cs.fromGeoJson=async function(e,t,n,i){let r=new Cs(e,t,n),s=wv(e,t,r,{geoJson:i,resource:n}),a=await Dm.fromGeoJson(s);return r._model=a,r._readyPromise=new Promise(c=>{r._resolveContent=c}),r};function wv(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Se.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return gt(i,r)}var lp=Cs;function $f(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties($f.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});$f.fromJson=function(e,t,n,i){let r=new $f(e,t,n);return r._tileset.loadTileset(r._resource,i,r._tile),r._ready=!0,r};$f.prototype.hasProperty=function(e,t){return!1};$f.prototype.getFeature=function(e){};$f.prototype.applyDebugSettings=function(e,t){};$f.prototype.applyStyle=function(e){};$f.prototype.update=function(e,t){};$f.prototype.isDestroyed=function(){return!1};$f.prototype.destroy=function(){return ue(this)};var UN=$f;var VN=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif - -uniform sampler2D u_atlas; - -#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_textureCoordinates; -in vec4 v_pickColor; -in vec4 v_color; - -#ifdef SDF -in vec4 v_outlineColor; -in float v_outlineWidth; +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR + color.rgb = pow(color.rgb, vec3(czm_gamma)); #endif - -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates -in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) -in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -in mat2 v_rotationMatrix; - -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT1 = 2.0; - -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; - -float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) + return color; +} +`;var jO=`/** + * DOC_TBA + * + * @name czm_geodeticSurfaceNormal + * @glslFunction + * + * @param {vec3} positionOnEllipsoid DOC_TBA + * @param {vec3} ellipsoidCenter DOC_TBA + * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA + * + * @returns {vec3} DOC_TBA. + */ +vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { - vec2 lookupVector = imageSize * (depthLookupST - adjustedST); - lookupVector = v_rotationMatrix * lookupVector; - vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal - - vec2 translation = v_originTextureCoordinateAndTranslate.zw; - - if (applyTranslate) - { - // this is only needed for labels where the horizontal origin is not LEFT - // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT - translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); - } - - vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - - if (logDepthOrDepth == 0.0) - { - return 0.0; // not on the globe - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - return eyeCoordinate.z / eyeCoordinate.w; + return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -#endif - - -#ifdef SDF - -// Get the distance from the edge of a glyph at a given position sampling an SDF texture. -float getDistance(vec2 position) +`;var qO=`/** + * An czm_material with default values. Every material's czm_getMaterial + * should use this default material as a base for the material it returns. + * The default normal value is given by materialInput.normalEC. + * + * @name czm_getDefaultMaterial + * @glslFunction + * + * @param {czm_materialInput} input The input used to construct the default material. + * + * @returns {czm_material} The default material. + * + * @see czm_materialInput + * @see czm_material + * @see czm_getMaterial + */ +czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { - return texture(u_atlas, position).r; + czm_material material; + material.diffuse = vec3(0.0); + material.specular = 0.0; + material.shininess = 1.0; + material.normal = materialInput.normalEC; + material.emission = vec3(0.0); + material.alpha = 1.0; + return material; } - -// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. -vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) +`;var YO=`/** + * Calculates the intensity of diffusely reflected light. + * + * @name czm_getLambertDiffuse + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * + * @returns {float} The intensity of the diffuse reflection. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { - float distance = getDistance(position); - - if (outlineWidth > 0.0) - { - // Don't get the outline edge exceed the SDF_EDGE - float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); - float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); - float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); - return vec4(sdfColor.rgb, sdfColor.a * alpha); - } - else - { - float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); - return vec4(v_color.rgb, v_color.a * alpha); - } + return max(dot(lightDirectionEC, normalEC), 0.0); } -#endif - -void main() +`;var XO=`/** + * Calculates the specular intensity of reflected light. + * + * @name czm_getSpecular + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * + * @returns {float} The intensity of the specular highlight. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { - vec4 color = texture(u_atlas, v_textureCoordinates); - -#ifdef SDF - float outlineWidth = v_outlineWidth; - vec4 outlineColor = v_outlineColor; - - // Get the current distance - float distance = getDistance(v_textureCoordinates); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float smoothing = fwidth(distance); - // Get an offset that is approximately half the distance to the neighbor pixels - // 0.354 is approximately half of 1/sqrt(2) - vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); - - // Sample the center point - vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); - - // Sample the 4 neighbors - vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); - vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); - - // Equally weight the center sample and the 4 neighboring samples - color = (center + color1 + color2 + color3 + color4)/5.0; -#else - // If no derivatives available (IE 10?), just do a single sample - float smoothing = 1.0/32.0; - color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif - - color = czm_gammaCorrect(color); -#else - color = czm_gammaCorrect(color); - color *= czm_gammaCorrect(v_color); -#endif - -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif - -#ifdef VECTOR_TILE - color *= u_highlightColor; -#endif - out_FragColor = color; - -#ifdef LOG_DEPTH - czm_writeLogDepth(); -#endif - -#ifdef FRAGMENT_DEPTH_CHECK - float temp = v_compressed.y; - - temp = temp * SHIFT_RIGHT1; - - float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; - bool enableDepthTest = temp2 != 0.0; - bool applyTranslate = floor(temp) != 0.0; - - if (enableDepthTest) { - temp = v_compressed.z; - temp = temp * SHIFT_RIGHT12; - - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); + vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); + float specular = max(dot(toReflectedLight, toEyeEC), 0.0); - temp = v_compressed.w; - temp = temp * SHIFT_RIGHT12; + // pow has undefined behavior if both parameters <= 0. + // Prevent this by making sure shininess is at least czm_epsilon2. + return pow(specular, max(shininess, czm_epsilon2)); +} +`;var KO=`/** + * @private + */ +vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +{ + float cosAngle = cos(angleInRadians); + float sinAngle = sin(angleInRadians); - vec2 imageSize; - imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; - imageSize.x = floor(temp); + // time dependent sampling directions + vec2 s0 = vec2(1.0/17.0, 0.0); + vec2 s1 = vec2(-1.0/29.0, 0.0); + vec2 s2 = vec2(1.0/101.0, 1.0/59.0); + vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); - vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; - adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); + // rotate sampling direction by specified angle + s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); + s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); + s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); + s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); - float epsilonEyeDepth = v_compressed.x + czm_epsilon1; - float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); + vec2 uv0 = (uv/103.0) + (time * s0); + vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); + vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); + vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); - // negative values go into the screen - if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) - { - float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner - if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) - { - float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner - if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) - { - discard; - } - } - } - } -#endif + uv0 = fract(uv0); + uv1 = fract(uv1); + uv2 = fract(uv2); + uv3 = fract(uv3); + vec4 noise = (texture(normalMap, uv0)) + + (texture(normalMap, uv1)) + + (texture(normalMap, uv2)) + + (texture(normalMap, uv3)); + // average and scale to between -1 and 1 + return ((noise / 4.0) - 0.5) * 2.0; } -`;var kN=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) -in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width -in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free -in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale -in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions -in vec2 sdf; // sdf outline color (rgb) and width (w) -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) -in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates -#endif -#ifdef VECTOR_TILE -in float a_batchId; -#endif - -out vec2 v_textureCoordinates; -#ifdef FRAGMENT_DEPTH_CHECK -out vec4 v_textureCoordinateBounds; -out vec4 v_originTextureCoordinateAndTranslate; -out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize -out mat2 v_rotationMatrix; -#endif +`;var JO=`/** + * Converts an HSB color (hue, saturation, brightness) to RGB + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_HSBToRGB + * @glslFunction + * + * @param {vec3} hsb The color in HSB. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -out vec4 v_pickColor; -out vec4 v_color; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; -#endif +const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -const float UPPER_BOUND = 32768.0; +vec3 czm_HSBToRGB(vec3 hsb) +{ + vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); + return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); +} +`;var ZO=`/** + * Converts an HSL color (hue, saturation, lightness) to RGB + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_HSLToRGB + * @glslFunction + * + * @param {vec3} rgb The color in HSL. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; +vec3 hueToRGB(float hue) +{ + float r = abs(hue * 6.0 - 3.0) - 1.0; + float g = 2.0 - abs(hue * 6.0 - 2.0); + float b = 2.0 - abs(hue * 6.0 - 4.0); + return clamp(vec3(r, g, b), 0.0, 1.0); +} -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; +vec3 czm_HSLToRGB(vec3 hsl) +{ + vec3 rgb = hueToRGB(hsl.x); + float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; + return (rgb - 0.5) * c + hsl.z; +} +`;var $O=`/** + * Adjusts the hue of a color. + * + * @name czm_hue + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the hue of the color in radians. + * + * @returns {float} The color with the hue adjusted. + * + * @example + * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) + */ +vec3 czm_hue(vec3 rgb, float adjustment) +{ + const mat3 toYIQ = mat3(0.299, 0.587, 0.114, + 0.595716, -0.274453, -0.321263, + 0.211456, -0.522591, 0.311135); + const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, + 1.0, -0.2721, -0.6474, + 1.0, -1.107, 1.7046); + + vec3 yiq = toYIQ * rgb; + float hue = atan(yiq.z, yiq.y) + adjustment; + float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); + + vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); + return toRGB * color; +} +`;var QO=`/** + * Converts a color in linear space to RGB space. + * + * @name czm_inverseGamma + * @glslFunction + * + * @param {vec3} color The color in linear space. + * @returns {vec3} The color in RGB space. + */ +vec3 czm_inverseGamma(vec3 color) { + return pow(color, vec3(1.0 / czm_gamma)); +} +`;var eR=`/** + * Determines if a time interval is empty. + * + * @name czm_isEmpty + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isEmpty(czm_raySegment interval) +{ + return (interval.stop < 0.0); +} +`;var tR=`/** + * Determines if a time interval is empty. + * + * @name czm_isFull + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isFull(czm_raySegment interval) +{ + return (interval.start == 0.0 && interval.stop == czm_infinity); +} +`;var nR=`/** + * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. + * + * @name czm_latitudeToWebMercatorFraction + * @glslFunction + * + * @param {float} latitude The geodetic latitude, in radians. + * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. + * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * + * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern + * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return + * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. + */ +float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) +{ + float sinLatitude = sin(latitude); + float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); + + return (mercatorY - southMercatorY) * oneOverMercatorHeight; +} +`;var iR=`/** + * Converts a linear RGB color to an sRGB color. + * + * @param {vec3|vec4} linearIn The color in linear color space. + * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + */ +vec3 czm_linearToSrgb(vec3 linearIn) +{ + return pow(linearIn, vec3(1.0/2.2)); +} -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +vec4 czm_linearToSrgb(vec4 linearIn) +{ + vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); + return vec4(srgbOut, linearIn.a); +} +`;var oR=`/** + * Computes distance from an point in 2D to a line in 2D. + * + * @name czm_lineDistance + * @glslFunction + * + * param {vec2} point1 A point along the line. + * param {vec2} point2 A point along the line. + * param {vec2} point A point that may or may not be on the line. + * returns {float} The distance from the point to the line. + */ +float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { + return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); +} +`;var rR=`/** + * Computes the luminance of a color. + * + * @name czm_luminance + * @glslFunction + * + * @param {vec3} rgb The color. + * + * @returns {float} The luminance. + * + * @example + * float light = czm_luminance(vec3(0.0)); // 0.0 + * float dark = czm_luminance(vec3(1.0)); // ~1.0 + */ +float czm_luminance(vec3 rgb) { - // Note the halfSize cannot be computed in JavaScript because it is sent via - // compressed vertex attributes that coerce it to an integer. - vec2 halfSize = imageSize * scale * 0.5; - halfSize *= ((direction * 2.0) - 1.0); + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); +} +`;var sR=`/** + * Computes the size of a pixel in meters at a distance from the eye. + * <p> + * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. + * </p> + * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +{ + float width = czm_viewport.z; + float height = czm_viewport.w; + float pixelWidth; + float pixelHeight; - vec2 originTranslate = origin * abs(halfSize); + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; -#if defined(ROTATION) || defined(ALIGNED_AXIS) - if (validAlignedAxis || rotation != 0.0) + if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) { - float angle = rotation; - if (validAlignedAxis) - { - vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); - angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / - (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); - } - - float cosTheta = cos(angle); - float sinTheta = sin(angle); - rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); - halfSize = rotationMatrix * halfSize; + float frustumWidth = right - left; + float frustumHeight = top - bottom; + pixelWidth = frustumWidth / width; + pixelHeight = frustumHeight / height; } else { - rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); + float distanceToPixel = -positionEC.z; + float inverseNear = 1.0 / czm_currentFrustum.x; + float tanTheta = top * inverseNear; + pixelHeight = 2.0 * distanceToPixel * tanTheta / height; + tanTheta = right * inverseNear; + pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } -#endif - - mpp = czm_metersPerPixel(positionEC); - positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); - positionEC.xy += (translate + pixelOffset) * mpp; - return positionEC; + return max(pixelWidth, pixelHeight) * pixelRatio; } -#ifdef VERTEX_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) +/** + * Computes the size of a pixel in meters at a distance from the eye. + * <p> + * Use this version when scaling by pixel ratio. + * </p> + * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC) { - vec4 posWC = czm_eyeToWindowCoordinates(positionEC); + return czm_metersPerPixel(positionEC, czm_pixelRatio); +} +`;var aR=`/** + * Transforms a position from model to window coordinates. The transformation + * from model to clip coordinates is done using {@link czm_modelViewProjection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * of <code>near = 0</code> and <code>far = 1</code>. + * <br /><br /> + * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * <br /><br /> + * This function should not be confused with {@link czm_viewportOrthographic}, + * which is an orthographic projection matrix that transforms from window + * coordinates to clip coordinates. + * + * @name czm_modelToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in model coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_eyeToWindowCoordinates + * @see czm_modelViewProjection + * @see czm_viewportTransformation + * @see czm_viewportOrthographic + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + */ +vec4 czm_modelToWindowCoordinates(vec4 position) +{ + vec4 q = czm_modelViewProjection * position; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var cR=`/** + * DOC_TBA + * + * @name czm_multiplyWithColorBalance + * @glslFunction + */ +vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) +{ + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + + vec3 target = left * right; + float leftLuminance = dot(left, W); + float rightLuminance = dot(right, W); + float targetLuminance = dot(target, W); + + return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; +} +`;var lR=`/** + * Computes a value that scales with distance. The scaling is clamped at the near and + * far distances, and does not extrapolate. This function works with the + * {@link NearFarScalar} JavaScript class. + * + * @name czm_nearFarScalar + * @glslFunction + * + * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). + * @param {float} cameraDistSq The square of the current distance from the camera. + * + * @returns {float} The value at this distance. + */ +float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) +{ + float valueAtMin = nearFarScalar.y; + float valueAtMax = nearFarScalar.w; + float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; + float farDistanceSq = nearFarScalar.z * nearFarScalar.z; - float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); + float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); - if (globeDepth == 0.0) - { - return 0.0; // not on the globe - } + t = pow(clamp(t, 0.0, 1.0), 0.2); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); - return eyeCoordinate.z / eyeCoordinate.w; + return mix(valueAtMin, valueAtMax, t); } -#endif -void main() -{ - // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition +`;var uR=` /** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded, float range) + { + if (encoded.x == 0.0 && encoded.y == 0.0) { + return vec3(0.0, 0.0, 0.0); + } - // unpack attributes - vec3 positionHigh = positionHighAndScale.xyz; - vec3 positionLow = positionLowAndRotation.xyz; - float scale = positionHighAndScale.w; + encoded = encoded / range * 2.0 - 1.0; + vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); + if (v.z < 0.0) + { + v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); + } -#if defined(ROTATION) || defined(ALIGNED_AXIS) - float rotation = positionLowAndRotation.w; -#else - float rotation = 0.0; -#endif + return normalize(v); + } - float compressed = compressedAttribute0.x; +/** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded) + { + return czm_octDecode(encoded, 255.0); + } + + /** + * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {float} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(float encoded) + { + float temp = encoded / 256.0; + float x = floor(temp); + float y = (temp - x) * 256.0; + return czm_octDecode(vec2(x, y)); + } - vec2 pixelOffset; - pixelOffset.x = floor(compressed * SHIFT_RIGHT7); - compressed -= pixelOffset.x * SHIFT_LEFT7; - pixelOffset.x -= UPPER_BOUND; +/** + * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The packed oct-encoded, unit-length vectors. + * @param {vec3} vector1 One decoded and normalized vector. + * @param {vec3} vector2 One decoded and normalized vector. + * @param {vec3} vector3 One decoded and normalized vector. + */ + void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) + { + float temp = encoded.x / 65536.0; + float x = floor(temp); + float encodedFloat1 = (temp - x) * 65536.0; - vec2 origin; - origin.x = floor(compressed * SHIFT_RIGHT5); - compressed -= origin.x * SHIFT_LEFT5; + temp = encoded.y / 65536.0; + float y = floor(temp); + float encodedFloat2 = (temp - y) * 65536.0; - origin.y = floor(compressed * SHIFT_RIGHT3); - compressed -= origin.y * SHIFT_LEFT3; + vector1 = czm_octDecode(encodedFloat1); + vector2 = czm_octDecode(encodedFloat2); + vector3 = czm_octDecode(vec2(x, y)); + } -#ifdef FRAGMENT_DEPTH_CHECK - vec2 depthOrigin = origin.xy; -#endif - origin -= vec2(1.0); +`;var fR=`/** + * Packs a depth value into a vec3 that can be represented by unsigned bytes. + * + * @name czm_packDepth + * @glslFunction + * + * @param {float} depth The floating-point depth. + * @returns {vec3} The packed depth. + */ +vec4 czm_packDepth(float depth) +{ + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; + enc = fract(enc); + enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + return enc; +} +`;var dR=`vec3 lambertianDiffuse(vec3 diffuseColor) +{ + return diffuseColor / czm_pi; +} - float show = floor(compressed * SHIFT_RIGHT2); - compressed -= show * SHIFT_LEFT2; +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +{ + return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); +} -#ifdef INSTANCED - vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); - vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); - vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; -#else - vec2 direction; - direction.x = floor(compressed * SHIFT_RIGHT1); - direction.y = compressed - direction.x * SHIFT_LEFT1; +float smithVisibilityG1(float NdotV, float roughness) +{ + // this is the k value for direct lighting. + // for image based lighting it will be roughness^2 / 2 + float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; + return NdotV / (NdotV * (1.0 - k) + k); +} - vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); -#endif +float smithVisibilityGGX(float roughness, float NdotL, float NdotV) +{ + return ( + smithVisibilityG1(NdotL, roughness) * + smithVisibilityG1(NdotV, roughness) + ); +} - float temp = compressedAttribute0.y * SHIFT_RIGHT8; - pixelOffset.y = -(floor(temp) - UPPER_BOUND); +float GGX(float roughness, float NdotH) +{ + float roughnessSquared = roughness * roughness; + float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; + return roughnessSquared / (czm_pi * f * f); +} - vec2 translate; - translate.y = (temp - floor(temp)) * SHIFT_LEFT16; +/** + * Compute the diffuse and specular contributions using physically based + * rendering. This function only handles direct lighting. + * <p> + * This function only handles the lighting calculations. Metallic/roughness + * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} + * </p> + * + * @name czm_pbrlighting + * @glslFunction + * + * @param {vec3} positionEC The position of the fragment in eye coordinates + * @param {vec3} normalEC The surface normal in eye coordinates + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. + * @param {czm_pbrParameters} The computed PBR parameters. + * @return {vec3} The computed HDR color + * + * @example + * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( + * baseColor, + * metallic, + * roughness + * ); + * vec3 color = czm_pbrlighting( + * positionEC, + * normalEC, + * lightDirectionEC, + * lightColorHdr, + * pbrParameters); + */ +vec3 czm_pbrLighting( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) +{ + vec3 v = -normalize(positionEC); + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); + vec3 n = normalEC; + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; + float NdotH = clamp(dot(n, h), 0.0, 1.0); + float LdotH = clamp(dot(l, h), 0.0, 1.0); + float VdotH = clamp(dot(v, h), 0.0, 1.0); - temp = compressedAttribute0.z * SHIFT_RIGHT8; - translate.x = floor(temp) - UPPER_BOUND; + vec3 f0 = pbrParameters.f0; + float reflectance = max(max(f0.r, f0.g), f0.b); + vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(f0, f90, VdotH); - translate.y += (temp - floor(temp)) * SHIFT_LEFT8; - translate.y -= UPPER_BOUND; + float alpha = pbrParameters.roughness; + float G = smithVisibilityGGX(alpha, NdotL, NdotV); + float D = GGX(alpha, NdotH); + vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); - temp = compressedAttribute1.x * SHIFT_RIGHT8; - float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); + vec3 diffuseColor = pbrParameters.diffuseColor; + // F here represents the specular contribution + vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); - vec2 imageSize = vec2(floor(temp), temp2); + // Lo = (diffuse + specular) * Li * NdotL + return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; +} +`;var mR=`/** + * Compute parameters for physically based rendering using the + * metallic/roughness workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrMetallicRoughnessMaterial + * @glslFunction + * + * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) + * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); + * @param {float} roughness A value between 0.0 and 1.0 + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrMetallicRoughnessMaterial( + vec3 baseColor, + float metallic, + float roughness +) +{ + czm_pbrParameters results; -#ifdef FRAGMENT_DEPTH_CHECK - float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); - float applyTranslate = 0.0; - if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false - { - applyTranslate = 1.0; - labelHorizontalOrigin -= 2.0; - depthOrigin.x = labelHorizontalOrigin + 1.0; - } + // roughness is authored as perceptual roughness + // square it to get material roughness + roughness = clamp(roughness, 0.0, 1.0); + results.roughness = roughness * roughness; - depthOrigin = vec2(1.0) - (depthOrigin * 0.5); -#endif + // dielectrics use f0 = 0.04, metals use albedo as f0 + metallic = clamp(metallic, 0.0, 1.0); + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); + results.f0 = f0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; + // diffuse only applies to dielectrics. + results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + return results; +} +`;var hR=`/** + * Compute parameters for physically based rendering using the + * specular/glossy workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrSpecularGlossinessMaterial + * @glslFunction + * + * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) + * @param {vec3} specular The reflectance at normal incidence (f0) + * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrSpecularGlossinessMaterial( + vec3 diffuse, + vec3 specular, + float glossiness +) +{ + czm_pbrParameters results; - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif + // glossiness is the opposite of roughness, but easier for artists to use. + float roughness = 1.0 - glossiness; + results.roughness = roughness * roughness; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) - temp = compressedAttribute3.w; - temp = temp * SHIFT_RIGHT12; + results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); + results.f0 = specular; - vec2 dimensions; - dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; - dimensions.x = floor(temp); -#endif + return results; +} +`;var pR=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +{ + return czm_getLambertDiffuse(lightDirectionEC, material.normal); +} -#ifdef ALIGNED_AXIS - vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); - temp = compressedAttribute2.z * SHIFT_RIGHT5; - bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; -#else - vec3 alignedAxis = vec3(0.0); - bool validAlignedAxis = false; -#endif +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) +{ + return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +} - vec4 pickColor; - vec4 color; +/** + * Computes a color using the Phong lighting model. + * + * @name czm_phong + * @glslFunction + * + * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. + * @param {czm_material} material The fragment's material. + * + * @returns {vec4} The computed color. + * + * @example + * vec3 positionToEyeEC = // ... + * czm_material material = // ... + * vec3 lightDirectionEC = // ... + * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * + * @see czm_getMaterial + */ +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down) + float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); + } - temp = compressedAttribute2.y; - temp = temp * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - temp = compressedAttribute2.x; - temp = temp * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; - temp = compressedAttribute2.z * SHIFT_RIGHT8; - bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; - temp = floor(temp) * SHIFT_RIGHT8; + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor /= 255.0; + return vec4(color, material.alpha); +} - color.a = floor(temp); - color /= 255.0; +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); - /////////////////////////////////////////////////////////////////////////// + vec3 ambient = vec3(0.0); + vec3 color = ambient + material.emission; + color += material.diffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; + return vec4(color, material.alpha); +} +`;var _R=`/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec4 plane, vec3 point) { + return (dot(plane.xyz, point) + plane.w); +} -#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) - float eyeDepth = positionEC.z; -#endif +/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js + * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { + return (dot(planeNormal, point) + planeDistance); +} +`;var gR=`/** + * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero. + * + * @name czm_pointAlongRay + * @glslFunction + * + * @param {czm_ray} ray The ray to compute the point along. + * @param {float} time The time along the ray. + * + * @returns {vec3} The point along the ray at the given time. + * + * @example + * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction + * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) + */ +vec3 czm_pointAlongRay(czm_ray ray, float time) +{ + return ray.origin + (time * ray.direction); +} +`;var yR=`/** + * DOC_TBA + * + * @name czm_rayEllipsoidIntersectionInterval + * @glslFunction + */ +czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +{ + // ray and ellipsoid center in eye coordinates. radii in model coordinates. + vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; + vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; - positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); - positionEC.xyz *= show; + q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; - /////////////////////////////////////////////////////////////////////////// + float q2 = dot(q, q); + float qw = dot(q, w); -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else + if (q2 > 1.0) // Outside ellipsoid. { - lengthSq = dot(positionEC.xyz, positionEC.xyz); - } -#endif + if (qw >= 0.0) // Looking outward or tangent (0 intersections). + { + return czm_emptyRaySegment; + } + else // qw < 0.0. + { + float qw2 = qw * qw; + float difference = q2 - 1.0; // Positively valued. + float w2 = dot(w, w); + float product = w2 * difference; -#ifdef EYE_DISTANCE_SCALING - float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); - scale *= distanceScale; - translate *= distanceScale; - // push vertex behind near plane for clipping - if (scale == 0.0) - { - positionEC.xyz = vec3(0.0); + if (qw2 < product) // Imaginary roots (0 intersections). + { + return czm_emptyRaySegment; + } + else if (qw2 > product) // Distinct roots (2 intersections). + { + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Avoid cancellation. + float root0 = temp / w2; + float root1 = difference / temp; + if (root0 < root1) + { + czm_raySegment i = czm_raySegment(root0, root1); + return i; + } + else + { + czm_raySegment i = czm_raySegment(root1, root0); + return i; + } + } + else // qw2 == product. Repeated roots (2 intersections). + { + float root = sqrt(difference / w2); + czm_raySegment i = czm_raySegment(root, root); + return i; + } + } } -#endif - - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency == 0.0) + else if (q2 < 1.0) // Inside ellipsoid (2 intersections). { - positionEC.xyz = vec3(0.0); + float difference = q2 - 1.0; // Negatively valued. + float w2 = dot(w, w); + float product = w2 * difference; // Negatively valued. + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Positively valued. + czm_raySegment i = czm_raySegment(0.0, temp / w2); + return i; } -#endif - -#ifdef EYE_DISTANCE_PIXEL_OFFSET - float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); - pixelOffset *= pixelOffsetScale; -#endif - -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = compressedAttribute3.x; - float farSq = compressedAttribute3.y; - if (lengthSq < nearSq || lengthSq > farSq) + else // q2 == 1.0. On ellipsoid. { - positionEC.xyz = vec3(0.0); + if (qw < 0.0) // Looking inward. + { + float w2 = dot(w, w); + czm_raySegment i = czm_raySegment(0.0, -qw / w2); + return i; + } + else // qw >= 0.0. Looking outward or tangent. + { + return czm_emptyRaySegment; + } } -#endif +} +`;var xR=`/** + * Compute the intersection interval of a ray with a sphere. + * + * @name czm_raySphereIntersectionInterval + * @glslFunction + * + * @param {czm_ray} ray The ray. + * @param {vec3} center The center of the sphere. + * @param {float} radius The radius of the sphere. + * @return {czm_raySegment} The intersection interval of the ray with the sphere. + */ +czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +{ + vec3 o = ray.origin; + vec3 d = ray.direction; - mat2 rotationMatrix; - float mpp; + vec3 oc = o - center; -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = compressedAttribute3.z; -#endif + float a = dot(d, d); + float b = 2.0 * dot(d, oc); + float c = dot(oc, oc) - (radius * radius); -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { - float depthsilon = 10.0; + float det = (b * b) - (4.0 * a * c); - vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; - vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth1 = getGlobeDepth(pEC1); + if (det < 0.0) { + return czm_emptyRaySegment; + } - if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) - { - vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth2 = getGlobeDepth(pEC2); + float sqrtDet = sqrt(det); - if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) - { - vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - float globeDepth3 = getGlobeDepth(pEC3); - if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) - { - positionEC.xyz = vec3(0.0); - } - } - } + float t0 = (-b - sqrtDet) / (2.0 * a); + float t1 = (-b + sqrtDet) / (2.0 * a); + + czm_raySegment result = czm_raySegment(t0, t1); + return result; +} +`;var bR=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +{ + return czm_reverseLogDepth(texture(depthTexture, texCoords).r); +} +`;var CR=`/** + * Reads a value previously transformed with {@link czm_writeNonPerspective} + * by dividing it by \`w\`, the value used in the perspective divide. + * This function is intended to be called in a fragment shader to access a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The value should have been + * previously written in the vertex shader with a call to + * {@link czm_writeNonPerspective}. + * + * @name czm_readNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. + * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. + * @returns {float|vec2|vec3|vec4} The usable value. + */ +float czm_readNonPerspective(float value, float oneOverW) { + return value * oneOverW; } -#endif - positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); - gl_Position = czm_projection * positionEC; - v_textureCoordinates = textureCoordinates; +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { + return value * oneOverW; +} + +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { + return value * oneOverW; +} +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { + return value * oneOverW; +} +`;var TR=`float czm_reverseLogDepth(float logZ) +{ #ifdef LOG_DEPTH - czm_vertexLogDepth(); + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + return far * (1.0 - near / (depthFromNear + near)) / (far - near); #endif + return logZ; +} +`;var AR=`/** + * Converts an RGB color to HSB (hue, saturation, brightness) + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_RGBToHSB + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ -#ifdef DISABLE_DEPTH_DISTANCE - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } +const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - v_depthFromNearPlusOne = 1.0; -#endif - } - } -#endif +vec3 czm_RGBToHSB(vec3 rgb) +{ + vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); + vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); -#ifdef FRAGMENT_DEPTH_CHECK - if (sizeInMeters) { - translate /= mpp; - dimensions /= mpp; - imageSize /= mpp; - } + float d = q.x - min(q.w, q.y); + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); +} +`;var ER=`/** + * Converts an RGB color to HSL (hue, saturation, lightness) + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_RGBToHSL + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSL. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ + +vec3 RGBtoHCV(vec3 rgb) +{ + // Based on work by Sam Hocevar and Emil Persson + vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); + vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); + float c = q.x - min(q.w, q.y); + float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); + return vec3(h, c, q.x); +} -#if defined(ROTATION) || defined(ALIGNED_AXIS) - v_rotationMatrix = rotationMatrix; -#else - v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); -#endif +vec3 czm_RGBToHSL(vec3 rgb) +{ + vec3 hcv = RGBtoHCV(rgb); + float l = hcv.z - hcv.y * 0.5; + float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); + return vec3(hcv.x, s, l); +} +`;var SR=`/** + * Converts an RGB color to CIE Yxy. + * <p>The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + * </p> + * + * @name czm_RGBToXYZ + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in CIE Yxy. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_RGBToXYZ(vec3 rgb) +{ + const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, + 0.3576, 0.7152, 0.1192, + 0.1805, 0.0722, 0.9505); + vec3 xyz = RGB2XYZ * rgb; + vec3 Yxy; + Yxy.r = xyz.g; + float temp = dot(vec3(1.0), xyz); + Yxy.gb = xyz.rg / temp; + return Yxy; +} +`;var vR=`/** + * Round a floating point value. This function exists because round() doesn't + * exist in GLSL 1.00. + * + * @param {float|vec2|vec3|vec4} value The value to round + * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + */ +float czm_round(float value) { + return floor(value + 0.5); +} - float enableDepthCheck = 0.0; - if (lengthSq < disableDepthTestDistance) - { - enableDepthCheck = 1.0; - } +vec2 czm_round(vec2 value) { + return floor(value + 0.5); +} - float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); - float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); +vec3 czm_round(vec3 value) { + return floor(value + 0.5); +} - float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); - float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); +vec4 czm_round(vec4 value) { + return floor(value + 0.5); +} +`;var wR=`/** + * Samples the 4 neighboring pixels and return the weighted average. + * + * @private + */ +vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) +{ + direction /= dot(vec3(1.0), abs(direction)); + vec2 rev = abs(direction.zx) - vec2(1.0); + vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, + direction.z < 0.0 ? rev.y : -rev.y); + vec2 uv = direction.y < 0.0 ? neg : direction.xz; + vec2 coord = 0.5 * uv + vec2(0.5); + vec2 pixel = 1.0 / textureSize; - v_compressed.x = eyeDepth; - v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; - v_compressed.z = dw * SHIFT_LEFT12 + dh; - v_compressed.w = iw * SHIFT_LEFT12 + ih; - v_originTextureCoordinateAndTranslate.xy = depthOrigin; - v_originTextureCoordinateAndTranslate.zw = translate; - v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; + if (lod > 0.0) + { + // Each subseqeuent mip level is half the size + float scale = 1.0 / pow(2.0, lod); + float offset = ((textureSize.y + 1.0) / textureSize.x); -#endif + coord.x *= offset; + coord *= scale; -#ifdef SDF - vec4 outlineColor; - float outlineWidth; + coord.x += offset + pixel.x; + coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; + } + else + { + coord.x *= (textureSize.y / textureSize.x); + } - temp = sdf.x; - temp = temp * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); + // Do bilinear filtering + #ifndef OES_texture_float_linear + vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; + vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; + vec3 color3 = texture(projectedMap, coord + pixel).rgb; + vec3 color4 = texture(projectedMap, coord).rgb; - temp = sdf.y; - temp = temp * SHIFT_RIGHT8; - float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.a = floor(temp); - outlineColor /= 255.0; + vec2 texturePosition = coord * textureSize; - v_outlineWidth = outlineWidth / 255.0; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency; -#endif + float fu = fract(texturePosition.x); + float fv = fract(texturePosition.y); - v_pickColor = pickColor; + vec3 average1 = mix(color4, color2, fu); + vec3 average2 = mix(color1, color3, fu); - v_color = color; - v_color.a *= translucency; + vec3 color = mix(average1, average2, fv); + #else + vec3 color = texture(projectedMap, coord).rgb; + #endif + return color; } -`;function xi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Lt.clone(n)),l(i)&&(i=Lt.clone(i)),l(r)&&(r=Lt.clone(r)),l(o)&&(o=Dt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Bn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,_i.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=jn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var Oie=xi.SHOW_INDEX=0,HN=xi.POSITION_INDEX=1,Nie=xi.PIXEL_OFFSET_INDEX=2,Vze=xi.EYE_OFFSET_INDEX=3,kze=xi.HORIZONTAL_ORIGIN_INDEX=4,zze=xi.VERTICAL_ORIGIN_INDEX=5,Hze=xi.SCALE_INDEX=6,GN=xi.IMAGE_INDEX_INDEX=7,Rie=xi.COLOR_INDEX=8,Gze=xi.ROTATION_INDEX=9,Wze=xi.ALIGNED_AXIS_INDEX=10,jze=xi.SCALE_BY_DISTANCE_INDEX=11,Yze=xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,qze=xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Xze=xi.DISTANCE_DISPLAY_CONDITION=14,Kze=xi.DISABLE_DEPTH_DISTANCE=15;xi.TEXTURE_COORDINATE_BOUNDS=16;var Mie=xi.SDF_INDEX=17;xi.NUMBER_OF_PROPERTIES=18;function Lr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Lr(this,Oie))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),Lr(this,HN))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Lr(this,HN))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),Lr(this,Nie))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Lt.equals(t,e)||(this._scaleByDistance=Lt.clone(e,t),Lr(this,jze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Lt.equals(t,e)||(this._translucencyByDistance=Lt.clone(e,t),Lr(this,Yze))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Lt.equals(t,e)||(this._pixelOffsetScaleByDistance=Lt.clone(e,t),Lr(this,qze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),Lr(this,Vze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Lr(this,kze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Lr(this,zze))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Lr(this,Hze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Lr(this,Rie))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Lr(this,Gze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),Lr(this,Wze))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Lr(this,GN))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Lr(this,GN))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Lr(this,Rie))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Lr(this,Xze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Lr(this,Kze))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof ve?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(jn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Lr(this,GN))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),Lr(this,HN)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Lr(this,Oie))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Lr(this,Mie))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Lr(this,Mie))}}});xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};xi.prototype._updateClamping=function(){xi._updateClamping(this._billboardCollection,this)};var Dv=new he,Bie=new m;xi._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,r=i.ellipsoid,o=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===qe.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!l(t._position))return;let c=r.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===qe.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=r.cartesianToCartographic(d,Dv);p.height+=c.height,r.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=o.updateHeight(c,u),he.clone(c,Dv);let f=i.getHeight(c);l(f)&&(Dv.height=f),r.cartographicToCartesian(Dv,Bie),u(Bie)};xi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,r,o=this;function s(a){if(o._imageId!==t||o._image!==n||!Ke.equals(o._imageSubRegion,i))return;let c=e.textureCoordinates[a];o._imageWidth=e.texture.width*c.width,o._imageHeight=e.texture.height*c.height,o._imageIndex=a,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,Lr(o,GN)}if(l(n)){let a=e.getImageIndex(t);if(l(a)){s(a);return}r=e.addImage(t,n)}l(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,l(r)&&r.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),o._imageIndexPromise=void 0})};xi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),Lr(this,Nie))};xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),Lr(this,HN)};var Lie=new oe;xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(B.multiplyByPoint(i,t,Lie),Zi.computeActualWgs84Position(n,Lie))};var Fie=new m;xi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=B.multiplyByPoint(e,t,Fie),a=Zi.wgs84WithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return H.add(a,i,a),a};var zN=new H(0,0);xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new H),H.clone(this._pixelOffset,zN),H.add(zN,this._translate,zN);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,Dv);r=a.cartographicToCartesian(c,Fie),i=B.IDENTITY}return xi._computeScreenSpacePosition(i,r,this._eyeOffset,zN,e,t)};xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===_i.RIGHT?s-=i:e.horizontalOrigin===_i.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?a-=r:e.verticalOrigin===Bn.CENTER&&(a-=r*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=r,n};xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Lt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var pr=xi;var Jze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},vr=Object.freeze(Jze);var Zze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},zs=Object.freeze(Zze);function up(e,t,n,i,r){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}var Qze=new H(16,16);function sg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,Qze);this._context=e.context,this._pixelFormat=y(e.pixelFormat,ct.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=jn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(sg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Bt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function $ze(e,t){let n=e._context,i=e.numberOfImages,r=2,o=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=r*(s+t.width+o),u=r*(a+t.height+o),f=s/c,d=a/u,p=new up(new H(s+o,o),new H(c,a)),g=new up(new H,new H(c,a),e._root,p),h=new up(new H(o,a+o),new H(c,u)),A=new up(new H,new H(c,u),g,h);for(let T=0;T<e._textureCoordinates.length;T++){let E=e._textureCoordinates[T];l(E)&&(E.x*=f,E.y*=d,E.width*=f,E.height*=d)}let x=new Bt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),C=new ca({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),x.copyFromFramebuffer(0,0,0,0,c,u),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=x,e._root=A}else{let s=r*(t.width+2*o),a=r*(t.height+2*o);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Bt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new up(new H(o,o),new H(s,a))}}function WN(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,r=t.topRight.y-t.bottomLeft.y,o=i-n.width,s=r-n.height;if(o<0||s<0)return;if(o===0&&s===0)return t;if(o>s){t.childNode1=new up(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new up(new H(a,t.bottomLeft.y),new H(t.topRight.x,t.topRight.y)))}else{t.childNode1=new up(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new up(new H(t.bottomLeft.x,a),new H(t.topRight.x,t.topRight.y)))}return WN(e,t.childNode1,n)}return WN(e,t.childNode1,n)||WN(e,t.childNode2,n)}}function Uie(e,t,n){let i=WN(e,e._root,t);if(l(i)){i.imageIndex=n;let r=e._texture.width,o=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/r,u=i.bottomLeft.y/o,f=s/r,d=a/o;e._textureCoordinates[n]=new Ke(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else $ze(e,t),Uie(e,t,n);e._guid=jn()}function Vie(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return Uie(e,t,n),n}sg.prototype.getImageIndex=function(e){return this._indexHash[e]};sg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=Vie(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};sg.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof ve)&&(t=ve.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(r){let o=Vie(i,r);return i._indexHash[e]=o,o}),this._idHash[e]=n,n};sg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new de(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(r){if(r===-1)return-1;let o=i._texture.width,s=i._texture.height,a=i._textureCoordinates[r],c=a.x+t.x/o,u=a.y+t.y/s,f=t.width/o,d=t.height/s,p=i._textureCoordinates.push(new Ke(c,u,f,d))-1;return i._indexHash[e]=p,i._guid=jn(),p})};sg.prototype.isDestroyed=function(){return!1};sg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var F0=sg;var eHe=pr.SHOW_INDEX,Pv=pr.POSITION_INDEX,kie=pr.PIXEL_OFFSET_INDEX,zie=pr.EYE_OFFSET_INDEX,tHe=pr.HORIZONTAL_ORIGIN_INDEX,nHe=pr.VERTICAL_ORIGIN_INDEX,iHe=pr.SCALE_INDEX,Iv=pr.IMAGE_INDEX_INDEX,Hie=pr.COLOR_INDEX,rHe=pr.ROTATION_INDEX,oHe=pr.ALIGNED_AXIS_INDEX,Gie=pr.SCALE_BY_DISTANCE_INDEX,Wie=pr.TRANSLUCENCY_BY_DISTANCE_INDEX,jie=pr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Yie=pr.DISTANCE_DISPLAY_CONDITION,sHe=pr.DISABLE_DEPTH_DISTANCE,aHe=pr.TEXTURE_COORDINATE_BOUNDS,qie=pr.SDF_INDEX,E6=pr.NUMBER_OF_PROPERTIES,_r,cHe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},lHe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function Wu(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(E6),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,vr.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(Wu.prototype,{length:{get:function(){return b6(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Xie(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Wu.prototype.add=function(e){let t=new pr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Wu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Wu.prototype.removeAll=function(){Xie(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function b6(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}Wu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Wu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Wu.prototype.get=function(e){return b6(this),this._billboards[e]};var g6;function uHe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s+0,r[o+4]=s+2,r[o+5]=s+3;return n=ht.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function fHe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=ht.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function dHe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=ht.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Wu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<E6;++i){let r=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function mHe(e,t,n,i,r,o){let s=[{index:_r.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Pv]},{index:_r.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Pv]},{index:_r.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[kie]},{index:_r.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Wie]},{index:_r.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Hie]},{index:_r.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[zie]},{index:_r.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Gie]},{index:_r.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[jie]},{index:_r.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Yie]},{index:_r.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[aHe]}];i&&s.push({index:_r.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:dHe(e)}),l(r)&&s.push({index:_r.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),o&&s.push({index:_r.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[qie]});let a=i?t:4*t;return new y_(e,s,a,i)}var y6=new Yn;function Kie(e,t,n,i,r){let o,s=i[_r.positionHighAndScale],a=i[_r.positionLowAndRotation],c=r._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(c,y6);let u=r.scale,f=r.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=y6.high,p=y6.low;e._instanced?(o=r._index,s(o,d.x,d.y,d.z,u),a(o,p.x,p.y,p.z,f)):(o=r._index*4,s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u),a(o+0,p.x,p.y,p.z,f),a(o+1,p.x,p.y,p.z,f),a(o+2,p.x,p.y,p.z,f),a(o+3,p.x,p.y,p.z,f))}var Gu=new H,Hu=32768,oT=65536,A6=4096,Im=256,hHe=128,pHe=32,_He=8,Jie=4,gHe=1/256,Zie=0,Qie=2,$ie=3,ere=1;function tre(e,t,n,i,r){let o,s=i[_r.compressedAttribute0],a=r.pixelOffset,c=a.x,u=a.y,f=r._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=r.horizontalOrigin,h=r._verticalOrigin,A=r.show&&r.clusterShow;r.color.alpha===0&&(A=!1),h===Bn.BASELINE&&(h=Bn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===_i.CENTER,e._allVerticalCenter=e._allVerticalCenter&&h===Bn.CENTER;let x=0,C=0,T=0,E=0,S=r._imageIndex;if(S!==-1){let k=n[S];x=k.x,C=k.y,T=k.width,E=k.height}let w=x+T,D=C+E,R=Math.floor(P.clamp(c,-Hu,Hu)+Hu)*hHe;R+=(g+1)*pHe,R+=(h+1)*_He,R+=(A?1:0)*Jie;let O=Math.floor(P.clamp(u,-Hu,Hu)+Hu)*Im,L=Math.floor(P.clamp(d,-Hu,Hu)+Hu)*Im,N=(P.clamp(p,-Hu,Hu)+Hu)*gHe,_=Math.floor(N),b=Math.floor((N-_)*Im);O+=_,L+=b,Gu.x=x,Gu.y=C;let v=qn.compressTextureCoordinates(Gu);Gu.x=w;let I=qn.compressTextureCoordinates(Gu);Gu.y=D;let M=qn.compressTextureCoordinates(Gu);Gu.x=x;let F=qn.compressTextureCoordinates(Gu);e._instanced?(o=r._index,s(o,R,O,L,v)):(o=r._index*4,s(o+0,R+Zie,O,L,v),s(o+1,R+Qie,O,L,I),s(o+2,R+$ie,O,L,M),s(o+3,R+ere,O,L,F))}function nre(e,t,n,i,r){let o,s=i[_r.compressedAttribute1],a=r.alignedAxis;m.equals(a,m.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=r.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,h=r._imageIndex;h!==-1&&(g=n[h].width);let A=e._textureAtlas.texture.width,x=Math.round(y(r.width,A*g));e._maxSize=Math.max(e._maxSize,x);let C=P.clamp(x,0,oT),T=0;Math.abs(m.magnitudeSquared(a)-1)<P.EPSILON6&&(T=qn.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,C=C*Im+u,d=P.clamp(d,0,1),d=d===1?255:d*255|0,T=T*Im+d,e._instanced?(o=r._index,s(o,C,T,c,f)):(o=r._index*4,s(o+0,C,T,c,f),s(o+1,C,T,c,f),s(o+2,C,T,c,f),s(o+3,C,T,c,f))}function C6(e,t,n,i,r){let o,s=i[_r.compressedAttribute2],a=r.color,c=l(e._batchTable)?z.WHITE:r.getPickId(t.context).color,u=r.sizeInMeters?1:0,f=Math.abs(m.magnitudeSquared(r.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=r._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,h=Math.round(y(r.height,g.y*d));e._maxSize=Math.max(e._maxSize,h);let A=y(r._labelHorizontalOrigin,-2);A+=2;let x=h*Jie+A,C=z.floatToByte(a.red),T=z.floatToByte(a.green),E=z.floatToByte(a.blue),S=C*oT+T*Im+E;C=z.floatToByte(c.red),T=z.floatToByte(c.green),E=z.floatToByte(c.blue);let w=C*oT+T*Im+E,D=z.floatToByte(a.alpha)*oT+z.floatToByte(c.alpha)*Im;D+=u*2+f,e._instanced?(o=r._index,s(o,S,w,D,x)):(o=r._index*4,s(o+0,S,w,D,x),s(o+1,S,w,D,x),s(o+2,S,w,D,x),s(o+3,S,w,D,x))}function T6(e,t,n,i,r){let o,s=i[_r.eyeOffset],a=r.eyeOffset,c=a.z;if(r._heightReference!==qe.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=r._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}Gu.x=u,Gu.y=f;let p=qn.compressTextureCoordinates(Gu);o=r._index,s(o,a.x,a.y,c,p)}else o=r._index*4,s(o+0,a.x,a.y,c,0),s(o+1,a.x,a.y,c,0),s(o+2,a.x,a.y,c,0),s(o+3,a.x,a.y,c,0)}function ire(e,t,n,i,r){let o,s=i[_r.scaleByDistance],a=0,c=1,u=1,f=1,d=r.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function rre(e,t,n,i,r){let o,s=i[_r.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=r.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function ore(e,t,n,i,r){let o,s=i[_r.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=r.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=r.disableDepthTestDistance,d=r.heightReference===qe.CLAMP_TO_GROUND&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(r._labelDimensions))g=r._labelDimensions.x,p=r._labelDimensions.y;else{let C=0,T=0,E=r._imageIndex;if(E!==-1){let w=n[E];C=w.height,T=w.width}p=Math.round(y(r.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(r.width,S*T))}let h=Math.floor(P.clamp(g,0,A6)),A=Math.floor(P.clamp(p,0,A6)),x=h*A6+A;e._instanced?(o=r._index,s(o,a,c,f,x)):(o=r._index*4,s(o+0,a,c,f,x),s(o+1,a,c,f,x),s(o+2,a,c,f,x),s(o+3,a,c,f,x))}function sre(e,t,n,i,r){if(r.heightReference===qe.CLAMP_TO_GROUND){let h=e._scene,A=t.context,x=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=A.depthTexture&&!x&&C}let o,s=i[_r.textureCoordinateBoundsOrLabelTranslate];if(Gt.maximumVertexTextureImageUnits>0){let h=0,A=0;l(r._labelTranslate)&&(h=r._labelTranslate.x,A=r._labelTranslate.y),e._instanced?(o=r._index,s(o,h,A,0,0)):(o=r._index*4,s(o+0,h,A,0,0),s(o+1,h,A,0,0),s(o+2,h,A,0,0),s(o+3,h,A,0,0));return}let a=0,c=0,u=0,f=0,d=r._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,u=h.width,f=h.height}let p=a+u,g=c+f;e._instanced?(o=r._index,s(o,a,c,p,g)):(o=r._index*4,s(o+0,a,c,p,g),s(o+1,a,c,p,g),s(o+2,a,c,p,g),s(o+3,a,c,p,g))}function yHe(e,t,n,i,r){if(!l(e._batchTable))return;let o=i[_r.a_batchId],s=r._batchIndex,a;e._instanced?(a=r._index,o(a,s)):(a=r._index*4,o(a+0,s),o(a+1,s),o(a+2,s),o(a+3,s))}function are(e,t,n,i,r){if(!e._sdf)return;let o,s=i[_r.sdf],a=r.outlineColor,c=r.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*oT+f*Im+d,g=c/zs.RADIUS,h=z.floatToByte(a.alpha)*oT+z.floatToByte(g)*Im;e._instanced?(o=r._index,s(o,p,h)):(o=r._index*4,s(o+0,p+Zie,h),s(o+1,p+Qie,h),s(o+2,p+$ie,h),s(o+3,p+ere,h))}function AHe(e,t,n,i,r){Kie(e,t,n,i,r),tre(e,t,n,i,r),nre(e,t,n,i,r),C6(e,t,n,i,r),T6(e,t,n,i,r),ire(e,t,n,i,r),rre(e,t,n,i,r),ore(e,t,n,i,r),sre(e,t,n,i,r),yHe(e,t,n,i,r),are(e,t,n,i,r)}function x6(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=pr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function xHe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!B.equals(o,e.modelMatrix)?(e._mode=n,B.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&x6(e,i,i.length,t,o,!0)):n===ne.MORPHING?x6(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&x6(e,r,e._billboardsToUpdateIndex,t,o,!1)}function CHe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function THe(e,t){let n=`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Se.OVERLAY,i}var EHe=[];Wu.prototype.update=function(e){if(b6(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,_r=this._instanced?lHe:cHe,g6=this._instanced?fHe:uHe;let r=this._textureAtlas;if(!l(r)){r=this._textureAtlas=new F0({context:i});for(let O=0;O<n;++O)t[O]._loadImage()}let o=r.textureCoordinates;if(o.length===0)return;xHe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let O=0;O<E6;++O)c[O]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=mHe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let O=0;O<n;++O){let L=this._billboards[O];L._dirty=!1,AHe(this,e,o,d,L)}this._vaf.commit(g6(i))}this._billboardsToUpdateIndex=0}else if(a>0){let O=EHe;O.length=0,(c[Pv]||c[rHe]||c[iHe])&&O.push(Kie),(c[Iv]||c[kie]||c[tHe]||c[nHe]||c[eHe])&&(O.push(tre),this._instanced&&O.push(T6)),(c[Iv]||c[oHe]||c[Wie])&&(O.push(nre),O.push(C6)),(c[Iv]||c[Hie])&&O.push(C6),c[zie]&&O.push(T6),c[Gie]&&O.push(ire),c[jie]&&O.push(rre),(c[Yie]||c[sHe]||c[Iv]||c[Pv])&&O.push(ore),(c[Iv]||c[Pv])&&O.push(sre),c[qie]&&O.push(are);let L=O.length;if(d=this._vaf.writers,a/n>.1){for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let b=0;b<L;++b)O[b](this,e,o,d,_)}this._vaf.commit(g6(i))}else{for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let b=0;b<L;++b)O[b](this,e,o,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,A=B.IDENTITY;e.mode===ne.SCENE3D?(A=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),CHe(this,e,h);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===vr.OPAQUE||this._blendOption===vr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let O=this._blendOption===vr.TRANSLUCENT;this._blendOption===vr.TRANSLUCENT||this._blendOption===vr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:O?te.LEQUAL:te.LESS},depthMask:O,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,T,E,S,w,D=Gt.maximumVertexTextureImageUnits>0;if(x||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=kN,T=VN,w=[],l(this._batchTable)&&(w.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),E=new He({defines:w,sources:[C]}),this._instanced&&E.defines.push("INSTANCED"),this._shaderRotation&&E.defines.push("ROTATION"),this._shaderAlignedAxis&&E.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&E.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&E.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&E.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&E.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&E.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK"));let O=1-zs.CUTOFF;this._sdf&&E.defines.push("SDF");let L=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===vr.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:_r}),S=new He({defines:["TRANSLUCENT",L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:_r})),this._blendOption===vr.OPAQUE&&(S=new He({defines:[L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:_r})),this._blendOption===vr.TRANSLUCENT&&(S=new He({defines:[L],sources:[T]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:_r})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let R=e.commandList;if(p.render||p.pick){let O=this._colorCommands,L=this._blendOption===vr.OPAQUE,N=this._blendOption===vr.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,b=_.length,v=this._uniforms,I;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),I=this._batchTable.getPickId()):I="v_pickColor",O.length=b;let M=N?b*2:b;for(let F=0;F<M;++F){let k=O[F];l(k)||(k=O[F]=new nt);let V=L||N&&F%2===0;k.pass=V||!N?Se.OPAQUE:Se.TRANSLUCENT,k.owner=this;let G=N?Math.floor(F/2):F;k.boundingVolume=h,k.modelMatrix=A,k.count=_[G].indicesCount,k.shaderProgram=V?this._sp:this._spTranslucent,k.uniformMap=v,k.vertexArray=_[G].va,k.renderState=V?this._rsOpaque:this._rsTranslucent,k.debugShowBoundingVolume=this.debugShowBoundingVolume,k.pickId=I,this._instanced&&(k.count=6,k.instanceCount=n),R.push(k)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=THe(this,e.context)),R.push(this.debugCommand))}};Wu.prototype.isDestroyed=function(){return!1};Wu.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Xie(this._billboards),ue(this)};var ju=Wu;function bHe(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var sT=bHe;function Hs(e,t,n,i,r){this._content=e,this._billboard=n,this._label=i,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),aT(this)}var SHe=new he;Object.defineProperties(Hs.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),aT(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,aT(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),aT(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,aT(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,SHe);i.height=i.height-t+e;let r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&aT(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Hs.defaultColor=z.WHITE;Hs.defaultPointOutlineColor=z.BLACK;Hs.defaultPointOutlineWidth=0;Hs.defaultPointSize=8;function aT(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,Hs.defaultColor),i=y(e._pointOutlineColor,Hs.defaultPointOutlineColor),r=y(e._pointOutlineWidth,Hs.defaultPointOutlineWidth),o=y(e._pointSize,Hs.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,sT(f,d,p,r,o))}Hs.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Hs.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Hs.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Hs.prototype.getPropertyInherited=function(e){return Us.getPropertyInherited(this._content,this._batchId,e)};Hs.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Hs.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Hs.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Hs.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ag=Hs;function vHe(e,t,n,i,r){let o=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=o.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),r&&(g.fillStyle="black",g.fillText(t,u/2,p));let h=g.getImageData(0,0,f,d).data,A=h.length,x=f*4,C,T,E,S;for(C=0;C<A;++C)if(h[C]!==255){E=C/x|0;break}for(C=A-1;C>=0;--C)if(h[C]!==255){S=C/x|0;break}let w=-1;for(C=0;C<f&&w===-1;++C)for(T=0;T<d;++T){let D=C*4+T*x;if(h[D]!==255||h[D+1]!==255||h[D+2]!==255||h[D+3]!==255){w=C;break}}return{width:o.width,height:S-E,ascent:p-E,descent:S-p,minx:w-u/2}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}var U0;function wHe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),r=y(t.fill,!0),o=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(U0)||(l(f.imageSmoothingEnabled)?U0="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?U0="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?U0="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(U0="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[U0]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=vHe(f,e,n,i,r);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,h=d.height+c,A=h-d.ascent+a,x=h-A+c;if(u.width=g,u.height=h,f.font=n,f.lineJoin="round",f.lineWidth=o,f[U0]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let C=y(t.strokeColor,z.BLACK);f.strokeStyle=C.toCssColorString(),f.strokeText(e,p+a,x)}if(r){let C=y(t.fillColor,z.WHITE);f.fillStyle=C.toCssColorString(),f.fillText(e,p+a,x)}return u}var cT=wHe;var xre=co(mre(),1);var OHe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},jr=Object.freeze(OHe);var hre={},pre=0,RHe=256,MHe=new z(.165,.165,.165,.8),BHe=new H(7,5),Ko=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function V0(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Rv(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Mv(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function gre(e){let t=hre[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(Mv(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Mv(n,"font-family"),size:Mv(n,"font-size").replace("px",""),style:Mv(n,"font-style"),weight:Mv(n,"font-weight"),lineHeight:i},document.body.removeChild(n),pre<RHe&&(hre[e._font]=t,pre++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function fp(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Lt.clone(n)),l(i)&&(i=Lt.clone(i)),l(r)&&(r=Lt.clone(r)),l(o)&&(o=Dt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,MHe)),this._backgroundPadding=H.clone(y(e.backgroundPadding,BHe)),this._style=y(e.style,jr.FILL),this._verticalOrigin=y(e.verticalOrigin,Bn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,_i.LEFT),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._position=m.clone(y(e.position,m.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=y(e.heightReference,qe.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,gre(this),this._updateClamping()}Object.defineProperties(fp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),Rv(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=fp.enableRightToLeftDetection?kHe(t):t,V0(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,V0(this),gre(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),V0(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),V0(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,V0(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,V0(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;H.equals(t,e)||(H.clone(e,t),Rv(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,V0(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!H.equals(t,e)){H.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Lt.equals(t,e)){this._translucencyByDistance=Lt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Lt.equals(t,e)){this._pixelOffsetScaleByDistance=Lt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Lt.equals(t,e)){this._scaleByDistance=Lt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Rv(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),Rv(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),Rv(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Dt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});fp.prototype._updateClamping=function(){pr._updateClamping(this._labelCollection,this)};fp.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new H);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return pr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};fp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,r=0,o=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?r-=s:e.verticalOrigin===Bn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let h=d[g],A=h.billboard;if(!l(A))continue;let x=t.x+A._translate.x,C=t.y-A._translate.y,T=h.dimensions.width*a,E=h.dimensions.height*a;e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?C-=E:e.verticalOrigin===Bn.CENTER&&(C-=E*.5),e._verticalOrigin===Bn.TOP?C+=zs.PADDING*a:(e._verticalOrigin===Bn.BOTTOM||e._verticalOrigin===Bn.BASELINE)&&(C-=zs.PADDING*a),i=Math.min(i,x),r=Math.min(r,C),u=Math.max(u,x+T),f=Math.max(f,C+E)}o=u-i,s=f-r}return l(n)||(n=new Ke),n.x=i,n.y=r,n.width=o,n.height=s,n};fp.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&H.equals(this._backgroundPadding,e._backgroundPadding)&&H.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Lt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Lt.equals(this._scaleByDistance,e._scaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};fp.prototype.isDestroyed=function(){return!1};fp.enableRightToLeftDetection=!1;function LHe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=Ko.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Ko.RTL:n.test(f)?a=Ko.LTR:i.test(f)?a=Ko.BRACKETS:a=Ko.WEAK,u===0&&(s=a),s===a&&a!==Ko.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function NHe(e){return e.split("").reverse().join("")}function Bv(e,t,n){return e.slice(0,t)+n+e.slice(t)}function FHe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var UHe="\u05D0-\u05EA",VHe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",_re=new RegExp(`[${UHe}${VHe}]`);function kHe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=_re.test(r.charAt(0)),s=LHe(r,_re),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===Ko.BRACKETS?FHe(f.Word):NHe(f.Word);o?f.Type===Ko.RTL?(c=d+c,a=0):f.Type===Ko.LTR?(c=Bv(c,a,f.Word),a+=f.Word.length):(f.Type===Ko.WEAK||f.Type===Ko.BRACKETS)&&(f.Type===Ko.WEAK&&s[u-1].Type===Ko.BRACKETS?c=d+c:s[u-1].Type===Ko.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===Ko.RTL?(c=d+c,a=0):(c=Bv(c,a,f.Word),a+=f.Word.length):c=Bv(c,0,d)):f.Type===Ko.RTL?c=Bv(c,a,d):f.Type===Ko.LTR?(c+=f.Word,a=c.length):(f.Type===Ko.WEAK||f.Type===Ko.BRACKETS)&&(u>0&&s[u-1].Type===Ko.RTL?s.length>u+1?s[u+1].Type===Ko.RTL?c=Bv(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var k0=fp;var Cre=co(yre(),1);function HHe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function GHe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var WHe=1.2,Tre="ID_WHITE_PIXEL",S6=new H(4,4),jHe=new Ke(1,1,1,1);function YHe(e){let t=document.createElement("canvas");t.width=S6.x,t.height=S6.y;let n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Tre,t)}var Yu={};function qHe(e,t,n,i,r,o,s){return Yu.font=t,Yu.fillColor=n,Yu.strokeColor=i,Yu.strokeWidth=r,Yu.padding=zs.PADDING,s===Bn.CENTER?Yu.textBaseline="middle":s===Bn.TOP?Yu.textBaseline="top":Yu.textBaseline="bottom",Yu.fill=o===jr.FILL||o===jr.FILL_AND_OUTLINE,Yu.stroke=o===jr.OUTLINE||o===jr.FILL_AND_OUTLINE,Yu.backgroundColor=z.BLACK,cT(e,Yu)}function v6(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function XHe(e,t,n,i){i.index=e.addImageSync(t,n)}var KHe=new Cre.default;function JHe(e,t){let n=t._renderedText,i=KHe.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length,a,c,u;if(t._relativeSize=t._fontSize/zs.FONT_SIZE,r<s)for(c=r;c<s;++c)v6(e,o[c]);o.length=r;let f=t._showBackground&&n.split(` -`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:Tre,imageSubRegion:jHe}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=_i.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<r;++u){let h=i[u],A=t._verticalOrigin,x=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+A]),C=g[x];if(!l(C)){let T=`${t._fontStyle} ${t._fontWeight} ${zs.FONT_SIZE}px ${t._fontFamily}`,E=qHe(h,T,z.WHITE,z.WHITE,0,jr.FILL,A);if(C=new GHe(e,-1,E.dimensions),g[x]=C,E.width>0&&E.height>0){let S=(0,xre.default)(E,{cutoff:zs.CUTOFF,radius:zs.RADIUS}),w=E.getContext("2d"),D=E.width,R=E.height,O=w.getImageData(0,0,D,R);for(let L=0;L<D;L++)for(let N=0;N<R;N++){let _=N*D+L,b=S[_]*255,v=_*4;O.data[v+0]=b,O.data[v+1]=b,O.data[v+2]=b,O.data[v+3]=b}w.putImageData(O,0,0),h!==" "&&XHe(e._textureAtlas,x,E,C)}}if(a=o[u],l(a)?C.index===-1?v6(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new HHe,o[u]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let T=a.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=e._billboardCollection.add({collection:e}),T._labelDimensions=new H,T._labelTranslate=new H),a.billboard=T),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=_i.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.image=x,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===jr.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===jr.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===jr.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Are(e,t,n){return t===_i.CENTER?-e/2:t===_i.RIGHT?-(e+n.x):n.x}var io=new H,ZHe=new H;function QHe(e){let t=e._glyphs,n=e._renderedText,i,r,o=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(l(g)?e._backgroundPadding:H.ZERO,ZHe);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` -`?(a.push(o),++f,o=0):(i=t[d],r=i.dimensions,u=Math.max(u,r.height-r.descent),c=Math.max(c,r.descent),o+=r.width-r.minx,d<p-1&&(o+=t[d+1].dimensions.minx),s=Math.max(s,o));a.push(o);let A=u+c,x=e.totalScale,C=e._horizontalOrigin,T=e._verticalOrigin,E=0,S=a[E],w=Are(S,C,h),D=(l(e._lineHeight)?e._lineHeight:WHe*e._fontSize)/e._relativeSize,R=D*(f-1),O=s,L=A+R;l(g)&&(O+=h.x*2,L+=h.y*2,g._labelHorizontalOrigin=C),io.x=w*x,io.y=0;let N=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` -`)++E,_+=D,S=a[E],w=Are(S,C,h),io.x=w*x,N=!0;else if(i=t[d],r=i.dimensions,T===Bn.TOP?(io.y=r.height-u-h.y,io.y+=zs.PADDING):T===Bn.CENTER?io.y=(R+r.height-u)/2:T===Bn.BASELINE?(io.y=R,io.y-=zs.PADDING):(io.y=R+c+h.y,io.y-=zs.PADDING),io.y=(io.y-r.descent-_)*x,N&&(io.x-=zs.PADDING*x,N=!1),l(i.billboard)&&(i.billboard._setTranslate(io),i.billboard._labelDimensions.x=O,i.billboard._labelDimensions.y=L,i.billboard._labelHorizontalOrigin=C),d<p-1){let b=t[d+1];io.x+=(r.width-r.minx+b.dimensions.minx)*x}if(l(g)&&n.split(` -`).join("").length>0&&(C===_i.CENTER?w=-s/2-h.x:C===_i.RIGHT?w=-(s+h.x*2):w=0,io.x=w*x,T===Bn.TOP?io.y=A-u-c:T===Bn.CENTER?io.y=(A-u)/2-c:T===Bn.BASELINE?io.y=-h.y-c:io.y=0,io.y=io.y*x,g.width=O,g.height=L,g._setTranslate(io),g._labelTranslate=H.clone(io,g._labelTranslate)),e.heightReference===qe.CLAMP_TO_GROUND)for(d=0;d<p;++d){i=t[d];let b=i.billboard;l(b)&&(b._labelTranslate=H.clone(io,b._labelTranslate))}}function Ere(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)v6(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function Pm(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new ju({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new ju({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vr.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Pm.prototype,{length:{get:function(){return this._labels.length}}});Pm.prototype.add=function(e){let t=new k0(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Pm.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Ere(this,e),!0}return!1};Pm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Ere(this,e[t]);e.length=0};Pm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Pm.prototype.get=function(e){return this._labels[e]};Pm.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new F0({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new F0({context:i,initialSize:S6}),n.textureAtlas=this._backgroundTextureAtlas,YHe(this._backgroundTextureAtlas));let r=this._labelsToUpdate.length;for(let s=0;s<r;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(JHe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(QHe(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let o=n.length>0?vr.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var dp=Pm;var YN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; +/** + * Samples from a cube map that has been projected using an octahedral projection from the given direction. + * + * @name czm_sampleOctahedralProjection + * @glslFunction + * + * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. + * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. + * @param {vec3} direction The normalized direction used to sample the cube map. + * @param {float} lod The level of detail to sample. + * @param {float} maxLod The maximum level of detail. + * @returns {vec3} The color of the cube map at the direction. + */ +vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { + float currentLod = floor(lod + 0.5); + float nextLod = min(currentLod + 1.0, maxLod); - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; + vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); + vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); - if (width < 1.0) - { - show = 0.0; - } + return mix(colorNextLod, colorCurrentLod, nextLod - lod); +} +`;var IR=`/** + * Adjusts the saturation of a color. + * + * @name czm_saturation + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the saturation of the color. + * + * @returns {float} The color with the saturation adjusted. + * + * @example + * vec3 greyScale = czm_saturation(color, 0.0); + * vec3 doubleSaturation = czm_saturation(color, 2.0); + */ +vec3 czm_saturation(vec3 rgb, float adjustment) +{ + // Algorithm from Chapter 16 of OpenGL Shading Language + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(rgb, W)); + return mix(intensity, rgb, adjustment); +} +`;var DR=` +float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) +{ + return czm_unpackDepth(czm_textureCube(shadowMap, d)); +} - vec4 pickColor = batchTable_getPickColor(batchTableIndex); +float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) +{ +#ifdef USE_SHADOW_DEPTH_TEXTURE + return texture(shadowMap, uv).r; +#else + return czm_unpackDepth(texture(shadowMap, uv)); +#endif +} - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); - } +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) +{ + return step(depth, czm_sampleShadowMap(shadowMap, uv)); +} - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); +float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) +{ + return step(depth, czm_sampleShadowMap(shadowMap, uv)); +} +`;var PR=` +float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +{ +#ifdef USE_NORMAL_SHADING +#ifdef USE_NORMAL_SHADING_SMOOTH + float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); +#else + float strength = step(0.0, nDotL); +#endif + visibility *= strength; +#endif - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - lengthSq = czm_eyeHeight2D.y; - } - else - { - vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); - lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); - } + visibility = max(visibility, darkness); + return visibility; +} - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - show = 0.0; - } - #endif +#ifdef USE_CUBE_MAP_SHADOW +float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +{ + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec3 uvw = shadowParameters.texCoords; - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; + depth -= depthBias; + float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +} +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) +{ + float depthBias = shadowParameters.depthBias; + float depth = shadowParameters.depth; + float nDotL = shadowParameters.nDotL; + float normalShadingSmooth = shadowParameters.normalShadingSmooth; + float darkness = shadowParameters.darkness; + vec2 uv = shadowParameters.texCoords; - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + depth -= depthBias; +#ifdef USE_SOFT_SHADOWS + vec2 texelStepSize = shadowParameters.texelStepSize; + float radius = 1.0; + float dx0 = -texelStepSize.x * radius; + float dy0 = -texelStepSize.y * radius; + float dx1 = texelStepSize.x * radius; + float dy1 = texelStepSize.y * radius; + float visibility = ( + czm_shadowDepthCompare(shadowMap, uv, depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) + ) * (1.0 / 9.0); +#else + float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); +#endif - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; + return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } -`;var bc={};bc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};bc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var $He=new he;bc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,$He).height}return i};var eGe=new B,tGe=new m,bre=new m,nGe=new fn(m.UNIT_X,0),Sre=new m,iGe=new fn(m.UNIT_X,0),rGe=new m,oGe=new m,D6=[];function wre(e,t,n){let i=D6;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var XN=new he,qN=new he,cg=new m,I6=new m,sGe=new m,w6=new Wf,Lv=new Ba;function aGe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,I6),u=i.scaleToGeodeticSurface(t,sGe),f=bc.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,XN),p=i.cartesianToCartographic(u,qN),g=wre(f,r,o);w6.setEndPoints(d,p);let h=w6.surfaceDistance/f,A=a;d.height=r;let x=i.cartographicToCartesian(d,cg);m.pack(x,s,A),A+=3;for(let C=1;C<f;C++){let T=w6.interpolateUsingSurfaceDistance(C*h,qN);T.height=g[C],x=i.cartographicToCartesian(T,cg),m.pack(x,s,A),A+=3}return A}function cGe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,XN),u=i.cartesianToCartographic(t,qN),f=bc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=wre(f,r,o);Lv.ellipsoid.equals(i)||(Lv=new Ba(void 0,void 0,i)),Lv.setEndPoints(c,u);let p=Lv.surfaceDistance/f,g=a;c.height=r;let h=i.cartographicToCartesian(c,cg);m.pack(h,s,g),g+=3;for(let A=1;A<f;A++){let x=Lv.interpolateUsingSurfaceDistance(A*p,qN);x.height=d[A],h=i.cartographicToCartesian(x,cg),m.pack(h,s,g),g+=3}return g}bc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,B.IDENTITY);let r=B.inverseTransformation(t,eGe),o=B.multiplyByPoint(r,m.ZERO,tGe),s=m.normalize(B.multiplyByPointAsVector(r,m.UNIT_Y,bre),bre),a=fn.fromPointNormal(o,s,nGe),c=m.normalize(B.multiplyByPointAsVector(r,m.UNIT_X,Sre),Sre),u=fn.fromPointNormal(o,c,iGe),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let h=e[g];if(fn.getPointDistance(u,d)<0||fn.getPointDistance(u,h)<0){let A=Ki.lineSegmentPlane(d,h,a,rGe);if(l(A)){let x=m.multiplyByScalar(s,5e-9,oGe);fn.getPointDistance(a,d)<0&&m.negate(x,x),n.push(m.add(A,x,new m)),i.push(f+1),m.negate(x,x),n.push(m.add(A,x,new m)),f=1}}n.push(m.clone(e[g])),f++,d=h}i.push(f)}return{positions:n,lengths:i}};bc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let A=i.scaleToGeodeticSurface(t[0],I6);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(A,cg);m.multiplyByScalar(x,r,x),m.add(A,x,A)}return[A.x,A.y,A.z]}let s=e.minDistance;if(!l(s)){let A=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(A,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=bc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let A=t[c],x=t[c+1],C=o?r[c]:r,T=o?r[c+1]:r;d=aGe(A,x,s,i,C,T,f,d)}D6.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,XN);g.height=o?r[n-1]:r;let h=i.cartographicToCartesian(g,cg);return m.pack(h,f,u-3),f};var vre=new he,lGe=new he;bc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,re.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],I6);if(r=o?r[0]:r,r!==0){let T=i.geodeticSurfaceNormal(C,cg);m.multiplyByScalar(T,r,T),m.add(C,T,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],vre),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],lGe),a+=bc.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,vre);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let C=t[c],T=t[c+1],E=o?r[c]:r,S=o?r[c+1]:r;g=cGe(C,T,s,i,E,S,p,g)}D6.length=0;let h=t[n-1],A=i.cartesianToCartographic(h,XN);A.height=o?r[n-1]:r;let x=i.cartographicToCartesian(A,cg);return m.pack(x,p,d-3),p};bc.generateCartesianArc=function(e){let t=bc.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};bc.generateCartesianRhumbArc=function(e){let t=bc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=m.unpack(t,r*3);return i};var Ri=bc;function ql(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Gi.fromType(Gi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Cr(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=B.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Ri.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Ire),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Dre=ql.POSITION_INDEX=0,uGe=ql.SHOW_INDEX=1,fGe=ql.WIDTH_INDEX=2,dGe=ql.MATERIAL_INDEX=3,Nv=ql.POSITION_SIZE_INDEX=4,mGe=ql.DISTANCE_DISPLAY_CONDITION=5,Ire=ql.NUMBER_OF_PROPERTIES=6;function mp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(ql.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,mp(this,uGe))}},positions:{get:function(){return this._positions},set:function(e){let t=Cr(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&mp(this,Nv),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),mp(this,Dre),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,mp(this,dGe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,mp(this,fGe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,mp(this,Nv)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),mp(this,mGe))}}});ql.prototype.update=function(){let e=B.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Dre]>0||this._propertiesChanged[Nv]>0;if((!B.equals(e,this._modelMatrix)||i)&&(this._segments=Ri.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=B.clone(e,this._modelMatrix),this._segments.positions.length!==t)mp(this,Nv);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){mp(this,Nv);break}}};ql.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};ql.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Ire-1;++t)e[t]=0};ql.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var ed=ql;var hGe=ed.SHOW_INDEX,pGe=ed.WIDTH_INDEX,O6=ed.POSITION_INDEX,_Ge=ed.MATERIAL_INDEX,Pre=ed.POSITION_SIZE_INDEX,gGe=ed.DISTANCE_DISPLAY_CONDITION,Fre=ed.NUMBER_OF_PROPERTIES,rl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function td(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Fre),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(td.prototype,{length:{get:function(){return R6(this),this._polylines.length}}});td.prototype.add=function(e){let t=new ed(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};td.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};td.prototype.removeAll=function(){M6(this),Hre(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};td.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};td.prototype.get=function(e){return R6(this),this._polylines[e]};function yGe(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new Qx(t,n,e._polylines.length)}var Ure=new Yn,Vre=new oe,kre=new H;td.prototype.update=function(e){if(R6(this),this._polylines.length===0||!this.show)return;bGe(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Gt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");yGe(this,t),this._createBatchTable=!1}if(this._createVertexArray||xGe(this))Mre(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[Pre]||r[_Ge])Mre(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let h in f)if(f.hasOwnProperty(h)){if(f[h]===p){r[O6]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[h].lengthOfPositions}if((r[hGe]||r[pGe])&&this._batchTable.setBatchedAttribute(i._index,0,new H(i._width,i._show)),this._batchTable.attributes.length>2){if(r[O6]||r[Pre]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,A=Yn.fromCartesian(h.center,Ure),x=oe.fromElements(A.low.x,A.low.y,A.low.z,h.radius,Vre);this._batchTable.setBatchedAttribute(i._index,2,A.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(r[gGe]){let h=kre;h.x=0,h.y=Number.MAX_VALUE;let A=i.distanceDisplayCondition;l(A)&&(h.x=A.near,h.y=A.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<Fre;++c)r[c]=0;let o=B.IDENTITY;e.mode===ne.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:hn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;AGe(this,e,c,o)}};var Fv=new ae,Ore=new ae;function AGe(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let h=0;h<g;++h){let A=u[h],x=A.buckets,C=x.length;for(let T=0;T<C;++T){let E=x[T],S=E.offset,w=E.bucket.shaderProgram,D=E.bucket.polylines,R=D.length,O,L,N=0,_,b;for(let v=0;v<R;++v){let I=D[v],M=TGe(I._material);if(M!==O){if(l(O)&&N>0){let G=L.isTranslucent();a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,b=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(Fv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?Se.TRANSLUCENT:Se.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=N,_.offset=S,S+=N,N=0,c=!0,o.push(_)}L=I._material,L.update(r),O=M}let F=I._locatorBuckets,k=F.length;for(let G=0;G<k;++G){let U=F[G];U.locator===E&&(N+=U.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,Ore),V.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,Ore)),c?(c=!1,ae.clone(V,Fv)):ae.union(V,Fv,Fv)}l(O)&&N>0&&(a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,b=gt(p(L._uniforms),e._uniformMap),_.boundingVolume=ae.clone(Fv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=A.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?Se.TRANSLUCENT:Se.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=b,_.count=N,_.offset=S,c=!0,o.push(_)),O=void 0}}n.length=a}td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return zre(this),M6(this),Hre(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function xGe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[O6]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var Rre=[0,0,0];function Mre(e,t,n){e._createVertexArray=!1,M6(e),zre(e),EGe(e);let i=[[]],r=i[0],o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,A=new Float32Array(6*f*3),x=new Float32Array(f*4),C,T=0,E=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(A,x,T,E,S,o,t,n),h===ne.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,T));let b=g.lengthOfPositions;T+=6*b*3,E+=b*4,S+=b*4,c=g.updateIndices(i,a,u,c)}let w=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=ht.createVertexBuffer({context:t,typedArray:A,usage:w});let R;l(C)&&(R=ht.createVertexBuffer({context:t,typedArray:C,usage:w})),e._texCoordExpandAndBatchIndexBuffer=ht.createVertexBuffer({context:t,typedArray:x,usage:D});let O=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let b=0;b<_;++b)if(r=i[b],r.length>0){let v=new Uint16Array(r),I=ht.createIndexBuffer({context:t,typedArray:v,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});N+=a[b];let M=6*(b*(O*P.SIXTY_FOUR_KILOBYTES)-N*O),F=O+M,k=O+F,V=O+k,G=O+V,U=O+G,q=b*(L*P.SIXTY_FOUR_KILOBYTES)-N*L,Y=[{index:rl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:rl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:rl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:rl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:rl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:rl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:rl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:rl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:rl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:rl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:rl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*O},{index:rl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:rl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],Q,W,K,J;h===ne.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",K=Rre,J="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(W=Rre,Q="value",K=e._positionBuffer,J="vertexBuffer"):(W=R,Q="vertexBuffer",K=e._positionBuffer,J="vertexBuffer"),Y[0][Q]=W,Y[1][Q]=W,Y[2][J]=K,Y[3][J]=K,Y[4][Q]=W,Y[5][Q]=W,Y[6][J]=K,Y[7][J]=K,Y[8][Q]=W,Y[9][Q]=W,Y[10][J]=K,Y[11][J]=K;let me=new si({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[b]})}}}function CGe(e,t){return t instanceof Bt?t.id:t}var KN=[];function TGe(e){let t=Gi._uniformList[e.type],n=t.length;KN.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];KN[i]=o,KN[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(KN,CGe)}`}function EGe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Om(c,t,n)),u.addPolyline(a)}}}function bGe(e,t){let n=t.mode;(e._mode!==n||!B.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=B.clone(e.modelMatrix),e._createVertexArray=!0)}function R6(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function M6(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function zre(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}td.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Hre(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function P6(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Om(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Om.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Om.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),jt.isInternetExplorer()||i.push("CLIP_POLYLINE");let r=new He({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,lC]}),o=t.getVertexShaderCallback()(YN),s=new He({defines:i,sources:[Fu,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:rl})};function Gre(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(fn.ORIGIN_ZX_PLANE)===tn.INTERSECTING}Om.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!Gre(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var os=new m,qu=new m,Xu=new m,JN=new m,SGe=new oe,vGe=new H;Om.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],h=g.width,A=g.show&&h>0,x=g._index,C=this.getSegments(g,a),T=C.positions,E=C.lengths,S=T.length,w=g.getPickId(s).color,D=0,R=0,O;for(let k=0;k<S;++k){k===0?g._loop?O=T[S-2]:(O=JN,m.subtract(T[0],T[1],O),m.add(T[0],O,O)):O=T[k-1],m.clone(O,qu),m.clone(T[k],os),k===S-1?g._loop?O=T[1]:(O=JN,m.subtract(T[S-1],T[S-2],O),m.add(T[S-1],O,O)):O=T[k+1],m.clone(O,Xu);let V=E[D];k===R+V&&(R+=V,++D);let G=k-R===0,U=k===R+E[D]-1;c===ne.SCENE2D&&(qu.z=0,os.z=0,Xu.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||U)&&u-Math.abs(os.x)<1&&((os.x<0&&qu.x>0||os.x>0&&qu.x<0)&&m.clone(os,qu),(os.x<0&&Xu.x>0||os.x>0&&Xu.x<0)&&m.clone(os,Xu));let q=G?2:0,Y=U?2:4;for(let Q=q;Q<Y;++Q){Yn.writeElements(os,e,n),Yn.writeElements(qu,e,n+6),Yn.writeElements(Xu,e,n+12);let W=Q-2<0?-1:1;t[r]=k/(S-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=x,n+=6*3,r+=4}}let L=SGe;L.x=z.floatToByte(w.red),L.y=z.floatToByte(w.green),L.z=z.floatToByte(w.blue),L.w=z.floatToByte(w.alpha);let N=vGe;N.x=h,N.y=A?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,b=Yn.fromCartesian(_.center,Ure),v=b.high,I=oe.fromElements(b.low.x,b.low.y,b.low.z,_.radius,Vre),M=kre;M.x=0,M.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(M.x=F.near,M.y=F.far),o.setBatchedAttribute(x,0,N),o.setBatchedAttribute(x,1,L),o.attributes.length>2&&(o.setBatchedAttribute(x,2,v),o.setBatchedAttribute(x,3,I),o.setBatchedAttribute(x,4,M))}};var wGe=new m,DGe=new m,IGe=new m,Bre=new m;Om.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=Bre,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=B.multiplyByPoint(n,g,DGe);let h=B.multiplyByPoint(n,a[p],wGe),A;p===u-1?s._loop?A=a[1]:(A=Bre,m.subtract(a[u-1],a[u-2],A),m.add(a[u-1],A,A)):A=a[p+1],A=B.multiplyByPoint(n,A,IGe);let x=c[f];p===d+x&&(d+=x,++f);let C=p-d===0,T=p===d+c[f]-1,E=C?2:0,S=T?2:4;for(let w=E;w<S;++w)Yn.writeElements(h,e,t),Yn.writeElements(g,e,t+6),Yn.writeElements(A,e,t+12),t+=6*3}}};var PGe=new Array(1);Om.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new P6(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=PGe;let A=p._actualPositions.length;if(A>0)g[0]=A;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let A=0;for(let x=0;x<h;++x){let C=g[x]-1;for(let T=0;T<C;++T)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:A}),A=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new P6(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),A+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:A}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new P6(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};Om.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var lT={positions:void 0,lengths:void 0},Lre=new Array(1),OGe=new m,RGe=new he;Om.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return Lre[0]=n.length,lT.positions=n,lT.lengths=Lre,lT;Gre(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=OGe;for(let u=0;u<s;++u)a=n[u],c=B.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,RGe)));if(r.length>0){e._boundingVolume2D=ae.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(u.z,u.x,u.y)}return lT.positions=r,lT.lengths=e._segments.lengths,lT};var Nre;Om.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Nre,c=6*s*3;!l(a)||a.length<c?a=Nre=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,h=0,A;s=f.length;for(let x=0;x<s;++x){x===0?t._loop?A=f[s-2]:(A=JN,m.subtract(f[0],f[1],A),m.add(f[0],A,A)):A=f[x-1],m.clone(A,qu),m.clone(f[x],os),x===s-1?t._loop?A=f[1]:(A=JN,m.subtract(f[s-1],f[s-2],A),m.add(f[s-1],A,A)):A=f[x+1],m.clone(A,Xu);let C=d[g];x===h+C&&(h+=C,++g);let T=x-h===0,E=x===h+d[g]-1;r===ne.SCENE2D&&(qu.z=0,os.z=0,Xu.z=0),(r===ne.SCENE2D||r===ne.MORPHING)&&(T||E)&&o-Math.abs(os.x)<1&&((os.x<0&&qu.x>0||os.x>0&&qu.x<0)&&m.clone(os,qu),(os.x<0&&Xu.x>0||os.x>0&&Xu.x<0)&&m.clone(os,Xu));let S=T?2:0,w=E?2:4;for(let D=S;D<w;++D)Yn.writeElements(os,a,p),Yn.writeElements(qu,a,p+6),Yn.writeElements(Xu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Rm=td;function lg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new ju({batchTable:e.batchTable}),this._labelCollection=new dp({batchTable:e.batchTable}),this._polylineCollection=new Rm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(lg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function MGe(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ce.packedLength+re.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ce.pack(n,s,a),a+=ce.packedLength,re.pack(t,s,a),s}var BGe=new pi("createVectorTilePoints",5),LGe=new m;function NGe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=MGe(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=BGe.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let h=d[g],A=m.unpack(n,g*3,LGe),x=c.add();x.position=A,x._batchIndex=h;let C=u.add();C.text=" ",C.position=A,C._batchIndex=h;let T=f.add();T.positions=[m.clone(A),m.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}lg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new ag(e,c,u,f,d)}};lg.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function FGe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=ag.defaultPointSize,s.color=ag.defaultColor,s.pointOutlineColor=ag.defaultPointOutlineColor,s.pointOutlineWidth=ag.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=jr.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new H(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=_i.CENTER,s.verticalOrigin=Bn.CENTER,s.labelHorizontalOrigin=_i.RIGHT,s.labelVerticalOrigin=Bn.BASELINE}}var UGe=new z,VGe=new z,kGe=new z,zGe=new z,HGe=new z,GGe=new z,Uv=new Lt,Vv=new Lt,B6=new Dt;lg.prototype.applyStyle=function(e,t){if(!l(e)){FGe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,UGe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,VGe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,kGe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,zGe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,HGe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(Uv.near=a.x,Uv.nearValue=a.y,Uv.far=a.z,Uv.farValue=a.w,s.scaleByDistance=Uv):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(Vv.near=a.x,Vv.nearValue=a.y,Vv.far=a.z,Vv.farValue=a.w,s.translucencyByDistance=Vv):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(B6.near=a.x,B6.far=a.y,s.distanceDisplayCondition=B6):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,GGe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};lg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=NGe(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};lg.prototype.isDestroyed=function(){return!1};lg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var ZN=lg;function hp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,m.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Hn.BOTH}Object.defineProperties(hp.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function WGe(e){let t=new Float64Array(3+m.packedLength+re.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,ce.pack(e._rectangle,t,n),t}function jGe(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=Ln.unpack(t,n),n+=Ln.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new jh({color:c,offset:u,count:f,batchIds:p})}}var YGe=new pi("createVectorTilePolygons",5),qGe=new z;function XGe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,h=s.length;for(let A=0;A<h;++A){let x=g.getColor(A,qGe);s[A]=x.toRgba()}a=e._packedBuffer=WGe(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=YGe.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),A=h[0];jGe(e,h),e._indices=Ue.getSizeInBytes(A)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),KGe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function KGe(e){l(e._primitive)||(e._primitive=new DC({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}hp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};hp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};hp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};hp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};hp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=XGe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var QN=hp;var $N=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; - -void main() +#endif +`;var OR=`/** + * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL + * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0. + * + * @name czm_signNotZero + * @glslFunction + * + * @param {} value The value for which to determine the sign. + * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. + */ +float czm_signNotZero(float value) { - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; - - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; + return value >= 0.0 ? 1.0 : -1.0; } -`;function nd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(nd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function JGe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var ZGe=new pi("createVectorTilePolylines",5),uT={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function QGe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=JGe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=ZGe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),$Ge(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function $Ge(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=ht.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=ht.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),d=ht.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),h=ht.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),A=[{index:uT.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:uT.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:uT.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:uT.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:uT.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:A,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var kv=new B,Wre=new m;function e8e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,kv),B.multiplyByPoint(kv,e._center,Wre),B.setTranslation(kv,Wre,kv),kv},u_highlightColor:function(){return e._highlightColor}})}function t8e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:hn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var n8e=`uniform vec4 u_highlightColor; -void main() + +vec2 czm_signNotZero(vec2 value) { - out_FragColor = u_highlightColor; + return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); } -`;function i8e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)($N),r=n.getFragmentShaderCallback(!1,void 0,!1)(n8e),o=new He({defines:["VECTOR_TILE",jt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Fu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:uT})}function r8e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Se.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}nd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};nd.prototype.getPositions=function(e){return nd.getPolylinePositions(this,e)};nd.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Us(e,o)}};nd.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function o8e(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var s8e=new z,a8e=z.WHITE,c8e=!0;nd.prototype.applyStyle=function(e,t){if(!l(e)){o8e(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,s8e):a8e,s.show=l(e.show)?e.show.evaluate(s):c8e}};nd.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=QGe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}e8e(this,t),i8e(this,t),t8e(this);let n=e.passes;(n.render||n.pick)&&r8e(this,e)};nd.prototype.isDestroyed=function(){return!1};nd.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var fT=nd;var eF=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; - -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; -void main() +vec3 czm_signNotZero(vec3 value) { - // vertex corner IDs - // 3-----------7 - // /| left /| - // / | 1 / | - // 2-----------6 5 end - // | / | / - // start |/ right |/ - // 0-----------4 - // - float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end - float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - - vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; - vec3 right = normalize(cross(forward, startEllipsoidNormal)); - - vec4 position = vec4(startPositionAndHeight.xyz, 1.0); - position.xyz += forward * isEnd; - - v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - - // Push for volume height - float offset; - vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - - // offset height to create volume - offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); - offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; - position.xyz += offset * ellipsoidNormal; - - // move from RTC to EC - position = u_modifiedModelView * position; - right = czm_normal * right; + return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +} - // Push for width in a direction that is in the start or end plane and in a plane with right - // N = normalEC ("right-facing" direction for push) - // R = right - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); +vec4 czm_signNotZero(vec4 value) +{ + return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +} +`;var RR=`/** + * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. + * <p> + * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. + * </p> + * + * @name czm_sphericalHarmonics + * @glslFunction + * + * @param {vec3} normal The normalized direction. + * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. + * @returns {vec3} The color at the direction. + * + * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + */ +vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ + vec3 L00 = coefficients[0]; + vec3 L1_1 = coefficients[1]; + vec3 L10 = coefficients[2]; + vec3 L11 = coefficients[3]; + vec3 L2_2 = coefficients[4]; + vec3 L2_1 = coefficients[5]; + vec3 L20 = coefficients[6]; + vec3 L21 = coefficients[7]; + vec3 L22 = coefficients[8]; - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); + float x = normal.x; + float y = normal.y; + float z = normal.z; - gl_Position = czm_depthClamp(czm_projection * position); + return + L00 + + L1_1 * y + + L10 * z + + L11 * x + + L2_2 * (y * x) + + L2_1 * (y * z) + + L20 * (3.0 * z * z - 1.0) + + L21 * (z * x) + + L22 * (x * x - y * y); +} +`;var MR=`/** + * Converts an sRGB color to a linear RGB color. + * + * @param {vec3|vec4} srgbIn The color in sRGB space + * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + */ +vec3 czm_srgbToLinear(vec3 srgbIn) +{ + return pow(srgbIn, vec3(2.2)); +} - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); +vec4 czm_srgbToLinear(vec4 srgbIn) +{ + vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); + return vec4(linearOut, srgbIn.a); +} +`;var LR=`/** + * Creates a matrix that transforms vectors from tangent space to eye space. + * + * @name czm_tangentToEyeSpaceMatrix + * @glslFunction + * + * @param {vec3} normalEC The normal vector in eye coordinates. + * @param {vec3} tangentEC The tangent vector in eye coordinates. + * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + * + * @returns {mat3} The matrix that transforms from tangent space to eye space. + * + * @example + * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); + * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + */ +mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ + vec3 normal = normalize(normalEC); + vec3 tangent = normalize(tangentEC); + vec3 bitangent = normalize(bitangentEC); + return mat3(tangent.x , tangent.y , tangent.z, + bitangent.x, bitangent.y, bitangent.z, + normal.x , normal.y , normal.z); +} +`;var NR=`/** + * A wrapper around the texture (WebGL2) / textureCube (WebGL1) + * function to allow for WebGL 1 support. + * + * @name czm_textureCube + * @glslFunction + * + * @param {samplerCube} sampler The sampler. + * @param {vec3} p The coordinates to sample the texture at. + */ +vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 + return texture(sampler, p); +#else + return textureCube(sampler, p); +#endif +}`;var FR=`/** + * Transforms a plane. + * + * @name czm_transformPlane + * @glslFunction + * + * @param {vec4} plane The plane in Hessian Normal Form. + * @param {mat4} transform The inverse-transpose of a transformation matrix. + */ +vec4 czm_transformPlane(vec4 plane, mat4 transform) { + vec4 transformedPlane = transform * plane; + // Convert the transformed plane to Hessian Normal Form + float normalMagnitude = length(transformedPlane.xyz); + return transformedPlane / normalMagnitude; +} +`;var BR=`/** + * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3}, + * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to + * be relative to the eye. As shown in the example, the position can then be transformed in eye + * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, + * respectively. + * <p> + * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as + * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + * </p> + * + * @name czm_translateRelativeToEye + * @glslFunction + * + * @param {vec3} high The position's high bits. + * @param {vec3} low The position's low bits. + * @returns {vec3} The position translated to be relative to the camera's position. + * + * @example + * in vec3 positionHigh; + * in vec3 positionLow; + * + * void main() + * { + * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * } + * + * @see czm_modelViewRelativeToEye + * @see czm_modelViewProjectionRelativeToEye + * @see czm_computePosition + * @see EncodedCartesian3 + */ +vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +{ + vec3 highDifference = high - czm_encodedCameraPositionMCHigh; + vec3 lowDifference = low - czm_encodedCameraPositionMCLow; - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; + return vec4(highDifference + lowDifference, 1.0); } -`;var tF=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; - -uniform vec4 u_highlightColor; -void main() +`;var kR=`/** + * @private + */ +vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + // Diffuse from directional light sources at eye (for top-down and horizon views) + float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); } - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + diffuse = clamp(diffuse, 0.0, 1.0); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; - czm_writeDepthClamp(); + return vec4(color, material.alpha); } -`;function pp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(ai._defaultMinTerrainHeight,ai._defaultMaxTerrainHeight),this._boundingVolume=Ln.fromRectangle(e.rectangle,ai._defaultMinTerrainHeight,ai._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(pp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function l8e(e,t,n){let i=ai.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;Ln.fromRectangle(c,r,o,n,a)}function u8e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ce.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,re.pack(r,a,c),c+=re.packedLength,m.pack(o,a,c),a}var f8e=new pi("createVectorTileClampedPolylines"),ug={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function d8e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=u8e(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=f8e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),m8e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function m8e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=ht.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),h=ht.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),A=ht.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),x=ht.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),C=ht.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),T=ht.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),E=[{index:ug.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:ug.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:ug.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ug.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ug.startFaceNormalAndVertexCorner,vertexBuffer:A,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ug.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:ug.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new si({context:t,attributes:E,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var zv=new B,jre=new m;function h8e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,zv),B.multiplyByPoint(zv,e._center,jre),B.setTranslation(zv,jre,zv),zv},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Yre(e){return ze.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function p8e(e){l(e._rs)||(e._rs=Yre(!1),e._rs3DTiles=Yre(!0))}function _8e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(eF),r=n.getFragmentShaderCallback(!1,void 0,!0)(tF),o=new He({defines:["VECTOR_TILE",jt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Fu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:ug})}function g8e(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Se.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=nt.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Hn.TERRAIN||i===Hn.BOTH)&&t.commandList.push(n),(i===Hn.CESIUM_3D_TILE||i===Hn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}pp.prototype.getPositions=function(e){return fT.getPolylinePositions(this,e)};pp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new Us(e,o)}};pp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function y8e(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var A8e=new z,x8e=z.WHITE,C8e=!0;pp.prototype.applyStyle=function(e,t){if(!l(e)){y8e(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,A8e):x8e,s.show=l(e.show)?e.show.evaluate(s):C8e}};function T8e(e){return ai.initialize().then(function(){l8e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}pp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=T8e(this).then(d8e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}h8e(this,t),_8e(this,t),p8e(this);let n=e.passes;(n.render||n.pick)&&g8e(this,e)};pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var nF=pp;var L6=32767,E8e=new he,b8e=new m;function S8e(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);qn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],h=P.lerp(t.west,t.east,d/L6),A=P.lerp(t.south,t.north,p/L6),x=P.lerp(n,i,g/L6),C=he.fromRadians(h,A,x,E8e),T=r.cartographicToCartesian(C,b8e);m.pack(T,u,f*3)}return u}var iF=S8e;function Mm(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o}),P8e(this,i,r)}Object.defineProperties(Mm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function v8e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function w8e(e,t){let n,i,r,o,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var id=Uint32Array.BYTES_PER_ELEMENT;function D8e(e){return new fT(e)}function I8e(e){return new nF(e)}function P8e(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=id;let o=r.getUint32(n,!0);if(o!==1)throw new de(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=id;let s=r.getUint32(n,!0);if(n+=id,s===0){e._ready=!0,e._resolveContent(e);return}let a=r.getUint32(n,!0);if(n+=id,a===0)throw new de("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=id;let u=r.getUint32(n,!0);n+=id;let f=r.getUint32(n,!0);n+=id;let d=r.getUint32(n,!0);n+=id;let p=r.getUint32(n,!0);n+=id;let g=r.getUint32(n,!0);n+=id;let h=r.getUint32(n,!0);n+=id;let A=Mr(i,n,a);n+=a;let x=new Uint8Array(t,n,c);n+=c;let C,T;u>0&&(C=Mr(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let E=y(A.POLYGONS_LENGTH,0),S=y(A.POLYLINES_LENGTH,0),w=y(A.POINTS_LENGTH,0),D=E+S+w,R=new R_(e,D,C,T,v8e(e));if(e._batchTable=R,D===0)return;let O=new bm(A,x),L=O.getGlobalProperty("REGION");if(!l(L))throw new de("Feature table global property: REGION must be defined");let N=ce.unpack(L),_=L[4],b=L[5],v=e._tile.computedTransform,I=O.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=m.unpack(I),B.multiplyByPoint(v,I,I)):(I=ce.center(N),I.height=P.lerp(_,b,.5),I=re.WGS84.cartographicToCartesian(I));let M=w8e(A,x);if(n+=(4-n%4)%4,E>0){O.featuresLength=E;let F=y(O.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(F))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=y(O.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(k))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=F.reduce(function(W,K){return W+K*2},0),G=k.reduce(function(W,K){return W+K},0),U=new Uint32Array(t,n,G);n+=d;let q=new Uint16Array(t,n,V);n+=p;let Y,Q;l(A.POLYGON_MINIMUM_HEIGHTS)&&l(A.POLYGON_MAXIMUM_HEIGHTS)&&(Y=O.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),Q=O.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new QN({positions:q,counts:F,indexCounts:k,indices:U,minimumHeight:_,maximumHeight:b,polygonMinimumHeights:Y,polygonMaximumHeights:Q,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,batchIds:M.polygons,modelMatrix:v})}if(S>0){O.featuresLength=S;let F=y(O.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),O.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(F))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=O.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(k)){k=new Uint16Array(S);for(let Q=0;Q<S;++Q)k[Q]=2}let V=F.reduce(function(Q,W){return Q+W*3},0),G=new Uint16Array(t,n,V);n+=g;let U=e._tileset,q=U.examineVectorLinesFunction;if(l(q)){let Q=iF(new Uint16Array(G),N,_,b,re.WGS84);O8e(Q,F,M.polylines,R,e.url,q)}let Y=D8e;l(U.classificationType)&&(Y=I8e),e._polylines=Y({positions:G,widths:k,counts:F,batchIds:M.polylines,minimumHeight:_,maximumHeight:b,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(w>0){let F=new Uint16Array(t,n,w*3);n+=h,e._points=new ZN({positions:F,batchIds:M.points,minimumHeight:_,maximumHeight:b,rectangle:N,batchTable:R})}}function N6(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Mm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Mm.prototype.getFeature=function(e){return l(this._features)||N6(this),this._features[e]};Mm.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Mm.prototype.applyStyle=function(e){l(this._features)||N6(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Mm.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||N6(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Mm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function O8e(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var rF=Mm;var qre={b3dm:function(e,t,n,i,r){return lp.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return lp.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return lp.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return JM.fromTileType(e,t,n,i,r,qre)},externalTileset:function(e,t,n,i){return UN.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new rB(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new rF(e,t,n,i,r)},subt:function(e,t,n,i,r){return lv.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return lv.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new de("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return lp.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return lp.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return lp.fromGeoJson(e,t,n,i)}},dT=qre;var R8e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Yr=Object.freeze(R8e);var rd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};rd.isBinaryFormat=function(e){switch(e){case rd.BATCHED_3D_MODEL:case rd.INSTANCED_3D_MODEL:case rd.COMPOSITE:case rd.POINT_CLOUD:case rd.VECTOR:case rd.GEOMETRY:case rd.IMPLICIT_SUBTREE:case rd.VOXEL_BINARY:case rd.GLTF_BINARY:return!0;default:return!1}};var Ts=Object.freeze(rd);var M8e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},od=Object.freeze(M8e);var Es={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},_p=new Array(Es.NUMBER_OF_PASSES);_p[Es.RENDER]=Object.freeze({pass:Es.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});_p[Es.PICK]=Object.freeze({pass:Es.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_p[Es.SHADOW]=Object.freeze({pass:Es.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});_p[Es.PRELOAD]=Object.freeze({pass:Es.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Es.PRELOAD_FLIGHT]=Object.freeze({pass:Es.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Es.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Es.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Es.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Es.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Es.MOST_DETAILED_PICK]=Object.freeze({pass:Es.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Es.getPassOptions=function(e){return _p[e]};var Nr=Object.freeze(Es);function gp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(gp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},readyPromise:{get:function(){return $("Empty3DTileContent.readyPromise","Empty3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Empty3DTileContent.ready to return true instead."),Promise.resolve(this)}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});gp.prototype.hasProperty=function(e,t){return!1};gp.prototype.getFeature=function(e){};gp.prototype.applyDebugSettings=function(e,t){};gp.prototype.applyStyle=function(e){};gp.prototype.update=function(e,t){};gp.prototype.isDestroyed=function(){return!1};gp.prototype.destroy=function(){return ue(this)};var Hv=gp;function yp(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(yp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yp.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};yp.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};yp.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};yp.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};yp.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};yp.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};yp.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var oF=yp;function F6(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){F6._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new oF({content:n,class:r})}}F6._oneTimeWarning=Rt;var mT=F6;function B8e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var hT=B8e;function Ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Ap.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ap.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ap.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ap.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ap.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Ap.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Ap.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Ap.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var sF=Ap;function U6(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){U6._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new sF({tile:n,class:r})}}U6._oneTimeWarning=Rt;var aF=U6;function L8e(e){let t=new Uint8Array(e),n=ym(t);if(n==="glTF"&&(n="glb"),Ts.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=N8e(t);if(l(i.root))return{contentType:Ts.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ts.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ts.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ts.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ts.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function N8e(e){let t;try{t=Mr(e)}catch{throw new de("Invalid tile content.")}return t}var xp=L8e;function sd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let r=l(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let s=0;s<o;s++){let a=n.getDerivedResource({url:r[s].uri}),c=cc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(sd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},readyPromise:{get:function(){return $("Multiple3DTileContent.readyPromise","Multiple3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Multiple3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function V6(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Xre(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}sd.prototype.requestInnerContents=function(){if(!F8e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;V6(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=U8e(this,n,t,this._tile._contentState);return V8e(this)};function F8e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!cc.serverHasOpenSlots(n,t[n]))return!1;return cc.heapHasOpenSlots(e.length)}function U8e(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new $r({throttle:!0,throttleByServer:!0,type:ns.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ni.CANCELLED){Xre(e,i);return}return V6(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===ni.CANCELLED){Xre(e,i);return}V6(e,-1),Kre(e,t,f)}})}async function V8e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>k8e(e,o,s)),r=await Promise.all(i);return e._contentsCreated=!0,e._contents=r.filter(l),r}async function k8e(e,t,n){if(l(t))try{let i=xp(t);if(i.contentType===Ts.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ts.GEOMETRY||i.contentType===Ts.VECTOR;let r=e._tileset,o=e._innerContentResources[n],s=e._tile,a,c=dT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=mT(r,u));let f=hT(r,u);return l(f)&&(a.group=new vC({metadata:f})),a}catch(i){Kre(e,n,i)}}function Kre(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}sd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};sd.prototype.hasProperty=function(e,t){return!1};sd.prototype.getFeature=function(e){};sd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};sd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};sd.prototype.update=function(e,t){let n=this._contents,i=n.length,r=!0;for(let o=0;o<i;++o)n[o].update(e,t),r=r&&n[o].ready;!this._ready&&r&&(this._ready=!0,this._resolveContent(this))};sd.prototype.isDestroyed=function(){return!1};sd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var cF=sd;var roe=co(eoe(),1);var n5e=new m,i5e=new m,fg={};fg.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};fg.computeWindingOrder2D=function(e){return fg.computeArea2D(e)>0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};fg.triangulate=function(e,t){let n=H.packArray(e);return(0,roe.default)(n,t,2)};var ooe=new m,soe=new m,aoe=new m,toe=new m,noe=new m,ioe=new m,Cp=new m,coe=new H,loe=new H,uoe=new H,_T=new H;fg.computeSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let E=t[a];if(u[d++]=E.x,u[d++]=E.y,u[d++]=E.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],h={},A=e.maximumRadius,x=P.chordLength(r,A),C=x*x;for(;s.length>0;){let E=s.pop(),S=s.pop(),w=s.pop(),D=m.fromArray(u,w*3,ooe),R=m.fromArray(u,S*3,soe),O=m.fromArray(u,E*3,aoe),L,N,_;o&&(L=H.fromArray(f,w*2,coe),N=H.fromArray(f,S*2,loe),_=H.fromArray(f,E*2,uoe));let b=m.multiplyByScalar(m.normalize(D,toe),A,toe),v=m.multiplyByScalar(m.normalize(R,noe),A,noe),I=m.multiplyByScalar(m.normalize(O,ioe),A,ioe),M=m.magnitudeSquared(m.subtract(b,v,Cp)),F=m.magnitudeSquared(m.subtract(v,I,Cp)),k=m.magnitudeSquared(m.subtract(I,b,Cp)),V=Math.max(M,F,k),G,U,q;V>C?M===V?(G=`${Math.min(w,S)} ${Math.max(w,S)}`,a=h[G],l(a)||(U=m.add(D,R,Cp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(L,N,_T),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(w,a,E),s.push(a,S,E)):F===V?(G=`${Math.min(S,E)} ${Math.max(S,E)}`,a=h[G],l(a)||(U=m.add(R,O,Cp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(N,_,_T),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,w),s.push(a,E,w)):k===V&&(G=`${Math.min(E,w)} ${Math.max(E,w)}`,a=h[G],l(a)||(U=m.add(O,D,Cp),m.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[G]=a,o&&(q=H.add(_,L,_T),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(E,a,S),s.push(a,w,S)):(g.push(w),g.push(S),g.push(E))}let T={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Le.TRIANGLES};return o&&(T.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(T)};var r5e=new he,o5e=new he,s5e=new he,W6=new he;fg.computeRhumbLineSubdivision=function(e,t,n,i,r){r=y(r,P.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let w=t[a];if(u[d++]=w.x,u[d++]=w.y,u[d++]=w.z,o){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let g=[],h={},A=e.maximumRadius,x=P.chordLength(r,A),C=new Ba(void 0,void 0,e),T=new Ba(void 0,void 0,e),E=new Ba(void 0,void 0,e);for(;s.length>0;){let w=s.pop(),D=s.pop(),R=s.pop(),O=m.fromArray(u,R*3,ooe),L=m.fromArray(u,D*3,soe),N=m.fromArray(u,w*3,aoe),_,b,v;o&&(_=H.fromArray(f,R*2,coe),b=H.fromArray(f,D*2,loe),v=H.fromArray(f,w*2,uoe));let I=e.cartesianToCartographic(O,r5e),M=e.cartesianToCartographic(L,o5e),F=e.cartesianToCartographic(N,s5e);C.setEndPoints(I,M);let k=C.surfaceDistance;T.setEndPoints(M,F);let V=T.surfaceDistance;E.setEndPoints(F,I);let G=E.surfaceDistance,U=Math.max(k,V,G),q,Y,Q,W,K;U>x?k===U?(q=`${Math.min(R,D)} ${Math.max(R,D)}`,a=h[q],l(a)||(Y=C.interpolateUsingFraction(.5,W6),Q=(I.height+M.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(_,b,_T),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(R,a,w),s.push(a,D,w)):V===U?(q=`${Math.min(D,w)} ${Math.max(D,w)}`,a=h[q],l(a)||(Y=T.interpolateUsingFraction(.5,W6),Q=(M.height+F.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(b,v,_T),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,R),s.push(a,w,R)):G===U&&(q=`${Math.min(w,R)} ${Math.max(w,R)}`,a=h[q],l(a)||(Y=E.interpolateUsingFraction(.5,W6),Q=(F.height+I.height)*.5,W=m.fromRadians(Y.longitude,Y.latitude,Q,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[q]=a,o&&(K=H.add(v,_,_T),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(w,a,D),s.push(a,R,D)):(g.push(R),g.push(D),g.push(w))}let S={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Le.TRIANGLES};return o&&(S.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(S)};fg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,re.WGS84);let r=n5e,o=i5e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),m.multiplyByScalar(r,t,r),m.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var ui=fg;var foe=Math.cos,doe=Math.sin,a5e=Math.sqrt,Y6={};Y6.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=foe(f),p=doe(f),g=a.z*p,h=c.longitude+i*e.granYSin+r*e.granXCos,A=d*foe(h),x=d*doe(h),C=a.x*A,T=a.y*x,E=a5e(C*A+T*x+g*p);if(o.x=C/E,o.y=T/E,o.z=g/E,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+r*e.stGranXSin,h=S.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(h-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var c5e=new er,Ku=new m,l5e=new he,mF=new m,j6=new Di;function moe(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;Ku=j6.project(e,Ku),Ku=m.subtract(Ku,mF,Ku);let g=er.fromRotation(t,c5e);Ku=er.multiplyByVector(g,Ku,Ku),Ku=m.add(Ku,mF,Ku),e=j6.unproject(Ku,e),o-=1,s-=1;let h=e.latitude,A=h+o*p,x=h-c*s,C=h-c*s+o*p,T=Math.max(h,A,x,C),E=Math.min(h,A,x,C),S=e.longitude,w=S+o*u,D=S+s*d,R=S+s*d+o*u,O=Math.max(S,w,D,R),L=Math.min(S,w,D,R);return{north:T,south:E,east:O,west:L,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}Y6.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,h=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let A=Math.ceil(g/t)+1,x=Math.ceil(h/t)+1,C=g/(A-1),T=h/(x-1),E=ce.northwest(e,o),S=ce.center(e,l5e);(n!==0||i!==0)&&(S.longitude<E.longitude&&(S.longitude+=P.TWO_PI),mF=j6.project(S,mF));let w=T,D=C,R=0,O=0,L=ce.clone(e,r),N={granYCos:w,granYSin:R,granXCos:D,granXSin:O,nwCorner:E,boundingRectangle:L,width:A,height:x,northCap:d,southCap:p};if(n!==0){let _=moe(E,n,C,T,S,A,x);u=_.north,f=_.south,a=_.east,c=_.west,N.granYCos=_.granYCos,N.granYSin=_.granYSin,N.granXCos=_.granXCos,N.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=c}if(i!==0){n=n-i;let _=ce.northwest(L,s),b=moe(_,n,C,T,S,A,x);N.stGranYCos=b.granYCos,N.stGranXCos=b.granXCos,N.stGranYSin=b.granYSin,N.stGranXSin=b.granXSin,N.stNwCorner=_,N.stWest=b.west,N.stSouth=b.south}return N};var bs=Y6;var u5e=new ae,f5e=new ae,d5e=new m,m5e=new ce;function hoe(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,h,A=d5e;if(o)bs.computePosition(t,n,!1,g,0,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;else for(h=0;h<r;h++)bs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(h=r-1,g=1;g<i;g++)bs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;if(g=i-1,!s)for(h=r-2;h>=0;h--)bs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(h=0,g=i-2;g>0;g--)bs.computePosition(t,n,!1,g,h,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;let x=d.length/3*2,C=Ue.createTypedArray(d.length/3,x),T=0;for(let S=0;S<d.length/3-1;S++)C[T++]=S,C[T++]=S+1;C[T++]=d.length/3-1,C[T++]=0;let E=new dt({attributes:new gn,primitiveType:Le.LINES});return E.attributes.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),E.indices=C,E}function h5e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=i,s=n,a=hoe(e,t),c=t.height,u=t.width,f=ui.scaleToGeodeticHeight(a.attributes.position.values,s,r,!1),d=f.length,p=new Float64Array(d*2);p.set(f);let g=ui.scaleToGeodeticHeight(a.attributes.position.values,o,r);p.set(g,d),a.attributes.position.values=p;let h=t.northCap,A=t.southCap,x=4;h&&(x-=1),A&&(x-=1);let C=(p.length/3+x)*2,T=Ue.createTypedArray(p.length/3,C);d=p.length/6;let E=0;for(let w=0;w<d-1;w++)T[E++]=w,T[E++]=w+1,T[E++]=w+d,T[E++]=w+d+1;T[E++]=d-1,T[E++]=0,T[E++]=d+d-1,T[E++]=d,T[E++]=0,T[E++]=d;let S;if(h)S=c-1;else{let w=u-1;T[E++]=w,T[E++]=w+d,S=u+c-2}if(T[E++]=S,T[E++]=S+d,!A){let w=u+S-1;T[E++]=w,T[E]=w+d}return a.indices=T,a}function yT(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,re.WGS84),r=y(e.rotation,0),o=y(e.height,0),s=y(e.extrudedHeight,o);this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}yT.packedLength=ce.packedLength+re.packedLength+5;yT.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var poe=new ce,_oe=re.clone(re.UNIT_SPHERE),gT={rectangle:poe,ellipsoid:_oe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};yT.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,poe);t+=ce.packedLength;let r=re.unpack(e,t,_oe);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(gT.granularity=o,gT.height=s,gT.rotation=a,gT.extrudedHeight=c,gT.offsetAttribute=u===-1?void 0:u,new yT(gT))};var p5e=new he;yT.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=bs.computeOptions(t,e._granularity,e._rotation,0,m5e,p5e),r,o;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(r=h5e(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===an.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===an.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,f5e),d=ae.fromRectangle3D(t,n,a,u5e);o=ae.union(f,d)}else{if(r=hoe(e,i),r.attributes.position.values=ui.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===an.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ae.fromRectangle3D(t,n,s)}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Le.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var AT=yT;function CT(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=y(e.ellipsoid,re.WGS84);x5e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(CT.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});CT.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Ln.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var goe=new m,hF=new m,yoe=new m,_5e=new m,g5e=new m,y5e=new m,A5e=new m,Ju=new he,Aoe=new fn(m.UNIT_X,0),xT=new On;function x5e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Ju.longitude=t.west,Ju.latitude=(t.south+t.north)*.5,Ju.height=0;let i=n.cartographicToCartesian(Ju,y5e),r=m.cross(i,m.UNIT_Z,_5e);m.normalize(r,e.westNormal),Ju.longitude=t.east;let o=n.cartographicToCartesian(Ju,A5e),s=m.cross(m.UNIT_Z,o,goe);m.normalize(s,e.eastNormal);let a=m.subtract(i,o,goe);m.magnitude(a)===0&&(a=m.clone(r,a));let c=m.normalize(a,g5e),u=t.south,f;if(u>0){Ju.longitude=(t.west+t.east)*.5,Ju.latitude=u;let A=n.cartographicToCartesian(Ju,xT.origin);m.clone(c,xT.direction);let x=fn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Aoe);Ki.rayPlane(xT,x,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(A,hF)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),hF);let d=m.cross(f,a,yoe);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Ju.longitude=(t.west+t.east)*.5,Ju.latitude=p;let A=n.cartographicToCartesian(Ju,xT.origin);m.negate(c,xT.direction);let x=fn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Aoe);Ki.rayPlane(xT,x,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(A,hF)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),hF);let h=m.cross(a,g,yoe);m.normalize(h,e.northNormal)}var C5e=new m,T5e=new m,E5e=new m(0,-1,0),b5e=new m(0,0,-1),xoe=new m;function S5e(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ce.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),C5e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),T5e),f.z=f.y,f.y=f.x,f.x=0,d=E5e,g=m.UNIT_Y,p=b5e,h=m.UNIT_Z);let A=m.subtract(i,u,xoe),x=m.dot(A,d),C=m.dot(A,p),T=m.subtract(i,f,xoe),E=m.dot(T,g),S=m.dot(T,h);x>0?o+=x*x:E>0&&(o+=E*E),C>0?o+=C*C:S>0&&(o+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}CT.prototype.distanceToCamera=function(e){let t=S5e(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};CT.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};CT.prototype.createDebugVolume=function(e){let t=new B.clone(B.IDENTITY),n=new AT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Tt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var ad=CT;var Yv={},v5e=new m,Coe=new m,Toe=new m,Eoe=new m,boe=new Ln;Yv.validOutline=function(e){let n=Ln.fromPoints(e,boe).halfAxes,i=Z.getColumn(n,0,Coe),r=Z.getColumn(n,1,Toe),o=Z.getColumn(n,2,Eoe),s=m.magnitude(i),a=m.magnitude(r),c=m.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};Yv.computeProjectTo2DArguments=function(e,t,n,i){let r=Ln.fromPoints(e,boe),o=r.halfAxes,s=Z.getColumn(o,0,Coe),a=Z.getColumn(o,1,Toe),c=Z.getColumn(o,2,Eoe),u=m.magnitude(s),f=m.magnitude(a),d=m.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,h;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(h=a),(p===u||p===f)&&(h=c),m.normalize(g,n),m.normalize(h,i),m.clone(r.center,t),!0};function Soe(e,t,n,i,r){let o=m.subtract(e,t,v5e),s=m.dot(n,o),a=m.dot(i,o);return H.fromElements(s,a,r)}Yv.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Soe(i[o],e,t,n);return r}};Yv.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Soe(i,e,t,n,r)}};var dg=Yv;function mg(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(mg.prototype,{length:{get:function(){return this._length}}});mg.prototype.enqueue=function(e){this._array.push(e),this._length++};mg.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};mg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};mg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};mg.prototype.clear=function(){this._array.length=this._offset=this._length=0};mg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var H0=mg;var ro={};ro.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};ro.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};ro.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=ro.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var G0=new H;function Ioe(e,t,n,i){return H.subtract(t,e,G0),H.multiplyByScalar(G0,n/i,G0),H.add(e,G0,G0),[G0.x,G0.y]}var hg=new m;function w5e(e,t,n,i){return m.subtract(t,e,hg),m.multiplyByScalar(hg,n/i,hg),m.add(e,hg,hg),[hg.x,hg.y,hg.z]}ro.subdivideLineCount=function(e,t,n){let r=m.distance(e,t)/n,o=Math.max(0,Math.ceil(P.log2(r)));return Math.pow(2,o)};var q6=new he,X6=new he,D5e=new he,I5e=new m,voe=new Ba;ro.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,q6),o=e.cartesianToCartographic(n,X6),a=new Ba(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};ro.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=ro.subdivideLineCount(n,i,r),a=H.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Ioe(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};ro.subdivideLine=function(e,t,n,i){let r=ro.subdivideLineCount(e,t,n),o=m.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=w5e(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};ro.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,q6),c=n.cartesianToCartographic(r,X6);voe.setEndPoints(a,c);let u=voe.surfaceDistance/o,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=H.distance(e,t),g=p/d,h=s;h.length=d*2;let A=0;for(let x=0;x<d;x++){let C=Ioe(e,t,x*g,p);h[A++]=C[0],h[A++]=C[1]}return h};ro.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,q6),s=e.cartesianToCartographic(n,X6),a=new Ba(o,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(r)||(r=[]);let p=r;p.length=f*3;let g=0;for(let h=0;h<f;h++){let A=a.interpolateUsingSurfaceDistance(h*d,D5e),x=e.cartographicToCartesian(A,I5e);p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}return p};var P5e=new m,O5e=new m,R5e=new m,M5e=new m;ro.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=y(i,re.WGS84);let o=P5e,s=O5e,a=R5e,c=M5e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)m.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(o,n,s),s=m.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=m.clone(a,c)),s=m.multiplyByScalar(o,t,s),s=m.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};ro.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new H0;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Cr(u,m.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Cr(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};ro.polygonsFromHierarchy=function(e,t,n,i,r){let o=[],s=[],a=new H0;for(a.enqueue(e);a.length!==0;){let c=a.dequeue(),u=c.positions,f=c.holes,d,p;if(i)for(p=u.length,d=0;d<p;d++)r.scaleToGeodeticSurface(u[d],u[d]);if(t||(u=Cr(u,m.equalsEpsilon,!0)),u.length<3)continue;let g=n(u);if(!l(g))continue;let h=[],A=ui.computeWindingOrder2D(g);A===ts.CLOCKWISE&&(g.reverse(),u=u.slice().reverse());let x=u.slice(),C=l(f)?f.length:0,T=[],E;for(d=0;d<C;d++){let S=f[d],w=S.positions;if(i)for(p=w.length,E=0;E<p;++E)r.scaleToGeodeticSurface(w[E],w[E]);if(t||(w=Cr(w,m.equalsEpsilon,!0)),w.length<3)continue;let D=n(w);if(!l(D))continue;A=ui.computeWindingOrder2D(D),A===ts.CLOCKWISE&&(D.reverse(),w=w.slice().reverse()),T.push(w),h.push(x.length),x=x.concat(w),g=g.concat(D);let R=0;for(l(S.holes)&&(R=S.holes.length),E=0;E<R;E++)a.enqueue(S.holes[E])}o.push({outerRing:u,holes:T}),s.push({positions:x,positions2D:g,holes:h})}return{hierarchy:o,polygons:s}};var B5e=new H,L5e=new m,N5e=new Ne,F5e=new Z;ro.computeBoundingRectangle=function(e,t,n,i,r){let o=Ne.fromAxisAngle(e,i,N5e),s=Z.fromQuaternion(o,F5e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=m.clone(n[p],L5e);Z.multiplyByVector(s,g,g);let h=t(g,B5e);l(h)&&(a=Math.min(a,h.x),c=Math.max(c,h.x),u=Math.min(u,h.y),f=Math.max(f,h.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};ro.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=ui.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let x=0;x<d;x++){let C=c[x];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let h={attributes:{position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Le.TRIANGLES};u&&(h.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H.packArray(f)}));let A=new dt(h);return o.normal?Vn.computeNormal(A):A}if(s===$t.GEODESIC)return ui.computeSubdivision(e,c,a,f,i);if(s===$t.RHUMB)return ui.computeRhumbLineSubdivision(e,c,a,f,i)};var woe=[],Doe=[],U5e=new m,V5e=new m;ro.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,h,A=e.length,x=0,C=0,T=l(t),E=T?t.positions:void 0;if(r)for(a=A*3*2,s=new Array(a*2),T&&(h=A*2*2,g=new Array(h*2)),c=0;c<A;c++)u=e[c],f=e[(c+1)%A],s[x]=s[x+a]=u.x,++x,s[x]=s[x+a]=u.y,++x,s[x]=s[x+a]=u.z,++x,s[x]=s[x+a]=f.x,++x,s[x]=s[x+a]=f.y,++x,s[x]=s[x+a]=f.z,++x,T&&(d=E[c],p=E[(c+1)%A],g[C]=g[C+h]=d.x,++C,g[C]=g[C+h]=d.y,++C,g[C]=g[C+h]=p.x,++C,g[C]=g[C+h]=p.y,++C);else{let O=P.chordLength(i,n.maximumRadius),L=0;if(o===$t.GEODESIC)for(c=0;c<A;c++)L+=ro.subdivideLineCount(e[c],e[(c+1)%A],O);else if(o===$t.RHUMB)for(c=0;c<A;c++)L+=ro.subdivideRhumbLineCount(n,e[c],e[(c+1)%A],O);for(a=(L+A)*3,s=new Array(a*2),T&&(h=(L+A)*2,g=new Array(h*2)),c=0;c<A;c++){u=e[c],f=e[(c+1)%A];let N,_;T&&(d=E[c],p=E[(c+1)%A]),o===$t.GEODESIC?(N=ro.subdivideLine(u,f,O,Doe),T&&(_=ro.subdivideTexcoordLine(d,p,u,f,O,woe))):o===$t.RHUMB&&(N=ro.subdivideRhumbLine(n,u,f,O,Doe),T&&(_=ro.subdivideTexcoordRhumbLine(d,p,n,u,f,O,woe)));let b=N.length;for(let v=0;v<b;++v,++x)s[x]=N[v],s[x+a]=N[v];if(s[x]=f.x,s[x+a]=f.x,++x,s[x]=f.y,s[x+a]=f.y,++x,s[x]=f.z,s[x+a]=f.z,++x,T){let v=_.length;for(let I=0;I<v;++I,++C)g[C]=_[I],g[C+h]=_[I];g[C]=p.x,g[C+h]=p.x,++C,g[C]=p.y,g[C+h]=p.y,++C}}}A=s.length;let S=Ue.createTypedArray(A/3,A-e.length*6),w=0;for(A/=6,c=0;c<A;c++){let O=c,L=O+1,N=O+A,_=N+1;u=m.fromArray(s,O*3,U5e),f=m.fromArray(s,L*3,V5e),!m.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(S[w++]=O,S[w++]=N,S[w++]=L,S[w++]=L,S[w++]=N,S[w++]=_)}let D={attributes:new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Le.TRIANGLES};return T&&(D.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new dt(D)};var Xn=ro;function k5e(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:Le.LINES})}function W0(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+1}W0.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new W0(t)};W0.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var z5e={polygonHierarchy:{}};W0.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new W0(z5e)),n._polygonHierarchy=i,n.packedLength=r,n};W0.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Cr(n,m.equalsEpsilon,!0),n.length<3||!dg.validOutline(n))return;let r=Xn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Tt({geometry:k5e(r[c])});o.push(u)}let s=Vn.combineInstances(o)[0],a=ae.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var cd=W0;var pF=new he;function qv(e){let t=V_.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),r=y(e.ellipsoid,re.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=J5e(t,n,i,r);this._boundingPlanes=o;let s=e6e(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=n9(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=n9(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=n9(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();pF=r.cartesianToCartographic(c,pF),pF.height=(i+n)/2,this.center=r.cartographicToCartesian(pF,c),this._boundingSphere=ae.fromPoints(s)}var H5e=new m,G5e=new he,W5e=new m,j5e=new he,Y5e=new m,q5e=new m,X5e=new m,K5e=new m;function J5e(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,H5e),a=i.cartesianToCartographic(o,G5e);a.height=n;let c=i.cartographicToCartesian(a,W5e),u=fn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,h;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,h=i.cartesianToCartographic(g,j5e),h.height=t;let x=fn.getPointDistance(u,i.cartographicToCartesian(h,Y5e));x<f&&(f=x)}let A=fn.clone(u);for(A.normal=m.negate(A.normal,A.normal),A.distance=A.distance*-1+f,r[1]=A,d=0;d<4;d++){g=p[d];let x=p[(d+1)%4],C=i.geodeticSurfaceNormal(g,q5e),T=m.subtract(x,g,K5e),E=m.cross(T,C,X5e);E=m.normalize(E,E),r[2+d]=fn.fromPointNormal(g,E)}return r}var j0=new m,Y0=new m,q0=new m,K6=new m,J6=new m,Z6=new m,Z5e=new m,Q5e=new m,$5e=new m,Q6=new m,$6=new m,e9=new m,pg=new m,Bm=new Z;function Poe(e,t,n){j0=e.normal,Y0=t.normal,q0=n.normal,K6=m.multiplyByScalar(e.normal,-e.distance,K6),J6=m.multiplyByScalar(t.normal,-t.distance,J6),Z6=m.multiplyByScalar(n.normal,-n.distance,Z6),Q6=m.multiplyByScalar(m.cross(Y0,q0,Z5e),m.dot(K6,j0),Q6),$6=m.multiplyByScalar(m.cross(q0,j0,Q5e),m.dot(J6,Y0),$6),e9=m.multiplyByScalar(m.cross(j0,Y0,$5e),m.dot(Z6,q0),e9),Bm[0]=j0.x,Bm[1]=Y0.x,Bm[2]=q0.x,Bm[3]=j0.y,Bm[4]=Y0.y,Bm[5]=q0.y,Bm[6]=j0.z,Bm[7]=Y0.z,Bm[8]=q0.z;let i=Z.determinant(Bm);return pg=m.add(Q6,$6,pg),pg=m.add(pg,e9,pg),new m(pg.x/i,pg.y/i,pg.z/i)}function e6e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Poe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Poe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var t9=new m,TT=new m;function n9(e,t){let n=[];for(let i=0;i<4;i++)t9=m.subtract(t[(i+1)%4],t[i],t9),TT=m.cross(e.normal,t9,TT),TT=m.normalize(TT,TT),n[i]=m.clone(TT);return n}Object.defineProperties(qv.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var i9=new m;qv.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;fn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):fn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,fn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=r9(fn.projectPointOntoPlane(c,t,i9),i[0],c,r),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Ooe(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=r9(fn.projectPointOntoPlane(c,t,i9),i[o],c,this._edgeNormals[n[o]]),d=m.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=r9(fn.projectPointOntoPlane(this._boundingPlanes[1],t,i9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+u)%4]):m.distance(t,this._vertices[4+(n[1]-2+u)%4])};var t6e=new m,n6e=new m;function Ooe(e,t,n){let i=m.subtract(n,t,t6e),r=m.subtract(e,t,n6e),o=m.dot(i,r);if(o<=0)return t;let s=m.dot(i,i);return o>=s?n:(o=o/s,new m((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var i6e=new fn(m.UNIT_X,0);function r9(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=fn.fromPointNormal(t[c],i[c],i6e);fn.getPointDistance(u,e)<0||(a=Ooe(e,t[c],t[(c+1)%4]),o=m.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}qv.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?tn.INSIDE:n===this._vertices.length?tn.OUTSIDE:tn.INTERSECTING};qv.prototype.createDebugVolume=function(e){let t=new B.clone(B.IDENTITY),n=new cd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=cd.createGeometry(n),r=new Tt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),o=new cd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=cd.createGeometry(o),a=new Tt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new cd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=cd.createGeometry(f);c[u]=new Tt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:zt.fromColor(e)}})}return new wn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var _F=qv;var r6e=new m(1,1,1),gF=Math.cos,yF=Math.sin;function ET(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,r6e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,P.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}ET.packedLength=2*m.packedLength+8;ET.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var Roe=new m,Moe=new m,Tp={radii:Roe,innerRadii:Moe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};ET.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Roe);t+=m.packedLength;let r=m.unpack(e,t,Moe);t+=m.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(Tp.minimumClock=o,Tp.maximumClock=s,Tp.minimumCone=a,Tp.maximumCone=c,Tp.stackPartitions=u,Tp.slicePartitions=f,Tp.subdivisions=d,Tp.offsetAttribute=p===-1?void 0:p,new ET(Tp))};ET.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=re.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-o)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,A=!1;g&&(p=2,o>0&&(h=!0,d+=u),s<Math.PI&&(A=!0,d+=u));let x=a*p*(f+u),C=new Float64Array(x*3),T=2*(x+d-(u+f)*p),E=Ue.createTypedArray(x,T),S,w,D,R,O=0,L=new Array(f),N=new Array(f);for(S=0;S<f;S++)R=o+S*(s-o)/(f-1),L[S]=yF(R),N[S]=gF(R);let _=new Array(a),b=new Array(a);for(S=0;S<a;S++)D=i+S*(r-i)/(a-1),_[S]=yF(D),b[S]=gF(D);for(S=0;S<f;S++)for(w=0;w<a;w++)C[O++]=t.x*L[S]*b[w],C[O++]=t.y*L[S]*_[w],C[O++]=t.z*N[S];if(g)for(S=0;S<f;S++)for(w=0;w<a;w++)C[O++]=n.x*L[S]*b[w],C[O++]=n.y*L[S]*_[w],C[O++]=n.z*N[S];for(L.length=a,N.length=a,S=0;S<a;S++)R=o+S*(s-o)/(a-1),L[S]=yF(R),N[S]=gF(R);for(_.length=u,b.length=u,S=0;S<u;S++)D=i+S*(r-i)/(u-1),_[S]=yF(D),b[S]=gF(D);for(S=0;S<a;S++)for(w=0;w<u;w++)C[O++]=t.x*L[S]*b[w],C[O++]=t.y*L[S]*_[w],C[O++]=t.z*N[S];if(g)for(S=0;S<a;S++)for(w=0;w<u;w++)C[O++]=n.x*L[S]*b[w],C[O++]=n.y*L[S]*_[w],C[O++]=n.z*N[S];for(O=0,S=0;S<f*p;S++){let M=S*a;for(w=0;w<a-1;w++)E[O++]=M+w,E[O++]=M+w+1}let v=f*a*p;for(S=0;S<u;S++)for(w=0;w<a-1;w++)E[O++]=v+S+w*u,E[O++]=v+S+(w+1)*u;if(g)for(v=f*a*p+u*a,S=0;S<u;S++)for(w=0;w<a-1;w++)E[O++]=v+S+w*u,E[O++]=v+S+(w+1)*u;if(g){let M=f*a*p,F=M+a*u;if(h)for(S=0;S<u;S++)E[O++]=M+S,E[O++]=F+S;if(A)for(M+=a*u-u,F+=a*u-u,S=0;S<u;S++)E[O++]=M+S,E[O++]=F+S}let I=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let M=C.length,F=e._offsetAttribute===an.NONE?0:1,k=new Uint8Array(M/3).fill(F);I.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return new dt({attributes:I,indices:E,primitiveType:Le.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Zu=ET;function bT(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Zu(i),this._workerName="createSphereOutlineGeometry"}bT.packedLength=Zu.packedLength;bT.pack=function(e,t,n){return Zu.pack(e._ellipsoidGeometry,t,n)};var o6e=new Zu,X0={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};bT.unpack=function(e,t,n){let i=Zu.unpack(e,t,o6e);return X0.stackPartitions=i._stackPartitions,X0.slicePartitions=i._slicePartitions,X0.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,X0.radii),n._ellipsoidGeometry=new Zu(X0),n):(X0.radius=i._radii.x,new bT(X0))};bT.createGeometry=function(e){return Zu.createGeometry(e._ellipsoidGeometry)};var _g=bT;function ST(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(ST.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});ST.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};ST.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};ST.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};ST.prototype.createDebugVolume=function(e){let t=new _g({radius:this.radius}),n=B.fromTranslation(this.center,new B.clone(B.IDENTITY)),i=new Tt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var gg=ST;var s6e=new m,a6e=new m,c6e=new m,l6e=new m;function K0(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,P.EPSILON7/i,n)}function o9(e,t){let n=m.normalize(e,l6e),i=m.equalsEpsilon(n,m.UNIT_X,P.EPSILON6)?m.UNIT_Y:m.UNIT_X;return K0(e,i,t)}function Boe(e){let t=Z.getColumn(e,0,s6e),n=Z.getColumn(e,1,a6e),i=Z.getColumn(e,2,c6e),r=m.equals(t,m.ZERO),o=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(r&&!o&&!s?t=K0(n,i,t):!r&&o&&!s?n=K0(t,i,n):!r&&!o&&s?i=K0(n,t,i):r?o?s||(t=o9(i,t),n=K0(i,t,n)):(t=o9(n,t),i=K0(n,t,i)):(n=o9(t,n),i=K0(n,t,i)),Z.setColumn(e,0,t,e),Z.setColumn(e,1,n,e),Z.setColumn(e,2,i,e),e)}function vT(e,t){t=Boe(t),this._orientedBoundingBox=new Ln(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(vT.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});vT.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};vT.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};vT.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=Boe(t),Z.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};vT.prototype.createDebugVolume=function(e){let t=new sm({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=B.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Tt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:zt.fromColor(e)}});return new wn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var ld=vT;function qr(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||ii(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?B.unpack(n.transform):B.clone(B.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=B.multiply(a,this.transform,new B),u=l(i)?i._initialTransform:B.IDENTITY;this._initialTransform=B.multiply(u,this.transform,new B),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,qr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&qr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Wr.REPLACE:Wr.ADD):l(i)?p=i.refine:p=Wr.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,A,x,C;if(t=ve.createIfNeeded(t),o)A=Yr.UNLOADED,x=t.clone();else if(l(s)){let w=s.uri;l(s.url)&&(qr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),w=s.url),w===""?(qr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new Hv(e,this),h=!0,A=Yr.READY):(A=Yr.UNLOADED,x=t.getDerivedResource({url:w}),C=cc.getServerKey(x.getUrlComponent()))}else g=new Hv(e,this),h=!0,A=Yr.READY;this._content=g,this._contentResource=x,this._contentState=A,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=aF(e,n),this.cacheNode=void 0;let T=n.expire,E,S;l(T)&&(E=T.duration,l(T.date)&&(S=ee.fromIso8601(T.date))),this.expireDuration=E,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=od.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}qr._deprecationWarning=$;Object.defineProperties(qr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Yr.READY}},contentUnloaded:{get:function(){return this._contentState===Yr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Yr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Yr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var yg=new m;function u6e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,yg),c=m.add(s.positionWC,a,yg),u=m.subtract(c,o,yg);if(m.magnitude(u)>r){let S=m.normalize(u,yg),w=m.multiplyByScalar(S,r,yg),D=m.add(o,w,yg),R=m.subtract(D,s.positionWC,yg),O=m.normalize(R,yg);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,O))}else e._foveatedFactor=0;let p=e.refine===Wr.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Nr.PRELOAD_FLIGHT||n._pass===Nr.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),A=n.foveatedConeSize*h;if(e._foveatedFactor<=A)return!1;let x=h-A,C=P.clamp((e._foveatedFactor-A)/x,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),E=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-T<=E}var Foe=new ee;qr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=y(n,1),o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===ne.SCENE2D||u instanceof rn){let g=u.offCenterFrustum;l(g)&&(u=g);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),h=u.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let A=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,C=P.fog(g,A)*x;p-=C}}return p/=e.pixelRatio,p};function f6e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,s=l(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function d6e(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}qr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:is.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==is.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=d6e(n,this),this._priorityProgressiveResolution=f6e(n,this),this.priorityDeferred=u6e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};qr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(Foe);ee.lessThan(this.expireDate,e)&&(this._contentState=Yr.EXPIRED,this._expiredContent=this._content)}};function m6e(e){if(!l(e.expireDuration))return;let t=ee.now(Foe);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function h6e(e){return function(){return e._priority}}qr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?p6e(this):g6e(this)};function p6e(e){let t=e._content,n=e._tileset;if(!l(t)){let r=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new cF(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Yr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Yr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Yr.FAILED,r})}async function _6e(e,t,n,i,r){let o=e._contentState;e._contentState=Yr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ni.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Yr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ni.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await y6e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Yr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Yr.FAILED,a}}function g6e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new $r({throttle:!0,throttleByServer:!0,type:ns.TILES3D,priorityFunction:h6e(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return _6e(e,r,i,n,o)}async function y6e(e,t){let n=xp(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ts.GEOMETRY||n.contentType===Ts.VECTOR,(n.contentType===Ts.IMPLICIT_SUBTREE||n.contentType===Ts.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ts.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r,o=dT[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?r=await Promise.resolve(o(i,e,e._contentResource,n.binaryPayload.buffer,0)):r=await Promise.resolve(o(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=mT(i,s));let a=hT(i,s);return l(a)&&(r.group=new vC({metadata:a})),r}qr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};qr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Yr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Uoe=new ae;function a9(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Uoe);e._boundingVolume2D=new gg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function A6e(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Uoe);e._contentBoundingVolume2D=new gg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}qr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=a9(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==tn.INSIDE,s===tn.OUTSIDE)return is.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};qr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return tn.INSIDE;if(this._visibilityPlaneMask===is.MASK_INSIDE)return tn.INSIDE;let t=e.cullingVolume,n=A6e(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let o=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=o!==tn.INSIDE,o===tn.OUTSIDE)return tn.OUTSIDE}return t.computeVisibility(n)};qr.prototype.distanceToTile=function(e){return a9(this,e).distanceToCamera(e)};var x6e=new m;qr.prototype.distanceToTileCenter=function(e){let n=a9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,x6e);return m.dot(e.camera.directionWC,i)};qr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Voe=new Z,koe=new m,C6e=new Z,zoe=new m,Hoe=new ce,T6e=new Ln,s9=new B;function E6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],zoe),r=Z.fromArray(e,3,C6e);i=B.multiplyByPoint(t,i,i);let o=B.getMatrix3(t,Voe);return r=Z.multiply(o,r,r),l(n)?(n.update(i,r),n):new ld(i,r)}function b6e(e,t,n,i){let r=ce.unpack(e,0,Hoe),o=e[4],s=e[5],a=Ln.fromRectangle(r,o,s,re.WGS84,T6e),c=a.center,u=a.halfAxes;t=B.multiplyTransformation(t,B.inverseTransformation(n,s9),s9),c=B.multiplyByPoint(t,c,c);let f=B.getMatrix3(t,Voe);return u=Z.multiply(f,u,u),l(i)&&i instanceof ld?(i.update(c,u),i):new ld(c,u)}function S6e(e,t,n,i){if(!B.equalsEpsilon(t,n,P.EPSILON8))return b6e(e,t,n,i);if(l(i))return i;let r=ce.unpack(e,0,Hoe);return new ad({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function v6e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],zoe),r=e[3];i=B.multiplyByPoint(t,i,i);let o=B.getScale(t,koe),s=m.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new gg(i,r)}qr.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new de("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new _F(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:r,sphere:o}=e;if(l(i))return E6e(i,t,n);if(l(r))return S6e(r,t,this._initialTransform,n);if(l(o))return v6e(o,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};qr.prototype.updateTransform=function(e){e=y(e,B.IDENTITY);let t=B.multiplyTransformation(e,this.transform,s9);if(!!B.equals(t,this.computedTransform))return;B.clone(t,this.computedTransform);let i=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};qr.prototype.updateGeometricErrorScale=function(){let e=B.getScale(this.computedTransform,koe),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function w6e(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=zt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function D6e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Yr.FAILED,r}}function I6e(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}qr.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;I6e(this,e),w6e(this,e,t,n),D6e(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Se.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var Loe=[];qr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(m6e(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=Yr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Loe;try{this._content.update(e,t)}catch(i){throw this._contentState=Yr.FAILED,i}Loe.length=0,t.commandList=n};function Noe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function AF(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}qr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,h=o,A=Math.pow(10,g),x=g+h,C=Math.pow(10,x),T=AF(this._depth,n.depth,i.depth);T=t?1-T:T;let S=!e.isSkippingLevelOfDetail&&this.refine===Wr.REPLACE?AF(this._priorityHolder._distanceToCamera,n.distance,i.distance):AF(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),w=Noe(S,a,s),D=this._priorityProgressiveResolution?0:p,R=AF(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),O=Noe(R,u,c),L=this.priorityDeferred?A:0,N=e._pass===Nr.PRELOAD_FLIGHT?0:C;this._priority=T+w+D+O+L+N};qr.prototype.isDestroyed=function(){return!1};qr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var ud=qr;function Ep(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Ep.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ep.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ep.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ep.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Ep.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Ep.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var Xv=Ep;function bp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(bp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bp.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};bp.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};bp.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};bp.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};bp.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};bp.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};bp.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var xF=bp;function Goe(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),r;l(i)&&(r=new xF({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new Xv({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new Xv({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Goe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var J0=Goe;var Woe={},P6e=new m;Woe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof ld||i instanceof ad){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=od.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof ld||a instanceof ad)){e._optimChildrenWithinParent=od.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=m.subtract(c.center,r.center,P6e),f=m.magnitude(u);m.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=od.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===od.USE_OPTIMIZATION};var CF=Woe;function Kv(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(Kv.prototype,{length:{get:function(){return this._length}}});function O6e(e,t,n){this.item=e,this.previous=t,this.next=n}Kv.prototype.add=function(e){let t=new O6e(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function joe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}Kv.prototype.remove=function(e){l(e)&&(joe(this,e),--this._length)};Kv.prototype.splice=function(e,t){if(e===t)return;joe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var TF=Kv;function Z0(){this._list=new TF,this._sentinel=this._list.add(),this._trimTiles=!1}Z0.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Z0.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Z0.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Z0.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Z0.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=e.maximumMemoryUsage*1024*1024,o=this._sentinel,s=i.head;for(;s!==o&&(e.totalMemoryUsageInBytes>r||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};Z0.prototype.trim=function(){this._trimTiles=!0};var EF=Z0;function bF(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function l9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}bF.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=l9(e,n),this._referenceMaximum[n]=l9(t,n)};function R6e(e,t){let n=e.tilePropertyName;if(l(n)){let i=l9(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var c9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];bF.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=R6e(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,u=c9.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=c9[d],A=c9[p],x=z.clone(z.WHITE);x.red=P.lerp(h.red,A.red,g),x.green=P.lerp(h.green,A.green,g),x.blue=P.lerp(h.blue,A.blue,g),e._debugColor=x};bF.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var SF=bF;function wT(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}wT.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function vF(e,t,n,i){let r=t.innerContents,o=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-s:s),l(r)){let d=r.length;for(let p=0;p<d;++p)vF(e,r[p],n,i)}}wT.prototype.incrementSelectionCounts=function(e){vF(this,e,!1,!1)};wT.prototype.incrementLoadCounts=function(e){vF(this,e,!1,!0)};wT.prototype.decrementLoadCounts=function(e){vF(this,e,!0,!0)};wT.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Ag=wT;function Jv(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(Jv.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});Jv.prototype.makeDirty=function(){this._styleDirty=!0};Jv.prototype.resetDirty=function(){this._styleDirty=!1};Jv.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var wF=Jv;function M6e(e,t,n){let i=ii(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!ii(r,"3DTILES_bounding_volume_S2")&&!ii(r,"3DTILES_bounding_volume_cylinder"))throw new de("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new ve({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=B6e(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Ye(a,!0));let c=new ve({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=L6e(t),this.subdivisionScheme=Yo[i.subdivisionScheme],this.branchingFactor=Yo.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function B6e(e){if(ii(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function L6e(e){let t=Ye(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var Q0=M6e;var Zv={};function Yoe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function u9(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function qoe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function f9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}Zv.encode2D=function(e,t){return(Yoe(e)|Yoe(t)<<1)>>>0};Zv.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=qoe(e),t[1]=qoe(e>>1),t};Zv.encode3D=function(e,t,n){return u9(e)|u9(t)<<1|u9(n)<<2};Zv.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=f9(e),t[1]=f9(e>>1),t[2]=f9(e>>2),t};var $0=Zv;function Fr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Yo.OCTREE&&(this.z=e.z)}Object.defineProperties(Fr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Yo.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Yo.OCTREE?$0.encode3D(this.x,this.y,this.z):$0.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Yo.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Fr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Yo.OCTREE){let r=(this.z<<e.level)+e.z;return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Fr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===Yo.OCTREE){let o=Math.floor(this.z/t);return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};Fr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Yo.OCTREE){let o=e.z%n;return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};Fr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Yo.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new Fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Fr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Fr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Fr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===Yo.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};Fr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Yo.OCTREE?this.z===e.z:!0)};Fr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Fr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Fr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Fr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Yo.OCTREE&&(e.z=this.z),e};var Xoe=[0,0,0];Fr.fromMortonIndex=function(e,t,n,i){let r;return e===Yo.OCTREE?(r=$0.decode3D(i,Xoe),new Fr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=$0.decode2D(i,Xoe),new Fr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};Fr.fromTileIndex=function(e,t,n){let i,r,o;return e===Yo.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),Fr.fromMortonIndex(e,t,i,o)};var DT=Fr;function Sp(){}Sp.selectTiles=function(e,t){fe.throwInstantiationError()};Sp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Sp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};Sp.selectTile=function(e,t){if(e.contentVisibility(t)===tn.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&i._selectedTilesToStyle.push(e),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Sp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Sp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Sp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!N6e(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function N6e(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}Sp.updateTile=function(e,t){Koe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,V6e(e),e._shouldSelect=!1,e._finalResolution=!0};function Koe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];Koe(o,t),e._visible=o._visible;return}if(F6e(e,t)){e._visible=!1;return}let i=e.refine===Wr.REPLACE,r=e._optimChildrenWithinParent===od.USE_OPTIMIZATION;if(i&&r&&n&&!U6e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function F6e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Wr.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function U6e(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function V6e(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Gs=Sp;function Joe(){}var Qv={stack:new Qc,stackMaximumLength:0};Joe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=Gs,s=Qv.stack;for(s.push(i);s.length>0;){Qv.stackMaximumLength=Math.max(Qv.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Wr.ADD,u=a.refine===Wr.REPLACE,f=k6e(a);f&&z6e(a,s,t),(c||u&&!f)&&(H6e(e,a),r(a,t),G6e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return Qv.stack.trim(Qv.stackMaximumLength),n};function k6e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function z6e(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function H6e(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function G6e(e,t){e.contentAvailable&&e.contentVisibility(t)!==tn.OUTSIDE&&e.tileset._selectedTiles.push(e)}var DF=Joe;function Zoe(){}var $v={stack:new Qc,stackMaximumLength:0},ew={stack:new Qc,stackMaximumLength:0};Zoe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;j6e(n,t),$v.stack.trim($v.stackMaximumLength),ew.stack.trim(ew.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function d9(e,t){e.contentAvailable&&Gs.selectTile(e,t)}function W6e(e,t,n){let i=e.refine===Wr.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Gs;for(let h=0;h<o.length;++h)s(o[h],n);o.sort(Gs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let h=0;h<o.length;++h){let A=o[h];if(A.isVisible?(t.push(A),A._foveatedFactor<g&&(p=h,g=A._foveatedFactor),d=!0):(u||r.loadSiblings)&&(A._foveatedFactor<g&&(p=h,g=A._foveatedFactor),a(A,n),c(A,n)),u){let x;A._inRequestVolume?A.hasRenderableContent?x=A.contentAvailable:x=Y6e(A,n):x=!1,f=f&&x}}if(d||(f=!1),p!==-1&&i){let h=o[p];h._wasMinPriorityChild=!0;let A=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;A._foveatedFactor=Math.min(h._foveatedFactor,A._foveatedFactor),A._distanceToCamera=Math.min(h._distanceToCamera,A._distanceToCamera);for(let x=0;x<o.length;++x)o[x]._priorityHolder=A}return f}function j6e(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Gs,a=$v.stack;for(a.push(e);a.length>0;){$v.stackMaximumLength=Math.max($v.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?W6e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Wr.ADD?(d9(c,t),r(c,t)):c.refine===Wr.REPLACE&&(r(c,t),d&&d9(c,t)):(n._emptyTiles.push(c),r(c,t),d&&d9(c,t)),o(c,t),s(c,t)}}function Y6e(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Gs,s=!0,a=ew.stack;for(a.push(e);a.length>0;){ew.stackMaximumLength=Math.max(ew.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(r(c,t),o(c,t)),d)for(let g=0;g<f;++g){let h=u[g];a.push(h)}}return s}var IF=Zoe;function Qoe(){}var tw={stack:new Qc,stackMaximumLength:0},nw={stack:new Qc,stackMaximumLength:0},vp={stack:new Qc,stackMaximumLength:0,ancestorStack:new Qc,ancestorStackMaximumLength:0},q6e=2;Qoe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;$6e(n,t),e9e(n,t),tw.stack.trim(tw.stackMaximumLength),nw.stack.trim(nw.stackMaximumLength),vp.stack.trim(vp.stackMaximumLength),vp.ancestorStack.trim(vp.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function X6e(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Gs,o=nw.stack;for(o.push(e);o.length>0;){nw.stackMaximumLength=Math.max(nw.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<q6e&&o.push(u))}}}function PF(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:X6e(e,t)}function K6e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function J6e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Z6e(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Gs;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(Gs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function Q6e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function $6e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Gs,c=tw.stack;for(c.push(e);c.length>0;){tw.stackMaximumLength=Math.max(tw.stackMaximumLength,c.length);let u=c.pop();K6e(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Z6e(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Wr.ADD?(PF(u,t),o(u,t)):u.refine===Wr.REPLACE&&(Q6e(u,i)?(o(u,t),p&&PF(u,t)):p?(PF(u,t),o(u,t)):J6e(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&PF(u,t)),s(u,t),a(u,t)}}function e9e(e,t){let{selectTile:n,canTraverse:i}=Gs,{stack:r,ancestorStack:o}=vp,s;for(r.push(e);r.length>0||o.length>0;){if(vp.stackMaximumLength=Math.max(vp.stackMaximumLength,r.length),vp.ancestorStackMaximumLength=Math.max(vp.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Wr.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var OF=Qoe;function mo(e){e=y(e,y.EMPTY_OBJECT),this._marsOptions=y(e.marsOptions,{}),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new EF,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Qc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=y(e.maximumMemoryUsage,512),this._styleEngine=new wF,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?B.clone(e.modelMatrix):B.clone(B.IDENTITY),this._statistics=new Ag,this._statisticsLast=new Ag,this._statisticsPerPass=new Array(Nr.NUMBER_OF_PASSES);for(let i=0;i<Nr.NUMBER_OF_PASSES;++i)this._statisticsPerPass[i]=new Ag;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new SF(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,re.WGS84),this._initialClippingPlanesOriginMatrix=B.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,xn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Vl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new tp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Z_,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new SC,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,nl.NONE),this._projectTo2D=y(e.projectTo2D,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Rt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let t=y(e.featureIdLabel,"featureId_0");typeof t=="number"&&(t=`featureId_${t}`),this._featureIdLabel=t;let n=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");if(typeof n=="number"&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,l(e.url)){$("Cesium3DTileset options.url","Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.");let i=this,r;this._readyPromise=Promise.resolve(e.url).then(function(o){let s;return r=ve.createIfNeeded(o),i._resource=r,i._credits=r.credits,r.extension==="json"?s=r.getBaseUri(!0):r.isDataUri&&(s=""),i._url=r.url,i._basePath=s,mo.loadJson(r)}).then(function(o){if(!i.isDestroyed())return nse(r,o).then(s=>(i._metadataExtension=s,o))}).then(function(o){if(i.isDestroyed())return;i._geometricError=o.geometricError,i._scaledGeometricError=o.geometricError,i._root=i.loadTileset(r,o);let s=l(o.asset.gltfUpAxis)?hr.fromName(o.asset.gltfUpAxis):hr.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,hr.X),u=o.asset;i._asset=u,i._properties=o.properties,i._extensionsUsed=o.extensionsUsed,i._extensions=o.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=o.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let h=f.cesium.credits,A=i._credits;l(A)||(A=[],i._credits=A);for(let x=0;x<h.length;++x){let C=h[x];A.push(new It(C.html,i._showCreditsOnScreen))}}let p=i._root.createBoundingVolume(o.root.boundingVolume,B.IDENTITY).boundingSphere.center,g=i._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>ai._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=B.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(mo.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){As.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return $("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),l(this._root)}},readyPromise:{get:function(){return $("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return $("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(B.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):B.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});mo.fromIonAssetId=async function(e,t){let n=await ma.fromAssetId(e);return mo.fromUrl(n,t)};mo.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await mo.loadJson(n),o=await nse(n,r),s=new mo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras;let c=n.credits;l(c)||(c=[]);let u=a.extras;if(l(u)&&l(u.cesium)&&l(u.cesium.credits)){let x=u.cesium.credits;for(let C=0;C<x.length;++C){let T=x[C];c.push(new It(T.html,s._showCreditsOnScreen))}}s._credits=c;let f=l(r.asset.gltfUpAxis)?hr.fromName(r.asset.gltfUpAxis):hr.Y,d=y(t.modelUpAxis,f),p=y(t.modelForwardAxis,hr.X);s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=d,s._modelForwardAxis=p,s._root=s.loadTileset(n,r);let h=s._root.createBoundingVolume(r.root.boundingVolume,B.IDENTITY).boundingSphere.center,A=s._ellipsoid.cartesianToCartographic(h);return l(A)&&A.height>ai._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=B.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};mo.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};mo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};mo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&mo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=$oe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Wr.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=$oe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&CF.checkChildrenWithinParent(c)}return s};function $oe(e,t,n,i){if(!(l(n.implicitTiling)||ii(n,"3DTILES_implicit_tiling")))return new ud(e,t,n,i);let o=e.schema,s=new Q0(t,n,o),a=new DT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ye(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new ud(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function nse(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Fi.getSchemaLoader({resource:e});else if(l(n.schema))i=Fi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new J0({schema:i.schema,metadataJson:n});return Fi.unload(i),r}var ese=new m,t9e=new he,n9e=new B,i9e=new m,r9e=new m,o9e=new m;function s9e(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof ad)n=m.normalize(a.positionWC,ese),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let A=B.inverseTransformation(c.computedTransform,n9e),x=t.mapProjection.ellipsoid,C=u.boundingVolume,T=B.multiplyByPoint(A,C.center,i9e);if(m.magnitude(T)>x.minimumRadius){let E=he.fromCartesian(T,x,t9e);n=m.normalize(a.positionWC,ese),i=a.directionWC,r=a.positionCartographic.height,o=0,s=E.height*2}else{let E=B.multiplyByPoint(A,a.positionWC,r9e);if(n=m.UNIT_Z,i=B.multiplyByPointAsVector(A,a.directionWC,o9e),i=m.normalize(i,i),r=E.z,u instanceof ld){let S=c._header.boundingVolume.box[11];o=T.z-S,s=T.z+S}else if(u instanceof gg){let S=C.radius;o=T.z-S,s=T.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function a9e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{ise(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?_9e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function c9e(e,t){return e._priority-t._priority}mo.prototype.postPassesUpdate=function(e){l(this._root)&&(l9e(this,e),y9e(this,e),this._cache.unloadTiles(this,ose),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};mo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;d9e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&s9e(this,e),e.newFrame&&this._cache.reset()};function l9e(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Yr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function u9e(e){let t=e._requestedTiles;t.sort(c9e);for(let n=0;n<t.length;++n)a9e(e,t[n])}function ise(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`))}function f9e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Yr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}function d9e(e,t){f9e(e);let n=e._processingQueue,i=e._statistics,r;for(let o=0;o<n.length;++o){r=n[o];try{r.process(e,t),r.contentReady&&(--i.numberOfTilesProcessing,e.tileLoad.raiseEvent(r))}catch(s){--i.numberOfTilesProcessing,ise(s,e,r)}}}var RF=new m,m9e={maximumFractionDigits:3};function tse(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,m9e):Math.round(t).toLocaleString()}function m9(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=m.clone(i,RF);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=m.normalize(i,RF);o=m.multiplyByScalar(o,.75*n,RF),r=m.add(o,i,RF)}return r}function h9(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` -Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` -Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` -Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,r++),i+=` -Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${tse(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${tse(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` -- ${s[a]}`;r+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function h9e(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:m9(e.debugPickedTile),a=h9(e.debugPickedTile,e,s);a.pixelOffset=new H(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];h9(a,e,m9(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&h9(a,e,m9(a))}}e._tileDebugLabels.update(t)}function p9e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new oi({stencil:0,pass:Se.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Ut.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let h=0;h<s.length;++h){let A=s[h];f&&u.raiseEvent(A),A.update(e,t,n),c.incrementSelectionCounts(A.content),++c.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,A=h.length;i.length+=A;for(let x=g-1;x>=0;--x)i[d+A+x]=i[d+x];for(let x=0;x<A;++x)i[d+x]=h[x]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new dp),h9e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var rse=[];function _9e(e,t){let n=t,i=rse;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(g9e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function ose(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function g9e(e,t){e._cache.unloadTile(e,t,ose),t.destroy()}mo.prototype.trimLoadedTiles=function(){this._cache.trim()};function y9e(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Ag.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function A9e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function x9e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!B.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=B.clone(e.modelMatrix,e._previousModelMatrix)))}function C9e(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,A9e(e),x9e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&u9e(e),p9e(e,t,i),Ag.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];c.showOnScreen=e._showCreditsOnScreen,t.creditDisplay.addCreditToNextFrame(c)}}return o}mo.prototype.getTraversal=function(e){let{pass:t}=e;return t===Nr.MOST_DETAILED_PRELOAD||t===Nr.MOST_DETAILED_PICK?DF:this.isSkippingLevelOfDetail?OF:IF};mo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};mo.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Nr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Nr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Nr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=Nr.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;e.commandList=c,e.camera=y(t.camera,r),e.cullingVolume=y(t.cullingVolume,o);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=C9e(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};mo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};mo.prototype.isDestroyed=function(){return!1};mo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=rse;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};mo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};mo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!mo.supportedExtensions[e[t]])throw new de(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Ga=mo;var T9e=new B;function xg(e,t){t.collectionChanged.addEventListener(xg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}xg.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,T9e),c=ve.createIfNeeded(j.getValueOrUndefined(a._uri,e))),!f){l(u)&&(u.tilesetPrimitive.show=!1);continue}let p=l(u)?u.tilesetPrimitive:void 0;(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],E9e(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=j.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(xg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)p9(this,e[i],t,n);return ue(this)};xg.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};xg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(p9(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],p9(this,o,a,c),s.remove(o.id)};function p9(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function E9e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Ga.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var MF=xg;var b9e=z.WHITE,S9e=z.BLACK,v9e=new H(2,2);function IT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});IT.prototype.getType=function(e){return"Checkerboard"};IT.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,b9e,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,S9e,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,v9e),t};IT.prototype.equals=function(e){return this===e||e instanceof IT&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var iw=IT;var sse={id:void 0};function rw(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function Wa(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new _e,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}Wa.prototype.suspendEvents=function(){this._suspendCount++};Wa.prototype.resumeEvents=function(){this._suspendCount--,rw(this)};Object.defineProperties(Wa.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Wa.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;ee.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),ee.greaterThan(c,t)&&!c.equals(Ge.MAXIMUM_VALUE)&&(t=c)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new bn({start:e,stop:t})};Wa.prototype.add=function(e){e instanceof no||(e=new no(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(Wa.prototype._onEntityDefinitionChanged,this),rw(this),e};Wa.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Wa.prototype.contains=function(e){return this._entities.get(e.id)===e};Wa.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(Wa.prototype._onEntityDefinitionChanged,this),rw(this),!0):!1};Wa.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(Wa.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),rw(this)};Wa.prototype.getById=function(e){return this._entities.get(e)};Wa.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(sse.id=e,t=new no(sse),this.add(t)),t};Wa.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),rw(this)};var Ws=Wa;var BF={id:void 0},PT=new Array(2);function _9(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function ase(e,t,n,i){PT[0]=n,PT[1]=i.id,t[JSON.stringify(PT)]=i.definitionChanged.addEventListener(So.prototype._onDefinitionChanged,e)}function cse(e,t,n,i){PT[0]=n,PT[1]=i.id;let r=JSON.stringify(PT);t[r](),t[r]=void 0}function Cg(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Ws(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(So.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],cse(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(So.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],ase(e,p,g,s);let A=d.getById(s.id);l(A)||(A=f.getById(s.id),l(A)?_9(A):(BF.id=s.id,A=new no(BF)),d.add(A)),A.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(o=0;o<h.length;o++)f.add(h[o]);f.resumeEvents()}function So(e,t){this._owner=t,this._composite=new Ws(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},Cg(this),this._shouldRecomposite=!1}Object.defineProperties(So.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});So.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Cg(this)};So.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Cg(this),!0):!1};So.prototype.removeAllCollections=function(){this._collections.length=0,Cg(this)};So.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};So.prototype.contains=function(e){return this._composite.contains(e)};So.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};So.prototype.getCollection=function(e){return this._collections[e]};So.prototype.getCollectionsLength=function(){return this._collections.length};function LF(e,t){return e.indexOf(t)}function lse(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,Cg(e)}So.prototype.raiseCollection=function(e){let t=LF(this._collections,e);lse(this,t,t+1)};So.prototype.lowerCollection=function(e){let t=LF(this._collections,e);lse(this,t,t-1)};So.prototype.raiseCollectionToTop=function(e){let t=LF(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Cg(this))};So.prototype.lowerCollectionToBottom=function(e){let t=LF(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Cg(this))};So.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};So.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Cg(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};So.prototype.computeAvailability=function(){return this._composite.computeAvailability()};So.prototype.getById=function(e){return this._composite.getById(e)};So.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let h=n[s];cse(this,d,p,h);let A=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(A),l(c)&&(l(u)||(u=o.getById(A),_9(u)),u.merge(c));l(u)||o.removeById(A),u=void 0}let g=t.length;for(s=0;s<g;s++){let h=t[s];ase(this,d,p,h);let A=h.id;for(a=r-1;a>=0;a--)c=i[a].getById(A),l(c)&&(l(u)||(u=o.getById(A),l(u)?_9(u):(BF.id=A,u=new no(BF),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};So.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let h=g[t];if(l(h)){if(d)if(d=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var use=So;function g9(){this._removalFunctions=[]}g9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};g9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Mo=g9;function x9(e,t){return ee.compare(e.start,t.start)}function vo(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(vo.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});vo.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof vo))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!bn.equals(n[o],i[o],t))return!1;return!0};vo.prototype.get=function(e){return this._intervals[e]};vo.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};vo.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};vo.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};vo.prototype.contains=function(e){return this.indexOf(e)>=0};var y9=new bn;vo.prototype.indexOf=function(e){let t=this._intervals;y9.start=e,y9.stop=e;let n=Or(t,y9,x9);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&bn.contains(t[n-1],e)?n-1:~n)};vo.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};vo.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Or(n,e,x9);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=ee.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new bn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new bn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=ee.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new bn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new bn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=ee.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new bn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new bn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};vo.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Or(t,e,x9);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new bn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new bn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new bn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new bn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new bn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new bn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};vo.prototype.intersect=function(e,t,n){let i=new vo,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(ee.lessThan(c.stop,u.start))++r;else if(ee.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=bn.intersect(c,u,new bn,n);f.isEmpty||i.addInterval(f,t)}ee.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};vo.fromJulianDateArray=function(e,t){l(t)||(t=new vo);let n=e.julianDates,i=n.length,r=e.dataCallback,o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new bn({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new bn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new bn({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var ja=new s_,ow=[0,31,28,31,30,31,30,31,31,30,31,30,31];function A9(e,t,n){l(n)||(n=new ee),ee.toGregorianDate(e,ja);let i=ja.millisecond+t.millisecond,r=ja.second+t.second,o=ja.minute+t.minute,s=ja.hour+t.hour,a=ja.day+t.day,c=ja.month+t.month,u=ja.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),ow[2]=a_(u)?29:28;a>ow[c]||c>=13;)a>ow[c]&&(a-=ow[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),ow[2]=a_(u)?29:28;return ja.millisecond=i,ja.second=r,ja.minute=o,ja.hour=s,ja.day=a,ja.month=c,ja.year=u,ee.fromGregorianDate(ja,n)}var w9e=new ee,D9e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function fse(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(D9e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,w9e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var sw=new s_;vo.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=[];if(!fse(n[2],sw))o.push(i,r);else{let s=ee.clone(i);for(o.push(s);ee.compare(s,r)<0;)s=A9(s,sw),ee.compare(r,s)<=0&&ee.clone(r,s),o.push(s)}return vo.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};vo.fromIso8601DateArray=function(e,t){return vo.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};vo.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=y(e.relativeToPrevious,!1),o=[],s,a,c=i.length;for(let u=0;u<c;++u)(fse(i[u],sw)||u===0)&&(r&&l(a)?s=A9(a,sw):s=A9(n,sw),o.push(s),a=s);return vo.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Bo=vo;function I9e(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function eA(){this._eventHelper=new Mo,this._definitionChanged=new _e,this._intervals=new Bo,this._intervals.changedEvent.addEventListener(eA.prototype._intervalsChanged,this)}Object.defineProperties(eA.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});eA.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};eA.prototype.equals=function(e){return this===e||e instanceof eA&&this._intervals.equals(e._intervals,j.equals)};eA.prototype._intervalsChanged=function(){I9e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Sc=eA;function Tg(){this._definitionChanged=new _e,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Tg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Tg.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Tg.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};Tg.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Tg.prototype.equals=function(e){return this===e||e instanceof Tg&&this._composite.equals(e._composite,j.equals)};Tg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var aw=Tg;function Eg(e){this._referenceFrame=y(e,nr.FIXED),this._definitionChanged=new _e,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Eg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Eg.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});Eg.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};Eg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Eg.prototype.equals=function(e){return this===e||e instanceof Eg&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};Eg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ga=Eg;var P9e={ROUNDED:0,MITERED:1,BEVELED:2},Mi=Object.freeze(P9e);var js=[new m,new m],O9e=new m,R9e=new m,M9e=new m,B9e=new m,L9e=new m,N9e=new m,F9e=new m,U9e=new m,V9e=new m,OT=new m,NF=new m,cw={},C9=new he;function k9e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];C9=t.cartesianToCartographic(r,C9),n[i]=C9.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function T9(e,t,n,i){let r=e[0],o=e[1],s=m.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var FF=new m,UF=new m;function z9e(e,t,n,i){let r=new Ma(n,i),o=r.projectPointOntoPlane(m.add(n,e,FF),FF),s=r.projectPointOntoPlane(m.add(n,t,UF),UF),a=H.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var H9e=new m(-1,0,0),tA=new B,G9e=new B,E9=new Z,W9e=Z.IDENTITY.clone(),j9e=new m,Y9e=new oe,dse=new m;function wp(e,t,n,i,r,o,s,a){let c=j9e,u=Y9e;tA=Mt.eastNorthUpToFixedFrame(e,r,tA),c=B.multiplyByPointAsVector(tA,H9e,c),c=m.normalize(c,c);let f=z9e(c,t,e,r);E9=Z.fromRotationZ(f,E9),dse.z=o,tA=B.multiplyTransformation(tA,B.fromRotationTranslation(E9,dse,G9e),tA);let d=W9e;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=m.fromArray(n,g,u),u=Z.multiplyByVector(d,u,u),u=B.multiplyByPoint(tA,u,u),i.push(u.x,u.y,u.z);return i}var q9e=new m;function b9(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,q9e);i=wp(c,t,n,i,r,o[a/3],s,1)}return i}function X9e(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s,i}function mse(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var hse=new Ne,pse=new m,_se=new Z;function gse(e,t,n,i,r,o,s,a,c,u){let f=m.angleBetween(m.subtract(t,e,OT),m.subtract(n,e,NF)),d=i===Mi.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=Z.fromQuaternion(Ne.fromAxisAngle(m.negate(e,OT),f/(d+1),hse),_se):p=Z.fromQuaternion(Ne.fromAxisAngle(e,f/(d+1),hse),_se);let g,h;if(t=m.clone(t,pse),d>0){let A=u?2:1;for(let x=0;x<d;x++)t=Z.multiplyByVector(p,t,t),g=m.subtract(t,e,OT),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,NF),s=wp(h,g,a,s,o,c,1,A)}else g=m.subtract(t,e,OT),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(t,NF),s=wp(h,g,a,s,o,c,1,1),n=m.clone(n,pse),g=m.subtract(n,e,OT),g=m.normalize(g,g),r||(g=m.negate(g,g)),h=o.scaleToGeodeticSurface(n,NF),s=wp(h,g,a,s,o,c,1,1);return s}cw.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];H.equals(o,s)||n.push(s)}return n};cw.angleIsGreaterThanPi=function(e,t,n,i){let r=new Ma(n,i),o=r.projectPointOntoPlane(m.add(n,e,FF),FF),s=r.projectPointOntoPlane(m.add(n,t,UF),UF);return s.x*o.y-s.y*o.x>=0};var K9e=new m,J9e=new m;cw.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=k9e(e,o),a=i._granularity,c=i._cornerType,u=r?X9e(t,n):mse(t,n),f=r?mse(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],A=r?[]:void 0,x=O9e,C=R9e,T=M9e,E=B9e,S=L9e,w=N9e,D=F9e,R=U9e,O=V9e,L=e[0],N=e[1];E=o.geodeticSurfaceNormal(L,E),x=m.subtract(N,L,x),x=m.normalize(x,x),R=m.cross(E,x,R),R=m.normalize(R,R);let _=s[0],b=s[1];r&&(A=wp(L,R,f,A,o,_+d,1,1)),O=m.clone(L,O),L=N,C=m.negate(x,C);let v,I;for(let k=1;k<g-1;k++){let V=r?2:1;if(N=e[k+1],L.equals(N)){Rt("Positions are too close and are considered equivalent with rounding error.");continue}x=m.subtract(N,L,x),x=m.normalize(x,x),T=m.add(x,C,T),T=m.normalize(T,T),E=o.geodeticSurfaceNormal(L,E);let G=m.multiplyByScalar(E,m.dot(x,E),K9e);m.subtract(x,G,G),m.normalize(G,G);let U=m.multiplyByScalar(E,m.dot(C,E),J9e);if(m.subtract(C,U,U),m.normalize(U,U),!P.equalsEpsilon(Math.abs(m.dot(G,U)),1,P.EPSILON7)){T=m.cross(T,E,T),T=m.cross(E,T,T),T=m.normalize(T,T);let Y=1/Math.max(.25,m.magnitude(m.cross(T,C,OT))),Q=cw.angleIsGreaterThanPi(x,C,L,o);Q?(S=m.add(L,m.multiplyByScalar(T,Y*p,T),S),w=m.add(S,m.multiplyByScalar(R,p,w),w),js[0]=m.clone(O,js[0]),js[1]=m.clone(w,js[1]),v=T9(js,_+d,b+d,a),I=Ri.generateArc({positions:js,granularity:a,ellipsoid:o}),h=b9(I,R,u,h,o,v,1),R=m.cross(E,x,R),R=m.normalize(R,R),D=m.add(S,m.multiplyByScalar(R,p,D),D),c===Mi.ROUNDED||c===Mi.BEVELED?gse(S,w,D,c,Q,o,h,u,b+d,r):(T=m.negate(T,T),h=wp(L,T,u,h,o,b+d,Y,V)),O=m.clone(D,O)):(S=m.add(L,m.multiplyByScalar(T,Y*p,T),S),w=m.add(S,m.multiplyByScalar(R,-p,w),w),js[0]=m.clone(O,js[0]),js[1]=m.clone(w,js[1]),v=T9(js,_+d,b+d,a),I=Ri.generateArc({positions:js,granularity:a,ellipsoid:o}),h=b9(I,R,u,h,o,v,1),R=m.cross(E,x,R),R=m.normalize(R,R),D=m.add(S,m.multiplyByScalar(R,-p,D),D),c===Mi.ROUNDED||c===Mi.BEVELED?gse(S,w,D,c,Q,o,h,u,b+d,r):h=wp(L,T,u,h,o,b+d,Y,V),O=m.clone(D,O)),C=m.negate(x,C)}else h=wp(O,R,u,h,o,_+d,1,1),O=L;_=b,b=s[k+1],L=N}js[0]=m.clone(O,js[0]),js[1]=m.clone(L,js[1]),v=T9(js,_+d,b+d,a),I=Ri.generateArc({positions:js,granularity:a,ellipsoid:o}),h=b9(I,R,u,h,o,v,1),r&&(A=wp(L,R,f,A,o,b+d,1,1)),g=h.length;let M=r?g+A.length:g,F=new Float64Array(M);return F.set(h),r&&F.set(A,g),F};var Lm=cw;var v9={},RT=new m,Tse=new m,Z9e=new m,yse=new m,vc=[new m,new m],Ese=new m,bse=new m,Sse=new m,Q9e=new m,$9e=new m,eWe=new m,tWe=new m,nWe=new m,iWe=new m,rWe=new m,Ase=new Ne,xse=new Z;function VF(e,t,n,i,r){let o=m.angleBetween(m.subtract(t,e,RT),m.subtract(n,e,Tse)),s=i===Mi.BEVELED?1:Math.ceil(o/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=Z.fromQuaternion(Ne.fromAxisAngle(m.negate(e,RT),o/s,Ase),xse):u=Z.fromQuaternion(Ne.fromAxisAngle(e,o/s,Ase),xse);let f=0;t=m.clone(t,RT);for(let d=0;d<s;d++)t=Z.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function oWe(e){let t=Ese,n=bse,i=Sse,r=e[1];n=m.fromArray(e[1],r.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let o=VF(t,n,i,Mi.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(r,0,i),t=m.midpoint(n,i,t);let c=VF(t,n,i,Mi.ROUNDED,!1);return[o,c]}function Cse(e,t,n,i){let r=RT;return i?r=m.add(e,t,r):(t=m.negate(t,t),r=m.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function S9(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=m.multiplyByScalar(t,n,RT),a=m.negate(s,Tse),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=m.fromArray(e,f,Z9e),p=m.add(d,a,yse);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=m.add(d,s,yse);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}v9.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var sWe=new m,aWe=new m;v9.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=Ese,c=bse,u=Sse,f=Q9e,d=$9e,p=eWe,g=tWe,h=nWe,A=iWe,x=rWe,C=[],T=s?[]:void 0,E=s?[]:void 0,S=n[0],w=n[1];c=m.normalize(m.subtract(w,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=m.normalize(m.cross(a,c,f),f),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),g=m.clone(S,g),S=w,u=m.negate(c,u);let D,R=[],O,L=n.length;for(O=1;O<L-1;O++){a=i.geodeticSurfaceNormal(S,a),w=n[O+1],c=m.normalize(m.subtract(w,S,c),c),d=m.normalize(m.add(c,u,d),d);let _=m.multiplyByScalar(a,m.dot(c,a),sWe);m.subtract(c,_,_),m.normalize(_,_);let b=m.multiplyByScalar(a,m.dot(u,a),aWe);if(m.subtract(u,b,b),m.normalize(b,b),!P.equalsEpsilon(Math.abs(m.dot(_,b)),1,P.EPSILON7)){d=m.cross(d,a,d),d=m.cross(a,d,d),d=m.normalize(d,d);let I=r/Math.max(.25,m.magnitude(m.cross(d,u,RT))),M=Lm.angleIsGreaterThanPi(c,u,S,i);d=m.multiplyByScalar(d,I,d),M?(h=m.add(S,d,h),x=m.add(h,m.multiplyByScalar(f,r,x),x),A=m.add(h,m.multiplyByScalar(f,r*2,A),A),vc[0]=m.clone(g,vc[0]),vc[1]=m.clone(x,vc[1]),D=Ri.generateArc({positions:vc,granularity:t,ellipsoid:i}),C=S9(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=m.clone(A,p),f=m.normalize(m.cross(a,c,f),f),A=m.add(h,m.multiplyByScalar(f,r*2,A),A),g=m.add(h,m.multiplyByScalar(f,r,g),g),o===Mi.ROUNDED||o===Mi.BEVELED?R.push({leftPositions:VF(h,p,A,o,M)}):R.push({leftPositions:Cse(S,m.negate(d,d),A,M)})):(A=m.add(S,d,A),x=m.add(A,m.negate(m.multiplyByScalar(f,r,x),x),x),h=m.add(A,m.negate(m.multiplyByScalar(f,r*2,h),h),h),vc[0]=m.clone(g,vc[0]),vc[1]=m.clone(x,vc[1]),D=Ri.generateArc({positions:vc,granularity:t,ellipsoid:i}),C=S9(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=m.clone(h,p),f=m.normalize(m.cross(a,c,f),f),h=m.add(A,m.negate(m.multiplyByScalar(f,r*2,h),h),h),g=m.add(A,m.negate(m.multiplyByScalar(f,r,g),g),g),o===Mi.ROUNDED||o===Mi.BEVELED?R.push({rightPositions:VF(A,p,h,o,M)}):R.push({rightPositions:Cse(S,d,h,M)})),u=m.negate(c,u)}S=w}a=i.geodeticSurfaceNormal(S,a),vc[0]=m.clone(g,vc[0]),vc[1]=m.clone(S,vc[1]),D=Ri.generateArc({positions:vc,granularity:t,ellipsoid:i}),C=S9(D,f,r,C),s&&(T.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z));let N;return o===Mi.ROUNDED&&(N=oWe(C)),{positions:C,corners:R,lefts:T,normals:E,endPositions:N}};var Ui=v9;var Dse=new m,Ise=new m,kF=new m,zF=new m,cWe=new m,Pse=new m,bg=new m,MT=new m;function Ose(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function fd(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=m.normalize(m.cross(n,t,bg),bg);o.normal&&Ui.addAttribute(s,t,i,r),o.tangent&&Ui.addAttribute(a,u,i,r),o.bitangent&&Ui.addAttribute(c,n,i,r)}function Rse(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new gn,u,f=0,d=0,p,g=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,f+=h,g+=h*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<r.length;p++){u=r[p];let J=r[p].leftPositions;l(J)?(h=J.length,f+=h,g+=h):(h=r[p].rightPositions.length,d+=h,g+=h)}let A=l(o),x;A&&(x=o[0].length-3,f+=x,d+=x,x/=3,g+=x*6);let C=f+d,T=new Float64Array(C),E=t.normal?new Float32Array(C):void 0,S=t.tangent?new Float32Array(C):void 0,w=t.bitangent?new Float32Array(C):void 0,D={normals:E,tangents:S,bitangents:w},R=0,O=C-1,L,N,_,b,v=Dse,I=Ise,M,F,k=x/2,V=Ue.createTypedArray(C/3,g),G=0;if(A){F=kF,M=zF;let J=o[0];for(v=m.fromArray(a,0,v),I=m.fromArray(s,0,I),p=0;p<k;p++)F=m.fromArray(J,(k-1-p)*3,F),M=m.fromArray(J,(k+p)*3,M),Ui.addAttribute(T,M,R),Ui.addAttribute(T,F,void 0,O),fd(D,v,I,R,O,t),N=R/3,b=N+1,L=(O-2)/3,_=L-1,V[G++]=L,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=b,R+=3,O-=3}let U=0,q=0,Y=i[U++],Q=i[U++];T.set(Y,R),T.set(Q,O-Q.length+1),I=m.fromArray(s,q,I);let W,K;for(h=Q.length-3,p=0;p<h;p+=3)W=n.geodeticSurfaceNormal(m.fromArray(Y,p,bg),bg),K=n.geodeticSurfaceNormal(m.fromArray(Q,h-p,MT),MT),v=m.normalize(m.add(W,K,v),v),fd(D,v,I,R,O,t),N=R/3,b=N+1,L=(O-2)/3,_=L-1,V[G++]=L,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=b,R+=3,O-=3;for(W=n.geodeticSurfaceNormal(m.fromArray(Y,h,bg),bg),K=n.geodeticSurfaceNormal(m.fromArray(Q,h,MT),MT),v=m.normalize(m.add(W,K,v),v),q+=3,p=0;p<r.length;p++){let J;u=r[p];let me=u.leftPositions,ye=u.rightPositions,se,pe,xe=Pse,we=kF,Ee=zF;if(v=m.fromArray(a,q,v),l(me)){for(fd(D,v,I,void 0,O,t),O-=3,se=b,pe=_,J=0;J<me.length/3;J++)xe=m.fromArray(me,J*3,xe),V[G++]=se,V[G++]=pe-J-1,V[G++]=pe-J,Ui.addAttribute(T,xe,void 0,O),we=m.fromArray(T,(pe-J-1)*3,we),Ee=m.fromArray(T,se*3,Ee),I=m.normalize(m.subtract(we,Ee,I),I),fd(D,v,I,void 0,O,t),O-=3;xe=m.fromArray(T,se*3,xe),we=m.subtract(m.fromArray(T,pe*3,we),xe,we),Ee=m.subtract(m.fromArray(T,(pe-J)*3,Ee),xe,Ee),I=m.normalize(m.add(we,Ee,I),I),fd(D,v,I,R,void 0,t),R+=3}else{for(fd(D,v,I,R,void 0,t),R+=3,se=_,pe=b,J=0;J<ye.length/3;J++)xe=m.fromArray(ye,J*3,xe),V[G++]=se,V[G++]=pe+J,V[G++]=pe+J+1,Ui.addAttribute(T,xe,R),we=m.fromArray(T,se*3,we),Ee=m.fromArray(T,(pe+J)*3,Ee),I=m.normalize(m.subtract(we,Ee,I),I),fd(D,v,I,R,void 0,t),R+=3;xe=m.fromArray(T,se*3,xe),we=m.subtract(m.fromArray(T,(pe+J)*3,we),xe,we),Ee=m.subtract(m.fromArray(T,pe*3,Ee),xe,Ee),I=m.normalize(m.negate(m.add(Ee,we,I),I),I),fd(D,v,I,void 0,O,t),O-=3}for(Y=i[U++],Q=i[U++],Y.splice(0,3),Q.splice(Q.length-3,3),T.set(Y,R),T.set(Q,O-Q.length+1),h=Q.length-3,q+=3,I=m.fromArray(s,q,I),J=0;J<Q.length;J+=3)W=n.geodeticSurfaceNormal(m.fromArray(Y,J,bg),bg),K=n.geodeticSurfaceNormal(m.fromArray(Q,h-J,MT),MT),v=m.normalize(m.add(W,K,v),v),fd(D,v,I,R,O,t),b=R/3,N=b-1,_=(O-2)/3,L=_+1,V[G++]=L,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=b,R+=3,O-=3;R-=3,O+=3}if(v=m.fromArray(a,a.length-3,v),fd(D,v,I,R,O,t),A){R+=3,O-=3,F=kF,M=zF;let J=o[1];for(p=0;p<k;p++)F=m.fromArray(J,(x-p-1)*3,F),M=m.fromArray(J,p*3,M),Ui.addAttribute(T,F,void 0,O),Ui.addAttribute(T,M,R),fd(D,v,I,R,O,t),b=R/3,N=b-1,_=(O-2)/3,L=_+1,V[G++]=L,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=b,R+=3,O-=3}if(c.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let J=new Float32Array(C/3*2),me,ye,se=0;if(A){f/=3,d/=3;let pe=Math.PI/(x+1);ye=1/(f-x+1),me=1/(d-x+1);let xe,we=x/2;for(p=we+1;p<x+1;p++)xe=P.PI_OVER_TWO+pe*p,J[se++]=me*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=1;p<d-x+1;p++)J[se++]=p*me,J[se++]=0;for(p=x;p>we;p--)xe=P.PI_OVER_TWO-p*pe,J[se++]=1-me*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=we;p>0;p--)xe=P.PI_OVER_TWO-pe*p,J[se++]=1-ye*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=f-x;p>0;p--)J[se++]=p*ye,J[se++]=1;for(p=1;p<we+1;p++)xe=P.PI_OVER_TWO+pe*p,J[se++]=ye*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe))}else{for(f/=3,d/=3,ye=1/(f-1),me=1/(d-1),p=0;p<d;p++)J[se++]=p*me,J[se++]=0;for(p=f;p>0;p--)J[se++]=(p-1)*ye,J[se++]=1}c.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function lWe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Dse,h=Ise,A=kF,x=zF,C=cWe,T=Pse,E=c;for(u=0;u<s;u+=3){let S=E+c;g=m.fromArray(n,u,g),h=m.fromArray(n,u+s,h),A=m.fromArray(n,(u+3)%s,A),h=m.subtract(h,g,h),A=m.subtract(A,g,A),x=m.normalize(m.cross(h,A,x),x),t.normal&&(Ui.addAttribute(f,x,S),Ui.addAttribute(f,x,S+3),Ui.addAttribute(f,x,E),Ui.addAttribute(f,x,E+3)),(t.tangent||t.bitangent)&&(T=m.fromArray(i,u,T),t.bitangent&&(Ui.addAttribute(p,T,S),Ui.addAttribute(p,T,S+3),Ui.addAttribute(p,T,E),Ui.addAttribute(p,T,E+3)),t.tangent&&(C=m.normalize(m.cross(T,x,C),C),Ui.addAttribute(d,C,S),Ui.addAttribute(d,C,S+3),Ui.addAttribute(d,C,E),Ui.addAttribute(d,C,E+3))),E+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;d.set(S),d.set(S,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let h=f[u],A=f[u+1];d[p++]=h,d[p++]=A,d[p++]=h,d[p++]=A}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function w9(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function uWe(e,t){let n=new Oe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=Ui.computePositions(e),o=Rse(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let h=new Float64Array(d*4);f=ui.scaleToGeodeticHeight(f,s,i),h=w9(f,0,h),g=ui.scaleToGeodeticHeight(g,a,i),h=w9(g,d*2,h),p.set(f),p.set(g,d),p.set(h,d*2),c.position.values=p,c=lWe(c,t);let A,x=d/3;if(e.shadowVolume){let L=c.normal.values;d=L.length;let N=new Float32Array(d*6);for(A=0;A<d;A++)L[A]=-L[A];N.set(L,d),N=w9(L,d*4,N),c.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let L=new Uint8Array(x*6);if(e.offsetAttribute===an.TOP)L=L.fill(1,0,x).fill(1,x*2,x*4);else{let N=e.offsetAttribute===an.NONE?0:1;L=L.fill(N)}c.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let C=u.length,T=x+x,E=Ue.createTypedArray(p.length/3,C*2+T*3);E.set(u);let S=C;for(A=0;A<C;A+=3){let L=u[A],N=u[A+1],_=u[A+2];E[S++]=_+x,E[S++]=N+x,E[S++]=L+x}let w,D,R,O;for(A=0;A<T;A+=2)w=A+T,D=w+T,R=w+1,O=D+1,E[S++]=w,E[S++]=D,E[S++]=R,E[S++]=R,E[S++]=D,E[S++]=O;return{attributes:c,indices:E}}var vse=new m,lw=new m,$u=new he;function wse(e,t,n,i,r,o){let s=m.subtract(t,e,vse);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,lw),c=m.cross(s,a,vse);m.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;m.add(e,c,lw),n.cartesianToCartographic(lw,$u);let g=$u.latitude,h=$u.longitude;u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),m.subtract(e,c,lw),n.cartesianToCartographic(lw,$u),g=$u.latitude,h=$u.longitude,u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Qu=new m,uw=new m,ol=new he,sl=new he;function Mse(e,t,n,i,r){e=Ose(e,t);let o=Cr(e,m.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ce;let a=n*.5;ol.latitude=Number.POSITIVE_INFINITY,ol.longitude=Number.POSITIVE_INFINITY,sl.latitude=Number.NEGATIVE_INFINITY,sl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Mi.ROUNDED){let p=o[0];m.subtract(p,o[1],Qu),m.normalize(Qu,Qu),m.multiplyByScalar(Qu,a,Qu),m.add(p,Qu,uw),t.cartesianToCartographic(uw,$u),c=$u.latitude,u=$u.longitude,ol.latitude=Math.min(ol.latitude,c),ol.longitude=Math.min(ol.longitude,u),sl.latitude=Math.max(sl.latitude,c),sl.longitude=Math.max(sl.longitude,u)}for(let p=0;p<s-1;++p)wse(o[p],o[p+1],t,a,ol,sl);let f=o[s-1];m.subtract(f,o[s-2],Qu),m.normalize(Qu,Qu),m.multiplyByScalar(Qu,a,Qu),m.add(f,Qu,uw),wse(f,uw,t,a,ol,sl),i===Mi.ROUNDED&&(t.cartesianToCartographic(uw,$u),c=$u.latitude,u=$u.longitude,ol.latitude=Math.min(ol.latitude,c),ol.longitude=Math.min(ol.longitude,u),sl.latitude=Math.max(sl.latitude,c),sl.longitude=Math.max(sl.longitude,u));let d=l(r)?r:new ce;return d.north=sl.latitude,d.south=ol.latitude,d.east=sl.longitude,d.west=ol.longitude,d}function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+re.packedLength+Oe.packedLength+7}Ip.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Bse=re.clone(re.UNIT_SPHERE),Lse=new Oe,Dp={positions:void 0,ellipsoid:Bse,vertexFormat:Lse,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Ip.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)r[h]=m.unpack(e,t);let o=re.unpack(e,t,Bse);t+=re.packedLength;let s=Oe.unpack(e,t,Lse);t+=Oe.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=Oe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Dp.positions=r,Dp.width=a,Dp.height=c,Dp.extrudedHeight=u,Dp.cornerType=f,Dp.granularity=d,Dp.shadowVolume=p,Dp.offsetAttribute=g===-1?void 0:g,new Ip(Dp))};Ip.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,r=y(e.ellipsoid,re.WGS84),o=y(e.cornerType,Mi.ROUNDED);return Mse(n,r,i,o,t)};Ip.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Ose(t,i);let r=Cr(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=uWe(u,c);else{let g=Ui.computePositions(u);if(f=Rse(g,c,i),f.attributes.position.values=ui.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let h=e._offsetAttribute===an.NONE?0:1,A=f.attributes.position.values.length,x=new Uint8Array(A/3).fill(h);f.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new dt({attributes:d,indices:f.indices,primitiveType:Le.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Ip.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Ip({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Ip.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Mse(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var BT=Ip;var Nse=new m,Fse=new m,fWe=new m;function dWe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Use(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new gn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){a=r[f];let M=r[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),h;g&&(h=o[0].length-3,c+=h,u+=h,h/=3,d+=h*4);let A=c+u,x=new Float64Array(A),C=0,T=A-1,E,S,w,D,R,O,L=h/2,N=Ue.createTypedArray(A/3,d+4),_=0;if(N[_++]=C/3,N[_++]=(T-2)/3,g){n.push(C/3),O=Nse,R=Fse;let M=o[0];for(f=0;f<L;f++)O=m.fromArray(M,(L-1-f)*3,O),R=m.fromArray(M,(L+f)*3,R),Ui.addAttribute(x,R,C),Ui.addAttribute(x,O,void 0,T),S=C/3,D=S+1,E=(T-2)/3,w=E-1,N[_++]=E,N[_++]=w,N[_++]=S,N[_++]=D,C+=3,T-=3}let b=0,v=i[b++],I=i[b++];for(x.set(v,C),x.set(I,T-I.length+1),p=I.length-3,n.push(C/3,(T-2)/3),f=0;f<p;f+=3)S=C/3,D=S+1,E=(T-2)/3,w=E-1,N[_++]=E,N[_++]=w,N[_++]=S,N[_++]=D,C+=3,T-=3;for(f=0;f<r.length;f++){let M;a=r[f];let F=a.leftPositions,k=a.rightPositions,V,G=fWe;if(l(F)){for(T-=3,V=w,n.push(D),M=0;M<F.length/3;M++)G=m.fromArray(F,M*3,G),N[_++]=V-M-1,N[_++]=V-M,Ui.addAttribute(x,G,void 0,T),T-=3;n.push(V-Math.floor(F.length/6)),t===Mi.BEVELED&&n.push((T-2)/3+1),C+=3}else{for(C+=3,V=D,n.push(w),M=0;M<k.length/3;M++)G=m.fromArray(k,M*3,G),N[_++]=V+M,N[_++]=V+M+1,Ui.addAttribute(x,G,C),C+=3;n.push(V+Math.floor(k.length/6)),t===Mi.BEVELED&&n.push(C/3-1),T-=3}for(v=i[b++],I=i[b++],v.splice(0,3),I.splice(I.length-3,3),x.set(v,C),x.set(I,T-I.length+1),p=I.length-3,M=0;M<I.length;M+=3)D=C/3,S=D-1,w=(T-2)/3,E=w+1,N[_++]=E,N[_++]=w,N[_++]=S,N[_++]=D,C+=3,T-=3;C-=3,T+=3,n.push(C/3,(T-2)/3)}if(g){C+=3,T-=3,O=Nse,R=Fse;let M=o[1];for(f=0;f<L;f++)O=m.fromArray(M,(h-f-1)*3,O),R=m.fromArray(M,f*3,R),Ui.addAttribute(x,O,void 0,T),Ui.addAttribute(x,R,C),D=C/3,S=D-1,w=(T-2)/3,E=w+1,N[_++]=E,N[_++]=w,N[_++]=S,N[_++]=D,C+=3,T-=3;n.push(C/3)}else n.push(C/3,(T-2)/3);return N[_++]=C/3,N[_++]=(T-2)/3,s.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:N,wallIndices:n}}function mWe(e){let t=e.ellipsoid,n=Ui.computePositions(e),i=Use(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=ui.scaleToGeodeticHeight(u,o,t),d=ui.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let E=new Uint8Array(f*2);if(e.offsetAttribute===an.TOP)E=E.fill(1,0,f);else{let S=e.offsetAttribute===an.NONE?0:1;E=E.fill(S)}a.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}let g,h=c.length,A=Ue.createTypedArray(p.length/3,(h+r.length)*2);A.set(c);let x=h;for(g=0;g<h;g+=2){let E=c[g],S=c[g+1];A[x++]=E+f,A[x++]=S+f}let C,T;for(g=0;g<r.length;g++)C=r[g],T=C+f,A[x++]=C,A[x++]=T;return{attributes:a,indices:A}}function fw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+re.packedLength+6}fw.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=m.packedLength)m.pack(i[o],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Vse=re.clone(re.UNIT_SPHERE),Sg={positions:void 0,ellipsoid:Vse,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};fw.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)r[p]=m.unpack(e,t);let o=re.unpack(e,t,Vse);t+=re.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=re.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(Sg.positions=r,Sg.width=s,Sg.height=a,Sg.extrudedHeight=c,Sg.cornerType=u,Sg.granularity=f,Sg.offsetAttribute=d===-1?void 0:d,new fw(Sg))};fw.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=dWe(t,i);let r=Cr(t,m.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=mWe(c);else{let p=Ui.computePositions(c);if(u=Use(p,c.cornerType),u.attributes.position.values=ui.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,h=e._offsetAttribute===an.NONE?0:1,A=new Uint8Array(g/3).fill(h);u.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let f=u.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new dt({attributes:f,indices:u.indices,primitiveType:Le.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var HF=fw;var hWe=new $n(0);function wc(e){li.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(wc.prototype=Object.create(li.prototype),wc.prototype.constructor=wc);Object.defineProperties(wc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});wc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Kc.isSupported(this._scene)};wc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};wc.prototype._computeCenter=fe.throwInstantiationError;wc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(li.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&Rt(Rt.geometryZIndex),this._zIndex=y(r.zIndex,hWe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new hm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new EC(this._scene,a,o,s)}};wc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),li.prototype.destroy.call(this)};wc.getGeometryHeight=function(e,t){if(!l(e)){t!==qe.NONE&&Rt(Rt.geometryHeightReference);return}return t!==qe.CLAMP_TO_GROUND?e:0};wc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==qe.NONE&&Rt(Rt.geometryExtrudedHeightReference);return}return t!==qe.CLAMP_TO_GROUND?e:wc.CLAMP_TO_GROUND};wc.CLAMP_TO_GROUND="clamp";wc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=qe.NONE),(!l(n)||!l(i))&&(i=qe.NONE);let r=0;if(t!==qe.NONE&&r++,i===qe.RELATIVE_TO_GROUND&&r++,r===2)return an.ALL;if(r===1)return an.TOP};var Kn=wc;var kse=new z,zse=m.ZERO,Hse=new m,Gse=new ce;function pWe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function dd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new pWe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(dd.prototype=Object.create(Kn.prototype),dd.prototype.constructor=dd);dd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,kse)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,zse,Hse))),new Tt({id:t,geometry:new BT(this._options),attributes:i})};dd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,kse),r={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,zse,Hse))),new Tt({id:t,geometry:new HF(this._options),attributes:r})};dd.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};dd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||li.prototype._isHidden.call(this,e,t)};dd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.width)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};dd.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),r=j.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),o=j.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=j.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Kn.getGeometryHeight(n,i),r=Kn.getGeometryExtrudedHeight(r,o),r===Kn.CLAMP_TO_GROUND&&(r=ai.getMinimumMaximumHeights(BT.computeRectangle(s,Gse)).minimumTerrainHeight),s.extrudedHeight=r};dd.DynamicGeometryUpdater=LT;function LT(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(LT.prototype=Object.create(ci.prototype),LT.prototype.constructor=LT);LT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ci.prototype._isHidden.call(this,e,t,n)};LT.prototype._setOptions=function(e,t,n){let i=this._options,r=j.getValueOrUndefined(t.height,n),o=j.getValueOrDefault(t.heightReference,n,qe.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(r)&&(r=0),i.positions=j.getValueOrUndefined(t.positions,n),i.width=j.getValueOrUndefined(t.width,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(BT.computeRectangle(i,Gse)).minimumTerrainHeight),i.extrudedHeight=s};var GF=dd;function WF(){fe.throwInstantiationError()}Object.defineProperties(WF.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});WF.prototype.update=function(e){fe.throwInstantiationError()};WF.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Lo=WF;function Nm(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Nm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Wse=new m;Nm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Wse);return I9(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Nm.prototype.isScaledSpacePointVisible=function(e){return I9(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var _We=new m;Nm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=_We,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),I9(e,r,i)};Nm.prototype.computeHorizonCullingPoint=function(e,t,n){return qse(this._ellipsoid,e,t,n)};var jse=re.clone(re.UNIT_SPHERE);Nm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Yse(this._ellipsoid,n,jse);return qse(r,e,t,i)};Nm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return Xse(this._ellipsoid,e,t,n,i,r)};Nm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Yse(this._ellipsoid,r,jse);return Xse(s,e,t,n,i,o)};var gWe=[];Nm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,gWe),r=ae.fromPoints(i);if(!(m.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var yWe=new m;function Yse(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,yWe);e=re.fromCartesian3(i,n)}return e}function qse(e,t,n,i){l(i)||(i=new m);let r=Zse(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Kse(e,c,r);if(u<0)return;o=Math.max(o,u)}return Jse(r,o,i)}var jF=new m;function Xse(e,t,n,i,r,o){l(o)||(o=new m),i=y(i,3),r=y(r,m.ZERO);let s=Zse(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){jF.x=n[c]+r.x,jF.y=n[c+1]+r.y,jF.z=n[c+2]+r.z;let f=Kse(e,jF,s);if(f<0)return;a=Math.max(a,f)}return Jse(s,a,o)}function I9(e,t,n){let i=t,r=n,o=m.subtract(e,i,Wse),s=-m.dot(o,i);return!(r<0?s>0:s>r&&s*s/m.magnitudeSquared(o)>r)}var AWe=new m,xWe=new m;function Kse(e,t,n){let i=e.transformPositionToScaledSpace(t,AWe),r=m.magnitudeSquared(i),o=Math.sqrt(r),s=m.divideByScalar(i,o,xWe);r=Math.max(1,r),o=Math.max(1,o);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function Jse(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var D9=new m;function Zse(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,D9),m.normalize(D9,D9))}var vg=Nm;function wo(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Lt.clone(n)),l(i)&&(i=Lt.clone(i)),l(r)&&(r=Dt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var Qse=wo.SHOW_INDEX=0,tae=wo.POSITION_INDEX=1,CWe=wo.COLOR_INDEX=2,TWe=wo.OUTLINE_COLOR_INDEX=3,EWe=wo.OUTLINE_WIDTH_INDEX=4,bWe=wo.PIXEL_SIZE_INDEX=5,SWe=wo.SCALE_BY_DISTANCE_INDEX=6,vWe=wo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,wWe=wo.DISTANCE_DISPLAY_CONDITION_INDEX=8,DWe=wo.DISABLE_DEPTH_DISTANCE_INDEX=9;wo.NUMBER_OF_PROPERTIES=10;function ef(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(wo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,ef(this,Qse))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),ef(this,tae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Lt.equals(t,e)||(this._scaleByDistance=Lt.clone(e,t),ef(this,SWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Lt.equals(t,e)||(this._translucencyByDistance=Lt.clone(e,t),ef(this,vWe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,ef(this,bWe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),ef(this,CWe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),ef(this,TWe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,ef(this,EWe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),ef(this,wWe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,ef(this,DWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,ef(this,Qse))}}});wo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};wo.prototype._getActualPosition=function(){return this._actualPosition};wo.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),ef(this,tae)};var $se=new oe;wo._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(B.multiplyByPoint(n,e,$se),Zi.computeActualWgs84Position(t,$se))};var eae=new oe;wo._computeScreenSpacePosition=function(e,t,n,i){let r=B.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,eae),eae);return Zi.wgs84ToWindowCoordinates(n,r,i)};wo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new H);let i=n.modelMatrix,r=wo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};wo.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new Ke),n.x=o,n.y=s,n.width=a,n.height=c,n};wo.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Lt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};wo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ys=wo;var nA=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; - -void main() +`;var UR=`/** + * Returns the transpose of the matrix. The input <code>matrix</code> can be + * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>. + * + * @name czm_transpose + * @glslFunction + * + * @param {} matrix The matrix to transpose. + * + * @returns {} The transposed matrix. + * + * @example + * // GLSL declarations + * mat2 czm_transpose(mat2 matrix); + * mat3 czm_transpose(mat3 matrix); + * mat4 czm_transpose(mat4 matrix); + * + * // Transpose a 3x3 rotation matrix to find its inverse. + * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( + * positionMC, normalEC); + * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + */ +mat2 czm_transpose(mat2 matrix) { - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); + return mat2( + matrix[0][0], matrix[1][0], + matrix[0][1], matrix[1][1]); +} - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; +mat3 czm_transpose(mat3 matrix) +{ + return mat3( + matrix[0][0], matrix[1][0], matrix[2][0], + matrix[0][1], matrix[1][1], matrix[2][1], + matrix[0][2], matrix[1][2], matrix[2][2]); +} -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 +mat4 czm_transpose(mat4 matrix) +{ + return mat4( + matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], + matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], + matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], + matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); +} +`;var VR=`/** + * Unpacks a vec4 depth value to a float in [0, 1) range. + * + * @name czm_unpackDepth + * @glslFunction + * + * @param {vec4} packedDepth The packed depth. + * + * @returns {float} The floating-point depth in [0, 1) range. + */ + float czm_unpackDepth(vec4 packedDepth) + { + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); + } +`;var zR=`/** + * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. + * + * @name czm_unpackFloat + * @glslFunction + * + * @param {vec4} packedFloat The packed float. + * + * @returns {float} The floating-point depth in arbitrary range. + */ +float czm_unpackFloat(vec4 packedFloat) +{ + // Convert to [0.0, 255.0] and round to integer + packedFloat = floor(packedFloat * 255.0 + 0.5); + float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; + float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; + if (exponent == -127.0) { - discard; + return 0.0; } -#endif -#endif - - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); + float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); + float result = sign * exp2(exponent - 23.0) * mantissa; + return result; } -`;var YF=`uniform float u_maxTotalPointSize; - -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance - -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; - -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; - -void main() -{ - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; - - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); - -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; - - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif - - /////////////////////////////////////////////////////////////////////////// - - vec4 color; - vec4 outlineColor; - vec4 pickColor; - - // compressedAttribute0.z => pickColor.rgb - - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); - - // compressedAttribute0.x => color.rgb - - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); +`;var HR=`/** + * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, + * so the return value is an int. + * <p> + * There are also precision limitations in WebGL 1. highp int is still limited + * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. + * </p> + * + * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * + * @return {int} The unpacked value. + */ + int czm_unpackUint(float packedValue) { + float rounded = czm_round(packedValue * 255.0); + return int(rounded); + } - // compressedAttribute0.y => outlineColor.rgb + int czm_unpackUint(vec2 packedValue) { + vec2 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec2(1.0, 256.0))); + } - temp = compressedAttribute0.y * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); + int czm_unpackUint(vec3 packedValue) { + vec3 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); + } - // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a + int czm_unpackUint(vec4 packedValue) { + vec4 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); + } +`;var GR=`/** + * Transform metadata values following the EXT_structural_metadata spec + * by multiplying by scale and adding the offset. Operations are always + * performed component-wise, even for matrices. + * + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * + * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + */ +float czm_valueTransform(float offset, float scale, float value) { + return scale * value + offset; +} - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { + return scale * value + offset; +} - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { + return scale * value + offset; +} - /////////////////////////////////////////////////////////////////////////// +vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { + return scale * value + offset; +} - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { + return matrixCompMult(scale, value) + offset; +} - /////////////////////////////////////////////////////////////////////////// +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { + return matrixCompMult(scale, value) + offset; +} -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else - { - lengthSq = dot(positionEC.xyz, positionEC.xyz); - } +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { + return matrixCompMult(scale, value) + offset; +} +`;var WR=`#ifdef LOG_DEPTH +// 1.0 at the near plane, increasing linearly from there. +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; #endif - -#ifdef EYE_DISTANCE_SCALING - totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); #endif - if (totalSize > 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; - } - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) - { - positionEC.xyz = vec3(0.0); - totalSize = 1.0; - } +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency < 0.004) - { - positionEC.xyz = vec3(0.0); - } +#ifdef SHADOW_MAP + vec3 logPositionEC = (czm_inverseProjection * coords).xyz; + v_logPositionEC = logPositionEC; #endif -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepth.x; - float farSq = distanceDisplayConditionAndDisableDepth.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); - } + // With the very high far/near ratios used with the logarithmic depth + // buffer, floating point rounding errors can cause linear depth values + // to end up on the wrong side of the far plane, even for vertices that + // are really nowhere near it. Since we always write a correct logarithmic + // depth value in the fragment shader anyway, we just need to make sure + // such errors don't cause the primitive to be clipped entirely before + // we even get to the fragment shader. + coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif - gl_Position = czm_projection * positionEC; - czm_vertexLogDepth(); - -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } + return coords; +} - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; +/** + * Writes the logarithmic depth to gl_Position using the already computed gl_Position. + * + * @name czm_vertexLogDepth + * @glslFunction + */ +void czm_vertexLogDepth() +{ #ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif - } - } + v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; + gl_Position = czm_updatePositionDepth(gl_Position); #endif +} - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; - - v_pickColor = pickColor; +/** + * Writes the logarithmic depth to gl_Position using the provided clip coordinates. + * <p> + * An example use case for this function would be moving the vertex in window coordinates + * before converting back to clip coordinates. Use the original vertex clip coordinates. + * </p> + * @name czm_vertexLogDepth + * @glslFunction + * + * @param {vec4} clipCoords The vertex in clip coordinates. + * + * @example + * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + */ +void czm_vertexLogDepth(vec4 clipCoords) +{ +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; + czm_updatePositionDepth(clipCoords); +#endif } -`;var IWe=Ys.SHOW_INDEX,R9=Ys.POSITION_INDEX,nae=Ys.COLOR_INDEX,PWe=Ys.OUTLINE_COLOR_INDEX,OWe=Ys.OUTLINE_WIDTH_INDEX,RWe=Ys.PIXEL_SIZE_INDEX,iae=Ys.SCALE_BY_DISTANCE_INDEX,rae=Ys.TRANSLUCENCY_BY_DISTANCE_INDEX,oae=Ys.DISTANCE_DISPLAY_CONDITION_INDEX,MWe=Ys.DISABLE_DEPTH_DISTANCE_INDEX,M9=Ys.NUMBER_OF_PROPERTIES,Ya={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function tf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(M9),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vr.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(tf.prototype,{length:{get:function(){return B9(this),this._pointPrimitives.length}}});function sae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}tf.prototype.add=function(e){let t=new Ys(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};tf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};tf.prototype.removeAll=function(){sae(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function B9(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}tf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};tf.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};tf.prototype.get=function(e){return B9(this),this._pointPrimitives[e]};tf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<M9;++i){let r=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function BWe(e,t,n){return new y_(e,[{index:Ya.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[R9]},{index:Ya.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[R9]},{index:Ya.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[nae]},{index:Ya.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[rae]},{index:Ya.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[iae]},{index:Ya.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:X.FLOAT,usage:n[oae]}],t)}var P9=new Yn;function aae(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(o,P9);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Ya.positionHighAndSize],u=P9.high;c(r,u.x,u.y,u.z,s);let f=n[Ya.positionLowAndOutline],d=P9.low;f(r,d.x,d.y,d.z,a)}var qF=65536,dw=256;function cae(e,t,n,i){let r=i._index,o=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(o.red),u=z.floatToByte(o.green),f=z.floatToByte(o.blue),d=c*qF+u*dw+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*qF+u*dw+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let g=c*qF+u*dw+f,h=z.floatToByte(o.alpha)*qF+z.floatToByte(a.alpha)*dw+z.floatToByte(s.alpha),A=n[Ya.compressedAttribute0];A(r,d,p,g,h)}function lae(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*dw+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Ya.compressedAttribute1];g(r,d,p,o,a)}function uae(e,t,n,i){let r=i._index,o=n[Ya.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function fae(e,t,n,i){let r=i._index,o=n[Ya.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(r,s,a,u)}function LWe(e,t,n,i){aae(e,t,n,i),cae(e,t,n,i),lae(e,t,n,i),uae(e,t,n,i),fae(e,t,n,i)}function O9(e,t,n,i,r,o){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ys._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ae.expand(s,d,s))}o&&ae.fromPoints(a,s)}function NWe(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!B.equals(o,e.modelMatrix)?(e._mode=n,B.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&O9(e,i,i.length,t,o,!0)):n===ne.MORPHING?O9(e,i,i.length,t,o,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&O9(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function FWe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var UWe=[];tf.prototype.update=function(e){if(B9(this),!this.show)return;this._maxTotalPointSize=Gt.maximumAliasedPointSize,NWe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let w=0;w<M9;++w)o[w]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=BWe(c,n,this._buffersUsage),a=this._vaf.writers;for(let w=0;w<n;++w){let D=this._pointPrimitives[w];D._dirty=!1,LWe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let w=UWe;w.length=0,(o[R9]||o[OWe]||o[RWe])&&w.push(aae),(o[nae]||o[PWe])&&w.push(cae),(o[IWe]||o[rae])&&w.push(lae),o[iae]&&w.push(uae),(o[oae]||o[MWe])&&w.push(fae);let D=w.length;if(a=this._vaf.writers,r/n>.1){for(let R=0;R<r;++R){let O=i[R];O._dirty=!1;for(let L=0;L<D;++L)w[L](this,c,a,O)}this._vaf.commit()}else{for(let R=0;R<r;++R){let O=i[R];O._dirty=!1;for(let L=0;L<D;++L)w[L](this,c,a,O);this._vaf.subCommit(O._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=B.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),FWe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===vr.OPAQUE||this._blendOption===vr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===vr.TRANSLUCENT||this._blendOption===vr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,A;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new He({sources:[YF]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===vr.OPAQUE_AND_TRANSLUCENT&&(A=new He({defines:["OPAQUE"],sources:[nA]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:Ya}),A=new He({defines:["TRANSLUCENT"],sources:[nA]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:Ya})),this._blendOption===vr.OPAQUE&&(A=new He({sources:[nA]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:Ya})),this._blendOption===vr.TRANSLUCENT&&(A=new He({sources:[nA]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:A,attributeLocations:Ya})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,C,T,E,S=e.commandList;if(u.render||f){let w=this._colorCommands,D=this._blendOption===vr.OPAQUE,R=this._blendOption===vr.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,C=x.length,w.length=C;let O=R?C*2:C;for(E=0;E<O;++E){let L=D||R&&E%2===0;T=w[E],l(T)||(T=w[E]=new nt),T.primitiveType=Le.POINTS,T.pass=L||!R?Se.OPAQUE:Se.TRANSLUCENT,T.owner=this;let N=R?Math.floor(E/2):E;T.boundingVolume=d,T.modelMatrix=p,T.shaderProgram=L?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=x[N].va,T.renderState=L?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",S.push(T)}}};tf.prototype.isDestroyed=function(){return!1};tf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),sae(this._pointPrimitives),ue(this)};var mw=tf;var dae=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],L9=1,hw=8,iA=class{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==L9)throw new Error(`Got v${r} data when expected v${L9}.`);let o=dae[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new iA(a,s,o,t)}constructor(t,n=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=dae.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,hw,t),this.coords=new this.ArrayType(this.data,hw+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(hw+s+a+c),this.ids=new this.IndexArrayType(this.data,hw,t),this.coords=new this.ArrayType(this.data,hw+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(L9<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return F9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let x=p;x<=d;x++){let C=s[2*x],T=s[2*x+1];C>=t&&C<=i&&T>=n&&T<=r&&u.push(o[x])}continue}let g=p+d>>1,h=s[2*g],A=s[2*g+1];h>=t&&h<=i&&A>=n&&A<=r&&u.push(o[g]),(f===0?t<=h:n<=A)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:r>=A)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let x=p;x<=d;x++)mae(o[2*x],o[2*x+1],t,n)<=u&&c.push(r[x]);continue}let g=p+d>>1,h=o[2*g],A=o[2*g+1];mae(h,A,t,n)<=u&&c.push(r[g]),(f===0?t-i<=h:n-i<=A)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=A)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function F9(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;hae(e,t,s,i,r,o),F9(e,t,n,i,s-1,1-o),F9(e,t,n,s+1,r,1-o)}function hae(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/u+g)),A=Math.min(r,Math.floor(n+(u-f)*p/u+g));hae(e,t,n,h,A,o)}let s=t[2*n+o],a=i,c=r;for(pw(e,t,i,n),t[2*r+o]>s&&pw(e,t,i,r);a<c;){for(pw(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?pw(e,t,i,c):(c++,pw(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function pw(e,t,n,i){N9(e,n,i),N9(t,2*n,2*i),N9(t,2*n+1,2*i+1)}function N9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function mae(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function md(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new _e,this.show=y(e.show,!0)}function pae(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var VWe=new Ke;function _ae(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=k0.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=pr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ys.getScreenSpaceBoundingBox(e,t,r)),pae(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&yae(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=k0.getScreenSpaceBoundingBox(s,t,VWe);pae(a,n),r=Ke.union(r,a,r)}return r}function kWe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&yae(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function gae(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function yae(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function U9(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var zWe=new Ke,HWe=new Ke,GWe=new Ke;function WWe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new dp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ju({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new mw;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,h=n.camera.positionCartographic.height,A=n.mapProjection.ellipsoid,x=n.camera.positionWC,C=new vg(A,x),T=[];e._clusterLabels&&U9(i,T,n,C,e),e._clusterBillboards&&U9(r,T,n,C,e),e._clusterPoints&&U9(o,T,n,C,e);let E,S,w,D,R,O,L,N,_,b,v,I;if(T.length>0){let M=new iA(T.length,64,Uint32Array);for(let F=0;F<T.length;++F)M.add(T[F].coord.x,T[F].coord.y);if(M.finish(),h<g)for(w=d.length,E=0;E<w;++E){let F=d[E];if(!C.isPointVisible(F.position))continue;let k=pr._computeScreenSpacePosition(B.IDENTITY,F.position,m.ZERO,H.ZERO,n);if(!l(k))continue;let V=1-h/g,G=F.width=F.width*V,U=F.height=F.height*V;G=Math.max(G,F.minimumWidth),U=Math.max(U,F.minimumHeight);let q=k.x-G*.5,Y=k.y-U*.5,Q=k.x+G,W=k.y+U;for(R=M.range(q,Y,Q,W),O=R.length,b=0,_=[],S=0;S<O;++S)L=R[S],N=T[L],N.clustered||(++b,v=N.collection,I=N.index,_.push(v.get(I).id));if(b>=f)for(gae(F.position,b,_,e),p.push(F),S=0;S<O;++S)T[R[S]].clustered=!0}for(w=T.length,E=0;E<w;++E){let F=T[E];if(F.clustered)continue;F.clustered=!0,v=F.collection,I=F.index;let k=v.get(I);D=_ae(k,F.coord,u,e,zWe);let V=Ke.clone(D,HWe);R=M.range(D.x,D.y,D.x+D.width,D.y+D.height),O=R.length;let G=m.clone(k.position);for(b=1,_=[k.id],S=0;S<O;++S)if(L=R[S],N=T[L],!N.clustered){let U=N.collection.get(N.index),q=_ae(U,N.coord,u,e,GWe);m.add(U.position,G,G),Ke.union(V,q,V),++b,_.push(U.id)}if(b>=f){let U=m.multiplyByScalar(G,1/b,G);for(gae(U,b,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S<O;++S)T[R[S]].clustered=!0}else kWe(k,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}md.prototype._initialize=function(e){this._scene=e;let t=WWe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(md.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function k9(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.pop(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function z9(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}md.prototype.getLabel=k9("_labelCollection",dp,"_unusedLabelIndices","labelIndex");md.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,z9(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};md.prototype.getBillboard=k9("_billboardCollection",ju,"_unusedBillboardIndices","billboardIndex");md.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,z9(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};md.prototype.getPoint=k9("_pointCollection",mw,"_unusedPointIndices","pointIndex");md.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,z9(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function V9(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function jWe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,V9(e._labelCollection),V9(e._billboardCollection),V9(e._pointCollection))}md.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,jWe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};md.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var nf=md;function H9(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Ws(this),this._entityCluster=new nf}Object.defineProperties(H9.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Lo.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});H9.prototype.update=function(e){return!0};var XF=H9;var Aae={};Aae.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,h=r?(a+i)*3:i*3;for(f=0;f<i;f++){let A=f/i*P.TWO_PI,x=Math.cos(A),C=Math.sin(A),T=x*n,E=C*n,S=x*t,w=C*t;u[p+g]=T,u[p+g+1]=E,u[p+g+2]=s,u[p+h]=S,u[p+h+1]=w,u[p+h+2]=o,p+=3,r&&(u[d++]=T,u[d++]=E,u[d++]=s,u[d++]=S,u[d++]=w,u[d++]=o)}return u};var NT=Aae;var G9=new H,YWe=new m,qWe=new m,XWe=new m,KWe=new m;function Pp(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Oe.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Pp.packedLength=Oe.packedLength+5;Pp.pack=function(e,t,n){return n=y(n,0),Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var xae=new Oe,FT={vertexFormat:xae,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Pp.unpack=function(e,t,n){t=y(t,0);let i=Oe.unpack(e,t,xae);t+=Oe.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Oe.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(FT.length=r,FT.topRadius=o,FT.bottomRadius=s,FT.slices=a,FT.offsetAttribute=c===-1?void 0:c,new Pp(FT))};Pp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=NT.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,h,A=r.normal||r.tangent||r.bitangent;if(A){let R=r.tangent||r.bitangent,O=0,L=0,N=0,_=Math.atan2(i-n,t),b=YWe;b.z=Math.sin(_);let v=Math.cos(_),I=XWe,M=qWe;for(h=0;h<o;h++){let F=h/o*P.TWO_PI,k=v*Math.cos(F),V=v*Math.sin(F);A&&(b.x=k,b.y=V,R&&(I=m.normalize(m.cross(m.UNIT_Z,b,I),I)),r.normal&&(d[O++]=b.x,d[O++]=b.y,d[O++]=b.z,d[O++]=b.x,d[O++]=b.y,d[O++]=b.z),r.tangent&&(p[L++]=I.x,p[L++]=I.y,p[L++]=I.z,p[L++]=I.x,p[L++]=I.y,p[L++]=I.z),r.bitangent&&(M=m.normalize(m.cross(b,I,M),M),g[N++]=M.x,g[N++]=M.y,g[N++]=M.z,g[N++]=M.x,g[N++]=M.y,g[N++]=M.z))}for(h=0;h<o;h++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=-1),r.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),r.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(h=0;h<o;h++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=1),r.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),r.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let x=12*o-12,C=Ue.createTypedArray(c,x),T=0,E=0;for(h=0;h<o-1;h++)C[T++]=E,C[T++]=E+2,C[T++]=E+3,C[T++]=E,C[T++]=E+3,C[T++]=E+1,E+=2;for(C[T++]=s-2,C[T++]=0,C[T++]=1,C[T++]=s-2,C[T++]=1,C[T++]=s-1,h=1;h<o-1;h++)C[T++]=s+h+1,C[T++]=s+h,C[T++]=s;for(h=1;h<o-1;h++)C[T++]=a,C[T++]=a+h,C[T++]=a+h+1;let S=0;if(r.st){let R=Math.max(n,i);for(h=0;h<c;h++){let O=m.fromArray(u,h*3,KWe);f[S++]=(O.x+R)/(2*R),f[S++]=(O.y+R)/(2*R)}}let w=new gn;r.position&&(w.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(w.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(w.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(w.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(w.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),G9.x=t*.5,G9.y=Math.max(i,n);let D=new ae(m.ZERO,H.magnitude(G9));if(l(e._offsetAttribute)){t=u.length;let R=e._offsetAttribute===an.NONE?0:1,O=new Uint8Array(t/3).fill(R);w.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new dt({attributes:w,indices:C,primitiveType:Le.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var W9;Pp.getUnitCylinder=function(){return l(W9)||(W9=Pp.createGeometry(new Pp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Oe.POSITION_ONLY}))),W9};var KF=Pp;var j9=new H;function UT(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.slices,128),o=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}UT.packedLength=6;UT.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var rA={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};UT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(rA.length=i,rA.topRadius=r,rA.bottomRadius=o,rA.slices=s,rA.numberOfVerticalLines=a,rA.offsetAttribute=c===-1?void 0:c,new UT(rA))};UT.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=NT.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let A=Math.min(o,r);u=Math.round(r/A),c+=A}let f=Ue.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new gn;g.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),j9.x=t*.5,j9.y=Math.max(i,n);let h=new ae(m.ZERO,H.magnitude(j9));if(l(e._offsetAttribute)){t=a.length;let A=e._offsetAttribute===an.NONE?0:1,x=new Uint8Array(t/3).fill(A);g.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new dt({attributes:g,indices:f,primitiveType:Le.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var JF=UT;var Cae=m.ZERO,Tae=new m,JWe=new m,Eae=new z;function ZWe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Xl(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new ZWe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Xl.prototype=Object.create(li.prototype),Xl.prototype.constructor=Xl);Object.defineProperties(Xl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Xl.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=zn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Eae)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Cae,Tae))),new Tt({id:t,geometry:new KF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};Xl.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Eae),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Cae,Tae))),new Tt({id:t,geometry:new JF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:o})};Xl.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Xl.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||li.prototype._isHidden.call(this,e,t)};Xl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!j.isConstant(t.slices)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)};Xl.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=j.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};Xl.prototype._onEntityPropertyChanged=I_;Xl.DynamicGeometryUpdater=VT;function VT(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(VT.prototype=Object.create(ci.prototype),VT.prototype.constructor=VT);VT.prototype._isHidden=function(e,t,n){let i=this._options,r=j.getValueOrUndefined(e.position,n,JWe);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ci.prototype._isHidden.call(this,e,t,n)};VT.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,qe.NONE),r=this._options;r.length=j.getValueOrUndefined(t.length,n),r.topRadius=j.getValueOrUndefined(t.topRadius,n),r.bottomRadius=j.getValueOrUndefined(t.bottomRadius,n),r.slices=j.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==qe.NONE?an.ALL:void 0};var ZF=Xl;var QWe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},No=Object.freeze(QWe);var $We={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},gr=Object.freeze($We);var e7e={NONE:0,HOLD:1,EXTRAPOLATE:2},rf=Object.freeze(e7e);var bae=co(wl(),1);function t7e(e){let t=new bae.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var wg=t7e;var n7e=P.factorial;function Y9(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=Y9(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var QF={type:"Hermite"};QF.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};QF.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c,u,f,d=t.length,p=new Array(i);for(o=0;o<i;o++){r[o]=0;let x=new Array(d);for(p[o]=x,s=0;s<d;s++)x[s]=[]}let g=d,h=new Array(g);for(o=0;o<g;o++)h[o]=o;let A=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=h[s]*i+c,p[c][0].push(n[f]);for(o=1;o<g;o++){let x=!1;for(s=0;s<g-o;s++){let C=t[h[s]],T=t[h[s+o]],E;T-C<=0?(f=h[s]*i+i*o+c,E=n[f],p[c][o].push(E/n7e(o))):(E=p[c][o-1][s+1]-p[c][o-1][s],p[c][o].push(E/(T-C))),x=x||E!==0}x||(A=o-1)}}for(a=0,u=0;a<=u;a++)for(o=a;o<=A;o++){let x=Y9(e,h,t,a,o,[]);for(c=0;c<i;c++){let C=p[c][o][0];r[c+a*i]+=C*x}}return r};var i7e=[];QF.interpolate=function(e,t,n,i,r,o,s){let a=i*(o+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,u=new Array(c*(r+1)),f;for(f=0;f<c;f++)for(let C=0;C<r+1;C++)u[f*(r+1)+C]=f;let d=u.length,p=i7e,g=r7e(p,u,t,n,i,r),h=[],A=d*(d+1)/2,x=Math.min(g,o);for(let C=0;C<=x;C++)for(f=C;f<=g;f++){h.length=0;let T=Y9(e,u,t,C,f,h),E=Math.floor(f*(1-f)/2)+d*f;for(let S=0;S<i;S++){let w=Math.floor(S*A),D=p[w+E];s[S+C*i]+=D*T}}return s};function r7e(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let h=0,A=Math.floor(g*(1-g)/2)+u*g,x=!1;for(s=0;s<u-g;s++){let C=n[t[s]],T=n[t[s+g]],E,S;if(T-C<=0)a=t[s]*r*(o+1)+r*g+d,E=i[a],S=E/P.factorial(g),e[p+A+h]=S,h++;else{let w=Math.floor((g-1)*(2-g)/2)+u*(g-1);E=e[p+w+s+1]-e[p+w+s],S=E/(T-C),e[p+A+h]=S,h++}x=x||E!==0}x&&(c=Math.max(c,g))}}return c}var $F=QF;var q9={type:"Lagrange"};q9.getRequiredDataPoints=function(e){return Math.max(e+1,2)};q9.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a=t.length;for(o=0;o<i;o++)r[o]=0;for(o=0;o<a;o++){let c=1;for(s=0;s<a;s++)if(s!==o){let u=t[o]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)r[s]+=c*n[o*i+s]}return r};var e2=q9;var X9={type:"Linear"};X9.getRequiredDataPoints=function(e){return 2};X9.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c=t[0],u=t[1];for(o=0;o<i;o++)s=n[o],a=n[o+i],r[o]=((a-s)*e+u*s-c*a)/(u-c);return r};var kT=X9;function qa(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}qa.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new qa),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};qa.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new qa(e.clock,e.cone,e.magnitude)};qa.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new qa(e.clock,e.cone,1)};qa.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};qa.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};qa.prototype.equals=function(e){return qa.equals(this,e)};qa.prototype.clone=function(e){return qa.clone(this,e)};qa.prototype.equalsEpsilon=function(e,t){return qa.equalsEpsilon(this,e,t)};qa.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var t2=qa;var Sw=co(wl(),1);var K9;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?K9=function(){return performance.now()}:K9=function(){return Date.now()};var Ci=K9;function J9(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=ee.clone(t):l(n)?t=ee.clone(n):l(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),l(n)?n=ee.clone(n):n=ee.clone(t),l(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,No.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ci(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,gr.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(J9.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===gr.SYSTEM_CLOCK&&(this._clockStep=gr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===gr.SYSTEM_CLOCK&&(this._clockStep=gr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===gr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===gr.SYSTEM_CLOCK&&(this._clockStep=gr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});J9.prototype.tick=function(){let e=Ci(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===gr.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===gr.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===No.CLAMPED)ee.lessThan(t,o)?t=ee.clone(o,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(r===No.LOOP_STOP)for(ee.lessThan(t,o)&&(t=ee.clone(o,t));ee.greaterThan(t,s);)t=ee.addSeconds(o,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Fm=J9;function oA(){this._definitionChanged=new _e,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(oA.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Ll("startTime"),stopTime:Ll("stopTime"),currentTime:Ll("currentTime"),clockRange:Ll("clockRange"),clockStep:Ll("clockStep"),multiplier:Ll("multiplier")});oA.prototype.clone=function(e){return l(e)||(e=new oA),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};oA.prototype.equals=function(e){return this===e||l(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};oA.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};oA.prototype.getValue=function(e){return l(e)||(e=new Fm),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var Um=oA;var o7e=z.WHITE,s7e=.1,a7e=new H(8,8),c7e=new H(0,0),l7e=new H(1,1);function zT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(zT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._cellAlpha)&&j.isConstant(this._lineCount)&&j.isConstant(this._lineThickness)&&j.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});zT.prototype.getType=function(e){return"Grid"};zT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,o7e,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,s7e),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,a7e,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,l7e,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,c7e,t.lineOffset),t};zT.prototype.equals=function(e){return this===e||e instanceof zT&&j.equals(this._color,e._color)&&j.equals(this._cellAlpha,e._cellAlpha)&&j.equals(this._lineCount,e._lineCount)&&j.equals(this._lineThickness,e._lineThickness)&&j.equals(this._lineOffset,e._lineOffset)};var _w=zT;function HT(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(HT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});HT.prototype.getType=function(e){return"PolylineArrow"};HT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};HT.prototype.equals=function(e){return this===e||e instanceof HT&&j.equals(this._color,e._color)};var gw=HT;var u7e=z.WHITE,f7e=z.TRANSPARENT,d7e=16,m7e=255;function GT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(GT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._gapColor)&&j.isConstant(this._dashLength)&&j.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});GT.prototype.getType=function(e){return"PolylineDash"};GT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,u7e,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,f7e,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,d7e,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,m7e,t.dashPattern),t};GT.prototype.equals=function(e){return this===e||e instanceof GT&&j.equals(this._color,e._color)&&j.equals(this._gapColor,e._gapColor)&&j.equals(this._dashLength,e._dashLength)&&j.equals(this._dashPattern,e._dashPattern)};var yw=GT;var h7e=z.WHITE,p7e=.25,_7e=1;function WT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(WT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});WT.prototype.getType=function(e){return"PolylineGlow"};WT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,h7e,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,p7e,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,_7e,t.taperPower),t};WT.prototype.equals=function(e){return this===e||e instanceof WT&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var Aw=WT;var g7e=z.WHITE,y7e=z.BLACK,A7e=1;function jT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(jT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._outlineColor)&&j.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});jT.prototype.getType=function(e){return"PolylineOutline"};jT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,g7e,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,y7e,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,A7e),t};jT.prototype.equals=function(e){return this===e||e instanceof jT&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var sA=jT;function Op(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Mo,this._referenceFrame=y(t,nr.FIXED),this.setValue(e)}Object.defineProperties(Op.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});Op.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};Op.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};Op.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,Op.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Op.prototype.equals=function(e){return this===e||e instanceof Op&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Op.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Dg=Op;function Ig(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Mo,this.setValue(e)}Object.defineProperties(Ig.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Ig.prototype.getValue=function(e,t){let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};Ig.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,Ig.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Ig.prototype.equals=function(e){return this===e||e instanceof Ig&&j.arrayEquals(this._value,e._value)};Ig.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var xw=Ig;function aA(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Kl.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function Kl(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(Kl.prototype._onCollectionChanged,this)}Object.defineProperties(Kl.prototype,{isConstant:{get:function(){return j.isConstant(aA(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=aA(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return aA(this)}}});Kl.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Kl(e,n,i)};Kl.prototype.getValue=function(e,t){let n=aA(this);return l(n)?n.getValue(e,t):void 0};Kl.prototype.getValueInReferenceFrame=function(e,t,n){let i=aA(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Kl.prototype.getType=function(e){let t=aA(this);return l(t)?t.getType(e):void 0};Kl.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};Kl.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Kl.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Kl.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=aA(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Pg=Kl;var x7e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-P.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+P.TWO_PI:r}},hd=x7e;var Sae={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function vae(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function wae(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var Z9=[],Q9=[];function n2(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=wae(i[o],e),c=Or(t,f,ee.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=wae(i[o],e),!(l(a)&&ee.compare(a,f)>=0||l(d)&&ee.compare(f,d)>=0));){for(Z9[p++]=f,o=o+1,s=0;s<r;s++)Q9[g++]=i[o],o=o+1;a=f}p>0&&(Q9.length=g,vae(n,u,Q9),Z9.length=p,vae(t,c,Z9))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function pd(e,t){let n=e;n===Number&&(n=Sae);let i=n.packedLength,r=y(n.packedInterpolationLength,i),o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=Sae);let f=u.packedLength;i+=f,r+=y(u.packedInterpolationLength,f),s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=kT,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new _e,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=rf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=rf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(pd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});pd.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Or(n,e,ee.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===rf.NONE||r!==0&&ee.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===rf.HOLD)return o.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===rf.NONE||r!==0&&ee.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===rf.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,A=i-1;if(A-h+1>=g+1){let S=a-(g/2|0)-1;S<h&&(S=h);let w=S+g;w>A&&(w=A,S=w-g,S<h&&(S=h)),h=S,A=w}let C=A-h+1;for(let S=0;S<C;++S)c[S]=ee.secondsDifference(n[h+S],n[A]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,h,A,u);else{let S=0,w=this._packedLength,D=h*w,R=(A+1)*w;for(;D<R;)u[S]=s[D],D++,S++}let T=ee.secondsDifference(e,n[A]),E;if(p===0||!l(f.interpolate))E=f.interpolateOrderZero(T,c,u,d,this._interpolationResult);else{let S=Math.floor(d/(p+1));E=f.interpolate(T,c,u,S,p,p,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(E,s,h,A,t):o.unpack(E,0,t)}return o.unpack(s,a*this._packedLength,t)};pd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};pd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}n2(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};pd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}n2(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};pd.prototype.addSamplesPackedArray=function(e,t){n2(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};pd.prototype.removeSample=function(e){let t=Or(this._times,e,ee.compare);return t<0?!1:(Dae(this,t,1),!0)};function Dae(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}pd.prototype.removeSamples=function(e){let t=this._times,n=Or(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Or(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,Dae(this,n,i-n)};pd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!ee.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};pd._mergeNewSamples=n2;var of=pd;function sf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new of(m,n),this._definitionChanged=new _e,this._referenceFrame=y(e,nr.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(sf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});sf.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};sf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return S_.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};sf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};sf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};sf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};sf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};sf.prototype.removeSample=function(e){return this._property.removeSample(e)};sf.prototype.removeSamples=function(e){this._property.removeSamples(e)};sf.prototype.equals=function(e){return this===e||e instanceof sf&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ya=sf;var C7e={HORIZONTAL:0,VERTICAL:1},Vm=Object.freeze(C7e);var T7e=Vm.HORIZONTAL,E7e=z.WHITE,b7e=z.BLACK,S7e=0,v7e=1;function YT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(YT.prototype,{isConstant:{get:function(){return j.isConstant(this._orientation)&&j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._offset)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});YT.prototype.getType=function(e){return"Stripe"};YT.prototype.getValue=function(e,t){return l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,T7e)===Vm.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,E7e,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,b7e,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,S7e),t.repeat=j.getValueOrDefault(this._repeat,e,v7e),t};YT.prototype.equals=function(e){return this===e||e instanceof YT&&j.equals(this._orientation,e._orientation)&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._offset,e._offset)&&j.equals(this._repeat,e._repeat)};var Cw=YT;function Og(e){this._definitionChanged=new _e,this._intervals=new Bo,this._intervals.changedEvent.addEventListener(Og.prototype._intervalsChanged,this),this._referenceFrame=y(e,nr.FIXED)}Object.defineProperties(Og.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});Og.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};Og.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return S_.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Og.prototype.equals=function(e){return this===e||e instanceof Og&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};Og.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Rg=Og;function cA(){this._definitionChanged=new _e,this._intervals=new Bo,this._intervals.changedEvent.addEventListener(cA.prototype._intervalsChanged,this)}Object.defineProperties(cA.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});cA.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};cA.prototype.equals=function(e){return this===e||e instanceof cA&&this._intervals.equals(e._intervals,j.equals)};cA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Mg=cA;function qT(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=y(t,!0),this.position=e}Object.defineProperties(qT.prototype,{isConstant:{get:function(){return j.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var w7e=new m,Iae=new m,Pae=new ee,$9=1/60;qT.prototype.getValue=function(e,t){return this._getValue(e,t)};qT.prototype._getValue=function(e,t,n){l(t)||(t=new m);let i=this._position;if(j.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let r=i.getValue(e,w7e),o=i.getValue(ee.addSeconds(e,$9,Pae),Iae);if(!l(r)||!l(o)&&(o=r,r=i.getValue(ee.addSeconds(e,-$9,Pae),Iae),!l(r)))return;if(m.equals(r,o))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&r.clone(n);let s=m.subtract(o,r,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,$9,t)};qT.prototype.equals=function(e){return this===e||e instanceof qT&&j.equals(this._position,e._position)};var XT=qT;function Tw(e,t){this._velocityVectorProperty=new XT(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=y(t,re.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(Tw.prototype,{isConstant:{get:function(){return j.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Oae=new m,D7e=new m,Rae=new Z;Tw.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,D7e,Oae);if(l(n))return Mt.rotationMatrixFromPositionVelocity(Oae,n,this._ellipsoid,Rae),Ne.fromRotationMatrix(Rae,t)};Tw.prototype.equals=function(e){return this===e||e instanceof Tw&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var i2=Tw;function Bg(){}Bg.packedLength=m.packedLength;Bg.unpack=m.unpack;Bg.pack=m.pack;var eW;function Ew(e,t){return t[0]==="#"&&(t=eW+t),Pg.fromString(e,t)}function Mae(e,t,n){if(l(n.reference))return Ew(t,n.reference);if(l(n.velocityReference)){let i=Ew(t,n.velocityReference);switch(e){case m:case Bg:return new XT(i,e===Bg);case Ne:return new i2(i)}}throw new de(`${JSON.stringify(n)} is not valid CZML.`)}function I7e(e,t){return new hm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Bi=new m,Dc=new t2,Xa=new he,lA=new bn,r2=new Ne;function P7e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function Bae(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function O7e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=P.toRadians(n[r+1]),t[r+2]=P.toRadians(n[r+2]),t[r+3]=P.toRadians(n[r+3]),t[r+4]=P.toRadians(n[r+4]);return t}function R7e(e){let t=e.length;if(Dc.magnitude=1,t===2)return Dc.clock=e[0],Dc.cone=e[1],m.fromSpherical(Dc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Dc.clock=e[i+1],Dc.cone=e[i+2],m.fromSpherical(Dc,Bi),n[r+1]=Bi.x,n[r+2]=Bi.y,n[r+3]=Bi.z;return n}function M7e(e){let t=e.length;if(t===3)return Dc.clock=e[0],Dc.cone=e[1],Dc.magnitude=e[2],m.fromSpherical(Dc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Dc.clock=e[i+1],Dc.cone=e[i+2],Dc.magnitude=e[i+3],m.fromSpherical(Dc,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function B7e(e){let t=e.length;if(t===3)return Xa.longitude=e[0],Xa.latitude=e[1],Xa.height=e[2],re.WGS84.cartographicToCartesian(Xa,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Xa.longitude=e[i+1],Xa.latitude=e[i+2],Xa.height=e[i+3],re.WGS84.cartographicToCartesian(Xa,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function L7e(e){let t=e.length;if(t===3)return Xa.longitude=P.toRadians(e[0]),Xa.latitude=P.toRadians(e[1]),Xa.height=e[2],re.WGS84.cartographicToCartesian(Xa,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Xa.longitude=P.toRadians(e[i+1]),Xa.latitude=P.toRadians(e[i+2]),Xa.height=e[i+3],re.WGS84.cartographicToCartesian(Xa,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function tW(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return R7e(r);let o=e.spherical;if(l(o))return M7e(o);let s=e.cartographicRadians;if(l(s))return B7e(s);let a=e.cartographicDegrees;if(l(a))return L7e(a);throw new de(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Lae(e,t){m.unpack(e,t,Bi),m.normalize(Bi,Bi),m.pack(Bi,e,t)}function N7e(e){let t=tW(e);if(t.length===3)return Lae(t,0),t;for(let n=1;n<t.length;n+=4)Lae(t,n);return t}function Nae(e,t){Ne.unpack(e,t,r2),Ne.normalize(r2,r2),Ne.pack(r2,e,t)}function F7e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Nae(t,0),t;for(let n=1;n<t.length;n+=5)Nae(t,n)}return t}function Fae(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ke:e.hasOwnProperty("cartesian2")?H:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Bg:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?$t:e.hasOwnProperty("classificationType")?Hn:e.hasOwnProperty("colorBlendMode")?Tc:e.hasOwnProperty("cornerType")?Mi:e.hasOwnProperty("heightReference")?qe:e.hasOwnProperty("horizontalOrigin")?_i:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?jr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Lt:e.hasOwnProperty("distanceDisplayCondition")?Dt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Vm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?Sw.default:e.hasOwnProperty("verticalOrigin")?Bn:Object}function U7e(e,t,n){switch(e){case $t:return $t[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ke:return t.boundingRectangle;case H:return t.cartesian2;case m:return tW(t);case Bg:return N7e(t);case z:return P7e(t);case Hn:return Hn[y(t.classificationType,t)];case Tc:return Tc[y(t.colorBlendMode,t)];case Mi:return Mi[y(t.cornerType,t)];case qe:return qe[y(t.heightReference,t)];case _i:return _i[y(t.horizontalOrigin,t)];case Image:return Bae(t,n);case ee:return ee.fromIso8601(y(t.date,t));case jr:return jr[y(t.labelStyle,t)];case Number:return y(t.number,t);case Lt:return t.nearFarScalar;case Dt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Ne:return F7e(t);case hd:return y(t.number,t);case xn:return xn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Vm:return Vm[y(t.stripeOrientation,t)];case ce:return O7e(t);case Sw.default:return Bae(t,n);case Bn:return Bn[y(t.verticalOrigin,t)];default:throw new de(e)}}var V7e={HERMITE:$F,LAGRANGE:e2,LINEAR:kT};function o2(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:V7e[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=rf[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=rf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Uae={iso8601:void 0};function oo(e){if(l(e))return Uae.iso8601=e,bn.fromIso8601(Uae)}function nW(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Vae(e){let t=new Sc;return t.intervals.addInterval(nW(e)),t}function kae(e){let t=new ga(e.referenceFrame);return t.intervals.addInterval(nW(e)),t}function s2(e,t,n,i,r,o,s){let a=oo(i.interval);l(r)&&(l(a)?a=bn.intersect(a,r,lA):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Zae(t[n],a)}let g=!1;if(d){if(u=U7e(e,i,o),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let h=typeof e.unpack=="function"&&e!==hd;if(!g&&!p){d?t[n]=new $n(h?e.unpack(u,0):u):t[n]=Mae(e,s,i);return}let A=t[n],x,C=i.epoch;if(l(C)&&(x=ee.fromIso8601(C)),g&&!p){A instanceof of||(t[n]=A=new of(e)),A.addSamplesPackedArray(u,x),o2(i,A);return}let T;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(u,0):u:a.data=Mae(e,s,i),l(A)||(t[n]=A=d?new Mg:new Sc),d&&A instanceof Mg?A.intervals.addInterval(a):A instanceof Sc?(d&&(a.data=new $n(a.data)),A.intervals.addInterval(a)):(t[n]=A=Vae(A),d&&(a.data=new $n(a.data)),A.intervals.addInterval(a));return}l(A)||(t[n]=A=new Sc),A instanceof Sc||(t[n]=A=Vae(A));let E=A.intervals;T=E.findInterval(a),(!l(T)||!(T.data instanceof of))&&(T=a.clone(),T.data=new of(e),E.addInterval(T)),T.data.addSamplesPackedArray(u,x),o2(i,T.data)}function Zae(e,t){if(e instanceof of){e.removeSamples(t);return}else if(e instanceof Mg){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=bn.intersect(n.get(i),t,lA);r.isEmpty||Zae(r.data,t)}n.removeInterval(t);return}}function ge(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)s2(e,t,n,i[a],r,o,s);else s2(e,t,n,i,r,o,s)}function zae(e,t,n,i,r,o){let s=oo(n.interval);l(i)&&(l(s)?s=bn.intersect(s,i,lA):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Qae(e[t],s)}let g,h=!1;if(d&&(l(n.referenceFrame)&&(g=nr[n.referenceFrame]),g=y(g,nr.FIXED),u=tW(n),f=y(u.length,1),h=f>c),!h&&!p){d?e[t]=new Jc(m.unpack(u),g):e[t]=Ew(o,n.reference);return}let A=e[t],x,C=n.epoch;if(l(C)&&(x=ee.fromIso8601(C)),h&&!p){(!(A instanceof ya)||l(g)&&A.referenceFrame!==g)&&(e[t]=A=new ya(g,a)),A.addSamplesPackedArray(u,x),o2(n,A);return}let T;if(!h&&p){s=s.clone(),d?s.data=m.unpack(u):s.data=Ew(o,n.reference),l(A)||(d?A=new Rg(g):A=new ga(g),e[t]=A),d&&A instanceof Rg&&l(g)&&A.referenceFrame===g?A.intervals.addInterval(s):A instanceof ga?(d&&(s.data=new Jc(s.data,g)),A.intervals.addInterval(s)):(e[t]=A=kae(A),d&&(s.data=new Jc(s.data,g)),A.intervals.addInterval(s));return}l(A)?A instanceof ga||(e[t]=A=kae(A)):e[t]=A=new ga(g);let E=A.intervals;T=E.findInterval(s),(!l(T)||!(T.data instanceof ya)||l(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new ya(g,a),E.addInterval(T)),T.data.addSamplesPackedArray(u,x),o2(n,T.data)}function Qae(e,t){if(e instanceof ya){e.removeSamples(t);return}else if(e instanceof Rg){e.intervals.removeInterval(t);return}else if(e instanceof ga){let n=e.intervals;for(let i=0;i<n.length;++i){let r=bn.intersect(n.get(i),t,lA);r.isEmpty||Qae(r.data,t)}n.removeInterval(t);return}}function $ae(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)zae(e,t,n[s],i,r,o);else zae(e,t,n,i,r,o)}function Hae(e,t,n,i){l(n.references)?a2(e,t,n.references,n.interval,i,xw,Sc):(l(n.cartesian2)?n.array=H.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=H.unpackArray(n.cartesian)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function Gae(e,t,n,i,r,o){let s=oo(n.interval);l(i)&&(l(s)?s=bn.intersect(s,i,lA):s=i);let a=e[t],c,u;if(l(s)){a instanceof aw||(a=new aw,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Vt||(c=new Vt),f=n.solidColor,ge(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof _w||(c=new _w),f=n.grid,ge(z,c,"color",f.color,void 0,r,o),ge(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),ge(H,c,"lineCount",f.lineCount,void 0,r,o),ge(H,c,"lineThickness",f.lineThickness,void 0,r,o),ge(H,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof f0||(c=new f0),f=n.image,ge(Image,c,"image",f.image,void 0,r,o),ge(H,c,"repeat",f.repeat,void 0,r,o),ge(z,c,"color",f.color,void 0,r,o),ge(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof Cw||(c=new Cw),f=n.stripe,ge(Vm,c,"orientation",f.orientation,void 0,r,o),ge(z,c,"evenColor",f.evenColor,void 0,r,o),ge(z,c,"oddColor",f.oddColor,void 0,r,o),ge(Number,c,"offset",f.offset,void 0,r,o),ge(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof sA||(c=new sA),f=n.polylineOutline,ge(z,c,"color",f.color,void 0,r,o),ge(z,c,"outlineColor",f.outlineColor,void 0,r,o),ge(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof Aw||(c=new Aw),f=n.polylineGlow,ge(z,c,"color",f.color,void 0,r,o),ge(Number,c,"glowPower",f.glowPower,void 0,r,o),ge(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof gw||(c=new gw),f=n.polylineArrow,ge(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof yw||(c=new yw),f=n.polylineDash,ge(z,c,"color",f.color,void 0,void 0,o),ge(z,c,"gapColor",f.gapColor,void 0,void 0,o),ge(Number,c,"dashLength",f.dashLength,void 0,r,o),ge(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof iw||(c=new iw),f=n.checkerboard,ge(z,c,"evenColor",f.evenColor,void 0,r,o),ge(z,c,"oddColor",f.oddColor,void 0,r,o),ge(H,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function Jl(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Gae(e,t,n[s],i,r,o);else Gae(e,t,n,i,r,o)}function k7e(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function z7e(e,t,n,i){let r=t.description;l(r)&&ge(String,e,"description",r,void 0,i,n)}function H7e(e,t,n,i){let r=t.position;l(r)&&$ae(e,"position",r,void 0,i,n)}function G7e(e,t,n,i){let r=t.viewFrom;l(r)&&ge(m,e,"viewFrom",r,void 0,i,n)}function W7e(e,t,n,i){let r=t.orientation;l(r)&&ge(Ne,e,"orientation",r,void 0,i,n)}function j7e(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new Nl);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)s2(Fae(s[a]),e.properties,o,s[a],void 0,i,n);else s2(Fae(s),e.properties,o,s,void 0,i,n)}}}function a2(e,t,n,i,r,o,s){let a=n.map(function(c){return Ew(r,c)});if(l(i)){i=oo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(nW(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function Wae(e,t,n,i){let r=n.references;l(r)?a2(e,t,r,n.interval,i,xw,Sc):ge(Array,e,t,n,void 0,void 0,i)}function jae(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Wae(e,t,n[r],i);else Wae(e,t,n,i)}function Yae(e,t,n,i){let r=n.references;l(r)?a2(e,t,r,n.interval,i,Dg,ga):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function vw(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Yae(e,t,n[r],i);else Yae(e,t,n,i)}function Y7e(e){return m.unpackArray(e)}function q7e(e){return m.fromRadiansArrayHeights(e)}function X7e(e){return m.fromDegreesArrayHeights(e)}function qae(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return a2(a,"positions",s,n.interval,i,Dg,ga),a.positions});e[t]=new Dg(o)}else l(n.cartesian)?n.array=n.cartesian.map(Y7e):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(q7e):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(X7e)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i)}function K7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)qae(e,t,n[r],i);else qae(e,t,n,i)}function J7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)Hae(e,t,n[r],i);else Hae(e,t,n,i)}function Z7e(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Bo),o.addInterval(oo(r[s]));else o=new Bo,o.addInterval(oo(r));e.availability=o}function Q7e(e,t,n,i,r){l(t)&&ge(Bg,e,"alignedAxis",t,n,i,r)}function $7e(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=oo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new mc),ge(Boolean,s,"show",r.show,o,i,n),ge(Image,s,"image",r.image,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(H,s,"pixelOffset",r.pixelOffset,o,i,n),ge(m,s,"eyeOffset",r.eyeOffset,o,i,n),ge(_i,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ge(Bn,s,"verticalOrigin",r.verticalOrigin,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(hd,s,"rotation",r.rotation,o,i,n),Q7e(s,r.alignedAxis,o,i,n),ge(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(Lt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Lt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Lt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ge(Ke,s,"imageSubRegion",r.imageSubRegion,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function eje(e,t,n,i){let r=t.box;if(!l(r))return;let o=oo(r.interval),s=e.box;l(s)||(e.box=s=new fC),ge(Boolean,s,"show",r.show,o,i,n),ge(m,s,"dimensions",r.dimensions,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function tje(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=oo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new mC),ge(Boolean,s,"show",r.show,o,i,n),vw(s,"positions",r.positions,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(qe,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(Mi,s,"cornerType",r.cornerType,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function nje(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=oo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new hC),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"length",r.length,o,i,n),ge(Number,s,"topRadius",r.topRadius,o,i,n),ge(Number,s,"bottomRadius",r.bottomRadius,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ge(Number,s,"slices",r.slices,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function ije(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new de("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new de("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=y(r.interval,o.interval),o.currentTime=y(r.currentTime,o.currentTime),o.range=y(r.range,o.range),o.step=y(r.step,o.step),o.multiplier=y(r.multiplier,o.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function rje(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=oo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new pC),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),ge(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(qe,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(hd,s,"rotation",r.rotation,o,i,n),ge(hd,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function oje(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=oo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new _C),ge(Boolean,s,"show",r.show,o,i,n),ge(m,s,"radii",r.radii,o,i,n),ge(m,s,"innerRadii",r.innerRadii,o,i,n),ge(Number,s,"minimumClock",r.minimumClock,o,i,n),ge(Number,s,"maximumClock",r.maximumClock,o,i,n),ge(Number,s,"minimumCone",r.minimumCone,o,i,n),ge(Number,s,"maximumCone",r.maximumCone,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"stackPartitions",r.stackPartitions,o,i,n),ge(Number,s,"slicePartitions",r.slicePartitions,o,i,n),ge(Number,s,"subdivisions",r.subdivisions,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function sje(e,t,n,i){let r=t.label;if(!l(r))return;let o=oo(r.interval),s=e.label;l(s)||(e.label=s=new um),ge(Boolean,s,"show",r.show,o,i,n),ge(String,s,"text",r.text,o,i,n),ge(String,s,"font",r.font,o,i,n),ge(jr,s,"style",r.style,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Boolean,s,"showBackground",r.showBackground,o,i,n),ge(z,s,"backgroundColor",r.backgroundColor,o,i,n),ge(H,s,"backgroundPadding",r.backgroundPadding,o,i,n),ge(H,s,"pixelOffset",r.pixelOffset,o,i,n),ge(m,s,"eyeOffset",r.eyeOffset,o,i,n),ge(_i,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),ge(Bn,s,"verticalOrigin",r.verticalOrigin,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"fillColor",r.fillColor,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Lt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Lt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),ge(Lt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function aje(e,t,n,i){let r=t.model;if(!l(r))return;let o=oo(r.interval),s=e.model;l(s)||(e.model=s=new v_),ge(Boolean,s,"show",r.show,o,i,n),ge(Sw.default,s,"uri",r.gltf,o,i,n),ge(Number,s,"scale",r.scale,o,i,n),ge(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),ge(Number,s,"maximumScale",r.maximumScale,o,i,n),ge(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),ge(Boolean,s,"runAnimations",r.runAnimations,o,i,n),ge(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),ge(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(Tc,s,"colorBlendMode",r.colorBlendMode,o,i,n),ge(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Xae(s,u[a],o,i,n);else Xae(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Kae(s,f[a],o,i,n);else Kae(s,f,o,i,n)}function Xae(e,t,n,i,r){let o=oo(t.interval);l(n)&&(l(o)?o=bn.intersect(o,n,lA):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Nl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new gC),ge(m,p,"translation",d.translation,o,i,r),ge(Ne,p,"rotation",d.rotation,o,i,r),ge(m,p,"scale",d.scale,o,i,r)}}function Kae(e,t,n,i,r){let o=oo(t.interval);l(n)&&(l(o)?o=bn.intersect(o,n,lA):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Nl),s.hasProperty(f)||s.addProperty(f),ge(Number,s,f,d,o,i,r))}}function cje(e,t,n,i){let r=t.path;if(!l(r))return;let o=oo(r.interval),s=e.path;l(s)||(e.path=s=new w_),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"leadTime",r.leadTime,o,i,n),ge(Number,s,"trailTime",r.trailTime,o,i,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"resolution",r.resolution,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function lje(e,t,n,i){let r=t.point;if(!l(r))return;let o=oo(r.interval),s=e.point;l(s)||(e.point=s=new AC),ge(Boolean,s,"show",r.show,o,i,n),ge(Number,s,"pixelSize",r.pixelSize,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(z,s,"color",r.color,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Lt,s,"scaleByDistance",r.scaleByDistance,o,i,n),ge(Lt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function bw(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(bw.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});bw.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Zc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Zc(n,i)};bw.prototype.equals=function(e){return this===e||e instanceof bw&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function uje(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=oo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new fm),ge(Boolean,s,"show",r.show,o,i,n),vw(s,"_positions",r.positions,n),K7e(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new bw(s)),ge(Number,s,"height",r.height,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(qe,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(hd,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),ge(Boolean,s,"closeTop",r.closeTop,o,i,n),ge(Boolean,s,"closeBottom",r.closeBottom,o,i,n),ge($t,s,"arcType",r.arcType,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function fje(e){return e?$t.GEODESIC:$t.NONE}function dje(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=oo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Ac),ge(Boolean,s,"show",r.show,o,i,n),vw(s,"positions",r.positions,n),ge(Number,s,"width",r.width,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),Jl(s,"material",r.material,o,i,n),Jl(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),ge($t,s,"arcType",r.arcType,o,i,n),ge(Boolean,s,"clampToGround",r.clampToGround,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};ge(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=I7e(a.followSurface,fje)}}function mje(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=oo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new xC),vw(s,"positions",r.positions,n),J7e(s,"shape",r.shape,n),ge(Boolean,s,"show",r.show,o,i,n),ge(Mi,s,"cornerType",r.cornerType,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function hje(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=oo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new dm),ge(Boolean,s,"show",r.show,o,i,n),ge(ce,s,"coordinates",r.coordinates,o,i,n),ge(Number,s,"height",r.height,o,i,n),ge(qe,s,"heightReference",r.heightReference,o,i,n),ge(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),ge(qe,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),ge(hd,s,"rotation",r.rotation,o,i,n),ge(hd,s,"stRotation",r.stRotation,o,i,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),ge(Hn,s,"classificationType",r.classificationType,o,i,n),ge(Number,s,"zIndex",r.zIndex,o,i,n)}function pje(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=oo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new yC),ge(Boolean,s,"show",r.show,o,i,n),ge(Sw.default,s,"uri",r.uri,o,i,n),ge(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function _je(e,t,n,i){let r=t.wall;if(!l(r))return;let o=oo(r.interval),s=e.wall;l(s)||(e.wall=s=new D_),ge(Boolean,s,"show",r.show,o,i,n),vw(s,"positions",r.positions,n),jae(s,"minimumHeights",r.minimumHeights,n),jae(s,"maximumHeights",r.maximumHeights,n),ge(Number,s,"granularity",r.granularity,o,i,n),ge(Boolean,s,"fill",r.fill,o,i,n),Jl(s,"material",r.material,o,i,n),ge(Boolean,s,"outline",r.outline,o,i,n),ge(z,s,"outlineColor",r.outlineColor,o,i,n),ge(Number,s,"outlineWidth",r.outlineWidth,o,i,n),ge(xn,s,"shadows",r.shadows,o,i,n),ge(Dt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Jae(e,t,n,i,r){let o=e.id;if(l(o)||(o=jn()),eW=o,!l(r._version)&&o!=="document")throw new de("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")ije(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}eW=void 0}function gje(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(Ge.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=ee.secondsDifference(s,o),c=Math.round(a/120);return t=new Um,t.startTime=ee.clone(o),t.stopTime=ee.clone(s),t.clockRange=No.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(o),t.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Um,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=No.LOOP_STOP,t.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=oo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(No[n.range],No.LOOP_STOP)),l(n.step)&&(t.clockStep=y(gr[n.step],gr.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function ece(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),o=y(o,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=ve.createIfNeeded(o),Lo.setLoading(e,!0),Promise.resolve(r).then(function(a){return yje(e,a,o,i)}).catch(function(a){return Lo.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function yje(e,t,n,i){Lo.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new tce,r.removeAll()),al._processCzml(t,r,n,void 0,e);let o=gje(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=wg(n.getUrlComponent()),o=!0),Lo.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function tce(){this.name=void 0,this.clock=void 0}function al(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new tce,this._version=void 0,this._entityCollection=new Ws(this),this._entityCluster=new nf,this._credit=void 0,this._resourceCredits=[]}al.load=function(e,t){return new al().load(e,t)};Object.defineProperties(al.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});al.updaters=[$7e,eje,tje,nje,rje,oje,sje,aje,k7e,z7e,cje,lje,uje,dje,mje,j7e,hje,H7e,pje,G7e,_je,W7e,Z7e];al.prototype.process=function(e,t){return ece(this,e,t,!1)};al.prototype.load=function(e,t){return ece(this,e,t,!0)};al.prototype.update=function(e){return!0};al.processPacketData=ge;al.processPositionPacketData=$ae;al.processMaterialPacketData=Jl;al._processCzml=function(e,t,n,i,r){if(i=y(i,al.updaters),Array.isArray(e))for(let o=0,s=e.length;o<s;++o)Jae(e[o],t,i,n,r);else Jae(e,t,i,n,r)};var c2=al;function Ic(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(Ic.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Ic.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Ic.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Ic.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};Ic.prototype.contains=function(e){return this.indexOf(e)!==-1};Ic.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Ic.prototype.get=function(e){return this._dataSources[e]};Ic.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function l2(e,t){return e.indexOf(t)}function nce(e,t,n){let i=e._dataSources,r=i.length-1;if(t=P.clamp(t,0,r),n=P.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Ic.prototype.raise=function(e){let t=l2(this._dataSources,e);nce(this,t,t+1)};Ic.prototype.lower=function(e){let t=l2(this._dataSources,e);nce(this,t,t-1)};Ic.prototype.raiseToTop=function(e){let t=l2(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Ic.prototype.lowerToBottom=function(e){let t=l2(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Ic.prototype.isDestroyed=function(){return!1};Ic.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var u2=Ic;function qs(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=jn(),this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(qs.prototype,{length:{get:function(){return this._primitives.length}}});qs.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e};qs.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1};qs.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};qs.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]};qs.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function f2(e,t){return e._primitives.indexOf(t)}qs.prototype.raise=function(e){if(l(e)){let t=f2(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};qs.prototype.raiseToTop=function(e){if(l(e)){let t=f2(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};qs.prototype.lower=function(e){if(l(e)){let t=f2(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};qs.prototype.lowerToBottom=function(e){if(l(e)){let t=f2(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};qs.prototype.get=function(e){return this._primitives[e]};qs.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};qs.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};qs.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};qs.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};qs.prototype.isDestroyed=function(){return!1};qs.prototype.destroy=function(){return this.removeAll(),ue(this)};var Zl=qs;function km(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(km.prototype,{length:{get:function(){return this._length}}});km.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Zl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};km.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};km.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};km.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};km.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};km.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};km.prototype.isDestroyed=function(){return!1};km.prototype.destroy=function(){return this.removeAll(),ue(this)};var d2=km;function KT(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Et}KT.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};KT.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};KT.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};KT.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};KT.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):lt.FAILED};var JT=KT;var rW={},m2=new m,ice=new m,rce=new Ne,oce=new Z;function ZT(e,t,n,i,r,o,s,a,c,u){let f=e+t;m.multiplyByScalar(i,Math.cos(f),m2),m.multiplyByScalar(n,Math.sin(f),ice),m.add(m2,ice,m2);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let h=o/Math.sqrt(s*d+r*p)/a;return Ne.fromAxisAngle(m2,h,rce),Z.fromQuaternion(rce,oce),Z.multiplyByVector(oce,c,u),m.normalize(u,u),m.multiplyByScalar(u,a,u),u}var sce=new m,ace=new m,iW=new m,Aje=new m;rW.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=m.fromArray(e,f,sce);i.scaleToGeodeticSurface(g,g);let h=m.clone(g,ace),A=i.geodeticSurfaceNormal(g,Aje),x=m.multiplyByScalar(A,r,iW);m.add(g,x,g),n&&(m.multiplyByScalar(A,o,x),m.add(h,x,h),a[f+u]=h.x,a[d+u]=h.y,a[p+u]=h.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var xje=new m,Cje=new m,Tje=new m;rW.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=m.magnitude(s),p=m.normalize(s,xje),g=m.cross(m.UNIT_Z,s,Cje);g=m.normalize(g,g);let h=m.cross(p,g,Tje),A=1+Math.ceil(P.PI_OVER_TWO/a),x=P.PI_OVER_TWO/(A-1),C=P.PI_OVER_TWO-A*x;C<0&&(A-=Math.ceil(Math.abs(C)/x));let T=2*(A*(A+2)),E=t?new Array(T*3):void 0,S=0,w=sce,D=ace,R=A*4*3,O=R-1,L=0,N=n?new Array(R):void 0,_,b,v,I,M;for(C=P.PI_OVER_TWO,w=ZT(C,o,h,g,c,f,u,d,p,w),t&&(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z),n&&(N[O--]=w.z,N[O--]=w.y,N[O--]=w.x),C=P.PI_OVER_TWO-x,_=1;_<A+1;++_){if(w=ZT(C,o,h,g,c,f,u,d,p,w),D=ZT(Math.PI-C,o,h,g,c,f,u,d,p,D),t){for(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,v=2*_+2,b=1;b<v-1;++b)I=b/(v-1),M=m.lerp(w,D,I,iW),E[S++]=M.x,E[S++]=M.y,E[S++]=M.z;E[S++]=D.x,E[S++]=D.y,E[S++]=D.z}n&&(N[O--]=w.z,N[O--]=w.y,N[O--]=w.x,N[L++]=D.x,N[L++]=D.y,N[L++]=D.z),C=P.PI_OVER_TWO-(_+1)*x}for(_=A;_>1;--_){if(C=P.PI_OVER_TWO-(_-1)*x,w=ZT(-C,o,h,g,c,f,u,d,p,w),D=ZT(C+Math.PI,o,h,g,c,f,u,d,p,D),t){for(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,v=2*(_-1)+2,b=1;b<v-1;++b)I=b/(v-1),M=m.lerp(w,D,I,iW),E[S++]=M.x,E[S++]=M.y,E[S++]=M.z;E[S++]=D.x,E[S++]=D.y,E[S++]=D.z}n&&(N[O--]=w.z,N[O--]=w.y,N[O--]=w.x,N[L++]=D.x,N[L++]=D.y,N[L++]=D.z)}C=P.PI_OVER_TWO,w=ZT(-C,o,h,g,c,f,u,d,p,w);let F={};return t&&(E[S++]=w.x,E[S++]=w.y,E[S++]=w.z,F.positions=E,F.numPts=A),n&&(N[O--]=w.z,N[O--]=w.y,N[O--]=w.x,F.outerPositions=N),F};var Ql=rW;var QT=new m,oW=new m,sW=new m,cce=new m,ss=new H,lce=new Z,Eje=new Z,aW=new Ne,uce=new m,fce=new m,dce=new m,_2=new he,mce=new m,hce=new H,pce=new H;function _ce(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,h=i.bitangent?new Float32Array(u*3):void 0,A=f?new Float32Array(u*3):void 0,x=0,C=uce,T=fce,E=dce,S=new Di(a),w=S.project(a.cartesianToCartographic(r,_2),mce),D=a.scaleToGeodeticSurface(r,QT);a.geodeticSurfaceNormal(D,D);let R=lce,O=Eje;if(c!==0){let M=Ne.fromAxisAngle(D,c,aW);R=Z.fromQuaternion(M,R),M=Ne.fromAxisAngle(D,-c,aW),O=Z.fromQuaternion(M,O)}else R=Z.clone(Z.IDENTITY,R),O=Z.clone(Z.IDENTITY,O);let L=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,hce),N=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pce),_=e.length,b=n?_:0,v=b/3*2;for(let M=0;M<_;M+=3){let F=M+1,k=M+2,V=m.fromArray(e,M,QT);if(i.st){let G=Z.multiplyByVector(R,V,oW),U=S.project(a.cartesianToCartographic(G,_2),sW);m.subtract(U,w,U),ss.x=(U.x+o)/(2*o),ss.y=(U.y+s)/(2*s),L.x=Math.min(ss.x,L.x),L.y=Math.min(ss.y,L.y),N.x=Math.max(ss.x,N.x),N.y=Math.max(ss.y,N.y),n&&(d[x+v]=ss.x,d[x+1+v]=ss.y),d[x++]=ss.x,d[x++]=ss.y}(i.normal||i.tangent||i.bitangent||f)&&(C=a.geodeticSurfaceNormal(V,C),f&&(A[M+b]=-C.x,A[F+b]=-C.y,A[k+b]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=m.normalize(m.cross(m.UNIT_Z,C,T),T),Z.multiplyByVector(O,T,T)),i.normal&&(p[M]=C.x,p[F]=C.y,p[k]=C.z,n&&(p[M+b]=-C.x,p[F+b]=-C.y,p[k+b]=-C.z)),i.tangent&&(g[M]=T.x,g[F]=T.y,g[k]=T.z,n&&(g[M+b]=-T.x,g[F+b]=-T.y,g[k+b]=-T.z)),i.bitangent&&(E=m.normalize(m.cross(C,T,E),E),h[M]=E.x,h[F]=E.y,h[k]=E.z,n&&(h[M+b]=E.x,h[F+b]=E.y,h[k+b]=E.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-L.x)/(N.x-L.x),d[M+1]=(d[M+1]-L.y)/(N.y-L.y)}let I=new gn;if(i.position){let M=Ql.raisePositionsToHeight(e,t,n);I.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(I.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),f&&(I.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===an.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===an.NONE?0:1;M=M.fill(F)}I.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return I}function gce(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var uA=new m;function bje(e){let t=e.center;uA=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,uA),e.height,uA),uA=m.add(t,uA,uA);let n=new ae(uA,e.semiMajorAxis),i=Ql.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=_ce(r,e,!1),a=gce(o);return a=Ue.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function Sje(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,h=n.tangent?new Float32Array(f*3):void 0,A=n.bitangent?new Float32Array(f*3):void 0,x=t.shadowVolume,C=x?new Float32Array(f*3):void 0,T=0,E=uce,S=fce,w=dce,D=new Di(s),R=D.project(s.cartesianToCartographic(i,_2),mce),O=s.scaleToGeodeticSurface(i,QT);s.geodeticSurfaceNormal(O,O);let L=Ne.fromAxisAngle(O,u,aW),N=Z.fromQuaternion(L,lce),_=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,hce),b=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pce),v=e.length,I=v/3*2;for(let F=0;F<v;F+=3){let k=F+1,V=F+2,G=m.fromArray(e,F,QT),U;if(n.st){let Y=Z.multiplyByVector(N,G,oW),Q=D.project(s.cartesianToCartographic(Y,_2),sW);m.subtract(Q,R,Q),ss.x=(Q.x+r)/(2*r),ss.y=(Q.y+o)/(2*o),_.x=Math.min(ss.x,_.x),_.y=Math.min(ss.y,_.y),b.x=Math.max(ss.x,b.x),b.y=Math.max(ss.y,b.y),p[T+I]=ss.x,p[T+1+I]=ss.y,p[T++]=ss.x,p[T++]=ss.y}G=s.scaleToGeodeticSurface(G,G),U=m.clone(G,oW),E=s.geodeticSurfaceNormal(G,E),x&&(C[F+v]=-E.x,C[k+v]=-E.y,C[V+v]=-E.z);let q=m.multiplyByScalar(E,a,cce);if(G=m.add(G,q,G),q=m.multiplyByScalar(E,c,q),U=m.add(U,q,U),n.position&&(d[F+v]=U.x,d[k+v]=U.y,d[V+v]=U.z,d[F]=G.x,d[k]=G.y,d[V]=G.z),n.normal||n.tangent||n.bitangent){w=m.clone(E,w);let Y=m.fromArray(e,(F+3)%v,cce);m.subtract(Y,G,Y);let Q=m.subtract(U,G,sW);E=m.normalize(m.cross(Q,Y,E),E),n.normal&&(g[F]=E.x,g[k]=E.y,g[V]=E.z,g[F+v]=E.x,g[k+v]=E.y,g[V+v]=E.z),n.tangent&&(S=m.normalize(m.cross(w,E,S),S),h[F]=S.x,h[k]=S.y,h[V]=S.z,h[F+v]=S.x,h[F+1+v]=S.y,h[F+2+v]=S.z),n.bitangent&&(A[F]=w.x,A[k]=w.y,A[V]=w.z,A[F+v]=w.x,A[k+v]=w.y,A[V+v]=w.z)}}if(n.st){v=p.length;for(let F=0;F<v;F+=2)p[F]=(p[F]-_.x)/(b.x-_.x),p[F+1]=(p[F+1]-_.y)/(b.y-_.y)}let M=new gn;if(n.position&&(M.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(M.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),x&&(M.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===an.TOP)F=F.fill(1,0,f/2);else{let k=t.offsetAttribute===an.NONE?0:1;F=F.fill(k)}M.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function vje(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var h2=new ae,p2=new ae;function wje(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,QT),e.height,QT);h2.center=m.add(t,r,h2.center),h2.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),p2.center=m.add(t,r,p2.center),p2.radius=i;let o=Ql.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ae.union(h2,p2),f=_ce(s,e,!0),d=gce(a),p=d.length;d.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)d[S+p]=d[S+2]+g,d[S+1+p]=d[S+1]+g,d[S+2+p]=d[S]+g;let h=Ue.createTypedArray(g*2/3,d),A=new dt({attributes:f,indices:h,primitiveType:Le.TRIANGLES}),x=Sje(c,e);d=vje(c);let C=Ue.createTypedArray(c.length*2/3,d),T=new dt({attributes:x,indices:C,primitiveType:Le.TRIANGLES}),E=Vn.combineInstances([new Tt({geometry:A}),new Tt({geometry:T})]);return{boundingSphere:u,attributes:E[0].attributes,indices:E[0].indices}}function yce(e,t,n,i,r,o,s){let c=Ql.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=m.fromArray(c,p*3);let d=ce.fromCartesianArray(f,o,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function Hm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Oe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Oe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Hm.packedLength=m.packedLength+re.packedLength+Oe.packedLength+9;Hm.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Ace=new m,xce=new re,Cce=new Oe,zm={center:Ace,ellipsoid:xce,vertexFormat:Cce,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Hm.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Ace);t+=m.packedLength;let r=re.unpack(e,t,xce);t+=re.packedLength;let o=Oe.unpack(e,t,Cce);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(zm.height=f,zm.extrudedHeight=p,zm.granularity=d,zm.stRotation=u,zm.rotation=c,zm.semiMajorAxis=s,zm.semiMinorAxis=a,zm.shadowVolume=g,zm.offsetAttribute=h===-1?void 0:h,new Hm(zm))};Hm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,re.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return yce(n,r,o,a,s,i,t)};Hm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=wje(r);else if(o=bje(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Le.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};Hm.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Hm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};function Dje(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Ql.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(Hm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=yce(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Dje(this)),this._textureCoordinateRotationPoints}}});var cl=Hm;var Tce=new m,fA=new m;function Ije(e){let t=e.center;fA=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,fA),e.height,fA),fA=m.add(t,fA,fA);let n=new ae(fA,e.semiMajorAxis),i=Ql.computeEllipsePositions(e,!1,!0).outerPositions,r=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Ql.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=Ue.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var g2=new ae,y2=new ae;function Pje(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,Tce),e.height,Tce);g2.center=m.add(t,r,g2.center),g2.radius=i,r=m.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),y2.center=m.add(t,r,y2.center),y2.radius=i;let o=Ql.computeEllipsePositions(e,!1,!0).outerPositions,s=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Ql.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ae.union(g2,y2),c=o.length/3;if(l(e.offsetAttribute)){let h=new Uint8Array(c);if(e.offsetAttribute===an.TOP)h=h.fill(1,0,c/2);else{let A=e.offsetAttribute===an.NONE?0:1;h=h.fill(A)}s.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ue.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let h=Math.min(u,c);g=Math.round(c/h);let A=Math.min(g*u,c);for(p=0;p<A;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function $T(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=re.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}$T.packedLength=m.packedLength+re.packedLength+8;$T.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Ece=new m,bce=new re,Rp={center:Ece,ellipsoid:bce,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};$T.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Ece);t+=m.packedLength;let r=re.unpack(e,t,bce);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(Rp.height=c,Rp.extrudedHeight=f,Rp.granularity=u,Rp.rotation=a,Rp.semiMajorAxis=o,Rp.semiMinorAxis=s,Rp.numberOfVerticalLines=d,Rp.offsetAttribute=p===-1?void 0:p,new $T(Rp))};$T.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=Pje(r);else if(o=Ije(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Le.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var af=$T;var Sce=new z,vce=m.ZERO,wce=new m,Dce=new ce;function Oje(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function _d(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new Oje(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(_d.prototype=Object.create(Kn.prototype),_d.prototype.constructor=_d);_d.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Sce)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,vce,wce))),new Tt({id:t,geometry:new cl(this._options),attributes:i})};_d.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Sce),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,vce,wce))),new Tt({id:t,geometry:new af(this._options),attributes:o})};_d.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};_d.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||li.prototype._isHidden.call(this,e,t)};_d.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!j.isConstant(t.rotation)||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};_d.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),r=j.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),o=j.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=j.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=j.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Kn.getGeometryHeight(n,i),r=Kn.getGeometryExtrudedHeight(r,o),r===Kn.CLAMP_TO_GROUND&&(r=ai.getMinimumMaximumHeights(cl.computeRectangle(s,Dce)).minimumTerrainHeight),s.extrudedHeight=r};_d.DynamicGeometryUpdater=eE;function eE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(eE.prototype=Object.create(ci.prototype),eE.prototype.constructor=eE);eE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ci.prototype._isHidden.call(this,e,t,n)};eE.prototype._setOptions=function(e,t,n){let i=this._options,r=j.getValueOrUndefined(t.height,n),o=j.getValueOrDefault(t.heightReference,n,qe.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(r)&&(r=0),i.center=j.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=j.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=j.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(cl.computeRectangle(i,Dce)).minimumTerrainHeight),i.extrudedHeight=s};var A2=_d;var Rje=new m,Mje=new m,Bje=new m,Lje=new m,Nje=new m,Fje=new m(1,1,1),Ice=Math.cos,Pce=Math.sin;function Mp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,Fje),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,P.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Oe.DEFAULT);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Oe.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Mp.packedLength=2*m.packedLength+Oe.packedLength+7;Mp.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Oce=new m,Rce=new m,Mce=new Oe,Lg={radii:Oce,innerRadii:Rce,vertexFormat:Mce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Mp.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Oce);t+=m.packedLength;let r=m.unpack(e,t,Rce);t+=m.packedLength;let o=Oe.unpack(e,t,Mce);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(r,n._innerRadii),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(Lg.minimumClock=s,Lg.maximumClock=a,Lg.minimumCone=c,Lg.maximumCone=u,Lg.stackPartitions=f,Lg.slicePartitions=d,Lg.offsetAttribute=p===-1?void 0:p,new Mp(Lg))};Mp.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-o)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],h=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)h.push(i+d*(r-i)/(c-1));h.push(r);let A=g.length,x=h.length,C=0,T=1,E=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,w=!1,D=!1;E&&(T=2,o>0&&(S=!0,C+=c-1),s<Math.PI&&(w=!0,C+=c-1),(r-i)%P.TWO_PI?(D=!0,C+=(u-1)*2+1):C+=1);let R=x*A*T,O=new Float64Array(R*3),L=new Array(R).fill(!1),N=new Array(R).fill(!1),_=c*u*T,b=6*(_+C+1-(c+u)*T),v=Ue.createTypedArray(_,b),I=a.normal?new Float32Array(R*3):void 0,M=a.tangent?new Float32Array(R*3):void 0,F=a.bitangent?new Float32Array(R*3):void 0,k=a.st?new Float32Array(R*2):void 0,V=new Array(A),G=new Array(A);for(f=0;f<A;f++)V[f]=Pce(g[f]),G[f]=Ice(g[f]);let U=new Array(x),q=new Array(x);for(d=0;d<x;d++)q[d]=Ice(h[d]),U[d]=Pce(h[d]);for(f=0;f<A;f++)for(d=0;d<x;d++)O[p++]=t.x*V[f]*q[d],O[p++]=t.y*V[f]*U[d],O[p++]=t.z*G[f];let Y=R/2;if(E)for(f=0;f<A;f++)for(d=0;d<x;d++)O[p++]=n.x*V[f]*q[d],O[p++]=n.y*V[f]*U[d],O[p++]=n.z*G[f],L[Y]=!0,f>0&&f!==A-1&&d!==0&&d!==x-1&&(N[Y]=!0),Y++;p=0;let Q,W;for(f=1;f<A-2;f++)for(Q=f*x,W=(f+1)*x,d=1;d<x-2;d++)v[p++]=W+d,v[p++]=W+d+1,v[p++]=Q+d+1,v[p++]=W+d,v[p++]=Q+d+1,v[p++]=Q+d;if(E){let Pe=A*x;for(f=1;f<A-2;f++)for(Q=Pe+f*x,W=Pe+(f+1)*x,d=1;d<x-2;d++)v[p++]=W+d,v[p++]=Q+d,v[p++]=Q+d+1,v[p++]=W+d,v[p++]=Q+d+1,v[p++]=W+d+1}let K,J;if(E){if(S)for(J=A*x,f=1;f<x-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=J+f+1,v[p++]=f,v[p++]=J+f+1,v[p++]=J+f;if(w)for(K=A*x-x,J=A*x*T-x,f=1;f<x-2;f++)v[p++]=K+f+1,v[p++]=K+f,v[p++]=J+f,v[p++]=K+f+1,v[p++]=J+f,v[p++]=J+f+1}if(D){for(f=1;f<A-2;f++)J=x*A+x*f,K=x*f,v[p++]=J,v[p++]=K+x,v[p++]=K,v[p++]=J,v[p++]=J+x,v[p++]=K+x;for(f=1;f<A-2;f++)J=x*A+x*(f+1)-1,K=x*(f+1)-1,v[p++]=K+x,v[p++]=J,v[p++]=K,v[p++]=K+x,v[p++]=J+x,v[p++]=J}let me=new gn;a.position&&(me.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:O}));let ye=0,se=0,pe=0,xe=0,we=R/2,Ee,Be=re.fromCartesian3(t),ke=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<R;f++){Ee=L[f]?ke:Be;let Pe=m.fromArray(O,f*3,Rje),ft=Ee.geodeticSurfaceNormal(Pe,Mje);if(N[f]&&m.negate(ft,ft),a.st){let _t=H.negate(ft,Nje);k[ye++]=Math.atan2(_t.y,_t.x)/P.TWO_PI+.5,k[ye++]=Math.asin(ft.z)/Math.PI+.5}if(a.normal&&(I[se++]=ft.x,I[se++]=ft.y,I[se++]=ft.z),a.tangent||a.bitangent){let _t=Bje,rt=0,dn;if(L[f]&&(rt=we),!S&&f>=rt&&f<rt+x*2?dn=m.UNIT_X:dn=m.UNIT_Z,m.cross(dn,ft,_t),m.normalize(_t,_t),a.tangent&&(M[pe++]=_t.x,M[pe++]=_t.y,M[pe++]=_t.z),a.bitangent){let In=m.cross(ft,_t,Lje);m.normalize(In,In),F[xe++]=In.x,F[xe++]=In.y,F[xe++]=In.z}}}a.st&&(me.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:k})),a.normal&&(me.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(me.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let Pe=O.length,ft=e._offsetAttribute===an.NONE?0:1,_t=new Uint8Array(Pe/3).fill(ft);me.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:_t})}return new dt({attributes:me,indices:v,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromEllipsoid(Be),offsetAttribute:e._offsetAttribute})};var cW;Mp.getUnitEllipsoid=function(){return l(cW)||(cW=Mp.createGeometry(new Mp({radii:new m(1,1,1),vertexFormat:Oe.POSITION_ONLY}))),cW};var Xs=Mp;var Uje=new Vt(z.WHITE),lW=m.ZERO,uW=new m,Vje=new m,kje=new m,fW=new z,zje=new m(1,1,1);function Hje(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function $l(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new Hje(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&($l.prototype=Object.create(li.prototype),$l.prototype.constructor=$l);Object.defineProperties($l.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});$l.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new An(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=zn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,fW)),l(f)||(f=z.WHITE),o=zt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,lW,uW))),new Tt({id:i,geometry:new Xs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:u})};$l.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,fW),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new An(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(o),distanceDisplayCondition:zn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,lW,uW))),new Tt({id:i,geometry:new Zu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};$l.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};$l.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||li.prototype._isHidden.call(this,e,t)};$l.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.radii.isConstant||!j.isConstant(t.innerRadii)||!j.isConstant(t.stackPartitions)||!j.isConstant(t.slicePartitions)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.minimumClock)||!j.isConstant(t.maximumClock)||!j.isConstant(t.minimumCone)||!j.isConstant(t.maximumCone)||!j.isConstant(t.subdivisions)};$l.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=j.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=j.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=j.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=j.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=j.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=j.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=j.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=j.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};$l.prototype._onEntityPropertyChanged=I_;$l.DynamicGeometryUpdater=ww;function ww(e,t,n){ci.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new B,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}l(Object.create)&&(ww.prototype=Object.create(ci.prototype),ww.prototype.constructor=ww);ww.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!j.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=j.getValueOrUndefined(n.radii,e,Vje),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=j.getValueOrDefault(n.fill,e,!0),s=j.getValueOrDefault(n.outline,e,!1),a=j.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,fW),c=to.getValue(e,y(n.material,Uje),this._material),u=j.getValueOrUndefined(n.innerRadii,e,kje),f=j.getValueOrUndefined(n.minimumClock,e),d=j.getValueOrUndefined(n.maximumClock,e),p=j.getValueOrUndefined(n.minimumCone,e),g=j.getValueOrUndefined(n.maximumCone,e),h=j.getValueOrUndefined(n.stackPartitions,e),A=j.getValueOrUndefined(n.slicePartitions,e),x=j.getValueOrUndefined(n.subdivisions,e),C=j.getValueOrDefault(n.outlineWidth,e,1),T=j.getValueOrDefault(n.heightReference,e,qe.NONE),E=T!==qe.NONE?an.ALL:void 0,S=this._scene.mode,w=S===ne.SCENE3D&&T===qe.NONE,D=this._options,R=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=j.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,lW,uW);if(!w||this._lastSceneMode!==S||!l(this._primitive)||D.stackPartitions!==h||D.slicePartitions!==A||l(u)&&!m.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==d||D.minimumCone!==p||D.maximumCone!==g||D.subdivisions!==x||this._lastOutlineWidth!==C||D.offsetAttribute!==E){let b=this._primitives;if(b.removeAndDestroy(this._primitive),b.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=C,D.stackPartitions=h,D.slicePartitions=A,D.subdivisions=x,D.offsetAttribute=E,D.radii=m.clone(w?zje:i,D.radii),l(u))if(w){let F=m.magnitude(i);D.innerRadii=m.fromElements(u.x/F,u.y/F,u.z/F,D.innerRadii)}else D.innerRadii=m.clone(u,D.innerRadii);else D.innerRadii=void 0;D.minimumClock=f,D.maximumClock=d,D.minimumCone=p,D.maximumCone=g;let v=new sr({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=v.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,w,this._modelMatrix);this._primitive=b.add(new wn({geometryInstances:I,appearance:v,asynchronous:!1,shadows:R}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,w,this._modelMatrix);this._outlinePrimitive=b.add(new wn({geometryInstances:M,appearance:new cn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:R})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=m.clone(N,this._lastOffset)}else if(this._primitive.ready){let b=this._primitive,v=this._outlinePrimitive;b.show=!0,v.show=!0,b.appearance.material=c;let I=this._attributes;l(I)||(I=b.getGeometryInstanceAttributes(t),this._attributes=I),o!==this._lastShow&&(I.show=An.toValue(o,I.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=v.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=An.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=zt.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),Dt.equals(L,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=zn.toValue(L,I.distanceDisplayCondition),M.distanceDisplayCondition=zn.toValue(L,M.distanceDisplayCondition),Dt.clone(L,this._lastDistanceDisplayCondition)),m.equals(N,this._lastOffset)||(I.offset=Xi.toValue(N,I.offset),M.offset=Xi.toValue(N,I.offset),m.clone(N,this._lastOffset))}w&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=B.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var x2=$l;function tE(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Oe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}tE.packedLength=Oe.packedLength;tE.pack=function(e,t,n){return n=y(n,0),Oe.pack(e._vertexFormat,t,n),t};var Bce=new Oe,Gje={vertexFormat:Bce};tE.unpack=function(e,t,n){t=y(t,0);let i=Oe.unpack(e,t,Bce);return l(n)?(n._vertexFormat=Oe.clone(i,n._vertexFormat),n):new tE(Gje)};var C2=new m(-.5,-.5,0),T2=new m(.5,.5,0);tE.createGeometry=function(e){let t=e._vertexFormat,n=new gn,i,r;if(t.position){if(r=new Float64Array(4*3),r[0]=C2.x,r[1]=C2.y,r[2]=0,r[3]=T2.x,r[4]=C2.y,r[5]=0,r[6]=T2.x,r[7]=T2.y,r[8]=0,r[9]=C2.x,r[10]=T2.y,r[11]=0,n.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new dt({attributes:n,indices:i,primitiveType:Le.TRIANGLES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var E2=tE;function nE(){this._workerName="createPlaneOutlineGeometry"}nE.packedLength=0;nE.pack=function(e,t){return t};nE.unpack=function(e,t,n){return l(n)?n:new nE};var Ng=new m(-.5,-.5,0),b2=new m(.5,.5,0);nE.createGeometry=function(){let e=new gn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=Ng.x,n[1]=Ng.y,n[2]=Ng.z,n[3]=b2.x,n[4]=Ng.y,n[5]=Ng.z,n[6]=b2.x,n[7]=b2.y,n[8]=Ng.z,n[9]=Ng.x,n[10]=b2.y,n[11]=Ng.z,e.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new dt({attributes:e,indices:t,primitiveType:Le.LINES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var S2=nE;var Wje=new m,Lce=new z;function jje(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function cf(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new jje(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(cf.prototype=Object.create(li.prototype),cf.prototype.constructor=cf);cf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Lce)),l(g)||(g=z.WHITE),r=zt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=j.getValueOrDefault(c.plane,e,u.plane),p=j.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=dW(d,p,f,f),new Tt({id:t,geometry:new E2(this._options),modelMatrix:f,attributes:i})};cf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Lce),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=j.getValueOrDefault(o.plane,e,s.plane),u=j.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=dW(c,u,a,a),new Tt({id:t,geometry:new S2,modelMatrix:a,attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r)}})};cf.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||li.prototype._isHidden.call(this,e,t)};cf.prototype._getIsClosed=function(e){return!1};cf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};cf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};cf.DynamicGeometryUpdater=iE;function iE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(iE.prototype=Object.create(ci.prototype),iE.prototype.constructor=iE);iE.prototype._isHidden=function(e,t,n){let i=this._options,r=j.getValueOrUndefined(e.position,n,Wje);return!l(r)||!l(i.plane)||!l(i.dimensions)||ci.prototype._isHidden.call(this,e,t,n)};iE.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=j.getValueOrDefault(t.plane,n,i.plane),i.dimensions=j.getValueOrUndefined(t.dimensions,n,i.dimensions)};var Yje=new m,qje=new m,Xje=new m,Kje=new m,Jje=new Z,Zje=new Z,Qje=new B;function dW(e,t,n,i){let r=e.normal,o=e.distance,s=m.multiplyByScalar(r,-o,Xje),a=m.clone(m.UNIT_Z,qje);P.equalsEpsilon(Math.abs(m.dot(a,r)),1,P.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,r,Yje);a=m.cross(r,c,a),m.normalize(c,c),m.normalize(a,a);let u=Jje;Z.setColumn(u,0,c,u),Z.setColumn(u,1,a,u),Z.setColumn(u,2,r,u);let f=m.fromElements(t.x,t.y,1,Kje),d=Z.multiplyByScale(u,f,Zje),p=B.fromRotationTranslation(d,s,Qje);return B.multiplyTransformation(n,p,i)}cf.createPrimitiveMatrix=dW;var v2=cf;var $je=new m,eYe=new Ke,tYe=new H,nYe=new H,iYe=new m,rYe=new m,oYe=new m,Dw=new m,sYe=new m,aYe=new m,Nce=new Ne,cYe=new Z,lYe=new Z,uYe=new m;function fYe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=ui.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ue.createTypedArray(u.length,f.length);d.set(f);let p=cYe;if(i!==0){let _=Ne.fromAxisAngle(s,i,Nce);if(p=Z.fromQuaternion(_,p),t.tangent||t.bitangent){_=Ne.fromAxisAngle(s,-i,Nce);let b=Z.fromQuaternion(_,lYe);a=m.normalize(Z.multiplyByVector(b,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=Z.clone(Z.IDENTITY,p);let g=nYe;t.st&&(g.x=n.x,g.y=n.y);let h=u.length,A=h*3,x=new Float64Array(A),C=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,S=t.st?new Float32Array(h*2):void 0,w=0,D=0,R=0,O=0,L=0;for(let _=0;_<h;_++){let b=u[_];if(x[w++]=b.x,x[w++]=b.y,x[w++]=b.z,t.st)if(l(r)&&r.positions.length===h)S[L++]=r.positions[_].x,S[L++]=r.positions[_].y;else{let v=Z.multiplyByVector(p,b,$je),I=o(v,tYe);H.subtract(I,g,I);let M=P.clamp(I.x/n.width,0,1),F=P.clamp(I.y/n.height,0,1);S[L++]=M,S[L++]=F}t.normal&&(C[D++]=s.x,C[D++]=s.y,C[D++]=s.z),t.tangent&&(T[O++]=a.x,T[O++]=a.y,T[O++]=a.z),t.bitangent&&(E[R++]=c.x,E[R++]=c.y,E[R++]=c.z)}let N=new gn;return t.position&&(N.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(N.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(N.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(N.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),t.st&&(N.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new dt({attributes:N,indices:d,primitiveType:Le.TRIANGLES})}function dA(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Oe.DEFAULT);this._vertexFormat=Oe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+Oe.packedLength+re.packedLength+(l(n)?Xn.computeHierarchyPackedLength(n,H):1)+2}dA.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new dA(t)};dA.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var dYe=re.clone(re.UNIT_SPHERE),mYe=new Oe,hYe={polygonHierarchy:{}};dA.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,dYe);t+=re.packedLength;let o=Oe.unpack(e,t,mYe);t+=Oe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new dA(hYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};dA.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Cr(s,m.equalsEpsilon,!0),s.length<3)return;let a=iYe,c=rYe,u=oYe,f=sYe,d=aYe;if(!dg.computeProjectTo2DArguments(s,Dw,f,d))return;if(a=m.cross(f,d,a),a=m.normalize(a,a),!m.equalsEpsilon(Dw,m.ZERO,P.EPSILON6)){let L=e._ellipsoid.geodeticSurfaceNormal(Dw,uYe);m.dot(a,L)<0&&(a=m.negate(a,a),f=m.negate(f,f))}let g=dg.createProjectPointsTo2DFunction(Dw,f,d),h=dg.createProjectPointTo2DFunction(Dw,f,d);t.tangent&&(c=m.clone(f,c)),t.bitangent&&(u=m.clone(d,u));let A=Xn.polygonsFromHierarchy(n,o,g,!1),x=A.hierarchy,C=A.polygons,T=function(L){return L},E=o?Xn.polygonsFromHierarchy(r,!0,T,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let S=ae.fromPoints(s),w=Xn.computeBoundingRectangle(a,h,s,i,eYe),D=[];for(let L=0;L<C.length;L++){let N=new Tt({geometry:fYe(C[L],t,w,i,o?E[L]:void 0,h,a,c,u)});D.push(N)}let R=Vn.combineInstances(D)[0];R.attributes.position.values=new Float64Array(R.attributes.position.values),R.indices=Ue.createTypedArray(R.attributes.position.values.length/3,R.indices);let O=R.attributes;return t.position||delete O.position,new dt({attributes:O,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:S})};var w2=dA;var pYe=new he,Fce=new he;function _Ye(e,t,n,i){let o=i.cartesianToCartographic(e,pYe).height,s=i.cartesianToCartographic(t,Fce);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Fce);a.height=o-100,i.cartographicToCartesian(a,n)}var gYe=new Ke,yYe=new m,AYe=new m,xYe=new m,CYe=new m,TYe=new m,EYe=new m,D2=new m,Gm=new m,rE=new m,bYe=new H,SYe=new H,vYe=new m,Uce=new Ne,wYe=new Z,DYe=new Z;function mW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.tangentPlane,p=e.ellipsoid,g=e.stRotation,h=e.perPositionHeight,A=bYe;A.x=f.x,A.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(h&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,D=0,R=AYe,O=xYe,L=CYe,N=!0,_=wYe,b=DYe;if(g!==0){let M=Ne.fromAxisAngle(d._plane.normal,g,Uce);_=Z.fromQuaternion(M,_),M=Ne.fromAxisAngle(d._plane.normal,-g,Uce),b=Z.fromQuaternion(M,b)}else _=Z.clone(Z.IDENTITY,_),b=Z.clone(Z.IDENTITY,b);let v=0,I=0;c&&u&&(v=s/2,I=s/3,s/=2);for(let M=0;M<s;M+=3){let F=m.fromArray(r,M,vYe);if(t.st&&!l(o)){let k=Z.multiplyByVector(_,F,yYe);k=p.scaleToGeodeticSurface(k,k);let V=d.projectPointOntoPlane(k,SYe);H.subtract(V,A,V);let G=P.clamp(V.x/f.width,0,1),U=P.clamp(V.y/f.height,0,1);u&&(x[w+I]=G,x[w+1+I]=U),c&&(x[w]=G,x[w+1]=U),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=D+1,V=D+2;if(a){if(M+3<s){let G=m.fromArray(r,M+3,TYe);if(N){let U=m.fromArray(r,M+s,EYe);h&&_Ye(F,G,U,p),m.subtract(G,F,G),m.subtract(U,F,U),R=m.normalize(m.cross(U,G,R),R),N=!1}m.equalsEpsilon(G,F,P.EPSILON10)&&(N=!0)}(t.tangent||t.bitangent)&&(L=p.geodeticSurfaceNormal(F,L),t.tangent&&(O=m.normalize(m.cross(L,R,O),O)))}else R=p.geodeticSurfaceNormal(F,R),(t.tangent||t.bitangent)&&(h&&(D2=m.fromArray(C,D,D2),Gm=m.cross(m.UNIT_Z,D2,Gm),Gm=m.normalize(Z.multiplyByVector(b,Gm,Gm),Gm),t.bitangent&&(rE=m.normalize(m.cross(D2,Gm,rE),rE))),O=m.cross(m.UNIT_Z,R,O),O=m.normalize(Z.multiplyByVector(b,O,O),O),t.bitangent&&(L=m.normalize(m.cross(R,O,L),L)));t.normal&&(e.wall?(C[D+v]=R.x,C[k+v]=R.y,C[V+v]=R.z):u&&(C[D+v]=-R.x,C[k+v]=-R.y,C[V+v]=-R.z),(c&&!h||a)&&(C[D]=R.x,C[k]=R.y,C[V]=R.z)),i&&(a&&(R=p.geodeticSurfaceNormal(F,R)),S[D+v]=-R.x,S[k+v]=-R.y,S[V+v]=-R.z),t.tangent&&(e.wall?(T[D+v]=O.x,T[k+v]=O.y,T[V+v]=O.z):u&&(T[D+v]=-O.x,T[k+v]=-O.y,T[V+v]=-O.z),c&&(h?(T[D]=Gm.x,T[k]=Gm.y,T[V]=Gm.z):(T[D]=O.x,T[k]=O.y,T[V]=O.z))),t.bitangent&&(u&&(E[D+v]=L.x,E[k+v]=L.y,E[V+v]=L.z),c&&(h?(E[D]=rE.x,E[k]=rE.y,E[V]=rE.z):(E[D]=L.x,E[k]=L.y,E[V]=L.z))),D+=3}}t.st&&!l(o)&&(n.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===an.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===an.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var IYe=new he,PYe=new he,Fg={westOverIDL:0,eastOverIDL:0},oE=new Wf;function zce(e,t,n,i,r){if(r=y(r,new ce),!l(e)||e.length<3)return r.west=0,r.north=0,r.south=0,r.east=0,r;if(n===$t.RHUMB)return ce.fromCartesianArray(e,t,r);oE.ellipsoid.equals(t)||(oE=new Wf(void 0,void 0,t)),r.west=Number.POSITIVE_INFINITY,r.east=Number.NEGATIVE_INFINITY,r.south=Number.POSITIVE_INFINITY,r.north=Number.NEGATIVE_INFINITY,Fg.westOverIDL=Number.POSITIVE_INFINITY,Fg.eastOverIDL=Number.NEGATIVE_INFINITY;let o=1/P.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],PYe),c=IYe,u;for(let f=1;f<s;f++)u=c,c=a,a=t.cartesianToCartographic(e[f],u),oE.setEndPoints(c,a),Vce(oE,o,r,Fg);return u=c,c=a,a=t.cartesianToCartographic(e[0],u),oE.setEndPoints(c,a),Vce(oE,o,r,Fg),r.east-r.west>Fg.eastOverIDL-Fg.westOverIDL&&(r.west=Fg.westOverIDL,r.east=Fg.eastOverIDL,r.east>P.PI&&(r.east=r.east-P.TWO_PI),r.west>P.PI&&(r.west=r.west-P.TWO_PI)),r}var OYe=new he;function Vce(e,t,n,i){let r=e.surfaceDistance,o=Math.ceil(r*t),s=o>0?r/(o-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<o;c++){let u=e.interpolateUsingSurfaceDistance(a,OYe);a+=s;let f=u.longitude,d=u.latitude;n.west=Math.min(n.west,f),n.east=Math.max(n.east,f),n.south=Math.min(n.south,d),n.north=Math.max(n.north,d);let p=f>=0?f:f+P.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var kce=[];function RYe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let T=Xn.createGeometryFromPositions(e,t,n,i,o,c,u),E=T.attributes.position.values,S=T.indices,w,D;if(s&&a){let R=E.concat(E);w=R.length/3,D=Ue.createTypedArray(w,S.length*2),D.set(S);let O=S.length,L=w/2;for(d=0;d<O;d+=3){let N=D[d]+L,_=D[d+1]+L,b=D[d+2]+L;D[d+O]=b,D[d+1+O]=_,D[d+2+O]=N}if(T.attributes.position.values=R,o&&c.normal){let N=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(R.length),T.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=T.attributes.st.values;T.attributes.st.values=new Float32Array(w*2),T.attributes.st.values=N.concat(N)}T.indices=D}else if(a){for(w=E.length/3,D=Ue.createTypedArray(w,S.length),d=0;d<S.length;d+=3)D[d]=S[d+2],D[d+1]=S[d+1],D[d+2]=S[d];T.indices=D}f.topAndBottom=new Tt({geometry:T})}let p=r.outerRing,g=Ma.fromPoints(p,e),h=g.projectPointsOntoPlane(p,kce),A=ui.computeWindingOrder2D(h);A===ts.CLOCKWISE&&(p=p.slice().reverse());let x=Xn.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Tt({geometry:x}));let C=r.holes;for(d=0;d<C.length;d++){let T=C[d];g=Ma.fromPoints(T,e),h=g.projectPointsOntoPlane(T,kce),A=ui.computeWindingOrder2D(h),A===ts.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),x=Xn.computeWallGeometry(T,n,e,i,o,u),f.walls.push(new Tt({geometry:x}))}return f}function gd(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Oe.DEFAULT),i=y(e.ellipsoid,re.WGS84),r=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Oe.clone(n),this._ellipsoid=re.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,$t.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+re.packedLength+Oe.packedLength+(s?Xn.computeHierarchyPackedLength(s,H):1)+12}gd.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new gd(t)};gd.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var MYe=re.clone(re.UNIT_SPHERE),BYe=new Oe,LYe={polygonHierarchy:{}};gd.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,MYe);t+=re.packedLength;let o=Oe.unpack(e,t,BYe);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,h=e[t++]===1,A=e[t++],x=e[t++],C=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let T=e[t++];return l(n)||(n=new gd(LYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=h,n._offsetAttribute=A===-1?void 0:A,n._arcType=x,n._textureCoordinates=C,n.packedLength=T,n};gd.computeRectangle=function(e,t){let n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.arcType,$t.GEODESIC),r=e.polygonHierarchy,o=y(e.ellipsoid,re.WGS84);return zce(r.positions,o,i,n,t)};gd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=Ma.fromPoints(p,n),h=Xn.polygonsFromHierarchy(o,d,g.projectPointsOntoPlane.bind(g),!s,n),A=h.hierarchy,x=h.polygons,C=function(v){return v},T=d?Xn.polygonsFromHierarchy(f,!0,C,!1).polygons:void 0;if(A.length===0)return;p=A[0].outerRing;let E=Xn.computeBoundingRectangle(g.plane.normal,g.projectPointOntoPlane.bind(g),p,r,gYe),S=[],w=e._height,D=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(w,D,0,P.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,tangentPlane:g,boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<x.length;L++){let v=RYe(n,x[L],d?T[L]:void 0,i,A[L],s,a,c,t,u),I;a&&c?(I=v.topAndBottom,O.geometry=Xn.scaleToGeodeticHeightExtruded(I.geometry,w,D,n,s)):a?(I=v.topAndBottom,I.geometry.attributes.position.values=ui.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!s),O.geometry=I.geometry):c&&(I=v.topAndBottom,I.geometry.attributes.position.values=ui.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!0),O.geometry=I.geometry),(a||c)&&(O.wall=!1,I.geometry=mW(O),S.push(I));let M=v.walls;O.wall=!0;for(let F=0;F<M.length;F++){let k=M[F];O.geometry=Xn.scaleToGeodeticHeightExtruded(k.geometry,w,D,n,s),k.geometry=mW(O),S.push(k)}}else for(L=0;L<x.length;L++){let v=new Tt({geometry:Xn.createGeometryFromPositions(n,x[L],d?T[L]:void 0,i,s,t,u)});if(v.geometry.attributes.position.values=ui.scaleToGeodeticHeight(v.geometry.attributes.position.values,w,n,!s),O.geometry=v.geometry,v.geometry=mW(O),l(e._offsetAttribute)){let I=v.geometry.attributes.position.values.length,M=e._offsetAttribute===an.NONE?0:1,F=new Uint8Array(I/3).fill(M);v.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}S.push(v)}let N=Vn.combineInstances(S)[0];N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=Ue.createTypedArray(N.attributes.position.values.length/3,N.indices);let _=N.attributes,b=ae.fromVertices(_.position.values);return t.position||delete _.position,new dt({attributes:_,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};gd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new gd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function NYe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return dt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(gd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=zce(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=NYe(this)),this._textureCoordinateRotationPoints}}});var sE=gd;var Hce=[],I2=[];function FYe(e,t,n,i,r){let s=Ma.fromPoints(t,e).projectPointsOntoPlane(t,Hce);ui.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let h=t[u],A=t[(u+1)%f];c[d++]=h.x,c[d++]=h.y,c[d++]=h.z,c[d++]=A.x,c[d++]=A.y,c[d++]=A.z}else{let h=0;if(r===$t.GEODESIC)for(u=0;u<f;u++)h+=Xn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===$t.RHUMB)for(u=0;u<f;u++)h+=Xn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(h*3),u=0;u<f;u++){let A;r===$t.GEODESIC?A=Xn.subdivideLine(t[u],t[(u+1)%f],n,I2):r===$t.RHUMB&&(A=Xn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,I2));let x=A.length;for(let C=0;C<x;++C)c[d++]=A[C]}}f=c.length/3;let p=f*2,g=Ue.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new Tt({geometry:new dt({attributes:new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Le.LINES})})}function UYe(e,t,n,i,r){let s=Ma.fromPoints(t,e).projectPointsOntoPlane(t,Hce);ui.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let x=t[u],C=t[(u+1)%f];c[p++]=x.x,c[p++]=x.y,c[p++]=x.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let x=0;if(r===$t.GEODESIC)for(u=0;u<f;u++)x+=Xn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===$t.RHUMB)for(u=0;u<f;u++)x+=Xn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(x*3*2),u=0;u<f;++u){d[u]=p/3;let C;r===$t.GEODESIC?C=Xn.subdivideLine(t[u],t[(u+1)%f],n,I2):r===$t.RHUMB&&(C=Xn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,I2));let T=C.length;for(let E=0;E<T;++E)c[p++]=C[E]}}f=c.length/(3*2);let g=d.length,h=(f*2+g)*2,A=Ue.createTypedArray(f+g,h);for(p=0,u=0;u<f;++u)A[p++]=u,A[p++]=(u+1)%f,A[p++]=u+f,A[p++]=(u+1)%f+f;for(u=0;u<g;u++){let x=d[u];A[p++]=x,A[p++]=x+f}return new Tt({geometry:new dt({attributes:new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:A,primitiveType:Le.LINES})})}function mA(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,re.WGS84),i=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.perPositionHeight,!1),o=r&&l(e.extrudedHeight),s=y(e.arcType,$t.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+re.packedLength+8}mA.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var VYe=re.clone(re.UNIT_SPHERE),kYe={polygonHierarchy:{}};mA.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let r=re.unpack(e,t,VYe);t+=re.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new mA(kYe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};mA.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new mA(t)};mA.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Xn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,h;if(p)for(h=0;h<s.length;h++){if(a=UYe(t,s[h],u,r,o),a.geometry=Xn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,T=new Uint8Array(C);e._offsetAttribute===an.TOP?T=T.fill(1,0,C/2):(g=e._offsetAttribute===an.NONE?0:1,T=T.fill(g)),a.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(h=0;h<s.length;h++){if(a=FYe(t,s[h],u,r,o),a.geometry.attributes.position.values=ui.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===an.NONE?0:1;let T=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let A=Vn.combineInstances(c)[0],x=ae.fromVertices(A.attributes.position.values);return new dt({attributes:A.attributes,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var P2=mA;var Gce="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Wce="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",jce=new z,Yce=m.ZERO,qce=new m,Xce=new ce,zYe=[],HYe=new H;function GYe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function eu(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new GYe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(eu.prototype=Object.create(Kn.prototype),eu.prototype.constructor=eu);eu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,jce)),l(s)||(s=z.WHITE),r.color=zt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Yce,qce)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new w2(i):o=new sE(i),new Tt({id:t,geometry:o,attributes:r})};eu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,jce),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(r),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Yce,qce)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new cd(i):a=new P2(i),new Tt({id:t,geometry:a,attributes:s})};eu.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.mapProjection.ellipsoid,o=Ma.fromPoints(i,r),s=o.projectPointsOntoPlane(i,zYe),a=s.length,c=0,u=a-1,f=new H;for(let p=0;p<a;u=p++){let g=s[p],h=s[u],A=g.x*h.y-h.x*g.y,x=H.add(g,h,HYe);x=H.multiplyByScalar(x,A,x),f=H.add(f,x,f),c+=A}let d=1/(c*3);return f=H.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};eu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||li.prototype._isHidden.call(this,e,t)};eu.prototype._isOnTerrain=function(e,t){let n=Kn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!r};eu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.textureCoordinates)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.perPositionHeight)||!j.isConstant(t.closeTop)||!j.isConstant(t.closeBottom)||!j.isConstant(t.zIndex)||!j.isConstant(t.arcType)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};eu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(Ge.MINIMUM_VALUE),o=j.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),a=j.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),c=j.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE),u=j.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);o=Kn.getGeometryHeight(o,s);let f;u?(l(o)&&(o=void 0,Rt(Gce)),s!==qe.NONE&&u&&(o=void 0,Rt(Wce))):(l(a)&&!l(o)&&(o=0),f=Kn.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=j.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=j.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=j.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=j.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,$t.GEODESIC),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=Kn.getGeometryExtrudedHeight(a,c),a===Kn.CLAMP_TO_GROUND&&(a=ai.getMinimumMaximumHeights(sE.computeRectangle(i,Xce)).minimumTerrainHeight),i.extrudedHeight=a};eu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};eu.DynamicGeometryUpdater=aE;function aE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(aE.prototype=Object.create(ci.prototype),aE.prototype.constructor=aE);aE.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ci.prototype._isHidden.call(this,e,t,n)};aE.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=j.getValueOrUndefined(t.hierarchy,n);let r=j.getValueOrUndefined(t.height,n),o=j.getValueOrDefault(t.heightReference,n,qe.NONE),s=j.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE),a=j.getValueOrUndefined(t.extrudedHeight,n),c=j.getValueOrUndefined(t.perPositionHeight,n);r=Kn.getGeometryHeight(r,s);let u;c?(l(r)&&(r=void 0,Rt(Gce)),o!==qe.NONE&&c&&(r=void 0,Rt(Wce))):(l(a)&&!l(r)&&(r=0),u=Kn.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=j.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=j.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=j.getValueOrDefault(t.arcType,n,$t.GEODESIC),a=Kn.getGeometryExtrudedHeight(a,s),a===Kn.CLAMP_TO_GROUND&&(a=ai.getMinimumMaximumHeights(sE.computeRectangle(i,Xce)).minimumTerrainHeight),i.extrudedHeight=a};var O2=eu;function WYe(e,t,n,i){let r=new gn;i.position&&(r.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=ui.triangulate(t),u=(a-1)*o*6+c.length*2,f=Ue.createTypedArray(s,u),d,p,g,h,A,x,C=o*2,T=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,x=g+C,h=g+1,A=h+C,f[T++]=h,f[T++]=g,f[T++]=A,f[T++]=A,f[T++]=g,f[T++]=x;g=o*2-2+d*o*2,h=g+1,A=h+C,x=g+C,f[T++]=h,f[T++]=g,f[T++]=A,f[T++]=A,f[T++]=g,f[T++]=x}if(i.st||i.tangent||i.bitangent){let w=new Float32Array(s*2),D=1/(a-1),R=1/n.height,O=n.height/2,L,N,_=0;for(d=0;d<a;d++){for(L=d*D,N=R*(t[0].y+O),w[_++]=L,w[_++]=N,p=1;p<o;p++)N=R*(t[p].y+O),w[_++]=L,w[_++]=N,w[_++]=L,w[_++]=N;N=R*(t[0].y+O),w[_++]=L,w[_++]=N}for(p=0;p<o;p++)L=0,N=R*(t[p].y+O),w[_++]=L,w[_++]=N;for(p=0;p<o;p++)L=(a-1)*D,N=R*(t[p].y+O),w[_++]=L,w[_++]=N;r.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(w)})}let E=s-o*2;for(d=0;d<c.length;d+=3){let w=c[d]+E,D=c[d+1]+E,R=c[d+2]+E;f[T++]=w,f[T++]=D,f[T++]=R,f[T++]=R+o,f[T++]=D+o,f[T++]=w+o}let S=new dt({attributes:r,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Le.TRIANGLES});if(i.normal&&(S=Vn.computeNormal(S)),i.tangent||i.bitangent){try{S=Vn.computeTangentAndBitangent(S)}catch{Rt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function Pw(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+Oe.packedLength+2}Pw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Kce=re.clone(re.UNIT_SPHERE),Jce=new Oe,Iw={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Kce,vertexFormat:Jce,cornerType:void 0,granularity:void 0};Pw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,Kce);t+=re.packedLength;let c=Oe.unpack(e,t,Jce);t+=Oe.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Oe.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(Iw.polylinePositions=o,Iw.shapePositions=s,Iw.cornerType=u,Iw.granularity=f,new Pw(Iw))};var jYe=new Ke;Pw.createGeometry=function(e){let t=e._positions,n=Cr(t,m.equalsEpsilon),i=e._shape;if(i=Lm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let r=Ke.fromPoints(i,jYe),o=Lm.computePositions(n,i,r,e,!0);return WYe(o,i,r,e._vertexFormat)};var R2=Pw;function YYe(e,t){let n=new gn;n.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=Ue.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,h=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+h}return new dt({attributes:n,indices:Ue.createTypedArray(r,a),boundingSphere:ae.fromVertices(e),primitiveType:Le.LINES})}function Rw(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+re.packedLength+2}Rw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=H.packedLength)H.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Zce=re.clone(re.UNIT_SPHERE),Ow={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Zce,height:void 0,cornerType:void 0,granularity:void 0};Rw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=re.unpack(e,t,Zce);t+=re.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(Ow.polylinePositions=o,Ow.shapePositions=s,Ow.cornerType=c,Ow.granularity=u,new Rw(Ow))};var qYe=new Ke;Rw.createGeometry=function(e){let t=e._positions,n=Cr(t,m.equalsEpsilon),i=e._shape;if(i=Lm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let r=Ke.fromPoints(i,qYe),o=Lm.computePositions(n,i,r,e,!1);return YYe(o,i)};var M2=Rw;var Qce=new z;function XYe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Wm(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new XYe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Wm.prototype=Object.create(li.prototype),Wm.prototype.constructor=Wm);Wm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Qce)),l(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Tt({id:t,geometry:new R2(this._options),attributes:i})};Wm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Qce),r=this._distanceDisplayConditionProperty.getValue(e);return new Tt({id:t,geometry:new M2(this._options),attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r)}})};Wm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||li.prototype._isHidden.call(this,e,t)};Wm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!j.isConstant(t.granularity)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)};Wm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Vt;r.vertexFormat=o?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};Wm.DynamicGeometryUpdater=cE;function cE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(cE.prototype=Object.create(ci.prototype),cE.prototype.constructor=cE);cE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ci.prototype._isHidden.call(this,e,t,n)};cE.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=j.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=j.getValueOrUndefined(t.shape,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n)};var B2=Wm;var hW=new m,tle=new m,nle=new m,ile=new m,rle=new ce,KYe=new H,JYe=new ae,ZYe=new ae;function ole(e,t){let n=new dt({attributes:new gn,primitiveType:Le.TRIANGLES});return n.attributes.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function QYe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=ile,f=nle,d=tle;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=m.fromArray(e,p,hW),h=c+1,A=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,d,f),Z.multiplyByVector(i,f,f),m.normalize(f,f),t.bitangent&&m.normalize(m.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[h]=d.y,o[A]=d.z),t.tangent&&(s[c]=f.x,s[h]=f.y,s[A]=f.z),t.bitangent&&(a[c]=u.x,a[h]=u.y,a[A]=u.z),c+=3}return ole(t,{positions:e,normals:o,tangents:s,bitangents:a})}var pW=new m,sle=new m;function $Ye(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=ile,p=nle,g=tle;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let A=m.fromArray(e,h,hW),x=m.fromArray(e,(h+6)%i,pW);if(f){let C=m.fromArray(e,(h+3)%i,sle);m.subtract(x,A,x),m.subtract(C,A,C),g=m.normalize(m.cross(C,x,g),g),f=!1}m.equalsEpsilon(x,A,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(A,d),t.tangent&&(p=m.normalize(m.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return ole(t,{positions:e,normals:r,tangents:o,bitangents:s})}function ale(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,h=0,A=0,x=hW,C=KYe,T=Number.MAX_VALUE,E=Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let b=c;b<u;++b)for(let v=0;v<o;++v)bs.computePosition(t,i,n.st,b,v,x,C),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(g[A++]=C.x,g[A++]=C.y,T=Math.min(T,C.x),E=Math.min(E,C.y),S=Math.max(S,C.x),w=Math.max(w,C.y));if(s&&(bs.computePosition(t,i,n.st,0,0,x,C),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(g[A++]=C.x,g[A++]=C.y,T=C.x,E=C.y,S=C.x,w=C.y)),a&&(bs.computePosition(t,i,n.st,r-1,0,x,C),p[h++]=x.x,p[h++]=x.y,p[h]=x.z,n.st&&(g[A++]=C.x,g[A]=C.y,T=Math.min(T,C.x),E=Math.min(E,C.y),S=Math.max(S,C.x),w=Math.max(w,C.y))),n.st&&(T<0||E<0||S>1||w>1))for(let b=0;b<g.length;b+=2)g[b]=(g[b]-T)/(S-T),g[b+1]=(g[b+1]-E)/(w-E);let D=QYe(p,n,i,t.tangentRotationMatrix),R=6*(o-1)*(f-1);s&&(R+=3*(o-1)),a&&(R+=3*(o-1));let O=Ue.createTypedArray(d,R),L=0,N=0,_;for(_=0;_<f-1;++_){for(let b=0;b<o-1;++b){let v=L,I=v+o,M=I+1,F=v+1;O[N++]=v,O[N++]=I,O[N++]=F,O[N++]=F,O[N++]=I,O[N++]=M,++L}++L}if(s||a){let b=d-1,v=d-1;s&&a&&(b=d-2);let I,M;if(L=0,s)for(_=0;_<o-1;_++)I=L,M=I+1,O[N++]=b,O[N++]=I,O[N++]=M,++L;if(a)for(L=(f-1)*o,_=0;_<o-1;_++)I=L,M=I+1,O[N++]=I,O[N++]=v,O[N++]=M,++L}return D.indices=O,n.st&&(D.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),D}function lE(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function uE(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var _W=new Oe;function eqe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let rt=Oe.clone(r,_W);rt.normal=!0,e._vertexFormat=rt}let d=ale(e,t);n&&(e._vertexFormat=r);let p=ui.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,h=g*2,A=new Float64Array(h);A.set(p);let x=ui.scaleToGeodeticHeight(d.attributes.position.values,o,a);A.set(x,g),d.attributes.position.values=A;let C=r.normal?new Float32Array(h):void 0,T=r.tangent?new Float32Array(h):void 0,E=r.bitangent?new Float32Array(h):void 0,S=r.st?new Float32Array(h/3*2):void 0,w,D;if(r.normal){for(D=d.attributes.normal.values,C.set(D),f=0;f<g;f++)D[f]=-D[f];C.set(D,g),d.attributes.normal.values=C}if(n){D=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let rt=new Float32Array(h);for(f=0;f<g;f++)D[f]=-D[f];rt.set(D,g),d.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:rt})}let R,O=l(i);if(O){let rt=g/3*2,dn=new Uint8Array(rt);i===an.TOP?dn=dn.fill(1,0,rt/2):(R=i===an.NONE?0:1,dn=dn.fill(R)),d.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:dn})}if(r.tangent){let rt=d.attributes.tangent.values;for(T.set(rt),f=0;f<g;f++)rt[f]=-rt[f];T.set(rt,g),d.attributes.tangent.values=T}if(r.bitangent){let rt=d.attributes.bitangent.values;E.set(rt),E.set(rt,g),d.attributes.bitangent.values=E}r.st&&(w=d.attributes.st.values,S.set(w),S.set(w,g/3*2),d.attributes.st.values=S);let L=d.indices,N=L.length,_=g/3,b=Ue.createTypedArray(h/3,N*2);for(b.set(L),f=0;f<N;f+=3)b[f+N]=L[f+2]+_,b[f+1+N]=L[f+1]+_,b[f+2+N]=L[f]+_;d.indices=b;let v=t.northCap,I=t.southCap,M=c,F=2,k=0,V=4,G=4;v&&(F-=1,M-=1,k+=1,V-=2,G-=1),I&&(F-=1,M-=1,k+=1,V-=2,G-=1),k+=F*u+2*M-V;let U=(k+G)*2,q=new Float64Array(U*3),Y=n?new Float32Array(U*3):void 0,Q=O?new Uint8Array(U):void 0,W=r.st?new Float32Array(U*2):void 0,K=i===an.TOP;O&&!K&&(R=i===an.ALL?1:0,Q=Q.fill(R));let J=0,me=0,ye=0,se=0,pe=u*M,xe;for(f=0;f<pe;f+=u)xe=f*3,q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);if(I){let rt=v?pe+1:pe;for(xe=rt*3,f=0;f<2;f++)q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,rt*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1)}else for(f=pe-u;f<pe;f++)xe=f*3,q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);for(f=pe-1;f>0;f-=u)xe=f*3,q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);if(v){let rt=pe;for(xe=rt*3,f=0;f<2;f++)q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,rt*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1)}else for(f=u-1;f>=0;f--)xe=f*3,q=lE(q,J,xe,p,x),J+=6,r.st&&(W=uE(W,me,f*2,w),me+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(Q[se++]=1,se+=1);let we=$Ye(q,r,a);r.st&&(we.attributes.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Y})),O&&(we.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Ee=Ue.createTypedArray(U,k*6),Be,ke,Pe,ft;g=q.length/3;let _t=0;for(f=0;f<g-1;f+=2){Be=f,ft=(Be+2)%g;let rt=m.fromArray(q,Be*3,pW),dn=m.fromArray(q,ft*3,sle);m.equalsEpsilon(rt,dn,P.EPSILON10)||(ke=(Be+1)%g,Pe=(ke+2)%g,Ee[_t++]=Be,Ee[_t++]=ke,Ee[_t++]=ft,Ee[_t++]=ft,Ee[_t++]=ke,Ee[_t++]=Pe)}return we.indices=Ee,we=Vn.combineInstances([new Tt({geometry:d}),new Tt({geometry:we})]),we[0]}var tqe=[new m,new m,new m,new m],cle=new he,nqe=new he;function gW(e,t,n,i,r){if(n===0)return ce.clone(e,r);let o=bs.computeOptions(e,t,n,0,rle,cle),s=o.height,a=o.width,c=tqe;return bs.computePosition(o,i,!1,0,0,c[0]),bs.computePosition(o,i,!1,0,a-1,c[1]),bs.computePosition(o,i,!1,s-1,0,c[2]),bs.computePosition(o,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,r)}function jm(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ce.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}jm.packedLength=ce.packedLength+re.packedLength+Oe.packedLength+7;jm.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var lle=new ce,ule=re.clone(re.UNIT_SPHERE),Ug={rectangle:lle,ellipsoid:ule,vertexFormat:_W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};jm.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,lle);t+=ce.packedLength;let r=re.unpack(e,t,ule);t+=re.packedLength;let o=Oe.unpack(e,t,_W);t+=Oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=Oe.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(Ug.granularity=s,Ug.height=a,Ug.rotation=c,Ug.stRotation=u,Ug.extrudedHeight=f,Ug.shadowVolume=d,Ug.offsetAttribute=p===-1?void 0:p,new jm(Ug))};jm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,re.WGS84),o=y(e.rotation,0);return gW(n,i,o,r,t)};var iqe=new Z,$ce=new Ne,rqe=new he;jm.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=bs.computeOptions(t,e._granularity,i,r,rle,cle,nqe),a=iqe;if(r!==0||i!==0){let g=ce.center(t,rqe),h=n.geodeticSurfaceNormalCartographic(g,pW);Ne.fromAxisAngle(h,-r,$ce),Z.fromQuaternion($ce,a)}else Z.clone(Z.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=eqe(e,s);let g=ae.fromRectangle3D(t,n,c,ZYe),h=ae.fromRectangle3D(t,n,u,JYe);p=ae.union(g,h)}else{if(d=ale(e,s),d.attributes.position.values=ui.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,h=e._offsetAttribute===an.NONE?0:1,A=new Uint8Array(g/3).fill(h);d.attributes.applyOffset=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}p=ae.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new dt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};jm.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new jm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};var ele=new ce,oqe=[new H,new H,new H],sqe=new er,aqe=new he;function cqe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,ele),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=gW(t,n,r,i,ele),s=oqe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=er.fromRotation(e._stRotation,sqe),u=ce.center(a,aqe);for(let h=0;h<3;++h){let A=s[h];A.x-=u.longitude,A.y-=u.latitude,er.multiplyByVector(c,A,A),A.x+=u.longitude,A.y+=u.latitude,A.x=(A.x-a.west)/a.width,A.y=(A.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return H.pack(f,g),H.pack(d,g,2),H.pack(p,g,4),g}Object.defineProperties(jm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=gW(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=cqe(this)),this._textureCoordinateRotationPoints}}});var fE=jm;var fle=new z,dle=m.ZERO,mle=new m,hle=new ce,lqe=new ce,uqe=new he;function fqe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function yd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new fqe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(yd.prototype=Object.create(Kn.prototype),yd.prototype.constructor=yd);yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,fle)),l(r)||(r=z.WHITE),i.color=zt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,dle,mle))),new Tt({id:t,geometry:new fE(this._options),attributes:i})};yd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,fle),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Xi.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,dle,mle))),new Tt({id:t,geometry:new AT(this._options),attributes:o})};yd.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,lqe);if(!l(n))return;let i=ce.center(n,uqe);return he.toCartesian(i,re.WGS84,t)};yd.prototype._isHidden=function(e,t){return!l(t.coordinates)||li.prototype._isHidden.call(this,e,t)};yd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.rotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};yd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=j.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),r=j.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=j.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=j.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=j.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=j.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=j.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=Kn.computeGeometryOffsetAttribute(i,r,o,s),a.height=Kn.getGeometryHeight(i,r),o=Kn.getGeometryExtrudedHeight(o,s),o===Kn.CLAMP_TO_GROUND&&(o=ai.getMinimumMaximumHeights(fE.computeRectangle(a,hle)).minimumTerrainHeight),a.extrudedHeight=o};yd.DynamicGeometryUpdater=dE;function dE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(dE.prototype=Object.create(ci.prototype),dE.prototype.constructor=dE);dE.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ci.prototype._isHidden.call(this,e,t,n)};dE.prototype._setOptions=function(e,t,n){let i=this._options,r=j.getValueOrUndefined(t.height,n),o=j.getValueOrDefault(t.heightReference,n,qe.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=j.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Kn.getGeometryHeight(r,o),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(fE.computeRectangle(i,hle)).minimumTerrainHeight),i.extrudedHeight=s};var L2=yd;var ple=new z,dqe=new Dt,mqe=new Dt,hqe=m.ZERO,pqe=new m;function Ad(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Ad.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Ad.prototype.onMaterialChanged=function(){this.invalidated=!0};Ad.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Ad.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty)||!j.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Ad.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Ad.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=to.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=to.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,C=j.getValueOrDefault(x,e,z.WHITE,ple);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Vt&&(!u.depthFailMaterialProperty.isConstant||c)){let x=u.depthFailMaterialProperty.color,C=j.getValueOrDefault(x,e,z.WHITE,ple);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!j.isConstant(h)){let x=j.getValueOrDefault(h,e,mqe,dqe);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}let A=u.terrainOffsetProperty;if(!j.isConstant(A)){let x=j.getValueOrDefault(A,e,hqe,pqe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Xi.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ad.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ad.prototype.contains=function(e){return this.updaters.contains(e.id)};Ad.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Ad.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function mE(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}mE.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Ad(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function _le(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}mE.prototype.remove=function(e){_le(this._solidItems,e)||_le(this._translucentItems,e)};function gle(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function N2(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}mE.prototype.update=function(e){let t=N2(this,this._solidItems,e,!0);t=N2(this,this._translucentItems,e,t)&&t;let n=gle(this,this._solidItems,e),i=gle(this,this._translucentItems,e);return(n||i)&&(t=N2(this,this._solidItems,e,t)&&t,t=N2(this,this._translucentItems,e,t)&&t),t};function yle(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return lt.FAILED}mE.prototype.getBoundingSphere=function(e,t){let n=yle(this._solidItems,e,t);return n===lt.FAILED?yle(this._translucentItems,e,t):n};function Ale(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}mE.prototype.removeAllPrimitives=function(){Ale(this._solidItems),Ale(this._translucentItems)};var xd=mE;var _qe=new Dt,gqe=new Dt,yqe=m.ZERO,Aqe=new m;function Cd(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Cd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et}Cd.prototype.onMaterialChanged=function(){this.invalidated=!0};Cd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};Cd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty)||!j.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Cd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var xqe=new z;Cd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=to.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=to.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new wn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=to.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=to.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Vt&&!c.depthFailMaterialProperty.isConstant){let x=c.depthFailMaterialProperty.color,C=j.getValueOrDefault(x,e,z.WHITE,xqe);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=zt.toValue(C,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!j.isConstant(h)){let x=j.getValueOrDefault(h,e,gqe,_qe);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}let A=c.terrainOffsetProperty;if(!j.isConstant(A)){let x=j.getValueOrDefault(A,e,yqe,Aqe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Xi.toValue(x,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Cd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Cd.prototype.contains=function(e){return this.updaters.contains(e.id)};Cd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Cd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function hE(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}hE.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new Cd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};hE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};hE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};hE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return lt.FAILED};hE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Td=hE;var Cle=co(xle(),1);function F2(){this._tree=new Cle.default}function hA(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}hA.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};F2.prototype.insert=function(e,t){let n=hA.fromRectangleAndId(e,t,new hA);this._tree.insert(n)};function Cqe(e,t){return e.id===t.id}var Tqe=new hA;F2.prototype.remove=function(e,t){let n=hA.fromRectangleAndId(e,t,Tqe);this._tree.remove(n,Cqe)};var Eqe=new hA;F2.prototype.collides=function(e){let t=hA.fromRectangleAndId("",e,Eqe);return this._tree.collides(t)};var pE=F2;var bqe=new z,Sqe=new Dt,vqe=new Dt;function Bp(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new pE}Bp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Bp.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Bp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Bp.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Kc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,x=j.getValueOrDefault(A,e,z.WHITE,bqe);z.equals(d._lastColor,x)||(d._lastColor=z.clone(x,d._lastColor),d.color=zt.toValue(x,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!j.isConstant(h)){let A=j.getValueOrDefault(h,e,vqe,Sqe);Dt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Bp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Bp.prototype.contains=function(e){return this.updaters.contains(e.id)};Bp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),lt.DONE):lt.FAILED};Bp.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function _E(e,t){this._batches=[],this._primitives=e,this._classificationType=t}_E.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=j.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new Bp(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};_E.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};_E.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};_E.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return lt.FAILED};_E.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var Mw=_E;var wqe=new Dt,Dqe=new Dt;function lf(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(lf.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new pE}lf.prototype.onMaterialChanged=function(){this.invalidated=!0};lf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};lf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};lf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};lf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};lf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=to.getValue(e,this.materialProperty,this.material),n=new Kc({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=to.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!j.isConstant(h)){let A=j.getValueOrDefault(h,e,Dqe,wqe);Dt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};lf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};lf.prototype.contains=function(e){return this.updaters.contains(e.id)};lf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};lf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function gE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}gE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Nu.shouldUseSphericalCoordinates(r.geometry.rectangle),s=j.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new lf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};gE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};gE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};gE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return lt.FAILED};gE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var U2=gE;var Iqe=new z,Pqe=new Dt,Oqe=new Dt,Rqe=m.ZERO,Mqe=new m;function Lp(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.itemsToRemove=[],this.subscriptions=new Et,this.showsUpdated=new Et}Lp.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty)||!j.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Lp.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Lp.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new cn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let x=u.outlineColorProperty,C=j.getValueOrDefault(x,e,z.WHITE,Iqe);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=zt.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!j.isConstant(h)){let x=j.getValueOrDefault(h,e,Oqe,Pqe);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}let A=u.terrainOffsetProperty;if(!j.isConstant(A)){let x=j.getValueOrDefault(A,e,Rqe,Mqe);m.equals(x,d._lastOffset)||(d._lastOffset=m.clone(x,d._lastOffset),d.offset=Xi.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Lp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=An.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Lp.prototype.contains=function(e){return this.updaters.contains(e.id)};Lp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Lp.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function yE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Et,this._translucentBatches=new Et}yE.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new Lp(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new Lp(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};yE.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};yE.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};yE.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return lt.FAILED};yE.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var Bw=yE;var Tle={};function Bqe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var Lqe=new he,Nqe=new he;function Fqe(e,t,n,i){t=Cr(t,m.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,Lqe);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],h=p===g,A=1;for(let x=1;x<r;++x){let C=t[x],T=e.cartesianToCartographic(C,Nqe);s&&(T.height=n[x]),h=h&&T.height===0,Bqe(d,T)?d.height<T.height&&(c[A-1]=T.height):(a[A]=C,c[A]=T.height,o?u[A]=i[x]:u[A]=0,h=h&&c[A]===u[A],he.clone(T,d),++A)}if(!(h||A<2))return a.length=A,c.length=A,u.length=A,{positions:a,topHeights:c,bottomHeights:u}}var Uqe=new Array(2),Vqe=new Array(2),kqe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Tle.computePositions=function(e,t,n,i,r,o){let s=Fqe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(r,e.maximumRadius),p=kqe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,h;for(h=0;h<a-1;h++)g+=Ri.numberOfPoints(t[h],t[h+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let A=Uqe,x=Vqe;p.positions=A,p.height=x;let C=0;for(h=0;h<a-1;h++){A[0]=t[h],A[1]=t[h+1],x[0]=n[h],x[1]=n[h+1];let T=Ri.generateArc(p);u.set(T,C),x[0]=i[h],x[1]=i[h+1],f.set(Ri.generateArc(p),C),C+=T.length}}else p.positions=t,p.height=n,u=new Float64Array(Ri.generateArc(p)),p.height=i,f=new Float64Array(Ri.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var AE=Tle;var xW=new m,V2=new m,zqe=new m,Ele=new m,Hqe=new m,Gqe=new m,Wqe=new m;function pA(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Oe.clone(r),this._granularity=o,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+re.packedLength+Oe.packedLength+1}pA.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n]=e._granularity,t};var ble=re.clone(re.UNIT_SPHERE),Sle=new Oe,Lw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ble,vertexFormat:Sle,granularity:void 0};pA.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,ble);t+=re.packedLength;let u=Oe.unpack(e,t,Sle);t+=Oe.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._vertexFormat=Oe.clone(u,n._vertexFormat),n._granularity=f,n):(Lw.positions=o,Lw.minimumHeights=s,Lw.maximumHeights=a,Lw.granularity=f,new pA(Lw))};pA.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new pA(c)};pA.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=AE.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,h=r.normal?new Float32Array(p):void 0,A=r.tangent?new Float32Array(p):void 0,x=r.bitangent?new Float32Array(p):void 0,C=r.st?new Float32Array(p/3*2):void 0,T=0,E=0,S=0,w=0,D=0,R=Wqe,O=Gqe,L=Hqe,N=!0;d/=3;let _,b=0,v=1/(d-f-1);for(_=0;_<d;++_){let V=_*3,G=m.fromArray(u,V,xW),U=m.fromArray(c,V,V2);if(r.position&&(g[T++]=U.x,g[T++]=U.y,g[T++]=U.z,g[T++]=G.x,g[T++]=G.y,g[T++]=G.z),r.st&&(C[D++]=b,C[D++]=0,C[D++]=b,C[D++]=1),r.normal||r.tangent||r.bitangent){let q=m.clone(m.ZERO,Ele),Y=m.subtract(G,s.geodeticSurfaceNormal(G,V2),V2);if(_+1<d&&(q=m.fromArray(u,V+3,Ele)),N){let Q=m.subtract(q,G,zqe),W=m.subtract(Y,G,xW);R=m.normalize(m.cross(W,Q,R),R),N=!1}m.equalsEpsilon(G,q,P.EPSILON10)?N=!0:(b+=v,r.tangent&&(O=m.normalize(m.subtract(q,G,O),O)),r.bitangent&&(L=m.normalize(m.cross(R,O,L),L))),r.normal&&(h[E++]=R.x,h[E++]=R.y,h[E++]=R.z,h[E++]=R.x,h[E++]=R.y,h[E++]=R.z),r.tangent&&(A[w++]=O.x,A[w++]=O.y,A[w++]=O.z,A[w++]=O.x,A[w++]=O.y,A[w++]=O.z),r.bitangent&&(x[S++]=L.x,x[S++]=L.y,x[S++]=L.z,x[S++]=L.x,x[S++]=L.y,x[S++]=L.z)}}let I=new gn;r.position&&(I.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(I.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(I.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),r.bitangent&&(I.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),r.st&&(I.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}));let M=p/3;p-=6*(f+1);let F=Ue.createTypedArray(M,p),k=0;for(_=0;_<M-2;_+=2){let V=_,G=_+2,U=m.fromArray(g,V*3,xW),q=m.fromArray(g,G*3,V2);if(m.equalsEpsilon(U,q,P.EPSILON10))continue;let Y=_+1,Q=_+3;F[k++]=Y,F[k++]=V,F[k++]=Q,F[k++]=Q,F[k++]=V,F[k++]=G}return new dt({attributes:I,indices:F,primitiveType:Le.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var k2=pA;var vle=new m,wle=new m;function _A(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=re.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}_A.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var Dle=re.clone(re.UNIT_SPHERE),Nw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Dle,granularity:void 0};_A.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=re.unpack(e,t,Dle);t+=re.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._granularity=u,n):(Nw.positions=o,Nw.minimumHeights=s,Nw.maximumHeights=a,Nw.granularity=u,new _A(Nw))};_A.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new _A(c)};_A.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=AE.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let T=g*3,E=m.fromArray(c,T,vle),S=m.fromArray(a,T,wle);d[p++]=S.x,d[p++]=S.y,d[p++]=S.z,d[p++]=E.x,d[p++]=E.y,d[p++]=E.z}let h=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),A=f/3;f=2*A-4+A;let x=Ue.createTypedArray(A,f),C=0;for(g=0;g<A-2;g+=2){let T=g,E=g+2,S=m.fromArray(d,T*3,vle),w=m.fromArray(d,E*3,wle);if(m.equalsEpsilon(S,w,P.EPSILON10))continue;let D=g+1,R=g+3;x[C++]=D,x[C++]=T,x[C++]=D,x[C++]=R,x[C++]=T,x[C++]=E}return x[C++]=A-2,x[C++]=A-1,new dt({attributes:h,indices:x,primitiveType:Le.LINES,boundingSphere:new ae.fromVertices(d)})};var z2=_A;var Ile=new z;function jqe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Ed(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new jqe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Ed.prototype=Object.create(li.prototype),Ed.prototype.constructor=Ed);Ed.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Ile)),l(c)||(c=z.WHITE),r=zt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Tt({id:t,geometry:new k2(this._options),attributes:i})};Ed.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ile),r=this._distanceDisplayConditionProperty.getValue(e);return new Tt({id:t,geometry:new z2(this._options),attributes:{show:new An(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:zt.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r)}})};Ed.prototype._isHidden=function(e,t){return!l(t.positions)||li.prototype._isHidden.call(this,e,t)};Ed.prototype._getIsClosed=function(e){return!1};Ed.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.minimumHeights)||!j.isConstant(t.maximumHeights)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.granularity)};Ed.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Vt,s=this._options;s.vertexFormat=o?cn.VERTEX_FORMAT:sr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(Ge.MINIMUM_VALUE):void 0};Ed.DynamicGeometryUpdater=xE;function xE(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(xE.prototype=Object.create(ci.prototype),xE.prototype.constructor=xE);xE.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ci.prototype._isHidden.call(this,e,t,n)};xE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=j.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=j.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=j.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=j.getValueOrUndefined(t.granularity,n)};var H2=Ed;var Yqe=[],Ple=[WM,ZF,GF,A2,x2,v2,O2,B2,L2,H2];function Fw(e,t){this.entity=e,this.scene=t;let n=new Array(Ple.length),i=new _e;function r(s){i.raiseEvent(s)}let o=new Mo;for(let s=0;s<n.length;s++){let a=new Ple[s](e,t);o.add(a.geometryChanged,r),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(Fw.prototype._onEntityPropertyChanged,this)}Fw.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};Fw.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Fw.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function uf(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let r=xn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=no.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new Bw(n,e,s,!1),this._outlineBatches[r+s]=new Bw(n,e,s,!0),this._closedColorBatches[s]=new xd(n,cn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new xd(n,cn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Td(n,sr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Td(n,sr,void 0,!0,s,!1),this._openColorBatches[s]=new xd(n,cn,void 0,!1,s,!0),this._openColorBatches[r+s]=new xd(n,cn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Td(n,sr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Td(n,sr,void 0,!1,s,!1);let a=Hn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new U2(i,s,sr)),c[s]=new Mw(i,s);else for(s=0;s<a;++s)c[s]=new Mw(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new JT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Et,this._updaterSets=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(uf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Yqe)}uf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(A){d._removeUpdater(A),d._insertUpdaterIntoBatch(e,A)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new Fw(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(A){d._insertUpdaterIntoBatch(e,A)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(uf._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a<h;a++)p=g[a].update(e)&&p;return p};var qqe=[],Xqe=new ae;uf.prototype.getBoundingSphere=function(e,t){let n=qqe,i=Xqe,r=0,o=lt.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return lt.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===lt.PENDING)return lt.PENDING;o===lt.DONE&&(n[r]=ae.clone(i,n[r]),r++)}}return r===0?lt.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),lt.DONE)};uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(uf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};uf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};uf.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Vt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};uf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};uf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var G2=uf;var Kqe=1,Jqe="30px sans-serif",Zqe=jr.FILL,Qqe=z.WHITE,$qe=z.BLACK,eXe=1,tXe=!1,nXe=new z(.165,.165,.165,.8),iXe=new H(7,5),rXe=H.ZERO,oXe=m.ZERO,sXe=qe.NONE,aXe=_i.CENTER,cXe=Bn.CENTER,lXe=new m,uXe=new z,fXe=new z,dXe=new z,mXe=new H,hXe=new m,pXe=new H,_Xe=new Lt,gXe=new Lt,yXe=new Lt,AXe=new Dt;function Ole(e){this.entity=e,this.label=void 0,this.index=void 0}function Vg(e,t){t.collectionChanged.addEventListener(Vg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Vg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),d;if(f&&(d=j.getValueOrUndefined(s._position,e,lXe),c=j.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){CW(o,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=j.getValueOrDefault(a._heightReference,e,sXe);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=m.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=j.getValueOrDefault(a._scale,e,Kqe),u.font=j.getValueOrDefault(a._font,e,Jqe),u.style=j.getValueOrDefault(a._style,e,Zqe),u.fillColor=j.getValueOrDefault(a._fillColor,e,Qqe,uXe),u.outlineColor=j.getValueOrDefault(a._outlineColor,e,$qe,fXe),u.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,eXe),u.showBackground=j.getValueOrDefault(a._showBackground,e,tXe),u.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,nXe,dXe),u.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,iXe,mXe),u.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,rXe,pXe),u.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,oXe,hXe),u.heightReference=g,u.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,aXe),u.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,cXe),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,_Xe),u.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,gXe),u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,yXe),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,AXe),u.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};Vg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return lt.FAILED;let i=n.label;return t.center=m.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,lt.DONE};Vg.prototype.isDestroyed=function(){return!1};Vg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};Vg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new Ole(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Ole(o)):(CW(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],CW(s.get(o.id),o,a),s.remove(o.id)};function CW(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var W2=Vg;async function xXe(e,t,n){return await e._readyPromise,EXe(e,t,n)}function CXe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let r=i.then(bXe(n)).catch(SXe(n));return e.shift(),t.push(r),!0}function TXe(e){return new Promise(function(t){setTimeout(t,e)})}function TW(e,t){return e.length?CXe(e,t)?TW(e,t):TXe(100).then(()=>TW(e,t)):Promise.resolve()}function EXe(e,t,n){let i=e.tilingScheme,r,o=[],s={};for(r=0;r<n.length;++r){let c=i.positionToTileXY(n[r],t);if(!l(c))continue;let u=c.toString();if(!s.hasOwnProperty(u)){let f={x:c.x,y:c.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};s[u]=f,o.push(f)}s[u].positions.push(n[r])}let a=[];return TW(o,a).then(function(){return Promise.all(a).then(function(){return n})})}function Rle(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function bXe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!Rle(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];Rle(s,i,n)}}):Promise.resolve()}}function SXe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var j2=xXe;var EW=new H;async function Mle(e,t){let n=[],i=[];await e._readyPromise;let r=e.availability,o=[];for(let a=0;a<t.length;++a){let c=t[a],u=r.computeMaximumLevelAtPosition(c);if(i[a]=u,u===0){e.tilingScheme.positionToTileXY(c,1,EW);let d=e.loadTileDataAvailability(EW.x,EW.y,1);l(d)&&o.push(d)}let f=n[u];l(f)||(n[u]=f=[]),f.push(c)}await Promise.all(o),await Promise.all(n.map(function(a,c){if(l(a))return j2(e,c,a)}));let s=[];for(let a=0;a<t.length;++a){let c=t[a];r.computeMaximumLevelAtPosition(c)!==i[a]&&s.push(c)}return s.length>0&&await Mle(e,s),t}var kg=Mle;var vXe=1,wXe=0,DXe=!0,IXe=!0,PXe=xn.ENABLED,OXe=qe.NONE,RXe=z.RED,MXe=0,BXe=z.WHITE,LXe=Tc.HIGHLIGHT,NXe=.5,FXe=new H(1,1),UXe=new B,VXe=new B,Ble=new z,Lle=new Array(4),kXe=new m;function Ym(e,t){t.collectionChanged.addEventListener(Ym.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function zXe(e,t,n,i){let r=e._primitives,o=e._modelHash;try{let s=await Dm.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(o[t.id]))return;s.id=t,r.add(s),o[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(o[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(o[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(o[t.id]))return;console.log(s),o[t.id].loadFailed=!0}}Ym.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,UXe),c=ve.createIfNeeded(j.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,awaitingSampleTerrain:!1,clampedBoundingSphere:void 0,sampleTerrainFailed:!1},n[s.id]=u;let h=j.getValueOrDefault(a._incrementallyLoadTextures,e,DXe);zXe(this,s,c,h)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=j.getValueOrDefault(a._scale,e,vXe),p.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,wXe),p.maximumScale=j.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=B.clone(d,p.modelMatrix),p.shadows=j.getValueOrDefault(a._shadows,e,PXe),p.heightReference=j.getValueOrDefault(a._heightReference,e,OXe),p.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,RXe,Ble),p.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,MXe),p.color=j.getValueOrDefault(a._color,e,BXe,Ble),p.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,LXe),p.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,NXe),p.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,IXe),p.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,FXe);let g=j.getValueOrUndefined(a._lightColor,e);if(l(g)&&(z.pack(g,Lle,0),g=m.unpack(Lle,0,kXe)),p.lightColor=g,p.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let h=j.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:jl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=h);let A=j.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,S=T.length;E<S;++E){let w=T[E],D=A[w];if(!l(D))continue;let R=p.getNode(w);if(!l(R))continue;let O=B.fromTranslationRotationScale(D,VXe);R.matrix=B.multiply(R.originalMatrix,O,O)}}let x=!1,C=j.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(C)){let T=Object.keys(C);for(let E=0,S=T.length;E<S;++E){let w=T[E],D=C[w];l(D)&&(x=!0,p.setArticulationStage(w,D))}}x&&p.applyArticulations()}}return!0};Ym.prototype.isDestroyed=function(){return!1};Ym.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ym.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)bW(this,e[i],t,n);return ue(this)};Ym._sampleTerrainMostDetailed=kg;var CE=new m,Nle=new he;Ym.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene.globe,s=l(o)?o.terrainProvider:void 0,a=i.heightReference!==qe.NONE;if(l(o)&&a){let c=o.ellipsoid;if(!s._ready)return lt.PENDING;let u=i.modelMatrix;CE.x=u[12],CE.y=u[13],CE.z=u[14];let f=c.cartesianToCartographic(CE);if(!l(s.availability)){i.heightReference===qe.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,lt.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,lt.FAILED):l(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,lt.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(he.clone(f,Nle),this._modelHash[e.id].awaitingSampleTerrain=!0,Ym._sampleTerrainMostDetailed(s,[Nle]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let A=h[0];i.heightReference===qe.RELATIVE_TO_GROUND&&(A.height+=f.height),c.cartographicToCartesian(A,CE),ae.clone(i.boundingSphere,d),d.center=CE,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),lt.PENDING)}return ae.clone(i.boundingSphere,t),lt.DONE};Ym.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(HXe(o,a),s.set(o.id,o)):(bW(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],bW(this,o,a,c),s.remove(o.id)};function bW(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function HXe(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Y2=Ym;function zg(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(zg.prototype,{isConstant:{get:function(){return j.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:nr.FIXED}}});zg.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,nr.FIXED,t)};zg.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};zg.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?re.WGS84.scaleToGeodeticSurface(n,n):void 0};zg.prototype.equals=function(e){return this===e||e instanceof zg&&this._value===e._value};zg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Np=zg;var GXe=60,WXe=1,Vle=new bn,SW=new bn,vW=new bn;function Fle(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function jXe(e,t,n,i,r,o,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,o,c[u]),l(f)&&(c[u++]=f);let d=!l(r)||ee.lessThanOrEquals(r,t)||ee.greaterThanOrEquals(r,n),p=0,g=i.length,h=i[p],A=n,x=!1,C,T,E;for(;p<g;){if(!d&&ee.greaterThanOrEquals(h,r)&&(f=e.getValueInReferenceFrame(r,o,c[u]),l(f)&&(c[u++]=f),d=!0),ee.greaterThan(h,t)&&ee.lessThan(h,A)&&!h.equals(r)&&(f=e.getValueInReferenceFrame(h,o,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!x){let S=i[p+1],w=ee.secondsDifference(S,h);x=w>s,x&&(C=Math.ceil(w/s),T=0,E=w/Math.max(C,2),C=Math.max(C-1,1))}if(x&&T<C){h=ee.addSeconds(h,E,new ee),T++;continue}}x=!1,p++,h=i[p]}return f=e.getValueInReferenceFrame(n,o,c[u]),l(f)&&(c[u++]=f),u}function YXe(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(d,n);)!g&&ee.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=ee.addSeconds(t,p*u,new ee);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function qXe(e,t,n,i,r,o,s,a){vW.start=t,vW.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!bn.intersect(d,vW,Vle).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=ee.addSeconds(d.start,ee.secondsDifference(d.stop,d.start)/2,new ee));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function XXe(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function KXe(e,t,n,i,r,o,s,a){SW.start=t,SW.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!bn.intersect(d,SW,Vle).isEmpty){let p=d.start,g=d.stop,h=t;ee.greaterThan(p,h)&&(h=p);let A=n;ee.lessThan(g,A)&&(A=g),c=kle(d.data,h,A,i,r,o,c,a)}}return c}function kle(e,t,n,i,r,o,s,a){for(;e instanceof Pg;)e=e.resolvedProperty;if(e instanceof ya){let c=e._property._times;s=jXe(e,t,n,c,i,r,o,s,a)}else e instanceof ga?s=KXe(e,t,n,i,r,o,s,a):e instanceof Rg?s=qXe(e,t,n,i,r,o,s,a):e instanceof Jc||e instanceof Np&&j.isConstant(e)?s=XXe(e,t,n,i,r,o,s,a):s=YXe(e,t,n,i,r,o,s,a);return s}function zle(e,t,n,i,r,o,s){l(s)||(s=[]);let a=kle(e,t,n,i,r,o,0,s);return s.length=a,s}var Ule=new Z;function Uw(e,t){this._unusedIndexes=[],this._polylineCollection=new Rm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}Uw.prototype.update=function(e){if(this._referenceFrame===nr.INERTIAL){let t=Mt.computeIcrfToFixedMatrix(e,Ule);l(t)||(t=Mt.computeTemeToPseudoFixedMatrix(e,Ule)),B.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};Uw.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=j.getValueOrUndefined(i._leadTime,e),p=j.getValueOrUndefined(i._trailTime,e),g=n._availability,h=l(g),A=l(d),x=l(p);if(u=h||A&&x,u){if(x&&(o=ee.addSeconds(e,-p,new ee)),A&&(s=ee.addSeconds(e,d,new ee)),h){let C=g.start,T=g.stop;(!x||ee.greaterThan(C,o))&&(o=C),(!A||ee.lessThan(T,s))&&(s=T)}u=ee.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=j.getValueOrDefault(i._resolution,e,GXe);c.show=!0,c.positions=zle(r,o,s,e,this._referenceFrame,f,c.positions.slice()),c.material=to.getValue(e,i._material,c.material),c.width=j.getValueOrDefault(i._width,e,WXe),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Uw.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};Uw.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Hg(e,t){t.collectionChanged.addEventListener(Hg.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Hg.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],a=o.entity._position,c=o.updater,u=nr.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,o);continue}l(c)&&c.removeObject(o),l(f)||(f=new Uw(this._scene,u),f.update(e),this._updaters[u]=f),o.updater=f,l(f)&&f.updateObject(e,o)}return!0};Hg.prototype.isDestroyed=function(){return!1};Hg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hg.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Hg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new Fle(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new Fle(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};Hg._subSample=zle;var q2=Hg;var Hle=z.WHITE,Gle=z.BLACK,Wle=0,jle=1,Yle=0,qle=new z,JXe=new m,Xle=new z,Kle=new Lt,Jle=new Lt,Zle=new Dt;function Qle(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Gg(e,t){t.collectionChanged.addEventListener(Gg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Gg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=j.getValueOrDefault(a._heightReference,e,qe.NONE),d=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),p;if(d&&(p=j.getValueOrUndefined(s._position,e,JXe),d=l(p)),!d){Vw(o,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,h=!1;if(f!==qe.NONE&&!l(u)?(l(c)&&(Vw(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,h=m.equals(u.position,p)&&u.heightReference===f):f===qe.NONE&&!l(c)&&(l(u)&&(Vw(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,Kle),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,Jle),c.color=j.getValueOrDefault(a._color,e,Hle,qle),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,Gle,Xle),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,Wle),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,jle),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,Zle),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,Yle);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,Kle),u.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,Jle),u.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,Zle),u.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,Yle),u.heightReference=f;let A=j.getValueOrDefault(a._color,e,Hle,qle),x=j.getValueOrDefault(a._outlineColor,e,Gle,Xle),C=Math.round(j.getValueOrDefault(a._outlineWidth,e,Wle)),T=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,jle)));if(C>0?(u.scale=1,g=g||C!==o.outlineWidth||T!==o.pixelSize||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)):(u.scale=T/50,T=50,g=g||C!==o.outlineWidth||!z.equals(A,o.color)||!z.equals(x,o.outlineColor)),g){o.color=z.clone(A,o.color),o.outlineColor=z.clone(x,o.outlineColor),o.pixelSize=T,o.outlineWidth=C;let E=A.alpha,S=A.toCssColorString(),w=x.toCssColorString(),D=JSON.stringify([S,T,w,C]);u.setImage(D,sT(E,S,w,C,T))}h&&u._updateClamping()}}return!0};Gg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return lt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return lt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};Gg.prototype.isDestroyed=function(){return!1};Gg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Gg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Gg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Qle(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Qle(o)):(Vw(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Vw(s.get(o.id),o,a),s.remove(o.id)};function Vw(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var X2=Gg;var iue=[];function ZXe(e,t,n,i,r){let o=iue;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let A=(d-a)/r,x=(p-c)/r,C=(g-u)/r,T=(h-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*A,c+s*x,u+s*C,f+s*T);return o}function kw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),r=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Oe.clone(y(e.vertexFormat,Oe.DEFAULT)),this._arcType=y(e.arcType,$t.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(y(e.ellipsoid,re.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+re.packedLength+Oe.packedLength+4}kw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var rue=re.clone(re.UNIT_SPHERE),oue=new Oe,gA={positions:void 0,colors:void 0,ellipsoid:rue,vertexFormat:oue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};kw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t,rue);t+=re.packedLength;let c=Oe.unpack(e,t,oue);t+=Oe.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=Oe.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(gA.positions=o,gA.colors=s,gA.width=u,gA.colorsPerVertex=f,gA.arcType=d,gA.granularity=p,new kw(gA))};var $le=new m,eue=new m,tue=new m,nue=new m;kw.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Cr(e._positions,m.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,F=d[0];i=i.filter(function(k,V){let G=!1;return r?G=V===F||V===0&&F===1:G=V+1===F,G?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===$t.GEODESIC||o===$t.RHUMB){let M,F;o===$t.GEODESIC?(M=P.chordLength(s,a.maximumRadius),F=Ri.numberOfPoints):(M=s,F=Ri.numberOfPointsRhumbLine);let k=Ri.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c<g-1;++c)V+=F(p[c],p[c+1],M);let G=new Array(V),U=0;for(c=0;c<g-1;++c){let q=p[c],Y=p[c+1],Q=i[c],W=F(q,Y,M);if(r&&c<V){let K=i[c+1],J=ZXe(q,Y,Q,K,W),me=J.length;for(u=0;u<me;++u)G[U++]=J[u]}else for(u=0;u<W;++u)G[U++]=z.clone(Q)}G[U]=z.clone(i[i.length-1]),i=G,iue.length=0}o===$t.GEODESIC?p=Ri.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:k}):p=Ri.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:k})}g=p.length;let h=g*4-4,A=new Float64Array(h*3),x=new Float64Array(h*3),C=new Float64Array(h*3),T=new Float32Array(h*2),E=n.st?new Float32Array(h*2):void 0,S=l(i)?new Uint8Array(h*4):void 0,w=0,D=0,R=0,O=0,L;for(u=0;u<g;++u){u===0?(L=$le,m.subtract(p[0],p[1],L),m.add(p[0],L,L)):L=p[u-1],m.clone(L,tue),m.clone(p[u],eue),u===g-1?(L=$le,m.subtract(p[g-1],p[g-2],L),m.add(p[g-1],L,L)):L=p[u+1],m.clone(L,nue);let M,F;l(S)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(F=i[u]));let k=u===0?2:0,V=u===g-1?2:4;for(f=k;f<V;++f){m.pack(eue,A,w),m.pack(tue,x,w),m.pack(nue,C,w),w+=3;let G=f-2<0?-1:1;if(T[D++]=2*(f%2)-1,T[D++]=G*t,n.st&&(E[R++]=u/(g-1),E[R++]=Math.max(T[D-2],0)),l(S)){let U=f<2?M:F;S[O++]=z.floatToByte(U.red),S[O++]=z.floatToByte(U.green),S[O++]=z.floatToByte(U.blue),S[O++]=z.floatToByte(U.alpha)}}}let N=new gn;N.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:A}),N.prevPosition=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),N.nextPosition=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),N.expandAndWidth=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(N.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:E})),l(S)&&(N.color=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Ue.createTypedArray(h,g*6-6),b=0,v=0,I=g-1;for(u=0;u<I;++u)_[v++]=b,_[v++]=b+2,_[v++]=b+1,_[v++]=b+1,_[v++]=b+2,_[v++]=b+3,b+=4;return new dt({attributes:N,indices:_,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:Nf.POLYLINES})};var Wg=kw;var QXe=new $n(0),K2={},sue=new z,$Xe=new Vt(z.WHITE),eKe=new $n(!0),tKe=new $n(xn.DISABLED),nKe=new $n(new Dt),iKe=new $n(Hn.BOTH);function rKe(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function oKe(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function bd(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(bd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new rKe,this._groundGeometryOptions=new oKe,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=no.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(bd.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});bd.prototype.isOutlineVisible=function(e){return!1};bd.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new An(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=zn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Vt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sue)),l(a)||(a=z.WHITE),s.color=zt.fromColor(a)),this.clampToGround?new Tt({id:t,geometry:new cC(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Vt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,sue)),l(a)||(a=z.WHITE),s.depthFailColor=zt.fromColor(a)),new Tt({id:t,geometry:new Wg(this._geometryOptions),attributes:s}))};bd.prototype.createOutlineGeometryInstance=function(e){};bd.prototype.isDestroyed=function(){return!1};bd.prototype.destroy=function(){this._entitySubscription(),ue(this)};bd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(Ge.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=y(r.material,$Xe),u=c instanceof Vt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=y(s,eKe),this._shadowsProperty=y(r.shadows,tKe),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,nKe),this._classificationTypeProperty=y(r.classificationType,iKe),this._fillEnabled=!0,this._zIndex=y(a,QXe);let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!j.isConstant(f)||!j.isConstant(d)||!j.isConstant(g)||!j.isConstant(p)||!j.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,A=o.getValue(Ge.MINIMUM_VALUE,h.positions);if(!l(A)||A.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Vt)?x=jo.VERTEX_FORMAT:x=da.VERTEX_FORMAT,h.vertexFormat=x,h.positions=A,h.width=l(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,h.arcType=l(d)?d.getValue(Ge.MINIMUM_VALUE):void 0,h.granularity=l(g)?g.getValue(Ge.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=A,C.width=h.width,C.arcType=h.arcType,C.granularity=h.granularity,this._clampToGround=l(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Rt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};bd.prototype.createDynamicUpdater=function(e,t){return new zw(e,t,this)};var TE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function zw(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function aue(e){if(l(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=K2[t],i=e._primitives;!l(n)||n.isDestroyed()?(n=new Rm,K2[t]=n,i.add(n)):i.contains(n)||i.add(n);let r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}zw.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=j.getValueOrUndefined(r,e,this._positions);t._clampToGround=j.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=j.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=j.getValueOrDefault(i._arcType,e,$t.GEODESIC),t._groundGeometryOptions.granularity=j.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let f=t.fillMaterialProperty,d;if(f instanceof Vt)d=new jo;else{let p=to.getValue(e,f,this._material);d=new da({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new lm({geometryInstances:t.createFillGeometryInstance(e),appearance:d,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),j.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=aue(this);if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=$t.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe;c!==$t.NONE&&l(u)&&(TE.ellipsoid=u.ellipsoid,TE.positions=o,TE.granularity=j.getValueOrUndefined(i._granularity,e),TE.height=Ri.extractHeights(o,u.ellipsoid),c===$t.GEODESIC?o=Ri.generateCartesianArc(TE):o=Ri.generateCartesianRhumbArc(TE)),a.show=!0,a.positions=o.slice(),a.material=to.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};zw.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),lt.DONE}return l(t)&&!t.ready?lt.PENDING:lt.DONE}else{let t=aue(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};zw.prototype.isDestroyed=function(){return!1};zw.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=K2[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete K2[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var J2=bd;var sKe=new z,aKe=new Dt,cKe=new Dt;function Sd(e,t,n,i,r){let o;n instanceof Vt?o=jo:o=da,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Sd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=r}Sd.prototype.onMaterialChanged=function(){this.invalidated=!0};Sd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};Sd.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Sd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Sd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new lm({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===da&&(this.material=to.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===da&&(this.material=to.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let A=c.fillMaterialProperty.color,x=j.getValueOrDefault(A,e,z.WHITE,sKe);z.equals(d._lastColor,x)||(d._lastColor=z.clone(x,d._lastColor),d.color=zt.toValue(x,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=An.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!j.isConstant(h)){let A=j.getValueOrDefault(h,e,cKe,aKe);Dt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Sd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=An.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Sd.prototype.contains=function(e){return this.updaters.contains(e.id)};Sd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Sd.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function EE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}EE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=j.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new Sd(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};EE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};EE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};EE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return lt.FAILED};EE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Z2=EE;var lKe=[];function cue(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function lue(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Vt?1:2);let o;l(i)&&(o=i+r*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Vt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function qm(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let r,o=xn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new xd(n,jo,void 0,!1,r),this._materialBatches[r]=new Td(n,da,void 0,!1,r),this._colorBatches[r+o]=new xd(n,jo,jo,!1,r),this._materialBatches[r+o]=new Td(n,da,jo,!1,r),this._colorBatches[r+o*2]=new xd(n,jo,da,!1,r),this._materialBatches[r+o*2]=new Td(n,da,da,!1,r);this._dynamicBatch=new JT(n,i);let s=Hn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new Z2(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Et,this._updaters=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(qm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,lKe)}qm.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(cue(this,f),lue(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),cue(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new J2(c,this._scene),this._updaters.set(u,f),lue(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(qm._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var uKe=[],fKe=new ae;qm.prototype.getBoundingSphere=function(e,t){let n=uKe,i=fKe,r=0,o=lt.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return lt.FAILED;for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===lt.PENDING)return lt.PENDING;o===lt.DONE&&(n[r]=ae.clone(i,n[r]),r++)}return r===0?lt.FAILED:(n.length=r,ae.fromBoundingSpheres(n,t),lt.DONE)};qm.prototype.isDestroyed=function(){return!1};qm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qm.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};qm._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};qm.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var Q2=qm;function ff(e){Kc.initializeTerrainHeights(),lm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Mo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,ff.defaultVisualizersCallback);let i=!1,r=new Zl,o=new Zl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new XF;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}ff.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new FR(t,i),new G2(e,i,n._primitives,n._groundPrimitives),new W2(t,i),new Y2(e,i),new MF(e,i),new X2(t,i),new q2(e,i),new Q2(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(ff.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};ff.prototype.update=function(e){if(!ai.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return this._ready=t,t};ff.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var dKe=[],mKe=new ae;ff.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return lt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return lt.FAILED;let s=dKe,a=mKe,c=0,u=lt.DONE,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===lt.PENDING)return lt.PENDING;u===lt.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?lt.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),lt.DONE)};ff.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Zl),s=r.add(new d2);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};ff.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};ff.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var $2=ff;function wW(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}wW.clone=function(e,t){if(l(e))return l(t)||(t=new wW),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var df=wW;var uue=new Z,fue=new Z,due=new Z,hKe=new B,e3=new m,mue=new m,DW=new m,IW=new m,hue=new m,pue=new m,bE=new ee,pKe=1.25;function _Ke(e,t,n,i,r,o,s){let a=e.scene.mode,c=r.getValue(o,e._lastCartesian);if(l(c)){let u=!1,f=!1,d,p,g;if(a===ne.SCENE3D){ee.addSeconds(o,.001,bE);let T=r.getValue(bE,e3);if(l(T)||(ee.addSeconds(o,-.001,bE),T=r.getValue(bE,e3),f=!0),l(T)){let E=Mt.computeFixedToIcrfMatrix(o,uue),S=Mt.computeFixedToIcrfMatrix(bE,fue),w;!l(E)||!l(S)?(w=Mt.computeTemeToPseudoFixedMatrix(o,due),E=Z.transpose(w,uue),S=Mt.computeTemeToPseudoFixedMatrix(bE,fue),Z.transpose(S,S)):w=Z.transpose(E,due);let D=Z.multiplyByVector(E,c,hue),R=Z.multiplyByVector(S,T,pue);m.subtract(D,R,IW);let O=m.magnitude(IW)*1e3,L=P.GRAVITATIONALPARAMETER,N=-L/(O*O-2*L/m.magnitude(D));N<0||N>pKe*s.maximumRadius?(d=mue,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,DW),p=m.cross(g,d,e3),m.magnitude(p)>P.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,DW),m.normalize(g,g),u=!0)):m.equalsEpsilon(c,T,P.EPSILON7)||(g=mue,m.normalize(D,g),m.normalize(R,R),p=m.cross(g,R,DW),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,P.EPSILON7)||(d=m.cross(p,g,e3),Z.multiplyByVector(w,d,d),Z.multiplyByVector(w,p,p),Z.multiplyByVector(w,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,A,x;i&&(h=m.clone(t.position,IW),A=m.clone(t.direction,hue),x=m.clone(t.up,pue));let C=hKe;u?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(A,t.direction),m.clone(x,t.up),m.cross(A,x,t.right))}if(n){let u=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function Hw(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,re.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(Hw,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});Hw.defaultOffset3D=new m(-14e3,3500,3500);var t3=new df,gKe=new m;Hw.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===ne.MORPHING)return;let o=this.entity,s=o.position;if(!l(s))return;let a=o!==this._lastEntity,c=r!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=o.viewFrom,g=l(p);if(!g&&l(t)){t3.pitch=-P.PI_OVER_FOUR,t3.range=0;let h=s.getValue(e,gKe);if(l(h)){let A=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);t3.pitch*=A}u.viewBoundingSphere(t,t3),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&m.clone(Hw._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(u.position,this._offset3D);this._lastEntity=o,this._mode=r,_Ke(this,u,f,d,s,e,i)};var n3=Hw;function l3(e){return u3(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function u3(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?u3(n):n),[])}var _ue=[0,1,2,3].concat(...l3([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function so(){let e=this;function t(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,h,A,x=0;for(g=0;g<=15;g++)r.bl_count[g]=0;for(o[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<573;f++)d=r.heap[f],g=o[o[d*2+1]*2+1]+1,g>u&&(g=u,x++),o[d*2+1]=g,!(d>e.max_code)&&(r.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),A=o[d*2],r.opt_len+=A*(g+h),s&&(r.static_len+=A*(s[d*2+1]+h)));if(x!==0){do{for(g=u-1;r.bl_count[g]===0;)g--;r.bl_count[g]--,r.bl_count[g+1]+=2,r.bl_count[u]--,x-=2}while(x>0);for(g=u;g!==0;g--)for(d=r.bl_count[g];d!==0;)p=r.heap[--f],!(p>e.max_code)&&(o[p*2+1]!=g&&(r.opt_len+=(g-o[p*2+1])*o[p*2],o[p*2+1]=g),d--)}}function n(r,o){let s=0;do s|=r&1,r>>>=1,s<<=1;while(--o>0);return s>>>1}function i(r,o,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=o;f++)d=r[f*2+1],d!==0&&(r[f*2]=n(a[d]++,d))}e.build_tree=function(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(r.heap_len=0,r.heap_max=573,c=0;c<a;c++)o[c*2]!==0?(r.heap[++r.heap_len]=f=c,r.depth[c]=0):o[c*2+1]=0;for(;r.heap_len<2;)d=r.heap[++r.heap_len]=f<2?++f:0,o[d*2]=1,r.depth[d]=0,r.opt_len--,s&&(r.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(r.heap_len/2);c>=1;c--)r.pqdownheap(o,c);d=a;do c=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),u=r.heap[1],r.heap[--r.heap_max]=c,r.heap[--r.heap_max]=u,o[d*2]=o[c*2]+o[u*2],r.depth[d]=Math.max(r.depth[c],r.depth[u])+1,o[c*2+1]=o[u*2+1]=d,r.heap[1]=d++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],t(r),i(o,e.max_code,r.bl_count)}}so._length_code=[0,1,2,3,4,5,6,7].concat(...l3([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));so.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];so.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];so.d_code=function(e){return e<256?_ue[e]:_ue[256+(e>>>7)]};so.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];so.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];so.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];so.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Aa(e,t,n,i,r){let o=this;o.static_tree=e,o.extra_bits=t,o.extra_base=n,o.elems=i,o.max_length=r}var yKe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],AKe=l3([[144,8],[112,9],[24,7],[8,8]]);Aa.static_ltree=u3(yKe.map((e,t)=>[e,AKe[t]]));var xKe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],CKe=l3([[30,5]]);Aa.static_dtree=u3(xKe.map((e,t)=>[e,CKe[t]]));Aa.static_l_desc=new Aa(Aa.static_ltree,so.extra_lbits,256+1,286,15);Aa.static_d_desc=new Aa(Aa.static_dtree,so.extra_dbits,0,30,15);Aa.static_bl_desc=new Aa(null,so.extra_blbits,0,19,7);var TKe=9,EKe=8;function Xm(e,t,n,i,r){let o=this;o.good_length=e,o.max_lazy=t,o.nice_length=n,o.max_chain=i,o.func=r}var yue=0,a3=1,yA=2,vd=[new Xm(0,0,0,0,yue),new Xm(4,4,8,4,a3),new Xm(4,5,16,8,a3),new Xm(4,6,32,32,a3),new Xm(4,4,16,16,yA),new Xm(8,16,32,32,yA),new Xm(8,16,128,128,yA),new Xm(8,32,128,256,yA),new Xm(32,128,258,1024,yA),new Xm(32,258,258,4096,yA)],i3=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],mf=0,r3=1,Gw=2,o3=3,bKe=32,PW=42,s3=113,Ww=666,OW=8,SKe=0,RW=1,vKe=2,ho=3,c3=258,tu=c3+ho+1;function gue(e,t,n,i){let r=e[t*2],o=e[n*2];return r<o||r==o&&i[t]<=i[n]}function wKe(){let e=this,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A,x,C,T,E,S,w,D,R,O,L,N,_,b,v,I,M,F,k,V=new so,G=new so,U=new so;e.depth=[];let q,Y,Q,W,K,J;e.bl_count=[],e.heap=[],M=[],F=[],k=[];function me(){u=2*o,d[g-1]=0;for(let Ve=0;Ve<g-1;Ve++)d[Ve]=0;N=vd[_].max_lazy,v=vd[_].good_length,I=vd[_].nice_length,L=vd[_].max_chain,w=0,C=0,R=0,T=O=ho-1,S=0,p=0}function ye(){let Ve;for(Ve=0;Ve<286;Ve++)M[Ve*2]=0;for(Ve=0;Ve<30;Ve++)F[Ve*2]=0;for(Ve=0;Ve<19;Ve++)k[Ve*2]=0;M[256*2]=1,e.opt_len=e.static_len=0,Y=Q=0}function se(){V.dyn_tree=M,V.stat_desc=Aa.static_l_desc,G.dyn_tree=F,G.stat_desc=Aa.static_d_desc,U.dyn_tree=k,U.stat_desc=Aa.static_bl_desc,K=0,J=0,W=8,ye()}e.pqdownheap=function(Ve,ot){let je=e.heap,Ze=je[ot],mt=ot<<1;for(;mt<=e.heap_len&&(mt<e.heap_len&&gue(Ve,je[mt+1],je[mt],e.depth)&&mt++,!gue(Ve,Ze,je[mt],e.depth));)je[ot]=je[mt],ot=mt,mt<<=1;je[ot]=Ze};function pe(Ve,ot){let je=-1,Ze,mt=Ve[0*2+1],kt=0,Jt=7,$i=4;mt===0&&(Jt=138,$i=3),Ve[(ot+1)*2+1]=65535;for(let dr=0;dr<=ot;dr++)Ze=mt,mt=Ve[(dr+1)*2+1],!(++kt<Jt&&Ze==mt)&&(kt<$i?k[Ze*2]+=kt:Ze!==0?(Ze!=je&&k[Ze*2]++,k[16*2]++):kt<=10?k[17*2]++:k[18*2]++,kt=0,je=Ze,mt===0?(Jt=138,$i=3):Ze==mt?(Jt=6,$i=3):(Jt=7,$i=4))}function xe(){let Ve;for(pe(M,V.max_code),pe(F,G.max_code),U.build_tree(e),Ve=19-1;Ve>=3&&k[so.bl_order[Ve]*2+1]===0;Ve--);return e.opt_len+=3*(Ve+1)+5+5+4,Ve}function we(Ve){e.pending_buf[e.pending++]=Ve}function Ee(Ve){we(Ve&255),we(Ve>>>8&255)}function Be(Ve){we(Ve>>8&255),we(Ve&255&255)}function ke(Ve,ot){let je,Ze=ot;J>16-Ze?(je=Ve,K|=je<<J&65535,Ee(K),K=je>>>16-J,J+=Ze-16):(K|=Ve<<J&65535,J+=Ze)}function Pe(Ve,ot){let je=Ve*2;ke(ot[je]&65535,ot[je+1]&65535)}function ft(Ve,ot){let je,Ze=-1,mt,kt=Ve[0*2+1],Jt=0,$i=7,dr=4;for(kt===0&&($i=138,dr=3),je=0;je<=ot;je++)if(mt=kt,kt=Ve[(je+1)*2+1],!(++Jt<$i&&mt==kt)){if(Jt<dr)do Pe(mt,k);while(--Jt!==0);else mt!==0?(mt!=Ze&&(Pe(mt,k),Jt--),Pe(16,k),ke(Jt-3,2)):Jt<=10?(Pe(17,k),ke(Jt-3,3)):(Pe(18,k),ke(Jt-11,7));Jt=0,Ze=mt,kt===0?($i=138,dr=3):mt==kt?($i=6,dr=3):($i=7,dr=4)}}function _t(Ve,ot,je){let Ze;for(ke(Ve-257,5),ke(ot-1,5),ke(je-4,4),Ze=0;Ze<je;Ze++)ke(k[so.bl_order[Ze]*2+1],3);ft(M,Ve-1),ft(F,ot-1)}function rt(){J==16?(Ee(K),K=0,J=0):J>=8&&(we(K&255),K>>>=8,J-=8)}function dn(){ke(RW<<1,3),Pe(256,Aa.static_ltree),rt(),1+W+10-J<9&&(ke(RW<<1,3),Pe(256,Aa.static_ltree),rt()),W=7}function In(Ve,ot){let je,Ze,mt;if(e.dist_buf[Y]=Ve,e.lc_buf[Y]=ot&255,Y++,Ve===0?M[ot*2]++:(Q++,Ve--,M[(so._length_code[ot]+256+1)*2]++,F[so.d_code(Ve)*2]++),!(Y&8191)&&_>2){for(je=Y*8,Ze=w-C,mt=0;mt<30;mt++)je+=F[mt*2]*(5+so.extra_dbits[mt]);if(je>>>=3,Q<Math.floor(Y/2)&&je<Math.floor(Ze/2))return!0}return Y==q-1}function Ht(Ve,ot){let je,Ze,mt=0,kt,Jt;if(Y!==0)do je=e.dist_buf[mt],Ze=e.lc_buf[mt],mt++,je===0?Pe(Ze,Ve):(kt=so._length_code[Ze],Pe(kt+256+1,Ve),Jt=so.extra_lbits[kt],Jt!==0&&(Ze-=so.base_length[kt],ke(Ze,Jt)),je--,kt=so.d_code(je),Pe(kt,ot),Jt=so.extra_dbits[kt],Jt!==0&&(je-=so.base_dist[kt],ke(je,Jt)));while(mt<Y);Pe(256,Ve),W=Ve[256*2+1]}function Ft(){J>8?Ee(K):J>0&&we(K&255),K=0,J=0}function Te(Ve,ot,je){Ft(),W=8,je&&(Ee(ot),Ee(~ot)),e.pending_buf.set(c.subarray(Ve,Ve+ot),e.pending),e.pending+=ot}function Ae(Ve,ot,je){ke((SKe<<1)+(je?1:0),3),Te(Ve,ot,!0)}function ut(Ve,ot,je){let Ze,mt,kt=0;_>0?(V.build_tree(e),G.build_tree(e),kt=xe(),Ze=e.opt_len+3+7>>>3,mt=e.static_len+3+7>>>3,mt<=Ze&&(Ze=mt)):Ze=mt=ot+5,ot+4<=Ze&&Ve!=-1?Ae(Ve,ot,je):mt==Ze?(ke((RW<<1)+(je?1:0),3),Ht(Aa.static_ltree,Aa.static_dtree)):(ke((vKe<<1)+(je?1:0),3),_t(V.max_code+1,G.max_code+1,kt+1),Ht(M,F)),ye(),je&&Ft()}function ti(Ve){ut(C>=0?C:-1,w-C,Ve),C=w,t.flush_pending()}function Je(){let Ve,ot,je,Ze;do{if(Ze=u-R-w,Ze===0&&w===0&&R===0)Ze=o;else if(Ze==-1)Ze--;else if(w>=o+o-tu){c.set(c.subarray(o,o+o),0),D-=o,w-=o,C-=o,Ve=g,je=Ve;do ot=d[--je]&65535,d[je]=ot>=o?ot-o:0;while(--Ve!==0);Ve=o,je=Ve;do ot=f[--je]&65535,f[je]=ot>=o?ot-o:0;while(--Ve!==0);Ze+=o}if(t.avail_in===0)return;Ve=t.read_buf(c,w+R,Ze),R+=Ve,R>=ho&&(p=c[w]&255,p=(p<<x^c[w+1]&255)&A)}while(R<tu&&t.avail_in!==0)}function or(Ve){let ot=65535,je;for(ot>i-5&&(ot=i-5);;){if(R<=1){if(Je(),R===0&&Ve==0)return mf;if(R===0)break}if(w+=R,R=0,je=C+ot,(w===0||w>=je)&&(R=w-je,w=je,ti(!1),t.avail_out===0)||w-C>=o-tu&&(ti(!1),t.avail_out===0))return mf}return ti(Ve==4),t.avail_out===0?Ve==4?Gw:mf:Ve==4?o3:r3}function Qo(Ve){let ot=L,je=w,Ze,mt,kt=O,Jt=w>o-tu?w-(o-tu):0,$i=I,dr=a,$o=w+c3,Is=c[je+kt-1],ao=c[je+kt];O>=v&&(ot>>=2),$i>R&&($i=R);do if(Ze=Ve,!(c[Ze+kt]!=ao||c[Ze+kt-1]!=Is||c[Ze]!=c[je]||c[++Ze]!=c[je+1])){je+=2,Ze++;do;while(c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&c[++je]==c[++Ze]&&je<$o);if(mt=c3-($o-je),je=$o-c3,mt>kt){if(D=Ve,kt=mt,mt>=$i)break;Is=c[je+kt-1],ao=c[je+kt]}}while((Ve=f[Ve&dr]&65535)>Jt&&--ot!==0);return kt<=R?kt:R}function va(Ve){let ot=0,je;for(;;){if(R<tu){if(Je(),R<tu&&Ve==0)return mf;if(R===0)break}if(R>=ho&&(p=(p<<x^c[w+(ho-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w),ot!==0&&(w-ot&65535)<=o-tu&&b!=2&&(T=Qo(ot)),T>=ho)if(je=In(w-D,T-ho),R-=T,T<=N&&R>=ho){T--;do w++,p=(p<<x^c[w+(ho-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w;while(--T!==0);w++}else w+=T,T=0,p=c[w]&255,p=(p<<x^c[w+1]&255)&A;else je=In(0,c[w]&255),R--,w++;if(je&&(ti(!1),t.avail_out===0))return mf}return ti(Ve==4),t.avail_out===0?Ve==4?Gw:mf:Ve==4?o3:r3}function Io(Ve){let ot=0,je,Ze;for(;;){if(R<tu){if(Je(),R<tu&&Ve==0)return mf;if(R===0)break}if(R>=ho&&(p=(p<<x^c[w+(ho-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w),O=T,E=D,T=ho-1,ot!==0&&O<N&&(w-ot&65535)<=o-tu&&(b!=2&&(T=Qo(ot)),T<=5&&(b==1||T==ho&&w-D>4096)&&(T=ho-1)),O>=ho&&T<=O){Ze=w+R-ho,je=In(w-1-E,O-ho),R-=O-1,O-=2;do++w<=Ze&&(p=(p<<x^c[w+(ho-1)]&255)&A,ot=d[p]&65535,f[w&a]=d[p],d[p]=w);while(--O!==0);if(S=0,T=ho-1,w++,je&&(ti(!1),t.avail_out===0))return mf}else if(S!==0){if(je=In(0,c[w-1]&255),je&&ti(!1),w++,R--,t.avail_out===0)return mf}else S=1,w++,R--}return S!==0&&(je=In(0,c[w-1]&255),S=0),ti(Ve==4),t.avail_out===0?Ve==4?Gw:mf:Ve==4?o3:r3}function Dr(Ve){return Ve.total_in=Ve.total_out=0,Ve.msg=null,e.pending=0,e.pending_out=0,n=s3,r=0,se(),me(),0}e.deflateInit=function(Ve,ot,je,Ze,mt,kt){return Ze||(Ze=OW),mt||(mt=EKe),kt||(kt=0),Ve.msg=null,ot==-1&&(ot=6),mt<1||mt>TKe||Ze!=OW||je<9||je>15||ot<0||ot>9||kt<0||kt>2?-2:(Ve.dstate=e,s=je,o=1<<s,a=o-1,h=mt+7,g=1<<h,A=g-1,x=Math.floor((h+ho-1)/ho),c=new Uint8Array(o*2),f=[],d=[],q=1<<mt+6,e.pending_buf=new Uint8Array(q*4),i=q*4,e.dist_buf=new Uint16Array(q),e.lc_buf=new Uint8Array(q),_=ot,b=kt,Dr(Ve))},e.deflateEnd=function(){return n!=PW&&n!=s3&&n!=Ww?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==s3?-3:0)},e.deflateParams=function(Ve,ot,je){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||je<0||je>2?-2:(vd[_].func!=vd[ot].func&&Ve.total_in!==0&&(Ze=Ve.deflate(1)),_!=ot&&(_=ot,N=vd[_].max_lazy,v=vd[_].good_length,I=vd[_].nice_length,L=vd[_].max_chain),b=je,Ze)},e.deflateSetDictionary=function(Ve,ot,je){let Ze=je,mt,kt=0;if(!ot||n!=PW)return-2;if(Ze<ho)return 0;for(Ze>o-tu&&(Ze=o-tu,kt=je-Ze),c.set(ot.subarray(kt,kt+Ze),0),w=Ze,C=Ze,p=c[0]&255,p=(p<<x^c[1]&255)&A,mt=0;mt<=Ze-ho;mt++)p=(p<<x^c[mt+(ho-1)]&255)&A,f[mt&a]=d[p],d[p]=mt;return 0},e.deflate=function(Ve,ot){let je,Ze,mt,kt,Jt;if(ot>4||ot<0)return-2;if(!Ve.next_out||!Ve.next_in&&Ve.avail_in!==0||n==Ww&&ot!=4)return Ve.msg=i3[2- -2],-2;if(Ve.avail_out===0)return Ve.msg=i3[2- -5],-5;if(t=Ve,kt=r,r=ot,n==PW&&(Ze=OW+(s-8<<4)<<8,mt=(_-1&255)>>1,mt>3&&(mt=3),Ze|=mt<<6,w!==0&&(Ze|=bKe),Ze+=31-Ze%31,n=s3,Be(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return r=-1,0}else if(t.avail_in===0&&ot<=kt&&ot!=4)return t.msg=i3[2- -5],-5;if(n==Ww&&t.avail_in!==0)return Ve.msg=i3[2- -5],-5;if(t.avail_in!==0||R!==0||ot!=0&&n!=Ww){switch(Jt=-1,vd[_].func){case yue:Jt=or(ot);break;case a3:Jt=va(ot);break;case yA:Jt=Io(ot);break;default:}if((Jt==Gw||Jt==o3)&&(n=Ww),Jt==mf||Jt==Gw)return t.avail_out===0&&(r=-1),0;if(Jt==r3){if(ot==1)dn();else if(Ae(0,0,!1),ot==3)for(je=0;je<g;je++)d[je]=0;if(t.flush_pending(),t.avail_out===0)return r=-1,0}}return ot!=4?0:1}}function Aue(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Aue.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new wKe,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function DKe(e){let t=this,n=new Aue,i=IKe(e&&e.chunkSize?e.chunkSize:64*1024),r=0,o=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=o,t.append=function(a,c){let u,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(r),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(o)):h.push(o.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(A){f.set(A,p),p+=A.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(o.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function IKe(e){return e+5*(Math.floor(e/16383)+1)}var xue=DKe;var nu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],kue=1440,PKe=0,OKe=4,RKe=9,MKe=5,BKe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],LKe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],NKe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],FKe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],UKe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],VKe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],jg=15;function NW(){let e=this,t,n,i,r,o,s;function a(u,f,d,p,g,h,A,x,C,T,E){let S,w,D,R,O,L,N,_,b,v,I,M,F,k,V;v=0,O=d;do i[u[f+v]]++,v++,O--;while(O!==0);if(i[0]==d)return A[0]=-1,x[0]=0,0;for(_=x[0],L=1;L<=jg&&i[L]===0;L++);for(N=L,_<L&&(_=L),O=jg;O!==0&&i[O]===0;O--);for(D=O,_>O&&(_=O),x[0]=_,k=1<<L;L<O;L++,k<<=1)if((k-=i[L])<0)return-3;if((k-=i[O])<0)return-3;for(i[O]+=k,s[1]=L=0,v=1,F=2;--O!==0;)s[F]=L+=i[v],F++,v++;O=0,v=0;do(L=u[f+v])!==0&&(E[s[L]++]=O),v++;while(++O<d);for(d=s[D],s[0]=O=0,v=0,R=-1,M=-_,o[0]=0,I=0,V=0;N<=D;N++)for(S=i[N];S--!==0;){for(;N>M+_;){if(R++,M+=_,V=D-M,V=V>_?_:V,(w=1<<(L=N-M))>S+1&&(w-=S+1,F=N,L<V))for(;++L<V&&!((w<<=1)<=i[++F]);)w-=i[F];if(V=1<<L,T[0]+V>kue)return-3;o[R]=I=T[0],T[0]+=V,R!==0?(s[R]=O,r[0]=L,r[1]=_,L=O>>>M-_,r[2]=I-o[R-1]-L,C.set(r,(o[R-1]+L)*3)):A[0]=I}for(r[1]=N-M,v>=d?r[0]=128+64:E[v]<p?(r[0]=E[v]<256?0:32+64,r[2]=E[v++]):(r[0]=h[E[v]-p]+16+64,r[2]=g[E[v++]-p]),w=1<<N-M,L=O>>>M;L<V;L+=w)C.set(r,(I+L)*3);for(L=1<<N-1;O&L;L>>>=1)O^=L;for(O^=L,b=(1<<M)-1;(O&b)!=s[R];)R--,M-=_,b=(1<<M)-1}return k!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(jg+1),r=[],o=new Int32Array(jg),s=new Int32Array(jg+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<jg+1;f++)i[f]=0;for(f=0;f<3;f++)r[f]=0;o.set(i.subarray(0,jg),0),s.set(i.subarray(0,jg+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let h;return c(19),t[0]=0,h=a(u,0,19,19,null,null,d,f,p,t,n),h==-3?g.msg="oversubscribed dynamic bit lengths tree":(h==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(u,f,d,p,g,h,A,x,C){let T;return c(288),t[0]=0,T=a(d,0,u,257,NKe,FKe,h,p,x,t,n),T!=0||p[0]===0?(T==-3?C.msg="oversubscribed literal/length tree":T!=-4&&(C.msg="incomplete literal/length tree",T=-3),T):(c(288),T=a(d,u,f,0,UKe,VKe,A,g,x,t,n),T!=0||g[0]===0&&u>257?(T==-3?C.msg="oversubscribed distance tree":T==-5?(C.msg="incomplete distance tree",T=-3):T!=-4&&(C.msg="empty distance tree with lengths",T=-3),T):0)}}NW.inflate_trees_fixed=function(e,t,n,i){return e[0]=RKe,t[0]=MKe,n[0]=BKe,i[0]=LKe,0};var f3=0,Cue=1,Tue=2,Eue=3,bue=4,Sue=5,vue=6,MW=7,wue=8,d3=9;function kKe(){let e=this,t,n=0,i,r=0,o=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,h=0;function A(x,C,T,E,S,w,D,R){let O,L,N,_,b,v,I,M,F,k,V,G,U,q,Y,Q;I=R.next_in_index,M=R.avail_in,b=D.bitb,v=D.bitk,F=D.write,k=F<D.read?D.read-F-1:D.end-F,V=nu[x],G=nu[C];do{for(;v<20;)M--,b|=(R.read_byte(I++)&255)<<v,v+=8;if(O=b&V,L=T,N=E,Q=(N+O)*3,(_=L[Q])===0){b>>=L[Q+1],v-=L[Q+1],D.win[F++]=L[Q+2],k--;continue}do{if(b>>=L[Q+1],v-=L[Q+1],_&16){for(_&=15,U=L[Q+2]+(b&nu[_]),b>>=_,v-=_;v<15;)M--,b|=(R.read_byte(I++)&255)<<v,v+=8;O=b&G,L=S,N=w,Q=(N+O)*3,_=L[Q];do if(b>>=L[Q+1],v-=L[Q+1],_&16){for(_&=15;v<_;)M--,b|=(R.read_byte(I++)&255)<<v,v+=8;if(q=L[Q+2]+(b&nu[_]),b>>=_,v-=_,k-=U,F>=q)Y=F-q,F-Y>0&&2>F-Y?(D.win[F++]=D.win[Y++],D.win[F++]=D.win[Y++],U-=2):(D.win.set(D.win.subarray(Y,Y+2),F),F+=2,Y+=2,U-=2);else{Y=F-q;do Y+=D.end;while(Y<0);if(_=D.end-Y,U>_){if(U-=_,F-Y>0&&_>F-Y)do D.win[F++]=D.win[Y++];while(--_!==0);else D.win.set(D.win.subarray(Y,Y+_),F),F+=_,Y+=_,_=0;Y=0}}if(F-Y>0&&U>F-Y)do D.win[F++]=D.win[Y++];while(--U!==0);else D.win.set(D.win.subarray(Y,Y+U),F),F+=U,Y+=U,U=0;break}else if(!(_&64))O+=L[Q+2],O+=b&nu[_],Q=(N+O)*3,_=L[Q];else return R.msg="invalid distance code",U=R.avail_in-M,U=v>>3<U?v>>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,-3;while(!0);break}if(_&64)return _&32?(U=R.avail_in-M,U=v>>3<U?v>>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,1):(R.msg="invalid literal/length code",U=R.avail_in-M,U=v>>3<U?v>>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,-3);if(O+=L[Q+2],O+=b&nu[_],Q=(N+O)*3,(_=L[Q])===0){b>>=L[Q+1],v-=L[Q+1],D.win[F++]=L[Q+2],k--;break}}while(!0)}while(k>=258&&M>=10);return U=R.avail_in-M,U=v>>3<U?v>>3:U,M+=U,I-=U,v-=U<<3,D.bitb=b,D.bitk=v,R.avail_in=M,R.total_in+=I-R.next_in_index,R.next_in_index=I,D.write=F,0}e.init=function(x,C,T,E,S,w){t=f3,u=x,f=C,d=T,p=E,g=S,h=w,i=null},e.proc=function(x,C,T){let E,S,w,D=0,R=0,O=0,L,N,_,b;for(O=C.next_in_index,L=C.avail_in,D=x.bitb,R=x.bitk,N=x.write,_=N<x.read?x.read-N-1:x.end-N;;)switch(t){case f3:if(_>=258&&L>=10&&(x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,T=A(u,f,d,p,g,h,x,C),O=C.next_in_index,L=C.avail_in,D=x.bitb,R=x.bitk,N=x.write,_=N<x.read?x.read-N-1:x.end-N,T!=0)){t=T==1?MW:d3;break}o=u,i=d,r=p,t=Cue;case Cue:for(E=o;R<E;){if(L!==0)T=0;else return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);L--,D|=(C.read_byte(O++)&255)<<R,R+=8}if(S=(r+(D&nu[E]))*3,D>>>=i[S+1],R-=i[S+1],w=i[S],w===0){s=i[S+2],t=vue;break}if(w&16){a=w&15,n=i[S+2],t=Tue;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}if(w&32){t=MW;break}return t=d3,C.msg="invalid literal/length code",T=-3,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);case Tue:for(E=a;R<E;){if(L!==0)T=0;else return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);L--,D|=(C.read_byte(O++)&255)<<R,R+=8}n+=D&nu[E],D>>=E,R-=E,o=f,i=g,r=h,t=Eue;case Eue:for(E=o;R<E;){if(L!==0)T=0;else return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);L--,D|=(C.read_byte(O++)&255)<<R,R+=8}if(S=(r+(D&nu[E]))*3,D>>=i[S+1],R-=i[S+1],w=i[S],w&16){a=w&15,c=i[S+2],t=bue;break}if(!(w&64)){o=w,r=S/3+i[S+2];break}return t=d3,C.msg="invalid distance code",T=-3,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);case bue:for(E=a;R<E;){if(L!==0)T=0;else return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);L--,D|=(C.read_byte(O++)&255)<<R,R+=8}c+=D&nu[E],D>>=E,R-=E,t=Sue;case Sue:for(b=N-c;b<0;)b+=x.end;for(;n!==0;){if(_===0&&(N==x.end&&x.read!==0&&(N=0,_=N<x.read?x.read-N-1:x.end-N),_===0&&(x.write=N,T=x.inflate_flush(C,T),N=x.write,_=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,_=N<x.read?x.read-N-1:x.end-N),_===0)))return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);x.win[N++]=x.win[b++],_--,b==x.end&&(b=0),n--}t=f3;break;case vue:if(_===0&&(N==x.end&&x.read!==0&&(N=0,_=N<x.read?x.read-N-1:x.end-N),_===0&&(x.write=N,T=x.inflate_flush(C,T),N=x.write,_=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,_=N<x.read?x.read-N-1:x.end-N),_===0)))return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);T=0,x.win[N++]=s,_--,t=f3;break;case MW:if(R>7&&(R-=8,L++,O--),x.write=N,T=x.inflate_flush(C,T),N=x.write,_=N<x.read?x.read-N-1:x.end-N,x.read!=x.write)return x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);t=wue;case wue:return T=1,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);case d3:return T=-3,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T);default:return T=-2,x.bitb=D,x.bitk=R,C.avail_in=L,C.total_in+=O-C.next_in_index,C.next_in_index=O,x.write=N,x.inflate_flush(C,T)}},e.free=function(){}}var Due=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],SE=0,BW=1,Iue=2,Pue=3,Oue=4,Rue=5,m3=6,h3=7,Mue=8,AA=9;function zKe(e,t){let n=this,i=SE,r=0,o=0,s=0,a,c=[0],u=[0],f=new kKe,d=0,p=new Int32Array(kue*3),g=0,h=new NW;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(A,x){x&&(x[0]=g),i==m3&&f.free(A),i=SE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(A,x){let C,T,E;return T=A.next_out_index,E=n.read,C=(E<=n.write?n.write:n.end)-E,C>A.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C,E==n.end&&(E=0,n.write==n.end&&(n.write=0),C=n.write-E,C>A.avail_out&&(C=A.avail_out),C!==0&&x==-5&&(x=0),A.avail_out-=C,A.total_out+=C,A.next_out.set(n.win.subarray(E,E+C),T),T+=C,E+=C),A.next_out_index=T,n.read=E,x},n.proc=function(A,x){let C,T,E,S,w,D,R,O;for(S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,R=D<n.read?n.read-D-1:n.end-D;;){let L,N,_,b,v,I,M,F;switch(i){case SE:for(;E<3;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}switch(C=T&7,d=C&1,C>>>1){case 0:T>>>=3,E-=3,C=E&7,T>>>=C,E-=C,i=BW;break;case 1:L=[],N=[],_=[[]],b=[[]],NW.inflate_trees_fixed(L,N,_,b),f.init(L[0],N[0],_[0],0,b[0],0),T>>>=3,E-=3,i=m3;break;case 2:T>>>=3,E-=3,i=Pue;break;case 3:return T>>>=3,E-=3,i=AA,A.msg="invalid block type",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x)}break;case BW:for(;E<32;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if((~T>>>16&65535)!=(T&65535))return i=AA,A.msg="invalid stored block lengths",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);r=T&65535,T=E=0,i=r!==0?Iue:d!==0?h3:SE;break;case Iue:if(w===0||R===0&&(D==n.end&&n.read!==0&&(D=0,R=D<n.read?n.read-D-1:n.end-D),R===0&&(n.write=D,x=n.inflate_flush(A,x),D=n.write,R=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,R=D<n.read?n.read-D-1:n.end-D),R===0)))return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);if(x=0,C=r,C>w&&(C=w),C>R&&(C=R),n.win.set(A.read_buf(S,C),D),S+=C,w-=C,D+=C,R-=C,(r-=C)!==0)break;i=d!==0?h3:SE;break;case Pue:for(;E<14;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(o=C=T&16383,(C&31)>29||(C>>5&31)>29)return i=AA,A.msg="too many length or distance symbols",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(O=0;O<C;O++)a[O]=0;T>>>=14,E-=14,s=0,i=Oue;case Oue:for(;s<4+(o>>>10);){for(;E<3;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}a[Due[s++]]=T&7,T>>>=3,E-=3}for(;s<19;)a[Due[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,A),C!=0)return x=C,x==-3&&(a=null,i=AA),n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);s=0,i=Rue;case Rue:for(;C=o,!(s>=258+(C&31)+(C>>5&31));){let k,V;for(C=c[0];E<C;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(C=p[(u[0]+(T&nu[C]))*3+1],V=p[(u[0]+(T&nu[C]))*3+2],V<16)T>>>=C,E-=C,a[s++]=V;else{for(O=V==18?7:V-14,k=V==18?11:3;E<C+O;){if(w!==0)x=0;else return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);w--,T|=(A.read_byte(S++)&255)<<E,E+=8}if(T>>>=C,E-=C,k+=T&nu[O],T>>>=O,E-=O,O=s,C=o,O+k>258+(C&31)+(C>>5&31)||V==16&&O<1)return a=null,i=AA,A.msg="invalid bit length repeat",x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);V=V==16?a[O-1]:0;do a[O++]=V;while(--k!==0);s=O}}if(u[0]=-1,v=[],I=[],M=[],F=[],v[0]=9,I[0]=6,C=o,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,v,I,M,F,p,A),C!=0)return C==-3&&(a=null,i=AA),x=C,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);f.init(v[0],I[0],p,M[0],p,F[0]),i=m3;case m3:if(n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,(x=f.proc(n,A,x))!=1)return n.inflate_flush(A,x);if(x=0,f.free(A),S=A.next_in_index,w=A.avail_in,T=n.bitb,E=n.bitk,D=n.write,R=D<n.read?n.read-D-1:n.end-D,d===0){i=SE;break}i=h3;case h3:if(n.write=D,x=n.inflate_flush(A,x),D=n.write,R=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);i=Mue;case Mue:return x=1,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);case AA:return x=-3,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x);default:return x=-2,n.bitb=T,n.bitk=E,A.avail_in=w,A.total_in+=S-A.next_in_index,A.next_in_index=S,n.write=D,n.inflate_flush(A,x)}}},n.free=function(A){n.reset(A,null),n.win=null,p=null},n.set_dictionary=function(A,x,C){n.win.set(A.subarray(x,x+C),0),n.read=n.write=C},n.sync_point=function(){return i==BW?1:0}}var HKe=32,GKe=8,WKe=0,Bue=1,Lue=2,Nue=3,Fue=4,Uue=5,LW=6,jw=7,Vue=12,Yg=13,jKe=[0,0,255,255];function YKe(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=jw,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new zKe(n,1<<i),t(n),0)},e.inflate=function(n,i){let r,o;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==OKe?-5:0,r=-5;;)switch(s.mode){case WKe:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=GKe){s.mode=Yg,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Yg,n.msg="invalid win size",s.marker=5;break}s.mode=Bue;case Bue:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,o=n.read_byte(n.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=Yg,n.msg="incorrect header check",s.marker=5;break}if(!(o&HKe)){s.mode=jw;break}s.mode=Lue;case Lue:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Nue;case Nue:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Fue;case Fue:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Uue;case Uue:return n.avail_in===0?r:(r=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=LW,2);case LW:return s.mode=Yg,n.msg="need dictionary",s.marker=0,-2;case jw:if(r=s.blocks.proc(n,r),r==-3){s.mode=Yg,s.marker=0;break}if(r==0&&(r=i),r!=1)return r;r=i,s.blocks.reset(n,s.was),s.mode=Vue;case Vue:return n.avail_in=0,1;case Yg:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,r){let o=0,s=r;if(!n||!n.istate||n.istate.mode!=LW)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,o=r-s),a.blocks.set_dictionary(i,o,s),a.mode=jw,0},e.inflateSync=function(n){let i,r,o,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Yg&&(c.mode=Yg,c.marker=0),(i=n.avail_in)===0)return-5;for(r=n.next_in_index,o=c.marker;i!==0&&o<4;)n.read_byte(r)==jKe[o]?o++:n.read_byte(r)!==0?o=0:o=4-o,r++,i--;return n.total_in+=r-n.next_in_index,n.next_in_index=r,n.avail_in=i,c.marker=o,o!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=jw,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function zue(){}zue.prototype={inflateInit:function(e){let t=this;return t.istate=new YKe,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function qKe(e){let t=this,n=new zue,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,r=PKe,o=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=o,t.append=function(a,c){let u=[],f,d,p=0,g=0,h=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(r),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(o)):u.push(o.slice(0,n.next_out_index))),h+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(h),u.forEach(function(A){d.set(A,g),g+=A.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var Hue=qKe;var XKe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},ll=Object.assign({},XKe);function p3(){return ll}function vE(e){if(e.baseURL!==void 0&&(ll.baseURL=e.baseURL),e.chunkSize!==void 0&&(ll.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(ll.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(ll.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(ll.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(ll.Deflate=e.Deflate),e.Inflate!==void 0&&(ll.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");ll.workerScripts||(ll.workerScripts={}),ll.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");ll.workerScripts||(ll.workerScripts={}),ll.workerScripts.inflate=e.workerScripts.inflate}}}var Gue=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Gue[e]=t}var FW=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,r=t.length|0;i<r;i++)n=n>>>8^Gue[(n^t[i])&255];this.crc=n}get(){return~this.crc}},qg=FW;var Yw=KKe;function KKe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var ul={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ul.getPartial(n);return i===32?e.concat(t):ul._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+ul.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=ul.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=ul.getPartial(r);return i.push(ul.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},UW={bytes:{fromBits(e){let n=ul.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)o&3||(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(ul.partial(8*(n&3),i)),t}}},VW={};VW.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};VW.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=UW.utf8String.toBits(e));let n=t._buffer=ul.concat(t._buffer,e),i=t._length,r=t._length=i+ul.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=ul.concat(t,[ul.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var kW={};kW.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],A=4,x,C,T;for(let E=0;E<i;E++)x=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[h&255]^n[A],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^u[d&255]^n[A+1],T=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^u[p&255]^n[A+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[A+3],A+=4,d=x,p=C,g=T;for(let E=0;E<4;E++)r[t?3&-E:E]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[A++],x=d,d=p,p=g,g=h,h=x;return r}};var zW={};zW.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=ul.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return ul.clamp(t,r)}};var HW={};HW.hmacSha1=class{constructor(e){let t=this,n=t._hash=VW.sha1,i=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}};var DE="Invalid pasword",wE=16,JKe="raw",Wue={name:"PBKDF2"},ZKe={name:"HMAC"},QKe="SHA-1",$Ke=Object.assign({hash:ZKe},Wue),eJe=Object.assign({iterations:1e3,hash:{name:QKe}},Wue),tJe=["deriveBits"],Xw=[8,12,16],qw=[16,24,32],Xg=10,jue=[0,0,0,0],Km=UW.bytes,Yue=kW.aes,que=zW.ctrGladman,Xue=HW.hmacSha1,_3=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let r=iu(t,0,Xw[n.strength]+2);await nJe(n,r,n.password),n.password=null,n.aesCtrGladman=new que(new Yue(n.keys.key),Array.from(jue)),n.hmac=new Xue(n.keys.authentication),t=iu(t,Xw[n.strength]+2)}let i=new Uint8Array(t.length-Xg-(t.length-Xg)%wE);return Kue(n,t,i,0,Xg,!0)}flush(){let t=this,n=t.pendingInput,i=iu(n,0,n.length-Xg),r=iu(n,n.length-Xg),o=new Uint8Array(0);if(i.length){let a=Km.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);o=Km.fromBits(c)}let s=!0;if(t.signed){let a=iu(Km.fromBits(t.hmac.digest()),0,Xg);for(let c=0;c<Xg;c++)a[c]!=r[c]&&(s=!1)}return{valid:s,data:o}}},g3=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await iJe(n,n.password),n.password=null,n.aesCtrGladman=new que(new Yue(n.keys.key),Array.from(jue)),n.hmac=new Xue(n.keys.authentication));let r=new Uint8Array(i.length+t.length-t.length%wE);return r.set(i,0),Kue(n,t,r,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let r=t.aesCtrGladman.update(Km.toBits(t.pendingInput));t.hmac.update(r),n=Km.fromBits(r)}let i=iu(Km.fromBits(t.hmac.digest()),0,Xg);return{data:GW(n,i),signature:i}}};function Kue(e,t,n,i,r,o){let s=t.length-r;e.pendingInput.length&&(t=GW(e.pendingInput,t),n=rJe(n,s-s%wE));let a;for(a=0;a<=s-wE;a+=wE){let c=Km.toBits(iu(t,a,a+wE));o&&e.hmac.update(c);let u=e.aesCtrGladman.update(c);o||e.hmac.update(u),n.set(Km.fromBits(u),a+i)}return e.pendingInput=iu(t,a),n}async function nJe(e,t,n){await Jue(e,n,iu(t,0,Xw[e.strength]));let i=iu(t,Xw[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new Error(DE)}async function iJe(e,t){let n=crypto.getRandomValues(new Uint8Array(Xw[e.strength]));return await Jue(e,t,n),GW(n,e.keys.passwordVerification)}async function Jue(e,t,n){let i=Yw(t),r=await crypto.subtle.importKey(JKe,i,$Ke,!1,tJe),o=await crypto.subtle.deriveBits(Object.assign({salt:n},eJe),r,8*(qw[e.strength]*2+2)),s=new Uint8Array(o);e.keys={key:Km.toBits(iu(s,0,qw[e.strength])),authentication:Km.toBits(iu(s,qw[e.strength],qw[e.strength]*2)),passwordVerification:iu(s,qw[e.strength]*2)}}function GW(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function rJe(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function iu(e,t,n){return e.subarray(t,n)}var IE=12,y3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),efe(i,t)}append(t){let n=this;if(n.password){let i=Zue(n,t.subarray(0,IE));if(n.password=null,i[IE-1]!=n.passwordVerification)throw new Error(DE);t=t.subarray(IE)}return Zue(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},A3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),efe(i,t)}append(t){let n=this,i,r;if(n.password){n.password=null;let o=crypto.getRandomValues(new Uint8Array(IE));o[IE-1]=n.passwordVerification,i=new Uint8Array(t.length+o.length),i.set(Que(n,o),0),r=IE}else i=new Uint8Array(t.length),r=0;return i.set(Que(n,t),r),i}flush(){return{data:new Uint8Array(0)}}};function Zue(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=tfe(e)^t[i],WW(e,n[i]);return n}function Que(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=tfe(e)^t[i],WW(e,t[i]);return n}function efe(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new qg(e.keys[0]),e.crcKey2=new qg(e.keys[2]);for(let n=0;n<t.length;n++)WW(e,t.charCodeAt(n))}function WW(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=$ue(e.keys[1]+nfe(e.keys[0])),e.keys[1]=$ue(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function tfe(e){let t=e.keys[2]|2;return nfe(Math.imul(t,t^1)>>>8)}function nfe(e){return e&255}function $ue(e){return e&4294967295}var C3="deflate",T3="inflate",x3="Invalid signature",jW=class{constructor(t,{signature:n,password:i,signed:r,compressed:o,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:r,compressed:o,inflate:o&&new t({chunkSize:u}),crc32:r&&new qg,zipCrypto:s,decrypt:f&&s?new y3(i,a):new _3(i,r,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let r=t.decrypt.flush();if(!r.valid)throw new Error(x3);i=r.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let r=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),r.setUint32(0,n),t.signature!=r.getUint32(0,!1))throw new Error(x3)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},YW=class{constructor(t,{encrypted:n,signed:i,compressed:r,level:o,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:r,deflate:r&&new t({level:o||5,chunkSize:f}),crc32:i&&new qg,zipCrypto:s,encrypt:n&&s?new A3(a,c):new g3(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let r=t.encrypt.flush();n=r.signature;let o=new Uint8Array(i.length+r.data.length);o.set(i,0),o.set(r.data,i.length),i=o}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function ife(e,t,n){if(t.codecType.startsWith(C3))return new YW(e,t,n);if(t.codecType.startsWith(T3))return new jW(e,t,n)}var rfe="init",ofe="append",qW="flush",oJe="message",sfe=!0,E3=(e,t,n,i,r,o,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,r(e)}}),o?aJe(e,i):sJe(e,i));function sJe(e,t){let n=ife(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(r){throw e.onTaskFinished(),r}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function aJe(e,t){let n,i={type:"module"};if(!e.interface){if(!sfe)e.worker=r(i,t.baseURL);else try{e.worker=r({},t.baseURL)}catch{sfe=!1,e.worker=r(i,t.baseURL)}e.worker.addEventListener(oJe,a,!1),e.interface={append(c){return o({type:ofe,data:c})},flush(){return o({type:qW})},abort(){e.onTaskFinished()}}}return e.interface;function r(c,u){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,u)}catch{d=f}return new Worker(d,c)}async function o(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:rfe,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==rfe||d==qW||d==ofe){let p=u.data;d==qW?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var xA=[],XW=[];function b3(e,t,n){let r=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),o=r&&n.workerScripts?n.workerScripts[t.codecType]:[];if(xA.length<n.maxWorkers){let a={};return xA.push(a),E3(a,e,t,n,s,r,o)}else{let a=xA.find(c=>!c.busy);return a?(afe(a),E3(a,e,t,n,s,r,o)):new Promise(c=>XW.push({resolve:c,codecConstructor:e,options:t,webWorker:r,scripts:o}))}function s(a){if(XW.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=XW.splice(0,1);c(E3(a,u,f,n,s,d,p))}else a.worker?(afe(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{xA=xA.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):xA=xA.filter(c=>c!=a)}}function afe(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var lfe="Abort error";async function S3(e,t,n,i,r,o,s){let a=Math.max(o.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal;if(u<r){KW(d,e);let p=await t.readUint8Array(u+i,Math.min(a,r-u)),g=p.length;KW(d,e);let h=await e.append(p);if(KW(d,e),f+=await cfe(n,h),s.onprogress)try{s.onprogress(u+g,r)}catch{}return c(u+a,f)}else{let p=await e.flush();return f+=await cfe(n,p.data),{signature:p.signature,length:f}}}}function KW(e,t){if(e&&e.aborted)throw t.abort(),new Error(lfe)}async function cfe(e,t){return t.length&&await e.writeUint8Array(t),t.length}var JW="text/plain";var v3=class{constructor(){this.size=0}init(){this.initialized=!0}},w3=class extends v3{},Kw=class extends v3{writeUint8Array(t){this.size+=t.length}},D3=class extends w3{constructor(t){super(),this.blobReader=new CA(new Blob([t],{type:JW}))}async init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}async readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},I3=class extends Kw{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:JW})}async writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:JW})}getData(){if(this.blob.text)return this.blob.text();{let t=new FileReader;return new Promise((n,i)=>{t.onload=r=>n(r.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var P3=class extends Kw{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}async writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,r=this.pending.length;for(this.pending="",n=0;n<Math.floor((r+t.length)/3)*3-r;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},CA=class extends w3{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(new Uint8Array(s.target.result)),i.onerror=()=>o(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},PE=class extends Kw{constructor(t){super(),this.contentType=t,this.arrayBuffers=[]}async writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.blob=new Blob(this.arrayBuffers,{type:this.contentType})),this.blob}};var OE="/",ZW=new Date(2107,11,31),QW=new Date(1980,0,1);var cJe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),ufe=e=>{let t="";for(let n=0;n<e.length;n++)t+=cJe[e[n]];return t};var O3=lJe;async function lJe(e,t){if(t&&t.trim().toLowerCase()=="cp437")return ufe(e);if(typeof TextDecoder>"u"){let n=new FileReader;return new Promise((i,r)=>{n.onload=o=>i(o.target.result),n.onerror=()=>r(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var uJe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],Fp=class{constructor(t){uJe.forEach(n=>this[n]=t[n])}};var t7="File format is not recognized",hJe="End of central directory not found",pJe="End of Zip64 central directory not found",_Je="End of Zip64 central directory locator not found",gJe="Central directory header not found",yJe="Local file header not found",AJe="Zip64 extra field not found",xJe="File contains encrypted entry",CJe="Encryption method not supported",ffe="Compression method not supported",dfe="utf-8",mfe="cp437",hfe=["uncompressedSize","compressedSize","offset"],k3=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:p3()})}async getEntries(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(t7);let r=await vJe(i,101010256,i.size,22,65535*16);if(!r)throw new Error(hJe);let o=Ka(r),s=Ks(o,12),a=Ks(o,16),c=ru(o,8),u=0;if(a==4294967295||s==4294967295||c==65535){let h=await Kg(i,r.offset-20,20),A=Ka(h);if(Ks(A,0)!=117853008)throw new Error(pJe);a=R3(A,8);let x=await Kg(i,a,56),C=Ka(x),T=r.offset-20-56;if(Ks(C,0)!=101075792&&a!=T){let E=a;a=T,u=a-E,x=await Kg(i,a,56),C=Ka(x)}if(Ks(C,0)!=101075792)throw new Error(_Je);c=R3(C,32),s=R3(C,40),a-=s}if(a<0||a>=i.size)throw new Error(t7);let f=0,d=await Kg(i,a,s),p=Ka(d);if(s){let h=r.offset-s;if(Ks(p,f)!=33639248&&a!=h){let A=a;a=h,u=a-A,d=await Kg(i,a,s),p=Ka(d)}}if(a<0||a>=i.size)throw new Error(t7);let g=[];for(let h=0;h<c;h++){let A=new i7(i,n.config,n.options);if(Ks(p,f)!=33639248)throw new Error(gJe);_fe(A,p,f+6);let x=!!A.bitFlag.languageEncodingFlag,C=f+46,T=C+A.filenameLength,E=T+A.extraFieldLength,S=ru(p,f+4),w=(S&0)==0;Object.assign(A,{versionMadeBy:S,msDosCompatible:w,compressedSize:0,uncompressedSize:0,commentLength:ru(p,f+32),directory:w&&(ME(p,f+38)&16)==16,offset:Ks(p,f+42)+u,internalFileAttribute:Ks(p,f+34),externalFileAttribute:Ks(p,f+38),rawFilename:d.subarray(C,T),filenameUTF8:x,commentUTF8:x,rawExtraField:d.subarray(T,E)});let D=E+A.commentLength;A.rawComment=d.subarray(E,D);let R=RE(n,t,"filenameEncoding"),O=RE(n,t,"commentEncoding"),[L,N]=await Promise.all([O3(A.rawFilename,A.filenameUTF8?dfe:R||mfe),O3(A.rawComment,A.commentUTF8?dfe:O||mfe)]);A.filename=L,A.comment=N,!A.directory&&A.filename.endsWith(OE)&&(A.directory=!0),await gfe(A,A,p,f+6);let _=new Fp(A);if(_.getData=(b,v)=>A.getData(b,_,v),g.push(_),f=D,t.onprogress)try{t.onprogress(h+1,c,new Fp(A))}catch{}}return g}async close(){}};var i7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let r=this,{reader:o,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=r,h=r.localDirectory={};o.initialized||await o.init();let A=await Kg(o,s,30),x=Ka(A),C=RE(r,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(ffe);if(c!=0&&c!=8)throw new Error(ffe);if(Ks(x,0)!=67324752)throw new Error(yJe);_fe(h,x,4),A=await Kg(o,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=A.subarray(30+h.filenameLength),await gfe(r,h,x,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let T=r.encrypted&&h.encrypted,E=T&&!a;if(T){if(!E&&a.strength===void 0)throw new Error(CJe);if(!C)throw new Error(xJe)}let S=await b3(u.Inflate,{codecType:T3,password:C,zipCrypto:E,encryptionStrength:a&&a.strength,signed:RE(r,i,"checkSignature"),passwordVerification:E&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:T,useWebWorkers:RE(r,i,"useWebWorkers")},u);t.initialized||await t.init();let w=RE(r,i,"signal"),D=s+30+h.filenameLength+h.extraFieldLength;return await S3(S,o,t,D,g,u,{onprogress:i.onprogress,signal:w}),t.getData()}};function _fe(e,t,n){let i=e.rawBitFlag=ru(t,n+2),r=(i&1)==1,o=Ks(t,n+6);Object.assign(e,{encrypted:r,version:ru(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:wJe(o),filenameLength:ru(t,n+22),extraFieldLength:ru(t,n+24)})}async function gfe(e,t,n,i){let r=t.rawExtraField,o=t.extraField=new Map,s=Ka(new Uint8Array(r)),a=0;try{for(;a<r.length;){let A=ru(s,a),x=ru(s,a+2);o.set(A,{type:A,data:r.slice(a+4,a+4+x)}),a+=4+x}}catch{}let c=ru(n,i+4);t.signature=Ks(n,i+10),t.uncompressedSize=Ks(n,i+18),t.compressedSize=Ks(n,i+14);let u=o.get(1);u&&(TJe(u,t),t.extraFieldZip64=u);let f=o.get(28789);f&&(await pfe(f,"filename","rawFilename",t,e),t.extraFieldUnicodePath=f);let d=o.get(25461);d&&(await pfe(d,"comment","rawComment",t,e),t.extraFieldUnicodeComment=d);let p=o.get(39169);p?(EJe(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let g=o.get(10);g&&(bJe(g,t),t.extraFieldNTFS=g);let h=o.get(21589);h&&(SJe(h,t),t.extraFieldExtendedTimestamp=h)}function TJe(e,t){t.zip64=!0;let n=Ka(e.data);e.values=[];for(let r=0;r<Math.floor(e.data.length/8);r++)e.values.push(R3(n,0+r*8));let i=hfe.filter(r=>t[r]==4294967295);for(let r=0;r<i.length;r++)e[i[r]]=e.values[r];hfe.forEach(r=>{if(t[r]==4294967295)if(e[r]!==void 0)t[r]=e[r];else throw new Error(AJe)})}async function pfe(e,t,n,i,r){let o=Ka(e.data);e.version=ME(o,0),e.signature=Ks(o,1);let s=new qg;s.append(r[n]);let a=Ka(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await O3(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==Ks(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function EJe(e,t,n){let i=Ka(e.data);e.vendorVersion=ME(i,0),e.vendorId=ME(i,2);let r=ME(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=ru(i,5)}function bJe(e,t){let n=Ka(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=ru(n,i),s=ru(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(r&&r.length==24){let o=Ka(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=n7(s),f=n7(a),d=n7(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function SJe(e,t){let n=Ka(e.data),i=ME(n,0),r=[],o=[];(i&1)==1&&(r.push("lastModDate"),o.push("rawLastModDate")),(i&2)==2&&(r.push("lastAccessDate"),o.push("rawLastAccessDate")),(i&4)==4&&(r.push("creationDate"),o.push("rawCreationDate"));let s=1;r.forEach((a,c)=>{if(e.data.length>=s+4){let u=Ks(n,s);t[a]=e[a]=new Date(u*1e3);let f=o[c];e[f]=u}s+=4})}async function vJe(e,t,n,i,r){let o=new Uint8Array(4),s=Ka(o);DJe(s,0,t);let a=i+r;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Kg(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==o[0]&&d[p+1]==o[1]&&d[p+2]==o[2]&&d[p+3]==o[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function RE(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function wJe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function n7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function ME(e,t){return e.getUint8(t)}function ru(e,t){return e.getUint16(t,!0)}function Ks(e,t){return e.getUint32(t,!0)}function R3(e,t){return Number(e.getBigUint64(t,!0))}function DJe(e,t,n){e.setUint32(t,n,!0)}function Ka(e){return new DataView(e.buffer)}function Kg(e,t,n){return e.readUint8Array(t,n)}var MJe="File already exists",BJe="Zip file comment exceeds 64KB",LJe="File entry comment exceeds 64KB",NJe="File entry name exceeds 64KB",xfe="Version exceeds 65535",FJe="The strength must equal 1, 2, or 3",UJe="Extra field type exceeds 65535",VJe="Extra field data exceeds 64KB",p7="Zip64 is not supported",Cfe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Tfe=24,m7=0,G3=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:p3(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[]})}async add(t="",n,i={}){let r=this;if(m7<r.config.maxWorkers){m7++;try{return await kJe(r,t,n,i)}finally{m7--;let o=r.pendingEntries.shift();o&&r.add(o.name,o.reader,o.options).then(o.resolve).catch(o.reject)}}else return new Promise((o,s)=>r.pendingEntries.push({name:t,reader:n,options:i,resolve:o,reject:s}))}async close(t=new Uint8Array(0),n={}){return await GJe(this,t,n),this.writer.getData()}};async function kJe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(OE)?t+=OE:i.directory=t.endsWith(OE),e.files.has(t))throw new Error(MJe);let r=Yw(t);if(r.length>65535)throw new Error(NJe);let o=i.comment||"",s=Yw(o);if(s.length>65535)throw new Error(LJe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(xfe);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(xfe);let u=xa(e,i,"lastModDate")||new Date,f=xa(e,i,"lastAccessDate"),d=xa(e,i,"creationDate"),p=xa(e,i,"password"),g=xa(e,i,"encryptionStrength")||3,h=xa(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(FJe);let A=new Uint8Array(0),x=i.extraField;if(x){let F=0,k=0;x.forEach(V=>F+=4+V.length),A=new Uint8Array(F),x.forEach((V,G)=>{if(G>65535)throw new Error(UJe);if(V.length>65535)throw new Error(VJe);Zs(A,new Uint16Array([G]),k),Zs(A,new Uint16Array([V.length]),k+2),Zs(A,V,k+4),k+=4+V.length})}let C=xa(e,i,"extendedTimestamp");C===void 0&&(C=!0);let T=0,E=xa(e,i,"keepOrder");E===void 0&&(E=!0);let S=0,w=xa(e,i,"msDosCompatible");w===void 0&&(w=!0);let D=xa(e,i,"internalFileAttribute")||0,R=xa(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,T=jJe(S));let O=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||T>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!E)throw new Error(p7);O=!0}e.pendingCompressedSize+=T,await Promise.resolve();let L=xa(e,i,"level"),N=xa(e,i,"useWebWorkers"),_=xa(e,i,"bufferedWrite"),b=xa(e,i,"dataDescriptor"),v=xa(e,i,"dataDescriptorSignature"),I=xa(e,i,"signal");b===void 0&&(b=!0),b&&v===void 0&&(v=!0);let M=await zJe(e,t,n,Object.assign({},i,{rawFilename:r,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:A,zip64:O,password:p,level:L,useWebWorkers:N,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:E,dataDescriptor:b,dataDescriptorSignature:v,signal:I,msDosCompatible:w,internalFileAttribute:D,externalFileAttribute:R}));return T&&(e.pendingCompressedSize-=T),Object.assign(M,{name:t,comment:o,extraField:x}),new Fp(M)}async function zJe(e,t,n,i){let r=e.files,o=e.writer,s=Array.from(r.values()).pop(),a={},c,u,f;r.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new PE,p.init(),c=!0):(e.lockWrite=new Promise(h=>u=h),o.initialized||await o.init(),p=o),a=await HJe(n,p,e.config,i),a.lock=g,r.set(t,a),a.filename=t,c){let h=0,A=p.getData();await Promise.all([e.lockWrite,d]);let x;do x=Array.from(r.values()).find(C=>C.writingBufferedData),x&&await x.lock;while(x&&x.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let T=await Efe(A,0,26),E=new DataView(T);(!a.encrypted||i.zipCrypto)&&lr(E,14,a.signature),a.zip64?(lr(E,18,4294967295),lr(E,22,4294967295)):(lr(E,18,a.compressedSize),lr(E,22,a.uncompressedSize)),await o.writeUint8Array(new Uint8Array(T)),h=26}await WJe(o,A,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=wd(a.rawExtraFieldZip64);fl(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(p7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),r.delete(t),d}finally{f(),u&&u()}}async function HJe(e,t,n,i){let{rawFilename:r,lastAccessDate:o,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:A,rawComment:x,rawExtraField:C,useWebWorkers:T,onprogress:E,signal:S,encryptionStrength:w,extendedTimestamp:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L}=i,N=!!(a&&a.length),_=c!==0&&!g,b;if(N&&!f){b=new Uint8Array(Cfe.length+2);let Be=wd(b);Xr(Be,0,39169),Zs(b,Cfe,2),W3(Be,8,w)}else b=new Uint8Array(0);let v,I;if(D){I=new Uint8Array(9+(o?4:0)+(s?4:0));let Be=wd(I);Xr(Be,0,21589),Xr(Be,2,I.length-4);let ke=1+(o?2:0)+(s?4:0);W3(Be,4,ke),lr(Be,5,Math.floor(i.lastModDate.getTime()/1e3)),o&&lr(Be,9,Math.floor(o.getTime()/1e3)),s&&lr(Be,13,Math.floor(s.getTime()/1e3));try{v=new Uint8Array(36);let Pe=wd(v),ft=h7(i.lastModDate);Xr(Pe,0,10),Xr(Pe,2,32),Xr(Pe,8,1),Xr(Pe,10,24),fl(Pe,12,ft),fl(Pe,20,h7(o)||ft),fl(Pe,28,h7(s)||ft)}catch{v=new Uint8Array(0)}}else v=I=new Uint8Array(0);let M={version:h||20,versionMadeBy:A,zip64:u,directory:!!g,filenameUTF8:!0,rawFilename:r,commentUTF8:!0,rawComment:x,rawExtraFieldZip64:u?new Uint8Array(Tfe+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:v,rawExtraFieldAES:b,rawExtraField:C,extendedTimestamp:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L},F=M.uncompressedSize=0,k=2048;d&&(k=k|8);let V=0;_&&(V=8),u&&(M.version=M.version>45?M.version:45),N&&(k=k|1,f||(M.version=M.version>51?M.version:51,V=99,_&&(M.rawExtraFieldAES[9]=8))),M.compressionMethod=V;let G=M.headerArray=new Uint8Array(26),U=wd(G);Xr(U,0,M.version),Xr(U,2,k),Xr(U,4,V);let q=new Uint32Array(1),Y=wd(q),Q;i.lastModDate<QW?Q=QW:i.lastModDate>ZW?Q=ZW:Q=i.lastModDate,Xr(Y,0,(Q.getHours()<<6|Q.getMinutes())<<5|Q.getSeconds()/2),Xr(Y,2,(Q.getFullYear()-1980<<4|Q.getMonth()+1)<<5|Q.getDate());let W=q[0];lr(U,6,W),Xr(U,22,r.length);let K=b.length+I.length+v.length+M.rawExtraField.length;Xr(U,24,K);let J=new Uint8Array(30+r.length+K),me=wd(J);lr(me,0,67324752),Zs(J,G,4),Zs(J,r,30),Zs(J,b,30+r.length),Zs(J,I,30+r.length+b.length),Zs(J,v,30+r.length+b.length+I.length),Zs(J,M.rawExtraField,30+r.length+b.length+I.length+v.length);let ye,se=0;if(e){F=M.uncompressedSize=e.size;let Be=await b3(n.Deflate,{codecType:C3,level:c,password:a,encryptionStrength:w,zipCrypto:N&&f,passwordVerification:N&&f&&W>>8&255,signed:!0,compressed:_,encrypted:N,useWebWorkers:T},n);await t.writeUint8Array(J),M.dataWritten=!0,ye=await S3(Be,e,t,0,F,n,{onprogress:E,signal:S}),se=ye.length}else await t.writeUint8Array(J),M.dataWritten=!0;let pe=new Uint8Array(0),xe,we=0;if(d&&(pe=new Uint8Array(u?p?24:20:p?16:12),xe=wd(pe),p&&(we=4,lr(xe,0,134695760))),e){let Be=ye.signature;if((!N||f)&&Be!==void 0&&(lr(U,10,Be),M.signature=Be,d&&lr(xe,we,Be)),u){let ke=wd(M.rawExtraFieldZip64);Xr(ke,0,1),Xr(ke,2,Tfe),lr(U,14,4294967295),fl(ke,12,BigInt(se)),lr(U,18,4294967295),fl(ke,4,BigInt(F)),d&&(fl(xe,we+4,BigInt(se)),fl(xe,we+12,BigInt(F)))}else lr(U,14,se),lr(U,18,F),d&&(lr(xe,we+4,se),lr(xe,we+8,F))}d&&await t.writeUint8Array(pe);let Ee=J.length+se+pe.length;return Object.assign(M,{compressedSize:se,lastModDate:Q,rawLastModDate:W,creationDate:s,lastAccessDate:o,encrypted:N,length:Ee}),M}async function GJe(e,t,n){let i=e.writer,r=e.files,o=0,s=0,a=e.offset,c=r.size;for(let[,p]of r)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(p7);u=!0}let f=new Uint8Array(s+(u?98:22)),d=wd(f);if(t&&t.length)if(t.length<=65535)Xr(d,o+20,t.length);else throw new Error(BJe);for(let[p,g]of Array.from(r.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:A,rawExtraFieldAES:x,rawExtraField:C,rawComment:T,versionMadeBy:E,headerArray:S,directory:w,zip64:D,msDosCompatible:R,internalFileAttribute:O,externalFileAttribute:L}=g,N,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,N=new Uint8Array(9);let v=wd(N);Xr(v,0,21589),Xr(v,2,N.length-4),W3(v,4,1),lr(v,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=N=new Uint8Array(0);let b=A.length+x.length+N.length+_.length+C.length;if(lr(d,o,33639248),Xr(d,o+4,E),Zs(f,S,o+6),Xr(d,o+30,b),Xr(d,o+32,T.length),lr(d,o+34,O),L?lr(d,o+38,L):w&&R&&W3(d,o+38,16),D?lr(d,o+42,4294967295):lr(d,o+42,g.offset),Zs(f,h,o+46),Zs(f,A,o+46+h.length),Zs(f,x,o+46+h.length+A.length),Zs(f,N,o+46+h.length+A.length+x.length),Zs(f,_,o+46+h.length+A.length+x.length+N.length),Zs(f,C,o+46+h.length+A.length+x.length+N.length+_.length),Zs(f,T,o+46+h.length+b),o+=46+h.length+b+T.length,n.onprogress)try{n.onprogress(p+1,r.size,new Fp(g))}catch{}}u&&(lr(d,o,101075792),fl(d,o+4,BigInt(44)),Xr(d,o+12,45),Xr(d,o+14,45),fl(d,o+24,BigInt(c)),fl(d,o+32,BigInt(c)),fl(d,o+40,BigInt(s)),fl(d,o+48,BigInt(a)),lr(d,o+56,117853008),fl(d,o+64,BigInt(a)+BigInt(s)),lr(d,o+72,1),c=65535,a=4294967295,s=4294967295,o+=76),lr(d,o,101010256),Xr(d,o+8,c),Xr(d,o+10,c),lr(d,o+12,s),lr(d,o+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function Efe(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(s.target.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function WJe(e,t,n=0){await r();async function r(){if(n<t.size){let o=await Efe(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(o)),n+=536870912,await r()}}}function h7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function xa(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function jJe(e){return e+5*(Math.floor(e/16383)+1)}function W3(e,t,n){e.setUint8(t,n)}function Xr(e,t,n){e.setUint16(t,n,!0)}function lr(e,t,n){e.setUint32(t,n,!0)}function fl(e,t,n){e.setBigUint64(t,n,!0)}function Zs(e,t,n){e.set(t,n)}function wd(e){return new DataView(e.buffer)}vE({Deflate:xue,Inflate:Hue});var _7=32,YJe="http://www.opengis.net/kml/2.2",Id="http://www.google.com/kml/ext/2.2",qJe="http://www.w3.org/2000/xmlns/";function j3(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var XJe=/^data:image\/([^,;]+)/;j3.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof ve){if(e=ve.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(XJe);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function KJe(e,t){return function(n){e._files[t]=n}}j3.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(KJe(this,o))}return r};Object.defineProperties(j3.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function Y3(e){this._time=e}Y3.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};Y3.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return EA(n)};Y3.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function g7(){this._ids={},this._styles={},this._count=0}g7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};g7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function wfe(){this._ids={}}wfe.prototype.get=function(e){if(!l(e))return this.get(jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function y7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=y7._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(qJe,"xmlns:gx",Id);let a=o.createElement("Document");s.appendChild(a),Ife(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?JJe(f,c.files):{kml:f,externalFiles:c.files}})}function JJe(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");vE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new PE,r=new G3(i);return r.add("doc.kml",new D3(e)).then(function(){let o=Object.keys(t);return Dfe(r,o,t,0)}).then(function(){return r.close()}).then(function(o){return{kmz:o}})}function Dfe(e,t,n,i){if(t.length===i)return;let r=t[i];return e.add(r,new CA(n[r])).then(function(){return Dfe(e,t,n,i+1)})}y7._createState=function(e){let t=e.entities,n=new g7,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);o.start===Ge.MINIMUM_VALUE?o.stop===Ge.MAXIMUM_VALUE?o=new bn:ee.addSeconds(o.stop,-10*s,o.start):o.stop===Ge.MAXIMUM_VALUE&&ee.addSeconds(o.start,10*s,o.stop);let a=new j3(e.modelCallback);return{kmlDoc:document.implementation.createDocument(YJe,"kml"),ellipsoid:y(e.ellipsoid,re.WGS84),idManager:new wfe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new Y3(r),sampleDuration:s,defaultAvailability:new Bo([o])}};function Ife(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],ZJe(e,p,u,f),QJe(e,p.polyline,u,f),vfe(e,p.rectangle,u,f,c),vfe(e,p.polygon,u,f,c),nZe(e,p,p.model,u,f);let g,h=p.availability;l(h)&&(g=i.createElement("TimeSpan"),ee.equals(h.start,Ge.MINIMUM_VALUE)||g.appendChild(pn(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,Ge.MAXIMUM_VALUE)||g.appendChild(pn(i,"end",ee.toIso8601(h.stop))));for(let C=0;C<c.length;++C){let T=c[C];T.setAttribute("id",s.get(p.id)),T.appendChild(pn(i,"name",p.name)),T.appendChild(pn(i,"visibility",p.show)),T.appendChild(pn(i,"description",p.description)),l(g)&&T.appendChild(g),t.appendChild(T)}let A=u.length;if(A>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let T=p.name,E=p.label;if(l(E)){let w=i.createElement("LabelStyle"),D=o.get(E.text);T=l(D)&&D.length>0?D:T;let R=o.getColor(E.fillColor);l(R)&&(w.appendChild(pn(i,"color",R)),w.appendChild(pn(i,"colorMode","normal")));let O=o.get(E.scale);l(O)&&w.appendChild(pn(i,"scale",O)),f.push(w)}C.appendChild(pn(i,"name",T)),C.appendChild(pn(i,"visibility",p.show)),C.appendChild(pn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let w=i.createElement("Style");for(let D=0;D<S;++D)w.appendChild(f[D]);C.appendChild(pn(i,"styleUrl",r.get(w)))}if(u.length===1)C.appendChild(u[0]);else if(u.length>1){let w=i.createElement("MultiGeometry");for(let D=0;D<A;++D)w.appendChild(u[D]);C.appendChild(w)}}let x=p._children;if(x.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(pn(i,"name",p.name)),C.appendChild(pn(i,"visibility",p.show)),C.appendChild(pn(i,"description",p.description)),t.appendChild(C),Ife(e,C,x)}}}var dl=new m,Pc=new he,Dd=new ee;function ZJe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){Pfe(e,t,a,n,i);return}s.get(c,void 0,dl);let u=pn(r,"coordinates",TA(dl,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(bA(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof mc?Rfe(e,a):Ofe(e,a);i.push(p)}function Pfe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof ga?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof v_,p,g,h,A=[];for(p=0;p<c.length;++p){let C=c.get(p),T=f?u:C.data,E=o.createElement("altitudeMode");T instanceof Np?(T=T._value,E.appendChild(bA(e,qe.CLAMP_TO_GROUND))):l(n)?E.appendChild(bA(e,n.heightReference)):E.appendChild(bA(e,qe.NONE));let S=[],w=[];if(T.isConstant){a.get(T,void 0,dl);let R=pn(o,"coordinates",TA(dl,s));S.push(ee.toIso8601(C.start)),w.push(R),S.push(ee.toIso8601(C.stop)),w.push(R)}else if(T instanceof ya)for(h=T._property._times,g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),T.getValueInReferenceFrame(h[g],nr.FIXED,dl),w.push(TA(dl,s));else if(T instanceof of){h=T._times;let R=T._values;for(g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),m.fromArray(R,g*3,dl),w.push(TA(dl,s))}else{let R=e.sampleDuration;C.start.clone(Dd),C.isStartIncluded||ee.addSeconds(Dd,R,Dd);let O=C.stop;for(;ee.lessThan(Dd,O);)T.getValue(Dd,dl),S.push(ee.toIso8601(Dd)),w.push(TA(dl,s)),ee.addSeconds(Dd,R,Dd);C.isStopIncluded&&ee.equals(Dd,O)&&(T.getValue(Dd,dl),S.push(ee.toIso8601(Dd)),w.push(TA(dl,s)))}let D=o.createElementNS(Id,"Track");D.appendChild(E);for(let R=0;R<S.length;++R){let O=pn(o,"when",S[R]),L=pn(o,"coord",w[R],Id);D.appendChild(O),D.appendChild(L)}d&&D.appendChild(Mfe(e,n)),A.push(D)}if(A.length===1)i.push(A[0]);else if(A.length>1){let C=o.createElementNS(Id,"MultiTrack");for(p=0;p<A.length;++p)C.appendChild(A[p]);i.push(C)}if(l(n)&&!d){let C=n instanceof mc?Rfe(e,n):Ofe(e,n);r.push(C)}let x=t.path;if(l(x)){let C=a.get(x.width),T=x.material;if(l(T)||l(C)){let E=o.createElement("LineStyle");l(C)&&E.appendChild(pn(o,"width",C)),A7(e,T,E),r.push(E)}}}function Ofe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(pn(n,"color",o)),r.appendChild(pn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(pn(n,"scale",s/_7)),r}function Rfe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(pn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(pn(n,"x",g.x,Id)),p.appendChild(pn(n,"y",g.y,Id)),p.appendChild(pn(n,"w",g.width,Id)),p.appendChild(pn(n,"h",g.height,Id))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(pn(n,"color",a)),o.appendChild(pn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(pn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),H.divideByScalar(u,c,u);let p=i.get(t.width,_7),g=i.get(t.height,_7),h=i.get(t.horizontalOrigin,_i.CENTER);h===_i.CENTER?u.x-=p*.5:h===_i.RIGHT&&(u.x-=p);let A=i.get(t.verticalOrigin,Bn.CENTER);A===Bn.TOP?u.y+=g:A===Bn.CENTER&&(u.y+=g*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-u.x),x.setAttribute("y",u.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),o.appendChild(x)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&m.equals(m.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),o.appendChild(pn(n,"heading",f))),o}function QJe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(pn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=pn(r,"coordinates",TA(p,o));a.appendChild(g);let h=s.get(t.zIndex);u&&l(h)&&a.appendChild(pn(r,"drawOrder",h,Id)),n.push(a);let A=r.createElement("LineStyle"),x=s.get(t.width);l(x)&&A.appendChild(pn(r,"width",x)),A7(e,t.material,A),i.push(A)}function $Je(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,Pc),c.push(`${P.toDegrees(Pc.longitude)},${P.toDegrees(Pc.latitude)},${o}`);let f=pn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Sfe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,Pc),s.push(`${P.toDegrees(Pc.longitude)},${P.toDegrees(Pc.latitude)},${i?Pc.height:n}`);let c=pn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function eZe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Sfe(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let h=0;h<g;++h){let A=i.createElement("innerBoundaryIs");A.appendChild(Sfe(e,p[h].positions,o,s)),a.push(A)}}return a}function vfe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof dm;if(a&&s.getMaterialType(t.material)==="Image"){tZe(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(pn(o,"extrude",!0));let f=a?$Je(e,t,u):eZe(e,t,u),d=f.length;for(let x=0;x<d;++x)c.appendChild(f[x]);let p=o.createElement("altitudeMode");p.appendChild(bA(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&g.appendChild(pn(o,"fill",h)),A7(e,t.material,g);let A=s.get(t.outline,!1);if(A){g.appendChild(pn(o,"outline",A));let x=o.createElement("LineStyle"),C=s.get(t.outlineWidth,1);x.appendChild(pn(o,"width",C));let T=s.getColor(t.outlineColor,z.BLACK);x.appendChild(pn(o,"color",T)),x.appendChild(pn(o,"colorMode","normal")),i.push(x)}i.push(g)}function tZe(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(bA(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(pn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(pn(i,"north",P.toDegrees(u.north))),f.appendChild(pn(i,"south",P.toDegrees(u.south))),f.appendChild(pn(i,"east",P.toDegrees(u.east))),f.appendChild(pn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(pn(i,"href",p)),s.appendChild(g);let h=d.color;l(h)&&s.appendChild(pn(i,"color",EA(d.color))),n.push(s)}function Mfe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(pn(n,"x",s)),u.appendChild(pn(n,"y",s)),u.appendChild(pn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(pn(n,"href",c)),o.appendChild(a),o}function nZe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){Pfe(e,t,n,i,r);return}let u=Mfe(e,n),f=o.createElement("altitudeMode");f.appendChild(bA(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,dl),he.fromCartesian(dl,s,Pc);let d=o.createElement("Location");d.appendChild(pn(o,"longitude",P.toDegrees(Pc.longitude))),d.appendChild(pn(o,"latitude",P.toDegrees(Pc.latitude))),d.appendChild(pn(o,"altitude",Pc.height)),u.appendChild(d),i.push(u)}function A7(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=EA(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=EA(o.color);break;case"PolylineOutline":s=EA(o.color),c=EA(o.outlineColor),u=o.outlineWidth,n.appendChild(pn(i,"outerColor",c,Id)),n.appendChild(pn(i,"outerWidth",u,Id));break;case"Stripe":s=EA(o.oddColor);break}l(s)&&(n.appendChild(pn(i,"color",s)),n.appendChild(pn(i,"colorMode","normal")))}function bA(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,qe.NONE),o;switch(r){case qe.NONE:o=n.createTextNode("absolute");break;case qe.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case qe.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function TA(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Pc),i.push(`${P.toDegrees(Pc.longitude)},${P.toDegrees(Pc.latitude)},${Pc.height}`);return i.join(" ")}function pn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function EA(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var Bfe=y7;function Zw(){this._cache={}}Zw.prototype.fromColor=function(e,t){return q3(void 0,void 0,e,t,this._cache)};Zw.prototype.fromUrl=function(e,t,n){return q3(e,void 0,t,n,this._cache)};Zw.prototype.fromMakiIconId=function(e,t,n){return q3(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Zw.prototype.fromText=function(e,t,n){return q3(void 0,e,t,n,this._cache)};var iZe=new z;function rZe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,iZe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Lfe(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var Jw=new Array(4);function q3(e,t,n,i,r){Jw[0]=e,Jw[1]=t,Jw[2]=n,Jw[3]=i;let o=JSON.stringify(Jw),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(rZe(c,n,i),l(e)){let f=ve.createIfNeeded(e).fetchImage().then(function(d){return Lfe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=cT(t,{font:`bold ${i}px sans-serif`});Lfe(c,u,i)}return r[o]=a,a}var Jg=Zw;function x7(e){return e}function X3(e){if(e==null)return x7;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+o,d[1]=(n+=a[1])*r+s;u<f;)d[u]=a[u],++u;return d}}function Nfe(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function C7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Ffe(e,n)})}:Ffe(e,t)}function Ffe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=T7(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function T7(e,t){var n=X3(e.transform),i=e.arcs;function r(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,h=p.length;g<h;++g)d.push(n(p[g],g));f<0&&Nfe(d,h)}function o(f){return n(f)}function s(f){for(var d=[],p=0,g=f.length;p<g;++p)r(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=o(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(o);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function K3(e){return m.fromDegrees(e[0],e[1],e[2])}var E7={"urn:ogc:def:crs:OGC:1.3:CRS84":K3,"EPSG:4326":K3,"urn:ogc:def:crs:EPSG::4326":K3},Ufe={},Vfe={},b7=48,S7,v7=z.ROYALBLUE,w7=z.YELLOW,D7=2,I7=z.fromBytes(255,255,0,100),P7=!1,lZe={small:24,medium:48,large:64},uZe=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function kfe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||uZe.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${kfe(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function fZe(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function dZe(e,t){return new hm(fZe(kfe,e,t),!0)}function J3(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new $n(c):n(o,s))}return r}function O7(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var zfe={Feature:Gfe,FeatureCollection:mZe,GeometryCollection:Wfe,LineString:Kfe,MultiLineString:Jfe,MultiPoint:qfe,MultiPolygon:$fe,Point:Yfe,Polygon:Qfe,Topology:ede},Hfe={GeometryCollection:Wfe,LineString:Kfe,MultiLineString:Jfe,MultiPoint:qfe,MultiPolygon:$fe,Point:Yfe,Polygon:Qfe,Topology:ede};function Gfe(e,t,n,i,r){if(t.geometry===null){J3(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new de("feature.geometry is required.");let o=t.geometry.type,s=Hfe[o];if(!l(s))throw new de(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function mZe(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)Gfe(e,o[s],void 0,i,r)}function Wfe(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=Hfe[u];if(!l(f))throw new de(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function jfe(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=y(lZe[c["marker-size"]],a);let h=c["marker-symbol"];l(h)&&(o=h)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new mc;f.verticalOrigin=new $n(Bn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=qe.CLAMP_TO_GROUND);let d=J3(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Jc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new $n(g)}).catch(function(){f.image=new $n(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Yfe(e,t,n,i,r){jfe(e,t,i,n.coordinates,r)}function qfe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)jfe(e,t,i,o[s],r)}function Xfe(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new $n(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Vt(d))}let c=J3(t,e._entityCollection,r.describe),u=new Ac;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new $n(O7(i,n)),u.arcType=$t.RHUMB}function Kfe(e,t,n,i,r){Xfe(e,t,i,n.coordinates,r)}function Jfe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Xfe(e,t,i,o[s],r)}function Zfe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new $n(g));let h,A=c.stroke;l(A)&&(h=z.fromCssColorString(A));let x=c["stroke-opacity"];l(x)&&x!==1&&(l(h)||(h=o.getValue().clone()),h.alpha=x),l(h)&&(o=new $n(h));let C,T=c.fill,E=s.color.getValue();l(T)&&(C=z.fromCssColorString(T),C.alpha=E.alpha),x=c["fill-opacity"],l(x)&&x!==E.alpha&&(l(C)||(C=E.clone()),C.alpha=x),l(C)&&(s=new Vt(C))}let u=new fm;u.outline=new $n(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=$t.RHUMB;let f=[];for(let g=1,h=i.length;g<h;g++)f.push(new Zc(O7(i[g],n)));let d=i[0];u.hierarchy=new $n(new Zc(O7(d,n),f)),d[0].length>2?u.perPositionHeight=new $n(!0):r.clampToGround||(u.height=0);let p=J3(t,e._entityCollection,r.describe);p.polygon=u}function Qfe(e,t,n,i,r){Zfe(e,t,i,n.coordinates,r)}function $fe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Zfe(e,t,i,o[s],r)}function ede(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=C7(n,n.objects[o]),a=zfe[s.type];a(e,s,s,i,r)}}function Zg(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Ws(this),this._promises=[],this._pinBuilder=new Jg,this._entityCluster=new nf,this._credit=void 0,this._resourceCredits=[]}Zg.load=function(e,t){return new Zg().load(e,t)};Object.defineProperties(Zg,{markerSize:{get:function(){return b7},set:function(e){b7=e}},markerSymbol:{get:function(){return S7},set:function(e){S7=e}},markerColor:{get:function(){return v7},set:function(e){v7=e}},stroke:{get:function(){return w7},set:function(e){w7=e}},strokeWidth:{get:function(){return D7},set:function(e){D7=e}},fill:{get:function(){return I7},set:function(e){I7=e}},clampToGround:{get:function(){return P7},set:function(e){P7=e}},crsNames:{get:function(){return E7}},crsLinkHrefs:{get:function(){return Ufe}},crsLinkTypes:{get:function(){return Vfe}}});Object.defineProperties(Zg.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Zg.prototype.load=function(e,t){return tde(this,e,t,!0)};Zg.prototype.process=function(e,t){return tde(this,e,t,!1)};function tde(e,t,n,i){Lo.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),o=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,dZe),markerSize:y(n.markerSize,b7),markerSymbol:y(n.markerSymbol,S7),markerColor:y(n.markerColor,v7),strokeWidthProperty:new $n(y(n.strokeWidth,D7)),strokeMaterialProperty:new Vt(y(n.stroke,w7)),fillMaterialProperty:new Vt(y(n.fill,I7)),clampToGround:y(n.clampToGround,P7)},Promise.resolve(o).then(function(a){return hZe(e,a,n,s,i)}).catch(function(a){throw Lo.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Zg.prototype.update=function(e){return!0};function hZe(e,t,n,i,r){let o;l(i)&&(o=wg(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=zfe[t.type];if(!l(s))throw new de(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?K3:null;if(l(a)){if(!l(a.properties))throw new de("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=E7[u.name],!l(c))throw new de(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Ufe[u.href];if(l(f)||(f=Vfe[u.type]),!l(f))throw new de(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=E7[`EPSG:${u.code}`],!l(c))throw new de(`Unknown crs EPSG code: ${u.code}`)}else throw new de(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Lo.setLoading(e,!1),e})})}var Z3=Zg;function pZe(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Mn=pZe;var nde="4.0.0";function _Ze(e){return e===void 0}function ou(e){return typeof e=="boolean"}function ide(e,t){for(var n in t)t.hasOwnProperty(n)&&_Ze(e[n])&&(e[n]=t[n]);return e}function rde(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ur(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Qg(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function $g(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var ey=/[A-Za-z]/,Ss=/[\d]/;var su=/\s/,Q3=/['"]/,ode=/[\x00-\x1F\x7F]/,sde=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,gZe=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,yZe=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,AZe=sde+gZe+yZe,ade=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,N9n=new RegExp("[".concat(sde+ade,"]")),R7=AZe+ade,Pd=new RegExp("[".concat(R7,"]"));var $3=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(su):[],r=t.split(su),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(su):[],r=t.split(su),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function cde(e,t,n){var i,r;n==null?(n="…",r=3,i=8):(r=n.length,i=n.length);var o=function(T){var E={},S=T,w=S.match(/^([a-z]+):\/\//i);return w&&(E.scheme=w[1],S=S.substr(w[0].length)),w=S.match(/^(.*?)(?=(\?|#|\/|$))/i),w&&(E.host=w[1],S=S.substr(w[0].length)),w=S.match(/^\/(.*?)(?=(\?|#|$))/i),w&&(E.path=w[1],S=S.substr(w[0].length)),w=S.match(/^\?(.*?)(?=(#|$))/i),w&&(E.query=w[1],S=S.substr(w[0].length)),w=S.match(/^#(.*?)$/i),w&&(E.fragment=w[1]),E},s=function(T){var E="";return T.scheme&&T.host&&(E+=T.scheme+"://"),T.host&&(E+=T.host),T.path&&(E+="/"+T.path),T.query&&(E+="?"+T.query),T.fragment&&(E+="#"+T.fragment),E},a=function(T,E){var S=E/2,w=Math.ceil(S),D=-1*Math.floor(S),R="";return D<0&&(R=T.substr(D)),T.substr(0,w)+n+R};if(e.length<=t)return e;var c=t-r,u=o(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-r)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var h="#"+u.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var A=c-d.length;return(d+a(h,A)).substr(0,c+i)}else d+=h}if(u.scheme&&u.host){var x=u.scheme+"://";if((d+x).length<c)return(x+d).substr(0,t)}if(d.length<=t)return d;var C="";return c>0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}function lde(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}function ude(e,t,n){return rde(e,t,n)}var fde=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new $3({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,r=n.location;return r==="smart"?cde(t,i):r==="middle"?lde(t,i):ude(t,i)},e}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var M7=function(e,t){return M7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},M7(e,t)};function Jm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");M7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var vs=function(){return vs=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},vs.apply(this,arguments)};var Zm=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var xZe="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",dde=new RegExp("^"+xZe+"$");var CZe=/[\/?#]/,TZe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,mde=/[?!:,.;^]/,B7=/https?:\/\//i,hde=new RegExp("^"+B7.source,"i"),pde=new RegExp(mde.source+"$"),EZe=/^(javascript|vbscript):/i,bZe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,SZe=/^(?:\/\/)?([^/#?:]+)/;function eU(e){return ey.test(e)}function L7(e){return ey.test(e)||Ss.test(e)||e==="+"||e==="-"||e==="."}function Up(e){return Pd.test(e)}function tU(e){return e==="_"||Up(e)}function N7(e){return Pd.test(e)||TZe.test(e)||mde.test(e)}function nU(e){return CZe.test(e)}function F7(e){return dde.test(e.toLowerCase())}function _de(e){if(EZe.test(e))return!1;var t=e.match(bZe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ey.test(i))}function gde(e){var t=e.match(SZe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!F7(r)}var vZe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,wZe=/[:/?#]/;function yde(e){var t=e.split(wZe,1)[0];return vZe.test(t)}var DZe=/^(https?:\/\/)?(www\.)?/i,IZe=/^\/\//,Ade=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=RZe(n)),this.stripPrefix.scheme&&(n=PZe(n)),this.stripPrefix.www&&(n=OZe(n)),this.stripTrailingSlash&&(n=MZe(n)),this.decodePercentEncoding&&(n=BZe(n)),n},t}(Zm);function PZe(e){return e.replace(hde,"")}function OZe(e){return e.replace(DZe,"$1")}function RZe(e){return e.replace(IZe,"")}function MZe(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function BZe(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var xde=/^mailto:/i,LZe=new RegExp("[".concat(R7,"!#$%&'*+/=?^_`{|}~-]"));function Cde(e){return Pd.test(e)}function iU(e){return LZe.test(e)}function Tde(e){var t=e.split(".").pop()||"";return F7(t)}var Ede=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Zm);function U7(e){return e==="_"||Pd.test(e)}function bde(e){return e.length<=140}var Sde=["twitter","facebook","instagram","tiktok"];var vde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw $g(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Zm);var NZe={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},FZe=/[-\w.]/;function V7(e){return FZe.test(e)}function wde(e,t){var n=NZe[t];return n.test(e)}var Dde=["twitter","instagram","soundcloud","tiktok"];var Ide=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Zm);var UZe=/[-. ]/,VZe=/[-. ()]/,kZe=/[,;]/,zZe=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,HZe=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,GZe=new RegExp("^".concat(zZe.source,"|").concat(HZe.source,"$"));function k7(e){return UZe.test(e)}function rU(e){return kZe.test(e)}function Pde(e){var t=e.charAt(0)==="+"||VZe.test(e);return t&&GZe.test(e)}var Ode=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Zm);function Bde(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,r=t.stripTrailingSlash,o=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],d=0;d<u;d++){var p=e.charAt(d);if(f.length===0)x(p);else for(var g=f.length-1;g>=0;g--){var h=f[g];switch(h.state){case 11:D(h,p);break;case 12:R(h,p);break;case 0:C(h,p);break;case 1:T(h,p);break;case 2:E(h,p);break;case 3:S(h,p);break;case 4:w(h,p);break;case 5:O(h,p);break;case 6:L(h,p);break;case 7:N(h,p);break;case 13:_(h,p);break;case 14:b(h,p);break;case 8:v(h,p);break;case 9:I(h,p);break;case 10:M(h,p);break;case 15:F(h,p);break;case 16:k(h,p);break;case 17:V(h,p);break;case 18:G(h,p);break;case 19:U(h,p);break;case 20:q(h,p);break;case 21:Y(h,p);break;case 22:Q(h,p);break;case 23:W(h,p);break;case 24:K(h,p);break;case 25:J(h,p);break;case 26:me(h,p);break;case 27:ye(h,p);break;case 28:se(h,p);break;case 29:pe(h,p);break;case 30:xe(h,p);break;case 31:we(h,p);break;case 32:Be(h,p);break;case 33:ke(h,p);break;case 34:Pe(h,p);break;case 35:ft(h,p);break;case 36:_t(h,p);break;case 37:Ee(h,p);break;case 38:rt(h,p);break;case 39:dn(h,p);break;case 40:In(h,p);break;case 41:Ht(h,p);break;default:$g(h.state)}}}for(var A=f.length-1;A>=0;A--)f.forEach(function(Te){return Ft(Te)});return c;function x(Te){if(Te==="#")f.push(XZe(d,28));else if(Te==="@")f.push(KZe(d,30));else if(Te==="/")f.push(H7(d,11));else if(Te==="+")f.push(G7(d,37));else if(Te==="(")f.push(G7(d,32));else{if(Ss.test(Te)&&(f.push(G7(d,38)),f.push(YZe(d,13))),Cde(Te)){var Ae=Te.toLowerCase()==="m"?15:22;f.push(qZe(d,Ae))}eU(Te)&&f.push(z7(d,0)),Pd.test(Te)&&f.push(H7(d,5))}}function C(Te,Ae){Ae===":"?Te.state=2:Ae==="-"?Te.state=1:L7(Ae)||Ur(f,Te)}function T(Te,Ae){Ae==="-"||(Ae==="/"?(Ur(f,Te),f.push(H7(d,11))):L7(Ae)?Te.state=0:Ur(f,Te))}function E(Te,Ae){Ae==="/"?Te.state=3:Ae==="."?Ur(f,Te):Up(Ae)?(Te.state=5,eU(Ae)&&f.push(z7(d,0))):Ur(f,Te)}function S(Te,Ae){Ae==="/"?Te.state=4:N7(Ae)?(Te.state=10,Te.acceptStateReached=!0):Ft(Te)}function w(Te,Ae){Ae==="/"?Te.state=10:Up(Ae)?(Te.state=5,Te.acceptStateReached=!0):Ur(f,Te)}function D(Te,Ae){Ae==="/"?Te.state=12:Ur(f,Te)}function R(Te,Ae){Up(Ae)?Te.state=5:Ur(f,Te)}function O(Te,Ae){Ae==="."?Te.state=7:Ae==="-"?Te.state=6:Ae===":"?Te.state=8:nU(Ae)?Te.state=10:tU(Ae)||Ft(Te)}function L(Te,Ae){Ae==="-"||(Ae==="."?Ft(Te):Up(Ae)?Te.state=5:Ft(Te))}function N(Te,Ae){Ae==="."?Ft(Te):Up(Ae)?(Te.state=5,Te.acceptStateReached=!0):Ft(Te)}function _(Te,Ae){Ae==="."?Te.state=14:Ae===":"?Te.state=8:Ss.test(Ae)||(nU(Ae)?Te.state=10:Pd.test(Ae)?Ur(f,Te):Ft(Te))}function b(Te,Ae){Ss.test(Ae)?(Te.octetsEncountered++,Te.octetsEncountered===4&&(Te.acceptStateReached=!0),Te.state=13):Ft(Te)}function v(Te,Ae){Ss.test(Ae)?Te.state=9:Ft(Te)}function I(Te,Ae){Ss.test(Ae)||(nU(Ae)?Te.state=10:Ft(Te))}function M(Te,Ae){N7(Ae)||Ft(Te)}function F(Te,Ae){Ae.toLowerCase()==="a"?Te.state=16:Q(Te,Ae)}function k(Te,Ae){Ae.toLowerCase()==="i"?Te.state=17:Q(Te,Ae)}function V(Te,Ae){Ae.toLowerCase()==="l"?Te.state=18:Q(Te,Ae)}function G(Te,Ae){Ae.toLowerCase()==="t"?Te.state=19:Q(Te,Ae)}function U(Te,Ae){Ae.toLowerCase()==="o"?Te.state=20:Q(Te,Ae)}function q(Te,Ae){Ae.toLowerCase()===":"?Te.state=21:Q(Te,Ae)}function Y(Te,Ae){iU(Ae)?Te.state=22:Ur(f,Te)}function Q(Te,Ae){Ae==="."?Te.state=23:Ae==="@"?Te.state=24:iU(Ae)?Te.state=22:Ur(f,Te)}function W(Te,Ae){Ae==="."?Ur(f,Te):Ae==="@"?Ur(f,Te):iU(Ae)?Te.state=22:Ur(f,Te)}function K(Te,Ae){Up(Ae)?Te.state=25:Ur(f,Te)}function J(Te,Ae){Ae==="."?Te.state=27:Ae==="-"?Te.state=26:tU(Ae)||Ft(Te)}function me(Te,Ae){Ae==="-"||Ae==="."?Ft(Te):tU(Ae)?Te.state=25:Ft(Te)}function ye(Te,Ae){Ae==="."||Ae==="-"?Ft(Te):Up(Ae)?(Te.state=25,Te.acceptStateReached=!0):Ft(Te)}function se(Te,Ae){U7(Ae)?(Te.state=29,Te.acceptStateReached=!0):Ur(f,Te)}function pe(Te,Ae){U7(Ae)||Ft(Te)}function xe(Te,Ae){V7(Ae)?(Te.state=31,Te.acceptStateReached=!0):Ur(f,Te)}function we(Te,Ae){V7(Ae)||(Pd.test(Ae)?Ur(f,Te):Ft(Te))}function Ee(Te,Ae){Ss.test(Ae)?Te.state=38:(Ur(f,Te),x(Ae))}function Be(Te,Ae){Ss.test(Ae)?Te.state=33:Ur(f,Te),x(Ae)}function ke(Te,Ae){Ss.test(Ae)?Te.state=34:Ur(f,Te)}function Pe(Te,Ae){Ss.test(Ae)?Te.state=35:Ur(f,Te)}function ft(Te,Ae){Ae===")"?Te.state=36:Ur(f,Te)}function _t(Te,Ae){Ss.test(Ae)?Te.state=38:k7(Ae)?Te.state=39:Ur(f,Te)}function rt(Te,Ae){Te.acceptStateReached=!0,rU(Ae)?Te.state=40:Ae==="#"?Te.state=41:Ss.test(Ae)||(Ae==="("?Te.state=32:k7(Ae)?Te.state=39:(Ft(Te),eU(Ae)&&f.push(z7(d,0))))}function dn(Te,Ae){Ss.test(Ae)?Te.state=38:Ae==="("?Te.state=32:(Ft(Te),x(Ae))}function In(Te,Ae){rU(Ae)||(Ae==="#"?Te.state=41:Ss.test(Ae)?Te.state=38:Ft(Te))}function Ht(Te,Ae){rU(Ae)?Te.state=40:Ss.test(Ae)?Ur(f,Te):Ft(Te)}function Ft(Te){if(Ur(f,Te),!!Te.acceptStateReached){var Ae=Te.startIdx,ut=e.slice(Te.startIdx,d);if(ut=jZe(ut),Te.type==="url"){var ti=e.charAt(Te.startIdx-1);if(ti==="@")return;var Je=Te.matchType;if(Je==="scheme"){var or=B7.exec(ut);if(or&&(Ae=Ae+or.index,ut=ut.slice(or.index)),!_de(ut))return}else if(Je==="tld"){if(!gde(ut))return}else if(Je==="ipV4"){if(!yde(ut))return}else $g(Je);c.push(new Ade({tagBuilder:n,matchedText:ut,offset:Ae,urlMatchType:Je,url:ut,protocolRelativeMatch:ut.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:r,decodePercentEncoding:o}))}else if(Te.type==="email")Tde(ut)&&c.push(new Ede({tagBuilder:n,matchedText:ut,offset:Ae,email:ut.replace(xde,"")}));else if(Te.type==="hashtag")bde(ut)&&c.push(new vde({tagBuilder:n,matchedText:ut,offset:Ae,serviceName:s,hashtag:ut.slice(1)}));else if(Te.type==="mention")wde(ut,a)&&c.push(new Ide({tagBuilder:n,matchedText:ut,offset:Ae,serviceName:a,mention:ut.slice(1)}));else if(Te.type==="phone"){if(ut=ut.replace(/ +$/g,""),Pde(ut)){var Qo=ut.replace(/[^0-9,;#]/g,"");c.push(new Ode({tagBuilder:n,matchedText:ut,offset:Ae,number:Qo,plusSign:ut.charAt(0)==="+"}))}}else $g(Te)}}}var WZe=/[\(\{\[]/,Rde=/[\)\}\]]/,Mde={")":"(","}":"{","]":"["};function jZe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);WZe.test(i)?t[i]++:Rde.test(i)&&t[Mde[i]]--}for(var r=e.length-1,o;r>=0;)if(o=e.charAt(r),Rde.test(o)){var s=Mde[o];if(t[s]<0)t[s]++,r--;else break}else if(pde.test(o))r--;else break;return e.slice(0,r+1)}function z7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function H7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function YZe(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function qZe(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function XZe(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function KZe(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function G7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Lde(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,r=t.onText,o=t.onComment,s=t.onDoctype,a=new Qm,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:h(g);break;case 1:A(g);break;case 2:C(g);break;case 3:x(g);break;case 4:T(g);break;case 5:E(g);break;case 6:S(g);break;case 7:w(g);break;case 8:D(g);break;case 9:R(g);break;case 10:O(g);break;case 11:L(g);break;case 12:N(g);break;case 13:_(g);break;case 14:b(g);break;case 15:v(g);break;case 16:I(g);break;case 17:M(g);break;case 18:F(g);break;case 19:k(g);break;case 20:V(g);break;default:$g(f)}c++}d<c&&Y();function h(K){K==="<"&&U()}function A(K){K==="!"?f=13:K==="/"?(f=2,p=new Qm(vs(vs({},p),{isClosing:!0}))):K==="<"?U():ey.test(K)?(f=3,p=new Qm(vs(vs({},p),{isOpening:!0}))):(f=0,p=a)}function x(K){su.test(K)?(p=new Qm(vs(vs({},p),{name:Q()})),f=4):K==="<"?U():K==="/"?(p=new Qm(vs(vs({},p),{name:Q()})),f=12):K===">"?(p=new Qm(vs(vs({},p),{name:Q()})),q()):!ey.test(K)&&!Ss.test(K)&&K!==":"&&G()}function C(K){K===">"?G():ey.test(K)?f=3:G()}function T(K){su.test(K)||(K==="/"?f=12:K===">"?q():K==="<"?U():K==="="||Q3.test(K)||ode.test(K)?G():f=5)}function E(K){su.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?q():K==="<"?U():Q3.test(K)&&G()}function S(K){su.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?q():K==="<"?U():Q3.test(K)?G():f=5)}function w(K){su.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?U():f=10)}function D(K){K==='"'&&(f=11)}function R(K){K==="'"&&(f=11)}function O(K){su.test(K)?f=4:K===">"?q():K==="<"&&U()}function L(K){su.test(K)?f=4:K==="/"?f=12:K===">"?q():K==="<"?U():(f=4,W())}function N(K){K===">"?(p=new Qm(vs(vs({},p),{isClosing:!0})),q()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new Qm(vs(vs({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Qm(vs(vs({},p),{type:"doctype"})),f=20):G()}function b(K){K==="-"?f=15:K===">"?G():f=16}function v(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function F(K){K===">"?q():K==="!"?f=19:K==="-"||(f=16)}function k(K){K==="-"?f=17:K===">"?q():f=16}function V(K){K===">"?q():K==="<"&&U()}function G(){f=0,p=a}function U(){f=1,p=new Qm({idx:c})}function q(){var K=e.slice(d,p.idx);K&&r(K,d),p.type==="comment"?o(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function Y(){var K=e.slice(d,c);r(K,d),d=c+1}function Q(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}var Qm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var JZe=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=ZZe(t.urls),this.email=ou(t.email)?t.email:this.email,this.phone=ou(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=ou(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=QZe(t.stripPrefix),this.stripTrailingSlash=ou(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=ou(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Dde.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Sde.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=$Ze(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return Lde(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length,s=r+o;if(n+1<t.length){if(t[n+1].getOffset()===r){var a=t[n+1].getMatchedText().length>o?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Qg(t,function(n){return n.getType()==="hashtag"}),this.email||Qg(t,function(n){return n.getType()==="email"}),this.phone||Qg(t,function(n){return n.getType()==="phone"}),this.mention||Qg(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Qg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Qg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Qg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=Bde(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof $3)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new fde({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=nde,e}(),Nde=JZe;function ZZe(e){return e==null&&(e=!0),ou(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:ou(e.schemeMatches)?e.schemeMatches:!0,tldMatches:ou(e.tldMatches)?e.tldMatches:!0,ipV4Matches:ou(e.ipV4Matches)?e.ipV4Matches:!0}}function QZe(e){return e==null&&(e=!0),ou(e)?{scheme:e,www:e}:{scheme:ou(e.scheme)?e.scheme:!0,www:ou(e.www)?e.www:!0}}function $Ze(e){return typeof e=="number"?{length:e,location:"end"}:ide(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var oU=Nde;var jde;typeof DOMParser<"u"&&(jde=new DOMParser);var eQe=new oU({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),sU=32,Fde=2414016,Ude=1,Vde=16093e3,kde=.1,tQe=[null,void 0,"http://www.topografix.com/GPX/1/1"],Tr={gpx:tQe};function nQe(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function W7(e,t){let n=eD(e,"id");return n=l(n)?n:jn(),t.getOrCreateEntity(n)}function j7(e){let t=zde(e,"lon"),n=zde(e,"lat"),i=Qw(e,"ele",Tr.gpx);return m.fromDegrees(t,n,i)}function zde(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function eD(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ty(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Y7(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Qw(e,t,n){let i=ty(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function ml(e,t,n){let i=ty(e,t,n);if(l(i))return i.textContent.trim()}function Yde(e){let t=new mc;return t.width=sU,t.height=sU,t.scaleByDistance=new Lt(Fde,Ude,Vde,kde),t.pixelOffsetScaleByDistance=new Lt(Fde,Ude,Vde,kde),t.verticalOrigin=new $n(Bn.BOTTOM),t.image=e,t}function iQe(){let e=new um;return e.translucencyByDistance=new Lt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=jr.FILL_AND_OUTLINE,e}function qde(e){let t=new Ac;return t.width=4,t.material=new sA,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var Hde={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},$w;typeof document<"u"&&($w=document.createElement("div"));function q7(e,t){let n,i="",r=Object.keys(Hde),o=r.length;for(n=0;n<o;n++){let f=r[n],d=Hde[f];d.value=y(ml(e,d.tag,Tr.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=eQe.link(i),$w.innerHTML=i;let s=$w.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${$w.innerHTML}</div>`,$w.innerHTML="",u}function Xde(e,t,n,i){let r=j7(t),o=W7(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,sU);o.billboard=Yde(s);let a=ml(t,"name",Tr.gpx);o.name=a,o.label=iQe(),o.label.text=a,o.description=q7(t,o),i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND,o.label.heightReference=qe.CLAMP_TO_GROUND)}function rQe(e,t,n,i){let r=W7(t,n);r.description=q7(t,r);let o=Y7(t,"rtept",Tr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)Xde(e,o[a],n,i),s[a]=j7(o[a]);r.polyline=qde(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function oQe(e,t,n,i){let r=W7(t,n);r.description=q7(t,r);let o=Y7(t,"trkseg",Tr.gpx),s=[],a=[],c,u=!0,f=new ya;for(let d=0;d<o.length;d++)c=sQe(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,sU);r.billboard=Yde(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND),r.availability=new Bo,r.availability.addInterval(new bn({start:a[0],stop:a[a.length-1]}))}r.polyline=qde(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function sQe(e){let t={positions:[],times:[]},n=Y7(e,"trkpt",Tr.gpx),i;for(let r=0;r<n.length;r++){let o=j7(n[r]);t.positions.push(o),i=ml(n[r],"time",Tr.gpx),l(i)&&t.times.push(ee.fromIso8601(i))}return t}function aQe(e){let t=ty(e,"metadata",Tr.gpx);if(l(t)){let n={name:ml(t,"name",Tr.gpx),desc:ml(t,"desc",Tr.gpx),author:cQe(t),copyright:uQe(t),link:Kde(t),time:ml(t,"time",Tr.gpx),keywords:ml(t,"keywords",Tr.gpx),bounds:fQe(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function cQe(e){let t=ty(e,"author",Tr.gpx);if(l(t)){let n={name:ml(t,"name",Tr.gpx),email:lQe(t),link:Kde(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function lQe(e){let t=ty(e,"email",Tr.gpx);if(l(t)){let n=ml(t,"id",Tr.gpx),i=ml(t,"domain",Tr.gpx);return`${n}@${i}`}}function Kde(e){let t=ty(e,"link",Tr.gpx);if(l(t)){let n={href:eD(t,"href"),text:ml(t,"text",Tr.gpx),mimeType:ml(t,"type",Tr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function uQe(e){let t=ty(e,"copyright",Tr.gpx);if(l(t)){let n={author:eD(t,"author"),year:ml(t,"year",Tr.gpx),license:ml(t,"license",Tr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function fQe(e){let t=ty(e,"bounds",Tr.gpx);if(l(t)){let n={minLat:Qw(t,"minlat",Tr.gpx),maxLat:Qw(t,"maxlat",Tr.gpx),minLon:Qw(t,"minlon",Tr.gpx),maxLon:Qw(t,"maxlon",Tr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Gde={wpt:Xde,rte:rQe,trk:oQe};function dQe(e,t,n,i){let r=Object.keys(Gde),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Gde[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Tr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Wde(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=eD(r,"version"),s=eD(r,"creator"),a,c=aQe(r);l(c)&&(a=c.name),r.localName==="gpx"?dQe(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=ee.equals(d,Ge.MINIMUM_VALUE),h=ee.equals(p,Ge.MAXIMUM_VALUE);if(!g||!h){let x;g&&(x=new Date,x.setHours(0,0,0,0),d=ee.fromDate(x)),h&&(x=new Date,x.setHours(24,0,0,0),p=ee.fromDate(x)),u=new Um,u.startTime=d,u.stopTime=p,u.currentTime=ee.clone(d),u.clockRange=No.LOOP_STOP,u.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,d)/60,1),31556900))}let A=!1;return e._name!==a&&(e._name=a,A=!0),e._creator!==s&&(e._creator=s,A=!0),mQe(e._metadata,c)&&(e._metadata=c,A=!0),e._version!==o&&(e._version=o,A=!0),u!==e._clock&&(A=!0,e._clock=u),A&&e._changed.raiseEvent(e),Lo.setLoading(e,!1),e}function mQe(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function hQe(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?nQe(o).then(function(s){let a,c;try{a=jde.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new de(u)}return Wde(e,a,i)}):Wde(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function BE(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new Ws(this),this._entityCluster=new nf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Jg}BE.load=function(e,t){return new BE().load(e,t)};Object.defineProperties(BE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});BE.prototype.update=function(e){return!0};BE.prototype.load=function(e,t){if(!l(e))throw new fe("data is required.");t=y(t,y.EMPTY_OBJECT),Lo.setLoading(this,!0);let n=this._name,i=this;return hQe(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,Ge.MINIMUM_VALUE),u=ee.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Um,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=No.LOOP_STOP,r.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Lo.setLoading(i,!1),i}).catch(function(r){return Lo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var aU=BE;function pQe(e,t){this.position=e,this.headingPitchRoll=t}var cU=pQe;var iD=co(wl(),1);function _Qe(e,t){this.position=e,this.headingPitchRange=t}var lU=_Qe;function uU(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}uU.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};uU.prototype.play=function(e,t){l(e.cesiumWidget)&&$("viewer","The viewer parameter has been deprecated in Cesium 1.99. It will be removed in 1.100. Instead of a Viewer, pass a CesiumWidget instead."),this.tourStart.raiseEvent();let n=this;Zde.call(this,e,t,function(i){n.playlistIndex=0,i||Jde(n._activeEntries),n.tourEnd.raiseEvent(i)})};uU.prototype.stop=function(){Jde(this._activeEntries)};function Jde(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Zde(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=gQe.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function gQe(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,Zde.call(this,e,t,n)}}var fU=uU;var Li={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Li.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Li.Bounce.In(e*2)*.5:Li.Bounce.Out(e*2-1)*.5+.5}}},tD;typeof self>"u"&&typeof process<"u"&&process.hrtime?tD=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?tD=self.performance.now.bind(self.performance):Date.now!==void 0?tD=Date.now:tD=function(){return new Date().getTime()};var LE=tD,yQe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=LE()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),nD={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=nD.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=nD.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=nD.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=nD.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},Qde=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),$de=new yQe,eme=function(){function e(t,n){n===void 0&&(n=$de),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Li.Linear.None,this._interpolationFunction=nD.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Qde.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?LE()+parseFloat(t):t:LE(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,r){for(var o in i){var s=t[o],a=Array.isArray(s),c=a?"array":typeof s,u=!a&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(u){var f=i[o];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[o]=[s].concat(f)}if((c==="object"||a)&&s&&!u){n[o]=a?[]:{};for(var d in s)n[o][d]=s[d];r[o]=a?[]:{},this._setupProperties(s,n[o],i[o],r[o])}else typeof n[o]>"u"&&(n[o]=s),a||(n[o]*=1),u?r[o]=i[o].slice().reverse():r[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=LE()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=LE()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return this._group=t,this},e.prototype.delay=function(t){return this._delayTime=t,this},e.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return this._yoyo=t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.interpolation=function(t){return this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){if(t===void 0&&(t=LE()),n===void 0&&(n=!0),this._isPaused)return!0;var i,r,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;n&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=this._duration===0||r>1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}();var ejn=Qde.nextId,$m=$de,tjn=$m.getAll.bind($m),njn=$m.removeAll.bind($m),ijn=$m.add.bind($m),rjn=$m.remove.bind($m),ojn=$m.update.bind($m);var AQe={LINEAR_NONE:Li.Linear.None,QUADRATIC_IN:Li.Quadratic.In,QUADRATIC_OUT:Li.Quadratic.Out,QUADRATIC_IN_OUT:Li.Quadratic.InOut,CUBIC_IN:Li.Cubic.In,CUBIC_OUT:Li.Cubic.Out,CUBIC_IN_OUT:Li.Cubic.InOut,QUARTIC_IN:Li.Quartic.In,QUARTIC_OUT:Li.Quartic.Out,QUARTIC_IN_OUT:Li.Quartic.InOut,QUINTIC_IN:Li.Quintic.In,QUINTIC_OUT:Li.Quintic.Out,QUINTIC_IN_OUT:Li.Quintic.InOut,SINUSOIDAL_IN:Li.Sinusoidal.In,SINUSOIDAL_OUT:Li.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Li.Sinusoidal.InOut,EXPONENTIAL_IN:Li.Exponential.In,EXPONENTIAL_OUT:Li.Exponential.Out,EXPONENTIAL_IN_OUT:Li.Exponential.InOut,CIRCULAR_IN:Li.Circular.In,CIRCULAR_OUT:Li.Circular.Out,CIRCULAR_IN_OUT:Li.Circular.InOut,ELASTIC_IN:Li.Elastic.In,ELASTIC_OUT:Li.Elastic.Out,ELASTIC_IN_OUT:Li.Elastic.InOut,BACK_IN:Li.Back.In,BACK_OUT:Li.Back.Out,BACK_IN_OUT:Li.Back.InOut,BOUNCE_IN:Li.Bounce.In,BOUNCE_OUT:Li.Bounce.Out,BOUNCE_IN_OUT:Li.Bounce.InOut},Fo=Object.freeze(AQe);function dU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}dU.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ae(this.view.position);t.flyToBoundingSphere(r,i)}};dU.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};dU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Fo.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=gt(t,e)),t};var mU=dU;function X7(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}X7.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};X7.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var hU=X7;var ume={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=Ix(t),ume[t]}},tj;typeof DOMParser<"u"&&(tj=new DOMParser);var xQe=new oU({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),ny=32,tme=2414016,nme=1,ime=16093e3,rme=.1,ome=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],sme=["http://www.google.com/kml/ext/2.2"],CQe=["http://www.w3.org/2005/Atom"],Me={kml:ome,gx:sme,atom:CQe,kmlgx:ome.concat(sme)},nj={Document:xme,Folder:kQe,Placemark:zQe,NetworkLink:JQe,GroundOverlay:qQe,PhotoOverlay:Eme,ScreenOverlay:YQe,Tour:GQe};function eh(e){this._dataSource=e,this._deferred=la(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(eh.prototype,{dataSource:{get:function(){return this._dataSource}}});eh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};eh.prototype.addPromise=function(e){this._promises.push(e)};eh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};eh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=lu._getTimestamp()),this._process(e)};eh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=lu._getTimestamp(),e._process(!0)},0)};eh.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};eh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};eh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let r=nj[i.localName];if(l(r)&&(Me.kml.indexOf(i.namespaceURI)!==-1||Me.gx.indexOf(i.namespaceURI)!==-1)&&(r(t,i,n,this),this._timeoutSet||lu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function TQe(e){let t=e.slice(0,Math.min(4,e.size)),n=la(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function EQe(e){let t=la(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function fme(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function dme(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}function bQe(e,t){return Promise.resolve(e.getData(new I3)).then(function(n){n=fme(n),n=dme(n),t.kml=tj.parseFromString(n,"application/xml")})}function K7(e,t){let n=y(ume.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new P3(n))).then(function(i){t[e.filename]=i})}function au(e,t,n,i){let r=i.keys,o=new iD.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new iD.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function cu(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=ij(a,i);l(c)&&s.setAttribute(n,c.url)}}function mme(e,t,n){let i=as(e,"id");i=l(i)&&i.length!==0?i:jn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=jn(),l(n)&&(i=n+i)),r=t.add(new no({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new e$e),r}function rD(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function yU(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,m.fromDegrees(i,r,o,t)}function pU(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=yU(n[s],t);return r}function iy(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function as(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Si(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function ame(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Od(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ei(e,t,n){let i=Si(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Dn(e,t,n){let i=Si(e,t,n);if(l(i))return i.textContent.trim()}function Rd(e,t,n){let i=Si(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function ij(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new ve({url:r});else{let o=new iD.default(t.getUrlComponent()),s=new iD.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new ve({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var hl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function $7(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(hl.maximumRed=o,hl.red=void 0):(hl.maximumRed=void 0,hl.red=0),r>0?(hl.maximumGreen=r,hl.green=void 0):(hl.maximumGreen=void 0,hl.green=0),i>0?(hl.maximumBlue=i,hl.blue=void 0):(hl.maximumBlue=void 0,hl.blue=0),hl.alpha=n,z.fromRandom(hl)):new z(o,r,i,n)}function SA(e,t,n){let i=Dn(e,t,n);if(l(i))return $7(i,Dn(e,"colorMode",n)==="random")}function SQe(e){let t=Si(e,"TimeStamp",Me.kmlgx),n=Dn(t,"when",Me.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),r=new Bo;return r.addInterval(new bn({start:i,stop:Ge.MAXIMUM_VALUE})),r}function vQe(e){let t=Si(e,"TimeSpan",Me.kmlgx);if(!l(t))return;let n,i=Si(t,"begin",Me.kmlgx),r=l(i)?ee.fromIso8601(i.textContent):void 0,o=Si(t,"end",Me.kmlgx),s=l(o)?ee.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(ee.lessThan(s,r)){let a=r;r=s,s=a}n=new Bo,n.addInterval(new bn({start:r,stop:s}))}else l(r)?(n=new Bo,n.addInterval(new bn({start:r,stop:Ge.MAXIMUM_VALUE}))):l(s)&&(n=new Bo,n.addInterval(new bn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function hme(){let e=new mc;return e.width=ny,e.height=ny,e.scaleByDistance=new Lt(tme,nme,ime,rme),e.pixelOffsetScaleByDistance=new Lt(tme,nme,ime,rme),e}function rj(){let e=new fm;return e.outline=!0,e.outlineColor=z.WHITE,e}function pme(){let e=new um;return e.translucencyByDistance=new Lt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=jr.FILL_AND_OUTLINE,e}function oj(e,t,n,i,r){let o=Dn(e,"href",Me.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=y(ei(e,"x",Me.gx),0),u=y(ei(e,"y",Me.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=ij(o,n,i);if(r){let a=Dn(e,"refreshMode",Me.kml),c=Dn(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?Rt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Rt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Dn(e,"viewBoundScale",Me.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Dn(e,"viewFormat",Me.kml),f),p=Dn(e,"httpQuery",Me.kml);l(d)&&s.setQueryParameters(Du(gU(d))),l(p)&&s.setQueryParameters(Du(gU(p)));let g=t._ellipsoid;return aj(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function wQe(e,t,n,i,r){let o=ei(t,"scale",Me.kml),s=ei(t,"heading",Me.kml),a=SA(t,"color",Me.kml),c=Si(t,"Icon",Me.kml),u=oj(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=ei(c,"x",Me.gx),d=ei(c,"y",Me.gx),p=ei(c,"w",Me.gx),g=ei(c,"h",Me.gx),h=Si(t,"hotSpot",Me.kml),A=iy(h,"x"),x=iy(h,"y"),C=as(h,"xunits"),T=as(h,"yunits"),E=n.billboard;l(E)||(E=hme(),n.billboard=E),E.image=u,E.scale=o,E.color=a,(l(f)||l(d)||l(p)||l(g))&&(E.imageSubRegion=new Ke(f,d,p,g)),l(s)&&s!==0&&(E.rotation=P.toRadians(-s),E.alignedAxis=m.UNIT_Z),o=y(o,1);let S,w;l(A)&&(C==="pixels"?S=-A*o:C==="insetPixels"?S=(A-ny)*o:C==="fraction"&&(S=-A*ny*o),S+=ny*.5*o),l(x)&&(T==="pixels"?w=x*o:T==="insetPixels"?w=(-x+ny)*o:T==="fraction"&&(w=x*ny*o),w-=ny*.5*o),(l(S)||l(w))&&(E.pixelOffset=new H(S,w))}function _U(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")wQe(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=pme(),n.label=c),c.scale=y(ei(a,"scale",Me.kml),c.scale),c.fillColor=y(SA(a,"color",Me.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Ac,n.polyline=c),c.width=ei(a,"width",Me.kml),c.material=SA(a,"color",Me.kml),l(SA(a,"outerColor",Me.gx))&&Rt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ei(a,"outerWidth",Me.gx))&&Rt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ei(a,"physicalWidth",Me.gx))&&Rt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Rd(a,"labelVisibility",Me.gx))&&Rt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=rj(),n.polygon=c),c.material=y(SA(a,"color",Me.kml),c.material),c.fill=y(Rd(a,"fill",Me.kml),c.fill),c.outline=y(Rd(a,"outline",Me.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y($7(Dn(a,"bgColor",Me.kml)),z.WHITE),u=y($7(Dn(a,"textColor",Me.kml)),z.BLACK),f=Dn(a,"text",Me.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Dn(a,"listItemType",Me.kml);(c==="radioFolder"||c==="checkOffOnly")&&Rt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function DQe(e,t,n,i,r){let o=new no,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")_U(e,d,o,i,r);else{let p=Od(d,"Pair",Me.kml);for(let g=0;g<p.length;g++){let h=p[g],A=Dn(h,"key",Me.kml);if(A==="normal"){let x=Dn(h,"styleUrl",Me.kml);if(l(x))s=n.getById(x),l(s)||(s=n.getById(`#${x}`)),l(s)&&o.merge(s);else{let C=Si(h,"Style",Me.kml);_U(e,C,o,i,r)}}else Rt(`kml-styleMap-${A}`,`KML - Unsupported StyleMap key: ${A}`)}}}let f=Dn(t,"styleUrl",Me.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function IQe(e,t,n){return t.fetchXML().then(function(i){return _me(e,i,n,t,!0)})}function _me(e,t,n,i,r,o){let s,a,c,u,f=ame(t,"Style",Me.kml);if(l(f)){let A=f.length;for(s=0;s<A;s++)u=f[s],a=as(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new no({id:a}),n.add(c),_U(e,u,c,i,o)))}let d=ame(t,"StyleMap",Me.kml);if(l(d)){let A=d.length;for(s=0;s<A;s++){let x=d[s];if(a=as(x,"id"),l(a)){let C=Od(x,"Pair",Me.kml);for(let T=0;T<C.length;T++){let E=C[T],S=Dn(E,"key",Me.kml);if(S==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let w=Dn(E,"styleUrl",Me.kml);if(l(w)){w[0]!=="#"&&(w=`#${w}`),r&&l(i)&&(w=i.getUrlComponent()+w);let D=n.getById(w);l(D)&&c.merge(D)}else u=Si(E,"Style",Me.kml),_U(e,u,c,i,o)}}else Rt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),h=g.length;for(s=0;s<h;s++){let A=g[s].textContent;if(A[0]!=="#"){let x=A.split("#");if(x.length===2){let C=x[0],T=i.getDerivedResource({url:C});p.push(IQe(e,T,n))}}}return p}function sj(e,t,n){let i=new Pg(e,t.id,["position"]),r=new Np(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Ac,t.polyline.positions=new Dg([i,r])}function gme(e,t){return!l(e)&&!l(t)||e==="clampToGround"?qe.CLAMP_TO_GROUND:e==="relativeToGround"?qe.RELATIVE_TO_GROUND:e==="absolute"?qe.NONE:t==="clampToSeaFloor"?(Rt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Rt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),qe.RELATIVE_TO_GROUND):(l(e)?Rt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Rt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function PQe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Np(e))}function OQe(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function AU(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():pme(),t.label=r),r.text=t.name;let o=t.billboard;l(o)||(o=l(n.billboard)?n.billboard.clone():hme(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(o.scale)&&(s=o.scale.getValue(),s!==0?r.pixelOffset=new H(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function yme(e,t){let n=e.path;l(n)||(n=new w_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function RQe(e,t,n,i,r){let o=Dn(n,"coordinates",Me.kml),s=Dn(n,"altitudeMode",Me.kml),a=Dn(n,"altitudeMode",Me.gx),c=Rd(n,"extrude",Me.kml),u=e._ellipsoid,f=yU(o,u);return i.position=f,AU(e,i,r,gme(s,a)),c&&rD(s,a)&&sj(t,i,r),!0}function cme(e,t,n,i,r){let o=Si(n,"coordinates",Me.kml),s=Dn(n,"altitudeMode",Me.kml),a=Dn(n,"altitudeMode",Me.gx),c=Rd(n,"extrude",Me.kml),u=Rd(n,"tessellate",Me.kml),f=rD(s,a),d=ei(n,"drawOrder",Me.gx),p=e._ellipsoid,g=pU(o,p),h=r.polyline;if(f&&c){let A=new D_;i.wall=A,A.positions=g;let x=r.polygon;l(x)&&(A.fill=x.fill,A.material=x.material),A.outline=!0,l(h)?(A.outlineColor=l(h.material)?h.material.color:z.WHITE,A.outlineWidth=h.width):l(x)&&(A.outlineColor=l(x.material)?x.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let A=new Ac;A.clampToGround=!0,i.polyline=A,A.positions=g,l(h)?(A.material=l(h.material)?h.material.color.getValue(Ge.MINIMUM_VALUE):z.WHITE,A.width=y(h.width,1)):(A.material=z.WHITE,A.width=1),A.zIndex=d}else l(d)&&Rt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&Rt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=l(h)?h.clone():new Ac,i.polyline=h,h.positions=OQe(g,s,a,p),(!u||f)&&(h.arcType=$t.NONE);return!0}function MQe(e,t,n,i,r){let o=Si(n,"outerBoundaryIs",Me.kml),s=Si(o,"LinearRing",Me.kml),a=Si(s,"coordinates",Me.kml),c=e._ellipsoid,u=pU(a,c),f=Rd(n,"extrude",Me.kml),d=Dn(n,"altitudeMode",Me.kml),p=Dn(n,"altitudeMode",Me.gx),g=rD(d,p),h=l(r.polygon)?r.polygon.clone():rj(),A=r.polyline;if(l(A)&&(h.outlineColor=l(A.material)?A.material.color:z.WHITE,h.outlineWidth=A.width),i.polygon=h,g?(h.perPositionHeight=!0,h.extrudedHeight=f?0:void 0):e._clampToGround||(h.height=0),l(u)){let x=new Zc(u),C=Od(n,"innerBoundaryIs",Me.kml);for(let T=0;T<C.length;T++){s=Od(C[T],"LinearRing",Me.kml);for(let E=0;E<s.length;E++)a=Si(s[E],"coordinates",Me.kml),u=pU(a,c),l(u)&&x.holes.push(new Zc(u))}h.hierarchy=x}return!0}function BQe(e,t,n,i,r){let o=Dn(n,"altitudeMode",Me.kml),s=Dn(n,"altitudeMode",Me.gx),a=Od(n,"coord",Me.gx),c=Od(n,"angles",Me.gx),u=Od(n,"when",Me.kml),f=Rd(n,"extrude",Me.kml),d=rD(o,s),p=e._ellipsoid;c.length>0&&Rt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),h=[],A=[];for(let C=0;C<g;C++){let T=yU(a[C].textContent,p);h.push(T),A.push(ee.fromIso8601(u[C].textContent))}let x=new ya;return x.addSamples(A,h),i.position=x,AU(e,i,r,gme(o,s)),yme(i,r),i.availability=new Bo,u.length>0&&i.availability.addInterval(new bn({start:A[0],stop:A[A.length-1]})),d&&f&&sj(t,i,r),!0}function lme(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new ya;d.addSamples(e,t),n.intervals.addInterval(new bn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:PQe(d,s,a)})),i.addInterval(new bn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new bn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function LQe(e,t,n,i,r){let o=Rd(n,"interpolate",Me.gx),s=Od(n,"Track",Me.gx),a,c,u,f=!1,d=new Mg,p=new Bo,g=new ga,h=e._ellipsoid;for(let A=0,x=s.length;A<x;A++){let C=s[A],T=Od(C,"when",Me.kml),E=Od(C,"coord",Me.gx),S=Dn(C,"altitudeMode",Me.kml),w=Dn(C,"altitudeMode",Me.gx),D=rD(S,w),R=Rd(C,"extrude",Me.kml),O=Math.min(E.length,T.length),L=[];a=[];for(let N=0;N<O;N++){let _=yU(E[N].textContent,h);L.push(_),a.push(ee.fromIso8601(T[N].textContent))}o&&(l(c)&&lme([c,a[0]],[u,L[0]],g,p,d,!1,"absolute",void 0,!1),c=a[O-1],u=L[L.length-1]),lme(a,L,g,p,d,D&&R,S,w,!0),f=f||D&&R}return i.availability=p,i.position=g,AU(e,i,r),yme(i,r),f&&(sj(t,i,r),i.polyline.show=d),!0}var Ame={Point:RQe,LineString:cme,LinearRing:cme,Polygon:MQe,Track:BQe,MultiTrack:LQe,MultiGeometry:NQe,Model:FQe};function NQe(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=Ame[f.localName];if(l(d)){let p=mme(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function FQe(e,t,n,i,r){return Rt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function UQe(e,t){let n=Si(e,"ExtendedData",Me.kml);if(!l(n))return;l(Si(n,"SchemaData",Me.kml))&&Rt("kml-schemaData","KML - SchemaData is unsupported"),l(as(n,"xmlns:prefix"))&&Rt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=Od(n,"Data",Me.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=as(a,"name");l(c)&&(i[c]={displayName:Dn(a,"displayName",Me.kml),value:Dn(a,"value",Me.kml)})}}t.kml.extendedData=i}var ur;typeof document<"u"&&(ur=document.createElement("div"));function VQe(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Dn(e,"description",Me.kml),d=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,g=z.BLACK,h=f;l(d)&&(p=y(d.bgColor,z.WHITE),g=y(d.textColor,z.BLACK),h=y(d.text,f));let A;if(l(h)){if(h=h.replace("$[name]",y(t.name,"")),h=h.replace("$[description]",y(f,"")),h=h.replace("$[address]",y(c.address,"")),h=h.replace("$[Snippet]",y(c.snippet,"")),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),l(u)){let T=h.match(/\$\[.+?\]/g);if(T!==null)for(o=0;o<T.length;o++){let E=T[o],S=E.substr(2,E.length-3),w=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),A=u[S],l(A)&&(A=w?A.displayName:A.value),l(A)&&(h=h.replace(E,y(A,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],A=u[s],h+=`<tr><th>${y(A.displayName,s)}</th><td>${y(A.value,"")}</td></tr>`;h+="</tbody></table>"}if(!l(h))return;h=xQe.link(h),ur.innerHTML=h;let x=ur.querySelectorAll("a");for(o=0;o<x.length;o++)x[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(au(ur,"a","href",i),au(ur,"link","href",i),au(ur,"area","href",i),au(ur,"img","src",i),au(ur,"iframe","src",i),au(ur,"video","src",i),au(ur,"audio","src",i),au(ur,"source","src",i),au(ur,"track","src",i),au(ur,"input","src",i),au(ur,"embed","src",i),au(ur,"script","src",i),au(ur,"video","poster",i)),cu(ur,"a","href",r),cu(ur,"link","href",r),cu(ur,"area","href",r),cu(ur,"img","src",r),cu(ur,"iframe","src",r),cu(ur,"video","src",r),cu(ur,"audio","src",r),cu(ur,"source","src",r),cu(ur,"track","src",r),cu(ur,"input","src",r),cu(ur,"embed","src",r),cu(ur,"script","src",r),cu(ur,"video","poster",r);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${ur.innerHTML}</div>`,ur.innerHTML="",t.description=C}function xU(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=mme(t,i,n.context),c=a.kml,u=DQe(e,t,n.styleCollection,o,s),f=Dn(t,"name",Me.kml);a.name=f,a.parent=r;let d=vQe(t);l(d)||(d=SQe(t)),a.availability=d,lj(a);function p(E){return E?E.show&&p(E.parent):!0}let g=Rd(t,"visibility",Me.kml);a.show=p(r)&&y(g,!0);let h=Si(t,"author",Me.atom),A=c.author;A.name=Dn(h,"name",Me.atom),A.uri=Dn(h,"uri",Me.atom),A.email=Dn(h,"email",Me.atom);let x=Si(t,"link",Me.atom),C=c.link;C.href=as(x,"href"),C.hreflang=as(x,"hreflang"),C.rel=as(x,"rel"),C.type=as(x,"type"),C.title=as(x,"title"),C.length=as(x,"length"),c.address=Dn(t,"address",Me.kml),c.phoneNumber=Dn(t,"phoneNumber",Me.kml),c.snippet=Dn(t,"Snippet",Me.kml),UQe(t,a),VQe(t,a,u,s,o);let T=e._ellipsoid;return Tme(t,a,T),Cme(t,a,T),l(Si(t,"Region",Me.kml))&&Rt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function xme(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function kQe(e,t,n,i){let r=xU(e,t,n),o=Ye(n);o.parentEntity=r.entity,xme(e,t,o,i)}function zQe(e,t,n,i){let r=xU(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=Ame[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),AU(e,o,s))}var HQe={FlyTo:jQe,Wait:WQe,SoundCue:J7,AnimatedUpdate:J7,TourControl:J7};function GQe(e,t,n,i){let r=Dn(t,"name",Me.kml),o=as(t,"id"),s=new fU(r,o),a=Si(t,"Playlist",Me.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=HQe[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function J7(e,t){Rt(`KML Tour unsupported node ${t.localName}`)}function WQe(e,t){let n=ei(t,"duration",Me.gx);e.addPlaylistEntry(new hU(n))}function jQe(e,t,n){let i=ei(t,"duration",Me.gx),r=Dn(t,"flyToMode",Me.gx),o={kml:{}};Tme(t,o,n),Cme(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new mU(i,r,s);e.addPlaylistEntry(a)}function Cme(e,t,n){let i=Si(e,"Camera",Me.kml);if(l(i)){let r=y(ei(i,"longitude",Me.kml),0),o=y(ei(i,"latitude",Me.kml),0),s=y(ei(i,"altitude",Me.kml),0),a=y(ei(i,"heading",Me.kml),0),c=y(ei(i,"tilt",Me.kml),0),u=y(ei(i,"roll",Me.kml),0),f=m.fromDegrees(r,o,s,n),d=lc.fromDegrees(a,c-90,u);t.kml.camera=new cU(f,d)}}function Tme(e,t,n){let i=Si(e,"LookAt",Me.kml);if(l(i)){let r=y(ei(i,"longitude",Me.kml),0),o=y(ei(i,"latitude",Me.kml),0),s=y(ei(i,"altitude",Me.kml),0),a=ei(i,"heading",Me.kml),c=ei(i,"tilt",Me.kml),u=y(ei(i,"range",Me.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new df(a,c-P.PI_OVER_TWO,u),d=m.fromDegrees(r,o,s,n);t.kml.lookAt=new lU(d,f)}}function YQe(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=Si(t,"Icon",Me.kml),c=oj(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Si(t,"screenXY",Me.kml),p=Si(t,"overlayXY",Me.kml),g=Si(t,"size",Me.kml),h,A,x,C,T,E;l(g)&&(h=iy(g,"x"),A=iy(g,"y"),x=as(g,"xunits"),C=as(g,"yunits"),l(h)&&h!==-1&&h!==0&&(x==="fraction"?T=`width: ${Math.floor(h*100)}%`:x==="pixels"&&(T=`width: ${h}px`),f.push(T)),l(A)&&A!==-1&&A!==0&&(C==="fraction"?E=`height: ${Math.floor(A*100)}%`:C==="pixels"&&(E=`height: ${A}px`),f.push(E))),u.style=f.join(";");let S=0,w=u.height;l(p)&&(h=iy(p,"x"),A=iy(p,"y"),x=as(p,"xunits"),C=as(p,"yunits"),l(h)&&(x==="fraction"?S=h*u.width:(x==="pixels"||x==="insetPixels")&&(S=h)),l(A)&&(C==="fraction"?w=A*u.height:(C==="pixels"||C==="insetPixels")&&(w=A))),l(d)&&(h=iy(d,"x"),A=iy(d,"y"),x=as(d,"xunits"),C=as(d,"yunits"),l(h)&&(x==="fraction"?T=`left: calc(${Math.floor(h*100)}% - ${S}px)`:x==="pixels"?T=`left: ${h-S}px`:x==="insetPixels"&&(T=`right: ${h-S}px`),f.push(T)),l(A)&&(C==="fraction"?E=`bottom: calc(${Math.floor(A*100)}% - ${w}px)`:C==="pixels"?E=`bottom: ${A-w}px`:C==="insetPixels"&&(E=`top: ${A-w}px`),f.push(E))),u.style=f.join(";")},r.appendChild(u)}function qQe(e,t,n,i){let o=xU(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=pU(Si(t,"LatLonQuad",Me.gx),c),f=ei(t,"drawOrder",Me.kml);if(l(u))s=rj(),s.hierarchy=new Zc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new dm,s.zIndex=f,o.rectangle=s;let h=Si(t,"LatLonBox",Me.kml);if(l(h)){let A=ei(h,"west",Me.kml),x=ei(h,"south",Me.kml),C=ei(h,"east",Me.kml),T=ei(h,"north",Me.kml);l(A)&&(A=P.negativePiToPi(P.toRadians(A))),l(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),l(C)&&(C=P.negativePiToPi(P.toRadians(C))),l(T)&&(T=P.clampToLatitudeRange(P.toRadians(T))),s.coordinates=new ce(A,x,C,T);let E=ei(h,"rotation",Me.kml);if(l(E)){let S=P.toRadians(E);s.rotation=S,s.stRotation=S}}}let d=Si(t,"Icon",Me.kml),p=oj(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Rt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ei(d,"x",Me.gx),A=ei(d,"y",Me.gx),x=ei(d,"w",Me.gx),C=ei(d,"h",Me.gx);(l(h)||l(A)||l(x)||l(C))&&Rt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=SA(t,"color",Me.kml),s.material.transparent=!0}else s.material=SA(t,"color",Me.kml);let g=Dn(t,"altitudeMode",Me.kml);l(g)?g==="absolute"?(s.height=ei(t,"altitude",Me.kml),s.zIndex=void 0):g!=="clampToGround"&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Dn(t,"altitudeMode",Me.gx),g==="relativeToSeaFloor"?(Rt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Me.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Rt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Rt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function Eme(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Rt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var ry={INTERVAL:0,EXPIRE:1,STOP:2};function gU(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var XQe=new ce,NE=new he,Z7=new H,KQe=new m;function aj(e,t,n,i,r,o){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=Mx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(r=y(r,XQe),l(n)&&(Z7.x=n.clientWidth*.5,Z7.y=n.clientHeight*.5,u=t.pickEllipsoid(Z7,o,KQe)),l(u)?f=o.cartesianToCartographic(u,NE):(f=ce.center(r,NE),u=o.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let C=r.width*i*.5,T=r.height*i*.5;r=new ce(a(f.longitude-C),s(f.latitude-T),a(f.longitude+C),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,NE),c=c.replace("[cameraLon]",P.toDegrees(NE.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(NE.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(NE.height).toString());let g=t.frustum,h=g.aspectRatio,A="",x="";if(l(h)){let C=P.toDegrees(g.fov);h>1?(A=C,x=C/h):(x=C,A=C*h)}c=c.replace("[horizFov]",A.toString()),c=c.replace("[vertFov]",x.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Du(c))}function JQe(e,t,n,i){let o=xU(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Si(t,"Link",Me.kml);if(l(c)||(c=Si(t,"Url",Me.kml)),l(c)){let u=Dn(c,"href",Me.kml),f,d;if(l(u)){let p=u;if(u=ij(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(c,"viewRefreshMode",Me.kml),f==="onRegion"){Rt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Dn(c,"viewBoundScale",Me.kml),1);let x=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Dn(c,"viewFormat",Me.kml),x),T=Dn(c,"httpQuery",Me.kml);l(C)&&u.setQueryParameters(Du(gU(C))),l(T)&&u.setQueryParameters(Du(gU(T)));let E=e._ellipsoid;aj(u,e.camera,e.canvas,d,e._lastCameraView.bbox,E)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},h=new Ws,A=cj(e,h,u,g).then(function(x){let C=e._entityCollection,T=h.values;C.suspendEvents();for(let w=0;w<T.length;w++){let D=T[w];l(D.parent)||(D.parent=o,lj(D)),C.add(D)}C.resumeEvents();let E=Dn(c,"refreshMode",Me.kml),S=y(ei(c,"refreshInterval",Me.kml),0);if(E==="onInterval"&&S>0||E==="onExpire"||f==="onStop"){let w=Si(x,"NetworkLinkControl",Me.kml),D=l(w),R=ee.now(),O={id:jn(),href:u,cookie:{},lastUpdated:R,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:R},L=0;if(D&&(O.cookie=Du(y(Dn(w,"cookie",Me.kml),"")),L=y(ei(w,"minRefreshPeriod",Me.kml),0)),E==="onInterval")D&&(S=Math.max(L,S)),O.refreshMode=ry.INTERVAL,O.time=S;else if(E==="onExpire"){let N;if(D&&(N=Dn(w,"expires",Me.kml)),l(N))try{let _=ee.fromIso8601(N),b=ee.secondsDifference(_,R);b>0&&b<L&&ee.addSeconds(R,L,_),O.refreshMode=ry.EXPIRE,O.time=_}catch{Rt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Rt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(O.refreshMode=ry.STOP,O.time=y(ei(c,"viewRefreshTime",Me.kml),0)):Rt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(O.refreshMode)&&e._networkLinks.set(O.id,O)}}).catch(function(x){Rt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,x)});i.addPromise(A)}}}function ZQe(e,t,n,i){let r=nj[t.localName];return l(r)?r(e,t,n,i):Eme(e,t,n,i)}function ej(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Si(a,"Document",Me.kml),u=Dn(c,"name",Me.kml);l(u)||(u=wg(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new lu._DeferredLoading(e),d=new Ws(e);return Promise.all(_me(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let A=0;A<h.length;A++){let x=h[A];if(l(nj[x.localName])){p=x;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),ZQe(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function QQe(e,t,n,i,r){let o=nn("ThirdParty/Workers/z-worker-pako.js");vE({workerScripts:{deflate:[o,"./pako_deflate.min.js"],inflate:[o,"./pako_inflate.min.js"]}});let s=new k3(new CA(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(K7(f,u)),f=p):c.push(K7(p,u)))}return l(f)&&c.push(bQe(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new de("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),ej(e,t,u.kml,i,u,r)})})}function cj(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),c=n.fetchBlob(),r=y(r,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=y(r,ve.DEFAULT.clone());return r=ve.createIfNeeded(r),l(a)&&(a=Mn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?TQe(u).then(function(f){return f?QQe(e,t,u,r,a):EQe(u).then(function(d){d=fme(d),d=dme(d);let p,g;try{p=tj.parseFromString(d,"application/xml")}catch(h){g=h.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let h=l(g)?g:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new de(h)}return ej(e,t,p,r,o,a,s)})}):ej(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function lu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new Ws(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Jg,this._networkLinks=new Et,this._entityCluster=new nf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,re.WGS84);let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}lu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new lu(t).load(e,t)};Object.defineProperties(lu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});lu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Lo.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return cj(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,Ge.MINIMUM_VALUE),u=ee.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new Um,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=No.LOOP_STOP,r.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Lo.setLoading(i,!1),i}).catch(function(r){return Lo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};lu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function lj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function $Qe(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Si(o,"NetworkLinkControl",Me.kml),c=l(a),u=0;if(c){if(l(Si(a,"Update",Me.kml))){Rt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Du(y(Dn(a,"cookie",Me.kml),"")),u=y(ei(a,"minRefreshPeriod",Me.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===ry.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===ry.EXPIRE){let R;if(l(a)&&(R=Dn(a,"expires",Me.kml)),l(R))try{let O=ee.fromIso8601(R),L=ee.secondsDifference(O,f);L>0&&L<u&&ee.addSeconds(f,u,O),t.time=O}catch{Rt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Rt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,h=n.values;function A(R){g.remove(R);let O=R._children,L=O.length;for(let N=0;N<L;++N)A(O[N])}g.suspendEvents();let x=g.values.slice(),C;for(C=0;C<x.length;++C){let R=x[C];R.parent===p&&(R.parent=void 0,A(R))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<h.length;C++){let R=h[C];l(R.parent)||(R.parent=p,lj(R)),g.add(R)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let T=g.computeAvailability(),E=T.start,S=T.stop,w=ee.equals(E,Ge.MINIMUM_VALUE),D=ee.equals(S,Ge.MAXIMUM_VALUE);if(!w||!D){let R=e._clock;(R.startTime!==E||R.stopTime!==S)&&(R.startTime=E,R.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Q7=new Et;lu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;Q7.removeAll();function r(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let h=d[g];Q7.set(h.id,h),r(h)}}let o=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),o=!0);let c=new Et,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!Q7.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===ry.INTERVAL?ee.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===ry.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===ry.STOP&&(o&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){r(d),f.updating=!0;let g=new Ws,h=f.href.clone();h.setQueryParameters(f.cookie);let A=y(i._ellipsoid,re.WGS84);aj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,A),cj(i,g,h,{context:d.id}).then($Qe(i,f,g,c,h)).catch(function(x){let C=`NetworkLink ${f.href} refresh failed: ${x}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function e$e(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}lu._DeferredLoading=eh;lu._getTimestamp=Ci;var CU=lu;function oD(){fe.throwInstantiationError()}oD.prototype.update=fe.throwInstantiationError;oD.prototype.getBoundingSphere=fe.throwInstantiationError;oD.prototype.isDestroyed=fe.throwInstantiationError;oD.prototype.destroy=fe.throwInstantiationError;var bme=oD;var t$e={NONE:0,LERC:1},Md=Object.freeze(t$e);var n$e={NONE:0,BITS12:1},Qs=Object.freeze(n$e);var vA=new m,i$e=new m,pf=new H,TU=new B,r$e=new B,o$e=Math.pow(2,12);function Ja(e,t,n,i,r,o,s,a,c,u){let f=Qs.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,h=t.maximum,A=m.subtract(h,g,i$e),x=i-n;Math.max(m.maximumComponent(A),x)<o$e-1?f=Qs.BITS12:f=Qs.NONE,d=B.inverseTransformation(r,new B);let T=m.negate(g,vA);B.multiply(B.fromTranslation(T,TU),d,d);let E=vA;E.x=1/A.x,E.y=1/A.y,E.z=1/A.z,B.multiply(B.fromScale(E,TU),d,d),p=B.clone(r),B.setTranslation(p,m.ZERO,p),r=B.clone(r,new B);let S=B.fromTranslation(g,TU),w=B.fromScale(A,r$e),D=B.multiply(S,w,TU);B.multiply(r,D,r),B.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Ja.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===Qs.BITS12){n=B.multiplyByPoint(this.toScaledENU,n,vA),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((r-this.minimumHeight)/f,0,1);H.fromElements(n.x,n.y,pf);let p=qn.compressTextureCoordinates(pf);H.fromElements(n.z,d,pf);let g=qn.compressTextureCoordinates(pf);H.fromElements(c,u,pf);let h=qn.compressTextureCoordinates(pf);if(e[t++]=p,e[t++]=g,e[t++]=h,this.hasWebMercatorT){H.fromElements(s,0,pf);let A=qn.compressTextureCoordinates(pf);e[t++]=A}}else m.subtract(n,this.center,vA),e[t++]=vA.x,e[t++]=vA.y,e[t++]=vA.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=qn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var s$e=new m,Sme=new m;Ja.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,s$e),c=n.geodeticSurfaceNormal(a,Sme),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Ja.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};Ja.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===Qs.BITS12){let i=qn.decompressTextureCoordinates(e[t],pf);n.x=i.x,n.y=i.y;let r=qn.decompressTextureCoordinates(e[t+1],pf);return n.z=r.x,B.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};Ja.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Sme),a=this.decodeHeight(e,t),c=Yc.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Ja.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new H),t*=this.stride,this.quantization===Qs.BITS12?qn.decompressTextureCoordinates(e[t+2],n):H.fromElements(e[t+4],e[t+5],n)};Ja.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?qn.decompressTextureCoordinates(e[t+1],pf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ja.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?qn.decompressTextureCoordinates(e[t+3],pf).x:e[t+6]};Ja.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return H.fromElements(r,o,n)};Ja.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Ja.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Qs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var EU={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},bU={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ja.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===Qs.NONE){s(EU.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(EU.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(EU.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(bU.compressed0,a?4:3),c&&s(bU.compressed1,1),this.hasGeodeticSurfaceNormals&&s(bU.geodeticSurfaceNormal,3)}return o};Ja.prototype.getAttributeLocations=function(){return this.quantization===Qs.NONE?EU:bU};Ja.clone=function(e,t){if(l(e))return l(t)||(t=new Ja),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=B.clone(e.toScaledENU),t.fromScaledENU=B.clone(e.fromScaledENU),t.matrix=B.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Oc=Ja;var th={};th.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var uj=new m,a$e=new B,c$e=new m,l$e=new m;th.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,re.WGS84),A=1/h.maximumRadius,x=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),T,E,S,w;l(C)?(T=C.west,E=C.south,S=C.east,w=C.north):g?(T=a(x.west),E=a(x.south),S=a(x.east),w=a(x.north)):(T=x.west*A,E=s-2*r(o(-x.south*A)),S=x.east*A,w=s-2*r(o(-x.north*A)));let D=e.relativeToCenter,R=l(D);D=R?D:m.ZERO;let O=y(e.includeWebMercatorT,!1),L=y(e.exaggeration,1),N=y(e.exaggerationRelativeHeight,0),b=L!==1,v=y(e.structure,th.DEFAULT_STRUCTURE),I=y(v.heightScale,th.DEFAULT_STRUCTURE.heightScale),M=y(v.heightOffset,th.DEFAULT_STRUCTURE.heightOffset),F=y(v.elementsPerHeight,th.DEFAULT_STRUCTURE.elementsPerHeight),k=y(v.stride,th.DEFAULT_STRUCTURE.stride),V=y(v.elementMultiplier,th.DEFAULT_STRUCTURE.elementMultiplier),G=y(v.isBigEndian,th.DEFAULT_STRUCTURE.isBigEndian),U=ce.computeWidth(x),q=ce.computeHeight(x),Y=U/(u-1),Q=q/(f-1);g||(U*=A,q*=A);let W=h.radiiSquared,K=W.x,J=W.y,me=W.z,ye=65536,se=-65536,pe=Mt.eastNorthUpToFixedFrame(D,h),xe=B.inverseTransformation(pe,a$e),we,Ee;O&&(we=Pi.geodeticLatitudeToMercatorAngle(E),Ee=1/(Pi.geodeticLatitudeToMercatorAngle(w)-we));let Be=c$e;Be.x=Number.POSITIVE_INFINITY,Be.y=Number.POSITIVE_INFINITY,Be.z=Number.POSITIVE_INFINITY;let ke=l$e;ke.x=Number.NEGATIVE_INFINITY,ke.y=Number.NEGATIVE_INFINITY,ke.z=Number.NEGATIVE_INFINITY;let Pe=Number.POSITIVE_INFINITY,ft=u*f,_t=d>0?u*2+f*2:0,rt=ft+_t,dn=new Array(rt),In=new Array(rt),Ht=new Array(rt),Ft=O?new Array(rt):[],Te=b?new Array(rt):[],Ae=0,ut=f,ti=0,Je=u;p&&(--Ae,++ut,--ti,++Je);let or=1e-5;for(let Ze=Ae;Ze<ut;++Ze){let mt=Ze;mt<0&&(mt=0),mt>=f&&(mt=f-1);let kt=x.north-Q*mt;g?kt=a(kt):kt=s-2*r(o(-kt*A));let Jt=(kt-E)/(w-E);Jt=P.clamp(Jt,0,1);let $i=Ze===Ae,dr=Ze===ut-1;d>0&&($i?kt+=or*q:dr&&(kt-=or*q));let $o=t(kt),Is=n(kt),ao=me*Is,ki;O&&(ki=(Pi.geodeticLatitudeToMercatorAngle(kt)-we)*Ee);for(let Ho=ti;Ho<Je;++Ho){let Fn=Ho;Fn<0&&(Fn=0),Fn>=u&&(Fn=u-1);let sn=mt*(u*k)+Fn*k,Wn;if(F===1)Wn=c[sn];else{Wn=0;let Pr;if(G)for(Pr=0;Pr<F;++Pr)Wn=Wn*V+c[sn+Pr];else for(Pr=F-1;Pr>=0;--Pr)Wn=Wn*V+c[sn+Pr]}Wn=Wn*I+M,se=Math.max(se,Wn),ye=Math.min(ye,Wn);let vn=x.west+Y*Fn;g?vn=a(vn):vn=vn*A;let Ps=(vn-T)/(S-T);Ps=P.clamp(Ps,0,1);let mi=mt*u+Fn;if(d>0){let Pr=Ho===ti,Rf=Ho===Je-1,ds=$i||dr||Pr||Rf;if(($i||dr)&&(Pr||Rf))continue;ds&&(Wn-=d,Pr?(mi=ft+(f-mt-1),vn-=or*U):dr?mi=ft+f+(u-Fn-1):Rf?(mi=ft+f+u+mt,vn+=or*U):$i&&(mi=ft+f+u+f+Fn))}let oa=$o*t(vn),bu=$o*n(vn),Of=K*oa,Os=J*bu,Vr=1/i(Of*oa+Os*bu+ao*Is),Ir=Of*Vr,sa=Os*Vr,xr=ao*Vr,Rs=new m;Rs.x=Ir+oa*Wn,Rs.y=sa+bu*Wn,Rs.z=xr+Is*Wn,B.multiplyByPoint(xe,Rs,uj),m.minimumByComponent(uj,Be,Be),m.maximumByComponent(uj,ke,ke),Pe=Math.min(Pe,Wn),dn[mi]=Rs,Ht[mi]=new H(Ps,Jt),In[mi]=Wn,O&&(Ft[mi]=ki),b&&(Te[mi]=h.geodeticSurfaceNormal(Rs))}}let Qo=ae.fromPoints(dn),va;l(C)&&(va=Ln.fromRectangle(C,ye,se,h));let Io;R&&(Io=new vg(h).computeHorizonCullingPointPossiblyUnderEllipsoid(D,dn,ye));let Dr=new e0(Be,ke,D),Ve=new Oc(D,Dr,Pe,se,pe,!1,O,b,L,N),ot=new Float32Array(rt*Ve.stride),je=0;for(let Ze=0;Ze<rt;++Ze)je=Ve.encode(ot,je,dn[Ze],Ht[Ze],In[Ze],void 0,Ft[Ze],Te[Ze]);return{vertices:ot,maximumHeight:se,minimumHeight:ye,encoding:Ve,boundingSphere3D:Qo,orientedBoundingBox:va,occludeePointInScaledSpace:Io}};var sD=th;function oy(){fe.throwInstantiationError()}Object.defineProperties(oy.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});oy.prototype.interpolateHeight=fe.throwInstantiationError;oy.prototype.isChildAvailable=fe.throwInstantiationError;oy.prototype.createMesh=fe.throwInstantiationError;oy.prototype.upsample=fe.throwInstantiationError;oy.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;oy.maximumAsynchronousTasks=5;var nh=oy;function u$e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=A}var Bd=u$e;function Rc(){fe.throwInstantiationError()}Object.defineProperties(Rc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var vme=[];Rc.getRegularGridIndices=function(e,t){let n=vme[e];l(n)||(vme[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Pme(e,t,i,0)),i};var wme=[];Rc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=wme[e];l(n)||(wme[e]=n=[]);let i=n[t];if(!l(i)){let r=Rc.getRegularGridIndices(e,t),o=Ime(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Dme=[];Rc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Dme[e];l(n)||(Dme[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=Ime(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,h=f.northIndicesWestToEast,A=Ue.createTypedArray(c,u);Pme(e,t,A,0),Rc.addSkirtIndices(d,p,g,h,r,A,o),i=n[t]={indices:A,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:h,indexCountWithoutSkirts:o}}return i};Rc.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=SU(e,a,o,s),a+=e.length,s=SU(t,a,o,s),a+=t.length,s=SU(n,a,o,s),a+=n.length,SU(i,a,o,s)};function Ime(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function Pme(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function SU(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Rc.heightmapTerrainQuality=.25;Rc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Rc.heightmapTerrainQuality/(t*n)};Rc.prototype.requestTileGeometry=fe.throwInstantiationError;Rc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Rc.prototype.getTileDataAvailable=fe.throwInstantiationError;Rc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var Jo=Rc;function Vp(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Md.NONE);let t=sD.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Md.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Vp.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Ome="createVerticesFromHeightmap",f$e=new pi(Ome),d$e=new pi(Ome,nh.maximumAsynchronousTasks);Vp.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ce.center(f)),p=this._structure,h=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(h*4,1e3);let x=(a?d$e:f$e).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(x))return;let C=this;return Promise.resolve(x).then(function(T){let E;C._skirtHeight>0?E=Jo.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):E=Jo.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let S=T.gridWidth*T.gridHeight;return C._mesh=new Bd(d,new Float32Array(T.vertices),E.indices,E.indexCountWithoutSkirts,S,T.minimumHeight,T.maximumHeight,ae.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Ln.clone(T.orientedBoundingBox),Oc.clone(T.encoding),E.westIndicesSouthToNorth,E.southIndicesEastToWest,E.eastIndicesNorthToSouth,E.northIndicesWestToEast),C._buffer=void 0,C._mesh})};Vp.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ce.center(u)),d=this._structure,g=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let h=sD.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let A;this._skirtHeight>0?A=Jo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):A=Jo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=h.gridWidth*h.gridHeight;return this._mesh=new Bd(f,h.vertices,A.indices,A.indexCountWithoutSkirts,x,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),this._mesh};Vp.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===Md.LERC;if(!p&&g)return;let A;if(p){let x=this._mesh.vertices,C=this._mesh.encoding;A=Rme(x,C,f,d,e,i,r,t,n)}else A=m$e(this._buffer,a,c,s,u,e,i,r,t,n),A=A*d+f;return A};Vp.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,h=a.encoding,A=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(r,o,s),C=f.heightOffset,T=f.heightScale,E=f.elementsPerHeight,S=f.elementMultiplier,w=f.isBigEndian,D=Math.pow(S,E-1);for(let R=0;R<u;++R){let O=P.lerp(x.north,x.south,R/(u-1));for(let L=0;L<c;++L){let N=P.lerp(x.west,x.east,L/(c-1)),_=Rme(g,h,C,T,A,c,u,N,O);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,h$e(p,E,S,D,d,w,R*c+L,_)}}return Promise.resolve(new Vp({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Vp.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Vp.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function m$e(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let h=d|0,A=h+1;A>=a&&(A=a-1,h=a-2);let x=f-p,C=d-h;h=a-1-h,A=a-1-A;let T=vU(e,t,n,i,r,h*s+p),E=vU(e,t,n,i,r,h*s+g),S=vU(e,t,n,i,r,A*s+p),w=vU(e,t,n,i,r,A*s+g);return Mme(x,C,T,E,S,w)}function Rme(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let A=u-d,x=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*o+d)-n)/i,T=(t.decodeHeight(e,g*o+p)-n)/i,E=(t.decodeHeight(e,h*o+d)-n)/i,S=(t.decodeHeight(e,h*o+p)-n)/i;return Mme(A,x,C,T,E,S)}function Mme(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function vU(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function h$e(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Za=Vp;function VE(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var wA=new ce;function p$e(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}VE.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)p$e(e,g,p,s)||s.push(new FE(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,wA);let a=wA.west,c=wA.north;o.tileXYToRectangle(i,r,e,wA);let u=wA.east,f=wA.south,d=new x$e(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];fj(g.extent,d)&&C$e(this._maximumLevel,g,d)}};VE.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(UE(i.extent,e)){t=i;break}}return l(t)?aD(void 0,t,e):-1};var _$e=[],g$e=[],y$e=new ce,A$e=new ce;VE.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=_$e;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,y$e)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,A$e))):t.push(e);let n=g$e;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)cD(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Bme=new he;VE.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,wA);return ce.center(i,Bme),this.computeMaximumLevelAtPosition(Bme)>=e};VE.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function FE(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(FE.prototype,{nw:{get:function(){return this._nw||(this._nw=new FE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new FE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new FE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new FE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function x$e(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function fj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function C$e(e,t,n){for(;t.level<e;)if(wU(t.nw.extent,n))t=t.nw;else if(wU(t.ne.extent,n))t=t.ne;else if(wU(t.sw.extent,n))t=t.sw;else if(wU(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Or(t.rectangles,n.level,T$e);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function T$e(e,t){return e.level-t}function wU(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function UE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function aD(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&UE(t._nw.extent,n),s=t._ne&&UE(t._ne.extent,n),a=t._sw&&UE(t._sw.extent,n),c=t._se&&UE(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,aD(t,t._nw,n))),s&&(i=Math.max(i,aD(t,t._ne,n))),a&&(i=Math.max(i,aD(t,t._sw,n))),c&&(i=Math.max(i,aD(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];UE(a,n)&&(i=a.level)}t=t.parent}return i}function cD(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||fj(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=E$e(e[s.level],s)}cD(e,t._nw,n),cD(e,t._ne,n),cD(e,t._sw,n),cD(e,t._se,n)}function E$e(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];fj(r,t)?(r.west<t.west&&n.push(new ce(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ce(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ce(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ce(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var ih=VE;function b$e(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` -${r}`),t}var kp=b$e;function DU(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=y(o,0),this.retry=!1,this.error=s}DU.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new DU(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${kp(i)}`),c};DU.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Ti=DU;function sy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Pi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(sy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});sy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};sy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};sy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),r=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=r.x,t.north=r.y,t):new ce(i.x,i.y,r.x,r.y)};sy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ce(a,d,c,f)};sy.prototype.tileXYToRectangle=function(e,t,n,i){let r=this.tileXYToNativeRectangle(e,t,n,i),o=this._projection,s=o.unproject(new H(r.west,r.south)),a=o.unproject(new H(r.east,r.north));return r.west=s.longitude,r.south=s.latitude,r.east=a.longitude,r.north=a.latitude,r};sy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,h=p/a|0;h>=r&&(h=r-1);let A=g/u|0;return A>=o&&(A=o-1),l(n)?(n.x=h,n.y=A,n):new H(h,A)};var Uo=sy;var S$e=15;function dj(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}dj.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function v$e(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=y(i.latestWkid,i.wkid),o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ce.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new Wi(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(o.xmin,o.ymin),s.rectangleNortheastInMeters=new H(o.xmax,o.ymax),e.tilingScheme=new Uo(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Md.LERC:Md.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new ih(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new ih(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Lme(e,t,n){try{let i=await t.fetchJson();v$e(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function ay(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new _e,l(e.url)){$("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new dj(e);this._readyPromise=Promise.resolve(e.url).then(async function(r){let o=ve.createIfNeeded(r);o.appendForwardSlash(),l(t)&&(o=o.getDerivedResource({queryParameters:{token:t}})),n._resource=o;let s=o.getDerivedResource({queryParameters:{f:"pjson"}});return await Lme(i,s,n),i.build(n),!0})}}Object.defineProperties(ay.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});ay.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new dj(t);await Lme(r,i);let o=new ay(t);return r.build(o),o._resource=n,o};ay.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(mj(this,n+1,e*2,t*2))){let d=Nme(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Za({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):S$e,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===ni.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ni.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function mj(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}ay.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ay.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=mj(this,n,e,t);if(l(i))return i;Nme(this,n,e,t)};ay.prototype.loadTileDataAvailability=function(e,t,n){};function w$e(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new H(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let h=e.y;h<g;++h)if(i[h*t+u.x]!==s){f=!0;break}f?(a.push(new H(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let h=u.y*t;for(let A=e.x;A<=p;++A)if(i[h+A]!==s){d=!0;break}d?(a.push(new H(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function D$e(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new H(0,0)];for(;a.length>0;){let c=a.pop(),u=w$e(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function Nme(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new $r({throttle:!1,throttleByServer:!0,type:ns.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=D$e(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let h=e._tilesAvailable;for(let A=0;A<g.length;++A){let x=g[A];h.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return mj(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var Fme=ay;var Ume="https://dev.virtualearth.net/REST/v1/Locations";function hj(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new ve({url:Ume,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(hj.prototype,{url:{get:function(){return Ume}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});hj.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ce.fromDegrees(a,s,u,c)}})})};var Vme=hj;function pj(){}Object.defineProperties(pj.prototype,{credit:{get:function(){}}});pj.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:m.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var IU=pj;var I$e=new oe,kme=new m,kE=new m;function P$e(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let u=(a-i)*r;return m.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new m);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=I$e;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=m.subtract(t[2],c,kme),m.multiplyByScalar(d,.5,d),p=B.multiplyByVector(D0.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=m.subtract(u,t[o-1],kme),m.multiplyByScalar(f,.5,f),p=B.multiplyByVector(D0.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=B.multiplyByVector(cy.catmullRomCoefficientMatrix,a,a)),r=m.multiplyByScalar(c,p.x,r),m.multiplyByScalar(u,p.y,kE),m.add(r,kE,r),m.multiplyByScalar(f,p.z,kE),m.add(r,kE,r),m.multiplyByScalar(d,p.w,kE),m.add(r,kE,r)}}var O$e=new m,R$e=new m;function cy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=O$e,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=R$e,m.multiplyByScalar(t[o-1],2,r),m.subtract(t[o],r,r),m.add(r,t[o-2],r),m.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(r),this._evaluateFunction=P$e(this),this._lastTimeIndex=0}Object.defineProperties(cy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});cy.catmullRomCoefficientMatrix=new B(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);cy.prototype.findTimeInterval=rr.prototype.findTimeInterval;cy.prototype.wrapTime=rr.prototype.wrapTime;cy.prototype.clampTime=rr.prototype.clampTime;cy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var zme=cy;var PU={};PU.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,h,A;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(h=(e-r)/(n-r),A=(e-r)/(i-r),o.push(0),o.push(1),A!==1&&(o.push(-1),o.push(2),o.push(1),o.push(A)),h!==1&&(o.push(-1),o.push(2),o.push(0),o.push(h))):u===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(h)):!a&&i!==e?(A=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(A),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};PU.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),h=t-a,A=e-s,x=(d*A+f*h)*g,C=(-p*A+u*h)*g,T=1-x-C;return l(c)?(c.x=x,c.y=C,c.z=T,c):new m(x,C,T)};PU.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var ly=PU;function uy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=RU(e.westIndices,r,t),this._southIndices=RU(e.southIndices,o,t),this._eastIndices=RU(e.eastIndices,r,t),this._northIndices=RU(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(uy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var OU=[];function RU(e,t,n){OU.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)OU[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(OU.sort(t),Ue.createTypedArray(n,OU)):e}var Hme="createVerticesFromQuantizedTerrainMesh",M$e=new pi(Hme),B$e=new pi(Hme,nh.maximumAsynchronousTasks);uy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?B$e:M$e).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,A=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Ue.createTypedArray(A,g.indices),C=new Float32Array(g.vertices),T=g.center,E=g.minimumHeight,S=g.maximumHeight,w=p._boundingSphere,D=p._orientedBoundingBox,R=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),O=g.vertexStride,L=Oc.clone(g.encoding);return p._mesh=new Bd(T,C,x,g.indexCountWithoutSkirts,h,E,S,w,R,O,D,L,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var L$e=new pi("upsampleQuantizedTerrainMesh",nh.maximumAsynchronousTasks);uy.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=L$e.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,A=u?g*.5:this._southSkirtHeight,x=c?this._eastSkirtHeight:g*.5,C=u?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(E){let S=new Uint16Array(E.vertices),w=Ue.createTypedArray(S.length/3,E.indices),D;return l(E.encodedNormals)&&(D=new Uint8Array(E.encodedNormals)),new uy({quantizedVertices:S,indices:w,encodedNormals:D,minimumHeight:E.minimumHeight,maximumHeight:E.maximumHeight,boundingSphere:ae.clone(E.boundingSphere),orientedBoundingBox:Ln.clone(E.orientedBoundingBox),horizonOcclusionPoint:m.clone(E.horizonOcclusionPoint),westIndices:E.westIndices,southIndices:E.southIndices,eastIndices:E.eastIndices,northIndices:E.northIndices,westSkirtHeight:h,southSkirtHeight:A,eastSkirtHeight:x,northSkirtHeight:C,childTileMask:0,credits:T,createdByUpsampling:!0})})};var _j=32767,Gme=new m;uy.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=_j;let r=P.clamp((n-e.south)/e.height,0,1);return r*=_j,l(this._mesh)?V$e(this,i,r):k$e(this,i,r)};function Wme(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var N$e=new H,F$e=new H,U$e=new H;function V$e(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,N$e),g=o.decodeTextureCoordinates(r,f,F$e),h=o.decodeTextureCoordinates(r,d,U$e);if(Wme(t,n,p.x,p.y,g.x,g.y,h.x,h.y)){let A=ly.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,Gme);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,u),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}}function k$e(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],h=i[d],A=r[u],x=r[f],C=r[d];if(Wme(t,n,p,A,g,x,h,C)){let T=ly.computeBarycentricCoordinates(t,n,p,A,g,x,h,C,Gme);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let E=T.x*o[u]+T.y*o[f]+T.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,E/_j)}}}}uy.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};uy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var zE=uy;function z$e(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function Aj(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}Aj.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata,e._ready=!0};async function Yme(e,t,n){if(!t.format){let A="The tile format is not specified in the layer.json file.";throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new de(A)}if(!t.tiles||t.tiles.length===0){let A="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new de(A)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let A=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new de(A)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Wi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Uo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let A=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new de(A)}if(e.levelZeroMaximumGeometricError=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let A=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new de(A)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new ih(e.tilingScheme,p.length);for(let A=0;A<p.length;++A){let x=p[A],C=e.tilingScheme.getNumberOfYTilesAtLevel(A);l(e.overallAvailability[A])||(e.overallAvailability[A]=[]);for(let T=0;T<x.length;++T){let E=x[T],S=C-E.endY-1,w=C-E.startY-1;e.overallAvailability[A].push([E.startX,S,E.endX,w]),g.addAvailableTileRange(A,E.startX,S,E.endX,w)}}}else l(d)&&(f=new ih(e.tilingScheme,u),g=new ih(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new z$e({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await MU(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function H$e(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Ti.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return MU(e,n);throw new de(i)}async function G$e(e,t,n){await Yme(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new ih(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function MU(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=G$e(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return l(n)&&n.statusCode===404?(await Yme(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),H$e(e,n,t))}}function uu(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),l(e.url)&&($("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=uu._initializeReadyPromise(e,this))}uu._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new Aj(e),r=ve.createIfNeeded(n);return r.appendForwardSlash(),i.lastResource=r,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await MU(i,t),i.build(t),!0};var gj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function jme(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function W$e(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Za({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function j$e(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,A=Uint16Array.BYTES_PER_ELEMENT,x=A*h,C=new DataView(t),T=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let E=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let w=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let D=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=new Uint16Array(t,a,R*3);a+=R*g,R>64*1024&&(A=Uint32Array.BYTES_PER_ELEMENT,x=A*h);let L=O.subarray(0,R),N=O.subarray(R,2*R),_=O.subarray(R*2,3*R);qn.zigZagDeltaDecode(L,N,_),a%A!==0&&(a+=A-a%A);let b=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=Ue.createTypedArrayFromArrayBuffer(R,t,a,b*h);a+=b*x;let I=0,M=v.length;for(let se=0;se<M;++se){let pe=v[se];v[se]=I-pe,pe===0&&++I}let F=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let k=Ue.createTypedArrayFromArrayBuffer(R,t,a,F);a+=F*A;let V=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ue.createTypedArrayFromArrayBuffer(R,t,a,V);a+=V*A;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Ue.createTypedArrayFromArrayBuffer(R,t,a,U);a+=U*A;let Y=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=Ue.createTypedArrayFromArrayBuffer(R,t,a,Y);a+=Y*A;let W,K;for(;a<C.byteLength;){let se=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let pe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,se===gj.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,R*2);else if(se===gj.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,pe);else if(se===gj.METADATA&&e._requestMetadata){let xe=C.getUint32(a,!0);if(xe>0){let Ee=Mr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Ee))for(let Be=0;Be<Ee.length;++Be){let ke=n+Be+1,Pe=Ee[Be],ft=e._tilingScheme.getNumberOfYTilesAtLevel(ke);for(let _t=0;_t<Pe.length;++_t){let rt=Pe[_t],dn=ft-rt.endY-1,In=ft-rt.startY-1;e.availability.addAvailableTileRange(ke,rt.startX,dn,rt.endX,In),o.availability.addAvailableTileRange(ke,rt.startX,dn,rt.endX,In)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=pe}let J=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,r,n),ye=Ln.fromRectangle(me,E,S,e._tilingScheme.ellipsoid);return new zE({center:T,minimumHeight:E,maximumHeight:S,boundingSphere:w,orientedBoundingBox:ye,horizonOcclusionPoint:D,quantizedVertices:O,encodedNormals:W,indices:v,westIndices:k,southIndices:G,eastIndices:q,northIndices:Q,westSkirtHeight:J,southSkirtHeight:J,eastSkirtHeight:J,northSkirtHeight:J,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:K,credits:e._tileCredits})}uu.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length;if(s===1)o=r[0];else for(let a=0;a<s;++a){let c=r[a];if(!l(c.availability)||c.availability.isTileAvailable(n,e,t)){o=c;break}}return qme(this,e,t,n,o,i)};function qme(e,t,n,i,r,o){if(!l(r))return Promise.reject(new de("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=jme(void 0)):u=jme(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(h){return l(h)?l(e._heightmapStructure)?W$e(e,h,i,t,n):j$e(e,h,i,t,n,r):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(uu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});uu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};uu.fromIonAssetId=async function(e,t){let n=await ma.fromAssetId(e);return uu.fromUrl(n,t)};uu.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=new Aj(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await MU(i);let r=new uu(t);return i.build(r),r};uu.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(Xme(this,e,t,n,i[o],o===0).result)return;return!1};uu.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=Xme(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function yj(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function Xme(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=yj(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new $r({throttle:!1,throttleByServer:!0,type:ns.TERRAIN});d=qme(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=yj(r,f.x,f.y,f.level)}return{result:!1}}uu._getAvailabilityTile=yj;var DA=uu;function zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new cl(n),this._workerName="createCircleGeometry"}zp.packedLength=cl.packedLength;zp.pack=function(e,t,n){return cl.pack(e._ellipseGeometry,t,n)};var Y$e=new cl({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Qa={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Oe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};zp.unpack=function(e,t,n){let i=cl.unpack(e,t,Y$e);return Qa.center=m.clone(i._center,Qa.center),Qa.ellipsoid=re.clone(i._ellipsoid,Qa.ellipsoid),Qa.height=i._height,Qa.extrudedHeight=i._extrudedHeight,Qa.granularity=i._granularity,Qa.vertexFormat=Oe.clone(i._vertexFormat,Qa.vertexFormat),Qa.stRotation=i._stRotation,Qa.shadowVolume=i._shadowVolume,l(n)?(Qa.semiMajorAxis=i._semiMajorAxis,Qa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new cl(Qa),n):(Qa.radius=i._semiMajorAxis,new zp(Qa))};zp.createGeometry=function(e){return cl.createGeometry(e._ellipseGeometry)};zp.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new zp({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Oe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(zp.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Kme=zp;function HE(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new af(n),this._workerName="createCircleOutlineGeometry"}HE.packedLength=af.packedLength;HE.pack=function(e,t,n){return af.pack(e._ellipseGeometry,t,n)};var q$e=new af({center:new m,semiMajorAxis:1,semiMinorAxis:1}),fu={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};HE.unpack=function(e,t,n){let i=af.unpack(e,t,q$e);return fu.center=m.clone(i._center,fu.center),fu.ellipsoid=re.clone(i._ellipsoid,fu.ellipsoid),fu.height=i._height,fu.extrudedHeight=i._extrudedHeight,fu.granularity=i._granularity,fu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(fu.semiMajorAxis=i._semiMajorAxis,fu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new af(fu),n):(fu.radius=i._semiMajorAxis,new HE(fu))};HE.createGeometry=function(e){return af.createGeometry(e._ellipseGeometry)};var Jme=HE;function X$e(e){$("createWorldTerrain","createWorldTerrain was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldTerrainAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=new DA({requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)});return t._readyPromise=DA._initializeReadyPromise({url:ma.fromAssetId(1),requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)},t),t}var Zme=X$e;function K$e(e){return e=y(e,y.EMPTY_OBJECT),DA.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)})}var GE=K$e;function WE(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Wi({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(WE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("CustomHeightmapTerrainProvider.ready","CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("CustomHeightmapTerrainProvider.readyPromise","CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});WE.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Za({buffer:c,width:o,height:s})})};WE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};WE.prototype.getTileDataAvailable=function(e,t,n){};WE.prototype.loadTileDataAvailability=function(e,t,n){};var Qme=WE;var J$e=1953029805,Z$e=2917034100;function xj(e,t){if(xj.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new de("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===J$e||r===Z$e)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}xj.passThroughDataForTesting=!1;var BU=xj;function $me(e){this.proxy=e}$me.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var ehe=$me;function Ld(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Ld.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Ld.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Ld({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Ld.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Ld.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)the(this,t)};Ld.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,the(this,i),t};Ld.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],nhe(this,0)),this._array[e-1]=void 0,t};Ld.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Cj(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&nhe(this,n)}return this._array[e-1]=void 0,t};Ld.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Ld.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Cj(this,1,2)?1:2]};function LU(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function lD(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Cj(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function the(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=lD(e,t,i);for(r!==n&&(LU(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(lD(e,t,o)!==r)break;LU(e,t,o),t=o}}function nhe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){lD(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;lD(e,f,o)===i&&(o=f)}}if(lD(e,o,t)===i&&(LU(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);Cj(e,o,a)===i&&LU(e,o,a)}t=o}}var jE=Ld;function YE(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Wi({ellipsoid:y(e.ellipsoid,re.WGS84)})),this._levelZeroMaximumGeometricError=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(YE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("EllipsoidTerrainProvider.ready","EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("EllipsoidTerrainProvider.readyPromise","EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});YE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Za({buffer:new Uint8Array(16*16),width:16,height:16}))};YE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};YE.prototype.getTileDataAvailable=function(e,t,n){};YE.prototype.loadTileDataAvailability=function(e,t,n){};var qE=YE;function rh(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new is,this._perspectiveMatrix=new B,this._infinitePerspective=new B}function Tj(e){let t=e.top,n=e.bottom,i=e.right,r=e.left,o=e.near,s=e.far;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=B.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=B.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(rh.prototype,{projectionMatrix:{get:function(){return Tj(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Tj(this),this._infinitePerspective}}});var Q$e=new m,$$e=new m,eet=new m,tet=new m;rh.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,Q$e),d=$$e;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=eet;m.multiplyByScalar(t,u,p),m.add(e,p,p);let g=tet;m.multiplyByScalar(f,a,g),m.add(d,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let h=i[0];return l(h)||(h=i[0]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(f,s,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),h=i[1],l(h)||(h=i[1]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(f,g,g),m.normalize(g,g),h=i[2],l(h)||(h=i[2]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(g,f,g),m.normalize(g,g),h=i[3],l(h)||(h=i[3]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),h=i[4],l(h)||(h=i[4]=new oe),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,d),m.negate(t,g),h=i[5],l(h)||(h=i[5]=new oe),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,p),this._cullingVolume};rh.prototype.getPixelDimensions=function(e,t,n,i,r){Tj(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};rh.prototype.clone=function(e){return l(e)||(e=new rh),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};rh.prototype.equals=function(e){return l(e)&&e instanceof rh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};rh.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof rh&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var pl=rh;function _l(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new pl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}_l.packedLength=6;_l.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};_l.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new _l),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Nd(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(_l.prototype,{projectionMatrix:{get:function(){return Nd(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Nd(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Nd(this),this._fovy}},sseDenominator:{get:function(){return Nd(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Nd(this),this._offCenterFrustum}}});_l.prototype.computeCullingVolume=function(e,t,n){return Nd(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};_l.prototype.getPixelDimensions=function(e,t,n,i,r){return Nd(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};_l.prototype.clone=function(e){return l(e)||(e=new _l),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};_l.prototype.equals=function(e){return!l(e)||!(e instanceof _l)?!1:(Nd(this),Nd(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};_l.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof _l)?!1:(Nd(this),Nd(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var vi=_l;var NU=0,net=1;function IA(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e.vertexFormat,Oe.DEFAULT),o=y(e._drawNearPlane,!0),s,a;t instanceof vi?(s=NU,a=vi.packedLength):t instanceof rn&&(s=net,a=rn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Ne.packedLength+Oe.packedLength}IA.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===NU?(vi.pack(r,t,n),n+=vi.packedLength):(rn.pack(r,t,n),n+=rn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,Oe.pack(e._vertexFormat,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var iet=new vi,ret=new rn,oet=new Ne,set=new m,aet=new Oe;IA.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===NU?(r=vi.unpack(e,t,iet),t+=vi.packedLength):(r=rn.unpack(e,t,ret),t+=rn.packedLength);let o=m.unpack(e,t,set);t+=m.packedLength;let s=Ne.unpack(e,t,oet);t+=Ne.packedLength;let a=Oe.unpack(e,t,aet);t+=Oe.packedLength;let c=e[t]===1;if(!l(n))return new IA({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Ne.clone(s,n._orientation),n._vertexFormat=Oe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function XE(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var cet=new Z,uet=new B,Ej=new B,ihe=new m,rhe=new m,ohe=new m,fet=new m,det=new m,met=new m,fy=new Array(3),uD=new Array(4);uD[0]=new oe(-1,-1,1,1);uD[1]=new oe(1,-1,1,1);uD[2]=new oe(1,1,1,1);uD[3]=new oe(-1,1,1,1);var she=new Array(4);for(let e=0;e<4;++e)she[e]=new oe;IA._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=Z.fromQuaternion(t,cet),u=y(o,ihe),f=y(s,rhe),d=y(a,ohe);u=Z.getColumn(c,0,u),f=Z.getColumn(c,1,f),d=Z.getColumn(c,2,d),m.normalize(u,u),m.normalize(f,f),m.normalize(d,d),m.negate(u,u);let p=B.computeView(e,d,f,u,uet),g,h,A=i.projectionMatrix;if(n===NU){let x=B.multiply(A,p,Ej);h=B.inverse(x,Ej)}else g=B.inverseTransformation(p,Ej);l(h)?(fy[0]=i.near,fy[1]=i.far):(fy[0]=0,fy[1]=i.near,fy[2]=i.far);for(let x=0;x<2;++x)for(let C=0;C<4;++C){let T=oe.clone(uD[C],she[C]);if(l(h)){T=B.multiplyByVector(h,T,T);let E=1/T.w;m.multiplyByScalar(T,E,T),m.subtract(T,e,T),m.normalize(T,T);let S=m.dot(d,T);m.multiplyByScalar(T,fy[x]/S,T),m.add(T,e,T)}else{let E=i.offCenterFrustum;l(E)&&(i=E);let S=fy[x],w=fy[x+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(S-w)-S-w)*.5,T.w=1,B.multiplyByVector(g,T,T)}r[12*x+C*3]=T.x,r[12*x+C*3+1]=T.y,r[12*x+C*3+2]=T.z}};IA.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(3*4*6);IA._computeNearFarPlanes(i,r,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[3+1],c[u+5]=c[3+2],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[3+1],c[u+2]=c[3+2],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],o||(c=c.subarray(3*4));let f=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,h=l(s.bitangent)?new Float32Array(3*4*a):void 0,A=l(s.st)?new Float32Array(2*4*a):void 0,x=ihe,C=rhe,T=ohe,E=m.negate(x,fet),S=m.negate(C,det),w=m.negate(T,met);u=0,o&&(XE(u,p,g,h,A,w,x,C),u+=3*4),XE(u,p,g,h,A,T,E,C),u+=3*4,XE(u,p,g,h,A,E,w,C),u+=3*4,XE(u,p,g,h,A,S,w,E),u+=3*4,XE(u,p,g,h,A,x,T,C),u+=3*4,XE(u,p,g,h,A,C,T,E),l(p)&&(f.normal=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),l(h)&&(f.bitangent=new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),l(A)&&(f.st=new De({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,h=p*4;d[g]=h,d[g+1]=h+1,d[g+2]=h+2,d[g+3]=h,d[g+4]=h+2,d[g+5]=h+3}return new dt({attributes:f,indices:d,primitiveType:Le.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var KE=IA;var bj=0,het=1;function fD(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e._drawNearPlane,!0),o,s;t instanceof vi?(o=bj,s=vi.packedLength):t instanceof rn&&(o=het,s=rn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Ne.packedLength}fD.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===bj?(vi.pack(r,t,n),n+=vi.packedLength):(rn.pack(r,t,n),n+=rn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var pet=new vi,_et=new rn,get=new Ne,yet=new m;fD.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===bj?(r=vi.unpack(e,t,pet),t+=vi.packedLength):(r=rn.unpack(e,t,_et),t+=rn.packedLength);let o=m.unpack(e,t,yet);t+=m.packedLength;let s=Ne.unpack(e,t,get);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new fD({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=m.clone(o,n._origin),n._orientation=Ne.clone(s,n._orientation),n._drawNearPlane=a,n};fD.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(3*4*2);KE._computeNearFarPlanes(i,r,t,n,s);let a=new gn({position:new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new dt({attributes:a,indices:d,primitiveType:Le.LINES,boundingSphere:ae.fromVertices(s)})};var FU=fD;function UU(){fe.throwInstantiationError()}Object.defineProperties(UU.prototype,{credit:{get:fe.throwInstantiationError}});UU.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};UU.prototype.geocode=fe.throwInstantiationError;var dD=UU;var Aet={SEARCH:0,AUTOCOMPLETE:1},PA=Object.freeze(Aet);function ahe(){fe.throwInstantiationError()}ahe.createGeometry=function(e){fe.throwInstantiationError()};var che=ahe;function xet(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var VU=xet;var wet=co(Sj(),1);function Cet(e,t){return(e&t)!==0}var Mc=Cet;var Tet=[1,2,4,8],lhe=15,Eet=16,bet=64,vet=128;function oh(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}oh.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new oh(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};oh.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};oh.prototype.hasSubtree=function(){return Mc(this._bits,Eet)};oh.prototype.hasImagery=function(){return Mc(this._bits,bet)};oh.prototype.hasTerrain=function(){return Mc(this._bits,vet)};oh.prototype.hasChildren=function(){return Mc(this._bits,lhe)};oh.prototype.hasChild=function(e){return Mc(this._bits,Tet[e])};oh.prototype.getChildBitmask=function(){return this._bits&lhe};var kU=oh;function Det(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var Iet=Det(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function du(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),l(e)){$("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=fhe(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(r){let o=`An error occurred while accessing ${Ij(i,"",1).url}.`;return Promise.reject(new de(o))})}}Object.defineProperties(du.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});du.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new du;i._resource=n;try{await fhe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Ij(i,"",1).url}: ${r}`;throw new de(o)}return i};du.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Mc(t,o)?Mc(e,o)&&(s|=1):(s|=2,Mc(e,o)||(s|=1)),i+=s}return i};du.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Mc(s,2)?Mc(s,1)||(t|=o):(n|=o,Mc(s,1)&&(t|=o))}return{x:t,y:n,level:i}};du.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var uhe=new pi("decodeGoogleEarthEnterprisePacket");du.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let r=Ij(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return uhe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let h=u[e];f=o[e],f._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,A){return h.length-A.length});let g=p.length;for(let h=0;h<g;++h){let A=p[h];if(u[A]!==null){let C=kU.clone(u[A]),T=A.length;if(T===d)C.setParent(f);else if(T>1){let E=o[A.substring(0,A.length-1)];C.setParent(E)}o[A]=C}else o[A]=null}})})};du.prototype.populateSubtree=function(e,t,n,i){let r=du.tileXYToQuadKey(e,t,n);return Dj(this,r,i)};function Dj(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new $r({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Dj(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new $r({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Dj(e,t,s)}).finally(function(){delete a[r]})}du.prototype.getTileInformation=function(e,t,n){let i=du.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};du.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Ij(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var vj,wj;function fhe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(wj)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;wj=Rx(n).then(function(){vj=window.cesiumGoogleEarthDbRootParser(wet),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return wj.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=vj.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return uhe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=vj.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let r=e.providers,o=y(i.providerInfo,[]),s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Iet})}var sh=du;function OA(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(OA.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var hhe="createVerticesFromGoogleEarthEnterpriseBuffer",Pet=new pi(hhe),Oet=new pi(hhe,nh.maximumAsynchronousTasks),dhe=new ce,Pj=new ce;OA.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,dhe),t.tileXYToRectangle(n,i,r,Pj);let u=c.cartographicToCartesian(ce.center(Pj)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?Oet:Pet).scheduleTask({buffer:this._buffer,nativeRectangle:dhe,rectangle:Pj,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let h=this;return g.then(function(A){return h._mesh=new Bd(u,new Float32Array(A.vertices),new Uint16Array(A.indices),A.indexCountWithoutSkirts,A.vertexCountWithoutSkirts,A.minimumHeight,A.maximumHeight,ae.clone(A.boundingSphere3D),m.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Ln.clone(A.orientedBoundingBox),Oc.clone(A.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),h._minimumHeight=A.minimumHeight,h._maximumHeight=A.maximumHeight,h._buffer=void 0,h._mesh})};OA.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),r=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Net(this,i,r):Vet(this,i,r,e)};var Ret=new pi("upsampleQuantizedTerrainMesh",nh.maximumAsynchronousTasks);OA.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Ret.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(h){let A=new Uint16Array(h.vertices),x=Ue.createTypedArray(A.length/3,h.indices),C=g._skirtHeight;return new zE({quantizedVertices:A,indices:x,minimumHeight:h.minimumHeight,maximumHeight:h.maximumHeight,boundingSphere:ae.clone(h.boundingSphere),orientedBoundingBox:Ln.clone(h.orientedBoundingBox),horizonOcclusionPoint:m.clone(h.horizonOcclusionPoint),westIndices:h.westIndices,southIndices:h.southIndices,eastIndices:h.eastIndices,northIndices:h.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};OA.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};OA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Met=new H,Bet=new H,Let=new H,phe=new m;function Net(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,Met),g=o.decodeTextureCoordinates(r,f,Bet),h=o.decodeTextureCoordinates(r,d,Let),A=ly.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,phe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let x=o.decodeHeight(r,u),C=o.decodeHeight(r,f),T=o.decodeHeight(r,d);return A.x*x+A.y*C+A.z*T}}}var Fet=Uint16Array.BYTES_PER_ELEMENT,mhe=Uint32Array.BYTES_PER_ELEMENT,Oj=Int32Array.BYTES_PER_ELEMENT,Uet=Float32Array.BYTES_PER_ELEMENT,Rj=Float64Array.BYTES_PER_ELEMENT;function Vet(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let w=0;w<o;++w)u+=c.getUint32(u,!0),u+=mhe;u+=mhe,u+=2*Rj;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Rj;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Rj;let p=i.width/f/2,g=i.height/d/2,h=c.getInt32(u,!0);u+=Oj;let A=c.getInt32(u,!0)*3;u+=Oj,u+=Oj;let x=new Array(h),C=new Array(h),T=new Array(h),E;for(E=0;E<h;++E)x[E]=s+c.getUint8(u++)*p,C[E]=a+c.getUint8(u++)*g,T[E]=c.getFloat32(u,!0)*6371010,u+=Uet;let S=new Array(A);for(E=0;E<A;++E)S[E]=c.getUint16(u,!0),u+=Fet;for(E=0;E<A;E+=3){let w=S[E],D=S[E+1],R=S[E+2],O=x[w],L=x[D],N=x[R],_=C[w],b=C[D],v=C[R],I=ly.computeBarycentricCoordinates(t,n,O,_,L,b,N,v,phe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*T[w]+I.y*T[D]+I.z*T[R]}}var mD=OA;var _f={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},zU=new ee;function HU(){this._terrainCache={},this._lastTidy=ee.now()}HU.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};HU.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};HU.prototype.tidy=function(){if(ee.now(zU),ee.secondsDifference(zU,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];ee.secondsDifference(zU,o.timestamp)>10&&delete e[r]}ee.clone(zU,this._lastTidy)}};function dy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Wi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new HU,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e,this._ready=!1,l(e.url)){$("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=ve.createIfNeeded(e.url),i=this,r;this._readyPromise=sh.fromUrl(n).then(o=>{if(!o.terrainPresent){let s=new de(`The server ${o.url} doesn't have terrain`);return Promise.reject(s)}return Ti.reportSuccess(r),i._metadata=o,i._ready=!0,!0}).catch(o=>{throw r=Ti.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),o})}else if(l(e.metadata)){$("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(dy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});dy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new dy(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var ket=new pi("decodeGoogleEarthEnterprisePacket");function _he(e,t,n){let i=t.getChildBitmask();if(t.terrainState===_f.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}dy.prototype.requestTileGeometry=function(e,t,n,i){let r=sh.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new de("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=_f.UNKNOWN);let u=o.get(r);if(l(u)){let C=s.providers[a.terrainProvider];return Promise.resolve(new mD({buffer:u,childTileMask:_he(r,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===_f.NONE)return Promise.reject(new de("Terrain tile doesn't exist"))}else return Promise.resolve(new Za({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=r,p=-1;switch(c){case _f.SELF:p=a.terrainVersion;break;case _f.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case _f.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new de("Terrain tile doesn't exist"));let g=this._terrainPromises,h=this._terrainRequests,A,x;if(l(g[d]))A=g[d],x=h[d];else{x=i;let C=zet(this,d,p,x).fetchArrayBuffer();if(!l(C))return;A=C.then(function(T){return l(T)?ket.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(E){let S=s.getTileInformationFromQuadKey(d);S.terrainState=_f.SELF,o.add(d,E[0]);let w=S.terrainProvider,D=E.length-1;for(let R=0;R<D;++R){let O=d+R.toString(),L=s.getTileInformationFromQuadKey(O);l(L)&&(o.add(O,E[R+1]),L.terrainState=_f.PARENT,L.terrainProvider===0&&(L.terrainProvider=w))}}):Promise.reject(new de("Failed to load terrain."))}),g[d]=A,h[d]=x,A=A.finally(function(){delete g[d],delete h[d]})}return A.then(function(){let C=o.get(r);if(l(C)){let T=s.providers[a.terrainProvider];return new mD({buffer:C,childTileMask:_he(r,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new de("Failed to load terrain."))}).catch(function(C){return x.state===ni.CANCELLED?(i.state=x.state,Promise.reject(C)):(a.terrainState=_f.NONE,Promise.reject(C))})};dy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};dy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=sh.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===_f.NONE)return!1;if((!l(s)||s===_f.UNKNOWN)&&(o.terrainState=_f.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new $r({throttle:!1,throttleByServer:!0,type:ns.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};dy.prototype.loadTileDataAvailability=function(e,t,n){};function zet(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var ghe=dy;function Het(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var GU=Het;var Ohe={},Get=32.184,Wet=2451545,yhe=-.0529921,Ahe=-.1059842,xhe=13.0120009,Che=13.3407154,The=.9856003,Ehe=26.4057084,bhe=13.064993,She=.3287146,vhe=1.7484877,whe=-.1589763,Dhe=.0036096,Ihe=.1643573,Phe=12.9590088,Mj=new ee;Ohe.ComputeMoon=function(e,t){l(e)||(e=ee.now()),Mj=ee.addSeconds(e,Get,Mj);let n=ee.totalDays(Mj)-Wet,i=n/Zn.DAYS_PER_JULIAN_CENTURY,r=(125.045+yhe*n)*P.RADIANS_PER_DEGREE,o=(250.089+Ahe*n)*P.RADIANS_PER_DEGREE,s=(260.008+xhe*n)*P.RADIANS_PER_DEGREE,a=(176.625+Che*n)*P.RADIANS_PER_DEGREE,c=(357.529+The*n)*P.RADIANS_PER_DEGREE,u=(311.589+Ehe*n)*P.RADIANS_PER_DEGREE,f=(134.963+bhe*n)*P.RADIANS_PER_DEGREE,d=(276.617+She*n)*P.RADIANS_PER_DEGREE,p=(34.226+vhe*n)*P.RADIANS_PER_DEGREE,g=(15.134+whe*n)*P.RADIANS_PER_DEGREE,h=(119.743+Dhe*n)*P.RADIANS_PER_DEGREE,A=(239.961+Ihe*n)*P.RADIANS_PER_DEGREE,x=(25.053+Phe*n)*P.RADIANS_PER_DEGREE,C=Math.sin(r),T=Math.sin(o),E=Math.sin(s),S=Math.sin(a),w=Math.sin(c),D=Math.sin(u),R=Math.sin(f),O=Math.sin(d),L=Math.sin(p),N=Math.sin(g),_=Math.sin(h),b=Math.sin(A),v=Math.sin(x),I=Math.cos(r),M=Math.cos(o),F=Math.cos(s),k=Math.cos(a),V=Math.cos(c),G=Math.cos(u),U=Math.cos(f),q=Math.cos(d),Y=Math.cos(p),Q=Math.cos(g),W=Math.cos(h),K=Math.cos(A),J=Math.cos(x),me=(269.9949+.0031*i-3.8787*C-.1204*T+.07*E-.0172*S+.0072*D-.0052*N+.0043*v)*P.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*I+.0239*M-.0278*F+.0068*k-.0029*G+9e-4*U+8e-4*Q-9e-4*J)*P.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*T-.0642*E+.0158*S+.0252*w-.0066*D-.0047*R-.0046*O+.0028*L+.0052*N+.004*_+.0019*b-.0044*v)*P.RADIANS_PER_DEGREE,pe=(13.17635815-14e-13*(2*n)+3.561*I*yhe+.1208*M*Ahe-.0642*F*xhe+.0158*k*Che+.0252*V*The-.0066*G*Ehe-.0047*U*bhe-.0046*q*She+.0028*Y*vhe+.0052*Q*whe+.004*W*Dhe+.0019*K*Ihe-.0044*J*Phe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new GU),t.rightAscension=me,t.declination=ye,t.rotation=se,t.rotationRate=pe,t};var WU=Ohe;function Rhe(e){(!l(e)||typeof e!="function")&&(e=WU.ComputeMoon),this._computeFunction=e}var jet=new m,Yet=new m,qet=new m;function Xet(e,t,n){let i=jet;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=qet;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=m.cross(o,i,Yet);return l(n)||(n=new Z),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var Ket=new Z,Jet=new Ne;Rhe.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=Xet(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Ne.fromAxisAngle(m.UNIT_Z,r,Jet),s=Z.fromQuaternion(Ne.conjugate(o,o),Ket);return Z.multiply(s,i,i)};var jU=Rhe;var hD={};hD.type=void 0;hD.getRequiredDataPoints=fe.throwInstantiationError;hD.interpolateOrderZero=fe.throwInstantiationError;hD.interpolate=fe.throwInstantiationError;var Mhe=hD;function Bj(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Bj.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Bj.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===PA.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=m.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var YU=Bj;function Lj(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,_m.defaultAccessToken),n=ve.createIfNeeded(y(e.server,_m.defaultServer));n.appendForwardSlash();let i=_m.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(i));let r=n.getDerivedResource({url:"v1/geocode"});l(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new YU(r)}Object.defineProperties(Lj.prototype,{credit:{get:function(){}}});Lj.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var qU=Lj;var Zet={SHIFT:0,CTRL:1,ALT:2},Ca=Object.freeze(Zet);function XU(){fe.throwInstantiationError()}Object.defineProperties(XU.prototype,{ellipsoid:{get:fe.throwInstantiationError}});XU.prototype.project=fe.throwInstantiationError;XU.prototype.unproject=fe.throwInstantiationError;var Bhe=XU;var Nj=[],Fj=[];function Qet(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Nj,u=Fj,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],h=u[d];f<s&&(d>=a||t(g,h,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=h,++d)}}function Uj(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Uj(e,t,n,i,o),Uj(e,t,n,o+1,r),Qet(e,t,n,i,o,r)}function $et(e,t,n){let i=e.length,r=Math.ceil(i*.5);Nj.length=r,Fj.length=r,Uj(e,t,n,0,i-1),Nj.length=0,Fj.length=0}var my=$et;function JE(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(JE.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});JE.prototype.findTimeInterval=rr.prototype.findTimeInterval;JE.prototype.wrapTime=rr.prototype.wrapTime;JE.prototype.clampTime=rr.prototype.clampTime;JE.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var Lhe=JE;var ett={NONE:-1,PARTIAL:0,FULL:1},po=Object.freeze(ett);function $a(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var KU=new m;Object.defineProperties($a.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,KU),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=m.multiplyByScalar(t,n,KU);let a=r*r*n;s=m.add(e,m.multiplyByScalar(o,a,KU),KU)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});$a.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new $a(e,t)};var Fhe=new m;$a.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Fhe),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var ttt=new m;$a.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,ttt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Fhe),r=this._occluderRadius-n;if(r=m.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),r*r+n*n>m.magnitudeSquared(i)):!1;if(r>0){i=m.subtract(t,this._cameraPosition,i);let o=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var ntt=new m;$a.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return po.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,ntt),r=this._occluderRadius-n,o=m.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return r*r+n*n<s?po.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?po.FULL:po.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?po.PARTIAL:po.FULL))}}return po.NONE};var JU=new m;$a.computeOccludeePoint=function(e,t,n){let i=m.clone(t),r=m.clone(e.center),o=e.radius,s=n.length,a=m.normalize(m.subtract(i,r,JU),JU),c=-m.dot(a,r),u=$a._anyRotationVector(r,a,c),f=$a._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=$a._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return m.add(r,m.multiplyByScalar(a,p,JU),JU)};var itt=[];$a.computeOccludeePointFromRectangle=function(e,t){t=y(t,re.WGS84);let n=ce.subsample(e,t,0,itt),i=ae.fromPoints(n),r=m.ZERO;if(!m.equals(r,i.center))return $a.computeOccludeePoint(new ae(r,t.minimumRadius),i.center,n)};var rtt=new m;$a._anyRotationVector=function(e,t,n){let i=m.abs(t,rtt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new m,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,o),i),e,i),i)};var ott=new m;$a._rotationVector=function(e,t,n,i,r){let o=m.subtract(i,e,ott);if(o=m.normalize(o,o),m.dot(t,o)<.9999999847691291){let s=m.cross(t,o,o);if(m.magnitude(s)>P.EPSILON13)return m.normalize(s,new m)}return r};var Vj=new m,stt=new m,ZU=new m,Nhe=new m;$a._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=m.clone(r,Vj),s=m.clone(e.center,stt),a=e.radius,c=m.subtract(s,o,ZU),u=m.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),h=1/Math.sqrt(u),x=p*h*p;c=m.normalize(c,c);let C=m.add(o,m.multiplyByScalar(c,x,Nhe),Nhe),T=Math.sqrt(d-x*x),E=this._rotationVector(s,t,n,o,i),S=m.fromElements(E.x*E.x*c.x+(E.x*E.y-E.z)*c.y+(E.x*E.z+E.y)*c.z,(E.x*E.y+E.z)*c.x+E.y*E.y*c.y+(E.y*E.z-E.x)*c.z,(E.x*E.z-E.y)*c.x+(E.y*E.z+E.x)*c.y+E.z*E.z*c.z,Vj);S=m.normalize(S,S);let w=m.multiplyByScalar(S,T,Vj);E=m.normalize(m.subtract(m.add(C,w,ZU),s,ZU),ZU);let D=m.dot(t,E);E=m.normalize(m.subtract(m.subtract(C,w,E),s,E),E);let R=m.dot(t,E);return D<R?D:R};var QU=$a;function kj(e,t,n){e=ve.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(kj.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});kj.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:gt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ce.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;r=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var Uhe=kj;var att={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},Vhe=att;var ctt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},khe=ctt;var ltt=new m;function utt(e,t,n,i){let r=$x(e,t,n,i,ltt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var zhe=utt;function Hhe(){fe.throwInstantiationError()}Hhe.prototype.getURL=fe.throwInstantiationError;var Ghe=Hhe;var ftt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(ftt);function hy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=(t.clientX-r.left)*(i.offsetWidth/r.width),n.y=(t.clientY-r.top)*(i.offsetHeight/r.height),n}function Yj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function RA(e){if(e.shiftKey)return Ca.SHIFT;if(e.ctrlKey)return Ca.CTRL;if(e.altKey)return Ca.ALT}var cs={LEFT:0,MIDDLE:1,RIGHT:2};function mu(e,t,n,i){function r(o){i(e,o)}jt.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function dtt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;jt.supportsPointerEvents()?(mu(e,"pointerdown",t,ytt),mu(e,"pointerup",t,$he),mu(e,"pointermove",t,Att),mu(e,"pointercancel",t,$he)):(mu(e,"mousedown",t,epe),mu(e,"mouseup",n,tpe),mu(e,"mousemove",n,npe),mu(e,"touchstart",t,_tt),mu(e,"touchend",n,Xhe),mu(e,"touchmove",n,gtt),mu(e,"touchcancel",n,Xhe)),mu(e,"dblclick",t,htt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",mu(e,i,t,ptt)}function mtt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Whe={position:new H};function qj(e){e._lastSeenTouchEvent=Ci()}function Xj(e){return Ci()-e._lastSeenTouchEvent>Fd.mouseEmulationIgnoreMilliseconds}function jj(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function epe(e,t){if(!Xj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===cs.LEFT)i=Cn.LEFT_DOWN;else if(n===cs.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===cs.RIGHT)i=Cn.RIGHT_DOWN;else return;let r=hy(e,t,e._primaryPosition);H.clone(r,e._primaryStartPosition),H.clone(r,e._primaryPreviousPosition);let o=RA(t),s=e.getInputAction(i,o);l(s)&&(H.clone(r,Whe.position),s(Whe),t.preventDefault())}var jhe={position:new H},Yhe={position:new H};function zj(e,t,n,i){let r=RA(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=hy(e,i,e._primaryPosition);if(l(o)&&(H.clone(a,jhe.position),o(jhe)),l(s)){let c=e._primaryStartPosition;jj(c,a,e._clickPixelTolerance)&&(H.clone(a,Yhe.position),s(Yhe))}}}function tpe(e,t){if(!Xj(e))return;let n=t.button;n!==cs.LEFT&&n!==cs.MIDDLE&&n!==cs.RIGHT||(e._buttonDown[cs.LEFT]&&(zj(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[cs.LEFT]=!1),e._buttonDown[cs.MIDDLE]&&(zj(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[cs.MIDDLE]=!1),e._buttonDown[cs.RIGHT]&&(zj(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[cs.RIGHT]=!1))}var Hj={startPosition:new H,endPosition:new H};function npe(e,t){if(!Xj(e))return;let n=RA(t),i=hy(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(Cn.MOUSE_MOVE,n);l(o)&&(H.clone(r,Hj.startPosition),H.clone(i,Hj.endPosition),o(Hj)),H.clone(i,r),(e._buttonDown[cs.LEFT]||e._buttonDown[cs.MIDDLE]||e._buttonDown[cs.RIGHT])&&t.preventDefault()}var qhe={position:new H};function htt(e,t){let n=t.button,i;if(n===cs.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let r=RA(t),o=e.getInputAction(i,r);l(o)&&(hy(e,t,qhe.position),o(qhe))}function ptt(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=RA(t),r=e.getInputAction(Cn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function _tt(e,t){qj(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,hy(e,o,new H));$U(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,H.clone(a.get(s)))}function Xhe(e,t){qj(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);$U(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var Khe={position:new H},Gj={position1:new H,position2:new H},Jhe={position:new H},Zhe={position:new H},Qhe={position:new H};function $U(e,t){let n=RA(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[cs.LEFT]){if(e._buttonDown[cs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(Cn.LEFT_UP,n),l(o)&&(H.clone(e._primaryPosition,Jhe.position),o(Jhe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];jj(c,u,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,Zhe.position),s(Zhe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(Cn.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];H.clone(c,e._primaryPosition),H.clone(c,e._primaryStartPosition),H.clone(c,e._primaryPreviousPosition),e._buttonDown[cs.LEFT]=!0,o=e.getInputAction(Cn.LEFT_DOWN,n),l(o)&&(H.clone(c,Khe.position),o(Khe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];jj(u,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,Qhe.position),s(Qhe))}},Fd.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(Cn.PINCH_START,n),l(o)&&(H.clone(i.values[0],Gj.position1),H.clone(i.values[1],Gj.position2),o(Gj),t.preventDefault()))}function gtt(e,t){qj(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&hy(e,o,u)}ipe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,H.clone(a.get(s),c.get(s))}var Wj={startPosition:new H,endPosition:new H},pD={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function ipe(e,t){let n=RA(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[cs.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),l(s)&&(H.clone(c,Wj.startPosition),H.clone(a,Wj.endPosition),s(Wj)),H.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,h=f.x-u.x,A=f.y-u.y,x=Math.sqrt(h*h+A*A)*.25,C=(c.y+a.y)*.125,T=(f.y+u.y)*.125,E=Math.atan2(p,d),S=Math.atan2(A,h);H.fromElements(0,x,pD.distance.startPosition),H.fromElements(0,g,pD.distance.endPosition),H.fromElements(S,T,pD.angleAndHeight.startPosition),H.fromElements(E,C,pD.angleAndHeight.endPosition),s(pD)}}function ytt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,hy(e,t,new H)),$U(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else epe(e,t)}function $he(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),$U(e,t),e._previousPositions.remove(i)}else tpe(e,t)}function Att(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;hy(e,t,r),ipe(e,t);let o=e._previousPositions;H.clone(n.get(i),o.get(i))}else npe(e,t)}function Fd(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Fd.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),dtt(this)}Fd.prototype.setInputAction=function(e,t,n){let i=Yj(t,n);this._inputEvents[i]=e};Fd.prototype.getInputAction=function(e,t){let n=Yj(e,t);return this._inputEvents[n]};Fd.prototype.removeInputAction=function(e,t){let n=Yj(e,t);delete this._inputEvents[n]};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return mtt(this),ue(this)};Fd.mouseEmulationIgnoreMilliseconds=800;Fd.touchHoldDelayMilliseconds=1500;var gf=Fd;function xtt(e,t,n,i,r,o,s){let a=Ri.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,h=i.green,A=i.blue,x=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let C=(g-u)/a,T=(h-f)/a,E=(A-d)/a,S=(x-p)/a,w=s;for(c=0;c<a;c++)o[w++]=z.floatToByte(u+c*C),o[w++]=z.floatToByte(f+c*T),o[w++]=z.floatToByte(d+c*E),o[w++]=z.floatToByte(p+c*S);return w}function _D(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,$t.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,re.WGS84),this._workerName="createSimplePolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+re.packedLength+3}_D.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=m.packedLength)m.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};_D.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=m.packedLength)o[i]=m.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new _D({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var eV=new Array(2),tV=new Array(2),Ctt={positions:eV,height:tV,ellipsoid:void 0,minDistance:void 0,granularity:void 0};_D.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=P.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,h,A=0;if(r===$t.GEODESIC||r===$t.RHUMB){let S,w,D;r===$t.GEODESIC?(S=P.chordLength(o,s.maximumRadius),w=Ri.numberOfPoints,D=Ri.generateArc):(S=o,w=Ri.numberOfPointsRhumbLine,D=Ri.generateRhumbArc);let R=Ri.extractHeights(t,s),O=Ctt;if(r===$t.GEODESIC?O.minDistance=a:O.granularity=o,O.ellipsoid=s,c){let L=0;for(u=0;u<f-1;u++)L+=w(t[u],t[u+1],S)+1;d=new Float64Array(L*3),g=new Uint8Array(L*4),O.positions=eV,O.height=tV;let N=0;for(u=0;u<f-1;++u){eV[0]=t[u],eV[1]=t[u+1],tV[0]=R[u],tV[1]=R[u+1];let _=D(O);if(l(n)){let b=_.length/3;h=n[u];for(let v=0;v<b;++v)g[N++]=z.floatToByte(h.red),g[N++]=z.floatToByte(h.green),g[N++]=z.floatToByte(h.blue),g[N++]=z.floatToByte(h.alpha)}d.set(_,A),A+=_.length}}else if(O.positions=t,O.height=R,d=new Float64Array(D(O)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let N=t[u],_=t[u+1],b=n[u],v=n[u+1];A=xtt(N,_,b,v,a,g,A)}let L=n[f-1];g[A++]=z.floatToByte(L.red),g[A++]=z.floatToByte(L.green),g[A++]=z.floatToByte(L.blue),g[A++]=z.floatToByte(L.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let S=0,w=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(m.pack(D,d,S),S+=3,h=n[u-1],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha)),c&&u===f-1)break;m.pack(D,d,S),S+=3,l(n)&&(h=n[u],g[w++]=z.floatToByte(h.red),g[w++]=z.floatToByte(h.green),g[w++]=z.floatToByte(h.blue),g[w++]=z.floatToByte(h.alpha))}}let x=new gn;x.position=new De({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(x.color=new De({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,T=Ue.createTypedArray(p,C),E=0;for(u=0;u<p-1;++u)T[E++]=u,T[E++]=u+1;return new dt({attributes:x,indices:T,primitiveType:Le.LINES,boundingSphere:ae.fromPoints(t)})};var rpe=_D;function ZE(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Xs(i),this._workerName="createSphereGeometry"}ZE.packedLength=Xs.packedLength;ZE.pack=function(e,t,n){return Xs.pack(e._ellipsoidGeometry,t,n)};var Ttt=new Xs,py={radius:void 0,radii:new m,vertexFormat:new Oe,stackPartitions:void 0,slicePartitions:void 0};ZE.unpack=function(e,t,n){let i=Xs.unpack(e,t,Ttt);return py.vertexFormat=Oe.clone(i._vertexFormat,py.vertexFormat),py.stackPartitions=i._stackPartitions,py.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,py.radii),n._ellipsoidGeometry=new Xs(py),n):(py.radius=i._radii.x,new ZE(py))};ZE.createGeometry=function(e){return Xs.createGeometry(e._ellipsoidGeometry)};var ope=ZE;var Ett={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=Ett;function _y(e){}Object.defineProperties(_y.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});_y.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;_y.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;_y.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;_y.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;_y.prototype.tileXYToRectangle=fe.throwInstantiationError;_y.prototype.positionToTileXY=fe.throwInstantiationError;var spe=_y;function MA(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Ge.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(MA.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(MA.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=btt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});MA.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};MA.prototype.isDestroyed=function(){return!1};MA.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};MA.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=y(this.epoch,Ge.MINIMUM_VALUE),s=ee.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function btt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var ape=MA;function Stt(e,t){this.rectangle=e,this.maxLevel=t}function Kj(e){this.ellipsoid=y(e.ellipsoid,re.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Kj.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function vtt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Wi({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Stt(new ce(a,c,u,f),d))}}function wtt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function cpe(e,t,n){try{let i=await t.fetchXML();vtt(e,i)}catch(i){wtt(t,i,n)}}function gy(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;if(typeof t=="string"&&(t=new It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[],l(e.url)){$("VRTheWorldTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. VRTheWorldTerrainProvider.fromUrl instead.");let n=this,i=new Kj(e),r=ve.createIfNeeded(e.url);this._resource=r,this._readyPromise=cpe(i,r,n).then(()=>(i.build(n),!0))}}Object.defineProperties(gy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return $("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});gy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new Kj(t),i=ve.createIfNeeded(e);await cpe(n,i);let r=new gy(t);return n.build(r),r._resource=i,r};gy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Za({buffer:$d(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Dtt(a,e,t,n),structure:a._terrainDataStructure})})};gy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var lpe=new ce;function Dtt(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ce.intersection(f,s,lpe);l(d)&&(nV(r,f,t*2,n*2,i+1)&&(a|=4),nV(r,f,t*2+1,n*2,i+1)&&(a|=8),nV(r,f,t*2,n*2+1,i+1)&&(a|=1),nV(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function nV(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ce.intersection(o,t,lpe))}gy.prototype.getTileDataAvailable=function(e,t,n){};gy.prototype.loadTileDataAvailability=function(e,t,n){};var upe=gy;var Itt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},fpe=Object.freeze(Itt);function Ptt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var dpe=Ptt;function Ott(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var iV=Ott;var Rtt={SATELLITE:1,OCEANS:2,HILLSHADE:3},ah=Object.freeze(Rtt);var Jj,mpe="AAPKd815e334cb774973b7245e23a67f4d08Js7A8e8xvfBpgnZIzp1jbL3FWJTmx7AKG8wa87OwDcWEu4CxQCNiydpPbGpALiTf",QE={};QE.defaultAccessToken=mpe;QE.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});QE.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});QE.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});QE.getDefaultTokenCredit=function(e){if(e===mpe){if(!l(Jj)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';Jj=new It(t,!0)}return Jj}};var yf=QE;function Zj(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=ve.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=$d(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}Zj.prototype.isReady=function(){return this._isReady};Zj.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=$d(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var rV=Zj;function Qj(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}Qj.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};Qj.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var ch=Qj;function $E(){fe.throwInstantiationError()}Object.defineProperties($E.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});$E.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};$E.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};$E.prototype.pickFeatures=function(e,t,n,i,r){fe.throwInstantiationError()};var Mtt=/\.ktx2$/i;$E.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Mtt.test(n.url)?Dl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var gl=$E;function $j(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Wi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}$j.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new rV({missingImageUrl:ppe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Btt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Uo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Wi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Pi,r=e.fullExtent,o=i.unproject(new m(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function Ltt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function hpe(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let r=await i.fetchJson();Btt(r,t)}catch(r){Ltt(e,r,n)}}function lh(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Wi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new It(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new _e,this._ready=!1,l(e.url)){$("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=ve.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,l(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new $j(e);i.useTiles?this._readyPromise=hpe(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}lh.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,r;switch(e){case ah.SATELLITE:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldImageryServer)),i.appendForwardSlash();let o=yf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case ah.OCEANS:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldOceanServer)),i.appendForwardSlash();let o=yf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case ah.HILLSHADE:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldHillshadeServer)),i.appendForwardSlash();let o=yf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return lh.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function ppe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Di?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(lh.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});lh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new lh(t);i._resource=n;let r=new $j(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await hpe(n,r),r.build(i),i._readyPromise=Promise.resolve(!0),i};lh.prototype.getTileCredits=function(e,t,n){return this._tileCredits};lh.prototype.requestImage=function(e,t,n,i){return gl.loadImage(this,ppe(this,e,t,n,i))};lh.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Di)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!l(h))return g;for(let A=0;A<h.length;++A){let x=h[A],C=new ch;if(C.data=x,C.name=x.value,C.properties=x.attributes,C.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let T=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)C.position=he.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(T===102100||T===900913||T===3857){let E=new Pi;C.position=E.unproject(new m(x.geometry.x,x.geometry.y,x.geometry.z))}}g.push(C)}return g})};lh._metadataCache={};var Hp=lh;function BA(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(BA.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function _pe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Ntt(e,t){_pe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function gpe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Ftt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Utt(e,t){let n=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -float sampleTexture(vec2 offset) { -`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); - return czm_luminance(color.rgb); -`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r; -`,n+=`} +`;var jR=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +{ + // Reconstruct NDC coordinates + float x = 2.0 * screenCoordinate.x - 1.0; + float y = 2.0 * screenCoordinate.y - 1.0; + float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 q = vec4(x, y, z, 1.0); -`,n+=`uniform vec2 colorTextureDimensions; -uniform vec2 minMaxLuminance; -uniform sampler2D previousLuminance; -void main() { - float color = 0.0; - float xStep = 1.0 / colorTextureDimensions.x; - float yStep = 1.0 / colorTextureDimensions.y; - int count = 0; - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 3; ++j) { - vec2 offset; - offset.x = -xStep + float(i) * xStep; - offset.y = -yStep + float(j) * yStep; - if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { - continue; - } - color += sampleTexture(offset); - ++count; - } - } - if (count > 0) { - color /= float(count); - } -`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); - color = previous + (color - previous) / (60.0 * 1.5); - color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); -`),n+=` out_FragColor = vec4(color); -} -`,n}function Vtt(e,t){gpe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(Utt(o,i),{framebuffer:n[o].framebuffer,uniformMap:Ftt(e,o)});e._commands=r}BA.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new oi({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};BA.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Ntt(this,e),Vtt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};BA.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};BA.prototype.isDestroyed=function(){return!1};BA.prototype.destroy=function(){return _pe(this),gpe(this),ue(this)};var oV=BA;var ktt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},gD=Object.freeze(ktt);function yD(e){}yD.prototype.isReady=function(){return!0};yD.prototype.shouldDiscardImage=function(e){return yD.EMPTY_IMAGE===e};var sV;Object.defineProperties(yD,{EMPTY_IMAGE:{get:function(){return l(sV)||(sV=new Image,sV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),sV}}});var AD=yD;function eY(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}eY.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ce(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}e._ready=!0};function ztt(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function Htt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function ype(e,t,n){let i=e.url,r=ls._metadataCache[i];l(r)||(r=e.fetchJsonp("jsonp"),ls._metadataCache[i]=r);try{let o=await r;return ztt(o,t)}catch(o){Htt(e,o,n)}}function ls(e){if(e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,gD.AERIAL),this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new AD),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${ls.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Uo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new _e,this._ready=!1,l(e.url)){$("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;l(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=ve.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),r=new eY(e);this._readyPromise=ype(i,r,this).then(()=>(r.build(this),!0))}}Object.defineProperties(ls.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ls.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,gD.AERIAL),r=ve.createIfNeeded(e);r.appendForwardSlash();let o=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new ls(t);s._resource=r;let a=new eY(t);return await ype(o,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var Gtt=new ce;ls.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Gtt);return Ytt(this._attributionList,n,i)};ls.prototype.requestImage=function(e,t,n,i){let r=gl.loadImage(this,Wtt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?AD.EMPTY_IMAGE:Promise.reject(o)})};ls.prototype.pickFeatures=function(e,t,n,i,r){};ls.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;e&o&&(s|=1),t&o&&(s|=2),i+=s}return i};ls.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];s&1&&(t|=o),s&2&&(n|=o)}return{x:t,y:n,level:i}};ls._logoUrl=void 0;Object.defineProperties(ls,{logoUrl:{get:function(){return l(ls._logoUrl)||(ls._logoUrl=nn("Assets/Images/bing_maps_credit.png")),ls._logoUrl},set:function(e){ls._logoUrl=e}}});function Wtt(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:ls.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var jtt=new ce;function Ytt(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,jtt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ls._metadataCache={};var xD=ls;var qtt=new m(1,1,1);function tY(e){e=y(e,qtt),this._dimensions=m.clone(e)}Object.defineProperties(tY.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var Xtt=new m;tY.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,Xtt),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=m.fromElements(i,r,o,e.position),e.velocity=m.normalize(e.position,e.velocity)};var Ape=tY;var aV=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; + // Reverse the perspective division to obtain clip coordinates. + q /= screenCoordinate.w; -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); + // Reverse the projection transformation to obtain eye coordinates. + if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s + { + q = czm_inverseProjection * q; } - return value; + else + { + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; + + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + + q.x = (q.x * (right - left) + left + right) * 0.5; + q.y = (q.y * (top - bottom) + bottom + top) * 0.5; + q.z = (q.z * (near - far) - near - far) * 0.5; + q.w = 1.0; + } + + return q; } -vec2 hammersley2D(int i, int N) +/** + * Transforms a position from window to eye coordinates. + * The transform from window to normalized device coordinates is done using components + * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating + * the inverse of <code>czm_viewportTransformation</code>. The transformation from + * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>, + * which is expected to be the scalar used in the perspective divide. The transformation + * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec4} fragmentCoordinate The position in window coordinates to transform. + * + * @returns {vec4} The transformed position in eye coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @example + * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + */ +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) { - return vec2(float(i) / float(N), vdcRadicalInverse(i)); + vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); } -vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) { - float a = roughness * roughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; + // See reverseLogDepth.glsl. This is separate to re-use the pow. +#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + float depthFromCamera = depthFromNear + near; + vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); + eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision + return eyeCoordinate; +#else + vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +#endif + return eyeCoordinate; } -float G1_Smith(float NdotV, float k) +/** + * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. + * This function produces more accurate results for window positions with log depth than + * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version + * of czm_windowToEyeCoordinates. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. + * @param {float} depthOrLogDepth A depth or log depth for the fragment. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @returns {vec4} The transformed position in eye coordinates. + */ +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) { - return NdotV / (NdotV * (1.0 - k) + k); + vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } +`;var qR=`// emulated noperspective +#if !defined(LOG_DEPTH) +in float v_WindowZ; +#endif -float G_Smith(float roughness, float NdotV, float NdotL) +/** + * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane + * by writing the fragment's depth. See czm_depthClamp for more details. + * + * @name czm_writeDepthClamp + * @glslFunction + * + * @example + * out_FragColor = color; + * czm_writeDepthClamp(); + * + * @see czm_depthClamp + */ +void czm_writeDepthClamp() { - float k = roughness * roughness / 2.0; - return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); +#endif } +`;var YR=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; -vec2 integrateBrdf(float roughness, float NdotV) +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; +#endif + +#endif + +/** + * Writes the fragment depth to the logarithmic depth buffer. + * <p> + * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when + * ray-casting geometry using a full screen quad. + * </p> + * @name czm_writeLogDepth + * @glslFunction + * + * @param {float} depth The depth coordinate, where 1.0 is on the near plane and + * depth increases in eye-space units from there + * + * @example + * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + */ +void czm_writeLogDepth(float depth) { - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - for (int i = 0; i < NumSamples; i++) - { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = G_Smith(roughness, NdotV, NdotL); - float G_Vis = G * VdotH / (NdotH * NdotV); - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + // Discard the vertex if it's not between the near and far planes. + // We allow a bit of epsilon on the near plane comparison because a 1.0 + // from the vertex shader (indicating the vertex should be _on_ the near + // plane) will not necessarily come here as exactly 1.0. + if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { + discard; } - return vec2(A, B) / float(NumSamples); + +#ifdef POLYGON_OFFSET + // Polygon offset: m * factor + r * units + float factor = u_polygonOffset[0]; + float units = u_polygonOffset[1]; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // This factor doesn't work in IE 10 + if (factor != 0.0) { + // m = sqrt(dZdX^2 + dZdY^2); + float x = dFdx(depth); + float y = dFdy(depth); + float m = sqrt(x * x + y * y); + + // Apply the factor before computing the log depth. + depth += m * factor; + } +#endif + +#endif + + gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; + +#ifdef POLYGON_OFFSET + // Apply the units after the log depth. + gl_FragDepth += czm_epsilon7 * units; +#endif + +#endif } -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +/** + * Writes the fragment depth to the logarithmic depth buffer. + * <p> + * Use this when the vertex shader calls {@link czm_vertexlogDepth}. + * </p> + * + * @name czm_writeLogDepth + * @glslFunction + */ +void czm_writeLogDepth() { +#ifdef LOG_DEPTH + czm_writeLogDepth(v_depthFromNearPlusOne); +#endif } -`;function CD(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(CD.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Ktt(e,t,n){let i=t.createViewportQuadCommand(aV,{framebuffer:n,renderState:ze.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}CD.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Bt({context:t,width:256,height:256,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,sampler:mn.NEAREST});this._colorTexture=n;let i=new ca({context:t,colorTextures:[n],destroyAttachments:!1});Ktt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};CD.prototype.isDestroyed=function(){return!1};CD.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var cV=CD;var Jtt=new H;function Ztt(e,t){let n=e.unionClippingRegions,i=e.length,r=As.useFloatTexture(t),o=As.getTextureResolution(e,t,Jtt),s=o.x,a=o.y,c=r?ent(s,a):tnt(s,a);return c+=` -`,c+=n?Qtt(i):$tt(i),c}function Qtt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount; - float pixelWidth = czm_metersPerPixel(position); - bool breakAndDiscard = false; - for (int i = 0; i < ${e}; ++i) - { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) - { - breakAndDiscard = true; - break; - } - } - if (breakAndDiscard) { - discard; - } - return clipAmount; +`;var XR=`/** + * Transforms a value for non-perspective interpolation by multiplying + * it by w, the value used in the perspective divide. This function is + * intended to be called in a vertex shader to compute the value of a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The fragment shader + * must call {@link czm_readNonPerspective} to retrieve the final + * non-perspective value. + * + * @name czm_writeNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. + * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. + * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the + * fragment shader with {@link czm_readNonPerspective}. + */ +float czm_writeNonPerspective(float value, float w) { + return value * w; } -`}function $tt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) -{ - bool clipped = true; - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float clipAmount = 0.0; - float pixelWidth = czm_metersPerPixel(position); - for (int i = 0; i < ${e}; ++i) - { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - } - if (clipped) - { - discard; - } - return clipAmount; + +vec2 czm_writeNonPerspective(vec2 value, float w) { + return value * w; } -`}function ent(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) -{ - int pixY = clippingPlaneNumber / ${e}; - int pixX = clippingPlaneNumber - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); + +vec3 czm_writeNonPerspective(vec3 value, float w) { + return value * w; +} + +vec4 czm_writeNonPerspective(vec4 value, float w) { + return value * w; } -`}function tnt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`;var KR=`/** + * Converts a CIE Yxy color to RGB. + * <p>The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + * </p> + * + * @name czm_XYZToRGB + * @glslFunction + * + * @param {vec3} Yxy The color in CIE Yxy. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_XYZToRGB(vec3 Yxy) { - int clippingPlaneStartIndex = clippingPlaneNumber * 2; - int pixY = clippingPlaneStartIndex / ${e}; - int pixX = clippingPlaneStartIndex - (pixY * ${e}); - float u = (float(pixX) + 0.5) * ${r}; - float v = (float(pixY) + 0.5) * ${o}; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); - return czm_transformPlane(plane, transform); + const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, + -1.5371, 1.8760, -0.2040, + -0.4985, 0.0416, 1.0572); + vec3 xyz; + xyz.r = Yxy.r * Yxy.g / Yxy.b; + xyz.g = Yxy.r; + xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; + + return XYZ2RGB * xyz; } -`}var yy=Ztt;var lV=`// See Intersection.glsl for the definition of intersectScene -// See IntersectionUtils.glsl for the definition of nextIntersection -// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl -// for the definition of convertUvToShapeUvSpace. The appropriate function is -// selected based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See Octree.glsl for the definitions of TraversalData, SampleData, -// traverseOctreeFromBeginning, and traverseOctreeFromExisting -// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture +`;var JR=`vec3 czm_fromCartesian(vec3 position) { + vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623); + vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002); + float centerToleranceSquared = 0.1; -#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops -#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 + vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared); -uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; -uniform float u_stepSize; + vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared); + n = normalize(n); -#if defined(PICKING) - uniform vec4 u_pickColor; -#endif + vec3 h = p - position; -#if defined(JITTER) -float hash(vec2 p) -{ - vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale - p3 += dot(p3, p3.yzx + 19.19); - return fract((p3.x + p3.y) * p3.z); -} -#endif + float longitude = atan(n.y, n.x); + float latitude = asin(n.z); -vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { -#if defined(SHAPE_BOX) - Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); - RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); - vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; - float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); - float dt = (exit - entry.w) * RAY_SCALE; - return vec4(normalize(entry.xyz), dt); -#else - float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); - return vec4(viewRay.dir, u_stepSize / dimAtLevel); -#endif + float dotNum = dot(h, position); + // float height = MathSign(dotNum)*czm_magnitude(h); + float height = czm_magnitude(h); + + vec3 result; + result.x = longitude; + result.y = latitude; + result.z = height; + return result; +}`;var ZR=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){ + for(int i=0;i<=16;i++){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){ + if(xyxy[0][0]<minx){ + minx = xyxy[0][0]; + } + if(xyxy[0][0]>maxx){ + maxx = xyxy[0][0]; + } + + if(xyxy[0][1]<miny){ + miny = xyxy[0][1]; + } + if(xyxy[0][1]>maxy){ + maxy = xyxy[0][1]; + } + + if(xyxy[0][2]<minz){ + minz = xyxy[0][2]; + } + if(xyxy[0][2]>maxz){ + maxz = xyxy[0][2]; + } + } + } + return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0); } -void main() -{ - vec4 fragCoord = gl_FragCoord; - vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] - vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); - vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case - vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case - vec3 viewPosUv = u_cameraPositionUv; - #if defined(SHAPE_BOX) - vec3 dInv = 1.0 / viewDirUv; - Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); - #else - Ray viewRayUv = Ray(viewPosUv, viewDirUv); - #endif - Intersections ix; - RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); - // Exit early if the scene was completely missed. - if (shapeIntersection.entry.w == NO_HIT) { - discard; +`;var $R=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1); + if(index==0){ + return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0); + } + if(index==1){ + return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0); + } + if(index==2){ + return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0); + } + if(index==3){ + return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0); + } + if(index==4){ + return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0); + } + if(index==5){ + return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0); + } + if(index==6){ + return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0); + } + if(index==7){ + return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0); + } + if(index==8){ + return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0); + } + if(index==9){ + return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0); + } + if(index==10){ + return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0); + } + if(index==11){ + return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0); + } + if(index==12){ + return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0); + } + if(index==13){ + return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0); + } + if(index==14){ + return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0); + } + if(index==15){ + return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0); + } +}`;var QR=`int czm_getMaxIndex(mat4 yp_mat_x){ + if(yp_mat_x[3][3]!=0.0){ + return 16; + } + if(yp_mat_x[3][2]!=0.0){ + return 15; + } + if(yp_mat_x[3][1]!=0.0){ + return 14; + } + if(yp_mat_x[3][0]!=0.0){ + return 15; + } + if(yp_mat_x[2][3]!=0.0){ + return 12; + } + if(yp_mat_x[2][2]!=0.0){ + return 11; + } + if(yp_mat_x[2][1]!=0.0){ + return 10; + } + if(yp_mat_x[2][0]!=0.0){ + return 9; + } + if(yp_mat_x[1][3]!=0.0){ + return 8; + } + if(yp_mat_x[1][2]!=0.0){ + return 7; } - - float currT = shapeIntersection.entry.w * RAY_SCALE; - float endT = shapeIntersection.exit.w; - vec3 positionUv = viewPosUv + currT * viewDirUv; - vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); - - // Traverse the tree from the start position - TraversalData traversalData; - SampleData sampleDatas[SAMPLE_COUNT]; - traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); - vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); - - #if defined(JITTER) - float noise = hash(screenCoord); // [0,1] - currT += noise * step.w; - positionUv += noise * step.w * viewDirUv; - #endif - - FragmentInput fragmentInput; - #if defined(STATISTICS) - setStatistics(fragmentInput.metadata.statistics); - #endif - - vec4 colorAccum =vec4(0.0); - - for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { - // Read properties from the megatexture based on the traversal state - Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); - - // Prepare the custom shader inputs - copyPropertiesToMetadata(properties, fragmentInput.metadata); - fragmentInput.voxel.positionUv = positionUv; - fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; - fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; - fragmentInput.voxel.viewDirUv = viewDirUv; - fragmentInput.voxel.viewDirWorld = viewDirWorld; - fragmentInput.voxel.surfaceNormal = step.xyz; - fragmentInput.voxel.travelDistance = step.w; - - // Run the custom shader - czm_modelMaterial materialOutput; - fragmentMain(fragmentInput, materialOutput); - - // Sanitize the custom shader output - vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); - color.rgb = max(color.rgb, vec3(0.0)); - color.a = clamp(color.a, 0.0, 1.0); - - // Pre-multiplied alpha blend - colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); - - // Stop traversing if the alpha has been fully saturated - if (colorAccum.a > ALPHA_ACCUM_MAX) { - colorAccum.a = ALPHA_ACCUM_MAX; - break; - } - - if (step.w == 0.0) { - // Shape is infinitely thin. The ray may have hit the edge of a - // foreground voxel. Step ahead slightly to check for more voxels - step.w == 0.00001; + if(yp_mat_x[1][1]!=0.0){ + return 6; + } + if(yp_mat_x[1][0]!=0.0){ + return 5; + } + if(yp_mat_x[0][3]!=0.0){ + return 4; + } + if(yp_mat_x[0][2]!=0.0){ + return 3; + } + if(yp_mat_x[0][1]!=0.0){ + return 2; + } + if(yp_mat_x[0][0]!=0.0){ + return 1; + } +}`;var eM=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){ + if(yp_max_index==0){ + return vec3(ypx[0][0],ypy[0][0],ypz[0][0]); + } + if(yp_max_index==1){ + return vec3(ypx[0][1],ypy[0][1],ypz[0][1]); + } + if(yp_max_index==2){ + return vec3(ypx[0][2],ypy[0][2],ypz[0][2]); + } + if(yp_max_index==3){ + return vec3(ypx[0][3],ypy[0][3],ypz[0][3]); + } + if(yp_max_index==4){ + return vec3(ypx[1][0],ypy[1][0],ypz[1][0]); + } + if(yp_max_index==5){ + return vec3(ypx[1][1],ypy[1][1],ypz[1][1]); + } + if(yp_max_index==6){ + return vec3(ypx[1][2],ypy[1][2],ypz[1][2]); + } + if(yp_max_index==7){ + return vec3(ypx[1][3],ypy[1][3],ypz[1][3]); + } + if(yp_max_index==8){ + return vec3(ypx[2][0],ypy[2][0],ypz[2][0]); + } + if(yp_max_index==9){ + return vec3(ypx[2][1],ypy[2][1],ypz[2][1]); + } + if(yp_max_index==10){ + return vec3(ypx[2][2],ypy[2][2],ypz[2][2]); + } + if(yp_max_index==11){ + return vec3(ypx[2][3],ypy[2][3],ypz[2][3]); + } + if(yp_max_index==12){ + return vec3(ypx[3][0],ypy[3][0],ypz[3][0]); + } + if(yp_max_index==13){ + return vec3(ypx[3][1],ypy[3][1],ypz[3][1]); + } + if(yp_max_index==14){ + return vec3(ypx[3][2],ypy[3][2],ypz[3][2]); + } + if(yp_max_index==15){ + return vec3(ypx[3][3],ypy[3][3],ypz[3][3]); + } +}`;var tM=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + float pz = position.z; + if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){ + vec3 lonlat = czm_fromCartesian(position); + px = lonlat.x; + py = lonlat.y; + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]); + vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]); + vec3 llh1 = czm_fromCartesian(pos1); + vec3 llh2 = czm_fromCartesian(pos2); + float sx = llh1.x; + float sy = llh1.y; + float tx = llh2.x; + float ty = llh2.y; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } + } } - - // Keep raymarching - currT += step.w; - positionUv += step.w * viewDirUv; - - // Check if there's more intersections. - if (currT > endT) { - #if (INTERSECTION_COUNT == 1) - break; - #else - shapeIntersection = nextIntersection(ix); - if (shapeIntersection.entry.w == NO_HIT) { - break; - } else { - // Found another intersection. Resume raymarching there - currT = shapeIntersection.entry.w * RAY_SCALE; - endT = shapeIntersection.exit.w; - positionUv = viewPosUv + currT * viewDirUv; + } + return isIn ? true : false; +}`;var nM=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) { + bool isIn = false; + float px = position.x; + float py = position.y; + if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){ + for(int i = 0;i <= 16; i++){ + vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i); + if(currVal.x!=0.0&&currVal.y!=0.0){ + mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index); + float sx = xyxy[0][0]; + float sy = xyxy[0][1]; + float tx = xyxy[1][0]; + float ty = xyxy[1][1]; + if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){ + if((sx == px && sy == py) || (tx == px && ty == py)) { + return true; + } + if((sy < py && ty >= py) || (sy >= py && ty < py)) { + float x = sx + (py - sy) * (tx - sx) / (ty - sy); + if(x == px) { + return true; + } + if(x > px) { + isIn = !isIn; + } + } } - #endif + } } - - // Traverse the tree from the current ray position. - // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. - positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); - traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); - step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); } + return isIn ? true : false; +}`;var iM=`float czm_magnitude(vec3 cartesian3) { + return sqrt(czm_magnitudeSquared(cartesian3)); +}`;var oM=`float czm_magnitudeSquared (vec3 cartesian4) { + return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z; +}`;var rM=`vec3 czm_multiplyComponents(vec3 left, vec3 right) { + vec3 result; + result.x = left.x * right.x; + result.y = left.y * right.y; + result.z = left.z * right.z; + return result; +}`;var sM=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) { - // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] - colorAccum.a /= ALPHA_ACCUM_MAX; + float positionX = cartesian1.x; + float positionY = cartesian1.y; + float positionZ = cartesian1.z; - #if defined(PICKING) - // If alpha is 0.0 there is nothing to pick - if (colorAccum.a == 0.0) { - discard; - } - out_FragColor = u_pickColor; - #else - out_FragColor = colorAccum; - #endif -} -`;var uV=`in vec2 position; + float oneOverRadiiX = oneOverRadii.x; + float oneOverRadiiY = oneOverRadii.y; + float oneOverRadiiZ = oneOverRadii.z; -uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; + float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX; + float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY; + float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ; -void main() { - vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; - vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; - vec2 translation = 0.5 * (aabbMax + aabbMin); - vec2 scale = 0.5 * (aabbMax - aabbMin); - gl_Position = vec4(position * scale + translation, 0.0, 1.0); -} -`;var fV=`/* Intersection defines -#define INTERSECTION_COUNT ### -*/ + // Compute the squared ellipsoid norm. + float squaredNorm = x2 + y2 + z2; + float ratio = sqrt(1.0 / squaredNorm); -#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -#define RAY_SHIFT (0.000003163) -#define RAY_SCALE (1.003163) + // As an initial approximation, assume that the radial intersection is the projection point. + vec3 intersection = cartesian1*ratio; -struct Ray { - vec3 pos; - vec3 dir; -#if defined(SHAPE_BOX) - vec3 dInv; -#endif -}; -struct RayShapeIntersection { - vec4 entry; - vec4 exit; -}; + float oneOverRadiiSquaredX = oneOverRadiiSquared.x; + float oneOverRadiiSquaredY = oneOverRadiiSquared.y; + float oneOverRadiiSquaredZ = oneOverRadiiSquared.z; -struct Intersections { - // Don't access these member variables directly - call the functions instead. + // Use the gradient at the intersection point in place of the true unit normal. + // The difference in magnitude will be absorbed in the multiplier. + vec3 gradient; + gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0; + gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0; + gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0; - // Store an array of ray-surface intersections. Each intersection is composed of: - // .xyz for the surface normal at the intersection point - // .w for the T value - // The scale of the normal encodes the shape intersection type: - // length(intersection.xyz) = 1: positive shape entry - // length(intersection.xyz) = 2: positive shape exit - // length(intersection.xyz) = 3: negative shape entry - // length(intersection.xyz) = 4: negative shape exit - // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, - // so we need twice as many to track ray-*surface* intersections - vec4 intersections[INTERSECTION_COUNT * 2]; + // Compute the initial guess at the normal vector multiplier, lambda. + float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient)); + float correction = 0.0; - #if (INTERSECTION_COUNT > 1) - // Maintain state for future nextIntersection calls - int index; - int surroundCount; - bool surroundIsPositive; - #endif -}; + float func; + float denominator; + float xMultiplier; + float yMultiplier; + float zMultiplier; + float xMultiplier2; + float yMultiplier2; + float zMultiplier2; + float xMultiplier3; + float yMultiplier3; + float zMultiplier3; + func = 1.0; + for(int i=0;i<9;i++){ + if(abs(func) > 0.000000000001){ + lambda -= correction; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ - return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); -} + xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX); + yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY); + zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ); -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) -{ - float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; - return vec4(intersection.xyz * scale, intersection.w); -} + xMultiplier2 = xMultiplier * xMultiplier; + yMultiplier2 = yMultiplier * yMultiplier; + zMultiplier2 = zMultiplier * zMultiplier; -// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. -#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) -#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) -#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; -#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) + xMultiplier3 = xMultiplier2 * xMultiplier; + yMultiplier3 = yMultiplier2 * yMultiplier; + zMultiplier3 = zMultiplier2 * zMultiplier; -#if (INTERSECTION_COUNT > 1) -void initializeIntersections(inout Intersections ix) { - // Sort the intersections from min T to max T with bubble sort. - // Note: If this sorting function changes, some of the intersection test may - // need to be updated. Search for "bubble sort" to find those areas. - const int sortPasses = INTERSECTION_COUNT * 2 - 1; - for (int n = sortPasses; n > 0; --n) { - for (int i = 0; i < sortPasses; ++i) { - // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= n) { break; } + func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0; - vec4 intersect0 = ix.intersections[i + 0]; - vec4 intersect1 = ix.intersections[i + 1]; + // "denominator" here refers to the use of this expression in the velocity and acceleration + // computations in the sections to follow. + denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ; - bool inOrder = intersect0.w <= intersect1.w; + float derivative = -2.0 * denominator; - ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; - ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; + correction = func / derivative; + + }else{ + break; } } - // Prepare initial state for nextIntersection - ix.index = 0; - ix.surroundCount = 0; - ix.surroundIsPositive = false; -} + vec3 result; + result.x = positionX * xMultiplier; + result.y = positionY * yMultiplier; + result.z = positionZ * zMultiplier; + return result; +}`;var Xb={czm_degreesPerRadian:wP,czm_depthRange:IP,czm_epsilon1:DP,czm_epsilon2:PP,czm_epsilon3:OP,czm_epsilon4:RP,czm_epsilon5:MP,czm_epsilon6:LP,czm_epsilon7:NP,czm_infinity:FP,czm_oneOverPi:BP,czm_oneOverTwoPi:kP,czm_passCesium3DTile:UP,czm_passCesium3DTileClassification:VP,czm_passCesium3DTileClassificationIgnoreShow:zP,czm_passClassification:HP,czm_passCompute:GP,czm_passEnvironment:WP,czm_passGlobe:jP,czm_passOpaque:qP,czm_passOverlay:YP,czm_passTerrainClassification:XP,czm_passTranslucent:KP,czm_passVoxels:JP,czm_pi:ZP,czm_piOverFour:$P,czm_piOverSix:QP,czm_piOverThree:eO,czm_piOverTwo:tO,czm_radiansPerDegree:nO,czm_sceneMode2D:iO,czm_sceneMode3D:oO,czm_sceneModeColumbusView:rO,czm_sceneModeMorphing:sO,czm_solarRadius:aO,czm_threePiOver2:cO,czm_twoPi:lO,czm_webMercatorMaxLatitude:uO,czm_depthRangeStruct:fO,czm_material:dO,czm_materialInput:mO,czm_modelMaterial:hO,czm_modelVertexOutput:pO,czm_pbrParameters:_O,czm_ray:gO,czm_raySegment:yO,czm_shadowParameters:xO,czm_acesTonemapping:bO,czm_alphaWeight:CO,czm_antialias:TO,czm_approximateSphericalCoordinates:AO,czm_backFacing:EO,czm_branchFreeTernary:SO,czm_cascadeColor:vO,czm_cascadeDistance:wO,czm_cascadeMatrix:IO,czm_cascadeWeights:DO,czm_columbusViewMorph:PO,czm_computePosition:OO,czm_cosineAndSine:RO,czm_decompressTextureCoordinates:MO,czm_defaultPbrMaterial:LO,czm_depthClamp:NO,czm_eastNorthUpToEyeCoordinates:FO,czm_ellipsoidContainsPoint:BO,czm_ellipsoidWgs84TextureCoordinates:kO,czm_equalsEpsilon:UO,czm_eyeOffset:VO,czm_eyeToWindowCoordinates:zO,czm_fastApproximateAtan:HO,czm_fog:GO,czm_gammaCorrect:WO,czm_geodeticSurfaceNormal:jO,czm_getDefaultMaterial:qO,czm_getLambertDiffuse:YO,czm_getSpecular:XO,czm_getWaterNoise:KO,czm_HSBToRGB:JO,czm_HSLToRGB:ZO,czm_hue:$O,czm_inverseGamma:QO,czm_isEmpty:eR,czm_isFull:tR,czm_latitudeToWebMercatorFraction:nR,czm_linearToSrgb:iR,czm_lineDistance:oR,czm_luminance:rR,czm_metersPerPixel:sR,czm_modelToWindowCoordinates:aR,czm_multiplyWithColorBalance:cR,czm_nearFarScalar:lR,czm_octDecode:uR,czm_packDepth:fR,czm_pbrLighting:dR,czm_pbrMetallicRoughnessMaterial:mR,czm_pbrSpecularGlossinessMaterial:hR,czm_phong:pR,czm_planeDistance:_R,czm_pointAlongRay:gR,czm_rayEllipsoidIntersectionInterval:yR,czm_raySphereIntersectionInterval:xR,czm_readDepth:bR,czm_readNonPerspective:CR,czm_reverseLogDepth:TR,czm_RGBToHSB:AR,czm_RGBToHSL:ER,czm_RGBToXYZ:SR,czm_round:vR,czm_sampleOctahedralProjection:wR,czm_saturation:IR,czm_shadowDepthCompare:DR,czm_shadowVisibility:PR,czm_signNotZero:OR,czm_sphericalHarmonics:RR,czm_srgbToLinear:MR,czm_tangentToEyeSpaceMatrix:LR,czm_textureCube:NR,czm_transformPlane:FR,czm_translateRelativeToEye:BR,czm_translucentPhong:kR,czm_transpose:UR,czm_unpackDepth:VR,czm_unpackFloat:zR,czm_unpackUint:HR,czm_valueTransform:GR,czm_vertexLogDepth:WR,czm_windowToEyeCoordinates:jR,czm_writeDepthClamp:qR,czm_writeLogDepth:YR,czm_writeNonPerspective:XR,czm_XYZToRGB:KR,czm_fromCartesian:JR,czm_getFloodRect:ZR,czm_getIndexMat:$R,czm_getMaxIndex:QR,czm_getMaxIndexVal:eM,czm_isInEllipsoid:tM,czm_isInObliq:nM,czm_magnitude:iM,czm_magnitudeSquared:oM,czm_multiplyComponents:rM,czm_scaleToGeodeticSurface:sM};function Zve(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable +${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable +${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable +#endif +${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 +${n}`,n}var aM=Zve;function OZ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=` +`;return i})}function RZ(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=OZ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function MZ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&_s._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=RZ(i,_s._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),MZ(o,t)}}))}function $ve(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function Qve(e){let t=[],n=RZ("main",e,t);MZ(n,t),$ve(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} +`;return i.replace(n.glslSource,"")}function LZ(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=` +#line 0 +${s[i]}`;r=OZ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,b){return a=b,` +`});let c=[];r=r.replace(/#extension.*\n/gm,function(x){return c.push(x),` +`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;l(u)&&(r=_s.createPickFragmentShaderSource(r,u));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp int; +#else + precision mediump float; + precision mediump int; + #define highp mediump #endif -#if (INTERSECTION_COUNT > 1) -RayShapeIntersection nextIntersection(inout Intersections ix) { - vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); - RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); +`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let x=p[i];x.length!==0&&(f+=`#define ${x} +`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear - const int passCount = INTERSECTION_COUNT * 2; +`),n.floatingPointTexture&&(f+=`#define OES_texture_float - if (ix.index == passCount) { - return shapeIntersection; - } +`);let g="";e.includeBuiltIns&&(g=Qve(r)),f+=` +#line 0 +`;let h=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(h)&&!/czm_out_FragColor/g.test(h)&&/out_FragColor/g.test(h)&&(f+=`layout(location = 0) out vec4 out_FragColor; - for (int i = 0; i < passCount; ++i) { - // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to continue instead. - if (i < ix.index) { - continue; - } +`),f+=g,f+=r,n.webgl2?f=`#version 300 es +${f}`:f=aM(f,t),f}function _s(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}_s.prototype.clone=function(){return new _s({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};_s.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};_s.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(` +`);return`${t}:${n}:${i}:${o}`};_s.prototype.createCombinedVertexShader=function(e){return LZ(this,!1,e)};_s.prototype.createCombinedFragmentShader=function(e){return LZ(this,!0,e)};_s._czmBuiltinsAndUniforms={};for(let e in Xb)Xb.hasOwnProperty(e)&&(_s._czmBuiltinsAndUniforms[e]=Xb[e]);for(let e in b_)if(b_.hasOwnProperty(e)){let t=b_[e];typeof t.getDeclaration=="function"&&(_s._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}_s.createPickVertexShaderSource=function(e){return`${_s.replaceMain(e,"czm_old_main")} +in vec4 pickColor; +out vec4 czm_pickColor; +void main() +{ + czm_old_main(); + czm_pickColor = pickColor; +}`};_s.createPickFragmentShaderSource=function(e,t){let n=_s.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +void main() +{ + czm_old_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = czm_pickColor; +}`;return`${n} +${i}`};function ewe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function NZ(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function FZ(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(NZ(e,o))return o}}var twe=["v_normalEC","v_normal"];_s.findNormalVarying=function(e){return NZ(e,"#ifdef HAS_NORMALS")?ewe(e,"HAS_NORMALS")?"v_normalEC":void 0:FZ(e,twe)};var nwe=["v_positionEC"];_s.findPositionVarying=function(e){return FZ(e,nwe)};var We=_s;var cM=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; - ix.index = i + 1; +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; - surfaceIntersection = ix.intersections[i]; - int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); - bool currShapeIsPositive = intersectionType < 2; - bool enter = intMod(intersectionType, 2) == 0; +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY - ix.surroundCount += enter ? +1 : -1; - ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR - // entering positive or exiting negative - if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { - shapeIntersection.entry = surfaceIntersection; - } +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES - // exiting positive or entering negative after being inside positive - bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; - bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; - if (exitPositive || enterNegativeFromPositive) { - shapeIntersection.exit = surfaceIntersection; +void main() +{ + vec4 position = czm_computePosition(); - // entry and exit have been found, so the loop can stop - if (exitPositive) { - // After exiting positive shape there is nothing left to intersect, so jump to the end index. - ix.index = passCount; - } - break; - } - } +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - return shapeIntersection; -} + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); #endif -// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var dV=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersectionPair, INF_HIT, NO_HIT - -/* intersectDepth defines (set in Scene/VoxelRenderResources.js) -#define DEPTH_INTERSECTION_INDEX ### -*/ - -uniform mat4 u_transformPositionViewToUv; +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); -void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); - if (logDepthOrDepth != 0.0) { - // Calculate how far the ray must travel before it hits the depth buffer. - vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); - eyeCoordinateDepth /= eyeCoordinateDepth.w; - vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); - float t = dot(depthPositionUv - ray.pos, ray.dir); - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); - } else { - // There's no depth at this location. - setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); - } -} -`;var mV=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, -// NO_HIT, setIntersectionPair + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); -/* Clipping plane defines (set in Scene/VoxelRenderResources.js) -#define CLIPPING_PLANES_UNION -#define CLIPPING_PLANES_COUNT -#define CLIPPING_PLANES_INTERSECTION_INDEX -*/ + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); -uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D -// Plane is in Hessian Normal Form -vec4 intersectPlane(in Ray ray, in vec4 plane) { - vec3 n = plane.xyz; // normal - float w = plane.w; // -dot(pointOnPlane, normal) + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; - float a = dot(ray.pos, n); - float b = dot(ray.dir, n); - float t = -(w + a) / b; + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; - return vec4(n, t); -} + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); -void intersectClippingPlanes(in Ray ray, inout Intersections ix) { - vec4 backSide = vec4(-ray.dir, -INF_HIT); - vec4 farSide = vec4(ray.dir, +INF_HIT); - RayShapeIntersection clippingVolume; + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES - #if (CLIPPING_PLANES_COUNT == 1) - // Union and intersection are the same when there's one clipping plane, and the code - // is more simplified. - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - bool reflects = dot(ray.dir, intersection.xyz) < 0.0; - clippingVolume.entry = reflects ? backSide : intersection; - clippingVolume.exit = reflects ? intersection : farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #elif defined(CLIPPING_PLANES_UNION) - vec4 firstTransmission = vec4(ray.dir, +INF_HIT); - vec4 lastReflection = vec4(-ray.dir, -INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; - } else { - lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; - } - } - clippingVolume.entry = backSide; - clippingVolume.exit = lastReflection; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); - clippingVolume.entry = firstTransmission; - clippingVolume.exit = farSide; - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); - #else // intersection - vec4 lastTransmission = vec4(ray.dir, -INF_HIT); - vec4 firstReflection = vec4(-ray.dir, +INF_HIT); - for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { - vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); - vec4 intersection = intersectPlane(ray, planeUv); - if (dot(ray.dir, planeUv.xyz) > 0.0) { - lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; - } else { - firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; - } - } - if (lastTransmission.w < firstReflection.w) { - clippingVolume.entry = lastTransmission; - clippingVolume.exit = firstReflection; - } else { - clippingVolume.entry = vec4(-ray.dir, NO_HIT); - clippingVolume.exit = vec4(ray.dir, NO_HIT); - } - setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); - #endif -} -`;var hV=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT -// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif -/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_INTERSECTION_INDEX ### // always 0 -*/ + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var t0=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif -uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; +void main(void) +{ +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); +#endif + czm_writeDepthClamp(); +} +`;var BZ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};BZ.NUMBER_OF_CLASSIFICATION_TYPES=3;var Hn=Object.freeze(BZ);var iwe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},dc=Object.freeze(iwe);function sm(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}sm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Lh={high:0,low:0};sm.fromCartesian=function(e,t){l(t)||(t=new sm);let n=t.high,i=t.low;return sm.encode(e.x,Lh),n.x=Lh.high,i.x=Lh.low,sm.encode(e.y,Lh),n.y=Lh.high,i.y=Lh.low,sm.encode(e.z,Lh),n.z=Lh.high,i.z=Lh.low,t};var x8=new sm;sm.writeElements=function(e,t,n){sm.fromCartesian(e,x8);let i=x8.high,o=x8.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var qn=sm;function owe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var lM=owe;var uM={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===uM.STREAM_DRAW||e===uM.STATIC_DRAW||e===uM.DYNAMIC_DRAW}},ke=Object.freeze(uM);var gs={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};gs.getSizeInBytes=function(e){switch(e){case gs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case gs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case gs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};gs.fromSizeInBytes=function(e){switch(e){case 2:return gs.UNSIGNED_SHORT;case 4:return gs.UNSIGNED_INT;case 1:return gs.UNSIGNED_BYTE}};gs.validate=function(e){return l(e)&&(e===gs.UNSIGNED_BYTE||e===gs.UNSIGNED_SHORT||e===gs.UNSIGNED_INT)};gs.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};gs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};gs.fromTypedArray=function(e){if(e instanceof Uint8Array)return gs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return gs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return gs.UNSIGNED_INT};var Ue=Object.freeze(gs);function Du(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Du.createVertexBuffer=function(e){return new Du({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Du.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new Du({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Du.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Du.prototype._getBuffer=function(){return this._buffer};Du.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Du.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Du.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Du.prototype.isDestroyed=function(){return!1};Du.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var ht=Du;function rwe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function UZ(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Nh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)rwe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),UZ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function kZ(e){return e.values.length/e.componentsPerAttribute}function swe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function awe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=kZ(e[o[0]]),t=1;t<s;++t){let u=kZ(e[o[t]]);if(u!==r)throw new de(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=swe(i);if(a>0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=o[t];let h=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/h,strideInComponentType:a/h}}for(t=0;t<r;++t)for(let h=0;h<s;++h){n=o[h],i=e[n];let x=i.values,b=g[n],C=b.pointer,T=i.componentsPerAttribute;for(let A=0;A<T;++A)C[b.index+A]=x[t*T+A];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Nh.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,ke.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(r){let h=awe(d);if(l(h)){u=ht.createVertexBuffer({context:t,typedArray:h.buffer,usage:i});let x=h.offsetsInBytes,b=h.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let h=c.componentDatatype;h===X.DOUBLE&&(h=X.FLOAT),u=void 0,l(c.values)&&(u=ht.createVertexBuffer({context:t,typedArray:X.createTypedArray(h,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:h,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(dt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ht.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=ht.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new Nh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Nh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Nh.prototype.getAttribute=function(e){return this._attributes[e]};function cwe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Gt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function lwe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}Nh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&cwe(this),this._hasConstantAttributes&&lwe(this,this._gl)):UZ(this._gl,this._attributes,this._indexBuffer)};Nh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ai=Nh;function Fh(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=uwe(t),o=e.floatingPointTexture,r=i===Je.FLOAT&&!o,s=fwe(t,r),a=dwe(s,t,r),c=Math.floor(Gt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,h=1/d,x=h*.5;this._textureDimensions=new H(f,d),this._textureStep=new re(p,g,h,x),this._pixelDatatype=r?Je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*d;this._batchValues=i===Je.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(Fh.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function uwe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Je.FLOAT:Je.UNSIGNED_BYTE}function zZ(e,t){let n=e[t].componentsPerAttribute;return n===2?H:n===3?m:n===4?re:Number}function fwe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function dwe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?o+4:o+1}var dS=new re;function mwe(e,t,n){let i=re.unpack(e,t,dS),o=re.unpackFloat(i);i=re.unpack(e,t+4,dS);let r=re.unpackFloat(i);i=re.unpack(e,t+8,dS);let s=re.unpackFloat(i);i=re.unpack(e,t+12,dS);let a=re.unpackFloat(i);return re.fromElements(o,r,s,a,n)}function hwe(e,t,n){let i=re.packFloat(e.x,dS);re.pack(i,t,n),i=re.packFloat(e.y,i),re.pack(i,t,n+4),i=re.packFloat(e.z,i),re.pack(i,t,n+8),i=re.packFloat(e.w,i),re.pack(i,t,n+12)}var VZ=new re;Fh.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Je.UNSIGNED_BYTE?a=mwe(this._batchValues,s,VZ):a=re.unpack(this._batchValues,s,VZ);let c=zZ(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var pwe=[void 0,void 0,new H,new m,new re],_we=new re;Fh.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=pwe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=zZ(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=_we;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Je.UNSIGNED_BYTE?hwe(c,this._batchValues,d):re.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function gwe(e,t){let n=e._textureDimensions;e._texture=new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:hn.NEAREST,flipY:!1})}function ywe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Fh.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||gwe(this,e.context),ywe(this))};Fh.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:_t(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function xwe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function bwe(e){return e===1?"float":`vec${e}`}function Cwe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function Twe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=bwe(o),a=Cwe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) +{ + vec2 st = computeSt(batchId); + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==Je.UNSIGNED_BYTE?u+=`vec4 textureValue; +textureValue.x = czm_unpackFloat(texture(batchTexture, st)); +textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); +textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); +textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); +`:u+=` vec4 textureValue = texture(batchTexture, st); +`,u+=` ${s} value = textureValue${a}; +`,e._pixelDatatype===Je.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===Je.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`),u+=` return value; +} +`,u}Fh.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${xwe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=Twe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} +${t} +${s}`}};Fh.prototype.isDestroyed=function(){return!1};Fh.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Kb=Fh;var Qi={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Qi.getMathType=function(e){switch(e){case Qi.SCALAR:return Number;case Qi.VEC2:return H;case Qi.VEC3:return m;case Qi.VEC4:return re;case Qi.MAT2:return no;case Qi.MAT3:return Z;case Qi.MAT4:return L}};Qi.getNumberOfComponents=function(e){switch(e){case Qi.SCALAR:return 1;case Qi.VEC2:return 2;case Qi.VEC3:return 3;case Qi.VEC4:case Qi.MAT2:return 4;case Qi.MAT3:return 9;case Qi.MAT4:return 16}};Qi.getAttributeLocationCount=function(e){switch(e){case Qi.SCALAR:case Qi.VEC2:case Qi.VEC3:case Qi.VEC4:return 1;case Qi.MAT2:return 2;case Qi.MAT3:return 3;case Qi.MAT4:return 4}};Qi.getGlslType=function(e){switch(e){case Qi.SCALAR:return"float";case Qi.VEC2:return"vec2";case Qi.VEC3:return"vec3";case Qi.VEC4:return"vec4";case Qi.MAT2:return"mat2";case Qi.MAT3:return"mat3";case Qi.MAT4:return"mat4"}};var ln=Object.freeze(Qi);var HZ=1/256,GZ=256,po={};po.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};po.octEncode=function(e,t){return po.octEncodeInRange(e,255,t)};var mS=new H,WZ=new Uint8Array(1);function fM(e){return WZ[0]=e,WZ[0]}po.octEncodeToCartesian4=function(e,t){return po.octEncodeInRange(e,65535,mS),t.x=fM(mS.x*HZ),t.y=fM(mS.x),t.z=fM(mS.y*HZ),t.w=fM(mS.y),t};po.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return m.normalize(i,i)};po.octDecode=function(e,t,n){return po.octDecodeInRange(e,t,255,n)};po.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*GZ+i,a=o*GZ+r;return po.octDecodeInRange(s,a,65535,t)};po.octPackFloat=function(e){return 256*e.x+e.y};var C8=new H;po.octEncodeFloat=function(e){return po.octEncode(e,C8),po.octPackFloat(C8)};po.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return po.octDecode(i,o,t)};po.octPack=function(e,t,n,i){let o=po.octEncodeFloat(e),r=po.octEncodeFloat(t),s=po.octEncode(n,C8);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};po.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;po.octDecodeFloat(s,t),po.octDecodeFloat(c,n),po.octDecode(r,a,i)};po.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};po.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function b8(e){return e>>1^-(e&1)}po.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=b8(e[a]),r+=b8(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=b8(n[a]),n[a]=s)};po.dequantize=function(e,t,n,i){let o=ln.getNumberOfComponents(n),r;switch(t){case X.BYTE:r=127;break;case X.UNSIGNED_BYTE:r=255;break;case X.SHORT:r=32767;break;case X.UNSIGNED_SHORT:r=65535;break;case X.INT:r=2147483647;break;case X.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};po.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=32-1,o=64-1,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var Yn=po;var jZ=new m,qZ=new m,YZ=new m;function Awe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,jZ),s=m.subtract(i,t,qZ),a=m.subtract(e,t,YZ),c=m.dot(r,r),u=m.dot(r,s),f=m.dot(r,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=H.subtract(n,t,jZ),s=H.subtract(i,t,qZ),a=H.subtract(e,t,YZ),c=H.dot(r,r),u=H.dot(r,s),f=H.dot(r,a),d=H.dot(s,s),p=H.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var Jb=Awe;var T8={};T8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};T8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(_,E,w,D){for(;E.length>=1;){let M=E[E.length-1];if(E.splice(E.length-1,1),_[M].numLiveTriangles>0)return M}for(;o<D;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,E,w,D,M,B,V){let U=-1,G,k=-1,Y=0;for(;Y<w.length;){let j=w[Y];D[j].numLiveTriangles&&(G=0,M-D[j].timeStamp+2*D[j].numLiveTriangles<=E&&(G=M-D[j].timeStamp),(G>k||k===-1)&&(k=G,U=j)),++Y}return U===-1?r(D,B,_,V):U}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let h=0;for(;u<d;)p[t[u]].vertexTriangles.push(h),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(h),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(h),++p[t[u+2]].numLiveTriangles,++h,u+=3;let x=0,b=i+1;o=1;let C=[],T=[],A,S,v=0,I=[],O=a/3,R=[];for(g=0;g<O;g++)R[g]=!1;let N,F;for(;x!==-1;){C=[],S=p[x],F=S.vertexTriangles.length;for(let _=0;_<F;++_)if(h=S.vertexTriangles[_],!R[h]){R[h]=!0,u=h+h+h;for(let E=0;E<3;++E)N=t[u],C.push(N),T.push(N),I[v]=N,++v,A=p[N],--A.numLiveTriangles,b-A.timeStamp>i&&(A.timeStamp=b,++b),++u}x=s(t,i,C,p,b,T,c)}return I};var dM=T8;var mc={};function xM(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function Ewe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)xM(i,o,e[r],e[r+1],e[r+2]);return i}function Swe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);xM(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)xM(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function vwe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)xM(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}mc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Fe.TRIANGLES:e.indices=Ewe(t);break;case Fe.TRIANGLE_STRIP:e.indices=Swe(t);break;case Fe.TRIANGLE_FAN:e.indices=vwe(t);break}e.primitiveType=Fe.LINES}return e};mc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new dt({attributes:{position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Fe.LINES,boundingSphere:c})};mc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};mc.reorderForPreVertexCache=function(e){let t=dt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ue.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],h=g.values,x=0,b=g.componentsPerAttribute,C=X.createTypedArray(g.componentDatatype,u*b);for(;x<t;){let T=i[x];if(T!==-1)for(let A=0;A<b;A++)C[b*T+A]=h[b*x+A];++x}g.values=C}}return e};mc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Fe.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=dM.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function XZ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Pe({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function wwe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}mc.fitToUnsignedShortIndices=function(e){let t=[],n=dt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=XZ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Fe.TRIANGLES?u=3:e.primitiveType===Fe.LINES?u=2:e.primitiveType===Fe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=r++,i[p]=g,wwe(s,e.attributes,p)),o.push(g)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=XZ(e.attributes))}o.length!==0&&t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var KZ=new m,Iwe=new me;mc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Di;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=m.fromArray(a,f,KZ),p=s.cartesianToCartographic(d,Iwe),g=o.project(p,KZ);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var A8={high:0,low:0};mc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)qn.encode(r[f],A8),a[f]=A8.high,c[f]=A8.low;let u=o.componentsPerAttribute;return e.attributes[n]=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Vf=new m;function E8(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Vf),L.multiplyByPoint(e,Vf,Vf),m.pack(Vf,n,o)}}function S8(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Vf),Z.multiplyByVector(e,Vf,Vf),Vf=m.normalize(Vf,Vf),m.pack(Vf,n,o)}}var mM=new L,hM=new Z;mc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(L.equals(t,L.IDENTITY))return e;let n=e.geometry.attributes;E8(t,n.position),E8(t,n.prevPosition),E8(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(L.inverse(t,mM),L.transpose(mM,mM),L.getMatrix3(mM,hM),S8(hM,n.normal),S8(hM,n.tangent),S8(hM,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=L.clone(L.IDENTITY),e};function Dwe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new Pe({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var Pwe=new m;function v8(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=Dwe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)d[s++]=p[r];let h;if(c){let T=0;for(o=0;o<n;++o)T+=e[o][t].indices.length;let A=dt.computeNumberOfVertices(new dt({attributes:f,primitiveType:Fe.POINTS})),S=Ue.createTypedArray(A,T),v=0,I=0;for(o=0;o<n;++o){let O=e[o][t].indices,R=O.length;for(s=0;s<R;++s)S[v++]=I+O[s];I+=dt.computeNumberOfVertices(e[o][t])}h=S}let x=new m,b=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){x=void 0;break}m.add(C.center,x,x)}if(l(x))for(m.divideByScalar(x,n,x),o=0;o<n;++o){C=e[o][t].boundingSphere;let T=m.magnitude(m.subtract(C.center,x,Pwe))+C.radius;T>b&&(b=T)}return new dt({attributes:f,indices:h,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}mc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(v8(t,"geometry")),n.length>0&&(o.push(v8(n,"westHemisphereGeometry")),o.push(v8(n,"eastHemisphereGeometry"))),o};var Pu=new m,hS=new m,Zb=new m,$b=new m;mc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let h=t[u],x=t[u+1],b=t[u+2],C=h*3,T=x*3,A=b*3;hS.x=i[C],hS.y=i[C+1],hS.z=i[C+2],Zb.x=i[T],Zb.y=i[T+1],Zb.z=i[T+2],$b.x=i[A],$b.y=i[A+1],$b.z=i[A+2],s[h].count++,s[x].count++,s[b].count++,m.subtract(Zb,hS,Zb),m.subtract($b,hS,$b),a[f]=m.cross(Zb,$b,new m),f++}let d=0;for(u=0;u<o;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let h=p.indexOffset+p.currentCount;c[h]=f,p.currentCount++,p=s[t[u+1]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,p=s[t[u+2]],h=p.indexOffset+p.currentCount,c[h]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let h=u*3;if(p=s[u],m.clone(m.ZERO,Pu),p.count>0){for(f=0;f<p.count;f++)m.add(Pu,a[c[p.indexOffset+f]],Pu);m.equalsEpsilon(m.ZERO,Pu,P.EPSILON10)&&m.clone(a[c[p.indexOffset]],Pu)}m.equalsEpsilon(m.ZERO,Pu,P.EPSILON10)&&(Pu.z=1),m.normalize(Pu,Pu),g[h]=Pu.x,g[h+1]=Pu.y,g[h+2]=Pu.z}return e.attributes.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var Owe=new m,JZ=new m,Rwe=new m;mc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],C=n[u+2];f=x*3,d=b*3,p=C*3;let T=x*2,A=b*2,S=C*2,v=i[f],I=i[f+1],O=i[f+2],R=r[T],N=r[T+1],F=r[A+1]-N,_=r[S+1]-N,E=1/((r[A]-R)*_-(r[S]-R)*F),w=(_*(i[d]-v)-F*(i[p]-v))*E,D=(_*(i[d+1]-I)-F*(i[p+1]-I))*E,M=(_*(i[d+2]-O)-F*(i[p+2]-O))*E;c[f]+=w,c[f+1]+=D,c[f+2]+=M,c[d]+=w,c[d+1]+=D,c[d+2]+=M,c[p]+=w,c[p+1]+=D,c[p+2]+=M}let g=new Float32Array(s*3),h=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let x=m.fromArray(o,f,Owe),b=m.fromArray(c,f,Rwe),C=m.dot(x,b);m.multiplyByScalar(x,C,JZ),m.normalize(m.subtract(b,JZ,b),b),g[f]=b.x,g[d]=b.y,g[p]=b.z,m.normalize(m.cross(x,b,b),b),h[f]=b.x,h[d]=b.y,h[p]=b.z}return e.attributes.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h}),e};var pS=new H,Uf=new m,ZZ=new m,$Z=new m,pM=new H;mc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let I=t.values;i=I.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(m.fromArray(I,n*3,Uf),m.equals(Uf,m.ZERO)){R+=2;continue}pM=Yn.octEncodeInRange(Uf,65535,pM),O[R++]=pM.x,O[R++]=pM.y}return e.attributes.compressedAttributes=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,h,x;s&&(p=o.values),a&&(g=r.values),f&&(h=c.values),d&&(x=u.values),i=(s?p.length:g.length)/(s?3:2);let T=i,A=a&&s?2:1;A+=f||d?1:0,T*=A;let S=new Float32Array(T),v=0;for(n=0;n<i;++n){a&&(H.fromArray(g,n*2,pS),S[v++]=Yn.compressTextureCoordinates(pS));let I=n*3;s&&l(h)&&l(x)?(m.fromArray(p,I,Uf),m.fromArray(h,I,ZZ),m.fromArray(x,I,$Z),Yn.octPack(Uf,ZZ,$Z,pS),S[v++]=pS.x,S[v++]=pS.y):(s&&(m.fromArray(p,I,Uf),S[v++]=Yn.octEncodeFloat(Uf)),f&&(m.fromArray(h,I,Uf),S[v++]=Yn.octEncodeFloat(Uf)),d&&(m.fromArray(x,I,Uf),S[v++]=Yn.octEncodeFloat(Uf)))}return e.attributes.compressedAttributes=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:A,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function Mwe(e){if(l(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Lwe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function Nwe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function Fwe(e){if(l(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Bwe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Fe.LINES,e}function kwe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Fe.LINES,e}function Uwe(e){switch(e.primitiveType){case Fe.TRIANGLE_FAN:return Lwe(e);case Fe.TRIANGLE_STRIP:return Nwe(e);case Fe.TRIANGLES:return Mwe(e);case Fe.LINE_STRIP:return Bwe(e);case Fe.LINE_LOOP:return kwe(e);case Fe.LINES:return Fwe(e)}return e}function C_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function Vwe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){C_(e,e.y<0),C_(t,t.y<0),C_(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;C_(e,a),C_(t,a),C_(n,a)}var QZ=new m;function Ou(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,QZ),e.y/(e.y-t.y),QZ),n),m.clone(n,i),C_(n,!0),C_(i,!1)}var n0=new m,i0=new m,o0=new m,r0=new m,w8={positions:new Array(7),indices:new Array(3*3)};function zwe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;Vwe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=w8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ou(e,t,n0,o0),Ou(e,n,i0,r0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Ou(t,n,n0,o0),Ou(t,e,i0,r0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Ou(n,e,n0,o0),Ou(n,t,i0,r0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Ou(n,e,n0,o0),Ou(n,t,i0,r0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ou(t,n,n0,o0),Ou(t,e,i0,r0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ou(e,t,n0,o0),Ou(e,n,i0,r0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=w8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=n0,c[4]=i0,c[5]=o0,c[6]=r0,c.length=7),w8}function e$(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function eC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Pe({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function O8(e,t,n){let i=l(e.geometry.boundingSphere);t=e$(t,i),n=e$(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function R8(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let g=e.fromArray(u,r*t,n),h=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(x,c.z,x);let b=e.add(g,h,g);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var Hwe=R8(re,4),yM=R8(m,3),s$=R8(H,2),Gwe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},_S=new m,I8=new m,D8=new m,Wwe=new m;function _M(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let b=m.fromArray(o,e*3,_S),C=m.fromArray(o,t*3,I8),T=m.fromArray(o,n*3,D8),A=Jb(i,b,C,T,Wwe);if(l(A)){if(l(r)&&yM(e,t,n,A,r,d.normal.values,x,!0),l(u)){let S=m.fromArray(u,e*3,_S),v=m.fromArray(u,t*3,I8),I=m.fromArray(u,n*3,D8);m.multiplyByScalar(S,A.x,S),m.multiplyByScalar(v,A.y,v),m.multiplyByScalar(I,A.z,I);let O;!m.equals(S,m.ZERO)||!m.equals(v,m.ZERO)||!m.equals(I,m.ZERO)?(O=m.add(S,v,S),m.add(O,I,O),m.normalize(O,O)):(O=_S,O.x=0,O.y=0,O.z=0),m.pack(O,d.extrudeDirection.values,x*3)}if(l(f)&&Gwe(e,t,n,A,f,d.applyOffset.values,x),l(s)&&yM(e,t,n,A,s,d.tangent.values,x,!0),l(a)&&yM(e,t,n,A,a,d.bitangent.values,x,!0),l(c)&&s$(e,t,n,A,c,d.st.values,x),g>0)for(let S=0;S<g;S++){let v=p[S];jwe(e,t,n,A,x,h[v],d[v])}}}function jwe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:Hwe(e,t,n,i,c,u,o,!1);break;case 3:yM(e,t,n,i,c,u,o,!1);break;case 2:s$(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function am(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var qwe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function t$(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let O in n)n.hasOwnProperty(O)&&!qwe[O]&&l(n[O])&&d.push(O);let p=d.length,g=eC(t),h=eC(t),x,b,C,T,A,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,A=0;A<S.length;++A)S[A]=-1,v[A]=-1;let I=f.length;for(A=0;A<I;A+=3){let O=f[A],R=f[A+1],N=f[A+2],F=m.fromArray(i,O*3),_=m.fromArray(i,R*3),E=m.fromArray(i,N*3),w=zwe(F,_,E);if(l(w)&&w.positions.length>3){let D=w.positions,M=w.indices,B=M.length;for(let V=0;V<B;++V){let U=M[V],G=D[U];G.y<0?(x=h.attributes,b=h.indices,C=S):(x=g.attributes,b=g.indices,C=v),T=am(x,b,C,f,U<3?A+U:-1,G),_M(O,R,N,G,i,o,s,r,a,c,u,x,d,p,n,T)}}else l(w)&&(F=w.positions[0],_=w.positions[1],E=w.positions[2]),F.y<0?(x=h.attributes,b=h.indices,C=S):(x=g.attributes,b=g.indices,C=v),T=am(x,b,C,f,A,F),_M(O,R,N,F,i,o,s,r,a,c,u,x,d,p,n,T),T=am(x,b,C,f,A+1,_),_M(O,R,N,_,i,o,s,r,a,c,u,x,d,p,n,T),T=am(x,b,C,f,A+2,E),_M(O,R,N,E,i,o,s,r,a,c,u,x,d,p,n,T)}O8(e,h,g)}var a$=dn.fromPointNormal(m.ZERO,m.UNIT_Y),Ywe=new m,Xwe=new m;function Qb(e,t,n,i,o,r,s){if(!l(s))return;let a=m.fromArray(i,e*3,_S);m.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function n$(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=eC(t),a=eC(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],g=r[c+1],h=m.fromArray(i,p*3,_S),x=m.fromArray(i,g*3,I8),b;Math.abs(h.y)<P.EPSILON6&&(h.y<0?h.y=-P.EPSILON6:h.y=P.EPSILON6),Math.abs(x.y)<P.EPSILON6&&(x.y<0?x.y=-P.EPSILON6:x.y=P.EPSILON6);let C=s.attributes,T=s.indices,A=d,S=a.attributes,v=a.indices,I=f,O=$i.lineSegmentPlane(h,x,a$,D8);if(l(O)){let R=m.multiplyByScalar(m.UNIT_Y,5*P.EPSILON9,Ywe);h.y<0&&(m.negate(R,R),C=a.attributes,T=a.indices,A=f,S=s.attributes,v=s.indices,I=d);let N=m.add(O,R,Xwe);b=am(C,T,A,r,c,h),Qb(p,g,h,i,b,C,o),b=am(C,T,A,r,-1,N),Qb(p,g,N,i,b,C,o),m.negate(R,R),m.add(O,R,N),b=am(S,v,I,r,-1,N),Qb(p,g,N,i,b,S,o),b=am(S,v,I,r,c+1,x),Qb(p,g,x,i,b,S,o)}else{let R,N,F;h.y<0?(R=a.attributes,N=a.indices,F=f):(R=s.attributes,N=s.indices,F=d),b=am(R,N,F,r,c,h),Qb(p,g,h,i,b,R,o),b=am(R,N,F,r,c+1,x),Qb(p,g,x,i,b,R,o)}}O8(e,a,s)}var i$=new H,Kwe=new H,c$=new m,l$=new m,P8=new m,Jwe=new m,Zwe=new m,$we=new m,o$=new re;function r$(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=m.unpack(n,s,c$);if(a.x>0)continue;let c=m.unpack(i,s,l$);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(o,s,P8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):m.pack(a,o,s))}}var Qwe=5*P.EPSILON9,gM=P.EPSILON6;function eIe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=eC(t),f=eC(t),d,p,g,h=!1,x=i.length/3;for(d=0;d<x;d+=4){let b=d,C=d+2,T=m.fromArray(i,b*3,c$),A=m.fromArray(i,C*3,l$);if(Math.abs(T.y)<gM)for(T.y=gM*(A.y<0?-1:1),i[d*3+1]=T.y,i[(d+1)*3+1]=T.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(A.y)<gM)for(A.y=gM*(T.y<0?-1:1),i[(d+2)*3+1]=A.y,i[(d+3)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let S=u.attributes,v=u.indices,I=f.attributes,O=f.indices,R=$i.lineSegmentPlane(T,A,a$,Jwe);if(l(R)){h=!0;let N=m.multiplyByScalar(m.UNIT_Y,Qwe,Zwe);T.y<0&&(m.negate(N,N),S=f.attributes,v=f.indices,I=u.attributes,O=u.indices);let F=m.add(R,N,$we);S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.position.values.push(F.x,F.y,F.z),S.position.values.push(F.x,F.y,F.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),m.negate(N,N),m.add(R,N,F),I.position.values.push(F.x,F.y,F.z),I.position.values.push(F.x,F.y,F.z),I.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),I.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let _=H.fromArray(s,b*2,i$),E=Math.abs(_.y);S.expandAndWidth.values.push(-1,E,1,E),S.expandAndWidth.values.push(-1,-E,1,-E),I.expandAndWidth.values.push(-1,E,1,E),I.expandAndWidth.values.push(-1,-E,1,-E);let w=m.magnitudeSquared(m.subtract(R,T,P8));if(w/=m.magnitudeSquared(m.subtract(A,T,P8)),l(c)){let D=re.fromArray(c,b*4,o$),M=re.fromArray(c,C*4,o$),B=P.lerp(D.x,M.x,w),V=P.lerp(D.y,M.y,w),U=P.lerp(D.z,M.z,w),G=P.lerp(D.w,M.w,w);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(B,V,U,G),S.color.values.push(B,V,U,G),I.color.values.push(B,V,U,G),I.color.values.push(B,V,U,G),p=C*4;p<C*4+2*4;++p)I.color.values.push(c[p])}if(l(a)){let D=H.fromArray(a,b*2,i$),M=H.fromArray(a,(d+3)*2,Kwe),B=P.lerp(D.x,M.x,w);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(B,D.y),S.st.values.push(B,M.y),I.st.values.push(B,D.y),I.st.values.push(B,M.y),p=C*2;p<C*2+2*2;++p)I.st.values.push(a[p])}g=S.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=I.position.values.length/3-4,O.push(g,g+2,g+1),O.push(g+1,g+2,g+3)}else{let N,F;for(T.y<0?(N=f.attributes,F=f.indices):(N=u.attributes,F=u.indices),N.position.values.push(T.x,T.y,T.z),N.position.values.push(T.x,T.y,T.z),N.position.values.push(A.x,A.y,A.z),N.position.values.push(A.x,A.y,A.z),p=d*3;p<d*3+4*3;++p)N.prevPosition.values.push(o[p]),N.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+4*2;++p)N.expandAndWidth.values.push(s[p]),l(a)&&N.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)N.color.values.push(c[p]);g=N.position.values.length/3-4,F.push(g,g+2,g+1),F.push(g+1,g+2,g+3)}}h&&(r$(f),r$(u)),O8(e,f,u)}mc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,dn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING))return e;if(t.geometryType!==Nf.NONE)switch(t.geometryType){case Nf.POLYLINES:eIe(e);break;case Nf.TRIANGLES:t$(e);break;case Nf.LINES:n$(e);break}else Uwe(t),t.primitiveType===Fe.TRIANGLES?t$(e):t.primitiveType===Fe.LINES&&n$(e);return e};var Un=mc;function qc(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(qc.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});qc.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};qc.geodeticLatitudeToMercatorAngle=function(e){e>qc.MaximumLatitude?e=qc.MaximumLatitude:e<-qc.MaximumLatitude&&(e=-qc.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};qc.MaximumLatitude=qc.mercatorAngleToGeodeticLatitude(Math.PI);qc.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=qc.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};qc.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=qc.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var Oi=qc;function tIe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!L.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Un.transformToWorldCoordinates(e[r]);else L.multiplyTransformation(t,e[0].modelMatrix,t)}function M8(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function nIe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?M8(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(M8(i.westHemisphereGeometry,n),M8(i.eastHemisphereGeometry,n))}}function iIe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(tIe(t,a,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&Un.splitLongitude(t[c]);if(nIe(t),r)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Un.reorderForPostVertexCache(g.geometry),Un.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Un.reorderForPostVertexCache(g.westHemisphereGeometry),Un.reorderForPreVertexCache(g.westHemisphereGeometry),Un.reorderForPostVertexCache(g.eastHemisphereGeometry),Un.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Un.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(o)for(let h in g)g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE&&Un.encodeAttribute(u,h,`${h}3DHigh`,`${h}3DLow`);else for(let h in g)if(g.hasOwnProperty(h)&&g[h].componentDatatype===X.DOUBLE){let x=`${h}3D`,b=`${h}2D`;Un.projectTo2D(u,h,x,b,n),l(u.boundingSphere)&&h==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Un.encodeAttribute(u,x,`${x}High`,`${x}Low`),Un.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Un.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Un.fitToUnsignedShortIndices(u));p=g}return p}function L8(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function oIe(e,t){let n=[];return L8(e,"geometry",t,n),L8(e,"westHemisphereGeometry",t,n),L8(e,"eastHemisphereGeometry",t,n),n}var Bh={};Bh.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=iIe(e),t.length>0&&(n=Un.createAttributeLocations(t[0]),e.createPickOffsets&&(r=oIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,h=d.westHemisphereGeometry;l(g)&&l(h)&&(l(g.boundingSphere)&&l(h.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,h.boundingSphere)),l(g.boundingSphereCV)&&l(h.boundingSphereCV)&&(u[f]=ae.union(g.boundingSphereCV,h.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function rIe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function sIe(e,t){let n=e.length;for(let i=0;i<n;++i)rIe(e[i],t)}function aIe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ae.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}Bh.packCreateGeometryResults=function(e,t){let n=new Float64Array(aIe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let b=g[x],C=p[b];n[s++]=o[b],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let h=l(c.indices)?c.indices.length:0;n[s++]=h,h>0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};Bh.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,C,T=new gn,A=n[s++];for(i=0;i<A;i++){let v=t[n[s++]],I=n[s++];C=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(I,x);for(let R=0;R<x;R++)b[R]=n[s++];T[v]=new Pe({componentDatatype:I,componentsPerAttribute:C,normalize:O,values:b})}let S;if(x=n[s++],x>0){let v=b.length/C;for(S=Ue.createTypedArray(v,x),i=0;i<x;i++)S[i]=n[s++]}o[r++]=new dt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:S,attributes:T,offsetAttribute:f})}return o};function cIe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(L.pack(s.modelMatrix,i,o),o+=L.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function lIe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=L.unpack(t,o),s;o+=L.packedLength,l(t[o])&&(s={offset:new Zi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Bh.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:cIe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Di,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Bh.unpackCombineGeometryParameters=function(e){let t=lIe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Bh.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=oe.clone(e.ellipsoid),s=e.isGeographic?new Di(r):new Oi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:L.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function u$(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ae.pack(e[r],i,o)):i[o++]=0,o+=ae.packedLength}return i}function f$(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}Bh.packCombineGeometryResults=function(e,t){l(e.geometries)&&sIe(e.geometries,t);let n=u$(e.boundingSpheres),i=u$(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Bh.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:f$(e.boundingSpheres),boundingSpheresCV:f$(e.boundingSpheresCV)}};var tC=Bh;var uIe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Tr=Object.freeze(uIe);var bM={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};bM.getMorphTime=function(e){return e===bM.SCENE3D?1:e===bM.MORPHING?void 0:0};var ne=Object.freeze(bM);var Ml={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Ml.NUMBER_OF_SHADOW_MODES=4;Ml.castShadows=function(e){return e===Ml.ENABLED||e===Ml.CAST_ONLY};Ml.receiveShadows=function(e){return e===Ml.ENABLED||e===Ml.RECEIVE_ONLY};Ml.fromCastReceive=function(e,t){return e&&t?Ml.ENABLED:e?Ml.CAST_ONLY:t?Ml.RECEIVE_ONLY:Ml.DISABLED};var Cn=Object.freeze(Ml);function mr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=new L,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,Cn.DISABLED),this._translucent=void 0,this._state=Tr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoad=(o,r,s)=>{this._error=s,this._state=r,o.afterRender.push(function(){if(t._ready=t._state===Tr.COMPLETE||t._state===Tr.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(mr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function fIe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var dIe=new H,mIe=new m,b$=new re;function C$(e){let t=e.length;if(t===1)return e[0];if(t===2)return H.unpack(e,0,dIe);if(t===3)return m.unpack(e,0,mIe);if(t===4)return re.unpack(e,0,b$)}function hIe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=fIe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,g,h,x;for(g=0;g<s;++g)h=r[g],x=p[h],c[h]=g,a.push({functionName:`czm_batchTable_${h}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,C=new Kb(t,a,o);for(g=0;g<o;++g){let T=i[g];p=T.attributes;for(let O=0;O<s;++O){h=r[O],x=p[h];let R=C$(x.value),N=c[h];C.setBatchedAttribute(g,N,R)}let A={primitive:y(T.pickPrimitive,e)};l(T.id)&&(A.id=T.id);let S=t.createPickId(A);e._pickIds.push(S);let v=S.color,I=b$;I.x=z.floatToByte(v.red),I.y=z.floatToByte(v.green),I.z=z.floatToByte(v.blue),I.w=z.floatToByte(v.alpha),C.setBatchedAttribute(g,b-1,I)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function pIe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Pe({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function _Ie(e){let t=e.attributes,n=new gn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=pIe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new dt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function gIe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:L.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var yIe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;mr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=yIe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; +`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; +`,r+=`in vec4 position; +`,s+=`${c} +{ + return u_modifiedModelView * position; +} -struct Box { - vec3 p0; - vec3 p1; -}; +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} +{ + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); +} -Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) +`:(r+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} { - // Find the min/max cornerpoints of the voxel in tile coordinates - vec3 tileOrigin = vec3(octreeCoords.xyz); - vec3 numSamples = vec3(u_dimensions); - vec3 voxelSize = 1.0 / numSamples; - vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; - vec3 coordP1 = coordP0 + voxelSize; + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; +} + +`)}return[o,r,t,s].join(` +`)};mr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${We.replaceMain(t,"czm_non_show_main")} +void main() +{ + czm_non_show_main(); + gl_Position *= czm_batchTable_show(batchId); +}`:t};mr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function d$(e){return`${We.replaceMain(e,"czm_non_pick_main")} +out vec4 v_pickColor; +void main() +{ + czm_non_pick_main(); + v_pickColor = czm_batchTable_pickColor(batchId); +}`}function m$(e){return`in vec4 v_pickColor; +${e}`}mr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};mr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; +`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); +`;return o+=` if (czm_sceneMode == czm_sceneMode3D) +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } +`,o+=` else +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};mr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=We.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() +{ + czm_non_distanceDisplayCondition_main(); + vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); + vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); + vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); + float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); +`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); + vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); + vec4 centerRTE; + if (czm_morphTime == 1.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); + } + else if (czm_morphTime == 0.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); + } + else + { + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); + } +`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function h$(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); +`}n&&o&&r?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(f+=`vec3 bitangent; +`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=We.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function xIe(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function bIe(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif +} +`,t}function p$(e,t){let n=e.vertexAttributes}function CIe(e,t){return function(){return e[t]}}var N8=Math.max(Wt.hardwareConcurrency-1,1),CM,TIe=new yi("combineGeometry");function AIe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Tr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,geometry:i});if(!l(CM))for(CM=new Array(N8),o=0;o<N8;o++)CM[o]=new yi("createGeometry");let f;for(u=lM(u,N8),o=0;o<u.length;o++){let d=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let h;if(d>0){let x=new Float64Array(d);for(h=[x.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(CM[o].scheduleTask({subTasks:u[o]},h))}e._state=Tr.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Tr.CREATED}).catch(function(d){yS(e,t,Tr.FAILED,d)})}else if(e._state===Tr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=TIe.scheduleTask(tC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Tr.COMBINING,Promise.resolve(f).then(function(d){let p=tC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=L.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Tr.COMBINED):yS(e,t,Tr.FAILED,void 0)}).catch(function(d){yS(e,t,Tr.FAILED,d)})}}function EIe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=_Ie(p):g=p.constructor.createGeometry(p),o[c++]=gIe(s,g),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=tC.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=L.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Tr.COMBINED):yS(e,t,Tr.FAILED,void 0)}function SIe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new m);x=r[i].clone(x),S$(x,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,dn.ORIGIN_ZX_PLANE)!==tn.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)g=ae.union(g,u[i]);let h=[];for(l(d)&&h.push(d),l(p)&&h.push(p),l(g)&&h.push(g),i=0;i<h.length;i++){let x=h[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}mr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var _$=new qn,T$=new me,A$=new m,E$=new ae;function vIe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let h=0;h<g;++h){let x=p[h];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,E$));let C=x.center,T=x.radius,A=qn.fromCartesian(C,_$);if(d.setBatchedAttribute(h,o,A.high),d.setBatchedAttribute(h,r,A.low),!t.scene3DOnly){let S=f.cartesianToCartographic(C,T$),v=u.project(S,A$);A=qn.fromCartesian(v,_$),d.setBatchedAttribute(h,s,A.high),d.setBatchedAttribute(h,a,A.low)}d.setBatchedAttribute(h,c,T)}e._batchTableBoundingSpheresUpdated=!0}var F8=new m,wIe=new m;function g$(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(m.equals(d,m.ZERO)){s.setBatchedAttribute(u,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,E$));let g=f.center;g=r.scaleToGeodeticSurface(g,wIe);let h=r.cartesianToCartographic(g,T$),x=o.project(h,A$),b=m.add(d,g,F8);h=r.cartesianToCartographic(b,h);let C=o.project(h,F8),T=m.subtract(C,x,F8),A=T.x;T.x=T.z,T.z=T.y,T.y=A,s.setBatchedAttribute(u,i,T)}e._batchTableOffsetsUpdated=!0}function IIe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(ai.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:ke.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,yS(e,t,Tr.COMPLETE,void 0)}function DIe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ye(o,!1),r.cull={enabled:!0,face:gi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=gi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ye(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ye(o,!1),r.depthTest.func=dc.GREATER,i?(r.cull={enabled:!0,face:gi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=gi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function PIe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=mr._appendOffsetToShader(e,r),r=mr._appendShowToShader(e,r),r=mr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=d$(r),r=mr._updateColorAttribute(e,r,!1),r=h$(e,r),r=mr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=m$(s),e._sp=$t.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),p$(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=mr._appendShowToShader(e,r),r=mr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=d$(r),r=mr._updateColorAttribute(e,r,!0),r=h$(e,r),r=mr._modifyShaderPosition(e,r,t.scene3DOnly),r=xIe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=m$(s),s=bIe(s),e._spDepthFail=$t.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),p$(e._spDepthFail,o))}var gS=new L,y$=new m;function x$(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=CIe(s,c));let a=_t(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return L.multiply(c,e._modelMatrix,gS),L.multiplyByPoint(gS,e.rtcCenter,y$),L.setTranslation(gS,y$,gS),gS}),a}function OIe(e,t,n,i,o,r,s,a){let c=x$(e,t,n,a),u;l(e._depthFailAppearance)&&(u=x$(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ae.TRANSLUCENT:Ae.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,g=0;for(let h=0;h<p;++h){let x;o&&(x=r[h],l(x)||(x=r[h]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++h),x=r[h],l(x)||(x=r[h]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(o&&(++h,x=r[h],l(x)||(x=r[h]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++h,x=r[h],l(x)||(x=r[h]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++g}}mr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!L.equals(n,e._modelMatrix))for(L.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ae.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ae.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ae.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function RIe(e,t,n,i,o,r,s,a){mr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Cn.castShadows(e.shadows),g=Cn.receiveShadows(e.shadows),h=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<h;++b){let C=Math.floor(b/x),T=n[b];T.modelMatrix=o,T.boundingVolume=c[C],T.cull=r,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=g,d?T.pickId="v_pickColor":T.pickId=void 0,u.push(T)}}}mr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Tr.FAILED)return;let t=e.context;if(l(this._batchTable)||hIe(this,t),this._batchTable.attributes.length>0){if(Gt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Tr.COMPLETE&&this._state!==Tr.COMBINED&&(this.asynchronous?AIe(this,e):EIe(this,e)),this._state===Tr.COMBINED&&(vIe(this,e),g$(this,e),IIe(this,e)),!this.show||this._state!==Tr.COMPLETE)return;this._batchTableOffsetsUpdated||g$(this,e),this._recomputeBoundingSpheres&&SIe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,DIe)(this,t,n,u),r&&y(this._createShaderProgramFunction,PIe)(this,e,n),(o||r)&&y(this._createCommandsFunction,OIe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,RIe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var MIe=new ae,LIe=new ae;function S$(e,t,n){if(n===an.TOP){let i=ae.clone(e,MIe),o=ae.clone(e,LIe);o.center=m.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===an.ALL&&(e.center=m.add(e.center,t,e.center));return e}function NIe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function FIe(e,t,n,i,o){return function(r){let s=C$(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var BIe=new m;function kIe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&S$(i,m.fromArray(r.get(),0,BIe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function UIe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}mr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:NIe(s,n,f),set:FIe(s,n,f,this,u)}}return kIe(this,c,n),UIe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};mr.prototype.isDestroyed=function(){return!1};mr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function yS(e,t,n,i){e._completeLoad(t,n,i)}var Dn=mr;function VIe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var hc=VIe;var xS=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES - // Transform to the UV coordinates of the scaled tileset - float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); - vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); - vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif - return Box(p0, p1); +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); + return eyeCoordinate.xyz / eyeCoordinate.w; } -vec3 getBoxNormal(in Box box, in Ray ray, in float t) -{ - vec3 hitPoint = ray.pos + t * ray.dir; - vec3 lower = step(hitPoint, box.p0); - vec3 upper = step(box.p1, hitPoint); - return normalize(upper - lower); +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { + vec2 glFragCoordXY = gl_FragCoord.xy; + // Sample depths at both offset and negative offset + float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); + float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); + // Explicitly evaluate both paths + // Necessary for multifrustum and for edges of the screen + bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); + float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } +#endif // NORMAL_EC -// Find the distances along a ray at which the ray intersects an axis-aligned box -// See https://tavianator.com/2011/ray_box.html -RayShapeIntersection intersectBox(in Ray ray, in Box box) +void main(void) { - // Consider the box as the intersection of the space between 3 pairs of parallel planes - // Compute the distance along the ray to each plane - vec3 t0 = (box.p0 - ray.pos) * ray.dInv; - vec3 t1 = (box.p1 - ray.pos) * ray.dInv; - - // Identify candidate entries/exits based on distance from ray.pos - vec3 entries = min(t0, t1); - vec3 exits = max(t0, t1); +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif - // The actual box intersection points are the furthest entry and the closest exit - float entryT = max(max(entries.x, entries.y), entries.z); - float exitT = min(min(exits.x, exits.y), exits.z); +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif - vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); - vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES - if (entryT > exitT) { - entryT = NO_HIT; - exitT = NO_HIT; +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK - return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); -} - -void intersectShape(in Ray ray, inout Intersections ix) -{ - RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); - setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); -} -`;var pV=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, -// setIntersectionPair - -/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX -#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT -#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF -#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO - -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED - -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX -#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN -#define CYLINDER_INTERSECTION_INDEX_ANGLE -*/ - -// Cylinder uniforms -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - uniform vec3 u_cylinderUvToRenderBoundsScale; - uniform vec3 u_cylinderUvToRenderBoundsTranslate; -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - uniform float u_cylinderUvToRenderRadiusMin; -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) - uniform vec2 u_cylinderRenderAngleMinMax; +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } #endif -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); - - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; - - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - - return vec4(-INF_HIT, t, t, +INF_HIT); -} - -#define POSITIVE_HIT vec2(t, +INF_HIT); -#define NEGATIVE_HIT vec2(-INF_HIT, t); - -vec2 intersectHalfSpace(Ray ray, float angle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); - - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); - - // Half space cuts right through the camera, pick the side to intersect - if (a == 0.0) { - if (b >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; - } - } +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif - if (t >= 0.0 != s >= 0.0) { - return POSITIVE_HIT; - } else { - return NEGATIVE_HIT; - } -} -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); +#ifdef PER_INSTANCE_COLOR - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; +#else // PER_INSTANCE_COLOR - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); -} + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); -} + czm_materialInput materialInput; -vec2 intersectUnitCylinder(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif - if (det < 0.0) { - return vec2(NO_HIT); - } +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif - det = sqrt(det); - float ta = (-b - det) / a; - float tb = (-b + det) / a; - float t1 = min(ta, tb); - float t2 = max(ta, tb); +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif - float z1 = o.z + t1 * d.z; - float z2 = o.z + t2 * d.z; + czm_material material = czm_getMaterial(materialInput); - if (abs(z1) >= 1.0) - { - float tCap = (sign(z1) - o.z) / d.z; - t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; - } +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT - if (abs(z2) >= 1.0) - { - float tCap = (sign(z2) - o.z) / d.z; - t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; - } + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - return vec2(t1, t2); +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK } +`;function Ru(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new B8;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new B8;if(o.requiresTextureCoordinates=e,n instanceof cn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Ru.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof cn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof cn||(o=t.material.shaderSource),new We({defines:i,sources:[o,xS]})};Ru.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new We({defines:n,sources:[xS],pickColorQualifier:"in"})};Ru.prototype.createVertexShader=function(e,t,n,i){return M$(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Ru.prototype.createPickVertexShader=function(e,t,n,i){return M$(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var v$=new m,w$=new me,I$={high:0,low:0};function M$(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=w$;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,v$),d=qn.encode(f.x,I$);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=w$;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,v$);d=qn.encode(g.x,I$),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof cn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new We({defines:c,sources:[o]})}function B8(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(B8.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function D$(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/H.distance(t,e)}var zIe=[new H,new H,new H,new H];function L$(e,t){let n=zIe,i=H.unpack(t,0,n[0]),o=H.unpack(t,2,n[1]),r=H.unpack(t,4,n[2]);e.uMaxVmax=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/D$(i,o,r),a=1/D$(i,r,o);e.uvMinAndExtents=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var N$=new me,F$=new m,HIe=new m,GIe=new m,TM={high:0,low:0};function B$(e,t,n){let i=N$;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,F$);i.latitude=e.north;let r=t.project(i,HIe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,GIe),a=[0,0,0,0],c=[0,0,0,0],u=qn.encode(o.x,TM);a[0]=u.high,c[0]=u.low,u=qn.encode(o.y,TM),a[1]=u.high,c[1]=u.low,u=qn.encode(r.y,TM),a[2]=u.high,c[2]=u.low,u=qn.encode(s.x,TM),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var WIe=new L,jIe=new L,P$=new m,qIe=new me,YIe=[new me,new me,new me,new me,new me,new me,new me,new me];function XIe(e,t,n,i,o,r){let s=ce.center(e,qIe);s.height=n;let a=me.toCartesian(s,t,P$),c=Mt.eastNorthUpToFixedFrame(a,t,WIe),u=L.inverse(c,jIe),f=e.west,d=e.east,p=e.north,g=e.south,h=YIe;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let x=(f+d)*.5,b=(p+g)*.5;h[4].latitude=g,h[4].longitude=x,h[5].latitude=p,h[5].longitude=x,h[6].latitude=b,h[6].longitude=f,h[7].latitude=b,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){h[R].height=n;let N=me.toCartesian(h[R],t,P$);L.multiplyByPoint(u,N,N),N.z=0,C=Math.min(C,N.x),T=Math.max(T,N.x),A=Math.min(A,N.y),S=Math.max(S,N.y)}let v=i;v.x=C,v.y=A,v.z=0,L.multiplyByPoint(c,v,v);let I=o;I.x=T,I.y=A,I.z=0,L.multiplyByPoint(c,I,I),m.subtract(I,v,o);let O=r;O.x=C,O.y=S,O.z=0,L.multiplyByPoint(c,O,O),m.subtract(O,v,r)}var KIe=new m,JIe=new m,ZIe=new qn;Ru.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=F$,s=KIe,a=JIe;XIe(e,n,y(o,0),r,s,a);let c={};L$(c,t);let u=qn.fromCartesian(r,ZIe);return c.southWest_HIGH=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new hc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),B$(e,i,c),c};var $Ie=new m;function O$(e,t,n,i){let o=N$;o.latitude=e,o.longitude=t,o.height=0;let r=me.toCartesian(o,n,$Ie),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var R$=new H;Ru.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=O$(e.south,e.west,n,R$),r=o.x,s=o.y,a=O$(e.north,e.east,n,R$),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),g={sphericalExtents:new hc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new hc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return L$(g,t),B$(e,i,g),g};Ru.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Ru.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function QIe(e){return Math.max(e.width,e.height)>Ru.MAX_WIDTH_FOR_PLANAR_EXTENTS}Ru.shouldUseSphericalCoordinates=function(e){return QIe(e)};Ru.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Mu=Ru;var e1e={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Gn=Object.freeze(e1e);var t1e={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},pt=Object.freeze(t1e);var AM={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};AM.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Gn.ALWAYS,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},backFunction:Gn.ALWAYS,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},reference:AM.CESIUM_3D_TILE_MASK,mask:AM.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(AM);function s0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,o)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(s0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});s0.isSupported=function(e){return e.context.stencilBuffer};function nC(e,t){let n=t?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:n,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}function U8(e){return{stencilTest:{enabled:e,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var n1e={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function i1e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(nC(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(nC(o,!0)),e._rsColorPass=Ve.fromCache(U8(o,!1)),e._rsPickPass=Ve.fromCache(n1e)}function o1e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=We.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function r1e(e,t){let n=t.context,i=e._primitive,o=cM;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Dn._appendDistanceDisplayConditionToShader(i,o),o=Dn._modifyShaderPosition(e,o,t.scene3DOnly),o=Dn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=o1e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new We({defines:[a],sources:[o]}),u=new We({sources:[t0]}),f=e._primitive._attributeLocations,d=new Mu(s,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=We.createPickVertexShaderSource(o);h=Dn._appendShowToShader(i,h),h=Dn._updatePickColorAttribute(h);let x=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let T=d.createPickFragmentShader(!0),A=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Dn._appendShowToShader(i,o),c=new We({defines:[a],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let x=d.createFragmentShader(!0),b=d.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=h}}function s1e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ae.TERRAIN_CLASSIFICATION,s=nt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ae.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=_t(c,x._uniforms)),r.uniformMap=c,s=nt.shallowClone(r,r.derivedCommands.tileset),s.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=nt.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=nt.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let h=f[g]=nt.shallowClone(t[p],f[g]);h.shaderProgram=d,h.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function a1e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let h=i._va[d++];if(n&&(a=r[s++],h=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ae.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=h,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ae.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let x=nt.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=nt.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function c1e(e,t,n,i,o,r,s){s1e(e,r),a1e(e,s)}function k$(e,t){return Math.floor(e%t/2)}function k8(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function U$(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function l1e(e,t,n,i,o,r,s,a){let c=e._primitive;Dn._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Hn.CESIUM_3D_TILE,p=f!==Hn.TERRAIN,g=t.passes,h,x,b;if(g.render){let C=n.length;for(h=0;h<C;++h)x=u[k$(h,C)],d&&(b=n[h],k8(b,t,o,r,x,s)),p&&(b=n[h].derivedCommands.tileset,k8(b,t,o,r,x,s));if(t.invertClassification){let T=e._commandsIgnoreShow,A=T.length;for(h=0;h<A;++h)x=u[h],b=T[h],k8(b,t,o,r,x,s)}}if(g.pick){let C=i.length,T=c._pickOffsets;for(h=0;h<C;++h){let A=T[k$(h,C)];x=u[A.index],d&&(b=i[h],U$(b,t,o,r,x)),p&&(b=i[h].derivedCommands.tileset,U$(b,t,o,r,x))}}}s0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=Mu.hasAttributesForSphericalExtents(c),g=Mu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Ht.equals(d,x)}if(!f&&!p&&!g)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new cn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let h=new Array(r);for(s=0;s<r;++s)a=o[s],h[s]=new Tt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=h,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,C,T){i1e(n,b)},i._createShaderProgramFunction=function(x,b,C){r1e(n,b)},i._createCommandsFunction=function(x,b,C,T,A,S,v){c1e(n,void 0,void 0,!0,!1,S,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,C,T,A,S,v,I){n._updateAndQueueCommandsFunction(x,b,C,T,A,S,v,I)}:i._updateAndQueueCommandsFunction=function(x,b,C,T,A,S,v,I){l1e(n,b,C,T,A,S,v,I)},this._primitive=new Dn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(nC(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(nC(!1,!0)),this._rsColorPass=Ve.fromCache(U8(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(nC(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(nC(!0,!0)),this._rsColorPass=Ve.fromCache(U8(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};s0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};s0.prototype.isDestroyed=function(){return!1};s0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var bS=s0;var u1e={u_globeMinimumAltitude:function(){return 55e3}};function Yc(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],s=r.length;for(let a=0;a<s;a++){let c=r[a].attributes;if(l(c)&&l(c.color)){t=new cn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;let i=this;this._readyPromise=new Promise((r,s)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):r(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=si._defaultMaxTerrainHeight,this._minTerrainHeight=si._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let o=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:o,_extruded:!0,_uniformMap:u1e}}Object.defineProperties(Yc.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});Yc.isSupported=bS.isSupported;function V$(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function z$(e){return function(t,n){return e._minHeight}}var f1e=new m,d1e=new m,m1e=new m,h1e=new me,p1e=new ce;function EM(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=m.unpack(i,d,f1e),g=m.unpack(o,d,d1e),h=m.add(p,g,m1e),x=n.cartesianToCartographic(h,h1e),b=x.latitude,C=x.longitude;s=Math.min(s,b),a=Math.min(a,C),c=Math.max(c,b),u=Math.max(u,C)}let f=p1e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function _1e(e,t,n){let i=si.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function g1e(e,t,n){let i=t.mapProjection.ellipsoid,o=EM(t,n),r=Nn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function V8(e,t){return Math.floor(e%t/2)}function z8(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function H$(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function y1e(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Hn.CESIUM_3D_TILE,d=u!==Hn.TERRAIN,p=t.passes,g=e._primitive,h,x,b;if(p.render){let C=n.length;for(h=0;h<C;++h)x=c[V8(h,C)],f&&(b=n[h],z8(e,b,t,o,r,x,s)),d&&(b=n[h].derivedCommands.tileset,z8(e,b,t,o,r,x,s));if(t.invertClassification){let T=g._commandsIgnoreShow,A=T.length;for(h=0;h<A;++h)x=c[h],b=T[h],z8(e,b,t,o,r,x,s)}}if(p.pick){let C=i.length,T;for(e._useFragmentCulling||(T=g._primitive._pickOffsets),h=0;h<C;++h){if(x=c[V8(h,C)],!e._useFragmentCulling){let A=T[V8(h,C)];x=c[A.index]}f&&(b=i[h],H$(e,b,t,o,r,x)),d&&(b=i[h].derivedCommands.tileset,H$(e,b,t,o,r,x))}}}Yc.initializeTerrainHeights=function(){return si.initialize()};Yc.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!si.initialized){Yc.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){o=a[f],r=o.geometry;let x=EM(e,r);l(d)?l(x)&&ce.union(d,x,d):d=ce.clone(x);let b=o.id;if(l(b)&&l(x)){let C=si.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(C)}s=r.constructor,!l(s)||l(s.createShadowVolume)}_1e(this,d,i);let p=e.terrainExaggeration,g=e.terrainExaggerationRelativeHeight;this._minHeight=jc.getHeight(this._minTerrainHeight,p,g),this._maxHeight=jc.getHeight(this._maxTerrainHeight,p,g);let h=Yc._supportsMaterials(e.context);if(this._useFragmentCulling=h,h){let x,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,d=EM(e,r),Mu.shouldUseSphericalCoordinates(d)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let C=EM(e,r),T=r.textureCoordinateRotationPoints;b?x=Mu.getPlanarTextureCoordinateAttributes(C,T,i,e.mapProjection,this._maxHeight):x=Mu.getSphericalExtentGeometryInstanceAttributes(C,T,i,e.mapProjection);let A=o.attributes;for(let S in A)A.hasOwnProperty(S)&&(x[S]=A[S]);u[f]=new Tt({geometry:s.createShadowVolume(r,z$(this),V$(this)),attributes:x,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new Tt({geometry:s.createShadowVolume(r,z$(this),V$(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){g1e(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,C,T,A,S,v,I){y1e(t,b,C,T,A,S,v,I)},this._primitive=new bS(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};Yc.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Yc.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Yc._supportsMaterials=function(e){return e.depthTexture};Yc.supportsMaterials=function(e){return Yc._supportsMaterials(e.frameState.context)};var Xc=Yc;function iC(){fe.throwInstantiationError()}Object.defineProperties(iC.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});iC.prototype.getType=fe.throwInstantiationError;iC.prototype.getValue=fe.throwInstantiationError;iC.prototype.equals=fe.throwInstantiationError;iC.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=qi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==qi.ColorType)&&(n=qi.fromType(qi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var tr=iC;function a0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}a0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};a0.prototype._setOptions=fe.throwInstantiationError;a0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Vt,d,p=t._getIsClosed(c);if(f)d=new cn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=tr.getValue(e,u,this._material);this._material=g,d=new co({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=cn.VERTEX_FORMAT,this._primitive=o.add(new Xc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Dn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Dn({geometryInstances:u,appearance:new cn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};a0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ci=a0;var x1e={NONE:0,GEODESIC:1,RHUMB:2},Qt=Object.freeze(x1e);var G$=P.EPSILON10;function b1e(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<r;++s)c=e[s],t(a,c,G$)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(d=i.length)),a=c);return n&&t(e[0],e[r-1],G$)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Ao=b1e;function C1e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),d=c*s,p=d*d,g=1-p,h=Math.sqrt(g),x=t/4,b=x*x,C=b*x,T=b*b,A=1+x-3*b/4+5*C/4-175*T/64,S=1-x+15*b/8-35*C/8,v=1-3*x+35*b/4,I=1-5*x,O=A*f-S*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-I*Math.sin(6*f)*C/48-Math.sin(8*f)*5*T/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=h,R.u2Over4=x,R.u4Over16=b,R.u6Over64=C,R.u8Over256=T,R.a0=A,R.a1=S,R.a2=v,R.a3=I,R.distanceRatio=O}function T1e(e,t){return e*t*(4+e*(4-3*t))/16}function W$(e,t,n,i,o,r,s){let a=T1e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function A1e(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),h=Math.sin(f),x=d*g,b=d*h,C=p*h,T=p*g,A=c,S=P.TWO_PI,v=Math.cos(A),I=Math.sin(A),O,R,N,F,_;do{v=Math.cos(A),I=Math.sin(A);let k=b-T*v;N=Math.sqrt(g*g*I*I+k*k),R=C+x*v,O=Math.atan2(N,R);let Y;N===0?(Y=0,F=1):(Y=x*I/N,F=1-Y*Y),S=A,_=R-2*C/F,isFinite(_)||(_=0),A=c+W$(a,Y,F,O,N,R,_)}while(Math.abs(A-S)>P.EPSILON12);let E=F*(t*t-n*n)/(n*n),w=1+E*(4096+E*(E*(320-175*E)-768))/16384,D=E*(256+E*(E*(74-47*E)-128))/1024,M=_*_,B=D*N*(_+D*(R*(2*M-1)-D*_*(4*N*N-3)*(4*M-3)/6)/4),V=n*w*(O-B),U=Math.atan2(g*I,b-T*v),G=Math.atan2(d*I,b*v-T);e._distance=V,e._startHeading=U,e._endHeading=G,e._uSquared=E}var E1e=new m,H8=new m;function j$(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,H8),E1e),r=m.normalize(i.cartographicToCartesian(n,H8),H8);A1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,C1e(e)}function CS(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&j$(this,e,t,i)}Object.defineProperties(CS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});CS.prototype.setEndPoints=function(e,t){j$(this,e,t,this._ellipsoid)};CS.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};CS.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,x=n.u6Over64,b=n.u4Over16,C=2*p*g*o/3+i*(1-h+7*b/4-15*x/4+579*g/64-(b-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(h/2-b+71*x/32-85*g/16)*a+(5*b/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),v=Math.sin(C),I=Math.cos(C),O=n.cosineU*I,R=n.sineU*v,F=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-W$(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,v,I,S);return l(t)?(t.longitude=this._start.longitude+F,t.latitude=A,t.height=0,t):new me(this._start.longitude+F,A,0)};var zf=CS;function W8(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*x)}function S1e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),A=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),I=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*A+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*R}function oC(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function v1e(e,t,n,i,o){let r=oC(e._ellipticity,n),s=oC(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function w1e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=W8(e._ellipticity,t,o);u=(W8(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var I1e=new m,G8=new m;function q$(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,G8),I1e),r=m.normalize(i.cartographicToCartesian(n,G8),G8),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=v1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=w1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Y$(e,t,n,i,o,r){if(n===0)return me.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=W8(o,i,e.latitude),d=n*Math.cos(t),p=f+d;c=S1e(p,o,i);let g=oC(o,e.latitude),h=oC(o,c);u=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new me(a,c,0)}function kh(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&q$(this,e,t,i)}Object.defineProperties(kh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});kh.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,oe.WGS84),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Y$(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new kh(e,d,r):(o.setEndPoints(e,d),o)};kh.prototype.setEndPoints=function(e,t){q$(this,e,t,this._ellipsoid)};kh.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};kh.prototype.interpolateUsingSurfaceDistance=function(e,t){return Y$(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};kh.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new me),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};kh.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=oC(n,o.latitude),s=oC(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var Na=kh;var $8=[Di,Oi],D1e=$8.length,mQ=Math.cos(P.toRadians(30)),X$=Math.cos(P.toRadians(150)),hQ=0,pQ=1e3;function A_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Qt.GEODESIC),this._ellipsoid=oe.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(A_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+oe.packedLength+1+1}}});A_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<D1e;i++)if(t instanceof $8[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var P1e=new m,K$=new m,J$=new m;function Z8(e,t,n,i,o){let r=pc(i,e,0,P1e),s=pc(i,e,n,K$),a=pc(i,t,0,J$),c=Uh(s,r,K$),u=Uh(a,r,J$);return m.cross(u,c,o),m.normalize(o,o)}var O1e=new me,R1e=new m,M1e=new m,L1e=new m;function j8(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let d;r===Qt.GEODESIC?d=new zf(e,t,s):r===Qt.RHUMB&&(d=new Na(e,t,s));let p=d.surfaceDistance;if(p<o)return;let g=Z8(e,t,i,s,L1e),h=Math.ceil(p/o),x=p/h,b=x,C=h-1,T=a.length;for(let A=0;A<C;A++){let S=d.interpolateUsingSurfaceDistance(b,O1e),v=pc(s,S,n,R1e),I=pc(s,S,i,M1e);m.pack(g,a,T),m.pack(v,c,T),m.pack(I,u,T),f.push(S.latitude),f.push(S.longitude),T+=3,b+=x}}var q8=new me;function pc(e,t,n,i){return me.clone(t,q8),q8.height=n,me.toCartesian(q8,e,i)}A_.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,oe.pack(e._ellipsoid,t,i),i+=oe.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};A_.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=oe.unpack(e,i);i+=oe.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new A_({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function Uh(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function Z$(e,t,n,i){return i=Uh(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var N1e=new m,F1e=new m,B1e=new m,_Q=new m,k1e=0,U1e=-1;function Y8(e,t,n,i,o){let r=Uh(n,t,_Q),s=Z$(e,t,r,N1e),a=Z$(i,t,r,F1e);if(P.equalsEpsilon(m.dot(s,a),U1e,P.EPSILON5))return o=m.cross(r,s,o),o=m.normalize(o,o),o;o=m.add(a,s,o),o=m.normalize(o,o);let c=m.cross(r,o,B1e);return m.dot(a,c)<k1e&&(o=m.negate(o,o)),o}var IM=dn.fromPointNormal(m.ZERO,m.UNIT_Y),V1e=new m,z1e=new m,H1e=new m,G1e=new m,W1e=new m,SM=new m,vM=new me,$$=new me,Q$=new me;A_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new $8[e._projectionIndex](i),a=hQ,c=pQ,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,h,x,b,C=new Na(void 0,void 0,i),T,A,S,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],h=d[f+1],T=$i.lineSegmentPlane(g,h,IM,SM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===Qt.GEODESIC?v.push(m.clone(T)):e.arcType===Qt.RHUMB&&(S=i.cartesianToCartographic(T,vM).longitude,x=i.cartesianToCartographic(g,vM),b=i.cartesianToCartographic(h,$$),C.setEndPoints(x,b),A=C.findIntersectionWithLongitude(S,Q$),T=i.cartographicToCartesian(A,SM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&v.push(m.clone(T)))),v.push(h);n&&(g=d[p-1],h=d[0],T=$i.lineSegmentPlane(g,h,IM,SM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&(e.arcType===Qt.GEODESIC?v.push(m.clone(T)):e.arcType===Qt.RHUMB&&(S=i.cartesianToCartographic(T,vM).longitude,x=i.cartesianToCartographic(g,vM),b=i.cartesianToCartographic(h,$$),C.setEndPoints(x,b),A=C.findIntersectionWithLongitude(S,Q$),T=i.cartographicToCartesian(A,SM),l(T)&&!m.equalsEpsilon(T,g,P.EPSILON7)&&!m.equalsEpsilon(T,h,P.EPSILON7)&&v.push(m.clone(T)))));let I=v.length,O=new Array(I);for(f=0;f<I;f++){let j=me.fromCartesian(v[f],i);j.height=0,O[f]=j}if(O=Ao(O,me.equalsEpsilon),I=O.length,I<2)return;let R=[],N=[],F=[],_=[],E=V1e,w=z1e,D=H1e,M=G1e,B=W1e,V=O[0],U=O[1],G=O[I-1];for(E=pc(i,G,a,E),M=pc(i,U,a,M),w=pc(i,V,a,w),D=pc(i,V,c,D),n?B=Y8(E,w,D,M,B):B=Z8(V,U,c,i,B),m.pack(B,N,0),m.pack(w,F,0),m.pack(D,_,0),R.push(V.latitude),R.push(V.longitude),j8(V,U,a,c,o,r,i,N,F,_,R),f=1;f<I-1;++f){E=m.clone(w,E),w=m.clone(M,w);let j=O[f];pc(i,j,c,D),pc(i,O[f+1],a,M),Y8(E,w,D,M,B),u=N.length,m.pack(B,N,u),m.pack(w,F,u),m.pack(D,_,u),R.push(j.latitude),R.push(j.longitude),j8(O[f],O[f+1],a,c,o,r,i,N,F,_,R)}let k=O[I-1],Y=O[I-2];if(w=pc(i,k,a,w),D=pc(i,k,c,D),n){let j=O[0];E=pc(i,Y,a,E),M=pc(i,j,a,M),B=Y8(E,w,D,M,B)}else B=Z8(Y,k,c,i,B);if(u=N.length,m.pack(B,N,u),m.pack(w,F,u),m.pack(D,_,u),R.push(k.latitude),R.push(k.longitude),n){for(j8(k,V,a,c,o,r,i,N,F,_,R),u=N.length,f=0;f<3;++f)N[u+f]=N[f],F[u+f]=F[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return _De(n,s,F,_,N,R,t)};var j1e=new m,q1e=new Z,Y1e=new Be;function eQ(e,t,n,i){let o=Uh(n,t,j1e),r=m.dot(o,e);if(r>mQ||r<X$){let s=Uh(i,n,_Q),a=r<X$?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Be.fromAxisAngle(s,a,Y1e),u=Z.fromQuaternion(c,q1e);return Z.multiplyByVector(u,e,e),!0}return!1}var tQ=new me,X1e=new m,nQ=new m;function TS(e,t,n,i,o){let r=me.toCartesian(t,e._ellipsoid,X1e),s=m.add(r,n,nQ),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,tQ);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,nQ),u=c.cartesianToCartographic(s,tQ)),u.height=0;let f=e.project(u,o);return o=m.subtract(f,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var K1e=new m,iQ=new m;function oQ(e,t,n,i,o,r){let s=m.subtract(t,e,K1e);m.normalize(s,s);let a=n-hQ,c=m.multiplyByScalar(s,a,iQ);m.add(e,c,o);let u=i-pQ;c=m.multiplyByScalar(s,u,iQ),m.add(t,c,r)}var J1e=new m;function wM(e,t){let n=dn.getPointDistance(IM,e),i=dn.getPointDistance(IM,t),o=J1e;P.equalsEpsilon(n,0,P.EPSILON2)?(o=Uh(t,e,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=Uh(e,t,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(t,o,t))}function Z1e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var gQ=new me,yQ=new me,rQ=new m,X8=new m,sQ=new m,aQ=new m,$1e=new m,cQ=new m,Q1e=[gQ,yQ],eDe=new ce,tDe=new m,nDe=new m,iDe=new m,oDe=new m,rDe=new m,sDe=new m,K8=new m,J8=new m,aDe=new m,cDe=new m,lDe=new m,lQ=new m,uDe=new m,fDe=new m,dDe=new qn,mDe=new qn,uQ=new m,hDe=new m,fQ=new m,pDe=[new ae,new ae],xQ=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],dQ=xQ.length;function _De(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),b=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),A=new Float32Array(p),S=new Float32Array(p),v,I,O,R;s&&(v=new Float32Array(p),I=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(d*2));let N=r.length/2,F=0,_=gQ;_.height=0;let E=yQ;E.height=0;let w=rQ,D=X8;if(s)for(c=0,a=1;a<N;a++)_.latitude=r[c],_.longitude=r[c+1],E.latitude=r[c+2],E.longitude=r[c+3],w=t.project(_,w),D=t.project(E,D),F+=m.distance(w,D),c+=2;let M=i.length/3;D=m.unpack(i,0,D);let B=0;for(c=3,a=1;a<M;a++)w=m.clone(D,w),D=m.unpack(i,c,D),B+=m.distance(w,D),c+=3;let V;c=3;let U=0,G=0,k=0,Y=0,j=!1,$=m.unpack(n,0,aQ),W=m.unpack(i,0,X8),K=m.unpack(o,0,cQ);if(e){let Se=m.unpack(n,n.length-6,sQ);eQ(K,Se,$,W)&&(K=m.negate(K,K))}let J=0,he=0,ge=0;for(a=0;a<f;a++){let Se=m.clone($,sQ),we=m.clone(W,rQ),ze=m.clone(K,$1e);j&&(ze=m.negate(ze,ze)),$=m.unpack(n,c,aQ),W=m.unpack(i,c,X8),K=m.unpack(o,c,cQ),j=eQ(K,Se,$,W),_.latitude=r[U],_.longitude=r[U+1],E.latitude=r[U+2],E.longitude=r[U+3];let Oe,ft,Ct,ot;if(s){let zi=Z1e(_,E);Oe=t.project(_,rDe),ft=t.project(E,sDe);let ts=Uh(ft,Oe,uQ);ts.y=Math.abs(ts.y),Ct=K8,ot=J8,zi===0||m.dot(ts,m.UNIT_Y)>mQ?(Ct=TS(t,_,ze,Oe,K8),ot=TS(t,E,K,ft,J8)):zi===1?(ot=TS(t,E,K,ft,J8),Ct.x=0,Ct.y=P.sign(_.longitude-Math.abs(E.longitude)),Ct.z=0):(Ct=TS(t,_,ze,Oe,K8),ot.x=0,ot.y=P.sign(_.longitude-E.longitude),ot.z=0)}let sn=m.distance(we,W),wn=qn.fromCartesian(Se,dDe),zt=m.subtract($,Se,aDe),Bt=m.normalize(zt,lQ),be=m.subtract(we,Se,cDe);be=m.normalize(be,be);let Ee=m.cross(Bt,be,lQ);Ee=m.normalize(Ee,Ee);let at=m.cross(be,ze,uDe);at=m.normalize(at,at);let Jt=m.subtract(W,$,lDe);Jt=m.normalize(Jt,Jt);let ri=m.cross(K,Jt,fDe);ri=m.normalize(ri,ri);let Ze=sn/B,zr=J/B,Hr=0,sa,$r,Ne,rt=0,$e=0;if(s){Hr=m.distance(Oe,ft),sa=qn.fromCartesian(Oe,mDe),$r=m.subtract(ft,Oe,uQ),Ne=m.normalize($r,hDe);let zi=Ne.x;Ne.x=Ne.y,Ne.y=-zi,rt=Hr/F,$e=he/F}for(V=0;V<8;V++){let zi=Y+V*4,ts=G+V*2,Wn=zi+3,Fn=V<4?1:-1,fn=V===2||V===3||V===6||V===7?1:-1;m.pack(wn.high,b,zi),b[Wn]=zt.x,m.pack(wn.low,C,zi),C[Wn]=zt.y,m.pack(at,T,zi),T[Wn]=zt.z,m.pack(ri,A,zi),A[Wn]=Ze*Fn,m.pack(Ee,S,zi);let pi=zr*fn;pi===0&&fn<0&&(pi=9),S[Wn]=pi,s&&(v[zi]=sa.high.x,v[zi+1]=sa.high.y,v[zi+2]=sa.low.x,v[zi+3]=sa.low.y,O[zi]=-Ct.y,O[zi+1]=Ct.x,O[zi+2]=ot.y,O[zi+3]=-ot.x,I[zi]=$r.x,I[zi+1]=$r.y,I[zi+2]=Ne.x,I[zi+3]=Ne.y,R[ts]=rt*Fn,pi=$e*fn,pi===0&&fn<0&&(pi=9),R[ts+1]=pi)}let He=iDe,mt=oDe,Ut=tDe,xn=nDe,Zn=ce.fromCartographicArray(Q1e,eDe),To=si.getMinimumMaximumHeights(Zn,u),Qr=To.minimumTerrainHeight,es=To.maximumTerrainHeight;ge+=Qr,ge+=es,oQ(Se,we,Qr,es,He,Ut),oQ($,W,Qr,es,mt,xn);let ar=m.multiplyByScalar(Ee,P.EPSILON5,fQ);m.add(He,ar,He),m.add(mt,ar,mt),m.add(Ut,ar,Ut),m.add(xn,ar,xn),wM(He,mt),wM(Ut,xn),m.pack(He,x,k),m.pack(mt,x,k+3),m.pack(xn,x,k+6),m.pack(Ut,x,k+9),ar=m.multiplyByScalar(Ee,-2*P.EPSILON5,fQ),m.add(He,ar,He),m.add(mt,ar,mt),m.add(Ut,ar,Ut),m.add(xn,ar,xn),wM(He,mt),wM(Ut,xn),m.pack(He,x,k+12),m.pack(mt,x,k+15),m.pack(xn,x,k+18),m.pack(Ut,x,k+21),U+=2,c+=3,G+=16,k+=24,Y+=32,J+=sn,he+=Hr}c=0;let se=0;for(a=0;a<f;a++){for(V=0;V<dQ;V++)h[c+V]=xQ[V]+se;se+=8,c+=dQ}let pe=pDe;ae.fromVertices(n,m.ZERO,3,pe[0]),ae.fromVertices(i,m.ZERO,3,pe[1]);let xe=ae.fromBoundingSpheres(pe);xe.radius+=ge/(f*2);let De={position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:T_(b),startLoAndForwardOffsetY:T_(C),startNormalAndForwardOffsetZ:T_(T),endNormalAndTextureCoordinateNormalizationX:T_(A),rightNormalAndTextureCoordinateNormalizationY:T_(S)};return s&&(De.startHiLo2D=T_(v),De.offsetAndRight2D=T_(I),De.startEndNormals2D=T_(O),De.texcoordNormalization2D=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new dt({attributes:De,indices:h,boundingSphere:xe})}function T_(e){return new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}A_._projectNormal=TS;var rC=A_;var DM=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; // Technically can compute distance for this here +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; -vec2 intersectUnitCircle(Ray ray) { - vec3 o = ray.pos; - vec3 d = ray.dir; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif - float t = -o.z / d.z; - vec2 zPlanePos = o.xy + d.xy * t; - float distSqr = dot(zPlanePos, zPlanePos); +void main(void) +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); - if (distSqr > 1.0) { - return vec2(NO_HIT); + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } - return vec2(t, t); -} + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; -vec2 intersectInfiniteUnitCylinder(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - float a = dot(d.xy, d.xy); - float b = dot(o.xy, d.xy); - float c = dot(o.xy, o.xy) - 1.0; - float det = b * b - a * c; + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - if (det < 0.0) { - return vec2(NO_HIT); + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - - return vec2(tmin, tmax); -} + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. -void intersectShape(Ray ray, inout Intersections ix) -{ - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) - ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; - ray.dir *= u_cylinderUvToRenderBoundsScale; - #else - // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. - // Direction is scaled as well to be in sync with position. - ray.pos = ray.pos * 2.0 - 1.0; - ray.dir *= 2.0; - #endif + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; - #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - vec2 outerIntersect = intersectUnitCircle(ray); - #else - vec2 outerIntersect = intersectUnitCylinder(ray); - #endif + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); - if (outerIntersect.x == NO_HIT) { - return; - } +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); - #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) - // When the cylinder is perfectly thin it's necessary to sandwich the - // inner cylinder intersection inside the outer cylinder intersection. + czm_materialInput materialInput; - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the cylinder to be invisible because it will think the ray - // is still inside the inner (negative) cylinder after exiting the - // outer (positive) cylinder. + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) - Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); - vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); - #endif + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; - #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); - #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); - #endif + czm_writeDepthClamp(); } -`;var _V=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, -// setIntersection, setIntersectionPair, INF_HIT, NO_HIT - -/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX -#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX -#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN -*/ +`;var PM=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidRenderLongitudeMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) - uniform float u_ellipsoidInverseOuterScaleUv; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - uniform float u_ellipsoidInverseInnerScaleUv; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; #endif -vec2 intersectZPlane(Ray ray) +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) { - float o = ray.pos.z; - float d = ray.dir.z; - float t = -o / d; - float s = sign(o); + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); -} +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); -vec4 intersectHalfPlane(Ray ray, float angle) { - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 planeDirection = vec2(cos(angle), sin(angle)); - vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); - float a = dot(o, planeNormal); - float b = dot(d, planeNormal); - float t = -a / b; + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; - vec2 p = o + t * d; - bool outside = dot(p, planeDirection) < 0.0; - if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + czm_materialInput materialInput; - return vec4(-INF_HIT, t, t, +INF_HIT); + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR } +`;var OM=`in vec3 position3DHigh; +in vec3 position3DLow; -vec2 intersectHalfSpace(Ray ray, float angle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n = vec2(sin(angle), -cos(angle)); +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; - float a = dot(o, n); - float b = dot(d, n); - float t = -a / b; - float s = sign(a); +in float batchId; - if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); - else return vec2(-INF_HIT, t); -} +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; -vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 o = ray.pos.xy; - vec2 d = ray.dir.xy; - vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); - vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif - float a1 = dot(o, n1); - float a2 = dot(o, n2); - float b1 = dot(d, n1); - float b2 = dot(d, n2); +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif - float t1 = -a1 / b1; - float t2 = -a2 / b2; - float s1 = sign(a1); - float s2 = sign(a2); +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. +void main() +{ + v_batchId = batchId; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - float smin = tmin == t1 ? s1 : s2; - float smax = tmin == t1 ? s2 : s1; + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - bool e = tmin >= 0.0; - bool f = tmax >= 0.0; - bool g = smin >= 0.0; - bool h = smax >= 0.0; + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); - if (e != g && f == h) return vec2(tmin, tmax); - else if (e == g && f == h) return vec2(-INF_HIT, tmin); - else if (e != g && f != h) return vec2(tmax, +INF_HIT); - else return vec2(NO_HIT); -} + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); -vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) -{ - vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); - vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); - return vec4(planeIntersectMin, planeIntersectMax); -} + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); -vec2 intersectUnitSphere(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - c; + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); - if (det < 0.0) { - return vec2(NO_HIT); - } + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - det = sqrt(det); - float t1 = -b - det; - float t2 = -b + det; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - return vec2(tmin, tmax); -} +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates -vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR - float a = dot(d, d); - float b = dot(d, o); - float c = dot(o, o) - 1.0; - float det = b * b - a * c; +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif - if (det < 0.0) { - return vec2(NO_HIT); - } + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - return vec2(tmin, tmax); -} + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; -vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) -{ - vec3 o = ray.pos; - vec3 d = ray.dir; - float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; - float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; - float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; - float det = b * b - a * c; + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - if (det < 0.0) { - return vec2(NO_HIT); - } + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - det = sqrt(det); - float t1 = (-b - det) / a; - float t2 = (-b + det) / a; - float tmin = min(t1, t2); - float tmax = max(t1, t2); - return vec2(tmin, tmax); -} + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; -vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif - if (intersect.x == NO_HIT) { - return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - } + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - // One interval - if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); - else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); - else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); - // Two intervals - else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } +`;var RM=`in vec3 position3DHigh; +in vec3 position3DLow; -vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { - vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif - if (intersect.x == NO_HIT) { - return vec2(NO_HIT); - } +in float batchId; - vec3 o = ray.pos; - vec3 d = ray.dir; - float tmin = intersect.x; - float tmax = intersect.y; - float zmin = o.z + tmin * d.z; - float zmax = o.z + tmax * d.z; +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; - if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); - else if (zmin < 0.0) return vec2(tmax, +INF_HIT); - else if (zmax < 0.0) return vec2(-INF_HIT, tmin); - else return vec2(tmin, tmax); -} +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif -void intersectShape(in Ray ray, inout Intersections ix) { - // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. - // Direction is scaled as well to be in sync with position. - ray.pos = ray.pos * 2.0 - 1.0; - ray.dir *= 2.0; +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) - Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); - #else - Ray outerRay = ray; - #endif +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - // Outer ellipsoid - vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); - // Exit early if the outer ellipsoid was missed. - if (outerIntersect.x == NO_HIT) { - return; - } + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - // Inner ellipsoid - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) - // When the ellipsoid is perfectly thin it's necessary to sandwich the - // inner ellipsoid intersection inside the outer ellipsoid intersection. + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - // Without this special case, - // [outerMin, outerMax, innerMin, innerMax] will bubble sort to - // [outerMin, innerMin, outerMax, innerMax] which will cause the back - // side of the ellipsoid to be invisible because it will think the ray - // is still inside the inner (negative) ellipsoid after exiting the - // outer (positive) ellipsoid. + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - // With this special case, - // [outerMin, innerMin, innerMax, outerMax] will bubble sort to - // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - // Note: If initializeIntersections() changes its sorting function - // from bubble sort to something else, this code may need to change. - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) - Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); - vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; - if (innerIntersect == vec2(NO_HIT)) { - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); - } else { - // When the ellipsoid is very large and thin it's possible for floating - // point math to cause the ray to intersect the inner ellipsoid before - // the outer ellipsoid. To prevent this from happening, clamp innerIntersect - // to outerIntersect and sandwhich the intersections like described above. - // - // In theory a similar fix is needed for cylinders, however it's more - // complicated to implement because the inner shape is allowed to be - // intersected first. - innerIntersect.x = max(innerIntersect.x, outerIntersect.x); - innerIntersect.y = min(innerIntersect.y, outerIntersect.y); - setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter - setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter - setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit - setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit - } - #endif + vec3 forwardDirectionEC = normalize(offset); - // Flip the ray because the intersection function expects a cone growing towards +Z. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - Ray flippedRay = outerRay; - flippedRay.dir.z *= -1.0; - flippedRay.pos.z *= -1.0; - #endif + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - // Bottom cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) - vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) - vec2 bottomConeIntersection = intersectZPlane(flippedRay); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) - vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); - #endif + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - // Top cone - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) - vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) - vec2 topConeIntersection = intersectZPlane(ray); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) - vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); - #endif + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - // Wedge - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) - vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) - vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); - #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) - vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); - setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); - #endif -} -`;var eb=`// Main intersection function for Voxel scenes. -// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl -// for the definition of intersectShape. The appropriate function is selected -// based on the VoxelPrimitive shape type, and added to the shader in -// Scene/VoxelRenderResources.js. -// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. -// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, -// getFirstIntersection, initializeIntersections, nextIntersection. + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; -/* Intersection defines (set in Scene/VoxelRenderResources.js) -#define INTERSECTION_COUNT ### -*/ +#endif // COLUMBUS_VIEW_2D -RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { - // Do a ray-shape intersection to find the exact starting and ending points. - intersectShape(ray, ix); + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - // Exit early if the positive shape was completely missed or behind the ray. - RayShapeIntersection intersection = getFirstIntersection(ix); - if (intersection.entry.w == NO_HIT) { - // Positive shape was completely missed - so exit early. - return intersection; - } +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR - // Clipping planes - #if defined(CLIPPING_PLANES) - intersectClippingPlanes(ray, ix); - #endif + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); - // Depth - #if defined(DEPTH_TEST) - intersectDepth(screenCoord, ray, ix); - #endif + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - // Find the first intersection that's in front of the ray - #if (INTERSECTION_COUNT > 1) - initializeIntersections(ix); - for (int i = 0; i < INTERSECTION_COUNT; ++i) { - intersection = nextIntersection(ix); - if (intersection.exit.w > 0.0) { - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - break; - } - } - #else - // Set start to 0.0 when ray is inside the shape. - intersection.entry.w = max(intersection.entry.w, 0.0); - #endif + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; - return intersection; -} -`;var gV=`/* Box defines (set in Scene/VoxelBoxShape.js) -#define BOX_HAS_SHAPE_BOUNDS -*/ + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); -#if defined(BOX_HAS_SHAPE_BOUNDS) - uniform vec3 u_boxUvToShapeUvScale; - uniform vec3 u_boxUvToShapeUvTranslate; + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; #endif -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; + + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; + + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N + + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); #else - return positionUv; + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); #endif -} -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) - return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else - return shapeUv; + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var yV=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS -#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT -#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY -#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED -*/ +`;var MM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - uniform vec2 u_cylinderShapeUvAngleMinMax; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - uniform float u_cylinderShapeUvAngleRangeZeroMid; -#endif +out vec4 v_color; -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - // Compute radius - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) - float radius = 1.0; - #else - float radius = length(positionLocal.xy); // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) - radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset - #endif - #endif + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); - // Compute height - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - float height = 1.0; - #else - float height = positionUv.z; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) - height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset - #endif - #endif + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; - // Compute angle - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) - float angle = 1.0; - #else - float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) - // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. - angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); - #endif + v_color = color; +} +`;var Lu=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) - angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; - #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) - angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; - #endif + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); - angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset - #endif - #endif + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; - return vec3(radius, height, angle); -} -`;var AV=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY -#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE -#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN -#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT -#define ELLIPSOID_IS_SPHERE -*/ + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. -uniform vec3 u_ellipsoidRadiiUv; // [0,1] -#if !defined(ELLIPSOID_IS_SPHERE) - uniform vec3 u_ellipsoidInverseRadiiSquaredUv; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - uniform float u_ellipsoidInverseHeightDifferenceUv; - uniform vec2 u_ellipseInnerRadiiUv; // [0,1] -#endif + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; -// robust iterative solution without trig functions -// https://github.com/0xfaded/ellipse_demo/issues/1 -// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse -// Pro: Good when radii.x ~= radii.y -// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse -// Con: Inaccurate with exterior points and thin ellipses -float ellipseDistanceIterative (vec2 pos, vec2 radii) { - vec2 p = abs(pos); - vec2 invRadii = 1.0 / radii; - vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; - vec2 t = vec2(0.70710678118); // sqrt(2) / 2 - vec2 v = radii * t; + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. - const int iterations = 3; - for (int i = 0; i < iterations; ++i) { - vec2 e = a * pow(t, vec2(3.0)); - vec2 q = normalize(p - e) * length(v - e); - t = normalize((q + e) * invRadii); - v = radii * t; + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; + + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; + } } - return length(v * sign(pos) - pos) * sign(p.y - v.y); -} -vec3 convertUvToShapeUvSpace(in vec3 positionUv) { - // Compute position and normal. - // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). - // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. - vec3 positionLocal = positionUv * 2.0 - 1.0; - #if defined(ELLIPSOID_IS_SPHERE) - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; - vec3 normal = normalize(posEllipsoid); - #else - vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; - vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal - #endif + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); +} - // Compute longitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) - float longitude = 1.0; - #else - float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - // Correct the angle when max < min - // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) - longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); - #endif +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) - longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; - #endif - #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) - longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; - #endif + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) - longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; - #endif - #endif + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif - // Compute latitude - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) - float latitude = 1.0; - #else - float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) - latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; - #endif - #endif + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - // Compute height - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) - // TODO: This breaks down when minBounds == maxBounds. To fix it, this - // function would have to know if ray is intersecting the front or back of the shape - // and set the shape space position to 1 (front) or 0 (back) accordingly. - float height = 1.0; - #else - #if defined(ELLIPSOID_IS_SPHERE) - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; - #else - float height = length(posEllipsoid); - #endif - #else - #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) - // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). - // This is an optimization so that math can be done with ellipses instead of ellipsoids. - vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); - float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; - #else - // TODO: this is probably not correct - float height = length(posEllipsoid); - #endif - #endif - #endif + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - return vec3(longitude, latitude, height); -} -`;var xV=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js -#define OCTREE_FLAG_INTERNAL 0 -#define OCTREE_FLAG_LEAF 1 -#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); -#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } -uniform sampler2D u_octreeInternalNodeTexture; -uniform vec2 u_octreeInternalNodeTexelSizeUv; -uniform int u_octreeInternalNodeTilesPerRow; -#if (SAMPLE_COUNT > 1) -uniform sampler2D u_octreeLeafNodeTexture; -uniform vec2 u_octreeLeafNodeTexelSizeUv; -uniform int u_octreeLeafNodeTilesPerRow; -#endif + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); -struct OctreeNodeData { - int data; - int flag; -}; + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } -struct TraversalData { - ivec4 octreeCoords; - int parentOctreeIndex; -}; + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } -struct SampleData { - int megatextureIndex; - ivec4 tileCoords; - vec3 tileUv; - #if (SAMPLE_COUNT > 1) - float weight; - #endif -}; + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); -// Integer mod: For WebGL1 only -int intMod(in int a, in int b) { - return a - (b * (a / b)); -} -int normU8_toInt(in float value) { - return int(value * 255.0); -} -int normU8x2_toInt(in vec2 value) { - return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { - return float(normU8x2_toInt(value)) / 65535.0; -} + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { - vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - OctreeNodeData data; - data.data = normU8x2_toInt(texData.xy); - data.flag = normU8x2_toInt(texData.zw); - return data; -} + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { - int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; - int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; - int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - return getOctreeNodeData(octreeUv); -} + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + } -int getOctreeParentIndex(in int octreeIndex) { - int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; - int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; - vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); - vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); - int parentOctreeIndex = normU8x2_toInt(parentData.xy); - return parentOctreeIndex; + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } -/** -* Convert a position in the uv-space of the tileset bounding shape -* into the uv-space of a tile within the tileset -*/ -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { - // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) - float dimAtLevel = pow(2.0, float(octreeCoords.w)); - return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +{ + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); } +`;var Q8=`${Lu} +${MM}`,gDe=jb;Wt.isInternetExplorer()||(Q8=`#define CLIP_POLYLINE +${Q8}`);function c0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=c0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,Q8),this._fragmentShaderSource=y(e.fragmentShaderSource,gDe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(c0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});c0.VERTEX_FORMAT=Me.POSITION_ONLY;c0.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;c0.prototype.isTranslucent=io.prototype.isTranslucent;c0.prototype.getRenderState=io.prototype.getRenderState;var jr=c0;var LM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; -void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { - sampleData.megatextureIndex = data.data; - sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; -} +out float v_width; +out vec2 v_st; +out float v_polylineAngle; -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { - int leafIndex = data.data; - int leafNodeTexelCount = 2; - // Adding 0.5 moves to the center of the texel - float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; - float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - // Get an interpolation weight and a flag to determine whether to read the parent texture - vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); - vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); - float lerp = normU8x2_toFloat(leafData0.xy); - sampleDatas[0].weight = 1.0 - lerp; - sampleDatas[1].weight = lerp; - // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT - sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; - sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) - ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) - : octreeCoords; + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); - // Get megatexture indices for both samples - vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); - vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); - sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); - sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_width = width; + v_st.s = st.s; + v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); + v_polylineAngle = angle; } +`;var sC=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { - float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); - vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; - vec3 end = start + vec3(sizeAtLevel); - OctreeNodeData childData; - - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - // Find out which octree child contains the position - // 0 if before center, 1 if after - vec3 center = 0.5 * (start + end); - vec3 childCoord = step(center, shapePosition); +in vec2 v_st; - // Get octree coords for the next level down - ivec4 octreeCoords = traversalData.octreeCoords; - traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); +void main() +{ + czm_materialInput materialInput; - childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); + vec2 st = v_st; + st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - if (childData.flag != OCTREE_FLAG_INTERNAL) { - // leaf tile - stop traversing - break; - } + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = vec3(st, 0.0); - // interior tile - keep going deeper - start = mix(start, center, childCoord); - end = mix(center, end, childCoord); - traversalData.parentOctreeIndex = childData.data; - } + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE + out_FragColor *= u_highlightColor; +#endif - return childData; + czm_writeLogDepth(); } +`;var e5=`${Lu} +${LM}`,yDe=sC;Wt.isInternetExplorer()||(e5=`#define CLIP_POLYLINE +${e5}`);function l0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=l0.VERTEX_FORMAT;this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,e5),this._fragmentShaderSource=y(e.fragmentShaderSource,yDe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(l0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});l0.VERTEX_FORMAT=Me.POSITION_AND_ST;l0.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;l0.prototype.isTranslucent=io.prototype.isTranslucent;l0.prototype.getRenderState=io.prototype.getRenderState;var da=l0;function Vh(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new da),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Hn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,o)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=bQ(!1),this._renderState3DTiles=bQ(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Vh.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Vh.initializeTerrainHeights=function(){return si.initialize()};function xDe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(RM);s=Dn._appendShowToShader(o,s),s=Dn._appendDistanceDisplayConditionToShader(o,s),s=Dn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(OM);a=Dn._appendShowToShader(o,a),a=Dn._appendDistanceDisplayConditionToShader(o,a),a=Dn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(DM),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new We({defines:u,sources:[s]}),h=new We({defines:p,sources:[d,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new We({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let C=new We({defines:u.concat([`MAX_TERRAIN_HEIGHT ${si._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(PM);let T=new We({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=b}function bQ(e){return Ve.fromCache({cull:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function bDe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof jr?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=o[d];l(g)||(g=o[d]=new nt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ae.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let h=nt.shallowClone(g,g.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=h;let x=nt.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let b=nt.shallowClone(h,h.derivedCommands.color2D);b.shaderProgram=e._sp2D,h.derivedCommands.color2D=b;let C=nt.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function CQ(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function CDe(e,t,n,i,o,r,s){let a=e._primitive;Dn._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==Hn.CESIUM_3D_TILE,p=f!==Hn.TERRAIN&&!u,g,h=t.passes;if(h.render||h.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let C=c[b];d&&(g=n[b],CQ(e,g,t,o,r,C,s)),p&&(g=n[b].derivedCommands.tileset,CQ(e,g,t,o,r,C,s))}}}Vh.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!si.initialized){Vh.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new hc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,rC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Tt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){xDe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,h){bDe(n,u,f,d,g,h)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,h,x){CDe(n,u,f,d,p,g,h)},this._primitive=new Dn(i)}if(this.appearance instanceof jr&&!this._hasPerInstanceColors)throw new fe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};Vh.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Vh.isSupported=function(e){return e.frameState.context.depthTexture};Vh.prototype.isDestroyed=function(){return!1};Vh.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var cm=Vh;var TDe=new H(1,1),ADe=!1,EDe=z.WHITE;function aC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(aC.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});aC.prototype.getType=function(e){return"Image"};aC.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,TDe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,EDe,t.color),q.getValueOrDefault(this._transparent,e,ADe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};aC.prototype.equals=function(e){return this===e||e instanceof aC&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var u0=aC;function SDe(e){if(e instanceof z)return new Vt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new u0;return t.image=e,t}}function vDe(e,t){return le(e,t,SDe)}var Ro=vDe;function AS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(AS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});AS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new AS(this)};AS.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var cC=AS;var wDe={FIXED:0,INERTIAL:1},oo=Object.freeze(wDe);function lC(){fe.throwInstantiationError()}Object.defineProperties(lC.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});lC.prototype.getValue=fe.throwInstantiationError;lC.prototype.getValueInReferenceFrame=fe.throwInstantiationError;lC.prototype.equals=fe.throwInstantiationError;var t5=new Z;lC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Mt.computeIcrfToFixedMatrix(e,t5);if(l(r)||(r=Mt.computeTemeToPseudoFixedMatrix(e,t5)),n===oo.INERTIAL)return Z.multiplyByVector(r,t,o);if(n===oo.FIXED)return Z.multiplyByVector(Z.transpose(r,t5),t,o)};var E_=lC;function f0(e,t){this._definitionChanged=new _e,this._value=m.clone(e),this._referenceFrame=y(t,oo.FIXED)}Object.defineProperties(f0.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===oo.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});f0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};f0.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};f0.prototype.getValueInReferenceFrame=function(e,t,n){return E_.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};f0.prototype.equals=function(e){return this===e||e instanceof f0&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Kc=f0;function ES(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(ES.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});ES.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new ES(this)};ES.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var uC=ES;function IDe(e){return e}function DDe(e,t){return le(e,t,IDe)}var Ll=DDe;function SS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(SS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});SS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new SS(this)};SS.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var fC=SS;function vS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});vS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new vS(this)};vS.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var dC=vS;function wS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});wS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new wS(this)};wS.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var mC=wS;function IS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(IS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});IS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new IS(this)};IS.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var lm=IS;var PDe=new m(1,1,1),ODe=m.ZERO,RDe=Be.IDENTITY;function TQ(e,t,n){this.translation=m.clone(y(e,ODe)),this.rotation=Be.clone(y(t,RDe)),this.scale=m.clone(y(n,PDe))}TQ.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Be.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var d0=TQ;var n5=new d0;function DS(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(DS.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});DS.prototype.getValue=function(e,t){return l(t)||(t=new d0),t.translation=q.getValueOrClonedDefault(this._translation,e,n5.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,n5.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,n5.scale,t.scale),t};DS.prototype.equals=function(e){return this===e||e instanceof DS&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var hC=DS;function zh(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(zh.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});zh.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function MDe(e){return new ei(e)}zh.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,MDe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};zh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};zh.prototype.getValue=function(e,t){l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=q.getValueOrUndefined(this[r],e,t[r])}return t};zh.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function LDe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!q.equals(e[s],t[s]))return!1}return!0}zh.prototype.equals=function(e){return this===e||e instanceof zh&&LDe(this,e)};var Nl=zh;function AQ(e){return new hC(e)}function NDe(e){return new Nl(e,AQ)}function FDe(e){return new Nl(e)}function PS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(PS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,NDe),articulations:le("articulations",void 0,FDe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});PS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new PS(this)};PS.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Nl(t,AQ)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Nl(n)}};var S_=PS;function OS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(OS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});OS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new OS(this)};OS.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var pC=OS;function RS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(RS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Ro("material"),distanceDisplayCondition:le("distanceDisplayCondition")});RS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new RS(this)};RS.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var v_=RS;function MS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(MS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});MS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new MS(this)};MS.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var NM=MS;function LS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(LS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});LS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new LS(this)};LS.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var _C=LS;function BDe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Jc=BDe;function kDe(e){return Array.isArray(e)&&(e=new Jc(e)),new ei(e)}function NS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(NS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,kDe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});NS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new NS(this)};NS.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var um=NS;function FS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Ro("material"),depthFailMaterial:Ro("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});FS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new FS(this)};FS.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var _c=FS;function BS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(BS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});BS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new BS(this)};BS.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var gC=BS;function kS(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(kS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});kS.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new kS(this)};kS.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var fm=kS;function US(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(US.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});US.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new US(this)};US.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var w_=US;var UDe=new me;function VDe(e){return new Kc(e)}function zDe(e){return le(e,void 0,VDe)}function Bs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function dm(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function i5(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&i5(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(dm.prototype,{availability:Ll("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Ll("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&i5(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&i5(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Bs("billboard",sc),box:Bs("box",cC),corridor:Bs("corridor",uC),cylinder:Bs("cylinder",fC),description:le("description"),ellipse:Bs("ellipse",dC),ellipsoid:Bs("ellipsoid",mC),label:Bs("label",lm),model:Bs("model",S_),tileset:Bs("tileset",pC),orientation:le("orientation"),path:Bs("path",v_),plane:Bs("plane",NM),point:Bs("point",_C),polygon:Bs("polygon",um),polyline:Bs("polyline",_c),polylineVolume:Bs("polylineVolume",gC),properties:Bs("properties",Nl),position:zDe("position"),rectangle:Bs("rectangle",fm),viewFrom:le("viewFrom"),wall:Bs("wall",w_)});dm.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};dm.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Ll(e,!0))};dm.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};dm.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var EQ=new Z,SQ=new m,vQ=new Be;dm.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,SQ);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,vQ);return l(i)?t=L.fromRotationTranslation(Z.fromQuaternion(i,EQ),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};dm.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=q.getValueOrDefault(t,e,qe.NONE),s=q.getValueOrUndefined(this._position,e,SQ);if(r===qe.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,UDe);r===qe.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=q.getValueOrUndefined(this._orientation,e,vQ);return l(c)?o=L.fromRotationTranslation(Z.fromQuaternion(c,EQ),s,o):o=Mt.eastNorthUpToFixedFrame(s,void 0,o),o};dm.supportsMaterialsforEntitiesOnTerrain=function(e){return Xc.supportsMaterials(e)};dm.supportsPolylinesOnTerrain=function(e){return cm.isSupported(e)};var nr=dm;var HDe=new Vt(z.WHITE),GDe=new ei(!0),WDe=new ei(!0),jDe=new ei(!1),qDe=new ei(z.BLACK),YDe=new ei(Cn.DISABLED),XDe=new ei(new Dt),KDe=new ei(Hn.BOTH);function gc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=nr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(gc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});gc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};gc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};gc.prototype.createFillGeometryInstance=fe.throwInstantiationError;gc.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;gc.prototype.isDestroyed=function(){return!1};gc.prototype.destroy=function(){ue(this)};gc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};gc.prototype._isOnTerrain=function(e,t){return!1};gc.prototype._getIsClosed=function(e){return!0};gc.prototype._isDynamic=fe.throwInstantiationError;gc.prototype._setStaticOptions=fe.throwInstantiationError;gc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Ge.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ge.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,HDe),this._fillProperty=y(r,WDe),this._showProperty=y(u,GDe),this._showOutlineProperty=y(o.outline,jDe),this._outlineColorProperty=c?y(o.outlineColor,qDe):void 0,this._shadowsProperty=y(o.shadows,YDe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,XDe),this._classificationTypeProperty=y(o.classificationType,KDe),this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Vt);if(c&&f&&(Nt(Nt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};gc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var li=gc;function yC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(yC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});yC.prototype.getValue=function(e,t){return this._callback(e,t)};yC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};yC.prototype.equals=function(e){return this===e||e instanceof yC&&this._callback===e._callback&&this._isConstant===e._isConstant};var mm=yC;var wQ=new m,JDe=new me;function xC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new me,this._normal=new m,this._definitionChanged=new _e,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ge.MINIMUM_VALUE,wQ);if(!l(r)||m.equals(r,m.ZERO)||!l(e.globe))return;this._position=m.clone(r,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(xC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});xC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!l(t)||m.equals(n,m.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,o=t._surface,r=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);l(a)?this._terrainHeight=a:this._terrainHeight=0;function c(u){if(e.mode===ne.SCENE3D){let f=i.cartesianToCartographic(u,JDe);r._terrainHeight=f.height}else r._terrainHeight=u.x;r.definitionChanged.raiseEvent()}this._removeCallbackFunc=o.updateHeight(s,c)};xC.prototype.getValue=function(e,t){let n=q.getValueOrDefault(this._heightReference,e,qe.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,qe.NONE);if(n===qe.NONE&&i!==qe.RELATIVE_TO_GROUND)return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,wQ);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,P.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};xC.prototype.isDestroyed=function(){return!1};xC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var bC=xC;function ZDe(e,t,n,i){if(li.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new bC(this._scene,s,r)}}var I_=ZDe;var IQ=m.ZERO,DQ=new m,$De=new m,PQ=new z;function QDe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Fl(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new QDe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Fl.prototype=Object.create(li.prototype),Fl.prototype.constructor=Fl);Object.defineProperties(Fl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Fl.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=zn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,PQ)),l(a)||(a=z.WHITE),s.color=Ht.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,IQ,DQ))),new Tt({id:t,geometry:Ol.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};Fl.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,PQ),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,IQ,DQ))),new Tt({id:t,geometry:tm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:r})};Fl.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Fl.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||li.prototype._isHidden.call(this,e,t)};Fl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Fl.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};Fl.prototype._onEntityPropertyChanged=I_;Fl.DynamicGeometryUpdater=CC;function CC(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(CC.prototype=Object.create(ci.prototype),CC.prototype.constructor=CC);CC.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,$De),o=this._options.dimensions;return!l(i)||!l(o)||ci.prototype._isHidden.call(this,e,t,n)};CC.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.dimensions=q.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==qe.NONE?an.ALL:void 0};var FM=Fl;var RQ=ur(OQ(),1);var ePe=0,s5={};function Hh(e,t){let n,i=e;l(s5[i])?n=s5[i]:(n=ePe++,s5[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Hh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=RQ.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Hh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Hh.prototype.equals=function(e){return Hh.equals(this,e)};Hh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible,n=new Hh(e.html,t);return n._isIon=n.html.indexOf("ion-credit.png")!==-1,n};Hh.clone=function(e){if(l(e))return new Hh(e.html,e.showOnScreen)};var wt=Hh;function MQ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ae.COMPUTE,this.owner=e.owner}MQ.prototype.execute=function(e){e.execute(this)};var Hf=MQ;var BM=`in vec2 v_textureCoordinates; -/** -* Transform a given position to an octree tile coordinate and a position within that tile, -* and find the corresponding megatexture index and texture coordinates -*/ -void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { - traversalData.octreeCoords = ivec4(0); - traversalData.parentOctreeIndex = 0; - - OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); - if (nodeData.flag != OCTREE_FLAG_LEAF) { - nodeData = traverseOctreeDownwards(shapePosition, traversalData); - } +uniform float originalSize; +uniform sampler2D texture0; +uniform sampler2D texture1; +uniform sampler2D texture2; +uniform sampler2D texture3; +uniform sampler2D texture4; +uniform sampler2D texture5; - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); - #endif -} +const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); +const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); +const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); +const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); -bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { - return clamp(v, minVal, maxVal) == v; -} +void main() +{ + vec2 uv = v_textureCoordinates; + vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); + vec2 pixel = 1.0 / textureSize; -bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { - vec3 tileUv = getTileUv(shapePosition, octreeCoords); - bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); - // Assume (!) the position is always inside the root tile. - return inside || octreeCoords.w == 0; -} + float mipLevel = 0.0; -void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { - if (insideTile(shapePosition, traversalData.octreeCoords)) { - for (int i = 0; i < SAMPLE_COUNT; i++) { - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + if (uv.x - pixel.x > (textureSize.y / textureSize.x)) + { + mipLevel = 1.0; + if (uv.y - pixel.y > yMipLevel1) + { + mipLevel = 2.0; + if (uv.y - pixel.y * 3.0 > yMipLevel2) + { + mipLevel = 3.0; + if (uv.y - pixel.y * 5.0 > yMipLevel3) + { + mipLevel = 4.0; + if (uv.y - pixel.y * 7.0 > yMipLevel4) + { + mipLevel = 5.0; + } + } + } } - return; } - // Go up tree until we find a parent tile containing shapePosition - for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { - traversalData.octreeCoords.xyz /= 2; - traversalData.octreeCoords.w -= 1; + if (mipLevel > 0.0) + { + float scale = pow(2.0, mipLevel); - if (insideTile(shapePosition, traversalData.octreeCoords)) { - break; - } + uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); + uv.x *= ((textureSize.x - 2.0) / textureSize.y); - traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); + uv.x -= 1.0 + pixel.x; + uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); + uv *= scale; + } + else + { + uv.x *= (textureSize.x / textureSize.y); } - // Go down tree - OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); + if(mipLevel == 0.0) + { + out_FragColor = texture(texture0, uv); + } + else if(mipLevel == 1.0) + { + out_FragColor = texture(texture1, uv); + } + else if(mipLevel == 2.0) + { + out_FragColor = texture(texture2, uv); + } + else if(mipLevel == 3.0) + { + out_FragColor = texture(texture3, uv); + } + else if(mipLevel == 4.0) + { + out_FragColor = texture(texture4, uv); + } + else if(mipLevel == 5.0) + { + out_FragColor = texture(texture5, uv); + } + else + { + out_FragColor = vec4(0.0); + } +} +`;var kM=`in vec3 v_cubeMapCoordinates; +uniform samplerCube cubeMap; - #if (SAMPLE_COUNT == 1) - getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); +void main() +{ + vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); + #ifdef RGBA_NORMALIZED + out_FragColor = vec4(rgba.rgb, 1.0); #else - getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); - sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); - sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); + float m = rgba.a * 16.0; + vec3 r = rgba.rgb * m; + out_FragColor = vec4(r * r, 1.0); #endif } -`;var CV=`// See Octree.glsl for the definitions of SampleData and intMod +`;var UM=`in vec4 position; +in vec3 cubeMapCoordinates; -/* Megatexture defines (set in Scene/VoxelRenderResources.js) -#define SAMPLE_COUNT ### -#define NEAREST_SAMPLING -#define PADDING -*/ +out vec3 v_cubeMapCoordinates; -uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions -uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; +void main() +{ + gl_Position = position; + v_cubeMapCoordinates = cubeMapCoordinates; +} +`;function m0(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new _e}Object.defineProperties(m0.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});m0.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var tPe=new m(1,0,0),nPe=new m(0,0,1),iPe=new m(-1,0,0),oPe=new m(0,0,-1),VM=new m(0,1,0),rPe=new m(0,-1,0),FQ=[VM,iPe,nPe,rPe,tPe,VM,oPe,VM,VM],BQ=FQ.length,kQ=new Float32Array(BQ*3),LQ=0;for(let e=0;e<BQ;++e,LQ+=3)m.pack(FQ[e],kQ,LQ);var sPe=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),aPe=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function cPe(e){let t=ht.createVertexBuffer({context:e,typedArray:sPe,usage:ke.STATIC_DRAW}),n=ht.createVertexBuffer({context:e,typedArray:kQ,usage:ke.STATIC_DRAW}),i=ht.createIndexBuffer({context:e,typedArray:aPe,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:X.FLOAT}];return new ai({context:e,attributes:o,indexBuffer:i})}function NQ(e){return function(){return e}}function a5(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(l(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}m0.prototype.update=function(e){let t=e.context;if(!m0.isSupported(t)||(l(this._texture)&&l(this._va)&&a5(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let g=e.context.textureCache.getTexture(this._url);l(g)&&(a5(this),this._texture=g,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let g=this;Rl(this._url).then(function(h){g._cubeMapBuffers=h,g._loading=!1}).catch(function(h){g.isDestroyed()||g._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;l(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT;let r=lt.RGBA,s=new We({defines:i,sources:[kM]});this._va=cPe(t),this._sp=$t.fromCache({context:t,vertexShaderSource:UM,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let g=0;g<a;++g){let h=n[g].positiveY;n[g].positiveY=n[g].negativeY,n[g].negativeY=h;let x=c[g]=new uc({context:t,source:n[g],pixelDatatype:o}),b=c[g].width*2,C=u[g]=new Lt({context:t,width:b,height:b,pixelDatatype:o,pixelFormat:r}),T=new Hf({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:NQ(x)},outputTexture:C,persists:!0,owner:this});e.commandList.push(T),d[`texture${g}`]=NQ(C)}this._texture=new Lt({context:t,width:f*1.5+2,height:f,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Hf({fragmentShaderSource:BM,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){return a5(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var hm=m0;function VS(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?H.clone(e.imageBasedLightingFactor):new H(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=H.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(VS.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=H.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function lPe(e,t){if(hm.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new hm(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}VS.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(lPe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};VS.prototype.isDestroyed=function(){return!1};VS.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var TC=VS;var c5=ur(Dl(),1);var zM,UQ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYmE2YWEzOS1lZDUyLTQ0YWMtOTlkNS0wN2VhZWI3NTc4MmEiLCJpZCI6MjU5LCJpYXQiOjE2ODU2MzQ0Njl9.AswCMxsN03WYwuZL-r183OZicN64Ks9aPExWhA3fuLY",HM={};HM.defaultAccessToken=UQ;HM.defaultServer=new ve({url:"https://api.cesium.com/"});HM.getDefaultTokenCredit=function(e){if(e===UQ){if(!l(zM)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;zM=new wt(t,!0),zM._isDefaultToken=!0}return zM}};var pm=HM;function yc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:uPe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new c5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(yc.prototype=Object.create(ve.prototype),yc.prototype.constructor=yc);yc.fromAssetId=function(e,t){let n=yc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new yc(i,n)})};Object.defineProperties(yc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=yc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});yc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(wt.getIonCredit),i=pm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(wt.clone(i)),n};yc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new yc(t._ionEndpoint,t._ionEndpointResource)),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};yc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};yc.prototype._makeRequest=function(e){return this._isExternal||new c5.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),ve.prototype._makeRequest.call(this,e))};yc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,pm.defaultServer),i=y(t.accessToken,pm.defaultAccessToken);n=ve.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function uPe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var ma=yc;function _m(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(_m.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});_m.prototype.get=function(e){return this._array[e]};_m.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};_m.prototype.peek=function(){return this._array[this._length-1]};_m.prototype.push=function(e){let t=this.length++;this._array[t]=e};_m.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};_m.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};_m.prototype.resize=function(e){this.length=e};_m.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Zc=_m;function GM(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}GM.ALL=Object.freeze(new GM({color:new z(0,0,0,0),depth:1,stencil:0}));GM.prototype.execute=function(e,t){e.clear(this,t)};var ui=GM;var Gh={X:0,Y:1,Z:2};Gh.Y_UP_TO_Z_UP=L.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));Gh.Z_UP_TO_Y_UP=L.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));Gh.X_UP_TO_Z_UP=L.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));Gh.Z_UP_TO_X_UP=L.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));Gh.X_UP_TO_Y_UP=L.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));Gh.Y_UP_TO_X_UP=L.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));Gh.fromName=function(e){return Gh[e]};var _o=Object.freeze(Gh);function Nu(e){this.planes=y(e,[])}var zS=[new m,new m,new m];m.clone(m.UNIT_X,zS[0]);m.clone(m.UNIT_Y,zS[1]);m.clone(m.UNIT_Z,zS[2]);var D_=new m,fPe=new m,VQ=new dn(new m(1,0,0),0);Nu.fromBoundingSphere=function(e,t){l(t)||(t=new Nu);let n=zS.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=zS[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new re),l(f)||(f=i[s+1]=new re),m.multiplyByScalar(c,-r,D_),m.add(o,D_,D_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-m.dot(c,D_),m.multiplyByScalar(c,r,D_),m.add(o,D_,D_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-m.dot(m.negate(c,fPe),D_),s+=2}return t};Nu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(dn.fromCartesian4(t[i],VQ));if(r===tn.OUTSIDE)return tn.OUTSIDE;r===tn.INTERSECTING&&(n=!0)}return n?tn.INTERSECTING:tn.INSIDE};Nu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Nu.MASK_OUTSIDE||t===Nu.MASK_INSIDE)return t;let n=Nu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(dn.fromCartesian4(i[o],VQ));if(a===tn.OUTSIDE)return Nu.MASK_OUTSIDE;a===tn.INTERSECTING&&(n|=s)}return n};Nu.MASK_OUTSIDE=4294967295;Nu.MASK_INSIDE=0;Nu.MASK_INDETERMINATE=2147483647;var ss=Nu;function gm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ss,this._orthographicMatrix=new L}function zQ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=L.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(gm.prototype,{projectionMatrix:{get:function(){return zQ(this),this._orthographicMatrix}}});var dPe=new m,mPe=new m,hPe=new m,l5=new m;gm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,dPe);m.normalize(f,f);let d=mPe;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=hPe;m.multiplyByScalar(f,a,p),m.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new re),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-m.dot(f,p),m.multiplyByScalar(f,s,p),m.add(d,p,p),g=i[1],l(g)||(g=i[1]=new re),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-m.dot(m.negate(f,l5),p),m.multiplyByScalar(n,r,p),m.add(d,p,p),g=i[2],l(g)||(g=i[2]=new re),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(d,p,p),g=i[3],l(g)||(g=i[3]=new re),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,l5),p),g=i[4],l(g)||(g=i[4]=new re),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,d),m.multiplyByScalar(t,u,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new re),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,l5),p),this._cullingVolume};gm.prototype.getPixelDimensions=function(e,t,n,i,o){zQ(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};gm.prototype.clone=function(e){return l(e)||(e=new gm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};gm.prototype.equals=function(e){return l(e)&&e instanceof gm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};gm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof gm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Or=gm;function $c(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Or,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}$c.packedLength=4;$c.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};$c.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $c),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function P_(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties($c.prototype,{projectionMatrix:{get:function(){return P_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return P_(this),this._offCenterFrustum}}});$c.prototype.computeCullingVolume=function(e,t,n){return P_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};$c.prototype.getPixelDimensions=function(e,t,n,i,o){return P_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};$c.prototype.clone=function(e){return l(e)||(e=new $c),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};$c.prototype.equals=function(e){return!l(e)||!(e instanceof $c)?!1:(P_(this),P_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};$c.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof $c)?!1:(P_(this),P_(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var on=$c;function HQ(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(HQ.prototype,{metadata:{get:function(){return this._metadata}}});var AC=HQ;function O_(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),O_.decode(e)}O_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};O_.decodeWithFromCharCode=function(e){let t="",n=pPe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function HS(e,t,n){return t<=e&&e<=n}function pPe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(HS(u,0,127)){s.push(u);continue}if(HS(u,194,223)){i=1,t=u&31;continue}if(HS(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(HS(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new de("String decoding failed.")}if(!HS(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?O_.decode=O_.decodeWithTextDecoder:O_.decode=O_.decodeWithFromCharCode;var Bl=O_;function _Pe(e,t){return t=y(t,0),Bl(e,t,Math.min(4,e.length))}var ym=_Pe;function Gf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(o=>{this._resolveContent=o})}Object.defineProperties(Gf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Composite3DTileContent.readyPromise","Composite3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Composite3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var GS=Uint32Array.BYTES_PER_ELEMENT;Gf.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=GS;let c=a.getUint32(o,!0);if(c!==1)throw new de(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=GS,o+=GS;let u=a.getUint32(o,!0);o+=GS;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let h=0;h<u;++h){let x=ym(s,o),b=a.getUint32(o+GS*2,!0),C=r[x],T=`${f}${h}`,A=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(C))d[h]=Promise.resolve(C(e,t,A,i,o));else throw new de(`Unknown tile content type, ${x}, inside Composite tile`);o+=b}let p=await Promise.all(d);return new Gf(e,t,n,p)};Gf.prototype.hasProperty=function(e,t){return!1};Gf.prototype.getFeature=function(e){};Gf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Gf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Gf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0,this._resolveContent(this))};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var WM=Gf;function gPe(e,t,n){return JSON.parse(Bl(e,t,n))}var Mo=gPe;function Fa(e){this._id=jn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Gt.maximumTextureSize),r=Math.ceil(t/Gt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new H(o,r),i=new re(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Fa.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Fa.DEFAULT_COLOR_VALUE=z.WHITE;Fa.DEFAULT_SHOW_VALUE=!0;function GQ(e){let t=e._textureDimensions;return t.x*t.y*4}function WQ(e){if(!l(e._batchValues)){let t=GQ(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function jQ(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Fa.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=jQ(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=WQ(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Fa.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Fa.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var yPe=new Array(4);Fa.prototype.setColor=function(e,t){if(z.equals(t,Fa.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(yPe),i=n[3],o=WQ(this),r=e*4,s=jQ(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Fa.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Fa.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Fa.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Fa.prototype.getPickColor=function(e){return this._pickIds[e]};function qQ(e,t,n){let i=e._textureDimensions;return new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:hn.NEAREST})}function xPe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=GQ(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=z.floatToByte(f.red),r[d+1]=z.floatToByte(f.green),r[d+2]=z.floatToByte(f.blue),r[d+3]=z.floatToByte(f.alpha)}e._pickTexture=qQ(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function bPe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Fa.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&xPe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=qQ(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),bPe(this))};Fa.prototype.isDestroyed=function(){return!1};Fa.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Qc=Fa;var CPe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TPe={SCALAR:void 0,VEC2:H,VEC3:m,VEC4:re,MAT2:no,MAT3:Z,MAT4:L};function APe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=CPe[e.type],o=TPe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return X.createArrayBufferView(n,r,s,i*a)}}}var Fu=APe;function Wh(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,EPe(this,e.extension,e.binaryBody)}Object.defineProperties(Wh.prototype,{byteLength:{get:function(){return this._byteLength}}});function EPe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=ln.SCALAR,r=Fu(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=ln.SCALAR,r=Fu(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=ln.SCALAR,r=Fu(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let h=a.length;for(i=0;i<h;++i){let C=a[i].length,T=a[i].instances,A=SPe(C,T,n);p+=vPe(A),a[i].instances=_t(A,T)}let x=new Array(h).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=x[o],++x[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function SPe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${o} requires a batch table binary.`);let u=Fu(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function vPe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var wPe=[],IPe=[],DPe=0;function PPe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=wPe;c.length=Math.max(c.length,a);let u=++DPe,f=IPe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=s[t];for(let h=0;h<p;++h){let x=r[g+h];x!==t&&f.push(x)}}}function OPe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function WS(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return PPe(e,t,n)}else return n(e,t);return OPe(e,t,n)}Wh.prototype.hasProperty=function(e,t){let n=WS(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Wh.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};Wh.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,WS(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Wh.prototype.getProperty=function(e,t){return WS(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?RPe(a,s):Ye(a[s],!0)})};function RPe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Wh.prototype.setProperty=function(e,t,n){let i=WS(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?MPe(u,c,n):u[c]=Ye(n,!0),!0});return l(i)};function MPe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Wh.prototype.isClass=function(e,t){let n=WS(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Wh.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var EC=Wh;var LPe={HIGHLIGHT:0,REPLACE:1,MIX:2},kl=Object.freeze(LPe);var u5=Qc.DEFAULT_COLOR_VALUE,f5=Qc.DEFAULT_SHOW_VALUE;function lo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=NPe(n);this._properties=s,this._batchTableHierarchy=FPe(this,n,i);let a=XQ(t,s,i);this._binaryPropertiesByteLength=BPe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Qc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}lo._deprecationWarning=Q;Object.defineProperties(lo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function NPe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function FPe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(lo._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new EC({extension:i,binaryBody:n})}function XQ(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${o} requires a batch table binary.`);let u=Fu(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function BPe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}lo.getBinaryProperties=function(e,t,n){return XQ(e,t,n)};lo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};lo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};lo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};lo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};lo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};lo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};lo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var kPe=new z;lo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(u5),this.setAllShow(f5);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,kPe),u5):u5,s=l(e.show)?y(e.show.evaluate(o),f5):f5;this.setColor(i,r),this.setShow(i,s)}};function UPe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function VPe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}lo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};lo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};lo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};lo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};lo.prototype.hasPropertyBySemantic=function(){return!1};lo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};lo.prototype.getPropertyBySemantic=function(e,t){};lo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return UPe(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};lo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){VPe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ye(n,!0)};function zPe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}lo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=KQ(o,n,!1),s;return Gt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${zPe(i)}${s}`}};function YQ(e,t){return e=We.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function HPe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function KQ(e,t,n){if(!l(t))return YQ(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return YQ(e,n);let r=o[0],s=o[2];e=We.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=HPe(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${r} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}lo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=KQ(i,t,!0),Gt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};lo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=We.replaceMain(e,"tile_main"),Gt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function GPe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===kl.HIGHLIGHT)return 0;if(n===kl.REPLACE)return 1;if(n===kl.MIX)return P.clamp(i,P.EPSILON4,1)}lo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return _t(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return GPe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};lo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var R_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};lo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=WPe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ae.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=jPe(f),f.dirty=!1);let p=d.originalCommand;c!==R_.ALL_OPAQUE&&f.pass!==Ae.TRANSLUCENT&&(l(d.translucent)||(d.translucent=qPe(p))),c!==R_.ALL_TRANSLUCENT&&f.pass!==Ae.TRANSLUCENT&&(l(d.opaque)||(d.opaque=YPe(p)),a&&(r||(l(d.zback)||(d.zback=KPe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==ZPe(d.stencil))&&(f.renderState.depthMask?d.stencil=JPe(p,o._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,h=d.translucent;f.pass!==Ae.TRANSLUCENT?(c===R_.ALL_OPAQUE&&(n[u]=g),c===R_.ALL_TRANSLUCENT&&(n[u]=h),c===R_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(h))):n[u]=p}};function WPe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?R_.ALL_OPAQUE:t===e.featuresLength?R_.ALL_TRANSLUCENT:R_.OPAQUE_AND_TRANSLUCENT}function jPe(e){let t=nt.shallowClone(e),n=t.pass===Ae.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function qPe(e){let t=nt.shallowClone(e);return t.pass=Ae.TRANSLUCENT,t.renderState=$Pe(e.renderState),t}function YPe(e){let t=nt.shallowClone(e);return t.renderState=QPe(e.renderState),t}function XPe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function KPe(e,t){let n=nt.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=gi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let o=new H(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=XPe(e,t.shaderProgram),n}function JPe(e,t){let n=nt.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Gn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=pt.REPLACE,i.stencilTest.backFunction=Gn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=pt.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function ZPe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function $Pe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function QPe(e){let t=Ye(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}lo.prototype.update=function(e,t){this._batchTexture.update(e,t)};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var M_=lo;function eOe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var jh=eOe;var jS=`in vec3 position; +in float a_batchId; -uniform ivec3 u_dimensions; // does not include padding -#if defined(PADDING) - uniform ivec3 u_paddingBefore; - uniform ivec3 u_paddingAfter; -#endif +uniform mat4 u_modifiedModelViewProjection; -// Integer min, max, clamp: For WebGL1 only -int intMin(int a, int b) { - return a <= b ? a : b; -} -int intMax(int a, int b) { - return a >= b ? a : b; -} -int intClamp(int v, int minVal, int maxVal) { - return intMin(intMax(v, minVal), maxVal); +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } - -vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) +`;function Bu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Bu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Bu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Bu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Bu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Bu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Bu.prototype.getPropertyInherited=function(e){return Bu.getPropertyInherited(this._content,this._batchId,e)};Bu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Bu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Bu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Bu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ks=Bu;var d5=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},m5=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},je=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+je.version}static addUnaryOp(t){return je.max_unop_len=Math.max(t.length,je.max_unop_len),je.unary_ops[t]=1,je}static addBinaryOp(t,n,i){return je.max_binop_len=Math.max(t.length,je.max_binop_len),je.binary_ops[t]=n,i?je.right_associative.add(t):je.right_associative.delete(t),je}static addIdentifierChar(t){return je.additional_identifier_chars.add(t),je}static addLiteral(t,n){return je.literals[t]=n,je}static removeUnaryOp(t){return delete je.unary_ops[t],t.length===je.max_unop_len&&(je.max_unop_len=je.getMaxKeyLen(je.unary_ops)),je}static removeAllUnaryOps(){return je.unary_ops={},je.max_unop_len=0,je}static removeIdentifierChar(t){return je.additional_identifier_chars.delete(t),je}static removeBinaryOp(t){return delete je.binary_ops[t],t.length===je.max_binop_len&&(je.max_binop_len=je.getMaxKeyLen(je.binary_ops)),je.right_associative.delete(t),je}static removeAllBinaryOps(){return je.binary_ops={},je.max_binop_len=0,je}static removeLiteral(t){return delete je.literals[t],je}static removeAllLiterals(){return je.literals={},je}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new je(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return je.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!je.binary_ops[String.fromCharCode(t)]||je.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return je.isIdentifierStart(t)||je.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(je.hooks[t]){let i={context:this,node:n};return je.hooks.run(t,i),i.node}return n}searchHook(t){if(je.hooks[t]){let n={context:this};return je.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===je.SPACE_CODE||t===je.TAB_CODE||t===je.LF_CODE||t===je.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:je.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===je.SEMCOL_CODE||i===je.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,je.max_binop_len),n=t.length;for(;n>0;){if(je.binary_ops.hasOwnProperty(t)&&(!je.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!je.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:je.binaryPrecedence(n),right_a:je.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=je.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:je.right_associative.has(n)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:je.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:je.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,je.isDecimalDigit(t)||t===je.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===je.SQUOTE_CODE||t===je.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===je.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,je.max_unop_len),i=n.length;i>0;){if(je.unary_ops.hasOwnProperty(n)&&(!je.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!je.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:je.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}je.isIdentifierStart(t)?(o=this.gobbleIdentifier(),je.literals.hasOwnProperty(o.name)?o={type:je.LITERAL,value:je.literals[o.name],raw:o.name}:o.name===je.this_str&&(o={type:je.THIS_EXP})):t===je.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===je.PERIOD_CODE||n===je.OBRACK_CODE||n===je.OPAREN_CODE||n===je.QUMARK_CODE;){let i;if(n===je.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==je.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===je.OBRACK_CODE?(t={type:je.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==je.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===je.OPAREN_CODE?t={type:je.CALL_EXP,arguments:this.gobbleArguments(je.CPAREN_CODE),callee:t}:(n===je.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:je.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;je.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===je.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);je.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));je.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);je.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,je.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===je.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===je.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:je.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:je.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(je.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,je.isIdentifierPart(t));)this.index++;return{type:je.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===je.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===je.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===je.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===je.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===je.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(je.CPAREN_CODE);if(this.code===je.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:je.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:je.ARRAY_EXP,elements:this.gobbleArguments(je.CBRACK_CODE)}}},tOe=new d5;Object.assign(je,{hooks:tOe,plugins:new m5(je),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});je.max_unop_len=je.getMaxKeyLen(je.unary_ops);je.max_binop_len=je.getMaxKeyLen(je.binary_ops);var L_=e=>new je(e).parse(),nOe=Object.getOwnPropertyNames(je);nOe.forEach(e=>{L_[e]===void 0&&e!=="prototype"&&(L_[e]=je[e])});L_.Jsep=je;var iOe="ConditionalExpression",oOe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:iOe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};L_.plugins.register(oOe);var rOe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(rOe);function Wf(e,t){this._expression=e,e=yOe(e,t),e=bOe(xOe(e)),L_.addBinaryOp("=~",0),L_.addBinaryOp("!~",0);let n;try{n=L_(e)}catch(i){throw new de(i)}this._runtimeAst=xi(this,n)}Object.defineProperties(Wf.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new m],cartesian4Array:[new re],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new re),this.cartesian4Array[this.cartesian4Index++]}};Wf.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof re?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof re?n.clone(t):n};Wf.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Wf.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} { - int indexX = intMod(index, dimensions.x); - int indexY = index / dimensions.x; - return vec2(indexX, indexY) * uvScale; + return ${o}; } +`,o};Wf.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Wf.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var sOe=["!","-","+"],JQ=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],YM=/\${(.*?)}/g,aOe=/\\/g,cOe="@#%",lOe=/@#%/g,XM=new z,KM={abs:ys(Math.abs),sqrt:ys(Math.sqrt),cos:ys(Math.cos),sin:ys(Math.sin),tan:ys(Math.tan),acos:ys(Math.acos),asin:ys(Math.asin),atan:ys(Math.atan),radians:ys(P.toRadians),degrees:ys(P.toDegrees),sign:ys(P.sign),floor:ys(Math.floor),ceil:ys(Math.ceil),round:ys(Math.round),exp:ys(Math.exp),exp2:ys(fOe),log:ys(Math.log),log2:ys(dOe),fract:ys(uOe),length:mOe,normalize:hOe},JM={atan2:jM(Math.atan2,!1),pow:jM(Math.pow,!1),min:jM(Math.min,!0),max:jM(Math.max,!0),distance:pOe,dot:_Oe,cross:gOe},_5={clamp:ZQ(P.clamp,!0),mix:ZQ(P.lerp,!0)};function uOe(e){return e-Math.floor(e)}function fOe(e){return Math.pow(2,e)}function dOe(e){return P.log2(e)}function ys(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof re)return re.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function jM(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof H)return H.fromElements(e(i.x,o),e(i.y,o),Rn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Rn.getCartesian3());if(i instanceof re)return re.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x),e(i.y,o.y),Rn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Rn.getCartesian3());if(i instanceof re&&o instanceof re)return re.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function ZQ(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Rn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Rn.getCartesian3());if(i instanceof re&&o instanceof re)return re.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof H&&o instanceof H&&r instanceof H)return H.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Rn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Rn.getCartesian3());if(i instanceof re&&o instanceof re&&r instanceof re)return re.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Rn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function mOe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof re)return re.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function hOe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof m)return m.normalize(t,Rn.getCartesian3());if(t instanceof re)return re.normalize(t,Rn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function pOe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof re&&n instanceof re)return re.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function _Oe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof re&&n instanceof re)return re.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function gOe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Rn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,POe(this)}function yOe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function xOe(e){return e.replace(aOe,cOe)}function p5(e){return e.replace(lOe,"\\")}function bOe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new de("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function COe(e){let t=typeof e.value;if(e.value===null)return new xt(gt.LITERAL_NULL,null);if(t==="boolean")return new xt(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new xt(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new xt(gt.VARIABLE_IN_STRING,e.value):new xt(gt.LITERAL_STRING,p5(e.value))}function TOe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${o} is not a function.`);return i===0?o==="test"?new xt(gt.LITERAL_BOOLEAN,!1):new xt(gt.LITERAL_NULL,null):(s=xi(e,c),a=xi(e,n[0]),new xt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=xi(e,c),new xt(gt.FUNCTION_CALL,o,r);throw new de(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new xt(gt.LITERAL_COLOR,o);if(r=xi(e,n[0]),l(n[1])){let c=xi(e,n[1]);return new xt(gt.LITERAL_COLOR,o,[r,c])}return new xt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new de(`${o} requires three arguments.`);return r=[xi(e,n[0]),xi(e,n[1]),xi(e,n[2])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new de(`${o} requires four arguments.`);return r=[xi(e,n[0]),xi(e,n[1]),xi(e,n[2]),xi(e,n[3])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=xi(e,n[c]);return new xt(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new xt(gt.LITERAL_BOOLEAN,!0):new xt(gt.LITERAL_BOOLEAN,!1):(r=xi(e,n[0]),new xt(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new de(`${o} requires exactly one argument.`);return r=xi(e,n[0]),new xt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new de(`${o} does not take any argument.`);return new xt(gt.UNARY,o)}else if(l(KM[o])){if(i!==1)throw new de(`${o} requires exactly one argument.`);return r=xi(e,n[0]),new xt(gt.UNARY,o,r)}else if(l(JM[o])){if(i!==2)throw new de(`${o} requires exactly two arguments.`);return s=xi(e,n[0]),a=xi(e,n[1]),new xt(gt.BINARY,o,s,a)}else if(l(_5[o])){if(i!==3)throw new de(`${o} requires exactly three arguments.`);s=xi(e,n[0]),a=xi(e,n[1]);let c=xi(e,n[2]);return new xt(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new xt(gt.LITERAL_BOOLEAN,!1):(r=xi(e,n[0]),new xt(gt.UNARY,o,r));if(o==="Number")return i===0?new xt(gt.LITERAL_NUMBER,0):(r=xi(e,n[0]),new xt(gt.UNARY,o,r));if(o==="String")return i===0?new xt(gt.LITERAL_STRING,""):(r=xi(e,n[0]),new xt(gt.UNARY,o,r));if(o==="regExp")return AOe(e,t)}}throw new de(`Unexpected function call "${o}".`)}function AOe(e,t){let n=t.arguments;if(n.length===0)return new xt(gt.LITERAL_REGEX,new RegExp);let i=xi(e,n[0]),o;if(n.length>1){let r=xi(e,n[1]);if(h5(i)&&h5(r)){try{o=new RegExp(p5(String(i._value)),r._value)}catch(s){throw new de(s)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i,r)}if(h5(i)){try{o=new RegExp(p5(String(i._value)))}catch(r){throw new de(r)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i)}function EOe(e){if(IOe(e.name)){let t=DOe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(gt.BUILTIN_VARIABLE,t):new xt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(gt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function SOe(e){let t=e.property.name;if(t==="PI")return new xt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(gt.LITERAL_NUMBER,Math.E)}function vOe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function wOe(e,t){if(t.object.name==="Math")return SOe(t);if(t.object.name==="Number")return vOe(t);let n,i=xi(e,t.object);return t.computed?(n=xi(e,t.property),new xt(gt.MEMBER,"brackets",i,n)):(n=new xt(gt.LITERAL_STRING,t.property.name),new xt(gt.MEMBER,"dot",i,n))}function h5(e){return e._type>=gt.LITERAL_NULL}function IOe(e){return e.substr(0,4)==="czm_"}function DOe(e){return e.substr(4)}function xi(e,t){let n,i,o,r;if(t.type==="Literal")n=COe(t);else if(t.type==="CallExpression")n=TOe(e,t);else if(t.type==="Identifier")n=EOe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=xi(e,t.argument);if(sOe.indexOf(i)>-1)n=new xt(gt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=xi(e,t.left),r=xi(e,t.right),JQ.indexOf(i)>-1)n=new xt(gt.BINARY,i,o,r);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=xi(e,t.left),r=xi(e,t.right),JQ.indexOf(i)>-1&&(n=new xt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=xi(e,t.test);o=xi(e,t.consequent),r=xi(e,t.alternate),n=new xt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=wOe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=xi(e,t.elements[a]);n=new xt(gt.ARRAY,s)}else throw t.type==="Compound"?new de("Provide exactly one expression."):new de("Cannot parse expression.");return n}function POe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(KM[e._value])&&(e.evaluate=ROe(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(JM[e._value])&&(e.evaluate=MOe(e._value)):e._type===gt.TERNARY?e.evaluate=LOe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=OOe):e.evaluate=e._evaluateLiteral}function OOe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function ROe(e){let t=KM[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function MOe(e){let t=JM[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function LOe(e){let t=_5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function ZM(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=XM,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return re.fromColor(t,Rn.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof H)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof re)t.push(c.x,c.y,c.z,c.w);else throw new de(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new de(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return re.fromArray(t,0,Rn.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=YM.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=ZM(e,o);l(r)||(r=""),t=t.replace(i,r),n=YM.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return ZM(e,this._value)};function h0(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(h0(this._left))return ZM(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(h0(this._left))return ZM(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};xt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};xt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof H)return H.negate(t,Rn.getCartesian2());if(t instanceof m)return m.negate(t,Rn.getCartesian3());if(t instanceof re)return re.negate(t,Rn.getCartesian4());if(typeof t=="number")return-t;throw new de(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};xt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof H||t instanceof m||t instanceof re||typeof t=="number"))throw new de(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};xt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};xt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};xt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.add(t,n,Rn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof re&&typeof t=="number")return re.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.divideComponents(t,n,Rn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new de(o)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof re)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function $Q(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,o,r,s,XM)}function QQ(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=XM;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function N_(e){return e%1===0?e.toFixed(1):e.toString()}function NOe(e){let t=N_(e.red),n=N_(e.green),i=N_(e.blue);return`vec3(${t}, ${n}, ${i})`}function qM(e){let t=N_(e.red),n=N_(e.green),i=N_(e.blue),o=N_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function eee(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function tee(e,t){return l(t[e])?t[e]:Wf.NULL_SENTINEL}Wf.NULL_SENTINEL="czm_infinity";xt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=eee(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=eee(this._value,e,t,this));let u,f,d;switch(a){case gt.VARIABLE:return h0(this)?void 0:tee(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(KM[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new de(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(JM[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(_5[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return h0(this._left)?tee(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case gt.FUNCTION_CALL:throw new de(`Error generating style shader: "${c}" is not supported.`);case gt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new de("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new de("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return Wf.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return N_(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||h0(n._left)))return c;if(i=z.fromCssColorString(c,XM),l(i))return NOe(i);throw new de("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=QQ(this),l(i)?qM(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=QQ(this),l(i)?qM(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=$Q(this),l(i)?qM(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=$Q(this),l(i)?(i.alpha!==1&&(t.translucent=!0),qM(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case gt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case gt.LITERAL_REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return Wf.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};xt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case gt.VARIABLE:h0(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=YM.exec(s);a!==null;)e.push(a[1]),a=YM.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&h0(t._left)&&e.push(s);break}};var jf=Wf;function qh(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,m.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,Hn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(qh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var FOe={position:0,a_batchId:1};function BOe(e,t){if(l(e._va))return;let n=ht.createVertexBuffer({context:t,typedArray:e._positions,usage:ke.STATIC_DRAW}),i=ht.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:ke.STATIC_DRAW}),o=ht.createIndexBuffer({context:t,typedArray:e._indices,usage:ke.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ai({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ai({context:t,attributes:r,indexBuffer:ht.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:ke.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function kOe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,FOe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=We.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`,e._spPick=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(jS),c=n.getFragmentShaderCallback(!1,void 0,!0)(t0);o=n.getPickId();let u=new We({sources:[a]}),f=new We({defines:["VECTOR_TILE"],sources:[c]});e._sp=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new We({sources:[jS]}),f=new We({defines:["VECTOR_TILE"],sources:[t0]}),e._spStencil=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=We.replaceMain(c,"czm_non_pick_main"),c=`${c} +void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`;let d=new We({sources:[a]}),p=new We({defines:["VECTOR_TILE"],sources:[c]});e._spPick=$t.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function nee(e){let t=e?Gn.EQUAL:Gn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:t,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}var UOe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},VOe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function zOe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(nee(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(nee(!0)),e._rsColorPass=Ve.fromCache(UOe),e._rsPickPass=Ve.fromCache(VOe))}var p0=new L,iee=new m;function HOe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return L.clone(i,p0),L.multiplyByPoint(p0,e._center,iee),L.setTranslation(p0,iee,p0),L.multiply(o,p0,p0),p0},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function g5(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d],h=new e.constructor(e.buffer,a*p,g);t.set(h,n),i[d]=n,n+=g}return n}function GOe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=g5(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=g5(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=g5(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function y5(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function WOe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=y5(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,r.color))u=y5(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=y5(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function jOe(e,t){return t.color.toRgba()-e.color.toRgba()}function qOe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(jOe),t.webgl2?WOe(e,n):GOe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function YOe(e,t){let n=qOe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,L.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,h=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new nt({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=h,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=Ae.TERRAIN_CLASSIFICATION;let b=nt.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new nt({owner:e})),C.vertexArray=a,C.modelMatrix=u,C.offset=g,C.count=h,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=d,C.cull=!1,C.pass=Ae.TERRAIN_CLASSIFICATION;let T=nt.shallowClone(C,C.derivedCommands.tileset);T.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=T}e._commandsDirty=!0}function XOe(e,t){if(e.classificationType===Hn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=nt.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function KOe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,L.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=d,p.pass=Ae.TERRAIN_CLASSIFICATION;let g=nt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let h=n[c*2+1];l(h)||(h=n[c*2+1]=new nt({owner:e,pickOnly:!0})),h.vertexArray=i,h.modelMatrix=s,h.offset=u,h.count=f,h.renderState=e._rsPickPass,h.shaderProgram=r,h.uniformMap=a,h.boundingVolume=d,h.pass=Ae.TERRAIN_CLASSIFICATION;let x=nt.shallowClone(h,h.derivedCommands.tileset);x.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=x}e._pickCommandsDirty=!1}qh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ks(e,r)}};qh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function JOe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=z.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var ZOe=new z,$Oe=z.WHITE,QOe=!0,eRe=/\$/;qh.prototype.applyStyle=function(e,t){if(!l(e)){JOe(this,t);return}let n=e.color,i=n instanceof jf&&!eRe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,ZOe):$Oe,c.show=l(e.show)?e.show.evaluate(c):QOe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};qh.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new jh({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,h=g.length;for(let x=0;x<h;++x){let b=g[x];if(b===e)continue;let C=n[b];o[C]<s?d.push(b):p.push(b)}p.length!==0&&c.push(new jh({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function oee(e,t,n,i){let o=e.classificationType,r=o!==Hn.CESIUM_3D_TILE,s=o!==Hn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Ae.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function tRe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ae.OPAQUE,n.push(r)}}function nRe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Fe.LINES):(n=e._rsColorPass,i=Fe.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}qh.prototype.update=function(e){let t=e.context;BOe(this,t),kOe(this,t),zOe(this),HOe(this,t);let n=e.passes;n.render&&(YOe(this,t),XOe(this,e),nRe(this),this._debugWireframe?tRe(e,this._commands):oee(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(KOe(this),oee(this,e,this._pickCommands))};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var SC=qh;function Ul(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Hn.BOTH}Object.defineProperties(Ul.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Ul.packedBoxLength=L.packedLength+m.packedLength;Ul.packedCylinderLength=L.packedLength+2;Ul.packedEllipsoidLength=L.packedLength+m.packedLength;Ul.packedSphereLength=m.packedLength+1;function iRe(e){let t=new Float64Array(L.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,L.pack(e._modelMatrix,t,n),t}function oRe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let h=0;h<p;++h)g[h]=t[n++];a[c]=new jh({color:u,offset:f,count:d,batchIds:g})}return i}var rRe=new yi("createVectorTileGeometries",5),sRe=new z;function aRe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let h=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),h+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),h+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),h+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),h+=c.length),u=e._batchTableColors=new Uint32Array(h);let x=e._batchTable;for(let b=0;b<h;++b){let C=x.getColor(b,sRe);u[b]=C.toRgba()}f=e._packedBuffer=iRe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=rRe.scheduleTask(p,d);return l(g)?g.then(function(h){if(e.isDestroyed())return;let x=new Float64Array(h.packedBuffer);oRe(e,x)===2?e._indices=new Uint16Array(h.indices):e._indices=new Uint32Array(h.indices),e._indexOffsets=new Uint32Array(h.indexOffsets),e._indexCounts=new Uint32Array(h.indexCounts),e._positions=new Float32Array(h.positions),e._vertexBatchIds=new Uint16Array(h.vertexBatchIds),e._batchIds=new Uint16Array(h.batchIds),cRe(e),e._ready=!0}).catch(h=>{e.isDestroyed()||(e._error=h)}):void 0}}function cRe(e){l(e._primitive)||(e._primitive=new SC({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Ul.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Ul.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Ul.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Ul.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Ul.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=aRe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Ul.prototype.isDestroyed=function(){return!1};Ul.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var F_=Ul;function Yh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r}),fRe(this,i,o)}Object.defineProperties(Yh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function lRe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function uRe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=h++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=h++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=h++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=h++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var _0=Uint32Array.BYTES_PER_ELEMENT;function fRe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=_0;let r=o.getUint32(n,!0);if(r!==1)throw new de(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=_0;let s=o.getUint32(n,!0);if(n+=_0,s===0){e._ready=!0,e._resolveContent(e);return}let a=o.getUint32(n,!0);if(n+=_0,a===0)throw new de("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=_0;let u=o.getUint32(n,!0);n+=_0;let f=o.getUint32(n,!0);n+=_0;let d=Mo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,h;u>0&&(g=Mo(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let x=y(d.BOXES_LENGTH,0),b=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),A=x+b+C+T,S=new M_(e,A,g,h,lRe(e));if(e._batchTable=S,A===0)return;let v=e.tile.computedTransform,I;l(d.RTC_CENTER)&&(I=m.unpack(d.RTC_CENTER),L.multiplyByPoint(v,I,I));let O=uRe(d,p);if(x>0||b>0||C>0||T>0){let R,N,F,_;if(x>0){let E=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,E,F_.packedBoxLength*x)}if(b>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;N=new Float32Array(p.buffer,E,F_.packedCylinderLength*b)}if(C>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,E,F_.packedEllipsoidLength*C)}if(T>0){let E=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,E,F_.packedSphereLength*T)}return e._geometries=new F_({boxes:R,boxBatchIds:O.boxes,cylinders:N,cylinderBatchIds:O.cylinders,ellipsoids:F,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:I,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function ree(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Yh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Yh.prototype.getFeature=function(e){return ree(this),this._features[e]};Yh.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Yh.prototype.applyStyle=function(e){ree(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Yh.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Yh.prototype.isDestroyed=function(){return!1};Yh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var $M=Yh;var x5={};x5.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),see(i,o,r,s);return c};x5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),see(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function see(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var qS=x5;var g0=30,dRe=1<<g0,mRe=1<<g0+1>>>0,b5=2*g0+1,B_=4,lee=[],uee=[],hRe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],k_=1,vC=2,QM=[k_,0,0,k_|vC];function Rr(e){if(!Wt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Rr.getLevel(e)}Rr.fromToken=function(e){return new Rr(Rr.getIdFromToken(e))};Rr.isValidId=function(e){return!(e<=0||e>>BigInt(b5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Rr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Rr.isValidId(Rr.getIdFromToken(e)):!1};Rr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Rr.getTokenFromId=function(e){let t=Math.floor(ERe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Rr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return g0-(t>>1)};Rr.prototype.getChild=function(e){let t=mee(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Rr(n)};Rr.prototype.getParent=function(){let e=mee(this._cellId)<<BigInt(2);return new Rr(this._cellId&~e+BigInt(1)|e)};Rr.prototype.getParentAtLevel=function(e){let t=TRe(e);return new Rr(this._cellId&-t|t)};Rr.prototype.getCenter=function(e){e=y(e,oe.WGS84);let t=pRe(this._cellId,this._level);t=m.normalize(t,t);let n=new me.fromCartesian(t,oe.UNIT_SPHERE);return me.toCartesian(n,e,new m)};Rr.prototype.getVertex=function(e,t){t=y(t,oe.WGS84);let n=_Re(this._cellId,this._level,e);n=m.normalize(n,n);let i=new me.fromCartesian(n,oe.UNIT_SPHERE);return me.toCartesian(i,t,new m)};Rr.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(b5-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Rr(a)};function pRe(e,t){let n=gRe(e,t);return yRe(n[0],n[1],n[2])}function _Re(e,t,n){let i=fee(e,t),o=xRe([i[1],i[2]],t),r=n>>1&1;return dee(i[0],o[0][r^n&1],o[1][r])}function gRe(e,t){let n=fee(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function fee(e){lee.length===0&&CRe();let t=Number(e>>BigInt(b5)),n=t&k_,i=(1<<B_)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?g0-7*B_:B_))-1;n+=Number(e>>BigInt(s*2*B_+1)&BigInt(c))<<2,n=uee[n];let u=s*B_;o+=n>>B_+2<<u,r+=(n>>2&i)<<u,n&=k_|vC}return[t,o,r]}function yRe(e,t,n){let i=aee(t),o=aee(n),r=eL(i),s=eL(o);return dee(e,r,s)}function dee(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function eL(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function aee(e){return 1/mRe*e}function xRe(e,t){let n=[[],[]],i=bRe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=eL(cee(r)),n[o][1]=eL(cee(s))}return n}function bRe(e){return 1<<g0-e>>>0}function cee(e){return 1/dRe*e}function U_(e,t,n,i,o,r){if(e===B_){let s=(t<<B_)+n;lee[(s<<2)+i]=(o<<2)+r,uee[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=hRe[r];U_(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^QM[0]),U_(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^QM[1]),U_(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^QM[2]),U_(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^QM[3])}}function CRe(){U_(0,0,0,0,0,0),U_(0,0,0,k_,0,k_),U_(0,0,0,vC,0,vC),U_(0,0,0,k_|vC,0,k_|vC)}function mee(e){return e&~e+BigInt(1)}function TRe(e){return BigInt(1)<<BigInt(2*(g0-e))}var ARe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function ERe(e){return ARe[(-e&e)%BigInt(67)]}var V_=Rr;function SRe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ii=SRe;function C5(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new de(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=vRe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function vRe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(C5.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});C5.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var YS=C5;function Xh(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Xh.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Xh.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Xh.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Xh.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Xh.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Xh.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Xh.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Xh.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var XS=Xh;var tL={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};tL.getBranchingFactor=function(e){switch(e){case tL.OCTREE:return 8;case tL.QUADTREE:return 4}};var qr=Object.freeze(tL);function Us(){}Object.defineProperties(Us.prototype,{class:{get:function(){fe.throwInstantiationError()}}});Us.prototype.hasProperty=function(e){fe.throwInstantiationError()};Us.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};Us.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};Us.prototype.getProperty=function(e){fe.throwInstantiationError()};Us.prototype.setProperty=function(e,t){fe.throwInstantiationError()};Us.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};Us.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};Us.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};Us.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Us.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};Us.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Us.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;l(r)&&(o=r[e]);let s=!0;return l(o)&&(t=o.packVectorAndMatrixTypes(t,s),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};Us.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Us.getProperty(o.id,t,n)};Us.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Us.setProperty(r.id,t,n,i):!1};var Vn=Us;function Kh(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Kh.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kh.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};Kh.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};Kh.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};Kh.prototype.getProperty=function(e){return Vn.getProperty(e,this._properties,this._class)};Kh.prototype.setProperty=function(e,t){return Vn.setProperty(e,t,this._properties,this._class)};Kh.prototype.getPropertyBySemantic=function(e){return Vn.getPropertyBySemantic(e,this._properties,this._class)};Kh.prototype.setPropertyBySemantic=function(e,t){return Vn.setPropertyBySemantic(e,t,this._properties,this._class)};var nL=Kh;var Pt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Pt.getMinimum=function(e){switch(e){case Pt.INT8:return-128;case Pt.UINT8:return 0;case Pt.INT16:return-32768;case Pt.UINT16:return 0;case Pt.INT32:return-2147483648;case Pt.UINT32:return 0;case Pt.INT64:return Wt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Pt.UINT64:return Wt.supportsBigInt()?BigInt(0):0;case Pt.FLOAT32:return-34028234663852886e22;case Pt.FLOAT64:return-Number.MAX_VALUE}};Pt.getMaximum=function(e){switch(e){case Pt.INT8:return 127;case Pt.UINT8:return 255;case Pt.INT16:return 32767;case Pt.UINT16:return 65535;case Pt.INT32:return 2147483647;case Pt.UINT32:return 4294967295;case Pt.INT64:return Wt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Pt.UINT64:return Wt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Pt.FLOAT32:return 34028234663852886e22;case Pt.FLOAT64:return Number.MAX_VALUE}};Pt.isIntegerType=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.INT64:case Pt.UINT64:return!0;default:return!1}};Pt.isUnsignedIntegerType=function(e){switch(e){case Pt.UINT8:case Pt.UINT16:case Pt.UINT32:case Pt.UINT64:return!0;default:return!1}};Pt.isVectorCompatible=function(e){switch(e){case Pt.INT8:case Pt.UINT8:case Pt.INT16:case Pt.UINT16:case Pt.INT32:case Pt.UINT32:case Pt.FLOAT32:case Pt.FLOAT64:return!0;default:return!1}};Pt.normalize=function(e,t){return Math.max(Number(e)/Number(Pt.getMaximum(t)),-1)};Pt.unnormalize=function(e,t){let n=Pt.getMaximum(t),i=Pt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Pt.INT64||t===Pt.UINT64)&&Wt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Pt.applyValueTransform=function(e,t,n){return n*e+t};Pt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Pt.getSizeInBytes=function(e){switch(e){case Pt.INT8:case Pt.UINT8:return 1;case Pt.INT16:case Pt.UINT16:return 2;case Pt.INT32:case Pt.UINT32:return 4;case Pt.INT64:case Pt.UINT64:return 8;case Pt.FLOAT32:return 4;case Pt.FLOAT64:return 8}};Pt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Pt.INT8;case X.UNSIGNED_BYTE:return Pt.UINT8;case X.SHORT:return Pt.INT16;case X.UNSIGNED_SHORT:return Pt.UINT16;case X.INT:return Pt.INT32;case X.UNSIGNED_INT:return Pt.UINT32;case X.FLOAT:return Pt.FLOAT32;case X.DOUBLE:return Pt.FLOAT64}};Pt.toComponentDatatype=function(e){switch(e){case Pt.INT8:return X.BYTE;case Pt.UINT8:return X.UNSIGNED_BYTE;case Pt.INT16:return X.SHORT;case Pt.UINT16:return X.UNSIGNED_SHORT;case Pt.INT32:return X.INT;case Pt.UINT32:return X.UNSIGNED_INT;case Pt.FLOAT32:return X.FLOAT;case Pt.FLOAT64:return X.DOUBLE}};var rn=Object.freeze(Pt);var Lo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Lo.isVectorType=function(e){switch(e){case Lo.VEC2:case Lo.VEC3:case Lo.VEC4:return!0;default:return!1}};Lo.isMatrixType=function(e){switch(e){case Lo.MAT2:case Lo.MAT3:case Lo.MAT4:return!0;default:return!1}};Lo.getComponentCount=function(e){switch(e){case Lo.SCALAR:case Lo.STRING:case Lo.ENUM:case Lo.BOOLEAN:return 1;case Lo.VEC2:return 2;case Lo.VEC3:return 3;case Lo.VEC4:return 4;case Lo.MAT2:return 4;case Lo.MAT3:return 9;case Lo.MAT4:return 16}};Lo.getMathType=function(e){switch(e){case Lo.VEC2:return H;case Lo.VEC3:return m;case Lo.VEC4:return re;case Lo.MAT2:return no;case Lo.MAT3:return Z;case Lo.MAT4:return L;default:return}};var qt=Object.freeze(Lo);function ha(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&rn.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=r;let s=Ye(e.offset,!0),a=Ye(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=y(e.required,!0),this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}ha.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=wRe(n),o=IRe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new ha({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(ha.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function wRe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===qt.SCALAR||qt.isMatrixType(t)||qt.isVectorType(t))return!1;if(l(rn[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function IRe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===qt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===qt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===qt.SCALAR||qt.isMatrixType(n)||qt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===qt.BOOLEAN||n===qt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===qt.BOOLEAN||i===qt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(rn[i]))return{type:qt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(rn[n]))return{type:qt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}ha.prototype.normalize=function(e){return this._normalized?T5(e,this._valueType,rn.normalize):e};ha.prototype.unnormalize=function(e){return this._normalized?T5(e,this._valueType,rn.unnormalize):e};ha.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ha.valueTransformInPlace(e,this._offset,this._scale,rn.applyValueTransform)};ha.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ha.valueTransformInPlace(e,this._offset,this._scale,rn.unapplyValueTransform)};ha.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=qt.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};ha.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!gee(e,t))return e};function gee(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!gee(e[n],t[n]))return!1;return!0}ha.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,o=qt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};ha.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=qt.getMathType(this._type),i=this._isArray,o=qt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};ha.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?DRe(this,e):yee(this,e)};function DRe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=yee(e,t[i]);if(l(o))return o}}function yee(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return qt.isVectorType(n)?PRe(t,n,i):qt.isMatrixType(n)?ORe(t,n,i):n===qt.STRING?RRe(t):n===qt.BOOLEAN?MRe(t):n===qt.ENUM?LRe(t,o):NRe(t,i,r)}function PRe(e,t,n){if(!rn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===qt.VEC2&&!(e instanceof H))return`vector value ${e} must be a Cartesian2`;if(t===qt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===qt.VEC4&&!(e instanceof re))return`vector value ${e} must be a Cartesian4`}function ORe(e,t,n){if(!rn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===qt.MAT2&&!(e instanceof no))return`matrix value ${e} must be a Matrix2`;if(t===qt.MAT3&&!(e instanceof Z))return`matrix value ${e} must be a Matrix3`;if(t===qt.MAT4&&!(e instanceof L))return`matrix value ${e} must be a Matrix4`}function RRe(e){if(typeof e!="string")return iL(e,qt.STRING)}function MRe(e){if(typeof e!="boolean")return iL(e,qt.BOOLEAN)}function LRe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function NRe(e,t,n){let i=typeof e;switch(t){case rn.INT8:case rn.UINT8:case rn.INT16:case rn.UINT16:case rn.INT32:case rn.UINT32:case rn.FLOAT32:case rn.FLOAT64:return i!=="number"?iL(e,t):isFinite(e)?pee(e,t,n):_ee(e,t);case rn.INT64:case rn.UINT64:return i!=="number"&&i!=="bigint"?iL(e,t):i==="number"&&!isFinite(e)?_ee(e,t):pee(e,t,n)}}function iL(e,t){return`value ${e} does not match type ${t}`}function hee(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function pee(e,t,n){if(n){let i=rn.isUnsignedIntegerType(t)?0:-1,o=1;return e<i||e>o?hee(e,t,n):void 0}if(e<rn.getMinimum(t)||e>rn.getMaximum(t))return hee(e,t,n)}function _ee(e,t){return`value ${e} of type ${t} must be finite`}function T5(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=T5(e[i],t,n);return e}ha.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=ha.valueTransformInPlace(e[o],t[o],n[o],i);return e};var y0=ha;function KS(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===qt.STRING,d=r===qt.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(rn[_],rn.UINT32);let E=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new A5(o[E],_,t+1),p+=g.typedArray.byteLength}let h=qt.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let b=h*x,C;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(rn[_],rn.UINT32);let E=y(n.stringOffsets,n.stringOffsetBufferView);C=new A5(o[E],_,b+1),p+=C.typedArray.byteLength}(f||d)&&(c=rn.UINT8);let T;f?T=C.get(b)-C.get(0):d?T=Math.ceil(b/8):T=b;let A=y(n.values,n.bufferView),S=new A5(o[A],c,T);p+=S.typedArray.byteLength;let v=n.offset,I=n.scale,O=i.hasValueTransform||l(v)||l(I);v=y(v,i.offset),I=y(I,i.scale),v=xee(v),I=xee(I);let R,N,F=this;f?R=function(_){return kRe(_,F._values,F._stringOffsets)}:d?(R=function(_){return URe(_,F._values)},N=function(_,E){VRe(_,F._values,E)}):l(u)?(R=function(_){let E=F._values.get(_);return u.namesByValue[E]},N=function(_,E){let w=u.valuesByName[E];F._values.set(_,w)}):(R=function(_){return F._values.get(_)},N=function(_,E){F._values.set(_,E)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=h,this._min=n.min,this._max=n.max,this._offset=v,this._scale=I,this._hasValueTransform=O,this._getValue=R,this._setValue=N,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(KS.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});KS.prototype.get=function(e){let t=FRe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=XRe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};KS.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=KRe(this,t),t=n.unnormalize(t),BRe(this,e,t)};KS.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function xee(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function FRe(e,t){Cee(e)&&Tee(e);let n=e._classProperty,i=n.isArray,o=n.type,r=qt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ye(s,!0):s}return!i&&r===1?e._getValue(t):bee(e,n,t)}function bee(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=qt.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function BRe(e,t,n){qRe(e,t,n)&&Tee(e);let i=e._classProperty,o=i.isArray,r=i.type,s=qt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ye(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function kRe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Bl(t.typedArray,i,o)}function URe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function VRe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function zRe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function HRe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function GRe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function WRe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function jRe(e){switch(e){case rn.INT8:return X.BYTE;case rn.UINT8:return X.UNSIGNED_BYTE;case rn.INT16:return X.SHORT;case rn.UINT16:return X.UNSIGNED_SHORT;case rn.INT32:return X.INT;case rn.UINT32:return X.UNSIGNED_INT;case rn.FLOAT32:return X.FLOAT;case rn.FLOAT64:return X.DOUBLE}}function Cee(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===qt.STRING||i===rn.INT64&&!Wt.supportsBigInt64Array()||i===rn.UINT64&&!Wt.supportsBigUint64Array()}function qRe(e,t,n){if(Cee(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Tee(e){e._unpackedValues=YRe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function YRe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=qt.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=bee(e,i,a);return n}function XRe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:y0.valueTransformInPlace(t,e._offset,e._scale,rn.applyValueTransform)}function KRe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:y0.valueTransformInPlace(t,e._offset,e._scale,rn.unapplyValueTransform)}function A5(e,t,n){let i=this,o,r,s;if(t===rn.INT64)Wt.supportsBigInt()?Wt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return HRe(a,i)}):(Nt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return zRe(a,i)});else if(t===rn.UINT64)Wt.supportsBigInt()?Wt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return WRe(a,i)}):(Nt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return GRe(a,i)});else{let a=jRe(t);o=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var oL=KS;function qf(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new oL({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(qf.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});qf.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};qf.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};qf.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};qf.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=JRe(this._class,t),i};qf.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};qf.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};qf.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};qf.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};qf.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function JRe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ye(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Vl=qf;function z_(){}Object.defineProperties(z_.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});z_.prototype.load=function(){fe.throwInstantiationError()};z_.prototype.unload=function(){};z_.prototype.process=function(e){return!1};z_.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` +${t.message}`);let n=new de(e);return l(t)&&(n.stack=`Original stack: +${t.stack} +Handler stack: +${n.stack}`),n};z_.prototype.isDestroyed=function(){return!1};z_.prototype.destroy=function(){return this.unload(),ue(this)};var ro=z_;var ZRe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},It=Object.freeze(ZRe);function Jh(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Jh.prototype=Object.create(ro.prototype),Jh.prototype.constructor=Jh);Object.defineProperties(Jh.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Jh.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=$Re(this),this._promise)};async function $Re(e){let t=e._resource;e._state=It.LOADING;try{let n=await Jh._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=It.READY,e)}catch(n){if(e.isDestroyed())return;e._state=It.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Jh._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Jh.prototype.unload=function(){this._typedArray=void 0};var wC=Jh;var qWt=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiLQdilevlevlooroowwvbDDbelve9Weiiviebeoweuec:G;kekr;qiHo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbzl79IV9RbHDwebcekdXCq:fSQdbk:fxeYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:q:kjjbc:GeV86bbavcjdfcbcjdz:tjjjb8AdnaiTmbavcjdfadalzMjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0Ez:tjjjb8AavavcjdfalzMjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdz:tjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamz:tjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamz:tjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamz:tjjjb8AaXmekkcbhwaoal6mvxikindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamz:tjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falzMjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9Rgez:tjjjbaefhwkawaDcjdfalzMjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:q:kjjbk;use3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbydN:kjjbgrc;GeV86bbalc;abfcFecjez:tjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYcb9kaYaH9iGgoce7Gh3dndndndndnaYcbcsavEaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkkaLaO9havcm0Va5Vmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBdN:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRbN:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaicwfhiaDclfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8Kjjjjbk;TkdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Oefcbc;Kbz:tjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd1:kjjbHjjjjbbgeBd:OeavceBd1daeabaozMjjjb8Akavc:yefcwfcbBdbav9cb83i:yeavc:yefaeadaiavc:Oefz:njjjbcuaicdtgraicFFFFi0Egwcbyd1:kjjbHjjjjbbhoavc:Oefavyd1dgDcdtfaoBdbavaDcefgqBd1daoavyd:yegkarzMjjjbhxavc:Oefaqcdtfadci9Ugmcbyd1:kjjbHjjjjbbgoBdbavaDcdfgrBd1daocbamz:tjjjbhPavc:Oefarcdtfawcbyd1:kjjbHjjjjbbgsBdbavaDcifgqBd1daxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:OefaqcdtfcuamcdtadcFFFF970Ecbyd1:kjjbHjjjjbbgqBdbavaDclfBd1ddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;mbfhzavhoavyd:CehHavyd:GehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhKaoydbhdabaAcx2fgiclfaoclfydbgDBdbaiadBdbaicwfaKBdbaParfce86bbazaKBdwazaDBdlazadBdbaqarcdtfcbBdbdnawTmbcihQaXhiindnaiydbgoadSmbaoaDSmbaoaKSmbazaQcdtfaoBdbaQcefhQkaiclfhiawcufgwmbkkaAcefhAaxadcdtfgoaoydbcufBdbaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhoinasazaocdtfydbcdtgifgwIdbh8AawalcbaocefgDaocs0EcdtfIdbalaxaifydbgocwaocw6Ecdtfc;ebfIdbMgEUdbdnakaifydbgwTmbaEa8A:thEaOaHaifydbcdtfhoawcdthiinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDhoaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd1dhokaocdtavc:Oeffc98fhrdninaoTmearydbcbyd:e:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd1:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:tjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcifc98GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcrfc94GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:m:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:m:kjjbfgdBd:m:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Eddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkxebbbdbbbaWbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var x=p.charCodeAt(h);g[h]=x>96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h<p.length;++h)g[b++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,b)}function r(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g,h){var x=n.exports.sbrk,b=x(p.length*4),C=x(g*4),T=new Uint8Array(n.exports.memory.buffer),A=s(p);T.set(A,b),h&&h(b,b,p.length,g);var S=n.exports.meshopt_optimizeVertexFetchRemap(C,b,p.length,g);T=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(g);new Uint8Array(v.buffer).set(T.subarray(C,C+g*4)),A.set(T.subarray(b,b+p.length*4)),x(b-x(0));for(var I=0;I<p.length;++I)p[I]=v[p[I]];return[v,S]}function c(p,g,h,x,b){var C=n.exports.sbrk,T=C(g),A=C(x*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(h),A);var v=p(T,g,A,x,b),I=new Uint8Array(v);return I.set(S.subarray(T,T+v)),C(T-C(0)),I}function u(p){for(var g=0,h=0;h<p.length;++h){var x=p[h];g=g<x?x:g}return g}function f(p,g){if(r(g==2||g==4),g==4)return new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4);var h=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2);return new Uint32Array(h)}function d(p,g,h,x,b,C,T){var A=n.exports.sbrk,S=A(h*x),v=A(h*C),I=new Uint8Array(n.exports.memory.buffer);I.set(s(g),v),p(S,h,x,b,v,T);var O=new Uint8Array(h*x);return O.set(I.subarray(S,S+h*x)),A(S-A(0)),O}return{ready:i,supported:!0,reorderMesh:function(p,g,h){var x=g?h?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(p,u(p)+1,x)},encodeVertexBuffer:function(p,g,h){r(h>0&&h<=256),r(h%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(g,h);return c(n.exports.meshopt_encodeVertexBuffer,x,p,g,h)},encodeIndexBuffer:function(p,g,h){r(h==2||h==4),r(g%3==0);var x=f(p,h),b=n.exports.meshopt_encodeIndexBufferBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexBuffer,b,x,g,4)},encodeIndexSequence:function(p,g,h){r(h==2||h==4);var x=f(p,h),b=n.exports.meshopt_encodeIndexSequenceBound(g,u(x)+1);return c(n.exports.meshopt_encodeIndexSequence,b,x,g,4)},encodeGltfBuffer:function(p,g,h,x){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(b[x]),b[x](p,g,h)},encodeFilterOct:function(p,g,h,x){return r(h==4||h==8),r(x>=1&&x<=16),d(n.exports.meshopt_encodeFilterOct,p,g,h,x,16)},encodeFilterQuat:function(p,g,h,x){return r(h==8),r(x>=4&&x<=16),d(n.exports.meshopt_encodeFilterQuat,p,g,h,x,16)},encodeFilterExp:function(p,g,h,x,b){r(h>0&&h%4==0),r(x>=1&&x<=24);var C={Separate:0,SharedVector:1,SharedComponent:2};return d(n.exports.meshopt_encodeFilterExp,p,g,h,x,h,b?C[b]:1)}}}();var Aee=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?t:e,r,s=WebAssembly.instantiate(a(o),{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var T=new Uint8Array(C.length),A=0;A<C.length;++A){var S=C.charCodeAt(A);T[A]=S>96?S-97:S>64?S-39:S+4}for(var v=0,A=0;A<C.length;++A)T[v++]=T[A]<60?i[T[A]]:(T[A]-60)*64+T[++A];return T.buffer.slice(0,v)}function c(C,T,A,S,v,I){var O=r.exports.sbrk,R=A+3&-4,N=O(R*S),F=O(v.length),_=new Uint8Array(r.exports.memory.buffer);_.set(v,F);var E=C(N,A,S,F,v.length);if(E==0&&I&&I(N,R,S),T.set(_.subarray(N,N+A*S)),O(N-O(0)),E!=0)throw new Error("Malformed buffer data: "+E)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(C){var T={object:new Worker(C),pending:0,requests:{}};return T.object.onmessage=function(A){var S=A.data;T.pending-=S.count,T.requests[S.id][S.action](S.value),delete T.requests[S.id]},T}function h(C){for(var T="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(o))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+b.toString(),A=new Blob([T],{type:"text/javascript"}),S=URL.createObjectURL(A),v=0;v<C;++v)d[v]=g(S);URL.revokeObjectURL(S)}function x(C,T,A,S,v){for(var I=d[0],O=1;O<d.length;++O)d[O].pending<I.pending&&(I=d[O]);return new Promise(function(R,N){var F=new Uint8Array(A),_=p++;I.pending+=C,I.requests[_]={resolve:R,reject:N},I.object.postMessage({id:_,count:C,size:T,source:F,mode:S,filter:v},[F.buffer])})}function b(C){s.then(function(){var T=C.data;try{var A=new Uint8Array(T.count*T.size);c(r.exports[T.mode],A,T.count,T.size,T.source,r.exports[T.filter]),self.postMessage({id:T.id,count:T.count,action:"resolve",value:A},[A.buffer])}catch(S){self.postMessage({id:T.id,count:T.count,action:"reject",value:S})}})}return{ready:s,supported:!0,useWorkers:function(C){h(C)},decodeVertexBuffer:function(C,T,A,S,v){c(r.exports.meshopt_decodeVertexBuffer,C,T,A,S,r.exports[u[v]])},decodeIndexBuffer:function(C,T,A,S){c(r.exports.meshopt_decodeIndexBuffer,C,T,A,S)},decodeIndexSequence:function(C,T,A,S){c(r.exports.meshopt_decodeIndexSequence,C,T,A,S)},decodeGltfBuffer:function(C,T,A,S,v,I){c(r.exports[f[v]],C,T,A,S,r.exports[u[I]])},decodeGltfBufferAsync:function(C,T,A,S,v){return d.length>0?x(C,T,A,f[S],u[v]):s.then(function(){var I=new Uint8Array(C*T);return c(r.exports[f[S]],I,C,T,A,r.exports[u[v]]),I})}}}();var KWt=function(){"use strict";var e="b9H79TebbbecD9Geueu9Geub9Gbb9Gquuuuuuu99uueu9Gvuuuuub9Gluuuue999Giuuue999Gluuuueu9Giuuueuimxdilvorbwwbewlve9Weiiviebeoweuecj;jekr7oo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95beX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbla9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbvl79IV9RboDwebcekdDqq:XJxdbkp8WiKuP99Hu8Jjjjjbcj;bb9Rgq8KjjjjbaqcKfcbc;Kbz1jjjb8AaqcualcdtgkalcFFFFi0Egxcbyd;S1jjbHjjjjbbgmBdKaqceBd94aqamBdwaqaxcbyd;S1jjbHjjjjbbgPBd3aqcdBd94aqaPBdxaqcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbgsBdaaqciBd94aqasBdzaqcwfaeadalcbz:cjjjbaqaxcbyd;S1jjbHjjjjbbgzBd8KaqclBd94aqaxcbyd;S1jjbHjjjjbbgHBdyaqcvBd94alcd4alfhOcehAinaAgCcethAaCaO6mbkcbhXaqcuaCcdtgAaCcFFFFi0Ecbyd;S1jjbHjjjjbbgOBd8SaqcoBd94aOcFeaAz1jjjbhQdnalTmbavcd4hLaCcufhKinaiaXaL2cdtfgYydlgCcH4aC7c:F:b:DD2aYydbgCcH4aC7c;D;O:B8J27aYydwgCcH4aC7c:3F;N8N27hOcbhCdndninaQaOaKGgOcdtfg8AydbgAcuSmeaiaAaL2cdtfaYcxz:ljjjbTmdaCcefgCaOfhOaCaK9nmbxdkka8AaXBdbaXhAkazaXcdtfaABdbaXcefgXal9hmbkcbhCaHhAinaAaCBdbaAclfhAalaCcefgC9hmbkcbhCazhAaHhOindnaCaAydbgKSmbaOaHaKcdtfgKydbBdbaKaCBdbkaAclfhAaOclfhOalaCcefgC9hmbkkcbhOaqalcbyd;S1jjbHjjjjbbgYBd8WaqcrBd94aqaxcbyd;S1jjbHjjjjbbgCBd80aqcwBd94aqaxcbyd;S1jjbHjjjjbbgABdUaqcDBd94aCcFeakz1jjjbhEaAcFeakz1jjjbh3dnalTmbascwfh5indnamaOcdtgCfydbg8ETmbasaPaCfydbcitfh8Fa3aCfhaaEaCfhXcbhLindndna8FaLcitfydbgQaO9hmbaXaOBdbaaaOBdbxekdnamaQcdtgkfydbghTmbasaPakfydbcitgCfydbaOSmeahcufh8Aa5aCfhAcbhCina8AaCSmeaCcefhCaAydbhKaAcwfhAaKaO9hmbkaCah6meka3akfgCaOaQaCydbcuSEBdbaXaQaOaXydbcuSEBdbkaLcefgLa8E9hmbkkaOcefgOal9hmbkazhAaHhOa3hKaEhLcbhCindndnaCaAydbg8A9hmbdnaCaOydbg8A9hmbaLydbh8AdnaKydbgQcu9hmba8Acu9hmbaYaCfcb86bbxikaYaCfhXdnaCaQSmbaCa8ASmbaXce86bbxikaXcl86bbxdkdnaCaHa8AcdtgQfydb9hmbdnaKydbgXcuSmbaCaXSmbaLydbgkcuSmbaCakSmba3aQfydbg8EcuSmba8Ea8ASmbaEaQfydbgQcuSmbaQa8ASmbdnazaXcdtfydbazaQcdtfydb9hmbazakcdtfydbaza8Ecdtfydb9hmbaYaCfcd86bbxlkaYaCfcl86bbxikaYaCfcl86bbxdkaYaCfcl86bbxekaYaCfaYa8AfRbb86bbkaAclfhAaOclfhOaKclfhKaLclfhLalaCcefgC9hmbkawceGTmbaYhCalhAindnaCRbbce9hmbaCcl86bbkaCcefhCaAcufgAmbkkcbhLcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhmaqcKfaqyd94gCcdtfamBdbaqaCcefgABd94amaialavz:djjjb8AaqcKfaAcdtfcualc8S2gAalc;D;O;f8U0Ecbyd;S1jjbHjjjjbbgOBdbaqaCcdfBd94aOcbaAz1jjjbhsdnadTmbaehAindnamaAclfydbg8Acx2fgCIdbamaAydbgQcx2fgOIdbgg:tg8JamaAcwfydbgXcx2fgKIdlaOIdlg8K:tg8LNaKIdbag:tg8MaCIdla8K:tg8NN:tgyayNa8NaKIdwaOIdwg8P:tgINa8LaCIdwa8P:tg8NN:tg8La8LNa8Na8MNaIa8JN:tg8Ja8JNMM:rg8MJbbbb9ETmbaya8M:vhya8Ja8M:vh8Ja8La8M:vh8LkasazaQcdtfydbc8S2fgCa8La8M:rg8Ma8LNNg8NaCIdbMUdbaCa8Ja8Ma8JNg8RNgIaCIdlMUdlaCaya8MayNg8SNgRaCIdwMUdwaCa8Ra8LNg8RaCIdxMUdxaCa8Sa8LNg8UaCIdzMUdzaCa8Sa8JNg8SaCIdCMUdCaCa8La8Maya8PNa8LagNa8Ka8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCayagNgyaCIdaMUdaaCaga8KNggaCId8KMUd8KaCa8MaCIdyMUdyasaza8Acdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyasazaXcdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyaAcxfhAaLcifgLad6mbkcbh8AaehXincbhAinaYaeaAc:81jjbfydbgQa8AfcdtfydbgOfRbbhCdndnaYaXaAfydbgKfRbbgLc99fcFeGcpe0mbaCceSmbaCcd9hmekdnaLcufcFeGce0mbaEaKcdtfydbaO9hmekdnaCcufcFeGce0mba3aOcdtfydbaK9hmekdnaLcv2aCfc:G1jjbfRbbTmbazaOcdtfydbazaKcdtfydb0mekJbbacJbbjZaCceSEh8MaLceShkamaeaQcdtc:81jjbfydba8Afcdtfydbcx2fhCdnamaOcx2fgLIdwamaKcx2fgQIdwg8K:tg8La8LNaLIdbaQIdbg8P:tg8Ja8JNaLIdlaQIdlg8N:tgyayNMM:rggJbbbb9ETmba8Lag:vh8Layag:vhya8Jag:vh8JkJbbaca8MakEh8SdnaCIdwa8K:tg8Ma8La8Ma8LNaCIdba8P:tgRa8JNayaCIdla8N:tg8RNMMgIN:tg8Ma8MNaRa8JaIN:tg8La8LNa8RayaIN:tg8Ja8JNMM:rgyJbbbb9ETmba8May:vh8Ma8Jay:vh8Ja8Lay:vh8LkasazaKcdtfydbc8S2fgCa8La8SagNgya8LNNgIaCIdbMUdbaCa8Jaya8JNg8SNgRaCIdlMUdlaCa8Maya8MNggNg8RaCIdwMUdwaCa8Sa8LNg8SaCIdxMUdxaCaga8LNg8UaCIdzMUdzaCaga8JNg8VaCIdCMUdCaCa8Laya8Ma8KNa8La8PNa8Na8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCa8MagNg8MaCIdaMUdaaCaga8KNggaCId8KMUd8KaCayaCIdyMUdyasazaOcdtfydbc8S2fgCaIaCIdbMUdbaCaRaCIdlMUdlaCa8RaCIdwMUdwaCa8SaCIdxMUdxaCa8UaCIdzMUdzaCa8VaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCa8MaCIdaMUdaaCagaCId8KMUd8KaCayaCIdyMUdykaAclfgAcx9hmbkaXcxfhXa8Acifg8Aad6mbkkdnabaeSmbabaeadcdtz:hjjjb8Akcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaaqcKfaqyd94gCcdtfaaBdbaqaCcefgABd94aqcKfaAcdtfcuadcdtadcFFFFi0Ecbyd;S1jjbHjjjjbbg5BdbaqaCcdfgABd94aqcKfaAcdtfaxcbyd;S1jjbHjjjjbbgiBdbaqaCcifgABd94aqcKfaAcdtfalcbyd;S1jjbHjjjjbbg8WBdbaqaCclfBd94JbbbbhRdnadao9nmbararNh8Saacwfh8Xaqydwh8Yaqydxh8Zaqydzh80JbbbbhRinaqcwfabadgPalazz:cjjjbcbhhabhXcbhkincbhCindnazaXaCfydbgOcdtgefydbgLazabaCc:81jjbfydbakfcdtfydbgAcdtfydbg8ASmbaYaAfRbbgQcv2aYaOfRbbgKfc;q1jjbfRbbg8FaKcv2aQfg8Ec;q1jjbfRbbgdVcFeGTmbdna8Ec:G1jjbfRbbTmba8AaL0mekdnaKaQ9hmbaKcufcFeGce0mbaEaefydbaA9hmekaaahcx2fgKaAaOadcFeGgLEBdlaKaOaAaLEBdbaKaLa8FGcb9hBdwahcefhhkaCclfgCcx9hmbkaXcxfhXakcifgkaP6mbkdndnahTmbaahAahh8AinaAcwfgQJbbbbJbbjZasazaAydbgOcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaAclfgeydbgKcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNgyJbbbbJbbjZasazaKaOaQydbgLEgQcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaOaKaLEgXcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNg8Laya8L9FgCEUdbaeaKaXaCEBdbaAaOaQaCEBdbaAcxfhAa8Acufg8Ambkaqcjefcbcj;abz1jjjb8Aa8XhCahhAinaqcjefaCydbcO4c;8ZGfgOaOydbcefBdbaCcxfhCaAcufgAmbkcbhCcbhAinaqcjefaCfgOydbhKaOaABdbaKaAfhAaCclfgCcj;ab9hmbkcbhCa8XhAinaqcjefaAydbcO4c;8ZGfgOaOydbgOcefBdba5aOcdtfaCBdbaAcxfhAahaCcefgC9hmbkaPao9RgOci9Uh81dnalTmbcbhCaihAinaAaCBdbaAclfhAalaCcefgC9hmbkkcbhBa8Wcbalz1jjjbh83aOcO9UhUa81ce4h85cbh86cbhkdninaaa5akcdtfydbcx2fgXIdwg8Ja8S9Emea86a819pmeJFFuuh8Ldna85ah9pmbaaa5a85cdtfydbcx2fIdwJbb;aZNh8Lkdna8Ja8L9ETmba86aU0mdkdna83azaXydlg87cdtg88fydbgOfg89Rbba83azaXydbgecdtg8:fydbgZfgnRbbVmbdna8YaZcdtgCfydbgKTmba80a8ZaCfydbcitfhCamaOcx2fg8Ecwfhda8EclfhxamaZcx2fg8Fcwfhva8FclfhwcbhAcehQdnindnaiaCydbcdtfydbgLaOSmbaiaCclfydbcdtfydbg8AaOSmbama8Acx2fg8AIdbamaLcx2fgLIdbg8M:tg8LawIdbaLIdlgy:tggNa8FIdba8M:tg8Ka8AIdlay:tg8JN:ta8LaxIdbay:tg8PNa8EIdba8M:tg8Na8JN:tNa8JavIdbaLIdwgy:tgINaga8AIdway:tg8MN:ta8JadIdbay:tgyNa8Pa8MN:tNa8Ma8KNaIa8LN:ta8Ma8NNaya8LN:tNMMJbbbb9DmdkaCcwfhCaAcefgAaK6hQaKaA9hmbkkaQceGTmba85cefh85xekaXcwfhKasaOc8S2fgCasaZc8S2fgAIdbaCIdbMUdbaCaAIdlaCIdlMUdlaCaAIdwaCIdwMUdwaCaAIdxaCIdxMUdxaCaAIdzaCIdzMUdzaCaAIdCaCIdCMUdCaCaAIdKaCIdKMUdKaCaAId3aCId3MUd3aCaAIdaaCIdaMUdaaCaAId8KaCId8KMUd8KaCaAIdyaCIdyMUdydndndndnaYaefgARbbc9:fPdebdkaehCinaiaCcdtgCfaOBdbaHaCfydbgCae9hmbxikkaHa88fydbhCaHa8:fydbheaia8:fa87BdbaCh87kaiaecdtfa87Bdbkance86bba89ce86bbaKIdbg8LaRaRa8L9DEhRaBcefhBcecdaARbbceSEa86fh86kakcefgkah9hmbkkaBTmbdnalTmbcbhAaEhCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmbaEaKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkcbhAa3hCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmba3aKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkkcbhdabhCcbhLindnaiaCydbcdtfydbgAaiaCclfydbcdtfydbgOSmbaAaiaCcwfydbcdtfydbgKSmbaOaKSmbabadcdtfg8AaABdba8AclfaOBdba8AcwfaKBdbadcifhdkaCcxfhCaLcifgLaP9pmdxbkkaPhdxdkadao0mbkkdnaDTmbaDaR:rUdbkaqyd94gCcdtaqcKffc98fhzdninaCTmeazydbcbyd;W1jjbH:bjjjbbazc98fhzaCcufhCxbkkaqcj;bbf8Kjjjjbadk;pleouabydbcbaicdtz1jjjb8Aadci9UhvdnadTmbabydbhodnalTmbaehradhwinaoalarydbcdtfydbcdtfgDaDydbcefBdbarclfhrawcufgwmbxdkkaehradhwinaoarydbcdtfgDaDydbcefBdbarclfhrawcufgwmbkkdnaiTmbabydbhrabydlhwcbhDaihoinawaDBdbawclfhwarydbaDfhDarclfhraocufgombkkdnadci6mbavceavce0EhqabydlhvabydwhrinaecwfydbhwaeclfydbhDaeydbhodnalTmbalawcdtfydbhwalaDcdtfydbhDalaocdtfydbhokaravaocdtfgdydbcitfaDBdbaradydbcitfawBdladadydbcefBdbaravaDcdtfgdydbcitfawBdbaradydbcitfaoBdladadydbcefBdbaravawcdtfgwydbcitfaoBdbarawydbcitfaDBdlawawydbcefBdbaecxfheaqcufgqmbkkdnaiTmbabydlhrabydbhwinararydbawydb9RBdbawclfhwarclfhraicufgimbkkk:3ldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkaPk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz1jjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;01jjbgeabcifc98GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;01jjbgeabcrfc94GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;01jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;01jjbfgdBd;01jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:cedbcjwk9PFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbc;Swkxebbbdbbbj9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function o(p){for(var g=new Uint8Array(p.length),h=0;h<p.length;++h){var x=p.charCodeAt(h);g[h]=x>96?x-97:x>64?x-39:x+4}for(var b=0,h=0;h<p.length;++h)g[b++]=g[h]<60?t[g[h]]:(g[h]-60)*64+g[++h];return g.buffer.slice(0,b)}function r(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,g){var h=n.exports.sbrk,x=h(p.length*4),b=h(g*4),C=new Uint8Array(n.exports.memory.buffer),T=s(p);C.set(T,x);var A=n.exports.meshopt_optimizeVertexFetchRemap(b,x,p.length,g);C=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(g);new Uint8Array(S.buffer).set(C.subarray(b,b+g*4)),T.set(C.subarray(x,x+p.length*4)),h(x-h(0));for(var v=0;v<p.length;++v)p[v]=S[p[v]];return[S,A]}function c(p){for(var g=0,h=0;h<p.length;++h){var x=p[h];g=g<x?x:g}return g}function u(p,g,h,x,b,C,T,A,S){var v=n.exports.sbrk,I=v(4),O=v(h*4),R=v(b*C),N=v(h*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(x),R),F.set(s(g),N);var _=p(O,N,h,R,b,C,T,A,S,I);F=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(_);s(E).set(F.subarray(O,O+_*4));var w=new Float32Array(1);return s(w).set(F.subarray(I,I+4)),v(I-v(0)),[E,w[0]]}function f(p,g,h,x){var b=n.exports.sbrk,C=b(h*x),T=new Uint8Array(n.exports.memory.buffer);T.set(s(g),C);var A=p(C,h,x);return b(C-b(0)),A}var d={LockBorder:1};return{ready:i,supported:!0,compactMesh:function(p){r(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),r(p.length%3==0);var g=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return a(g,c(p)+1)},simplify:function(p,g,h,x,b,C){r(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),r(p.length%3==0),r(g instanceof Float32Array),r(g.length%h==0),r(h>=3),r(x%3==0),r(b>=0&&b<=1);for(var T=0,A=0;A<(C?C.length:0);++A)T|=d[C[A]];var S=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),v=u(n.exports.meshopt_simplify,S,p.length,g,g.length/h,h*4,x,b,T);return v[0]=p instanceof Uint32Array?v[0]:new p.constructor(v[0]),v},getScale:function(p,g){return r(p instanceof Float32Array),r(p.length%g==0),f(n.exports.meshopt_simplifyScale,p,p.length/g,g*4)}}}();function x0(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,h,x;if(ii(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),f=C.byteLength,d=!0,p=C.byteStride,g=C.count,h=C.mode,x=y(C.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=h,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(x0.prototype=Object.create(ro.prototype),x0.prototype.constructor=x0);Object.defineProperties(x0.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function QRe(e){try{let t=eMe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);Aee.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=It.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=It.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}x0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=QRe(this),this._promise)};function eMe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}x0.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var JS=x0;function Ba(){}Ba._maxDecodingConcurrency=Math.max(Wt.hardwareConcurrency-1,1);Ba._decoderTaskProcessor=void 0;Ba._taskProcessorReady=!1;Ba._getDecoderTaskProcessor=function(){if(!l(Ba._decoderTaskProcessor)){let e=new yi("decodeDraco",Ba._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Ba._taskProcessorReady=!0}),Ba._decoderTaskProcessor=e}return Ba._decoderTaskProcessor};Ba.decodePointCloud=function(e){let t=Ba._getDecoderTaskProcessor();if(Ba._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ba.decodeBufferView=function(e){let t=Ba._getDecoderTaskProcessor();if(Ba._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var H_=Ba;function G_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=It.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(G_.prototype=Object.create(ro.prototype),G_.prototype.constructor=G_);Object.defineProperties(G_.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function tMe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=It.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Eee(e,n)}}G_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=tMe(this),this._promise)};function Eee(e,t){e.unload(),e._state=It.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function nMe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=It.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}G_.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.PROCESSING||(l(this._dracoError)&&Eee(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=H_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=nMe(this,c)};G_.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var ZS=G_;function iMe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new ve({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var IC=iMe;function Zh(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Zh.prototype=Object.create(ro.prototype),Zh.prototype.constructor=Zh);Object.defineProperties(Zh.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Zh.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=oMe(this),this._promise):(this._promise=rMe(this),this._promise)};function See(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function oMe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await aMe(i);if(e.isDestroyed())return;let r=See(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(n){return e.isDestroyed()?void 0:vee(e,n,"Failed to load embedded image")}}async function rMe(e){e._state=It.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await lMe(i);if(e.isDestroyed())return;let r=See(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(o){return e.isDestroyed()?void 0:vee(e,o,`Failed to load image: ${n}`)}}function vee(e,t,n){return e.unload(),e._state=It.FAILED,Promise.reject(e.getError(n,t))}function sMe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function aMe(e){let t=sMe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Rl(n)}return Zh._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var cMe=/(^data:image\/ktx2)|(\.ktx2$)/i;function lMe(e){let t=e.getUrlComponent(!1,!0);return cMe.test(t)?Rl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Zh.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Zh._loadImageFromTypedArray=IC;var $S=Zh;var uMe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},ka=Object.freeze(uMe);function W_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(W_.prototype=Object.create(ro.prototype),W_.prototype.constructor=W_);Object.defineProperties(W_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var fMe=new S5;W_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=dMe(this),this._promise):(this._promise=mMe(this),this._promise)};async function dMe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=It.LOADED,e)}catch(n){if(e.isDestroyed())return;E5(e,n)}}async function mMe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=It.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=hMe(e,a),e._state=It.PROCESSING,e}catch(s){if(e.isDestroyed())return;E5(e,s)}}function hMe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ue.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Q("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function E5(e,t){e.unload(),e._state=It.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function S5(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}S5.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};S5.prototype.execute=function(){this.buffer=wee(this.typedArray,this.indexDatatype,this.context)};function wee(e,t,n){let i=ht.createIndexBuffer({typedArray:e,context:n,usage:ke.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}W_.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){E5(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=fMe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,ka.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=wee(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=It.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};W_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var QS=W_;function pMe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var xs=pMe;function _Me(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var hr=_Me;function Yt(){}Yt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Yt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};Yt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Yt.objectLegacy(i,n):Yt.object(i,n)};Yt.accessor=function(e,t){return Yt.topLevel(e,"accessors",t)};Yt.accessorWithSemantic=function(e,t,n){let i={};return Yt.mesh(e,function(o){return Yt.meshPrimitive(o,function(r){let s=Yt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:Yt.meshPrimitiveTarget(r,function(a){return Yt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Yt.accessorContainingVertexAttributeData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(o){let r=Yt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Yt.meshPrimitiveTarget(o,function(s){return Yt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Yt.accessorContainingIndexData=function(e,t){let n={};return Yt.mesh(e,function(i){return Yt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};Yt.animation=function(e,t){return Yt.topLevel(e,"animations",t)};Yt.animationChannel=function(e,t){let n=e.channels;return Yt.object(n,t)};Yt.animationSampler=function(e,t){let n=e.samplers;return Yt.object(n,t)};Yt.buffer=function(e,t){return Yt.topLevel(e,"buffers",t)};Yt.bufferView=function(e,t){return Yt.topLevel(e,"bufferViews",t)};Yt.camera=function(e,t){return Yt.topLevel(e,"cameras",t)};Yt.image=function(e,t){return Yt.topLevel(e,"images",t)};Yt.material=function(e,t){return Yt.topLevel(e,"materials",t)};Yt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Yt.mesh=function(e,t){return Yt.topLevel(e,"meshes",t)};Yt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};Yt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Yt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};Yt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};Yt.node=function(e,t){return Yt.topLevel(e,"nodes",t)};Yt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=Yt.nodeInTree(e,u,n),l(c)))return c}}}};Yt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Yt.nodeInTree(e,i,n)};Yt.program=function(e,t){return hr(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.programs,t):Yt.topLevel(e,"programs",t)};Yt.sampler=function(e,t){return Yt.topLevel(e,"samplers",t)};Yt.scene=function(e,t){return Yt.topLevel(e,"scenes",t)};Yt.shader=function(e,t){return hr(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.shaders,t):Yt.topLevel(e,"shaders",t)};Yt.skin=function(e,t){return Yt.topLevel(e,"skins",t)};Yt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};Yt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Yt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Yt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Yt.technique=function(e,t){return hr(e,"KHR_techniques_webgl")?Yt.object(e.extensions.KHR_techniques_webgl.techniques,t):Yt.topLevel(e,"techniques",t)};Yt.texture=function(e,t){return Yt.topLevel(e,"textures",t)};var Re=Yt;function gMe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ku=gMe;function yMe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*ku(t.type)}var zl=yMe;function xMe(e){Re.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Re.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=xs(e.materials,o)}})}),Re.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=zl(e,i),r.target=te.ARRAY_BUFFER}}),Re.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Re.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Re.materialValue(n,function(c){l(c.index)&&b0(c)}),b0(n.emissiveTexture),b0(n.normalTexture),b0(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),b0(s.baseColorTexture),b0(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),b0(a.specularGlossinessTexture))}),Re.animation(e,function(n){Re.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=bMe(e);return Re.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Re.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function bMe(e){let t={};return Re.animation(e,function(n){Re.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function b0(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var rL=xMe;function CMe(e){return Re.shader(e,function(t){sL(t)}),Re.buffer(e,function(t){sL(t)}),Re.image(e,function(t){sL(t)}),sL(e),e}function sL(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var C0=CMe;function TMe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var aL=TMe;function AMe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),aL(e,t),n.length===0&&delete e.extensionsUsed}}var DC=AMe;var EMe=4;function SMe(e){if(ym(e)!=="glTF")throw new de("File is not valid binary glTF");let n=Iee(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?vMe(e,n):wMe(e,n)}function Iee(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*EMe,!0);return o}function vMe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new de("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Bl(e,r,i),c=JSON.parse(a);C0(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return DC(c,"KHR_binary_glTF"),c}function wMe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Iee(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Bl(u);o=JSON.parse(f),C0(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var cL=SMe;function IMe(e){return Re.shader(e,function(t){lL(t)}),Re.buffer(e,function(t){lL(t)}),Re.image(e,function(t){lL(t)}),lL(e),e}function lL(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var uL=IMe;function DMe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),xs(n,t,!0)}var Yf=DMe;function PMe(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case X.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case X.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case X.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case X.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case X.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case X.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var j_=PMe;function OMe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=ku(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=zl(e,t),h=t.byteOffset+c.byteOffset+d.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),C=new DataView(d.buffer),T=new Array(r),A=j_(x);for(let S=0;S<p;S++){A(C,h,r,b,T);for(let v=0;v<r;v++){let I=T[v];s[v]=Math.min(s[v],I),a[v]=Math.max(a[v],I)}h+=g}return{min:s,max:a}}var PC=OMe;var RMe=[te.FUNC_ADD,te.FUNC_ADD],MMe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Dee(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var LMe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function NMe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(LMe.indexOf(e[n])===-1)return t;return e}function FMe(e){let t={},n={},i=e.techniques;return l(i)&&(Re.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Dee(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,RMe),blendFactors:NMe(c.blendFuncSeparate,MMe)})}Dee(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Yf(e,"KHR_blend")),Re.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Re.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var fL=FMe;function BMe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),xs(n,t,!0),Yf(e,t)}var dL=BMe;function kMe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Re.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Re.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Re.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=xs(r.shaders,g,!0);let h=e.shaders[d.vertexShader];p.vertexShader=xs(r.shaders,h,!0),u.program=xs(r.programs,p),o[a.program]=u.program}i[c]=xs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Yf(e,"KHR_techniques_webgl"),dL(e,"KHR_techniques_webgl"))}return Re.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Re.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var mL=kMe;function UMe(e,t){wl.typeOf.object("material",e),wl.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,u=r.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Re.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var ev=UMe;var Pee=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function VMe(e,t){return t=y(t,Pee),Pee.forEach(function(n){t.indexOf(n)>-1&&HMe(e,n)}),e}var zMe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function HMe(e,t){let n=zMe[t],i=e[n];if(l(i)){let o=0,r=bm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(xm[t](e,a-o),o++)}}function xm(){}xm.accessor=function(e,t){e.accessors.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){Re.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Re.meshPrimitiveTarget(o,function(a){Re.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Re.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Re.animation(e,function(i){Re.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};xm.buffer=function(e,t){e.buffers.splice(t,1),Re.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};xm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Re.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),hr(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),hr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(hr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};xm.image=function(e,t){e.images.splice(t,1),Re.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};xm.mesh=function(e,t){e.meshes.splice(t,1),Re.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};xm.node=function(e,t){e.nodes.splice(t,1),Re.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Re.animation(e,function(i){Re.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Re.technique(e,function(i){Re.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Re.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Re.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};xm.material=function(e,t){e.materials.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};xm.sampler=function(e,t){e.samplers.splice(t,1),Re.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};xm.texture=function(e,t){if(e.textures.splice(t,1),Re.material(e,function(i){ev(i,function(o,r){r.index>t&&--r.index})}),hr(e,"EXT_feature_metadata")){Re.mesh(e,function(r){Re.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(hr(e,"EXT_mesh_features")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),hr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function bm(){}bm.accessor=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Re.meshPrimitiveTarget(i,function(r){Re.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Re.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Re.animation(e,function(n){Re.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),hr(e,"EXT_mesh_gpu_instancing")&&Re.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),hr(e,"CESIUM_primitive_outline")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};bm.buffer=function(e){let t={};return Re.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};bm.bufferView=function(e){let t={};if(Re.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),hr(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),hr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(hr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};bm.image=function(e){let t={};return Re.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};bm.mesh=function(e){let t={};return Re.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Oee(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Oee(e,o,n)}).length===0}bm.node=function(e){let t={};return Re.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Re.skinJoint(n,function(i){t[i]=!0})}),Re.animation(e,function(n){Re.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Re.technique(e,function(n){Re.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Re.node(e,function(n,i){Oee(e,i,t)||(t[i]=!0)}),t};bm.material=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bm.texture=function(e){let t={};if(Re.material(e,function(n){ev(n,function(i){t[i]=!0})}),hr(e,"EXT_feature_metadata")){Re.mesh(e,function(o){Re.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(hr(e,"EXT_mesh_features")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),hr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};bm.sampler=function(e){let t={};return Re.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var hL=VMe;function GMe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:xs(e.buffers,n),byteOffset:0,byteLength:t.length};return xs(e.bufferViews,o)}var pL=GMe;function WMe(e,t){let n=zl(e,t),i=X.getSizeInBytes(t.componentType),o=ku(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=j_(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,d);for(let h=0;h<o;++h)s[g*o+h]=d[h];u+=n}return s}var _L=WMe;function jMe(e){let t;return Re.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?gL(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&gL(e,i,X.UNSIGNED_SHORT)}),Re.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?gL(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&gL(e,i,X.UNSIGNED_SHORT)}),e}function gL(e,t,n){let i=X.createTypedArray(n,_L(e,t)),o=new Uint8Array(i.buffer);t.bufferView=pL(e,o),t.componentType=n,t.byteOffset=0}var yL=jMe;function qMe(e,t){return DC(e,t),t==="CESIUM_RTC"&&YMe(e),v5(e,t)}function YMe(e){Re.technique(e,function(t){Re.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function v5(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)v5(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&v5(e[o],t);return i}}var OC=qMe;var xL={.8:QMe,"1.0":bLe,"2.0":void 0};function XMe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(xL,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(xL,i)||(i="1.0"));let o=xL[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=xL[i];return t.keepLegacyExtensions||(ALe(e,t),ELe(e)),e}function Mee(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function KMe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function JMe(e){let t=e.nodes,n=new m,i=new Be;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;m.fromArray(a,0,n),Be.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function ZMe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new m,a=new Be;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let h=0;h<g;++h){let x=f[h];if(x.target.path==="rotation"){let b=d[p[x.sampler].output];if(l(r[b]))continue;r[b]=!0;let C=n[b],T=i[C.bufferView],S=o[T.buffer].extras._pipeline.source,v=S.byteOffset+T.byteOffset+C.byteOffset,I=C.componentType,O=C.count,R=ku(C.type),N=C.count*R,F=X.createArrayBufferView(I,S.buffer,v,N);for(let _=0;_<O;_++){let E=_*R;m.unpack(F,E,s);let w=F[E+3];Be.fromAxisAngle(s,w,a),Be.pack(a,F,E)}}}}}}function $Me(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function QMe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Mee(e),KMe(e),JMe(e),ZMe(e),$Me(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Yf(e,"KHR_materials_common")}}function eLe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Ree(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function tLe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Ree(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Re.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Re.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Re.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Re.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Re.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Re.mesh(e,function(s){Re.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Re.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Re.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=xs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Re.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Re.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Re.animation(e,function(s){let a={};s.samplers=Ree(s.samplers,a),Re.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Re.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Re.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Re.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Re.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Re.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Re.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function nLe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){delete n.name})})}function iLe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Re.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function oLe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var rLe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function sLe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(rLe[o])&&e.extensionsRequired.push(o)}}}function aLe(e){Re.buffer(e,function(t){delete t.type})}function cLe(e){Re.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function lLe(e){Re.mesh(e,function(t){Re.meshPrimitive(t,function(n){Re.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Re.technique(e,function(t){Re.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var uLe={POSITION:!0,NORMAL:!0,TANGENT:!0},fLe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function dLe(e){let t={};Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=fLe[a];l(f)?(u=f+c,t[r]=u):l(uLe[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Re.technique(e,function(n){Re.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function mLe(e){Re.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function w5(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:zl(e,t)}function hLe(e){Re.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Re.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=w5(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function pLe(e){let t,n,i,o=e.bufferViews,r={};Re.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Re.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=w5(e,p),h=p.byteOffset,x=p.count*g;delete p.byteStride;let b=t<d-1,C=b?w5(e,c[t+1]):void 0;if(g!==C){let T=Ye(i,!0);r[a]&&(T.byteStride=g),T.byteOffset+=u,T.byteLength=h+x-u;let A=xs(o,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=A,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}hL(e,["accessor","bufferView","buffer"])}function _Le(e){Re.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=PC(e,n);n.min=i.min,n.max=i.max}})}function Lee(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||re.fromArray(e.rotation).equals(new re(0,0,0,1)))&&(!l(e.matrix)||L.fromColumnMajorArray(e.matrix).equals(L.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Nee(e,t){Re.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Re.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Lee(n)&&Nee(e,i))}}),delete e.nodes[t]}function gLe(e){return Re.node(e,function(t,n){Lee(t)&&Nee(e,n)}),e}function yLe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=PC(e,i);i.min=o.min,i.max=o.max}})})}function xLe(e){Re.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=PC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function bLe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Mee(e),eLe(e),gLe(e),tLe(e),nLe(e),oLe(e),sLe(e),hLe(e),pLe(e),_Le(e),yLe(e),xLe(e),aLe(e),cLe(e),lLe(e),dLe(e),yL(e),mLe(e),fL(e),mL(e),iLe(e)}var CLe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],TLe=["u_diffuse","u_diffuse_mat"];function I5(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function bL(e){return l(e.index)}function CL(e){return Array.isArray(e)&&e.length===4}function Fee(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function ALe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,CLe),i=y(t.baseColorFactorNames,TLe);Re.material(e,function(o){Re.materialValue(o,function(r,s){n.indexOf(s)!==-1&&bL(r)?(I5(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&CL(r)&&(I5(o),o.pbrMetallicRoughness.baseColorFactor=Fee(r))})}),OC(e,"KHR_techniques_webgl"),OC(e,"KHR_blend")}function ELe(e){Re.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(Yf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,u=n.doubleSided,f=n.transparent;I5(t),l(r)&&(CL(r)?t.emissiveFactor=r.slice(0,3):bL(r)&&(t.emissiveTexture=r)),l(s)&&(CL(s)?t.pbrMetallicRoughness.baseColorFactor=Fee(s):bL(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(CL(a)?t.emissiveFactor=a.slice(0,3):bL(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),OC(e,"KHR_materials_common")}var TL=XMe;var oi={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function SLe(e){switch(e){case oi.POSITION:return"positionMC";case oi.NORMAL:return"normalMC";case oi.TANGENT:return"tangentMC";case oi.TEXCOORD:return"texCoord";case oi.COLOR:return"color";case oi.JOINTS:return"joints";case oi.WEIGHTS:return"weights";case oi.FEATURE_ID:return"featureId"}}oi.hasSetIndex=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return!1;case oi.TEXCOORD:case oi.COLOR:case oi.JOINTS:case oi.WEIGHTS:case oi.FEATURE_ID:return!0}};oi.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return oi.POSITION;case"NORMAL":return oi.NORMAL;case"TANGENT":return oi.TANGENT;case"TEXCOORD":return oi.TEXCOORD;case"COLOR":return oi.COLOR;case"JOINTS":return oi.JOINTS;case"WEIGHTS":return oi.WEIGHTS;case"_FEATURE_ID":return oi.FEATURE_ID}};oi.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return oi.POSITION;case"RGBA":case"RGB":case"RGB565":return oi.COLOR;case"NORMAL":case"NORMAL_OCT16P":return oi.NORMAL;case"BATCH_ID":return oi.FEATURE_ID}};oi.getGlslType=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return"vec3";case oi.TEXCOORD:return"vec2";case oi.COLOR:return"vec4";case oi.JOINTS:return"ivec4";case oi.WEIGHTS:return"vec4";case oi.FEATURE_ID:return"int"}};oi.getVariableName=function(e,t){let n=SLe(e);return l(t)&&(n+=`_${t}`),n};var Et=Object.freeze(oi);function Ua(){}Ua.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let o=new de(i);return l(n)&&(o.stack=`Original stack: +${n.stack} +Handler stack: +${o.stack}`),o};Ua.getNodeTransform=function(e){return l(e.matrix)?e.matrix:L.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:Be.IDENTITY,l(e.scale)?e.scale:m.ONE)};Ua.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Ua.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};Ua.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Ua.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Ua.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=Et.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=ln.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":ln.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var vLe=new m,wLe=new m;Ua.getPositionMinMax=function(e,t,n){let i=Ua.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=m.add(r,t,wLe),o=m.add(o,n,vLe)),{min:r,max:o}};Ua.getAxisCorrectionMatrix=function(e,t,n){return n=L.clone(L.IDENTITY,n),e===_o.Y?n=L.clone(_o.Y_UP_TO_Z_UP,n):e===_o.X&&(n=L.clone(_o.X_UP_TO_Z_UP,n)),t===_o.Z&&(n=L.multiplyTransformation(n,_o.Z_UP_TO_X_UP,n)),n};var ILe=new Z;Ua.getCullFace=function(e,t){if(!Fe.isTriangles(t))return gi.BACK;let n=L.getMatrix3(e,ILe);return Z.determinant(n)<0?gi.FRONT:gi.BACK};Ua.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Ua.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Ua.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Ua.supportedExtensions[i])throw new de(`Unsupported glTF Extension: ${i}`)}};var en=Ua;function q_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(q_.prototype=Object.create(ro.prototype),q_.prototype.constructor=q_);Object.defineProperties(q_.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});q_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,l(this._gltfJson)?(this._promise=Bee(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=kee(this,this._typedArray),this._promise):(this._promise=DLe(this),this._promise))};async function DLe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;D5(e,n)}return kee(e,t)}function D5(e,t){e.unload(),e._state=It.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function PLe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!hr(t,"KHR_techniques_webgl")&&!hr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Re.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),TL(t)}function OLe(e){let t=[];return Re.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&m_(i)&&(delete n.uri,t.push(ve.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function RLe(e,t){let n=[];return Re.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Bee(e,t){try{C0(t),await OLe(t),await PLe(e,t),rL(t),await RLe(e,t),uL(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new de(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&en.checkSupportedExtensions(i),e._gltf=t,e._state=It.READY,e}catch(n){if(e.isDestroyed())return;D5(e,n)}}async function kee(e,t){let n;try{ym(t)==="glTF"?n=cL(t):n=Mo(t)}catch(i){if(e.isDestroyed())return;D5(e,i)}return Bee(e,n)}q_.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};q_.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var tv=q_;var MLe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},$h=Object.freeze(MLe);var Ho={};function LLe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function NLe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function FLe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function BLe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function kLe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function ULe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function VLe(){this.attributes=[]}function zLe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function HLe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function GLe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function WLe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function jLe(){this.nodes=[]}var qLe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function YLe(){this.input=[],this.interpolation=void 0,this.output=[]}function XLe(){this.node=void 0,this.path=void 0}function KLe(){this.sampler=void 0,this.target=void 0}function JLe(){this.name=void 0,this.samplers=[],this.channels=[]}function ZLe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function $Le(){this.name=void 0,this.stages=[]}function Uee(){this.credits=[]}function QLe(){this.asset=new Uee,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=L.clone(L.IDENTITY)}function eNe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.channels=void 0}function Y_(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=re.clone(Y_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Y_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Y_.DEFAULT_ROUGHNESS_FACTOR}Y_.DEFAULT_BASE_COLOR_FACTOR=re.ONE;Y_.DEFAULT_METALLIC_FACTOR=1;Y_.DEFAULT_ROUGHNESS_FACTOR=1;function T0(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=re.clone(T0.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(T0.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=T0.DEFAULT_GLOSSINESS_FACTOR}T0.DEFAULT_DIFFUSE_FACTOR=re.ONE;T0.DEFAULT_SPECULAR_FACTOR=m.ONE;T0.DEFAULT_GLOSSINESS_FACTOR=1;function P5(){this.metallicRoughness=new Y_,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(P5.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=$h.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}P5.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Ho.Quantization=LLe;Ho.Attribute=NLe;Ho.Indices=FLe;Ho.FeatureIdAttribute=BLe;Ho.FeatureIdTexture=ULe;Ho.FeatureIdImplicitRange=kLe;Ho.MorphTarget=VLe;Ho.Primitive=zLe;Ho.Instances=HLe;Ho.Skin=GLe;Ho.Node=WLe;Ho.Scene=jLe;Ho.AnimatedPropertyType=Object.freeze(qLe);Ho.AnimationSampler=YLe;Ho.AnimationTarget=XLe;Ho.AnimationChannel=KLe;Ho.Animation=JLe;Ho.ArticulationStage=ZLe;Ho.Articulation=$Le;Ho.Asset=Uee;Ho.Components=QLe;Ho.TextureReader=eNe;Ho.MetallicRoughness=Y_;Ho.SpecularGlossiness=T0;Ho.Material=P5;var Ft=Ho;var AL={};AL.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};AL.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=y(e.compressedTextureNoMipmap,!1),o=On.REPEAT,r=On.REPEAT,s=un.LINEAR,a=Si.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let g=t.samplers[f];o=y(g.wrapS,o),r=y(g.wrapT,r),s=y(g.minFilter,s),a=y(g.magFilter,a)}let d=!1,p=n.extensions;return l(p)&&l(p.KHR_texture_transform)&&(d=!0),(i||d)&&s!==un.LINEAR&&s!==un.NEAREST&&(s===un.NEAREST_MIPMAP_NEAREST||s===un.NEAREST_MIPMAP_LINEAR?s=un.NEAREST:s=un.LINEAR),new hn({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var tNe=new H(1,1);AL.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,o=y(t.texCoord,0),r,s=y(t.extensions,y.EMPTY_OBJECT).KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?H.unpack(s.offset):H.ZERO,u=y(s.rotation,0),f=l(s.scale)?H.unpack(s.scale):tNe;u=-u,r=new Z(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new Ft.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.transform=r,a.channels=n,a};var Hl=AL;function nNe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var A0=nNe;function X_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=Hl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(X_.prototype=Object.create(ro.prototype),X_.prototype.constructor=X_);Object.defineProperties(X_.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var iNe=new O5;async function oNe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=It.LOADED,e)}catch(n){if(e.isDestroyed())return;e.unload(),e._state=It.FAILED;let i="Failed to load texture";throw e.getError(i,n)}}X_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=oNe(this),this._promise)};function O5(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}O5.prototype.set=function(e,t,n,i,o){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=o};O5.prototype.execute=function(){this.texture=Vee(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function Vee(e,t,n,i,o){let r=n.internalFormat,s=!1;lt.isCompressedFormat(r)&&!l(i)&&(s=!0);let a=Hl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,u=a.wrapS,f=a.wrapT,d=c===un.NEAREST_MIPMAP_NEAREST||c===un.NEAREST_MIPMAP_LINEAR||c===un.LINEAR_MIPMAP_NEAREST||c===un.LINEAR_MIPMAP_LINEAR,p=!l(r)&&d,g=p||u===On.REPEAT||u===On.MIRRORED_REPEAT||f===On.REPEAT||f===On.MIRRORED_REPEAT,h=!P.isPowerOfTwo(n.width)||!P.isPowerOfTwo(n.height),x=g&&h,b;return l(r)?(!o.webgl2&<.isCompressedFormat(r)&&h&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Lt.create({context:o,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=A0(n)),b=Lt.create({context:o,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&b.generateMipmap(),b}X_.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=It.PROCESSING;let t;if(this._asynchronous){let n=iNe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,ka.TEXTURE))return;t=n.texture}else t=Vee(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=It.READY,this._resourceCache.statistics.addTextureLoader(this),!0};X_.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var nv=X_;function K_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(K_.prototype=Object.create(ro.prototype),K_.prototype.constructor=K_);Object.defineProperties(K_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function rNe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}K_.prototype.load=async function(){return l(this._promise)?this._promise:rNe(this._draco,this._attributeSemantic)?(this._promise=aNe(this),this._promise):(this._promise=lNe(this),this._promise)};function sNe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Ft.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=ln.VEC2,a.normalizationRange=r;else{let c=ln.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function aNe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=It.LOADED,e)}catch{if(e.isDestroyed())return;R5(e)}}function cNe(e){e._state=It.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=sNe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function lNe(e){e._state=It.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=It.PROCESSING,e)}catch(n){if(e.isDestroyed())return;R5(e,n)}}function R5(e,t){e.unload(),e._state=It.FAILED;let n="Failed to load vertex buffer";throw e.getError(n,t)}function M5(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}M5.prototype.set=function(e,t){this.typedArray=e,this.context=t};M5.prototype.execute=function(){this.buffer=zee(this.typedArray,this.context)};function zee(e,t){let n=ht.createVertexBuffer({typedArray:e,context:t,usage:ke.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var uNe=new M5;K_.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){R5(this,i)}cNe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=uNe;if(i.set(n,e.context),!e.jobScheduler.execute(i,ka.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=zee(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=It.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};K_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var iv=K_;function ov(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}ov.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=y0.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new ov({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(ov.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ov.BATCH_TABLE_CLASS_NAME="_batchTable";var Cm=ov;function EL(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}EL.fromJson=function(e){return new EL({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(EL.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var SL=EL;function vL(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,rn.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}vL.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return SL.fromJson(o)});return new vL({id:t,values:i,valueType:rn[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(vL.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var wL=vL;function IL(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}IL.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=wL.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Cm.fromJson({id:i,class:e.classes[i],enums:t}));return new IL({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(IL.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Tm=IL;function E0(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Tm.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(E0.prototype=Object.create(ro.prototype),E0.prototype.constructor=E0);Object.defineProperties(E0.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});E0.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=fNe(this),this._promise)};async function fNe(e){let t=e._resource;e._state=It.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Tm.fromJson(n),e._state=It.READY,e)}catch(n){if(e.isDestroyed())return;e._state=It.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}E0.prototype.unload=function(){this._schema=void 0};var rv=E0;var Xf={};function sv(e){return d_(e.url)}function DL(e){let t=e.byteOffset,n=e.byteLength;if(ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function dNe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,o=e.type,r=e.count;return`${n}-${i}-${o}-${r}`}function Hee(e){return sv(e)}function Gee(e,t){return`${sv(e)}-buffer-id-${t}`}function av(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return Hee(o)}return Gee(n,t)}function L5(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=av(a,s,n,i),u=DL(r);return`${c}-range-${u}`}function Wee(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return sv(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=av(u,c,n,i),d=DL(a);return`${f}-range-${d}`}function mNe(e,t){let n=Hl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Xf.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${sv(n)}`};Xf.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${Hee(t)}`};Xf.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${Gee(t,n)}`};Xf.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${sv(t)}`};Xf.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ii(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=av(a,s,i,o),u=DL(r);return`buffer-view:${c}-range-${u}`};Xf.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource;return`draco:${L5(t,n,i,o)}`};Xf.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=y(e.dequantize,!1),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${o.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${L5(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[r],g=p.buffer,h=t.buffers[g],x=av(h,g,n,i),b=DL(p);return`vertex-buffer:${x}-range-${b}${d}`};Xf.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=y(e.loadBuffer,!1),c=y(e.loadTypedArray,!1),u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${L5(t,s,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,h=t.buffers[g],x=av(h,g,i,o),b=dNe(f,p);return`index-buffer:${x}-accessor-${b}${u}`};Xf.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource;return`image:${Wee(t,n,i,o)}`};Xf.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=n.index,c=Hl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=Wee(t,c,i,o),f=mNe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Gl=Xf;function cv(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}cv.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};cv.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};cv.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};cv.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var PL=cv;function Bn(){}Bn.cacheEntries={};Bn.statistics=new PL;function hNe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Bn.get=function(e){let t=Bn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Bn.add=function(e){let t=e.cacheKey;return Bn.cacheEntries[t]=new hNe(e),e};Bn.unload=function(e){let t=e.cacheKey,n=Bn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Bn.statistics.removeLoader(e),e.destroy(),delete Bn.cacheEntries[t])};Bn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=Gl.getSchemaCacheKey({schema:t,resource:n}),o=Bn.get(i);return l(o)?o:(o=new rv({schema:t,resource:n,cacheKey:i}),Bn.add(o))};Bn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,o=Gl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Bn.get(o);return l(r)?r:(r=new wC({typedArray:i,cacheKey:o}),Bn.add(r))};Bn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource,n=Gl.getExternalBufferCacheKey({resource:t}),i=Bn.get(n);return l(i)?i:(i=new wC({resource:t,cacheKey:n}),Bn.add(i))};Bn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=e.gltfJson,r=Gl.getGltfCacheKey({gltfResource:t}),s=Bn.get(r);return l(s)?s:(s=new tv({resourceCache:Bn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Bn.add(s))};Bn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=Gl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Bn.get(r);return l(s)?s:(s=new JS({resourceCache:Bn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Bn.add(s))};Bn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource,r=Gl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Bn.get(r);return l(s)?s:(s=new ZS({resourceCache:Bn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Bn.add(s))};Bn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=y(e.asynchronous,!0),f=y(e.dequantize,!1),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1),g=Gl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),h=Bn.get(g);return l(h)?h:(h=new iv({resourceCache:Bn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:u,dequantize:f,loadBuffer:d,loadTypedArray:p}),Bn.add(h))};Bn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=y(e.asynchronous,!0),c=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),f=Gl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:u}),d=Bn.get(f);return l(d)?d:(d=new QS({resourceCache:Bn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Bn.add(d))};Bn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource,r=Gl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Bn.get(r);return l(s)?s:(s=new $S({resourceCache:Bn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Bn.add(s))};Bn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=y(e.asynchronous,!0),c=Gl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Bn.get(c);return l(u)?u:(u=new nv({resourceCache:Bn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Bn.add(u))};Bn.clearForSpecs=function(){let e=[iv,QS,ZS,nv,$S,JS,wC,rv,tv],t,n=Bn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Bn.statistics.clear()};var ki=Bn;function Vs(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Vs.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Vs.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Vs.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Vs.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};Vs.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Vs.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Vs.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Vs.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Vs.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===qr.OCTREE&&(t=3),e>>t};Vs.fromSubtreeJson=async function(e,t,n,i,o){let r=new Vs(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=pNe(n);let a=s.json;r._subtreeJson=a;let c;if(ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let A=0;A<T;A++){let S=a.contentMetadata[A];u.push(a.propertyTables[S])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let T=p.class,A=d.classes[T];f=new nL({subtreeMetadata:p,class:A})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ii(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let h=_Ne(a.buffers),x=gNe(a.bufferViews,h);yNe(a,x),l(c)&&jee(c,x);for(let T=0;T<u.length;T++){let A=u[T];jee(A,x)}let b=await xNe(r,h,s.binary),C=CNe(x,b);return TNe(r,a,i,C),l(c)&&(ANe(r,i,C),SNe(r)),ENe(r,i,C),vNe(r),r._ready=!0,r};function pNe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Mo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function _Ne(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function gNe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function yNe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function jee(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function xNe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=bNe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function bNe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=ki.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function CNe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function TNe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ii(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=N5(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=N5(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=N5(t.childSubtreeAvailability,i,a)}function N5(e,t,n,i){if(l(e.constant))return new YS({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new YS({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function ANe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Vl({class:a,count:o,properties:i.properties,bufferViews:n})}function ENe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,d=c.class,p=r.classes[d],g=new Vl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function qee(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function SNe(e){let t=qee(e._tileAvailability);e._tileJumpBuffer=t}function vNe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=qee(o);t.push(r)}}Vs.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new de("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Vs.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new de("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function wNe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function INe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}Vs.prototype.getTileMetadataView=function(e){let t=wNe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new XS({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Vs.prototype.getContentMetadataView=function(e,t){let n=INe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new XS({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Vs.prototype.isDestroyed=function(){return!1};Vs.prototype.destroy=function(){return l(this._bufferLoader)&&ki.unload(this._bufferLoader),ue(this)};var RC=Vs;var DNe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},MC=Object.freeze(DNe);function PNe(e){return{tile:{boundingVolume:Yee("TILE",e),minimumHeight:Xee("TILE",e),maximumHeight:Kee("TILE",e)},content:{boundingVolume:Yee("CONTENT",e),minimumHeight:Xee("CONTENT",e),maximumHeight:Kee("CONTENT",e)}}}function Yee(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}}function Xee(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function Kee(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}var OL=PNe;function el(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1,this._readyPromise=void 0}Object.defineProperties(el.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Implicit3DTileContent.readyPromise","Implicit3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Implicit3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});el.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await RC.fromSubtreeJson(n,i,s,a,c),f=new el(e,t,n);return f._implicitSubtree=u,ONe(f,u),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function ONe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=MNe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=RNe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=HNe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function RNe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function MNe(e,t,n,i){let s=Jee(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let h=0;h<g;h++){let x=p+h;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(h),C=c[b],T=h%f.branchingFactor,A=Jee(e,t,C,T,x);C.children.push(A),a.numberOfTilesTotal++,u.push(A)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Zee(e,t,n){let i=MC.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Jee(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let I=OL(c);u=I.tile,f=I.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){g=!0;break}let h=FNe(s,a,i,r,n,u),x=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(o,I))continue;let N={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},F=BNe(h,f);l(F)&&(N.boundingVolume=F),x.push(_t(N,s.contentHeaders[I]))}let b=Zee(c,s,a),C={boundingVolume:h,geometricError:b,refine:s.refine,contents:x},T=!0,A=Ye(s.tileHeader,T);delete A.boundingVolume,delete A.transform;let S=_t(C,A,T),v=nte(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=g,v}function RL(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function B5(e,t){l(t)&&(ii(e,"3DTILES_bounding_volume_S2")?NNe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&LNe(e.region,t.minimumHeight,t.maximumHeight))}function LNe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function NNe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function FNe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!RL(r.boundingVolume,r)&&RL(e.boundingVolume,r)?s=$ee(e,t,n,y(i,!1),o):s=r.boundingVolume,B5(s,r),s}function BNe(e,t){let n;return l(t)&&(n=t.boundingVolume),RL(n,t)?B5(n,t):RL(e,t)&&(n=Ye(e,!0),B5(n,t)),n}function $ee(e,t,n,i,o){let r=e.boundingVolume;return ii(r,"3DTILES_bounding_volume_S2")?Qee(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:tte(r.region,t.level,t.x,t.y,t.z)}:{box:ete(r.box,t.level,t.x,t.y,t.z)}}function Qee(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:V_.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?qS.encode2D(i,o,r):qS.encode2D(i,r,o),f=V_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:V_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var kNe=new m,UNe=new m,F5=new m,VNe=new Z;function ete(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,UNe),s=Z.unpack(e,3,VNe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=m.fromElements(a,a,1,kNe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=m.fromElements(c,u,f,F5);p=Z.multiplyByVector(s,p,F5),p=m.add(p,r,F5);let g=Z.clone(s);g=Z.multiplyByScale(g,d,g);let h=new Array(12);return m.pack(p,h),Z.pack(g,h,3),h}var zNe=new ce;function tte(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,zNe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),d=P.negativePiToPi(f+u),p=c*r.height,g=P.negativePiToPi(r.south+i*p),h=P.negativePiToPi(g+p),x=s,b=a;if(l(o)){let C=c*(a-s);x+=o*C,b=x+C}return[f,g,d,h,x,b]}function HNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=$ee(i,o,n,!1,t),s=Zee(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=nte(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function nte(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}el.prototype.hasProperty=function(e,t){return!1};el.prototype.getFeature=function(e){};el.prototype.applyDebugSettings=function(e,t){};el.prototype.applyStyle=function(e){};el.prototype.update=function(e,t){};el.prototype.isDestroyed=function(){return!1};el.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};el._deriveBoundingBox=ete;el._deriveBoundingRegion=tte;el._deriveBoundingVolumeS2=Qee;var lv=el;var GNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Wl=Object.freeze(GNe);function LC(e,t){this._distance=t,this._normal=new ite(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(LC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});LC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new LC(e.normal,e.distance),t};LC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new LC(e.normal,e.distance)};function ite(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(ite.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var NC=LC;function Va(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?cte:lte,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function cte(e){return e===tn.OUTSIDE}function lte(e){return e===tn.INSIDE}Object.defineProperties(Va.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?cte:lte)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function ote(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Va.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ote(n,i)},e.index=t,ote(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Va.prototype.get=function(e){return this._planes[e]};function ute(e,t){let n=e.length;for(let i=0;i<n;++i)if(dn.equals(e[i],t))return i;return-1}Va.prototype.contains=function(e){return ute(this._planes,e)!==-1};Va.prototype.remove=function(e){let t=this._planes,n=ute(t,e);if(n===-1)return!1;e instanceof NC&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof NC&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Va.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof NC&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var WNe=new re,jNe=new re;function rte(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Yn.octEncodeToCartesian4(a.normal,jNe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=re.packFloat(a.distance,WNe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function ste(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function fte(e,t){let n=Gt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var qNe=new H;Va.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Va.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=fte(o,qNe);s.y*=2,i?(t=new Lt({context:n,width:s.x,height:s.y,pixelFormat:lt.RGBA,pixelDatatype:Je.FLOAT,sampler:hn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Lt({context:n,width:s.x,height:s.y,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(ste(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(rte(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),ste(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),rte(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var YNe=new L,ate=new dn(m.UNIT_X,0);Va.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=L.multiply(t,o,YNe));let r=tn.INSIDE;!this.unionClippingRegions&&i>0&&(r=tn.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];dn.transform(a,o,ate);let c=e.intersectPlane(ate);if(c===tn.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Va.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Va.useFloatTexture=function(e){return e.floatingPointTexture};Va.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Va.useFloatTexture(t)?e.length:e.length*2,r=fte(o,n);return r.y*=2,r};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var bs=Va;var uv={HIGHLIGHT:0,REPLACE:1,MIX:2};uv.getColorBlend=function(e,t){if(e===uv.HIGHLIGHT)return 0;if(e===uv.REPLACE)return 1;if(e===uv.MIX)return P.clamp(t,P.EPSILON4,1)};var xc=Object.freeze(uv);var XNe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},bc=Object.freeze(XNe);var KNe={STEP:0,LINEAR:1,CUBICSPLINE:2},Am=Object.freeze(KNe);var dte={};function fv(e){this._count=e.count,this._properties=Ye(e.properties,!0)}fv.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,dte)};fv.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,dte,e)};fv.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};fv.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var J_=fv;function za(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(za.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});za.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};za.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};za.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};za.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var k5=[];za.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(k5)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,k5)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(k5)),t};za.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};za.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new J_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};za.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};za.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};za.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};za.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};za.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};za.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};za.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var tl=za;function dv(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Hl.createModelTextureReader({textureInfo:r,channels:$Ne(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(dv.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});dv.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===qt.SCALAR&&n===rn.UINT8:qt.isVectorType(t)||t===qt.SCALAR?n===rn.UINT8:!1};var JNe=[void 0,"float","vec2","vec3","vec4"],ZNe=[void 0,"int","ivec2","ivec3","ivec4"];dv.prototype.getGlslType=function(){let e=this._classProperty,t=qt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?JNe[t]:ZNe[t]};dv.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function $Ne(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var ML=dv;function U5(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new ML({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(U5.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});U5.prototype.getProperty=function(e){return this._properties[e]};var FC=U5;function mte(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(mte.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var LL=mte;function V5(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new LL({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(V5.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});V5.prototype.getProperty=function(e){return this._properties[e]};var BC=V5;function mv(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(mv.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});mv.prototype.getPropertyTable=function(e){return this._propertyTables[e]};mv.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};mv.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Ha=mv;function QNe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new Vl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new tl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new FC({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new BC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ha({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var NL=QNe;function eFe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new Vl({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new tl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new FC({id:a,propertyTexture:tFe(c),class:n.classes[c.class],textures:e.textures}))}return new Ha({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function tFe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:nFe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=_t(o.texture,r,!0)}return t}function nFe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var FL=eFe;function Z_(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,u=y(e.asynchronous,!0);this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Z_.prototype=Object.create(ro.prototype),Z_.prototype.constructor=Z_);Object.defineProperties(Z_.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function iFe(e){try{let t=cFe(e),n=mFe(e),i=hFe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=It.LOADED,e)}catch(t){if(e.isDestroyed())return;e.unload(),e._state=It.FAILED;let n="Failed to load structural metadata";throw e.getError(n,t)}}Z_.prototype.load=function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=iFe(this),this._promise)};function oFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function rFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function sFe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];oFe(o.properties,n)}return n}function aFe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&rFe(r,n)}}return n}async function cFe(e){let t;l(e._extension)?t=sFe(e._extension):t=aFe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=ki.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function lFe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&uFe(r,t)}return t}function uFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function fFe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&dFe(r,t)}}return t}function dFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function mFe(e){let t;l(e._extension)?t=lFe(e._extension):t=fFe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=ki.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function hFe(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=ki.getSchemaLoader({resource:i})}else n=ki.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Z_.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=NL({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=FL({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),hte(this),this._state=It.READY,!0};function hte(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function pFe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Z_.prototype.unload=function(){hte(this),pFe(this),l(this._schemaLoader)&&ki.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var BL=Z_;var kC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};kC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return kC.TRANSLATION;case"ROTATION":return kC.ROTATION;case"SCALE":return kC.SCALE;case"_FEATURE_ID":return kC.FEATURE_ID}};var Yr=Object.freeze(kC);var _Fe=65534,gFe=255;function kL(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new gte(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],yFe(this)}Object.defineProperties(kL.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function yFe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),h=d||n.hasEdge(f,c),x=pte(i,c,u,f,p,g,h);for(;l(x);){let b=s[x];if(!l(b)){b=r+o.length;let C=x;for(;C>=r;)C=o[C-r];o.push(C),s[x]=b}b>_Fe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>gFe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=pte(i,c,u,f,p,g,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function pte(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=z5(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,g=r?1:0,h=z5(e,n,d,p,g);if(h===0)return n;let x=s?1:0,b=0,C=r?1:0,T=z5(e,i,x,b,C);if(T===0)return i;let A=f&h&T,S,v,I;if(A&1)S=0,v=1,I=2;else if(A&2)S=0,I=1,v=2;else if(A&4)v=0,S=1,I=2;else if(A&8)v=0,I=1,S=2;else if(A&16)I=0,S=1,v=2;else if(A&32)I=0,v=1,S=2;else{let F=H5(f),_=H5(h),E=H5(T);return F<_&&F<E?t:_<E?n:i}let O=t*3;e[O+S]=a,e[O+v]=c,e[O+I]=u;let R=n*3;e[R+S]=d,e[R+v]=p,e[R+I]=g;let N=i*3;e[N+S]=x,e[N+v]=b,e[N+I]=C}function z5(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function H5(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}kL.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};kL.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Gt.maximumTextureSize),i=n,o=_te(i),r=[];for(;i>1;)i>>=1,r.push(_te(i));let s=new Lt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:lt.LUMINANCE,sampler:new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.LINEAR_MIPMAP_LINEAR,magnificationFilter:Si.LINEAR})});return t.outlineTexture=s,s};function _te(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function gte(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}gte.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var UC=kL;function yte(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function xFe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function UL(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}UL.prototype.postProcess=function(e){this.needsOutlines&&(bFe(this),TFe(this,e))};function bFe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new UC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let r=CFe(o.outlineCoordinates),s=new yte(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function CFe(e){let t=new Ft.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=ln.VEC3,t.normalized=!1,t.count=e.length/3,t}function TFe(e,t){AFe(e.attributePlans,t),l(e.indicesPlan)&&EFe(e.indicesPlan,t)}function AFe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=ht.createVertexBuffer({typedArray:s,context:t,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function EFe(e,t){let n=e.indices;if(e.loadBuffer){let i=ht.createIndexBuffer({typedArray:n.typedArray,context:t,usage:ke.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}UL.AttributeLoadPlan=yte;UL.IndicesLoadPlan=xFe;var VC=UL;function SFe(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var VL=SFe;var vFe=Ft.Attribute,wFe=Ft.Indices,xte=Ft.FeatureIdAttribute,bte=Ft.FeatureIdTexture,Cte=Ft.FeatureIdImplicitRange,IFe=Ft.MorphTarget,DFe=Ft.Primitive,PFe=Ft.Instances,OFe=Ft.Skin,RFe=Ft.Node,MFe=Ft.AnimatedPropertyType,LFe=Ft.AnimationSampler,NFe=Ft.AnimationTarget,FFe=Ft.AnimationChannel,BFe=Ft.Animation,kFe=Ft.ArticulationStage,UFe=Ft.Articulation,VFe=Ft.Asset,zFe=Ft.Scene,HFe=Ft.Components,GFe=Ft.MetallicRoughness,WFe=Ft.SpecularGlossiness,jFe=Ft.Material,wo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Kf(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=y(e.releaseGltfJson,!1),r=y(e.asynchronous,!0),s=y(e.incrementallyLoadTextures,!0),a=y(e.upAxis,_o.Y),c=y(e.forwardAxis,_o.Z),u=y(e.loadAttributesAsTypedArray,!1),f=y(e.loadAttributesFor2D,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.loadForClassification,!1),h=y(e.renameBatchIdSemantic,!1);n=l(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=h,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=wo.NOT_LOADED,this._textureState=wo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Kf.prototype=Object.create(ro.prototype),Kf.prototype.constructor=Kf);Object.defineProperties(Kf.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function qFe(e){e._state=wo.LOADING,e._textureState=wo.LOADING;try{let t=ki.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=wo.LOADED,e._textureState=wo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=wo.FAILED,e._textureState=wo.FAILED,zL(e,t)}}async function YFe(e,t){Wt.supportsWebP.initialized||await Wt.supportsWebP.initialize();let n=new VL({webp:Wt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,o=W2e(e,i,n,t);return e._state=wo.PROCESSING,e._textureState=wo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(ki.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),o}Kf.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=qFe(this),this._promise)};function zL(e,t){e.unload();let n="Failed to load glTF";throw e.getError(n,t)}function XFe(e,t){let n,i=!0,o=e._geometryLoaders,r=o.length;for(n=0;n<r;++n){let a=o[n].process(t);a&&l(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(l(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=wo.POST_PROCESSING)}function KFe(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.postProcess(t),r.needsOutlines&&JFe(e,r)}}function JFe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes,s=r.length;for(let c=0;c<s;c++){let u=r[c];l(u.buffer)&&n.push(u.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}Kf.prototype._process=function(e){return this._state===wo.READY?!0:(this._state===wo.PROCESSING&&XFe(this,e),this._resourcesLoaded&&this._state===wo.POST_PROCESSING&&(KFe(this,e.context),this._state=wo.PROCESSED),this._resourcesLoaded&&this._state===wo.PROCESSED?(Pte(this),this._typedArray=void 0,this._state=wo.READY,!0):!1)};Kf.prototype._processTextures=function(e){if(this._textureState===wo.READY)return!0;if(this._textureState!==wo.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,o=i.length;for(t=0;t<o;++t){let r=i[t].process(e);r&&l(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&r}return n?(this._textureState=wo.READY,this._texturesLoaded=!0,!0):!1};Kf.prototype.process=function(e){if(this._state===wo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=YFe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=wo.FAILED;let o=this._processError;this._processError=void 0,zL(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===wo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=wo.FAILED,zL(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=wo.FAILED,zL(this,o)}return this._incrementallyLoadTextures?n:n&&i};function ZFe(e,t,n,i,o,r,s,a){let u=t.accessors[n].bufferView;return ki.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,draco:o,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function $Fe(e,t,n,i,o,r,s){return ki.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function QFe(e,t,n){let i=ki.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function Tte(e,t,n){let i=t.byteOffset,o=zl(e,t),r=t.count,s=ku(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),h=j_(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){h(p,i,s,c,g);for(let b=0;b<s;++b)d[x*s+b]=g[b];i+=o}return d}function e2e(e,t){let n=e.type;if(n===ln.SCALAR)return t.fill(0);let i=ln.getMathType(n);return t.fill(i.clone(i.ZERO))}function t2e(e,t,n,i){let o=e.type,r=e.count;if(o===ln.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===ln.VEC4&&i)for(let s=0;s<r;s++)n[s]=Be.unpack(t,s*4);else{let s=ln.getMathType(o),a=ln.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function n2e(e,t,n,i,o,r){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=Tte(n,i,s);o=y(o,!1),t2e(i,a,r,o)}function HL(e,t,n,i){let o=t.accessors[n],r=o.count,s=new Array(r),a=o.bufferView;if(l(a)){let c=QFe(e,t,a),u=n2e(e,c,t,o,i,s);return e._loaderPromises.push(u),s}return e2e(o,s)}function Uu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function i2e(e){return e===Number?0:new e}function o2e(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var r2e={VEC2:new H(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new re(-1,-1,-1,-1)};function s2e(e,t){let n=o2e(e.componentDatatype),i=r2e[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function a2e(e,t,n){let i=e.decodeMatrix,o=Uu(n,e.decodedMin),r=Uu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Ft.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new H(i[6],i[7]),s.quantizedVolumeStepSize=new H(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new re(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new re(i[0],i[6],i[12],i[18])),t.quantization=s}function c2e(e,t,n,i,o){let r=e.accessors[t],s=ln.getMathType(r.type),a=y(r.normalized,!1),c=new vFe;c.name=n,c.semantic=i,c.setIndex=o,c.constant=i2e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=Uu(s,r.min),c.max=Uu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=zl(e,r),ii(r,"WEB3D_quantized_attributes")&&a2e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===Et.POSITION||c.semantic===Et.NORMAL||c.semantic===Et.TANGENT||c.semantic===Et.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&s2e(c,s),c}function Ate(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var l2e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function G5(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=l2e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function u2e(e){let t=e===Et.POSITION,n=e===Et.FEATURE_ID,i=e===Et.TEXCOORD;return t||n||i}function f2e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(o,t.typedArray.buffer)}}function d2e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Tte(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Ete(e,t,n,i,o,r,s,a){let c=t.accessors[n],u=c.bufferView,f=i.gltfSemantic,d=i.renamedSemantic,p=i.modelSemantic,g=l(p)?Ate(d):void 0,x=c2e(t,n,f,p,g);if(!l(o)&&!l(u))return x;let b=ZFe(e,t,n,f,o,r,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(b);let T=b.load();return e._loaderPromises.push(T),e._geometryCallbacks[C]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[f])?f2e(x,b,r,s):d2e(t,c,x,b,r,s)},x}function Ste(e,t,n,i,o,r,s,a){let c=i.modelSemantic,u=c===Et.POSITION,f=c===Et.FEATURE_ID,d=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&f,g=e._loadAttributesAsTypedArray,h=!g,x=g||d||p,T=Ete(e,t,n,i,o,s?!1:h,s?!0:x,a),A=new VC.AttributeLoadPlan(T);return A.loadBuffer=h,A.loadTypedArray=x,A}function m2e(e,t,n,i,o,r){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=G5(e,Yr,o),u=c.modelSemantic,f=u===Yr.TRANSLATION||u===Yr.ROTATION||u===Yr.SCALE,d=u===Yr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=!p,h=e._loadAttributesFor2D&&!r.scene3DOnly;return Ete(e,t,n,c,void 0,g,p||d&&(!a||h),r)}function h2e(e,t,n,i,o,r,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new wFe;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&o,h=!f,x=f||d||p,T=$Fe(e,t,n,i,r?!1:h,r?!0:x,s),A=e._geometryLoaders.length;e._geometryLoaders.push(T);let S=T.load();e._loaderPromises.push(S),e._geometryCallbacks[A]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let v=new VC.IndicesLoadPlan(u);return v.loadBuffer=h,v.loadTypedArray=x,v}function Qh(e,t,n,i,o,r){let s=Hl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=ki.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:o,asynchronous:e._asynchronous}),c=Hl.createModelTextureReader({textureInfo:n}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=wo.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{c.texture=a.texture,l(r)&&(c.texture.sampler=r)},c}function p2e(e,t,n,i,o){let r=new jFe,s=y(n.extensions,y.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(r.unlit=l(s.KHR_materials_unlit),l(a)){let u=new WFe;r.specularGlossiness=u,l(a.diffuseTexture)&&(u.diffuseTexture=Qh(e,t,a.diffuseTexture,i,o)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(u.specularGlossinessTexture=Qh(e,t,a.specularGlossinessTexture,i,o)),u.diffuseFactor=Uu(re,a.diffuseFactor),u.specularFactor=Uu(m,a.specularFactor),u.glossinessFactor=a.glossinessFactor,r.pbrSpecularGlossiness=a}else if(l(c)){let u=new GFe;l(c.baseColorTexture)&&(u.baseColorTexture=Qh(e,t,c.baseColorTexture,i,o)),l(c.metallicRoughnessTexture)&&(u.metallicRoughnessTexture=Qh(e,t,c.metallicRoughnessTexture,i,o)),u.baseColorFactor=Uu(re,c.baseColorFactor),u.metallicFactor=c.metallicFactor,u.roughnessFactor=c.roughnessFactor,r.metallicRoughness=u}return l(n.emissiveTexture)&&(r.emissiveTexture=Qh(e,t,n.emissiveTexture,i,o)),l(n.normalTexture)&&!e._loadForClassification&&(r.normalTexture=Qh(e,t,n.normalTexture,i,o)),l(n.occlusionTexture)&&(r.occlusionTexture=Qh(e,t,n.occlusionTexture,i,o)),r.emissiveFactor=Uu(m,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}function vte(e,t){let n=new xte;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function wte(e,t,n,i){let o=new xte,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Ate(r.attribute),o.positionalLabel=i,o}function Ite(e,t){let n=new Cte;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Dte(e,t,n,i){let o=new Cte,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function _2e(e,t,n,i,o,r){let s=new bte;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=r;let a=n.texture;s.textureReader=Qh(e,t,a,i,o,hn.NEAREST);let u=(l(a.channels)?a.channels:[0]).map(function(f){return"rgba".charAt(f)}).join("");return s.textureReader.channels=u,s}function g2e(e,t,n,i,o,r,s,a){let c=new bte,u=n.featureIds,f=u.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Qh(e,t,f,o,r,hn.NEAREST),c.textureReader.channels=u.channels,c.positionalLabel=a,c}function y2e(e,t,n,i,o,r){let s=new IFe,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=G5(e,Et,u),p=Ste(e,t,f,d,a,c,i,r);s.attributes.push(p.attribute),o.attributePlans.push(p)}return s}function x2e(e,t,n,i,o,r){let s=new DFe,a=new VC(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=p2e(e,t,t.materials[c],o,r));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=b2e(e,t,d,a));let p=e._loadForClassification,g=u.KHR_draco_mesh_compression,h=!1,x=n.attributes;if(l(x)){for(let O in x)if(x.hasOwnProperty(O)){let R=x[O],N=G5(e,Et,O),F=N.modelSemantic;if(p&&!u2e(F))continue;F===Et.FEATURE_ID&&(h=!0);let _=Ste(e,t,R,N,g,i,f,r);a.attributePlans.push(_),s.attributes.push(_.attribute)}}let b=n.targets;if(l(b)&&!p){let O=b.length;for(let R=0;R<O;++R)s.morphTargets.push(y2e(e,t,b[R],f,a,r))}let C=n.indices;if(l(C)){let O=h2e(e,t,C,g,h,f,r);l(O)&&(a.indicesPlan=O,s.indices=O.indices)}let T=u.EXT_structural_metadata,A=u.EXT_mesh_features,S=u.EXT_feature_metadata,v=l(S);l(A)?C2e(e,t,s,A,o,r):v&&T2e(e,t,s,S,o,r),l(T)?A2e(s,T):v&&E2e(e,s,S);let I=n.mode;if(p&&I!==Fe.TRIANGLES)throw new de("Only triangle meshes can be used for classification.");return s.primitiveType=I,s}function b2e(e,t,n){let i=n.indices;return HL(e,t,i,!1)}function C2e(e,t,n,i,o,r){let s;l(i)&&l(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],u=`featureId_${a}`,f;l(c.texture)?f=_2e(e,t,c,o,r,u):l(c.attribute)?f=vte(c,u):f=Ite(c,u),n.featureIds.push(f)}}function T2e(e,t,n,i,o,r){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(l(c)){let f=c.length;for(let d=0;d<f;++d){let p=c[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),x=s[g].count,b=`featureId_${a}`;a++;let C;l(p.featureIds.attribute)?C=wte(p,h,x,b):C=Dte(p,h,x,b),n.featureIds.push(C)}}let u=i.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d],g=p.featureTable,h=e._sortedPropertyTableIds.indexOf(g),x=s[g].count,b=`featureId_${a}`;a++;let C=g2e(e,t,p,h,o,r,x,b);n.featureIds.push(C)}}}function A2e(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function E2e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function S2e(e,t,n,i){let o=n.EXT_mesh_gpu_instancing,r=new PFe,s=o.attributes;if(l(s)){for(let f in s)if(s.hasOwnProperty(f)){let d=s[f];r.attributes.push(m2e(e,t,d,s,f,i))}}let a=y(o.extensions,y.EMPTY_OBJECT),c=n.EXT_instance_features,u=a.EXT_feature_metadata;return l(c)?v2e(r,c):l(u)&&w2e(t,r,u,e._sortedPropertyTableIds),r}function v2e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=vte(o,r):s=Ite(o,r),e.featureIds.push(s)}}function w2e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r)){let s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.featureTable,f=i.indexOf(u),d=o[u].count,p=`instanceFeatureId_${a}`,g;l(c.featureIds.attribute)?g=wte(c,f,d,p):g=Dte(c,f,d,p),t.featureIds.push(g)}}}function I2e(e,t,n,i,o){let r=new RFe;r.name=n.name,r.matrix=Uu(L,n.matrix),r.translation=Uu(m,n.translation),r.rotation=Uu(Be,n.rotation),r.scale=Uu(m,n.scale);let s=y(n.extensions,y.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(l(a)){if(e._loadForClassification)throw new de("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");r.instances=S2e(e,t,s,o)}l(c)&&(r.articulationName=c.articulationName);let u=n.mesh;if(l(u)){let f=t.meshes[u],d=f.primitives,p=d.length;for(let b=0;b<p;++b)r.primitives.push(x2e(e,t,d[b],l(r.instances),i,o));let g=y(n.weights,f.weights),x=r.primitives[0].morphTargets.length;r.morphWeights=l(g)?g.slice():new Array(x).fill(0)}return r}function D2e(e,t,n,i){if(!l(t.nodes))return[];let o,r,s=t.nodes.length,a=new Array(s);for(o=0;o<s;++o){let c=I2e(e,t,t.nodes[o],n,i);c.index=o,a[o]=c}for(o=0;o<s;++o){let c=t.nodes[o].children;if(l(c)){let u=c.length;for(r=0;r<u;++r)a[o].children.push(a[c[r]])}}return a}function P2e(e,t,n,i){let o=new OFe,r=n.joints,s=r.length,a=new Array(s);for(let u=0;u<s;++u)a[u]=i[r[u]];o.joints=a;let c=n.inverseBindMatrices;return l(c)?o.inverseBindMatrices=HL(e,t,c):o.inverseBindMatrices=new Array(s).fill(L.IDENTITY),o}function O2e(e,t,n){let i=t.skins;if(e._loadForClassification||!l(i))return[];let o=t.skins.length,r=new Array(o);for(let a=0;a<o;++a){let c=P2e(e,t,t.skins[a],n);c.index=a,r[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;l(c)&&(n[a].skin=r[c])}return r}async function R2e(e,t,n,i,o,r){let s=new BL({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:o,frameState:r,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function M2e(e,t,n){let i=new LFe,o=n.input;i.input=HL(e,t,o);let r=n.interpolation;i.interpolation=y(Am[r],Am.LINEAR);let s=n.output;return i.output=HL(e,t,s,!0),i}function L2e(e,t){let n=new NFe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=MFe[o],n}function N2e(e,t,n){let i=new FFe,o=e.sampler;return i.sampler=t[o],i.target=L2e(e.target,n),i}function F2e(e,t,n,i){let o,r=new BFe;r.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(o=0;o<a;o++){let p=M2e(e,t,s[o]);p.index=o,c[o]=p}let u=n.channels,f=u.length,d=new Array(f);for(o=0;o<f;o++)d[o]=N2e(u[o],c,i);return r.samplers=c,r.channels=d,r}function B2e(e,t,n){let i=t.animations;if(e._loadForClassification||!l(i))return[];let o=t.animations.length,r=new Array(o);for(let s=0;s<o;++s){let a=F2e(e,t,t.animations[s],n);a.index=s,r[s]=a}return r}function k2e(e){let t=new kFe;t.name=e.name;let n=e.type.toUpperCase();return t.type=bc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function U2e(e){let t=new UFe;t.name=e.name;let n=e.stages,i=n.length,o=new Array(i);for(let r=0;r<i;r++){let s=k2e(n[r]);o[r]=s}return t.stages=o,t}function V2e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations;if(!l(n))return[];let i=n.articulations;if(!l(i))return[];let o=i.length,r=new Array(o);for(let s=0;s<o;s++){let a=U2e(i[s]);r[s]=a}return r}function z2e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function H2e(e,t){let n=new zFe,i=z2e(e);return n.nodes=i.map(function(o){return t[o]}),n}var G2e=new m;function W2e(e,t,n,i){let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_structural_metadata,s=o.EXT_feature_metadata,a=o.CESIUM_RTC;if(l(s)){let C=s.featureTables,T=s.featureTextures,A=l(C)?C:[],S=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(A).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let c=D2e(e,t,n,i),u=O2e(e,t,c),f=B2e(e,t,c),d=V2e(t),p=H2e(t,c),g=new HFe,h=new VFe,x=t.asset.copyright;if(l(x)){let C=x.split(";").map(function(T){return new wt(T.trim())});h.credits=C}if(g.asset=h,g.scene=p,g.nodes=c,g.skins=u,g.animations=f,g.articulations=d,g.upAxis=e._upAxis,g.forwardAxis=e._forwardAxis,l(a)){let C=m.fromArray(a.center,0,G2e);g.transform=L.fromTranslation(C,g.transform)}if(e._components=g,l(r)||l(s)){let C=R2e(e,t,r,s,n,i);e._loaderPromises.push(C)}let b=[];return b.push.apply(b,e._loaderPromises),e._incrementallyLoadTextures||b.push.apply(b,e._texturesPromises),Promise.all(b)}function j2e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._textureLoaders.length=0}function Pte(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._bufferViewLoaders.length=0}function q2e(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&ki.unload(t[i]);e._geometryLoaders.length=0}function Y2e(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}function X2e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Kf.prototype.isUnloaded=function(){return this._state===wo.UNLOADED};Kf.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&ki.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,j2e(this),Pte(this),q2e(this),Y2e(this),X2e(this),this._components=void 0,this._typedArray=void 0,this._state=wo.UNLOADED};var ep=Kf;function W5(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function GL(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Jf(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Gt.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0);let o=l(e.depthTexture)||l(e.depthRenderbuffer),r=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);this._bind();let s,a,c,u,f;if(l(e.colorTextures)){let d=e.colorTextures;for(u=this._colorTextures.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)s=d[c],f=this._gl.COLOR_ATTACHMENT0+c,W5(this,f,s),this._activeColorAttachments[c]=f,this._colorTextures[c]=s}if(l(e.colorRenderbuffers)){let d=e.colorRenderbuffers;for(u=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)a=d[c],f=this._gl.COLOR_ATTACHMENT0+c,GL(this,f,a),this._activeColorAttachments[c]=f,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,W5(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,GL(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,GL(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,W5(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,GL(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(Jf.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Jf.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Jf.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Jf.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Jf.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Jf.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Jf.prototype.getColorTexture=function(e){return this._colorTextures[e]};Jf.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Jf.prototype.isDestroyed=function(){return!1};Jf.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let o=t[e];l(o)&&o.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let o=i[e];l(o)&&o.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var pa=Jf;function zC(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let o=e.colorRenderbuffers,r=e.colorTextures;if(l(o)!==l(r))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new pa({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new pa({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}zC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};zC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};zC.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};zC.prototype.isDestroyed=function(){return!1};zC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var WL=zC;var nl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===nl.RGBA4||e===nl.RGBA8||e===nl.RGBA16F||e===nl.RGBA32F||e===nl.RGB5_A1||e===nl.RGB565||e===nl.DEPTH_COMPONENT16||e===nl.STENCIL_INDEX8||e===nl.DEPTH_STENCIL||e===nl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?nl.RGBA32F:e===te.HALF_FLOAT_OES?nl.RGBA16F:nl.RGBA8}},il=Object.freeze(nl);function hv(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Gt.maximumRenderbufferSize,o=y(e.format,il.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(hv.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});hv.prototype._getRenderbuffer=function(){return this._renderbuffer};hv.prototype.isDestroyed=function(){return!1};hv.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Vu=hv;function as(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(as.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});as.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};as.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,lt.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Lt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:hn.NEAREST}),this._numSamples>1){let a=il.getColorFormat(o);this._colorRenderbuffers[s]=new Vu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Lt({context:e,width:t,height:n,pixelFormat:lt.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Vu({context:e,width:t,height:n,format:il.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Vu({context:e,width:t,height:n,format:il.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Lt({context:e,width:t,height:n,pixelFormat:lt.DEPTH_COMPONENT,pixelDatatype:Je.UNSIGNED_INT,sampler:hn.NEAREST}):this._depthRenderbuffer=new Vu({context:e,width:t,height:n,format:il.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new WL({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new pa({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};as.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};as.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};as.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};as.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};as.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};as.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};as.prototype.getDepthTexture=function(){return this._depthTexture};as.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};as.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};as.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};as.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};as.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};as.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};as.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};as.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};as.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&l(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),l(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),l(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=as;var jL=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; -/* - How is 3D data stored in a 2D megatexture? - - In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). - The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and - the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). - Note that there could be empty space in the megatexture because it's a power of two. - - 0 1 2 3 - +---+---+---+---+ - | | | | | 3 - +---+---+---+---+ - | | | | | 2 - +-------+-------+ - |010|110|011|111| 1 - |--- ---|--- ---| - |000|100|001|101| 0 - +-------+-------+ +vec2 neighborContribution(float log2Depth, vec2 offset) +{ + float dist = u_distanceAndEdlStrength.x; + vec2 texCoordOrig = v_textureCoordinates + offset * dist; + vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); + vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); - When doing linear interpolation the megatexture needs to be sampled twice: once for - the Z slice above the voxel coordinate and once for the slice below. The two slices - are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is - halfway between two Z slices so the interpolation factor is 0.5. Below is a side view - of the 3D voxel grid with voxel coordinates on the left side. + float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); + float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); - 2 +---+ - |001| - 1 +-z-+ - |000| - 0 +---+ + // ignore depth values that are the clear depth + if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { + return vec2(0.0); + } - When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. -*/ + // interpolate the two adjacent depth values + float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); + return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +} -Properties getPropertiesFromMegatexture(in SampleData sampleData) { - vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? - int tileIndex = sampleData.megatextureIndex; - vec3 voxelCoord = tileUv * vec3(u_dimensions); - ivec3 voxelDimensions = u_dimensions; +void main() +{ + float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); - #if defined(PADDING) - voxelDimensions += u_paddingBefore + u_paddingAfter; - voxelCoord += vec3(u_paddingBefore); - #endif + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); + eyeCoordinate /= eyeCoordinate.w; - #if defined(NEAREST_SAMPLING) - // Round to the center of the nearest voxel - voxelCoord = floor(voxelCoord) + vec3(0.5); - #endif + float log2Depth = log2(-eyeCoordinate.z); - // Tile location - vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); + if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer + { + discard; + } - // Slice location - float slice = voxelCoord.z - 0.5; - int sliceIndex = int(floor(slice)); - int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); - vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); + vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); - // Voxel location - vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; + // sample from neighbors left, right, down, up + vec2 texelSize = 1.0 / czm_viewport.zw; - // Final location in the megatexture - vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; + vec2 responseAndCount = vec2(0.0); - #if defined(NEAREST_SAMPLING) - return getPropertiesFromMegatextureAtUv(uv0); - #else - float sliceLerp = fract(slice); - int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); - vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); - vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; - Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); - Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); - return mixProperties(properties0, properties1, sliceLerp); - #endif -} + responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); -// Convert an array of sample datas to a final weighted properties. -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { - #if (SAMPLE_COUNT == 1) - return getPropertiesFromMegatexture(sampleDatas[0]); - #else - // When more than one sample is taken the accumulator needs to start at 0 - Properties properties = clearProperties(); - for (int i = 0; i < SAMPLE_COUNT; ++i) { - float weight = sampleDatas[i].weight; + float response = responseAndCount.x / responseAndCount.y; + float strength = u_distanceAndEdlStrength.y; + float shade = exp(-response * 300.0 * strength); + color.rgb *= shade; + out_FragColor = vec4(color); - // Avoid reading the megatexture when the weight is 0 as it can be costly. - if (weight > 0.0) { - Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); - tempProperties = scaleProperties(tempProperties, weight); - properties = sumProperties(properties, tempProperties); - } - } - return properties; - #endif + // Input and output depth are the same. + gl_FragDepth = depthOrLogDepth; } -`;function nnt(e){let t=new jx;this.shaderBuilder=t;let n=e._customShader,i=gt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let p in r)if(r.hasOwnProperty(p)){let g=r[p];t.addUniform(g.type,p,be.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",be.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s,t.addVertexLines([uV]),t.addFragmentLines([n.fragmentShaderText,"#line 0",xV,fV,CV]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,be.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,be.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,be.FRAGMENT),t.addFragmentLines([mV])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,be.FRAGMENT),t.addFragmentLines([dV]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,be.FRAGMENT),t.addFragmentLines([gV,hV,eb])):a==="CYLINDER"?t.addFragmentLines([pV,eb,yV]):a==="ELLIPSOID"&&t.addFragmentLines([_V,eb,AV]),t.addFragmentLines([lV]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,be.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,be.FRAGMENT),s===1?f+=1:o.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,be.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,be.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,be.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,be.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,be.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,be.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,be.FRAGMENT)}var TV=nnt;function int(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,be.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,be.FRAGMENT);for(let O=0;O<c;O++){let L=i[O],N=r[O],_=`PropertyStatistics_${L}`,b=`PropertyStatistics_${L}`;n.addStruct(_,b,be.FRAGMENT);let v=EV(N);n.addStructField(_,v,"min"),n.addStructField(_,v,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,be.FRAGMENT);for(let O=0;O<c;O++){let L=i[O],N=`PropertyStatistics_${L}`,_=L;n.addStructField(f,N,_)}let g="Metadata",h="Metadata",A="metadata";n.addStruct(g,h,be.FRAGMENT),n.addStructField(g,d,p);for(let O=0;O<c;O++){let L=i[O],N=r[O],_=EV(N);n.addStructField(g,_,L)}for(let O=0;O<c;O++){let L=i[O],N=r[O],_=ont(N),b=`VoxelProperty_${L}`,v=`VoxelProperty_${L}`;n.addStruct(b,v,be.FRAGMENT),n.addStructField(b,_,"partialDerivativeLocal"),n.addStructField(b,_,"partialDerivativeWorld"),n.addStructField(b,_,"partialDerivativeView"),n.addStructField(b,_,"partialDerivativeValid")}let x="Voxel",C="Voxel",T="voxel";n.addStruct(x,C,be.FRAGMENT);for(let O=0;O<c;O++){let L=i[O],N=`VoxelProperty_${L}`;n.addStructField(x,N,L)}n.addStructField(x,"vec3","positionEC"),n.addStructField(x,"vec3","positionUv"),n.addStructField(x,"vec3","positionShapeUv"),n.addStructField(x,"vec3","positionUvLocal"),n.addStructField(x,"vec3","viewDirUv"),n.addStructField(x,"vec3","viewDirWorld"),n.addStructField(x,"vec3","surfaceNormal"),n.addStructField(x,"float","travelDistance");let E="FragmentInput",S="FragmentInput";n.addStruct(E,S,be.FRAGMENT),n.addStructField(E,h,A),n.addStructField(E,C,T);let w="Properties",D="Properties",R="properties";n.addStruct(w,D,be.FRAGMENT);for(let O=0;O<c;O++){let L=i[O],N=r[O],_=EV(N);n.addStructField(w,_,L)}{let O="clearProperties";n.addFunction(O,`${D} clearProperties()`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${R};`]);for(let L=0;L<c;L++){let N=i[L],_=r[L],b=o[L],v=EV(_,b);n.addFunctionLines(O,[`${R}.${N} = ${v}(0.0);`])}n.addFunctionLines(O,[`return ${R};`])}{let O="sumProperties";n.addFunction(O,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${R};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(O,[`${R}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(O,[`return ${R};`])}{let O="scaleProperties";n.addFunction(O,`${D} scaleProperties(${D} ${R}, float scale)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} scaledProperties = ${R};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(O,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(O,["return scaledProperties;"])}{let O="mixProperties";n.addFunction(O,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${R};`]);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(O,[`${R}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(O,[`return ${R};`])}{let O="copyPropertiesToMetadata";n.addFunction(O,`void copyPropertiesToMetadata(in ${D} ${R}, inout ${h} ${A})`,be.FRAGMENT);for(let L=0;L<c;L++){let N=i[L];n.addFunctionLines(O,[`${A}.${N} = ${R}.${N};`])}}if(u){let O="setStatistics";n.addFunction(O,`void setStatistics(inout ${d} ${p})`,be.FRAGMENT);for(let L=0;L<c;L++){let N=i[L],_=r[L],b=Yt.getComponentCount(_);for(let v=0;v<b;v++){let I=snt(_,v),M=s[L][v],F=a[L][v];n.addFunctionLines(O,[`${p}.${N}.min${I} = ${xpe(M)};`,`${p}.${N}.max${I} = ${xpe(F)};`])}}}{let O="getPropertiesFromMegatextureAtUv";n.addFunction(O,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,be.FRAGMENT),n.addFunctionLines(O,[`${D} ${R};`]);for(let L=0;L<c;L++){let N=i[L],_=r[L],b=o[L],v=rnt(_,b);n.addFunctionLines(O,[`properties.${N} = texture(u_megatextureTextures[${L}], texcoord)${v};`])}n.addFunctionLines(O,[`return ${R};`])}}function EV(e){if(e===Yt.SCALAR)return"float";if(e===Yt.VEC2)return"vec2";if(e===Yt.VEC3)return"vec3";if(e===Yt.VEC4)return"vec4"}function rnt(e){if(e===Yt.SCALAR)return".r";if(e===Yt.VEC2)return".ra";if(e===Yt.VEC3)return".rgb";if(e===Yt.VEC4)return""}function ont(e){if(e===Yt.SCALAR)return"vec3";if(e===Yt.VEC2)return"mat2";if(e===Yt.VEC3)return"mat3";if(e===Yt.VEC4)return"mat4"}function xpe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function snt(e,t){return e===Yt.SCALAR?"":`[${t}]`}var bV=int;function ant(e,t){let n=new TV(e);bV(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o}=n;if(o>0){let h="getClippingPlane",A=yy(r,t),x=0,C=A.indexOf(")")+1,T=A.indexOf("{",C)+1,E=A.indexOf("}",T),S=A.slice(x,C),w=A.slice(T,E);i.addFunction(h,S,be.FRAGMENT),i.addFunctionLines(h,[w])}let s=i.clone();s.addDefine("PICKING",void 0,be.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),u=ze.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new nt({vertexArray:f,primitiveType:Le.TRIANGLES,renderState:u,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Se.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=nt.shallowClone(p,new nt);if(g.shaderProgram=c,g.pickOnly=!0,l(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(l(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var SV=ant;var bpe={};function cnt(e,t,n){let i,r,o;if(e instanceof vi){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof pl)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var lnt=new m,Cpe=new m;function Spe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function iY(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,lnt),g=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),Cpe)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),Cpe));o=Math.min(cnt(d,g,h)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return P.lerp(n,i,a)}}function TD(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var vpe=new m;function unt(e,t,n,i,r,o,s,a){let c=e.camera,u=m.clone(c.position,vpe),f=c.pitch,d=TD(c.heading,i),p=TD(c.roll,o),g=iY(c,n,u.z,n.z,s),h=Spe(f,r,g,a);function A(x){let C=x.time/t;c.setView({orientation:{heading:P.lerp(d,i,C),pitch:h(C),roll:P.lerp(p,o,C)}}),H.lerp(u,n,C,c.position),c.position.z=g(C)}return A}function fnt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function dnt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var mnt=new he,hnt=new he;function pnt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,mnt),h=f.pitch,A=TD(f.heading,i),x=TD(f.roll,o),C=p.cartesianToCartographic(n,hnt);g.longitude=P.zeroToTwoPi(g.longitude),C.longitude=P.zeroToTwoPi(C.longitude);let T=!1;if(l(a)){let D=P.zeroToTwoPi(a),R=Math.min(g.longitude,C.longitude),O=Math.max(g.longitude,C.longitude),L=D>=R&&D<=O;if(l(c)){let N=Math.abs(g.longitude-C.longitude),_=P.TWO_PI-N;(L?N:_)<(L?_:N)*c&&!L&&(T=!0)}else L||(T=!0)}T?fnt(g,C):dnt(g,C);let E=iY(f,n,g.height,C.height,s),S=Spe(h,r,E,u);function w(){let D=g.longitude,R=C.longitude,O=g.latitude,L=C.latitude;return function(_){let b=_.time/t,v=m.fromRadians(P.lerp(D,R,b),P.lerp(O,L,b),E(b),p);f.setView({destination:v,orientation:{heading:P.lerp(A,i,b),pitch:S(b),roll:P.lerp(x,o,b)}})}}return w()}function _nt(e,t,n,i,r,o,s){let a=e.camera,c=m.clone(a.position,vpe),u=TD(a.heading,i),f=a.frustum.right-a.frustum.left,d=iY(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,h)}}),H.lerp(c,n,h,a.position);let A=d(h),x=a.frustum,C=x.top/x.right,T=(A-(x.right-x.left))*.5;x.right+=T,x.left-=T,x.top=C*x.right,x.bottom=-x.top}return p}var Tpe=new he,gnt=new m;function nY(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Epe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}bpe.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return nY();let r=y(t.convert,!0),o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,Tpe),n=o.project(Tpe,gnt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let h=t.duration;l(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let A=y(t.heading,0),x=y(t.pitch,-P.PI_OVER_TWO),C=y(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let E=Epe(T,t.complete),S=Epe(T,t.cancel),w=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&H.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(w.right-w.left,w.top-w.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(C),P.negativePiToPi(p.roll),P.EPSILON10),D)return nY(E,S);let R=new Array(4);if(R[ne.SCENE2D]=_nt,R[ne.SCENE3D]=pnt,R[ne.COLUMBUS_VIEW]=unt,h<=0)return nY(function(){R[i](e,1,n,A,x,C,a,c,u,f)({time:1}),typeof E=="function"&&E()},S);let O=R[i](e,h,n,A,x,C,a,c,u,f);if(!l(d)){let L=p.positionCartographic.height,N=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>N&&L>11500?d=Fo.CUBIC_OUT:d=Fo.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:O,complete:E,cancel:S}};var vV=bpe;var ynt={ROTATE:0,INFINITE_SCROLL:1},hu=Object.freeze(ynt);function Zt(e){this._scene=e,this._transform=B.clone(B.IDENTITY),this._invTransform=B.clone(B.IDENTITY),this._actualTransform=B.clone(B.IDENTITY),this._actualInvTransform=B.clone(B.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new _e,this._moveEnd=new _e,this._changed=new _e,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new B,this._invViewMatrix=new B,Bpe(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,Ype(this,Zt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*Zt.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}Zt.TRANSFORM_2D=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Zt.TRANSFORM_2D_INVERSE=B.inverseTransformation(Zt.TRANSFORM_2D,new B);Zt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Zt.DEFAULT_VIEW_FACTOR=.5;Zt.DEFAULT_OFFSET=new df(0,-P.PI_OVER_FOUR,0);function Bpe(e){B.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),B.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),B.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Ant(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ci()):e.timeSinceMoved=Math.max(Ci()-e._lastMovedTimestamp,0)/1e3}}Zt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};Zt.prototype._updateCameraChanged=function(){let e=this;if(Ant(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,h=u.x+d.right,A=f.x+p.left,x=f.x+p.right,C=u.y+d.bottom,T=u.y+d.top,E=f.y+p.bottom,S=f.y+p.top,w=Math.max(g,A),D=Math.min(h,x),R=Math.max(C,E),O=Math.min(T,S),L;if(w>=D||R>=T)L=1;else{let N=p;g<A&&h>x&&C<E&&T>S&&(N=d),L=1-(D-w)*(O-R)/((N.right-N.left)*(N.top-N.bottom))}L>t&&(e._changed.raiseEvent(L),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let o=P.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=o/(e.frustum.fovy*.5):s=o;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function xnt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Cnt=new he,Tnt=new m,wV=new m,Ent=new oe,bnt=new oe,Snt=new oe,vnt=new oe,wnt=new oe;function Dnt(e){let t=e._projection,n=t.ellipsoid,i=B.getColumn(e._transform,3,Ent),r=n.cartesianToCartographic(i,Cnt),o=t.project(r,Tnt),s=bnt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=oe.clone(oe.UNIT_X,wnt),c=oe.add(B.getColumn(e._transform,0,wV),i,wV);n.cartesianToCartographic(c,r),t.project(r,o);let u=Snt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,m.subtract(u,s,u),u.x=0;let f=vnt;if(m.magnitudeSquared(u)>P.EPSILON10)m.cross(a,u,f);else{let d=oe.add(B.getColumn(e._transform,1,wV),i,wV);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}m.cross(f,a,u),m.normalize(u,u),m.cross(a,u,f),m.normalize(f,f),B.setColumn(e._actualTransform,0,u,e._actualTransform),B.setColumn(e._actualTransform,1,f,e._actualTransform),B.setColumn(e._actualTransform,2,a,e._actualTransform),B.setColumn(e._actualTransform,3,s,e._actualTransform)}var rY=new m;function tc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!m.equals(r,e.position)||n;o&&(r=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,u=!m.equals(c,e.up);u&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let f=e._right,d=!m.equals(f,e.right);d&&(m.normalize(e.right,e.right),f=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(B.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?B.equals(B.IDENTITY,e._transform)?B.clone(Zt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?xnt(e):Dnt(e):B.clone(e._transform,e._actualTransform),B.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=B.multiplyByPoint(g,r,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=rY;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===ne.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||u||d){let h=m.dot(s,m.cross(c,f,rY));if(Math.abs(1-h)>P.EPSILON2){let A=1/m.magnitudeSquared(c),x=m.dot(c,s)*A,C=m.multiplyByScalar(s,x,rY);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=B.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=B.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=B.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&Bpe(e)}function Lpe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function Npe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function Fpe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var PV=new B,OV=new B;Object.defineProperties(Zt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return tc(this),this._invTransform}},viewMatrix:{get:function(){return tc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return tc(this),this._invViewMatrix}},positionCartographic:{get:function(){return tc(this),this._positionCartographic}},positionWC:{get:function(){return tc(this),this._positionWC}},directionWC:{get:function(){return tc(this),this._directionWC}},upWC:{get:function(){return tc(this),this._upWC}},rightWC:{get:function(){return tc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,PV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,OV);this._setTransform(n);let i=Lpe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,PV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,OV);this._setTransform(n);let i=Npe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,PV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,OV);this._setTransform(n);let i=Fpe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Zt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&zpe(this,this.position)};var Int=new m,Pnt=new m,Ont=new m;Zt.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Int),n=m.clone(this.upWC,Pnt),i=m.clone(this.directionWC,Ont);B.clone(e,this._transform),this._transformChanged=!0,tc(this);let r=this._actualInvTransform;B.multiplyByPoint(r,t,this.position),B.multiplyByPointAsVector(r,i,this.direction),B.multiplyByPointAsVector(r,n,this.up),m.cross(this.direction,this.up,this.right),tc(this)};var Rnt=new H,Mnt=new On,Bnt=new m,Lnt=new m;function Upe(e){if(!B.equals(B.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Rnt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let r;if(l(n)){let a=e.getPickRay(i,Mnt);r=n.pickWorldCoordinates(a,t,!0,Bnt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,Lnt));let s;if(l(r)||l(o)){let a=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Zt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Upe(this)))};var RV=new m,lY=new B,Nnt=new B,uY=new Ne,fY=new Z,Vpe=new he;function Fnt(e,t,n){let i=B.clone(e.transform,lY),r=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Nnt);e._setTransform(r),m.clone(m.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Ne.fromHeadingPitchRoll(n,uY),s=Z.fromQuaternion(o,fY);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Unt(e,t,n,i){let r=B.clone(e.transform,lY);if(e._setTransform(B.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Vpe);t=a.project(c,RV)}m.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Ne.fromHeadingPitchRoll(n,uY),s=Z.fromQuaternion(o,fY);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function Vnt(e,t,n,i){let r=B.clone(e.transform,lY);if(e._setTransform(B.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Vpe);t=c.project(u,RV)}H.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===hu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Ne.fromHeadingPitchRoll(n,uY),s=Z.fromQuaternion(o,fY);Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(r)}var knt=new m,znt=new m,Hnt=new m;function kpe(e,t,n,i){let r=m.clone(n.direction,knt),o=m.clone(n.up,znt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,PV),u=B.inverseTransformation(c,OV);B.multiplyByPointAsVector(u,r,r),B.multiplyByPointAsVector(u,o,o)}let s=m.cross(r,o,Hnt);return i.heading=Lpe(r,o),i.pitch=Npe(r),i.roll=Fpe(r,o,s),i}var cY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},tb=new lc;Zt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),r=y(e.destination,m.clone(this.positionWC,RV));l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,RV),i=!1),l(t.direction)&&(t=kpe(this,r,t,cY.orientation)),tb.heading=y(t.heading,0),tb.pitch=y(t.pitch,-P.PI_OVER_TWO),tb.roll=y(t.roll,0),n===ne.SCENE3D?Fnt(this,r,tb):n===ne.SCENE2D?Vnt(this,r,tb,i):Unt(this,r,tb,i)};var Gnt=new m;Zt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Zt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:B.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Zt.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*Zt.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:B.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Gnt).z),roll:0},endTransform:B.IDENTITY,convert:!1})}};Zt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),tc(this),B.multiplyByVector(this._actualInvTransform,e,t)};Zt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),tc(this),B.multiplyByPoint(this._actualInvTransform,e,t)};Zt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),tc(this),B.multiplyByPointAsVector(this._actualInvTransform,e,t)};Zt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),tc(this),B.multiplyByVector(this._actualTransform,e,t)};Zt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),tc(this),B.multiplyByPoint(this._actualTransform,e,t)};Zt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),tc(this),B.multiplyByPointAsVector(this._actualTransform,e,t)};function zpe(e,t){let n=e._scene.mapMode2D===hu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var wpe=new m;Zt.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,wpe),m.add(n,wpe,n),this._mode===ne.SCENE2D&&zpe(this,n),this._adjustOrthographicFrustum(!0)};Zt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?MV(this,e):this.move(this.direction,e)};Zt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?MV(this,-e):this.move(this.direction,-e)};Zt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Zt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Zt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Zt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Zt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Zt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Zt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Zt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Wnt=new Ne,jnt=new Z;Zt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Ne.fromAxisAngle(e,-n,Wnt),r=Z.fromQuaternion(i,jnt),o=this.direction,s=this.up,a=this.right;Z.multiplyByVector(r,o,o),Z.multiplyByVector(r,s,s),Z.multiplyByVector(r,a,a)};Zt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Zt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Ynt=new Ne,qnt=new Z;Zt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Ne.fromAxisAngle(e,-n,Ynt),r=Z.fromQuaternion(i,qnt);Z.multiplyByVector(r,this.position,this.position),Z.multiplyByVector(r,this.direction,this.direction),Z.multiplyByVector(r,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Zt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Hpe(this,e)};Zt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Hpe(this,-e)};var Xnt=new m,Knt=new m,Jnt=new m,Dpe=new m;function Hpe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,P.EPSILON2)){let i=m.normalize(n,Xnt),r=m.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=m.equalsEpsilon(i,m.negate(e.constrainedAxis,Dpe),P.EPSILON2);if(!r&&!o){let s=m.normalize(e.constrainedAxis,Knt),a=m.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=m.dot(i,m.negate(s,Dpe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=m.cross(s,i,Jnt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Zt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Gpe(this,-e)};Zt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Gpe(this,e)};function Gpe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function MV(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===hu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===hu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function Wpe(e,t){e.move(e.direction,t)}Zt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?MV(this,e):Wpe(this,e)};Zt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?MV(this,-e):Wpe(this,-e)};Zt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Znt=new B;Zt.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,re.WGS84,Znt);this.lookAtTransform(n,t)};var Qnt=new m,$nt=new Ne,eit=new Ne,tit=new Z;function jpe(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Ne.fromAxisAngle(m.UNIT_Y,-t,$nt),r=Ne.fromAxisAngle(m.UNIT_Z,-e,eit),o=Ne.multiply(r,i,r),s=Z.fromQuaternion(o,tit),a=m.clone(m.UNIT_X,Qnt);return Z.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}Zt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=jpe(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<P.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(B.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<P.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var ED=new he,nit=new he,iit=new m,rit=new m,oit=new m,sit=new m,ait=new m,cit=new m,lit=new m,oY=new m,uit={direction:new m,right:new m,up:new m},Ipe;function ec(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Ype(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:uit,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=P.TWO_PI);let f=(u+c)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let L=ED;L.longitude=f,L.latitude=s,L.height=0;let N=nit;N.longitude=f,N.latitude=a,N.height=0;let _=Ipe;(!l(_)||_.ellipsoid!==r)&&(Ipe=_=new Wf(void 0,void 0,r)),_.setEndPoints(L,N),d=_.interpolateUsingFraction(.5,ED).latitude}let p=ED;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,lit),h=ED;h.longitude=c,h.latitude=s;let A=r.cartographicToCartesian(h,iit);h.longitude=u;let x=r.cartographicToCartesian(h,oit);h.longitude=f;let C=r.cartographicToCartesian(h,ait);h.latitude=a;let T=r.cartographicToCartesian(h,cit);h.longitude=c;let E=r.cartographicToCartesian(h,sit);h.longitude=u;let S=r.cartographicToCartesian(h,rit);m.subtract(x,g,x),m.subtract(E,g,E),m.subtract(A,g,A),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(T,g,T);let w=r.geodeticSurfaceNormal(g,o.direction);m.negate(w,w);let D=m.cross(w,m.UNIT_Z,o.right);m.normalize(D,D);let R=m.cross(D,w,o.up),O;if(e.frustum instanceof rn){let L=Math.max(m.distance(A,x),m.distance(E,S)),N=Math.max(m.distance(A,E),m.distance(x,S)),_,b,v=e.frustum._offCenterFrustum,I=v.right/v.top,M=N*I;L>M?(_=L,b=_/I):(b=N,_=M),O=Math.max(_,b)}else{let L=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*L;if(O=Math.max(ec(w,R,x,L),ec(w,R,E,L),ec(w,R,A,L),ec(w,R,S,L),ec(w,R,C,L),ec(w,R,T,L),ec(w,D,x,N),ec(w,D,E,N),ec(w,D,A,N),ec(w,D,S,N),ec(w,D,C,N),ec(w,D,T,N)),a<0&&s>0){let _=ED;_.longitude=u,_.latitude=0,_.height=0;let b=r.cartographicToCartesian(_,oY);m.subtract(b,g,b),O=Math.max(O,ec(w,R,b,L),ec(w,D,b,N)),_.longitude=c,b=r.cartographicToCartesian(_,oY),m.subtract(b,g,b),O=Math.max(O,ec(w,R,b,L),ec(w,D,b,N))}}return m.add(g,m.multiplyByScalar(w,-O,oY),n)}var fit=new he,dit=new m,mit=new m;function hit(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=fit;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,dit);B.multiplyByPoint(r,a,a),B.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,mit);if(B.multiplyByPoint(r,c,c),B.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var pit=new he,_it=new m,git=new m;function yit(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===hu.INFINITE_SCROLL?r+=P.TWO_PI:(t=ce.MAX_VALUE,r=t.east));let o=pit;o.longitude=r,o.latitude=t.north;let s=i.project(o,_it);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,git),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}Zt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===ne.SCENE3D)return Ype(this,e,t);if(n===ne.COLUMBUS_VIEW)return hit(this,e,t);if(n===ne.SCENE2D)return yit(this,e,t)};var Ait=new On;function xit(e,t,n,i){n=y(n,re.WGS84);let r=e.getPickRay(t,Ait),o=Ki.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return On.getPoint(r,s,i)}var Cit=new On;function Tit(e,t,n,i){let o=e.getPickRay(t,Cit).origin;o=m.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Eit=new On;function bit(e,t,n,i){let r=e.getPickRay(t,Eit),o=-r.origin.x/r.direction.x;On.getPoint(r,o,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Zt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,re.WGS84),this._mode===ne.SCENE3D)n=xit(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Tit(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=bit(this,e,this._projection,n);else return;return n}};var Sit=new m,vit=new m,wit=new m;function Dit(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,Sit);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,u*c*a,vit),h=m.multiplyByScalar(e.upWC,f*c*s,wit),A=m.add(p,g,n.direction);return m.add(A,h,A),m.subtract(A,d,A),m.normalize(A,A),n}var DV=new m;function Iit(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,DV),m.add(DV,f,f),m.multiplyByScalar(e.up,u,DV),m.add(DV,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Zt.prototype.getPickRay=function(e,t){l(t)||(t=new On);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Dit(this,e,t):Iit(this,e,t)};var Pit=new m,Oit=new m;Zt.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Pit),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Oit);return Math.max(0,m.magnitude(n)-e.radius)};var Rit=new H;Zt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Rit);return Math.max(r.x,r.y)};function Mit(e,t,n,i,r,o){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Fo.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Bit=new m,Ppe=new m,Lit=new m,Nit=new m;function Fit(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(m.UNIT_X,Bit),o=-m.dot(r,n)/m.dot(r,i),s=m.add(n,m.multiplyByScalar(i,o,Ppe),Ppe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Lit);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=m.magnitude(m.subtract(n,s,Nit)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),A=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-A||n.y>A){let x=s.y<-h||s.y>h,C=s.z<-A||s.z>A;if(x||C)return Mit(e,n,s,h,A,t)}}Zt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Fit(this,e)};var Uit=new m,ws={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Zt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Zt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ws.destination,e.orientation.heading=ws.heading,e.orientation.pitch=ws.pitch,e.orientation.roll=ws.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Zt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Uit));let r=y(e.orientation,y.EMPTY_OBJECT);if(l(r.direction)&&(r=kpe(this,t,r,cY.orientation)),l(e.duration)&&e.duration<=0){let f=cY;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;ws.destination=t,ws.heading=r.heading,ws.pitch=r.pitch,ws.roll=r.roll,ws.duration=e.duration,ws.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},ws.cancel=e.cancel,ws.endTransform=e.endTransform,ws.convert=i?!1:e.convert,ws.maximumHeight=e.maximumHeight,ws.pitchAdjustHeight=e.pitchAdjustHeight,ws.flyOverLongitude=e.flyOverLongitude,ws.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ws.easingFunction=e.easingFunction;let a=this._scene,c=vV.createTween(a,ws);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=Zt.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Vit(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function kit(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var zit=100;function qpe(e,t,n){n=df.clone(l(n)?n:Zt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=zit:e.frustum instanceof rn||e._mode===ne.SCENE2D?n.range=kit(e,s):n.range=Vit(e,s),n.range=P.clamp(n.range,i,r)}return n}Zt.prototype.viewBoundingSphere=function(e,t){t=qpe(this,e,t),this.lookAt(e.center,t)};var Hit=new B,Git=new m,Wit=new m,jit=new m,Yit=new m,qit=new oe,Xit=new Ne,Kit=new Z;Zt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(B.IDENTITY);let i=qpe(this,e,t.offset),r;n?r=m.multiplyByScalar(m.UNIT_Z,i.range,Git):r=jpe(i.heading,i.pitch,i.range);let o=Mt.eastNorthUpToFixedFrame(e.center,re.WGS84,Hit);B.multiplyByPoint(o,r,r);let s,a;if(!n){if(s=m.subtract(e.center,r,Wit),m.normalize(s,s),a=B.multiplyByPointAsVector(o,m.UNIT_Z,jit),1-Math.abs(m.dot(s,a))<P.EPSILON6){let u=Ne.fromAxisAngle(s,i.heading,Xit),f=Z.fromQuaternion(u,Kit);m.fromCartesian4(B.getColumn(o,1,qit),a),Z.multiplyByVector(f,a,a)}let c=m.cross(s,a,Yit);m.cross(c,s,a),m.normalize(a,a)}this.flyTo({destination:r,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Ope=new m,Rpe=new m,sY=new m,Mpe=new m,bD=[new m,new m,new m,new m];function Jit(e,t){let n=t.radii,i=e.positionWC,r=m.multiplyComponents(t.oneOverRadii,i,Ope),o=m.magnitude(r),s=m.normalize(r,Rpe),a,c;m.equalsEpsilon(s,m.UNIT_Z,P.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,sY),sY),c=m.normalize(m.cross(s,a,Mpe),Mpe));let u=Math.sqrt(m.magnitudeSquared(r)-1),f=m.multiplyByScalar(s,1/o,Ope),d=u/o,p=m.multiplyByScalar(a,d,Rpe),g=m.multiplyByScalar(c,d,sY),h=m.add(f,g,bD[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let A=m.subtract(f,g,bD[1]);m.subtract(A,p,A),m.multiplyComponents(n,A,A);let x=m.subtract(f,g,bD[2]);m.add(x,p,x),m.multiplyComponents(n,x,x);let C=m.add(f,g,bD[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),bD}var aY=new H,Zit=new m,Ay=[new he,new he,new he,new he];function IV(e,t,n,i,r,o){aY.x=e,aY.y=t;let s=i.pickEllipsoid(aY,r,Zit);return l(s)?(Ay[n]=r.cartesianToCartographic(s,Ay[n]),1):(Ay[n]=r.cartesianToCartographic(o[n],Ay[n]),0)}Zt.prototype.computeViewRectangle=function(e,t){e=y(e,re.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===tn.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=Jit(this,e);if(c+=IV(0,0,0,this,e,u),c+=IV(0,a,1,this,e,u),c+=IV(s,a,2,this,e,u),c+=IV(s,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Ay,t);let f=0,d=Ay[3].longitude;for(let p=0;p<4;++p){let g=Ay[p].longitude,h=Math.abs(g-d);h>P.PI?f+=P.TWO_PI-h:f+=h,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,Ay[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};Zt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof vi)return;let e=this._scene;this.frustum=new vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};Zt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof rn)return;let e=Upe(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Zt.clone=function(e,t){return l(t)||(t=new Zt(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),B.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var fr=Zt;var Qit={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ni=Object.freeze(Qit);function nc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function $it(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Xpe(e,t,n){let i=nc(Ni.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new H;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?($it(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function Kpe(e,t){let n=nc(Ni.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},Cn.WHEEL,t)}function nb(e,t,n){let i=nc(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;r[i]=!1,o[i]=new H;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let u,f;n===Ni.LEFT_DRAG?(u=Cn.LEFT_DOWN,f=Cn.LEFT_UP):n===Ni.RIGHT_DRAG?(u=Cn.RIGHT_DOWN,f=Cn.RIGHT_UP):n===Ni.MIDDLE_DRAG&&(u=Cn.MIDDLE_DOWN,f=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,r[i]=!0,s[i]=new Date,H.clone(d.position,o[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,a[i]=new Date},f,t)}function Jpe(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function Zpe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in Ni)if(Ni.hasOwnProperty(s)){let a=Ni[s];if(l(a)){let c=nc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new H,endPosition:new H,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Ni)if(Ni.hasOwnProperty(a)){let c=Ni[a];if(l(c)){let u=nc(c,t);o[u]&&(n[u]?(Jpe(i[u],r[u]),r[u].valid=!0,Jpe(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function Af(e){this._eventHandler=new gf(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,Kpe(this,void 0),Xpe(this,void 0,e),nb(this,void 0,Ni.LEFT_DRAG),nb(this,void 0,Ni.RIGHT_DRAG),nb(this,void 0,Ni.MIDDLE_DRAG),Zpe(this,void 0);for(let t in Ca)if(Ca.hasOwnProperty(t)){let n=Ca[t];l(n)&&(Kpe(this,n),Xpe(this,n,e),nb(this,n,Ni.LEFT_DRAG),nb(this,n,Ni.RIGHT_DRAG),nb(this,n,Ni.MIDDLE_DRAG),Zpe(this,n))}}Object.defineProperties(Af.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[nc(Ni.WHEEL)]||!this._update[nc(Ni.WHEEL,Ca.SHIFT)]||!this._update[nc(Ni.WHEEL,Ca.CTRL)]||!this._update[nc(Ni.WHEEL,Ca.ALT)];return this._buttonsDown>0||e}}});Af.prototype.isMoving=function(e,t){let n=nc(e,t);return!this._update[n]};Af.prototype.getMovement=function(e,t){let n=nc(e,t);return this._movement[n]};Af.prototype.getLastMovement=function(e,t){let n=nc(e,t),i=this._lastMovement[n];if(i.valid)return i};Af.prototype.isButtonDown=function(e,t){let n=nc(e,t);return this._isDown[n]};Af.prototype.getStartMousePosition=function(e,t){if(e===Ni.WHEEL)return this._currentMousePosition;let n=nc(e,t);return this._eventStartPosition[n]};Af.prototype.getButtonPressTime=function(e,t){let n=nc(e,t);return this._pressTime[n]};Af.prototype.getButtonReleaseTime=function(e,t){let n=nc(e,t);return this._releaseTime[n]};Af.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var BV=Af;function Gp(){this.featurePropertiesDirty=!1}Object.defineProperties(Gp.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});Gp.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};Gp.prototype.getFeature=function(e){fe.throwInstantiationError()};Gp.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};Gp.prototype.applyStyle=function(e){fe.throwInstantiationError()};Gp.prototype.update=function(e,t){fe.throwInstantiationError()};Gp.prototype.isDestroyed=function(){fe.throwInstantiationError()};Gp.prototype.destroy=function(){fe.throwInstantiationError()};var Qpe=Gp;function ert(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Ud=ert;function ib(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,nrt(this,t)}Object.defineProperties(ib.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function trt(e,t){this.condition=e,this.expression=t}function nrt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new trt(new qf(a,t),new qf(c,t)))}e._runtimeConditions=n}ib.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};ib.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};ib.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) - { - return ${f}; - } -`}return o=`${i} ${e} +`;function HC(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(HC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function K2e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var j5=new H;function J2e(e,t){let n=new We({defines:["LOG_DEPTH_WRITE"],sources:[jL]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return j5.x=e._radius,j5.y=e._strength,j5}},o=Ve.fromCache({blending:mn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ae.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:Ae.CESIUM_3D_TILE,owner:e})}function Z2e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),J2e(e,t)}function Ote(e){return e.drawBuffers&&e.fragmentDepth}HC.isSupported=Ote;function $2e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=We.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() +{ + czm_point_cloud_post_process_main(); +#ifdef LOG_DEPTH + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}HC.prototype.update=function(e,t,n,i){if(!Ote(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Z2e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Fe.POINTS||u.pass===Ae.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=nt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=$2e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};HC.prototype.isDestroyed=function(){return!1};HC.prototype.destroy=function(){return K2e(this),ue(this)};var $_=HC;function Rte(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Rte.isSupported=function(e){return $_.isSupported(e.context)};var tp=Rte;var _a={},Q2e=new re(0,0,0,1),Ga=new re,eBe=new Ke,q5=new H,Y5=new H;_a.wgs84ToWindowCoordinates=function(e,t,n){return _a.wgs84WithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Mte=new re,Lte=new m;function pv(e,t,n,i){let o=n.viewMatrix,r=L.multiplyByVector(o,re.fromElements(e.x,e.y,e.z,1,Mte),Mte),s=m.multiplyComponents(t,m.normalize(r,Lte),Lte);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,L.multiplyByVector(n.frustum.projectionMatrix,r,i)}var tBe=new me(Math.PI,P.PI_OVER_TWO),nBe=new m,iBe=new m;_a.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=_a.computeActualWgs84Position(o,t,Q2e);if(!l(r))return;let s=e.canvas,a=eBe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,d=tBe,p=f.project(d,nBe),g=m.clone(c.position,iBe),h=c.frustum.clone(),x=L.computeViewportTransformation(a,0,1,new L),b=c.frustum.projectionMatrix,C=c.positionWC.y,T=m.fromElements(P.sign(C)*p.x-C,0,-c.positionWC.x),A=Mt.pointToGLWindowCoordinates(b,x,T);if(C===0||A.x<=0||A.x>=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-C,Ga=pv(r,n,c,Ga),_a.clipToGLWindowCoordinates(a,Ga,q5),a.x+=A.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,Ga=pv(r,n,c,Ga),_a.clipToGLWindowCoordinates(a,Ga,Y5)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-C,Ga=pv(r,n,c,Ga),_a.clipToGLWindowCoordinates(a,Ga,q5),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,Ga=pv(r,n,c,Ga),_a.clipToGLWindowCoordinates(a,Ga,Y5)}m.clone(g,c.position),c.frustum=h.clone(),i=H.clone(q5,i),(i.x<0||i.x>s.clientWidth)&&(i.x=Y5.x)}}if(o.mode!==ne.SCENE2D||u){if(Ga=pv(r,n,c,Ga),Ga.z<0&&!(c.frustum instanceof on)&&!(c.frustum instanceof Or))return;i=_a.clipToGLWindowCoordinates(a,Ga,i)}return i.y=s.clientHeight-i.y,i};_a.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=_a.wgs84ToWindowCoordinates(e,t,n),!!l(n))return _a.transformWindowToDrawingBuffer(e,n,n)};var np=new m,oBe=new me;_a.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,oBe);if(!l(r))return;if(o.project(r,np),i===ne.COLUMBUS_VIEW)return m.fromElements(np.z,np.x,np.y,n);if(i===ne.SCENE2D)return m.fromElements(0,np.x,np.y,n);let s=e.morphTime;return m.fromElements(P.lerp(np.z,t.x,s),P.lerp(np.x,t.y,s),P.lerp(np.y,t.z,s),n)};var Nte=new m,Fte=new m,Bte=new L;_a.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Nte),L.computeViewportTransformation(e,0,1,Bte),L.multiplyByPoint(Bte,Nte,Fte),H.fromCartesian3(Fte,n)};_a.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*o,t.y*r,n)};var rBe=new re,kte=new re;_a.drawingBufferToWgs84Coordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,h=Math.pow(2,g)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,f=re.clone(re.UNIT_W,rBe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=L.multiplyByVector(r.inverseViewProjection,f,kte);let g=1/d.w;m.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=kte,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=L.multiplyByVector(r.inverseView,d,d)}return m.fromCartesian4(d,i)};var eo=_a;var sBe={LEFT:-1,NONE:0,RIGHT:1},ol=Object.freeze(sBe);var GC={};GC._deprecationWarning=Q;var ip=Uint32Array.BYTES_PER_ELEMENT;GC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ip;let r=o.getUint32(t,!0);if(r!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=ip;let s=o.getUint32(t,!0);t+=ip;let a=o.getUint32(t,!0);t+=ip;let c=o.getUint32(t,!0);t+=ip;let u=o.getUint32(t,!0);t+=ip;let f=o.getUint32(t,!0);t+=ip;let d;u>=570425344?(t-=ip*2,d=a,u=c,f=0,a=0,c=0,GC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=ip,d=u,u=a,f=c,a=0,c=0,GC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Mo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Mo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(GC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var qL=GC;function _v(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Ute(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function aBe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}_v.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),Ute(this,e,t,n,1,i.byteOffset)):i};_v.prototype.hasProperty=function(e){return l(this.json[e])};_v.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),Ute(this,e,t,n,this.featuresLength,i.byteOffset)):aBe(this,e,t,i)};_v.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Em=_v;function gv(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=cBe(n),a;l(s.jsonProperties)&&(a=new J_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new EC({extension:s.hierarchy,binaryBody:i}));let u=Cm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(o){let b=uBe(t,u,f,i,r);g=b.transcodedSchema,p=[new BC({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=lBe(t,u,f,i);g=b.transcodedSchema;let C=b.featureTableJson;d=new Vl({count:C.count,properties:C.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let h=[];if(l(d)||l(a)||l(c)){let b=new tl({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});h.push(b)}let x={schema:g,propertyTables:h,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ha(x)}function cBe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(gv._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function lBe(e,t,n,i){let o={},r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new de(`Property ${d} requires a batch table binary.`);let p=n[d],g=Fu(p);r[d]={bufferView:a},o[d]=Vte(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=Tm.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function uBe(e,t,n,i,o){let r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new de(`Property ${d} requires a batch table binary.`);let g=en.sanitizeGlslIdentifier(d);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let h=Vte(p);h.name=d,r[g]=h;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=Fu(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Ft.Attribute;C.name=x,C.count=e,C.type=p.type;let T=X.fromTypedArray(b);(T===X.INT||T===X.UNSIGNED_INT||T===X.DOUBLE)&&(gv._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),C.componentDatatype=X.fromTypedArray(b),C.typedArray=b,o.push(C),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let u=Tm.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Vte(e){let t=fBe(e.componentType);return{type:e.type,componentType:t}}function fBe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}gv._deprecationWarning=Q;gv._oneTimeWarning=Nt;var Q_=gv;var S0={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},dBe=Ft.FeatureIdAttribute;function eg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,_o.Y),u=y(e.forwardAxis,_o.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.loadIndicesForWireframe,!1),g=y(e.loadPrimitiveOutline,!0),h=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=h,this._state=S0.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=L.IDENTITY}l(Object.create)&&(eg.prototype=Object.create(ro.prototype),eg.prototype.constructor=eg);Object.defineProperties(eg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});eg.prototype.load=function(){if(l(this._promise))return this._promise;let e=qL.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Em(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=L.fromTranslation(m.fromArray(a))),this._batchTable={json:o,binary:r};let c=new ep({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=S0.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=S0.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return mBe(u,f)}),this._promise};function mBe(e,t){e.unload(),e._state=S0.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}eg.prototype.process=function(e){if(this._state===S0.READY)return!0;if(this._state!==S0.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=L.multiplyTransformation(this._transform,n.transform,n.transform),hBe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=S0.READY,!0};function hBe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new tl({name:Cm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ha({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)zte(r[a]);t.structuralMetadata=o}function zte(e){let t=e.children.length;for(let i=0;i<t;i++)zte(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=en.getAttributeBySemantic(o,Et.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new dBe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}eg.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var YL=eg;function tg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(tg.prototype=Object.create(ro.prototype),tg.prototype.constructor=tg);Object.defineProperties(tg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});tg.prototype.load=function(){return Promise.resolve(this)};tg.prototype.process=function(e){return l(this._components)||(this._components=wBe(this._geoJson,e),this._geoJson=void 0),!0};function pBe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function _Be(){this.features=[]}function X5(e){let t=e[0],n=e[1],i=y(e[2],0);return new m(t,n,i)}function K5(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=X5(e[o]);return[n]}function gBe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=K5(e[i])[0];return n}function Hte(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=K5(e[i])[0];return n}function yBe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Hte(e[i]));return n}function xBe(e){return[X5(e)]}function bBe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=X5(e[i]);return n}var CBe={LineString:K5,MultiLineString:gBe,MultiPolygon:yBe,Polygon:Hte,MultiPoint:bBe,Point:xBe},TBe={LineString:Fe.LINES,MultiLineString:Fe.LINES,MultiPolygon:Fe.LINES,Polygon:Fe.LINES,MultiPoint:Fe.POINTS,Point:Fe.POINTS};function Gte(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=CBe[n],o=TBe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new pBe;o===Fe.LINES?s.lines=i(r):o===Fe.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function ABe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Gte(n[o],t)}var EBe={FeatureCollection:ABe,Feature:Gte},XL=new m;function SBe(e,t,n){let i=0,o=0,r=e.length;for(let N=0;N<r;N++){let F=e[N];if(l(F.lines)){let _=F.lines.length;for(let E=0;E<_;E++){let w=F.lines[E];i+=w.length,o+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ue.createTypedArray(i,o),u=Ue.fromTypedArray(c),f=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let N=0;N<r;N++){let F=e[N];if(!l(F.lines))continue;let _=F.lines.length;for(let E=0;E<_;E++){let w=F.lines[E],D=w.length;for(let M=0;M<D;M++){let B=w[M],V=m.fromDegrees(B.x,B.y,B.z,oe.WGS84,XL),U=L.multiplyByPoint(t,V,XL);m.minimumByComponent(f,U,f),m.maximumByComponent(d,U,d),m.pack(U,s,p*3),a[p]=N,M<D-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let h=ht.createVertexBuffer({typedArray:s,context:n.context,usage:ke.STATIC_DRAW});h.vertexArrayDestroyable=!1;let x=ht.createVertexBuffer({typedArray:a,context:n.context,usage:ke.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=ht.createIndexBuffer({typedArray:c,context:n.context,usage:ke.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let C=new Ft.Attribute;C.semantic=Et.POSITION,C.componentDatatype=X.FLOAT,C.type=ln.VEC3,C.count=i,C.min=f,C.max=d,C.buffer=h;let T=new Ft.Attribute;T.semantic=Et.FEATURE_ID,T.setIndex=0,T.componentDatatype=X.FLOAT,T.type=ln.SCALAR,T.count=i,T.buffer=x;let A=[C,T],S=new Ft.Material;S.unlit=!0;let v=new Ft.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let I=new Ft.FeatureIdAttribute;I.featureCount=r,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let O=[I],R=new Ft.Primitive;return R.attributes=A,R.indices=v,R.featureIds=O,R.primitiveType=Fe.LINES,R.material=S,R}function vBe(e,t,n){let i=0,o=e.length;for(let A=0;A<o;A++){let S=e[A];l(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let A=0;A<o;A++){let S=e[A];if(!l(S.points))continue;let v=S.points.length;for(let I=0;I<v;I++){let O=S.points[I],R=m.fromDegrees(O.x,O.y,O.z,oe.WGS84,XL),N=L.multiplyByPoint(t,R,XL);m.minimumByComponent(a,N,a),m.maximumByComponent(c,N,c),m.pack(N,r,u*3),s[u]=A,u++}}let f=ht.createVertexBuffer({typedArray:r,context:n.context,usage:ke.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=ht.createVertexBuffer({typedArray:s,context:n.context,usage:ke.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Ft.Attribute;p.semantic=Et.POSITION,p.componentDatatype=X.FLOAT,p.type=ln.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Ft.Attribute;g.semantic=Et.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=ln.SCALAR,g.count=i,g.buffer=d;let h=[p,g],x=new Ft.Material;x.unlit=!0;let b=new Ft.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let C=[b],T=new Ft.Primitive;return T.attributes=h,T.featureIds=C,T.primitiveType=Fe.POINTS,T.material=x,T}function wBe(e,t){let n=new _Be,i=EBe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new de("GeoJSON must have at least one feature");let s={};for(let N=0;N<r;N++){let F=o[N],_=y(F.properties,y.EMPTY_OBJECT);for(let E in _)_.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(r)))}for(let N=0;N<r;N++){let F=o[N];for(let _ in s)if(s.hasOwnProperty(_)){let E=y(F.properties[_],"");s[_][N]=E}}let a=new J_({count:r,properties:s}),u=[new tl({id:0,count:r,jsonMetadataTable:a})],f=Tm.fromJson({}),d=new Ha({schema:f,propertyTables:u}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),h=!1,x=!1;for(let N=0;N<r;N++){let F=o[N];if(l(F.lines)){h=!0;let _=F.lines.length;for(let E=0;E<_;E++){let w=F.lines[E],D=w.length;for(let M=0;M<D;M++)m.minimumByComponent(p,w[M],p),m.maximumByComponent(g,w[M],g)}}if(l(F.points)){x=!0;let _=F.points.length;for(let E=0;E<_;E++){let w=F.points[E];m.minimumByComponent(p,w,p),m.maximumByComponent(g,w,g)}}}let b=m.midpoint(p,g,new m),C=m.fromDegrees(b.x,b.y,b.z,oe.WGS84,new m),T=Mt.eastNorthUpToFixedFrame(C,oe.WGS84,new L),A=L.inverseTransformation(T,new L),S=[];h&&S.push(SBe(o,A,t)),x&&S.push(vBe(o,A,t));let v=new Ft.Node;v.index=0,v.primitives=S;let I=[v],O=new Ft.Scene;O.nodes=I;let R=new Ft.Components;return R.scene=O,R.nodes=I,R.transform=T,R.structuralMetadata=d,R}tg.prototype.unload=function(){this._components=void 0};var KL=tg;var JL={};JL._deprecationWarning=Q;var ng=Uint32Array.BYTES_PER_ELEMENT;JL.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ng;let r=o.getUint32(t,!0);if(r!==1)throw new de(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=ng;let s=o.getUint32(t,!0);t+=ng;let a=o.getUint32(t,!0);if(a===0)throw new de("featureTableJsonByteLength is zero, the feature table must be defined.");t+=ng;let c=o.getUint32(t,!0);t+=ng;let u=o.getUint32(t,!0);t+=ng;let f=o.getUint32(t,!0);t+=ng;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new de(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=ng;let p=Mo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Mo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,b):(JL._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:h,batchTableBinary:x,gltf:C}};var ZL=JL;var op={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},$L=Ft.Attribute,IBe=Ft.FeatureIdAttribute,jte=Ft.Instances;function rp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,_o.Y),u=y(e.forwardAxis,_o.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=op.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=L.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(rp.prototype=Object.create(ro.prototype),rp.prototype.constructor=rp);Object.defineProperties(rp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});rp.prototype.load=function(){if(l(this._promise))return this._promise;let e=ZL.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Em(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=L.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=Bl(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new ep(u);return this._gltfLoader=f,this._state=op.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=op.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw DBe(this,d)}),this._promise};function DBe(e,t){e.unload(),e._state=op.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}rp.prototype.process=function(e){if(this._state===op.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===op.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=L.multiplyTransformation(this._transform,i.transform,i.transform),RBe(this,i,e),PBe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=op.READY,!0};function PBe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new tl({name:Cm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ha({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var QL=new m,J5=new Array(4),OBe=new L;function RBe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=LBe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),h=m.unpackArray(f),x=new m,b=new m,C=new m,T=new m,A=new Z,S=new Be,v=new Array(4),I=new m,O=new Array(3),R=new L;if(!l(s)){let U=ae.fromPoints(h);for(i=0;i<h.length;i++)m.subtract(h[i],U.center,QL),f[3*i+0]=QL.x,f[3*i+1]=QL.y,f[3*i+2]=QL.z;let G=L.fromTranslation(U.center,OBe);t.transform=L.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<r;i++){x=m.clone(h[i]),l(s)&&m.add(x,m.unpack(s),x),c&&(NBe(o,a,i,S,x,C,b,T,A,R),Be.pack(S,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(FBe(o,i,I),m.pack(I,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let U=o.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let N=new jte;N.transformInWorldSpace=!0;let F=e._buffers,_=new $L;if(_.name="Instance Translation",_.semantic=Yr.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=ln.VEC3,_.count=r,_.typedArray=f,!c){let U=ht.createVertexBuffer({context:n.context,typedArray:f,usage:ke.STATIC_DRAW});U.vertexArrayDestroyable=!1,F.push(U),_.buffer=U}if(N.attributes.push(_),c){let U=new $L;U.name="Instance Rotation",U.semantic=Yr.ROTATION,U.componentDatatype=X.FLOAT,U.type=ln.VEC4,U.count=r,U.typedArray=d,N.attributes.push(U)}if(u){let U=new $L;if(U.name="Instance Scale",U.semantic=Yr.SCALE,U.componentDatatype=X.FLOAT,U.type=ln.VEC3,U.count=r,c)U.typedArray=p;else{let G=ht.createVertexBuffer({context:n.context,typedArray:p,usage:ke.STATIC_DRAW});G.vertexArrayDestroyable=!1,F.push(G),U.buffer=G}N.attributes.push(U)}let E=new $L;E.name="Instance Feature ID",E.setIndex=0,E.semantic=Yr.FEATURE_ID,E.componentDatatype=X.FLOAT,E.type=ln.SCALAR,E.count=r;let w=ht.createVertexBuffer({context:n.context,typedArray:g,usage:ke.STATIC_DRAW});w.vertexArrayDestroyable=!1,F.push(w),E.buffer=w,N.attributes.push(E);let D=new IBe;D.propertyTableId=0,D.setIndex=0,D.positionalLabel="instanceFeatureId_0",N.featureIds.push(D);let M=t.nodes,B=M.length,V=!1;for(i=0;i<B;i++){let U=M[i];U.primitives.length>0&&(U.instances=V?MBe(N):N,V=!0)}}function MBe(e){let t=new jte;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ye(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function LBe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(o))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new de("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Wte=new Array(4);function NBe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,J5),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,Wte),p=!1;if(l(f)){if(!l(d))throw new de("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(f,0,r),m.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,J5),h=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,Wte);if(l(g)){if(!l(h))throw new de("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Yn.octDecodeInRange(g[0],g[1],65535,r),Yn.octDecodeInRange(h[0],h[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(o,oe.WGS84,u),L.getMatrix3(u,c)):Z.clone(Z.IDENTITY,c)}p&&(m.cross(s,r,a),m.normalize(a,a),Z.setColumn(c,0,s,c),Z.setColumn(c,1,r,c),Z.setColumn(c,2,a,c)),Be.fromRotationMatrix(c,i)}function FBe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,J5);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function BBe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}rp.prototype.isUnloaded=function(){return this._state===op.UNLOADED};rp.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),BBe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=op.UNLOADED};var eN=rp;var kBe={STOPPED:0,ANIMATING:1},Sm=Object.freeze(kBe);function WC(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}WC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Be)return Be};WC.prototype.evaluate=fe.throwInstantiationError;WC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};WC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};WC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var so=WC;function jC(e){this._value=e,this._valueType=so.getPointType(e)}Object.defineProperties(jC.prototype,{value:{get:function(){return this._value}}});jC.prototype.findTimeInterval=function(e){};jC.prototype.wrapTime=function(e){return 0};jC.prototype.clampTime=function(e){return 0};jC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var tN=jC;function qC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=so.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(qC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});qC.prototype.findTimeInterval=so.prototype.findTimeInterval;qC.prototype.wrapTime=so.prototype.wrapTime;qC.prototype.clampTime=so.prototype.clampTime;qC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var v0=qC;var qte={};qte.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new m,s[a]=new m;o[0]=n[0]/t[0],r[0]=m.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var yv=qte;var Yte=[],Xte=[],Kte=[],Jte=[];function UBe(e,t,n){let i=Yte,o=Kte,r=Xte,s=Jte;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),yv.solve(i,r,o,s)}function VBe(e){let t=Yte,n=Kte,i=Xte,o=Jte;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r+1],e[r-1],s),m.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r],e[r-1],s),m.multiplyByScalar(s,3,s),yv.solve(t,i,n,o)}function rl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=so.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(rl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});rl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new rl({times:t,points:n,inTangents:r,outTangents:o})};rl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new v0({points:n,times:t});let i=VBe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new rl({times:t,points:n,inTangents:r,outTangents:o})};rl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=so.getPointType(n[0]);if(n.length<3)return new v0({points:n,times:t});let s=UBe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new rl({times:t,points:n,inTangents:c,outTangents:a})};rl.hermiteCoefficientMatrix=new L(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);rl.prototype.findTimeInterval=so.prototype.findTimeInterval;var zBe=new re,YC=new m;rl.prototype.wrapTime=so.prototype.wrapTime;rl.prototype.clampTime=so.prototype.clampTime;rl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=zBe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=L.multiplyByVector(rl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,YC),d.add(t,YC,t),d.multiplyByScalar(r[s],f.z,YC),d.add(t,YC,t),d.multiplyByScalar(o[s],f.w,YC),d.add(t,YC,t))};var w0=rl;function XC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=so.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(XC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});XC.prototype.findTimeInterval=so.prototype.findTimeInterval;XC.prototype.wrapTime=so.prototype.wrapTime;XC.prototype.clampTime=so.prototype.clampTime;XC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var nN=XC;function HBe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Be);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Be.fastSlerp(a,c,s,o)}}function KC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=HBe(this),this._lastTimeIndex=0}Object.defineProperties(KC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});KC.prototype.findTimeInterval=so.prototype.findTimeInterval;KC.prototype.wrapTime=so.prototype.wrapTime;KC.prototype.clampTime=so.prototype.clampTime;KC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var iN=KC;var I0=Ft.AnimatedPropertyType;function $5(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,jBe(this)}Object.defineProperties($5.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function GBe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new w0({times:e,points:n,inTangents:i,outTangents:o})}function Zte(e,t,n,i){if(e.length===1&&t.length===1)return new tN(t[0]);switch(n){case Am.STEP:return new nN({times:e,points:t});case Am.CUBICSPLINE:return GBe(e,t);case Am.LINEAR:return i===I0.ROTATION?new iN({times:e,points:t}):new v0({times:e,points:t})}}function WBe(e,t,n,i,o){let r=[];if(i===I0.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===Am.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(Zte(e,f,n,i))}}else r.push(Zte(e,t,n,i));return r}var Z5;function jBe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=WBe(i,o,r,a,u);switch(e._splines=f,e._path=a,a){case I0.TRANSLATION:case I0.SCALE:Z5=new m;break;case I0.ROTATION:Z5=new Be;break;case I0.WEIGHTS:break}}$5.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===I0.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);o[n]=r.evaluate(s,Z5)}}};var oN=$5;function Q5(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ee.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,Wl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Sm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,qBe(this)}Object.defineProperties(Q5.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function qBe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new oN({channel:u,runtimeAnimation:e,runtimeNode:p}),h=u.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}Q5.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var rN=Q5;function sp(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(sp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function e6(e,t,n){let i=e._model,o=new rN(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}sp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return e6(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return e6(this,n[i],e)};sp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=e6(this,n[r],e);i.push(s)}return i};sp.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};sp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};sp.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};sp.prototype.get=function(e){return this._runtimeAnimations[e]};var sN=[];function YBe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}sp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,o),a.delay,new ee)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=ee.lessThanOrEquals(c,o),p=l(f)&&ee.greaterThan(o,f),g=0;if(u!==0){let b=ee.secondsDifference(p?f:o,c);g=l(a._animationTime)?a._animationTime(u,b):b/u}let h=a.loop===Wl.REPEAT||a.loop===Wl.MIRRORED_REPEAT,x=(d||h&&!l(a.startTime))&&(g<=1||h)&&!p;if(g===a._prevAnimationDelta){let b=a._state===Sm.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=g,x||a._state===Sm.ANIMATING){if(x&&a._state===Sm.STOPPED&&(a._state=Sm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Wl.REPEAT)g=g-Math.floor(g);else if(a.loop===Wl.MIRRORED_REPEAT){let C=Math.floor(g),T=g-C;g=C%2===1?1-T:T}a.reverse&&(g=1-g);let b=g*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Sm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&sN.push(a))}}n=sN.length;for(let s=0;s<n;++s){let a=sN[s];t.splice(t.indexOf(a),1),e.afterRender.push(YBe(this,r,a))}return sN.length=0,i};var aN=sp;function D0(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(D0.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});D0.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};D0.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};D0.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};D0.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};D0.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var cN=D0;var xv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};xv.getStyleCommandsNeeded=function(e,t){return t===0?xv.ALL_OPAQUE:t===e?xv.ALL_TRANSLUCENT:xv.OPAQUE_AND_TRANSLUCENT};var vm=Object.freeze(xv);var ig={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ig.is3DTiles=function(e){switch(e){case ig.TILE_GLTF:case ig.TILE_B3DM:case ig.TILE_I3DM:case ig.TILE_PNTS:case ig.TILE_GEOJSON:return!0;case ig.GLTF:return!1}};var Go=Object.freeze(ig);function Ar(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=vm.ALL_OPAQUE,XBe(this)}Object.defineProperties(Ar.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function XBe(e){let t=e._model,n=Go.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new ks(s,o)}else for(o=0;o<i;o++)r[o]=new cN({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Qc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Ar.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=vm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Ar.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Ar.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Ar.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Ar.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Ar.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Ar.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Ar.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Ar.prototype.getFeature=function(e){return this._features[e]};Ar.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Ar.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Ar.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Ar.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Ar.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Ar.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Ar.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Ar.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Ar.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var KBe=new z;Ar.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Qc.DEFAULT_COLOR_VALUE),this.setAllShow(Qc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,KBe),Qc.DEFAULT_COLOR_VALUE):Qc.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),Qc.DEFAULT_SHOW_VALUE):Qc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Ar.prototype.isDestroyed=function(){return!1};Ar.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var lN=Ar;var uN=`czm_modelMaterial defaultModelMaterial() { -${o} return ${i}(1.0); + czm_modelMaterial material; + material.diffuse = vec3(0.0); + material.specular = vec3(1.0); + material.roughness = 1.0; + material.occlusion = 1.0; + material.normalEC = vec3(0.0, 0.0, 1.0); + material.emissive = vec3(0.0); + material.alpha = 1.0; + return material; } -`,o};ib.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];e.push.apply(e,r.condition.getVariables()),e.push.apply(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var LV=ib;function xy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,irt(this,e)}function irt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,r=y(t.meta,y.EMPTY_OBJECT);for(let o in r)r.hasOwnProperty(o)&&(n[o]=new qf(r[o],i))}e._meta=n,e._ready=!0}function Kr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new qf(String(t));if(typeof t=="string")return new qf(t,n);if(l(t.conditions))return new LV(t,n)}else return;return t}function Jr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(xy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Kr(this,e),this._style.show=Jr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Kr(this,e),this._style.color=Jr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Kr(this,e),this._style.pointSize=Jr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Kr(this,e),this._style.pointOutlineColor=Jr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Kr(this,e),this._style.pointOutlineWidth=Jr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Kr(this,e),this._style.labelColor=Jr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Kr(this,e),this._style.labelOutlineColor=Jr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Kr(this,e),this._style.labelOutlineWidth=Jr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Kr(this,e),this._style.font=Jr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Kr(this,e),this._style.labelStyle=Jr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Kr(this,e),this._style.labelText=Jr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Kr(this,e),this._style.backgroundColor=Jr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Kr(this,e),this._style.backgroundPadding=Jr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Kr(this,e),this._style.backgroundEnabled=Jr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Kr(this,e),this._style.scaleByDistance=Jr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Kr(this,e),this._style.translucencyByDistance=Jr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Kr(this,e),this._style.distanceDisplayCondition=Jr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Kr(this,e),this._style.heightOffset=Jr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Kr(this,e),this._style.anchorLineEnabled=Jr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Kr(this,e),this._style.anchorLineColor=Jr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Kr(this,e),this._style.image=Jr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Kr(this,e),this._style.disableDepthTestDistance=Jr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Kr(this,e),this._style.horizontalOrigin=Jr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Kr(this,e),this._style.verticalOrigin=Jr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Kr(this,e),this._style.labelHorizontalOrigin=Jr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Kr(this,e),this._style.labelVerticalOrigin=Jr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});xy.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new xy(n)})};xy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};xy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};xy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};xy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Cy=xy;function SD(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new jE({comparator:SD.comparator})}SD.prototype.addSubtree=function(e){let t=new rrt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};SD.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};SD.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function rrt(e,t){this.subtree=e,this.stamp=t}var NV=SD;function yl(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new B,this.shapeTransform=new B,this._minBounds=m.clone(yl.DefaultMinBounds,new m),this._maxBounds=m.clone(yl.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var ort=new m,dY=new m,srt=new Z,art=new m,crt=new m,lrt=new m,urt=new m,$pe=B.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new B);yl.prototype.update=function(e,t,n,i,r){i=y(i,yl.DefaultMinBounds),r=y(r,yl.DefaultMaxBounds);let o=yl.DefaultMinBounds,s=yl.DefaultMaxBounds;t=this._minBounds=m.clamp(t,o,s,this._minBounds),n=this._maxBounds=m.clamp(n,o,s,this._maxBounds),i=m.clamp(i,o,s,art),r=m.clamp(r,o,s,crt);let a=m.clamp(t,i,r,lrt),c=m.clamp(n,i,r,urt),u=B.getScale(e,dY);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>r.x||i.y>r.y||i.z>r.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=e_e(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,o)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=B.multiplyByPoint($pe,a,f.renderMinBounds),f.renderMaxBounds=B.multiplyByPoint($pe,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,A=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===A.x?1:A.x-h.x),2/(h.y===A.y?1:A.y-h.y),2/(h.z===A.z?1:A.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var frt=new m,drt=new m;yl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),frt),u=m.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),drt);return e_e(c,u,this.shapeTransform,r)};yl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};yl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));yl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function e_e(e,t,n,i){let r=yl.DefaultMinBounds,o=yl.DefaultMaxBounds;if(m.equals(e,r)&&m.equals(t,o))i.center=B.getTranslation(n,i.center),i.halfAxes=B.getMatrix3(n,i.halfAxes);else{let a=B.getScale(n,dY),c=m.midpoint(e,t,ort);i.center=B.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),dY);let u=B.getRotation(n,srt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var Wp=yl;function FV(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(FV.prototype,{metadataTable:{get:function(){return this._metadataTable}}});FV.fromJson=async function(e,t,n,i){let r;l(t)?r={json:t,binary:void 0}:r=hrt(n);let o=await mrt(e,r.json,r.binary),s={},a=r.json.bufferViews.length;for(let d=0;d<a;++d){let p=r.json.bufferViews[d],g=p.byteOffset,h=g+p.byteLength,x=o[p.buffer].subarray(g,h);s[d]=x}let c=r.json.voxelTable,u=r.json.propertyTables[c],f=new FV(e);return f._metadataTable=new zl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function mrt(e,t,n){let i=t.buffers.length,r=new Array(i);for(let o=0;o<i;o++){let s=t.buffers[o];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});r[o]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else r[o]=Promise.resolve(n)}return Promise.all(r)}function hrt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Mr(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}var UV=FV;function Vo(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new B,this.shapeTransform=new B,this._minimumRadius=Vo.DefaultMinBounds.x,this._maximumRadius=Vo.DefaultMaxBounds.x,this._minimumHeight=Vo.DefaultMinBounds.y,this._maximumHeight=Vo.DefaultMaxBounds.y,this._minimumAngle=Vo.DefaultMinBounds.z,this._maximumAngle=Vo.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new m,cylinderUvToRenderBoundsTranslate:new m,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvHeight:new H,cylinderUvToShapeUvAngle:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var n_e=new m,prt=new m,_rt=new m,grt=new Z,yrt=new B,Art=new B,xrt=B.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new B);Vo.prototype.update=function(e,t,n,i,r){i=y(i,Vo.DefaultMinBounds),r=y(r,Vo.DefaultMaxBounds);let o=Vo.DefaultMinBounds.x,s=Vo.DefaultMaxBounds.x,a=Vo.DefaultMinBounds.y,c=Vo.DefaultMaxBounds.y,u=Vo.DefaultMinBounds.z,f=Vo.DefaultMaxBounds.z,d=f-u,p=.5*d,g=P.EPSILON10,h=P.EPSILON3,A=P.EPSILON10,x=P.clamp(t.x,o,s),C=P.clamp(n.x,o,s),T=P.clamp(i.x,o,s),E=P.clamp(r.x,o,s),S=Math.max(x,T),w=Math.min(C,E),D=P.clamp(t.y,a,c),R=P.clamp(n.y,a,c),O=P.clamp(i.y,a,c),L=P.clamp(r.y,a,c),N=Math.max(D,O),_=Math.min(R,L),b=P.negativePiToPi(t.z),v=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),M=P.negativePiToPi(r.z),F=Math.max(b,I),k=Math.min(v,M),V=B.getScale(e,n_e);if(w===0||S>w||N>_||P.equalsEpsilon(V.x,0,void 0,g)||P.equalsEpsilon(V.y,0,void 0,g)||P.equalsEpsilon(V.z,0,void 0,g))return!1;this._minimumRadius=x,this._maximumRadius=C,this._minimumHeight=D,this._maximumHeight=R,this._minimumAngle=b,this._maximumAngle=v,this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=hY(S,w,N,_,F,k,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let q=x===o&&C===s,Y=D===a&&R===c,Q=v<b,W=v-b+Q*d,K=W>p+A&&W<d-A,J=W>A&&W<p-A,me=W>=p-A&&W<=p+A,ye=W<=A,se=K||J||me||ye,pe=P.equalsEpsilon(b,u,void 0,h),xe=P.equalsEpsilon(v,f,void 0,h),we=w===s,Ee=S===o,Be=N===a&&_===c,ke=k<F,Pe=k-F+ke*d,ft=Pe>p+A&&Pe<d-A,_t=Pe>A&&Pe<p-A,rt=Pe>=p-A&&Pe<=p+A,dn=Pe<=A,In=ft||_t||rt||dn,Ht=this.shaderUniforms,Ft=this.shaderDefines;for(let Ae in Ft)Ft.hasOwnProperty(Ae)&&(Ft[Ae]=void 0);let Te=0;if(Ft.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Te,Te+=1,Ee||(Ft.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Ft.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Te,Te+=1,Ht.cylinderUvToRenderRadiusMin=w/S),we||(Ft.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===w&&(Ft.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Be||(Ft.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),N===_&&(Ft.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),D===R&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),x===C&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!q){Ft.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ae=1/(C-x),ut=x/(x-C);Ht.cylinderUvToShapeUvRadius=H.fromElements(Ae,ut,Ht.cylinderUvToShapeUvRadius)}if(!Y){Ft.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ae=2/(R-D),ut=(D+1)/(D-R);Ht.cylinderUvToShapeUvHeight=H.fromElements(Ae,ut,Ht.cylinderUvToShapeUvHeight)}if(!we||!Be){let Ae=.5*(_-N),ut=m.fromElements(1/w,1/w,1/(Ae===0?1:Ae),_rt),ti=m.fromElements(0,0,-ut.z*.5*(N+_),prt),Je=B.fromRotationTranslation(Z.fromScale(ut,grt),ti,yrt),or=B.multiplyTransformation(Je,xrt,Art);Ht.cylinderUvToRenderBoundsScale=B.getScale(or,Ht.cylinderUvToRenderBoundsScale),Ht.cylinderUvToRenderBoundsTranslate=B.getTranslation(or,Ht.cylinderUvToRenderBoundsTranslate)}if(Q&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),In&&(Ft.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Ft.CYLINDER_INTERSECTION_INDEX_ANGLE=Te,ft?(Ft.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Te+=1):_t?(Ft.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Te+=2):rt?(Ft.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,Te+=1):dn&&(Ft.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Te+=2),Ht.cylinderRenderAngleMinMax=H.fromElements(F,k,Ht.cylinderAngleMinMax)),se){Ft.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ye&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),pe&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(Ft.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ae=(b-u)/d,ut=(v-u)/d,ti=1-W/d;Ht.cylinderShapeUvAngleMinMax=H.fromElements(Ae,ut,Ht.cylinderShapeUvAngleMinMax),Ht.cylinderShapeUvAngleRangeZeroMid=(ut+.5*ti)%1;let Je=d/W,or=-(b-u)/W;Ht.cylinderUvToShapeUvAngle=H.fromElements(Je,or,Ht.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=Te,!0};Vo.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(o,s,t*d),g=P.lerp(o,s,(t+1)*d),h=P.lerp(a,c,n*d),A=P.lerp(a,c,(n+1)*d),x=P.lerp(u,f,i*d),C=P.lerp(u,f,(i+1)*d);return hY(p,g,h,A,x,C,this.shapeTransform,r)};var Crt=new Ln,Trt=new m,Ert=new m,brt=new m;Vo.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,r=this._minimumHeight,o=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,u=1-1/e.y,f=1-1/e.z,d=P.lerp(n,i,c),p=P.lerp(r,o,u),g=P.lerp(s,a,f),C=hY(d,i,p,o,g,a,t,Crt),T=Z.getScale(C.halfAxes,Trt),E=B.getScale(t,Ert),S=m.divideComponents(T,E,brt);return m.minimumComponent(S)};Vo.DefaultMinBounds=Object.freeze(new m(0,-1,-P.PI));Vo.DefaultMaxBounds=Object.freeze(new m(1,1,+P.PI));var Srt=5,vrt=new Array(Srt),wrt=new m,Drt=new Z,Irt=new B,Prt=new B,Ort=new B,mY=new B,Rrt=new m,Mrt=new m,Brt=new m,i_e=new Array(8);for(let e=0;e<8;e++)i_e[e]=new m;function t_e(e,t,n){return Math.abs(oe.dot(e,t))<n}function Lrt(e){let t=B.getColumn(e,0,Rrt),n=B.getColumn(e,1,Mrt),i=B.getColumn(e,2,Brt),r=P.EPSILON4;return t_e(t,n,r)&&t_e(n,i,r)}function Nrt(e,t){let n=i_e;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)B.multiplyByPoint(e,n[i],n[i]);return Ln.fromPoints(n,t)}function hY(e,t,n,i,r,o,s,a){let c=Vo.DefaultMinBounds,u=Vo.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,h=c.z,A=u.z;if(e===f&&t===d&&n===p&&i===g&&r===h&&o===A)return a.center=B.getTranslation(s,a.center),a.halfAxes=B.getMatrix3(s,a.halfAxes),a;o<r&&(o+=P.TWO_PI);let C=o-r,T=r+C*.5,E=vrt,S=0;E[S++]=r,E[S++]=o,E[S++]=T,C>P.PI&&(E[S++]=T-P.PI_OVER_TWO,E[S++]=T+P.PI_OVER_TWO);let w=1,D=1,R=-1,O=-1;for(let Q=0;Q<S;++Q){let W=E[Q]-T,K=Math.cos(W),J=Math.sin(W),me=K*e,ye=J*e,se=K*t,pe=J*t;w=Math.min(w,me),D=Math.min(D,ye),w=Math.min(w,se),D=Math.min(D,pe),R=Math.max(R,me),O=Math.max(O,ye),R=Math.max(R,se),O=Math.max(O,pe)}let L=R-w,N=O-D,_=i-n,b=(w+R)*.5,v=(D+O)*.5,I=(n+i)*.5,M=m.fromElements(b,v,I,wrt),F=Z.fromRotationZ(T,Drt),k=m.fromElements(L,N,_,n_e),V=B.fromScale(k,Ort),G=B.fromRotation(F,Prt),U=B.fromTranslation(M,Irt),q=B.multiplyTransformation(G,B.multiplyTransformation(U,V,mY),mY),Y=B.multiplyTransformation(s,q,mY);return Lrt(Y)?Ln.fromTransformation(Y,a):Nrt(Y,a)}var jp=Vo;function Al(){this.orientedBoundingBox=new Ln,this.boundingSphere=new ae,this.boundTransform=new B,this.shapeTransform=new B,this._rectangle=new ce,this._minimumHeight=Al.DefaultMinBounds.z,this._maximumHeight=Al.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new m,this._rotation=new Z,this.shaderUniforms={ellipsoidRadiiUv:new m,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeCosSqrHalfMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new H,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Frt=new m,Urt=new Z,r_e=new m,o_e=new m,s_e=new m,a_e=new m,Vrt=new ce;Al.prototype.update=function(e,t,n,i,r){i=y(i,Al.DefaultMinBounds),r=y(r,Al.DefaultMaxBounds);let o=Al.DefaultMinBounds.x,s=Al.DefaultMaxBounds.x,a=s-o,c=.5*a,u=Al.DefaultMinBounds.y,f=Al.DefaultMaxBounds.y,d=f-u,p=P.EPSILON10,g=P.EPSILON3,h=P.EPSILON10,A=P.EPSILON10,x=P.EPSILON3,C=P.clamp(t.x,o,s),T=P.clamp(n.x,o,s),E=P.clamp(i.x,o,s),S=P.clamp(r.x,o,s),w=Math.max(C,E),D=Math.min(T,S),R=P.clamp(t.y,u,f),O=P.clamp(n.y,u,f),L=P.clamp(i.y,u,f),N=P.clamp(r.y,u,f),_=Math.max(R,L),b=Math.min(O,N),v=B.getScale(e,Frt),I=v.x===v.y&&v.y===v.z,M=m.minimumComponent(v),F=Math.max(t.z,-M),k=Math.max(n.z,-M),V=Math.max(i.z,-M),G=Math.max(r.z,-M),U=Math.max(F,V),q=Math.min(k,G),Y=m.add(v,m.fromElements(F,F,F,o_e),o_e),Q=m.add(v,m.fromElements(k,k,k,r_e),r_e),W=m.maximumComponent(Q),K=m.add(v,m.fromElements(U,U,U,a_e),a_e),J=m.add(v,m.fromElements(q,q,q,s_e),s_e);if(_>b||_===f||b===u||U>q||P.equalsEpsilon(J,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,R,T,O),this._translation=B.getTranslation(e,this._translation),this._rotation=B.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(v,this._ellipsoid),this._minimumHeight=F,this._maximumHeight=k;let me=ce.fromRadians(w,_,D,b,Vrt);this.orientedBoundingBox=c_e(me,U,q,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=B.fromRotationTranslation(Z.setScale(this._rotation,Q,Urt),this._translation,this.shapeTransform),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ye=D<w,se=D-w+ye*a,pe=se<=h,xe=se>c+h&&se<a-h,we=se>=c-h&&se<=c+h,Ee=se>h&&se<c-h,Be=pe||xe||we||Ee,ke=T<C,Pe=T-C+ke*a,ft=Pe<=h,_t=Pe>c+h&&Pe<a-h,rt=Pe>=c-h&&Pe<=c+h,dn=Pe>h&&Pe<c-h,In=ft||_t||rt||dn,Ht=b<-x,Ft=b>=-x&&b<=+x,Te=b>+x&&b<f-A,Ae=Ht||Ft||Te,ut=_>u+A&&_<-x,ti=_>=-x&&_<=+x,Je=_>+x,or=ut||ti||Je,Qo=Ae||or,va=O-R,Io=O<-x,Dr=O>=-x&&O<=+x,Ve=O>+x&&O<f-A,ot=Io||Dr||Ve,je=R>u+A&&R<-x,Ze=R>=-x&&R<=+x,mt=R>+x,Jt=ot||(je||Ze||mt),$i=!m.equals(K,m.ZERO),dr=!m.equals(J,m.ZERO),$o=$i||dr,Is=q-U,ao=!m.equals(Y,m.ZERO),ki=!m.equals(Q,m.ZERO),Ho=ao||ki,Fn=this.shaderUniforms,sn=this.shaderDefines;for(let vn in sn)sn.hasOwnProperty(vn)&&(sn[vn]=void 0);Fn.ellipsoidRadiiUv=m.divideByScalar(Q,W,Fn.ellipsoidRadiiUv),Fn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Fn.ellipsoidRadiiUv,Fn.ellipsoidRadiiUv,Fn.ellipsoidInverseRadiiSquaredUv),Fn.ellipsoidInverseRadiiSquaredUv);let Wn=0;if(sn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Wn,Wn+=1,$o&&(Is===0&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),$i&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,sn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Wn,Wn+=1,Fn.ellipsoidInverseInnerScaleUv=W/(W-(k-U))),dr&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Fn.ellipsoidInverseOuterScaleUv=W/(W-(k-q)))),Ho){if(ao){sn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let vn=(k-F)/W;Fn.ellipsoidInverseHeightDifferenceUv=1/vn,Fn.ellipseInnerRadiiUv=H.fromElements(Fn.ellipsoidRadiiUv.x*(1-vn),Fn.ellipsoidRadiiUv.z*(1-vn),Fn.ellipseInnerRadiiUv)}F===k&&(sn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Be&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,sn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Wn,xe?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Wn+=1):Ee?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Wn+=2):we?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,Wn+=1):pe&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Wn+=2),Fn.ellipsoidRenderLongitudeMinMax=H.fromElements(w,D,Fn.ellipsoidRenderLongitudeMinMax)),In){sn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,T<C&&(sn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let Ps=a/Pe,mi=-(C-o)/Pe;Fn.ellipsoidUvToShapeUvLongitude=H.fromElements(Ps,mi,Fn.ellipsoidUvToShapeUvLongitude)}if(Be){let vn=P.equalsEpsilon(w,o,void 0,g),Ps=P.equalsEpsilon(D,s,void 0,g);vn&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Ps&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let mi=(C-o)/a,oa=(T-o)/a,bu=(D-o)/a,Of=1-se/a,Os=(bu+.5*Of)%1;Fn.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(mi,oa,Os,Fn.ellipsoidShapeUvLongitudeMinMaxMid)}if(Qo){sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,or&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,sn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Wn,ut?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Wn+=1):ti?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Wn+=1):Je&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Wn+=2)),Ae&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,sn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Wn,Ht?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Wn+=2):Ft?(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Wn+=1):Te&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Wn+=1)),_===b&&(sn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let vn=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(_)),2),Ps=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(b)),2);Fn.ellipsoidRenderLatitudeCosSqrHalfMinMax=H.fromElements(vn,Ps,Fn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(Jt){sn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,R===O&&(sn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let vn=d/va,Ps=(u-R)/va;Fn.ellipsoidUvToShapeUvLatitude=H.fromElements(vn,Ps,Fn.ellipsoidUvToShapeUvLatitude)}return I&&(sn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=Wn,!0};var krt=new ce;Al.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ce.subsection(this._rectangle,s,c,a,u,krt),g=P.lerp(this._minimumHeight,this._maximumHeight,f),h=P.lerp(this._minimumHeight,this._maximumHeight,d);return c_e(p,g,h,this._ellipsoid,this._translation,this._rotation,r)};Al.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,r=this._maximumHeight;return .5*((r-i)/(n+r))/e.z};function c_e(e,t,n,i,r,o,s){return s=Ln.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,r,s.center),s.halfAxes=Z.multiply(s.halfAxes,o,s.halfAxes),s}Al.DefaultMinBounds=Object.freeze(new m(-P.PI,-P.PI_OVER_TWO,-Number.MAX_VALUE));Al.DefaultMaxBounds=Object.freeze(new m(+P.PI,+P.PI_OVER_TWO,+Number.MAX_VALUE));var rb=Al;var pu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};pu.getMinBounds=function(e){switch(e){case pu.BOX:return Wp.DefaultMinBounds;case pu.ELLIPSOID:return rb.DefaultMinBounds;case pu.CYLINDER:return jp.DefaultMinBounds}};pu.getMaxBounds=function(e){switch(e){case pu.BOX:return Wp.DefaultMaxBounds;case pu.ELLIPSOID:return rb.DefaultMaxBounds;case pu.CYLINDER:return jp.DefaultMaxBounds}};pu.getShapeConstructor=function(e){switch(e){case pu.BOX:return Wp;case pu.ELLIPSOID:return rb;case pu.CYLINDER:return jp}};var ji=Object.freeze(pu);function vD(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new NV;let t=this,n;l(e.url)&&($("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(e.url).then(function(i){let r=ve.createIfNeeded(i);return r.fetchJson().then(function(o){return n=o,f_e(n),m_e(n,r).load()}).then(function(o){let s=n.root,a=s.content.extensions["3DTILES_content_voxels"],c=a.class,u=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,f=o.schema,d=new J0({metadataJson:u,schema:f});h_e(t,d,c);let p=new Q0(r,s,f),{shape:g,minBounds:h,maxBounds:A,shapeTransform:x,globalTransform:C}=d_e(s);t.shape=g,t.minBounds=h,t.maxBounds=A,t.dimensions=m.unpack(a.dimensions),t.shapeTransform=x,t.globalTransform=C,t.maximumTileCount=u_e(d);let T,E;return l(a.padding)&&(T=m.unpack(a.padding.before),E=m.unpack(a.padding.after)),t.paddingBefore=T,t.paddingAfter=E,t._implicitTileset=p,Fi.unload(o),t._ready=!0,t})}))}Object.defineProperties(vD.prototype,{readyPromise:{get:function(){return $("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return $("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});vD.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();f_e(n);let i=m_e(n,t);await i.load();let r=n.root,o=r.content.extensions["3DTILES_content_voxels"],s=o.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new J0({metadataJson:a,schema:c}),f=new vD;h_e(f,u,s);let d=new Q0(t,r,c),{shape:p,minBounds:g,maxBounds:h,shapeTransform:A,globalTransform:x}=d_e(r);f.shape=p,f.minBounds=g,f.maxBounds=h,f.dimensions=m.unpack(o.dimensions),f.shapeTransform=A,f.globalTransform=x,f.maximumTileCount=u_e(u);let C,T;return l(o.padding)&&(C=m.unpack(o.padding.before),T=m.unpack(o.padding.after)),f.paddingBefore=C,f.paddingAfter=T,f._implicitTileset=d,Fi.unload(i),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function u_e(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(NC.TILESET_TILE_COUNT)}function f_e(e){let t=e.root;if(!l(t.content))throw new de("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function d_e(e){let t=e.boundingVolume,n;if(l(e.transform)?n=B.unpack(e.transform):n=B.clone(B.IDENTITY),l(t.box))return Hrt(t.box,n);if(l(t.region))return zrt(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return Grt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function zrt(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=B.fromScale(re.WGS84.radii),c=t,u=i,f=n,d=r,p=o,g=s,h=new m(c,f,p),A=new m(u,d,g);return{shape:ji.ELLIPSOID,minBounds:h,maxBounds:A,shapeTransform:a,globalTransform:B.clone(B.IDENTITY)}}function Hrt(e,t){let n=Ln.unpack(e),i=B.fromRotationTranslation(n.halfAxes,n.center);return{shape:ji.BOX,minBounds:m.clone(Wp.DefaultMinBounds),maxBounds:m.clone(Wp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Grt(e,t){let n=Ln.unpack(e),i=B.fromRotationTranslation(n.halfAxes,n.center);return{shape:ji.CYLINDER,minBounds:m.clone(jp.DefaultMinBounds),maxBounds:m.clone(jp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function m_e(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Fi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Fi.getSchemaLoader({schema:i})}function h_e(e,t,n){let{schema:i,statistics:r}=t,o=r?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:h}=p,A=o?.properties[d].min,x=o?.properties[d].max,C=Yt.getComponentCount(g),T=l_e(A,C),E=l_e(x,C);return{id:d,type:g,componentType:h,minValue:T,maxValue:E}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function l_e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function Wrt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),r=await i.fetchArrayBuffer(),o=xp(r);return await UV.fromJson(i,o.jsonPayload,o.binaryPayload,e.metadataSchema)}async function jrt(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=xp(a);return r=await LC.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}vD.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),r=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new DT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return jrt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?Wrt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var p_e=vD;function pY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(pY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});pY.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=m.fromElements(i,r,o,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var VV=pY;var _Y={CUMULUS:0};_Y.validate=function(e){return e===_Y.CUMULUS};var wD=Object.freeze(_Y);var kV=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); +vec4 handleAlpha(vec3 color, float alpha) +{ + #ifdef ALPHA_MODE_MASK + if (alpha < u_alphaCutoff) { + discard; } - return mod(value, rangeLength); -} + #endif -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); + return vec4(color, alpha); } -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; +SelectedFeature selectedFeature; - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); +void main() +{ + #ifdef HAS_MODEL_SPLITTER + modelSplitterStage(); + #endif - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} + czm_modelMaterial material = defaultModelMaterial(); -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); -} + ProcessedAttributes attributes; + geometryStage(attributes); -vec4 sampleNoiseTexture(vec3 position) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); + FeatureIds featureIds; + featureIdStage(featureIds, attributes); - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); -} + #ifdef HAS_SELECTED_FEATURE_ID + selectedFeatureIdStage(selectedFeature, featureIds); + #endif -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; + #ifndef CUSTOM_SHADER_REPLACE_MATERIAL + materialStage(material, attributes, selectedFeature); + #endif - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; - } - } + #ifdef HAS_CUSTOM_FRAGMENT_SHADER + customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; -} + lightingStage(material, attributes); -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } + #ifdef HAS_SELECTED_FEATURE_ID + cpuStylingStage(material, selectedFeature); + #endif - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; - } - return intersected; + #ifdef HAS_MODEL_COLOR + modelColorStage(material); + #endif + + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(material); + #endif + + vec4 color = handleAlpha(material.diffuse, material.alpha); + + #ifdef HAS_CLIPPING_PLANES + modelClippingPlanesStage(color); + #endif + + #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) + silhouetteStage(color); + #endif + + out_FragColor = color; } +`;var fN=`precision highp float; -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { + czm_modelVertexOutput vsOutput; + vsOutput.positionMC = positionMC; + vsOutput.pointSize = 1.0; + return vsOutput; } -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} +void main() +{ + // Initialize the attributes struct with all + // attributes except quantized ones. + ProcessedAttributes attributes; + initializeAttributes(attributes); + + // Dequantize the quantized ones and add them to the + // attributes struct. + #ifdef USE_DEQUANTIZATION + dequantizationStage(attributes); + #endif -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; + #ifdef HAS_MORPH_TARGETS + morphTargetsStage(attributes); + #endif -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; -} + #ifdef HAS_SKINNING + skinningStage(attributes); + #endif -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(); + #endif -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} + // Compute the bitangent according to the formula in the glTF spec. + // Normal and tangents can be affected by morphing and skinning, so + // the bitangent should not be computed until their values are finalized. + #ifdef HAS_BITANGENTS + attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); + #endif -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + FeatureIds featureIds; + featureIdStage(featureIds, attributes); -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } + #ifdef HAS_SELECTED_FEATURE_ID + SelectedFeature feature; + selectedFeatureIdStage(feature, featureIds); + // Handle any show properties that come from the style. + cpuStylingStage(attributes.positionMC, feature); + #endif - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + // The scene mode 2D pipeline stage and instancing stage add a different + // model view matrix to accurately project the model to 2D. However, the + // output positions and normals should be transformed by the 3D matrices + // to keep the data the same for the fragment shader. + mat4 modelView = czm_modelView3D; + mat3 normal = czm_normal3D; + #else + // These are used for individual model projection because they will + // automatically change based on the scene mode. + mat4 modelView = czm_modelView; + mat3 normal = czm_normal; + #endif - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; + // Update the position for this instance in place + #ifdef HAS_INSTANCING - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. + // The legacy instance stage is used when rendering i3dm models that + // encode instances transforms in world space, as opposed to glTF models + // that use EXT_mesh_gpu_instancing, where instance transforms are encoded + // in object space. + #ifdef USE_LEGACY_INSTANCING + mat4 instanceModelView; + mat3 instanceModelViewInverseTranspose; + + legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; + modelView = instanceModelView; + normal = instanceModelViewInverseTranspose; + #else + instancingStage(attributes); + #endif - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; + #ifdef USE_PICKING + v_pickColor = a_pickColor; + #endif - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. + #endif - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; + #ifdef HAS_CUSTOM_VERTEX_SHADER + czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); + customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); + // Compute the final position in each coordinate system needed. + // This returns the value that will be assigned to gl_Position. + vec4 positionClip = geometryStage(attributes, modelView, normal); - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); + #ifdef HAS_SILHOUETTE + silhouetteStage(attributes, positionClip); + #endif - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + float show = pointCloudShowStylingStage(attributes, metadata); + #else + float show = 1.0; + #endif -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; + #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING + show *= pointCloudBackFaceCullingStage(); + #endif - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); + #endif - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } -#else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; -#endif -#endif -} -`;var zV=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; + #ifdef PRIMITIVE_TYPE_POINTS + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); + #else + gl_PointSize = 1.0; + #endif -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; + gl_PointSize *= show; + #endif -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); + gl_Position = show * positionClip; +} +`;function n6(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Hn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Hn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],QBe(this)}function JBe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:e,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}var ZBe={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},$Be={stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Gn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},ene=[];function QBe(e){let t=e._command,n=ene;if(e._useDebugWireframe){t.pass=Ae.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=bv(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ae.TERRAIN_CLASSIFICATION,s=t6(t,r),a=$te(t,r);n.length=0,n.push(s,a),e._commandListTerrain=bv(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Qte(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ae.CESIUM_3D_TILE_CLASSIFICATION,s=t6(t,r),a=$te(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=bv(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Qte(e,n,e._commandList3DTilesPicking))}}function bv(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let d=0;d<a;d++){let p=t[d],g=nt.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function t6(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ae.TERRAIN_CLASSIFICATION?Gn.ALWAYS:Gn.EQUAL,o=JBe(i);return n.renderState=Ve.fromCache(o),n}function $te(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(ZBe),n}var e3e=[];function Qte(e,t,n){let i=Ve.fromCache($Be),o=t[0],r=t[1],s=nt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=nt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=e3e;return c.length=0,c.push(s,a),bv(e,c,n)}Object.defineProperties(n6.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});n6.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=t6(this._command,o),s=ene;s.length=0,s.push(r),this._commandListIgnoreShow=bv(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var dN=n6;function mN(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Ae.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c;this._command=t,this._modelMatrix=L.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new L,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,t3e(this)}function ap(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}ap.clone=function(e){return new ap({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function t3e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new ap({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new ap({command:c3e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new ap({command:h3e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new ap({command:p3e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new ap({command:l3e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new ap({command:u3e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(mN.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,i3e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,o3e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,r3e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,s3e(this))}}});function n3e(e,t){let n=e._modelMatrix;e._modelMatrix2D=L.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function i3e(e){let t=e.shadows,n=Cn.castShadows(t),i=Cn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function o3e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ye(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function r3e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ye(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function s3e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}mN.prototype.pushCommands=function(e,t){let n=tne(this,e);n&&!this._has2DCommands&&(a3e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(n3e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==vm.ALL_OPAQUE&&ZC(t,this._translucentCommand,n),i===vm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||ZC(o._backfaceCommands,this._skipLodBackfaceCommand,n),f3e(this,r,n),ZC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){ZC(t,this._silhouetteModelCommand,n);return}return ZC(t,this._originalCommand,n),t}};mN.prototype.pushSilhouetteCommands=function(e,t){let n=tne(this,e);return ZC(t,this._silhouetteColorCommand,n),t};function ZC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function tne(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return o<s&&r>s||o<-s&&r>-s}function JC(e,t){if(!l(t))return;let n=ap.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function a3e(e){JC(e,e._originalCommand),JC(e,e._translucentCommand),JC(e,e._skipLodBackfaceCommand),JC(e,e._skipLodStencilCommand),JC(e,e._silhouetteModelCommand),JC(e,e._silhouetteColorCommand)}function c3e(e){let t=nt.shallowClone(e);t.pass=Ae.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=mn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function l3e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function u3e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ae.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ae.TRANSLUCENT,o.depthMask=!1,o.blending=mn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function f3e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=d3e(o);if(r!==s){let a=m3e(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function d3e(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function m3e(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function h3e(e){let t=nt.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=gi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),o=new H(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function p3e(e){let t=nt.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=Gn.GREATER_OR_EQUAL,i.frontOperation.zPass=pt.REPLACE,i.backFunction=Gn.GREATER_OR_EQUAL,i.backOperation.zPass=pt.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var hN=mN;function _3e(e,t){let n=e.shaderBuilder;n.addVertexLines(fN),n.addFragmentLines(uN);let i=g3e(e),o=new ai({context:t.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=n.buildShaderProgram(t.context);r._pipelineResources.push(s);let a=e.alphaOptions.pass,c=r.sceneGraph,u=t.mode===ne.SCENE3D,f,d;if(!u&&!t.scene3DOnly&&r._projectTo2D)f=L.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new L),d=e.runtimePrimitive.boundingSphere2D;else{let T=u?c._computedModelMatrix:c._computedModelMatrix2D;f=L.multiplyTransformation(T,e.runtimeNode.computedTransform,new L),d=ae.transform(e.boundingSphere,f,e.boundingSphere)}let p=Ye(Ve.fromCache(e.renderStateOptions),!0);p.cull.face=en.getCullFace(f,e.primitiveType),p=Ve.fromCache(p);let g=l(r.classificationType),h=g?!1:Cn.castShadows(r.shadows),x=g?!1:Cn.receiveShadows(r.shadows),b=g?void 0:e.pickId,C=new nt({boundingVolume:d,modelMatrix:f,uniformMap:e.uniformMap,renderState:p,vertexArray:o,shaderProgram:s,cull:r.cull,pass:a,count:e.count,owner:r,pickId:b,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:h,receiveShadows:x});return g?new dN({primitiveRenderResources:e,command:C}):new hN({primitiveRenderResources:e,command:C})}function g3e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var pN=_3e;var P0={VERTEX:0,FRAGMENT:1,BOTH:2};P0.includesVertexShader=function(e){return e===P0.VERTEX||e===P0.BOTH};P0.includesFragmentShader=function(e){return e===P0.FRAGMENT||e===P0.BOTH};var Te=Object.freeze(P0);var nne={name:"TilesetPipelineStage"};nne.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,Te.FRAGMENT);let r={u_polygonOffset:function(){return H.ZERO}};e.uniformMap=_t(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var _N=nne;var gN=`vec3 proceduralIBL( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { + vec3 v = -positionEC; + vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); + vec3 vWC = -normalize(positionWC); + vec3 l = normalize(lightDirectionEC); + vec3 n = normalEC; + vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; -#endif + // Figure out if the reflection vector hits the ellipsoid + float vertexRadius = length(positionWC); + float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); + float reflectionDotNadir = dot(r, normalize(positionWC)); + // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. + r.x = -r.x; + r = -normalize(czm_temeToPseudoFixed * r); + r.x = -r.x; - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; + vec3 diffuseColor = pbrParameters.diffuseColor; + float roughness = pbrParameters.roughness; + vec3 specularColor = pbrParameters.f0; - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var HV=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; + float inverseRoughness = 1.04 - roughness; + inverseRoughness *= inverseRoughness; + vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness; -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} + float atmosphereHeight = 0.05; + float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); + float blendRegionOffset = roughness * -1.0; + float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); + float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); + float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); + float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); + vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); + vec3 nadirColor = belowHorizonColor * 0.5; + vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); + vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); + vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); + vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); + float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; + float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); + vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); + float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); + vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); + specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); + specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} + // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf + #ifdef USE_SUN_LUMINANCE + // Angle between sun and zenith + float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); + float S = acos(LdotZenith); + // Angle between zenith and current pixel + float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); + // Angle between sun and current pixel + float gamma = acos(NdotL); + float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); + float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); + float luminance = model_luminanceAtZenith * (numerator / denominator); + #endif -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); + float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); + vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); + iblColor *= lightColor; -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; + #ifdef USE_SUN_LUMINANCE + iblColor *= luminance; + #endif + + return iblColor; } -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + czm_pbrParameters pbrParameters +) { + vec3 diffuseColor = pbrParameters.diffuseColor; + float roughness = pbrParameters.roughness; + vec3 specularColor = pbrParameters.f0; - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); + vec3 v = -positionEC; + vec3 n = normalEC; + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } + float NdotV = abs(dot(n, v)) + 0.001; + float VdotH = clamp(dot(v, h), 0.0, 1.0); - return shortestDistance; -} + const mat3 yUpToZUp = mat3( + -1.0, 0.0, 0.0, + 0.0, 0.0, -1.0, + 0.0, 1.0, 0.0 + ); + vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); -const float MAX_FBM_ITERATIONS = 10.0; + #ifdef DIFFUSE_IBL + #ifdef CUSTOM_SPHERICAL_HARMONICS + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif + #else + vec3 diffuseIrradiance = vec3(0.0); + #endif -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } + #ifdef SPECULAR_IBL + vec3 r0 = specularColor.rgb; + float reflectance = max(max(r0.r, r0.g), r0.b); + vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(r0, r90, VdotH); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + #ifdef CUSTOM_SPECULAR_IBL + vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); + #else + vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); + #endif + specularIBL *= F * brdfLut.x + brdfLut.y; + #else + vec3 specularIBL = vec3(0.0); + #endif - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; + return diffuseColor * diffuseIrradiance + specularColor * specularIBL; } +#endif -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); +vec3 imageBasedLightingStage( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) { + #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) + // Environment maps were provided, use them for IBL + return textureIBL( + positionEC, + normalEC, + lightDirectionEC, + pbrParameters + ); + #else + // Use the procedural IBL if there are no environment maps + return proceduralIBL( + positionEC, + normalEC, + lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif +}`;var ine={name:"ImageBasedLightingPipelineStage"};ine.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,Te.FRAGMENT),o.addUniform("vec2","model_iblFactor",Te.FRAGMENT),hm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",Te.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Te.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Te.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,Te.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(o.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,Te.FRAGMENT),o.addUniform("sampler2D","model_specularEnvironmentMaps",Te.FRAGMENT),o.addUniform("vec2","model_specularEnvironmentMapsSize",Te.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Te.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,Te.FRAGMENT)),l(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,Te.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",Te.FRAGMENT)),o.addFragmentLines(gN);let r={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=_t(r,e.uniformMap)};var yN=ine;var y3e=P.EPSILON16;function o6(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(o6.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,y3e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var x3e=new m,i6=new Z;o6.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=x3e,o;switch(t){case bc.XROTATE:o=Z.fromRotationX(P.toRadians(n),i6),e=L.multiplyByMatrix3(e,o,e);break;case bc.YROTATE:o=Z.fromRotationY(P.toRadians(n),i6),e=L.multiplyByMatrix3(e,o,e);break;case bc.ZROTATE:o=Z.fromRotationZ(P.toRadians(n),i6),e=L.multiplyByMatrix3(e,o,e);break;case bc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case bc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case bc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=L.multiplyByTranslation(e,i,e);break;case bc.XSCALE:i.x=n,i.y=1,i.z=1,e=L.multiplyByScale(e,i,e);break;case bc.YSCALE:i.x=1,i.y=n,i.z=1,e=L.multiplyByScale(e,i,e);break;case bc.ZSCALE:i.x=1,i.y=1,i.z=n,e=L.multiplyByScale(e,i,e);break;case bc.UNIFORMSCALE:e=L.multiplyByUniformScale(e,n,e);break;default:break}return e};var xN=o6;function bN(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,b3e(this)}Object.defineProperties(bN.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function b3e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new xN({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}bN.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var C3e=new L,T3e=new L;bN.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=L.clone(L.IDENTITY,C3e),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=L.multiplyTransformation(s.originalTransform,e,T3e);s.transform=a}};var CN=bN;var TN=`void modelColorStage(inout czm_modelMaterial material) +{ + material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); + material.alpha *= model_color.a; +}`;var $C={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};$C.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,Te.FRAGMENT),i.addFragmentLines(TN);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Ae.TRANSLUCENT),i.addUniform("vec4",$C.COLOR_UNIFORM_NAME,Te.FRAGMENT),o[$C.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",$C.COLOR_BLEND_UNIFORM_NAME,Te.FRAGMENT),o[$C.COLOR_BLEND_UNIFORM_NAME]=function(){return xc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=_t(o,e.uniformMap)};var O0=$C;var AN=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +#else +// Handle uint8 clipping texture instead +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each + int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); + return czm_transformPlane(plane, transform); } -`;var GV=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; - -out vec2 v_position; - -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); +#endif - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;function Vd(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var Yrt=Vd.SHOW_INDEX=0,qrt=Vd.POSITION_INDEX=1,Xrt=Vd.SCALE_INDEX=2,Krt=Vd.MAXIMUM_SIZE_INDEX=3,Jrt=Vd.SLICE_INDEX=4,Zrt=Vd.BRIGHTNESS_INDEX=5,Qrt=Vd.COLOR_INDEX=6;Vd.NUMBER_OF_PROPERTIES=7;function LA(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Vd.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,LA(this,Yrt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),LA(this,qrt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),LA(this,Xrt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),LA(this,Krt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),LA(this,Qrt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,LA(this,Jrt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,LA(this,Zrt))}}});Vd.prototype._destroy=function(){this._cloudCollection=void 0};var xf=Vd;var _u,WV=new m,$rt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},eot={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},tot=xf.SHOW_INDEX,not=xf.POSITION_INDEX,iot=xf.SCALE_INDEX,rot=xf.MAXIMUM_SIZE_INDEX,oot=xf.SLICE_INDEX,sot=xf.BRIGHTNESS_INDEX,aot=xf.NUMBER_OF_PROPERTIES,cot=xf.COLOR_INDEX;function kd(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(aot),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:__e(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function __e(e){return function(){return WV.x=e._textureSliceWidth,WV.y=e._noiseTextureRows,WV.z=1/e._noiseTextureRows,WV}}Object.defineProperties(kd.prototype,{length:{get:function(){return yY(this),this._clouds.length}}});function g_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}kd.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,wD.CUMULUS),n;return t===wD.CUMULUS&&(n=new xf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};kd.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};kd.prototype.removeAll=function(){g_e(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function yY(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}kd.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};kd.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};kd.prototype.get=function(e){return yY(this),this._clouds[e]};var lot=new Float32Array([-1,-1,1,-1,1,1,-1,1]),uot=new Uint16Array([0,1,2,0,2,3]);function fot(e){let t=ht.createVertexBuffer({context:e,typedArray:lot,usage:Fe.STATIC_DRAW}),n=ht.createIndexBuffer({context:e,typedArray:uot,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new si({context:e,attributes:i,indexBuffer:n})}var AY;function dot(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=ht.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function mot(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ht.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function hot(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ht.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function pot(e,t,n){let i=[{index:_u.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:_u.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:_u.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:_u.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:_u.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:_u.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:hot(e)});let r=n?t:4*t;return new y_(e,i,r,n)}var gY=new Yn;function y_e(e,t,n,i){let r,o=n[_u.positionHighAndScaleX],s=n[_u.positionLowAndScaleY],a=i.position;Yn.fromCartesian(a,gY);let c=i.scale,u=gY.high,f=gY.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function A_e(e,t,n,i){let r,o=n[_u.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function x_e(e,t,n,i){let r,o=n[_u.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function C_e(e,t,n,i){let r,o=n[_u.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function _ot(e,t,n,i){y_e(e,t,n,i),A_e(e,t,n,i),x_e(e,t,n,i),C_e(e,t,n,i)}function got(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=fot(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Bt({context:a,width:o*o/s,height:o*s,pixelDatatype:Qe.UNSIGNED_BYTE,pixelFormat:ct.RGBA,sampler:new mn({wrapS:Pn.REPEAT,wrapT:Pn.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST})});let f=new Bf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:__e(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function yot(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=pot(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];_ot(e,t,s,c)}n._vaf.commit(AY(i))}}var Aot=[];function xot(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=Aot;u.length=0,(c[not]||c[iot])&&u.push(y_e),(c[tot]||c[sot])&&u.push(A_e),(c[rot]||c[oot])&&u.push(x_e),c[cot]&&u.push(C_e);let f=u.length,d=i._vaf.writers,p,g,h;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._vaf.commit(AY(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Cot(e,t,n,i){let r=t.context,o=e,s=new He({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new He({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:_u}),o._rs=ze.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:hn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function Tot(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new nt),f.pass=Se.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}kd.prototype.update=function(e){if(yY(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&got(this,e,GV,HV),this._instanced=e.context.instancedArrays,_u=this._instanced?eot:$rt,AY=this._instanced?mot:dot;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?yot(this,e):o>0&&xot(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Cot(this,e,zV,kV),Tot(this,e))};kd.prototype.isDestroyed=function(){return!1};kd.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),g_e(this._clouds),ue(this)};var T_e=kd;async function xY(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;await n._readyPromise;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return o;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await xY._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,h){return l(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}xY._sampleTerrainMostDetailed=kg;var ob=xY;var Eot=P.toRadians(30);function CY(e){this._angle=y(e,Eot)}Object.defineProperties(CY.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});CY.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=m.fromElements(r,o,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var E_e=CY;var bot=new z,Sot=new z,vot=new z,wot=new z,b_e=new oe,DD=new Uint8Array(4);function S_e(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function jV(e,t){return{height:e,color:z.clone(t)}}function v_e(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function Dot(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],h=P.clamp(g.height,xl._minimumHeight,xl._maximumHeight),A=z.clone(g.color,bot);A.red*=A.alpha,A.green*=A.alpha,A.blue*=A.alpha,c.push(jV(h,A))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],h=c[n+1];u=u&&g.height<=h.height,f=f&&g.height>=h.height}f?c=c.reverse():u||my(c,function(g,h){return P.sign(g.height-h.height)});let d=y(o.extendDownwards,!1),p=y(o.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,jV(xl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,jV(xl._maximumHeight,c[c.length-1].color)),c=v_e(c),i.push(c)}return i}function Iot(e){let t=Dot(e),n=[],i=[],r;function o(u,f){n.push(jV(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,wot);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let h=f<p?u[f]:void 0,A=f>0?u[f-1]:void 0,x=f<p-1?u[f+1]:void 0,C=d<g?i[d]:void 0,T=d>0?i[d-1]:void 0,E=d<g-1?i[d+1]:void 0;if(l(h)&&l(C)&&h.height===C.height){let S=l(E)&&C.height===E.height,w=!l(T),D=!l(E),R=l(x)&&h.height===x.height,O=!l(A),L=!l(x);S?R?(s(h.height,h.color,C.color),s(h.height,x.color,E.color)):O?(o(h.height,C.color),s(h.height,h.color,E.color)):L?(s(h.height,h.color,C.color),o(h.height,E.color)):(s(h.height,h.color,C.color),s(h.height,h.color,E.color)):w?R?(o(h.height,h.color),s(h.height,x.color,C.color)):L?(o(h.height,h.color),o(h.height,C.color)):(O||o(h.height,h.color),s(h.height,h.color,C.color)):D?R?(s(h.height,h.color,C.color),o(h.height,x.color)):O?(o(h.height,C.color),o(h.height,h.color)):L?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),o(h.height,h.color)):R?(s(h.height,h.color,C.color),s(h.height,x.color,C.color)):O?(o(h.height,C.color),s(h.height,h.color,C.color)):L?(s(h.height,h.color,C.color),o(h.height,C.color)):s(h.height,h.color,C.color),f+=R?2:1,d+=S?2:1}else if(l(h)&&l(C)&&l(T)&&h.height<C.height){let S=S_e(h.height,T,C,vot);l(A)?l(x)?s(h.height,h.color,S):(s(h.height,h.color,S),o(h.height,S)):(o(h.height,S),s(h.height,h.color,S)),f++}else if(l(C)&&l(h)&&l(A)&&C.height<h.height){let S=S_e(C.height,A,h,Sot);l(T)?l(E)?s(C.height,S,C.color):(s(C.height,S,C.color),o(C.height,S)):(o(C.height,S),s(C.height,S,C.color)),d++}else l(h)&&(!l(C)||h.height<C.height)?(l(C)&&!l(T)&&!l(x)?(o(h.height,h.color),o(h.height,xl._emptyColor),o(C.height,xl._emptyColor)):(!l(C)&&l(T)&&!l(A)&&(o(T.height,xl._emptyColor),o(h.height,xl._emptyColor)),o(h.height,h.color)),f++):l(C)&&(!l(h)||C.height<h.height)&&(o(C.height,C.color),d++)}}return v_e(n)}function xl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,r=Iot(n),o=r.length,s,a,c;if(!xl._useFloatTexture(i)){a=Qe.UNSIGNED_BYTE,c=ct.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)oe.packFloat(r[g].height,b_e),oe.pack(b_e,s,g*4)}else{a=Qe.FLOAT,c=i.webgl2?ct.RED:ct.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Bt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(DD),d[g*4+0]=DD[0],d[g*4+1]=DD[1],d[g*4+2]=DD[2],d[g*4+3]=DD[3];let p=Bt.create({context:i,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:bi.LINEAR})});return Gi.fromType("ElevationBand",{heights:f,colors:p})}xl._useFloatTexture=function(e){return e.floatingPointTexture};xl._maximumHeight=5906376425472;xl._minimumHeight=-5906376425472;xl._emptyColor=new z(0,0,0,0);var w_e=xl;function Pot(e){$("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),e=gt(e,{url:ma.fromAssetId(96188)});let t=new Ga(e),n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new Cy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var D_e=Pot;async function Oot(e){let t=await Ga.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new Cy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var I_e=Oot;function Rot(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=B.clone(y(e.modelMatrix,B.IDENTITY)),o=y(e.length,1e4);if(l(i.normal)&&t.push(new Tt({geometry:Vn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new zt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Tt({geometry:Vn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new zt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Tt({geometry:Vn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new zt(0,0,1,1)},modelMatrix:r})),t.length>0)return new wn({asynchronous:!1,geometryInstances:t,appearance:new cn({flat:!0,translucent:!1})})}var P_e=Rot;var O_e=/{[^}]+}/g,bY={x:Lot,y:Fot,z:kot,s:zot,reverseX:Not,reverseY:Uot,reverseZ:Vot,westDegrees:Hot,southDegrees:Got,eastDegrees:Wot,northDegrees:jot,westProjected:Yot,southProjected:qot,eastProjected:Xot,northProjected:Kot,width:Jot,height:Zot},R_e=gt(bY,{i:Qot,j:$ot,reverseI:est,reverseJ:tst,longitudeDegrees:ist,latitudeDegrees:rst,longitudeProjected:ost,latitudeProjected:sst,format:cst});function NA(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,l(e.then)){this._reinitialize(e);return}let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Uo({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let o=e.customTags,s=gt(bY,o),a=gt(R_e,o);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(NA.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._ready&&l(this._resource)}},readyPromise:{get:function(){return $("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});NA.prototype.reinitialize=function(e){return $("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._reinitialize(e)};NA.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,r=gt(bY,i),o=gt(R_e,i),s=ve.createIfNeeded(n.url),a=ve.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new Uo({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new It(c)),t._credit=c,t._resource=s,t._tags=r,t._pickFeaturesResource=a,t._pickFeaturesTags=o,t._ready=!0,!0})};NA.prototype.getTileCredits=function(e,t,n){};NA.prototype.requestImage=function(e,t,n,i){return gl.loadImage(this,Mot(this,e,t,n,i))};NA.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=Bot(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var YV=!1,gu=new ce,qV=!1,ID=new ce;function Mot(e,t,n,i,r){YV=!1,qV=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(O_e);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var TY=!1,ab=new H,EY=!1;function Bot(e,t,n,i,r,o,s){YV=!1,qV=!1,TY=!1,EY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(O_e);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function cb(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Lot(e,t,n,i){return cb(e,"{x}",t)}function Not(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return cb(e,"{reverseX}",r)}function Fot(e,t,n,i){return cb(e,"{y}",n)}function Uot(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return cb(e,"{reverseY}",r)}function Vot(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return cb(e,"{reverseZ}",o)}function kot(e,t,n,i){return cb(e,"{z}",i)}function zot(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function XV(e,t,n,i){YV||(e.tilingScheme.tileXYToRectangle(t,n,i,gu),gu.west=P.toDegrees(gu.west),gu.south=P.toDegrees(gu.south),gu.east=P.toDegrees(gu.east),gu.north=P.toDegrees(gu.north),YV=!0)}function Hot(e,t,n,i){return XV(e,t,n,i),gu.west}function Got(e,t,n,i){return XV(e,t,n,i),gu.south}function Wot(e,t,n,i){return XV(e,t,n,i),gu.east}function jot(e,t,n,i){return XV(e,t,n,i),gu.north}function KV(e,t,n,i){qV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,ID),qV=!0)}function Yot(e,t,n,i){return KV(e,t,n,i),ID.west}function qot(e,t,n,i){return KV(e,t,n,i),ID.south}function Xot(e,t,n,i){return KV(e,t,n,i),ID.east}function Kot(e,t,n,i){return KV(e,t,n,i),ID.north}function Jot(e,t,n,i){return e.tileWidth}function Zot(e,t,n,i){return e.tileHeight}function Qot(e,t,n,i,r,o,s){return JV(e,t,n,i,r,o),ab.x}function $ot(e,t,n,i,r,o,s){return JV(e,t,n,i,r,o),ab.y}function est(e,t,n,i,r,o,s){return JV(e,t,n,i,r,o),e.tileWidth-ab.x-1}function tst(e,t,n,i,r,o,s){return JV(e,t,n,i,r,o),e.tileHeight-ab.y-1}var nst=new ce,sb=new m;function JV(e,t,n,i,r,o,s){if(TY)return;SY(e,t,n,i,r,o);let a=sb,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,nst);ab.x=e.tileWidth*(a.x-c.west)/c.width|0,ab.y=e.tileHeight*(c.north-a.y)/c.height|0,TY=!0}function ist(e,t,n,i,r,o,s){return P.toDegrees(r)}function rst(e,t,n,i,r,o,s){return P.toDegrees(o)}function ost(e,t,n,i,r,o,s){return SY(e,t,n,i,r,o),sb.x}function sst(e,t,n,i,r,o,s){return SY(e,t,n,i,r,o),sb.y}var ast=new he;function SY(e,t,n,i,r,o,s){if(!EY){if(e.tilingScheme.projection instanceof Di)sb.x=P.toDegrees(r),sb.y=P.toDegrees(o);else{let a=ast;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,sb)}EY=!0}}function cst(e,t,n,i,r,o,s){return s}var $s=NA;function yu(e){if(e=y(e,y.EMPTY_OBJECT),l(e.url)){$("TileMapServiceImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use TileMapServiceImageryProvider.fromUrl instead."),this._metadataError=void 0,this._ready=!1;let t,n=this,i=Promise.resolve(e.url).then(function(r){return t=ve.createIfNeeded(r),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),yu._requestMetadata(e,n._tmsResource,n._xmlResource,n)}).catch(r=>Promise.reject(r));$s.call(this,i),this._promise=i}}yu._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return yu._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof Dh)return yu._metadataFailure(e,t);throw r}};yu.fromUrl=async function(e,t){let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let o=await yu._requestMetadata(t,i,r),s=new yu;return $s.call(s,o),s};l(Object.create)&&(yu.prototype=Object.create($s.prototype),yu.prototype.constructor=yu);function M_e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function B_e(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),r=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}yu._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let O=0;O<g.length;O++)if(o.test(g.item(O).nodeName))u=g.item(O);else if(a.test(g.item(O).nodeName)){d=g.item(O);let L=g.item(O).childNodes;for(let N=0;N<L.length;N++)s.test(L.item(N).nodeName)&&p.push(L.item(N))}else c.test(g.item(O).nodeName)&&(f=g.item(O));let h;if(!l(d)||!l(f))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&Ti.reportError(void 0,r,r.errorEvent,h),new de(h);let A=y(t.fileExtension,u.getAttribute("extension")),x=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),T=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),E=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=d.getAttribute("profile"),w=t.tilingScheme;if(!l(w))if(S==="geodetic"||S==="global-geodetic")w=new Wi({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")w=new Uo({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(r)&&Ti.reportError(void 0,r,r.errorEvent,h),new de(h);let D=ce.clone(t.rectangle);if(!l(D)){let O,L,N,_;y(t.flipXY,!1)?(N=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let v=S==="geodetic"||S==="mercator";if(w.projection instanceof Di||v)O=he.fromDegrees(N.x,N.y),L=he.fromDegrees(_.x,_.y);else{let I=w.projection;O=I.unproject(N),L=I.unproject(_)}D=new ce(O.longitude,O.latitude,L.longitude,L.latitude)}return D=M_e(D,w),T=B_e(w,D,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${A}`}),tilingScheme:w,rectangle:D,tileWidth:x,tileHeight:C,minimumLevel:T,maximumLevel:E,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};yu._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),r=y(e.tileHeight,256),o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Uo({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=M_e(a,s);let c=B_e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Yp=yu;function vY(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}vY.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function lst(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new de(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Wi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Uo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new de(r)}return!0}function ust(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Ti.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function L_e(e,t,n){try{let i=await e.fetchText();lst(i,t)}catch(i){ust(i,e,n)}}function Cl(e){if(e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Cl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new _e,l(e.url)||l(e.channel)){$("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=ve.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=new vY(e);this._readyPromise=L_e(r,o,this).then(()=>(o.build(this),this._ready=!0,!0))}}Object.defineProperties(Cl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Cl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),r=ve.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new vY(n);s.channel=t,await L_e(o,s);let a=new Cl(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=r,a._url=e,a._path=i,a};Cl.prototype.getTileCredits=function(e,t,n){};Cl.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return gl.loadImage(this,r)};Cl.prototype.pickFeatures=function(e,t,n,i,r){};Cl._logoUrl=void 0;Object.defineProperties(Cl,{logoUrl:{get:function(){return l(Cl._logoUrl)||(Cl._logoUrl=nn("Assets/Images/google_earth_credit.png")),Cl._logoUrl},set:function(e){Cl._logoUrl=e}}});var PD=Cl;var fst=/\/$/,N_e=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function lb(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=y(e.format,"png");/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();fst.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=N_e,this._resource=i,this._imageryProvider=new $s({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(lb.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});lb.prototype.getTileCredits=function(e,t,n){};lb.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};lb.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};lb._defaultCredit=N_e;var OD=lb;function FA(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new Wi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new _e,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=ve.createIfNeeded(e.url);if(this._resource=r,l(e.tileWidth)||l(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}$("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=ZV(r,this).then(o=>(Ti.reportSuccess(this._errorEvent),this._image=o,this._tileWidth=o.width,this._tileHeight=o.height,this._ready=!0,!0))}Object.defineProperties(FA.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return $("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function dst(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Ti.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return ZV(e,n,o);throw l(n)&&(n._hasError=!0),new de(r)}async function ZV(e,t,n){try{return await gl.loadImage(null,e)}catch(i){return dst(e,i,t,n)}}FA.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await ZV(n);t=y(t,y.EMPTY_OBJECT);let r=new FA({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};FA.prototype.getTileCredits=function(e,t,n){};FA.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await ZV(this._resource,this);return this._image=r,Ti.reportSuccess(this._errorEvent),r}return this._image};FA.prototype.pickFeatures=function(e,t,n,i,r){};var RD=FA;function mst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=hst:e==="xml"?n=yst:(e==="html"||e==="text")&&(n=F_e)),this.callback=n}function hst(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new ch;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var wY="http://www.mapinfo.com/mxp",pst="http://www.esri.com/wms",_st="http://www.opengis.net/wfs",gst="http://www.opengis.net/gml";function yst(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===wY)return Ast(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===pst)return xst(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===_st)return Cst(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Tst(e):Est(e)}function Ast(e){let t=[],i=e.documentElement.getElementsByTagNameNS(wY,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(wY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new ch;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function xst(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(QV(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(QV(a,i))}}return n}function Cst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(gst,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};DY(o,s),t.push(QV(o,s))}return t}function Tst(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new de("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};DY(s,a),t.push(QV(s,a))}}return t}function DY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&DY(r,t)&&(t[r.localName]=r.textContent)}return n}function QV(e,t){let n=new ch;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Est(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new ch;return r.data=e,r.description=n.innerHTML,[r]}var bst=/<body>\s*<\/body>/im,Sst=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,vst=/<title>([\s\S]*)<\/title>/im;function F_e(e){if(bst.test(e)||Sst.test(e))return;let t,n=vst.exec(e);n&&n.length>1&&(t=n[1]);let i=new ch;return i.name=t,i.description=e,i.data=e,[i]}var ub=mst;function MD(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(MD.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});MD.prototype.getFromCache=function(e,t,n,i){let r=U_e(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};MD.prototype.checkApproachingInterval=function(e,t,n,i){let r=U_e(e,t,n),o=this._tilesRequestedForInterval,s=V_e(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!k_e(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};MD.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=V_e(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=k_e(this,c,o),a||s.push(c)}}};function U_e(e,t,n){return`${e}-${t}-${n}`}function wst(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function V_e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function k_e(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=wst(s),c=new $r({throttle:!1,throttleByServer:!0,type:ns.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var fb=MD;var Dst=[3034,3035,3042,3043,3044],Ist=[4471,4559];function zd(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(zd.DefaultParameters,!0),n.setQueryParameters(zd.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(z_e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(z_e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fb({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return H_e(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Ist.includes(a)||Dst.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new $s({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Wi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,zd.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function H_e(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Pst(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(zd.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return $("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return $("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});zd.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};zd.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=H_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};zd.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Pst(this,e,t,n,i,r,s)};zd.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});zd.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});zd.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new ub("json","application/json")),Object.freeze(new ub("xml","text/xml")),Object.freeze(new ub("text","text/html"))]);function z_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var BD=zd;var Ost=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function LD(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=ve.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!l(o)||o.length===1&&/{s}/.test(r))t.setQueryParameters(Ost),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Uo({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fb({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,A){return G_e(s,d,p,g,h,A)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new _e;let f=e.credit;this._credit=typeof f=="string"?new It(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function G_e(e,t,n,i,r,o){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(o)?o.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=gt(g,u)),l(f)&&(g=gt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:r}),d.setTemplateValues(p)}return gl.loadImage(e,d)}Object.defineProperties(LD.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return $("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});LD.prototype.getTileCredits=function(e,t,n){};LD.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=G_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};LD.prototype.pickFeatures=function(e,t,n,i,r){};var ND=LD;function qp(e){return function(t){return new e(t)}}var Rst={ARCGIS_MAPSERVER:qp(Hp),BING:qp(xD),GOOGLE_EARTH:qp(PD),MAPBOX:qp(OD),SINGLE_TILE:qp(RD),TMS:qp(Yp),URL_TEMPLATE:qp($s),WMS:qp(BD),WMTS:qp(ND)},Mst={ARCGIS_MAPSERVER:Hp.fromUrl,BING:async(e,t)=>xD.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,PD.fromUrl(e,n,t)},MAPBOX:(e,t)=>new OD({url:e,...t}),SINGLE_TILE:RD.fromUrl,TMS:Yp.fromUrl,URL_TEMPLATE:(e,t)=>new $s({url:e,...t}),WMS:(e,t)=>new BD({url:e,...t}),WMTS:(e,t)=>new ND({url:e,...t})};function Tl(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new _e;let t=e.assetId;l(t)&&($("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),Tl._initialize(this,t,e))}Object.defineProperties(Tl.prototype,{ready:{get:function(){return $("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return $("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return $("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Tl._initialize=function(e,t,n){let i=ma._createEndpointResource(t,n),r=t.toString()+n.accessToken+n.server,o=Tl._endpointCache[r];l(o)||(o=i.fetchJson(),Tl._endpointCache[r]=o),e._readyPromise=o.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new Yp({url:new ma(s,i)});else{let u=Rst[c];if(!l(u))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return e._tileCredits=ma.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=e,e._errorEvent.raiseEvent(u)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};Tl.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ma._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Tl._endpointCache[i];l(r)||(r=n.fetchJson(),Tl._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=o.externalType;if(!l(a))s=await Yp.fromUrl(new ma(o,n));else{let u=Mst[a];if(!l(u))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...o.options},d=f.url;delete f.url,s=await u(d,f)}let c=new Tl(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=ma.getCreditsFromEndpoint(o,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};Tl.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Tl.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Tl.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Tl._endpointCache={};var Hd=Tl;var Bst={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},uh=Object.freeze(Bst);function Lst(e){$("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,uh.AERIAL),n=new Hd;return Hd._initialize(n,t,e),n}var W_e=Lst;function Nst(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,uh.AERIAL);return Hd.fromAssetId(t)}var Ty=Nst;var K_e=co(wl(),1),j_e=576,Fst=100,FD="#ffffff",IY="#48b";function J_e(e,t){this.credit=e,this.count=y(t,1)}function Z_e(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function Ust(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Q_e="cesium-credit-delimiter";function Y_e(e){let t=document.createElement("span");return t.textContent=e,t.className=Q_e,t}function q_e(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function X_e(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(Y_e(n));else{let f=r[u];f.className!==Q_e&&e.replaceChild(Y_e(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(q_e(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(q_e(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function Vst(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<j_e?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=j_e&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function ic(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } -`,n}function kst(e){let t="";t+=ic(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=ic(".cesium-credit-lightbox",{"background-color":"#303336",color:FD,position:"relative","min-height":`${Fst}px`,margin:"auto"}),t+=ic(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:FD}),t+=ic(".cesium-credit-lightbox > ul > li a:hover",{color:IY}),t+=ic(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=ic(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=ic(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=ic(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:FD}),t+=ic(".cesium-credit-lightbox-close:hover",{color:IY}),t+=ic(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=ic(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=ic(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=ic(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:FD}),t+=ic(".cesium-credit-expand-link:hover",{color:IY}),t+=ic(".cesium-credit-text",{color:FD}),t+=ic(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function wr(e,t,n){let i=this;n=y(n,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function s(h){o.contains(h.target)||i.hideLightbox()}r.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",o.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let u=document.createElement("ul");o.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),kst(e);let g=It.clone(wr.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=r,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function $_e(e,t,n,i){i=y(i,1);let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new J_e(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}wr.prototype.addCredit=function(e){$("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};wr.prototype.addCreditToNextFrame=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=It.clone(ege())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,$_e(this,t,e)};wr.prototype.addDefaultCredit=function(e){$("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;Z_e(t,e)||(e.showOnScreen=!0,t.push(e))};wr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Z_e(t,e)||t.push(e)};wr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};wr.prototype.removeDefaultCredit=function(e){$("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};wr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};wr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};wr.prototype.update=function(){this._expanded&&Vst(this)};wr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o._isIon&&It.equals(wr.cesiumCredit,this._cesiumCredit)||$_e(this,s,o,Number.MAX_VALUE)}It.equals(wr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(wr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};wr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;X_e(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",X_e(this._creditList,t,void 0,"li"),Ust(this)};wr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};wr.prototype.isDestroyed=function(){return!1};wr._cesiumCredit=void 0;wr._cesiumCreditInitialized=!1;var $V;function ege(){if(!l($V)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new K_e.default(e).path()),$V=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return wr._cesiumCreditInitialized||(wr._cesiumCredit=$V,wr._cesiumCreditInitialized=!0),$V}Object.defineProperties(wr,{cesiumCredit:{get:function(){return ege(),wr._cesiumCredit},set:function(e){wr._cesiumCredit=e,wr._cesiumCreditInitialized=!0}}});wr.CreditDisplayElement=J_e;var ek=wr;function UD(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } -`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } -`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } -`;break;case"vec4":o=`vec4 getColor() { return ${r}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${r}; -${o} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=tr.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(UD.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});UD.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;UD.prototype.isTranslucent=tr.prototype.isTranslucent;UD.prototype.getRenderState=tr.prototype.getRenderState;var tge=UD;function tk(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var zst=new m,Hst=new Z,Gst=new Ne,Wst=new vi,jst=new pl,Yst=new rn,qst=new Po,Xst=new z,Kst=[1,1e5];tk.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof vi?a=Wst:s instanceof pl?a=jst:s instanceof rn?a=Yst:a=qst,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Kst,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=m.negate(g,zst);let h=Hst;Z.setColumn(h,0,g,h),Z.setColumn(h,1,p,h),Z.setColumn(h,2,d,h);let A=Ne.fromRotationMatrix(h,Gst);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new wn({geometryInstances:new Tt({geometry:new KE({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(z.fromAlpha(this._color,.1,Xst))},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new wn({geometryInstances:new Tt({geometry:new FU({origin:f,orientation:A,frustum:a,_drawNearPlane:i===0}),attributes:{color:zt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};tk.prototype.isDestroyed=function(){return!1};tk.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var Xp=tk;function nge(){this._cachedShowFrustumsShaders={}}function Jst(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Zst(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",r.sources.push(a);let u=Jst(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var VD=new z;function Qst(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(VD.red=t.debugOverlappingFrustums&1<<0?1:0,VD.green=t.debugOverlappingFrustums&1<<1?1:0,VD.blue=t.debugOverlappingFrustums&1<<2?1:0,VD.alpha=1,VD):z.WHITE}),n}var $st=new nt;nge.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=Zst(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=nt.shallowClone(t,$st);o.shaderProgram=r,o.uniformMap=Qst(e,t),o.execute(e.context,n)};var nk=nge;function ik(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=new B,this.id=e.id,this._id=void 0,this._primitive=void 0}ik.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!B.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=B.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Tt({geometry:new Wg({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:jo.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:$t.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),n=new Tt({geometry:new Wg({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:jo.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:$t.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),i=new Tt({geometry:new Wg({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:jo.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:$t.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this});this._primitive=new wn({geometryInstances:[t,n,i],appearance:new jo,asynchronous:!1})}this._primitive.update(e)}};ik.prototype.isDestroyed=function(){return!1};ik.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var rk=ik;var ok=`in vec4 positionEC; +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float pixelWidth = czm_metersPerPixel(position); + + #ifdef UNION_CLIPPING_REGIONS + float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. + #else + float clipAmount = 0.0; + bool clipped = true; + #endif -void main() -{ - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) - { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); + for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + + #ifdef UNION_CLIPPING_REGIONS + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) { + discard; + } + #else + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + #endif } - czm_ray ray = czm_ray(position, direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) - { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); - } - else - { + #ifndef UNION_CLIPPING_REGIONS + if (clipped) { discard; } - - czm_writeLogDepth(); + #endif + + return clipAmount; } -`;var sk=`in vec4 position; - -out vec4 positionEC; -void main() +void modelClippingPlanesStage(inout vec4 color) { - positionEC = czm_modelView * position; - gl_Position = czm_projection * positionEC; - - czm_vertexLogDepth(); + float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; + + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; + } } -`;function zD(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var kD=jt.supportsTypedArrays()?new Float32Array(12):[],ige=new m,rge=new m,PY=new m,oge=new m,ak=new m;function eat(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof rn)r=m.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,ige),g=m.normalize(p,rge),h=m.normalize(m.cross(m.UNIT_Z,p,PY),PY),A=m.normalize(m.cross(g,h,oge),oge),x=m.magnitude(p),C=Math.sqrt(x*x-1);r=m.multiplyByScalar(g,1/x,ige);let T=C/x;o=m.multiplyByScalar(h,T,rge),s=m.multiplyByScalar(A,T,PY)}let a=m.add(r,s,ak);m.subtract(a,o,a),m.multiplyComponents(n,a,a),m.pack(a,kD,0);let c=m.subtract(r,s,ak);m.subtract(c,o,c),m.multiplyComponents(n,c,c),m.pack(c,kD,3);let u=m.add(r,s,ak);m.add(u,o,u),m.multiplyComponents(n,u,u),m.pack(u,kD,6);let f=m.subtract(r,s,ak);return m.add(f,o,f),m.multiplyComponents(n,f,f),m.pack(f,kD,9),kD}zD.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:Se.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new He({sources:[sk]}),a=new He({sources:[ok]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=eat(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new dt({attributes:{position:new De({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Le.TRIANGLES});this._va=si.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};zD.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};zD.prototype.isDestroyed=function(){return!1};zD.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var ck=zD;function HD(){}var tat=/\bgl_FragDepth\b/,nat=/\bdiscard\b/;function iat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource,o,s=!1,a=r.sources,c=a.length;for(o=0;o<c;++o)if(tat.test(a[o])||nat.test(a[o])){s=!0;break}let u=!1,f=r.defines;for(c=f.length,o=0;o<c;++o)if(f[o]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main() -{ - out_FragColor = vec4(1.0); -} -`,r=new He({sources:[d]})):!s&&u&&(d=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`,r=new He({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}function rat(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let r=ze.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=ze.fromCache(r),n[t.id]=i}return i}HD.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=iat(n,t.shaderProgram),i.depthOnlyCommand.renderState=rat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var oat=/\s+czm_writeLogDepth\(/,sat=/\s+czm_vertexLogDepth\(/;function aat(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,u=!1,f=o.sources,d=f.length;for(a=0;a<d;++a)if(sat.test(f[a])){u=!0;break}if(!u){for(a=0;a<d;++a)f[a]=He.replaceMain(f[a],"czm_log_depth_main");c=` +`;var one={name:"ModelClippingPlanesPipelineStage"},A3e=new H;one.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,Te.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,Te.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,Te.FRAGMENT),bs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Te.FRAGMENT);let s=bs.getTextureResolution(i,o,A3e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Te.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Te.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",Te.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",Te.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",Te.FRAGMENT),r.addFragmentLines(AN);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=_t(a,e.uniformMap)};var EN=one;function rne(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(rne.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var SN=rne;var vN=`mat4 getInstancingTransform() +{ + mat4 instancingTransform; -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`,f.push(c)}for(f=s.sources,d=f.length,u=!1,a=0;a<d;++a)oat.test(f[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<d;a++)f[a]=He.replaceMain(f[a],"czm_log_depth_main");p+=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}return i}HD.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=aat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function cat(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let r=t._attributeLocations,o=t.fragmentShaderSource,s=o.sources,a=s.length,c=`void main() -{ - czm_non_pick_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = ${n}; -} -`,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=He.replaceMain(s[f],"czm_non_pick_main");u[a]=c,o=new He({sources:u,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}function lat(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let r=ze.getState(t);r.blending.enabled=!1,r.depthMask=!0,i=ze.fromCache(r),n[t.id]=i}return i}HD.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=cat(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=lat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};function uat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}HD.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=uat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Ey=HD;function lk(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var fat=new Ne,sge=new Ne,dat=new Z;function mat(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Ne.fromAxisAngle(r,n,sge),c=Ne.fromAxisAngle(o,i,fat),u=Ne.multiply(c,a,c),f=Ne.fromAxisAngle(s,t,sge);Ne.multiply(f,u,u);let d=Z.fromQuaternion(u,dat);Z.multiplyByVector(d,o,o),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,r,r)}lk.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;mat(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};lk.prototype.isDestroyed=function(){return!1};lk.prototype.destroy=function(){return this._removeListener(),ue(this)};var uk=lk;function hat(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var age=hat;var GD=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif -in vec3 v_positionEC; + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) + return instancingTransform; +} + +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() { - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes + mat4 instancingTransform2D; - vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + return instancingTransform2D; } - -void main() +#endif +`;var wN=`void instancingStage(inout ProcessedAttributes attributes) { - // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii - // in the vertex shader. Only when it is larger than some constant, march along the ray. - // Otherwise perform one intersection test which will be the common case. + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - // Test if the ray intersects a sphere with the ellipsoid's maximum radius. - // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test - // may cause false negatives. This will discard fragments before marching the ray forward. - float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; - vec3 direction = normalize(v_positionEC); - vec3 ellipsoidCenter = czm_modelView[3].xyz; + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif - float t1 = -1.0; - float t2 = -1.0; + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var IN=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) +{ + vec3 positionMC = attributes.positionMC; - float b = -2.0 * dot(direction, ellipsoidCenter); - float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - float discriminant = b * b - 4.0 * c; - if (discriminant >= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var DN=new L,E3e=new L,S3e=new L,ane={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:dne,_transformsToTypedArray:s6};ane.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(vN);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=[];V3e(e,n,i,f,u),G3e(e,n,i,f);let d={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,Te.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",Te.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",Te.VERTEX),d.u_instance_modifiedModelView=function(){let p=L.multiplyTransformation(s.modelMatrix,a.components.transform,DN);return u?L.multiplyTransformation(n.context.uniformState.view3D,p,DN):(n.mode!==ne.SCENE3D&&(p=Mt.basisTo2D(n.mapProjection,p,DN)),L.multiplyTransformation(n.context.uniformState.view,p,DN))},d.u_instance_nodeTransform=function(){return L.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,E3e)},r.addVertexLines(IN)):r.addVertexLines(wN),u){r.addDefine("USE_2D_INSTANCING",void 0,Te.VERTEX),r.addUniform("mat4","u_modelView2D",Te.VERTEX);let p=n.context,g=L.fromTranslation(c.instancingReferencePoint2D,new L);d.u_modelView2D=function(){return L.multiplyTransformation(p.uniformState.view,g,S3e)}}e.uniformMap=_t(d,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,f)};var Cv=new L,v3e=new m;function w3e(e,t,n,i,o){let r=L.multiplyTransformation(t,e,Cv);return r=L.multiplyTransformation(r,n,Cv),o=Mt.basisTo2D(i.mapProjection,r,o),o}function I3e(e,t,n,i,o){let r=L.fromTranslation(e,Cv),s=L.multiplyTransformation(t,r,Cv);s=L.multiplyTransformation(s,n,Cv);let a=L.getTranslation(s,v3e);return o=eo.computeActualWgs84Position(i,a,o),o}function cne(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=L.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=L.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=L.clone(o.computedModelMatrix,t),t=L.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=L.clone(L.IDENTITY,n))}var lne=new L,une=new L,D3e=new L,P3e=new m;function O3e(e,t,n,i){let o=lne,r=une;cne(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=w3e(f,o,r,n,D3e),p=L.getTranslation(d,P3e),g=m.subtract(p,a,p);i[u]=L.setTranslation(d,g,i[u])}return i}function R3e(e,t,n,i){let o=lne,r=une;cne(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=I3e(f,o,r,n,f);i[u]=m.subtract(d,a,i[u])}return i}var M3e=new m,L3e=new m;function fne(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=L.multiplyByPoint(i,n.instancingTranslationMin,M3e),r=eo.computeActualWgs84Position(t,o,o),s=L.multiplyByPoint(i,n.instancingTranslationMax,L3e),a=eo.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=m.lerp(r,a,.5,new m)}function s6(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function N3e(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var F3e=new m,B3e=new Be,k3e=new m;function dne(e,t,n){let i=new Array(t),o=en.getAttributeBySemantic(e,Yr.TRANSLATION),r=en.getAttributeBySemantic(e,Yr.ROTATION),s=en.getAttributeBySemantic(e,Yr.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Yn.dequantize(g,r.componentDatatype,r.type,t));let h;d?h=s.typedArray:(h=new Float32Array(t*3),h.fill(1));for(let b=0;b<t;b++){let C=new m(p[b*3],p[b*3+1],p[b*3+2],F3e);m.maximumByComponent(a,C,a),m.minimumByComponent(c,C,c);let T=new Be(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,B3e),A=new m(h[b*3],h[b*3+1],h[b*3+2],k3e),S=L.fromTranslationQuaternionRotationScale(C,T,A,new L);i[b]=S}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(s.typedArray=void 0),i}function U3e(e,t,n){let i=new Array(t),o=e.typedArray,r=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new m(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,m.minimumByComponent(r,u,r),m.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function a6(e,t){let n=ht.createVertexBuffer({context:t.context,typedArray:e,usage:ke.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function V3e(e,t,n,i,o){let r=en.getAttributeBySemantic(n,Yr.ROTATION);l(r)?z3e(e,n,i,t,o):H3e(e,n,i,t,o)}function z3e(e,t,n,i,o){let r=e.shaderBuilder,s=t.attributes[0].count,a=e.model,c=e.runtimeNode;r.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",f,d=c.instancingTransformsBuffer;if(!l(d)){f=dne(t,s,e);let x=s6(f);d=a6(x,i),a._modelResources.push(d),c.instancingTransformsBuffer=d}if(sne(e,d,n,u),!o)return;let p=Ye(i);p.mode=ne.COLUMBUS_VIEW,fne(e,p);let g=c.instancingTransformsBuffer2D;if(!l(g)){let x=O3e(f,e,p,f),b=s6(x);g=a6(b,i),a._modelResources.push(g),c.instancingTransformsBuffer2D=g}sne(e,g,n,"Transform2D")}function H3e(e,t,n,i,o){let r=e.shaderBuilder,s=e.runtimeNode,a=en.getAttributeBySemantic(t,Yr.TRANSLATION),c=en.getAttributeBySemantic(t,Yr.SCALE);if(l(c)){r.addDefine("HAS_INSTANCE_SCALE");let C="Scale";r6(e,c.buffer,c.byteOffset,c.byteStride,n,C)}if(!l(a))return;let u,f=a.typedArray;l(f)?u=U3e(a,a.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=a.min,s.instancingTranslationMax=a.max),r.addDefine("HAS_INSTANCE_TRANSLATION");let d="Translation";if(r6(e,a.buffer,a.byteOffset,a.byteStride,n,d),!o)return;let p=Ye(i);p.mode=ne.COLUMBUS_VIEW,fne(e,p);let g=s.instancingTranslationBuffer2D;if(!l(g)){let C=R3e(u,e,p,u),T=N3e(C);g=a6(T,i),e.model._modelResources.push(g),s.instancingTranslationBuffer2D=g}r6(e,g,0,void 0,n,"Translation2D")}function sne(e,t,n,i){let r=X.getSizeInBytes(X.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function r6(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function G3e(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===Yr.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:ln.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var PN=ane;var c6={};c6.name="ModelMatrixUpdateStage";c6.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;mne(e,t,o,e.transformToRoot),e._transformDirty=!1}};function mne(e,t,n,i){let o;i=L.multiplyTransformation(i,e.transform,new L),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let c=e.runtimePrimitives[o].drawCommand;c.modelMatrix=L.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=en.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=L.clone(i,a._transformToRoot),mne(a,t,n,i),a._transformDirty=!1}}var ON=c6;var hne={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:pne,_countGeneratedBuffers:_ne};hne.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;pne(i,o),_ne(i,r)};function pne(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function _ne(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var RN=hne;function QC(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=L.clone(n,this._originalTransform),this._transform=L.clone(n,this._transform),this._transformToRoot=L.clone(i,this._transformToRoot),this._computedTransform=new L,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,W3e(this)}Object.defineProperties(QC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=L.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),l6(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Be.equals(n,e)||(t.rotation=Be.clone(e,t.rotation),l6(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),l6(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function W3e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=L.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new d0(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function l6(e,t){e._transformDirty=!0,e._transform=L.fromTranslationRotationScale(t,e._transform)}QC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};QC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(PN),t.push(RN),n.push(ON)};QC.prototype.updateComputedTransform=function(){this._computedTransform=L.multiply(this._transformToRoot,this._transform,this._computedTransform)};QC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new L);let r=L.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=L.inverseTransformation(r,t[o]);t[o]=L.multiplyTransformation(s,n[o],t[o])}};var MN=QC;var gne={name:"AlphaPipelineStage"};gne.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Ae.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=mn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,Te.FRAGMENT),s.addUniform("float","u_alphaCutoff",Te.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var LN=gne;var yne={name:"BatchTexturePipelineStage"};yne.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=_t(o,e.uniformMap)};var NN=yne;var xne={name:"ClassificationPipelineStage"};xne.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,Te.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||j3e(t,o)};function j3e(e,t){let n=en.getAttributeBySemantic(e,Et.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=en.getAttributeBySemantic(e,Et.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],g=0;for(let x=1;x<s;x++){let b=r?i[x]:x,C=c[b];if(C!==p){let T=x-g,A=x;u.push(T),f.push(A),g=A,p=C}}let h=s-g;u.push(h),t.batchLengths=u,t.batchOffsets=f}var FN=xne;var BN=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + positionMC *= float(model_silhouettePass); + #else + positionMC *= 0.0; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + positionMC *= 0.0; } +} - if (t1 < 0.0 && t2 < 0.0) { +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ + float show = ceil(feature.color.a); + positionMC *= show; + + #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) + filterByPassType(positionMC, feature.color); + #endif +} +`;var kN=`void filterByPassType(vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + if(!model_silhouettePass) { + discard; + } + #else discard; + #endif } - - float t = min(t1, t2); - if (t < 0.0) { - t = 0.0; + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + discard; } +} - // March ray forward to intersection with larger sphere and find - czm_ray ray = czm_ray(t * direction, direction); - - vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); - - if (czm_isEmpty(intersection)) +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ + vec4 featureColor = feature.color; + if (featureColor.a == 0.0) { discard; } - // If the viewer is outside, compute outsideFaceColor, with normals facing outward. - vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - - // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. - vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); + // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. + // So, we only apply in in the fragment shader if the feature ID texture is used. + #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) + filterByPassType(featureColor); + #endif - out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); - out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); + featureColor = czm_gammaCorrect(featureColor); -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - t = (intersection.start != 0.0) ? intersection.start : intersection.stop; - vec3 positionEC = czm_pointAlongRay(ray, t); - vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH - czm_writeLogDepth(1.0 + positionCC.w); -#else - float z = positionCC.z / positionCC.w; + // Classification models compute the diffuse differently. + #ifdef HAS_CLASSIFICATION + material.diffuse = featureColor.rgb * featureColor.a; + #else + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + #endif + + material.alpha *= featureColor.a; +} +`;var bne={name:"CPUStylingPipelineStage"};bne.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(BN),o.addFragmentLines(kN),o.addDefine("USE_CPU_STYLING",void 0,Te.BOTH),l(i.color)||(o.addUniform("float",O0.COLOR_BLEND_UNIFORM_NAME,Te.FRAGMENT),e.uniformMap[O0.COLOR_BLEND_UNIFORM_NAME]=function(){return xc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",Te.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ae.TRANSLUCENT}};var UN=bne;var Cne={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Cne.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var og=Object.freeze(Cne);var VN=`void customShaderStage( + inout czm_modelVertexOutput vsOutput, + inout ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // VertexInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + VertexInput vsInput; + initializeInputStruct(vsInput, attributes); + vsInput.featureIds = featureIds; + vsInput.metadata = metadata; + vsInput.metadataClass = metadataClass; + vsInput.metadataStatistics = metadataStatistics; + vertexMain(vsInput, vsOutput); + attributes.positionMC = vsOutput.positionMC; +} +`;var zN=`void customShaderStage( + inout czm_modelMaterial material, + ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // FragmentInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + FragmentInput fsInput; + initializeInputStruct(fsInput, attributes); + fsInput.featureIds = featureIds; + fsInput.metadata = metadata; + fsInput.metadataClass = metadataClass; + fsInput.metadataStatistics = metadataStatistics; + fragmentMain(fsInput, material); +} +`;var HN=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); +} +`;var GN=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); + setFeatureIdVaryings(); +} +`;var Ri={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Ri.process=function(e,t,n){let i=e.shaderBuilder;q3e(i);let o=e.runtimeNode.node.instances;l(o)&&Y3e(e,o,n),X3e(e,t,n),i.addVertexLines(GN),i.addFragmentLines(HN)};function q3e(e){e.addStruct(Ri.STRUCT_ID_FEATURE_IDS_VS,Ri.STRUCT_NAME_FEATURE_IDS,Te.VERTEX),e.addStruct(Ri.STRUCT_ID_FEATURE_IDS_FS,Ri.STRUCT_NAME_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ri.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.VERTEX),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ri.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Te.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ri.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.VERTEX),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ri.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Te.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ri.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Te.VERTEX)}function Y3e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Ft.FeatureIdAttribute?K3e(e,s,a):Tne(e,s,a,o,1,n);let c=s.label;l(c)&&Ane(e,a,c,Te.BOTH)}}function X3e(e,t,n){let i=t.featureIds,r=en.getAttributeBySemantic(t,Et.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=Te.BOTH;a instanceof Ft.FeatureIdAttribute?J3e(e,a,c):a instanceof Ft.FeatureIdImplicitRange?Tne(e,a,c,r,void 0,n):(Z3e(e,a,c,s,n),u=Te.FRAGMENT);let f=a.label;l(f)&&Ane(e,c,f,u)}}function K3e(e,t,n){let i=e.shaderBuilder;i.addStructField(Ri.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ri.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Ri.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function J3e(e,t,n){let i=e.shaderBuilder;i.addStructField(Ri.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ri.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Tne(e,t,n,i,o,r){$3e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Ri.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ri.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ri.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Z3e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Ri.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,Te.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,d=`texture(${r}, ${f}).${c}`,p=`featureIds.${n} = czm_unpackUint(${d});`;u.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Ane(e,t,n,i){let o=e.shaderBuilder,r=Te.includesVertexShader(i);r&&o.addStructField(Ri.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Ri.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function $3e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=Q3e(t,n);s=ht.createVertexBuffer({context:o.context,typedArray:u,usage:ke.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s);let f=!1;r.statistics.addBuffer(s,f)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Q3e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var R0=Ri;var WN=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +} +`;var jN=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); + setMetadataVaryings(); +} +`;var bi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};bi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=eke(r.propertyAttributes,t,a),u=nke(r.propertyTextures,a),f=c.concat(u);oke(i,f),ake(i),i.addVertexLines(jN),i.addFragmentLines(WN);for(let d=0;d<c.length;d++){let p=c[d];cke(e,p)}for(let d=0;d<u.length;d++){let p=u[d];uke(e,p)}};function eke(e,t,n){return l(e)?e.flatMap(i=>tke(i,t,n)):[]}function tke(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=en,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:h,variableName:x}=o(g);u[f]={metadataVariable:r(d),property:p,type:p.classProperty.type,glslType:h,variableName:x,propertyStatistics:a?.properties[d],shaderDestination:Te.BOTH}}return u}function nke(e,t){return l(e)?e.flatMap(n=>ike(n,t)):[]}function ike(e,t){let{sanitizeGlslIdentifier:n}=en,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:Te.FRAGMENT}}return s}function oke(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==qt.ENUM&&i.add(u)}let o=bi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=bi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,Te.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?ske(c):c;e.addStructField(a,p,d)}}}var rke={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function ske(e){let t=rke[e];return l(t)?t:e}function ake(e){e.addStruct(bi.STRUCT_ID_METADATA_VS,bi.STRUCT_NAME_METADATA,Te.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_FS,bi.STRUCT_NAME_METADATA,Te.FRAGMENT),e.addStruct(bi.STRUCT_ID_METADATA_CLASS_VS,bi.STRUCT_NAME_METADATA_CLASS,Te.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_CLASS_FS,bi.STRUCT_NAME_METADATA_CLASS,Te.FRAGMENT),e.addStruct(bi.STRUCT_ID_METADATA_STATISTICS_VS,bi.STRUCT_NAME_METADATA_STATISTICS,Te.VERTEX),e.addStruct(bi.STRUCT_ID_METADATA_STATISTICS_FS,bi.STRUCT_NAME_METADATA_STATISTICS,Te.FRAGMENT),e.addFunction(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,bi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Te.VERTEX),e.addFunction(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,bi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Te.FRAGMENT),e.addFunction(bi.FUNCTION_ID_SET_METADATA_VARYINGS,bi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,Te.VERTEX)}function cke(e,t){lke(e,t),Ene(e.shaderBuilder,t),Sne(e.shaderBuilder,t)}function lke(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=wne({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:Te.BOTH,property:o});n.addStructField(bi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(bi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function uke(e,t){fke(e,t),Ene(e.shaderBuilder,t),Sne(e.shaderBuilder,t)}function fke(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f}=s.textureReader,d=`u_propertyTexture_${u}`;i.hasOwnProperty(d)||(n.addUniform("sampler2D",d,Te.FRAGMENT),i[d]=()=>f),n.addStructField(bi.STRUCT_ID_METADATA_FS,r,o);let p=`attributes.texCoord_${a}`,g=`texture(${d}, ${p}).${c}`,h=s.unpackInShader(g),x=wne({valueExpression:h,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:Te.FRAGMENT,property:s}),b=`metadata.${o} = ${x};`;n.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,[b])}function Ene(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=vne(bi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(bi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),Te.includesVertexShader(r)&&(e.addStructField(bi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Sne(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===qt.ENUM)return;let s=bi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=vne(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(bi.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),Te.includesVertexShader(t.shaderDestination)&&(e.addStructField(bi.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(bi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function vne(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function wne(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var Zf=bi;var dke={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},M0=Object.freeze(dke);var Xr={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Nt};Xr.process=function(e,t,n){let i=e.model.customShader;if(i&&Xr.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=r_.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&Xr.process_original(e,t,n,o[r])}};Xr.process_original=function(e,t,n,i){let o=e.shaderBuilder;l(i.lightingModel)&&(e.lightingOptions.lightingModel=i.lightingModel);let r=e.alphaOptions;i.translucencyMode===M0.TRANSLUCENT?r.pass=Ae.TRANSLUCENT:i.translucencyMode===M0.OPAQUE&&(r.pass=void 0);let s=bke(i,t);if(!s.customShaderEnabled)return;if(Eke(o,i,s),s.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Te.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Te.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Te.FRAGMENT);let u=og.getDefineName(i.mode);o.addDefine(u,void 0,Te.FRAGMENT)}let a=i.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];o.addUniform(f.type,u)}let c=i.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];o.addVarying(f,u)}e.uniformMap=_t(e.uniformMap,i.uniformMap)};function mke(e){let t={};for(let n=0;n<e.length;n++){let i=e[n],o=en.getAttributeInfo(i);t[o.variableName]=o}return t}var hke={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},pke={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Ine(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=hke[t],i=pke[t];if(l(n))return{attributeField:[n,e],value:i}}function _ke(e,t,n){let i=Dne(t,e.usedVariablesVertex.attributeSet,!1),o=i.addToShader,r=i.missingAttributes,s,a,c=[],u=[];for(s in o)if(o.hasOwnProperty(s)){let d=[o[s].glslType,s];c.push(d),a=`vsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let f=0;f<r.length;f++){s=r[f];let d=Ine(s);if(!l(d)){Xr._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${s}, disabling custom vertex shader`);return}c.push(d.attributeField),a=`vsInput.attributes.${s} = ${d.value};`,u.push(a)}n.enabled=!0,n.attributeFields=c,n.initializationLines=u}function gke(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function yke(e,t,n){let i=Dne(t,e.usedVariablesFragment.attributeSet,!0),o=i.addToShader,r=i.missingAttributes,s,a,c=[],u=[];for(s in o)if(o.hasOwnProperty(s)){let p=[o[s].glslType,s];c.push(p),a=`fsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let d=0;d<r.length;d++){s=r[d];let p=Ine(s);if(!l(p)){Xr._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${s}, disabling custom fragment shader.`);return}c.push(p.attributeField),a=`fsInput.attributes.${s} = ${p.value};`,u.push(a)}let f=gke(e);n.enabled=!0,n.attributeFields=c.concat(f.attributeFields),n.initializationLines=f.initializationLines.concat(u)}var xke={positionWC:!0,positionEC:!0};function Dne(e,t,n){let i,o,r={};for(o in e)if(e.hasOwnProperty(o)){let a=e[o];i=o,n&&o==="normalMC"?i="normalEC":n&&o==="tangentMC"&&(i="tangentEC"),t.hasOwnProperty(i)&&(r[i]=a)}let s=[];for(o in t)if(t.hasOwnProperty(o)){if(xke.hasOwnProperty(o))continue;i=o,n&&o==="normalEC"?i="normalMC":n&&o==="tangentEC"&&(i="tangentMC"),e.hasOwnProperty(i)||s.push(o)}return{addToShader:r,missingAttributes:s}}function bke(e,t){let n={enabled:!1},i={enabled:!1},o=mke(t.attributes);l(e.vertexShaderText)&&_ke(e,o,n),l(e.fragmentShaderText)&&yke(e,o,i);let s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:s}}function Cke(e,t){let n,i=Xr.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,Xr.STRUCT_NAME_ATTRIBUTES,Te.VERTEX);let o=t.attributeFields;for(n=0;n<o.length;n++){let a=o[n],c=a[0],u=a[1];e.addStructField(i,c,u)}i=Xr.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,Xr.STRUCT_NAME_VERTEX_INPUT,Te.VERTEX),e.addStructField(i,Xr.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,R0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Zf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Zf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,Zf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Xr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Xr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,Te.VERTEX);let s=t.initializationLines;e.addFunctionLines(r,s)}function Tke(e,t){let n,i=Xr.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,Xr.STRUCT_NAME_ATTRIBUTES,Te.FRAGMENT);let o,r,s,a=t.attributeFields;for(n=0;n<a.length;n++)o=a[n],r=o[0],s=o[1],e.addStructField(i,r,s);i=Xr.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,Xr.STRUCT_NAME_FRAGMENT_INPUT,Te.FRAGMENT),e.addStructField(i,Xr.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,R0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Zf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Zf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,Zf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let c=Xr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,Xr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,Te.FRAGMENT);let u=t.initializationLines;e.addFunctionLines(c,u)}var Ake=[];function Eke(e,t,n){let i=n.vertexLines,o=Ake;i.enabled&&(Cke(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,VN),e.addVertexLines(o));let r=n.fragmentLines;r.enabled&&(Tke(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,zN),e.addFragmentLines(o))}var qN=Xr;var Tv={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Tv.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,Te.VERTEX),i.addFunction(Tv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Tv.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,Te.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===Et.POSITION,d=c.semantic===Et.TEXCOORD;if(r&&!f&&!d)continue;let p=en.getAttributeInfo(c);vke(i,p),Ske(e,p)}};function Ske(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,Te.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,Te.VERTEX),n.addUniform(c,a,Te.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Pne(u,0),f=Pne(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Pne(e,t){return e instanceof re?e:new re(e.x,e.y,e.z,t)}function vke(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=wke(n,i):o=Ike(n),e.addFunctionLines(Tv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function wke(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function Ike(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var YN=Tv;var XN=`void geometryStage(out ProcessedAttributes attributes) +{ + attributes.positionMC = v_positionMC; + attributes.positionEC = v_positionEC; - float n = czm_depthRange.near; - float f = czm_depthRange.far; + #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER + attributes.positionWC = v_positionWC; + #endif - gl_FragDepth = (z * (f - n) + f + n) * 0.5; -#endif -#endif -} -`;var WD=`in vec3 position; + #ifdef HAS_NORMALS + // renormalize after interpolation + attributes.normalEC = normalize(v_normalEC); + #endif -uniform vec3 u_radii; + #ifdef HAS_TANGENTS + attributes.tangentEC = normalize(v_tangentEC); + #endif -out vec3 v_positionEC; + #ifdef HAS_BITANGENTS + attributes.bitangentEC = normalize(v_bitangentEC); + #endif -void main() + // Everything else is dynamically generated in GeometryPipelineStage + setDynamicVaryings(attributes); +} +`;var KN=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { - // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. - // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, - // but doing it here allows us to change the radii without rewriting the vertex data, and - // allows all ellipsoids to reuse the same vertex data. - vec4 p = vec4(u_radii * position, 1.0); - - v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates - gl_Position = czm_modelViewProjection * p; // position in clip coordinates + vec4 computedPosition; - // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums - // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the - // ellipsoid (does not write depth) that was rendered in the farther frustum. - // - // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates - // artifacts since some fragments can be alpha blended twice. This is solved by only rendering - // the ellipsoid in the closest frustum to the viewer. - gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + // Compute positions in different coordinate systems + vec3 positionMC = attributes.positionMC; + v_positionMC = positionMC; + v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; - czm_vertexLogDepth(); -} -`;var OY={position:0};function fk(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._modelMatrix=new B,this._computedModelMatrix=new B,this.show=y(e.show,!0),this.material=y(e.material,Gi.fromType(Gi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:y(e._owner,this)}),this._pickCommand=new nt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function pat(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ml.createGeometry(Ml.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Oe.POSITION_ONLY}));return t=si.fromGeometry({context:e,geometry:n,attributeLocations:OY,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}fk.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?hn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=pat(t));let r=!1,o=this.radii;if(!m.equals(this._radii,o)){m.clone(o,this._radii);let A=this._oneOverEllipsoidRadiiSquared;A.x=1/(o.x*o.x),A.y=1/(o.y*o.y),A.z=1/(o.z*o.z),r=!0}(!B.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(B.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),B.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(o),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new He({sources:[WD]}),p=new He({sources:[this.material.shaderSource,GD]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:OY}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=gt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Se.TRANSLUCENT:Se.OPAQUE,g.push(f)),h.pick){let A=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new He({sources:[WD]}),p=new He({sources:[this.material.shaderSource,GD],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:OY}),A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._pickSP,A.uniformMap=gt(gt(this._uniforms,this._pickUniforms),this.material._uniforms),A.executeInClosestFrustum=n),A.boundingVolume=this._boundingSphere,A.modelMatrix=this._computedModelMatrix,A.pass=n?Se.TRANSLUCENT:Se.OPAQUE,g.push(A)}};fk.prototype.isDestroyed=function(){return!1};fk.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var dk=fk;var mk=`in vec3 v_positionMC; -in vec3 v_positionEC; -in vec2 v_st; + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + vec3 position2D = attributes.position2D; + vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; + computedPosition = czm_projection * vec4(positionEC, 1.0); + #else + computedPosition = czm_projection * vec4(v_positionEC, 1.0); + #endif -void main() -{ - czm_materialInput materialInput; + // Sometimes the custom shader and/or style needs this + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) + // Note that this is a 32-bit position which may result in jitter on small + // scales. + v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + #endif - vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif + #ifdef HAS_NORMALS + v_normalEC = normalize(normal * attributes.normalMC); + #endif - materialInput.s = v_st.s; - materialInput.st = v_st; - materialInput.str = vec3(v_st, 0.0); + #ifdef HAS_TANGENTS + v_tangentEC = normalize(normal * attributes.tangentMC); + #endif - // Convert tangent space material normal to eye space - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); + #ifdef HAS_BITANGENTS + v_bitangentEC = normalize(normal * attributes.bitangentMC); + #endif - // Convert view vector to world space - vec3 positionToEyeEC = -v_positionEC; - materialInput.positionToEyeEC = positionToEyeEC; + // All other varyings need to be dynamically generated in + // GeometryPipelineStage + setDynamicVaryings(attributes); + + return computedPosition; +} +`;var Av=`vec2 computeSt(float featureId) +{ + float stepX = model_textureStep.x; + float centerX = model_textureStep.y; - czm_material material = czm_getMaterial(materialInput); + #ifdef MULTILINE_BATCH_TEXTURE + float stepY = model_textureStep.z; + float centerY = model_textureStep.w; -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + float xId = mod(featureId, model_textureDimensions.x); + float yId = floor(featureId / model_textureDimensions.x); + + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); + #else + return vec2(centerX + (featureId * stepX), 0.5); + #endif } -`;var hk=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec2 st; -in float batchId; -out vec3 v_positionMC; -out vec3 v_positionEC; -out vec2 v_st; +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +{ + int featureId = featureIds.SELECTED_FEATURE_ID; -void main() -{ - vec4 p = czm_computePosition(); - v_positionMC = position3DHigh + position3DLow; // position in model coordinates - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_st = st; + if (featureId < model_featuresLength) + { + vec2 featureSt = computeSt(float(featureId)); - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function UA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Gi.fromType(Gi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,hk),this._fragmentShaderSource=y(e.fragmentShaderSource,mk),this._renderState=tr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(UA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return UA.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});UA.VERTEX_FORMAT=Oe.POSITION_AND_ST;UA.prototype.getFragmentShaderSource=tr.prototype.getFragmentShaderSource;UA.prototype.isTranslucent=tr.prototype.isTranslucent;UA.prototype.getRenderState=tr.prototype.getRenderState;var cge=UA;function lge(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var pk=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],fh=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<fh.length;++e)fh[e]*=1e6;var uge=fh[1],RY=fh[fh.length-1];for(let e=0;e<fh.length;++e)fh[e]=(fh[e]-RY)/(uge-RY);var ea=0;function _at(e){let t=pk,n=t.length;if(e<t[0])return ea=0,ea;if(e>t[n-1])return ea=n-2,ea;if(e>=t[ea]){if(ea+1<n&&e<t[ea+1])return ea;if(ea+2<n&&e<t[ea+2])return++ea,ea}else if(ea-1>=0&&e>=t[ea-1])return--ea,ea;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ea=i,ea}var gat=new m;lge.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let r=i.height,o=_at(r),s=P.clamp((r-pk[o])/(pk[o+1]-pk[o]),0,1),a=P.lerp(fh[o],fh[o+1],s),c=this.density*1e6,u=c/uge*RY;a=a*(c-u)*1e-6;let f=m.normalize(n.positionWC,gat),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var _k=lge;function El(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,El.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,El.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,El.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,El.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,El.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new _e,this._nominalFrameRate=new _e,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){yat(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){Aat(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}El.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};El.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new El({scene:e})),e._frameRateMonitor};Object.defineProperties(El.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});El.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};El.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};El.prototype.isDestroyed=function(){return!1};El.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function yat(e,t){if(e._pauseCount>0)return;let n=Ci();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Zn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function Aat(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var gk=El;function xat(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var yk=xat;function Cat(e,t){this.near=y(e,0),this.far=y(t,0);let n=Se.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var Ak=Cat;function Tat(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = ${n}.rgb; - float clippingPlanesEdgeWidth = ${n}.a; - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) - { - out_FragColor = clippingPlanesEdgeColor; - } -`}var xk=Tat;var Ck=`uniform vec4 u_initialColor; + feature.id = featureId; + feature.st = featureSt; + feature.color = texture(model_batchTexture, featureSt); + } + // Floating point comparisons can be unreliable in GLSL, so we + // increment the feature ID to make sure it's always greater + // then the model_featuresLength - a condition we check for in the + // pick ID, to avoid sampling the pick texture if the feature ID is + // greater than the number of features. + else + { + feature.id = model_featuresLength + 1; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP -uniform sampler2D u_mars_clip_area; -uniform bool u_mars_clip_enabled; -uniform bool u_mars_clip_only; -uniform mat4 u_mars_clip_inverMatrix; -uniform vec4 u_mars_clip_rect; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + #ifdef HAS_NULL_FEATURE_ID + if (featureId == model_nullFeatureId) { + feature.id = featureId; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + #endif +} +`;var Ev={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};Ev.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=Dke(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),Pke(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===Te.BOTH&&i.addVertexLines(Av),i.addFragmentLines(Av)};function One(e){return e instanceof Ft.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Rne(e){return e instanceof Ft.FeatureIdTexture?Te.FRAGMENT:Te.BOTH}function Dke(e,t,n){let i,o;return l(t.instances)&&(o=en.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Rne(o),featureIdDefine:One(o)}):(o=en.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Rne(o),featureIdDefine:One(o)})}function Pke(e){e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Ev.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var L0=Ev;var Cs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Cs.process=function(e,t,n){let i=e.shaderBuilder,o=e.model;i.addStruct(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Te.VERTEX),i.addStruct(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Te.FRAGMENT),i.addStruct(L0.STRUCT_ID_SELECTED_FEATURE,L0.STRUCT_NAME_SELECTED_FEATURE,Te.BOTH),i.addFunction(Cs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Cs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Te.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Cs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Cs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.VERTEX),i.addFunction(Cs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Cs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Te.FRAGMENT),o.type===Go.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Te.FRAGMENT);let s=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,u=t.attributes.length;for(let f=0;f<u;f++){let d=t.attributes[f],p=ln.getAttributeLocationCount(d.type),g=d.semantic===Et.POSITION,h;p>1?(h=e.attributeIndex,e.attributeIndex+=p):g&&!c?h=0:h=e.attributeIndex++,Oke(e,d,h,p,s,a)}Vke(i,t.attributes),t.primitiveType===Fe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(KN),i.addFragmentLines(XN)};function Oke(e,t,n,i,o,r){let s=e.shaderBuilder,a=en.getAttributeInfo(t),c=o&&!r;i>1?Lke(e,t,n,i):Mke(e,t,n,c),Fke(s,a,c),Nke(s,a),l(t.semantic)&&Rke(s,t),Bke(s,a,o),kke(s,a,c),Uke(s,a)}function Rke(e,t){let n=t.semantic,i=t.setIndex;switch(n){case Et.NORMAL:e.addDefine("HAS_NORMALS");break;case Et.TANGENT:e.addDefine("HAS_TANGENTS");break;case Et.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Et.TEXCOORD:case Et.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Mke(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===Et.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===Et.POSITION,f=u?0:n,d=ln.getNumberOfComponents(r),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function Lke(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.normalized,u=ln.getNumberOfComponents(r)/i,f=X.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let h=t.byteOffset+g*d,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:h,strideInBytes:p,normalize:a};e.attributes.push(x)}}function Nke(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function Fke(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===Et.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function Bke(e,t,n){let i=Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,r=t.variableName;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,t.glslType,r),e.addStructField(o,t.glslType,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function kke(e,t,n){let i=Cs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function Uke(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(l(n)&&!l(i))return;let o=Cs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Cs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Vke(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===Et.NORMAL?n=!0:r.semantic===Et.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Cs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var JN=Cs;var ZN=`#ifdef LIGHTING_PBR +vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes) +{ + czm_pbrParameters pbrParameters; + pbrParameters.diffuseColor = inputMaterial.diffuse; + pbrParameters.f0 = inputMaterial.specular; + pbrParameters.roughness = inputMaterial.roughness; + + #ifdef USE_CUSTOM_LIGHT_COLOR + vec3 lightColorHdr = model_lightColorHdr; + #else + vec3 lightColorHdr = czm_lightColorHdr; + #endif -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; + vec3 color = inputMaterial.diffuse; + #ifdef HAS_NORMALS + color = czm_pbrLighting( + attributes.positionEC, + inputMaterial.normalEC, + czm_lightDirectionEC, + lightColorHdr, + pbrParameters + ); -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; -#endif + #ifdef USE_IBL_LIGHTING + color += imageBasedLightingStage( + attributes.positionEC, + inputMaterial.normalEC, + czm_lightDirectionEC, + lightColorHdr, + pbrParameters + ); + #endif + #endif -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; -#endif + color *= inputMaterial.occlusion; + color += inputMaterial.emissive; -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; -#endif + // In HDR mode, the frame buffer is in linear color space. The + // post-processing stages (see PostProcessStageCollection) will handle + // tonemapping. However, if HDR is not enabled, we must tonemap else large + // values may be clamped to 1.0 + #ifndef HDR + color = czm_acesTonemapping(color); + #endif -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; + return color; +} #endif -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; -#endif +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ + // Even though the lighting will only set the diffuse color, + // pass all other properties so further stages have access to them. + vec3 color = vec3(0.0); -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; -#endif + #ifdef LIGHTING_PBR + color = computePbrLighting(material, attributes); + #else // unlit + color = material.diffuse; + #endif -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; -#endif + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + // The colors resulting from point cloud styles are adjusted differently. + color = czm_gammaCorrect(color); + #elif !defined(HDR) + // If HDR is not enabled, the frame buffer stores sRGB colors rather than + // linear colors so the linear value must be converted. + color = czm_linearToSrgb(color); + #endif -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; -#endif + material.diffuse = color; +} +`;var zke={UNLIT:0,PBR:1},cp=Object.freeze(zke);var Mne={name:"LightingPipelineStage"};Mne.process=function(e,t){let n=e.model,i=e.lightingOptions,o=e.shaderBuilder;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Te.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",Te.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===cp.PBR?o.addDefine("LIGHTING_PBR",void 0,Te.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,Te.FRAGMENT),o.addFragmentLines(ZN)};var $N=Mne;var QN=`// If the style color is white, it implies the feature has not been styled. +bool isDefaultStyleColor(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D -uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; -#endif +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +{ + vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); + vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; + return color; +} -#ifdef APPLY_FILTER_COLOR_MARS3D -uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ + return vec2(textureTransform * vec3(texCoord, 1.0)); +} -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ + // Geometry normal. This is already normalized + vec3 ng = attributes.normalEC; -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif + vec3 normal = ng; + #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) + vec2 normalTexCoords = TEXCOORD_NORMAL; + #ifdef HAS_NORMAL_TEXTURE_TRANSFORM + normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform); + #endif -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + mat3 tbn = mat3(t, b, ng); + vec3 n = texture(u_normalTexture, normalTexCoords).rgb; + normal = normalize(tbn * (2.0 * n - 1.0)); + #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // If derivatives are available (not IE 10), compute tangents + vec3 positionEC = attributes.positionEC; + vec3 pos_dx = dFdx(positionEC); + vec3 pos_dy = dFdy(positionEC); + vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0)); + vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0)); + vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); + t = normalize(t - ng * dot(ng, t)); + vec3 b = normalize(cross(ng, t)); + mat3 tbn = mat3(t, b, ng); + vec3 n = texture(u_normalTexture, normalTexCoords).rgb; + normal = normalize(tbn * (2.0 * n - 1.0)); + #endif + #endif -#ifdef SHOW_REFLECTIVE_OCEAN -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + normal = -normal; + } + #endif -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; + return normal; +} #endif -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +{ + #ifdef HAS_NORMALS + material.normalEC = computeNormal(attributes); + #endif -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif + vec4 baseColorWithAlpha = vec4(1.0); + // Regardless of whether we use PBR, set a base color + #ifdef HAS_BASE_COLOR_TEXTURE + vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif + #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM + baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); + #endif -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif + baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif + #ifdef HAS_BASE_COLOR_FACTOR + baseColorWithAlpha *= u_baseColorFactor; + #endif + #elif defined(HAS_BASE_COLOR_FACTOR) + baseColorWithAlpha = u_baseColorFactor; + #endif -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; // Hue, saturation, brightness -#endif + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + baseColorWithAlpha = v_pointCloudColor; + #elif defined(HAS_COLOR_0) + vec4 color = attributes.color_0; + // .pnts files store colors in the sRGB color space + #ifdef HAS_SRGB_COLOR + color = czm_srgbToLinear(color); + #endif + baseColorWithAlpha *= color; + #endif -#ifdef HIGHLIGHT_FILL_TILE -uniform vec4 u_fillHighlightColor; -#endif + material.diffuse = baseColorWithAlpha.rgb; + material.alpha = baseColorWithAlpha.a; -#ifdef TRANSLUCENT -uniform vec4 u_frontFaceAlphaByDistance; -uniform vec4 u_backFaceAlphaByDistance; -uniform vec4 u_translucencyRectangle; -#endif + #ifdef USE_CPU_STYLING + material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend); + #endif -#ifdef UNDERGROUND_COLOR -uniform vec4 u_undergroundColor; -uniform vec4 u_undergroundColorAlphaByDistance; -#endif + #ifdef HAS_OCCLUSION_TEXTURE + vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; + #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM + occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + #endif + material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; + #endif -#ifdef ENABLE_VERTEX_LIGHTING -uniform float u_lambertDiffuseMultiplier; -uniform float u_vertexShadowDarkness; -#endif + #ifdef HAS_EMISSIVE_TEXTURE + vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; + #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM + emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #endif -in vec3 v_positionMC; -in vec3 v_positionEC; -in vec3 v_textureCoordinates; -in vec3 v_normalMC; -in vec3 v_normalEC; + vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); + #ifdef HAS_EMISSIVE_FACTOR + emissive *= u_emissiveFactor; + #endif + material.emissive = emissive; + #elif defined(HAS_EMISSIVE_FACTOR) + material.emissive = u_emissiveFactor; + #endif -#ifdef APPLY_MATERIAL -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -uniform bool u_mars_flood_globe; + #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE + vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM + specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); + #endif -uniform sampler2D u_mars_flood_area; -uniform bool u_mars_flood_emabled; -uniform bool u_showFloodOnly; -uniform mat4 u_mars_flood_inverMatrix; -uniform vec4 u_mars_flood_rect; -uniform bool u_mars_flood_showElse; -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); + vec3 specular = specularGlossiness.rgb; + float glossiness = specularGlossiness.a; + #ifdef HAS_SPECULAR_FACTOR + specular *= u_specularFactor; + #endif -in float v_height; -in float v_slope; -in float v_aspect; -#endif + #ifdef HAS_GLOSSINESS_FACTOR + glossiness *= u_glossinessFactor; + #endif + #else + #ifdef HAS_SPECULAR_FACTOR + vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); + #else + vec3 specular = vec3(1.0); + #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; -#endif + #ifdef HAS_GLOSSINESS_FACTOR + float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); + #else + float glossiness = 1.0; + #endif + #endif -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; -#endif + #ifdef HAS_DIFFUSE_TEXTURE + vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; + #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM + diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); + #endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT -uniform int u_mars_uplift_RectangleWidth; -uniform int u_mars_uplift_RectangleHeight; -uniform highp sampler2D u_mars_uplift_RampRectangle; -uniform float u_mars_inverseTileWidth; -uniform vec2 u_mars_cartographicTileRectangle; -uniform bool u_mars_uplift_enabled; -uniform bool u_mars_uplift_hideInsideOrOutside; + vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); + #ifdef HAS_DIFFUSE_FACTOR + diffuse *= u_diffuseFactor; + #endif + #elif defined(HAS_DIFFUSE_FACTOR) + vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); + #else + vec4 diffuse = vec4(1.0); + #endif + czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial( + diffuse.rgb, + specular, + glossiness + ); + material.diffuse = parameters.diffuseColor; + // the specular glossiness extension's alpha overrides anything set + // by the base material. + material.alpha = diffuse.a; + material.specular = parameters.f0; + material.roughness = parameters.roughness; + #elif defined(LIGHTING_PBR) + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE + vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM + metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); + #endif -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); - float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); - vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, 0.0); -} + vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; + float metalness = clamp(metallicRoughness.b, 0.0, 1.0); + float roughness = clamp(metallicRoughness.g, 0.04, 1.0); + #ifdef HAS_METALLIC_FACTOR + metalness *= u_metallicFactor; + #endif -bool inSlopeRampRectangle() { - for(int h = 0; h < 100000; h++) { - if(h >= u_mars_uplift_RectangleWidth) - break; + #ifdef HAS_ROUGHNESS_FACTOR + roughness *= u_roughnessFactor; + #endif + #else + #ifdef HAS_METALLIC_FACTOR + float metalness = clamp(u_metallicFactor, 0.0, 1.0); + #else + float metalness = 1.0; + #endif - vec4 first = getRegions(0, h); - float currentLength = first.z; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++) { - if(float(w) >= currentLength) - break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { - if(v_textureCoordinates.y <= max(p1.y, p2.y)) { - if(p1.x != p2.x) { - xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { - counter += 1.0; - } - } - } - } + #ifdef HAS_ROUGHNESS_FACTOR + float roughness = clamp(u_roughnessFactor, 0.04, 1.0); + #else + float roughness = 1.0; + #endif + #endif + czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial( + material.diffuse, + metalness, + roughness + ); + material.diffuse = parameters.diffuseColor; + material.specular = parameters.f0; + material.roughness = parameters.roughness; + #endif +} +`;var Hke=Ft.Material,u6=Ft.MetallicRoughness,f6=Ft.SpecularGlossiness,Lne={name:"MaterialPipelineStage",_processTexture:rg,_processTextureTransform:Nne};Lne.process=function(e,t,n){let i=t.material,o=e.model,r=l(o.classificationType),s=r,a=e.uniformMap,c=e.shaderBuilder,u=n.context.defaultTexture,f=n.context.defaultNormalTexture,d=n.context.defaultEmissiveTexture;Gke(i,a,c,u,f,d,s),l(i.specularGlossiness)?Wke(i,a,c,u,s):jke(i,a,c,u,s);let p=en.getAttributeBySemantic(t,Et.NORMAL),g=e.lightingOptions;i.unlit||!p||r?g.lightingModel=cp.UNLIT:g.lightingModel=cp.PBR;let h=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let x=e.alphaOptions;i.alphaMode===$h.BLEND?x.pass=Ae.TRANSLUCENT:i.alphaMode===$h.MASK&&(x.alphaCutoff=i.alphaCutoff),c.addFragmentLines(QN),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Te.BOTH)};function Nne(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,Te.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Te.FRAGMENT),t[s]=function(){return n.transform}}function rg(e,t,n,i,o,r){e.addUniform("sampler2D",i,Te.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,Te.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,Te.FRAGMENT);let f=n.transform;l(f)&&!Z.equals(f,Z.IDENTITY)&&Nne(e,t,n,i,o)}function Gke(e,t,n,i,o,r,s){let a=e.emissiveFactor;if(l(a)&&!m.equals(a,Hke.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",Te.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Te.FRAGMENT);let f=e.emissiveTexture;l(f)&&!s&&rg(n,t,f,"u_emissiveTexture","EMISSIVE",r)}let c=e.normalTexture;l(c)&&!s&&rg(n,t,c,"u_normalTexture","NORMAL",o);let u=e.occlusionTexture;l(u)&&!s&&rg(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function Wke(e,t,n,i,o){let r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Te.FRAGMENT);let s=r.diffuseTexture;l(s)&&!o&&rg(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=r.diffuseFactor;l(a)&&!re.equals(a,f6.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Te.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Te.FRAGMENT));let c=r.specularGlossinessTexture;l(c)&&!o&&rg(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let u=r.specularFactor;l(u)&&!m.equals(u,f6.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Te.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Te.FRAGMENT));let f=r.glossinessFactor;l(f)&&f!==f6.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Te.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Te.FRAGMENT))}function jke(e,t,n,i,o){let r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Te.FRAGMENT);let s=r.baseColorTexture;l(s)&&!o&&rg(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=r.baseColorFactor;l(a)&&!re.equals(a,u6.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Te.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Te.FRAGMENT));let c=r.metallicRoughnessTexture;l(c)&&!o&&rg(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=r.metallicFactor;l(u)&&u!==u6.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Te.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Te.FRAGMENT));let f=r.roughnessFactor;l(f)&&f!==u6.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Te.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Te.FRAGMENT))}var eF=Lne;var tF=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + attributes.positionMC = getMorphedPosition(positionMC); - } - if((mod(counter, 2.0) != 0.0)) { - return true; - } - } + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = getMorphedNormal(normalMC); + #endif - return false; + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = getMorphedTangent(tangentMC); + #endif +}`;var ga={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};ga.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Te.VERTEX),Zke(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==Et.POSITION&&p!==Et.NORMAL&&p!==Et.TANGENT||(Yke(e,d,e.attributeIndex,a),e.attributeIndex++)}}$ke(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,Te.VERTEX),n.addVertexLines(tF);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=_t(s,e.uniformMap)};var qke={attributeString:void 0,functionId:void 0};function Yke(e,t,n,i){let o=e.shaderBuilder;Xke(e,t,n);let r=Kke(t,qke);Jke(o,r,i)}function Xke(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:ln.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Kke(e,t){switch(e.semantic){case Et.POSITION:t.attributeString="Position",t.functionId=ga.FUNCTION_ID_GET_MORPHED_POSITION;break;case Et.NORMAL:t.attributeString="Normal",t.functionId=ga.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Et.TANGENT:t.attributeString="Tangent",t.functionId=ga.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Jke(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function Zke(e){e.addFunction(ga.FUNCTION_ID_GET_MORPHED_POSITION,ga.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,Te.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(ga.FUNCTION_ID_GET_MORPHED_NORMAL,ga.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,Te.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(ga.FUNCTION_ID_GET_MORPHED_TANGENT,ga.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,Te.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function $ke(e){let t="return morphedPosition;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(ga.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var nF=ga;var Fne={name:"PickingPipelineStage"};Fne.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)Qke(e,t,a,i);else if(l(a))eUe(e,i);else{let c=Bne(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",Te.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Bne(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Go.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function Qke(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=en.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=en.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",Te.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function eUe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let d=0;d<n;d++){let p=Bne(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let h=g.color;o[d*4+0]=z.floatToByte(h.red),o[d*4+1]=z.floatToByte(h.green),o[d*4+2]=z.floatToByte(h.blue),o[d*4+3]=z.floatToByte(h.alpha)}r._pickIds=i;let a=ht.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;r.statistics.addBuffer(a,c),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,Te.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var iF=Fne;var tUe={ADD:0,REPLACE:1},Wo=Object.freeze(tUe);var oF=`float getPointSizeFromAttenuation(vec3 positionEC) { + // Variables are packed into a single vector to minimize gl.uniformXXX() calls + float pointSize = model_pointCloudParameters.x; + float geometricError = model_pointCloudParameters.y; + float depthMultiplier = model_pointCloudParameters.z; + + float depth = -positionEC.z; + return min((geometricError / depth) * depthMultiplier, pointSize); } -#endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); } #endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); } #endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ - return - v_textureCoordinates.x > u_translucencyRectangle.x && - v_textureCoordinates.x < u_translucencyRectangle.z && - v_textureCoordinates.y > u_translucencyRectangle.y && - v_textureCoordinates.y < u_translucencyRectangle.w; +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + return getPointSizeFromAttenuation(v_positionEC); } #endif -vec4 sampleAndBlend( - vec4 previousColor, - sampler2D textureToSample, - vec2 tileTextureCoordinates, - vec4 textureCoordinateRectangle, - vec4 textureCoordinateTranslationAndScale, - float textureAlpha, - float textureNightAlpha, - float textureDayAlpha, - float textureBrightness, - float textureContrast, - float textureHue, - float textureSaturation, - float textureOneOverGamma, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - bool textureInvertColor, - vec3 texturefilterColor, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - float split, - vec4 colorToAlpha, - float nightBlend) -{ - // This crazy step stuff sets the alpha to 0.0 if this following condition is true: - // tileTextureCoordinates.s < textureCoordinateRectangle.s || - // tileTextureCoordinates.s > textureCoordinateRectangle.p || - // tileTextureCoordinates.t < textureCoordinateRectangle.t || - // tileTextureCoordinates.t > textureCoordinateRectangle.q - // In other words, the alpha is zero if the fragment is outside the rectangle - // covered by this texture. Would an actual 'if' yield better performance? - vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { + #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) + // This needs to be computed in eye coordinates so we can't use attributes.normalMC + return step(-v_normalEC.z, 0.0); + #else + return 1.0; + #endif +} +#endif`;var nUe=new re,Une={name:"PointCloudStylingPipelineStage"};Une.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=sUe(a),b=aUe(r,x);cUe(i,b);let T=lUe(b).indexOf("normalMC")>=0,A=en.getAttributeBySemantic(t,Et.NORMAL);if(T&&!A)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Te.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=Ae.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Te.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,Te.VERTEX);let d,p,g;Go.is3DTiles(o.type)&&(p=!0,d=o.content,g=d.tile.refine===Wo.ADD),i.addUniform("vec4","model_pointCloudParameters",Te.VERTEX),i.addVertexLines(oF);let h=e.uniformMap;h.model_pointCloudParameters=function(){let x=nUe,b=1;p&&(b=g?5:d.tileset.maximumScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let C=iUe(e,t,f,d);x.y=C*f.geometricErrorScale;let T=n.context,A=n.camera.frustum,S;return n.mode===ne.SCENE2D||A instanceof on?S=Number.POSITIVE_INFINITY:S=T.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=d.tileset.timeSinceLoad),x}};var kne=new m;function iUe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=en.getAttributeBySemantic(t,Et.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,kne);a=L.multiplyByPointAsVector(s,a,kne);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var oUe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},rUe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function sUe(e){let t=Ye(rUe);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var d6="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function aUe(e,t){let n=oUe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${d6})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${d6})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${d6})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function cUe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,Te.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,Te.VERTEX),e.addVertexLines(i));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,Te.VERTEX),e.addVertexLines(o))}function m6(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function lUe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&m6(t,o),l(n)&&m6(n,o),l(i)&&m6(i,o),o}var rF=Une;var sF=`void primitiveOutlineStage() { + v_outlineCoordinates = a_outlineCoordinates; +} +`;var aF=`void primitiveOutlineStage(inout czm_modelMaterial material) { + if (!model_showOutline) { + return; + } - alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + float outlineX = + texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; + float outlineY = + texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; + float outlineZ = + texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; + float outlineness = max(outlineX, max(outlineY, outlineZ)); -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif + material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} - vec2 translation = textureCoordinateTranslationAndScale.xy; - vec2 scale = textureCoordinateTranslationAndScale.zw; - vec2 textureCoordinates = tileTextureCoordinates * scale + translation; - vec4 value = texture(textureToSample, textureCoordinates); - vec3 color = value.rgb; - float alpha = value.a; +`;var Vne={name:"PrimitiveOutlinePipelineStage"};Vne.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Te.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:ln.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Te.FRAGMENT);let a=UC.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Te.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Te.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(sF),i.addFragmentLines(aF)};var cF=Vne;var zne={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Hne,_count2DPositions:Gne,_countMorphTargetAttributes:Wne,_countMaterialTextures:jne,_countFeatureIdTextures:qne,_countBinaryMetadata:Yne};zne.process=function(e,t,n){let i=e.model,o=i.statistics;Hne(o,t),Gne(o,e.runtimePrimitive),Wne(o,t),jne(o,t.material),qne(o,t.featureIds),Yne(o,i)};function Hne(e,t){let n=l(t.indices)?t.indices.count:en.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Fe.POINTS?e.pointsLength+=n:Fe.isTriangles(i)&&(e.trianglesLength+=uUe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function uUe(e,t){switch(e){case Fe.TRIANGLES:return t/3;case Fe.TRIANGLE_STRIP:case Fe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Gne(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Wne(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function jne(e,t){let n=fUe(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function fUe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function qne(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Ft.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Yne(e,t){let n=t.structuralMetadata;l(n)&&(dUe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function dUe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var lF=zne;var mUe=new L,hUe=new L,Xne={name:"SceneMode2DPipelineStage"};Xne.process=function(e,t,n){let i=en.getAttributeBySemantic(t,Et.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=L.multiplyTransformation(s,a,mUe),u=gUe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let x=bUe(i,c,u,n);f.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,Te.VERTEX),o.addUniform("mat4","u_modelView2D",Te.VERTEX);let p=L.fromTranslation(u.center,new L),g=n.context,h={u_modelView2D:function(){return L.multiplyTransformation(g.uniformState.view,p,hUe)}};e.uniformMap=_t(h,e.uniformMap)};var pUe=new m,_Ue=new m;function gUe(e,t,n){let i=L.multiplyByPoint(t,e.positionMin,pUe),o=eo.computeActualWgs84Position(n,i,i),r=L.multiplyByPoint(t,e.positionMax,_Ue),s=eo.computeActualWgs84Position(n,r,r);return ae.fromCornerPoints(o,s,new ae)}var Kne=new m;function yUe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,Kne),c=m.multiplyComponents(a,r,a),u=m.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function xUe(e,t,n,i){let o;l(e.quantization)?o=yUe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=m.fromArray(o,c,Kne);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=L.multiplyByPoint(t,u,u),d=eo.computeActualWgs84Position(i,f,f),p=m.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function bUe(e,t,n,i){let o=Ye(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=xUe(e,t,r,o),a=ht.createVertexBuffer({context:i.context,typedArray:s,usage:ke.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var uF=Xne;var fF=`void skinningStage(inout ProcessedAttributes attributes) +{ + mat4 skinningMatrix = getSkinningMatrix(); + mat3 skinningMatrixMat3 = mat3(skinningMatrix); -#ifdef APPLY_COLOR_TO_ALPHA - vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); - colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); - alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif + vec4 positionMC = vec4(attributes.positionMC, 1.0); + attributes.positionMC = vec3(skinningMatrix * positionMC); -#if !defined(APPLY_GAMMA) - vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); - color = tempColor.rgb; - alpha = tempColor.a; -#else - color = pow(color, vec3(textureOneOverGamma)); -#endif + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = skinningMatrixMat3 * normalMC; + #endif -#ifdef APPLY_SPLIT - float splitPosition = czm_splitPosition; - // Split to the left - if (split < 0.0 && gl_FragCoord.x > splitPosition) { - alpha = 0.0; + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = skinningMatrixMat3 * tangentMC; + #endif +}`;var N0={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};N0.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Te.VERTEX),TUe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,Te.VERTEX),n.addVertexLines(fF);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=_t(r,e.uniformMap)};function CUe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===Et.JOINTS||r.semantic===Et.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function TUe(e,t){e.addFunction(N0.FUNCTION_ID_GET_SKINNING_MATRIX,N0.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,Te.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(N0.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,o,r=["x","y","z","w"],s=CUe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(N0.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}let a="return skinnedMatrix;";e.addFunctionLines(N0.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var dF=N0;var h6={};function AUe(e){let t=Ue.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function EUe(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function SUe(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function vUe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function wUe(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function IUe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}h6.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Fe.TRIANGLES)return i?EUe(t,n):AUe(t);if(e===Fe.TRIANGLE_STRIP)return i?vUe(t,n):SUe(t);if(e===Fe.TRIANGLE_FAN)return i?IUe(t,n):wUe(t)};h6.getWireframeIndicesCount=function(e,t){return e===Fe.TRIANGLES?t*2:e===Fe.TRIANGLE_STRIP||e===Fe.TRIANGLE_FAN?2+(t-2)*4:t};var Sv=h6;var Jne={name:"WireframePipelineStage"};Jne.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,Te.FRAGMENT);let o=e.model,r=DUe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r;let s=!1;o.statistics.addBuffer(r,s);let a=e.primitiveType,c=e.count;e.primitiveType=Fe.LINES,e.count=Sv.getWireframeIndicesCount(a,c)};function DUe(e,t,n){let o=en.getAttributeBySemantic(e,Et.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(s=f.sizeInBytes===d?new Uint8Array(d):Ue.createTypedArray(o,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=Sv.createWireframeIndices(a,o,s),u=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return ht.createIndexBuffer({context:n.context,typedArray:c,usage:ke.STATIC_DRAW,indexDatatype:u})}var mF=Jne;function Zne(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Zne.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader;if(l(o._marsOptions)&&l(o._marsOptions.customShaders)){let R=r_.getCache(o._marsOptions.customShaders);for(let N in R)if(Object.prototype.hasOwnProperty.call(R,N)){r=R[N];break}}let s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=l(n.morphTargets)&&n.morphTargets.length>0,d=l(i.skin),p=l(r),h=!(p&&l(r.fragmentShaderText))||r.mode!==og.REPLACE_MATERIAL,x=en.hasQuantizedAttributes(n.attributes),b=o.debugWireframe&&Fe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,T=l(C)&&C.attenuation,A=l(C)&&C.backFaceCulling,S=n.primitiveType===Fe.POINTS&&(l(s)||T||A),v=o._enableShowOutline&&l(n.outlineCoordinates),I=PUe(o,i,n),O=l(o.classificationType);u&&t.push(uF),t.push(JN),b&&t.push(mF),O&&t.push(FN),f&&t.push(nF),d&&t.push(dF),S&&t.push(rF),x&&t.push(YN),h&&t.push(eF),t.push(R0),t.push(Zf),I.hasPropertyTable&&(t.push(L0),t.push(NN),t.push(UN)),p&&t.push(qN),t.push($N),o.allowPicking&&t.push(iF),v&&t.push(cF),t.push(LN),t.push(lF)};function PUe(e,t,n){let i;return l(t.instances)&&(i=en.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=en.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var hF=Zne;function p6(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],OUe(this)}Object.defineProperties(p6.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function OUe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let d=n[c],p=$ne(f,d,new L);a.push(p)}}function $ne(e,t,n){let i=L.multiplyTransformation(e.transformToRoot,e.transform,n);return n=L.multiplyTransformation(i,t,n),n}p6.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=$ne(i,o,e[n])}};var pF=p6;function RUe(){this.pass=void 0,this.alphaCutoff=void 0}var _F=RUe;function _6(e){this.name=e,this.fields=[]}_6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};_6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var gF=_6;function g6(e){this.signature=e,this.body=[]}g6.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};g6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var yF=g6;function Cc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Cc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Cc.prototype.addDefine=function(e,t,n){n=y(n,Te.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),Te.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),Te.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Cc.prototype.addStruct=function(e,t,n){this._structs[e]=new gF(t),Te.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),Te.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Cc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Cc.prototype.addFunction=function(e,t,n){this._functions[e]=new yF(t),Te.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),Te.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Cc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Cc.prototype.addUniform=function(e,t,n){n=y(n,Te.BOTH);let i=`uniform ${e} ${t};`;Te.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),Te.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Cc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Cc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=LUe(e),i};Cc.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};Cc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Cc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Cc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=MUe(this),i=NUe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +`),r=new We({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` +`),a=new We({defines:this._fragmentShaderParts.defineLines,sources:[s]});return $t.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Cc.prototype.clone=function(){return Ye(this,!0)};function MUe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function LUe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function NUe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var eT=Cc;function FUe(e){this.shaderBuilder=new eT,this.model=e,this.uniformMap={},this.alphaOptions=new _F,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var xF=FUe;var bF=`void silhouetteStage(inout vec4 color) { + if(model_silhouettePass) { + color = czm_gammaCorrect(model_silhouetteColor); } - // Split to the right - else if (split > 0.0 && gl_FragCoord.x < splitPosition) { - alpha = 0.0; +}`;var CF=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { + #ifdef HAS_NORMALS + if(model_silhouettePass) { + vec3 normal = normalize(czm_normal3D * attributes.normalMC); + normal.x *= czm_projection[0][0]; + normal.y *= czm_projection[1][1]; + positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; } + #endif +} +`;var TF={name:"ModelSilhouettePipelineStage"};TF.silhouettesLength=0;TF.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++TF.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,Te.BOTH),i.addVertexLines(CF),i.addFragmentLines(bF),i.addUniform("vec4","model_silhouetteColor",Te.FRAGMENT),i.addUniform("float","model_silhouetteSize",Te.VERTEX),i.addUniform("bool","model_silhouettePass",Te.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=_t(o,e.uniformMap),e.hasSilhouette=!0};var AF=TF;var EF=`void modelSplitterStage() +{ + // Don't split when rendering the shadow map, because it is rendered from + // the perspective of a totally different camera. +#ifndef SHADOW_MAP + if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif +} +`;var SF={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};SF.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Te.FRAGMENT),i.addFragmentLines(EF);let o={};i.addUniform("float",SF.SPLIT_DIRECTION_UNIFORM_NAME,Te.FRAGMENT),o[SF.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=_t(o,e.uniformMap)};var vF=SF;function BUe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var wF=BUe;function kUe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,cp.UNLIT)}var IF=kUe;function UUe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:en.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=en.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new IF,this.pickId=void 0}var DF=UUe;function jl(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=L.clone(L.IDENTITY),this._computedModelMatrix2D=L.clone(L.IDENTITY),this._axisCorrectionMatrix=en.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new L),this._runtimeArticulations={},VUe(this)}Object.defineProperties(jl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function VUe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Qne(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let A=r[T],S=new CN({articulation:A,sceneGraph:e}),v=S.name;a[v]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=L.IDENTITY;for(let T=0;T<d;T++){let A=n.nodes[T],S=eie(e,A,p);e._rootNodes.push(S)}let g=t.skins,h=e._runtimeSkins,x=g.length;for(let T=0;T<x;T++){let A=g[T];h.push(new pF({skin:A,sceneGraph:e}))}let b=e._skinnedNodes,C=b.length;for(let T=0;T<C;T++){let A=b[T],S=e._runtimeNodes[A],I=c[A].skin.index;S._runtimeSkin=h[I],S.updateJointMatrices()}e.applyArticulations()}function Qne(e,t){let n=e._components,i=e._model;e._computedModelMatrix=L.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=L.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=L.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var zUe=new m;function HUe(e,t){let n=e._computedModelMatrix,i=L.getTranslation(n,zUe);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Mt.wgs84To2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=L.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function eie(e,t,n){let i=[],o=en.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=L.multiplyTransformation(n,o,new L),g=eie(e,d,p);i.push(g)}let s=new MN({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new hF({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new SN(f,s);f._nodesByName[u]=d}return c}var GUe=new m,WUe=new m,jUe=new m,qUe=new m;jl.prototype.buildDrawCommands=function(e){let t=this._model,n=new xF(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,GUe),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,WUe);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new wF(n,u);for(r=0;r<f.length;r++)f[r].process(d,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let h=g.pipelineStages,x=new DF(d,g);for(s=0;s<h.length;s++)h[s].process(x,g.primitive,e);g.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=L.multiplyByPoint(p,x.positionMin,jUe),C=L.multiplyByPoint(p,x.positionMax,qUe);m.minimumByComponent(a,b,a),m.maximumByComponent(c,C,c);let T=pN(x,e);g.drawCommand=T}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};jl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;l(n.color)&&t.push(O0),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(yN),n.isClippingEnabled()&&t.push(EN),n.hasSilhouette(e)&&t.push(AF),l(n.splitDirection)&&n.splitDirection!==ol.NONE&&t.push(vF),Go.is3DTiles(n.type)&&t.push(_N))};jl.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};jl.prototype.updateModelMatrix=function(e,t){Qne(this,e),t.mode!==ne.SCENE3D&&HUe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};jl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function tie(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);tie(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function PF(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];tie(e,c,t,n,i)}}var YUe={backFaceCulling:void 0};jl.prototype.updateBackFaceCulling=function(e){let t=YUe;t.backFaceCulling=e,PF(this,!1,XUe,t)};function XUe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var KUe={shadowMode:void 0};jl.prototype.updateShadows=function(e){let t=KUe;t.shadowMode=e,PF(this,!1,JUe,t)};function JUe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var ZUe={debugShowBoundingVolume:void 0};jl.prototype.updateShowBoundingVolume=function(e){let t=ZUe;t.debugShowBoundingVolume=e,PF(this,!1,$Ue,t)};function $Ue(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var nie=[],QUe={frameState:void 0,hasSilhouette:void 0};jl.prototype.pushDrawCommands=function(e){let t=nie;t.length=0;let n=QUe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,PF(this,!0,eVe,n),e.commandList.push.apply(e.commandList,t)};function eVe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=nie,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}jl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};jl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var OF=jl;function tT(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new At}Object.defineProperties(tT.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});tT.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};tT.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};tT.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};tT.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var RF=tT;var sie=ur(Q1(),1);var iie={},F0=Uint32Array.BYTES_PER_ELEMENT;iie.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=F0;let o=i.getUint32(t,!0);if(o!==1)throw new de(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=F0,t+=F0;let r=i.getUint32(t,!0);if(r===0)throw new de("Feature table must have a byte length greater than zero");t+=F0;let s=i.getUint32(t,!0);t+=F0;let a=i.getUint32(t,!0);t+=F0;let c=i.getUint32(t,!0);t+=F0;let u=Mo(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Mo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new Em(u,f),h=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=h,!l(h))throw new de("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=m.unpack(x));let b=tVe(g,d);if(b.rtcCenter=x,b.pointsLength=h,!b.hasPositions){let C=nVe(g);b.positions=C,b.hasPositions=b.hasPositions||l(C)}if(!b.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let C=oVe(g);b.normals=C,b.hasNormals=b.hasNormals||l(C)}if(!b.hasColors){let C=iVe(g);b.colors=C,b.hasColors=b.hasColors||l(C),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(C)&&C.isTranslucent}if(!b.hasBatchIds){let C=rVe(g);b.batchIds=C,b.hasBatchIds=b.hasBatchIds||l(C)}if(b.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=C}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function tVe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let h=s.byteOffset,x=s.byteLength;if(!l(o)||!l(h)||!l(x))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:_t(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function nVe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:ln.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65536-1,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:ln.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:ln.VEC3}}}function iVe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:ln.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=z.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:ln.VEC4,isQuantized:!1,isTranslucent:s}}}function oVe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:ln.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2);let i=8;return{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:ln.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:ln.VEC3}}}function rVe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:Et.FEATURE_ID,semantic:Et.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:ln.SCALAR}}}var nT=iie;var sVe=Ft.Components,aVe=Ft.Scene,cVe=Ft.Node,lVe=Ft.Primitive,uVe=Ft.Attribute,oie=Ft.Quantization,fVe=Ft.FeatureIdAttribute,dVe=Ft.Material,mVe=Ft.MetallicRoughness;function sg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=It.UNLOADED,this._buffers=[],this._components=void 0,this._transform=L.IDENTITY}l(Object.create)&&(sg.prototype=Object.create(ro.prototype),sg.prototype.constructor=sg);Object.defineProperties(sg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});sg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=nT.parse(this._arrayBuffer,this._byteOffset),this._state=It.PROCESSING,this._promise=Promise.resolve(this)};sg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===It.READY)return!0;if(this._state===It.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=hVe(this,e.context)}return!1};function hVe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=H_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&pVe(e,i,r),vVe(e,t),e._state=It.READY,e}).catch(function(r){e.unload(),e._state=It.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function pVe(e,t,n){e._state=It.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Et.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:ln.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=m.fromElements(c,c,c),f=m.unpack(a.minValues),d=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,o.quantizedType=ln.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:Et.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:ln.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=X.UNSIGNED_BYTE,o.quantizedType=ln.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:ln.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Et.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:ln.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:_Ve(u.componentsPerAttribute),componentType:gVe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function _Ve(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function gVe(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function vv(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new oie,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new oie;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new uVe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Yn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=z.pack(t.constantColor,a)}else{let a=ht.createVertexBuffer({typedArray:i,context:n,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===Et.POSITION&&s&&(r.typedArray=i),r}var rie,MF;function yVe(e){if(!l(MF)){rie=new sie.default(0),MF=new Array(e);for(let t=0;t<e;++t)MF[t]=rie.random()}return MF}var xVe=new m,bVe=new m,CVe=new m;function TVe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=yVe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,xVe),u=m.fromElements(a,a,a,bVe),f,d,p;if(e.isQuantized)c=m.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=m.unpack(t,d*3,CVe),m.minimumByComponent(c,p,c),m.maximumByComponent(u,p,u);e.min=m.clone(c),e.max=m.clone(u)}var AVe={name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:ln.VEC4,isQuantized:!1,isTranslucent:!1};function EVe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(TVe(r),o=vv(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=vv(e,t.normals,n),i.push(o)),l(t.colors)?(o=vv(e,t.colors,n),i.push(o)):(o=vv(e,AVe,n),i.push(o)),l(t.batchIds)&&(o=vv(e,t.batchIds,n),i.push(o)),i}function SVe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return Q_({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new Ha({schema:{},propertyTables:[]})}function vVe(e,t){let n=e._parsedContent,i=new mVe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new dVe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=$h.BLEND);let s=!l(n.normals);o.unlit=s;let a=new lVe;if(a.attributes=EVe(e,n,t),a.primitiveType=Fe.POINTS,a.material=o,l(n.batchIds)){let g=new fVe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new cVe;c.index=0,c.primitives=[a];let u=new aVe;u.nodes=[c],u.upAxis=_o.Z,u.forwardAxis=_o.X;let f=new sVe;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=SVe(n,d),d.length>0&&wVe(e,a,d,t),l(n.rtcCenter)&&(f.transform=L.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=L.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function wVe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=ht.createVertexBuffer({typedArray:a.typedArray,context:i,usage:ke.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}sg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var wv=sg;function uo(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,Go.GLTF),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=L.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=Z.clone(Z.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new aN(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,xc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ae.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,qe.NONE),this._heightDirty=this._heightReference!==qe.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new tp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?bs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=L.clone(L.IDENTITY),this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new TC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,Cn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Go.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new wt(a)),this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,ol.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new RF,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._texturesLoadedPromise=void 0,this._completeLoad=void 0,this._rejectLoad=void 0,this._completeTexturesLoad=void 0,this._rejectTexturesLoad=void 0,l(this._loader._promise)?(this._readyPromise=Promise.resolve(this),this._texturesLoadedPromise=Promise.resolve(this)):(this._readyPromise=new Promise((c,u)=>{this._completeLoad=()=>(c(this),!1),this._rejectLoad=f=>(u(f),!1)}),this._loader instanceof wv?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((c,u)=>{this._completeTexturesLoad=()=>(c(this),!1),this._rejectTexturesLoad=f=>(u(f),!1)}),this._loader.load().catch(c=>{this.isDestroyed()||!l(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad(en.getError("model",this._resource,c)))})),this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=y(e.marsOptions,{})}function LF(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function IVe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new lN({model:e,propertyTable:s});n.push(a)}return n}function DVe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=en.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=en.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function x6(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(uo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},readyPromise:{get:function(){return Q("Model.readyPromise","Model.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.readyEvent instead."),this._readyPromise}},texturesLoadedPromise:{get:function(){return Q("Model.texturesLoadedPromise","Model.texturesLoadedPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.texturesReadyEvent instead."),this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){x6(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=x6(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return lie(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Go.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(bs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});uo.prototype.getNode=function(e){return this._nodesByName[e]};uo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};uo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};uo.prototype.makeStyleDirty=function(){this._styleDirty=!0};uo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var PVe=new L,OVe=new Z,RVe=new L;uo.prototype.update=function(e){let t=!1;try{t=MVe(this,e)}catch(n){if(this._loader.incrementallyLoadTextures)if(n.name==="TextureError")LF(this,n),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(n);else{let i=en.getError("model",this._resource,n);LF(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i)}else{let i=en.getError("model",this._resource,n);LF(this,i),this._rejectLoad=this._rejectLoad&&this._rejectLoad(i),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(i)}}if(NVe(this,e),LVe(this,e),FVe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=en.getError("model",this._resource,new de("Failed to load model."));LF(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&IVe(this,i);let o=new OF({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(BVe(this),kVe(this),UVe(this,e),VVe(this),zVe(this,e),HVe(this,e),GVe(this,e),WVe(this,e),this._defaultTexture=e.context.defaultTexture,jVe(this,e),qVe(this,e),YVe(this),XVe(this,e),ZVe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),JVe(this),$Ve(this,e),QVe(this),eze(this,e)}};function MVe(e,t){return!e._resourcesLoaded||!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function LVe(e,t){l(e._customShader)&&e._customShader.update(t)}function NVe(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=r_.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function FVe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function BVe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=DVe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function kVe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function UVe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&cie(e)}function cie(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=vm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function VVe(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function zVe(e,t){e._silhouetteDirty&&(uie(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function HVe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function GVe(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function WVe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function jVe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function qVe(e,t){L.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=L.clone(e.modelMatrix,e._modelMatrix))}var wm=new m,NF=new me;function YVe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===qe.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,o=e.modelMatrix;wm.x=o[12],wm.y=o[13],wm.z=o[14];let r=i.cartesianToCartographic(wm);if(!l(r)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=L.clone(o,new L));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(r,aie(e,i,r));let a=n.getHeight(r);if(l(a)){let c=aie(e,i,r);me.clone(r,NF),NF.height=a,i.cartographicToCartesian(NF,wm),c(wm)}e._heightDirty=!1,e._updateModelMatrix=!0}function XVe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;lie(e,n),KVe(e,n,t)}function lie(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function KVe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);L.getTranslation(t,wm),e._sceneMode!==ne.SCENE3D&&eo.computeActualWgs84Position(n,wm,wm);let s=e._boundingSphere.radius,a=tze(wm,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function JVe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}function ZVe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=e._imageBasedLighting;if(r.useSphericalHarmonicCoefficients||r.useSpecularEnvironmentMaps){let s=OVe,a=PVe;a=L.multiply(o.uniformState.view3D,i,a),s=L.getMatrix3(a,s),s=Z.getRotation(s,s),e._iblReferenceFrameMatrix=Z.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=RVe;s=L.multiply(o.uniformState.view3D,i,s),s=L.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=L.inverseTranspose(s,e._clippingPlanesMatrix)}}function $Ve(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function QVe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;let t=e._showCreditsOnScreen;l(e._credit)&&(e._credit.showOnScreen=t||e._credit._isDefaultToken);let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++)n[s].showOnScreen=t||n[s]._isDefaultToken;let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++)o[s].showOnScreen=t||o[s]._isDefaultToken}function eze(e,t){let n=ize(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(oze(e,t),e._sceneGraph.pushDrawCommands(t))}var y6=new ae;function tze(e,t,n){return y6.center=e,y6.radius=t,n.camera.getPixelSize(y6,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function aie(e,t,n){return function(i){if(e.heightReference===qe.RELATIVE_TO_GROUND){let r=t.cartesianToCartographic(i,NF);r.height+=n.height,t.cartographicToCartesian(r,i)}let o=e._clampedModelMatrix;L.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightDirty=!0}}var nze=new m;function ize(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=L.getTranslation(e.modelMatrix,nze);eo.computeActualWgs84Position(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function oze(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCreditToNextFrame(i);let o=e._resourceCredits,r=o.length;for(let c=0;c<r;c++)n.addCreditToNextFrame(o[c]);let s=e._gltfCredits,a=s.length;for(let c=0;c<a;c++)n.addCreditToNextFrame(s[c])}uo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};uo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function uie(e){return e.context.stencilBuffer}uo.prototype.hasSilhouette=function(e){return uie(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};uo.prototype.hasSkipLevelOfDetail=function(e){if(!Go.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};uo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let o=0;o<i;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};uo.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};uo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};uo.fromGltf=function(e){Q("Model.fromGltf","Model.fromGltf was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=ve.createIfNeeded(t);let r=new ep(n),a=l(e.content)?Go.TILE_GLTF:Go.GLTF,c=iT(r,a,e);return c.resource=n.gltfResource,new uo(c)};uo.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=ve.createIfNeeded(t);let r=new ep(n),a=l(e.content)?Go.TILE_GLTF:Go.GLTF,c=n.gltfResource,u=iT(r,a,e);u.resource=c;try{await r.load()}catch(g){throw r.destroy(),en.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new uo(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let h=0;h<g;h++)d._resourceCredits.push(p[h])}return d};uo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new YL(t);try{await n.load();let i=iT(n,Go.TILE_B3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new wv(t);try{await n.load();let i=iT(n,Go.TILE_PNTS,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new eN(t);try{await n.load();let i=iT(n,Go.TILE_I3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new KL(t),i=iT(n,Go.TILE_GEOJSON,e);return new uo(i)};uo.prototype.applyColorAndShow=function(e){let t=this._color,n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,x6(t,this._color)&&this.resetDrawCommands()};uo.prototype.applyStyle=function(e){let t=this.type===Go.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),cie(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function iT(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var Im=uo;function Ts(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Ts.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ts.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Ts.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Ts.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Ts.prototype.applyStyle=function(e){this._model.style=e};Ts.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Wl.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Ts.prototype.isDestroyed=function(){return!1};Ts.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Ts.fromGltf=async function(e,t,n,i){let o=new Ts(e,t,n),s=Iv(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Im.fromGltfAsync(s);return o._model=c,o._readyPromise=new Promise(u=>{o._resolveContent=u}),o};Ts.fromB3dm=async function(e,t,n,i,o){let r=new Ts(e,t,n),a=Iv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Im.fromB3dm(a);return r._model=u,r._readyPromise=new Promise(f=>{r._resolveContent=f}),r};Ts.fromI3dm=async function(e,t,n,i,o){let r=new Ts(e,t,n),a=Iv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Im.fromI3dm(a);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};Ts.fromPnts=async function(e,t,n,i,o){let r=new Ts(e,t,n),a=Iv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Im.fromPnts(a);return r._model=c,r._readyPromise=new Promise(u=>{r._resolveContent=u}),r};Ts.fromGeoJson=async function(e,t,n,i){let o=new Ts(e,t,n),s=Iv(e,t,o,{geoJson:i,resource:n}),a=await Im.fromGeoJson(s);return o._model=a,o._readyPromise=new Promise(c=>{o._resolveContent=c}),o};function Iv(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ae.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return _t(i,o)}var lp=Ts;function $f(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties($f.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});$f.fromJson=function(e,t,n,i){let o=new $f(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};$f.prototype.hasProperty=function(e,t){return!1};$f.prototype.getFeature=function(e){};$f.prototype.applyDebugSettings=function(e,t){};$f.prototype.applyStyle=function(e){};$f.prototype.update=function(e,t){};$f.prototype.isDestroyed=function(){return!1};$f.prototype.destroy=function(){return ue(this)};var FF=$f;function As(e,t,n,i){let o=As._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=As._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:As._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}As._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,X.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,ke.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};As._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};As._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};As.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];As._resize(o,this._size),As._appendWriters(this.writers,o)}b6(this)};As._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var rze=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];As._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=rze[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};As.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=sze(this,i)||t;if(t||!l(this.va)){b6(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*a);As._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new ai({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function sze(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=ht.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}As._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};As.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)aze(n[i],e,t)};function aze(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}As.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function b6(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}As.prototype.isDestroyed=function(){return!1};As.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return b6(this),ue(this)};var ag=As;var BF=`uniform sampler2D u_atlas; -#ifdef APPLY_BRIGHTNESS - color = mix(vec3(0.0), color, textureBrightness); +#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -#ifdef APPLY_CONTRAST - color = mix(vec3(0.5), color, textureContrast); -#endif +in vec2 v_textureCoordinates; +in vec4 v_pickColor; +in vec4 v_color; -#ifdef APPLY_HUE - color = czm_hue(color, textureHue); +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; #endif -#ifdef APPLY_SATURATION - color = czm_saturation(color, textureSaturation); -#endif +#ifdef FRAGMENT_DEPTH_CHECK +in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates +in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs) +in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +in mat2 v_rotationMatrix; -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C -#ifdef APPLY_INVERT_COLOR_MARS3D - if(textureInvertColor) { - color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); - } -#endif +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT1 = 2.0; -#ifdef APPLY_FILTER_COLOR_MARS3D - if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { - color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; - float sourceAlpha = alpha * textureAlpha; - float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); - outAlpha += sign(outAlpha) - 1.0; +float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) +{ + vec2 lookupVector = imageSize * (depthLookupST - adjustedST); + lookupVector = v_rotationMatrix * lookupVector; + vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal - vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; + vec2 translation = v_originTextureCoordinateAndTranslate.zw; - // When rendering imagery for a tile in multiple passes, - // some GPU/WebGL implementation combinations will not blend fragments in - // additional passes correctly if their computation includes an unmasked - // divide-by-zero operation, - // even if it's not in the output or if the output has alpha zero. - // - // For example, without sanitization for outAlpha, - // this renders without artifacts: - // if (outAlpha == 0.0) { outColor = vec3(0.0); } - // - // but using czm_branchFreeTernary will cause portions of the tile that are - // alpha-zero in the additional pass to render as black instead of blending - // with the previous pass: - // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); - // - // So instead, sanitize against divide-by-zero, - // store this state on the sign of outAlpha, and correct on return. + if (applyTranslate) + { + // this is only needed for labels where the horizontal origin is not LEFT + // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT + translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); + } + + vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + + if (logDepthOrDepth == 0.0) + { + return 0.0; // not on the globe + } - return vec4(outColor, max(outAlpha, 0.0)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + return eyeCoordinate.z / eyeCoordinate.w; } - -vec3 colorCorrect(vec3 rgb) { -#ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - rgb = czm_HSBToRGB(hsb); #endif - return rgb; -} -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); -const float fExposure = 2.0; +#ifdef SDF -vec3 computeEllipsoidPosition() +// Get the distance from the edge of a glyph at a given position sampling an SDF texture. +float getDistance(vec2 position) { - float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); - vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); - xy *= czm_viewport.zw * mpp * 0.5; - - vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); - czm_ray ray = czm_ray(vec3(0.0), direction); - - vec3 ellipsoid_center = czm_view[3].xyz; + return texture(u_atlas, position).r; +} - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); +// Samples the sdf texture at the given position and produces a color based on the fill color and the outline. +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) +{ + float distance = getDistance(position); - vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); - return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; + if (outlineWidth > 0.0) + { + // Don't get the outline edge exceed the SDF_EDGE + float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); + float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); + float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); + return vec4(sdfColor.rgb, sdfColor.a * alpha); + } + else + { + float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); + return vec4(v_color.rgb, v_color.a * alpha); + } } +#endif void main() { -#ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) - { - discard; - } -#endif + vec4 color = texture(u_atlas, v_textureCoordinates); -#ifdef ENABLE_CLIPPING_PLANES - float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif +#ifdef SDF + float outlineWidth = v_outlineWidth; + vec4 outlineColor = v_outlineColor; -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) - vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates - vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes -#endif + // Get the current distance + float distance = getDistance(v_textureCoordinates); -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float smoothing = fwidth(distance); + // Get an offset that is approximately half the distance to the neighbor pixels + // 0.354 is approximately half of 1/sqrt(2) + vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); + + // Sample the center point + vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); + + // Sample the 4 neighbors + vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); + + // Equally weight the center sample and the 4 neighboring samples + color = (center + color1 + color2 + color3 + color4)/5.0; #else - float nightBlend = 0.0; + // If no derivatives available (IE 10?), just do a single sample + float smoothing = 1.0/32.0; + color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); #endif - // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 - // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the - // fragments on the edges of tiles even though the vertex shader is outputting - // coordinates strictly in the 0-1 range. - vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); - -#ifdef SHOW_TILE_BOUNDARIES - if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || - v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) - { - color = vec4(1.0, 0.0, 0.0, 1.0); - } + color = czm_gammaCorrect(color); +#else + color = czm_gammaCorrect(color); + color *= czm_gammaCorrect(v_color); #endif -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) - float cameraDist; - if (czm_sceneMode == czm_sceneMode2D) +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 { - cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; + discard; } - else if (czm_sceneMode == czm_sceneModeColumbusView) +#else +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 { - cameraDist = -czm_view[3].z; + discard; } - else +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 { - cameraDist = length(czm_view[3]); - } - float fadeOutDist = u_lightingFadeDistance.x; - float fadeInDist = u_lightingFadeDistance.y; - if (czm_sceneMode != czm_sceneMode3D) { - vec3 radii = czm_ellipsoidRadii; - float maxRadii = max(radii.x, max(radii.y, radii.z)); - fadeOutDist -= maxRadii; - fadeInDist -= maxRadii; + discard; } - float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else - float fade = 0.0; +#endif #endif -#ifdef SHOW_REFLECTIVE_OCEAN - vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; - vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; - vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; - waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; +#ifdef VECTOR_TILE + color *= u_highlightColor; +#endif + out_FragColor = color; - float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; +#ifdef LOG_DEPTH + czm_writeLogDepth(); +#endif - if (mask > 0.0) - { - mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); +#ifdef FRAGMENT_DEPTH_CHECK + float temp = v_compressed.y; - vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); - vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); + temp = temp * SHIFT_RIGHT1; - vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); + float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; + bool enableDepthTest = temp2 != 0.0; + bool applyTranslate = floor(temp) != 0.0; - color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); - } -#endif + if (enableDepthTest) { + temp = v_compressed.z; + temp = temp * SHIFT_RIGHT12; -#ifdef APPLY_MATERIAL - czm_materialInput materialInput; - materialInput.st = v_textureCoordinates.st; - materialInput.normalEC = normalize(v_normalEC); - materialInput.positionToEyeEC = -v_positionEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); - materialInput.slope = v_slope; - materialInput.height = v_height; - materialInput.aspect = v_aspect; - czm_material material = czm_getMaterial(materialInput); - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 - //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); - vec4 materialColor = vec4(material.diffuse, material.alpha); - if(u_mars_flood_emabled) { - if(u_mars_flood_globe) { - vec4 materialColor = vec4(material.diffuse, material.alpha); - color = alphaBlend(materialColor, color); - } else { - vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); - vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; - vec4 ymColor = texture(u_mars_flood_area, newuv); - if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { - color.xyz = mix(color.xyz, material.diffuse, material.alpha); - } else { - if(!u_mars_flood_showElse) { + temp = v_compressed.w; + temp = temp * SHIFT_RIGHT12; + + vec2 imageSize; + imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; + imageSize.x = floor(temp); + + vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; + adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); + + float epsilonEyeDepth = v_compressed.x + czm_epsilon1; + float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); + + // negative values go into the screen + if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) + { + float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner + if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) + { + float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner + if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) + { discard; } } } } - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 #endif -#ifdef ENABLE_VERTEX_LIGHTING - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); - diffuseIntensity = mix(1.0, diffuseIntensity, fade); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else - vec4 finalColor = color; +} +`;var kF=`#ifdef INSTANCED +in vec2 direction; #endif - -#ifdef ENABLE_CLIPPING_PLANES - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; - - if (clipDistance < clippingPlanesEdgeWidth) - { - finalColor = clippingPlanesEdgeColor; - } +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) +in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width +in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free +in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale +in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions +in vec2 sdf; // sdf outline color (rgb) and width (w) +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates #endif - -#ifdef HIGHLIGHT_FILL_TILE - finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +#ifdef VECTOR_TILE +in float a_batchId; #endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; +out vec2 v_textureCoordinates; +#ifdef FRAGMENT_DEPTH_CHECK +out vec4 v_textureCoordinateBounds; +out vec4 v_originTextureCoordinateAndTranslate; +out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize +out mat2 v_rotationMatrix; #endif -#if defined(GROUND_ATMOSPHERE) || defined(FOG) - if (!czm_backFacing()) - { - bool dynamicLighting = false; - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif +out vec4 v_pickColor; +out vec4 v_color; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif - vec3 rayleighColor; - vec3 mieColor; - float opacity; +const float UPPER_BOUND = 32768.0; - vec3 positionWC; - vec3 lightDirection; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; - // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. - // Otherwise, the scattering is computed in the vertex shader. - #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE - positionWC = computeEllipsoidPosition(); - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - computeAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - #else - positionWC = v_positionMC; - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - #endif +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; - rayleighColor = colorCorrect(rayleighColor); - mieColor = colorCorrect(mieColor); +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +{ + // Note the halfSize cannot be computed in JavaScript because it is sent via + // compressed vertex attributes that coerce it to an integer. + vec2 halfSize = imageSize * scale * 0.5; + halfSize *= ((direction * 2.0) - 1.0); - vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + vec2 originTranslate = origin * abs(halfSize); - // Fog is applied to tiles selected for fog, close to the Earth. - #ifdef FOG - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is lighting, apply that to the fog. - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); - fogColor *= darken; - #endif +#if defined(ROTATION) || defined(ALIGNED_AXIS) + if (validAlignedAxis || rotation != 0.0) + { + float angle = rotation; + if (validAlignedAxis) + { + vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); + angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / + (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); + } - #ifndef HDR - fogColor.rgb = czm_acesTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - const float modifier = 0.15; - finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); + float cosTheta = cos(angle); + float sinTheta = sin(angle); + rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); + halfSize = rotationMatrix * halfSize; + } + else + { + rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); + } +#endif - #else - // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. - // This value is larger near the "circumference", as it is further away from the camera. We use it to - // brighten up that area of the ground atmosphere. - const float transmittanceModifier = 0.5; - float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); + mpp = czm_metersPerPixel(positionEC); + positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); + positionEC.xy += (translate + pixelOffset) * mpp; - vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; + return positionEC; +} - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float fadeInDist = u_nightFadeDistance.x; - float fadeOutDist = u_nightFadeDistance.y; - - float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); - float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); - vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); +#ifdef VERTEX_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) +{ + vec4 posWC = czm_eyeToWindowCoordinates(positionEC); - finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); - #endif - - #ifndef HDR - finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); - #else - finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); - #endif - - finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); - #endif - } -#endif + float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); -#ifdef UNDERGROUND_COLOR - if (czm_backFacing()) + if (globeDepth == 0.0) { - float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); - float distance = max(v_distance - distanceFromEllipsoid, 0.0); - float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); - vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); - finalColor = alphaBlend(undergroundColor, finalColor); + return 0.0; // not on the globe } -#endif -#ifdef TRANSLUCENT - if (inTranslucencyRectangle()) - { - vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; - finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); - } + vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); + return eyeCoordinate.z / eyeCoordinate.w; +} #endif +void main() +{ + // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 -#ifdef APPLY_MARS3D_CLIP - if(u_mars_clip_enabled) { - vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); - vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; - vec4 tColor = texture(u_mars_clip_area, tuv); - if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { - if(u_mars_clip_only) { - discard; - } - } else { - if(!u_mars_clip_only) { - discard; - } - } - } -#endif -//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + // unpack attributes + vec3 positionHigh = positionHighAndScale.xyz; + vec3 positionLow = positionLowAndRotation.xyz; + float scale = positionHighAndScale.w; -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 -#ifdef APPLY_MARS3D_UPLIFT - if(u_mars_uplift_enabled) { - bool isInSlopeRampRectangle = inSlopeRampRectangle(); - if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { - discard; - } - } +#if defined(ROTATION) || defined(ALIGNED_AXIS) + float rotation = positionLowAndRotation.w; +#else + float rotation = 0.0; #endif - out_FragColor = finalColor; -} + float compressed = compressedAttribute0.x; + vec2 pixelOffset; + pixelOffset.x = floor(compressed * SHIFT_RIGHT7); + compressed -= pixelOffset.x * SHIFT_LEFT7; + pixelOffset.x -= UPPER_BOUND; -#ifdef SHOW_REFLECTIVE_OCEAN + vec2 origin; + origin.x = floor(compressed * SHIFT_RIGHT5); + compressed -= origin.x * SHIFT_LEFT5; -float waveFade(float edge0, float edge1, float x) -{ - float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return pow(1.0 - y, 5.0); -} + origin.y = floor(compressed * SHIFT_RIGHT3); + compressed -= origin.y * SHIFT_LEFT3; -float linearFade(float edge0, float edge1, float x) -{ - return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} +#ifdef FRAGMENT_DEPTH_CHECK + vec2 depthOrigin = origin.xy; +#endif + origin -= vec2(1.0); -// Based on water rendering by Jonas Wagner: -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + float show = floor(compressed * SHIFT_RIGHT2); + compressed -= show * SHIFT_LEFT2; -// low altitude wave settings -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; +#ifdef INSTANCED + vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); + vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); + vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +#else + vec2 direction; + direction.x = floor(compressed * SHIFT_RIGHT1); + direction.y = compressed - direction.x * SHIFT_LEFT1; -// high altitude wave settings -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); +#endif -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ - vec3 positionToEyeEC = -positionEyeCoordinates; - float positionToEyeECLength = length(positionToEyeEC); + float temp = compressedAttribute0.y * SHIFT_RIGHT8; + pixelOffset.y = -(floor(temp) - UPPER_BOUND); - // The double normalize below works around a bug in Firefox on Android devices. - vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); + vec2 translate; + translate.y = (temp - floor(temp)) * SHIFT_LEFT16; - // Fade out the waves as the camera moves far from the surface. - float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); + temp = compressedAttribute0.z * SHIFT_RIGHT8; + translate.x = floor(temp) - UPPER_BOUND; -#ifdef SHOW_OCEAN_WAVES - // high altitude waves - float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; - vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); - vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); + translate.y += (temp - floor(temp)) * SHIFT_LEFT8; + translate.y -= UPPER_BOUND; - // low altitude waves - time = czm_frameNumber * oceanAnimationSpeedLowAltitude; - noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); - vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); + temp = compressedAttribute1.x * SHIFT_RIGHT8; + float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); - // blend the 2 wave layers based on distance to surface - float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); - float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); - vec3 normalTangentSpace = - (highAltitudeFade * normalTangentSpaceHighAltitude) + - (lowAltitudeFade * normalTangentSpaceLowAltitude); - normalTangentSpace = normalize(normalTangentSpace); + vec2 imageSize = vec2(floor(temp), temp2); - // fade out the normal perturbation as we move farther from the water surface - normalTangentSpace.xy *= waveIntensity; - normalTangentSpace = normalize(normalTangentSpace); -#else - vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif +#ifdef FRAGMENT_DEPTH_CHECK + float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); + float applyTranslate = 0.0; + if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false + { + applyTranslate = 1.0; + labelHorizontalOrigin -= 2.0; + depthOrigin.x = labelHorizontalOrigin + 1.0; + } - vec3 normalEC = enuToEye * normalTangentSpace; + depthOrigin = vec2(1.0) - (depthOrigin * 0.5); +#endif - const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; - // Use diffuse light to highlight the waves - float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; - vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#ifdef SHOW_OCEAN_WAVES - // Where diffuse light is low or non-existent, use wave highlights based solely on - // the wave bumpiness and no particular light direction. - float tsPerturbationRatio = normalTangentSpace.z; - vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else - vec3 nonDiffuseHighlight = vec3(0.0); + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif - // Add specular highlights in 3D, and in all modes when zoomed in. - float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); - float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); - float specular = specularIntensity * surfaceReflectance; - -#ifdef HDR - specular *= 1.4; +#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) + temp = compressedAttribute3.w; + temp = temp * SHIFT_RIGHT12; - float e = 0.2; - float d = 3.3; - float c = 1.7; + vec2 dimensions; + dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; + dimensions.x = floor(temp); +#endif - vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); +#ifdef ALIGNED_AXIS + vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); + temp = compressedAttribute2.z * SHIFT_RIGHT5; + bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; #else - vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; + vec3 alignedAxis = vec3(0.0); + bool validAlignedAxis = false; #endif - return vec4(color, imageryColor.a); -} + vec4 pickColor; + vec4 color; -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var Tk=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; -#else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; -#endif + temp = compressedAttribute2.y; + temp = temp * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; -#endif + temp = compressedAttribute2.x; + temp = temp * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); -#ifdef EXAGGERATION -uniform vec2 u_terrainExaggerationAndRelativeHeight; -#endif + temp = compressedAttribute2.z * SHIFT_RIGHT8; + bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; + temp = floor(temp) * SHIFT_RIGHT8; -uniform vec3 u_center3D; -uniform mat4 u_modifiedModelView; -uniform mat4 u_modifiedModelViewProjection; -uniform vec4 u_tileRectangle; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor /= 255.0; -// Uniforms for 2D Mercator projection -uniform vec2 u_southAndNorthLatitude; -uniform vec2 u_southMercatorYAndOneOverHeight; + color.a = floor(temp); + color /= 255.0; -out vec3 v_positionMC; -out vec3 v_positionEC; + /////////////////////////////////////////////////////////////////////////// -out vec3 v_textureCoordinates; -out vec3 v_normalMC; -out vec3 v_normalEC; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT -uniform bool u_mars_flat_enabled; -uniform int u_mars_flat_AreaWidth; -uniform int u_mars_flat_AreaHeight; -uniform highp float u_mars_inverseTileWidth; -uniform highp vec2 u_mars_cartographicTileRectangle; -uniform highp sampler2D u_mars_flat_AreaTexture; -const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C +#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) + float eyeDepth = positionEC.z; +#endif -vec4 getRegions(int x, int y) { - float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); - float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); - vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); - float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; - float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; - return vec4(newX, newY, point.z, point.w); -} + positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); + positionEC.xyz *= show; -float inRectangle(vec2 textureCoordinates) { - for(int h = 0; h < 100000; h++){ - if(h >= u_mars_flat_AreaWidth) break; + /////////////////////////////////////////////////////////////////////////// - vec4 first = getRegions(0, h); - float currentLength = first.z; - float height = first.w; - float counter = 0.0; - float xinters = 0.0; - for(int w = 0; w < 100000; w++){ - if(float(w) >= currentLength) break; - int nextIndex = w + 1; - nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; - vec4 px = getRegions(w, h); - vec4 py = getRegions(nextIndex, h); - vec2 p1 = px.xy; - vec2 p2 = py.xy; - if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ - if (textureCoordinates.y <= max(p1.y, p2.y)){ - if (p1.x != p2.x){ - xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; - if (p1.y == p2.y || textureCoordinates.y <= xinters) - { - counter += 1.0; - } - } - } - } +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif - } - if((mod(counter, 2.0) != 0.0)) { - return height; - } +#ifdef EYE_DISTANCE_SCALING + float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); + scale *= distanceScale; + translate *= distanceScale; + // push vertex behind near plane for clipping + if (scale == 0.0) + { + positionEC.xyz = vec3(0.0); } +#endif - return invalidValue; -} + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency == 0.0) + { + positionEC.xyz = vec3(0.0); + } #endif -// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MATERIAL -out float v_slope; -out float v_aspect; -out float v_height; +#ifdef EYE_DISTANCE_PIXEL_OFFSET + float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); + pixelOffset *= pixelOffsetScale; +#endif + +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = compressedAttribute3.x; + float farSq = compressedAttribute3.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + positionEC.xyz = vec3(0.0); + } #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; -#endif + mat2 rotationMatrix; + float mpp; -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = compressedAttribute3.z; #endif -// These functions are generated at runtime. -vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); -float get2DYPositionFraction(vec2 textureCoordinates); +#ifdef VERTEX_DEPTH_CHECK +if (lengthSq < disableDepthTestDistance) { + float depthsilon = 10.0; -vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return u_modifiedModelViewProjection * vec4(position, 1.0); -} + vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; + vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth1 = getGlobeDepth(pEC1); -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ - // The width of a tile at level 11, in radians and assuming a single root tile, is - // 2.0 * czm_pi / pow(2.0, 11.0) - // We want to just linearly interpolate the 2D position from the texture coordinates - // when we're at this level or higher. The constant below is the expression - // above evaluated and then rounded up at the 4th significant digit. - const float maxTileWidth = 0.003068; - float positionFraction = textureCoordinates.y; - float southLatitude = u_southAndNorthLatitude.x; - float northLatitude = u_southAndNorthLatitude.y; - if (northLatitude - southLatitude > maxTileWidth) + if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) { - float southMercatorY = u_southMercatorYAndOneOverHeight.x; - float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; + vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth2 = getGlobeDepth(pEC2); - float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); - currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); - positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); + if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) + { + vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + float globeDepth3 = getGlobeDepth(pEC3); + if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) + { + positionEC.xyz = vec3(0.0); + } + } } - return positionFraction; -} - -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ - return textureCoordinates.y; -} - -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) -{ - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - return u_modifiedModelViewProjection * rtcPosition2D; } +#endif -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, 0.0, textureCoordinates); -} + positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); + gl_Position = czm_projection * positionEC; + v_textureCoordinates = textureCoordinates; -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ - return getPositionPlanarEarth(position, height, textureCoordinates); -} +#ifdef LOG_DEPTH + czm_vertexLogDepth(); +#endif -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ - // We do not do RTC while morphing, so there is potential for jitter. - // This is unlikely to be noticeable, though. - vec3 position3DWC = position + u_center3D; - float yPositionFraction = get2DYPositionFraction(textureCoordinates); - vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); - vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); - return czm_modelViewProjection * morphPosition; -} +#ifdef DISABLE_DEPTH_DISTANCE + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; + } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = 1.0; +#endif + } + } #endif -void main() -{ -#ifdef QUANTIZATION_BITS12 - vec2 xy = czm_decompressTextureCoordinates(compressed0.x); - vec2 zh = czm_decompressTextureCoordinates(compressed0.y); - vec3 position = vec3(xy, zh.x); - float height = zh.y; - vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); - - height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; - position = (u_scaleAndBias * vec4(position, 1.0)).xyz; +#ifdef FRAGMENT_DEPTH_CHECK + if (sizeInMeters) { + translate /= mpp; + dimensions /= mpp; + imageSize /= mpp; + } -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = compressed1; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; - float encodedNormal = 0.0; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = compressed0.w; +#if defined(ROTATION) || defined(ALIGNED_AXIS) + v_rotationMatrix = rotationMatrix; #else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; + v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); #endif -#else - // A single float per element - vec3 position = position3DAndHeight.xyz; - float height = position3DAndHeight.w; - vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; + float enableDepthCheck = 0.0; + if (lengthSq < disableDepthTestDistance) + { + enableDepthCheck = 1.0; + } -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = textureCoordAndEncodedNormals.w; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - float webMercatorT = textureCoordinates.y; - float encodedNormal = textureCoordAndEncodedNormals.z; -#elif defined(INCLUDE_WEB_MERCATOR_Y) - float webMercatorT = textureCoordAndEncodedNormals.z; - float encodedNormal = 0.0; -#else - float webMercatorT = textureCoordinates.y; - float encodedNormal = 0.0; -#endif + float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); + float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); -#endif + float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); + float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); - vec3 position3DWC = position + u_center3D; + v_compressed.x = eyeDepth; + v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; + v_compressed.z = dw * SHIFT_LEFT12 + dh; + v_compressed.w = iw * SHIFT_LEFT12 + ih; + v_originTextureCoordinateAndTranslate.xy = depthOrigin; + v_originTextureCoordinateAndTranslate.zw = translate; + v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; -#ifdef GEODETIC_SURFACE_NORMALS - vec3 ellipsoidNormal = geodeticSurfaceNormal; -#else - vec3 ellipsoidNormal = normalize(position3DWC); #endif -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - float exaggeration = u_terrainExaggerationAndRelativeHeight.x; - float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; - float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; +#ifdef SDF + vec4 outlineColor; + float outlineWidth; - // stop from going through center of earth - float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); - newHeight = max(newHeight, -minRadius); + temp = sdf.x; + temp = temp * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); - vec3 offset = ellipsoidNormal * (newHeight - height); - position += offset; - position3DWC += offset; - height = newHeight; -#endif + temp = sdf.y; + temp = temp * SHIFT_RIGHT8; + float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.a = floor(temp); + outlineColor /= 255.0; - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 -#ifdef APPLY_MARS3D_FLAT - if(u_mars_flat_enabled){ - float isInside = inRectangle(textureCoordinates); - if(isInside != invalidValue){ - vec3 offset = (isInside - height) * ellipsoidNormal; - position += offset; - position3DWC += offset; - height = isInside; - // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; - } - } + v_outlineWidth = outlineWidth / 255.0; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency; #endif - // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 - gl_Position = getPosition(position, height, textureCoordinates); + v_pickColor = pickColor; + + v_color = color; + v_color.a *= translucency; + +} +`;function Ci(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Rt.clone(n)),l(i)&&(i=Rt.clone(i)),l(o)&&(o=Rt.clone(o)),l(r)&&(r=Dt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._translate=new H(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Ln.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,_i.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=jn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var fie=Ci.SHOW_INDEX=0,VF=Ci.POSITION_INDEX=1,_ie=Ci.PIXEL_OFFSET_INDEX=2,cze=Ci.EYE_OFFSET_INDEX=3,lze=Ci.HORIZONTAL_ORIGIN_INDEX=4,uze=Ci.VERTICAL_ORIGIN_INDEX=5,fze=Ci.SCALE_INDEX=6,zF=Ci.IMAGE_INDEX_INDEX=7,die=Ci.COLOR_INDEX=8,dze=Ci.ROTATION_INDEX=9,mze=Ci.ALIGNED_AXIS_INDEX=10,hze=Ci.SCALE_BY_DISTANCE_INDEX=11,pze=Ci.TRANSLUCENCY_BY_DISTANCE_INDEX=12,_ze=Ci.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,gze=Ci.DISTANCE_DISPLAY_CONDITION=14,yze=Ci.DISABLE_DEPTH_DISTANCE=15;Ci.TEXTURE_COORDINATE_BOUNDS=16;var mie=Ci.SDF_INDEX=17;Ci.NUMBER_OF_PROPERTIES=18;function No(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ci.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,No(this,fie))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),No(this,VF))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),No(this,VF))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),No(this,_ie))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Rt.equals(t,e)||(this._scaleByDistance=Rt.clone(e,t),No(this,hze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Rt.equals(t,e)||(this._translucencyByDistance=Rt.clone(e,t),No(this,pze))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Rt.equals(t,e)||(this._pixelOffsetScaleByDistance=Rt.clone(e,t),No(this,_ze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),No(this,cze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,No(this,lze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,No(this,uze))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,No(this,fze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),No(this,die))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,No(this,dze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),No(this,mze))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,No(this,zF))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,No(this,zF))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,No(this,die))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),No(this,gze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,No(this,yze))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof ve?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(jn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,No(this,zF))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),No(this,VF)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,No(this,fie))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),No(this,mie))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,No(this,mie))}}});Ci.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ci.prototype._updateClamping=function(){Ci._updateClamping(this._billboardCollection,this)};var Dv=new me,hie=new m;Ci._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,o=i.ellipsoid,r=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===qe.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!l(t._position))return;let c=o.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===qe.RELATIVE_TO_GROUND)if(t._mode===ne.SCENE3D){let p=o.cartesianToCartographic(d,Dv);p.height+=c.height,o.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=m.clone(d,t._clampedPosition)}t._removeCallbackFunc=r.updateHeight(c,u),me.clone(c,Dv);let f=i.getHeight(c);l(f)&&(Dv.height=f),o.cartographicToCartesian(Dv,hie),u(hie)};Ci.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(a){if(r._imageId!==t||r._image!==n||!Ke.equals(r._imageSubRegion,i))return;let c=e.textureCoordinates[a];r._imageWidth=e.texture.width*c.width,r._imageHeight=e.texture.height*c.height,r._imageIndex=a,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,No(r,zF)}l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,l(o)&&o.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),r._imageIndexPromise=void 0})};Ci.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ci.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ci.prototype._setTranslate=function(e){let t=this._translate;H.equals(t,e)||(H.clone(e,t),No(this,_ie))};Ci.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ci.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),No(this,VF)};var pie=new re;Ci._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(L.multiplyByPoint(i,t,pie),eo.computeActualWgs84Position(n,pie))};var gie=new m;Ci._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=L.multiplyByPoint(e,t,gie),a=eo.wgs84WithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return H.add(a,i,a),a};var UF=new H(0,0);Ci.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new H),H.clone(this._pixelOffset,UF),H.add(UF,this._translate,UF);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,Dv);o=a.cartographicToCartesian(c,gie),i=L.IDENTITY}return Ci._computeScreenSpacePosition(i,o,this._eyeOffset,UF,e,t)};Ci.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===_i.RIGHT?s-=i:e.horizontalOrigin===_i.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Ln.BOTTOM||e.verticalOrigin===Ln.BASELINE?a-=o:e.verticalOrigin===Ln.CENTER&&(a-=o*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};Ci.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Rt.equals(this._scaleByDistance,e._scaleByDistance)&&Rt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Rt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Ci.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var go=Ci;var xze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Io=Object.freeze(xze);var bze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},zs=Object.freeze(bze);function up(e,t,n,i,o){this.bottomLeft=y(e,H.ZERO),this.topRight=y(t,H.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var Cze=new H(16,16);function cg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,Cze);this._context=e.context,this._pixelFormat=y(e.pixelFormat,lt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=jn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(cg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Lt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function Tze(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,d=a/u,p=new up(new H(s+r,r),new H(c,a)),g=new up(new H,new H(c,a),e._root,p),h=new up(new H(r,a+r),new H(c,u)),x=new up(new H,new H(c,u),g,h);for(let T=0;T<e._textureCoordinates.length;T++){let A=e._textureCoordinates[T];l(A)&&(A.x*=f,A.y*=d,A.width*=f,A.height*=d)}let b=new Lt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),C=new pa({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Lt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new up(new H(r,r),new H(s,a))}}function HF(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new up(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new up(new H(a,t.bottomLeft.y),new H(t.topRight.x,t.topRight.y)))}else{t.childNode1=new up(new H(t.bottomLeft.x,t.bottomLeft.y),new H(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new up(new H(t.bottomLeft.x,a),new H(t.topRight.x,t.topRight.y)))}return HF(e,t.childNode1,n)}return HF(e,t.childNode1,n)||HF(e,t.childNode2,n)}}function yie(e,t,n){let i=HF(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,u=i.bottomLeft.y/r,f=s/o,d=a/r;e._textureCoordinates[n]=new Ke(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else Tze(e,t),yie(e,t,n);e._guid=jn()}function xie(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return yie(e,t,n),n}cg.prototype.getImageIndex=function(e){return this._indexHash[e]};cg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=xie(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};cg.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof ve)&&(t=ve.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=xie(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};cg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new de(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,u=a.y+t.y/s,f=t.width/r,d=t.height/s,p=i._textureCoordinates.push(new Ke(c,u,f,d))-1;return i._indexHash[e]=p,i._guid=jn(),p})};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var B0=cg;var Aze=go.SHOW_INDEX,Ov=go.POSITION_INDEX,bie=go.PIXEL_OFFSET_INDEX,Cie=go.EYE_OFFSET_INDEX,Eze=go.HORIZONTAL_ORIGIN_INDEX,Sze=go.VERTICAL_ORIGIN_INDEX,vze=go.SCALE_INDEX,Pv=go.IMAGE_INDEX_INDEX,Tie=go.COLOR_INDEX,wze=go.ROTATION_INDEX,Ize=go.ALIGNED_AXIS_INDEX,Aie=go.SCALE_BY_DISTANCE_INDEX,Eie=go.TRANSLUCENCY_BY_DISTANCE_INDEX,Sie=go.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,vie=go.DISTANCE_DISPLAY_CONDITION,Dze=go.DISABLE_DEPTH_DISTANCE,Pze=go.TEXTURE_COORDINATE_BOUNDS,wie=go.SDF_INDEX,w6=go.NUMBER_OF_PROPERTIES,yo,Oze={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},Rze={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function Gu(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(w6),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Gu.prototype,{length:{get:function(){return I6(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Iie(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Gu.prototype.add=function(e){let t=new go(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Gu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Gu.prototype.removeAll=function(){Iie(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function I6(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Gu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Gu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Gu.prototype.get=function(e){return I6(this),this._billboards[e]};var C6;function Mze(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=ht.createIndexBuffer({context:e,typedArray:o,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Lze(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=ht.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Nze(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=ht.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:ke.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Gu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<w6;++i){let o=n[i]===0?ke.STATIC_DRAW:ke.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Fze(e,t,n,i,o,r){let s=[{index:yo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Ov]},{index:yo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Ov]},{index:yo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[bie]},{index:yo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Eie]},{index:yo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Tie]},{index:yo.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Cie]},{index:yo.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Aie]},{index:yo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Sie]},{index:yo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[vie]},{index:yo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Pze]}];i&&s.push({index:yo.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Nze(e)}),l(o)&&s.push({index:yo.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:ke.STATIC_DRAW}),r&&s.push({index:yo.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[wie]});let a=i?t:4*t;return new ag(e,s,a,i)}var T6=new qn;function Die(e,t,n,i,o){let r,s=i[yo.positionHighAndScale],a=i[yo.positionLowAndRotation],c=o._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),qn.fromCartesian(c,T6);let u=o.scale,f=o.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=T6.high,p=T6.low;e._instanced?(r=o._index,s(r,d.x,d.y,d.z,u),a(r,p.x,p.y,p.z,f)):(r=o._index*4,s(r+0,d.x,d.y,d.z,u),s(r+1,d.x,d.y,d.z,u),s(r+2,d.x,d.y,d.z,u),s(r+3,d.x,d.y,d.z,u),a(r+0,p.x,p.y,p.z,f),a(r+1,p.x,p.y,p.z,f),a(r+2,p.x,p.y,p.z,f),a(r+3,p.x,p.y,p.z,f))}var Hu=new H,zu=32768,oT=65536,A6=4096,Dm=256,Bze=128,kze=32,Uze=8,Pie=4,Vze=1/256,Oie=0,Rie=2,Mie=3,Lie=1;function Nie(e,t,n,i,o){let r,s=i[yo.compressedAttribute0],a=o.pixelOffset,c=a.x,u=a.y,f=o._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=o.horizontalOrigin,h=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),h===Ln.BASELINE&&(h=Ln.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===_i.CENTER,e._allVerticalCenter=e._allVerticalCenter&&h===Ln.CENTER;let b=0,C=0,T=0,A=0,S=o._imageIndex;if(S!==-1){let V=n[S];b=V.x,C=V.y,T=V.width,A=V.height}let v=b+T,I=C+A,O=Math.floor(P.clamp(c,-zu,zu)+zu)*Bze;O+=(g+1)*kze,O+=(h+1)*Uze,O+=(x?1:0)*Pie;let R=Math.floor(P.clamp(u,-zu,zu)+zu)*Dm,N=Math.floor(P.clamp(d,-zu,zu)+zu)*Dm,F=(P.clamp(p,-zu,zu)+zu)*Vze,_=Math.floor(F),E=Math.floor((F-_)*Dm);R+=_,N+=E,Hu.x=b,Hu.y=C;let w=Yn.compressTextureCoordinates(Hu);Hu.x=v;let D=Yn.compressTextureCoordinates(Hu);Hu.y=I;let M=Yn.compressTextureCoordinates(Hu);Hu.x=b;let B=Yn.compressTextureCoordinates(Hu);e._instanced?(r=o._index,s(r,O,R,N,w)):(r=o._index*4,s(r+0,O+Oie,R,N,w),s(r+1,O+Rie,R,N,D),s(r+2,O+Mie,R,N,M),s(r+3,O+Lie,R,N,B))}function Fie(e,t,n,i,o){let r,s=i[yo.compressedAttribute1],a=o.alignedAxis;m.equals(a,m.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=o.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,h=o._imageIndex;h!==-1&&(g=n[h].width);let x=e._textureAtlas.texture.width,b=Math.round(y(o.width,x*g));e._maxSize=Math.max(e._maxSize,b);let C=P.clamp(b,0,oT),T=0;Math.abs(m.magnitudeSquared(a)-1)<P.EPSILON6&&(T=Yn.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,C=C*Dm+u,d=P.clamp(d,0,1),d=d===1?255:d*255|0,T=T*Dm+d,e._instanced?(r=o._index,s(r,C,T,c,f)):(r=o._index*4,s(r+0,C,T,c,f),s(r+1,C,T,c,f),s(r+2,C,T,c,f),s(r+3,C,T,c,f))}function S6(e,t,n,i,o){let r,s=i[yo.compressedAttribute2],a=o.color,c=l(e._batchTable)?z.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,f=Math.abs(m.magnitudeSquared(o.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=o._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,h=Math.round(y(o.height,g.y*d));e._maxSize=Math.max(e._maxSize,h);let x=y(o._labelHorizontalOrigin,-2);x+=2;let b=h*Pie+x,C=z.floatToByte(a.red),T=z.floatToByte(a.green),A=z.floatToByte(a.blue),S=C*oT+T*Dm+A;C=z.floatToByte(c.red),T=z.floatToByte(c.green),A=z.floatToByte(c.blue);let v=C*oT+T*Dm+A,I=z.floatToByte(a.alpha)*oT+z.floatToByte(c.alpha)*Dm;I+=u*2+f,e._instanced?(r=o._index,s(r,S,v,I,b)):(r=o._index*4,s(r+0,S,v,I,b),s(r+1,S,v,I,b),s(r+2,S,v,I,b),s(r+3,S,v,I,b))}function v6(e,t,n,i,o){let r,s=i[yo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==qe.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=o._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}Hu.x=u,Hu.y=f;let p=Yn.compressTextureCoordinates(Hu);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function Bie(e,t,n,i,o){let r,s=i[yo.scaleByDistance],a=0,c=1,u=1,f=1,d=o.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function kie(e,t,n,i,o){let r,s=i[yo.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=o.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function Uie(e,t,n,i,o){let r,s=i[yo.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=o.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,d=o.heightReference===qe.CLAMP_TO_GROUND&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,T=0,A=o._imageIndex;if(A!==-1){let v=n[A];C=v.height,T=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let S=e._textureAtlas.texture.width;g=Math.round(y(o.width,S*T))}let h=Math.floor(P.clamp(g,0,A6)),x=Math.floor(P.clamp(p,0,A6)),b=h*A6+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function Vie(e,t,n,i,o){if(o.heightReference===qe.CLAMP_TO_GROUND){let h=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&C}let r,s=i[yo.textureCoordinateBoundsOrLabelTranslate];if(Gt.maximumVertexTextureImageUnits>0){let h=0,x=0;l(o._labelTranslate)&&(h=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,h,x,0,0)):(r=o._index*4,s(r+0,h,x,0,0),s(r+1,h,x,0,0),s(r+2,h,x,0,0),s(r+3,h,x,0,0));return}let a=0,c=0,u=0,f=0,d=o._imageIndex;if(d!==-1){let h=n[d];a=h.x,c=h.y,u=h.width,f=h.height}let p=a+u,g=c+f;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function zze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[yo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function zie(e,t,n,i,o){if(!e._sdf)return;let r,s=i[yo.sdf],a=o.outlineColor,c=o.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*oT+f*Dm+d,g=c/zs.RADIUS,h=z.floatToByte(a.alpha)*oT+z.floatToByte(g)*Dm;e._instanced?(r=o._index,s(r,p,h)):(r=o._index*4,s(r+0,p+Oie,h),s(r+1,p+Rie,h),s(r+2,p+Mie,h),s(r+3,p+Lie,h))}function Hze(e,t,n,i,o){Die(e,t,n,i,o),Nie(e,t,n,i,o),Fie(e,t,n,i,o),S6(e,t,n,i,o),v6(e,t,n,i,o),Bie(e,t,n,i,o),kie(e,t,n,i,o),Uie(e,t,n,i,o),Vie(e,t,n,i,o),zze(e,t,n,i,o),zie(e,t,n,i,o)}function E6(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=go._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function Gze(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!L.equals(r,e.modelMatrix)?(e._mode=n,L.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&E6(e,i,i.length,t,r,!0)):n===ne.MORPHING?E6(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&E6(e,o,e._billboardsToUpdateIndex,t,r,!1)}function Wze(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function jze(e,t){let n=`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; +void main() +{ + out_FragColor = texture(billboard_texture, v_textureCoordinates); +} +`,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Ae.OVERLAY,i}var qze=[];Gu.prototype.update=function(e){if(I6(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,yo=this._instanced?Rze:Oze,C6=this._instanced?Lze:Mze;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new B0({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;Gze(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<w6;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Fze(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let R=0;R<n;++R){let N=this._billboards[R];N._dirty=!1,Hze(this,e,r,d,N)}this._vaf.commit(C6(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=qze;R.length=0,(c[Ov]||c[wze]||c[vze])&&R.push(Die),(c[Pv]||c[bie]||c[Eze]||c[Sze]||c[Aze])&&(R.push(Nie),this._instanced&&R.push(v6)),(c[Pv]||c[Ize]||c[Eie])&&(R.push(Fie),R.push(S6)),(c[Pv]||c[Tie])&&R.push(S6),c[Cie]&&R.push(v6),c[Aie]&&R.push(Bie),c[Sie]&&R.push(kie),(c[vie]||c[Dze]||c[Pv]||c[Ov])&&R.push(Uie),(c[Pv]||c[Ov])&&R.push(Vie),c[wie]&&R.push(zie);let N=R.length;if(d=this._vaf.writers,a/n>.1){for(let F=0;F<a;++F){let _=s[F];_._dirty=!1;for(let E=0;E<N;++E)R[E](this,e,r,d,_)}this._vaf.commit(C6(i))}else{for(let F=0;F<a;++F){let _=s[F];_._dirty=!1;for(let E=0;E<N;++E)R[E](this,e,r,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,x=L.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),Wze(this,e,h);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Io.OPAQUE||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Io.TRANSLUCENT;this._blendOption===Io.TRANSLUCENT||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,T,A,S,v,I=Gt.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=kF,T=BF,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),A=new We({defines:v,sources:[C]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-zs.CUTOFF;this._sdf&&A.defines.push("SDF");let N=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Io.OPAQUE_AND_TRANSLUCENT&&(S=new We({defines:["OPAQUE",N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:yo}),S=new We({defines:["TRANSLUCENT",N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:yo})),this._blendOption===Io.OPAQUE&&(S=new We({defines:[N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:yo})),this._blendOption===Io.TRANSLUCENT&&(S=new We({defines:[N],sources:[T]}),this._shaderClampToGround&&(I?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:yo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,N=this._blendOption===Io.OPAQUE,F=this._blendOption===Io.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,E=_.length,w=this._uniforms,D;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),D=this._batchTable.getPickId()):D="v_pickColor",R.length=E;let M=F?E*2:E;for(let B=0;B<M;++B){let V=R[B];l(V)||(V=R[B]=new nt);let U=N||F&&B%2===0;V.pass=U||!F?Ae.OPAQUE:Ae.TRANSLUCENT,V.owner=this;let G=F?Math.floor(B/2):B;V.boundingVolume=h,V.modelMatrix=x,V.count=_[G].indicesCount,V.shaderProgram=U?this._sp:this._spTranslucent,V.uniformMap=w,V.vertexArray=_[G].va,V.renderState=U?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId=D,this._instanced&&(V.count=6,V.instanceCount=n),O.push(V)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=jze(this,e.context)),O.push(this.debugCommand))}};Gu.prototype.isDestroyed=function(){return!1};Gu.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Iie(this._billboards),ue(this)};var Wu=Gu;function Yze(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var rT=Yze;function Hs(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),sT(this)}var Xze=new me;Object.defineProperties(Hs.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),sT(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,sT(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),sT(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,sT(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Xze);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&sT(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Hs.defaultColor=z.WHITE;Hs.defaultPointOutlineColor=z.BLACK;Hs.defaultPointOutlineWidth=0;Hs.defaultPointSize=8;function sT(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,Hs.defaultColor),i=y(e._pointOutlineColor,Hs.defaultPointOutlineColor),o=y(e._pointOutlineWidth,Hs.defaultPointOutlineWidth),r=y(e._pointSize,Hs.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&o===c&&r===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,r,p,o]);t.setImage(g,rT(f,d,p,o,r))}Hs.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Hs.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Hs.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Hs.prototype.getPropertyInherited=function(e){return ks.getPropertyInherited(this._content,this._batchId,e)};Hs.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Hs.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Hs.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Hs.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var lg=Hs;function Kze(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let h=g.getImageData(0,0,f,d).data,x=h.length,b=f*4,C,T,A,S;for(C=0;C<x;++C)if(h[C]!==255){A=C/b|0;break}for(C=x-1;C>=0;--C)if(h[C]!==255){S=C/b|0;break}let v=-1;for(C=0;C<f&&v===-1;++C)for(T=0;T<d;++T){let I=C*4+T*b;if(h[I]!==255||h[I+1]!==255||h[I+2]!==255||h[I+3]!==255){v=C;break}}return{width:r.width,height:S-A,ascent:p-A,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var k0;function Jze(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(k0)||(l(f.imageSmoothingEnabled)?k0="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?k0="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?k0="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(k0="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[k0]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Kze(f,e,n,i,o);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,h=d.height+c,x=h-d.ascent+a,b=h-x+c;if(u.width=g,u.height=h,f.font=n,f.lineJoin="round",f.lineWidth=r,f[k0]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let C=y(t.strokeColor,z.BLACK);f.strokeStyle=C.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let C=y(t.fillColor,z.WHITE);f.fillStyle=C.toCssColorString(),f.fillText(e,p+a,b)}return u}var aT=Jze;var $ie=ur(jie(),1);var $ze={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},jo=Object.freeze($ze);var qie={},Yie=0,Qze=256,e4e=new z(.165,.165,.165,.8),t4e=new H(7,5),Kr=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function U0(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Mv(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Lv(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Kie(e){let t=qie[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(Lv(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Lv(n,"font-family"),size:Lv(n,"font-size").replace("px",""),style:Lv(n,"font-style"),weight:Lv(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Yie<Qze&&(qie[e._font]=t,Yie++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function fp(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Rt.clone(n)),l(i)&&(i=Rt.clone(i)),l(o)&&(o=Rt.clone(o)),l(r)&&(r=Dt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,e4e)),this._backgroundPadding=H.clone(y(e.backgroundPadding,t4e)),this._style=y(e.style,jo.FILL),this._verticalOrigin=y(e.verticalOrigin,Ln.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,_i.LEFT),this._pixelOffset=H.clone(y(e.pixelOffset,H.ZERO)),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._position=m.clone(y(e.position,m.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,qe.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Kie(this),this._updateClamping()}Object.defineProperties(fp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),Mv(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=fp.enableRightToLeftDetection?a4e(t):t,U0(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,U0(this),Kie(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),U0(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),U0(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,U0(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,U0(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;H.equals(t,e)||(H.clone(e,t),Mv(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,U0(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!H.equals(t,e)){H.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Rt.equals(t,e)){this._translucencyByDistance=Rt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Rt.equals(t,e)){this._pixelOffsetScaleByDistance=Rt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Rt.equals(t,e)){this._scaleByDistance=Rt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Mv(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),Mv(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),Mv(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Dt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});fp.prototype._updateClamping=function(){go._updateClamping(this._labelCollection,this)};fp.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new H);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return go._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};fp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===Ln.BOTTOM||e.verticalOrigin===Ln.BASELINE?o-=s:e.verticalOrigin===Ln.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let h=d[g],x=h.billboard;if(!l(x))continue;let b=t.x+x._translate.x,C=t.y-x._translate.y,T=h.dimensions.width*a,A=h.dimensions.height*a;e.verticalOrigin===Ln.BOTTOM||e.verticalOrigin===Ln.BASELINE?C-=A:e.verticalOrigin===Ln.CENTER&&(C-=A*.5),e._verticalOrigin===Ln.TOP?C+=zs.PADDING*a:(e._verticalOrigin===Ln.BOTTOM||e._verticalOrigin===Ln.BASELINE)&&(C-=zs.PADDING*a),i=Math.min(i,b),o=Math.min(o,C),u=Math.max(u,b+T),f=Math.max(f,C+A)}r=u-i,s=f-o}return l(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};fp.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&H.equals(this._backgroundPadding,e._backgroundPadding)&&H.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Rt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Rt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Rt.equals(this._scaleByDistance,e._scaleByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};fp.prototype.isDestroyed=function(){return!1};fp.enableRightToLeftDetection=!1;function n4e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=Kr.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Kr.RTL:n.test(f)?a=Kr.LTR:i.test(f)?a=Kr.BRACKETS:a=Kr.WEAK,u===0&&(s=a),s===a&&a!==Kr.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function i4e(e){return e.split("").reverse().join("")}function Nv(e,t,n){return e.slice(0,t)+n+e.slice(t)}function o4e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var r4e="\u05D0-\u05EA",s4e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Xie=new RegExp(`[${r4e}${s4e}]`);function a4e(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Xie.test(o.charAt(0)),s=n4e(o,Xie),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===Kr.BRACKETS?o4e(f.Word):i4e(f.Word);r?f.Type===Kr.RTL?(c=d+c,a=0):f.Type===Kr.LTR?(c=Nv(c,a,f.Word),a+=f.Word.length):(f.Type===Kr.WEAK||f.Type===Kr.BRACKETS)&&(f.Type===Kr.WEAK&&s[u-1].Type===Kr.BRACKETS?c=d+c:s[u-1].Type===Kr.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===Kr.RTL?(c=d+c,a=0):(c=Nv(c,a,f.Word),a+=f.Word.length):c=Nv(c,0,d)):f.Type===Kr.RTL?c=Nv(c,a,d):f.Type===Kr.LTR?(c+=f.Word,a=c.length):(f.Type===Kr.WEAK||f.Type===Kr.BRACKETS)&&(u>0&&s[u-1].Type===Kr.RTL?s.length>u+1?s[u+1].Type===Kr.RTL?c=Nv(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var V0=fp;var Qie=ur(Jie(),1);function l4e(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function u4e(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var f4e=1.2,eoe="ID_WHITE_PIXEL",D6=new H(4,4),d4e=new Ke(1,1,1,1);function m4e(e){let t=document.createElement("canvas");t.width=D6.x,t.height=D6.y;let n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(eoe,t)}var ju={};function h4e(e,t,n,i,o,r,s){return ju.font=t,ju.fillColor=n,ju.strokeColor=i,ju.strokeWidth=o,ju.padding=zs.PADDING,s===Ln.CENTER?ju.textBaseline="middle":s===Ln.TOP?ju.textBaseline="top":ju.textBaseline="bottom",ju.fill=r===jo.FILL||r===jo.FILL_AND_OUTLINE,ju.stroke=r===jo.OUTLINE||r===jo.FILL_AND_OUTLINE,ju.backgroundColor=z.BLACK,aT(e,ju)}function P6(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function p4e(e,t,n,i){i.index=e.addImageSync(t,n)}var _4e=new Qie.default;function g4e(e,t){let n=t._renderedText,i=_4e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,u;if(t._relativeSize=t._fontSize/zs.FONT_SIZE,o<s)for(c=o;c<s;++c)P6(e,r[c]);r.length=o;let f=t._showBackground&&n.split(` +`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:eoe,imageSubRegion:d4e}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=_i.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<o;++u){let h=i[u],x=t._verticalOrigin,b=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=g[b];if(!l(C)){let T=`${t._fontStyle} ${t._fontWeight} ${zs.FONT_SIZE}px ${t._fontFamily}`,A=h4e(h,T,z.WHITE,z.WHITE,0,jo.FILL,x);if(C=new u4e(e,-1,A.dimensions),g[b]=C,A.width>0&&A.height>0){let S=(0,$ie.default)(A,{cutoff:zs.CUTOFF,radius:zs.RADIUS}),v=A.getContext("2d"),I=A.width,O=A.height,R=v.getImageData(0,0,I,O);for(let N=0;N<I;N++)for(let F=0;F<O;F++){let _=F*I+N,E=S[_]*255,w=_*4;R.data[w+0]=E,R.data[w+1]=E,R.data[w+2]=E,R.data[w+3]=E}v.putImageData(R,0,0),h!==" "&&p4e(e._textureAtlas,b,A,C)}}if(a=r[u],l(a)?C.index===-1?P6(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new l4e,r[u]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let T=a.billboard,A=e._spareBillboards;l(T)||(A.length>0?T=A.pop():(T=e._billboardCollection.add({collection:e}),T._labelDimensions=new H,T._labelTranslate=new H),a.billboard=T),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=_i.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.image=b,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===jo.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===jo.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===jo.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Zie(e,t,n){return t===_i.CENTER?-e/2:t===_i.RIGHT?-(e+n.x):n.x}var ir=new H,y4e=new H;function x4e(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,h=H.clone(l(g)?e._backgroundPadding:H.ZERO,y4e);for(h.x/=e._relativeSize,h.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` +`?(a.push(r),++f,r=0):(i=t[d],o=i.dimensions,u=Math.max(u,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,d<p-1&&(r+=t[d+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=u+c,b=e.totalScale,C=e._horizontalOrigin,T=e._verticalOrigin,A=0,S=a[A],v=Zie(S,C,h),I=(l(e._lineHeight)?e._lineHeight:f4e*e._fontSize)/e._relativeSize,O=I*(f-1),R=s,N=x+O;l(g)&&(R+=h.x*2,N+=h.y*2,g._labelHorizontalOrigin=C),ir.x=v*b,ir.y=0;let F=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` +`)++A,_+=I,S=a[A],v=Zie(S,C,h),ir.x=v*b,F=!0;else if(i=t[d],o=i.dimensions,T===Ln.TOP?(ir.y=o.height-u-h.y,ir.y+=zs.PADDING):T===Ln.CENTER?ir.y=(O+o.height-u)/2:T===Ln.BASELINE?(ir.y=O,ir.y-=zs.PADDING):(ir.y=O+c+h.y,ir.y-=zs.PADDING),ir.y=(ir.y-o.descent-_)*b,F&&(ir.x-=zs.PADDING*b,F=!1),l(i.billboard)&&(i.billboard._setTranslate(ir),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=N,i.billboard._labelHorizontalOrigin=C),d<p-1){let E=t[d+1];ir.x+=(o.width-o.minx+E.dimensions.minx)*b}if(l(g)&&n.split(` +`).join("").length>0&&(C===_i.CENTER?v=-s/2-h.x:C===_i.RIGHT?v=-(s+h.x*2):v=0,ir.x=v*b,T===Ln.TOP?ir.y=x-u-c:T===Ln.CENTER?ir.y=(x-u)/2-c:T===Ln.BASELINE?ir.y=-h.y-c:ir.y=0,ir.y=ir.y*b,g.width=R,g.height=N,g._setTranslate(ir),g._labelTranslate=H.clone(ir,g._labelTranslate)),e.heightReference===qe.CLAMP_TO_GROUND)for(d=0;d<p;++d){i=t[d];let E=i.billboard;l(E)&&(E._labelTranslate=H.clone(ir,E._labelTranslate))}}function toe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)P6(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function Pm(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Wu({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Wu({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Pm.prototype,{length:{get:function(){return this._labels.length}}});Pm.prototype.add=function(e){let t=new V0(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Pm.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),toe(this,e),!0}return!1};Pm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)toe(this,e[t]);e.length=0};Pm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Pm.prototype.get=function(e){return this._labels[e]};Pm.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new B0({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new B0({context:i,initialSize:D6}),n.textureAtlas=this._backgroundTextureAtlas,m4e(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(g4e(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(x4e(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let r=n.length>0?Io.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var dp=Pm;var WF=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; + +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; - v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; - v_positionMC = position3DWC; // position in model coordinates +void main() +{ + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; - v_textureCoordinates = vec3(textureCoordinates, webMercatorT); + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; -#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) - vec3 normalMC = czm_octDecode(encodedNormal); + if (width < 1.0) + { + show = 0.0; + } -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) - vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; - vec3 rejection = normalMC - projection; - normalMC = normalize(projection + rejection * exaggeration); -#endif + vec4 pickColor = batchTable_getPickColor(batchTableIndex); - v_normalMC = normalMC; - v_normalEC = czm_normal3D * v_normalMC; -#endif + vec4 p, prev, next; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); + } -#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); - bool dynamicLighting = false; + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } #endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - - vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); - - computeAtmosphereScattering( - position3DWC, - lightDirection, - v_atmosphereRayleighColor, - v_atmosphereMieColor, - v_atmosphereOpacity - ); -#endif + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) - v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); -#endif + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); -#ifdef APPLY_MATERIAL - float northPoleZ = czm_ellipsoidRadii.z; - vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); - vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); - float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); - v_slope = acos(dotProd); - vec3 normalRejected = ellipsoidNormal * dotProd; - vec3 normalProjected = v_normalMC - normalRejected; - vec3 aspectVector = normalize(normalProjected); - v_aspect = acos(dot(aspectVector, vectorEastMC)); - float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); - v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); - v_height = height; -#endif + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; } -`;var by=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;var Tc={};Tc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};Tc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var b4e=new me;Tc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,b4e).height}return i};var C4e=new L,T4e=new m,noe=new m,A4e=new dn(m.UNIT_X,0),ioe=new m,E4e=new dn(m.UNIT_X,0),S4e=new m,v4e=new m,R6=[];function roe(e,t,n){let i=R6;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var qF=new me,jF=new me,ug=new m,M6=new m,w4e=new m,O6=new zf,Fv=new Na;function I4e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,M6),u=i.scaleToGeodeticSurface(t,w4e),f=Tc.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,qF),p=i.cartesianToCartographic(u,jF),g=roe(f,o,r);O6.setEndPoints(d,p);let h=O6.surfaceDistance/f,x=a;d.height=o;let b=i.cartographicToCartesian(d,ug);m.pack(b,s,x),x+=3;for(let C=1;C<f;C++){let T=O6.interpolateUsingSurfaceDistance(C*h,jF);T.height=g[C],b=i.cartographicToCartesian(T,ug),m.pack(b,s,x),x+=3}return x}function D4e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,qF),u=i.cartesianToCartographic(t,jF),f=Tc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=roe(f,o,r);Fv.ellipsoid.equals(i)||(Fv=new Na(void 0,void 0,i)),Fv.setEndPoints(c,u);let p=Fv.surfaceDistance/f,g=a;c.height=o;let h=i.cartographicToCartesian(c,ug);m.pack(h,s,g),g+=3;for(let x=1;x<f;x++){let b=Fv.interpolateUsingSurfaceDistance(x*p,jF);b.height=d[x],h=i.cartographicToCartesian(b,ug),m.pack(h,s,g),g+=3}return g}Tc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,L.IDENTITY);let o=L.inverseTransformation(t,C4e),r=L.multiplyByPoint(o,m.ZERO,T4e),s=m.normalize(L.multiplyByPointAsVector(o,m.UNIT_Y,noe),noe),a=dn.fromPointNormal(r,s,A4e),c=m.normalize(L.multiplyByPointAsVector(o,m.UNIT_X,ioe),ioe),u=dn.fromPointNormal(r,c,E4e),f=1;n.push(m.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let h=e[g];if(dn.getPointDistance(u,d)<0||dn.getPointDistance(u,h)<0){let x=$i.lineSegmentPlane(d,h,a,S4e);if(l(x)){let b=m.multiplyByScalar(s,5e-9,v4e);dn.getPointDistance(a,d)<0&&m.negate(b,b),n.push(m.add(x,b,new m)),i.push(f+1),m.negate(b,b),n.push(m.add(x,b,new m)),f=1}}n.push(m.clone(e[g])),f++,d=h}i.push(f)}return{positions:n,lengths:i}};Tc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,oe.WGS84),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],M6);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,ug);m.multiplyByScalar(b,o,b),m.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Tc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],C=r?o[c]:o,T=r?o[c+1]:o;d=I4e(x,b,s,i,C,T,f,d)}R6.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,qF);g.height=r?o[n-1]:o;let h=i.cartographicToCartesian(g,ug);return m.pack(h,f,u-3),f};var ooe=new me,P4e=new me;Tc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,oe.WGS84),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],M6);if(o=r?o[0]:o,o!==0){let T=i.geodeticSurfaceNormal(C,ug);m.multiplyByScalar(T,o,T),m.add(C,T,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],ooe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],P4e),a+=Tc.numberOfPointsRhumbLine(u,f,s),u=me.clone(f,ooe);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let C=t[c],T=t[c+1],A=r?o[c]:o,S=r?o[c+1]:o;g=D4e(C,T,s,i,A,S,p,g)}R6.length=0;let h=t[n-1],x=i.cartesianToCartographic(h,qF);x.height=r?o[n-1]:o;let b=i.cartographicToCartesian(x,ug);return m.pack(b,p,d-3),p};Tc.generateCartesianArc=function(e){let t=Tc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};Tc.generateCartesianRhumbArc=function(e){let t=Tc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};var Mi=Tc;function ql(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=qi.fromType(qi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Ao(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=L.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Mi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(aoe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var soe=ql.POSITION_INDEX=0,O4e=ql.SHOW_INDEX=1,R4e=ql.WIDTH_INDEX=2,M4e=ql.MATERIAL_INDEX=3,Bv=ql.POSITION_SIZE_INDEX=4,L4e=ql.DISTANCE_DISPLAY_CONDITION=5,aoe=ql.NUMBER_OF_PROPERTIES=6;function mp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(ql.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,mp(this,O4e))}},positions:{get:function(){return this._positions},set:function(e){let t=Ao(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&mp(this,Bv),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),mp(this,soe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,mp(this,M4e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,mp(this,R4e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,mp(this,Bv)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),mp(this,L4e))}}});ql.prototype.update=function(){let e=L.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[soe]>0||this._propertiesChanged[Bv]>0;if((!L.equals(e,this._modelMatrix)||i)&&(this._segments=Mi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=L.clone(e,this._modelMatrix),this._segments.positions.length!==t)mp(this,Bv);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){mp(this,Bv);break}}};ql.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};ql.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<aoe-1;++t)e[t]=0};ql.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Qf=ql;var N4e=Qf.SHOW_INDEX,F4e=Qf.WIDTH_INDEX,N6=Qf.POSITION_INDEX,B4e=Qf.MATERIAL_INDEX,coe=Qf.POSITION_SIZE_INDEX,k4e=Qf.DISTANCE_DISPLAY_CONDITION,poe=Qf.NUMBER_OF_PROPERTIES,sl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function ed(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(poe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:ke.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(ed.prototype,{length:{get:function(){return F6(this),this._polylines.length}}});ed.prototype.add=function(e){let t=new Qf(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};ed.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};ed.prototype.removeAll=function(){B6(this),boe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};ed.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};ed.prototype.get=function(e){return F6(this),this._polylines[e]};function U4e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new Kb(t,n,e._polylines.length)}var _oe=new qn,goe=new re,yoe=new H;ed.prototype.update=function(e){if(F6(this),this._polylines.length===0||!this.show)return;j4e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Gt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");U4e(this,t),this._createBatchTable=!1}if(this._createVertexArray||z4e(this))foe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[coe]||o[B4e])foe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,g=0;for(let h in f)if(f.hasOwnProperty(h)){if(f[h]===p){o[N6]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[h].lengthOfPositions}if((o[N4e]||o[F4e])&&this._batchTable.setBatchedAttribute(i._index,0,new H(i._width,i._show)),this._batchTable.attributes.length>2){if(o[N6]||o[coe]){let h=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=qn.fromCartesian(h.center,_oe),b=re.fromElements(x.low.x,x.low.y,x.low.z,h.radius,goe);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[k4e]){let h=yoe;h.x=0,h.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(h.x=x.near,h.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<poe;++c)o[c]=0;let r=L.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:mn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;V4e(this,e,c,r)}};var kv=new ae,loe=new ae;function V4e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let h=0;h<g;++h){let x=u[h],b=x.buckets,C=b.length;for(let T=0;T<C;++T){let A=b[T],S=A.offset,v=A.bucket.shaderProgram,I=A.bucket.polylines,O=I.length,R,N,F=0,_,E;for(let w=0;w<O;++w){let D=I[w],M=G4e(D._material);if(M!==R){if(l(R)&&F>0){let G=N.isTranslucent();a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,E=_t(p(N._uniforms),e._uniformMap),_.boundingVolume=ae.clone(kv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?Ae.TRANSLUCENT:Ae.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=F,_.offset=S,S+=F,F=0,c=!0,r.push(_)}N=D._material,N.update(o),R=M}let B=D._locatorBuckets,V=B.length;for(let G=0;G<V;++G){let k=B[G];k.locator===A&&(F+=k.count)}let U;t.mode===ne.SCENE3D?U=D._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?U=D._boundingVolume2D:t.mode===ne.SCENE2D?l(D._boundingVolume2D)&&(U=ae.clone(D._boundingVolume2D,loe),U.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(U=ae.union(D._boundingVolumeWC,D._boundingVolume2D,loe)),c?(c=!1,ae.clone(U,kv)):ae.union(U,kv,kv)}l(R)&&F>0&&(a>=s?(_=new nt({owner:e}),n.push(_)):_=n[a],++a,E=_t(p(N._uniforms),e._uniformMap),_.boundingVolume=ae.clone(kv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=N.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=N.isTranslucent()?Ae.TRANSLUCENT:Ae.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=F,_.offset=S,c=!0,r.push(_)),R=void 0}}n.length=a}ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){return xoe(this),B6(this),boe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function z4e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[N6]?(i.bufferUsage!==ke.STREAM_DRAW&&(t=!0,i.bufferUsage=ke.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==ke.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=ke.STATIC_DRAW):i.frameCount--),t}var uoe=[0,0,0];function foe(e,t,n){e._createVertexArray=!1,B6(e),xoe(e),W4e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let h=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),C,T=0,A=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,b,T,A,S,r,t,n),h===ne.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),g.writeForMorph(C,T));let E=g.lengthOfPositions;T+=6*E*3,A+=E*4,S+=E*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,I=ke.STATIC_DRAW;e._positionBuffer=ht.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(C)&&(O=ht.createVertexBuffer({context:t,typedArray:C,usage:v})),e._texCoordExpandAndBatchIndexBuffer=ht.createVertexBuffer({context:t,typedArray:b,usage:I});let R=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,F=0,_=i.length;for(let E=0;E<_;++E)if(o=i[E],o.length>0){let w=new Uint16Array(o),D=ht.createIndexBuffer({context:t,typedArray:w,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});F+=a[E];let M=6*(E*(R*P.SIXTY_FOUR_KILOBYTES)-F*R),B=R+M,V=R+B,U=R+V,G=R+U,k=R+G,Y=E*(N*P.SIXTY_FOUR_KILOBYTES)-F*N,j=[{index:sl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:sl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:sl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:sl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:sl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:sl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:sl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:sl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:sl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:sl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:sl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:sl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:sl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:Y}],$,W,K,J;h===ne.SCENE3D?(W=e._positionBuffer,$="vertexBuffer",K=uoe,J="value"):h===ne.SCENE2D||h===ne.COLUMBUS_VIEW?(W=uoe,$="value",K=e._positionBuffer,J="vertexBuffer"):(W=O,$="vertexBuffer",K=e._positionBuffer,J="vertexBuffer"),j[0][$]=W,j[1][$]=W,j[2][J]=K,j[3][J]=K,j[4][$]=W,j[5][$]=W,j[6][J]=K,j[7][J]=K,j[8][$]=W,j[9][$]=W,j[10][J]=K,j[11][J]=K;let he=new ai({context:t,attributes:j,indexBuffer:D});e._vertexArrays.push({va:he,buckets:u[E]})}}}function H4e(e,t){return t instanceof Lt?t.id:t}var YF=[];function G4e(e){let t=qi._uniformList[e.type],n=t.length;YF.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];YF[i]=r,YF[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(YF,H4e)}`}function W4e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Om(c,t,n)),u.addPolyline(a)}}}function j4e(e,t){let n=t.mode;(e._mode!==n||!L.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=L.clone(e.modelMatrix),e._createVertexArray=!0)}function F6(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function B6(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function xoe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}ed.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function boe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function L6(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Om(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Om.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Om.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Wt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new We({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,sC]}),r=t.getVertexShaderCallback()(WF),s=new We({defines:i,sources:[Lu,r]});this.shaderProgram=$t.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:sl})};function Coe(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(dn.ORIGIN_ZX_PLANE)===tn.INTERSECTING}Om.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!Coe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var cs=new m,qu=new m,Yu=new m,XF=new m,q4e=new re,Y4e=new H;Om.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],h=g.width,x=g.show&&h>0,b=g._index,C=this.getSegments(g,a),T=C.positions,A=C.lengths,S=T.length,v=g.getPickId(s).color,I=0,O=0,R;for(let V=0;V<S;++V){V===0?g._loop?R=T[S-2]:(R=XF,m.subtract(T[0],T[1],R),m.add(T[0],R,R)):R=T[V-1],m.clone(R,qu),m.clone(T[V],cs),V===S-1?g._loop?R=T[1]:(R=XF,m.subtract(T[S-1],T[S-2],R),m.add(T[S-1],R,R)):R=T[V+1],m.clone(R,Yu);let U=A[I];V===O+U&&(O+=U,++I);let G=V-O===0,k=V===O+A[I]-1;c===ne.SCENE2D&&(qu.z=0,cs.z=0,Yu.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(cs.x)<1&&((cs.x<0&&qu.x>0||cs.x>0&&qu.x<0)&&m.clone(cs,qu),(cs.x<0&&Yu.x>0||cs.x>0&&Yu.x<0)&&m.clone(cs,Yu));let Y=G?2:0,j=k?2:4;for(let $=Y;$<j;++$){qn.writeElements(cs,e,n),qn.writeElements(qu,e,n+6),qn.writeElements(Yu,e,n+12);let W=$-2<0?-1:1;t[o]=V/(S-1),t[o+1]=2*($%2)-1,t[o+2]=W,t[o+3]=b,n+=6*3,o+=4}}let N=q4e;N.x=z.floatToByte(v.red),N.y=z.floatToByte(v.green),N.z=z.floatToByte(v.blue),N.w=z.floatToByte(v.alpha);let F=Y4e;F.x=h,F.y=x?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,E=qn.fromCartesian(_.center,_oe),w=E.high,D=re.fromElements(E.low.x,E.low.y,E.low.z,_.radius,goe),M=yoe;M.x=0,M.y=Number.MAX_VALUE;let B=g.distanceDisplayCondition;l(B)&&(M.x=B.near,M.y=B.far),r.setBatchedAttribute(b,0,F),r.setBatchedAttribute(b,1,N),r.attributes.length>2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,D),r.setBatchedAttribute(b,4,M))}};var X4e=new m,K4e=new m,J4e=new m,doe=new m;Om.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=doe,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=L.multiplyByPoint(n,g,K4e);let h=L.multiplyByPoint(n,a[p],X4e),x;p===u-1?s._loop?x=a[1]:(x=doe,m.subtract(a[u-1],a[u-2],x),m.add(a[u-1],x,x)):x=a[p+1],x=L.multiplyByPoint(n,x,J4e);let b=c[f];p===d+b&&(d+=b,++f);let C=p-d===0,T=p===d+c[f]-1,A=C?2:0,S=T?2:4;for(let v=A;v<S;++v)qn.writeElements(h,e,t),qn.writeElements(g,e,t+6),qn.writeElements(x,e,t+12),t+=6*3}}};var Z4e=new Array(1);Om.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new L6(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=Z4e;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let h=g.length;if(h>0){let x=0;for(let b=0;b<h;++b){let C=g[b]-1;for(let T=0;T<C;++T)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new L6(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new L6(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Om.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var cT={positions:void 0,lengths:void 0},moe=new Array(1),$4e=new m,Q4e=new me;Om.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return moe[0]=n.length,cT.positions=n,cT.lengths=moe,cT;Coe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=$4e;for(let u=0;u<s;++u)a=n[u],c=L.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Q4e)));if(o.length>0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(u.z,u.x,u.y)}return cT.positions=o,cT.lengths=e._segments.lengths,cT};var hoe;Om.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=hoe,c=6*s*3;!l(a)||a.length<c?a=hoe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,h=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=XF,m.subtract(f[0],f[1],x),m.add(f[0],x,x)):x=f[b-1],m.clone(x,qu),m.clone(f[b],cs),b===s-1?t._loop?x=f[1]:(x=XF,m.subtract(f[s-1],f[s-2],x),m.add(f[s-1],x,x)):x=f[b+1],m.clone(x,Yu);let C=d[g];b===h+C&&(h+=C,++g);let T=b-h===0,A=b===h+d[g]-1;o===ne.SCENE2D&&(qu.z=0,cs.z=0,Yu.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(T||A)&&r-Math.abs(cs.x)<1&&((cs.x<0&&qu.x>0||cs.x>0&&qu.x<0)&&m.clone(cs,qu),(cs.x<0&&Yu.x>0||cs.x>0&&Yu.x<0)&&m.clone(cs,Yu));let S=T?2:0,v=A?2:4;for(let I=S;I<v;++I)qn.writeElements(cs,a,p),qn.writeElements(qu,a,p+6),qn.writeElements(Yu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Rm=ed;function fg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Wu({batchTable:e.batchTable}),this._labelCollection=new dp({batchTable:e.batchTable}),this._polylineCollection=new Rm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(fg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function eHe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+oe.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,oe.pack(t,s,a),s}var tHe=new yi("createVectorTilePoints",5),nHe=new m;function iHe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=eHe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=tHe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let h=d[g],x=m.unpack(n,g*3,nHe),b=c.add();b.position=x,b._batchIndex=h;let C=u.add();C.text=" ",C.position=x,C._batchIndex=h;let T=f.add();T.positions=[m.clone(x),m.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}fg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),d=o.get(a);t[c]=new lg(e,c,u,f,d)}};fg.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function oHe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=lg.defaultPointSize,s.color=lg.defaultColor,s.pointOutlineColor=lg.defaultPointOutlineColor,s.pointOutlineWidth=lg.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=jo.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new H(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=_i.CENTER,s.verticalOrigin=Ln.CENTER,s.labelHorizontalOrigin=_i.RIGHT,s.labelVerticalOrigin=Ln.BASELINE}}var rHe=new z,sHe=new z,aHe=new z,cHe=new z,lHe=new z,uHe=new z,Uv=new Rt,Vv=new Rt,k6=new Dt;fg.prototype.applyStyle=function(e,t){if(!l(e)){oHe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,rHe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,sHe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,aHe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,cHe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,lHe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(Uv.near=a.x,Uv.nearValue=a.y,Uv.far=a.z,Uv.farValue=a.w,s.scaleByDistance=Uv):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(Vv.near=a.x,Vv.nearValue=a.y,Vv.far=a.z,Vv.farValue=a.w,s.translucencyByDistance=Vv):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(k6.near=a.x,k6.far=a.y,s.distanceDisplayCondition=k6):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,uHe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};fg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=iHe(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};fg.prototype.isDestroyed=function(){return!1};fg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var KF=fg;function hp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,m.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Hn.BOTH}Object.defineProperties(hp.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function fHe(e){let t=new Float64Array(3+m.packedLength+oe.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,ce.pack(e._rectangle,t,n),t}function dHe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Nn.unpack(t,n),n+=Nn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new jh({color:c,offset:u,count:f,batchIds:p})}}var mHe=new yi("createVectorTilePolygons",5),hHe=new z;function pHe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,h=s.length;for(let x=0;x<h;++x){let b=g.getColor(x,hHe);s[x]=b.toRgba()}a=e._packedBuffer=fHe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=mHe.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(g.packedBuffer),x=h[0];dHe(e,h),e._indices=Ue.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),_He(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function _He(e){l(e._primitive)||(e._primitive=new SC({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}hp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};hp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};hp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};hp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};hp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=pHe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var JF=hp;var ZF=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; -uniform float u_atmosphereLightIntensity; -uniform float u_atmosphereRayleighScaleHeight; -uniform float u_atmosphereMieScaleHeight; -uniform float u_atmosphereMieAnisotropy; -uniform vec3 u_atmosphereRayleighCoefficient; -uniform vec3 u_atmosphereMieCoefficient; +uniform mat4 u_modifiedModelView; -const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. -const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. -const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; -/** - * Rational approximation to tanh(x) -*/ -float approximateTanh(float x) { - float x2 = x * x; - return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); -} + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; -/** - * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as - * the transmittance value for the ray. - * - * @param {czm_ray} primaryRay The ray from the camera to the position. - * @param {float} primaryRayLength The length of the primary ray. - * @param {vec3} lightDirection The direction of the light to calculate the scattering from. - * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. - * @param {vec3} mieColor The variable the Mie scattering will be written to. - * @param {float} opacity The variable the transmittance will be written to. - * @glslFunction - */ -void computeScattering( - czm_ray primaryRay, - float primaryRayLength, - vec3 lightDirection, - float atmosphereInnerRadius, - out vec3 rayleighColor, - out vec3 mieColor, - out float opacity -) { + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; +} +`;function td(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(td.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function gHe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+oe.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,oe.pack(o,a,c),c+=oe.packedLength,m.pack(r,a,c),a}var yHe=new yi("createVectorTilePolylines",5),lT={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function xHe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=gHe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=yHe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),bHe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function bHe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=ht.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),f=ht.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),d=ht.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),h=ht.createIndexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),x=[{index:lT.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:lT.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:lT.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:lT.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:lT.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ai({context:t,attributes:x,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var zv=new L,Toe=new m;function CHe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,zv),L.multiplyByPoint(zv,e._center,Toe),L.setTranslation(zv,Toe,zv),zv},u_highlightColor:function(){return e._highlightColor}})}function THe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:mn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var AHe=`uniform vec4 u_highlightColor; +void main() +{ + out_FragColor = u_highlightColor; +} +`;function EHe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ZF),o=n.getFragmentShaderCallback(!1,void 0,!1)(AHe),r=new We({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Lu,i]}),s=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:lT})}function SHe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ae.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}td.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};td.prototype.getPositions=function(e){return td.getPolylinePositions(this,e)};td.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ks(e,r)}};td.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function vHe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var wHe=new z,IHe=z.WHITE,DHe=!0;td.prototype.applyStyle=function(e,t){if(!l(e)){vHe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,wHe):IHe,s.show=l(e.show)?e.show.evaluate(s):DHe}};td.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=xHe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}CHe(this,t),EHe(this,t),THe(this);let n=e.passes;(n.render||n.pick)&&SHe(this,e)};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var uT=td;var $F=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; - // Initialize the default scattering amounts to 0. - rayleighColor = vec3(0.0); - mieColor = vec3(0.0); - opacity = 0.0; +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; - vec3 origin = vec3(0.0); +void main() +{ + // vertex corner IDs + // 3-----------7 + // /| left /| + // / | 1 / | + // 2-----------6 5 end + // | / | / + // start |/ right |/ + // 0-----------4 + // + float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end + float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - // Calculate intersection from the camera to the outer ring of the atmosphere. - czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); + vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; + vec3 right = normalize(cross(forward, startEllipsoidNormal)); - // Return empty colors if no intersection with the atmosphere geometry. - if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { - return; - } + vec4 position = vec4(startPositionAndHeight.xyz, 1.0); + position.xyz += forward * isEnd; - // To deal with smaller values of PRIMARY_STEPS (e.g. 4) - // we implement a split strategy: sky or horizon. - // For performance reasons, instead of a if/else branch - // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 - float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); - // Value close to 0.0: close to the horizon - // Value close to 1.0: above in the sky - float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); - - // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. - float start_0 = primaryRayAtmosphereIntersect.start; - primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); - // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. - primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); + v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - // For the number of ray steps, distinguish inside or outside atmosphere (outer space) - // (1) from outer space we have to use more ray steps to get a realistic rendering - // (2) within atmosphere we need fewer steps for faster rendering - float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters - float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); - int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. - int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. - float rayPositionLength = primaryRayAtmosphereIntersect.start; - // (1) Outside the atmosphere: constant rayStepLength - // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps - float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; - float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); - float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; - vec3 rayleighAccumulation = vec3(0.0); - vec3 mieAccumulation = vec3(0.0); - vec2 opticalDepth = vec2(0.0); - vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; - // Sample positions on the primary ray. - for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (i >= PRIMARY_STEPS) { - break; - } + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - // Calculate sample position along viewpoint ray. - vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); + gl_Position = czm_depthClamp(czm_projection * position); - // Calculate height of sample position above ellipsoid. - float sampleHeight = length(samplePosition) - atmosphereInnerRadius; + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - // Calculate and accumulate density of particles at the sample position. - vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; - opticalDepth += sampleDensity; + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; +} +`;var QF=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; - // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. - czm_ray lightRay = czm_ray(samplePosition, lightDirection); - czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); +uniform vec4 u_highlightColor; +void main() +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); - float lightPositionLength = 0.0; + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } - vec2 lightOpticalDepth = vec2(0.0); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; - // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. - for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot - // loop with non-constant condition, so it has to break early instead - if (j >= LIGHT_STEPS) { - break; - } + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); - // Calculate sample position along light ray. - vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - // Calculate height of the light sample position above ellipsoid. - float lightHeight = length(lightPosition) - atmosphereInnerRadius; + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - // Calculate density of photons at the light sample position. - lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + out_FragColor = u_highlightColor; - // Increment distance on light ray. - lightPositionLength += lightStepLength; - } + czm_writeDepthClamp(); +} +`;function pp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new H(si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight),this._boundingVolume=Nn.fromRectangle(e.rectangle,si._defaultMinTerrainHeight,si._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(pp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function PHe(e,t,n){let i=si.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Nn.fromRectangle(c,o,r,n,a)}function OHe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+oe.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,oe.pack(o,a,c),c+=oe.packedLength,m.pack(r,a,c),a}var RHe=new yi("createVectorTileClampedPolylines"),dg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function MHe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=OHe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=RHe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),LHe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function LHe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=ht.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),p=ht.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),g=ht.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),h=ht.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),x=ht.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),b=ht.createVertexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW}),C=ht.createVertexBuffer({context:t,typedArray:c,usage:ke.STATIC_DRAW}),T=ht.createIndexBuffer({context:t,typedArray:u,usage:ke.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),A=[{index:dg.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:dg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:dg.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:dg.endPositionAndHeight,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:dg.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:dg.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:dg.a_batchId,vertexBuffer:C,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ai({context:t,attributes:A,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Hv=new L,Aoe=new m;function NHe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,Hv),L.multiplyByPoint(Hv,e._center,Aoe),L.setTranslation(Hv,Aoe,Hv),Hv},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Eoe(e){return Ve.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function FHe(e){l(e._rs)||(e._rs=Eoe(!1),e._rs3DTiles=Eoe(!0))}function BHe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)($F),o=n.getFragmentShaderCallback(!1,void 0,!0)(QF),r=new We({defines:["VECTOR_TILE",Wt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Lu,i]}),s=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:dg})}function kHe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ae.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ae.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Hn.TERRAIN||i===Hn.BOTH)&&t.commandList.push(n),(i===Hn.CESIUM_3D_TILE||i===Hn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}pp.prototype.getPositions=function(e){return uT.getPolylinePositions(this,e)};pp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ks(e,r)}};pp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function UHe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var VHe=new z,zHe=z.WHITE,HHe=!0;pp.prototype.applyStyle=function(e,t){if(!l(e)){UHe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,VHe):zHe,s.show=l(e.show)?e.show.evaluate(s):HHe}};function GHe(e){return si.initialize().then(function(){PHe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}pp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=GHe(this).then(MHe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}NHe(this,t),BHe(this,t),FHe(this);let n=e.passes;(n.render||n.pick)&&kHe(this,e)};pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var e2=pp;var U6=32767,WHe=new me,jHe=new m;function qHe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Yn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=s[f],p=a[f],g=c[f],h=P.lerp(t.west,t.east,d/U6),x=P.lerp(t.south,t.north,p/U6),b=P.lerp(n,i,g/U6),C=me.fromRadians(h,x,b,WHe),T=o.cartographicToCartesian(C,jHe);m.pack(T,u,f*3)}return u}var t2=qHe;function Mm(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r}),ZHe(this,i,o)}Object.defineProperties(Mm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function YHe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function XHe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var nd=Uint32Array.BYTES_PER_ELEMENT;function KHe(e){return new uT(e)}function JHe(e){return new e2(e)}function ZHe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=nd;let r=o.getUint32(n,!0);if(r!==1)throw new de(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=nd;let s=o.getUint32(n,!0);if(n+=nd,s===0){e._ready=!0,e._resolveContent(e);return}let a=o.getUint32(n,!0);if(n+=nd,a===0)throw new de("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=nd;let u=o.getUint32(n,!0);n+=nd;let f=o.getUint32(n,!0);n+=nd;let d=o.getUint32(n,!0);n+=nd;let p=o.getUint32(n,!0);n+=nd;let g=o.getUint32(n,!0);n+=nd;let h=o.getUint32(n,!0);n+=nd;let x=Mo(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let C,T;u>0&&(C=Mo(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let A=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),I=A+S+v,O=new M_(e,I,C,T,YHe(e));if(e._batchTable=O,I===0)return;let R=new Em(x,b),N=R.getGlobalProperty("REGION");if(!l(N))throw new de("Feature table global property: REGION must be defined");let F=ce.unpack(N),_=N[4],E=N[5],w=e._tile.computedTransform,D=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(D)?(D=m.unpack(D),L.multiplyByPoint(w,D,D)):(D=ce.center(F),D.height=P.lerp(_,E,.5),D=oe.WGS84.cartographicToCartesian(D));let M=XHe(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(V))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=B.reduce(function(W,K){return W+K*2},0),G=V.reduce(function(W,K){return W+K},0),k=new Uint32Array(t,n,G);n+=d;let Y=new Uint16Array(t,n,U);n+=p;let j,$;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(j=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),$=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new JF({positions:Y,counts:B,indexCounts:V,indices:k,minimumHeight:_,maximumHeight:E,polygonMinimumHeights:j,polygonMaximumHeights:$,center:D,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:M.polygons,modelMatrix:w})}if(S>0){R.featuresLength=S;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(S);for(let $=0;$<S;++$)V[$]=2}let U=B.reduce(function($,W){return $+W*3},0),G=new Uint16Array(t,n,U);n+=g;let k=e._tileset,Y=k.examineVectorLinesFunction;if(l(Y)){let $=t2(new Uint16Array(G),F,_,E,oe.WGS84);$He($,B,M.polylines,O,e.url,Y)}let j=KHe;l(k.classificationType)&&(j=JHe),e._polylines=j({positions:G,widths:V,counts:B,batchIds:M.polylines,minimumHeight:_,maximumHeight:E,center:D,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=h,e._points=new KF({positions:B,batchIds:M.points,minimumHeight:_,maximumHeight:E,rectangle:F,batchTable:O})}}function V6(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Mm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Mm.prototype.getFeature=function(e){return l(this._features)||V6(this),this._features[e]};Mm.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Mm.prototype.applyStyle=function(e){l(this._features)||V6(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Mm.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||V6(this),this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Mm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function $He(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var n2=Mm;var Soe={b3dm:function(e,t,n,i,o){return lp.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return lp.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return lp.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return WM.fromTileType(e,t,n,i,o,Soe)},externalTileset:function(e,t,n,i){return FF.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new $M(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new n2(e,t,n,i,o)},subt:function(e,t,n,i,o){return lv.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return lv.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new de("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return lp.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return lp.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return lp.fromGeoJson(e,t,n,i)}},fT=Soe;var QHe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},qo=Object.freeze(QHe);var id={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};id.isBinaryFormat=function(e){switch(e){case id.BATCHED_3D_MODEL:case id.INSTANCED_3D_MODEL:case id.COMPOSITE:case id.POINT_CLOUD:case id.VECTOR:case id.GEOMETRY:case id.IMPLICIT_SUBTREE:case id.VOXEL_BINARY:case id.GLTF_BINARY:return!0;default:return!1}};var Es=Object.freeze(id);var eGe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},od=Object.freeze(eGe);var Ss={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},_p=new Array(Ss.NUMBER_OF_PASSES);_p[Ss.RENDER]=Object.freeze({pass:Ss.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});_p[Ss.PICK]=Object.freeze({pass:Ss.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_p[Ss.SHADOW]=Object.freeze({pass:Ss.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});_p[Ss.PRELOAD]=Object.freeze({pass:Ss.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Ss.PRELOAD_FLIGHT]=Object.freeze({pass:Ss.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Ss.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ss.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Ss.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ss.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_p[Ss.MOST_DETAILED_PICK]=Object.freeze({pass:Ss.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ss.getPassOptions=function(e){return _p[e]};var Fo=Object.freeze(Ss);function gp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(gp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},readyPromise:{get:function(){return Q("Empty3DTileContent.readyPromise","Empty3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Empty3DTileContent.ready to return true instead."),Promise.resolve(this)}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});gp.prototype.hasProperty=function(e,t){return!1};gp.prototype.getFeature=function(e){};gp.prototype.applyDebugSettings=function(e,t){};gp.prototype.applyStyle=function(e){};gp.prototype.update=function(e,t){};gp.prototype.isDestroyed=function(){return!1};gp.prototype.destroy=function(){return ue(this)};var Gv=gp;function yp(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(yp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yp.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};yp.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};yp.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};yp.prototype.getProperty=function(e){return Vn.getProperty(e,this._properties,this._class)};yp.prototype.setProperty=function(e,t){return Vn.setProperty(e,t,this._properties,this._class)};yp.prototype.getPropertyBySemantic=function(e){return Vn.getPropertyBySemantic(e,this._properties,this._class)};yp.prototype.setPropertyBySemantic=function(e,t){return Vn.setPropertyBySemantic(e,t,this._properties,this._class)};var i2=yp;function z6(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){z6._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new i2({content:n,class:o})}}z6._oneTimeWarning=Nt;var dT=z6;function tGe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var mT=tGe;function xp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(xp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xp.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};xp.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};xp.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};xp.prototype.getProperty=function(e){return Vn.getProperty(e,this._properties,this._class)};xp.prototype.setProperty=function(e,t){return Vn.setProperty(e,t,this._properties,this._class)};xp.prototype.getPropertyBySemantic=function(e){return Vn.getPropertyBySemantic(e,this._properties,this._class)};xp.prototype.setPropertyBySemantic=function(e,t){return Vn.setPropertyBySemantic(e,t,this._properties,this._class)};var o2=xp;function H6(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){H6._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new o2({tile:n,class:o})}}H6._oneTimeWarning=Nt;var r2=H6;function nGe(e){let t=new Uint8Array(e),n=ym(t);if(n==="glTF"&&(n="glb"),Es.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=iGe(t);if(l(i.root))return{contentType:Es.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Es.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Es.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Es.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Es.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function iGe(e){let t;try{t=Mo(e)}catch{throw new de("Invalid tile content.")}return t}var bp=nGe;function rd(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(s=>{this._resolveContent=s}),this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=cc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(rd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},readyPromise:{get:function(){return Q("Multiple3DTileContent.readyPromise","Multiple3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Multiple3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function G6(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function voe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}rd.prototype.requestInnerContents=function(){if(!oGe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;G6(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=rGe(this,n,t,this._tile._contentState);return sGe(this)};function oGe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!cc.serverHasOpenSlots(n,t[n]))return!1;return cc.heapHasOpenSlots(e.length)}function rGe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Qo({throttle:!0,throttleByServer:!0,type:os.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===ni.CANCELLED){voe(e,i);return}return G6(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===ni.CANCELLED){voe(e,i);return}G6(e,-1),woe(e,t,f)}})}async function sGe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>aGe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function aGe(e,t,n){if(l(t))try{let i=bp(t);if(i.contentType===Es.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Es.GEOMETRY||i.contentType===Es.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=fT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=dT(o,u));let f=mT(o,u);return l(f)&&(a.group=new AC({metadata:f})),a}catch(i){woe(e,n,i)}}function woe(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}rd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};rd.prototype.hasProperty=function(e,t){return!1};rd.prototype.getFeature=function(e){};rd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};rd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};rd.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0,this._resolveContent(this))};rd.prototype.isDestroyed=function(){return!1};rd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var s2=rd;var Foe=ur(Roe(),1);var AGe=new m,EGe=new m,mg={};mg.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};mg.computeWindingOrder2D=function(e){return mg.computeArea2D(e)>0?rs.COUNTER_CLOCKWISE:rs.CLOCKWISE};mg.triangulate=function(e,t){let n=H.packArray(e);return(0,Foe.default)(n,t,2)};var Boe=new m,koe=new m,Uoe=new m,Moe=new m,Loe=new m,Noe=new m,Cp=new m,Voe=new H,zoe=new H,Hoe=new H,pT=new H;mg.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let A=t[a];if(u[d++]=A.x,u[d++]=A.y,u[d++]=A.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],h={},x=e.maximumRadius,b=P.chordLength(o,x),C=b*b;for(;s.length>0;){let A=s.pop(),S=s.pop(),v=s.pop(),I=m.fromArray(u,v*3,Boe),O=m.fromArray(u,S*3,koe),R=m.fromArray(u,A*3,Uoe),N,F,_;r&&(N=H.fromArray(f,v*2,Voe),F=H.fromArray(f,S*2,zoe),_=H.fromArray(f,A*2,Hoe));let E=m.multiplyByScalar(m.normalize(I,Moe),x,Moe),w=m.multiplyByScalar(m.normalize(O,Loe),x,Loe),D=m.multiplyByScalar(m.normalize(R,Noe),x,Noe),M=m.magnitudeSquared(m.subtract(E,w,Cp)),B=m.magnitudeSquared(m.subtract(w,D,Cp)),V=m.magnitudeSquared(m.subtract(D,E,Cp)),U=Math.max(M,B,V),G,k,Y;U>C?M===U?(G=`${Math.min(v,S)} ${Math.max(v,S)}`,a=h[G],l(a)||(k=m.add(I,O,Cp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(N,F,pT),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(v,a,A),s.push(a,S,A)):B===U?(G=`${Math.min(S,A)} ${Math.max(S,A)}`,a=h[G],l(a)||(k=m.add(O,R,Cp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(F,_,pT),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(S,a,v),s.push(a,A,v)):V===U&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=h[G],l(a)||(k=m.add(R,I,Cp),m.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,h[G]=a,r&&(Y=H.add(_,N,pT),H.multiplyByScalar(Y,.5,Y),f.push(Y.x,Y.y))),s.push(A,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(A))}let T={attributes:{position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(T.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(T)};var SGe=new me,vGe=new me,wGe=new me,X6=new me;mg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,r){let I=i[a];f[p++]=I.x,f[p++]=I.y}}let g=[],h={},x=e.maximumRadius,b=P.chordLength(o,x),C=new Na(void 0,void 0,e),T=new Na(void 0,void 0,e),A=new Na(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),I=s.pop(),O=s.pop(),R=m.fromArray(u,O*3,Boe),N=m.fromArray(u,I*3,koe),F=m.fromArray(u,v*3,Uoe),_,E,w;r&&(_=H.fromArray(f,O*2,Voe),E=H.fromArray(f,I*2,zoe),w=H.fromArray(f,v*2,Hoe));let D=e.cartesianToCartographic(R,SGe),M=e.cartesianToCartographic(N,vGe),B=e.cartesianToCartographic(F,wGe);C.setEndPoints(D,M);let V=C.surfaceDistance;T.setEndPoints(M,B);let U=T.surfaceDistance;A.setEndPoints(B,D);let G=A.surfaceDistance,k=Math.max(V,U,G),Y,j,$,W,K;k>b?V===k?(Y=`${Math.min(O,I)} ${Math.max(O,I)}`,a=h[Y],l(a)||(j=C.interpolateUsingFraction(.5,X6),$=(D.height+M.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(_,E,pT),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,I,v)):U===k?(Y=`${Math.min(I,v)} ${Math.max(I,v)}`,a=h[Y],l(a)||(j=T.interpolateUsingFraction(.5,X6),$=(M.height+B.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(E,w,pT),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(I,a,O),s.push(a,v,O)):G===k&&(Y=`${Math.min(v,O)} ${Math.max(v,O)}`,a=h[Y],l(a)||(j=A.interpolateUsingFraction(.5,X6),$=(B.height+D.height)*.5,W=m.fromRadians(j.longitude,j.latitude,$,e,Cp),u.push(W.x,W.y,W.z),a=u.length/3-1,h[Y]=a,r&&(K=H.add(w,_,pT),H.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,I),s.push(a,O,I)):(g.push(O),g.push(I),g.push(v))}let S={attributes:{position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(S.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new dt(S)};mg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,oe.WGS84);let o=AGe,r=EGe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),m.multiplyByScalar(o,t,o),m.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var fi=mg;var Goe=Math.cos,Woe=Math.sin,IGe=Math.sqrt,J6={};J6.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=Goe(f),p=Woe(f),g=a.z*p,h=c.longitude+i*e.granYSin+o*e.granXCos,x=d*Goe(h),b=d*Woe(h),C=a.x*x,T=a.y*b,A=IGe(C*x+T*b+g*p);if(r.x=C/A,r.y=T/A,r.z=g/A,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,h=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(h-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var DGe=new no,Xu=new m,PGe=new me,f2=new m,K6=new Di;function joe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;Xu=K6.project(e,Xu),Xu=m.subtract(Xu,f2,Xu);let g=no.fromRotation(t,DGe);Xu=no.multiplyByVector(g,Xu,Xu),Xu=m.add(Xu,f2,Xu),e=K6.unproject(Xu,e),r-=1,s-=1;let h=e.latitude,x=h+r*p,b=h-c*s,C=h-c*s+r*p,T=Math.max(h,x,b,C),A=Math.min(h,x,b,C),S=e.longitude,v=S+r*u,I=S+s*d,O=S+s*d+r*u,R=Math.max(S,v,I,O),N=Math.min(S,v,I,O);return{north:T,south:A,east:R,west:N,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}J6.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,h=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,b=Math.ceil(h/t)+1,C=g/(x-1),T=h/(b-1),A=ce.northwest(e,r),S=ce.center(e,PGe);(n!==0||i!==0)&&(S.longitude<A.longitude&&(S.longitude+=P.TWO_PI),f2=K6.project(S,f2));let v=T,I=C,O=0,R=0,N=ce.clone(e,o),F={granYCos:v,granYSin:O,granXCos:I,granXSin:R,nwCorner:A,boundingRectangle:N,width:x,height:b,northCap:d,southCap:p};if(n!==0){let _=joe(A,n,C,T,S,x,b);u=_.north,f=_.south,a=_.east,c=_.west,F.granYCos=_.granYCos,F.granYSin=_.granYSin,F.granXCos=_.granXCos,F.granXSin=_.granXSin,N.north=u,N.south=f,N.east=a,N.west=c}if(i!==0){n=n-i;let _=ce.northwest(N,s),E=joe(_,n,C,T,S,x,b);F.stGranYCos=E.granYCos,F.stGranXCos=E.granXCos,F.stGranYSin=E.granYSin,F.stGranXSin=E.granXSin,F.stNwCorner=_,F.stWest=E.west,F.stSouth=E.south}return F};var vs=J6;var OGe=new ae,RGe=new ae,MGe=new m,LGe=new ce;function qoe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let d=new Float64Array(u*3),p=0,g=0,h,x=MGe;if(r)vs.computePosition(t,n,!1,g,0,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;else for(h=0;h<o;h++)vs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(h=o-1,g=1;g<i;g++)vs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;if(g=i-1,!s)for(h=o-2;h>=0;h--)vs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(h=0,g=i-2;g>0;g--)vs.computePosition(t,n,!1,g,h,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let b=d.length/3*2,C=Ue.createTypedArray(d.length/3,b),T=0;for(let S=0;S<d.length/3-1;S++)C[T++]=S,C[T++]=S+1;C[T++]=d.length/3-1,C[T++]=0;let A=new dt({attributes:new gn,primitiveType:Fe.LINES});return A.attributes.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),A.indices=C,A}function NGe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=i,s=n,a=qoe(e,t),c=t.height,u=t.width,f=fi.scaleToGeodeticHeight(a.attributes.position.values,s,o,!1),d=f.length,p=new Float64Array(d*2);p.set(f);let g=fi.scaleToGeodeticHeight(a.attributes.position.values,r,o);p.set(g,d),a.attributes.position.values=p;let h=t.northCap,x=t.southCap,b=4;h&&(b-=1),x&&(b-=1);let C=(p.length/3+b)*2,T=Ue.createTypedArray(p.length/3,C);d=p.length/6;let A=0;for(let v=0;v<d-1;v++)T[A++]=v,T[A++]=v+1,T[A++]=v+d,T[A++]=v+d+1;T[A++]=d-1,T[A++]=0,T[A++]=d+d-1,T[A++]=d,T[A++]=0,T[A++]=d;let S;if(h)S=c-1;else{let v=u-1;T[A++]=v,T[A++]=v+d,S=u+c-2}if(T[A++]=S,T[A++]=S+d,!x){let v=u+S-1;T[A++]=v,T[A]=v+d}return a.indices=T,a}function gT(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,oe.WGS84),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}gT.packedLength=ce.packedLength+oe.packedLength+5;gT.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Yoe=new ce,Xoe=oe.clone(oe.UNIT_SPHERE),_T={rectangle:Yoe,ellipsoid:Xoe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};gT.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,Yoe);t+=ce.packedLength;let o=oe.unpack(e,t,Xoe);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=oe.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(_T.granularity=r,_T.height=s,_T.rotation=a,_T.extrudedHeight=c,_T.offsetAttribute=u===-1?void 0:u,new gT(_T))};var FGe=new me;gT.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=vs.computeOptions(t,e._granularity,e._rotation,0,LGe,FGe),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=NGe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===an.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===an.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,RGe),d=ae.fromRectangle3D(t,n,a,OGe);r=ae.union(f,d)}else{if(o=qoe(e,i),o.attributes.position.values=fi.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===an.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=ae.fromRectangle3D(t,n,s)}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Fe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var yT=gT;function bT(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=y(e.ellipsoid,oe.WGS84);zGe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(bT.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});bT.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Nn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var Koe=new m,d2=new m,Joe=new m,BGe=new m,kGe=new m,UGe=new m,VGe=new m,Ku=new me,Zoe=new dn(m.UNIT_X,0),xT=new In;function zGe(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Ku.longitude=t.west,Ku.latitude=(t.south+t.north)*.5,Ku.height=0;let i=n.cartographicToCartesian(Ku,UGe),o=m.cross(i,m.UNIT_Z,BGe);m.normalize(o,e.westNormal),Ku.longitude=t.east;let r=n.cartographicToCartesian(Ku,VGe),s=m.cross(m.UNIT_Z,r,Koe);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,Koe);m.magnitude(a)===0&&(a=m.clone(o,a));let c=m.normalize(a,kGe),u=t.south,f;if(u>0){Ku.longitude=(t.west+t.east)*.5,Ku.latitude=u;let x=n.cartographicToCartesian(Ku,xT.origin);m.clone(c,xT.direction);let b=dn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Zoe);$i.rayPlane(xT,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,d2)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),d2);let d=m.cross(f,a,Joe);m.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Ku.longitude=(t.west+t.east)*.5,Ku.latitude=p;let x=n.cartographicToCartesian(Ku,xT.origin);m.negate(c,xT.direction);let b=dn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Zoe);$i.rayPlane(xT,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,d2)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),d2);let h=m.cross(a,g,Joe);m.normalize(h,e.northNormal)}var HGe=new m,GGe=new m,WGe=new m(0,-1,0),jGe=new m(0,0,-1),$oe=new m;function qGe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,h=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),HGe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),GGe),f.z=f.y,f.y=f.x,f.x=0,d=WGe,g=m.UNIT_Y,p=jGe,h=m.UNIT_Z);let x=m.subtract(i,u,$oe),b=m.dot(x,d),C=m.dot(x,p),T=m.subtract(i,f,$oe),A=m.dot(T,g),S=m.dot(T,h);b>0?r+=b*b:A>0&&(r+=A*A),C>0?r+=C*C:S>0&&(r+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}bT.prototype.distanceToCamera=function(e){let t=qGe(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};bT.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};bT.prototype.createDebugVolume=function(e){let t=new L.clone(L.IDENTITY),n=new yT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Tt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var sd=bT;var Yv={},YGe=new m,Qoe=new m,ere=new m,tre=new m,nre=new Nn;Yv.validOutline=function(e){let n=Nn.fromPoints(e,nre).halfAxes,i=Z.getColumn(n,0,Qoe),o=Z.getColumn(n,1,ere),r=Z.getColumn(n,2,tre),s=m.magnitude(i),a=m.magnitude(o),c=m.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};Yv.computeProjectTo2DArguments=function(e,t,n,i){let o=Nn.fromPoints(e,nre),r=o.halfAxes,s=Z.getColumn(r,0,Qoe),a=Z.getColumn(r,1,ere),c=Z.getColumn(r,2,tre),u=m.magnitude(s),f=m.magnitude(a),d=m.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,h;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(h=a),(p===u||p===f)&&(h=c),m.normalize(g,n),m.normalize(h,i),m.clone(o.center,t),!0};function ire(e,t,n,i,o){let r=m.subtract(e,t,YGe),s=m.dot(n,r),a=m.dot(i,r);return H.fromElements(s,a,o)}Yv.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=ire(i[r],e,t,n);return o}};Yv.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return ire(i,e,t,n,o)}};var hg=Yv;function pg(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(pg.prototype,{length:{get:function(){return this._length}}});pg.prototype.enqueue=function(e){this._array.push(e),this._length++};pg.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};pg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};pg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};pg.prototype.clear=function(){this._array.length=this._offset=this._length=0};pg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var H0=pg;var or={};or.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};or.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};or.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=or.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var G0=new H;function are(e,t,n,i){return H.subtract(t,e,G0),H.multiplyByScalar(G0,n/i,G0),H.add(e,G0,G0),[G0.x,G0.y]}var _g=new m;function XGe(e,t,n,i){return m.subtract(t,e,_g),m.multiplyByScalar(_g,n/i,_g),m.add(e,_g,_g),[_g.x,_g.y,_g.z]}or.subdivideLineCount=function(e,t,n){let o=m.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var Z6=new me,$6=new me,KGe=new me,JGe=new m,ore=new Na;or.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,Z6),r=e.cartesianToCartographic(n,$6),a=new Na(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};or.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=or.subdivideLineCount(n,i,o),a=H.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=are(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};or.subdivideLine=function(e,t,n,i){let o=or.subdivideLineCount(e,t,n),r=m.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=XGe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};or.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,Z6),c=n.cartesianToCartographic(o,$6);ore.setEndPoints(a,c);let u=ore.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=H.distance(e,t),g=p/d,h=s;h.length=d*2;let x=0;for(let b=0;b<d;b++){let C=are(e,t,b*g,p);h[x++]=C[0],h[x++]=C[1]}return h};or.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,Z6),s=e.cartesianToCartographic(n,$6),a=new Na(r,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(o)||(o=[]);let p=o;p.length=f*3;let g=0;for(let h=0;h<f;h++){let x=a.interpolateUsingSurfaceDistance(h*d,KGe),b=e.cartographicToCartesian(x,JGe);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var ZGe=new m,$Ge=new m,QGe=new m,e8e=new m;or.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,oe.WGS84);let r=ZGe,s=$Ge,a=QGe,c=e8e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)m.fromArray(u,d,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(r,n,s),s=m.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,o&&(c=m.clone(a,c)),s=m.multiplyByScalar(r,t,s),s=m.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};or.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new H0;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Ao(u,m.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Ao(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)o.enqueue(d.holes[s])}i.push(u)}return i};or.polygonsFromHierarchy=function(e,t,n,i,o){let r=[],s=[],a=new H0;for(a.enqueue(e);a.length!==0;){let c=a.dequeue(),u=c.positions,f=c.holes,d,p;if(i)for(p=u.length,d=0;d<p;d++)o.scaleToGeodeticSurface(u[d],u[d]);if(t||(u=Ao(u,m.equalsEpsilon,!0)),u.length<3)continue;let g=n(u);if(!l(g))continue;let h=[],x=fi.computeWindingOrder2D(g);x===rs.CLOCKWISE&&(g.reverse(),u=u.slice().reverse());let b=u.slice(),C=l(f)?f.length:0,T=[],A;for(d=0;d<C;d++){let S=f[d],v=S.positions;if(i)for(p=v.length,A=0;A<p;++A)o.scaleToGeodeticSurface(v[A],v[A]);if(t||(v=Ao(v,m.equalsEpsilon,!0)),v.length<3)continue;let I=n(v);if(!l(I))continue;x=fi.computeWindingOrder2D(I),x===rs.CLOCKWISE&&(I.reverse(),v=v.slice().reverse()),T.push(v),h.push(b.length),b=b.concat(v),g=g.concat(I);let O=0;for(l(S.holes)&&(O=S.holes.length),A=0;A<O;A++)a.enqueue(S.holes[A])}r.push({outerRing:u,holes:T}),s.push({positions:b,positions2D:g,holes:h})}return{hierarchy:r,polygons:s}};var t8e=new H,n8e=new m,i8e=new Be,o8e=new Z;or.computeBoundingRectangle=function(e,t,n,i,o){let r=Be.fromAxisAngle(e,i,i8e),s=Z.fromQuaternion(r,o8e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=m.clone(n[p],n8e);Z.multiplyByVector(s,g,g);let h=t(g,t8e);l(h)&&(a=Math.min(a,h.x),c=Math.max(c,h.x),u=Math.min(u,h.y),f=Math.max(f,h.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};or.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=fi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),g=0;for(let b=0;b<d;b++){let C=c[b];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let h={attributes:{position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Fe.TRIANGLES};u&&(h.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H.packArray(f)}));let x=new dt(h);return r.normal?Un.computeNormal(x):x}if(s===Qt.GEODESIC)return fi.computeSubdivision(e,c,a,f,i);if(s===Qt.RHUMB)return fi.computeRhumbLineSubdivision(e,c,a,f,i)};var rre=[],sre=[],r8e=new m,s8e=new m;or.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,d,p,g,h,x=e.length,b=0,C=0,T=l(t),A=T?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),T&&(h=x*2*2,g=new Array(h*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,T&&(d=A[c],p=A[(c+1)%x],g[C]=g[C+h]=d.x,++C,g[C]=g[C+h]=d.y,++C,g[C]=g[C+h]=p.x,++C,g[C]=g[C+h]=p.y,++C);else{let R=P.chordLength(i,n.maximumRadius),N=0;if(r===Qt.GEODESIC)for(c=0;c<x;c++)N+=or.subdivideLineCount(e[c],e[(c+1)%x],R);else if(r===Qt.RHUMB)for(c=0;c<x;c++)N+=or.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(N+x)*3,s=new Array(a*2),T&&(h=(N+x)*2,g=new Array(h*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let F,_;T&&(d=A[c],p=A[(c+1)%x]),r===Qt.GEODESIC?(F=or.subdivideLine(u,f,R,sre),T&&(_=or.subdivideTexcoordLine(d,p,u,f,R,rre))):r===Qt.RHUMB&&(F=or.subdivideRhumbLine(n,u,f,R,sre),T&&(_=or.subdivideTexcoordRhumbLine(d,p,n,u,f,R,rre)));let E=F.length;for(let w=0;w<E;++w,++b)s[b]=F[w],s[b+a]=F[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,T){let w=_.length;for(let D=0;D<w;++D,++C)g[C]=_[D],g[C+h]=_[D];g[C]=p.x,g[C+h]=p.x,++C,g[C]=p.y,g[C+h]=p.y,++C}}}x=s.length;let S=Ue.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,N=R+1,F=R+x,_=F+1;u=m.fromArray(s,R*3,r8e),f=m.fromArray(s,N*3,s8e),!m.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(S[v++]=R,S[v++]=F,S[v++]=N,S[v++]=N,S[v++]=F,S[v++]=_)}let I={attributes:new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Fe.TRIANGLES};return T&&(I.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new dt(I)};var Xn=or;function a8e(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:Fe.LINES})}function W0(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+1}W0.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new W0(t)};W0.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var c8e={polygonHierarchy:{}};W0.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new W0(c8e)),n._polygonHierarchy=i,n.packedLength=o,n};W0.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Ao(n,m.equalsEpsilon,!0),n.length<3||!hg.validOutline(n))return;let o=Xn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Tt({geometry:a8e(o[c])});r.push(u)}let s=Un.combineInstances(r)[0],a=ae.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var ad=W0;var m2=new me;function Xv(e){let t=V_.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,oe.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=g8e(t,n,i,o);this._boundingPlanes=r;let s=C8e(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=s9(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=s9(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=s9(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();m2=o.cartesianToCartographic(c,m2),m2.height=(i+n)/2,this.center=o.cartographicToCartesian(m2,c),this._boundingSphere=ae.fromPoints(s)}var l8e=new m,u8e=new me,f8e=new m,d8e=new me,m8e=new m,h8e=new m,p8e=new m,_8e=new m;function g8e(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,l8e),a=i.cartesianToCartographic(r,u8e);a.height=n;let c=i.cartographicToCartesian(a,f8e),u=dn.fromPointNormal(c,s);o[0]=u;let f=0,d,p=[],g,h;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,h=i.cartesianToCartographic(g,d8e),h.height=t;let b=dn.getPointDistance(u,i.cartographicToCartesian(h,m8e));b<f&&(f=b)}let x=dn.clone(u);for(x.normal=m.negate(x.normal,x.normal),x.distance=x.distance*-1+f,o[1]=x,d=0;d<4;d++){g=p[d];let b=p[(d+1)%4],C=i.geodeticSurfaceNormal(g,h8e),T=m.subtract(b,g,_8e),A=m.cross(T,C,p8e);A=m.normalize(A,A),o[2+d]=dn.fromPointNormal(g,A)}return o}var j0=new m,q0=new m,Y0=new m,Q6=new m,e9=new m,t9=new m,y8e=new m,x8e=new m,b8e=new m,n9=new m,i9=new m,o9=new m,gg=new m,Lm=new Z;function cre(e,t,n){j0=e.normal,q0=t.normal,Y0=n.normal,Q6=m.multiplyByScalar(e.normal,-e.distance,Q6),e9=m.multiplyByScalar(t.normal,-t.distance,e9),t9=m.multiplyByScalar(n.normal,-n.distance,t9),n9=m.multiplyByScalar(m.cross(q0,Y0,y8e),m.dot(Q6,j0),n9),i9=m.multiplyByScalar(m.cross(Y0,j0,x8e),m.dot(e9,q0),i9),o9=m.multiplyByScalar(m.cross(j0,q0,b8e),m.dot(t9,Y0),o9),Lm[0]=j0.x,Lm[1]=q0.x,Lm[2]=Y0.x,Lm[3]=j0.y,Lm[4]=q0.y,Lm[5]=Y0.y,Lm[6]=j0.z,Lm[7]=q0.z,Lm[8]=Y0.z;let i=Z.determinant(Lm);return gg=m.add(n9,i9,gg),gg=m.add(gg,o9,gg),new m(gg.x/i,gg.y/i,gg.z/i)}function C8e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=cre(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=cre(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var r9=new m,CT=new m;function s9(e,t){let n=[];for(let i=0;i<4;i++)r9=m.subtract(t[(i+1)%4],t[i],r9),CT=m.cross(e.normal,r9,CT),CT=m.normalize(CT,CT),n[i]=m.clone(CT);return n}Object.defineProperties(Xv.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var a9=new m;Xv.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;dn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):dn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,dn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=c9(dn.projectPointOntoPlane(c,t,a9),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=lre(t,p[0],p[1]),m.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=c9(dn.projectPointOntoPlane(c,t,a9),i[r],c,this._edgeNormals[n[r]]),d=m.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=c9(dn.projectPointOntoPlane(this._boundingPlanes[1],t,a9),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+u)%4]):m.distance(t,this._vertices[4+(n[1]-2+u)%4])};var T8e=new m,A8e=new m;function lre(e,t,n){let i=m.subtract(n,t,T8e),o=m.subtract(e,t,A8e),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var E8e=new dn(m.UNIT_X,0);function c9(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=dn.fromPointNormal(t[c],i[c],E8e);dn.getPointDistance(u,e)<0||(a=lre(e,t[c],t[(c+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}Xv.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?tn.INSIDE:n===this._vertices.length?tn.OUTSIDE:tn.INTERSECTING};Xv.prototype.createDebugVolume=function(e){let t=new L.clone(L.IDENTITY),n=new ad({polygonHierarchy:{positions:this._planeVertices[0]}}),i=ad.createGeometry(n),o=new Tt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}}),r=new ad({polygonHierarchy:{positions:this._planeVertices[1]}}),s=ad.createGeometry(r),a=new Tt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new ad({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=ad.createGeometry(f);c[u]=new Tt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}})}return new Dn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var h2=Xv;var S8e=new m(1,1,1),p2=Math.cos,_2=Math.sin;function TT(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,S8e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}TT.packedLength=2*m.packedLength+8;TT.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var ure=new m,fre=new m,Tp={radii:ure,innerRadii:fre,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};TT.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,ure);t+=m.packedLength;let o=m.unpack(e,t,fre);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(Tp.minimumClock=r,Tp.maximumClock=s,Tp.minimumCone=a,Tp.maximumCone=c,Tp.stackPartitions=u,Tp.slicePartitions=f,Tp.subdivisions=d,Tp.offsetAttribute=p===-1?void 0:p,new TT(Tp))};TT.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=oe.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,x=!1;g&&(p=2,r>0&&(h=!0,d+=u),s<Math.PI&&(x=!0,d+=u));let b=a*p*(f+u),C=new Float64Array(b*3),T=2*(b+d-(u+f)*p),A=Ue.createTypedArray(b,T),S,v,I,O,R=0,N=new Array(f),F=new Array(f);for(S=0;S<f;S++)O=r+S*(s-r)/(f-1),N[S]=_2(O),F[S]=p2(O);let _=new Array(a),E=new Array(a);for(S=0;S<a;S++)I=i+S*(o-i)/(a-1),_[S]=_2(I),E[S]=p2(I);for(S=0;S<f;S++)for(v=0;v<a;v++)C[R++]=t.x*N[S]*E[v],C[R++]=t.y*N[S]*_[v],C[R++]=t.z*F[S];if(g)for(S=0;S<f;S++)for(v=0;v<a;v++)C[R++]=n.x*N[S]*E[v],C[R++]=n.y*N[S]*_[v],C[R++]=n.z*F[S];for(N.length=a,F.length=a,S=0;S<a;S++)O=r+S*(s-r)/(a-1),N[S]=_2(O),F[S]=p2(O);for(_.length=u,E.length=u,S=0;S<u;S++)I=i+S*(o-i)/(u-1),_[S]=_2(I),E[S]=p2(I);for(S=0;S<a;S++)for(v=0;v<u;v++)C[R++]=t.x*N[S]*E[v],C[R++]=t.y*N[S]*_[v],C[R++]=t.z*F[S];if(g)for(S=0;S<a;S++)for(v=0;v<u;v++)C[R++]=n.x*N[S]*E[v],C[R++]=n.y*N[S]*_[v],C[R++]=n.z*F[S];for(R=0,S=0;S<f*p;S++){let M=S*a;for(v=0;v<a-1;v++)A[R++]=M+v,A[R++]=M+v+1}let w=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(g)for(w=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(g){let M=f*a*p,B=M+a*u;if(h)for(S=0;S<u;S++)A[R++]=M+S,A[R++]=B+S;if(x)for(M+=a*u-u,B+=a*u-u,S=0;S<u;S++)A[R++]=M+S,A[R++]=B+S}let D=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let M=C.length,B=e._offsetAttribute===an.NONE?0:1,V=new Uint8Array(M/3).fill(B);D.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new dt({attributes:D,indices:A,primitiveType:Fe.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Ju=TT;function AT(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Ju(i),this._workerName="createSphereOutlineGeometry"}AT.packedLength=Ju.packedLength;AT.pack=function(e,t,n){return Ju.pack(e._ellipsoidGeometry,t,n)};var v8e=new Ju,X0={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};AT.unpack=function(e,t,n){let i=Ju.unpack(e,t,v8e);return X0.stackPartitions=i._stackPartitions,X0.slicePartitions=i._slicePartitions,X0.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,X0.radii),n._ellipsoidGeometry=new Ju(X0),n):(X0.radius=i._radii.x,new AT(X0))};AT.createGeometry=function(e){return Ju.createGeometry(e._ellipsoidGeometry)};var yg=AT;function ET(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(ET.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});ET.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};ET.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};ET.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};ET.prototype.createDebugVolume=function(e){let t=new yg({radius:this.radius}),n=L.fromTranslation(this.center,new L.clone(L.IDENTITY)),i=new Tt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ht.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var xg=ET;var w8e=new m,I8e=new m,D8e=new m,P8e=new m;function K0(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,P.EPSILON7/i,n)}function l9(e,t){let n=m.normalize(e,P8e),i=m.equalsEpsilon(n,m.UNIT_X,P.EPSILON6)?m.UNIT_Y:m.UNIT_X;return K0(e,i,t)}function dre(e){let t=Z.getColumn(e,0,w8e),n=Z.getColumn(e,1,I8e),i=Z.getColumn(e,2,D8e),o=m.equals(t,m.ZERO),r=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=K0(n,i,t):!o&&r&&!s?n=K0(t,i,n):!o&&!r&&s?i=K0(n,t,i):o?r?s||(t=l9(i,t),n=K0(i,t,n)):(t=l9(n,t),i=K0(n,t,i)):(n=l9(t,n),i=K0(n,t,i)),Z.setColumn(e,0,t,e),Z.setColumn(e,1,n,e),Z.setColumn(e,2,i,e),e)}function ST(e,t){t=dre(t),this._orientedBoundingBox=new Nn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(ST.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});ST.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};ST.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};ST.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=dre(t),Z.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};ST.prototype.createDebugVolume=function(e){let t=new tm({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=L.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Tt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ht.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var cd=ST;function Yo(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ii(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?L.unpack(n.transform):L.clone(L.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=L.multiply(a,this.transform,new L),u=l(i)?i._initialTransform:L.IDENTITY;this._initialTransform=L.multiply(u,this.transform,new L),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Yo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Yo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Wo.REPLACE:Wo.ADD):l(i)?p=i.refine:p=Wo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,h=!1,x,b,C;if(t=ve.createIfNeeded(t),r)x=qo.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(Yo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Yo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new Gv(e,this),h=!0,x=qo.READY):(x=qo.UNLOADED,b=t.getDerivedResource({url:v}),C=cc.getServerKey(b.getUrlComponent()))}else g=new Gv(e,this),h=!0,x=qo.READY;this._content=g,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.metadata=r2(e,n),this.cacheNode=void 0;let T=n.expire,A,S;l(T)&&(A=T.duration,l(T.date)&&(S=ee.fromIso8601(T.date))),this.expireDuration=A,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=od.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Yo._deprecationWarning=Q;Object.defineProperties(Yo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===qo.READY}},contentUnloaded:{get:function(){return this._contentState===qo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===qo.EXPIRED}},contentFailed:{get:function(){return this._contentState===qo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var bg=new m;function O8e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,bg),c=m.add(s.positionWC,a,bg),u=m.subtract(c,r,bg);if(m.magnitude(u)>o){let S=m.normalize(u,bg),v=m.multiplyByScalar(S,o,bg),I=m.add(r,v,bg),O=m.subtract(I,s.positionWC,bg),R=m.normalize(O,bg);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Wo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Fo.PRELOAD_FLIGHT||n._pass===Fo.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*h;if(e._foveatedFactor<=x)return!1;let b=h-x,C=P.clamp((e._foveatedFactor-x)/b,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-T<=A}var pre=new ee;Yo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof on){let g=u.offCenterFrustum;l(g)&&(u=g);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/h}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),h=u.sseDenominator;if(p=s*d/(g*h),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,C=P.fog(g,x)*b;p-=C}}return p/=e.pixelRatio,p};function R8e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,o=e._maximumScreenSpaceError,r=t._screenSpaceErrorProgressiveResolution<=o,s=l(i)&&i._screenSpaceErrorProgressiveResolution>o;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function M8e(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Yo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:ss.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==ss.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=M8e(n,this),this._priorityProgressiveResolution=R8e(n,this),this.priorityDeferred=O8e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Yo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(pre);ee.lessThan(this.expireDate,e)&&(this._contentState=qo.EXPIRED,this._expiredContent=this._content)}};function L8e(e){if(!l(e.expireDuration))return;let t=ee.now(pre);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function N8e(e){return function(){return e._priority}}Yo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?F8e(this):k8e(this)};function F8e(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new s2(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=qo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=qo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=qo.FAILED,o})}async function B8e(e,t,n,i,o){let r=e._contentState;e._contentState=qo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ni.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=qo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ni.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await U8e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=qo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=qo.FAILED,a}}function k8e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Qo({throttle:!0,throttleByServer:!0,type:os.TILES3D,priorityFunction:N8e(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return B8e(e,o,i,n,r)}async function U8e(e,t){let n=bp(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Es.GEOMETRY||n.contentType===Es.VECTOR,(n.contentType===Es.IMPLICIT_SUBTREE||n.contentType===Es.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Es.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=fT[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=dT(i,s));let a=mT(i,s);return l(a)&&(o.group=new AC({metadata:a})),o}Yo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Yo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=qo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var _re=new ae;function f9(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,_re);e._boundingVolume2D=new xg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function V8e(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,_re);e._contentBoundingVolume2D=new xg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Yo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=f9(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==tn.INSIDE,s===tn.OUTSIDE)return ss.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Yo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return tn.INSIDE;if(this._visibilityPlaneMask===ss.MASK_INSIDE)return tn.INSIDE;let t=e.cullingVolume,n=V8e(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let r=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=r!==tn.INSIDE,r===tn.OUTSIDE)return tn.OUTSIDE}return t.computeVisibility(n)};Yo.prototype.distanceToTile=function(e){return f9(this,e).distanceToCamera(e)};var z8e=new m;Yo.prototype.distanceToTileCenter=function(e){let n=f9(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,z8e);return m.dot(e.camera.directionWC,i)};Yo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var gre=new Z,yre=new m,H8e=new Z,xre=new m,bre=new ce,G8e=new Nn,u9=new L;function W8e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],xre),o=Z.fromArray(e,3,H8e);i=L.multiplyByPoint(t,i,i);let r=L.getMatrix3(t,gre);return o=Z.multiply(r,o,o),l(n)?(n.update(i,o),n):new cd(i,o)}function j8e(e,t,n,i){let o=ce.unpack(e,0,bre),r=e[4],s=e[5],a=Nn.fromRectangle(o,r,s,oe.WGS84,G8e),c=a.center,u=a.halfAxes;t=L.multiplyTransformation(t,L.inverseTransformation(n,u9),u9),c=L.multiplyByPoint(t,c,c);let f=L.getMatrix3(t,gre);return u=Z.multiply(f,u,u),l(i)&&i instanceof cd?(i.update(c,u),i):new cd(c,u)}function q8e(e,t,n,i){if(!L.equalsEpsilon(t,n,P.EPSILON8))return j8e(e,t,n,i);if(l(i))return i;let o=ce.unpack(e,0,bre);return new sd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Y8e(e,t,n){let i=m.fromElements(e[0],e[1],e[2],xre),o=e[3];i=L.multiplyByPoint(t,i,i);let r=L.getScale(t,yre),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new xg(i,o)}Yo.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new de("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new h2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:i,region:o,sphere:r}=e;if(l(i))return W8e(i,t,n);if(l(o))return q8e(o,t,this._initialTransform,n);if(l(r))return Y8e(r,t,n);throw new de("boundingVolume must contain a sphere, region, or box")};Yo.prototype.updateTransform=function(e){e=y(e,L.IDENTITY);let t=L.multiplyTransformation(e,this.transform,u9);if(!!L.equals(t,this.computedTransform))return;L.clone(t,this.computedTransform);let i=this._header,o=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Yo.prototype.updateGeometricErrorScale=function(){let e=L.getScale(this.computedTransform,yre),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function X8e(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Ht.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function K8e(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=qo.FAILED,o}}function J8e(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Yo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;J8e(this,e),X8e(this,e,t,n),K8e(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ae.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var mre=[];Yo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(L8e(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=qo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=mre;try{this._content.update(e,t)}catch(i){throw this._contentState=qo.FAILED,i}mre.length=0,t.commandList=n};function hre(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function g2(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}Yo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,d=r,p=Math.pow(10,f),g=f+d,h=r,x=Math.pow(10,g),b=g+h,C=Math.pow(10,b),T=g2(this._depth,n.depth,i.depth);T=t?1-T:T;let S=!e.isSkippingLevelOfDetail&&this.refine===Wo.REPLACE?g2(this._priorityHolder._distanceToCamera,n.distance,i.distance):g2(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=hre(S,a,s),I=this._priorityProgressiveResolution?0:p,O=g2(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=hre(O,u,c),N=this.priorityDeferred?x:0,F=e._pass===Fo.PRELOAD_FLIGHT?0:C;this._priority=T+v+I+R+N+F};Yo.prototype.isDestroyed=function(){return!1};Yo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var ld=Yo;function Ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Ap.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ap.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};Ap.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};Ap.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};Ap.prototype.getProperty=function(e){return Vn.getProperty(e,this._properties,this._class)};Ap.prototype.setProperty=function(e,t){return Vn.setProperty(e,t,this._properties,this._class)};Ap.prototype.getPropertyBySemantic=function(e){return Vn.getPropertyBySemantic(e,this._properties,this._class)};Ap.prototype.setPropertyBySemantic=function(e,t){return Vn.setPropertyBySemantic(e,t,this._properties,this._class)};var Kv=Ap;function Ep(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ep.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ep.prototype.hasProperty=function(e){return Vn.hasProperty(e,this._properties,this._class)};Ep.prototype.hasPropertyBySemantic=function(e){return Vn.hasPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.getPropertyIds=function(e){return Vn.getPropertyIds(this._properties,this._class,e)};Ep.prototype.getProperty=function(e){return Vn.getProperty(e,this._properties,this._class)};Ep.prototype.setProperty=function(e,t){return Vn.setProperty(e,t,this._properties,this._class)};Ep.prototype.getPropertyBySemantic=function(e){return Vn.getPropertyBySemantic(e,this._properties,this._class)};Ep.prototype.setPropertyBySemantic=function(e,t){return Vn.setPropertyBySemantic(e,t,this._properties,this._class)};var y2=Ep;function Cre(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new y2({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new Kv({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new Kv({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Cre.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var J0=Cre;var Tre={},Z8e=new m;Tre.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof cd||i instanceof sd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=od.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof cd||a instanceof sd)){e._optimChildrenWithinParent=od.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=m.subtract(c.center,o.center,Z8e),f=m.magnitude(u);m.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=od.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===od.USE_OPTIMIZATION};var x2=Tre;function Jv(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(Jv.prototype,{length:{get:function(){return this._length}}});function $8e(e,t,n){this.item=e,this.previous=t,this.next=n}Jv.prototype.add=function(e){let t=new $8e(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Are(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}Jv.prototype.remove=function(e){l(e)&&(Are(this,e),--this._length)};Jv.prototype.splice=function(e,t){if(e===t)return;Are(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var b2=Jv;function Z0(){this._list=new b2,this._sentinel=this._list.add(),this._trimTiles=!1}Z0.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Z0.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Z0.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Z0.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Z0.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=e.maximumMemoryUsage*1024*1024,r=this._sentinel,s=i.head;for(;s!==r&&(e.totalMemoryUsageInBytes>o||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};Z0.prototype.trim=function(){this._trimTiles=!0};var C2=Z0;function T2(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function m9(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}T2.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=m9(e,n),this._referenceMaximum[n]=m9(t,n)};function Q8e(e,t){let n=e.tilePropertyName;if(l(n)){let i=m9(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var d9=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];T2.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Q8e(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=d9.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,h=d9[d],x=d9[p],b=z.clone(z.WHITE);b.red=P.lerp(h.red,x.red,g),b.green=P.lerp(h.green,x.green,g),b.blue=P.lerp(h.blue,x.blue,g),e._debugColor=b};T2.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var A2=T2;function vT(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}vT.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function E2(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),l(o)){let d=o.length;for(let p=0;p<d;++p)E2(e,o[p],n,i)}}vT.prototype.incrementSelectionCounts=function(e){E2(this,e,!1,!1)};vT.prototype.incrementLoadCounts=function(e){E2(this,e,!1,!0)};vT.prototype.decrementLoadCounts=function(e){E2(this,e,!0,!0)};vT.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Cg=vT;function Zv(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(Zv.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});Zv.prototype.makeDirty=function(){this._styleDirty=!0};Zv.prototype.resetDirty=function(){this._styleDirty=!1};Zv.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var S2=Zv;function e5e(e,t,n){let i=ii(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!ii(o,"3DTILES_bounding_volume_S2")&&!ii(o,"3DTILES_bounding_volume_cylinder"))throw new de("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new ve({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=t5e(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ye(a,!0));let c=new ve({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=n5e(t),this.subdivisionScheme=qr[i.subdivisionScheme],this.branchingFactor=qr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function t5e(e){if(ii(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function n5e(e){let t=Ye(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var $0=e5e;var $v={};function Ere(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function h9(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Sre(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function p9(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}$v.encode2D=function(e,t){return(Ere(e)|Ere(t)<<1)>>>0};$v.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Sre(e),t[1]=Sre(e>>1),t};$v.encode3D=function(e,t,n){return h9(e)|h9(t)<<1|h9(n)<<2};$v.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=p9(e),t[1]=p9(e>>1),t[2]=p9(e>>2),t};var Q0=$v;function Bo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===qr.OCTREE&&(this.z=e.z)}Object.defineProperties(Bo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===qr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===qr.OCTREE?Q0.encode3D(this.x,this.y,this.z):Q0.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===qr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Bo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===qr.OCTREE){let o=(this.z<<e.level)+e.z;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Bo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===qr.OCTREE){let r=Math.floor(this.z/t);return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Bo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===qr.OCTREE){let r=e.z%n;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Bo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===qr.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Bo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Bo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Bo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===qr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Bo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===qr.OCTREE?this.z===e.z:!0)};Bo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Bo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Bo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Bo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===qr.OCTREE&&(e.z=this.z),e};var vre=[0,0,0];Bo.fromMortonIndex=function(e,t,n,i){let o;return e===qr.OCTREE?(o=Q0.decode3D(i,vre),new Bo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Q0.decode2D(i,vre),new Bo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Bo.fromTileIndex=function(e,t,n){let i,o,r;return e===qr.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Bo.fromMortonIndex(e,t,i,r)};var wT=Bo;function Sp(){}Sp.selectTiles=function(e,t){fe.throwInstantiationError()};Sp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Sp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset._maximumScreenSpaceError};Sp.selectTile=function(e,t){if(e.contentVisibility(t)===tn.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&i._selectedTilesToStyle.push(e),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Sp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Sp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Sp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!i5e(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function i5e(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Sp.updateTile=function(e,t){wre(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,s5e(e),e._shouldSelect=!1,e._finalResolution=!0};function wre(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];wre(r,t),e._visible=r._visible;return}if(o5e(e,t)){e._visible=!1;return}let i=e.refine===Wo.REPLACE,o=e._optimChildrenWithinParent===od.USE_OPTIMIZATION;if(i&&o&&n&&!r5e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function o5e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Wo.ADD?!1:e.getScreenSpaceError(t,!0)<=i._maximumScreenSpaceError}function r5e(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function s5e(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Gs=Sp;function Ire(){}var Qv={stack:new Zc,stackMaximumLength:0};Ire.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Gs,s=Qv.stack;for(s.push(i);s.length>0;){Qv.stackMaximumLength=Math.max(Qv.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Wo.ADD,u=a.refine===Wo.REPLACE,f=a5e(a);f&&c5e(a,s,t),(c||u&&!f)&&(l5e(e,a),o(a,t),u5e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return Qv.stack.trim(Qv.stackMaximumLength),n};function a5e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function c5e(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function l5e(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function u5e(e,t){e.contentAvailable&&e.contentVisibility(t)!==tn.OUTSIDE&&e.tileset._selectedTiles.push(e)}var v2=Ire;function Dre(){}var ew={stack:new Zc,stackMaximumLength:0},tw={stack:new Zc,stackMaximumLength:0};Dre.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;d5e(n,t),ew.stack.trim(ew.stackMaximumLength),tw.stack.trim(tw.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function _9(e,t){e.contentAvailable&&Gs.selectTile(e,t)}function f5e(e,t,n){let i=e.refine===Wo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Gs;for(let h=0;h<r.length;++h)s(r[h],n);r.sort(Gs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let h=0;h<r.length;++h){let x=r[h];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=h,g=x._foveatedFactor),d=!0):(u||o.loadSiblings)&&(x._foveatedFactor<g&&(p=h,g=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=m5e(x,n):b=!1,f=f&&b}}if(d||(f=!1),p!==-1&&i){let h=r[p];h._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(h._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(h._distanceToCamera,x._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=x}return f}function d5e(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Gs,a=ew.stack;for(a.push(e);a.length>0;){ew.stackMaximumLength=Math.max(ew.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?f5e(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Wo.ADD?(_9(c,t),o(c,t)):c.refine===Wo.REPLACE&&(o(c,t),d&&_9(c,t)):(n._emptyTiles.push(c),o(c,t),d&&_9(c,t)),r(c,t),s(c,t)}}function m5e(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Gs,s=!0,a=tw.stack;for(a.push(e);a.length>0;){tw.stackMaximumLength=Math.max(tw.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!d&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let g=0;g<f;++g){let h=u[g];a.push(h)}}return s}var w2=Dre;function Pre(){}var nw={stack:new Zc,stackMaximumLength:0},iw={stack:new Zc,stackMaximumLength:0},vp={stack:new Zc,stackMaximumLength:0,ancestorStack:new Zc,ancestorStackMaximumLength:0},h5e=2;Pre.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;b5e(n,t),C5e(n,t),nw.stack.trim(nw.stackMaximumLength),iw.stack.trim(iw.stackMaximumLength),vp.stack.trim(vp.stackMaximumLength),vp.ancestorStack.trim(vp.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function p5e(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Gs,r=iw.stack;for(r.push(e);r.length>0;){iw.stackMaximumLength=Math.max(iw.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<h5e&&r.push(u))}}}function I2(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:p5e(e,t)}function _5e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function g5e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function y5e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Gs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Gs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function x5e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function b5e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.maximumScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Gs,c=nw.stack;for(c.push(e);c.length>0;){nw.stackMaximumLength=Math.max(nw.stackMaximumLength,c.length);let u=c.pop();_5e(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?y5e(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Wo.ADD?(I2(u,t),r(u,t)):u.refine===Wo.REPLACE&&(x5e(u,i)?(r(u,t),p&&I2(u,t)):p?(I2(u,t),r(u,t)):g5e(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&I2(u,t)),s(u,t),a(u,t)}}function C5e(e,t){let{selectTile:n,canTraverse:i}=Gs,{stack:o,ancestorStack:r}=vp,s;for(o.push(e);o.length>0||r.length>0;){if(vp.stackMaximumLength=Math.max(vp.stackMaximumLength,o.length),vp.ancestorStackMaximumLength=Math.max(vp.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Wo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var D2=Pre;function pr(e){e=y(e,y.EMPTY_OBJECT),this._marsOptions=y(e.marsOptions,{}),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new C2,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Zc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=y(e.maximumMemoryUsage,512),this._styleEngine=new S2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?L.clone(e.modelMatrix):L.clone(L.IDENTITY),this._statistics=new Cg,this._statisticsLast=new Cg,this._statisticsPerPass=new Array(Fo.NUMBER_OF_PASSES);for(let i=0;i<Fo.NUMBER_OF_PASSES;++i)this._statisticsPerPass[i]=new Cg;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new A2(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._initialClippingPlanesOriginMatrix=L.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,Cn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=kl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new tp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new $_,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new TC,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,ol.NONE),this._projectTo2D=y(e.projectTo2D,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Nt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let t=y(e.featureIdLabel,"featureId_0");typeof t=="number"&&(t=`featureId_${t}`),this._featureIdLabel=t;let n=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");if(typeof n=="number"&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,l(e.url)){Q("Cesium3DTileset options.url","Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.");let i=this,o;this._readyPromise=Promise.resolve(e.url).then(function(r){let s;return o=ve.createIfNeeded(r),i._resource=o,i._credits=o.credits,o.extension==="json"?s=o.getBaseUri(!0):o.isDataUri&&(s=""),i._url=o.url,i._basePath=s,pr.loadJson(o)}).then(function(r){if(!i.isDestroyed())return Lre(o,r).then(s=>(i._metadataExtension=s,r))}).then(function(r){if(i.isDestroyed())return;i._geometricError=r.geometricError,i._scaledGeometricError=r.geometricError,i._root=i.loadTileset(o,r);let s=l(r.asset.gltfUpAxis)?_o.fromName(r.asset.gltfUpAxis):_o.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,_o.X),u=r.asset;i._asset=u,i._properties=r.properties,i._extensionsUsed=r.extensionsUsed,i._extensions=r.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=r.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let h=f.cesium.credits,x=i._credits;l(x)||(x=[],i._credits=x);for(let b=0;b<h.length;++b){let C=h[b];x.push(new wt(C.html,i._showCreditsOnScreen))}}let p=i._root.createBoundingVolume(r.root.boundingVolume,L.IDENTITY).boundingSphere.center,g=i._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>si._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=L.clone(i._initialClippingPlanesOriginMatrix),i})}}Object.defineProperties(pr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return Q("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),l(this._root)}},readyPromise:{get:function(){return Q("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Q("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(L.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):L.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});pr.fromIonAssetId=async function(e,t){let n=await ma.fromAssetId(e);return pr.fromUrl(n,t)};pr.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await pr.loadJson(n),r=await Lre(n,o),s=new pr(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras;let c=n.credits;l(c)||(c=[]);let u=a.extras;if(l(u)&&l(u.cesium)&&l(u.cesium.credits)){let b=u.cesium.credits;for(let C=0;C<b.length;++C){let T=b[C];c.push(new wt(T.html,s._showCreditsOnScreen))}}s._credits=c;let f=l(o.asset.gltfUpAxis)?_o.fromName(o.asset.gltfUpAxis):_o.Y,d=y(t.modelUpAxis,f),p=y(t.modelForwardAxis,_o.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=p,s._root=s.loadTileset(n,o);let h=s._root.createBoundingVolume(o.root.boundingVolume,L.IDENTITY).boundingSphere.center,x=s._ellipsoid.cartesianToCartographic(h);return l(x)&&x.height>si._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(h)),s._clippingPlanesOriginMatrix=L.clone(s._initialClippingPlanesOriginMatrix),s._readyPromise=Promise.resolve(s),s._ready=!0,s};pr.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};pr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};pr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&pr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Ore(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Wo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=Ore(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&x2.checkChildrenWithinParent(c)}return s};function Ore(e,t,n,i){if(!(l(n.implicitTiling)||ii(n,"3DTILES_implicit_tiling")))return new ld(e,t,n,i);let r=e.schema,s=new $0(t,n,r),a=new wT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ye(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new ld(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Lre(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=ki.getSchemaLoader({resource:e});else if(l(n.schema))i=ki.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new J0({schema:i.schema,metadataJson:n});return ki.unload(i),o}var Rre=new m,T5e=new me,A5e=new L,E5e=new m,S5e=new m,v5e=new m;function w5e(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof sd)n=m.normalize(a.positionWC,Rre),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let x=L.inverseTransformation(c.computedTransform,A5e),b=t.mapProjection.ellipsoid,C=u.boundingVolume,T=L.multiplyByPoint(x,C.center,E5e);if(m.magnitude(T)>b.minimumRadius){let A=me.fromCartesian(T,b,T5e);n=m.normalize(a.positionWC,Rre),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=L.multiplyByPoint(x,a.positionWC,S5e);if(n=m.UNIT_Z,i=L.multiplyByPointAsVector(x,a.directionWC,v5e),i=m.normalize(i,i),o=A.z,u instanceof cd){let S=c._header.boundingVolume.box[11];r=T.z-S,s=T.z+S}else if(u instanceof xg){let S=C.radius;r=T.z-S,s=T.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,g=P.clamp((o-d)/(p-d),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function I5e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{Nre(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?B5e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function D5e(e,t){return e._priority-t._priority}pr.prototype.postPassesUpdate=function(e){l(this._root)&&(P5e(this,e),U5e(this,e),this._cache.unloadTiles(this,Bre),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};pr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;M5e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&w5e(this,e),e.newFrame&&this._cache.reset()};function P5e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==qo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function O5e(e){let t=e._requestedTiles;t.sort(D5e);for(let n=0;n<t.length;++n)I5e(e,t[n])}function Nre(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`))}function R5e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==qo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}function M5e(e,t){R5e(e);let n=e._processingQueue,i=e._statistics,o;for(let r=0;r<n.length;++r){o=n[r];try{o.process(e,t),o.contentReady&&(--i.numberOfTilesProcessing,e.tileLoad.raiseEvent(o))}catch(s){--i.numberOfTilesProcessing,Nre(s,e,o)}}}var P2=new m,L5e={maximumFractionDigits:3};function Mre(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,L5e):Math.round(t).toLocaleString()}function g9(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,P2);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=m.normalize(i,P2);r=m.multiplyByScalar(r,.75*n,P2),o=m.add(r,i,P2)}return o}function y9(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,o++),i+=` +Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${Mre(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${Mre(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` +- ${s[a]}`;o+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function N5e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:g9(e.debugPickedTile),a=y9(e.debugPickedTile,e,s);a.pixelOffset=new H(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];y9(a,e,g9(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&y9(a,e,g9(a))}}e._tileDebugLabels.update(t)}function F5e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ui({stencil:0,pass:Ae.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let h=0;h<s.length;++h){let x=s[h];f&&u.raiseEvent(x),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,x=h.length;i.length+=x;for(let b=g-1;b>=0;--b)i[d+x+b]=i[d+b];for(let b=0;b<x;++b)i[d+b]=h[b]}g=i.length-r,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new dp),N5e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Fre=[];function B5e(e,t){let n=t,i=Fre;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(k5e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Bre(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function k5e(e,t){e._cache.unloadTile(e,t,Bre),t.destroy()}pr.prototype.trimLoadedTiles=function(){this._cache.trim()};function U5e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Cg.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function V5e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function z5e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!L.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=L.clone(e.modelMatrix,e._previousModelMatrix)))}function H5e(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,V5e(e),z5e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&O5e(e),F5e(e,t,i),Cg.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];c.showOnScreen=e._showCreditsOnScreen||c._isDefaultToken,t.creditDisplay.addCreditToNextFrame(c)}}return r}pr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Fo.MOST_DETAILED_PRELOAD||t===Fo.MOST_DETAILED_PICK?v2:this.isSkippingLevelOfDetail?D2:w2};pr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};pr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Fo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Fo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=H5e(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};pr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};pr.prototype.isDestroyed=function(){return!1};pr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=Fre;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};pr.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};pr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!pr.supportedExtensions[e[t]])throw new de(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Ws=pr;var G5e=new L;function Tg(e,t){t.collectionChanged.addEventListener(Tg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new At,this._onCollectionChanged(t,t.values,[],[])}Tg.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,G5e),c=ve.createIfNeeded(q.getValueOrUndefined(a._uri,e))),!f){l(u)&&(u.tilesetPrimitive.show=!1);continue}let p=l(u)?u.tilesetPrimitive:void 0;(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],W5e(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=q.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Tg.prototype.isDestroyed=function(){return!1};Tg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Tg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)x9(this,e[i],t,n);return ue(this)};Tg.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};Tg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(x9(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],x9(this,r,a,c),s.remove(r.id)};function x9(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function W5e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Ws.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var O2=Tg;var j5e=z.WHITE,q5e=z.BLACK,Y5e=new H(2,2);function IT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});IT.prototype.getType=function(e){return"Checkerboard"};IT.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,j5e,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,q5e,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,Y5e),t};IT.prototype.equals=function(e){return this===e||e instanceof IT&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var ow=IT;var kre={id:void 0};function rw(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function Wa(e){this._owner=e,this._entities=new At,this._addedEntities=new At,this._removedEntities=new At,this._changedEntities=new At,this._suspendCount=0,this._collectionChanged=new _e,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}Wa.prototype.suspendEvents=function(){this._suspendCount++};Wa.prototype.resumeEvents=function(){this._suspendCount--,rw(this)};Object.defineProperties(Wa.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Wa.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;ee.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),ee.greaterThan(c,t)&&!c.equals(Ge.MAXIMUM_VALUE)&&(t=c)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new Sn({start:e,stop:t})};Wa.prototype.add=function(e){e instanceof nr||(e=new nr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(Wa.prototype._onEntityDefinitionChanged,this),rw(this),e};Wa.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Wa.prototype.contains=function(e){return this._entities.get(e.id)===e};Wa.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(Wa.prototype._onEntityDefinitionChanged,this),rw(this),!0):!1};Wa.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(Wa.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),rw(this)};Wa.prototype.getById=function(e){return this._entities.get(e)};Wa.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(kre.id=e,t=new nr(kre),this.add(t)),t};Wa.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),rw(this)};var js=Wa;var R2={id:void 0},DT=new Array(2);function b9(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Ure(e,t,n,i){DT[0]=n,DT[1]=i.id,t[JSON.stringify(DT)]=i.definitionChanged.addEventListener(Sr.prototype._onDefinitionChanged,e)}function Vre(e,t,n,i){DT[0]=n,DT[1]=i.id;let o=JSON.stringify(DT);t[o](),t[o]=void 0}function Ag(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,d=new js(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Sr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],Vre(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Sr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Ure(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?b9(x):(R2.id=s.id,x=new nr(R2)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let h=d.values;for(r=0;r<h.length;r++)f.add(h[r]);f.resumeEvents()}function Sr(e,t){this._owner=t,this._composite=new js(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},Ag(this),this._shouldRecomposite=!1}Object.defineProperties(Sr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Sr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Ag(this)};Sr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Ag(this),!0):!1};Sr.prototype.removeAllCollections=function(){this._collections.length=0,Ag(this)};Sr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Sr.prototype.contains=function(e){return this._composite.contains(e)};Sr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Sr.prototype.getCollection=function(e){return this._collections[e]};Sr.prototype.getCollectionsLength=function(){return this._collections.length};function M2(e,t){return e.indexOf(t)}function zre(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Ag(e)}Sr.prototype.raiseCollection=function(e){let t=M2(this._collections,e);zre(this,t,t+1)};Sr.prototype.lowerCollection=function(e){let t=M2(this._collections,e);zre(this,t,t-1)};Sr.prototype.raiseCollectionToTop=function(e){let t=M2(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Ag(this))};Sr.prototype.lowerCollectionToBottom=function(e){let t=M2(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Ag(this))};Sr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Sr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Ag(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Sr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Sr.prototype.getById=function(e){return this._composite.getById(e)};Sr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let h=n[s];Vre(this,d,p,h);let x=h.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),b9(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let g=t.length;for(s=0;s<g;s++){let h=t[s];Ure(this,d,p,h);let x=h.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?b9(u):(R2.id=x,u=new nr(R2),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Sr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let h=g[t];if(l(h)){if(d)if(d=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var Hre=Sr;function C9(){this._removalFunctions=[]}C9.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};C9.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Mr=C9;function E9(e,t){return ee.compare(e.start,t.start)}function vr(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(vr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});vr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof vr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Sn.equals(n[r],i[r],t))return!1;return!0};vr.prototype.get=function(e){return this._intervals[e]};vr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};vr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};vr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};vr.prototype.contains=function(e){return this.indexOf(e)>=0};var T9=new Sn;vr.prototype.indexOf=function(e){let t=this._intervals;T9.start=e,T9.stop=e;let n=Oo(t,T9,E9);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Sn.contains(t[n-1],e)?n-1:~n)};vr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};vr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Oo(n,e,E9);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=ee.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Sn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Sn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=ee.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Sn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Sn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=ee.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Sn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Sn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};vr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Oo(t,e,E9);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Sn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Sn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Sn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Sn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Sn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Sn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};vr.prototype.intersect=function(e,t,n){let i=new vr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(ee.lessThan(c.stop,u.start))++o;else if(ee.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Sn.intersect(c,u,new Sn,n);f.isEmpty||i.addInterval(f,t)}ee.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};vr.fromJulianDateArray=function(e,t){l(t)||(t=new vr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new Sn({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Sn({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new Sn({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var ja=new l_,sw=[0,31,28,31,30,31,30,31,31,30,31,30,31];function A9(e,t,n){l(n)||(n=new ee),ee.toGregorianDate(e,ja);let i=ja.millisecond+t.millisecond,o=ja.second+t.second,r=ja.minute+t.minute,s=ja.hour+t.hour,a=ja.day+t.day,c=ja.month+t.month,u=ja.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),sw[2]=u_(u)?29:28;a>sw[c]||c>=13;)a>sw[c]&&(a-=sw[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),sw[2]=u_(u)?29:28;return ja.millisecond=i,ja.second=o,ja.minute=r,ja.hour=s,ja.day=a,ja.month=c,ja.year=u,ee.fromGregorianDate(ja,n)}var X5e=new ee,K5e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Gre(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(K5e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,X5e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var aw=new l_;vr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=[];if(!Gre(n[2],aw))r.push(i,o);else{let s=ee.clone(i);for(r.push(s);ee.compare(s,o)<0;)s=A9(s,aw),ee.compare(o,s)<=0&&ee.clone(o,s),r.push(s)}return vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};vr.fromIso8601DateArray=function(e,t){return vr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};vr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u<c;++u)(Gre(i[u],aw)||u===0)&&(o&&l(a)?s=A9(a,aw):s=A9(n,aw),r.push(s),a=s);return vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Lr=vr;function J5e(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function ex(){this._eventHelper=new Mr,this._definitionChanged=new _e,this._intervals=new Lr,this._intervals.changedEvent.addEventListener(ex.prototype._intervalsChanged,this)}Object.defineProperties(ex.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});ex.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};ex.prototype.equals=function(e){return this===e||e instanceof ex&&this._intervals.equals(e._intervals,q.equals)};ex.prototype._intervalsChanged=function(){J5e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Ac=ex;function Eg(){this._definitionChanged=new _e,this._composite=new Ac,this._composite.definitionChanged.addEventListener(Eg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Eg.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Eg.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};Eg.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Eg.prototype.equals=function(e){return this===e||e instanceof Eg&&this._composite.equals(e._composite,q.equals)};Eg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var cw=Eg;function Sg(e){this._referenceFrame=y(e,oo.FIXED),this._definitionChanged=new _e,this._composite=new Ac,this._composite.definitionChanged.addEventListener(Sg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Sg.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});Sg.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};Sg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Sg.prototype.equals=function(e){return this===e||e instanceof Sg&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};Sg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ya=Sg;var Z5e={ROUNDED:0,MITERED:1,BEVELED:2},Li=Object.freeze(Z5e);var qs=[new m,new m],$5e=new m,Q5e=new m,e6e=new m,t6e=new m,n6e=new m,i6e=new m,o6e=new m,r6e=new m,s6e=new m,PT=new m,L2=new m,lw={},S9=new me;function a6e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];S9=t.cartesianToCartographic(o,S9),n[i]=S9.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function v9(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var N2=new m,F2=new m;function c6e(e,t,n,i){let o=new Ma(n,i),r=o.projectPointOntoPlane(m.add(n,e,N2),N2),s=o.projectPointOntoPlane(m.add(n,t,F2),F2),a=H.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var l6e=new m(-1,0,0),tx=new L,u6e=new L,w9=new Z,f6e=Z.IDENTITY.clone(),d6e=new m,m6e=new re,Wre=new m;function wp(e,t,n,i,o,r,s,a){let c=d6e,u=m6e;tx=Mt.eastNorthUpToFixedFrame(e,o,tx),c=L.multiplyByPointAsVector(tx,l6e,c),c=m.normalize(c,c);let f=c6e(c,t,e,o);w9=Z.fromRotationZ(f,w9),Wre.z=r,tx=L.multiplyTransformation(tx,L.fromRotationTranslation(w9,Wre,u6e),tx);let d=f6e;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=m.fromArray(n,g,u),u=Z.multiplyByVector(d,u,u),u=L.multiplyByPoint(tx,u,u),i.push(u.x,u.y,u.z);return i}var h6e=new m;function I9(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,h6e);i=wp(c,t,n,i,o,r[a/3],s,1)}return i}function p6e(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function jre(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var qre=new Be,Yre=new m,Xre=new Z;function Kre(e,t,n,i,o,r,s,a,c,u){let f=m.angleBetween(m.subtract(t,e,PT),m.subtract(n,e,L2)),d=i===Li.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=Z.fromQuaternion(Be.fromAxisAngle(m.negate(e,PT),f/(d+1),qre),Xre):p=Z.fromQuaternion(Be.fromAxisAngle(e,f/(d+1),qre),Xre);let g,h;if(t=m.clone(t,Yre),d>0){let x=u?2:1;for(let b=0;b<d;b++)t=Z.multiplyByVector(p,t,t),g=m.subtract(t,e,PT),g=m.normalize(g,g),o||(g=m.negate(g,g)),h=r.scaleToGeodeticSurface(t,L2),s=wp(h,g,a,s,r,c,1,x)}else g=m.subtract(t,e,PT),g=m.normalize(g,g),o||(g=m.negate(g,g)),h=r.scaleToGeodeticSurface(t,L2),s=wp(h,g,a,s,r,c,1,1),n=m.clone(n,Yre),g=m.subtract(n,e,PT),g=m.normalize(g,g),o||(g=m.negate(g,g)),h=r.scaleToGeodeticSurface(n,L2),s=wp(h,g,a,s,r,c,1,1);return s}lw.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];H.equals(r,s)||n.push(s)}return n};lw.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ma(n,i),r=o.projectPointOntoPlane(m.add(n,e,N2),N2),s=o.projectPointOntoPlane(m.add(n,t,F2),F2);return s.x*r.y-s.y*r.x>=0};var _6e=new m,g6e=new m;lw.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=a6e(e,r),a=i._granularity,c=i._cornerType,u=o?p6e(t,n):jre(t,n),f=o?jre(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,h=[],x=o?[]:void 0,b=$5e,C=Q5e,T=e6e,A=t6e,S=n6e,v=i6e,I=o6e,O=r6e,R=s6e,N=e[0],F=e[1];A=r.geodeticSurfaceNormal(N,A),b=m.subtract(F,N,b),b=m.normalize(b,b),O=m.cross(A,b,O),O=m.normalize(O,O);let _=s[0],E=s[1];o&&(x=wp(N,O,f,x,r,_+d,1,1)),R=m.clone(N,R),N=F,C=m.negate(b,C);let w,D;for(let V=1;V<g-1;V++){let U=o?2:1;if(F=e[V+1],N.equals(F)){Nt("Positions are too close and are considered equivalent with rounding error.");continue}b=m.subtract(F,N,b),b=m.normalize(b,b),T=m.add(b,C,T),T=m.normalize(T,T),A=r.geodeticSurfaceNormal(N,A);let G=m.multiplyByScalar(A,m.dot(b,A),_6e);m.subtract(b,G,G),m.normalize(G,G);let k=m.multiplyByScalar(A,m.dot(C,A),g6e);if(m.subtract(C,k,k),m.normalize(k,k),!P.equalsEpsilon(Math.abs(m.dot(G,k)),1,P.EPSILON7)){T=m.cross(T,A,T),T=m.cross(A,T,T),T=m.normalize(T,T);let j=1/Math.max(.25,m.magnitude(m.cross(T,C,PT))),$=lw.angleIsGreaterThanPi(b,C,N,r);$?(S=m.add(N,m.multiplyByScalar(T,j*p,T),S),v=m.add(S,m.multiplyByScalar(O,p,v),v),qs[0]=m.clone(R,qs[0]),qs[1]=m.clone(v,qs[1]),w=v9(qs,_+d,E+d,a),D=Mi.generateArc({positions:qs,granularity:a,ellipsoid:r}),h=I9(D,O,u,h,r,w,1),O=m.cross(A,b,O),O=m.normalize(O,O),I=m.add(S,m.multiplyByScalar(O,p,I),I),c===Li.ROUNDED||c===Li.BEVELED?Kre(S,v,I,c,$,r,h,u,E+d,o):(T=m.negate(T,T),h=wp(N,T,u,h,r,E+d,j,U)),R=m.clone(I,R)):(S=m.add(N,m.multiplyByScalar(T,j*p,T),S),v=m.add(S,m.multiplyByScalar(O,-p,v),v),qs[0]=m.clone(R,qs[0]),qs[1]=m.clone(v,qs[1]),w=v9(qs,_+d,E+d,a),D=Mi.generateArc({positions:qs,granularity:a,ellipsoid:r}),h=I9(D,O,u,h,r,w,1),O=m.cross(A,b,O),O=m.normalize(O,O),I=m.add(S,m.multiplyByScalar(O,-p,I),I),c===Li.ROUNDED||c===Li.BEVELED?Kre(S,v,I,c,$,r,h,u,E+d,o):h=wp(N,T,u,h,r,E+d,j,U),R=m.clone(I,R)),C=m.negate(b,C)}else h=wp(R,O,u,h,r,_+d,1,1),R=N;_=E,E=s[V+1],N=F}qs[0]=m.clone(R,qs[0]),qs[1]=m.clone(N,qs[1]),w=v9(qs,_+d,E+d,a),D=Mi.generateArc({positions:qs,granularity:a,ellipsoid:r}),h=I9(D,O,u,h,r,w,1),o&&(x=wp(N,O,f,x,r,E+d,1,1)),g=h.length;let M=o?g+x.length:g,B=new Float64Array(M);return B.set(h),o&&B.set(x,g),B};var Nm=lw;var P9={},OT=new m,ese=new m,y6e=new m,Jre=new m,Ec=[new m,new m],tse=new m,nse=new m,ise=new m,x6e=new m,b6e=new m,C6e=new m,T6e=new m,A6e=new m,E6e=new m,S6e=new m,Zre=new Be,$re=new Z;function B2(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,OT),m.subtract(n,e,ese)),s=i===Li.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=Z.fromQuaternion(Be.fromAxisAngle(m.negate(e,OT),r/s,Zre),$re):u=Z.fromQuaternion(Be.fromAxisAngle(e,r/s,Zre),$re);let f=0;t=m.clone(t,OT);for(let d=0;d<s;d++)t=Z.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function v6e(e){let t=tse,n=nse,i=ise,o=e[1];n=m.fromArray(e[1],o.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let r=B2(t,n,i,Li.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(o,0,i),t=m.midpoint(n,i,t);let c=B2(t,n,i,Li.ROUNDED,!1);return[r,c]}function Qre(e,t,n,i){let o=OT;return i?o=m.add(e,t,o):(t=m.negate(t,t),o=m.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function D9(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,OT),a=m.negate(s,ese),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=m.fromArray(e,f,y6e),p=m.add(d,a,Jre);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=m.add(d,s,Jre);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}P9.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var w6e=new m,I6e=new m;P9.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=tse,c=nse,u=ise,f=x6e,d=b6e,p=C6e,g=T6e,h=A6e,x=E6e,b=S6e,C=[],T=s?[]:void 0,A=s?[]:void 0,S=n[0],v=n[1];c=m.normalize(m.subtract(v,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=m.normalize(m.cross(a,c,f),f),s&&(T.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),g=m.clone(S,g),S=v,u=m.negate(c,u);let I,O=[],R,N=n.length;for(R=1;R<N-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],c=m.normalize(m.subtract(v,S,c),c),d=m.normalize(m.add(c,u,d),d);let _=m.multiplyByScalar(a,m.dot(c,a),w6e);m.subtract(c,_,_),m.normalize(_,_);let E=m.multiplyByScalar(a,m.dot(u,a),I6e);if(m.subtract(u,E,E),m.normalize(E,E),!P.equalsEpsilon(Math.abs(m.dot(_,E)),1,P.EPSILON7)){d=m.cross(d,a,d),d=m.cross(a,d,d),d=m.normalize(d,d);let D=o/Math.max(.25,m.magnitude(m.cross(d,u,OT))),M=Nm.angleIsGreaterThanPi(c,u,S,i);d=m.multiplyByScalar(d,D,d),M?(h=m.add(S,d,h),b=m.add(h,m.multiplyByScalar(f,o,b),b),x=m.add(h,m.multiplyByScalar(f,o*2,x),x),Ec[0]=m.clone(g,Ec[0]),Ec[1]=m.clone(b,Ec[1]),I=Mi.generateArc({positions:Ec,granularity:t,ellipsoid:i}),C=D9(I,f,o,C),s&&(T.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=m.clone(x,p),f=m.normalize(m.cross(a,c,f),f),x=m.add(h,m.multiplyByScalar(f,o*2,x),x),g=m.add(h,m.multiplyByScalar(f,o,g),g),r===Li.ROUNDED||r===Li.BEVELED?O.push({leftPositions:B2(h,p,x,r,M)}):O.push({leftPositions:Qre(S,m.negate(d,d),x,M)})):(x=m.add(S,d,x),b=m.add(x,m.negate(m.multiplyByScalar(f,o,b),b),b),h=m.add(x,m.negate(m.multiplyByScalar(f,o*2,h),h),h),Ec[0]=m.clone(g,Ec[0]),Ec[1]=m.clone(b,Ec[1]),I=Mi.generateArc({positions:Ec,granularity:t,ellipsoid:i}),C=D9(I,f,o,C),s&&(T.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=m.clone(h,p),f=m.normalize(m.cross(a,c,f),f),h=m.add(x,m.negate(m.multiplyByScalar(f,o*2,h),h),h),g=m.add(x,m.negate(m.multiplyByScalar(f,o,g),g),g),r===Li.ROUNDED||r===Li.BEVELED?O.push({rightPositions:B2(x,p,h,r,M)}):O.push({rightPositions:Qre(S,d,h,M)})),u=m.negate(c,u)}S=v}a=i.geodeticSurfaceNormal(S,a),Ec[0]=m.clone(g,Ec[0]),Ec[1]=m.clone(S,Ec[1]),I=Mi.generateArc({positions:Ec,granularity:t,ellipsoid:i}),C=D9(I,f,o,C),s&&(T.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z));let F;return r===Li.ROUNDED&&(F=v6e(C)),{positions:C,corners:O,lefts:T,normals:A,endPositions:F}};var Ui=P9;var sse=new m,ase=new m,k2=new m,U2=new m,D6e=new m,cse=new m,vg=new m,RT=new m;function lse(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function ud(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=m.normalize(m.cross(n,t,vg),vg);r.normal&&Ui.addAttribute(s,t,i,o),r.tangent&&Ui.addAttribute(a,u,i,o),r.bitangent&&Ui.addAttribute(c,n,i,o)}function use(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new gn,u,f=0,d=0,p,g=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,f+=h,g+=h*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let J=o[p].leftPositions;l(J)?(h=J.length,f+=h,g+=h):(h=o[p].rightPositions.length,d+=h,g+=h)}let x=l(r),b;x&&(b=r[0].length-3,f+=b,d+=b,b/=3,g+=b*6);let C=f+d,T=new Float64Array(C),A=t.normal?new Float32Array(C):void 0,S=t.tangent?new Float32Array(C):void 0,v=t.bitangent?new Float32Array(C):void 0,I={normals:A,tangents:S,bitangents:v},O=0,R=C-1,N,F,_,E,w=sse,D=ase,M,B,V=b/2,U=Ue.createTypedArray(C/3,g),G=0;if(x){B=k2,M=U2;let J=r[0];for(w=m.fromArray(a,0,w),D=m.fromArray(s,0,D),p=0;p<V;p++)B=m.fromArray(J,(V-1-p)*3,B),M=m.fromArray(J,(V+p)*3,M),Ui.addAttribute(T,M,O),Ui.addAttribute(T,B,void 0,R),ud(I,w,D,O,R,t),F=O/3,E=F+1,N=(R-2)/3,_=N-1,U[G++]=N,U[G++]=F,U[G++]=_,U[G++]=_,U[G++]=F,U[G++]=E,O+=3,R-=3}let k=0,Y=0,j=i[k++],$=i[k++];T.set(j,O),T.set($,R-$.length+1),D=m.fromArray(s,Y,D);let W,K;for(h=$.length-3,p=0;p<h;p+=3)W=n.geodeticSurfaceNormal(m.fromArray(j,p,vg),vg),K=n.geodeticSurfaceNormal(m.fromArray($,h-p,RT),RT),w=m.normalize(m.add(W,K,w),w),ud(I,w,D,O,R,t),F=O/3,E=F+1,N=(R-2)/3,_=N-1,U[G++]=N,U[G++]=F,U[G++]=_,U[G++]=_,U[G++]=F,U[G++]=E,O+=3,R-=3;for(W=n.geodeticSurfaceNormal(m.fromArray(j,h,vg),vg),K=n.geodeticSurfaceNormal(m.fromArray($,h,RT),RT),w=m.normalize(m.add(W,K,w),w),Y+=3,p=0;p<o.length;p++){let J;u=o[p];let he=u.leftPositions,ge=u.rightPositions,se,pe,xe=cse,De=k2,Se=U2;if(w=m.fromArray(a,Y,w),l(he)){for(ud(I,w,D,void 0,R,t),R-=3,se=E,pe=_,J=0;J<he.length/3;J++)xe=m.fromArray(he,J*3,xe),U[G++]=se,U[G++]=pe-J-1,U[G++]=pe-J,Ui.addAttribute(T,xe,void 0,R),De=m.fromArray(T,(pe-J-1)*3,De),Se=m.fromArray(T,se*3,Se),D=m.normalize(m.subtract(De,Se,D),D),ud(I,w,D,void 0,R,t),R-=3;xe=m.fromArray(T,se*3,xe),De=m.subtract(m.fromArray(T,pe*3,De),xe,De),Se=m.subtract(m.fromArray(T,(pe-J)*3,Se),xe,Se),D=m.normalize(m.add(De,Se,D),D),ud(I,w,D,O,void 0,t),O+=3}else{for(ud(I,w,D,O,void 0,t),O+=3,se=_,pe=E,J=0;J<ge.length/3;J++)xe=m.fromArray(ge,J*3,xe),U[G++]=se,U[G++]=pe+J,U[G++]=pe+J+1,Ui.addAttribute(T,xe,O),De=m.fromArray(T,se*3,De),Se=m.fromArray(T,(pe+J)*3,Se),D=m.normalize(m.subtract(De,Se,D),D),ud(I,w,D,O,void 0,t),O+=3;xe=m.fromArray(T,se*3,xe),De=m.subtract(m.fromArray(T,(pe+J)*3,De),xe,De),Se=m.subtract(m.fromArray(T,pe*3,Se),xe,Se),D=m.normalize(m.negate(m.add(Se,De,D),D),D),ud(I,w,D,void 0,R,t),R-=3}for(j=i[k++],$=i[k++],j.splice(0,3),$.splice($.length-3,3),T.set(j,O),T.set($,R-$.length+1),h=$.length-3,Y+=3,D=m.fromArray(s,Y,D),J=0;J<$.length;J+=3)W=n.geodeticSurfaceNormal(m.fromArray(j,J,vg),vg),K=n.geodeticSurfaceNormal(m.fromArray($,h-J,RT),RT),w=m.normalize(m.add(W,K,w),w),ud(I,w,D,O,R,t),E=O/3,F=E-1,_=(R-2)/3,N=_+1,U[G++]=N,U[G++]=F,U[G++]=_,U[G++]=_,U[G++]=F,U[G++]=E,O+=3,R-=3;O-=3,R+=3}if(w=m.fromArray(a,a.length-3,w),ud(I,w,D,O,R,t),x){O+=3,R-=3,B=k2,M=U2;let J=r[1];for(p=0;p<V;p++)B=m.fromArray(J,(b-p-1)*3,B),M=m.fromArray(J,p*3,M),Ui.addAttribute(T,B,void 0,R),Ui.addAttribute(T,M,O),ud(I,w,D,O,R,t),E=O/3,F=E-1,_=(R-2)/3,N=_+1,U[G++]=N,U[G++]=F,U[G++]=_,U[G++]=_,U[G++]=F,U[G++]=E,O+=3,R-=3}if(c.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let J=new Float32Array(C/3*2),he,ge,se=0;if(x){f/=3,d/=3;let pe=Math.PI/(b+1);ge=1/(f-b+1),he=1/(d-b+1);let xe,De=b/2;for(p=De+1;p<b+1;p++)xe=P.PI_OVER_TWO+pe*p,J[se++]=he*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=1;p<d-b+1;p++)J[se++]=p*he,J[se++]=0;for(p=b;p>De;p--)xe=P.PI_OVER_TWO-p*pe,J[se++]=1-he*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=De;p>0;p--)xe=P.PI_OVER_TWO-pe*p,J[se++]=1-ge*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)J[se++]=p*ge,J[se++]=1;for(p=1;p<De+1;p++)xe=P.PI_OVER_TWO+pe*p,J[se++]=ge*(1+Math.cos(xe)),J[se++]=.5*(1+Math.sin(xe))}else{for(f/=3,d/=3,ge=1/(f-1),he=1/(d-1),p=0;p<d;p++)J[se++]=p*he,J[se++]=0;for(p=f;p>0;p--)J[se++]=(p-1)*ge,J[se++]=1}c.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function P6e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=sse,h=ase,x=k2,b=U2,C=D6e,T=cse,A=c;for(u=0;u<s;u+=3){let S=A+c;g=m.fromArray(n,u,g),h=m.fromArray(n,u+s,h),x=m.fromArray(n,(u+3)%s,x),h=m.subtract(h,g,h),x=m.subtract(x,g,x),b=m.normalize(m.cross(h,x,b),b),t.normal&&(Ui.addAttribute(f,b,S),Ui.addAttribute(f,b,S+3),Ui.addAttribute(f,b,A),Ui.addAttribute(f,b,A+3)),(t.tangent||t.bitangent)&&(T=m.fromArray(i,u,T),t.bitangent&&(Ui.addAttribute(p,T,S),Ui.addAttribute(p,T,S+3),Ui.addAttribute(p,T,A),Ui.addAttribute(p,T,A+3)),t.tangent&&(C=m.normalize(m.cross(T,b,C),C),Ui.addAttribute(d,C,S),Ui.addAttribute(d,C,S+3),Ui.addAttribute(d,C,A),Ui.addAttribute(d,C,A+3))),A+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;d.set(S),d.set(S,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let h=f[u],x=f[u+1];d[p++]=h,d[p++]=x,d[p++]=h,d[p++]=x}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function O9(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function O6e(e,t){let n=new Me({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Ui.computePositions(e),r=use(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let h=new Float64Array(d*4);f=fi.scaleToGeodeticHeight(f,s,i),h=O9(f,0,h),g=fi.scaleToGeodeticHeight(g,a,i),h=O9(g,d*2,h),p.set(f),p.set(g,d),p.set(h,d*2),c.position.values=p,c=P6e(c,t);let x,b=d/3;if(e.shadowVolume){let N=c.normal.values;d=N.length;let F=new Float32Array(d*6);for(x=0;x<d;x++)N[x]=-N[x];F.set(N,d),F=O9(N,d*4,F),c.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let N=new Uint8Array(b*6);if(e.offsetAttribute===an.TOP)N=N.fill(1,0,b).fill(1,b*2,b*4);else{let F=e.offsetAttribute===an.NONE?0:1;N=N.fill(F)}c.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}let C=u.length,T=b+b,A=Ue.createTypedArray(p.length/3,C*2+T*3);A.set(u);let S=C;for(x=0;x<C;x+=3){let N=u[x],F=u[x+1],_=u[x+2];A[S++]=_+b,A[S++]=F+b,A[S++]=N+b}let v,I,O,R;for(x=0;x<T;x+=2)v=x+T,I=v+T,O=v+1,R=I+1,A[S++]=v,A[S++]=I,A[S++]=O,A[S++]=O,A[S++]=I,A[S++]=R;return{attributes:c,indices:A}}var ose=new m,uw=new m,$u=new me;function rse(e,t,n,i,o,r){let s=m.subtract(t,e,ose);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,uw),c=m.cross(s,a,ose);m.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;m.add(e,c,uw),n.cartesianToCartographic(uw,$u);let g=$u.latitude,h=$u.longitude;u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),m.subtract(e,c,uw),n.cartesianToCartographic(uw,$u),g=$u.latitude,h=$u.longitude,u=Math.min(u,g),f=Math.min(f,h),d=Math.max(d,g),p=Math.max(p,h),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var Zu=new m,fw=new m,al=new me,cl=new me;function fse(e,t,n,i,o){e=lse(e,t);let r=Ao(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;al.latitude=Number.POSITIVE_INFINITY,al.longitude=Number.POSITIVE_INFINITY,cl.latitude=Number.NEGATIVE_INFINITY,cl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Li.ROUNDED){let p=r[0];m.subtract(p,r[1],Zu),m.normalize(Zu,Zu),m.multiplyByScalar(Zu,a,Zu),m.add(p,Zu,fw),t.cartesianToCartographic(fw,$u),c=$u.latitude,u=$u.longitude,al.latitude=Math.min(al.latitude,c),al.longitude=Math.min(al.longitude,u),cl.latitude=Math.max(cl.latitude,c),cl.longitude=Math.max(cl.longitude,u)}for(let p=0;p<s-1;++p)rse(r[p],r[p+1],t,a,al,cl);let f=r[s-1];m.subtract(f,r[s-2],Zu),m.normalize(Zu,Zu),m.multiplyByScalar(Zu,a,Zu),m.add(f,Zu,fw),rse(f,fw,t,a,al,cl),i===Li.ROUNDED&&(t.cartesianToCartographic(fw,$u),c=$u.latitude,u=$u.longitude,al.latitude=Math.min(al.latitude,c),al.longitude=Math.min(al.longitude,u),cl.latitude=Math.max(cl.latitude,c),cl.longitude=Math.max(cl.longitude,u));let d=l(o)?o:new ce;return d.north=cl.latitude,d.south=al.latitude,d.east=cl.longitude,d.west=al.longitude,d}function Dp(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._vertexFormat=Me.clone(y(e.vertexFormat,Me.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+oe.packedLength+Me.packedLength+7}Dp.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var dse=oe.clone(oe.UNIT_SPHERE),mse=new Me,Ip={positions:void 0,ellipsoid:dse,vertexFormat:mse,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Dp.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)o[h]=m.unpack(e,t);let r=oe.unpack(e,t,dse);t+=oe.packedLength;let s=Me.unpack(e,t,mse);t+=Me.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Me.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Ip.positions=o,Ip.width=a,Ip.height=c,Ip.extrudedHeight=u,Ip.cornerType=f,Ip.granularity=d,Ip.shadowVolume=p,Ip.offsetAttribute=g===-1?void 0:g,new Dp(Ip))};Dp.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,oe.WGS84),r=y(e.cornerType,Li.ROUNDED);return fse(n,o,i,r,t)};Dp.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=lse(t,i);let o=Ao(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=O6e(u,c);else{let g=Ui.computePositions(u);if(f=use(g,c,i),f.attributes.position.values=fi.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let h=e._offsetAttribute===an.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(h);f.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new dt({attributes:d,indices:f.indices,primitiveType:Fe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Dp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Dp({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Dp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=fse(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var MT=Dp;var hse=new m,pse=new m,R6e=new m;function M6e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function _se(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new gn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let M=o[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(r),h;g&&(h=r[0].length-3,c+=h,u+=h,h/=3,d+=h*4);let x=c+u,b=new Float64Array(x),C=0,T=x-1,A,S,v,I,O,R,N=h/2,F=Ue.createTypedArray(x/3,d+4),_=0;if(F[_++]=C/3,F[_++]=(T-2)/3,g){n.push(C/3),R=hse,O=pse;let M=r[0];for(f=0;f<N;f++)R=m.fromArray(M,(N-1-f)*3,R),O=m.fromArray(M,(N+f)*3,O),Ui.addAttribute(b,O,C),Ui.addAttribute(b,R,void 0,T),S=C/3,I=S+1,A=(T-2)/3,v=A-1,F[_++]=A,F[_++]=v,F[_++]=S,F[_++]=I,C+=3,T-=3}let E=0,w=i[E++],D=i[E++];for(b.set(w,C),b.set(D,T-D.length+1),p=D.length-3,n.push(C/3,(T-2)/3),f=0;f<p;f+=3)S=C/3,I=S+1,A=(T-2)/3,v=A-1,F[_++]=A,F[_++]=v,F[_++]=S,F[_++]=I,C+=3,T-=3;for(f=0;f<o.length;f++){let M;a=o[f];let B=a.leftPositions,V=a.rightPositions,U,G=R6e;if(l(B)){for(T-=3,U=v,n.push(I),M=0;M<B.length/3;M++)G=m.fromArray(B,M*3,G),F[_++]=U-M-1,F[_++]=U-M,Ui.addAttribute(b,G,void 0,T),T-=3;n.push(U-Math.floor(B.length/6)),t===Li.BEVELED&&n.push((T-2)/3+1),C+=3}else{for(C+=3,U=I,n.push(v),M=0;M<V.length/3;M++)G=m.fromArray(V,M*3,G),F[_++]=U+M,F[_++]=U+M+1,Ui.addAttribute(b,G,C),C+=3;n.push(U+Math.floor(V.length/6)),t===Li.BEVELED&&n.push(C/3-1),T-=3}for(w=i[E++],D=i[E++],w.splice(0,3),D.splice(D.length-3,3),b.set(w,C),b.set(D,T-D.length+1),p=D.length-3,M=0;M<D.length;M+=3)I=C/3,S=I-1,v=(T-2)/3,A=v+1,F[_++]=A,F[_++]=v,F[_++]=S,F[_++]=I,C+=3,T-=3;C-=3,T+=3,n.push(C/3,(T-2)/3)}if(g){C+=3,T-=3,R=hse,O=pse;let M=r[1];for(f=0;f<N;f++)R=m.fromArray(M,(h-f-1)*3,R),O=m.fromArray(M,f*3,O),Ui.addAttribute(b,R,void 0,T),Ui.addAttribute(b,O,C),I=C/3,S=I-1,v=(T-2)/3,A=v+1,F[_++]=A,F[_++]=v,F[_++]=S,F[_++]=I,C+=3,T-=3;n.push(C/3)}else n.push(C/3,(T-2)/3);return F[_++]=C/3,F[_++]=(T-2)/3,s.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:F,wallIndices:n}}function L6e(e){let t=e.ellipsoid,n=Ui.computePositions(e),i=_se(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=fi.scaleToGeodeticHeight(u,r,t),d=fi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let A=new Uint8Array(f*2);if(e.offsetAttribute===an.TOP)A=A.fill(1,0,f);else{let S=e.offsetAttribute===an.NONE?0:1;A=A.fill(S)}a.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let g,h=c.length,x=Ue.createTypedArray(p.length/3,(h+o.length)*2);x.set(c);let b=h;for(g=0;g<h;g+=2){let A=c[g],S=c[g+1];x[b++]=A+f,x[b++]=S+f}let C,T;for(g=0;g<o.length;g++)C=o[g],T=C+f,x[b++]=C,x[b++]=T;return{attributes:a,indices:x}}function dw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+oe.packedLength+6}dw.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var gse=oe.clone(oe.UNIT_SPHERE),wg={positions:void 0,ellipsoid:gse,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};dw.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)o[p]=m.unpack(e,t);let r=oe.unpack(e,t,gse);t+=oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=oe.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(wg.positions=o,wg.width=s,wg.height=a,wg.extrudedHeight=c,wg.cornerType=u,wg.granularity=f,wg.offsetAttribute=d===-1?void 0:d,new dw(wg))};dw.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=M6e(t,i);let o=Ao(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=L6e(c);else{let p=Ui.computePositions(c);if(u=_se(p,c.cornerType),u.attributes.position.values=fi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,h=e._offsetAttribute===an.NONE?0:1,x=new Uint8Array(g/3).fill(h);u.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new dt({attributes:f,indices:u.indices,primitiveType:Fe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var V2=dw;var N6e=new ei(0);function Sc(e){li.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Sc.prototype=Object.create(li.prototype),Sc.prototype.constructor=Sc);Object.defineProperties(Sc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Sc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Xc.isSupported(this._scene)};Sc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Sc.prototype._computeCenter=fe.throwInstantiationError;Sc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(li.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&Nt(Nt.geometryZIndex),this._zIndex=y(o.zIndex,N6e),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new bC(this._scene,a,r,s)}};Sc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),li.prototype.destroy.call(this)};Sc.getGeometryHeight=function(e,t){if(!l(e)){t!==qe.NONE&&Nt(Nt.geometryHeightReference);return}return t!==qe.CLAMP_TO_GROUND?e:0};Sc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==qe.NONE&&Nt(Nt.geometryExtrudedHeightReference);return}return t!==qe.CLAMP_TO_GROUND?e:Sc.CLAMP_TO_GROUND};Sc.CLAMP_TO_GROUND="clamp";Sc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=qe.NONE),(!l(n)||!l(i))&&(i=qe.NONE);let o=0;if(t!==qe.NONE&&o++,i===qe.RELATIVE_TO_GROUND&&o++,o===2)return an.ALL;if(o===1)return an.TOP};var Kn=Sc;var yse=new z,xse=m.ZERO,bse=new m,Cse=new ce;function F6e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function fd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new F6e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(fd.prototype=Object.create(Kn.prototype),fd.prototype.constructor=fd);fd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,yse)),l(o)||(o=z.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,xse,bse))),new Tt({id:t,geometry:new MT(this._options),attributes:i})};fd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,yse),o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,xse,bse))),new Tt({id:t,geometry:new V2(this._options),attributes:o})};fd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};fd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||li.prototype._isHidden.call(this,e,t)};fd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};fd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=q.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Kn.getGeometryHeight(n,i),o=Kn.getGeometryExtrudedHeight(o,r),o===Kn.CLAMP_TO_GROUND&&(o=si.getMinimumMaximumHeights(MT.computeRectangle(s,Cse)).minimumTerrainHeight),s.extrudedHeight=o};fd.DynamicGeometryUpdater=LT;function LT(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(LT.prototype=Object.create(ci.prototype),LT.prototype.constructor=LT);LT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ci.prototype._isHidden.call(this,e,t,n)};LT.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,qe.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(o)&&(o=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Kn.getGeometryHeight(o,r),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(MT.computeRectangle(i,Cse)).minimumTerrainHeight),i.extrudedHeight=s};var z2=fd;function H2(){fe.throwInstantiationError()}Object.defineProperties(H2.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});H2.prototype.update=function(e){fe.throwInstantiationError()};H2.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Nr=H2;function Fm(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Fm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Tse=new m;Fm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Tse);return M9(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Fm.prototype.isScaledSpacePointVisible=function(e){return M9(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var B6e=new m;Fm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=B6e,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),M9(e,o,i)};Fm.prototype.computeHorizonCullingPoint=function(e,t,n){return Sse(this._ellipsoid,e,t,n)};var Ase=oe.clone(oe.UNIT_SPHERE);Fm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Ese(this._ellipsoid,n,Ase);return Sse(o,e,t,i)};Fm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return vse(this._ellipsoid,e,t,n,i,o)};Fm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Ese(this._ellipsoid,o,Ase);return vse(s,e,t,n,i,r)};var k6e=[];Fm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,k6e),o=ae.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var U6e=new m;function Ese(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,U6e);e=oe.fromCartesian3(i,n)}return e}function Sse(e,t,n,i){l(i)||(i=new m);let o=Dse(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=wse(e,c,o);if(u<0)return;r=Math.max(r,u)}return Ise(o,r,i)}var G2=new m;function vse(e,t,n,i,o,r){l(r)||(r=new m),i=y(i,3),o=y(o,m.ZERO);let s=Dse(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){G2.x=n[c]+o.x,G2.y=n[c+1]+o.y,G2.z=n[c+2]+o.z;let f=wse(e,G2,s);if(f<0)return;a=Math.max(a,f)}return Ise(s,a,r)}function M9(e,t,n){let i=t,o=n,r=m.subtract(e,i,Tse),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var V6e=new m,z6e=new m;function wse(e,t,n){let i=e.transformPositionToScaledSpace(t,V6e),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,z6e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function Ise(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var R9=new m;function Dse(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,R9),m.normalize(R9,R9))}var Ig=Fm;function wr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Rt.clone(n)),l(i)&&(i=Rt.clone(i)),l(o)&&(o=Dt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var Pse=wr.SHOW_INDEX=0,Mse=wr.POSITION_INDEX=1,H6e=wr.COLOR_INDEX=2,G6e=wr.OUTLINE_COLOR_INDEX=3,W6e=wr.OUTLINE_WIDTH_INDEX=4,j6e=wr.PIXEL_SIZE_INDEX=5,q6e=wr.SCALE_BY_DISTANCE_INDEX=6,Y6e=wr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,X6e=wr.DISTANCE_DISPLAY_CONDITION_INDEX=8,K6e=wr.DISABLE_DEPTH_DISTANCE_INDEX=9;wr.NUMBER_OF_PROPERTIES=10;function Qu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(wr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Qu(this,Pse))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Qu(this,Mse))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Rt.equals(t,e)||(this._scaleByDistance=Rt.clone(e,t),Qu(this,q6e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Rt.equals(t,e)||(this._translucencyByDistance=Rt.clone(e,t),Qu(this,Y6e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Qu(this,j6e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Qu(this,H6e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Qu(this,G6e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Qu(this,W6e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Dt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Dt.clone(e,this._distanceDisplayCondition),Qu(this,X6e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Qu(this,K6e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Qu(this,Pse))}}});wr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};wr.prototype._getActualPosition=function(){return this._actualPosition};wr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Qu(this,Mse)};var Ose=new re;wr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(L.multiplyByPoint(n,e,Ose),eo.computeActualWgs84Position(t,Ose))};var Rse=new re;wr._computeScreenSpacePosition=function(e,t,n,i){let o=L.multiplyByVector(e,re.fromElements(t.x,t.y,t.z,1,Rse),Rse);return eo.wgs84ToWindowCoordinates(n,o,i)};wr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new H);let i=n.modelMatrix,o=wr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};wr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=c,n};wr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Rt.equals(this._scaleByDistance,e._scaleByDistance)&&Rt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Dt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};wr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ys=wr;var nx=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; - // Compute attenuation via the primary ray and the light ray. - vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); +void main() +{ + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - // Accumulate the scattering. - rayleighAccumulation += sampleDensity.x * attenuation; - mieAccumulation += sampleDensity.y * attenuation; + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; - // Increment distance on primary ray. - rayPositionLength += (rayStepLength += rayStepLengthIncrease); +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 + { + discard; } +#else +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } +#endif +#endif - // Compute the scattering amount. - rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; - mieColor = u_atmosphereMieCoefficient * mieAccumulation; - - // Compute the transmittance i.e. how much light is passing through the atmosphere. - opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } +`;var W2=`uniform float u_maxTotalPointSize; -vec4 computeAtmosphereColor( - vec3 positionWC, - vec3 lightDirection, - vec3 rayleighColor, - vec3 mieColor, - float opacity -) { - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance - float cosAngle = dot(cameraToPositionWCDirection, lightDirection); - float cosAngleSq = cosAngle * cosAngle; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; - float G = u_atmosphereMieAnisotropy; - float GSq = G * G; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; - // The Rayleigh phase function. - float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); - // The Mie phase function. - float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); +void main() +{ + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - // The final color is generated by combining the effects of the Rayleigh and Mie scattering. - vec3 rayleigh = rayleighPhase * rayleighColor; - vec3 mie = miePhase * mieColor; + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); - return vec4(color, opacity); -} -`;var jD=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - float atmosphereInnerRadius = length(positionWC); + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); -} -`;function Eat(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function MY(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function bat(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case ne.SCENE3D:r=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:r=n;break;case ne.MORPHING:r=i;break}return r}function Sat(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}MY.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,A=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,D=e.enableClippingPlanes,R=e.clippingPlanes,O=e.clippedByBoundaries,L=e.hasImageryLayerCutout,N=e.colorCorrect,_=e.highlightFillTile,b=e.colorToAlpha,v=e.hasGeodeticSurfaceNormals,I=e.hasExaggeration,M=e.showUndergroundColor,F=e.translucent,k=e.marsOptions||{},V=0,G="",q=n.renderedMesh.encoding;q.quantization===Qs.BITS12&&(V=1,G="QUANTIZATION_BITS12");let Q=0,W="";O&&(Q=1,W="TILE_LIMIT_RECTANGLE");let K=0,J="";L&&(K=1,J="APPLY_IMAGERY_CUTOUT");let me=t.mode,ye=me|r<<2|o<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|h<<10|A<<11|x<<12|C<<13|T<<14|E<<15|S<<16|w<<17|V<<18|d<<19|D<<20|Q<<21|K<<22|N<<23|_<<24|b<<25|v<<26|I<<27|M<<28|F<<29|f<<30,se=0;l(R)&&R.length>0&&(se=D?R.clippingPlanesState:0);let pe=n.surfaceShader;if(l(pe)&&pe.numberOfDayTextures===i&&pe.flags===ye&&pe.material===this.material&&pe.clippingShaderState===se)return pe.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(l(xe)||(xe=this._shadersByTexturesFlags[i]=[]),pe=xe[ye],k.enableClip||!l(pe)||pe.material!==this.material||pe.clippingShaderState!==se){let we=this.baseVertexShaderSource.clone(),Ee=this.baseFragmentShaderSource.clone();se!==0&&Ee.sources.unshift(yy(R,t.context)),k.enableClip&&Ee.defines.push("APPLY_MARS3D_CLIP"),k.enableUplift&&Ee.defines.push("APPLY_MARS3D_UPLIFT"),k.enableFlat&&we.defines.push("APPLY_MARS3D_FLAT"),we.defines.push(G),Ee.defines.push(`TEXTURE_UNITS ${i}`,W,J),r&&Ee.defines.push("APPLY_BRIGHTNESS"),o&&Ee.defines.push("APPLY_CONTRAST"),s&&Ee.defines.push("APPLY_HUE"),a&&Ee.defines.push("APPLY_SATURATION"),c&&Ee.defines.push("APPLY_GAMMA"),k.invertColor&&Ee.defines.push("APPLY_INVERT_COLOR_MARS3D"),k.filterColor&&Ee.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Ee.defines.push("APPLY_ALPHA"),f&&Ee.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Ee.defines.push("SHOW_REFLECTIVE_OCEAN"),we.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&Ee.defines.push("SHOW_OCEAN_WAVES"),b&&Ee.defines.push("APPLY_COLOR_TO_ALPHA"),M&&(we.defines.push("UNDERGROUND_COLOR"),Ee.defines.push("UNDERGROUND_COLOR")),F&&(we.defines.push("TRANSLUCENT"),Ee.defines.push("TRANSLUCENT")),h&&(E?(we.defines.push("ENABLE_VERTEX_LIGHTING"),Ee.defines.push("ENABLE_VERTEX_LIGHTING")):(we.defines.push("ENABLE_DAYNIGHT_SHADING"),Ee.defines.push("ENABLE_DAYNIGHT_SHADING"))),A&&(we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ee.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ee.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(we.defines.push("GROUND_ATMOSPHERE"),Ee.defines.push("GROUND_ATMOSPHERE"),T&&(we.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ee.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),we.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ee.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(we.defines.push("FOG"),Ee.defines.push("FOG")),d&&Ee.defines.push("APPLY_SPLIT"),D&&Ee.defines.push("ENABLE_CLIPPING_PLANES"),N&&Ee.defines.push("COLOR_CORRECT"),_&&Ee.defines.push("HIGHLIGHT_FILL_TILE"),v&&we.defines.push("GEODETIC_SURFACE_NORMALS"),I&&we.defines.push("EXAGGERATION");let Be=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;L&&(Be+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let Pe=0;Pe<i;++Pe)L?Be+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Pe}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Be+=` color = sampleAndBlend( -`,Be+=` color, - u_dayTextures[${Pe}], - u_dayTextureUseWebMercatorT[${Pe}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${Pe}], - u_dayTextureTranslationAndScale[${Pe}], - ${u?`u_dayTextureAlpha[${Pe}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${Pe}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${Pe}]`:"1.0"}, -${r?`u_dayTextureBrightness[${Pe}]`:"0.0"}, - ${o?`u_dayTextureContrast[${Pe}]`:"0.0"}, - ${s?`u_dayTextureHue[${Pe}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${Pe}]`:"0.0"}, - ${c?`u_dayTextureOneOverGamma[${Pe}]`:"0.0"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${k.invertColor?`u_mars3dTextureInvertColor[${Pe}]`:"false"}, - ${k.filterColor?`u_mars3dTextureFilterColor[${Pe}]`:"vec3(1.0)"}, - //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C - ${d?`u_dayTextureSplit[${Pe}]`:"0.0"}, - ${b?`u_colorsToAlpha[${Pe}]`:"vec4(0.0)"}, - nightBlend ); -`,L&&(Be+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Be+=` return color; - }`,Ee.sources.push(Be),we.sources.push(bat(me)),we.sources.push(Sat(S));let ke=Qt.fromCache({context:t.context,vertexShaderSource:we,fragmentShaderSource:Ee,attributeLocations:q.getAttributeLocations()});pe=xe[ye]=new Eat(i,ye,this.material,ke,se)}return n.surfaceShader=pe,pe.shaderProgram};MY.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];if(!l(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var Ek=MY;var vat={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},fi=Object.freeze(vat);var wat={START:0,LOADING:1,DONE:2,FAILED:3},ta=Object.freeze(wat);var Dat={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},yr=Object.freeze(Dat);function Zr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=yr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Zr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===yr.RECEIVING||e===yr.TRANSFORMING),i=this.imagery;for(let r=0,o=i.length;n&&r<o;++r){let s=i[r];n=!l(s.loadingImagery)||s.loadingImagery.state!==fi.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Iat=new he;function BY(e,t,n,i,r,o){let s=e.getExaggeratedPosition(i,r,o);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Iat);s=n.project(c,o),s=m.fromElements(s.z,s.x,s.y,o)}return s}var Pat=new m,Oat=new m,Rat=new m;Zr.prototype.pick=function(e,t,n,i,r){let o=this.renderedMesh;if(!l(o))return;let s=o.vertices,a=o.indices,c=o.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],h=a[d+2],A=BY(c,t,n,s,p,Pat),x=BY(c,t,n,s,g,Oat),C=BY(c,t,n,s,h,Rat),T=Ki.rayTriangleParametric(e,A,x,C,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?On.getPoint(e,f,r):void 0};Zr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=yr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Zr.prototype.freeVertexArray=function(){Zr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Zr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Zr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Zr),e.state===ta.START&&(Mat(e,t,n),e.state=ta.LOADING)};Zr.processStateMachine=function(e,t,n,i,r,o,s){Zr.initialize(e,n,i);let a=e.data;if(e.state===ta.LOADING&&Bat(e,t,n,i,r,o),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===yr.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ta.DONE}c&&(e.renderable=!0)};Zr.prototype.processImagery=function(e,t,n,i){let r=e.data,o=e.upsampledFromParent,s=!1,a=!0,c=r.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){o=!1;continue}if(d.loadingImagery.state===fi.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready&&g.imageryProvider._ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else o=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),o=o&&l(d.loadingImagery)&&(d.loadingImagery.state===fi.FAILED||d.loadingImagery.state===fi.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(s||a),a};function fge(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Oc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Oc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(Zr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Zr._createVertexArrayForMesh(i.context,r)):(Zr._freeVertexArray(e.vertexArray),e.vertexArray=Zr._createVertexArrayForMesh(i.context,r)),Zr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Zr.prototype.addGeodeticSurfaceNormals=function(e,t){fge(this,!0,e,t)};Zr.prototype.removeGeodeticSurfaceNormals=function(e){fge(this,!1,void 0,e)};Zr.prototype.updateExaggeration=function(e,t,n){let i=this,r=i.renderedMesh;if(r===void 0)return;let o=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=o!==1,c=r.encoding,u=c.exaggeration!==o,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function Mat(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let r=e.parent,o=r.data;l(o)&&l(o.terrainData)&&(i=o.terrainData.isChildAvailable(r.x,r.y,e.x,e.y))}i===!1&&(e.data.terrainState=yr.FAILED);for(let r=0,o=n.length;r<o;++r){let s=n.get(r);s.show&&s._createTileImagerySkeletons(e,t)}}function Bat(e,t,n,i,r,o){let s=e.data,a=e.parent;if(s.terrainState===yr.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Zr.processStateMachine(a,t,n,i,r,o,!0)),s.terrainState===yr.FAILED&&Lat(s,e,t,n,e.x,e.y,e.level),s.terrainState===yr.UNLOADED&&Nat(s,n,e.x,e.y,e.level),s.terrainState===yr.RECEIVED&&Uat(s,t,n,e.x,e.y,e.level),s.terrainState===yr.TRANSFORMED&&(Vat(s,t.context,n,e.x,e.y,e.level,o),s.updateExaggeration(e,t,r)),s.terrainState>=yr.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)zat(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Lat(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=ta.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,r,o,s);l(p)&&(e.terrainState=yr.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=yr.RECEIVED}).catch(function(){e.terrainState=yr.FAILED}))}function Nat(e,t,n,i,r){function o(c){e.terrainData=c,e.terrainState=yr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ni.CANCELLED){e.terrainData=void 0,e.terrainState=yr.UNLOADED,e.request=void 0;return}e.terrainState=yr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Ti.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new $r({throttle:!1,throttleByServer:!0,type:ns.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=yr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=yr.UNLOADED,e.request=void 0)}a()}var Fat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Uat(e,t,n,i,r,o){let s=n.tilingScheme,a=Fat;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=yr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=yr.TRANSFORMED}).catch(function(){e.terrainState=yr.FAILED}))}Zr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ht.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{},s=o[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=ht.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,o[e.id]=s,t.indices.indexBuffers=o}else++s.referenceCount;return new si({context:e,attributes:r,indexBuffer:s})};Zr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Vat(e,t,n,i,r,o,s){e.vertexArray=Zr._createVertexArrayForMesh(t,e.mesh),e.terrainState=yr.READY,e.fill=e.fill&&e.fill.destroy(s)}function kat(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Bt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Qe.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:bi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function zat(e,t){let n=t.terrainData.waterMask,i=kat(e),r,o=n.length;if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Bt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:Qe.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Zr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Zr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,r=e.rectangle,o=r.width,s=r.height,a=o/i.width,c=s/i.height;return n.x=a*(r.west-i.west)/o,n.y=c*(r.south-i.south)/s,n.z=a,n.w=c,n};var Gd=Zr;var bk=`uniform sampler2D u_texture; + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif + + /////////////////////////////////////////////////////////////////////////// + + vec4 color; + vec4 outlineColor; + vec4 pickColor; + + // compressedAttribute0.z => pickColor.rgb + + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); -in vec2 v_textureCoordinates; + // compressedAttribute0.x => color.rgb -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var Sk=`in vec4 position; -in float webMercatorT; + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); -uniform vec2 u_textureDimensions; + // compressedAttribute0.y => outlineColor.rgb -out vec2 v_textureCoordinates; + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;function db(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=fi.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&e.imageryProvider._ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}db.createPlaceholder=function(e){let t=new db(e,0,0,0);return t.addReference(),t.state=fi.PLACEHOLDER,t};db.prototype.addReference=function(){++this.referenceCount};db.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};db.prototype.processStateMachine=function(e,t,n){this.state===fi.UNLOADED&&!n&&(this.state=fi.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===fi.RECEIVED&&(this.state=fi.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===fi.READY&&t&&!this.texture;(this.state===fi.TEXTURE_LOADED||i)&&(this.state=fi.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var YD=db;function LY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}LY.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};LY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===fi.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==fi.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==fi.FAILED&&o.state!==fi.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===fi.FAILED||i.state===fi.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var qD=LY;function di(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,di.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,di.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,di.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,di.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,di.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,di.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,di.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,di.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new qD(YD.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,di.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(di.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});di.DEFAULT_BRIGHTNESS=1;di.DEFAULT_CONTRAST=1;di.DEFAULT_HUE=0;di.DEFAULT_SATURATION=1;di.DEFAULT_GAMMA=1;di.DEFAULT_SPLIT=nl.NONE;di.DEFAULT_MINIFICATION_FILTER=un.LINEAR;di.DEFAULT_MAGNIFICATION_FILTER=bi.LINEAR;di.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;di.fromProviderAsync=function(e,t){let n=new di(void 0,t);return Yat(n,Promise.resolve(e)),n};di.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),di.fromProviderAsync(Ty({style:e.style}),e)};di.prototype.isBaseLayer=function(){return this._isBaseLayer};di.prototype.isDestroyed=function(){return!1};di.prototype.destroy=function(){return ue(this)};var hge=new ce,dge=new ce,NY=new ce,pge=new ce;di.prototype.getViewableRectangle=async function(){$("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return await e._readyPromise,ce.intersection(e.rectangle,t)};di.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};di.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready||!r._ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof Pi&&e.rectangle.north<Pi.MaximumLatitude&&e.rectangle.south>-Pi.MaximumLatitude,s=ce.intersection(r.rectangle,this._rectangle,hge),a=ce.intersection(e.rectangle,s,dge);if(!l(a)){if(!this.isBaseLayer())return!1;let v=s,I=e.rectangle;a=dge,I.south>=v.north?a.north=a.south=v.north:I.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(I.south,v.south),a.north=Math.min(I.north,v.north)),I.west>=v.east?a.west=a.east=v.east:I.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(I.west,v.west),a.east=Math.min(I.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Wat(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let v=r.minimumLevel;d<v&&(d=v)}let g=r.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),A=g.positionToTileXY(ce.southeast(a),d),x=e.rectangle.width/512,C=e.rectangle.height/512,T=g.tileXYToRectangle(h.x,h.y,d);Math.abs(T.south-e.rectangle.north)<C&&h.y<A.y&&++h.y,Math.abs(T.east-e.rectangle.west)<x&&h.x<A.x&&++h.x;let E=g.tileXYToRectangle(A.x,A.y,d);Math.abs(E.north-e.rectangle.south)<C&&A.y>h.y&&--A.y,Math.abs(E.west-e.rectangle.east)<x&&A.x>h.x&&--A.x;let S=ce.clone(e.rectangle,pge),w=g.tileXYToRectangle(h.x,h.y,d),D=ce.intersection(w,s,NY),R;o?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),R=g.tileXYToNativeRectangle.bind(g),x=S.width/512,C=S.height/512):R=g.tileXYToRectangle.bind(g);let O,L=0,N=1,_;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=x&&(L=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=C&&(N=Math.max(0,(D.north-S.south)/S.height));let b=N;for(let v=h.x;v<=A.x;v++)if(O=L,w=R(v,h.y,d),D=ce.simpleIntersection(w,s,NY),!!l(D)){L=Math.min(1,(D.east-S.west)/S.width),v===A.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<x)&&(L=1),N=b;for(let I=h.y;I<=A.y;I++){if(_=N,w=R(v,I,d),D=ce.simpleIntersection(w,s,NY),!l(D))continue;N=Math.max(0,(D.south-S.south)/S.height),I===A.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<C)&&(N=0);let M=new oe(O,N,L,_),F=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new qD(F,M,o)),++n}}return!0};di.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,hge),i=c.rectangleToNativeRectangle(i,pge)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new oe(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};di.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=fi.RECEIVED,e.request=void 0,Ti.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function r(s){if(e.request.state===ni.CANCELLED){e.state=fi.UNLOADED,e.request=void 0;return}e.state=fi.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Ti.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function o(){let s=new $r({throttle:!1,throttleByServer:!0,type:ns.IMAGERY});e.request=s,e.state=fi.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=fi.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){r(c)}):i(a)}o()};di.prototype._createTextureWebGL=function(e,t){let n=new mn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Bt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Bt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ct.RGBA:ct.RGB,sampler:n})};di.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=fi.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=fi.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Pi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=fi.TEXTURE_LOADED};function mge(e,t,n){return`${e}:${t}:${n}`}di.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===un.LINEAR&&i===bi.LINEAR&&!ct.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=un.LINEAR_MIPMAP_LINEAR;let o=Gt.maximumTextureFilterAnisotropy,s=Math.min(o,y(this._maximumAnisotropy,o)),a=mge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Rh.NICEST),t.sampler=u}else{let o=mge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};di.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Di)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new Bf({persists:!0,owner:this,preExecute:function(c){Gat(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=fi.READY,t.releaseReference()},canceled:function(){t.state=fi.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=fi.READY};di.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};di.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};di.prototype.getImageryFromCache=function(e,t,n,i){let r=_ge(e,t,n),o=this._imageryCache[r];return l(o)||(o=new YD(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};di.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=_ge(e.x,e.y,e.level);delete this._imageryCache[t]};function _ge(e,t,n){return JSON.stringify([e,t,n])}var vk={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},Hat=jt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Gat(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let x=new Float32Array(2*64*2),C=0;for(let D=0;D<64;++D){let R=D/63;x[C++]=0,x[C++]=R,x[C++]=1,x[C++]=R}let T={position:0,webMercatorT:1},E=Jo.getRegularGridIndices(2,64),S=ht.createIndexBuffer({context:t,typedArray:E,usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});r.vertexArray=new si({context:t,attributes:[{index:T.position,vertexBuffer:ht.createVertexBuffer({context:t,typedArray:x,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:ht.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let w=new He({sources:[Sk]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:w,fragmentShaderSource:bk,attributeLocations:T}),r.sampler=new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:bi.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;vk.textureDimensions.x=o,vk.textureDimensions.y=s,vk.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Bt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(Rh.NICEST);let p=i.south,g=i.north,h=Hat,A=0;for(let x=0;x<64;++x){let C=x/63,T=P.lerp(p,g,C);a=Math.sin(T);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[A++]=S,h[A++]=S}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=vk,e.vertexArray=r.vertexArray}function Wat(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Di?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function jat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Yat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){jat(e._errorEvent,i)}}var na=di;var gge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=gge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Qn=gge;function hb(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}hb.prototype.update=function(e,t,n){this.changedThisFrame&&(bge(e,t,this.tile,n),this.changedThisFrame=!1)};hb.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};hb.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Gd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var qat=new H0;hb.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=qat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);us(e,n,c,u,s,yn.EAST,!1,a,i),us(e,n,c,f,s,yn.NORTH,!1,a,i),us(e,n,c,d,s,yn.WEST,!1,a,i),us(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),h=u.findTileToSouth(o),A=d.findTileToNorth(o),x=d.findTileToSouth(o);us(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),us(e,n,c,A,s,yn.SOUTHWEST,!1,a,i),us(e,n,c,h,s,yn.NORTHEAST,!1,a,i),us(e,n,c,x,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function us(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||Qn.wasKicked(u._lastSelectionResult)||Qn.originalResult(u._lastSelectionResult)===Qn.CULLED);){if(s)return;let f=u.parent;if(o>=yn.NORTHWEST&&f!==void 0)switch(o){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Qn.RENDERED){if(l(u.data.vertexArray))return;Xat(e,t,n,u,o,r,a,c);return}if(Qn.originalResult(i._lastSelectionResult)!==Qn.CULLED)switch(o){case yn.WEST:us(e,t,n,i.northwestChild,r,o,!0,a,c),us(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.EAST:us(e,t,n,i.southeastChild,r,o,!0,a,c),us(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTH:us(e,t,n,i.southwestChild,r,o,!0,a,c),us(e,t,n,i.southeastChild,r,o,!0,a,c);break;case yn.NORTH:us(e,t,n,i.northeastChild,r,o,!0,a,c),us(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHWEST:us(e,t,n,i.northwestChild,r,o,!0,a,c);break;case yn.NORTHEAST:us(e,t,n,i.northeastChild,r,o,!0,a,c);break;case yn.SOUTHWEST:us(e,t,n,i.southwestChild,r,o,!0,a,c);break;case yn.SOUTHEAST:us(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new fe("Invalid edge")}}}function Xat(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new hb(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Kat(e,t,n,i,r,a)}function Kat(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(bge(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,h,A=n.rectangle,x,C=i.rectangle;switch(r){case yn.WEST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.north,h.south,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.south,h.north,x));++p);break;case yn.SOUTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.west,h.east,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.east,h.west,x));++p);break;case yn.EAST:for(x=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(A.south,h.north,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(A.north,h.south,x));++p);break;case yn.NORTH:for(x=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(A.east,h.west,x));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(A.west,h.east,x));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var VA=new he,Jat=new he,mb=new m,kY=new m,FY=new H,UY=new H,Au=new H;function Mk(){this.height=0,this.encodedNormal=new H}function wk(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return Sge(e,t,n,i,u,c),c}var Zat={minimumHeight:0,maximumHeight:0},Qat=new m,yge=new Mk,Age=new Mk,xge=new Mk,Cge=new Mk,$at=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,ect={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function bge(e,t,n,i){Gd.initialize(n,e.terrainProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=Ik(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,xge),p=Ik(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,yge),g=Ik(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,Age),h=Ik(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Cge);d=wk(o,f,0,1,d,p,h,g,xge),p=wk(o,f,0,0,p,d,g,h,yge),g=wk(o,f,1,1,g,p,h,d,Age),h=wk(o,f,1,1,h,g,d,p,Cge);let A=p.height,x=g.height,C=d.height,T=h.height,E=Math.min(A,x,C,T),S=Math.max(A,x,C,T),w=(E+S)*.5,D,R,O=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-O,N=Math.acos(L/f.maximumRadius)*4;if(N*=1.5,s.width>N&&S-E<=O){let v=new Za({width:9,height:9,buffer:$at,structure:{heightOffset:S}}),I=ect;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,o.mesh=v._createMeshSync(I)}else{let v=u,I=ce.center(s,Jat);I.height=w;let M=f.cartographicToCartesian(I,Qat),F=new Oc(M,void 0,void 0,void 0,void 0,!0,!0,v,a,c),k=5,V;for(V=o.westMeshes,D=0,R=V.length;D<R;++D)k+=V[D].eastIndicesNorthToSouth.length;for(V=o.southMeshes,D=0,R=V.length;D<R;++D)k+=V[D].northIndicesWestToEast.length;for(V=o.eastMeshes,D=0,R=V.length;D<R;++D)k+=V[D].westIndicesSouthToNorth.length;for(V=o.northMeshes,D=0,R=V.length;D<R;++D)k+=V[D].southIndicesEastToWest.length;let G=Zat;G.minimumHeight=E,G.maximumHeight=S;let U=F.stride,q=new Float32Array(k*U),Y=0,Q=Y;Y=Dk(f,s,F,q,Y,0,1,d.height,d.encodedNormal,1,G),Y=Ok(o,f,F,q,Y,o.westTiles,o.westMeshes,yn.EAST,G);let W=Y;Y=Dk(f,s,F,q,Y,0,0,p.height,p.encodedNormal,0,G),Y=Ok(o,f,F,q,Y,o.southTiles,o.southMeshes,yn.NORTH,G);let K=Y;Y=Dk(f,s,F,q,Y,1,0,g.height,g.encodedNormal,0,G),Y=Ok(o,f,F,q,Y,o.eastTiles,o.eastMeshes,yn.WEST,G);let J=Y;Y=Dk(f,s,F,q,Y,1,1,h.height,h.encodedNormal,1,G),Y=Ok(o,f,F,q,Y,o.northTiles,o.northMeshes,yn.SOUTH,G),E=G.minimumHeight,S=G.maximumHeight;let me=Ln.fromRectangle(s,E,S,n.tilingScheme.ellipsoid),ye=Pi.geodeticLatitudeToMercatorAngle(s.south),se=1/(Pi.geodeticLatitudeToMercatorAngle(s.north)-ye),pe=(Pi.geodeticLatitudeToMercatorAngle(I.latitude)-ye)*se,xe=f.geodeticSurfaceNormalCartographic(VA,kY),we=qn.octEncode(xe,FY),Ee=Y;F.encode(q,Y*U,me.center,H.fromElements(.5,.5,Au),w,we,pe,xe),++Y;let Be=Y,ke=Be<256?1:2,Pe=(Be-1)*3,ft=Pe*ke,_t=(q.length-Be*U)*Float32Array.BYTES_PER_ELEMENT,rt;if(_t>=ft){let Ae=Be*U*Float32Array.BYTES_PER_ELEMENT;rt=Be<256?new Uint8Array(q.buffer,Ae,Pe):new Uint16Array(q.buffer,Ae,Pe)}else rt=Be<256?new Uint8Array(Pe):new Uint16Array(Pe);q=new Float32Array(q.buffer,0,Be*U);let dn=0;for(D=0;D<Be-2;++D)rt[dn++]=Ee,rt[dn++]=D,rt[dn++]=D+1;rt[dn++]=Ee,rt[dn++]=D,rt[dn++]=0;let In=[];for(D=W;D>=Q;--D)In.push(D);let Ht=[];for(D=K;D>=W;--D)Ht.push(D);let Ft=[];for(D=J;D>=K;--D)Ft.push(D);let Te=[];for(Te.push(0),D=Ee-1;D>=J;--D)Te.push(D);o.mesh=new Bd(F.center,q,rt,Pe,Be,E,S,ae.fromOrientedBoundingBox(me),act(e,me.center,s,E,S),F.stride,me,F,In,Ht,Ft,Te)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Gd._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let b=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=r._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(o.waterMaskTexture=v.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,v,o.waterMaskTranslationAndScale))}l(b)&&(--b.referenceCount,b.referenceCount===0&&b.destroy())}function Dk(e,t,n,i,r,o,s,a,c,u,f){let d=VA;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,mb),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,kY));let h=UY;return h.x=o,h.y=s,n.encode(i,r*n.stride,p,h,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var Rk=new ce;function XD(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ce.clone(e.rectangle,Rk),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ce.clone(e.rectangle,Rk),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var tct=new H;function VY(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var nct=new H,ict=new m;function rct(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=XD(t,n,f.decodeTextureCoordinates(d,r,Au),Au),g=XD(t,n,f.decodeTextureCoordinates(d,o,UY),UY),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let A=f.decodeHeight(d,r),x=f.decodeHeight(d,o),C=n.rectangle;VA.longitude=P.lerp(C.west,C.east,s),VA.latitude=P.lerp(C.south,C.north,a),u.height=VA.height=P.lerp(A,x,h);let T;if(f.hasVertexNormals){let E=f.getOctEncodedNormal(d,r,tct),S=f.getOctEncodedNormal(d,o,nct),w=qn.octDecode(E.x,E.y,mb),D=qn.octDecode(S.x,S.y,ict);T=m.lerp(w,D,h,mb),m.normalize(T,T),qn.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(VA,mb),qn.octEncode(T,u.encodedNormal)}function Sge(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(VA,mb);qn.octEncode(s,o.encodedNormal)}function Ik(e,t,n,i,r,o,s,a,c,u,f){if(Ege(e,t,a,s,!1,n,i,f)||Ege(e,t,u,c,!0,n,i,f))return f;let p;if(zY(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],VY(o,p,n,i,f),f;let g;if(n===0?i===0?g=Pk(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=Pk(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=Pk(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=Pk(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return Sge(e,t,n,i,g,f),f}function Pk(e,t,n,i,r,o,s,a){let c=Tge(e,t,!1,n,s,a),u=Tge(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function Ok(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=oct(e,t,n,i,r,o[u],s[u],a,c);return r}function oct(e,t,n,i,r,o,s,a,c){let u=o.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(o.rectangle,Rk),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===yn.WEST&&o.x===0&&(u=ce.clone(o.rectangle,Rk),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Au),d=Au.x,p=Au.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let A=o,x=e.tile,C=s.encoding,T=s.vertices,E=n.stride,S,w;C.hasWebMercatorT&&(S=Pi.geodeticLatitudeToMercatorAngle(f.south),w=1/(Pi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<g.length;++D){let R=g[D],O=C.decodeTextureCoordinates(T,R,Au);XD(A,x,O,O);let L=O.x,N=O.y,_=h?L:N;if(_<0||_>1||Math.abs(L-d)<P.EPSILON5&&Math.abs(N-p)<P.EPSILON5)continue;let b=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5,v=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5;if(b&&v)continue;let I=C.decodePosition(T,R,mb),M=C.decodeHeight(T,R),F;C.hasVertexNormals?F=C.getOctEncodedNormal(T,R,FY):(F=FY,F.x=0,F.y=0);let k=N;if(C.hasWebMercatorT){let G=P.lerp(f.south,f.north,N);k=(Pi.geodeticLatitudeToMercatorAngle(G)-S)*w}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,kY)),n.encode(i,r*E,I,O,M,F,k,V),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function Tge(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!zY(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function zY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Ege(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],h=n[r?0:n.length-1];if(zY(g,h)&&(o===0?s===0?(c=r?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=r,f=r):(c=r?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!r,f=!0):(c=r?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,Au);let A=XD(g,e.tile,Au,Au);if(A.x===o&&A.y===s)return VY(h,p,o,s,a),!0;if(d=Or(c,u?o:s,function(x,C){h.encoding.decodeTextureCoordinates(h.vertices,x,Au);let T=XD(g,e.tile,Au,Au);return f?u?T.x-o:T.y-s:u?o-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return rct(t,g,e.tile,h,c[d-1],c[d],o,s,u,a),!0}else return VY(h,c[d],o,s,a),!0}return!1}var sct=[new m,new m,new m,new m];function act(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=sct;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var KD=hb;function Qr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Qr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Qr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Qr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Qr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(Qr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return l(this._terrainProvider)&&this._terrainProvider._ready&&(this._imageryLayers.length===0||this._imageryLayers.get(0).ready&&this._imageryLayers.get(0).imageryProvider._ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){As.setOwner(e,this,"_clippingPlanes")}}});function cct(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Qr.prototype.update=function(e){this._imageryLayers._update()};function lct(e,t){let n=t.creditDisplay;l(e._terrainProvider)&&e._terrainProvider._ready&&l(e._terrainProvider.credit)&&n.addCreditToNextFrame(e._terrainProvider.credit);let i=e._imageryLayers;for(let r=0,o=i.length;r<o;++r){let s=i.get(r);s.ready&&s.imageryProvider._ready&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}Qr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(cct)})),lct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Gd._freeVertexArray(t[i]);t.length=0};Qr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,r=t.length;i<r;++i){let o=t[i];l(o)&&(o.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Qr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:pc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:pc.LESS_OR_EQUAL},blending:hn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&KD.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let o=this._tilesToRenderByTextureCount;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;Pge(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){Pge(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Oge(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Qr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Oge(t[n],e)};Qr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Qr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Qr.prototype.loadTile=function(e,t){let n=t.data,i=!0,r;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Qn.CULLED_BUT_NEEDED,r=n.terrainState),Gd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&r!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==po.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Gd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var uct=new ae,Rge=new ce,fct=new ce,dct=new he;function Lk(e,t){if(t.west<t.east)return t;let n=ce.clone(t,fct);return ce.center(e,dct).longitude>0?n.east=P.PI:n.west=-P.PI,n}function Mge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}Qr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let r=Mge(this,t);if(t.fog.enabled&&!r&&P.fog(i,t.fog.density)>=1)return po.NONE;let o=e.data,s=o.tileBoundingRegion;if(o.boundingVolumeSourceTile===void 0)return po.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),o.clippedByBoundaries=!1;let u=Lk(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Rge);if(!l(f))return po.NONE;if(ce.equals(f,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=uct,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(o.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return po.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let A=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=A!==tn.INSIDE,A===tn.OUTSIDE)return po.NONE}let p,g=a.computeVisibility(c);if(g===tn.OUTSIDE?p=po.NONE:g===tn.INTERSECTING?p=po.PARTIAL:g===tn.INSIDE&&(p=po.FULL),p===po.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===ne.SCENE3D&&!h&&l(n)&&!r){let A=o.occludeePointInScaledSpace;return!l(A)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(A,s.minimumHeight)?p:po.NONE}return p};Qr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var mct=[],hct=[];Qr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=mct;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===yr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===fi.FAILED||p.state===fi.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,f=hct;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Qn.NONE;if(p===Qn.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===yr.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let A=h[a],x=A.loadingImagery,C=!l(x)||x.state===fi.FAILED||x.state===fi.INVALID,T=(A.loadingImagery||A.readyImagery).imageryLayer._layerIndex;if(C&&!i[T])return!1}}else p===Qn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var pct=new m;Qr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,s=m.subtract(i.center,r,pct),a=m.magnitude(s);return a<P.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,o))*e._distance)};var vge=new B,Bk=new B,_ct=new oe,gct=new oe,yct=new oe,Act=new m,wge=new m,xct=new m,Cct=new m;Qr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let r=this._tilesToRenderByTextureCount[n];l(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);let o=e.data;l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Tct=[new m,new m,new m,new m];function Dge(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Tct;return m.fromRadians(n.west,n.south,r,a,c[0]),m.fromRadians(n.east,n.south,r,a,c[1]),m.fromRadians(n.west,n.north,r,a,c[2]),m.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}Qr.prototype.computeDistanceToTile=function(e,t){Ect(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let r=n.tileBoundingRegion,o=r.minimumHeight,s=r.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-o),f=Math.abs(c-s);u>f?(r.minimumHeight=o,r.maximumHeight=o):(r.minimumHeight=s,r.maximumHeight=s)}let a=r.distanceToCamera(t);return r.minimumHeight=o,r.maximumHeight=s,a};function Ect(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Gd);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new ad({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let x=0;x<d.rectangles.length;x++)if(ce.intersection(e.rectangle,d.rectangles[x])){f=d.heights[x];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let x=0;x<p.rectangles.length;x++)if(ce.intersection(o.rectangle,p.rectangles[x])){g=p.height;break}}let h=i.mesh,A=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)o.minimumHeight=h.minimumHeight,o.maximumHeight=h.maximumHeight,c=!0;else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0)o.minimumHeight=A._minimumHeight,o.maximumHeight=A._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let x=e.parent;for(;x!==void 0;){let C=x.data;if(C!==void 0){let T=C.mesh,E=C.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0){o.minimumHeight=T.minimumHeight,o.maximumHeight=T.maximumHeight;break}else if(E!==void 0&&E._minimumHeight!==void 0&&E._maximumHeight!==void 0){o.minimumHeight=E._minimumHeight,o.maximumHeight=E._maximumHeight;break}}x=x.parent}u=x}if(o.maximumHeight+=g,o.maximumHeight<f&&(o.maximumHeight=f),o.minimumHeight>f&&(o.minimumHeight=f),u!==void 0){let x=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((x!==1||f!==0)&&(c=!1,o.minimumHeight=Yc.getHeight(o.minimumHeight,x,C),o.maximumHeight=Yc.getHeight(o.maximumHeight,x,C)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=Ln.clone(h.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ae.clone(h.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Dge(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let E=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||E)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=Dge(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Qr.prototype.isDestroyed=function(){return!1};Qr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function bct(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=y(r.readyImagery,r.loadingImagery),o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?y(r.readyImagery,r.loadingImagery):void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}Qr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,r=this._imageryLayersUpdatedEvent,o=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=bct(d,e,n),s.state=ta.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=o}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ta.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Qn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}};Qr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,r=-1,o=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)r===-1&&(r=s),c.freeResources(),++o;else if(r!==-1)break}r!==-1&&i.splice(r,o)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Qr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Qr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Sct=new B,vct=new B;function Ige(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=B.multiplyByPoint(i,this.properties.rtc,wge);return B.setTranslation(i,r,vge),vge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=B.multiplyByPoint(i,this.properties.rtc,wge);return B.setTranslation(i,o,Bk),B.multiply(r,Bk,Bk),Bk},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?B.multiply(e.context.uniformState.view,i.modelMatrix,Sct):B.IDENTITY;return B.inverseTranspose(r,vct)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return l(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return l(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new B,tileRectangle:new oe,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new H,scaleAndBias:new B,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=gt(n,i)}return l(t.materialUniformMap)?gt(n,t.materialUniformMap):n}function wct(e,t,n){let i=n.data,r,o;if(l(i.vertexArray)?(r=i.mesh,o=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),!(!l(r)||!l(o))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Dct(e,o,r),i.wireframeVertexArray.mesh=r}}function Dct(e,t,n){let r={indices:n.indices,primitiveType:Le.TRIANGLES};Vn.toWireframe(r);let o=r.indices,s=ht.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new si({context:e,attributes:t._attributes,indexBuffer:s})}var Bge,Lge,Nk;(function(){let e=new Tt({geometry:sm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Tt({geometry:new _g({radius:1})}),n=new B,i,r;function o(s){return new wn({geometryInstances:s,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}Bge=function(s,a){return s===i||(Nk(),i=s,n=B.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=zt.fromColor(a),r=o(e)),r},Lge=function(s,a){return s===i||(Nk(),i=s,n=B.fromTranslation(s.center,n),n=B.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=zt.fromColor(a),r=o(t)),r},Nk=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Ict=new oe(0,0,0,0),Pct={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Oct=z.TRANSPARENT,Rct=new Lt;function Pge(e,t,n,i){let r=t.data;l(r.vertexArray)||(r.fill===void 0&&(r.fill=new KD(t)),r.fill.update(e,n));let o=n.creditDisplay,s=r.terrainData;if(l(s)&&l(s.credits)){let Ae=s.credits;for(let ut=0,ti=Ae.length;ut<ti;++ut)o.addCreditToNextFrame(Ae[ut])}let a=Gt.maximumTextureImageUnits,c=r.waterMaskTexture,u=r.waterMaskTranslationAndScale;!l(c)&&l(r.fill)&&(c=r.fill.waterMaskTexture,u=r.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,A=d.rectangle,x=y(e.undergroundColor,Oct),C=y(e.undergroundColorAlphaByDistance,Rct),T=Mge(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(C.nearValue>0||C.farValue>0),E=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,w=e.hasWaterMask&&l(c),D=e.oceanNormalMap,R=w&&l(D),O=l(e.terrainProvider)&&e.terrainProvider._ready&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!f,N=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,_=xn.castShadows(e.shadows)&&!p,b=xn.receiveShadows(e.shadows)&&!p,v=e.hueShift,I=e.saturationShift,M=e.brightnessShift,F=!(P.equalsEpsilon(v,0,P.EPSILON7)&&P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(M,0,P.EPSILON7)),k=!1;if(N){let Ae=m.magnitude(n.camera.positionWC),ut=e.nightFadeOutDistance;k=Ae>ut}w&&--a,R&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let V=r.renderedMesh,G=V.center,U=V.encoding,q=r.tileBoundingRegion,Y=n.terrainExaggeration,Q=n.terrainExaggerationRelativeHeight,W=e.marsOptions?.uplift;i&&W&&(Q=n.terrainExaggerationRelativeHeight-W.height/(Y-1));let K=Y!==1,J=U.hasGeodeticSurfaceNormals,me=_ct,ye=0,se=0,pe=0,xe=0,we=!1;if(n.mode!==ne.SCENE3D){let Ae=n.mapProjection,ut=Ae.project(ce.southwest(t.rectangle),xct),ti=Ae.project(ce.northeast(t.rectangle),Cct);if(me.x=ut.x,me.y=ut.y,me.z=ti.x,me.w=ti.y,n.mode!==ne.MORPHING&&(G=Act,G.x=0,G.y=(me.z+me.x)*.5,G.z=(me.w+me.y)*.5,me.x-=G.y,me.y-=G.z,me.z-=G.y,me.w-=G.z),n.mode===ne.SCENE2D&&U.quantization===Qs.BITS12){let Je=1/(Math.pow(2,12)-1)*.5,or=(me.z-me.x)*Je,Qo=(me.w-me.y)*Je;me.x-=or,me.y-=Qo,me.z+=or,me.w+=Qo}Ae instanceof Pi&&(ye=t.rectangle.south,se=t.rectangle.north,pe=Pi.geodeticLatitudeToMercatorAngle(ye),xe=1/(Pi.geodeticLatitudeToMercatorAngle(se)-pe),we=!0)}let Ee=Pct;Ee.frameState=n,Ee.surfaceTile=r,Ee.showReflectiveOcean=w,Ee.showOceanWaves=R,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=N,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=k,Ee.hasVertexNormals=O,Ee.useWebMercatorProjection=we,Ee.clippedByBoundaries=r.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=J,Ee.hasExaggeration=K;let Be=r.imagery,ke=0,Pe=Be.length,ft=e.showSkirts&&!f&&!p,_t=e.backFaceCulling&&!f&&!p,rt=_t?e._renderState:e._disableCullingRenderState,dn=_t?e._blendRenderState:e._disableCullingBlendRenderState,In=rt,Ht=e._firstPassInitialColor,Ft=n.context;if(l(e._debug.boundingSphereTile)||Nk(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ae=e._drawCommands.length;for(let ut=0;ut<Ae;++ut)e._uniformMaps[ut]=Ige(n,e)}do{let Ae=0,ut,ti;if(e._drawCommands.length<=e._usedDrawCommands?(ut=new nt,ut.owner=t,ut.cull=!1,ut.boundingVolume=new ae,ut.orientedBoundingBox=void 0,ti=Ige(n,e),e._drawCommands.push(ut),e._uniformMaps.push(ti)):(ut=e._drawCommands[e._usedDrawCommands],ti=e._uniformMaps[e._usedDrawCommands]),ut.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Vr=q.boundingVolume,Ir=q.boundingSphere;l(Vr)?Bge(Vr,z.RED).update(n):l(Ir)&&Lge(Ir,z.RED).update(n)}let Je=ti.properties;oe.clone(Ht,Je.initialColor),Je.oceanNormalMap=D,Je.lightingFadeDistance.x=e.lightingFadeOutDistance,Je.lightingFadeDistance.y=e.lightingFadeInDistance,Je.nightFadeDistance.x=e.nightFadeOutDistance,Je.nightFadeDistance.y=e.nightFadeInDistance,Je.atmosphereLightIntensity=e.atmosphereLightIntensity,Je.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Je.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Je.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Je.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Je.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Je.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let or=f?h:g,Qo=f?g:h;l(or)&&(oe.fromElements(or.near,or.nearValue,or.far,or.farValue,Je.frontFaceAlphaByDistance),oe.fromElements(Qo.near,Qo.nearValue,Qo.far,Qo.farValue,Je.backFaceAlphaByDistance)),oe.fromElements(C.near,C.nearValue,C.far,C.farValue,Je.undergroundColorAlphaByDistance),z.clone(x,Je.undergroundColor),Je.lambertDiffuseMultiplier=E,Je.vertexShadowDarkness=S;let va=!l(r.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;va&&z.clone(e.fillHighlightColor,Je.fillHighlightColor),Je.terrainExaggerationAndRelativeHeight.x=Y,Je.terrainExaggerationAndRelativeHeight.y=Q,Je.center3D=V.center,m.clone(G,Je.rtc),oe.clone(me,Je.tileRectangle),Je.southAndNorthLatitude.x=ye,Je.southAndNorthLatitude.y=se,Je.southMercatorYAndOneOverHeight.x=pe,Je.southMercatorYAndOneOverHeight.y=xe;let Io=gct,Dr=Lk(t.rectangle,e.cartographicLimitRectangle),Ve=yct,ot=Lk(t.rectangle,A);m.fromElements(v,I,M,Je.hsbShift);let je=t.rectangle,Ze=1/je.width,mt=1/je.height;Io.x=(Dr.west-je.west)*Ze,Io.y=(Dr.south-je.south)*mt,Io.z=(Dr.east-je.west)*Ze,Io.w=(Dr.north-je.south)*mt,oe.clone(Io,Je.localizedCartographicLimitRectangle),Ve.x=(ot.west-je.west)*Ze,Ve.y=(ot.south-je.south)*mt,Ve.z=(ot.east-je.west)*Ze,Ve.w=(ot.north-je.south)*mt;let kt=e.marsOptions?.flat;if(kt){let Vr=kt.areas,Ir=0;Vr?(Vr.forEach(sa=>{Ir<sa.length&&(Ir=sa.length)}),Je.mars_flat_AreaWidth=Vr.length):Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=Ir,Je.mars_flat_AreaTexture=kt.texture,Je.mars_flat_enabled=kt.enabled}else Je.mars_flat_enabled=!1,Je.mars_flat_AreaWidth=0,Je.mars_flat_AreaHeight=0,Je.mars_flat_AreaTexture=void 0;Je.inverseTileWidth=Ze,Je.cartographicTileRectangle=new H(je.west,je.south);let Jt=e.marsOptions?.uplift;if(Jt){let Vr=Jt.areas,Ir=0;Vr?(Vr.forEach(sa=>{Ir<sa.length&&(Ir=sa.length)}),Je.mars_uplift_RectangleWidth=Vr.length):Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=Ir,Je.mars_uplift_RampRectangle=Jt.texture,Je.mars_uplift_enabled=(!Jt.showUp||Jt.enabled&&e._topographicUpliftHeight!==0)&&l(Jt.rectangles)&&Jt.rectangles.length>0,Je.mars_uplift_hideInsideOrOutside=!i}else Je.mars_uplift_enabled=!1,Je.mars_uplift_hideInsideOrOutside=!1,Je.mars_uplift_RectangleWidth=0,Je.mars_uplift_RectangleHeight=0,Je.mars_uplift_RampRectangle=void 0;oe.clone(Ve,Je.localizedTranslucencyRectangle);let $i=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;F=F&&($i||N);let dr=!1,$o=!1,Is=!1,ao=!1,ki=!1,Ho=!1,Fn=!1,sn=!1,Wn=!1,vn=!1,Ps=!1,mi=!1;for(;Ae<a&&ke<Pe;){let Vr=Be[ke],Ir=Vr.readyImagery;if(++ke,!l(Ir)||Ir.imageryLayer.alpha===0)continue;let sa=Vr.useWebMercatorT?Ir.textureWebMercator:Ir.texture,xr=Ir.imageryLayer;l(Vr.textureTranslationAndScale)||(Vr.textureTranslationAndScale=xr._calculateTextureTranslationAndScale(t,Vr)),Je.dayTextures[Ae]=sa,Je.dayTextureTranslationAndScale[Ae]=Vr.textureTranslationAndScale,Je.dayTextureTexCoordsRectangle[Ae]=Vr.textureCoordinateRectangle,Je.dayTextureUseWebMercatorT[Ae]=Vr.useWebMercatorT,Je.dayTextureAlpha[Ae]=xr.alpha,Ho=Ho||Je.dayTextureAlpha[Ae]!==1,Je.dayTextureNightAlpha[Ae]=xr.nightAlpha,Fn=Fn||Je.dayTextureNightAlpha[Ae]!==1,Je.dayTextureDayAlpha[Ae]=xr.dayAlpha,Fn=Fn||Je.dayTextureDayAlpha[Ae]!==1,Je.dayTextureBrightness[Ae]=xr.brightness,dr=dr||Je.dayTextureBrightness[Ae]!==na.DEFAULT_BRIGHTNESS,Je.dayTextureContrast[Ae]=xr.contrast,$o=$o||Je.dayTextureContrast[Ae]!==na.DEFAULT_CONTRAST,Je.dayTextureHue[Ae]=xr.hue,Is=Is||Je.dayTextureHue[Ae]!==na.DEFAULT_HUE,Je.dayTextureSaturation[Ae]=xr.saturation,ao=ao||Je.dayTextureSaturation[Ae]!==na.DEFAULT_SATURATION,Je.dayTextureOneOverGamma[Ae]=1/xr.gamma,ki=ki||Je.dayTextureOneOverGamma[Ae]!==1/na.DEFAULT_GAMMA,Je.dayTextureSplit[Ae]=xr.splitDirection,sn=sn||Je.dayTextureSplit[Ae]!==0,Ps=Ps||!!xr.invertColor,Je.mars3dTextureInvertColor[Ae]=!!xr.invertColor,mi=mi||!!xr.filterColor,xr.filterColor?Je.mars3dTextureFilterColor[Ae]=new m(xr.filterColor.red,xr.filterColor.green,xr.filterColor.blue):Je.mars3dTextureFilterColor[Ae]=new m(1,1,1);let Rs=Je.dayTextureCutoutRectangles[Ae];if(l(Rs)||(Rs=Je.dayTextureCutoutRectangles[Ae]=new oe),oe.clone(oe.ZERO,Rs),l(xr.cutoutRectangle)){let ds=Lk(je,xr.cutoutRectangle),xh=ce.simpleIntersection(ds,je,Rge);Wn=l(xh)||Wn,Rs.x=(ds.west-je.west)*Ze,Rs.y=(ds.south-je.south)*mt,Rs.z=(ds.east-je.west)*Ze,Rs.w=(ds.north-je.south)*mt}let Pr=Je.colorsToAlpha[Ae];l(Pr)||(Pr=Je.colorsToAlpha[Ae]=new oe);let Rf=l(xr.colorToAlpha)&&xr.colorToAlphaThreshold>0;if(vn=vn||Rf,Rf){let ds=xr.colorToAlpha;Pr.x=ds.red,Pr.y=ds.green,Pr.z=ds.blue,Pr.w=xr.colorToAlphaThreshold}else Pr.w=-1;if(l(Ir.credits)){let ds=Ir.credits;for(let xh=0,HI=ds.length;xh<HI;++xh)o.addCreditToNextFrame(ds[xh])}++Ae}Je.dayTextures.length=Ae,Je.waterMask=c,oe.clone(u,Je.waterMaskTranslationAndScale),Je.minMaxHeight.x=U.minimumHeight,Je.minMaxHeight.y=U.maximumHeight,B.clone(U.matrix,Je.scaleAndBias);let oa=e._clippingPlanes,bu=l(oa)&&oa.enabled&&t.isClipped;bu&&(Je.clippingPlanesEdgeColor=z.clone(oa.edgeColor,Je.clippingPlanesEdgeColor),Je.clippingPlanesEdgeWidth=oa.edgeWidth),Ee.numberOfDayTextures=Ae,Ee.applyBrightness=dr,Ee.applyContrast=$o,Ee.applyHue=Is,Ee.applySaturation=ao,Ee.applyGamma=ki,Ee.applyAlpha=Ho,Ee.applyDayNightAlpha=Fn,Ee.applySplit=sn,Ee.enableFog=$i,Ee.enableClippingPlanes=bu,Ee.clippingPlanes=oa,Ee.hasImageryLayerCutout=Wn,Ee.colorCorrect=F,Ee.highlightFillTile=va,Ee.colorToAlpha=vn,Ee.showUndergroundColor=T,Ee.translucent=p,Ee.marsOptions={invertColor:Ps,filterColor:mi,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let Of=r.renderedMesh.indices.length;ft||(Of=r.renderedMesh.indexCountWithoutSkirts),ut.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),ut.castShadows=_,ut.receiveShadows=b,ut.renderState=In,ut.primitiveType=Le.TRIANGLES,ut.vertexArray=r.vertexArray||r.fill.vertexArray,ut.count=Of,ut.uniformMap=ti,ut.pass=Se.GLOBE,e._debug.wireframe&&(wct(Ft,e,t),l(r.wireframeVertexArray)&&(ut.vertexArray=r.wireframeVertexArray,ut.primitiveType=Le.LINES,ut.count=Of*2));let Os=ut.boundingVolume,Vb=ut.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,Os),m.fromElements(Os.center.z,Os.center.x,Os.center.y,Os.center),n.mode===ne.MORPHING&&(Os=ae.union(q.boundingSphere,Os,Os))):(ut.boundingVolume=ae.clone(q.boundingSphere,Os),ut.orientedBoundingBox=Ln.clone(q.boundingVolume,Vb)),ut.dirty=!0,p&&d.updateDerivedCommands(ut,n),Oge(ut,n),In=dn,Ht=Ict}while(ke<Pe)}var Fk=Qr;function Nge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(Nge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Lt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Lt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var Uk=Nge;function fs(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(fs.prototype,{length:{get:function(){return this._layers.length}}});fs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};fs.prototype.addImageryProvider=function(e,t){let n=new na(e);return this.add(n,t),n};fs.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};fs.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};fs.prototype.contains=function(e){return this.indexOf(e)!==-1};fs.prototype.indexOf=function(e){return this._layers.indexOf(e)};fs.prototype.get=function(e){return this._layers[e]};function Vk(e,t){return e.indexOf(t)}function Fge(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}fs.prototype.raise=function(e){let t=Vk(this._layers,e);Fge(this,t,t+1)};fs.prototype.lower=function(e){let t=Vk(this._layers,e);Fge(this,t,t-1)};fs.prototype.raiseToTop=function(e){let t=Vk(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};fs.prototype.lowerToBottom=function(e){let t=Vk(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Mct=new ce;function Uge(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ce.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let d=Mct,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(u)}}fs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];if(Uge(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};fs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];if(Uge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(r.push(c),o.push(s.imageryLayer))}),r.length!==0)return Promise.all(r).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=o[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};fs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};fs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};fs.prototype.isDestroyed=function(){return!1};fs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};fs.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var kk=fs;function Vge(e){this._ellipsoid=new vg(e.ellipsoid,m.ZERO)}Object.defineProperties(Vge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var zk=Vge;function Bc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Qn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Bc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),r=0;for(let o=0;o<n;++o)for(let s=0;s<t;++s)i[r++]=new Bc({tilingScheme:e,x:s,y:o,level:0});return i};Bc.prototype._updateCustomData=function(e,t,n){let i=this.customData,r,o,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,r=0;r<t.length;++r)o=t[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(r=0;r<c.length;++r)o=c[r],ce.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Bc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Bc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Bc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Bc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Bc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ta.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Bc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(r){return r.x===t&&r.y===n})[0]};Bc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Bc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Bc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Bc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Bc.prototype.freeResources=function(){this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),Hk(this._southwestChild),this._southwestChild=void 0,Hk(this._southeastChild),this._southeastChild=void 0,Hk(this._northwestChild),this._northwestChild=void 0,Hk(this._northeastChild),this._northeastChild=void 0};function Hk(e){l(e)&&e.freeResources()}var Gk=Bc;function Wk(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}Wk.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};Wk.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),kge(this,t)),t=i}};function kge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}Wk.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&kge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var jk=Wk;function Cf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new jk,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new zk({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Cf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Cf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Bct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Hge(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData,s=o.length;for(let a=0;a<s;++a){let c=o[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Cf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ta.START&&e(t),t=t.replacementNext};Cf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Cf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let s=0;s<o;++s)if(r[s]===i){r.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Cf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Hge(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Cf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Bct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Hge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Cf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Uct(this,e),Xct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Lct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=_e.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Cf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Wct(this,e),qct(this,e),Lct(this,e))};Cf.prototype.isDestroyed=function(){return!1};Cf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var ZD,zge=new he;function Nct(e,t){let n=ce.center(e.rectangle,zge),i=n.longitude-ZD.longitude,r=n.latitude-ZD.latitude;n=ce.center(t.rectangle,zge);let o=n.longitude-ZD.longitude,s=n.latitude-ZD.latitude;return i*i+r*r-(o*o+s*s)}var Fct=new m,JD=[];function Uct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r,o=e._tileProvider;if(!l(e._levelZeroTiles))if(o.ready){let A=o.tilingScheme;e._levelZeroTiles=Gk.createLevelZeroTiles(A);let x=e._levelZeroTiles.length;if(JD.length<x)for(JD=new Array(x),r=0;r<x;++r)JD[r]===void 0&&(JD[r]=new QD)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;ZD=t.camera.positionCartographic,a.sort(Nct);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(r=0,p=a.length;r<p;++r)s=a[r],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=B.getTranslation(g.transform,Fct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),r=0,p=a.length;r<p;++r)s=a[r],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ta(e,s,o,t,c,!1,JD[r]):(Kp(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function Kp(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function QD(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Gge(){this.southwest=new QD,this.southeast=new QD,this.northwest=new QD,this.northeast=new QD}Gge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var WY=new Array(31);for(let e=0;e<WY.length;++e)WY[e]=new Gge;function Vct(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=Hct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Qn.NONE,g=e.tileProvider;if(s||i){let h=Qn.originalResult(p)===Qn.RENDERED,A=Qn.originalResult(p)===Qn.CULLED||p===Qn.NONE,x=n.state===ta.DONE,C=h||A||x;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&Kp(e,e._tileLoadQueueMedium,n,t),Yk(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&Kp(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){Yk(e,n),Kp(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.REFINED;let A=e._tilesToRender.length,x=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,E=e._tileToUpdateHeights.length;if(kct(e,a,c,u,f,t,i,r),A!==e._tilesToRender.length){let S=r.allAreRenderable,w=r.anyWereRenderedLastFrame,D=r.notYetRenderableCount,R=!1;if(!S&&!w){let O=e._tilesToRender;for(let N=A;N<O.length;++N){let _=O[N];for(;_!==void 0&&_._lastSelectionResult!==Qn.KICKED&&_!==n;)_._lastSelectionResult=Qn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=A,e._tileToUpdateHeights.length=E,Yk(e,n),n._lastSelectionResult=Qn.RENDERED;let L=p===Qn.RENDERED;!L&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=T,Kp(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,R=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!R&&Kp(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,Yk(e,n),Kp(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Qn.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function kct(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=WY[t.level],p=d.southwest,g=d.southeast,h=d.northwest,A=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ta(e,t,u,o,f,s,p),Ta(e,n,u,o,f,s,g),Ta(e,i,u,o,f,s,h),Ta(e,r,u,o,f,s,A)):(Ta(e,i,u,o,f,s,h),Ta(e,t,u,o,f,s,p),Ta(e,r,u,o,f,s,A),Ta(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Ta(e,n,u,o,f,s,g),Ta(e,t,u,o,f,s,p),Ta(e,r,u,o,f,s,A),Ta(e,i,u,o,f,s,h)):(Ta(e,r,u,o,f,s,A),Ta(e,i,u,o,f,s,h),Ta(e,n,u,o,f,s,g),Ta(e,t,u,o,f,s,p)),d.combine(a)}function zct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ta(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==po.NONE)return Vct(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,zct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&Kp(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Qn.NONE;c!==Qn.CULLED_BUT_NEEDED&&c!==Qn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Qn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(Kp(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Qn.CULLED):t._lastSelectionResult=Qn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Hct(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof Po)return Gct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Gct(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function Yk(e,t){e._tilesToRender.push(t)}function Wct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=Ci()+e._loadQueueTimeSlice,s=e._tileProvider,a=HY(e,t,s,o,n,!1);a=HY(e,t,s,o,i,a),HY(e,t,s,o,r,a)}function jct(e,t){return e._loadPriority-t._loadPriority}function HY(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(jct);for(let s=0,a=r.length;s<a&&(Ci()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var pb=new On,GY=new he,Sy=new m,Yct=[];function qct(e,t){if(!e.tileProvider.ready)return;let n=Yct;n.length=0;let i=e._tileToUpdateHeights,r=Ci(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Qn.NONE;(A===Qn.RENDERED||A===Qn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let A=p[f],x=d.data.terrainData,C=l(x)&&x.wasCreatedByUpsampling();if(d.level>A.level&&!C){if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=m.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let E=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,pb.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,pb.origin);if(!l(S)){let w=0;l(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(w,-11500),R=m.multiplyByScalar(E,Math.abs(D)+1,Sy);m.subtract(A.positionOnEllipsoidSurface,R,pb.origin)}}else he.clone(A.positionCartographic,GY),GY.height=-11500,c.project(GY,Sy),m.fromElements(Sy.z,Sy.x,Sy.y,Sy),m.clone(Sy,pb.origin),m.clone(m.UNIT_X,pb.direction);let T=d.data.pick(pb,a,c,!1,Sy);l(T)&&(l(A.callback)&&A.callback(T),A.level=d.level)}if(Ci()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Xct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var qk=Cf;function Wd(e){e=y(e,re.WGS84);let t=new qE({ellipsoid:e}),n=new kk;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Ek,this._material=void 0,this._surface=new qk({tileProvider:new Fk({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Lt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new Uk,YY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Wd.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&YY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,YY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Lt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function YY(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[by,jD];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Ck),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[by,jD,Tk],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Kct(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),r=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var Jct=[],Zct={start:0,stop:0};Wd.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let r=t.mode,o=t.mapProjection,s=Jct;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(r!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,o,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=Ki.raySphere(e,g,Zct);l(h)&&s.push(p)}s.sort(Kct(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var Qct=new he;Wd.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Qct);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var $ct=new m,Wge=new m,elt=new he,tlt=new On;function jY(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}Wd.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=jY(n._southwestChild,e)||jY(n._southeastChild,e)||jY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,$ct),u=tlt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),A=m.multiplyByScalar(f,Math.abs(h)+1,Wge);m.subtract(c,A,u.origin)}let p=n.data.pick(u,void 0,s,!1,Wge);if(l(p))return a.cartesianToCartographic(p,elt).height};Wd.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Wd.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=this.showWaterEffect&&l(i)&&i.hasWaterMask&&i._ready&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Bt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Wd.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Wd.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Wd.prototype.isDestroyed=function(){return!1};Wd.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var Xk=Wd;var xu=`uniform sampler2D colorTexture; + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a -in vec2 v_textureCoordinates; + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; -void main() -{ - out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var kA=`uniform highp sampler2D u_depthTexture; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; -in vec2 v_textureCoordinates; + /////////////////////////////////////////////////////////////////////////// -void main() -{ - out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function dh(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(dh.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function nlt(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function jge(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ke.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ke.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ke.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ke.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(kA,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(kA,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new oi({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}dh.prototype.update=function(e,t,n,i,r,o){let s=n.width,a=n.height,c=r?e.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT:Qe.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),jge(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o};dh.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};dh.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};dh.prototype.executeUpdateDepth=function(e,t,n,i){let r=l(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,o,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,o,s),jge(this,e,o,s,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};dh.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};dh.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return nlt(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var Kk=dh;function zA(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(zA.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function ilt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function rlt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT:Qe.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function olt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Ke.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,Ke.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Ke.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(kA,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new oi({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}zA.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;rlt(this,n,r,o,e),olt(this,n,r,o,i),this._useHdr=e};zA.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};zA.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};zA.prototype.isDestroyed=function(){return!1};zA.prototype.destroy=function(){return ilt(this),ue(this)};var Jk=zA;var ia={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},HA=ia.DERIVED_COMMANDS_MAXIMUM_LENGTH,tye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function GA(){this._frontFaceAlphaByDistance=new Lt(0,1,0,1),this._backFaceAlphaByDistance=new Lt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(HA),this._derivedBlendCommandTypes=new Array(HA),this._derivedPickCommandTypes=new Array(HA),this._derivedCommandTypesToUpdate=new Array(HA),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(GA.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});GA.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Yge(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Yge(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=qge(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=qge(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=llt(this,e,t),this._sunVisibleThroughGlobe=slt(this,e),this._environmentVisible=alt(this,e),this._useDepthPlane=clt(this,e),this._numberOfTextureUniforms=ult(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),flt(this,e)};function Yge(e,t,n,i){return e?l(n)?(Lt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function qge(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function slt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function alt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function clt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function llt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function ult(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function flt(e,t){e._derivedCommandsLength=qY(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=qY(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=qY(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<HA;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=vlt())}function qY(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ia.PICK_FRONT_FACE:u?ia.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ia.TRANSLUCENT_FRONT_FACE,d=i?ia.PICK_BACK_FACE:u?ia.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ia.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(r[o++]=ia.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=ia.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=ia.DEPTH_ONLY_BACK_FACE),r[o++]=ia.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=ia.DEPTH_ONLY_FRONT_FACE),r[o++]=ia.OPAQUE_BACK_FACE,r[o++]=f),o)}function Tf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Xge(e,t){return e.indexOf(t)>-1}function dlt(e,t){Tf(e.defines,"TRANSLUCENT"),Tf(t.defines,"TRANSLUCENT")}function mlt(e,t){Tf(e.defines,"GROUND_ATMOSPHERE"),Tf(t.defines,"GROUND_ATMOSPHERE"),Tf(e.defines,"FOG"),Tf(t.defines,"FOG"),Tf(e.defines,"TRANSLUCENT"),Tf(t.defines,"TRANSLUCENT")}function XY(e,t){if(Xge(t.defines,"TILE_LIMIT_RECTANGLE")||Xge(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function KY(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=He.replaceMain(n[o],"czm_globe_translucency_main");let r=` + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; -uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; -#ifdef MANUAL_DEPTH_TEST - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - if (logDepthOrDepth != 0.0) - { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } - } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) - { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; - } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`;n.push(r)}function nye(e,t){KY(e,t),Tf(e.defines,"GROUND_ATMOSPHERE"),Tf(t.defines,"GROUND_ATMOSPHERE"),Tf(e.defines,"FOG"),Tf(t.defines,"FOG")}function hlt(e,t){KY(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function plt(e,t){nye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Kge(e,t){let n=`uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; - vec4 pickColor = texture(u_classificationTexture, st); - if (pickColor == vec4(0.0)) - { - discard; - } - out_FragColor = pickColor; -} -`;t.sources=[n]}function _lt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function glt(e){e.cull.face=gi.BACK,e.cull.enabled=!0}function ylt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0}function Alt(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xlt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Clt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Jge(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function Zge(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function Tlt(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Elt(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function blt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=ze.getState(e);i(s),o=ze.fromCache(s),r[e.id]=o}return o}function _b(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Slt(e,t,n,i,r){return l(r)?!i&&l(n)?n:gt(t,r(e),!1):t}function jd(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function vlt(){return[new jd({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:dlt,getRenderStateFunction:glt,getUniformMapFunction:void 0}),new jd({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:mlt,getRenderStateFunction:ylt,getUniformMapFunction:void 0}),new jd({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:XY,getRenderStateFunction:Alt,getUniformMapFunction:void 0}),new jd({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:XY,getRenderStateFunction:xlt,getUniformMapFunction:void 0}),new jd({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:XY,getRenderStateFunction:Clt,getUniformMapFunction:void 0}),new jd({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:KY,getRenderStateFunction:Jge,getUniformMapFunction:_b}),new jd({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:nye,getRenderStateFunction:Zge,getUniformMapFunction:_b}),new jd({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hlt,getRenderStateFunction:Jge,getUniformMapFunction:_b}),new jd({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:plt,getRenderStateFunction:Zge,getUniformMapFunction:_b}),new jd({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Kge,getRenderStateFunction:Tlt,getUniformMapFunction:_b}),new jd({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Kge,getRenderStateFunction:Elt,getUniformMapFunction:_b})]}var Qge=new Array(HA),$ge=new Array(HA);GA.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)$ge[r]=this._derivedCommandPacks[n[r]],Qge[r]=tye[n[r]];wlt(this,e,i,n,Qge,$ge,t)}};function wlt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,A=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),A&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let C=o[x],T=i[x],E=r[x],S=a[E],w,D,R;l(S)?(w=S.uniformMap,D=S.shaderProgram,R=S.renderState):(w=void 0,D=void 0,R=void 0),S=nt.shallowClone(t,S),a[E]=S;let O=y(S.derivedCommands.uniformMapDirtyFrame,0),L=y(S.derivedCommands.shaderProgramDirtyFrame,0),N=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||O<f,b=h||L<d,v=A||N<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),b&&(S.derivedCommands.shaderProgramDirtyFrame=u),v&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=T,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=Slt(e,t.uniformMap,w,_,C.getUniformMapFunction),S.shaderProgram=_lt(s.context,t.shaderProgram,D,b,C.getShaderProgramFunction,E),S.renderState=blt(t.renderState,R,v,C.getRenderStateFunction,C.renderStateCache)}}}GA.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=tye[r[a]];n.commandList.push(s[c])}};function iye(e,t,n,i,r,o,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,r,o)}}function eye(e,t,n,i,r,o){for(let s=0;s<t;++s)n(e[s],i,r,o)}var Dlt=[ia.OPAQUE_FRONT_FACE,ia.OPAQUE_BACK_FACE],Ilt=[ia.DEPTH_ONLY_FRONT_FACE,ia.DEPTH_ONLY_BACK_FACE,ia.DEPTH_ONLY_FRONT_AND_BACK_FACE];GA.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),iye(s,a,t,i,o,r,Dlt))};GA.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE],c=e.commands[Se.TERRAIN_CLASSIFICATION],u=e.indices[Se.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&eye(c,u,t,i,o,r),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=o.uniformState.globeDepthTexture,g=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,iye(s,a,t,i,o,r,Ilt),o.depthTexture){let h=n.packDepth(o,r);o.uniformState.globeDepthTexture=h}eye(c,u,t,i,o,r),o.uniformState.globeDepthTexture=p,r.framebuffer=g};var Zk=GA;var rye=co(Sj(),1);function JY(){this._image=new Image}JY.prototype.isReady=function(){return!0};JY.prototype.shouldDiscardImage=function(e){return e===this._image};function WA(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Wi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new JY),this._errorEvent=new _e,this._ready=!1;let n=this,i,r;if(l(e.url)){$("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let o=ve.createIfNeeded(e.url);r=new sh(o)}l(e.metadata)&&($("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),r=e.metadata),this._metadata=r,l(r)&&(this._readyPromise=r.readyPromise.then(function(o){if(!r.imageryPresent){let s=new de(`The server ${r.url} doesn't have imagery`);return i=Ti.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return Ti.reportSuccess(i),n._ready=o,o}).catch(function(o){return i=Ti.reportError(i,n,n._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)}))}Object.defineProperties(WA.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});WA.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new WA(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};WA.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};WA.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=sh.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new $r({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=Plt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){BU(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Olt(f)),!l(d)&&(!l(p)||p)){let g=Rlt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:OC({uint8Array:f,format:d,flipY:!0})})};WA.prototype.pickFeatures=function(e,t,n,i,r){};function Plt(e,t,n,i,r,o){let s=sh.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function Olt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Rlt(e){let t=rye.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var oye=WA;var Mlt=new z(1,1,1,.4),Blt=new z(0,1,0,.05),Llt=new z(0,.5,0,.2);function jA(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Wi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,Mlt),this._glowColor=y(e.glowColor,Blt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,Llt),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(jA.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){$("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});jA.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};jA.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};jA.prototype.getTileCredits=function(e,t,n){};jA.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};jA.prototype.pickFeatures=function(e,t,n,i,r){};var sye=jA;function ZY(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(ZY.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});ZY.prototype.load=async function(){return this._data=await gb.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var Qk=ZY;function yb(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(yb.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Nlt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}yb.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let r=e._parseHeader(n),o=Nlt(e._storageInfo.attributeValues.valueType);o>0&&(r=Math.ceil(r/o)*o),e._parseBody(n,r)}})};yb.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};yb.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};yb.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=this._storageInfo[i];if(l(r)){this._values[i]=[];for(let o=0;o<this._header.count;++o)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[o],a="";for(let c=0;c<s;++c){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(a+=u.value),t=u.offset}this._values[i].push(a)}}}};var $k=yb;function $D(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties($D.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});$D.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Flt=new m,Ult=new m,Vlt=new m,klt=new m,zlt=new m;function QY(e,t,n,i){let r=m.subtract(i,n,Flt),o=m.cross(r,m.subtract(e,n,Ult),klt),s=m.cross(r,m.subtract(t,n,Vlt),zlt);return m.dot(o,s)>=0}var Hlt=new m,Glt=new m,Wlt=new m,jlt=new m,Ylt=new m,qlt=new m,Xlt=new m,Klt=new m,Jlt=new m,Zlt=new m;$D.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,h,A;l(f)?(g=f[p],h=f[p+1],A=f[p+2]):(g=p*3,h=p*3+1,A=p*3+2);let x=m.fromElements(u[g*3],u[g*3+1],u[g*3+2],Hlt),C=m.fromElements(u[h*3],u[h*3+1],u[h*3+2],Glt),T=new m(u[A*3],u[A*3+1],u[A*3+2],Wlt);if(!QY(i,x,C,T)||!QY(i,C,x,T)||!QY(i,T,x,C))continue;let E=m.subtract(C,x,jlt),S=m.subtract(T,x,Ylt),w=m.cross(E,S,qlt);if(m.magnitude(w)===0)continue;let D=m.normalize(w,Xlt),R=m.subtract(i,x,Klt),O=Math.abs(m.dot(R,D));if(O<r){r=O,o=p;let L=m.magnitudeSquared(m.subtract(i,x,R)),N=m.magnitudeSquared(m.subtract(i,C,Jlt)),_=m.magnitudeSquared(m.subtract(i,T,Zlt));L<N&&L<_?(a=g,c=x,s=L):N<_?(a=h,c=C,s=N):(a=A,c=T,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};$D.prototype._generateGltf=function(e,t,n,i,r,o){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,u="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[A],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let T=this._layer._data.textureSetDefinitions[C];for(let E=0;E<T.formats.length;E++){let S=T.formats[E];if(S.format==="jpg"){x=S.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(u=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${x}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,u=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:u}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var eI=$D;function bl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(bl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});bl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new ud(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await gb.loadJson(this._resource,this._dataProvider._traceFetches);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};bl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(r,o){let s=new $k(t,r[o]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let r=0;r<e.length;r++)i.push(n(e,r));return Promise.all(i)};bl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};bl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};bl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new bl(e,y(i.href,i),!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};bl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new eI(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new eI(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};bl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new Qk(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};bl.prototype._clearGeometryData=function(){this._geometryData=[]};bl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let T=this._dataProvider._geoidDataList[C],E=T.projection.project(n);if(E.x>T.nativeExtent.west&&E.x<T.nativeExtent.east&&E.y>T.nativeExtent.south&&E.y<T.nativeExtent.north){n.height+=$lt(E.x,E.y,T);break}}let i={},r,o=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=re.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=o/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new lc(0,0,0),u=Mt.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Ne(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new B(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=B.inverse(p,new B),h=B.clone(p);l(this._parent._globalTransform)&&B.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let A=[];for(let C=0;C<this._children.length;C++)A.push(this._children[C]._create3DTileDefinition());return{children:A,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};bl.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,r=0,o=0,s=0;l(n.obb)?(r=n.obb.center[0],o=n.obb.center[1],s=n.obb.center[2]):l(n.mbs)&&(r=n.mbs[0],o=n.mbs[1],s=n.mbs[2]);let a=Z.fromRotationX(-P.PI_OVER_TWO),c=new Z;Z.multiply(a,i,c);let u=he.fromDegrees(r,o,s),f=re.WGS84.cartographicToCartesian(u),d={binaryData:t.geometryData._data,featureData:l(t.featureData)&&l(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:u,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};bl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let r=Promise.resolve();if(l(i._geometryData)&&i._geometryData.length>0){let o={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,o);if(!l(s))return;r=s.then(function(a){e=o.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return r.then(function(){let o=i._dataProvider._binarizeGltf(e),s=new Blob([o],{type:"application/binary"});return URL.createObjectURL(s)})})};ud.prototype._hookedRequestContent=ud.prototype.requestContent;ud.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new ve({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function Qlt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function e4(e,t,n,i){let r=e+t*n;return i[r]}function $lt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=e4(s,a,n.width,n.buffer),d=e4(c,a,n.width,n.buffer),p=e4(s,u,n.width,n.buffer),g=e4(c,u,n.width,n.buffer),h=Qlt(r,o,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(ud.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var tI=bl;function Ef(e,t,n){this._dataProvider=e,l(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),r="";i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new ve({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Ef.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Ef.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Ef.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Ef.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}return 0};Ef.prototype._loadRootNode=function(){if(l(this._data.nodePages)){let e=0;l(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new tI(this,e,!0)}else this._rootNode=new tI(this,this._data.store.rootNode,!0);return this._rootNode.load()};Ef.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};Ef._fetchJson=function(e){return e.fetchJson()};Ef.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Ef._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Ef.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Ef.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(l(this._dataProvider._cesium3dTilesetOptions))for(let r in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(r)&&(i[r]=this._dataProvider._cesium3dTilesetOptions[r]);this._tileset=await Ga.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};var YA=Ef;var cye=co(aye(),1);function Zo(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,l(e.url)&&($("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=ve.createIfNeeded(e.url),this._load())}Object.defineProperties(Zo.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return $("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return $("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});Zo.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};Zo.prototype.isDestroyed=function(){return!1};Zo.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Zo.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Zo.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Zo.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};Zo.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i=await Zo.loadJson(n),r=new Zo(t);if(r._resource=n,r._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new YA(r,i.layers[s],s);r._layers.push(a)}else{let s=new YA(r,i,i.id);r._layers.push(s)}r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load());return await Promise.all(o),r._ready=!0,r._readyPromise=Promise.resolve(r),r};Zo.prototype._load=function(){let e=this;return this._readyPromise=Zo.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,l(t.layers))for(let i=0;i<t.layers.length;i++){let r=new YA(e,t.layers[i],i);e._layers.push(r)}else{let i=new YA(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};Zo._fetchJson=function(e){return e.fetchJson()};Zo.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await Zo._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};Zo.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};Zo.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]="g".charCodeAt(),r.magic[1]="l".charCodeAt(),r.magic[2]="T".charCodeAt(),r.magic[3]="F".charCodeAt(),r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};Zo.prototype.getDecoderTaskProcessor=function(){if(l(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!l(this._decoderTaskProcessor)){let e=new pi("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function eut(e,t){return nut(e,t)}var tut=new H;function nut(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=H.fromElements(d,p,tut),h=g.toString();if(!r.hasOwnProperty(h)){let A={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[h]=A,i.push(A)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},A=d[g],x="Geographic";n._projection instanceof Pi&&(x="WebMercator");let C={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:A._height,width:A._width,scale:A._structure.heightScale,offset:A._structure.heightOffset};if(A._encoding===Md.LERC){let T=cye.default.decode(A._buffer);C.buffer=T.pixels[0]}else C.buffer=A._buffer;p.push(C)}return p})}async function iut(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await eut(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Zo.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=iut(this),this._geoidDataPromise)};Zo.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var gb=Zo;function mh(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new oi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new oi({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(mh.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});mh.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var rut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},out={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},sut={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK,blending:hn.ALPHA_BLEND},aut=`uniform sampler2D colorTexture; -uniform sampler2D depthTexture; -uniform sampler2D classifiedTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) + /////////////////////////////////////////////////////////////////////////// + +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) { - discard; + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; } - bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); -#ifdef UNCLASSIFIED - vec4 highlightColor = czm_invertClassificationColor; - if (isClassified) + else { - discard; + lengthSq = dot(positionEC.xyz, positionEC.xyz); } -#else - vec4 highlightColor = vec4(1.0); - if (!isClassified) +#endif + +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } + + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) { - discard; + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } + + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); } #endif - out_FragColor = color * highlightColor; - gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; -} -`,cut=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - if (color.a == 0.0) + +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepth.x; + float farSq = distanceDisplayConditionAndDisableDepth.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif + + gl_Position = czm_projection * positionEC; + czm_vertexLogDepth(); + +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) { - discard; + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; + } + + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); +#endif + } } -#ifdef UNCLASSIFIED - out_FragColor = color * czm_invertClassificationColor; -#else - out_FragColor = color; #endif + + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; + + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; + + v_pickColor = pickColor; +} +`;var J6e=Ys.SHOW_INDEX,F9=Ys.POSITION_INDEX,Lse=Ys.COLOR_INDEX,Z6e=Ys.OUTLINE_COLOR_INDEX,$6e=Ys.OUTLINE_WIDTH_INDEX,Q6e=Ys.PIXEL_SIZE_INDEX,Nse=Ys.SCALE_BY_DISTANCE_INDEX,Fse=Ys.TRANSLUCENCY_BY_DISTANCE_INDEX,Bse=Ys.DISTANCE_DISPLAY_CONDITION_INDEX,e9e=Ys.DISABLE_DEPTH_DISTANCE_INDEX,B9=Ys.NUMBER_OF_PROPERTIES,qa={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function ef(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(B9),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ef.prototype,{length:{get:function(){return k9(this),this._pointPrimitives.length}}});function kse(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ef.prototype.add=function(e){let t=new Ys(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ef.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ef.prototype.removeAll=function(){kse(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function k9(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}ef.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ef.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};ef.prototype.get=function(e){return k9(this),this._pointPrimitives[e]};ef.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<B9;++i){let o=n[i]===0?ke.STATIC_DRAW:ke.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function t9e(e,t,n){return new ag(e,[{index:qa.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[F9]},{index:qa.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[F9]},{index:qa.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lse]},{index:qa.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Fse]},{index:qa.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Nse]},{index:qa.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:X.FLOAT,usage:n[Bse]}],t)}var L9=new qn;function Use(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),qn.fromCartesian(r,L9);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[qa.positionHighAndSize],u=L9.high;c(o,u.x,u.y,u.z,s);let f=n[qa.positionLowAndOutline],d=L9.low;f(o,d.x,d.y,d.z,a)}var j2=65536,mw=256;function Vse(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(r.red),u=z.floatToByte(r.green),f=z.floatToByte(r.blue),d=c*j2+u*mw+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*j2+u*mw+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let g=c*j2+u*mw+f,h=z.floatToByte(r.alpha)*j2+z.floatToByte(a.alpha)*mw+z.floatToByte(s.alpha),x=n[qa.compressedAttribute0];x(o,d,p,g,h)}function zse(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*mw+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[qa.compressedAttribute1];g(o,d,p,r,a)}function Hse(e,t,n,i){let o=i._index,r=n[qa.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function Gse(e,t,n,i){let o=i._index,r=n[qa.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),r(o,s,a,u)}function n9e(e,t,n,i){Use(e,t,n,i),Vse(e,t,n,i),zse(e,t,n,i),Hse(e,t,n,i),Gse(e,t,n,i)}function N9(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ys._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function i9e(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!L.equals(r,e.modelMatrix)?(e._mode=n,L.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&N9(e,i,i.length,t,r,!0)):n===ne.MORPHING?N9(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&N9(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function o9e(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var r9e=[];ef.prototype.update=function(e){if(k9(this),!this.show)return;this._maxTotalPointSize=Gt.maximumAliasedPointSize,i9e(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<B9;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=t9e(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let I=this._pointPrimitives[v];I._dirty=!1,n9e(this,c,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=r9e;v.length=0,(r[F9]||r[$6e]||r[Q6e])&&v.push(Use),(r[Lse]||r[Z6e])&&v.push(Vse),(r[J6e]||r[Fse])&&v.push(zse),r[Nse]&&v.push(Hse),(r[Bse]||r[e9e])&&v.push(Gse);let I=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let N=0;N<I;++N)v[N](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let N=0;N<I;++N)v[N](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=L.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),o9e(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Io.OPAQUE||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Io.TRANSLUCENT||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new We({sources:[W2]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Io.OPAQUE_AND_TRANSLUCENT&&(x=new We({defines:["OPAQUE"],sources:[nx]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:qa}),x=new We({defines:["TRANSLUCENT"],sources:[nx]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:qa})),this._blendOption===Io.OPAQUE&&(x=new We({sources:[nx]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:qa})),this._blendOption===Io.TRANSLUCENT&&(x=new We({sources:[nx]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:qa})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,C,T,A,S=e.commandList;if(u.render||f){let v=this._colorCommands,I=this._blendOption===Io.OPAQUE,O=this._blendOption===Io.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,C=b.length,v.length=C;let R=O?C*2:C;for(A=0;A<R;++A){let N=I||O&&A%2===0;T=v[A],l(T)||(T=v[A]=new nt),T.primitiveType=Fe.POINTS,T.pass=N||!O?Ae.OPAQUE:Ae.TRANSLUCENT,T.owner=this;let F=O?Math.floor(A/2):A;T.boundingVolume=d,T.modelMatrix=p,T.shaderProgram=N?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=b[F].va,T.renderState=N?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",S.push(T)}}};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),kse(this._pointPrimitives),ue(this)};var hw=ef;var Wse=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],U9=1,pw=8,ix=class{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==U9)throw new Error(`Got v${o} data when expected v${U9}.`);let r=Wse[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new ix(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Wse.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,pw,t),this.coords=new this.ArrayType(this.data,pw+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(pw+s+a+c),this.ids=new this.IndexArrayType(this.data,pw,t),this.coords=new this.ArrayType(this.data,pw+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(U9<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return z9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let C=s[2*b],T=s[2*b+1];C>=t&&C<=i&&T>=n&&T<=o&&u.push(r[b])}continue}let g=p+d>>1,h=s[2*g],x=s[2*g+1];h>=t&&h<=i&&x>=n&&x<=o&&u.push(r[g]),(f===0?t<=h:n<=x)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=h:o>=x)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)jse(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let g=p+d>>1,h=r[2*g],x=r[2*g+1];jse(h,x,t,n)<=u&&c.push(o[g]),(f===0?t-i<=h:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=h:n+i>=x)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function z9(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;qse(e,t,s,i,o,r),z9(e,t,n,i,s-1,1-r),z9(e,t,n,s+1,o,1-r)}function qse(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),h=Math.max(i,Math.floor(n-f*p/u+g)),x=Math.min(o,Math.floor(n+(u-f)*p/u+g));qse(e,t,n,h,x,r)}let s=t[2*n+r],a=i,c=o;for(_w(e,t,i,n),t[2*o+r]>s&&_w(e,t,i,o);a<c;){for(_w(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?_w(e,t,i,c):(c++,_w(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function _w(e,t,n,i){V9(e,n,i),V9(t,2*n,2*i),V9(t,2*n+1,2*i+1)}function V9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function jse(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function dd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new _e,this.show=y(e.show,!0)}function Yse(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var s9e=new Ke;function Xse(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=V0.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=go.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ys.getScreenSpaceBoundingBox(e,t,o)),Yse(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Jse(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=V0.getScreenSpaceBoundingBox(s,t,s9e);Yse(a,n),o=Ke.union(o,a,o)}return o}function a9e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Jse(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Kse(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Jse(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function H9(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var c9e=new Ke,l9e=new Ke,u9e=new Ke;function f9e(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new dp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Wu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new hw;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,h=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,b=n.camera.positionWC,C=new Ig(x,b),T=[];e._clusterLabels&&H9(i,T,n,C,e),e._clusterBillboards&&H9(o,T,n,C,e),e._clusterPoints&&H9(r,T,n,C,e);let A,S,v,I,O,R,N,F,_,E,w,D;if(T.length>0){let M=new ix(T.length,64,Uint32Array);for(let B=0;B<T.length;++B)M.add(T[B].coord.x,T[B].coord.y);if(M.finish(),h<g)for(v=d.length,A=0;A<v;++A){let B=d[A];if(!C.isPointVisible(B.position))continue;let V=go._computeScreenSpacePosition(L.IDENTITY,B.position,m.ZERO,H.ZERO,n);if(!l(V))continue;let U=1-h/g,G=B.width=B.width*U,k=B.height=B.height*U;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let Y=V.x-G*.5,j=V.y-k*.5,$=V.x+G,W=V.y+k;for(O=M.range(Y,j,$,W),R=O.length,E=0,_=[],S=0;S<R;++S)N=O[S],F=T[N],F.clustered||(++E,w=F.collection,D=F.index,_.push(w.get(D).id));if(E>=f)for(Kse(B.position,E,_,e),p.push(B),S=0;S<R;++S)T[O[S]].clustered=!0}for(v=T.length,A=0;A<v;++A){let B=T[A];if(B.clustered)continue;B.clustered=!0,w=B.collection,D=B.index;let V=w.get(D);I=Xse(V,B.coord,u,e,c9e);let U=Ke.clone(I,l9e);O=M.range(I.x,I.y,I.x+I.width,I.y+I.height),R=O.length;let G=m.clone(V.position);for(E=1,_=[V.id],S=0;S<R;++S)if(N=O[S],F=T[N],!F.clustered){let k=F.collection.get(F.index),Y=Xse(k,F.coord,u,e,u9e);m.add(k.position,G,G),Ke.union(U,Y,U),++E,_.push(k.id)}if(E>=f){let k=m.multiplyByScalar(G,1/E,G);for(Kse(k,E,_,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),S=0;S<R;++S)T[O[S]].clustered=!0}else a9e(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}dd.prototype._initialize=function(e){this._scene=e;let t=f9e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(dd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function W9(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.pop(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function j9(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}dd.prototype.getLabel=W9("_labelCollection",dp,"_unusedLabelIndices","labelIndex");dd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,j9(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};dd.prototype.getBillboard=W9("_billboardCollection",Wu,"_unusedBillboardIndices","billboardIndex");dd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,j9(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};dd.prototype.getPoint=W9("_pointCollection",hw,"_unusedPointIndices","pointIndex");dd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,j9(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function G9(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function d9e(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,G9(e._labelCollection),G9(e._billboardCollection),G9(e._pointCollection))}dd.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,d9e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};dd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var tf=dd;function q9(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new js(this),this._entityCluster=new tf}Object.defineProperties(q9.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Nr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});q9.prototype.update=function(e){return!0};var q2=q9;var Zse={};Zse.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=o?a*3:0,h=o?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*P.TWO_PI,b=Math.cos(x),C=Math.sin(x),T=b*n,A=C*n,S=b*t,v=C*t;u[p+g]=T,u[p+g+1]=A,u[p+g+2]=s,u[p+h]=S,u[p+h+1]=v,u[p+h+2]=r,p+=3,o&&(u[d++]=T,u[d++]=A,u[d++]=s,u[d++]=S,u[d++]=v,u[d++]=r)}return u};var NT=Zse;var Y9=new H,m9e=new m,h9e=new m,p9e=new m,_9e=new m;function Pp(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Me.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Me.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Pp.packedLength=Me.packedLength+5;Pp.pack=function(e,t,n){return n=y(n,0),Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var $se=new Me,FT={vertexFormat:$se,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Pp.unpack=function(e,t,n){t=y(t,0);let i=Me.unpack(e,t,$se);t+=Me.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(FT.length=o,FT.topRadius=r,FT.bottomRadius=s,FT.slices=a,FT.offsetAttribute=c===-1?void 0:c,new Pp(FT))};Pp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=NT.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,h,x=o.normal||o.tangent||o.bitangent;if(x){let O=o.tangent||o.bitangent,R=0,N=0,F=0,_=Math.atan2(i-n,t),E=m9e;E.z=Math.sin(_);let w=Math.cos(_),D=p9e,M=h9e;for(h=0;h<r;h++){let B=h/r*P.TWO_PI,V=w*Math.cos(B),U=w*Math.sin(B);x&&(E.x=V,E.y=U,O&&(D=m.normalize(m.cross(m.UNIT_Z,E,D),D)),o.normal&&(d[R++]=E.x,d[R++]=E.y,d[R++]=E.z,d[R++]=E.x,d[R++]=E.y,d[R++]=E.z),o.tangent&&(p[N++]=D.x,p[N++]=D.y,p[N++]=D.z,p[N++]=D.x,p[N++]=D.y,p[N++]=D.z),o.bitangent&&(M=m.normalize(m.cross(E,D,M),M),g[F++]=M.x,g[F++]=M.y,g[F++]=M.z,g[F++]=M.x,g[F++]=M.y,g[F++]=M.z))}for(h=0;h<r;h++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(g[F++]=0,g[F++]=-1,g[F++]=0);for(h=0;h<r;h++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(g[F++]=0,g[F++]=1,g[F++]=0)}let b=12*r-12,C=Ue.createTypedArray(c,b),T=0,A=0;for(h=0;h<r-1;h++)C[T++]=A,C[T++]=A+2,C[T++]=A+3,C[T++]=A,C[T++]=A+3,C[T++]=A+1,A+=2;for(C[T++]=s-2,C[T++]=0,C[T++]=1,C[T++]=s-2,C[T++]=1,C[T++]=s-1,h=1;h<r-1;h++)C[T++]=s+h+1,C[T++]=s+h,C[T++]=s;for(h=1;h<r-1;h++)C[T++]=a,C[T++]=a+h,C[T++]=a+h+1;let S=0;if(o.st){let O=Math.max(n,i);for(h=0;h<c;h++){let R=m.fromArray(u,h*3,_9e);f[S++]=(R.x+O)/(2*O),f[S++]=(R.y+O)/(2*O)}}let v=new gn;o.position&&(v.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(v.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),Y9.x=t*.5,Y9.y=Math.max(i,n);let I=new ae(m.ZERO,H.magnitude(Y9));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===an.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new dt({attributes:v,indices:C,primitiveType:Fe.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var X9;Pp.getUnitCylinder=function(){return l(X9)||(X9=Pp.createGeometry(new Pp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Me.POSITION_ONLY}))),X9};var Y2=Pp;var K9=new H;function BT(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}BT.packedLength=6;BT.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var ox={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};BT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(ox.length=i,ox.topRadius=o,ox.bottomRadius=r,ox.slices=s,ox.numberOfVerticalLines=a,ox.offsetAttribute=c===-1?void 0:c,new BT(ox))};BT.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=NT.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ue.createTypedArray(s,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let g=new gn;g.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),K9.x=t*.5,K9.y=Math.max(i,n);let h=new ae(m.ZERO,H.magnitude(K9));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===an.NONE?0:1,b=new Uint8Array(t/3).fill(x);g.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new dt({attributes:g,indices:f,primitiveType:Fe.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var X2=BT;var Qse=m.ZERO,eae=new m,g9e=new m,tae=new z;function y9e(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Yl(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new y9e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Yl.prototype=Object.create(li.prototype),Yl.prototype.constructor=Yl);Object.defineProperties(Yl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Yl.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=zn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,tae)),l(a)||(a=z.WHITE),s.color=Ht.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qse,eae))),new Tt({id:t,geometry:new Y2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};Yl.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,tae),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qse,eae))),new Tt({id:t,geometry:new X2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:r})};Yl.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Yl.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||li.prototype._isHidden.call(this,e,t)};Yl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};Yl.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};Yl.prototype._onEntityPropertyChanged=I_;Yl.DynamicGeometryUpdater=kT;function kT(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(kT.prototype=Object.create(ci.prototype),kT.prototype.constructor=kT);kT.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,g9e);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ci.prototype._isHidden.call(this,e,t,n)};kT.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.length=q.getValueOrUndefined(t.length,n),o.topRadius=q.getValueOrUndefined(t.topRadius,n),o.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),o.slices=q.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==qe.NONE?an.ALL:void 0};var K2=Yl;var x9e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Fr=Object.freeze(x9e);var b9e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},xo=Object.freeze(b9e);var C9e={NONE:0,HOLD:1,EXTRAPOLATE:2},nf=Object.freeze(C9e);var nae=ur(Dl(),1);function T9e(e){let t=new nae.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Dg=T9e;var A9e=P.factorial;function J9(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=J9(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var J2={type:"Hermite"};J2.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};J2.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(d);for(p[r]=b,s=0;s<d;s++)b[s]=[]}let g=d,h=new Array(g);for(r=0;r<g;r++)h[r]=r;let x=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=h[s]*i+c,p[c][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let C=t[h[s]],T=t[h[s+r]],A;T-C<=0?(f=h[s]*i+i*r+c,A=n[f],p[c][r].push(A/A9e(r))):(A=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(A/(T-C))),b=b||A!==0}b||(x=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=x;r++){let b=J9(e,h,t,a,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+a*i]+=C*b}}return o};var E9e=[];J2.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let C=0;C<o+1;C++)u[f*(o+1)+C]=f;let d=u.length,p=E9e,g=S9e(p,u,t,n,i,o),h=[],x=d*(d+1)/2,b=Math.min(g,r);for(let C=0;C<=b;C++)for(f=C;f<=g;f++){h.length=0;let T=J9(e,u,t,C,f,h),A=Math.floor(f*(1-f)/2)+d*f;for(let S=0;S<i;S++){let v=Math.floor(S*x),I=p[v+A];s[S+C*i]+=I*T}}return s};function S9e(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let h=0,x=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let C=n[t[s]],T=n[t[s+g]],A,S;if(T-C<=0)a=t[s]*o*(r+1)+o*g+d,A=i[a],S=A/P.factorial(g),e[p+x+h]=S,h++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);A=e[p+v+s+1]-e[p+v+s],S=A/(T-C),e[p+x+h]=S,h++}b=b||A!==0}b&&(c=Math.max(c,g))}}return c}var Z2=J2;var Z9={type:"Lagrange"};Z9.getRequiredDataPoints=function(e){return Math.max(e+1,2)};Z9.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var $2=Z9;var $9={type:"Linear"};$9.getRequiredDataPoints=function(e){return 2};$9.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var UT=$9;function Ya(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}Ya.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Ya),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Ya.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Ya(e.clock,e.cone,e.magnitude)};Ya.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Ya(e.clock,e.cone,1)};Ya.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Ya.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Ya.prototype.equals=function(e){return Ya.equals(this,e)};Ya.prototype.clone=function(e){return Ya.clone(this,e)};Ya.prototype.equalsEpsilon=function(e,t){return Ya.equalsEpsilon(this,e,t)};Ya.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var Q2=Ya;var vw=ur(Dl(),1);var Q9;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?Q9=function(){return performance.now()}:Q9=function(){return Date.now()};var Ti=Q9;function eW(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=ee.clone(t):l(n)?t=ee.clone(n):l(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),l(n)?n=ee.clone(n):n=ee.clone(t),l(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Fr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ti(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,xo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(eW.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===xo.SYSTEM_CLOCK&&(this._clockStep=xo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===xo.SYSTEM_CLOCK&&(this._clockStep=xo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===xo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===xo.SYSTEM_CLOCK&&(this._clockStep=xo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});eW.prototype.tick=function(){let e=Ti(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===xo.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===xo.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Fr.CLAMPED)ee.lessThan(t,r)?t=ee.clone(r,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(o===Fr.LOOP_STOP)for(ee.lessThan(t,r)&&(t=ee.clone(r,t));ee.greaterThan(t,s);)t=ee.addSeconds(r,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Bm=eW;function rx(){this._definitionChanged=new _e,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(rx.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Ll("startTime"),stopTime:Ll("stopTime"),currentTime:Ll("currentTime"),clockRange:Ll("clockRange"),clockStep:Ll("clockStep"),multiplier:Ll("multiplier")});rx.prototype.clone=function(e){return l(e)||(e=new rx),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};rx.prototype.equals=function(e){return this===e||l(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};rx.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};rx.prototype.getValue=function(e){return l(e)||(e=new Bm),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var km=rx;var v9e=z.WHITE,w9e=.1,I9e=new H(8,8),D9e=new H(0,0),P9e=new H(1,1);function VT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(VT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});VT.prototype.getType=function(e){return"Grid"};VT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,v9e,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,w9e),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,I9e,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,P9e,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,D9e,t.lineOffset),t};VT.prototype.equals=function(e){return this===e||e instanceof VT&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var gw=VT;function zT(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});zT.prototype.getType=function(e){return"PolylineArrow"};zT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};zT.prototype.equals=function(e){return this===e||e instanceof zT&&q.equals(this._color,e._color)};var yw=zT;var O9e=z.WHITE,R9e=z.TRANSPARENT,M9e=16,L9e=255;function HT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(HT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});HT.prototype.getType=function(e){return"PolylineDash"};HT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,O9e,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,R9e,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,M9e,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,L9e,t.dashPattern),t};HT.prototype.equals=function(e){return this===e||e instanceof HT&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var xw=HT;var N9e=z.WHITE,F9e=.25,B9e=1;function GT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(GT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});GT.prototype.getType=function(e){return"PolylineGlow"};GT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,N9e,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,F9e,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,B9e,t.taperPower),t};GT.prototype.equals=function(e){return this===e||e instanceof GT&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var bw=GT;var k9e=z.WHITE,U9e=z.BLACK,V9e=1;function WT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(WT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});WT.prototype.getType=function(e){return"PolylineOutline"};WT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,k9e,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,U9e,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,V9e),t};WT.prototype.equals=function(e){return this===e||e instanceof WT&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var sx=WT;function Op(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Mr,this._referenceFrame=y(t,oo.FIXED),this.setValue(e)}Object.defineProperties(Op.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});Op.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};Op.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Op.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Op.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Op.prototype.equals=function(e){return this===e||e instanceof Op&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};Op.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Pg=Op;function Og(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Mr,this.setValue(e)}Object.defineProperties(Og.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Og.prototype.getValue=function(e,t){let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Og.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Og.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Og.prototype.equals=function(e){return this===e||e instanceof Og&&q.arrayEquals(this._value,e._value)};Og.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Cw=Og;function ax(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Xl.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Xl(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(Xl.prototype._onCollectionChanged,this)}Object.defineProperties(Xl.prototype,{isConstant:{get:function(){return q.isConstant(ax(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=ax(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return ax(this)}}});Xl.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Xl(e,n,i)};Xl.prototype.getValue=function(e,t){let n=ax(this);return l(n)?n.getValue(e,t):void 0};Xl.prototype.getValueInReferenceFrame=function(e,t,n){let i=ax(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Xl.prototype.getType=function(e){let t=ax(this);return l(t)?t.getType(e):void 0};Xl.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Xl.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Xl.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Xl.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=ax(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Rg=Xl;var z9e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},md=z9e;var iae={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function oae(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function rae(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var tW=[],nW=[];function eB(e,t,n,i,o){let r=0,s,a,c,u,f,d;for(;r<i.length;){f=rae(i[r],e),c=Oo(t,f,ee.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*o,a=void 0,d=t[c];r<i.length&&(f=rae(i[r],e),!(l(a)&&ee.compare(a,f)>=0||l(d)&&ee.compare(f,d)>=0));){for(tW[p++]=f,r=r+1,s=0;s<o;s++)nW[g++]=i[r],r=r+1;a=f}p>0&&(nW.length=g,oae(n,u,nW),tW.length=p,oae(t,c,tW))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function hd(e,t){let n=e;n===Number&&(n=iae);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=iae);let f=u.packedLength;i+=f,o+=y(u.packedInterpolationLength,f),s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=UT,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new _e,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=nf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=nf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(hd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});hd.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Oo(n,e,ee.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===nf.NONE||o!==0&&ee.secondsDifference(S,e)>o)return;if(this._backwardExtrapolationType===nf.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===nf.NONE||o!==0&&ee.secondsDifference(e,S)>o)return;if(this._forwardExtrapolationType===nf.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let h=0,x=i-1;if(x-h+1>=g+1){let S=a-(g/2|0)-1;S<h&&(S=h);let v=S+g;v>x&&(v=x,S=v-g,S<h&&(S=h)),h=S,x=v}let C=x-h+1;for(let S=0;S<C;++S)c[S]=ee.secondsDifference(n[h+S],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,h,x,u);else{let S=0,v=this._packedLength,I=h*v,O=(x+1)*v;for(;I<O;)u[S]=s[I],I++,S++}let T=ee.secondsDifference(e,n[x]),A;if(p===0||!l(f.interpolate))A=f.interpolateOrderZero(T,c,u,d,this._interpolationResult);else{let S=Math.floor(d/(p+1));A=f.interpolate(T,c,u,S,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(A,s,h,x,t):r.unpack(A,0,t)}return r.unpack(s,a*this._packedLength,t)};hd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};hd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}eB(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}eB(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hd.prototype.addSamplesPackedArray=function(e,t){eB(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hd.prototype.removeSample=function(e){let t=Oo(this._times,e,ee.compare);return t<0?!1:(sae(this,t,1),!0)};function sae(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}hd.prototype.removeSamples=function(e){let t=this._times,n=Oo(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Oo(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,sae(this,n,i-n)};hd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!ee.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};hd._mergeNewSamples=eB;var of=hd;function rf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new of(m,n),this._definitionChanged=new _e,this._referenceFrame=y(e,oo.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(rf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});rf.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};rf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return E_.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};rf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};rf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};rf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};rf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};rf.prototype.removeSample=function(e){return this._property.removeSample(e)};rf.prototype.removeSamples=function(e){this._property.removeSamples(e)};rf.prototype.equals=function(e){return this===e||e instanceof rf&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var xa=rf;var H9e={HORIZONTAL:0,VERTICAL:1},Um=Object.freeze(H9e);var G9e=Um.HORIZONTAL,W9e=z.WHITE,j9e=z.BLACK,q9e=0,Y9e=1;function jT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new _e,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(jT.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});jT.prototype.getType=function(e){return"Stripe"};jT.prototype.getValue=function(e,t){return l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,G9e)===Um.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,W9e,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,j9e,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,q9e),t.repeat=q.getValueOrDefault(this._repeat,e,Y9e),t};jT.prototype.equals=function(e){return this===e||e instanceof jT&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var Tw=jT;function Mg(e){this._definitionChanged=new _e,this._intervals=new Lr,this._intervals.changedEvent.addEventListener(Mg.prototype._intervalsChanged,this),this._referenceFrame=y(e,oo.FIXED)}Object.defineProperties(Mg.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});Mg.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};Mg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return E_.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Mg.prototype.equals=function(e){return this===e||e instanceof Mg&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};Mg.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Lg=Mg;function cx(){this._definitionChanged=new _e,this._intervals=new Lr,this._intervals.changedEvent.addEventListener(cx.prototype._intervalsChanged,this)}Object.defineProperties(cx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});cx.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};cx.prototype.equals=function(e){return this===e||e instanceof cx&&this._intervals.equals(e._intervals,q.equals)};cx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ng=cx;function qT(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=y(t,!0),this.position=e}Object.defineProperties(qT.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var X9e=new m,aae=new m,cae=new ee,iW=1/60;qT.prototype.getValue=function(e,t){return this._getValue(e,t)};qT.prototype._getValue=function(e,t,n){l(t)||(t=new m);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let o=i.getValue(e,X9e),r=i.getValue(ee.addSeconds(e,iW,cae),aae);if(!l(o)||!l(r)&&(r=o,o=i.getValue(ee.addSeconds(e,-iW,cae),aae),!l(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,iW,t)};qT.prototype.equals=function(e){return this===e||e instanceof qT&&q.equals(this._position,e._position)};var YT=qT;function Aw(e,t){this._velocityVectorProperty=new YT(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=y(t,oe.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(Aw.prototype,{isConstant:{get:function(){return q.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var lae=new m,K9e=new m,uae=new Z;Aw.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,K9e,lae);if(l(n))return Mt.rotationMatrixFromPositionVelocity(lae,n,this._ellipsoid,uae),Be.fromRotationMatrix(uae,t)};Aw.prototype.equals=function(e){return this===e||e instanceof Aw&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var tB=Aw;function Fg(){}Fg.packedLength=m.packedLength;Fg.unpack=m.unpack;Fg.pack=m.pack;var oW;function Ew(e,t){return t[0]==="#"&&(t=oW+t),Rg.fromString(e,t)}function fae(e,t,n){if(l(n.reference))return Ew(t,n.reference);if(l(n.velocityReference)){let i=Ew(t,n.velocityReference);switch(e){case m:case Fg:return new YT(i,e===Fg);case Be:return new tB(i)}}throw new de(`${JSON.stringify(n)} is not valid CZML.`)}function J9e(e,t){return new mm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ni=new m,vc=new Q2,Xa=new me,lx=new Sn,nB=new Be;function Z9e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=z.byteToFloat(n[o+1]),t[o+2]=z.byteToFloat(n[o+2]),t[o+3]=z.byteToFloat(n[o+3]),t[o+4]=z.byteToFloat(n[o+4]);return t}function dae(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function $9e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function Q9e(e){let t=e.length;if(vc.magnitude=1,t===2)return vc.clock=e[0],vc.cone=e[1],m.fromSpherical(vc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],vc.clock=e[i+1],vc.cone=e[i+2],m.fromSpherical(vc,Ni),n[o+1]=Ni.x,n[o+2]=Ni.y,n[o+3]=Ni.z;return n}function eWe(e){let t=e.length;if(t===3)return vc.clock=e[0],vc.cone=e[1],vc.magnitude=e[2],m.fromSpherical(vc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],vc.clock=e[i+1],vc.cone=e[i+2],vc.magnitude=e[i+3],m.fromSpherical(vc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function tWe(e){let t=e.length;if(t===3)return Xa.longitude=e[0],Xa.latitude=e[1],Xa.height=e[2],oe.WGS84.cartographicToCartesian(Xa,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Xa.longitude=e[i+1],Xa.latitude=e[i+2],Xa.height=e[i+3],oe.WGS84.cartographicToCartesian(Xa,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function nWe(e){let t=e.length;if(t===3)return Xa.longitude=P.toRadians(e[0]),Xa.latitude=P.toRadians(e[1]),Xa.height=e[2],oe.WGS84.cartographicToCartesian(Xa,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Xa.longitude=P.toRadians(e[i+1]),Xa.latitude=P.toRadians(e[i+2]),Xa.height=e[i+3],oe.WGS84.cartographicToCartesian(Xa,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function rW(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return Q9e(o);let r=e.spherical;if(l(r))return eWe(r);let s=e.cartographicRadians;if(l(s))return tWe(s);let a=e.cartographicDegrees;if(l(a))return nWe(a);throw new de(`${JSON.stringify(e)} is not a valid CZML interval.`)}function mae(e,t){m.unpack(e,t,Ni),m.normalize(Ni,Ni),m.pack(Ni,e,t)}function iWe(e){let t=rW(e);if(t.length===3)return mae(t,0),t;for(let n=1;n<t.length;n+=4)mae(t,n);return t}function hae(e,t){Be.unpack(e,t,nB),Be.normalize(nB,nB),Be.pack(nB,e,t)}function oWe(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return hae(t,0),t;for(let n=1;n<t.length;n+=5)hae(t,n)}return t}function pae(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ke:e.hasOwnProperty("cartesian2")?H:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Fg:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?Qt:e.hasOwnProperty("classificationType")?Hn:e.hasOwnProperty("colorBlendMode")?xc:e.hasOwnProperty("cornerType")?Li:e.hasOwnProperty("heightReference")?qe:e.hasOwnProperty("horizontalOrigin")?_i:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?jo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Rt:e.hasOwnProperty("distanceDisplayCondition")?Dt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Be:e.hasOwnProperty("shadowMode")?Cn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Um:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?vw.default:e.hasOwnProperty("verticalOrigin")?Ln:Object}function rWe(e,t,n){switch(e){case Qt:return Qt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ke:return t.boundingRectangle;case H:return t.cartesian2;case m:return rW(t);case Fg:return iWe(t);case z:return Z9e(t);case Hn:return Hn[y(t.classificationType,t)];case xc:return xc[y(t.colorBlendMode,t)];case Li:return Li[y(t.cornerType,t)];case qe:return qe[y(t.heightReference,t)];case _i:return _i[y(t.horizontalOrigin,t)];case Image:return dae(t,n);case ee:return ee.fromIso8601(y(t.date,t));case jo:return jo[y(t.labelStyle,t)];case Number:return y(t.number,t);case Rt:return t.nearFarScalar;case Dt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Be:return oWe(t);case md:return y(t.number,t);case Cn:return Cn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Um:return Um[y(t.stripeOrientation,t)];case ce:return $9e(t);case vw.default:return dae(t,n);case Ln:return Ln[y(t.verticalOrigin,t)];default:throw new de(e)}}var sWe={HERMITE:Z2,LAGRANGE:$2,LINEAR:UT};function iB(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:sWe[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=nf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=nf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var _ae={iso8601:void 0};function rr(e){if(l(e))return _ae.iso8601=e,Sn.fromIso8601(_ae)}function sW(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function gae(e){let t=new Ac;return t.intervals.addInterval(sW(e)),t}function yae(e){let t=new ya(e.referenceFrame);return t.intervals.addInterval(sW(e)),t}function oB(e,t,n,i,o,r,s){let a=rr(i.interval);l(o)&&(l(a)?a=Sn.intersect(a,o,lx):a=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Dae(t[n],a)}let g=!1;if(d){if(u=rWe(e,i,r),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let h=typeof e.unpack=="function"&&e!==md;if(!g&&!p){d?t[n]=new ei(h?e.unpack(u,0):u):t[n]=fae(e,s,i);return}let x=t[n],b,C=i.epoch;if(l(C)&&(b=ee.fromIso8601(C)),g&&!p){x instanceof of||(t[n]=x=new of(e)),x.addSamplesPackedArray(u,b),iB(i,x);return}let T;if(!g&&p){a=a.clone(),d?a.data=h?e.unpack(u,0):u:a.data=fae(e,s,i),l(x)||(t[n]=x=d?new Ng:new Ac),d&&x instanceof Ng?x.intervals.addInterval(a):x instanceof Ac?(d&&(a.data=new ei(a.data)),x.intervals.addInterval(a)):(t[n]=x=gae(x),d&&(a.data=new ei(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Ac),x instanceof Ac||(t[n]=x=gae(x));let A=x.intervals;T=A.findInterval(a),(!l(T)||!(T.data instanceof of))&&(T=a.clone(),T.data=new of(e),A.addInterval(T)),T.data.addSamplesPackedArray(u,b),iB(i,T.data)}function Dae(e,t){if(e instanceof of){e.removeSamples(t);return}else if(e instanceof Ng){e.intervals.removeInterval(t);return}else if(e instanceof Ac){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,lx);o.isEmpty||Dae(o.data,t)}n.removeInterval(t);return}}function ye(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)oB(e,t,n,i[a],o,r,s);else oB(e,t,n,i,o,r,s)}function xae(e,t,n,i,o,r){let s=rr(n.interval);l(i)&&(l(s)?s=Sn.intersect(s,i,lx):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Pae(e[t],s)}let g,h=!1;if(d&&(l(n.referenceFrame)&&(g=oo[n.referenceFrame]),g=y(g,oo.FIXED),u=rW(n),f=y(u.length,1),h=f>c),!h&&!p){d?e[t]=new Kc(m.unpack(u),g):e[t]=Ew(r,n.reference);return}let x=e[t],b,C=n.epoch;if(l(C)&&(b=ee.fromIso8601(C)),h&&!p){(!(x instanceof xa)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new xa(g,a)),x.addSamplesPackedArray(u,b),iB(n,x);return}let T;if(!h&&p){s=s.clone(),d?s.data=m.unpack(u):s.data=Ew(r,n.reference),l(x)||(d?x=new Lg(g):x=new ya(g),e[t]=x),d&&x instanceof Lg&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof ya?(d&&(s.data=new Kc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=yae(x),d&&(s.data=new Kc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof ya||(e[t]=x=yae(x)):e[t]=x=new ya(g);let A=x.intervals;T=A.findInterval(s),(!l(T)||!(T.data instanceof xa)||l(g)&&T.data.referenceFrame!==g)&&(T=s.clone(),T.data=new xa(g,a),A.addInterval(T)),T.data.addSamplesPackedArray(u,b),iB(n,T.data)}function Pae(e,t){if(e instanceof xa){e.removeSamples(t);return}else if(e instanceof Lg){e.intervals.removeInterval(t);return}else if(e instanceof ya){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,lx);o.isEmpty||Pae(o.data,t)}n.removeInterval(t);return}}function Oae(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)xae(e,t,n[s],i,o,r);else xae(e,t,n,i,o,r)}function bae(e,t,n,i){l(n.references)?rB(e,t,n.references,n.interval,i,Cw,Ac):(l(n.cartesian2)?n.array=H.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=H.unpackArray(n.cartesian)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function Cae(e,t,n,i,o,r){let s=rr(n.interval);l(i)&&(l(s)?s=Sn.intersect(s,i,lx):s=i);let a=e[t],c,u;if(l(s)){a instanceof cw||(a=new cw,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Vt||(c=new Vt),f=n.solidColor,ye(z,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof gw||(c=new gw),f=n.grid,ye(z,c,"color",f.color,void 0,o,r),ye(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),ye(H,c,"lineCount",f.lineCount,void 0,o,r),ye(H,c,"lineThickness",f.lineThickness,void 0,o,r),ye(H,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof u0||(c=new u0),f=n.image,ye(Image,c,"image",f.image,void 0,o,r),ye(H,c,"repeat",f.repeat,void 0,o,r),ye(z,c,"color",f.color,void 0,o,r),ye(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof Tw||(c=new Tw),f=n.stripe,ye(Um,c,"orientation",f.orientation,void 0,o,r),ye(z,c,"evenColor",f.evenColor,void 0,o,r),ye(z,c,"oddColor",f.oddColor,void 0,o,r),ye(Number,c,"offset",f.offset,void 0,o,r),ye(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof sx||(c=new sx),f=n.polylineOutline,ye(z,c,"color",f.color,void 0,o,r),ye(z,c,"outlineColor",f.outlineColor,void 0,o,r),ye(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof bw||(c=new bw),f=n.polylineGlow,ye(z,c,"color",f.color,void 0,o,r),ye(Number,c,"glowPower",f.glowPower,void 0,o,r),ye(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof yw||(c=new yw),f=n.polylineArrow,ye(z,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof xw||(c=new xw),f=n.polylineDash,ye(z,c,"color",f.color,void 0,void 0,r),ye(z,c,"gapColor",f.gapColor,void 0,void 0,r),ye(Number,c,"dashLength",f.dashLength,void 0,o,r),ye(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof ow||(c=new ow),f=n.checkerboard,ye(z,c,"evenColor",f.evenColor,void 0,o,r),ye(z,c,"oddColor",f.oddColor,void 0,o,r),ye(H,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function Kl(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Cae(e,t,n[s],i,o,r);else Cae(e,t,n,i,o,r)}function aWe(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function cWe(e,t,n,i){let o=t.description;l(o)&&ye(String,e,"description",o,void 0,i,n)}function lWe(e,t,n,i){let o=t.position;l(o)&&Oae(e,"position",o,void 0,i,n)}function uWe(e,t,n,i){let o=t.viewFrom;l(o)&&ye(m,e,"viewFrom",o,void 0,i,n)}function fWe(e,t,n,i){let o=t.orientation;l(o)&&ye(Be,e,"orientation",o,void 0,i,n)}function dWe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Nl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)oB(pae(s[a]),e.properties,r,s[a],void 0,i,n);else oB(pae(s),e.properties,r,s,void 0,i,n)}}}function rB(e,t,n,i,o,r,s){let a=n.map(function(c){return Ew(o,c)});if(l(i)){i=rr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(sW(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Tae(e,t,n,i){let o=n.references;l(o)?rB(e,t,o,n.interval,i,Cw,Ac):ye(Array,e,t,n,void 0,void 0,i)}function Aae(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Tae(e,t,n[o],i);else Tae(e,t,n,i)}function Eae(e,t,n,i){let o=n.references;l(o)?rB(e,t,o,n.interval,i,Pg,ya):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function ww(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Eae(e,t,n[o],i);else Eae(e,t,n,i)}function mWe(e){return m.unpackArray(e)}function hWe(e){return m.fromRadiansArrayHeights(e)}function pWe(e){return m.fromDegreesArrayHeights(e)}function Sae(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return rB(a,"positions",s,n.interval,i,Pg,ya),a.positions});e[t]=new Pg(r)}else l(n.cartesian)?n.array=n.cartesian.map(mWe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(hWe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(pWe)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i)}function _We(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Sae(e,t,n[o],i);else Sae(e,t,n,i)}function gWe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)bae(e,t,n[o],i);else bae(e,t,n,i)}function yWe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Lr),r.addInterval(rr(o[s]));else r=new Lr,r.addInterval(rr(o));e.availability=r}function xWe(e,t,n,i,o){l(t)&&ye(Fg,e,"alignedAxis",t,n,i,o)}function bWe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=rr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new sc),ye(Boolean,s,"show",o.show,r,i,n),ye(Image,s,"image",o.image,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(H,s,"pixelOffset",o.pixelOffset,r,i,n),ye(m,s,"eyeOffset",o.eyeOffset,r,i,n),ye(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(Ln,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(md,s,"rotation",o.rotation,r,i,n),xWe(s,o.alignedAxis,r,i,n),ye(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Rt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Rt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Rt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function CWe(e,t,n,i){let o=t.box;if(!l(o))return;let r=rr(o.interval),s=e.box;l(s)||(e.box=s=new cC),ye(Boolean,s,"show",o.show,r,i,n),ye(m,s,"dimensions",o.dimensions,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function TWe(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=rr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new uC),ye(Boolean,s,"show",o.show,r,i,n),ww(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Li,s,"cornerType",o.cornerType,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function AWe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=rr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new fC),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"length",o.length,r,i,n),ye(Number,s,"topRadius",o.topRadius,r,i,n),ye(Number,s,"bottomRadius",o.bottomRadius,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(Number,s,"slices",o.slices,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function EWe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new de("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new de("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function SWe(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=rr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new dC),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ye(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(md,s,"rotation",o.rotation,r,i,n),ye(md,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function vWe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=rr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new mC),ye(Boolean,s,"show",o.show,r,i,n),ye(m,s,"radii",o.radii,r,i,n),ye(m,s,"innerRadii",o.innerRadii,r,i,n),ye(Number,s,"minimumClock",o.minimumClock,r,i,n),ye(Number,s,"maximumClock",o.maximumClock,r,i,n),ye(Number,s,"minimumCone",o.minimumCone,r,i,n),ye(Number,s,"maximumCone",o.maximumCone,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ye(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ye(Number,s,"subdivisions",o.subdivisions,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function wWe(e,t,n,i){let o=t.label;if(!l(o))return;let r=rr(o.interval),s=e.label;l(s)||(e.label=s=new lm),ye(Boolean,s,"show",o.show,r,i,n),ye(String,s,"text",o.text,r,i,n),ye(String,s,"font",o.font,r,i,n),ye(jo,s,"style",o.style,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Boolean,s,"showBackground",o.showBackground,r,i,n),ye(z,s,"backgroundColor",o.backgroundColor,r,i,n),ye(H,s,"backgroundPadding",o.backgroundPadding,r,i,n),ye(H,s,"pixelOffset",o.pixelOffset,r,i,n),ye(m,s,"eyeOffset",o.eyeOffset,r,i,n),ye(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(Ln,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"fillColor",o.fillColor,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Rt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Rt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(Rt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function IWe(e,t,n,i){let o=t.model;if(!l(o))return;let r=rr(o.interval),s=e.model;l(s)||(e.model=s=new S_),ye(Boolean,s,"show",o.show,r,i,n),ye(vw.default,s,"uri",o.gltf,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ye(Number,s,"maximumScale",o.maximumScale,r,i,n),ye(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ye(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ye(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"silhouetteColor",o.silhouetteColor,r,i,n),ye(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(xc,s,"colorBlendMode",o.colorBlendMode,r,i,n),ye(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)vae(s,u[a],r,i,n);else vae(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)wae(s,f[a],r,i,n);else wae(s,f,r,i,n)}function vae(e,t,n,i,o){let r=rr(t.interval);l(n)&&(l(r)?r=Sn.intersect(r,n,lx):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Nl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new hC),ye(m,p,"translation",d.translation,r,i,o),ye(Be,p,"rotation",d.rotation,r,i,o),ye(m,p,"scale",d.scale,r,i,o)}}function wae(e,t,n,i,o){let r=rr(t.interval);l(n)&&(l(r)?r=Sn.intersect(r,n,lx):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Nl),s.hasProperty(f)||s.addProperty(f),ye(Number,s,f,d,r,i,o))}}function DWe(e,t,n,i){let o=t.path;if(!l(o))return;let r=rr(o.interval),s=e.path;l(s)||(e.path=s=new v_),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"leadTime",o.leadTime,r,i,n),ye(Number,s,"trailTime",o.trailTime,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"resolution",o.resolution,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function PWe(e,t,n,i){let o=t.point;if(!l(o))return;let r=rr(o.interval),s=e.point;l(s)||(e.point=s=new _C),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"pixelSize",o.pixelSize,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Rt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Rt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Sw(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(Sw.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});Sw.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Jc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Jc(n,i)};Sw.prototype.equals=function(e){return this===e||e instanceof Sw&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function OWe(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=rr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new um),ye(Boolean,s,"show",o.show,r,i,n),ww(s,"_positions",o.positions,n),_We(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new Sw(s)),ye(Number,s,"height",o.height,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(md,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),ye(Boolean,s,"closeTop",o.closeTop,r,i,n),ye(Boolean,s,"closeBottom",o.closeBottom,r,i,n),ye(Qt,s,"arcType",o.arcType,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function RWe(e){return e?Qt.GEODESIC:Qt.NONE}function MWe(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=rr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new _c),ye(Boolean,s,"show",o.show,r,i,n),ww(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),Kl(s,"material",o.material,r,i,n),Kl(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),ye(Qt,s,"arcType",o.arcType,r,i,n),ye(Boolean,s,"clampToGround",o.clampToGround,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};ye(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=J9e(a.followSurface,RWe)}}function LWe(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=rr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new gC),ww(s,"positions",o.positions,n),gWe(s,"shape",o.shape,n),ye(Boolean,s,"show",o.show,r,i,n),ye(Li,s,"cornerType",o.cornerType,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function NWe(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=rr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new fm),ye(Boolean,s,"show",o.show,r,i,n),ye(ce,s,"coordinates",o.coordinates,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(qe,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(md,s,"rotation",o.rotation,r,i,n),ye(md,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Hn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function FWe(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=rr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new pC),ye(Boolean,s,"show",o.show,r,i,n),ye(vw.default,s,"uri",o.uri,r,i,n),ye(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function BWe(e,t,n,i){let o=t.wall;if(!l(o))return;let r=rr(o.interval),s=e.wall;l(s)||(e.wall=s=new w_),ye(Boolean,s,"show",o.show,r,i,n),ww(s,"positions",o.positions,n),Aae(s,"minimumHeights",o.minimumHeights,n),Aae(s,"maximumHeights",o.maximumHeights,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),Kl(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Cn,s,"shadows",o.shadows,r,i,n),ye(Dt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Iae(e,t,n,i,o){let r=e.id;if(l(r)||(r=jn()),oW=r,!l(o._version)&&r!=="document")throw new de("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")EWe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}oW=void 0}function kWe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=ee.secondsDifference(s,r),c=Math.round(a/120);return t=new km,t.startTime=ee.clone(r),t.stopTime=ee.clone(s),t.clockRange=Fr.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(r),t.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new km,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=Fr.LOOP_STOP,t.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=rr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Fr[n.range],Fr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(xo[n.step],xo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Rae(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new wt(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=ve.createIfNeeded(r),Nr.setLoading(e,!0),Promise.resolve(o).then(function(a){return UWe(e,a,r,i)}).catch(function(a){return Nr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function UWe(e,t,n,i){Nr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Mae,o.removeAll()),ll._processCzml(t,o,n,void 0,e);let r=kWe(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=Dg(n.getUrlComponent()),r=!0),Nr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Mae(){this.name=void 0,this.clock=void 0}function ll(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new Mae,this._version=void 0,this._entityCollection=new js(this),this._entityCluster=new tf,this._credit=void 0,this._resourceCredits=[]}ll.load=function(e,t){return new ll().load(e,t)};Object.defineProperties(ll.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});ll.updaters=[bWe,CWe,TWe,AWe,SWe,vWe,wWe,IWe,aWe,cWe,DWe,PWe,OWe,MWe,LWe,dWe,NWe,lWe,FWe,uWe,BWe,fWe,yWe];ll.prototype.process=function(e,t){return Rae(this,e,t,!1)};ll.prototype.load=function(e,t){return Rae(this,e,t,!0)};ll.prototype.update=function(e){return!0};ll.processPacketData=ye;ll.processPositionPacketData=Oae;ll.processMaterialPacketData=Kl;ll._processCzml=function(e,t,n,i,o){if(i=y(i,ll.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)Iae(e[r],t,i,n,o);else Iae(e,t,i,n,o)};var sB=ll;function wc(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(wc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});wc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};wc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};wc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};wc.prototype.contains=function(e){return this.indexOf(e)!==-1};wc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};wc.prototype.get=function(e){return this._dataSources[e]};wc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function aB(e,t){return e.indexOf(t)}function Lae(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}wc.prototype.raise=function(e){let t=aB(this._dataSources,e);Lae(this,t,t+1)};wc.prototype.lower=function(e){let t=aB(this._dataSources,e);Lae(this,t,t-1)};wc.prototype.raiseToTop=function(e){let t=aB(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};wc.prototype.lowerToBottom=function(e){let t=aB(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};wc.prototype.isDestroyed=function(){return!1};wc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var cB=wc;function Xs(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=jn(),this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(Xs.prototype,{length:{get:function(){return this._primitives.length}}});Xs.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e};Xs.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1};Xs.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Xs.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]};Xs.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function lB(e,t){return e._primitives.indexOf(t)}Xs.prototype.raise=function(e){if(l(e)){let t=lB(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Xs.prototype.raiseToTop=function(e){if(l(e)){let t=lB(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Xs.prototype.lower=function(e){if(l(e)){let t=lB(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Xs.prototype.lowerToBottom=function(e){if(l(e)){let t=lB(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Xs.prototype.get=function(e){return this._primitives[e]};Xs.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Xs.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};Xs.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};Xs.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};Xs.prototype.isDestroyed=function(){return!1};Xs.prototype.destroy=function(){return this.removeAll(),ue(this)};var Jl=Xs;function Vm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Vm.prototype,{length:{get:function(){return this._length}}});Vm.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Jl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Vm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Vm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};Vm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Vm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Vm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){return this.removeAll(),ue(this)};var uB=Vm;function XT(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new At}XT.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};XT.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};XT.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};XT.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};XT.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var KT=XT;var cW={},fB=new m,Nae=new m,Fae=new Be,Bae=new Z;function JT(e,t,n,i,o,r,s,a,c,u){let f=e+t;m.multiplyByScalar(i,Math.cos(f),fB),m.multiplyByScalar(n,Math.sin(f),Nae),m.add(fB,Nae,fB);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let h=r/Math.sqrt(s*d+o*p)/a;return Be.fromAxisAngle(fB,h,Fae),Z.fromQuaternion(Fae,Bae),Z.multiplyByVector(Bae,c,u),m.normalize(u,u),m.multiplyByScalar(u,a,u),u}var kae=new m,Uae=new m,aW=new m,VWe=new m;cW.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=m.fromArray(e,f,kae);i.scaleToGeodeticSurface(g,g);let h=m.clone(g,Uae),x=i.geodeticSurfaceNormal(g,VWe),b=m.multiplyByScalar(x,o,aW);m.add(g,b,g),n&&(m.multiplyByScalar(x,r,b),m.add(h,b,h),a[f+u]=h.x,a[d+u]=h.y,a[p+u]=h.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var zWe=new m,HWe=new m,GWe=new m;cW.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,d=m.magnitude(s),p=m.normalize(s,zWe),g=m.cross(m.UNIT_Z,s,HWe);g=m.normalize(g,g);let h=m.cross(p,g,GWe),x=1+Math.ceil(P.PI_OVER_TWO/a),b=P.PI_OVER_TWO/(x-1),C=P.PI_OVER_TWO-x*b;C<0&&(x-=Math.ceil(Math.abs(C)/b));let T=2*(x*(x+2)),A=t?new Array(T*3):void 0,S=0,v=kae,I=Uae,O=x*4*3,R=O-1,N=0,F=n?new Array(O):void 0,_,E,w,D,M;for(C=P.PI_OVER_TWO,v=JT(C,r,h,g,c,f,u,d,p,v),t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z),n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x),C=P.PI_OVER_TWO-b,_=1;_<x+1;++_){if(v=JT(C,r,h,g,c,f,u,d,p,v),I=JT(Math.PI-C,r,h,g,c,f,u,d,p,I),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*_+2,E=1;E<w-1;++E)D=E/(w-1),M=m.lerp(v,I,D,aW),A[S++]=M.x,A[S++]=M.y,A[S++]=M.z;A[S++]=I.x,A[S++]=I.y,A[S++]=I.z}n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,F[N++]=I.x,F[N++]=I.y,F[N++]=I.z),C=P.PI_OVER_TWO-(_+1)*b}for(_=x;_>1;--_){if(C=P.PI_OVER_TWO-(_-1)*b,v=JT(-C,r,h,g,c,f,u,d,p,v),I=JT(C+Math.PI,r,h,g,c,f,u,d,p,I),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*(_-1)+2,E=1;E<w-1;++E)D=E/(w-1),M=m.lerp(v,I,D,aW),A[S++]=M.x,A[S++]=M.y,A[S++]=M.z;A[S++]=I.x,A[S++]=I.y,A[S++]=I.z}n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,F[N++]=I.x,F[N++]=I.y,F[N++]=I.z)}C=P.PI_OVER_TWO,v=JT(-C,r,h,g,c,f,u,d,p,v);let B={};return t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,B.positions=A,B.numPts=x),n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,B.outerPositions=F),B};var Zl=cW;var ZT=new m,lW=new m,uW=new m,Vae=new m,ls=new H,zae=new Z,WWe=new Z,fW=new Be,Hae=new m,Gae=new m,Wae=new m,hB=new me,jae=new m,qae=new H,Yae=new H;function Xae(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,h=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,C=Hae,T=Gae,A=Wae,S=new Di(a),v=S.project(a.cartesianToCartographic(o,hB),jae),I=a.scaleToGeodeticSurface(o,ZT);a.geodeticSurfaceNormal(I,I);let O=zae,R=WWe;if(c!==0){let M=Be.fromAxisAngle(I,c,fW);O=Z.fromQuaternion(M,O),M=Be.fromAxisAngle(I,-c,fW),R=Z.fromQuaternion(M,R)}else O=Z.clone(Z.IDENTITY,O),R=Z.clone(Z.IDENTITY,R);let N=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,qae),F=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Yae),_=e.length,E=n?_:0,w=E/3*2;for(let M=0;M<_;M+=3){let B=M+1,V=M+2,U=m.fromArray(e,M,ZT);if(i.st){let G=Z.multiplyByVector(O,U,lW),k=S.project(a.cartesianToCartographic(G,hB),uW);m.subtract(k,v,k),ls.x=(k.x+r)/(2*r),ls.y=(k.y+s)/(2*s),N.x=Math.min(ls.x,N.x),N.y=Math.min(ls.y,N.y),F.x=Math.max(ls.x,F.x),F.y=Math.max(ls.y,F.y),n&&(d[b+w]=ls.x,d[b+1+w]=ls.y),d[b++]=ls.x,d[b++]=ls.y}(i.normal||i.tangent||i.bitangent||f)&&(C=a.geodeticSurfaceNormal(U,C),f&&(x[M+E]=-C.x,x[B+E]=-C.y,x[V+E]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=m.normalize(m.cross(m.UNIT_Z,C,T),T),Z.multiplyByVector(R,T,T)),i.normal&&(p[M]=C.x,p[B]=C.y,p[V]=C.z,n&&(p[M+E]=-C.x,p[B+E]=-C.y,p[V+E]=-C.z)),i.tangent&&(g[M]=T.x,g[B]=T.y,g[V]=T.z,n&&(g[M+E]=-T.x,g[B+E]=-T.y,g[V+E]=-T.z)),i.bitangent&&(A=m.normalize(m.cross(C,T,A),A),h[M]=A.x,h[B]=A.y,h[V]=A.z,n&&(h[M+E]=A.x,h[B+E]=A.y,h[V+E]=A.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-N.x)/(F.x-N.x),d[M+1]=(d[M+1]-N.y)/(F.y-N.y)}let D=new gn;if(i.position){let M=Zl.raisePositionsToHeight(e,t,n);D.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(D.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(D.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(D.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(D.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),f&&(D.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===an.TOP)M=M.fill(1,0,u/2);else{let B=t.offsetAttribute===an.NONE?0:1;M=M.fill(B)}D.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return D}function Kae(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var ux=new m;function jWe(e){let t=e.center;ux=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,ux),e.height,ux),ux=m.add(t,ux,ux);let n=new ae(ux,e.semiMajorAxis),i=Zl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Xae(o,e,!1),a=Kae(r);return a=Ue.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function qWe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,h=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,C=b?new Float32Array(f*3):void 0,T=0,A=Hae,S=Gae,v=Wae,I=new Di(s),O=I.project(s.cartesianToCartographic(i,hB),jae),R=s.scaleToGeodeticSurface(i,ZT);s.geodeticSurfaceNormal(R,R);let N=Be.fromAxisAngle(R,u,fW),F=Z.fromQuaternion(N,zae),_=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,qae),E=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Yae),w=e.length,D=w/3*2;for(let B=0;B<w;B+=3){let V=B+1,U=B+2,G=m.fromArray(e,B,ZT),k;if(n.st){let j=Z.multiplyByVector(F,G,lW),$=I.project(s.cartesianToCartographic(j,hB),uW);m.subtract($,O,$),ls.x=($.x+o)/(2*o),ls.y=($.y+r)/(2*r),_.x=Math.min(ls.x,_.x),_.y=Math.min(ls.y,_.y),E.x=Math.max(ls.x,E.x),E.y=Math.max(ls.y,E.y),p[T+D]=ls.x,p[T+1+D]=ls.y,p[T++]=ls.x,p[T++]=ls.y}G=s.scaleToGeodeticSurface(G,G),k=m.clone(G,lW),A=s.geodeticSurfaceNormal(G,A),b&&(C[B+w]=-A.x,C[V+w]=-A.y,C[U+w]=-A.z);let Y=m.multiplyByScalar(A,a,Vae);if(G=m.add(G,Y,G),Y=m.multiplyByScalar(A,c,Y),k=m.add(k,Y,k),n.position&&(d[B+w]=k.x,d[V+w]=k.y,d[U+w]=k.z,d[B]=G.x,d[V]=G.y,d[U]=G.z),n.normal||n.tangent||n.bitangent){v=m.clone(A,v);let j=m.fromArray(e,(B+3)%w,Vae);m.subtract(j,G,j);let $=m.subtract(k,G,uW);A=m.normalize(m.cross($,j,A),A),n.normal&&(g[B]=A.x,g[V]=A.y,g[U]=A.z,g[B+w]=A.x,g[V+w]=A.y,g[U+w]=A.z),n.tangent&&(S=m.normalize(m.cross(v,A,S),S),h[B]=S.x,h[V]=S.y,h[U]=S.z,h[B+w]=S.x,h[B+1+w]=S.y,h[B+2+w]=S.z),n.bitangent&&(x[B]=v.x,x[V]=v.y,x[U]=v.z,x[B+w]=v.x,x[V+w]=v.y,x[U+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-_.x)/(E.x-_.x),p[B+1]=(p[B+1]-_.y)/(E.y-_.y)}let M=new gn;if(n.position&&(M.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(M.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(M.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===an.TOP)B=B.fill(1,0,f/2);else{let V=t.offsetAttribute===an.NONE?0:1;B=B.fill(V)}M.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return M}function YWe(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var dB=new ae,mB=new ae;function XWe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,ZT),e.height,ZT);dB.center=m.add(t,o,dB.center),dB.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),mB.center=m.add(t,o,mB.center),mB.radius=i;let r=Zl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=ae.union(dB,mB),f=Xae(s,e,!0),d=Kae(a),p=d.length;d.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)d[S+p]=d[S+2]+g,d[S+1+p]=d[S+1]+g,d[S+2+p]=d[S]+g;let h=Ue.createTypedArray(g*2/3,d),x=new dt({attributes:f,indices:h,primitiveType:Fe.TRIANGLES}),b=qWe(c,e);d=YWe(c);let C=Ue.createTypedArray(c.length*2/3,d),T=new dt({attributes:b,indices:C,primitiveType:Fe.TRIANGLES}),A=Un.combineInstances([new Tt({geometry:x}),new Tt({geometry:T})]);return{boundingSphere:u,attributes:A[0].attributes,indices:A[0].indices}}function Jae(e,t,n,i,o,r,s){let c=Zl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=m.fromArray(c,p*3);let d=ce.fromCartesianArray(f,r,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function Hm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Me.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=oe.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Me.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Hm.packedLength=m.packedLength+oe.packedLength+Me.packedLength+9;Hm.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Zae=new m,$ae=new oe,Qae=new Me,zm={center:Zae,ellipsoid:$ae,vertexFormat:Qae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Hm.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Zae);t+=m.packedLength;let o=oe.unpack(e,t,$ae);t+=oe.packedLength;let r=Me.unpack(e,t,Qae);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,h=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=h===-1?void 0:h,n):(zm.height=f,zm.extrudedHeight=p,zm.granularity=d,zm.stRotation=u,zm.rotation=c,zm.semiMajorAxis=s,zm.semiMinorAxis=a,zm.shadowVolume=g,zm.offsetAttribute=h===-1?void 0:h,new Hm(zm))};Hm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,oe.WGS84),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Jae(n,o,r,a,s,i,t)};Hm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=XWe(o);else if(r=jWe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Fe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Hm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Hm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};function KWe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Zl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Hm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Jae(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=KWe(this)),this._textureCoordinateRotationPoints}}});var ul=Hm;var ece=new m,fx=new m;function JWe(e){let t=e.center;fx=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,fx),e.height,fx),fx=m.add(t,fx,fx);let n=new ae(fx,e.semiMajorAxis),i=Zl.computeEllipsePositions(e,!1,!0).outerPositions,o=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Zl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ue.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var pB=new ae,_B=new ae;function ZWe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,ece),e.height,ece);pB.center=m.add(t,o,pB.center),pB.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),_B.center=m.add(t,o,_B.center),_B.radius=i;let r=Zl.computeEllipsePositions(e,!1,!0).outerPositions,s=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Zl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ae.union(pB,_B),c=r.length/3;if(l(e.offsetAttribute)){let h=new Uint8Array(c);if(e.offsetAttribute===an.TOP)h=h.fill(1,0,c/2);else{let x=e.offsetAttribute===an.NONE?0:1;h=h.fill(x)}s.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ue.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let h=Math.min(u,c);g=Math.round(c/h);let x=Math.min(g*u,c);for(p=0;p<x;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function $T(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=oe.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}$T.packedLength=m.packedLength+oe.packedLength+8;$T.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var tce=new m,nce=new oe,Rp={center:tce,ellipsoid:nce,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};$T.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,tce);t+=m.packedLength;let o=oe.unpack(e,t,nce);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=oe.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(Rp.height=c,Rp.extrudedHeight=f,Rp.granularity=u,Rp.rotation=a,Rp.semiMajorAxis=r,Rp.semiMinorAxis=s,Rp.numberOfVerticalLines=d,Rp.offsetAttribute=p===-1?void 0:p,new $T(Rp))};$T.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=ZWe(o);else if(r=JWe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Fe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var sf=$T;var ice=new z,oce=m.ZERO,rce=new m,sce=new ce;function $We(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function pd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new $We(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(pd.prototype=Object.create(Kn.prototype),pd.prototype.constructor=pd);pd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,ice)),l(o)||(o=z.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,oce,rce))),new Tt({id:t,geometry:new ul(this._options),attributes:i})};pd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ice),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,oce,rce))),new Tt({id:t,geometry:new sf(this._options),attributes:r})};pd.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};pd.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||li.prototype._isHidden.call(this,e,t)};pd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};pd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=q.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=Kn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Kn.getGeometryHeight(n,i),o=Kn.getGeometryExtrudedHeight(o,r),o===Kn.CLAMP_TO_GROUND&&(o=si.getMinimumMaximumHeights(ul.computeRectangle(s,sce)).minimumTerrainHeight),s.extrudedHeight=o};pd.DynamicGeometryUpdater=QT;function QT(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(QT.prototype=Object.create(ci.prototype),QT.prototype.constructor=QT);QT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ci.prototype._isHidden.call(this,e,t,n)};QT.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,qe.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(o)&&(o=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Kn.getGeometryHeight(o,r),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(ul.computeRectangle(i,sce)).minimumTerrainHeight),i.extrudedHeight=s};var gB=pd;var QWe=new m,e7e=new m,t7e=new m,n7e=new m,i7e=new m,o7e=new m(1,1,1),ace=Math.cos,cce=Math.sin;function Mp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,o7e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Me.DEFAULT);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Me.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Mp.packedLength=2*m.packedLength+Me.packedLength+7;Mp.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var lce=new m,uce=new m,fce=new Me,Bg={radii:lce,innerRadii:uce,vertexFormat:fce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Mp.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,lce);t+=m.packedLength;let o=m.unpack(e,t,uce);t+=m.packedLength;let r=Me.unpack(e,t,fce);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=Me.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(Bg.minimumClock=s,Bg.maximumClock=a,Bg.minimumCone=c,Bg.maximumCone=u,Bg.stackPartitions=f,Bg.slicePartitions=d,Bg.offsetAttribute=p===-1?void 0:p,new Mp(Bg))};Mp.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[r],h=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),d=0;d<c;d++)h.push(i+d*(o-i)/(c-1));h.push(o);let x=g.length,b=h.length,C=0,T=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,I=!1;A&&(T=2,r>0&&(S=!0,C+=c-1),s<Math.PI&&(v=!0,C+=c-1),(o-i)%P.TWO_PI?(I=!0,C+=(u-1)*2+1):C+=1);let O=b*x*T,R=new Float64Array(O*3),N=new Array(O).fill(!1),F=new Array(O).fill(!1),_=c*u*T,E=6*(_+C+1-(c+u)*T),w=Ue.createTypedArray(_,E),D=a.normal?new Float32Array(O*3):void 0,M=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,V=a.st?new Float32Array(O*2):void 0,U=new Array(x),G=new Array(x);for(f=0;f<x;f++)U[f]=cce(g[f]),G[f]=ace(g[f]);let k=new Array(b),Y=new Array(b);for(d=0;d<b;d++)Y[d]=ace(h[d]),k[d]=cce(h[d]);for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=t.x*U[f]*Y[d],R[p++]=t.y*U[f]*k[d],R[p++]=t.z*G[f];let j=O/2;if(A)for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=n.x*U[f]*Y[d],R[p++]=n.y*U[f]*k[d],R[p++]=n.z*G[f],N[j]=!0,f>0&&f!==x-1&&d!==0&&d!==b-1&&(F[j]=!0),j++;p=0;let $,W;for(f=1;f<x-2;f++)for($=f*b,W=(f+1)*b,d=1;d<b-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=$+d+1,w[p++]=W+d,w[p++]=$+d+1,w[p++]=$+d;if(A){let Oe=x*b;for(f=1;f<x-2;f++)for($=Oe+f*b,W=Oe+(f+1)*b,d=1;d<b-2;d++)w[p++]=W+d,w[p++]=$+d,w[p++]=$+d+1,w[p++]=W+d,w[p++]=$+d+1,w[p++]=W+d+1}let K,J;if(A){if(S)for(J=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=J+f+1,w[p++]=f,w[p++]=J+f+1,w[p++]=J+f;if(v)for(K=x*b-b,J=x*b*T-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=J+f,w[p++]=K+f+1,w[p++]=J+f,w[p++]=J+f+1}if(I){for(f=1;f<x-2;f++)J=b*x+b*f,K=b*f,w[p++]=J,w[p++]=K+b,w[p++]=K,w[p++]=J,w[p++]=J+b,w[p++]=K+b;for(f=1;f<x-2;f++)J=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=J,w[p++]=K,w[p++]=K+b,w[p++]=J+b,w[p++]=J}let he=new gn;a.position&&(he.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let ge=0,se=0,pe=0,xe=0,De=O/2,Se,we=oe.fromCartesian3(t),ze=oe.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){Se=N[f]?ze:we;let Oe=m.fromArray(R,f*3,QWe),ft=Se.geodeticSurfaceNormal(Oe,e7e);if(F[f]&&m.negate(ft,ft),a.st){let Ct=H.negate(ft,i7e);V[ge++]=Math.atan2(Ct.y,Ct.x)/P.TWO_PI+.5,V[ge++]=Math.asin(ft.z)/Math.PI+.5}if(a.normal&&(D[se++]=ft.x,D[se++]=ft.y,D[se++]=ft.z),a.tangent||a.bitangent){let Ct=t7e,ot=0,sn;if(N[f]&&(ot=De),!S&&f>=ot&&f<ot+b*2?sn=m.UNIT_X:sn=m.UNIT_Z,m.cross(sn,ft,Ct),m.normalize(Ct,Ct),a.tangent&&(M[pe++]=Ct.x,M[pe++]=Ct.y,M[pe++]=Ct.z),a.bitangent){let wn=m.cross(ft,Ct,n7e);m.normalize(wn,wn),B[xe++]=wn.x,B[xe++]=wn.y,B[xe++]=wn.z}}}a.st&&(he.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(he.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D})),a.tangent&&(he.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(he.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let Oe=R.length,ft=e._offsetAttribute===an.NONE?0:1,Ct=new Uint8Array(Oe/3).fill(ft);he.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ct})}return new dt({attributes:he,indices:w,primitiveType:Fe.TRIANGLES,boundingSphere:ae.fromEllipsoid(we),offsetAttribute:e._offsetAttribute})};var dW;Mp.getUnitEllipsoid=function(){return l(dW)||(dW=Mp.createGeometry(new Mp({radii:new m(1,1,1),vertexFormat:Me.POSITION_ONLY}))),dW};var Ks=Mp;var r7e=new Vt(z.WHITE),mW=m.ZERO,hW=new m,s7e=new m,a7e=new m,pW=new z,c7e=new m(1,1,1);function l7e(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function $l(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new l7e(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&($l.prototype=Object.create(li.prototype),$l.prototype.constructor=$l);Object.defineProperties($l.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});$l.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=zn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Vt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,pW)),l(f)||(f=z.WHITE),r=Ht.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,mW,hW))),new Tt({id:i,geometry:new Ks(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:u})};$l.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,pW),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(r),distanceDisplayCondition:zn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,mW,hW))),new Tt({id:i,geometry:new Ju(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};$l.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};$l.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||li.prototype._isHidden.call(this,e,t)};$l.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};$l.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Vt?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?an.ALL:void 0};$l.prototype._onEntityPropertyChanged=I_;$l.DynamicGeometryUpdater=Iw;function Iw(e,t,n){ci.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new L,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}l(Object.create)&&(Iw.prototype=Object.create(ci.prototype),Iw.prototype.constructor=Iw);Iw.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,s7e),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=q.getValueOrDefault(n.fill,e,!0),s=q.getValueOrDefault(n.outline,e,!1),a=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,pW),c=tr.getValue(e,y(n.material,r7e),this._material),u=q.getValueOrUndefined(n.innerRadii,e,a7e),f=q.getValueOrUndefined(n.minimumClock,e),d=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),g=q.getValueOrUndefined(n.maximumCone,e),h=q.getValueOrUndefined(n.stackPartitions,e),x=q.getValueOrUndefined(n.slicePartitions,e),b=q.getValueOrUndefined(n.subdivisions,e),C=q.getValueOrDefault(n.outlineWidth,e,1),T=q.getValueOrDefault(n.heightReference,e,qe.NONE),A=T!==qe.NONE?an.ALL:void 0,S=this._scene.mode,v=S===ne.SCENE3D&&T===qe.NONE,I=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),N=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),F=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,mW,hW);if(!v||this._lastSceneMode!==S||!l(this._primitive)||I.stackPartitions!==h||I.slicePartitions!==x||l(u)&&!m.equals(I.innerRadii!==u)||I.minimumClock!==f||I.maximumClock!==d||I.minimumCone!==p||I.maximumCone!==g||I.subdivisions!==b||this._lastOutlineWidth!==C||I.offsetAttribute!==A){let E=this._primitives;if(E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=C,I.stackPartitions=h,I.slicePartitions=x,I.subdivisions=b,I.offsetAttribute=A,I.radii=m.clone(v?c7e:i,I.radii),l(u))if(v){let B=m.magnitude(i);I.innerRadii=m.fromElements(u.x/B,u.y/B,u.z/B,I.innerRadii)}else I.innerRadii=m.clone(u,I.innerRadii);else I.innerRadii=void 0;I.minimumClock=f,I.maximumClock=d,I.minimumCone=p,I.maximumCone=g;let w=new co({material:c,translucent:c.isTranslucent(),closed:!0});I.vertexFormat=w.vertexFormat;let D=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=E.add(new Dn({geometryInstances:D,appearance:w,asynchronous:!1,shadows:O}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=E.add(new Dn({geometryInstances:M,appearance:new cn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:O})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=N,this._lastOffset=m.clone(F,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,w=this._outlinePrimitive;E.show=!0,w.show=!0,E.appearance.material=c;let D=this._attributes;l(D)||(D=E.getGeometryInstanceAttributes(t),this._attributes=D),r!==this._lastShow&&(D.show=bn.toValue(r,D.show),this._lastShow=r);let M=this._outlineAttributes;l(M)||(M=w.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=bn.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=Ht.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),Dt.equals(N,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=zn.toValue(N,D.distanceDisplayCondition),M.distanceDisplayCondition=zn.toValue(N,M.distanceDisplayCondition),Dt.clone(N,this._lastDistanceDisplayCondition)),m.equals(F,this._lastOffset)||(D.offset=Zi.toValue(F,D.offset),M.offset=Zi.toValue(F,D.offset),m.clone(F,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=L.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var yB=$l;function eA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Me.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}eA.packedLength=Me.packedLength;eA.pack=function(e,t,n){return n=y(n,0),Me.pack(e._vertexFormat,t,n),t};var dce=new Me,u7e={vertexFormat:dce};eA.unpack=function(e,t,n){t=y(t,0);let i=Me.unpack(e,t,dce);return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n):new eA(u7e)};var xB=new m(-.5,-.5,0),bB=new m(.5,.5,0);eA.createGeometry=function(e){let t=e._vertexFormat,n=new gn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=xB.x,o[1]=xB.y,o[2]=0,o[3]=bB.x,o[4]=xB.y,o[5]=0,o[6]=bB.x,o[7]=bB.y,o[8]=0,o[9]=xB.x,o[10]=bB.y,o[11]=0,n.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new dt({attributes:n,indices:i,primitiveType:Fe.TRIANGLES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var CB=eA;function tA(){this._workerName="createPlaneOutlineGeometry"}tA.packedLength=0;tA.pack=function(e,t){return t};tA.unpack=function(e,t,n){return l(n)?n:new tA};var kg=new m(-.5,-.5,0),TB=new m(.5,.5,0);tA.createGeometry=function(){let e=new gn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=kg.x,n[1]=kg.y,n[2]=kg.z,n[3]=TB.x,n[4]=kg.y,n[5]=kg.z,n[6]=TB.x,n[7]=TB.y,n[8]=kg.z,n[9]=kg.x,n[10]=TB.y,n[11]=kg.z,e.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new dt({attributes:e,indices:t,primitiveType:Fe.LINES,boundingSphere:new ae(m.ZERO,Math.sqrt(2))})};var AB=tA;var f7e=new m,mce=new z;function d7e(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function af(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new d7e(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(af.prototype=Object.create(li.prototype),af.prototype.constructor=af);af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,mce)),l(g)||(g=z.WHITE),o=Ht.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=_W(d,p,f,f),new Tt({id:t,geometry:new CB(this._options),modelMatrix:f,attributes:i})};af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,mce),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=q.getValueOrDefault(r.plane,e,s.plane),u=q.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=_W(c,u,a,a),new Tt({id:t,geometry:new AB,modelMatrix:a,attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o)}})};af.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||li.prototype._isHidden.call(this,e,t)};af.prototype._getIsClosed=function(e){return!1};af.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};af.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};af.DynamicGeometryUpdater=nA;function nA(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(nA.prototype=Object.create(ci.prototype),nA.prototype.constructor=nA);nA.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,f7e);return!l(o)||!l(i.plane)||!l(i.dimensions)||ci.prototype._isHidden.call(this,e,t,n)};nA.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var m7e=new m,h7e=new m,p7e=new m,_7e=new m,g7e=new Z,y7e=new Z,x7e=new L;function _W(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,p7e),a=m.clone(m.UNIT_Z,h7e);P.equalsEpsilon(Math.abs(m.dot(a,o)),1,P.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,o,m7e);a=m.cross(o,c,a),m.normalize(c,c),m.normalize(a,a);let u=g7e;Z.setColumn(u,0,c,u),Z.setColumn(u,1,a,u),Z.setColumn(u,2,o,u);let f=m.fromElements(t.x,t.y,1,_7e),d=Z.multiplyByScale(u,f,y7e),p=L.fromRotationTranslation(d,s,x7e);return L.multiplyTransformation(n,p,i)}af.createPrimitiveMatrix=_W;var EB=af;var b7e=new m,C7e=new Ke,T7e=new H,A7e=new H,E7e=new m,S7e=new m,v7e=new m,Dw=new m,w7e=new m,I7e=new m,hce=new Be,D7e=new Z,P7e=new Z,O7e=new m;function R7e(e,t,n,i,o,r,s,a,c){let u=e.positions,f=fi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ue.createTypedArray(u.length,f.length);d.set(f);let p=D7e;if(i!==0){let _=Be.fromAxisAngle(s,i,hce);if(p=Z.fromQuaternion(_,p),t.tangent||t.bitangent){_=Be.fromAxisAngle(s,-i,hce);let E=Z.fromQuaternion(_,P7e);a=m.normalize(Z.multiplyByVector(E,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=Z.clone(Z.IDENTITY,p);let g=A7e;t.st&&(g.x=n.x,g.y=n.y);let h=u.length,x=h*3,b=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,T=t.tangent?new Float32Array(x):void 0,A=t.bitangent?new Float32Array(x):void 0,S=t.st?new Float32Array(h*2):void 0,v=0,I=0,O=0,R=0,N=0;for(let _=0;_<h;_++){let E=u[_];if(b[v++]=E.x,b[v++]=E.y,b[v++]=E.z,t.st)if(l(o)&&o.positions.length===h)S[N++]=o.positions[_].x,S[N++]=o.positions[_].y;else{let w=Z.multiplyByVector(p,E,b7e),D=r(w,T7e);H.subtract(D,g,D);let M=P.clamp(D.x/n.width,0,1),B=P.clamp(D.y/n.height,0,1);S[N++]=M,S[N++]=B}t.normal&&(C[I++]=s.x,C[I++]=s.y,C[I++]=s.z),t.tangent&&(T[R++]=a.x,T[R++]=a.y,T[R++]=a.z),t.bitangent&&(A[O++]=c.x,A[O++]=c.y,A[O++]=c.z)}let F=new gn;return t.position&&(F.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(F.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(F.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(F.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.st&&(F.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new dt({attributes:F,indices:d,primitiveType:Fe.TRIANGLES})}function dx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Me.DEFAULT);this._vertexFormat=Me.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+Me.packedLength+oe.packedLength+(l(n)?Xn.computeHierarchyPackedLength(n,H):1)+2}dx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new dx(t)};dx.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var M7e=oe.clone(oe.UNIT_SPHERE),L7e=new Me,N7e={polygonHierarchy:{}};dx.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,M7e);t+=oe.packedLength;let r=Me.unpack(e,t,L7e);t+=Me.packedLength;let s=e[t++],a=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new dx(N7e)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};dx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Ao(s,m.equalsEpsilon,!0),s.length<3)return;let a=E7e,c=S7e,u=v7e,f=w7e,d=I7e;if(!hg.computeProjectTo2DArguments(s,Dw,f,d))return;if(a=m.cross(f,d,a),a=m.normalize(a,a),!m.equalsEpsilon(Dw,m.ZERO,P.EPSILON6)){let N=e._ellipsoid.geodeticSurfaceNormal(Dw,O7e);m.dot(a,N)<0&&(a=m.negate(a,a),f=m.negate(f,f))}let g=hg.createProjectPointsTo2DFunction(Dw,f,d),h=hg.createProjectPointTo2DFunction(Dw,f,d);t.tangent&&(c=m.clone(f,c)),t.bitangent&&(u=m.clone(d,u));let x=Xn.polygonsFromHierarchy(n,r,g,!1),b=x.hierarchy,C=x.polygons,T=function(N){return N},A=r?Xn.polygonsFromHierarchy(o,!0,T,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=ae.fromPoints(s),v=Xn.computeBoundingRectangle(a,h,s,i,C7e),I=[];for(let N=0;N<C.length;N++){let F=new Tt({geometry:R7e(C[N],t,v,i,r?A[N]:void 0,h,a,c,u)});I.push(F)}let O=Un.combineInstances(I)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Ue.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new dt({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:S})};var SB=dx;var F7e=new me,pce=new me;function B7e(e,t,n,i){let r=i.cartesianToCartographic(e,F7e).height,s=i.cartesianToCartographic(t,pce);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,pce);a.height=r-100,i.cartographicToCartesian(a,n)}var k7e=new Ke,U7e=new m,V7e=new m,z7e=new m,H7e=new m,G7e=new m,W7e=new m,vB=new m,Gm=new m,iA=new m,j7e=new H,q7e=new H,Y7e=new m,_ce=new Be,X7e=new Z,K7e=new Z;function gW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.tangentPlane,p=e.ellipsoid,g=e.stRotation,h=e.perPositionHeight,x=j7e;x.x=f.x,x.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(h&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,A=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,v=0,I=0,O=V7e,R=z7e,N=H7e,F=!0,_=X7e,E=K7e;if(g!==0){let M=Be.fromAxisAngle(d._plane.normal,g,_ce);_=Z.fromQuaternion(M,_),M=Be.fromAxisAngle(d._plane.normal,-g,_ce),E=Z.fromQuaternion(M,E)}else _=Z.clone(Z.IDENTITY,_),E=Z.clone(Z.IDENTITY,E);let w=0,D=0;c&&u&&(w=s/2,D=s/3,s/=2);for(let M=0;M<s;M+=3){let B=m.fromArray(o,M,Y7e);if(t.st&&!l(r)){let V=Z.multiplyByVector(_,B,U7e);V=p.scaleToGeodeticSurface(V,V);let U=d.projectPointOntoPlane(V,q7e);H.subtract(U,x,U);let G=P.clamp(U.x/f.width,0,1),k=P.clamp(U.y/f.height,0,1);u&&(b[v+D]=G,b[v+1+D]=k),c&&(b[v]=G,b[v+1]=k),v+=2}if(t.normal||t.tangent||t.bitangent||i){let V=I+1,U=I+2;if(a){if(M+3<s){let G=m.fromArray(o,M+3,G7e);if(F){let k=m.fromArray(o,M+s,W7e);h&&B7e(B,G,k,p),m.subtract(G,B,G),m.subtract(k,B,k),O=m.normalize(m.cross(k,G,O),O),F=!1}m.equalsEpsilon(G,B,P.EPSILON10)&&(F=!0)}(t.tangent||t.bitangent)&&(N=p.geodeticSurfaceNormal(B,N),t.tangent&&(R=m.normalize(m.cross(N,O,R),R)))}else O=p.geodeticSurfaceNormal(B,O),(t.tangent||t.bitangent)&&(h&&(vB=m.fromArray(C,I,vB),Gm=m.cross(m.UNIT_Z,vB,Gm),Gm=m.normalize(Z.multiplyByVector(E,Gm,Gm),Gm),t.bitangent&&(iA=m.normalize(m.cross(vB,Gm,iA),iA))),R=m.cross(m.UNIT_Z,O,R),R=m.normalize(Z.multiplyByVector(E,R,R),R),t.bitangent&&(N=m.normalize(m.cross(O,R,N),N)));t.normal&&(e.wall?(C[I+w]=O.x,C[V+w]=O.y,C[U+w]=O.z):u&&(C[I+w]=-O.x,C[V+w]=-O.y,C[U+w]=-O.z),(c&&!h||a)&&(C[I]=O.x,C[V]=O.y,C[U]=O.z)),i&&(a&&(O=p.geodeticSurfaceNormal(B,O)),S[I+w]=-O.x,S[V+w]=-O.y,S[U+w]=-O.z),t.tangent&&(e.wall?(T[I+w]=R.x,T[V+w]=R.y,T[U+w]=R.z):u&&(T[I+w]=-R.x,T[V+w]=-R.y,T[U+w]=-R.z),c&&(h?(T[I]=Gm.x,T[V]=Gm.y,T[U]=Gm.z):(T[I]=R.x,T[V]=R.y,T[U]=R.z))),t.bitangent&&(u&&(A[I+w]=N.x,A[V+w]=N.y,A[U+w]=N.z),c&&(h?(A[I]=iA.x,A[V]=iA.y,A[U]=iA.z):(A[I]=N.x,A[V]=N.y,A[U]=N.z))),I+=3}}t.st&&!l(r)&&(n.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),i&&(n.attributes.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===an.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===an.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var J7e=new me,Z7e=new me,Ug={westOverIDL:0,eastOverIDL:0},oA=new zf;function xce(e,t,n,i,o){if(o=y(o,new ce),!l(e)||e.length<3)return o.west=0,o.north=0,o.south=0,o.east=0,o;if(n===Qt.RHUMB)return ce.fromCartesianArray(e,t,o);oA.ellipsoid.equals(t)||(oA=new zf(void 0,void 0,t)),o.west=Number.POSITIVE_INFINITY,o.east=Number.NEGATIVE_INFINITY,o.south=Number.POSITIVE_INFINITY,o.north=Number.NEGATIVE_INFINITY,Ug.westOverIDL=Number.POSITIVE_INFINITY,Ug.eastOverIDL=Number.NEGATIVE_INFINITY;let r=1/P.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],Z7e),c=J7e,u;for(let f=1;f<s;f++)u=c,c=a,a=t.cartesianToCartographic(e[f],u),oA.setEndPoints(c,a),gce(oA,r,o,Ug);return u=c,c=a,a=t.cartesianToCartographic(e[0],u),oA.setEndPoints(c,a),gce(oA,r,o,Ug),o.east-o.west>Ug.eastOverIDL-Ug.westOverIDL&&(o.west=Ug.westOverIDL,o.east=Ug.eastOverIDL,o.east>P.PI&&(o.east=o.east-P.TWO_PI),o.west>P.PI&&(o.west=o.west-P.TWO_PI)),o}var $7e=new me;function gce(e,t,n,i){let o=e.surfaceDistance,r=Math.ceil(o*t),s=r>0?o/(r-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<r;c++){let u=e.interpolateUsingSurfaceDistance(a,$7e);a+=s;let f=u.longitude,d=u.latitude;n.west=Math.min(n.west,f),n.east=Math.max(n.east,f),n.south=Math.min(n.south,d),n.north=Math.max(n.north,d);let p=f>=0?f:f+P.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var yce=[];function Q7e(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let T=Xn.createGeometryFromPositions(e,t,n,i,r,c,u),A=T.attributes.position.values,S=T.indices,v,I;if(s&&a){let O=A.concat(A);v=O.length/3,I=Ue.createTypedArray(v,S.length*2),I.set(S);let R=S.length,N=v/2;for(d=0;d<R;d+=3){let F=I[d]+N,_=I[d+1]+N,E=I[d+2]+N;I[d+R]=E,I[d+1+R]=_,I[d+2+R]=F}if(T.attributes.position.values=O,r&&c.normal){let F=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(O.length),T.attributes.normal.values.set(F)}if(c.st&&l(n)){let F=T.attributes.st.values;T.attributes.st.values=new Float32Array(v*2),T.attributes.st.values=F.concat(F)}T.indices=I}else if(a){for(v=A.length/3,I=Ue.createTypedArray(v,S.length),d=0;d<S.length;d+=3)I[d]=S[d+2],I[d+1]=S[d+1],I[d+2]=S[d];T.indices=I}f.topAndBottom=new Tt({geometry:T})}let p=o.outerRing,g=Ma.fromPoints(p,e),h=g.projectPointsOntoPlane(p,yce),x=fi.computeWindingOrder2D(h);x===rs.CLOCKWISE&&(p=p.slice().reverse());let b=Xn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new Tt({geometry:b}));let C=o.holes;for(d=0;d<C.length;d++){let T=C[d];g=Ma.fromPoints(T,e),h=g.projectPointsOntoPlane(T,yce),x=fi.computeWindingOrder2D(h),x===rs.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),b=Xn.computeWallGeometry(T,n,e,i,r,u),f.walls.push(new Tt({geometry:b}))}return f}function _d(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Me.DEFAULT),i=y(e.ellipsoid,oe.WGS84),o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Me.clone(n),this._ellipsoid=oe.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Qt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Xn.computeHierarchyPackedLength(t,m)+oe.packedLength+Me.packedLength+(s?Xn.computeHierarchyPackedLength(s,H):1)+12}_d.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new _d(t)};_d.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Xn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var eje=oe.clone(oe.UNIT_SPHERE),tje=new Me,nje={polygonHierarchy:{}};_d.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,eje);t+=oe.packedLength;let r=Me.unpack(e,t,tje);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,h=e[t++]===1,x=e[t++],b=e[t++],C=e[t]===-1?void 0:Xn.unpackPolygonHierarchy(e,t,H);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let T=e[t++];return l(n)||(n=new _d(nje)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=h,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=C,n.packedLength=T,n};_d.computeRectangle=function(e,t){let n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.arcType,Qt.GEODESIC),o=e.polygonHierarchy,r=y(e.ellipsoid,oe.WGS84);return xce(o.positions,r,i,n,t)};_d.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let g=Ma.fromPoints(p,n),h=Xn.polygonsFromHierarchy(r,d,g.projectPointsOntoPlane.bind(g),!s,n),x=h.hierarchy,b=h.polygons,C=function(w){return w},T=d?Xn.polygonsFromHierarchy(f,!0,C,!1).polygons:void 0;if(x.length===0)return;p=x[0].outerRing;let A=Xn.computeBoundingRectangle(g.plane.normal,g.projectPointOntoPlane.bind(g),p,o,k7e),S=[],v=e._height,I=e._extrudedHeight,O=e._perPositionHeightExtrude||!P.equalsEpsilon(v,I,0,P.EPSILON2),R={perPositionHeight:s,vertexFormat:t,geometry:void 0,tangentPlane:g,boundingRectangle:A,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},N;if(O)for(R.extrude=!0,R.top=a,R.bottom=c,R.shadowVolume=e._shadowVolume,R.offsetAttribute=e._offsetAttribute,N=0;N<b.length;N++){let w=Q7e(n,b[N],d?T[N]:void 0,i,x[N],s,a,c,t,u),D;a&&c?(D=w.topAndBottom,R.geometry=Xn.scaleToGeodeticHeightExtruded(D.geometry,v,I,n,s)):a?(D=w.topAndBottom,D.geometry.attributes.position.values=fi.scaleToGeodeticHeight(D.geometry.attributes.position.values,v,n,!s),R.geometry=D.geometry):c&&(D=w.topAndBottom,D.geometry.attributes.position.values=fi.scaleToGeodeticHeight(D.geometry.attributes.position.values,I,n,!0),R.geometry=D.geometry),(a||c)&&(R.wall=!1,D.geometry=gW(R),S.push(D));let M=w.walls;R.wall=!0;for(let B=0;B<M.length;B++){let V=M[B];R.geometry=Xn.scaleToGeodeticHeightExtruded(V.geometry,v,I,n,s),V.geometry=gW(R),S.push(V)}}else for(N=0;N<b.length;N++){let w=new Tt({geometry:Xn.createGeometryFromPositions(n,b[N],d?T[N]:void 0,i,s,t,u)});if(w.geometry.attributes.position.values=fi.scaleToGeodeticHeight(w.geometry.attributes.position.values,v,n,!s),R.geometry=w.geometry,w.geometry=gW(R),l(e._offsetAttribute)){let D=w.geometry.attributes.position.values.length,M=e._offsetAttribute===an.NONE?0:1,B=new Uint8Array(D/3).fill(M);w.geometry.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}S.push(w)}let F=Un.combineInstances(S)[0];F.attributes.position.values=new Float64Array(F.attributes.position.values),F.indices=Ue.createTypedArray(F.attributes.position.values.length/3,F.indices);let _=F.attributes,E=ae.fromVertices(_.position.values);return t.position||delete _.position,new dt({attributes:_,indices:F.indices,primitiveType:F.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};_d.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new _d({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function ije(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return dt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(_d.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=xce(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ije(this)),this._textureCoordinateRotationPoints}}});var rA=_d;var bce=[],wB=[];function oje(e,t,n,i,o){let s=Ma.fromPoints(t,e).projectPointsOntoPlane(t,bce);fi.computeWindingOrder2D(s)===rs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let h=t[u],x=t[(u+1)%f];c[d++]=h.x,c[d++]=h.y,c[d++]=h.z,c[d++]=x.x,c[d++]=x.y,c[d++]=x.z}else{let h=0;if(o===Qt.GEODESIC)for(u=0;u<f;u++)h+=Xn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Qt.RHUMB)for(u=0;u<f;u++)h+=Xn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(h*3),u=0;u<f;u++){let x;o===Qt.GEODESIC?x=Xn.subdivideLine(t[u],t[(u+1)%f],n,wB):o===Qt.RHUMB&&(x=Xn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,wB));let b=x.length;for(let C=0;C<b;++C)c[d++]=x[C]}}f=c.length/3;let p=f*2,g=Ue.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new Tt({geometry:new dt({attributes:new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Fe.LINES})})}function rje(e,t,n,i,o){let s=Ma.fromPoints(t,e).projectPointsOntoPlane(t,bce);fi.computeWindingOrder2D(s)===rs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let b=t[u],C=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let b=0;if(o===Qt.GEODESIC)for(u=0;u<f;u++)b+=Xn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Qt.RHUMB)for(u=0;u<f;u++)b+=Xn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){d[u]=p/3;let C;o===Qt.GEODESIC?C=Xn.subdivideLine(t[u],t[(u+1)%f],n,wB):o===Qt.RHUMB&&(C=Xn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,wB));let T=C.length;for(let A=0;A<T;++A)c[p++]=C[A]}}f=c.length/(3*2);let g=d.length,h=(f*2+g)*2,x=Ue.createTypedArray(f+g,h);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=d[u];x[p++]=b,x[p++]=b+f}return new Tt({geometry:new dt({attributes:new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Fe.LINES})})}function mx(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,oe.WGS84),i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,Qt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=oe.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Xn.computeHierarchyPackedLength(t,m)+oe.packedLength+8}mx.pack=function(e,t,n){return n=y(n,0),n=Xn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var sje=oe.clone(oe.UNIT_SPHERE),aje={polygonHierarchy:{}};mx.unpack=function(e,t,n){t=y(t,0);let i=Xn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,sje);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new mx(aje)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};mx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new mx(t)};mx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Xn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,h;if(p)for(h=0;h<s.length;h++){if(a=rje(t,s[h],u,o,r),a.geometry=Xn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,T=new Uint8Array(C);e._offsetAttribute===an.TOP?T=T.fill(1,0,C/2):(g=e._offsetAttribute===an.NONE?0:1,T=T.fill(g)),a.geometry.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(h=0;h<s.length;h++){if(a=oje(t,s[h],u,o,r),a.geometry.attributes.position.values=fi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===an.NONE?0:1;let T=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let x=Un.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new dt({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var IB=mx;var Cce="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Tce="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Ace=new z,Ece=m.ZERO,Sce=new m,vce=new ce,cje=[],lje=new H;function uje(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function Ql(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new uje(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Ql.prototype=Object.create(Kn.prototype),Ql.prototype.constructor=Ql);Ql.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Ace)),l(s)||(s=z.WHITE),o.color=Ht.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ece,Sce)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new SB(i):r=new rA(i),new Tt({id:t,geometry:r,attributes:o})};Ql.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ace),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(o),distanceDisplayCondition:zn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ece,Sce)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new ad(i):a=new IB(i),new Tt({id:t,geometry:a,attributes:s})};Ql.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.mapProjection.ellipsoid,r=Ma.fromPoints(i,o),s=r.projectPointsOntoPlane(i,cje),a=s.length,c=0,u=a-1,f=new H;for(let p=0;p<a;u=p++){let g=s[p],h=s[u],x=g.x*h.y-h.x*g.y,b=H.add(g,h,lje);b=H.multiplyByScalar(b,x,b),f=H.add(f,b,f),c+=x}let d=1/(c*3);return f=H.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};Ql.prototype._isHidden=function(e,t){return!l(t.hierarchy)||li.prototype._isHidden.call(this,e,t)};Ql.prototype._isOnTerrain=function(e,t){let n=Kn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};Ql.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};Ql.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=q.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),a=q.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE),u=q.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=Kn.getGeometryHeight(r,s);let f;u?(l(r)&&(r=void 0,Nt(Cce)),s!==qe.NONE&&u&&(r=void 0,Nt(Tce))):(l(a)&&!l(r)&&(r=0),f=Kn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=q.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,Qt.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=Kn.getGeometryExtrudedHeight(a,c),a===Kn.CLAMP_TO_GROUND&&(a=si.getMinimumMaximumHeights(rA.computeRectangle(i,vce)).minimumTerrainHeight),i.extrudedHeight=a};Ql.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};Ql.DynamicGeometryUpdater=sA;function sA(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(sA.prototype=Object.create(ci.prototype),sA.prototype.constructor=sA);sA.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ci.prototype._isHidden.call(this,e,t,n)};sA.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,qe.NONE),s=q.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);o=Kn.getGeometryHeight(o,s);let u;c?(l(o)&&(o=void 0,Nt(Cce)),r!==qe.NONE&&c&&(o=void 0,Nt(Tce))):(l(a)&&!l(o)&&(o=0),u=Kn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,n,Qt.GEODESIC),a=Kn.getGeometryExtrudedHeight(a,s),a===Kn.CLAMP_TO_GROUND&&(a=si.getMinimumMaximumHeights(rA.computeRectangle(i,vce)).minimumTerrainHeight),i.extrudedHeight=a};var DB=Ql;function fje(e,t,n,i){let o=new gn;i.position&&(o.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=fi.triangulate(t),u=(a-1)*r*6+c.length*2,f=Ue.createTypedArray(s,u),d,p,g,h,x,b,C=r*2,T=0;for(d=0;d<a-1;d++){for(p=0;p<r-1;p++)g=p*2+d*r*2,b=g+C,h=g+1,x=h+C,f[T++]=h,f[T++]=g,f[T++]=x,f[T++]=x,f[T++]=g,f[T++]=b;g=r*2-2+d*r*2,h=g+1,x=h+C,b=g+C,f[T++]=h,f[T++]=g,f[T++]=x,f[T++]=x,f[T++]=g,f[T++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),I=1/(a-1),O=1/n.height,R=n.height/2,N,F,_=0;for(d=0;d<a;d++){for(N=d*I,F=O*(t[0].y+R),v[_++]=N,v[_++]=F,p=1;p<r;p++)F=O*(t[p].y+R),v[_++]=N,v[_++]=F,v[_++]=N,v[_++]=F;F=O*(t[0].y+R),v[_++]=N,v[_++]=F}for(p=0;p<r;p++)N=0,F=O*(t[p].y+R),v[_++]=N,v[_++]=F;for(p=0;p<r;p++)N=(a-1)*I,F=O*(t[p].y+R),v[_++]=N,v[_++]=F;o.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let A=s-r*2;for(d=0;d<c.length;d+=3){let v=c[d]+A,I=c[d+1]+A,O=c[d+2]+A;f[T++]=v,f[T++]=I,f[T++]=O,f[T++]=O+r,f[T++]=I+r,f[T++]=v+r}let S=new dt({attributes:o,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Fe.TRIANGLES});if(i.normal&&(S=Un.computeNormal(S)),i.tangent||i.bitangent){try{S=Un.computeTangentAndBitangent(S)}catch{Nt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function Ow(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._cornerType=y(e.cornerType,Li.ROUNDED),this._vertexFormat=Me.clone(y(e.vertexFormat,Me.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+oe.packedLength+Me.packedLength+2}Ow.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var wce=oe.clone(oe.UNIT_SPHERE),Ice=new Me,Pw={polylinePositions:void 0,shapePositions:void 0,ellipsoid:wce,vertexFormat:Ice,cornerType:void 0,granularity:void 0};Ow.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=oe.unpack(e,t,wce);t+=oe.packedLength;let c=Me.unpack(e,t,Ice);t+=Me.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Me.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(Pw.polylinePositions=r,Pw.shapePositions=s,Pw.cornerType=u,Pw.granularity=f,new Ow(Pw))};var dje=new Ke;Ow.createGeometry=function(e){let t=e._positions,n=Ao(t,m.equalsEpsilon),i=e._shape;if(i=Nm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===rs.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,dje),r=Nm.computePositions(n,i,o,e,!0);return fje(r,i,o,e._vertexFormat)};var PB=Ow;function mje(e,t){let n=new gn;n.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ue.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,h=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+h}return new dt({attributes:n,indices:Ue.createTypedArray(o,a),boundingSphere:ae.fromVertices(e),primitiveType:Fe.LINES})}function Mw(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+oe.packedLength+2}Mw.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Dce=oe.clone(oe.UNIT_SPHERE),Rw={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Dce,height:void 0,cornerType:void 0,granularity:void 0};Mw.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=oe.unpack(e,t,Dce);t+=oe.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(Rw.polylinePositions=r,Rw.shapePositions=s,Rw.cornerType=c,Rw.granularity=u,new Mw(Rw))};var hje=new Ke;Mw.createGeometry=function(e){let t=e._positions,n=Ao(t,m.equalsEpsilon),i=e._shape;if(i=Nm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===rs.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,hje),r=Nm.computePositions(n,i,o,e,!1);return mje(r,i)};var OB=Mw;var Pce=new z;function pje(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Wm(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new pje(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Wm.prototype=Object.create(li.prototype),Wm.prototype.constructor=Wm);Wm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Pce)),l(c)||(c=z.WHITE),o=Ht.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Tt({id:t,geometry:new PB(this._options),attributes:i})};Wm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Pce),o=this._distanceDisplayConditionProperty.getValue(e);return new Tt({id:t,geometry:new OB(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o)}})};Wm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||li.prototype._isHidden.call(this,e,t)};Wm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};Wm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Vt;o.vertexFormat=r?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};Wm.DynamicGeometryUpdater=aA;function aA(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(aA.prototype=Object.create(ci.prototype),aA.prototype.constructor=aA);aA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ci.prototype._isHidden.call(this,e,t,n)};aA.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var RB=Wm;var yW=new m,Mce=new m,Lce=new m,Nce=new m,Fce=new ce,_je=new H,gje=new ae,yje=new ae;function Bce(e,t){let n=new dt({attributes:new gn,primitiveType:Fe.TRIANGLES});return n.attributes.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function xje(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=Nce,f=Lce,d=Mce;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=m.fromArray(e,p,yW),h=c+1,x=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,d,f),Z.multiplyByVector(i,f,f),m.normalize(f,f),t.bitangent&&m.normalize(m.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[h]=d.y,r[x]=d.z),t.tangent&&(s[c]=f.x,s[h]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[h]=u.y,a[x]=u.z),c+=3}return Bce(t,{positions:e,normals:r,tangents:s,bitangents:a})}var xW=new m,kce=new m;function bje(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=Nce,p=Lce,g=Mce;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let x=m.fromArray(e,h,yW),b=m.fromArray(e,(h+6)%i,xW);if(f){let C=m.fromArray(e,(h+3)%i,kce);m.subtract(b,x,b),m.subtract(C,x,C),g=m.normalize(m.cross(C,b,g),g),f=!1}m.equalsEpsilon(b,x,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(x,d),t.tangent&&(p=m.normalize(m.cross(d,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return Bce(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Uce(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,h=0,x=0,b=yW,C=_je,T=Number.MAX_VALUE,A=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let w=0;w<r;++w)vs.computePosition(t,i,n.st,E,w,b,C),p[h++]=b.x,p[h++]=b.y,p[h++]=b.z,n.st&&(g[x++]=C.x,g[x++]=C.y,T=Math.min(T,C.x),A=Math.min(A,C.y),S=Math.max(S,C.x),v=Math.max(v,C.y));if(s&&(vs.computePosition(t,i,n.st,0,0,b,C),p[h++]=b.x,p[h++]=b.y,p[h++]=b.z,n.st&&(g[x++]=C.x,g[x++]=C.y,T=C.x,A=C.y,S=C.x,v=C.y)),a&&(vs.computePosition(t,i,n.st,o-1,0,b,C),p[h++]=b.x,p[h++]=b.y,p[h]=b.z,n.st&&(g[x++]=C.x,g[x]=C.y,T=Math.min(T,C.x),A=Math.min(A,C.y),S=Math.max(S,C.x),v=Math.max(v,C.y))),n.st&&(T<0||A<0||S>1||v>1))for(let E=0;E<g.length;E+=2)g[E]=(g[E]-T)/(S-T),g[E+1]=(g[E+1]-A)/(v-A);let I=xje(p,n,i,t.tangentRotationMatrix),O=6*(r-1)*(f-1);s&&(O+=3*(r-1)),a&&(O+=3*(r-1));let R=Ue.createTypedArray(d,O),N=0,F=0,_;for(_=0;_<f-1;++_){for(let E=0;E<r-1;++E){let w=N,D=w+r,M=D+1,B=w+1;R[F++]=w,R[F++]=D,R[F++]=B,R[F++]=B,R[F++]=D,R[F++]=M,++N}++N}if(s||a){let E=d-1,w=d-1;s&&a&&(E=d-2);let D,M;if(N=0,s)for(_=0;_<r-1;_++)D=N,M=D+1,R[F++]=E,R[F++]=D,R[F++]=M,++N;if(a)for(N=(f-1)*r,_=0;_<r-1;_++)D=N,M=D+1,R[F++]=D,R[F++]=w,R[F++]=M,++N}return I.indices=R,n.st&&(I.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),I}function cA(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function lA(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var bW=new Me;function Cje(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let ot=Me.clone(o,bW);ot.normal=!0,e._vertexFormat=ot}let d=Uce(e,t);n&&(e._vertexFormat=o);let p=fi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,h=g*2,x=new Float64Array(h);x.set(p);let b=fi.scaleToGeodeticHeight(d.attributes.position.values,r,a);x.set(b,g),d.attributes.position.values=x;let C=o.normal?new Float32Array(h):void 0,T=o.tangent?new Float32Array(h):void 0,A=o.bitangent?new Float32Array(h):void 0,S=o.st?new Float32Array(h/3*2):void 0,v,I;if(o.normal){for(I=d.attributes.normal.values,C.set(I),f=0;f<g;f++)I[f]=-I[f];C.set(I,g),d.attributes.normal.values=C}if(n){I=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let ot=new Float32Array(h);for(f=0;f<g;f++)I[f]=-I[f];ot.set(I,g),d.attributes.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:ot})}let O,R=l(i);if(R){let ot=g/3*2,sn=new Uint8Array(ot);i===an.TOP?sn=sn.fill(1,0,ot/2):(O=i===an.NONE?0:1,sn=sn.fill(O)),d.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:sn})}if(o.tangent){let ot=d.attributes.tangent.values;for(T.set(ot),f=0;f<g;f++)ot[f]=-ot[f];T.set(ot,g),d.attributes.tangent.values=T}if(o.bitangent){let ot=d.attributes.bitangent.values;A.set(ot),A.set(ot,g),d.attributes.bitangent.values=A}o.st&&(v=d.attributes.st.values,S.set(v),S.set(v,g/3*2),d.attributes.st.values=S);let N=d.indices,F=N.length,_=g/3,E=Ue.createTypedArray(h/3,F*2);for(E.set(N),f=0;f<F;f+=3)E[f+F]=N[f+2]+_,E[f+1+F]=N[f+1]+_,E[f+2+F]=N[f]+_;d.indices=E;let w=t.northCap,D=t.southCap,M=c,B=2,V=0,U=4,G=4;w&&(B-=1,M-=1,V+=1,U-=2,G-=1),D&&(B-=1,M-=1,V+=1,U-=2,G-=1),V+=B*u+2*M-U;let k=(V+G)*2,Y=new Float64Array(k*3),j=n?new Float32Array(k*3):void 0,$=R?new Uint8Array(k):void 0,W=o.st?new Float32Array(k*2):void 0,K=i===an.TOP;R&&!K&&(O=i===an.ALL?1:0,$=$.fill(O));let J=0,he=0,ge=0,se=0,pe=u*M,xe;for(f=0;f<pe;f+=u)xe=f*3,Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);if(D){let ot=w?pe+1:pe;for(xe=ot*3,f=0;f<2;f++)Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,ot*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1)}else for(f=pe-u;f<pe;f++)xe=f*3,Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);for(f=pe-1;f>0;f-=u)xe=f*3,Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);if(w){let ot=pe;for(xe=ot*3,f=0;f<2;f++)Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,ot*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1)}else for(f=u-1;f>=0;f--)xe=f*3,Y=cA(Y,J,xe,p,b),J+=6,o.st&&(W=lA(W,he,f*2,v),he+=4),n&&(ge+=3,j[ge++]=I[xe],j[ge++]=I[xe+1],j[ge++]=I[xe+2]),K&&($[se++]=1,se+=1);let De=bje(Y,o,a);o.st&&(De.attributes.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:W})),n&&(De.attributes.extrudeDirection=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:j})),R&&(De.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:$}));let Se=Ue.createTypedArray(k,V*6),we,ze,Oe,ft;g=Y.length/3;let Ct=0;for(f=0;f<g-1;f+=2){we=f,ft=(we+2)%g;let ot=m.fromArray(Y,we*3,xW),sn=m.fromArray(Y,ft*3,kce);m.equalsEpsilon(ot,sn,P.EPSILON10)||(ze=(we+1)%g,Oe=(ze+2)%g,Se[Ct++]=we,Se[Ct++]=ze,Se[Ct++]=ft,Se[Ct++]=ft,Se[Ct++]=ze,Se[Ct++]=Oe)}return De.indices=Se,De=Un.combineInstances([new Tt({geometry:d}),new Tt({geometry:De})]),De[0]}var Tje=[new m,new m,new m,new m],Vce=new me,Aje=new me;function CW(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=vs.computeOptions(e,t,n,0,Fce,Vce),s=r.height,a=r.width,c=Tje;return vs.computePosition(r,i,!1,0,0,c[0]),vs.computePosition(r,i,!1,0,a-1,c[1]),vs.computePosition(r,i,!1,s-1,0,c[2]),vs.computePosition(r,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,o)}function jm(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ce.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Me.clone(y(e.vertexFormat,Me.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}jm.packedLength=ce.packedLength+oe.packedLength+Me.packedLength+7;jm.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var zce=new ce,Hce=oe.clone(oe.UNIT_SPHERE),Vg={rectangle:zce,ellipsoid:Hce,vertexFormat:bW,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};jm.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,zce);t+=ce.packedLength;let o=oe.unpack(e,t,Hce);t+=oe.packedLength;let r=Me.unpack(e,t,bW);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(Vg.granularity=s,Vg.height=a,Vg.rotation=c,Vg.stRotation=u,Vg.extrudedHeight=f,Vg.shadowVolume=d,Vg.offsetAttribute=p===-1?void 0:p,new jm(Vg))};jm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,oe.WGS84),r=y(e.rotation,0);return CW(n,i,r,o,t)};var Eje=new Z,Oce=new Be,Sje=new me;jm.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=vs.computeOptions(t,e._granularity,i,o,Fce,Vce,Aje),a=Eje;if(o!==0||i!==0){let g=ce.center(t,Sje),h=n.geodeticSurfaceNormalCartographic(g,xW);Be.fromAxisAngle(h,-o,Oce),Z.fromQuaternion(Oce,a)}else Z.clone(Z.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=Cje(e,s);let g=ae.fromRectangle3D(t,n,c,yje),h=ae.fromRectangle3D(t,n,u,gje);p=ae.union(g,h)}else{if(d=Uce(e,s),d.attributes.position.values=fi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,h=e._offsetAttribute===an.NONE?0:1,x=new Uint8Array(g/3).fill(h);d.attributes.applyOffset=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new dt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};jm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new jm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};var Rce=new ce,vje=[new H,new H,new H],wje=new no,Ije=new me;function Dje(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,Rce),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=CW(t,n,o,i,Rce),s=vje;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=no.fromRotation(e._stRotation,wje),u=ce.center(a,Ije);for(let h=0;h<3;++h){let x=s[h];x.x-=u.longitude,x.y-=u.latitude,no.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return H.pack(f,g),H.pack(d,g,2),H.pack(p,g,4),g}Object.defineProperties(jm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=CW(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Dje(this)),this._textureCoordinateRotationPoints}}});var uA=jm;var Gce=new z,Wce=m.ZERO,jce=new m,qce=new ce,Pje=new ce,Oje=new me;function Rje(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function gd(e,t){Kn.call(this,{entity:e,scene:t,geometryOptions:new Rje(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(gd.prototype=Object.create(Kn.prototype),gd.prototype.constructor=gd);gd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:zn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Vt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Gce)),l(o)||(o=z.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wce,jce))),new Tt({id:t,geometry:new uA(this._options),attributes:i})};gd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Gce),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wce,jce))),new Tt({id:t,geometry:new yT(this._options),attributes:r})};gd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,Pje);if(!l(n))return;let i=ce.center(n,Oje);return me.toCartesian(i,oe.WGS84,t)};gd.prototype._isHidden=function(e,t){return!l(t.coordinates)||li.prototype._isHidden.call(this,e,t)};gd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Vt)};gd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Vt,i=q.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=q.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),r=q.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=q.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=q.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=q.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=Kn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Kn.getGeometryHeight(i,o),r=Kn.getGeometryExtrudedHeight(r,s),r===Kn.CLAMP_TO_GROUND&&(r=si.getMinimumMaximumHeights(uA.computeRectangle(a,qce)).minimumTerrainHeight),a.extrudedHeight=r};gd.DynamicGeometryUpdater=fA;function fA(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(fA.prototype=Object.create(ci.prototype),fA.prototype.constructor=fA);fA.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ci.prototype._isHidden.call(this,e,t,n)};fA.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,qe.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Kn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Kn.getGeometryHeight(o,r),s=Kn.getGeometryExtrudedHeight(s,a),s===Kn.CLAMP_TO_GROUND&&(s=si.getMinimumMaximumHeights(uA.computeRectangle(i,qce)).minimumTerrainHeight),i.extrudedHeight=s};var MB=gd;var Yce=new z,Mje=new Dt,Lje=new Dt,Nje=m.ZERO,Fje=new m;function yd(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.updaters=new At,this.updatersWithAttributes=new At,this.attributes=new At,this.subscriptions=new At,this.showsUpdated=new At,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(yd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}yd.prototype.onMaterialChanged=function(){this.invalidated=!0};yd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};yd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};yd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};yd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,Yce);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=Ht.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Vt&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,Yce);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=Ht.toValue(C,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,Lje,Mje);Dt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,Nje,Fje);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};yd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};yd.prototype.contains=function(e){return this.updaters.contains(e.id)};yd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};yd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function dA(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}dA.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new yd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Xce(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}dA.prototype.remove=function(e){Xce(this._solidItems,e)||Xce(this._translucentItems,e)};function Kce(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function LB(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}dA.prototype.update=function(e){let t=LB(this,this._solidItems,e,!0);t=LB(this,this._translucentItems,e,t)&&t;let n=Kce(this,this._solidItems,e),i=Kce(this,this._translucentItems,e);return(n||i)&&(t=LB(this,this._solidItems,e,t)&&t,t=LB(this,this._translucentItems,e,t)&&t),t};function Jce(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ut.FAILED}dA.prototype.getBoundingSphere=function(e,t){let n=Jce(this._solidItems,e,t);return n===ut.FAILED?Jce(this._translucentItems,e,t):n};function Zce(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}dA.prototype.removeAllPrimitives=function(){Zce(this._solidItems),Zce(this._translucentItems)};var xd=dA;var Bje=new Dt,kje=new Dt,Uje=m.ZERO,Vje=new m;function bd(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new At,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new At,this.attributes=new At,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(bd.prototype.onMaterialChanged,this),this.subscriptions=new At,this.showsUpdated=new At}bd.prototype.onMaterialChanged=function(){this.invalidated=!0};bd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};bd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};bd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var zje=new z;bd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Dn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Vt)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Vt&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,C=q.getValueOrDefault(b,e,z.WHITE,zje);z.equals(d._lastDepthFailColor,C)||(d._lastDepthFailColor=z.clone(C,d._lastDepthFailColor),d.depthFailColor=Ht.toValue(C,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,kje,Bje);Dt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(b,d.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,Uje,Vje);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};bd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};bd.prototype.contains=function(e){return this.updaters.contains(e.id)};bd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};bd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function mA(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}mA.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new bd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};mA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};mA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};mA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};mA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Cd=mA;var Qce=ur($ce(),1);function NB(){this._tree=new Qce.default}function hx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}hx.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};NB.prototype.insert=function(e,t){let n=hx.fromRectangleAndId(e,t,new hx);this._tree.insert(n)};function Hje(e,t){return e.id===t.id}var Gje=new hx;NB.prototype.remove=function(e,t){let n=hx.fromRectangleAndId(e,t,Gje);this._tree.remove(n,Hje)};var Wje=new hx;NB.prototype.collides=function(e){let t=hx.fromRectangleAndId("",e,Wje);return this._tree.collides(t)};var hA=NB;var jje=new z,qje=new Dt,Yje=new Dt;function Lp(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.updaters=new At,this.updatersWithAttributes=new At,this.attributes=new At,this.subscriptions=new At,this.showsUpdated=new At,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new hA}Lp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Lp.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Lp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Lp.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Xc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,jje);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Ht.toValue(b,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,Yje,qje);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Lp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Lp.prototype.contains=function(e){return this.updaters.contains(e.id)};Lp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ut.DONE):ut.FAILED};Lp.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function pA(e,t){this._batches=[],this._primitives=e,this._classificationType=t}pA.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=q.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new Lp(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};pA.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};pA.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};pA.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};pA.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var Lw=pA;var Xje=new Dt,Kje=new Dt;function cf(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new At,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.material=void 0,this.updatersWithAttributes=new At,this.attributes=new At,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(cf.prototype.onMaterialChanged,this),this.subscriptions=new At,this.showsUpdated=new At,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new hA}cf.prototype.onMaterialChanged=function(){this.invalidated=!0};cf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};cf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};cf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};cf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};cf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material),n=new Xc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,Kje,Xje);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};cf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};cf.prototype.contains=function(e){return this.updaters.contains(e.id)};cf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};cf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function _A(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}_A.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Mu.shouldUseSphericalCoordinates(o.geometry.rectangle),s=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new cf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};_A.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};_A.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};_A.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};_A.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var FB=_A;var Jje=new z,Zje=new Dt,$je=new Dt,Qje=m.ZERO,eqe=new m;function Np(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.updaters=new At,this.updatersWithAttributes=new At,this.attributes=new At,this.itemsToRemove=[],this.subscriptions=new At,this.showsUpdated=new At}Np.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Np.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Np.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new cn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,C=q.getValueOrDefault(b,e,z.WHITE,Jje);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=Ht.toValue(C,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=u.distanceDisplayConditionProperty;if(!q.isConstant(h)){let b=q.getValueOrDefault(h,e,$je,Zje);Dt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,Qje,eqe);m.equals(b,d._lastOffset)||(d._lastOffset=m.clone(b,d._lastOffset),d.offset=Zi.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Np.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Np.prototype.contains=function(e){return this.updaters.contains(e.id)};Np.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Np.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function gA(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new At,this._translucentBatches=new At}gA.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new Np(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new Np(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};gA.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};gA.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};gA.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ut.FAILED};gA.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var Nw=gA;var ele={};function tqe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var nqe=new me,iqe=new me;function oqe(e,t,n,i){t=Ao(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,nqe);s&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],h=p===g,x=1;for(let b=1;b<o;++b){let C=t[b],T=e.cartesianToCartographic(C,iqe);s&&(T.height=n[b]),h=h&&T.height===0,tqe(d,T)?d.height<T.height&&(c[x-1]=T.height):(a[x]=C,c[x]=T.height,r?u[x]=i[b]:u[x]=0,h=h&&c[x]===u[x],me.clone(T,d),++x)}if(!(h||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var rqe=new Array(2),sqe=new Array(2),aqe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ele.computePositions=function(e,t,n,i,o,r){let s=oqe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(o,e.maximumRadius),p=aqe;if(p.minDistance=d,p.ellipsoid=e,r){let g=0,h;for(h=0;h<a-1;h++)g+=Mi.numberOfPoints(t[h],t[h+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let x=rqe,b=sqe;p.positions=x,p.height=b;let C=0;for(h=0;h<a-1;h++){x[0]=t[h],x[1]=t[h+1],b[0]=n[h],b[1]=n[h+1];let T=Mi.generateArc(p);u.set(T,C),b[0]=i[h],b[1]=i[h+1],f.set(Mi.generateArc(p),C),C+=T.length}}else p.positions=t,p.height=n,u=new Float64Array(Mi.generateArc(p)),p.height=i,f=new Float64Array(Mi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var yA=ele;var EW=new m,BB=new m,cqe=new m,tle=new m,lqe=new m,uqe=new m,fqe=new m;function px(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Me.DEFAULT),r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Me.clone(o),this._granularity=r,this._ellipsoid=oe.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+oe.packedLength+Me.packedLength+1}px.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._granularity,t};var nle=oe.clone(oe.UNIT_SPHERE),ile=new Me,Fw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:nle,vertexFormat:ile,granularity:void 0};px.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=oe.unpack(e,t,nle);t+=oe.packedLength;let u=Me.unpack(e,t,ile);t+=Me.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._vertexFormat=Me.clone(u,n._vertexFormat),n._granularity=f,n):(Fw.positions=r,Fw.minimumHeights=s,Fw.maximumHeights=a,Fw.granularity=f,new px(Fw))};px.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new px(c)};px.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=yA.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=o.position?new Float64Array(p):void 0,h=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,T=0,A=0,S=0,v=0,I=0,O=fqe,R=uqe,N=lqe,F=!0;d/=3;let _,E=0,w=1/(d-f-1);for(_=0;_<d;++_){let U=_*3,G=m.fromArray(u,U,EW),k=m.fromArray(c,U,BB);if(o.position&&(g[T++]=k.x,g[T++]=k.y,g[T++]=k.z,g[T++]=G.x,g[T++]=G.y,g[T++]=G.z),o.st&&(C[I++]=E,C[I++]=0,C[I++]=E,C[I++]=1),o.normal||o.tangent||o.bitangent){let Y=m.clone(m.ZERO,tle),j=m.subtract(G,s.geodeticSurfaceNormal(G,BB),BB);if(_+1<d&&(Y=m.fromArray(u,U+3,tle)),F){let $=m.subtract(Y,G,cqe),W=m.subtract(j,G,EW);O=m.normalize(m.cross(W,$,O),O),F=!1}m.equalsEpsilon(G,Y,P.EPSILON10)?F=!0:(E+=w,o.tangent&&(R=m.normalize(m.subtract(Y,G,R),R)),o.bitangent&&(N=m.normalize(m.cross(O,R,N),N))),o.normal&&(h[A++]=O.x,h[A++]=O.y,h[A++]=O.z,h[A++]=O.x,h[A++]=O.y,h[A++]=O.z),o.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),o.bitangent&&(b[S++]=N.x,b[S++]=N.y,b[S++]=N.z,b[S++]=N.x,b[S++]=N.y,b[S++]=N.z)}}let D=new gn;o.position&&(D.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(D.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(D.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(D.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(D.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}));let M=p/3;p-=6*(f+1);let B=Ue.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let U=_,G=_+2,k=m.fromArray(g,U*3,EW),Y=m.fromArray(g,G*3,BB);if(m.equalsEpsilon(k,Y,P.EPSILON10))continue;let j=_+1,$=_+3;B[V++]=j,B[V++]=U,B[V++]=$,B[V++]=$,B[V++]=U,B[V++]=G}return new dt({attributes:D,indices:B,primitiveType:Fe.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var kB=px;var ole=new m,rle=new m;function _x(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=oe.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+oe.packedLength+1}_x.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n]=e._granularity,t};var sle=oe.clone(oe.UNIT_SPHERE),Bw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:sle,granularity:void 0};_x.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=oe.unpack(e,t,sle);t+=oe.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._granularity=u,n):(Bw.positions=r,Bw.minimumHeights=s,Bw.maximumHeights=a,Bw.granularity=u,new _x(Bw))};_x.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new _x(c)};_x.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=yA.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let T=g*3,A=m.fromArray(c,T,ole),S=m.fromArray(a,T,rle);d[p++]=S.x,d[p++]=S.y,d[p++]=S.z,d[p++]=A.x,d[p++]=A.y,d[p++]=A.z}let h=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),x=f/3;f=2*x-4+x;let b=Ue.createTypedArray(x,f),C=0;for(g=0;g<x-2;g+=2){let T=g,A=g+2,S=m.fromArray(d,T*3,ole),v=m.fromArray(d,A*3,rle);if(m.equalsEpsilon(S,v,P.EPSILON10))continue;let I=g+1,O=g+3;b[C++]=I,b[C++]=T,b[C++]=I,b[C++]=O,b[C++]=T,b[C++]=A}return b[C++]=x-2,b[C++]=x-1,new dt({attributes:h,indices:b,primitiveType:Fe.LINES,boundingSphere:new ae.fromVertices(d)})};var UB=_x;var ale=new z;function dqe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Td(e,t){li.call(this,{entity:e,scene:t,geometryOptions:new dqe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Td.prototype=Object.create(li.prototype),Td.prototype.constructor=Td);Td.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=zn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Vt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ale)),l(c)||(c=z.WHITE),o=Ht.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Tt({id:t,geometry:new kB(this._options),attributes:i})};Td.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ale),o=this._distanceDisplayConditionProperty.getValue(e);return new Tt({id:t,geometry:new UB(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:zn.fromDistanceDisplayCondition(o)}})};Td.prototype._isHidden=function(e,t){return!l(t.positions)||li.prototype._isHidden.call(this,e,t)};Td.prototype._getIsClosed=function(e){return!1};Td.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};Td.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Vt,s=this._options;s.vertexFormat=r?cn.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};Td.DynamicGeometryUpdater=xA;function xA(e,t,n){ci.call(this,e,t,n)}l(Object.create)&&(xA.prototype=Object.create(ci.prototype),xA.prototype.constructor=xA);xA.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ci.prototype._isHidden.call(this,e,t,n)};xA.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var VB=Td;var mqe=[],cle=[FM,K2,z2,gB,yB,EB,DB,RB,MB,VB];function kw(e,t){this.entity=e,this.scene=t;let n=new Array(cle.length),i=new _e;function o(s){i.raiseEvent(s)}let r=new Mr;for(let s=0;s<n.length;s++){let a=new cle[s](e,t);r.add(a.geometryChanged,o),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(kw.prototype._onEntityPropertyChanged,this)}kw.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};kw.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};kw.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function lf(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new At,this._removedObjects=new At,this._changedObjects=new At;let o=Cn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=nr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new Nw(n,e,s,!1),this._outlineBatches[o+s]=new Nw(n,e,s,!0),this._closedColorBatches[s]=new xd(n,cn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new xd(n,cn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Cd(n,co,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Cd(n,co,void 0,!0,s,!1),this._openColorBatches[s]=new xd(n,cn,void 0,!1,s,!0),this._openColorBatches[o+s]=new xd(n,cn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Cd(n,co,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Cd(n,co,void 0,!1,s,!1);let a=Hn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new FB(i,s,co)),c[s]=new Lw(i,s);else for(s=0;s<a;++s)c[s]=new Lw(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new KT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new At,this._updaterSets=new At,this._entityCollection=t,t.collectionChanged.addEventListener(lf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,mqe)}lf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new kw(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(lf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,h=g.length;for(a=0;a<h;a++)p=g[a].update(e)&&p;return p};var hqe=[],pqe=new ae;lf.prototype.getBoundingSphere=function(e,t){let n=hqe,i=pqe,o=0,r=ut.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return ut.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(d,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ae.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ut.DONE)};lf.prototype.isDestroyed=function(){return!1};lf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};lf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};lf.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Cn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Vt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Vt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};lf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};lf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var zB=lf;var _qe=1,gqe="30px sans-serif",yqe=jo.FILL,xqe=z.WHITE,bqe=z.BLACK,Cqe=1,Tqe=!1,Aqe=new z(.165,.165,.165,.8),Eqe=new H(7,5),Sqe=H.ZERO,vqe=m.ZERO,wqe=qe.NONE,Iqe=_i.CENTER,Dqe=Ln.CENTER,Pqe=new m,Oqe=new z,Rqe=new z,Mqe=new z,Lqe=new H,Nqe=new m,Fqe=new H,Bqe=new Rt,kqe=new Rt,Uqe=new Rt,Vqe=new Dt;function lle(e){this.entity=e,this.label=void 0,this.index=void 0}function zg(e,t){t.collectionChanged.addEventListener(zg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}zg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=q.getValueOrUndefined(s._position,e,Pqe),c=q.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){SW(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=q.getValueOrDefault(a._heightReference,e,wqe);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=m.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=q.getValueOrDefault(a._scale,e,_qe),u.font=q.getValueOrDefault(a._font,e,gqe),u.style=q.getValueOrDefault(a._style,e,yqe),u.fillColor=q.getValueOrDefault(a._fillColor,e,xqe,Oqe),u.outlineColor=q.getValueOrDefault(a._outlineColor,e,bqe,Rqe),u.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,Cqe),u.showBackground=q.getValueOrDefault(a._showBackground,e,Tqe),u.backgroundColor=q.getValueOrDefault(a._backgroundColor,e,Aqe,Mqe),u.backgroundPadding=q.getValueOrDefault(a._backgroundPadding,e,Eqe,Lqe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,Sqe,Fqe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,vqe,Nqe),u.heightReference=g,u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,Iqe),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,Dqe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Bqe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,kqe),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Uqe),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Vqe),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};zg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ut.DONE};zg.prototype.isDestroyed=function(){return!1};zg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};zg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new lle(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new lle(r)):(SW(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],SW(s.get(r.id),r,a),s.remove(r.id)};function SW(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var HB=zg;async function zqe(e,t,n){return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,Wqe(e,t,n)}function Hqe(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let o=i.then(jqe(n)).catch(qqe(n));return e.shift(),t.push(o),!0}function Gqe(e){return new Promise(function(t){setTimeout(t,e)})}function vW(e,t){return e.length?Hqe(e,t)?vW(e,t):Gqe(100).then(()=>vW(e,t)):Promise.resolve()}function Wqe(e,t,n){let i=e.tilingScheme,o,r=[],s={};for(o=0;o<n.length;++o){let c=i.positionToTileXY(n[o],t);if(!l(c))continue;let u=c.toString();if(!s.hasOwnProperty(u)){let f={x:c.x,y:c.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};s[u]=f,r.push(f)}s[u].positions.push(n[o])}let a=[];return vW(r,a).then(function(){return Promise.all(a).then(function(){return n})})}function ule(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function jqe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!ule(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];ule(s,i,n)}}):Promise.resolve()}}function qqe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var GB=zqe;var wW=new H;async function fle(e,t){let n=[],i=[];l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise;let o=e.availability,r=[];for(let a=0;a<t.length;++a){let c=t[a],u=o.computeMaximumLevelAtPosition(c);if(i[a]=u,u===0){e.tilingScheme.positionToTileXY(c,1,wW);let d=e.loadTileDataAvailability(wW.x,wW.y,1);l(d)&&r.push(d)}let f=n[u];l(f)||(n[u]=f=[]),f.push(c)}await Promise.all(r),await Promise.all(n.map(function(a,c){if(l(a))return GB(e,c,a)}));let s=[];for(let a=0;a<t.length;++a){let c=t[a];o.computeMaximumLevelAtPosition(c)!==i[a]&&s.push(c)}return s.length>0&&await fle(e,s),t}var Hg=fle;var Yqe=1,Xqe=0,Kqe=!0,Jqe=!0,Zqe=Cn.ENABLED,$qe=qe.NONE,Qqe=z.RED,eYe=0,tYe=z.WHITE,nYe=xc.HIGHLIGHT,iYe=.5,oYe=new H(1,1),rYe=new L,sYe=new L,dle=new z,mle=new Array(4),aYe=new m;function qm(e,t){t.collectionChanged.addEventListener(qm.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new At,this._onCollectionChanged(t,t.values,[],[])}async function cYe(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await Im.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}qm.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,rYe),c=ve.createIfNeeded(q.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,awaitingSampleTerrain:!1,clampedBoundingSphere:void 0,sampleTerrainFailed:!1},n[s.id]=u;let h=q.getValueOrDefault(a._incrementallyLoadTextures,e,Kqe);cYe(this,s,c,h)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(a._scale,e,Yqe),p.minimumPixelSize=q.getValueOrDefault(a._minimumPixelSize,e,Xqe),p.maximumScale=q.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=L.clone(d,p.modelMatrix),p.shadows=q.getValueOrDefault(a._shadows,e,Zqe),p.heightReference=q.getValueOrDefault(a._heightReference,e,$qe),p.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(a._silhouetteColor,e,Qqe,dle),p.silhouetteSize=q.getValueOrDefault(a._silhouetteSize,e,eYe),p.color=q.getValueOrDefault(a._color,e,tYe,dle),p.colorBlendMode=q.getValueOrDefault(a._colorBlendMode,e,nYe),p.colorBlendAmount=q.getValueOrDefault(a._colorBlendAmount,e,iYe),p.clippingPlanes=q.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(a._clampAnimations,e,Jqe),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(a._imageBasedLightingFactor,e,oYe);let g=q.getValueOrUndefined(a._lightColor,e);if(l(g)&&(z.pack(g,mle,0),g=m.unpack(mle,0,aYe)),p.lightColor=g,p.customShader=q.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let h=q.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:Wl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=h);let x=q.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let T=Object.keys(x);for(let A=0,S=T.length;A<S;++A){let v=T[A],I=x[v];if(!l(I))continue;let O=p.getNode(v);if(!l(O))continue;let R=L.fromTranslationRotationScale(I,sYe);O.matrix=L.multiply(O.originalMatrix,R,R)}}let b=!1,C=q.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(C)){let T=Object.keys(C);for(let A=0,S=T.length;A<S;++A){let v=T[A],I=C[v];l(I)&&(b=!0,p.setArticulationStage(v,I))}}b&&p.applyArticulations()}}return!0};qm.prototype.isDestroyed=function(){return!1};qm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qm.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)IW(this,e[i],t,n);return ue(this)};qm._sampleTerrainMostDetailed=Hg;var bA=new m,hle=new me;qm.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let r=this._scene.globe,s=l(r)?r.terrainProvider:void 0,a=i.heightReference!==qe.NONE;if(l(r)&&a){let c=r.ellipsoid;if(l(s)&&(l(s._ready)?!s._ready:l(s.ready)&&!s.ready))return ut.PENDING;let u=i.modelMatrix;bA.x=u[12],bA.y=u[13],bA.z=u[14];let f=c.cartesianToCartographic(bA);if(!l(s.availability)){i.heightReference===qe.CLAMP_TO_GROUND&&(f.height=0);let g=c.cartographicToCartesian(f);return ae.clone(i.boundingSphere,t),t.center=g,ut.DONE}let d=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,ut.FAILED):l(d)?(ae.clone(d,t),this._modelHash[e.id].clampedBoundingSphere=void 0,ut.DONE):(d=new ae,this._modelHash[e.id].awaitingSampleTerrain||(me.clone(f,hle),this._modelHash[e.id].awaitingSampleTerrain=!0,qm._sampleTerrainMostDetailed(s,[hle]).then(h=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let x=h[0];i.heightReference===qe.RELATIVE_TO_GROUND&&(x.height+=f.height),c.cartographicToCartesian(x,bA),ae.clone(i.boundingSphere,d),d.center=bA,this._modelHash[e.id].clampedBoundingSphere=ae.clone(d)}).catch(h=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),ut.PENDING)}return ae.clone(i.boundingSphere,t),ut.DONE};qm.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(lYe(r,a),s.set(r.id,r)):(IW(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],IW(this,r,a,c),s.remove(r.id)};function IW(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function lYe(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var WB=qm;function Gg(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Gg.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:oo.FIXED}}});Gg.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,oo.FIXED,t)};Gg.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Gg.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?oe.WGS84.scaleToGeodeticSurface(n,n):void 0};Gg.prototype.equals=function(e){return this===e||e instanceof Gg&&this._value===e._value};Gg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Fp=Gg;var uYe=60,fYe=1,gle=new Sn,DW=new Sn,PW=new Sn;function ple(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function dYe(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||ee.lessThanOrEquals(o,t)||ee.greaterThanOrEquals(o,n),p=0,g=i.length,h=i[p],x=n,b=!1,C,T,A;for(;p<g;){if(!d&&ee.greaterThanOrEquals(h,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),d=!0),ee.greaterThan(h,t)&&ee.lessThan(h,x)&&!h.equals(o)&&(f=e.getValueInReferenceFrame(h,r,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!b){let S=i[p+1],v=ee.secondsDifference(S,h);b=v>s,b&&(C=Math.ceil(v/s),T=0,A=v/Math.max(C,2),C=Math.max(C-1,1))}if(b&&T<C){h=ee.addSeconds(h,A,new ee),T++;continue}}b=!1,p++,h=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function mYe(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=Math.max(r,60),g=!l(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(d,n);)!g&&ee.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=ee.addSeconds(t,p*u,new ee);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function hYe(e,t,n,i,o,r,s,a){PW.start=t,PW.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Sn.intersect(d,PW,gle).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=ee.addSeconds(d.start,ee.secondsDifference(d.stop,d.start)/2,new ee));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function pYe(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function _Ye(e,t,n,i,o,r,s,a){DW.start=t,DW.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Sn.intersect(d,DW,gle).isEmpty){let p=d.start,g=d.stop,h=t;ee.greaterThan(p,h)&&(h=p);let x=n;ee.lessThan(g,x)&&(x=g),c=yle(d.data,h,x,i,o,r,c,a)}}return c}function yle(e,t,n,i,o,r,s,a){for(;e instanceof Rg;)e=e.resolvedProperty;if(e instanceof xa){let c=e._property._times;s=dYe(e,t,n,c,i,o,r,s,a)}else e instanceof ya?s=_Ye(e,t,n,i,o,r,s,a):e instanceof Lg?s=hYe(e,t,n,i,o,r,s,a):e instanceof Kc||e instanceof Fp&&q.isConstant(e)?s=pYe(e,t,n,i,o,r,s,a):s=mYe(e,t,n,i,o,r,s,a);return s}function xle(e,t,n,i,o,r,s){l(s)||(s=[]);let a=yle(e,t,n,i,o,r,0,s);return s.length=a,s}var _le=new Z;function Uw(e,t){this._unusedIndexes=[],this._polylineCollection=new Rm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}Uw.prototype.update=function(e){if(this._referenceFrame===oo.INERTIAL){let t=Mt.computeIcrfToFixedMatrix(e,_le);l(t)||(t=Mt.computeTemeToPseudoFixedMatrix(e,_le)),L.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};Uw.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=q.getValueOrUndefined(i._leadTime,e),p=q.getValueOrUndefined(i._trailTime,e),g=n._availability,h=l(g),x=l(d),b=l(p);if(u=h||x&&b,u){if(b&&(r=ee.addSeconds(e,-p,new ee)),x&&(s=ee.addSeconds(e,d,new ee)),h){let C=g.start,T=g.stop;(!b||ee.greaterThan(C,r))&&(r=C),(!x||ee.lessThan(T,s))&&(s=T)}u=ee.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,uYe);c.show=!0,c.positions=xle(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=tr.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,fYe),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Uw.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};Uw.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Wg(e,t){t.collectionChanged.addEventListener(Wg.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}Wg.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=oo.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new Uw(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};Wg.prototype.isDestroyed=function(){return!1};Wg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Wg.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Wg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new ple(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new ple(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Wg._subSample=xle;var jB=Wg;var ble=z.WHITE,Cle=z.BLACK,Tle=0,Ale=1,Ele=0,Sle=new z,gYe=new m,vle=new z,wle=new Rt,Ile=new Rt,Dle=new Dt;function Ple(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function jg(e,t){t.collectionChanged.addEventListener(jg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new At,this._onCollectionChanged(t,t.values,[],[])}jg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=q.getValueOrDefault(a._heightReference,e,qe.NONE),d=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),p;if(d&&(p=q.getValueOrUndefined(s._position,e,gYe),d=l(p)),!d){Vw(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,h=!1;if(f!==qe.NONE&&!l(u)?(l(c)&&(Vw(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,h=m.equals(u.position,p)&&u.heightReference===f):f===qe.NONE&&!l(c)&&(l(u)&&(Vw(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,wle),c.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Ile),c.color=q.getValueOrDefault(a._color,e,ble,Sle),c.outlineColor=q.getValueOrDefault(a._outlineColor,e,Cle,vle),c.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,Tle),c.pixelSize=q.getValueOrDefault(a._pixelSize,e,Ale),c.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Dle),c.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Ele);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,wle),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Ile),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Dle),u.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Ele),u.heightReference=f;let x=q.getValueOrDefault(a._color,e,ble,Sle),b=q.getValueOrDefault(a._outlineColor,e,Cle,vle),C=Math.round(q.getValueOrDefault(a._outlineWidth,e,Tle)),T=Math.max(1,Math.round(q.getValueOrDefault(a._pixelSize,e,Ale)));if(C>0?(u.scale=1,g=g||C!==r.outlineWidth||T!==r.pixelSize||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)):(u.scale=T/50,T=50,g=g||C!==r.outlineWidth||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)),g){r.color=z.clone(x,r.color),r.outlineColor=z.clone(b,r.outlineColor),r.pixelSize=T,r.outlineWidth=C;let A=x.alpha,S=x.toCssColorString(),v=b.toCssColorString(),I=JSON.stringify([S,T,v,C]);u.setImage(I,rT(A,S,v,C,T))}h&&u._updateClamping()}}return!0};jg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ut.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};jg.prototype.isDestroyed=function(){return!1};jg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};jg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Ple(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Ple(r)):(Vw(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Vw(s.get(r.id),r,a),s.remove(r.id)};function Vw(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var qB=jg;var Nle=[];function yYe(e,t,n,i,o){let r=Nle;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,h=i.alpha;if(z.equals(n,i)){for(s=0;s<o;s++)r[s]=z.clone(n);return r}let x=(d-a)/o,b=(p-c)/o,C=(g-u)/o,T=(h-f)/o;for(s=0;s<o;s++)r[s]=new z(a+s*x,c+s*b,u+s*C,f+s*T);return r}function zw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Me.clone(y(e.vertexFormat,Me.DEFAULT)),this._arcType=y(e.arcType,Qt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+oe.packedLength+Me.packedLength+4}zw.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Fle=oe.clone(oe.UNIT_SPHERE),Ble=new Me,gx={positions:void 0,colors:void 0,ellipsoid:Fle,vertexFormat:Ble,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};zw.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=oe.unpack(e,t,Fle);t+=oe.packedLength;let c=Me.unpack(e,t,Ble);t+=Me.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Me.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(gx.positions=r,gx.colors=s,gx.width=u,gx.colorsPerVertex=f,gx.arcType=d,gx.granularity=p,new zw(gx))};var Ole=new m,Rle=new m,Mle=new m,Lle=new m;zw.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Ao(e._positions,m.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,B=d[0];i=i.filter(function(V,U){let G=!1;return o?G=U===B||U===0&&B===1:G=U+1===B,G?(M++,B=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===Qt.GEODESIC||r===Qt.RHUMB){let M,B;r===Qt.GEODESIC?(M=P.chordLength(s,a.maximumRadius),B=Mi.numberOfPoints):(M=s,B=Mi.numberOfPointsRhumbLine);let V=Mi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=B(p[c],p[c+1],M);let G=new Array(U),k=0;for(c=0;c<g-1;++c){let Y=p[c],j=p[c+1],$=i[c],W=B(Y,j,M);if(o&&c<U){let K=i[c+1],J=yYe(Y,j,$,K,W),he=J.length;for(u=0;u<he;++u)G[k++]=J[u]}else for(u=0;u<W;++u)G[k++]=z.clone($)}G[k]=z.clone(i[i.length-1]),i=G,Nle.length=0}r===Qt.GEODESIC?p=Mi.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=Mi.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:V})}g=p.length;let h=g*4-4,x=new Float64Array(h*3),b=new Float64Array(h*3),C=new Float64Array(h*3),T=new Float32Array(h*2),A=n.st?new Float32Array(h*2):void 0,S=l(i)?new Uint8Array(h*4):void 0,v=0,I=0,O=0,R=0,N;for(u=0;u<g;++u){u===0?(N=Ole,m.subtract(p[0],p[1],N),m.add(p[0],N,N)):N=p[u-1],m.clone(N,Mle),m.clone(p[u],Rle),u===g-1?(N=Ole,m.subtract(p[g-1],p[g-2],N),m.add(p[g-1],N,N)):N=p[u+1],m.clone(N,Lle);let M,B;l(S)&&(u!==0&&!o?M=i[u-1]:M=i[u],u!==g-1&&(B=i[u]));let V=u===0?2:0,U=u===g-1?2:4;for(f=V;f<U;++f){m.pack(Rle,x,v),m.pack(Mle,b,v),m.pack(Lle,C,v),v+=3;let G=f-2<0?-1:1;if(T[I++]=2*(f%2)-1,T[I++]=G*t,n.st&&(A[O++]=u/(g-1),A[O++]=Math.max(T[I-2],0)),l(S)){let k=f<2?M:B;S[R++]=z.floatToByte(k.red),S[R++]=z.floatToByte(k.green),S[R++]=z.floatToByte(k.blue),S[R++]=z.floatToByte(k.alpha)}}}let F=new gn;F.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),F.prevPosition=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),F.nextPosition=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),F.expandAndWidth=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(F.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A})),l(S)&&(F.color=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Ue.createTypedArray(h,g*6-6),E=0,w=0,D=g-1;for(u=0;u<D;++u)_[w++]=E,_[w++]=E+2,_[w++]=E+1,_[w++]=E+1,_[w++]=E+2,_[w++]=E+3,E+=4;return new dt({attributes:F,indices:_,primitiveType:Fe.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:Nf.POLYLINES})};var qg=zw;var xYe=new ei(0),YB={},kle=new z,bYe=new Vt(z.WHITE),CYe=new ei(!0),TYe=new ei(Cn.DISABLED),AYe=new ei(new Dt),EYe=new ei(Hn.BOTH);function SYe(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function vYe(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ad(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Ad.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new SYe,this._groundGeometryOptions=new vYe,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=nr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Ad.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Ad.prototype.isOutlineVisible=function(e){return!1};Ad.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};Ad.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=zn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Vt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,kle)),l(a)||(a=z.WHITE),s.color=Ht.fromColor(a)),this.clampToGround?new Tt({id:t,geometry:new rC(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Vt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,kle)),l(a)||(a=z.WHITE),s.depthFailColor=Ht.fromColor(a)),new Tt({id:t,geometry:new qg(this._geometryOptions),attributes:s}))};Ad.prototype.createOutlineGeometryInstance=function(e){};Ad.prototype.isDestroyed=function(){return!1};Ad.prototype.destroy=function(){this._entitySubscription(),ue(this)};Ad.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Ge.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,bYe),u=c instanceof Vt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,CYe),this._shadowsProperty=y(o.shadows,TYe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,AYe),this._classificationTypeProperty=y(o.classificationType,EYe),this._fillEnabled=!0,this._zIndex=y(a,xYe);let f=o.width,d=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!q.isConstant(f)||!q.isConstant(d)||!q.isConstant(g)||!q.isConstant(p)||!q.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,x=r.getValue(Ge.MINIMUM_VALUE,h.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Vt)?b=jr.VERTEX_FORMAT:b=da.VERTEX_FORMAT,h.vertexFormat=b,h.positions=x,h.width=l(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,h.arcType=l(d)?d.getValue(Ge.MINIMUM_VALUE):void 0,h.granularity=l(g)?g.getValue(Ge.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=h.width,C.arcType=h.arcType,C.granularity=h.granularity,this._clampToGround=l(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Nt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Ad.prototype.createDynamicUpdater=function(e,t){return new Hw(e,t,this)};var CA={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Hw(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Ule(e){if(l(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=YB[t],i=e._primitives;!l(n)||n.isDestroyed()?(n=new Rm,YB[t]=n,i.add(n)):i.contains(n)||i.add(n);let o=n.add();return o.id=e._geometryUpdater._entity,e._line=o,o}Hw.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=q.getValueOrUndefined(o,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,Qt.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let f=t.fillMaterialProperty,d;if(f instanceof Vt)d=new jr;else{let p=tr.getValue(e,f,this._material);d=new da({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new cm({geometryInstances:t.createFillGeometryInstance(e),appearance:d,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Ule(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=Qt.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe;c!==Qt.NONE&&l(u)&&(CA.ellipsoid=u.ellipsoid,CA.positions=r,CA.granularity=q.getValueOrUndefined(i._granularity,e),CA.height=Mi.extractHeights(r,u.ellipsoid),c===Qt.GEODESIC?r=Mi.generateCartesianArc(CA):r=Mi.generateCartesianRhumbArc(CA)),a.show=!0,a.positions=r.slice(),a.material=tr.getValue(e,t.fillMaterialProperty,a.material),a.width=q.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};Hw.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=Ule(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};Hw.prototype.isDestroyed=function(){return!1};Hw.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=YB[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete YB[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var XB=Ad;var wYe=new z,IYe=new Dt,DYe=new Dt;function Ed(e,t,n,i,o){let r;n instanceof Vt?r=jr:r=da,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new At,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new At,this.material=void 0,this.updatersWithAttributes=new At,this.attributes=new At,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ed.prototype.onMaterialChanged,this),this.subscriptions=new At,this.showsUpdated=new At,this.zIndex=i,this._asynchronous=o}Ed.prototype.onMaterialChanged=function(){this.invalidated=!0};Ed.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Vt&&t instanceof Vt?!0:l(t)&&t.equals(n)};Ed.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ed.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Ed.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new cm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===da&&(this.material=tr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===da&&(this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,wYe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Ht.toValue(b,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=bn.toValue(p,d.show));let h=c.distanceDisplayConditionProperty;if(!q.isConstant(h)){let x=q.getValueOrDefault(h,e,DYe,IYe);Dt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Dt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=zn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ed.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ed.prototype.contains=function(e){return this.updaters.contains(e.id)};Ed.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Ed.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function TA(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}TA.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=q.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Ed(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};TA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};TA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};TA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};TA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var KB=TA;var PYe=[];function Vle(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function zle(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Vt?1:2);let r;l(i)&&(r=i+o*Cn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Vt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Ym(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new At,this._removedObjects=new At,this._changedObjects=new At;let o,r=Cn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new xd(n,jr,void 0,!1,o),this._materialBatches[o]=new Cd(n,da,void 0,!1,o),this._colorBatches[o+r]=new xd(n,jr,jr,!1,o),this._materialBatches[o+r]=new Cd(n,da,jr,!1,o),this._colorBatches[o+r*2]=new xd(n,jr,da,!1,o),this._materialBatches[o+r*2]=new Cd(n,da,da,!1,o);this._dynamicBatch=new KT(n,i);let s=Hn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new KB(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new At,this._updaters=new At,this._entityCollection=t,t.collectionChanged.addEventListener(Ym.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,PYe)}Ym.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Vle(this,f),zle(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),Vle(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new XB(c,this._scene),this._updaters.set(u,f),zle(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Ym._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var OYe=[],RYe=new ae;Ym.prototype.getBoundingSphere=function(e,t){let n=OYe,i=RYe,o=0,r=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return ut.FAILED;for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ae.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ut.DONE)};Ym.prototype.isDestroyed=function(){return!1};Ym.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ym.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};Ym._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Ym.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var JB=Ym;function uf(e){Xc.initializeTerrainHeights(),cm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Mr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,uf.defaultVisualizersCallback);let i=!1,o=new Jl,r=new Jl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new q2;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}uf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new dD(t,i),new zB(e,i,n._primitives,n._groundPrimitives),new HB(t,i),new WB(e,i),new O2(e,i),new qB(t,i),new jB(e,i),new JB(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(uf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};uf.prototype.update=function(e){if(!si.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return this._ready=t,t};uf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var MYe=[],LYe=new ae;uf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ut.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return ut.FAILED;let s=MYe,a=LYe,c=0,u=ut.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ut.PENDING)return ut.PENDING;u===ut.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),ut.DONE)};uf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Jl),s=o.add(new uB);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};uf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};uf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var ZB=uf;function OW(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}OW.clone=function(e,t){if(l(e))return l(t)||(t=new OW),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var ff=OW;var Hle=new Z,Gle=new Z,Wle=new Z,NYe=new L,$B=new m,jle=new m,RW=new m,MW=new m,qle=new m,Yle=new m,AA=new ee,FYe=1.25;function BYe(e,t,n,i,o,r,s){let a=e.scene.mode,c=o.getValue(r,e._lastCartesian);if(l(c)){let u=!1,f=!1,d,p,g;if(a===ne.SCENE3D){ee.addSeconds(r,.001,AA);let T=o.getValue(AA,$B);if(l(T)||(ee.addSeconds(r,-.001,AA),T=o.getValue(AA,$B),f=!0),l(T)){let A=Mt.computeFixedToIcrfMatrix(r,Hle),S=Mt.computeFixedToIcrfMatrix(AA,Gle),v;!l(A)||!l(S)?(v=Mt.computeTemeToPseudoFixedMatrix(r,Wle),A=Z.transpose(v,Hle),S=Mt.computeTemeToPseudoFixedMatrix(AA,Gle),Z.transpose(S,S)):v=Z.transpose(A,Wle);let I=Z.multiplyByVector(A,c,qle),O=Z.multiplyByVector(S,T,Yle);m.subtract(I,O,MW);let R=m.magnitude(MW)*1e3,N=P.GRAVITATIONALPARAMETER,F=-N/(R*R-2*N/m.magnitude(I));F<0||F>FYe*s.maximumRadius?(d=jle,m.normalize(c,d),m.negate(d,d),g=m.clone(m.UNIT_Z,RW),p=m.cross(g,d,$B),m.magnitude(p)>P.EPSILON7&&(m.normalize(d,d),m.normalize(p,p),g=m.cross(d,p,RW),m.normalize(g,g),u=!0)):m.equalsEpsilon(c,T,P.EPSILON7)||(g=jle,m.normalize(I,g),m.normalize(O,O),p=m.cross(g,O,RW),f&&(p=m.multiplyByScalar(p,-1,p)),m.equalsEpsilon(p,m.ZERO,P.EPSILON7)||(d=m.cross(p,g,$B),Z.multiplyByVector(v,d,d),Z.multiplyByVector(v,p,p),Z.multiplyByVector(v,g,g),m.normalize(d,d),m.normalize(p,p),m.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,x,b;i&&(h=m.clone(t.position,MW),x=m.clone(t.direction,qle),b=m.clone(t.up,Yle));let C=NYe;u?(C[0]=d.x,C[1]=d.y,C[2]=d.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Mt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(m.clone(h,t.position),m.clone(x,t.direction),m.clone(b,t.up),m.cross(x,b,t.right))}if(n){let u=a===ne.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function Gw(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,oe.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._offset3D=new m}Object.defineProperties(Gw,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});Gw.defaultOffset3D=new m(-14e3,3500,3500);var QB=new ff,kYe=new m;Gw.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.position;if(!l(s))return;let a=r!==this._lastEntity,c=o!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=r.viewFrom,g=l(p);if(!g&&l(t)){QB.pitch=-P.PI_OVER_FOUR,QB.range=0;let h=s.getValue(e,kYe);if(l(h)){let x=2-1/Math.max(1,m.magnitude(h)/i.maximumRadius);QB.pitch*=x}u.viewBoundingSphere(t,QB),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&m.clone(Gw._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ne.SCENE2D&&m.clone(u.position,this._offset3D);this._lastEntity=r,this._mode=o,BYe(this,u,f,d,s,e,i)};var e3=Gw;function a3(e){return c3(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function c3(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?c3(n):n),[])}var Xle=[0,1,2,3].concat(...a3([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function sr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,h,x,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],g=r[r[d*2+1]*2+1]+1,g>u&&(g=u,b++),r[d*2+1]=g,!(d>e.max_code)&&(o.bl_count[g]++,h=0,d>=c&&(h=a[d-c]),x=r[d*2],o.opt_len+=x*(g+h),s&&(o.static_len+=x*(s[d*2+1]+h)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(d=o.bl_count[g];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),d--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=f<2?++f:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}sr._length_code=[0,1,2,3,4,5,6,7].concat(...a3([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));sr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];sr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];sr.d_code=function(e){return e<256?Xle[e]:Xle[256+(e>>>7)]};sr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];sr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];sr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];sr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ba(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var UYe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],VYe=a3([[144,8],[112,9],[24,7],[8,8]]);ba.static_ltree=c3(UYe.map((e,t)=>[e,VYe[t]]));var zYe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],HYe=a3([[30,5]]);ba.static_dtree=c3(zYe.map((e,t)=>[e,HYe[t]]));ba.static_l_desc=new ba(ba.static_ltree,sr.extra_lbits,256+1,286,15);ba.static_d_desc=new ba(ba.static_dtree,sr.extra_dbits,0,30,15);ba.static_bl_desc=new ba(null,sr.extra_blbits,0,19,7);var GYe=9,WYe=8;function Xm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Jle=0,r3=1,yx=2,Sd=[new Xm(0,0,0,0,Jle),new Xm(4,4,8,4,r3),new Xm(4,5,16,8,r3),new Xm(4,6,32,32,r3),new Xm(4,4,16,16,yx),new Xm(8,16,32,32,yx),new Xm(8,16,128,128,yx),new Xm(8,32,128,256,yx),new Xm(32,128,258,1024,yx),new Xm(32,258,258,4096,yx)],t3=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],df=0,n3=1,Ww=2,i3=3,jYe=32,LW=42,o3=113,jw=666,NW=8,qYe=0,FW=1,YYe=2,_r=3,s3=258,eu=s3+_r+1;function Kle(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function XYe(){let e=this,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x,b,C,T,A,S,v,I,O,R,N,F,_,E,w,D,M,B,V,U=new sr,G=new sr,k=new sr;e.depth=[];let Y,j,$,W,K,J;e.bl_count=[],e.heap=[],M=[],B=[],V=[];function he(){u=2*r,d[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)d[Ne]=0;F=Sd[_].max_lazy,w=Sd[_].good_length,D=Sd[_].nice_length,N=Sd[_].max_chain,v=0,C=0,O=0,T=R=_r-1,S=0,p=0}function ge(){let Ne;for(Ne=0;Ne<286;Ne++)M[Ne*2]=0;for(Ne=0;Ne<30;Ne++)B[Ne*2]=0;for(Ne=0;Ne<19;Ne++)V[Ne*2]=0;M[256*2]=1,e.opt_len=e.static_len=0,j=$=0}function se(){U.dyn_tree=M,U.stat_desc=ba.static_l_desc,G.dyn_tree=B,G.stat_desc=ba.static_d_desc,k.dyn_tree=V,k.stat_desc=ba.static_bl_desc,K=0,J=0,W=8,ge()}e.pqdownheap=function(Ne,rt){let $e=e.heap,He=$e[rt],mt=rt<<1;for(;mt<=e.heap_len&&(mt<e.heap_len&&Kle(Ne,$e[mt+1],$e[mt],e.depth)&&mt++,!Kle(Ne,He,$e[mt],e.depth));)$e[rt]=$e[mt],rt=mt,mt<<=1;$e[rt]=He};function pe(Ne,rt){let $e=-1,He,mt=Ne[0*2+1],Ut=0,xn=7,Zn=4;mt===0&&(xn=138,Zn=3),Ne[(rt+1)*2+1]=65535;for(let To=0;To<=rt;To++)He=mt,mt=Ne[(To+1)*2+1],!(++Ut<xn&&He==mt)&&(Ut<Zn?V[He*2]+=Ut:He!==0?(He!=$e&&V[He*2]++,V[16*2]++):Ut<=10?V[17*2]++:V[18*2]++,Ut=0,$e=He,mt===0?(xn=138,Zn=3):He==mt?(xn=6,Zn=3):(xn=7,Zn=4))}function xe(){let Ne;for(pe(M,U.max_code),pe(B,G.max_code),k.build_tree(e),Ne=19-1;Ne>=3&&V[sr.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function De(Ne){e.pending_buf[e.pending++]=Ne}function Se(Ne){De(Ne&255),De(Ne>>>8&255)}function we(Ne){De(Ne>>8&255),De(Ne&255&255)}function ze(Ne,rt){let $e,He=rt;J>16-He?($e=Ne,K|=$e<<J&65535,Se(K),K=$e>>>16-J,J+=He-16):(K|=Ne<<J&65535,J+=He)}function Oe(Ne,rt){let $e=Ne*2;ze(rt[$e]&65535,rt[$e+1]&65535)}function ft(Ne,rt){let $e,He=-1,mt,Ut=Ne[0*2+1],xn=0,Zn=7,To=4;for(Ut===0&&(Zn=138,To=3),$e=0;$e<=rt;$e++)if(mt=Ut,Ut=Ne[($e+1)*2+1],!(++xn<Zn&&mt==Ut)){if(xn<To)do Oe(mt,V);while(--xn!==0);else mt!==0?(mt!=He&&(Oe(mt,V),xn--),Oe(16,V),ze(xn-3,2)):xn<=10?(Oe(17,V),ze(xn-3,3)):(Oe(18,V),ze(xn-11,7));xn=0,He=mt,Ut===0?(Zn=138,To=3):mt==Ut?(Zn=6,To=3):(Zn=7,To=4)}}function Ct(Ne,rt,$e){let He;for(ze(Ne-257,5),ze(rt-1,5),ze($e-4,4),He=0;He<$e;He++)ze(V[sr.bl_order[He]*2+1],3);ft(M,Ne-1),ft(B,rt-1)}function ot(){J==16?(Se(K),K=0,J=0):J>=8&&(De(K&255),K>>>=8,J-=8)}function sn(){ze(FW<<1,3),Oe(256,ba.static_ltree),ot(),1+W+10-J<9&&(ze(FW<<1,3),Oe(256,ba.static_ltree),ot()),W=7}function wn(Ne,rt){let $e,He,mt;if(e.dist_buf[j]=Ne,e.lc_buf[j]=rt&255,j++,Ne===0?M[rt*2]++:($++,Ne--,M[(sr._length_code[rt]+256+1)*2]++,B[sr.d_code(Ne)*2]++),!(j&8191)&&_>2){for($e=j*8,He=v-C,mt=0;mt<30;mt++)$e+=B[mt*2]*(5+sr.extra_dbits[mt]);if($e>>>=3,$<Math.floor(j/2)&&$e<Math.floor(He/2))return!0}return j==Y-1}function zt(Ne,rt){let $e,He,mt=0,Ut,xn;if(j!==0)do $e=e.dist_buf[mt],He=e.lc_buf[mt],mt++,$e===0?Oe(He,Ne):(Ut=sr._length_code[He],Oe(Ut+256+1,Ne),xn=sr.extra_lbits[Ut],xn!==0&&(He-=sr.base_length[Ut],ze(He,xn)),$e--,Ut=sr.d_code($e),Oe(Ut,rt),xn=sr.extra_dbits[Ut],xn!==0&&($e-=sr.base_dist[Ut],ze($e,xn)));while(mt<j);Oe(256,Ne),W=Ne[256*2+1]}function Bt(){J>8?Se(K):J>0&&De(K&255),K=0,J=0}function be(Ne,rt,$e){Bt(),W=8,$e&&(Se(rt),Se(~rt)),e.pending_buf.set(c.subarray(Ne,Ne+rt),e.pending),e.pending+=rt}function Ee(Ne,rt,$e){ze((qYe<<1)+($e?1:0),3),be(Ne,rt,!0)}function at(Ne,rt,$e){let He,mt,Ut=0;_>0?(U.build_tree(e),G.build_tree(e),Ut=xe(),He=e.opt_len+3+7>>>3,mt=e.static_len+3+7>>>3,mt<=He&&(He=mt)):He=mt=rt+5,rt+4<=He&&Ne!=-1?Ee(Ne,rt,$e):mt==He?(ze((FW<<1)+($e?1:0),3),zt(ba.static_ltree,ba.static_dtree)):(ze((YYe<<1)+($e?1:0),3),Ct(U.max_code+1,G.max_code+1,Ut+1),zt(M,B)),ge(),$e&&Bt()}function Jt(Ne){at(C>=0?C:-1,v-C,Ne),C=v,t.flush_pending()}function ri(){let Ne,rt,$e,He;do{if(He=u-O-v,He===0&&v===0&&O===0)He=r;else if(He==-1)He--;else if(v>=r+r-eu){c.set(c.subarray(r,r+r),0),I-=r,v-=r,C-=r,Ne=g,$e=Ne;do rt=d[--$e]&65535,d[$e]=rt>=r?rt-r:0;while(--Ne!==0);Ne=r,$e=Ne;do rt=f[--$e]&65535,f[$e]=rt>=r?rt-r:0;while(--Ne!==0);He+=r}if(t.avail_in===0)return;Ne=t.read_buf(c,v+O,He),O+=Ne,O>=_r&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<eu&&t.avail_in!==0)}function Ze(Ne){let rt=65535,$e;for(rt>i-5&&(rt=i-5);;){if(O<=1){if(ri(),O===0&&Ne==0)return df;if(O===0)break}if(v+=O,O=0,$e=C+rt,(v===0||v>=$e)&&(O=v-$e,v=$e,Jt(!1),t.avail_out===0)||v-C>=r-eu&&(Jt(!1),t.avail_out===0))return df}return Jt(Ne==4),t.avail_out===0?Ne==4?Ww:df:Ne==4?i3:n3}function zr(Ne){let rt=N,$e=v,He,mt,Ut=R,xn=v>r-eu?v-(r-eu):0,Zn=D,To=a,Qr=v+s3,es=c[$e+Ut-1],ar=c[$e+Ut];R>=w&&(rt>>=2),Zn>O&&(Zn=O);do if(He=Ne,!(c[He+Ut]!=ar||c[He+Ut-1]!=es||c[He]!=c[$e]||c[++He]!=c[$e+1])){$e+=2,He++;do;while(c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&c[++$e]==c[++He]&&$e<Qr);if(mt=s3-(Qr-$e),$e=Qr-s3,mt>Ut){if(I=Ne,Ut=mt,mt>=Zn)break;es=c[$e+Ut-1],ar=c[$e+Ut]}}while((Ne=f[Ne&To]&65535)>xn&&--rt!==0);return Ut<=O?Ut:O}function Hr(Ne){let rt=0,$e;for(;;){if(O<eu){if(ri(),O<eu&&Ne==0)return df;if(O===0)break}if(O>=_r&&(p=(p<<b^c[v+(_r-1)]&255)&x,rt=d[p]&65535,f[v&a]=d[p],d[p]=v),rt!==0&&(v-rt&65535)<=r-eu&&E!=2&&(T=zr(rt)),T>=_r)if($e=wn(v-I,T-_r),O-=T,T<=F&&O>=_r){T--;do v++,p=(p<<b^c[v+(_r-1)]&255)&x,rt=d[p]&65535,f[v&a]=d[p],d[p]=v;while(--T!==0);v++}else v+=T,T=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else $e=wn(0,c[v]&255),O--,v++;if($e&&(Jt(!1),t.avail_out===0))return df}return Jt(Ne==4),t.avail_out===0?Ne==4?Ww:df:Ne==4?i3:n3}function sa(Ne){let rt=0,$e,He;for(;;){if(O<eu){if(ri(),O<eu&&Ne==0)return df;if(O===0)break}if(O>=_r&&(p=(p<<b^c[v+(_r-1)]&255)&x,rt=d[p]&65535,f[v&a]=d[p],d[p]=v),R=T,A=I,T=_r-1,rt!==0&&R<F&&(v-rt&65535)<=r-eu&&(E!=2&&(T=zr(rt)),T<=5&&(E==1||T==_r&&v-I>4096)&&(T=_r-1)),R>=_r&&T<=R){He=v+O-_r,$e=wn(v-1-A,R-_r),O-=R-1,R-=2;do++v<=He&&(p=(p<<b^c[v+(_r-1)]&255)&x,rt=d[p]&65535,f[v&a]=d[p],d[p]=v);while(--R!==0);if(S=0,T=_r-1,v++,$e&&(Jt(!1),t.avail_out===0))return df}else if(S!==0){if($e=wn(0,c[v-1]&255),$e&&Jt(!1),v++,O--,t.avail_out===0)return df}else S=1,v++,O--}return S!==0&&($e=wn(0,c[v-1]&255),S=0),Jt(Ne==4),t.avail_out===0?Ne==4?Ww:df:Ne==4?i3:n3}function $r(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=o3,o=0,se(),he(),0}e.deflateInit=function(Ne,rt,$e,He,mt,Ut){return He||(He=NW),mt||(mt=WYe),Ut||(Ut=0),Ne.msg=null,rt==-1&&(rt=6),mt<1||mt>GYe||He!=NW||$e<9||$e>15||rt<0||rt>9||Ut<0||Ut>2?-2:(Ne.dstate=e,s=$e,r=1<<s,a=r-1,h=mt+7,g=1<<h,x=g-1,b=Math.floor((h+_r-1)/_r),c=new Uint8Array(r*2),f=[],d=[],Y=1<<mt+6,e.pending_buf=new Uint8Array(Y*4),i=Y*4,e.dist_buf=new Uint16Array(Y),e.lc_buf=new Uint8Array(Y),_=rt,E=Ut,$r(Ne))},e.deflateEnd=function(){return n!=LW&&n!=o3&&n!=jw?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==o3?-3:0)},e.deflateParams=function(Ne,rt,$e){let He=0;return rt==-1&&(rt=6),rt<0||rt>9||$e<0||$e>2?-2:(Sd[_].func!=Sd[rt].func&&Ne.total_in!==0&&(He=Ne.deflate(1)),_!=rt&&(_=rt,F=Sd[_].max_lazy,w=Sd[_].good_length,D=Sd[_].nice_length,N=Sd[_].max_chain),E=$e,He)},e.deflateSetDictionary=function(Ne,rt,$e){let He=$e,mt,Ut=0;if(!rt||n!=LW)return-2;if(He<_r)return 0;for(He>r-eu&&(He=r-eu,Ut=$e-He),c.set(rt.subarray(Ut,Ut+He),0),v=He,C=He,p=c[0]&255,p=(p<<b^c[1]&255)&x,mt=0;mt<=He-_r;mt++)p=(p<<b^c[mt+(_r-1)]&255)&x,f[mt&a]=d[p],d[p]=mt;return 0},e.deflate=function(Ne,rt){let $e,He,mt,Ut,xn;if(rt>4||rt<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==jw&&rt!=4)return Ne.msg=t3[2- -2],-2;if(Ne.avail_out===0)return Ne.msg=t3[2- -5],-5;if(t=Ne,Ut=o,o=rt,n==LW&&(He=NW+(s-8<<4)<<8,mt=(_-1&255)>>1,mt>3&&(mt=3),He|=mt<<6,v!==0&&(He|=jYe),He+=31-He%31,n=o3,we(He)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&rt<=Ut&&rt!=4)return t.msg=t3[2- -5],-5;if(n==jw&&t.avail_in!==0)return Ne.msg=t3[2- -5],-5;if(t.avail_in!==0||O!==0||rt!=0&&n!=jw){switch(xn=-1,Sd[_].func){case Jle:xn=Ze(rt);break;case r3:xn=Hr(rt);break;case yx:xn=sa(rt);break;default:}if((xn==Ww||xn==i3)&&(n=jw),xn==df||xn==Ww)return t.avail_out===0&&(o=-1),0;if(xn==n3){if(rt==1)sn();else if(Ee(0,0,!1),rt==3)for($e=0;$e<g;$e++)d[$e]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return rt!=4?0:1}}function Zle(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Zle.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new XYe,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function KYe(e){let t=this,n=new Zle,i=JYe(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,d=0,p=0,g=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(r)):h.push(r.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(f=new Uint8Array(g),h.forEach(function(x){f.set(x,p),p+=x.length})):f=h[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function JYe(e){return e+5*(Math.floor(e/16383)+1)}var $le=KYe;var tu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],yue=1440,ZYe=0,$Ye=4,QYe=9,eXe=5,tXe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],nXe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],iXe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],oXe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],rXe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],sXe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Yg=15;function VW(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,g,h,x,b,C,T,A){let S,v,I,O,R,N,F,_,E,w,D,M,B,V,U;w=0,R=d;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==d)return x[0]=-1,b[0]=0,0;for(_=b[0],N=1;N<=Yg&&i[N]===0;N++);for(F=N,_<N&&(_=N),R=Yg;R!==0&&i[R]===0;R--);for(I=R,_>R&&(_=R),b[0]=_,V=1<<N;N<R;N++,V<<=1)if((V-=i[N])<0)return-3;if((V-=i[R])<0)return-3;for(i[R]+=V,s[1]=N=0,w=1,B=2;--R!==0;)s[B]=N+=i[w],B++,w++;R=0,w=0;do(N=u[f+w])!==0&&(A[s[N]++]=R),w++;while(++R<d);for(d=s[I],s[0]=R=0,w=0,O=-1,M=-_,r[0]=0,D=0,U=0;F<=I;F++)for(S=i[F];S--!==0;){for(;F>M+_;){if(O++,M+=_,U=I-M,U=U>_?_:U,(v=1<<(N=F-M))>S+1&&(v-=S+1,B=F,N<U))for(;++N<U&&!((v<<=1)<=i[++B]);)v-=i[B];if(U=1<<N,T[0]+U>yue)return-3;r[O]=D=T[0],T[0]+=U,O!==0?(s[O]=R,o[0]=N,o[1]=_,N=R>>>M-_,o[2]=D-r[O-1]-N,C.set(o,(r[O-1]+N)*3)):x[0]=D}for(o[1]=F-M,w>=d?o[0]=128+64:A[w]<p?(o[0]=A[w]<256?0:32+64,o[2]=A[w++]):(o[0]=h[A[w]-p]+16+64,o[2]=g[A[w++]-p]),v=1<<F-M,N=R>>>M;N<U;N+=v)C.set(o,(D+N)*3);for(N=1<<F-1;R&N;N>>>=1)R^=N;for(R^=N,E=(1<<M)-1;(R&E)!=s[O];)O--,M-=_,E=(1<<M)-1}return V!==0&&I!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(Yg+1),o=[],r=new Int32Array(Yg),s=new Int32Array(Yg+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<Yg+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,Yg),0),s.set(i.subarray(0,Yg+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let h;return c(19),t[0]=0,h=a(u,0,19,19,null,null,d,f,p,t,n),h==-3?g.msg="oversubscribed dynamic bit lengths tree":(h==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(u,f,d,p,g,h,x,b,C){let T;return c(288),t[0]=0,T=a(d,0,u,257,iXe,oXe,h,p,b,t,n),T!=0||p[0]===0?(T==-3?C.msg="oversubscribed literal/length tree":T!=-4&&(C.msg="incomplete literal/length tree",T=-3),T):(c(288),T=a(d,u,f,0,rXe,sXe,x,g,b,t,n),T!=0||g[0]===0&&u>257?(T==-3?C.msg="oversubscribed distance tree":T==-5?(C.msg="incomplete distance tree",T=-3):T!=-4&&(C.msg="empty distance tree with lengths",T=-3),T):0)}}VW.inflate_trees_fixed=function(e,t,n,i){return e[0]=QYe,t[0]=eXe,n[0]=tXe,i[0]=nXe,0};var l3=0,Qle=1,eue=2,tue=3,nue=4,iue=5,oue=6,BW=7,rue=8,u3=9;function aXe(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,h=0;function x(b,C,T,A,S,v,I,O){let R,N,F,_,E,w,D,M,B,V,U,G,k,Y,j,$;D=O.next_in_index,M=O.avail_in,E=I.bitb,w=I.bitk,B=I.write,V=B<I.read?I.read-B-1:I.end-B,U=tu[b],G=tu[C];do{for(;w<20;)M--,E|=(O.read_byte(D++)&255)<<w,w+=8;if(R=E&U,N=T,F=A,$=(F+R)*3,(_=N[$])===0){E>>=N[$+1],w-=N[$+1],I.win[B++]=N[$+2],V--;continue}do{if(E>>=N[$+1],w-=N[$+1],_&16){for(_&=15,k=N[$+2]+(E&tu[_]),E>>=_,w-=_;w<15;)M--,E|=(O.read_byte(D++)&255)<<w,w+=8;R=E&G,N=S,F=v,$=(F+R)*3,_=N[$];do if(E>>=N[$+1],w-=N[$+1],_&16){for(_&=15;w<_;)M--,E|=(O.read_byte(D++)&255)<<w,w+=8;if(Y=N[$+2]+(E&tu[_]),E>>=_,w-=_,V-=k,B>=Y)j=B-Y,B-j>0&&2>B-j?(I.win[B++]=I.win[j++],I.win[B++]=I.win[j++],k-=2):(I.win.set(I.win.subarray(j,j+2),B),B+=2,j+=2,k-=2);else{j=B-Y;do j+=I.end;while(j<0);if(_=I.end-j,k>_){if(k-=_,B-j>0&&_>B-j)do I.win[B++]=I.win[j++];while(--_!==0);else I.win.set(I.win.subarray(j,j+_),B),B+=_,j+=_,_=0;j=0}}if(B-j>0&&k>B-j)do I.win[B++]=I.win[j++];while(--k!==0);else I.win.set(I.win.subarray(j,j+k),B),B+=k,j+=k,k=0;break}else if(!(_&64))R+=N[$+2],R+=E&tu[_],$=(F+R)*3,_=N[$];else return O.msg="invalid distance code",k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,-3;while(!0);break}if(_&64)return _&32?(k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,-3);if(R+=N[$+2],R+=E&tu[_],$=(F+R)*3,(_=N[$])===0){E>>=N[$+1],w-=N[$+1],I.win[B++]=N[$+2],V--;break}}while(!0)}while(V>=258&&M>=10);return k=O.avail_in-M,k=w>>3<k?w>>3:k,M+=k,D-=k,w-=k<<3,I.bitb=E,I.bitk=w,O.avail_in=M,O.total_in+=D-O.next_in_index,O.next_in_index=D,I.write=B,0}e.init=function(b,C,T,A,S,v){t=l3,u=b,f=C,d=T,p=A,g=S,h=v,i=null},e.proc=function(b,C,T){let A,S,v,I=0,O=0,R=0,N,F,_,E;for(R=C.next_in_index,N=C.avail_in,I=b.bitb,O=b.bitk,F=b.write,_=F<b.read?b.read-F-1:b.end-F;;)switch(t){case l3:if(_>=258&&N>=10&&(b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,T=x(u,f,d,p,g,h,b,C),R=C.next_in_index,N=C.avail_in,I=b.bitb,O=b.bitk,F=b.write,_=F<b.read?b.read-F-1:b.end-F,T!=0)){t=T==1?BW:u3;break}r=u,i=d,o=p,t=Qle;case Qle:for(A=r;O<A;){if(N!==0)T=0;else return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);N--,I|=(C.read_byte(R++)&255)<<O,O+=8}if(S=(o+(I&tu[A]))*3,I>>>=i[S+1],O-=i[S+1],v=i[S],v===0){s=i[S+2],t=oue;break}if(v&16){a=v&15,n=i[S+2],t=eue;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=BW;break}return t=u3,C.msg="invalid literal/length code",T=-3,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);case eue:for(A=a;O<A;){if(N!==0)T=0;else return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);N--,I|=(C.read_byte(R++)&255)<<O,O+=8}n+=I&tu[A],I>>=A,O-=A,r=f,i=g,o=h,t=tue;case tue:for(A=r;O<A;){if(N!==0)T=0;else return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);N--,I|=(C.read_byte(R++)&255)<<O,O+=8}if(S=(o+(I&tu[A]))*3,I>>=i[S+1],O-=i[S+1],v=i[S],v&16){a=v&15,c=i[S+2],t=nue;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=u3,C.msg="invalid distance code",T=-3,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);case nue:for(A=a;O<A;){if(N!==0)T=0;else return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);N--,I|=(C.read_byte(R++)&255)<<O,O+=8}c+=I&tu[A],I>>=A,O-=A,t=iue;case iue:for(E=F-c;E<0;)E+=b.end;for(;n!==0;){if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0&&(b.write=F,T=b.inflate_flush(C,T),F=b.write,_=F<b.read?b.read-F-1:b.end-F,F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0)))return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);b.win[F++]=b.win[E++],_--,E==b.end&&(E=0),n--}t=l3;break;case oue:if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0&&(b.write=F,T=b.inflate_flush(C,T),F=b.write,_=F<b.read?b.read-F-1:b.end-F,F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0)))return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);T=0,b.win[F++]=s,_--,t=l3;break;case BW:if(O>7&&(O-=8,N++,R--),b.write=F,T=b.inflate_flush(C,T),F=b.write,_=F<b.read?b.read-F-1:b.end-F,b.read!=b.write)return b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);t=rue;case rue:return T=1,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);case u3:return T=-3,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T);default:return T=-2,b.bitb=I,b.bitk=O,C.avail_in=N,C.total_in+=R-C.next_in_index,C.next_in_index=R,b.write=F,b.inflate_flush(C,T)}},e.free=function(){}}var sue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],EA=0,kW=1,aue=2,cue=3,lue=4,uue=5,f3=6,d3=7,fue=8,xx=9;function cXe(e,t){let n=this,i=EA,o=0,r=0,s=0,a,c=[0],u=[0],f=new aXe,d=0,p=new Int32Array(yue*3),g=0,h=new VW;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=g),i==f3&&f.free(x),i=EA,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let C,T,A;return T=x.next_out_index,A=n.read,C=(A<=n.write?n.write:n.end)-A,C>x.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(A,A+C),T),T+=C,A+=C,A==n.end&&(A=0,n.write==n.end&&(n.write=0),C=n.write-A,C>x.avail_out&&(C=x.avail_out),C!==0&&b==-5&&(b=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(A,A+C),T),T+=C,A+=C),x.next_out_index=T,n.read=A,b},n.proc=function(x,b){let C,T,A,S,v,I,O,R;for(S=x.next_in_index,v=x.avail_in,T=n.bitb,A=n.bitk,I=n.write,O=I<n.read?n.read-I-1:n.end-I;;){let N,F,_,E,w,D,M,B;switch(i){case EA:for(;A<3;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}switch(C=T&7,d=C&1,C>>>1){case 0:T>>>=3,A-=3,C=A&7,T>>>=C,A-=C,i=kW;break;case 1:N=[],F=[],_=[[]],E=[[]],VW.inflate_trees_fixed(N,F,_,E),f.init(N[0],F[0],_[0],0,E[0],0),T>>>=3,A-=3,i=f3;break;case 2:T>>>=3,A-=3,i=cue;break;case 3:return T>>>=3,A-=3,i=xx,x.msg="invalid block type",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b)}break;case kW:for(;A<32;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}if((~T>>>16&65535)!=(T&65535))return i=xx,x.msg="invalid stored block lengths",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);o=T&65535,T=A=0,i=o!==0?aue:d!==0?d3:EA;break;case aue:if(v===0||O===0&&(I==n.end&&n.read!==0&&(I=0,O=I<n.read?n.read-I-1:n.end-I),O===0&&(n.write=I,b=n.inflate_flush(x,b),I=n.write,O=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,O=I<n.read?n.read-I-1:n.end-I),O===0)))return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);if(b=0,C=o,C>v&&(C=v),C>O&&(C=O),n.win.set(x.read_buf(S,C),I),S+=C,v-=C,I+=C,O-=C,(o-=C)!==0)break;i=d!==0?d3:EA;break;case cue:for(;A<14;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}if(r=C=T&16383,(C&31)>29||(C>>5&31)>29)return i=xx,x.msg="too many length or distance symbols",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(R=0;R<C;R++)a[R]=0;T>>>=14,A-=14,s=0,i=lue;case lue:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}a[sue[s++]]=T&7,T>>>=3,A-=3}for(;s<19;)a[sue[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,x),C!=0)return b=C,b==-3&&(a=null,i=xx),n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);s=0,i=uue;case uue:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let V,U;for(C=c[0];A<C;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}if(C=p[(u[0]+(T&tu[C]))*3+1],U=p[(u[0]+(T&tu[C]))*3+2],U<16)T>>>=C,A-=C,a[s++]=U;else{for(R=U==18?7:U-14,V=U==18?11:3;A<C+R;){if(v!==0)b=0;else return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);v--,T|=(x.read_byte(S++)&255)<<A,A+=8}if(T>>>=C,A-=C,V+=T&tu[R],T>>>=R,A-=R,R=s,C=r,R+V>258+(C&31)+(C>>5&31)||U==16&&R<1)return a=null,i=xx,x.msg="invalid bit length repeat",b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);U=U==16?a[R-1]:0;do a[R++]=U;while(--V!==0);s=R}}if(u[0]=-1,w=[],D=[],M=[],B=[],w[0]=9,D[0]=6,C=r,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,w,D,M,B,p,x),C!=0)return C==-3&&(a=null,i=xx),b=C,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);f.init(w[0],D[0],p,M[0],p,B[0]),i=f3;case f3:if(n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),S=x.next_in_index,v=x.avail_in,T=n.bitb,A=n.bitk,I=n.write,O=I<n.read?n.read-I-1:n.end-I,d===0){i=EA;break}i=d3;case d3:if(n.write=I,b=n.inflate_flush(x,b),I=n.write,O=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);i=fue;case fue:return b=1,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);case xx:return b=-3,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b);default:return b=-2,n.bitb=T,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=I,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,C){n.win.set(x.subarray(b,b+C),0),n.read=n.write=C},n.sync_point=function(){return i==kW?1:0}}var lXe=32,uXe=8,fXe=0,due=1,mue=2,hue=3,pue=4,_ue=5,UW=6,qw=7,gue=12,Xg=13,dXe=[0,0,255,255];function mXe(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=qw,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new cXe(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==$Ye?-5:0,o=-5;;)switch(s.mode){case fXe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=uXe){s.mode=Xg,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Xg,n.msg="invalid win size",s.marker=5;break}s.mode=due;case due:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Xg,n.msg="incorrect header check",s.marker=5;break}if(!(r&lXe)){s.mode=qw;break}s.mode=mue;case mue:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=hue;case hue:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=pue;case pue:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=_ue;case _ue:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=UW,2);case UW:return s.mode=Xg,n.msg="need dictionary",s.marker=0,-2;case qw:if(o=s.blocks.proc(n,o),o==-3){s.mode=Xg,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=gue;case gue:return n.avail_in=0,1;case Xg:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=UW)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=qw,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Xg&&(c.mode=Xg,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==dXe[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=qw,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function xue(){}xue.prototype={inflateInit:function(e){let t=this;return t.istate=new mXe,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function hXe(e){let t=this,n=new xue,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=ZYe,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,d,p=0,g=0,h=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.slice(0,n.next_out_index))),h+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(h),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var bue=hXe;var pXe={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},fl=Object.assign({},pXe);function m3(){return fl}function SA(e){if(e.baseURL!==void 0&&(fl.baseURL=e.baseURL),e.chunkSize!==void 0&&(fl.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(fl.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(fl.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(fl.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(fl.Deflate=e.Deflate),e.Inflate!==void 0&&(fl.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");fl.workerScripts||(fl.workerScripts={}),fl.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");fl.workerScripts||(fl.workerScripts={}),fl.workerScripts.inflate=e.workerScripts.inflate}}}var Cue=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Cue[e]=t}var zW=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^Cue[(n^t[i])&255];this.crc=n}get(){return~this.crc}},Kg=zW;var Yw=_Xe;function _Xe(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Ic={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Ic.getPartial(n);return i===32?e.concat(t):Ic._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Ic.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Ic.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Ic.getPartial(o);return i.push(Ic.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Xw={bytes:{fromBits(e){let n=Ic.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Ic.partial(8*(n&3),i)),t}}},HW={};HW.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};HW.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=Xw.utf8String.toBits(e));let n=t._buffer=Ic.concat(t._buffer,e),i=t._length,o=t._length=i+Ic.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=Ic.concat(t,[Ic.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var GW={};GW.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=o[d]*257^d*16843008;for(let h=0;h<4;h++)e[h][f]=g=g<<24^g>>>8,t[h][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],h=e[t?1:3]^n[3],x=4,b,C,T;for(let A=0;A<i;A++)b=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[h&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[h>>8&255]^u[d&255]^n[x+1],T=s[g>>>24]^a[h>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],h=s[h>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=b,p=C,g=T;for(let A=0;A<4;A++)o[t?3&-A:A]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[h&255]^n[x++],b=d,d=p,p=g,g=h,h=b;return o}};var Tue={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},WW={};WW.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=Ic.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return Ic.clamp(t,o)}};var vA={importKey(e){return new vA.hmacSha1(Xw.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,g=Ic;for(t=Xw.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)d.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};vA.hmacSha1=class{constructor(e){let t=this,n=t._hash=HW.sha1,i=[[],[]],o=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>o&&(e=n.hash(e));for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var IA="Invalid pasword",wA=16,gXe="raw",Aue={name:"PBKDF2"},yXe={name:"HMAC"},xXe="SHA-1",bXe=Object.assign({hash:yXe},Aue),Eue=Object.assign({iterations:1e3,hash:{name:xXe}},Aue),CXe=["deriveBits"],Jw=[8,12,16],Kw=[16,24,32],Jg=10,Sue=[0,0,0,0],_3=typeof crypto<"u",vue=_3&&typeof crypto.subtle<"u",Km=Xw.bytes,wue=GW.aes,Iue=WW.ctrGladman,Due=vA.hmacSha1,h3=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let o=nu(t,0,Jw[n.strength]+2);await TXe(n,o,n.password),n.password=null,n.aesCtrGladman=new Iue(new wue(n.keys.key),Array.from(Sue)),n.hmac=new Due(n.keys.authentication),t=nu(t,Jw[n.strength]+2)}let i=new Uint8Array(t.length-Jg-(t.length-Jg)%wA);return Pue(n,t,i,0,Jg,!0)}flush(){let t=this,n=t.pendingInput,i=nu(n,0,n.length-Jg),o=nu(n,n.length-Jg),r=new Uint8Array(0);if(i.length){let a=Km.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);r=Km.fromBits(c)}let s=!0;if(t.signed){let a=nu(Km.fromBits(t.hmac.digest()),0,Jg);for(let c=0;c<Jg;c++)a[c]!=o[c]&&(s=!1)}return{valid:s,data:r}}},p3=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await AXe(n,n.password),n.password=null,n.aesCtrGladman=new Iue(new wue(n.keys.key),Array.from(Sue)),n.hmac=new Due(n.keys.authentication));let o=new Uint8Array(i.length+t.length-t.length%wA);return o.set(i,0),Pue(n,t,o,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let o=t.aesCtrGladman.update(Km.toBits(t.pendingInput));t.hmac.update(o),n=Km.fromBits(o)}let i=nu(Km.fromBits(t.hmac.digest()),0,Jg);return{data:jW(n,i),signature:i}}};function Pue(e,t,n,i,o,r){let s=t.length-o;e.pendingInput.length&&(t=jW(e.pendingInput,t),n=wXe(n,s-s%wA));let a;for(a=0;a<=s-wA;a+=wA){let c=Km.toBits(nu(t,a,a+wA));r&&e.hmac.update(c);let u=e.aesCtrGladman.update(c);r||e.hmac.update(u),n.set(Km.fromBits(u),a+i)}return e.pendingInput=nu(t,a),n}async function TXe(e,t,n){await Oue(e,n,nu(t,0,Jw[e.strength]));let i=nu(t,Jw[e.strength]),o=e.keys.passwordVerification;if(o[0]!=i[0]||o[1]!=i[1])throw new Error(IA)}async function AXe(e,t){let n=EXe(new Uint8Array(Jw[e.strength]));return await Oue(e,t,n),jW(n,e.keys.passwordVerification)}async function Oue(e,t,n){let i=Yw(t),o=await SXe(gXe,i,bXe,!1,CXe),r=await vXe(Object.assign({salt:n},Eue),o,8*(Kw[e.strength]*2+2)),s=new Uint8Array(r);e.keys={key:Km.toBits(nu(s,0,Kw[e.strength])),authentication:Km.toBits(nu(s,Kw[e.strength],Kw[e.strength]*2)),passwordVerification:nu(s,Kw[e.strength]*2)}}function EXe(e){return _3&&typeof crypto.getRandomValues=="function"?crypto.getRandomValues(e):Tue.getRandomValues(e)}function SXe(e,t,n,i,o){return _3&&vue&&typeof crypto.subtle.importKey=="function"?crypto.subtle.importKey(e,t,n,i,o):vA.importKey(t)}async function vXe(e,t,n){return _3&&vue&&typeof crypto.subtle.deriveBits=="function"?await crypto.subtle.deriveBits(e,t,n):vA.pbkdf2(t,e.salt,Eue.iterations,n)}function jW(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function wXe(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function nu(e,t,n){return e.subarray(t,n)}var DA=12,g3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Nue(i,t)}append(t){let n=this;if(n.password){let i=Rue(n,t.subarray(0,DA));if(n.password=null,i[DA-1]!=n.passwordVerification)throw new Error(IA);t=t.subarray(DA)}return Rue(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},y3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Nue(i,t)}append(t){let n=this,i,o;if(n.password){n.password=null;let r=crypto.getRandomValues(new Uint8Array(DA));r[DA-1]=n.passwordVerification,i=new Uint8Array(t.length+r.length),i.set(Mue(n,r),0),o=DA}else i=new Uint8Array(t.length),o=0;return i.set(Mue(n,t),o),i}flush(){return{data:new Uint8Array(0)}}};function Rue(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Fue(e)^t[i],qW(e,n[i]);return n}function Mue(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Fue(e)^t[i],qW(e,t[i]);return n}function Nue(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new Kg(e.keys[0]),e.crcKey2=new Kg(e.keys[2]);for(let n=0;n<t.length;n++)qW(e,t.charCodeAt(n))}function qW(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=Lue(e.keys[1]+Bue(e.keys[0])),e.keys[1]=Lue(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function Fue(e){let t=e.keys[2]|2;return Bue(Math.imul(t,t^1)>>>8)}function Bue(e){return e&255}function Lue(e){return e&4294967295}var b3="deflate",C3="inflate",x3="Invalid signature",YW=class{constructor(t,{signature:n,password:i,signed:o,compressed:r,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=!!i;Object.assign(this,{signature:n,encrypted:f,signed:o,compressed:r,inflate:r&&new t({chunkSize:u}),crc32:o&&new Kg,zipCrypto:s,decrypt:f&&s?new g3(i,a):new h3(i,o,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let o=t.decrypt.flush();if(!o.valid)throw new Error(x3);i=o.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let o=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),o.setUint32(0,n),t.signature!=o.getUint32(0,!1))throw new Error(x3)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},XW=class{constructor(t,{encrypted:n,signed:i,compressed:o,level:r,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:o,deflate:o&&new t({level:r||5,chunkSize:f}),crc32:i&&new Kg,zipCrypto:s,encrypt:n&&s?new y3(a,c):new p3(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let o=t.encrypt.flush();n=o.signature;let r=new Uint8Array(i.length+o.data.length);r.set(i,0),r.set(o.data,i.length),i=r}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function kue(e,t,n){if(t.codecType.startsWith(b3))return new XW(e,t,n);if(t.codecType.startsWith(C3))return new YW(e,t,n)}var Uue="init",Vue="append",KW="flush",IXe="message",zue=!0,T3=(e,t,n,i,o,r,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,o(e)}}),r?PXe(e,i):DXe(e,i));function DXe(e,t){let n=kue(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(o){throw e.onTaskFinished(),o}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function PXe(e,t){let n,i={type:"module"};if(!e.interface){if(!zue)e.worker=o(i,t.baseURL);else try{e.worker=o({},t.baseURL)}catch{zue=!1,e.worker=o(i,t.baseURL)}e.worker.addEventListener(IXe,a,!1),e.interface={append(c){return r({type:Vue,data:c})},flush(){return r({type:KW})},abort(){e.onTaskFinished()}}}return e.interface;function o(c,u){let f,d;f=e.scripts[0],typeof f=="function"&&(f=f());try{d=new URL(f,u)}catch{d=f}return new Worker(d,c)}async function r(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:Uue,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==Uue||d==KW||d==Vue){let p=u.data;d==KW?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var bx=[],JW=[];function A3(e,t,n){let o=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),r=o&&n.workerScripts?n.workerScripts[t.codecType]:[];if(bx.length<n.maxWorkers){let a={};return bx.push(a),T3(a,e,t,n,s,o,r)}else{let a=bx.find(c=>!c.busy);return a?(Hue(a),T3(a,e,t,n,s,o,r)):new Promise(c=>JW.push({resolve:c,codecConstructor:e,options:t,webWorker:o,scripts:r}))}function s(a){if(JW.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=JW.splice(0,1);c(T3(a,u,f,n,s,d,p))}else a.worker?(Hue(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{bx=bx.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):bx=bx.filter(c=>c!=a)}}function Hue(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var Wue="Abort error";async function E3(e,t,n,i,o,r,s){let a=Math.max(r.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal,p=o();if(u<p){ZW(d,e);let g=await t.readUint8Array(u+i,Math.min(a,p-u)),h=g.length;ZW(d,e);let x=await e.append(g);if(ZW(d,e),f+=await Gue(n,x),s.onprogress)try{s.onprogress(u+h,p)}catch{}return c(u+a,f)}else{let g=await e.flush();return f+=await Gue(n,g.data),{signature:g.signature,length:f}}}}function ZW(e,t){if(e&&e.aborted)throw t.abort(),new Error(Wue)}async function Gue(e,t){return t.length&&await e.writeUint8Array(t),t.length}var $W="text/plain";var S3=class{constructor(){this.size=0}init(){this.initialized=!0}},v3=class extends S3{},Zw=class extends S3{writeUint8Array(t){this.size+=t.length}},w3=class extends v3{constructor(t){super(),this.blobReader=new Cx(new Blob([t],{type:$W}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},I3=class extends Zw{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:$W})}writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:$W})}getData(){if(this.blob.text)return this.blob.text();{let t=new FileReader;return new Promise((n,i)=>{t.onload=o=>n(o.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var D3=class extends Zw{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,o=this.pending.length;for(this.pending="",n=0;n<Math.floor((o+t.length)/3)*3-o;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},Cx=class extends v3{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(new Uint8Array(s.target.result)),i.onerror=()=>r(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},PA=class extends Zw{constructor(t){super(),this.contentType=t,this.arrayBuffersMaxlength=8,jue(this)}writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.length==this.arrayBuffersMaxlength&&que(this),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&que(this),this.blob=this.pendingBlob,jue(this)),this.blob}};function jue(e){e.pendingBlob=new Blob([],{type:e.contentType}),e.arrayBuffers=[]}function que(e){e.pendingBlob=new Blob([e.pendingBlob,...e.arrayBuffers],{type:e.contentType}),e.arrayBuffers=[]}var OA="/",QW=new Date(2107,11,31),e7=new Date(1980,0,1);var OXe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Yue=e=>{let t="";for(let n=0;n<e.length;n++)t+=OXe[e[n]];return t};var P3=RXe;function RXe(e,t){if(t&&t.trim().toLowerCase()=="cp437")return Yue(e);if(typeof TextDecoder>"u"){let n=new FileReader;return new Promise((i,o)=>{n.onload=r=>i(r.target.result),n.onerror=()=>o(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var MXe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],Bp=class{constructor(t){MXe.forEach(n=>this[n]=t[n])}};var i7="File format is not recognized",BXe="End of central directory not found",kXe="End of Zip64 central directory not found",UXe="End of Zip64 central directory locator not found",VXe="Central directory header not found",zXe="Local file header not found",HXe="Zip64 extra field not found",GXe="File contains encrypted entry",WXe="Encryption method not supported",Xue="Compression method not supported",Kue="utf-8",Jue="cp437",Zue=["uncompressedSize","compressedSize","offset"],U3=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:m3()})}async*getEntriesGenerator(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(i7);let o=await KXe(i,101010256,i.size,22,65535*16);if(!o)throw new Error(BXe);let r=Ka(o),s=Js(r,12),a=Js(r,16),c=iu(r,8),u=0;if(a==4294967295||s==4294967295||c==65535){let g=await Zg(i,o.offset-20,20),h=Ka(g);if(Js(h,0)!=117853008)throw new Error(kXe);a=O3(h,8);let x=await Zg(i,a,56),b=Ka(x),C=o.offset-20-56;if(Js(b,0)!=101075792&&a!=C){let T=a;a=C,u=a-T,x=await Zg(i,a,56),b=Ka(x)}if(Js(b,0)!=101075792)throw new Error(UXe);c=O3(b,32),s=O3(b,40),a-=s}if(a<0||a>=i.size)throw new Error(i7);let f=0,d=await Zg(i,a,s),p=Ka(d);if(s){let g=o.offset-s;if(Js(p,f)!=33639248&&a!=g){let h=a;a=g,u=a-h,d=await Zg(i,a,s),p=Ka(d)}}if(a<0||a>=i.size)throw new Error(i7);for(let g=0;g<c;g++){let h=new r7(i,n.config,n.options);if(Js(p,f)!=33639248)throw new Error(VXe);Que(h,p,f+6);let x=!!h.bitFlag.languageEncodingFlag,b=f+46,C=b+h.filenameLength,T=C+h.extraFieldLength,A=iu(p,f+4),S=(A&0)==0;Object.assign(h,{versionMadeBy:A,msDosCompatible:S,compressedSize:0,uncompressedSize:0,commentLength:iu(p,f+32),directory:S&&(MA(p,f+38)&16)==16,offset:Js(p,f+42)+u,internalFileAttribute:Js(p,f+34),externalFileAttribute:Js(p,f+38),rawFilename:d.subarray(b,C),filenameUTF8:x,commentUTF8:x,rawExtraField:d.subarray(C,T)});let v=T+h.commentLength;h.rawComment=d.subarray(T,v);let I=RA(n,t,"filenameEncoding"),O=RA(n,t,"commentEncoding"),[R,N]=await Promise.all([P3(h.rawFilename,h.filenameUTF8?Kue:I||Jue),P3(h.rawComment,h.commentUTF8?Kue:O||Jue)]);h.filename=R,h.comment=N,!h.directory&&h.filename.endsWith(OA)&&(h.directory=!0),await efe(h,h,p,f+6);let F=new Bp(h);if(F.getData=(_,E)=>h.getData(_,F,E),f=v,t.onprogress)try{t.onprogress(g+1,c,new Bp(h))}catch{}yield F}return!0}async getEntries(t={}){let n=[],i=this.getEntriesGenerator(t),o=i.next();for(;!(await o).done;)n.push((await o).value),o=i.next();return n}async close(){}};var r7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=o,h=o.localDirectory={};r.initialized||await r.init();let x=await Zg(r,s,30),b=Ka(x),C=RA(o,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(Xue);if(c!=0&&c!=8)throw new Error(Xue);if(Js(b,0)!=67324752)throw new Error(zXe);Que(h,b,4),x=await Zg(r,s,30+h.filenameLength+h.extraFieldLength),h.rawExtraField=x.subarray(30+h.filenameLength),await efe(o,h,b,4),n.lastAccessDate=h.lastAccessDate,n.creationDate=h.creationDate;let T=o.encrypted&&h.encrypted,A=T&&!a;if(T){if(!A&&a.strength===void 0)throw new Error(WXe);if(!C)throw new Error(GXe)}let S=await A3(u.Inflate,{codecType:C3,password:C,zipCrypto:A,encryptionStrength:a&&a.strength,signed:RA(o,i,"checkSignature"),passwordVerification:A&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:T,useWebWorkers:RA(o,i,"useWebWorkers")},u);t.initialized||await t.init();let v=RA(o,i,"signal"),I=s+30+h.filenameLength+h.extraFieldLength;return await E3(S,r,t,I,()=>g,u,{onprogress:i.onprogress,signal:v}),t.getData()}};function Que(e,t,n){let i=e.rawBitFlag=iu(t,n+2),o=(i&1)==1,r=Js(t,n+6);Object.assign(e,{encrypted:o,version:iu(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:JXe(r),filenameLength:iu(t,n+22),extraFieldLength:iu(t,n+24)})}async function efe(e,t,n,i){let o=t.rawExtraField,r=t.extraField=new Map,s=Ka(new Uint8Array(o)),a=0;try{for(;a<o.length;){let x=iu(s,a),b=iu(s,a+2);r.set(x,{type:x,data:o.slice(a+4,a+4+b)}),a+=4+b}}catch{}let c=iu(n,i+4);t.signature=Js(n,i+10),t.uncompressedSize=Js(n,i+18),t.compressedSize=Js(n,i+14);let u=r.get(1);u&&(jXe(u,t),t.extraFieldZip64=u);let f=r.get(28789);f&&(await $ue(f,"filename","rawFilename",t,e),t.extraFieldUnicodePath=f);let d=r.get(25461);d&&(await $ue(d,"comment","rawComment",t,e),t.extraFieldUnicodeComment=d);let p=r.get(39169);p?(qXe(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let g=r.get(10);g&&(YXe(g,t),t.extraFieldNTFS=g);let h=r.get(21589);h&&(XXe(h,t),t.extraFieldExtendedTimestamp=h)}function jXe(e,t){t.zip64=!0;let n=Ka(e.data);e.values=[];for(let o=0;o<Math.floor(e.data.length/8);o++)e.values.push(O3(n,0+o*8));let i=Zue.filter(o=>t[o]==4294967295);for(let o=0;o<i.length;o++)e[i[o]]=e.values[o];Zue.forEach(o=>{if(t[o]==4294967295)if(e[o]!==void 0)t[o]=e[o];else throw new Error(HXe)})}async function $ue(e,t,n,i,o){let r=Ka(e.data);e.version=MA(r,0),e.signature=Js(r,1);let s=new Kg;s.append(o[n]);let a=Ka(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await P3(e.data.subarray(5)),e.valid=!o.bitFlag.languageEncodingFlag&&e.signature==Js(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function qXe(e,t,n){let i=Ka(e.data);e.vendorVersion=MA(i,0),e.vendorId=MA(i,2);let o=MA(i,4);e.strength=o,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=iu(i,5)}function YXe(e,t){let n=Ka(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=iu(n,i),s=iu(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=Ka(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=o7(s),f=o7(a),d=o7(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function XXe(e,t){let n=Ka(e.data),i=MA(n,0),o=[],r=[];(i&1)==1&&(o.push("lastModDate"),r.push("rawLastModDate")),(i&2)==2&&(o.push("lastAccessDate"),r.push("rawLastAccessDate")),(i&4)==4&&(o.push("creationDate"),r.push("rawCreationDate"));let s=1;o.forEach((a,c)=>{if(e.data.length>=s+4){let u=Js(n,s);t[a]=e[a]=new Date(u*1e3);let f=r[c];e[f]=u}s+=4})}async function KXe(e,t,n,i,o){let r=new Uint8Array(4),s=Ka(r);ZXe(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Zg(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function RA(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function JXe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function o7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function MA(e,t){return e.getUint8(t)}function iu(e,t){return e.getUint16(t,!0)}function Js(e,t){return e.getUint32(t,!0)}function O3(e,t){return Number(e.getBigUint64(t,!0))}function ZXe(e,t,n){e.setUint32(t,n,!0)}function Ka(e){return new DataView(e.buffer)}function Zg(e,t,n){return e.readUint8Array(t,n)}var nKe="File already exists",iKe="Zip file comment exceeds 64KB",oKe="File entry comment exceeds 64KB",rKe="File entry name exceeds 64KB",ife="Version exceeds 65535",sKe="The strength must equal 1, 2, or 3",aKe="Extra field type exceeds 65535",cKe="Extra field data exceeds 64KB",g7="Zip64 is not supported",ofe=new Uint8Array([7,0,2,0,65,69,3,0,0]),rfe=24,p7=0,H3=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:m3(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[],pendingAddFileCalls:new Set})}async add(t="",n,i={}){let o=this;if(p7<o.config.maxWorkers){p7++;let r;try{return r=lKe(o,t,n,i),this.pendingAddFileCalls.add(r),await r}finally{this.pendingAddFileCalls.delete(r),p7--;let s=o.pendingEntries.shift();s&&o.add(s.name,s.reader,s.options).then(s.resolve).catch(s.reject)}}else return new Promise((r,s)=>o.pendingEntries.push({name:t,reader:n,options:i,resolve:r,reject:s}))}async close(t=new Uint8Array(0),n={}){for(;this.pendingAddFileCalls.size;)await Promise.all(Array.from(this.pendingAddFileCalls));return await dKe(this,t,n),this.writer.getData()}};async function lKe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(OA)?t+=OA:i.directory=t.endsWith(OA),e.files.has(t))throw new Error(nKe);let o=Yw(t);if(o.length>65535)throw new Error(rKe);let r=i.comment||"",s=Yw(r);if(s.length>65535)throw new Error(oKe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(ife);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(ife);let u=Ca(e,i,"lastModDate")||new Date,f=Ca(e,i,"lastAccessDate"),d=Ca(e,i,"creationDate"),p=Ca(e,i,"password"),g=Ca(e,i,"encryptionStrength")||3,h=Ca(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(sKe);let x=new Uint8Array(0),b=i.extraField;if(b){let B=0,V=0;b.forEach(U=>B+=4+U.length),x=new Uint8Array(B),b.forEach((U,G)=>{if(G>65535)throw new Error(aKe);if(U.length>65535)throw new Error(cKe);$s(x,new Uint16Array([G]),V),$s(x,new Uint16Array([U.length]),V+2),$s(x,U,V+4),V+=4+U.length})}let C=Ca(e,i,"extendedTimestamp");C===void 0&&(C=!0);let T=0,A=Ca(e,i,"keepOrder");A===void 0&&(A=!0);let S=0,v=Ca(e,i,"msDosCompatible");v===void 0&&(v=!0);let I=Ca(e,i,"internalFileAttribute")||0,O=Ca(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,T=hKe(S));let R=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||T>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!A)throw new Error(g7);R=!0}e.pendingCompressedSize+=T,await Promise.resolve();let N=Ca(e,i,"level"),F=Ca(e,i,"useWebWorkers"),_=Ca(e,i,"bufferedWrite"),E=Ca(e,i,"dataDescriptor"),w=Ca(e,i,"dataDescriptorSignature"),D=Ca(e,i,"signal");E===void 0&&(E=!0),E&&w===void 0&&(w=!1);let M=await uKe(e,t,n,Object.assign({},i,{rawFilename:o,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:x,zip64:R,password:p,level:N,useWebWorkers:F,encryptionStrength:g,extendedTimestamp:C,zipCrypto:h,bufferedWrite:_,keepOrder:A,dataDescriptor:E,dataDescriptorSignature:w,signal:D,msDosCompatible:v,internalFileAttribute:I,externalFileAttribute:O}));return T&&(e.pendingCompressedSize-=T),Object.assign(M,{name:t,comment:r,extraField:b}),new Bp(M)}async function uKe(e,t,n,i){let o=e.files,r=e.writer,s=Array.from(o.values()).pop(),a={},c,u,f;o.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(h=>f=h),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new PA,p.init(),c=!0):(e.lockWrite=new Promise(h=>u=h),r.initialized||await r.init(),p=r),a=await fKe(n,p,e.config,i),a.lock=g,o.set(t,a),a.filename=t,c){let h=0,x=p.getData();await Promise.all([e.lockWrite,d]);let b;do b=Array.from(o.values()).find(C=>C.writingBufferedData),b&&await b.lock;while(b&&b.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let T=await sfe(x,0,26),A=new DataView(T);(!a.encrypted||i.zipCrypto)&&fo(A,14,a.signature),a.zip64?(fo(A,18,4294967295),fo(A,22,4294967295)):(fo(A,18,a.compressedSize),fo(A,22,a.uncompressedSize)),await r.writeUint8Array(new Uint8Array(T)),h=26}await mKe(r,x,h),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let h=vd(a.rawExtraFieldZip64);dl(h,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(g7);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),o.delete(t),d}finally{f(),u&&u()}}async function fKe(e,t,n,i){let{rawFilename:o,lastAccessDate:r,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:h,versionMadeBy:x,rawComment:b,rawExtraField:C,useWebWorkers:T,onprogress:A,signal:S,encryptionStrength:v,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N}=i,F=!!(a&&a.length),_=c!==0&&!g,E;if(F&&!f){E=new Uint8Array(ofe.length+2);let we=vd(E);Xo(we,0,39169),$s(E,ofe,2),G3(we,8,v)}else E=new Uint8Array(0);let w,D;if(I){D=new Uint8Array(9+(r?4:0)+(s?4:0));let we=vd(D);Xo(we,0,21589),Xo(we,2,D.length-4);let ze=1+(r?2:0)+(s?4:0);G3(we,4,ze),fo(we,5,Math.floor(i.lastModDate.getTime()/1e3)),r&&fo(we,9,Math.floor(r.getTime()/1e3)),s&&fo(we,13,Math.floor(s.getTime()/1e3));try{w=new Uint8Array(36);let Oe=vd(w),ft=_7(i.lastModDate);Xo(Oe,0,10),Xo(Oe,2,32),Xo(Oe,8,1),Xo(Oe,10,24),dl(Oe,12,ft),dl(Oe,20,_7(r)||ft),dl(Oe,28,_7(s)||ft)}catch{w=new Uint8Array(0)}}else w=D=new Uint8Array(0);let M={version:h||20,versionMadeBy:x,zip64:u,directory:!!g,filenameUTF8:!0,rawFilename:o,commentUTF8:!0,rawComment:b,rawExtraFieldZip64:u?new Uint8Array(rfe+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:D,rawExtraFieldNTFS:w,rawExtraFieldAES:E,rawExtraField:C,extendedTimestamp:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N},B=M.uncompressedSize=0,V=2048;d&&(V=V|8);let U=0;_&&(U=8),u&&(M.version=M.version>45?M.version:45),F&&(V=V|1,f||(M.version=M.version>51?M.version:51,U=99,_&&(M.rawExtraFieldAES[9]=8))),M.compressionMethod=U;let G=M.headerArray=new Uint8Array(26),k=vd(G);Xo(k,0,M.version),Xo(k,2,V),Xo(k,4,U);let Y=new Uint32Array(1),j=vd(Y),$;i.lastModDate<e7?$=e7:i.lastModDate>QW?$=QW:$=i.lastModDate,Xo(j,0,($.getHours()<<6|$.getMinutes())<<5|$.getSeconds()/2),Xo(j,2,($.getFullYear()-1980<<4|$.getMonth()+1)<<5|$.getDate());let W=Y[0];fo(k,6,W),Xo(k,22,o.length);let K=E.length+D.length+w.length+M.rawExtraField.length;Xo(k,24,K);let J=new Uint8Array(30+o.length+K),he=vd(J);fo(he,0,67324752),$s(J,G,4),$s(J,o,30),$s(J,E,30+o.length),$s(J,D,30+o.length+E.length),$s(J,w,30+o.length+E.length+D.length),$s(J,M.rawExtraField,30+o.length+E.length+D.length+w.length);let ge,se=0;if(e){let we=await A3(n.Deflate,{codecType:b3,level:c,password:a,encryptionStrength:v,zipCrypto:F&&f,passwordVerification:F&&f&&W>>8&255,signed:!0,compressed:_,encrypted:F,useWebWorkers:T},n);await t.writeUint8Array(J),M.dataWritten=!0,ge=await E3(we,e,t,0,()=>e.size,n,{onprogress:A,signal:S}),B=M.uncompressedSize=e.size,se=ge.length}else await t.writeUint8Array(J),M.dataWritten=!0;let pe=new Uint8Array(0),xe,De=0;if(d&&(pe=new Uint8Array(u?p?24:20:p?16:12),xe=vd(pe),p&&(De=4,fo(xe,0,134695760))),e){let we=ge.signature;if((!F||f)&&we!==void 0&&(fo(k,10,we),M.signature=we,d&&fo(xe,De,we)),u){let ze=vd(M.rawExtraFieldZip64);Xo(ze,0,1),Xo(ze,2,rfe),fo(k,14,4294967295),dl(ze,12,BigInt(se)),fo(k,18,4294967295),dl(ze,4,BigInt(B)),d&&(dl(xe,De+4,BigInt(se)),dl(xe,De+12,BigInt(B)))}else fo(k,14,se),fo(k,18,B),d&&(fo(xe,De+4,se),fo(xe,De+8,B))}d&&await t.writeUint8Array(pe);let Se=J.length+se+pe.length;return Object.assign(M,{compressedSize:se,lastModDate:$,rawLastModDate:W,creationDate:s,lastAccessDate:r,encrypted:F,length:Se}),M}async function dKe(e,t,n){let i=e.writer,o=e.files,r=0,s=0,a=e.offset,c=o.size;for(let[,p]of o)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(g7);u=!0}let f=new Uint8Array(s+(u?98:22)),d=vd(f);if(t&&t.length)if(t.length<=65535)Xo(d,r+20,t.length);else throw new Error(iKe);for(let[p,g]of Array.from(o.values()).entries()){let{rawFilename:h,rawExtraFieldZip64:x,rawExtraFieldAES:b,rawExtraField:C,rawComment:T,versionMadeBy:A,headerArray:S,directory:v,zip64:I,msDosCompatible:O,internalFileAttribute:R,externalFileAttribute:N}=g,F,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,F=new Uint8Array(9);let w=vd(F);Xo(w,0,21589),Xo(w,2,F.length-4),G3(w,4,1),fo(w,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=F=new Uint8Array(0);let E=x.length+b.length+F.length+_.length+C.length;if(fo(d,r,33639248),Xo(d,r+4,A),$s(f,S,r+6),Xo(d,r+30,E),Xo(d,r+32,T.length),fo(d,r+34,R),N?fo(d,r+38,N):v&&O&&G3(d,r+38,16),I?fo(d,r+42,4294967295):fo(d,r+42,g.offset),$s(f,h,r+46),$s(f,x,r+46+h.length),$s(f,b,r+46+h.length+x.length),$s(f,F,r+46+h.length+x.length+b.length),$s(f,_,r+46+h.length+x.length+b.length+F.length),$s(f,C,r+46+h.length+x.length+b.length+F.length+_.length),$s(f,T,r+46+h.length+E),r+=46+h.length+E+T.length,n.onprogress)try{n.onprogress(p+1,o.size,new Bp(g))}catch{}}u&&(fo(d,r,101075792),dl(d,r+4,BigInt(44)),Xo(d,r+12,45),Xo(d,r+14,45),dl(d,r+24,BigInt(c)),dl(d,r+32,BigInt(c)),dl(d,r+40,BigInt(s)),dl(d,r+48,BigInt(a)),fo(d,r+56,117853008),dl(d,r+64,BigInt(a)+BigInt(s)),fo(d,r+72,1),c=65535,a=4294967295,s=4294967295,r+=76),fo(d,r,101010256),Xo(d,r+8,c),Xo(d,r+10,c),fo(d,r+12,s),fo(d,r+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function sfe(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(s.target.result),i.onerror=()=>r(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function mKe(e,t,n=0){await o();async function o(){if(n<t.size){let r=await sfe(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(r)),n+=536870912,await o()}}}function _7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ca(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function hKe(e){return e+5*(Math.floor(e/16383)+1)}function G3(e,t,n){e.setUint8(t,n)}function Xo(e,t,n){e.setUint16(t,n,!0)}function fo(e,t,n){e.setUint32(t,n,!0)}function dl(e,t,n){e.setBigUint64(t,n,!0)}function $s(e,t,n){e.set(t,n)}function vd(e){return new DataView(e.buffer)}SA({Deflate:$le,Inflate:bue});var y7=32,pKe="http://www.opengis.net/kml/2.2",Id="http://www.google.com/kml/ext/2.2",_Ke="http://www.w3.org/2000/xmlns/";function W3(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var gKe=/^data:image\/([^,;]+)/;W3.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof ve){if(e=ve.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(gKe);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function yKe(e,t){return function(n){e._files[t]=n}}W3.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(yKe(this,r))}return o};Object.defineProperties(W3.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function j3(e){this._time=e}j3.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};j3.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Ax(n)};j3.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function x7(){this._ids={},this._styles={},this._count=0}x7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};x7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function ufe(){this._ids={}}ufe.prototype.get=function(e){if(!l(e))return this.get(jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function b7(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=b7._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(_Ke,"xmlns:gx",Id);let a=r.createElement("Document");s.appendChild(a),dfe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?xKe(f,c.files):{kml:f,externalFiles:c.files}})}function xKe(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");SA({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new PA,o=new H3(i);return o.add("doc.kml",new w3(e)).then(function(){let r=Object.keys(t);return ffe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function ffe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new Cx(n[o])).then(function(){return ffe(e,t,n,i+1)})}b7._createState=function(e){let t=e.entities,n=new x7,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new Sn:ee.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&ee.addSeconds(r.start,10*s,r.stop);let a=new W3(e.modelCallback);return{kmlDoc:document.implementation.createDocument(pKe,"kml"),ellipsoid:y(e.ellipsoid,oe.WGS84),idManager:new ufe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new j3(o),sampleDuration:s,defaultAvailability:new Lr([r])}};function dfe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],bKe(e,p,u,f),CKe(e,p.polyline,u,f),lfe(e,p.rectangle,u,f,c),lfe(e,p.polygon,u,f,c),SKe(e,p,p.model,u,f);let g,h=p.availability;l(h)&&(g=i.createElement("TimeSpan"),ee.equals(h.start,Ge.MINIMUM_VALUE)||g.appendChild(pn(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,Ge.MAXIMUM_VALUE)||g.appendChild(pn(i,"end",ee.toIso8601(h.stop))));for(let C=0;C<c.length;++C){let T=c[C];T.setAttribute("id",s.get(p.id)),T.appendChild(pn(i,"name",p.name)),T.appendChild(pn(i,"visibility",p.show)),T.appendChild(pn(i,"description",p.description)),l(g)&&T.appendChild(g),t.appendChild(T)}let x=u.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let T=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),I=r.get(A.text);T=l(I)&&I.length>0?I:T;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(pn(i,"color",O)),v.appendChild(pn(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(pn(i,"scale",R)),f.push(v)}C.appendChild(pn(i,"name",T)),C.appendChild(pn(i,"visibility",p.show)),C.appendChild(pn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let S=f.length;if(S>0){let v=i.createElement("Style");for(let I=0;I<S;++I)v.appendChild(f[I]);C.appendChild(pn(i,"styleUrl",o.get(v)))}if(u.length===1)C.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let I=0;I<x;++I)v.appendChild(u[I]);C.appendChild(v)}}let b=p._children;if(b.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(pn(i,"name",p.name)),C.appendChild(pn(i,"visibility",p.show)),C.appendChild(pn(i,"description",p.description)),t.appendChild(C),dfe(e,C,b)}}}var ml=new m,Dc=new me,wd=new ee;function bKe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){mfe(e,t,a,n,i);return}s.get(c,void 0,ml);let u=pn(o,"coordinates",Tx(ml,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(Ex(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof sc?pfe(e,a):hfe(e,a);i.push(p)}function mfe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof ya?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof S_,p,g,h,x=[];for(p=0;p<c.length;++p){let C=c.get(p),T=f?u:C.data,A=r.createElement("altitudeMode");T instanceof Fp?(T=T._value,A.appendChild(Ex(e,qe.CLAMP_TO_GROUND))):l(n)?A.appendChild(Ex(e,n.heightReference)):A.appendChild(Ex(e,qe.NONE));let S=[],v=[];if(T.isConstant){a.get(T,void 0,ml);let O=pn(r,"coordinates",Tx(ml,s));S.push(ee.toIso8601(C.start)),v.push(O),S.push(ee.toIso8601(C.stop)),v.push(O)}else if(T instanceof xa)for(h=T._property._times,g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),T.getValueInReferenceFrame(h[g],oo.FIXED,ml),v.push(Tx(ml,s));else if(T instanceof of){h=T._times;let O=T._values;for(g=0;g<h.length;++g)S.push(ee.toIso8601(h[g])),m.fromArray(O,g*3,ml),v.push(Tx(ml,s))}else{let O=e.sampleDuration;C.start.clone(wd),C.isStartIncluded||ee.addSeconds(wd,O,wd);let R=C.stop;for(;ee.lessThan(wd,R);)T.getValue(wd,ml),S.push(ee.toIso8601(wd)),v.push(Tx(ml,s)),ee.addSeconds(wd,O,wd);C.isStopIncluded&&ee.equals(wd,R)&&(T.getValue(wd,ml),S.push(ee.toIso8601(wd)),v.push(Tx(ml,s)))}let I=r.createElementNS(Id,"Track");I.appendChild(A);for(let O=0;O<S.length;++O){let R=pn(r,"when",S[O]),N=pn(r,"coord",v[O],Id);I.appendChild(R),I.appendChild(N)}d&&I.appendChild(_fe(e,n)),x.push(I)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(Id,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!d){let C=n instanceof sc?pfe(e,n):hfe(e,n);o.push(C)}let b=t.path;if(l(b)){let C=a.get(b.width),T=b.material;if(l(T)||l(C)){let A=r.createElement("LineStyle");l(C)&&A.appendChild(pn(r,"width",C)),C7(e,T,A),o.push(A)}}}function hfe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(pn(n,"color",r)),o.appendChild(pn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(pn(n,"scale",s/y7)),o}function pfe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(pn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(pn(n,"x",g.x,Id)),p.appendChild(pn(n,"y",g.y,Id)),p.appendChild(pn(n,"w",g.width,Id)),p.appendChild(pn(n,"h",g.height,Id))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(pn(n,"color",a)),r.appendChild(pn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(pn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),H.divideByScalar(u,c,u);let p=i.get(t.width,y7),g=i.get(t.height,y7),h=i.get(t.horizontalOrigin,_i.CENTER);h===_i.CENTER?u.x-=p*.5:h===_i.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,Ln.CENTER);x===Ln.TOP?u.y+=g:x===Ln.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&m.equals(m.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(pn(n,"heading",f))),r}function CKe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(pn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=pn(o,"coordinates",Tx(p,r));a.appendChild(g);let h=s.get(t.zIndex);u&&l(h)&&a.appendChild(pn(o,"drawOrder",h,Id)),n.push(a);let x=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(pn(o,"width",b)),C7(e,t.material,x),i.push(x)}function TKe(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,Dc),c.push(`${P.toDegrees(Dc.longitude)},${P.toDegrees(Dc.latitude)},${r}`);let f=pn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function cfe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)me.fromCartesian(t[f],r,Dc),s.push(`${P.toDegrees(Dc.longitude)},${P.toDegrees(Dc.latitude)},${i?Dc.height:n}`);let c=pn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function AKe(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(cfe(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let h=0;h<g;++h){let x=i.createElement("innerBoundaryIs");x.appendChild(cfe(e,p[h].positions,r,s)),a.push(x)}}return a}function lfe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof fm;if(a&&s.getMaterialType(t.material)==="Image"){EKe(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(pn(r,"extrude",!0));let f=a?TKe(e,t,u):AKe(e,t,u),d=f.length;for(let b=0;b<d;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(Ex(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&g.appendChild(pn(r,"fill",h)),C7(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(pn(r,"outline",x));let b=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);b.appendChild(pn(r,"width",C));let T=s.getColor(t.outlineColor,z.BLACK);b.appendChild(pn(r,"color",T)),b.appendChild(pn(r,"colorMode","normal")),i.push(b)}i.push(g)}function EKe(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(Ex(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(pn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(pn(i,"north",P.toDegrees(u.north))),f.appendChild(pn(i,"south",P.toDegrees(u.south))),f.appendChild(pn(i,"east",P.toDegrees(u.east))),f.appendChild(pn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),g=i.createElement("Icon");g.appendChild(pn(i,"href",p)),s.appendChild(g);let h=d.color;l(h)&&s.appendChild(pn(i,"color",Ax(d.color))),n.push(s)}function _fe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(pn(n,"x",s)),u.appendChild(pn(n,"y",s)),u.appendChild(pn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(pn(n,"href",c)),r.appendChild(a),r}function SKe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){mfe(e,t,n,i,o);return}let u=_fe(e,n),f=r.createElement("altitudeMode");f.appendChild(Ex(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,ml),me.fromCartesian(ml,s,Dc);let d=r.createElement("Location");d.appendChild(pn(r,"longitude",P.toDegrees(Dc.longitude))),d.appendChild(pn(r,"latitude",P.toDegrees(Dc.latitude))),d.appendChild(pn(r,"altitude",Dc.height)),u.appendChild(d),i.push(u)}function C7(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=Ax(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=Ax(r.color);break;case"PolylineOutline":s=Ax(r.color),c=Ax(r.outlineColor),u=r.outlineWidth,n.appendChild(pn(i,"outerColor",c,Id)),n.appendChild(pn(i,"outerWidth",u,Id));break;case"Stripe":s=Ax(r.oddColor);break}l(s)&&(n.appendChild(pn(i,"color",s)),n.appendChild(pn(i,"colorMode","normal")))}function Ex(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,qe.NONE),r;switch(o){case qe.NONE:r=n.createTextNode("absolute");break;case qe.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case qe.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function Tx(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)me.fromCartesian(e[o],t,Dc),i.push(`${P.toDegrees(Dc.longitude)},${P.toDegrees(Dc.latitude)},${Dc.height}`);return i.join(" ")}function pn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function Ax(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var gfe=b7;function Qw(){this._cache={}}Qw.prototype.fromColor=function(e,t){return q3(void 0,void 0,e,t,this._cache)};Qw.prototype.fromUrl=function(e,t,n){return q3(e,void 0,t,n,this._cache)};Qw.prototype.fromMakiIconId=function(e,t,n){return q3(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Qw.prototype.fromText=function(e,t,n){return q3(void 0,e,t,n,this._cache)};var vKe=new z;function wKe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,vKe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function yfe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var $w=new Array(4);function q3(e,t,n,i,o){$w[0]=e,$w[1]=t,$w[2]=n,$w[3]=i;let r=JSON.stringify($w),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(wKe(c,n,i),l(e)){let f=ve.createIfNeeded(e).fetchImage().then(function(d){return yfe(c,d,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=aT(t,{font:`bold ${i}px sans-serif`});yfe(c,u,i)}return o[r]=a,a}var $g=Qw;function T7(e){return e}function Y3(e){if(e==null)return T7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+r,d[1]=(n+=a[1])*o+s;u<f;)d[u]=a[u],++u;return d}}function xfe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function A7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return bfe(e,n)})}:bfe(e,t)}function bfe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=E7(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function E7(e,t){var n=Y3(e.transform),i=e.arcs;function o(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,h=p.length;g<h;++g)d.push(n(p[g],g));f<0&&xfe(d,h)}function r(f){return n(f)}function s(f){for(var d=[],p=0,g=f.length;p<g;++p)o(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function X3(e){return m.fromDegrees(e[0],e[1],e[2])}var S7={"urn:ogc:def:crs:OGC:1.3:CRS84":X3,"EPSG:4326":X3,"urn:ogc:def:crs:EPSG::4326":X3},Cfe={},Tfe={},v7=48,w7,I7=z.ROYALBLUE,D7=z.YELLOW,P7=2,O7=z.fromBytes(255,255,0,100),R7=!1,RKe={small:24,medium:48,large:64},MKe=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Afe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||MKe.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Afe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function LKe(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function NKe(e,t){return new mm(LKe(Afe,e,t),!0)}function K3(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new ei(c):n(r,s))}return o}function M7(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Efe={Feature:vfe,FeatureCollection:FKe,GeometryCollection:wfe,LineString:Rfe,MultiLineString:Mfe,MultiPoint:Pfe,MultiPolygon:Ffe,Point:Dfe,Polygon:Nfe,Topology:Bfe},Sfe={GeometryCollection:wfe,LineString:Rfe,MultiLineString:Mfe,MultiPoint:Pfe,MultiPolygon:Ffe,Point:Dfe,Polygon:Nfe,Topology:Bfe};function vfe(e,t,n,i,o){if(t.geometry===null){K3(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new de("feature.geometry is required.");let r=t.geometry.type,s=Sfe[r];if(!l(s))throw new de(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function FKe(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)vfe(e,r[s],void 0,i,o)}function wfe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=Sfe[u];if(!l(f))throw new de(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function Ife(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=y(RKe[c["marker-size"]],a);let h=c["marker-symbol"];l(h)&&(r=h)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new sc;f.verticalOrigin=new ei(Ln.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=qe.CLAMP_TO_GROUND);let d=K3(t,e._entityCollection,o.describe);d.billboard=f,d.position=new Kc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new ei(g)}).catch(function(){f.image=new ei(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Dfe(e,t,n,i,o){Ife(e,t,i,n.coordinates,o)}function Pfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ife(e,t,i,r[s],o)}function Ofe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new ei(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=g),l(d)&&(r=new Vt(d))}let c=K3(t,e._entityCollection,o.describe),u=new _c;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new ei(M7(i,n)),u.arcType=Qt.RHUMB}function Rfe(e,t,n,i,o){Ofe(e,t,i,n.coordinates,o)}function Mfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ofe(e,t,i,r[s],o)}function Lfe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new ei(g));let h,x=c.stroke;l(x)&&(h=z.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(h)||(h=r.getValue().clone()),h.alpha=b),l(h)&&(r=new ei(h));let C,T=c.fill,A=s.color.getValue();l(T)&&(C=z.fromCssColorString(T),C.alpha=A.alpha),b=c["fill-opacity"],l(b)&&b!==A.alpha&&(l(C)||(C=A.clone()),C.alpha=b),l(C)&&(s=new Vt(C))}let u=new um;u.outline=new ei(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=Qt.RHUMB;let f=[];for(let g=1,h=i.length;g<h;g++)f.push(new Jc(M7(i[g],n)));let d=i[0];u.hierarchy=new ei(new Jc(M7(d,n),f)),d[0].length>2?u.perPositionHeight=new ei(!0):o.clampToGround||(u.height=0);let p=K3(t,e._entityCollection,o.describe);p.polygon=u}function Nfe(e,t,n,i,o){Lfe(e,t,i,n.coordinates,o)}function Ffe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Lfe(e,t,i,r[s],o)}function Bfe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=A7(n,n.objects[r]),a=Efe[s.type];a(e,s,s,i,o)}}function Qg(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new js(this),this._promises=[],this._pinBuilder=new $g,this._entityCluster=new tf,this._credit=void 0,this._resourceCredits=[]}Qg.load=function(e,t){return new Qg().load(e,t)};Object.defineProperties(Qg,{markerSize:{get:function(){return v7},set:function(e){v7=e}},markerSymbol:{get:function(){return w7},set:function(e){w7=e}},markerColor:{get:function(){return I7},set:function(e){I7=e}},stroke:{get:function(){return D7},set:function(e){D7=e}},strokeWidth:{get:function(){return P7},set:function(e){P7=e}},fill:{get:function(){return O7},set:function(e){O7=e}},clampToGround:{get:function(){return R7},set:function(e){R7=e}},crsNames:{get:function(){return S7}},crsLinkHrefs:{get:function(){return Cfe}},crsLinkTypes:{get:function(){return Tfe}}});Object.defineProperties(Qg.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Qg.prototype.load=function(e,t){return kfe(this,e,t,!0)};Qg.prototype.process=function(e,t){return kfe(this,e,t,!1)};function kfe(e,t,n,i){Nr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new wt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,NKe),markerSize:y(n.markerSize,v7),markerSymbol:y(n.markerSymbol,w7),markerColor:y(n.markerColor,I7),strokeWidthProperty:new ei(y(n.strokeWidth,P7)),strokeMaterialProperty:new Vt(y(n.stroke,D7)),fillMaterialProperty:new Vt(y(n.fill,O7)),clampToGround:y(n.clampToGround,R7)},Promise.resolve(r).then(function(a){return BKe(e,a,n,s,i)}).catch(function(a){throw Nr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Qg.prototype.update=function(e){return!0};function BKe(e,t,n,i,o){let r;l(i)&&(r=Dg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Efe[t.type];if(!l(s))throw new de(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?X3:null;if(l(a)){if(!l(a.properties))throw new de("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=S7[u.name],!l(c))throw new de(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Cfe[u.href];if(l(f)||(f=Tfe[u.type]),!l(f))throw new de(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=S7[`EPSG:${u.code}`],!l(c))throw new de(`Unknown crs EPSG code: ${u.code}`)}else throw new de(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Nr.setLoading(e,!1),e})})}var J3=Qg;function kKe(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Mn=kKe;var Ufe="4.0.0";function UKe(e){return e===void 0}function ou(e){return typeof e=="boolean"}function Vfe(e,t){for(var n in t)t.hasOwnProperty(n)&&UKe(e[n])&&(e[n]=t[n]);return e}function zfe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Uo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function ey(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function ty(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var ny=/[A-Za-z]/,ws=/[\d]/;var ru=/\s/,Z3=/['"]/,Hfe=/[\x00-\x1F\x7F]/,Gfe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,VKe=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,zKe=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,HKe=Gfe+VKe+zKe,Wfe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,g6n=new RegExp("[".concat(Gfe+Wfe,"]")),L7=HKe+Wfe,Dd=new RegExp("[".concat(L7,"]"));var $3=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(ru):[],o=t.split(ru),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(ru):[],o=t.split(ru),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function jfe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(T){var A={},S=T,v=S.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(T){var A="";return T.scheme&&T.host&&(A+=T.scheme+"://"),T.host&&(A+=T.host),T.path&&(A+="/"+T.path),T.query&&(A+="?"+T.query),T.fragment&&(A+="#"+T.fragment),A},a=function(T,A){var S=A/2,v=Math.ceil(S),I=-1*Math.floor(S),O="";return I<0&&(O=T.substr(I)),T.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var h="#"+u.fragment;if((d+h).length>=c){if((d+h).length==t)return(d+h).substr(0,t);var x=c-d.length;return(d+a(h,x)).substr(0,c+i)}else d+=h}if(u.scheme&&u.host){var b=u.scheme+"://";if((d+b).length<c)return(b+d).substr(0,t)}if(d.length<=t)return d;var C="";return c>0&&(C=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}function qfe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}function Yfe(e,t,n){return zfe(e,t,n)}var Xfe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new $3({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?jfe(t,i):o==="middle"?qfe(t,i):Yfe(t,i)},e}();var N7=function(e,t){return N7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},N7(e,t)};function Jm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");N7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Is=function(){return Is=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Is.apply(this,arguments)};var Zm=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var GKe="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",Kfe=new RegExp("^"+GKe+"$");var WKe=/[\/?#]/,jKe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Jfe=/[?!:,.;^]/,F7=/https?:\/\//i,Zfe=new RegExp("^"+F7.source,"i"),$fe=new RegExp(Jfe.source+"$"),qKe=/^(javascript|vbscript):/i,YKe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,XKe=/^(?:\/\/)?([^/#?:]+)/;function Q3(e){return ny.test(e)}function B7(e){return ny.test(e)||ws.test(e)||e==="+"||e==="-"||e==="."}function kp(e){return Dd.test(e)}function ek(e){return e==="_"||kp(e)}function k7(e){return Dd.test(e)||jKe.test(e)||Jfe.test(e)}function tk(e){return WKe.test(e)}function U7(e){return Kfe.test(e.toLowerCase())}function Qfe(e){if(qKe.test(e))return!1;var t=e.match(YKe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ny.test(i))}function ede(e){var t=e.match(XKe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!U7(o)}var KKe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,JKe=/[:/?#]/;function tde(e){var t=e.split(JKe,1)[0];return KKe.test(t)}var ZKe=/^(https?:\/\/)?(www\.)?/i,$Ke=/^\/\//,nde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=tJe(n)),this.stripPrefix.scheme&&(n=QKe(n)),this.stripPrefix.www&&(n=eJe(n)),this.stripTrailingSlash&&(n=nJe(n)),this.decodePercentEncoding&&(n=iJe(n)),n},t}(Zm);function QKe(e){return e.replace(Zfe,"")}function eJe(e){return e.replace(ZKe,"$1")}function tJe(e){return e.replace($Ke,"")}function nJe(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function iJe(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var ide=/^mailto:/i,oJe=new RegExp("[".concat(L7,"!#$%&'*+/=?^_`{|}~-]"));function ode(e){return Dd.test(e)}function nk(e){return oJe.test(e)}function rde(e){var t=e.split(".").pop()||"";return U7(t)}var sde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Zm);function V7(e){return e==="_"||Dd.test(e)}function ade(e){return e.length<=140}var cde=["twitter","facebook","instagram","tiktok"];var lde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw ty(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Zm);var rJe={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},sJe=/[-\w.]/;function z7(e){return sJe.test(e)}function ude(e,t){var n=rJe[t];return n.test(e)}var fde=["twitter","instagram","soundcloud","tiktok"];var dde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Zm);var aJe=/[-. ]/,cJe=/[-. ()]/,lJe=/[,;]/,uJe=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,fJe=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,dJe=new RegExp("^".concat(uJe.source,"|").concat(fJe.source,"$"));function H7(e){return aJe.test(e)}function ik(e){return lJe.test(e)}function mde(e){var t=e.charAt(0)==="+"||cJe.test(e);return t&&dJe.test(e)}var hde=function(e){Jm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Zm);function gde(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],d=0;d<u;d++){var p=e.charAt(d);if(f.length===0)b(p);else for(var g=f.length-1;g>=0;g--){var h=f[g];switch(h.state){case 11:I(h,p);break;case 12:O(h,p);break;case 0:C(h,p);break;case 1:T(h,p);break;case 2:A(h,p);break;case 3:S(h,p);break;case 4:v(h,p);break;case 5:R(h,p);break;case 6:N(h,p);break;case 7:F(h,p);break;case 13:_(h,p);break;case 14:E(h,p);break;case 8:w(h,p);break;case 9:D(h,p);break;case 10:M(h,p);break;case 15:B(h,p);break;case 16:V(h,p);break;case 17:U(h,p);break;case 18:G(h,p);break;case 19:k(h,p);break;case 20:Y(h,p);break;case 21:j(h,p);break;case 22:$(h,p);break;case 23:W(h,p);break;case 24:K(h,p);break;case 25:J(h,p);break;case 26:he(h,p);break;case 27:ge(h,p);break;case 28:se(h,p);break;case 29:pe(h,p);break;case 30:xe(h,p);break;case 31:De(h,p);break;case 32:we(h,p);break;case 33:ze(h,p);break;case 34:Oe(h,p);break;case 35:ft(h,p);break;case 36:Ct(h,p);break;case 37:Se(h,p);break;case 38:ot(h,p);break;case 39:sn(h,p);break;case 40:wn(h,p);break;case 41:zt(h,p);break;default:ty(h.state)}}}for(var x=f.length-1;x>=0;x--)f.forEach(function(be){return Bt(be)});return c;function b(be){if(be==="#")f.push(gJe(d,28));else if(be==="@")f.push(yJe(d,30));else if(be==="/")f.push(W7(d,11));else if(be==="+")f.push(j7(d,37));else if(be==="(")f.push(j7(d,32));else{if(ws.test(be)&&(f.push(j7(d,38)),f.push(pJe(d,13))),ode(be)){var Ee=be.toLowerCase()==="m"?15:22;f.push(_Je(d,Ee))}Q3(be)&&f.push(G7(d,0)),Dd.test(be)&&f.push(W7(d,5))}}function C(be,Ee){Ee===":"?be.state=2:Ee==="-"?be.state=1:B7(Ee)||Uo(f,be)}function T(be,Ee){Ee==="-"||(Ee==="/"?(Uo(f,be),f.push(W7(d,11))):B7(Ee)?be.state=0:Uo(f,be))}function A(be,Ee){Ee==="/"?be.state=3:Ee==="."?Uo(f,be):kp(Ee)?(be.state=5,Q3(Ee)&&f.push(G7(d,0))):Uo(f,be)}function S(be,Ee){Ee==="/"?be.state=4:k7(Ee)?(be.state=10,be.acceptStateReached=!0):Bt(be)}function v(be,Ee){Ee==="/"?be.state=10:kp(Ee)?(be.state=5,be.acceptStateReached=!0):Uo(f,be)}function I(be,Ee){Ee==="/"?be.state=12:Uo(f,be)}function O(be,Ee){kp(Ee)?be.state=5:Uo(f,be)}function R(be,Ee){Ee==="."?be.state=7:Ee==="-"?be.state=6:Ee===":"?be.state=8:tk(Ee)?be.state=10:ek(Ee)||Bt(be)}function N(be,Ee){Ee==="-"||(Ee==="."?Bt(be):kp(Ee)?be.state=5:Bt(be))}function F(be,Ee){Ee==="."?Bt(be):kp(Ee)?(be.state=5,be.acceptStateReached=!0):Bt(be)}function _(be,Ee){Ee==="."?be.state=14:Ee===":"?be.state=8:ws.test(Ee)||(tk(Ee)?be.state=10:Dd.test(Ee)?Uo(f,be):Bt(be))}function E(be,Ee){ws.test(Ee)?(be.octetsEncountered++,be.octetsEncountered===4&&(be.acceptStateReached=!0),be.state=13):Bt(be)}function w(be,Ee){ws.test(Ee)?be.state=9:Bt(be)}function D(be,Ee){ws.test(Ee)||(tk(Ee)?be.state=10:Bt(be))}function M(be,Ee){k7(Ee)||Bt(be)}function B(be,Ee){Ee.toLowerCase()==="a"?be.state=16:$(be,Ee)}function V(be,Ee){Ee.toLowerCase()==="i"?be.state=17:$(be,Ee)}function U(be,Ee){Ee.toLowerCase()==="l"?be.state=18:$(be,Ee)}function G(be,Ee){Ee.toLowerCase()==="t"?be.state=19:$(be,Ee)}function k(be,Ee){Ee.toLowerCase()==="o"?be.state=20:$(be,Ee)}function Y(be,Ee){Ee.toLowerCase()===":"?be.state=21:$(be,Ee)}function j(be,Ee){nk(Ee)?be.state=22:Uo(f,be)}function $(be,Ee){Ee==="."?be.state=23:Ee==="@"?be.state=24:nk(Ee)?be.state=22:Uo(f,be)}function W(be,Ee){Ee==="."?Uo(f,be):Ee==="@"?Uo(f,be):nk(Ee)?be.state=22:Uo(f,be)}function K(be,Ee){kp(Ee)?be.state=25:Uo(f,be)}function J(be,Ee){Ee==="."?be.state=27:Ee==="-"?be.state=26:ek(Ee)||Bt(be)}function he(be,Ee){Ee==="-"||Ee==="."?Bt(be):ek(Ee)?be.state=25:Bt(be)}function ge(be,Ee){Ee==="."||Ee==="-"?Bt(be):kp(Ee)?(be.state=25,be.acceptStateReached=!0):Bt(be)}function se(be,Ee){V7(Ee)?(be.state=29,be.acceptStateReached=!0):Uo(f,be)}function pe(be,Ee){V7(Ee)||Bt(be)}function xe(be,Ee){z7(Ee)?(be.state=31,be.acceptStateReached=!0):Uo(f,be)}function De(be,Ee){z7(Ee)||(Dd.test(Ee)?Uo(f,be):Bt(be))}function Se(be,Ee){ws.test(Ee)?be.state=38:(Uo(f,be),b(Ee))}function we(be,Ee){ws.test(Ee)?be.state=33:Uo(f,be),b(Ee)}function ze(be,Ee){ws.test(Ee)?be.state=34:Uo(f,be)}function Oe(be,Ee){ws.test(Ee)?be.state=35:Uo(f,be)}function ft(be,Ee){Ee===")"?be.state=36:Uo(f,be)}function Ct(be,Ee){ws.test(Ee)?be.state=38:H7(Ee)?be.state=39:Uo(f,be)}function ot(be,Ee){be.acceptStateReached=!0,ik(Ee)?be.state=40:Ee==="#"?be.state=41:ws.test(Ee)||(Ee==="("?be.state=32:H7(Ee)?be.state=39:(Bt(be),Q3(Ee)&&f.push(G7(d,0))))}function sn(be,Ee){ws.test(Ee)?be.state=38:Ee==="("?be.state=32:(Bt(be),b(Ee))}function wn(be,Ee){ik(Ee)||(Ee==="#"?be.state=41:ws.test(Ee)?be.state=38:Bt(be))}function zt(be,Ee){ik(Ee)?be.state=40:ws.test(Ee)?Uo(f,be):Bt(be)}function Bt(be){if(Uo(f,be),!!be.acceptStateReached){var Ee=be.startIdx,at=e.slice(be.startIdx,d);if(at=hJe(at),be.type==="url"){var Jt=e.charAt(be.startIdx-1);if(Jt==="@")return;var ri=be.matchType;if(ri==="scheme"){var Ze=F7.exec(at);if(Ze&&(Ee=Ee+Ze.index,at=at.slice(Ze.index)),!Qfe(at))return}else if(ri==="tld"){if(!ede(at))return}else if(ri==="ipV4"){if(!tde(at))return}else ty(ri);c.push(new nde({tagBuilder:n,matchedText:at,offset:Ee,urlMatchType:ri,url:at,protocolRelativeMatch:at.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(be.type==="email")rde(at)&&c.push(new sde({tagBuilder:n,matchedText:at,offset:Ee,email:at.replace(ide,"")}));else if(be.type==="hashtag")ade(at)&&c.push(new lde({tagBuilder:n,matchedText:at,offset:Ee,serviceName:s,hashtag:at.slice(1)}));else if(be.type==="mention")ude(at,a)&&c.push(new dde({tagBuilder:n,matchedText:at,offset:Ee,serviceName:a,mention:at.slice(1)}));else if(be.type==="phone"){if(at=at.replace(/ +$/g,""),mde(at)){var zr=at.replace(/[^0-9,;#]/g,"");c.push(new hde({tagBuilder:n,matchedText:at,offset:Ee,number:zr,plusSign:at.charAt(0)==="+"}))}}else ty(be)}}}var mJe=/[\(\{\[]/,pde=/[\)\}\]]/,_de={")":"(","}":"{","]":"["};function hJe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);mJe.test(i)?t[i]++:pde.test(i)&&t[_de[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),pde.test(r)){var s=_de[r];if(t[s]<0)t[s]++,o--;else break}else if($fe.test(r))o--;else break;return e.slice(0,o+1)}function G7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function W7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function pJe(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function _Je(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function gJe(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function yJe(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function j7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function yde(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new $m,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:h(g);break;case 1:x(g);break;case 2:C(g);break;case 3:b(g);break;case 4:T(g);break;case 5:A(g);break;case 6:S(g);break;case 7:v(g);break;case 8:I(g);break;case 9:O(g);break;case 10:R(g);break;case 11:N(g);break;case 12:F(g);break;case 13:_(g);break;case 14:E(g);break;case 15:w(g);break;case 16:D(g);break;case 17:M(g);break;case 18:B(g);break;case 19:V(g);break;case 20:U(g);break;default:ty(f)}c++}d<c&&j();function h(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new $m(Is(Is({},p),{isClosing:!0}))):K==="<"?k():ny.test(K)?(f=3,p=new $m(Is(Is({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){ru.test(K)?(p=new $m(Is(Is({},p),{name:$()})),f=4):K==="<"?k():K==="/"?(p=new $m(Is(Is({},p),{name:$()})),f=12):K===">"?(p=new $m(Is(Is({},p),{name:$()})),Y()):!ny.test(K)&&!ws.test(K)&&K!==":"&&G()}function C(K){K===">"?G():ny.test(K)?f=3:G()}function T(K){ru.test(K)||(K==="/"?f=12:K===">"?Y():K==="<"?k():K==="="||Z3.test(K)||Hfe.test(K)?G():f=5)}function A(K){ru.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():Z3.test(K)&&G()}function S(K){ru.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?Y():K==="<"?k():Z3.test(K)?G():f=5)}function v(K){ru.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function I(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){ru.test(K)?f=4:K===">"?Y():K==="<"&&k()}function N(K){ru.test(K)?f=4:K==="/"?f=12:K===">"?Y():K==="<"?k():(f=4,W())}function F(K){K===">"?(p=new $m(Is(Is({},p),{isClosing:!0})),Y()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new $m(Is(Is({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new $m(Is(Is({},p),{type:"doctype"})),f=20):G()}function E(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function D(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function B(K){K===">"?Y():K==="!"?f=19:K==="-"||(f=16)}function V(K){K==="-"?f=17:K===">"?Y():f=16}function U(K){K===">"?Y():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new $m({idx:c})}function Y(){var K=e.slice(d,p.idx);K&&o(K,d),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function j(){var K=e.slice(d,c);o(K,d),d=c+1}function $(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}var $m=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var xJe=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=bJe(t.urls),this.email=ou(t.email)?t.email:this.email,this.phone=ou(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=ou(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=CJe(t.stripPrefix),this.stripTrailingSlash=ou(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=ou(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&fde.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&cde.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=TJe(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return yde(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);r.push.apply(r,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||ey(t,function(n){return n.getType()==="hashtag"}),this.email||ey(t,function(n){return n.getType()==="email"}),this.phone||ey(t,function(n){return n.getType()==="phone"}),this.mention||ey(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=gde(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof $3)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Xfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Ufe,e}(),xde=xJe;function bJe(e){return e==null&&(e=!0),ou(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:ou(e.schemeMatches)?e.schemeMatches:!0,tldMatches:ou(e.tldMatches)?e.tldMatches:!0,ipV4Matches:ou(e.ipV4Matches)?e.ipV4Matches:!0}}function CJe(e){return e==null&&(e=!0),ou(e)?{scheme:e,www:e}:{scheme:ou(e.scheme)?e.scheme:!0,www:ou(e.www)?e.www:!0}}function TJe(e){return typeof e=="number"?{length:e,location:"end"}:Vfe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var ok=xde;var Ide;typeof DOMParser<"u"&&(Ide=new DOMParser);var AJe=new ok({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),rk=32,bde=2414016,Cde=1,Tde=16093e3,Ade=.1,EJe=[null,void 0,"http://www.topografix.com/GPX/1/1"],Eo={gpx:EJe};function SJe(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function q7(e,t){let n=nI(e,"id");return n=l(n)?n:jn(),t.getOrCreateEntity(n)}function Y7(e){let t=Ede(e,"lon"),n=Ede(e,"lat"),i=eI(e,"ele",Eo.gpx);return m.fromDegrees(t,n,i)}function Ede(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function nI(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function iy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function X7(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function eI(e,t,n){let i=iy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function hl(e,t,n){let i=iy(e,t,n);if(l(i))return i.textContent.trim()}function Dde(e){let t=new sc;return t.width=rk,t.height=rk,t.scaleByDistance=new Rt(bde,Cde,Tde,Ade),t.pixelOffsetScaleByDistance=new Rt(bde,Cde,Tde,Ade),t.verticalOrigin=new ei(Ln.BOTTOM),t.image=e,t}function vJe(){let e=new lm;return e.translucencyByDistance=new Rt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=jo.FILL_AND_OUTLINE,e}function Pde(e){let t=new _c;return t.width=4,t.material=new sx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var Sde={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},tI;typeof document<"u"&&(tI=document.createElement("div"));function K7(e,t){let n,i="",o=Object.keys(Sde),r=o.length;for(n=0;n<r;n++){let f=o[n],d=Sde[f];d.value=y(hl(e,d.tag,Eo.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=AJe.link(i),tI.innerHTML=i;let s=tI.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${tI.innerHTML}</div>`,tI.innerHTML="",u}function Ode(e,t,n,i){let o=Y7(t),r=q7(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,rk);r.billboard=Dde(s);let a=hl(t,"name",Eo.gpx);r.name=a,r.label=vJe(),r.label.text=a,r.description=K7(t,r),i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND,r.label.heightReference=qe.CLAMP_TO_GROUND)}function wJe(e,t,n,i){let o=q7(t,n);o.description=K7(t,o);let r=X7(t,"rtept",Eo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)Ode(e,r[a],n,i),s[a]=Y7(r[a]);o.polyline=Pde(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function IJe(e,t,n,i){let o=q7(t,n);o.description=K7(t,o);let r=X7(t,"trkseg",Eo.gpx),s=[],a=[],c,u=!0,f=new xa;for(let d=0;d<r.length;d++)c=DJe(r[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,rk);o.billboard=Dde(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND),o.availability=new Lr,o.availability.addInterval(new Sn({start:a[0],stop:a[a.length-1]}))}o.polyline=Pde(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function DJe(e){let t={positions:[],times:[]},n=X7(e,"trkpt",Eo.gpx),i;for(let o=0;o<n.length;o++){let r=Y7(n[o]);t.positions.push(r),i=hl(n[o],"time",Eo.gpx),l(i)&&t.times.push(ee.fromIso8601(i))}return t}function PJe(e){let t=iy(e,"metadata",Eo.gpx);if(l(t)){let n={name:hl(t,"name",Eo.gpx),desc:hl(t,"desc",Eo.gpx),author:OJe(t),copyright:MJe(t),link:Rde(t),time:hl(t,"time",Eo.gpx),keywords:hl(t,"keywords",Eo.gpx),bounds:LJe(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function OJe(e){let t=iy(e,"author",Eo.gpx);if(l(t)){let n={name:hl(t,"name",Eo.gpx),email:RJe(t),link:Rde(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function RJe(e){let t=iy(e,"email",Eo.gpx);if(l(t)){let n=hl(t,"id",Eo.gpx),i=hl(t,"domain",Eo.gpx);return`${n}@${i}`}}function Rde(e){let t=iy(e,"link",Eo.gpx);if(l(t)){let n={href:nI(t,"href"),text:hl(t,"text",Eo.gpx),mimeType:hl(t,"type",Eo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function MJe(e){let t=iy(e,"copyright",Eo.gpx);if(l(t)){let n={author:nI(t,"author"),year:hl(t,"year",Eo.gpx),license:hl(t,"license",Eo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function LJe(e){let t=iy(e,"bounds",Eo.gpx);if(l(t)){let n={minLat:eI(t,"minlat",Eo.gpx),maxLat:eI(t,"maxlat",Eo.gpx),minLon:eI(t,"minlon",Eo.gpx),maxLon:eI(t,"maxlon",Eo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var vde={wpt:Ode,rte:wJe,trk:IJe};function NJe(e,t,n,i){let o=Object.keys(vde),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=vde[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Eo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function wde(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=nI(o,"version"),s=nI(o,"creator"),a,c=PJe(o);l(c)&&(a=c.name),o.localName==="gpx"?NJe(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=ee.equals(d,Ge.MINIMUM_VALUE),h=ee.equals(p,Ge.MAXIMUM_VALUE);if(!g||!h){let b;g&&(b=new Date,b.setHours(0,0,0,0),d=ee.fromDate(b)),h&&(b=new Date,b.setHours(24,0,0,0),p=ee.fromDate(b)),u=new km,u.startTime=d,u.stopTime=p,u.currentTime=ee.clone(d),u.clockRange=Fr.LOOP_STOP,u.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,d)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),FJe(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),Nr.setLoading(e,!1),e}function FJe(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function BJe(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?SJe(r).then(function(s){let a,c;try{a=Ide.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new de(u)}return wde(e,a,i)}):wde(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function LA(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new js(this),this._entityCluster=new tf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new $g}LA.load=function(e,t){return new LA().load(e,t)};Object.defineProperties(LA.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});LA.prototype.update=function(e){return!0};LA.prototype.load=function(e,t){if(!l(e))throw new fe("data is required.");t=y(t,y.EMPTY_OBJECT),Nr.setLoading(this,!0);let n=this._name,i=this;return BJe(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=ee.equals(s,Ge.MINIMUM_VALUE),u=ee.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),o=new km,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=Fr.LOOP_STOP,o.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Nr.setLoading(i,!1),i}).catch(function(o){return Nr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var sk=LA;function kJe(e,t){this.position=e,this.headingPitchRoll=t}var ak=kJe;var rI=ur(Dl(),1);function UJe(e,t){this.position=e,this.headingPitchRange=t}var ck=UJe;function lk(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}lk.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};lk.prototype.play=function(e,t){l(e.cesiumWidget)&&Q("viewer","The viewer parameter has been deprecated in Cesium 1.99. It will be removed in 1.100. Instead of a Viewer, pass a CesiumWidget instead."),this.tourStart.raiseEvent();let n=this;Lde.call(this,e,t,function(i){n.playlistIndex=0,i||Mde(n._activeEntries),n.tourEnd.raiseEvent(i)})};lk.prototype.stop=function(){Mde(this._activeEntries)};function Mde(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Lde(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=VJe.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function VJe(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Lde.call(this,e,t,n)}}var uk=lk;var Fi={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Fi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Fi.Bounce.In(e*2)*.5:Fi.Bounce.Out(e*2-1)*.5+.5}}},iI;typeof self>"u"&&typeof process<"u"&&process.hrtime?iI=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?iI=self.performance.now.bind(self.performance):Date.now!==void 0?iI=Date.now:iI=function(){return new Date().getTime()};var NA=iI,zJe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=NA()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&delete this._tweens[i[o]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),oI={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=oI.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=oI.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=oI.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=oI.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},Nde=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Fde=new zJe,Bde=function(){function e(t,n){n===void 0&&(n=Fde),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Fi.Linear.None,this._interpolationFunction=oI.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Nde.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),n!==void 0&&(this._duration=n),this},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t!==void 0?typeof t=="string"?NA()+parseFloat(t):t:NA(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(t,n,i,o){for(var r in i){var s=t[r],a=Array.isArray(s),c=a?"array":typeof s,u=!a&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(u){var f=i[r];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[r]=[s].concat(f)}if((c==="object"||a)&&s&&!u){n[r]=a?[]:{};for(var d in s)n[r][d]=s[d];o[r]=a?[]:{},this._setupProperties(s,n[r],i[r],o[r])}else typeof n[r]>"u"&&(n[r]=s),a||(n[r]*=1),u?o[r]=i[r].slice().reverse():o[r]=n[r]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=NA()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=NA()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return this._group=t,this},e.prototype.delay=function(t){return this._delayTime=t,this},e.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return this._yoyo=t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.interpolation=function(t){return this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){if(t===void 0&&(t=NA()),n===void 0&&(n=!0),this._isPaused)return!0;var i,o,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;n&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),o=(t-this._startTime)/this._duration,o=this._duration===0||o>1?1:o;var s=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),o===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}();var NWn=Nde.nextId,Qm=Fde,FWn=Qm.getAll.bind(Qm),BWn=Qm.removeAll.bind(Qm),kWn=Qm.add.bind(Qm),UWn=Qm.remove.bind(Qm),VWn=Qm.update.bind(Qm);var HJe={LINEAR_NONE:Fi.Linear.None,QUADRATIC_IN:Fi.Quadratic.In,QUADRATIC_OUT:Fi.Quadratic.Out,QUADRATIC_IN_OUT:Fi.Quadratic.InOut,CUBIC_IN:Fi.Cubic.In,CUBIC_OUT:Fi.Cubic.Out,CUBIC_IN_OUT:Fi.Cubic.InOut,QUARTIC_IN:Fi.Quartic.In,QUARTIC_OUT:Fi.Quartic.Out,QUARTIC_IN_OUT:Fi.Quartic.InOut,QUINTIC_IN:Fi.Quintic.In,QUINTIC_OUT:Fi.Quintic.Out,QUINTIC_IN_OUT:Fi.Quintic.InOut,SINUSOIDAL_IN:Fi.Sinusoidal.In,SINUSOIDAL_OUT:Fi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Fi.Sinusoidal.InOut,EXPONENTIAL_IN:Fi.Exponential.In,EXPONENTIAL_OUT:Fi.Exponential.Out,EXPONENTIAL_IN_OUT:Fi.Exponential.InOut,CIRCULAR_IN:Fi.Circular.In,CIRCULAR_OUT:Fi.Circular.Out,CIRCULAR_IN_OUT:Fi.Circular.InOut,ELASTIC_IN:Fi.Elastic.In,ELASTIC_OUT:Fi.Elastic.Out,ELASTIC_IN_OUT:Fi.Elastic.InOut,BACK_IN:Fi.Back.In,BACK_OUT:Fi.Back.Out,BACK_IN_OUT:Fi.Back.InOut,BOUNCE_IN:Fi.Bounce.In,BOUNCE_OUT:Fi.Bounce.Out,BOUNCE_IN_OUT:Fi.Bounce.InOut},Br=Object.freeze(HJe);function fk(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}fk.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ae(this.view.position);t.flyToBoundingSphere(o,i)}};fk.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};fk.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Br.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=_t(t,e)),t};var dk=fk;function J7(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}J7.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};J7.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var mk=J7;var Yde={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=Pb(t),Yde[t]}},ij;typeof DOMParser<"u"&&(ij=new DOMParser);var GJe=new ok({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),oy=32,kde=2414016,Ude=1,Vde=16093e3,zde=.1,Hde=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Gde=["http://www.google.com/kml/ext/2.2"],WJe=["http://www.w3.org/2005/Atom"],Le={kml:Hde,gx:Gde,atom:WJe,kmlgx:Hde.concat(Gde)},oj={Document:ime,Folder:lZe,Placemark:uZe,NetworkLink:xZe,GroundOverlay:_Ze,PhotoOverlay:sme,ScreenOverlay:pZe,Tour:dZe};function eh(e){this._dataSource=e,this._deferred=ua(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(eh.prototype,{dataSource:{get:function(){return this._dataSource}}});eh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};eh.prototype.addPromise=function(e){this._promises.push(e)};eh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};eh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=cu._getTimestamp()),this._process(e)};eh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=cu._getTimestamp(),e._process(!0)},0)};eh.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};eh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};eh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=oj[i.localName];if(l(o)&&(Le.kml.indexOf(i.namespaceURI)!==-1||Le.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||cu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function jJe(e){let t=e.slice(0,Math.min(4,e.size)),n=ua(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function qJe(e){let t=ua(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function Xde(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function Kde(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function YJe(e,t){return Promise.resolve(e.getData(new I3)).then(function(n){n=Xde(n),n=Kde(n),t.kml=ij.parseFromString(n,"application/xml")})}function Z7(e,t){let n=y(Yde.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new D3(n))).then(function(i){t[e.filename]=i})}function su(e,t,n,i){let o=i.keys,r=new rI.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new rI.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function au(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=rj(a,i);l(c)&&s.setAttribute(n,c.url)}}function Jde(e,t,n){let i=us(e,"id");i=l(i)&&i.length!==0?i:jn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=jn(),l(n)&&(i=n+i)),o=t.add(new nr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new AZe),o}function sI(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function gk(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,m.fromDegrees(i,o,r,t)}function hk(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=gk(n[s],t);return o}function ry(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function us(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function vi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Wde(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Pd(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ti(e,t,n){let i=vi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pn(e,t,n){let i=vi(e,t,n);if(l(i))return i.textContent.trim()}function Od(e,t,n){let i=vi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function rj(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new ve({url:o});else{let r=new rI.default(t.getUrlComponent()),s=new rI.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var pl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function tj(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(pl.maximumRed=r,pl.red=void 0):(pl.maximumRed=void 0,pl.red=0),o>0?(pl.maximumGreen=o,pl.green=void 0):(pl.maximumGreen=void 0,pl.green=0),i>0?(pl.maximumBlue=i,pl.blue=void 0):(pl.maximumBlue=void 0,pl.blue=0),pl.alpha=n,z.fromRandom(pl)):new z(r,o,i,n)}function Sx(e,t,n){let i=Pn(e,t,n);if(l(i))return tj(i,Pn(e,"colorMode",n)==="random")}function XJe(e){let t=vi(e,"TimeStamp",Le.kmlgx),n=Pn(t,"when",Le.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),o=new Lr;return o.addInterval(new Sn({start:i,stop:Ge.MAXIMUM_VALUE})),o}function KJe(e){let t=vi(e,"TimeSpan",Le.kmlgx);if(!l(t))return;let n,i=vi(t,"begin",Le.kmlgx),o=l(i)?ee.fromIso8601(i.textContent):void 0,r=vi(t,"end",Le.kmlgx),s=l(r)?ee.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(ee.lessThan(s,o)){let a=o;o=s,s=a}n=new Lr,n.addInterval(new Sn({start:o,stop:s}))}else l(o)?(n=new Lr,n.addInterval(new Sn({start:o,stop:Ge.MAXIMUM_VALUE}))):l(s)&&(n=new Lr,n.addInterval(new Sn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function Zde(){let e=new sc;return e.width=oy,e.height=oy,e.scaleByDistance=new Rt(kde,Ude,Vde,zde),e.pixelOffsetScaleByDistance=new Rt(kde,Ude,Vde,zde),e}function sj(){let e=new um;return e.outline=!0,e.outlineColor=z.WHITE,e}function $de(){let e=new lm;return e.translucencyByDistance=new Rt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=jo.FILL_AND_OUTLINE,e}function aj(e,t,n,i,o){let r=Pn(e,"href",Le.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(ti(e,"x",Le.gx),0),u=y(ti(e,"y",Le.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=rj(r,n,i);if(o){let a=Pn(e,"refreshMode",Le.kml),c=Pn(e,"viewRefreshMode",Le.kml);a==="onInterval"||a==="onExpire"?Nt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Nt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Pn(e,"viewBoundScale",Le.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Pn(e,"viewFormat",Le.kml),f),p=Pn(e,"httpQuery",Le.kml);l(d)&&s.setQueryParameters(Iu(_k(d))),l(p)&&s.setQueryParameters(Iu(_k(p)));let g=t._ellipsoid;return lj(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function JJe(e,t,n,i,o){let r=ti(t,"scale",Le.kml),s=ti(t,"heading",Le.kml),a=Sx(t,"color",Le.kml),c=vi(t,"Icon",Le.kml),u=aj(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=ti(c,"x",Le.gx),d=ti(c,"y",Le.gx),p=ti(c,"w",Le.gx),g=ti(c,"h",Le.gx),h=vi(t,"hotSpot",Le.kml),x=ry(h,"x"),b=ry(h,"y"),C=us(h,"xunits"),T=us(h,"yunits"),A=n.billboard;l(A)||(A=Zde(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(d)||l(p)||l(g))&&(A.imageSubRegion=new Ke(f,d,p,g)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=m.UNIT_Z),r=y(r,1);let S,v;l(x)&&(C==="pixels"?S=-x*r:C==="insetPixels"?S=(x-oy)*r:C==="fraction"&&(S=-x*oy*r),S+=oy*.5*r),l(b)&&(T==="pixels"?v=b*r:T==="insetPixels"?v=(-b+oy)*r:T==="fraction"&&(v=b*oy*r),v-=oy*.5*r),(l(S)||l(v))&&(A.pixelOffset=new H(S,v))}function pk(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")JJe(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=$de(),n.label=c),c.scale=y(ti(a,"scale",Le.kml),c.scale),c.fillColor=y(Sx(a,"color",Le.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new _c,n.polyline=c),c.width=ti(a,"width",Le.kml),c.material=Sx(a,"color",Le.kml),l(Sx(a,"outerColor",Le.gx))&&Nt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ti(a,"outerWidth",Le.gx))&&Nt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ti(a,"physicalWidth",Le.gx))&&Nt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Od(a,"labelVisibility",Le.gx))&&Nt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=sj(),n.polygon=c),c.material=y(Sx(a,"color",Le.kml),c.material),c.fill=y(Od(a,"fill",Le.kml),c.fill),c.outline=y(Od(a,"outline",Le.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(tj(Pn(a,"bgColor",Le.kml)),z.WHITE),u=y(tj(Pn(a,"textColor",Le.kml)),z.BLACK),f=Pn(a,"text",Le.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",Le.kml);(c==="radioFolder"||c==="checkOffOnly")&&Nt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function ZJe(e,t,n,i,o){let r=new nr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")pk(e,d,r,i,o);else{let p=Pd(d,"Pair",Le.kml);for(let g=0;g<p.length;g++){let h=p[g],x=Pn(h,"key",Le.kml);if(x==="normal"){let b=Pn(h,"styleUrl",Le.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let C=vi(h,"Style",Le.kml);pk(e,C,r,i,o)}}else Nt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Pn(t,"styleUrl",Le.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&r.merge(s)}return r}function $Je(e,t,n){return t.fetchXML().then(function(i){return Qde(e,i,n,t,!0)})}function Qde(e,t,n,i,o,r){let s,a,c,u,f=Wde(t,"Style",Le.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=us(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new nr({id:a}),n.add(c),pk(e,u,c,i,r)))}let d=Wde(t,"StyleMap",Le.kml);if(l(d)){let x=d.length;for(s=0;s<x;s++){let b=d[s];if(a=us(b,"id"),l(a)){let C=Pd(b,"Pair",Le.kml);for(let T=0;T<C.length;T++){let A=C[T],S=Pn(A,"key",Le.kml);if(S==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Pn(A,"styleUrl",Le.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),o&&l(i)&&(v=i.getUrlComponent()+v);let I=n.getById(v);l(I)&&c.merge(I)}else u=vi(A,"Style",Le.kml),pk(e,u,c,i,r)}}else Nt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),h=g.length;for(s=0;s<h;s++){let x=g[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let C=b[0],T=i.getDerivedResource({url:C});p.push($Je(e,T,n))}}}return p}function cj(e,t,n){let i=new Rg(e,t.id,["position"]),o=new Fp(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new _c,t.polyline.positions=new Pg([i,o])}function eme(e,t){return!l(e)&&!l(t)||e==="clampToGround"?qe.CLAMP_TO_GROUND:e==="relativeToGround"?qe.RELATIVE_TO_GROUND:e==="absolute"?qe.NONE:t==="clampToSeaFloor"?(Nt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Nt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),qe.RELATIVE_TO_GROUND):(l(e)?Nt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Nt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function QJe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Fp(e))}function eZe(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function yk(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():$de(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():Zde(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new H(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function tme(e,t){let n=e.path;l(n)||(n=new v_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function tZe(e,t,n,i,o){let r=Pn(n,"coordinates",Le.kml),s=Pn(n,"altitudeMode",Le.kml),a=Pn(n,"altitudeMode",Le.gx),c=Od(n,"extrude",Le.kml),u=e._ellipsoid,f=gk(r,u);return i.position=f,yk(e,i,o,eme(s,a)),c&&sI(s,a)&&cj(t,i,o),!0}function jde(e,t,n,i,o){let r=vi(n,"coordinates",Le.kml),s=Pn(n,"altitudeMode",Le.kml),a=Pn(n,"altitudeMode",Le.gx),c=Od(n,"extrude",Le.kml),u=Od(n,"tessellate",Le.kml),f=sI(s,a),d=ti(n,"drawOrder",Le.gx),p=e._ellipsoid,g=hk(r,p),h=o.polyline;if(f&&c){let x=new w_;i.wall=x,x.positions=g;let b=o.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(h)?(x.outlineColor=l(h.material)?h.material.color:z.WHITE,x.outlineWidth=h.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let x=new _c;x.clampToGround=!0,i.polyline=x,x.positions=g,l(h)?(x.material=l(h.material)?h.material.color.getValue(Ge.MINIMUM_VALUE):z.WHITE,x.width=y(h.width,1)):(x.material=z.WHITE,x.width=1),x.zIndex=d}else l(d)&&Nt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&Nt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=l(h)?h.clone():new _c,i.polyline=h,h.positions=eZe(g,s,a,p),(!u||f)&&(h.arcType=Qt.NONE);return!0}function nZe(e,t,n,i,o){let r=vi(n,"outerBoundaryIs",Le.kml),s=vi(r,"LinearRing",Le.kml),a=vi(s,"coordinates",Le.kml),c=e._ellipsoid,u=hk(a,c),f=Od(n,"extrude",Le.kml),d=Pn(n,"altitudeMode",Le.kml),p=Pn(n,"altitudeMode",Le.gx),g=sI(d,p),h=l(o.polygon)?o.polygon.clone():sj(),x=o.polyline;if(l(x)&&(h.outlineColor=l(x.material)?x.material.color:z.WHITE,h.outlineWidth=x.width),i.polygon=h,g?(h.perPositionHeight=!0,h.extrudedHeight=f?0:void 0):e._clampToGround||(h.height=0),l(u)){let b=new Jc(u),C=Pd(n,"innerBoundaryIs",Le.kml);for(let T=0;T<C.length;T++){s=Pd(C[T],"LinearRing",Le.kml);for(let A=0;A<s.length;A++)a=vi(s[A],"coordinates",Le.kml),u=hk(a,c),l(u)&&b.holes.push(new Jc(u))}h.hierarchy=b}return!0}function iZe(e,t,n,i,o){let r=Pn(n,"altitudeMode",Le.kml),s=Pn(n,"altitudeMode",Le.gx),a=Pd(n,"coord",Le.gx),c=Pd(n,"angles",Le.gx),u=Pd(n,"when",Le.kml),f=Od(n,"extrude",Le.kml),d=sI(r,s),p=e._ellipsoid;c.length>0&&Nt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),h=[],x=[];for(let C=0;C<g;C++){let T=gk(a[C].textContent,p);h.push(T),x.push(ee.fromIso8601(u[C].textContent))}let b=new xa;return b.addSamples(x,h),i.position=b,yk(e,i,o,eme(r,s)),tme(i,o),i.availability=new Lr,u.length>0&&i.availability.addInterval(new Sn({start:x[0],stop:x[x.length-1]})),d&&f&&cj(t,i,o),!0}function qde(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new xa;d.addSamples(e,t),n.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:QJe(d,s,a)})),i.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function oZe(e,t,n,i,o){let r=Od(n,"interpolate",Le.gx),s=Pd(n,"Track",Le.gx),a,c,u,f=!1,d=new Ng,p=new Lr,g=new ya,h=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let C=s[x],T=Pd(C,"when",Le.kml),A=Pd(C,"coord",Le.gx),S=Pn(C,"altitudeMode",Le.kml),v=Pn(C,"altitudeMode",Le.gx),I=sI(S,v),O=Od(C,"extrude",Le.kml),R=Math.min(A.length,T.length),N=[];a=[];for(let F=0;F<R;F++){let _=gk(A[F].textContent,h);N.push(_),a.push(ee.fromIso8601(T[F].textContent))}r&&(l(c)&&qde([c,a[0]],[u,N[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=N[N.length-1]),qde(a,N,g,p,d,I&&O,S,v,!0),f=f||I&&O}return i.availability=p,i.position=g,yk(e,i,o),tme(i,o),f&&(cj(t,i,o),i.polyline.show=d),!0}var nme={Point:tZe,LineString:jde,LinearRing:jde,Polygon:nZe,Track:iZe,MultiTrack:oZe,MultiGeometry:rZe,Model:sZe};function rZe(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=nme[f.localName];if(l(d)){let p=Jde(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(a=!0)}}return a}function sZe(e,t,n,i,o){return Nt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function aZe(e,t){let n=vi(e,"ExtendedData",Le.kml);if(!l(n))return;l(vi(n,"SchemaData",Le.kml))&&Nt("kml-schemaData","KML - SchemaData is unsupported"),l(us(n,"xmlns:prefix"))&&Nt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Pd(n,"Data",Le.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=us(a,"name");l(c)&&(i[c]={displayName:Pn(a,"displayName",Le.kml),value:Pn(a,"value",Le.kml)})}}t.kml.extendedData=i}var mo;typeof document<"u"&&(mo=document.createElement("div"));function cZe(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Pn(e,"description",Le.kml),d=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,g=z.BLACK,h=f;l(d)&&(p=y(d.bgColor,z.WHITE),g=y(d.textColor,z.BLACK),h=y(d.text,f));let x;if(l(h)){if(h=h.replace("$[name]",y(t.name,"")),h=h.replace("$[description]",y(f,"")),h=h.replace("$[address]",y(c.address,"")),h=h.replace("$[Snippet]",y(c.snippet,"")),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),l(u)){let T=h.match(/\$\[.+?\]/g);if(T!==null)for(r=0;r<T.length;r++){let A=T[r],S=A.substr(2,A.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),x=u[S],l(x)&&(x=v?x.displayName:x.value),l(x)&&(h=h.replace(A,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=u[s],h+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;h+="</tbody></table>"}if(!l(h))return;h=GJe.link(h),mo.innerHTML=h;let b=mo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(su(mo,"a","href",i),su(mo,"link","href",i),su(mo,"area","href",i),su(mo,"img","src",i),su(mo,"iframe","src",i),su(mo,"video","src",i),su(mo,"audio","src",i),su(mo,"source","src",i),su(mo,"track","src",i),su(mo,"input","src",i),su(mo,"embed","src",i),su(mo,"script","src",i),su(mo,"video","poster",i)),au(mo,"a","href",o),au(mo,"link","href",o),au(mo,"area","href",o),au(mo,"img","src",o),au(mo,"iframe","src",o),au(mo,"video","src",o),au(mo,"audio","src",o),au(mo,"source","src",o),au(mo,"track","src",o),au(mo,"input","src",o),au(mo,"embed","src",o),au(mo,"script","src",o),au(mo,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${mo.innerHTML}</div>`,mo.innerHTML="",t.description=C}function xk(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Jde(t,i,n.context),c=a.kml,u=ZJe(e,t,n.styleCollection,r,s),f=Pn(t,"name",Le.kml);a.name=f,a.parent=o;let d=KJe(t);l(d)||(d=XJe(t)),a.availability=d,fj(a);function p(A){return A?A.show&&p(A.parent):!0}let g=Od(t,"visibility",Le.kml);a.show=p(o)&&y(g,!0);let h=vi(t,"author",Le.atom),x=c.author;x.name=Pn(h,"name",Le.atom),x.uri=Pn(h,"uri",Le.atom),x.email=Pn(h,"email",Le.atom);let b=vi(t,"link",Le.atom),C=c.link;C.href=us(b,"href"),C.hreflang=us(b,"hreflang"),C.rel=us(b,"rel"),C.type=us(b,"type"),C.title=us(b,"title"),C.length=us(b,"length"),c.address=Pn(t,"address",Le.kml),c.phoneNumber=Pn(t,"phoneNumber",Le.kml),c.snippet=Pn(t,"Snippet",Le.kml),aZe(t,a),cZe(t,a,u,s,r);let T=e._ellipsoid;return rme(t,a,T),ome(t,a,T),l(vi(t,"Region",Le.kml))&&Nt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function ime(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function lZe(e,t,n,i){let o=xk(e,t,n),r=Ye(n);r.parentEntity=o.entity,ime(e,t,r,i)}function uZe(e,t,n,i){let o=xk(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=nme[d.localName];l(p)&&(p(e,n.entityCollection,d,r,s,r.id),a=!0)}a||(r.merge(s),yk(e,r,s))}var fZe={FlyTo:hZe,Wait:mZe,SoundCue:$7,AnimatedUpdate:$7,TourControl:$7};function dZe(e,t,n,i){let o=Pn(t,"name",Le.kml),r=us(t,"id"),s=new uk(o,r),a=vi(t,"Playlist",Le.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=fZe[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function $7(e,t){Nt(`KML Tour unsupported node ${t.localName}`)}function mZe(e,t){let n=ti(t,"duration",Le.gx);e.addPlaylistEntry(new mk(n))}function hZe(e,t,n){let i=ti(t,"duration",Le.gx),o=Pn(t,"flyToMode",Le.gx),r={kml:{}};rme(t,r,n),ome(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new dk(i,o,s);e.addPlaylistEntry(a)}function ome(e,t,n){let i=vi(e,"Camera",Le.kml);if(l(i)){let o=y(ti(i,"longitude",Le.kml),0),r=y(ti(i,"latitude",Le.kml),0),s=y(ti(i,"altitude",Le.kml),0),a=y(ti(i,"heading",Le.kml),0),c=y(ti(i,"tilt",Le.kml),0),u=y(ti(i,"roll",Le.kml),0),f=m.fromDegrees(o,r,s,n),d=lc.fromDegrees(a,c-90,u);t.kml.camera=new ak(f,d)}}function rme(e,t,n){let i=vi(e,"LookAt",Le.kml);if(l(i)){let o=y(ti(i,"longitude",Le.kml),0),r=y(ti(i,"latitude",Le.kml),0),s=y(ti(i,"altitude",Le.kml),0),a=ti(i,"heading",Le.kml),c=ti(i,"tilt",Le.kml),u=y(ti(i,"range",Le.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new ff(a,c-P.PI_OVER_TWO,u),d=m.fromDegrees(o,r,s,n);t.kml.lookAt=new ck(d,f)}}function pZe(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=vi(t,"Icon",Le.kml),c=aj(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=vi(t,"screenXY",Le.kml),p=vi(t,"overlayXY",Le.kml),g=vi(t,"size",Le.kml),h,x,b,C,T,A;l(g)&&(h=ry(g,"x"),x=ry(g,"y"),b=us(g,"xunits"),C=us(g,"yunits"),l(h)&&h!==-1&&h!==0&&(b==="fraction"?T=`width: ${Math.floor(h*100)}%`:b==="pixels"&&(T=`width: ${h}px`),f.push(T)),l(x)&&x!==-1&&x!==0&&(C==="fraction"?A=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(A=`height: ${x}px`),f.push(A))),u.style=f.join(";");let S=0,v=u.height;l(p)&&(h=ry(p,"x"),x=ry(p,"y"),b=us(p,"xunits"),C=us(p,"yunits"),l(h)&&(b==="fraction"?S=h*u.width:(b==="pixels"||b==="insetPixels")&&(S=h)),l(x)&&(C==="fraction"?v=x*u.height:(C==="pixels"||C==="insetPixels")&&(v=x))),l(d)&&(h=ry(d,"x"),x=ry(d,"y"),b=us(d,"xunits"),C=us(d,"yunits"),l(h)&&(b==="fraction"?T=`left: calc(${Math.floor(h*100)}% - ${S}px)`:b==="pixels"?T=`left: ${h-S}px`:b==="insetPixels"&&(T=`right: ${h-S}px`),f.push(T)),l(x)&&(C==="fraction"?A=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:C==="pixels"?A=`bottom: ${x-v}px`:C==="insetPixels"&&(A=`top: ${x-v}px`),f.push(A))),u.style=f.join(";")},o.appendChild(u)}function _Ze(e,t,n,i){let r=xk(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=hk(vi(t,"LatLonQuad",Le.gx),c),f=ti(t,"drawOrder",Le.kml);if(l(u))s=sj(),s.hierarchy=new Jc(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new fm,s.zIndex=f,r.rectangle=s;let h=vi(t,"LatLonBox",Le.kml);if(l(h)){let x=ti(h,"west",Le.kml),b=ti(h,"south",Le.kml),C=ti(h,"east",Le.kml),T=ti(h,"north",Le.kml);l(x)&&(x=P.negativePiToPi(P.toRadians(x))),l(b)&&(b=P.clampToLatitudeRange(P.toRadians(b))),l(C)&&(C=P.negativePiToPi(P.toRadians(C))),l(T)&&(T=P.clampToLatitudeRange(P.toRadians(T))),s.coordinates=new ce(x,b,C,T);let A=ti(h,"rotation",Le.kml);if(l(A)){let S=P.toRadians(A);s.rotation=S,s.stRotation=S}}}let d=vi(t,"Icon",Le.kml),p=aj(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Nt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ti(d,"x",Le.gx),x=ti(d,"y",Le.gx),b=ti(d,"w",Le.gx),C=ti(d,"h",Le.gx);(l(h)||l(x)||l(b)||l(C))&&Nt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=Sx(t,"color",Le.kml),s.material.transparent=!0}else s.material=Sx(t,"color",Le.kml);let g=Pn(t,"altitudeMode",Le.kml);l(g)?g==="absolute"?(s.height=ti(t,"altitude",Le.kml),s.zIndex=void 0):g!=="clampToGround"&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Pn(t,"altitudeMode",Le.gx),g==="relativeToSeaFloor"?(Nt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ti(t,"altitude",Le.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Nt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function sme(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Nt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var sy={INTERVAL:0,EXPIRE:1,STOP:2};function _k(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var gZe=new ce,FA=new me,Q7=new H,yZe=new m;function lj(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=Lb(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,gZe),l(n)&&(Q7.x=n.clientWidth*.5,Q7.y=n.clientHeight*.5,u=t.pickEllipsoid(Q7,r,yZe)),l(u)?f=r.cartesianToCartographic(u,FA):(f=ce.center(o,FA),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let C=o.width*i*.5,T=o.height*i*.5;o=new ce(a(f.longitude-C),s(f.latitude-T),a(f.longitude+C),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,FA),c=c.replace("[cameraLon]",P.toDegrees(FA.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(FA.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(FA.height).toString());let g=t.frustum,h=g.aspectRatio,x="",b="";if(l(h)){let C=P.toDegrees(g.fov);h>1?(x=C,b=C/h):(b=C,x=C*h)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Iu(c))}function xZe(e,t,n,i){let r=xk(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=vi(t,"Link",Le.kml);if(l(c)||(c=vi(t,"Url",Le.kml)),l(c)){let u=Pn(c,"href",Le.kml),f,d;if(l(u)){let p=u;if(u=rj(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Pn(c,"viewRefreshMode",Le.kml),f==="onRegion"){Nt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Pn(c,"viewBoundScale",Le.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Pn(c,"viewFormat",Le.kml),b),T=Pn(c,"httpQuery",Le.kml);l(C)&&u.setQueryParameters(Iu(_k(C))),l(T)&&u.setQueryParameters(Iu(_k(T)));let A=e._ellipsoid;lj(u,e.camera,e.canvas,d,e._lastCameraView.bbox,A)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},h=new js,x=uj(e,h,u,g).then(function(b){let C=e._entityCollection,T=h.values;C.suspendEvents();for(let v=0;v<T.length;v++){let I=T[v];l(I.parent)||(I.parent=r,fj(I)),C.add(I)}C.resumeEvents();let A=Pn(c,"refreshMode",Le.kml),S=y(ti(c,"refreshInterval",Le.kml),0);if(A==="onInterval"&&S>0||A==="onExpire"||f==="onStop"){let v=vi(b,"NetworkLinkControl",Le.kml),I=l(v),O=ee.now(),R={id:jn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:O},N=0;if(I&&(R.cookie=Iu(y(Pn(v,"cookie",Le.kml),"")),N=y(ti(v,"minRefreshPeriod",Le.kml),0)),A==="onInterval")I&&(S=Math.max(N,S)),R.refreshMode=sy.INTERVAL,R.time=S;else if(A==="onExpire"){let F;if(I&&(F=Pn(v,"expires",Le.kml)),l(F))try{let _=ee.fromIso8601(F),E=ee.secondsDifference(_,O);E>0&&E<N&&ee.addSeconds(O,N,_),R.refreshMode=sy.EXPIRE,R.time=_}catch{Nt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=sy.STOP,R.time=y(ti(c,"viewRefreshTime",Le.kml),0)):Nt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){Nt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function bZe(e,t,n,i){let o=oj[t.localName];return l(o)?o(e,t,n,i):sme(e,t,n,i)}function nj(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:vi(a,"Document",Le.kml),u=Pn(c,"name",Le.kml);l(u)||(u=Dg(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new cu._DeferredLoading(e),d=new js(e);return Promise.all(Qde(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let x=0;x<h.length;x++){let b=h[x];if(l(oj[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),bZe(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function CZe(e,t,n,i,o){let r=nn("ThirdParty/Workers/z-worker-pako.js");SA({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new U3(new Cx(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(Z7(f,u)),f=p):c.push(Z7(p,u)))}return l(f)&&c.push(YJe(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new de("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),nj(e,t,u.kml,i,u,o)})})}function uj(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=y(o,ve.DEFAULT.clone());return o=ve.createIfNeeded(o),l(a)&&(a=Mn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?jJe(u).then(function(f){return f?CZe(e,t,u,o,a):qJe(u).then(function(d){d=Xde(d),d=Kde(d);let p,g;try{p=ij.parseFromString(d,"application/xml")}catch(h){g=h.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let h=l(g)?g:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new de(h)}return nj(e,t,p,o,r,a,s)})}):nj(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function cu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new js(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new $g,this._networkLinks=new At,this._entityCluster=new tf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,oe.WGS84);let i=e.credit;typeof i=="string"&&(i=new wt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}cu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new cu(t).load(e,t)};Object.defineProperties(cu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});cu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Nr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return uj(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=ee.equals(s,Ge.MINIMUM_VALUE),u=ee.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),o=new km,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=Fr.LOOP_STOP,o.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Nr.setLoading(i,!1),i}).catch(function(o){return Nr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};cu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function fj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function TZe(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=vi(r,"NetworkLinkControl",Le.kml),c=l(a),u=0;if(c){if(l(vi(a,"Update",Le.kml))){Nt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Iu(y(Pn(a,"cookie",Le.kml),"")),u=y(ti(a,"minRefreshPeriod",Le.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===sy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===sy.EXPIRE){let O;if(l(a)&&(O=Pn(a,"expires",Le.kml)),l(O))try{let R=ee.fromIso8601(O),N=ee.secondsDifference(R,f);N>0&&N<u&&ee.addSeconds(f,u,R),t.time=R}catch{Nt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,h=n.values;function x(O){g.remove(O);let R=O._children,N=R.length;for(let F=0;F<N;++F)x(R[F])}g.suspendEvents();let b=g.values.slice(),C;for(C=0;C<b.length;++C){let O=b[C];O.parent===p&&(O.parent=void 0,x(O))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<h.length;C++){let O=h[C];l(O.parent)||(O.parent=p,fj(O)),g.add(O)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let T=g.computeAvailability(),A=T.start,S=T.stop,v=ee.equals(A,Ge.MINIMUM_VALUE),I=ee.equals(S,Ge.MAXIMUM_VALUE);if(!v||!I){let O=e._clock;(O.startTime!==A||O.stopTime!==S)&&(O.startTime=A,O.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var ej=new At;cu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;ej.removeAll();function o(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let h=d[g];ej.set(h.id,h),o(h)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new At,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!ej.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===sy.INTERVAL?ee.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===sy.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===sy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let g=new js,h=f.href.clone();h.setQueryParameters(f.cookie);let x=y(i._ellipsoid,oe.WGS84);lj(h,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),uj(i,g,h,{context:d.id}).then(TZe(i,f,g,c,h)).catch(function(b){let C=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function AZe(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}cu._DeferredLoading=eh;cu._getTimestamp=Ti;var bk=cu;function aI(){fe.throwInstantiationError()}aI.prototype.update=fe.throwInstantiationError;aI.prototype.getBoundingSphere=fe.throwInstantiationError;aI.prototype.isDestroyed=fe.throwInstantiationError;aI.prototype.destroy=fe.throwInstantiationError;var ame=aI;var EZe={NONE:0,LERC:1},Rd=Object.freeze(EZe);var SZe={NONE:0,BITS12:1},Qs=Object.freeze(SZe);var vx=new m,vZe=new m,hf=new H,Ck=new L,wZe=new L,IZe=Math.pow(2,12);function Ja(e,t,n,i,o,r,s,a,c,u){let f=Qs.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,h=t.maximum,x=m.subtract(h,g,vZe),b=i-n;Math.max(m.maximumComponent(x),b)<IZe-1?f=Qs.BITS12:f=Qs.NONE,d=L.inverseTransformation(o,new L);let T=m.negate(g,vx);L.multiply(L.fromTranslation(T,Ck),d,d);let A=vx;A.x=1/x.x,A.y=1/x.y,A.z=1/x.z,L.multiply(L.fromScale(A,Ck),d,d),p=L.clone(o),L.setTranslation(p,m.ZERO,p),o=L.clone(o,new L);let S=L.fromTranslation(g,Ck),v=L.fromScale(x,wZe),I=L.multiply(S,v,Ck);L.multiply(o,I,o),L.multiply(p,I,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Ja.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===Qs.BITS12){n=L.multiplyByPoint(this.toScaledENU,n,vx),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((o-this.minimumHeight)/f,0,1);H.fromElements(n.x,n.y,hf);let p=Yn.compressTextureCoordinates(hf);H.fromElements(n.z,d,hf);let g=Yn.compressTextureCoordinates(hf);H.fromElements(c,u,hf);let h=Yn.compressTextureCoordinates(hf);if(e[t++]=p,e[t++]=g,e[t++]=h,this.hasWebMercatorT){H.fromElements(s,0,hf);let x=Yn.compressTextureCoordinates(hf);e[t++]=x}}else m.subtract(n,this.center,vx),e[t++]=vx.x,e[t++]=vx.y,e[t++]=vx.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Yn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var DZe=new m,cme=new m;Ja.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*r+f;t[p]=e[d]}let a=this.decodePosition(t,s,DZe),c=n.geodeticSurfaceNormal(a,cme),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Ja.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};Ja.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===Qs.BITS12){let i=Yn.decompressTextureCoordinates(e[t],hf);n.x=i.x,n.y=i.y;let o=Yn.decompressTextureCoordinates(e[t+1],hf);return n.z=o.x,L.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};Ja.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,cme),a=this.decodeHeight(e,t),c=jc.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Ja.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new H),t*=this.stride,this.quantization===Qs.BITS12?Yn.decompressTextureCoordinates(e[t+2],n):H.fromElements(e[t+4],e[t+5],n)};Ja.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?Yn.decompressTextureCoordinates(e[t+1],hf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ja.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?Yn.decompressTextureCoordinates(e[t+3],hf).x:e[t+6]};Ja.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return H.fromElements(o,r,n)};Ja.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Ja.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Qs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var Tk={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},Ak={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ja.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Qs.NONE){s(Tk.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(Tk.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(Tk.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(Ak.compressed0,a?4:3),c&&s(Ak.compressed1,1),this.hasGeodeticSurfaceNormals&&s(Ak.geodeticSurfaceNormal,3)}return r};Ja.prototype.getAttributeLocations=function(){return this.quantization===Qs.NONE?Tk:Ak};Ja.clone=function(e,t){if(l(e))return l(t)||(t=new Ja),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=L.clone(e.toScaledENU),t.fromScaledENU=L.clone(e.fromScaledENU),t.matrix=L.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Pc=Ja;var th={};th.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var dj=new m,PZe=new L,OZe=new m,RZe=new m;th.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),h=y(e.ellipsoid,oe.WGS84),x=1/h.maximumRadius,b=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),T,A,S,v;l(C)?(T=C.west,A=C.south,S=C.east,v=C.north):g?(T=a(b.west),A=a(b.south),S=a(b.east),v=a(b.north)):(T=b.west*x,A=s-2*o(r(-b.south*x)),S=b.east*x,v=s-2*o(r(-b.north*x)));let I=e.relativeToCenter,O=l(I);I=O?I:m.ZERO;let R=y(e.includeWebMercatorT,!1),N=y(e.exaggeration,1),F=y(e.exaggerationRelativeHeight,0),E=N!==1,w=y(e.structure,th.DEFAULT_STRUCTURE),D=y(w.heightScale,th.DEFAULT_STRUCTURE.heightScale),M=y(w.heightOffset,th.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,th.DEFAULT_STRUCTURE.elementsPerHeight),V=y(w.stride,th.DEFAULT_STRUCTURE.stride),U=y(w.elementMultiplier,th.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,th.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(b),Y=ce.computeHeight(b),j=k/(u-1),$=Y/(f-1);g||(k*=x,Y*=x);let W=h.radiiSquared,K=W.x,J=W.y,he=W.z,ge=65536,se=-65536,pe=Mt.eastNorthUpToFixedFrame(I,h),xe=L.inverseTransformation(pe,PZe),De,Se;R&&(De=Oi.geodeticLatitudeToMercatorAngle(A),Se=1/(Oi.geodeticLatitudeToMercatorAngle(v)-De));let we=OZe;we.x=Number.POSITIVE_INFINITY,we.y=Number.POSITIVE_INFINITY,we.z=Number.POSITIVE_INFINITY;let ze=RZe;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let Oe=Number.POSITIVE_INFINITY,ft=u*f,Ct=d>0?u*2+f*2:0,ot=ft+Ct,sn=new Array(ot),wn=new Array(ot),zt=new Array(ot),Bt=R?new Array(ot):[],be=E?new Array(ot):[],Ee=0,at=f,Jt=0,ri=u;p&&(--Ee,++at,--Jt,++ri);let Ze=1e-5;for(let He=Ee;He<at;++He){let mt=He;mt<0&&(mt=0),mt>=f&&(mt=f-1);let Ut=b.north-$*mt;g?Ut=a(Ut):Ut=s-2*o(r(-Ut*x));let xn=(Ut-A)/(v-A);xn=P.clamp(xn,0,1);let Zn=He===Ee,To=He===at-1;d>0&&(Zn?Ut+=Ze*Y:To&&(Ut-=Ze*Y));let Qr=t(Ut),es=n(Ut),ar=he*es,zi;R&&(zi=(Oi.geodeticLatitudeToMercatorAngle(Ut)-De)*Se);for(let ts=Jt;ts<ri;++ts){let Wn=ts;Wn<0&&(Wn=0),Wn>=u&&(Wn=u-1);let Fn=mt*(u*V)+Wn*V,fn;if(B===1)fn=c[Fn];else{fn=0;let lr;if(G)for(lr=0;lr<B;++lr)fn=fn*U+c[Fn+lr];else for(lr=B-1;lr>=0;--lr)fn=fn*U+c[Fn+lr]}fn=fn*D+M,se=Math.max(se,fn),ge=Math.min(ge,fn);let pi=b.west+j*Wn;g?pi=a(pi):pi=pi*x;let Hi=(pi-T)/(S-T);Hi=P.clamp(Hi,0,1);let ns=mt*u+Wn;if(d>0){let lr=ts===Jt,Os=ts===ri-1,bh=Zn||To||lr||Os;if((Zn||To)&&(lr||Os))continue;bh&&(fn-=d,lr?(ns=ft+(f-mt-1),pi-=Ze*k):To?ns=ft+f+(u-Wn-1):Os?(ns=ft+f+u+mt,pi+=Ze*k):Zn&&(ns=ft+f+u+f+Wn))}let ao=Qr*t(pi),aa=Qr*n(pi),Of=K*ao,Rf=J*aa,i_=1/i(Of*ao+Rf*aa+ar*es),cr=Of*i_,Po=Rf*i_,ca=ar*i_,Gi=new m;Gi.x=cr+ao*fn,Gi.y=Po+aa*fn,Gi.z=ca+es*fn,L.multiplyByPoint(xe,Gi,dj),m.minimumByComponent(dj,we,we),m.maximumByComponent(dj,ze,ze),Oe=Math.min(Oe,fn),sn[ns]=Gi,zt[ns]=new H(Hi,xn),wn[ns]=fn,R&&(Bt[ns]=zi),E&&(be[ns]=h.geodeticSurfaceNormal(Gi))}}let zr=ae.fromPoints(sn),Hr;l(C)&&(Hr=Nn.fromRectangle(C,ge,se,h));let sa;O&&(sa=new Ig(h).computeHorizonCullingPointPossiblyUnderEllipsoid(I,sn,ge));let $r=new $y(we,ze,I),Ne=new Pc(I,$r,Oe,se,pe,!1,R,E,N,F),rt=new Float32Array(ot*Ne.stride),$e=0;for(let He=0;He<ot;++He)$e=Ne.encode(rt,$e,sn[He],zt[He],wn[He],void 0,Bt[He],be[He]);return{vertices:rt,maximumHeight:se,minimumHeight:ge,encoding:Ne,boundingSphere3D:zr,orientedBoundingBox:Hr,occludeePointInScaledSpace:sa}};var cI=th;function ay(){fe.throwInstantiationError()}Object.defineProperties(ay.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});ay.prototype.interpolateHeight=fe.throwInstantiationError;ay.prototype.isChildAvailable=fe.throwInstantiationError;ay.prototype.createMesh=fe.throwInstantiationError;ay.prototype.upsample=fe.throwInstantiationError;ay.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;ay.maximumAsynchronousTasks=5;var nh=ay;function MZe(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=x}var Md=MZe;function Oc(){fe.throwInstantiationError()}Object.defineProperties(Oc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var lme=[];Oc.getRegularGridIndices=function(e,t){let n=lme[e];l(n)||(lme[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),mme(e,t,i,0)),i};var ume=[];Oc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=ume[e];l(n)||(ume[e]=n=[]);let i=n[t];if(!l(i)){let o=Oc.getRegularGridIndices(e,t),r=dme(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var fme=[];Oc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=fme[e];l(n)||(fme[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=dme(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,h=f.northIndicesWestToEast,x=Ue.createTypedArray(c,u);mme(e,t,x,0),Oc.addSkirtIndices(d,p,g,h,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:h,indexCountWithoutSkirts:r}}return i};Oc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=Ek(e,a,r,s),a+=e.length,s=Ek(t,a,r,s),a+=t.length,s=Ek(n,a,r,s),a+=n.length,Ek(i,a,r,s)};function dme(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function mme(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function Ek(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Oc.heightmapTerrainQuality=.25;Oc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Oc.heightmapTerrainQuality/(t*n)};Oc.prototype.requestTileGeometry=fe.throwInstantiationError;Oc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Oc.prototype.getTileDataAvailable=fe.throwInstantiationError;Oc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var Jr=Oc;function Up(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Rd.NONE);let t=cI.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Rd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Up.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var hme="createVerticesFromHeightmap",LZe=new yi(hme),NZe=new yi(hme,nh.maximumAsynchronousTasks);Up.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(ce.center(f)),p=this._structure,h=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(h*4,1e3);let b=(a?NZe:LZe).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let C=this;return Promise.resolve(b).then(function(T){let A;C._skirtHeight>0?A=Jr.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):A=Jr.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let S=T.gridWidth*T.gridHeight;return C._mesh=new Md(d,new Float32Array(T.vertices),A.indices,A.indexCountWithoutSkirts,S,T.minimumHeight,T.maximumHeight,ae.clone(T.boundingSphere3D),m.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Nn.clone(T.orientedBoundingBox),Pc.clone(T.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),C._buffer=void 0,C._mesh})};Up.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),d=this._structure,g=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let h=cI.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=Jr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=Jr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=h.gridWidth*h.gridHeight;return this._mesh=new Md(f,h.vertices,x.indices,x.indexCountWithoutSkirts,b,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};Up.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),g=this._encoding===Rd.LERC;if(!p&&g)return;let x;if(p){let b=this._mesh.vertices,C=this._mesh.encoding;x=pme(b,C,f,d,e,i,o,t,n)}else x=FZe(this._buffer,a,c,s,u,e,i,o,t,n),x=x*d+f;return x};Up.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,h=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),C=f.heightOffset,T=f.heightScale,A=f.elementsPerHeight,S=f.elementMultiplier,v=f.isBigEndian,I=Math.pow(S,A-1);for(let O=0;O<u;++O){let R=P.lerp(b.north,b.south,O/(u-1));for(let N=0;N<c;++N){let F=P.lerp(b.west,b.east,N/(c-1)),_=pme(g,h,C,T,x,c,u,F,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,BZe(p,A,S,I,d,v,O*c+N,_)}}return Promise.resolve(new Up({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Up.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Up.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function FZe(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),d=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let h=d|0,x=h+1;x>=a&&(x=a-1,h=a-2);let b=f-p,C=d-h;h=a-1-h,x=a-1-x;let T=Sk(e,t,n,i,o,h*s+p),A=Sk(e,t,n,i,o,h*s+g),S=Sk(e,t,n,i,o,x*s+p),v=Sk(e,t,n,i,o,x*s+g);return _me(b,C,T,A,S,v)}function pme(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let g=f|0,h=g+1;h>=s&&(h=s-1,g=s-2);let x=u-d,b=f-g;g=s-1-g,h=s-1-h;let C=(t.decodeHeight(e,g*r+d)-n)/i,T=(t.decodeHeight(e,g*r+p)-n)/i,A=(t.decodeHeight(e,h*r+d)-n)/i,S=(t.decodeHeight(e,h*r+p)-n)/i;return _me(x,b,C,T,A,S)}function _me(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function Sk(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function BZe(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Za=Up;function UA(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var wx=new ce;function kZe(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}UA.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)kZe(e,g,p,s)||s.push(new BA(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,wx);let a=wx.west,c=wx.north;r.tileXYToRectangle(i,o,e,wx);let u=wx.east,f=wx.south,d=new GZe(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];mj(g.extent,d)&&WZe(this._maximumLevel,g,d)}};UA.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(kA(i.extent,e)){t=i;break}}return l(t)?lI(void 0,t,e):-1};var UZe=[],VZe=[],zZe=new ce,HZe=new ce;UA.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=UZe;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,zZe)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,HZe))):t.push(e);let n=VZe;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)uI(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var gme=new me;UA.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,wx);return ce.center(i,gme),this.computeMaximumLevelAtPosition(gme)>=e};UA.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function BA(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(BA.prototype,{nw:{get:function(){return this._nw||(this._nw=new BA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new BA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new BA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new BA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function GZe(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function mj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function WZe(e,t,n){for(;t.level<e;)if(vk(t.nw.extent,n))t=t.nw;else if(vk(t.ne.extent,n))t=t.ne;else if(vk(t.sw.extent,n))t=t.sw;else if(vk(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Oo(t.rectangles,n.level,jZe);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function jZe(e,t){return e.level-t}function vk(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function kA(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function lI(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&kA(t._nw.extent,n),s=t._ne&&kA(t._ne.extent,n),a=t._sw&&kA(t._sw.extent,n),c=t._se&&kA(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,lI(t,t._nw,n))),s&&(i=Math.max(i,lI(t,t._ne,n))),a&&(i=Math.max(i,lI(t,t._sw,n))),c&&(i=Math.max(i,lI(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];kA(a,n)&&(i=a.level)}t=t.parent}return i}function uI(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||mj(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=qZe(e[s.level],s)}uI(e,t._nw,n),uI(e,t._ne,n),uI(e,t._sw,n),uI(e,t._se,n)}function qZe(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];mj(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var ih=UA;function YZe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` +${o}`),t}var Vp=YZe;function wk(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}wk.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new wk(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Vp(i)}`),c};wk.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Ai=wk;function cy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Oi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(cy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});cy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};cy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};cy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};cy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ce(a,d,c,f)};cy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new H(o.west,o.south)),a=r.unproject(new H(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};cy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,h=p/a|0;h>=o&&(h=o-1);let x=g/u|0;return x>=r&&(x=r-1),l(n)?(n.x=h,n.y=x,n):new H(h,x)};var kr=cy;var XZe=15;function hj(e){this.ellipsoid=y(e.ellipsoid,oe.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}hj.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure,e._ready=!0};function KZe(e,t){let n=t.copyrightText;l(n)&&(e.credit=new wt(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Yi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(r.xmin,r.ymin),s.rectangleNortheastInMeters=new H(r.xmax,r.ymax),e.tilingScheme=new kr(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Rd.LERC:Rd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new ih(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new ih(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function yme(e,t,n){try{let i=await t.fetchJson();KZe(e,i),n&&n._marsOptions&&n._marsOptions.onLoadSuccess&&n._marsOptions.onLoadSuccess(i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),n&&n._marsOptions&&n._marsOptions.onLoadError&&n._marsOptions.onLoadError(i),i}}function ly(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let t=e.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new _e,l(e.url)){Q("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let n=this,i=new hj(e);this._readyPromise=Promise.resolve(e.url).then(async function(o){let r=ve.createIfNeeded(o);r.appendForwardSlash(),l(t)&&(r=r.getDerivedResource({queryParameters:{token:t}})),n._resource=r;let s=r.getDerivedResource({queryParameters:{f:"pjson"}});return await yme(i,s,n),i.build(n),!0})}}Object.defineProperties(ly.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});ly.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new hj(t);await yme(o,i);let r=new ly(t);return o.build(r),r._resource=n,r};ly.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(pj(this,n+1,e*2,t*2))){let d=xme(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Za({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):XZe,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===ni.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ni.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function pj(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}ly.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ly.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=pj(this,n,e,t);if(l(i))return i;xme(this,n,e,t)};ly.prototype.loadTileDataAvailability=function(e,t,n){};function JZe(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new H(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let h=e.y;h<g;++h)if(i[h*t+u.x]!==s){f=!0;break}f?(a.push(new H(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let h=u.y*t;for(let x=e.x;x<=p;++x)if(i[h+x]!==s){d=!0;break}d?(a.push(new H(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function ZZe(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new H(0,0)];for(;a.length>0;){let c=a.pop(),u=JZe(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function xme(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new Qo({throttle:!1,throttleByServer:!0,type:os.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=ZZe(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let h=e._tilesAvailable;for(let x=0;x<g.length;++x){let b=g[x];h.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return pj(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var bme=ly;var Cme="https://dev.virtualearth.net/REST/v1/Locations";function _j(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new ve({url:Cme,queryParameters:n}),this._credit=new wt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(_j.prototype,{url:{get:function(){return Cme}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});_j.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,c)}})})};var Tme=_j;function gj(){}Object.defineProperties(gj.prototype,{credit:{get:function(){}}});gj.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Ik=gj;var $Ze=new re,Ame=new m,VA=new m;function QZe(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let u=(a-i)*o;return m.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=$Ze;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=m.subtract(t[2],c,Ame),m.multiplyByScalar(d,.5,d),p=L.multiplyByVector(w0.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=m.subtract(u,t[r-1],Ame),m.multiplyByScalar(f,.5,f),p=L.multiplyByVector(w0.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=L.multiplyByVector(uy.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(u,p.y,VA),m.add(o,VA,o),m.multiplyByScalar(f,p.z,VA),m.add(o,VA,o),m.multiplyByScalar(d,p.w,VA),m.add(o,VA,o)}}var e$e=new m,t$e=new m;function uy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=e$e,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=t$e,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=QZe(this),this._lastTimeIndex=0}Object.defineProperties(uy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});uy.catmullRomCoefficientMatrix=new L(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);uy.prototype.findTimeInterval=so.prototype.findTimeInterval;uy.prototype.wrapTime=so.prototype.wrapTime;uy.prototype.clampTime=so.prototype.clampTime;uy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Eme=uy;var Dk={};Dk.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,d,p,g,h,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(h=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),h!==1&&(r.push(-1),r.push(2),r.push(0),r.push(h))):u===2?!s&&n!==e?(g=(e-i)/(n-i),h=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(h)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};Dk.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,g=1/(d*u+f*p),h=t-a,x=e-s,b=(d*x+f*h)*g,C=(-p*x+u*h)*g,T=1-b-C;return l(c)?(c.x=b,c.y=C,c.z=T,c):new m(b,C,T)};Dk.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new H),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var fy=Dk;function dy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=Ok(e.westIndices,o,t),this._southIndices=Ok(e.southIndices,r,t),this._eastIndices=Ok(e.eastIndices,o,t),this._northIndices=Ok(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(dy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var Pk=[];function Ok(e,t,n){Pk.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)Pk[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(Pk.sort(t),Ue.createTypedArray(n,Pk)):e}var Sme="createVerticesFromQuantizedTerrainMesh",n$e=new yi(Sme),i$e=new yi(Sme,nh.maximumAsynchronousTasks);dy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?i$e:n$e).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let h=p._quantizedVertices.length/3,x=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ue.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),T=g.center,A=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,I=p._orientedBoundingBox,O=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=g.vertexStride,N=Pc.clone(g.encoding);return p._mesh=new Md(T,C,b,g.indexCountWithoutSkirts,h,A,S,v,O,R,I,N,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var o$e=new yi("upsampleQuantizedTerrainMesh",nh.maximumAsynchronousTasks);dy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=o$e.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let h=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:g*.5,C=u?this._northSkirtHeight:g*.5,T=this._credits;return Promise.resolve(p).then(function(A){let S=new Uint16Array(A.vertices),v=Ue.createTypedArray(S.length/3,A.indices),I;return l(A.encodedNormals)&&(I=new Uint8Array(A.encodedNormals)),new dy({quantizedVertices:S,indices:v,encodedNormals:I,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:Nn.clone(A.orientedBoundingBox),horizonOcclusionPoint:m.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:h,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:C,childTileMask:0,credits:T,createdByUpsampling:!0})})};var yj=32767,vme=new m;dy.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=yj;let o=P.clamp((n-e.south)/e.height,0,1);return o*=yj,l(this._mesh)?c$e(this,i,o):l$e(this,i,o)};function wme(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var r$e=new H,s$e=new H,a$e=new H;function c$e(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,r$e),g=r.decodeTextureCoordinates(o,f,s$e),h=r.decodeTextureCoordinates(o,d,a$e);if(wme(t,n,p.x,p.y,g.x,g.y,h.x,h.y)){let x=fy.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,vme);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),C=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return x.x*b+x.y*C+x.z*T}}}}function l$e(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],h=i[d],x=o[u],b=o[f],C=o[d];if(wme(t,n,p,x,g,b,h,C)){let T=fy.computeBarycentricCoordinates(t,n,p,x,g,b,h,C,vme);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let A=T.x*r[u]+T.y*r[f]+T.z*r[d];return P.lerp(e._minimumHeight,e._maximumHeight,A/yj)}}}}dy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};dy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var zA=dy;function u$e(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function Cj(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}Cj.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata,e._ready=!0};async function Dme(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new kr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(e.levelZeroMaximumGeometricError=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new ih(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let T=0;T<b.length;++T){let A=b[T],S=C-A.endY-1,v=C-A.startY-1;e.overallAvailability[x].push([A.startX,S,A.endX,v]),g.addAvailableTileRange(x,A.startX,S,A.endX,v)}}}else l(d)&&(f=new ih(e.tilingScheme,u),g=new ih(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new u$e({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Rk(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function f$e(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Ai.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Rk(e,n);throw new de(i)}async function d$e(e,t,n){await Dme(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new ih(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new wt(e.attribution);e.tileCredits.push(o)}return!0}async function Rk(e,t){try{let n=await e.layerJsonResource.fetchJson(),i=d$e(e,n,t);return t&&t._marsOptions&&t._marsOptions.onLoadSuccess&&t._marsOptions.onLoadSuccess(n),i}catch(n){return l(n)&&n.statusCode===404?(await Dme(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):(t&&t._marsOptions&&t._marsOptions.onLoadError&&t._marsOptions.onLoadError(n),f$e(e,n,t))}}function lu(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),l(e.url)&&(Q("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=lu._initializeReadyPromise(e,this))}lu._initializeReadyPromise=async function(e,t){let n=await Promise.resolve(e.url),i=new Cj(e),o=ve.createIfNeeded(n);return o.appendForwardSlash(),i.lastResource=o,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Rk(i,t),i.build(t),!0};var xj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Ime(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function m$e(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Za({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function h$e(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,h=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*h,C=new DataView(t),T=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let A=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+f,!0));a+=d;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=f;let O=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*g,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*h);let N=R.subarray(0,O),F=R.subarray(O,2*O),_=R.subarray(O*2,3*O);Yn.zigZagDeltaDecode(N,F,_),a%x!==0&&(a+=x-a%x);let E=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ue.createTypedArrayFromArrayBuffer(O,t,a,E*h);a+=E*b;let D=0,M=w.length;for(let se=0;se<M;++se){let pe=w[se];w[se]=D-pe,pe===0&&++D}let B=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=Ue.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ue.createTypedArrayFromArrayBuffer(O,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ue.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let j=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let $=Ue.createTypedArrayFromArrayBuffer(O,t,a,j);a+=j*x;let W,K;for(;a<C.byteLength;){let se=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let pe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,se===xj.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,O*2);else if(se===xj.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,pe);else if(se===xj.METADATA&&e._requestMetadata){let xe=C.getUint32(a,!0);if(xe>0){let Se=Mo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Se))for(let we=0;we<Se.length;++we){let ze=n+we+1,Oe=Se[we],ft=e._tilingScheme.getNumberOfYTilesAtLevel(ze);for(let Ct=0;Ct<Oe.length;++Ct){let ot=Oe[Ct],sn=ft-ot.endY-1,wn=ft-ot.startY-1;e.availability.addAvailableTileRange(ze,ot.startX,sn,ot.endX,wn),r.availability.addAvailableTileRange(ze,ot.startX,sn,ot.endX,wn)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=pe}let J=e.getLevelMaximumGeometricError(n)*5,he=e._tilingScheme.tileXYToRectangle(i,o,n),ge=Nn.fromRectangle(he,A,S,e._tilingScheme.ellipsoid);return new zA({center:T,minimumHeight:A,maximumHeight:S,boundingSphere:v,orientedBoundingBox:ge,horizonOcclusionPoint:I,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:G,eastIndices:Y,northIndices:$,westSkirtHeight:J,southSkirtHeight:J,eastSkirtHeight:J,northSkirtHeight:J,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}lu.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=Tj(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(r)&&a?c.then(()=>this.requestTileGeometry(e,t,n,i)):Pme(this,e,t,n,r,i)};function Pme(e,t,n,i,o,r){if(!l(o))return Promise.reject(new de("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Ime(void 0)):u=Ime(c);let g=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(h){return l(h)?l(e._heightmapStructure)?m$e(e,h,i,t,n):h$e(e,h,i,t,n,o):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(lu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});lu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};lu.fromIonAssetId=async function(e,t){let n=await ma.fromAssetId(e);return lu.fromUrl(n,t)};lu.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=new Cj(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Rk(i);let o=new lu(t);return i.build(o),o};lu.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(Tj(this,e,t,n,i[r],r===0).result)return;return!1};lu.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=Tj(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function bj(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function Tj(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=bj(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[s],!l(d))){let p=new Qo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});d=Pme(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=bj(o,f.x,f.y,f.level)}return{result:!1}}lu._getAvailabilityTile=bj;var Ix=lu;function zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new ul(n),this._workerName="createCircleGeometry"}zp.packedLength=ul.packedLength;zp.pack=function(e,t,n){return ul.pack(e._ellipseGeometry,t,n)};var p$e=new ul({center:new m,semiMajorAxis:1,semiMinorAxis:1}),$a={center:new m,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Me,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};zp.unpack=function(e,t,n){let i=ul.unpack(e,t,p$e);return $a.center=m.clone(i._center,$a.center),$a.ellipsoid=oe.clone(i._ellipsoid,$a.ellipsoid),$a.height=i._height,$a.extrudedHeight=i._extrudedHeight,$a.granularity=i._granularity,$a.vertexFormat=Me.clone(i._vertexFormat,$a.vertexFormat),$a.stRotation=i._stRotation,$a.shadowVolume=i._shadowVolume,l(n)?($a.semiMajorAxis=i._semiMajorAxis,$a.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ul($a),n):($a.radius=i._semiMajorAxis,new zp($a))};zp.createGeometry=function(e){return ul.createGeometry(e._ellipseGeometry)};zp.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new zp({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(zp.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Ome=zp;function HA(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new sf(n),this._workerName="createCircleOutlineGeometry"}HA.packedLength=sf.packedLength;HA.pack=function(e,t,n){return sf.pack(e._ellipseGeometry,t,n)};var _$e=new sf({center:new m,semiMajorAxis:1,semiMinorAxis:1}),uu={center:new m,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};HA.unpack=function(e,t,n){let i=sf.unpack(e,t,_$e);return uu.center=m.clone(i._center,uu.center),uu.ellipsoid=oe.clone(i._ellipsoid,uu.ellipsoid),uu.height=i._height,uu.extrudedHeight=i._extrudedHeight,uu.granularity=i._granularity,uu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(uu.semiMajorAxis=i._semiMajorAxis,uu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new sf(uu),n):(uu.radius=i._semiMajorAxis,new HA(uu))};HA.createGeometry=function(e){return sf.createGeometry(e._ellipseGeometry)};var Rme=HA;function g$e(e){Q("createWorldTerrain","createWorldTerrain was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldTerrainAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=new Ix({requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)});return t._readyPromise=Ix._initializeReadyPromise({url:ma.fromAssetId(1),requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)},t),t}var Mme=g$e;function y$e(e){return e=y(e,y.EMPTY_OBJECT),Ix.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)})}var GA=y$e;function WA(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:y(e.ellipsoid,oe.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new wt(n)),this._credit=n,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(WA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("CustomHeightmapTerrainProvider.ready","CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("CustomHeightmapTerrainProvider.readyPromise","CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});WA.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Za({buffer:c,width:r,height:s})})};WA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};WA.prototype.getTileDataAvailable=function(e,t,n){};WA.prototype.loadTileDataAvailability=function(e,t,n){};var Lme=WA;var x$e=1953029805,b$e=2917034100;function Aj(e,t){if(Aj.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new de("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===x$e||o===b$e)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}Aj.passThroughDataForTesting=!1;var Mk=Aj;function Nme(e){this.proxy=e}Nme.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Fme=Nme;function Ld(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Ld.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Ld.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Ld({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Ld.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Ld.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Bme(this,t)};Ld.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Bme(this,i),t};Ld.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],kme(this,0)),this._array[e-1]=void 0,t};Ld.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Ej(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&kme(this,n)}return this._array[e-1]=void 0,t};Ld.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Ld.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Ej(this,1,2)?1:2]};function Lk(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function fI(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Ej(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Bme(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=fI(e,t,i);for(o!==n&&(Lk(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(fI(e,t,r)!==o)break;Lk(e,t,r),t=r}}function kme(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){fI(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;fI(e,f,r)===i&&(r=f)}}if(fI(e,r,t)===i&&(Lk(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);Ej(e,r,a)===i&&Lk(e,r,a)}t=r}}var jA=Ld;function qA(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:y(e.ellipsoid,oe.WGS84)})),this._levelZeroMaximumGeometricError=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(qA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("EllipsoidTerrainProvider.ready","EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("EllipsoidTerrainProvider.readyPromise","EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});qA.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Za({buffer:new Uint8Array(16*16),width:16,height:16}))};qA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qA.prototype.getTileDataAvailable=function(e,t,n){};qA.prototype.loadTileDataAvailability=function(e,t,n){};var YA=qA;function oh(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ss,this._perspectiveMatrix=new L,this._infinitePerspective=new L}function Sj(e){let t=e.top,n=e.bottom,i=e.right,o=e.left,r=e.near,s=e.far;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=L.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=L.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(oh.prototype,{projectionMatrix:{get:function(){return Sj(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Sj(this),this._infinitePerspective}}});var C$e=new m,T$e=new m,A$e=new m,E$e=new m;oh.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=m.cross(t,n,C$e),d=T$e;m.multiplyByScalar(t,c,d),m.add(e,d,d);let p=A$e;m.multiplyByScalar(t,u,p),m.add(e,p,p);let g=E$e;m.multiplyByScalar(f,a,g),m.add(d,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let h=i[0];return l(h)||(h=i[0]=new re),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(f,s,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),h=i[1],l(h)||(h=i[1]=new re),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(f,g,g),m.normalize(g,g),h=i[2],l(h)||(h=i[2]=new re),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(d,g,g),m.subtract(g,e,g),m.cross(g,f,g),m.normalize(g,g),h=i[3],l(h)||(h=i[3]=new re),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,e),h=i[4],l(h)||(h=i[4]=new re),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,d),m.negate(t,g),h=i[5],l(h)||(h=i[5]=new re),h.x=g.x,h.y=g.y,h.z=g.z,h.w=-m.dot(g,p),this._cullingVolume};oh.prototype.getPixelDimensions=function(e,t,n,i,o){Sj(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};oh.prototype.clone=function(e){return l(e)||(e=new oh),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};oh.prototype.equals=function(e){return l(e)&&e instanceof oh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};oh.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof oh&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var _l=oh;function gl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new _l,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}gl.packedLength=6;gl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};gl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new gl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Nd(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(gl.prototype,{projectionMatrix:{get:function(){return Nd(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Nd(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Nd(this),this._fovy}},sseDenominator:{get:function(){return Nd(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Nd(this),this._offCenterFrustum}}});gl.prototype.computeCullingVolume=function(e,t,n){return Nd(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};gl.prototype.getPixelDimensions=function(e,t,n,i,o){return Nd(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};gl.prototype.clone=function(e){return l(e)||(e=new gl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};gl.prototype.equals=function(e){return!l(e)||!(e instanceof gl)?!1:(Nd(this),Nd(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};gl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof gl)?!1:(Nd(this),Nd(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var wi=gl;var Nk=0,S$e=1;function Dx(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Me.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof wi?(s=Nk,a=wi.packedLength):t instanceof on&&(s=S$e,a=on.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Be.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Be.packedLength+Me.packedLength}Dx.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Nk?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Be.pack(e._orientation,t,n),n+=Be.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var v$e=new wi,w$e=new on,I$e=new Be,D$e=new m,P$e=new Me;Dx.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===Nk?(o=wi.unpack(e,t,v$e),t+=wi.packedLength):(o=on.unpack(e,t,w$e),t+=on.packedLength);let r=m.unpack(e,t,D$e);t+=m.packedLength;let s=Be.unpack(e,t,I$e);t+=Be.packedLength;let a=Me.unpack(e,t,P$e);t+=Me.packedLength;let c=e[t]===1;if(!l(n))return new Dx({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Be.clone(s,n._orientation),n._vertexFormat=Me.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function XA(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var O$e=new Z,R$e=new L,vj=new L,Ume=new m,Vme=new m,zme=new m,M$e=new m,L$e=new m,N$e=new m,my=new Array(3),dI=new Array(4);dI[0]=new re(-1,-1,1,1);dI[1]=new re(1,-1,1,1);dI[2]=new re(1,1,1,1);dI[3]=new re(-1,1,1,1);var Hme=new Array(4);for(let e=0;e<4;++e)Hme[e]=new re;Dx._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=Z.fromQuaternion(t,O$e),u=y(r,Ume),f=y(s,Vme),d=y(a,zme);u=Z.getColumn(c,0,u),f=Z.getColumn(c,1,f),d=Z.getColumn(c,2,d),m.normalize(u,u),m.normalize(f,f),m.normalize(d,d),m.negate(u,u);let p=L.computeView(e,d,f,u,R$e),g,h,x=i.projectionMatrix;if(n===Nk){let b=L.multiply(x,p,vj);h=L.inverse(b,vj)}else g=L.inverseTransformation(p,vj);l(h)?(my[0]=i.near,my[1]=i.far):(my[0]=0,my[1]=i.near,my[2]=i.far);for(let b=0;b<2;++b)for(let C=0;C<4;++C){let T=re.clone(dI[C],Hme[C]);if(l(h)){T=L.multiplyByVector(h,T,T);let A=1/T.w;m.multiplyByScalar(T,A,T),m.subtract(T,e,T),m.normalize(T,T);let S=m.dot(d,T);m.multiplyByScalar(T,my[b]/S,T),m.add(T,e,T)}else{let A=i.offCenterFrustum;l(A)&&(i=A);let S=my[b],v=my[b+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(S-v)-S-v)*.5,T.w=1,L.multiplyByVector(g,T,T)}o[12*b+C*3]=T.x,o[12*b+C*3+1]=T.y,o[12*b+C*3+2]=T.z}};Dx.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);Dx._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[3+1],c[u+5]=c[3+2],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[3+1],c[u+2]=c[3+2],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,h=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=Ume,C=Vme,T=zme,A=m.negate(b,M$e),S=m.negate(C,L$e),v=m.negate(T,N$e);u=0,r&&(XA(u,p,g,h,x,v,b,C),u+=3*4),XA(u,p,g,h,x,T,A,C),u+=3*4,XA(u,p,g,h,x,A,v,C),u+=3*4,XA(u,p,g,h,x,S,v,A),u+=3*4,XA(u,p,g,h,x,b,T,C),u+=3*4,XA(u,p,g,h,x,C,T,A),l(p)&&(f.normal=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),l(h)&&(f.bitangent=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),l(x)&&(f.st=new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,h=p*4;d[g]=h,d[g+1]=h+1,d[g+2]=h+2,d[g+3]=h,d[g+4]=h+2,d[g+5]=h+3}return new dt({attributes:f,indices:d,primitiveType:Fe.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var KA=Dx;var wj=0,F$e=1;function mI(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof wi?(r=wj,s=wi.packedLength):t instanceof on&&(r=F$e,s=on.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Be.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Be.packedLength}mI.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===wj?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Be.pack(e._orientation,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var B$e=new wi,k$e=new on,U$e=new Be,V$e=new m;mI.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===wj?(o=wi.unpack(e,t,B$e),t+=wi.packedLength):(o=on.unpack(e,t,k$e),t+=on.packedLength);let r=m.unpack(e,t,V$e);t+=m.packedLength;let s=Be.unpack(e,t,U$e);t+=Be.packedLength;let a=e[t]===1;if(!l(n))return new mI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Be.clone(s,n._orientation),n._drawNearPlane=a,n};mI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);KA._computeNearFarPlanes(i,o,t,n,s);let a=new gn({position:new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new dt({attributes:a,indices:d,primitiveType:Fe.LINES,boundingSphere:ae.fromVertices(s)})};var Fk=mI;function Bk(){fe.throwInstantiationError()}Object.defineProperties(Bk.prototype,{credit:{get:fe.throwInstantiationError}});Bk.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(wt.getIonCredit)};Bk.prototype.geocode=fe.throwInstantiationError;var hI=Bk;var z$e={SEARCH:0,AUTOCOMPLETE:1},Px=Object.freeze(z$e);function Gme(){fe.throwInstantiationError()}Gme.createGeometry=function(e){fe.throwInstantiationError()};var Wme=Gme;function H$e(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var kk=H$e;var X$e=ur(Ij(),1);function G$e(e,t){return(e&t)!==0}var Rc=G$e;var W$e=[1,2,4,8],jme=15,j$e=16,q$e=64,Y$e=128;function rh(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}rh.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new rh(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};rh.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};rh.prototype.hasSubtree=function(){return Rc(this._bits,j$e)};rh.prototype.hasImagery=function(){return Rc(this._bits,q$e)};rh.prototype.hasTerrain=function(){return Rc(this._bits,Y$e)};rh.prototype.hasChildren=function(){return Rc(this._bits,jme)};rh.prototype.hasChild=function(e){return Rc(this._bits,W$e[e])};rh.prototype.getChildBitmask=function(){return this._bits&jme};var Uk=rh;function K$e(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var J$e=K$e(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB +\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function fu(e){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),l(e)){Q("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash(),this._resource=n;let i=this;this._readyPromise=Yme(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(o){let r=`An error occurred while accessing ${Rj(i,"",1).url}.`;return Promise.reject(new de(r))})}}Object.defineProperties(fu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});fu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new fu;i._resource=n;try{await Yme(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Rj(i,"",1).url}: ${o}`;throw new de(r)}return i};fu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Rc(t,r)?Rc(e,r)&&(s|=1):(s|=2,Rc(e,r)||(s|=1)),i+=s}return i};fu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Rc(s,2)?Rc(s,1)||(t|=r):(n|=r,Rc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};fu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var qme=new yi("decodeGoogleEarthEnterprisePacket");fu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=Rj(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return qme.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let h=u[e];f=r[e],f._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,x){return h.length-x.length});let g=p.length;for(let h=0;h<g;++h){let x=p[h];if(u[x]!==null){let C=Uk.clone(u[x]),T=x.length;if(T===d)C.setParent(f);else if(T>1){let A=r[x.substring(0,x.length-1)];C.setParent(A)}r[x]=C}else r[x]=null}})})};fu.prototype.populateSubtree=function(e,t,n,i){let o=fu.tileXYToQuadKey(e,t,n);return Oj(this,o,i)};function Oj(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Oj(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Oj(e,t,s)}).finally(function(){delete a[o]})}fu.prototype.getTileInformation=function(e,t,n){let i=fu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};fu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Rj(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Dj,Pj;function Yme(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Pj)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Pj=Mb(n).then(function(){Dj=window.cesiumGoogleEarthDbRootParser(X$e),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Pj.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Dj.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return qme.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Dj.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new wt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=J$e})}var sh=fu;function Ox(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(Ox.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Jme="createVerticesFromGoogleEarthEnterpriseBuffer",Z$e=new yi(Jme),$$e=new yi(Jme,nh.maximumAsynchronousTasks),Xme=new ce,Mj=new ce;Ox.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Xme),t.tileXYToRectangle(n,i,o,Mj);let u=c.cartographicToCartesian(ce.center(Mj)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let g=(a?$$e:Z$e).scheduleTask({buffer:this._buffer,nativeRectangle:Xme,rectangle:Mj,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let h=this;return g.then(function(x){return h._mesh=new Md(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),m.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Nn.clone(x.orientedBoundingBox),Pc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),h._minimumHeight=x.minimumHeight,h._maximumHeight=x.maximumHeight,h._buffer=void 0,h._mesh})};Ox.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?iQe(this,i,o):sQe(this,i,o,e)};var Q$e=new yi("upsampleQuantizedTerrainMesh",nh.maximumAsynchronousTasks);Ox.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=Q$e.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(h){let x=new Uint16Array(h.vertices),b=Ue.createTypedArray(x.length/3,h.indices),C=g._skirtHeight;return new zA({quantizedVertices:x,indices:b,minimumHeight:h.minimumHeight,maximumHeight:h.maximumHeight,boundingSphere:ae.clone(h.boundingSphere),orientedBoundingBox:Nn.clone(h.orientedBoundingBox),horizonOcclusionPoint:m.clone(h.horizonOcclusionPoint),westIndices:h.westIndices,southIndices:h.southIndices,eastIndices:h.eastIndices,northIndices:h.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};Ox.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Ox.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var eQe=new H,tQe=new H,nQe=new H,Zme=new m;function iQe(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,eQe),g=r.decodeTextureCoordinates(o,f,tQe),h=r.decodeTextureCoordinates(o,d,nQe),x=fy.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,h.x,h.y,Zme);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),C=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return x.x*b+x.y*C+x.z*T}}}var oQe=Uint16Array.BYTES_PER_ELEMENT,Kme=Uint32Array.BYTES_PER_ELEMENT,Lj=Int32Array.BYTES_PER_ELEMENT,rQe=Float32Array.BYTES_PER_ELEMENT,Nj=Float64Array.BYTES_PER_ELEMENT;function sQe(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v<r;++v)u+=c.getUint32(u,!0),u+=Kme;u+=Kme,u+=2*Nj;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Nj;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Nj;let p=i.width/f/2,g=i.height/d/2,h=c.getInt32(u,!0);u+=Lj;let x=c.getInt32(u,!0)*3;u+=Lj,u+=Lj;let b=new Array(h),C=new Array(h),T=new Array(h),A;for(A=0;A<h;++A)b[A]=s+c.getUint8(u++)*p,C[A]=a+c.getUint8(u++)*g,T[A]=c.getFloat32(u,!0)*6371010,u+=rQe;let S=new Array(x);for(A=0;A<x;++A)S[A]=c.getUint16(u,!0),u+=oQe;for(A=0;A<x;A+=3){let v=S[A],I=S[A+1],O=S[A+2],R=b[v],N=b[I],F=b[O],_=C[v],E=C[I],w=C[O],D=fy.computeBarycentricCoordinates(t,n,R,_,N,E,F,w,Zme);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15)return D.x*T[v]+D.y*T[I]+D.z*T[O]}}var pI=Ox;var pf={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},Vk=new ee;function zk(){this._terrainCache={},this._lastTidy=ee.now()}zk.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};zk.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};zk.prototype.tidy=function(){if(ee.now(Vk),ee.secondsDifference(Vk,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];ee.secondsDifference(Vk,r.timestamp)>10&&delete e[o]}ee.clone(Vk,this._lastTidy)}};function hy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;if(typeof t=="string"&&(t=new wt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new zk,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=ve.createIfNeeded(e.url),i=this,o;this._readyPromise=sh.fromUrl(n).then(r=>{if(!r.terrainPresent){let s=new de(`The server ${r.url} doesn't have terrain`);return Promise.reject(s)}return Ai.reportSuccess(o),i._metadata=r,i._ready=!0,!0}).catch(r=>{throw o=Ai.reportError(o,i,i._errorEvent,r.message,void 0,void 0,void 0,r),r})}else if(l(e.metadata)){Q("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let n=e.metadata;this._metadata=n;let i=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!n.terrainPresent)throw new de(`The server ${n.url} doesn't have terrain`);i._ready=!0})}}Object.defineProperties(hy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});hy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new hy(t);return n._metadata=e,n._readyPromise=Promise.resolve(!0),n._ready=!0,n};var aQe=new yi("decodeGoogleEarthEnterprisePacket");function $me(e,t,n){let i=t.getChildBitmask();if(t.terrainState===pf.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}hy.prototype.requestTileGeometry=function(e,t,n,i){let o=sh.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new de("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=pf.UNKNOWN);let u=r.get(o);if(l(u)){let C=s.providers[a.terrainProvider];return Promise.resolve(new pI({buffer:u,childTileMask:$me(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===pf.NONE)return Promise.reject(new de("Terrain tile doesn't exist"))}else return Promise.resolve(new Za({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=o,p=-1;switch(c){case pf.SELF:p=a.terrainVersion;break;case pf.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case pf.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new de("Terrain tile doesn't exist"));let g=this._terrainPromises,h=this._terrainRequests,x,b;if(l(g[d]))x=g[d],b=h[d];else{b=i;let C=cQe(this,d,p,b).fetchArrayBuffer();if(!l(C))return;x=C.then(function(T){return l(T)?aQe.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(A){let S=s.getTileInformationFromQuadKey(d);S.terrainState=pf.SELF,r.add(d,A[0]);let v=S.terrainProvider,I=A.length-1;for(let O=0;O<I;++O){let R=d+O.toString(),N=s.getTileInformationFromQuadKey(R);l(N)&&(r.add(R,A[O+1]),N.terrainState=pf.PARENT,N.terrainProvider===0&&(N.terrainProvider=v))}}):Promise.reject(new de("Failed to load terrain."))}),g[d]=x,h[d]=b,x=x.finally(function(){delete g[d],delete h[d]})}return x.then(function(){let C=r.get(o);if(l(C)){let T=s.providers[a.terrainProvider];return new pI({buffer:C,childTileMask:$me(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new de("Failed to load terrain."))}).catch(function(C){return b.state===ni.CANCELLED?(i.state=b.state,Promise.reject(C)):(a.terrainState=pf.NONE,Promise.reject(C))})};hy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};hy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=sh.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===pf.NONE)return!1;if((!l(s)||s===pf.UNKNOWN)&&(r.terrainState=pf.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Qo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};hy.prototype.loadTileDataAvailability=function(e,t,n){};function cQe(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Qme=hy;var Hk,ehe="AIzaSyBqCv5lozjjhtIQ_pZuj2obyAL9bTJdY28",Gk={};Gk.defaultApiKey=ehe;Gk.mapTilesApiEndpoint=new ve({url:"https://tile.googleapis.com/v1/"});Gk.getDefaultApiKeyCredit=function(e){if(e===ehe){if(!l(Hk)){let t=`<b> This application is using CesiumJS's default Google Maps API key. Please assign <i>Cesium.GoogleMaps.defaultApiKey</i> with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>`;Hk=new wt(t,!0),Hk._isDefaultToken=!0}return Hk}};var JA=Gk;function lQe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Wk=lQe;var hhe={},uQe=32.184,fQe=2451545,the=-.0529921,nhe=-.1059842,ihe=13.0120009,ohe=13.3407154,rhe=.9856003,she=26.4057084,ahe=13.064993,che=.3287146,lhe=1.7484877,uhe=-.1589763,fhe=.0036096,dhe=.1643573,mhe=12.9590088,Fj=new ee;hhe.ComputeMoon=function(e,t){l(e)||(e=ee.now()),Fj=ee.addSeconds(e,uQe,Fj);let n=ee.totalDays(Fj)-fQe,i=n/$n.DAYS_PER_JULIAN_CENTURY,o=(125.045+the*n)*P.RADIANS_PER_DEGREE,r=(250.089+nhe*n)*P.RADIANS_PER_DEGREE,s=(260.008+ihe*n)*P.RADIANS_PER_DEGREE,a=(176.625+ohe*n)*P.RADIANS_PER_DEGREE,c=(357.529+rhe*n)*P.RADIANS_PER_DEGREE,u=(311.589+she*n)*P.RADIANS_PER_DEGREE,f=(134.963+ahe*n)*P.RADIANS_PER_DEGREE,d=(276.617+che*n)*P.RADIANS_PER_DEGREE,p=(34.226+lhe*n)*P.RADIANS_PER_DEGREE,g=(15.134+uhe*n)*P.RADIANS_PER_DEGREE,h=(119.743+fhe*n)*P.RADIANS_PER_DEGREE,x=(239.961+dhe*n)*P.RADIANS_PER_DEGREE,b=(25.053+mhe*n)*P.RADIANS_PER_DEGREE,C=Math.sin(o),T=Math.sin(r),A=Math.sin(s),S=Math.sin(a),v=Math.sin(c),I=Math.sin(u),O=Math.sin(f),R=Math.sin(d),N=Math.sin(p),F=Math.sin(g),_=Math.sin(h),E=Math.sin(x),w=Math.sin(b),D=Math.cos(o),M=Math.cos(r),B=Math.cos(s),V=Math.cos(a),U=Math.cos(c),G=Math.cos(u),k=Math.cos(f),Y=Math.cos(d),j=Math.cos(p),$=Math.cos(g),W=Math.cos(h),K=Math.cos(x),J=Math.cos(b),he=(269.9949+.0031*i-3.8787*C-.1204*T+.07*A-.0172*S+.0072*I-.0052*F+.0043*w)*P.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*D+.0239*M-.0278*B+.0068*V-.0029*G+9e-4*k+8e-4*$-9e-4*J)*P.RADIANS_PER_DEGREE,se=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*T-.0642*A+.0158*S+.0252*v-.0066*I-.0047*O-.0046*R+.0028*N+.0052*F+.004*_+.0019*E-.0044*w)*P.RADIANS_PER_DEGREE,pe=(13.17635815-14e-13*(2*n)+3.561*D*the+.1208*M*nhe-.0642*B*ihe+.0158*V*ohe+.0252*U*rhe-.0066*G*she-.0047*k*ahe-.0046*Y*che+.0028*j*lhe+.0052*$*uhe+.004*W*fhe+.0019*K*dhe-.0044*J*mhe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new Wk),t.rightAscension=he,t.declination=ge,t.rotation=se,t.rotationRate=pe,t};var jk=hhe;function phe(e){(!l(e)||typeof e!="function")&&(e=jk.ComputeMoon),this._computeFunction=e}var dQe=new m,mQe=new m,hQe=new m;function pQe(e,t,n){let i=dQe;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=hQe;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,mQe);return l(n)||(n=new Z),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var _Qe=new Z,gQe=new Be;phe.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=pQe(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Be.fromAxisAngle(m.UNIT_Z,o,gQe),s=Z.fromQuaternion(Be.conjugate(r,r),_Qe);return Z.multiply(s,i,i)};var qk=phe;var _I={};_I.type=void 0;_I.getRequiredDataPoints=fe.throwInstantiationError;_I.interpolateOrderZero=fe.throwInstantiationError;_I.interpolate=fe.throwInstantiationError;var _he=_I;function Bj(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Bj.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Bj.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Px.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var Yk=Bj;function kj(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,pm.defaultAccessToken),n=ve.createIfNeeded(y(e.server,pm.defaultServer));n.appendForwardSlash();let i=pm.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(wt.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});l(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new Yk(o)}Object.defineProperties(kj.prototype,{credit:{get:function(){}}});kj.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var Xk=kj;var yQe={SHIFT:0,CTRL:1,ALT:2},Ta=Object.freeze(yQe);function Kk(){fe.throwInstantiationError()}Object.defineProperties(Kk.prototype,{ellipsoid:{get:fe.throwInstantiationError}});Kk.prototype.project=fe.throwInstantiationError;Kk.prototype.unproject=fe.throwInstantiationError;var ghe=Kk;var Uj=[],Vj=[];function xQe(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=Uj,u=Vj,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let g=c[f],h=u[d];f<s&&(d>=a||t(g,h,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=h,++d)}}function zj(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);zj(e,t,n,i,r),zj(e,t,n,r+1,o),xQe(e,t,n,i,r,o)}function bQe(e,t,n){let i=e.length,o=Math.ceil(i*.5);Uj.length=o,Vj.length=o,zj(e,t,n,0,i-1),Uj.length=0,Vj.length=0}var py=bQe;function ZA(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(ZA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});ZA.prototype.findTimeInterval=so.prototype.findTimeInterval;ZA.prototype.wrapTime=so.prototype.wrapTime;ZA.prototype.clampTime=so.prototype.clampTime;ZA.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var yhe=ZA;var CQe={NONE:-1,PARTIAL:0,FULL:1},gr=Object.freeze(CQe);function Qa(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var Jk=new m;Object.defineProperties(Qa.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,Jk),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,Jk);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,Jk),Jk)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Qa.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Qa(e,t)};var bhe=new m;Qa.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,bhe),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var TQe=new m;Qa.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,TQe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,bhe),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var AQe=new m;Qa.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return gr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,AQe),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?gr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?gr.FULL:gr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?gr.PARTIAL:gr.FULL))}}return gr.NONE};var Zk=new m;Qa.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,Zk),Zk),c=-m.dot(a,o),u=Qa._anyRotationVector(o,a,c),f=Qa._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Qa._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return m.add(o,m.multiplyByScalar(a,p,Zk),Zk)};var EQe=[];Qa.computeOccludeePointFromRectangle=function(e,t){t=y(t,oe.WGS84);let n=ce.subsample(e,t,0,EQe),i=ae.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return Qa.computeOccludeePoint(new ae(o,t.minimumRadius),i.center,n)};var SQe=new m;Qa._anyRotationVector=function(e,t,n){let i=m.abs(t,SQe),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var vQe=new m;Qa._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,vQe);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>P.EPSILON13)return m.normalize(s,new m)}return o};var Hj=new m,wQe=new m,$k=new m,xhe=new m;Qa._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,Hj),s=m.clone(e.center,wQe),a=e.radius,c=m.subtract(s,r,$k),u=m.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),h=1/Math.sqrt(u),b=p*h*p;c=m.normalize(c,c);let C=m.add(r,m.multiplyByScalar(c,b,xhe),xhe),T=Math.sqrt(d-b*b),A=this._rotationVector(s,t,n,r,i),S=m.fromElements(A.x*A.x*c.x+(A.x*A.y-A.z)*c.y+(A.x*A.z+A.y)*c.z,(A.x*A.y+A.z)*c.x+A.y*A.y*c.y+(A.y*A.z-A.x)*c.z,(A.x*A.z-A.y)*c.x+(A.y*A.z+A.x)*c.y+A.z*A.z*c.z,Hj);S=m.normalize(S,S);let v=m.multiplyByScalar(S,T,Hj);A=m.normalize(m.subtract(m.add(C,v,$k),s,$k),$k);let I=m.dot(t,A);A=m.normalize(m.subtract(m.subtract(C,v,A),s,A),A);let O=m.dot(t,A);return I<O?I:O};var Qk=Qa;function Gj(e,t,n){e=ve.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new wt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Gj.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Gj.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:_t(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var Che=Gj;var IQe={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},The=IQe;var DQe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},Ahe=DQe;var PQe=new m;function OQe(e,t,n,i){let o=Jb(e,t,n,i,PQe);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var Ehe=OQe;function She(){fe.throwInstantiationError()}She.prototype.getURL=fe.throwInstantiationError;var vhe=She;var RQe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Tn=Object.freeze(RQe);function _y(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=(t.clientX-o.left)*(i.offsetWidth/o.width),n.y=(t.clientY-o.top)*(i.offsetHeight/o.height),n}function Kj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Rx(e){if(e.shiftKey)return Ta.SHIFT;if(e.ctrlKey)return Ta.CTRL;if(e.altKey)return Ta.ALT}var fs={LEFT:0,MIDDLE:1,RIGHT:2};function du(e,t,n,i){function o(r){i(e,r)}Wt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function MQe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Wt.supportsPointerEvents()?(du(e,"pointerdown",t,UQe),du(e,"pointerup",t,Fhe),du(e,"pointermove",t,VQe),du(e,"pointercancel",t,Fhe)):(du(e,"mousedown",t,Bhe),du(e,"mouseup",n,khe),du(e,"mousemove",n,Uhe),du(e,"touchstart",t,BQe),du(e,"touchend",n,Ohe),du(e,"touchmove",n,kQe),du(e,"touchcancel",n,Ohe)),du(e,"dblclick",t,NQe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",du(e,i,t,FQe)}function LQe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var whe={position:new H};function Jj(e){e._lastSeenTouchEvent=Ti()}function Zj(e){return Ti()-e._lastSeenTouchEvent>Fd.mouseEmulationIgnoreMilliseconds}function Xj(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Bhe(e,t){if(!Zj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===fs.LEFT)i=Tn.LEFT_DOWN;else if(n===fs.MIDDLE)i=Tn.MIDDLE_DOWN;else if(n===fs.RIGHT)i=Tn.RIGHT_DOWN;else return;let o=_y(e,t,e._primaryPosition);H.clone(o,e._primaryStartPosition),H.clone(o,e._primaryPreviousPosition);let r=Rx(t),s=e.getInputAction(i,r);l(s)&&(H.clone(o,whe.position),s(whe),t.preventDefault())}var Ihe={position:new H},Dhe={position:new H};function Wj(e,t,n,i){let o=Rx(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=_y(e,i,e._primaryPosition);if(l(r)&&(H.clone(a,Ihe.position),r(Ihe)),l(s)){let c=e._primaryStartPosition;Xj(c,a,e._clickPixelTolerance)&&(H.clone(a,Dhe.position),s(Dhe))}}}function khe(e,t){if(!Zj(e))return;let n=t.button;n!==fs.LEFT&&n!==fs.MIDDLE&&n!==fs.RIGHT||(e._buttonDown[fs.LEFT]&&(Wj(e,Tn.LEFT_UP,Tn.LEFT_CLICK,t),e._buttonDown[fs.LEFT]=!1),e._buttonDown[fs.MIDDLE]&&(Wj(e,Tn.MIDDLE_UP,Tn.MIDDLE_CLICK,t),e._buttonDown[fs.MIDDLE]=!1),e._buttonDown[fs.RIGHT]&&(Wj(e,Tn.RIGHT_UP,Tn.RIGHT_CLICK,t),e._buttonDown[fs.RIGHT]=!1))}var jj={startPosition:new H,endPosition:new H};function Uhe(e,t){if(!Zj(e))return;let n=Rx(t),i=_y(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Tn.MOUSE_MOVE,n);l(r)&&(H.clone(o,jj.startPosition),H.clone(i,jj.endPosition),r(jj)),H.clone(i,o),(e._buttonDown[fs.LEFT]||e._buttonDown[fs.MIDDLE]||e._buttonDown[fs.RIGHT])&&t.preventDefault()}var Phe={position:new H};function NQe(e,t){let n=t.button,i;if(n===fs.LEFT)i=Tn.LEFT_DOUBLE_CLICK;else return;let o=Rx(t),r=e.getInputAction(i,o);l(r)&&(_y(e,t,Phe.position),r(Phe))}function FQe(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Rx(t),o=e.getInputAction(Tn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function BQe(e,t){Jj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,_y(e,r,new H));eU(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,H.clone(a.get(s)))}function Ohe(e,t){Jj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);eU(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var Rhe={position:new H},qj={position1:new H,position2:new H},Mhe={position:new H},Lhe={position:new H},Nhe={position:new H};function eU(e,t){let n=Rx(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[fs.LEFT]){if(e._buttonDown[fs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Tn.LEFT_UP,n),l(r)&&(H.clone(e._primaryPosition,Mhe.position),r(Mhe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Tn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];Xj(c,u,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,Lhe.position),s(Lhe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Tn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];H.clone(c,e._primaryPosition),H.clone(c,e._primaryStartPosition),H.clone(c,e._primaryPreviousPosition),e._buttonDown[fs.LEFT]=!0,r=e.getInputAction(Tn.LEFT_DOWN,n),l(r)&&(H.clone(c,Rhe.position),r(Rhe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Tn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];Xj(u,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,Nhe.position),s(Nhe))}},Fd.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Tn.PINCH_START,n),l(r)&&(H.clone(i.values[0],qj.position1),H.clone(i.values[1],qj.position2),r(qj),t.preventDefault()))}function kQe(e,t){Jj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&_y(e,r,u)}Vhe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,H.clone(a.get(s),c.get(s))}var Yj={startPosition:new H,endPosition:new H},gI={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function Vhe(e,t){let n=Rx(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[fs.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Tn.MOUSE_MOVE,n),l(s)&&(H.clone(c,Yj.startPosition),H.clone(a,Yj.endPosition),s(Yj)),H.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Tn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,h=f.x-u.x,x=f.y-u.y,b=Math.sqrt(h*h+x*x)*.25,C=(c.y+a.y)*.125,T=(f.y+u.y)*.125,A=Math.atan2(p,d),S=Math.atan2(x,h);H.fromElements(0,b,gI.distance.startPosition),H.fromElements(0,g,gI.distance.endPosition),H.fromElements(S,T,gI.angleAndHeight.startPosition),H.fromElements(A,C,gI.angleAndHeight.endPosition),s(gI)}}function UQe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,_y(e,t,new H)),eU(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else Bhe(e,t)}function Fhe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),eU(e,t),e._previousPositions.remove(i)}else khe(e,t)}function VQe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;_y(e,t,o),Vhe(e,t);let r=e._previousPositions;H.clone(n.get(i),r.get(i))}else Uhe(e,t)}function Fd(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Fd.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new At,this._previousPositions=new At,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),MQe(this)}Fd.prototype.setInputAction=function(e,t,n){let i=Kj(t,n);this._inputEvents[i]=e};Fd.prototype.getInputAction=function(e,t){let n=Kj(e,t);return this._inputEvents[n]};Fd.prototype.removeInputAction=function(e,t){let n=Kj(e,t);delete this._inputEvents[n]};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return LQe(this),ue(this)};Fd.mouseEmulationIgnoreMilliseconds=800;Fd.touchHoldDelayMilliseconds=1500;var _f=Fd;var $j={};function zQe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var HQe=32.184,GQe=2451545;function rpe(e,t){t=ee.addSeconds(e,HQe,t);let n=ee.totalDays(t)-GQe;return t=ee.addSeconds(t,zQe(n),t),t}var tU=new ee(2451545,0,Jn.TAI),WQe=1e3,gf=P.RADIANS_PER_DEGREE,mu=P.RADIANS_PER_ARCSECOND,Aa=14959787e4,zhe=new Z;function spe(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=qQe(r-i,t),d=jQe(t,0);ZQe(c,n,u,zhe);let p=a*(1+t),g=Math.cos(f),h=Math.sin(f),x=1+t*g,b=p/x;return l(s)?(s.x=b*g,s.y=b*h,s.z=0):s=new m(b*g,b*h,0),Z.multiplyByVector(zhe,s,s)}function jQe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function qQe(e,t){let n=KQe(e,t);return JQe(n,t)}var YQe=50,XQe=P.EPSILON8;function KQe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<YQe&&Math.abs(o-i)>XQe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function JQe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function ZQe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var $Qe=1.0000010178*Aa,QQe=100.46645683*gf,eet=129597742283429e-5*mu,Hhe=16002,Ghe=21863,Whe=32004,jhe=10931,qhe=14529,Yhe=16368,Xhe=15318,Khe=32794,tet=64*1e-7*Aa,net=-152*1e-7*Aa,iet=62*1e-7*Aa,oet=-8*1e-7*Aa,ret=32*1e-7*Aa,set=-41*1e-7*Aa,aet=19*1e-7*Aa,cet=-11*1e-7*Aa,uet=-150*1e-7*Aa,fet=-46*1e-7*Aa,det=68*1e-7*Aa,met=54*1e-7*Aa,het=14*1e-7*Aa,pet=24*1e-7*Aa,_et=-28*1e-7*Aa,get=22*1e-7*Aa,Jhe=10,Zhe=16002,$he=21863,Qhe=10931,epe=1473,tpe=32004,npe=4387,ipe=73,yet=-325*1e-7,xet=-322*1e-7,bet=-79*1e-7,Cet=232*1e-7,Tet=-52*1e-7,Aet=97*1e-7,Eet=55*1e-7,vet=-41*1e-7,wet=-105*1e-7,Iet=-137*1e-7,Det=258*1e-7,Pet=35*1e-7,Oet=-116*1e-7,Ret=-88*1e-7,Met=-112*1e-7,Let=-80*1e-7,$A=new ee(0,0,Jn.TAI);function Net(e,t){rpe(e,$A);let i=($A.dayNumber-tU.dayNumber+($A.secondsOfDay-tU.secondsOfDay)/$n.SECONDS_PER_DAY)/($n.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=$Qe+tet*Math.cos(Hhe*o)+uet*Math.sin(Hhe*o)+net*Math.cos(Ghe*o)+fet*Math.sin(Ghe*o)+iet*Math.cos(Whe*o)+det*Math.sin(Whe*o)+oet*Math.cos(jhe*o)+met*Math.sin(jhe*o)+ret*Math.cos(qhe*o)+het*Math.sin(qhe*o)+set*Math.cos(Yhe*o)+pet*Math.sin(Yhe*o)+aet*Math.cos(Xhe*o)+_et*Math.sin(Xhe*o)+cet*Math.cos(Khe*o)+get*Math.sin(Khe*o),s=QQe+eet*i+yet*Math.cos(Jhe*o)+wet*Math.sin(Jhe*o)+xet*Math.cos(Zhe*o)+Iet*Math.sin(Zhe*o)+bet*Math.cos($he*o)+Det*Math.sin($he*o)+Cet*Math.cos(Qhe*o)+Pet*Math.sin(Qhe*o)+Tet*Math.cos(epe*o)+Oet*Math.sin(epe*o)+Aet*Math.cos(tpe*o)+Ret*Math.sin(tpe*o)+Eet*Math.cos(npe*o)+Met*Math.sin(npe*o)+vet*Math.cos(ipe*o)+Let*Math.sin(ipe*o),a=.0167086342-.0004203654*i,c=102.93734808*gf+11612.3529*mu*i,u=469.97289*mu*i,f=174.87317577*gf-8679.27034*mu*i;return spe(r,a,u,c,f,s,t)}function ape(e,t){rpe(e,$A);let i=($A.dayNumber-tU.dayNumber+($A.secondsOfDay-tU.secondsOfDay)/$n.SECONDS_PER_DAY)/$n.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*gf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*gf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*gf,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*gf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*gf+mu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*gf+mu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*gf+mu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*gf+mu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*gf-mu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,O=4*C,R=6*C,N=2*A,F=3*A,_=4*A,E=2*T;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-A)-235.6*Math.cos(A)+218.1*Math.cos(I-S)+181*Math.cos(I+A),c+=.014216*Math.cos(I-A)+.008551*Math.cos(I-N)-.001383*Math.cos(A)+.001356*Math.cos(I+A)-.001147*Math.cos(O-F)-914e-6*Math.cos(O-N)+869e-6*Math.cos(I-S-A)-627e-6*Math.cos(I)-394e-6*Math.cos(O-_)+282e-6*Math.cos(I-S-N)-279e-6*Math.cos(C-A)-236e-6*Math.cos(N)+231e-6*Math.cos(O)+229e-6*Math.cos(R-_)-201e-6*Math.cos(N-E),f+=486.26*Math.cos(I-E)-40.13*Math.cos(I)+37.51*Math.cos(E)+25.73*Math.cos(N-E)+19.97*Math.cos(I-S-E),p+=-55609*Math.sin(I-A)-34711*Math.sin(I-N)-9792*Math.sin(A)+9385*Math.sin(O-F)+7505*Math.sin(O-N)+5318*Math.sin(I+A)+3484*Math.sin(O-_)-3417*Math.sin(I-S-A)-2530*Math.sin(R-_)-2376*Math.sin(I)-2075*Math.sin(I-F)-1883*Math.sin(N)-1736*Math.sin(R-5*A)+1626*Math.sin(S)-1370*Math.sin(R-F),h+=-5392*Math.sin(I-E)-540*Math.sin(S)-441*Math.sin(I)+423*Math.sin(E)-288*Math.sin(N-E),b+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-A)-662.5*Math.sin(S)+396.3*Math.sin(A)-218*Math.sin(I-S);let w=2*v,D=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(I-E+v)*i+.614*Math.cos(I-E-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(I-E+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(D)*r+4e-5*Math.cos(w)*r;let M=2.116*Math.sin(v)*i-.111*Math.sin(I-E-v)*i-.0015*Math.sin(v)*o;p+=M,b+=M,h+=-520.77*Math.sin(v)*i+13.66*Math.sin(I-E+v)*i+1.12*Math.sin(I-v)*i-1.06*Math.sin(E-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(I-E+w)*o-.015*Math.sin(I-E+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(D)*r-9e-4*Math.sin(w)*r,a*=WQe;let B=u+f*mu,V=d+p*mu,U=x+b*mu,G=g+h*mu;return spe(a,c,B,V,G,U,t)}var ope=.012300034,Fet=ope/(ope+1)*-1;function Bet(e,t){return t=ape(e,t),m.multiplyByScalar(t,Fet,t)}var cpe=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),yI=new m;$j.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),yI=Net(e,yI),t=m.negate(yI,t),Bet(e,yI),m.subtract(t,yI,t),Z.multiplyByVector(cpe,t,t),t};$j.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=ape(e,t),Z.multiplyByVector(cpe,t,t),t};var Mx=$j;function ket(e,t,n,i,o,r,s){let a=Mi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,h=i.green,x=i.blue,b=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)r[s++]=z.floatToByte(u),r[s++]=z.floatToByte(f),r[s++]=z.floatToByte(d),r[s++]=z.floatToByte(p);return s}let C=(g-u)/a,T=(h-f)/a,A=(x-d)/a,S=(b-p)/a,v=s;for(c=0;c<a;c++)r[v++]=z.floatToByte(u+c*C),r[v++]=z.floatToByte(f+c*T),r[v++]=z.floatToByte(d+c*A),r[v++]=z.floatToByte(p+c*S);return v}function xI(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Qt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+oe.packedLength+3}xI.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};xI.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=oe.unpack(e,t);t+=oe.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new xI({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var nU=new Array(2),iU=new Array(2),Uet={positions:nU,height:iU,ellipsoid:void 0,minDistance:void 0,granularity:void 0};xI.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,h,x=0;if(o===Qt.GEODESIC||o===Qt.RHUMB){let S,v,I;o===Qt.GEODESIC?(S=P.chordLength(r,s.maximumRadius),v=Mi.numberOfPoints,I=Mi.generateArc):(S=r,v=Mi.numberOfPointsRhumbLine,I=Mi.generateRhumbArc);let O=Mi.extractHeights(t,s),R=Uet;if(o===Qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,c){let N=0;for(u=0;u<f-1;u++)N+=v(t[u],t[u+1],S)+1;d=new Float64Array(N*3),g=new Uint8Array(N*4),R.positions=nU,R.height=iU;let F=0;for(u=0;u<f-1;++u){nU[0]=t[u],nU[1]=t[u+1],iU[0]=O[u],iU[1]=O[u+1];let _=I(R);if(l(n)){let E=_.length/3;h=n[u];for(let w=0;w<E;++w)g[F++]=z.floatToByte(h.red),g[F++]=z.floatToByte(h.green),g[F++]=z.floatToByte(h.blue),g[F++]=z.floatToByte(h.alpha)}d.set(_,x),x+=_.length}}else if(R.positions=t,R.height=O,d=new Float64Array(I(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let F=t[u],_=t[u+1],E=n[u],w=n[u+1];x=ket(F,_,E,w,a,g,x)}let N=n[f-1];g[x++]=z.floatToByte(N.red),g[x++]=z.floatToByte(N.green),g[x++]=z.floatToByte(N.blue),g[x++]=z.floatToByte(N.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let I=t[u];if(c&&u>0&&(m.pack(I,d,S),S+=3,h=n[u-1],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha)),c&&u===f-1)break;m.pack(I,d,S),S+=3,l(n)&&(h=n[u],g[v++]=z.floatToByte(h.red),g[v++]=z.floatToByte(h.green),g[v++]=z.floatToByte(h.blue),g[v++]=z.floatToByte(h.alpha))}}let b=new gn;b.position=new Pe({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new Pe({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let C=(p-1)*2,T=Ue.createTypedArray(p,C),A=0;for(u=0;u<p-1;++u)T[A++]=u,T[A++]=u+1;return new dt({attributes:b,indices:T,primitiveType:Fe.LINES,boundingSphere:ae.fromPoints(t)})};var lpe=xI;function QA(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ks(i),this._workerName="createSphereGeometry"}QA.packedLength=Ks.packedLength;QA.pack=function(e,t,n){return Ks.pack(e._ellipsoidGeometry,t,n)};var Vet=new Ks,gy={radius:void 0,radii:new m,vertexFormat:new Me,stackPartitions:void 0,slicePartitions:void 0};QA.unpack=function(e,t,n){let i=Ks.unpack(e,t,Vet);return gy.vertexFormat=Me.clone(i._vertexFormat,gy.vertexFormat),gy.stackPartitions=i._stackPartitions,gy.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,gy.radii),n._ellipsoidGeometry=new Ks(gy),n):(gy.radius=i._radii.x,new QA(gy))};QA.createGeometry=function(e){return Ks.createGeometry(e._ellipsoidGeometry)};var upe=QA;var zet={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=zet;function yy(e){}Object.defineProperties(yy.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});yy.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;yy.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;yy.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;yy.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;yy.prototype.tileXYToRectangle=fe.throwInstantiationError;yy.prototype.positionToTileXY=fe.throwInstantiationError;var fpe=yy;function Lx(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Ge.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Lx.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(Lx.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=Het(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Lx.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};Lx.prototype.isDestroyed=function(){return!1};Lx.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};Lx.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,Ge.MINIMUM_VALUE),s=ee.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Het(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var dpe=Lx;function Get(e,t){this.rectangle=e,this.maxLevel=t}function Qj(e){this.ellipsoid=y(e.ellipsoid,oe.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Qj.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles,e._ready=!0};function Wet(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Yi({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Get(new ce(a,c,u,f),d))}}function jet(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function mpe(e,t,n){try{let i=await t.fetchXML();Wet(e,i)}catch(i){jet(t,i,n)}}function xy(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;if(typeof t=="string"&&(t=new wt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[],l(e.url)){Q("VRTheWorldTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. VRTheWorldTerrainProvider.fromUrl instead.");let n=this,i=new Qj(e),o=ve.createIfNeeded(e.url);this._resource=o,this._readyPromise=mpe(i,o,n).then(()=>(i.build(n),!0))}}Object.defineProperties(xy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return Q("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});xy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new Qj(t),i=ve.createIfNeeded(e);await mpe(n,i);let o=new xy(t);return n.build(o),o._resource=i,o};xy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Za({buffer:Jd(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:qet(a,e,t,n),structure:a._terrainDataStructure})})};xy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var hpe=new ce;function qet(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ce.intersection(f,s,hpe);l(d)&&(oU(o,f,t*2,n*2,i+1)&&(a|=4),oU(o,f,t*2+1,n*2,i+1)&&(a|=8),oU(o,f,t*2,n*2+1,i+1)&&(a|=1),oU(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function oU(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,hpe))}xy.prototype.getTileDataAvailable=function(e,t,n){};xy.prototype.loadTileDataAvailability=function(e,t,n){};var ppe=xy;var Yet={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},_pe=Object.freeze(Yet);function Xet(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var gpe=Xet;function Ket(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var rU=Ket;var eE=`in vec4 position; +in vec2 textureCoordinates; + +out vec2 v_textureCoordinates; + +void main() +{ + gl_Position = position; + v_textureCoordinates = textureCoordinates; } -`;mh.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Bt({context:e,width:s,height:a,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Qe.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Ou({context:e,width:s,height:a,format:Gc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(rut),this._rsClassified=ze.fromCache(out),this._rsDefault=ze.fromCache(sut)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?cut:aut,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),d=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(xu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};mh.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};mh.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};mh.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};mh.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};mh.prototype.isDestroyed=function(){return!1};mh.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var nI=mh;function n4(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(n4.prototype,{total:{get:function(){return this._total}}});function vy(e){let t=new Array(Fa.NUMBER_OF_JOB_TYPES);t[Fa.TEXTURE]=new n4(l(e)?e[Fa.TEXTURE]:10),t[Fa.PROGRAM]=new n4(l(e)?e[Fa.PROGRAM]:10),t[Fa.BUFFER]=new n4(l(e)?e[Fa.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}vy.getTimestamp=Ci;Object.defineProperties(vy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});vy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};vy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};vy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=vy.getTimestamp();e.execute();let a=vy.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var i4=vy;var lye=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function r4(e,t){this.spatialNode=e,this.keyframe=t,this.state=lye.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}r4.priorityComparator=function(e,t){return e.priority-t.priority};r4.searchComparator=function(e,t){return e.keyframe-t.keyframe};r4.LoadState=lye;var Qi=r4;function uye(){}Object.defineProperties(uye.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var fye=uye;var lut=/\/$/,dye=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function Ab(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let r=y(e.tilesize,512);this._tilesize=r;let o=y(e.username,"mapbox");this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();lut.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=dye,this._resource=i,this._imageryProvider=new $s({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(Ab.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return $("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return $("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ab.prototype.getTileCredits=function(e,t,n){};Ab.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Ab.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Ab._defaultCredit=dye;var mye=Ab;function wy(e,t,n,i,r){i===on.UNSIGNED_SHORT&&(i=on.FLOAT32);let o=e.floatingPointTexture;if(i===on.FLOAT32&&!o)throw new de("Floating point texture not supported");let s;i===on.FLOAT32||i===on.FLOAT64?s=Qe.FLOAT:i===on.UINT8&&(s=Qe.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?ct.RED:ct.LUMINANCE:n===2?a=e.webgl2?ct.RG:ct.LUMINANCE_ALPHA:n===3?a=ct.RGB:n===4&&(a=ct.RGBA);let c=512*1024*1024,u=128*1024*1024;r=Math.min(y(r,u),c);let f=Gt.maximumTextureSize,d=on.getSizeInBytes(i),p=Math.floor(r/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),A=Math.ceil(t.z/h),x=h*t.x,C=A*t.y,T=Math.floor(g/x),E=Math.floor(g/C);if(T===0||E===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=T*E,this.regionCountPerMegatexture=new H(T,E),this.voxelCountPerRegion=new H(x,C),this.sliceCountPerRegion=new H(h,A),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(x/g,C/g),this.texture=new Bt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:bi.LINEAR})});let S=on.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,x*C*n),this.nodes=new Array(this.maximumTileCount);for(let w=0;w<this.maximumTileCount;w++)this.nodes[w]=new uut(w);for(let w=0;w<this.maximumTileCount;w++){let D=this.nodes[w];D.previousNode=w>0?this.nodes[w-1]:void 0,D.nextNode=w<this.maximumTileCount-1?this.nodes[w+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function uut(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}wy.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};wy.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};wy.prototype.isFull=function(){return this.emptyList===void 0};wy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===on.UNSIGNED_SHORT&&(i=on.FLOAT32);let r=on.getSizeInBytes(i),o=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(o)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*r};wy.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,r=this.sliceCountPerRegion,o=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let A=0;A<i.z;A++){let x=A%r.x*i.x,C=Math.floor(A/r.x)*i.y;for(let T=0;T<i.y;T++)for(let E=0;E<i.x;E++){let S=A*i.y*i.x+T*i.x+E,w=(C+T)*o.x+(x+E);for(let D=0;D<s;D++)a[w*s+D]=n[S*s+D]}}let c=this.regionCountPerMegatexture,u=o.x,f=o.y,d=e%c.x*o.x,p=Math.floor(e/c.x)*o.y,h={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};wy.prototype.isDestroyed=function(){return!1};wy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var iI=wy;function rI(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,re.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new dk({radii:this.ellipsoid.radii,material:Gi.fromType(Gi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new jU}Object.defineProperties(rI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var o4=new Z,fut=new Z,dut=new m,s4=[];rI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,o4))||Mt.computeTemeToPseudoFixedMatrix(n,o4);let i=this._axes.evaluate(n,fut);Z.transpose(i,i),Z.multiply(o4,i,i);let r=Jy.computeMoonPositionInEarthInertialFrame(n,dut);Z.multiplyByVector(o4,r,r),B.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=s4,s4.length=0,t.update(e),e.commandList=o,s4.length===1?s4[0]:void 0};rI.prototype.isDestroyed=function(){return!1};rI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var a4=rI;function $Y(e){}$Y.prototype.isReady=function(){return!0};$Y.prototype.shouldDiscardImage=function(e){return!1};var hye=$Y;var oI=`#ifdef MRT +`;function sU(e){this._context=e}var bI,Jet=new nt({primitiveType:Fe.TRIANGLES}),Zet=new ui({color:new z(0,0,0,0)});function $et(e,t){return new pa({context:e,colorTextures:[t],destroyAttachments:!1})}function Qet(e,t){return $t.fromCache({context:e,vertexShaderSource:eE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function ett(e,t){return(!l(bI)||bI.viewport.width!==e||bI.viewport.height!==t)&&(bI=Ve.fromCache({viewport:new Ke(0,0,e,t)})),bI}sU.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:Qet(o,e.fragmentShaderSource),a=$et(o,t),c=ett(n,i),u=e.uniformMap,f=Zet;f.framebuffer=a,f.renderState=c,f.execute(o);let d=Jet;d.vertexArray=r,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};sU.prototype.isDestroyed=function(){return!1};sU.prototype.destroy=function(){return ue(this)};var aU=sU;function ttt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Mc=ttt;function Bd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Bd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Bd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function ntt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Bd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new We({sources:[t]})),typeof n=="string"&&(n=new We({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?ntt(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new $t({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Bd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){eq(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Bd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Bd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new We({sources:[r]})),typeof s=="string"&&(s=new We({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function eq(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];eq(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Bd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];eq(this,n),--this._numberOfShaders}this._shadersToRelease={}};Bd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var cU=Bd;function Nx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Nx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Nx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Nx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Nx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Nx.prototype.isDestroyed=function(){return!1};Nx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var lU=Nx;function itt(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var by=itt;function tE(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new re,this._viewportDirty=!1,this._viewportOrthographicMatrix=L.clone(L.IDENTITY),this._viewportTransformation=L.clone(L.IDENTITY),this._model=L.clone(L.IDENTITY),this._view=L.clone(L.IDENTITY),this._inverseView=L.clone(L.IDENTITY),this._projection=L.clone(L.IDENTITY),this._infiniteProjection=L.clone(L.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new re,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.clone(L.IDENTITY),this._view3DDirty=!0,this._view3D=new L,this._inverseView3DDirty=!0,this._inverseView3D=new L,this._inverseModelDirty=!0,this._inverseModel=new L,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,this._inverseProjectionDirty=!0,this._inverseProjection=new L,this._modelViewDirty=!0,this._modelView=new L,this._modelView3DDirty=!0,this._modelView3D=new L,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new L,this._inverseModelViewDirty=!0,this._inverseModelView=new L,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new L,this._viewProjectionDirty=!0,this._viewProjection=new L,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new L,this._modelViewProjectionDirty=!0,this._modelViewProjection=new L,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new L,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new L,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new L,this._normalDirty=!0,this._normal=new Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new qn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(tE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return ype(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return ype(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){L.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,L.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,L.getMatrix3(this.inverseModel,e),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return tq(this),this._view3D}},viewRotation:{get:function(){return tq(this),this._viewRotation}},viewRotation3D:{get:function(){return tq(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Cpe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Cpe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return mtt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return htt(this),this._modelView}},modelView3D:{get:function(){return ptt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Ctt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return _tt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return gtt(this),this._inverseModelView3D}},viewProjection:{get:function(){return ytt(this),this._viewProjection}},inverseViewProjection:{get:function(){return xtt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return btt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Ttt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Att(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Ett(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Stt(this),this._normal}},normal3D:{get:function(){return vtt(this),this._normal3D}},inverseNormal:{get:function(){return wtt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Itt(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return bpe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return bpe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,oe.WGS84)}}});function ott(e,t){L.clone(t,e._view),L.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function rtt(e,t){L.clone(t,e._inverseView),L.getMatrix3(t,e._inverseViewRotation)}function stt(e,t){L.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function att(e,t){L.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function ctt(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var CI=new Z,ltt=new me;function utt(e,t){l(Mt.computeIcrfToFixedMatrix(t.time,CI))||(CI=Mt.computeTemeToPseudoFixedMatrix(t.time,CI));let n=Mx.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(CI,n,n),m.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Mx.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(CI,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,ltt);i.project(r,e._sunPositionColumbusView)}tE.prototype.updateCamera=function(e){ott(this,e.viewMatrix),rtt(this,e.inverseViewMatrix),ctt(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof on};tE.prototype.updateFrustum=function(e){stt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&att(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};tE.prototype.updatePass=function(e){this._pass=e};var ftt=[],dtt=new by;tE.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),utt(this,e);let n=y(e.light,dtt);n instanceof by?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,ftt),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function ype(e){if(e._viewportDirty){let t=e._viewport;L.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),L.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function mtt(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?L.inverse(e._projection,e._inverseProjection):L.clone(L.ZERO,e._inverseProjection))}function htt(e){e._modelViewDirty&&(e._modelViewDirty=!1,L.multiplyTransformation(e._view,e._model,e._modelView))}function ptt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,L.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function _tt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,L.inverse(e.modelView,e._inverseModelView))}function gtt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,L.inverse(e.modelView3D,e._inverseModelView3D))}function ytt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,L.multiply(e._projection,e._view,e._viewProjection))}function xtt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,L.inverse(e.viewProjection,e._inverseViewProjection))}function btt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,L.multiply(e._projection,e.modelView,e._modelViewProjection))}function Ctt(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function Ttt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,L.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Att(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,L.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Ett(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,L.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Stt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;L.getMatrix3(e.inverseModelView,t),Z.getRotation(t,t),Z.transpose(t,t)}}function vtt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;L.getMatrix3(e.inverseModelView3D,t),Z.getRotation(t,t),Z.transpose(t,t)}}function wtt(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,L.getMatrix3(e.inverseModelView,e._inverseNormal),Z.getRotation(e._inverseNormal,e._inverseNormal))}function Itt(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,L.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Z.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var xpe=new m;function bpe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,L.multiplyByPoint(e.inverseModel,e._cameraPosition,xpe),qn.fromCartesian(xpe,e._encodedCameraPositionMC))}var Dtt=new m,Ptt=new m,Ott=new m,Rtt=new m,Mtt=new me,Ltt=new m,Ntt=new L;function Ftt(e,t,n,i,o,r,s,a){let c=Dtt;c.x=e.y,c.y=e.z,c.z=e.x;let u=Ptt;u.x=n.y,u.y=n.z,u.z=n.x;let f=Ott;f.x=i.y,f.y=i.z,f.z=i.x;let d=Rtt;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,Mtt);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,Ltt),x=Mt.eastNorthUpToFixedFrame(h,g,Ntt);return L.multiplyByPointAsVector(x,u,u),L.multiplyByPointAsVector(x,f,f),L.multiplyByPointAsVector(x,d,d),l(a)||(a=new L),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function tq(e){e._view3DDirty&&(e._mode===ne.SCENE3D?L.clone(e._view,e._view3D):Ftt(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),L.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Cpe(e){e._inverseView3DDirty&&(L.inverseTransformation(e.view3D,e._inverseView3D),L.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var uU=tE;function hu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):Btt(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new cU(this),this._textureCache=new lU;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Gt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Gt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Gt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Gt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Gt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Gt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Gt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Gt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Gt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Gt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Gt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Gt._minimumAliasedLineWidth=f[0],Gt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Gt._minimumAliasedPointSize=d[0],Gt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Gt._maximumViewportWidth=p[0],Gt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Gt._highpFloatSupported=g.precision!==0;let h=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Gt._highpIntSupported=h.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Ir(u,["OES_standard_derivatives"]),this._blendMinmax=!!Ir(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Ir(u,["OES_element_index_uint"]),this._depthTexture=!!Ir(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Ir(u,["EXT_frag_depth"]),this._debugShaders=Ir(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Ir(u,["OES_texture_float"]),this._textureHalfFloat=!!Ir(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Ir(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Ir(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Ir(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Ir(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Ir(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Ir(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Ir(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Ir(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Ir(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Ir(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Ir(u,["EXT_texture_compression_bptc"]),Rl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?Ir(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Gt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,C,T,A,S,v,I,O,R,N;if(c){let w=this;b=function(){return w._gl.createVertexArray()},C=function(D){w._gl.bindVertexArray(D)},T=function(D){w._gl.deleteVertexArray(D)},A=function(D,M,B,V,U){u.drawElementsInstanced(D,M,B,V,U)},S=function(D,M,B,V){u.drawArraysInstanced(D,M,B,V)},v=function(D,M){u.vertexAttribDivisor(D,M)},I=function(D){u.drawBuffers(D)}}else O=Ir(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},C=function(w){O.bindVertexArrayOES(w)},T=function(w){O.deleteVertexArrayOES(w)}),R=Ir(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,D,M,B,V){R.drawElementsInstancedANGLE(w,D,M,B,V)},S=function(w,D,M,B){R.drawArraysInstancedANGLE(w,D,M,B)},v=function(w,D){R.vertexAttribDivisorANGLE(w,D)}),N=Ir(u,["WEBGL_draw_buffers"]),l(N)&&(I=function(w){N.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=C,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=I,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!N,Gt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Gt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new uU,_=new Mc(this),E=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=E,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Gt._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,E,_)}function Btt(e,t,n){if(typeof WebGLRenderingContext>"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new de("The browser supports WebGL, but initialization failed.");return r}function ktt(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Utt(e,t,n,i){let o=`${ktt(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function Vtt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new de(Utt(e,t,n,i))}function ztt(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function Htt(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,ztt(e,o,t))}return i}function Ir(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var Gtt={};Object.defineProperties(hu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Htt(this._originalGLContext,e?Vtt:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Lt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Lt({context:this,pixelFormat:lt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Lt({context:this,pixelFormat:lt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new uc({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Gtt}}});function Tpe(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var nq;typeof WebGLRenderingContext<"u"&&(nq=[te.BACK]);function iq(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=nq;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Wtt=new ui;hu.prototype.clear=function(e,t){e=y(e,Wtt),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);Tpe(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);iq(this,c),n.clear(i)};function jtt(e,t,n,i,o){iq(e,t),Tpe(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function qtt(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,L.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(a=y(a,r.numberOfVertices),c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}hu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),jtt(this,o,t,n,r),qtt(this,e,n,i)};hu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=nq;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};hu.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Je.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=lt.createTypedArray(lt.RGBA,a,o,r);return iq(this,s),t.readPixels(n,i,o,r,lt.RGBA,Je.toWebGLConstant(a,this),c),c};var Ape={position:0,textureCoordinates:1};hu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new dt({attributes:{position:new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fe.TRIANGLES});e=ai.fromGeometry({context:this,geometry:t,attributeLocations:Ape,bufferUsage:ke.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};hu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fe.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:eE,fragmentShaderSource:e,attributeLocations:Ape}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};hu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function oq(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(oq.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});oq.prototype.destroy=function(){delete this._pickObjects[this.key]};hu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new oq(this._pickObjects,t,z.fromRgba(t))};hu.prototype.isDestroyed=function(){return!1};hu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};hu._deprecationWarning=Q;var fU=hu;function Ytt(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[ve.createIfNeeded(t.positiveX).fetchImage(i),ve.createIfNeeded(t.negativeX).fetchImage(i),ve.createIfNeeded(t.positiveY).fetchImage(i),ve.createIfNeeded(t.negativeY).fetchImage(i),ve.createIfNeeded(t.positiveZ).fetchImage(i),ve.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new uc({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var dU=Ytt;var TI=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -12941,1070 +8723,926 @@ void main() discard; } -`;var c4=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ +`;var Cy=`uniform vec3 u_radiiAndDynamicAtmosphereColor; -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; +uniform float u_atmosphereLightIntensity; +uniform float u_atmosphereRayleighScaleHeight; +uniform float u_atmosphereMieScaleHeight; +uniform float u_atmosphereMieAnisotropy; +uniform vec3 u_atmosphereRayleighCoefficient; +uniform vec3 u_atmosphereMieCoefficient; + +const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. +const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. +const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. + +/** + * Rational approximation to tanh(x) +*/ +float approximateTanh(float x) { + float x2 = x * x; + return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); +} + +/** + * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as + * the transmittance value for the ray. + * + * @param {czm_ray} primaryRay The ray from the camera to the position. + * @param {float} primaryRayLength The length of the primary ray. + * @param {vec3} lightDirection The direction of the light to calculate the scattering from. + * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. + * @param {vec3} mieColor The variable the Mie scattering will be written to. + * @param {float} opacity The variable the transmittance will be written to. + * @glslFunction + */ +void computeScattering( + czm_ray primaryRay, + float primaryRayLength, + vec3 lightDirection, + float atmosphereInnerRadius, + out vec3 rayleighColor, + out vec3 mieColor, + out float opacity +) { -in vec2 v_textureCoordinates; + // Initialize the default scattering amounts to 0. + rayleighColor = vec3(0.0); + mieColor = vec3(0.0); + opacity = 0.0; -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif + vec3 origin = vec3(0.0); - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; + // Calculate intersection from the camera to the outer ring of the atmosphere. + czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;function Jp(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new oi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new oi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new oi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new oi({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function pye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function eq(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function _ye(e){pye(e),eq(e)}function mut(e,t,n,i){pye(e),e._accumulationTexture=new Bt({context:t,width:n,height:i,pixelFormat:ct.RGBA,pixelDatatype:Qe.FLOAT});let r=new Float32Array(n*i*4);e._revealageTexture=new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Qe.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}function hut(e,t){eq(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(eq(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(_ye(e),e._translucentMultipassSupport=!1,i=!1)}return i}Jp.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,mut(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!hut(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new He({sources:[c4]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new He({defines:["MRT"],sources:[oI]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new He({sources:[oI]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var put={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.ONE,functionDestinationRgb:br.ONE,functionSourceAlpha:br.ZERO,functionDestinationAlpha:br.ONE_MINUS_SOURCE_ALPHA},_ut={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.ONE,functionDestinationRgb:br.ONE,functionSourceAlpha:br.ONE,functionDestinationAlpha:br.ONE},gut={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:br.ZERO,functionDestinationRgb:br.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:br.ZERO,functionDestinationAlpha:br.ONE_MINUS_SOURCE_ALPHA};function tq(e,t,n,i){let r=n[i.id];if(!l(r)){let o=ze.getState(i);o.depthMask=!1,o.blending=t,r=ze.fromCache(o),n[i.id]=r}return r}function yut(e,t,n){return tq(t,put,e._translucentRenderStateCache,n)}function Aut(e,t,n){return tq(t,_ut,e._translucentRenderStateCache,n)}function xut(e,t,n){return tq(t,gut,e._alphaRenderStateCache,n)}var Cut=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragData_0 = vec4(Ci * wzi, ai); - out_FragData_1 = vec4(ai * wzi); -`,Tut=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; - float ai = czm_out_FragColor.a; - float wzi = czm_alphaWeight(ai); - out_FragColor = vec4(Ci, ai) * wzi; -`,Eut=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function nq(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; -bool czm_discard = false; -`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; -${u}`}return a.sources.push(u),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; + // Return empty colors if no intersection with the atmosphere geometry. + if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { + return; } -${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function but(e,t){return nq(e,t,"translucentMRT",Cut)}function Sut(e,t){return nq(e,t,"translucentMultipass",Tut)}function vut(e,t){return nq(e,t,"alphaMultipass",Eut)}Jp.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=but(t,e.shaderProgram),n.translucentCommand.renderState=yut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Sut(t,e.shaderProgram),n.translucentCommand.renderState=Aut(this,t,e.renderState),n.alphaCommand.shaderProgram=vut(t,e.shaderProgram),n.alphaCommand.renderState=xut(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function wut(e,t,n,i,r,o){let s,a,c,{context:u,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,A=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let x=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x);for(l(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<r.length;++c)s=r[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x);l(o)&&(s=o.unclassifiedCommand,a=A&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x)),i.framebuffer=h}function Dut(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,A;for(let x=0;x<r.length;++x)h=r[x],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g);l(o)&&(h=o.unclassifiedCommand,A=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(A,t,s,i,g)),i.framebuffer=d}Jp.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){Dut(this,e,t,n,i,r);return}wut(this,e,t,n,i,r)};Jp.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Jp.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};Jp.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Jp.prototype.isDestroyed=function(){return!1};Jp.prototype.destroy=function(){return _ye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var l4=Jp;var Iut=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function u4(e){e=y(e,y.EMPTY_OBJECT);let t=ve.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new Uo({ellipsoid:e.ellipsoid}),i=256,r=256,o=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),o),u=n.positionToTileXY(ce.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,Iut);typeof d=="string"&&(d=new It(d)),$s.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(u4.prototype=Object.create($s.prototype),u4.prototype.constructor=u4);var xb=u4;var Put=new H(1,1);function iq(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,Put)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(iq.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var gye=new m;iq.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,gye),m.add(this.position,gye,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var sI=iq;function yye(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(yye.prototype,{complete:{get:function(){return this._complete}}});var Aye=yye;function xye(e){}xye.prototype.emit=function(e){fe.throwInstantiationError()};var Cye=xye;var Tye=new H(1,1);function aI(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new VV(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._emitterModelMatrix=B.clone(y(e.emitterModelMatrix,B.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new B,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,Tye))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,Tye))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(aI.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!B.equals(this._modelMatrix,e),B.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!B.equals(this._emitterModelMatrix,e),B.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function Out(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new sI;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function Rut(e){let t=e._particlePool.pop();return l(t)||(t=new sI),t}function Mut(e,t){e._particlePool.push(t)}function But(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function Lut(e){l(e._billboard)&&(e._billboard.show=!1)}function Eye(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function Nut(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Fut(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var f4=new m;aI.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new ju),this._updateParticlePool&&(Out(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?Eye(this,s):(Lut(s),Mut(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=Fut(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=B.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=Rut(this),this._emitter.emit(s),m.add(s.position,s.velocity,f4),B.multiplyByPoint(u,f4,f4),s.position=B.multiplyByPoint(u,s.position,s.position),m.subtract(f4,s.position,s.velocity),m.normalize(s.velocity,s.velocity),Nut(this,s),Eye(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&But(this)};aI.prototype.isDestroyed=function(){return!1};aI.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var bye=aI;function d4(e){e=y(e,y.EMPTY_OBJECT);let t=Mn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ci(),this._lastMsSampleTime=Ci(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(d4.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});d4.prototype.update=function(e){let t=Ci(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};d4.prototype.destroy=function(){return ue(this)};var Dy=d4;function qA(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(qA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Uut(e,t,n){let i=n.width,r=n.height;e._framebuffer.update(t,i,r)}function Vut(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); -} -`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:ze.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}qA.prototype.update=function(e,t){Uut(this,e,t),Vut(this,e,t)};var kut=new oe,zut=new oe(1,1/255,1/65025,1/16581375);qA.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=oe.unpack(i,0,kut);return oe.divideByScalar(r,255,r),oe.dot(r,zut)};qA.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};qA.prototype.isDestroyed=function(){return!1};qA.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var m4=qA;function cI(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(cI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Hut(e){e._framebuffer.destroy()}function Gut(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new fc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Ke},r.viewport=new Ke,e._passState=r}cI.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&Gut(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};cI.prototype.isDestroyed=function(){return!1};cI.prototype.destroy=function(){return Hut(this),ue(this)};var h4=cI;function uI(e){let t=new fc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}uI.prototype.begin=function(e,t){let n=this._context,i=t.width,r=t.height;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};var lI=new z;uI.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),s=o*o,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+u+a);lI.red=z.byteToFloat(r[h]),lI.green=z.byteToFloat(r[h+1]),lI.blue=z.byteToFloat(r[h+2]),lI.alpha=z.byteToFloat(r[h+3]);let A=i.getObjectByPickColor(lI);if(l(A))return A}if(u===f||u<0&&-u===f||u>0&&u===1-f){let h=d;d=-p,p=h}u+=d,f+=p}};uI.prototype.isDestroyed=function(){return!1};uI.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var p4=uI;function Zp(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new oi({color:new z(0,0,0,0),depth:1,owner:this})}function Wut(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Zp.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Zp.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT:Qe.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};Zp.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Zp.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Zp.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Zp.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Zp.prototype.isDestroyed=function(){return!1};Zp.prototype.destroy=function(){return Wut(this),ue(this)};var Cb=Zp;function XA(){}XA.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};XA.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=He.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=He.replaceMain(r[u],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`;r.push(c)}return new He({defines:i,sources:r})};XA.createShadowCastFragmentShader=function(e,t,n,i){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=o.length;for(let f=0;f<c;++f)o[f]=He.replaceMain(o[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,o.push(u),new He({defines:r,sources:o})};XA.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};XA.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new He({defines:i,sources:r})};XA.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=He.findNormalVarying(e),s=!i&&l(o)||i&&r,a=He.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,A=t.softShadows,x=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),T=e.sources.slice(0),E=T.length;for(let D=0;D<E;++D)T[D]=He.replaceMain(T[D],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),A&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; -`:S+=`uniform sampler2D shadowMap_texture; -`;let w;return c?w=` return vec4(${a}, 1.0); -`:w=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,S+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${w}} -vec3 getNormalEC() -{ -${s?` return normalize(${o}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${x.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,S+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,S+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; - float distance = length(directionEC); - directionEC = normalize(directionEC); - float radius = shadowMap_lightPositionEC.w; - // Stop early if the fragment is beyond the point light radius - if (distance > radius) - { - return; - } - vec3 directionWC = czm_inverseViewRotation * directionEC; - shadowParameters.depth = distance / radius; - shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - shadowParameters.texCoords = directionWC; - float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); -`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${h?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,S+=` out_FragColor.rgb *= visibility; -} -`,T.push(S),new He({defines:C,sources:T})};var Qp=XA;function hh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(jt.isInternetExplorer()||jt.isEdge()||(jt.isChrome()||jt.isFirefox())&&jt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new B,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new _4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Po:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new B,new B,new B,new B],this._cascadeDistances=new oe;let r;this._isPointLight?r=6:this._cascadesEnabled?r=this._numberOfCascades:r=1,this._passes=new Array(r);for(let o=0;o<r;++o)this._passes[o]=new jut(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,oq(this),this._clearCommand=new oi({depth:1,color:new z}),this._clearPassState=new fc(t),this._size=y(e.size,2048),this.size=this._size}hh.MAXIMUM_DISTANCE=2e4;function jut(e){this.camera=new _4,this.passState=new fc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function rq(e,t){return ze.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function oq(e){let t=!e._usesDepthTexture;e._primitiveRenderState=rq(t,e._primitiveBias),e._terrainRenderState=rq(t,e._terrainBias),e._pointRenderState=rq(t,e._pointBias)}hh.prototype.debugCreateRenderStates=function(){oq(this)};Object.defineProperties(hh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Zut(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function sq(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Yut(e,t){let n=new Ou({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Gc.DEPTH_COMPONENT16}),i=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,sampler:mn.NEAREST}),r=new ca({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function qut(e,t){let n=new Bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Qe.UNSIGNED_INT_24_8,sampler:mn.NEAREST}),i=new ca({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Xut(e,t){let n=new Ou({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Gc.DEPTH_COMPONENT16}),i=new uc({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,sampler:mn.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new ca({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function wye(e,t){e._isPointLight?Xut(e,t):e._usesDepthTexture?qut(e,t):Yut(e,t)}function Kut(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,oq(e),sq(e),wye(e,t))}function Jut(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(sq(e),wye(e,t),Kut(e,t),Dye(e,t))}function Dye(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Zut(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Gt.maximumCubeMapSize>=t?t:Gt.maximumCubeMapSize,r.x=t,r.y=t;let o=new Ke(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Gt.maximumTextureSize>=t?t:Gt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Gt.maximumTextureSize>=t*2?t:Gt.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new B(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Qut=new Ke;function $ut(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; -in vec2 v_textureCoordinates; -void main() -{ - vec2 uv = v_textureCoordinates; - vec3 dir; - - if (uv.y < 0.5) - { - if (uv.x < 0.333) - { - dir.x = -1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 1.0; - } - else if (uv.x < 0.666) - { - dir.y = -1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 1.0; - } - else - { - dir.z = -1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 1.0; - } - } - else - { - if (uv.x < 0.333) - { - dir.x = 1.0; - dir.y = uv.x * 6.0 - 1.0; - dir.z = uv.y * 4.0 - 3.0; - } - else if (uv.x < 0.666) - { - dir.y = 1.0; - dir.x = uv.x * 6.0 - 3.0; - dir.z = uv.y * 4.0 - 3.0; - } - else - { - dir.z = 1.0; - dir.x = uv.x * 6.0 - 5.0; - dir.y = uv.y * 4.0 - 3.0; - } - } - - float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); - out_FragColor = vec4(vec3(shadow), 1.0); -} -`:n=`uniform sampler2D shadowMap_texture; -in vec2 v_textureCoordinates; -void main() -{ -${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; -`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); -`} out_FragColor = vec4(vec3(shadow), 1.0); -} -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Se.OVERLAY,i}function eft(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=Qut;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=$ut(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var ph=new Array(8);ph[0]=new oe(-1,-1,-1,1);ph[1]=new oe(1,-1,-1,1);ph[2]=new oe(1,1,-1,1);ph[3]=new oe(-1,1,-1,1);ph[4]=new oe(-1,-1,1,1);ph[5]=new oe(1,-1,1,1);ph[6]=new oe(1,1,1,1);ph[7]=new oe(-1,1,1,1);var Iy=new B,aq=new Array(8);for(let e=0;e<8;++e)aq[e]=new oe;function tft(e,t){let n=new Tt({geometry:new sm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:zt.fromColor(t)}}),i=new Tt({geometry:new _g({radius:.5}),attributes:{color:zt.fromColor(t)}});return new wn({geometryInstances:[n,i],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var nft=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],ift=new m;function rft(e,t){eft(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Xp({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Xp({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Xp({camera:e._passes[i].camera,color:nft[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Ne.IDENTITY,o=e._pointLightRadius*2,s=m.fromElements(o,o,o,ift),a=B.fromTranslationQuaternionRotationScale(i,r,s,Iy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=tft(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Xp({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function _4(){this.viewMatrix=new B,this.inverseViewMatrix=new B,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new B}_4.prototype.clone=function(e){B.clone(e.viewMatrix,this.viewMatrix),B.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var oft=new B(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_4.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return B.multiply(t,e,this.viewProjectionMatrix),B.multiply(oft,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var sft=new Array(5),aft=new vi,cft=new Array(4),Iye=new m,Pye=new m;function lft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=cft,g=sft;for(g[0]=r,g[s]=o,a=0;a<s;++a){let N=(a+1)/s,_=r*Math.pow(u,N),b=r+c*N,v=P.lerp(b,_,f);g[a+1]=v,p[a]=v-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let h=n.frustum,A=h.left,x=h.right,C=h.bottom,T=h.top,E=h.near,S=h.far,w=n.positionWC,D=n.directionWC,R=n.upWC,O=i.frustum.clone(aft),L=n.getViewProjection();for(a=0;a<s;++a){O.near=g[a],O.far=g[a+1];let N=B.multiply(O.projectionMatrix,i.viewMatrix,Iy),_=B.inverse(N,Iy),b=B.multiply(L,_,Iy),v=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Iye),I=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Pye);for(let G=0;G<8;++G){let U=oe.clone(ph[G],aq[G]);B.multiplyByVector(b,U,U),m.divideByScalar(U,U.w,U),m.minimumByComponent(U,v,v),m.maximumByComponent(U,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let M=e._passes[a],F=M.camera;F.clone(n);let k=F.frustum;k.left=A+v.x*(x-A),k.right=A+I.x*(x-A),k.bottom=C+v.y*(T-C),k.top=C+I.y*(T-C),k.near=E+v.z*(S-E),k.far=E+I.z*(S-E),M.cullingVolume=F.frustum.computeCullingVolume(w,D,R);let V=e._cascadeMatrices[a];B.multiply(F.getViewProjection(),i.inverseViewMatrix,V),B.multiply(M.textureOffsets,V,V)}}var uft=new B,fft=new m,dft=new m,Sye=new m;function mft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=B.multiply(i.frustum.projectionMatrix,i.viewMatrix,Iy),o=B.inverse(r,Iy),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,fft);a=m.cross(c,s,dft),m.normalize(a,a),m.normalize(c,c);let u=m.fromElements(0,0,0,Sye),f=B.computeView(u,s,a,c,uft),d=B.multiply(f,o,Iy),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Iye),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Pye);for(let S=0;S<8;++S){let w=oe.clone(ph[S],aq[S]);B.multiplyByVector(d,w,w),m.divideByScalar(w,w.w,w),m.minimumByComponent(w,p,p),m.maximumByComponent(w,g,g)}g.z+=1e3,p.z-=10;let h=Sye;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let A=B.fromTranslation(h,Iy);f=B.multiply(A,f,f);let x=.5*(g.x-p.x),C=.5*(g.y-p.y),T=g.z-p.z,E=n.frustum;E.left=-x,E.right=x,E.bottom=-C,E.top=C,E.near=.01,E.far=T,B.clone(f,n.viewMatrix),B.inverse(f,n.inverseViewMatrix),B.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var hft=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],pft=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],_ft=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function gft(e,t){let n=new vi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=hft[i],r.upWC=pft[i],r.rightWC=_ft[i],B.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),B.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var yft=new m,Aft=new m,Oye=new ae,vye=Oye.center;function xft(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=Oye;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,yft),s=m.negate(i.directionWC,Aft),a=m.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,o,vye),vye);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ae.clone(r,e._boundingSphere)}}function Cft(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,o.directionWC):e._isPointLight?m.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;B.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),m.normalize(s,s),m.negate(s,s),B.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=fr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,xft(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}hh.prototype.update=function(e){if(Cft(this,e),this._needsUpdate)if(Jut(this,e.context),this._isPointLight&&gft(this,e),this._cascadesEnabled&&(mft(this,e),this._numberOfCascades>1&&lft(this,e)),this._isPointLight)this._shadowMapCullingVolume=is.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;B.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&rft(this,e)};hh.prototype.updatePass=function(e,t){Dye(this,e,t)};var Tft=new H;function Rye(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=Tft;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,oe.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return gt(t,r,!1)}function Eft(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=nt.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Se.GLOBE,d=n.pass!==Se.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Qp.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let x=u.vertexShaderSource,C=u.fragmentShaderSource,T=Qp.createShadowCastVertexShader(x,p,f),E=Qp.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=Rye(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}hh.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Se.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=nt.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,h=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||h||n||g){let A=Qp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,A),!l(d)){let x=Qp.createShadowReceiveVertexShader(a,u,f),C=Qp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,A,{vertexShaderSource:x,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Rye(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};hh.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=Eft(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){sq(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var Py=hh;var g4=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; -in vec2 v_textureCoordinates; + // To deal with smaller values of PRIMARY_STEPS (e.g. 4) + // we implement a split strategy: sky or horizon. + // For performance reasons, instead of a if/else branch + // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 + float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); + // Value close to 0.0: close to the horizon + // Value close to 1.0: above in the sky + float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); + + // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. + float start_0 = primaryRayAtmosphereIntersect.start; + primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); + // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. + primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); + + // For the number of ray steps, distinguish inside or outside atmosphere (outer space) + // (1) from outer space we have to use more ray steps to get a realistic rendering + // (2) within atmosphere we need fewer steps for faster rendering + float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters + float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); + int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. + int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); + // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. + float rayPositionLength = primaryRayAtmosphereIntersect.start; + // (1) Outside the atmosphere: constant rayStepLength + // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps + float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; + float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); + float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); + + vec3 rayleighAccumulation = vec3(0.0); + vec3 mieAccumulation = vec3(0.0); + vec2 opticalDepth = vec2(0.0); + vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); + + // Sample positions on the primary ray. + for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { + + // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= PRIMARY_STEPS) { + break; + } + + // Calculate sample position along viewpoint ray. + vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); + + // Calculate height of sample position above ellipsoid. + float sampleHeight = length(samplePosition) - atmosphereInnerRadius; + + // Calculate and accumulate density of particles at the sample position. + vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; + opticalDepth += sampleDensity; + + // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. + czm_ray lightRay = czm_ray(samplePosition, lightDirection); + czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); + + float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); + float lightPositionLength = 0.0; + + vec2 lightOpticalDepth = vec2(0.0); + + // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. + for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { + + // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (j >= LIGHT_STEPS) { + break; + } + + // Calculate sample position along light ray. + vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); + + // Calculate height of the light sample position above ellipsoid. + float lightHeight = length(lightPosition) - atmosphereInnerRadius; + + // Calculate density of photons at the light sample position. + lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; + + // Increment distance on light ray. + lightPositionLength += lightStepLength; + } + + // Compute attenuation via the primary ray and the light ray. + vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); + + // Accumulate the scattering. + rayleighAccumulation += sampleDensity.x * attenuation; + mieAccumulation += sampleDensity.y * attenuation; + + // Increment distance on primary ray. + rayPositionLength += (rayStepLength += rayStepLengthIncrease); + } + + // Compute the scattering amount. + rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; + mieColor = u_atmosphereMieCoefficient * mieAccumulation; + + // Compute the transmittance i.e. how much light is passing through the atmosphere. + opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } -`;var Tb=`uniform sampler2D colorTexture; -#ifdef DEBUG_SHOW_DEPTH -uniform sampler2D u_packedTranslucentDepth; -#endif +vec4 computeAtmosphereColor( + vec3 positionWC, + vec3 lightDirection, + vec3 rayleighColor, + vec3 mieColor, + float opacity +) { + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -in vec2 v_textureCoordinates; + float cosAngle = dot(cameraToPositionWCDirection, lightDirection); + float cosAngleSq = cosAngle * cosAngle; -void main() + float G = u_atmosphereMieAnisotropy; + float GSq = G * G; + + // The Rayleigh phase function. + float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); + // The Mie phase function. + float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); + + // The final color is generated by combining the effects of the Rayleigh and Mie scattering. + vec3 rayleigh = rayleighPhase * rayleighColor; + vec3 mie = miePhase * mieColor; + + vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; + + return vec4(color, opacity); +} +`;var mU=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; + +float vdcRadicalInverse(int i) { -#ifdef DEBUG_SHOW_DEPTH - if (v_textureCoordinates.x < 0.5) + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) { - out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); - out_FragColor.a = 1.0; + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); } -#else - vec4 color = texture(colorTexture, v_textureCoordinates); + return value; +} -#ifdef PICK - if (color == vec4(0.0)) - { - discard; - } -#else - // Reverse premultiplication process to get the correct composited result of the classification primitives - color.rgb /= color.a; -#endif - out_FragColor = color; -#endif +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); } -`;var bft=!1;function Oy(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new oi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new oi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Oy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Mye(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Bye(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Sft(e,t,n,i){Mye(e),e._translucentDepthStencilTexture=new Bt({context:t,width:n,height:i,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Qe.UNSIGNED_INT_24_8,sampler:mn.NEAREST})}function vft(e,t,n,i){Bye(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function wft(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(Sft(e,t,r,o),vft(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new He({sources:[g4]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new He({sources:[Tb]}),a={colorTexture:function(){return e._textureToComposite}},bft&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=nt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new He({sources:[Tb]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new He({sources:[Tb]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!Ke.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,reference:Ut.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Oy.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<o;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(wft(this,u,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<o;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};Oy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Se.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,r,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};Oy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Dft(this,e,t)};function Dft(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Oy.prototype.isSupported=function(){return this._supported};Oy.prototype.isDestroyed=function(){return!1};Oy.prototype.destroy=function(){return Mye(this),Bye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var y4=Oy;function Ift(){this.command=void 0,this.near=void 0,this.far=void 0}function A4(e,t,n){let i=e.context,r;i.depthTexture&&(r=new Kk);let o;e._useOIT&&i.depthTexture&&(o=new l4(i));let s=new fc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=fr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new p4(i),this.pickDepthFramebuffer=new h4,this.sceneFramebuffer=new Cb,this.globeDepth=r,this.globeTranslucencyFramebuffer=new Jk,this.oit=o,this.translucentTileClassification=new y4(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Lye=new m,Nye=new m;function Pft(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}function Oft(e,t,n){let i=1/Math.max(1,Pft(e.position,t.position));return m.multiplyByScalar(e.position,i,Lye),m.multiplyByScalar(t.position,i,Nye),m.equalsEpsilon(Lye,Nye,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&B.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}A4.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Oft(t,n,P.EPSILON15)?(this._cameraStartFired&&Ci()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ci(),fr.clone(t,n),!0)};function Rft(e,t,n,i){let r=t.frameState,o=r.camera,s=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),isNaN(n)&&(n=o.frustum.near),isNaN(i)&&(i=o.frustum.far);let u;a?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];l(h)?(h.near=p,h.far=g):h=f[d]=new Ak(p,g)}}function Mft(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let o=e.frustumCommandsList,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.near,f=c.far;if(i>f)continue;if(r<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var Fye=new is,Bft=new Wc;A4.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Se.NUMBER_OF_PASSES;for(let b=0;b<u;++b)for(let v=0;v<f;++v)c[b].indices[v]=0;o.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,A=-Number.MAX_VALUE,x=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,T=-Number.MAX_VALUE,E=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,w=t.cullingVolume,D=Fye.planes;for(let b=0;b<5;++b)D[b]=w.planes[b];w=Fye;let R=a.length;for(let b=0;b<R;++b){let v=a[b],I=v.pass;if(I===Se.COMPUTE)o.push(v);else if(I===Se.OVERLAY)s.push(v);else{let M,F,k=v.boundingVolume;if(l(k)){if(!e.isVisible(v,w,S))continue;let G=k.computePlaneDistances(r,i,Bft);if(M=G.start,F=G.stop,h=Math.min(h,M),A=Math.max(A,F),x&&v.receiveShadows&&M<Py.MAXIMUM_DISTANCE&&!(I===Se.GLOBE&&M<-100&&F>100)){let U=F-M;I!==Se.GLOBE&&M<100&&(E=Math.min(E,U)),C=Math.min(C,M),T=Math.max(T,F)}}else v instanceof oi?(M=n.frustum.near,F=n.frustum.far):(M=n.frustum.near,F=n.frustum.far,h=Math.min(h,M),A=Math.max(A,F));let V=d[g];l(V)||(V=d[g]=new Ift),V.command=v,V.near=M,V.far=F,g++}}x&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),T=Math.max(Math.min(T,n.frustum.far),C)),x&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=T,t.shadowState.closestObjectSize=E),Rft(this,e,h,A);let O,L;for(O=0;O<g;O++)L=d[O],Mft(this,e,L.command,L.near,L.far);if(g<p)for(O=g;O<p&&(L=d[O],!!l(L.command));O++)L.command=void 0;let N=c.length,_=t.frustumSplits;_.length=N+1;for(let b=0;b<N;++b)_[b]=c[b].near,b===N-1&&(_[b+1]=c[b].far)};A4.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var Eb=A4;var Vye=.1,Lft=new Ud({pass:Nr.MOST_DETAILED_PRELOAD}),Nft=new Ud({pass:Nr.MOST_DETAILED_PICK}),cq=new Ud({pass:Nr.PICK});function Ea(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new fr(e);n.frustum=new rn({width:Vye,aspectRatio:1,near:.1}),this._pickOffscreenView=new Eb(e,n,t)}Ea.prototype.update=function(){this._pickPositionCacheDirty=!0};Ea.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new m4,n[t]=i),i};var Fft=new Po,Uft=new m,x4=new m,Vft=new H,kft=new B;function zft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=B.clone(o.transform,kft);o._setTransform(B.IDENTITY);let d=m.clone(o.position,Uft);m.multiplyByScalar(o.right,c,x4),m.add(x4,d,d),m.multiplyByScalar(o.up,u,x4),m.add(x4,d,d),o._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,Vft),g=Fft;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var Hft=new pl,Gft=new H;function Wft(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,h=s.getPixelDimensions(r.width,r.height,1,1,Gft),A=h.x*n*.5,x=h.y*i*.5,C=Hft;return C.top=g+x,C.bottom=g-x,C.right=p+A,C.left=p-A,C.near=a,C.far=s.far,C.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function kye(e,t,n,i,r){let o=e.camera.frustum;return o instanceof rn||o instanceof Po?zft(e,t,n,i,r):Wft(e,t,n,i,r)}var bb=3,fI=3,_h=new Ke(0,0,bb,fI),zye=new H,lq=new z(0,0,0,0);Ea.prototype.pick=function(e,t,n,i){bb=y(n,3),fI=y(i,bb);let r=e.context,o=r.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let u=a.passState;u.viewport=Ke.clone(c,u.viewport);let f=Zi.transformWindowToDrawingBuffer(e,t,zye);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=kye(e,f,bb,fI,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=cq,o.update(s),e.updateEnvironment(),_h.x=f.x-(bb-1)*.5,_h.y=e.drawingBufferHeight-f.y-(fI-1)*.5,_h.width=bb,_h.height=fI,u=a.pickFramebuffer.begin(_h,a.viewport),e.updateAndExecuteCommands(u,lq),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(_h);return r.endFrame(),d};function jft(e,t){let n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=o.passState;a.viewport=Ke.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=kye(e,t,1,1,s),i.tilesetPassState=cq,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,a=o.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,lq),e.resolveFramebuffers(a),n.endFrame()}var Yft=new vi,qft=new pl,Xft=new rn,Kft=new Po;Ea.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let r=e.frameState,o=e.context,s=o.uniformState,a=e.defaultView;e.view=a;let c=Zi.transformWindowToDrawingBuffer(e,t,zye);e.pickTranslucentDepth?jft(e,c):(e.updateFrameState(),s.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(Yft):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(qft):l(u.frustum.width)?f=u.frustum.clone(Xft):f=u.frustum.clone(Kft);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let A=this.getPickDepth(e,g).getDepth(o,c.x,c.y);if(l(A)&&A>0&&A<1){let x=d[g],C;return e.mode===ne.SCENE2D?(C=u.position.z,u.position.z=C-x.near+1,f.far=Math.max(1,x.far-x.near),f.near=1,s.update(r),s.updateFrustum(f)):(f.near=x.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=x.far,s.updateFrustum(f)),n=Zi.drawingBufferToWgs84Coordinates(e,c,A,n),e.mode===ne.SCENE2D&&(u.position.z=C,s.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Jft=new he;Ea.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,Jft);r.cartographicToCartesian(o,n)}return n};function Hye(e,t){let n,i,r=[],o=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){r.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(r.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=An.toValue(!1,i.show),s.push(i))),u instanceof Us&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,o.push(p)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=An.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return r}Ea.prototype.drillPick=function(e,t,n,i,r){let o=this;return Hye(n,function(){let c=o.pick(e,t,i,r);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Uye=new m,Zft=new m;function Qft(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function Gye(e,t,n,i){let r=t.direction,o=m.mostOrthogonalAxis(r,Uye),s=m.cross(r,o,Uye),a=m.cross(r,s,Zft);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=y(n,Vye),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function $ft(e,t,n){let i=t.frameState,r=n.ray,o=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=Gye(e,r,o,a),u=Lft;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ea.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)$ft(this,e,t[n])&&t.splice(n--,1)};function Wye(e,t,n){let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Zl&&Wye(o,t,n))}}function C4(e,t,n,i,r,o){let s=[];if(Wye(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new Qft(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function edt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function tdt(e,t,n,i,r,o,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,Gye(e,n,r,f.camera),_h=Ke.clone(f.viewport,_h);let d=f.pickFramebuffer.begin(_h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=Nft:u.tilesetPassState=cq,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,lq),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(_h);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let A=0;A<h;++A){let C=e.getPickDepth(t,A).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let T=f.frustumCommandsList[A],E=T.near*(A!==0?t.opaqueFrustumNearOffset:1),S=T.far,w=E+C*(S-E);p=On.getPoint(n,w);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&o||edt(g,i)}}function jye(e,t,n,i,r,o,s,a){return Hye(i,function(){return tdt(e,t,n,r,o,s,a)})}function Sb(e,t,n,i,r,o,s){let a=jye(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function Yye(e,t,n,i,r,o,s,a){return jye(e,t,n,i,r,o,s,a)}function T4(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Ea.prototype.pickFromRay=function(e,t,n,i){return Sb(this,e,t,n,i,!1,!1)};Ea.prototype.drillPickFromRay=function(e,t,n,i,r){return Yye(this,e,t,n,i,r,!1,!1)};Ea.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=On.clone(t),n=l(n)?n.slice():n,T4(e,C4(r,e,t,n,i,function(){return Sb(r,e,t,n,i,!1,!0)}))};Ea.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=On.clone(t),i=l(i)?i.slice():i,T4(e,C4(o,e,t,i,r,function(){return Yye(o,e,t,n,i,r,!1,!0)}))};var ndt=new m,idt=new m,rdt=new On,qye=new he;function uq(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=ai._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,idt),s=he.toCartesian(t,i,ndt),a=rdt;a.origin=s,a.direction=o;let c=new On;return On.getPoint(a,r,c.origin),m.negate(o,c.direction),c}function Xye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=he.fromCartesian(t,i,qye);return uq(e,r)}function Kye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return he.fromCartesian(t,i,qye).height}function odt(e,t,n,i,r){let o=uq(t,n);return C4(e,t,o,i,r,function(){let s=Sb(e,t,o,i,r,!0,!0);if(l(s))return Kye(t,s.position)})}function sdt(e,t,n,i,r,o){let s=Xye(t,n);return C4(e,t,s,i,r,function(){let a=Sb(e,t,s,i,r,!0,!0);if(l(a))return m.clone(a.position,o)})}Ea.prototype.sampleHeight=function(e,t,n,i){let r=uq(e,t),o=Sb(this,e,r,n,i,!0,!1);if(l(o))return Kye(e,o.position)};Ea.prototype.clampToHeight=function(e,t,n,i,r){let o=Xye(e,t),s=Sb(this,e,o,n,i,!0,!1);if(l(s))return m.clone(s.position,r)};Ea.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=odt(this,e,t[s],n,i);return T4(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ea.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=sdt(this,e,t[s],n,i,t[s]);return T4(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ea.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var E4=Ea;var Qye=co(XI(),1);var adt={modifyFragmentShader:function(t){return t=He.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},dI=adt;var KA={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function mI(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=KA.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Se.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=B.clone(B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,nl.NONE),this._splittingEnabled=!1,this._error=void 0,cdt(this,e)}Object.defineProperties(mI.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function cdt(e,t){let n=iT.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=R_.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=KA.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var ldt=new m,udt=new m,fdt=new m,Jye,b4;function ddt(e){if(!l(b4)){Jye=new Qye.default(0),b4=new Array(e);for(let t=0;t<e;++t)b4[t]=Jye.random()}return b4}function mdt(e){let n=e.length/3,i=Math.min(n,20),r=ddt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(o,o,o,ldt),c=m.fromElements(s,s,s,udt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=m.unpack(e,d*3,fdt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function Zye(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Rt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var hdt=new oe,pdt=new oe,_dt=new z,$ye=0,S4=1,pq=2,e0e=3,gdt=4,fq=new B,ydt=new B;function Adt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,A=e._quantizedRange,x=e._octEncodedRange,C=e._isRGB565,T=e._isTranslucent,E=e._hasColors,S=e._hasNormals,w=e._hasBatchIds,D,R,O=[],L={};if(e._styleableShaderAttributes=L,f){let V=gdt;for(let G in u)if(u.hasOwnProperty(G)){let U=u[G],q=Zye(U.typedArray,G);D=U.componentCount,R=X.fromTypedArray(q);let Y=ht.createVertexBuffer({context:n,typedArray:q,usage:Fe.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let Q={index:V,vertexBuffer:Y,componentsPerAttribute:D,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0};O.push(Q),L[G]={location:V,componentCount:D},++V}}let N=ht.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;E&&(_=ht.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let b;S&&(b=ht.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let v;w&&(c.typedArray=Zye(c.typedArray,"batchIds"),v=ht.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?R=X.UNSIGNED_SHORT:p?R=A<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:R=X.FLOAT,I.push({index:$ye,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=mdt(o.typedArray)),E)if(C)I.push({index:S4,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=T?4:3;I.push({index:S4,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(D=2,R=X.UNSIGNED_BYTE):h?(D=2,R=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,R=X.FLOAT),I.push({index:pq,vertexBuffer:b,componentsPerAttribute:D,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0})),w&&I.push({index:e0e,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(O));let M=new si({context:n,attributes:I}),F={depthTest:{enabled:!0}},k={depthTest:{enabled:!0},depthMask:!1,blending:hn.ALPHA_BLEND};e._opaquePass===Se.CESIUM_3D_TILE&&(F.stencilTest=Ut.setCesium3DTileBit(),F.stencilMask=Ut.CESIUM_3D_TILE_MASK,k.stencilTest=Ut.setCesium3DTileBit(),k.stencilMask=Ut.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(F),e._translucentRenderState=ze.fromCache(k),e._drawCommand=new nt({boundingVolume:new ae,cull:e._cull,modelMatrix:new B,primitiveType:Le.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Se.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function xdt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=hdt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof rn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,_dt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return B.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);B.multiply(n.uniformState.view3D,c,fq);let u=B.multiply(fq,a.modelMatrix,fq);return B.inverseTranspose(u,ydt)}};dI.addUniforms(e,s),(i||r||o)&&(s=gt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=pdt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function dq(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function mq(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function hq(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Cdt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function Tdt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,A=e._hasNormals,x=e._hasBatchIds,C=e._backFaceCulling,T=e._normalShading,E=e._drawCommand.vertexArray,S=e.clippingPlanes,w=e._attenuation,D,R,O,L=g,N=Ye(Cdt),_={},b=e._styleableShaderAttributes;for(r in b)b.hasOwnProperty(r)&&(o=b[r],N[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let se={translucent:!1},pe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${pe}`,N,se),R=n.getShowShaderFunction(`getShowFromStyle${pe}`,N,se),O=n.getPointSizeShaderFunction(`getPointSizeFromStyle${pe}`,N,se),l(D)&&se.translucent&&(L=!0)}e._styleTranslucent=L;let v=l(D),I=l(R),M=l(O),F=e.isClipped,k=[],V=[];v&&(dq(D,k),mq(D,V)),I&&(dq(R,k),mq(R,V)),M&&(dq(O,k),mq(O,V));let G=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!A)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(r in b)if(b.hasOwnProperty(r)){o=b[r];let se=k.indexOf(o.location)>=0,pe=hq(E,o.location);pe.enabled=se}let q=h&&(!v||G);if(h){let se=hq(E,S4);se.enabled=q}let Y=A&&(T||C||U);if(A){let se=hq(E,pq);se.enabled=Y}let Q={a_position:$ye};q&&(Q.a_color=S4),Y&&(Q.a_normal=pq),x&&(Q.a_batchId=e0e);let W="",K=k.length;for(i=0;i<K;++i){let se=k[i];o=_[se];let pe=o.componentCount,xe=`czm_3dtiles_property_${se}`,we;pe===1?we="float":we=`vec${pe}`,W+=`in ${we} ${xe}; -`,Q[xe]=o.location}xdt(e,t);let J=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;J+=`float u_pointSize; -float tiles3d_tileset_time; -`,w&&(J+=`float u_geometricError; -float u_depthMultiplier; -`),J+=W,q&&(g?J+=`in vec4 a_color; -`:p?J+=`in float a_color; -const float SHIFT_RIGHT_11 = 1.0 / 2048.0; -const float SHIFT_RIGHT_5 = 1.0 / 32.0; -const float SHIFT_LEFT_11 = 2048.0; -const float SHIFT_LEFT_5 = 32.0; -const float NORMALIZE_6 = 1.0 / 64.0; -const float NORMALIZE_5 = 1.0 / 32.0; -`:J+=`in vec3 a_color; -`),Y&&(f||d?J+=`in vec2 a_normal; -`:J+=`in vec3 a_normal; -`),x&&(J+=`in float a_batchId; -`),(c||u||d)&&(J+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),v&&(J+=D),I&&(J+=R),M&&(J+=O),J+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,w&&(J+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),q?g?J+=` vec4 color = a_color; -`:p?J+=` float compressed = a_color; - float r = floor(compressed * SHIFT_RIGHT_11); - compressed -= r * SHIFT_LEFT_11; - float g = floor(compressed * SHIFT_RIGHT_5); - compressed -= g * SHIFT_LEFT_5; - float b = compressed; - vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); - vec4 color = vec4(rgb, 1.0); -`:J+=` vec4 color = vec4(a_color, 1.0); -`:J+=` vec4 color = u_constantColor; -`,c||u?J+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:J+=` vec3 position = a_position; -`,J+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,Y?(f?J+=` vec3 normal = czm_octDecode(a_normal); -`:d?J+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:J+=` vec3 normal = a_normal; -`,J+=` vec3 normalEC = czm_normal * normal; -`):J+=` vec3 normal = vec3(1.0); -`,v&&(J+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(J+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),M?J+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:w?J+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:J+=` gl_PointSize = u_pointSize; -`,J+=` color = color * u_highlightColor; -`,Y&&T&&(J+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),J+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,Y&&C&&(J+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(J+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),J+=`} -`;let me=`in vec4 v_color; -`;F&&(me+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,me+=` -`,me+=yy(S,s),me+=` -`),me+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,F&&(me+=xk("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} -`,e.splitDirection!==nl.NONE&&(me=dI.modifyFragmentShader(me)),l(e._vertexShaderLoaded)&&(J=e._vertexShaderLoaded(J)),l(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let ye=e._drawCommand;l(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:J,fragmentShaderSource:me,attributeLocations:Q});try{ye.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Edt(e,t){if(e._decodingState===KA.READY)return!1;if(e._decodingState===KA.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=z_.decodePointCloud(i,t);l(r)&&(e._decodingState=KA.DECODING,r.then(function(o){e._decodingState=KA.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let x=o.POSITION.data.quantization,C=x.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let x in h)if(h.hasOwnProperty(x)){let C=o[x];l(g)||(g={}),g[x]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let A=y(c,a);l(A)&&(n.colors={typedArray:A}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=KA.FAILED,e._error=o}))}return!0}var bdt=new oe,Sdt=new m;mI.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(Edt(this,t))return;let i=!1,r=!B.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(Adt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){B.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(B.clone(this._modelMatrix,u),l(this._rtcCenter)&&B.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&B.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=B.getColumn(u,3,bdt);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;B.multiplyByPoint(u,d,d);let p=B.getScale(u,Sdt);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==nl.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&Tdt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Se.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};mI.prototype.isDestroyed=function(){return!1};mI.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var v4=mI;var vdt={NEAREST:0,LINEAR:1},bf=vdt;function JA(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,ct.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,bf.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Qe.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new fc;r.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=r,this._ready=!1;let o=e.name;l(o)||(o=jn()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(JA.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var wdt=/uniform\s+sampler2D\s+depthTexture/g;JA.prototype._isSupported=function(e){return!wdt.test(this._fragmentShader)||e.depthTexture};function Ddt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Bt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Bt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function Idt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Pdt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Odt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i)if(i.hasOwnProperty(o)){typeof i[o]!="function"?(t[o]=Idt(e,o),n[o]=Ddt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Bt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=Pdt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=gt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Rdt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE -uniform sampler2D czm_idTexture; -uniform sampler2D czm_selectedIdTexture; -uniform float czm_selectedIdTextureStep; -in vec2 v_textureCoordinates; -bool czm_selected(vec2 offset) -{ - bool selected = false; - vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); - for (int i = 0; i < ${r}; ++i) - { - vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); - if (all(equal(id, selectedId))) - { - return true; - } - } - return false; -} -bool czm_selected() -{ - return czm_selected(vec2(0.0)); -} +vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) +{ + float a = roughness * roughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} -${n}`}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Mdt(e){let t=e._sampleMode,n,i;t===bf.LINEAR?(n=un.LINEAR,i=bi.LINEAR):(n=un.NEAREST,i=bi.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new mn({wrapS:Pn.CLAMP_TO_EDGE,wrapT:Pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Bdt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Ldt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Ndt(e,t){let n,i,r,o=e._texturesToRelease,s=o.length;for(n=0;n<s;++n)i=o[n],i=i&&i.destroy();o.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];r=d.name;let p=d.source;e._actualUniforms[r]=new Bt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){r=c[n];let d=u[r],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[r]=Ldt(e,d);else if(typeof d=="string"){let g=new ve({url:d});f.push(g.fetchImage().then(Bdt(e,r)))}else e._texturesToCreate.push({name:r,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function t0e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i)i.hasOwnProperty(r)&&i[r]instanceof Bt&&(l(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}function Fdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function Udt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,r,o=0,s=n.length;for(i=0;i<s;++i)r=n[i],l(r.pickIds)?o+=r.pickIds.length:l(r.pickId)&&++o;if(s===0||o===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:mn.NEAREST});return}let a,c=0,u=new Uint8Array(o*4);for(i=0;i<s;++i)if(r=n[i],l(r.pickIds)){let f=r.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(r.pickId)&&(a=r.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,source:{arrayBufferView:u,width:o,height:1},sampler:mn.NEAREST})}JA.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&t0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Fdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,Udt(this,e),Odt(this),Ndt(this,e),Rdt(this,e),Mdt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=r};JA.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,mn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};JA.prototype.isDestroyed=function(){return!1};JA.prototype.destroy=function(){return t0e(this),ue(this)};var Ar=JA;var w4=`uniform sampler2D colorTexture; +float G1_Smith(float NdotV, float k) +{ + return NdotV / (NdotV * (1.0 - k) + k); +} -in vec2 v_textureCoordinates; +float G_Smith(float roughness, float NdotV, float NdotL) +{ + float k = roughness * roughness / 2.0; + return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); +} -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = G_Smith(roughness, NdotV, NdotL); + float G_Vis = G * VdotH / (NdotH * NdotV); + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + return vec2(A, B) / float(NumSamples); +} void main() { - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +} +`;var hU=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; -#ifdef AUTO_EXPOSURE - color /= texture(autoExposure, vec2(0.5)).r; -#endif - color = czm_acesTonemapping(color); - color = czm_inverseGamma(color); +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} - out_FragColor = vec4(color, fragmentColor.a); +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); } -`;var D4=`uniform sampler2D randomTexture; -uniform sampler2D depthTexture; -uniform float intensity; -uniform float bias; -uniform float lengthCap; -uniform float stepSize; -uniform float frustumLength; -in vec2 v_textureCoordinates; +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; -vec4 clipToEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); - posEC = posEC / posEC.w; - return posEC; + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); + + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; } -//Reconstruct Normal Without Edge Removation -vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) -{ - vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); - vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); - vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); - vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} - vec3 up = posInCamera.xyz - posInCameraUp.xyz; - vec3 down = posInCameraDown.xyz - posInCamera.xyz; - vec3 left = posInCamera.xyz - posInCameraLeft.xyz; - vec3 right = posInCameraRight.xyz - posInCamera.xyz; +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); - vec3 DX = length(left) < length(right) ? left : right; - vec3 DY = length(up) < length(down) ? up : down; + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - return normalize(cross(DY, DX)); + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); } -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = clipToEye(v_textureCoordinates, depth); +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; - if (posInCamera.z > frustumLength) - { - out_FragColor = vec4(1.0); - return; + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } } - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); - float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); - float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); - float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); - vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; +} - float ao = 0.0; - vec2 sampleDirection = vec2(1.0, 0.0); - float gapAngle = 90.0 * czm_radiansPerDegree; +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } - // RandomNoise - float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; + } + return intersected; +} - //Loop for each direction - for (int i = 0; i < 4; i++) - { - float newGapAngle = gapAngle * (float(i) + randomVal); - float cosVal = cos(newGapAngle); - float sinVal = sin(newGapAngle); +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); +} - //Rotate Sampling Direction - vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); - float localAO = 0.0; - float localStepSize = stepSize; +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +} + +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; + +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); + } + return k * sum.x * sum.y; +} + +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection + +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} + +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); + } - //Loop for each step - for (int j = 0; j < 6; j++) - { - vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - //Exception Handling - if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) - { - break; - } + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; - float stepDepthInfo = czm_readDepth(depthTexture, newCoords); - vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); - vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; - float len = length(diffVec); + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. - if (len > lengthCap) - { - break; - } + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; - float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); - float weight = len / lengthCap; - weight = 1.0 - weight * weight; + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; - if (dotVal < bias) - { - dotVal = 0.0; - } + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. - localAO = max(localAO, dotVal * weight); - localStepSize += stepSize; - } - ao += localAO; - } + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); - ao /= 4.0; - ao = 1.0 - clamp(ao, 0.0, 1.0); - ao = pow(ao, intensity); - out_FragColor = vec4(vec3(ao), 1.0); -} -`;var I4=`uniform sampler2D colorTexture; -uniform sampler2D ambientOcclusionTexture; -uniform bool ambientOcclusionOnly; -in vec2 v_textureCoordinates; + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); - out_FragColor = ambientOcclusionOnly ? ao : ao * color; -} -`;var P4=`uniform sampler2D colorTexture; -uniform float gradations; + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); -in vec2 v_textureCoordinates; + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = vec4(rgb, 1.0); - return; - } -#endif - float luminance = czm_luminance(rgb); - float darkness = luminance * gradations; - darkness = (darkness - fract(darkness)) / gradations; - out_FragColor = vec4(vec3(darkness), 1.0); + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; } -`;var O4=`uniform sampler2D colorTexture; -uniform sampler2D bloomTexture; -uniform bool glowOnly; -in vec2 v_textureCoordinates; +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; -void main(void) -{ - vec4 color = texture(colorTexture, v_textureCoordinates); + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); -#ifdef CZM_SELECTED_FEATURE - if (czm_selected()) { - out_FragColor = color; - return; + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } +#else +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; } + out_FragColor = cloud; +#endif #endif - - vec4 bloom = texture(bloomTexture, v_textureCoordinates); - out_FragColor = glowOnly ? bloom : bloom + color; } -`;var R4=`uniform sampler2D colorTexture; -uniform float brightness; - -in vec2 v_textureCoordinates; +`;var pU=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; -void main(void) -{ - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 target = vec3(0.0); - out_FragColor = vec4(mix(target, rgb, brightness), 1.0); -} -`;var M4=`uniform sampler2D colorTexture; -uniform float contrast; -uniform float brightness; +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; -in vec2 v_textureCoordinates; +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); -void main(void) -{ - vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; - sceneColor = czm_RGBToHSB(sceneColor); - sceneColor.z += brightness; - sceneColor = czm_HSBToRGB(sceneColor); + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; - float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); - sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); - out_FragColor = vec4(sceneColor, 1.0); -} -`;var B4=`uniform sampler2D colorTexture; -uniform sampler2D blurTexture; -uniform sampler2D depthTexture; -uniform float focalDistance; +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif -in vec2 v_textureCoordinates; + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; -vec4 toEye(vec2 uv, float depth) -{ - vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); - vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); - posInCamera = posInCamera / posInCamera.w; - return posInCamera; + v_offset = offset; + v_maximumSize = maximumSize; + v_color = color; + v_slice = slice; + v_brightness = brightness; } +`;var _U=`uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +uniform vec3 u_noiseOffset; +in vec2 v_position; -float computeDepthBlur(float depth) -{ - float f; - if (depth < focalDistance) - { - f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); - } - else - { - f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); - f = pow(f, 0.1); +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); } - f *= f; - f = clamp(f, 0.0, 1.0); - return pow(f, 0.5); + return mod(value, rangeLength); } -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - vec4 posInCamera = toEye(v_textureCoordinates, depth); - float d = computeDepthBlur(-posInCamera.z); - out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); } -`;var L4=`uniform sampler2D depthTexture; -in vec2 v_textureCoordinates; - -void main(void) -{ - float depth = czm_readDepth(depthTexture, v_textureCoordinates); - out_FragColor = vec4(vec3(depth), 1.0); +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); } -`;var N4=`uniform sampler2D depthTexture; -uniform float length; -uniform vec4 color; -in vec2 v_textureCoordinates; - -void main(void) -{ - float directions[3]; - directions[0] = -1.0; - directions[1] = 0.0; - directions[2] = 1.0; +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; +} - float scalars[3]; - scalars[0] = 3.0; - scalars[1] = 10.0; - scalars[2] = 3.0; +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; - float padx = czm_pixelRatio / czm_viewport.z; - float pady = czm_pixelRatio / czm_viewport.w; + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); -#ifdef CZM_SELECTED_FEATURE - bool selected = false; - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - selected = selected || czm_selected(vec2(-padx, dir * pady)); - selected = selected || czm_selected(vec2(padx, dir * pady)); - selected = selected || czm_selected(vec2(dir * padx, -pady)); - selected = selected || czm_selected(vec2(dir * padx, pady)); - if (selected) - { - break; + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } } } - if (!selected) - { - out_FragColor = vec4(color.rgb, 0.0); - return; - } -#endif - float horizEdge = 0.0; - float vertEdge = 0.0; + return shortestDistance; +} - for (int i = 0; i < 3; ++i) - { - float dir = directions[i]; - float scale = scalars[i]; +const float MAX_FBM_ITERATIONS = 10.0; - horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; - horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } - vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; - vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; } - - float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); - out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); + return noise; } -`;var F4=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); +} +`;var gU=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; -// See slides 142 and 143: -// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting +out vec2 v_position; void main() { - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; - -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - - const float A = 0.22; // shoulder strength - const float B = 0.30; // linear strength - const float C = 0.10; // linear angle - const float D = 0.20; // toe strength - const float E = 0.01; // toe numerator - const float F = 0.30; // toe denominator - - const float white = 11.2; // linear white point value - - vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; - float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; + gl_Position = vec4(position, 0.1, 1.0); - c = czm_inverseGamma(c / w); - out_FragColor = vec4(c, fragmentColor.a); + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; } -`;var U4=`in vec2 v_textureCoordinates; - -uniform sampler2D colorTexture; +`;var yU=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; -const float fxaaQualitySubpix = 0.5; -const float fxaaQualityEdgeThreshold = 0.125; -const float fxaaQualityEdgeThresholdMin = 0.0833; +in vec2 v_textureCoordinates; void main() { - vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; - vec4 color = FxaaPixelShader( - v_textureCoordinates, - colorTexture, - fxaaQualityRcpFrame, - fxaaQualitySubpix, - fxaaQualityEdgeThreshold, - fxaaQualityEdgeThresholdMin); - float alpha = texture(colorTexture, v_textureCoordinates).a; - out_FragColor = vec4(color.rgb, alpha); + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); } -`;var ZA=`#define SAMPLES 8 - -uniform float delta; -uniform float sigma; -uniform float direction; // 0.0 for x direction, 1.0 for y direction - -uniform sampler2D colorTexture; +`;var xU=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; in vec2 v_textureCoordinates; -// Incremental Computation of the Gaussian: -// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html - void main() { - vec2 st = v_textureCoordinates; - vec2 dir = vec2(1.0 - direction, direction); + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; -#ifdef USE_STEP_SIZE - vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); #else - vec2 step = step; + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); #endif - vec3 g; - g.x = 1.0 / (sqrt(czm_twoPi) * sigma); - g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); - g.z = g.y * g.y; + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - vec4 result = texture(colorTexture, st) * g.x; - for (int i = 1; i < SAMPLES; ++i) + if (opaque != czm_backgroundColor) { - g.xy *= g.yz; - - vec2 offset = float(i) * dir * step; - result += texture(colorTexture, st - offset) * g.x; - result += texture(colorTexture, st + offset) * g.x; + out_FragColor.a = 1.0; } - - out_FragColor = result; -} -`;var V4=`uniform sampler2D colorTexture; -uniform sampler2D dirtTexture; -uniform sampler2D starTexture; -uniform vec2 dirtTextureDimensions; -uniform float distortion; -uniform float ghostDispersal; -uniform float haloWidth; -uniform float dirtAmount; -uniform float earthRadius; -uniform float intensity; - -in vec2 v_textureCoordinates; - -// whether it is in space or not -// 6500000.0 is empirical value -#define DISTANCE_TO_SPACE 6500000.0 - -// return ndc from world coordinate biased earthRadius -vec4 getNDCFromWC(vec3 WC, float earthRadius) -{ - vec4 positionEC = czm_view * vec4(WC, 1.0); - positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); } +`;var bU=`in vec4 positionEC; -// Check if current pixel is included Earth -// if then mask it gradually -float isInEarth(vec2 texcoord, vec2 sceneSize) +void main() { - vec2 NDC = texcoord * 2.0 - 1.0; - vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); - vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); - NDC.xy -= earthPosSC.xy; + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } - float X = abs(NDC.x) * sceneSize.x; - float Y = abs(NDC.y) * sceneSize.y; + czm_ray ray = czm_ray(position, direction); - return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); -} + vec3 ellipsoid_center = czm_view[3].xyz; -// For Chromatic effect -vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) -{ - vec2 sceneSize = czm_viewport.zw; - vec3 color; - if(isSpace) + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) { - color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; - color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; - color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); } else { - color.r = texture(tex, texcoord + direction * distortion.r).r; - color.g = texture(tex, texcoord + direction * distortion.g).g; - color.b = texture(tex, texcoord + direction * distortion.b).b; + discard; } - return vec4(clamp(color, 0.0, 1.0), 0.0); + + czm_writeLogDepth(); } +`;var CU=`in vec4 position; -void main(void) +out vec4 positionEC; + +void main() { - vec4 originalColor = texture(colorTexture, v_textureCoordinates); - vec3 rgb = originalColor.rgb; - bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; - // Sun position - vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); - vec4 sunPositionEC = czm_view * sunPos; - vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); - sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); + czm_vertexLogDepth(); +} +`;var AI=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; - // If sun is not in the screen space, use original color. - if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) - { - // Lens flare is disabled when not in space until #5932 is fixed. - // https://github.com/CesiumGS/cesium/issues/5932 - out_FragColor = originalColor; - return; - } +in vec3 v_positionEC; - vec2 texcoord = vec2(1.0) - v_textureCoordinates; - vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; - vec2 invPixelSize = 1.0 / pixelSize; - vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes - // ghost vector to image centre: - vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; - vec3 direction = normalize(vec3(ghostVec, 0.0)); + vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; - // sample ghosts: - vec4 result = vec4(0.0); - vec4 ghost = vec4(0.0); - for (int i = 0; i < 4; ++i) - { - vec2 offset = fract(texcoord + ghostVec * float(i)); - // Only bright spots from the centre of the source image - ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); - } - result += ghost; + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); - // sample halo - vec2 haloVec = normalize(ghostVec) * haloWidth; - float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); - weightForHalo = pow(1.0 - weightForHalo, 5.0); +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); +#else + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} - result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. - // dirt on lens - vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; - if (dirtTexCoords.x > 1.0) - { - dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); - } - if (dirtTexCoords.y > 1.0) - { - dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); - } - result += dirtAmount * texture(dirtTexture, dirtTexCoords); + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; - // Rotating starburst texture's coordinate - // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) - float camrot = czm_view[0].z + czm_view[1].y; - float cosValue = cos(camrot); - float sinValue = sin(camrot); - mat3 rotation = mat3( - cosValue, -sinValue, 0.0, - sinValue, cosValue, 0.0, - 0.0, 0.0, 1.0 - ); + float t1 = -1.0; + float t2 = -1.0; - vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); - vec3 st2 = vec3((rotation * st1).xy, 1.0); - vec3 st3 = st2 * 0.5 + vec3(0.5); - vec2 lensStarTexcoord = st3.xy; - float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); - float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; - if (!isSpace) - { - result *= oneMinusWeightForLensFlare * intensity * 0.2; + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; } - else - { - result *= oneMinusWeightForLensFlare * intensity; - result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; + + if (t1 < 0.0 && t2 < 0.0) { + discard; } - result += texture(colorTexture, v_textureCoordinates); + float t = min(t1, t2); + if (t < 0.0) { + t = 0.0; + } - out_FragColor = result; -} -`;var k4=`uniform sampler2D colorTexture; -uniform vec3 white; + // March ray forward to intersection with larger sphere and find + czm_ray ray = czm_ray(t * direction, direction); -in vec2 v_textureCoordinates; + vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); -// See equation 4: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + if (czm_isEmpty(intersection)) + { + discard; + } -void main() -{ - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = (color * (1.0 + color / white)) / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var z4=`uniform sampler2D colorTexture; + // If the viewer is outside, compute outsideFaceColor, with normals facing outward. + vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); -in vec2 v_textureCoordinates; + // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. + vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); -float rand(vec2 co) -{ - return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); -} + out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); + out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); -void main(void) -{ - float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; - vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; - vec3 green = vec3(0.0, 1.0, 0.0); - out_FragColor = vec4((noiseValue + rgb) * green, 1.0); -} -`;var H4=`uniform sampler2D colorTexture; +#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + t = (intersection.start != 0.0) ? intersection.start : intersection.stop; + vec3 positionEC = czm_pointAlongRay(ray, t); + vec4 positionCC = czm_projection * vec4(positionEC, 1.0); +#ifdef LOG_DEPTH + czm_writeLogDepth(1.0 + positionCC.w); +#else + float z = positionCC.z / positionCC.w; -in vec2 v_textureCoordinates; + float n = czm_depthRange.near; + float f = czm_depthRange.far; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; + gl_FragDepth = (z * (f - n) + f + n) * 0.5; +#endif #endif +} +`;var EI=`in vec3 position; -// See equation 3: -// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf +uniform vec3 u_radii; + +out vec3 v_positionEC; void main() { - vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); - vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE - float exposure = texture(autoExposure, vec2(0.5)).r; - color /= exposure; -#endif - color = color / (1.0 + color); - color = czm_inverseGamma(color); - out_FragColor = vec4(color, fragmentColor.a); -} -`;var G4=`uniform sampler2D colorTexture; -uniform sampler2D silhouetteTexture; + // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. + // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, + // but doing it here allows us to change the radii without rewriting the vertex data, and + // allows all ellipsoids to reuse the same vertex data. + vec4 p = vec4(u_radii * position, 1.0); -in vec2 v_textureCoordinates; + v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates + gl_Position = czm_modelViewProjection * p; // position in clip coordinates + + // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums + // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the + // ellipsoid (does not write depth) that was rendered in the farther frustum. + // + // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates + // artifacts since some fragments can be alpha blended twice. This is solved by only rendering + // the ellipsoid in the closest frustum to the viewer. + gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); -void main(void) -{ - vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); - vec4 color = texture(colorTexture, v_textureCoordinates); - out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); + czm_vertexLogDepth(); } `;/** * @license @@ -14033,7 +9671,7 @@ void main(void) * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var W4=`/** + */var TU=`/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * @@ -14627,449 +10265,4773 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; /*--------------------------------------------------------------------------*/ } - #endif -/*--------------------------------------------------------------------------*/ + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;var AU=`uniform vec4 u_initialColor; + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP +uniform sampler2D u_mars_clip_area; +uniform bool u_mars_clip_enabled; +uniform bool u_mars_clip_only; +uniform mat4 u_mars_clip_inverMatrix; +uniform vec4 u_mars_clip_rect; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +#if TEXTURE_UNITS > 0 +uniform sampler2D u_dayTextures[TEXTURE_UNITS]; +uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; +uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; + +#ifdef APPLY_ALPHA +uniform float u_dayTextureAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_DAY_NIGHT_ALPHA +uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; +uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_CONTRAST +uniform float u_dayTextureContrast[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_HUE +uniform float u_dayTextureHue[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_SATURATION +uniform float u_dayTextureSaturation[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D +uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D +uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS]; +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; +#endif + +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; +#endif + +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN +uniform sampler2D u_waterMask; +uniform vec4 u_waterMaskTranslationAndScale; +uniform float u_zoomedOutOceanSpecularIntensity; +#endif + +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; +#endif + +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; +#endif + +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; +#endif + +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; +#endif + +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; // Hue, saturation, brightness +#endif + +#ifdef HIGHLIGHT_FILL_TILE +uniform vec4 u_fillHighlightColor; +#endif + +#ifdef TRANSLUCENT +uniform vec4 u_frontFaceAlphaByDistance; +uniform vec4 u_backFaceAlphaByDistance; +uniform vec4 u_translucencyRectangle; +#endif + +#ifdef UNDERGROUND_COLOR +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; +#endif + +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; +#endif + +in vec3 v_positionMC; +in vec3 v_positionEC; +in vec3 v_textureCoordinates; +in vec3 v_normalMC; +in vec3 v_normalEC; + +#ifdef APPLY_MATERIAL +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +uniform bool u_mars_flood_globe; + +uniform sampler2D u_mars_flood_area; +uniform bool u_mars_flood_emabled; +uniform bool u_showFloodOnly; +uniform mat4 u_mars_flood_inverMatrix; +uniform vec4 u_mars_flood_rect; +uniform bool u_mars_flood_showElse; +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2019-6-4 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +in float v_height; +in float v_slope; +in float v_aspect; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +in float v_distance; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +in vec3 v_atmosphereRayleighColor; +in vec3 v_atmosphereMieColor; +in float v_atmosphereOpacity; +#endif + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT +uniform int u_mars_uplift_RectangleWidth; +uniform int u_mars_uplift_RectangleHeight; +uniform highp sampler2D u_mars_uplift_RampRectangle; +uniform float u_mars_inverseTileWidth; +uniform vec2 u_mars_cartographicTileRectangle; +uniform bool u_mars_uplift_enabled; +uniform bool u_mars_uplift_hideInsideOrOutside; + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_uplift_RectangleHeight); + float v = (float(y) + 0.5) / float(u_mars_uplift_RectangleWidth); + vec4 point = texture(u_mars_uplift_RampRectangle, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, 0.0); +} + +bool inSlopeRampRectangle() { + for(int h = 0; h < 100000; h++) { + if(h >= u_mars_uplift_RectangleWidth) + break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++) { + if(float(w) >= currentLength) + break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(v_textureCoordinates.x > min(p1.x, p2.x) && v_textureCoordinates.x <= max(p1.x, p2.x)) { + if(v_textureCoordinates.y <= max(p1.y, p2.y)) { + if(p1.x != p2.x) { + xinters = ((v_textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if(p1.y == p2.y || v_textureCoordinates.y <= xinters) { + counter += 1.0; + } + } + } + } + + } + if((mod(counter, 2.0) != 0.0)) { + return true; + } + } + + return false; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} +#endif + +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +{ + return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); +} +#endif + +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() +{ + return + v_textureCoordinates.x > u_translucencyRectangle.x && + v_textureCoordinates.x < u_translucencyRectangle.z && + v_textureCoordinates.y > u_translucencyRectangle.y && + v_textureCoordinates.y < u_translucencyRectangle.w; +} +#endif + +vec4 sampleAndBlend( + vec4 previousColor, + sampler2D textureToSample, + vec2 tileTextureCoordinates, + vec4 textureCoordinateRectangle, + vec4 textureCoordinateTranslationAndScale, + float textureAlpha, + float textureNightAlpha, + float textureDayAlpha, + float textureBrightness, + float textureContrast, + float textureHue, + float textureSaturation, + float textureOneOverGamma, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + bool textureInvertColor, + vec3 texturefilterColor, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + float split, + vec4 colorToAlpha, + float nightBlend) +{ + // This crazy step stuff sets the alpha to 0.0 if this following condition is true: + // tileTextureCoordinates.s < textureCoordinateRectangle.s || + // tileTextureCoordinates.s > textureCoordinateRectangle.p || + // tileTextureCoordinates.t < textureCoordinateRectangle.t || + // tileTextureCoordinates.t > textureCoordinateRectangle.q + // In other words, the alpha is zero if the fragment is outside the rectangle + // covered by this texture. Would an actual 'if' yield better performance? + vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + + alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); + textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); +#endif + + vec2 translation = textureCoordinateTranslationAndScale.xy; + vec2 scale = textureCoordinateTranslationAndScale.zw; + vec2 textureCoordinates = tileTextureCoordinates * scale + translation; + vec4 value = texture(textureToSample, textureCoordinates); + vec3 color = value.rgb; + float alpha = value.a; + +#ifdef APPLY_COLOR_TO_ALPHA + vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); + colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); + alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); +#endif + +#if !defined(APPLY_GAMMA) + vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); + color = tempColor.rgb; + alpha = tempColor.a; +#else + color = pow(color, vec3(textureOneOverGamma)); +#endif + +#ifdef APPLY_SPLIT + float splitPosition = czm_splitPosition; + // Split to the left + if (split < 0.0 && gl_FragCoord.x > splitPosition) { + alpha = 0.0; + } + // Split to the right + else if (split > 0.0 && gl_FragCoord.x < splitPosition) { + alpha = 0.0; + } +#endif + +#ifdef APPLY_BRIGHTNESS + color = mix(vec3(0.0), color, textureBrightness); +#endif + +#ifdef APPLY_CONTRAST + color = mix(vec3(0.5), color, textureContrast); +#endif + +#ifdef APPLY_HUE + color = czm_hue(color, textureHue); +#endif + +#ifdef APPLY_SATURATION + color = czm_saturation(color, textureSaturation); +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C +#ifdef APPLY_INVERT_COLOR_MARS3D + if(textureInvertColor) { + color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b); + } +#endif + +#ifdef APPLY_FILTER_COLOR_MARS3D + if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) { + color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z); + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + + float sourceAlpha = alpha * textureAlpha; + float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); + outAlpha += sign(outAlpha) - 1.0; + + vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; + + // When rendering imagery for a tile in multiple passes, + // some GPU/WebGL implementation combinations will not blend fragments in + // additional passes correctly if their computation includes an unmasked + // divide-by-zero operation, + // even if it's not in the output or if the output has alpha zero. + // + // For example, without sanitization for outAlpha, + // this renders without artifacts: + // if (outAlpha == 0.0) { outColor = vec3(0.0); } + // + // but using czm_branchFreeTernary will cause portions of the tile that are + // alpha-zero in the additional pass to render as black instead of blending + // with the previous pass: + // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); + // + // So instead, sanitize against divide-by-zero, + // store this state on the sign of outAlpha, and correct on return. + + return vec4(outColor, max(outAlpha, 0.0)); +} + +vec3 colorCorrect(vec3 rgb) { +#ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + rgb = czm_HSBToRGB(hsb); +#endif + return rgb; +} + +vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); + +const float fExposure = 2.0; + +vec3 computeEllipsoidPosition() +{ + float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); + vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); + xy *= czm_viewport.zw * mpp * 0.5; + + vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); + czm_ray ray = czm_ray(vec3(0.0), direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + + vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); + return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; +} + +void main() +{ +#ifdef TILE_LIMIT_RECTANGLE + if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || + v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) + { + discard; + } +#endif + +#ifdef ENABLE_CLIPPING_PLANES + float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); +#endif + +#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) + vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates + vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes +#endif + +#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) + float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); +#else + float nightBlend = 0.0; +#endif + + // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 + // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the + // fragments on the edges of tiles even though the vertex shader is outputting + // coordinates strictly in the 0-1 range. + vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); + +#ifdef SHOW_TILE_BOUNDARIES + if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || + v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) + { + color = vec4(1.0, 0.0, 0.0, 1.0); + } +#endif + +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) + float cameraDist; + if (czm_sceneMode == czm_sceneMode2D) + { + cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; + } + else if (czm_sceneMode == czm_sceneModeColumbusView) + { + cameraDist = -czm_view[3].z; + } + else + { + cameraDist = length(czm_view[3]); + } + float fadeOutDist = u_lightingFadeDistance.x; + float fadeInDist = u_lightingFadeDistance.y; + if (czm_sceneMode != czm_sceneMode3D) { + vec3 radii = czm_ellipsoidRadii; + float maxRadii = max(radii.x, max(radii.y, radii.z)); + fadeOutDist -= maxRadii; + fadeInDist -= maxRadii; + } + float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else + float fade = 0.0; +#endif + +#ifdef SHOW_REFLECTIVE_OCEAN + vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; + vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; + vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; + waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; + + float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; + + if (mask > 0.0) + { + mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); + + vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); + vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); + + vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); + + color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); + } +#endif + +#ifdef APPLY_MATERIAL + czm_materialInput materialInput; + materialInput.st = v_textureCoordinates.st; + materialInput.normalEC = normalize(v_normalEC); + materialInput.positionToEyeEC = -v_positionEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); + materialInput.slope = v_slope; + materialInput.height = v_height; + materialInput.aspect = v_aspect; + czm_material material = czm_getMaterial(materialInput); + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + //czm_isInEllipsoid\u662F\u81EA\u5DF1\u5199\u7684\u5224\u65AD\u9876\u70B9\u662F\u5426\u5728\u533A\u57DF\u7684\u5185\u7F6E\u51FD\u6570 + + vec4 materialColor = vec4(material.diffuse, material.alpha); + if(u_mars_flood_emabled) { + if(u_mars_flood_globe) { + vec4 materialColor = vec4(material.diffuse, material.alpha); + color = alphaBlend(materialColor, color); + } else { + vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC, 1.0); + vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw; + vec4 ymColor = texture(u_mars_flood_area, newuv); + if(newuv.x >= 0.0 && newuv.x <= 1.0 && newuv.y >= 0.0 && newuv.y <= 1.0 && lpos.z >= 0.0 && ymColor.r > 0.8 && ymColor.a > 0.8) { + color.xyz = mix(color.xyz, material.diffuse, material.alpha); + } else { + if(!u_mars_flood_showElse) { + discard; + } + } + } + } + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#endif + +#ifdef ENABLE_VERTEX_LIGHTING + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#elif defined(ENABLE_DAYNIGHT_SHADING) + float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); + diffuseIntensity = mix(1.0, diffuseIntensity, fade); + vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); +#else + vec4 finalColor = color; +#endif + +#ifdef ENABLE_CLIPPING_PLANES + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; + + if (clipDistance < clippingPlanesEdgeWidth) + { + finalColor = clippingPlanesEdgeColor; + } +#endif + +#ifdef HIGHLIGHT_FILL_TILE + finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +#endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + +#if defined(GROUND_ATMOSPHERE) || defined(FOG) + if (!czm_backFacing()) + { + bool dynamicLighting = false; + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + + vec3 rayleighColor; + vec3 mieColor; + float opacity; + + vec3 positionWC; + vec3 lightDirection; + + // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. + // Otherwise, the scattering is computed in the vertex shader. + #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE + positionWC = computeEllipsoidPosition(); + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + computeAtmosphereScattering( + positionWC, + lightDirection, + rayleighColor, + mieColor, + opacity + ); + #else + positionWC = v_positionMC; + lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); + rayleighColor = v_atmosphereRayleighColor; + mieColor = v_atmosphereMieColor; + opacity = v_atmosphereOpacity; + #endif + + rayleighColor = colorCorrect(rayleighColor); + mieColor = colorCorrect(mieColor); + + vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + + // Fog is applied to tiles selected for fog, close to the Earth. + #ifdef FOG + vec3 fogColor = groundAtmosphereColor.rgb; + + // If there is lighting, apply that to the fog. + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); + fogColor *= darken; + #endif + + #ifndef HDR + fogColor.rgb = czm_acesTonemapping(fogColor.rgb); + fogColor.rgb = czm_inverseGamma(fogColor.rgb); + #endif + + const float modifier = 0.15; + finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); + + #else + // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. + // This value is larger near the "circumference", as it is further away from the camera. We use it to + // brighten up that area of the ground atmosphere. + const float transmittanceModifier = 0.5; + float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); + + vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) + float fadeInDist = u_nightFadeDistance.x; + float fadeOutDist = u_nightFadeDistance.y; + + float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); + float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); + vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); + + finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); + #endif + + #ifndef HDR + finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); + #else + finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); + #endif + + finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); + #endif + } +#endif + +#ifdef UNDERGROUND_COLOR + if (czm_backFacing()) + { + float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); + float distance = max(v_distance - distanceFromEllipsoid, 0.0); + float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); + vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); + finalColor = alphaBlend(undergroundColor, finalColor); + } +#endif + +#ifdef TRANSLUCENT + if (inTranslucencyRectangle()) + { + vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; + finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); + } +#endif + +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 +#ifdef APPLY_MARS3D_CLIP + if(u_mars_clip_enabled) { + vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC, 1.0); + vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy) / u_mars_clip_rect.zw; + vec4 tColor = texture(u_mars_clip_area, tuv); + if(!(tuv.x >= 0.0 && tuv.x <= 1.0 && tuv.y >= 0.0 && tuv.y <= 1.0) || (tColor.r < 0.5 && tColor.a < 0.5)) { + if(u_mars_clip_only) { + discard; + } + } else { + if(!u_mars_clip_only) { + discard; + } + } + } +#endif +//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2021-3-16 \u5730\u5F62\u6316\u6398\u4E0E\u6DF9\u6CA1 + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347 +#ifdef APPLY_MARS3D_UPLIFT + if(u_mars_uplift_enabled) { + bool isInSlopeRampRectangle = inSlopeRampRectangle(); + if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) { + discard; + } + } +#endif + + out_FragColor = finalColor; +} + + +#ifdef SHOW_REFLECTIVE_OCEAN + +float waveFade(float edge0, float edge1, float x) +{ + float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return pow(1.0 - y, 5.0); +} + +float linearFade(float edge0, float edge1, float x) +{ + return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} + +// Based on water rendering by Jonas Wagner: +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +// low altitude wave settings +const float oceanFrequencyLowAltitude = 825000.0; +const float oceanAnimationSpeedLowAltitude = 0.004; +const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; +const float oceanSpecularIntensity = 0.5; + +// high altitude wave settings +const float oceanFrequencyHighAltitude = 125000.0; +const float oceanAnimationSpeedHighAltitude = 0.008; +const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; + +vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) +{ + vec3 positionToEyeEC = -positionEyeCoordinates; + float positionToEyeECLength = length(positionToEyeEC); + + // The double normalize below works around a bug in Firefox on Android devices. + vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); + + // Fade out the waves as the camera moves far from the surface. + float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); + +#ifdef SHOW_OCEAN_WAVES + // high altitude waves + float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; + vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); + vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); + + // low altitude waves + time = czm_frameNumber * oceanAnimationSpeedLowAltitude; + noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); + vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); + + // blend the 2 wave layers based on distance to surface + float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); + float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); + vec3 normalTangentSpace = + (highAltitudeFade * normalTangentSpaceHighAltitude) + + (lowAltitudeFade * normalTangentSpaceLowAltitude); + normalTangentSpace = normalize(normalTangentSpace); + + // fade out the normal perturbation as we move farther from the water surface + normalTangentSpace.xy *= waveIntensity; + normalTangentSpace = normalize(normalTangentSpace); +#else + vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); +#endif + + vec3 normalEC = enuToEye * normalTangentSpace; + + const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); + + // Use diffuse light to highlight the waves + float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; + vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); + +#ifdef SHOW_OCEAN_WAVES + // Where diffuse light is low or non-existent, use wave highlights based solely on + // the wave bumpiness and no particular light direction. + float tsPerturbationRatio = normalTangentSpace.z; + vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); +#else + vec3 nonDiffuseHighlight = vec3(0.0); +#endif + + // Add specular highlights in 3D, and in all modes when zoomed in. + float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); + float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); + float specular = specularIntensity * surfaceReflectance; + +#ifdef HDR + specular *= 1.4; + + float e = 0.2; + float d = 3.3; + float c = 1.7; + + vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); +#else + vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; +#endif + + return vec4(color, imageryColor.a); +} + +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var EU=`#ifdef QUANTIZATION_BITS12 +in vec4 compressed0; +in float compressed1; +#else +in vec4 position3DAndHeight; +in vec4 textureCoordAndEncodedNormals; +#endif + +#ifdef GEODETIC_SURFACE_NORMALS +in vec3 geodeticSurfaceNormal; +#endif + +#ifdef EXAGGERATION +uniform vec2 u_terrainExaggerationAndRelativeHeight; +#endif + +uniform vec3 u_center3D; +uniform mat4 u_modifiedModelView; +uniform mat4 u_modifiedModelViewProjection; +uniform vec4 u_tileRectangle; + +// Uniforms for 2D Mercator projection +uniform vec2 u_southAndNorthLatitude; +uniform vec2 u_southMercatorYAndOneOverHeight; + +out vec3 v_positionMC; +out vec3 v_positionEC; + +out vec3 v_textureCoordinates; +out vec3 v_normalMC; +out vec3 v_normalEC; + +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT +uniform bool u_mars_flat_enabled; +uniform int u_mars_flat_AreaWidth; +uniform int u_mars_flat_AreaHeight; +uniform highp float u_mars_inverseTileWidth; +uniform highp vec2 u_mars_cartographicTileRectangle; +uniform highp sampler2D u_mars_flat_AreaTexture; +const float invalidValue = 8654238.5581; // \u8BBE\u7F6E\u65E0\u6548\u503C + +vec4 getRegions(int x, int y) { + float u = (float(x) + 0.5) / float(u_mars_flat_AreaHeight); + float v = (float(y) + 0.5) / float(u_mars_flat_AreaWidth); + vec4 point = texture(u_mars_flat_AreaTexture, vec2(u, v)); + float newX = (point.x - u_mars_cartographicTileRectangle.x) * u_mars_inverseTileWidth; + float newY = (point.y - u_mars_cartographicTileRectangle.y) * u_mars_inverseTileWidth; + return vec4(newX, newY, point.z, point.w); +} + +float inRectangle(vec2 textureCoordinates) { + for(int h = 0; h < 100000; h++){ + if(h >= u_mars_flat_AreaWidth) break; + + vec4 first = getRegions(0, h); + float currentLength = first.z; + float height = first.w; + float counter = 0.0; + float xinters = 0.0; + for(int w = 0; w < 100000; w++){ + if(float(w) >= currentLength) break; + int nextIndex = w + 1; + nextIndex = float(nextIndex) == currentLength ? 0 : nextIndex; + vec4 px = getRegions(w, h); + vec4 py = getRegions(nextIndex, h); + vec2 p1 = px.xy; + vec2 p2 = py.xy; + if(textureCoordinates.x > min(p1.x, p2.x) && textureCoordinates.x <= max(p1.x, p2.x)){ + if (textureCoordinates.y <= max(p1.y, p2.y)){ + if (p1.x != p2.x){ + xinters = ((textureCoordinates.x - p1.x) * (p2.y - p1.y)) / (p2.x - p1.x) + p1.y; + if (p1.y == p2.y || textureCoordinates.y <= xinters) + { + counter += 1.0; + } + } + } + } + + } + if((mod(counter, 2.0) != 0.0)) { + return height; + } + } + + return invalidValue; +} +#endif +// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + +#ifdef APPLY_MATERIAL +out float v_slope; +out float v_aspect; +out float v_height; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +out float v_distance; +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) +out vec3 v_atmosphereRayleighColor; +out vec3 v_atmosphereMieColor; +out float v_atmosphereOpacity; +#endif + +// These functions are generated at runtime. +vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); +float get2DYPositionFraction(vec2 textureCoordinates); + +vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return u_modifiedModelViewProjection * vec4(position, 1.0); +} + +float get2DMercatorYPositionFraction(vec2 textureCoordinates) +{ + // The width of a tile at level 11, in radians and assuming a single root tile, is + // 2.0 * czm_pi / pow(2.0, 11.0) + // We want to just linearly interpolate the 2D position from the texture coordinates + // when we're at this level or higher. The constant below is the expression + // above evaluated and then rounded up at the 4th significant digit. + const float maxTileWidth = 0.003068; + float positionFraction = textureCoordinates.y; + float southLatitude = u_southAndNorthLatitude.x; + float northLatitude = u_southAndNorthLatitude.y; + if (northLatitude - southLatitude > maxTileWidth) + { + float southMercatorY = u_southMercatorYAndOneOverHeight.x; + float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; + + float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); + currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); + positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); + } + return positionFraction; +} + +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ + return textureCoordinates.y; +} + +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + return u_modifiedModelViewProjection * rtcPosition2D; +} + +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} + +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ + return getPositionPlanarEarth(position, height, textureCoordinates); +} + +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ + // We do not do RTC while morphing, so there is potential for jitter. + // This is unlikely to be noticeable, though. + vec3 position3DWC = position + u_center3D; + float yPositionFraction = get2DYPositionFraction(textureCoordinates); + vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); + vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); + return czm_modelViewProjection * morphPosition; +} + +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif + +void main() +{ +#ifdef QUANTIZATION_BITS12 + vec2 xy = czm_decompressTextureCoordinates(compressed0.x); + vec2 zh = czm_decompressTextureCoordinates(compressed0.y); + vec3 position = vec3(xy, zh.x); + float height = zh.y; + vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); + + height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; + position = (u_scaleAndBias * vec4(position, 1.0)).xyz; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; + float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = compressed0.w; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#else + // A single float per element + vec3 position = position3DAndHeight.xyz; + float height = position3DAndHeight.w; + vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; + +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = textureCoordAndEncodedNormals.w; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + float webMercatorT = textureCoordinates.y; + float encodedNormal = textureCoordAndEncodedNormals.z; +#elif defined(INCLUDE_WEB_MERCATOR_Y) + float webMercatorT = textureCoordAndEncodedNormals.z; + float encodedNormal = 0.0; +#else + float webMercatorT = textureCoordinates.y; + float encodedNormal = 0.0; +#endif + +#endif + + vec3 position3DWC = position + u_center3D; + +#ifdef GEODETIC_SURFACE_NORMALS + vec3 ellipsoidNormal = geodeticSurfaceNormal; +#else + vec3 ellipsoidNormal = normalize(position3DWC); +#endif + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + float exaggeration = u_terrainExaggerationAndRelativeHeight.x; + float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; + float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; + + // stop from going through center of earth + float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); + newHeight = max(newHeight, -minRadius); + + vec3 offset = ellipsoidNormal * (newHeight - height); + position += offset; + position3DWC += offset; + height = newHeight; +#endif + + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 +#ifdef APPLY_MARS3D_FLAT + if(u_mars_flat_enabled){ + float isInside = inRectangle(textureCoordinates); + if(isInside != invalidValue){ + vec3 offset = (isInside - height) * ellipsoidNormal; + position += offset; + position3DWC += offset; + height = isInside; + // vec3 newPosition = (position3DWC + (isInside - height) * ellipsoidNormal) - u_center3D; + } + } +#endif + // \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73 + + gl_Position = getPosition(position, height, textureCoordinates); + + v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; + v_positionMC = position3DWC; // position in model coordinates + + v_textureCoordinates = vec3(textureCoordinates, webMercatorT); + +#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) + vec3 normalMC = czm_octDecode(encodedNormal); + +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) + vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; + vec3 rejection = normalMC - projection; + normalMC = normalize(projection + rejection * exaggeration); +#endif + + v_normalMC = normalMC; + v_normalEC = czm_normal3D * v_normalMC; +#endif + +#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) + + bool dynamicLighting = false; + + #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) + dynamicLighting = true; + #endif + +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) + vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else + vec3 atmosphereLightDirection = czm_lightDirectionWC; +#endif + + vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); + + computeAtmosphereScattering( + position3DWC, + lightDirection, + v_atmosphereRayleighColor, + v_atmosphereMieColor, + v_atmosphereOpacity + ); +#endif + +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) + v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif + +#ifdef APPLY_MATERIAL + float northPoleZ = czm_ellipsoidRadii.z; + vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); + vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); + float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); + v_slope = acos(dotProd); + vec3 normalRejected = ellipsoidNormal * dotProd; + vec3 normalProjected = v_normalMC - normalRejected; + vec3 aspectVector = normalize(normalProjected); + v_aspect = acos(dot(aspectVector, vectorEastMC)); + float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); + v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); + v_height = height; +#endif +} +`;var SI=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { + + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + float atmosphereInnerRadius = length(positionWC); + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); +} +`;var SU=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var vU=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;var vI=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +vec3 getLightDirection(vec3 positionWC) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = + positionWC * float(lightEnum == 0.0) + + czm_lightDirectionWC * float(lightEnum == 1.0) + + czm_sunDirectionWC * float(lightEnum == 2.0); + return normalize(lightDirection); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var wU=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + vec3 lightDirection = getLightDirection(v_outerPositionWC); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_acesTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + // Convert rgb color to hsb + vec3 hsb = czm_RGBToHSB(color.rgb); + // Perform hsb shift + hsb.x += u_hsbShift.x; // hue + hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation + hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness + // Convert shifted hsb back to rgb + color.rgb = czm_HSBToRGB(hsb); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var IU=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + vec3 lightDirection = getLightDirection(positionWC.xyz); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;var DU=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var PU=`in vec3 position; + +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;var OU=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var RU=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var MU=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;var LU=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;var Xtt=new H;function Ktt(e,t){let n=e.unionClippingRegions,i=e.length,o=bs.useFloatTexture(t),r=bs.getTextureResolution(e,t,Xtt),s=r.x,a=r.y,c=o?$tt(s,a):Qtt(s,a);return c+=` +`,c+=n?Jtt(i):Ztt(i),c}function Jtt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount; + float pixelWidth = czm_metersPerPixel(position); + bool breakAndDiscard = false; + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) + { + breakAndDiscard = true; + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; +} +`}function Ztt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +{ + bool clipped = true; + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float clipAmount = 0.0; + float pixelWidth = czm_metersPerPixel(position); + for (int i = 0; i < ${e}; ++i) + { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + } + if (clipped) + { + discard; + } + return clipAmount; +} +`}function $tt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${r}; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +`}function Qtt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${r}; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v))); + return czm_transformPlane(plane, transform); +} +`}var Ty=Ktt;function ent(e,t,n,i,o){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o}function rq(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function tnt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function nnt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}rq.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,h=e.enableLighting,x=e.dynamicAtmosphereLighting,b=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,A=e.hasVertexNormals,S=e.useWebMercatorProjection,v=e.enableFog,I=e.enableClippingPlanes,O=e.clippingPlanes,R=e.clippedByBoundaries,N=e.hasImageryLayerCutout,F=e.colorCorrect,_=e.highlightFillTile,E=e.colorToAlpha,w=e.hasGeodeticSurfaceNormals,D=e.hasExaggeration,M=e.showUndergroundColor,B=e.translucent,V=e.marsOptions||{},U=0,G="",Y=n.renderedMesh.encoding;Y.quantization===Qs.BITS12&&(U=1,G="QUANTIZATION_BITS12");let $=0,W="";R&&($=1,W="TILE_LIMIT_RECTANGLE");let K=0,J="";N&&(K=1,J="APPLY_IMAGERY_CUTOUT");let he=t.mode,ge=he|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|h<<10|x<<11|b<<12|C<<13|T<<14|A<<15|S<<16|v<<17|U<<18|d<<19|I<<20|$<<21|K<<22|F<<23|_<<24|E<<25|w<<26|D<<27|M<<28|B<<29|f<<30,se=0;l(O)&&O.length>0&&(se=I?O.clippingPlanesState:0);let pe=n.surfaceShader;if(l(pe)&&pe.numberOfDayTextures===i&&pe.flags===ge&&pe.material===this.material&&pe.clippingShaderState===se)return pe.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(l(xe)||(xe=this._shadersByTexturesFlags[i]=[]),pe=xe[ge],V.enableClip||!l(pe)||pe.material!==this.material||pe.clippingShaderState!==se){let De=this.baseVertexShaderSource.clone(),Se=this.baseFragmentShaderSource.clone();se!==0&&Se.sources.unshift(Ty(O,t.context)),V.enableClip&&Se.defines.push("APPLY_MARS3D_CLIP"),V.enableUplift&&Se.defines.push("APPLY_MARS3D_UPLIFT"),V.enableFlat&&De.defines.push("APPLY_MARS3D_FLAT"),De.defines.push(G),Se.defines.push(`TEXTURE_UNITS ${i}`,W,J),o&&Se.defines.push("APPLY_BRIGHTNESS"),r&&Se.defines.push("APPLY_CONTRAST"),s&&Se.defines.push("APPLY_HUE"),a&&Se.defines.push("APPLY_SATURATION"),c&&Se.defines.push("APPLY_GAMMA"),V.invertColor&&Se.defines.push("APPLY_INVERT_COLOR_MARS3D"),V.filterColor&&Se.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Se.defines.push("APPLY_ALPHA"),f&&Se.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Se.defines.push("SHOW_REFLECTIVE_OCEAN"),De.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&Se.defines.push("SHOW_OCEAN_WAVES"),E&&Se.defines.push("APPLY_COLOR_TO_ALPHA"),M&&(De.defines.push("UNDERGROUND_COLOR"),Se.defines.push("UNDERGROUND_COLOR")),B&&(De.defines.push("TRANSLUCENT"),Se.defines.push("TRANSLUCENT")),h&&(A?(De.defines.push("ENABLE_VERTEX_LIGHTING"),Se.defines.push("ENABLE_VERTEX_LIGHTING")):(De.defines.push("ENABLE_DAYNIGHT_SHADING"),Se.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Se.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),b&&(De.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Se.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(De.defines.push("GROUND_ATMOSPHERE"),Se.defines.push("GROUND_ATMOSPHERE"),T&&(De.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Se.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),De.defines.push("INCLUDE_WEB_MERCATOR_Y"),Se.defines.push("INCLUDE_WEB_MERCATOR_Y"),v&&(De.defines.push("FOG"),Se.defines.push("FOG")),d&&Se.defines.push("APPLY_SPLIT"),I&&Se.defines.push("ENABLE_CLIPPING_PLANES"),F&&Se.defines.push("COLOR_CORRECT"),_&&Se.defines.push("HIGHLIGHT_FILL_TILE"),w&&De.defines.push("GEODETIC_SURFACE_NORMALS"),D&&De.defines.push("EXAGGERATION");let we=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;N&&(we+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let Oe=0;Oe<i;++Oe)N?we+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Oe}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:we+=` color = sampleAndBlend( +`,we+=` color, + u_dayTextures[${Oe}], + u_dayTextureUseWebMercatorT[${Oe}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${Oe}], + u_dayTextureTranslationAndScale[${Oe}], + ${u?`u_dayTextureAlpha[${Oe}]`:"1.0"}, + ${f?`u_dayTextureNightAlpha[${Oe}]`:"1.0"}, +${f?`u_dayTextureDayAlpha[${Oe}]`:"1.0"}, +${o?`u_dayTextureBrightness[${Oe}]`:"0.0"}, + ${r?`u_dayTextureContrast[${Oe}]`:"0.0"}, + ${s?`u_dayTextureHue[${Oe}]`:"0.0"}, + ${a?`u_dayTextureSaturation[${Oe}]`:"0.0"}, + ${c?`u_dayTextureOneOverGamma[${Oe}]`:"0.0"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${V.invertColor?`u_mars3dTextureInvertColor[${Oe}]`:"false"}, + ${V.filterColor?`u_mars3dTextureFilterColor[${Oe}]`:"vec3(1.0)"}, + //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C + ${d?`u_dayTextureSplit[${Oe}]`:"0.0"}, + ${E?`u_colorsToAlpha[${Oe}]`:"vec4(0.0)"}, + nightBlend ); +`,N&&(we+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);we+=` return color; + }`,Se.sources.push(we),De.sources.push(tnt(he)),De.sources.push(nnt(S));let ze=$t.fromCache({context:t.context,vertexShaderSource:De,fragmentShaderSource:Se,attributeLocations:Y.getAttributeLocations()});pe=xe[ge]=new ent(i,ge,this.material,ze,se)}return n.surfaceShader=pe,pe.shaderProgram};rq.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var NU=rq;var int={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},di=Object.freeze(int);var ont={START:0,LOADING:1,DONE:2,FAILED:3},ea=Object.freeze(ont);var rnt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},bo=Object.freeze(rnt);function Ko(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new re(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=bo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Ko.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===bo.RECEIVING||e===bo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==di.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var snt=new me;function sq(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,snt);s=n.project(c,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var ant=new m,cnt=new m,lnt=new m;Ko.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],h=a[d+2],x=sq(c,t,n,s,p,ant),b=sq(c,t,n,s,g,cnt),C=sq(c,t,n,s,h,lnt),T=$i.rayTriangleParametric(e,x,b,C,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?In.getPoint(e,f,o):void 0};Ko.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=bo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Ko.prototype.freeVertexArray=function(){Ko._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Ko._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Ko.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Ko),e.state===ea.START&&(unt(e,t,n),e.state=ea.LOADING)};Ko.processStateMachine=function(e,t,n,i,o,r,s){Ko.initialize(e,n,i);let a=e.data;if(e.state===ea.LOADING&&fnt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===bo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ea.DONE}c&&(e.renderable=!0)};Ko.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===di.PLACEHOLDER){let g=d.loadingImagery.imageryLayer,h=g.imageryProvider;if(g.ready&&(l(h._ready)?h._ready:!l(h.ready)||h.ready)){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===di.FAILED||d.loadingImagery.state===di.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Epe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Pc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Pc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Ko._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Ko._createVertexArrayForMesh(i.context,o)):(Ko._freeVertexArray(e.vertexArray),e.vertexArray=Ko._createVertexArrayForMesh(i.context,o)),Ko._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Ko.prototype.addGeodeticSurfaceNormals=function(e,t){Epe(this,!0,e,t)};Ko.prototype.removeGeodeticSurfaceNormals=function(e){Epe(this,!1,void 0,e)};Ko.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let h=d[g];h.level=-1}}}};function unt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=bo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function fnt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===bo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Ko.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===bo.FAILED&&dnt(s,e,t,n,e.x,e.y,e.level),s.terrainState===bo.UNLOADED&&mnt(s,n,e.x,e.y,e.level),s.terrainState===bo.RECEIVED&&pnt(s,t,n,e.x,e.y,e.level),s.terrainState===bo.TRANSFORMED&&(_nt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=bo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)ynt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function dnt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ea.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=bo.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=bo.RECEIVED}).catch(function(){e.terrainState=bo.FAILED}))}function mnt(e,t,n,i,o){function r(c){e.terrainData=c,e.terrainState=bo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ni.CANCELLED){e.terrainData=void 0,e.terrainState=bo.UNLOADED,e.request=void 0;return}e.terrainState=bo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Ai.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new Qo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=bo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=bo.UNLOADED,e.request=void 0)}a()}var hnt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function pnt(e,t,n,i,o,r){let s=n.tilingScheme,a=hnt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=bo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=bo.TRANSFORMED}).catch(function(){e.terrainState=bo.FAILED}))}Ko._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ht.createVertexBuffer({context:e,typedArray:n,usage:ke.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=ht.createIndexBuffer({context:e,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ai({context:e,attributes:o,indexBuffer:s})};Ko._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function _nt(e,t,n,i,o,r,s){e.vertexArray=Ko._createVertexArrayForMesh(t,e.mesh),e.terrainState=bo.READY,e.fill=e.fill&&e.fill.destroy(s)}function gnt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Lt.create({context:e,pixelFormat:lt.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Si.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function ynt(e,t){let n=t.terrainData.waterMask,i=gnt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Lt.create({context:e,pixelFormat:lt.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,re.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Ko.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Ko.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var kd=Ko;var FU,Spe="AAPKac82a6d80f1340a4aa9587f789d07e96a_Jj1a4fbA59cggYHArDizxxA2U4QDofLUm36VivpUsSRyK7O1JjRPwy916Y-7ld",nE={};nE.defaultAccessToken=Spe;nE.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});nE.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});nE.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});nE.getDefaultTokenCredit=function(e){if(e===Spe){if(!l(FU)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';FU=new wt(t,!0),FU._isDefaultToken=!0}return FU}};var yf=nE;function aq(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=ve.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Jd(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}aq.prototype.isReady=function(){return this._isReady};aq.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Jd(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var BU=aq;function cq(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}cq.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};cq.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var ah=cq;function iE(){fe.throwInstantiationError()}Object.defineProperties(iE.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError},defaultAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultNightAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultDayAlpha:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultBrightness:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultContrast:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultHue:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultSaturation:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultGamma:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMinificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},defaultMagnificationFilter:{get:fe.throwInstantiationError,set:fe.throwInstantiationError}});iE.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};iE.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};iE.prototype.pickFeatures=function(e,t,n,i,o){fe.throwInstantiationError()};var xnt=/\.ktx2$/i;iE.loadImage=function(e,t){let n=ve.createIfNeeded(t);return xnt.test(n.url)?Rl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var yl=iE;var bnt={SATELLITE:1,OCEANS:2,HILLSHADE:3},ch=Object.freeze(bnt);function lq(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Yi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new wt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}lq.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new BU({missingImageUrl:wpe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),e._ready=!0};function Cnt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new kr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Yi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Oi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new wt(e.copyrightText)]:t.credit=new wt(e.copyrightText))}function Tnt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function vpe(e,t,n){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let o=await i.fetchJson();Cnt(o,t)}catch(o){Tnt(e,o,n)}}function lh(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Yi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;if(typeof t=="string"&&(t=new wt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let n=ve.createIfNeeded(e.url);n.appendForwardSlash(),this._tileDiscardPolicy=e.tileDiscardPolicy,l(e.token)&&n.setQueryParameters({token:e.token}),this._resource=n;let i=new lq(e);i.useTiles?this._readyPromise=vpe(n,i,this).then(()=>(i.build(this),!0)):(i.build(this),this._readyPromise=Promise.resolve(!0))}}lh.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case ch.SATELLITE:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldImageryServer)),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;case ch.OCEANS:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldOceanServer)),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;case ch.HILLSHADE:{n=y(t.token,yf.defaultAccessToken),i=ve.createIfNeeded(y(t.url,yf.defaultWorldHillshadeServer)),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=wt.clone(r))}break;default:}return lh.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function wpe(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Di?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(lh.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});lh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new lh(t);i._resource=n;let o=new lq(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await vpe(n,o),o.build(i),i._readyPromise=Promise.resolve(!0),i};lh.prototype.getTileCredits=function(e,t,n){return this._tileCredits};lh.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,wpe(this,e,t,n,i))};lh.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Di)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],h=p.results;if(!l(h))return g;for(let x=0;x<h.length;++x){let b=h[x],C=new ah;if(C.data=b,C.name=b.value,C.properties=b.attributes,C.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let T=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)C.position=me.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(T===102100||T===900913||T===3857){let A=new Oi;C.position=A.unproject(new m(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(C)}return g})};lh._metadataCache={};var Hp=lh;var Ant={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},wI=Object.freeze(Ant);function II(e){}II.prototype.isReady=function(){return!0};II.prototype.shouldDiscardImage=function(e){return II.EMPTY_IMAGE===e};var kU;Object.defineProperties(II,{EMPTY_IMAGE:{get:function(){return l(kU)||(kU=new Image,kU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),kU}}});var DI=II;function uq(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}uq.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof wt)break;o.credit=new wt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new ce(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}e._ready=!0};function Ent(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function Snt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function Ipe(e,t,n){let i=e.url,o=ds._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),ds._metadataCache[i]=o);try{let r=await o;return Ent(r,t)}catch(r){Snt(e,r,n)}}function ds(e){if(e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,wI.AERIAL),this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new DI),this._proxy=e.proxy,this._credit=new wt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${ds.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new kr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new _e,this._ready=!1,l(e.url)){Q("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let t=e.tileProtocol;l(t)?t.length>0&&t[t.length-1]===":"&&(t=t.substr(0,t.length-1)):t=document.location.protocol==="http:"?"http":"https";let n=ve.createIfNeeded(e.url);this._resource=n,n.appendForwardSlash();let i=n.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:e.key,uriScheme:t}}),o=new uq(e);this._readyPromise=Ipe(i,o,this).then(()=>(o.build(this),!0))}}Object.defineProperties(ds.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ds.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,wI.AERIAL),o=ve.createIfNeeded(e);o.appendForwardSlash();let r=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new ds(t);s._resource=o;let a=new uq(t);return await Ipe(r,a),a.build(s),s._readyPromise=Promise.resolve(!0),s};var vnt=new ce;ds.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,vnt);return Dnt(this._attributionList,n,i)};ds.prototype.requestImage=function(e,t,n,i){let o=yl.loadImage(this,wnt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?DI.EMPTY_IMAGE:Promise.reject(r)})};ds.prototype.pickFeatures=function(e,t,n,i,o){};ds.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};ds.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};ds._logoUrl=void 0;Object.defineProperties(ds,{logoUrl:{get:function(){return l(ds._logoUrl)||(ds._logoUrl=nn("Assets/Images/bing_maps_credit.png")),ds._logoUrl},set:function(e){ds._logoUrl=e}}});function wnt(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:ds.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Int=new ce;function Dnt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ce.intersection(n,d.bbox,Int);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ds._metadataCache={};var PI=ds;var Dpe=/{[^}]+}/g,mq={x:Rnt,y:Lnt,z:Bnt,s:knt,reverseX:Mnt,reverseY:Nnt,reverseZ:Fnt,westDegrees:Unt,southDegrees:Vnt,eastDegrees:znt,northDegrees:Hnt,westProjected:Gnt,southProjected:Wnt,eastProjected:jnt,northProjected:qnt,width:Ynt,height:Xnt},Ppe=_t(mq,{i:Knt,j:Jnt,reverseI:Znt,reverseJ:$nt,longitudeDegrees:eit,latitudeDegrees:tit,longitudeProjected:nit,latitudeProjected:iit,format:rit});function Fx(e){if(e=y(e,y.EMPTY_OBJECT),this._errorEvent=new _e,l(e.then)){this._reinitialize(e);return}let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new kr({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new wt(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=_t(mq,r),a=_t(Ppe,r);this._tags=s,this._pickFeaturesTags=a,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(Fx.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready&&l(this._resource)}},readyPromise:{get:function(){return Q("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Fx.prototype.reinitialize=function(e){return Q("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._reinitialize(e)};Fx.prototype._reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,o=_t(mq,i),r=_t(Ppe,i),s=ve.createIfNeeded(n.url),a=ve.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new kr({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=ce.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new wt(c)),t._credit=c,t._resource=s,t._tags=o,t._pickFeaturesResource=a,t._pickFeaturesTags=r,t._ready=!0,!0})};Fx.prototype.getTileCredits=function(e,t,n){};Fx.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,Pnt(this,e,t,n,i))};Fx.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Ont(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var UU=!1,pu=new ce,VU=!1,OI=new ce;function Pnt(e,t,n,i,o){UU=!1,VU=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(Dpe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var fq=!1,rE=new H,dq=!1;function Ont(e,t,n,i,o,r,s){UU=!1,VU=!1,fq=!1,dq=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Dpe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function sE(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Rnt(e,t,n,i){return sE(e,"{x}",t)}function Mnt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return sE(e,"{reverseX}",o)}function Lnt(e,t,n,i){return sE(e,"{y}",n)}function Nnt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return sE(e,"{reverseY}",o)}function Fnt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return sE(e,"{reverseZ}",r)}function Bnt(e,t,n,i){return sE(e,"{z}",i)}function knt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function zU(e,t,n,i){UU||(e.tilingScheme.tileXYToRectangle(t,n,i,pu),pu.west=P.toDegrees(pu.west),pu.south=P.toDegrees(pu.south),pu.east=P.toDegrees(pu.east),pu.north=P.toDegrees(pu.north),UU=!0)}function Unt(e,t,n,i){return zU(e,t,n,i),pu.west}function Vnt(e,t,n,i){return zU(e,t,n,i),pu.south}function znt(e,t,n,i){return zU(e,t,n,i),pu.east}function Hnt(e,t,n,i){return zU(e,t,n,i),pu.north}function HU(e,t,n,i){VU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,OI),VU=!0)}function Gnt(e,t,n,i){return HU(e,t,n,i),OI.west}function Wnt(e,t,n,i){return HU(e,t,n,i),OI.south}function jnt(e,t,n,i){return HU(e,t,n,i),OI.east}function qnt(e,t,n,i){return HU(e,t,n,i),OI.north}function Ynt(e,t,n,i){return e.tileWidth}function Xnt(e,t,n,i){return e.tileHeight}function Knt(e,t,n,i,o,r,s){return GU(e,t,n,i,o,r),rE.x}function Jnt(e,t,n,i,o,r,s){return GU(e,t,n,i,o,r),rE.y}function Znt(e,t,n,i,o,r,s){return GU(e,t,n,i,o,r),e.tileWidth-rE.x-1}function $nt(e,t,n,i,o,r,s){return GU(e,t,n,i,o,r),e.tileHeight-rE.y-1}var Qnt=new ce,oE=new m;function GU(e,t,n,i,o,r,s){if(fq)return;hq(e,t,n,i,o,r);let a=oE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Qnt);rE.x=e.tileWidth*(a.x-c.west)/c.width|0,rE.y=e.tileHeight*(c.north-a.y)/c.height|0,fq=!0}function eit(e,t,n,i,o,r,s){return P.toDegrees(o)}function tit(e,t,n,i,o,r,s){return P.toDegrees(r)}function nit(e,t,n,i,o,r,s){return hq(e,t,n,i,o,r),oE.x}function iit(e,t,n,i,o,r,s){return hq(e,t,n,i,o,r),oE.y}var oit=new me;function hq(e,t,n,i,o,r,s){if(!dq){if(e.tilingScheme.projection instanceof Di)oE.x=P.toDegrees(o),oE.y=P.toDegrees(r);else{let a=oit;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,oE)}dq=!0}}function rit(e,t,n,i,o,r,s){return s}var ta=Fx;function _u(e){if(e=y(e,y.EMPTY_OBJECT),l(e.url)){Q("TileMapServiceImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use TileMapServiceImageryProvider.fromUrl instead."),this._metadataError=void 0,this._ready=!1;let t,n=this,i=Promise.resolve(e.url).then(function(o){return t=ve.createIfNeeded(o),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),_u._requestMetadata(e,n._tmsResource,n._xmlResource,n)}).catch(o=>Promise.reject(o));ta.call(this,i),this._promise=i}}_u._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return _u._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof wh)return _u._metadataFailure(e,t);throw o}};_u.fromUrl=async function(e,t){let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await _u._requestMetadata(t,i,o),s=new _u;return ta.call(s,r),s};l(Object.create)&&(_u.prototype=Object.create(ta.prototype),_u.prototype.constructor=_u);function Ope(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function Rpe(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}_u._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let N=g.item(R).childNodes;for(let F=0;F<N.length;F++)s.test(N.item(F).nodeName)&&p.push(N.item(F))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let h;if(!l(d)||!l(f))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Ai.reportError(void 0,o,o.errorEvent,h),new de(h);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),T=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(S==="geodetic"||S==="global-geodetic")v=new Yi({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new kr({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(o)&&Ai.reportError(void 0,o,o.errorEvent,h),new de(h);let I=ce.clone(t.rectangle);if(!l(I)){let R,N,F,_;y(t.flipXY,!1)?(F=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(F=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=S==="geodetic"||S==="mercator";if(v.projection instanceof Di||w)R=me.fromDegrees(F.x,F.y),N=me.fromDegrees(_.x,_.y);else{let D=v.projection;R=D.unproject(F),N=D.unproject(_)}I=new ce(R.longitude,R.latitude,N.longitude,N.latitude)}return I=Ope(I,v),T=Rpe(v,I,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:I,tileWidth:b,tileHeight:C,minimumLevel:T,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};_u._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new kr({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=Ope(a,s);let c=Rpe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Gp=_u;function pq(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}pq.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function sit(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new de(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new kr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new de(o)}return!0}function ait(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Ai.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function Mpe(e,t,n){try{let i=await e.fetchText();sit(i,t)}catch(i){ait(i,e,n)}}function xl(e){if(e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new wt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${xl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new _e,l(e.url)||l(e.channel)){Q("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let t=e.url,n=y(e.path,"/default_map"),i=ve.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._ready=!1;let o=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),r=new pq(e);this._readyPromise=Mpe(o,r,this).then(()=>(r.build(this),this._ready=!0,!0))}}Object.defineProperties(xl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});xl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=ve.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new pq(n);s.channel=t,await Mpe(r,s);let a=new xl(n);return s.build(a),a._readyPromise=Promise.resolve(!0),a._ready=!0,a._resource=o,a._url=e,a._path=i,a};xl.prototype.getTileCredits=function(e,t,n){};xl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return yl.loadImage(this,o)};xl.prototype.pickFeatures=function(e,t,n,i,o){};xl._logoUrl=void 0;Object.defineProperties(xl,{logoUrl:{get:function(){return l(xl._logoUrl)||(xl._logoUrl=nn("Assets/Images/google_earth_credit.png")),xl._logoUrl},set:function(e){xl._logoUrl=e}}});var RI=xl;var cit=/\/$/,Lpe=new wt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function aE(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();cit.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new wt(s))):s=Lpe,this._resource=i,this._imageryProvider=new ta({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(aE.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});aE.prototype.getTileCredits=function(e,t,n){};aE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};aE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};aE._defaultCredit=Lpe;var MI=aE;function Bx(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new Yi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new _e,this._ready=!1;let i=e.credit;typeof i=="string"&&(i=new wt(i)),this._credit=i;let o=ve.createIfNeeded(e.url);if(this._resource=o,l(e.tileWidth)||l(e.tileHeight)){this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}Q("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=WU(o,this).then(r=>(Ai.reportSuccess(this._errorEvent),this._image=r,this._tileWidth=r.width,this._tileHeight=r.height,this._ready=!0,!0))}Object.defineProperties(Bx.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return Q("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});function lit(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Ai.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return WU(e,n,r);throw l(n)&&(n._hasError=!0),new de(o)}async function WU(e,t,n){try{return await yl.loadImage(null,e)}catch(i){return lit(e,i,t,n)}}Bx.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await WU(n);t=y(t,y.EMPTY_OBJECT);let o=new Bx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};Bx.prototype.getTileCredits=function(e,t,n){};Bx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await WU(this._resource,this);return this._image=o,Ai.reportSuccess(this._errorEvent),o}return this._image};Bx.prototype.pickFeatures=function(e,t,n,i,o){};var LI=Bx;function uit(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=fit:e==="xml"?n=pit:(e==="html"||e==="text")&&(n=Npe)),this.callback=n}function fit(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new ah;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=me.fromDegrees(s,a)}t.push(r)}return t}var _q="http://www.mapinfo.com/mxp",dit="http://www.esri.com/wms",mit="http://www.opengis.net/wfs",hit="http://www.opengis.net/gml";function pit(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===_q)return _it(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===dit)return git(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===mit)return yit(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?xit(e):bit(e)}function _it(e){let t=[],i=e.documentElement.getElementsByTagNameNS(_q,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(_q,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new ah;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function git(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(jU(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(jU(a,i))}}return n}function yit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(hit,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};gq(r,s),t.push(jU(r,s))}return t}function xit(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new de("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};gq(s,a),t.push(jU(s,a))}}return t}function gq(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&gq(o,t)&&(t[o.localName]=o.textContent)}return n}function jU(e,t){let n=new ah;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function bit(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new ah;return o.data=e,o.description=n.innerHTML,[o]}var Cit=/<body>\s*<\/body>/im,Tit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Ait=/<title>([\s\S]*)<\/title>/im;function Npe(e){if(Cit.test(e)||Tit.test(e))return;let t,n=Ait.exec(e);n&&n.length>1&&(t=n[1]);let i=new ah;return i.name=t,i.description=e,i.data=e,[i]}var cE=uit;function NI(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(NI.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});NI.prototype.getFromCache=function(e,t,n,i){let o=Fpe(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};NI.prototype.checkApproachingInterval=function(e,t,n,i){let o=Fpe(e,t,n),r=this._tilesRequestedForInterval,s=Bpe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!kpe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};NI.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Bpe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=kpe(this,c,r),a||s.push(c)}}};function Fpe(e,t,n){return`${e}-${t}-${n}`}function Eit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Bpe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function kpe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Eit(s),c=new Qo({throttle:!1,throttleByServer:!0,type:os.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var lE=NI;var Sit=[3034,3035,3042,3043,3044],vit=[4471,4559];function Ud(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Ud.DefaultParameters,!0),n.setQueryParameters(Ud.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Upe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Upe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new lE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Vpe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!vit.includes(a)||Sit.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new ta({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Yi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Ud.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function Vpe(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function wit(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Ud.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return Q("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return Q("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});Ud.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Ud.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Vpe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Ud.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return wit(this,e,t,n,i,o,s)};Ud.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Ud.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Ud.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new cE("json","application/json")),Object.freeze(new cE("xml","text/xml")),Object.freeze(new cE("text","text/html"))]);function Upe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var FI=Ud;var Iit=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function BI(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=ve.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Iit),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new kr({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new lE({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,h,x){return zpe(s,d,p,g,h,x)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new _e;let f=e.credit;this._credit=typeof f=="string"?new wt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function zpe(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=_t(g,u)),l(f)&&(g=_t(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:o}),d.setTemplateValues(p)}return yl.loadImage(e,d)}Object.defineProperties(BI.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return Q("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});BI.prototype.getTileCredits=function(e,t,n){};BI.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=zpe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};BI.prototype.pickFeatures=function(e,t,n,i,o){};var kI=BI;function Wp(e){return function(t){return new e(t)}}var Dit={ARCGIS_MAPSERVER:Wp(Hp),BING:Wp(PI),GOOGLE_EARTH:Wp(RI),MAPBOX:Wp(MI),SINGLE_TILE:Wp(LI),TMS:Wp(Gp),URL_TEMPLATE:Wp(ta),WMS:Wp(FI),WMTS:Wp(kI)},Pit={ARCGIS_MAPSERVER:Hp.fromUrl,BING:async(e,t)=>PI.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,RI.fromUrl(e,n,t)},MAPBOX:(e,t)=>new MI({url:e,...t}),SINGLE_TILE:LI.fromUrl,TMS:Gp.fromUrl,URL_TEMPLATE:(e,t)=>new ta({url:e,...t}),WMS:(e,t)=>new FI({url:e,...t}),WMTS:(e,t)=>new kI({url:e,...t})};function bl(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new _e;let t=e.assetId;l(t)&&(Q("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),bl._initialize(this,t,e))}Object.defineProperties(bl.prototype,{ready:{get:function(){return Q("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return Q("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});bl._initialize=function(e,t,n){let i=ma._createEndpointResource(t,n),o=t.toString()+n.accessToken+n.server,r=bl._endpointCache[o];l(r)||(r=i.fetchJson(),bl._endpointCache[o]=r),e._readyPromise=r.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new de(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new Gp({url:new ma(s,i)});else{let u=Dit[c];if(!l(u))return Promise.reject(new de(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return e._tileCredits=ma.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=e,e._errorEvent.raiseEvent(u)}),e._imageryProvider=a,Promise.resolve(a._readyPromise).then(function(){return e._ready=!0,!0})})};bl.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ma._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=bl._endpointCache[i];l(o)||(o=n.fetchJson(),bl._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Gp.fromUrl(new ma(r,n));else{let u=Pit[a];if(!l(u))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new bl(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=ma.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c._ready=!0,c._readyPromise=Promise.resolve(!0),c};bl.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};bl.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};bl.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};bl._endpointCache={};var Vd=bl;var Oit={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},uh=Object.freeze(Oit);function Rit(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,uh.AERIAL);return Vd.fromAssetId(t)}var Ay=Rit;function uE(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let s=t/2|0,a=n/2|0,c=i-1;this.parent=e.getImageryFromCache(s,a,c)}this.state=di.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0;let r=e.imageryProvider;!l(o)&&e.ready&&(l(r._ready)?r._ready:!l(r.ready)||r.ready)&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}uE.createPlaceholder=function(e){let t=new uE(e,0,0,0);return t.addReference(),t.state=di.PLACEHOLDER,t};uE.prototype.addReference=function(){++this.referenceCount};uE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};uE.prototype.processStateMachine=function(e,t,n){this.state===di.UNLOADED&&!n&&(this.state=di.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===di.RECEIVED&&(this.state=di.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===di.READY&&t&&!this.texture;(this.state===di.TEXTURE_LOADED||i)&&(this.state=di.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var UI=uE;function yq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}yq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};yq.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===di.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==di.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==di.FAILED&&r.state!==di.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===di.FAILED||i.state===di.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var VI=yq;function mi(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,mi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,mi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,mi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,mi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,mi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,mi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,mi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,mi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new VI(UI.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,mi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(mi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});mi.DEFAULT_BRIGHTNESS=1;mi.DEFAULT_CONTRAST=1;mi.DEFAULT_HUE=0;mi.DEFAULT_SATURATION=1;mi.DEFAULT_GAMMA=1;mi.DEFAULT_SPLIT=ol.NONE;mi.DEFAULT_MINIFICATION_FILTER=un.LINEAR;mi.DEFAULT_MAGNIFICATION_FILTER=Si.LINEAR;mi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;mi.fromProviderAsync=function(e,t){let n=new mi(void 0,t);return Bit(n,Promise.resolve(e)),n};mi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),mi.fromProviderAsync(Ay({style:e.style}),e)};mi.prototype.isBaseLayer=function(){return this._isBaseLayer};mi.prototype.isDestroyed=function(){return!1};mi.prototype.destroy=function(){return ue(this)};var Wpe=new ce,Hpe=new ce,xq=new ce,jpe=new ce;mi.prototype.getViewableRectangle=async function(){Q("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let e=this._imageryProvider,t=this._rectangle;return l(e._readyPromise)?await e._readyPromise:l(e.readyPromise)&&await e.readyPromise,ce.intersection(e.rectangle,t)};mi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};mi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready||(l(o._ready)?!o._ready:l(o.ready)&&!o.ready))return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Oi&&e.rectangle.north<Oi.MaximumLatitude&&e.rectangle.south>-Oi.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,Wpe),a=ce.intersection(e.rectangle,s,Hpe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=Hpe,D.south>=w.north?a.north=a.south=w.north:D.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(D.south,w.south),a.north=Math.min(D.north,w.north)),D.west>=w.east?a.west=a.east=w.east:D.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(D.west,w.west),a.east=Math.min(D.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Nit(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let w=o.minimumLevel;d<w&&(d=w)}let g=o.tilingScheme,h=g.positionToTileXY(ce.northwest(a),d),x=g.positionToTileXY(ce.southeast(a),d),b=e.rectangle.width/512,C=e.rectangle.height/512,T=g.tileXYToRectangle(h.x,h.y,d);Math.abs(T.south-e.rectangle.north)<C&&h.y<x.y&&++h.y,Math.abs(T.east-e.rectangle.west)<b&&h.x<x.x&&++h.x;let A=g.tileXYToRectangle(x.x,x.y,d);Math.abs(A.north-e.rectangle.south)<C&&x.y>h.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>h.x&&--x.x;let S=ce.clone(e.rectangle,jpe),v=g.tileXYToRectangle(h.x,h.y,d),I=ce.intersection(v,s,xq),O;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),O=g.tileXYToNativeRectangle.bind(g),b=S.width/512,C=S.height/512):O=g.tileXYToRectangle.bind(g);let R,N=0,F=1,_;!this.isBaseLayer()&&Math.abs(I.west-S.west)>=b&&(N=Math.min(1,(I.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(I.north-S.north)>=C&&(F=Math.max(0,(I.north-S.south)/S.height));let E=F;for(let w=h.x;w<=x.x;w++)if(R=N,v=O(w,h.y,d),I=ce.simpleIntersection(v,s,xq),!!l(I)){N=Math.min(1,(I.east-S.west)/S.width),w===x.x&&(this.isBaseLayer()||Math.abs(I.east-S.east)<b)&&(N=1),F=E;for(let D=h.y;D<=x.y;D++){if(_=F,v=O(w,D,d),I=ce.simpleIntersection(v,s,xq),!l(I))continue;F=Math.max(0,(I.south-S.south)/S.height),D===x.y&&(this.isBaseLayer()||Math.abs(I.south-S.south)<C)&&(F=0);let M=new re(R,F,N,_),B=this.getImageryFromCache(w,D,d);i.imagery.splice(n,0,new VI(B,M,r)),++n}}return!0};mi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Wpe),i=c.rectangleToNativeRectangle(i,jpe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new re(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};mi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=di.RECEIVED,e.request=void 0,Ai.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(s){if(e.request.state===ni.CANCELLED){e.state=di.UNLOADED,e.request=void 0;return}e.state=di.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Ai.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let s=new Qo({throttle:!1,throttleByServer:!0,type:os.IMAGERY});e.request=s,e.state=di.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=di.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){o(c)}):i(a)}r()};mi.prototype._createTextureWebGL=function(e,t){let n=new hn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Lt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Lt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?lt.RGBA:lt.RGB,sampler:n})};mi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=di.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=di.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Oi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=di.TEXTURE_LOADED};function Gpe(e,t,n){return`${e}:${t}:${n}`}mi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===un.LINEAR&&i===Si.LINEAR&&!lt.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=un.LINEAR_MIPMAP_LINEAR;let r=Gt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=Gpe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Oh.NICEST),t.sampler=u}else{let r=Gpe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};mi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Di)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Hf({persists:!0,owner:this,preExecute:function(c){Lit(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=di.READY,t.releaseReference()},canceled:function(){t.state=di.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=di.READY};mi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};mi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};mi.prototype.getImageryFromCache=function(e,t,n,i){let o=qpe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new UI(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};mi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=qpe(e.x,e.y,e.level);delete this._imageryCache[t]};function qpe(e,t,n){return JSON.stringify([e,t,n])}var qU={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},Mit=Wt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Lit(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let O=I/63;b[C++]=0,b[C++]=O,b[C++]=1,b[C++]=O}let T={position:0,webMercatorT:1},A=Jr.getRegularGridIndices(2,64),S=ht.createIndexBuffer({context:t,typedArray:A,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new ai({context:t,attributes:[{index:T.position,vertexBuffer:ht.createVertexBuffer({context:t,typedArray:b,usage:ke.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:ht.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:ke.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new We({sources:[vU]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:SU,attributeLocations:T}),o.sampler=new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Si.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;qU.textureDimensions.x=r,qU.textureDimensions.y=s,qU.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Lt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&d.generateMipmap(Oh.NICEST);let p=i.south,g=i.north,h=Mit,x=0;for(let b=0;b<64;++b){let C=b/63,T=P.lerp(p,g,C);a=Math.sin(T);let S=(.5*Math.log((1+a)/(1-a))-c)*f;h[x++]=S,h[x++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=qU,e.vertexArray=o.vertexArray}function Nit(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Di?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Fit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Bit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Fit(e._errorEvent,i)}}var na=mi;var Ype={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Ype.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Qn=Ype;function dE(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new re}dE.prototype.update=function(e,t,n){this.changedThisFrame&&(e_e(e,t,this.tile,n),this.changedThisFrame=!1)};dE.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};dE.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):kd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var kit=new H0;dE.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=kit;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);ms(e,n,c,u,s,yn.EAST,!1,a,i),ms(e,n,c,f,s,yn.NORTH,!1,a,i),ms(e,n,c,d,s,yn.WEST,!1,a,i),ms(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),h=u.findTileToSouth(r),x=d.findTileToNorth(r),b=d.findTileToSouth(r);ms(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),ms(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),ms(e,n,c,h,s,yn.NORTHEAST,!1,a,i),ms(e,n,c,b,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function ms(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Qn.wasKicked(u._lastSelectionResult)||Qn.originalResult(u._lastSelectionResult)===Qn.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Qn.RENDERED){if(l(u.data.vertexArray))return;Uit(e,t,n,u,r,o,a,c);return}if(Qn.originalResult(i._lastSelectionResult)!==Qn.CULLED)switch(r){case yn.WEST:ms(e,t,n,i.northwestChild,o,r,!0,a,c),ms(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:ms(e,t,n,i.southeastChild,o,r,!0,a,c),ms(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:ms(e,t,n,i.southwestChild,o,r,!0,a,c),ms(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:ms(e,t,n,i.northeastChild,o,r,!0,a,c),ms(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:ms(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:ms(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:ms(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:ms(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new fe("Invalid edge")}}}function Uit(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new dE(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Vit(e,t,n,i,o,a)}function Vit(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(e_e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,h,x=n.rectangle,b,C=i.rectangle;switch(o){case yn.WEST:for(b=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(x.north,h.south,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(x.south,h.north,b));++p);break;case yn.SOUTH:for(b=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(x.west,h.east,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(x.east,h.west,b));++p);break;case yn.EAST:for(b=(C.north-C.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.lessThan(x.south,h.north,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.lessThanOrEquals(x.north,h.south,b));++p);break;case yn.NORTH:for(b=(C.east-C.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],h=g.rectangle,!P.greaterThan(x.east,h.west,b));++d);for(p=d;p<f.length&&(g=f[p],h=g.rectangle,!P.greaterThanOrEquals(x.west,h.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var kx=new me,zit=new me,fE=new m,Aq=new m,bq=new H,Cq=new H,gu=new H;function QU(){this.height=0,this.encodedNormal=new H}function YU(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return t_e(e,t,n,i,u,c),c}var Hit={minimumHeight:0,maximumHeight:0},Git=new m,Xpe=new QU,Kpe=new QU,Jpe=new QU,Zpe=new QU,Wit=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,jit={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function e_e(e,t,n,i){kd.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=KU(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Jpe),p=KU(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,Xpe),g=KU(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,Kpe),h=KU(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Zpe);d=YU(r,f,0,1,d,p,h,g,Jpe),p=YU(r,f,0,0,p,d,g,h,Xpe),g=YU(r,f,1,1,g,p,h,d,Kpe),h=YU(r,f,1,1,h,g,d,p,Zpe);let x=p.height,b=g.height,C=d.height,T=h.height,A=Math.min(x,b,C,T),S=Math.max(x,b,C,T),v=(A+S)*.5,I,O,R=e.getLevelMaximumGeometricError(n.level),N=f.maximumRadius-R,F=Math.acos(N/f.maximumRadius)*4;if(F*=1.5,s.width>F&&S-A<=R){let w=new Za({width:9,height:9,buffer:Wit,structure:{heightOffset:S}}),D=jit;D.tilingScheme=n.tilingScheme,D.x=n.x,D.y=n.y,D.level=n.level,D.exaggeration=a,D.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(D)}else{let w=u,D=ce.center(s,zit);D.height=v;let M=f.cartographicToCartesian(D,Git),B=new Pc(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,U;for(U=r.westMeshes,I=0,O=U.length;I<O;++I)V+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,O=U.length;I<O;++I)V+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,O=U.length;I<O;++I)V+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,O=U.length;I<O;++I)V+=U[I].southIndicesEastToWest.length;let G=Hit;G.minimumHeight=A,G.maximumHeight=S;let k=B.stride,Y=new Float32Array(V*k),j=0,$=j;j=XU(f,s,B,Y,j,0,1,d.height,d.encodedNormal,1,G),j=ZU(r,f,B,Y,j,r.westTiles,r.westMeshes,yn.EAST,G);let W=j;j=XU(f,s,B,Y,j,0,0,p.height,p.encodedNormal,0,G),j=ZU(r,f,B,Y,j,r.southTiles,r.southMeshes,yn.NORTH,G);let K=j;j=XU(f,s,B,Y,j,1,0,g.height,g.encodedNormal,0,G),j=ZU(r,f,B,Y,j,r.eastTiles,r.eastMeshes,yn.WEST,G);let J=j;j=XU(f,s,B,Y,j,1,1,h.height,h.encodedNormal,1,G),j=ZU(r,f,B,Y,j,r.northTiles,r.northMeshes,yn.SOUTH,G),A=G.minimumHeight,S=G.maximumHeight;let he=Nn.fromRectangle(s,A,S,n.tilingScheme.ellipsoid),ge=Oi.geodeticLatitudeToMercatorAngle(s.south),se=1/(Oi.geodeticLatitudeToMercatorAngle(s.north)-ge),pe=(Oi.geodeticLatitudeToMercatorAngle(D.latitude)-ge)*se,xe=f.geodeticSurfaceNormalCartographic(kx,Aq),De=Yn.octEncode(xe,bq),Se=j;B.encode(Y,j*k,he.center,H.fromElements(.5,.5,gu),v,De,pe,xe),++j;let we=j,ze=we<256?1:2,Oe=(we-1)*3,ft=Oe*ze,Ct=(Y.length-we*k)*Float32Array.BYTES_PER_ELEMENT,ot;if(Ct>=ft){let Ee=we*k*Float32Array.BYTES_PER_ELEMENT;ot=we<256?new Uint8Array(Y.buffer,Ee,Oe):new Uint16Array(Y.buffer,Ee,Oe)}else ot=we<256?new Uint8Array(Oe):new Uint16Array(Oe);Y=new Float32Array(Y.buffer,0,we*k);let sn=0;for(I=0;I<we-2;++I)ot[sn++]=Se,ot[sn++]=I,ot[sn++]=I+1;ot[sn++]=Se,ot[sn++]=I,ot[sn++]=0;let wn=[];for(I=W;I>=$;--I)wn.push(I);let zt=[];for(I=K;I>=W;--I)zt.push(I);let Bt=[];for(I=J;I>=K;--I)Bt.push(I);let be=[];for(be.push(0),I=Se-1;I>=J;--I)be.push(I);r.mesh=new Md(B.center,Y,ot,Oe,we,A,S,ae.fromOrientedBoundingBox(he),$it(e,he.center,s,A,S),B.stride,he,B,wn,zt,Bt,be)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=kd._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function XU(e,t,n,i,o,r,s,a,c,u,f){let d=kx;d.longitude=P.lerp(t.west,t.east,r),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,fE),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,Aq));let h=Cq;return h.x=r,h.y=s,n.encode(i,o*n.stride,p,h,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var $U=new ce;function zI(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,$U),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,$U),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var qit=new H;function Tq(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Yit=new H,Xit=new m;function Kit(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=zI(t,n,f.decodeTextureCoordinates(d,o,gu),gu),g=zI(t,n,f.decodeTextureCoordinates(d,r,Cq),Cq),h;c?h=(s-p.x)/(g.x-p.x):h=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,o),b=f.decodeHeight(d,r),C=n.rectangle;kx.longitude=P.lerp(C.west,C.east,s),kx.latitude=P.lerp(C.south,C.north,a),u.height=kx.height=P.lerp(x,b,h);let T;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(d,o,qit),S=f.getOctEncodedNormal(d,r,Yit),v=Yn.octDecode(A.x,A.y,fE),I=Yn.octDecode(S.x,S.y,Xit);T=m.lerp(v,I,h,fE),m.normalize(T,T),Yn.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(kx,fE),Yn.octEncode(T,u.encodedNormal)}function t_e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(kx,fE);Yn.octEncode(s,r.encodedNormal)}function KU(e,t,n,i,o,r,s,a,c,u,f){if(Qpe(e,t,a,s,!1,n,i,f)||Qpe(e,t,u,c,!0,n,i,f))return f;let p;if(Eq(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],Tq(r,p,n,i,f),f;let g;if(n===0?i===0?g=JU(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=JU(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=JU(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=JU(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return t_e(e,t,n,i,g,f),f}function JU(e,t,n,i,o,r,s,a){let c=$pe(e,t,!1,n,s,a),u=$pe(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function ZU(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Jit(e,t,n,i,o,r[u],s[u],a,c);return o}function Jit(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,$U),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,$U),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,gu),d=gu.x,p=gu.y);let g,h;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,h=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,h=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,h=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,h=!0;break}let x=r,b=e.tile,C=s.encoding,T=s.vertices,A=n.stride,S,v;C.hasWebMercatorT&&(S=Oi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Oi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let I=0;I<g.length;++I){let O=g[I],R=C.decodeTextureCoordinates(T,O,gu);zI(x,b,R,R);let N=R.x,F=R.y,_=h?N:F;if(_<0||_>1||Math.abs(N-d)<P.EPSILON5&&Math.abs(F-p)<P.EPSILON5)continue;let E=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5,w=Math.abs(F)<P.EPSILON5||Math.abs(F-1)<P.EPSILON5;if(E&&w)continue;let D=C.decodePosition(T,O,fE),M=C.decodeHeight(T,O),B;C.hasVertexNormals?B=C.getOctEncodedNormal(T,O,bq):(B=bq,B.x=0,B.y=0);let V=F;if(C.hasWebMercatorT){let G=P.lerp(f.south,f.north,F);V=(Oi.geodeticLatitudeToMercatorAngle(G)-S)*v}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(D,Aq)),n.encode(i,o*A,D,R,M,B,V,U),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++o}return o}function $pe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!Eq(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function Eq(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Qpe(e,t,n,i,o,r,s,a){let c,u,f,d,p,g=i[o?0:n.length-1],h=n[o?0:n.length-1];if(Eq(g,h)&&(r===0?s===0?(c=o?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=o,f=o):(c=o?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!o,f=!0):(c=o?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],h.encoding.decodeTextureCoordinates(h.vertices,p,gu);let x=zI(g,e.tile,gu,gu);if(x.x===r&&x.y===s)return Tq(h,p,r,s,a),!0;if(d=Oo(c,u?r:s,function(b,C){h.encoding.decodeTextureCoordinates(h.vertices,b,gu);let T=zI(g,e.tile,gu,gu);return f?u?T.x-r:T.y-s:u?r-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return Kit(t,g,e.tile,h,c[d-1],c[d],r,s,u,a),!0}else return Tq(h,c[d],r,s,a),!0}return!1}var Zit=[new m,new m,new m,new m];function $it(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Zit;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var HI=dE;function Jo(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Cn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Jo.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Jo.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Jo.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Jo.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(Jo.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=re.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){let e=this._terrainProvider;if(!l(e)||(l(e._ready)?!e._ready:l(e.ready)&&!e.ready))return!1;if(this._imageryLayers.length===0)return!0;let t=this._imageryLayers.get(0);if(!t.ready)return!1;let n=t.imageryProvider;return l(n._ready)?n._ready:!l(n.ready)||n.ready}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}}});function Qit(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Jo.prototype.update=function(e){this._imageryLayers._update()};function eot(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);if(a.ready){let c=a.imageryProvider;(l(c._ready)?c._ready:!l(c.ready)||c.ready)&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}}Jo.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Qit)})),eot(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)kd._freeVertexArray(t[i]);t.length=0};Jo.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,o=t.length;i<o;++i){let r=t[i];l(r)&&(r.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Jo.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},blending:mn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&HI.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,o=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;s_e(this,d,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let h=0;h<g.rectangles.length;h++)if(ce.intersection(p.rectangle,g.rectangles[h])){s_e(this,d,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function a_e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Jo.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)a_e(t[n],e)};Jo.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Jo.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Jo.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Qn.CULLED_BUT_NEEDED,o=n.terrainState),kd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==gr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,kd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var tot=new ae,c_e=new ce,not=new ce,iot=new me;function tV(e,t){if(t.west<t.east)return t;let n=ce.clone(t,not);return ce.center(e,iot).longitude>0?n.east=P.PI:n.west=-P.PI,n}function l_e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}Jo.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=l_e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return gr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return gr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=tV(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,c_e);if(!l(f))return gr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=tot,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return gr.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let x=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==tn.INSIDE,x===tn.OUTSIDE)return gr.NONE}let p,g=a.computeVisibility(c);if(g===tn.OUTSIDE?p=gr.NONE:g===tn.INTERSECTING?p=gr.PARTIAL:g===tn.INSIDE&&(p=gr.FULL),p===gr.NONE)return p;let h=t.mode===ne.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===ne.SCENE3D&&!h&&l(n)&&!o){let x=r.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:gr.NONE}return p};Jo.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var oot=[],rot=[];Jo.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=oot;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===bo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===di.FAILED||p.state===di.INVALID,h=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[h]=g&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,f=rot;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Qn.NONE;if(p===Qn.RENDERED){let g=d.data;if(!l(g))continue;if(!o&&d.data.terrainState===bo.READY)return!1;let h=d.data.imagery;for(a=0,c=h.length;a<c;++a){let x=h[a],b=x.loadingImagery,C=!l(b)||b.state===di.FAILED||b.state===di.INVALID,T=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[T])return!1}}else p===Qn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var sot=new m;Jo.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,sot),a=m.magnitude(s);return a<P.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var n_e=new L,eV=new L,aot=new re,cot=new re,lot=new re,uot=new m,i_e=new m,fot=new m,dot=new m;Jo.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var mot=[new m,new m,new m,new m];function o_e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=mot;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Jo.prototype.computeDistanceToTile=function(e,t){hot(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function hot(e,t,n){let i=e.data;i===void 0&&(i=e.data=new kd);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new sd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=0,d=t.marsOptions?.flat;if(d&&d.enabled&&d.rectangles){for(let b=0;b<d.rectangles.length;b++)if(ce.intersection(e.rectangle,d.rectangles[b])){f=d.heights[b];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let b=0;b<p.rectangles.length;b++)if(ce.intersection(r.rectangle,p.rectangles[b])){g=p.height;break}}let h=i.mesh,x=i.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0)r.minimumHeight=h.minimumHeight,r.maximumHeight=h.maximumHeight,c=!0;else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0)r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let b=e.parent;for(;b!==void 0;){let C=b.data;if(C!==void 0){let T=C.mesh,A=C.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0){r.minimumHeight=T.minimumHeight,r.maximumHeight=T.maximumHeight;break}else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0){r.minimumHeight=A._minimumHeight,r.maximumHeight=A._maximumHeight;break}}b=b.parent}u=b}if(r.maximumHeight+=g,r.maximumHeight<f&&(r.maximumHeight=f),r.minimumHeight>f&&(r.minimumHeight=f),u!==void 0){let b=n.terrainExaggeration,C=n.terrainExaggerationRelativeHeight;if((b!==1||f!==0)&&(c=!1,r.minimumHeight=jc.getHeight(r.minimumHeight,b,C),r.maximumHeight=jc.getHeight(r.maximumHeight,b,C)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Nn.clone(h.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(h.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=o_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let A=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||A)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=o_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Jo.prototype.isDestroyed=function(){return!1};Jo.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function pot(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}Jo.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=pot(d,e,n),s.state=ea.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ea.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Qn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Jo.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var _ot=new L,got=new L;function r_e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=L.multiplyByPoint(i,this.properties.rtc,i_e);return L.setTranslation(i,o,n_e),n_e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=L.multiplyByPoint(i,this.properties.rtc,i_e);return L.setTranslation(i,r,eV),L.multiply(o,eV,eV),eV},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?L.multiply(e.context.uniformState.view,i.modelMatrix,_ot):L.IDENTITY;return L.inverseTranspose(o,got)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_AreaWidth:function(){return this.properties.mars_flat_AreaWidth},u_mars_flat_AreaHeight:function(){return this.properties.mars_flat_AreaHeight},u_mars_flat_AreaTexture:function(){return l(this.properties.mars_flat_AreaTexture)?this.properties.mars_flat_AreaTexture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_RectangleWidth:function(){return this.properties.mars_uplift_RectangleWidth},u_mars_uplift_RectangleHeight:function(){return this.properties.mars_uplift_RectangleHeight},u_mars_uplift_RampRectangle:function(){return l(this.properties.mars_uplift_RampRectangle)?this.properties.mars_uplift_RampRectangle:e.context.defaultTexture},properties:{initialColor:new re(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,mars_flat_enabled:!1,mars_flat_AreaWidth:0,mars_flat_AreaHeight:0,inverseTileWidth:0,mars_flat_AreaTexture:void 0,cartographicTileRectangle:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_RectangleWidth:0,mars_uplift_RectangleHeight:0,mars_uplift_RampRectangle:void 0,center3D:void 0,rtc:new m,modifiedModelView:new L,tileRectangle:new re,terrainExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new re,minMaxHeight:new H,scaleAndBias:new L,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new re,frontFaceAlphaByDistance:new re,backFaceAlphaByDistance:new re,localizedTranslucencyRectangle:new re,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new re,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=_t(n,i)}return l(t.materialUniformMap)?_t(n,t.materialUniformMap):n}function yot(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=xot(e,r,o),i.wireframeVertexArray.mesh=o}}function xot(e,t,n){let o={indices:n.indices,primitiveType:Fe.TRIANGLES};Un.toWireframe(o);let r=o.indices,s=ht.createIndexBuffer({context:e,typedArray:r,usage:ke.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ai({context:e,attributes:t._attributes,indexBuffer:s})}var u_e,f_e,nV;(function(){let e=new Tt({geometry:tm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Tt({geometry:new yg({radius:1})}),n=new L,i,o;function r(s){return new Dn({geometryInstances:s,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}u_e=function(s,a){return s===i||(nV(),i=s,n=L.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ht.fromColor(a),o=r(e)),o},f_e=function(s,a){return s===i||(nV(),i=s,n=L.fromTranslation(s.center,n),n=L.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ht.fromColor(a),o=r(t)),o},nV=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var bot=new re(0,0,0,0),Cot={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Tot=z.TRANSPARENT,Aot=new Rt;function s_e(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new HI(t)),o.fill.update(e,n));let r=n.creditDisplay,s=o.terrainData;if(l(s)&&l(s.credits)){let at=s.credits;for(let Jt=0,ri=at.length;Jt<ri;++Jt)r.addCreditToNextFrame(at[Jt])}let a=Gt.maximumTextureImageUnits,c=o.waterMaskTexture,u=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,u=o.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,d=n.globeTranslucencyState,p=d.translucent,g=d.frontFaceAlphaByDistance,h=d.backFaceAlphaByDistance,x=d.rectangle,b=y(e.undergroundColor,Tot),C=y(e.undergroundColorAlphaByDistance,Aot),T=l_e(e,n)&&n.mode===ne.SCENE3D&&b.alpha>0&&(C.nearValue>0||C.farValue>0),A=e.lambertDiffuseMultiplier,S=e.vertexShadowDarkness,v=e.hasWaterMask&&l(c),I=e.oceanNormalMap,O=v&&l(I),R=e.terrainProvider,N=l(R)&&(l(R._ready)?R._ready:!l(R.ready)||R.ready)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!f,_=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=Cn.castShadows(e.shadows)&&!p,w=Cn.receiveShadows(e.shadows)&&!p,D=e.hueShift,M=e.saturationShift,B=e.brightnessShift,V=!(P.equalsEpsilon(D,0,P.EPSILON7)&&P.equalsEpsilon(M,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),U=!1;if(_){let at=m.magnitude(n.camera.positionWC),Jt=e.nightFadeOutDistance;U=at>Jt}v&&--a,O&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=d.numberOfTextureUniforms;let G=o.renderedMesh,k=G.center,Y=G.encoding,j=o.tileBoundingRegion,$=n.terrainExaggeration,W=n.terrainExaggerationRelativeHeight,K=e.marsOptions?.uplift;i&&K&&(W=n.terrainExaggerationRelativeHeight-K.height/($-1));let J=$!==1,he=Y.hasGeodeticSurfaceNormals,ge=aot,se=0,pe=0,xe=0,De=0,Se=!1;if(n.mode!==ne.SCENE3D){let at=n.mapProjection,Jt=at.project(ce.southwest(t.rectangle),fot),ri=at.project(ce.northeast(t.rectangle),dot);if(ge.x=Jt.x,ge.y=Jt.y,ge.z=ri.x,ge.w=ri.y,n.mode!==ne.MORPHING&&(k=uot,k.x=0,k.y=(ge.z+ge.x)*.5,k.z=(ge.w+ge.y)*.5,ge.x-=k.y,ge.y-=k.z,ge.z-=k.y,ge.w-=k.z),n.mode===ne.SCENE2D&&Y.quantization===Qs.BITS12){let Ze=1/(Math.pow(2,12)-1)*.5,zr=(ge.z-ge.x)*Ze,Hr=(ge.w-ge.y)*Ze;ge.x-=zr,ge.y-=Hr,ge.z+=zr,ge.w+=Hr}at instanceof Oi&&(se=t.rectangle.south,pe=t.rectangle.north,xe=Oi.geodeticLatitudeToMercatorAngle(se),De=1/(Oi.geodeticLatitudeToMercatorAngle(pe)-xe),Se=!0)}let we=Cot;we.frameState=n,we.surfaceTile=o,we.showReflectiveOcean=v,we.showOceanWaves=O,we.enableLighting=e.enableLighting,we.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,we.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,we.showGroundAtmosphere=_,we.atmosphereLightIntensity=e.atmosphereLightIntensity,we.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,we.atmosphereMieCoefficient=e.atmosphereMieCoefficient,we.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,we.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,we.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,we.perFragmentGroundAtmosphere=U,we.hasVertexNormals=N,we.useWebMercatorProjection=Se,we.clippedByBoundaries=o.clippedByBoundaries,we.hasGeodeticSurfaceNormals=he,we.hasExaggeration=J;let ze=o.imagery,Oe=0,ft=ze.length,Ct=e.showSkirts&&!f&&!p,ot=e.backFaceCulling&&!f&&!p,sn=ot?e._renderState:e._disableCullingRenderState,wn=ot?e._blendRenderState:e._disableCullingBlendRenderState,zt=sn,Bt=e._firstPassInitialColor,be=n.context;if(l(e._debug.boundingSphereTile)||nV(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let at=e._drawCommands.length;for(let Jt=0;Jt<at;++Jt)e._uniformMaps[Jt]=r_e(n,e)}do{let at=0,Jt,ri;if(e._drawCommands.length<=e._usedDrawCommands?(Jt=new nt,Jt.owner=t,Jt.cull=!1,Jt.boundingVolume=new ae,Jt.orientedBoundingBox=void 0,ri=r_e(n,e),e._drawCommands.push(Jt),e._uniformMaps.push(ri)):(Jt=e._drawCommands[e._usedDrawCommands],ri=e._uniformMaps[e._usedDrawCommands]),Jt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let cr=j.boundingVolume,Po=j.boundingSphere;l(cr)?u_e(cr,z.RED).update(n):l(Po)&&f_e(Po,z.RED).update(n)}let Ze=ri.properties;re.clone(Bt,Ze.initialColor),Ze.oceanNormalMap=I,Ze.lightingFadeDistance.x=e.lightingFadeOutDistance,Ze.lightingFadeDistance.y=e.lightingFadeInDistance,Ze.nightFadeDistance.x=e.nightFadeOutDistance,Ze.nightFadeDistance.y=e.nightFadeInDistance,Ze.atmosphereLightIntensity=e.atmosphereLightIntensity,Ze.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ze.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ze.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ze.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ze.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ze.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let zr=f?h:g,Hr=f?g:h;l(zr)&&(re.fromElements(zr.near,zr.nearValue,zr.far,zr.farValue,Ze.frontFaceAlphaByDistance),re.fromElements(Hr.near,Hr.nearValue,Hr.far,Hr.farValue,Ze.backFaceAlphaByDistance)),re.fromElements(C.near,C.nearValue,C.far,C.farValue,Ze.undergroundColorAlphaByDistance),z.clone(b,Ze.undergroundColor),Ze.lambertDiffuseMultiplier=A,Ze.vertexShadowDarkness=S;let sa=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;sa&&z.clone(e.fillHighlightColor,Ze.fillHighlightColor),Ze.terrainExaggerationAndRelativeHeight.x=$,Ze.terrainExaggerationAndRelativeHeight.y=W,Ze.center3D=G.center,m.clone(k,Ze.rtc),re.clone(ge,Ze.tileRectangle),Ze.southAndNorthLatitude.x=se,Ze.southAndNorthLatitude.y=pe,Ze.southMercatorYAndOneOverHeight.x=xe,Ze.southMercatorYAndOneOverHeight.y=De;let $r=cot,Ne=tV(t.rectangle,e.cartographicLimitRectangle),rt=lot,$e=tV(t.rectangle,x);m.fromElements(D,M,B,Ze.hsbShift);let He=t.rectangle,mt=1/He.width,Ut=1/He.height;$r.x=(Ne.west-He.west)*mt,$r.y=(Ne.south-He.south)*Ut,$r.z=(Ne.east-He.west)*mt,$r.w=(Ne.north-He.south)*Ut,re.clone($r,Ze.localizedCartographicLimitRectangle),rt.x=($e.west-He.west)*mt,rt.y=($e.south-He.south)*Ut,rt.z=($e.east-He.west)*mt,rt.w=($e.north-He.south)*Ut;let xn=e.marsOptions?.flat;if(xn){let cr=xn.areas,Po=0;cr?(cr.forEach(ca=>{Po<ca.length&&(Po=ca.length)}),Ze.mars_flat_AreaWidth=cr.length):Ze.mars_flat_AreaWidth=0,Ze.mars_flat_AreaHeight=Po,Ze.mars_flat_AreaTexture=xn.texture,Ze.mars_flat_enabled=xn.enabled}else Ze.mars_flat_enabled=!1,Ze.mars_flat_AreaWidth=0,Ze.mars_flat_AreaHeight=0,Ze.mars_flat_AreaTexture=void 0;Ze.inverseTileWidth=mt,Ze.cartographicTileRectangle=new H(He.west,He.south);let Zn=e.marsOptions?.uplift;if(Zn){let cr=Zn.areas,Po=0;cr?(cr.forEach(ca=>{Po<ca.length&&(Po=ca.length)}),Ze.mars_uplift_RectangleWidth=cr.length):Ze.mars_uplift_RectangleWidth=0,Ze.mars_uplift_RectangleHeight=Po,Ze.mars_uplift_RampRectangle=Zn.texture,Ze.mars_uplift_enabled=(!Zn.showUp||Zn.enabled&&e._topographicUpliftHeight!==0)&&l(Zn.rectangles)&&Zn.rectangles.length>0,Ze.mars_uplift_hideInsideOrOutside=!i}else Ze.mars_uplift_enabled=!1,Ze.mars_uplift_hideInsideOrOutside=!1,Ze.mars_uplift_RectangleWidth=0,Ze.mars_uplift_RectangleHeight=0,Ze.mars_uplift_RampRectangle=void 0;re.clone(rt,Ze.localizedTranslucencyRectangle);let To=F&&P.fog(t._distance,n.fog.density)>P.EPSILON3;V=V&&(To||_);let Qr=!1,es=!1,ar=!1,zi=!1,ts=!1,Wn=!1,Fn=!1,fn=!1,pi=!1,Hi=!1,ns=!1,ao=!1;for(;at<a&&Oe<ft;){let cr=ze[Oe],Po=cr.readyImagery;if(++Oe,!l(Po)||Po.imageryLayer.alpha===0)continue;let ca=cr.useWebMercatorT?Po.textureWebMercator:Po.texture,Gi=Po.imageryLayer;l(cr.textureTranslationAndScale)||(cr.textureTranslationAndScale=Gi._calculateTextureTranslationAndScale(t,cr)),Ze.dayTextures[at]=ca,Ze.dayTextureTranslationAndScale[at]=cr.textureTranslationAndScale,Ze.dayTextureTexCoordsRectangle[at]=cr.textureCoordinateRectangle,Ze.dayTextureUseWebMercatorT[at]=cr.useWebMercatorT,Ze.dayTextureAlpha[at]=Gi.alpha,Wn=Wn||Ze.dayTextureAlpha[at]!==1,Ze.dayTextureNightAlpha[at]=Gi.nightAlpha,Fn=Fn||Ze.dayTextureNightAlpha[at]!==1,Ze.dayTextureDayAlpha[at]=Gi.dayAlpha,Fn=Fn||Ze.dayTextureDayAlpha[at]!==1,Ze.dayTextureBrightness[at]=Gi.brightness,Qr=Qr||Ze.dayTextureBrightness[at]!==na.DEFAULT_BRIGHTNESS,Ze.dayTextureContrast[at]=Gi.contrast,es=es||Ze.dayTextureContrast[at]!==na.DEFAULT_CONTRAST,Ze.dayTextureHue[at]=Gi.hue,ar=ar||Ze.dayTextureHue[at]!==na.DEFAULT_HUE,Ze.dayTextureSaturation[at]=Gi.saturation,zi=zi||Ze.dayTextureSaturation[at]!==na.DEFAULT_SATURATION,Ze.dayTextureOneOverGamma[at]=1/Gi.gamma,ts=ts||Ze.dayTextureOneOverGamma[at]!==1/na.DEFAULT_GAMMA,Ze.dayTextureSplit[at]=Gi.splitDirection,fn=fn||Ze.dayTextureSplit[at]!==0,ns=ns||!!Gi.invertColor,Ze.mars3dTextureInvertColor[at]=!!Gi.invertColor,ao=ao||!!Gi.filterColor,Gi.filterColor?Ze.mars3dTextureFilterColor[at]=new m(Gi.filterColor.red,Gi.filterColor.green,Gi.filterColor.blue):Ze.mars3dTextureFilterColor[at]=new m(1,1,1);let lr=Ze.dayTextureCutoutRectangles[at];if(l(lr)||(lr=Ze.dayTextureCutoutRectangles[at]=new re),re.clone(re.ZERO,lr),l(Gi.cutoutRectangle)){let Rs=tV(He,Gi.cutoutRectangle),o_=ce.simpleIntersection(Rs,He,c_e);pi=l(o_)||pi,lr.x=(Rs.west-He.west)*mt,lr.y=(Rs.south-He.south)*Ut,lr.z=(Rs.east-He.west)*mt,lr.w=(Rs.north-He.south)*Ut}let Os=Ze.colorsToAlpha[at];l(Os)||(Os=Ze.colorsToAlpha[at]=new re);let bh=l(Gi.colorToAlpha)&&Gi.colorToAlphaThreshold>0;if(Hi=Hi||bh,bh){let Rs=Gi.colorToAlpha;Os.x=Rs.red,Os.y=Rs.green,Os.z=Rs.blue,Os.w=Gi.colorToAlphaThreshold}else Os.w=-1;if(l(Po.credits)){let Rs=Po.credits;for(let o_=0,Y1=Rs.length;o_<Y1;++o_)r.addCreditToNextFrame(Rs[o_])}++at}Ze.dayTextures.length=at,Ze.waterMask=c,re.clone(u,Ze.waterMaskTranslationAndScale),Ze.minMaxHeight.x=Y.minimumHeight,Ze.minMaxHeight.y=Y.maximumHeight,L.clone(Y.matrix,Ze.scaleAndBias);let aa=e._clippingPlanes,Of=l(aa)&&aa.enabled&&t.isClipped;Of&&(Ze.clippingPlanesEdgeColor=z.clone(aa.edgeColor,Ze.clippingPlanesEdgeColor),Ze.clippingPlanesEdgeWidth=aa.edgeWidth),we.numberOfDayTextures=at,we.applyBrightness=Qr,we.applyContrast=es,we.applyHue=ar,we.applySaturation=zi,we.applyGamma=ts,we.applyAlpha=Wn,we.applyDayNightAlpha=Fn,we.applySplit=fn,we.enableFog=To,we.enableClippingPlanes=Of,we.clippingPlanes=aa,we.hasImageryLayerCutout=pi,we.colorCorrect=V,we.highlightFillTile=sa,we.colorToAlpha=Hi,we.showUndergroundColor=T,we.translucent=p,we.marsOptions={invertColor:ns,filterColor:ao,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled,enableUplift:e._marsOptions&&e._marsOptions.uplift&&e._marsOptions.uplift.enabled,enableFlat:e._marsOptions&&e._marsOptions.flat&&e._marsOptions.flat.enabled};let Rf=o.renderedMesh.indices.length;Ct||(Rf=o.renderedMesh.indexCountWithoutSkirts),Jt.shaderProgram=e._surfaceShaderSet.getShaderProgram(we),Jt.castShadows=E,Jt.receiveShadows=w,Jt.renderState=zt,Jt.primitiveType=Fe.TRIANGLES,Jt.vertexArray=o.vertexArray||o.fill.vertexArray,Jt.count=Rf,Jt.uniformMap=ri,Jt.pass=Ae.GLOBE,e._debug.wireframe&&(yot(be,e,t),l(o.wireframeVertexArray)&&(Jt.vertexArray=o.wireframeVertexArray,Jt.primitiveType=Fe.LINES,Jt.count=Rf*2));let Uc=Jt.boundingVolume,i_=Jt.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,j.minimumHeight,j.maximumHeight,Uc),m.fromElements(Uc.center.z,Uc.center.x,Uc.center.y,Uc.center),n.mode===ne.MORPHING&&(Uc=ae.union(j.boundingSphere,Uc,Uc))):(Jt.boundingVolume=ae.clone(j.boundingSphere,Uc),Jt.orientedBoundingBox=Nn.clone(j.boundingVolume,i_)),Jt.dirty=!0,p&&d.updateDerivedCommands(Jt,n),a_e(Jt,n),zt=wn,Bt=bot}while(Oe<ft)}var iV=Jo;function d_e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(d_e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Rt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Rt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var oV=d_e;function hs(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(hs.prototype,{length:{get:function(){return this._layers.length}}});hs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};hs.prototype.addImageryProvider=function(e,t){let n=new na(e);return this.add(n,t),n};hs.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};hs.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};hs.prototype.contains=function(e){return this.indexOf(e)!==-1};hs.prototype.indexOf=function(e){return this._layers.indexOf(e)};hs.prototype.get=function(e){return this._layers[e]};function rV(e,t){return e.indexOf(t)}function m_e(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}hs.prototype.raise=function(e){let t=rV(this._layers,e);m_e(this,t,t+1)};hs.prototype.lower=function(e){let t=rV(this._layers,e);m_e(this,t,t-1)};hs.prototype.raiseToTop=function(e){let t=rV(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};hs.prototype.lowerToBottom=function(e){let t=rV(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Eot=new ce;function h_e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let d=Eot,p=1/1024;d.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(d,t)&&i(u)}}hs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[];if(h_e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};hs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(h_e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};hs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};hs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};hs.prototype.isDestroyed=function(){return!1};hs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};hs.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var sV=hs;function p_e(e){this._ellipsoid=new Ig(e.ellipsoid,m.ZERO)}Object.defineProperties(p_e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var aV=p_e;function Lc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Qn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Lc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Lc({tilingScheme:e,x:s,y:r,level:0});return i};Lc.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Lc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Lc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Lc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Lc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Lc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ea.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Lc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Lc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Lc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Lc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Lc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Lc.prototype.freeResources=function(){this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),cV(this._southwestChild),this._southwestChild=void 0,cV(this._southeastChild),this._southeastChild=void 0,cV(this._northwestChild),this._northwestChild=void 0,cV(this._northeastChild),this._northeastChild=void 0};function cV(e){l(e)&&e.freeResources()}var lV=Lc;function uV(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}uV.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};uV.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),__e(this,t)),t=i}};function __e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}uV.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&__e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var fV=uV;function xf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new fV,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new aV({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(xf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});xf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Sot(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,y_e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}xf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ea.START&&e(t),t=t.replacementNext};xf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};xf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};xf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function y_e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}xf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Sot(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),y_e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};xf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Dot(this,e),Uot(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function vot(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=_e.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}xf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Not(this,e),kot(this,e),vot(this,e))};xf.prototype.isDestroyed=function(){return!1};xf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var WI,g_e=new me;function wot(e,t){let n=ce.center(e.rectangle,g_e),i=n.longitude-WI.longitude,o=n.latitude-WI.latitude;n=ce.center(t.rectangle,g_e);let r=n.longitude-WI.longitude,s=n.latitude-WI.latitude;return i*i+o*o-(r*r+s*s)}var Iot=new m,GI=[];function Dot(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles))if(r.ready){let x=r.tilingScheme;e._levelZeroTiles=lV.createLevelZeroTiles(x);let b=e._levelZeroTiles.length;if(GI.length<b)for(GI=new Array(b),o=0;o<b;++o)GI[o]===void 0&&(GI[o]=new jI)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;WI=t.camera.positionCartographic,a.sort(wot);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let h=L.getTranslation(g.transform,Iot);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ea(e,s,r,t,c,!1,GI[o]):(jp(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function jp(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function jI(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function x_e(){this.southwest=new jI,this.southeast=new jI,this.northwest=new jI,this.northeast=new jI}x_e.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var wq=new Array(31);for(let e=0;e<wq.length;++e)wq[e]=new x_e;function Pot(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Mot(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Qn.NONE,g=e.tileProvider;if(s||i){let h=Qn.originalResult(p)===Qn.RENDERED,x=Qn.originalResult(p)===Qn.CULLED||p===Qn.NONE,b=n.state===ea.DONE,C=h||x||b;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&jp(e,e._tileLoadQueueMedium,n,t),dV(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&jp(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){dV(e,n),jp(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(Oot(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,O=!1;if(!S&&!v){let R=e._tilesToRender;for(let F=x;F<R.length;++F){let _=R[F];for(;_!==void 0&&_._lastSelectionResult!==Qn.KICKED&&_!==n;)_._lastSelectionResult=Qn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,dV(e,n),n._lastSelectionResult=Qn.RENDERED;let N=p===Qn.RENDERED;!N&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=T,jp(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=N,N||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&jp(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,dV(e,n),jp(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Oot(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=wq[t.level],p=d.southwest,g=d.southeast,h=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ea(e,t,u,r,f,s,p),Ea(e,n,u,r,f,s,g),Ea(e,i,u,r,f,s,h),Ea(e,o,u,r,f,s,x)):(Ea(e,i,u,r,f,s,h),Ea(e,t,u,r,f,s,p),Ea(e,o,u,r,f,s,x),Ea(e,n,u,r,f,s,g)):c.latitude<t.rectangle.north?(Ea(e,n,u,r,f,s,g),Ea(e,t,u,r,f,s,p),Ea(e,o,u,r,f,s,x),Ea(e,i,u,r,f,s,h)):(Ea(e,o,u,r,f,s,x),Ea(e,i,u,r,f,s,h),Ea(e,n,u,r,f,s,g),Ea(e,t,u,r,f,s,p)),d.combine(a)}function Rot(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ea(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==gr.NONE)return Pot(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Rot(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&jp(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Qn.NONE;c!==Qn.CULLED_BUT_NEEDED&&c!==Qn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Qn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(jp(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Qn.CULLED):t._lastSelectionResult=Qn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Mot(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof Or)return Lot(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Lot(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function dV(e,t){e._tilesToRender.push(t)}function Not(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=Sq(e,t,s,r,n,!1);a=Sq(e,t,s,r,i,a),Sq(e,t,s,r,o,a)}function Fot(e,t){return e._loadPriority-t._loadPriority}function Sq(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Fot);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var mE=new In,vq=new me,Ey=new m,Bot=[];function kot(e,t){if(!e.tileProvider.ready)return;let n=Bot;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Qn.NONE;(x===Qn.RENDERED||x===Qn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,h=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],b=d.data.terrainData,C=l(b)&&b.wasCreatedByUpsampling();if(d.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,mE.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,mE.origin);if(!l(S)){let v=0;l(d.data.tileBoundingRegion)&&(v=d.data.tileBoundingRegion.minimumHeight);let I=Math.min(v,-11500),O=m.multiplyByScalar(A,Math.abs(I)+1,Ey);m.subtract(x.positionOnEllipsoidSurface,O,mE.origin)}}else me.clone(x.positionCartographic,vq),vq.height=-11500,c.project(vq,Ey),m.fromElements(Ey.z,Ey.x,Ey.y,Ey),m.clone(Ey,mE.origin),m.clone(m.UNIT_X,mE.direction);let T=d.data.pick(mE,a,c,!1,Ey);l(T)&&(l(x.callback)&&x.callback(T),x.level=d.level)}if(Ti()>=s){h=!0;break}}if(h){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Uot(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var mV=xf;function zd(e){e=y(e,oe.WGS84);let t=new YA({ellipsoid:e}),n=new sV;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new NU,this._material=void 0,this._surface=new mV({tileProvider:new iV({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Rt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new oV,Dq(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Cn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(zd.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&Dq(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Dq(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Rt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Dq(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[Cy,SI];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(AU),e._surfaceShaderSet.baseVertexShaderSource=new We({sources:[Cy,SI,EU],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new We({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Vot(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var zot=[],Hot={start:0,stop:0};zd.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=zot;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let h=$i.raySphere(e,g,Hot);l(h)&&s.push(p)}s.sort(Vot(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var Got=new me;zd.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Got);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var Wot=new m,b_e=new m,jot=new me,qot=new In;function Iq(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}zd.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=Iq(n._southwestChild,e)||Iq(n._southeastChild,e)||Iq(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,Wot),u=qot,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(g,0),-11500),x=m.multiplyByScalar(f,Math.abs(h)+1,b_e);m.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,b_e);if(l(p))return a.cartesianToCartographic(p,jot).height};zd.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};zd.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&(l(i._ready)?i._ready:!l(i.ready)||i.ready),r=this.showWaterEffect&&o&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let c=this._oceanNormalMapResource,u=c.url;if(l(u)){let f=this;c.fetchImage().then(function(d){u===f._oceanNormalMapResource.url&&(f._oceanNormalMap=f._oceanNormalMap&&f._oceanNormalMap.destroy(),f._oceanNormalMap=new Lt({context:e.context,source:d}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let s=e.passes,a=e.mode;s.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=a===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};zd.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};zd.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};zd.prototype.isDestroyed=function(){return!1};zd.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var hV=zd;var Pq={position:0};function pV(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ae,this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=new L,this._computedModelMatrix=new L,this.show=y(e.show,!0),this.material=y(e.material,qi.fromType(qi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:y(e._owner,this)}),this._pickCommand=new nt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Yot(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ol.createGeometry(Ol.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Me.POSITION_ONLY}));return t=ai.fromGeometry({context:e,geometry:n,attributeLocations:Pq,bufferUsage:ke.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}pV.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:gi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?mn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Yot(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!L.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(L.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),L.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new We({sources:[EI]}),p=new We({sources:[this.material.shaderSource,AI]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Pq}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=_t(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,h=e.passes;if(h.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ae.TRANSLUCENT:Ae.OPAQUE,g.push(f)),h.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new We({sources:[EI]}),p=new We({sources:[this.material.shaderSource,AI],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Pq}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=_t(_t(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ae.TRANSLUCENT:Ae.OPAQUE,g.push(x)}};pV.prototype.isDestroyed=function(){return!1};pV.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var _V=pV;function qI(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,oe.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new _V({radii:this.ellipsoid.radii,material:qi.fromType(qi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new qk}Object.defineProperties(qI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var gV=new Z,Xot=new Z,Kot=new m,yV=[];qI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,gV))||Mt.computeTemeToPseudoFixedMatrix(n,gV);let i=this._axes.evaluate(n,Xot);Z.transpose(i,i),Z.multiply(gV,i,i);let o=Mx.computeMoonPositionInEarthInertialFrame(n,Kot);Z.multiplyByVector(gV,o,o),L.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=yV,yV.length=0,t.update(e),e.commandList=r,yV.length===1?yV[0]:void 0};qI.prototype.isDestroyed=function(){return!1};qI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var xV=qI;function YI(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(YI.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Jot(e,t,n){let i=t.createViewportQuadCommand(mU,{framebuffer:n,renderState:Ve.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}YI.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Lt({context:t,width:256,height:256,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST});this._colorTexture=n;let i=new pa({context:t,colorTextures:[n],destroyAttachments:!1});Jot(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};YI.prototype.isDestroyed=function(){return!1};YI.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var bV=YI;var E_e={};function Zot(e,t,n){let i,o,r;if(e instanceof wi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof _l)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var $ot=new m,C_e=new m;function S_e(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(o){return P.lerp(e,t,o)}}function Rq(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=m.subtract(a,c,$ot),g=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),C_e)),h=m.magnitude(m.multiplyByScalar(f,m.dot(p,f),C_e));r=Math.min(Zot(d,g,h)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function XI(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var v_e=new m;function Qot(e,t,n,i,o,r,s,a){let c=e.camera,u=m.clone(c.position,v_e),f=c.pitch,d=XI(c.heading,i),p=XI(c.roll,r),g=Rq(c,n,u.z,n.z,s),h=S_e(f,o,g,a);function x(b){let C=b.time/t;c.setView({orientation:{heading:P.lerp(d,i,C),pitch:h(C),roll:P.lerp(p,r,C)}}),H.lerp(u,n,C,c.position),c.position.z=g(C)}return x}function ert(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function trt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var nrt=new me,irt=new me;function ort(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=me.clone(f.positionCartographic,nrt),h=f.pitch,x=XI(f.heading,i),b=XI(f.roll,r),C=p.cartesianToCartographic(n,irt);g.longitude=P.zeroToTwoPi(g.longitude),C.longitude=P.zeroToTwoPi(C.longitude);let T=!1;if(l(a)){let I=P.zeroToTwoPi(a),O=Math.min(g.longitude,C.longitude),R=Math.max(g.longitude,C.longitude),N=I>=O&&I<=R;if(l(c)){let F=Math.abs(g.longitude-C.longitude),_=P.TWO_PI-F;(N?F:_)<(N?_:F)*c&&!N&&(T=!0)}else N||(T=!0)}T?ert(g,C):trt(g,C);let A=Rq(f,n,g.height,C.height,s),S=S_e(h,o,A,u);function v(){let I=g.longitude,O=C.longitude,R=g.latitude,N=C.latitude;return function(_){let E=_.time/t,w=m.fromRadians(P.lerp(I,O,E),P.lerp(R,N,E),A(E),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,E),pitch:S(E),roll:P.lerp(b,r,E)}})}}return v()}function rrt(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,v_e),u=XI(a.heading,i),f=a.frustum.right-a.frustum.left,d=Rq(a,n,f,n.z,s);function p(g){let h=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,h)}}),H.lerp(c,n,h,a.position);let x=d(h),b=a.frustum,C=b.top/b.right,T=(x-(b.right-b.left))*.5;b.right+=T,b.left-=T,b.top=C*b.right,b.bottom=-b.top}return p}var T_e=new me,srt=new m;function Oq(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function A_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}E_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return Oq();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,T_e),n=r.project(T_e,srt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let h=t.duration;l(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),C=y(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let A=A_e(T,t.complete),S=A_e(T,t.cancel),v=p.frustum,I=e.mode===ne.SCENE2D;if(I=I&&H.equalsEpsilon(p.position,n,P.EPSILON6),I=I&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),I=I||e.mode!==ne.SCENE2D&&m.equalsEpsilon(n,p.position,P.EPSILON10),I=I&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(C),P.negativePiToPi(p.roll),P.EPSILON10),I)return Oq(A,S);let O=new Array(4);if(O[ne.SCENE2D]=rrt,O[ne.SCENE3D]=ort,O[ne.COLUMBUS_VIEW]=Qot,h<=0)return Oq(function(){O[i](e,1,n,x,b,C,a,c,u,f)({time:1}),typeof A=="function"&&A()},S);let R=O[i](e,h,n,x,b,C,a,c,u,f);if(!l(d)){let N=p.positionCartographic.height,F=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;N>F&&N>11500?d=Br.CUBIC_OUT:d=Br.QUINTIC_IN_OUT}return{duration:h,easingFunction:d,startObject:{time:0},stopObject:{time:h},update:R,complete:A,cancel:S}};var CV=E_e;var art={ROTATE:0,INFINITE_SCROLL:1},yu=Object.freeze(art);function Zt(e){this._scene=e,this._transform=L.clone(L.IDENTITY),this._invTransform=L.clone(L.IDENTITY),this._actualTransform=L.clone(L.IDENTITY),this._actualInvTransform=L.clone(L.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new _e,this._moveEnd=new _e,this._changed=new _e,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new L,this._invViewMatrix=new L,L_e(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,q_e(this,Zt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*Zt.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}Zt.TRANSFORM_2D=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Zt.TRANSFORM_2D_INVERSE=L.inverseTransformation(Zt.TRANSFORM_2D,new L);Zt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Zt.DEFAULT_VIEW_FACTOR=.5;Zt.DEFAULT_OFFSET=new ff(0,-P.PI_OVER_FOUR,0);function L_e(e){L.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),L.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),L.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function crt(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}Zt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};Zt.prototype._updateCameraChanged=function(){let e=this;if(crt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;if(o>t&&(e._changed.raiseEvent(o),e._changedHeading=n),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,h=u.x+d.right,x=f.x+p.left,b=f.x+p.right,C=u.y+d.bottom,T=u.y+d.top,A=f.y+p.bottom,S=f.y+p.top,v=Math.max(g,x),I=Math.min(h,b),O=Math.max(C,A),R=Math.min(T,S),N;if(v>=I||O>=T)N=1;else{let F=p;g<x&&h>b&&C<A&&T>S&&(F=d),N=1-(I-v)*(R-O)/((F.right-F.left)*(F.top-F.bottom))}N>t&&(e._changed.raiseEvent(N),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let r=P.acosClamped(m.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=r/(e.frustum.fovy*.5):s=r;let c=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function lrt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var urt=new me,frt=new m,TV=new m,drt=new re,mrt=new re,hrt=new re,prt=new re,_rt=new re;function grt(e){let t=e._projection,n=t.ellipsoid,i=L.getColumn(e._transform,3,drt),o=n.cartesianToCartographic(i,urt),r=t.project(o,frt),s=mrt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=re.clone(re.UNIT_X,_rt),c=re.add(L.getColumn(e._transform,0,TV),i,TV);n.cartesianToCartographic(c,o),t.project(o,r);let u=hrt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0;let f=prt;if(m.magnitudeSquared(u)>P.EPSILON10)m.cross(a,u,f);else{let d=re.add(L.getColumn(e._transform,1,TV),i,TV);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,m.subtract(f,s,f),f.x=0,m.magnitudeSquared(f)<P.EPSILON10&&(re.clone(re.UNIT_Y,u),re.clone(re.UNIT_Z,f))}m.cross(f,a,u),m.normalize(u,u),m.cross(a,u,f),m.normalize(f,f),L.setColumn(e._actualTransform,0,u,e._actualTransform),L.setColumn(e._actualTransform,1,f,e._actualTransform),L.setColumn(e._actualTransform,2,a,e._actualTransform),L.setColumn(e._actualTransform,3,s,e._actualTransform)}var Mq=new m;function tc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,u=!m.equals(c,e.up);u&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let f=e._right,d=!m.equals(f,e.right);d&&(m.normalize(e.right,e.right),f=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(L.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?L.equals(L.IDENTITY,e._transform)?L.clone(Zt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?lrt(e):grt(e):L.clone(e._transform,e._actualTransform),L.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=L.multiplyByPoint(g,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=Mq;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===ne.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||u||d){let h=m.dot(s,m.cross(c,f,Mq));if(Math.abs(1-h)>P.EPSILON2){let x=1/m.magnitudeSquared(c),b=m.dot(c,s)*x,C=m.multiplyByScalar(s,b,Mq);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),f=m.cross(s,c,e._right),m.clone(f,e.right)}}(a||p)&&(e._directionWC=L.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=L.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=L.multiplyByPointAsVector(g,f,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&L_e(e)}function N_e(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function F_e(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function B_e(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var SV=new L,vV=new L;Object.defineProperties(Zt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return tc(this),this._invTransform}},viewMatrix:{get:function(){return tc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return tc(this),this._invViewMatrix}},positionCartographic:{get:function(){return tc(this),this._positionCartographic}},positionWC:{get:function(){return tc(this),this._positionWC}},directionWC:{get:function(){return tc(this),this._directionWC}},upWC:{get:function(){return tc(this),this._upWC}},rightWC:{get:function(){return tc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,SV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vV);this._setTransform(n);let i=N_e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,SV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vV);this._setTransform(n);let i=F_e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,SV),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,vV);this._setTransform(n);let i=B_e(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Zt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&z_e(this,this.position)};var yrt=new m,xrt=new m,brt=new m;Zt.prototype._setTransform=function(e){let t=m.clone(this.positionWC,yrt),n=m.clone(this.upWC,xrt),i=m.clone(this.directionWC,brt);L.clone(e,this._transform),this._transformChanged=!0,tc(this);let o=this._actualInvTransform;L.multiplyByPoint(o,t,this.position),L.multiplyByPointAsVector(o,i,this.direction),L.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),tc(this)};var Crt=new H,Trt=new In,Art=new m,Ert=new m;function k_e(e){if(!L.equals(L.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Crt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,Trt);o=n.pickWorldCoordinates(a,t,!0,Art)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Ert));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Zt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=k_e(this)))};var wV=new m,kq=new L,Srt=new L,Uq=new Be,Vq=new Z,U_e=new me;function vrt(e,t,n){let i=L.clone(e.transform,kq),o=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Srt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Be.fromHeadingPitchRoll(n,Uq),s=Z.fromQuaternion(r,Vq);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function wrt(e,t,n,i){let o=L.clone(e.transform,kq);if(e._setTransform(L.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,U_e);t=a.project(c,wV)}m.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Be.fromHeadingPitchRoll(n,Uq),s=Z.fromQuaternion(r,Vq);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Irt(e,t,n,i){let o=L.clone(e.transform,kq);if(e._setTransform(L.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,U_e);t=c.project(u,wV)}H.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===yu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Be.fromHeadingPitchRoll(n,Uq),s=Z.fromQuaternion(r,Vq);Z.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Drt=new m,Prt=new m,Ort=new m;function V_e(e,t,n,i){let o=m.clone(n.direction,Drt),r=m.clone(n.up,Prt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,SV),u=L.inverseTransformation(c,vV);L.multiplyByPointAsVector(u,o,o),L.multiplyByPointAsVector(u,r,r)}let s=m.cross(o,r,Ort);return i.heading=N_e(o,r),i.pitch=F_e(o),i.roll=B_e(o,r,s),i}var Bq={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},hE=new lc;Zt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,m.clone(this.positionWC,wV));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,wV),i=!1),l(t.direction)&&(t=V_e(this,o,t,Bq.orientation)),hE.heading=y(t.heading,0),hE.pitch=y(t.pitch,-P.PI_OVER_TWO),hE.roll=y(t.roll,0),n===ne.SCENE3D?vrt(this,o,hE):n===ne.SCENE2D?Irt(this,o,hE,i):wrt(this,o,hE,i)};var Rrt=new m;Zt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Zt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:L.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Zt.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*Zt.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:L.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Rrt).z),roll:0},endTransform:L.IDENTITY,convert:!1})}};Zt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new re),tc(this),L.multiplyByVector(this._actualInvTransform,e,t)};Zt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),tc(this),L.multiplyByPoint(this._actualInvTransform,e,t)};Zt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),tc(this),L.multiplyByPointAsVector(this._actualInvTransform,e,t)};Zt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new re),tc(this),L.multiplyByVector(this._actualTransform,e,t)};Zt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),tc(this),L.multiplyByPoint(this._actualTransform,e,t)};Zt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),tc(this),L.multiplyByPointAsVector(this._actualTransform,e,t)};function z_e(e,t){let n=e._scene.mapMode2D===yu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var w_e=new m;Zt.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,w_e),m.add(n,w_e,n),this._mode===ne.SCENE2D&&z_e(this,n),this._adjustOrthographicFrustum(!0)};Zt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?IV(this,e):this.move(this.direction,e)};Zt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?IV(this,-e):this.move(this.direction,-e)};Zt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Zt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Zt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Zt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Zt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Zt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Zt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Zt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Mrt=new Be,Lrt=new Z;Zt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Be.fromAxisAngle(e,-n,Mrt),o=Z.fromQuaternion(i,Lrt),r=this.direction,s=this.up,a=this.right;Z.multiplyByVector(o,r,r),Z.multiplyByVector(o,s,s),Z.multiplyByVector(o,a,a)};Zt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Zt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Nrt=new Be,Frt=new Z;Zt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Be.fromAxisAngle(e,-n,Nrt),o=Z.fromQuaternion(i,Frt);Z.multiplyByVector(o,this.position,this.position),Z.multiplyByVector(o,this.direction,this.direction),Z.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Zt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),H_e(this,e)};Zt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),H_e(this,-e)};var Brt=new m,krt=new m,Urt=new m,I_e=new m;function H_e(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,P.EPSILON2)){let i=m.normalize(n,Brt),o=m.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,I_e),P.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,krt),a=m.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=m.dot(i,m.negate(s,I_e)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=m.cross(s,i,Urt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Zt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),G_e(this,-e)};Zt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),G_e(this,e)};function G_e(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function IV(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===yu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===yu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function W_e(e,t){e.move(e.direction,t)}Zt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?IV(this,e):W_e(this,e)};Zt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?IV(this,-e):W_e(this,-e)};Zt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return m.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Vrt=new L;Zt.prototype.lookAt=function(e,t){let n=Mt.eastNorthUpToFixedFrame(e,oe.WGS84,Vrt);this.lookAtTransform(n,t)};var zrt=new m,Hrt=new Be,Grt=new Be,Wrt=new Z;function j_e(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Be.fromAxisAngle(m.UNIT_Y,-t,Hrt),o=Be.fromAxisAngle(m.UNIT_Z,-e,Grt),r=Be.multiply(o,i,o),s=Z.fromQuaternion(r,Wrt),a=m.clone(m.UNIT_X,zrt);return Z.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}Zt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=j_e(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){H.clone(H.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<P.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(L.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<P.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var KI=new me,jrt=new me,qrt=new m,Yrt=new m,Xrt=new m,Krt=new m,Jrt=new m,Zrt=new m,$rt=new m,Lq=new m,Qrt={direction:new m,right:new m,up:new m},D_e;function ec(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function q_e(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Qrt,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=P.TWO_PI);let f=(u+c)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let N=KI;N.longitude=f,N.latitude=s,N.height=0;let F=jrt;F.longitude=f,F.latitude=a,F.height=0;let _=D_e;(!l(_)||_.ellipsoid!==o)&&(D_e=_=new zf(void 0,void 0,o)),_.setEndPoints(N,F),d=_.interpolateUsingFraction(.5,KI).latitude}let p=KI;p.longitude=f,p.latitude=d,p.height=0;let g=o.cartographicToCartesian(p,$rt),h=KI;h.longitude=c,h.latitude=s;let x=o.cartographicToCartesian(h,qrt);h.longitude=u;let b=o.cartographicToCartesian(h,Xrt);h.longitude=f;let C=o.cartographicToCartesian(h,Jrt);h.latitude=a;let T=o.cartographicToCartesian(h,Zrt);h.longitude=c;let A=o.cartographicToCartesian(h,Krt);h.longitude=u;let S=o.cartographicToCartesian(h,Yrt);m.subtract(b,g,b),m.subtract(A,g,A),m.subtract(x,g,x),m.subtract(S,g,S),m.subtract(C,g,C),m.subtract(T,g,T);let v=o.geodeticSurfaceNormal(g,r.direction);m.negate(v,v);let I=m.cross(v,m.UNIT_Z,r.right);m.normalize(I,I);let O=m.cross(I,v,r.up),R;if(e.frustum instanceof on){let N=Math.max(m.distance(x,b),m.distance(A,S)),F=Math.max(m.distance(x,A),m.distance(b,S)),_,E,w=e.frustum._offCenterFrustum,D=w.right/w.top,M=F*D;N>M?(_=N,E=_/D):(E=F,_=M),R=Math.max(_,E)}else{let N=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*N;if(R=Math.max(ec(v,O,b,N),ec(v,O,A,N),ec(v,O,x,N),ec(v,O,S,N),ec(v,O,C,N),ec(v,O,T,N),ec(v,I,b,F),ec(v,I,A,F),ec(v,I,x,F),ec(v,I,S,F),ec(v,I,C,F),ec(v,I,T,F)),a<0&&s>0){let _=KI;_.longitude=u,_.latitude=0,_.height=0;let E=o.cartographicToCartesian(_,Lq);m.subtract(E,g,E),R=Math.max(R,ec(v,O,E,N),ec(v,I,E,F)),_.longitude=c,E=o.cartographicToCartesian(_,Lq),m.subtract(E,g,E),R=Math.max(R,ec(v,O,E,N),ec(v,I,E,F))}}return m.add(g,m.multiplyByScalar(v,-R,Lq),n)}var est=new me,tst=new m,nst=new m;function ist(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=est;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,tst);L.multiplyByPoint(o,a,a),L.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,nst);if(L.multiplyByPoint(o,c,c),L.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var ost=new me,rst=new m,sst=new m;function ast(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===yu.INFINITE_SCROLL?o+=P.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=ost;r.longitude=o,r.latitude=t.north;let s=i.project(r,rst);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,sst),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}Zt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===ne.SCENE3D)return q_e(this,e,t);if(n===ne.COLUMBUS_VIEW)return ist(this,e,t);if(n===ne.SCENE2D)return ast(this,e,t)};var cst=new In;function lst(e,t,n,i){n=y(n,oe.WGS84);let o=e.getPickRay(t,cst),r=$i.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return In.getPoint(o,s,i)}var ust=new In;function fst(e,t,n,i){let r=e.getPickRay(t,ust).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var dst=new In;function mst(e,t,n,i){let o=e.getPickRay(t,dst),r=-o.origin.x/o.direction.x;In.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Zt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,oe.WGS84),this._mode===ne.SCENE3D)n=lst(this,e,t,n);else if(this._mode===ne.SCENE2D)n=fst(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=mst(this,e,this._projection,n);else return;return n}};var hst=new m,pst=new m,_st=new m;function gst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;m.clone(d,n.origin);let p=m.multiplyByScalar(e.directionWC,c,hst);m.add(d,p,p);let g=m.multiplyByScalar(e.rightWC,u*c*a,pst),h=m.multiplyByScalar(e.upWC,f*c*s,_st),x=m.add(p,g,n.direction);return m.add(x,h,x),m.subtract(x,d,x),m.normalize(x,x),n}var AV=new m;function yst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return m.clone(e.position,f),m.multiplyByScalar(e.right,c,AV),m.add(AV,f,f),m.multiplyByScalar(e.up,u,AV),m.add(AV,f,f),m.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Zt.prototype.getPickRay=function(e,t){l(t)||(t=new In);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?gst(this,e,t):yst(this,e,t)};var xst=new m,bst=new m;Zt.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,xst),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),bst);return Math.max(0,m.magnitude(n)-e.radius)};var Cst=new H;Zt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Cst);return Math.max(o.x,o.y)};function Tst(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Br.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Ast=new m,P_e=new m,Est=new m,Sst=new m;function vst(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,Ast),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,P_e),P_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Est);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=m.magnitude(m.subtract(n,s,Sst)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,h=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-h||n.z>h||n.y<-x||n.y>x){let b=s.y<-h||s.y>h,C=s.z<-x||s.z>x;if(b||C)return Tst(e,n,s,h,x,t)}}Zt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return vst(this,e)};var wst=new m,Ds={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Zt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Zt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ds.destination,e.orientation.heading=Ds.heading,e.orientation.pitch=Ds.pitch,e.orientation.roll=Ds.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Zt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,wst));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=V_e(this,t,o,Bq.orientation)),l(e.duration)&&e.duration<=0){let f=Bq;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;Ds.destination=t,Ds.heading=o.heading,Ds.pitch=o.pitch,Ds.roll=o.roll,Ds.duration=e.duration,Ds.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ds.cancel=e.cancel,Ds.endTransform=e.endTransform,Ds.convert=i?!1:e.convert,Ds.maximumHeight=e.maximumHeight,Ds.pitchAdjustHeight=e.pitchAdjustHeight,Ds.flyOverLongitude=e.flyOverLongitude,Ds.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ds.easingFunction=e.easingFunction;let a=this._scene,c=CV.createTween(a,Ds);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=Zt.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Ist(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Dst(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Pst=100;function Y_e(e,t,n){n=ff.clone(l(n)?n:Zt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Pst:e.frustum instanceof on||e._mode===ne.SCENE2D?n.range=Dst(e,s):n.range=Ist(e,s),n.range=P.clamp(n.range,i,o)}return n}Zt.prototype.viewBoundingSphere=function(e,t){t=Y_e(this,e,t),this.lookAt(e.center,t)};var Ost=new L,Rst=new m,Mst=new m,Lst=new m,Nst=new m,Fst=new re,Bst=new Be,kst=new Z;Zt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(L.IDENTITY);let i=Y_e(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,Rst):o=j_e(i.heading,i.pitch,i.range);let r=Mt.eastNorthUpToFixedFrame(e.center,oe.WGS84,Ost);L.multiplyByPoint(r,o,o);let s,a;if(!n){if(s=m.subtract(e.center,o,Mst),m.normalize(s,s),a=L.multiplyByPointAsVector(r,m.UNIT_Z,Lst),1-Math.abs(m.dot(s,a))<P.EPSILON6){let u=Be.fromAxisAngle(s,i.heading,Bst),f=Z.fromQuaternion(u,kst);m.fromCartesian4(L.getColumn(r,1,Fst),a),Z.multiplyByVector(f,a,a)}let c=m.cross(s,a,Nst);m.cross(c,s,a),m.normalize(a,a)}this.flyTo({destination:o,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var O_e=new m,R_e=new m,Nq=new m,M_e=new m,JI=[new m,new m,new m,new m];function Ust(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,O_e),r=m.magnitude(o),s=m.normalize(o,R_e),a,c;m.equalsEpsilon(s,m.UNIT_Z,P.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,Nq),Nq),c=m.normalize(m.cross(s,a,M_e),M_e));let u=Math.sqrt(m.magnitudeSquared(o)-1),f=m.multiplyByScalar(s,1/r,O_e),d=u/r,p=m.multiplyByScalar(a,d,R_e),g=m.multiplyByScalar(c,d,Nq),h=m.add(f,g,JI[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let x=m.subtract(f,g,JI[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let b=m.subtract(f,g,JI[2]);m.add(b,p,b),m.multiplyComponents(n,b,b);let C=m.add(f,g,JI[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),JI}var Fq=new H,Vst=new m,Sy=[new me,new me,new me,new me];function EV(e,t,n,i,o,r){Fq.x=e,Fq.y=t;let s=i.pickEllipsoid(Fq,o,Vst);return l(s)?(Sy[n]=o.cartesianToCartographic(s,Sy[n]),1):(Sy[n]=o.cartesianToCartographic(r[n],Sy[n]),0)}Zt.prototype.computeViewRectangle=function(e,t){e=y(e,oe.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===tn.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=Ust(this,e);if(c+=EV(0,0,0,this,e,u),c+=EV(0,a,1,this,e,u),c+=EV(s,a,2,this,e,u),c+=EV(s,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Sy,t);let f=0,d=Sy[3].longitude;for(let p=0;p<4;++p){let g=Sy[p].longitude,h=Math.abs(g-d);h>P.PI?f+=P.TWO_PI-h:f+=h,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,Sy[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};Zt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof wi)return;let e=this._scene;this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};Zt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof on)return;let e=k_e(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Zt.clone=function(e,t){return l(t)||(t=new Zt(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),L.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ho=Zt;function zst(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Hd=zst;var $_e=ur(Dl(),1),X_e=576,Hst=100,ZI="#ffffff",zq="#48b";function Q_e(e,t){this.credit=e,this.count=y(t,1)}function ege(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(wt.equals(o,t))return!0}return!1}function Gst(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;wt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var tge="cesium-credit-delimiter";function K_e(e){let t=document.createElement("span");return t.textContent=e,t.className=tge,t}function J_e(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Z_e(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(K_e(n));else{let f=o[u];f.className!==tge&&e.replaceChild(K_e(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(J_e(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(J_e(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Wst(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<X_e?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=X_e&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function nc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` } +`,n}function jst(e){let t="";t+=nc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=nc(".cesium-credit-lightbox",{"background-color":"#303336",color:ZI,position:"relative","min-height":`${Hst}px`,margin:"auto"}),t+=nc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:ZI}),t+=nc(".cesium-credit-lightbox > ul > li a:hover",{color:zq}),t+=nc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=nc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=nc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=nc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:ZI}),t+=nc(".cesium-credit-lightbox-close:hover",{color:zq}),t+=nc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=nc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=nc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=nc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:ZI}),t+=nc(".cesium-credit-expand-link:hover",{color:zq}),t+=nc(".cesium-credit-text",{color:ZI}),t+=nc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Do(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(h){r.contains(h.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),jst(e);let g=wt.clone(Do.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new At,lightboxCredits:new At},this._defaultCredit=void 0,this.viewport=n,this.container=e}function nge(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Q_e(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Do.prototype.addCredit=function(e){Q("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(e)};Do.prototype.addCreditToNextFrame=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=wt.clone(ige())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,nge(this,t,e)};Do.prototype.addDefaultCredit=function(e){Q("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let t=this._staticCredits;ege(t,e)||(e.showOnScreen=!0,t.push(e))};Do.prototype.addStaticCredit=function(e){let t=this._staticCredits;ege(t,e)||t.push(e)};Do.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Do.prototype.removeDefaultCredit=function(e){Q("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(e)};Do.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Do.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Do.prototype.update=function(){this._expanded&&Wst(this)};Do.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r._isIon&&wt.equals(Do.cesiumCredit,this._cesiumCredit)||nge(this,s,r,Number.MAX_VALUE)}wt.equals(Do.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=wt.clone(Do.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Do.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Z_e(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Z_e(this._creditList,t,void 0,"li"),Gst(this)};Do.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Do.prototype.isDestroyed=function(){return!1};Do._cesiumCredit=void 0;Do._cesiumCreditInitialized=!1;var DV;function ige(){if(!l(DV)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new $_e.default(e).path()),DV=new wt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return Do._cesiumCreditInitialized||(Do._cesiumCredit=DV,Do._cesiumCreditInitialized=!0),DV}Object.defineProperties(Do,{cesiumCredit:{get:function(){return ige(),Do._cesiumCredit},set:function(e){Do._cesiumCredit=e,Do._cesiumCreditInitialized=!0}}});Do.CreditDisplayElement=Q_e;var PV=Do;function OV(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var qst=new m,Yst=new Z,Xst=new Be,Kst=new wi,Jst=new _l,Zst=new on,$st=new Or,Qst=new z,eat=[1,1e5];OV.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof wi?a=Kst:s instanceof _l?a=Jst:s instanceof on?a=Zst:a=$st,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=eat,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,qst);let h=Yst;Z.setColumn(h,0,g,h),Z.setColumn(h,1,p,h),Z.setColumn(h,2,d,h);let x=Be.fromRotationMatrix(h,Xst);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Dn({geometryInstances:new Tt({geometry:new KA({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(z.fromAlpha(this._color,.1,Qst))},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Dn({geometryInstances:new Tt({geometry:new Fk({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};OV.prototype.isDestroyed=function(){return!1};OV.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var qp=OV;function QI(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var $I=Wt.supportsTypedArrays()?new Float32Array(12):[],oge=new m,rge=new m,Hq=new m,sge=new m,RV=new m;function tat(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,d,oge),g=m.normalize(p,rge),h=m.normalize(m.cross(m.UNIT_Z,p,Hq),Hq),x=m.normalize(m.cross(g,h,sge),sge),b=m.magnitude(p),C=Math.sqrt(b*b-1);o=m.multiplyByScalar(g,1/b,oge);let T=C/b;r=m.multiplyByScalar(h,T,rge),s=m.multiplyByScalar(x,T,Hq)}let a=m.add(o,s,RV);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,$I,0);let c=m.subtract(o,s,RV);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,$I,3);let u=m.add(o,s,RV);m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,$I,6);let f=m.subtract(o,s,RV);return m.add(f,r,f),m.multiplyComponents(n,f,f),m.pack(f,$I,9),$I}QI.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new oe(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ae(m.ZERO,i.maximumRadius),pass:Ae.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new We({sources:[CU]}),a=new We({sources:[bU]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=tat(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new dt({attributes:{position:new Pe({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Fe.TRIANGLES});this._va=ai.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:ke.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};QI.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};QI.prototype.isDestroyed=function(){return!1};QI.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var MV=QI;function e1(){}var nat=/\bgl_FragDepth\b/,iat=/\bdiscard\b/;function oat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource,r,s=!1,a=o.sources,c=a.length;for(r=0;r<c;++r)if(nat.test(a[r])||iat.test(a[r])){s=!0;break}let u=!1,f=o.defines;for(c=f.length,r=0;r<c;++r)if(f[r]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main() +{ + out_FragColor = vec4(1.0); +} +`,o=new We({sources:[d]})):!s&&u&&(d=`void main() +{ + out_FragColor = vec4(1.0); + czm_writeLogDepth(); +} +`,o=new We({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}function rat(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ve.fromCache(o),n[t.id]=i}return i}e1.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.depthOnlyCommand)&&(o=i.depthOnlyCommand.shaderProgram,r=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=oat(n,t.shaderProgram),i.depthOnlyCommand.renderState=rat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var sat=/\s+czm_writeLogDepth\(/,aat=/\s+czm_vertexLogDepth\(/;function cat(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,u=!1,f=r.sources,d=f.length;for(a=0;a<d;++a)if(aat.test(f[a])){u=!0;break}if(!u){for(a=0;a<d;++a)f[a]=We.replaceMain(f[a],"czm_log_depth_main");c=` + +void main() +{ + czm_log_depth_main(); + czm_vertexLogDepth(); +} +`,f.push(c)}for(f=s.sources,d=f.length,u=!1,a=0;a<d;++a)sat.test(f[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<d;a++)f[a]=We.replaceMain(f[a],"czm_log_depth_main");p+=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); +} +`}f.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}return i}e1.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=cat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function lat(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let o=t._attributeLocations,r=t.fragmentShaderSource,s=r.sources,a=s.length;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${z.floatToByte(n.color.red)}, ${z.floatToByte(n.color.green)}, ${z.floatToByte(n.color.blue)}, ${z.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let c=`void main() +{ + czm_non_pick_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = ${n}; +} +`,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=We.replaceMain(s[f],"czm_non_pick_main");u[a]=c,r=new We({sources:u,defines:r.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:o})}return i}function uat(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=Ve.fromCache(o),n[t.id]=i}return i}e1.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.pickCommand)&&(o=i.pickCommand.shaderProgram,r=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=lat(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=uat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function fat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}return n}e1.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=fat(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var vy=e1;function LV(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var dat=new Be,age=new Be,mat=new Z;function hat(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Be.fromAxisAngle(o,n,age),c=Be.fromAxisAngle(r,i,dat),u=Be.multiply(c,a,c),f=Be.fromAxisAngle(s,t,age);Be.multiply(f,u,u);let d=Z.fromQuaternion(u,mat);Z.multiplyByVector(d,r,r),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,o,o)}LV.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;hat(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};LV.prototype.isDestroyed=function(){return!1};LV.prototype.destroy=function(){return this._removeListener(),ue(this)};var NV=LV;function cge(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var FV=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],fh=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<fh.length;++e)fh[e]*=1e6;var lge=fh[1],Gq=fh[fh.length-1];for(let e=0;e<fh.length;++e)fh[e]=(fh[e]-Gq)/(lge-Gq);var ia=0;function pat(e){let t=FV,n=t.length;if(e<t[0])return ia=0,ia;if(e>t[n-1])return ia=n-2,ia;if(e>=t[ia]){if(ia+1<n&&e<t[ia+1])return ia;if(ia+2<n&&e<t[ia+2])return++ia,ia}else if(ia-1>=0&&e>=t[ia-1])return--ia,ia;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ia=i,ia}var _at=new m;cge.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ne.SCENE3D){e.fog.enabled=!1;return}let o=i.height,r=pat(o),s=P.clamp((o-FV[r])/(FV[r+1]-FV[r]),0,1),a=P.lerp(fh[r],fh[r+1],s),c=this.density*1e6,u=c/lge*Gq;a=a*(c-u)*1e-6;let f=m.normalize(n.positionWC,_at),d=Math.abs(m.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var BV=cge;function gat(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var kV=gat;var oa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},Ux=oa.DERIVED_COMMANDS_MAXIMUM_LENGTH,xge=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Vx(){this._frontFaceAlphaByDistance=new Rt(0,1,0,1),this._backFaceAlphaByDistance=new Rt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(Ux),this._derivedBlendCommandTypes=new Array(Ux),this._derivedPickCommandTypes=new Array(Ux),this._derivedCommandTypesToUpdate=new Array(Ux),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Vx.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});Vx.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=uge(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=uge(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=fge(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=fge(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Cat(this,e,t),this._sunVisibleThroughGlobe=yat(this,e),this._environmentVisible=xat(this,e),this._useDepthPlane=bat(this,e),this._numberOfTextureUniforms=Tat(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Aat(this,e)};function uge(e,t,n,i){return e?l(n)?(Rt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function fge(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function yat(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function xat(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function bat(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Cat(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function Tat(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Aat(e,t){e._derivedCommandsLength=Wq(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Wq(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Wq(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<Ux;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=kat())}function Wq(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?oa.PICK_FRONT_FACE:u?oa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:oa.TRANSLUCENT_FRONT_FACE,d=i?oa.PICK_BACK_FACE:u?oa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:oa.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=oa.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=oa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=oa.DEPTH_ONLY_BACK_FACE),o[r++]=oa.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=oa.DEPTH_ONLY_FRONT_FACE),o[r++]=oa.OPAQUE_BACK_FACE,o[r++]=f),r)}function bf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function dge(e,t){return e.indexOf(t)>-1}function Eat(e,t){bf(e.defines,"TRANSLUCENT"),bf(t.defines,"TRANSLUCENT")}function Sat(e,t){bf(e.defines,"GROUND_ATMOSPHERE"),bf(t.defines,"GROUND_ATMOSPHERE"),bf(e.defines,"FOG"),bf(t.defines,"FOG"),bf(e.defines,"TRANSLUCENT"),bf(t.defines,"TRANSLUCENT")}function jq(e,t){if(dge(t.defines,"TILE_LIMIT_RECTANGLE")||dge(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function qq(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=We.replaceMain(n[r],"czm_globe_translucency_main");let o=` + +uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; +#ifdef MANUAL_DEPTH_TEST + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); + if (logDepthOrDepth != 0.0) + { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + float depthEC = eyeCoordinate.z / eyeCoordinate.w; + if (v_positionEC.z < depthEC) + { + discard; + } + } +#endif + czm_globe_translucency_main(); + vec4 classificationColor = texture(u_classificationTexture, st); + if (classificationColor.a > 0.0) + { + // Reverse premultiplication process to get the correct composited result of the classification primitives + classificationColor.rgb /= classificationColor.a; + } + out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); +} +`;n.push(o)}function bge(e,t){qq(e,t),bf(e.defines,"GROUND_ATMOSPHERE"),bf(t.defines,"GROUND_ATMOSPHERE"),bf(e.defines,"FOG"),bf(t.defines,"FOG")}function vat(e,t){qq(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function wat(e,t){bge(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function mge(e,t){let n=`uniform sampler2D u_classificationTexture; +void main() +{ + vec2 st = gl_FragCoord.xy / czm_viewport.zw; + vec4 pickColor = texture(u_classificationTexture, st); + if (pickColor == vec4(0.0)) + { + discard; + } + out_FragColor = pickColor; +} +`;t.sources=[n]}function Iat(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Dat(e){e.cull.face=gi.BACK,e.cull.enabled=!0}function Pat(e){e.cull.face=gi.FRONT,e.cull.enabled=!0}function Oat(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Rat(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Mat(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function hge(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function pge(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function Lat(e){e.cull.face=gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Nat(e){e.cull.face=gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Fat(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function pE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Bat(e,t,n,i,o){return l(o)?!i&&l(n)?n:_t(t,o(e),!1):t}function Gd(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function kat(){return[new Gd({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:Eat,getRenderStateFunction:Dat,getUniformMapFunction:void 0}),new Gd({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:Sat,getRenderStateFunction:Pat,getUniformMapFunction:void 0}),new Gd({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:jq,getRenderStateFunction:Oat,getUniformMapFunction:void 0}),new Gd({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:jq,getRenderStateFunction:Rat,getUniformMapFunction:void 0}),new Gd({pass:Ae.GLOBE,pickOnly:!1,getShaderProgramFunction:jq,getRenderStateFunction:Mat,getUniformMapFunction:void 0}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:qq,getRenderStateFunction:hge,getUniformMapFunction:pE}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:bge,getRenderStateFunction:pge,getUniformMapFunction:pE}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vat,getRenderStateFunction:hge,getUniformMapFunction:pE}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wat,getRenderStateFunction:pge,getUniformMapFunction:pE}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:mge,getRenderStateFunction:Lat,getUniformMapFunction:pE}),new Gd({pass:Ae.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:mge,getRenderStateFunction:Nat,getUniformMapFunction:pE})]}var _ge=new Array(Ux),gge=new Array(Ux);Vx.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)gge[o]=this._derivedCommandPacks[n[o]],_ge[o]=xge[n[o]];Uat(this,e,i,n,_ge,gge,t)}};function Uat(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let C=r[b],T=i[b],A=o[b],S=a[A],v,I,O;l(S)?(v=S.uniformMap,I=S.shaderProgram,O=S.renderState):(v=void 0,I=void 0,O=void 0),S=nt.shallowClone(t,S),a[A]=S;let R=y(S.derivedCommands.uniformMapDirtyFrame,0),N=y(S.derivedCommands.shaderProgramDirtyFrame,0),F=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||R<f,E=h||N<d,w=x||F<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),w&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=T,S.pass=C.pass,S.pickOnly=C.pickOnly,S.uniformMap=Bat(e,t.uniformMap,v,_,C.getUniformMapFunction),S.shaderProgram=Iat(s.context,t.shaderProgram,I,E,C.getShaderProgramFunction,A),S.renderState=Fat(t.renderState,O,w,C.getRenderStateFunction,C.renderStateCache)}}}Vx.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=xge[o[a]];n.commandList.push(s[c])}};function Cge(e,t,n,i,o,r,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,o,r)}}function yge(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var Vat=[oa.OPAQUE_FRONT_FACE,oa.OPAQUE_BACK_FACE],zat=[oa.DEPTH_ONLY_FRONT_FACE,oa.DEPTH_ONLY_BACK_FACE,oa.DEPTH_ONLY_FRONT_AND_BACK_FACE];Vx.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ae.GLOBE],a=e.indices[Ae.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Cge(s,a,t,i,r,o,Vat))};Vx.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ae.GLOBE],a=e.indices[Ae.GLOBE],c=e.commands[Ae.TERRAIN_CLASSIFICATION],u=e.indices[Ae.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&yge(c,u,t,i,r,o),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,g=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Cge(s,a,t,i,r,o,zat),r.depthTexture){let h=n.packDepth(r,o);r.uniformState.globeDepthTexture=h}yge(c,u,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=g};var UV=Vx;var xu=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;function dh(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ui({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(dh.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});dh.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Hat={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},Gat={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Gn.NOT_EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},Wat={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:mn.ALPHA_BLEND},jat=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } + bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); +#ifdef UNCLASSIFIED + vec4 highlightColor = czm_invertClassificationColor; + if (isClassified) + { + discard; + } +#else + vec4 highlightColor = vec4(1.0); + if (!isClassified) + { + discard; + } +#endif + out_FragColor = color * highlightColor; + gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; +} +`,qat=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } +#ifdef UNCLASSIFIED + out_FragColor = color * czm_invertClassificationColor; +#else + out_FragColor = color; +#endif +} +`;dh.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Lt({context:e,width:s,height:a,pixelFormat:lt.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Vu({context:e,width:s,height:a,format:il.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(Hat),this._rsClassified=Ve.fromCache(Gat),this._rsDefault=Ve.fromCache(Wat)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?qat:jat,f=new We({defines:["UNCLASSIFIED"],sources:[u]}),d=new We({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(xu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};dh.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};dh.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};dh.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};dh.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var t1=dh;function VV(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(VV.prototype,{total:{get:function(){return this._total}}});function wy(e){let t=new Array(ka.NUMBER_OF_JOB_TYPES);t[ka.TEXTURE]=new VV(l(e)?e[ka.TEXTURE]:10),t[ka.PROGRAM]=new VV(l(e)?e[ka.PROGRAM]:10),t[ka.BUFFER]=new VV(l(e)?e[ka.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}wy.getTimestamp=Ti;Object.defineProperties(wy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});wy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};wy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};wy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=wy.getTimestamp();e.execute();let a=wy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var zV=wy;function HV(e){e=y(e,y.EMPTY_OBJECT);let t=Mn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ti(),this._lastMsSampleTime=Ti(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(HV.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});HV.prototype.update=function(e){let t=Ti(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};HV.prototype.destroy=function(){return ue(this)};var Iy=HV;function zx(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(zx.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Yat(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Xat(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ + out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); +} +`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:Ve.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}zx.prototype.update=function(e,t){Yat(this,e,t),Xat(this,e,t)};var Kat=new re,Jat=new re(1,1/255,1/65025,1/16581375);zx.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=re.unpack(i,0,Kat);return re.divideByScalar(o,255,o),re.dot(o,Jat)};zx.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};zx.prototype.isDestroyed=function(){return!1};zx.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var GV=zx;function Zat(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ae.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var WV=Zat;var Hx=`uniform highp sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); +} +`;function mh(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(mh.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function $at(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function Tge(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ke.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Gn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Hx,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Hx,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ui({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}mh.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),Tge(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};mh.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};mh.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};mh.prototype.executeUpdateDepth=function(e,t,n,i){let o=l(i)?i:t.framebuffer.depthStencilTexture;if(n||o!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==o||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,r,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(o),this._updateDepthFramebuffer.update(e,r,s),Tge(this,e,r,s,t)}this._tempCopyDepthTexture=o,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};mh.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};mh.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};mh.prototype.isDestroyed=function(){return!1};mh.prototype.destroy=function(){return $at(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var jV=mh;function Gx(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(Gx.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Qat(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function ect(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function tct(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Hx,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}Gx.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;ect(this,n,o,r,e),tct(this,n,o,r,i),this._useHdr=e};Gx.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};Gx.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};Gx.prototype.isDestroyed=function(){return!1};Gx.prototype.destroy=function(){return Qat(this),ue(this)};var qV=Gx;function Yp(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Age(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Yq(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Ege(e){Age(e),Yq(e)}function nct(e,t,n,i){Age(e),e._accumulationTexture=new Lt({context:t,width:n,height:i,pixelFormat:lt.RGBA,pixelDatatype:Je.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:Je.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function ict(e,t){Yq(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Yq(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(Ege(e),e._translucentMultipassSupport=!1,i=!1)}return i}Yp.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,nct(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!ict(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new We({sources:[xU]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new We({defines:["MRT"],sources:[TI]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new We({sources:[TI]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),h=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var oct={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA},rct={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationAlpha:vo.ONE},sct={enabled:!0,color:new z(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:vo.ZERO,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA};function Xq(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function act(e,t,n){return Xq(t,oct,e._translucentRenderStateCache,n)}function cct(e,t,n){return Xq(t,rct,e._translucentRenderStateCache,n)}function lct(e,t,n){return Xq(t,sct,e._alphaRenderStateCache,n)}var uct=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragData_0 = vec4(Ci * wzi, ai); + out_FragData_1 = vec4(ai * wzi); +`,fct=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; + float ai = czm_out_FragColor.a; + float wzi = czm_alphaWeight(ai); + out_FragColor = vec4(Ci, ai) * wzi; +`,dct=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function Kq(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return We.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +bool czm_discard = false; +`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; +${u}`}return a.sources.push(u),a.sources.push(`void main() +{ + czm_translucent_main(); + if (czm_discard) + { + discard; + } +${i}} +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function mct(e,t){return Kq(e,t,"translucentMRT",uct)}function hct(e,t){return Kq(e,t,"translucentMultipass",fct)}function pct(e,t){return Kq(e,t,"alphaMultipass",dct)}Yp.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=mct(t,e.shaderProgram),n.translucentCommand.renderState=act(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hct(t,e.shaderProgram),n.translucentCommand.renderState=cct(this,t,e.renderState),n.alphaCommand.shaderProgram=pct(t,e.shaderProgram),n.alphaCommand.renderState=lct(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function _ct(e,t,n,i,o,r){let s,a,c,{context:u,frameState:f}=t,{useLogDepth:d,shadowState:p}=f,g=t._hdr,h=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let b=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b);for(l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,b)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=d?s.derivedCommands.logDepth.command:s,s=g?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b);l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,b)),i.framebuffer=h}function gct(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,x;for(let b=0;b<o.length;++b)h=o[b],h=c?h.derivedCommands.logDepth.command:h,h=f?h.derivedCommands.hdr.command:h,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g);l(r)&&(h=r.unclassifiedCommand,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,g)),i.framebuffer=d}Yp.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){gct(this,e,t,n,i,o);return}_ct(this,e,t,n,i,o)};Yp.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Yp.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};Yp.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Yp.prototype.isDestroyed=function(){return!1};Yp.prototype.destroy=function(){return Ege(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var YV=Yp;function n1(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(n1.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function yct(e){e._framebuffer.destroy()}function xct(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Mc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}n1.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&xct(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};n1.prototype.isDestroyed=function(){return!1};n1.prototype.destroy=function(){return yct(this),ue(this)};var XV=n1;function o1(e){let t=new Mc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}o1.prototype.begin=function(e,t){let n=this._context,i=t.width,o=t.height;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var i1=new z;o1.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let h=4*((c-f)*t+u+a);i1.red=z.byteToFloat(o[h]),i1.green=z.byteToFloat(o[h+1]),i1.blue=z.byteToFloat(o[h+2]),i1.alpha=z.byteToFloat(o[h+3]);let x=i.getObjectByPickColor(i1);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let h=d;d=-p,p=h}u+=d,f+=p}};o1.prototype.isDestroyed=function(){return!1};o1.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var KV=o1;function Xp(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ui({color:new z(0,0,0,0),depth:1,owner:this})}function bct(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Xp.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Xp.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};Xp.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Xp.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Xp.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Xp.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Xp.prototype.isDestroyed=function(){return!1};Xp.prototype.destroy=function(){return bct(this),ue(this)};var _E=Xp;function Wx(){}Wx.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};Wx.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=We.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=We.replaceMain(o[u],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; +void main() +{ + czm_shadow_cast_main(); + v_positionEC = (czm_inverseProjection * gl_Position).xyz; +}`;o.push(c)}return new We({defines:i,sources:o})};Wx.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=We.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=We.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; +`),u+=`uniform vec4 shadowMap_lightPositionEC; +`),i?u+=`void main() +{ +`:u+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) + { + discard; + } +`,t?u+=` float distance = length(${s}); + if (distance >= shadowMap_lightPositionEC.w) + { + discard; + } + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?u+=` out_FragColor = vec4(1.0); +`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,u+=`} +`,r.push(u),new We({defines:o,sources:r})};Wx.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${f}${t}${n}${i}`};Wx.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new We({defines:i,sources:o})};Wx.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=We.findNormalVarying(e),s=!i&&l(r)||i&&o,a=We.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,h=t.debugCascadeColors,x=t.softShadows,b=d?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),T=e.sources.slice(0),A=T.length;for(let I=0;I<A;++I)T[I]=We.replaceMain(T[I],"czm_shadow_receive_main");d?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!d&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube; +`:S+=`uniform sampler2D shadowMap_texture; +`;let v;return c?v=` return vec4(${a}, 1.0); +`:v=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,S+=`uniform mat4 shadowMap_matrix; +uniform vec3 shadowMap_lightDirectionEC; +uniform vec4 shadowMap_lightPositionEC; +uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; +uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; +#ifdef LOG_DEPTH +in vec3 v_logPositionEC; +#endif +vec4 getPositionEC() +{ +${v}} +vec3 getNormalEC() +{ +${s?` return normalize(${r}); +`:` return vec3(1.0); +`}} +void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) +{ +${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; + float normalOffsetScale = 1.0 - nDotL; + vec3 offset = normalOffset * normalOffsetScale * normalEC; + positionEC.xyz += offset; +`:""}} +`,S+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,S+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; + float distance = length(directionEC); + directionEC = normalize(directionEC); + float radius = shadowMap_lightPositionEC.w; + // Stop early if the fragment is beyond the point light radius + if (distance > radius) + { + return; + } + vec3 directionWC = czm_inverseViewRotation * directionEC; + shadowParameters.depth = distance / radius; + shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + shadowParameters.texCoords = directionWC; + float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); +`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); + float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Spot light uses a perspective projection, so perform the perspective divide + shadowPosition /= shadowPosition.w; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; + // Stop early if the eye depth exceeds the last cascade + if (depth > maxDepth) + { + return; + } + // Get the cascade based on the eye-space depth + vec4 weights = czm_cascadeWeights(depth); + // Apply normal offset + float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + // Transform position into the cascade + vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; + // Get visibility + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); + // Fade out shadows that are far away + float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; + float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); + visibility = mix(visibility, 1.0, fade); +${h?` // Draw cascade colors for debugging + out_FragColor *= czm_cascadeColor(weights); +`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); + applyNormalOffset(positionEC, normalEC, nDotL); + vec4 shadowPosition = shadowMap_matrix * positionEC; + // Stop early if the fragment is not in the shadow bounds + if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) + { + return; + } + shadowParameters.texCoords = shadowPosition.xy; + shadowParameters.depth = shadowPosition.z; + shadowParameters.nDotL = nDotL; + float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); +`,S+=` out_FragColor.rgb *= visibility; +} +`,T.push(S),new We({defines:C,sources:T})};var Kp=Wx;function hh(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Wt.isInternetExplorer()||Wt.isEdge()||(Wt.isChrome()||Wt.isFirefox())&&Wt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=y(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new L,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new re,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new JV,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Or:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new re,new re],this._cascadeMatrices=[new L,new L,new L,new L],this._cascadeDistances=new re;let o;this._isPointLight?o=6:this._cascadesEnabled?o=this._numberOfCascades:o=1,this._passes=new Array(o);for(let r=0;r<o;++r)this._passes[r]=new Cct(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Zq(this),this._clearCommand=new ui({depth:1,color:new z}),this._clearPassState=new Mc(t),this._size=y(e.size,2048),this.size=this._size}hh.MAXIMUM_DISTANCE=2e4;function Cct(e){this.camera=new JV,this.passState=new Mc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Jq(e,t){return Ve.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Zq(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Jq(t,e._primitiveBias),e._terrainRenderState=Jq(t,e._terrainBias),e._pointRenderState=Jq(t,e._pointBias)}hh.prototype.debugCreateRenderStates=function(){Zq(this)};Object.defineProperties(hh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){wct(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function $q(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Tct(e,t){let n=new Vu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:il.DEPTH_COMPONENT16}),i=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=new pa({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Act(e,t){let n=new Lt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:lt.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),i=new pa({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Ect(e,t){let n=new Vu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:il.DEPTH_COMPONENT16}),i=new uc({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new pa({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function wge(e,t){e._isPointLight?Ect(e,t):e._usesDepthTexture?Act(e,t):Tct(e,t)}function Sct(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Zq(e),$q(e),wge(e,t))}function vct(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&($q(e),wge(e,t),Sct(e,t),Ige(e,t))}function Ige(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function wct(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Gt.maximumCubeMapSize>=t?t:Gt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Gt.maximumTextureSize>=t?t:Gt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Gt.maximumTextureSize>=t*2?t:Gt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new L(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Ict=new Ke;function Dct(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +in vec2 v_textureCoordinates; +void main() +{ + vec2 uv = v_textureCoordinates; + vec3 dir; + + if (uv.y < 0.5) + { + if (uv.x < 0.333) + { + dir.x = -1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 1.0; + } + else if (uv.x < 0.666) + { + dir.y = -1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 1.0; + } + else + { + dir.z = -1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 1.0; + } + } + else + { + if (uv.x < 0.333) + { + dir.x = 1.0; + dir.y = uv.x * 6.0 - 1.0; + dir.z = uv.y * 4.0 - 3.0; + } + else if (uv.x < 0.666) + { + dir.y = 1.0; + dir.x = uv.x * 6.0 - 3.0; + dir.z = uv.y * 4.0 - 3.0; + } + else + { + dir.z = 1.0; + dir.x = uv.x * 6.0 - 5.0; + dir.y = uv.y * 4.0 - 3.0; + } + } + + float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); + out_FragColor = vec4(vec3(shadow), 1.0); +} +`:n=`uniform sampler2D shadowMap_texture; +in vec2 v_textureCoordinates; +void main() +{ +${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; +`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); +`} out_FragColor = vec4(vec3(shadow), 1.0); +} +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ae.OVERLAY,i}function Pct(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Ict;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Dct(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var ph=new Array(8);ph[0]=new re(-1,-1,-1,1);ph[1]=new re(1,-1,-1,1);ph[2]=new re(1,1,-1,1);ph[3]=new re(-1,1,-1,1);ph[4]=new re(-1,-1,1,1);ph[5]=new re(1,-1,1,1);ph[6]=new re(1,1,1,1);ph[7]=new re(-1,1,1,1);var Dy=new L,Qq=new Array(8);for(let e=0;e<8;++e)Qq[e]=new re;function Oct(e,t){let n=new Tt({geometry:new tm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Ht.fromColor(t)}}),i=new Tt({geometry:new yg({radius:.5}),attributes:{color:Ht.fromColor(t)}});return new Dn({geometryInstances:[n,i],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Rct=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Mct=new m;function Lct(e,t){Pct(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new qp({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new qp({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new qp({camera:e._passes[i].camera,color:Rct[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Be.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,Mct),a=L.fromTranslationQuaternionRotationScale(i,o,s,Dy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Oct(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new qp({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function JV(){this.viewMatrix=new L,this.inverseViewMatrix=new L,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new L}JV.prototype.clone=function(e){L.clone(e.viewMatrix,this.viewMatrix),L.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var Nct=new L(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);JV.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return L.multiply(t,e,this.viewProjectionMatrix),L.multiply(Nct,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Fct=new Array(5),Bct=new wi,kct=new Array(4),Dge=new m,Pge=new m;function Uct(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=kct,g=Fct;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,_=o*Math.pow(u,F),E=o+c*F,w=P.lerp(E,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}re.unpack(g,0,e._cascadeSplits[0]),re.unpack(g,1,e._cascadeSplits[1]),re.unpack(p,0,e._cascadeDistances);let h=n.frustum,x=h.left,b=h.right,C=h.bottom,T=h.top,A=h.near,S=h.far,v=n.positionWC,I=n.directionWC,O=n.upWC,R=i.frustum.clone(Bct),N=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let F=L.multiply(R.projectionMatrix,i.viewMatrix,Dy),_=L.inverse(F,Dy),E=L.multiply(N,_,Dy),w=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Dge),D=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Pge);for(let G=0;G<8;++G){let k=re.clone(ph[G],Qq[G]);L.multiplyByVector(E,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,w,w),m.maximumByComponent(k,D,D)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,D.x=Math.min(D.x,1),D.y=Math.min(D.y,1),D.z=Math.min(D.z,1);let M=e._passes[a],B=M.camera;B.clone(n);let V=B.frustum;V.left=x+w.x*(b-x),V.right=x+D.x*(b-x),V.bottom=C+w.y*(T-C),V.top=C+D.y*(T-C),V.near=A+w.z*(S-A),V.far=A+D.z*(S-A),M.cullingVolume=B.frustum.computeCullingVolume(v,I,O);let U=e._cascadeMatrices[a];L.multiply(B.getViewProjection(),i.inverseViewMatrix,U),L.multiply(M.textureOffsets,U,U)}}var Vct=new L,zct=new m,Hct=new m,Sge=new m;function Gct(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=L.multiply(i.frustum.projectionMatrix,i.viewMatrix,Dy),r=L.inverse(o,Dy),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,zct);a=m.cross(c,s,Hct),m.normalize(a,a),m.normalize(c,c);let u=m.fromElements(0,0,0,Sge),f=L.computeView(u,s,a,c,Vct),d=L.multiply(f,r,Dy),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Dge),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Pge);for(let S=0;S<8;++S){let v=re.clone(ph[S],Qq[S]);L.multiplyByVector(d,v,v),m.divideByScalar(v,v.w,v),m.minimumByComponent(v,p,p),m.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let h=Sge;h.x=-(.5*(p.x+g.x)),h.y=-(.5*(p.y+g.y)),h.z=-g.z;let x=L.fromTranslation(h,Dy);f=L.multiply(x,f,f);let b=.5*(g.x-p.x),C=.5*(g.y-p.y),T=g.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-C,A.top=C,A.near=.01,A.far=T,L.clone(f,n.viewMatrix),L.inverse(f,n.inverseViewMatrix),L.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var Wct=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],jct=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],qct=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Yct(e,t){let n=new wi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Wct[i],o.upWC=jct[i],o.rightWC=qct[i],L.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),L.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Xct=new m,Kct=new m,Oge=new ae,vge=Oge.center;function Jct(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Oge;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Xct),s=m.negate(i.directionWC,Kct),a=m.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,vge),vge);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===tn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function Zct(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;L.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),L.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=ho.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Jct(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}hh.prototype.update=function(e){if(Zct(this,e),this._needsUpdate)if(vct(this,e.context),this._isPointLight&&Yct(this,e),this._cascadesEnabled&&(Gct(this,e),this._numberOfCascades>1&&Uct(this,e)),this._isPointLight)this._shadowMapCullingVolume=ss.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;L.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Lct(this,e)};hh.prototype.updatePass=function(e,t){Ige(this,e,t)};var $ct=new H;function Rge(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=$ct;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,re.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return re.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new re,combinedUniforms2:new re};return _t(t,o,!1)}function Qct(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ae.GLOBE,d=n.pass!==Ae.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,h=Kp.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let b=u.vertexShaderSource,C=u.fragmentShaderSource,T=Kp.createShadowCastVertexShader(b,p,f),A=Kp.createShadowCastFragmentShader(C,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:T,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=Rge(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}hh.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ae.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,h=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||h||n||g){let x=Kp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let b=Kp.createShadowReceiveVertexShader(a,u,f),C=Kp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Rge(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};hh.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Qct(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){$q(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var Py=hh;var gE=`uniform sampler2D colorTexture; + +#ifdef DEBUG_SHOW_DEPTH +uniform sampler2D u_packedTranslucentDepth; +#endif + +in vec2 v_textureCoordinates; + +void main() +{ +#ifdef DEBUG_SHOW_DEPTH + if (v_textureCoordinates.x < 0.5) + { + out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); + out_FragColor.a = 1.0; + } +#else + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef PICK + if (color == vec4(0.0)) + { + discard; + } +#else + // Reverse premultiplication process to get the correct composited result of the classification primitives + color.rgb /= color.a; +#endif + out_FragColor = color; +#endif +} +`;var elt=!1;function Oy(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ui({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Oy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Mge(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Lge(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function tlt(e,t,n,i){Mge(e),e._translucentDepthStencilTexture=new Lt({context:t,width:n,height:i,pixelFormat:lt.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:hn.NEAREST})}function nlt(e,t,n,i){Lge(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function ilt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(tlt(e,t,o,r),nlt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new We({sources:[yU]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new We({sources:[gE]}),a={colorTexture:function(){return e._textureToComposite}},elt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new We({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=nt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new We({sources:[gE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new We({sources:[gE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Ke.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Gn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Oy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<r;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(ilt(this,u,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<r;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};Oy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(o,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,o,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Oy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),olt(this,e,t)};function olt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Oy.prototype.isSupported=function(){return this._supported};Oy.prototype.isDestroyed=function(){return!1};Oy.prototype.destroy=function(){return Mge(this),Lge(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var ZV=Oy;function rlt(){this.command=void 0,this.near=void 0,this.far=void 0}function $V(e,t,n){let i=e.context,o;i.depthTexture&&(o=new jV);let r;e._useOIT&&i.depthTexture&&(r=new YV(i));let s=new Mc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=ho.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new KV(i),this.pickDepthFramebuffer=new XV,this.sceneFramebuffer=new _E,this.globeDepth=o,this.globeTranslucencyFramebuffer=new qV,this.oit=r,this.translucentTileClassification=new ZV(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Nge=new m,Fge=new m;function slt(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),o=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),o)}function alt(e,t,n){let i=1/Math.max(1,slt(e.position,t.position));return m.multiplyByScalar(e.position,i,Nge),m.multiplyByScalar(t.position,i,Fge),m.equalsEpsilon(Nge,Fge,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&L.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}$V.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return alt(t,n,P.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),ho.clone(t,n),!0)};function clt(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ne.SCENE2D,c=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n),isNaN(n)&&(n=r.frustum.near),isNaN(i)&&(i=r.frustum.far);let u;a?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let h=f[d];l(h)?(h.near=p,h.far=g):h=f[d]=new WV(p,g)}}function llt(e,t,n,i,o){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let r=e.frustumCommandsList,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.near,f=c.far;if(i>f)continue;if(o<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var Bge=new ss,ult=new Hc;$V.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,o=n.positionWC,r=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Ae.NUMBER_OF_PASSES;for(let E=0;E<u;++E)for(let w=0;w<f;++w)c[E].indices[w]=0;r.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,h=+Number.MAX_VALUE,x=-Number.MAX_VALUE,b=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,T=-Number.MAX_VALUE,A=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,v=t.cullingVolume,I=Bge.planes;for(let E=0;E<5;++E)I[E]=v.planes[E];v=Bge;let O=a.length;for(let E=0;E<O;++E){let w=a[E],D=w.pass;if(D===Ae.COMPUTE)r.push(w);else if(D===Ae.OVERLAY)s.push(w);else{let M,B,V=w.boundingVolume;if(l(V)){if(!e.isVisible(w,v,S))continue;let G=V.computePlaneDistances(o,i,ult);if(M=G.start,B=G.stop,h=Math.min(h,M),x=Math.max(x,B),b&&w.receiveShadows&&M<Py.MAXIMUM_DISTANCE&&!(D===Ae.GLOBE&&M<-100&&B>100)){let k=B-M;D!==Ae.GLOBE&&M<100&&(A=Math.min(A,k)),C=Math.min(C,M),T=Math.max(T,B)}}else w instanceof ui?(M=n.frustum.near,B=n.frustum.far):(M=n.frustum.near,B=n.frustum.far,h=Math.min(h,M),x=Math.max(x,B));let U=d[g];l(U)||(U=d[g]=new rlt),U.command=w,U.near=M,U.far=B,g++}}b&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),T=Math.max(Math.min(T,n.frustum.far),C)),b&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=T,t.shadowState.closestObjectSize=A),clt(this,e,h,x);let R,N;for(R=0;R<g;R++)N=d[R],llt(this,e,N.command,N.near,N.far);if(g<p)for(R=g;R<p&&(N=d[R],!!l(N.command));R++)N.command=void 0;let F=c.length,_=t.frustumSplits;_.length=F+1;for(let E=0;E<F;++E)_[E]=c[E].near,E===F-1&&(_[E+1]=c[E].far)};$V.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var yE=$V;var Uge=.1,flt=new Hd({pass:Fo.MOST_DETAILED_PRELOAD}),dlt=new Hd({pass:Fo.MOST_DETAILED_PICK}),eY=new Hd({pass:Fo.PICK});function Sa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new ho(e);n.frustum=new on({width:Uge,aspectRatio:1,near:.1}),this._pickOffscreenView=new yE(e,n,t)}Sa.prototype.update=function(){this._pickPositionCacheDirty=!0};Sa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new GV,n[t]=i),i};var mlt=new Or,hlt=new m,QV=new m,plt=new H,_lt=new L;function glt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=L.clone(r.transform,_lt);r._setTransform(L.IDENTITY);let d=m.clone(r.position,hlt);m.multiplyByScalar(r.right,c,QV),m.add(QV,d,d),m.multiplyByScalar(r.up,u,QV),m.add(QV,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&m.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,plt),g=mlt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,r.directionWC,r.upWC)}var ylt=new _l,xlt=new H;function blt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=d*a*c,h=s.getPixelDimensions(o.width,o.height,1,1,xlt),x=h.x*n*.5,b=h.y*i*.5,C=ylt;return C.top=g+b,C.bottom=g-b,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Vge(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof Or?glt(e,t,n,i,o):blt(e,t,n,i,o)}var xE=3,r1=3,_h=new Ke(0,0,xE,r1),zge=new H,tY=new z(0,0,0,0);Sa.prototype.pick=function(e,t,n,i){xE=y(n,3),r1=y(i,xE);let o=e.context,r=o.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=o.drawingBufferWidth,c.height=o.drawingBufferHeight;let u=a.passState;u.viewport=Ke.clone(c,u.viewport);let f=eo.transformWindowToDrawingBuffer(e,t,zge);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=Vge(e,f,xE,r1,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=eY,r.update(s),e.updateEnvironment(),_h.x=f.x-(xE-1)*.5,_h.y=e.drawingBufferHeight-f.y-(r1-1)*.5,_h.width=xE,_h.height=r1,u=a.pickFramebuffer.begin(_h,a.viewport),e.updateAndExecuteCommands(u,tY),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(_h);return o.endFrame(),d};function Clt(e,t){let n=e.context,i=e.frameState,o=e.environmentState,r=e.defaultView;e.view=r;let s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=r.passState;a.viewport=Ke.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=Vge(e,t,1,1,s),i.tilesetPassState=eY,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,a=r.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,tY),e.resolveFramebuffers(a),n.endFrame()}var Tlt=new wi,Alt=new _l,Elt=new on,Slt=new Or;Sa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let o=e.frameState,r=e.context,s=r.uniformState,a=e.defaultView;e.view=a;let c=eo.transformWindowToDrawingBuffer(e,t,zge);e.pickTranslucentDepth?Clt(e,c):(e.updateFrameState(),s.update(o),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(Tlt):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(Alt):l(u.frustum.width)?f=u.frustum.clone(Elt):f=u.frustum.clone(Slt);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(r,c.x,c.y);if(l(x)&&x>0&&x<1){let b=d[g],C;return e.mode===ne.SCENE2D?(C=u.position.z,u.position.z=C-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,s.update(o),s.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,s.updateFrustum(f)),n=eo.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===ne.SCENE2D&&(u.position.z=C,s.update(o)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var vlt=new me;Sa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,vlt);o.cartographicToCartesian(r,n)}return n};function Hge(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=bn.toValue(!1,i.show),s.push(i))),u instanceof ks&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=bn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Sa.prototype.drillPick=function(e,t,n,i,o){let r=this;return Hge(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var kge=new m,wlt=new m;function Ilt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Gge(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,kge),s=m.cross(o,r,kge),a=m.cross(o,s,wlt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Uge),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Dlt(e,t,n){let i=t.frameState,o=n.ray,r=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=Gge(e,o,r,a),u=flt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Sa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Dlt(this,e,t[n])&&t.splice(n--,1)};function Wge(e,t,n){let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Jl&&Wge(r,t,n))}}function ez(e,t,n,i,o,r){let s=[];if(Wge(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Ilt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Plt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Olt(e,t,n,i,o,r,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,Gge(e,n,o,f.camera),_h=Ke.clone(f.viewport,_h);let d=f.pickFramebuffer.begin(_h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=dlt:u.tilesetPassState=eY,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,tY),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(_h);if(t.context.depthTexture){let h=f.frustumCommandsList.length;for(let x=0;x<h;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let T=f.frustumCommandsList[x],A=T.near*(x!==0?t.opaqueFrustumNearOffset:1),S=T.far,v=A+C*(S-A);p=In.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&r||Plt(g,i)}}function jge(e,t,n,i,o,r,s,a){return Hge(i,function(){return Olt(e,t,n,o,r,s,a)})}function bE(e,t,n,i,o,r,s){let a=jge(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function qge(e,t,n,i,o,r,s,a){return jge(e,t,n,i,o,r,s,a)}function tz(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}Sa.prototype.pickFromRay=function(e,t,n,i){return bE(this,e,t,n,i,!1,!1)};Sa.prototype.drillPickFromRay=function(e,t,n,i,o){return qge(this,e,t,n,i,o,!1,!1)};Sa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=In.clone(t),n=l(n)?n.slice():n,tz(e,ez(o,e,t,n,i,function(){return bE(o,e,t,n,i,!1,!0)}))};Sa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=In.clone(t),i=l(i)?i.slice():i,tz(e,ez(r,e,t,i,o,function(){return qge(r,e,t,n,i,o,!1,!0)}))};var Rlt=new m,Mlt=new m,Llt=new In,Yge=new me;function nY(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=si._defaultMaxTerrainHeight,r=i.geodeticSurfaceNormalCartographic(t,Mlt),s=me.toCartesian(t,i,Rlt),a=Llt;a.origin=s,a.direction=r;let c=new In;return In.getPoint(a,o,c.origin),m.negate(r,c.direction),c}function Xge(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=me.fromCartesian(t,i,Yge);return nY(e,o)}function Kge(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return me.fromCartesian(t,i,Yge).height}function Nlt(e,t,n,i,o){let r=nY(t,n);return ez(e,t,r,i,o,function(){let s=bE(e,t,r,i,o,!0,!0);if(l(s))return Kge(t,s.position)})}function Flt(e,t,n,i,o,r){let s=Xge(t,n);return ez(e,t,s,i,o,function(){let a=bE(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}Sa.prototype.sampleHeight=function(e,t,n,i){let o=nY(e,t),r=bE(this,e,o,n,i,!0,!1);if(l(r))return Kge(e,r.position)};Sa.prototype.clampToHeight=function(e,t,n,i,o){let r=Xge(e,t),s=bE(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};Sa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Nlt(this,e,t[s],n,i);return tz(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Sa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Flt(this,e,t[s],n,i,t[s]);return tz(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Sa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var nz=Sa;var iz=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + color /= texture(autoExposure, vec2(0.5)).r; +#endif + color = czm_acesTonemapping(color); + color = czm_inverseGamma(color); + + out_FragColor = vec4(color, fragmentColor.a); +} +`;var oz=`uniform sampler2D randomTexture; +uniform sampler2D depthTexture; +uniform float intensity; +uniform float bias; +uniform float lengthCap; +uniform float stepSize; +uniform float frustumLength; + +in vec2 v_textureCoordinates; + +vec4 clipToEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); + posEC = posEC / posEC.w; + return posEC; +} + +//Reconstruct Normal Without Edge Removation +vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) +{ + vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); + vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); + vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); + vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); + + vec3 up = posInCamera.xyz - posInCameraUp.xyz; + vec3 down = posInCameraDown.xyz - posInCamera.xyz; + vec3 left = posInCamera.xyz - posInCameraLeft.xyz; + vec3 right = posInCameraRight.xyz - posInCamera.xyz; + + vec3 DX = length(left) < length(right) ? left : right; + vec3 DY = length(up) < length(down) ? up : down; + + return normalize(cross(DY, DX)); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = clipToEye(v_textureCoordinates, depth); + + if (posInCamera.z > frustumLength) + { + out_FragColor = vec4(1.0); + return; + } + + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); + float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); + float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); + float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); + vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); + + float ao = 0.0; + vec2 sampleDirection = vec2(1.0, 0.0); + float gapAngle = 90.0 * czm_radiansPerDegree; + + // RandomNoise + float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; + + //Loop for each direction + for (int i = 0; i < 4; i++) + { + float newGapAngle = gapAngle * (float(i) + randomVal); + float cosVal = cos(newGapAngle); + float sinVal = sin(newGapAngle); + + //Rotate Sampling Direction + vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); + float localAO = 0.0; + float localStepSize = stepSize; + + //Loop for each step + for (int j = 0; j < 6; j++) + { + vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; + + //Exception Handling + if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) + { + break; + } + + float stepDepthInfo = czm_readDepth(depthTexture, newCoords); + vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); + vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; + float len = length(diffVec); + + if (len > lengthCap) + { + break; + } + + float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); + float weight = len / lengthCap; + weight = 1.0 - weight * weight; + + if (dotVal < bias) + { + dotVal = 0.0; + } + + localAO = max(localAO, dotVal * weight); + localStepSize += stepSize; + } + ao += localAO; + } + + ao /= 4.0; + ao = 1.0 - clamp(ao, 0.0, 1.0); + ao = pow(ao, intensity); + out_FragColor = vec4(vec3(ao), 1.0); +} +`;var rz=`uniform sampler2D colorTexture; +uniform sampler2D ambientOcclusionTexture; +uniform bool ambientOcclusionOnly; +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); + out_FragColor = ambientOcclusionOnly ? ao : ao * color; +} +`;var sz=`uniform sampler2D colorTexture; +uniform float gradations; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = vec4(rgb, 1.0); + return; + } +#endif + float luminance = czm_luminance(rgb); + float darkness = luminance * gradations; + darkness = (darkness - fract(darkness)) / gradations; + out_FragColor = vec4(vec3(darkness), 1.0); +} +`;var az=`uniform sampler2D colorTexture; +uniform sampler2D bloomTexture; +uniform bool glowOnly; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + +#ifdef CZM_SELECTED_FEATURE + if (czm_selected()) { + out_FragColor = color; + return; + } +#endif + + vec4 bloom = texture(bloomTexture, v_textureCoordinates); + out_FragColor = glowOnly ? bloom : bloom + color; +} +`;var cz=`uniform sampler2D colorTexture; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 target = vec3(0.0); + out_FragColor = vec4(mix(target, rgb, brightness), 1.0); +} +`;var lz=`uniform sampler2D colorTexture; +uniform float contrast; +uniform float brightness; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; + sceneColor = czm_RGBToHSB(sceneColor); + sceneColor.z += brightness; + sceneColor = czm_HSBToRGB(sceneColor); + + float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); + sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); + out_FragColor = vec4(sceneColor, 1.0); +} +`;var uz=`uniform sampler2D colorTexture; +uniform sampler2D blurTexture; +uniform sampler2D depthTexture; +uniform float focalDistance; + +in vec2 v_textureCoordinates; + +vec4 toEye(vec2 uv, float depth) +{ + vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); + vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); + posInCamera = posInCamera / posInCamera.w; + return posInCamera; +} + +float computeDepthBlur(float depth) +{ + float f; + if (depth < focalDistance) + { + f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); + } + else + { + f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); + f = pow(f, 0.1); + } + f *= f; + f = clamp(f, 0.0, 1.0); + return pow(f, 0.5); +} + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + vec4 posInCamera = toEye(v_textureCoordinates, depth); + float d = computeDepthBlur(-posInCamera.z); + out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); +} +`;var fz=`uniform sampler2D depthTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float depth = czm_readDepth(depthTexture, v_textureCoordinates); + out_FragColor = vec4(vec3(depth), 1.0); +} +`;var dz=`uniform sampler2D depthTexture; +uniform float length; +uniform vec4 color; + +in vec2 v_textureCoordinates; + +void main(void) +{ + float directions[3]; + directions[0] = -1.0; + directions[1] = 0.0; + directions[2] = 1.0; + + float scalars[3]; + scalars[0] = 3.0; + scalars[1] = 10.0; + scalars[2] = 3.0; + + float padx = czm_pixelRatio / czm_viewport.z; + float pady = czm_pixelRatio / czm_viewport.w; + +#ifdef CZM_SELECTED_FEATURE + bool selected = false; + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + selected = selected || czm_selected(vec2(-padx, dir * pady)); + selected = selected || czm_selected(vec2(padx, dir * pady)); + selected = selected || czm_selected(vec2(dir * padx, -pady)); + selected = selected || czm_selected(vec2(dir * padx, pady)); + if (selected) + { + break; + } + } + if (!selected) + { + out_FragColor = vec4(color.rgb, 0.0); + return; + } +#endif + + float horizEdge = 0.0; + float vertEdge = 0.0; + + for (int i = 0; i < 3; ++i) + { + float dir = directions[i]; + float scale = scalars[i]; + + horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; + horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; + + vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; + vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; + } + + float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); + out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); +} +`;var mz=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See slides 142 and 143: +// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; + +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + + const float A = 0.22; // shoulder strength + const float B = 0.30; // linear strength + const float C = 0.10; // linear angle + const float D = 0.20; // toe strength + const float E = 0.01; // toe numerator + const float F = 0.30; // toe denominator + + const float white = 11.2; // linear white point value + + vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; + float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; + + c = czm_inverseGamma(c / w); + out_FragColor = vec4(c, fragmentColor.a); +} +`;var hz=`in vec2 v_textureCoordinates; + +uniform sampler2D colorTexture; + +const float fxaaQualitySubpix = 0.5; +const float fxaaQualityEdgeThreshold = 0.125; +const float fxaaQualityEdgeThresholdMin = 0.0833; + +void main() +{ + vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; + vec4 color = FxaaPixelShader( + v_textureCoordinates, + colorTexture, + fxaaQualityRcpFrame, + fxaaQualitySubpix, + fxaaQualityEdgeThreshold, + fxaaQualityEdgeThresholdMin); + float alpha = texture(colorTexture, v_textureCoordinates).a; + out_FragColor = vec4(color.rgb, alpha); +} +`;var jx=`#define SAMPLES 8 + +uniform float delta; +uniform float sigma; +uniform float direction; // 0.0 for x direction, 1.0 for y direction + +uniform sampler2D colorTexture; + +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif + +in vec2 v_textureCoordinates; + +// Incremental Computation of the Gaussian: +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html + +void main() +{ + vec2 st = v_textureCoordinates; + vec2 dir = vec2(1.0 - direction, direction); + +#ifdef USE_STEP_SIZE + vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); +#else + vec2 step = step; +#endif + + vec3 g; + g.x = 1.0 / (sqrt(czm_twoPi) * sigma); + g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); + g.z = g.y * g.y; + + vec4 result = texture(colorTexture, st) * g.x; + for (int i = 1; i < SAMPLES; ++i) + { + g.xy *= g.yz; + + vec2 offset = float(i) * dir * step; + result += texture(colorTexture, st - offset) * g.x; + result += texture(colorTexture, st + offset) * g.x; + } + + out_FragColor = result; +} +`;var pz=`uniform sampler2D colorTexture; +uniform sampler2D dirtTexture; +uniform sampler2D starTexture; +uniform vec2 dirtTextureDimensions; +uniform float distortion; +uniform float ghostDispersal; +uniform float haloWidth; +uniform float dirtAmount; +uniform float earthRadius; +uniform float intensity; + +in vec2 v_textureCoordinates; + +// whether it is in space or not +// 6500000.0 is empirical value +#define DISTANCE_TO_SPACE 6500000.0 + +// return ndc from world coordinate biased earthRadius +vec4 getNDCFromWC(vec3 WC, float earthRadius) +{ + vec4 positionEC = czm_view * vec4(WC, 1.0); + positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); +} + +// Check if current pixel is included Earth +// if then mask it gradually +float isInEarth(vec2 texcoord, vec2 sceneSize) +{ + vec2 NDC = texcoord * 2.0 - 1.0; + vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); + vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); + NDC.xy -= earthPosSC.xy; + + float X = abs(NDC.x) * sceneSize.x; + float Y = abs(NDC.y) * sceneSize.y; + + return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); +} + +// For Chromatic effect +vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) +{ + vec2 sceneSize = czm_viewport.zw; + vec3 color; + if(isSpace) + { + color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; + color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; + color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; + } + else + { + color.r = texture(tex, texcoord + direction * distortion.r).r; + color.g = texture(tex, texcoord + direction * distortion.g).g; + color.b = texture(tex, texcoord + direction * distortion.b).b; + } + return vec4(clamp(color, 0.0, 1.0), 0.0); +} + +void main(void) +{ + vec4 originalColor = texture(colorTexture, v_textureCoordinates); + vec3 rgb = originalColor.rgb; + bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; + + // Sun position + vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); + vec4 sunPositionEC = czm_view * sunPos; + vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); + sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); + + // If sun is not in the screen space, use original color. + if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) + { + // Lens flare is disabled when not in space until #5932 is fixed. + // https://github.com/CesiumGS/cesium/issues/5932 + out_FragColor = originalColor; + return; + } + + vec2 texcoord = vec2(1.0) - v_textureCoordinates; + vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; + vec2 invPixelSize = 1.0 / pixelSize; + vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); + + // ghost vector to image centre: + vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; + vec3 direction = normalize(vec3(ghostVec, 0.0)); + + // sample ghosts: + vec4 result = vec4(0.0); + vec4 ghost = vec4(0.0); + for (int i = 0; i < 4; ++i) + { + vec2 offset = fract(texcoord + ghostVec * float(i)); + // Only bright spots from the centre of the source image + ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); + } + result += ghost; + + // sample halo + vec2 haloVec = normalize(ghostVec) * haloWidth; + float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); + weightForHalo = pow(1.0 - weightForHalo, 5.0); + + result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; + + // dirt on lens + vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; + if (dirtTexCoords.x > 1.0) + { + dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); + } + if (dirtTexCoords.y > 1.0) + { + dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); + } + result += dirtAmount * texture(dirtTexture, dirtTexCoords); + + // Rotating starburst texture's coordinate + // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) + float camrot = czm_view[0].z + czm_view[1].y; + float cosValue = cos(camrot); + float sinValue = sin(camrot); + mat3 rotation = mat3( + cosValue, -sinValue, 0.0, + sinValue, cosValue, 0.0, + 0.0, 0.0, 1.0 + ); + + vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); + vec3 st2 = vec3((rotation * st1).xy, 1.0); + vec3 st3 = st2 * 0.5 + vec3(0.5); + vec2 lensStarTexcoord = st3.xy; + float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); + float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); + + if (!isSpace) + { + result *= oneMinusWeightForLensFlare * intensity * 0.2; + } + else + { + result *= oneMinusWeightForLensFlare * intensity; + result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; + } + + result += texture(colorTexture, v_textureCoordinates); + + out_FragColor = result; +} +`;var _z=`uniform sampler2D colorTexture; +uniform vec3 white; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 4: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = (color * (1.0 + color / white)) / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var gz=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; + vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; + vec3 green = vec3(0.0, 1.0, 0.0); + out_FragColor = vec4((noiseValue + rgb) * green, 1.0); +} +`;var yz=`uniform sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#endif + +// See equation 3: +// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf + +void main() +{ + vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); + vec3 color = fragmentColor.rgb; +#ifdef AUTO_EXPOSURE + float exposure = texture(autoExposure, vec2(0.5)).r; + color /= exposure; +#endif + color = color / (1.0 + color); + color = czm_inverseGamma(color); + out_FragColor = vec4(color, fragmentColor.a); +} +`;var xz=`uniform sampler2D colorTexture; +uniform sampler2D silhouetteTexture; + +in vec2 v_textureCoordinates; + +void main(void) +{ + vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); + vec4 color = texture(colorTexture, v_textureCoordinates); + out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); +} +`;function qx(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(qx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Jge(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Blt(e,t){Jge(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Zge(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function klt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Ult(e,t){let n=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +float sampleTexture(vec2 offset) { +`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); + return czm_luminance(color.rgb); +`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r; +`,n+=`} + +`,n+=`uniform vec2 colorTextureDimensions; +uniform vec2 minMaxLuminance; +uniform sampler2D previousLuminance; +void main() { + float color = 0.0; + float xStep = 1.0 / colorTextureDimensions.x; + float yStep = 1.0 / colorTextureDimensions.y; + int count = 0; + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + vec2 offset; + offset.x = -xStep + float(i) * xStep; + offset.y = -yStep + float(j) * yStep; + if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { + continue; + } + color += sampleTexture(offset); + ++count; + } + } + if (count > 0) { + color /= float(count); + } +`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r; + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); + color = previous + (color - previous) / (60.0 * 1.5); + color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); +`),n+=` out_FragColor = vec4(color); +} +`,n}function Vlt(e,t){Zge(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Ult(r,i),{framebuffer:n[r].framebuffer,uniformMap:klt(e,r)});e._commands=o}qx.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};qx.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Blt(this,e),Vlt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};qx.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};qx.prototype.isDestroyed=function(){return!1};qx.prototype.destroy=function(){return Jge(this),Zge(this),ue(this)};var bz=qx;var zlt={NEAREST:0,LINEAR:1},Cf=zlt;function Yx(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,lt.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,Cf.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,Je.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let o=new Mc;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=jn()),this._name=r,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Yx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Hlt=/uniform\s+sampler2D\s+depthTexture/g;Yx.prototype._isSupported=function(e){return!Hlt.test(this._fragmentShader)||e.depthTexture};function Glt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Lt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Lt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function Wlt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function jlt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function qlt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i)if(i.hasOwnProperty(r)){typeof i[r]!="function"?(t[r]=Wlt(e,r),n[r]=Glt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Lt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=jlt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=_t(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Ylt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE +uniform sampler2D czm_idTexture; +uniform sampler2D czm_selectedIdTexture; +uniform float czm_selectedIdTextureStep; +in vec2 v_textureCoordinates; +bool czm_selected(vec2 offset) +{ + bool selected = false; + vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); + for (int i = 0; i < ${o}; ++i) + { + vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); + if (all(equal(id, selectedId))) + { + return true; + } + } + return false; +} + +bool czm_selected() +{ + return czm_selected(vec2(0.0)); +} + +${n}`}let i=new We({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Xlt(e){let t=e._sampleMode,n,i;t===Cf.LINEAR?(n=un.LINEAR,i=Si.LINEAR):(n=un.NEAREST,i=Si.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Klt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Jlt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Zlt(e,t){let n,i,o,r=e._texturesToRelease,s=r.length;for(n=0;n<s;++n)i=r[n],i=i&&i.destroy();r.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];o=d.name;let p=d.source;e._actualUniforms[o]=new Lt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){o=c[n];let d=u[o],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[o]=Jlt(e,d);else if(typeof d=="string"){let g=new ve({url:d});f.push(g.fetchImage().then(Klt(e,o)))}else e._texturesToCreate.push({name:o,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function $ge(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i)i.hasOwnProperty(o)&&i[o]instanceof Lt&&(l(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function $lt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function Qlt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,o,r=0,s=n.length;for(i=0;i<s;++i)o=n[i],l(o.pickIds)?r+=o.pickIds.length:l(o.pickId)&&++r;if(s===0||r===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:hn.NEAREST});return}let a,c=0,u=new Uint8Array(r*4);for(i=0;i<s;++i)if(o=n[i],l(o.pickIds)){let f=o.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(o.pickId)&&(a=o.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:u,width:r,height:1},sampler:hn.NEAREST})}Yx.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&$ge(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=$lt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,Qlt(this,e),qlt(this),Zlt(this,e),Ylt(this,e),Xlt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};Yx.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,hn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};Yx.prototype.isDestroyed=function(){return!1};Yx.prototype.destroy=function(){return $ge(this),ue(this)};var Co=Yx;function Xx(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=jn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(Xx.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});Xx.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};Xx.prototype.get=function(e){return this._stages[e]};function eut(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}Xx.prototype.update=function(e,t){this._selectedDirty=eut(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Cl=Xx;var Dr={};function Cz(e){let o=`#define USE_STEP_SIZE +${jx}`,r=new Co({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Cf.LINEAR}),s=new Co({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Cf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Cl({name:e,stages:[r,s],uniforms:a})}Dr.createBlurStage=function(){return Cz("czm_blur")};Dr.createDepthOfFieldStage=function(){let e=Cz("czm_depth_of_field_blur"),t=new Co({name:"czm_depth_of_field_composite",fragmentShader:uz,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Cl({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Dr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Dr.createEdgeDetectionStage=function(){let e=jn();return new Co({name:`czm_edge_detection_${e}`,fragmentShader:dz,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Dr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function tut(e){if(!l(e))return Dr.createEdgeDetectionStage();let t=new Cl({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +`,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); + if (edge${a}.a > 0.0) + { + color = edge${a}; + break; + } +`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; +void main() { + vec4 color = vec4(0.0); + for (int i = 0; i < ${e.length}; i++) + { +${o} } + out_FragColor = color; +} +`,s=new Co({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Cl({name:"czm_edge_detection_composite",stages:[t,s]})}Dr.createSilhouetteStage=function(e){let t=tut(e),n=new Co({name:"czm_silhouette_color_edges",fragmentShader:xz,uniforms:{silhouetteTexture:t.name}});return new Cl({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Dr.isSilhouetteSupported=function(e){return e.context.depthTexture};Dr.createBloomStage=function(){let e=new Co({name:"czm_bloom_contrast_bias",fragmentShader:lz,uniforms:{contrast:128,brightness:-.3}}),t=Cz("czm_bloom_blur"),n=new Cl({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Co({name:"czm_bloom_generate_composite",fragmentShader:az,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Cl({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Dr.createAmbientOcclusionStage=function(){let e=new Co({name:"czm_ambient_occlusion_generate",fragmentShader:oz,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=Cz("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Cl({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new Co({name:"czm_ambient_occlusion_composite",fragmentShader:rz,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new Cl({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Dr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var nut=`#define FXAA_QUALITY_PRESET 39 +${TU} +${hz}`;Dr.createFXAAStage=function(){return new Co({name:"czm_FXAA",fragmentShader:nut,sampleMode:Cf.LINEAR})};Dr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=iz,new Co({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Dr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=mz,new Co({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Dr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=yz,new Co({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Dr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=_z,new Co({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Dr.createAutoExposureStage=function(){return new bz};Dr.createBlackAndWhiteStage=function(){return new Co({name:"czm_black_and_white",fragmentShader:sz,uniforms:{gradations:5}})};Dr.createBrightnessStage=function(){return new Co({name:"czm_brightness",fragmentShader:cz,uniforms:{brightness:.5}})};Dr.createNightVisionStage=function(){return new Co({name:"czm_night_vision",fragmentShader:gz})};Dr.createDepthViewStage=function(){return new Co({name:"czm_depth_view",fragmentShader:fz})};Dr.createLensFlareStage=function(){return new Co({name:"czm_lens_flare",fragmentShader:pz,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:oe.WGS84.maximumRadius}})};var Wd=Dr;function Jp(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function a1(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function iY(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[a1(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[a1(d)]=!0)}}}return i.name}function s1(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=s1(e,t,n,p,o):a=iY(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=a1(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=a1(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[a1(i.get(p))]=!0}return a}function iut(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=s1(e,t,n,i,void 0);a=s1(e,t,n,o,a),a=iY(e,t,n,r,a),a=s1(e,t,n,e,a),iY(e,t,n,s,a)}else s1(e,t,n,e,void 0);return n}function out(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let h=d.stages,x=h.length,b=!1;for(let C=0;C<x;++C)if(n[h[C]]){b=!0;break}if(!b)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function rut(e,t){let n=iut(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=out(e,i,n[i]))}function oY(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function sut(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new ui({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}Jp.prototype.updateDependencies=function(){this._updateDependencies=!0};Jp.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(oY(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&rut(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,oY(this),sut(this,e))};Jp.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Jp.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Jp.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Jp.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};Jp.prototype.isDestroyed=function(){return!1};Jp.prototype.destroy=function(){return oY(this),ue(this)};var CE=Jp;var c1={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===c1.REINHARD||e===c1.MODIFIED_REINHARD||e===c1.FILMIC||e===c1.ACES}},Kx=Object.freeze(c1);var rY=[];function Nc(){let e=Wd.createFXAAStage(),t=Wd.createAmbientOcclusionStage(),n=Wd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Wd.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Kx.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new CE(this),r={},s=rY;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Nc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return sY(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Kx.REINHARD:n=Wd.createReinhardTonemappingStage(t);break;case Kx.MODIFIED_REINHARD:n=Wd.createModifiedReinhardTonemappingStage(t);break;case Kx.FILMIC:n=Wd.createFilmicTonemappingStage(t);break;default:n=Wd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function sY(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._stages=t}Nc.prototype.add=function(e){let t=this._stageNames,n=rY;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Nc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=rY;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Nc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Nc.prototype.get=function(e){return sY(this),this._stages[e]};Nc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Nc.prototype.getStageByName=function(e){return this._stageNames[e]};Nc.prototype.update=function(e,t,n){sY(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages,s=o.length=r.length,a,c,u=0;for(a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&(o[u++]=c);o.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(o[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,x=this._fxaa;h.enabled=n;let b=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),T=h.enabled&&h._isSupported(e),A=x.enabled&&x._isSupported(e);if((f||this._textureCacheDirty||b!==this._aoEnabled||C!==this._bloomEnabled||T!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=C,this._tonemappingEnabled=T,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Lt({context:e,pixelFormat:lt.RGB,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new hn({wrapS:On.REPEAT,wrapT:On.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=r.length,a=0;a<s;++a)r[a].update(e,t);for(u=0,a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==o.length,f&&this.update(e,t,n)};Nc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Jx(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Nc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return Jx(t)};function gh(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}let r=e.length,s;if(e.inputPreviousStageTexture)for(gh(e.get(0),t,n,i,o),s=1;s<r;++s)gh(e.get(s),t,Jx(e.get(s-1)),i,o);else for(s=0;s<r;++s)gh(e.get(s),t,n,i,o)}Nc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!h&&r===0)return;let b=t;d&&a.ready&&(gh(a,e,b,n,i),b=Jx(a)),p&&c.ready&&(gh(c,e,b,n,i),b=Jx(c)),g&&u.ready&&gh(u,e,b,n,i),h&&f.ready&&(gh(f,e,b,n,i),b=Jx(f));let C=b;if(r>0){gh(o[0],e,b,n,i);for(let T=1;T<r;++T)gh(o[T],e,Jx(o[T-1]),n,i);C=Jx(o[r-1])}x&&s.ready&&gh(s,e,C,n,i)};Nc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Nc.prototype.isDestroyed=function(){return!1};Nc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var Tz=Nc;function Zx(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Zx.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};Zx.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(L.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?Uut(this,e):qut(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var aut=new m,cut=new m,lut=new m,uut=new m,fut=new m,dut=new m,mut=new m,hut=new me,put=new L,_ut=new wi,gut=new on,yut={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};Zx.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(L.IDENTITY);let i=aut,o=cut,r=lut;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(u.positionWC,i),m.clone(u.directionWC,o),m.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,mut),d=Mt.eastNorthUpToFixedFrame(f,t,put);L.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,hut),i),L.multiplyByPointAsVector(d,o,o),L.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=gut,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=_ut,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=yut;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Xut(a);l1(this,c),this._previousMode===ne.SCENE2D?Yut(this,e,a,c):(a.position2D=L.multiplyByPoint(ho.TRANSFORM_2D,i,uut),a.direction2D=L.multiplyByPointAsVector(ho.TRANSFORM_2D,o,fut),a.up2D=L.multiplyByPointAsVector(ho.TRANSFORM_2D,r,dut),n._mode=ne.MORPHING,lye(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var lY={position:new m,direction:new m,up:new m,frustum:void 0},eye=new wi;Zx.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(L.IDENTITY),this._previousMode===ne.SCENE2D)Dut(this,e,t);else{let i;e>0?(i=lY,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=tye(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=eye,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=fye(i);l1(this,s),cY(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};Zx.prototype.isDestroyed=function(){return!1};Zx.prototype.destroy=function(){return Az(this),ue(this)};function l1(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new _f(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Tn.LEFT_DOWN),e._morphHandler.setInputAction(n,Tn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Tn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Tn.WHEEL)}}function Az(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var xut=new me,but=new m,Cut=new L;function tye(e,t){let n=e._scene,i=n.camera,o=lY,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,xut);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,but),f=Mt.eastNorthUpToFixedFrame(u,t,Cut);return L.multiplyByPointAsVector(f,i.direction,s),L.multiplyByPointAsVector(f,i.up,a),o}var Tut=new m,Aut=new m,Eut=new m,Sut=new m,vut=new m,wut=new m;function cY(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,Tut),a=m.clone(r.direction,Aut),c=m.clone(r.up,Eut),u=L.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,n.position,Sut),f=L.multiplyByPointAsVector(ho.TRANSFORM_2D_INVERSE,n.direction,vut),d=L.multiplyByPointAsVector(ho.TRANSFORM_2D_INVERSE,n.up,wut);function p(h){Tf(s,u,h.time,r.position),Tf(a,f,h.time,r.direction),Tf(c,d,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){uye(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Iut=new on,nye=new m,iye=new m,oye=new m,uY=new m,rye=new m,sye=new m;function Dut(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=lY,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=tye(e,n));let s;e._morphToOrthographic?(s=Iut,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=eye,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=fye(r);l1(e,a);let c;e._morphToOrthographic?c=function(){cY(e,t,r,a)}:c=function(){cye(e,t,r,function(){cY(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,uY),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Tf(e,t,n,i){return m.lerp(e,t,n,i)}function aye(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=r.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var Put=new m,Out=new m,Rut=new m,aY=new m,Mut=new m,Lut=new m,Nut=new Or,Fut=new In,But=new m,kut={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Uut(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,Put),r=m.clone(i.direction,Out),s=m.clone(i.up,Rut),a=m.negate(m.UNIT_Z,Mut),c=m.clone(m.UNIT_Y,Lut),u=aY;if(t>0)m.clone(m.ZERO,aY),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(o,aY);let b=Fut;L.multiplyByPoint(ho.TRANSFORM_2D,o,b.origin),L.multiplyByPointAsVector(ho.TRANSFORM_2D,r,b.direction);let C=n.globe;if(l(C)){let T=C.pickWorldCoordinates(b,n,!0,But);l(T)&&(L.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,T,u),u.z+=m.distance(o,u))}}let f=Nut;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=kut;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=dye(d);l1(e,p);function g(b){Tf(o,u,b.time,i.position),Tf(r,a,b.time,i.direction),Tf(s,c,b.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(b,C){b.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){aye(e,t,d,h,p)}});e._currentTweens.push(x)}var Qge=new me,Vut={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Or},zut={position:new m,direction:new m,up:new m,frustum:void 0},Hut=new m,Gut=new In,Wut=new L,jut=new m;function qut(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Vut;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,Qge),i.mapProjection.project(Qge,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let d=Gut;m.clone(r.position2D,d.origin);let p=m.clone(o.directionWC,d.direction),g=n.scaleToGeodeticSurface(o.positionWC,jut),h=Mt.eastNorthUpToFixedFrame(g,n,Wut);L.inverseTransformation(h,h),L.multiplyByPointAsVector(h,p,p),L.multiplyByPointAsVector(ho.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(d,i,!0,Hut);if(l(b)){let C=m.distance(r.position2D,b);b.x+=C,m.clone(b,r.position2D)}}}function s(d,p){d.position.x=p}L.multiplyByPoint(ho.TRANSFORM_2D,r.position,r.position2D),L.multiplyByPointAsVector(ho.TRANSFORM_2D,r.direction,r.direction2D),L.multiplyByPointAsVector(ho.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=zut;L.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let u=dye(c);l1(e,u);function f(){aye(e,t,r,s,u)}lye(e,t,r,f)}function cye(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Yut(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,uY),a=m.clone(n.direction,rye),c=m.clone(n.up,sye);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=m.clone(r.position,nye),d=m.clone(r.direction,iye),p=m.clone(r.up,oye);f.z=s.z;function g(x){Tf(f,s,x.time,r.position),Tf(d,a,x.time,r.direction),Tf(p,c,x.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let h=o.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():cye(e,0,n,u)}function lye(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,nye),a=m.clone(r.direction,iye),c=m.clone(r.up,oye),u=m.clone(n.position2D,uY),f=m.clone(n.direction2D,rye),d=m.clone(n.up2D,sye);function p(h){Tf(s,u,h.time,r.position),Tf(a,f,h.time,r.direction),Tf(c,d,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Br.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){uye(e,o,1,0,t,i)}});e._currentTweens.push(g)}function uye(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Br.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function fye(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),Az(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function dye(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),Az(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function Xut(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),Az(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var Ez=Zx;var Kut={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Bi=Object.freeze(Kut);function ic(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Jut(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function mye(e,t,n){let i=ic(Bi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new H;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},Tn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Tn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(Jut(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Tn.PINCH_MOVE,t)}function hye(e,t){let n=ic(Bi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Tn.WHEEL,t)}function TE(e,t,n){let i=ic(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;o[i]=!1,r[i]=new H;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let u,f;n===Bi.LEFT_DRAG?(u=Tn.LEFT_DOWN,f=Tn.LEFT_UP):n===Bi.RIGHT_DRAG?(u=Tn.RIGHT_DOWN,f=Tn.RIGHT_UP):n===Bi.MIDDLE_DRAG&&(u=Tn.MIDDLE_DOWN,f=Tn.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,o[i]=!0,s[i]=new Date,H.clone(d.position,r[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,a[i]=new Date},f,t)}function pye(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function _ye(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Bi)if(Bi.hasOwnProperty(s)){let a=Bi[s];if(l(a)){let c=ic(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new H,endPosition:new H,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Bi)if(Bi.hasOwnProperty(a)){let c=Bi[a];if(l(c)){let u=ic(c,t);r[u]&&(n[u]?(pye(i[u],o[u]),o[u].valid=!0,pye(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},Tn.MOUSE_MOVE,t)}function Af(e){this._eventHandler=new _f(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,hye(this,void 0),mye(this,void 0,e),TE(this,void 0,Bi.LEFT_DRAG),TE(this,void 0,Bi.RIGHT_DRAG),TE(this,void 0,Bi.MIDDLE_DRAG),_ye(this,void 0);for(let t in Ta)if(Ta.hasOwnProperty(t)){let n=Ta[t];l(n)&&(hye(this,n),mye(this,n,e),TE(this,n,Bi.LEFT_DRAG),TE(this,n,Bi.RIGHT_DRAG),TE(this,n,Bi.MIDDLE_DRAG),_ye(this,n))}}Object.defineProperties(Af.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ic(Bi.WHEEL)]||!this._update[ic(Bi.WHEEL,Ta.SHIFT)]||!this._update[ic(Bi.WHEEL,Ta.CTRL)]||!this._update[ic(Bi.WHEEL,Ta.ALT)];return this._buttonsDown>0||e}}});Af.prototype.isMoving=function(e,t){let n=ic(e,t);return!this._update[n]};Af.prototype.getMovement=function(e,t){let n=ic(e,t);return this._movement[n]};Af.prototype.getLastMovement=function(e,t){let n=ic(e,t),i=this._lastMovement[n];if(i.valid)return i};Af.prototype.isButtonDown=function(e,t){let n=ic(e,t);return this._isDown[n]};Af.prototype.getStartMousePosition=function(e,t){if(e===Bi.WHEEL)return this._currentMousePosition;let n=ic(e,t);return this._eventStartPosition[n]};Af.prototype.getButtonPressTime=function(e,t){let n=ic(e,t);return this._pressTime[n]};Af.prototype.getButtonReleaseTime=function(e,t){let n=ic(e,t);return this._releaseTime[n]};Af.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var Sz=Af;function vz(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(vz.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});vz.prototype.cancelTween=function(){this._tweens.remove(this)};function jd(){this._tweens=[]}Object.defineProperties(jd.prototype,{length:{get:function(){return this._tweens.length}}});jd.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new vz(this);let t=e.duration/$n.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/$n.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Br.LINEAR_NONE),r=e.startObject,s=new Bde(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new vz(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};jd.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};jd.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};jd.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};jd.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};jd.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};jd.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};jd.prototype.get=function(e){return this._tweens[e]};jd.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/$n.SECONDS_PER_MILLISECOND:Ti();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var AE=jd;function f1(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Bi.LEFT_DRAG,this.zoomEventTypes=[Bi.RIGHT_DRAG,Bi.WHEEL,Bi.PINCH],this.rotateEventTypes=Bi.LEFT_DRAG,this.tiltEventTypes=[Bi.MIDDLE_DRAG,Bi.PINCH,{eventType:Bi.LEFT_DRAG,modifier:Ta.CTRL},{eventType:Bi.RIGHT_DRAG,modifier:Ta.CTRL}],this.lookEventTypes={eventType:Bi.LEFT_DRAG,modifier:Ta.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new Sz(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new AE,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new H,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new me(Math.PI,P.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Zut(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function $ut(e){return H.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Qut=.4;function eft(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Qut){let g=Zut(p,i),h=e.getLastMovement(t,n);if(!l(h)||$ut(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function tft(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var gye=[];function Fc(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(gye[0]=n,n=gye);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),tft(e,r)):o<1&&eft(s,f,d,o,i,e,r))}}var wz=new In,nft=new m,ift=new H,oft=new m,rft=new H,sft=new m,aft=new m,cft=new m,lft=new m,Dye=new m,uft=new m,fft=new m,dft=new m,mft=new m,hft=new m,pft=new m,_ft=new m,gft=new m,yft=new m,xft=new m,$x=new m,yye=new m,xye=new m,fY={orientation:new lc};function xY(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(o-u)<1||h<0&&Math.abs(o-f)<1)return;o-h<u?h=o-u-1:o-h>f&&(h=o-f)}let x=e._scene,b=x.camera,C=x.mode,T=fY.orientation;if(T.heading=b.heading,T.pitch=b.pitch,T.roll=b.roll,b.frustum instanceof on){Math.abs(h)>0&&(b.zoomIn(h),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,v=e._rotatingZoom,I;if(A||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),l(e._globe)&&C===ne.SCENE2D?(I=b.getPickRay(t,wz).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=Zp(e,t,nft)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(h);return}let O=C===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(C===ne.SCENE2D){let R=e._zoomWorldPosition,N=b.position;if(!m.equals(R,N)&&b.positionCartographic.height<e._maxCoord.x*2){let F=b.position.x,_=m.subtract(R,N,oft);m.normalize(_,_);let E=m.distance(R,N)*h/(b.getMagnitude()*.5);b.move(_,E*.5),(b.position.x<0&&F>0||b.position.x>0&&F<0)&&(I=b.getPickRay(t,wz).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let R=m.normalize(b.position,Dye);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(m.dot(b.direction,R))<.6)O=!0;else{let N=x.canvas,F=rft;F.x=N.clientWidth/2,F.y=N.clientHeight/2;let _=Zp(e,F,sft);if(!l(_))O=!0;else if(b.positionCartographic.height<1e6)if(m.dot(b.direction,R)>=-.5)O=!0;else{let E=fft;m.clone(b.position,E);let w=e._zoomWorldPosition,D=uft;if(D=m.normalize(w,D),m.dot(D,R)<0)return;let M=xft,B=hft;m.clone(b.direction,B),m.add(E,m.multiplyByScalar(B,1e3,$x),M);let V=pft,U=_ft;m.subtract(w,E,V),m.normalize(V,U);let G=m.dot(R,U);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),Y=m.magnitude(E),j=m.magnitude(w),$=Y-h,W=m.magnitude(V),K=Math.asin(P.clamp(W/j*Math.sin(k),-1,1)),J=Math.asin(P.clamp($/j*Math.sin(k),-1,1)),he=K-J+k,ge=dft;m.normalize(E,ge);let se=mft;se=m.cross(U,ge,se),se=m.normalize(se,se),m.normalize(m.cross(ge,se,$x),B),m.multiplyByScalar(m.normalize(M,$x),m.magnitude(M)-h,M),m.normalize(E,E),m.multiplyByScalar(E,$,E);let pe=gft;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,yye),m.multiplyByScalar(B,Math.sin(he),xye),$x),$,pe),m.add(E,pe,E),m.normalize(M,ge),m.normalize(m.cross(ge,se,$x),B);let xe=yft;m.multiplyByScalar(m.add(m.multiplyByScalar(ge,Math.cos(he)-1,yye),m.multiplyByScalar(B,Math.sin(he),xye),$x),m.magnitude(M),xe),m.add(M,xe,M),m.clone(E,b.position),m.normalize(m.subtract(M,E,$x),b.direction),m.clone(b.direction,b.direction),m.cross(b.direction,b.up,b.right),m.cross(b.right,b.direction,b.up),b.setView(fY);return}else{let E=m.normalize(_,aft),w=m.normalize(e._zoomWorldPosition,cft),D=m.dot(w,E);if(D>0&&D<1){let M=P.acosClamped(D),B=m.cross(w,E,lft),V=Math.abs(M)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-h,U=h/V;b.rotate(B,M*U)}}}}e._rotatingZoom=!O}if(!A&&O||S){let R,N=eo.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,ift);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&l(N)?R=b.getPickRay(N,wz):R=b.getPickRay(t,wz);let F=R.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(F.y,F.z,F.x,F),b.move(F,h),e._zoomingOnVector=!0}else b.zoomIn(h);e._cameraUnderground||b.setView(fY)}var bft=new In,Cft=new In,Tft=new m;function Aft(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,bft).origin,s=o.getPickRay(n.endPosition,Cft).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,Tft),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function bye(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;xY(e,t,n,e._zoomFactor,o.getMagnitude())}var Eft=new H,Sft=new H;function Cye(e,t,n){if(l(n.angleAndHeight)){vft(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=Eft;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let u=Sft;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;o.twistRight(p)}function vft(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function wft(e){let t=e._scene.mapMode2D===yu.ROTATE;L.equals(L.IDENTITY,e._scene.camera.transform)?(Fc(e,e.enableTranslate,e.translateEventTypes,Aft,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Fc(e,e.enableZoom,e.zoomEventTypes,bye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Fc(e,e.enableRotate,e.tiltEventTypes,Cye,e.inertiaSpin,"_lastInertiaTiltMovement")):(Fc(e,e.enableZoom,e.zoomEventTypes,bye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Fc(e,e.enableRotate,e.translateEventTypes,Cye,e.inertiaSpin,"_lastInertiaSpinMovement"))}var Pye=new In,Ift=new m,Dft=new m;function Zp(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Ift)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,Pye),u=o.pickWorldCoordinates(c,i,a,Dft),f=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?m.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(s,n):m.clone(u,n)}var Pft=new me;function Lz(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,Pft);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var Oft=new m;function Oye(e,t){let n=t.origin,i=t.direction,o=Lz(e),r=m.normalize(n,Oft),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function Rye(e,t,n,i){let o=m.distance(t.origin,n),r=Lz(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),In.getPoint(t,o,i)}function Mye(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=Lz(e))):o=Lz(e),In.getPoint(t,o,i)}var Rft=new H;function Lye(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,Rft),o=e._strafeEndMousePosition;H.add(o,i,o),t.endPosition=o,bY(e,t,e._strafeStartPosition),t.endPosition=n}var Tye=new In,Mft=new In,dY=new m,Lft=new m,Nft=new m,Fft=new m,Bft=new dn(m.UNIT_X,0),kft=new H,Uft=new H;function Vft(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Cu(e,t,n);return}if(e._strafing){Lye(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=H.clone(n.startPosition,kft),a=H.clone(n.endPosition,Uft),c=o.getPickRay(s,Tye),u=m.clone(m.ZERO,Fft),f=m.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=Zp(e,s,dY),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let A=d;r&&(A=Mye(e,c,d,dY)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(A,e._strafeStartPosition),e._strafing=!0,bY(e,n,e._strafeStartPosition);return}let p=dn.fromPointNormal(u,f,Bft);c=o.getPickRay(s,Tye);let g=$i.rayPlane(c,p,dY),h=o.getPickRay(a,Mft),x=$i.rayPlane(h,p,Lft);if(!l(g)||!l(x)){e._looking=!0,Cu(e,t,n),H.clone(t,e._translateMousePosition);return}let b=m.subtract(g,x,Nft),C=b.x;b.x=b.y,b.y=b.z,b.z=C;let T=m.magnitude(b);T>P.EPSILON6&&(m.normalize(b,b),o.move(b,T))}var Nye=new H,Pz=new In,Oz=new m,zft=new m,Fye=new L,Hft=new L,Gft=new m,Wft=new dn(m.UNIT_X,0),mY=new m,_Y=new me,Bye=new L,jft=new Be,qft=new Z,Rz=new m;function Yft(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Cu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Xft(e,t,n)):Kft(e,t,n)}function Xft(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=Nye;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,Pz),c=m.UNIT_X,u=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-m.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Cu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,Oz);m.add(u,g,g);let h=i.mapProjection,x=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let b=h.unproject(g,_Y);x.cartographicToCartesian(b,g);let C=Mt.eastNorthUpToFixedFrame(g,x,Fye),T=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=L.clone(o.transform,Bye);o._setTransform(C),bu(e,t,n,m.UNIT_Z),o._setTransform(S),e._globe=T,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function Kft(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,Oz);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Zp(e,t,Oz)),!l(s)){a=o.getPickRay(t,Pz);let _=a.origin,E=a.direction,w,D=m.dot(c,E);if(Math.abs(D)>P.EPSILON6&&(w=-m.dot(c,_)/D),!l(w)||w<=0){e._looking=!0,Cu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(E,w,Oz),m.add(_,s,s)}r&&(l(a)||(a=o.getPickRay(t,Pz)),Rye(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let u=i.canvas,f=Nye;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,Pz);let d=m.clone(m.ZERO,Gft);d.x=s.x;let p=dn.fromPointNormal(d,c,Wft),g=$i.rayPlane(a,p,zft),h=o._projection,x=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let b=h.unproject(s,_Y);x.cartographicToCartesian(b,s);let C=Mt.eastNorthUpToFixedFrame(s,x,Fye),T;l(g)?(m.fromElements(g.y,g.z,g.x,g),b=h.unproject(g,_Y),x.cartographicToCartesian(b,g),T=Mt.eastNorthUpToFixedFrame(g,x,Hft)):T=C;let A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=L.clone(o.transform,Bye);o._setTransform(C);let O=m.cross(m.UNIT_Z,m.normalize(o.position,mY),mY),R=m.dot(o.right,O);if(bu(e,t,n,v,!1,!0),o._setTransform(T),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,bu(e,t,n,v,!0,!1),o.constrainedAxis=E}else bu(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,Rz);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=A,e._ellipsoid=S;let N=S.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let F=m.clone(o.positionWC,mY);if(e.enableCollisionDetection&&AY(e),!m.equals(o.positionWC,F)){o._setTransform(T),o.worldToCameraCoordinatesPoint(F,F);let _=m.magnitudeSquared(F);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let E=m.angleBetween(F,o.position),w=m.cross(F,o.position,F);m.normalize(w,w);let D=Be.fromAxisAngle(w,E,jft),M=Z.fromQuaternion(D,qft);Z.multiplyByVector(M,o.direction,o.direction),Z.multiplyByVector(M,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var kye=new H,Uye=new In,Vye=new m;function Jft(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=kye,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,Uye),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Zp(e,a,Vye));let g;if(l(p)&&(g=m.distance(u,p)),s){let h=Oye(e,c,d);l(g)?g=Math.min(g,h):g=h}if(!l(g)){let h=m.UNIT_X;g=-m.dot(h,u)/m.dot(h,f)}xY(e,t,n,e._zoomFactor,g)}function Zft(e){let n=e._scene.camera;if(!L.equals(L.IDENTITY,n.transform))Fc(e,e.enableRotate,e.rotateEventTypes,bu,e.inertiaSpin,"_lastInertiaSpinMovement"),Fc(e,e.enableZoom,e.zoomEventTypes,Hye,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Fc(e,e.enableTilt,e.tiltEventTypes,Yft,e.inertiaSpin,"_lastInertiaTiltMovement"),Fc(e,e.enableTranslate,e.translateEventTypes,Vft,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Fc(e,e.enableZoom,e.zoomEventTypes,Jft,e.inertiaZoom,"_lastInertiaZoomMovement"),Fc(e,e.enableLook,e.lookEventTypes,Cu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var $ft=new In,Qft=new dn(m.UNIT_X,0),edt=new m,tdt=new m;function bY(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,$ft),s=m.clone(o.direction,tdt);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=dn.fromPointNormal(n,s,Qft),c=$i.rayPlane(r,a,edt);l(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var Aye=new m,zye=new me,gY=new m,yY=new oe,ndt=new m,idt=new m,odt=new m;function rdt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!L.equals(o.transform,L.IDENTITY)){bu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,ndt);if(H.equals(t,e._rotateMousePosition)){if(e._looking)Cu(e,t,n,u);else if(e._rotating)bu(e,t,n);else if(e._strafing)Lye(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=gY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,yY),pY(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,zye).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Zp(e,n.startPosition,odt);if(l(p)){let g=!1,h=o.getPickRay(n.startPosition,Pye);if(r)g=!0,Mye(e,h,p,p);else{let x=s.geodeticSurfaceNormal(p,idt);Math.abs(m.dot(h.direction,x))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,bY(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=gY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,yY),pY(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Cu(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,Aye))?(pY(e,t,n,e._ellipsoid),m.clone(Aye,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,bu(e,t,n)):(e._looking=!0,Cu(e,t,n,u));H.clone(t,e._rotateMousePosition)}function bu(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,x=d*g*Math.PI;o||a.rotateRight(h),r||a.rotateUp(x),a.constrainedAxis=u}var hY=re.clone(re.UNIT_W),Eye=re.clone(re.UNIT_W),Iz=new m,EE=new m,Dz=new m,Sye=new m,sdt=new H,adt=new H,cdt=new H,ldt=new H,udt=new In;function pY(e,t,n,i){let o=e._scene,r=o.camera,s=H.clone(n.startPosition,sdt),a=H.clone(n.endPosition,adt),c=i.cartesianToCartographic(r.positionWC,zye).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=m.clone(e._panLastWorldPosition,hY),!l(e._globe)&&!H.equalsEpsilon(s,e._panLastMousePosition)&&(u=Zp(e,s,hY)),!l(e._globe)&&l(u))){let d=m.subtract(u,r.positionWC,EE),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,d),EE),g=m.magnitude(p),h=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,ldt),x=H.subtract(a,s,cdt),b=m.multiplyByScalar(r.rightWC,x.x*h.x,EE),C=m.normalize(r.positionWC,Dye),T=r.getPickRay(a,udt).direction,A=m.subtract(T,m.projectVector(T,r.rightWC,Dz),Dz),S=m.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let I=Math.abs(m.dot(r.directionWC,C)),O=-x.y*h.y*2/Math.sqrt(v)*(1-I),R=m.multiplyByScalar(T,O,Dz);I=Math.abs(m.dot(r.upWC,C));let N=m.multiplyByScalar(r.upWC,-x.y*(1-I)*h.y,Sye);f=m.add(u,b,Eye),f=m.add(f,R,f),f=m.add(f,N,f),m.clone(f,e._panLastWorldPosition),H.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,hY),f=r.pickEllipsoid(a,i,Eye)),!l(u)||!l(f)){e._rotating=!0,bu(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=m.mostOrthogonalAxis(d,Iz);m.cross(p,d,p),m.normalize(p,p);let g=m.cross(d,p,EE),h=m.magnitude(u),x=m.dot(d,u),b=Math.acos(x/h),C=m.multiplyByScalar(d,x,Dz);m.subtract(u,C,C),m.normalize(C,C);let T=m.magnitude(f),A=m.dot(d,f),S=Math.acos(A/T),v=m.multiplyByScalar(d,A,Sye);m.subtract(f,v,v),m.normalize(v,v);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=P.TWO_PI-I);let O=Math.acos(m.dot(v,p));m.dot(v,g)<0&&(O=P.TWO_PI-O);let R=I-O,N;m.equalsEpsilon(d,r.position,P.EPSILON2)?N=r.right:N=m.cross(d,r.position,Iz);let F=m.cross(d,N,Iz),_=m.dot(F,m.subtract(u,d,EE)),E=m.dot(F,m.subtract(f,d,EE)),w;_>0&&E>0?w=S-b:_>0&&E<=0?m.dot(r.position,d)>0?w=-b-S:w=b+S:w=b-S,r.rotateRight(R),r.rotateUp(w)}else{m.normalize(u,u),m.normalize(f,f);let d=m.dot(u,f),p=m.cross(u,f,Iz);if(d<1&&!m.equalsEpsilon(p,m.ZERO,P.EPSILON14)){let g=Math.acos(d);r.rotate(p,g)}}}var fdt=new m,ddt=new me,vye=0;function Hye(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=kye,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,Uye),d,p=o.cartesianToCartographic(s.position,ddt).height,g=Math.abs(vye)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Zp(e,u,Vye));let x;if(l(d)&&(x=m.distance(f.origin,d),vye=x),c){let C=Oye(e,f,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let b=m.normalize(s.position,fdt);xY(e,t,n,e._zoomFactor,x,m.dot(b,s.direction))}var Gye=new H,Mz=new In,u1=new m,mdt=new m,Wye=new L,hdt=new L,jye=new L,pdt=new Be,_dt=new Z,CY=new me,TY=new m;function gdt(e,t,n){let o=e._scene.camera;if(!L.equals(o.transform,L.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,TY);Cu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,CY);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,xdt(e,t,n)):bdt(e,t,n)}var ydt=new me;function xdt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,ydt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=Gye;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,Mz),d,p=$i.rayEllipsoid(f,i);if(l(p))d=In.getPoint(f,p.start,u1);else if(a>e._minimumTrackBallHeight){let T=$i.grazingAltitudeLocation(f,i);if(!l(T))return;let A=i.cartesianToCartographic(T,CY);A.height=0,d=i.cartographicToCartesian(A,u1)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(r.position,TY);Cu(e,t,n,T),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,Wye),h=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=L.clone(r.transform,jye);r._setTransform(g),bu(e,t,n,m.UNIT_Z),r._setTransform(b),e._globe=h,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function bdt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,u1);else{if(a=Zp(e,t,u1),!l(a)){if(c=r.getPickRay(t,Mz),u=$i.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,CY).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,TY);Cu(e,t,n,E),H.clone(t,e._tiltCenterMousePosition)}return}a=In.getPoint(c,u.start,u1)}s&&(l(c)||(c=r.getPickRay(t,Mz)),Rye(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=o.canvas,d=Gye;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,Mz);let p=m.magnitude(a),g=m.fromElements(p,p,p,gY),h=oe.fromCartesian3(g,yY);if(u=$i.rayEllipsoid(c,h),!l(u))return;let x=m.magnitude(c.origin)>p?u.start:u.stop,b=In.getPoint(c,x,mdt),C=Mt.eastNorthUpToFixedFrame(a,i,Wye),T=Mt.eastNorthUpToFixedFrame(b,h,hdt),A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=m.UNIT_Z,I=L.clone(r.transform,jye);r._setTransform(T);let O=m.cross(b,r.positionWC,Rz);if(m.dot(r.rightWC,O)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,bu(e,t,n,v,!0,!1),r.constrainedAxis=E}else bu(e,t,n,v,!0,!1);if(r._setTransform(C),bu(e,t,n,v,!1,!0),l(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,Rz);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=A,e._ellipsoid=S;let N=S.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let F=m.clone(r.positionWC,Rz);if(e.enableCollisionDetection&&AY(e),!m.equals(r.positionWC,F)){r._setTransform(T),r.worldToCameraCoordinatesPoint(F,F);let _=m.magnitudeSquared(F);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let E=m.angleBetween(F,r.position),w=m.cross(F,r.position,F);m.normalize(w,w);let D=Be.fromAxisAngle(w,E,pdt),M=Z.fromQuaternion(D,_dt);Z.multiplyByVector(M,r.direction,r.direction),Z.multiplyByVector(M,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Cdt=new H,Tdt=new H,wye=new In,Iye=new In,Adt=new m,Edt=new m;function Cu(e,t,n,i){let r=e._scene.camera,s=Cdt;s.x=n.startPosition.x,s.y=0;let a=Tdt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,wye),u=r.getPickRay(a,Iye),f=0,d,p;r.frustum instanceof on?(d=c.origin,p=u.origin,m.add(r.direction,d,d),m.add(r.direction,p,p),m.subtract(d,r.position,d),m.subtract(p,r.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(h)?r.look(h,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,wye),u=r.getPickRay(a,Iye),f=0,r.frustum instanceof on?(d=c.origin,p=u.origin,m.add(r.direction,d,d),m.add(r.direction,p,p),m.subtract(d,r.position,d),m.subtract(p,r.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),l(i)){let x=r.direction,b=m.negate(i,Adt),C=m.equalsEpsilon(x,i,P.EPSILON2),T=m.equalsEpsilon(x,b,P.EPSILON2);if(!C&&!T){g=m.dot(x,i);let A=P.acosClamped(g);f>0&&f>A&&(f=A-P.EPSILON4),g=m.dot(x,b),A=P.acosClamped(g),f<0&&-f>A&&(f=-A+P.EPSILON4);let S=m.cross(i,x,Edt);r.look(S,f)}else(C&&f<0||T&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Sdt(e){Fc(e,e.enableRotate,e.rotateEventTypes,rdt,e.inertiaSpin,"_lastInertiaSpinMovement"),Fc(e,e.enableZoom,e.zoomEventTypes,Hye,e.inertiaZoom,"_lastInertiaZoomMovement"),Fc(e,e.enableTilt,e.tiltEventTypes,gdt,e.inertiaSpin,"_lastInertiaTiltMovement"),Fc(e,e.enableLook,e.lookEventTypes,Cu)}var vdt=new L,wdt=new me;function AY(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let o=t.camera,r=i.ellipsoid,s=t.mapProjection,a,c;L.equals(o.transform,L.IDENTITY)||(a=L.clone(o.transform,vdt),c=m.magnitude(o.position),o._setTransform(L.IDENTITY));let u=wdt;n===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0)}}l(a)&&(o._setTransform(a),f&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}f1.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Idt=new m,Ddt=new m;f1.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;L.equals(t.transform,L.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=oe.UNIT_SPHERE);let o=l(this._globe)?this._globe.terrainExaggeration:1,r=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=jc.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=jc.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=jc.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,Idt),c=m.clone(t.directionWC,Ddt);i===ne.SCENE2D?wft(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Zft(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,Sdt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&AY(this),this._aggregator.reset()};f1.prototype.isDestroyed=function(){return!1};f1.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var Nz=f1;var Fz=`uniform sampler2D colorTexture; +uniform sampler2D colorTexture2; + +uniform vec2 center; +uniform float radius; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color0 = texture(colorTexture, v_textureCoordinates); + vec4 color1 = texture(colorTexture2, v_textureCoordinates); + + float x = length(gl_FragCoord.xy - center) / radius; + float t = smoothstep(0.5, 0.8, x); + out_FragColor = mix(color0 + color1, color1, t); +} +`;var Bz=`uniform sampler2D colorTexture; + +uniform float avgLuminance; +uniform float threshold; +uniform float offset; + +in vec2 v_textureCoordinates; + +float key(float avg) +{ + float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); + return max(0.0, guess) + 0.1; +} + +// See section 9. "The bright-pass filter" of Realtime HDR Rendering +// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf + +void main() +{ + vec4 color = texture(colorTexture, v_textureCoordinates); + vec3 xyz = czm_RGBToXYZ(color.rgb); + float luminance = xyz.r; + + float scaledLum = key(avgLuminance) * luminance / avgLuminance; + float brightLum = max(scaledLum - threshold, 0.0); + float brightness = brightLum / (offset + brightLum); + + xyz.r = brightness; + out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); +} +`;function $p(){this._sceneFramebuffer=new _E;let e=.125,t=new Array(6);t[0]=new Co({fragmentShader:xu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Cf.LINEAR});let n=t[1]=new Co({fragmentShader:Bz,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new Co({fragmentShader:jx,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Co({fragmentShader:jx,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Co({fragmentShader:xu,sampleMode:Cf.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new Co({fragmentShader:Fz,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Cl({stages:t});let o=new CE(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}$p.prototype.get=function(e){return this._stages.get(e)};$p.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Pdt=new re,qye=new H,Odt=new H,Yye=new L;function Rdt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=L.computeViewportTransformation(n,0,1,Yye),u=L.multiplyByPoint(r,o,Pdt),f=Mt.pointToGLWindowCoordinates(s,c,o,qye);u.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=H.magnitude(H.subtract(d,f,d))*30*2,g=Odt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,C=b.get(0),T=C.outputTexture.width,A=C.outputTexture.height,S=new Ke;S.width=T,S.height=A,c=L.computeViewportTransformation(S,0,1,Yye),f=Mt.pointToGLWindowCoordinates(s,c,o,qye),g.x*=T/h,g.y*=A/x;let v=C.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,h),v.height=Math.min(g.y,x);for(let I=1;I<4;++I)Ke.clone(v,b.get(I).scissorRectangle)}$p.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};$p.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Rdt(this,t,n),o};$p.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};$p.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var kz=$p;function Xye(){this._cachedShowFrustumsShaders={}}function Mdt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Ldt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=We.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`,a+=`uniform vec3 debugShowFrustumsColor; +`,a+=`void main() +{ + czm_Debug_main(); +`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor; +`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; +`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; +`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; +`;a+="}",o.sources.push(a);let u=Mdt(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var d1=new z;function Ndt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(d1.red=t.debugOverlappingFrustums&1?1:0,d1.green=t.debugOverlappingFrustums&2?1:0,d1.blue=t.debugOverlappingFrustums&4?1:0,d1.alpha=1,d1):z.WHITE}),n}var Fdt=new nt;Xye.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Ldt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,Fdt);r.shaderProgram=o,r.uniformMap=Ndt(e,t),r.execute(e.context,n)};var Uz=Xye;var zz=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Vi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new fU(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new zV,this._frameState=new kV(s,new PV(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new aU(s),this._globe=void 0,this._globeTranslucencyState=new UV,this._primitives=new Jl,this._groundPrimitives=new Jl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new AE,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new MV(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:Ve.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new Ez(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Uz,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Di,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new BV,this._shadowMapCamera=new ho(this),this.shadowMap=new Py({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new t1,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new Tz,this._brdfLutGenerator=new bV,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new Nz(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,yu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=cc.requestCompletedEvent.addEventListener(zz(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(zz(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ho(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ho(this),this.preloadFlightCullingVolume=void 0,this._picking=new nz(this),this._defaultView=new yE(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new by,$ye(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function Bdt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(zz(e))),n.push(t.terrainProviderChanged.addEventListener(zz(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Vi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Gt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Gt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return hm.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Bdt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ho(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new NV(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Gt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Vi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Kye(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=vy.createPickDerivedCommand(e,t,o,c.picking)),t.pickOnly||(c.depth=vy.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=vy.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Py.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ae.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}Vi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,o=t.shadowState.lastDirtyTime;e.lastDirtyTime!==o&&(e.lastDirtyTime=o,e.dirty=!0,i=!0);let r=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=r&&!c,p=s&&!u,g=(!r||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=Py.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=vy.createLogDepthCommand(e,n,a.logDepth),Kye(this,a.logDepth.command,i)),(f||g)&&Kye(this,e,i)}};var kdt=new Hd({pass:Fo.RENDER}),EY=new Hd({pass:Fo.PRELOAD}),SY=new Hd({pass:Fo.PRELOAD_FLIGHT}),Udt=new Hd({pass:Fo.REQUEST_RENDER_MODE_DEFER_CHECK}),Jye=new ae,vY;function Vdt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Jye.radius=n.minimumRadius+i,vY=Qk.fromBoundingSphere(Jye,e.camera.positionWC,vY),vY}}Vi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function $ye(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Vi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Vdt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof Or),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),t1.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Vi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==tn.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var Vz=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Vz=L.inverseTransformation(Vz,Vz);function zdt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(o.mode!==ne.SCENE3D){c=L.multiplyByPoint(Vz,c,c);let p=o.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=Un.toWireframe(Ks.createGeometry(new Ks({radii:new m(p,p,p),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Dn({geometryInstances:new Tt({geometry:a,modelMatrix:L.fromTranslation(c),attributes:{color:new Ht(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Un.toWireframe(Ol.createGeometry(Ol.fromDimensions({dimensions:new m(2,2,2),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Dn({geometryInstances:new Tt({geometry:a,modelMatrix:L.fromRotationTranslation(p,c,new L),attributes:{color:new Ht(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}let u=o.commandList,f=o.commandList=[];t._debugVolume.update(o),e=f[0],o.useLogDepth&&(e=vy.createLogDepthCommand(e,r).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(d)&&(n.framebuffer=d),o.commandList=u}function va(e,t,n,i,o){let r=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&zdt(e,t,i,o),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function m1(e,t,n,i){let o=t._frameState,r=e.derivedCommands;l(r)&&(o.useLogDepth&&l(r.logDepth)&&(e=r.logDepth.command),r=e.derivedCommands,l(r.picking)?(e=r.picking.pickCommand,e.execute(n,i)):l(r.depth)&&(e=r.depth.depthOnlyCommand,e.execute(n,i)))}function Qye(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Hdt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function Gdt(e,t,n,i,o){let r=e.context;py(i,Qye,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Wdt(e,t,n,i,o){let r=e.context;py(i,Hdt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function jdt(e,t,n,i){let o=e.context;py(i,Qye,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var qdt=new wi,Ydt=new _l,Xdt=new on,Kdt=new Or;function wY(e,t){let n=e.camera,i=e.context,o=e.frameState,r=i.uniformState;r.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(qdt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Ydt):l(n.frustum.width)?s=n.frustum.clone(Xdt):s=n.frustum.clone(Kdt),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Ae.ENVIRONMENT);let a=o.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let E=u.skyBoxCommand;if(l(E)&&va(E,e,i,t),u.isSkyAtmosphereVisible&&va(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let w;u.useGlobeDepthFramebuffer?w=f.globeDepth.framebuffer:u.usePostProcess?w=f.sceneFramebuffer.framebuffer:w=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,w),t.framebuffer=w}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(E,w,D,M,B){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(E,w,D,M,B)}),g=e._executeOITFunction):a.render?g=Gdt:g=Wdt;let h=f.frustumCommandsList,x=h.length,b=u.clearGlobeDepth,C=u.useDepthPlane,T=e._globeTranslucencyState,A=T.translucent,S=e._view.globeTranslucencyFramebuffer,v=e._depthClearCommand,I=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,N=u.usePostProcessSelected,F=n.position.z,_;for(let E=0;E<x;++E){let w=x-E-1,D=h[w];e.mode===ne.SCENE2D?(n.position.z=F-D.near+1,s.far=Math.max(1,D.far-D.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&I.execute(i,t),r.updatePass(Ae.GLOBE);let M=D.commands[Ae.GLOBE],B=D.indices[Ae.GLOBE];if(A)T.executeGlobeCommands(D,va,S,e,t);else for(_=0;_<B;++_)va(M[_],e,i,t);let V=f.globeDepth;if(l(V)&&u.useGlobeDepthFramebuffer&&V.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(r.updatePass(Ae.TERRAIN_CLASSIFICATION),M=D.commands[Ae.TERRAIN_CLASSIFICATION],B=D.indices[Ae.TERRAIN_CLASSIFICATION],A)T.executeGlobeClassificationCommands(D,va,S,e,t);else for(_=0;_<B;++_)va(M[_],e,i,t);if(b&&(v.execute(i,t),C&&R.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)va(M[_],e,i,t);if(B>0&&(l(V)&&u.useGlobeDepthFramebuffer&&(V.prepareColorTextures(i,b),V.executeUpdateDepth(i,t,b,V.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)va(M[_],e,i,t)}else{e._invertClassification.clear(i,t);let Y=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)va(M[_],e,i,t);for(l(V)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),V.executeUpdateDepth(i,t,b,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<B;++_)va(M[_],e,i,t);for(t.framebuffer=Y,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),B>0&&i.stencilBuffer&&O.execute(i,t),r.updatePass(Ae.CESIUM_3D_TILE_CLASSIFICATION),M=D.commands[Ae.CESIUM_3D_TILE_CLASSIFICATION],B=D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<B;++_)va(M[_],e,i,t)}for(B>0&&i.stencilBuffer&&I.execute(i,t),r.updatePass(Ae.VOXELS),M=D.commands[Ae.VOXELS],B=D.indices[Ae.VOXELS],M.length=B,jdt(e,va,t,M),r.updatePass(Ae.OPAQUE),M=D.commands[Ae.OPAQUE],B=D.indices[Ae.OPAQUE],_=0;_<B;++_)va(M[_],e,i,t);w!==0&&e.mode!==ne.SCENE2D&&(s.near=D.near,r.updateFrustum(s));let U;if(!c&&u.useInvertClassification&&o.invertClassificationColor.alpha<1&&(U=e._invertClassification),r.updatePass(Ae.TRANSLUCENT),M=D.commands[Ae.TRANSLUCENT],M.length=D.indices[Ae.TRANSLUCENT],g(e,va,t,M,U),D.indices[Ae.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,va,t,M,V.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,va,t,D)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let Y=V.depthStencilTexture,j=e._picking.getPickDepth(e,w);j.update(i,Y),j.executeCopyDepth(i,t)}if(c||!N)continue;let k=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,r.updateFrustum(s),r.updatePass(Ae.GLOBE),M=D.commands[Ae.GLOBE],B=D.indices[Ae.GLOBE],A)T.executeGlobeCommands(D,m1,S,e,t);else for(_=0;_<B;++_)m1(M[_],e,i,t);for(b&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),b&&C&&R.execute(i,t),r.updatePass(Ae.CESIUM_3D_TILE),M=D.commands[Ae.CESIUM_3D_TILE],B=D.indices[Ae.CESIUM_3D_TILE],_=0;_<B;++_)m1(M[_],e,i,t);for(r.updatePass(Ae.OPAQUE),M=D.commands[Ae.OPAQUE],B=D.indices[Ae.OPAQUE],_=0;_<B;++_)m1(M[_],e,i,t);for(r.updatePass(Ae.TRANSLUCENT),M=D.commands[Ae.TRANSLUCENT],B=D.indices[Ae.TRANSLUCENT],_=0;_<B;++_)m1(M[_],e,i,t);t.framebuffer=k}}function e0e(e){e.context.uniformState.updatePass(Ae.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,o=i.length;for(let r=0;r<o;++r)i[r].execute(e._computeEngine)}function Jdt(e,t){e.context.uniformState.updatePass(Ae.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function Zdt(e,t,n){let i=n.shadowMapCullingVolume,o=n.isPointLight,r=n.passes,s=r.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Ae.GLOBE||u.pass===Ae.CESIUM_3D_TILE||u.pass===Ae.OPAQUE||u.pass===Ae.TRANSLUCENT)&&e.isVisible(u,i))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(u,p))r[d].commandList.push(u),f=!0;else if(f)break}}}}function t0e(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let o=e.context,r=o.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;Zdt(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];r.updateCamera(p.camera),a.updatePass(o,d);let g=p.commandList.length;for(let h=0;h<g;++h){let x=p.commandList[h];r.updatePass(x.pass),va(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var $dt=new m;Vi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?Qdt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===yu.ROTATE?(emt(this,e),Ry(!0,this,e,t)):(IY(this,e,t),lmt(this,e))};function Qdt(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;IY(e,t,n),n0e(e),i.createPotentiallyVisibleSet(e),e0e(e),s||t0e(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=ho.clone(o,e._cameraVR);c.frustum=o.frustum;let u=o.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,$dt);o.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;m.add(c.position,p,o.position),o.frustum.xOffset=g,wY(e,t),a.x=a.width,m.subtract(c.position,p,o.position),o.frustum.xOffset=-g,wY(e,t),ho.clone(c,o)}function emt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var tmt=new me(Math.PI,P.PI_OVER_TWO),nmt=new m,imt=new m,omt=new L,rmt=new L,smt=new m,amt=new m,cmt=new Ke;function lmt(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=Ke.clone(r,cmt);t.viewport=s;let a=tmt,c=nmt;e.mapProjection.project(a,c);let f=m.clone(o.position,imt),d=L.clone(o.transform,rmt),p=o.frustum.clone();o._setTransform(L.IDENTITY);let g=L.computeViewportTransformation(s,0,1,omt),h=o.frustum.projectionMatrix,x=o.positionWC.y,b=m.fromElements(P.sign(x)*c.x-x,0,-o.positionWC.x,smt),C=Mt.pointToGLWindowCoordinates(h,g,b,amt);C.x=Math.floor(C.x);let T=s.x,A=s.width;if(x===0||C.x<=T||C.x>=T+A)Ry(!0,e,t);else if(Math.abs(T+A*.5-C.x)<1)s.width=C.x-s.x,o.position.x*=P.sign(o.position.x),o.frustum.right=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!0,e,t),s.x=C.x,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!1,e,t);else if(C.x>T+A*.5){s.width=C.x-T;let S=o.frustum.right;o.frustum.right=c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!0,e,t),s.x=C.x,s.width=T+A-C.x,o.position.x=-o.position.x,o.frustum.left=-o.frustum.right,o.frustum.right=S-o.frustum.right*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!1,e,t)}else{s.x=C.x,s.width=T+A-C.x;let S=o.frustum.left;o.frustum.left=-c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!0,e,t),s.x=T,s.width=C.x-T,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=S-o.frustum.left*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),Ry(!1,e,t)}o._setTransform(d),m.clone(f,o.position),o.frustum=p.clone(),t.viewport=r}function Ry(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),n0e(t),r.createPotentiallyVisibleSet(t),e&&(l(i)&&IY(t,n,i),e0e(t),s||t0e(t)),wY(t,n)}var Zye=new ss;Vi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof on||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(r)?(l(s)&&(r.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=r.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(x)?x.drawCommand:void 0,n.sunComputeCommand=l(x)?x.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=Zye.planes;for(let x=0;x<5;++x)p[x]=d.planes[x];d=Zye,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;l(g)&&(!l(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new hm(g)):!l(g)&&l(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function umt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new qp({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function fmt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(o!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=o),t.shadowState.lightShadowsEnabled=!1,!!o){for(let r=0;r<i;++r)if(n[r]!==t.shadowState.shadowMaps[r]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let r=0;r<i;++r){let s=n[r];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function n0e(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),umt(e),fmt(e),e._globe&&e._globe.render(t)}function IY(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new kz:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let h=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,o.useLogDepth,e._hdr),h.clear(i),x=r.usePostProcess=h.ready,r.usePostProcessSelected=x&&h.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&r.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,A=T.derivedCommands;A.oit=p.createDerivedCommands(T,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Vi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,o=i.globeDepth;l(o)&&o.prepareColorTextures(t);let r=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?o.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;r&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!r&&(g=u);let h=this.postProcessStages,x=g.getColorTexture(0),b=d.getColorTexture(0),C=y(u,f).getDepthStencilTexture();h.execute(t,x,C,b),h.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function dmt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function mmt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function hmt(e){let t=e.camera,n=e._mode,i=e.globe,o=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!o.onMap()&&r.height<0)return!0;if(!l(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return l(s)&&r.height<s}Vi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=mmt(this),this._cameraUnderground=hmt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function pmt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new Iy({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function _mt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function gmt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),cc.update()}var ymt=new z;function xmt(e){let t=e._frameState,n=e.context,i=n.uniformState,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=kdt;let r=y(e.backgroundColor,z.BLACK);e._hdr&&(r=z.clone(r,ymt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof by?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,Jdt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Qx(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function bmt(e){return e._picking.updateMostDetailedRayPicks(e)}Vi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);$ye(this,o,e),t.newFrame=!0}Qx(this,_mt),this.primitives.show&&(Qx(this,bmt),Qx(this,Cmt),Qx(this,Tmt),i||Qx(this,Amt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Qx(this,xmt)),pmt(this,i),Qx(this,gmt),dmt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Vi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Vi.prototype.requestRender=function(){this._renderRequested=!0};Vi.prototype.clampLineWidth=function(e){return Math.max(Gt.minimumAliasedLineWidth,Math.min(e,Gt.maximumAliasedLineWidth))};Vi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Vi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Vi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Vi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Cmt(e){let t=e._frameState;EY.camera=t.camera,EY.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,EY)}function Tmt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;SY.camera=e.preloadFlightCamera,SY.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,SY)}function Amt(e){e.primitives.updateForPass(e._frameState,Udt)}Vi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Vi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Vi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Vi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Vi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Vi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Vi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Vi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Vi.prototype.cartesianToCanvasCoordinates=function(e,t){return eo.wgs84ToWindowCoordinates(this,e,t)};Vi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Vi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Vi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Vi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function Emt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Vi.prototype.setTerrain=function(e){return Emt(this,e),e};Vi.prototype.isDestroyed=function(){return!1};Vi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var Hz=Vi;function SE(e){e=y(e,oe.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=L.fromScale(n),this._modelMatrix=new L,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(SE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});SE.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var DY=new L;SE.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=L.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,DY),o=L.multiplyTransformation(i,_o.Y_UP_TO_Z_UP,DY),r=L.multiply(this._scaleMatrix,o,DY);L.clone(r,this._modelMatrix);let s=e.context,a=Smt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Ks.createGeometry(new Ks({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Me.POSITION_ONLY}));f.vertexArray=ai.fromGeometry({context:s,geometry:p,attributeLocations:Un.createAttributeLocations(p),bufferUsage:ke.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:mn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new We({defines:p,sources:[Cy,vI,IU]}),h=new We({defines:p,sources:[Cy,vI,wU]});this._spSkyAtmosphere=$t.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function Smt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}SE.prototype.isDestroyed=function(){return!1};SE.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var Gz=SE;function Wz(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new nt({modelMatrix:L.clone(L.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}Wz.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let r=this.sources;typeof r.positiveX=="string"?dU(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new uc({context:i,source:r}))}let o=this._command;if(!l(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return n._cubeMap}};let r=Ol.createGeometry(Ol.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Me.POSITION_ONLY})),s=this._attributeLocations=Un.createAttributeLocations(r);o.vertexArray=ai.fromGeometry({context:i,geometry:r,attributeLocations:s,bufferUsage:ke.STATIC_DRAW}),o.renderState=Ve.fromCache({blending:mn.ALPHA_BLEND})}if(!l(o.shaderProgram)||this._useHdr!==t){let r=new We({defines:[t?"HDR":""],sources:[DU]});o.shaderProgram=$t.fromCache({context:i,vertexShaderSource:PU,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return o};Wz.prototype.isDestroyed=function(){return!1};Wz.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var jz=Wz;function p1(){this.show=!0,this._drawCommand=new nt({primitiveType:Fe.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(p1.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var vmt=new H,wmt=new H,Imt=new re,h1=new re;p1.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._texture=new Lt({context:o,width:S,height:S,pixelFormat:lt.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,O={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new Hf({fragmentShaderSource:RU,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let I=ht.createVertexBuffer({context:o,typedArray:v,usage:ke.STATIC_DRAW}),O=[{index:S.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=ht.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});a.vertexArray=new ai({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=$t.fromCache({context:o,vertexShaderSource:MU,fragmentShaderSource:OU,attributeLocations:S}),a.renderState=Ve.fromCache({blending:mn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=eo.computeActualWgs84Position(e,c,h1),g=m.magnitude(m.subtract(p,e.camera.position,h1)),h=o.uniformState.projection,x=Imt;x.x=0,x.y=0,x.z=-g,x.w=1;let b=L.multiplyByVector(h,x,h1),C=eo.clipToGLWindowCoordinates(t.viewport,b,vmt);x.x=P.SOLAR_RADIUS;let T=L.multiplyByVector(h,x,h1),A=eo.clipToGLWindowCoordinates(t.viewport,T,wmt);return this._size=H.magnitude(H.subtract(A,C,h1)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};p1.prototype.isDestroyed=function(){return!1};p1.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var qz=p1;function vE(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Dmt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let r="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(r,void 0,o)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function i0e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function o0e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=i0e(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function r0e(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function eb(e,t){e=Mn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Wt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Wt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Mn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Mn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new Bm,o0e(this);try{let p=new Hz({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,i0e(this),r0e(this);let g=y(p.mapProjection.ellipsoid,oe.WGS84),h=t.globe;l(h)||(h=new hV(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,Cn.RECEIVE_ONLY));let x=t.skyBox;l(x)||(x=new jz({sources:{positiveX:vE("px"),negativeX:vE("mx"),positiveY:vE("py"),negativeY:vE("my"),positiveZ:vE("pz"),negativeZ:vE("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new qz,p.moon=new xV);let b=t.skyAtmosphere;l(b)||(b=new Gz(g)),b!==!1&&(p.skyAtmosphere=b),l(t.imageryProvider)&&Q("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(l(t.imageryProvider)&&!l(C)&&(C=new na(t.imageryProvider)),l(C)||(C=na.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new _f(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(A,S){if(T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors){let v="An error occurred while rendering. Rendering has stopped.";T.showErrorPanel(v,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(eb.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Dmt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});eb.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=Vp(n);u||(typeof n=="string"&&(n=new Error(n)),t=Vp({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${h}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(C){x.removeChild(b),x.appendChild(document.createTextNode(h)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},d.appendChild(p),i.appendChild(o)};eb.prototype.isDestroyed=function(){return!1};eb.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};eb.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,o0e(this),r0e(this),this._scene.requestRender())};eb.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var Yz=eb;var Pmt=new m(1,1,1);function PY(e){e=y(e,Pmt),this._dimensions=m.clone(e)}Object.defineProperties(PY.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var Omt=new m;PY.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,Omt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var s0e=PY;var Xz=`// See Intersection.glsl for the definition of intersectScene +// See IntersectionUtils.glsl for the definition of nextIntersection +// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl +// for the definition of convertUvToShapeUvSpace. The appropriate function is +// selected based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See Octree.glsl for the definitions of TraversalData, SampleData, +// traverseOctreeFromBeginning, and traverseOctreeFromExisting +// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture + +#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 + +uniform mat3 u_transformDirectionViewToLocal; +uniform vec3 u_cameraPositionUv; +uniform float u_stepSize; + +#if defined(PICKING) + uniform vec4 u_pickColor; +#endif + +#if defined(JITTER) +float hash(vec2 p) +{ + vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); +} +#endif + +vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { +#if defined(SHAPE_BOX) + Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); + RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); + vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; + float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); + float dt = (exit - entry.w) * RAY_SCALE; + return vec4(normalize(entry.xyz), dt); +#else + float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); + return vec4(viewRay.dir, u_stepSize / dimAtLevel); +#endif +} + +void main() +{ + vec4 fragCoord = gl_FragCoord; + vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] + vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); + vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case + vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case + vec3 viewPosUv = u_cameraPositionUv; + #if defined(SHAPE_BOX) + vec3 dInv = 1.0 / viewDirUv; + Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); + #else + Ray viewRayUv = Ray(viewPosUv, viewDirUv); + #endif + + Intersections ix; + RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); + + // Exit early if the scene was completely missed. + if (shapeIntersection.entry.w == NO_HIT) { + discard; + } + + float currT = shapeIntersection.entry.w * RAY_SCALE; + float endT = shapeIntersection.exit.w; + vec3 positionUv = viewPosUv + currT * viewDirUv; + vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + + // Traverse the tree from the start position + TraversalData traversalData; + SampleData sampleDatas[SAMPLE_COUNT]; + traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); + vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + + #if defined(JITTER) + float noise = hash(screenCoord); // [0,1] + currT += noise * step.w; + positionUv += noise * step.w * viewDirUv; + #endif + + FragmentInput fragmentInput; + #if defined(STATISTICS) + setStatistics(fragmentInput.metadata.statistics); + #endif + + vec4 colorAccum =vec4(0.0); + + for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { + // Read properties from the megatexture based on the traversal state + Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); + + // Prepare the custom shader inputs + copyPropertiesToMetadata(properties, fragmentInput.metadata); + fragmentInput.voxel.positionUv = positionUv; + fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; + fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; + fragmentInput.voxel.viewDirUv = viewDirUv; + fragmentInput.voxel.viewDirWorld = viewDirWorld; + fragmentInput.voxel.surfaceNormal = step.xyz; + fragmentInput.voxel.travelDistance = step.w; + + // Run the custom shader + czm_modelMaterial materialOutput; + fragmentMain(fragmentInput, materialOutput); + + // Sanitize the custom shader output + vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); + color.rgb = max(color.rgb, vec3(0.0)); + color.a = clamp(color.a, 0.0, 1.0); + + // Pre-multiplied alpha blend + colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); + + // Stop traversing if the alpha has been fully saturated + if (colorAccum.a > ALPHA_ACCUM_MAX) { + colorAccum.a = ALPHA_ACCUM_MAX; + break; + } + + if (step.w == 0.0) { + // Shape is infinitely thin. The ray may have hit the edge of a + // foreground voxel. Step ahead slightly to check for more voxels + step.w == 0.00001; + } + + // Keep raymarching + currT += step.w; + positionUv += step.w * viewDirUv; + + // Check if there's more intersections. + if (currT > endT) { + #if (INTERSECTION_COUNT == 1) + break; + #else + shapeIntersection = nextIntersection(ix); + if (shapeIntersection.entry.w == NO_HIT) { + break; + } else { + // Found another intersection. Resume raymarching there + currT = shapeIntersection.entry.w * RAY_SCALE; + endT = shapeIntersection.exit.w; + positionUv = viewPosUv + currT * viewDirUv; } - #endif -/*--------------------------------------------------------------------------*/ + #endif + } + + // Traverse the tree from the current ray position. + // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. + positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); + traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); + step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); + } + + // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] + colorAccum.a /= ALPHA_ACCUM_MAX; + + #if defined(PICKING) + // If alpha is 0.0 there is nothing to pick + if (colorAccum.a == 0.0) { + discard; + } + out_FragColor = u_pickColor; + #else + out_FragColor = colorAccum; + #endif +} +`;var Kz=`in vec2 position; + +uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; + +void main() { + vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; + vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; + vec2 translation = 0.5 * (aabbMax + aabbMin); + vec2 scale = 0.5 * (aabbMax - aabbMin); + gl_Position = vec4(position * scale + translation, 0.0, 1.0); +} +`;var Jz=`/* Intersection defines +#define INTERSECTION_COUNT ### +*/ + +#define NO_HIT (-czm_infinity) +#define INF_HIT (czm_infinity * 0.5) +#define RAY_SHIFT (0.000003163) +#define RAY_SCALE (1.003163) + +struct Ray { + vec3 pos; + vec3 dir; +#if defined(SHAPE_BOX) + vec3 dInv; +#endif +}; + +struct RayShapeIntersection { + vec4 entry; + vec4 exit; +}; + +struct Intersections { + // Don't access these member variables directly - call the functions instead. + + // Store an array of ray-surface intersections. Each intersection is composed of: + // .xyz for the surface normal at the intersection point + // .w for the T value + // The scale of the normal encodes the shape intersection type: + // length(intersection.xyz) = 1: positive shape entry + // length(intersection.xyz) = 2: positive shape exit + // length(intersection.xyz) = 3: negative shape entry + // length(intersection.xyz) = 4: negative shape exit + // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, + // so we need twice as many to track ray-*surface* intersections + vec4 intersections[INTERSECTION_COUNT * 2]; + + #if (INTERSECTION_COUNT > 1) + // Maintain state for future nextIntersection calls + int index; + int surroundCount; + bool surroundIsPositive; + #endif +}; + +RayShapeIntersection getFirstIntersection(in Intersections ix) +{ + return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +} + +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +{ + float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; + return vec4(intersection.xyz * scale, intersection.w); +} + +// Use defines instead of real functions because WebGL1 cannot access array with non-constant index. +#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) +#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) +#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; +#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) + +#if (INTERSECTION_COUNT > 1) +void initializeIntersections(inout Intersections ix) { + // Sort the intersections from min T to max T with bubble sort. + // Note: If this sorting function changes, some of the intersection test may + // need to be updated. Search for "bubble sort" to find those areas. + const int sortPasses = INTERSECTION_COUNT * 2 - 1; + for (int n = sortPasses; n > 0; --n) { + for (int i = 0; i < sortPasses; ++i) { + // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to break early instead + if (i >= n) { break; } + + vec4 intersect0 = ix.intersections[i + 0]; + vec4 intersect1 = ix.intersections[i + 1]; + + bool inOrder = intersect0.w <= intersect1.w; + + ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; + ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; + } + } + + // Prepare initial state for nextIntersection + ix.index = 0; + ix.surroundCount = 0; + ix.surroundIsPositive = false; +} +#endif + +#if (INTERSECTION_COUNT > 1) +RayShapeIntersection nextIntersection(inout Intersections ix) { + vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); + RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); + + const int passCount = INTERSECTION_COUNT * 2; + + if (ix.index == passCount) { + return shapeIntersection; + } + + for (int i = 0; i < passCount; ++i) { + // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot + // loop with non-constant condition, so it has to continue instead. + if (i < ix.index) { + continue; + } + + ix.index = i + 1; + + surfaceIntersection = ix.intersections[i]; + int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); + bool currShapeIsPositive = intersectionType < 2; + bool enter = intMod(intersectionType, 2) == 0; + + ix.surroundCount += enter ? +1 : -1; + ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; + + // entering positive or exiting negative + if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { + shapeIntersection.entry = surfaceIntersection; + } + + // exiting positive or entering negative after being inside positive + bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; + bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; + if (exitPositive || enterNegativeFromPositive) { + shapeIntersection.exit = surfaceIntersection; + + // entry and exit have been found, so the loop can stop + if (exitPositive) { + // After exiting positive shape there is nothing left to intersect, so jump to the end index. + ix.index = passCount; + } + break; + } + } + + return shapeIntersection; +} +#endif + +// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 +`;var Zz=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersectionPair, INF_HIT, NO_HIT + +/* intersectDepth defines (set in Scene/VoxelRenderResources.js) +#define DEPTH_INTERSECTION_INDEX ### +*/ + +uniform mat4 u_transformPositionViewToUv; + +void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); + if (logDepthOrDepth != 0.0) { + // Calculate how far the ray must travel before it hits the depth buffer. + vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); + eyeCoordinateDepth /= eyeCoordinateDepth.w; + vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); + float t = dot(depthPositionUv - ray.pos, ray.dir); + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); + } else { + // There's no depth at this location. + setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); + } +} +`;var $z=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +// NO_HIT, setIntersectionPair + +/* Clipping plane defines (set in Scene/VoxelRenderResources.js) +#define CLIPPING_PLANES_UNION +#define CLIPPING_PLANES_COUNT +#define CLIPPING_PLANES_INTERSECTION_INDEX +*/ + +uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; + +// Plane is in Hessian Normal Form +vec4 intersectPlane(in Ray ray, in vec4 plane) { + vec3 n = plane.xyz; // normal + float w = plane.w; // -dot(pointOnPlane, normal) + + float a = dot(ray.pos, n); + float b = dot(ray.dir, n); + float t = -(w + a) / b; + + return vec4(n, t); +} + +void intersectClippingPlanes(in Ray ray, inout Intersections ix) { + vec4 backSide = vec4(-ray.dir, -INF_HIT); + vec4 farSide = vec4(ray.dir, +INF_HIT); + RayShapeIntersection clippingVolume; + + #if (CLIPPING_PLANES_COUNT == 1) + // Union and intersection are the same when there's one clipping plane, and the code + // is more simplified. + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + bool reflects = dot(ray.dir, intersection.xyz) < 0.0; + clippingVolume.entry = reflects ? backSide : intersection; + clippingVolume.exit = reflects ? intersection : farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #elif defined(CLIPPING_PLANES_UNION) + vec4 firstTransmission = vec4(ray.dir, +INF_HIT); + vec4 lastReflection = vec4(-ray.dir, -INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; + } else { + lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; + } + } + clippingVolume.entry = backSide; + clippingVolume.exit = lastReflection; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); + clippingVolume.entry = firstTransmission; + clippingVolume.exit = farSide; + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); + #else // intersection + vec4 lastTransmission = vec4(ray.dir, -INF_HIT); + vec4 firstReflection = vec4(-ray.dir, +INF_HIT); + for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { + vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); + vec4 intersection = intersectPlane(ray, planeUv); + if (dot(ray.dir, planeUv.xyz) > 0.0) { + lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; + } else { + firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; + } + } + if (lastTransmission.w < firstReflection.w) { + clippingVolume.entry = lastTransmission; + clippingVolume.exit = firstReflection; + } else { + clippingVolume.entry = vec4(-ray.dir, NO_HIT); + clippingVolume.exit = vec4(ray.dir, NO_HIT); + } + setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); + #endif +} +`;var Qz=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT +// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace + +/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_INTERSECTION_INDEX ### // always 0 +*/ + +uniform vec3 u_renderMinBounds; +uniform vec3 u_renderMaxBounds; + +struct Box { + vec3 p0; + vec3 p1; +}; + +Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) +{ + // Find the min/max cornerpoints of the voxel in tile coordinates + vec3 tileOrigin = vec3(octreeCoords.xyz); + vec3 numSamples = vec3(u_dimensions); + vec3 voxelSize = 1.0 / numSamples; + vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; + vec3 coordP1 = coordP0 + voxelSize; + + // Transform to the UV coordinates of the scaled tileset + float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); + vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); + vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); + + return Box(p0, p1); +} + +vec3 getBoxNormal(in Box box, in Ray ray, in float t) +{ + vec3 hitPoint = ray.pos + t * ray.dir; + vec3 lower = step(hitPoint, box.p0); + vec3 upper = step(box.p1, hitPoint); + return normalize(upper - lower); +} + +// Find the distances along a ray at which the ray intersects an axis-aligned box +// See https://tavianator.com/2011/ray_box.html +RayShapeIntersection intersectBox(in Ray ray, in Box box) +{ + // Consider the box as the intersection of the space between 3 pairs of parallel planes + // Compute the distance along the ray to each plane + vec3 t0 = (box.p0 - ray.pos) * ray.dInv; + vec3 t1 = (box.p1 - ray.pos) * ray.dInv; + + // Identify candidate entries/exits based on distance from ray.pos + vec3 entries = min(t0, t1); + vec3 exits = max(t0, t1); + + // The actual box intersection points are the furthest entry and the closest exit + float entryT = max(max(entries.x, entries.y), entries.z); + float exitT = min(min(exits.x, exits.y), exits.z); + + vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); + vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); + + if (entryT > exitT) { + entryT = NO_HIT; + exitT = NO_HIT; + } + + return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); +} + +void intersectShape(in Ray ray, inout Intersections ix) +{ + RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); + setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +} +`;var e4=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, +// setIntersectionPair + +/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX +#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT +#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF +#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO + +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED + +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX +#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN +#define CYLINDER_INTERSECTION_INDEX_ANGLE +*/ + +// Cylinder uniforms +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + uniform vec3 u_cylinderUvToRenderBoundsScale; + uniform vec3 u_cylinderUvToRenderBoundsTranslate; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + uniform float u_cylinderUvToRenderRadiusMin; +#endif +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) + uniform vec2 u_cylinderRenderAngleMinMax; +#endif + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +#define POSITIVE_HIT vec2(t, +INF_HIT); +#define NEGATIVE_HIT vec2(-INF_HIT, t); + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + // Half space cuts right through the camera, pick the side to intersect + if (a == 0.0) { + if (b >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } + } + + if (t >= 0.0 != s >= 0.0) { + return POSITIVE_HIT; + } else { + return NEGATIVE_HIT; + } +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float ta = (-b - det) / a; + float tb = (-b + det) / a; + float t1 = min(ta, tb); + float t2 = max(ta, tb); + + float z1 = o.z + t1 * d.z; + float z2 = o.z + t2 * d.z; + + if (abs(z1) >= 1.0) + { + float tCap = (sign(z1) - o.z) / d.z; + t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + if (abs(z2) >= 1.0) + { + float tCap = (sign(z2) - o.z) / d.z; + t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; + } + + return vec2(t1, t2); +} + +vec2 intersectUnitCircle(Ray ray) { + vec3 o = ray.pos; + vec3 d = ray.dir; + + float t = -o.z / d.z; + vec2 zPlanePos = o.xy + d.xy * t; + float distSqr = dot(zPlanePos, zPlanePos); + + if (distSqr > 1.0) { + return vec2(NO_HIT); + } + + return vec2(t, t); +} + +vec2 intersectInfiniteUnitCylinder(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d.xy, d.xy); + float b = dot(o.xy, d.xy); + float c = dot(o.xy, o.xy) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +void intersectShape(Ray ray, inout Intersections ix) +{ + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) + ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; + ray.dir *= u_cylinderUvToRenderBoundsScale; + #else + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + vec2 outerIntersect = intersectUnitCircle(ray); + #else + vec2 outerIntersect = intersectUnitCylinder(ray); + #endif + + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); + + if (outerIntersect.x == NO_HIT) { + return; + } + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) + // When the cylinder is perfectly thin it's necessary to sandwich the + // inner cylinder intersection inside the outer cylinder intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the cylinder to be invisible because it will think the ray + // is still inside the inner (negative) cylinder after exiting the + // outer (positive) cylinder. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) + Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); + vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); + #endif + + #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); + #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); + #endif +} +`;var t4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +// setIntersection, setIntersectionPair, INF_HIT, NO_HIT + +/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX +#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX +#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN +*/ + +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidRenderLongitudeMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + uniform float u_ellipsoidInverseOuterScaleUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + uniform float u_ellipsoidInverseInnerScaleUv; +#endif + +vec2 intersectZPlane(Ray ray) +{ + float o = ray.pos.z; + float d = ray.dir.z; + float t = -o / d; + float s = sign(o); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec4 intersectHalfPlane(Ray ray, float angle) { + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 planeDirection = vec2(cos(angle), sin(angle)); + vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); + + float a = dot(o, planeNormal); + float b = dot(d, planeNormal); + float t = -a / b; + + vec2 p = o + t * d; + bool outside = dot(p, planeDirection) < 0.0; + if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + + return vec4(-INF_HIT, t, t, +INF_HIT); +} + +vec2 intersectHalfSpace(Ray ray, float angle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n = vec2(sin(angle), -cos(angle)); + + float a = dot(o, n); + float b = dot(d, n); + float t = -a / b; + float s = sign(a); + + if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); + else return vec2(-INF_HIT, t); +} + +vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 o = ray.pos.xy; + vec2 d = ray.dir.xy; + vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); + vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); + + float a1 = dot(o, n1); + float a2 = dot(o, n2); + float b1 = dot(d, n1); + float b2 = dot(d, n2); + + float t1 = -a1 / b1; + float t2 = -a2 / b2; + float s1 = sign(a1); + float s2 = sign(a2); + + float tmin = min(t1, t2); + float tmax = max(t1, t2); + float smin = tmin == t1 ? s1 : s2; + float smax = tmin == t1 ? s2 : s1; + + bool e = tmin >= 0.0; + bool f = tmax >= 0.0; + bool g = smin >= 0.0; + bool h = smax >= 0.0; + + if (e != g && f == h) return vec2(tmin, tmax); + else if (e == g && f == h) return vec2(-INF_HIT, tmin); + else if (e != g && f != h) return vec2(tmax, +INF_HIT); + else return vec2(NO_HIT); +} + +vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) +{ + vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); + vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); + return vec4(planeIntersectMin, planeIntersectMax); +} + +vec2 intersectUnitSphere(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = -b - det; + float t2 = -b + det; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + + float a = dot(d, d); + float b = dot(d, o); + float c = dot(o, o) - 1.0; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + + return vec2(tmin, tmax); +} + +vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) +{ + vec3 o = ray.pos; + vec3 d = ray.dir; + float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; + float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; + float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; + float det = b * b - a * c; + + if (det < 0.0) { + return vec2(NO_HIT); + } + + det = sqrt(det); + float t1 = (-b - det) / a; + float t2 = (-b + det) / a; + float tmin = min(t1, t2); + float tmax = max(t1, t2); + return vec2(tmin, tmax); +} + +vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + // One interval + if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); + else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); + else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); + // Two intervals + else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); +} + +vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { + vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); + + if (intersect.x == NO_HIT) { + return vec2(NO_HIT); + } + + vec3 o = ray.pos; + vec3 d = ray.dir; + float tmin = intersect.x; + float tmax = intersect.y; + float zmin = o.z + tmin * d.z; + float zmax = o.z + tmax * d.z; + + if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); + else if (zmin < 0.0) return vec2(tmax, +INF_HIT); + else if (zmax < 0.0) return vec2(-INF_HIT, tmin); + else return vec2(tmin, tmax); +} + +void intersectShape(in Ray ray, inout Intersections ix) { + // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. + // Direction is scaled as well to be in sync with position. + ray.pos = ray.pos * 2.0 - 1.0; + ray.dir *= 2.0; + + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) + Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); + #else + Ray outerRay = ray; + #endif + + // Outer ellipsoid + vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); + + // Exit early if the outer ellipsoid was missed. + if (outerIntersect.x == NO_HIT) { + return; + } + + // Inner ellipsoid + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) + // When the ellipsoid is perfectly thin it's necessary to sandwich the + // inner ellipsoid intersection inside the outer ellipsoid intersection. + + // Without this special case, + // [outerMin, outerMax, innerMin, innerMax] will bubble sort to + // [outerMin, innerMin, outerMax, innerMax] which will cause the back + // side of the ellipsoid to be invisible because it will think the ray + // is still inside the inner (negative) ellipsoid after exiting the + // outer (positive) ellipsoid. + + // With this special case, + // [outerMin, innerMin, innerMax, outerMax] will bubble sort to + // [outerMin, innerMin, innerMax, outerMax] which will work correctly. + + // Note: If initializeIntersections() changes its sorting function + // from bubble sort to something else, this code may need to change. + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) + Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); + vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); + + if (innerIntersect == vec2(NO_HIT)) { + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); + } else { + // When the ellipsoid is very large and thin it's possible for floating + // point math to cause the ray to intersect the inner ellipsoid before + // the outer ellipsoid. To prevent this from happening, clamp innerIntersect + // to outerIntersect and sandwhich the intersections like described above. + // + // In theory a similar fix is needed for cylinders, however it's more + // complicated to implement because the inner shape is allowed to be + // intersected first. + innerIntersect.x = max(innerIntersect.x, outerIntersect.x); + innerIntersect.y = min(innerIntersect.y, outerIntersect.y); + setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter + setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter + setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit + setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit + } + #endif + + // Flip the ray because the intersection function expects a cone growing towards +Z. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + Ray flippedRay = outerRay; + flippedRay.dir.z *= -1.0; + flippedRay.pos.z *= -1.0; + #endif + + // Bottom cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) + vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) + vec2 bottomConeIntersection = intersectZPlane(flippedRay); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) + vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); + #endif + + // Top cone + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) + vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) + vec2 topConeIntersection = intersectZPlane(ray); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) + vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); + #endif + + // Wedge + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) + vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) + vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); + #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) + vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); + setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); + #endif +} +`;var wE=`// Main intersection function for Voxel scenes. +// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl +// for the definition of intersectShape. The appropriate function is selected +// based on the VoxelPrimitive shape type, and added to the shader in +// Scene/VoxelRenderResources.js. +// See also IntersectClippingPlane.glsl and IntersectDepth.glsl. +// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, +// getFirstIntersection, initializeIntersections, nextIntersection. + +/* Intersection defines (set in Scene/VoxelRenderResources.js) +#define INTERSECTION_COUNT ### +*/ + +RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { + // Do a ray-shape intersection to find the exact starting and ending points. + intersectShape(ray, ix); + + // Exit early if the positive shape was completely missed or behind the ray. + RayShapeIntersection intersection = getFirstIntersection(ix); + if (intersection.entry.w == NO_HIT) { + // Positive shape was completely missed - so exit early. + return intersection; + } + + // Clipping planes + #if defined(CLIPPING_PLANES) + intersectClippingPlanes(ray, ix); + #endif + + // Depth + #if defined(DEPTH_TEST) + intersectDepth(screenCoord, ray, ix); + #endif + + // Find the first intersection that's in front of the ray + #if (INTERSECTION_COUNT > 1) + initializeIntersections(ix); + for (int i = 0; i < INTERSECTION_COUNT; ++i) { + intersection = nextIntersection(ix); + if (intersection.exit.w > 0.0) { + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + break; } + } + #else + // Set start to 0.0 when ray is inside the shape. + intersection.entry.w = max(intersection.entry.w, 0.0); + #endif + + return intersection; +} +`;var n4=`/* Box defines (set in Scene/VoxelBoxShape.js) +#define BOX_HAS_SHAPE_BOUNDS +*/ + +#if defined(BOX_HAS_SHAPE_BOUNDS) + uniform vec3 u_boxUvToShapeUvScale; + uniform vec3 u_boxUvToShapeUvTranslate; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; +#else + return positionUv; +#endif +} + +vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { +#if defined(BOX_HAS_SHAPE_BOUNDS) + return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; +#else + return shapeUv; +#endif +} +`;var i4=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS +#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT +#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY +#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED +*/ + +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + uniform vec2 u_cylinderShapeUvAngleMinMax; +#endif +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + uniform float u_cylinderShapeUvAngleRangeZeroMid; +#endif + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] + + // Compute radius + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) + float radius = 1.0; + #else + float radius = length(positionLocal.xy); // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) + radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset + #endif + #endif + + // Compute height + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + float height = 1.0; + #else + float height = positionUv.z; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) + height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset + #endif + #endif + + // Compute angle + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) + float angle = 1.0; + #else + float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) + // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. + angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) + angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; + #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) + angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; + #endif + + angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset + #endif + #endif + + return vec3(radius, height, angle); +} +`;var o4=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY +#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE +#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN +#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT +#define ELLIPSOID_IS_SPHERE +*/ + +uniform vec3 u_ellipsoidRadiiUv; // [0,1] +#if !defined(ELLIPSOID_IS_SPHERE) + uniform vec3 u_ellipsoidInverseRadiiSquaredUv; +#endif +#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset +#endif +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + uniform float u_ellipsoidInverseHeightDifferenceUv; + uniform vec2 u_ellipseInnerRadiiUv; // [0,1] +#endif + +// robust iterative solution without trig functions +// https://github.com/0xfaded/ellipse_demo/issues/1 +// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse +// Pro: Good when radii.x ~= radii.y +// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse +// Con: Inaccurate with exterior points and thin ellipses +float ellipseDistanceIterative (vec2 pos, vec2 radii) { + vec2 p = abs(pos); + vec2 invRadii = 1.0 / radii; + vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; + vec2 t = vec2(0.70710678118); // sqrt(2) / 2 + vec2 v = radii * t; + + const int iterations = 3; + for (int i = 0; i < iterations; ++i) { + vec2 e = a * pow(t, vec2(3.0)); + vec2 q = normalize(p - e) * length(v - e); + t = normalize((q + e) * invRadii); + v = radii * t; + } + return length(v * sign(pos) - pos) * sign(p.y - v.y); +} + +vec3 convertUvToShapeUvSpace(in vec3 positionUv) { + // Compute position and normal. + // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). + // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. + vec3 positionLocal = positionUv * 2.0 - 1.0; + #if defined(ELLIPSOID_IS_SPHERE) + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; + vec3 normal = normalize(posEllipsoid); + #else + vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; + vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal + #endif + + // Compute longitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) + float longitude = 1.0; + #else + float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; + + // Correct the angle when max < min + // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) + longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); + #endif + + // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) + longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; + #endif + #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) + longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; + #endif + + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) + longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; + #endif + #endif + + // Compute latitude + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) + float latitude = 1.0; + #else + float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) + latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; + #endif + #endif + + // Compute height + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) + // TODO: This breaks down when minBounds == maxBounds. To fix it, this + // function would have to know if ray is intersecting the front or back of the shape + // and set the shape space position to 1 (front) or 0 (back) accordingly. + float height = 1.0; + #else + #if defined(ELLIPSOID_IS_SPHERE) + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; + #else + float height = length(posEllipsoid); #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } + #else + #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) + // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). + // This is an optimization so that math can be done with ellipses instead of ellipsoids. + vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); + float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; + #else + // TODO: this is probably not correct + float height = length(posEllipsoid); #endif -/*--------------------------------------------------------------------------*/ - } #endif -/*--------------------------------------------------------------------------*/ - } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); -} -`;function QA(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=jn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(QA.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});QA.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};QA.prototype.get=function(e){return this._stages[e]};function Vdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}QA.prototype.update=function(e,t){this._selectedDirty=Vdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Sl=QA;var Do={};function j4(e){let r=`#define USE_STEP_SIZE -${ZA}`,o=new Ar({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:bf.LINEAR}),s=new Ar({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:bf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Sl({name:e,stages:[o,s],uniforms:a})}Do.createBlurStage=function(){return j4("czm_blur")};Do.createDepthOfFieldStage=function(){let e=j4("czm_depth_of_field_blur"),t=new Ar({name:"czm_depth_of_field_composite",fragmentShader:B4,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Sl({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Do.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Do.createEdgeDetectionStage=function(){let e=jn();return new Ar({name:`czm_edge_detection_${e}`,fragmentShader:N4,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Do.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function kdt(e){if(!l(e))return Do.createEdgeDetectionStage();let t=new Sl({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; -`,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); - if (edge${a}.a > 0.0) - { - color = edge${a}; - break; - } -`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; -void main() { - vec4 color = vec4(0.0); - for (int i = 0; i < ${e.length}; i++) - { -${r} } - out_FragColor = color; -} -`,s=new Ar({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new Sl({name:"czm_edge_detection_composite",stages:[t,s]})}Do.createSilhouetteStage=function(e){let t=kdt(e),n=new Ar({name:"czm_silhouette_color_edges",fragmentShader:G4,uniforms:{silhouetteTexture:t.name}});return new Sl({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Do.isSilhouetteSupported=function(e){return e.context.depthTexture};Do.createBloomStage=function(){let e=new Ar({name:"czm_bloom_contrast_bias",fragmentShader:M4,uniforms:{contrast:128,brightness:-.3}}),t=j4("czm_bloom_blur"),n=new Sl({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ar({name:"czm_bloom_generate_composite",fragmentShader:O4,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new Sl({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Do.createAmbientOcclusionStage=function(){let e=new Ar({name:"czm_ambient_occlusion_generate",fragmentShader:D4,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=j4("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Sl({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new Ar({name:"czm_ambient_occlusion_composite",fragmentShader:I4,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(o){e.uniforms.intensity=o}},bias:{get:function(){return e.uniforms.bias},set:function(o){e.uniforms.bias=o}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(o){e.uniforms.lengthCap=o}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(o){e.uniforms.stepSize=o}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(o){e.uniforms.frustumLength=o}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(o){e.uniforms.randomTexture=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(o){i.uniforms.ambientOcclusionOnly=o}}}),new Sl({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Do.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var zdt=`#define FXAA_QUALITY_PRESET 39 -${W4} -${U4}`;Do.createFXAAStage=function(){return new Ar({name:"czm_FXAA",fragmentShader:zdt,sampleMode:bf.LINEAR})};Do.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=w4,new Ar({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Do.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=F4,new Ar({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Do.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=H4,new Ar({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Do.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=k4,new Ar({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Do.createAutoExposureStage=function(){return new oV};Do.createBlackAndWhiteStage=function(){return new Ar({name:"czm_black_and_white",fragmentShader:P4,uniforms:{gradations:5}})};Do.createBrightnessStage=function(){return new Ar({name:"czm_brightness",fragmentShader:R4,uniforms:{brightness:.5}})};Do.createNightVisionStage=function(){return new Ar({name:"czm_night_vision",fragmentShader:z4})};Do.createDepthViewStage=function(){return new Ar({name:"czm_depth_view",fragmentShader:L4})};Do.createLensFlareStage=function(){return new Ar({name:"czm_lens_flare",fragmentShader:V4,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var Yd=Do;function $p(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function pI(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function _q(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[pI(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[pI(d)]=!0)}}}return i.name}function hI(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=hI(e,t,n,p,r):a=_q(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=pI(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=pI(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[pI(i.get(p))]=!0}return a}function Hdt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=hI(e,t,n,i,void 0);a=hI(e,t,n,r,a),a=_q(e,t,n,o,a),a=hI(e,t,n,e,a),_q(e,t,n,s,a)}else hI(e,t,n,e,void 0);return n}function Gdt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let h=d.stages,A=h.length,x=!1;for(let C=0;C<A;++C)if(n[h[C]]){x=!0;break}if(!x)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function Wdt(e,t){let n=Hdt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Gdt(e,i,n[i]))}function gq(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function jdt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new oi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}$p.prototype.updateDependencies=function(){this._updateDependencies=!0};$p.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(gq(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Wdt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,gq(this),jdt(this,e))};$p.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};$p.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};$p.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};$p.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){return gq(this),ue(this)};var vb=$p;var _I={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===_I.REINHARD||e===_I.MODIFIED_REINHARD||e===_I.FILMIC||e===_I.ACES}},$A=Object.freeze(_I);var yq=[];function Lc(){let e=Yd.createFXAAStage(),t=Yd.createAmbientOcclusionStage(),n=Yd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Yd.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=$A.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new vb(this),o={},s=yq;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(Lc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return Aq(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case $A.REINHARD:n=Yd.createReinhardTonemappingStage(t);break;case $A.MODIFIED_REINHARD:n=Yd.createModifiedReinhardTonemappingStage(t);break;case $A.FILMIC:n=Yd.createFilmicTonemappingStage(t);break;default:n=Yd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function Aq(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._stages=t}Lc.prototype.add=function(e){let t=this._stageNames,n=yq;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Lc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=yq;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Lc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Lc.prototype.get=function(e){return Aq(this),this._stages[e]};Lc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Lc.prototype.getStageByName=function(e){return this._stageNames[e]};Lc.prototype.update=function(e,t,n){Aq(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages,s=r.length=o.length,a,c,u=0;for(a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&(r[u++]=c);r.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(r[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,h=this._tonemapping,A=this._fxaa;h.enabled=n;let x=d.enabled&&d._isSupported(e),C=p.enabled&&p._isSupported(e),T=h.enabled&&h._isSupported(e),E=A.enabled&&A._isSupported(e);if((f||this._textureCacheDirty||x!==this._aoEnabled||C!==this._bloomEnabled||T!==this._tonemappingEnabled||E!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=x,this._bloomEnabled=C,this._tonemappingEnabled=T,this._fxaaEnabled=E,this._textureCacheDirty=!1),l(this._randomTexture)&&!x&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&x){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new Bt({context:e,pixelFormat:ct.RGB,pixelDatatype:Qe.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new mn({wrapS:Pn.REPEAT,wrapT:Pn.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST})})}for(this._textureCache.update(e),A.update(e,t),d.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=o.length,a=0;a<s;++a)o[a].update(e,t);for(u=0,a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==r.length,f&&this.update(e,t,n)};Lc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function ex(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Lc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return ex(t)};function gh(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}let o=e.length,s;if(e.inputPreviousStageTexture)for(gh(e.get(0),t,n,i,r),s=1;s<o;++s)gh(e.get(s),t,ex(e.get(s-1)),i,r);else for(s=0;s<o;++s)gh(e.get(s),t,n,i,r)}Lc.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,h=f.enabled&&f._isSupported(e),A=s.enabled&&s._isSupported(e);if(!A&&!d&&!p&&!h&&o===0)return;let x=t;d&&a.ready&&(gh(a,e,x,n,i),x=ex(a)),p&&c.ready&&(gh(c,e,x,n,i),x=ex(c)),g&&u.ready&&gh(u,e,x,n,i),h&&f.ready&&(gh(f,e,x,n,i),x=ex(f));let C=x;if(o>0){gh(r[0],e,x,n,i);for(let T=1;T<o;++T)gh(r[T],e,ex(r[T-1]),n,i);C=ex(r[o-1])}A&&s.ready&&gh(s,e,C,n,i)};Lc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var Y4=Lc;function Cu(){fe.throwInstantiationError()}Cu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Cu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Cu.prototype.update=fe.throwInstantiationError;Cu.prototype.beginUpdate=fe.throwInstantiationError;Cu.prototype.endUpdate=fe.throwInstantiationError;Cu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Cu.prototype.loadTile=fe.throwInstantiationError;Cu.prototype.computeTileVisibility=fe.throwInstantiationError;Cu.prototype.showTileThisFrame=fe.throwInstantiationError;Cu.prototype.computeDistanceToTile=fe.throwInstantiationError;Cu.prototype.isDestroyed=fe.throwInstantiationError;Cu.prototype.destroy=fe.throwInstantiationError;var n0e=Cu;function tx(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}tx.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};tx.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(B.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?bmt(this,e):Omt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Ydt=new m,qdt=new m,Xdt=new m,Kdt=new m,Jdt=new m,Zdt=new m,Qdt=new m,$dt=new he,emt=new B,tmt=new vi,nmt=new rn,imt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};tx.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(B.IDENTITY);let i=Ydt,r=qdt,o=Xdt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,r),r),m.cross(m.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)m.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,m.negate(m.UNIT_Z,r),m.clone(m.UNIT_Y,o);else{m.clone(u.positionWC,i),m.clone(u.directionWC,r),m.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,Qdt),d=Mt.eastNorthUpToFixedFrame(f,t,emt);B.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,$dt),i),B.multiplyByPointAsVector(d,r,r),B.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=nmt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=tmt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=imt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=Mmt(a);gI(this,c),this._previousMode===ne.SCENE2D?Rmt(this,e,a,c):(a.position2D=B.multiplyByPoint(fr.TRANSFORM_2D,i,Kdt),a.direction2D=B.multiplyByPointAsVector(fr.TRANSFORM_2D,r,Jdt),a.up2D=B.multiplyByPointAsVector(fr.TRANSFORM_2D,o,Zdt),n._mode=ne.MORPHING,m0e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Tq={position:new m,direction:new m,up:new m,frustum:void 0},r0e=new vi;tx.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(B.IDENTITY),this._previousMode===ne.SCENE2D)hmt(this,e,t);else{let i;e>0?(i=Tq,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=o0e(this,t);let r,o=n.camera;o.frustum instanceof rn?r=o.frustum.clone():(r=r0e,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=p0e(i);gI(this,s),Cq(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};tx.prototype.isDestroyed=function(){return!1};tx.prototype.destroy=function(){return q4(this),ue(this)};function gI(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new gf(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function q4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var rmt=new he,omt=new m,smt=new B;function o0e(e,t){let n=e._scene,i=n.camera,r=Tq,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,rmt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,omt),f=Mt.eastNorthUpToFixedFrame(u,t,smt);return B.multiplyByPointAsVector(f,i.direction,s),B.multiplyByPointAsVector(f,i.up,a),r}var amt=new m,cmt=new m,lmt=new m,umt=new m,fmt=new m,dmt=new m;function Cq(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(o.position,amt),a=m.clone(o.direction,cmt),c=m.clone(o.up,lmt),u=B.multiplyByPoint(fr.TRANSFORM_2D_INVERSE,n.position,umt),f=B.multiplyByPointAsVector(fr.TRANSFORM_2D_INVERSE,n.direction,fmt),d=B.multiplyByPointAsVector(fr.TRANSFORM_2D_INVERSE,n.up,dmt);function p(h){Sf(s,u,h.time,o.position),Sf(a,f,h.time,o.direction),Sf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){h0e(e,r,0,1,t,i)}});e._currentTweens.push(g)}var mmt=new rn,s0e=new m,a0e=new m,c0e=new m,Eq=new m,l0e=new m,u0e=new m;function hmt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Tq,m.fromDegrees(0,0,5*n.maximumRadius,n,o.position),m.negate(o.position,o.direction),m.normalize(o.direction,o.direction),m.clone(m.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=o0e(e,n));let s;e._morphToOrthographic?(s=mmt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=r0e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=p0e(o);gI(e,a);let c;e._morphToOrthographic?c=function(){Cq(e,t,o,a)}:c=function(){d0e(e,t,o,function(){Cq(e,t,o,a)})},t>0?(i._mode=ne.SCENE2D,r.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,Eq),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Sf(e,t,n,i){return m.lerp(e,t,n,i)}function f0e(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var pmt=new m,_mt=new m,gmt=new m,xq=new m,ymt=new m,Amt=new m,xmt=new Po,Cmt=new On,Tmt=new m,Emt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function bmt(e,t){t*=.5;let n=e._scene,i=n.camera,r=m.clone(i.position,pmt),o=m.clone(i.direction,_mt),s=m.clone(i.up,gmt),a=m.negate(m.UNIT_Z,ymt),c=m.clone(m.UNIT_Y,Amt),u=xq;if(t>0)m.clone(m.ZERO,xq),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{m.clone(r,xq);let x=Cmt;B.multiplyByPoint(fr.TRANSFORM_2D,r,x.origin),B.multiplyByPointAsVector(fr.TRANSFORM_2D,o,x.direction);let C=n.globe;if(l(C)){let T=C.pickWorldCoordinates(x,n,!0,Tmt);l(T)&&(B.multiplyByPoint(fr.TRANSFORM_2D_INVERSE,T,u),u.z+=m.distance(r,u))}}let f=xmt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=Emt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=_0e(d);gI(e,p);function g(x){Sf(r,u,x.time,i.position),Sf(o,a,x.time,i.direction),Sf(s,c,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(x,C){x.position.z=C}let A=n.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){f0e(e,t,d,h,p)}});e._currentTweens.push(A)}var i0e=new he,Smt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Po},vmt={position:new m,direction:new m,up:new m,frustum:void 0},wmt=new m,Dmt=new On,Imt=new B,Pmt=new m;function Omt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=Smt;if(t>0)m.clone(m.ZERO,o.position),o.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,i0e),i.mapProjection.project(i0e,o.position),m.negate(m.UNIT_Z,o.direction),m.clone(m.UNIT_Y,o.up);let d=Dmt;m.clone(o.position2D,d.origin);let p=m.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,Pmt),h=Mt.eastNorthUpToFixedFrame(g,n,Imt);B.inverseTransformation(h,h),B.multiplyByPointAsVector(h,p,p),B.multiplyByPointAsVector(fr.TRANSFORM_2D,p,p);let A=i.globe;if(l(A)){let x=A.pickWorldCoordinates(d,i,!0,wmt);if(l(x)){let C=m.distance(o.position2D,x);x.x+=C,m.clone(x,o.position2D)}}}function s(d,p){d.position.x=p}B.multiplyByPoint(fr.TRANSFORM_2D,o.position,o.position2D),B.multiplyByPointAsVector(fr.TRANSFORM_2D,o.direction,o.direction2D),B.multiplyByPointAsVector(fr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=vmt;B.multiplyByPoint(fr.TRANSFORM_2D_INVERSE,o.position2D,c.position),m.clone(o.direction,c.direction),m.clone(o.up,c.up),c.frustum=a;let u=_0e(c);gI(e,u);function f(){f0e(e,t,o,s,u)}m0e(e,t,o,f)}function d0e(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Rmt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=m.clone(n.position,Eq),a=m.clone(n.direction,l0e),c=m.clone(n.up,u0e);r._mode=ne.MORPHING;function u(){o.frustum=n.frustum.clone();let f=m.clone(o.position,s0e),d=m.clone(o.direction,a0e),p=m.clone(o.up,c0e);f.z=s.z;function g(A){Sf(f,s,A.time,o.position),Sf(d,a,A.time,o.direction),Sf(p,c,A.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right)}let h=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():d0e(e,0,n,u)}function m0e(e,t,n,i){let r=e._scene,o=r.camera,s=m.clone(o.position,s0e),a=m.clone(o.direction,a0e),c=m.clone(o.up,c0e),u=m.clone(n.position2D,Eq),f=m.clone(n.direction2D,l0e),d=m.clone(n.up2D,u0e);function p(h){Sf(s,u,h.time,o.position),Sf(a,f,h.time,o.direction),Sf(c,d,h.time,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Fo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){h0e(e,r,1,0,t,i)}});e._currentTweens.push(g)}function h0e(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Fo.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function p0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),q4(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,o)}}function _0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),q4(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,r)}}function Mmt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),q4(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,o)}}var X4=tx;function K4(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(K4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});K4.prototype.cancelTween=function(){this._tweens.remove(this)};function qd(){this._tweens=[]}Object.defineProperties(qd.prototype,{length:{get:function(){return this._tweens.length}}});qd.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new K4(this);let t=e.duration/Zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Zn.SECONDS_PER_MILLISECOND,r=y(e.easingFunction,Fo.LINEAR_NONE),o=e.startObject,s=new eme(o);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new K4(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};qd.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};qd.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};qd.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};qd.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};qd.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};qd.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};qd.prototype.get=function(e){return this._tweens[e]};qd.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Zn.SECONDS_PER_MILLISECOND:Ci();n<t.length;){let i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var wb=qd;function AI(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Ni.LEFT_DRAG,this.zoomEventTypes=[Ni.RIGHT_DRAG,Ni.WHEEL,Ni.PINCH],this.rotateEventTypes=Ni.LEFT_DRAG,this.tiltEventTypes=[Ni.MIDDLE_DRAG,Ni.PINCH,{eventType:Ni.LEFT_DRAG,modifier:Ca.CTRL},{eventType:Ni.RIGHT_DRAG,modifier:Ca.CTRL}],this.lookEventTypes={eventType:Ni.LEFT_DRAG,modifier:Ca.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new BV(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new wb,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Bmt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Lmt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Nmt=.4;function Fmt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Nmt){let g=Bmt(p,i),h=e.getLastMovement(t,n);if(!l(h)||Lmt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=H.clone(h.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let A=e.getStartMousePosition(t,n);r(o,A,a)}}}function Umt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var g0e=[];function Nc(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(g0e[0]=n,n=g0e);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),Umt(e,o)):r<1&&Fmt(s,f,d,r,i,e,o))}}var J4=new On,Vmt=new m,kmt=new H,zmt=new m,Hmt=new H,Gmt=new m,Wmt=new m,jmt=new m,Ymt=new m,qmt=new m,Xmt=new m,Kmt=new m,Jmt=new m,Zmt=new m,Qmt=new m,$mt=new m,eht=new m,tht=new m,nht=new m,iht=new m,nx=new m,y0e=new m,A0e=new m,bq={orientation:new lc};function Rq(e,t,n,i,r,o){let s=1;l(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let h=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(r-u)<1||h<0&&Math.abs(r-f)<1)return;r-h<u?h=r-u-1:r-h>f&&(h=r-f)}let A=e._scene,x=A.camera,C=A.mode,T=bq.orientation;if(T.heading=x.heading,T.pitch=x.pitch,T.roll=x.roll,x.frustum instanceof rn){Math.abs(h)>0&&(x.zoomIn(h),x._adjustOrthographicFrustum(!0));return}let E=y(n.inertiaEnabled,H.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,w=e._rotatingZoom,D;if(E||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),l(e._globe)&&(C===ne.SCENE2D?(D=x.getPickRay(t,J4).origin,D=m.fromElements(D.y,D.z,D.x)):D=Ry(e,t,Vmt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,w=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(h);return}let R=C===ne.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(w=!0),!E||w){if(C===ne.SCENE2D){let O=e._zoomWorldPosition,L=x.position;if(!m.equals(O,L)&&x.positionCartographic.height<e._maxCoord.x*2){let N=x.position.x,_=m.subtract(O,L,zmt);m.normalize(_,_);let b=m.distance(O,L)*h/(x.getMagnitude()*.5);x.move(_,b*.5),(x.position.x<0&&N>0||x.position.x>0&&N<0)&&(D=x.getPickRay(t,J4).origin,D=m.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=m.clone(D,e._zoomWorldPosition))}}else if(C===ne.SCENE3D){let O=m.normalize(x.position,qmt);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,O))<.6)R=!0;else{let L=A.canvas,N=Hmt;N.x=L.clientWidth/2,N.y=L.clientHeight/2;let _=Ry(e,N,Gmt);if(!l(_))R=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,O)>=-.5)R=!0;else{let b=Kmt;m.clone(x.position,b);let v=e._zoomWorldPosition,I=Xmt;if(I=m.normalize(v,I),m.dot(I,O)<0)return;let M=iht,F=Qmt;m.clone(x.direction,F),m.add(b,m.multiplyByScalar(F,1e3,nx),M);let k=$mt,V=eht;m.subtract(v,b,k),m.normalize(k,V);let G=m.dot(O,V);if(G>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-G),q=m.magnitude(b),Y=m.magnitude(v),Q=q-h,W=m.magnitude(k),K=Math.asin(P.clamp(W/Y*Math.sin(U),-1,1)),J=Math.asin(P.clamp(Q/Y*Math.sin(U),-1,1)),me=K-J+U,ye=Jmt;m.normalize(b,ye);let se=Zmt;se=m.cross(V,ye,se),se=m.normalize(se,se),m.normalize(m.cross(ye,se,nx),F),m.multiplyByScalar(m.normalize(M,nx),m.magnitude(M)-h,M),m.normalize(b,b),m.multiplyByScalar(b,Q,b);let pe=tht;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,y0e),m.multiplyByScalar(F,Math.sin(me),A0e),nx),Q,pe),m.add(b,pe,b),m.normalize(M,ye),m.normalize(m.cross(ye,se,nx),F);let xe=nht;m.multiplyByScalar(m.add(m.multiplyByScalar(ye,Math.cos(me)-1,y0e),m.multiplyByScalar(F,Math.sin(me),A0e),nx),m.magnitude(M),xe),m.add(M,xe,M),m.clone(b,x.position),m.normalize(m.subtract(M,b,nx),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(bq);return}else{let b=m.normalize(_,Wmt),v=m.normalize(e._zoomWorldPosition,jmt),I=m.dot(v,b);if(I>0&&I<1){let M=P.acosClamped(I),F=m.cross(v,b,Ymt),k=Math.abs(M)>P.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-h,V=h/k;x.rotate(F,M*V)}}}}e._rotatingZoom=!R}if(!E&&R||S){let O,L=Zi.wgs84ToWindowCoordinates(A,e._zoomWorldPosition,kmt);C!==ne.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&l(L)?O=x.getPickRay(L,J4):O=x.getPickRay(t,J4);let N=O.direction;(C===ne.COLUMBUS_VIEW||C===ne.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),x.move(N,h),e._zoomingOnVector=!0}else x.zoomIn(h);e._cameraUnderground||x.setView(bq)}var rht=new On,oht=new On,sht=new m;function aht(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,rht).origin,s=r.getPickRay(n.endPosition,oht).origin;o=m.fromElements(o.y,o.z,o.x,o),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(o,s,sht),c=m.magnitude(a);c>0&&(m.normalize(a,a),r.move(a,c))}function x0e(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Rq(e,t,n,e._zoomFactor,r.getMagnitude())}var cht=new H,lht=new H;function C0e(e,t,n){if(l(n.angleAndHeight)){uht(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=cht;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=H.normalize(c,c);let u=lht;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function uht(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function fht(e){let t=e._scene.mapMode2D===hu.ROTATE;B.equals(B.IDENTITY,e._scene.camera.transform)?(Nc(e,e.enableTranslate,e.translateEventTypes,aht,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Nc(e,e.enableZoom,e.zoomEventTypes,x0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Nc(e,e.enableRotate,e.tiltEventTypes,C0e,e.inertiaSpin,"_lastInertiaTiltMovement")):(Nc(e,e.enableZoom,e.zoomEventTypes,x0e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Nc(e,e.enableRotate,e.translateEventTypes,C0e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var w0e=new On,dht=new m,mht=new m;function Ry(e,t,n){let i=e._scene,r=e._globe,o=i.camera;if(!l(r))return;let s=!e._cameraUnderground,a;i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,dht));let c=o.getPickRay(t,w0e),u=r.pickWorldCoordinates(c,i,s,mht),f=l(a)?m.distance(a,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?m.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?m.clone(a,n):m.clone(u,n)}var hht=new he;function nz(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,hht);l(c)&&(o=c.height)}else o=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-o)}var pht=new m;function D0e(e,t){let n=t.origin,i=t.direction,r=nz(e),o=m.normalize(n,pht),s=Math.abs(m.dot(o,i));return s=Math.max(s,.5)*2,r*s}function I0e(e,t,n,i){let r=m.distance(t.origin,n),o=nz(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),On.getPoint(t,r,i)}function P0e(e,t,n,i){let r;return l(n)?(r=m.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=nz(e))):r=nz(e),On.getPoint(t,r,i)}var _ht=new H;function O0e(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,_ht),r=e._strafeEndMousePosition;H.add(r,i,r),t.endPosition=r,Mq(e,t,e._strafeStartPosition),t.endPosition=n}var T0e=new On,ght=new On,Sq=new m,yht=new m,Aht=new m,xht=new m,Cht=new fn(m.UNIT_X,0),Tht=new H,Eht=new H;function bht(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Eu(e,t,n);return}if(e._strafing){O0e(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=H.clone(n.startPosition,Tht),a=H.clone(n.endPosition,Eht),c=r.getPickRay(s,T0e),u=m.clone(m.ZERO,xht),f=m.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=Ry(e,s,Sq),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let E=d;o&&(E=P0e(e,c,d,Sq)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),m.clone(E,e._strafeStartPosition),e._strafing=!0,Mq(e,n,e._strafeStartPosition);return}let p=fn.fromPointNormal(u,f,Cht);c=r.getPickRay(s,T0e);let g=Ki.rayPlane(c,p,Sq),h=r.getPickRay(a,ght),A=Ki.rayPlane(h,p,yht);if(!l(g)||!l(A)){e._looking=!0,Eu(e,t,n),H.clone(t,e._translateMousePosition);return}let x=m.subtract(g,A,Aht),C=x.x;x.x=x.y,x.y=x.z,x.z=C;let T=m.magnitude(x);T>P.EPSILON6&&(m.normalize(x,x),r.move(x,T))}var R0e=new H,Q4=new On,$4=new m,Sht=new m,M0e=new B,vht=new B,wht=new m,Dht=new fn(m.UNIT_X,0),vq=new m,Iq=new he,B0e=new B,Iht=new Ne,Pht=new Z,ez=new m;function Oht(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Eu(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Rht(e,t,n)):Mht(e,t,n)}function Rht(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=R0e;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,Q4),c=m.UNIT_X,u=a.origin,f=a.direction,d,p=m.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-m.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Eu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(f,d,$4);m.add(u,g,g);let h=i.mapProjection,A=h.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let x=h.unproject(g,Iq);A.cartographicToCartesian(x,g);let C=Mt.eastNorthUpToFixedFrame(g,A,M0e),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=B.clone(r.transform,B0e);r._setTransform(C),Tu(e,t,n,m.UNIT_Z),r._setTransform(S),e._globe=T,e._ellipsoid=E;let w=E.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w}function Mht(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=m.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,$4);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=Ry(e,t,$4)),!l(s)){a=r.getPickRay(t,Q4);let _=a.origin,b=a.direction,v,I=m.dot(c,b);if(Math.abs(I)>P.EPSILON6&&(v=-m.dot(c,_)/I),!l(v)||v<=0){e._looking=!0,Eu(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(b,v,$4),m.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,Q4)),I0e(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let u=i.canvas,f=R0e;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,Q4);let d=m.clone(m.ZERO,wht);d.x=s.x;let p=fn.fromPointNormal(d,c,Dht),g=Ki.rayPlane(a,p,Sht),h=r._projection,A=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=h.unproject(s,Iq);A.cartographicToCartesian(x,s);let C=Mt.eastNorthUpToFixedFrame(s,A,M0e),T;l(g)?(m.fromElements(g.y,g.z,g.x,g),x=h.unproject(g,Iq),A.cartographicToCartesian(x,g),T=Mt.eastNorthUpToFixedFrame(g,A,vht)):T=C;let E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=B.clone(r.transform,B0e);r._setTransform(C);let R=m.cross(m.UNIT_Z,m.normalize(r.position,vq),vq),O=m.dot(r.right,R);if(Tu(e,t,n,w,!1,!0),r._setTransform(T),O<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(w=void 0);let b=r.constrainedAxis;r.constrainedAxis=void 0,Tu(e,t,n,w,!0,!1),r.constrainedAxis=b}else Tu(e,t,n,w,!0,!1);if(l(r.constrainedAxis)){let _=m.cross(r.direction,r.constrainedAxis,ez);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,r.right)<0&&m.negate(_,_),m.cross(_,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(D),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(r.positionWC,vq);if(e.enableCollisionDetection&&Nq(e),!m.equals(r.positionWC,N)){r._setTransform(T),r.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>_&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(_),r.position));let b=m.angleBetween(N,r.position),v=m.cross(N,r.position,N);m.normalize(v,v);let I=Ne.fromAxisAngle(v,b,Iht),M=Z.fromQuaternion(I,Pht);Z.multiplyByVector(M,r.direction,r.direction),Z.multiplyByVector(M,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(D)}}var L0e=new H,N0e=new On,F0e=new m;function Bht(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=L0e,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,N0e),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Ry(e,a,F0e));let g;if(l(p)&&(g=m.distance(u,p)),s){let h=D0e(e,c,d);l(g)?g=Math.min(g,h):g=h}if(!l(g)){let h=m.UNIT_X;g=-m.dot(h,u)/m.dot(h,f)}Rq(e,t,n,e._zoomFactor,g)}function Lht(e){let n=e._scene.camera;if(!B.equals(B.IDENTITY,n.transform))Nc(e,e.enableRotate,e.rotateEventTypes,Tu,e.inertiaSpin,"_lastInertiaSpinMovement"),Nc(e,e.enableZoom,e.zoomEventTypes,U0e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Nc(e,e.enableTilt,e.tiltEventTypes,Oht,e.inertiaSpin,"_lastInertiaTiltMovement"),Nc(e,e.enableTranslate,e.translateEventTypes,bht,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Nc(e,e.enableZoom,e.zoomEventTypes,Bht,e.inertiaZoom,"_lastInertiaZoomMovement"),Nc(e,e.enableLook,e.lookEventTypes,Eu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var Nht=new On,Fht=new fn(m.UNIT_X,0),Uht=new m,Vht=new m,kht=new m;function Mq(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,Nht),s=m.clone(r.direction,Vht);i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=fn.fromPointNormal(n,s,Fht),c=Ki.rayPlane(o,a,Uht);l(c)&&(s=m.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(r.position,s,r.position))}var E0e=new m,zht=new he,Pq=new m,Oq=new re,Hht=new m,Ght=new m;function Wht(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!B.equals(r.transform,B.IDENTITY)){Tu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,Hht);if(H.equals(t,e._rotateMousePosition)){if(e._looking)Eu(e,t,n,u);else if(e._rotating)Tu(e,t,n);else if(e._strafing)O0e(e,n);else{if(m.magnitude(r.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=Pq,c.x=c.y=c.z=a,s=re.fromCartesian3(c,Oq),Dq(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,zht).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Ry(e,n.startPosition,kht);if(l(p)){let g=!1,h=r.getPickRay(n.startPosition,w0e);if(o)g=!0,P0e(e,h,p,p);else{let A=s.geodeticSurfaceNormal(p,Ght);Math.abs(m.dot(h.direction,A))<.05?g=!0:g=m.magnitude(r.position)<m.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,Mq(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=Pq,c.x=c.y=c.z=a,s=re.fromCartesian3(c,Oq),Dq(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,Eu(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,E0e))?(Dq(e,t,n,e._ellipsoid),m.clone(E0e,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Tu(e,t,n)):(e._looking=!0,Eu(e,t,n,u));H.clone(t,e._rotateMousePosition)}function Tu(e,t,n,i,r,o){r=y(r,!1),o=y(o,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=m.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let h=d*p*Math.PI*2,A=d*g*Math.PI;r||a.rotateRight(h),o||a.rotateUp(A),a.constrainedAxis=u}var jht=oe.clone(oe.UNIT_W),Yht=oe.clone(oe.UNIT_W),Z4=new m,wq=new m,qht=new m,Xht=new m,Kht=new H,Jht=new H;function Dq(e,t,n,i){let o=e._scene.camera,s=H.clone(n.startPosition,Kht),a=H.clone(n.endPosition,Jht),c=o.pickEllipsoid(s,i,jht),u=o.pickEllipsoid(a,i,Yht);if(!l(c)||!l(u)){e._rotating=!0,Tu(e,t,n);return}if(c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),l(o.constrainedAxis)){let f=o.constrainedAxis,d=m.mostOrthogonalAxis(f,Z4);m.cross(d,f,d),m.normalize(d,d);let p=m.cross(f,d,wq),g=m.magnitude(c),h=m.dot(f,c),A=Math.acos(h/g),x=m.multiplyByScalar(f,h,qht);m.subtract(c,x,x),m.normalize(x,x);let C=m.magnitude(u),T=m.dot(f,u),E=Math.acos(T/C),S=m.multiplyByScalar(f,T,Xht);m.subtract(u,S,S),m.normalize(S,S);let w=Math.acos(m.dot(x,d));m.dot(x,p)<0&&(w=P.TWO_PI-w);let D=Math.acos(m.dot(S,d));m.dot(S,p)<0&&(D=P.TWO_PI-D);let R=w-D,O;m.equalsEpsilon(f,o.position,P.EPSILON2)?O=o.right:O=m.cross(f,o.position,Z4);let L=m.cross(f,O,Z4),N=m.dot(L,m.subtract(c,f,wq)),_=m.dot(L,m.subtract(u,f,wq)),b;N>0&&_>0?b=E-A:N>0&&_<=0?m.dot(o.position,f)>0?b=-A-E:b=A+E:b=A-E,o.rotateRight(R),o.rotateUp(b)}else{m.normalize(c,c),m.normalize(u,u);let f=m.dot(c,u),d=m.cross(c,u,Z4);if(f<1&&!m.equalsEpsilon(d,m.ZERO,P.EPSILON14)){let p=Math.acos(f);o.rotate(d,p)}}}var Zht=new m,Qht=new he,b0e=0;function U0e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=L0e,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,N0e),d,p=r.cartesianToCartographic(s.position,Qht).height,g=Math.abs(b0e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Ry(e,u,F0e));let A;if(l(d)&&(A=m.distance(f.origin,d),b0e=A),c){let C=D0e(e,f,p);l(A)?A=Math.min(A,C):A=C}l(A)||(A=p);let x=m.normalize(s.position,Zht);Rq(e,t,n,e._zoomFactor,A,m.dot(x,s.direction))}var V0e=new H,tz=new On,yI=new m,$ht=new m,k0e=new B,ept=new B,z0e=new B,tpt=new Ne,npt=new Z,Bq=new he,Lq=new m;function ipt(e,t,n){let r=e._scene.camera;if(!B.equals(r.transform,B.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,Lq);Eu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Bq);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,opt(e,t,n)):spt(e,t,n)}var rpt=new he;function opt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,rpt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=V0e;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,tz),d,p=Ki.rayEllipsoid(f,i);if(l(p))d=On.getPoint(f,p.start,yI);else if(a>e._minimumTrackBallHeight){let T=Ki.grazingAltitudeLocation(f,i);if(!l(T))return;let E=i.cartesianToCartographic(T,Bq);E.height=0,d=i.cartographicToCartesian(E,yI)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(o.position,Lq);Eu(e,t,n,T),H.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,k0e),h=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=B.clone(o.transform,z0e);o._setTransform(g),Tu(e,t,n,m.UNIT_Z),o._setTransform(x),e._globe=h,e._ellipsoid=A;let C=A.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function spt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(H.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,yI);else{if(a=Ry(e,t,yI),!l(a)){if(c=o.getPickRay(t,tz),u=Ki.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Bq).height<=e._minimumTrackBallHeight){e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(o.position,Lq);Eu(e,t,n,b),H.clone(t,e._tiltCenterMousePosition)}return}a=On.getPoint(c,u.start,yI)}s&&(l(c)||(c=o.getPickRay(t,tz)),I0e(e,c,a,a)),H.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let f=r.canvas,d=V0e;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,tz);let p=m.magnitude(a),g=m.fromElements(p,p,p,Pq),h=re.fromCartesian3(g,Oq);if(u=Ki.rayEllipsoid(c,h),!l(u))return;let A=m.magnitude(c.origin)>p?u.start:u.stop,x=On.getPoint(c,A,$ht),C=Mt.eastNorthUpToFixedFrame(a,i,k0e),T=Mt.eastNorthUpToFixedFrame(x,h,ept),E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=m.UNIT_Z,D=B.clone(o.transform,z0e);o._setTransform(T);let R=m.cross(x,o.positionWC,ez);if(m.dot(o.rightWC,R)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(w=void 0);let b=o.constrainedAxis;o.constrainedAxis=void 0,Tu(e,t,n,w,!0,!1),o.constrainedAxis=b}else Tu(e,t,n,w,!0,!1);if(o._setTransform(C),Tu(e,t,n,w,!1,!0),l(o.constrainedAxis)){let _=m.cross(o.direction,o.constrainedAxis,ez);m.equalsEpsilon(_,m.ZERO,P.EPSILON6)||(m.dot(_,o.right)<0&&m.negate(_,_),m.cross(_,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(D),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let N=m.clone(o.positionWC,ez);if(e.enableCollisionDetection&&Nq(e),!m.equals(o.positionWC,N)){o._setTransform(T),o.worldToCameraCoordinatesPoint(N,N);let _=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>_&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(_),o.position));let b=m.angleBetween(N,o.position),v=m.cross(N,o.position,N);m.normalize(v,v);let I=Ne.fromAxisAngle(v,b,tpt),M=Z.fromQuaternion(I,npt);Z.multiplyByVector(M,o.direction,o.direction),Z.multiplyByVector(M,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(D)}}var apt=new H,cpt=new H,S0e=new On,v0e=new On,lpt=new m,upt=new m;function Eu(e,t,n,i){let o=e._scene.camera,s=apt;s.x=n.startPosition.x,s.y=0;let a=cpt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,S0e),u=o.getPickRay(a,v0e),f=0,d,p;o.frustum instanceof rn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction);let g=m.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let h=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(h)?o.look(h,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,S0e),u=o.getPickRay(a,v0e),f=0,o.frustum instanceof rn?(d=c.origin,p=u.origin,m.add(o.direction,d,d),m.add(o.direction,p,p),m.subtract(d,o.position,d),m.subtract(p,o.position,p),m.normalize(d,d),m.normalize(p,p)):(d=c.direction,p=u.direction),g=m.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,h),l(i)){let A=o.direction,x=m.negate(i,lpt),C=m.equalsEpsilon(A,i,P.EPSILON2),T=m.equalsEpsilon(A,x,P.EPSILON2);if(!C&&!T){g=m.dot(A,i);let E=P.acosClamped(g);f>0&&f>E&&(f=E-P.EPSILON4),g=m.dot(A,x),E=P.acosClamped(g),f<0&&-f>E&&(f=-E+P.EPSILON4);let S=m.cross(i,A,upt);o.look(S,f)}else(C&&f<0||T&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function fpt(e){Nc(e,e.enableRotate,e.rotateEventTypes,Wht,e.inertiaSpin,"_lastInertiaSpinMovement"),Nc(e,e.enableZoom,e.zoomEventTypes,U0e,e.inertiaZoom,"_lastInertiaZoomMovement"),Nc(e,e.enableTilt,e.tiltEventTypes,ipt,e.inertiaSpin,"_lastInertiaTiltMovement"),Nc(e,e.enableLook,e.lookEventTypes,Eu)}var dpt=new B,mpt=new he;function Nq(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===ne.SCENE2D||n===ne.MORPHING)return;let r=t.camera,o=i.ellipsoid,s=t.mapProjection,a,c;B.equals(r.transform,B.IDENTITY)||(a=B.clone(r.transform,dpt),c=m.magnitude(r.position),r._setTransform(B.IDENTITY));let u=mpt;n===ne.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===ne.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0)}}l(a)&&(r._setTransform(a),f&&(m.normalize(r.position,r.position),m.negate(r.position,r.direction),m.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),m.normalize(r.direction,r.direction),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up)))}AI.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var hpt=new m,ppt=new m;AI.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;B.equals(t.transform,B.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let r=l(this._globe)?this._globe.terrainExaggeration:1,o=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=Yc.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Yc.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Yc.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,hpt),c=m.clone(t.directionWC,ppt);i===ne.SCENE2D?fht(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Lht(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,fpt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC))&&Nq(this),this._aggregator.reset()};AI.prototype.isDestroyed=function(){return!1};AI.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var iz=AI;var rz=`uniform sampler2D colorTexture; -uniform sampler2D colorTexture2; + #endif -uniform vec2 center; -uniform float radius; + return vec3(longitude, latitude, height); +} +`;var r4=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +#define OCTREE_FLAG_INTERNAL 0 +#define OCTREE_FLAG_LEAF 1 +#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 -in vec2 v_textureCoordinates; +#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops -void main() -{ - vec4 color0 = texture(colorTexture, v_textureCoordinates); - vec4 color1 = texture(colorTexture2, v_textureCoordinates); +uniform sampler2D u_octreeInternalNodeTexture; +uniform vec2 u_octreeInternalNodeTexelSizeUv; +uniform int u_octreeInternalNodeTilesPerRow; +#if (SAMPLE_COUNT > 1) +uniform sampler2D u_octreeLeafNodeTexture; +uniform vec2 u_octreeLeafNodeTexelSizeUv; +uniform int u_octreeLeafNodeTilesPerRow; +#endif - float x = length(gl_FragCoord.xy - center) / radius; - float t = smoothstep(0.5, 0.8, x); - out_FragColor = mix(color0 + color1, color1, t); -} -`;var oz=`uniform sampler2D colorTexture; +struct OctreeNodeData { + int data; + int flag; +}; -uniform float avgLuminance; -uniform float threshold; -uniform float offset; +struct TraversalData { + ivec4 octreeCoords; + int parentOctreeIndex; +}; -in vec2 v_textureCoordinates; +struct SampleData { + int megatextureIndex; + ivec4 tileCoords; + vec3 tileUv; + #if (SAMPLE_COUNT > 1) + float weight; + #endif +}; -float key(float avg) -{ - float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); - return max(0.0, guess) + 0.1; +// Integer mod: For WebGL1 only +int intMod(in int a, in int b) { + return a - (b * (a / b)); +} +int normU8_toInt(in float value) { + return int(value * 255.0); +} +int normU8x2_toInt(in vec2 value) { + return int(value.x * 255.0) + 256 * int(value.y * 255.0); +} +float normU8x2_toFloat(in vec2 value) { + return float(normU8x2_toInt(value)) / 65535.0; } -// See section 9. "The bright-pass filter" of Realtime HDR Rendering -// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf +OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { + vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -void main() -{ - vec4 color = texture(colorTexture, v_textureCoordinates); - vec3 xyz = czm_RGBToXYZ(color.rgb); - float luminance = xyz.r; + OctreeNodeData data; + data.data = normU8x2_toInt(texData.xy); + data.flag = normU8x2_toInt(texData.zw); + return data; +} - float scaledLum = key(avgLuminance) * luminance / avgLuminance; - float brightLum = max(scaledLum - threshold, 0.0); - float brightness = brightLum / (offset + brightLum); +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { + int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; + int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; + int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + return getOctreeNodeData(octreeUv); +} - xyz.r = brightness; - out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); +int getOctreeParentIndex(in int octreeIndex) { + int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; + int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; + vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); + vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); + int parentOctreeIndex = normU8x2_toInt(parentData.xy); + return parentOctreeIndex; } -`;function e_(){this._sceneFramebuffer=new Cb;let e=.125,t=new Array(6);t[0]=new Ar({fragmentShader:xu,textureScale:e,forcePowerOfTwo:!0,sampleMode:bf.LINEAR});let n=t[1]=new Ar({fragmentShader:oz,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new Ar({fragmentShader:ZA,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Ar({fragmentShader:ZA,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Ar({fragmentShader:xu,sampleMode:bf.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new Ar({fragmentShader:rz,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Sl({stages:t});let r=new vb(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}e_.prototype.get=function(e){return this._stages.get(e)};e_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var _pt=new oe,H0e=new H,gpt=new H,G0e=new B;function ypt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=B.computeViewportTransformation(n,0,1,G0e),u=B.multiplyByPoint(o,r,_pt),f=Mt.pointToGLWindowCoordinates(s,c,r,H0e);u.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=H.magnitude(H.subtract(d,f,d))*30*2,g=gpt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let h=t.drawingBufferWidth,A=t.drawingBufferHeight,x=e._stages,C=x.get(0),T=C.outputTexture.width,E=C.outputTexture.height,S=new Ke;S.width=T,S.height=E,c=B.computeViewportTransformation(S,0,1,G0e),f=Mt.pointToGLWindowCoordinates(s,c,r,H0e),g.x*=T/h,g.y*=E/A;let w=C.scissorRectangle;w.x=Math.max(f.x-g.x*.5,0),w.y=Math.max(f.y-g.y*.5,0),w.width=Math.min(g.x,h),w.height=Math.min(g.y,A);for(let D=1;D<4;++D)Ke.clone(w,x.get(D).scissorRectangle)}e_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};e_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),ypt(this,t,n),r};e_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};e_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(xu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};e_.prototype.isDestroyed=function(){return!1};e_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var sz=e_;var cz=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Vi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=Ye(e.contextOptions),o=l(n),s=new RR(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new i4,this._frameState=new yk(s,new ek(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new gP(s),this._globe=void 0,this._globeTranslucencyState=new Zk,this._primitives=new Zl,this._groundPrimitives=new Zl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new wb,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new ck(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new oi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new oi({depth:1,owner:this}),this._stencilClearCommand=new oi({stencil:0}),this._classificationStencilClearCommand=new oi({stencil:0,renderState:ze.fromCache({stencilMask:Ut.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new X4(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new nk,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Di,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new _k,this._shadowMapCamera=new fr(this),this.shadowMap=new Py({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new nI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new Y4,this._brdfLutGenerator=new cV,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new iz(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,hu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=cc.requestCompletedEvent.addEventListener(cz(this)),this._removeTaskProcessorListenerCallback=pi.taskCompletedEvent.addEventListener(cz(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new fr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new fr(this),this.preloadFlightCullingVolume=void 0,this._picking=new E4(this),this._defaultView=new Eb(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new g_,q0e(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function Apt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(cz(e))),n.push(t.terrainProviderChanged.addEventListener(cz(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Vi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Gt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Gt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return pm.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Apt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new fr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new uk(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Gt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Vi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function W0e(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=Ey.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=Ey.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Ey.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Py.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Se.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Vi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);let o=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=o&&!c,p=s&&!u,g=(!o||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=Py.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||d)&&(a.logDepth=Ey.createLogDepthCommand(e,n,a.logDepth),W0e(this,a.logDepth.command,i)),(f||g)&&W0e(this,e,i)}};var xpt=new Ud({pass:Nr.RENDER}),Fq=new Ud({pass:Nr.PRELOAD}),Uq=new Ud({pass:Nr.PRELOAD_FLIGHT}),Cpt=new Ud({pass:Nr.REQUEST_RENDER_MODE_DEFER_CHECK}),j0e=new ae,Vq;function Tpt(e){let t=e.globe;if(e._mode===ne.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return j0e.radius=n.minimumRadius+i,Vq=QU.fromBoundingSphere(j0e,e.camera.positionWC,Vq),Vq}}Vi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function q0e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Vi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Tpt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof Po),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),nI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Vi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==tn.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var az=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);az=B.inverseTransformation(az,az);function Ept(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=m.clone(s.center);if(r.mode!==ne.SCENE3D){c=B.multiplyByPoint(az,c,c);let p=r.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=Vn.toWireframe(Xs.createGeometry(new Xs({radii:new m(p,p,p),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new wn({geometryInstances:new Tt({geometry:a,modelMatrix:B.fromTranslation(c),attributes:{color:new zt(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Vn.toWireframe(Ml.createGeometry(Ml.fromDimensions({dimensions:new m(2,2,2),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new wn({geometryInstances:new Tt({geometry:a,modelMatrix:B.fromRotationTranslation(p,c,new B),attributes:{color:new zt(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}let u=r.commandList,f=r.commandList=[];t._debugVolume.update(r),e=f[0],r.useLogDepth&&(e=Ey.createLogDepthCommand(e,o).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(d)&&(n.framebuffer=d),r.commandList=u}function ba(e,t,n,i,r){let o=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof oi){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Ept(e,t,i,r),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function xI(e,t,n,i){let r=t._frameState,o=e.derivedCommands;l(o)&&(r.useLogDepth&&l(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,l(o.picking)?(e=o.picking.pickCommand,e.execute(n,i)):l(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(n,i)))}function X0e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function bpt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function Spt(e,t,n,i,r){let o=e.context;my(i,X0e,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function vpt(e,t,n,i,r){let o=e.context;my(i,bpt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function wpt(e,t,n,i){let r=e.context;my(i,X0e,e.camera.positionWC);let o=i.length;for(let s=0;s<o;++s)t(i[s],e,r,n)}var Dpt=new vi,Ipt=new pl,Ppt=new rn,Opt=new Po;function kq(e,t){let n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;o.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(Dpt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Ipt):l(n.frustum.width)?s=n.frustum.clone(Ppt):s=n.frustum.clone(Opt),s.near=n.frustum.near,s.far=n.frustum.far,o.updateFrustum(s),o.updatePass(Se.ENVIRONMENT);let a=r.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let b=u.skyBoxCommand;if(l(b)&&ba(b,e,i,t),u.isSkyAtmosphereVisible&&ba(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let v;u.useGlobeDepthFramebuffer?v=f.globeDepth.framebuffer:u.usePostProcess?v=f.sceneFramebuffer.framebuffer:v=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,v),t.framebuffer=v}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(b,v,I,M,F){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(b,v,I,M,F)}),g=e._executeOITFunction):a.render?g=Spt:g=vpt;let h=f.frustumCommandsList,A=h.length,x=u.clearGlobeDepth,C=u.useDepthPlane,T=e._globeTranslucencyState,E=T.translucent,S=e._view.globeTranslucencyFramebuffer,w=e._depthClearCommand,D=e._stencilClearCommand,R=e._classificationStencilClearCommand,O=e._depthPlane,L=u.usePostProcessSelected,N=n.position.z,_;for(let b=0;b<A;++b){let v=A-b-1,I=h[v];e.mode===ne.SCENE2D?(n.position.z=N-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s)),w.execute(i,t),i.stencilBuffer&&D.execute(i,t),o.updatePass(Se.GLOBE);let M=I.commands[Se.GLOBE],F=I.indices[Se.GLOBE];if(E)T.executeGlobeCommands(I,ba,S,e,t);else for(_=0;_<F;++_)ba(M[_],e,i,t);let k=f.globeDepth;if(l(k)&&u.useGlobeDepthFramebuffer&&k.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(o.updatePass(Se.TERRAIN_CLASSIFICATION),M=I.commands[Se.TERRAIN_CLASSIFICATION],F=I.indices[Se.TERRAIN_CLASSIFICATION],E)T.executeGlobeClassificationCommands(I,ba,S,e,t);else for(_=0;_<F;++_)ba(M[_],e,i,t);if(x&&(w.execute(i,t),C&&O.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)ba(M[_],e,i,t);if(F>0&&(l(k)&&u.useGlobeDepthFramebuffer&&(k.prepareColorTextures(i,x),k.executeUpdateDepth(i,t,x,k.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)ba(M[_],e,i,t)}else{e._invertClassification.clear(i,t);let q=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)ba(M[_],e,i,t);for(l(k)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),k.executeUpdateDepth(i,t,x,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<F;++_)ba(M[_],e,i,t);for(t.framebuffer=q,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),F>0&&i.stencilBuffer&&R.execute(i,t),o.updatePass(Se.CESIUM_3D_TILE_CLASSIFICATION),M=I.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],F=I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)ba(M[_],e,i,t)}for(F>0&&i.stencilBuffer&&D.execute(i,t),o.updatePass(Se.VOXELS),M=I.commands[Se.VOXELS],F=I.indices[Se.VOXELS],M.length=F,wpt(e,ba,t,M),o.updatePass(Se.OPAQUE),M=I.commands[Se.OPAQUE],F=I.indices[Se.OPAQUE],_=0;_<F;++_)ba(M[_],e,i,t);v!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,o.updateFrustum(s));let V;if(!c&&u.useInvertClassification&&r.invertClassificationColor.alpha<1&&(V=e._invertClassification),o.updatePass(Se.TRANSLUCENT),M=I.commands[Se.TRANSLUCENT],M.length=I.indices[Se.TRANSLUCENT],g(e,ba,t,M,V),I.indices[Se.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,ba,t,M,k.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,ba,t,I)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let q=k.depthStencilTexture,Y=e._picking.getPickDepth(e,v);Y.update(i,q),Y.executeCopyDepth(i,t)}if(c||!L)continue;let U=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,o.updateFrustum(s),o.updatePass(Se.GLOBE),M=I.commands[Se.GLOBE],F=I.indices[Se.GLOBE],E)T.executeGlobeCommands(I,xI,S,e,t);else for(_=0;_<F;++_)xI(M[_],e,i,t);for(x&&(w.framebuffer=t.framebuffer,w.execute(i,t),w.framebuffer=void 0),x&&C&&O.execute(i,t),o.updatePass(Se.CESIUM_3D_TILE),M=I.commands[Se.CESIUM_3D_TILE],F=I.indices[Se.CESIUM_3D_TILE],_=0;_<F;++_)xI(M[_],e,i,t);for(o.updatePass(Se.OPAQUE),M=I.commands[Se.OPAQUE],F=I.indices[Se.OPAQUE],_=0;_<F;++_)xI(M[_],e,i,t);for(o.updatePass(Se.TRANSLUCENT),M=I.commands[Se.TRANSLUCENT],F=I.indices[Se.TRANSLUCENT],_=0;_<F;++_)xI(M[_],e,i,t);t.framebuffer=U}}function K0e(e){e.context.uniformState.updatePass(Se.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,r=i.length;for(let o=0;o<r;++o)i[o].execute(e._computeEngine)}function Rpt(e,t){e.context.uniformState.updatePass(Se.OVERLAY);let i=e.context,r=e._overlayCommandList,o=r.length;for(let s=0;s<o;++s)r[s].execute(i,t)}function Mpt(e,t,n){let i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,s=o.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Se.GLOBE||u.pass===Se.CESIUM_3D_TILE||u.pass===Se.OPAQUE||u.pass===Se.TRANSLUCENT)&&e.isVisible(u,i))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(u,p))o[d].commandList.push(u),f=!0;else if(f)break}}}}function J0e(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;Mpt(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];o.updateCamera(p.camera),a.updatePass(r,d);let g=p.commandList.length;for(let h=0;h<g;++h){let A=p.commandList[h];o.updatePass(A.pass),ba(A.derivedCommands.shadows.castCommands[s],e,r,p.passState)}}}}var Bpt=new m;Vi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?Lpt(this,e,t):i!==ne.SCENE2D||this._mapMode2D===hu.ROTATE?(Npt(this,e),My(!0,this,e,t)):(zq(this,e,t),jpt(this,e))};function Lpt(e,t,n){let i=e._view,r=i.camera,s=e._environmentState.renderTranslucentDepthForPick;zq(e,t,n),Z0e(e),i.createPotentiallyVisibleSet(e),K0e(e),s||J0e(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=fr.clone(r,e._cameraVR);c.frustum=r.frustum;let u=r.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=m.multiplyByScalar(c.right,d*.5,Bpt);r.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;m.add(c.position,p,r.position),r.frustum.xOffset=g,kq(e,t),a.x=a.width,m.subtract(c.position,p,r.position),r.frustum.xOffset=-g,kq(e,t),fr.clone(c,r)}function Npt(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var Fpt=new he(Math.PI,P.PI_OVER_TWO),Upt=new m,Vpt=new m,kpt=new B,zpt=new B,Hpt=new m,Gpt=new m,Wpt=new Ke;function jpt(e,t){let n=e.context,i=e.frameState,r=e.camera,o=t.viewport,s=Ke.clone(o,Wpt);t.viewport=s;let a=Fpt,c=Upt;e.mapProjection.project(a,c);let f=m.clone(r.position,Vpt),d=B.clone(r.transform,zpt),p=r.frustum.clone();r._setTransform(B.IDENTITY);let g=B.computeViewportTransformation(s,0,1,kpt),h=r.frustum.projectionMatrix,A=r.positionWC.y,x=m.fromElements(P.sign(A)*c.x-A,0,-r.positionWC.x,Hpt),C=Mt.pointToGLWindowCoordinates(h,g,x,Gpt);C.x=Math.floor(C.x);let T=s.x,E=s.width;if(A===0||C.x<=T||C.x>=T+E)My(!0,e,t);else if(Math.abs(T+E*.5-C.x)<1)s.width=C.x-s.x,r.position.x*=P.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!0,e,t),s.x=C.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!1,e,t);else if(C.x>T+E*.5){s.width=C.x-T;let S=r.frustum.right;r.frustum.right=c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!0,e,t),s.x=C.x,s.width=T+E-C.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=S-r.frustum.right*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!1,e,t)}else{s.x=C.x,s.width=T+E-C.x;let S=r.frustum.left;r.frustum.left=-c.x-A,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!0,e,t),s.x=T,s.width=C.x-T,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=S-r.frustum.left*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),My(!1,e,t)}r._setTransform(d),m.clone(f,r.position),r.frustum=p.clone(),t.viewport=o}function My(e,t,n,i){let r=t._environmentState,o=t._view,s=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),Z0e(t),o.createPotentiallyVisibleSet(t),e&&(l(i)&&zq(t,n,i),K0e(t),s||J0e(t)),kq(t,n)}var Y0e=new is;Vi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof rn||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(o)?(l(s)&&(o.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=c&&this.mode===ne.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!r;let f=e.mode===ne.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=Y0e.planes;for(let A=0;A<5;++A)p[A]=d.planes[A];d=Y0e,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,h=this._specularEnvironmentMapAtlas;l(g)&&(!l(h)||h.url!==g)?(h=h&&h.destroy(),this._specularEnvironmentMapAtlas=new pm(g)):!l(g)&&l(h)&&(h.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function Ypt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Xp({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function qpt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===ne.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,!!r){for(let o=0;o<i;++o)if(n[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let o=0;o<i;++o){let s=n[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function Z0e(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Ypt(e),qpt(e),e._globe&&e._globe.render(t)}function zq(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new sz:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let h=e.postProcessStages,A=o.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(o.usePostProcessSelected=!1,A&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,r.useLogDepth,e._hdr),h.clear(i),A=o.usePostProcess=h.ready,o.usePostProcessSelected=A&&h.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:A&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&o.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,E=T.derivedCommands;E.oit=p.createDerivedCommands(T,i,E.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Vi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;l(r)&&r.prepareColorTextures(t);let o=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?r.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!o&&(g=u);let h=this.postProcessStages,A=g.getColorTexture(0),x=d.getColorTexture(0),C=y(u,f).getDepthStencilTexture();h.execute(t,A,C,x),h.copy(t,c)}!o&&!a&&s&&(e.framebuffer=c,r.executeCopyColor(t,e))};function Xpt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function Kpt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function Jpt(e){let t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!l(i)||!i.show||n===ne.SCENE2D||n===ne.MORPHING)return!1;let s=e._globeHeight;return l(s)&&o.height<s}Vi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=Kpt(this),this._cameraUnderground=Jpt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Zpt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new Dy({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Qpt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function $pt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),cc.update()}var e_t=new z;function t_t(e){let t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=xpt;let o=y(e.backgroundColor,z.BLACK);e._hdr&&(o=z.clone(o,e_t),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof g_?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,Rpt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function ix(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function n_t(e){return e._picking.updateMostDetailedRayPicks(e)}Vi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,15e6,1);q0e(this,r,e),t.newFrame=!0}ix(this,Qpt),this.primitives.show&&(ix(this,n_t),ix(this,i_t),ix(this,r_t),i||ix(this,o_t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),ix(this,t_t)),Zpt(this,i),ix(this,$pt),Xpt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Vi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Vi.prototype.requestRender=function(){this._renderRequested=!0};Vi.prototype.clampLineWidth=function(e){return Math.max(Gt.minimumAliasedLineWidth,Math.min(e,Gt.maximumAliasedLineWidth))};Vi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Vi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Vi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Vi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function i_t(e){let t=e._frameState;Fq.camera=t.camera,Fq.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Fq)}function r_t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Uq.camera=e.preloadFlightCamera,Uq.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Uq)}function o_t(e){e.primitives.updateForPass(e._frameState,Cpt)}Vi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Vi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Vi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Vi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Vi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Vi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Vi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Vi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Vi.prototype.cartesianToCanvasCoordinates=function(e,t){return Zi.wgs84ToWindowCoordinates(this,e,t)};Vi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Vi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Vi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Vi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};function s_t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Vi.prototype.setTerrain=function(e){return s_t(this,e),e};Vi.prototype.isDestroyed=function(){return!1};Vi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var lz=Vi;var CI=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); + +/** +* Convert a position in the uv-space of the tileset bounding shape +* into the uv-space of a tile within the tileset +*/ +vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { + // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) + float dimAtLevel = pow(2.0, float(octreeCoords.w)); + return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); } -vec3 getLightDirection(vec3 positionWC) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = - positionWC * float(lightEnum == 0.0) + - czm_lightDirectionWC * float(lightEnum == 1.0) + - czm_sunDirectionWC * float(lightEnum == 2.0); - return normalize(lightDirection); +void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { + sampleData.megatextureIndex = data.data; + sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; } -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; +#if (SAMPLE_COUNT > 1) +void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { + int leafIndex = data.data; + int leafNodeTexelCount = 2; + // Adding 0.5 moves to the center of the texel + float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; + float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; + + // Get an interpolation weight and a flag to determine whether to read the parent texture + vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); + vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); + float lerp = normU8x2_toFloat(leafData0.xy); + sampleDatas[0].weight = 1.0 - lerp; + sampleDatas[1].weight = lerp; + // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT + sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; + sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) + ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) + : octreeCoords; + + // Get megatexture indices for both samples + vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); + vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); + sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); + sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); +} +#endif + +OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { + float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); + vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; + vec3 end = start + vec3(sizeAtLevel); + OctreeNodeData childData; + + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + // Find out which octree child contains the position + // 0 if before center, 1 if after + vec3 center = 0.5 * (start + end); + vec3 childCoord = step(center, shapePosition); + + // Get octree coords for the next level down + ivec4 octreeCoords = traversalData.octreeCoords; + traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); + + childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); + + if (childData.flag != OCTREE_FLAG_INTERNAL) { + // leaf tile - stop traversing + break; + } + + // interior tile - keep going deeper + start = mix(start, center, childCoord); + end = mix(center, end, childCoord); + traversalData.parentOctreeIndex = childData.data; + } - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + return childData; +} - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; +/** +* Transform a given position to an octree tile coordinate and a position within that tile, +* and find the corresponding megatexture index and texture coordinates +*/ +void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { + traversalData.octreeCoords = ivec4(0); + traversalData.parentOctreeIndex = 0; - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); + if (nodeData.flag != OCTREE_FLAG_LEAF) { + nodeData = traverseOctreeDownwards(shapePosition, traversalData); + } - underTranslucentGlobe = 0.0; + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + #else + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); + #endif +} - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) +bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { + return clamp(v, minVal, maxVal) == v; +} - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); +bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { + vec3 tileUv = getTileUv(shapePosition, octreeCoords); + bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); + // Assume (!) the position is always inside the root tile. + return inside || octreeCoords.w == 0; +} - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); +void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { + if (insideTile(shapePosition, traversalData.octreeCoords)) { + for (int i = 0; i < SAMPLE_COUNT; i++) { + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + } + return; + } - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); + // Go up tree until we find a parent tile containing shapePosition + for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { + traversalData.octreeCoords.xyz /= 2; + traversalData.octreeCoords.w -= 1; - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; + if (insideTile(shapePosition, traversalData.octreeCoords)) { + break; } - #endif - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); + traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); + } - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + // Go down tree + OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); + #if (SAMPLE_COUNT == 1) + getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + #else + getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); + sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); + sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); + #endif } -`;var uz=`in vec3 v_outerPositionWC; +`;var s4=`// See Octree.glsl for the definitions of SampleData and intMod -uniform vec3 u_hsbShift; +/* Megatexture defines (set in Scene/VoxelRenderResources.js) +#define SAMPLE_COUNT ### +#define NEAREST_SAMPLING +#define PADDING +*/ -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif +uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions +uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions +uniform vec2 u_megatextureVoxelSizeUv; +uniform vec2 u_megatextureSliceSizeUv; +uniform vec2 u_megatextureTileSizeUv; -void main (void) -{ - vec3 lightDirection = getLightDirection(v_outerPositionWC); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; +uniform ivec3 u_dimensions; // does not include padding +#if defined(PADDING) + uniform ivec3 u_paddingBefore; + uniform ivec3 u_paddingAfter; +#endif - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); - #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; - #endif +// Integer min, max, clamp: For WebGL1 only +int intMin(int a, int b) { + return a <= b ? a : b; +} +int intMax(int a, int b) { + return a >= b ? a : b; +} +int intClamp(int v, int minVal, int maxVal) { + return intMin(intMax(v, minVal), maxVal); +} - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); +vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) +{ + int indexX = intMod(index, dimensions.x); + int indexY = index / dimensions.x; + return vec2(indexX, indexY) * uvScale; +} - #ifndef HDR - color.rgb = czm_acesTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif +/* + How is 3D data stored in a 2D megatexture? - #ifdef COLOR_CORRECT - // Convert rgb color to hsb - vec3 hsb = czm_RGBToHSB(color.rgb); - // Perform hsb shift - hsb.x += u_hsbShift.x; // hue - hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation - hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness - // Convert shifted hsb back to rgb - color.rgb = czm_HSBToRGB(hsb); - #endif + In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). + The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and + the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). + Note that there could be empty space in the megatexture because it's a power of two. - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); - } + 0 1 2 3 + +---+---+---+---+ + | | | | | 3 + +---+---+---+---+ + | | | | | 2 + +-------+-------+ + |010|110|011|111| 1 + |--- ---|--- ---| + |000|100|001|101| 0 + +-------+-------+ - out_FragColor = color; -} -`;var fz=`in vec4 position; + When doing linear interpolation the megatexture needs to be sampled twice: once for + the Z slice above the voxel coordinate and once for the slice below. The two slices + are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is + halfway between two Z slices so the interpolation factor is 0.5. Below is a side view + of the 3D voxel grid with voxel coordinates on the left side. -out vec3 v_outerPositionWC; + 2 +---+ + |001| + 1 +-z-+ + |000| + 0 +---+ -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif + When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. +*/ -void main(void) -{ - vec4 positionWC = czm_model * position; - vec3 lightDirection = getLightDirection(positionWC.xyz); +Properties getPropertiesFromMegatexture(in SampleData sampleData) { + vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? + int tileIndex = sampleData.megatextureIndex; + vec3 voxelCoord = tileUv * vec3(u_dimensions); + ivec3 voxelDimensions = u_dimensions; - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); + #if defined(PADDING) + voxelDimensions += u_paddingBefore + u_paddingAfter; + voxelCoord += vec3(u_paddingBefore); #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; -} -`;function Db(e){e=y(e,re.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=B.fromScale(n),this._modelMatrix=new B,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(Db.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Db.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var Hq=new B;Db.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=B.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,Hq),r=B.multiplyTransformation(i,hr.Y_UP_TO_Z_UP,Hq),o=B.multiply(this._scaleMatrix,r,Hq);B.clone(o,this._modelMatrix);let s=e.context,a=a_t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Xs.createGeometry(new Xs({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Oe.POSITION_ONLY}));f.vertexArray=si.fromGeometry({context:s,geometry:p,attributeLocations:Vn.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:gi.FRONT},blending:hn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[by,CI,fz]}),h=new He({defines:p,sources:[by,CI,uz]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:h}),f.shaderProgram=this._spSkyAtmosphere}return f};function a_t(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}Db.prototype.isDestroyed=function(){return!1};Db.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var dz=Db;var mz=`uniform samplerCube u_cubeMap; -in vec3 v_texCoord; + #if defined(NEAREST_SAMPLING) + // Round to the center of the nearest voxel + voxelCoord = floor(voxelCoord) + vec3(0.5); + #endif -void main() -{ - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var hz=`in vec3 position; + // Tile location + vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -out vec3 v_texCoord; + // Slice location + float slice = voxelCoord.z - 0.5; + int sliceIndex = int(floor(slice)); + int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); + vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;function pz(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new nt({modelMatrix:B.clone(B.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}pz.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ne.SCENE3D&&e.mode!==ne.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let o=this.sources;typeof o.positiveX=="string"?BR(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new uc({context:i,source:o}))}let r=this._command;if(!l(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};let o=Ml.createGeometry(Ml.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Oe.POSITION_ONLY})),s=this._attributeLocations=Vn.createAttributeLocations(o);r.vertexArray=si.fromGeometry({context:i,geometry:o,attributeLocations:s,bufferUsage:Fe.STATIC_DRAW}),r.renderState=ze.fromCache({blending:hn.ALPHA_BLEND})}if(!l(r.shaderProgram)||this._useHdr!==t){let o=new He({defines:[t?"HDR":""],sources:[mz]});r.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:hz,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return r};pz.prototype.isDestroyed=function(){return!1};pz.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var _z=pz;function vf(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Ln,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o,s)}var c_t=new m;vf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=Z.getScale(this.orientedBoundingBox.halfAxes,c_t),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};vf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:r,z:o}=this,s=i*2,a=r*2,c=o*2,u=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,u,c],[p,f,u,c],[p,s,a,d],[p,f,a,d],[p,s,u,d],[p,f,u,d]];this.children=g.map(([h,A,x,C])=>new vf(h,A,x,C,this,e,t))};vf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};vf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var Q0e={keyframe:0};function TI(e,t){return Q0e.keyframe=e,Or(t,Q0e,Qi.searchComparator)}vf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=l_t(i,d),g=d[p],h=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),A=d[h],x=i-g.keyframe,C=$0e(n-t.level,x);C<a&&(a=C,o=g);let T=A.keyframe-r,E=$0e(n-t.level,T);if(E<c&&(c=E,s=A),x===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function l_t(e,t){let n=TI(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function $0e(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}vf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};vf.prototype.createKeyframeNode=function(e){let t=TI(e,this.keyframeNodes);if(t<0){t=~t;let n=new Qi(this,e);this.keyframeNodes.splice(t,0,n)}};vf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=TI(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=TI(n,this.renderableKeyframeNodes);if(r<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.spatialNode=void 0,e.state=Qi.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};vf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==Qi.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let r=0;r<t.length;r++){let o=t[r];e.megatextureIndex=o.add(e.metadatas[r]),e.metadatas[r]=void 0}e.state=Qi.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=TI(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};vf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var gz=vf;function Gq(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(Gq.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Gq.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(r,o,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var eAe=Gq;function EI(){}EI.prototype.evaluate=function(e,t){fe.throwInstantiationError()};EI.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};EI.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};EI.prototype.getVariables=function(){fe.throwInstantiationError()};var tAe=EI;var yz=`uniform sampler2D u_texture; + // Voxel location + vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -in vec2 v_textureCoordinates; + // Final location in the megatexture + vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); + #if defined(NEAREST_SAMPLING) + return getPropertiesFromMegatextureAtUv(uv0); + #else + float sliceLerp = fract(slice); + int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); + vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); + vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; + Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); + Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); + return mixProperties(properties0, properties1, sliceLerp); + #endif } -`;var Az=`uniform float u_radiusTS; -in vec2 v_textureCoordinates; +// Convert an array of sample datas to a final weighted properties. +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { + #if (SAMPLE_COUNT == 1) + return getPropertiesFromMegatexture(sampleDatas[0]); + #else + // When more than one sample is taken the accumulator needs to start at 0 + Properties properties = clearProperties(); + for (int i = 0; i < SAMPLE_COUNT; ++i) { + float weight = sampleDatas[i].weight; -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); + // Avoid reading the megatexture when the weight is 0 as it can be costly. + if (weight > 0.0) { + Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); + tempProperties = scaleProperties(tempProperties, weight); + properties = sumProperties(properties, tempProperties); + } + } + return properties; + #endif } - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +`;function Rmt(e){let t=new eT;this.shaderBuilder=t;let n=e._customShader,i=_t(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,Te.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",Te.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([Kz]),t.addFragmentLines([n.fragmentShaderText,"#line 0",r4,Jz,s4]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,Te.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,Te.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,Te.FRAGMENT),t.addFragmentLines([$z])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,Te.FRAGMENT),t.addFragmentLines([Zz]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,Te.FRAGMENT),t.addFragmentLines([n4,Qz,wE])):a==="CYLINDER"?t.addFragmentLines([e4,wE,i4]):a==="ELLIPSOID"&&t.addFragmentLines([t4,wE,o4]),t.addFragmentLines([Xz]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,Te.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,Te.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,Te.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,Te.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,Te.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,Te.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,Te.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,Te.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,Te.FRAGMENT)}var a4=Rmt;function Mmt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,Te.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=`PropertyStatistics_${N}`,E=`PropertyStatistics_${N}`;n.addStruct(_,E,Te.FRAGMENT);let w=c4(F);n.addStructField(_,w,"min"),n.addStructField(_,w,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=`PropertyStatistics_${N}`,_=N;n.addStructField(f,F,_)}let g="Metadata",h="Metadata",x="metadata";n.addStruct(g,h,Te.FRAGMENT),n.addStructField(g,d,p);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=c4(F);n.addStructField(g,_,N)}for(let R=0;R<c;R++){let N=i[R],F=o[R],_=Nmt(F),E=`VoxelProperty_${N}`,w=`VoxelProperty_${N}`;n.addStruct(E,w,Te.FRAGMENT),n.addStructField(E,_,"partialDerivativeLocal"),n.addStructField(E,_,"partialDerivativeWorld"),n.addStructField(E,_,"partialDerivativeView"),n.addStructField(E,_,"partialDerivativeValid")}let b="Voxel",C="Voxel",T="voxel";n.addStruct(b,C,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=`VoxelProperty_${N}`;n.addStructField(b,F,N)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance");let A="FragmentInput",S="FragmentInput";n.addStruct(A,S,Te.FRAGMENT),n.addStructField(A,h,x),n.addStructField(A,C,T);let v="Properties",I="Properties",O="properties";n.addStruct(v,I,Te.FRAGMENT);for(let R=0;R<c;R++){let N=i[R],F=o[R],_=c4(F);n.addStructField(v,_,N)}{let R="clearProperties";n.addFunction(R,`${I} clearProperties()`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=r[N],w=c4(_,E);n.addFunctionLines(R,[`${O}.${F} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${O}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${I} scaleProperties(${I} ${O}, float scale)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} scaledProperties = ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${O}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${I} ${O}, inout ${h} ${x})`,Te.FRAGMENT);for(let N=0;N<c;N++){let F=i[N];n.addFunctionLines(R,[`${x}.${F} = ${O}.${F};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${d} ${p})`,Te.FRAGMENT);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=qt.getComponentCount(_);for(let w=0;w<E;w++){let D=Fmt(_,w),M=s[N][w],B=a[N][w];n.addFunctionLines(R,[`${p}.${F}.min${D} = ${a0e(M)};`,`${p}.${F}.max${D} = ${a0e(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,Te.FRAGMENT),n.addFunctionLines(R,[`${I} ${O};`]);for(let N=0;N<c;N++){let F=i[N],_=o[N],E=r[N],w=Lmt(_,E);n.addFunctionLines(R,[`properties.${F} = texture(u_megatextureTextures[${N}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function c4(e){if(e===qt.SCALAR)return"float";if(e===qt.VEC2)return"vec2";if(e===qt.VEC3)return"vec3";if(e===qt.VEC4)return"vec4"}function Lmt(e){if(e===qt.SCALAR)return".r";if(e===qt.VEC2)return".ra";if(e===qt.VEC3)return".rgb";if(e===qt.VEC4)return""}function Nmt(e){if(e===qt.SCALAR)return"vec3";if(e===qt.VEC2)return"mat2";if(e===qt.VEC3)return"mat3";if(e===qt.VEC4)return"mat4"}function a0e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Fmt(e,t){return e===qt.SCALAR?"":`[${t}]`}var l4=Mmt;function Bmt(e,t){let n=new a4(e);l4(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let h="getClippingPlane",x=Ty(o,t),b=0,C=x.indexOf(")")+1,T=x.indexOf("{",C)+1,A=x.indexOf("}",T),S=x.slice(b,C),v=x.slice(T,A);i.addFunction(h,S,Te.FRAGMENT),i.addFunctionLines(h,[v])}let s=i.clone();s.addDefine("PICKING",void 0,Te.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),u=Ve.fromCache({cull:{enabled:!0,face:gi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),d=e._depthTest,p=new nt({vertexArray:f,primitiveType:Fe.TRIANGLES,renderState:u,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ae.VOXELS,executeInClosestFrustum:!0,owner:this,cull:d,occlude:d}),g=nt.shallowClone(p,new nt);if(g.shaderProgram=c,g.pickOnly=!0,l(e._drawCommand)){let h=e._drawCommand;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}if(l(e._drawCommandPick)){let h=e._drawCommandPick;h.shaderProgram=h.shaderProgram&&h.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=g}var u4=Bmt;function Qp(){this.featurePropertiesDirty=!1}Object.defineProperties(Qp.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},readyPromise:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});Qp.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};Qp.prototype.getFeature=function(e){fe.throwInstantiationError()};Qp.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};Qp.prototype.applyStyle=function(e){fe.throwInstantiationError()};Qp.prototype.update=function(e,t){fe.throwInstantiationError()};Qp.prototype.isDestroyed=function(){fe.throwInstantiationError()};Qp.prototype.destroy=function(){fe.throwInstantiationError()};var c0e=Qp;function IE(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Umt(this,t)}Object.defineProperties(IE.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function kmt(e,t){this.condition=e,this.expression=t}function Umt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new kmt(new jf(a,t),new jf(c,t)))}e._runtimeConditions=n}IE.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};IE.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};IE.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) + { + return ${f}; + } +`}return r=`${i} ${e} { - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); +${r} return ${i}(1.0); } - +`,r};IE.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var f4=IE;function My(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,Vmt(this,e)}function Vmt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new jf(o[r],i))}e._meta=n,e._ready=!0}function Zo(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new jf(String(t));if(typeof t=="string")return new jf(t,n);if(l(t.conditions))return new f4(t,n)}else return;return t}function $o(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(My.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Zo(this,e),this._style.show=$o(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Zo(this,e),this._style.color=$o(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Zo(this,e),this._style.pointSize=$o(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Zo(this,e),this._style.pointOutlineColor=$o(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Zo(this,e),this._style.pointOutlineWidth=$o(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Zo(this,e),this._style.labelColor=$o(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Zo(this,e),this._style.labelOutlineColor=$o(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Zo(this,e),this._style.labelOutlineWidth=$o(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Zo(this,e),this._style.font=$o(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Zo(this,e),this._style.labelStyle=$o(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Zo(this,e),this._style.labelText=$o(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Zo(this,e),this._style.backgroundColor=$o(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Zo(this,e),this._style.backgroundPadding=$o(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Zo(this,e),this._style.backgroundEnabled=$o(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Zo(this,e),this._style.scaleByDistance=$o(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Zo(this,e),this._style.translucencyByDistance=$o(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Zo(this,e),this._style.distanceDisplayCondition=$o(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Zo(this,e),this._style.heightOffset=$o(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Zo(this,e),this._style.anchorLineEnabled=$o(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Zo(this,e),this._style.anchorLineColor=$o(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Zo(this,e),this._style.image=$o(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Zo(this,e),this._style.disableDepthTestDistance=$o(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Zo(this,e),this._style.horizontalOrigin=$o(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Zo(this,e),this._style.verticalOrigin=$o(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Zo(this,e),this._style.labelHorizontalOrigin=$o(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Zo(this,e),this._style.labelVerticalOrigin=$o(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});My.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new My(n)})};My.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};My.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};My.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};My.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Ly=My;function _1(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new jA({comparator:_1.comparator})}_1.prototype.addSubtree=function(e){let t=new zmt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};_1.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};_1.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function zmt(e,t){this.subtree=e,this.stamp=t}var d4=_1;function Tl(){this.orientedBoundingBox=new Nn,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._minBounds=m.clone(Tl.DefaultMinBounds,new m),this._maxBounds=m.clone(Tl.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Hmt=new m,OY=new m,Gmt=new Z,Wmt=new m,jmt=new m,qmt=new m,Ymt=new m,l0e=L.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new L);Tl.prototype.update=function(e,t,n,i,o){i=y(i,Tl.DefaultMinBounds),o=y(o,Tl.DefaultMaxBounds);let r=Tl.DefaultMinBounds,s=Tl.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,Wmt),o=m.clamp(o,r,s,jmt);let a=m.clamp(t,i,o,qmt),c=m.clamp(n,i,o,Ymt),u=L.getScale(e,OY);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=L.clone(e,this.shapeTransform),this.orientedBoundingBox=u0e(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let h in d)d.hasOwnProperty(h)&&(d[h]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=L.multiplyByPoint(l0e,a,f.renderMinBounds),f.renderMaxBounds=L.multiplyByPoint(l0e,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,x=n;f.boxUvToShapeUvScale=m.fromElements(2/(h.x===x.x?1:x.x-h.x),2/(h.y===x.y?1:x.y-h.y),2/(h.z===x.z?1:x.z-h.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=m.fromElements(-f.boxUvToShapeUvScale.x*(h.x*.5+.5),-f.boxUvToShapeUvScale.y*(h.y*.5+.5),-f.boxUvToShapeUvScale.z*(h.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var Xmt=new m,Kmt=new m;Tl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),Xmt),u=m.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),Kmt);return u0e(c,u,this.shapeTransform,o)};Tl.prototype.computeApproximateStepSize=function(e){return 1/m.maximumComponent(e)};Tl.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));Tl.DefaultMaxBounds=Object.freeze(new m(1,1,1));function u0e(e,t,n,i){let o=Tl.DefaultMinBounds,r=Tl.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=L.getTranslation(n,i.center),i.halfAxes=L.getMatrix3(n,i.halfAxes);else{let a=L.getScale(n,OY),c=m.midpoint(e,t,Hmt);i.center=L.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),OY);let u=L.getRotation(n,Gmt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var e_=Tl;function m4(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(m4.prototype,{metadataTable:{get:function(){return this._metadataTable}}});m4.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=Zmt(n);let r=await Jmt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let d=0;d<a;++d){let p=o.json.bufferViews[d],g=p.byteOffset,h=g+p.byteLength,b=r[p.buffer].subarray(g,h);s[d]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new m4(e);return f._metadataTable=new Vl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function Jmt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function Zmt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Mo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var h4=m4;function Ur(){this.orientedBoundingBox=new Nn,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._minimumRadius=Ur.DefaultMinBounds.x,this._maximumRadius=Ur.DefaultMaxBounds.x,this._minimumHeight=Ur.DefaultMinBounds.y,this._maximumHeight=Ur.DefaultMaxBounds.y,this._minimumAngle=Ur.DefaultMinBounds.z,this._maximumAngle=Ur.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new m,cylinderUvToRenderBoundsTranslate:new m,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvHeight:new H,cylinderUvToShapeUvAngle:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var d0e=new m,$mt=new m,Qmt=new m,eht=new Z,tht=new L,nht=new L,iht=L.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new L);Ur.prototype.update=function(e,t,n,i,o){i=y(i,Ur.DefaultMinBounds),o=y(o,Ur.DefaultMaxBounds);let r=Ur.DefaultMinBounds.x,s=Ur.DefaultMaxBounds.x,a=Ur.DefaultMinBounds.y,c=Ur.DefaultMaxBounds.y,u=Ur.DefaultMinBounds.z,f=Ur.DefaultMaxBounds.z,d=f-u,p=.5*d,g=P.EPSILON10,h=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),C=P.clamp(n.x,r,s),T=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),S=Math.max(b,T),v=Math.min(C,A),I=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),N=P.clamp(o.y,a,c),F=Math.max(I,R),_=Math.min(O,N),E=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),D=P.negativePiToPi(i.z),M=P.negativePiToPi(o.z),B=Math.max(E,D),V=Math.min(w,M),U=L.getScale(e,d0e);if(v===0||S>v||F>_||P.equalsEpsilon(U.x,0,void 0,g)||P.equalsEpsilon(U.y,0,void 0,g)||P.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=b,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=O,this._minimumAngle=E,this._maximumAngle=w,this.shapeTransform=L.clone(e,this.shapeTransform),this.orientedBoundingBox=MY(S,v,F,_,B,V,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Y=b===r&&C===s,j=I===a&&O===c,$=w<E,W=w-E+$*d,K=W>p+x&&W<d-x,J=W>x&&W<p-x,he=W>=p-x&&W<=p+x,ge=W<=x,se=K||J||he||ge,pe=P.equalsEpsilon(E,u,void 0,h),xe=P.equalsEpsilon(w,f,void 0,h),De=v===s,Se=S===r,we=F===a&&_===c,ze=V<B,Oe=V-B+ze*d,ft=Oe>p+x&&Oe<d-x,Ct=Oe>x&&Oe<p-x,ot=Oe>=p-x&&Oe<=p+x,sn=Oe<=x,wn=ft||Ct||ot||sn,zt=this.shaderUniforms,Bt=this.shaderDefines;for(let Ee in Bt)Bt.hasOwnProperty(Ee)&&(Bt[Ee]=void 0);let be=0;if(Bt.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=be,be+=1,Se||(Bt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Bt.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=be,be+=1,zt.cylinderUvToRenderRadiusMin=v/S),De||(Bt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),S===v&&(Bt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),we||(Bt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),F===_&&(Bt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),I===O&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),b===C&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!Y){Bt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ee=1/(C-b),at=b/(b-C);zt.cylinderUvToShapeUvRadius=H.fromElements(Ee,at,zt.cylinderUvToShapeUvRadius)}if(!j){Bt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ee=2/(O-I),at=(I+1)/(I-O);zt.cylinderUvToShapeUvHeight=H.fromElements(Ee,at,zt.cylinderUvToShapeUvHeight)}if(!De||!we){let Ee=.5*(_-F),at=m.fromElements(1/v,1/v,1/(Ee===0?1:Ee),Qmt),Jt=m.fromElements(0,0,-at.z*.5*(F+_),$mt),ri=L.fromRotationTranslation(Z.fromScale(at,eht),Jt,tht),Ze=L.multiplyTransformation(ri,iht,nht);zt.cylinderUvToRenderBoundsScale=L.getScale(Ze,zt.cylinderUvToRenderBoundsScale),zt.cylinderUvToRenderBoundsTranslate=L.getTranslation(Ze,zt.cylinderUvToRenderBoundsTranslate)}if($&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),wn&&(Bt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Bt.CYLINDER_INTERSECTION_INDEX_ANGLE=be,ft?(Bt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,be+=1):Ct?(Bt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,be+=2):ot?(Bt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,be+=1):sn&&(Bt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,be+=2),zt.cylinderRenderAngleMinMax=H.fromElements(B,V,zt.cylinderAngleMinMax)),se){Bt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ge&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),pe&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(Bt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ee=(E-u)/d,at=(w-u)/d,Jt=1-W/d;zt.cylinderShapeUvAngleMinMax=H.fromElements(Ee,at,zt.cylinderShapeUvAngleMinMax),zt.cylinderShapeUvAngleRangeZeroMid=(at+.5*Jt)%1;let ri=d/W,Ze=-(E-u)/W;zt.cylinderUvToShapeUvAngle=H.fromElements(ri,Ze,zt.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=be,!0};Ur.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(r,s,t*d),g=P.lerp(r,s,(t+1)*d),h=P.lerp(a,c,n*d),x=P.lerp(a,c,(n+1)*d),b=P.lerp(u,f,i*d),C=P.lerp(u,f,(i+1)*d);return MY(p,g,h,x,b,C,this.shapeTransform,o)};var oht=new Nn,rht=new m,sht=new m,aht=new m;Ur.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,o=this._minimumHeight,r=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,u=1-1/e.y,f=1-1/e.z,d=P.lerp(n,i,c),p=P.lerp(o,r,u),g=P.lerp(s,a,f),C=MY(d,i,p,r,g,a,t,oht),T=Z.getScale(C.halfAxes,rht),A=L.getScale(t,sht),S=m.divideComponents(T,A,aht);return m.minimumComponent(S)};Ur.DefaultMinBounds=Object.freeze(new m(0,-1,-P.PI));Ur.DefaultMaxBounds=Object.freeze(new m(1,1,+P.PI));var cht=5,lht=new Array(cht),uht=new m,fht=new Z,dht=new L,mht=new L,hht=new L,RY=new L,pht=new m,_ht=new m,ght=new m,m0e=new Array(8);for(let e=0;e<8;e++)m0e[e]=new m;function f0e(e,t,n){return Math.abs(re.dot(e,t))<n}function yht(e){let t=L.getColumn(e,0,pht),n=L.getColumn(e,1,_ht),i=L.getColumn(e,2,ght),o=P.EPSILON4;return f0e(t,n,o)&&f0e(n,i,o)}function xht(e,t){let n=m0e;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)L.multiplyByPoint(e,n[i],n[i]);return Nn.fromPoints(n,t)}function MY(e,t,n,i,o,r,s,a){let c=Ur.DefaultMinBounds,u=Ur.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,h=c.z,x=u.z;if(e===f&&t===d&&n===p&&i===g&&o===h&&r===x)return a.center=L.getTranslation(s,a.center),a.halfAxes=L.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let C=r-o,T=o+C*.5,A=lht,S=0;A[S++]=o,A[S++]=r,A[S++]=T,C>P.PI&&(A[S++]=T-P.PI_OVER_TWO,A[S++]=T+P.PI_OVER_TWO);let v=1,I=1,O=-1,R=-1;for(let $=0;$<S;++$){let W=A[$]-T,K=Math.cos(W),J=Math.sin(W),he=K*e,ge=J*e,se=K*t,pe=J*t;v=Math.min(v,he),I=Math.min(I,ge),v=Math.min(v,se),I=Math.min(I,pe),O=Math.max(O,he),R=Math.max(R,ge),O=Math.max(O,se),R=Math.max(R,pe)}let N=O-v,F=R-I,_=i-n,E=(v+O)*.5,w=(I+R)*.5,D=(n+i)*.5,M=m.fromElements(E,w,D,uht),B=Z.fromRotationZ(T,fht),V=m.fromElements(N,F,_,d0e),U=L.fromScale(V,hht),G=L.fromRotation(B,mht),k=L.fromTranslation(M,dht),Y=L.multiplyTransformation(G,L.multiplyTransformation(k,U,RY),RY),j=L.multiplyTransformation(s,Y,RY);return yht(j)?Nn.fromTransformation(j,a):xht(j,a)}var t_=Ur;function Al(){this.orientedBoundingBox=new Nn,this.boundingSphere=new ae,this.boundTransform=new L,this.shapeTransform=new L,this._rectangle=new ce,this._minimumHeight=Al.DefaultMinBounds.z,this._maximumHeight=Al.DefaultMaxBounds.z,this._ellipsoid=new oe,this._translation=new m,this._rotation=new Z,this.shaderUniforms={ellipsoidRadiiUv:new m,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeCosSqrHalfMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new H,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var bht=new m,Cht=new Z,h0e=new m,p0e=new m,_0e=new m,g0e=new m,Tht=new ce;Al.prototype.update=function(e,t,n,i,o){i=y(i,Al.DefaultMinBounds),o=y(o,Al.DefaultMaxBounds);let r=Al.DefaultMinBounds.x,s=Al.DefaultMaxBounds.x,a=s-r,c=.5*a,u=Al.DefaultMinBounds.y,f=Al.DefaultMaxBounds.y,d=f-u,p=P.EPSILON10,g=P.EPSILON3,h=P.EPSILON10,x=P.EPSILON10,b=P.EPSILON3,C=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),A=P.clamp(i.x,r,s),S=P.clamp(o.x,r,s),v=Math.max(C,A),I=Math.min(T,S),O=P.clamp(t.y,u,f),R=P.clamp(n.y,u,f),N=P.clamp(i.y,u,f),F=P.clamp(o.y,u,f),_=Math.max(O,N),E=Math.min(R,F),w=L.getScale(e,bht),D=w.x===w.y&&w.y===w.z,M=m.minimumComponent(w),B=Math.max(t.z,-M),V=Math.max(n.z,-M),U=Math.max(i.z,-M),G=Math.max(o.z,-M),k=Math.max(B,U),Y=Math.min(V,G),j=m.add(w,m.fromElements(B,B,B,p0e),p0e),$=m.add(w,m.fromElements(V,V,V,h0e),h0e),W=m.maximumComponent($),K=m.add(w,m.fromElements(k,k,k,g0e),g0e),J=m.add(w,m.fromElements(Y,Y,Y,_0e),_0e);if(_>E||_===f||E===u||k>Y||P.equalsEpsilon(J,m.ZERO,void 0,p))return!1;this._rectangle=ce.fromRadians(C,O,T,R),this._translation=L.getTranslation(e,this._translation),this._rotation=L.getRotation(e,this._rotation),this._ellipsoid=oe.fromCartesian3(w,this._ellipsoid),this._minimumHeight=B,this._maximumHeight=V;let he=ce.fromRadians(v,_,I,E,Tht);this.orientedBoundingBox=y0e(he,k,Y,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=L.fromRotationTranslation(Z.setScale(this._rotation,$,Cht),this._translation,this.shapeTransform),this.boundTransform=L.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ge=I<v,se=I-v+ge*a,pe=se<=h,xe=se>c+h&&se<a-h,De=se>=c-h&&se<=c+h,Se=se>h&&se<c-h,we=pe||xe||De||Se,ze=T<C,Oe=T-C+ze*a,ft=Oe<=h,Ct=Oe>c+h&&Oe<a-h,ot=Oe>=c-h&&Oe<=c+h,sn=Oe>h&&Oe<c-h,wn=ft||Ct||ot||sn,zt=E<-b,Bt=E>=-b&&E<=+b,be=E>+b&&E<f-x,Ee=zt||Bt||be,at=_>u+x&&_<-b,Jt=_>=-b&&_<=+b,ri=_>+b,Ze=at||Jt||ri,zr=Ee||Ze,Hr=R-O,sa=R<-b,$r=R>=-b&&R<=+b,Ne=R>+b&&R<f-x,rt=sa||$r||Ne,$e=O>u+x&&O<-b,He=O>=-b&&O<=+b,mt=O>+b,xn=rt||($e||He||mt),Zn=!m.equals(K,m.ZERO),To=!m.equals(J,m.ZERO),Qr=Zn||To,es=Y-k,ar=!m.equals(j,m.ZERO),zi=!m.equals($,m.ZERO),ts=ar||zi,Wn=this.shaderUniforms,Fn=this.shaderDefines;for(let pi in Fn)Fn.hasOwnProperty(pi)&&(Fn[pi]=void 0);Wn.ellipsoidRadiiUv=m.divideByScalar($,W,Wn.ellipsoidRadiiUv),Wn.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Wn.ellipsoidRadiiUv,Wn.ellipsoidRadiiUv,Wn.ellipsoidInverseRadiiSquaredUv),Wn.ellipsoidInverseRadiiSquaredUv);let fn=0;if(Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=fn,fn+=1,Qr&&(es===0&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),Zn&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=fn,fn+=1,Wn.ellipsoidInverseInnerScaleUv=W/(W-(V-k))),To&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Wn.ellipsoidInverseOuterScaleUv=W/(W-(V-Y)))),ts){if(ar){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let pi=(V-B)/W;Wn.ellipsoidInverseHeightDifferenceUv=1/pi,Wn.ellipseInnerRadiiUv=H.fromElements(Wn.ellipsoidRadiiUv.x*(1-pi),Wn.ellipsoidRadiiUv.z*(1-pi),Wn.ellipseInnerRadiiUv)}B===V&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(we&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=fn,xe?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,fn+=1):Se?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,fn+=2):De?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,fn+=1):pe&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,fn+=2),Wn.ellipsoidRenderLongitudeMinMax=H.fromElements(v,I,Wn.ellipsoidRenderLongitudeMinMax)),wn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,T<C&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let Hi=a/Oe,ns=-(C-r)/Oe;Wn.ellipsoidUvToShapeUvLongitude=H.fromElements(Hi,ns,Wn.ellipsoidUvToShapeUvLongitude)}if(we){let pi=P.equalsEpsilon(v,r,void 0,g),Hi=P.equalsEpsilon(I,s,void 0,g);pi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Hi&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let ns=(C-r)/a,ao=(T-r)/a,aa=(I-r)/a,Of=1-se/a,Rf=(aa+.5*Of)%1;Wn.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(ns,ao,Rf,Wn.ellipsoidShapeUvLongitudeMinMaxMid)}if(zr){Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,Ze&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=fn,at?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,fn+=1):Jt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,fn+=1):ri&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,fn+=2)),Ee&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Fn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=fn,zt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,fn+=2):Bt?(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,fn+=1):be&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,fn+=1)),_===E&&(Fn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let pi=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(_)),2),Hi=Math.pow(Math.cos(P.PI_OVER_TWO-Math.abs(E)),2);Wn.ellipsoidRenderLatitudeCosSqrHalfMinMax=H.fromElements(pi,Hi,Wn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(xn){Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,O===R&&(Fn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let pi=d/Hr,Hi=(u-O)/Hr;Wn.ellipsoidUvToShapeUvLatitude=H.fromElements(pi,Hi,Wn.ellipsoidUvToShapeUvLatitude)}return D&&(Fn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=fn,!0};var Aht=new ce;Al.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=ce.subsection(this._rectangle,s,c,a,u,Aht),g=P.lerp(this._minimumHeight,this._maximumHeight,f),h=P.lerp(this._minimumHeight,this._maximumHeight,d);return y0e(p,g,h,this._ellipsoid,this._translation,this._rotation,o)};Al.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,o=this._maximumHeight;return .5*((o-i)/(n+o))/e.z};function y0e(e,t,n,i,o,r,s){return s=Nn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=Z.multiply(s.halfAxes,r,s.halfAxes),s}Al.DefaultMinBounds=Object.freeze(new m(-P.PI,-P.PI_OVER_TWO,-Number.MAX_VALUE));Al.DefaultMaxBounds=Object.freeze(new m(+P.PI,+P.PI_OVER_TWO,+Number.MAX_VALUE));var DE=Al;var Tu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Tu.getMinBounds=function(e){switch(e){case Tu.BOX:return e_.DefaultMinBounds;case Tu.ELLIPSOID:return DE.DefaultMinBounds;case Tu.CYLINDER:return t_.DefaultMinBounds}};Tu.getMaxBounds=function(e){switch(e){case Tu.BOX:return e_.DefaultMaxBounds;case Tu.ELLIPSOID:return DE.DefaultMaxBounds;case Tu.CYLINDER:return t_.DefaultMaxBounds}};Tu.getShapeConstructor=function(e){switch(e){case Tu.BOX:return e_;case Tu.ELLIPSOID:return DE;case Tu.CYLINDER:return t_}};var Xi=Object.freeze(Tu);function g1(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new d4;let t=this,n;l(e.url)&&(Q("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(e.url).then(function(i){let o=ve.createIfNeeded(i);return o.fetchJson().then(function(r){return n=r,C0e(n),A0e(n,o).load()}).then(function(r){let s=n.root,a=s.content.extensions["3DTILES_content_voxels"],c=a.class,u=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,f=r.schema,d=new J0({metadataJson:u,schema:f});E0e(t,d,c);let p=new $0(o,s,f),{shape:g,minBounds:h,maxBounds:x,shapeTransform:b,globalTransform:C}=T0e(s);t.shape=g,t.minBounds=h,t.maxBounds=x,t.dimensions=m.unpack(a.dimensions),t.shapeTransform=b,t.globalTransform=C,t.maximumTileCount=b0e(d);let T,A;return l(a.padding)&&(T=m.unpack(a.padding.before),A=m.unpack(a.padding.after)),t.paddingBefore=T,t.paddingAfter=A,t._implicitTileset=p,ki.unload(r),t._ready=!0,t})}))}Object.defineProperties(g1.prototype,{readyPromise:{get:function(){return Q("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});g1.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();C0e(n);let i=A0e(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new J0({metadataJson:a,schema:c}),f=new g1;E0e(f,u,s);let d=new $0(t,o,c),{shape:p,minBounds:g,maxBounds:h,shapeTransform:x,globalTransform:b}=T0e(o);f.shape=p,f.minBounds=g,f.maxBounds=h,f.dimensions=m.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=b0e(u);let C,T;return l(r.padding)&&(C=m.unpack(r.padding.before),T=m.unpack(r.padding.after)),f.paddingBefore=C,f.paddingAfter=T,f._implicitTileset=d,ki.unload(i),f._ready=!0,f._readyPromise=Promise.resolve(f),f};function b0e(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(MC.TILESET_TILE_COUNT)}function C0e(e){let t=e.root;if(!l(t.content))throw new de("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function T0e(e){let t=e.boundingVolume,n;if(l(e.transform)?n=L.unpack(e.transform):n=L.clone(L.IDENTITY),l(t.box))return Sht(t.box,n);if(l(t.region))return Eht(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return vht(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Eht(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=L.fromScale(oe.WGS84.radii),c=t,u=i,f=n,d=o,p=r,g=s,h=new m(c,f,p),x=new m(u,d,g);return{shape:Xi.ELLIPSOID,minBounds:h,maxBounds:x,shapeTransform:a,globalTransform:L.clone(L.IDENTITY)}}function Sht(e,t){let n=Nn.unpack(e),i=L.fromRotationTranslation(n.halfAxes,n.center);return{shape:Xi.BOX,minBounds:m.clone(e_.DefaultMinBounds),maxBounds:m.clone(e_.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function vht(e,t){let n=Nn.unpack(e),i=L.fromRotationTranslation(n.halfAxes,n.center);return{shape:Xi.CYLINDER,minBounds:m.clone(t_.DefaultMinBounds),maxBounds:m.clone(t_.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function A0e(e,t){let{schemaUri:n,schema:i}=e;return l(n)?ki.getSchemaLoader({resource:t.getDerivedResource({url:n})}):ki.getSchemaLoader({schema:i})}function E0e(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:h}=p,x=r?.properties[d].min,b=r?.properties[d].max,C=qt.getComponentCount(g),T=x0e(x,C),A=x0e(b,C);return{id:d,type:g,componentType:h,minValue:T,maxValue:A}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function x0e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function wht(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=bp(o);return await h4.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function Iht(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=bp(a);return o=await RC.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}g1.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new wT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return Iht(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?wht(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var S0e=g1;function LY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(LY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});LY.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var p4=LY;var NY={CUMULUS:0};NY.validate=function(e){return e===NY.CUMULUS};var y1=Object.freeze(NY);function qd(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(y(e.scale,new H(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var Dht=qd.SHOW_INDEX=0,Pht=qd.POSITION_INDEX=1,Oht=qd.SCALE_INDEX=2,Rht=qd.MAXIMUM_SIZE_INDEX=3,Mht=qd.SLICE_INDEX=4,Lht=qd.BRIGHTNESS_INDEX=5,Nht=qd.COLOR_INDEX=6;qd.NUMBER_OF_PROPERTIES=7;function tb(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(qd.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,tb(this,Dht))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),tb(this,Pht))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;H.equals(t,e)||(H.clone(e,t),tb(this,Oht))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),tb(this,Rht))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),tb(this,Nht))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,tb(this,Mht))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,tb(this,Lht))}}});qd.prototype._destroy=function(){this._cloudCollection=void 0};var Ef=qd;var Au,_4=new m,Fht={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},Bht={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},kht=Ef.SHOW_INDEX,Uht=Ef.POSITION_INDEX,Vht=Ef.SCALE_INDEX,zht=Ef.MAXIMUM_SIZE_INDEX,Hht=Ef.SLICE_INDEX,Ght=Ef.BRIGHTNESS_INDEX,Wht=Ef.NUMBER_OF_PROPERTIES,jht=Ef.COLOR_INDEX;function Yd(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Wht),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:v0e(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function v0e(e){return function(){return _4.x=e._textureSliceWidth,_4.y=e._noiseTextureRows,_4.z=1/e._noiseTextureRows,_4}}Object.defineProperties(Yd.prototype,{length:{get:function(){return BY(this),this._clouds.length}}});function w0e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Yd.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,y1.CUMULUS),n;return t===y1.CUMULUS&&(n=new Ef(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Yd.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Yd.prototype.removeAll=function(){w0e(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function BY(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Yd.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Yd.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Yd.prototype.get=function(e){return BY(this),this._clouds[e]};var qht=new Float32Array([-1,-1,1,-1,1,1,-1,1]),Yht=new Uint16Array([0,1,2,0,2,3]);function Xht(e){let t=ht.createVertexBuffer({context:e,typedArray:qht,usage:ke.STATIC_DRAW}),n=ht.createIndexBuffer({context:e,typedArray:Yht,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ai({context:e,attributes:i,indexBuffer:n})}var kY;function Kht(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=ht.createIndexBuffer({context:e,typedArray:o,usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function Jht(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ht.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function Zht(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ht.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:ke.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function $ht(e,t,n){let i=[{index:Au.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Au.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Au.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Au.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:ke.STATIC_DRAW},{index:Au.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:ke.STATIC_DRAW}];n&&i.push({index:Au.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Zht(e)});let o=n?t:4*t;return new ag(e,i,o,n)}var FY=new qn;function I0e(e,t,n,i){let o,r=n[Au.positionHighAndScaleX],s=n[Au.positionLowAndScaleY],a=i.position;qn.fromCartesian(a,FY);let c=i.scale,u=FY.high,f=FY.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function D0e(e,t,n,i){let o,r=n[Au.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function P0e(e,t,n,i){let o,r=n[Au.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function O0e(e,t,n,i){let o,r=n[Au.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function Qht(e,t,n,i){I0e(e,t,n,i),D0e(e,t,n,i),P0e(e,t,n,i),O0e(e,t,n,i)}function ept(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=Xht(a),o._spNoise=$t.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Lt({context:a,width:r*r/s,height:r*s,pixelDatatype:Je.UNSIGNED_BYTE,pixelFormat:lt.RGBA,sampler:new hn({wrapS:On.REPEAT,wrapT:On.REPEAT,minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST})});let f=new Hf({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:v0e(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function tpt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=$ht(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];Qht(e,t,s,c)}n._vaf.commit(kY(i))}}var npt=[];function ipt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=npt;u.length=0,(c[Uht]||c[Vht])&&u.push(I0e),(c[kht]||c[Ght])&&u.push(D0e),(c[zht]||c[Hht])&&u.push(P0e),c[jht]&&u.push(O0e);let f=u.length,d=i._vaf.writers,p,g,h;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._vaf.commit(kY(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,h=0;h<f;++h)u[h](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function opt(e,t,n,i){let o=t.context,r=e,s=new We({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new We({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Au}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:mn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function rpt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new nt),f.pass=Ae.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Yd.prototype.update=function(e){if(BY(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&ept(this,e,gU,_U),this._instanced=e.context.instancedArrays,Au=this._instanced?Bht:Fht,kY=this._instanced?Jht:Kht;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?tpt(this,e):r>0&&ipt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&opt(this,e,pU,hU),rpt(this,e))};Yd.prototype.isDestroyed=function(){return!1};Yd.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),w0e(this._clouds),ue(this)};var R0e=Yd;async function UY(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;l(n._readyPromise)?await n._readyPromise:l(n.readyPromise)&&await n.readyPromise;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await UY._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,h){return l(h.height)?(f=!0,Math.max(h.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}UY._sampleTerrainMostDetailed=Hg;var PE=UY;var spt=P.toRadians(30);function VY(e){this._angle=y(e,spt)}Object.defineProperties(VY.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});VY.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var M0e=VY;var apt=new z,cpt=new z,lpt=new z,upt=new z,L0e=new re,x1=new Uint8Array(4);function N0e(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,o,i)}function g4(e,t){return{height:e,color:z.clone(t)}}function F0e(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?z.equals(t.color,i[n-1].color):!1,a=r?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?z.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function fpt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],h=P.clamp(g.height,El._minimumHeight,El._maximumHeight),x=z.clone(g.color,apt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(g4(h,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],h=c[n+1];u=u&&g.height<=h.height,f=f&&g.height>=h.height}f?c=c.reverse():u||py(c,function(g,h){return P.sign(g.height-h.height)});let d=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,g4(El._minimumHeight,c[0].color)),p&&c.splice(c.length,0,g4(El._maximumHeight,c[c.length-1].color)),c=F0e(c),i.push(c)}return i}function dpt(e){let t=fpt(e),n=[],i=[],o;function r(u,f){n.push(g4(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,upt);p=z.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let h=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,C=d<g?i[d]:void 0,T=d>0?i[d-1]:void 0,A=d<g-1?i[d+1]:void 0;if(l(h)&&l(C)&&h.height===C.height){let S=l(A)&&C.height===A.height,v=!l(T),I=!l(A),O=l(b)&&h.height===b.height,R=!l(x),N=!l(b);S?O?(s(h.height,h.color,C.color),s(h.height,b.color,A.color)):R?(r(h.height,C.color),s(h.height,h.color,A.color)):N?(s(h.height,h.color,C.color),r(h.height,A.color)):(s(h.height,h.color,C.color),s(h.height,h.color,A.color)):v?O?(r(h.height,h.color),s(h.height,b.color,C.color)):N?(r(h.height,h.color),r(h.height,C.color)):(R||r(h.height,h.color),s(h.height,h.color,C.color)):I?O?(s(h.height,h.color,C.color),r(h.height,b.color)):R?(r(h.height,C.color),r(h.height,h.color)):N?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),r(h.height,h.color)):O?(s(h.height,h.color,C.color),s(h.height,b.color,C.color)):R?(r(h.height,C.color),s(h.height,h.color,C.color)):N?(s(h.height,h.color,C.color),r(h.height,C.color)):s(h.height,h.color,C.color),f+=O?2:1,d+=S?2:1}else if(l(h)&&l(C)&&l(T)&&h.height<C.height){let S=N0e(h.height,T,C,lpt);l(x)?l(b)?s(h.height,h.color,S):(s(h.height,h.color,S),r(h.height,S)):(r(h.height,S),s(h.height,h.color,S)),f++}else if(l(C)&&l(h)&&l(x)&&C.height<h.height){let S=N0e(C.height,x,h,cpt);l(T)?l(A)?s(C.height,S,C.color):(s(C.height,S,C.color),r(C.height,S)):(r(C.height,S),s(C.height,S,C.color)),d++}else l(h)&&(!l(C)||h.height<C.height)?(l(C)&&!l(T)&&!l(b)?(r(h.height,h.color),r(h.height,El._emptyColor),r(C.height,El._emptyColor)):(!l(C)&&l(T)&&!l(x)&&(r(T.height,El._emptyColor),r(h.height,El._emptyColor)),r(h.height,h.color)),f++):l(C)&&(!l(h)||C.height<h.height)&&(r(C.height,C.color),d++)}}return F0e(n)}function El(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=dpt(n),r=o.length,s,a,c;if(!El._useFloatTexture(i)){a=Je.UNSIGNED_BYTE,c=lt.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)re.packFloat(o[g].height,L0e),re.pack(L0e,s,g*4)}else{a=Je.FLOAT,c=i.webgl2?lt.RED:lt.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Lt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST})}),d=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(x1),d[g*4+0]=x1[0],d[g*4+1]=x1[1],d[g*4+2]=x1[2],d[g*4+3]=x1[3];let p=Lt.create({context:i,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Si.LINEAR})});return qi.fromType("ElevationBand",{heights:f,colors:p})}El._useFloatTexture=function(e){return e.floatingPointTexture};El._maximumHeight=5906376425472;El._minimumHeight=-5906376425472;El._emptyColor=new z(0,0,0,0);var B0e=El;async function mpt(e,t){e=y(e,JA.defaultApiKey);let n,i=JA.getDefaultApiKeyCredit(e);l(i)&&(n=[i]),t=y(t,{}),t.showCreditsOnScreen=!0;let o=new ve({url:`${JA.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return Ws.fromUrl(o,t)}var k0e=mpt;function hpt(e){Q("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),e=_t(e,{url:ma.fromAssetId(96188)});let t=new Ws(e),n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new Ly({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var U0e=hpt;async function ppt(e){let t=await Ws.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new Ly({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var V0e=ppt;function _pt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=L.clone(y(e.modelMatrix,L.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Tt({geometry:Un.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Ht(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Tt({geometry:Un.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Ht(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Tt({geometry:Un.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Ht(0,0,1,1)},modelMatrix:o})),t.length>0)return new Dn({asynchronous:!1,geometryInstances:t,appearance:new cn({flat:!0,translucent:!1})})}var z0e=_pt;function gpt(e){Q("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldImageryAsync instead."),e=y(e,y.EMPTY_OBJECT);let t=y(e.style,uh.AERIAL),n=new Vd;return Vd._initialize(n,t,e),n}var H0e=gpt;function b1(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } +`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } +`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } +`;break;case"vec4":r=`vec4 getColor() { return ${o}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${o}; void main() { - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${o} = czm_batchTable_${t}(batchId); +`:`${o} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${o}; +${r} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(b1.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});b1.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;b1.prototype.isTranslucent=io.prototype.isTranslucent;b1.prototype.getRenderState=io.prototype.getRenderState;var G0e=b1;function y4(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._modelMatrix=new L,this.id=e.id,this._id=void 0,this._primitive=void 0}y4.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!L.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=L.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Tt({geometry:new qg({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Qt.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),n=new Tt({geometry:new qg({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Qt.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),i=new Tt({geometry:new qg({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Qt.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this});this._primitive=new Dn({geometryInstances:[t,n,i],appearance:new jr,asynchronous:!1})}this._primitive.update(e)}};y4.prototype.isDestroyed=function(){return!1};y4.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var x4=y4;function ypt(e){this.direction=m.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var W0e=ypt;var b4=`in vec3 v_positionMC; +in vec3 v_positionEC; +in vec2 v_st; - vec4 burst = vec4(0.0); +void main() +{ + czm_materialInput materialInput; - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} + vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + materialInput.s = v_st.s; + materialInput.st = v_st; + materialInput.str = vec3(v_st, 0.0); - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + // Convert tangent space material normal to eye space + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); - // End of manual loop unrolling. + // Convert view vector to world space + vec3 positionToEyeEC = -v_positionEC; + materialInput.positionToEyeEC = positionToEyeEC; - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + czm_material material = czm_getMaterial(materialInput); - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif } -`;var xz=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; +`;var C4=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec2 st; +in float batchId; -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;function SI(){this.show=!0,this._drawCommand=new nt({primitiveType:Le.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(SI.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var u_t=new H,f_t=new H,d_t=new oe,bI=new oe;SI.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(o,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let w=n?r.halfFloatingPointTexture?Qe.HALF_FLOAT:Qe.FLOAT:Qe.UNSIGNED_BYTE;this._texture=new Bt({context:r,width:S,height:S,pixelFormat:ct.RGBA,pixelDatatype:w}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,R={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new Bf({fragmentShaderSource:Az,outputTexture:this._texture,uniformMap:R,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},w=new Uint8Array(4*2);w[0]=0,w[1]=0,w[2]=255,w[3]=0,w[4]=255,w[5]=255,w[6]=0,w[7]=255;let D=ht.createVertexBuffer({context:r,typedArray:w,usage:Fe.STATIC_DRAW}),R=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],O=ht.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});a.vertexArray=new si({context:r,attributes:R,indexBuffer:O}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:xz,fragmentShaderSource:yz,attributeLocations:S}),a.renderState=ze.fromCache({blending:hn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;m.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=Zi.computeActualWgs84Position(e,c,bI),g=m.magnitude(m.subtract(p,e.camera.position,bI)),h=r.uniformState.projection,A=d_t;A.x=0,A.y=0,A.z=-g,A.w=1;let x=B.multiplyByVector(h,A,bI),C=Zi.clipToGLWindowCoordinates(t.viewport,x,u_t);A.x=P.SOLAR_RADIUS;let T=B.multiplyByVector(h,A,bI),E=Zi.clipToGLWindowCoordinates(t.viewport,T,f_t);return this._size=H.magnitude(H.subtract(E,C,bI)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};SI.prototype.isDestroyed=function(){return!1};SI.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Cz=SI;function Tz(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,h_t(this,e)}Object.defineProperties(Tz.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});Tz.fromWorldTerrain=function(e){return new Tz(GE(e))};function m_t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function h_t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){m_t(e._errorEvent,i)}}var Ez=Tz;function Ib(){}Ib.prototype.boundingVolume=void 0;Ib.prototype.boundingSphere=void 0;Ib.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};Ib.prototype.intersectPlane=function(e){fe.throwInstantiationError()};Ib.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var nAe=Ib;function vI(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Wi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(vI.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return $("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return $("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return $("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){$("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return $("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){$("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return $("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){$("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return $("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){$("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return $("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){$("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return $("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){$("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return $("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){$("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});vI.prototype.getTileCredits=function(e,t,n){};vI.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};vI.prototype.pickFeatures=function(e,t,n,i,r){};var bz=vI;function Wq(e){fe.throwInstantiationError()}Wq.prototype.isReady=fe.throwInstantiationError;Wq.prototype.shouldDiscardImage=fe.throwInstantiationError;var iAe=Wq;var p_t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},rAe=Object.freeze(p_t);function ox(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this.shadows=y(e.shadows,xn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new tp(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Z_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(ox.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){As.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return $("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function __t(e){return`uniform vec4 czm_pickColor; -${e}`}function g_t(e){return function(t){return gt(t,{czm_pickColor:function(){return e._pickId.color}})}}function y_t(){return"czm_pickColor"}ox.prototype.makeStyleDirty=function(){this._styleDirty=!0};ox.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var A_t=new ee;function Yq(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function rx(e,t){return e._intervals.indexOf(t.start)}function x_t(e,t){let n=e._intervals,i=e._clock,r=Yq(e);if(r===0)return;let o=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,o*r,A_t),a=n.indexOf(s),c=rx(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function C_t(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function T_t(e,t,n){let i=Yq(e),r=rx(e,t),o=rx(e,n);return i>=0?r>=o:r<=o}function sAe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function E_t(e,t,n){let i=rx(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?B.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:Ci(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,ve.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new v4({arrayBuffer:u,cull:!0,fragmentShaderLoaded:__t,uniformMapLoaded:g_t(e),pickIdLoaded:y_t})}).catch(sAe(e,c))}return o}function b_t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function S_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(aAe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(Ci()-t.timestamp)/1e3;b_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var v_t=new B;function w_t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function D_t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var I_t=new tp;function aAe(e,t,n,i){let r=y(e.shading,I_t),o=t.pointCloud,s=y(t.transform,B.IDENTITY);o.modelMatrix=B.multiplyTransformation(e.modelMatrix,s,v_t),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=w_t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=D_t(e);try{o.update(i)}catch(a){sAe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function jq(e,t,n,i){let r=E_t(e,t,i);S_t(e,r,n,i)}function P_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function cAe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function O_t(e,t){let n=rx(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function oAe(e,t,n,i,r){return l(n)?n.ready?!0:(jq(e,t,i,r),n.ready):!1}function R_t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=rx(e,n),d=rx(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],oAe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],oAe(e,s,a,i,r))return s;return t}function M_t(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var Pb={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};ox.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&M_t(this,r,s),Pb.timeSinceLoad=t,Pb.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=C_t(this);if(!l(g))return;let h=!1,A=Yq(this),x=A===0;A!==this._clockMultiplier&&(h=!0,this._clockMultiplier=A),(!l(d)||x)&&(d=g),(!l(p)||h||T_t(this,g,p))&&(p=x_t(this,g)),d=R_t(this,d,g,Pb,e);let C=O_t(this,d);l(C)||(jq(this,d,Pb,e),C=this._lastRenderedFrame),l(C)&&aAe(this,C,Pb,e),l(p)&&jq(this,p,Pb,e);let T=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return T._resolveReadyPromise(T),!0}),l(C)&&C!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let E=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;E>S&&cAe(this,P_t(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};ox.prototype.isDestroyed=function(){return!1};ox.prototype.destroy=function(){return cAe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var wI=ox;var Sz=` -in vec2 v_textureCoordinates; +out vec3 v_positionMC; +out vec3 v_positionEC; +out vec2 v_st; void main() { - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); + vec4 p = czm_computePosition(); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); + v_positionMC = position3DHigh + position3DLow; // position in model coordinates + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function vz(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=Gi.fromType(Gi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}vz.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:hn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new He({sources:[this._material.shaderSource,Sz]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Se.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};vz.prototype.isDestroyed=function(){return!1};vz.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var lAe=vz;function By(e,t,n,i,r,o,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let A=0;A<a;A++){let x=i[A],C=Yt.getComponentCount(x),T=r[A];this.megatextures[A]=new iI(t,n,C,T,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let u=e._shape;this.rootNode=new gz(0,0,0,0,void 0,u,n),this._priorityQueue=new jE({maximumLength:c,comparator:Qi.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=o,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(o);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[o-1]=0,qq(f,1,o-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Bt({context:t,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new mn({minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function qq(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,qq(e,t,r-1,i+1),qq(e,r+1,n,i+1)}By.simultaneousRequestCountMaximum=50;By.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Bt({context:o,pixelFormat:ct.RGBA,pixelDatatype:Qe.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new mn({minificationFilter:un.NEAREST,magnificationFilter:bi.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&uAe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ci();N_t(this,e);let h=Ci();U_t(this,d,c);let A=Ci();if(this._debugPrint){let x=h-g,C=A-h,T=A-g;F_t(this,x,C,T)}};By.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};By.prototype.isDestroyed=function(){return!1};By.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function uAe(e,t){let n=e._primitive,i=n._shape,r=n._provider.dimensions;if(t.computeBoundingVolumes(i,r),l(t.children))for(let o=0;o<8;o++){let s=t.children[o];uAe(e,s)}}function B_t(e,t){if(e._simultaneousRequestCount>=By.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function r(u){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!l(u))t.state=Qi.LoadState.UNAVAILABLE;else if(u===Qi.LoadState.FAILED)t.state=Qi.LoadState.FAILED;else if(!Array.isArray(u)||u.length!==f)t.state=Qi.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x:A,y:x,z:C}=g,T=A*x*C,E=u[p],S=T*h;if(E.length===S)t.metadatas[p]=E,t.state=Qi.LoadState.RECEIVED;else{t.state=Qi.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=Qi.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=Qi.LoadState.RECEIVING,c.then(r).catch(o)):t.state=Qi.LoadState.FAILED}function L_t(e){return e/(1+e)}function N_t(e,t){let n=e._frameNumber,i=e._primitive,r=i._shape,{dimensions:o}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,u=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:A}=d,C=p.drawingBufferHeight/g/A.sseDenominator;function T(b,v,I){let M=Math.min(Math.abs(v-b),Math.abs(v-I)),F=Math.max(b,u-I-1,1),k=Math.pow(1-M/F,4),V=Math.exp(-e._binaryTreeKeyframeWeighting[v]);return P.lerp(V,k,.15+.85*k)}function E(b,v){if(b.computeScreenSpaceError(h,C),v=b.visibility(t,v),v===is.MASK_OUTSIDE)return;b.visitedFrameNumber=n;let I=P.clamp(Math.floor(c),0,u-2),M=I+1;if(u===1)b.createKeyframeNode(0);else if(b.keyframeNodes.length!==u)for(let U=0;U<u;U++)b.createKeyframeNode(U);let F=L_t(b.screenSpaceError),k=!1,V=b.keyframeNodes;for(let U=0;U<V.length;U++){let q=V[U];q.priority=10*F+T(I,q.keyframe,M),q.state!==Qi.LoadState.UNAVAILABLE&&q.state!==Qi.LoadState.FAILED&&q.priority!==-Number.MAX_VALUE&&a.insert(q),q.state===Qi.LoadState.LOADED&&(k=!0)}if(b.screenSpaceError<s||!k){b.children=void 0;return}l(b.children)||b.constructChildNodes(r,o);for(let U=0;U<8;U++){let q=b.children[U];E(q,v)}}a.reset(),E(f,is.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,w=0,D;for(;a.length>0;)D=a.removeMaximum(),D.highPriorityFrameNumber=n,S[w]=D,w++;let R=e._keyframeNodesInMegatexture,O=e.megatextures[0],L=O.occupiedCount;R.length=L,R.sort(function(b,v){return b.highPriorityFrameNumber===v.highPriorityFrameNumber?v.priority-b.priority:v.highPriorityFrameNumber-b.highPriorityFrameNumber});let N=0,_=0;for(let b=0;b<w;b++)if(D=S[b],!(D.state===Qi.LoadState.LOADED||D.spatialNode===void 0)&&(D.state===Qi.LoadState.UNLOADED&&B_t(e,D),D.state===Qi.LoadState.RECEIVED)){let v=0;if(O.isFull()){v=L-1-N,N++;let I=R[v];I.spatialNode.destroyKeyframeNode(I,e.megatextures)}else v=L+_,_++;D.spatialNode.addKeyframeNodeToMegatextures(D,e.megatextures),R[v]=D}}function F_t(e,t,n,i){let r=e._keyframeCount,o=e.rootNode,s=Object.keys(Qi.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let T=new Array(r);a[C]=T;for(let E=0;E<r;E++)T[E]=0;c[C]=0}function f(C){let T=C.keyframeNodes;for(let E=0;E<T.length;E++){let S=T[E],w=S.keyframe,D=S.state;a[D][w]+=1,c[D]+=1,u++}if(l(C.children))for(let E=0;E<8;E++){let S=C.children[E];f(S)}}f(o);let d=`KEYFRAMES: ${a[Qi.LoadState.LOADED]}`,p=`UNLOADED: ${c[Qi.LoadState.UNLOADED]} | RECEIVING: ${c[Qi.LoadState.RECEIVING]} | RECEIVED: ${c[Qi.LoadState.RECEIVED]} | LOADED: ${c[Qi.LoadState.LOADED]} | FAILED: ${c[Qi.LoadState.FAILED]} | UNAVAILABLE: ${c[Qi.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,A=Math.round(i*100)/100,x=`LOAD: ${g} | OCT: ${h} | ALL: ${A}`;console.log(`${d} || ${p} || ${x}`)}var wz={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function U_t(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,h,A,x,C){let T=!1;if(l(g.children))for(let E=0;E<8;E++){let S=g.children[E];S.computeSurroundingRenderableKeyframeNodes(r),S.isRenderable(o)&&(T=!0)}if(T){u[C]=wz.INTERNAL<<16|h,u[A]=x,a++,x=h,C=x*9+1;for(let E=0;E<8;E++){let S=g.children[E];h=a,A=h*9+0,d(S,h,A,x,C+E)}}else{if(s){let E=c*5,S=g.renderableKeyframeNodePrevious,w=g.level-S.spatialNode.level,D=S.spatialNode.parent,R=l(D)?D.renderableKeyframeNodePrevious:S,O=V_t(g,i,n),L=w,N=1,_=S.megatextureIndex,b=R.megatextureIndex;f[E+0]=O,f[E+1]=L,f[E+2]=N,f[E+3]=_,f[E+4]=b,u[C]=wz.LEAF<<16|c}else{let E=g.renderableKeyframeNodePrevious,w=g.level-E.spatialNode.level===0?wz.LEAF:wz.PACKED_LEAF_FROM_PARENT;u[C]=w<<16|E.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),k_t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&z_t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function V_t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function k_t(e,t,n,i){let r=ct.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let h=0;h<r;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function z_t(e,t,n,i){let r=ct.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],h=e[p*o+1],A=e[p*o+2],x=e[p*o+3],C=e[p*o+4],T=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=h&255,u[p*8+3]=A&255,u[p*8+4]=x>>>0&255,u[p*8+5]=x>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}By.getApproximateTextureMemoryByteLength=function(e,t,n,i){let r=0,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=i[s],u=Yt.getComponentCount(a);r+=iI.getApproximateTextureMemoryByteLength(e,t,u,c)}return r};var DI=By;var H_t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},II=Object.freeze(H_t);function Ob(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Ob.prototype.getTexture=function(e){return this._textures[e]};function G_t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Ob.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):G_t(this,e,t)};function W_t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?Dz(r,o,n):j_t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function Dz(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?dAe(e,n):new Bt({context:n,source:t,sampler:r});return fAe(r)&&o.generateMipmap(),o}function j_t(e,t,n){let{typedArray:i,sampler:r}=e,o=fAe(r),s=r.wrapS===Pn.REPEAT||r.wrapS===Pn.MIRRORED_REPEAT||r.wrapT===Pn.REPEAT||r.wrapT===Pn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===Qe.UNSIGNED_BYTE){let d=VU(i,a,c),p=b0(d);return Dz({sampler:r},p,n)}}else{let d=b0(t);return Dz(e,d,n)}else return Dz(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),dAe(e,n)}function fAe(e){return[un.NEAREST_MIPMAP_NEAREST,un.NEAREST_MIPMAP_LINEAR,un.LINEAR_MIPMAP_NEAREST,un.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function dAe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Bt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}Ob.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];W_t(this,r,t)}n.length=0};Ob.prototype.isDestroyed=function(){return!1};Ob.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var Iz=Ob;function PI(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,ig.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,M0.INHERIT),this._textureManager=new Iz,this._defaultTexture=void 0,this.uniformMap=Y_t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},K_t(this),J_t(this)}function Y_t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===II.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=q_t(e,i)):n[i]=X_t(e,i)}return n}function q_t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function X_t(e,t){return function(){return e.uniforms[t].value}}function sx(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function K_t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,sx(o,t,r),r=e.usedVariablesVertex.featureIdSet,sx(o,n,r),r=e.usedVariablesVertex.metadataSet,sx(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,sx(s,t,r),r=e.usedVariablesFragment.featureIdSet,sx(s,n,r),r=e.usedVariablesFragment.metadataSet,sx(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;sx(s,a,c)}}function mAe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function rc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${mAe(t)} is not available in the ${i} shader. Did you mean ${mAe(n)} instead?`;throw new fe(r)}}function J_t(e){let t=e.usedVariablesVertex.attributeSet;rc(t,"position","positionMC","vertex"),rc(t,"normal","normalMC","vertex"),rc(t,"tangent","tangentMC","vertex"),rc(t,"bitangent","bitangentMC","vertex"),rc(t,"positionWC","positionMC","vertex"),rc(t,"positionEC","positionMC","vertex"),rc(t,"normalEC","normalMC","vertex"),rc(t,"tangentEC","tangentMC","vertex"),rc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;rc(n,"position","positionEC","fragment"),rc(n,"normal","normalEC","fragment"),rc(n,"tangent","tangentEC","fragment"),rc(n,"bitangent","bitangentEC","fragment"),rc(n,"normalMC","normalEC","fragment"),rc(n,"tangentMC","tangentEC","fragment"),rc(n,"bitangentMC","bitangentEC","fragment")}PI.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===II.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};PI.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};PI.prototype.isDestroyed=function(){return!1};PI.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var Rb=PI;function yh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,yh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=B.clone(y(e.modelMatrix,B.IDENTITY)),this._compoundModelMatrix=new B,this._compoundModelMatrixOld=new B,this._customShader=y(e.customShader,yh.DefaultCustomShader),this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new B,this._transformPositionUvToWorld=new B,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Rm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new B,transformPositionUvToView:new B,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new B,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let r in t)if(t.hasOwnProperty(r)){let o=`u_${r}`;n[o]=function(){return t[r]}}let i=this._provider;this._completeLoad=function(r,o){},this._readyPromise=Z_t(this,i)}async function Z_t(e,t){let n=new Promise(function(a){e._completeLoad=function(c,u){u.afterRender.push(function(){return c._ready=!0,a(c),!0})}});l(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:r=ji.getMinBounds(i),maxBounds:o=ji.getMaxBounds(i)}=t;e.minBounds=r,e.maxBounds=o,e.minClippingBounds=ji.getMinBounds(i),e.maxClippingBounds=ji.getMaxBounds(i),pAe(e,t);let s=ji.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=_Ae(e,e._shape,t),n}Object.defineProperties(yh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=B.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){As.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];l(e)?this._customShader=e:this._customShader=yh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var Q_t=new m,$_t=new oe,egt=new oe,tgt=new m,ngt=new m,igt=new Z,rgt=new Z,ogt=new B,sgt=new B,agt=new B,cgt=B.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new B),lgt=B.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new B);yh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),l(t._ready)&&!t._ready||!l(this._shape))return;let n=e.context;if(!this._ready){ugt(this,t,n),this._completeLoad(this,e);return}let i=pAe(this,t),r=this._shape;if(i&&(this._shapeVisible=_Ae(this,r,t),mgt(this,r)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let o=hgt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,o,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Tgt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),pgt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(SV(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=r.orientedBoundingBox,g=ygt(p,d,egt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let A=n.uniformState.inverseView;f.transformPositionViewToUv=B.multiplyTransformation(this._transformPositionWorldToUv,A,f.transformPositionViewToUv);let x=n.uniformState.view;f.transformPositionUvToView=B.multiplyTransformation(x,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=B.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let E=e.passes.pick?this._drawCommandPick:this._drawCommand;E.boundingVolume=r.boundingSphere,e.commandList.push(E)};function ugt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:r,shaderUniforms:o}=e._shape;e._shapeDefinesOld=Ye(r,!0);let s=e._uniformMap;for(let a in o)if(o.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return o[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=fgt(e,t,n),dgt(e._traversal,i)}function pAe(e,t){let n=y(t.shapeTransform,B.IDENTITY),i=y(t.globalTransform,B.IDENTITY);return B.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),B.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),OI(e,"_compoundModelMatrix","_compoundModelMatrixOld")+OI(e,"_minBounds","_minBoundsOld")+OI(e,"_maxBounds","_maxBoundsOld")+OI(e,"_minClippingBounds","_minClippingBoundsOld")+OI(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function OI(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}function _Ae(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let r=t.shapeTransform,o=B.inverse(r,ogt),s=B.getRotation(r,igt),a=B.getScale(r,tgt),c=m.maximumComponent(a),u=m.divideByScalar(a,c,ngt),f=Z.multiplyByScale(s,u,rgt),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=B.multiplyTransformation(cgt,o,e._transformPositionWorldToUv),e._transformPositionUvToWorld=B.multiplyTransformation(r,lgt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=B.getMatrix3(o,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function fgt(e,t,n){let i=m.clone(t.dimensions,Q_t);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let r=t.maximumTileCount,o=l(r)?DI.getApproximateTextureMemoryByteLength(r,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new DI(e,n,i,t.types,t.componentTypes,s,o)}function dgt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],r=n.length;t.megatextureTextures=new Array(r);for(let o=0;o<r;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function mgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(r=>n[r]!==e._shapeDefinesOld[r]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function hgt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/o;return r+a}function pgt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=B.transpose(B.multiplyTransformation(B.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionUvToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var hAe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),_gt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),ggt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function ygt(e,t,n){let i=B.fromRotationTranslation(e.halfAxes,e.center,sgt),r=B.multiply(t,i,agt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=ggt,d=hAe.length;for(u=0;u<d;u++)B.multiplyByVector(r,hAe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=_gt[u*3+g],A=f[h];if(A.z>=-A.w){let x=p.z+p.w,C=A.z+A.w,T=x/(x-C),E=oe.lerp(p,A,T,$_t),S=E.x/E.w,w=E.y/E.w;o=Math.min(o,S),s=Math.max(s,S),a=Math.min(a,w),c=Math.max(c,w)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(o,a,s,c,n),n}var Xq=3e7,Agt=new m(Xq,0,0),xgt=new m(0,Xq,0),Cgt=new m(0,0,Xq);function Tgt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:Gi.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(m.ZERO,Agt,z.RED,a),r(m.ZERO,xgt,z.LIME,a),r(m.ZERO,Cgt,z.BLUE,a),i.update(t)}yh.DefaultCustomShader=new Rb({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function nb(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,C4),this._fragmentShaderSource=y(e.fragmentShaderSource,b4),this._renderState=io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(nb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return nb.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});nb.VERTEX_FORMAT=Me.POSITION_AND_ST;nb.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;nb.prototype.isTranslucent=io.prototype.isTranslucent;nb.prototype.getRenderState=io.prototype.getRenderState;var j0e=nb;function Sl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Sl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Sl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Sl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Sl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Sl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new _e,this._nominalFrameRate=new _e,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){xpt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){bpt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Sl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Sl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Sl({scene:e})),e._frameRateMonitor};Object.defineProperties(Sl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Sl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Sl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Sl.prototype.isDestroyed=function(){return!1};Sl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function xpt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/$n.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/$n.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/$n.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function bpt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var T4=Sl;function Cpt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = ${n}.rgb; + float clippingPlanesEdgeWidth = ${n}.a; + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) + { + out_FragColor = clippingPlanesEdgeColor; + } +`}var A4=Cpt;var q0e=ur(Ij(),1);function zY(){this._image=new Image}zY.prototype.isReady=function(){return!0};zY.prototype.shouldDiscardImage=function(e){return e===this._image};function ib(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new zY),this._errorEvent=new _e,this._ready=!1;let n=this,i,o;if(l(e.url)){Q("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let r=ve.createIfNeeded(e.url);o=new sh(r)}l(e.metadata)&&(Q("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),o=e.metadata),this._metadata=o,l(o)&&(this._readyPromise=o.readyPromise.then(function(r){if(!o.imageryPresent){let s=new de(`The server ${o.url} doesn't have imagery`);return i=Ai.reportError(i,n,n._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return Ai.reportSuccess(i),n._ready=r,r}).catch(function(r){return i=Ai.reportError(i,n,n._errorEvent,r.message,void 0,void 0,void 0,r),Promise.reject(r)}))}Object.defineProperties(ib.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ib.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new ib(t);return n._metadata=e,n._ready=!0,n._readyPromise=Promise.resolve(!0),n};ib.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};ib.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=sh.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new Qo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=Tpt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){Mk(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=Apt(f)),!l(d)&&(!l(p)||p)){let g=Ept(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?o:IC({uint8Array:f,format:d,flipY:!0})})};ib.prototype.pickFeatures=function(e,t,n,i,o){};function Tpt(e,t,n,i,o,r){let s=sh.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function Apt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Ept(e){let t=q0e.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var Y0e=ib;var Spt=new z(1,1,1,.4),vpt=new z(0,1,0,.05),wpt=new z(0,.5,0,.2);function ob(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Yi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,Spt),this._glowColor=y(e.glowColor,vpt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,wpt),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(ob.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(e){Q("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ob.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};ob.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};ob.prototype.getTileCredits=function(e,t,n){};ob.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};ob.prototype.pickFeatures=function(e,t,n,i,o){};var X0e=ob;function HY(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(HY.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});HY.prototype.load=async function(){return this._data=await OE.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var E4=HY;function RE(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(RE.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Ipt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}RE.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let o=e._parseHeader(n),r=Ipt(e._storageInfo.attributeValues.valueType);r>0&&(o=Math.ceil(o/r)*r),e._parseBody(n,o)}})};RE.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};RE.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};RE.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=this._storageInfo[i];if(l(o)){this._values[i]=[];for(let r=0;r<this._header.count;++r)if(o.valueType!=="String"){let s=this._parseValue(e,o.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[r],a="";for(let c=0;c<s;++c){let u=this._parseValue(e,o.valueType,t);u.value.charCodeAt(0)!==0&&(a+=u.value),t=u.offset}this._values[i].push(a)}}}};var S4=RE;function C1(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(C1.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});C1.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Dpt=new m,Ppt=new m,Opt=new m,Rpt=new m,Mpt=new m;function GY(e,t,n,i){let o=m.subtract(i,n,Dpt),r=m.cross(o,m.subtract(e,n,Ppt),Rpt),s=m.cross(o,m.subtract(t,n,Opt),Mpt);return m.dot(r,s)>=0}var Lpt=new m,Npt=new m,Fpt=new m,Bpt=new m,kpt=new m,Upt=new m,Vpt=new m,zpt=new m,Hpt=new m,Gpt=new m;C1.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,h,x;l(f)?(g=f[p],h=f[p+1],x=f[p+2]):(g=p*3,h=p*3+1,x=p*3+2);let b=m.fromElements(u[g*3],u[g*3+1],u[g*3+2],Lpt),C=m.fromElements(u[h*3],u[h*3+1],u[h*3+2],Npt),T=new m(u[x*3],u[x*3+1],u[x*3+2],Fpt);if(!GY(i,b,C,T)||!GY(i,C,b,T)||!GY(i,T,b,C))continue;let A=m.subtract(C,b,Bpt),S=m.subtract(T,b,kpt),v=m.cross(A,S,Upt);if(m.magnitude(v)===0)continue;let I=m.normalize(v,Vpt),O=m.subtract(i,b,zpt),R=Math.abs(m.dot(O,I));if(R<o){o=R,r=p;let N=m.magnitudeSquared(m.subtract(i,b,O)),F=m.magnitudeSquared(m.subtract(i,C,Hpt)),_=m.magnitudeSquared(m.subtract(i,T,Gpt));N<F&&N<_?(a=g,c=b,s=N):F<_?(a=h,c=C,s=F):(a=x,c=T,s=_)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};C1.prototype._generateGltf=function(e,t,n,i,o,r){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,u="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let x=this._parent._data.mesh.material.definition;if(x>=0&&x<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[x],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let b="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let T=this._layer._data.textureSetDefinitions[C];for(let A=0;A<T.formats.length;A++){let S=T.formats[A];if(S.format==="jpg"){b=S.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(u=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${b}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,u=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let f=[],d=[],p=[];return a&&(f=[{sampler:0,source:0}],d=[{uri:u}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:[s],textures:f,images:d,samplers:p,asset:{version:"2.0"}}};var T1=C1;function vl(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(vl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});vl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new ld(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await OE.loadJson(this._resource,this._dataProvider._traceFetches);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};vl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(o,r){let s=new S4(t,o[r]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let o=0;o<e.length;o++)i.push(n(e,o));return Promise.all(i)};vl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};vl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};vl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new vl(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};vl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new T1(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new T1(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};vl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new E4(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};vl.prototype._clearGeometryData=function(){this._geometryData=[]};vl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=me.fromDegrees(e.center[0],e.center[1],e.center[2]):n=me.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let T=this._dataProvider._geoidDataList[C],A=T.projection.project(n);if(A.x>T.nativeExtent.west&&A.x<T.nativeExtent.east&&A.y>T.nativeExtent.south&&A.y<T.nativeExtent.north){n.height+=jpt(A.x,A.y,T);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=oe.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=oe.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new lc(0,0,0),u=Mt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Be(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new L(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=L.inverse(p,new L),h=L.clone(p);l(this._parent._globalTransform)&&L.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};vl.prototype._createI3SDecoderTask=async function(e,t){let n=t.geometryData._parent._data,i=t.geometryData._parent._inverseRotationMatrix,o=0,r=0,s=0;l(n.obb)?(o=n.obb.center[0],r=n.obb.center[1],s=n.obb.center[2]):l(n.mbs)&&(o=n.mbs[0],r=n.mbs[1],s=n.mbs[2]);let a=Z.fromRotationX(-P.PI_OVER_TWO),c=new Z;Z.multiply(a,i,c);let u=me.fromDegrees(o,r,s),f=oe.WGS84.cartographicToCartesian(u),d={binaryData:t.geometryData._data,featureData:l(t.featureData)&&l(t.featureData[0])?t.featureData[0].data:void 0,schema:t.defaultGeometrySchema,bufferInfo:t.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:oe.WGS84.radiiSquared,url:t.url,geoidDataList:t.geometryData._dataProvider._geoidDataList,cartographicCenter:u,cartesianCenter:f,parentRotation:c},p=[];return e.scheduleTask(d,p)};vl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=await this._dataProvider.getDecoderTaskProcessor(),n=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&n.push(this._loadFeatureData());let i=this;return Promise.all(n).then(function(){let o=Promise.resolve();if(l(i._geometryData)&&i._geometryData.length>0){let r={geometryData:i._geometryData[0],featureData:i._featureData,defaultGeometrySchema:i._layer._data.store.defaultGeometrySchema,url:i._geometryData[0].resource.url,tile:i._tile},s=i._createI3SDecoderTask(t,r);if(!l(s))return;o=s.then(function(a){e=r.geometryData._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),i._geometryData[0]._customAttributes=a.meshData._customAttributes})}return o.then(function(){let r=i._dataProvider._binarizeGltf(e),s=new Blob([r],{type:"application/binary"});return URL.createObjectURL(s)})})};ld.prototype._hookedRequestContent=ld.prototype.requestContent;ld.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new ve({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function Wpt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function v4(e,t,n,i){let o=e+t*n;return i[o]}function jpt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=v4(s,a,n.width,n.buffer),d=v4(c,a,n.width,n.buffer),p=v4(s,u,n.width,n.buffer),g=v4(c,u,n.width,n.buffer),h=Wpt(o,r,f,d,p,g);return h=h*n.scale+n.offset,h}Object.defineProperties(ld.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var A1=vl;function Sf(e,t,n){this._dataProvider=e,l(t.href)||(t.href=`./layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new ve({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Sf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Sf.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Sf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Sf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}return 0};Sf.prototype._loadRootNode=function(){if(l(this._data.nodePages)){let e=0;l(this._data.nodePages.rootIndex)&&(e=this._data.nodePages.rootIndex),this._rootNode=new A1(this,e,!0)}else this._rootNode=new A1(this,this._data.store.rootNode,!0);return this._rootNode.load()};Sf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage,i=this;return this._loadNodePage(t).then(function(){return i._nodePages[t][n]})};Sf._fetchJson=function(e){return e.fetchJson()};Sf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Sf._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Sf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Sf.prototype._create3DTileset=async function(){let e={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},t=new Blob([JSON.stringify(e)],{type:"application/json"}),n=URL.createObjectURL(t),i={};if(l(this._dataProvider._cesium3dTilesetOptions))for(let o in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(o)&&(i[o]=this._dataProvider._cesium3dTilesetOptions[o]);this._tileset=await Ws.fromUrl(n,i),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};var rb=Sf;var J0e=ur(K0e(),1);function Zr(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=y(e.traceFetches,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,l(e.url)&&(Q("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=ve.createIfNeeded(e.url),this._load())}Object.defineProperties(Zr.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return Q("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return Q("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});Zr.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};Zr.prototype.isDestroyed=function(){return!1};Zr.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Zr.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Zr.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Zr.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};Zr.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=ve.createIfNeeded(e),i=await Zr.loadJson(n),o=new Zr(t);if(o._resource=n,o._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new rb(o,i.layers[s],s);o._layers.push(a)}else{let s=new rb(o,i,i.id);o._layers.push(s)}o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load());return await Promise.all(r),o._ready=!0,o._readyPromise=Promise.resolve(o),o};Zr.prototype._load=function(){let e=this;return this._readyPromise=Zr.loadJson(this._resource,this._traceFetches).then(function(t){if(e._data=t,l(t.layers))for(let i=0;i<t.layers.length;i++){let o=new rb(e,t.layers[i],i);e._layers.push(o)}else{let i=new rb(e,t,t.id);e._layers.push(i)}e._computeExtent();let n=[];for(let i=0;i<e._layers.length;i++)n.push(e._layers[i].load());return Promise.all(n).then(function(){return e._ready=!0,e})}),this._readyPromise};Zr._fetchJson=function(e){return e.fetchJson()};Zr.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await Zr._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new de(n.error)}return n};Zr.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};Zr.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]="g".charCodeAt(),o.magic[1]="l".charCodeAt(),o.magic[2]="T".charCodeAt(),o.magic[3]="F".charCodeAt(),o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};Zr.prototype.getDecoderTaskProcessor=function(){if(l(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!l(this._decoderTaskProcessor)){let e=new yi("decodeI3S");this._taskProcessorReadyPromise=e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>e),this._decoderTaskProcessor=e}return this._taskProcessorReadyPromise};function qpt(e,t){return Xpt(e,t)}var Ypt=new H;function Xpt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=me.fromRadians(t.west,t.north),a=me.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=H.fromElements(d,p,Ypt),h=g.toString();if(!o.hasOwnProperty(h)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[h]=x,i.push(x)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let h={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=d[g],b="Geographic";n._projection instanceof Oi&&(b="WebMercator");let C={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===Rd.LERC){let T=J0e.default.decode(x._buffer);C.buffer=T.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function Kpt(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await qpt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Zr.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Kpt(this),this._geoidDataPromise)};Zr.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};var OE=Zr;var Z0e=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function I4(e,t){this.spatialNode=e,this.keyframe=t,this.state=Z0e.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}I4.priorityComparator=function(e,t){return e.priority-t.priority};I4.searchComparator=function(e,t){return e.keyframe-t.keyframe};I4.LoadState=Z0e;var to=I4;function $0e(){}Object.defineProperties($0e.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var Q0e=$0e;var Jpt=/\/$/,exe=new wt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ME(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();Jpt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new wt(c))):c=exe,this._resource=i,this._imageryProvider=new ta({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(ME.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return Q("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return Q("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});ME.prototype.getTileCredits=function(e,t,n){};ME.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ME.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ME._defaultCredit=exe;var txe=ME;function Ny(e,t,n,i,o){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let r=e.floatingPointTexture;if(i===rn.FLOAT32&&!r)throw new de("Floating point texture not supported");let s;i===rn.FLOAT32||i===rn.FLOAT64?s=Je.FLOAT:i===rn.UINT8&&(s=Je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?lt.RED:lt.LUMINANCE:n===2?a=e.webgl2?lt.RG:lt.LUMINANCE_ALPHA:n===3?a=lt.RGB:n===4&&(a=lt.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Gt.maximumTextureSize,d=rn.getSizeInBytes(i),p=Math.floor(o/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/h),b=h*t.x,C=x*t.y,T=Math.floor(g/b),A=Math.floor(g/C);if(T===0||A===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=T*A,this.regionCountPerMegatexture=new H(T,A),this.voxelCountPerRegion=new H(b,C),this.sliceCountPerRegion=new H(h,x),this.voxelSizeUv=new H(1/g,1/g),this.sliceSizeUv=new H(t.x/g,t.y/g),this.regionSizeUv=new H(b/g,C/g),this.texture=new Lt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new hn({wrapS:On.CLAMP_TO_EDGE,wrapT:On.CLAMP_TO_EDGE,minificationFilter:un.LINEAR,magnificationFilter:Si.LINEAR})});let S=rn.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,b*C*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new Zpt(v);for(let v=0;v<this.maximumTileCount;v++){let I=this.nodes[v];I.previousNode=v>0?this.nodes[v-1]:void 0,I.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Zpt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Ny.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Ny.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Ny.prototype.isFull=function(){return this.emptyList===void 0};Ny.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===rn.UNSIGNED_SHORT&&(i=rn.FLOAT32);let o=rn.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};Ny.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let T=0;T<i.y;T++)for(let A=0;A<i.x;A++){let S=x*i.y*i.x+T*i.x+A,v=(C+T)*r.x+(b+A);for(let I=0;I<s;I++)a[v*s+I]=n[S*s+I]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,d=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,h={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(h)};Ny.prototype.isDestroyed=function(){return!1};Ny.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var E1=Ny;function WY(e){}WY.prototype.isReady=function(){return!0};WY.prototype.shouldDiscardImage=function(e){return!1};var nxe=WY;var $pt=new wt("MapQuest, Open Street Map and contributors, CC-BY-SA");function D4(e){e=y(e,y.EMPTY_OBJECT);let t=ve.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new kr({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,$pt);typeof d=="string"&&(d=new wt(d)),ta.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(D4.prototype=Object.create(ta.prototype),D4.prototype.constructor=D4);var LE=D4;var Qpt=new H(1,1);function jY(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=H.clone(y(e.imageSize,Qpt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(jY.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var ixe=new m;jY.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,ixe),m.add(this.position,ixe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var S1=jY;function oxe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(oxe.prototype,{complete:{get:function(){return this._complete}}});var rxe=oxe;function sxe(e){}sxe.prototype.emit=function(e){fe.throwInstantiationError()};var axe=sxe;var cxe=new H(1,1);function v1(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new p4(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._emitterModelMatrix=L.clone(y(e.emitterModelMatrix,L.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new L,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=H.clone(y(e.imageSize,y(e.minimumImageSize,cxe))),this._maximumImageSize=H.clone(y(e.imageSize,y(e.maximumImageSize,cxe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(v1.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!L.equals(this._modelMatrix,e),L.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!L.equals(this._emitterModelMatrix,e),L.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function e_t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new S1;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function t_t(e){let t=e._particlePool.pop();return l(t)||(t=new S1),t}function n_t(e,t){e._particlePool.push(t)}function i_t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function o_t(e){l(e._billboard)&&(e._billboard.show=!1)}function lxe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function r_t(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function s_t(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var P4=new m;v1.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Wu),this._updateParticlePool&&(e_t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?lxe(this,s):(o_t(s),n_t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=s_t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=L.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=t_t(this),this._emitter.emit(s),m.add(s.position,s.velocity,P4),L.multiplyByPoint(u,P4,P4),s.position=L.multiplyByPoint(u,s.position,s.position),m.subtract(P4,s.position,s.velocity),m.normalize(s.velocity,s.velocity),r_t(this,s),lxe(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&i_t(this)};v1.prototype.isDestroyed=function(){return!1};v1.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var uxe=v1;var mxe=ur(Q1(),1);var a_t={modifyFragmentShader:function(t){return t=We.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +void main() +{ +#ifndef SHADOW_MAP + if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},w1=a_t;var sb={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function I1(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=sb.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ae.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=L.clone(L.IDENTITY),this._modelMatrix=L.clone(L.IDENTITY),this.time=0,this.shadows=Cn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,ol.NONE),this._splittingEnabled=!1,this._error=void 0,c_t(this,e)}Object.defineProperties(I1.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function c_t(e,t){let n=nT.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=M_.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=sb.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=z.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var l_t=new m,u_t=new m,f_t=new m,fxe,O4;function d_t(e){if(!l(O4)){fxe=new mxe.default(0),O4=new Array(e);for(let t=0;t<e;++t)O4[t]=fxe.random()}return O4}function m_t(e){let n=e.length/3,i=Math.min(n,20),o=d_t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,l_t),c=m.fromElements(s,s,s,u_t);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=m.unpack(e,d*3,f_t);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function dxe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(Nt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var h_t=new re,p_t=new re,__t=new z,hxe=0,R4=1,JY=2,pxe=3,g_t=4,qY=new L,y_t=new L;function x_t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,h=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,C=e._isRGB565,T=e._isTranslucent,A=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,I,O,R=[],N={};if(e._styleableShaderAttributes=N,f){let U=g_t;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],Y=dxe(k.typedArray,G);I=k.componentCount,O=X.fromTypedArray(Y);let j=ht.createVertexBuffer({context:n,typedArray:Y,usage:ke.STATIC_DRAW});e._geometryByteLength+=j.sizeInBytes;let $={index:U,vertexBuffer:j,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push($),N[G]={location:U,componentCount:I},++U}}let F=ht.createVertexBuffer({context:n,typedArray:r.typedArray,usage:ke.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let _;A&&(_=ht.createVertexBuffer({context:n,typedArray:s.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let E;S&&(E=ht.createVertexBuffer({context:n,typedArray:a.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let w;v&&(c.typedArray=dxe(c.typedArray,"batchIds"),w=ht.createVertexBuffer({context:n,typedArray:c.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D=[];if(d?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,D.push({index:hxe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=m_t(r.typedArray)),A)if(C)D.push({index:R4,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=T?4:3;D.push({index:R4,vertexBuffer:_,componentsPerAttribute:U,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(I=2,O=X.UNSIGNED_BYTE):h?(I=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(I=3,O=X.FLOAT),D.push({index:JY,vertexBuffer:E,componentsPerAttribute:I,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:pxe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(D=D.concat(R));let M=new ai({context:n,attributes:D}),B={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:mn.ALPHA_BLEND};e._opaquePass===Ae.CESIUM_3D_TILE&&(B.stencilTest=kt.setCesium3DTileBit(),B.stencilMask=kt.CESIUM_3D_TILE_MASK,V.stencilTest=kt.setCesium3DTileBit(),V.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(V),e._drawCommand=new nt({boundingVolume:new ae,cull:e._cull,modelMatrix:new L,primitiveType:Fe.POINTS,vertexArray:M,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Ae.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function b_t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=h_t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,__t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return L.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);L.multiply(n.uniformState.view3D,c,qY);let u=L.multiply(qY,a.modelMatrix,qY);return L.inverseTranspose(u,y_t)}};w1.addUniforms(e,s),(i||o||r)&&(s=_t(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=p_t;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function YY(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function XY(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function KY(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var C_t={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function T_t(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,h=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,C=e._backFaceCulling,T=e._normalShading,A=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,I,O,R,N=g,F=Ye(C_t),_={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],F[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let se={translucent:!1},pe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${pe}`,F,se),O=n.getShowShaderFunction(`getShowFromStyle${pe}`,F,se),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${pe}`,F,se),l(I)&&se.translucent&&(N=!0)}e._styleTranslucent=N;let w=l(I),D=l(O),M=l(R),B=e.isClipped,V=[],U=[];w&&(YY(I,V),XY(I,U)),D&&(YY(O,V),XY(O,U)),M&&(YY(R,V),XY(R,U));let G=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let se=V.indexOf(r.location)>=0,pe=KY(A,r.location);pe.enabled=se}let Y=h&&(!w||G);if(h){let se=KY(A,R4);se.enabled=Y}let j=x&&(T||C||k);if(x){let se=KY(A,JY);se.enabled=j}let $={a_position:hxe};Y&&($.a_color=R4),j&&($.a_normal=JY),b&&($.a_batchId=pxe);let W="",K=V.length;for(i=0;i<K;++i){let se=V[i];r=_[se];let pe=r.componentCount,xe=`czm_3dtiles_property_${se}`,De;pe===1?De="float":De=`vec${pe}`,W+=`in ${De} ${xe}; +`,$[xe]=r.location}b_t(e,t);let J=`in vec3 a_position; +out vec4 v_color; +uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; +uniform vec4 u_constantColor; +uniform vec4 u_highlightColor; +`;J+=`float u_pointSize; +float tiles3d_tileset_time; +`,v&&(J+=`float u_geometricError; +float u_depthMultiplier; +`),J+=W,Y&&(g?J+=`in vec4 a_color; +`:p?J+=`in float a_color; +const float SHIFT_RIGHT_11 = 1.0 / 2048.0; +const float SHIFT_RIGHT_5 = 1.0 / 32.0; +const float SHIFT_LEFT_11 = 2048.0; +const float SHIFT_LEFT_5 = 32.0; +const float NORMALIZE_6 = 1.0 / 64.0; +const float NORMALIZE_5 = 1.0 / 32.0; +`:J+=`in vec3 a_color; +`),j&&(f||d?J+=`in vec2 a_normal; +`:J+=`in vec3 a_normal; +`),b&&(J+=`in float a_batchId; +`),(c||u||d)&&(J+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),w&&(J+=I),D&&(J+=O),M&&(J+=R),J+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,v&&(J+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),Y?g?J+=` vec4 color = a_color; +`:p?J+=` float compressed = a_color; + float r = floor(compressed * SHIFT_RIGHT_11); + compressed -= r * SHIFT_LEFT_11; + float g = floor(compressed * SHIFT_RIGHT_5); + compressed -= g * SHIFT_LEFT_5; + float b = compressed; + vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); + vec4 color = vec4(rgb, 1.0); +`:J+=` vec4 color = vec4(a_color, 1.0); +`:J+=` vec4 color = u_constantColor; +`,c||u?J+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; +`:J+=` vec3 position = a_position; +`,J+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); +`,j?(f?J+=` vec3 normal = czm_octDecode(a_normal); +`:d?J+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; +`:J+=` vec3 normal = a_normal; +`,J+=` vec3 normalEC = czm_normal * normal; +`):J+=` vec3 normal = vec3(1.0); +`,w&&(J+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),D&&(J+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),M?J+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:v?J+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); + float depth = -positionEC.z; + gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); +`:J+=` gl_PointSize = u_pointSize; +`,J+=` color = color * u_highlightColor; +`,j&&T&&(J+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); + diffuseStrength = max(diffuseStrength, 0.4); + color.xyz *= diffuseStrength * czm_lightColor; +`),J+=` v_color = color; + gl_Position = czm_modelViewProjection * vec4(position, 1.0); +`,j&&C&&(J+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),D&&(J+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),J+=`} +`;let he=`in vec4 v_color; +`;B&&(he+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,he+=` +`,he+=Ty(S,s),he+=` +`),he+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,B&&(he+=A4("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),he+=`} +`,e.splitDirection!==ol.NONE&&(he=w1.modifyFragmentShader(he)),l(e._vertexShaderLoaded)&&(J=e._vertexShaderLoaded(J)),l(e._fragmentShaderLoaded)&&(he=e._fragmentShaderLoaded(he));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=$t.fromCache({context:s,vertexShaderSource:J,fragmentShaderSource:he,attributeLocations:$});try{ge.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function A_t(e,t){if(e._decodingState===sb.READY)return!1;if(e._decodingState===sb.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=H_.decodePointCloud(i,t);l(o)&&(e._decodingState=sb.DECODING,o.then(function(r){e._decodingState=sb.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let b=r.POSITION.data.quantization,C=b.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,h=i.batchTableProperties;for(let b in h)if(h.hasOwnProperty(b)){let C=r[b];l(g)||(g={}),g[b]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=sb.FAILED,e._error=r}))}return!0}var E_t=new re,S_t=new m;I1.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(A_t(this,t))return;let i=!1,o=!L.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(x_t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){L.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(L.clone(this._modelMatrix,u),l(this._rtcCenter)&&L.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&L.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=L.getColumn(u,3,E_t);re.equals(p,re.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;L.multiplyByPoint(u,d,d);let p=L.getScale(u,S_t);f.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==ol.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&T_t(this,e,this._style),this._drawCommand.castShadows=Cn.castShadows(this.shadows),this._drawCommand.receiveShadows=Cn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ae.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};I1.prototype.isDestroyed=function(){return!1};I1.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var M4=I1;function Eu(){fe.throwInstantiationError()}Eu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Eu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},ready:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Eu.prototype.update=fe.throwInstantiationError;Eu.prototype.beginUpdate=fe.throwInstantiationError;Eu.prototype.endUpdate=fe.throwInstantiationError;Eu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Eu.prototype.loadTile=fe.throwInstantiationError;Eu.prototype.computeTileVisibility=fe.throwInstantiationError;Eu.prototype.showTileThisFrame=fe.throwInstantiationError;Eu.prototype.computeDistanceToTile=fe.throwInstantiationError;Eu.prototype.isDestroyed=fe.throwInstantiationError;Eu.prototype.destroy=fe.throwInstantiationError;var _xe=Eu;function vf(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Nn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r,s)}var v_t=new m;vf.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=Z.getScale(this.orientedBoundingBox.halfAxes,v_t),i=2*m.maximumComponent(n);this.approximateVoxelSize=i/m.minimumComponent(t)};vf.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:o,z:r}=this,s=i*2,a=o*2,c=r*2,u=a+1,f=s+1,d=c+1,p=n+1,g=[[p,s,a,c],[p,f,a,c],[p,s,u,c],[p,f,u,c],[p,s,a,d],[p,f,a,d],[p,s,u,d],[p,f,u,d]];this.children=g.map(([h,x,b,C])=>new vf(h,x,b,C,this,e,t))};vf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};vf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var gxe={keyframe:0};function D1(e,t){return gxe.keyframe=e,Oo(t,gxe,to.searchComparator)}vf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=w_t(i,d),g=d[p],h=o===i||i<g.keyframe?p:Math.min(p+1,d.length-1),x=d[h],b=i-g.keyframe,C=yxe(n-t.level,b);C<a&&(a=C,r=g);let T=x.keyframe-o,A=yxe(n-t.level,T);if(A<c&&(c=A,s=x),b===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function w_t(e,t){let n=D1(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function yxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}vf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};vf.prototype.createKeyframeNode=function(e){let t=D1(e,this.keyframeNodes);if(t<0){t=~t;let n=new to(this,e);this.keyframeNodes.splice(t,0,n)}};vf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=D1(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=D1(n,this.renderableKeyframeNodes);if(o<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=to.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};vf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==to.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadatas[o]),e.metadatas[o]=void 0}e.state=to.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=D1(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};vf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var L4=vf;function ZY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(ZY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});ZY.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var xxe=ZY;function P1(){}P1.prototype.evaluate=function(e,t){fe.throwInstantiationError()};P1.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};P1.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};P1.prototype.getVariables=function(){fe.throwInstantiationError()};var bxe=P1;function N4(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,D_t(this,e)}Object.defineProperties(N4.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});N4.fromWorldTerrain=function(e){return new N4(GA(e))};function I_t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function D_t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){I_t(e._errorEvent,i)}}var F4=N4;function NE(){}NE.prototype.boundingVolume=void 0;NE.prototype.boundingSphere=void 0;NE.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};NE.prototype.intersectPlane=function(e){fe.throwInstantiationError()};NE.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var Cxe=NE;function O1(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Yi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new _e,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(O1.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Q("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return Q("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=e}},defaultNightAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=e}},defaultDayAlpha:{get:function(){return Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(e){Q("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=e}},defaultBrightness:{get:function(){return Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(e){Q("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=e}},defaultContrast:{get:function(){return Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(e){Q("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=e}},defaultHue:{get:function(){return Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(e){Q("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=e}},defaultSaturation:{get:function(){return Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(e){Q("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=e}},defaultGamma:{get:function(){return Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(e){Q("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=e}},defaultMinificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=e}},defaultMagnificationFilter:{get:function(){return Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(e){Q("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=e}}});O1.prototype.getTileCredits=function(e,t,n){};O1.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};O1.prototype.pickFeatures=function(e,t,n,i,o){};var B4=O1;function $Y(e){fe.throwInstantiationError()}$Y.prototype.isReady=fe.throwInstantiationError;$Y.prototype.shouldDiscardImage=fe.throwInstantiationError;var Txe=$Y;var P_t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Axe=Object.freeze(P_t);function cb(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this.shadows=y(e.shadows,Cn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new tp(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new $_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(cb.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return Q("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function O_t(e){return`uniform vec4 czm_pickColor; +${e}`}function R_t(e){return function(t){return _t(t,{czm_pickColor:function(){return e._pickId.color}})}}function M_t(){return"czm_pickColor"}cb.prototype.makeStyleDirty=function(){this._styleDirty=!0};cb.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var L_t=new ee;function eX(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function ab(e,t){return e._intervals.indexOf(t.start)}function N_t(e,t){let n=e._intervals,i=e._clock,o=eX(e);if(o===0)return;let r=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,r*o,L_t),a=n.indexOf(s),c=ab(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function F_t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function B_t(e,t,n){let i=eX(e),o=ab(e,t),r=ab(e,n);return i>=0?o>=r:o<=r}function Sxe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function k_t(e,t,n){let i=ab(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?L.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,ve.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new M4({arrayBuffer:u,cull:!0,fragmentShaderLoaded:O_t,uniformMapLoaded:R_t(e),pickIdLoaded:M_t})}).catch(Sxe(e,c))}return r}function U_t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function V_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(vxe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;U_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var z_t=new L;function H_t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function G_t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var W_t=new tp;function vxe(e,t,n,i){let o=y(e.shading,W_t),r=t.pointCloud,s=y(t.transform,L.IDENTITY);r.modelMatrix=L.multiplyTransformation(e.modelMatrix,s,z_t),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=H_t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=G_t(e);try{r.update(i)}catch(a){Sxe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function QY(e,t,n,i){let o=k_t(e,t,i);V_t(e,o,n,i)}function j_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function wxe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function q_t(e,t){let n=ab(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function Exe(e,t,n,i,o){return l(n)?n.ready?!0:(QY(e,t,i,o),n.ready):!1}function Y_t(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=ab(e,n),d=ab(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],Exe(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],Exe(e,s,a,i,o))return s;return t}function X_t(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var FE={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};cb.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&X_t(this,o,s),FE.timeSinceLoad=t,FE.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=F_t(this);if(!l(g))return;let h=!1,x=eX(this),b=x===0;x!==this._clockMultiplier&&(h=!0,this._clockMultiplier=x),(!l(d)||b)&&(d=g),(!l(p)||h||B_t(this,g,p))&&(p=N_t(this,g)),d=Y_t(this,d,g,FE,e);let C=q_t(this,d);l(C)||(QY(this,d,FE,e),C=this._lastRenderedFrame),l(C)&&vxe(this,C,FE,e),l(p)&&QY(this,p,FE,e);let T=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return T._resolveReadyPromise(T),!0}),l(C)&&C!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=C;let A=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;A>S&&wxe(this,j_t(e));let I=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,f,a,this.boundingSphere)};cb.prototype.isDestroyed=function(){return!1};cb.prototype.destroy=function(){return wxe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var R1=cb;function k4(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=qi.fromType(qi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}k4.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:mn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new We({sources:[this._material.shaderSource,LU]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ae.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};k4.prototype.isDestroyed=function(){return!1};k4.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Ixe=k4;function Fy(e,t,n,i,o,r,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let x=0;x<a;x++){let b=i[x],C=qt.getComponentCount(b),T=o[x];this.megatextures[x]=new E1(t,n,C,T,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let u=e._shape;this.rootNode=new L4(0,0,0,0,void 0,u,n),this._priorityQueue=new jA({maximumLength:c,comparator:to.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[r-1]=0,tX(f,1,r-2,0);let d=9,p=2048,g=Math.floor(p/d),h=Math.ceil(c/g);this.internalNodeTexture=new Lt({context:t,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:p,height:h,sampler:new hn({minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST})}),this.internalNodeTilesPerRow=g,this.internalNodeTexelSizeUv=new H(1/p,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}function tX(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,tX(e,t,o-1,i+1),tX(e,o+1,n,i+1)}Fy.simultaneousRequestCountMaximum=50;Fy.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),A=Math.ceil(s/T);this.leafNodeTexture=new Lt({context:r,pixelFormat:lt.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new hn({minificationFilter:un.NEAREST,magnificationFilter:Si.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&Dxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ti();Z_t(this,e);let h=Ti();Q_t(this,d,c);let x=Ti();if(this._debugPrint){let b=h-g,C=x-h,T=x-g;$_t(this,b,C,T)}};Fy.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Fy.prototype.isDestroyed=function(){return!1};Fy.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function Dxe(e,t){let n=e._primitive,i=n._shape,o=n._provider.dimensions;if(t.computeBoundingVolumes(i,o),l(t.children))for(let r=0;r<8;r++){let s=t.children[r];Dxe(e,s)}}function K_t(e,t){if(e._simultaneousRequestCount>=Fy.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function o(u){e._simultaneousRequestCount--;let f=n._provider.types.length;if(!l(u))t.state=to.LoadState.UNAVAILABLE;else if(u===to.LoadState.FAILED)t.state=to.LoadState.FAILED;else if(!Array.isArray(u)||u.length!==f)t.state=to.LoadState.FAILED;else{let d=e.megatextures;for(let p=0;p<f;p++){let{voxelCountPerTile:g,channelCount:h}=d[p],{x,y:b,z:C}=g,T=x*b*C,A=u[p],S=T*h;if(A.length===S)t.metadatas[p]=A,t.state=to.LoadState.RECEIVED;else{t.state=to.LoadState.FAILED;break}}}}function r(){e._simultaneousRequestCount--,t.state=to.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=to.LoadState.RECEIVING,c.then(o).catch(r)):t.state=to.LoadState.FAILED}function J_t(e){return e/(1+e)}function Z_t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,{dimensions:r}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,u=e._keyframeCount,f=e.rootNode,{camera:d,context:p,pixelRatio:g}=t,{positionWC:h,frustum:x}=d,C=p.drawingBufferHeight/g/x.sseDenominator;function T(E,w,D){let M=Math.min(Math.abs(w-E),Math.abs(w-D)),B=Math.max(E,u-D-1,1),V=Math.pow(1-M/B,4),U=Math.exp(-e._binaryTreeKeyframeWeighting[w]);return P.lerp(U,V,.15+.85*V)}function A(E,w){if(E.computeScreenSpaceError(h,C),w=E.visibility(t,w),w===ss.MASK_OUTSIDE)return;E.visitedFrameNumber=n;let D=P.clamp(Math.floor(c),0,u-2),M=D+1;if(u===1)E.createKeyframeNode(0);else if(E.keyframeNodes.length!==u)for(let k=0;k<u;k++)E.createKeyframeNode(k);let B=J_t(E.screenSpaceError),V=!1,U=E.keyframeNodes;for(let k=0;k<U.length;k++){let Y=U[k];Y.priority=10*B+T(D,Y.keyframe,M),Y.state!==to.LoadState.UNAVAILABLE&&Y.state!==to.LoadState.FAILED&&Y.priority!==-Number.MAX_VALUE&&a.insert(Y),Y.state===to.LoadState.LOADED&&(V=!0)}if(E.screenSpaceError<s||!V){E.children=void 0;return}l(E.children)||E.constructChildNodes(o,r);for(let k=0;k<8;k++){let Y=E.children[k];A(Y,w)}}a.reset(),A(f,ss.MASK_INDETERMINATE);let S=e._highPriorityKeyframeNodes,v=0,I;for(;a.length>0;)I=a.removeMaximum(),I.highPriorityFrameNumber=n,S[v]=I,v++;let O=e._keyframeNodesInMegatexture,R=e.megatextures[0],N=R.occupiedCount;O.length=N,O.sort(function(E,w){return E.highPriorityFrameNumber===w.highPriorityFrameNumber?w.priority-E.priority:w.highPriorityFrameNumber-E.highPriorityFrameNumber});let F=0,_=0;for(let E=0;E<v;E++)if(I=S[E],!(I.state===to.LoadState.LOADED||I.spatialNode===void 0)&&(I.state===to.LoadState.UNLOADED&&K_t(e,I),I.state===to.LoadState.RECEIVED)){let w=0;if(R.isFull()){w=N-1-F,F++;let D=O[w];D.spatialNode.destroyKeyframeNode(D,e.megatextures)}else w=N+_,_++;I.spatialNode.addKeyframeNodeToMegatextures(I,e.megatextures),O[w]=I}}function $_t(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(to.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let T=new Array(o);a[C]=T;for(let A=0;A<o;A++)T[A]=0;c[C]=0}function f(C){let T=C.keyframeNodes;for(let A=0;A<T.length;A++){let S=T[A],v=S.keyframe,I=S.state;a[I][v]+=1,c[I]+=1,u++}if(l(C.children))for(let A=0;A<8;A++){let S=C.children[A];f(S)}}f(r);let d=`KEYFRAMES: ${a[to.LoadState.LOADED]}`,p=`UNLOADED: ${c[to.LoadState.UNLOADED]} | RECEIVING: ${c[to.LoadState.RECEIVING]} | RECEIVED: ${c[to.LoadState.RECEIVED]} | LOADED: ${c[to.LoadState.LOADED]} | FAILED: ${c[to.LoadState.FAILED]} | UNAVAILABLE: ${c[to.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,h=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${g} | OCT: ${h} | ALL: ${x}`;console.log(`${d} || ${p} || ${b}`)}var U4={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Q_t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,h,x,b,C){let T=!1;if(l(g.children))for(let A=0;A<8;A++){let S=g.children[A];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(T=!0)}if(T){u[C]=U4.INTERNAL<<16|h,u[x]=b,a++,b=h,C=b*9+1;for(let A=0;A<8;A++){let S=g.children[A];h=a,x=h*9+0,d(S,h,x,b,C+A)}}else{if(s){let A=c*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,I=S.spatialNode.parent,O=l(I)?I.renderableKeyframeNodePrevious:S,R=egt(g,i,n),N=v,F=1,_=S.megatextureIndex,E=O.megatextureIndex;f[A+0]=R,f[A+1]=N,f[A+2]=F,f[A+3]=_,f[A+4]=E,u[C]=U4.LEAF<<16|c}else{let A=g.renderableKeyframeNodePrevious,v=g.level-A.spatialNode.level===0?U4.LEAF:U4.PACKED_LEAF_FROM_PARENT;u[C]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),tgt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&ngt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function egt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function tgt(e,t,n,i){let o=lt.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],g=d*o;for(let h=0;h<o;h++)c[g+h]=p>>>h*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function ngt(e,t,n,i){let o=lt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],h=e[p*r+1],x=e[p*r+2],b=e[p*r+3],C=e[p*r+4],T=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=h&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}Fy.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=qt.getComponentCount(a);o+=E1.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var M1=Fy;var igt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},L1=Object.freeze(igt);function BE(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}BE.prototype.getTexture=function(e){return this._textures[e]};function ogt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}BE.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):ogt(this,e,t)};function rgt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?V4(o,r,n):sgt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function V4(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?Oxe(e,n):new Lt({context:n,source:t,sampler:o});return Pxe(o)&&r.generateMipmap(),r}function sgt(e,t,n){let{typedArray:i,sampler:o}=e,r=Pxe(o),s=o.wrapS===On.REPEAT||o.wrapS===On.MIRRORED_REPEAT||o.wrapT===On.REPEAT||o.wrapT===On.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Je.UNSIGNED_BYTE){let d=kk(i,a,c),p=A0(d);return V4({sampler:o},p,n)}}else{let d=A0(t);return V4(e,d,n)}else return V4(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),Oxe(e,n)}function Pxe(e){return[un.NEAREST_MIPMAP_NEAREST,un.NEAREST_MIPMAP_LINEAR,un.LINEAR_MIPMAP_NEAREST,un.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function Oxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Lt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}BE.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];rgt(this,o,t)}n.length=0};BE.prototype.isDestroyed=function(){return!1};BE.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var z4=BE;function N1(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,og.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,M0.INHERIT),this._textureManager=new z4,this._defaultTexture=void 0,this.uniformMap=agt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},ugt(this),fgt(this)}function agt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===L1.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=cgt(e,i)):n[i]=lgt(e,i)}return n}function cgt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function lgt(e,t){return function(){return e.uniforms[t].value}}function lb(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function ugt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,lb(r,t,o),o=e.usedVariablesVertex.featureIdSet,lb(r,n,o),o=e.usedVariablesVertex.metadataSet,lb(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,lb(s,t,o),o=e.usedVariablesFragment.featureIdSet,lb(s,n,o),o=e.usedVariablesFragment.metadataSet,lb(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;lb(s,a,c)}}function Rxe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function oc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${Rxe(t)} is not available in the ${i} shader. Did you mean ${Rxe(n)} instead?`;throw new fe(o)}}function fgt(e){let t=e.usedVariablesVertex.attributeSet;oc(t,"position","positionMC","vertex"),oc(t,"normal","normalMC","vertex"),oc(t,"tangent","tangentMC","vertex"),oc(t,"bitangent","bitangentMC","vertex"),oc(t,"positionWC","positionMC","vertex"),oc(t,"positionEC","positionMC","vertex"),oc(t,"normalEC","normalMC","vertex"),oc(t,"tangentEC","tangentMC","vertex"),oc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;oc(n,"position","positionEC","fragment"),oc(n,"normal","normalEC","fragment"),oc(n,"tangent","tangentEC","fragment"),oc(n,"bitangent","bitangentEC","fragment"),oc(n,"normalMC","normalEC","fragment"),oc(n,"tangentMC","tangentEC","fragment"),oc(n,"bitangentMC","bitangentEC","fragment")}N1.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===L1.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};N1.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};N1.prototype.isDestroyed=function(){return!1};N1.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var kE=N1;function yh(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,yh.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=L.clone(y(e.modelMatrix,L.IDENTITY)),this._compoundModelMatrix=new L,this._compoundModelMatrixOld=new L,this._customShader=y(e.customShader,yh.DefaultCustomShader),this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new L,this._transformPositionUvToWorld=new L,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Rm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new L,transformPositionUvToView:new L,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new re,clippingPlanesTexture:void 0,clippingPlanesMatrix:new L,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;this._completeLoad=function(o,r){},this._readyPromise=dgt(this,i)}async function dgt(e,t){let n=new Promise(function(a){e._completeLoad=function(c,u){u.afterRender.push(function(){return c._ready=!0,a(c),!0})}});l(t._readyPromise)&&!t._ready&&await t._readyPromise;let{shape:i,minBounds:o=Xi.getMinBounds(i),maxBounds:r=Xi.getMaxBounds(i)}=t;e.minBounds=o,e.maxBounds=r,e.minClippingBounds=Xi.getMinBounds(i),e.maxClippingBounds=Xi.getMaxBounds(i),Lxe(e,t);let s=Xi.getShapeConstructor(i);return e._shape=new s,e._shapeVisible=Nxe(e,e._shape,t),n}Object.defineProperties(yh.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return Q("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=L.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=yh.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var mgt=new m,hgt=new re,pgt=new re,_gt=new m,ggt=new m,ygt=new Z,xgt=new Z,bgt=new L,Cgt=new L,Tgt=new L,Agt=L.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new m(.5,.5,.5),new L),Egt=L.fromRotationTranslation(Z.fromUniformScale(2,new Z),new m(-1,-1,-1),new L);yh.prototype.update=function(e){let t=this._provider;if(this._customShader.update(e),l(t._ready)&&!t._ready||!l(this._shape))return;let n=e.context;if(!this._ready){Sgt(this,t,n),this._completeLoad(this,e);return}let i=Lxe(this,t),o=this._shape;if(i&&(this._shapeVisible=Nxe(this,o,t),Igt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Dgt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Bgt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Pgt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(u4(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=Mgt(p,d,pgt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=re.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=L.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=L.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,C,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=L.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};function Sgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=vgt(e,t,n),wgt(e._traversal,i)}function Lxe(e,t){let n=y(t.shapeTransform,L.IDENTITY),i=y(t.globalTransform,L.IDENTITY);return L.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),L.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),F1(e,"_compoundModelMatrix","_compoundModelMatrixOld")+F1(e,"_minBounds","_minBoundsOld")+F1(e,"_maxBounds","_maxBoundsOld")+F1(e,"_minClippingBounds","_minClippingBoundsOld")+F1(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function F1(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Nxe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=L.inverse(o,bgt),s=L.getRotation(o,ygt),a=L.getScale(o,_gt),c=m.maximumComponent(a),u=m.divideByScalar(a,c,ggt),f=Z.multiplyByScale(s,u,xgt),d=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(d),e._transformPositionWorldToUv=L.multiplyTransformation(Agt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=L.multiplyTransformation(o,Egt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=L.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function vgt(e,t,n){let i=m.clone(t.dimensions,mgt);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?M1.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new M1(e,n,i,t.types,t.componentTypes,s,r)}function wgt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Igt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Dgt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/r;return o+a}function Pgt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=L.transpose(L.multiplyTransformation(L.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var Mxe=new Array(new re(-1,-1,-1,1),new re(1,-1,-1,1),new re(-1,1,-1,1),new re(1,1,-1,1),new re(-1,-1,1,1),new re(1,-1,1,1),new re(-1,1,1,1),new re(1,1,1,1)),Ogt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Rgt=new Array(new re,new re,new re,new re,new re,new re,new re,new re);function Mgt(e,t,n){let i=L.fromRotationTranslation(e.halfAxes,e.center,Cgt),o=L.multiply(t,i,Tgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Rgt,d=Mxe.length;for(u=0;u<d;u++)L.multiplyByVector(o,Mxe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,h=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,h),c=Math.max(c,h)}else for(let g=0;g<3;g++){let h=Ogt[u*3+g],x=f[h];if(x.z>=-x.w){let b=p.z+p.w,C=x.z+x.w,T=b/(b-C),A=re.lerp(p,x,T,hgt),S=A.x/A.w,v=A.y/A.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=re.fromElements(r,a,s,c,n),n}var nX=3e7,Lgt=new m(nX,0,0),Ngt=new m(0,nX,0),Fgt=new m(0,0,nX);function Bgt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:qi.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(r(c.orientedBoundingBox,g,d),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}r(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Lgt,z.RED,a),o(m.ZERO,Ngt,z.LIME,a),o(m.ZERO,Fgt,z.BLUE,a),i.update(t)}yh.DefaultCustomShader=new kE({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function gAe(){this.ready=!0,this.shape=ji.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[Yt.SCALAR],this.componentTypes=[on.FLOAT32],this.maximumTileCount=1}gAe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};yh.DefaultProvider=new gAe;var RI=yh;function Kq(){fe.throwInstantiationError()}Object.defineProperties(Kq.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});Kq.prototype.requestData=fe.throwInstantiationError;var yAe=Kq;function ax(){fe.throwInstantiationError()}Object.defineProperties(ax.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});ax.prototype.update=fe.throwInstantiationError;ax.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;ax.prototype.computeApproximateStepSize=fe.throwInstantiationError;ax.DefaultMinBounds=fe.throwInstantiationError;ax.DefaultMaxBounds=fe.throwInstantiationError;var AAe=ax;function Mb(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Egt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let o="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(o,void 0,r)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function xAe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function CAe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=xAe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function TAe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function cx(e,t){e=Mn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=jt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=jt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Mn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Mn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new Fm,CAe(this);try{let p=new lz({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=m.UNIT_Z,xAe(this),TAe(this);let g=y(p.mapProjection.ellipsoid,re.WGS84),h=t.globe;l(h)||(h=new Xk(g)),h!==!1&&(p.globe=h,p.globe.shadows=y(t.terrainShadows,xn.RECEIVE_ONLY));let A=t.skyBox;l(A)||(A=new _z({sources:{positiveX:Mb("px"),negativeX:Mb("mx"),positiveY:Mb("py"),negativeY:Mb("my"),positiveZ:Mb("pz"),negativeZ:Mb("mz")}})),A!==!1&&(p.skyBox=A,p.sun=new Cz,p.moon=new a4);let x=t.skyAtmosphere;l(x)||(x=new dz(g)),x!==!1&&(p.skyAtmosphere=x),l(t.imageryProvider)&&$("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead.");let C=t.baseLayer;t.globe!==!1&&C!==!1&&t.imageryProvider!==!1&&(l(t.imageryProvider)&&!l(C)&&(C=new na(t.imageryProvider)),l(C)||(C=na.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new gf(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(E,S){if(T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors){let w="An error occurred while rendering. Rendering has stopped.";T.showErrorPanel(w,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",h='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,h,p)}throw p}}Object.defineProperties(cx.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Egt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});cx.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let h=kp(n);u||(typeof n=="string"&&(n=new Error(n)),t=kp({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${h}`);let A=document.createElement("div");A.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),A.appendChild(x),A.onclick=function(C){A.removeChild(x),A.appendChild(document.createTextNode(h)),A.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",A.onclick=void 0},a.appendChild(A)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};cx.prototype.isDestroyed=function(){return!1};cx.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};cx.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,CAe(this),TAe(this),this._scene.requestRender())};cx.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var Pz=cx;function bgt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,ct.RGBA),this.pixelDatatype=y(e.pixelDatatype,Qe.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Pn.REPEAT:Pn.CLAMP_TO_EDGE;this.sampler=new mn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var EAe=bgt;var Sgt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},bAe=Object.freeze(Sgt);var SAe=`uniform sampler2D u_depthTexture; +}`});function Fxe(){this.ready=!0,this.shape=Xi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[qt.SCALAR],this.componentTypes=[rn.FLOAT32],this.maximumTileCount=1}Fxe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};yh.DefaultProvider=new Fxe;var B1=yh;function iX(){fe.throwInstantiationError()}Object.defineProperties(iX.prototype,{ready:{get:fe.throwInstantiationError},readyPromise:{get:fe.throwInstantiationError},globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});iX.prototype.requestData=fe.throwInstantiationError;var Bxe=iX;function ub(){fe.throwInstantiationError()}Object.defineProperties(ub.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});ub.prototype.update=fe.throwInstantiationError;ub.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;ub.prototype.computeApproximateStepSize=fe.throwInstantiationError;ub.DefaultMinBounds=fe.throwInstantiationError;ub.DefaultMaxBounds=fe.throwInstantiationError;var kxe=ub;var Uxe=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15083,38 +15045,38 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;function vgt(e,t,n){let i;try{return i=e(t,n),i}catch(r){return Promise.reject(r)}}function wgt(e){let t;return function(n){let i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(vgt(e,i.parameters,r)).then(function(s){o.result=s}).catch(function(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${kp(s)} - with responseMessage: ${JSON.stringify(o)}`,t(o)}})}}var vAe=wgt;globalThis.CESIUM_VERSION="1.105";var MI;typeof ko<"u"&&(MI=ko);(function(){/*! +`;function kgt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,lt.RGBA),this.pixelDatatype=y(e.pixelDatatype,Je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?On.REPEAT:On.CLAMP_TO_EDGE;this.sampler=new hn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Vxe=kgt;var Ugt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},zxe=Object.freeze(Ugt);function Vgt(e,t,n){let i;try{return i=e(t,n),i}catch(o){return Promise.reject(o)}}function zgt(e){let t;return function(n){let i=n.data,o=[],r={id:i.id,result:void 0,error:void 0};return Promise.resolve(Vgt(e,i.parameters,o)).then(function(s){r.result=s}).catch(function(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(o.length=0);try{t(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Vp(s)} + with responseMessage: ${JSON.stringify(r)}`,t(r)}})}}var Hxe=zgt;globalThis.CESIUM_VERSION="1.106.1";var k1;typeof ko<"u"&&(k1=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,b){return _===null||typeof _ in A?_===b:!1}function u(_,b){var v;return function(){v||(v=h.a.setTimeout(function(){v=e,_()},b))}}function f(_,b){var v;return function(){clearTimeout(v),v=h.a.setTimeout(_,b)}}function d(_,b){b&&b!=="change"?b==="beforeChange"?this.pc(_):this.gb(_,b):this.qc(_)}function p(_,b){b!==null&&b.s&&b.s()}function g(_,b){var v=this.qd,I=v[S];I.ra||(this.Qb&&this.mb[b]?(v.uc(b,_,this.mb[b]),this.mb[b]=null,--this.Qb):I.I[b]||v.uc(b,_,I.J?{da:_}:v.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,b){for(var v=_.split("."),I=h,M=0;M<v.length-1;M++)I=I[v[M]];I[v[v.length-1]]=b},h.L=function(_,b,v){_[b]=v},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(W,K){for(var J in W)M.call(W,J)&&K(J,W[J])}function b(W,K){if(K)for(var J in K)M.call(K,J)&&(W[J]=K[J]);return W}function v(W,K){return W.__proto__=K,W}function I(W,K,J,me){var ye=W[K].match(Y)||[];h.a.D(J.match(Y),function(se){h.a.Na(ye,se,me)}),W[K]=ye.join(" ")}var M=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,k=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(W,K){if(K.length)for(var J=0,me=K.length;J<me;J++)G[K[J]]=W});var U={propertychange:!0},q=n&&function(){for(var W=3,K=n.createElement("div"),J=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",J[0];);return 4<W?W:e}(),Y=/\S+/g,Q;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,J){for(var me=0,ye=W.length;me<ye;me++)K.call(J,W[me],me,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var J=0,me=W.length;J<me;J++)if(W[J]===K)return J;return-1},Lb:function(W,K,J){for(var me=0,ye=W.length;me<ye;me++)if(K.call(J,W[me],me,W))return W[me];return e},Pa:function(W,K){var J=h.a.A(W,K);0<J?W.splice(J,1):J===0&&W.shift()},wc:function(W){var K=[];return W&&h.a.D(W,function(J){0>h.a.A(K,J)&&K.push(J)}),K},Mb:function(W,K,J){var me=[];if(W)for(var ye=0,se=W.length;ye<se;ye++)me.push(K.call(J,W[ye],ye));return me},jb:function(W,K,J){var me=[];if(W)for(var ye=0,se=W.length;ye<se;ye++)K.call(J,W[ye],ye)&&me.push(W[ye]);return me},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var J=0,me=K.length;J<me;J++)W.push(K[J]);return W},Na:function(W,K,J){var me=h.a.A(h.a.bc(W),K);0>me?J&&W.push(K):J||W.splice(me,1)},Ba:F,extend:b,setPrototypeOf:v,Ab:F?v:b,P:_,Ga:function(W,K,J){if(!W)return W;var me={},ye;for(ye in W)M.call(W,ye)&&(me[ye]=K.call(J,W[ye],ye,W));return me},Tb:function(W){for(;W.firstChild;)h.removeNode(W.firstChild)},Yb:function(W){W=h.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),J=0,me=W.length;J<me;J++)K.appendChild(h.oa(W[J]));return K},Ca:function(W,K){for(var J=0,me=W.length,ye=[];J<me;J++){var se=W[J].cloneNode(!0);ye.push(K?h.oa(se):se)}return ye},va:function(W,K){if(h.a.Tb(W),K)for(var J=0,me=K.length;J<me;J++)W.appendChild(K[J])},Xc:function(W,K){var J=W.nodeType?[W]:W;if(0<J.length){for(var me=J[0],ye=me.parentNode,se=0,pe=K.length;se<pe;se++)ye.insertBefore(K[se],me);for(se=0,pe=J.length;se<pe;se++)h.removeNode(J[se])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var J=W[0],me=W[W.length-1];for(W.length=0;J!==me;)W.push(J),J=J.nextSibling;W.push(me)}}return W},Zc:function(W,K){7>q?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return h.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!h.a.Lb(W,h.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return h.onError?function(){try{return W.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(h.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw h.onError&&h.onError(W),W},0)},B:function(W,K,J){var me=h.a.Ac(J);if(J=U[K],h.options.useOnlyNativeEvents||J||!r)if(J||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ye=function(pe){me.call(W,pe)},se="on"+K;W.attachEvent(se,ye),h.a.K.za(W,function(){W.detachEvent(se,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,me,!1);else Q||(Q=typeof r(W).on=="function"?"on":"bind"),r(W)[Q](K,me)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var J;if(h.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(J=W.type,J=J=="checkbox"||J=="radio"):J=!1,h.options.useOnlyNativeEvents||!r||J)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")J=n.createEvent(G[K]||"HTMLEvents"),J.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(J);else throw Error("The supplied element doesn't support dispatchEvent");else if(J&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else r(W).trigger(K)},f:function(W){return h.O(W)?W():W},bc:function(W){return h.O(W)?W.v():W},Eb:function(W,K,J){var me;K&&(typeof W.classList=="object"?(me=W.classList[J?"add":"remove"],h.a.D(K.match(Y),function(ye){me.call(W.classList,ye)})):typeof W.className.baseVal=="string"?I(W.className,"baseVal",K,J):I(W,"className",K,J))},Bb:function(W,K){var J=h.a.f(K);(J===null||J===e)&&(J="");var me=h.h.firstChild(W);!me||me.nodeType!=3||h.h.nextSibling(me)?h.h.va(W,[W.ownerDocument.createTextNode(J)]):me.data=J,h.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=q)try{var J=W.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+J+"'/>"),!1)}catch{}},Ad:function(W){9<=q&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(q){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=h.a.f(W),K=h.a.f(K);for(var J=[],me=W;me<=K;me++)J.push(me);return J},la:function(W){for(var K=[],J=0,me=W.length;J<me;J++)K.push(W[J]);return K},Da:function(W){return k?Symbol(W):W},Zd:q===6,$d:q===7,W:q,Lc:function(W,K){for(var J=h.a.la(W.getElementsByTagName("input")).concat(h.a.la(W.getElementsByTagName("textarea"))),me=typeof K=="string"?function(pe){return pe.name===K}:function(pe){return K.test(pe.name)},ye=[],se=J.length-1;0<=se;se--)me(J[se])&&ye.push(J[se]);return ye},Nd:function(W){return typeof W=="string"&&(W=h.a.Db(W))?o&&o.parse?o.parse(W):new Function("return "+W)():null},hc:function(W,K,J){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(h.a.f(W),K,J)},Od:function(W,K,J){J=J||{};var me=J.params||{},ye=J.includeFields||this.Jc,se=W;if(typeof W=="object"&&h.a.R(W)==="form")for(var se=W.action,pe=ye.length-1;0<=pe;pe--)for(var xe=h.a.Lc(W,ye[pe]),we=xe.length-1;0<=we;we--)me[xe[we].name]=xe[we].value;K=h.a.f(K);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=se,Ee.method="post";for(var Be in K)W=n.createElement("input"),W.type="hidden",W.name=Be,W.value=h.a.hc(h.a.f(K[Be])),Ee.appendChild(W);_(me,function(ke,Pe){var ft=n.createElement("input");ft.type="hidden",ft.name=ke,ft.value=Pe,Ee.appendChild(ft)}),n.body.appendChild(Ee),J.submitter?J.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var b=this;if(arguments.length===1)return function(){return b.apply(_,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),b.apply(_,I)}}),h.a.g=new function(){var _=0,b="__ko__"+new Date().getTime(),v={},I,M;return h.a.W?(I=function(F,k){var V=F[b];if(!V||V==="null"||!v[V]){if(!k)return e;V=F[b]="ko"+_++,v[V]={}}return v[V]},M=function(F){var k=F[b];return k?(delete v[k],F[b]=null,!0):!1}):(I=function(F,k){var V=F[b];return!V&&k&&(V=F[b]={}),V},M=function(F){return F[b]?(delete F[b],!0):!1}),{get:function(F,k){var V=I(F,!1);return V&&V[k]},set:function(F,k,V){(F=I(F,V!==e))&&(F[k]=V)},Ub:function(F,k,V){return F=I(F,!0),F[k]||(F[k]=V)},clear:M,Z:function(){return _+++b}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(k,V){var G=h.a.g.get(k,I);return G===e&&V&&(G=[],h.a.g.set(k,I,G)),G}function b(k){var V=_(k,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](k);h.a.g.clear(k),h.a.K.cleanExternalData(k),F[k.nodeType]&&v(k.childNodes,!0)}function v(k,V){for(var G=[],U,q=0;q<k.length;q++)if((!V||k[q].nodeType===8)&&(b(G[G.length]=U=k[q]),k[q]!==U))for(;q--&&h.a.A(G,k[q])==-1;);}var I=h.a.g.Z(),M={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(k,V){if(typeof V!="function")throw Error("Callback must be a function");_(k,!0).push(V)},yb:function(k,V){var G=_(k,!1);G&&(h.a.Pa(G,V),G.length==0&&h.a.g.set(k,I,e))},oa:function(k){return h.u.G(function(){M[k.nodeType]&&(b(k),F[k.nodeType]&&v(k.getElementsByTagName("*")))}),k},removeNode:function(k){h.oa(k),k.parentNode&&k.parentNode.removeChild(k)},cleanExternalData:function(k){r&&typeof r.cleanData=="function"&&r.cleanData([k])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],b=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],M={thead:b,tbody:b,tfoot:b,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},F=8>=h.a.W;h.a.ua=function(k,V){var G;if(r){if(r.parseHTML)G=r.parseHTML(k,V)||[];else if((G=r.clean([k],V))&&G[0]){for(var U=G[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(G=V)||(G=n);var U=G.parentWindow||G.defaultView||t,q=h.a.Db(k).toLowerCase(),Y=G.createElement("div"),Q;for(Q=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[q[1]]||_,q=Q[0],Q="ignored<div>"+Q[1]+k+Q[2]+"</div>",typeof U.innerShiv=="function"?Y.appendChild(U.innerShiv(Q)):(F&&G.body.appendChild(Y),Y.innerHTML=Q,F&&Y.parentNode.removeChild(Y));q--;)Y=Y.lastChild;G=h.a.la(Y.lastChild.childNodes)}return G},h.a.Md=function(k,V){var G=h.a.ua(k,V);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(k,V){if(h.a.Tb(k),V=h.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),r)r(k).html(V);else for(var G=h.a.ua(V,k.ownerDocument),U=0;U<G.length;U++)k.appendChild(G[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(v,I){if(v){if(v.nodeType==8){var M=h.aa.Uc(v.nodeValue);M!=null&&I.push({ud:v,Kd:M})}else if(v.nodeType==1)for(var M=0,F=v.childNodes,k=F.length;M<k;M++)_(F[M],I)}}var b={};return{Xb:function(v){if(typeof v!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return b[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var M=b[v];if(M===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return M.apply(null,I||[]),!0}finally{delete b[v]}},cd:function(v,I){var M=[];_(v,M);for(var F=0,k=M.length;F<k;F++){var V=M[F].ud,G=[V];I&&h.a.Nb(G,I),h.aa.bd(M[F].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(M){for(var V=M,G=0,U;k<M;)if(U=I[k++]){if(k>V){if(5e3<=++G){k=M,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=M}try{U()}catch(q){h.a.Gc(q)}}}}function b(){_(),k=M=I.length=0}var v,I=[],M=0,F=1,k=0;return t.MutationObserver?v=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(b):v=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:v,zb:function(V){return M||h.na.scheduler(b),I[M++]=V,F++},cancel:function(V){V=V-(F-M),V>=k&&V<M&&(I[V]=null)},resetForTesting:function(){var V=M-k;return k=M=I.length=0,V},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,b){_.throttleEvaluation=b;var v=null;return h.$({read:_,write:function(I){clearTimeout(v),v=h.a.setTimeout(function(){_(I)},b)}})},rateLimit:function(_,b){var v,I,M;typeof b=="number"?v=b:(v=b.timeout,I=b.method),_.Hb=!1,M=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(F){return M(F,v,b)})},deferred:function(_,b){if(b!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(v){var I,M=!1;return function(){if(!M){h.na.cancel(I),I=h.na.zb(v);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,b){_.equalityComparer=b=="always"?null:c}};var A={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,b,v){this.da=_,this.lc=b,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,x),x.qb(this)};var x={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,b,v){var I=this;v=v||"change";var M=new h.ic(I,b?_.bind(b):_,function(){h.a.Pa(I.U[v],M),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(M),M},notifySubscribers:function(_,b){if(b=b||"change",b==="change"&&this.Gb(),this.Wa(b)){var v=b==="change"&&this.ed||this.U[b].slice(0);try{h.u.xc();for(var I=0,M;M=v[I];++I)M.Ib||M.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var b=this,v=h.O(b),I,M,F,k,V;b.gb||(b.gb=b.notifySubscribers,b.notifySubscribers=d);var G=_(function(){b.Ja=!1,v&&k===b&&(k=b.nc?b.nc():b());var U=M||V&&b.sb(F,k);V=M=I=!1,U&&b.gb(F=k)});b.qc=function(U,q){q&&b.Ja||(V=!q),b.ed=b.U.change.slice(0),b.Ja=I=!0,k=U,G()},b.pc=function(U){I||(F=U,b.gb(U,"beforeChange"))},b.rc=function(){V=!0},b.gd=function(){b.sb(F,b.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var b=0;return h.a.P(this.U,function(v,I){v!=="dirty"&&(b+=I.length)}),b},sb:function(_,b){return!this.equalityComparer||!this.equalityComparer(_,b)},toString:function(){return"[object Object]"},extend:function(_){var b=this;return _&&h.a.P(_,function(v,I){var M=h.Ta[v];typeof M=="function"&&(b=M(b,I)||b)}),b}};h.L(x,"init",x.qb),h.L(x,"subscribe",x.subscribe),h.L(x,"extend",x.extend),h.L(x,"getSubscriptionsCount",x.Bd),h.a.Ba&&h.a.setPrototypeOf(x,Function.prototype),h.T.fn=x,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(F){v.push(I),I=F}function b(){I=v.pop()}var v=[],I,M=0;return{xc:_,end:b,cc:function(F){if(I){if(!h.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++M))}},G:function(F,k,V){try{return _(),F.apply(k,V||[])}finally{b()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function b(){return 0<arguments.length?(b.sb(b[C],arguments[0])&&(b.ya(),b[C]=arguments[0],b.xa()),this):(h.u.cc(b),b[C])}return b[C]=_,h.a.Ba||h.a.extend(b,h.T.fn),h.T.fn.qb(b),h.a.Ab(b,T),h.options.deferUpdates&&h.Ta.deferred(b,!0),b};var T={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(T,h.T.fn);var E=h.ta.Ma="__ko_proto__";T[E]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[E])&&_!==T[E]&&_!==h.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[E]===T[E]||_[E]===h.o.fn[E]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",T),h.L(T,"peek",T.v),h.L(T,"valueHasMutated",T.xa),h.L(T,"valueWillMutate",T.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var b=this.v(),v=[],I=typeof _!="function"||h.O(_)?function(k){return k===_}:_,M=0;M<b.length;M++){var F=b[M];if(I(F)){if(v.length===0&&this.ya(),b[M]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),b.splice(M,1),M--}}return v.length&&this.xa(),v},removeAll:function(_){if(_===e){var b=this.v(),v=b.slice(0);return this.ya(),b.splice(0,b.length),this.xa(),v}return _?this.remove(function(I){return 0<=h.a.A(_,I)}):[]},destroy:function(_){var b=this.v(),v=typeof _!="function"||h.O(_)?function(F){return F===_}:_;this.ya();for(var I=b.length-1;0<=I;I--){var M=b[I];v(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(b){return 0<=h.a.A(_,b)}):[]},indexOf:function(_){var b=this();return h.a.A(b,_)},replace:function(_,b){var v=this.indexOf(_);0<=v&&(this.ya(),this.v()[v]=b,this.xa())},sorted:function(_){var b=this().slice(0);return _?b.sort(_):b.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var b=this.v();this.ya(),this.zc(b,_,arguments);var v=b[_].apply(b,arguments);return this.xa(),v===b?this:v}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var b=this();return b[_].apply(b,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,b){function v(){function Y(){if(V){var Q=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<V)&&(M=h.a.Pb(G,Q,_.Ob)),W=M),G=Q,M=null,V=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}I?Y():(I=!0,k=_.subscribe(function(){++V},null,"spectate"),G=[].concat(_.v()||[]),M=null,F=_.subscribe(Y))}if(_.Ob={},b&&typeof b=="object"&&h.a.extend(_.Ob,b),_.Ob.sparse=!0,!_.zc){var I=!1,M=null,F,k,V=0,G,U=_.Qa,q=_.hb;_.Qa=function(Y){U&&U.call(_,Y),Y==="arrayChange"&&v()},_.hb=function(Y){q&&q.call(_,Y),Y!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),k&&k.s(),k=F=null,I=!1,G=e)},_.zc=function(Y,Q,W){function K(Ee,Be,ke){return J[J.length]={status:Ee,value:Be,index:ke}}if(I&&!V){var J=[],me=Y.length,ye=W.length,se=0;switch(Q){case"push":se=me;case"unshift":for(Q=0;Q<ye;Q++)K("added",W[Q],se+Q);break;case"pop":se=me-1;case"shift":me&&K("deleted",Y[se],se);break;case"splice":Q=Math.min(Math.max(0,0>W[0]?me+W[0]:W[0]),me);for(var me=ye===1?me:Math.min(Q+(W[1]||0),me),ye=Q+ye-2,se=Math.max(me,ye),pe=[],xe=[],we=2;Q<se;++Q,++we)Q<me&&xe.push(K("deleted",Y[Q],Q)),Q<ye&&pe.push(K("added",W[we],Q));h.a.Kc(xe,pe);break;default:return}M=J}}}};var S=h.a.Da("_state");h.o=h.$=function(_,b,v){function I(){if(0<arguments.length){if(typeof M=="function")M.apply(F.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return F.ra||h.u.cc(I),(F.ka||F.J&&I.Xa())&&I.ha(),F.X}if(typeof _=="object"?v=_:(v=v||{},_&&(v.read=_)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:b||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=F,I.Nc=typeof M=="function",h.a.Ba||h.a.extend(I,h.T.fn),h.T.fn.qb(I),h.a.Ab(I,w),v.pure?(F.wb=!0,F.J=!0,h.a.extend(I,D)):v.deferEvaluation&&h.a.extend(I,R),h.options.deferUpdates&&h.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||I.ha(),F.l&&I.ja()&&h.a.K.za(F.l,F.Rb=function(){I.s()}),I};var w={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(b,v){_[v.Ka]=v.da}),_},Vb:function(_){if(!this[S].V)return!1;var b=this.Va();return h.a.A(b,_)!==-1?!0:!!h.a.Lb(b,function(v){return v.Vb&&v.Vb(_)})},uc:function(_,b,v){if(this[S].wb&&b===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=v,v.Ka=this[S].V++,v.La=b.ob()},Xa:function(){var _,b,v=this[S].I;for(_ in v)if(Object.prototype.hasOwnProperty.call(v,_)&&(b=v[_],this.Ia&&b.da.Ja||b.da.Dd(b.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var b=_.subscribe(this.Jd,this,"dirty"),v=_.subscribe(this.Rd,this);return{da:_,s:function(){b.s(),v.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,b=_.throttleEvaluation;b&&0<=b?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},b)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var b=this[S],v=b.Sa,I=!1;if(!b.rb&&!b.ra){if(b.l&&!h.a.Sb(b.l)||v&&v()){if(!b.jc){this.s();return}}else b.jc=!1;b.rb=!0;try{I=this.zd(_)}finally{b.rb=!1}return I}},zd:function(_){var b=this[S],I=!1,v=b.wb?e:!b.V,I={qd:this,mb:b.I,Qb:b.V};h.u.xc({pd:I,od:g,o:this,Ya:v}),b.I={},b.V=0;var M=this.yd(b,I);return b.V?I=this.sb(b.X,M):(this.s(),I=!0),I&&(b.J?this.Gb():this.notifySubscribers(b.X,"beforeChange"),b.X=M,this.notifySubscribers(b.X,"spectate"),!b.J&&_&&this.notifySubscribers(b.X),this.rc&&this.rc()),v&&this.notifySubscribers(b.X,"awake"),I},yd:function(_,b){try{var v=_.Wc;return _.nb?v.call(_.nb):v()}finally{h.u.end(),b.Qb&&!_.J&&h.a.P(b.mb,p),_.sa=_.ka=!1}},v:function(_){var b=this[S];return(b.ka&&(_||!b.V)||b.J&&this.Xa())&&this.ha(),b.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(b){this.pc(this[S].X),this[S].ka=!0,b&&(this[S].sa=!0),this.qc(this,!b)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(b,v){v.s&&v.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var b=this,v=b[S];if(!v.ra&&v.J&&_=="change"){if(v.J=!1,v.sa||b.Xa())v.I=null,v.V=0,b.ha()&&b.Gb();else{var I=[];h.a.P(v.I,function(M,F){I[F.Ka]=M}),h.a.D(I,function(M,F){var k=v.I[M],V=b.$c(k.da);V.Ka=F,V.La=k.La,v.I[M]=V}),b.Xa()&&b.ha()&&b.Gb()}v.ra||b.notifySubscribers(v.X,"awake")}},hb:function(_){var b=this[S];b.ra||_!="change"||this.Wa("change")||(h.a.P(b.I,function(v,I){I.s&&(b.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),b.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},R={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(w,h.T.fn);var O=h.ta.Ma;w[O]=h.o,h.Oc=function(_){return typeof _=="function"&&_[O]===w[O]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",w),h.L(w,"peek",w.v),h.L(w,"dispose",w.s),h.L(w,"isActive",w.ja),h.L(w,"getDependenciesCount",w.qa),h.L(w,"getDependencies",w.Va),h.xb=function(_,b){return typeof _=="function"?h.o(_,b,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,b))},h.b("pureComputed",h.xb),function(){function _(I,M,F){if(F=F||new v,I=M(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var k=I instanceof Array?[]:{};return F.save(I,k),b(I,function(V){var G=M(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":k[V]=G;break;case"object":case"undefined":var U=F.get(G);k[V]=U!==e?U:_(G,M,F)}}),k}function b(I,M){if(I instanceof Array){for(var F=0;F<I.length;F++)M(F);typeof I.toJSON=="function"&&M("toJSON")}else for(F in I)M(F)}function v(){this.keys=[],this.values=[]}h.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(M){for(var F=0;h.O(M)&&10>F;F++)M=M();return M})},h.toJSON=function(I,M,F){return I=h.ad(I),h.a.hc(I,M,F)},v.prototype={constructor:v,save:function(I,M){var F=h.a.A(this.keys,I);0<=F?this.values[F]=M:(this.keys.push(I),this.values.push(M))},get:function(I){return I=h.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,b,v){function I(M){var F=h.xb(_,v).extend({ma:"always"}),k=F.subscribe(function(V){V&&(k.s(),M(V))});return F.notifySubscribers(F.v()),k}return typeof Promise!="function"||b?I(b.bind(v)):new Promise(I)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,b,v){switch(h.a.R(_)){case"option":typeof b=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=b):(h.a.g.set(_,h.c.options.$b,b),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof b=="number"?b:"");break;case"select":(b===""||b===null)&&(b=e);for(var I=-1,M=0,F=_.options.length,k;M<F;++M)if(k=h.w.M(_.options[M]),k==b||k===""&&b===e){I=M;break}(v||0<=I||b===e&&1<_.size)&&(_.selectedIndex=I,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(b===null||b===e)&&(b=""),_.value=b}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(V){V=h.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var G=[],U=V.match(I),q,Y=[],Q=0;if(1<U.length){for(var W=0,K;K=U[W];++W){var J=K.charCodeAt(0);if(J===44){if(0>=Q){G.push(q&&Y.length?{key:q,value:Y.join("")}:{unknown:q||Y.join("")}),q=Q=0,Y=[];continue}}else if(J===58){if(!Q&&!q&&Y.length===1){q=Y.pop();continue}}else{if(J===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;J===47&&W&&1<K.length?(J=U[W-1].match(M))&&!F[J[0]]&&(V=V.substr(V.indexOf(K)+1),U=V.match(I),W=-1,K="/"):J===40||J===123||J===91?++Q:J===41||J===125||J===93?--Q:q||Y.length||J!==34&&J!==39||(K=K.slice(1,-1))}Y.push(K)}if(0<Q)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var b=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},k={};return{Ra:[],wa:k,ac:_,vb:function(V,G){function U(J,me){var ye;if(!W){var se=h.getBindingHandler(J);if(se&&se.preprocess&&!(me=se.preprocess(me,J,U)))return;(se=k[J])&&(ye=me,0<=h.a.A(b,ye)?ye=!1:(se=ye.match(v),ye=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ye),se=ye),se&&Y.push("'"+(typeof k[J]=="string"?k[J]:J)+"':function(_z){"+ye+"=_z}")}Q&&(me="function(){return "+me+" }"),q.push("'"+J+"':"+me)}G=G||{};var q=[],Y=[],Q=G.valueAccessors,W=G.bindingParams,K=typeof V=="string"?_(V):V;return h.a.D(K,function(J){U(J.key||J.unknown,J.value)}),Y.length&&U("_ko_property_writers","{"+Y.join(",")+" }"),q.join(",")},Id:function(V,G){for(var U=0;U<V.length;U++)if(V[U].key==G)return!0;return!1},eb:function(V,G,U,q,Y){V&&h.O(V)?!h.Za(V)||Y&&V.v()===q||V(q):(V=G.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(U){return U.nodeType==8&&F.test(M?U.text:U.nodeValue)}function b(U){return U.nodeType==8&&k.test(M?U.text:U.nodeValue)}function v(U,q){for(var Y=U,Q=1,W=[];Y=Y.nextSibling;){if(b(Y)&&(h.a.g.set(Y,G,!0),Q--,Q===0))return W;W.push(Y),_(Y)&&Q++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var Y=v(U,q);return Y?0<Y.length?Y[Y.length-1].nextSibling:U.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",F=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return _(U)?v(U):U.childNodes},Ea:function(U){if(_(U)){U=h.h.childNodes(U);for(var q=0,Y=U.length;q<Y;q++)h.removeNode(U[q])}else h.a.Tb(U)},va:function(U,q){if(_(U)){h.h.Ea(U);for(var Y=U.nextSibling,Q=0,W=q.length;Q<W;Q++)Y.parentNode.insertBefore(q[Q],Y)}else h.a.va(U,q)},Vc:function(U,q){var Y;_(U)?(Y=U.nextSibling,U=U.parentNode):Y=U.firstChild,Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)},Wb:function(U,q,Y){Y?(Y=Y.nextSibling,_(U)&&(U=U.parentNode),Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)):h.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||b(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&b(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&b(U.nextSibling)){var q=U.nextSibling;if(b(q)&&!h.a.g.get(q,G))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(M?U.text:U.nodeValue).match(F))?U[1]:null},Sc:function(U){if(V[h.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var Y;Y=q.firstChild;var Q=null;if(Y)do if(Q)Q.push(Y);else if(_(Y)){var W=I(Y,!0);W?Y=W:Q=[Y]}else b(Y)&&(Q=[Y]);while(Y=Y.nextSibling);if(Y=Q)for(Q=q.nextSibling,W=0;W<Y.length;W++)Q?U.insertBefore(Y[W],Q):U.appendChild(Y[W])}while(q=q.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_):null;return h.j.tc(v,_,b,!1)},getBindingAccessors:function(_,b){var v=this.getBindingsString(_,b),v=v?this.parseBindingsString(v,b,_,{valueAccessors:!0}):null;return h.j.tc(v,_,b,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,b,v,I){try{var M=this.nd,F=_+(I&&I.valueAccessors||""),k;if(!(k=M[F])){var V,G="with($context){with($data||{}){return{"+h.m.vb(_,I)+"}}}";V=new Function("$context","$element",G),k=M[F]=V}return k(b,v)}catch(U){throw U.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,E){return _===null||typeof _ in x?_===E:!1}function u(_,E){var w;return function(){w||(w=h.a.setTimeout(function(){w=e,_()},E))}}function f(_,E){var w;return function(){clearTimeout(w),w=h.a.setTimeout(_,E)}}function d(_,E){E&&E!=="change"?E==="beforeChange"?this.pc(_):this.gb(_,E):this.qc(_)}function p(_,E){E!==null&&E.s&&E.s()}function g(_,E){var w=this.qd,D=w[S];D.ra||(this.Qb&&this.mb[E]?(w.uc(E,_,this.mb[E]),this.mb[E]=null,--this.Qb):D.I[E]||w.uc(E,_,D.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var h=typeof s<"u"?s:{};h.b=function(_,E){for(var w=_.split("."),D=h,M=0;M<w.length-1;M++)D=D[w[M]];D[w[w.length-1]]=E},h.L=function(_,E,w){_[E]=w},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function _(W,K){for(var J in W)M.call(W,J)&&K(J,W[J])}function E(W,K){if(K)for(var J in K)M.call(K,J)&&(W[J]=K[J]);return W}function w(W,K){return W.__proto__=K,W}function D(W,K,J,he){var ge=W[K].match(j)||[];h.a.D(J.match(j),function(se){h.a.Na(ge,se,he)}),W[K]=ge.join(" ")}var M=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,V=typeof Symbol=="function",U={},G={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(U,function(W,K){if(K.length)for(var J=0,he=K.length;J<he;J++)G[K[J]]=W});var k={propertychange:!0},Y=n&&function(){for(var W=3,K=n.createElement("div"),J=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",J[0];);return 4<W?W:e}(),j=/\S+/g,$;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,J){for(var he=0,ge=W.length;he<ge;he++)K.call(J,W[he],he,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var J=0,he=W.length;J<he;J++)if(W[J]===K)return J;return-1},Lb:function(W,K,J){for(var he=0,ge=W.length;he<ge;he++)if(K.call(J,W[he],he,W))return W[he];return e},Pa:function(W,K){var J=h.a.A(W,K);0<J?W.splice(J,1):J===0&&W.shift()},wc:function(W){var K=[];return W&&h.a.D(W,function(J){0>h.a.A(K,J)&&K.push(J)}),K},Mb:function(W,K,J){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)he.push(K.call(J,W[ge],ge));return he},jb:function(W,K,J){var he=[];if(W)for(var ge=0,se=W.length;ge<se;ge++)K.call(J,W[ge],ge)&&he.push(W[ge]);return he},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var J=0,he=K.length;J<he;J++)W.push(K[J]);return W},Na:function(W,K,J){var he=h.a.A(h.a.bc(W),K);0>he?J&&W.push(K):J||W.splice(he,1)},Ba:B,extend:E,setPrototypeOf:w,Ab:B?w:E,P:_,Ga:function(W,K,J){if(!W)return W;var he={},ge;for(ge in W)M.call(W,ge)&&(he[ge]=K.call(J,W[ge],ge,W));return he},Tb:function(W){for(;W.firstChild;)h.removeNode(W.firstChild)},Yb:function(W){W=h.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),J=0,he=W.length;J<he;J++)K.appendChild(h.oa(W[J]));return K},Ca:function(W,K){for(var J=0,he=W.length,ge=[];J<he;J++){var se=W[J].cloneNode(!0);ge.push(K?h.oa(se):se)}return ge},va:function(W,K){if(h.a.Tb(W),K)for(var J=0,he=K.length;J<he;J++)W.appendChild(K[J])},Xc:function(W,K){var J=W.nodeType?[W]:W;if(0<J.length){for(var he=J[0],ge=he.parentNode,se=0,pe=K.length;se<pe;se++)ge.insertBefore(K[se],he);for(se=0,pe=J.length;se<pe;se++)h.removeNode(J[se])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var J=W[0],he=W[W.length-1];for(W.length=0;J!==he;)W.push(J),J=J.nextSibling;W.push(he)}}return W},Zc:function(W,K){7>Y?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return h.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!h.a.Lb(W,h.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return h.onError?function(){try{return W.apply(this,arguments)}catch(K){throw h.onError&&h.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(h.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw h.onError&&h.onError(W),W},0)},B:function(W,K,J){var he=h.a.Ac(J);if(J=k[K],h.options.useOnlyNativeEvents||J||!o)if(J||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ge=function(pe){he.call(W,pe)},se="on"+K;W.attachEvent(se,ge),h.a.K.za(W,function(){W.detachEvent(se,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,he,!1);else $||($=typeof o(W).on=="function"?"on":"bind"),o(W)[$](K,he)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var J;if(h.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(J=W.type,J=J=="checkbox"||J=="radio"):J=!1,h.options.useOnlyNativeEvents||!o||J)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")J=n.createEvent(G[K]||"HTMLEvents"),J.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(J);else throw Error("The supplied element doesn't support dispatchEvent");else if(J&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(W).trigger(K)},f:function(W){return h.O(W)?W():W},bc:function(W){return h.O(W)?W.v():W},Eb:function(W,K,J){var he;K&&(typeof W.classList=="object"?(he=W.classList[J?"add":"remove"],h.a.D(K.match(j),function(ge){he.call(W.classList,ge)})):typeof W.className.baseVal=="string"?D(W.className,"baseVal",K,J):D(W,"className",K,J))},Bb:function(W,K){var J=h.a.f(K);(J===null||J===e)&&(J="");var he=h.h.firstChild(W);!he||he.nodeType!=3||h.h.nextSibling(he)?h.h.va(W,[W.ownerDocument.createTextNode(J)]):he.data=J,h.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=Y)try{var J=W.name.replace(/[&<>'"]/g,function(he){return"&#"+he.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+J+"'/>"),!1)}catch{}},Ad:function(W){9<=Y&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(Y){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=h.a.f(W),K=h.a.f(K);for(var J=[],he=W;he<=K;he++)J.push(he);return J},la:function(W){for(var K=[],J=0,he=W.length;J<he;J++)K.push(W[J]);return K},Da:function(W){return V?Symbol(W):W},Zd:Y===6,$d:Y===7,W:Y,Lc:function(W,K){for(var J=h.a.la(W.getElementsByTagName("input")).concat(h.a.la(W.getElementsByTagName("textarea"))),he=typeof K=="string"?function(pe){return pe.name===K}:function(pe){return K.test(pe.name)},ge=[],se=J.length-1;0<=se;se--)he(J[se])&&ge.push(J[se]);return ge},Nd:function(W){return typeof W=="string"&&(W=h.a.Db(W))?r&&r.parse?r.parse(W):new Function("return "+W)():null},hc:function(W,K,J){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(h.a.f(W),K,J)},Od:function(W,K,J){J=J||{};var he=J.params||{},ge=J.includeFields||this.Jc,se=W;if(typeof W=="object"&&h.a.R(W)==="form")for(var se=W.action,pe=ge.length-1;0<=pe;pe--)for(var xe=h.a.Lc(W,ge[pe]),De=xe.length-1;0<=De;De--)he[xe[De].name]=xe[De].value;K=h.a.f(K);var Se=n.createElement("form");Se.style.display="none",Se.action=se,Se.method="post";for(var we in K)W=n.createElement("input"),W.type="hidden",W.name=we,W.value=h.a.hc(h.a.f(K[we])),Se.appendChild(W);_(he,function(ze,Oe){var ft=n.createElement("input");ft.type="hidden",ft.name=ze,ft.value=Oe,Se.appendChild(ft)}),n.body.appendChild(Se),J.submitter?J.submitter(Se):Se.submit(),setTimeout(function(){Se.parentNode.removeChild(Se)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var E=this;if(arguments.length===1)return function(){return E.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var D=w.slice(0);return D.push.apply(D,arguments),E.apply(_,D)}}),h.a.g=new function(){var _=0,E="__ko__"+new Date().getTime(),w={},D,M;return h.a.W?(D=function(B,V){var U=B[E];if(!U||U==="null"||!w[U]){if(!V)return e;U=B[E]="ko"+_++,w[U]={}}return w[U]},M=function(B){var V=B[E];return V?(delete w[V],B[E]=null,!0):!1}):(D=function(B,V){var U=B[E];return!U&&V&&(U=B[E]={}),U},M=function(B){return B[E]?(delete B[E],!0):!1}),{get:function(B,V){var U=D(B,!1);return U&&U[V]},set:function(B,V,U){(B=D(B,U!==e))&&(B[V]=U)},Ub:function(B,V,U){return B=D(B,!0),B[V]||(B[V]=U)},clear:M,Z:function(){return _+++E}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function _(V,U){var G=h.a.g.get(V,D);return G===e&&U&&(G=[],h.a.g.set(V,D,G)),G}function E(V){var U=_(V,!1);if(U)for(var U=U.slice(0),G=0;G<U.length;G++)U[G](V);h.a.g.clear(V),h.a.K.cleanExternalData(V),B[V.nodeType]&&w(V.childNodes,!0)}function w(V,U){for(var G=[],k,Y=0;Y<V.length;Y++)if((!U||V[Y].nodeType===8)&&(E(G[G.length]=k=V[Y]),V[Y]!==k))for(;Y--&&h.a.A(G,V[Y])==-1;);}var D=h.a.g.Z(),M={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(V,U){if(typeof U!="function")throw Error("Callback must be a function");_(V,!0).push(U)},yb:function(V,U){var G=_(V,!1);G&&(h.a.Pa(G,U),G.length==0&&h.a.g.set(V,D,e))},oa:function(V){return h.u.G(function(){M[V.nodeType]&&(E(V),B[V.nodeType]&&w(V.getElementsByTagName("*")))}),V},removeNode:function(V){h.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){o&&typeof o.cleanData=="function"&&o.cleanData([V])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var _=[0,"",""],E=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],D=[1,"<select multiple='multiple'>","</select>"],M={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:D,optgroup:D},B=8>=h.a.W;h.a.ua=function(V,U){var G;if(o){if(o.parseHTML)G=o.parseHTML(V,U)||[];else if((G=o.clean([V],U))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=U)||(G=n);var k=G.parentWindow||G.defaultView||t,Y=h.a.Db(V).toLowerCase(),j=G.createElement("div"),$;for($=(Y=Y.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[Y[1]]||_,Y=$[0],$="ignored<div>"+$[1]+V+$[2]+"</div>",typeof k.innerShiv=="function"?j.appendChild(k.innerShiv($)):(B&&G.body.appendChild(j),j.innerHTML=$,B&&j.parentNode.removeChild(j));Y--;)j=j.lastChild;G=h.a.la(j.lastChild.childNodes)}return G},h.a.Md=function(V,U){var G=h.a.ua(V,U);return G.length&&G[0].parentElement||h.a.Yb(G)},h.a.fc=function(V,U){if(h.a.Tb(V),U=h.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(V).html(U);else for(var G=h.a.ua(U,V.ownerDocument),k=0;k<G.length;k++)V.appendChild(G[k])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function _(w,D){if(w){if(w.nodeType==8){var M=h.aa.Uc(w.nodeValue);M!=null&&D.push({ud:w,Kd:M})}else if(w.nodeType==1)for(var M=0,B=w.childNodes,V=B.length;M<V;M++)_(B[M],D)}}var E={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var D=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[D]=w,"<!--[ko_memo:"+D+"]-->"},bd:function(w,D){var M=E[w];if(M===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return M.apply(null,D||[]),!0}finally{delete E[w]}},cd:function(w,D){var M=[];_(w,M);for(var B=0,V=M.length;B<V;B++){var U=M[B].ud,G=[U];D&&h.a.Nb(G,D),h.aa.bd(M[B].Kd,G),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function _(){if(M){for(var U=M,G=0,k;V<M;)if(k=D[V++]){if(V>U){if(5e3<=++G){V=M,h.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}U=M}try{k()}catch(Y){h.a.Gc(Y)}}}}function E(){_(),V=M=D.length=0}var w,D=[],M=0,B=1,V=0;return t.MutationObserver?w=function(U){var G=n.createElement("div");return new MutationObserver(U).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(E):w=n&&"onreadystatechange"in n.createElement("script")?function(U){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,U()},n.documentElement.appendChild(G)}:function(U){setTimeout(U,0)},{scheduler:w,zb:function(U){return M||h.na.scheduler(E),D[M++]=U,B++},cancel:function(U){U=U-(B-M),U>=V&&U<M&&(D[U]=null)},resetForTesting:function(){var U=M-V;return V=M=D.length=0,U},Sd:_}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(_,E){_.throttleEvaluation=E;var w=null;return h.$({read:_,write:function(D){clearTimeout(w),w=h.a.setTimeout(function(){_(D)},E)}})},rateLimit:function(_,E){var w,D,M;typeof E=="number"?w=E:(w=E.timeout,D=E.method),_.Hb=!1,M=typeof D=="function"?D:D=="notifyWhenChangesStop"?f:u,_.ub(function(B){return M(B,w,E)})},deferred:function(_,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var D,M=!1;return function(){if(!M){h.na.cancel(D),D=h.na.zb(w);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,E){_.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(_,E,w){this.da=_,this.lc=E,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(_){this.Jb=_,h.a.K.za(_,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,E,w){var D=this;w=w||"change";var M=new h.ic(D,E?_.bind(E):_,function(){h.a.Pa(D.U[w],M),D.hb&&D.hb(w)});return D.Qa&&D.Qa(w),D.U[w]||(D.U[w]=[]),D.U[w].push(M),M},notifySubscribers:function(_,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var w=E==="change"&&this.ed||this.U[E].slice(0);try{h.u.xc();for(var D=0,M;M=w[D];++D)M.Ib||M.lc(_)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var E=this,w=h.O(E),D,M,B,V,U;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var G=_(function(){E.Ja=!1,w&&V===E&&(V=E.nc?E.nc():E());var k=M||U&&E.sb(B,V);U=M=D=!1,k&&E.gb(B=V)});E.qc=function(k,Y){Y&&E.Ja||(U=!Y),E.ed=E.U.change.slice(0),E.Ja=D=!0,V=k,G()},E.pc=function(k){D||(B=k,E.gb(k,"beforeChange"))},E.rc=function(){U=!0},E.gd=function(){E.sb(B,E.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var E=0;return h.a.P(this.U,function(w,D){w!=="dirty"&&(E+=D.length)}),E},sb:function(_,E){return!this.equalityComparer||!this.equalityComparer(_,E)},toString:function(){return"[object Object]"},extend:function(_){var E=this;return _&&h.a.P(_,function(w,D){var M=h.Ta[w];typeof M=="function"&&(E=M(E,D)||E)}),E}};h.L(b,"init",b.qb),h.L(b,"subscribe",b.subscribe),h.L(b,"extend",b.extend),h.L(b,"getSubscriptionsCount",b.Bd),h.a.Ba&&h.a.setPrototypeOf(b,Function.prototype),h.T.fn=b,h.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function _(B){w.push(D),D=B}function E(){D=w.pop()}var w=[],D,M=0;return{xc:_,end:E,cc:function(B){if(D){if(!h.Qc(B))throw Error("Only subscribable things can act as dependencies");D.od.call(D.pd,B,B.fd||(B.fd=++M))}},G:function(B,V,U){try{return _(),B.apply(V,U||[])}finally{E()}},qa:function(){if(D)return D.o.qa()},Va:function(){if(D)return D.o.Va()},Ya:function(){if(D)return D.Ya},o:function(){if(D)return D.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(_){function E(){return 0<arguments.length?(E.sb(E[C],arguments[0])&&(E.ya(),E[C]=arguments[0],E.xa()),this):(h.u.cc(E),E[C])}return E[C]=_,h.a.Ba||h.a.extend(E,h.T.fn),h.T.fn.qb(E),h.a.Ab(E,T),h.options.deferUpdates&&h.Ta.deferred(E,!0),E};var T={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(T,h.T.fn);var A=h.ta.Ma="__ko_proto__";T[A]=h.ta,h.O=function(_){if((_=typeof _=="function"&&_[A])&&_!==T[A]&&_!==h.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},h.Za=function(_){return typeof _=="function"&&(_[A]===T[A]||_[A]===h.o.fn[A]&&_.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",T),h.L(T,"peek",T.v),h.L(T,"valueHasMutated",T.xa),h.L(T,"valueWillMutate",T.ya),h.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=h.ta(_),h.a.Ab(_,h.Ha.fn),_.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(_){for(var E=this.v(),w=[],D=typeof _!="function"||h.O(_)?function(V){return V===_}:_,M=0;M<E.length;M++){var B=E[M];if(D(B)){if(w.length===0&&this.ya(),E[M]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),E.splice(M,1),M--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var E=this.v(),w=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),w}return _?this.remove(function(D){return 0<=h.a.A(_,D)}):[]},destroy:function(_){var E=this.v(),w=typeof _!="function"||h.O(_)?function(B){return B===_}:_;this.ya();for(var D=E.length-1;0<=D;D--){var M=E[D];w(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(E){return 0<=h.a.A(_,E)}):[]},indexOf:function(_){var E=this();return h.a.A(E,_)},replace:function(_,E){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=E,this.xa())},sorted:function(_){var E=this().slice(0);return _?E.sort(_):E.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){h.Ha.fn[_]=function(){var E=this.v();this.ya(),this.zc(E,_,arguments);var w=E[_].apply(E,arguments);return this.xa(),w===E?this:w}}),h.a.D(["slice"],function(_){h.Ha.fn[_]=function(){var E=this();return E[_].apply(E,arguments)}}),h.Pc=function(_){return h.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(_,E){function w(){function j(){if(U){var $=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<U)&&(M=h.a.Pb(G,$,_.Ob)),W=M),G=$,M=null,U=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}D?j():(D=!0,V=_.subscribe(function(){++U},null,"spectate"),G=[].concat(_.v()||[]),M=null,B=_.subscribe(j))}if(_.Ob={},E&&typeof E=="object"&&h.a.extend(_.Ob,E),_.Ob.sparse=!0,!_.zc){var D=!1,M=null,B,V,U=0,G,k=_.Qa,Y=_.hb;_.Qa=function(j){k&&k.call(_,j),j==="arrayChange"&&w()},_.hb=function(j){Y&&Y.call(_,j),j!=="arrayChange"||_.Wa("arrayChange")||(B&&B.s(),V&&V.s(),V=B=null,D=!1,G=e)},_.zc=function(j,$,W){function K(Se,we,ze){return J[J.length]={status:Se,value:we,index:ze}}if(D&&!U){var J=[],he=j.length,ge=W.length,se=0;switch($){case"push":se=he;case"unshift":for($=0;$<ge;$++)K("added",W[$],se+$);break;case"pop":se=he-1;case"shift":he&&K("deleted",j[se],se);break;case"splice":$=Math.min(Math.max(0,0>W[0]?he+W[0]:W[0]),he);for(var he=ge===1?he:Math.min($+(W[1]||0),he),ge=$+ge-2,se=Math.max(he,ge),pe=[],xe=[],De=2;$<se;++$,++De)$<he&&xe.push(K("deleted",j[$],$)),$<ge&&pe.push(K("added",W[De],$));h.a.Kc(xe,pe);break;default:return}M=J}}}};var S=h.a.Da("_state");h.o=h.$=function(_,E,w){function D(){if(0<arguments.length){if(typeof M=="function")M.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||h.u.cc(D),(B.ka||B.J&&D.Xa())&&D.ha(),B.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:E||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return D[S]=B,D.Nc=typeof M=="function",h.a.Ba||h.a.extend(D,h.T.fn),h.T.fn.qb(D),h.a.Ab(D,v),w.pure?(B.wb=!0,B.J=!0,h.a.extend(D,I)):w.deferEvaluation&&h.a.extend(D,O),h.options.deferUpdates&&h.Ta.deferred(D,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||D.ha(),B.l&&D.ja()&&h.a.K.za(B.l,B.Rb=function(){D.s()}),D};var v={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return h.a.P(this[S].I,function(E,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[S].V)return!1;var E=this.Va();return h.a.A(E,_)!==-1?!0:!!h.a.Lb(E,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,E,w){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=w,w.Ka=this[S].V++,w.La=E.ob()},Xa:function(){var _,E,w=this[S].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(E=w[_],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var E=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){E.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,E=_.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=h.a.setTimeout(function(){_.ha(!0)},E)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var E=this[S],w=E.Sa,D=!1;if(!E.rb&&!E.ra){if(E.l&&!h.a.Sb(E.l)||w&&w()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{D=this.zd(_)}finally{E.rb=!1}return D}},zd:function(_){var E=this[S],D=!1,w=E.wb?e:!E.V,D={qd:this,mb:E.I,Qb:E.V};h.u.xc({pd:D,od:g,o:this,Ya:w}),E.I={},E.V=0;var M=this.yd(E,D);return E.V?D=this.sb(E.X,M):(this.s(),D=!0),D&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=M,this.notifySubscribers(E.X,"spectate"),!E.J&&_&&this.notifySubscribers(E.X),this.rc&&this.rc()),w&&this.notifySubscribers(E.X,"awake"),D},yd:function(_,E){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{h.u.end(),E.Qb&&!_.J&&h.a.P(E.mb,p),_.sa=_.ka=!1}},v:function(_){var E=this[S];return(E.ka&&(_||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(_){h.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var _=this[S];!_.J&&_.I&&h.a.P(_.I,function(E,w){w.s&&w.s()}),_.l&&_.Rb&&h.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},I={Qa:function(_){var E=this,w=E[S];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||E.Xa())w.I=null,w.V=0,E.ha()&&E.Gb();else{var D=[];h.a.P(w.I,function(M,B){D[B.Ka]=M}),h.a.D(D,function(M,B){var V=w.I[M],U=E.$c(V.da);U.Ka=B,U.La=V.La,w.I[M]=U}),E.Xa()&&E.ha()&&E.Gb()}w.ra||E.notifySubscribers(w.X,"awake")}},hb:function(_){var E=this[S];E.ra||_!="change"||this.Wa("change")||(h.a.P(E.I,function(w,D){D.s&&(E.I[w]={da:D.da,Ka:D.Ka,La:D.La},D.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},O={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(v,h.T.fn);var R=h.ta.Ma;v[R]=h.o,h.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},h.Fd=function(_){return h.Oc(_)&&_[S]&&_[S].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",v),h.L(v,"peek",v.v),h.L(v,"dispose",v.s),h.L(v,"isActive",v.ja),h.L(v,"getDependenciesCount",v.qa),h.L(v,"getDependencies",v.Va),h.xb=function(_,E){return typeof _=="function"?h.o(_,E,{pure:!0}):(_=h.a.extend({},_),_.pure=!0,h.o(_,E))},h.b("pureComputed",h.xb),function(){function _(D,M,B){if(B=B||new w,D=M(D),typeof D!="object"||D===null||D===e||D instanceof RegExp||D instanceof Date||D instanceof String||D instanceof Number||D instanceof Boolean)return D;var V=D instanceof Array?[]:{};return B.save(D,V),E(D,function(U){var G=M(D[U]);switch(typeof G){case"boolean":case"number":case"string":case"function":V[U]=G;break;case"object":case"undefined":var k=B.get(G);V[U]=k!==e?k:_(G,M,B)}}),V}function E(D,M){if(D instanceof Array){for(var B=0;B<D.length;B++)M(B);typeof D.toJSON=="function"&&M("toJSON")}else for(B in D)M(B)}function w(){this.keys=[],this.values=[]}h.ad=function(D){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(D,function(M){for(var B=0;h.O(M)&&10>B;B++)M=M();return M})},h.toJSON=function(D,M,B){return D=h.ad(D),h.a.hc(D,M,B)},w.prototype={constructor:w,save:function(D,M){var B=h.a.A(this.keys,D);0<=B?this.values[B]=M:(this.keys.push(D),this.values.push(M))},get:function(D){return D=h.a.A(this.keys,D),0<=D?this.values[D]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(_,E,w){function D(M){var B=h.xb(_,w).extend({ma:"always"}),V=B.subscribe(function(U){U&&(V.s(),M(U))});return B.notifySubscribers(B.v()),V}return typeof Promise!="function"||E?D(E.bind(w)):new Promise(D)},h.b("when",h.Wd),function(){h.w={M:function(_){switch(h.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?h.a.g.get(_,h.c.options.$b):7>=h.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,E,w){switch(h.a.R(_)){case"option":typeof E=="string"?(h.a.g.set(_,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=E):(h.a.g.set(_,h.c.options.$b,E),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var D=-1,M=0,B=_.options.length,V;M<B;++M)if(V=h.w.M(_.options[M]),V==E||V===""&&E===e){D=M;break}(w||0<=D||E===e&&1<_.size)&&(_.selectedIndex=D,h.a.W===6&&h.a.setTimeout(function(){_.selectedIndex=D},0));break;default:(E===null||E===e)&&(E=""),_.value=E}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function _(U){U=h.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=` +,`;var G=[],k=U.match(D),Y,j=[],$=0;if(1<k.length){for(var W=0,K;K=k[W];++W){var J=K.charCodeAt(0);if(J===44){if(0>=$){G.push(Y&&j.length?{key:Y,value:j.join("")}:{unknown:Y||j.join("")}),Y=$=0,j=[];continue}}else if(J===58){if(!$&&!Y&&j.length===1){Y=j.pop();continue}}else{if(J===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;J===47&&W&&1<K.length?(J=k[W-1].match(M))&&!B[J[0]]&&(U=U.substr(U.indexOf(K)+1),k=U.match(D),W=-1,K="/"):J===40||J===123||J===91?++$:J===41||J===125||J===93?--$:Y||j.length||J!==34&&J!==39||(K=K.slice(1,-1))}j.push(K)}if(0<$)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var E=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,D=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(U,G){function k(J,he){var ge;if(!W){var se=h.getBindingHandler(J);if(se&&se.preprocess&&!(he=se.preprocess(he,J,k)))return;(se=V[J])&&(ge=he,0<=h.a.A(E,ge)?ge=!1:(se=ge.match(w),ge=se===null?!1:se[1]?"Object("+se[1]+")"+se[2]:ge),se=ge),se&&j.push("'"+(typeof V[J]=="string"?V[J]:J)+"':function(_z){"+ge+"=_z}")}$&&(he="function(){return "+he+" }"),Y.push("'"+J+"':"+he)}G=G||{};var Y=[],j=[],$=G.valueAccessors,W=G.bindingParams,K=typeof U=="string"?_(U):U;return h.a.D(K,function(J){k(J.key||J.unknown,J.value)}),j.length&&k("_ko_property_writers","{"+j.join(",")+" }"),Y.join(",")},Id:function(U,G){for(var k=0;k<U.length;k++)if(U[k].key==G)return!0;return!1},eb:function(U,G,k,Y,j){U&&h.O(U)?!h.Za(U)||j&&U.v()===Y||U(Y):(U=G.get("_ko_property_writers"))&&U[k]&&U[k](Y)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function _(k){return k.nodeType==8&&B.test(M?k.text:k.nodeValue)}function E(k){return k.nodeType==8&&V.test(M?k.text:k.nodeValue)}function w(k,Y){for(var j=k,$=1,W=[];j=j.nextSibling;){if(E(j)&&(h.a.g.set(j,G,!0),$--,$===0))return W;W.push(j),_(j)&&$++}if(!Y)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function D(k,Y){var j=w(k,Y);return j?0<j.length?j[j.length-1].nextSibling:k.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",B=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},G="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=h.h.childNodes(k);for(var Y=0,j=k.length;Y<j;Y++)h.removeNode(k[Y])}else h.a.Tb(k)},va:function(k,Y){if(_(k)){h.h.Ea(k);for(var j=k.nextSibling,$=0,W=Y.length;$<W;$++)j.parentNode.insertBefore(Y[$],j)}else h.a.va(k,Y)},Vc:function(k,Y){var j;_(k)?(j=k.nextSibling,k=k.parentNode):j=k.firstChild,j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)},Wb:function(k,Y,j){j?(j=j.nextSibling,_(k)&&(k=k.parentNode),j?Y!==j&&k.insertBefore(Y,j):k.appendChild(Y)):h.h.Vc(k,Y)},firstChild:function(k){if(_(k))return!k.nextSibling||E(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&E(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=D(k)),k.nextSibling&&E(k.nextSibling)){var Y=k.nextSibling;if(E(Y)&&!h.a.g.get(Y,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(M?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(U[h.a.R(k)]){var Y=k.firstChild;if(Y)do if(Y.nodeType===1){var j;j=Y.firstChild;var $=null;if(j)do if($)$.push(j);else if(_(j)){var W=D(j,!0);W?j=W:$=[j]}else E(j)&&($=[j]);while(j=j.nextSibling);if(j=$)for($=Y.nextSibling,W=0;W<j.length;W++)$?k.insertBefore(j[W],$):k.appendChild(j[W])}while(Y=Y.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(_);case 8:return h.h.Cd(_);default:return!1}},getBindings:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_):null;return h.j.tc(w,_,E,!1)},getBindingAccessors:function(_,E){var w=this.getBindingsString(_,E),w=w?this.parseBindingsString(w,E,_,{valueAccessors:!0}):null;return h.j.tc(w,_,E,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return h.h.Vd(_);default:return null}},parseBindingsString:function(_,E,w,D){try{var M=this.nd,B=_+(D&&D.valueAccessors||""),V;if(!(V=M[B])){var U,G="with($context){with($data||{}){return{"+h.m.vb(_,D)+"}}}";U=new Function("$context","$element",G),V=M[B]=U}return V(E,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var pe=(se=h.a.g.get(se,ye))&&se.N;pe&&(se.N=null,pe.Tc())}function b(se,pe,xe){this.node=se,this.yc=pe,this.kb=[],this.H=!1,pe.N||h.a.K.za(se,_),xe&&xe.N&&(xe.N.kb.push(se),this.Kb=xe)}function v(se){return function(){return se}}function I(se){return se()}function M(se){return h.a.Ga(h.u.G(se),function(pe,xe){return function(){return se()[xe]}})}function F(se,pe,xe){return typeof se=="function"?M(se.bind(null,pe,xe)):h.a.Ga(se,v)}function k(se,pe){return M(this.getBindings.bind(this,se,pe))}function V(se,pe){var xe=h.h.firstChild(pe);if(xe){var we,Ee=h.ga.instance,Be=Ee.preprocessNode;if(Be){for(;we=xe;)xe=h.h.nextSibling(we),Be.call(Ee,we);xe=h.h.firstChild(pe)}for(;we=xe;)xe=h.h.nextSibling(we),G(se,we)}h.i.ma(pe,h.i.H)}function G(se,pe){var xe=se,we=pe.nodeType===1;we&&h.h.Sc(pe),(we||h.ga.instance.nodeHasBindings(pe))&&(xe=q(pe,null,se).bindingContextForDescendants),xe&&!J[h.a.R(pe)]&&V(xe,pe)}function U(se){var pe=[],xe={},we=[];return h.a.P(se,function Ee(Be){if(!xe[Be]){var ke=h.getBindingHandler(Be);ke&&(ke.after&&(we.push(Be),h.a.D(ke.after,function(Pe){if(se[Pe]){if(h.a.A(we,Pe)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));Ee(Pe)}}),we.length--),pe.push({key:Be,Mc:ke})),xe[Be]=!0}}),pe}function q(se,pe,xe){var we=h.a.g.Ub(se,ye,{}),Ee=we.hd;if(!pe){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}Ee||(we.context=xe),we.Zb||(we.Zb={});var Be;if(pe&&typeof pe!="function")Be=pe;else{var ke=h.ga.instance,Pe=ke.getBindingAccessors||k,ft=h.$(function(){return(Be=pe?pe(xe,se):Pe.call(ke,se,xe))&&(xe[Q]&&xe[Q](),xe[K]&&xe[K]()),Be},null,{l:se});Be&&ft.ja()||(ft=null)}var _t=xe,rt;if(Be){var dn=function(){return h.a.Ga(ft?ft():Be,I)},In=ft?function(Ht){return function(){return I(ft()[Ht])}}:function(Ht){return Be[Ht]};dn.get=function(Ht){return Be[Ht]&&I(In(Ht))},dn.has=function(Ht){return Ht in Be},h.i.H in Be&&h.i.subscribe(se,h.i.H,function(){var Ht=(0,Be[h.i.H])();if(Ht){var Ft=h.h.childNodes(se);Ft.length&&Ht(Ft,h.Ec(Ft[0]))}}),h.i.pa in Be&&(_t=h.i.Cb(se,xe),h.i.subscribe(se,h.i.pa,function(){var Ht=(0,Be[h.i.pa])();Ht&&h.h.firstChild(se)&&Ht(se)})),we=U(Be),h.a.D(we,function(Ht){var Ft=Ht.Mc.init,Te=Ht.Mc.update,Ae=Ht.key;if(se.nodeType===8&&!h.h.ea[Ae])throw Error("The binding '"+Ae+"' cannot be used with virtual elements");try{typeof Ft=="function"&&h.u.G(function(){var ut=Ft(se,In(Ae),dn,_t.$data,_t);if(ut&&ut.controlsDescendantBindings){if(rt!==e)throw Error("Multiple bindings ("+rt+" and "+Ae+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");rt=Ae}}),typeof Te=="function"&&h.$(function(){Te(se,In(Ae),dn,_t.$data,_t)},null,{l:se})}catch(ut){throw ut.message='Unable to process binding "'+Ae+": "+Be[Ae]+`" -Message: `+ut.message,ut}})}return we=rt===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&_t}}function Y(se,pe){return se&&se instanceof h.fa?se:new h.fa(se,e,e,pe)}var Q=h.a.Da("_subscribable"),W=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var J={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var me={};h.fa=function(se,pe,xe,we,Ee){function Be(){var In=_t?ft():ft,Ht=h.a.f(In);return pe?(h.a.extend(ke,pe),W in pe&&(ke[W]=pe[W])):(ke.$parents=[],ke.$root=Ht,ke.ko=h),ke[Q]=rt,Pe?Ht=ke.$data:(ke.$rawData=In,ke.$data=Ht),xe&&(ke[xe]=Ht),we&&we(ke,pe,Ht),pe&&pe[Q]&&!h.S.o().Vb(pe[Q])&&pe[Q](),dn&&(ke[K]=dn),ke.$data}var ke=this,Pe=se===me,ft=Pe?e:se,_t=typeof ft=="function"&&!h.O(ft),rt,dn=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?Be():(rt=h.xb(Be),rt.v(),rt.ja()?rt.equalityComparer=null:ke[Q]=e)},h.fa.prototype.createChildContext=function(se,pe,xe,we){if(!we&&pe&&typeof pe=="object"&&(we=pe,pe=we.as,xe=we.extend),pe&&we&&we.noChildContext){var Ee=typeof se=="function"&&!h.O(se);return new h.fa(me,this,null,function(Be){xe&&xe(Be),Be[pe]=Ee?se():se},we)}return new h.fa(se,this,pe,function(Be,ke){Be.$parentContext=ke,Be.$parent=ke.$data,Be.$parents=(ke.$parents||[]).slice(0),Be.$parents.unshift(Be.$parent),xe&&xe(Be)},we)},h.fa.prototype.extend=function(se,pe){return new h.fa(me,this,null,function(xe){h.a.extend(xe,typeof se=="function"?se(xe):se)},pe)};var ye=h.a.g.Z();b.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},b.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},b.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,pe,xe,we,Ee){var Be=h.a.g.Ub(se,ye,{});return Be.Fa||(Be.Fa=new h.T),Ee&&Ee.notifyImmediately&&Be.Zb[pe]&&h.u.G(xe,we,[se]),Be.Fa.subscribe(xe,we,pe)},ma:function(se,pe){var xe=h.a.g.get(se,ye);if(xe&&(xe.Zb[pe]=!0,xe.Fa&&xe.Fa.notifySubscribers(se,pe),pe==h.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,pe){var xe=h.a.g.Ub(se,ye,{});return xe.N||(xe.N=new b(se,xe,pe[W])),pe[W]==xe?pe:pe.extend(function(we){we[W]=xe})}},h.Td=function(se){return(se=h.a.g.get(se,ye))&&se.context},h.ib=function(se,pe,xe){return se.nodeType===1&&h.h.Sc(se),q(se,pe,Y(xe))},h.ld=function(se,pe,xe){return xe=Y(xe),h.ib(se,F(pe,xe,se),xe)},h.Oa=function(se,pe){pe.nodeType!==1&&pe.nodeType!==8||V(Y(se),pe)},h.vc=function(se,pe,xe){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(pe=n.body,!pe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!pe||pe.nodeType!==1&&pe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(Y(se,xe),pe)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function b(k,V){var G=Object.prototype.hasOwnProperty.call(M,k)?M[k]:_,U;G?G.subscribe(V):(G=M[k]=new h.T,G.subscribe(V),v(k,function(q,Y){var Q=!(!Y||!Y.synchronous);F[k]={definition:q,Gd:Q},delete M[k],U||Q?G.notifySubscribers(q):h.na.zb(function(){G.notifySubscribers(q)})}),U=!0)}function v(k,V){I("getConfig",[k],function(G){G?I("loadComponent",[k,G],function(U){V(U,G)}):V(null,null)})}function I(k,V,G,U){U||(U=h.j.loaders.slice(0));var q=U.shift();if(q){var Y=q[k];if(Y){var Q=!1;if(Y.apply(q,V.concat(function(W){Q?G(null):W!==null?G(W):I(k,V,G,U)}))!==_&&(Q=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(k,V,G,U)}else G(null)}var M={},F={};h.j={get:function(k,V){var G=Object.prototype.hasOwnProperty.call(F,k)?F[k]:_;G?G.Gd?h.u.G(function(){V(G.definition)}):h.na.zb(function(){V(G.definition)}):b(k,V)},Bc:function(k){delete F[k]},oc:I},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,U,q,Y){function Q(){--K===0&&Y(W)}var W={},K=2,J=q.template;q=q.viewModel,J?M(U,J,function(me){h.j.oc("loadTemplate",[G,me],function(ye){W.template=ye,Q()})}):Q(),q?M(U,q,function(me){h.j.oc("loadViewModel",[G,me],function(ye){W[V]=ye,Q()})}):Q()}function b(G,U,q){if(typeof U=="function")q(function(Q){return new U(Q)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var Y=U.instance;q(function(){return Y})}else"viewModel"in U?b(G,U.viewModel,q):G("Unknown viewModel value: "+U)}function v(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(I(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function M(G,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),q(Y)}):G("Uses require, but no AMD loader is present"):q(U)}function F(G){return function(U){throw Error("Component '"+G+"': "+U)}}var k={};h.j.register=function(G,U){if(!U)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");k[G]=U},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(k,G)},h.j.unregister=function(G){delete k[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,U){U(h.j.tb(G)?k[G]:null)},loadComponent:function(G,U,q){var Y=F(G);M(Y,U,function(Q){_(G,Y,Q,q)})},loadTemplate:function(G,U,q){if(G=F(G),typeof U=="string")q(h.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(v(U));else if(typeof U=="string"){var Y=n.getElementById(U);Y?q(v(Y)):G("Cannot find element with ID "+U)}else G("Unknown element type: "+U);else G("Unknown template value: "+U)},loadViewModel:function(G,U,q){b(F(G),U,q)}};var V="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=k}(),function(){function _(v,I){var M=v.getAttribute("params");if(M){var M=b.parseBindingsString(M,I,v,{valueAccessors:!0,bindingParams:!0}),M=h.a.Ga(M,function(V){return h.o(V,null,{l:v})}),F=h.a.Ga(M,function(V){var G=V.v();return V.ja()?h.o({read:function(){return h.a.f(V())},write:h.Za(G)&&function(U){V()(U)},l:v}):G});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}h.j.getComponentNameForNode=function(v){var I=h.a.R(v);if(h.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=h.a.W&&v.tagName===I))return I},h.j.tc=function(v,I,M,F){if(I.nodeType===1){var k=h.j.getComponentNameForNode(I);if(k){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:k,params:_(I,M)};v.component=F?function(){return V}:V}}return v};var b=new h.ga;9>h.a.W&&(h.j.register=function(v){return function(I){return v.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(v){return function(){var I=v(),M=h.j.dd,F;for(F in M);return I}}(n.createDocumentFragment))}(),function(){function _(I,M,F){if(M=M.template,!M)throw Error("Component '"+I+"' has no template");I=h.a.Ca(M),h.h.va(F,I)}function b(I,M,F){var k=I.createViewModel;return k?k.call(I,M,F):M}var v=0;h.c.component={init:function(I,M,F,k,V){function G(){var W=U&&U.dispose;typeof W=="function"&&W.call(U),Y&&Y.s(),q=U=Y=null}var U,q,Y,Q=h.a.la(h.h.childNodes(I));return h.h.Ea(I),h.a.K.za(I,G),h.o(function(){var W=h.a.f(M()),K,J;if(typeof W=="string"?K=W:(K=h.a.f(W.name),J=h.a.f(W.params)),!K)throw Error("No component name specified");var me=h.i.Cb(I,V),ye=q=++v;h.j.get(K,function(se){if(q===ye){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,I);var pe=b(se,J,{element:I,templateNodes:Q});se=me.createChildContext(pe,{extend:function(xe){xe.$component=pe,xe.$componentTemplateNodes=Q}}),pe&&pe.koDescendantsComplete&&(Y=h.i.subscribe(I,h.i.pa,pe.koDescendantsComplete,pe)),U=pe,h.Oa(se,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};h.c.attr={update:function(_,b){var v=h.a.f(b())||{};h.a.P(v,function(I,M){M=h.a.f(M);var F=I.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(I.substr(0,F)),k=M===!1||M===null||M===e;k?F?_.removeAttributeNS(F,I):_.removeAttribute(I):M=M.toString(),8>=h.a.W&&I in L?(I=L[I],k?_.removeAttribute(I):_[I]=M):k||(F?_.setAttributeNS(F,I,M):_.setAttribute(I,M)),I==="name"&&h.a.Yc(_,k?"":M)})}},function(){h.c.checked={after:["value","attr"],init:function(_,b,v){function I(){var W=_.checked,K=F();if(!h.S.Ya()&&(W||!V&&!h.S.qa())){var J=h.u.G(b);if(U){var me=q?J.v():J,ye=Q;Q=K,ye!==K?W&&(h.a.Na(me,K,!0),h.a.Na(me,ye,!1)):h.a.Na(me,K,W),q&&h.Za(J)&&J(me)}else k&&(K===e?K=W:W||(K=e)),h.m.eb(J,v,"checked",K,!0)}}function M(){var W=h.a.f(b()),K=F();U?(_.checked=0<=h.a.A(W,K),Q=K):_.checked=k&&K===e?!!W:F()===W}var F=h.xb(function(){if(v.has("checkedValue"))return h.a.f(v.get("checkedValue"));if(Y)return v.has("value")?h.a.f(v.get("value")):_.value}),k=_.type=="checkbox",V=_.type=="radio";if(k||V){var G=b(),U=k&&h.a.f(G)instanceof Array,q=!(U&&G.push&&G.splice),Y=V||U,Q=U?F():e;V&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(I,null,{l:_}),h.a.B(_,"click",I),h.o(M,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,b){_.value=h.a.f(b())}}}(),h.c.class={update:function(_,b){var v=h.a.Db(h.a.f(b()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=v,h.a.Eb(_,v,!0)}},h.c.css={update:function(_,b){var v=h.a.f(b());v!==null&&typeof v=="object"?h.a.P(v,function(I,M){M=h.a.f(M),h.a.Eb(_,I,M)}):h.c.class.update(_,b)}},h.c.enable={update:function(_,b){var v=h.a.f(b());v&&_.disabled?_.removeAttribute("disabled"):v||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,b){h.c.enable.update(_,function(){return!h.a.f(b())})}},h.c.event={init:function(_,b,v,I,M){var F=b()||{};h.a.P(F,function(k){typeof k=="string"&&h.a.B(_,k,function(V){var G,U=b()[k];if(U){try{var q=h.a.la(arguments);I=M.$data,q.unshift(I),G=U.apply(I,q)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}v.get(k+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var b=_(),v=h.a.bc(b);return!v||typeof v.length=="number"?{foreach:b,templateEngine:h.ba.Ma}:(h.a.f(b),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:h.ba.Ma})}},init:function(_,b){return h.c.template.init(_,h.c.foreach.Rc(b))},update:function(_,b,v,I,M){return h.c.template.update(_,h.c.foreach.Rc(b),v,I,M)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,b,v){function I(k){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}k=G===_}V=b(),h.m.eb(V,v,"hasfocus",k,!0),_.__ko_hasfocusLastValue=k,_.__ko_hasfocusUpdating=!1}var M=I.bind(null,!0),F=I.bind(null,!1);h.a.B(_,"focus",M),h.a.B(_,"focusin",M),h.a.B(_,"blur",F),h.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,b){var v=!!h.a.f(b());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===v||(v?_.focus():_.blur(),!v&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,v?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.fc(_,b())}},function(){function _(b,v,I){h.c[b]={init:function(M,F,k,V,G){var U,q,Y={},Q,W,K;if(v){V=k.get("as");var J=k.get("noChildContext");K=!(V&&J),Y={as:V,noChildContext:J,exportDependencies:K}}return W=(Q=k.get("completeOn")=="render")||k.has(h.i.pa),h.o(function(){var me=h.a.f(F()),ye=!I!=!me,se=!q,pe;(K||ye!==U)&&(W&&(G=h.i.Cb(M,G)),ye&&((!v||K)&&(Y.dataDependency=h.S.o()),pe=v?G.createChildContext(typeof me=="function"?me:F,Y):h.S.qa()?G.extend(null,Y):G),se&&h.S.qa()&&(q=h.a.Ca(h.h.childNodes(M),!0)),ye?(se||h.h.va(M,h.a.Ca(q)),h.Oa(pe,M)):(h.h.Ea(M),Q||h.i.ma(M,h.i.H)),U=ye)},null,{l:M}),{controlsDescendantBindings:!0}}},h.m.Ra[b]=!1,h.h.ea[b]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,b,v,I,M){return b=M.extend(b),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var N={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,b,v){function I(){return h.a.jb(_.options,function(J){return J.selected})}function M(J,me,ye){var se=typeof me;return se=="function"?me(J):se=="string"?J[me]:ye}function F(J,me){if(W&&U)h.i.ma(_,h.i.H);else if(Q.length){var ye=0<=h.a.A(Q,h.w.M(me[0]));h.a.Zc(me[0],ye),W&&!ye&&h.u.G(h.a.Fb,null,[_,"change"])}}var k=_.multiple,V=_.length!=0&&k?_.scrollTop:null,G=h.a.f(b()),U=v.get("valueAllowUnset")&&v.has("value"),q=v.get("optionsIncludeDestroyed");b={};var Y,Q=[];U||(k?Q=h.a.Mb(I(),h.w.M):0<=_.selectedIndex&&Q.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),Y=h.a.jb(G,function(J){return q||J===e||J===null||!h.a.f(J._destroy)}),v.has("optionsCaption")&&(G=h.a.f(v.get("optionsCaption")),G!==null&&G!==e&&Y.unshift(N)));var W=!1;if(b.beforeRemove=function(J){_.removeChild(J)},G=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(G=function(J,me){F(0,me),h.u.G(v.get("optionsAfterRender"),null,[me[0],J!==N?J:e])}),h.a.ec(_,Y,function(J,me,ye){return ye.length&&(Q=!U&&ye[0].selected?[h.w.M(ye[0])]:[],W=!0),me=_.ownerDocument.createElement("option"),J===N?(h.a.Bb(me,v.get("optionsCaption")),h.w.cb(me,e)):(ye=M(J,v.get("optionsValue"),J),h.w.cb(me,h.a.f(ye)),J=M(J,v.get("optionsText"),ye),h.a.Bb(me,J)),[me]},b,G),!U){var K;k?K=Q.length&&I().length<Q.length:K=Q.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(U||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,b,v){function I(){var k=b(),V=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&V.push(h.w.M(G))}),h.m.eb(k,v,"selectedOptions",V)}function M(){var k=h.a.f(b()),V=_.scrollTop;k&&typeof k.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var U=0<=h.a.A(k,h.w.M(G));G.selected!=U&&h.a.Zc(G,U)}),_.scrollTop=V}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;h.i.subscribe(_,h.i.H,function(){F?I():(h.a.B(_,"change",I),F=h.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,b){var v=h.a.f(b()||{});h.a.P(v,function(I,M){if(M=h.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(I,M);else if(/^--/.test(I))_.style.setProperty(I,M);else{I=I.replace(/-(\w)/g,function(k,V){return V.toUpperCase()});var F=_.style[I];_.style[I]=M,M===F||_.style[I]!=F||isNaN(M)||(_.style[I]=M+"px")}})}},h.c.submit={init:function(_,b,v,I,M){if(typeof b()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(F){var k,V=b();try{k=V.call(M.$data,_)}finally{k!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,b){h.a.Bb(_,b())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(Y){if(Y)return parseFloat(Y[1])},b=t.navigator.userAgent,v,I,M,F,k;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(k=_(b.match(/Edge\/([^ ]+)$/)))||_(b.match(/Chrome\/([^ ]+)/))||(I=_(b.match(/Version\/([^ ]+) Safari/)))||(M=_(b.match(/Firefox\/([^ ]+)/)))||(F=h.a.W||_(b.match(/MSIE ([^ ]+)/)))||(F=_(b.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var V=h.a.g.Z(),G=h.a.g.Z(),U=function(Y){var Q=this.activeElement;(Q=Q&&h.a.g.get(Q,G))&&Q(Y)},q=function(Y,Q){var W=Y.ownerDocument;h.a.g.get(W,V)||(h.a.g.set(W,V,!0),h.a.B(W,"selectionchange",U)),h.a.g.set(Y,G,Q)};h.c.textInput={init:function(Y,Q,W){function K(Be,ke){h.a.B(Y,Be,ke)}function J(){var Be=h.a.f(Q());(Be===null||Be===e)&&(Be=""),xe!==e&&Be===xe?h.a.setTimeout(J,4):Y.value!==Be&&(Ee=!0,Y.value=Be,Ee=!1,se=Y.value)}function me(){pe||(xe=Y.value,pe=h.a.setTimeout(ye,4))}function ye(){clearTimeout(pe),xe=pe=e;var Be=Y.value;se!==Be&&(se=Be,h.m.eb(Q(),W,"textInput",Be))}var se=Y.value,pe,xe,we=h.a.W==9?me:ye,Ee=!1;F&&K("keypress",ye),11>F&&K("propertychange",function(Be){Ee||Be.propertyName!=="value"||we(Be)}),F==8&&(K("keyup",ye),K("keydown",ye)),q&&(q(Y,we),K("dragend",me)),(!F||9<=F)&&K("input",we),5>I&&h.a.R(Y)==="textarea"?(K("keydown",me),K("paste",me),K("cut",me)):11>v?K("keydown",me):4>M?(K("DOMAutoComplete",ye),K("dragdrop",ye),K("drop",ye)):k&&Y.type==="number"&&K("keydown",me),K("change",ye),K("blur",ye),h.o(J,null,{l:Y})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(Y,Q,W){W("textInput",Y)}}}(),h.c.uniqueName={init:function(_,b){if(b()){var v="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,v)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,b,v,I,M){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),b=M.createChildContext(b,F),h.Oa(b,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,b,v){var I=h.a.R(_),M=I=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],k=v.get("valueUpdate"),V=!1,G=null;k&&(typeof k=="string"?F=[k]:F=h.a.wc(k),h.a.Pa(F,"change"));var U=function(){G=null,V=!1;var Q=b(),W=h.w.M(_);h.m.eb(Q,v,"value",W)};!h.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(F,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){V=!0}),h.a.B(_,"focus",function(){V=!1}),h.a.B(_,"blur",function(){V&&U()})),h.a.D(F,function(Q){var W=U;h.a.Ud(Q,"after")&&(W=function(){G=h.w.M(_),h.a.setTimeout(U,0)},Q=Q.substring(5)),h.a.B(_,Q,W)});var q;if(q=M&&_.type=="file"?function(){var Q=h.a.f(b());Q===null||Q===e||Q===""?_.value="":h.u.G(U)}:function(){var Q=h.a.f(b()),W=h.w.M(_);G!==null&&Q===G?h.a.setTimeout(q,0):(Q!==W||W===e)&&(I==="select"?(W=v.get("valueAllowUnset"),h.w.cb(_,Q,W),W||Q===h.w.M(_)||h.u.G(U)):h.w.cb(_,Q))},I==="select"){var Y;h.i.subscribe(_,h.i.H,function(){Y?v.get("valueAllowUnset")?q():U():(h.a.B(_,"change",U),Y=h.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",U),h.o(q,null,{l:_})}else h.ib(_,{checkedValue:b})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,b){var v=h.a.f(b()),I=_.style.display!="none";v&&!I?_.style.display="":!v&&I&&(_.style.display="none")}},h.c.hidden={update:function(_,b){h.c.visible.update(_,function(){return!h.a.f(b())})}},function(_){h.c[_]={init:function(b,v,I,M,F){return h.c.event.init.call(this,b,function(){var k={};return k[_]=v(),k},I,M,F)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,b){if(typeof _=="string"){b=b||n;var v=b.getElementById(_);if(!v)throw Error("Cannot find template with ID "+_);return new h.C.F(v)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,b,v,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,b,v,I)},h.ca.prototype.isTemplateRewritten=function(_,b){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,b).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,b,v){_=this.makeTemplateSource(_,v),b=b(_.text()),_.text(b),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(I,M,F,k){I=h.m.ac(I);for(var V=h.m.Ra,G=0;G<I.length;G++){var U=I[G].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[G].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",k.createJavaScriptEvaluatorBlock(F)+M}var b=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,M,F){M.isTemplateRewritten(I,F)||M.rewriteTemplate(I,function(k){return h.kc.Ld(k,M)},F)},Ld:function(I,M){return I.replace(b,function(F,k,V,G,U){return _(U,k,V,M)}).replace(v,function(F,k){return _(k,"<!-- ko -->","#comment",M)})},md:function(I,M){return h.aa.Xb(function(F,k){var V=F.nextSibling;V&&V.nodeName.toLowerCase()===M&&h.ib(V,I,k)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(v){if(this.F=v){var I=h.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?h.a.fc(this.F,I):this.F[v]=I};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(v){if(arguments.length===1)return h.a.g.get(this.F,_+v);h.a.g.set(this.F,_+v,arguments[1])};var b=h.a.g.Z();h.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=h.a.g.get(v,b)||{},M=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!M||I.jd){var F=this.text();F&&F!==I.bb&&(M=h.a.Md(F,v.ownerDocument),h.a.g.set(v,b,{lb:M,bb:F,jd:!0}))}return M}I=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(v,b,{lb:I})},h.C.ia=function(v){this.F=v},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var v=h.a.g.get(this.F,b)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}h.a.g.set(this.F,b,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,U,q){var Y;for(U=h.h.nextSibling(U);G&&(Y=G)!==U;)G=h.h.nextSibling(Y),q(Y,G)}function b(G,U){if(G.length){var q=G[0],Y=G[G.length-1],Q=q.parentNode,W=h.ga.instance,K=W.preprocessNode;if(K){if(_(q,Y,function(J,me){var ye=J.previousSibling,se=K.call(W,J);se&&(J===q&&(q=se[0]||me),J===Y&&(Y=se[se.length-1]||ye))}),G.length=0,!q)return;q===Y?G.push(q):(G.push(q,Y),h.a.Ua(G,Q))}_(q,Y,function(J){J.nodeType!==1&&J.nodeType!==8||h.vc(U,J)}),_(q,Y,function(J){J.nodeType!==1&&J.nodeType!==8||h.aa.cd(J,[U])}),h.a.Ua(G,Q)}}function v(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,U,q,Y,Q){Q=Q||{};var W=(G&&v(G)||q||{}).ownerDocument,K=Q.templateEngine||F;if(h.kc.xd(q,K,W),q=K.renderTemplate(q,Y,Q,W),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,U){case"replaceChildren":h.h.va(G,q),W=!0;break;case"replaceNode":h.a.Xc(G,q),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return W&&(b(q,Y),Q.afterRender&&h.u.G(Q.afterRender,null,[q,Y[Q.as||"$data"]]),U=="replaceChildren"&&h.i.ma(G,h.i.H)),q}function M(G,U,q){return h.O(G)?G():typeof G=="function"?G(U,q):G}var F;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=G},h.dc=function(G,U,q,Y,Q){if(q=q||{},(q.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",Y){var W=v(Y);return h.$(function(){var J=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),K=M(G,J.$data,J),J=I(Y,Q,K,J,q);Q=="replaceNode"&&(Y=J,W=v(Y))},null,{Sa:function(){return!W||!h.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return h.aa.Xb(function(K){h.dc(G,U,q,K,"replaceNode")})},h.Qd=function(G,U,q,Y,Q){function W(xe,we){h.u.G(h.a.ec,null,[Y,xe,J,q,K,we]),h.i.ma(Y,h.i.H)}function K(xe,we){b(we,me),q.afterRender&&q.afterRender(we,xe),me=null}function J(xe,we){me=Q.createChildContext(xe,{as:ye,noChildContext:q.noChildContext,extend:function(Be){Be.$index=we,ye&&(Be[ye+"Index"]=we)}});var Ee=M(G,xe,me);return I(Y,"ignoreTargetNode",Ee,me,q)}var me,ye=q.as,se=q.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!q.includeDestroyed;if(se||q.beforeRemove||!h.Pc(U))return h.$(function(){var xe=h.a.f(U)||[];typeof xe.length>"u"&&(xe=[xe]),se&&(xe=h.a.jb(xe,function(we){return we===e||we===null||!h.a.f(we._destroy)})),W(xe)},null,{l:Y});W(U.v());var pe=U.subscribe(function(xe){W(U(),xe)},null,"arrayChange");return pe.l(Y),pe};var k=h.a.g.Z(),V=h.a.g.Z();h.c.template={init:function(G,U){var q=h.a.f(U());if(typeof q=="string"||"name"in q)h.h.Ea(G);else if("nodes"in q){if(q=q.nodes||[],h.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=q[0]&&q[0].parentNode;Y&&h.a.g.get(Y,V)||(Y=h.a.Yb(q),h.a.g.set(Y,V,!0)),new h.C.ia(G).nodes(Y)}else if(q=h.h.childNodes(G),0<q.length)Y=h.a.Yb(q),new h.C.ia(G).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,U,q,Y,Q){var W=U();U=h.a.f(W),q=!0,Y=null,typeof U=="string"?U={}:(W="name"in U?U.name:G,"if"in U&&(q=h.a.f(U.if)),q&&"ifnot"in U&&(q=!h.a.f(U.ifnot)),q&&!W&&(q=!1)),"foreach"in U?Y=h.Qd(W,q&&U.foreach||[],U,G,Q):q?(q=Q,"data"in U&&(q=Q.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Y=h.dc(W,q,U,G)):h.h.Ea(G),Q=Y,(U=h.a.g.get(G,k))&&typeof U.s=="function"&&U.s(),h.a.g.set(G,k,!Q||Q.ja&&!Q.ja()?e:Q)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,b,v){if(_.length&&b.length){var I,M,F,k,V;for(I=M=0;(!v||I<v)&&(k=_[M]);++M){for(F=0;V=b[F];++F)if(k.value===V.value){k.moved=V.index,V.moved=k.index,b.splice(F,1),I=F=0;break}I+=F}}},h.a.Pb=function(){function _(b,v,I,M,F){var k=Math.min,V=Math.max,G=[],U,q=b.length,Y,Q=v.length,W=Q-q||1,K=q+Q+1,J,me,ye;for(U=0;U<=q;U++)for(me=J,G.push(J=[]),ye=k(Q,U+W),Y=V(0,U-1);Y<=ye;Y++)J[Y]=Y?U?b[U-1]===v[Y-1]?me[Y-1]:k(me[Y]||K,J[Y-1]||K)+1:Y+1:U+1;for(k=[],V=[],W=[],U=q,Y=Q;U||Y;)Q=G[U][Y]-1,Y&&Q===G[U][Y-1]?V.push(k[k.length]={status:I,value:v[--Y],index:Y}):U&&Q===G[U-1][Y]?W.push(k[k.length]={status:M,value:b[--U],index:U}):(--Y,--U,F.sparse||k.push({status:"retained",value:v[Y]}));return h.a.Kc(W,V,!F.dontLimitMoves&&10*q),k.reverse()}return function(b,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},b=b||[],v=v||[],b.length<v.length?_(b,v,"added","deleted",I):_(v,b,"deleted","added",I)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(I,M,F,k,V){var G=[],U=h.$(function(){var q=M(F,V,h.a.Ua(G,I))||[];0<G.length&&(h.a.Xc(G,q),k&&h.u.G(k,null,[F,q,V])),G.length=0,h.a.Nb(G,q)},null,{l:I,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:U.ja()?U:e}}var b=h.a.g.Z(),v=h.a.g.Z();h.a.ec=function(I,M,F,k,V,G){function U(Ht){Ee={Aa:Ht,pb:h.ta(me++)},K.push(Ee),W||we.push(Ee)}function q(Ht){Ee=Q[Ht],me!==Ee.pb.v()&&xe.push(Ee),Ee.pb(me++),h.a.Ua(Ee.Y,I),K.push(Ee)}function Y(Ht,Ft){if(Ht)for(var Te=0,Ae=Ft.length;Te<Ae;Te++)h.a.D(Ft[Te].Y,function(ut){Ht(ut,Te,Ft[Te].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),k=k||{};var Q=h.a.g.get(I,b),W=!Q,K=[],J=0,me=0,ye=[],se=[],pe=[],xe=[],we=[],Ee,Be=0;if(W)h.a.D(M,U);else{if(!G||Q&&Q._countWaitingForRemove){var ke=h.a.Mb(Q,function(Ht){return Ht.Aa});G=h.a.Pb(ke,M,{dontLimitMoves:k.dontLimitMoves,sparse:!0})}for(var ke=0,Pe,ft,_t;Pe=G[ke];ke++)switch(ft=Pe.moved,_t=Pe.index,Pe.status){case"deleted":for(;J<_t;)q(J++);ft===e&&(Ee=Q[J],Ee.$&&(Ee.$.s(),Ee.$=e),h.a.Ua(Ee.Y,I).length&&(k.beforeRemove&&(K.push(Ee),Be++,Ee.Aa===v?Ee=null:pe.push(Ee)),Ee&&ye.push.apply(ye,Ee.Y))),J++;break;case"added":for(;me<_t;)q(J++);ft!==e?(se.push(K.length),q(ft)):U(Pe.value)}for(;me<M.length;)q(J++);K._countWaitingForRemove=Be}h.a.g.set(I,b,K),Y(k.beforeMove,xe),h.a.D(ye,k.beforeRemove?h.oa:h.removeNode);var rt,dn,In;try{In=I.ownerDocument.activeElement}catch{}if(se.length)for(;(ke=se.shift())!=e;){for(Ee=K[ke],rt=e;ke;)if((dn=K[--ke].Y)&&dn.length){rt=dn[dn.length-1];break}for(M=0;J=Ee.Y[M];rt=J,M++)h.h.Wb(I,J,rt)}for(ke=0;Ee=K[ke];ke++){for(Ee.Y||h.a.extend(Ee,_(I,F,Ee.Aa,V,Ee.pb)),M=0;J=Ee.Y[M];rt=J,M++)h.h.Wb(I,J,rt);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,rt=Ee.Y[Ee.Y.length-1])}for(In&&I.ownerDocument.activeElement!=In&&In.focus(),Y(k.beforeRemove,pe),ke=0;ke<pe.length;++ke)pe[ke].Aa=v;Y(k.afterMove,xe),Y(k.afterAdd,we)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,b,v,I){return(b=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(b.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,I))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var b=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(v,I,M,F){if(F=F||n,M=M||{},2>b)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var k=v.data("precompiled");return k||(k=v.text()||"",k=r.template(null,"{{ko_with $item.koBindingContext}}"+k+"{{/ko_with}}"),v.data("precompiled",k)),v=[I.$data],I=r.extend({koBindingContext:I},M.templateOptions),I=r.tmpl(k,v,I),I.appendTo(F.createElement("div")),r.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"<\/script>")},0<b&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var Dgt=ko;typeof window<"u"?(ko=window.ko,typeof MI<"u"?window.ko=MI:delete window.ko):(ko=global.ko,typeof MI<"u"?global.ko=MI:delete global.ko);var Bb=Dgt;/** +Message: `+k.message,k}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function _(se){var pe=(se=h.a.g.get(se,ge))&&se.N;pe&&(se.N=null,pe.Tc())}function E(se,pe,xe){this.node=se,this.yc=pe,this.kb=[],this.H=!1,pe.N||h.a.K.za(se,_),xe&&xe.N&&(xe.N.kb.push(se),this.Kb=xe)}function w(se){return function(){return se}}function D(se){return se()}function M(se){return h.a.Ga(h.u.G(se),function(pe,xe){return function(){return se()[xe]}})}function B(se,pe,xe){return typeof se=="function"?M(se.bind(null,pe,xe)):h.a.Ga(se,w)}function V(se,pe){return M(this.getBindings.bind(this,se,pe))}function U(se,pe){var xe=h.h.firstChild(pe);if(xe){var De,Se=h.ga.instance,we=Se.preprocessNode;if(we){for(;De=xe;)xe=h.h.nextSibling(De),we.call(Se,De);xe=h.h.firstChild(pe)}for(;De=xe;)xe=h.h.nextSibling(De),G(se,De)}h.i.ma(pe,h.i.H)}function G(se,pe){var xe=se,De=pe.nodeType===1;De&&h.h.Sc(pe),(De||h.ga.instance.nodeHasBindings(pe))&&(xe=Y(pe,null,se).bindingContextForDescendants),xe&&!J[h.a.R(pe)]&&U(xe,pe)}function k(se){var pe=[],xe={},De=[];return h.a.P(se,function Se(we){if(!xe[we]){var ze=h.getBindingHandler(we);ze&&(ze.after&&(De.push(we),h.a.D(ze.after,function(Oe){if(se[Oe]){if(h.a.A(De,Oe)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Se(Oe)}}),De.length--),pe.push({key:we,Mc:ze})),xe[we]=!0}}),pe}function Y(se,pe,xe){var De=h.a.g.Ub(se,ge,{}),Se=De.hd;if(!pe){if(Se)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Se||(De.context=xe),De.Zb||(De.Zb={});var we;if(pe&&typeof pe!="function")we=pe;else{var ze=h.ga.instance,Oe=ze.getBindingAccessors||V,ft=h.$(function(){return(we=pe?pe(xe,se):Oe.call(ze,se,xe))&&(xe[$]&&xe[$](),xe[K]&&xe[K]()),we},null,{l:se});we&&ft.ja()||(ft=null)}var Ct=xe,ot;if(we){var sn=function(){return h.a.Ga(ft?ft():we,D)},wn=ft?function(zt){return function(){return D(ft()[zt])}}:function(zt){return we[zt]};sn.get=function(zt){return we[zt]&&D(wn(zt))},sn.has=function(zt){return zt in we},h.i.H in we&&h.i.subscribe(se,h.i.H,function(){var zt=(0,we[h.i.H])();if(zt){var Bt=h.h.childNodes(se);Bt.length&&zt(Bt,h.Ec(Bt[0]))}}),h.i.pa in we&&(Ct=h.i.Cb(se,xe),h.i.subscribe(se,h.i.pa,function(){var zt=(0,we[h.i.pa])();zt&&h.h.firstChild(se)&&zt(se)})),De=k(we),h.a.D(De,function(zt){var Bt=zt.Mc.init,be=zt.Mc.update,Ee=zt.key;if(se.nodeType===8&&!h.h.ea[Ee])throw Error("The binding '"+Ee+"' cannot be used with virtual elements");try{typeof Bt=="function"&&h.u.G(function(){var at=Bt(se,wn(Ee),sn,Ct.$data,Ct);if(at&&at.controlsDescendantBindings){if(ot!==e)throw Error("Multiple bindings ("+ot+" and "+Ee+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");ot=Ee}}),typeof be=="function"&&h.$(function(){be(se,wn(Ee),sn,Ct.$data,Ct)},null,{l:se})}catch(at){throw at.message='Unable to process binding "'+Ee+": "+we[Ee]+`" +Message: `+at.message,at}})}return De=ot===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&Ct}}function j(se,pe){return se&&se instanceof h.fa?se:new h.fa(se,e,e,pe)}var $=h.a.Da("_subscribable"),W=h.a.Da("_ancestorBindingInfo"),K=h.a.Da("_dataDependency");h.c={};var J={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(se){return h.c[se]};var he={};h.fa=function(se,pe,xe,De,Se){function we(){var wn=Ct?ft():ft,zt=h.a.f(wn);return pe?(h.a.extend(ze,pe),W in pe&&(ze[W]=pe[W])):(ze.$parents=[],ze.$root=zt,ze.ko=h),ze[$]=ot,Oe?zt=ze.$data:(ze.$rawData=wn,ze.$data=zt),xe&&(ze[xe]=zt),De&&De(ze,pe,zt),pe&&pe[$]&&!h.S.o().Vb(pe[$])&&pe[$](),sn&&(ze[K]=sn),ze.$data}var ze=this,Oe=se===he,ft=Oe?e:se,Ct=typeof ft=="function"&&!h.O(ft),ot,sn=Se&&Se.dataDependency;Se&&Se.exportDependencies?we():(ot=h.xb(we),ot.v(),ot.ja()?ot.equalityComparer=null:ze[$]=e)},h.fa.prototype.createChildContext=function(se,pe,xe,De){if(!De&&pe&&typeof pe=="object"&&(De=pe,pe=De.as,xe=De.extend),pe&&De&&De.noChildContext){var Se=typeof se=="function"&&!h.O(se);return new h.fa(he,this,null,function(we){xe&&xe(we),we[pe]=Se?se():se},De)}return new h.fa(se,this,pe,function(we,ze){we.$parentContext=ze,we.$parent=ze.$data,we.$parents=(ze.$parents||[]).slice(0),we.$parents.unshift(we.$parent),xe&&xe(we)},De)},h.fa.prototype.extend=function(se,pe){return new h.fa(he,this,null,function(xe){h.a.extend(xe,typeof se=="function"?se(xe):se)},pe)};var ge=h.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(se){h.a.Pa(this.kb,se),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,_),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(se,pe,xe,De,Se){var we=h.a.g.Ub(se,ge,{});return we.Fa||(we.Fa=new h.T),Se&&Se.notifyImmediately&&we.Zb[pe]&&h.u.G(xe,De,[se]),we.Fa.subscribe(xe,De,pe)},ma:function(se,pe){var xe=h.a.g.get(se,ge);if(xe&&(xe.Zb[pe]=!0,xe.Fa&&xe.Fa.notifySubscribers(se,pe),pe==h.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(se,pe){var xe=h.a.g.Ub(se,ge,{});return xe.N||(xe.N=new E(se,xe,pe[W])),pe[W]==xe?pe:pe.extend(function(De){De[W]=xe})}},h.Td=function(se){return(se=h.a.g.get(se,ge))&&se.context},h.ib=function(se,pe,xe){return se.nodeType===1&&h.h.Sc(se),Y(se,pe,j(xe))},h.ld=function(se,pe,xe){return xe=j(xe),h.ib(se,B(pe,xe,se),xe)},h.Oa=function(se,pe){pe.nodeType!==1&&pe.nodeType!==8||U(j(se),pe)},h.vc=function(se,pe,xe){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(pe=n.body,!pe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!pe||pe.nodeType!==1&&pe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(j(se,xe),pe)},h.Dc=function(se){return!se||se.nodeType!==1&&se.nodeType!==8?e:h.Td(se)},h.Ec=function(se){return(se=h.Dc(se))?se.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(_){function E(V,U){var G=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;G?G.subscribe(U):(G=M[V]=new h.T,G.subscribe(U),w(V,function(Y,j){var $=!(!j||!j.synchronous);B[V]={definition:Y,Gd:$},delete M[V],k||$?G.notifySubscribers(Y):h.na.zb(function(){G.notifySubscribers(Y)})}),k=!0)}function w(V,U){D("getConfig",[V],function(G){G?D("loadComponent",[V,G],function(k){U(k,G)}):U(null,null)})}function D(V,U,G,k){k||(k=h.j.loaders.slice(0));var Y=k.shift();if(Y){var j=Y[V];if(j){var $=!1;if(j.apply(Y,U.concat(function(W){$?G(null):W!==null?G(W):D(V,U,G,k)}))!==_&&($=!0,!Y.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else D(V,U,G,k)}else G(null)}var M={},B={};h.j={get:function(V,U){var G=Object.prototype.hasOwnProperty.call(B,V)?B[V]:_;G?G.Gd?h.u.G(function(){U(G.definition)}):h.na.zb(function(){U(G.definition)}):E(V,U)},Bc:function(V){delete B[V]},oc:D},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function _(G,k,Y,j){function $(){--K===0&&j(W)}var W={},K=2,J=Y.template;Y=Y.viewModel,J?M(k,J,function(he){h.j.oc("loadTemplate",[G,he],function(ge){W.template=ge,$()})}):$(),Y?M(k,Y,function(he){h.j.oc("loadViewModel",[G,he],function(ge){W[U]=ge,$()})}):$()}function E(G,k,Y){if(typeof k=="function")Y(function($){return new k($)});else if(typeof k[U]=="function")Y(k[U]);else if("instance"in k){var j=k.instance;Y(function(){return j})}else"viewModel"in k?E(G,k.viewModel,Y):G("Unknown viewModel value: "+k)}function w(G){switch(h.a.R(G)){case"script":return h.a.ua(G.text);case"textarea":return h.a.ua(G.value);case"template":if(D(G.content))return h.a.Ca(G.content.childNodes)}return h.a.Ca(G.childNodes)}function D(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function M(G,k,Y){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(j){j&&typeof j=="object"&&j.Xd&&j.default&&(j=j.default),Y(j)}):G("Uses require, but no AMD loader is present"):Y(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var V={};h.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(h.j.tb(G))throw Error("Component "+G+" is already registered");V[G]=k},h.j.tb=function(G){return Object.prototype.hasOwnProperty.call(V,G)},h.j.unregister=function(G){delete V[G],h.j.Bc(G)},h.j.Fc={getConfig:function(G,k){k(h.j.tb(G)?V[G]:null)},loadComponent:function(G,k,Y){var j=B(G);M(j,k,function($){_(G,j,$,Y)})},loadTemplate:function(G,k,Y){if(G=B(G),typeof k=="string")Y(h.a.ua(k));else if(k instanceof Array)Y(k);else if(D(k))Y(h.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)Y(w(k));else if(typeof k=="string"){var j=n.getElementById(k);j?Y(w(j)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,Y){E(B(G),k,Y)}};var U="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=V}(),function(){function _(w,D){var M=w.getAttribute("params");if(M){var M=E.parseBindingsString(M,D,w,{valueAccessors:!0,bindingParams:!0}),M=h.a.Ga(M,function(U){return h.o(U,null,{l:w})}),B=h.a.Ga(M,function(U){var G=U.v();return U.ja()?h.o({read:function(){return h.a.f(U())},write:h.Za(G)&&function(k){U()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=M),B}return{$raw:{}}}h.j.getComponentNameForNode=function(w){var D=h.a.R(w);if(h.j.tb(D)&&(D.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=h.a.W&&w.tagName===D))return D},h.j.tc=function(w,D,M,B){if(D.nodeType===1){var V=h.j.getComponentNameForNode(D);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:V,params:_(D,M)};w.component=B?function(){return U}:U}}return w};var E=new h.ga;9>h.a.W&&(h.j.register=function(w){return function(D){return w.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(w){return function(){var D=w(),M=h.j.dd,B;for(B in M);return D}}(n.createDocumentFragment))}(),function(){function _(D,M,B){if(M=M.template,!M)throw Error("Component '"+D+"' has no template");D=h.a.Ca(M),h.h.va(B,D)}function E(D,M,B){var V=D.createViewModel;return V?V.call(D,M,B):M}var w=0;h.c.component={init:function(D,M,B,V,U){function G(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),j&&j.s(),Y=k=j=null}var k,Y,j,$=h.a.la(h.h.childNodes(D));return h.h.Ea(D),h.a.K.za(D,G),h.o(function(){var W=h.a.f(M()),K,J;if(typeof W=="string"?K=W:(K=h.a.f(W.name),J=h.a.f(W.params)),!K)throw Error("No component name specified");var he=h.i.Cb(D,U),ge=Y=++w;h.j.get(K,function(se){if(Y===ge){if(G(),!se)throw Error("Unknown component '"+K+"'");_(K,se,D);var pe=E(se,J,{element:D,templateNodes:$});se=he.createChildContext(pe,{extend:function(xe){xe.$component=pe,xe.$componentTemplateNodes=$}}),pe&&pe.koDescendantsComplete&&(j=h.i.subscribe(D,h.i.pa,pe.koDescendantsComplete,pe)),k=pe,h.Oa(se,D)}})},null,{l:D}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var N={class:"className",for:"htmlFor"};h.c.attr={update:function(_,E){var w=h.a.f(E())||{};h.a.P(w,function(D,M){M=h.a.f(M);var B=D.indexOf(":"),B="lookupNamespaceURI"in _&&0<B&&_.lookupNamespaceURI(D.substr(0,B)),V=M===!1||M===null||M===e;V?B?_.removeAttributeNS(B,D):_.removeAttribute(D):M=M.toString(),8>=h.a.W&&D in N?(D=N[D],V?_.removeAttribute(D):_[D]=M):V||(B?_.setAttributeNS(B,D,M):_.setAttribute(D,M)),D==="name"&&h.a.Yc(_,V?"":M)})}},function(){h.c.checked={after:["value","attr"],init:function(_,E,w){function D(){var W=_.checked,K=B();if(!h.S.Ya()&&(W||!U&&!h.S.qa())){var J=h.u.G(E);if(k){var he=Y?J.v():J,ge=$;$=K,ge!==K?W&&(h.a.Na(he,K,!0),h.a.Na(he,ge,!1)):h.a.Na(he,K,W),Y&&h.Za(J)&&J(he)}else V&&(K===e?K=W:W||(K=e)),h.m.eb(J,w,"checked",K,!0)}}function M(){var W=h.a.f(E()),K=B();k?(_.checked=0<=h.a.A(W,K),$=K):_.checked=V&&K===e?!!W:B()===W}var B=h.xb(function(){if(w.has("checkedValue"))return h.a.f(w.get("checkedValue"));if(j)return w.has("value")?h.a.f(w.get("value")):_.value}),V=_.type=="checkbox",U=_.type=="radio";if(V||U){var G=E(),k=V&&h.a.f(G)instanceof Array,Y=!(k&&G.push&&G.splice),j=U||k,$=k?B():e;U&&!_.name&&h.c.uniqueName.init(_,function(){return!0}),h.o(D,null,{l:_}),h.a.B(_,"click",D),h.o(M,null,{l:_}),G=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(_,E){_.value=h.a.f(E())}}}(),h.c.class={update:function(_,E){var w=h.a.Db(h.a.f(E()));h.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,h.a.Eb(_,w,!0)}},h.c.css={update:function(_,E){var w=h.a.f(E());w!==null&&typeof w=="object"?h.a.P(w,function(D,M){M=h.a.f(M),h.a.Eb(_,D,M)}):h.c.class.update(_,E)}},h.c.enable={update:function(_,E){var w=h.a.f(E());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},h.c.disable={update:function(_,E){h.c.enable.update(_,function(){return!h.a.f(E())})}},h.c.event={init:function(_,E,w,D,M){var B=E()||{};h.a.P(B,function(V){typeof V=="string"&&h.a.B(_,V,function(U){var G,k=E()[V];if(k){try{var Y=h.a.la(arguments);D=M.$data,Y.unshift(D),G=k.apply(D,Y)}finally{G!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}w.get(V+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},h.c.foreach={Rc:function(_){return function(){var E=_(),w=h.a.bc(E);return!w||typeof w.length=="number"?{foreach:E,templateEngine:h.ba.Ma}:(h.a.f(E),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:h.ba.Ma})}},init:function(_,E){return h.c.template.init(_,h.c.foreach.Rc(E))},update:function(_,E,w,D,M){return h.c.template.update(_,h.c.foreach.Rc(E),w,D,M)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(_,E,w){function D(V){_.__ko_hasfocusUpdating=!0;var U=_.ownerDocument;if("activeElement"in U){var G;try{G=U.activeElement}catch{G=U.body}V=G===_}U=E(),h.m.eb(U,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=D.bind(null,!0),B=D.bind(null,!1);h.a.B(_,"focus",M),h.a.B(_,"focusin",M),h.a.B(_,"blur",B),h.a.B(_,"focusout",B),_.__ko_hasfocusLastValue=!1},update:function(_,E){var w=!!h.a.f(E());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[_,w?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.fc(_,E())}},function(){function _(E,w,D){h.c[E]={init:function(M,B,V,U,G){var k,Y,j={},$,W,K;if(w){U=V.get("as");var J=V.get("noChildContext");K=!(U&&J),j={as:U,noChildContext:J,exportDependencies:K}}return W=($=V.get("completeOn")=="render")||V.has(h.i.pa),h.o(function(){var he=h.a.f(B()),ge=!D!=!he,se=!Y,pe;(K||ge!==k)&&(W&&(G=h.i.Cb(M,G)),ge&&((!w||K)&&(j.dataDependency=h.S.o()),pe=w?G.createChildContext(typeof he=="function"?he:B,j):h.S.qa()?G.extend(null,j):G),se&&h.S.qa()&&(Y=h.a.Ca(h.h.childNodes(M),!0)),ge?(se||h.h.va(M,h.a.Ca(Y)),h.Oa(pe,M)):(h.h.Ea(M),$||h.i.ma(M,h.i.H)),k=ge)},null,{l:M}),{controlsDescendantBindings:!0}}},h.m.Ra[E]=!1,h.h.ea[E]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),h.c.let={init:function(_,E,w,D,M){return E=M.extend(E),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var F={};h.c.options={init:function(_){if(h.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,E,w){function D(){return h.a.jb(_.options,function(J){return J.selected})}function M(J,he,ge){var se=typeof he;return se=="function"?he(J):se=="string"?J[he]:ge}function B(J,he){if(W&&k)h.i.ma(_,h.i.H);else if($.length){var ge=0<=h.a.A($,h.w.M(he[0]));h.a.Zc(he[0],ge),W&&!ge&&h.u.G(h.a.Fb,null,[_,"change"])}}var V=_.multiple,U=_.length!=0&&V?_.scrollTop:null,G=h.a.f(E()),k=w.get("valueAllowUnset")&&w.has("value"),Y=w.get("optionsIncludeDestroyed");E={};var j,$=[];k||(V?$=h.a.Mb(D(),h.w.M):0<=_.selectedIndex&&$.push(h.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),j=h.a.jb(G,function(J){return Y||J===e||J===null||!h.a.f(J._destroy)}),w.has("optionsCaption")&&(G=h.a.f(w.get("optionsCaption")),G!==null&&G!==e&&j.unshift(F)));var W=!1;if(E.beforeRemove=function(J){_.removeChild(J)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(J,he){B(0,he),h.u.G(w.get("optionsAfterRender"),null,[he[0],J!==F?J:e])}),h.a.ec(_,j,function(J,he,ge){return ge.length&&($=!k&&ge[0].selected?[h.w.M(ge[0])]:[],W=!0),he=_.ownerDocument.createElement("option"),J===F?(h.a.Bb(he,w.get("optionsCaption")),h.w.cb(he,e)):(ge=M(J,w.get("optionsValue"),J),h.w.cb(he,h.a.f(ge)),J=M(J,w.get("optionsText"),ge),h.a.Bb(he,J)),[he]},E,G),!k){var K;V?K=$.length&&D().length<$.length:K=$.length&&0<=_.selectedIndex?h.w.M(_.options[_.selectedIndex])!==$[0]:$.length||0<=_.selectedIndex,K&&h.u.G(h.a.Fb,null,[_,"change"])}(k||h.S.Ya())&&h.i.ma(_,h.i.H),h.a.wd(_),U&&20<Math.abs(U-_.scrollTop)&&(_.scrollTop=U)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(_,E,w){function D(){var V=E(),U=[];h.a.D(_.getElementsByTagName("option"),function(G){G.selected&&U.push(h.w.M(G))}),h.m.eb(V,w,"selectedOptions",U)}function M(){var V=h.a.f(E()),U=_.scrollTop;V&&typeof V.length=="number"&&h.a.D(_.getElementsByTagName("option"),function(G){var k=0<=h.a.A(V,h.w.M(G));G.selected!=k&&h.a.Zc(G,k)}),_.scrollTop=U}if(h.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;h.i.subscribe(_,h.i.H,function(){B?D():(h.a.B(_,"change",D),B=h.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(_,E){var w=h.a.f(E()||{});h.a.P(w,function(D,M){if(M=h.a.f(M),(M===null||M===e||M===!1)&&(M=""),o)o(_).css(D,M);else if(/^--/.test(D))_.style.setProperty(D,M);else{D=D.replace(/-(\w)/g,function(V,U){return U.toUpperCase()});var B=_.style[D];_.style[D]=M,M===B||_.style[D]!=B||isNaN(M)||(_.style[D]=M+"px")}})}},h.c.submit={init:function(_,E,w,D,M){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");h.a.B(_,"submit",function(B){var V,U=E();try{V=U.call(M.$data,_)}finally{V!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){h.a.Bb(_,E())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(j){if(j)return parseFloat(j[1])},E=t.navigator.userAgent,w,D,M,B,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(E.match(/Edge\/([^ ]+)$/)))||_(E.match(/Chrome\/([^ ]+)/))||(D=_(E.match(/Version\/([^ ]+) Safari/)))||(M=_(E.match(/Firefox\/([^ ]+)/)))||(B=h.a.W||_(E.match(/MSIE ([^ ]+)/)))||(B=_(E.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var U=h.a.g.Z(),G=h.a.g.Z(),k=function(j){var $=this.activeElement;($=$&&h.a.g.get($,G))&&$(j)},Y=function(j,$){var W=j.ownerDocument;h.a.g.get(W,U)||(h.a.g.set(W,U,!0),h.a.B(W,"selectionchange",k)),h.a.g.set(j,G,$)};h.c.textInput={init:function(j,$,W){function K(we,ze){h.a.B(j,we,ze)}function J(){var we=h.a.f($());(we===null||we===e)&&(we=""),xe!==e&&we===xe?h.a.setTimeout(J,4):j.value!==we&&(Se=!0,j.value=we,Se=!1,se=j.value)}function he(){pe||(xe=j.value,pe=h.a.setTimeout(ge,4))}function ge(){clearTimeout(pe),xe=pe=e;var we=j.value;se!==we&&(se=we,h.m.eb($(),W,"textInput",we))}var se=j.value,pe,xe,De=h.a.W==9?he:ge,Se=!1;B&&K("keypress",ge),11>B&&K("propertychange",function(we){Se||we.propertyName!=="value"||De(we)}),B==8&&(K("keyup",ge),K("keydown",ge)),Y&&(Y(j,De),K("dragend",he)),(!B||9<=B)&&K("input",De),5>D&&h.a.R(j)==="textarea"?(K("keydown",he),K("paste",he),K("cut",he)):11>w?K("keydown",he):4>M?(K("DOMAutoComplete",ge),K("dragdrop",ge),K("drop",ge)):V&&j.type==="number"&&K("keydown",he),K("change",ge),K("blur",ge),h.o(J,null,{l:j})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(j,$,W){W("textInput",j)}}}(),h.c.uniqueName={init:function(_,E){if(E()){var w="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(_,w)}}},h.c.uniqueName.rd=0,h.c.using={init:function(_,E,w,D,M){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),E=M.createChildContext(E,B),h.Oa(E,_),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(_,E,w){var D=h.a.R(_),M=D=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var B=[],V=w.get("valueUpdate"),U=!1,G=null;V&&(typeof V=="string"?B=[V]:B=h.a.wc(V),h.a.Pa(B,"change"));var k=function(){G=null,U=!1;var $=E(),W=h.w.M(_);h.m.eb($,w,"value",W)};!h.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||h.a.A(B,"propertychange")!=-1||(h.a.B(_,"propertychange",function(){U=!0}),h.a.B(_,"focus",function(){U=!1}),h.a.B(_,"blur",function(){U&&k()})),h.a.D(B,function($){var W=k;h.a.Ud($,"after")&&(W=function(){G=h.w.M(_),h.a.setTimeout(k,0)},$=$.substring(5)),h.a.B(_,$,W)});var Y;if(Y=M&&_.type=="file"?function(){var $=h.a.f(E());$===null||$===e||$===""?_.value="":h.u.G(k)}:function(){var $=h.a.f(E()),W=h.w.M(_);G!==null&&$===G?h.a.setTimeout(Y,0):($!==W||W===e)&&(D==="select"?(W=w.get("valueAllowUnset"),h.w.cb(_,$,W),W||$===h.w.M(_)||h.u.G(k)):h.w.cb(_,$))},D==="select"){var j;h.i.subscribe(_,h.i.H,function(){j?w.get("valueAllowUnset")?Y():k():(h.a.B(_,"change",k),j=h.o(Y,null,{l:_}))},null,{notifyImmediately:!0})}else h.a.B(_,"change",k),h.o(Y,null,{l:_})}else h.ib(_,{checkedValue:E})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(_,E){var w=h.a.f(E()),D=_.style.display!="none";w&&!D?_.style.display="":!w&&D&&(_.style.display="none")}},h.c.hidden={update:function(_,E){h.c.visible.update(_,function(){return!h.a.f(E())})}},function(_){h.c[_]={init:function(E,w,D,M,B){return h.c.event.init.call(this,E,function(){var V={};return V[_]=w(),V},D,M,B)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(_,E){if(typeof _=="string"){E=E||n;var w=E.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new h.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new h.C.ia(_);throw Error("Unknown template type: "+_)},h.ca.prototype.renderTemplate=function(_,E,w,D){return _=this.makeTemplateSource(_,D),this.renderTemplateSource(_,E,w,D)},h.ca.prototype.isTemplateRewritten=function(_,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,E).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(_,E,w){_=this.makeTemplateSource(_,w),E=E(_.text()),_.text(E),_.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function _(D,M,B,V){D=h.m.ac(D);for(var U=h.m.Ra,G=0;G<D.length;G++){var k=D[G].key;if(Object.prototype.hasOwnProperty.call(U,k)){var Y=U[k];if(typeof Y=="function"){if(k=Y(D[G].value))throw Error(k)}else if(!Y)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(D,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(B)+M}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(D,M,B){M.isTemplateRewritten(D,B)||M.rewriteTemplate(D,function(V){return h.kc.Ld(V,M)},B)},Ld:function(D,M){return D.replace(E,function(B,V,U,G,k){return _(k,V,U,M)}).replace(w,function(B,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(D,M){return h.aa.Xb(function(B,V){var U=B.nextSibling;U&&U.nodeName.toLowerCase()===M&&h.ib(U,D,V)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(w){if(this.F=w){var D=h.a.R(w);this.ab=D==="script"?1:D==="textarea"?2:D=="template"&&w.content&&w.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var D=arguments[0];w==="innerHTML"?h.a.fc(this.F,D):this.F[w]=D};var _=h.a.g.Z()+"_";h.C.F.prototype.data=function(w){if(arguments.length===1)return h.a.g.get(this.F,_+w);h.a.g.set(this.F,_+w,arguments[1])};var E=h.a.g.Z();h.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var D=h.a.g.get(w,E)||{},M=D.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||D.jd){var B=this.text();B&&B!==D.bb&&(M=h.a.Md(B,w.ownerDocument),h.a.g.set(w,E,{lb:M,bb:B,jd:!0}))}return M}D=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(w,E,{lb:D})},h.C.ia=function(w){this.F=w},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var w=h.a.g.get(this.F,E)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}h.a.g.set(this.F,E,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function _(G,k,Y){var j;for(k=h.h.nextSibling(k);G&&(j=G)!==k;)G=h.h.nextSibling(j),Y(j,G)}function E(G,k){if(G.length){var Y=G[0],j=G[G.length-1],$=Y.parentNode,W=h.ga.instance,K=W.preprocessNode;if(K){if(_(Y,j,function(J,he){var ge=J.previousSibling,se=K.call(W,J);se&&(J===Y&&(Y=se[0]||he),J===j&&(j=se[se.length-1]||ge))}),G.length=0,!Y)return;Y===j?G.push(Y):(G.push(Y,j),h.a.Ua(G,$))}_(Y,j,function(J){J.nodeType!==1&&J.nodeType!==8||h.vc(k,J)}),_(Y,j,function(J){J.nodeType!==1&&J.nodeType!==8||h.aa.cd(J,[k])}),h.a.Ua(G,$)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function D(G,k,Y,j,$){$=$||{};var W=(G&&w(G)||Y||{}).ownerDocument,K=$.templateEngine||B;if(h.kc.xd(Y,K,W),Y=K.renderTemplate(Y,j,$,W),typeof Y.length!="number"||0<Y.length&&typeof Y[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":h.h.va(G,Y),W=!0;break;case"replaceNode":h.a.Xc(G,Y),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(E(Y,j),$.afterRender&&h.u.G($.afterRender,null,[Y,j[$.as||"$data"]]),k=="replaceChildren"&&h.i.ma(G,h.i.H)),Y}function M(G,k,Y){return h.O(G)?G():typeof G=="function"?G(k,Y):G}var B;h.gc=function(G){if(G!=e&&!(G instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},h.dc=function(G,k,Y,j,$){if(Y=Y||{},(Y.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if($=$||"replaceChildren",j){var W=w(j);return h.$(function(){var J=k&&k instanceof h.fa?k:new h.fa(k,null,null,null,{exportDependencies:!0}),K=M(G,J.$data,J),J=D(j,$,K,J,Y);$=="replaceNode"&&(j=J,W=w(j))},null,{Sa:function(){return!W||!h.a.Sb(W)},l:W&&$=="replaceNode"?W.parentNode:W})}return h.aa.Xb(function(K){h.dc(G,k,Y,K,"replaceNode")})},h.Qd=function(G,k,Y,j,$){function W(xe,De){h.u.G(h.a.ec,null,[j,xe,J,Y,K,De]),h.i.ma(j,h.i.H)}function K(xe,De){E(De,he),Y.afterRender&&Y.afterRender(De,xe),he=null}function J(xe,De){he=$.createChildContext(xe,{as:ge,noChildContext:Y.noChildContext,extend:function(we){we.$index=De,ge&&(we[ge+"Index"]=De)}});var Se=M(G,xe,he);return D(j,"ignoreTargetNode",Se,he,Y)}var he,ge=Y.as,se=Y.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!Y.includeDestroyed;if(se||Y.beforeRemove||!h.Pc(k))return h.$(function(){var xe=h.a.f(k)||[];typeof xe.length>"u"&&(xe=[xe]),se&&(xe=h.a.jb(xe,function(De){return De===e||De===null||!h.a.f(De._destroy)})),W(xe)},null,{l:j});W(k.v());var pe=k.subscribe(function(xe){W(k(),xe)},null,"arrayChange");return pe.l(j),pe};var V=h.a.g.Z(),U=h.a.g.Z();h.c.template={init:function(G,k){var Y=h.a.f(k());if(typeof Y=="string"||"name"in Y)h.h.Ea(G);else if("nodes"in Y){if(Y=Y.nodes||[],h.O(Y))throw Error('The "nodes" option must be a plain, non-observable array.');var j=Y[0]&&Y[0].parentNode;j&&h.a.g.get(j,U)||(j=h.a.Yb(Y),h.a.g.set(j,U,!0)),new h.C.ia(G).nodes(j)}else if(Y=h.h.childNodes(G),0<Y.length)j=h.a.Yb(Y),new h.C.ia(G).nodes(j);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,Y,j,$){var W=k();k=h.a.f(W),Y=!0,j=null,typeof k=="string"?k={}:(W="name"in k?k.name:G,"if"in k&&(Y=h.a.f(k.if)),Y&&"ifnot"in k&&(Y=!h.a.f(k.ifnot)),Y&&!W&&(Y=!1)),"foreach"in k?j=h.Qd(W,Y&&k.foreach||[],k,G,$):Y?(Y=$,"data"in k&&(Y=$.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),j=h.dc(W,Y,k,G)):h.h.Ea(G),$=j,(k=h.a.g.get(G,V))&&typeof k.s=="function"&&k.s(),h.a.g.set(G,V,!$||$.ja&&!$.ja()?e:$)}},h.m.Ra.template=function(G){return G=h.m.ac(G),G.length==1&&G[0].unknown||h.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(_,E,w){if(_.length&&E.length){var D,M,B,V,U;for(D=M=0;(!w||D<w)&&(V=_[M]);++M){for(B=0;U=E[B];++B)if(V.value===U.value){V.moved=U.index,U.moved=V.index,E.splice(B,1),D=B=0;break}D+=B}}},h.a.Pb=function(){function _(E,w,D,M,B){var V=Math.min,U=Math.max,G=[],k,Y=E.length,j,$=w.length,W=$-Y||1,K=Y+$+1,J,he,ge;for(k=0;k<=Y;k++)for(he=J,G.push(J=[]),ge=V($,k+W),j=U(0,k-1);j<=ge;j++)J[j]=j?k?E[k-1]===w[j-1]?he[j-1]:V(he[j]||K,J[j-1]||K)+1:j+1:k+1;for(V=[],U=[],W=[],k=Y,j=$;k||j;)$=G[k][j]-1,j&&$===G[k][j-1]?U.push(V[V.length]={status:D,value:w[--j],index:j}):k&&$===G[k-1][j]?W.push(V[V.length]={status:M,value:E[--k],index:k}):(--j,--k,B.sparse||V.push({status:"retained",value:w[j]}));return h.a.Kc(W,U,!B.dontLimitMoves&&10*Y),V.reverse()}return function(E,w,D){return D=typeof D=="boolean"?{dontLimitMoves:D}:D||{},E=E||[],w=w||[],E.length<w.length?_(E,w,"added","deleted",D):_(w,E,"deleted","added",D)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function _(D,M,B,V,U){var G=[],k=h.$(function(){var Y=M(B,U,h.a.Ua(G,D))||[];0<G.length&&(h.a.Xc(G,Y),V&&h.u.G(V,null,[B,Y,U])),G.length=0,h.a.Nb(G,Y)},null,{l:D,Sa:function(){return!h.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var E=h.a.g.Z(),w=h.a.g.Z();h.a.ec=function(D,M,B,V,U,G){function k(zt){Se={Aa:zt,pb:h.ta(he++)},K.push(Se),W||De.push(Se)}function Y(zt){Se=$[zt],he!==Se.pb.v()&&xe.push(Se),Se.pb(he++),h.a.Ua(Se.Y,D),K.push(Se)}function j(zt,Bt){if(zt)for(var be=0,Ee=Bt.length;be<Ee;be++)h.a.D(Bt[be].Y,function(at){zt(at,be,Bt[be].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var $=h.a.g.get(D,E),W=!$,K=[],J=0,he=0,ge=[],se=[],pe=[],xe=[],De=[],Se,we=0;if(W)h.a.D(M,k);else{if(!G||$&&$._countWaitingForRemove){var ze=h.a.Mb($,function(zt){return zt.Aa});G=h.a.Pb(ze,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var ze=0,Oe,ft,Ct;Oe=G[ze];ze++)switch(ft=Oe.moved,Ct=Oe.index,Oe.status){case"deleted":for(;J<Ct;)Y(J++);ft===e&&(Se=$[J],Se.$&&(Se.$.s(),Se.$=e),h.a.Ua(Se.Y,D).length&&(V.beforeRemove&&(K.push(Se),we++,Se.Aa===w?Se=null:pe.push(Se)),Se&&ge.push.apply(ge,Se.Y))),J++;break;case"added":for(;he<Ct;)Y(J++);ft!==e?(se.push(K.length),Y(ft)):k(Oe.value)}for(;he<M.length;)Y(J++);K._countWaitingForRemove=we}h.a.g.set(D,E,K),j(V.beforeMove,xe),h.a.D(ge,V.beforeRemove?h.oa:h.removeNode);var ot,sn,wn;try{wn=D.ownerDocument.activeElement}catch{}if(se.length)for(;(ze=se.shift())!=e;){for(Se=K[ze],ot=e;ze;)if((sn=K[--ze].Y)&&sn.length){ot=sn[sn.length-1];break}for(M=0;J=Se.Y[M];ot=J,M++)h.h.Wb(D,J,ot)}for(ze=0;Se=K[ze];ze++){for(Se.Y||h.a.extend(Se,_(D,B,Se.Aa,U,Se.pb)),M=0;J=Se.Y[M];ot=J,M++)h.h.Wb(D,J,ot);!Se.Ed&&U&&(U(Se.Aa,Se.Y,Se.pb),Se.Ed=!0,ot=Se.Y[Se.Y.length-1])}for(wn&&D.ownerDocument.activeElement!=wn&&wn.focus(),j(V.beforeRemove,pe),ze=0;ze<pe.length;++ze)pe[ze].Aa=w;j(V.afterMove,xe),j(V.afterAdd,De)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(_,E,w,D){return(E=!(9>h.a.W)&&_.nodes?_.nodes():null)?h.a.la(E.cloneNode(!0).childNodes):(_=_.text(),h.a.ua(_,D))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var E=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,D,M,B){if(B=B||n,M=M||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=o.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[D.$data],D=o.extend({koBindingContext:D},M.templateOptions),D=o.tmpl(V,w,D),D.appendTo(B.createElement("div")),o.fragments={},D},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,D){n.write("<script type='text/html' id='"+w+"'>"+D+"<\/script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var _=new h.$a;0<_.Hd&&h.gc(_),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var Hgt=ko;typeof window<"u"?(ko=window.ko,typeof k1<"u"?window.ko=k1:delete window.ko):(ko=global.ko,typeof k1<"u"?global.ko=k1:delete global.ko);var UE=Hgt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Jq="__knockoutObservables",Zq="__knockoutSubscribable";function wAe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=DAe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Jq||r===Zq)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&Pgt(n,a)}}),e}function DAe(e,t){var n=e[Jq];return!n&&t&&(n={},Object.defineProperty(e,Jq,{value:n})),n}function Igt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),wAe.call(i,e,[t]),e}function Pgt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Ogt(e,t,i))})}function Ogt(e,t,n){var i=Rgt(e,n);return i.subscribe(t)}function Rgt(e,t){var n=t[Zq];if(!n){n=new e.subscribable,Object.defineProperty(t,Zq,{value:n});var i={};Mgt(t,n,i),Bgt(e,t,n,i)}return n}function Mgt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function Bgt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function IAe(e,t){if(!e)return null;var n=DAe(e,!1);return n&&n[t]||null}function Lgt(e,t){var n=IAe(e,t);n&&n.valueHasMutated()}function Ngt(e){e.track=wAe,e.getObservable=IAe,e.valueHasMutated=Lgt,e.defineProperty=Igt}var Oz={attachToKo:Ngt};var PAe="http://www.w3.org/2000/svg",OAe="cesium-svgPath-svg",Fgt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(PAe,"svg:svg");i.setAttribute("class",OAe);let r=document.createElementNS(PAe,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${OAe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},Rz=Fgt;Oz.attachToKo(Bb);Rz.register(Bb);var Ce=Bb;function BI(e){l(e)||(e=new Fm),this._clock=e,this._eventHelper=new Mo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(BI.prototype,{clock:{get:function(){return this._clock}}});BI.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};BI.prototype.isDestroyed=function(){return!1};BI.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var Mz=BI;function Ugt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var RAe=Ugt;function Vgt(e,t){t=y(t,!0);let n=new _e,i=new _e;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Ce.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var Sn=Vgt;var LI={};LI.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};LI.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};LI.createRangeInput=function(e,t,n,i,r,o){o=y(o,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(r,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};LI.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var oc=LI;function kgt(e,t,n,i,r){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,r)}var Sa=kgt;function MAe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(MAe.prototype,{command:{get:function(){return this._command}}});var lx=MAe;var ux="http://www.w3.org/2000/svg",NAe="http://www.w3.org/1999/xlink",Bz,NI=z.fromCssColorString("rgba(247,250,255,0.384)"),Lz=z.fromCssColorString("rgba(143,191,255,0.216)"),Qq=z.fromCssColorString("rgba(153,197,255,0.098)"),Nz=z.fromCssColorString("rgba(255,255,255,0.086)"),zgt=z.fromCssColorString("rgba(255,255,255,0.267)"),Hgt=z.fromCssColorString("rgba(255,255,255,0)"),BAe=z.fromCssColorString("rgba(66,67,68,0.3)"),LAe=z.fromCssColorString("rgba(0,0,0,0.5)");function Ly(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var FI={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Xd(e){let t=document.createElementNS(ux,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Xd(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(NAe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function $q(e,t,n){let i=document.createElementNS(ux,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(ux,"tspan");return r.textContent=n,i.appendChild(r),i}function Ggt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Fz=new z;function zo(e,t){let n=t.alpha,i=1-n;return Fz.red=e.red*i+t.red*n,Fz.green=e.green*i+t.green*n,Fz.blue=e.blue*i+t.blue*n,Fz.toCssColorString()}function eX(e,t,n){let i=FI[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Xd(r)}function Wgt(e,t,n){let i=FI[n],r=FI.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Xd(o)}function jgt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&Bz!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(Bz=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===Bz&&(Bz=void 0),n.shuttleRingDragging=!1}function t_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Sa(t,"toggled",this.setToggled,this),Sa(t,"tooltip",this.setTooltip,this),Sa(t.command,"canExecute",this.setEnabled,this)]}t_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};t_.prototype.isDestroyed=function(){return!1};t_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};t_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};t_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function Lb(e,t){e=Mn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(ux,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",NAe);let s=document.createElementNS(ux,"g");this._topG=s,this._realtimeSVG=new t_(Wgt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new t_(eX(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new t_(eX(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new t_(eX(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(ux,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Xd({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=FI.animation_pathSwooshFX,f=FI.animation_pathPointer,d=Xd({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Xd({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Xd({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Xd({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=Xd({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=$q(0,-24,""),this._knobTime=$q(0,-7,""),this._knobStatus=$q(0,-41,"");let A=Xd({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(ux,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(A),o.appendChild(s),e.appendChild(o);let C=this;function T(R){jgt(C,R)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let E=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],w=this._knobStatus.childNodes[0],D;this._subscriptions=[Sa(t.pauseViewModel,"toggled",function(R){D!==R&&(D=R,D?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Sa(t,"shuttleRingAngle",function(R){Ggt(C._shuttleRingPointer,C._knobOuter,R)}),Sa(t,"dateLabel",function(R){S.textContent!==R&&(S.textContent=R)}),Sa(t,"timeLabel",function(R){E.textContent!==R&&(E.textContent=R)}),Sa(t,"multiplierLabel",function(R){w.textContent!==R&&(w.textContent=R)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(Lb.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Lb.prototype.isDestroyed=function(){return!1};Lb.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,r=n.length;i<r;i++)n[i].dispose();return ue(this)};Lb.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};Lb.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Ly(this._themeNormal),n=Ly(this._themeHover),i=Ly(this._themeSelect),r=Ly(this._themeDisabled),o=Ly(this._themeKnob),s=Ly(this._themePointer),a=Ly(this._themeSwoosh),c=Ly(this._themeSwooshHover),u=Xd({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zo(t,NI)},{tagName:"stop",offset:"12%","stop-color":zo(t,Lz)},{tagName:"stop",offset:"46%","stop-color":zo(t,Qq)},{tagName:"stop",offset:"81%","stop-color":zo(t,Nz)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zo(n,NI)},{tagName:"stop",offset:"12%","stop-color":zo(n,Lz)},{tagName:"stop",offset:"46%","stop-color":zo(n,Qq)},{tagName:"stop",offset:"81%","stop-color":zo(n,Nz)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zo(i,NI)},{tagName:"stop",offset:"12%","stop-color":zo(i,Lz)},{tagName:"stop",offset:"46%","stop-color":zo(i,Qq)},{tagName:"stop",offset:"81%","stop-color":zo(i,Nz)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zo(r,zgt)},{tagName:"stop",offset:"75%","stop-color":zo(r,Hgt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":zo(s,LAe)},{tagName:"stop",offset:"100%","stop-color":zo(s,LAe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zo(o,NI)},{tagName:"stop",offset:"60%","stop-color":zo(o,BAe)},{tagName:"stop",offset:"85%","stop-color":zo(o,Lz)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zo(o,BAe)},{tagName:"stop",offset:"60%","stop-color":zo(o,NI)},{tagName:"stop",offset:"85%","stop-color":zo(o,Nz)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Uz=Lb;var Ygt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ny=15,Nb=105;function FAe(e,t){return e-t}function tX(e,t){let n=Or(t,e,FAe);return n<0?~n:n}function qgt(e,t){if(Math.abs(e)<=Ny)return e/Ny;let n=Ny,i=Nb,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function Xgt(e,t,n){if(n.clockStep===gr.SYSTEM_CLOCK)return Ny;if(Math.abs(e)<=1)return e*Ny;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Ny,o=Nb,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function wf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=wf.defaultDateFormatter,this._timeFormatter=wf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(wf.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===gr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return Xgt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,Nb),-Nb);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=gr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===Nb){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=qgt(s,a);if(t.snapToTicks)u=a[tX(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Ny?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===No.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===No.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===No.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new lx(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new lx(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new lx(r,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==gr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Sn(function(){t._clockViewModel.clockStep=gr.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new lx(o,{toggled:Ce.computed(function(){return e.clockStep===gr.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=tX(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=tX(c,a)+1;u<a.length&&(s.multiplier=a[u])})}wf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${Ygt[n.month-1]} ${n.day} ${n.year}`};wf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];wf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};wf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};wf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(FAe);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,o),this._allShuttleRingTicks=s};Object.defineProperties(wf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});wf._maxShuttleRingAngle=Nb;wf._realtimeShuttleRingAngle=Ny;var Vz=wf;function UAe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Ce.getObservable(this,"imageryProviderViewModels"),o=Ce.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;l(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._imageryProviders=o;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let x=d[g],C=x.category;l(p[C])?p[C].push(x):p[C]=[x]}let h=Object.keys(p),A=[];for(g=0;g<h.length;g++){let x=h[g];A.push({name:x,providers:p[x]})}return A});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,h=l(p)?p.name:void 0;return l(g)&&l(h)?`${g} -${h}`:l(g)?g:h}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,A=this._globe.imageryLayers,x=!1;for(p=0;p<h;p++){let C=A.length;for(let T=0;T<C;T++){let E=A.get(T);if(E===g[p]){A.remove(E),x=!0;break}}}if(l(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let T=C.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let E=na.fromProviderAsync(C[p]);A.add(E,0),this._currentImageryLayers.push(E)}}else{this._currentImageryLayers=[];let T=na.fromProviderAsync(C);if(T.name=d.name,x)A.add(T,0);else{let E=A.get(0);l(E)&&A.remove(E),A.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),x=new Ez(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,x()}});u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(UAe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var kz=UAe;function zz(e,t){e=Mn(e);let n=new kz(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",o.appendChild(h);let A=document.createElement("div");A.className="cesium-baseLayerPicker-section",A.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(A);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",A.appendChild(x);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),x.appendChild(C);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),x.appendChild(T);let E=document.createElement("div");E.className="cesium-baseLayerPicker-item",E.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(E);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),E.appendChild(S);let w=document.createElement("div");w.className="cesium-baseLayerPicker-itemLabel",w.setAttribute("data-bind","text: name"),E.appendChild(w),Ce.applyBindings(n,i),Ce.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(D){i.contains(D.target)||o.contains(D.target)||(n.dropDownVisible=!1)},jt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(zz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zz.prototype.isDestroyed=function(){return!1};zz.prototype.destroy=function(){return jt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Hz=zz;function VAe(e){let t=e.creationFunction;l(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(VAe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Ds=VAe;function Kgt(){let e=[];return e.push(new Ds({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ty({style:uh.AERIAL})}})),e.push(new Ds({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ty({style:uh.AERIAL_WITH_LABELS})}})),e.push(new Ds({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ty({style:uh.ROAD})}})),e.push(new Ds({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ah.SATELLITE,{enablePickFeatures:!1})}})),e.push(new Ds({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ah.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new Ds({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ah.OCEANS,{enablePickFeatures:!1})}})),e.push(new Ds({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new xb({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new Ds({name:"Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new xb({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ds({name:"Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. -http://maps.stamen.com`,category:"Other",creationFunction:function(){return new xb({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ds({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Hd.fromAssetId(3954)}})),e.push(new Ds({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Hd.fromAssetId(3845)}})),e.push(new Ds({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Hd.fromAssetId(3812)}})),e.push(new Ds({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Yp.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var Gz=Kgt;function Jgt(){let e=[];return e.push(new Ds({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new qE}})),e.push(new Ds({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return GE({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var Wz=Jgt;function Zgt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ga&&(e.tileset=n.primitive),e.pickActive=!1}}function zAe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ga&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var Qgt={maximumFractionDigits:3};function UI(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Qgt):Math.round(t).toLocaleString()}function VI(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Nr.PICK]:e._statisticsPerPass[Nr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${UI(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${UI(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${UI(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function HAe(){let e=Fi.statistics;return` + */var oX="__knockoutObservables",rX="__knockoutSubscribable";function Gxe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Wxe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===oX||o===rX)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&Wgt(n,a)}}),e}function Wxe(e,t){var n=e[oX];return!n&&t&&(n={},Object.defineProperty(e,oX,{value:n})),n}function Ggt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),Gxe.call(i,e,[t]),e}function Wgt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=jgt(e,t,i))})}function jgt(e,t,n){var i=qgt(e,n);return i.subscribe(t)}function qgt(e,t){var n=t[rX];if(!n){n=new e.subscribable,Object.defineProperty(t,rX,{value:n});var i={};Ygt(t,n,i),Xgt(e,t,n,i)}return n}function Ygt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function Xgt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function jxe(e,t){if(!e)return null;var n=Wxe(e,!1);return n&&n[t]||null}function Kgt(e,t){var n=jxe(e,t);n&&n.valueHasMutated()}function Jgt(e){e.track=Gxe,e.getObservable=jxe,e.valueHasMutated=Kgt,e.defineProperty=Ggt}var H4={attachToKo:Jgt};var qxe="http://www.w3.org/2000/svg",Yxe="cesium-svgPath-svg",Zgt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(qxe,"svg:svg");i.setAttribute("class",Yxe);let o=document.createElementNS(qxe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${Yxe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},G4=Zgt;H4.attachToKo(UE);G4.register(UE);var Ce=UE;function U1(e){l(e)||(e=new Bm),this._clock=e,this._eventHelper=new Mr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(U1.prototype,{clock:{get:function(){return this._clock}}});U1.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};U1.prototype.isDestroyed=function(){return!1};U1.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var W4=U1;function $gt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var Xxe=$gt;function Qgt(e,t){t=y(t,!0);let n=new _e,i=new _e;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ce.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var vn=Qgt;var V1={};V1.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};V1.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};V1.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};V1.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var rc=V1;function eyt(e,t,n,i,o){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,o)}var wa=eyt;function Kxe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(Kxe.prototype,{command:{get:function(){return this._command}}});var fb=Kxe;function Jxe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ce.getObservable(this,"imageryProviderViewModels"),r=Ce.pureComputed(function(){let d=o(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let b=d[g],C=b.category;l(p[C])?p[C].push(b):p[C]=[b]}let h=Object.keys(p),x=[];for(g=0;g<h.length;g++){let b=h[g];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,h=l(p)?p.name:void 0;return l(g)&&l(h)?`${g} +${h}`:l(g)?g:h}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,h=g.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<h;p++){let C=x.length;for(let T=0;T<C;T++){let A=x.get(T);if(A===g[p]){x.remove(A),b=!0;break}}}if(l(d))if(e.map&&d.marsOptions)e.map.basemap=d.marsOptions.layerId;else{let C=d.creationCommand();if(Array.isArray(C)){let T=C.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let A=na.fromProviderAsync(C[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let T=na.fromProviderAsync(C);if(T.name=d.name,b)x.add(T,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand());let g=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,h()}),b=new F4(Promise.resolve(p)).readyEvent.addEventListener(C=>{if(!g){if(e.map&&d.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,b()}});u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=vn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(Jxe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var j4=Jxe;function q4(e,t){e=Mn(e);let n=new j4(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",r.appendChild(h);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),b.appendChild(C);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),b.appendChild(T);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(A);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),A.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),Ce.applyBindings(n,i),Ce.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(q4.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});q4.prototype.isDestroyed=function(){return!1};q4.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Y4=q4;function Zxe(e){let t=e.creationFunction;l(t.canExecute)||(t=vn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this.marsOptions=e.marsOptions,Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Zxe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Ps=Zxe;function tyt(){let e=[];return e.push(new Ps({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ay({style:uh.AERIAL})}})),e.push(new Ps({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ay({style:uh.AERIAL_WITH_LABELS})}})),e.push(new Ps({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ay({style:uh.ROAD})}})),e.push(new Ps({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ch.SATELLITE,{enablePickFeatures:!1})}})),e.push(new Ps({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ch.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new Ps({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Hp.fromBasemapType(ch.OCEANS,{enablePickFeatures:!1})}})),e.push(new Ps({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new LE({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new Ps({name:"Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new LE({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ps({name:"Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. +http://maps.stamen.com`,category:"Other",creationFunction:function(){return new LE({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Ps({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Vd.fromAssetId(3954)}})),e.push(new Ps({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Vd.fromAssetId(3845)}})),e.push(new Ps({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Vd.fromAssetId(3812)}})),e.push(new Ps({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Gp.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var X4=tyt;function nyt(){let e=[];return e.push(new Ps({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new YA}})),e.push(new Ps({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return GA({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var K4=nyt;var db="http://www.w3.org/2000/svg",ebe="http://www.w3.org/1999/xlink",J4,z1=z.fromCssColorString("rgba(247,250,255,0.384)"),Z4=z.fromCssColorString("rgba(143,191,255,0.216)"),sX=z.fromCssColorString("rgba(153,197,255,0.098)"),$4=z.fromCssColorString("rgba(255,255,255,0.086)"),iyt=z.fromCssColorString("rgba(255,255,255,0.267)"),oyt=z.fromCssColorString("rgba(255,255,255,0)"),$xe=z.fromCssColorString("rgba(66,67,68,0.3)"),Qxe=z.fromCssColorString("rgba(0,0,0,0.5)");function By(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var H1={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Xd(e){let t=document.createElementNS(db,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(Xd(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(ebe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function aX(e,t,n){let i=document.createElementNS(db,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(db,"tspan");return o.textContent=n,i.appendChild(o),i}function ryt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Q4=new z;function Vr(e,t){let n=t.alpha,i=1-n;return Q4.red=e.red*i+t.red*n,Q4.green=e.green*i+t.green*n,Q4.blue=e.blue*i+t.blue*n,Q4.toCssColorString()}function cX(e,t,n){let i=H1[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Xd(o)}function syt(e,t,n){let i=H1[n],o=H1.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Xd(r)}function ayt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&J4!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let h=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(J4=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<h?n.slower():g>h&&n.faster(),t.preventDefault()}else e===J4&&(J4=void 0),n.shuttleRingDragging=!1}function n_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[wa(t,"toggled",this.setToggled,this),wa(t,"tooltip",this.setTooltip,this),wa(t.command,"canExecute",this.setEnabled,this)]}n_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};n_.prototype.isDestroyed=function(){return!1};n_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};n_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};n_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function VE(e,t){e=Mn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(db,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",ebe);let s=document.createElementNS(db,"g");this._topG=s,this._realtimeSVG=new n_(syt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new n_(cX(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new n_(cX(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new n_(cX(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(db,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Xd({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=H1.animation_pathSwooshFX,f=H1.animation_pathPointer,d=Xd({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Xd({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Xd({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Xd({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,h=Xd({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=aX(0,-24,""),this._knobTime=aX(0,-7,""),this._knobStatus=aX(0,-41,"");let x=Xd({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(db,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function T(O){ayt(C,O)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let A=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],I;this._subscriptions=[wa(t.pauseViewModel,"toggled",function(O){I!==O&&(I=O,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),wa(t,"shuttleRingAngle",function(O){ryt(C._shuttleRingPointer,C._knobOuter,O)}),wa(t,"dateLabel",function(O){S.textContent!==O&&(S.textContent=O)}),wa(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),wa(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(VE.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VE.prototype.isDestroyed=function(){return!1};VE.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};VE.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};VE.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=By(this._themeNormal),n=By(this._themeHover),i=By(this._themeSelect),o=By(this._themeDisabled),r=By(this._themeKnob),s=By(this._themePointer),a=By(this._themeSwoosh),c=By(this._themeSwooshHover),u=Xd({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Vr(t,z1)},{tagName:"stop",offset:"12%","stop-color":Vr(t,Z4)},{tagName:"stop",offset:"46%","stop-color":Vr(t,sX)},{tagName:"stop",offset:"81%","stop-color":Vr(t,$4)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Vr(n,z1)},{tagName:"stop",offset:"12%","stop-color":Vr(n,Z4)},{tagName:"stop",offset:"46%","stop-color":Vr(n,sX)},{tagName:"stop",offset:"81%","stop-color":Vr(n,$4)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Vr(i,z1)},{tagName:"stop",offset:"12%","stop-color":Vr(i,Z4)},{tagName:"stop",offset:"46%","stop-color":Vr(i,sX)},{tagName:"stop",offset:"81%","stop-color":Vr(i,$4)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Vr(o,iyt)},{tagName:"stop",offset:"75%","stop-color":Vr(o,oyt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Vr(s,Qxe)},{tagName:"stop",offset:"100%","stop-color":Vr(s,Qxe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Vr(r,z1)},{tagName:"stop",offset:"60%","stop-color":Vr(r,$xe)},{tagName:"stop",offset:"85%","stop-color":Vr(r,Z4)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Vr(r,$xe)},{tagName:"stop",offset:"60%","stop-color":Vr(r,z1)},{tagName:"stop",offset:"85%","stop-color":Vr(r,$4)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var eH=VE;var cyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ky=15,zE=105;function tbe(e,t){return e-t}function lX(e,t){let n=Oo(t,e,tbe);return n<0?~n:n}function lyt(e,t){if(Math.abs(e)<=ky)return e/ky;let n=ky,i=zE,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function uyt(e,t,n){if(n.clockStep===xo.SYSTEM_CLOCK)return ky;if(Math.abs(e)<=1)return e*ky;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=ky,r=zE,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function wf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=wf.defaultDateFormatter,this._timeFormatter=wf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(wf.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===xo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return uyt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,zE),-zE);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===zE){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=lyt(s,a);if(t.snapToTicks)u=a[lX(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>ky?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Fr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===Fr.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Fr.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=vn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new fb(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=vn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new fb(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=vn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new fb(o,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==xo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=vn(function(){t._clockViewModel.clockStep=xo.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new fb(r,{toggled:Ce.computed(function(){return e.clockStep===xo.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=vn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=lX(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=vn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=lX(c,a)+1;u<a.length&&(s.multiplier=a[u])})}wf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${cyt[n.month-1]} ${n.day} ${n.year}`};wf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];wf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};wf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};wf.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(tbe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(wf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});wf._maxShuttleRingAngle=zE;wf._realtimeShuttleRingAngle=ky;var tH=wf;function fyt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ws&&(e.tileset=n.primitive),e.pickActive=!1}}function ibe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ws&&(e.tileset=i.primitive)},Tn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Tn.MOUSE_MOVE),e.picking=e.picking)}var dyt={maximumFractionDigits:3};function G1(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,dyt):Math.round(t).toLocaleString()}function W1(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Fo.PICK]:e._statisticsPerPass[Fo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${G1(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${G1(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${G1(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function obe(){let e=ki.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${UI(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${UI(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${G1(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${G1(e.texturesByteLength)}</li> </ul> - `}var $gt=[{text:"Highlight",value:Vl.HIGHLIGHT},{text:"Replace",value:Vl.REPLACE},{text:"Mix",value:Vl.MIX}],kAe=new z(1,1,0,.4),eyt=new z,jz=new z;function ra(e,t){let n=this,i=e.canvas;this._eventHandler=new gf(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new Dy({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let U=[],q=n._properties();for(let Y in q)q.hasOwnProperty(Y)&&U.push(Y);return U});let r=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(U){r(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let o=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(U){o(U),l(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Vl.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let Y=e.pick(q.endPosition);if(Y instanceof Us?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(Y)&&l(Y.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(q.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),l(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),l(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(U){d(U),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),l(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),l(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let A=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return A()},set:function(U){A(U),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(U){x(U),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),l(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let T=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(U){U=Number(U),isNaN(U)||(T(U),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let E=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(E(),1/6)},set:function(U){E(Math.pow(U,6))}});let S=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=4;let w=Zgt(this),D=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return D()},set:function(U){D(U),U?n._eventHandler.setInputAction(w,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let R=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return R()},set:function(U){R(U),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let O=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(U){U=Number(U),isNaN(U)||(O(U),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let N=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let b=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return b()},set:function(U){U=Number(U),isNaN(U)||(b(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let v=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(U){U=Number(U),isNaN(U)||(v(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),l(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let M=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(U){U=Number(U),isNaN(U)||(M(U),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let F=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),l(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let k=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),l(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(U){G(U),l(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||zAe(this,!0)}Object.defineProperties(ra.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return $gt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e._readyPromise.then(function(o){t.isDestroyed()||t._properties(o.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let o=0;o<i;++o){let s=n[o];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=VI(e,!1),this._pickStatisticsText=VI(e,!0),this._resourceCacheStatisticsText=HAe(),zAe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,eyt):z.WHITE:t.color=jz,this._scene.requestRender()),l(e)&&(z.clone(e.color,jz),e.color=kAe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!nX(t.content)&&(t.color=jz,this._scene.requestRender()),l(e)&&!nX(e.content)&&(z.clone(e.color,jz),e.color=kAe,this._scene.requestRender()),this._tile=e}}});function nX(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!nX(t[i]))return!1;return!0}return!1}ra.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ra.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ra.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ra.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ra.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ra.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ra.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ra.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ra.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ra.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ra.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new Cy(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ra.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ra.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=VI(e,!1),this._pickStatisticsText=VI(e,!0),this._resourceCacheStatisticsText=HAe())};ra.prototype.isDestroyed=function(){return!1};ra.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};ra.getStatistics=VI;var Yz=ra;function qz(e,t){e=Mn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new Yz(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=oc.createSection,c=oc.createCheckbox,u=oc.createRangeInput,f=oc.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),A=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let E=document.createElement("label");E.className="field-label",E.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),T.appendChild(E),T.appendChild(S),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let w=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",w.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let R=document.createElement("div");R.setAttribute("data-bind","visible: pointCloudShading"),R.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),R.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),R.appendChild(u("Base Resolution","baseResolution",0,1,.01)),R.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(R);let O=document.createElement("div");O.setAttribute("data-bind","visible: eyeDomeLighting"),O.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),O.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),R.appendChild(O),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(N),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(b),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(v);let I=document.createElement("div");x.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let k=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(k);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),A.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),A.appendChild(c("Geometric Error","showGeometricError")),A.appendChild(c("Rendering Statistics","showRenderingStatistics")),A.appendChild(c("Memory Usage (MB)","showMemoryUsage")),A.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(q),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(r,n)}Object.defineProperties(qz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qz.prototype.isDestroyed=function(){return!1};qz.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var Xz=qz;function tyt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function iX(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var nyt=new On,iyt=new m;function kI(e,t){let n=this,i=e.canvas,r=new gf(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new Dy({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new rk({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=iX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=iX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new bz({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Sn(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,nyt),g=o.pick(p,n._scene,iyt);if(l(g)){let h=d.cartesianToCartographic(g),A=o._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!f&&x<A.length;++x){let C=A[x];if(l(C))for(let T=0;!f&&T<C.length;++T){let E=C[T];ce.contains(E.rectangle,h)&&(f=E)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,Cn.LEFT_CLICK):r.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(kI.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});kI.prototype._update=function(){this.frustums&&(this.frustumStatisticText=tyt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=iX(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};kI.prototype.isDestroyed=function(){return!1};kI.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var Kz=kI;function Jz(e,t){e=Mn(e);let n=document.createElement("div"),i=new Kz(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=oc.createSection,c=oc.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(A);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(x);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",T.appendChild(E);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let w=document.createElement("div");w.className="cesium-cesiumInspector-center",w.appendChild(S),E.appendChild(w),E.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),E.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),E.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",D.appendChild(R);let O=document.createElement("input");O.type="button",O.value="Pick a tile",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),w=document.createElement("div"),w.appendChild(O),w.className="cesium-cesiumInspector-center",R.appendChild(w);let L=document.createElement("div");R.appendChild(L);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let b=document.createElement("input");b.type="button",b.value="NE",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(M),L.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",L.appendChild(F);let k=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),U=document.createElement("td");U.appendChild(N);let q=document.createElement("td");q.appendChild(_);let Y=document.createElement("td");Y.appendChild(b),V.appendChild(U),V.appendChild(q),V.appendChild(Y);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(v);let K=document.createElement("td");K.appendChild(I),G.appendChild(Q),G.appendChild(W),G.appendChild(K),k.appendChild(V),k.appendChild(G),L.appendChild(k),R.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),R.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(Jz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Jz.prototype.isDestroyed=function(){return!1};Jz.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var Zz=Jz;function Qz(e,t){l(t)||(t=document.body),t=Mn(t);let n=this,i=Ce.observable(yo.fullscreen),r=Ce.observable(yo.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&yo.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){yo.fullscreen?yo.exitFullscreen():yo.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Mn(e),o.body),this._callback=function(){i(yo.fullscreen)},o.addEventListener(yo.changeEventName,this._callback)}Object.defineProperties(Qz.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});Qz.prototype.isDestroyed=function(){return!1};Qz.prototype.destroy=function(){document.removeEventListener(yo.changeEventName,this._callback),ue(this)};var $z=Qz;var ryt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",oyt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function eH(e,t){e=Mn(e);let n=new $z(t,e);n._exitFullScreenPath=oyt,n._enterFullScreenPath=ryt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(eH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eH.prototype.isDestroyed=function(){return!1};eH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var tH=eH;function GAe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(GAe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var nH=GAe;function iH(e,t,n){e=Mn(e);let i=new nH(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Ce.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(iH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});iH.prototype.isDestroyed=function(){return!1};iH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var rH=iH;var WAe=1e3;function Df(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new IU,new qU({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=YAe,this._handleArrowUp=jAe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let r=Ce.getObservable(t,"_suggestions")().length>0,o=Ce.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=Sn(function(i){if(i=y(i,PA.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)fyt(t);else return lyt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?jAe(t):o?YAe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;KAe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Df.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Df._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Df.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Df.prototype.destroy=function(){this._suggestionSubscription.dispose()};function jAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Df._adjustSuggestionsScroll(e,n)}function YAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Df._adjustSuggestionsScroll(e,i)}function syt(e,t){let n=l(t)?t.availability:void 0;return l(n)?kg(t,[e]).then(function(i){return e=i[0],e.height+=WAe,e}):(e.height+=WAe,Promise.resolve(e))}function ayt(e,t){let n=e._scene,r=n.mapProjection.ellipsoid,o=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ce.center(t):c=ob(t,n):t=r.cartesianToCartographic(t),l(c)||(c=syt(t,s)),c.then(function(u){a=r.cartographicToCartesian(u)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:B.IDENTITY})})}async function cyt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function lyt(e,t,n){let i=e._searchText;if(XAe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await cyt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,oX(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=qAe(e,dD.getCreditsFromResult(s[0]));l(a)||rX(e,t[r].credit);return}e._searchText=`${i} (not found)`}function rX(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function qAe(e,t){return l(t)&&t.forEach(n=>rX(e,n)),t}function oX(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function uyt(e,t){let n=Mn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function fyt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function XAe(e){return/^\s*$/.test(e)}function KAe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function dyt(e){if(!e.autoComplete)return;let t=e._searchText;if(KAe(e),oX(e),!XAe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,PA.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=dD.getCreditsFromResult(o);r=r&&!l(s),qAe(e,s)}),r&&rX(e,n.credit)}if(e._suggestions.length>=5)return}}Df.flyToDestination=ayt;Df._updateSearchSuggestions=dyt;Df._adjustSuggestionsScroll=uyt;Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){return oX(this),ue(this)};var oH=Df;var myt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",hyt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function sH(e){let t=Mn(e.container),n=new oH(e);n._startSearchPath=myt,n._stopSearchPath=hyt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},jt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(sH.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});sH.prototype.isDestroyed=function(){return!1};sH.prototype.destroy=function(){let e=this._container;return jt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var aH=sH;function JAe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(JAe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var cH=JAe;function lH(e){let t=Mn(e.container),n=new cH,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ce.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},jt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(lH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lH.prototype.isDestroyed=function(){return!1};lH.prototype.destroy=function(){return jt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var uH=lH;var pyt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",_yt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function sX(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?_yt:pyt}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}sX.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(sX.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var fH=sX;function dH(e){e=Mn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let s=new fH;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=o,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;o.addEventListener("load",function(){let c=o.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Sa(s,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let A=window.getComputedStyle(g);if(A!==null){let x=A["background-color"],C=z.fromCssColorString(x);l(C)&&C.alpha!==0&&(p=A["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;o.style.height=`${h}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties(dH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});dH.prototype.isDestroyed=function(){return!1};dH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var mH=dH;function hH(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Sn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Mo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===ne.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(hH.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});hH.prototype.isDestroyed=function(){return!1};hH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var pH=hH;var gyt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",yyt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function _H(e,t){e=Mn(e);let n=new pH(t);n._perspectivePath=gyt,n._orthographicPath=yyt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},jt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(_H.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_H.prototype.isDestroyed=function(){return!1};_H.prototype.destroy=function(){return this._viewModel.destroy(),jt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var gH=_H;function aX(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=gk.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(aX.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});aX.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var yH=aX;function AH(e){let t=Mn(e.container),n=new yH(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(AH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});AH.prototype.isDestroyed=function(){return!1};AH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var xH=AH;function CH(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Mo,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===ne.SCENE2D?n.tooltip2D:r===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(CH.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});CH.prototype.isDestroyed=function(){return!1};CH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var TH=CH;var Ayt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",xyt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Cyt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function EH(e,t,n){e=Mn(e);let i=new TH(t,n);i._globePath=Ayt,i._flatMapPath=xyt,i._columbusViewPath=Cyt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),Ce.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},jt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(EH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EH.prototype.isDestroyed=function(){return!1};EH.prototype.destroy=function(){return this._viewModel.destroy(),jt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var bH=EH;var Tyt=new H,SH="-1000px";function zI(e,t,n){this._scene=e,this._screenPositionX=SH,this._screenPositionY=SH,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return Zi.wgs84ToWindowCoordinates(e,i,r)}}zI.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Tyt);if(!l(e))this._screenPositionX=SH,this._screenPositionY=SH;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};zI.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Fo.EXPONENTIAL_OUT})};zI.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Fo.EXPONENTIAL_OUT})};Object.defineProperties(zI.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var vH=zI;function wH(e,t){e=Mn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new vH(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(wH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wH.prototype.isDestroyed=function(){return!1};wH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),ue(this)};var DH=wH;function fx(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}fx.prototype.getHeight=function(){return this._height};fx.prototype.getBase=function(){return this._base};fx.prototype.getStartTime=function(){return this._start};fx.prototype.getStopTime=function(){return this._stop};fx.prototype.setRange=function(e,t){this._start=e,this._stop=t};fx.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=ee.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var IH=fx;function ZAe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}ZAe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,r)&&ee.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,o)&&ee.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var PH=ZAe;var cX=1e12,If={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Fc={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Fy=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Eyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Uc(e,t){e=Mn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=If.none,this._touchMode=Fc.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=byt(this),this._onMouseUp=Syt(this),this._onMouseMove=vyt(this),this._onMouseWheel=wyt(this),this._onTouchStart=Dyt(this),this._onTouchMove=Pyt(this),this._onTouchEnd=Iyt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Uc.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Uc.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Uc.prototype.isDestroyed=function(){return!1};Uc.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Uc.prototype.addHighlightRange=function(e,t,n){let i=new IH(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Uc.prototype.addTrack=function(e,t,n,i){let r=new PH(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Uc.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==No.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=ee.secondsDifference(r,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=r,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Uc.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function lX(e){return e<10?`0${e.toString()}`:e.toString()}Uc.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Eyt[t.month-1]} ${t.day} ${t.year} ${lX(t.hour)}:${lX(t.minute)}:${lX(t.second)}${i}`};Uc.prototype.smallestTicInPixels=7;Uc.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),A,x=ee.toGregorianDate(g);d>31536e4?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):d>31536e3?A=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):d>86400?A=ee.fromDate(new Date(Date.UTC(x.year,0))):A=ee.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(A,h,new ee)),T=C+d;this._epochJulian=A;function E(U){return Math.floor(C/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function w(U){return(U-C)/d}function D(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let R=this._rulerEle.offsetWidth+20;R<30&&(R=180);let O=f;f-=u;let L={startTime:C,startJulian:g,epochJulian:A,duration:d,timeBarWidth:p,getAlpha:w};this._highlightRanges.forEach(function(U){s+=U.render(L)});let N=0,_=0,b=0,v=R/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,M=-1,F=Fy.length,k;for(k=0;k<F;++k){let U=Fy[k];if(++I,N=U,U>v&&U>f)break;M<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(N,Fy[I]))<1e-5){Fy[I]>=f&&(_=Fy[I]);break}if(M>=0)for(;M<I;){if(Math.abs(D(_,Fy[M]))<1e-5&&Fy[M]>=f){b=Fy[M];break}++M}}f=O,f>u&&b<1e-5&&Math.abs(f-N)>u&&(b=f,f<=N+u&&(_=0));let V=-999999,G;if(p*(b/this._timeBarSecondsSpan)>=3)for(r=E(b);r<=T;r=S(r,b))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=E(_);r<=T;r=S(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,T+=N,r=E(N);let U=ee.computeTaiMinusUtc(A);for(;r<=T;){let q=ee.addSeconds(g,r-C,new ee);if(N>2.1){let K=ee.computeTaiMinusUtc(q);Math.abs(K-U)>.1&&(r+=K-U,q=ee.addSeconds(g,r-C,new ee))}let Y=Math.round(p*w(r)),Q=this.makeLabel(q);this._rulerEle.innerHTML=Q,G=this._rulerEle.offsetWidth,G<10&&(G=R);let W=Y-(G/2-1);W>V?(V=W+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,r=S(r,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),L.y=0,this._trackList.forEach(function(U){U.render(o._context,L),L.y+=U.height})};Uc.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};Uc.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function byt(e){return function(t){e._mouseMode!==If.touchOnly&&(t.button===0?(e._mouseMode=If.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=If.zoom:e._mouseMode=If.slide)),t.preventDefault()}}function Syt(e){return function(t){e._mouseMode=If.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function vyt(e){return function(t){let n;if(e._mouseMode===If.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===If.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===If.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function wyt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;cX=Math.max(Math.min(Math.abs(n),cX),1),n/=cX,e.zoomFrom(Math.pow(1.05,-n))}}function Dyt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=If.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Fc.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Fc.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Fc.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Fc.ignore}}function Iyt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Fc.singleTap?(e._touchMode=Fc.scrub,e._onTouchMove(t)):e._touchMode===Fc.scrub&&e._onTouchMove(t),e._mouseMode=If.touchOnly,n!==1?e._touchMode=n>0?Fc.ignore:Fc.none:e._touchMode===Fc.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function Pyt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Fc.singleTap&&(e._touchMode=Fc.slideZoom),e._mouseMode=If.touchOnly,e._touchMode===Fc.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Fc.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-o,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=o,e._touchState.spanX=s))}}Uc.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var OH=Uc;var nxe=co(txe(),1);function Myt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ixe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Byt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ixe(),e._locked=!1),e._noSleep.disable(),yo.exitFullscreen(),n(!1)):(yo.fullscreen||yo.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Myt("landscape")),t.useWebVR=!0,n(!0)))}function RH(e,t){let n=this,i=Ce.observable(yo.enabled),r=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&yo.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Mo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new nxe.default,this._command=Sn(function(){Byt(n,e,r,o)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(Mn(t),document.body),this._callback=function(){!yo.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(ixe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(yo.changeEventName,this._callback)}Object.defineProperties(RH.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});RH.prototype.isDestroyed=function(){return!1};RH.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(yo.changeEventName,this._callback),ue(this)};var MH=RH;var Lyt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",Nyt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function BH(e,t,n){e=Mn(e);let i=new MH(t,n);i._exitVRPath=Nyt,i._enterVRPath=Lyt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),Ce.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(BH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BH.prototype.isDestroyed=function(){return!1};BH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var LH=BH;var Uy=new ae;function sxe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Fyt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function Uyt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function rxe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof no)return i;if(n instanceof Us)return new no({name:Uyt(n),description:Fyt(n),feature:n})}if(l(e.scene.globe))return zyt(e,t.position)}var Vyt=new ee;function axe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let r=i.startTime,o=i.stopTime;ee.equals(r,o)&&(o=ee.addSeconds(r,P.EPSILON2,Vyt)),e.updateFromClock(),e.zoomTo(r,o)}}}var kyt=new m;function zyt(e,t){let n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(r))return;let o=new no({id:"Loading...",description:"Loading feature information..."});return r.then(function(s){if(e.selectedEntity!==o)return;if(!l(s)||s.length===0){e.selectedEntity=oxe();return}let a=s[0],c=new no({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,kyt);c.position=new Jc(u)}e.selectedEntity=c},function(){e.selectedEntity===o&&(e.selectedEntity=oxe())}),o}function oxe(){return new no({id:"None",description:"No features found."})}function Hyt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function wi(e,t){e=Mn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Fm,u=new Mz(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new Pz(o,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new u2,g=!0);let h=d.scene,A=new $2({scene:h,dataSourceCollection:p}),x=new Mo;x.add(c.onTick,wi.prototype._onTick,this),x.add(h.morphStart,wi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(Y),C=new DH(Y,h)}let T;if(!l(t.infoBox)||t.infoBox!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-infoBoxContainer",r.appendChild(Y),T=new mH(Y);let Q=T.viewModel;x.add(Q.cameraClicked,wi.prototype._onInfoBoxCameraClicked,this),x.add(Q.closeClicked,wi.prototype._onInfoBoxClockClicked,this)}let E=document.createElement("div");E.className="cesium-viewer-toolbar",r.appendChild(E);let S;if(!l(t.geocoder)||t.geocoder!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-geocoderContainer",E.appendChild(Y);let Q;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new aH({container:Y,geocoderServices:Q,scene:h}),x.add(S.viewModel.search.beforeExecute,wi.prototype._clearObjects,this)}let w;(!l(t.homeButton)||t.homeButton!==!1)&&(w=new rH(E,h),l(S)&&x.add(w.viewModel.command.afterExecute,function(){let Y=S.viewModel;Y.searchText="",Y.isSearchInProgress&&Y.search()}),x.add(w.viewModel.command.beforeExecute,wi.prototype._clearTrackedObject,this));let D;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(D=new bH(E,h));let R;t.projectionPicker&&(R=new gH(E,h));let O,L;if(n){let Y=y(t.imageryProviderViewModels,Gz()),Q=y(t.terrainProviderViewModels,Wz());O=new Hz(E,{globe:h.globe,imageryProviderViewModels:Y,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),L=E.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&($("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(O.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(O.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(O.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let N;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let Y=!0;try{if(l(window.localStorage)){let Q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Q)&&Q?Y=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}N=new uH({container:E,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,Y)})}let _;if(!l(t.animation)||t.animation!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-animationContainer",r.appendChild(Y),_=new Uz(Y,new Vz(u))}let b;if(!l(t.timeline)||t.timeline!==!1){let Y=document.createElement("div");Y.className="cesium-viewer-timelineContainer",r.appendChild(Y),b=new OH(Y,c),b.addEventListener("settime",sxe,!1),b.zoomTo(c.startTime,c.stopTime)}let v,I,M;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",r.appendChild(M),v=new tH(M,t.fullscreenElement),I=Sa(v.viewModel,"isFullscreenEnabled",function(Y){M.style.display=Y?"block":"none",l(b)&&(b.container.style.right=`${M.clientWidth}px`,b.resize())}));let F,k,V;if(t.vrButton){let Y=document.createElement("div");Y.className="cesium-viewer-vrContainer",r.appendChild(Y),F=new LH(Y,h,t.fullScreenElement),k=Sa(F.viewModel,"isVREnabled",function(Q){Y.style.display=Q?"block":"none",l(v)&&(Y.style.right=`${M.clientWidth}px`),l(b)&&(b.container.style.right=`${Y.clientWidth}px`,b.resize())}),V=Sa(F.viewModel,"isVRMode",function(Q){Hyt(i,Q)})}this._baseLayerPickerDropDown=L,this._fullscreenSubscription=I,this._vrSubscription=k,this._vrModeSubscription=V,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=T,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=A,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=E,this._homeButton=w,this._sceneModePicker=D,this._projectionPicker=R,this._baseLayerPicker=O,this._navigationHelpButton=N,this._animation=_,this._timeline=b,this._fullscreenButton=v,this._vrButton=F,this._geocoder=S,this._eventHelper=x,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(T)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new _e,this._trackedEntityChanged=new _e,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),x.add(p.dataSourceAdded,wi.prototype._onDataSourceAdded,this),x.add(p.dataSourceRemoved,wi.prototype._onDataSourceRemoved,this),x.add(h.postUpdate,wi.prototype.resize,this),x.add(h.postRender,wi.prototype._postRender,this);let G=p.length;for(let Y=0;Y<G;Y++)this._dataSourceAdded(p,p.get(Y));this._dataSourceAdded(void 0,A.defaultDataSource),x.add(p.dataSourceAdded,wi.prototype._dataSourceAdded,this),x.add(p.dataSourceRemoved,wi.prototype._dataSourceRemoved,this);function U(Y){let Q=rxe(i,Y);l(Q)?j.getValueOrUndefined(Q.position,i.clock.currentTime)?i.trackedEntity=Q:i.zoomTo(Q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function q(Y){i.selectedEntity=rxe(i,Y)}d.screenSpaceEventHandler.setInputAction(q,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(U,Cn.LEFT_DOUBLE_CLICK)}Object.defineProperties(wi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,NH(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(B.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,axe(this._timeline,this.clock,e))}}});wi.prototype.extend=function(e,t){e(this,t)};wi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,A=c.container,x=A.style;p=A.clientHeight+3,x.left=`${f}px`;let C=0;l(g)&&(C+=g.container.clientWidth),l(h)&&(C+=h.container.clientWidth),x.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};wi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};wi.prototype.render=function(){this._cesiumWidget.render()};wi.prototype.isDestroyed=function(){return!1};wi.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",sxe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};wi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(wi.prototype._onEntityCollectionChanged,this)};wi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(wi.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};wi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,Uy)===lt.DONE&&i.update(t,Uy)}let r,o=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,Uy)!==lt.FAILED?r=Uy.center:l(s.position)&&(r=s.position.getValue(t,r)),o=l(r));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=m.clone(r,c.position),c.showSelection=a&&o,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=o,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=j.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};wi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}};wi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};wi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};wi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};wi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};wi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&axe(this.timeline,this.clock,e)};wi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,wi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};wi.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};wi.prototype.zoomTo=function(e,t){return cxe(this,e,{offset:t},!1)};wi.prototype.flyTo=function(e,t){return cxe(this,e,t,!0)};function cxe(e,t,n,i){NH(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof na){let s;l(o.imageryProvider)?s=o.imageryProvider._readyPromise.then(()=>o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return ob(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Ga||o instanceof wI||o instanceof RI){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=y(o.values,o),l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function Fb(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function NH(e){let t=e._zoomPromise;l(t)&&(Fb(e),e._completeZoom(!1))}wi.prototype._postRender=function(){Gyt(this),Wyt(this)};function Gyt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,r=y(e._zoomOptions,{}),o;if(t instanceof Ga||t instanceof RI)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new df(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),Fb(e)}).catch(()=>{NH(e)});if(t instanceof wI)return t._readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new df(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),Fb(e)});if(t instanceof he){o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),Fb(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,Uy);if(d===lt.PENDING)return;d!==lt.FAILED&&a.push(ae.clone(Uy))}if(a.length===0){NH(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(Fb(e),i.flyToBoundingSphere(c,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(c,r.offset),i.lookAtTransform(B.IDENTITY),Fb(e),e._completeZoom(!0))}function Wyt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=j.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,Uy);if(o===lt.PENDING)return;let s=r.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==lt.FAILED?Uy:void 0;e._entityView=new n3(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var lxe=wi;function jyt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Xz(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var uxe=jyt;function Yyt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new Zz(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var fxe=Yyt;function qyt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),r=new _e,o=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Mn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){dxe(s,u),s=f,mX(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?mX(s,u):dxe(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){dx(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],A=new FileReader;A.onload=Xyt(e,h,c,a),A.onerror=Kyt(e,h),A.readAsText(h)}}mX(s,u),e.destroy=iV(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function dx(e){e.stopPropagation(),e.preventDefault()}function dxe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",dx,!1),n.removeEventListener("dragover",dx,!1),n.removeEventListener("dragexit",dx,!1))}function mX(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",dx,!1),e.addEventListener("dragover",dx,!1),e.addEventListener("dragexit",dx,!1)}function Xyt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=c2.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Z3.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=CU.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=aU.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function Kyt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var mxe=qyt;function Jyt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new xH({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var hxe=Jyt;function pxe(e){let t=e.split(` -`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function Pf(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ce.observable();return Ce.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=pxe(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===ji.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===ji.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===ji.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.translationX=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.translationY=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.translationZ=B.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.scaleX=B.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.scaleY=B.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)},getPrimitiveFunction:function(){t.scaleZ=B.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Ah(t)}})}var Zyt=new m,Qyt=new m,$yt=new lc,e0t=new Z;function Ah(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,Zyt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,Qyt),i=$yt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=Z.fromHeadingPitchRoll(i,e0t),o=Z.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=B.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Pf.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=pxe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Ah(t)})}}}});Pf.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pf.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pf.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Pf.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Pf.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Pf.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Pf.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new Rb({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Pf.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Pf.prototype.isDestroyed=function(){return!1};Pf.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};var FH=Pf;function UH(e,t){e=Mn(e);let n=document.createElement("div"),i=new FH(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let s=oc.createSection,a=oc.createCheckbox,c=oc.createRangeInput,u=oc.createButton,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Bounds","boundsVisible","toggleBounds"),g=s(o,"Clipping","clippingVisible","toggleClipping"),h=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let A=10,x=10,C=P.PI;d.appendChild(c("Translation X","translationX",-A,+A)),d.appendChild(c("Translation Y","translationY",-A,+A)),d.appendChild(c("Translation Z","translationZ",-A,+A)),d.appendChild(c("Scale X","scaleX",0,+x)),d.appendChild(c("Scale Y","scaleY",0,+x)),d.appendChild(c("Scale Z","scaleZ",0,+x)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let T=ji.getMinBounds(ji.BOX),E=ji.getMaxBounds(ji.BOX),S=m.fromElements(ji.getMinBounds(ji.ELLIPSOID).x,ji.getMinBounds(ji.ELLIPSOID).y,-re.WGS84.maximumRadius,new m),w=m.fromElements(ji.getMaxBounds(ji.ELLIPSOID).x,ji.getMaxBounds(ji.ELLIPSOID).y,1e7,new m),D=ji.getMinBounds(ji.CYLINDER),R=ji.getMaxBounds(ji.CYLINDER);Ub("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",T,E,"shapeIsBox",p),Ub("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,w,"shapeIsEllipsoid",p),Ub("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,R,"shapeIsCylinder",p),Ub("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",T,E,"shapeIsBox",g),Ub("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,w,"shapeIsEllipsoid",g),Ub("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,R,"shapeIsCylinder",g);let O=document.createElement("div");h.appendChild(O);let L=document.createElement("textarea");L.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),O.className="cesium-cesiumInspector-styleEditor",O.appendChild(L);let N=u("Compile (Ctrl+Enter)","compileShader");O.appendChild(N);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),O.appendChild(_),Ce.applyBindings(i,n)}Object.defineProperties(UH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UH.prototype.isDestroyed=function(){return!1};UH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Ub(e,t,n,i,r,o,s,a,c,u,f,d,p,g,h,A){let x=oc.createRangeInput,C=p,T=g,E=A.appendChild(document.createElement("div"));E.setAttribute("data-bind",`if: ${h}`),E.appendChild(x(e,s,C.x,T.x)),E.appendChild(x(t,a,C.x,T.x)),E.appendChild(x(n,c,C.y,T.y)),E.appendChild(x(i,u,C.y,T.y)),E.appendChild(x(r,f,C.z,T.z)),E.appendChild(x(o,d,C.z,T.z))}var VH=UH;function t0t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new VH(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var _xe=t0t;globalThis.CESIUM_VERSION="1.105";var HKi="1.105";export{Qh as AlphaMode,UL as AlphaPipelineStage,Uz as Animation,Vz as AnimationViewModel,tr as Appearance,ai as ApproximateTerrainHeights,Fme as ArcGISTiledElevationTerrainProvider,ah as ArcGisBaseMapType,Hp as ArcGisMapServerImageryProvider,yf as ArcGisMapService,$t as ArcType,Ec as ArticulationStageType,Et as AssociativeArray,qn as AttributeCompression,ln as AttributeType,oV as AutoExposure,i_ as AutomaticUniforms,hr as Axis,e0 as AxisAlignedBoundingBox,ZB as B3dmLoader,JB as B3dmParser,Hz as BaseLayerPicker,kz as BaseLayerPickerViewModel,Qx as BatchTable,wC as BatchTableHierarchy,$c as BatchTexture,VL as BatchTexturePipelineStage,pr as Billboard,ju as BillboardCollection,mc as BillboardGraphics,FR as BillboardVisualizer,Vme as BingMapsGeocoderService,xD as BingMapsImageryProvider,gD as BingMapsStyle,Ra as BlendEquation,br as BlendFunction,vr as BlendOption,hn as BlendingState,Ke as BoundingRectangle,ae as BoundingSphere,lt as BoundingSphereState,Ape as BoxEmitter,Ml as BoxGeometry,WM as BoxGeometryUpdater,fC as BoxGraphics,sm as BoxOutlineGeometry,cV as BrdfLutGenerator,ht as Buffer,PC as BufferLoader,Fe as BufferUsage,GL as CPUStylingPipelineStage,hm as CallbackProperty,fr as Camera,BV as CameraEventAggregator,Ni as CameraEventType,vV as CameraFlightPath,H as Cartesian2,m as Cartesian3,oe as Cartesian4,he as Cartographic,IU as CartographicGeocoderService,zme as CatmullRomSpline,vC as Cesium3DContentGroup,ud as Cesium3DTile,R_ as Cesium3DTileBatchTable,Vl as Cesium3DTileColorBlendMode,Qpe as Cesium3DTileContent,dT as Cesium3DTileContentFactory,Yr as Cesium3DTileContentState,Ts as Cesium3DTileContentType,Us as Cesium3DTileFeature,bm as Cesium3DTileFeatureTable,od as Cesium3DTileOptimizationHint,CF as Cesium3DTileOptimizations,Nr as Cesium3DTilePass,Ud as Cesium3DTilePassState,ag as Cesium3DTilePointFeature,Wr as Cesium3DTileRefine,Cy as Cesium3DTileStyle,wF as Cesium3DTileStyleEngine,Xz as Cesium3DTilesInspector,Yz as Cesium3DTilesInspectorViewModel,p_e as Cesium3DTilesVoxelProvider,Ga as Cesium3DTileset,IF as Cesium3DTilesetBaseTraversal,EF as Cesium3DTilesetCache,yC as Cesium3DTilesetGraphics,SF as Cesium3DTilesetHeatmap,J0 as Cesium3DTilesetMetadata,DF as Cesium3DTilesetMostDetailedTraversal,OF as Cesium3DTilesetSkipTraversal,Ag as Cesium3DTilesetStatistics,Gs as Cesium3DTilesetTraversal,MF as Cesium3DTilesetVisualizer,Zz as CesiumInspector,Kz as CesiumInspectorViewModel,DA as CesiumTerrainProvider,Pz as CesiumWidget,vl as Check,iw as CheckerboardMaterialProperty,VV as CircleEmitter,Kme as CircleGeometry,Jme as CircleOutlineGeometry,_L as ClassificationModelDrawCommand,kL as ClassificationPipelineStage,CS as ClassificationPrimitive,Hn as ClassificationType,oi as ClearCommand,UC as ClippingPlane,As as ClippingPlaneCollection,Fm as Clock,No as ClockRange,gr as ClockStep,Mz as ClockViewModel,T_e as CloudCollection,wD as CloudType,z as Color,Tc as ColorBlendMode,zt as ColorGeometryInstanceAttribute,Vt as ColorMaterialProperty,RAe as Command,X as ComponentDatatype,JM as Composite3DTileContent,use as CompositeEntityCollection,aw as CompositeMaterialProperty,ga as CompositePositionProperty,Sc as CompositeProperty,kP as CompressedTextureBuffer,Bf as ComputeCommand,gP as ComputeEngine,LV as ConditionsExpression,E_e as ConeEmitter,Jc as ConstantPositionProperty,$n as ConstantProperty,oL as ConstantSpline,oF as ContentMetadata,RR as Context,Gt as ContextLimits,w2 as CoplanarPolygonGeometry,dg as CoplanarPolygonGeometryLibrary,cd as CoplanarPolygonOutlineGeometry,Mi as CornerType,BT as CorridorGeometry,Ui as CorridorGeometryLibrary,GF as CorridorGeometryUpdater,mC as CorridorGraphics,HF as CorridorOutlineGeometry,It as Credit,ek as CreditDisplay,uc as CubeMap,Oh as CubeMapFace,Zx as CubicRealPolynomial,gi as CullFace,is as CullingVolume,xf as CumulusCloud,XF as CustomDataSource,Qme as CustomHeightmapTerrainProvider,Rb as CustomShader,ig as CustomShaderMode,JL as CustomShaderPipelineStage,M0 as CustomShaderTranslucencyMode,KF as CylinderGeometry,NT as CylinderGeometryLibrary,ZF as CylinderGeometryUpdater,hC as CylinderGraphics,JF as CylinderOutlineGeometry,c2 as CzmlDataSource,Lo as DataSource,Um as DataSourceClock,u2 as DataSourceCollection,$2 as DataSourceDisplay,tge as DebugAppearance,Xp as DebugCameraPrimitive,nk as DebugInspector,rk as DebugModelMatrixPrimitive,ehe as DefaultProxy,pc as DepthFunction,ck as DepthPlane,ZL as DequantizationPipelineStage,Ey as DerivedCommand,fe as DeveloperError,uk as DeviceOrientationCameraController,age as DirectionalLight,AD as DiscardEmptyTileImagePolicy,rV as DiscardMissingTileImagePolicy,Dt as DistanceDisplayCondition,zn as DistanceDisplayConditionGeometryInstanceAttribute,jE as DoubleEndedPriorityQueue,TF as DoublyLinkedList,z_ as DracoLoader,nt as DrawCommand,JT as DynamicGeometryBatch,ci as DynamicGeometryUpdater,NP as EarthOrientationParameters,Wy as EarthOrientationParametersSample,Fo as EasingFunction,cl as EllipseGeometry,Ql as EllipseGeometryLibrary,A2 as EllipseGeometryUpdater,pC as EllipseGraphics,af as EllipseOutlineGeometry,re as Ellipsoid,Wf as EllipsoidGeodesic,Xs as EllipsoidGeometry,x2 as EllipsoidGeometryUpdater,_C as EllipsoidGraphics,Zu as EllipsoidOutlineGeometry,dk as EllipsoidPrimitive,Ba as EllipsoidRhumbLine,cge as EllipsoidSurfaceAppearance,Ma as EllipsoidTangentPlane,qE as EllipsoidTerrainProvider,vg as EllipsoidalOccluder,Hv as Empty3DTileContent,Yn as EncodedCartesian3,no as Entity,nf as EntityCluster,Ws as EntityCollection,n3 as EntityView,_e as Event,Mo as EventHelper,qf as Expression,yt as ExpressionNodeType,rf as ExtrapolationType,jt as FeatureDetection,R0 as FeatureIdPipelineStage,_k as Fog,Re as ForEach,gk as FrameRateMonitor,yk as FrameState,ca as Framebuffer,hi as FramebufferManager,Ak as FrustumCommands,KE as FrustumGeometry,FU as FrustumOutlineGeometry,yo as Fullscreen,tH as FullscreenButton,$z as FullscreenButtonViewModel,Z3 as GeoJsonDataSource,$B as GeoJsonLoader,PA as GeocodeType,aH as Geocoder,dD as GeocoderService,oH as GeocoderViewModel,Di as GeographicProjection,Wi as GeographicTilingScheme,dt as Geometry,rB as Geometry3DTileContent,De as GeometryAttribute,gn as GeometryAttributes,che as GeometryFactory,Tt as GeometryInstance,gc as GeometryInstanceAttribute,an as GeometryOffsetAttribute,Vn as GeometryPipeline,eN as GeometryPipelineStage,Nf as GeometryType,li as GeometryUpdater,G2 as GeometryVisualizer,ub as GetFeatureInfoFormat,Xk as Globe,Kk as GlobeDepth,Ek as GlobeSurfaceShaderSet,Gd as GlobeSurfaceTile,Fk as GlobeSurfaceTileProvider,Uk as GlobeTranslucency,Jk as GlobeTranslucencyFramebuffer,Zk as GlobeTranslucencyState,JS as GltfBufferViewLoader,ZS as GltfDracoLoader,QS as GltfImageLoader,$S as GltfIndexBufferLoader,tv as GltfJsonLoader,ep as GltfLoader,Gl as GltfLoaderUtil,GB as GltfStructuralMetadataLoader,nv as GltfTextureLoader,iv as GltfVertexBufferLoader,oye as GoogleEarthEnterpriseImageryProvider,PD as GoogleEarthEnterpriseMapsProvider,sh as GoogleEarthEnterpriseMetadata,mD as GoogleEarthEnterpriseTerrainData,ghe as GoogleEarthEnterpriseTerrainProvider,kU as GoogleEarthEnterpriseTileInformation,aU as GpxDataSource,s_ as GregorianDate,sye as GridImageryProvider,_w as GridMaterialProperty,Kn as GroundGeometryUpdater,cC as GroundPolylineGeometry,lm as GroundPolylinePrimitive,Kc as GroundPrimitive,Xv as GroupMetadata,df as HeadingPitchRange,lc as HeadingPitchRoll,OP as Heap,qe as HeightReference,Md as HeightmapEncoding,Za as HeightmapTerrainData,sD as HeightmapTessellator,$F as HermitePolynomialApproximation,D0 as HermiteSpline,YS as HilbertOrder,rH as HomeButton,nH as HomeButtonViewModel,_i as HorizontalOrigin,gb as I3SDataProvider,Qk as I3SFeature,$k as I3SField,eI as I3SGeometry,YA as I3SLayer,tI as I3SNode,rL as I3dmLoader,tL as I3dmParser,WU as Iau2000Orientation,UP as Iau2006XysData,Ux as Iau2006XysSample,jU as IauOrientationAxes,GU as IauOrientationParameters,SC as ImageBasedLighting,TL as ImageBasedLightingPipelineStage,f0 as ImageMaterialProperty,YD as Imagery,na as ImageryLayer,kk as ImageryLayerCollection,ch as ImageryLayerFeatureInfo,gl as ImageryProvider,fi as ImageryState,lv as Implicit3DTileContent,qS as ImplicitAvailabilityBitstream,XS as ImplicitMetadataView,Yo as ImplicitSubdivisionScheme,LC as ImplicitSubtree,NV as ImplicitSubtreeCache,cB as ImplicitSubtreeMetadata,DT as ImplicitTileCoordinates,Q0 as ImplicitTileset,Ue as IndexDatatype,mH as InfoBox,fH as InfoBoxViewModel,oc as InspectorShared,qo as InstanceAttributeSemantic,BL as InstancingPipelineStage,Mhe as InterpolationAlgorithm,Em as InterpolationType,tn as Intersect,Ki as IntersectionTests,ly as Intersections2D,Wc as Interval,nI as InvertClassification,_m as Ion,qU as IonGeocoderService,Hd as IonImageryProvider,ma as IonResource,uh as IonWorldImageryStyle,Ge as Iso8601,i4 as JobScheduler,Fa as JobType,K_ as JsonMetadataTable,ee as JulianDate,zP as KTX2Transcoder,Ca as KeyboardEventModifier,Qi as KeyframeNode,cU as KmlCamera,CU as KmlDataSource,lU as KmlLookAt,fU as KmlTour,mU as KmlTourFlyTo,hU as KmlTourWait,k0 as Label,dp as LabelCollection,um as LabelGraphics,jr as LabelStyle,W2 as LabelVisualizer,e2 as LagrangePolynomialApproximation,zi as LeapSecond,fye as Light,cp as LightingModel,nN as LightingPipelineStage,kT as LinearApproximation,w0 as LinearSpline,Qc as ManagedArray,hu as MapMode2D,Bhe as MapProjection,OD as MapboxImageryProvider,mye as MapboxStyleImageryProvider,n_ as Mars3DEx,Gi as Material,sr as MaterialAppearance,rN as MaterialPipelineStage,to as MaterialProperty,P as Math,er as Matrix2,Z as Matrix3,B as Matrix4,iI as Megatexture,Cm as MetadataClass,A0 as MetadataClassProperty,on as MetadataComponentType,kn as MetadataEntity,MB as MetadataEnum,OB as MetadataEnumValue,Qf as MetadataPipelineStage,Tm as MetadataSchema,ov as MetadataSchemaLoader,NC as MetadataSemantic,zl as MetadataTable,uB as MetadataTableProperty,Yt as MetadataType,Rh as MipmapHint,Dm as Model,lp as Model3DTileContent,xN as ModelAlphaOptions,lL as ModelAnimation,cL as ModelAnimationChannel,fL as ModelAnimationCollection,jl as ModelAnimationLoop,Sm as ModelAnimationState,SL as ModelArticulation,EL as ModelArticulationStage,DL as ModelClippingPlanesPipelineStage,O0 as ModelColorPipelineStage,Nt as ModelComponents,yL as ModelDrawCommand,dL as ModelFeature,mL as ModelFeatureTable,v_ as ModelGraphics,PN as ModelLightingOptions,LL as ModelMatrixUpdateStage,IL as ModelNode,CN as ModelRenderResources,FL as ModelRuntimeNode,yN as ModelRuntimePrimitive,MN as ModelSceneGraph,SN as ModelSilhouettePipelineStage,AN as ModelSkin,DN as ModelSplitterPipelineStage,BN as ModelStatistics,Gr as ModelType,en as ModelUtility,Y2 as ModelVisualizer,a4 as Moon,sN as MorphTargetsPipelineStage,Lhe as MorphWeightSpline,$0 as MortonOrder,cF as Multiple3DTileContent,MR as MultisampleFramebuffer,uH as NavigationHelpButton,cH as NavigationHelpButtonViewModel,Lt as NearFarScalar,hye as NeverTileDiscardPolicy,IN as NodeRenderResources,NL as NodeStatisticsPipelineStage,gC as NodeTransformationProperty,l4 as OIT,QU as Occluder,pm as OctahedralProjectedCubeMap,Xi as OffsetGeometryInstanceAttribute,Uhe as OpenCageGeocoderService,xb as OpenStreetMapImageryProvider,d2 as OrderedGroundPrimitiveCollection,Ln as OrientedBoundingBox,rn as OrthographicFrustum,Po as OrthographicOffCenterFrustum,Vhe as Packable,khe as PackableForInterpolation,sI as Particle,Aye as ParticleBurst,Cye as ParticleEmitter,bye as ParticleSystem,Se as Pass,fc as PassState,w_ as PathGraphics,q2 as PathVisualizer,YU as PeliasGeocoderService,cn as PerInstanceColorAppearance,Dy as PerformanceDisplay,xH as PerformanceWatchdog,yH as PerformanceWatchdogViewModel,vi as PerspectiveFrustum,pl as PerspectiveOffCenterFrustum,m4 as PickDepth,h4 as PickDepthFramebuffer,p4 as PickFramebuffer,E4 as Picking,aN as PickingPipelineStage,Jg as PinBuilder,Qe as PixelDatatype,ct as PixelFormat,fn as Plane,E2 as PlaneGeometry,v2 as PlaneGeometryUpdater,GM as PlaneGraphics,S2 as PlaneOutlineGeometry,vv as PntsLoader,iT as PntsParser,v4 as PointCloud,Z_ as PointCloudEyeDomeLighting,tp as PointCloudShading,lN as PointCloudStylingPipelineStage,AC as PointGraphics,Ys as PointPrimitive,mw as PointPrimitiveCollection,X2 as PointVisualizer,sE as PolygonGeometry,Xn as PolygonGeometryLibrary,O2 as PolygonGeometryUpdater,fm as PolygonGraphics,Zc as PolygonHierarchy,P2 as PolygonOutlineGeometry,ui as PolygonPipeline,ed as Polyline,gw as PolylineArrowMaterialProperty,Rm as PolylineCollection,jo as PolylineColorAppearance,yw as PolylineDashMaterialProperty,Wg as PolylineGeometry,J2 as PolylineGeometryUpdater,Aw as PolylineGlowMaterialProperty,Ac as PolylineGraphics,da as PolylineMaterialAppearance,sA as PolylineOutlineMaterialProperty,Ri as PolylinePipeline,Q2 as PolylineVisualizer,R2 as PolylineVolumeGeometry,Lm as PolylineVolumeGeometryLibrary,B2 as PolylineVolumeGeometryUpdater,xC as PolylineVolumeGraphics,M2 as PolylineVolumeOutlineGeometry,S_ as PositionProperty,Dg as PositionPropertyArray,Ar as PostProcessStage,Y4 as PostProcessStageCollection,Sl as PostProcessStageComposite,Yd as PostProcessStageLibrary,bf as PostProcessStageSampleMode,vb as PostProcessStageTextureCache,wn as Primitive,Zl as PrimitiveCollection,GC as PrimitiveLoadPlan,HC as PrimitiveOutlineGenerator,dN as PrimitiveOutlinePipelineStage,rC as PrimitivePipeline,ON as PrimitiveRenderResources,Co as PrimitiveState,mN as PrimitiveStatisticsPipelineStage,Le as PrimitiveType,gH as ProjectionPicker,pH as ProjectionPickerViewModel,j as Property,xw as PropertyArray,kC as PropertyAttribute,kB as PropertyAttributeProperty,Nl as PropertyBag,tl as PropertyTable,VC as PropertyTexture,VB as PropertyTextureProperty,Ds as ProviderViewModel,Ghe as Proxy,jc as QuadraticRealPolynomial,zk as QuadtreeOccluders,qk as QuadtreePrimitive,Gk as QuadtreeTile,ta as QuadtreeTileLoadState,n0e as QuadtreeTileProvider,zE as QuantizedMeshTerrainData,mM as QuarticRealPolynomial,Ne as Quaternion,aL as QuaternionSpline,H0 as Queue,On as Ray,ce as Rectangle,pE as RectangleCollisionChecker,fE as RectangleGeometry,bs as RectangleGeometryLibrary,L2 as RectangleGeometryUpdater,dm as RectangleGraphics,AT as RectangleOutlineGeometry,nr as ReferenceFrame,Pg as ReferenceProperty,ze as RenderState,Ou as Renderbuffer,Gc as RenderbufferFormat,$r as Request,Dh as RequestErrorEvent,cc as RequestScheduler,ni as RequestState,ns as RequestType,ve as Resource,Fi as ResourceCache,Wl as ResourceCacheKey,NB as ResourceCacheStatistics,ir as ResourceLoader,wt as ResourceLoaderState,hd as Rotation,de as RuntimeError,V_ as S2Cell,zs as SDFSettings,ya as SampledPositionProperty,of as SampledProperty,mn as Sampler,Np as ScaledPositionProperty,lz as Scene,Cb as SceneFramebuffer,ne as SceneMode,hN as SceneMode2DPipelineStage,bH as SceneModePicker,TH as SceneModePickerViewModel,Zi as SceneTransforms,X4 as SceneTransitioner,iz as ScreenSpaceCameraController,gf as ScreenSpaceEventHandler,Cn as ScreenSpaceEventType,B0 as SelectedFeatureIdPipelineStage,DH as SelectionIndicator,vH as SelectionIndicatorViewModel,jx as ShaderBuilder,wR as ShaderCache,be as ShaderDestination,NR as ShaderFunction,Qt as ShaderProgram,He as ShaderSource,LR as ShaderStruct,Py as ShadowMap,Qp as ShadowMapShader,xn as ShadowMode,Nu as ShadowVolumeAppearance,An as ShowGeometryInstanceAttribute,Jy as Simon1994PlanetaryPositions,rpe as SimplePolylineGeometry,RD as SingleTileImageryProvider,_N as SkinningPipelineStage,dz as SkyAtmosphere,_z as SkyBox,gz as SpatialNode,eAe as SphereEmitter,ope as SphereGeometry,_g as SphereOutlineGeometry,t2 as Spherical,rr as Spline,nl as SplitDirection,dI as Splitter,xd as StaticGeometryColorBatch,Td as StaticGeometryPerMaterialBatch,Mw as StaticGroundGeometryColorBatch,U2 as StaticGroundGeometryPerMaterialBatch,Z2 as StaticGroundPolylinePerMaterialBatch,Bw as StaticOutlineGeometryBatch,Ut as StencilConstants,Gn as StencilFunction,pt as StencilOperation,sL as SteppedSpline,Cw as StripeMaterialProperty,Vm as StripeOrientation,za as StructuralMetadata,vm as StyleCommandsNeeded,tAe as StyleExpression,Cz as Sun,g_ as SunLight,sz as SunPostProcess,YB as SupportedImageFormats,Rz as SvgPathBindingHandler,pi as TaskProcessor,Ez as Terrain,nh as TerrainData,Oc as TerrainEncoding,Yc as TerrainExaggeration,KD as TerrainFillMesh,Bd as TerrainMesh,EC as TerrainOffsetProperty,Jo as TerrainProvider,Qs as TerrainQuantization,yr as TerrainState,Bt as Texture,F0 as TextureAtlas,DR as TextureCache,bi as TextureMagnificationFilter,Iz as TextureManager,un as TextureMinificationFilter,EAe as TextureUniform,Pn as TextureWrap,ih as TileAvailability,ad as TileBoundingRegion,_F as TileBoundingS2Cell,gg as TileBoundingSphere,nAe as TileBoundingVolume,bz as TileCoordinatesImageryProvider,iAe as TileDiscardPolicy,yn as TileEdge,qD as TileImagery,Yp as TileMapServiceImageryProvider,sF as TileMetadata,ld as TileOrientedBoundingBox,Ti as TileProviderError,jk as TileReplacementQueue,Qn as TileSelectionResult,rAe as TileState,UN as Tileset3DTileContent,xF as TilesetMetadata,xL as TilesetPipelineStage,spe as TilingScheme,Zn as TimeConstants,fb as TimeDynamicImagery,wI as TimeDynamicPointCloud,bn as TimeInterval,Bo as TimeIntervalCollection,Rg as TimeIntervalCollectionPositionProperty,Mg as TimeIntervalCollectionProperty,Jn as TimeStandard,OH as Timeline,IH as TimelineHighlightRange,PH as TimelineTrack,CM as Tipsify,lx as ToggleButtonViewModel,$A as Tonemapper,Mt as Transforms,m0 as TranslationRotationScale,y4 as TranslucentTileClassification,gv as TridiagonalSystemSolver,Zb as TrustedServers,wb as TweenCollection,OR as UniformState,II as UniformType,$s as UrlTemplateImageryProvider,HKi as VERSION,LH as VRButton,MH as VRButtonViewModel,upe as VRTheWorldTerrainProvider,bAe as VaryingType,jh as Vector3DTileBatch,nF as Vector3DTileClampedPolylines,rF as Vector3DTileContent,L_ as Vector3DTileGeometry,ZN as Vector3DTilePoints,QN as Vector3DTilePolygons,fT as Vector3DTilePolylines,DC as Vector3DTilePrimitive,i2 as VelocityOrientationProperty,XT as VelocityVectorProperty,si as VertexArray,y_ as VertexArrayFacade,bt as VertexAttributeSemantic,Oe as VertexFormat,Bn as VerticalOrigin,ape as VideoSynchronizer,Eb as View,lxe as Viewer,lAe as ViewportQuad,po as Visibility,bme as Visualizer,Wp as VoxelBoxShape,UV as VoxelContent,jp as VoxelCylinderShape,rb as VoxelEllipsoidShape,VH as VoxelInspector,FH as VoxelInspectorViewModel,RI as VoxelPrimitive,yAe as VoxelProvider,TV as VoxelRenderResources,AAe as VoxelShape,ji as VoxelShapeType,DI as VoxelTraversal,fpe as VulkanConstants,k2 as WallGeometry,AE as WallGeometryLibrary,H2 as WallGeometryUpdater,D_ as WallGraphics,z2 as WallOutlineGeometry,te as WebGLConstants,BD as WebMapServiceImageryProvider,ND as WebMapTileServiceImageryProvider,Pi as WebMercatorProjection,Uo as WebMercatorTilingScheme,ts as WindingOrder,bv as WireframeIndexGenerator,gN as WireframePipelineStage,w4 as _shadersAcesTonemappingStage,rz as _shadersAdditiveBlend,oI as _shadersAdjustTranslucentFS,VR as _shadersAllMaterialAppearanceFS,kR as _shadersAllMaterialAppearanceVS,D4 as _shadersAmbientOcclusionGenerate,I4 as _shadersAmbientOcclusionModulate,jR as _shadersAspectRampMaterial,by as _shadersAtmosphereCommon,zR as _shadersBasicMaterialAppearanceFS,HR as _shadersBasicMaterialAppearanceVS,VN as _shadersBillboardCollectionFS,kN as _shadersBillboardCollectionVS,P4 as _shadersBlackAndWhite,O4 as _shadersBloomComposite,aV as _shadersBrdfLutGeneratorFS,oz as _shadersBrightPass,R4 as _shadersBrightness,YR as _shadersBumpMapMaterial,HL as _shadersCPUStylingStageFS,zL as _shadersCPUStylingStageVS,qR as _shadersCheckerboardMaterial,kV as _shadersCloudCollectionFS,zV as _shadersCloudCollectionVS,HV as _shadersCloudNoiseFS,GV as _shadersCloudNoiseVS,g4 as _shadersCompareAndPackTranslucentDepth,c4 as _shadersCompositeOITFS,Tb as _shadersCompositeTranslucentClassification,M4 as _shadersContrastBias,jL as _shadersCustomShaderStageFS,WL as _shadersCustomShaderStageVS,zx as _shadersCzmBuiltins,B4 as _shadersDepthOfField,ok as _shadersDepthPlaneFS,sk as _shadersDepthPlaneVS,L4 as _shadersDepthView,SAe as _shadersDepthViewPacked,XR as _shadersDotMaterial,N4 as _shadersEdgeDetection,KR as _shadersElevationBandMaterial,JR as _shadersElevationContourMaterial,ZR as _shadersElevationRampMaterial,GD as _shadersEllipsoidFS,mk as _shadersEllipsoidSurfaceAppearanceFS,hk as _shadersEllipsoidSurfaceAppearanceVS,WD as _shadersEllipsoidVS,U4 as _shadersFXAA,W4 as _shadersFXAA3_11,QR as _shadersFadeMaterial,YL as _shadersFeatureIdStageFS,qL as _shadersFeatureIdStageVS,F4 as _shadersFilmicTonemapping,ZA as _shadersGaussianBlur1D,QL as _shadersGeometryStageFS,$L as _shadersGeometryStageVS,Ck as _shadersGlobeFS,Tk as _shadersGlobeVS,$R as _shadersGridMaterial,jD as _shadersGroundAtmosphere,pO as _shadersHSBToRGB,_O as _shadersHSLToRGB,CL as _shadersImageBasedLightingStageFS,PL as _shadersInstancingStageCommon,OL as _shadersInstancingStageVS,hV as _shadersIntersectBox,mV as _shadersIntersectClippingPlanes,pV as _shadersIntersectCylinder,dV as _shadersIntersectDepth,_V as _shadersIntersectEllipsoid,eb as _shadersIntersection,fV as _shadersIntersectionUtils,RL as _shadersLegacyInstancingStageVS,V4 as _shadersLensFlare,tN as _shadersLightingStageFS,iN as _shadersMaterialStageFS,CV as _shadersMegatexture,XL as _shadersMetadataStageFS,KL as _shadersMetadataStageVS,wL as _shadersModelClippingPlanesStageFS,vL as _shadersModelColorStageFS,hL as _shadersModelFS,TN as _shadersModelSilhouetteStageFS,EN as _shadersModelSilhouetteStageVS,vN as _shadersModelSplitterStageFS,pL as _shadersModelVS,k4 as _shadersModifiedReinhardTonemapping,oN as _shadersMorphTargetsStageVS,z4 as _shadersNightVision,eM as _shadersNormalMapMaterial,jM as _shadersOctahedralProjectionAtlasFS,YM as _shadersOctahedralProjectionFS,qM as _shadersOctahedralProjectionVS,xV as _shadersOctree,xu as _shadersPassThrough,kA as _shadersPassThroughDepth,lM as _shadersPerInstanceColorAppearanceFS,uM as _shadersPerInstanceColorAppearanceVS,Kx as _shadersPerInstanceFlatColorAppearanceFS,fM as _shadersPerInstanceFlatColorAppearanceVS,KB as _shadersPointCloudEyeDomeLighting,cN as _shadersPointCloudStylingStageVS,nA as _shadersPointPrimitiveCollectionFS,YF as _shadersPointPrimitiveCollectionVS,tM as _shadersPolylineArrowMaterial,zM as _shadersPolylineColorAppearanceVS,Fu as _shadersPolylineCommon,nM as _shadersPolylineDashMaterial,lC as _shadersPolylineFS,iM as _shadersPolylineGlowMaterial,HM as _shadersPolylineMaterialAppearanceVS,rM as _shadersPolylineOutlineMaterial,FM as _shadersPolylineShadowVolumeFS,UM as _shadersPolylineShadowVolumeMorphFS,VM as _shadersPolylineShadowVolumeMorphVS,kM as _shadersPolylineShadowVolumeVS,YN as _shadersPolylineVS,fN as _shadersPrimitiveOutlineStageFS,uN as _shadersPrimitiveOutlineStageVS,HO as _shadersRGBToHSB,GO as _shadersRGBToHSL,WO as _shadersRGBToXYZ,H4 as _shadersReinhardTonemapping,bk as _shadersReprojectWebMercatorFS,Sk as _shadersReprojectWebMercatorVS,oM as _shadersRimLightingMaterial,Tv as _shadersSelectedFeatureIdStageCommon,xS as _shadersShadowVolumeAppearanceFS,yM as _shadersShadowVolumeAppearanceVS,n0 as _shadersShadowVolumeFS,G4 as _shadersSilhouette,pN as _shadersSkinningStageVS,CI as _shadersSkyAtmosphereCommon,uz as _shadersSkyAtmosphereFS,fz as _shadersSkyAtmosphereVS,mz as _shadersSkyBoxFS,hz as _shadersSkyBoxVS,sM as _shadersSlopeRampMaterial,aM as _shadersStripeMaterial,yz as _shadersSunFS,Az as _shadersSunTextureFS,xz as _shadersSunVS,GR as _shadersTexturedMaterialAppearanceFS,WR as _shadersTexturedMaterialAppearanceVS,tF as _shadersVector3DTileClampedPolylinesFS,eF as _shadersVector3DTileClampedPolylinesVS,$N as _shadersVector3DTilePolylinesVS,jS as _shadersVectorTileVS,Sz as _shadersViewportQuadFS,bx as _shadersViewportQuadVS,lV as _shadersVoxelFS,uV as _shadersVoxelVS,cM as _shadersWater,hR as _shadersXYZToRGB,V1 as _shadersacesTonemapping,k1 as _shadersalphaWeight,z1 as _shadersantialias,H1 as _shadersapproximateSphericalCoordinates,G1 as _shadersbackFacing,W1 as _shadersbranchFreeTernary,j1 as _shaderscascadeColor,Y1 as _shaderscascadeDistance,q1 as _shaderscascadeMatrix,X1 as _shaderscascadeWeights,K1 as _shaderscolumbusViewMorph,J1 as _shaderscomputePosition,gV as _shadersconvertUvToBox,yV as _shadersconvertUvToCylinder,AV as _shadersconvertUvToEllipsoid,Z1 as _shaderscosineAndSine,Q1 as _shadersdecompressTextureCoordinates,$1 as _shadersdefaultPbrMaterial,YP as _shadersdegreesPerRadian,eO as _shadersdepthClamp,qP as _shadersdepthRange,P1 as _shadersdepthRangeStruct,tO as _shaderseastNorthUpToEyeCoordinates,nO as _shadersellipsoidContainsPoint,iO as _shadersellipsoidWgs84TextureCoordinates,XP as _shadersepsilon1,KP as _shadersepsilon2,JP as _shadersepsilon3,ZP as _shadersepsilon4,QP as _shadersepsilon5,$P as _shadersepsilon6,e1 as _shadersepsilon7,rO as _shadersequalsEpsilon,oO as _shaderseyeOffset,sO as _shaderseyeToWindowCoordinates,aO as _shadersfastApproximateAtan,cO as _shadersfog,pR as _shadersfromCartesian,lO as _shadersgammaCorrect,uO as _shadersgeodeticSurfaceNormal,fO as _shadersgetDefaultMaterial,_R as _shadersgetFloodRect,gR as _shadersgetIndexMat,dO as _shadersgetLambertDiffuse,yR as _shadersgetMaxIndex,AR as _shadersgetMaxIndexVal,mO as _shadersgetSpecular,hO as _shadersgetWaterNoise,gO as _shadershue,t1 as _shadersinfinity,yO as _shadersinverseGamma,AO as _shadersisEmpty,xO as _shadersisFull,xR as _shadersisInEllipsoid,CR as _shadersisInObliq,CO as _shaderslatitudeToWebMercatorFraction,EO as _shaderslineDistance,TO as _shaderslinearToSrgb,bO as _shadersluminance,TR as _shadersmagnitude,ER as _shadersmagnitudeSquared,O1 as _shadersmaterial,R1 as _shadersmaterialInput,SO as _shadersmetersPerPixel,M1 as _shadersmodelMaterial,vO as _shadersmodelToWindowCoordinates,B1 as _shadersmodelVertexOutput,bR as _shadersmultiplyComponents,wO as _shadersmultiplyWithColorBalance,DO as _shadersnearFarScalar,IO as _shadersoctDecode,n1 as _shadersoneOverPi,i1 as _shadersoneOverTwoPi,PO as _shaderspackDepth,r1 as _shaderspassCesium3DTile,o1 as _shaderspassCesium3DTileClassification,s1 as _shaderspassCesium3DTileClassificationIgnoreShow,a1 as _shaderspassClassification,c1 as _shaderspassCompute,l1 as _shaderspassEnvironment,u1 as _shaderspassGlobe,f1 as _shaderspassOpaque,d1 as _shaderspassOverlay,m1 as _shaderspassTerrainClassification,h1 as _shaderspassTranslucent,p1 as _shaderspassVoxels,OO as _shaderspbrLighting,RO as _shaderspbrMetallicRoughnessMaterial,L1 as _shaderspbrParameters,MO as _shaderspbrSpecularGlossinessMaterial,BO as _shadersphong,_1 as _shaderspi,g1 as _shaderspiOverFour,y1 as _shaderspiOverSix,A1 as _shaderspiOverThree,x1 as _shaderspiOverTwo,LO as _shadersplaneDistance,NO as _shaderspointAlongRay,C1 as _shadersradiansPerDegree,N1 as _shadersray,FO as _shadersrayEllipsoidIntersectionInterval,F1 as _shadersraySegment,UO as _shadersraySphereIntersectionInterval,VO as _shadersreadDepth,kO as _shadersreadNonPerspective,zO as _shadersreverseLogDepth,jO as _shadersround,YO as _shaderssampleOctahedralProjection,qO as _shaderssaturation,SR as _shadersscaleToGeodeticSurface,T1 as _shaderssceneMode2D,E1 as _shaderssceneMode3D,b1 as _shaderssceneModeColumbusView,S1 as _shaderssceneModeMorphing,XO as _shadersshadowDepthCompare,U1 as _shadersshadowParameters,KO as _shadersshadowVisibility,JO as _shaderssignNotZero,v1 as _shaderssolarRadius,ZO as _shaderssphericalHarmonics,QO as _shaderssrgbToLinear,$O as _shaderstangentToEyeSpaceMatrix,eR as _shaderstextureCube,w1 as _shadersthreePiOver2,tR as _shaderstransformPlane,nR as _shaderstranslateRelativeToEye,iR as _shaderstranslucentPhong,rR as _shaderstranspose,D1 as _shaderstwoPi,oR as _shadersunpackDepth,sR as _shadersunpackFloat,aR as _shadersunpackUint,cR as _shadersvalueTransform,lR as _shadersvertexLogDepth,I1 as _shaderswebMercatorMaxLatitude,uR as _shaderswindowToEyeCoordinates,fR as _shaderswriteDepthClamp,dR as _shaderswriteLogDepth,mR as _shaderswriteNonPerspective,CB as addBuffer,fB as addDefaults,yB as addExtensionsRequired,Kf as addExtensionsUsed,T0 as addPipelineExtras,ys as addToArray,wP as appendForwardSlash,Cr as arrayRemoveDuplicates,$x as barycentricCoordinates,Or as binarySearch,AL as buildDrawCommand,nn as buildModuleUrl,SV as buildVoxelDrawCommands,Ye as clone,gt as combine,ob as computeFlyToLocationForRectangle,sT as createBillboardPointCallback,Sn as createCommand,Gz as createDefaultImageryProviderViewModels,Wz as createDefaultTerrainProviderViewModels,w_e as createElevationBandMaterial,jn as createGuid,Rr as createMaterialPropertyDescriptor,D_e as createOsmBuildings,I_e as createOsmBuildingsAsync,le as createPropertyDescriptor,Ll as createRawPropertyDescriptor,P_e as createTangentSpaceDebugPrimitive,vAe as createTaskProcessorWorker,mP as createUniform,hP as createUniformArray,W_e as createWorldImagery,Ty as createWorldImageryAsync,Zme as createWorldTerrain,GE as createWorldTerrainAsync,BU as decodeGoogleEarthEnterpriseData,iF as decodeVectorPolylinePositions,y as defaultValue,la as defer,l as defined,vR as demodernizeShader,$ as deprecationWarning,ue as destroyObject,Bfe as exportKml,MC as findAccessorMinMax,mT as findContentMetadata,hT as findGroupMetadata,aF as findTileMetadata,ev as forEachTextureInMaterial,kp as formatError,eK as freezeRenderState,l_ as getAbsoluteUri,Hl as getAccessorByteStride,DP as getBaseUri,Uu as getBinaryAccessor,xk as getClipAndStyleCode,yy as getClippingFunction,W_ as getComponentReader,Mn as getElement,Ix as getExtensionFromUri,wg as getFilenameFromUri,VU as getImageFromTypedArray,$d as getImagePixels,Mr as getJsonFromTypedArray,ym as getMagic,Ul as getStringFromTypedArray,Ci as getTimestamp,ii as hasExtension,I_ as heightReferenceOnEntityPropertyChanged,Mc as isBitSet,Px as isBlobUri,Ox as isCrossOriginUrl,u_ as isDataUri,a_ as isLeapYear,Ce as knockout,Bb as knockout_3_5_1,Oz as knockout_es5,Rx as loadAndExecuteScript,BR as loadCubeMap,OC as loadImageFromTypedArray,Dl as loadKTX2,my as mergeSort,gB as moveTechniqueRenderStates,AB as moveTechniquesToExtension,ku as numberOfComponentsForType,Mx as objectToQuery,Rt as oneTimeWarning,Q_ as parseBatchTable,FB as parseBoundingVolumeSemantics,HB as parseFeatureMetadataLegacy,hB as parseGlb,PP as parseResponseHeaders,zB as parseStructuralMetadata,zhe as pointInsideTriangle,xp as preprocess3DTileContent,bV as processVoxelProperties,Du as queryToObject,TB as readAccessorPacked,BC as removeExtension,mB as removeExtensionsRequired,RC as removeExtensionsUsed,_B as removePipelineExtras,xB as removeUnusedElements,b0 as resizeImageToNextPowerOfTwo,j2 as sampleTerrain,kg as sampleTerrainMostDetailed,Ex as scaleToGeodeticSurface,AM as subdivideArray,Sa as subscribeAndEvaluate,bB as updateAccessorComponentTypes,DB as updateVersion,To as usesExtension,uxe as viewerCesium3DTilesInspectorMixin,fxe as viewerCesiumInspectorMixin,mxe as viewerDragDropMixin,hxe as viewerPerformanceWatchdogMixin,_xe as viewerVoxelInspectorMixin,dpe as webGLConstantToGlslType,iV as wrapFunction,cT as writeTextToCanvas}; + `}var myt=[{text:"Highlight",value:kl.HIGHLIGHT},{text:"Replace",value:kl.REPLACE},{text:"Mix",value:kl.MIX}],nbe=new z(1,1,0,.4),hyt=new z,nH=new z;function ra(e,t){let n=this,i=e.canvas;this._eventHandler=new _f(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new Iy({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let k=[],Y=n._properties();for(let j in Y)Y.hasOwnProperty(j)&&k.push(j);return k});let o=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=kl.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(Y){let j=e.pick(Y.endPosition);if(j instanceof ks?(n.feature=j,n.tile=j.content.tile):l(j)&&l(j.content)?(n.feature=void 0,n.tile=j.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(j)&&l(j.content)){let $;e.pickPositionSupported&&($=e.pickPosition(Y.endPosition),l($)&&(n._tileset.debugPickPosition=$)),n._tileset.debugPickedTile=j.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Tn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Tn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let T=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){A(Math.pow(k,6))}});let S=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=4;let v=fyt(this),I=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(v,Tn.LEFT_CLICK):n._eventHandler.removeInputAction(Tn.LEFT_CLICK)}});let O=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let N=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let F=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let E=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let D=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(k){D(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||ibe(this,!0)}Object.defineProperties(ra.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return myt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e._readyPromise.then(function(r){t.isDestroyed()||t._properties(r.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let r=0;r<i;++r){let s=n[r];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation?o.maximumAttenuation:0,this.baseResolution=o.baseResolution?o.baseResolution:0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=W1(e,!1),this._pickStatisticsText=W1(e,!0),this._resourceCacheStatisticsText=obe(),ibe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,hyt):z.WHITE:t.color=nH,this._scene.requestRender()),l(e)&&(z.clone(e.color,nH),e.color=nbe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!uX(t.content)&&(t.color=nH,this._scene.requestRender()),l(e)&&!uX(e.content)&&(z.clone(e.color,nH),e.color=nbe,this._scene.requestRender()),this._tile=e}}});function uX(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!uX(t[i]))return!1;return!0}return!1}ra.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ra.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ra.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ra.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ra.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ra.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ra.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ra.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ra.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ra.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ra.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new Ly(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ra.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ra.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=W1(e,!1),this._pickStatisticsText=W1(e,!0),this._resourceCacheStatisticsText=obe())};ra.prototype.isDestroyed=function(){return!1};ra.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};ra.getStatistics=W1;var iH=ra;function oH(e,t){e=Mn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new iH(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=rc.createSection,c=rc.createCheckbox,u=rc.createRangeInput,f=rc.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),T.appendChild(A),T.appendChild(S),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let N=document.createElement("div");N.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(N);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),g.appendChild(F),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(_),h.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(E),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(w);let D=document.createElement("div");b.appendChild(D),D.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),D.appendChild(M);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),D.className="cesium-cesiumInspector-styleEditor",D.appendChild(B);let V=f("Compile (Ctrl+Enter)","compileStyle");D.appendChild(V);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),D.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let Y=document.createElement("div");Y.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(Y),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(o,n)}Object.defineProperties(oH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});oH.prototype.isDestroyed=function(){return!1};oH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var rH=oH;function pyt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function fX(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var _yt=new In,gyt=new m;function j1(e,t){let n=this,i=e.canvas,o=new _f(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=vn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=vn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=vn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=vn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new Iy({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=vn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=vn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new x4({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=vn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=vn(function(){let u=n.depthFrustum+1;return n.depthFrustum=fX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=vn(function(){let u=n.depthFrustum-1;return n.depthFrustum=fX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=vn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new B4({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=vn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=vn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=vn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,_yt),g=r.pick(p,n._scene,gyt);if(l(g)){let h=d.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let C=x[b];if(l(C))for(let T=0;!f&&T<C.length;++T){let A=C[T];ce.contains(A.rectangle,h)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=vn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(j1.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return vn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return vn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return vn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return vn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return vn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});j1.prototype._update=function(){this.frustums&&(this.frustumStatisticText=pyt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=fX(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};j1.prototype.isDestroyed=function(){return!1};j1.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var sH=j1;function aH(e,t){e=Mn(e);let n=document.createElement("div"),i=new sH(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=rc.createSection,c=rc.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(h);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",T.appendChild(A);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",I.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let N=document.createElement("div");O.appendChild(N);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",N.className="cesium-cesiumInspector-frustumStatistics",N.appendChild(M),N.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",N.appendChild(B);let V=document.createElement("table"),U=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(F);let Y=document.createElement("td");Y.appendChild(_);let j=document.createElement("td");j.appendChild(E),U.appendChild(k),U.appendChild(Y),U.appendChild(j);let $=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let K=document.createElement("td");K.appendChild(D),G.appendChild($),G.appendChild(W),G.appendChild(K),V.appendChild(U),V.appendChild(G),N.appendChild(V),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(aH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aH.prototype.isDestroyed=function(){return!1};aH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var cH=aH;function lH(e,t){l(t)||(t=document.body),t=Mn(t);let n=this,i=Ce.observable(Cr.fullscreen),o=Ce.observable(Cr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Cr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=vn(function(){Cr.fullscreen?Cr.exitFullscreen():Cr.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Mn(e),r.body),this._callback=function(){i(Cr.fullscreen)},r.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(lH.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});lH.prototype.isDestroyed=function(){return!1};lH.prototype.destroy=function(){document.removeEventListener(Cr.changeEventName,this._callback),ue(this)};var uH=lH;var yyt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",xyt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function fH(e,t){e=Mn(e);let n=new uH(t,e);n._exitFullScreenPath=xyt,n._enterFullScreenPath=yyt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(fH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});fH.prototype.isDestroyed=function(){return!1};fH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var dH=fH;var rbe=1e3;function If(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new Ik,new Xk({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=abe,this._handleArrowUp=sbe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let o=Ce.getObservable(t,"_suggestions")().length>0,r=Ce.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=vn(function(i){if(i=y(i,Px.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Syt(t);else return Ayt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?sbe(t):r?abe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;ube(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,If.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){If._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(If.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});If.prototype.destroy=function(){this._suggestionSubscription.dispose()};function sbe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],If._adjustSuggestionsScroll(e,n)}function abe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],If._adjustSuggestionsScroll(e,i)}function byt(e,t){let n=l(t)?t.availability:void 0;return l(n)?Hg(t,[e]).then(function(i){return e=i[0],e.height+=rbe,e}):(e.height+=rbe,Promise.resolve(e))}function Cyt(e,t){let n=e._scene,o=n.mapProjection.ellipsoid,r=n.camera,s=n.terrainProvider,a=t,c;return t instanceof ce?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ce.center(t):c=PE(t,n):t=o.cartesianToCartographic(t),l(c)||(c=byt(t,s)),c.then(function(u){a=o.cartographicToCartesian(u)}).finally(function(){r.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:L.IDENTITY})})}async function Tyt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function Ayt(e,t,n){let i=e._searchText;if(lbe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await Tyt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,mX(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=cbe(e,hI.getCreditsFromResult(s[0]));l(a)||dX(e,t[o].credit);return}e._searchText=`${i} (not found)`}function dX(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function cbe(e,t){return l(t)&&t.forEach(n=>dX(e,n)),t}function mX(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function Eyt(e,t){let n=Mn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function Syt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function lbe(e){return/^\s*$/.test(e)}function ube(e){Ce.getObservable(e,"_suggestions").removeAll()}async function vyt(e){if(!e.autoComplete)return;let t=e._searchText;if(ube(e),mX(e),!lbe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Px.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=hI.getCreditsFromResult(r);o=o&&!l(s),cbe(e,s)}),o&&dX(e,n.credit)}if(e._suggestions.length>=5)return}}If.flyToDestination=Cyt;If._updateSearchSuggestions=vyt;If._adjustSuggestionsScroll=Eyt;If.prototype.isDestroyed=function(){return!1};If.prototype.destroy=function(){return mX(this),ue(this)};var mH=If;var wyt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",Iyt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function hH(e){let t=Mn(e.container),n=new mH(e);n._startSearchPath=wyt,n._stopSearchPath=Iyt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Wt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(hH.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});hH.prototype.isDestroyed=function(){return!1};hH.prototype.destroy=function(){let e=this._container;return Wt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var pH=hH;function fbe(e,t){this._scene=e,this._duration=t;let n=this;this._command=vn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(fbe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var _H=fbe;function gH(e,t,n){e=Mn(e);let i=new _H(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(gH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gH.prototype.isDestroyed=function(){return!1};gH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var yH=gH;var Dyt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",Pyt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function hX(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?Pyt:Dyt}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}hX.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(hX.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var xH=hX;function bH(e){e=Mn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new xH;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=wa(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let b=x["background-color"],C=z.fromCssColorString(b);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let h=f.getBoundingClientRect().height;r.style.height=`${h}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(bH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});bH.prototype.isDestroyed=function(){return!1};bH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var CH=bH;function dbe(){this.showInstructions=!1;let e=this;this._command=vn(function(){e.showInstructions=!e.showInstructions}),this._showClick=vn(function(){e._touch=!1}),this._showTouch=vn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(dbe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var TH=dbe;function AH(e){let t=Mn(e.container),n=new TH,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ce.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(AH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});AH.prototype.isDestroyed=function(){return!1};AH.prototype.destroy=function(){return Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var EH=AH;function pX(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=vn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=T4.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(pX.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});pX.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var SH=pX;function vH(e){let t=Mn(e.container),n=new SH(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(vH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vH.prototype.isDestroyed=function(){return!1};vH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var wH=vH;function IH(e){this._scene=e,this._orthographic=e.camera.frustum instanceof on,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=vn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Mr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=vn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=vn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(IH.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});IH.prototype.isDestroyed=function(){return!1};IH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var DH=IH;var Oyt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Ryt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function PH(e,t){e=Mn(e);let n=new DH(t);n._perspectivePath=Oyt,n._orthographicPath=Ryt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(PH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PH.prototype.isDestroyed=function(){return!1};PH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var OH=PH;function RH(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Mr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=vn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=vn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=vn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=vn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(RH.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});RH.prototype.isDestroyed=function(){return!1};RH.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var MH=RH;var Myt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Lyt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Nyt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function LH(e,t,n){e=Mn(e);let i=new MH(t,n);i._globePath=Myt,i._flatMapPath=Lyt,i._columbusViewPath=Nyt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Ce.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Wt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(LH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LH.prototype.isDestroyed=function(){return!1};LH.prototype.destroy=function(){return this._viewModel.destroy(),Wt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var NH=LH;var Fyt=new H,FH="-1000px";function q1(e,t,n){this._scene=e,this._screenPositionX=FH,this._screenPositionY=FH,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return eo.wgs84ToWindowCoordinates(e,i,o)}}q1.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Fyt);if(!l(e))this._screenPositionX=FH,this._screenPositionY=FH;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};q1.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Br.EXPONENTIAL_OUT})};q1.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Br.EXPONENTIAL_OUT})};Object.defineProperties(q1.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var BH=q1;function kH(e,t){e=Mn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new BH(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(kH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kH.prototype.isDestroyed=function(){return!1};kH.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),ue(this)};var UH=kH;function mb(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}mb.prototype.getHeight=function(){return this._height};mb.prototype.getBase=function(){return this._base};mb.prototype.getStartTime=function(){return this._start};mb.prototype.getStopTime=function(){return this._stop};mb.prototype.setRange=function(e,t){this._start=e,this._stop=t};mb.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=ee.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var VH=mb;function mbe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}mbe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,o)&&ee.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,r)&&ee.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var zH=mbe;var _X=1e12,Df={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Bc={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Uy=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Byt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kc(e,t){e=Mn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Df.none,this._touchMode=Bc.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=kyt(this),this._onMouseUp=Uyt(this),this._onMouseMove=Vyt(this),this._onMouseWheel=zyt(this),this._onTouchStart=Hyt(this),this._onTouchMove=Wyt(this),this._onTouchEnd=Gyt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}kc.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};kc.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};kc.prototype.isDestroyed=function(){return!1};kc.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};kc.prototype.addHighlightRange=function(e,t,n){let i=new VH(e,t,n);return this._highlightRanges.push(i),this.resize(),i};kc.prototype.addTrack=function(e,t,n,i){let o=new zH(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};kc.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Fr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=ee.secondsDifference(o,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=o,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};kc.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function gX(e){return e<10?`0${e.toString()}`:e.toString()}kc.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Byt[t.month-1]} ${t.day} ${t.year} ${gX(t.hour)}:${gX(t.minute)}:${gX(t.second)}${i}`};kc.prototype.smallestTicInPixels=7;kc.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,h=Math.min(d/p*1e-5,.4),x,b=ee.toGregorianDate(g);d>31536e4?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?x=ee.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?x=ee.fromDate(new Date(Date.UTC(b.year,0))):x=ee.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let C=ee.secondsDifference(this._startJulian,ee.addSeconds(x,h,new ee)),T=C+d;this._epochJulian=x;function A(k){return Math.floor(C/k)*k}function S(k,Y){return Math.ceil(k/Y+.5)*Y}function v(k){return(k-C)/d}function I(k,Y){return k-Y*Math.round(k/Y)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let N={startTime:C,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(N)});let F=0,_=0,E=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let D=-1,M=-1,B=Uy.length,V;for(V=0;V<B;++V){let k=Uy[V];if(++D,F=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=D)}if(D>0){for(;D>0;)if(--D,Math.abs(I(F,Uy[D]))<1e-5){Uy[D]>=f&&(_=Uy[D]);break}if(M>=0)for(;M<D;){if(Math.abs(I(_,Uy[M]))<1e-5&&Uy[M]>=f){E=Uy[M];break}++M}}f=R,f>u&&E<1e-5&&Math.abs(f-F)>u&&(E=f,f<=F+u&&(_=0));let U=-999999,G;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=A(E);o<=T;o=S(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=A(_);o<=T;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,T+=F,o=A(F);let k=ee.computeTaiMinusUtc(x);for(;o<=T;){let Y=ee.addSeconds(g,o-C,new ee);if(F>2.1){let K=ee.computeTaiMinusUtc(Y);Math.abs(K-k)>.1&&(o+=K-k,Y=ee.addSeconds(g,o-C,new ee))}let j=Math.round(p*v(o)),$=this.makeLabel(Y);this._rulerEle.innerHTML=$,G=this._rulerEle.offsetWidth,G<10&&(G=O);let W=j-(G/2-1);W>U?(U=W+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${j.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${$}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${j.toString()}px;"></span>`,o=S(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),N.y=0,this._trackList.forEach(function(k){k.render(r._context,N),N.y+=k.height})};kc.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};kc.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function kyt(e){return function(t){e._mouseMode!==Df.touchOnly&&(t.button===0?(e._mouseMode=Df.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Df.zoom:e._mouseMode=Df.slide)),t.preventDefault()}}function Uyt(e){return function(t){e._mouseMode=Df.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Vyt(e){return function(t){let n;if(e._mouseMode===Df.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Df.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Df.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function zyt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;_X=Math.max(Math.min(Math.abs(n),_X),1),n/=_X,e.zoomFrom(Math.pow(1.05,-n))}}function Hyt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Df.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Bc.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Bc.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Bc.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Bc.ignore}}function Gyt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Bc.singleTap?(e._touchMode=Bc.scrub,e._onTouchMove(t)):e._touchMode===Bc.scrub&&e._onTouchMove(t),e._mouseMode=Df.touchOnly,n!==1?e._touchMode=n>0?Bc.ignore:Bc.none:e._touchMode===Bc.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function Wyt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Bc.singleTap&&(e._touchMode=Bc.slideZoom),e._mouseMode=Df.touchOnly,e._touchMode===Bc.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Bc.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-r,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=r,e._touchState.spanX=s))}}kc.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var HH=kc;var ybe=ur(gbe(),1);function Yyt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function xbe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Xyt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(xbe(),e._locked=!1),e._noSleep.disable(),Cr.exitFullscreen(),n(!1)):(Cr.fullscreen||Cr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Yyt("landscape")),t.useWebVR=!0,n(!0)))}function GH(e,t){let n=this,i=Ce.observable(Cr.enabled),o=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Cr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Mr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new ybe.default,this._command=vn(function(){Xyt(n,e,o,r)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(Mn(t),document.body),this._callback=function(){!Cr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(xbe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(GH.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});GH.prototype.isDestroyed=function(){return!1};GH.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Cr.changeEventName,this._callback),ue(this)};var WH=GH;var Kyt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",Jyt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function jH(e,t,n){e=Mn(e);let i=new WH(t,n);i._exitVRPath=Jyt,i._enterVRPath=Kyt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(jH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jH.prototype.isDestroyed=function(){return!1};jH.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var qH=jH;var Vy=new ae;function Tbe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Zyt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function $yt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function bbe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof nr)return i;if(n instanceof ks)return new nr({name:$yt(n),description:Zyt(n),feature:n})}if(l(e.scene.globe))return t0t(e,t.position)}var Qyt=new ee;function Abe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let o=i.startTime,r=i.stopTime;ee.equals(o,r)&&(r=ee.addSeconds(o,P.EPSILON2,Qyt)),e.updateFromClock(),e.zoomTo(o,r)}}}var e0t=new m;function t0t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new nr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=Cbe();return}let a=s[0],c=new nr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,e0t);c.position=new Kc(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=Cbe())}),r}function Cbe(){return new nr({id:"None",description:"No features found."})}function n0t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ii(e,t){e=Mn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Bm,u=new W4(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new Yz(r,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new cB,g=!0);let h=d.scene,x=new ZB({scene:h,dataSourceCollection:p}),b=new Mr;b.add(c.onTick,Ii.prototype._onTick,this),b.add(h.morphStart,Ii.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(j),C=new UH(j,h)}let T;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",o.appendChild(j),T=new CH(j);let $=T.viewModel;b.add($.cameraClicked,Ii.prototype._onInfoBoxCameraClicked,this),b.add($.closeClicked,Ii.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",o.appendChild(A);let S;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",A.appendChild(j);let $;l(t.geocoder)&&typeof t.geocoder!="boolean"&&($=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new pH({container:j,geocoderServices:$,scene:h}),b.add(S.viewModel.search.beforeExecute,Ii.prototype._clearObjects,this)}let v;(!l(t.homeButton)||t.homeButton!==!1)&&(v=new yH(A,h),l(S)&&b.add(v.viewModel.command.afterExecute,function(){let j=S.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),b.add(v.viewModel.command.beforeExecute,Ii.prototype._clearTrackedObject,this));let I;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new NH(A,h));let O;t.projectionPicker&&(O=new OH(A,h));let R,N;if(n){let j=y(t.imageryProviderViewModels,X4()),$=y(t.terrainProviderViewModels,K4());R=new Y4(A,{globe:h.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:$,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),N=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&(Q("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(R.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(R.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(R.viewModel.selectedTerrain=void 0,h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let F;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let $=window.localStorage.getItem("cesium-hasSeenNavHelp");l($)&&$?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}F=new EH({container:A,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,j)})}let _;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",o.appendChild(j),_=new eH(j,new tH(u))}let E;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",o.appendChild(j),E=new HH(j,c),E.addEventListener("settime",Tbe,!1),E.zoomTo(c.startTime,c.stopTime)}let w,D,M;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",o.appendChild(M),w=new dH(M,t.fullscreenElement),D=wa(w.viewModel,"isFullscreenEnabled",function(j){M.style.display=j?"block":"none",l(E)&&(E.container.style.right=`${M.clientWidth}px`,E.resize())}));let B,V,U;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",o.appendChild(j),B=new qH(j,h,t.fullScreenElement),V=wa(B.viewModel,"isVREnabled",function($){j.style.display=$?"block":"none",l(w)&&(j.style.right=`${M.clientWidth}px`),l(E)&&(E.container.style.right=`${j.clientWidth}px`,E.resize())}),U=wa(B.viewModel,"isVRMode",function($){n0t(i,$)})}this._baseLayerPickerDropDown=N,this._fullscreenSubscription=D,this._vrSubscription=V,this._vrModeSubscription=U,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=C,this._infoBox=T,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=v,this._sceneModePicker=I,this._projectionPicker=O,this._baseLayerPicker=R,this._navigationHelpButton=F,this._animation=_,this._timeline=E,this._fullscreenButton=w,this._vrButton=B,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(T)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new _e,this._trackedEntityChanged=new _e,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),b.add(p.dataSourceAdded,Ii.prototype._onDataSourceAdded,this),b.add(p.dataSourceRemoved,Ii.prototype._onDataSourceRemoved,this),b.add(h.postUpdate,Ii.prototype.resize,this),b.add(h.postRender,Ii.prototype._postRender,this);let G=p.length;for(let j=0;j<G;j++)this._dataSourceAdded(p,p.get(j));this._dataSourceAdded(void 0,x.defaultDataSource),b.add(p.dataSourceAdded,Ii.prototype._dataSourceAdded,this),b.add(p.dataSourceRemoved,Ii.prototype._dataSourceRemoved,this);function k(j){let $=bbe(i,j);l($)?q.getValueOrUndefined($.position,i.clock.currentTime)?i.trackedEntity=$:i.zoomTo($):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function Y(j){i.selectedEntity=bbe(i,j)}d.screenSpaceEventHandler.setInputAction(Y,Tn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(k,Tn.LEFT_DOUBLE_CLICK)}Object.defineProperties(Ii.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,YH(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(L.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Abe(this._timeline,this.clock,e))}}});Ii.prototype.extend=function(e,t){e(this,t)};Ii.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,h=this._vrButton,x=c.container,b=x.style;p=x.clientHeight+3,b.left=`${f}px`;let C=0;l(g)&&(C+=g.container.clientWidth),l(h)&&(C+=h.container.clientWidth),b.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Ii.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ii.prototype.render=function(){this._cesiumWidget.render()};Ii.prototype.isDestroyed=function(){return!1};Ii.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",Tbe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ii.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ii.prototype._onEntityCollectionChanged,this)};Ii.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ii.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ii.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,Vy)===ut.DONE&&i.update(t,Vy)}let o,r=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,Vy)!==ut.FAILED?o=Vy.center:l(s.position)&&(o=s.position.getValue(t,o)),r=l(o));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=m.clone(o,c.position),c.showSelection=a&&r,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=r,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=q.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Ii.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0),this.selectedEntity===r&&(this.selectedEntity=void 0)}};Ii.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ii.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ii.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ii.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ii.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Abe(this.timeline,this.clock,e)};Ii.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ii.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ii.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Ii.prototype.zoomTo=function(e,t){return Ebe(this,e,{offset:t},!1)};Ii.prototype.flyTo=function(e,t){return Ebe(this,e,t,!0)};function Ebe(e,t,n,i){YH(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof na){let s;if(l(r.imageryProvider)){let a=Promise.resolve();l(r.imageryProvider._readyPromise)?a=r.imageryProvider._readyPromise:l(r.imageryProvider.readyPromise)&&(a=r.imageryProvider.readyPromise),s=a.then(()=>r.getImageryRectangle())}else s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})});s.then(function(a){return PE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Ws||r instanceof R1||r instanceof B1){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=y(r.values,r),l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function HE(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function YH(e){let t=e._zoomPromise;l(t)&&(HE(e),e._completeZoom(!1))}Ii.prototype._postRender=function(){i0t(this),o0t(this)};function i0t(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=y(e._zoomOptions,{}),r;if(t instanceof Ws||t instanceof B1)return t._readyPromise.then(function(){let u=t.boundingSphere;l(o.offset)||(o.offset=new ff(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(L.IDENTITY),e._completeZoom(!0)),HE(e)}).catch(()=>{YH(e)});if(t instanceof R1)return t._readyPromise.then(function(){let u=t.boundingSphere;l(o.offset)||(o.offset=new ff(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(L.IDENTITY),e._completeZoom(!0)),HE(e)});if(t instanceof me){r={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),HE(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,Vy);if(d===ut.PENDING)return;d!==ut.FAILED&&a.push(ae.clone(Vy))}if(a.length===0){YH(e);return}e.trackedEntity=void 0;let c=ae.fromBoundingSpheres(a);e._zoomIsFlight?(HE(e),i.flyToBoundingSphere(c,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(c,o.offset),i.lookAtTransform(L.IDENTITY),HE(e),e._completeZoom(!0))}function o0t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Vy);if(r===ut.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?Vy:void 0;e._entityView=new e3(t,o,o.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var Sbe=Ii;function r0t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new rH(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var vbe=r0t;function s0t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new cH(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var wbe=s0t;function a0t(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new _e,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Mn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){Ibe(s,u),s=f,CX(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?CX(s,u):Ibe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){hb(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let h=d[g],x=new FileReader;x.onload=c0t(e,h,c,a),x.onerror=l0t(e,h),x.readAsText(h)}}CX(s,u),e.destroy=rU(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function hb(e){e.stopPropagation(),e.preventDefault()}function Ibe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",hb,!1),n.removeEventListener("dragover",hb,!1),n.removeEventListener("dragexit",hb,!1))}function CX(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",hb,!1),e.addEventListener("dragover",hb,!1),e.addEventListener("dragexit",hb,!1)}function c0t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=sB.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=J3.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=bk.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=sk.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function l0t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Dbe=a0t;function u0t(e,t){t=y(t,y.EMPTY_OBJECT);let n=new wH({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Pbe=u0t;function Obe(e){let t=e.split(` +`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} +`}return i}function Pf(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ce.observable();return Ce.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Obe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Xi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Xi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Xi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.translationX=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.translationY=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.translationZ=L.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.scaleX=L.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.scaleY=L.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)},getPrimitiveFunction:function(){t.scaleZ=L.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&xh(t)}})}var f0t=new m,d0t=new m,m0t=new lc,h0t=new Z;function xh(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,f0t),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,d0t),i=m0t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=Z.fromHeadingPitchRoll(i,h0t),r=Z.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=L.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Pf.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._voxelPrimitive._readyPromise.then(function(){t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Obe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,xh(t)})}}}});Pf.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pf.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pf.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Pf.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Pf.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Pf.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Pf.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new kE({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Pf.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Pf.prototype.isDestroyed=function(){return!1};Pf.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};var XH=Pf;function KH(e,t){e=Mn(e);let n=document.createElement("div"),i=new XH(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=rc.createSection,a=rc.createCheckbox,c=rc.createRangeInput,u=rc.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),h=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,C=P.PI;d.appendChild(c("Translation X","translationX",-x,+x)),d.appendChild(c("Translation Y","translationY",-x,+x)),d.appendChild(c("Translation Z","translationZ",-x,+x)),d.appendChild(c("Scale X","scaleX",0,+b)),d.appendChild(c("Scale Y","scaleY",0,+b)),d.appendChild(c("Scale Z","scaleZ",0,+b)),d.appendChild(c("Heading","angleX",-C,+C)),d.appendChild(c("Pitch","angleY",-C,+C)),d.appendChild(c("Roll","angleZ",-C,+C));let T=Xi.getMinBounds(Xi.BOX),A=Xi.getMaxBounds(Xi.BOX),S=m.fromElements(Xi.getMinBounds(Xi.ELLIPSOID).x,Xi.getMinBounds(Xi.ELLIPSOID).y,-oe.WGS84.maximumRadius,new m),v=m.fromElements(Xi.getMaxBounds(Xi.ELLIPSOID).x,Xi.getMaxBounds(Xi.ELLIPSOID).y,1e7,new m),I=Xi.getMinBounds(Xi.CYLINDER),O=Xi.getMaxBounds(Xi.CYLINDER);GE("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",T,A,"shapeIsBox",p),GE("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,v,"shapeIsEllipsoid",p),GE("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,O,"shapeIsCylinder",p),GE("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",T,A,"shapeIsBox",g),GE("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,v,"shapeIsEllipsoid",g),GE("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,O,"shapeIsCylinder",g);let R=document.createElement("div");h.appendChild(R);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(N);let F=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(F);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(_),Ce.applyBindings(i,n)}Object.defineProperties(KH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KH.prototype.isDestroyed=function(){return!1};KH.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function GE(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,x){let b=rc.createRangeInput,C=p,T=g,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${h}`),A.appendChild(b(e,s,C.x,T.x)),A.appendChild(b(t,a,C.x,T.x)),A.appendChild(b(n,c,C.y,T.y)),A.appendChild(b(i,u,C.y,T.y)),A.appendChild(b(o,f,C.z,T.z)),A.appendChild(b(r,d,C.z,T.z))}var JH=KH;function p0t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new JH(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Rbe=p0t;globalThis.CESIUM_VERSION="1.106.1";var hJi="1.106.1";export{$h as AlphaMode,LN as AlphaPipelineStage,eH as Animation,tH as AnimationViewModel,io as Appearance,si as ApproximateTerrainHeights,bme as ArcGISTiledElevationTerrainProvider,ch as ArcGisBaseMapType,Hp as ArcGisMapServerImageryProvider,yf as ArcGisMapService,Qt as ArcType,bc as ArticulationStageType,At as AssociativeArray,Yn as AttributeCompression,ln as AttributeType,bz as AutoExposure,b_ as AutomaticUniforms,_o as Axis,$y as AxisAlignedBoundingBox,YL as B3dmLoader,qL as B3dmParser,Y4 as BaseLayerPicker,j4 as BaseLayerPickerViewModel,Kb as BatchTable,EC as BatchTableHierarchy,Qc as BatchTexture,NN as BatchTexturePipelineStage,go as Billboard,Wu as BillboardCollection,sc as BillboardGraphics,dD as BillboardVisualizer,Tme as BingMapsGeocoderService,PI as BingMapsImageryProvider,wI as BingMapsStyle,Ra as BlendEquation,vo as BlendFunction,Io as BlendOption,mn as BlendingState,Ke as BoundingRectangle,ae as BoundingSphere,ut as BoundingSphereState,s0e as BoxEmitter,Ol as BoxGeometry,FM as BoxGeometryUpdater,cC as BoxGraphics,tm as BoxOutlineGeometry,bV as BrdfLutGenerator,ht as Buffer,wC as BufferLoader,ke as BufferUsage,UN as CPUStylingPipelineStage,mm as CallbackProperty,ho as Camera,Sz as CameraEventAggregator,Bi as CameraEventType,CV as CameraFlightPath,H as Cartesian2,m as Cartesian3,re as Cartesian4,me as Cartographic,Ik as CartographicGeocoderService,Eme as CatmullRomSpline,AC as Cesium3DContentGroup,ld as Cesium3DTile,M_ as Cesium3DTileBatchTable,kl as Cesium3DTileColorBlendMode,c0e as Cesium3DTileContent,fT as Cesium3DTileContentFactory,qo as Cesium3DTileContentState,Es as Cesium3DTileContentType,ks as Cesium3DTileFeature,Em as Cesium3DTileFeatureTable,od as Cesium3DTileOptimizationHint,x2 as Cesium3DTileOptimizations,Fo as Cesium3DTilePass,Hd as Cesium3DTilePassState,lg as Cesium3DTilePointFeature,Wo as Cesium3DTileRefine,Ly as Cesium3DTileStyle,S2 as Cesium3DTileStyleEngine,rH as Cesium3DTilesInspector,iH as Cesium3DTilesInspectorViewModel,S0e as Cesium3DTilesVoxelProvider,Ws as Cesium3DTileset,w2 as Cesium3DTilesetBaseTraversal,C2 as Cesium3DTilesetCache,pC as Cesium3DTilesetGraphics,A2 as Cesium3DTilesetHeatmap,J0 as Cesium3DTilesetMetadata,v2 as Cesium3DTilesetMostDetailedTraversal,D2 as Cesium3DTilesetSkipTraversal,Cg as Cesium3DTilesetStatistics,Gs as Cesium3DTilesetTraversal,O2 as Cesium3DTilesetVisualizer,cH as CesiumInspector,sH as CesiumInspectorViewModel,Ix as CesiumTerrainProvider,Yz as CesiumWidget,wl as Check,ow as CheckerboardMaterialProperty,p4 as CircleEmitter,Ome as CircleGeometry,Rme as CircleOutlineGeometry,dN as ClassificationModelDrawCommand,FN as ClassificationPipelineStage,bS as ClassificationPrimitive,Hn as ClassificationType,ui as ClearCommand,NC as ClippingPlane,bs as ClippingPlaneCollection,Bm as Clock,Fr as ClockRange,xo as ClockStep,W4 as ClockViewModel,R0e as CloudCollection,y1 as CloudType,z as Color,xc as ColorBlendMode,Ht as ColorGeometryInstanceAttribute,Vt as ColorMaterialProperty,Xxe as Command,X as ComponentDatatype,WM as Composite3DTileContent,Hre as CompositeEntityCollection,cw as CompositeMaterialProperty,ya as CompositePositionProperty,Ac as CompositeProperty,WD as CompressedTextureBuffer,Hf as ComputeCommand,aU as ComputeEngine,f4 as ConditionsExpression,M0e as ConeEmitter,Kc as ConstantPositionProperty,ei as ConstantProperty,tN as ConstantSpline,i2 as ContentMetadata,fU as Context,Gt as ContextLimits,SB as CoplanarPolygonGeometry,hg as CoplanarPolygonGeometryLibrary,ad as CoplanarPolygonOutlineGeometry,Li as CornerType,MT as CorridorGeometry,Ui as CorridorGeometryLibrary,z2 as CorridorGeometryUpdater,uC as CorridorGraphics,V2 as CorridorOutlineGeometry,wt as Credit,PV as CreditDisplay,uc as CubeMap,Ph as CubeMapFace,Yb as CubicRealPolynomial,gi as CullFace,ss as CullingVolume,Ef as CumulusCloud,q2 as CustomDataSource,Lme as CustomHeightmapTerrainProvider,kE as CustomShader,og as CustomShaderMode,qN as CustomShaderPipelineStage,M0 as CustomShaderTranslucencyMode,Y2 as CylinderGeometry,NT as CylinderGeometryLibrary,K2 as CylinderGeometryUpdater,fC as CylinderGraphics,X2 as CylinderOutlineGeometry,sB as CzmlDataSource,Nr as DataSource,km as DataSourceClock,cB as DataSourceCollection,ZB as DataSourceDisplay,G0e as DebugAppearance,qp as DebugCameraPrimitive,Uz as DebugInspector,x4 as DebugModelMatrixPrimitive,Fme as DefaultProxy,dc as DepthFunction,MV as DepthPlane,YN as DequantizationPipelineStage,vy as DerivedCommand,fe as DeveloperError,NV as DeviceOrientationCameraController,W0e as DirectionalLight,DI as DiscardEmptyTileImagePolicy,BU as DiscardMissingTileImagePolicy,Dt as DistanceDisplayCondition,zn as DistanceDisplayConditionGeometryInstanceAttribute,jA as DoubleEndedPriorityQueue,b2 as DoublyLinkedList,H_ as DracoLoader,nt as DrawCommand,KT as DynamicGeometryBatch,ci as DynamicGeometryUpdater,MD as EarthOrientationParameters,qy as EarthOrientationParametersSample,Br as EasingFunction,ul as EllipseGeometry,Zl as EllipseGeometryLibrary,gB as EllipseGeometryUpdater,dC as EllipseGraphics,sf as EllipseOutlineGeometry,oe as Ellipsoid,zf as EllipsoidGeodesic,Ks as EllipsoidGeometry,yB as EllipsoidGeometryUpdater,mC as EllipsoidGraphics,Ju as EllipsoidOutlineGeometry,_V as EllipsoidPrimitive,Na as EllipsoidRhumbLine,j0e as EllipsoidSurfaceAppearance,Ma as EllipsoidTangentPlane,YA as EllipsoidTerrainProvider,Ig as EllipsoidalOccluder,Gv as Empty3DTileContent,qn as EncodedCartesian3,nr as Entity,tf as EntityCluster,js as EntityCollection,e3 as EntityView,_e as Event,Mr as EventHelper,jf as Expression,gt as ExpressionNodeType,nf as ExtrapolationType,Wt as FeatureDetection,R0 as FeatureIdPipelineStage,BV as Fog,Re as ForEach,T4 as FrameRateMonitor,kV as FrameState,pa as Framebuffer,hi as FramebufferManager,WV as FrustumCommands,KA as FrustumGeometry,Fk as FrustumOutlineGeometry,Cr as Fullscreen,dH as FullscreenButton,uH as FullscreenButtonViewModel,J3 as GeoJsonDataSource,KL as GeoJsonLoader,Px as GeocodeType,pH as Geocoder,hI as GeocoderService,mH as GeocoderViewModel,Di as GeographicProjection,Yi as GeographicTilingScheme,dt as Geometry,$M as Geometry3DTileContent,Pe as GeometryAttribute,gn as GeometryAttributes,Wme as GeometryFactory,Tt as GeometryInstance,hc as GeometryInstanceAttribute,an as GeometryOffsetAttribute,Un as GeometryPipeline,JN as GeometryPipelineStage,Nf as GeometryType,li as GeometryUpdater,zB as GeometryVisualizer,cE as GetFeatureInfoFormat,hV as Globe,jV as GlobeDepth,NU as GlobeSurfaceShaderSet,kd as GlobeSurfaceTile,iV as GlobeSurfaceTileProvider,oV as GlobeTranslucency,qV as GlobeTranslucencyFramebuffer,UV as GlobeTranslucencyState,JS as GltfBufferViewLoader,ZS as GltfDracoLoader,$S as GltfImageLoader,QS as GltfIndexBufferLoader,tv as GltfJsonLoader,ep as GltfLoader,Hl as GltfLoaderUtil,BL as GltfStructuralMetadataLoader,nv as GltfTextureLoader,iv as GltfVertexBufferLoader,Y0e as GoogleEarthEnterpriseImageryProvider,RI as GoogleEarthEnterpriseMapsProvider,sh as GoogleEarthEnterpriseMetadata,pI as GoogleEarthEnterpriseTerrainData,Qme as GoogleEarthEnterpriseTerrainProvider,Uk as GoogleEarthEnterpriseTileInformation,JA as GoogleMaps,sk as GpxDataSource,l_ as GregorianDate,X0e as GridImageryProvider,gw as GridMaterialProperty,Kn as GroundGeometryUpdater,rC as GroundPolylineGeometry,cm as GroundPolylinePrimitive,Xc as GroundPrimitive,Kv as GroupMetadata,ff as HeadingPitchRange,lc as HeadingPitchRoll,ID as Heap,qe as HeightReference,Rd as HeightmapEncoding,Za as HeightmapTerrainData,cI as HeightmapTessellator,Z2 as HermitePolynomialApproximation,w0 as HermiteSpline,qS as HilbertOrder,yH as HomeButton,_H as HomeButtonViewModel,_i as HorizontalOrigin,OE as I3SDataProvider,E4 as I3SFeature,S4 as I3SField,T1 as I3SGeometry,rb as I3SLayer,A1 as I3SNode,eN as I3dmLoader,ZL as I3dmParser,jk as Iau2000Orientation,ND as Iau2006XysData,Ub as Iau2006XysSample,qk as IauOrientationAxes,Wk as IauOrientationParameters,TC as ImageBasedLighting,yN as ImageBasedLightingPipelineStage,u0 as ImageMaterialProperty,UI as Imagery,na as ImageryLayer,sV as ImageryLayerCollection,ah as ImageryLayerFeatureInfo,yl as ImageryProvider,di as ImageryState,lv as Implicit3DTileContent,YS as ImplicitAvailabilityBitstream,XS as ImplicitMetadataView,qr as ImplicitSubdivisionScheme,RC as ImplicitSubtree,d4 as ImplicitSubtreeCache,nL as ImplicitSubtreeMetadata,wT as ImplicitTileCoordinates,$0 as ImplicitTileset,Ue as IndexDatatype,CH as InfoBox,xH as InfoBoxViewModel,rc as InspectorShared,Yr as InstanceAttributeSemantic,PN as InstancingPipelineStage,_he as InterpolationAlgorithm,Am as InterpolationType,tn as Intersect,$i as IntersectionTests,fy as Intersections2D,Hc as Interval,t1 as InvertClassification,pm as Ion,Xk as IonGeocoderService,Vd as IonImageryProvider,ma as IonResource,uh as IonWorldImageryStyle,Ge as Iso8601,zV as JobScheduler,ka as JobType,J_ as JsonMetadataTable,ee as JulianDate,jD as KTX2Transcoder,Ta as KeyboardEventModifier,to as KeyframeNode,ak as KmlCamera,bk as KmlDataSource,ck as KmlLookAt,uk as KmlTour,dk as KmlTourFlyTo,mk as KmlTourWait,V0 as Label,dp as LabelCollection,lm as LabelGraphics,jo as LabelStyle,HB as LabelVisualizer,$2 as LagrangePolynomialApproximation,Wi as LeapSecond,Q0e as Light,cp as LightingModel,$N as LightingPipelineStage,UT as LinearApproximation,v0 as LinearSpline,Zc as ManagedArray,yu as MapMode2D,ghe as MapProjection,MI as MapboxImageryProvider,txe as MapboxStyleImageryProvider,r_ as Mars3DEx,qi as Material,co as MaterialAppearance,eF as MaterialPipelineStage,tr as MaterialProperty,P as Math,no as Matrix2,Z as Matrix3,L as Matrix4,E1 as Megatexture,Cm as MetadataClass,y0 as MetadataClassProperty,rn as MetadataComponentType,Vn as MetadataEntity,wL as MetadataEnum,SL as MetadataEnumValue,Zf as MetadataPipelineStage,Tm as MetadataSchema,rv as MetadataSchemaLoader,MC as MetadataSemantic,Vl as MetadataTable,oL as MetadataTableProperty,qt as MetadataType,Oh as MipmapHint,Im as Model,lp as Model3DTileContent,_F as ModelAlphaOptions,rN as ModelAnimation,oN as ModelAnimationChannel,aN as ModelAnimationCollection,Wl as ModelAnimationLoop,Sm as ModelAnimationState,CN as ModelArticulation,xN as ModelArticulationStage,EN as ModelClippingPlanesPipelineStage,O0 as ModelColorPipelineStage,Ft as ModelComponents,hN as ModelDrawCommand,cN as ModelFeature,lN as ModelFeatureTable,S_ as ModelGraphics,IF as ModelLightingOptions,ON as ModelMatrixUpdateStage,SN as ModelNode,xF as ModelRenderResources,MN as ModelRuntimeNode,hF as ModelRuntimePrimitive,OF as ModelSceneGraph,AF as ModelSilhouettePipelineStage,pF as ModelSkin,vF as ModelSplitterPipelineStage,RF as ModelStatistics,Go as ModelType,en as ModelUtility,WB as ModelVisualizer,xV as Moon,nF as MorphTargetsPipelineStage,yhe as MorphWeightSpline,Q0 as MortonOrder,s2 as Multiple3DTileContent,WL as MultisampleFramebuffer,EH as NavigationHelpButton,TH as NavigationHelpButtonViewModel,Rt as NearFarScalar,nxe as NeverTileDiscardPolicy,wF as NodeRenderResources,RN as NodeStatisticsPipelineStage,hC as NodeTransformationProperty,YV as OIT,Qk as Occluder,hm as OctahedralProjectedCubeMap,Zi as OffsetGeometryInstanceAttribute,Che as OpenCageGeocoderService,LE as OpenStreetMapImageryProvider,uB as OrderedGroundPrimitiveCollection,Nn as OrientedBoundingBox,on as OrthographicFrustum,Or as OrthographicOffCenterFrustum,The as Packable,Ahe as PackableForInterpolation,S1 as Particle,rxe as ParticleBurst,axe as ParticleEmitter,uxe as ParticleSystem,Ae as Pass,Mc as PassState,v_ as PathGraphics,jB as PathVisualizer,Yk as PeliasGeocoderService,cn as PerInstanceColorAppearance,Iy as PerformanceDisplay,wH as PerformanceWatchdog,SH as PerformanceWatchdogViewModel,wi as PerspectiveFrustum,_l as PerspectiveOffCenterFrustum,GV as PickDepth,XV as PickDepthFramebuffer,KV as PickFramebuffer,nz as Picking,iF as PickingPipelineStage,$g as PinBuilder,Je as PixelDatatype,lt as PixelFormat,dn as Plane,CB as PlaneGeometry,EB as PlaneGeometryUpdater,NM as PlaneGraphics,AB as PlaneOutlineGeometry,wv as PntsLoader,nT as PntsParser,M4 as PointCloud,$_ as PointCloudEyeDomeLighting,tp as PointCloudShading,rF as PointCloudStylingPipelineStage,_C as PointGraphics,Ys as PointPrimitive,hw as PointPrimitiveCollection,qB as PointVisualizer,rA as PolygonGeometry,Xn as PolygonGeometryLibrary,DB as PolygonGeometryUpdater,um as PolygonGraphics,Jc as PolygonHierarchy,IB as PolygonOutlineGeometry,fi as PolygonPipeline,Qf as Polyline,yw as PolylineArrowMaterialProperty,Rm as PolylineCollection,jr as PolylineColorAppearance,xw as PolylineDashMaterialProperty,qg as PolylineGeometry,XB as PolylineGeometryUpdater,bw as PolylineGlowMaterialProperty,_c as PolylineGraphics,da as PolylineMaterialAppearance,sx as PolylineOutlineMaterialProperty,Mi as PolylinePipeline,JB as PolylineVisualizer,PB as PolylineVolumeGeometry,Nm as PolylineVolumeGeometryLibrary,RB as PolylineVolumeGeometryUpdater,gC as PolylineVolumeGraphics,OB as PolylineVolumeOutlineGeometry,E_ as PositionProperty,Pg as PositionPropertyArray,Co as PostProcessStage,Tz as PostProcessStageCollection,Cl as PostProcessStageComposite,Wd as PostProcessStageLibrary,Cf as PostProcessStageSampleMode,CE as PostProcessStageTextureCache,Dn as Primitive,Jl as PrimitiveCollection,VC as PrimitiveLoadPlan,UC as PrimitiveOutlineGenerator,cF as PrimitiveOutlinePipelineStage,tC as PrimitivePipeline,DF as PrimitiveRenderResources,Tr as PrimitiveState,lF as PrimitiveStatisticsPipelineStage,Fe as PrimitiveType,OH as ProjectionPicker,DH as ProjectionPickerViewModel,q as Property,Cw as PropertyArray,BC as PropertyAttribute,LL as PropertyAttributeProperty,Nl as PropertyBag,tl as PropertyTable,FC as PropertyTexture,ML as PropertyTextureProperty,Ps as ProviderViewModel,vhe as Proxy,Wc as QuadraticRealPolynomial,aV as QuadtreeOccluders,mV as QuadtreePrimitive,lV as QuadtreeTile,ea as QuadtreeTileLoadState,_xe as QuadtreeTileProvider,zA as QuantizedMeshTerrainData,yP as QuarticRealPolynomial,Be as Quaternion,iN as QuaternionSpline,H0 as Queue,In as Ray,ce as Rectangle,hA as RectangleCollisionChecker,uA as RectangleGeometry,vs as RectangleGeometryLibrary,MB as RectangleGeometryUpdater,fm as RectangleGraphics,yT as RectangleOutlineGeometry,oo as ReferenceFrame,Rg as ReferenceProperty,Ve as RenderState,Vu as Renderbuffer,il as RenderbufferFormat,Qo as Request,wh as RequestErrorEvent,cc as RequestScheduler,ni as RequestState,os as RequestType,ve as Resource,ki as ResourceCache,Gl as ResourceCacheKey,PL as ResourceCacheStatistics,ro as ResourceLoader,It as ResourceLoaderState,md as Rotation,de as RuntimeError,V_ as S2Cell,zs as SDFSettings,xa as SampledPositionProperty,of as SampledProperty,hn as Sampler,Fp as ScaledPositionProperty,Hz as Scene,_E as SceneFramebuffer,ne as SceneMode,uF as SceneMode2DPipelineStage,NH as SceneModePicker,MH as SceneModePickerViewModel,eo as SceneTransforms,Ez as SceneTransitioner,Nz as ScreenSpaceCameraController,_f as ScreenSpaceEventHandler,Tn as ScreenSpaceEventType,L0 as SelectedFeatureIdPipelineStage,UH as SelectionIndicator,BH as SelectionIndicatorViewModel,eT as ShaderBuilder,cU as ShaderCache,Te as ShaderDestination,yF as ShaderFunction,$t as ShaderProgram,We as ShaderSource,gF as ShaderStruct,Py as ShadowMap,Kp as ShadowMapShader,Cn as ShadowMode,Mu as ShadowVolumeAppearance,bn as ShowGeometryInstanceAttribute,Mx as Simon1994PlanetaryPositions,lpe as SimplePolylineGeometry,LI as SingleTileImageryProvider,dF as SkinningPipelineStage,Gz as SkyAtmosphere,jz as SkyBox,L4 as SpatialNode,xxe as SphereEmitter,upe as SphereGeometry,yg as SphereOutlineGeometry,Q2 as Spherical,so as Spline,ol as SplitDirection,w1 as Splitter,xd as StaticGeometryColorBatch,Cd as StaticGeometryPerMaterialBatch,Lw as StaticGroundGeometryColorBatch,FB as StaticGroundGeometryPerMaterialBatch,KB as StaticGroundPolylinePerMaterialBatch,Nw as StaticOutlineGeometryBatch,kt as StencilConstants,Gn as StencilFunction,pt as StencilOperation,nN as SteppedSpline,Tw as StripeMaterialProperty,Um as StripeOrientation,Ha as StructuralMetadata,vm as StyleCommandsNeeded,bxe as StyleExpression,qz as Sun,by as SunLight,kz as SunPostProcess,VL as SupportedImageFormats,G4 as SvgPathBindingHandler,yi as TaskProcessor,F4 as Terrain,nh as TerrainData,Pc as TerrainEncoding,jc as TerrainExaggeration,HI as TerrainFillMesh,Md as TerrainMesh,bC as TerrainOffsetProperty,Jr as TerrainProvider,Qs as TerrainQuantization,bo as TerrainState,Lt as Texture,B0 as TextureAtlas,lU as TextureCache,Si as TextureMagnificationFilter,z4 as TextureManager,un as TextureMinificationFilter,Vxe as TextureUniform,On as TextureWrap,ih as TileAvailability,sd as TileBoundingRegion,h2 as TileBoundingS2Cell,xg as TileBoundingSphere,Cxe as TileBoundingVolume,B4 as TileCoordinatesImageryProvider,Txe as TileDiscardPolicy,yn as TileEdge,VI as TileImagery,Gp as TileMapServiceImageryProvider,o2 as TileMetadata,cd as TileOrientedBoundingBox,Ai as TileProviderError,fV as TileReplacementQueue,Qn as TileSelectionResult,Axe as TileState,FF as Tileset3DTileContent,y2 as TilesetMetadata,_N as TilesetPipelineStage,fpe as TilingScheme,$n as TimeConstants,lE as TimeDynamicImagery,R1 as TimeDynamicPointCloud,Sn as TimeInterval,Lr as TimeIntervalCollection,Lg as TimeIntervalCollectionPositionProperty,Ng as TimeIntervalCollectionProperty,Jn as TimeStandard,HH as Timeline,VH as TimelineHighlightRange,zH as TimelineTrack,dM as Tipsify,fb as ToggleButtonViewModel,Kx as Tonemapper,Mt as Transforms,d0 as TranslationRotationScale,ZV as TranslucentTileClassification,yv as TridiagonalSystemSolver,QE as TrustedServers,AE as TweenCollection,uU as UniformState,L1 as UniformType,ta as UrlTemplateImageryProvider,hJi as VERSION,qH as VRButton,WH as VRButtonViewModel,ppe as VRTheWorldTerrainProvider,zxe as VaryingType,jh as Vector3DTileBatch,e2 as Vector3DTileClampedPolylines,n2 as Vector3DTileContent,F_ as Vector3DTileGeometry,KF as Vector3DTilePoints,JF as Vector3DTilePolygons,uT as Vector3DTilePolylines,SC as Vector3DTilePrimitive,tB as VelocityOrientationProperty,YT as VelocityVectorProperty,ai as VertexArray,ag as VertexArrayFacade,Et as VertexAttributeSemantic,Me as VertexFormat,Ln as VerticalOrigin,dpe as VideoSynchronizer,yE as View,Sbe as Viewer,Ixe as ViewportQuad,gr as Visibility,ame as Visualizer,e_ as VoxelBoxShape,h4 as VoxelContent,t_ as VoxelCylinderShape,DE as VoxelEllipsoidShape,JH as VoxelInspector,XH as VoxelInspectorViewModel,B1 as VoxelPrimitive,Bxe as VoxelProvider,a4 as VoxelRenderResources,kxe as VoxelShape,Xi as VoxelShapeType,M1 as VoxelTraversal,_pe as VulkanConstants,kB as WallGeometry,yA as WallGeometryLibrary,VB as WallGeometryUpdater,w_ as WallGraphics,UB as WallOutlineGeometry,te as WebGLConstants,FI as WebMapServiceImageryProvider,kI as WebMapTileServiceImageryProvider,Oi as WebMercatorProjection,kr as WebMercatorTilingScheme,rs as WindingOrder,Sv as WireframeIndexGenerator,mF as WireframePipelineStage,iz as _shadersAcesTonemappingStage,Fz as _shadersAdditiveBlend,TI as _shadersAdjustTranslucentFS,kD as _shadersAllMaterialAppearanceFS,UD as _shadersAllMaterialAppearanceVS,oz as _shadersAmbientOcclusionGenerate,rz as _shadersAmbientOcclusionModulate,JD as _shadersAspectRampMaterial,Cy as _shadersAtmosphereCommon,VD as _shadersBasicMaterialAppearanceFS,zD as _shadersBasicMaterialAppearanceVS,BF as _shadersBillboardCollectionFS,kF as _shadersBillboardCollectionVS,sz as _shadersBlackAndWhite,az as _shadersBloomComposite,mU as _shadersBrdfLutGeneratorFS,Bz as _shadersBrightPass,cz as _shadersBrightness,ZD as _shadersBumpMapMaterial,kN as _shadersCPUStylingStageFS,BN as _shadersCPUStylingStageVS,$D as _shadersCheckerboardMaterial,hU as _shadersCloudCollectionFS,pU as _shadersCloudCollectionVS,_U as _shadersCloudNoiseFS,gU as _shadersCloudNoiseVS,yU as _shadersCompareAndPackTranslucentDepth,xU as _shadersCompositeOITFS,gE as _shadersCompositeTranslucentClassification,lz as _shadersContrastBias,zN as _shadersCustomShaderStageFS,VN as _shadersCustomShaderStageVS,Xb as _shadersCzmBuiltins,uz as _shadersDepthOfField,bU as _shadersDepthPlaneFS,CU as _shadersDepthPlaneVS,fz as _shadersDepthView,Uxe as _shadersDepthViewPacked,QD as _shadersDotMaterial,dz as _shadersEdgeDetection,eP as _shadersElevationBandMaterial,tP as _shadersElevationContourMaterial,nP as _shadersElevationRampMaterial,AI as _shadersEllipsoidFS,b4 as _shadersEllipsoidSurfaceAppearanceFS,C4 as _shadersEllipsoidSurfaceAppearanceVS,EI as _shadersEllipsoidVS,hz as _shadersFXAA,TU as _shadersFXAA3_11,iP as _shadersFadeMaterial,HN as _shadersFeatureIdStageFS,GN as _shadersFeatureIdStageVS,mz as _shadersFilmicTonemapping,jx as _shadersGaussianBlur1D,XN as _shadersGeometryStageFS,KN as _shadersGeometryStageVS,AU as _shadersGlobeFS,EU as _shadersGlobeVS,oP as _shadersGridMaterial,SI as _shadersGroundAtmosphere,JO as _shadersHSBToRGB,ZO as _shadersHSLToRGB,gN as _shadersImageBasedLightingStageFS,vN as _shadersInstancingStageCommon,wN as _shadersInstancingStageVS,Qz as _shadersIntersectBox,$z as _shadersIntersectClippingPlanes,e4 as _shadersIntersectCylinder,Zz as _shadersIntersectDepth,t4 as _shadersIntersectEllipsoid,wE as _shadersIntersection,Jz as _shadersIntersectionUtils,IN as _shadersLegacyInstancingStageVS,pz as _shadersLensFlare,ZN as _shadersLightingStageFS,QN as _shadersMaterialStageFS,s4 as _shadersMegatexture,WN as _shadersMetadataStageFS,jN as _shadersMetadataStageVS,AN as _shadersModelClippingPlanesStageFS,TN as _shadersModelColorStageFS,uN as _shadersModelFS,bF as _shadersModelSilhouetteStageFS,CF as _shadersModelSilhouetteStageVS,EF as _shadersModelSplitterStageFS,fN as _shadersModelVS,_z as _shadersModifiedReinhardTonemapping,tF as _shadersMorphTargetsStageVS,gz as _shadersNightVision,rP as _shadersNormalMapMaterial,BM as _shadersOctahedralProjectionAtlasFS,kM as _shadersOctahedralProjectionFS,UM as _shadersOctahedralProjectionVS,r4 as _shadersOctree,xu as _shadersPassThrough,Hx as _shadersPassThroughDepth,hP as _shadersPerInstanceColorAppearanceFS,pP as _shadersPerInstanceColorAppearanceVS,jb as _shadersPerInstanceFlatColorAppearanceFS,_P as _shadersPerInstanceFlatColorAppearanceVS,jL as _shadersPointCloudEyeDomeLighting,oF as _shadersPointCloudStylingStageVS,nx as _shadersPointPrimitiveCollectionFS,W2 as _shadersPointPrimitiveCollectionVS,sP as _shadersPolylineArrowMaterial,MM as _shadersPolylineColorAppearanceVS,Lu as _shadersPolylineCommon,aP as _shadersPolylineDashMaterial,sC as _shadersPolylineFS,cP as _shadersPolylineGlowMaterial,LM as _shadersPolylineMaterialAppearanceVS,lP as _shadersPolylineOutlineMaterial,DM as _shadersPolylineShadowVolumeFS,PM as _shadersPolylineShadowVolumeMorphFS,OM as _shadersPolylineShadowVolumeMorphVS,RM as _shadersPolylineShadowVolumeVS,WF as _shadersPolylineVS,aF as _shadersPrimitiveOutlineStageFS,sF as _shadersPrimitiveOutlineStageVS,AR as _shadersRGBToHSB,ER as _shadersRGBToHSL,SR as _shadersRGBToXYZ,yz as _shadersReinhardTonemapping,SU as _shadersReprojectWebMercatorFS,vU as _shadersReprojectWebMercatorVS,uP as _shadersRimLightingMaterial,Av as _shadersSelectedFeatureIdStageCommon,xS as _shadersShadowVolumeAppearanceFS,cM as _shadersShadowVolumeAppearanceVS,t0 as _shadersShadowVolumeFS,xz as _shadersSilhouette,fF as _shadersSkinningStageVS,vI as _shadersSkyAtmosphereCommon,wU as _shadersSkyAtmosphereFS,IU as _shadersSkyAtmosphereVS,DU as _shadersSkyBoxFS,PU as _shadersSkyBoxVS,fP as _shadersSlopeRampMaterial,dP as _shadersStripeMaterial,OU as _shadersSunFS,RU as _shadersSunTextureFS,MU as _shadersSunVS,HD as _shadersTexturedMaterialAppearanceFS,GD as _shadersTexturedMaterialAppearanceVS,QF as _shadersVector3DTileClampedPolylinesFS,$F as _shadersVector3DTileClampedPolylinesVS,ZF as _shadersVector3DTilePolylinesVS,jS as _shadersVectorTileVS,LU as _shadersViewportQuadFS,eE as _shadersViewportQuadVS,Xz as _shadersVoxelFS,Kz as _shadersVoxelVS,mP as _shadersWater,KR as _shadersXYZToRGB,bO as _shadersacesTonemapping,CO as _shadersalphaWeight,TO as _shadersantialias,AO as _shadersapproximateSphericalCoordinates,EO as _shadersbackFacing,SO as _shadersbranchFreeTernary,vO as _shaderscascadeColor,wO as _shaderscascadeDistance,IO as _shaderscascadeMatrix,DO as _shaderscascadeWeights,PO as _shaderscolumbusViewMorph,OO as _shaderscomputePosition,n4 as _shadersconvertUvToBox,i4 as _shadersconvertUvToCylinder,o4 as _shadersconvertUvToEllipsoid,RO as _shaderscosineAndSine,MO as _shadersdecompressTextureCoordinates,LO as _shadersdefaultPbrMaterial,wP as _shadersdegreesPerRadian,NO as _shadersdepthClamp,IP as _shadersdepthRange,fO as _shadersdepthRangeStruct,FO as _shaderseastNorthUpToEyeCoordinates,BO as _shadersellipsoidContainsPoint,kO as _shadersellipsoidWgs84TextureCoordinates,DP as _shadersepsilon1,PP as _shadersepsilon2,OP as _shadersepsilon3,RP as _shadersepsilon4,MP as _shadersepsilon5,LP as _shadersepsilon6,NP as _shadersepsilon7,UO as _shadersequalsEpsilon,VO as _shaderseyeOffset,zO as _shaderseyeToWindowCoordinates,HO as _shadersfastApproximateAtan,GO as _shadersfog,JR as _shadersfromCartesian,WO as _shadersgammaCorrect,jO as _shadersgeodeticSurfaceNormal,qO as _shadersgetDefaultMaterial,ZR as _shadersgetFloodRect,$R as _shadersgetIndexMat,YO as _shadersgetLambertDiffuse,QR as _shadersgetMaxIndex,eM as _shadersgetMaxIndexVal,XO as _shadersgetSpecular,KO as _shadersgetWaterNoise,$O as _shadershue,FP as _shadersinfinity,QO as _shadersinverseGamma,eR as _shadersisEmpty,tR as _shadersisFull,tM as _shadersisInEllipsoid,nM as _shadersisInObliq,nR as _shaderslatitudeToWebMercatorFraction,oR as _shaderslineDistance,iR as _shaderslinearToSrgb,rR as _shadersluminance,iM as _shadersmagnitude,oM as _shadersmagnitudeSquared,dO as _shadersmaterial,mO as _shadersmaterialInput,sR as _shadersmetersPerPixel,hO as _shadersmodelMaterial,aR as _shadersmodelToWindowCoordinates,pO as _shadersmodelVertexOutput,rM as _shadersmultiplyComponents,cR as _shadersmultiplyWithColorBalance,lR as _shadersnearFarScalar,uR as _shadersoctDecode,BP as _shadersoneOverPi,kP as _shadersoneOverTwoPi,fR as _shaderspackDepth,UP as _shaderspassCesium3DTile,VP as _shaderspassCesium3DTileClassification,zP as _shaderspassCesium3DTileClassificationIgnoreShow,HP as _shaderspassClassification,GP as _shaderspassCompute,WP as _shaderspassEnvironment,jP as _shaderspassGlobe,qP as _shaderspassOpaque,YP as _shaderspassOverlay,XP as _shaderspassTerrainClassification,KP as _shaderspassTranslucent,JP as _shaderspassVoxels,dR as _shaderspbrLighting,mR as _shaderspbrMetallicRoughnessMaterial,_O as _shaderspbrParameters,hR as _shaderspbrSpecularGlossinessMaterial,pR as _shadersphong,ZP as _shaderspi,$P as _shaderspiOverFour,QP as _shaderspiOverSix,eO as _shaderspiOverThree,tO as _shaderspiOverTwo,_R as _shadersplaneDistance,gR as _shaderspointAlongRay,nO as _shadersradiansPerDegree,gO as _shadersray,yR as _shadersrayEllipsoidIntersectionInterval,yO as _shadersraySegment,xR as _shadersraySphereIntersectionInterval,bR as _shadersreadDepth,CR as _shadersreadNonPerspective,TR as _shadersreverseLogDepth,vR as _shadersround,wR as _shaderssampleOctahedralProjection,IR as _shaderssaturation,sM as _shadersscaleToGeodeticSurface,iO as _shaderssceneMode2D,oO as _shaderssceneMode3D,rO as _shaderssceneModeColumbusView,sO as _shaderssceneModeMorphing,DR as _shadersshadowDepthCompare,xO as _shadersshadowParameters,PR as _shadersshadowVisibility,OR as _shaderssignNotZero,aO as _shaderssolarRadius,RR as _shaderssphericalHarmonics,MR as _shaderssrgbToLinear,LR as _shaderstangentToEyeSpaceMatrix,NR as _shaderstextureCube,cO as _shadersthreePiOver2,FR as _shaderstransformPlane,BR as _shaderstranslateRelativeToEye,kR as _shaderstranslucentPhong,UR as _shaderstranspose,lO as _shaderstwoPi,VR as _shadersunpackDepth,zR as _shadersunpackFloat,HR as _shadersunpackUint,GR as _shadersvalueTransform,WR as _shadersvertexLogDepth,uO as _shaderswebMercatorMaxLatitude,jR as _shaderswindowToEyeCoordinates,qR as _shaderswriteDepthClamp,YR as _shaderswriteLogDepth,XR as _shaderswriteNonPerspective,pL as addBuffer,rL as addDefaults,dL as addExtensionsRequired,Yf as addExtensionsUsed,C0 as addPipelineExtras,xs as addToArray,ED as appendForwardSlash,Ao as arrayRemoveDuplicates,Jb as barycentricCoordinates,Oo as binarySearch,pN as buildDrawCommand,nn as buildModuleUrl,u4 as buildVoxelDrawCommands,Ye as clone,_t as combine,PE as computeFlyToLocationForRectangle,rT as createBillboardPointCallback,vn as createCommand,X4 as createDefaultImageryProviderViewModels,K4 as createDefaultTerrainProviderViewModels,B0e as createElevationBandMaterial,k0e as createGooglePhotorealistic3DTileset,jn as createGuid,Ro as createMaterialPropertyDescriptor,U0e as createOsmBuildings,V0e as createOsmBuildingsAsync,le as createPropertyDescriptor,Ll as createRawPropertyDescriptor,z0e as createTangentSpaceDebugPrimitive,Hxe as createTaskProcessorWorker,EP as createUniform,SP as createUniformArray,H0e as createWorldImagery,Ay as createWorldImageryAsync,Mme as createWorldTerrain,GA as createWorldTerrainAsync,Mk as decodeGoogleEarthEnterpriseData,t2 as decodeVectorPolylinePositions,y as defaultValue,ua as defer,l as defined,aM as demodernizeShader,Q as deprecationWarning,ue as destroyObject,gfe as exportKml,PC as findAccessorMinMax,dT as findContentMetadata,mT as findGroupMetadata,r2 as findTileMetadata,ev as forEachTextureInMaterial,Vp as formatError,qJ as freezeRenderState,d_ as getAbsoluteUri,zl as getAccessorByteStride,SD as getBaseUri,Fu as getBinaryAccessor,A4 as getClipAndStyleCode,Ty as getClippingFunction,j_ as getComponentReader,Mn as getElement,Pb as getExtensionFromUri,Dg as getFilenameFromUri,kk as getImageFromTypedArray,Jd as getImagePixels,Mo as getJsonFromTypedArray,ym as getMagic,Bl as getStringFromTypedArray,Ti as getTimestamp,ii as hasExtension,I_ as heightReferenceOnEntityPropertyChanged,Rc as isBitSet,Ob as isBlobUri,Rb as isCrossOriginUrl,m_ as isDataUri,u_ as isLeapYear,Ce as knockout,UE as knockout_3_5_1,H4 as knockout_es5,Mb as loadAndExecuteScript,dU as loadCubeMap,IC as loadImageFromTypedArray,Rl as loadKTX2,py as mergeSort,fL as moveTechniqueRenderStates,mL as moveTechniquesToExtension,ku as numberOfComponentsForType,Lb as objectToQuery,Nt as oneTimeWarning,Q_ as parseBatchTable,OL as parseBoundingVolumeSemantics,FL as parseFeatureMetadataLegacy,cL as parseGlb,wD as parseResponseHeaders,NL as parseStructuralMetadata,Ehe as pointInsideTriangle,bp as preprocess3DTileContent,l4 as processVoxelProperties,Iu as queryToObject,_L as readAccessorPacked,OC as removeExtension,aL as removeExtensionsRequired,DC as removeExtensionsUsed,uL as removePipelineExtras,hL as removeUnusedElements,A0 as resizeImageToNextPowerOfTwo,GB as sampleTerrain,Hg as sampleTerrainMostDetailed,Tb as scaleToGeodeticSurface,lM as subdivideArray,wa as subscribeAndEvaluate,yL as updateAccessorComponentTypes,TL as updateVersion,hr as usesExtension,vbe as viewerCesium3DTilesInspectorMixin,wbe as viewerCesiumInspectorMixin,Dbe as viewerDragDropMixin,Pbe as viewerPerformanceWatchdogMixin,Rbe as viewerVoxelInspectorMixin,gpe as webGLConstantToGlslType,rU as wrapFunction,aT as writeTextToCanvas}; diff --git a/public/lib/ammo/ex/ConvexObjectBreaker.js b/public/lib/ammo/ex/ConvexObjectBreaker.js deleted file mode 100644 index faae9e7f..00000000 --- a/public/lib/ammo/ex/ConvexObjectBreaker.js +++ /dev/null @@ -1,489 +0,0 @@ -/** - * @author yomboprime https://github.com/yomboprime - * - * @fileoverview This class can be used to subdivide a convex Geometry object into pieces. - * - * Usage: - * - * Use the function prepareBreakableObject to prepare a Mesh object to be broken. - * - * Then, call the various functions to subdivide the object (subdivideByImpact, cutByPlane) - * - * Sub-objects that are product of subdivision don't need prepareBreakableObject to be called on them. - * - * Requisites for the object: - * - * - Mesh object must have a Geometry (not BufferGeometry) and a Material - * - * - The Geometry must be convex (this is not tested in the library). You can create convex - * Geometries with THREE.ConvexGeometry. The BoxGeometry, SphereGeometry and other convex primitives - * can also be used. - * - * Note: This lib adds member variables to object's userData member and to its vertices. - * (see prepareBreakableObject function) - * Use with caution and read the code when using with other libs. - * - * @param {double} minSizeForBreak Min size a debris can have to break. - * @param {double} smallDelta Max distance to consider that a point belongs to a plane. - * - */ - -THREE.ConvexObjectBreaker = function (minSizeForBreak, smallDelta) { - - this.minSizeForBreak = minSizeForBreak || 1.4; - this.smallDelta = smallDelta || 0.0001; - - this.tempLine1 = new THREE.Line3(); - this.tempPlane1 = new THREE.Plane(); - this.tempPlane2 = new THREE.Plane(); - this.tempCM1 = new THREE.Vector3(); - this.tempCM2 = new THREE.Vector3(); - this.tempVector3 = new THREE.Vector3(); - this.tempVector3_2 = new THREE.Vector3(); - this.tempVector3_3 = new THREE.Vector3(); - this.tempResultObjects = { object1: null, object2: null }; - - this.segments = []; - var n = 30 * 30; - for (var i = 0; i < n; i++) { - this.segments[i] = false; - } - -}; - -THREE.ConvexObjectBreaker.prototype = { - - constructor: THREE.ConvexObjectBreaker, - - prepareBreakableObject: function (object, mass, velocity, angularVelocity, breakable) { - - // object is a THREE.Object3d (normally a Mesh), must have a Geometry, and it must be convex. - // Its material property is propagated to its children (sub-pieces) - // mass must be > 0 - - // Create vertices mark - var geometry = object.geometry; - var vertices = geometry.vertices; - for (var i = 0, il = vertices.length; i < il; i++) { - vertices[i].mark = 0; - } - - var userData = object.userData; - userData.mass = mass; - userData.velocity = velocity.clone(); - userData.angularVelocity = angularVelocity.clone(); - userData.breakable = breakable; - }, - - /* - * @param {int} maxRadialIterations Iterations for radial cuts. - * @param {int} maxRandomIterations Max random iterations for not-radial cuts - * @param {double} minSizeForRadialSubdivision Min size a debris can have to break in radial subdivision. - * - * Returns the array of pieces - */ - subdivideByImpact: function (object, pointOfImpact, normal, maxRadialIterations, maxRandomIterations, minSizeForRadialSubdivision) { - - var debris = []; - - var tempPlane1 = this.tempPlane1; - var tempPlane2 = this.tempPlane2; - - this.tempVector3.addVectors(pointOfImpact, normal); - tempPlane1.setFromCoplanarPoints(pointOfImpact, object.position, this.tempVector3); - - var maxTotalIterations = maxRandomIterations + maxRadialIterations; - - var scope = this; - - function subdivideRadial(subObject, startAngle, endAngle, numIterations) { - - if (Math.random() < numIterations * 0.05 || numIterations > maxTotalIterations) { - - debris.push(subObject); - - return; - - } - - var angle = Math.PI; - - if (numIterations === 0) { - - tempPlane2.normal.copy(tempPlane1.normal); - tempPlane2.constant = tempPlane1.constant; - - } - else { - - if (numIterations <= maxRadialIterations) { - - angle = (endAngle - startAngle) * (0.2 + 0.6 * Math.random()) + startAngle; - - // Rotate tempPlane2 at impact point around normal axis and the angle - scope.tempVector3_2.copy(object.position).sub(pointOfImpact).applyAxisAngle(normal, angle).add(pointOfImpact); - tempPlane2.setFromCoplanarPoints(pointOfImpact, scope.tempVector3, scope.tempVector3_2); - - } - else { - - angle = ((0.5 * (numIterations & 1)) + 0.2 * (2 - Math.random())) * Math.PI; - - // Rotate tempPlane2 at object position around normal axis and the angle - scope.tempVector3_2.copy(pointOfImpact).sub(subObject.position).applyAxisAngle(normal, angle).add(subObject.position); - scope.tempVector3_3.copy(normal).add(subObject.position); - tempPlane2.setFromCoplanarPoints(subObject.position, scope.tempVector3_3, scope.tempVector3_2); - - } - - } - - // Perform the cut - scope.cutByPlane(subObject, tempPlane2, scope.tempResultObjects); - - var obj1 = scope.tempResultObjects.object1; - var obj2 = scope.tempResultObjects.object2; - - if (obj1) { - - subdivideRadial(obj1, startAngle, angle, numIterations + 1); - - } - - if (obj2) { - - subdivideRadial(obj2, angle, endAngle, numIterations + 1); - - } - - } - - subdivideRadial(object, 0, 2 * Math.PI, 0); - - return debris; - - }, - - cutByPlane: function (object, plane, output) { - - // Returns breakable objects in output.object1 and output.object2 members, the resulting 2 pieces of the cut. - // object2 can be null if the plane doesn't cut the object. - // object1 can be null only in case of internal error - // Returned value is number of pieces, 0 for error. - - var geometry = object.geometry; - var points = geometry.vertices; - var faces = geometry.faces; - - var numPoints = points.length; - - var points1 = []; - var points2 = []; - - var delta = this.smallDelta; - - // Reset vertices mark - for (var i = 0; i < numPoints; i++) { - points[i].mark = 0; - } - - // Reset segments mark - var numPointPairs = numPoints * numPoints; - for (var i = 0; i < numPointPairs; i++) { - this.segments[i] = false; - } - - // Iterate through the faces to mark edges shared by coplanar faces - for (var i = 0, il = faces.length - 1; i < il; i++) { - - var face1 = faces[i]; - - for (var j = i + 1, jl = faces.length; j < jl; j++) { - - var face2 = faces[j]; - - var coplanar = 1 - face1.normal.dot(face2.normal) < delta; - - if (coplanar) { - - var a1 = face1.a; - var b1 = face1.b; - var c1 = face1.c; - var a2 = face2.a; - var b2 = face2.b; - var c2 = face2.c; - - - if (a1 === a2 || a1 === b2 || a1 === c2) { - if (b1 === a2 || b1 === b2 || b1 === c2) { - this.segments[a1 * numPoints + b1] = true; - this.segments[b1 * numPoints + a1] = true; - } - else { - this.segments[c1 * numPoints + a1] = true; - this.segments[a1 * numPoints + c1] = true; - } - } - else if (b1 === a2 || b1 === b2 || b1 === c2) { - this.segments[c1 * numPoints + b1] = true; - this.segments[b1 * numPoints + c1] = true; - } - - } - - } - - } - - // Transform the plane to object local space - var localPlane = this.tempPlane1; - - THREE.ConvexObjectBreaker.transformPlaneToLocalSpace(plane, object.matrix, localPlane); - - // Iterate through the faces adding points to both pieces - for (var i = 0, il = faces.length; i < il; i++) { - - var face = faces[i]; - - for (var segment = 0; segment < 3; segment++) { - - var i0 = segment === 0 ? face.a : (segment === 1 ? face.b : face.c); - var i1 = segment === 0 ? face.b : (segment === 1 ? face.c : face.a); - - var segmentState = this.segments[i0 * numPoints + i1]; - - if (segmentState) { - // The segment already has been processed in another face - continue; - } - - // Mark segment as processed (also inverted segment) - this.segments[i0 * numPoints + i1] = true; - this.segments[i1 * numPoints + i0] = true; - - var p0 = points[i0]; - var p1 = points[i1]; - - if (p0.mark === 0) { - - var d = localPlane.distanceToPoint(p0); - - // mark: 1 for negative side, 2 for positive side, 3 for coplanar point - if (d > delta) { - p0.mark = 2; - points2.push(p0); - } - else if (d < -delta) { - p0.mark = 1; - points1.push(p0); - } - else { - p0.mark = 3; - points1.push(p0); - var p0_2 = p0.clone(); - p0_2.mark = 3; - points2.push(p0_2); - } - - } - - if (p1.mark === 0) { - - var d = localPlane.distanceToPoint(p1); - - // mark: 1 for negative side, 2 for positive side, 3 for coplanar point - if (d > delta) { - p1.mark = 2; - points2.push(p1); - } - else if (d < -delta) { - p1.mark = 1; - points1.push(p1); - } - else { - p1.mark = 3; - points1.push(p1); - var p1_2 = p1.clone(); - p1_2.mark = 3; - points2.push(p1_2); - } - - } - - var mark0 = p0.mark; - var mark1 = p1.mark; - - if ((mark0 === 1 && mark1 === 2) || (mark0 === 2 && mark1 === 1)) { - - // Intersection of segment with the plane - - this.tempLine1.start.copy(p0); - this.tempLine1.end.copy(p1); - var intersection = localPlane.intersectLine(this.tempLine1); - if (intersection === undefined) { - // Shouldn't happen - console.error("Internal error: segment does not intersect plane."); - output.segmentedObject1 = null; - output.segmentedObject2 = null; - return 0; - } - - intersection.mark = 1; - points1.push(intersection); - var intersection_2 = intersection.clone(); - intersection_2.mark = 2; - points2.push(intersection_2); - - } - - } - - } - - // Calculate debris mass (very fast and imprecise): - var newMass = object.userData.mass * 0.5; - - // Calculate debris Center of Mass (again fast and imprecise) - this.tempCM1.set(0, 0, 0); - var radius1 = 0; - var numPoints1 = points1.length; - if (numPoints1 > 0) { - for (var i = 0; i < numPoints1; i++) { - this.tempCM1.add(points1[i]); - } - this.tempCM1.divideScalar(numPoints1); - for (var i = 0; i < numPoints1; i++) { - var p = points1[i]; - p.sub(this.tempCM1); - radius1 = Math.max(radius1, p.x, p.y, p.z); - } - this.tempCM1.add(object.position); - } - - this.tempCM2.set(0, 0, 0); - var radius2 = 0; - var numPoints2 = points2.length; - if (numPoints2 > 0) { - for (var i = 0; i < numPoints2; i++) { - this.tempCM2.add(points2[i]); - } - this.tempCM2.divideScalar(numPoints2); - for (var i = 0; i < numPoints2; i++) { - var p = points2[i]; - p.sub(this.tempCM2); - radius2 = Math.max(radius2, p.x, p.y, p.z); - } - this.tempCM2.add(object.position); - } - - var object1 = null; - var object2 = null; - - var numObjects = 0; - - if (numPoints1 > 4) { - - object1 = new THREE.Mesh(new THREE.ConvexGeometry(points1), object.material); - object1.position.copy(this.tempCM1); - object1.quaternion.copy(object.quaternion); - - this.prepareBreakableObject(object1, newMass, object.userData.velocity, object.userData.angularVelocity, 2 * radius1 > this.minSizeForBreak); - - numObjects++; - - } - - if (numPoints2 > 4) { - - object2 = new THREE.Mesh(new THREE.ConvexGeometry(points2), object.material); - object2.position.copy(this.tempCM2); - object2.quaternion.copy(object.quaternion); - - this.prepareBreakableObject(object2, newMass, object.userData.velocity, object.userData.angularVelocity, 2 * radius2 > this.minSizeForBreak); - - numObjects++; - - } - - - output.object1 = object1; - output.object2 = object2; - - return numObjects; - - } - -}; - -THREE.ConvexObjectBreaker.transformFreeVector = function (v, m) { - - // input: - // vector interpreted as a free vector - // THREE.Matrix4 orthogonal matrix (matrix without scale) - - var x = v.x, y = v.y, z = v.z; - var e = m.elements; - - v.x = e[0] * x + e[4] * y + e[8] * z; - v.y = e[1] * x + e[5] * y + e[9] * z; - v.z = e[2] * x + e[6] * y + e[10] * z; - - return v; - -}; - -THREE.ConvexObjectBreaker.transformFreeVectorInverse = function (v, m) { - - // input: - // vector interpreted as a free vector - // THREE.Matrix4 orthogonal matrix (matrix without scale) - - var x = v.x, y = v.y, z = v.z; - var e = m.elements; - - v.x = e[0] * x + e[1] * y + e[2] * z; - v.y = e[4] * x + e[5] * y + e[6] * z; - v.z = e[8] * x + e[9] * y + e[10] * z; - - return v; - -}; - -THREE.ConvexObjectBreaker.transformTiedVectorInverse = function (v, m) { - - // input: - // vector interpreted as a tied (ordinary) vector - // THREE.Matrix4 orthogonal matrix (matrix without scale) - - var x = v.x, y = v.y, z = v.z; - var e = m.elements; - - v.x = e[0] * x + e[1] * y + e[2] * z - e[12]; - v.y = e[4] * x + e[5] * y + e[6] * z - e[13]; - v.z = e[8] * x + e[9] * y + e[10] * z - e[14]; - - return v; - -}; - -THREE.ConvexObjectBreaker.transformPlaneToLocalSpace = function () { - - var v1 = new THREE.Vector3(); - var m1 = new THREE.Matrix3(); - - return function transformPlaneToLocalSpace(plane, m, resultPlane) { - - resultPlane.normal.copy(plane.normal); - resultPlane.constant = plane.constant; - - var referencePoint = THREE.ConvexObjectBreaker.transformTiedVectorInverse(plane.coplanarPoint(v1), m); - - THREE.ConvexObjectBreaker.transformFreeVectorInverse(resultPlane.normal, m); - - // recalculate constant (like in setFromNormalAndCoplanarPoint) - resultPlane.constant = -referencePoint.dot(resultPlane.normal); - - - }; - -}(); diff --git a/public/lib/ammo/ex/QuickHull.js b/public/lib/ammo/ex/QuickHull.js deleted file mode 100644 index 5c3ab0cf..00000000 --- a/public/lib/ammo/ex/QuickHull.js +++ /dev/null @@ -1,1218 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - * - * Ported from: https://github.com/maurizzzio/quickhull3d/ by Mauricio Poppe (https://github.com/maurizzzio) - * - */ - -( function() { - - var Visible = 0; - var Deleted = 1; - - function QuickHull() { - - this.tolerance = - 1; - - this.faces = []; // the generated faces of the convex hull - this.newFaces = []; // this array holds the faces that are generated within a single iteration - - // the vertex lists work as follows: - // - // let 'a' and 'b' be 'Face' instances - // let 'v' be points wrapped as instance of 'Vertex' - // - // [v, v, ..., v, v, v, ...] - // ^ ^ - // | | - // a.outside b.outside - // - this.assigned = new VertexList(); - this.unassigned = new VertexList(); - - this.vertices = []; // vertices of the hull (internal representation of given geometry data) - - } - - Object.assign( QuickHull.prototype, { - - setFromPoints: function ( points ) { - - if ( Array.isArray( points ) !== true ) { - - console.error( 'THREE.QuickHull: Points parameter is not an array.' ); - - } - - if ( points.length < 4 ) { - - console.error( 'THREE.QuickHull: The algorithm needs at least four points.' ); - - } - - this.makeEmpty(); - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - this.vertices.push( new VertexNode( points[ i ] ) ); - - } - - this.compute(); - - return this; - - }, - - setFromObject: function ( object ) { - - var points = []; - - object.updateMatrixWorld( true ); - - object.traverse( function ( node ) { - - var i, l, point; - - var geometry = node.geometry; - - if ( geometry !== undefined ) { - - if ( geometry.isGeometry ) { - - var vertices = geometry.vertices; - - for ( i = 0, l = vertices.length; i < l; i ++ ) { - - point = vertices[ i ].clone(); - point.applyMatrix4( node.matrixWorld ); - - points.push( point ); - - } - - } else if ( geometry.isBufferGeometry ) { - - var attribute = geometry.attributes.position; - - if ( attribute !== undefined ) { - - for ( i = 0, l = attribute.count; i < l; i ++ ) { - - point = new THREE.Vector3(); - - point.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld ); - - points.push( point ); - - } - - } - - } - - } - - } ); - - return this.setFromPoints( points ); - - }, - - makeEmpty: function () { - - this.faces = []; - this.vertices = []; - - return this; - - }, - - // Adds a vertex to the 'assigned' list of vertices and assigns it to the given face - - addVertexToFace: function ( vertex, face ) { - - vertex.face = face; - - if ( face.outside === null ) { - - this.assigned.append( vertex ); - - } else { - - this.assigned.insertBefore( face.outside, vertex ); - - } - - face.outside = vertex; - - return this; - - }, - - // Removes a vertex from the 'assigned' list of vertices and from the given face - - removeVertexFromFace: function ( vertex, face ) { - - if ( vertex === face.outside ) { - - // fix face.outside link - - if ( vertex.next !== null && vertex.next.face === face ) { - - // face has at least 2 outside vertices, move the 'outside' reference - - face.outside = vertex.next; - - } else { - - // vertex was the only outside vertex that face had - - face.outside = null; - - } - - } - - this.assigned.remove( vertex ); - - return this; - - }, - - // Removes all the visible vertices that a given face is able to see which are stored in the 'assigned' vertext list - - removeAllVerticesFromFace: function ( face ) { - - if ( face.outside !== null ) { - - // reference to the first and last vertex of this face - - var start = face.outside; - var end = face.outside; - - while ( end.next !== null && end.next.face === face ) { - - end = end.next; - - } - - this.assigned.removeSubList( start, end ); - - // fix references - - start.prev = end.next = null; - face.outside = null; - - return start; - - } - - }, - - // Removes all the visible vertices that 'face' is able to see - - deleteFaceVertices: function ( face, absorbingFace ) { - - var faceVertices = this.removeAllVerticesFromFace( face ); - - if ( faceVertices !== undefined ) { - - if ( absorbingFace === undefined ) { - - // mark the vertices to be reassigned to some other face - - this.unassigned.appendChain( faceVertices ); - - - } else { - - // if there's an absorbing face try to assign as many vertices as possible to it - - var vertex = faceVertices; - - do { - - // we need to buffer the subsequent vertex at this point because the 'vertex.next' reference - // will be changed by upcoming method calls - - var nextVertex = vertex.next; - - var distance = absorbingFace.distanceToPoint( vertex.point ); - - // check if 'vertex' is able to see 'absorbingFace' - - if ( distance > this.tolerance ) { - - this.addVertexToFace( vertex, absorbingFace ); - - } else { - - this.unassigned.append( vertex ); - - } - - // now assign next vertex - - vertex = nextVertex; - - } while ( vertex !== null ); - - } - - } - - return this; - - }, - - // Reassigns as many vertices as possible from the unassigned list to the new faces - - resolveUnassignedPoints: function ( newFaces ) { - - if ( this.unassigned.isEmpty() === false ) { - - var vertex = this.unassigned.first(); - - do { - - // buffer 'next' reference, see .deleteFaceVertices() - - var nextVertex = vertex.next; - - var maxDistance = this.tolerance; - - var maxFace = null; - - for ( var i = 0; i < newFaces.length; i ++ ) { - - var face = newFaces[ i ]; - - if ( face.mark === Visible ) { - - var distance = face.distanceToPoint( vertex.point ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - maxFace = face; - - } - - if ( maxDistance > 1000 * this.tolerance ) break; - - } - - } - - // 'maxFace' can be null e.g. if there are identical vertices - - if ( maxFace !== null ) { - - this.addVertexToFace( vertex, maxFace ); - - } - - vertex = nextVertex; - - } while ( vertex !== null ); - - } - - return this; - - }, - - // Computes the extremes of a simplex which will be the initial hull - - computeExtremes: function () { - - var min = new THREE.Vector3(); - var max = new THREE.Vector3(); - - var minVertices = []; - var maxVertices = []; - - var i, l, j; - - // initially assume that the first vertex is the min/max - - for ( i = 0; i < 3; i ++ ) { - - minVertices[ i ] = maxVertices[ i ] = this.vertices[ 0 ]; - - } - - min.copy( this.vertices[ 0 ].point ); - max.copy( this.vertices[ 0 ].point ); - - // compute the min/max vertex on all six directions - - for ( i = 0, l = this.vertices.length; i < l ; i ++ ) { - - var vertex = this.vertices[ i ]; - var point = vertex.point; - - // update the min coordinates - - for ( j = 0; j < 3; j ++ ) { - - if ( point.getComponent( j ) < min.getComponent( j ) ) { - - min.setComponent( j, point.getComponent( j ) ); - minVertices[ j ] = vertex; - - } - - } - - // update the max coordinates - - for ( j = 0; j < 3; j ++ ) { - - if ( point.getComponent( j ) > max.getComponent( j ) ) { - - max.setComponent( j, point.getComponent( j ) ); - maxVertices[ j ] = vertex; - - } - - } - - } - - // use min/max vectors to compute an optimal epsilon - - this.tolerance = 3 * Number.EPSILON * ( - Math.max( Math.abs( min.x ), Math.abs( max.x ) ) + - Math.max( Math.abs( min.y ), Math.abs( max.y ) ) + - Math.max( Math.abs( min.z ), Math.abs( max.z ) ) - ); - - return { min: minVertices, max: maxVertices }; - - }, - - // Computes the initial simplex assigning to its faces all the points - // that are candidates to form part of the hull - - computeInitialHull: function () { - - var line3, plane, closestPoint; - - return function computeInitialHull () { - - if ( line3 === undefined ) { - - line3 = new THREE.Line3(); - plane = new THREE.Plane(); - closestPoint = new THREE.Vector3(); - - } - - var vertex, vertices = this.vertices; - var extremes = this.computeExtremes(); - var min = extremes.min; - var max = extremes.max; - - var v0, v1, v2, v3; - var i, l, j; - - // 1. Find the two vertices 'v0' and 'v1' with the greatest 1d separation - // (max.x - min.x) - // (max.y - min.y) - // (max.z - min.z) - - var distance, maxDistance = 0; - var index = 0; - - for ( i = 0; i < 3; i ++ ) { - - distance = max[ i ].point.getComponent( i ) - min[ i ].point.getComponent( i ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - index = i; - - } - - } - - v0 = min[ index ]; - v1 = max[ index ]; - - // 2. The next vertex 'v2' is the one farthest to the line formed by 'v0' and 'v1' - - maxDistance = 0; - line3.set( v0.point, v1.point ); - - for ( i = 0, l = this.vertices.length; i < l; i ++ ) { - - vertex = vertices[ i ]; - - if ( vertex !== v0 && vertex !== v1 ) { - - line3.closestPointToPoint( vertex.point, true, closestPoint ); - - distance = closestPoint.distanceToSquared( vertex.point ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - v2 = vertex; - - } - - } - - } - - // 3. The next vertex 'v3' is the one farthest to the plane 'v0', 'v1', 'v2' - - maxDistance = 0; - plane.setFromCoplanarPoints( v0.point, v1.point, v2.point ); - - for ( i = 0, l = this.vertices.length; i < l; i ++ ) { - - vertex = vertices[ i ]; - - if ( vertex !== v0 && vertex !== v1 && vertex !== v2 ) { - - distance = Math.abs( plane.distanceToPoint( vertex.point ) ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - v3 = vertex; - - } - - } - - } - - var faces = []; - - if ( plane.distanceToPoint( v3.point ) < 0 ) { - - // the face is not able to see the point so 'plane.normal' is pointing outside the tetrahedron - - faces.push( - Face.create( v0, v1, v2 ), - Face.create( v3, v1, v0 ), - Face.create( v3, v2, v1 ), - Face.create( v3, v0, v2 ) - ); - - // set the twin edge - - for ( i = 0; i < 3; i ++ ) { - - j = ( i + 1 ) % 3; - - // join face[ i ] i > 0, with the first face - - faces[ i + 1 ].getEdge( 2 ).setTwin( faces[ 0 ].getEdge( j ) ); - - // join face[ i ] with face[ i + 1 ], 1 <= i <= 3 - - faces[ i + 1 ].getEdge( 1 ).setTwin( faces[ j + 1 ].getEdge( 0 ) ); - - } - - } else { - - // the face is able to see the point so 'plane.normal' is pointing inside the tetrahedron - - faces.push( - Face.create( v0, v2, v1 ), - Face.create( v3, v0, v1 ), - Face.create( v3, v1, v2 ), - Face.create( v3, v2, v0 ) - ); - - // set the twin edge - - for ( i = 0; i < 3; i ++ ) { - - j = ( i + 1 ) % 3; - - // join face[ i ] i > 0, with the first face - - faces[ i + 1 ].getEdge( 2 ).setTwin( faces[ 0 ].getEdge( ( 3 - i ) % 3 ) ); - - // join face[ i ] with face[ i + 1 ] - - faces[ i + 1 ].getEdge( 0 ).setTwin( faces[ j + 1 ].getEdge( 1 ) ); - - } - - } - - // the initial hull is the tetrahedron - - for ( i = 0; i < 4; i ++ ) { - - this.faces.push( faces[ i ] ); - - } - - // initial assignment of vertices to the faces of the tetrahedron - - for ( i = 0, l = vertices.length; i < l; i ++ ) { - - vertex = vertices[i]; - - if ( vertex !== v0 && vertex !== v1 && vertex !== v2 && vertex !== v3 ) { - - maxDistance = this.tolerance; - var maxFace = null; - - for ( j = 0; j < 4; j ++ ) { - - distance = this.faces[ j ].distanceToPoint( vertex.point ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - maxFace = this.faces[ j ]; - - } - - } - - if ( maxFace !== null ) { - - this.addVertexToFace( vertex, maxFace ); - - } - - } - - } - - return this; - - }; - - }(), - - // Removes inactive faces - - reindexFaces: function () { - - var activeFaces = []; - - for ( var i = 0; i < this.faces.length; i ++ ) { - - var face = this.faces[ i ]; - - if ( face.mark === Visible ) { - - activeFaces.push( face ); - - } - - } - - this.faces = activeFaces; - - return this; - - }, - - // Finds the next vertex to create faces with the current hull - - nextVertexToAdd: function () { - - // if the 'assigned' list of vertices is empty, no vertices are left. return with 'undefined' - - if ( this.assigned.isEmpty() === false ) { - - var eyeVertex, maxDistance = 0; - - // grap the first available face and start with the first visible vertex of that face - - var eyeFace = this.assigned.first().face; - var vertex = eyeFace.outside; - - // now calculate the farthest vertex that face can see - - do { - - var distance = eyeFace.distanceToPoint( vertex.point ); - - if ( distance > maxDistance ) { - - maxDistance = distance; - eyeVertex = vertex; - - } - - vertex = vertex.next; - - } while ( vertex !== null && vertex.face === eyeFace ); - - return eyeVertex; - - } - - }, - - // Computes a chain of half edges in CCW order called the 'horizon'. - // For an edge to be part of the horizon it must join a face that can see - // 'eyePoint' and a face that cannot see 'eyePoint'. - - computeHorizon: function ( eyePoint, crossEdge, face, horizon ) { - - // moves face's vertices to the 'unassigned' vertex list - - this.deleteFaceVertices( face ); - - face.mark = Deleted; - - var edge; - - if ( crossEdge === null ) { - - edge = crossEdge = face.getEdge( 0 ); - - } else { - - // start from the next edge since 'crossEdge' was already analyzed - // (actually 'crossEdge.twin' was the edge who called this method recursively) - - edge = crossEdge.next; - - } - - do { - - var twinEdge = edge.twin; - var oppositeFace = twinEdge.face; - - if ( oppositeFace.mark === Visible ) { - - if ( oppositeFace.distanceToPoint( eyePoint ) > this.tolerance ) { - - // the opposite face can see the vertex, so proceed with next edge - - this.computeHorizon( eyePoint, twinEdge, oppositeFace, horizon ); - - } else { - - // the opposite face can't see the vertex, so this edge is part of the horizon - - horizon.push( edge ); - - } - - } - - edge = edge.next; - - } while ( edge !== crossEdge ); - - return this; - - }, - - // Creates a face with the vertices 'eyeVertex.point', 'horizonEdge.tail' and 'horizonEdge.head' in CCW order - - addAdjoiningFace: function ( eyeVertex, horizonEdge ) { - - // all the half edges are created in ccw order thus the face is always pointing outside the hull - - var face = Face.create( eyeVertex, horizonEdge.tail(), horizonEdge.head() ); - - this.faces.push( face ); - - // join face.getEdge( - 1 ) with the horizon's opposite edge face.getEdge( - 1 ) = face.getEdge( 2 ) - - face.getEdge( - 1 ).setTwin( horizonEdge.twin ); - - return face.getEdge( 0 ); // the half edge whose vertex is the eyeVertex - - - }, - - // Adds 'horizon.length' faces to the hull, each face will be linked with the - // horizon opposite face and the face on the left/right - - addNewFaces: function ( eyeVertex, horizon ) { - - this.newFaces = []; - - var firstSideEdge = null; - var previousSideEdge = null; - - for ( var i = 0; i < horizon.length; i ++ ) { - - var horizonEdge = horizon[ i ]; - - // returns the right side edge - - var sideEdge = this.addAdjoiningFace( eyeVertex, horizonEdge ); - - if ( firstSideEdge === null ) { - - firstSideEdge = sideEdge; - - } else { - - // joins face.getEdge( 1 ) with previousFace.getEdge( 0 ) - - sideEdge.next.setTwin( previousSideEdge ); - - } - - this.newFaces.push( sideEdge.face ); - previousSideEdge = sideEdge; - - } - - // perform final join of new faces - - firstSideEdge.next.setTwin( previousSideEdge ); - - return this; - - }, - - // Adds a vertex to the hull - - addVertexToHull: function ( eyeVertex ) { - - var horizon = []; - var i, face; - - this.unassigned.clear(); - - // remove 'eyeVertex' from 'eyeVertex.face' so that it can't be added to the 'unassigned' vertex list - - this.removeVertexFromFace( eyeVertex, eyeVertex.face ); - - this.computeHorizon( eyeVertex.point, null, eyeVertex.face, horizon ); - - this.addNewFaces( eyeVertex, horizon ); - - // reassign 'unassigned' vertices to the new faces - - this.resolveUnassignedPoints( this.newFaces ); - - return this; - - }, - - cleanup: function () { - - this.assigned.clear(); - this.unassigned.clear(); - this.newFaces = []; - - return this; - - }, - - compute: function () { - - var vertex; - - this.computeInitialHull(); - - // add all available vertices gradually to the hull - - while ( ( vertex = this.nextVertexToAdd() ) !== undefined ) { - - this.addVertexToHull( vertex ); - - } - - this.reindexFaces(); - - this.cleanup(); - - return this; - - } - - } ); - - // - - function Face() { - - this.normal = new THREE.Vector3(); - this.midpoint = new THREE.Vector3(); - this.area = 0; - - this.constant = 0; // signed distance from face to the origin - this.outside = null; // reference to a vertex in a vertex list this face can see - this.mark = Visible; - this.edge = null; - - } - - Object.assign( Face, { - - create: function( a, b, c ) { - - var face = new Face(); - - var e0 = new HalfEdge( a, face ); - var e1 = new HalfEdge( b, face ); - var e2 = new HalfEdge( c, face ); - - // join edges - - e0.next = e2.prev = e1; - e1.next = e0.prev = e2; - e2.next = e1.prev = e0; - - // main half edge reference - - face.edge = e0; - - return face.compute(); - - } - - } ); - - Object.assign( Face.prototype, { - - getEdge: function ( i ) { - - var edge = this.edge; - - while ( i > 0 ) { - - edge = edge.next; - i --; - - } - - while ( i < 0 ) { - - edge = edge.prev; - i ++; - - } - - return edge; - - }, - - compute: function () { - - var triangle; - - return function compute () { - - if ( triangle === undefined ) triangle = new THREE.Triangle(); - - var a = this.edge.tail(); - var b = this.edge.head(); - var c = this.edge.next.head(); - - triangle.set( a.point, b.point, c.point ); - - triangle.normal( this.normal ); - triangle.midpoint( this.midpoint ); - this.area = triangle.area(); - - this.constant = this.normal.dot( this.midpoint ); - - return this; - - }; - - }(), - - distanceToPoint: function ( point ) { - - return this.normal.dot( point ) - this.constant; - - } - - } ); - - // Entity for a Doubly-Connected Edge List (DCEL). - - function HalfEdge( vertex, face ) { - - this.vertex = vertex; - this.prev = null; - this.next = null; - this.twin = null; - this.face = face; - - } - - Object.assign( HalfEdge.prototype, { - - head: function () { - - return this.vertex; - - }, - - tail: function () { - - return this.prev ? this.prev.vertex : null; - - }, - - length: function () { - - var head = this.head(); - var tail = this.tail(); - - if ( tail !== null ) { - - return tail.point.distanceTo( head.point ); - - } - - return - 1; - - }, - - lengthSquared: function () { - - var head = this.head(); - var tail = this.tail(); - - if ( tail !== null ) { - - return tail.point.distanceToSquared( head.point ); - - } - - return - 1; - - }, - - setTwin: function ( edge ) { - - this.twin = edge; - edge.twin = this; - - return this; - - } - - } ); - - // A vertex as a double linked list node. - - function VertexNode( point ) { - - this.point = point; - this.prev = null; - this.next = null; - this.face = null; // the face that is able to see this vertex - - } - - // A double linked list that contains vertex nodes. - - function VertexList() { - - this.head = null; - this.tail = null; - - } - - Object.assign( VertexList.prototype, { - - first: function () { - - return this.head; - - }, - - last: function () { - - return this.tail; - - }, - - clear: function () { - - this.head = this.tail = null; - - return this; - - }, - - // Inserts a vertex before the target vertex - - insertBefore: function ( target, vertex ) { - - vertex.prev = target.prev; - vertex.next = target; - - if ( vertex.prev === null ) { - - this.head = vertex; - - } else { - - vertex.prev.next = vertex; - - } - - target.prev = vertex; - - return this; - - }, - - // Inserts a vertex after the target vertex - - insertAfter: function ( target, vertex ) { - - vertex.prev = target; - vertex.next = target.next; - - if ( vertex.next === null ) { - - this.tail = vertex; - - } else { - - vertex.next.prev = vertex; - - } - - target.next = vertex; - - return this; - - }, - - // Appends a vertex to the end of the linked list - - append: function ( vertex ) { - - if ( this.head === null ) { - - this.head = vertex; - - } else { - - this.tail.next = vertex; - - } - - vertex.prev = this.tail; - vertex.next = null; // the tail has no subsequent vertex - - this.tail = vertex; - - return this; - - }, - - // Appends a chain of vertices where 'vertex' is the head. - - appendChain: function ( vertex ) { - - if ( this.head === null ) { - - this.head = vertex; - - } else { - - this.tail.next = vertex; - - } - - vertex.prev = this.tail; - - // ensure that the 'tail' reference points to the last vertex of the chain - - while ( vertex.next !== null ) { - - vertex = vertex.next; - - } - - this.tail = vertex; - - return this; - - }, - - // Removes a vertex from the linked list - - remove: function ( vertex ) { - - if ( vertex.prev === null ) { - - this.head = vertex.next; - - } else { - - vertex.prev.next = vertex.next; - - } - - if ( vertex.next === null ) { - - this.tail = vertex.prev; - - } else { - - vertex.next.prev = vertex.prev; - - } - - return this; - - }, - - // Removes a list of vertices whose 'head' is 'a' and whose 'tail' is b - - removeSubList: function ( a, b ) { - - if ( a.prev === null ) { - - this.head = b.next; - - } else { - - a.prev.next = b.next; - - } - - if ( b.next === null ) { - - this.tail = a.prev; - - } else { - - b.next.prev = a.prev; - - } - - return this; - - }, - - isEmpty: function() { - - return this.head === null; - - } - - } ); - - // export - - THREE.QuickHull = QuickHull; - - -} ) (); diff --git a/public/lib/ammo/ex/geometries/ConvexGeometry.js b/public/lib/ammo/ex/geometries/ConvexGeometry.js deleted file mode 100644 index 2de58348..00000000 --- a/public/lib/ammo/ex/geometries/ConvexGeometry.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - */ - -( function() { - - // ConvexGeometry - - function ConvexGeometry( points ) { - - THREE.Geometry.call( this ); - - this.type = 'ConvexGeometry'; - - this.fromBufferGeometry( new ConvexBufferGeometry( points ) ); - this.mergeVertices(); - - } - - ConvexGeometry.prototype = Object.create( THREE.Geometry.prototype ); - ConvexGeometry.prototype.constructor = ConvexGeometry; - - // ConvexBufferGeometry - - function ConvexBufferGeometry( points ) { - - THREE.BufferGeometry.call( this ); - - this.type = 'ConvexBufferGeometry'; - - // buffers - - var vertices = []; - var normals = []; - - // execute QuickHull - - if ( THREE.QuickHull === undefined ) { - - console.error( 'THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on THREE.QuickHull' ); - - } - - var quickHull = new THREE.QuickHull().setFromPoints( points ); - - // generate vertices and normals - - var faces = quickHull.faces; - - for ( var i = 0; i < faces.length; i ++ ) { - - var face = faces[ i ]; - var edge = face.edge; - - // we move along a doubly-connected edge list to access all face points (see HalfEdge docs) - - do { - - var point = edge.head().point; - - vertices.push( point.x, point.y, point.z ); - normals.push( face.normal.x, face.normal.y, face.normal.z ); - - edge = edge.next; - - } while ( edge !== face.edge ); - - } - - // build geometry - if (THREE.Float32BufferAttribute) { - this.addAttribute('position', new THREE.Float32BufferAttribute(vertices, 3)); - this.addAttribute('normal', new THREE.Float32BufferAttribute(normals, 3)); - - } else { - this.addAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3)); - this.addAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3)); - } - - } - - ConvexBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); - ConvexBufferGeometry.prototype.constructor = ConvexBufferGeometry; - - // export - - THREE.ConvexGeometry = ConvexGeometry; - THREE.ConvexBufferGeometry = ConvexBufferGeometry; - -} ) (); diff --git a/public/lib/includeLibs.js b/public/lib/includeLibs.js index dab65c3b..e0206993 100644 --- a/public/lib/includeLibs.js +++ b/public/lib/includeLibs.js @@ -19,7 +19,7 @@ window.configLibs = { "cesium-comp": [ //cesium版本间兼容处理 "mars3d/plugins/compatible/cesium-version.js", - "mars3d/plugins/compatible/cesium-when.js", + "mars3d/plugins/compatible/cesium-when.js" ], "mars3d-space": [ // 卫星插件 @@ -63,25 +63,22 @@ window.configLibs = { "mars3d/thirdParty/pbf-ol/ol.js", "mars3d/thirdParty/pbf-ol/olms.js", "mars3d/thirdParty/pbf-ol/style/MapboxStreetsV6.js", - "mars3d/thirdParty/pbf-ol/PbfolLayer.js", + "mars3d/thirdParty/pbf-ol/PbfolLayer.js" ], "cesium-pbf-mapbox": [ // pbf矢量瓦片支持(基于mapbox渲染) "mars3d/thirdParty/pbf-mapbox/mapbox-gl.js", - "mars3d/thirdParty/pbf-mapbox/PbfLayer.js", + "mars3d/thirdParty/pbf-mapbox/PbfLayer.js" ], "cesium-weiVectorTile": [ // 项目矢量瓦片方式加载GeoJson插件 "mars3d/thirdParty/weiVectorTile/CesiumVectorTile.js", - "mars3d/thirdParty/weiVectorTile/WeiVectorTileLayer.js", + "mars3d/thirdParty/weiVectorTile/WeiVectorTileLayer.js" ], "cesium-meshVisualizer": [ // ammo物理引擎支持 "three/three.js", "ammo/ammo.js", - "ammo/ex/ConvexObjectBreaker.js", // 仅convexBreak使用 - "ammo/ex/QuickHull.js", // 仅convexBreak使用 - "ammo/ex/geometries/ConvexGeometry.js", // 仅convexBreak使用 "mars3d/thirdParty/meshVisualizer/CesiumMeshVisualizer.js" ], "cesium-sensorVolumes": [ @@ -93,6 +90,9 @@ window.configLibs = { "ol/ol.js", "ol/ol-cesium/olcesium.js" ], + "cesium-networkPlug": [ + "mars3d/thirdParty/networkPlug/CesiumNetworkPlug.js" + ], //////////////////////////mars2d及其插件//////////////////////// 'mars2d': [//地图 主库 @@ -136,7 +136,9 @@ window.configLibs = { three: ["three/three.js"], 'hls': ["video/hls/hls.js"], 'flv': ["video/flv/flv.min.js"], - tween: ["tween/Tween.js"] - + tween: ["tween/Tween.js"], + 'localforage': [ + "localforage/localforage.min.js" + ], } diff --git a/public/lib/mars3d/mars3d.css b/public/lib/mars3d/mars3d.css index 319cfc81..0a7ab483 100644 --- a/public/lib/mars3d/mars3d.css +++ b/public/lib/mars3d/mars3d.css @@ -1,8 +1,8 @@ /** * Mars3D三维可视化平台 mars3d * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:30:23 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:10:19 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ diff --git a/public/lib/mars3d/mars3d.d.ts b/public/lib/mars3d/mars3d.d.ts index eae40647..4bee990b 100644 --- a/public/lib/mars3d/mars3d.d.ts +++ b/public/lib/mars3d/mars3d.d.ts @@ -2,8 +2,8 @@ /** * Mars3D三维可视化平台 mars3d * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:30:23 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:10:19 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -915,7 +915,11 @@ declare enum Icon { * 多语种文本配置, * 值为数组,对应{@link LangType}按照固定顺序排列,如:[中文简体,中文繁體,English] * @example - * mars3d.Lang["_单击开始绘制"][mars3d.LangType.ZH] ="新的中文提示语句"; + * // 更新Lang值 + * mars3d.Util.setLangText("_右击菜单删除", "新的提示语句", mars3d.LangType.ZH) + * + * // 获取Lang值 + * const text = mars3d.Util.getLangText("_右击菜单删除", mars3d.LangType.ZH) */ declare enum Lang { "_放大" = "[\"\u653E\u5927\",\"\u653E\u5927\",\"Zoom In\"]", @@ -7964,6 +7968,7 @@ declare namespace BoxEntity { * @property [material = Cesium.Color.WHITE] - 指定用于填充的材质,指定material后`materialType`和`material材质参数`将被覆盖。 * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineWidth = 1.0] - 边框宽度 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -7994,6 +7999,7 @@ declare namespace BoxEntity { material?: Cesium.MaterialProperty | BaseMaterialProperty | Cesium.Color; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineWidth?: string; outlineColor?: string | Cesium.Color; @@ -8237,6 +8243,7 @@ declare namespace CircleEntity { * @property [material = Cesium.Color.WHITE] - 指定用于填充的材质,指定material后`materialType`和`material材质参数`将被覆盖。 * @property [color = "#3388ff"] - 填充颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineWidth = 1] - 边框宽度 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -8273,6 +8280,7 @@ declare namespace CircleEntity { material?: Cesium.MaterialProperty | BaseMaterialProperty | Cesium.Color; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineWidth?: number; outlineColor?: string | Cesium.Color; @@ -8647,6 +8655,7 @@ declare namespace CorridorEntity { * @property [material = Cesium.Color.WHITE] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineWidth = 1] - 边框宽度,outlineWidth只适用于非Windows系统,如Android、iOS、Linux和OS X。这是由于WebGL是如何在Windows上的所有三个主要浏览器引擎中实现所限制的,目前只能显示1px。 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -8679,6 +8688,7 @@ declare namespace CorridorEntity { material?: Cesium.MaterialProperty | BaseMaterialProperty | Cesium.Color; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineWidth?: number; outlineColor?: string | Cesium.Color; @@ -10469,6 +10479,7 @@ declare namespace PlaneEntity { * @property [randomColor = false] - 是否随机颜色 * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineWidth = 1] - 边框宽度,outlineWidth只适用于非Windows系统,如Android、iOS、Linux和OS X。这是由于WebGL是如何在Windows上的所有三个主要浏览器引擎中实现所限制的,目前只能显示1px。 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -10500,6 +10511,7 @@ declare namespace PlaneEntity { randomColor?: boolean; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineWidth?: number; outlineColor?: string | Cesium.Color; @@ -10726,6 +10738,7 @@ declare namespace PolygonEntity { * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 * @property [randomColor = false] - 是否随机颜色 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [stRotation = 0] - 多边形纹理的角度(弧度值),正北为0,逆时针旋转 * @property [stRotationDegree = 0] - 多边形纹理的角度(度数值,0-360度),与stRotation二选一 * @property [outline = false] - 是否边框 @@ -10769,6 +10782,7 @@ declare namespace PolygonEntity { color?: string | Cesium.Color; opacity?: number; randomColor?: boolean; + image?: string; stRotation?: number; stRotationDegree?: number; outline?: boolean; @@ -11210,6 +11224,7 @@ declare namespace RectangleEntity { * @property [material = Cesium.Color.WHITE] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineWidth = 1] - 边框宽度 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -11245,6 +11260,7 @@ declare namespace RectangleEntity { material?: Cesium.MaterialProperty | BaseMaterialProperty | Cesium.Color; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineWidth?: number; outlineColor?: string | Cesium.Color; @@ -11783,6 +11799,7 @@ declare namespace WallEntity { * @property [material = Cesium.Color.WHITE] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [closure = false] - 是否闭合, 在positions是属性机制的回调对象时无效 * @property [outline = false] - 是否边框 * @property [outlineWidth = 1] - 边框宽度,outlineWidth只适用于非Windows系统,如Android、iOS、Linux和OS X。这是由于WebGL是如何在Windows上的所有三个主要浏览器引擎中实现所限制的,目前只能显示1px。 @@ -11812,6 +11829,7 @@ declare namespace WallEntity { material?: Cesium.MaterialProperty | BaseMaterialProperty | Cesium.Color; color?: string | Cesium.Color; opacity?: number; + image?: string; closure?: boolean; outline?: boolean; outlineWidth?: number; @@ -12648,6 +12666,19 @@ declare class Sector extends PolygonEntity { * 位置坐标数组 (笛卡尔坐标), 赋值时可以传入LatLngPoint数组对象 或 Cesium.PolygonHierarchy */ positions: Cesium.Cartesian3[]; + /** + * 异步计算更新坐标高度进行贴地(或贴模型),内部自动调用{@link PolyUtil#computeSurfacePoints}方法处理。 + * @param [options = {}] - 参数对象: + * @param [options.has3dtiles = auto] - 是否在3dtiles模型上分析(模型分析较慢,按需开启),默认内部根据点的位置自动判断(但可能不准) + * @param [options.objectsToExclude] - 贴模型分析时,排除的不进行贴模型计算的模型对象,可以是: primitives, entities, 或 3D Tiles features + * @param [options.offset = 0] - 可以按需增加偏移高度(单位:米),便于可视 + * @returns 异步计算完成的Promise + */ + autoSurfaceHeight(options?: { + has3dtiles?: boolean; + objectsToExclude?: any; + offset?: number; + }): Promise<any>; } /** @@ -14115,6 +14146,7 @@ declare namespace BoxPrimitive { * @property [material] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineColor = "#ffffff"] - 边框颜色 * @property [outlineOpacity = 0.6] - 边框透明度 @@ -14146,6 +14178,7 @@ declare namespace BoxPrimitive { material?: Cesium.Material; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineColor?: string | Cesium.Color; outlineOpacity?: number; @@ -14244,6 +14277,7 @@ declare namespace CirclePrimitive { * @property [material] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineColor = "#ffffff"] - 边框颜色 * @property [outlineOpacity = 0.6] - 边框透明度 @@ -14279,6 +14313,7 @@ declare namespace CirclePrimitive { material?: Cesium.Material; color?: string | Cesium.Color; opacity?: number; + image?: string; outline?: boolean; outlineColor?: string | Cesium.Color; outlineOpacity?: number; @@ -14762,6 +14797,7 @@ declare namespace CorridorPrimitive { * @property [outline = false] - 是否边框 * @property [outlineColor = "#ffffff"] - 边框颜色 * @property [outlineOpacity = 0.6] - 边框透明度 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [height = 0] - 高程,圆相对于椭球面的高度。 * @property [diffHeight = 100] - 高度差(走廊本身的高度),与extrudedHeight二选一。 * @property [extrudedHeight] - 指定走廊挤压面相对于椭球面的高度。 @@ -14795,6 +14831,7 @@ declare namespace CorridorPrimitive { outline?: boolean; outlineColor?: string | Cesium.Color; outlineOpacity?: number; + image?: string; height?: number; diffHeight?: number; extrudedHeight?: number; @@ -16108,6 +16145,7 @@ declare namespace PlanePrimitive { * @property [roll = 0] - 翻滚角(度数值,0-360度) * @property [color = "#00FF00"] - 颜色 * @property [opacity = 1.0] - 透明度, 取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [materialType = "Color"] - 填充材质类型 ,可选项:{@link MaterialType} * @property [materialOptions] - materialType对应的{@link MaterialType}中材质参数 * @property [material] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 @@ -16137,6 +16175,7 @@ declare namespace PlanePrimitive { roll?: number; color?: string | Cesium.Color; opacity?: number; + image?: string; materialType?: string; materialOptions?: any; material?: Cesium.Material; @@ -16246,6 +16285,7 @@ declare namespace PointPrimitive { * @property [visibleDepth = true] - 是否被遮挡 * @property [disableDepthTestDistance] - 指定从相机到禁用深度测试的距离。 * @property [translucencyByDistance] - 用于基于与相机的距离设置半透明度。 + * @property [clampToGround = false] - 是否贴地, 仅限普通坐标. 提示:Cesium默认不支持贴地,是内部计算了贴地高度值。 * @property [setHeight] - 指定坐标高度值(对编辑时无效,仅初始化传入有效,常用于图层中配置),也支持字符串模版配置 * @property [addHeight] - 在现有坐标基础上增加的高度值(对编辑时无效,仅初始化传入有效,常用于图层中配置),也支持字符串模版配置 * @property [label] - 支持附带文字的显示 @@ -16269,6 +16309,7 @@ declare namespace PointPrimitive { visibleDepth?: boolean; disableDepthTestDistance?: number; translucencyByDistance?: Cesium.NearFarScalar; + clampToGround?: boolean; setHeight?: number | string; addHeight?: number | string; label?: LabelPrimitive.StyleOptions | any; @@ -16328,6 +16369,10 @@ declare class PointPrimitive extends BasePointPrimitive { * 当加载primitive数据的内部Cesium容器 */ readonly primitiveCollection: Cesium.PointPrimitiveCollection; + /** + * 位置坐标 (笛卡尔坐标), 赋值时可以传入LatLngPoint对象 + */ + position: Cesium.Cartesian3 | LngLatPoint; } declare namespace PolygonPrimitive { @@ -16339,7 +16384,7 @@ declare namespace PolygonPrimitive { * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度,取值范围:0.0-1.0 * @property [randomColor = false] - 是否随机颜色 - * @property [image] - 当为贴图时,贴图的url + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [stRotation = 0] - 多边形纹理的角度(弧度值),正北为0,逆时针旋转 * @property [stRotationDegree = 0] - 多边形纹理的角度(度数值,0-360度),与stRotation二选一 * @property [outline = false] - 是否边框 @@ -16759,7 +16804,7 @@ declare namespace RectanglePrimitive { * @property [material] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度,取值范围:0.0-1.0 - * @property [image] - 当为贴图时,贴图的url + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [outline = false] - 是否边框 * @property [outlineColor = "#ffffff"] - 边框颜色 * @property [outlineOpacity = 0.6] - 边框透明度 @@ -17328,6 +17373,7 @@ declare namespace WallPrimitive { * @property [material] - 指定用于填充的材质,指定material后`materialType`和`materialOptions`将被覆盖。 * @property [color = "#3388ff"] - 颜色 * @property [opacity = 1.0] - 透明度,取值范围:0.0-1.0 + * @property [image] - 图片材质时,贴图的url,等价于 materialType:'Image' * @property [closure = false] - 是否闭合 * @property [outline = false] - 是否边框 * @property [outlineColor = "#ffffff"] - 边框颜色 @@ -17355,6 +17401,7 @@ declare namespace WallPrimitive { material?: Cesium.Material; color?: string | Cesium.Color; opacity?: number; + image?: string; closure?: boolean; outline?: boolean; outlineColor?: string | Cesium.Color; @@ -18642,7 +18689,7 @@ declare class ArcGisWfsLayer extends LodGraphicLayer { wkid?: number; parameters?: any; headers?: any; - proxy?: Cesium.Proxy; + proxy?: string | Cesium.DefaultProxy; IdField?: string; minimumLevel?: number; maximumLevel?: number; @@ -19823,6 +19870,10 @@ declare class GraphicLayer extends BaseGraphicLayer { * 是否自动激活编辑(true时,单击后自动激活编辑) */ hasEdit: boolean; + /** + * 是否正在编辑状态 + */ + readonly isDrawing: boolean; /** * 是否正在编辑状态 */ @@ -21365,7 +21416,7 @@ declare class WfsLayer extends LodGraphicLayer { }; geometryName?: string; headers?: any; - proxy?: Cesium.Proxy; + proxy?: string | Cesium.DefaultProxy; layer: string; IdField?: string; getCapabilities?: boolean; @@ -21609,7 +21660,7 @@ declare class GroupLayer extends BaseGraphicLayer { declare class TerrainLayer extends BaseLayer { constructor(options?: { terrain: { - type?: TerrainType; + type?: string | TerrainType; url: string | Cesium.Resource; requestVertexNormals?: boolean; requestWaterMask?: boolean; @@ -25411,7 +25462,7 @@ declare namespace Map { * @property [requestMetadata = true] - 是否应该从服务器请求每个块元数据(如果可用)。 */ type terrainOptions = { - type?: TerrainType; + type?: string | TerrainType; url: string | Cesium.Resource; show?: boolean; requestVertexNormals?: boolean; @@ -30855,7 +30906,7 @@ declare class BaiduPOI { key?: string[]; city?: string; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; }); /** * 百度key数组,内部轮询使用 @@ -31029,7 +31080,7 @@ declare class GaodePOI { constructor(options?: { key?: string[]; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; }); /** * 高德key数组,内部轮询使用 @@ -31192,7 +31243,7 @@ declare class GaodeRoute { constructor(options?: { key?: string[]; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; }); /** * 高德key数组,内部轮询使用 @@ -31338,7 +31389,7 @@ declare class QueryArcServer extends BaseClass { url: string; pageSize?: number; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; id?: string | number; pid?: string | number; name?: string; @@ -31450,7 +31501,7 @@ declare class QueryGeoServer extends BaseClass { layer: string; crs?: string; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; id?: string | number; pid?: string | number; name?: string; @@ -31532,7 +31583,7 @@ declare class TdtPOI { constructor(options?: { key?: string[]; headers?: any; - proxy?: Cesium.Proxy; + proxy?: Cesium.DefaultProxy; }); /** * 天地图key数组,内部轮询使用 @@ -34723,7 +34774,7 @@ declare namespace LayerUtil { * @returns 地形对象 */ function createTerrainProvider(options: { - type: TerrainType; + type: string | TerrainType; url: string | Cesium.Resource; proxy?: string; templateValues?: any; @@ -36399,10 +36450,18 @@ declare namespace Util { /** * 根据设置的lang参数,获取当前key对应语言的文本内容。 * @param key - 文本key - * @param langType - 使用的语言 + * @param [langType = 0] - 使用的语言 * @returns lang参数指定的对应文本内容 */ - function getLangText(key: string, langType: LangType): void; + function getLangText(key: string, langType?: LangType): void; + /** + * 更新Lang值,设置当前key对应语言的文本内容。 + * @param key - 文本key + * @param text - 文本内容 + * @param [langType = 0] - 使用的语言 + * @returns 是否更新成功 + */ + function setLangText(key: string, text: string, langType?: LangType): void; /** * 进入全屏 * @param container - 指定DOM元素,如 map.container diff --git a/public/lib/mars3d/mars3d.js b/public/lib/mars3d/mars3d.js index eb698b8a..540bfc5e 100644 --- a/public/lib/mars3d/mars3d.js +++ b/public/lib/mars3d/mars3d.js @@ -1,8 +1,8 @@ /** * Mars3D三维可视化平台 mars3d * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:30:23 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:10:19 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'mars3d-cesium', '@turf/turf'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.mars3d = {}, global.Cesium, global.turf)); })(this, (function (exports, Cesium, turf) { -'use strict';const _0x35a251=_0x2767;(function(_0x3f46ca,_0xf27529){const _0x569207={_0x3a7f62:0x138,_0x57f956:0x3ed,_0x539950:0x5f9,_0x4ced11:0xeeb,_0x31b3bd:0xa2e},_0x541a76=_0x2767,_0x29d249=_0x3f46ca();while(!![]){try{const _0x73d509=parseInt(_0x541a76(0xe2c))/0x1*(parseInt(_0x541a76(_0x569207._0x3a7f62))/0x2)+-parseInt(_0x541a76(0x3e0))/0x3*(-parseInt(_0x541a76(0x24a))/0x4)+-parseInt(_0x541a76(_0x569207._0x57f956))/0x5+parseInt(_0x541a76(_0x569207._0x539950))/0x6*(-parseInt(_0x541a76(0x305))/0x7)+parseInt(_0x541a76(0x935))/0x8*(-parseInt(_0x541a76(0xca))/0x9)+-parseInt(_0x541a76(_0x569207._0x4ced11))/0xa*(-parseInt(_0x541a76(0x6a8))/0xb)+-parseInt(_0x541a76(_0x569207._0x31b3bd))/0xc*(-parseInt(_0x541a76(0x625))/0xd);if(_0x73d509===_0xf27529)break;else _0x29d249['push'](_0x29d249['shift']());}catch(_0x5061c0){_0x29d249['push'](_0x29d249['shift']());}}}(_0x398f,0x2e6df));function _interopNamespace(_0x34c34d){const _0x5c7432={_0x1b8a5b:0x915},_0x25a881=_0x2767;if(_0x34c34d&&_0x34c34d[_0x25a881(_0x5c7432._0x1b8a5b)])return _0x34c34d;var _0x5b0508=Object['create'](null);return _0x34c34d&&Object['keys'](_0x34c34d)['forEach'](function(_0x1c6c6b){const _0x5a4ba8=_0x25a881;if(_0x1c6c6b!=='default'){var _0x104712=Object[_0x5a4ba8(0x61d)](_0x34c34d,_0x1c6c6b);Object['defineProperty'](_0x5b0508,_0x1c6c6b,_0x104712['get']?_0x104712:{'enumerable':!![],'get':function(){return _0x34c34d[_0x1c6c6b];}});}}),_0x5b0508['default']=_0x34c34d,_0x5b0508;}var Cesium__namespace=_interopNamespace(Cesium);if(!(Cesium__namespace!==null&&Cesium__namespace!==void 0x0&&Cesium__namespace['Viewer']))throw new Error(_0x35a251(0xb22));const getUrlComponent_old=Cesium__namespace['Resource'][_0x35a251(0xb1b)][_0x35a251(0x7f5)];Cesium__namespace['Resource']['prototype'][_0x35a251(0x7f5)]=function(_0x393e24,_0x5cbd76){const _0x5d20d0={_0x37fbff:0x3ba},_0x3d7c01=_0x35a251;let _0x4c9498=getUrlComponent_old['bind'](this)(_0x393e24,_0x5cbd76);return Cesium__namespace['Resource'][_0x3d7c01(_0x5d20d0._0x37fbff)]&&(_0x4c9498=Cesium__namespace[_0x3d7c01(0x58d)][_0x3d7c01(0x3ba)](_0x4c9498)),this[_0x3d7c01(0xa15)]=_0x4c9498,_0x4c9498;};const getValueInReferenceFrame_old=Cesium__namespace['ConstantPositionProperty']['prototype']['getValueInReferenceFrame'];Cesium__namespace[_0x35a251(0x8f6)]['prototype']['getValueInReferenceFrame']=function(_0x422aa3,_0x368ff0,_0x25300b){const _0x19c90e={_0x3d5f69:0x579},_0x2ebed9=_0x35a251;return!Cesium__namespace[_0x2ebed9(0xaa2)](_0x422aa3)&&(_0x422aa3=Cesium__namespace[_0x2ebed9(_0x19c90e._0x3d5f69)]['now']()),getValueInReferenceFrame_old['bind'](this)(_0x422aa3,_0x368ff0,_0x25300b);},Cesium__namespace['VelocityOrientationProperty']['prototype']['getValue']=function(_0x16bfeb,_0x453750){const _0xb4a49e={_0x4cd690:0xe27,_0x2b8522:0x8eb,_0xf0f75b:0xd8,_0x19e443:0x49c,_0x10a847:0x653},_0x4d408b=_0x35a251;!this[_0x4d408b(_0xb4a49e._0x4cd690)]&&(this[_0x4d408b(_0xb4a49e._0x4cd690)]=new Cesium__namespace[(_0x4d408b(_0xb4a49e._0x2b8522))](),this['_velocityScratch']=new Cesium__namespace[(_0x4d408b(0x8eb))](),this['_rotationScratch']=new Cesium__namespace['Matrix3']());let _0x1f1e3c=this['_velocityVectorProperty']['_getValue'](_0x16bfeb,this['_velocityScratch'],this['_positionScratch']);Cesium__namespace['defined'](_0x1f1e3c)?this[_0x4d408b(_0xb4a49e._0xf0f75b)]=_0x1f1e3c['clone']():_0x1f1e3c=this['_last_velocity'];if(!Cesium__namespace['defined'](_0x1f1e3c))return undefined;return Cesium__namespace[_0x4d408b(_0xb4a49e._0x19e443)]['rotationMatrixFromPositionVelocity'](this['_positionScratch'],_0x1f1e3c,this['_ellipsoid'],this['_rotationScratch']),Cesium__namespace[_0x4d408b(_0xb4a49e._0x10a847)]['fromRotationMatrix'](this['_rotationScratch'],_0x453750);};const beginFrame_old=Cesium__namespace[_0x35a251(0xa67)]['prototype']['beginFrame'];Cesium__namespace['Globe'][_0x35a251(0xb1b)]['beginFrame']=function(_0x3f6ea2){const _0x1bc0a4={_0x42a3ce:0xdfb,_0x404b76:0x1ac,_0x1bfda9:0xcc2,_0x410da8:0x390,_0x4f9f92:0xdfb},_0x396cbe=_0x35a251;var _0x4b6691,_0x542547,_0x265b85,_0x41948a;const _0x4c15f1=(_0x4b6691=this['_surface']['_tileProvider'])===null||_0x4b6691===void 0x0?void 0x0:(_0x542547=_0x4b6691['marsOptions'])===null||_0x542547===void 0x0?void 0x0:_0x542547['flat'];_0x4c15f1&&(_0x4c15f1[_0x396cbe(0x1ac)]&&(_0x4c15f1['texture']&&_0x4c15f1['texture']['destroy'](),_0x4c15f1['texture']=createFlattingAreaTextureOrLimitAreaTexture(_0x3f6ea2['context'],_0x4c15f1[_0x396cbe(_0x1bc0a4._0x42a3ce)],_0x4c15f1['heights']),_0x4c15f1[_0x396cbe(_0x1bc0a4._0x404b76)]=![]));const _0x47fe42=(_0x265b85=this['_surface']['_tileProvider'])===null||_0x265b85===void 0x0?void 0x0:(_0x41948a=_0x265b85['marsOptions'])===null||_0x41948a===void 0x0?void 0x0:_0x41948a['uplift'];return _0x47fe42&&(_0x47fe42['hasUpdate']&&(_0x47fe42['texture']&&_0x47fe42[_0x396cbe(_0x1bc0a4._0x1bfda9)][_0x396cbe(0xa63)](),_0x47fe42['texture']=createFlattingAreaTextureOrLimitAreaTexture(_0x3f6ea2[_0x396cbe(_0x1bc0a4._0x410da8)],_0x47fe42[_0x396cbe(_0x1bc0a4._0x4f9f92)],undefined),_0x47fe42['hasUpdate']=![])),beginFrame_old['bind'](this)(_0x3f6ea2);};function createFlattingAreaTextureOrLimitAreaTexture(_0x58c755,_0x58f4ac,_0x2d59fa){const _0x467a73={_0x44acda:0xe1e,_0x12dc32:0xf4e,_0x367a17:0xaf6},_0x4585db={_0x10941a:0xc26,_0x3d24df:0x6de},_0x28f703=_0x35a251,_0x21f860=_0x58f4ac===null||_0x58f4ac===void 0x0?void 0x0:_0x58f4ac[_0x28f703(_0x467a73._0x44acda)];if(!_0x21f860||_0x21f860===0x0)return undefined;let _0x17cdd5=0x0;_0x58f4ac[_0x28f703(0xdbd)](_0x5320f2=>{_0x17cdd5<_0x5320f2['length']&&(_0x17cdd5=_0x5320f2['length']);});const _0x5ea824=[];return _0x58f4ac['forEach']((_0x4bdc54,_0x3396ce)=>{const _0x22c1d4=_0x4bdc54['length'];_0x4bdc54['forEach'](_0x391b08=>{const _0x28dc9f=_0x2767;_0x5ea824['push'](_0x391b08[_0x28dc9f(_0x4585db._0x10941a)]),_0x5ea824[_0x28dc9f(_0x4585db._0x3d24df)](_0x391b08['latitude']),_0x5ea824[_0x28dc9f(0x6de)](_0x22c1d4),Cesium__namespace['defined'](_0x2d59fa)?_0x5ea824[_0x28dc9f(0x6de)](_0x2d59fa[_0x3396ce]):_0x5ea824[_0x28dc9f(0x6de)](0x0);});if(_0x22c1d4<_0x17cdd5)for(let _0xe5673d=0x0;_0xe5673d<_0x17cdd5-_0x22c1d4;_0xe5673d++){_0x5ea824['push'](0x0),_0x5ea824['push'](0x0),_0x5ea824['push'](0x0),_0x5ea824['push'](0x0);}}),new Cesium__namespace['Texture']({'context':_0x58c755,'pixelFormat':Cesium__namespace['PixelFormat']['RGBA'],'pixelDatatype':Cesium__namespace['PixelDatatype'][_0x28f703(_0x467a73._0x12dc32)],'sampler':new Cesium__namespace['Sampler']({'wrapS':Cesium__namespace['TextureWrap']['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace['TextureWrap'][_0x28f703(_0x467a73._0x367a17)],'minificationFilter':Cesium__namespace['TextureMinificationFilter']['NEAREST'],'magnificationFilter':Cesium__namespace[_0x28f703(0x6ac)]['NEAREST']}),'flipY':![],'source':{'width':_0x17cdd5,'height':_0x21f860,'arrayBufferView':new Float32Array(_0x5ea824)}});}Object['defineProperties'](Cesium__namespace['GlobeSurfaceTileProvider'][_0x35a251(0xb1b)],{'marsOptions':{'get':function(){return this['_marsOptions'];}}}),Cesium__namespace['GlobeSurfaceTileProvider'][_0x35a251(0xb1b)]['_initByMars3D']=function(_0x332aa6){const _0xdc3b3b={_0xaab6c9:0xe94,_0x5cf224:0xe94},_0x13aa4e={_0x26dc5b:0xe94},_0x103a67={_0x135f58:0x6ad},_0x5ef883={_0x521907:0x6ad,_0x433fa1:0xe5e},_0x2bbcc9={_0x2fb7e7:0x9c1,_0x5a4487:0x6a7,_0x278a70:0xa84},_0x2d42ea={_0xb9418c:0xd37,_0x2b00bd:0xdfb,_0x399a2a:0x1ac},_0x63b4cc={_0x1b96d2:0x59f},_0x10f587=_0x35a251,_0x3109f8=this;this[_0x10f587(_0xdc3b3b._0xaab6c9)]={'resetValue':function(){this['resetClipValue'](),this['resetFloodValue'](),this['resetFlatValue'](),this['resetUpliftValue']();},'flat':{},'resetFlatValue':function(){const _0x17956d=_0x10f587;this[_0x17956d(0x59f)]['enabled']=![],this['flat'][_0x17956d(0x76e)]=[],this['flat']['rectangles']=undefined,this[_0x17956d(_0x63b4cc._0x1b96d2)]['areas']=undefined,this[_0x17956d(0x59f)]['texture']=undefined,this['flat']['hasUpdate']=![];},'uplift':{},'resetUpliftValue':function(){const _0x2f3cf2=_0x10f587;this[_0x2f3cf2(0x557)]['enabled']=![],this['uplift']['showUp']=!![],this[_0x2f3cf2(0x557)]['height']=0x0,this['uplift'][_0x2f3cf2(_0x2d42ea._0xb9418c)]=undefined,this['uplift'][_0x2f3cf2(_0x2d42ea._0x2b00bd)]=undefined,this['uplift']['texture']=undefined,this['uplift'][_0x2f3cf2(_0x2d42ea._0x399a2a)]=![];},'clip':{},'resetClipValue':function(){const _0x39f008=_0x10f587;this['clip']['enabled']=![],this['clip']['clipOutSide']=![],this['clip']['polygonTexture']=undefined,this['clip']['tailorRect']=Cesium__namespace['Cartesian4']['ZERO'],this[_0x39f008(_0x2bbcc9._0x2fb7e7)][_0x39f008(0x9ed)]=Cesium__namespace[_0x39f008(_0x2bbcc9._0x5a4487)][_0x39f008(_0x2bbcc9._0x278a70)];},'flood':{},'resetFloodValue':function(){const _0x5ce8c7=_0x10f587;this[_0x5ce8c7(0x6ad)]['enabled']=![],this['flood']['globe']=!![],this['flood']['showElseArea']=!![],this[_0x5ce8c7(_0x5ef883._0x521907)]['polygonTexture']=undefined,this['flood']['inverMatrix']=Cesium__namespace['Matrix4']['ZERO'],this['flood'][_0x5ce8c7(0xa86)]=Cesium__namespace['Cartesian4'][_0x5ce8c7(0xa84)],this['flood'][_0x5ce8c7(_0x5ef883._0x433fa1)]=new Cesium__namespace['Cartesian4'](0x0,0x0,0x0,0x1f4),this['flood']['color']=new Cesium__namespace[(_0x5ce8c7(0xf29))](0.15,0.7,0.95,0.5);},'updateTileUniformMap':function(_0x518498,_0x4fa507){const _0x25b3c2={_0x664909:0x6ad},_0x555812={_0x34ca71:0x6a7},_0x186251={_0xb1429a:0x7bf,_0x2ea40b:0x641},_0x56518e={_0x2d1a38:0x9c1,_0x695c9d:0xafb},_0x570a79={_0x570fcf:0x9c1,_0x1163a0:0xa20};return{'u_mars_clip_enabled':function(){const _0x5945a0=_0x2767;return _0x3109f8['_marsOptions']['clip'][_0x5945a0(0x2a6)];},'u_mars_clip_only':function(){const _0x4df745=_0x2767;return _0x3109f8[_0x4df745(0xe94)][_0x4df745(_0x570a79._0x570fcf)][_0x4df745(_0x570a79._0x1163a0)];},'u_mars_clip_area':function(){return _0x3109f8['_marsOptions']['clip']['polygonTexture']||_0x518498['context']['defaultTexture'];},'u_mars_clip_inverMatrix':function(){const _0x4a595b=_0x2767;return _0x3109f8[_0x4a595b(0xe94)][_0x4a595b(0x9c1)]['inverMatrix']||Cesium__namespace['Matrix4']['ZERO'];},'u_mars_clip_rect':function(){const _0x4a4d31=_0x2767;return _0x3109f8['_marsOptions'][_0x4a4d31(_0x56518e._0x2d1a38)][_0x4a4d31(_0x56518e._0x695c9d)]||Cesium__namespace['Cartesian4']['ZERO'];},'u_mars_flood_emabled':function(){const _0x28d905=_0x2767;return _0x3109f8['_marsOptions'][_0x28d905(0x6ad)]['enabled'];},'u_mars_flood_globe':function(){const _0x5538ac=_0x2767;return _0x3109f8[_0x5538ac(0xe94)]['flood']['globe'];},'u_mars_flood_showElse':function(){const _0x1bf26a=_0x2767;return _0x3109f8['_marsOptions'][_0x1bf26a(_0x103a67._0x135f58)]['showElseArea'];},'u_mars_flood_area':function(){const _0x200394=_0x2767;return _0x3109f8['_marsOptions']['flood'][_0x200394(_0x186251._0xb1429a)]||_0x518498['context'][_0x200394(_0x186251._0x2ea40b)];},'u_mars_flood_inverMatrix':function(){const _0x4f8443=_0x2767;return _0x3109f8['_marsOptions']['flood'][_0x4f8443(0x9ed)]||Cesium__namespace[_0x4f8443(_0x555812._0x34ca71)]['ZERO'];},'u_mars_flood_rect':function(){const _0x51e0fd=_0x2767;return _0x3109f8[_0x51e0fd(_0x13aa4e._0x26dc5b)]['flood'][_0x51e0fd(0xa86)]||Cesium__namespace[_0x51e0fd(0xb9f)]['ZERO'];},'u_mars_flood_val':function(){return _0x3109f8['_marsOptions']['flood']['heightVal'];},'u_mars_flood_color':function(){const _0x4177ba=_0x2767;return _0x3109f8[_0x4177ba(0xe94)][_0x4177ba(_0x25b3c2._0x664909)]['color'];}};}},this[_0x10f587(_0xdc3b3b._0x5cf224)]['resetValue']();},Cesium__namespace['ImageryLayer']['prototype'][_0x35a251(0xfc1)]=function(_0x4e23cb,_0x2fa37f){const _0x23ff79={_0x5411d1:0x64b,_0x330965:0xf3d},_0x5d03c3=_0x35a251;this[_0x5d03c3(_0x23ff79._0x5411d1)]=_0x2fa37f['invertColor']??_0x4e23cb[_0x5d03c3(_0x23ff79._0x5411d1)],this['filterColor']=_0x2fa37f[_0x5d03c3(_0x23ff79._0x330965)]??_0x4e23cb['filterColor'],this['filterColor']&&typeof this['filterColor']==='string'&&this['filterColor']['constructor']===String&&(this['filterColor']=Cesium__namespace['Color']['fromCssColorString'](this['filterColor']));},Cesium__namespace['ImageryLayerCollection']['prototype']['addImageryProvider']=function(_0x189fa7,_0x4d3032){const _0x4cea47={_0x47ffb9:0x4af},_0x32fe54=_0x35a251,_0x13b635=new Cesium__namespace['ImageryLayer'](_0x189fa7,_0x189fa7[_0x32fe54(0xe86)]);return this[_0x32fe54(_0x4cea47._0x47ffb9)](_0x13b635,_0x4d3032),_0x13b635;};const createShadowReceiveFragmentShader_old=Cesium__namespace[_0x35a251(0xcbe)]['createShadowReceiveFragmentShader'];Cesium__namespace['ShadowMapShader']['createShadowReceiveFragmentShader']=function(_0x1847aa,_0x4f33ba,_0x469e93,_0xcc9c7d,_0x2db32c){const _0x23d6c5={_0x374516:0x154,_0xe83a6e:0xe1e,_0x260d39:0xe13},_0x51fb43=_0x35a251,_0x1af4ef=createShadowReceiveFragmentShader_old[_0x51fb43(_0x23d6c5._0x374516)](this)(_0x1847aa,_0x4f33ba,_0x469e93,_0xcc9c7d,_0x2db32c);if(!isSun(_0x4f33ba[_0x51fb43(0x561)][_0x51fb43(0xb61)])){const _0x48e819=_0x1af4ef['sources'][_0x1af4ef['sources']['length']-0x1];_0x1af4ef['sources'][_0x1af4ef['sources'][_0x51fb43(_0x23d6c5._0xe83a6e)]-0x1]=_0x48e819['replace']('out_FragColor.rgb\x20*=\x20visibility;',_0x51fb43(_0x23d6c5._0x260d39));}return _0x1af4ef;};function isSun(_0x16dfac){if(Math['abs'](_0x16dfac['x'])>0x71ff98)return!![];if(Math['abs'](_0x16dfac['y'])>0x71ff98)return!![];if(Math['abs'](_0x16dfac['z'])>0x71ff98)return!![];return![];}Object['defineProperties'](Cesium__namespace['Entity'][_0x35a251(0xb1b)],{'circle':{'set':function(_0x1c1e6a){this['ellipse']=_0x1c1e6a;},'get':function(){return this['ellipse'];}}}),Cesium__namespace[_0x35a251(0x3b6)]['prototype']['update']=function(_0x350f1){const _0x1e001c={_0x51218d:0x918,_0x5c9074:0xfb9,_0x12b0ce:0xfb9},_0x29b4c8=_0x35a251,_0x475d49=Cesium__namespace['getTimestamp'](),_0x5becfb=_0x350f1??!![];this[_0x29b4c8(0xc2c)]++;const _0x1f6eb3=_0x475d49-this['_lastFpsSampleTime'];if(_0x1f6eb3>0x3e8){if(_0x5becfb){const _0x3a21bc=this['_fpsFrameCount']*0x3e8/_0x1f6eb3|0x0;this[_0x29b4c8(_0x1e001c._0x51218d)]['nodeValue']=_0x3a21bc+'\x20FPS';}this['_lastFpsSampleTime']=_0x475d49,this['_fpsFrameCount']=0x0;}this[_0x29b4c8(_0x1e001c._0x5c9074)]++;const _0x177f76=_0x475d49-this['_lastMsSampleTime'];if(_0x177f76>0xc8){if(_0x5becfb){const _0x25e124=(_0x177f76/this[_0x29b4c8(_0x1e001c._0x12b0ce)])['toFixed'](0x2);this['_msText'][_0x29b4c8(0x505)]=_0x25e124+'\x20MS';}this['_lastMsSampleTime']=_0x475d49,this['_msFrameCount']=0x0;}};const load_old=Cesium__namespace[_0x35a251(0x5a9)]['prototype']['load'];Cesium__namespace['I3SLayer'][_0x35a251(0xb1b)][_0x35a251(0x64a)]=function(){const _0x581e70={_0x95bf10:0x374},_0x3eb9f9=_0x35a251;var _0x37032c,_0x190f05;return((_0x37032c=this['_data'])===null||_0x37032c===void 0x0?void 0x0:(_0x190f05=_0x37032c['spatialReference'])===null||_0x190f05===void 0x0?void 0x0:_0x190f05['wkid'])===0x118a&&(this[_0x3eb9f9(_0x581e70._0x95bf10)]['spatialReference']['wkid']=0x10e6),load_old['bind'](this)();},Object['defineProperties'](Cesium__namespace['CheckerboardMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x365cdf){const _0x501041=_0x35a251;this[_0x501041(0xb8)]=_0x365cdf;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$6=Cesium__namespace[_0x35a251(0x160)]['prototype']['getValue'];Cesium__namespace[_0x35a251(0x160)]['prototype']['getValue']=function(_0xfcf174,_0x4c36c7){const _0x397be8={_0x280f0e:0x931,_0x1b0bef:0x2cf},_0x56d6a3=_0x35a251;return _0x4c36c7=getValue_old$6[_0x56d6a3(0x154)](this)(_0xfcf174,_0x4c36c7),this['globalAlpha']!==0x1&&(_0x4c36c7['lightColor']&&(_0x4c36c7[_0x56d6a3(0x110)]['alpha']*=this['globalAlpha']),_0x4c36c7['darkColor']&&(_0x4c36c7[_0x56d6a3(_0x397be8._0x280f0e)][_0x56d6a3(0x1f4)]*=this['globalAlpha']),_0x4c36c7['evenColor']&&(_0x4c36c7['evenColor']['alpha']*=this['globalAlpha']),_0x4c36c7['oddColor']&&(_0x4c36c7['oddColor'][_0x56d6a3(0x1f4)]*=this[_0x56d6a3(_0x397be8._0x1b0bef)])),_0x4c36c7;};let _hasInfo=!![],_hasError=!![];function hasInfo(_0x234153){_hasInfo=_0x234153;}function hasWarn(_0x3940a4){_hasInfo=_0x3940a4;}function hasError(_0x5208a3){_hasError=_0x5208a3;}function logInfo(..._0x41bde4){if(!_hasInfo)return;console['log'](..._0x41bde4);}function logWarn(..._0x57d947){console['warn'](..._0x57d947);}function logError$1(..._0x55aafc){const _0x5ad3ba=_0x35a251;if(!_hasError)return;console[_0x5ad3ba(0xb49)](..._0x55aafc);}var Log={'__proto__':null,'hasInfo':hasInfo,'hasWarn':hasWarn,'hasError':hasError,'logInfo':logInfo,'logWarn':logWarn,'logError':logError$1};const GraphicType={},GraphicClass={};function hasType(_0x49e091){return GraphicClass[_0x49e091]?!![]:![];}function eachGraphicType(_0x143404){const _0x38e7df={_0x4aefda:0xad6},_0x3e1243=_0x35a251;Object['keys'](GraphicClass)[_0x3e1243(0xdbd)]((_0x22e04d,_0x13ece9)=>{const _0x534e46=_0x3e1243;_0x143404&&_0x143404[_0x534e46(_0x38e7df._0x4aefda)](this,_0x22e04d,_0x13ece9);});}function isPointType(_0x5caf6c){const _0x3d483e={_0x47ba92:0x7e8},_0x1dffb4=_0x35a251;if(!_0x5caf6c)return![];return GraphicClass[_0x5caf6c]&&GraphicClass[_0x5caf6c][_0x1dffb4(_0x3d483e._0x47ba92)]?!![]:![];}function isCombineType(_0x550011){const _0x2d91d7=_0x35a251;if(!_0x550011)return![];return GraphicClass[_0x550011]&&GraphicClass[_0x550011][_0x2d91d7(0x109)]?!![]:![];}function register$4(_0x2a7e25,_0x37bf20,_0x529865){const _0x6004ac={_0x190a82:0xb1b},_0x3c9874=_0x35a251;GraphicClass[_0x2a7e25]&&logError$1('register\x20Graphic:\x20'+_0x2a7e25+'类型已存在',_0x37bf20),GraphicType[_0x2a7e25]=_0x2a7e25,GraphicClass[_0x2a7e25]=_0x37bf20,_0x37bf20['type']=_0x2a7e25,_0x37bf20['prototype'][_0x3c9874(0x859)]=_0x2a7e25,_0x529865&&(_0x37bf20['isPoint']=!![],_0x37bf20[_0x3c9874(_0x6004ac._0x190a82)]['isPoint']=!![]);}function getClass$4(_0x1dc9cf){return GraphicClass[_0x1dc9cf]?GraphicClass[_0x1dc9cf]:(logWarn('getClass:未找到该类型对应的处理类',_0x1dc9cf),null);}function create$4(_0x578b77,_0x4f986d){const _0x3051fb=getClass$4(_0x578b77);if(!_0x3051fb)return;const _0x4ca87b=new _0x3051fb(_0x4f986d);return _0x4ca87b;}function fromDraw(_0x43254b,_0x5ac6c1){const _0x2f44e5={_0x428f5f:0x2ef},_0x588338=_0x35a251;if(!_0x5ac6c1['type']){logError$1('fromDraw:需要传入指定绘制的type类型!');return;}const _0x43ab87=getClass$4(_0x5ac6c1[_0x588338(0x8ea)]);if(!_0x43ab87||!_0x43ab87['prototype']['startDraw']){logInfo('对象不支持标绘',_0x43ab87);return;}const _0x2b471d=new _0x43ab87(_0x5ac6c1);return _0x2b471d[_0x588338(_0x2f44e5._0x428f5f)](_0x43254b),_0x2b471d;}var GraphicUtil={'__proto__':null,'hasType':hasType,'eachGraphicType':eachGraphicType,'isPointType':isPointType,'isCombineType':isCombineType,'register':register$4,'getClass':getClass$4,'create':create$4,'fromDraw':fromDraw},edgeIntersectsEdge=function edgeIntersectsEdge(_0x37bc3e,_0x51a93d,_0x5241f3,_0x3a0f63){var _0xe57fae=(_0x3a0f63[0x0]-_0x5241f3[0x0])*(_0x37bc3e[0x1]-_0x5241f3[0x1])-(_0x3a0f63[0x1]-_0x5241f3[0x1])*(_0x37bc3e[0x0]-_0x5241f3[0x0]),_0xd18f99=(_0x51a93d[0x0]-_0x37bc3e[0x0])*(_0x37bc3e[0x1]-_0x5241f3[0x1])-(_0x51a93d[0x1]-_0x37bc3e[0x1])*(_0x37bc3e[0x0]-_0x5241f3[0x0]),_0x188325=(_0x3a0f63[0x1]-_0x5241f3[0x1])*(_0x51a93d[0x0]-_0x37bc3e[0x0])-(_0x3a0f63[0x0]-_0x5241f3[0x0])*(_0x51a93d[0x1]-_0x37bc3e[0x1]);if(_0x188325!==0x0){var _0x19208e=_0xe57fae/_0x188325,_0x1fca4f=_0xd18f99/_0x188325;if(_0x19208e>=0x0&&_0x19208e<=0x1&&_0x1fca4f>=0x0&&_0x1fca4f<=0x1)return!![];}return![];},coordinatesContainPoint=function coordinatesContainPoint(_0x2efc1b,_0x487ded){var _0x52084d=![];for(var _0x326bd=-0x1,_0x47c5cb=_0x2efc1b['length'],_0x1ce537=_0x47c5cb-0x1;++_0x326bd<_0x47c5cb;_0x1ce537=_0x326bd){(_0x2efc1b[_0x326bd][0x1]<=_0x487ded[0x1]&&_0x487ded[0x1]<_0x2efc1b[_0x1ce537][0x1]||_0x2efc1b[_0x1ce537][0x1]<=_0x487ded[0x1]&&_0x487ded[0x1]<_0x2efc1b[_0x326bd][0x1])&&_0x487ded[0x0]<(_0x2efc1b[_0x1ce537][0x0]-_0x2efc1b[_0x326bd][0x0])*(_0x487ded[0x1]-_0x2efc1b[_0x326bd][0x1])/(_0x2efc1b[_0x1ce537][0x1]-_0x2efc1b[_0x326bd][0x1])+_0x2efc1b[_0x326bd][0x0]&&(_0x52084d=!_0x52084d);}return _0x52084d;},pointsEqual=function pointsEqual(_0x37e2be,_0x174116){for(var _0xfe2a01=0x0;_0xfe2a01<_0x37e2be['length'];_0xfe2a01++){if(_0x37e2be[_0xfe2a01]!==_0x174116[_0xfe2a01])return![];}return!![];},arrayIntersectsArray=function arrayIntersectsArray(_0x28dfb8,_0x10e904){const _0x25484c={_0x49de04:0xe1e},_0x23e1c3=_0x35a251;for(var _0x22f020=0x0;_0x22f020<_0x28dfb8['length']-0x1;_0x22f020++){for(var _0xfff779=0x0;_0xfff779<_0x10e904[_0x23e1c3(_0x25484c._0x49de04)]-0x1;_0xfff779++){if(edgeIntersectsEdge(_0x28dfb8[_0x22f020],_0x28dfb8[_0x22f020+0x1],_0x10e904[_0xfff779],_0x10e904[_0xfff779+0x1]))return!![];}}return![];},closeRing=function closeRing(_0x31986f){return!pointsEqual(_0x31986f[0x0],_0x31986f[_0x31986f['length']-0x1])&&_0x31986f['push'](_0x31986f[0x0]),_0x31986f;},ringIsClockwise=function ringIsClockwise(_0x40d5f5){const _0x5a49ad=_0x35a251;var _0x561aeb=0x0,_0x2bdc95=0x0,_0x3ea629=_0x40d5f5[_0x5a49ad(0xe1e)],_0x565dad=_0x40d5f5[_0x2bdc95],_0x3f0891;for(_0x2bdc95;_0x2bdc95<_0x3ea629-0x1;_0x2bdc95++){_0x3f0891=_0x40d5f5[_0x2bdc95+0x1],_0x561aeb+=(_0x3f0891[0x0]-_0x565dad[0x0])*(_0x3f0891[0x1]+_0x565dad[0x1]),_0x565dad=_0x3f0891;}return _0x561aeb>=0x0;},shallowClone=function shallowClone(_0x142e04){var _0x4a1388={};for(var _0x4b34cd in _0x142e04){_0x142e04['hasOwnProperty'](_0x4b34cd)&&(_0x4a1388[_0x4b34cd]=_0x142e04[_0x4b34cd]);}return _0x4a1388;},coordinatesContainCoordinates=function coordinatesContainCoordinates(_0x2d956f,_0x594dfb){var _0x1731e1=arrayIntersectsArray(_0x2d956f,_0x594dfb),_0x2730f6=coordinatesContainPoint(_0x2d956f,_0x594dfb[0x0]);if(!_0x1731e1&&_0x2730f6)return!![];return![];},convertRingsToGeoJSON=function convertRingsToGeoJSON(_0x51b43c){const _0x273e82={_0x3024a3:0xe1e,_0xde747c:0xda9,_0x445d0e:0xe3e,_0x43e940:0xf30},_0x33b54f=_0x35a251;var _0x4ce82c=[],_0x24b166=[],_0x2983f0,_0x2994a7,_0x11ac9f;for(var _0x1b9f8d=0x0;_0x1b9f8d<_0x51b43c[_0x33b54f(0xe1e)];_0x1b9f8d++){var _0x1740d2=closeRing(_0x51b43c[_0x1b9f8d]['slice'](0x0));if(_0x1740d2[_0x33b54f(0xe1e)]<0x4)continue;if(ringIsClockwise(_0x1740d2)){var _0x1b75c1=[_0x1740d2[_0x33b54f(0x97a)]()['reverse']()];_0x4ce82c['push'](_0x1b75c1);}else _0x24b166['push'](_0x1740d2['slice']()['reverse']());}var _0x13089d=[];while(_0x24b166['length']){_0x11ac9f=_0x24b166['pop']();var _0x43c9e6=![];for(_0x2983f0=_0x4ce82c[_0x33b54f(_0x273e82._0x3024a3)]-0x1;_0x2983f0>=0x0;_0x2983f0--){_0x2994a7=_0x4ce82c[_0x2983f0][0x0];if(coordinatesContainCoordinates(_0x2994a7,_0x11ac9f)){_0x4ce82c[_0x2983f0][_0x33b54f(0x6de)](_0x11ac9f),_0x43c9e6=!![];break;}}!_0x43c9e6&&_0x13089d[_0x33b54f(0x6de)](_0x11ac9f);}while(_0x13089d[_0x33b54f(0xe1e)]){_0x11ac9f=_0x13089d[_0x33b54f(_0x273e82._0xde747c)]();var _0x4cf1eb=![];for(_0x2983f0=_0x4ce82c['length']-0x1;_0x2983f0>=0x0;_0x2983f0--){_0x2994a7=_0x4ce82c[_0x2983f0][0x0];if(arrayIntersectsArray(_0x2994a7,_0x11ac9f)){_0x4ce82c[_0x2983f0]['push'](_0x11ac9f),_0x4cf1eb=!![];break;}}!_0x4cf1eb&&_0x4ce82c['push']([_0x11ac9f[_0x33b54f(_0x273e82._0x445d0e)]()]);}return _0x4ce82c['length']===0x1?{'type':'Polygon','coordinates':_0x4ce82c[0x0]}:{'type':_0x33b54f(_0x273e82._0x43e940),'coordinates':_0x4ce82c};},getId=function getId(_0x37c1eb,_0x4e6673){const _0x53c414={_0x41b718:0x9f4,_0x1203f5:0xd06},_0x58408c=_0x35a251;var _0x3ab1b3=_0x4e6673?[_0x4e6673,'OBJECTID',_0x58408c(_0x53c414._0x41b718)]:[_0x58408c(_0x53c414._0x1203f5),'FID'];for(var _0x551785=0x0;_0x551785<_0x3ab1b3['length'];_0x551785++){var _0xeba76=_0x3ab1b3[_0x551785];if(_0xeba76 in _0x37c1eb&&(typeof _0x37c1eb[_0xeba76]==='string'||typeof _0x37c1eb[_0xeba76]==='number'))return _0x37c1eb[_0xeba76];}throw Error('No\x20valid\x20id\x20attribute\x20found');},arcgisToGeoJSON$1=function arcgisToGeoJSON(_0x2d8c63,_0x264c31){const _0x321a99={_0x400918:0xf47,_0x48ecc8:0x6de,_0x51c419:0x4a6,_0x21dffa:0x97a,_0x405759:0x1db,_0x2c616a:0xf91,_0x33ec30:0x5e2,_0x42c290:0x15b,_0x590ce4:0x523,_0x360bfe:0x1e6,_0x121b06:0x101,_0x414d8f:0x101},_0xf8e7fa=_0x35a251;var _0x48ae68={};if(_0x2d8c63['features']){_0x48ae68[_0xf8e7fa(0x8ea)]=_0xf8e7fa(_0x321a99._0x400918),_0x48ae68[_0xf8e7fa(0x830)]=[];for(var _0x5cf550=0x0;_0x5cf550<_0x2d8c63['features']['length'];_0x5cf550++){_0x48ae68['features']['push'](arcgisToGeoJSON(_0x2d8c63['features'][_0x5cf550],_0x264c31));}}typeof _0x2d8c63['x']==='number'&&typeof _0x2d8c63['y']==='number'&&(_0x48ae68[_0xf8e7fa(0x8ea)]='Point',_0x48ae68['coordinates']=[_0x2d8c63['x'],_0x2d8c63['y']],typeof _0x2d8c63['z']==='number'&&_0x48ae68[_0xf8e7fa(0x310)][_0xf8e7fa(_0x321a99._0x48ecc8)](_0x2d8c63['z']));_0x2d8c63[_0xf8e7fa(0x34a)]&&(_0x48ae68['type']='MultiPoint',_0x48ae68['coordinates']=_0x2d8c63['points']['slice'](0x0));_0x2d8c63[_0xf8e7fa(_0x321a99._0x51c419)]&&(_0x2d8c63[_0xf8e7fa(0x4a6)]['length']===0x1?(_0x48ae68['type']='LineString',_0x48ae68['coordinates']=_0x2d8c63[_0xf8e7fa(0x4a6)][0x0][_0xf8e7fa(_0x321a99._0x21dffa)](0x0)):(_0x48ae68['type']='MultiLineString',_0x48ae68['coordinates']=_0x2d8c63['paths']['slice'](0x0)));_0x2d8c63[_0xf8e7fa(0xb37)]&&(_0x48ae68=convertRingsToGeoJSON(_0x2d8c63['rings']['slice'](0x0)));typeof _0x2d8c63['xmin']===_0xf8e7fa(0xf91)&&typeof _0x2d8c63['ymin']==='number'&&typeof _0x2d8c63[_0xf8e7fa(_0x321a99._0x405759)]==='number'&&typeof _0x2d8c63['ymax']===_0xf8e7fa(_0x321a99._0x2c616a)&&(_0x48ae68['type']='Polygon',_0x48ae68['coordinates']=[[[_0x2d8c63['xmax'],_0x2d8c63['ymax']],[_0x2d8c63[_0xf8e7fa(_0x321a99._0x33ec30)],_0x2d8c63['ymax']],[_0x2d8c63['xmin'],_0x2d8c63[_0xf8e7fa(_0x321a99._0x42c290)]],[_0x2d8c63['xmax'],_0x2d8c63['ymin']],[_0x2d8c63['xmax'],_0x2d8c63['ymax']]]]);if(_0x2d8c63['geometry']||_0x2d8c63['attributes']){_0x48ae68['type']='Feature',_0x48ae68['geometry']=_0x2d8c63[_0xf8e7fa(0x58f)]?arcgisToGeoJSON(_0x2d8c63['geometry']):null,_0x48ae68['properties']=_0x2d8c63['attributes']?shallowClone(_0x2d8c63['attributes']):null;if(_0x2d8c63[_0xf8e7fa(_0x321a99._0x590ce4)])try{_0x48ae68['id']=getId(_0x2d8c63['attributes'],_0x264c31);}catch(_0x331e78){}}return JSON['stringify'](_0x48ae68['geometry'])===JSON[_0xf8e7fa(_0x321a99._0x360bfe)]({})&&(_0x48ae68['geometry']=null),_0x2d8c63[_0xf8e7fa(_0x321a99._0x121b06)]&&_0x2d8c63['spatialReference']['wkid']&&_0x2d8c63[_0xf8e7fa(0x101)]['wkid']!==0x10e6&&console['warn']('Object\x20converted\x20in\x20non-standard\x20crs\x20-\x20'+JSON['stringify'](_0x2d8c63[_0xf8e7fa(_0x321a99._0x414d8f)])),_0x48ae68;},orientRings=function orientRings(_0x49823b){const _0x3b802a={_0x39e1ea:0x97a,_0x1d2099:0xe1e},_0x4edbb4=_0x35a251;var _0x3452ea=[],_0x4597d7=_0x49823b['slice'](0x0),_0x21be8c=closeRing(_0x4597d7['shift']()[_0x4edbb4(_0x3b802a._0x39e1ea)](0x0));if(_0x21be8c[_0x4edbb4(_0x3b802a._0x1d2099)]>=0x4){!ringIsClockwise(_0x21be8c)&&_0x21be8c['reverse']();_0x3452ea['push'](_0x21be8c);for(var _0x5d0231=0x0;_0x5d0231<_0x4597d7['length'];_0x5d0231++){var _0x39a793=closeRing(_0x4597d7[_0x5d0231]['slice'](0x0));_0x39a793[_0x4edbb4(0xe1e)]>=0x4&&(ringIsClockwise(_0x39a793)&&_0x39a793['reverse'](),_0x3452ea['push'](_0x39a793));}}return _0x3452ea;},flattenMultiPolygonRings=function flattenMultiPolygonRings(_0x90805e){const _0x3a70e4=_0x35a251;var _0x3ccd82=[];for(var _0x2a5ebb=0x0;_0x2a5ebb<_0x90805e[_0x3a70e4(0xe1e)];_0x2a5ebb++){var _0x23a95b=orientRings(_0x90805e[_0x2a5ebb]);for(var _0x366bc0=_0x23a95b['length']-0x1;_0x366bc0>=0x0;_0x366bc0--){var _0x2c165f=_0x23a95b[_0x366bc0]['slice'](0x0);_0x3ccd82['push'](_0x2c165f);}}return _0x3ccd82;},geojsonToArcGIS$1=function geojsonToArcGIS(_0x29d0e0,_0x497a23){const _0x2539f3={_0xc7d6c9:0x49e,_0xb6f184:0x310,_0x382de5:0x98f},_0x39653=_0x35a251;_0x497a23=_0x497a23||'OBJECTID';var _0x4ae31d={'wkid':0x10e6},_0xa449da={},_0x1ca374;switch(_0x29d0e0['type']){case'Point':_0xa449da['x']=_0x29d0e0[_0x39653(0x310)][0x0],_0xa449da['y']=_0x29d0e0['coordinates'][0x1];_0x29d0e0['coordinates'][0x2]!=null&&(_0xa449da['z']=_0x29d0e0['coordinates'][0x2]);_0xa449da['spatialReference']=_0x4ae31d;break;case'MultiPoint':_0xa449da['points']=_0x29d0e0['coordinates'][_0x39653(0x97a)](0x0);_0x29d0e0['coordinates'][0x0][0x2]!=null&&(_0xa449da['hasZ']=!![]);_0xa449da['spatialReference']=_0x4ae31d;break;case'LineString':_0xa449da['paths']=[_0x29d0e0[_0x39653(0x310)]['slice'](0x0)];_0x29d0e0['coordinates'][0x0][0x2]!=null&&(_0xa449da[_0x39653(_0x2539f3._0xc7d6c9)]=!![]);_0xa449da['spatialReference']=_0x4ae31d;break;case'MultiLineString':_0xa449da['paths']=_0x29d0e0['coordinates'][_0x39653(0x97a)](0x0);_0x29d0e0['coordinates'][0x0][0x0][0x2]!=null&&(_0xa449da[_0x39653(_0x2539f3._0xc7d6c9)]=!![]);_0xa449da['spatialReference']=_0x4ae31d;break;case'Polygon':_0xa449da[_0x39653(0xb37)]=orientRings(_0x29d0e0[_0x39653(_0x2539f3._0xb6f184)]['slice'](0x0));_0x29d0e0['coordinates'][0x0][0x0][0x2]!=null&&(_0xa449da['hasZ']=!![]);_0xa449da[_0x39653(0x101)]=_0x4ae31d;break;case'MultiPolygon':_0xa449da['rings']=flattenMultiPolygonRings(_0x29d0e0['coordinates']['slice'](0x0));_0x29d0e0['coordinates'][0x0][0x0][0x0][0x2]!=null&&(_0xa449da[_0x39653(0x49e)]=!![]);_0xa449da['spatialReference']=_0x4ae31d;break;case _0x39653(_0x2539f3._0x382de5):_0x29d0e0[_0x39653(0x58f)]&&(_0xa449da['geometry']=geojsonToArcGIS(_0x29d0e0[_0x39653(0x58f)],_0x497a23));_0xa449da['attributes']=_0x29d0e0['properties']?shallowClone(_0x29d0e0['properties']):{};_0x29d0e0['id']&&(_0xa449da['attributes'][_0x497a23]=_0x29d0e0['id']);break;case'FeatureCollection':_0xa449da=[];for(_0x1ca374=0x0;_0x1ca374<_0x29d0e0['features']['length'];_0x1ca374++){_0xa449da[_0x39653(0x6de)](geojsonToArcGIS(_0x29d0e0['features'][_0x1ca374],_0x497a23));}break;case'GeometryCollection':_0xa449da=[];for(_0x1ca374=0x0;_0x1ca374<_0x29d0e0['geometries']['length'];_0x1ca374++){_0xa449da['push'](geojsonToArcGIS(_0x29d0e0['geometries'][_0x1ca374],_0x497a23));}break;}return _0xa449da;};function globals(_0x1f3774){const _0x44ca95={_0x223aa3:0x515,_0x2893b3:0x367},_0x2762a9=_0x35a251;_0x1f3774('EPSG:4326','+title=WGS\x2084\x20(long/lat)\x20+proj=longlat\x20+ellps=WGS84\x20+datum=WGS84\x20+units=degrees'),_0x1f3774(_0x2762a9(0x360),_0x2762a9(_0x44ca95._0x223aa3)),_0x1f3774('EPSG:3857','+title=WGS\x2084\x20/\x20Pseudo-Mercator\x20+proj=merc\x20+a=6378137\x20+b=6378137\x20+lat_ts=0.0\x20+lon_0=0.0\x20+x_0=0.0\x20+y_0=0\x20+k=1.0\x20+units=m\x20+nadgrids=@null\x20+no_defs'),_0x1f3774[_0x2762a9(0xf39)]=_0x1f3774['EPSG:4326'],_0x1f3774['EPSG:3785']=_0x1f3774[_0x2762a9(0x367)],_0x1f3774['GOOGLE']=_0x1f3774[_0x2762a9(0x367)],_0x1f3774[_0x2762a9(0xd94)]=_0x1f3774[_0x2762a9(_0x44ca95._0x2893b3)],_0x1f3774['EPSG:102113']=_0x1f3774['EPSG:3857'];}var PJD_3PARAM=0x1,PJD_7PARAM=0x2,PJD_GRIDSHIFT=0x3,PJD_WGS84=0x4,PJD_NODATUM=0x5,SRS_WGS84_SEMIMAJOR=0x615299,SRS_WGS84_SEMIMINOR=6356752.314,SRS_WGS84_ESQUARED=0.0066943799901413165,SEC_TO_RAD=0.00000484813681109536,HALF_PI=Math['PI']/0x2,SIXTH=0.16666666666666666,RA4=0.04722222222222222,RA6=0.022156084656084655,EPSLN=1e-10,D2R$1=0.017453292519943295,R2D=57.29577951308232,FORTPI=Math['PI']/0x4,TWO_PI=Math['PI']*0x2,SPI=3.14159265359,exports$3={};exports$3['greenwich']=0x0,exports$3['lisbon']=-9.131906111111,exports$3['paris']=2.337229166667,exports$3['bogota']=-74.080916666667,exports$3['madrid']=-3.687938888889,exports$3[_0x35a251(0x8e6)]=12.452333333333,exports$3[_0x35a251(0xf50)]=7.439583333333,exports$3[_0x35a251(0x509)]=106.807719444444,exports$3['ferro']=-17.666666666667,exports$3['brussels']=4.367975,exports$3['stockholm']=18.058277777778,exports$3['athens']=23.7163375,exports$3[_0x35a251(0x77f)]=10.722916666667;var units={'ft':{'to_meter':0.3048},'us-ft':{'to_meter':0x4b0/0xf61}},ignoredChar=/[\s_\-\/\(\)]/g;function match(_0x58c8d0,_0x58e978){const _0x2a89e7={_0x5b40c6:0x29b,_0x46e65e:0x20e},_0x5cce58=_0x35a251;if(_0x58c8d0[_0x58e978])return _0x58c8d0[_0x58e978];var _0x480937=Object['keys'](_0x58c8d0),_0x8198b3=_0x58e978[_0x5cce58(_0x2a89e7._0x5b40c6)]()[_0x5cce58(_0x2a89e7._0x46e65e)](ignoredChar,''),_0x3c6ef7=-0x1,_0x46761d,_0x4f5a58;while(++_0x3c6ef7<_0x480937['length']){_0x46761d=_0x480937[_0x3c6ef7],_0x4f5a58=_0x46761d['toLowerCase']()['replace'](ignoredChar,'');if(_0x4f5a58===_0x8198b3)return _0x58c8d0[_0x46761d];}}function projStr(_0x458f86){const _0x2ab549={_0x3c4d8a:0xc07},_0x3f40c3={_0x5304a0:0x37f},_0x5ecb37={_0x29c5aa:0xb0c},_0x560111={_0x243047:0x782},_0x112c2e={_0x3e15ff:0xbca};var _0x3ffeca={},_0x272099=_0x458f86['split']('+')['map'](function(_0x3750b4){const _0x1799cf=_0x2767;return _0x3750b4[_0x1799cf(_0x112c2e._0x3e15ff)]();})['filter'](function(_0x3efaee){return _0x3efaee;})['reduce'](function(_0x5cbe42,_0x349bb3){var _0x3ca989=_0x349bb3['split']('=');return _0x3ca989['push'](!![]),_0x5cbe42[_0x3ca989[0x0]['toLowerCase']()]=_0x3ca989[0x1],_0x5cbe42;},{}),_0x1c8458,_0x3b2986,_0x4e3c22,_0x23fa78={'proj':'projName','datum':'datumCode','rf':function(_0x4b003e){_0x3ffeca['rf']=parseFloat(_0x4b003e);},'lat_0':function(_0x859e9f){_0x3ffeca['lat0']=_0x859e9f*D2R$1;},'lat_1':function(_0x40ea58){_0x3ffeca['lat1']=_0x40ea58*D2R$1;},'lat_2':function(_0x77bc2){const _0x4e1aa9=_0x2767;_0x3ffeca[_0x4e1aa9(0x290)]=_0x77bc2*D2R$1;},'lat_ts':function(_0x5c06fd){_0x3ffeca['lat_ts']=_0x5c06fd*D2R$1;},'lon_0':function(_0x4d9d41){_0x3ffeca['long0']=_0x4d9d41*D2R$1;},'lon_1':function(_0x117fbf){const _0x55d5d=_0x2767;_0x3ffeca[_0x55d5d(0x119)]=_0x117fbf*D2R$1;},'lon_2':function(_0x2ab989){const _0x2c46c9=_0x2767;_0x3ffeca[_0x2c46c9(_0x560111._0x243047)]=_0x2ab989*D2R$1;},'alpha':function(_0x45ce74){_0x3ffeca['alpha']=parseFloat(_0x45ce74)*D2R$1;},'gamma':function(_0x59bd82){_0x3ffeca['rectified_grid_angle']=parseFloat(_0x59bd82);},'lonc':function(_0x2b56ee){_0x3ffeca['longc']=_0x2b56ee*D2R$1;},'x_0':function(_0x42f0fe){_0x3ffeca['x0']=parseFloat(_0x42f0fe);},'y_0':function(_0x46fa36){_0x3ffeca['y0']=parseFloat(_0x46fa36);},'k_0':function(_0x451b87){_0x3ffeca['k0']=parseFloat(_0x451b87);},'k':function(_0x2f9354){_0x3ffeca['k0']=parseFloat(_0x2f9354);},'a':function(_0x4f485b){_0x3ffeca['a']=parseFloat(_0x4f485b);},'b':function(_0x5902c3){_0x3ffeca['b']=parseFloat(_0x5902c3);},'r_a':function(){_0x3ffeca['R_A']=!![];},'zone':function(_0x3f033c){_0x3ffeca['zone']=parseInt(_0x3f033c,0xa);},'south':function(){const _0x263e87=_0x2767;_0x3ffeca[_0x263e87(0x989)]=!![];},'towgs84':function(_0x35b740){const _0x2b9fac=_0x2767;_0x3ffeca['datum_params']=_0x35b740[_0x2b9fac(_0x5ecb37._0x29c5aa)](',')['map'](function(_0x2840de){return parseFloat(_0x2840de);});},'to_meter':function(_0x50375c){_0x3ffeca['to_meter']=parseFloat(_0x50375c);},'units':function(_0x5af1f1){const _0x30aa03=_0x2767;_0x3ffeca[_0x30aa03(0x672)]=_0x5af1f1;var _0x3442b9=match(units,_0x5af1f1);_0x3442b9&&(_0x3ffeca['to_meter']=_0x3442b9['to_meter']);},'from_greenwich':function(_0x278779){_0x3ffeca['from_greenwich']=_0x278779*D2R$1;},'pm':function(_0x123b9a){const _0x57efdb=_0x2767;var _0xb4137=match(exports$3,_0x123b9a);_0x3ffeca[_0x57efdb(_0x3f40c3._0x5304a0)]=(_0xb4137?_0xb4137:parseFloat(_0x123b9a))*D2R$1;},'nadgrids':function(_0x57894e){_0x57894e==='@null'?_0x3ffeca['datumCode']='none':_0x3ffeca['nadgrids']=_0x57894e;},'axis':function(_0x3778a7){const _0x1ab170=_0x2767;var _0x29eb59='ewnsud';_0x3778a7['length']===0x3&&_0x29eb59['indexOf'](_0x3778a7['substr'](0x0,0x1))!==-0x1&&_0x29eb59['indexOf'](_0x3778a7[_0x1ab170(0x29f)](0x1,0x1))!==-0x1&&_0x29eb59[_0x1ab170(0xd74)](_0x3778a7['substr'](0x2,0x1))!==-0x1&&(_0x3ffeca[_0x1ab170(_0x2ab549._0x3c4d8a)]=_0x3778a7);},'approx':function(){_0x3ffeca['approx']=!![];}};for(_0x1c8458 in _0x272099){_0x3b2986=_0x272099[_0x1c8458],_0x1c8458 in _0x23fa78?(_0x4e3c22=_0x23fa78[_0x1c8458],typeof _0x4e3c22==='function'?_0x4e3c22(_0x3b2986):_0x3ffeca[_0x4e3c22]=_0x3b2986):_0x3ffeca[_0x1c8458]=_0x3b2986;}return typeof _0x3ffeca['datumCode']==='string'&&_0x3ffeca['datumCode']!=='WGS84'&&(_0x3ffeca['datumCode']=_0x3ffeca['datumCode']['toLowerCase']()),_0x3ffeca;}var NEUTRAL=0x1,KEYWORD=0x2,NUMBER=0x3,QUOTED=0x4,AFTERQUOTE=0x5,ENDED=-0x1,whitespace=/\s/,latin=/[A-Za-z]/,keyword=/[A-Za-z84_]/,endThings=/[,\]]/,digets=/[\d\.E\-\+]/;function Parser(_0x38b708){const _0x4d5192={_0xeecfe2:0x829,_0x136345:0xe1f,_0x211325:0xc89},_0x30753d=_0x35a251;if(typeof _0x38b708!=='string')throw new Error(_0x30753d(_0x4d5192._0xeecfe2));this[_0x30753d(_0x4d5192._0x136345)]=_0x38b708['trim'](),this[_0x30753d(0xd0c)]=0x0,this[_0x30753d(_0x4d5192._0x211325)]=0x0,this['root']=null,this['stack']=[],this[_0x30753d(0x6d5)]=null,this['state']=NEUTRAL;}Parser['prototype']['readCharicter']=function(){const _0x379f5d={_0x57fc18:0x4e0,_0x3bc0bc:0x342,_0x38f88f:0xfbf,_0x142417:0x8aa},_0x53c725=_0x35a251;var _0x6b3a3e=this['text'][this['place']++];if(this[_0x53c725(_0x379f5d._0x57fc18)]!==QUOTED)while(whitespace[_0x53c725(_0x379f5d._0x3bc0bc)](_0x6b3a3e)){if(this['place']>=this[_0x53c725(0xe1f)][_0x53c725(0xe1e)])return;_0x6b3a3e=this['text'][this['place']++];}switch(this[_0x53c725(0x4e0)]){case NEUTRAL:return this['neutral'](_0x6b3a3e);case KEYWORD:return this[_0x53c725(0x6c6)](_0x6b3a3e);case QUOTED:return this[_0x53c725(_0x379f5d._0x38f88f)](_0x6b3a3e);case AFTERQUOTE:return this[_0x53c725(_0x379f5d._0x142417)](_0x6b3a3e);case NUMBER:return this[_0x53c725(0xf91)](_0x6b3a3e);case ENDED:return;}},Parser['prototype'][_0x35a251(0x8aa)]=function(_0x3e740f){const _0x4815e7={_0x4ca39a:0x342,_0x3d038d:0xaca,_0x3c442c:0x148},_0x5061f9=_0x35a251;if(_0x3e740f==='\x22'){this['word']+='\x22',this['state']=QUOTED;return;}if(endThings[_0x5061f9(_0x4815e7._0x4ca39a)](_0x3e740f)){this[_0x5061f9(0xaca)]=this[_0x5061f9(_0x4815e7._0x3d038d)]['trim'](),this['afterItem'](_0x3e740f);return;}throw new Error('havn\x27t\x20handled\x20\x22'+_0x3e740f+_0x5061f9(_0x4815e7._0x3c442c)+this['place']);},Parser[_0x35a251(0xb1b)][_0x35a251(0x4ca)]=function(_0x5765b4){const _0x304018={_0x5da264:0xaa8},_0x17f8cd=_0x35a251;if(_0x5765b4===','){this[_0x17f8cd(0xaca)]!==null&&this['currentObject']['push'](this['word']);this['word']=null,this[_0x17f8cd(0x4e0)]=NEUTRAL;return;}if(_0x5765b4===']'){this['level']--;this['word']!==null&&(this['currentObject']['push'](this['word']),this['word']=null);this[_0x17f8cd(0x4e0)]=NEUTRAL,this['currentObject']=this[_0x17f8cd(_0x304018._0x5da264)]['pop']();!this['currentObject']&&(this['state']=ENDED);return;}},Parser[_0x35a251(0xb1b)][_0x35a251(0xf91)]=function(_0x9373dc){const _0x5afd3e={_0x4057a6:0xaca,_0x5ec282:0x7b5},_0x1d0991=_0x35a251;if(digets['test'](_0x9373dc)){this['word']+=_0x9373dc;return;}if(endThings['test'](_0x9373dc)){this[_0x1d0991(_0x5afd3e._0x4057a6)]=parseFloat(this['word']),this['afterItem'](_0x9373dc);return;}throw new Error(_0x1d0991(_0x5afd3e._0x5ec282)+_0x9373dc+'\x22\x20in\x20number\x20yet,\x20index\x20'+this['place']);},Parser[_0x35a251(0xb1b)]['quoted']=function(_0x549efc){if(_0x549efc==='\x22'){this['state']=AFTERQUOTE;return;}this['word']+=_0x549efc;return;},Parser['prototype']['keyword']=function(_0x3dcb81){const _0x591ba4={_0x4e7920:0xaca,_0x3a3988:0x6d5,_0x180bf5:0x4ca,_0xd83061:0x7b5},_0x279388=_0x35a251;if(keyword['test'](_0x3dcb81)){this[_0x279388(_0x591ba4._0x4e7920)]+=_0x3dcb81;return;}if(_0x3dcb81==='['){var _0x3b95dc=[];_0x3b95dc['push'](this['word']),this['level']++;this['root']===null?this[_0x279388(0x791)]=_0x3b95dc:this[_0x279388(_0x591ba4._0x3a3988)]['push'](_0x3b95dc);this['stack'][_0x279388(0x6de)](this['currentObject']),this['currentObject']=_0x3b95dc,this[_0x279388(0x4e0)]=NEUTRAL;return;}if(endThings['test'](_0x3dcb81)){this[_0x279388(_0x591ba4._0x180bf5)](_0x3dcb81);return;}throw new Error(_0x279388(_0x591ba4._0xd83061)+_0x3dcb81+_0x279388(0xd90)+this['place']);},Parser[_0x35a251(0xb1b)][_0x35a251(0xab)]=function(_0x16dc10){const _0x3dc61c={_0x17b87a:0x342,_0x3a3694:0x4e0},_0x29bc21=_0x35a251;if(latin['test'](_0x16dc10)){this['word']=_0x16dc10,this['state']=KEYWORD;return;}if(_0x16dc10==='\x22'){this[_0x29bc21(0xaca)]='',this[_0x29bc21(0x4e0)]=QUOTED;return;}if(digets[_0x29bc21(_0x3dc61c._0x17b87a)](_0x16dc10)){this['word']=_0x16dc10,this[_0x29bc21(_0x3dc61c._0x3a3694)]=NUMBER;return;}if(endThings['test'](_0x16dc10)){this[_0x29bc21(0x4ca)](_0x16dc10);return;}throw new Error(_0x29bc21(0x7b5)+_0x16dc10+'\x22\x20in\x20neutral\x20yet,\x20index\x20'+this['place']);},Parser['prototype']['output']=function(){const _0x3f1cef={_0x1bc2aa:0xd72,_0x49c700:0x4e0},_0x376044=_0x35a251;while(this['place']<this[_0x376044(0xe1f)][_0x376044(0xe1e)]){this['readCharicter']();}if(this[_0x376044(0x4e0)]===ENDED)return this[_0x376044(0x791)];throw new Error('unable\x20to\x20parse\x20string\x20\x22'+this[_0x376044(0xe1f)]+_0x376044(_0x3f1cef._0x1bc2aa)+this[_0x376044(_0x3f1cef._0x49c700)]);};function parseString(_0x19c913){const _0xa998ef={_0x43bf37:0xd7e},_0x2bc795=_0x35a251;var _0x5e5e5a=new Parser(_0x19c913);return _0x5e5e5a[_0x2bc795(_0xa998ef._0x43bf37)]();}function mapit(_0x486da7,_0xc72259,_0x2769a){const _0x15c08e={_0x3f6ff0:0x719,_0x17036d:0x970},_0x5d7443=_0x35a251;Array[_0x5d7443(_0x15c08e._0x3f6ff0)](_0xc72259)&&(_0x2769a[_0x5d7443(_0x15c08e._0x17036d)](_0xc72259),_0xc72259=null);var _0x566e40=_0xc72259?{}:_0x486da7,_0x518f5c=_0x2769a['reduce'](function(_0x50a4cb,_0x14d7ed){return sExpr(_0x14d7ed,_0x50a4cb),_0x50a4cb;},_0x566e40);_0xc72259&&(_0x486da7[_0xc72259]=_0x518f5c);}function sExpr(_0x4deda9,_0x32b746){const _0x5c2295={_0x44c8f9:0xd5e,_0x4ccc90:0xe1e},_0x4e6bcc=_0x35a251;if(!Array['isArray'](_0x4deda9)){_0x32b746[_0x4deda9]=!![];return;}var _0x3bd5c0=_0x4deda9[_0x4e6bcc(_0x5c2295._0x44c8f9)]();_0x3bd5c0===_0x4e6bcc(0x547)&&(_0x3bd5c0=_0x4deda9[_0x4e6bcc(0xd5e)]());if(_0x4deda9['length']===0x1){if(Array['isArray'](_0x4deda9[0x0])){_0x32b746[_0x3bd5c0]={},sExpr(_0x4deda9[0x0],_0x32b746[_0x3bd5c0]);return;}_0x32b746[_0x3bd5c0]=_0x4deda9[0x0];return;}if(!_0x4deda9['length']){_0x32b746[_0x3bd5c0]=!![];return;}if(_0x3bd5c0==='TOWGS84'){_0x32b746[_0x3bd5c0]=_0x4deda9;return;}if(_0x3bd5c0===_0x4e6bcc(0x97)){!(_0x3bd5c0 in _0x32b746)&&(_0x32b746[_0x3bd5c0]=[]);_0x32b746[_0x3bd5c0]['push'](_0x4deda9);return;}!Array['isArray'](_0x3bd5c0)&&(_0x32b746[_0x3bd5c0]={});var _0x1f504c;switch(_0x3bd5c0){case'UNIT':case'PRIMEM':case _0x4e6bcc(0xa4):_0x32b746[_0x3bd5c0]={'name':_0x4deda9[0x0]['toLowerCase'](),'convert':_0x4deda9[0x1]};_0x4deda9['length']===0x3&&sExpr(_0x4deda9[0x2],_0x32b746[_0x3bd5c0]);return;case'SPHEROID':case'ELLIPSOID':_0x32b746[_0x3bd5c0]={'name':_0x4deda9[0x0],'a':_0x4deda9[0x1],'rf':_0x4deda9[0x2]};_0x4deda9[_0x4e6bcc(_0x5c2295._0x4ccc90)]===0x4&&sExpr(_0x4deda9[0x3],_0x32b746[_0x3bd5c0]);return;case'PROJECTEDCRS':case'PROJCRS':case'GEOGCS':case'GEOCCS':case'PROJCS':case'LOCAL_CS':case _0x4e6bcc(0xe4f):case _0x4e6bcc(0xee9):case _0x4e6bcc(0xed7):case _0x4e6bcc(0x80f):case'ENGINEERINGDATUM':case'VERT_CS':case'VERTCRS':case'VERTICALCRS':case'COMPD_CS':case'COMPOUNDCRS':case _0x4e6bcc(0x911):case'ENGCRS':case'FITTED_CS':case'LOCAL_DATUM':case'DATUM':_0x4deda9[0x0]=[_0x4e6bcc(0x504),_0x4deda9[0x0]],mapit(_0x32b746,_0x3bd5c0,_0x4deda9);return;default:_0x1f504c=-0x1;while(++_0x1f504c<_0x4deda9[_0x4e6bcc(0xe1e)]){if(!Array[_0x4e6bcc(0x719)](_0x4deda9[_0x1f504c]))return sExpr(_0x4deda9,_0x32b746[_0x3bd5c0]);}return mapit(_0x32b746,_0x3bd5c0,_0x4deda9);}}var D2R=0.017453292519943295;function rename(_0x1c2133,_0x4a210f){var _0x1a91fe=_0x4a210f[0x0],_0x24064f=_0x4a210f[0x1];!(_0x1a91fe in _0x1c2133)&&_0x24064f in _0x1c2133&&(_0x1c2133[_0x1a91fe]=_0x1c2133[_0x24064f],_0x4a210f['length']===0x3&&(_0x1c2133[_0x1a91fe]=_0x4a210f[0x2](_0x1c2133[_0x1a91fe])));}function d2r(_0x3ad10e){return _0x3ad10e*D2R;}function cleanWKT(_0x45f2b9){const _0x54c2be={_0x464eae:0x57c,_0x1e100b:0x876,_0x55a1a9:0xe3a,_0x292e81:0x97,_0x3aad88:0xd74,_0x59d494:0xdc7,_0x57d806:0xa47,_0x10f9a4:0x49b,_0x3c5148:0x504,_0x47c080:0x29b,_0x2f9a6b:0x2b9,_0x3cfd75:0x2b9,_0x19b08c:0x3bd,_0x13c8ba:0xe3a,_0x5d8444:0x2b9,_0x400696:0xd74,_0x399f20:0x8e2,_0x54c65d:0x20e,_0x25853a:0x20e,_0x54b1bf:0xe05,_0x53ae6d:0x2b9,_0x267c9a:0xd74,_0x1df815:0x214,_0x34ba74:0xd74,_0x353ac6:0x2c8,_0x4acaf6:0xba9,_0x5b0efe:0xb9c,_0xd1b34f:0x42c,_0x2ec4f5:0x7d0,_0x5a02a9:0xb72,_0x2c8d96:0x8fa,_0x3a105c:0x2f3,_0x28212a:0x9d0,_0x3b55b0:0xaba,_0x481cab:0x2c8,_0x14d10d:0xc53,_0x5f4005:0xc53,_0x541c68:0xf53,_0x367ddf:0xb0a},_0x3f71ba=_0x35a251;if(_0x45f2b9['type']===_0x3f71ba(_0x54c2be._0x464eae))_0x45f2b9['projName']=_0x3f71ba(0xe60);else _0x45f2b9['type']==='LOCAL_CS'?(_0x45f2b9['projName']='identity',_0x45f2b9[_0x3f71ba(_0x54c2be._0x1e100b)]=!![]):typeof _0x45f2b9[_0x3f71ba(_0x54c2be._0x55a1a9)]==='object'?_0x45f2b9['projName']=Object['keys'](_0x45f2b9['PROJECTION'])[0x0]:_0x45f2b9['projName']=_0x45f2b9['PROJECTION'];if(_0x45f2b9[_0x3f71ba(_0x54c2be._0x292e81)]){var _0x1f7af9='';for(var _0x58c330=0x0,_0x4c6527=_0x45f2b9['AXIS']['length'];_0x58c330<_0x4c6527;++_0x58c330){var _0x356d19=[_0x45f2b9[_0x3f71ba(0x97)][_0x58c330][0x0]['toLowerCase'](),_0x45f2b9['AXIS'][_0x58c330][0x1]['toLowerCase']()];if(_0x356d19[0x0][_0x3f71ba(_0x54c2be._0x3aad88)]('north')!==-0x1||(_0x356d19[0x0]==='y'||_0x356d19[0x0]==='lat')&&_0x356d19[0x1]==='north')_0x1f7af9+='n';else{if(_0x356d19[0x0]['indexOf'](_0x3f71ba(0xdc7))!==-0x1||(_0x356d19[0x0]==='y'||_0x356d19[0x0]===_0x3f71ba(0xb9d))&&_0x356d19[0x1]===_0x3f71ba(_0x54c2be._0x59d494))_0x1f7af9+='s';else{if(_0x356d19[0x0]['indexOf'](_0x3f71ba(_0x54c2be._0x57d806))!==-0x1||(_0x356d19[0x0]==='x'||_0x356d19[0x0]==='lon')&&_0x356d19[0x1]==='east')_0x1f7af9+='e';else(_0x356d19[0x0]['indexOf'](_0x3f71ba(0x27d))!==-0x1||(_0x356d19[0x0]==='x'||_0x356d19[0x0]==='lon')&&_0x356d19[0x1]===_0x3f71ba(0x27d))&&(_0x1f7af9+='w');}}}_0x1f7af9['length']===0x2&&(_0x1f7af9+='u'),_0x1f7af9['length']===0x3&&(_0x45f2b9[_0x3f71ba(0xc07)]=_0x1f7af9);}_0x45f2b9[_0x3f71ba(0xca4)]&&(_0x45f2b9['units']=_0x45f2b9['UNIT'][_0x3f71ba(0x504)]['toLowerCase'](),_0x45f2b9['units']==='metre'&&(_0x45f2b9['units']='meter'),_0x45f2b9['UNIT']['convert']&&(_0x45f2b9['type']==='GEOGCS'?_0x45f2b9[_0x3f71ba(_0x54c2be._0x10f9a4)]&&_0x45f2b9['DATUM']['SPHEROID']&&(_0x45f2b9['to_meter']=_0x45f2b9['UNIT']['convert']*_0x45f2b9['DATUM']['SPHEROID']['a']):_0x45f2b9['to_meter']=_0x45f2b9['UNIT']['convert']));var _0x308a21=_0x45f2b9['GEOGCS'];_0x45f2b9['type']==='GEOGCS'&&(_0x308a21=_0x45f2b9);_0x308a21&&(_0x308a21['DATUM']?_0x45f2b9['datumCode']=_0x308a21['DATUM'][_0x3f71ba(_0x54c2be._0x3c5148)][_0x3f71ba(_0x54c2be._0x47c080)]():_0x45f2b9[_0x3f71ba(_0x54c2be._0x2f9a6b)]=_0x308a21[_0x3f71ba(0x504)]['toLowerCase'](),_0x45f2b9[_0x3f71ba(_0x54c2be._0x2f9a6b)][_0x3f71ba(0x97a)](0x0,0x2)==='d_'&&(_0x45f2b9['datumCode']=_0x45f2b9['datumCode']['slice'](0x2)),(_0x45f2b9[_0x3f71ba(_0x54c2be._0x2f9a6b)]==='new_zealand_geodetic_datum_1949'||_0x45f2b9[_0x3f71ba(_0x54c2be._0x3cfd75)]==='new_zealand_1949')&&(_0x45f2b9['datumCode']=_0x3f71ba(0x325)),(_0x45f2b9[_0x3f71ba(_0x54c2be._0x2f9a6b)]==='wgs_1984'||_0x45f2b9[_0x3f71ba(0x2b9)]===_0x3f71ba(_0x54c2be._0x19b08c))&&(_0x45f2b9[_0x3f71ba(_0x54c2be._0x13c8ba)]==='Mercator_Auxiliary_Sphere'&&(_0x45f2b9['sphere']=!![]),_0x45f2b9['datumCode']='wgs84'),_0x45f2b9['datumCode'][_0x3f71ba(0x97a)](-0x6)===_0x3f71ba(0x5d3)&&(_0x45f2b9['datumCode']=_0x45f2b9[_0x3f71ba(0x2b9)][_0x3f71ba(0x97a)](0x0,-0x6)),_0x45f2b9['datumCode']['slice'](-0x8)==='_jakarta'&&(_0x45f2b9[_0x3f71ba(_0x54c2be._0x5d8444)]=_0x45f2b9['datumCode']['slice'](0x0,-0x8)),~_0x45f2b9[_0x3f71ba(0x2b9)][_0x3f71ba(_0x54c2be._0x400696)](_0x3f71ba(0x55a))&&(_0x45f2b9[_0x3f71ba(0x2b9)]='rnb72'),_0x308a21['DATUM']&&_0x308a21['DATUM'][_0x3f71ba(0x95c)]&&(_0x45f2b9[_0x3f71ba(_0x54c2be._0x399f20)]=_0x308a21[_0x3f71ba(_0x54c2be._0x10f9a4)]['SPHEROID']['name'][_0x3f71ba(_0x54c2be._0x54c65d)](_0x3f71ba(0x844),'')[_0x3f71ba(_0x54c2be._0x25853a)](/[Cc]larke\_18/,'clrk'),_0x45f2b9['ellps']['toLowerCase']()[_0x3f71ba(0x97a)](0x0,0xd)===_0x3f71ba(_0x54c2be._0x54b1bf)&&(_0x45f2b9[_0x3f71ba(_0x54c2be._0x399f20)]=_0x3f71ba(0xce4)),_0x45f2b9['a']=_0x308a21['DATUM']['SPHEROID']['a'],_0x45f2b9['rf']=parseFloat(_0x308a21['DATUM']['SPHEROID']['rf'],0xa)),_0x308a21['DATUM']&&_0x308a21['DATUM']['TOWGS84']&&(_0x45f2b9['datum_params']=_0x308a21[_0x3f71ba(0x49b)]['TOWGS84']),~_0x45f2b9[_0x3f71ba(_0x54c2be._0x53ae6d)][_0x3f71ba(_0x54c2be._0x267c9a)](_0x3f71ba(0x5cc))&&(_0x45f2b9['datumCode']='osgb36'),~_0x45f2b9['datumCode']['indexOf'](_0x3f71ba(_0x54c2be._0x1df815))&&(_0x45f2b9['datumCode']='osni52'),(~_0x45f2b9[_0x3f71ba(0x2b9)][_0x3f71ba(_0x54c2be._0x34ba74)]('tm65')||~_0x45f2b9['datumCode']['indexOf']('geodetic_datum_of_1965'))&&(_0x45f2b9['datumCode']='ire65'),_0x45f2b9[_0x3f71ba(0x2b9)]==='ch1903+'&&(_0x45f2b9['datumCode']='ch1903'),~_0x45f2b9[_0x3f71ba(0x2b9)]['indexOf'](_0x3f71ba(0x629))&&(_0x45f2b9['datumCode']=_0x3f71ba(0xec9)));_0x45f2b9['b']&&!isFinite(_0x45f2b9['b'])&&(_0x45f2b9['b']=_0x45f2b9['a']);function _0xa6fb87(_0x284f8f){var _0x1dfe50=_0x45f2b9['to_meter']||0x1;return _0x284f8f*_0x1dfe50;}var _0x21b80b=function(_0x58711d){return rename(_0x45f2b9,_0x58711d);},_0x47b452=[['standard_parallel_1','Standard_Parallel_1'],[_0x3f71ba(_0x54c2be._0x353ac6),'Latitude\x20of\x201st\x20standard\x20parallel'],[_0x3f71ba(_0x54c2be._0x4acaf6),'Standard_Parallel_2'],['standard_parallel_2',_0x3f71ba(_0x54c2be._0x5b0efe)],['false_easting','False_Easting'],[_0x3f71ba(_0x54c2be._0xd1b34f),_0x3f71ba(0x8e)],['false-easting',_0x3f71ba(_0x54c2be._0x2ec4f5)],['false_northing',_0x3f71ba(0x26e)],[_0x3f71ba(0x9d0),'False\x20northing'],[_0x3f71ba(0x9d0),_0x3f71ba(0xb43)],[_0x3f71ba(0xaba),'Central_Meridian'],[_0x3f71ba(0xaba),'Longitude\x20of\x20natural\x20origin'],['central_meridian','Longitude\x20of\x20false\x20origin'],['latitude_of_origin','Latitude_Of_Origin'],['latitude_of_origin',_0x3f71ba(_0x54c2be._0x5a02a9)],['latitude_of_origin','Latitude\x20of\x20natural\x20origin'],['latitude_of_origin','Latitude\x20of\x20false\x20origin'],['scale_factor',_0x3f71ba(0xa65)],['k0','scale_factor'],['latitude_of_center','Latitude_Of_Center'],['latitude_of_center',_0x3f71ba(_0x54c2be._0x2c8d96)],['lat0',_0x3f71ba(0xcc6),d2r],[_0x3f71ba(_0x54c2be._0x3a105c),'Longitude_Of_Center'],[_0x3f71ba(0x2f3),_0x3f71ba(0x3bc)],['longc',_0x3f71ba(0x2f3),d2r],['x0','false_easting',_0xa6fb87],['y0',_0x3f71ba(_0x54c2be._0x28212a),_0xa6fb87],[_0x3f71ba(0x9cb),_0x3f71ba(_0x54c2be._0x3b55b0),d2r],['lat0','latitude_of_origin',d2r],['lat0','standard_parallel_1',d2r],['lat1',_0x3f71ba(_0x54c2be._0x481cab),d2r],['lat2','standard_parallel_2',d2r],[_0x3f71ba(_0x54c2be._0x14d10d),'Azimuth'],['alpha',_0x3f71ba(_0x54c2be._0x5f4005),d2r],['srsCode','name']];_0x47b452['forEach'](_0x21b80b),!_0x45f2b9['long0']&&_0x45f2b9['longc']&&(_0x45f2b9['projName']==='Albers_Conic_Equal_Area'||_0x45f2b9['projName']===_0x3f71ba(_0x54c2be._0x541c68))&&(_0x45f2b9['long0']=_0x45f2b9[_0x3f71ba(0x8d9)]),!_0x45f2b9[_0x3f71ba(0x8e9)]&&_0x45f2b9[_0x3f71ba(_0x54c2be._0x367ddf)]&&(_0x45f2b9['projName']==='Stereographic_South_Pole'||_0x45f2b9['projName']==='Polar\x20Stereographic\x20(variant\x20B)')&&(_0x45f2b9[_0x3f71ba(0xe40)]=d2r(_0x45f2b9['lat1']>0x0?0x5a:-0x5a),_0x45f2b9['lat_ts']=_0x45f2b9['lat1']);}function wkt(_0x1c267a){var _0x1822cd=parseString(_0x1c267a),_0x54bb3f=_0x1822cd['shift'](),_0x18568d=_0x1822cd['shift']();_0x1822cd['unshift'](['name',_0x18568d]),_0x1822cd['unshift'](['type',_0x54bb3f]);var _0x1371aa={};return sExpr(_0x1822cd,_0x1371aa),cleanWKT(_0x1371aa),_0x1371aa;}function defs(_0x2af8be){const _0x51643d=_0x35a251;var _0x3af7f2=this;if(arguments['length']===0x2){var _0x40dba4=arguments[0x1];typeof _0x40dba4==='string'?_0x40dba4['charAt'](0x0)==='+'?defs[_0x2af8be]=projStr(arguments[0x1]):defs[_0x2af8be]=wkt(arguments[0x1]):defs[_0x2af8be]=_0x40dba4;}else{if(arguments['length']===0x1){if(Array[_0x51643d(0x719)](_0x2af8be))return _0x2af8be['map'](function(_0x17dd8e){Array['isArray'](_0x17dd8e)?defs['apply'](_0x3af7f2,_0x17dd8e):defs(_0x17dd8e);});else{if(typeof _0x2af8be===_0x51643d(0x8bf)){if(_0x2af8be in defs)return defs[_0x2af8be];}else{if('EPSG'in _0x2af8be)defs['EPSG:'+_0x2af8be['EPSG']]=_0x2af8be;else{if('ESRI'in _0x2af8be)defs['ESRI:'+_0x2af8be['ESRI']]=_0x2af8be;else'IAU2000'in _0x2af8be?defs['IAU2000:'+_0x2af8be['IAU2000']]=_0x2af8be:console['log'](_0x2af8be);}}}return;}}}globals(defs);function testObj(_0x42f267){return typeof _0x42f267==='string';}function testDef(_0xba8557){return _0xba8557 in defs;}var codeWords=[_0x35a251(0x822),_0x35a251(0x426),_0x35a251(0x57c),_0x35a251(0xc99),'PROJCS',_0x35a251(0xdda),'GEODCRS','GEODETICCRS','GEODETICDATUM',_0x35a251(0x522),'ENGINEERINGCRS'];function testWKT(_0x10b1d0){return codeWords['some'](function(_0x3e6b9c){return _0x10b1d0['indexOf'](_0x3e6b9c)>-0x1;});}var codes=[_0x35a251(0x779),_0x35a251(0xac4),'3785',_0x35a251(0xf3a)];function checkMercator(_0xf1fb2d){const _0x1bc76e={_0x15174c:0x6dc},_0x476f5c=_0x35a251;var _0x35ccfb=match(_0xf1fb2d,_0x476f5c(0xbdd));if(!_0x35ccfb)return;var _0x110146=match(_0x35ccfb,_0x476f5c(_0x1bc76e._0x15174c));return _0x110146&&codes['indexOf'](_0x110146)>-0x1;}function checkProjStr(_0x2e1023){var _0x178e4c=match(_0x2e1023,'extension');if(!_0x178e4c)return;return match(_0x178e4c,'proj4');}function testProj(_0x12efd8){return _0x12efd8[0x0]==='+';}function parse(_0x248cf3){const _0x59f1bd=_0x35a251;if(testObj(_0x248cf3)){if(testDef(_0x248cf3))return defs[_0x248cf3];if(testWKT(_0x248cf3)){var _0x1a0275=wkt(_0x248cf3);if(checkMercator(_0x1a0275))return defs[_0x59f1bd(0x367)];var _0x14ac2f=checkProjStr(_0x1a0275);if(_0x14ac2f)return projStr(_0x14ac2f);return _0x1a0275;}if(testProj(_0x248cf3))return projStr(_0x248cf3);}else return _0x248cf3;}function extend(_0x453611,_0x24f73c){_0x453611=_0x453611||{};var _0x37bbf6,_0x13560f;if(!_0x24f73c)return _0x453611;for(_0x13560f in _0x24f73c){_0x37bbf6=_0x24f73c[_0x13560f],_0x37bbf6!==undefined&&(_0x453611[_0x13560f]=_0x37bbf6);}return _0x453611;}function msfnz(_0x2cdaf2,_0x421dd8,_0x2b8343){var _0x277c5f=_0x2cdaf2*_0x421dd8;return _0x2b8343/Math['sqrt'](0x1-_0x277c5f*_0x277c5f);}function sign(_0x5d4a4c){return _0x5d4a4c<0x0?-0x1:0x1;}function adjust_lon(_0x38d797){return Math['abs'](_0x38d797)<=SPI?_0x38d797:_0x38d797-sign(_0x38d797)*TWO_PI;}function tsfnz(_0x224f6a,_0x220e8c,_0x3d0a0b){var _0x275346=_0x224f6a*_0x3d0a0b,_0x40e421=0.5*_0x224f6a;return _0x275346=Math['pow']((0x1-_0x275346)/(0x1+_0x275346),_0x40e421),Math['tan'](0.5*(HALF_PI-_0x220e8c))/_0x275346;}function phi2z(_0x2f83cf,_0x4efc25){const _0x32b77d={_0x8937fc:0x269},_0x5a099e=_0x35a251;var _0x5034e4=0.5*_0x2f83cf,_0x213cd8,_0x26b4ec,_0x1b0240=HALF_PI-0x2*Math['atan'](_0x4efc25);for(var _0xe4f402=0x0;_0xe4f402<=0xf;_0xe4f402++){_0x213cd8=_0x2f83cf*Math[_0x5a099e(0xdef)](_0x1b0240),_0x26b4ec=HALF_PI-0x2*Math[_0x5a099e(_0x32b77d._0x8937fc)](_0x4efc25*Math['pow']((0x1-_0x213cd8)/(0x1+_0x213cd8),_0x5034e4))-_0x1b0240,_0x1b0240+=_0x26b4ec;if(Math['abs'](_0x26b4ec)<=1e-10)return _0x1b0240;}return-0x270f;}function init$v(){const _0x3bb4c6=_0x35a251;var _0x381190=this['b']/this['a'];this['es']=0x1-_0x381190*_0x381190,!('x0'in this)&&(this['x0']=0x0),!('y0'in this)&&(this['y0']=0x0),this['e']=Math[_0x3bb4c6(0x76b)](this['es']),this[_0x3bb4c6(0x8e9)]?this['sphere']?this['k0']=Math['cos'](this[_0x3bb4c6(0x8e9)]):this['k0']=msfnz(this['e'],Math[_0x3bb4c6(0xdef)](this[_0x3bb4c6(0x8e9)]),Math['cos'](this['lat_ts'])):!this['k0']&&(this['k']?this['k0']=this['k']:this['k0']=0x1);}function forward$u(_0x3cdb4a){const _0x1d2869={_0x5b57f1:0x3a8},_0x2d3639=_0x35a251;var _0x323547=_0x3cdb4a['x'],_0x1bfdea=_0x3cdb4a['y'];if(_0x1bfdea*R2D>0x5a&&_0x1bfdea*R2D<-0x5a&&_0x323547*R2D>0xb4&&_0x323547*R2D<-0xb4)return null;var _0x1f0598,_0x53f949;if(Math['abs'](Math[_0x2d3639(0x405)](_0x1bfdea)-HALF_PI)<=EPSLN)return null;else{if(this['sphere'])_0x1f0598=this['x0']+this['a']*this['k0']*adjust_lon(_0x323547-this[_0x2d3639(0x9cb)]),_0x53f949=this['y0']+this['a']*this['k0']*Math[_0x2d3639(_0x1d2869._0x5b57f1)](Math['tan'](FORTPI+0.5*_0x1bfdea));else{var _0x15e45d=Math['sin'](_0x1bfdea),_0x54073f=tsfnz(this['e'],_0x1bfdea,_0x15e45d);_0x1f0598=this['x0']+this['a']*this['k0']*adjust_lon(_0x323547-this['long0']),_0x53f949=this['y0']-this['a']*this['k0']*Math['log'](_0x54073f);}return _0x3cdb4a['x']=_0x1f0598,_0x3cdb4a['y']=_0x53f949,_0x3cdb4a;}}function inverse$u(_0x51bc94){const _0x321132=_0x35a251;var _0x44257c=_0x51bc94['x']-this['x0'],_0x268664=_0x51bc94['y']-this['y0'],_0x3cba0c,_0x3597b8;if(this['sphere'])_0x3597b8=HALF_PI-0x2*Math['atan'](Math['exp'](-_0x268664/(this['a']*this['k0'])));else{var _0x4c4bf4=Math['exp'](-_0x268664/(this['a']*this['k0']));_0x3597b8=phi2z(this['e'],_0x4c4bf4);if(_0x3597b8===-0x270f)return null;}return _0x3cba0c=adjust_lon(this[_0x321132(0x9cb)]+_0x44257c/(this['a']*this['k0'])),_0x51bc94['x']=_0x3cba0c,_0x51bc94['y']=_0x3597b8,_0x51bc94;}var names$w=[_0x35a251(0x4ce),_0x35a251(0x3cf),'Mercator_1SP','Mercator_Auxiliary_Sphere','merc'],merc={'init':init$v,'forward':forward$u,'inverse':inverse$u,'names':names$w};function init$u(){}function identity(_0x817d05){return _0x817d05;}var names$v=[_0x35a251(0xe60),'identity'],longlat={'init':init$u,'forward':identity,'inverse':identity,'names':names$v},projs=[merc,longlat],names$u={},projStore=[];function add$1(_0x459efb,_0x492659){const _0x5e1b3c={_0x2297c7:0xa3b,_0x4524b2:0x3a8},_0x91fa74=_0x35a251;var _0x24b5a6=projStore['length'];if(!_0x459efb[_0x91fa74(_0x5e1b3c._0x2297c7)])return console[_0x91fa74(_0x5e1b3c._0x4524b2)](_0x492659),!![];return projStore[_0x24b5a6]=_0x459efb,_0x459efb['names']['forEach'](function(_0x33fc5a){names$u[_0x33fc5a['toLowerCase']()]=_0x24b5a6;}),this;}function get$1(_0x567e62){const _0x1dedec=_0x35a251;if(!_0x567e62)return![];var _0x402c55=_0x567e62['toLowerCase']();if(typeof names$u[_0x402c55]!==_0x1dedec(0xc19)&&projStore[names$u[_0x402c55]])return projStore[names$u[_0x402c55]];}function start(){projs['forEach'](add$1);}var projections={'start':start,'add':add$1,'get':get$1},exports$2={};exports$2['MERIT']={'a':0x615299,'rf':298.257,'ellipseName':'MERIT\x201983'},exports$2['SGS85']={'a':0x615298,'rf':298.257,'ellipseName':_0x35a251(0xf8f)},exports$2['GRS80']={'a':0x615299,'rf':298.257222101,'ellipseName':_0x35a251(0xcf9)},exports$2[_0x35a251(0x41b)]={'a':0x61529c,'rf':298.257,'ellipseName':_0x35a251(0xe66)},exports$2[_0x35a251(0xb31)]={'a':6377563.396,'b':6356256.91,'ellipseName':_0x35a251(0x8c7)},exports$2[_0x35a251(0x1b6)]={'a':0x615299,'rf':298.25,'ellipseName':'Appl.\x20Physics.\x201965'},exports$2['NWL9D']={'a':0x6152a1,'rf':298.25,'ellipseName':_0x35a251(0x206)},exports$2['mod_airy']={'a':6377340.189,'b':6356034.446,'ellipseName':_0x35a251(0x394)},exports$2['andrae']={'a':6377104.43,'rf':0x12c,'ellipseName':'Andrae\x201876\x20(Den.,\x20Iclnd.)'},exports$2['aust_SA']={'a':0x6152b0,'rf':298.25,'ellipseName':'Australian\x20Natl\x20&\x20S.\x20Amer.\x201969'},exports$2['GRS67']={'a':0x6152b0,'rf':298.247167427,'ellipseName':'GRS\x2067(IUGG\x201967)'},exports$2['bessel']={'a':6377397.155,'rf':299.1528128,'ellipseName':'Bessel\x201841'},exports$2['bess_nam']={'a':6377483.865,'rf':299.1528128,'ellipseName':_0x35a251(0x5cd)},exports$2[_0x35a251(0xfc7)]={'a':6378206.4,'b':6356583.8,'ellipseName':_0x35a251(0xf89)},exports$2['clrk80']={'a':6378249.145,'rf':293.4663,'ellipseName':'Clarke\x201880\x20mod.'},exports$2['clrk80ign']={'a':6378249.2,'b':0x60fe23,'rf':293.4660213,'ellipseName':'Clarke\x201880\x20(IGN)'},exports$2['clrk58']={'a':6378293.645208759,'rf':294.2606763692654,'ellipseName':_0x35a251(0xbd7)},exports$2['CPM']={'a':6375738.7,'rf':334.29,'ellipseName':_0x35a251(0x847)},exports$2['delmbr']={'a':0x614bec,'rf':311.5,'ellipseName':_0x35a251(0x4b5)},exports$2[_0x35a251(0x9bc)]={'a':6378136.05,'rf':298.2566,'ellipseName':'Engelis\x201985'},exports$2['evrst30']={'a':6377276.345,'rf':300.8017,'ellipseName':_0x35a251(0xc95)},exports$2['evrst48']={'a':6377304.063,'rf':300.8017,'ellipseName':'Everest\x201948'},exports$2['evrst56']={'a':6377301.243,'rf':300.8017,'ellipseName':'Everest\x201956'},exports$2['evrst69']={'a':6377295.664,'rf':300.8017,'ellipseName':'Everest\x201969'},exports$2[_0x35a251(0x8ac)]={'a':6377298.556,'rf':300.8017,'ellipseName':'Everest\x20(Sabah\x20&\x20Sarawak)'},exports$2['fschr60']={'a':0x6152b6,'rf':298.3,'ellipseName':_0x35a251(0x5f6)},exports$2['fschr60m']={'a':0x6152ab,'rf':298.3,'ellipseName':_0x35a251(0xf78)},exports$2[_0x35a251(0x347)]={'a':0x6152a6,'rf':298.3,'ellipseName':'Fischer\x201968'},exports$2['helmert']={'a':0x6152d8,'rf':298.3,'ellipseName':'Helmert\x201906'},exports$2[_0x35a251(0xbc5)]={'a':0x61531e,'rf':0x129,'ellipseName':'Hough'},exports$2['intl']={'a':0x615394,'rf':0x129,'ellipseName':'International\x201909\x20(Hayford)'},exports$2['kaula']={'a':0x6152b3,'rf':298.24,'ellipseName':'Kaula\x201961'},exports$2[_0x35a251(0xb76)]={'a':0x61529b,'rf':298.257,'ellipseName':_0x35a251(0x343)},exports$2['mprts']={'a':0x619d74,'rf':0xbf,'ellipseName':'Maupertius\x201738'},exports$2['new_intl']={'a':6378157.5,'b':6356772.2,'ellipseName':'New\x20International\x201967'},exports$2['plessis']={'a':0x614c4b,'rf':0x60fb97,'ellipseName':'Plessis\x201817\x20(France)'},exports$2['krass']={'a':0x615305,'rf':298.3,'ellipseName':'Krassovsky,\x201942'},exports$2['SEasia']={'a':0x6152ab,'b':6356773.3205,'ellipseName':_0x35a251(0x2b0)},exports$2['walbeck']={'a':0x614dc0,'b':6355834.8467,'ellipseName':'Walbeck'},exports$2[_0x35a251(0xc8b)]={'a':0x6152b5,'rf':298.3,'ellipseName':'WGS\x2060'},exports$2[_0x35a251(0xad2)]={'a':0x6152a1,'rf':298.25,'ellipseName':_0x35a251(0x42e)},exports$2['WGS7']={'a':0x615297,'rf':298.26,'ellipseName':'WGS\x2072'};var WGS84=exports$2['WGS84']={'a':0x615299,'rf':298.257223563,'ellipseName':_0x35a251(0x713)};exports$2['sphere']={'a':0x6136b5,'b':0x6136b5,'ellipseName':'Normal\x20Sphere\x20(r=6370997)'};function eccentricity(_0x55d290,_0x21c584,_0x59d033,_0x4303ff){var _0x54ddfa=_0x55d290*_0x55d290,_0x244082=_0x21c584*_0x21c584,_0x328f81=(_0x54ddfa-_0x244082)/_0x54ddfa,_0x192d3f=0x0;_0x4303ff?(_0x55d290*=0x1-_0x328f81*(SIXTH+_0x328f81*(RA4+_0x328f81*RA6)),_0x54ddfa=_0x55d290*_0x55d290,_0x328f81=0x0):_0x192d3f=Math['sqrt'](_0x328f81);var _0x3948e7=(_0x54ddfa-_0x244082)/_0x244082;return{'es':_0x328f81,'e':_0x192d3f,'ep2':_0x3948e7};}function sphere(_0x259e79,_0x14f07e,_0x5c77bc,_0x345faf,_0x165a00){if(!_0x259e79){var _0x75cd73=match(exports$2,_0x345faf);!_0x75cd73&&(_0x75cd73=WGS84),_0x259e79=_0x75cd73['a'],_0x14f07e=_0x75cd73['b'],_0x5c77bc=_0x75cd73['rf'];}return _0x5c77bc&&!_0x14f07e&&(_0x14f07e=(0x1-0x1/_0x5c77bc)*_0x259e79),(_0x5c77bc===0x0||Math['abs'](_0x259e79-_0x14f07e)<EPSLN)&&(_0x165a00=!![],_0x14f07e=_0x259e79),{'a':_0x259e79,'b':_0x14f07e,'rf':_0x5c77bc,'sphere':_0x165a00};}var exports$1={};exports$1['wgs84']={'towgs84':'0,0,0','ellipse':_0x35a251(0xf39),'datumName':'WGS84'},exports$1['ch1903']={'towgs84':_0x35a251(0x3a1),'ellipse':'bessel','datumName':_0x35a251(0xaa4)},exports$1[_0x35a251(0x31a)]={'towgs84':'-199.87,74.79,246.62','ellipse':'GRS80','datumName':_0x35a251(0xf72)},exports$1['nad83']={'towgs84':'0,0,0','ellipse':'GRS80','datumName':'North_American_Datum_1983'},exports$1['nad27']={'nadgrids':'@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat','ellipse':_0x35a251(0xfc7),'datumName':_0x35a251(0x62b)},exports$1[_0x35a251(0x885)]={'towgs84':_0x35a251(0x962),'ellipse':'bessel','datumName':'Potsdam\x20Rauenberg\x201950\x20DHDN'},exports$1['carthage']={'towgs84':'-263.0,6.0,431.0','ellipse':'clark80','datumName':'Carthage\x201934\x20Tunisia'},exports$1['hermannskogel']={'towgs84':_0x35a251(0x950),'ellipse':_0x35a251(0x27c),'datumName':'Hermannskogel'},exports$1['osni52']={'towgs84':_0x35a251(0xadd),'ellipse':_0x35a251(0xb31),'datumName':'Irish\x20National'},exports$1['ire65']={'towgs84':'482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15','ellipse':_0x35a251(0xfc3),'datumName':'Ireland\x201965'},exports$1['rassadiran']={'towgs84':'-133.63,-157.5,-158.62','ellipse':_0x35a251(0xce4),'datumName':'Rassadiran'},exports$1['nzgd49']={'towgs84':_0x35a251(0x44a),'ellipse':'intl','datumName':_0x35a251(0x559)},exports$1['osgb36']={'towgs84':_0x35a251(0xd35),'ellipse':'airy','datumName':'Airy\x201830'},exports$1['s_jtsk']={'towgs84':'589,76,480','ellipse':'bessel','datumName':'S-JTSK\x20(Ferro)'},exports$1['beduaram']={'towgs84':'-106,-87,188','ellipse':'clrk80','datumName':'Beduaram'},exports$1['gunung_segara']={'towgs84':'-403,684,41','ellipse':'bessel','datumName':_0x35a251(0xd4)},exports$1['rnb72']={'towgs84':'106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1','ellipse':_0x35a251(0xce4),'datumName':'Reseau\x20National\x20Belge\x201972'};function datum(_0x5bef4a,_0x34a932,_0x24af36,_0xb8d780,_0x110f39,_0x2eed45,_0x5d6865){const _0x1c6b9f={_0x5ce5aa:0xd9e},_0x11037f=_0x35a251;var _0x210302={};return _0x5bef4a===undefined||_0x5bef4a==='none'?_0x210302['datum_type']=PJD_NODATUM:_0x210302['datum_type']=PJD_WGS84,_0x34a932&&(_0x210302['datum_params']=_0x34a932['map'](parseFloat),(_0x210302['datum_params'][0x0]!==0x0||_0x210302['datum_params'][0x1]!==0x0||_0x210302[_0x11037f(0xe32)][0x2]!==0x0)&&(_0x210302['datum_type']=PJD_3PARAM),_0x210302['datum_params']['length']>0x3&&((_0x210302['datum_params'][0x3]!==0x0||_0x210302['datum_params'][0x4]!==0x0||_0x210302['datum_params'][0x5]!==0x0||_0x210302['datum_params'][0x6]!==0x0)&&(_0x210302[_0x11037f(_0x1c6b9f._0x5ce5aa)]=PJD_7PARAM,_0x210302['datum_params'][0x3]*=SEC_TO_RAD,_0x210302[_0x11037f(0xe32)][0x4]*=SEC_TO_RAD,_0x210302['datum_params'][0x5]*=SEC_TO_RAD,_0x210302['datum_params'][0x6]=_0x210302['datum_params'][0x6]/0xf4240+0x1))),_0x5d6865&&(_0x210302['datum_type']=PJD_GRIDSHIFT,_0x210302['grids']=_0x5d6865),_0x210302['a']=_0x24af36,_0x210302['b']=_0xb8d780,_0x210302['es']=_0x110f39,_0x210302['ep2']=_0x2eed45,_0x210302;}var loadedNadgrids={};function nadgrid(_0x59a15d,_0x400baf){var _0x277cd1=new DataView(_0x400baf),_0x27a40c=detectLittleEndian(_0x277cd1),_0x10560f=readHeader(_0x277cd1,_0x27a40c);_0x10560f['nSubgrids']>0x1&&console['log']('Only\x20single\x20NTv2\x20subgrids\x20are\x20currently\x20supported,\x20subsequent\x20sub\x20grids\x20are\x20ignored');var _0x4f289a=readSubgrids(_0x277cd1,_0x10560f,_0x27a40c),_0x420353={'header':_0x10560f,'subgrids':_0x4f289a};return loadedNadgrids[_0x59a15d]=_0x420353,_0x420353;}function getNadgrids(_0x43b6e1){const _0x129b3d=_0x35a251;if(_0x43b6e1===undefined)return null;var _0xb824b3=_0x43b6e1[_0x129b3d(0xb0c)](',');return _0xb824b3['map'](parseNadgridString);}function parseNadgridString(_0x60ea4){const _0x1cc816=_0x35a251;if(_0x60ea4[_0x1cc816(0xe1e)]===0x0)return null;var _0x50f651=_0x60ea4[0x0]==='@';_0x50f651&&(_0x60ea4=_0x60ea4['slice'](0x1));if(_0x60ea4==='null')return{'name':'null','mandatory':!_0x50f651,'grid':null,'isNull':!![]};return{'name':_0x60ea4,'mandatory':!_0x50f651,'grid':loadedNadgrids[_0x60ea4]||null,'isNull':![]};}function secondsToRadians(_0x2b2b63){return _0x2b2b63/0xe10*Math['PI']/0xb4;}function detectLittleEndian(_0x2da8ea){const _0x5cffa6={_0x5a800d:0x35a,_0x563cc7:0xef6},_0x1541bf=_0x35a251;var _0xd01787=_0x2da8ea['getInt32'](0x8,![]);if(_0xd01787===0xb)return![];return _0xd01787=_0x2da8ea[_0x1541bf(_0x5cffa6._0x5a800d)](0x8,!![]),_0xd01787!==0xb&&console[_0x1541bf(_0x5cffa6._0x563cc7)](_0x1541bf(0x3d4)),!![];}function readHeader(_0x515b68,_0x466149){const _0x4843f9={_0x4d0a61:0xbca,_0x7f4f59:0x5b1,_0xe373b0:0x5b1},_0x14b0d2=_0x35a251;return{'nFields':_0x515b68['getInt32'](0x8,_0x466149),'nSubgridFields':_0x515b68['getInt32'](0x18,_0x466149),'nSubgrids':_0x515b68['getInt32'](0x28,_0x466149),'shiftType':decodeString(_0x515b68,0x38,0x38+0x8)[_0x14b0d2(_0x4843f9._0x4d0a61)](),'fromSemiMajorAxis':_0x515b68[_0x14b0d2(_0x4843f9._0x7f4f59)](0x78,_0x466149),'fromSemiMinorAxis':_0x515b68['getFloat64'](0x88,_0x466149),'toSemiMajorAxis':_0x515b68[_0x14b0d2(_0x4843f9._0xe373b0)](0x98,_0x466149),'toSemiMinorAxis':_0x515b68['getFloat64'](0xa8,_0x466149)};}function decodeString(_0x5c501c,_0x4f6ba1,_0x3196b2){const _0x26d596=_0x35a251;return String[_0x26d596(0x599)]['apply'](null,new Uint8Array(_0x5c501c['buffer'][_0x26d596(0x97a)](_0x4f6ba1,_0x3196b2)));}function readSubgrids(_0x357b35,_0x29076d,_0x488944){const _0xc83e92={_0x377cb6:0x345,_0x52616c:0xf2c,_0x2d849b:0xc78},_0x2c8524=_0x35a251;var _0x2f0a3b=0xb0,_0x481973=[];for(var _0x29defd=0x0;_0x29defd<_0x29076d['nSubgrids'];_0x29defd++){var _0x2f7441=readGridHeader(_0x357b35,_0x2f0a3b,_0x488944),_0x57d598=readGridNodes(_0x357b35,_0x2f0a3b,_0x2f7441,_0x488944),_0x3cc683=Math[_0x2c8524(0xca6)](0x1+(_0x2f7441[_0x2c8524(0x232)]-_0x2f7441['lowerLongitude'])/_0x2f7441['longitudeInterval']),_0x4623ba=Math['round'](0x1+(_0x2f7441['upperLatitude']-_0x2f7441['lowerLatitude'])/_0x2f7441[_0x2c8524(_0xc83e92._0x377cb6)]);_0x481973['push']({'ll':[secondsToRadians(_0x2f7441[_0x2c8524(_0xc83e92._0x52616c)]),secondsToRadians(_0x2f7441[_0x2c8524(_0xc83e92._0x2d849b)])],'del':[secondsToRadians(_0x2f7441['longitudeInterval']),secondsToRadians(_0x2f7441['latitudeInterval'])],'lim':[_0x3cc683,_0x4623ba],'count':_0x2f7441['gridNodeCount'],'cvs':mapNodes(_0x57d598)});}return _0x481973;}function mapNodes(_0x2ed94d){return _0x2ed94d['map'](function(_0x5c966f){return[secondsToRadians(_0x5c966f['longitudeShift']),secondsToRadians(_0x5c966f['latitudeShift'])];});}function readGridHeader(_0x33b0ef,_0x2d3adf,_0x45e3f4){const _0x42f981={_0x454b6a:0x5b1},_0x345842=_0x35a251;return{'name':decodeString(_0x33b0ef,_0x2d3adf+0x8,_0x2d3adf+0x10)[_0x345842(0xbca)](),'parent':decodeString(_0x33b0ef,_0x2d3adf+0x18,_0x2d3adf+0x18+0x8)['trim'](),'lowerLatitude':_0x33b0ef['getFloat64'](_0x2d3adf+0x48,_0x45e3f4),'upperLatitude':_0x33b0ef['getFloat64'](_0x2d3adf+0x58,_0x45e3f4),'lowerLongitude':_0x33b0ef['getFloat64'](_0x2d3adf+0x68,_0x45e3f4),'upperLongitude':_0x33b0ef[_0x345842(_0x42f981._0x454b6a)](_0x2d3adf+0x78,_0x45e3f4),'latitudeInterval':_0x33b0ef['getFloat64'](_0x2d3adf+0x88,_0x45e3f4),'longitudeInterval':_0x33b0ef['getFloat64'](_0x2d3adf+0x98,_0x45e3f4),'gridNodeCount':_0x33b0ef[_0x345842(0x35a)](_0x2d3adf+0xa8,_0x45e3f4)};}function readGridNodes(_0x52f25c,_0x2cf3d8,_0x1c4e16,_0x171c7b){const _0x8acf15={_0x4444d5:0x6de},_0x5d6725=_0x35a251;var _0x56cd32=_0x2cf3d8+0xb0,_0x3103e2=0x10,_0x56d75d=[];for(var _0x10dc42=0x0;_0x10dc42<_0x1c4e16['gridNodeCount'];_0x10dc42++){var _0x4ca0f2={'latitudeShift':_0x52f25c['getFloat32'](_0x56cd32+_0x10dc42*_0x3103e2,_0x171c7b),'longitudeShift':_0x52f25c['getFloat32'](_0x56cd32+_0x10dc42*_0x3103e2+0x4,_0x171c7b),'latitudeAccuracy':_0x52f25c['getFloat32'](_0x56cd32+_0x10dc42*_0x3103e2+0x8,_0x171c7b),'longitudeAccuracy':_0x52f25c['getFloat32'](_0x56cd32+_0x10dc42*_0x3103e2+0xc,_0x171c7b)};_0x56d75d[_0x5d6725(_0x8acf15._0x4444d5)](_0x4ca0f2);}return _0x56d75d;}function Projection(_0x3bb5b6,_0x30bf71){const _0x54755f={_0x53193a:0x3ef,_0x5f248f:0x274,_0x21478d:0x2b9,_0x1cdd77:0x8e2},_0xbe2bb3=_0x35a251;if(!(this instanceof Projection))return new Projection(_0x3bb5b6);_0x30bf71=_0x30bf71||function(_0x51dfdd){if(_0x51dfdd)throw _0x51dfdd;};var _0x520cff=parse(_0x3bb5b6);if(typeof _0x520cff!=='object'){_0x30bf71(_0x3bb5b6);return;}var _0x33aca0=Projection[_0xbe2bb3(0xbf6)]['get'](_0x520cff[_0xbe2bb3(_0x54755f._0x53193a)]);if(!_0x33aca0){_0x30bf71(_0x3bb5b6);return;}if(_0x520cff['datumCode']&&_0x520cff['datumCode']!==_0xbe2bb3(_0x54755f._0x5f248f)){var _0x3ace6b=match(exports$1,_0x520cff[_0xbe2bb3(_0x54755f._0x21478d)]);_0x3ace6b&&(_0x520cff['datum_params']=_0x520cff['datum_params']||(_0x3ace6b[_0xbe2bb3(0x5f7)]?_0x3ace6b['towgs84']['split'](','):null),_0x520cff['ellps']=_0x3ace6b['ellipse'],_0x520cff['datumName']=_0x3ace6b['datumName']?_0x3ace6b['datumName']:_0x520cff['datumCode']);}_0x520cff['k0']=_0x520cff['k0']||0x1,_0x520cff['axis']=_0x520cff['axis']||'enu',_0x520cff[_0xbe2bb3(_0x54755f._0x1cdd77)]=_0x520cff['ellps']||'wgs84',_0x520cff['lat1']=_0x520cff[_0xbe2bb3(0xb0a)]||_0x520cff['lat0'];var _0x1c9914=sphere(_0x520cff['a'],_0x520cff['b'],_0x520cff['rf'],_0x520cff['ellps'],_0x520cff[_0xbe2bb3(0x64c)]),_0x231a60=eccentricity(_0x1c9914['a'],_0x1c9914['b'],_0x1c9914['rf'],_0x520cff['R_A']),_0xd0e5b2=getNadgrids(_0x520cff['nadgrids']),_0x37bdb2=_0x520cff['datum']||datum(_0x520cff['datumCode'],_0x520cff['datum_params'],_0x1c9914['a'],_0x1c9914['b'],_0x231a60['es'],_0x231a60['ep2'],_0xd0e5b2);extend(this,_0x520cff),extend(this,_0x33aca0),this['a']=_0x1c9914['a'],this['b']=_0x1c9914['b'],this['rf']=_0x1c9914['rf'],this['sphere']=_0x1c9914['sphere'],this['es']=_0x231a60['es'],this['e']=_0x231a60['e'],this['ep2']=_0x231a60['ep2'],this[_0xbe2bb3(0xd78)]=_0x37bdb2,this['init'](),_0x30bf71(null,this);}Projection[_0x35a251(0xbf6)]=projections,Projection[_0x35a251(0xbf6)]['start']();function compareDatums(_0x34fce1,_0x2b095e){const _0x3150e2={_0x5ee872:0xd9e,_0x1113ed:0xe32},_0x4ebc70=_0x35a251;if(_0x34fce1[_0x4ebc70(0xd9e)]!==_0x2b095e['datum_type'])return![];else{if(_0x34fce1['a']!==_0x2b095e['a']||Math['abs'](_0x34fce1['es']-_0x2b095e['es'])>5e-11)return![];else{if(_0x34fce1[_0x4ebc70(0xd9e)]===PJD_3PARAM)return _0x34fce1['datum_params'][0x0]===_0x2b095e['datum_params'][0x0]&&_0x34fce1['datum_params'][0x1]===_0x2b095e['datum_params'][0x1]&&_0x34fce1['datum_params'][0x2]===_0x2b095e['datum_params'][0x2];else return _0x34fce1[_0x4ebc70(_0x3150e2._0x5ee872)]===PJD_7PARAM?_0x34fce1['datum_params'][0x0]===_0x2b095e[_0x4ebc70(_0x3150e2._0x1113ed)][0x0]&&_0x34fce1['datum_params'][0x1]===_0x2b095e['datum_params'][0x1]&&_0x34fce1['datum_params'][0x2]===_0x2b095e['datum_params'][0x2]&&_0x34fce1['datum_params'][0x3]===_0x2b095e['datum_params'][0x3]&&_0x34fce1['datum_params'][0x4]===_0x2b095e[_0x4ebc70(_0x3150e2._0x1113ed)][0x4]&&_0x34fce1['datum_params'][0x5]===_0x2b095e['datum_params'][0x5]&&_0x34fce1['datum_params'][0x6]===_0x2b095e[_0x4ebc70(_0x3150e2._0x1113ed)][0x6]:!![];}}}function geodeticToGeocentric(_0x5c4d25,_0x722219,_0x3022ad){const _0xf1bf8e=_0x35a251;var _0x25b753=_0x5c4d25['x'],_0x334355=_0x5c4d25['y'],_0x4f3b48=_0x5c4d25['z']?_0x5c4d25['z']:0x0,_0x241a6b,_0x1d6f49,_0x56c7c7,_0x307c7c;if(_0x334355<-HALF_PI&&_0x334355>-1.001*HALF_PI)_0x334355=-HALF_PI;else{if(_0x334355>HALF_PI&&_0x334355<1.001*HALF_PI)_0x334355=HALF_PI;else{if(_0x334355<-HALF_PI)return{'x':-Infinity,'y':-Infinity,'z':_0x5c4d25['z']};else{if(_0x334355>HALF_PI)return{'x':Infinity,'y':Infinity,'z':_0x5c4d25['z']};}}}return _0x25b753>Math['PI']&&(_0x25b753-=0x2*Math['PI']),_0x1d6f49=Math['sin'](_0x334355),_0x307c7c=Math['cos'](_0x334355),_0x56c7c7=_0x1d6f49*_0x1d6f49,_0x241a6b=_0x3022ad/Math[_0xf1bf8e(0x76b)](0x1-_0x722219*_0x56c7c7),{'x':(_0x241a6b+_0x4f3b48)*_0x307c7c*Math[_0xf1bf8e(0xeec)](_0x25b753),'y':(_0x241a6b+_0x4f3b48)*_0x307c7c*Math['sin'](_0x25b753),'z':(_0x241a6b*(0x1-_0x722219)+_0x4f3b48)*_0x1d6f49};}function geocentricToGeodetic(_0x2b217e,_0x34e0da,_0x39ecda,_0x373cd2){const _0x5d8f4d={_0x322daa:0x5f5},_0x1d61c0=_0x35a251;var _0xd930be=1e-12,_0x54e37=_0xd930be*_0xd930be,_0x6de840=0x1e,_0x5bcfb4,_0x16b32c,_0x41659d,_0x3a7b7b,_0x13b7be,_0x19a335,_0x360dcb,_0xba319a,_0x3ba1d6,_0x24268c,_0x27521e,_0xcc50de,_0x2a8c51,_0x3d2266=_0x2b217e['x'],_0x441eba=_0x2b217e['y'],_0x2a9b8c=_0x2b217e['z']?_0x2b217e['z']:0x0,_0xb1a57b,_0x15eb30,_0x24b905;_0x5bcfb4=Math['sqrt'](_0x3d2266*_0x3d2266+_0x441eba*_0x441eba),_0x16b32c=Math['sqrt'](_0x3d2266*_0x3d2266+_0x441eba*_0x441eba+_0x2a9b8c*_0x2a9b8c);if(_0x5bcfb4/_0x39ecda<_0xd930be){_0xb1a57b=0x0;if(_0x16b32c/_0x39ecda<_0xd930be)return _0x15eb30=HALF_PI,_0x24b905=-_0x373cd2,{'x':_0x2b217e['x'],'y':_0x2b217e['y'],'z':_0x2b217e['z']};}else _0xb1a57b=Math[_0x1d61c0(_0x5d8f4d._0x322daa)](_0x441eba,_0x3d2266);_0x41659d=_0x2a9b8c/_0x16b32c,_0x3a7b7b=_0x5bcfb4/_0x16b32c,_0x13b7be=0x1/Math['sqrt'](0x1-_0x34e0da*(0x2-_0x34e0da)*_0x3a7b7b*_0x3a7b7b),_0xba319a=_0x3a7b7b*(0x1-_0x34e0da)*_0x13b7be,_0x3ba1d6=_0x41659d*_0x13b7be,_0x2a8c51=0x0;do{_0x2a8c51++,_0x360dcb=_0x39ecda/Math['sqrt'](0x1-_0x34e0da*_0x3ba1d6*_0x3ba1d6),_0x24b905=_0x5bcfb4*_0xba319a+_0x2a9b8c*_0x3ba1d6-_0x360dcb*(0x1-_0x34e0da*_0x3ba1d6*_0x3ba1d6),_0x19a335=_0x34e0da*_0x360dcb/(_0x360dcb+_0x24b905),_0x13b7be=0x1/Math['sqrt'](0x1-_0x19a335*(0x2-_0x19a335)*_0x3a7b7b*_0x3a7b7b),_0x24268c=_0x3a7b7b*(0x1-_0x19a335)*_0x13b7be,_0x27521e=_0x41659d*_0x13b7be,_0xcc50de=_0x27521e*_0xba319a-_0x24268c*_0x3ba1d6,_0xba319a=_0x24268c,_0x3ba1d6=_0x27521e;}while(_0xcc50de*_0xcc50de>_0x54e37&&_0x2a8c51<_0x6de840);return _0x15eb30=Math['atan'](_0x27521e/Math['abs'](_0x24268c)),{'x':_0xb1a57b,'y':_0x15eb30,'z':_0x24b905};}function geocentricToWgs84(_0x2a43bc,_0x51639e,_0x3aa79d){if(_0x51639e===PJD_3PARAM)return{'x':_0x2a43bc['x']+_0x3aa79d[0x0],'y':_0x2a43bc['y']+_0x3aa79d[0x1],'z':_0x2a43bc['z']+_0x3aa79d[0x2]};else{if(_0x51639e===PJD_7PARAM){var _0x35dedf=_0x3aa79d[0x0],_0x2b2e19=_0x3aa79d[0x1],_0x4cb74e=_0x3aa79d[0x2],_0x1cf82b=_0x3aa79d[0x3],_0x22f1d3=_0x3aa79d[0x4],_0x24e557=_0x3aa79d[0x5],_0x4b514b=_0x3aa79d[0x6];return{'x':_0x4b514b*(_0x2a43bc['x']-_0x24e557*_0x2a43bc['y']+_0x22f1d3*_0x2a43bc['z'])+_0x35dedf,'y':_0x4b514b*(_0x24e557*_0x2a43bc['x']+_0x2a43bc['y']-_0x1cf82b*_0x2a43bc['z'])+_0x2b2e19,'z':_0x4b514b*(-_0x22f1d3*_0x2a43bc['x']+_0x1cf82b*_0x2a43bc['y']+_0x2a43bc['z'])+_0x4cb74e};}}}function geocentricFromWgs84(_0x88d28,_0x4e9757,_0x5678ba){if(_0x4e9757===PJD_3PARAM)return{'x':_0x88d28['x']-_0x5678ba[0x0],'y':_0x88d28['y']-_0x5678ba[0x1],'z':_0x88d28['z']-_0x5678ba[0x2]};else{if(_0x4e9757===PJD_7PARAM){var _0x12f08d=_0x5678ba[0x0],_0x302a32=_0x5678ba[0x1],_0x3ef1bc=_0x5678ba[0x2],_0x5a8aa6=_0x5678ba[0x3],_0xd4506=_0x5678ba[0x4],_0x4f3290=_0x5678ba[0x5],_0x2d0c61=_0x5678ba[0x6],_0x9c23d7=(_0x88d28['x']-_0x12f08d)/_0x2d0c61,_0x4effc0=(_0x88d28['y']-_0x302a32)/_0x2d0c61,_0xda805e=(_0x88d28['z']-_0x3ef1bc)/_0x2d0c61;return{'x':_0x9c23d7+_0x4f3290*_0x4effc0-_0xd4506*_0xda805e,'y':-_0x4f3290*_0x9c23d7+_0x4effc0+_0x5a8aa6*_0xda805e,'z':_0xd4506*_0x9c23d7-_0x5a8aa6*_0x4effc0+_0xda805e};}}}function checkParams(_0x2dcc8c){return _0x2dcc8c===PJD_3PARAM||_0x2dcc8c===PJD_7PARAM;}function datum_transform(_0x30276a,_0x57530f,_0x429d86){const _0x5cf07d={_0x4312ac:0xd9e},_0x3f52ac=_0x35a251;if(compareDatums(_0x30276a,_0x57530f))return _0x429d86;if(_0x30276a['datum_type']===PJD_NODATUM||_0x57530f['datum_type']===PJD_NODATUM)return _0x429d86;var _0x1903ac=_0x30276a['a'],_0x402233=_0x30276a['es'];if(_0x30276a['datum_type']===PJD_GRIDSHIFT){var _0xab3e84=applyGridShift(_0x30276a,![],_0x429d86);if(_0xab3e84!==0x0)return undefined;_0x1903ac=SRS_WGS84_SEMIMAJOR,_0x402233=SRS_WGS84_ESQUARED;}var _0x316e14=_0x57530f['a'],_0x3780c4=_0x57530f['b'],_0x47dc80=_0x57530f['es'];_0x57530f['datum_type']===PJD_GRIDSHIFT&&(_0x316e14=SRS_WGS84_SEMIMAJOR,_0x3780c4=SRS_WGS84_SEMIMINOR,_0x47dc80=SRS_WGS84_ESQUARED);if(_0x402233===_0x47dc80&&_0x1903ac===_0x316e14&&!checkParams(_0x30276a['datum_type'])&&!checkParams(_0x57530f[_0x3f52ac(_0x5cf07d._0x4312ac)]))return _0x429d86;_0x429d86=geodeticToGeocentric(_0x429d86,_0x402233,_0x1903ac);checkParams(_0x30276a['datum_type'])&&(_0x429d86=geocentricToWgs84(_0x429d86,_0x30276a['datum_type'],_0x30276a[_0x3f52ac(0xe32)]));checkParams(_0x57530f['datum_type'])&&(_0x429d86=geocentricFromWgs84(_0x429d86,_0x57530f['datum_type'],_0x57530f['datum_params']));_0x429d86=geocentricToGeodetic(_0x429d86,_0x47dc80,_0x316e14,_0x3780c4);if(_0x57530f['datum_type']===PJD_GRIDSHIFT){var _0x200614=applyGridShift(_0x57530f,!![],_0x429d86);if(_0x200614!==0x0)return undefined;}return _0x429d86;}function applyGridShift(_0x419e10,_0x3bc435,_0x7b56d8){const _0x5bc8cc={_0x43e001:0x3a8,_0x2137ac:0x4bf,_0x4096f7:0x14d,_0x80e13d:0x165,_0x24ed63:0x2d8,_0x217293:0x504,_0x127cfa:0xdab,_0xef6bff:0xcac},_0x16f2ad=_0x35a251;if(_0x419e10['grids']===null||_0x419e10['grids'][_0x16f2ad(0xe1e)]===0x0)return console[_0x16f2ad(_0x5bc8cc._0x43e001)]('Grid\x20shift\x20grids\x20not\x20found'),-0x1;var _0x396129={'x':-_0x7b56d8['x'],'y':_0x7b56d8['y']},_0x3fc15e={'x':Number[_0x16f2ad(_0x5bc8cc._0x2137ac)],'y':Number[_0x16f2ad(0x4bf)]},_0x5df92b=[];for(var _0x567906=0x0;_0x567906<_0x419e10['grids']['length'];_0x567906++){var _0xbee387=_0x419e10[_0x16f2ad(_0x5bc8cc._0x4096f7)][_0x567906];_0x5df92b['push'](_0xbee387[_0x16f2ad(0x504)]);if(_0xbee387['isNull']){_0x3fc15e=_0x396129;break;}if(_0xbee387['grid']===null){if(_0xbee387[_0x16f2ad(_0x5bc8cc._0x80e13d)])return console['log'](_0x16f2ad(_0x5bc8cc._0x24ed63)+_0xbee387[_0x16f2ad(_0x5bc8cc._0x217293)]+'\x27'),-0x1;continue;}var _0x2c2edd=_0xbee387['grid']['subgrids'][0x0],_0x30d810=(Math['abs'](_0x2c2edd['del'][0x1])+Math['abs'](_0x2c2edd['del'][0x0]))/0x2710,_0x32aa2c=_0x2c2edd['ll'][0x0]-_0x30d810,_0x4bfb8c=_0x2c2edd['ll'][0x1]-_0x30d810,_0xbbdf0d=_0x2c2edd['ll'][0x0]+(_0x2c2edd[_0x16f2ad(_0x5bc8cc._0x127cfa)][0x0]-0x1)*_0x2c2edd['del'][0x0]+_0x30d810,_0x25f23e=_0x2c2edd['ll'][0x1]+(_0x2c2edd[_0x16f2ad(0xdab)][0x1]-0x1)*_0x2c2edd[_0x16f2ad(_0x5bc8cc._0xef6bff)][0x1]+_0x30d810;if(_0x4bfb8c>_0x396129['y']||_0x32aa2c>_0x396129['x']||_0x25f23e<_0x396129['y']||_0xbbdf0d<_0x396129['x'])continue;_0x3fc15e=applySubgridShift(_0x396129,_0x3bc435,_0x2c2edd);if(!isNaN(_0x3fc15e['x']))break;}if(isNaN(_0x3fc15e['x']))return console['log']('Failed\x20to\x20find\x20a\x20grid\x20shift\x20table\x20for\x20location\x20\x27'+-_0x396129['x']*R2D+'\x20'+_0x396129['y']*R2D+'\x20tried:\x20\x27'+_0x5df92b+'\x27'),-0x1;return _0x7b56d8['x']=-_0x3fc15e['x'],_0x7b56d8['y']=_0x3fc15e['y'],0x0;}function applySubgridShift(_0x190de4,_0x43edf6,_0x47c452){const _0x424623={_0x382ec0:0x33c},_0x4eeb33=_0x35a251;var _0x2041e0={'x':Number['NaN'],'y':Number['NaN']};if(isNaN(_0x190de4['x']))return _0x2041e0;var _0x287d6e={'x':_0x190de4['x'],'y':_0x190de4['y']};_0x287d6e['x']-=_0x47c452['ll'][0x0],_0x287d6e['y']-=_0x47c452['ll'][0x1],_0x287d6e['x']=adjust_lon(_0x287d6e['x']-Math['PI'])+Math['PI'];var _0x2438d5=nadInterpolate(_0x287d6e,_0x47c452);if(_0x43edf6){if(isNaN(_0x2438d5['x']))return _0x2041e0;_0x2438d5['x']=_0x287d6e['x']-_0x2438d5['x'],_0x2438d5['y']=_0x287d6e['y']-_0x2438d5['y'];var _0x52a854=0x9,_0x118544=1e-12,_0x453c84,_0x498ee3;do{_0x498ee3=nadInterpolate(_0x2438d5,_0x47c452);if(isNaN(_0x498ee3['x'])){console['log'](_0x4eeb33(_0x424623._0x382ec0));break;}_0x453c84={'x':_0x287d6e['x']-(_0x498ee3['x']+_0x2438d5['x']),'y':_0x287d6e['y']-(_0x498ee3['y']+_0x2438d5['y'])},_0x2438d5['x']+=_0x453c84['x'],_0x2438d5['y']+=_0x453c84['y'];}while(_0x52a854--&&Math['abs'](_0x453c84['x'])>_0x118544&&Math['abs'](_0x453c84['y'])>_0x118544);if(_0x52a854<0x0)return console['log']('Inverse\x20grid\x20shift\x20iterator\x20failed\x20to\x20converge.'),_0x2041e0;_0x2041e0['x']=adjust_lon(_0x2438d5['x']+_0x47c452['ll'][0x0]),_0x2041e0['y']=_0x2438d5['y']+_0x47c452['ll'][0x1];}else!isNaN(_0x2438d5['x'])&&(_0x2041e0['x']=_0x190de4['x']+_0x2438d5['x'],_0x2041e0['y']=_0x190de4['y']+_0x2438d5['y']);return _0x2041e0;}function nadInterpolate(_0xd459af,_0x89d258){const _0x2224b4={_0x3e8440:0x6ba,_0x24c072:0x4bf,_0x29403a:0x74a},_0x39afcf=_0x35a251;var _0x2186ce={'x':_0xd459af['x']/_0x89d258['del'][0x0],'y':_0xd459af['y']/_0x89d258['del'][0x1]},_0x2b722c={'x':Math[_0x39afcf(_0x2224b4._0x3e8440)](_0x2186ce['x']),'y':Math['floor'](_0x2186ce['y'])},_0x3d4478={'x':_0x2186ce['x']-0x1*_0x2b722c['x'],'y':_0x2186ce['y']-0x1*_0x2b722c['y']},_0x1bcc69={'x':Number[_0x39afcf(0x4bf)],'y':Number[_0x39afcf(_0x2224b4._0x24c072)]},_0x26c44e;if(_0x2b722c['x']<0x0||_0x2b722c['x']>=_0x89d258['lim'][0x0])return _0x1bcc69;if(_0x2b722c['y']<0x0||_0x2b722c['y']>=_0x89d258['lim'][0x1])return _0x1bcc69;_0x26c44e=_0x2b722c['y']*_0x89d258['lim'][0x0]+_0x2b722c['x'];var _0x5a14b1={'x':_0x89d258[_0x39afcf(_0x2224b4._0x29403a)][_0x26c44e][0x0],'y':_0x89d258['cvs'][_0x26c44e][0x1]};_0x26c44e++;var _0x195380={'x':_0x89d258['cvs'][_0x26c44e][0x0],'y':_0x89d258['cvs'][_0x26c44e][0x1]};_0x26c44e+=_0x89d258['lim'][0x0];var _0x18b4e9={'x':_0x89d258[_0x39afcf(0x74a)][_0x26c44e][0x0],'y':_0x89d258['cvs'][_0x26c44e][0x1]};_0x26c44e--;var _0x4cae60={'x':_0x89d258['cvs'][_0x26c44e][0x0],'y':_0x89d258['cvs'][_0x26c44e][0x1]},_0x5aec24=_0x3d4478['x']*_0x3d4478['y'],_0x250f7f=_0x3d4478['x']*(0x1-_0x3d4478['y']),_0x3ac6bc=(0x1-_0x3d4478['x'])*(0x1-_0x3d4478['y']),_0x24627a=(0x1-_0x3d4478['x'])*_0x3d4478['y'];return _0x1bcc69['x']=_0x3ac6bc*_0x5a14b1['x']+_0x250f7f*_0x195380['x']+_0x24627a*_0x4cae60['x']+_0x5aec24*_0x18b4e9['x'],_0x1bcc69['y']=_0x3ac6bc*_0x5a14b1['y']+_0x250f7f*_0x195380['y']+_0x24627a*_0x4cae60['y']+_0x5aec24*_0x18b4e9['y'],_0x1bcc69;}function adjust_axis(_0xa3e48d,_0xc44b06,_0x15aacb){const _0x13dad5={_0x397c75:0xc07},_0x1c338c=_0x35a251;var _0x3e189f=_0x15aacb['x'],_0x308237=_0x15aacb['y'],_0x453fa6=_0x15aacb['z']||0x0,_0x297ed5,_0x6b3a84,_0x11e787,_0x115b74={};for(_0x11e787=0x0;_0x11e787<0x3;_0x11e787++){if(_0xc44b06&&_0x11e787===0x2&&_0x15aacb['z']===undefined)continue;if(_0x11e787===0x0)_0x297ed5=_0x3e189f,'ew'['indexOf'](_0xa3e48d[_0x1c338c(_0x13dad5._0x397c75)][_0x11e787])!==-0x1?_0x6b3a84='x':_0x6b3a84='y';else _0x11e787===0x1?(_0x297ed5=_0x308237,'ns'['indexOf'](_0xa3e48d['axis'][_0x11e787])!==-0x1?_0x6b3a84='y':_0x6b3a84='x'):(_0x297ed5=_0x453fa6,_0x6b3a84='z');switch(_0xa3e48d['axis'][_0x11e787]){case'e':_0x115b74[_0x6b3a84]=_0x297ed5;break;case'w':_0x115b74[_0x6b3a84]=-_0x297ed5;break;case'n':_0x115b74[_0x6b3a84]=_0x297ed5;break;case's':_0x115b74[_0x6b3a84]=-_0x297ed5;break;case'u':_0x15aacb[_0x6b3a84]!==undefined&&(_0x115b74['z']=_0x297ed5);break;case'd':_0x15aacb[_0x6b3a84]!==undefined&&(_0x115b74['z']=-_0x297ed5);break;default:return null;}}return _0x115b74;}function common(_0x243b21){const _0x5c94b8={_0x23ca2e:0xe1e},_0x854634=_0x35a251;var _0x46c509={'x':_0x243b21[0x0],'y':_0x243b21[0x1]};return _0x243b21['length']>0x2&&(_0x46c509['z']=_0x243b21[0x2]),_0x243b21[_0x854634(_0x5c94b8._0x23ca2e)]>0x3&&(_0x46c509['m']=_0x243b21[0x3]),_0x46c509;}function checkSanity(_0x470eb9){checkCoord(_0x470eb9['x']),checkCoord(_0x470eb9['y']);}function checkCoord(_0x1dd6ce){const _0x1a0036=_0x35a251;if(typeof Number['isFinite']===_0x1a0036(0x638)){if(Number['isFinite'](_0x1dd6ce))return;throw new TypeError('coordinates\x20must\x20be\x20finite\x20numbers');}if(typeof _0x1dd6ce!=='number'||_0x1dd6ce!==_0x1dd6ce||!isFinite(_0x1dd6ce))throw new TypeError('coordinates\x20must\x20be\x20finite\x20numbers');}function checkNotWGS(_0x13bc60,_0x1209b0){const _0x40aa57={_0x332f64:0xd78,_0x5e3933:0xd9e},_0x1ed0b3=_0x35a251;return(_0x13bc60[_0x1ed0b3(_0x40aa57._0x332f64)]['datum_type']===PJD_3PARAM||_0x13bc60['datum'][_0x1ed0b3(0xd9e)]===PJD_7PARAM||_0x13bc60[_0x1ed0b3(0xd78)][_0x1ed0b3(0xd9e)]===PJD_GRIDSHIFT)&&_0x1209b0['datumCode']!=='WGS84'||(_0x1209b0['datum'][_0x1ed0b3(_0x40aa57._0x5e3933)]===PJD_3PARAM||_0x1209b0['datum']['datum_type']===PJD_7PARAM||_0x1209b0['datum']['datum_type']===PJD_GRIDSHIFT)&&_0x13bc60['datumCode']!=='WGS84';}function transform(_0x1d9210,_0x1e6631,_0x48abd2,_0x2214c1){const _0x4b3d09={_0x427166:0xd78,_0x1f6094:0xf39,_0x322d2a:0xc07,_0x2562a1:0xd13},_0x1a9f57=_0x35a251;var _0xb80fd3;Array['isArray'](_0x48abd2)?_0x48abd2=common(_0x48abd2):_0x48abd2={'x':_0x48abd2['x'],'y':_0x48abd2['y'],'z':_0x48abd2['z'],'m':_0x48abd2['m']};var _0x516a95=_0x48abd2['z']!==undefined;checkSanity(_0x48abd2);_0x1d9210['datum']&&_0x1e6631[_0x1a9f57(_0x4b3d09._0x427166)]&&checkNotWGS(_0x1d9210,_0x1e6631)&&(_0xb80fd3=new Projection(_0x1a9f57(_0x4b3d09._0x1f6094)),_0x48abd2=transform(_0x1d9210,_0xb80fd3,_0x48abd2,_0x2214c1),_0x1d9210=_0xb80fd3);_0x2214c1&&_0x1d9210[_0x1a9f57(_0x4b3d09._0x322d2a)]!=='enu'&&(_0x48abd2=adjust_axis(_0x1d9210,![],_0x48abd2));if(_0x1d9210[_0x1a9f57(0x3ef)]==='longlat')_0x48abd2={'x':_0x48abd2['x']*D2R$1,'y':_0x48abd2['y']*D2R$1,'z':_0x48abd2['z']||0x0};else{_0x1d9210['to_meter']&&(_0x48abd2={'x':_0x48abd2['x']*_0x1d9210[_0x1a9f57(0xd13)],'y':_0x48abd2['y']*_0x1d9210[_0x1a9f57(_0x4b3d09._0x2562a1)],'z':_0x48abd2['z']||0x0});_0x48abd2=_0x1d9210['inverse'](_0x48abd2);if(!_0x48abd2)return;}_0x1d9210['from_greenwich']&&(_0x48abd2['x']+=_0x1d9210['from_greenwich']);_0x48abd2=datum_transform(_0x1d9210['datum'],_0x1e6631['datum'],_0x48abd2);if(!_0x48abd2)return;_0x1e6631['from_greenwich']&&(_0x48abd2={'x':_0x48abd2['x']-_0x1e6631['from_greenwich'],'y':_0x48abd2['y'],'z':_0x48abd2['z']||0x0});_0x1e6631['projName']==='longlat'?_0x48abd2={'x':_0x48abd2['x']*R2D,'y':_0x48abd2['y']*R2D,'z':_0x48abd2['z']||0x0}:(_0x48abd2=_0x1e6631['forward'](_0x48abd2),_0x1e6631['to_meter']&&(_0x48abd2={'x':_0x48abd2['x']/_0x1e6631['to_meter'],'y':_0x48abd2['y']/_0x1e6631['to_meter'],'z':_0x48abd2['z']||0x0}));if(_0x2214c1&&_0x1e6631[_0x1a9f57(_0x4b3d09._0x322d2a)]!==_0x1a9f57(0xbaf))return adjust_axis(_0x1e6631,!![],_0x48abd2);return!_0x516a95&&delete _0x48abd2['z'],_0x48abd2;}var wgs84=Projection('WGS84');function transformer(_0xbd7a74,_0x1e65ff,_0xb2db7e,_0x435464){const _0x1c43b6={_0x20c2bd:0xe1e,_0x3f581e:0xc19},_0x6e66d2=_0x35a251;var _0x324792,_0x1f3f3d,_0x149959;if(Array['isArray'](_0xb2db7e))return _0x324792=transform(_0xbd7a74,_0x1e65ff,_0xb2db7e,_0x435464)||{'x':NaN,'y':NaN},_0xb2db7e[_0x6e66d2(_0x1c43b6._0x20c2bd)]>0x2?typeof _0xbd7a74['name']!==_0x6e66d2(_0x1c43b6._0x3f581e)&&_0xbd7a74[_0x6e66d2(0x504)]==='geocent'||typeof _0x1e65ff[_0x6e66d2(0x504)]!=='undefined'&&_0x1e65ff['name']==='geocent'?typeof _0x324792['z']==='number'?[_0x324792['x'],_0x324792['y'],_0x324792['z']]['concat'](_0xb2db7e['splice'](0x3)):[_0x324792['x'],_0x324792['y'],_0xb2db7e[0x2]]['concat'](_0xb2db7e[_0x6e66d2(0xce0)](0x3)):[_0x324792['x'],_0x324792['y']][_0x6e66d2(0x93a)](_0xb2db7e['splice'](0x2)):[_0x324792['x'],_0x324792['y']];else{_0x1f3f3d=transform(_0xbd7a74,_0x1e65ff,_0xb2db7e,_0x435464),_0x149959=Object['keys'](_0xb2db7e);if(_0x149959['length']===0x2)return _0x1f3f3d;return _0x149959['forEach'](function(_0x8da244){const _0x330aea=_0x6e66d2;if(typeof _0xbd7a74['name']!=='undefined'&&_0xbd7a74[_0x330aea(0x504)]===_0x330aea(0xbaa)||typeof _0x1e65ff['name']!==_0x330aea(0xc19)&&_0x1e65ff['name']==='geocent'){if(_0x8da244==='x'||_0x8da244==='y'||_0x8da244==='z')return;}else{if(_0x8da244==='x'||_0x8da244==='y')return;}_0x1f3f3d[_0x8da244]=_0xb2db7e[_0x8da244];}),_0x1f3f3d;}}function checkProj(_0x2f2486){const _0x27ae42=_0x35a251;if(_0x2f2486 instanceof Projection)return _0x2f2486;if(_0x2f2486['oProj'])return _0x2f2486[_0x27ae42(0x41a)];return Projection(_0x2f2486);}function proj4(_0x8d047e,_0xc037d6,_0x1f8835){const _0x46989b={_0x2ff2e7:0xc19,_0x37c7bc:0xc19,_0x1a7eed:0x41a},_0x45d193=_0x35a251;_0x8d047e=checkProj(_0x8d047e);var _0x20ee8d=![],_0x1bc44d;if(typeof _0xc037d6===_0x45d193(_0x46989b._0x2ff2e7))_0xc037d6=_0x8d047e,_0x8d047e=wgs84,_0x20ee8d=!![];else(typeof _0xc037d6['x']!==_0x45d193(_0x46989b._0x37c7bc)||Array['isArray'](_0xc037d6))&&(_0x1f8835=_0xc037d6,_0xc037d6=_0x8d047e,_0x8d047e=wgs84,_0x20ee8d=!![]);return _0xc037d6=checkProj(_0xc037d6),_0x1f8835?transformer(_0x8d047e,_0xc037d6,_0x1f8835):(_0x1bc44d={'forward':function(_0xe2a2b,_0x19e81a){return transformer(_0x8d047e,_0xc037d6,_0xe2a2b,_0x19e81a);},'inverse':function(_0x134939,_0x50c9ad){return transformer(_0xc037d6,_0x8d047e,_0x134939,_0x50c9ad);}},_0x20ee8d&&(_0x1bc44d[_0x45d193(_0x46989b._0x1a7eed)]=_0xc037d6),_0x1bc44d);}var NUM_100K_SETS=0x6,SET_ORIGIN_COLUMN_LETTERS='AJSAJS',SET_ORIGIN_ROW_LETTERS='AFAFAF',A=0x41,I=0x49,O=0x4f,V=0x56,Z=0x5a,mgrs={'forward':forward$t,'inverse':inverse$t,'toPoint':toPoint};function forward$t(_0x1f5389,_0x2a923c){return _0x2a923c=_0x2a923c||0x5,encode$1(LLtoUTM({'lat':_0x1f5389[0x1],'lon':_0x1f5389[0x0]}),_0x2a923c);}function inverse$t(_0x1f528c){const _0x2f9d7e=_0x35a251;var _0x67ace3=UTMtoLL(decode(_0x1f528c['toUpperCase']()));if(_0x67ace3[_0x2f9d7e(0xb9d)]&&_0x67ace3['lon'])return[_0x67ace3['lon'],_0x67ace3['lat'],_0x67ace3['lon'],_0x67ace3['lat']];return[_0x67ace3['left'],_0x67ace3['bottom'],_0x67ace3['right'],_0x67ace3['top']];}function toPoint(_0xf5a614){const _0x131a52={_0x36fd34:0xca9,_0x8fe78d:0x82e},_0x1b1222=_0x35a251;var _0x495c0d=UTMtoLL(decode(_0xf5a614['toUpperCase']()));if(_0x495c0d['lat']&&_0x495c0d['lon'])return[_0x495c0d[_0x1b1222(_0x131a52._0x36fd34)],_0x495c0d['lat']];return[(_0x495c0d['left']+_0x495c0d['right'])/0x2,(_0x495c0d[_0x1b1222(_0x131a52._0x8fe78d)]+_0x495c0d['bottom'])/0x2];}function degToRad(_0x1316ed){return _0x1316ed*(Math['PI']/0xb4);}function radToDeg(_0x268c57){return 0xb4*(_0x268c57/Math['PI']);}function LLtoUTM(_0x25f2a1){const _0x5be9c4={_0x1b7f95:0x76b,_0x421543:0xdef,_0x2d38d3:0x9b5,_0x17cfe6:0xeec},_0x32ac07=_0x35a251;var _0x3178c6=_0x25f2a1['lat'],_0x57030d=_0x25f2a1['lon'],_0x16774a=0x615299,_0x592c52=0.00669438,_0x466409=0.9996,_0x3b1b88,_0x30d584,_0x4a1183,_0x2d29e3,_0x1bff7f,_0x452569,_0x521b59,_0x1e6ef4=degToRad(_0x3178c6),_0x2310cb=degToRad(_0x57030d),_0x11b2ee,_0x598ea3;_0x598ea3=Math['floor']((_0x57030d+0xb4)/0x6)+0x1;_0x57030d===0xb4&&(_0x598ea3=0x3c);_0x3178c6>=0x38&&_0x3178c6<0x40&&_0x57030d>=0x3&&_0x57030d<0xc&&(_0x598ea3=0x20);if(_0x3178c6>=0x48&&_0x3178c6<0x54){if(_0x57030d>=0x0&&_0x57030d<0x9)_0x598ea3=0x1f;else{if(_0x57030d>=0x9&&_0x57030d<0x15)_0x598ea3=0x21;else{if(_0x57030d>=0x15&&_0x57030d<0x21)_0x598ea3=0x23;else _0x57030d>=0x21&&_0x57030d<0x2a&&(_0x598ea3=0x25);}}}_0x3b1b88=(_0x598ea3-0x1)*0x6-0xb4+0x3,_0x11b2ee=degToRad(_0x3b1b88),_0x30d584=_0x592c52/(0x1-_0x592c52),_0x4a1183=_0x16774a/Math[_0x32ac07(_0x5be9c4._0x1b7f95)](0x1-_0x592c52*Math['sin'](_0x1e6ef4)*Math[_0x32ac07(_0x5be9c4._0x421543)](_0x1e6ef4)),_0x2d29e3=Math[_0x32ac07(_0x5be9c4._0x2d38d3)](_0x1e6ef4)*Math['tan'](_0x1e6ef4),_0x1bff7f=_0x30d584*Math['cos'](_0x1e6ef4)*Math[_0x32ac07(_0x5be9c4._0x17cfe6)](_0x1e6ef4),_0x452569=Math['cos'](_0x1e6ef4)*(_0x2310cb-_0x11b2ee),_0x521b59=_0x16774a*((0x1-_0x592c52/0x4-0x3*_0x592c52*_0x592c52/0x40-0x5*_0x592c52*_0x592c52*_0x592c52/0x100)*_0x1e6ef4-(0x3*_0x592c52/0x8+0x3*_0x592c52*_0x592c52/0x20+0x2d*_0x592c52*_0x592c52*_0x592c52/0x400)*Math[_0x32ac07(0xdef)](0x2*_0x1e6ef4)+(0xf*_0x592c52*_0x592c52/0x100+0x2d*_0x592c52*_0x592c52*_0x592c52/0x400)*Math['sin'](0x4*_0x1e6ef4)-0x23*_0x592c52*_0x592c52*_0x592c52/0xc00*Math['sin'](0x6*_0x1e6ef4));var _0x432f38=_0x466409*_0x4a1183*(_0x452569+(0x1-_0x2d29e3+_0x1bff7f)*_0x452569*_0x452569*_0x452569/0x6+(0x5-0x12*_0x2d29e3+_0x2d29e3*_0x2d29e3+0x48*_0x1bff7f-0x3a*_0x30d584)*_0x452569*_0x452569*_0x452569*_0x452569*_0x452569/0x78)+0x7a120,_0x88ab53=_0x466409*(_0x521b59+_0x4a1183*Math['tan'](_0x1e6ef4)*(_0x452569*_0x452569/0x2+(0x5-_0x2d29e3+0x9*_0x1bff7f+0x4*_0x1bff7f*_0x1bff7f)*_0x452569*_0x452569*_0x452569*_0x452569/0x18+(0x3d-0x3a*_0x2d29e3+_0x2d29e3*_0x2d29e3+0x258*_0x1bff7f-0x14a*_0x30d584)*_0x452569*_0x452569*_0x452569*_0x452569*_0x452569*_0x452569/0x2d0));return _0x3178c6<0x0&&(_0x88ab53+=0x989680),{'northing':Math['round'](_0x88ab53),'easting':Math[_0x32ac07(0xca6)](_0x432f38),'zoneNumber':_0x598ea3,'zoneLetter':getLetterDesignator(_0x3178c6)};}function UTMtoLL(_0x5f1c83){const _0x478810={_0x40ccfe:0xeec,_0x1436cf:0x4d3,_0x220e51:0x9f1,_0x40b41d:0xca9},_0x3f7e0b=_0x35a251;var _0x5a5942=_0x5f1c83['northing'],_0x329e69=_0x5f1c83['easting'],_0x41b14c=_0x5f1c83[_0x3f7e0b(0x9f1)],_0x4cab17=_0x5f1c83['zoneNumber'];if(_0x4cab17<0x0||_0x4cab17>0x3c)return null;var _0x48064e=0.9996,_0xfa617f=0x615299,_0x8d9793=0.00669438,_0x125663,_0x24b40c=(0x1-Math['sqrt'](0x1-_0x8d9793))/(0x1+Math['sqrt'](0x1-_0x8d9793)),_0x48a110,_0xc7928d,_0x13ad3a,_0x3f3d07,_0x169156,_0xd8d66c,_0x7e6bb2,_0x1aa767,_0x47f58a,_0x3a7c39=_0x329e69-0x7a120,_0x33ec48=_0x5a5942;_0x41b14c<'N'&&(_0x33ec48-=0x989680);_0x7e6bb2=(_0x4cab17-0x1)*0x6-0xb4+0x3,_0x125663=_0x8d9793/(0x1-_0x8d9793),_0xd8d66c=_0x33ec48/_0x48064e,_0x1aa767=_0xd8d66c/(_0xfa617f*(0x1-_0x8d9793/0x4-0x3*_0x8d9793*_0x8d9793/0x40-0x5*_0x8d9793*_0x8d9793*_0x8d9793/0x100)),_0x47f58a=_0x1aa767+(0x3*_0x24b40c/0x2-0x1b*_0x24b40c*_0x24b40c*_0x24b40c/0x20)*Math['sin'](0x2*_0x1aa767)+(0x15*_0x24b40c*_0x24b40c/0x10-0x37*_0x24b40c*_0x24b40c*_0x24b40c*_0x24b40c/0x20)*Math['sin'](0x4*_0x1aa767)+0x97*_0x24b40c*_0x24b40c*_0x24b40c/0x60*Math['sin'](0x6*_0x1aa767),_0x48a110=_0xfa617f/Math['sqrt'](0x1-_0x8d9793*Math['sin'](_0x47f58a)*Math['sin'](_0x47f58a)),_0xc7928d=Math['tan'](_0x47f58a)*Math[_0x3f7e0b(0x9b5)](_0x47f58a),_0x13ad3a=_0x125663*Math[_0x3f7e0b(_0x478810._0x40ccfe)](_0x47f58a)*Math['cos'](_0x47f58a),_0x3f3d07=_0xfa617f*(0x1-_0x8d9793)/Math['pow'](0x1-_0x8d9793*Math['sin'](_0x47f58a)*Math['sin'](_0x47f58a),1.5),_0x169156=_0x3a7c39/(_0x48a110*_0x48064e);var _0x5e4b37=_0x47f58a-_0x48a110*Math['tan'](_0x47f58a)/_0x3f3d07*(_0x169156*_0x169156/0x2-(0x5+0x3*_0xc7928d+0xa*_0x13ad3a-0x4*_0x13ad3a*_0x13ad3a-0x9*_0x125663)*_0x169156*_0x169156*_0x169156*_0x169156/0x18+(0x3d+0x5a*_0xc7928d+0x12a*_0x13ad3a+0x2d*_0xc7928d*_0xc7928d-0xfc*_0x125663-0x3*_0x13ad3a*_0x13ad3a)*_0x169156*_0x169156*_0x169156*_0x169156*_0x169156*_0x169156/0x2d0);_0x5e4b37=radToDeg(_0x5e4b37);var _0x402fd2=(_0x169156-(0x1+0x2*_0xc7928d+_0x13ad3a)*_0x169156*_0x169156*_0x169156/0x6+(0x5-0x2*_0x13ad3a+0x1c*_0xc7928d-0x3*_0x13ad3a*_0x13ad3a+0x8*_0x125663+0x18*_0xc7928d*_0xc7928d)*_0x169156*_0x169156*_0x169156*_0x169156*_0x169156/0x78)/Math['cos'](_0x47f58a);_0x402fd2=_0x7e6bb2+radToDeg(_0x402fd2);var _0x5ee170;if(_0x5f1c83[_0x3f7e0b(0x4d3)]){var _0x560829=UTMtoLL({'northing':_0x5f1c83['northing']+_0x5f1c83[_0x3f7e0b(_0x478810._0x1436cf)],'easting':_0x5f1c83['easting']+_0x5f1c83['accuracy'],'zoneLetter':_0x5f1c83[_0x3f7e0b(_0x478810._0x220e51)],'zoneNumber':_0x5f1c83['zoneNumber']});_0x5ee170={'top':_0x560829['lat'],'right':_0x560829[_0x3f7e0b(_0x478810._0x40b41d)],'bottom':_0x5e4b37,'left':_0x402fd2};}else _0x5ee170={'lat':_0x5e4b37,'lon':_0x402fd2};return _0x5ee170;}function getLetterDesignator(_0x3f4bb2){var _0x1b2f4b='Z';if(0x54>=_0x3f4bb2&&_0x3f4bb2>=0x48)_0x1b2f4b='X';else{if(0x48>_0x3f4bb2&&_0x3f4bb2>=0x40)_0x1b2f4b='W';else{if(0x40>_0x3f4bb2&&_0x3f4bb2>=0x38)_0x1b2f4b='V';else{if(0x38>_0x3f4bb2&&_0x3f4bb2>=0x30)_0x1b2f4b='U';else{if(0x30>_0x3f4bb2&&_0x3f4bb2>=0x28)_0x1b2f4b='T';else{if(0x28>_0x3f4bb2&&_0x3f4bb2>=0x20)_0x1b2f4b='S';else{if(0x20>_0x3f4bb2&&_0x3f4bb2>=0x18)_0x1b2f4b='R';else{if(0x18>_0x3f4bb2&&_0x3f4bb2>=0x10)_0x1b2f4b='Q';else{if(0x10>_0x3f4bb2&&_0x3f4bb2>=0x8)_0x1b2f4b='P';else{if(0x8>_0x3f4bb2&&_0x3f4bb2>=0x0)_0x1b2f4b='N';else{if(0x0>_0x3f4bb2&&_0x3f4bb2>=-0x8)_0x1b2f4b='M';else{if(-0x8>_0x3f4bb2&&_0x3f4bb2>=-0x10)_0x1b2f4b='L';else{if(-0x10>_0x3f4bb2&&_0x3f4bb2>=-0x18)_0x1b2f4b='K';else{if(-0x18>_0x3f4bb2&&_0x3f4bb2>=-0x20)_0x1b2f4b='J';else{if(-0x20>_0x3f4bb2&&_0x3f4bb2>=-0x28)_0x1b2f4b='H';else{if(-0x28>_0x3f4bb2&&_0x3f4bb2>=-0x30)_0x1b2f4b='G';else{if(-0x30>_0x3f4bb2&&_0x3f4bb2>=-0x38)_0x1b2f4b='F';else{if(-0x38>_0x3f4bb2&&_0x3f4bb2>=-0x40)_0x1b2f4b='E';else{if(-0x40>_0x3f4bb2&&_0x3f4bb2>=-0x48)_0x1b2f4b='D';else-0x48>_0x3f4bb2&&_0x3f4bb2>=-0x50&&(_0x1b2f4b='C');}}}}}}}}}}}}}}}}}}return _0x1b2f4b;}function encode$1(_0x66d4e5,_0xa18065){const _0x1638ab={_0xf276eb:0x9f1,_0x19367f:0xe1e},_0x56a183=_0x35a251;var _0x50bb04='00000'+_0x66d4e5[_0x56a183(0xda1)],_0x123d44=_0x56a183(0x759)+_0x66d4e5['northing'];return _0x66d4e5['zoneNumber']+_0x66d4e5[_0x56a183(_0x1638ab._0xf276eb)]+get100kID(_0x66d4e5['easting'],_0x66d4e5['northing'],_0x66d4e5['zoneNumber'])+_0x50bb04['substr'](_0x50bb04['length']-0x5,_0xa18065)+_0x123d44['substr'](_0x123d44[_0x56a183(_0x1638ab._0x19367f)]-0x5,_0xa18065);}function get100kID(_0x7f01c1,_0x502dc9,_0x563915){const _0x29baef=_0x35a251;var _0x10178f=get100kSetForZone(_0x563915),_0x4239b8=Math[_0x29baef(0x6ba)](_0x7f01c1/0x186a0),_0x47e745=Math['floor'](_0x502dc9/0x186a0)%0x14;return getLetter100kID(_0x4239b8,_0x47e745,_0x10178f);}function get100kSetForZone(_0x4c932b){var _0x35cb5c=_0x4c932b%NUM_100K_SETS;return _0x35cb5c===0x0&&(_0x35cb5c=NUM_100K_SETS),_0x35cb5c;}function getLetter100kID(_0x8d6036,_0x50eda9,_0x168321){const _0x27d665={_0x3c0bc3:0x4a8},_0x1b8daa=_0x35a251;var _0x1bae69=_0x168321-0x1,_0x342e2b=SET_ORIGIN_COLUMN_LETTERS[_0x1b8daa(_0x27d665._0x3c0bc3)](_0x1bae69),_0x420966=SET_ORIGIN_ROW_LETTERS[_0x1b8daa(0x4a8)](_0x1bae69),_0x257faf=_0x342e2b+_0x8d6036-0x1,_0x3d59e7=_0x420966+_0x50eda9,_0xe00b21=![];_0x257faf>Z&&(_0x257faf=_0x257faf-Z+A-0x1,_0xe00b21=!![]);(_0x257faf===I||_0x342e2b<I&&_0x257faf>I||(_0x257faf>I||_0x342e2b<I)&&_0xe00b21)&&_0x257faf++;(_0x257faf===O||_0x342e2b<O&&_0x257faf>O||(_0x257faf>O||_0x342e2b<O)&&_0xe00b21)&&(_0x257faf++,_0x257faf===I&&_0x257faf++);_0x257faf>Z&&(_0x257faf=_0x257faf-Z+A-0x1);_0x3d59e7>V?(_0x3d59e7=_0x3d59e7-V+A-0x1,_0xe00b21=!![]):_0xe00b21=![];(_0x3d59e7===I||_0x420966<I&&_0x3d59e7>I||(_0x3d59e7>I||_0x420966<I)&&_0xe00b21)&&_0x3d59e7++;(_0x3d59e7===O||_0x420966<O&&_0x3d59e7>O||(_0x3d59e7>O||_0x420966<O)&&_0xe00b21)&&(_0x3d59e7++,_0x3d59e7===I&&_0x3d59e7++);_0x3d59e7>V&&(_0x3d59e7=_0x3d59e7-V+A-0x1);var _0x2c15be=String['fromCharCode'](_0x257faf)+String['fromCharCode'](_0x3d59e7);return _0x2c15be;}function decode(_0x2ec249){const _0x263b48=_0x35a251;if(_0x2ec249&&_0x2ec249['length']===0x0)throw'MGRSPoint\x20coverting\x20from\x20nothing';var _0x3c0dc8=_0x2ec249['length'],_0x375c8a=null,_0xe07aba='',_0x24ca1b,_0x126b26=0x0;while(!/[A-Z]/['test'](_0x24ca1b=_0x2ec249['charAt'](_0x126b26))){if(_0x126b26>=0x2)throw'MGRSPoint\x20bad\x20conversion\x20from:\x20'+_0x2ec249;_0xe07aba+=_0x24ca1b,_0x126b26++;}var _0x3ef88e=parseInt(_0xe07aba,0xa);if(_0x126b26===0x0||_0x126b26+0x3>_0x3c0dc8)throw'MGRSPoint\x20bad\x20conversion\x20from:\x20'+_0x2ec249;var _0x447422=_0x2ec249['charAt'](_0x126b26++);if(_0x447422<='A'||_0x447422==='B'||_0x447422==='Y'||_0x447422>='Z'||_0x447422==='I'||_0x447422==='O')throw'MGRSPoint\x20zone\x20letter\x20'+_0x447422+'\x20not\x20handled:\x20'+_0x2ec249;_0x375c8a=_0x2ec249['substring'](_0x126b26,_0x126b26+=0x2);var _0x59a441=get100kSetForZone(_0x3ef88e),_0x50b850=getEastingFromChar(_0x375c8a['charAt'](0x0),_0x59a441),_0x252e40=getNorthingFromChar(_0x375c8a['charAt'](0x1),_0x59a441);while(_0x252e40<getMinNorthing(_0x447422)){_0x252e40+=0x1e8480;}var _0x3ac655=_0x3c0dc8-_0x126b26;if(_0x3ac655%0x2!==0x0)throw'MGRSPoint\x20has\x20to\x20have\x20an\x20even\x20number\x20\x0aof\x20digits\x20after\x20the\x20zone\x20letter\x20and\x20two\x20100km\x20letters\x20-\x20front\x20\x0ahalf\x20for\x20easting\x20meters,\x20second\x20half\x20for\x20\x0anorthing\x20meters'+_0x2ec249;var _0x5a8779=_0x3ac655/0x2,_0x39ebf0=0x0,_0x44fa31=0x0,_0x4b83f6,_0xaa9bca,_0x342e87,_0x3e3acb,_0xecd1f5;return _0x5a8779>0x0&&(_0x4b83f6=0x186a0/Math['pow'](0xa,_0x5a8779),_0xaa9bca=_0x2ec249['substring'](_0x126b26,_0x126b26+_0x5a8779),_0x39ebf0=parseFloat(_0xaa9bca)*_0x4b83f6,_0x342e87=_0x2ec249[_0x263b48(0x4cc)](_0x126b26+_0x5a8779),_0x44fa31=parseFloat(_0x342e87)*_0x4b83f6),_0x3e3acb=_0x39ebf0+_0x50b850,_0xecd1f5=_0x44fa31+_0x252e40,{'easting':_0x3e3acb,'northing':_0xecd1f5,'zoneLetter':_0x447422,'zoneNumber':_0x3ef88e,'accuracy':_0x4b83f6};}function getEastingFromChar(_0x3bb5f4,_0x28d2be){const _0x26fcf7=_0x35a251;var _0x4a5246=SET_ORIGIN_COLUMN_LETTERS[_0x26fcf7(0x4a8)](_0x28d2be-0x1),_0x198643=0x186a0,_0x55b374=![];while(_0x4a5246!==_0x3bb5f4['charCodeAt'](0x0)){_0x4a5246++;_0x4a5246===I&&_0x4a5246++;_0x4a5246===O&&_0x4a5246++;if(_0x4a5246>Z){if(_0x55b374)throw'Bad\x20character:\x20'+_0x3bb5f4;_0x4a5246=A,_0x55b374=!![];}_0x198643+=0x186a0;}return _0x198643;}function getNorthingFromChar(_0x2d3120,_0x39a814){const _0x4d8f3a={_0x5c7608:0x4a8},_0x1d456d=_0x35a251;if(_0x2d3120>'V')throw'MGRSPoint\x20given\x20invalid\x20Northing\x20'+_0x2d3120;var _0x447caf=SET_ORIGIN_ROW_LETTERS[_0x1d456d(_0x4d8f3a._0x5c7608)](_0x39a814-0x1),_0x29779f=0x0,_0x3cf23f=![];while(_0x447caf!==_0x2d3120['charCodeAt'](0x0)){_0x447caf++;_0x447caf===I&&_0x447caf++;_0x447caf===O&&_0x447caf++;if(_0x447caf>V){if(_0x3cf23f)throw'Bad\x20character:\x20'+_0x2d3120;_0x447caf=A,_0x3cf23f=!![];}_0x29779f+=0x186a0;}return _0x29779f;}function getMinNorthing(_0x49ff09){var _0x436d53;switch(_0x49ff09){case'C':_0x436d53=0x10c8e0;break;case'D':_0x436d53=0x1e8480;break;case'E':_0x436d53=0x2ab980;break;case'F':_0x436d53=0x387520;break;case'G':_0x436d53=0x4630c0;break;case'H':_0x436d53=0x53ec60;break;case'J':_0x436d53=0x61a800;break;case'K':_0x436d53=0x6f63a0;break;case'L':_0x436d53=0x7d1f40;break;case'M':_0x436d53=0x8adae0;break;case'N':_0x436d53=0x0;break;case'P':_0x436d53=0xc3500;break;case'Q':_0x436d53=0x19f0a0;break;case'R':_0x436d53=0x27ac40;break;case'S':_0x436d53=0x3567e0;break;case'T':_0x436d53=0x432380;break;case'U':_0x436d53=0x50df20;break;case'V':_0x436d53=0x5e9ac0;break;case'W':_0x436d53=0x6acfc0;break;case'X':_0x436d53=0x788b60;break;default:_0x436d53=-0x1;}if(_0x436d53>=0x0)return _0x436d53;else throw'Invalid\x20zone\x20letter:\x20'+_0x49ff09;}function Point(_0x4ef856,_0xec7894,_0x3309e9){if(!(this instanceof Point))return new Point(_0x4ef856,_0xec7894,_0x3309e9);if(Array['isArray'](_0x4ef856))this['x']=_0x4ef856[0x0],this['y']=_0x4ef856[0x1],this['z']=_0x4ef856[0x2]||0x0;else{if(typeof _0x4ef856==='object')this['x']=_0x4ef856['x'],this['y']=_0x4ef856['y'],this['z']=_0x4ef856['z']||0x0;else{if(typeof _0x4ef856==='string'&&typeof _0xec7894==='undefined'){var _0x517601=_0x4ef856['split'](',');this['x']=parseFloat(_0x517601[0x0],0xa),this['y']=parseFloat(_0x517601[0x1],0xa),this['z']=parseFloat(_0x517601[0x2],0xa)||0x0;}else this['x']=_0x4ef856,this['y']=_0xec7894,this['z']=_0x3309e9||0x0;}}console['warn']('proj4.Point\x20will\x20be\x20removed\x20in\x20version\x203,\x20use\x20proj4.toPoint');}Point['fromMGRS']=function(_0x95c25c){return new Point(toPoint(_0x95c25c));},Point[_0x35a251(0xb1b)]['toMGRS']=function(_0x53bb72){return forward$t([this['x'],this['y']],_0x53bb72);};var C00=0x1,C02=0.25,C04=0.046875,C06=0.01953125,C08=0.01068115234375,C22=0.75,C44=0.46875,C46=0.013020833333333334,C48=0.007120768229166667,C66=0.3645833333333333,C68=0.005696614583333333,C88=0.3076171875;function pj_enfn(_0x564768){var _0xfe0f9f=[];_0xfe0f9f[0x0]=C00-_0x564768*(C02+_0x564768*(C04+_0x564768*(C06+_0x564768*C08))),_0xfe0f9f[0x1]=_0x564768*(C22-_0x564768*(C04+_0x564768*(C06+_0x564768*C08)));var _0x17698f=_0x564768*_0x564768;return _0xfe0f9f[0x2]=_0x17698f*(C44-_0x564768*(C46+_0x564768*C48)),_0x17698f*=_0x564768,_0xfe0f9f[0x3]=_0x17698f*(C66-_0x564768*C68),_0xfe0f9f[0x4]=_0x17698f*_0x564768*C88,_0xfe0f9f;}function pj_mlfn(_0x2a339c,_0x59dce0,_0x484140,_0x2e31e1){return _0x484140*=_0x59dce0,_0x59dce0*=_0x59dce0,_0x2e31e1[0x0]*_0x2a339c-_0x484140*(_0x2e31e1[0x1]+_0x59dce0*(_0x2e31e1[0x2]+_0x59dce0*(_0x2e31e1[0x3]+_0x59dce0*_0x2e31e1[0x4])));}var MAX_ITER$3=0x14;function pj_inv_mlfn(_0x390f3d,_0x295d0f,_0x29def5){const _0x8152e6={_0x17c378:0xeec},_0x3e48f6=_0x35a251;var _0x21120d=0x1/(0x1-_0x295d0f),_0x2f2ea9=_0x390f3d;for(var _0x116eba=MAX_ITER$3;_0x116eba;--_0x116eba){var _0x536017=Math['sin'](_0x2f2ea9),_0x41855b=0x1-_0x295d0f*_0x536017*_0x536017;_0x41855b=(pj_mlfn(_0x2f2ea9,_0x536017,Math[_0x3e48f6(_0x8152e6._0x17c378)](_0x2f2ea9),_0x29def5)-_0x390f3d)*(_0x41855b*Math['sqrt'](_0x41855b))*_0x21120d,_0x2f2ea9-=_0x41855b;if(Math[_0x3e48f6(0x405)](_0x41855b)<EPSLN)return _0x2f2ea9;}return _0x2f2ea9;}function init$t(){const _0x118b21={_0x433303:0xeec},_0x5434ec=_0x35a251;this['x0']=this['x0']!==undefined?this['x0']:0x0,this['y0']=this['y0']!==undefined?this['y0']:0x0,this['long0']=this['long0']!==undefined?this['long0']:0x0,this[_0x5434ec(0xe40)]=this['lat0']!==undefined?this['lat0']:0x0,this['es']&&(this['en']=pj_enfn(this['es']),this[_0x5434ec(0x368)]=pj_mlfn(this['lat0'],Math['sin'](this['lat0']),Math[_0x5434ec(_0x118b21._0x433303)](this['lat0']),this['en']));}function forward$s(_0x2f2d86){const _0x3effd5={_0x40de8d:0x405,_0x5f1f33:0xe40,_0x20e217:0xda4},_0x5a319b=_0x35a251;var _0x5e6848=_0x2f2d86['x'],_0x3e7c66=_0x2f2d86['y'],_0x153f88=adjust_lon(_0x5e6848-this['long0']),_0x5e7c80,_0x59be78,_0xfa1fb7,_0x1fbf68=Math['sin'](_0x3e7c66),_0x979240=Math['cos'](_0x3e7c66);if(!this['es']){var _0xb4b6c9=_0x979240*Math['sin'](_0x153f88);if(Math['abs'](Math[_0x5a319b(_0x3effd5._0x40de8d)](_0xb4b6c9)-0x1)<EPSLN)return 0x5d;else{_0x59be78=0.5*this['a']*this['k0']*Math['log']((0x1+_0xb4b6c9)/(0x1-_0xb4b6c9))+this['x0'],_0xfa1fb7=_0x979240*Math['cos'](_0x153f88)/Math['sqrt'](0x1-Math['pow'](_0xb4b6c9,0x2)),_0xb4b6c9=Math['abs'](_0xfa1fb7);if(_0xb4b6c9>=0x1){if(_0xb4b6c9-0x1>EPSLN)return 0x5d;else _0xfa1fb7=0x0;}else _0xfa1fb7=Math[_0x5a319b(0xf73)](_0xfa1fb7);_0x3e7c66<0x0&&(_0xfa1fb7=-_0xfa1fb7),_0xfa1fb7=this['a']*this['k0']*(_0xfa1fb7-this[_0x5a319b(_0x3effd5._0x5f1f33)])+this['y0'];}}else{var _0x694cdd=_0x979240*_0x153f88,_0x42f555=Math[_0x5a319b(_0x3effd5._0x20e217)](_0x694cdd,0x2),_0xb2fac6=this['ep2']*Math['pow'](_0x979240,0x2),_0x1ec744=Math['pow'](_0xb2fac6,0x2),_0x1c0e6c=Math['abs'](_0x979240)>EPSLN?Math[_0x5a319b(0x9b5)](_0x3e7c66):0x0,_0x594431=Math['pow'](_0x1c0e6c,0x2),_0x5bb567=Math['pow'](_0x594431,0x2);_0x5e7c80=0x1-this['es']*Math['pow'](_0x1fbf68,0x2),_0x694cdd=_0x694cdd/Math['sqrt'](_0x5e7c80);var _0x376e75=pj_mlfn(_0x3e7c66,_0x1fbf68,_0x979240,this['en']);_0x59be78=this['a']*(this['k0']*_0x694cdd*(0x1+_0x42f555/0x6*(0x1-_0x594431+_0xb2fac6+_0x42f555/0x14*(0x5-0x12*_0x594431+_0x5bb567+0xe*_0xb2fac6-0x3a*_0x594431*_0xb2fac6+_0x42f555/0x2a*(0x3d+0xb3*_0x5bb567-_0x5bb567*_0x594431-0x1df*_0x594431)))))+this['x0'],_0xfa1fb7=this['a']*(this['k0']*(_0x376e75-this['ml0']+_0x1fbf68*_0x153f88*_0x694cdd/0x2*(0x1+_0x42f555/0xc*(0x5-_0x594431+0x9*_0xb2fac6+0x4*_0x1ec744+_0x42f555/0x1e*(0x3d+_0x5bb567-0x3a*_0x594431+0x10e*_0xb2fac6-0x14a*_0x594431*_0xb2fac6+_0x42f555/0x38*(0x569+0x21f*_0x5bb567-_0x5bb567*_0x594431-0xc27*_0x594431))))))+this['y0'];}return _0x2f2d86['x']=_0x59be78,_0x2f2d86['y']=_0xfa1fb7,_0x2f2d86;}function inverse$s(_0x20930a){const _0x4ab72a={_0x548276:0xda4,_0x29d922:0xdef,_0x2d8cde:0x76b},_0xa549dd=_0x35a251;var _0x147aff,_0x366301,_0x322680,_0x4e4b30,_0x28dcc1=(_0x20930a['x']-this['x0'])*(0x1/this['a']),_0x442426=(_0x20930a['y']-this['y0'])*(0x1/this['a']);if(!this['es']){var _0x33c392=Math['exp'](_0x28dcc1/this['k0']),_0x2bbd32=0.5*(_0x33c392-0x1/_0x33c392),_0x2314fa=this[_0xa549dd(0xe40)]+_0x442426/this['k0'],_0x102820=Math[_0xa549dd(0xeec)](_0x2314fa);_0x147aff=Math['sqrt']((0x1-Math[_0xa549dd(_0x4ab72a._0x548276)](_0x102820,0x2))/(0x1+Math[_0xa549dd(0xda4)](_0x2bbd32,0x2))),_0x322680=Math[_0xa549dd(0x2bf)](_0x147aff),_0x442426<0x0&&(_0x322680=-_0x322680),_0x2bbd32===0x0&&_0x102820===0x0?_0x4e4b30=0x0:_0x4e4b30=adjust_lon(Math['atan2'](_0x2bbd32,_0x102820)+this['long0']);}else{_0x147aff=this[_0xa549dd(0x368)]+_0x442426/this['k0'],_0x366301=pj_inv_mlfn(_0x147aff,this['es'],this['en']);if(Math[_0xa549dd(0x405)](_0x366301)<HALF_PI){var _0x1db156=Math[_0xa549dd(_0x4ab72a._0x29d922)](_0x366301),_0x15ed1f=Math[_0xa549dd(0xeec)](_0x366301),_0x3855d4=Math['abs'](_0x15ed1f)>EPSLN?Math['tan'](_0x366301):0x0,_0x4b091a=this['ep2']*Math[_0xa549dd(0xda4)](_0x15ed1f,0x2),_0x2071d6=Math['pow'](_0x4b091a,0x2),_0x488c54=Math['pow'](_0x3855d4,0x2),_0x3443ae=Math['pow'](_0x488c54,0x2);_0x147aff=0x1-this['es']*Math['pow'](_0x1db156,0x2);var _0x4c6c72=_0x28dcc1*Math[_0xa549dd(_0x4ab72a._0x2d8cde)](_0x147aff)/this['k0'],_0x12396f=Math['pow'](_0x4c6c72,0x2);_0x147aff=_0x147aff*_0x3855d4,_0x322680=_0x366301-_0x147aff*_0x12396f/(0x1-this['es'])*0.5*(0x1-_0x12396f/0xc*(0x5+0x3*_0x488c54-0x9*_0x4b091a*_0x488c54+_0x4b091a-0x4*_0x2071d6-_0x12396f/0x1e*(0x3d+0x5a*_0x488c54-0xfc*_0x4b091a*_0x488c54+0x2d*_0x3443ae+0x2e*_0x4b091a-_0x12396f/0x38*(0x569+0xe31*_0x488c54+0xfff*_0x3443ae+0x626*_0x3443ae*_0x488c54)))),_0x4e4b30=adjust_lon(this['long0']+_0x4c6c72*(0x1-_0x12396f/0x6*(0x1+0x2*_0x488c54+_0x4b091a-_0x12396f/0x14*(0x5+0x1c*_0x488c54+0x18*_0x3443ae+0x8*_0x4b091a*_0x488c54+0x6*_0x4b091a-_0x12396f/0x2a*(0x3d+0x296*_0x488c54+0x528*_0x3443ae+0x2d0*_0x3443ae*_0x488c54))))/_0x15ed1f);}else _0x322680=HALF_PI*sign(_0x442426),_0x4e4b30=0x0;}return _0x20930a['x']=_0x4e4b30,_0x20930a['y']=_0x322680,_0x20930a;}var names$t=['Fast_Transverse_Mercator','Fast\x20Transverse\x20Mercator'],tmerc={'init':init$t,'forward':forward$s,'inverse':inverse$s,'names':names$t};function sinh(_0x2d35c3){var _0x12094d=Math['exp'](_0x2d35c3);return _0x12094d=(_0x12094d-0x1/_0x12094d)/0x2,_0x12094d;}function hypot(_0x32241d,_0x4f199c){const _0x2f6f7c={_0x267e35:0xc9d},_0x43bc82=_0x35a251;_0x32241d=Math['abs'](_0x32241d),_0x4f199c=Math[_0x43bc82(0x405)](_0x4f199c);var _0x121dc8=Math[_0x43bc82(_0x2f6f7c._0x267e35)](_0x32241d,_0x4f199c),_0x5f2a01=Math[_0x43bc82(0x60c)](_0x32241d,_0x4f199c)/(_0x121dc8?_0x121dc8:0x1);return _0x121dc8*Math['sqrt'](0x1+Math['pow'](_0x5f2a01,0x2));}function log1py(_0x407b59){var _0x349312=0x1+_0x407b59,_0x15a247=_0x349312-0x1;return _0x15a247===0x0?_0x407b59:_0x407b59*Math['log'](_0x349312)/_0x15a247;}function asinhy(_0x3ee698){const _0x2d569b=_0x35a251;var _0x2f0faa=Math[_0x2d569b(0x405)](_0x3ee698);return _0x2f0faa=log1py(_0x2f0faa*(0x1+_0x2f0faa/(hypot(0x1,_0x2f0faa)+0x1))),_0x3ee698<0x0?-_0x2f0faa:_0x2f0faa;}function gatg(_0xade424,_0x54e473){const _0x3b29bb={_0x5789c6:0xeec,_0x7490dc:0xdef},_0x375026=_0x35a251;var _0x29e6b0=0x2*Math[_0x375026(_0x3b29bb._0x5789c6)](0x2*_0x54e473),_0x172c45=_0xade424['length']-0x1,_0xd0f8d5=_0xade424[_0x172c45],_0x3fc25e=0x0,_0x1717d2;while(--_0x172c45>=0x0){_0x1717d2=-_0x3fc25e+_0x29e6b0*_0xd0f8d5+_0xade424[_0x172c45],_0x3fc25e=_0xd0f8d5,_0xd0f8d5=_0x1717d2;}return _0x54e473+_0x1717d2*Math[_0x375026(_0x3b29bb._0x7490dc)](0x2*_0x54e473);}function clens(_0x14392a,_0x3fdc99){var _0x1540b2=0x2*Math['cos'](_0x3fdc99),_0x16fc9b=_0x14392a['length']-0x1,_0x2bd645=_0x14392a[_0x16fc9b],_0x5513d6=0x0,_0x2ffa86;while(--_0x16fc9b>=0x0){_0x2ffa86=-_0x5513d6+_0x1540b2*_0x2bd645+_0x14392a[_0x16fc9b],_0x5513d6=_0x2bd645,_0x2bd645=_0x2ffa86;}return Math['sin'](_0x3fdc99)*_0x2ffa86;}function cosh(_0x3bc230){var _0x42df59=Math['exp'](_0x3bc230);return _0x42df59=(_0x42df59+0x1/_0x42df59)/0x2,_0x42df59;}function clens_cmplx(_0x446877,_0x419046,_0x3c875a){const _0x263357=_0x35a251;var _0x3ab218=Math['sin'](_0x419046),_0x18e815=Math[_0x263357(0xeec)](_0x419046),_0x2fdc27=sinh(_0x3c875a),_0x15603f=cosh(_0x3c875a),_0x36c440=0x2*_0x18e815*_0x15603f,_0x16f6e6=-0x2*_0x3ab218*_0x2fdc27,_0x55a633=_0x446877['length']-0x1,_0x4138e4=_0x446877[_0x55a633],_0x256a05=0x0,_0x13175d=0x0,_0x530f77=0x0,_0x5f3319,_0x202a3e;while(--_0x55a633>=0x0){_0x5f3319=_0x13175d,_0x202a3e=_0x256a05,_0x13175d=_0x4138e4,_0x256a05=_0x530f77,_0x4138e4=-_0x5f3319+_0x36c440*_0x13175d-_0x16f6e6*_0x256a05+_0x446877[_0x55a633],_0x530f77=-_0x202a3e+_0x16f6e6*_0x13175d+_0x36c440*_0x256a05;}return _0x36c440=_0x3ab218*_0x15603f,_0x16f6e6=_0x18e815*_0x2fdc27,[_0x36c440*_0x4138e4-_0x16f6e6*_0x530f77,_0x36c440*_0x530f77+_0x16f6e6*_0x4138e4];}function init$s(){const _0x276cec={_0x10abe2:0x7b,_0x1e4076:0x721,_0x158875:0x727,_0x570422:0x9ee,_0x46219f:0x9ee},_0x5bd698=_0x35a251;if(!this['approx']&&(isNaN(this['es'])||this['es']<=0x0))throw new Error('Incorrect\x20elliptical\x20usage.\x20Try\x20using\x20the\x20+approx\x20option\x20in\x20the\x20proj\x20string,\x20or\x20PROJECTION[\x22Fast_Transverse_Mercator\x22]\x20in\x20the\x20WKT.');this[_0x5bd698(0x189)]&&(tmerc['init'][_0x5bd698(0x240)](this),this['forward']=tmerc['forward'],this['inverse']=tmerc[_0x5bd698(_0x276cec._0x10abe2)]);this['x0']=this['x0']!==undefined?this['x0']:0x0,this['y0']=this['y0']!==undefined?this['y0']:0x0,this['long0']=this['long0']!==undefined?this['long0']:0x0,this['lat0']=this['lat0']!==undefined?this['lat0']:0x0,this['cgb']=[],this[_0x5bd698(0x9ee)]=[],this[_0x5bd698(_0x276cec._0x1e4076)]=[],this['gtu']=[];var _0x16eaba=this['es']/(0x1+Math['sqrt'](0x1-this['es'])),_0x5e047a=_0x16eaba/(0x2-_0x16eaba),_0x1f0ab3=_0x5e047a;this['cgb'][0x0]=_0x5e047a*(0x2+_0x5e047a*(-0x2/0x3+_0x5e047a*(-0x2+_0x5e047a*(0x74/0x2d+_0x5e047a*(0x1a/0x2d+_0x5e047a*(-0xb26/0x2a3)))))),this['cbg'][0x0]=_0x5e047a*(-0x2+_0x5e047a*(0x2/0x3+_0x5e047a*(0x4/0x3+_0x5e047a*(-0x52/0x2d+_0x5e047a*(0x20/0x2d+_0x5e047a*(0x1222/0x1275)))))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this[_0x5bd698(_0x276cec._0x158875)][0x1]=_0x1f0ab3*(0x7/0x3+_0x5e047a*(-0x8/0x5+_0x5e047a*(-0xe3/0x2d+_0x5e047a*(0xa90/0x13b+_0x5e047a*(0x913/0x3b1))))),this['cbg'][0x1]=_0x1f0ab3*(0x5/0x3+_0x5e047a*(-0x10/0xf+_0x5e047a*(-0xd/0x9+_0x5e047a*(0x388/0x13b+_0x5e047a*(-0x5f2/0x3b1))))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this['cgb'][0x2]=_0x1f0ab3*(0x38/0xf+_0x5e047a*(-0x88/0x23+_0x5e047a*(-0x4ee/0x69+_0x5e047a*(0x12056/0xb13)))),this['cbg'][0x2]=_0x1f0ab3*(-0x1a/0xf+_0x5e047a*(0x22/0x15+_0x5e047a*(0x8/0x5+_0x5e047a*(-0x318e/0xb13)))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this['cgb'][0x3]=_0x1f0ab3*(0x10b7/0x276+_0x5e047a*(-0x14c/0x23+_0x5e047a*(-0x618d4/0x375f))),this[_0x5bd698(_0x276cec._0x570422)][0x3]=_0x1f0ab3*(0x4d5/0x276+_0x5e047a*(-0xc/0x5+_0x5e047a*(-0x6100/0x375f))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this[_0x5bd698(0x727)][0x4]=_0x1f0ab3*(0x104e/0x13b+_0x5e047a*(-0x235c6/0x185d)),this[_0x5bd698(_0x276cec._0x46219f)][0x4]=_0x1f0ab3*(-0x2de/0x13b+_0x5e047a*(0x1ac1e/0x79d1)),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this[_0x5bd698(0x727)][0x5]=_0x1f0ab3*(0x92e4c/0x5703),this['cbg'][0x5]=_0x1f0ab3*(0x6c7b1/0x26115),_0x1f0ab3=Math['pow'](_0x5e047a,0x2),this['Qn']=this['k0']/(0x1+_0x5e047a)*(0x1+_0x1f0ab3*(0x1/0x4+_0x1f0ab3*(0x1/0x40+_0x1f0ab3/0x100))),this[_0x5bd698(0x721)][0x0]=_0x5e047a*(-0.5+_0x5e047a*(0x2/0x3+_0x5e047a*(-0x25/0x60+_0x5e047a*(0x1/0x168+_0x5e047a*(0x51/0x200+_0x5e047a*(-0x177c7/0x93a80)))))),this[_0x5bd698(0x376)][0x0]=_0x5e047a*(0.5+_0x5e047a*(-0x2/0x3+_0x5e047a*(0x5/0x10+_0x5e047a*(0x29/0xb4+_0x5e047a*(-0x7f/0x120+_0x5e047a*(0x1ed3/0x93a8)))))),this['utg'][0x1]=_0x1f0ab3*(-0x1/0x30+_0x5e047a*(-0x1/0xf+_0x5e047a*(0x1b5/0x5a0+_0x5e047a*(-0x2e/0x69+_0x5e047a*(0x1111f7/0x3b1000))))),this['gtu'][0x1]=_0x1f0ab3*(0xd/0x30+_0x5e047a*(-0x3/0x5+_0x5e047a*(0x22d/0x5a0+_0x5e047a*(0x119/0x276+_0x5e047a*(-0x1e43c9/0x1d8800))))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this['utg'][0x2]=_0x1f0ab3*(-0x11/0x1e0+_0x5e047a*(0x25/0x348+_0x5e047a*(0xd1/0x1180+_0x5e047a*(-0x15c1/0x16260)))),this[_0x5bd698(0x376)][0x2]=_0x1f0ab3*(0x3d/0xf0+_0x5e047a*(-0x67/0x8c+_0x5e047a*(0x3ad5/0x6900+_0x5e047a*(0x28eb3/0x2c4c0)))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this['utg'][0x3]=_0x1f0ab3*(-0x112d/0x27600+_0x5e047a*(0xb/0x1f8+_0x5e047a*(0xcab2b/0x6ebe00))),this[_0x5bd698(0x376)][0x3]=_0x1f0ab3*(0xc199/0x27600+_0x5e047a*(-0xb3/0xa8+_0x5e047a*(0x64bbbd/0x6ebe00))),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this['utg'][0x4]=_0x1f0ab3*(-0x11e7/0x27600+_0x5e047a*(0x1a92f/0x3ce880)),this['gtu'][0x4]=_0x1f0ab3*(0x87a9/0x13b00+_0x5e047a*(-0x342b09/0x1e7440)),_0x1f0ab3=_0x1f0ab3*_0x5e047a,this[_0x5bd698(0x721)][0x5]=_0x1f0ab3*(-0x13b12f5/0x26115000),this['gtu'][0x5]=_0x1f0ab3*(0xca8a53d/0x1308a800);var _0x2d832b=gatg(this['cbg'],this['lat0']);this['Zb']=-this['Qn']*(_0x2d832b+clens(this['gtu'],0x2*_0x2d832b));}function forward$r(_0x504e33){const _0x1ae881={_0x49a23f:0x9cb,_0xb2c2e8:0xeec},_0x54164d=_0x35a251;var _0x46ef2d=adjust_lon(_0x504e33['x']-this[_0x54164d(_0x1ae881._0x49a23f)]),_0x32d649=_0x504e33['y'];_0x32d649=gatg(this['cbg'],_0x32d649);var _0x58bca4=Math['sin'](_0x32d649),_0x2acd21=Math['cos'](_0x32d649),_0x2d5ed3=Math['sin'](_0x46ef2d),_0x2bfb86=Math[_0x54164d(_0x1ae881._0xb2c2e8)](_0x46ef2d);_0x32d649=Math['atan2'](_0x58bca4,_0x2bfb86*_0x2acd21),_0x46ef2d=Math[_0x54164d(0x5f5)](_0x2d5ed3*_0x2acd21,hypot(_0x58bca4,_0x2acd21*_0x2bfb86)),_0x46ef2d=asinhy(Math['tan'](_0x46ef2d));var _0x1e6c51=clens_cmplx(this['gtu'],0x2*_0x32d649,0x2*_0x46ef2d);_0x32d649=_0x32d649+_0x1e6c51[0x0],_0x46ef2d=_0x46ef2d+_0x1e6c51[0x1];var _0x1260a3,_0x52e061;return Math[_0x54164d(0x405)](_0x46ef2d)<=2.623395162778?(_0x1260a3=this['a']*(this['Qn']*_0x46ef2d)+this['x0'],_0x52e061=this['a']*(this['Qn']*_0x32d649+this['Zb'])+this['y0']):(_0x1260a3=Infinity,_0x52e061=Infinity),_0x504e33['x']=_0x1260a3,_0x504e33['y']=_0x52e061,_0x504e33;}function inverse$r(_0x2f7461){const _0x3be7d9=_0x35a251;var _0x46d5e0=(_0x2f7461['x']-this['x0'])*(0x1/this['a']),_0x1a7841=(_0x2f7461['y']-this['y0'])*(0x1/this['a']);_0x1a7841=(_0x1a7841-this['Zb'])/this['Qn'],_0x46d5e0=_0x46d5e0/this['Qn'];var _0x3d0fcf,_0x24207e;if(Math['abs'](_0x46d5e0)<=2.623395162778){var _0x31ae3c=clens_cmplx(this[_0x3be7d9(0x721)],0x2*_0x1a7841,0x2*_0x46d5e0);_0x1a7841=_0x1a7841+_0x31ae3c[0x0],_0x46d5e0=_0x46d5e0+_0x31ae3c[0x1],_0x46d5e0=Math[_0x3be7d9(0x269)](sinh(_0x46d5e0));var _0x413738=Math['sin'](_0x1a7841),_0x4884a2=Math['cos'](_0x1a7841),_0x18ac4e=Math['sin'](_0x46d5e0),_0x313441=Math['cos'](_0x46d5e0);_0x1a7841=Math[_0x3be7d9(0x5f5)](_0x413738*_0x313441,hypot(_0x18ac4e,_0x313441*_0x4884a2)),_0x46d5e0=Math['atan2'](_0x18ac4e,_0x313441*_0x4884a2),_0x3d0fcf=adjust_lon(_0x46d5e0+this['long0']),_0x24207e=gatg(this['cgb'],_0x1a7841);}else _0x3d0fcf=Infinity,_0x24207e=Infinity;return _0x2f7461['x']=_0x3d0fcf,_0x2f7461['y']=_0x24207e,_0x2f7461;}var names$s=['Extended_Transverse_Mercator','Extended\x20Transverse\x20Mercator',_0x35a251(0xd34),_0x35a251(0x36c),'Transverse\x20Mercator',_0x35a251(0xfc5)],etmerc={'init':init$s,'forward':forward$r,'inverse':inverse$r,'names':names$s};function adjust_zone(_0x37c1d6,_0x3ffc16){if(_0x37c1d6===undefined){_0x37c1d6=Math['floor']((adjust_lon(_0x3ffc16)+Math['PI'])*0x1e/Math['PI'])+0x1;if(_0x37c1d6<0x0)return 0x0;else{if(_0x37c1d6>0x3c)return 0x3c;}}return _0x37c1d6;}var dependsOn=_0x35a251(0xd34);function init$r(){const _0x2063fd=_0x35a251;var _0x4f4d80=adjust_zone(this[_0x2063fd(0x86f)],this['long0']);if(_0x4f4d80===undefined)throw new Error('unknown\x20utm\x20zone');this['lat0']=0x0,this[_0x2063fd(0x9cb)]=(0x6*Math['abs'](_0x4f4d80)-0xb7)*D2R$1,this['x0']=0x7a120,this['y0']=this['utmSouth']?0x989680:0x0,this['k0']=0.9996,etmerc['init']['apply'](this),this['forward']=etmerc['forward'],this['inverse']=etmerc['inverse'];}var names$r=['Universal\x20Transverse\x20Mercator\x20System','utm'],utm={'init':init$r,'names':names$r,'dependsOn':dependsOn};function srat(_0x21845c,_0x4965f8){return Math['pow']((0x1-_0x21845c)/(0x1+_0x21845c),_0x4965f8);}var MAX_ITER$2=0x14;function init$q(){const _0x2acf07={_0x4f8e23:0xe40,_0x3e33a1:0x76b,_0x246079:0x9b5},_0x23feba=_0x35a251;var _0x157a2f=Math['sin'](this[_0x23feba(_0x2acf07._0x4f8e23)]),_0x2bee69=Math['cos'](this[_0x23feba(0xe40)]);_0x2bee69*=_0x2bee69,this['rc']=Math[_0x23feba(_0x2acf07._0x3e33a1)](0x1-this['es'])/(0x1-this['es']*_0x157a2f*_0x157a2f),this['C']=Math['sqrt'](0x1+this['es']*_0x2bee69*_0x2bee69/(0x1-this['es'])),this[_0x23feba(0xf63)]=Math['asin'](_0x157a2f/this['C']),this['ratexp']=0.5*this['C']*this['e'],this['K']=Math[_0x23feba(_0x2acf07._0x246079)](0.5*this['phic0']+FORTPI)/(Math['pow'](Math['tan'](0.5*this['lat0']+FORTPI),this['C'])*srat(this['e']*_0x157a2f,this['ratexp']));}function forward$q(_0x396cb8){const _0x8ee384=_0x35a251;var _0x3466bd=_0x396cb8['x'],_0x215ae8=_0x396cb8['y'];return _0x396cb8['y']=0x2*Math['atan'](this['K']*Math[_0x8ee384(0xda4)](Math['tan'](0.5*_0x215ae8+FORTPI),this['C'])*srat(this['e']*Math['sin'](_0x215ae8),this['ratexp']))-HALF_PI,_0x396cb8['x']=this['C']*_0x3466bd,_0x396cb8;}function inverse$q(_0x370185){const _0x236d54={_0x593be3:0xdef},_0x1e8973=_0x35a251;var _0x56e826=1e-14,_0x180efc=_0x370185['x']/this['C'],_0x58d3eb=_0x370185['y'],_0x109d71=Math['pow'](Math[_0x1e8973(0x9b5)](0.5*_0x58d3eb+FORTPI)/this['K'],0x1/this['C']);for(var _0xe92b33=MAX_ITER$2;_0xe92b33>0x0;--_0xe92b33){_0x58d3eb=0x2*Math['atan'](_0x109d71*srat(this['e']*Math[_0x1e8973(_0x236d54._0x593be3)](_0x370185['y']),-0.5*this['e']))-HALF_PI;if(Math[_0x1e8973(0x405)](_0x58d3eb-_0x370185['y'])<_0x56e826)break;_0x370185['y']=_0x58d3eb;}if(!_0xe92b33)return null;return _0x370185['x']=_0x180efc,_0x370185['y']=_0x58d3eb,_0x370185;}var names$q=[_0x35a251(0xb45)],gauss={'init':init$q,'forward':forward$q,'inverse':inverse$q,'names':names$q};function init$p(){const _0x20b171={_0x592364:0xf63,_0x5be56d:0x6e2},_0x1c1c42=_0x35a251;gauss['init']['apply'](this);if(!this['rc'])return;this['sinc0']=Math[_0x1c1c42(0xdef)](this[_0x1c1c42(0xf63)]),this['cosc0']=Math['cos'](this[_0x1c1c42(_0x20b171._0x592364)]),this['R2']=0x2*this['rc'],!this['title']&&(this[_0x1c1c42(0x732)]=_0x1c1c42(_0x20b171._0x5be56d));}function forward$p(_0x568fda){const _0x3e7377={_0x1f60eb:0x55e},_0x5f0e77=_0x35a251;var _0xcf257f,_0x122e1d,_0x49884e,_0x34c305;return _0x568fda['x']=adjust_lon(_0x568fda['x']-this['long0']),gauss['forward']['apply'](this,[_0x568fda]),_0xcf257f=Math['sin'](_0x568fda['y']),_0x122e1d=Math['cos'](_0x568fda['y']),_0x49884e=Math['cos'](_0x568fda['x']),_0x34c305=this['k0']*this['R2']/(0x1+this['sinc0']*_0xcf257f+this[_0x5f0e77(_0x3e7377._0x1f60eb)]*_0x122e1d*_0x49884e),_0x568fda['x']=_0x34c305*_0x122e1d*Math['sin'](_0x568fda['x']),_0x568fda['y']=_0x34c305*(this['cosc0']*_0xcf257f-this['sinc0']*_0x122e1d*_0x49884e),_0x568fda['x']=this['a']*_0x568fda['x']+this['x0'],_0x568fda['y']=this['a']*_0x568fda['y']+this['y0'],_0x568fda;}function inverse$p(_0x5d29a5){const _0x12fb09={_0x1f3035:0x5f5,_0x16cfc0:0x55e,_0x4d02d6:0x240},_0x1e7a89=_0x35a251;var _0x5a3d97,_0x437cb7,_0x3d3929,_0x59d351,_0x26a1f2;_0x5d29a5['x']=(_0x5d29a5['x']-this['x0'])/this['a'],_0x5d29a5['y']=(_0x5d29a5['y']-this['y0'])/this['a'],_0x5d29a5['x']/=this['k0'],_0x5d29a5['y']/=this['k0'];if(_0x26a1f2=Math[_0x1e7a89(0x76b)](_0x5d29a5['x']*_0x5d29a5['x']+_0x5d29a5['y']*_0x5d29a5['y'])){var _0xd86657=0x2*Math[_0x1e7a89(_0x12fb09._0x1f3035)](_0x26a1f2,this['R2']);_0x5a3d97=Math['sin'](_0xd86657),_0x437cb7=Math['cos'](_0xd86657),_0x59d351=Math[_0x1e7a89(0x2bf)](_0x437cb7*this['sinc0']+_0x5d29a5['y']*_0x5a3d97*this[_0x1e7a89(_0x12fb09._0x16cfc0)]/_0x26a1f2),_0x3d3929=Math['atan2'](_0x5d29a5['x']*_0x5a3d97,_0x26a1f2*this['cosc0']*_0x437cb7-_0x5d29a5['y']*this['sinc0']*_0x5a3d97);}else _0x59d351=this['phic0'],_0x3d3929=0x0;return _0x5d29a5['x']=_0x3d3929,_0x5d29a5['y']=_0x59d351,gauss['inverse'][_0x1e7a89(_0x12fb09._0x4d02d6)](this,[_0x5d29a5]),_0x5d29a5['x']=adjust_lon(_0x5d29a5['x']+this['long0']),_0x5d29a5;}var names$p=[_0x35a251(0xf21),_0x35a251(0xcf3),'Polar_Stereographic',_0x35a251(0xd8e),_0x35a251(0x6e2),_0x35a251(0xc97)],sterea={'init':init$p,'forward':forward$p,'inverse':inverse$p,'names':names$p};function ssfn_(_0x5e88e2,_0x55dc8b,_0x124b9c){const _0x53d422=_0x35a251;return _0x55dc8b*=_0x124b9c,Math['tan'](0.5*(HALF_PI+_0x5e88e2))*Math[_0x53d422(0xda4)]((0x1-_0x55dc8b)/(0x1+_0x55dc8b),0.5*_0x124b9c);}function init$o(){const _0x58de63={_0x4bb65e:0x64c,_0x525ed2:0x405,_0xe3b775:0x405,_0x173e52:0xaa3,_0x4c0ab1:0xe40,_0x461dfa:0x254,_0x372709:0x8e9,_0x2e54e2:0xeec,_0x4ad522:0x31d,_0x2c43b3:0xe40,_0x339804:0x31d},_0x10a87e=_0x35a251;this['coslat0']=Math['cos'](this['lat0']),this['sinlat0']=Math['sin'](this['lat0']),this[_0x10a87e(_0x58de63._0x4bb65e)]?this['k0']===0x1&&!isNaN(this['lat_ts'])&&Math[_0x10a87e(_0x58de63._0x525ed2)](this[_0x10a87e(0xaa3)])<=EPSLN&&(this['k0']=0.5*(0x1+sign(this[_0x10a87e(0xe40)])*Math['sin'](this['lat_ts']))):(Math[_0x10a87e(_0x58de63._0xe3b775)](this[_0x10a87e(_0x58de63._0x173e52)])<=EPSLN&&(this[_0x10a87e(_0x58de63._0x4c0ab1)]>0x0?this['con']=0x1:this['con']=-0x1),this['cons']=Math[_0x10a87e(0x76b)](Math[_0x10a87e(0xda4)](0x1+this['e'],0x1+this['e'])*Math['pow'](0x1-this['e'],0x1-this['e'])),this['k0']===0x1&&!isNaN(this['lat_ts'])&&Math[_0x10a87e(_0x58de63._0x525ed2)](this[_0x10a87e(0xaa3)])<=EPSLN&&(this['k0']=0.5*this[_0x10a87e(_0x58de63._0x461dfa)]*msfnz(this['e'],Math['sin'](this[_0x10a87e(_0x58de63._0x372709)]),Math[_0x10a87e(_0x58de63._0x2e54e2)](this['lat_ts']))/tsfnz(this['e'],this['con']*this[_0x10a87e(0x8e9)],this['con']*Math['sin'](this['lat_ts']))),this['ms1']=msfnz(this['e'],this[_0x10a87e(_0x58de63._0x4ad522)],this['coslat0']),this['X0']=0x2*Math['atan'](this['ssfn_'](this[_0x10a87e(_0x58de63._0x2c43b3)],this[_0x10a87e(_0x58de63._0x339804)],this['e']))-HALF_PI,this['cosX0']=Math['cos'](this['X0']),this['sinX0']=Math['sin'](this['X0']));}function forward$o(_0x2be37b){const _0xa0fdae={_0x403590:0x405,_0x4145b9:0xaa3,_0x38c36b:0x9cb,_0x49a855:0xeec,_0x56e450:0x765,_0x763d7f:0x272},_0x26adcd=_0x35a251;var _0x821322=_0x2be37b['x'],_0x248da4=_0x2be37b['y'],_0x31c63d=Math['sin'](_0x248da4),_0x5847eb=Math['cos'](_0x248da4),_0x473d5a,_0x115740,_0x2141ff,_0x1c894f,_0x486f2f,_0x32f618,_0x814829=adjust_lon(_0x821322-this['long0']);if(Math['abs'](Math['abs'](_0x821322-this['long0'])-Math['PI'])<=EPSLN&&Math[_0x26adcd(_0xa0fdae._0x403590)](_0x248da4+this['lat0'])<=EPSLN)return _0x2be37b['x']=NaN,_0x2be37b['y']=NaN,_0x2be37b;if(this[_0x26adcd(0x64c)])return _0x473d5a=0x2*this['k0']/(0x1+this['sinlat0']*_0x31c63d+this[_0x26adcd(_0xa0fdae._0x4145b9)]*_0x5847eb*Math[_0x26adcd(0xeec)](_0x814829)),_0x2be37b['x']=this['a']*_0x473d5a*_0x5847eb*Math[_0x26adcd(0xdef)](_0x814829)+this['x0'],_0x2be37b['y']=this['a']*_0x473d5a*(this['coslat0']*_0x31c63d-this['sinlat0']*_0x5847eb*Math[_0x26adcd(0xeec)](_0x814829))+this['y0'],_0x2be37b;else{_0x115740=0x2*Math['atan'](this[_0x26adcd(0x5b9)](_0x248da4,_0x31c63d,this['e']))-HALF_PI,_0x1c894f=Math['cos'](_0x115740),_0x2141ff=Math['sin'](_0x115740);if(Math['abs'](this['coslat0'])<=EPSLN)return _0x486f2f=tsfnz(this['e'],_0x248da4*this['con'],this['con']*_0x31c63d),_0x32f618=0x2*this['a']*this['k0']*_0x486f2f/this['cons'],_0x2be37b['x']=this['x0']+_0x32f618*Math['sin'](_0x821322-this[_0x26adcd(_0xa0fdae._0x38c36b)]),_0x2be37b['y']=this['y0']-this['con']*_0x32f618*Math['cos'](_0x821322-this['long0']),_0x2be37b;else Math['abs'](this['sinlat0'])<EPSLN?(_0x473d5a=0x2*this['a']*this['k0']/(0x1+_0x1c894f*Math[_0x26adcd(_0xa0fdae._0x49a855)](_0x814829)),_0x2be37b['y']=_0x473d5a*_0x2141ff):(_0x473d5a=0x2*this['a']*this['k0']*this[_0x26adcd(_0xa0fdae._0x56e450)]/(this['cosX0']*(0x1+this['sinX0']*_0x2141ff+this[_0x26adcd(_0xa0fdae._0x763d7f)]*_0x1c894f*Math['cos'](_0x814829))),_0x2be37b['y']=_0x473d5a*(this['cosX0']*_0x2141ff-this[_0x26adcd(0xa05)]*_0x1c894f*Math['cos'](_0x814829))+this['y0']);_0x2be37b['x']=_0x473d5a*_0x1c894f*Math['sin'](_0x814829)+this['x0'];}return _0x2be37b;}function inverse$o(_0x280b63){const _0x53803b={_0x4c0ee9:0x9cb,_0x91ad7b:0xeec,_0x2915de:0x5f5,_0x36683f:0xeec,_0x36898e:0xdef},_0x5880c4=_0x35a251;_0x280b63['x']-=this['x0'],_0x280b63['y']-=this['y0'];var _0xcbdcca,_0x3c495b,_0x348356,_0x49aa25,_0x302147,_0x1ecb02=Math['sqrt'](_0x280b63['x']*_0x280b63['x']+_0x280b63['y']*_0x280b63['y']);if(this['sphere']){var _0x23ec4b=0x2*Math['atan'](_0x1ecb02/(0x2*this['a']*this['k0']));_0xcbdcca=this[_0x5880c4(_0x53803b._0x4c0ee9)],_0x3c495b=this[_0x5880c4(0xe40)];if(_0x1ecb02<=EPSLN)return _0x280b63['x']=_0xcbdcca,_0x280b63['y']=_0x3c495b,_0x280b63;return _0x3c495b=Math['asin'](Math['cos'](_0x23ec4b)*this['sinlat0']+_0x280b63['y']*Math['sin'](_0x23ec4b)*this['coslat0']/_0x1ecb02),Math['abs'](this['coslat0'])<EPSLN?this['lat0']>0x0?_0xcbdcca=adjust_lon(this[_0x5880c4(0x9cb)]+Math['atan2'](_0x280b63['x'],-0x1*_0x280b63['y'])):_0xcbdcca=adjust_lon(this[_0x5880c4(_0x53803b._0x4c0ee9)]+Math['atan2'](_0x280b63['x'],_0x280b63['y'])):_0xcbdcca=adjust_lon(this['long0']+Math['atan2'](_0x280b63['x']*Math['sin'](_0x23ec4b),_0x1ecb02*this['coslat0']*Math[_0x5880c4(_0x53803b._0x91ad7b)](_0x23ec4b)-_0x280b63['y']*this[_0x5880c4(0x31d)]*Math['sin'](_0x23ec4b))),_0x280b63['x']=_0xcbdcca,_0x280b63['y']=_0x3c495b,_0x280b63;}else{if(Math['abs'](this['coslat0'])<=EPSLN){if(_0x1ecb02<=EPSLN)return _0x3c495b=this['lat0'],_0xcbdcca=this['long0'],_0x280b63['x']=_0xcbdcca,_0x280b63['y']=_0x3c495b,_0x280b63;_0x280b63['x']*=this['con'],_0x280b63['y']*=this['con'],_0x348356=_0x1ecb02*this['cons']/(0x2*this['a']*this['k0']),_0x3c495b=this['con']*phi2z(this['e'],_0x348356),_0xcbdcca=this['con']*adjust_lon(this['con']*this['long0']+Math[_0x5880c4(_0x53803b._0x2915de)](_0x280b63['x'],-0x1*_0x280b63['y']));}else _0x49aa25=0x2*Math['atan'](_0x1ecb02*this['cosX0']/(0x2*this['a']*this['k0']*this['ms1'])),_0xcbdcca=this['long0'],_0x1ecb02<=EPSLN?_0x302147=this['X0']:(_0x302147=Math['asin'](Math[_0x5880c4(_0x53803b._0x36683f)](_0x49aa25)*this['sinX0']+_0x280b63['y']*Math[_0x5880c4(_0x53803b._0x36898e)](_0x49aa25)*this['cosX0']/_0x1ecb02),_0xcbdcca=adjust_lon(this[_0x5880c4(0x9cb)]+Math['atan2'](_0x280b63['x']*Math['sin'](_0x49aa25),_0x1ecb02*this['cosX0']*Math[_0x5880c4(0xeec)](_0x49aa25)-_0x280b63['y']*this['sinX0']*Math[_0x5880c4(_0x53803b._0x36898e)](_0x49aa25)))),_0x3c495b=-0x1*phi2z(this['e'],Math['tan'](0.5*(HALF_PI+_0x302147)));}return _0x280b63['x']=_0xcbdcca,_0x280b63['y']=_0x3c495b,_0x280b63;}var names$o=[_0x35a251(0x1d2),'Stereographic_South_Pole','Polar\x20Stereographic\x20(variant\x20B)'],stere={'init':init$o,'forward':forward$o,'inverse':inverse$o,'names':names$o,'ssfn_':ssfn_};function init$n(){const _0x52e107={_0x162ea0:0x76b,_0x353ddb:0x2bf,_0x599978:0x9b5},_0x2b036e=_0x35a251;var _0x165f4c=this['lat0'];this[_0x2b036e(0xa3f)]=this['long0'];var _0x156ef2=Math['sin'](_0x165f4c),_0x3b4905=this['a'],_0x272385=this['rf'],_0x593f75=0x1/_0x272385,_0x57832e=0x2*_0x593f75-Math['pow'](_0x593f75,0x2),_0x1d10ab=this['e']=Math['sqrt'](_0x57832e);this['R']=this['k0']*_0x3b4905*Math['sqrt'](0x1-_0x57832e)/(0x1-_0x57832e*Math['pow'](_0x156ef2,0x2)),this['alpha']=Math[_0x2b036e(_0x52e107._0x162ea0)](0x1+_0x57832e/(0x1-_0x57832e)*Math['pow'](Math['cos'](_0x165f4c),0x4)),this['b0']=Math[_0x2b036e(_0x52e107._0x353ddb)](_0x156ef2/this['alpha']);var _0x213bec=Math['log'](Math[_0x2b036e(_0x52e107._0x599978)](Math['PI']/0x4+this['b0']/0x2)),_0x14cf8d=Math[_0x2b036e(0x3a8)](Math['tan'](Math['PI']/0x4+_0x165f4c/0x2)),_0x205e90=Math[_0x2b036e(0x3a8)]((0x1+_0x1d10ab*_0x156ef2)/(0x1-_0x1d10ab*_0x156ef2));this['K']=_0x213bec-this[_0x2b036e(0x1f4)]*_0x14cf8d+this['alpha']*_0x1d10ab/0x2*_0x205e90;}function forward$n(_0x1a03c5){const _0x369e01={_0x5e078a:0xeec},_0x5d6369=_0x35a251;var _0x13655f=Math['log'](Math['tan'](Math['PI']/0x4-_0x1a03c5['y']/0x2)),_0x36911d=this['e']/0x2*Math['log']((0x1+this['e']*Math['sin'](_0x1a03c5['y']))/(0x1-this['e']*Math['sin'](_0x1a03c5['y']))),_0x5202a0=-this['alpha']*(_0x13655f+_0x36911d)+this['K'],_0x4d727b=0x2*(Math[_0x5d6369(0x269)](Math['exp'](_0x5202a0))-Math['PI']/0x4),_0x41caf7=this['alpha']*(_0x1a03c5['x']-this['lambda0']),_0x4df462=Math['atan'](Math['sin'](_0x41caf7)/(Math['sin'](this['b0'])*Math['tan'](_0x4d727b)+Math['cos'](this['b0'])*Math[_0x5d6369(_0x369e01._0x5e078a)](_0x41caf7))),_0x38b804=Math['asin'](Math['cos'](this['b0'])*Math['sin'](_0x4d727b)-Math['sin'](this['b0'])*Math['cos'](_0x4d727b)*Math['cos'](_0x41caf7));return _0x1a03c5['y']=this['R']/0x2*Math['log']((0x1+Math['sin'](_0x38b804))/(0x1-Math[_0x5d6369(0xdef)](_0x38b804)))+this['y0'],_0x1a03c5['x']=this['R']*_0x4df462+this['x0'],_0x1a03c5;}function inverse$n(_0x23086b){const _0x5c988d={_0xc80b1a:0xdef,_0x22e815:0xa3f,_0x3c9437:0x9b5,_0x42daa6:0x269},_0x2f2d=_0x35a251;var _0x524780=_0x23086b['x']-this['x0'],_0x5a9477=_0x23086b['y']-this['y0'],_0x4f82d9=_0x524780/this['R'],_0x2b83a4=0x2*(Math['atan'](Math['exp'](_0x5a9477/this['R']))-Math['PI']/0x4),_0x1bf461=Math['asin'](Math['cos'](this['b0'])*Math['sin'](_0x2b83a4)+Math[_0x2f2d(_0x5c988d._0xc80b1a)](this['b0'])*Math['cos'](_0x2b83a4)*Math['cos'](_0x4f82d9)),_0x99f1da=Math[_0x2f2d(0x269)](Math[_0x2f2d(_0x5c988d._0xc80b1a)](_0x4f82d9)/(Math['cos'](this['b0'])*Math['cos'](_0x4f82d9)-Math['sin'](this['b0'])*Math['tan'](_0x2b83a4))),_0x5ca943=this[_0x2f2d(_0x5c988d._0x22e815)]+_0x99f1da/this['alpha'],_0x43e0a1=0x0,_0x22fc0e=_0x1bf461,_0x4b8541=-0x3e8,_0x3ec0fe=0x0;while(Math[_0x2f2d(0x405)](_0x22fc0e-_0x4b8541)>1e-7){if(++_0x3ec0fe>0x14)return;_0x43e0a1=0x1/this['alpha']*(Math['log'](Math[_0x2f2d(0x9b5)](Math['PI']/0x4+_0x1bf461/0x2))-this['K'])+this['e']*Math['log'](Math[_0x2f2d(_0x5c988d._0x3c9437)](Math['PI']/0x4+Math['asin'](this['e']*Math['sin'](_0x22fc0e))/0x2)),_0x4b8541=_0x22fc0e,_0x22fc0e=0x2*Math[_0x2f2d(_0x5c988d._0x42daa6)](Math[_0x2f2d(0xed)](_0x43e0a1))-Math['PI']/0x2;}return _0x23086b['x']=_0x5ca943,_0x23086b['y']=_0x22fc0e,_0x23086b;}var names$n=[_0x35a251(0x8c2)],somerc={'init':init$n,'forward':forward$n,'inverse':inverse$n,'names':names$n},TOL=1e-7;function isTypeA(_0x83491c){const _0xb9beab={_0x13214b:0xd74},_0x521c9f=_0x35a251;var _0x57289f=['Hotine_Oblique_Mercator','Hotine_Oblique_Mercator_Azimuth_Natural_Origin'],_0x5d6e2b=typeof _0x83491c['PROJECTION']==='object'?Object['keys'](_0x83491c['PROJECTION'])[0x0]:_0x83491c['PROJECTION'];return'no_uoff'in _0x83491c||'no_off'in _0x83491c||_0x57289f[_0x521c9f(_0xb9beab._0x13214b)](_0x5d6e2b)!==-0x1;}function init$m(){const _0xc3d694={_0x34debc:0xc49,_0x1cd070:0x8d9,_0x1052b9:0xda4,_0x46edb6:0xe40,_0x1708ff:0x2bf,_0x3b7fd5:0x2bf,_0x2cbd60:0x86d,_0x21735d:0xdef,_0x8aa353:0x269,_0x1ae828:0x270,_0x2f4e52:0xf00,_0x362a18:0xdc,_0x5df713:0x839},_0xe4ec1=_0x35a251;var _0xae6a11,_0x4c3f0e,_0x496945,_0x358678,_0x43707a,_0x34ae1a,_0x48191c,_0x46c39d,_0x146863,_0x9ea980,_0x5090ca=0x0,_0x4a4cfd,_0x44907c=0x0,_0x583d4b=0x0,_0x1ec9c6=0x0,_0xe69d5d=0x0,_0x3f6f52=0x0,_0x5578c1=0x0;this[_0xe4ec1(0xf00)]=isTypeA(this),this[_0xe4ec1(_0xc3d694._0x34debc)]='no_rot'in this;var _0x50c296=![];_0xe4ec1(0x1f4)in this&&(_0x50c296=!![]);var _0x56a20a=![];'rectified_grid_angle'in this&&(_0x56a20a=!![]);_0x50c296&&(_0x5578c1=this[_0xe4ec1(0x1f4)]);_0x56a20a&&(_0x5090ca=this['rectified_grid_angle']*D2R$1);if(_0x50c296||_0x56a20a)_0x44907c=this[_0xe4ec1(_0xc3d694._0x1cd070)];else{_0x583d4b=this['long1'],_0xe69d5d=this['lat1'],_0x1ec9c6=this[_0xe4ec1(0x782)],_0x3f6f52=this['lat2'];if(Math['abs'](_0xe69d5d-_0x3f6f52)<=TOL||(_0xae6a11=Math['abs'](_0xe69d5d))<=TOL||Math['abs'](_0xae6a11-HALF_PI)<=TOL||Math['abs'](Math['abs'](this['lat0'])-HALF_PI)<=TOL||Math['abs'](Math[_0xe4ec1(0x405)](_0x3f6f52)-HALF_PI)<=TOL)throw new Error();}var _0x13c497=0x1-this['es'];_0x4c3f0e=Math['sqrt'](_0x13c497);Math['abs'](this['lat0'])>EPSLN?(_0x46c39d=Math['sin'](this['lat0']),_0x496945=Math[_0xe4ec1(0xeec)](this[_0xe4ec1(0xe40)]),_0xae6a11=0x1-this['es']*_0x46c39d*_0x46c39d,this['B']=_0x496945*_0x496945,this['B']=Math['sqrt'](0x1+this['es']*this['B']*this['B']/_0x13c497),this['A']=this['B']*this['k0']*_0x4c3f0e/_0xae6a11,_0x358678=this['B']*_0x4c3f0e/(_0x496945*Math['sqrt'](_0xae6a11)),_0x43707a=_0x358678*_0x358678-0x1,_0x43707a<=0x0?_0x43707a=0x0:(_0x43707a=Math['sqrt'](_0x43707a),this['lat0']<0x0&&(_0x43707a=-_0x43707a)),this['E']=_0x43707a+=_0x358678,this['E']*=Math[_0xe4ec1(_0xc3d694._0x1052b9)](tsfnz(this['e'],this[_0xe4ec1(_0xc3d694._0x46edb6)],_0x46c39d),this['B'])):(this['B']=0x1/_0x4c3f0e,this['A']=this['k0'],this['E']=_0x358678=_0x43707a=0x1);if(_0x50c296||_0x56a20a)_0x50c296?(_0x4a4cfd=Math[_0xe4ec1(_0xc3d694._0x1708ff)](Math[_0xe4ec1(0xdef)](_0x5578c1)/_0x358678),!_0x56a20a&&(_0x5090ca=_0x5578c1)):(_0x4a4cfd=_0x5090ca,_0x5578c1=Math[_0xe4ec1(_0xc3d694._0x3b7fd5)](_0x358678*Math['sin'](_0x4a4cfd))),this[_0xe4ec1(_0xc3d694._0x2cbd60)]=_0x44907c-Math['asin'](0.5*(_0x43707a-0x1/_0x43707a)*Math['tan'](_0x4a4cfd))/this['B'];else{_0x34ae1a=Math[_0xe4ec1(_0xc3d694._0x1052b9)](tsfnz(this['e'],_0xe69d5d,Math[_0xe4ec1(_0xc3d694._0x21735d)](_0xe69d5d)),this['B']),_0x48191c=Math[_0xe4ec1(0xda4)](tsfnz(this['e'],_0x3f6f52,Math['sin'](_0x3f6f52)),this['B']),_0x43707a=this['E']/_0x34ae1a,_0x146863=(_0x48191c-_0x34ae1a)/(_0x48191c+_0x34ae1a),_0x9ea980=this['E']*this['E'],_0x9ea980=(_0x9ea980-_0x48191c*_0x34ae1a)/(_0x9ea980+_0x48191c*_0x34ae1a),_0xae6a11=_0x583d4b-_0x1ec9c6;if(_0xae6a11<-Math['pi'])_0x1ec9c6-=TWO_PI;else _0xae6a11>Math['pi']&&(_0x1ec9c6+=TWO_PI);this[_0xe4ec1(0x86d)]=adjust_lon(0.5*(_0x583d4b+_0x1ec9c6)-Math['atan'](_0x9ea980*Math['tan'](0.5*this['B']*(_0x583d4b-_0x1ec9c6))/_0x146863)/this['B']),_0x4a4cfd=Math[_0xe4ec1(_0xc3d694._0x8aa353)](0x2*Math['sin'](this['B']*adjust_lon(_0x583d4b-this['lam0']))/(_0x43707a-0x1/_0x43707a)),_0x5090ca=_0x5578c1=Math[_0xe4ec1(0x2bf)](_0x358678*Math['sin'](_0x4a4cfd));}this['singam']=Math[_0xe4ec1(0xdef)](_0x4a4cfd),this['cosgam']=Math['cos'](_0x4a4cfd),this[_0xe4ec1(_0xc3d694._0x1ae828)]=Math[_0xe4ec1(0xdef)](_0x5090ca),this['cosrot']=Math['cos'](_0x5090ca),this['rB']=0x1/this['B'],this['ArB']=this['A']*this['rB'],this[_0xe4ec1(0x9a7)]=0x1/this['ArB'],this['A']*this['B'],this[_0xe4ec1(_0xc3d694._0x2f4e52)]?this['u_0']=0x0:(this[_0xe4ec1(_0xc3d694._0x362a18)]=Math['abs'](this[_0xe4ec1(0x839)]*Math['atan'](Math['sqrt'](_0x358678*_0x358678-0x1)/Math['cos'](_0x5578c1))),this['lat0']<0x0&&(this[_0xe4ec1(0xdc)]=-this['u_0'])),_0x43707a=0.5*_0x4a4cfd,this['v_pole_n']=this['ArB']*Math['log'](Math['tan'](FORTPI-_0x43707a)),this['v_pole_s']=this[_0xe4ec1(_0xc3d694._0x5df713)]*Math['log'](Math['tan'](FORTPI+_0x43707a));}function forward$m(_0xdbae77){const _0x32ed1a={_0x68cf33:0x86d,_0x153a98:0x405,_0x38cf37:0x7e1,_0x2442e5:0xeec,_0xf21fc4:0x284},_0x2880c3=_0x35a251;var _0x3001d4={},_0x5861dd,_0x16dcc2,_0x1a42e6,_0x254bf4,_0x5f428a,_0x4726ce,_0x12ec40,_0xd64e86;_0xdbae77['x']=_0xdbae77['x']-this[_0x2880c3(_0x32ed1a._0x68cf33)];if(Math['abs'](Math[_0x2880c3(_0x32ed1a._0x153a98)](_0xdbae77['y'])-HALF_PI)>EPSLN){_0x5f428a=this['E']/Math['pow'](tsfnz(this['e'],_0xdbae77['y'],Math['sin'](_0xdbae77['y'])),this['B']),_0x4726ce=0x1/_0x5f428a,_0x5861dd=0.5*(_0x5f428a-_0x4726ce),_0x16dcc2=0.5*(_0x5f428a+_0x4726ce),_0x254bf4=Math['sin'](this['B']*_0xdbae77['x']),_0x1a42e6=(_0x5861dd*this[_0x2880c3(_0x32ed1a._0x38cf37)]-_0x254bf4*this['cosgam'])/_0x16dcc2;if(Math['abs'](Math['abs'](_0x1a42e6)-0x1)<EPSLN)throw new Error();_0xd64e86=0.5*this['ArB']*Math[_0x2880c3(0x3a8)]((0x1-_0x1a42e6)/(0x1+_0x1a42e6)),_0x4726ce=Math[_0x2880c3(_0x32ed1a._0x2442e5)](this['B']*_0xdbae77['x']),Math['abs'](_0x4726ce)<TOL?_0x12ec40=this['A']*_0xdbae77['x']:_0x12ec40=this['ArB']*Math['atan2'](_0x5861dd*this[_0x2880c3(_0x32ed1a._0xf21fc4)]+_0x254bf4*this['singam'],_0x4726ce);}else _0xd64e86=_0xdbae77['y']>0x0?this['v_pole_n']:this[_0x2880c3(0x478)],_0x12ec40=this['ArB']*_0xdbae77['y'];return this['no_rot']?(_0x3001d4['x']=_0x12ec40,_0x3001d4['y']=_0xd64e86):(_0x12ec40-=this['u_0'],_0x3001d4['x']=_0xd64e86*this[_0x2880c3(0x1cd)]+_0x12ec40*this['sinrot'],_0x3001d4['y']=_0x12ec40*this[_0x2880c3(0x1cd)]-_0xd64e86*this['sinrot']),_0x3001d4['x']=this['a']*_0x3001d4['x']+this['x0'],_0x3001d4['y']=this['a']*_0x3001d4['y']+this['y0'],_0x3001d4;}function inverse$m(_0x1c783d){const _0x253861={_0x129905:0x1cd,_0x3fa9be:0x284},_0x3c8caa=_0x35a251;var _0x4e84e3,_0x90ec9a,_0x5ae2ba,_0xee084f,_0x185c66,_0x3a9a5f,_0x280cef,_0x4acc81={};_0x1c783d['x']=(_0x1c783d['x']-this['x0'])*(0x1/this['a']),_0x1c783d['y']=(_0x1c783d['y']-this['y0'])*(0x1/this['a']);this[_0x3c8caa(0xc49)]?(_0x90ec9a=_0x1c783d['y'],_0x4e84e3=_0x1c783d['x']):(_0x90ec9a=_0x1c783d['x']*this['cosrot']-_0x1c783d['y']*this['sinrot'],_0x4e84e3=_0x1c783d['y']*this[_0x3c8caa(_0x253861._0x129905)]+_0x1c783d['x']*this['sinrot']+this['u_0']);_0x5ae2ba=Math['exp'](-this['BrA']*_0x90ec9a),_0xee084f=0.5*(_0x5ae2ba-0x1/_0x5ae2ba),_0x185c66=0.5*(_0x5ae2ba+0x1/_0x5ae2ba),_0x3a9a5f=Math['sin'](this['BrA']*_0x4e84e3),_0x280cef=(_0x3a9a5f*this['cosgam']+_0xee084f*this['singam'])/_0x185c66;if(Math['abs'](Math['abs'](_0x280cef)-0x1)<EPSLN)_0x4acc81['x']=0x0,_0x4acc81['y']=_0x280cef<0x0?-HALF_PI:HALF_PI;else{_0x4acc81['y']=this['E']/Math[_0x3c8caa(0x76b)]((0x1+_0x280cef)/(0x1-_0x280cef)),_0x4acc81['y']=phi2z(this['e'],Math['pow'](_0x4acc81['y'],0x1/this['B']));if(_0x4acc81['y']===Infinity)throw new Error();_0x4acc81['x']=-this['rB']*Math['atan2'](_0xee084f*this[_0x3c8caa(_0x253861._0x3fa9be)]-_0x3a9a5f*this['singam'],Math['cos'](this['BrA']*_0x4e84e3));}return _0x4acc81['x']+=this['lam0'],_0x4acc81;}var names$m=['Hotine_Oblique_Mercator',_0x35a251(0xd9c),'Hotine_Oblique_Mercator_Azimuth_Natural_Origin','Hotine_Oblique_Mercator_Two_Point_Natural_Origin',_0x35a251(0x1d1),_0x35a251(0x990),'omerc'],omerc={'init':init$m,'forward':forward$m,'inverse':inverse$m,'names':names$m};function init$l(){const _0x4fe593={_0x1b5829:0x290,_0x397dc3:0xb0a,_0x1f2c0a:0xeec},_0x49c68f=_0x35a251;!this['lat2']&&(this[_0x49c68f(_0x4fe593._0x1b5829)]=this[_0x49c68f(_0x4fe593._0x397dc3)]);!this['k0']&&(this['k0']=0x1);this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0;if(Math['abs'](this['lat1']+this['lat2'])<EPSLN)return;var _0x5907e8=this['b']/this['a'];this['e']=Math[_0x49c68f(0x76b)](0x1-_0x5907e8*_0x5907e8);var _0x5a841c=Math[_0x49c68f(0xdef)](this['lat1']),_0x4df4b2=Math[_0x49c68f(_0x4fe593._0x1f2c0a)](this['lat1']),_0x5c60be=msfnz(this['e'],_0x5a841c,_0x4df4b2),_0xda4304=tsfnz(this['e'],this['lat1'],_0x5a841c),_0x2d8c8a=Math['sin'](this['lat2']),_0x279608=Math['cos'](this['lat2']),_0x4f982f=msfnz(this['e'],_0x2d8c8a,_0x279608),_0x1b4f0e=tsfnz(this['e'],this[_0x49c68f(_0x4fe593._0x1b5829)],_0x2d8c8a),_0x131ab1=tsfnz(this['e'],this['lat0'],Math['sin'](this['lat0']));Math['abs'](this['lat1']-this['lat2'])>EPSLN?this['ns']=Math['log'](_0x5c60be/_0x4f982f)/Math['log'](_0xda4304/_0x1b4f0e):this['ns']=_0x5a841c,isNaN(this['ns'])&&(this['ns']=_0x5a841c),this['f0']=_0x5c60be/(this['ns']*Math[_0x49c68f(0xda4)](_0xda4304,this['ns'])),this['rh']=this['a']*this['f0']*Math['pow'](_0x131ab1,this['ns']),!this['title']&&(this[_0x49c68f(0x732)]='Lambert\x20Conformal\x20Conic');}function forward$l(_0x328fac){const _0x19b2f2={_0x33e3a1:0x405},_0x348042=_0x35a251;var _0x4f7055=_0x328fac['x'],_0x428aef=_0x328fac['y'];Math[_0x348042(_0x19b2f2._0x33e3a1)](0x2*Math['abs'](_0x428aef)-Math['PI'])<=EPSLN&&(_0x428aef=sign(_0x428aef)*(HALF_PI-0x2*EPSLN));var _0x3a5b7d=Math['abs'](Math['abs'](_0x428aef)-HALF_PI),_0x5cc5c1,_0x53dd63;if(_0x3a5b7d>EPSLN)_0x5cc5c1=tsfnz(this['e'],_0x428aef,Math['sin'](_0x428aef)),_0x53dd63=this['a']*this['f0']*Math['pow'](_0x5cc5c1,this['ns']);else{_0x3a5b7d=_0x428aef*this['ns'];if(_0x3a5b7d<=0x0)return null;_0x53dd63=0x0;}var _0x2b225c=this['ns']*adjust_lon(_0x4f7055-this['long0']);return _0x328fac['x']=this['k0']*(_0x53dd63*Math['sin'](_0x2b225c))+this['x0'],_0x328fac['y']=this['k0']*(this['rh']-_0x53dd63*Math['cos'](_0x2b225c))+this['y0'],_0x328fac;}function inverse$l(_0x2eefa6){var _0x37da61,_0x48d583,_0x2e23e5,_0x1de28e,_0x1371c8,_0xab9d56=(_0x2eefa6['x']-this['x0'])/this['k0'],_0x4af287=this['rh']-(_0x2eefa6['y']-this['y0'])/this['k0'];this['ns']>0x0?(_0x37da61=Math['sqrt'](_0xab9d56*_0xab9d56+_0x4af287*_0x4af287),_0x48d583=0x1):(_0x37da61=-Math['sqrt'](_0xab9d56*_0xab9d56+_0x4af287*_0x4af287),_0x48d583=-0x1);var _0x2a3ee4=0x0;_0x37da61!==0x0&&(_0x2a3ee4=Math['atan2'](_0x48d583*_0xab9d56,_0x48d583*_0x4af287));if(_0x37da61!==0x0||this['ns']>0x0){_0x48d583=0x1/this['ns'],_0x2e23e5=Math['pow'](_0x37da61/(this['a']*this['f0']),_0x48d583),_0x1de28e=phi2z(this['e'],_0x2e23e5);if(_0x1de28e===-0x270f)return null;}else _0x1de28e=-HALF_PI;return _0x1371c8=adjust_lon(_0x2a3ee4/this['ns']+this['long0']),_0x2eefa6['x']=_0x1371c8,_0x2eefa6['y']=_0x1de28e,_0x2eefa6;}var names$l=['Lambert\x20Tangential\x20Conformal\x20Conic\x20Projection',_0x35a251(0xe92),'Lambert_Conformal_Conic_1SP','Lambert_Conformal_Conic_2SP','lcc',_0x35a251(0x7d1),'Lambert\x20Conic\x20Conformal\x20(2SP)'],lcc={'init':init$l,'forward':forward$l,'inverse':inverse$l,'names':names$l};function init$k(){const _0x1e248a={_0x1283ef:0x130,_0x5f5976:0xda4,_0x545664:0xdef,_0x1fdfb1:0x9b5,_0x500c0d:0x3d3},_0x167aa4=_0x35a251;this['a']=6377397.155,this['es']=0.006674372230614,this['e']=Math['sqrt'](this['es']),!this[_0x167aa4(0xe40)]&&(this['lat0']=0.863937979737193),!this['long0']&&(this['long0']=0.7417649320975901-0.308341501185665),!this['k0']&&(this['k0']=0.9999),this['s45']=0.785398163397448,this['s90']=0x2*this[_0x167aa4(_0x1e248a._0x1283ef)],this['fi0']=this['lat0'],this['e2']=this['es'],this['e']=Math[_0x167aa4(0x76b)](this['e2']),this['alfa']=Math['sqrt'](0x1+this['e2']*Math[_0x167aa4(_0x1e248a._0x5f5976)](Math['cos'](this['fi0']),0x4)/(0x1-this['e2'])),this['uq']=1.04216856380474,this['u0']=Math['asin'](Math[_0x167aa4(_0x1e248a._0x545664)](this[_0x167aa4(0x3d3)])/this['alfa']),this['g']=Math['pow']((0x1+this['e']*Math['sin'](this['fi0']))/(0x1-this['e']*Math[_0x167aa4(0xdef)](this['fi0'])),this['alfa']*this['e']/0x2),this['k']=Math['tan'](this['u0']/0x2+this['s45'])/Math['pow'](Math[_0x167aa4(_0x1e248a._0x1fdfb1)](this[_0x167aa4(_0x1e248a._0x500c0d)]/0x2+this[_0x167aa4(0x130)]),this['alfa'])*this['g'],this['k1']=this['k0'],this['n0']=this['a']*Math['sqrt'](0x1-this['e2'])/(0x1-this['e2']*Math['pow'](Math['sin'](this[_0x167aa4(0x3d3)]),0x2)),this['s0']=1.37008346281555,this['n']=Math['sin'](this['s0']),this['ro0']=this['k1']*this['n0']/Math['tan'](this['s0']),this['ad']=this['s90']-this['uq'];}function forward$k(_0x139278){const _0x4d907d={_0x55ced4:0x9cb,_0x37dec2:0xda4,_0x1db07b:0x130,_0x59efdb:0x7c5,_0x267b8c:0xdef,_0x378cb8:0x9b5},_0x1c567e=_0x35a251;var _0x215f69,_0x1095d1,_0x5d4e84,_0x299b1c,_0x4fa217,_0xdaa92b,_0x490e66,_0x121e69=_0x139278['x'],_0x25c910=_0x139278['y'],_0x5be131=adjust_lon(_0x121e69-this[_0x1c567e(_0x4d907d._0x55ced4)]);return _0x215f69=Math[_0x1c567e(_0x4d907d._0x37dec2)]((0x1+this['e']*Math['sin'](_0x25c910))/(0x1-this['e']*Math['sin'](_0x25c910)),this['alfa']*this['e']/0x2),_0x1095d1=0x2*(Math['atan'](this['k']*Math['pow'](Math[_0x1c567e(0x9b5)](_0x25c910/0x2+this[_0x1c567e(_0x4d907d._0x1db07b)]),this[_0x1c567e(_0x4d907d._0x59efdb)])/_0x215f69)-this['s45']),_0x5d4e84=-_0x5be131*this['alfa'],_0x299b1c=Math['asin'](Math['cos'](this['ad'])*Math['sin'](_0x1095d1)+Math['sin'](this['ad'])*Math['cos'](_0x1095d1)*Math['cos'](_0x5d4e84)),_0x4fa217=Math[_0x1c567e(0x2bf)](Math['cos'](_0x1095d1)*Math[_0x1c567e(_0x4d907d._0x267b8c)](_0x5d4e84)/Math['cos'](_0x299b1c)),_0xdaa92b=this['n']*_0x4fa217,_0x490e66=this['ro0']*Math[_0x1c567e(0xda4)](Math[_0x1c567e(0x9b5)](this['s0']/0x2+this[_0x1c567e(0x130)]),this['n'])/Math['pow'](Math[_0x1c567e(_0x4d907d._0x378cb8)](_0x299b1c/0x2+this['s45']),this['n']),_0x139278['y']=_0x490e66*Math[_0x1c567e(0xeec)](_0xdaa92b)/0x1,_0x139278['x']=_0x490e66*Math['sin'](_0xdaa92b)/0x1,!this['czech']&&(_0x139278['y']*=-0x1,_0x139278['x']*=-0x1),_0x139278;}function inverse$k(_0x19ad49){const _0x1f0a5c={_0x297001:0x130,_0x51cecc:0x2bf,_0x4568c6:0xeec,_0x21526e:0x7c5},_0x2319e4=_0x35a251;var _0x346531,_0x2f57a9,_0x530dcd,_0x2c0087,_0x45e0e0,_0x51221e,_0x1a8a3a,_0x2e2e73,_0x4605f8=_0x19ad49['x'];_0x19ad49['x']=_0x19ad49['y'],_0x19ad49['y']=_0x4605f8;!this['czech']&&(_0x19ad49['y']*=-0x1,_0x19ad49['x']*=-0x1);_0x51221e=Math['sqrt'](_0x19ad49['x']*_0x19ad49['x']+_0x19ad49['y']*_0x19ad49['y']),_0x45e0e0=Math['atan2'](_0x19ad49['y'],_0x19ad49['x']),_0x2c0087=_0x45e0e0/Math['sin'](this['s0']),_0x530dcd=0x2*(Math['atan'](Math['pow'](this['ro0']/_0x51221e,0x1/this['n'])*Math['tan'](this['s0']/0x2+this[_0x2319e4(_0x1f0a5c._0x297001)]))-this['s45']),_0x346531=Math[_0x2319e4(_0x1f0a5c._0x51cecc)](Math[_0x2319e4(0xeec)](this['ad'])*Math['sin'](_0x530dcd)-Math['sin'](this['ad'])*Math[_0x2319e4(0xeec)](_0x530dcd)*Math['cos'](_0x2c0087)),_0x2f57a9=Math[_0x2319e4(0x2bf)](Math[_0x2319e4(_0x1f0a5c._0x4568c6)](_0x530dcd)*Math['sin'](_0x2c0087)/Math['cos'](_0x346531)),_0x19ad49['x']=this['long0']-_0x2f57a9/this[_0x2319e4(0x7c5)],_0x1a8a3a=_0x346531,_0x2e2e73=0x0;var _0x3f4497=0x0;do{_0x19ad49['y']=0x2*(Math['atan'](Math[_0x2319e4(0xda4)](this['k'],-0x1/this[_0x2319e4(_0x1f0a5c._0x21526e)])*Math['pow'](Math['tan'](_0x346531/0x2+this['s45']),0x1/this['alfa'])*Math[_0x2319e4(0xda4)]((0x1+this['e']*Math['sin'](_0x1a8a3a))/(0x1-this['e']*Math['sin'](_0x1a8a3a)),this['e']/0x2))-this['s45']),Math['abs'](_0x1a8a3a-_0x19ad49['y'])<1e-10&&(_0x2e2e73=0x1),_0x1a8a3a=_0x19ad49['y'],_0x3f4497+=0x1;}while(_0x2e2e73===0x0&&_0x3f4497<0xf);if(_0x3f4497>=0xf)return null;return _0x19ad49;}var names$k=[_0x35a251(0xe47),'krovak'],krovak={'init':init$k,'forward':forward$k,'inverse':inverse$k,'names':names$k};function mlfn(_0x4c1cf1,_0x344696,_0x19292e,_0x1d9b21,_0x3865f1){const _0x451185={_0x3621d7:0xdef},_0x5a4887=_0x35a251;return _0x4c1cf1*_0x3865f1-_0x344696*Math[_0x5a4887(_0x451185._0x3621d7)](0x2*_0x3865f1)+_0x19292e*Math[_0x5a4887(0xdef)](0x4*_0x3865f1)-_0x1d9b21*Math[_0x5a4887(0xdef)](0x6*_0x3865f1);}function e0fn(_0x4e0d18){return 0x1-0.25*_0x4e0d18*(0x1+_0x4e0d18/0x10*(0x3+1.25*_0x4e0d18));}function e1fn(_0xda541b){return 0.375*_0xda541b*(0x1+0.25*_0xda541b*(0x1+0.46875*_0xda541b));}function e2fn(_0x2ddca9){return 0.05859375*_0x2ddca9*_0x2ddca9*(0x1+0.75*_0x2ddca9);}function e3fn(_0x2b3065){return _0x2b3065*_0x2b3065*_0x2b3065*(0x23/0xc00);}function gN(_0x4c8343,_0x5182c8,_0x53e041){var _0x2f08b7=_0x5182c8*_0x53e041;return _0x4c8343/Math['sqrt'](0x1-_0x2f08b7*_0x2f08b7);}function adjust_lat(_0x26da59){const _0x4ecffc=_0x35a251;return Math[_0x4ecffc(0x405)](_0x26da59)<HALF_PI?_0x26da59:_0x26da59-sign(_0x26da59)*Math['PI'];}function imlfn(_0x1a2697,_0x14777b,_0x131d87,_0x3fc052,_0x3f07f4){const _0x12a1c3={_0x5db2b6:0xdef},_0x27b7f1=_0x35a251;var _0x28e575,_0x528215;_0x28e575=_0x1a2697/_0x14777b;for(var _0x408bb9=0x0;_0x408bb9<0xf;_0x408bb9++){_0x528215=(_0x1a2697-(_0x14777b*_0x28e575-_0x131d87*Math['sin'](0x2*_0x28e575)+_0x3fc052*Math['sin'](0x4*_0x28e575)-_0x3f07f4*Math[_0x27b7f1(_0x12a1c3._0x5db2b6)](0x6*_0x28e575)))/(_0x14777b-0x2*_0x131d87*Math['cos'](0x2*_0x28e575)+0x4*_0x3fc052*Math['cos'](0x4*_0x28e575)-0x6*_0x3f07f4*Math['cos'](0x6*_0x28e575)),_0x28e575+=_0x528215;if(Math[_0x27b7f1(0x405)](_0x528215)<=1e-10)return _0x28e575;}return NaN;}function init$j(){!this['sphere']&&(this['e0']=e0fn(this['es']),this['e1']=e1fn(this['es']),this['e2']=e2fn(this['es']),this['e3']=e3fn(this['es']),this['ml0']=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat0']));}function forward$j(_0x2d450d){const _0x5be17a={_0x1e00d7:0x64c,_0x2f6df2:0xdef,_0x56f4ba:0x9b5,_0x27619c:0xeec},_0x23442b=_0x35a251;var _0x1348b9,_0x1025b9,_0x3f1d6d=_0x2d450d['x'],_0x5befc0=_0x2d450d['y'];_0x3f1d6d=adjust_lon(_0x3f1d6d-this[_0x23442b(0x9cb)]);if(this[_0x23442b(_0x5be17a._0x1e00d7)])_0x1348b9=this['a']*Math['asin'](Math['cos'](_0x5befc0)*Math[_0x23442b(_0x5be17a._0x2f6df2)](_0x3f1d6d)),_0x1025b9=this['a']*(Math['atan2'](Math[_0x23442b(_0x5be17a._0x56f4ba)](_0x5befc0),Math[_0x23442b(_0x5be17a._0x27619c)](_0x3f1d6d))-this['lat0']);else{var _0x404576=Math['sin'](_0x5befc0),_0x4f5118=Math[_0x23442b(0xeec)](_0x5befc0),_0x3448de=gN(this['a'],this['e'],_0x404576),_0xf3d709=Math[_0x23442b(0x9b5)](_0x5befc0)*Math['tan'](_0x5befc0),_0x25787c=_0x3f1d6d*Math['cos'](_0x5befc0),_0x3c9048=_0x25787c*_0x25787c,_0x4de2a9=this['es']*_0x4f5118*_0x4f5118/(0x1-this['es']),_0x398b23=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0x5befc0);_0x1348b9=_0x3448de*_0x25787c*(0x1-_0x3c9048*_0xf3d709*(0x1/0x6-(0x8-_0xf3d709+0x8*_0x4de2a9)*_0x3c9048/0x78)),_0x1025b9=_0x398b23-this['ml0']+_0x3448de*_0x404576/_0x4f5118*_0x3c9048*(0.5+(0x5-_0xf3d709+0x6*_0x4de2a9)*_0x3c9048/0x18);}return _0x2d450d['x']=_0x1348b9+this['x0'],_0x2d450d['y']=_0x1025b9+this['y0'],_0x2d450d;}function inverse$j(_0x1d0ebe){const _0x2632a4={_0x158828:0xdef,_0xf41e5b:0x5f5,_0x33f4e9:0x368},_0x218a27=_0x35a251;_0x1d0ebe['x']-=this['x0'],_0x1d0ebe['y']-=this['y0'];var _0x57ad37=_0x1d0ebe['x']/this['a'],_0x5f36d2=_0x1d0ebe['y']/this['a'],_0x989768,_0x209b2f;if(this['sphere']){var _0x35e641=_0x5f36d2+this['lat0'];_0x989768=Math['asin'](Math[_0x218a27(_0x2632a4._0x158828)](_0x35e641)*Math['cos'](_0x57ad37)),_0x209b2f=Math[_0x218a27(_0x2632a4._0xf41e5b)](Math[_0x218a27(0x9b5)](_0x57ad37),Math['cos'](_0x35e641));}else{var _0x1b7411=this[_0x218a27(_0x2632a4._0x33f4e9)]/this['a']+_0x5f36d2,_0x4cdc38=imlfn(_0x1b7411,this['e0'],this['e1'],this['e2'],this['e3']);if(Math['abs'](Math[_0x218a27(0x405)](_0x4cdc38)-HALF_PI)<=EPSLN)return _0x1d0ebe['x']=this['long0'],_0x1d0ebe['y']=HALF_PI,_0x5f36d2<0x0&&(_0x1d0ebe['y']*=-0x1),_0x1d0ebe;var _0x24d3b3=gN(this['a'],this['e'],Math['sin'](_0x4cdc38)),_0x3ecdd5=_0x24d3b3*_0x24d3b3*_0x24d3b3/this['a']/this['a']*(0x1-this['es']),_0x57cb51=Math['pow'](Math[_0x218a27(0x9b5)](_0x4cdc38),0x2),_0x4d1f0e=_0x57ad37*this['a']/_0x24d3b3,_0x46da7e=_0x4d1f0e*_0x4d1f0e;_0x989768=_0x4cdc38-_0x24d3b3*Math['tan'](_0x4cdc38)/_0x3ecdd5*_0x4d1f0e*_0x4d1f0e*(0.5-(0x1+0x3*_0x57cb51)*_0x4d1f0e*_0x4d1f0e/0x18),_0x209b2f=_0x4d1f0e*(0x1-_0x46da7e*(_0x57cb51/0x3+(0x1+0x3*_0x57cb51)*_0x57cb51*_0x46da7e/0xf))/Math['cos'](_0x4cdc38);}return _0x1d0ebe['x']=adjust_lon(_0x209b2f+this[_0x218a27(0x9cb)]),_0x1d0ebe['y']=adjust_lat(_0x989768),_0x1d0ebe;}var names$j=['Cassini','Cassini_Soldner','cass'],cass={'init':init$j,'forward':forward$j,'inverse':inverse$j,'names':names$j};function qsfnz(_0x1cf830,_0x5d3fb3){var _0xe9612c;return _0x1cf830>1e-7?(_0xe9612c=_0x1cf830*_0x5d3fb3,(0x1-_0x1cf830*_0x1cf830)*(_0x5d3fb3/(0x1-_0xe9612c*_0xe9612c)-0.5/_0x1cf830*Math['log']((0x1-_0xe9612c)/(0x1+_0xe9612c)))):0x2*_0x5d3fb3;}var S_POLE=0x1,N_POLE=0x2,EQUIT=0x3,OBLIQ=0x4;function init$i(){const _0x12a00e={_0x4e86a5:0xef7,_0x1f52b0:0xe40,_0x4d96f6:0x405,_0x3c7575:0x28f,_0x389435:0x673,_0x14e248:0xbe,_0x9e254a:0x28a,_0x172bc7:0xf7a},_0x3d3fd8=_0x35a251;var _0x2aeec0=Math['abs'](this['lat0']);if(Math['abs'](_0x2aeec0-HALF_PI)<EPSLN)this[_0x3d3fd8(_0x12a00e._0x4e86a5)]=this[_0x3d3fd8(_0x12a00e._0x1f52b0)]<0x0?this[_0x3d3fd8(0xd3)]:this[_0x3d3fd8(0xee4)];else Math[_0x3d3fd8(_0x12a00e._0x4d96f6)](_0x2aeec0)<EPSLN?this['mode']=this['EQUIT']:this['mode']=this['OBLIQ'];if(this['es']>0x0){var _0x3c38d9;this['qp']=qsfnz(this['e'],0x1),this['mmf']=0.5/(0x1-this['es']),this[_0x3d3fd8(0xe3)]=authset(this['es']);switch(this['mode']){case this['N_POLE']:this['dd']=0x1;break;case this['S_POLE']:this['dd']=0x1;break;case this[_0x3d3fd8(_0x12a00e._0x3c7575)]:this['rq']=Math['sqrt'](0.5*this['qp']),this['dd']=0x1/this['rq'],this['xmf']=0x1,this[_0x3d3fd8(_0x12a00e._0x389435)]=0.5*this['qp'];break;case this[_0x3d3fd8(_0x12a00e._0x14e248)]:this['rq']=Math['sqrt'](0.5*this['qp']),_0x3c38d9=Math['sin'](this[_0x3d3fd8(0xe40)]),this['sinb1']=qsfnz(this['e'],_0x3c38d9)/this['qp'],this['cosb1']=Math['sqrt'](0x1-this['sinb1']*this[_0x3d3fd8(_0x12a00e._0x9e254a)]),this['dd']=Math[_0x3d3fd8(0xeec)](this[_0x3d3fd8(0xe40)])/(Math['sqrt'](0x1-this['es']*_0x3c38d9*_0x3c38d9)*this['rq']*this[_0x3d3fd8(_0x12a00e._0x172bc7)]),this['ymf']=(this['xmf']=this['rq'])/this['dd'],this['xmf']*=this['dd'];break;}}else this['mode']===this['OBLIQ']&&(this['sinph0']=Math['sin'](this['lat0']),this['cosph0']=Math['cos'](this['lat0']));}function forward$i(_0xbb4c1c){const _0x1cd647={_0xba19bd:0xef7,_0x28d164:0x28f,_0x476ab2:0x445,_0x6c2011:0xee4,_0x4f2a45:0xef7,_0x7e454a:0xef7,_0x2dde37:0xbe,_0x3a243d:0x28a,_0x26f92a:0x76b},_0x565c95=_0x35a251;var _0x25600e,_0x5982a9,_0x2fcd06,_0x1a38d4,_0x424140,_0x38b0a1,_0x7f914f,_0x10c112,_0x2c2eb5,_0x2a0b3f,_0x352879=_0xbb4c1c['x'],_0x535d13=_0xbb4c1c['y'];_0x352879=adjust_lon(_0x352879-this['long0']);if(this['sphere']){_0x424140=Math['sin'](_0x535d13),_0x2a0b3f=Math[_0x565c95(0xeec)](_0x535d13),_0x2fcd06=Math['cos'](_0x352879);if(this[_0x565c95(_0x1cd647._0xba19bd)]===this['OBLIQ']||this['mode']===this[_0x565c95(_0x1cd647._0x28d164)]){_0x5982a9=this[_0x565c95(0xef7)]===this['EQUIT']?0x1+_0x2a0b3f*_0x2fcd06:0x1+this[_0x565c95(0x445)]*_0x424140+this[_0x565c95(0x1dc)]*_0x2a0b3f*_0x2fcd06;if(_0x5982a9<=EPSLN)return null;_0x5982a9=Math['sqrt'](0x2/_0x5982a9),_0x25600e=_0x5982a9*_0x2a0b3f*Math['sin'](_0x352879),_0x5982a9*=this['mode']===this['EQUIT']?_0x424140:this[_0x565c95(0x1dc)]*_0x424140-this[_0x565c95(_0x1cd647._0x476ab2)]*_0x2a0b3f*_0x2fcd06;}else{if(this['mode']===this[_0x565c95(_0x1cd647._0x6c2011)]||this['mode']===this['S_POLE']){this[_0x565c95(_0x1cd647._0x4f2a45)]===this['N_POLE']&&(_0x2fcd06=-_0x2fcd06);if(Math['abs'](_0x535d13+this['lat0'])<EPSLN)return null;_0x5982a9=FORTPI-_0x535d13*0.5,_0x5982a9=0x2*(this[_0x565c95(_0x1cd647._0x7e454a)]===this['S_POLE']?Math['cos'](_0x5982a9):Math[_0x565c95(0xdef)](_0x5982a9)),_0x25600e=_0x5982a9*Math['sin'](_0x352879),_0x5982a9*=_0x2fcd06;}}}else{_0x7f914f=0x0,_0x10c112=0x0,_0x2c2eb5=0x0,_0x2fcd06=Math['cos'](_0x352879),_0x1a38d4=Math['sin'](_0x352879),_0x424140=Math['sin'](_0x535d13),_0x38b0a1=qsfnz(this['e'],_0x424140);(this['mode']===this['OBLIQ']||this['mode']===this['EQUIT'])&&(_0x7f914f=_0x38b0a1/this['qp'],_0x10c112=Math['sqrt'](0x1-_0x7f914f*_0x7f914f));switch(this['mode']){case this[_0x565c95(_0x1cd647._0x2dde37)]:_0x2c2eb5=0x1+this['sinb1']*_0x7f914f+this['cosb1']*_0x10c112*_0x2fcd06;break;case this[_0x565c95(0x28f)]:_0x2c2eb5=0x1+_0x10c112*_0x2fcd06;break;case this['N_POLE']:_0x2c2eb5=HALF_PI+_0x535d13,_0x38b0a1=this['qp']-_0x38b0a1;break;case this['S_POLE']:_0x2c2eb5=_0x535d13-HALF_PI,_0x38b0a1=this['qp']+_0x38b0a1;break;}if(Math['abs'](_0x2c2eb5)<EPSLN)return null;switch(this[_0x565c95(0xef7)]){case this['OBLIQ']:case this['EQUIT']:_0x2c2eb5=Math['sqrt'](0x2/_0x2c2eb5);this['mode']===this['OBLIQ']?_0x5982a9=this['ymf']*_0x2c2eb5*(this['cosb1']*_0x7f914f-this[_0x565c95(_0x1cd647._0x3a243d)]*_0x10c112*_0x2fcd06):_0x5982a9=(_0x2c2eb5=Math['sqrt'](0x2/(0x1+_0x10c112*_0x2fcd06)))*_0x7f914f*this['ymf'];_0x25600e=this['xmf']*_0x2c2eb5*_0x10c112*_0x1a38d4;break;case this['N_POLE']:case this['S_POLE']:_0x38b0a1>=0x0?(_0x25600e=(_0x2c2eb5=Math[_0x565c95(_0x1cd647._0x26f92a)](_0x38b0a1))*_0x1a38d4,_0x5982a9=_0x2fcd06*(this['mode']===this['S_POLE']?_0x2c2eb5:-_0x2c2eb5)):_0x25600e=_0x5982a9=0x0;break;}}return _0xbb4c1c['x']=this['a']*_0x25600e+this['x0'],_0xbb4c1c['y']=this['a']*_0x5982a9+this['y0'],_0xbb4c1c;}function inverse$i(_0x3e5b47){const _0x2ad290={_0x575cc9:0xeec,_0x55789b:0xef7,_0x42da27:0xef7,_0x58f644:0x76b,_0x31d389:0x9cb,_0x455ea0:0xd3,_0x3cbee5:0xef7,_0x14b281:0x5f5,_0x3375d2:0xe3},_0x24953a=_0x35a251;_0x3e5b47['x']-=this['x0'],_0x3e5b47['y']-=this['y0'];var _0x469a5f=_0x3e5b47['x']/this['a'],_0x5a2385=_0x3e5b47['y']/this['a'],_0x5b4c39,_0x30d336,_0x58afa2,_0x1eb296,_0x5976fe,_0xd7707a,_0x453b2a;if(this['sphere']){var _0x59dc94=0x0,_0x2a1bb3,_0x918a96=0x0;_0x2a1bb3=Math['sqrt'](_0x469a5f*_0x469a5f+_0x5a2385*_0x5a2385),_0x30d336=_0x2a1bb3*0.5;if(_0x30d336>0x1)return null;_0x30d336=0x2*Math[_0x24953a(0x2bf)](_0x30d336);(this['mode']===this['OBLIQ']||this['mode']===this[_0x24953a(0x28f)])&&(_0x918a96=Math['sin'](_0x30d336),_0x59dc94=Math[_0x24953a(_0x2ad290._0x575cc9)](_0x30d336));switch(this[_0x24953a(0xef7)]){case this['EQUIT']:_0x30d336=Math['abs'](_0x2a1bb3)<=EPSLN?0x0:Math['asin'](_0x5a2385*_0x918a96/_0x2a1bb3),_0x469a5f*=_0x918a96,_0x5a2385=_0x59dc94*_0x2a1bb3;break;case this['OBLIQ']:_0x30d336=Math['abs'](_0x2a1bb3)<=EPSLN?this[_0x24953a(0xe40)]:Math['asin'](_0x59dc94*this['sinph0']+_0x5a2385*_0x918a96*this['cosph0']/_0x2a1bb3),_0x469a5f*=_0x918a96*this[_0x24953a(0x1dc)],_0x5a2385=(_0x59dc94-Math['sin'](_0x30d336)*this['sinph0'])*_0x2a1bb3;break;case this['N_POLE']:_0x5a2385=-_0x5a2385,_0x30d336=HALF_PI-_0x30d336;break;case this['S_POLE']:_0x30d336-=HALF_PI;break;}_0x5b4c39=_0x5a2385===0x0&&(this[_0x24953a(_0x2ad290._0x55789b)]===this['EQUIT']||this[_0x24953a(_0x2ad290._0x55789b)]===this['OBLIQ'])?0x0:Math['atan2'](_0x469a5f,_0x5a2385);}else{_0x453b2a=0x0;if(this[_0x24953a(_0x2ad290._0x42da27)]===this['OBLIQ']||this['mode']===this['EQUIT']){_0x469a5f/=this['dd'],_0x5a2385*=this['dd'],_0xd7707a=Math[_0x24953a(_0x2ad290._0x58f644)](_0x469a5f*_0x469a5f+_0x5a2385*_0x5a2385);if(_0xd7707a<EPSLN)return _0x3e5b47['x']=this[_0x24953a(_0x2ad290._0x31d389)],_0x3e5b47['y']=this['lat0'],_0x3e5b47;_0x1eb296=0x2*Math['asin'](0.5*_0xd7707a/this['rq']),_0x58afa2=Math['cos'](_0x1eb296),_0x469a5f*=_0x1eb296=Math['sin'](_0x1eb296),this[_0x24953a(0xef7)]===this['OBLIQ']?(_0x453b2a=_0x58afa2*this[_0x24953a(0x28a)]+_0x5a2385*_0x1eb296*this['cosb1']/_0xd7707a,_0x5976fe=this['qp']*_0x453b2a,_0x5a2385=_0xd7707a*this['cosb1']*_0x58afa2-_0x5a2385*this['sinb1']*_0x1eb296):(_0x453b2a=_0x5a2385*_0x1eb296/_0xd7707a,_0x5976fe=this['qp']*_0x453b2a,_0x5a2385=_0xd7707a*_0x58afa2);}else{if(this[_0x24953a(0xef7)]===this['N_POLE']||this[_0x24953a(0xef7)]===this[_0x24953a(_0x2ad290._0x455ea0)]){this[_0x24953a(_0x2ad290._0x3cbee5)]===this[_0x24953a(0xee4)]&&(_0x5a2385=-_0x5a2385);_0x5976fe=_0x469a5f*_0x469a5f+_0x5a2385*_0x5a2385;if(!_0x5976fe)return _0x3e5b47['x']=this['long0'],_0x3e5b47['y']=this['lat0'],_0x3e5b47;_0x453b2a=0x1-_0x5976fe/this['qp'],this['mode']===this[_0x24953a(0xd3)]&&(_0x453b2a=-_0x453b2a);}}_0x5b4c39=Math[_0x24953a(_0x2ad290._0x14b281)](_0x469a5f,_0x5a2385),_0x30d336=authlat(Math[_0x24953a(0x2bf)](_0x453b2a),this[_0x24953a(_0x2ad290._0x3375d2)]);}return _0x3e5b47['x']=adjust_lon(this['long0']+_0x5b4c39),_0x3e5b47['y']=_0x30d336,_0x3e5b47;}var P00=0.3333333333333333,P01=0.17222222222222222,P02=0.10257936507936508,P10=0.06388888888888888,P11=0.0664021164021164,P20=0.016415012942191543;function authset(_0x53cd31){var _0x47a4ee,_0x290615=[];return _0x290615[0x0]=_0x53cd31*P00,_0x47a4ee=_0x53cd31*_0x53cd31,_0x290615[0x0]+=_0x47a4ee*P01,_0x290615[0x1]=_0x47a4ee*P10,_0x47a4ee*=_0x53cd31,_0x290615[0x0]+=_0x47a4ee*P02,_0x290615[0x1]+=_0x47a4ee*P11,_0x290615[0x2]=_0x47a4ee*P20,_0x290615;}function authlat(_0x54bf68,_0x8f8f23){var _0x5b61ef=_0x54bf68+_0x54bf68;return _0x54bf68+_0x8f8f23[0x0]*Math['sin'](_0x5b61ef)+_0x8f8f23[0x1]*Math['sin'](_0x5b61ef+_0x5b61ef)+_0x8f8f23[0x2]*Math['sin'](_0x5b61ef+_0x5b61ef+_0x5b61ef);}var names$i=['Lambert\x20Azimuthal\x20Equal\x20Area','Lambert_Azimuthal_Equal_Area','laea'],laea={'init':init$i,'forward':forward$i,'inverse':inverse$i,'names':names$i,'S_POLE':S_POLE,'N_POLE':N_POLE,'EQUIT':EQUIT,'OBLIQ':OBLIQ};function asinz(_0x330ebb){return Math['abs'](_0x330ebb)>0x1&&(_0x330ebb=_0x330ebb>0x1?0x1:-0x1),Math['asin'](_0x330ebb);}function init$h(){const _0x5a3585={_0xb408a0:0xa87,_0x44f7d2:0x6c9,_0x42e154:0x74c,_0x30f17b:0xe40,_0x550910:0x765},_0x4b2c7e=_0x35a251;if(Math['abs'](this['lat1']+this['lat2'])<EPSLN)return;this['temp']=this['b']/this['a'],this['es']=0x1-Math['pow'](this['temp'],0x2),this['e3']=Math['sqrt'](this['es']),this[_0x4b2c7e(0xa87)]=Math['sin'](this['lat1']),this[_0x4b2c7e(0x74c)]=Math['cos'](this['lat1']),this['t1']=this[_0x4b2c7e(_0x5a3585._0xb408a0)],this[_0x4b2c7e(0x6e4)]=this['sin_po'],this['ms1']=msfnz(this['e3'],this['sin_po'],this[_0x4b2c7e(0x74c)]),this[_0x4b2c7e(_0x5a3585._0x44f7d2)]=qsfnz(this['e3'],this['sin_po']),this['sin_po']=Math['sin'](this['lat2']),this[_0x4b2c7e(0x74c)]=Math['cos'](this[_0x4b2c7e(0x290)]),this['t2']=this['sin_po'],this['ms2']=msfnz(this['e3'],this['sin_po'],this[_0x4b2c7e(_0x5a3585._0x42e154)]),this[_0x4b2c7e(0x938)]=qsfnz(this['e3'],this['sin_po']),this[_0x4b2c7e(_0x5a3585._0xb408a0)]=Math[_0x4b2c7e(0xdef)](this['lat0']),this['cos_po']=Math['cos'](this[_0x4b2c7e(_0x5a3585._0x30f17b)]),this['t3']=this['sin_po'],this[_0x4b2c7e(0x63b)]=qsfnz(this['e3'],this['sin_po']),Math[_0x4b2c7e(0x405)](this['lat1']-this[_0x4b2c7e(0x290)])>EPSLN?this['ns0']=(this['ms1']*this['ms1']-this['ms2']*this['ms2'])/(this['qs2']-this[_0x4b2c7e(0x6c9)]):this[_0x4b2c7e(0xbd0)]=this[_0x4b2c7e(0x6e4)],this['c']=this[_0x4b2c7e(_0x5a3585._0x550910)]*this['ms1']+this['ns0']*this['qs1'],this['rh']=this['a']*Math['sqrt'](this['c']-this['ns0']*this['qs0'])/this['ns0'];}function forward$h(_0x4e9237){const _0x2ce64b={_0x3a1212:0x54c,_0x39f5c6:0x66b,_0x1c31bc:0xbd0},_0xed6255=_0x35a251;var _0x5db7a1=_0x4e9237['x'],_0x499440=_0x4e9237['y'];this['sin_phi']=Math[_0xed6255(0xdef)](_0x499440),this[_0xed6255(_0x2ce64b._0x3a1212)]=Math['cos'](_0x499440);var _0x179d70=qsfnz(this['e3'],this[_0xed6255(_0x2ce64b._0x39f5c6)]),_0x5744c0=this['a']*Math['sqrt'](this['c']-this[_0xed6255(_0x2ce64b._0x1c31bc)]*_0x179d70)/this[_0xed6255(0xbd0)],_0x2a13ee=this['ns0']*adjust_lon(_0x5db7a1-this['long0']),_0x136c3e=_0x5744c0*Math['sin'](_0x2a13ee)+this['x0'],_0x1a5ff4=this['rh']-_0x5744c0*Math['cos'](_0x2a13ee)+this['y0'];return _0x4e9237['x']=_0x136c3e,_0x4e9237['y']=_0x1a5ff4,_0x4e9237;}function inverse$h(_0x3e466e){var _0x3cedb9,_0x4e5f01,_0x5ac306,_0x29dfc6,_0x510bb7,_0x17444a;return _0x3e466e['x']-=this['x0'],_0x3e466e['y']=this['rh']-_0x3e466e['y']+this['y0'],this['ns0']>=0x0?(_0x3cedb9=Math['sqrt'](_0x3e466e['x']*_0x3e466e['x']+_0x3e466e['y']*_0x3e466e['y']),_0x5ac306=0x1):(_0x3cedb9=-Math['sqrt'](_0x3e466e['x']*_0x3e466e['x']+_0x3e466e['y']*_0x3e466e['y']),_0x5ac306=-0x1),_0x29dfc6=0x0,_0x3cedb9!==0x0&&(_0x29dfc6=Math['atan2'](_0x5ac306*_0x3e466e['x'],_0x5ac306*_0x3e466e['y'])),_0x5ac306=_0x3cedb9*this['ns0']/this['a'],this['sphere']?_0x17444a=Math['asin']((this['c']-_0x5ac306*_0x5ac306)/(0x2*this['ns0'])):(_0x4e5f01=(this['c']-_0x5ac306*_0x5ac306)/this['ns0'],_0x17444a=this['phi1z'](this['e3'],_0x4e5f01)),_0x510bb7=adjust_lon(_0x29dfc6/this['ns0']+this['long0']),_0x3e466e['x']=_0x510bb7,_0x3e466e['y']=_0x17444a,_0x3e466e;}function phi1z(_0x2b9bc2,_0x31e487){const _0x35fc49={_0x296ec3:0xeec,_0xd1c8be:0x405},_0xba894a=_0x35a251;var _0x4b28d3,_0x41bd30,_0x299629,_0x4f96c7,_0x4042ff,_0x40a362=asinz(0.5*_0x31e487);if(_0x2b9bc2<EPSLN)return _0x40a362;var _0x4b393b=_0x2b9bc2*_0x2b9bc2;for(var _0x5b0168=0x1;_0x5b0168<=0x19;_0x5b0168++){_0x4b28d3=Math['sin'](_0x40a362),_0x41bd30=Math[_0xba894a(_0x35fc49._0x296ec3)](_0x40a362),_0x299629=_0x2b9bc2*_0x4b28d3,_0x4f96c7=0x1-_0x299629*_0x299629,_0x4042ff=0.5*_0x4f96c7*_0x4f96c7/_0x41bd30*(_0x31e487/(0x1-_0x4b393b)-_0x4b28d3/_0x4f96c7+0.5/_0x2b9bc2*Math['log']((0x1-_0x299629)/(0x1+_0x299629))),_0x40a362=_0x40a362+_0x4042ff;if(Math[_0xba894a(_0x35fc49._0xd1c8be)](_0x4042ff)<=1e-7)return _0x40a362;}return null;}var names$h=['Albers_Conic_Equal_Area','Albers',_0x35a251(0xe9a)],aea={'init':init$h,'forward':forward$h,'inverse':inverse$h,'names':names$h,'phi1z':phi1z};function init$g(){const _0x34c2c7={_0xa0226b:0xdef,_0x515021:0xe40},_0x2fb0d8=_0x35a251;this['sin_p14']=Math[_0x2fb0d8(_0x34c2c7._0xa0226b)](this[_0x2fb0d8(_0x34c2c7._0x515021)]),this['cos_p14']=Math['cos'](this['lat0']),this[_0x2fb0d8(0x9d1)]=0x3e8*this['a'],this['rc']=0x1;}function forward$g(_0x5d0db5){const _0x5d2718=_0x35a251;var _0x3473ca,_0x23bfe1,_0x20e633,_0x5e2810,_0x2b18a3,_0x18eec1,_0x51df59,_0x529fb8,_0x42d7cb=_0x5d0db5['x'],_0x15cfa2=_0x5d0db5['y'];return _0x20e633=adjust_lon(_0x42d7cb-this['long0']),_0x3473ca=Math['sin'](_0x15cfa2),_0x23bfe1=Math['cos'](_0x15cfa2),_0x5e2810=Math['cos'](_0x20e633),_0x18eec1=this['sin_p14']*_0x3473ca+this[_0x5d2718(0x2fd)]*_0x23bfe1*_0x5e2810,_0x2b18a3=0x1,_0x18eec1>0x0||Math['abs'](_0x18eec1)<=EPSLN?(_0x51df59=this['x0']+this['a']*_0x2b18a3*_0x23bfe1*Math['sin'](_0x20e633)/_0x18eec1,_0x529fb8=this['y0']+this['a']*_0x2b18a3*(this[_0x5d2718(0x2fd)]*_0x3473ca-this['sin_p14']*_0x23bfe1*_0x5e2810)/_0x18eec1):(_0x51df59=this['x0']+this[_0x5d2718(0x9d1)]*_0x23bfe1*Math[_0x5d2718(0xdef)](_0x20e633),_0x529fb8=this['y0']+this['infinity_dist']*(this['cos_p14']*_0x3473ca-this['sin_p14']*_0x23bfe1*_0x5e2810)),_0x5d0db5['x']=_0x51df59,_0x5d0db5['y']=_0x529fb8,_0x5d0db5;}function inverse$g(_0x5b3d29){const _0x113201=_0x35a251;var _0x53ddcb,_0x304f49,_0x11863c,_0x17b22b,_0x980c26,_0x1d0bc5;return _0x5b3d29['x']=(_0x5b3d29['x']-this['x0'])/this['a'],_0x5b3d29['y']=(_0x5b3d29['y']-this['y0'])/this['a'],_0x5b3d29['x']/=this['k0'],_0x5b3d29['y']/=this['k0'],(_0x53ddcb=Math['sqrt'](_0x5b3d29['x']*_0x5b3d29['x']+_0x5b3d29['y']*_0x5b3d29['y']))?(_0x17b22b=Math['atan2'](_0x53ddcb,this['rc']),_0x304f49=Math['sin'](_0x17b22b),_0x11863c=Math['cos'](_0x17b22b),_0x1d0bc5=asinz(_0x11863c*this['sin_p14']+_0x5b3d29['y']*_0x304f49*this[_0x113201(0x2fd)]/_0x53ddcb),_0x980c26=Math['atan2'](_0x5b3d29['x']*_0x304f49,_0x53ddcb*this['cos_p14']*_0x11863c-_0x5b3d29['y']*this[_0x113201(0x6b1)]*_0x304f49),_0x980c26=adjust_lon(this['long0']+_0x980c26)):(_0x1d0bc5=this['phic0'],_0x980c26=0x0),_0x5b3d29['x']=_0x980c26,_0x5b3d29['y']=_0x1d0bc5,_0x5b3d29;}var names$g=[_0x35a251(0x750)],gnom={'init':init$g,'forward':forward$g,'inverse':inverse$g,'names':names$g};function iqsfnz(_0x528b11,_0x5141b6){const _0x54b97d=_0x35a251;var _0x48ae4f=0x1-(0x1-_0x528b11*_0x528b11)/(0x2*_0x528b11)*Math['log']((0x1-_0x528b11)/(0x1+_0x528b11));if(Math[_0x54b97d(0x405)](Math['abs'](_0x5141b6)-_0x48ae4f)<0.000001)return _0x5141b6<0x0?-0x1*HALF_PI:HALF_PI;var _0x397228=Math['asin'](0.5*_0x5141b6),_0x2b15d4,_0x49aa8a,_0xbaf104,_0x13bd40;for(var _0x496eb9=0x0;_0x496eb9<0x1e;_0x496eb9++){_0x49aa8a=Math['sin'](_0x397228),_0xbaf104=Math[_0x54b97d(0xeec)](_0x397228),_0x13bd40=_0x528b11*_0x49aa8a,_0x2b15d4=Math[_0x54b97d(0xda4)](0x1-_0x13bd40*_0x13bd40,0x2)/(0x2*_0xbaf104)*(_0x5141b6/(0x1-_0x528b11*_0x528b11)-_0x49aa8a/(0x1-_0x13bd40*_0x13bd40)+0.5/_0x528b11*Math[_0x54b97d(0x3a8)]((0x1-_0x13bd40)/(0x1+_0x13bd40))),_0x397228+=_0x2b15d4;if(Math['abs'](_0x2b15d4)<=1e-10)return _0x397228;}return NaN;}function init$f(){const _0x5aff16={_0x497d95:0x8e9},_0x1f0aa3=_0x35a251;!this['sphere']&&(this['k0']=msfnz(this['e'],Math['sin'](this[_0x1f0aa3(_0x5aff16._0x497d95)]),Math['cos'](this['lat_ts'])));}function forward$f(_0x1861e4){const _0x19c1b4={_0xeb16bc:0x8e9},_0x40ccbf=_0x35a251;var _0x4db62e=_0x1861e4['x'],_0x20ba95=_0x1861e4['y'],_0x16d3f2,_0x548293,_0x4697e2=adjust_lon(_0x4db62e-this['long0']);if(this['sphere'])_0x16d3f2=this['x0']+this['a']*_0x4697e2*Math[_0x40ccbf(0xeec)](this[_0x40ccbf(_0x19c1b4._0xeb16bc)]),_0x548293=this['y0']+this['a']*Math['sin'](_0x20ba95)/Math['cos'](this[_0x40ccbf(_0x19c1b4._0xeb16bc)]);else{var _0x149f0f=qsfnz(this['e'],Math['sin'](_0x20ba95));_0x16d3f2=this['x0']+this['a']*this['k0']*_0x4697e2,_0x548293=this['y0']+this['a']*_0x149f0f*0.5/this['k0'];}return _0x1861e4['x']=_0x16d3f2,_0x1861e4['y']=_0x548293,_0x1861e4;}function inverse$f(_0x49a320){_0x49a320['x']-=this['x0'],_0x49a320['y']-=this['y0'];var _0x3b3fdf,_0x17c58f;return this['sphere']?(_0x3b3fdf=adjust_lon(this['long0']+_0x49a320['x']/this['a']/Math['cos'](this['lat_ts'])),_0x17c58f=Math['asin'](_0x49a320['y']/this['a']*Math['cos'](this['lat_ts']))):(_0x17c58f=iqsfnz(this['e'],0x2*_0x49a320['y']*this['k0']/this['a']),_0x3b3fdf=adjust_lon(this['long0']+_0x49a320['x']/(this['a']*this['k0']))),_0x49a320['x']=_0x3b3fdf,_0x49a320['y']=_0x17c58f,_0x49a320;}var names$f=['cea'],cea={'init':init$f,'forward':forward$f,'inverse':inverse$f,'names':names$f};function init$e(){const _0x1d6626={_0x4c0d6e:0xe40,_0x23cc14:0x9cb,_0x3df0a9:0x8e9},_0x6b7d00=_0x35a251;this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this['lat0']=this[_0x6b7d00(_0x1d6626._0x4c0d6e)]||0x0,this[_0x6b7d00(_0x1d6626._0x23cc14)]=this['long0']||0x0,this['lat_ts']=this['lat_ts']||0x0,this[_0x6b7d00(0x732)]=this['title']||'Equidistant\x20Cylindrical\x20(Plate\x20Carre)',this['rc']=Math['cos'](this[_0x6b7d00(_0x1d6626._0x3df0a9)]);}function forward$e(_0x3f506b){var _0xac7209=_0x3f506b['x'],_0x509e2e=_0x3f506b['y'],_0x34c67e=adjust_lon(_0xac7209-this['long0']),_0x3ce5d4=adjust_lat(_0x509e2e-this['lat0']);return _0x3f506b['x']=this['x0']+this['a']*_0x34c67e*this['rc'],_0x3f506b['y']=this['y0']+this['a']*_0x3ce5d4,_0x3f506b;}function inverse$e(_0x173d58){var _0x55f3bd=_0x173d58['x'],_0x1836bc=_0x173d58['y'];return _0x173d58['x']=adjust_lon(this['long0']+(_0x55f3bd-this['x0'])/(this['a']*this['rc'])),_0x173d58['y']=adjust_lat(this['lat0']+(_0x1836bc-this['y0'])/this['a']),_0x173d58;}var names$e=['Equirectangular','Equidistant_Cylindrical',_0x35a251(0xaf3)],eqc={'init':init$e,'forward':forward$e,'inverse':inverse$e,'names':names$e},MAX_ITER$1=0x14;function init$d(){const _0x2d89b6={_0x3de6bf:0xda4,_0x4c2cdb:0x378,_0x4ee4dd:0x76b},_0x5cee38=_0x35a251;this['temp']=this['b']/this['a'],this['es']=0x1-Math[_0x5cee38(_0x2d89b6._0x3de6bf)](this[_0x5cee38(_0x2d89b6._0x4c2cdb)],0x2),this['e']=Math[_0x5cee38(_0x2d89b6._0x4ee4dd)](this['es']),this['e0']=e0fn(this['es']),this['e1']=e1fn(this['es']),this['e2']=e2fn(this['es']),this['e3']=e3fn(this['es']),this[_0x5cee38(0x368)]=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat0']);}function forward$d(_0x36a7b9){const _0x372a37={_0x4fe90a:0xdef},_0x51e316=_0x35a251;var _0xec6e9c=_0x36a7b9['x'],_0x3e1dbe=_0x36a7b9['y'],_0x41447a,_0x3b34d3,_0x183dab,_0x101afe=adjust_lon(_0xec6e9c-this['long0']);_0x183dab=_0x101afe*Math['sin'](_0x3e1dbe);if(this['sphere'])Math['abs'](_0x3e1dbe)<=EPSLN?(_0x41447a=this['a']*_0x101afe,_0x3b34d3=-0x1*this['a']*this['lat0']):(_0x41447a=this['a']*Math['sin'](_0x183dab)/Math['tan'](_0x3e1dbe),_0x3b34d3=this['a']*(adjust_lat(_0x3e1dbe-this['lat0'])+(0x1-Math['cos'](_0x183dab))/Math[_0x51e316(0x9b5)](_0x3e1dbe)));else{if(Math['abs'](_0x3e1dbe)<=EPSLN)_0x41447a=this['a']*_0x101afe,_0x3b34d3=-0x1*this[_0x51e316(0x368)];else{var _0x13dffa=gN(this['a'],this['e'],Math[_0x51e316(_0x372a37._0x4fe90a)](_0x3e1dbe))/Math['tan'](_0x3e1dbe);_0x41447a=_0x13dffa*Math['sin'](_0x183dab),_0x3b34d3=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0x3e1dbe)-this['ml0']+_0x13dffa*(0x1-Math['cos'](_0x183dab));}}return _0x36a7b9['x']=_0x41447a+this['x0'],_0x36a7b9['y']=_0x3b34d3+this['y0'],_0x36a7b9;}function inverse$d(_0x4d2f0b){const _0x16bd65={_0x26a848:0xdef,_0xd80c2a:0x76b},_0x20aed4=_0x35a251;var _0x498042,_0x4411d0,_0x1d980f,_0x49e406,_0x18f68d,_0x4b4ea4,_0x4cabf4,_0xa0a6b0,_0x287f7d;_0x1d980f=_0x4d2f0b['x']-this['x0'],_0x49e406=_0x4d2f0b['y']-this['y0'];if(this['sphere']){if(Math['abs'](_0x49e406+this['a']*this[_0x20aed4(0xe40)])<=EPSLN)_0x498042=adjust_lon(_0x1d980f/this['a']+this['long0']),_0x4411d0=0x0;else{_0x4b4ea4=this['lat0']+_0x49e406/this['a'],_0x4cabf4=_0x1d980f*_0x1d980f/this['a']/this['a']+_0x4b4ea4*_0x4b4ea4,_0xa0a6b0=_0x4b4ea4;var _0x45a547;for(_0x18f68d=MAX_ITER$1;_0x18f68d;--_0x18f68d){_0x45a547=Math['tan'](_0xa0a6b0),_0x287f7d=-0x1*(_0x4b4ea4*(_0xa0a6b0*_0x45a547+0x1)-_0xa0a6b0-0.5*(_0xa0a6b0*_0xa0a6b0+_0x4cabf4)*_0x45a547)/((_0xa0a6b0-_0x4b4ea4)/_0x45a547-0x1),_0xa0a6b0+=_0x287f7d;if(Math['abs'](_0x287f7d)<=EPSLN){_0x4411d0=_0xa0a6b0;break;}}_0x498042=adjust_lon(this['long0']+Math['asin'](_0x1d980f*Math[_0x20aed4(0x9b5)](_0xa0a6b0)/this['a'])/Math['sin'](_0x4411d0));}}else{if(Math['abs'](_0x49e406+this['ml0'])<=EPSLN)_0x4411d0=0x0,_0x498042=adjust_lon(this['long0']+_0x1d980f/this['a']);else{_0x4b4ea4=(this[_0x20aed4(0x368)]+_0x49e406)/this['a'],_0x4cabf4=_0x1d980f*_0x1d980f/this['a']/this['a']+_0x4b4ea4*_0x4b4ea4,_0xa0a6b0=_0x4b4ea4;var _0x150c23,_0xc38ccc,_0x4471e9,_0x271a98,_0x20f91f;for(_0x18f68d=MAX_ITER$1;_0x18f68d;--_0x18f68d){_0x20f91f=this['e']*Math[_0x20aed4(_0x16bd65._0x26a848)](_0xa0a6b0),_0x150c23=Math['sqrt'](0x1-_0x20f91f*_0x20f91f)*Math['tan'](_0xa0a6b0),_0xc38ccc=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0xa0a6b0),_0x4471e9=this['e0']-0x2*this['e1']*Math['cos'](0x2*_0xa0a6b0)+0x4*this['e2']*Math['cos'](0x4*_0xa0a6b0)-0x6*this['e3']*Math['cos'](0x6*_0xa0a6b0),_0x271a98=_0xc38ccc/this['a'],_0x287f7d=(_0x4b4ea4*(_0x150c23*_0x271a98+0x1)-_0x271a98-0.5*_0x150c23*(_0x271a98*_0x271a98+_0x4cabf4))/(this['es']*Math['sin'](0x2*_0xa0a6b0)*(_0x271a98*_0x271a98+_0x4cabf4-0x2*_0x4b4ea4*_0x271a98)/(0x4*_0x150c23)+(_0x4b4ea4-_0x271a98)*(_0x150c23*_0x4471e9-0x2/Math['sin'](0x2*_0xa0a6b0))-_0x4471e9),_0xa0a6b0-=_0x287f7d;if(Math['abs'](_0x287f7d)<=EPSLN){_0x4411d0=_0xa0a6b0;break;}}_0x150c23=Math[_0x20aed4(_0x16bd65._0xd80c2a)](0x1-this['es']*Math['pow'](Math['sin'](_0x4411d0),0x2))*Math[_0x20aed4(0x9b5)](_0x4411d0),_0x498042=adjust_lon(this['long0']+Math['asin'](_0x1d980f*_0x150c23/this['a'])/Math['sin'](_0x4411d0));}}return _0x4d2f0b['x']=_0x498042,_0x4d2f0b['y']=_0x4411d0,_0x4d2f0b;}var names$d=[_0x35a251(0xd3d),'poly'],poly={'init':init$d,'forward':forward$d,'inverse':inverse$d,'names':names$d};function init$c(){const _0x3a7a79={_0x2c96c6:0x546,_0x5dfff7:0xd6c,_0x486814:0x422,_0x58113a:0xfb},_0x41b71b=_0x35a251;this['A']=[],this['A'][0x1]=0.6399175073,this['A'][0x2]=-0.1358797613,this['A'][0x3]=0.063294409,this['A'][0x4]=-0.02526853,this['A'][0x5]=0.0117879,this['A'][0x6]=-0.0055161,this['A'][0x7]=0.0026906,this['A'][0x8]=-0.001333,this['A'][0x9]=0.00067,this['A'][0xa]=-0.00034,this['B_re']=[],this['B_im']=[],this['B_re'][0x1]=0.7557853228,this['B_im'][0x1]=0x0,this['B_re'][0x2]=0.249204646,this[_0x41b71b(0x546)][0x2]=0.003371507,this['B_re'][0x3]=-0.001541739,this[_0x41b71b(_0x3a7a79._0x2c96c6)][0x3]=0.04105856,this['B_re'][0x4]=-0.10162907,this['B_im'][0x4]=0.01727609,this['B_re'][0x5]=-0.26623489,this['B_im'][0x5]=-0.36249218,this[_0x41b71b(_0x3a7a79._0x5dfff7)][0x6]=-0.6870983,this['B_im'][0x6]=-1.1651967,this['C_re']=[],this['C_im']=[],this[_0x41b71b(_0x3a7a79._0x486814)][0x1]=1.3231270439,this[_0x41b71b(0xfb)][0x1]=0x0,this['C_re'][0x2]=-0.577245789,this['C_im'][0x2]=-0.007809598,this['C_re'][0x3]=0.508307513,this[_0x41b71b(_0x3a7a79._0x58113a)][0x3]=-0.112208952,this['C_re'][0x4]=-0.15094762,this[_0x41b71b(0xfb)][0x4]=0.18200602,this['C_re'][0x5]=1.01418179,this['C_im'][0x5]=1.64497696,this[_0x41b71b(0x422)][0x6]=1.9660549,this['C_im'][0x6]=2.5127645,this['D']=[],this['D'][0x1]=1.5627014243,this['D'][0x2]=0.5185406398,this['D'][0x3]=-0.03333098,this['D'][0x4]=-0.1052906,this['D'][0x5]=-0.0368594,this['D'][0x6]=0.007317,this['D'][0x7]=0.0122,this['D'][0x8]=0.00394,this['D'][0x9]=-0.0013;}function forward$c(_0xfaa4a7){const _0xd7d1d={_0x110cd9:0x9cb,_0x138b52:0x546},_0xa2e04d=_0x35a251;var _0x15d9fb,_0x598e9a=_0xfaa4a7['x'],_0x2254bb=_0xfaa4a7['y'],_0x70692c=_0x2254bb-this[_0xa2e04d(0xe40)],_0x5768c1=_0x598e9a-this[_0xa2e04d(_0xd7d1d._0x110cd9)],_0x16a791=_0x70692c/SEC_TO_RAD*0.00001,_0x4555a8=_0x5768c1,_0x2a8cbe=0x1,_0x22d7f3=0x0;for(_0x15d9fb=0x1;_0x15d9fb<=0xa;_0x15d9fb++){_0x2a8cbe=_0x2a8cbe*_0x16a791,_0x22d7f3=_0x22d7f3+this['A'][_0x15d9fb]*_0x2a8cbe;}var _0x9faea1=_0x22d7f3,_0x6776f4=_0x4555a8,_0x5c0a2c=0x1,_0x455ff7=0x0,_0x5bf47,_0x388d9c,_0x59fd26=0x0,_0x18638a=0x0;for(_0x15d9fb=0x1;_0x15d9fb<=0x6;_0x15d9fb++){_0x5bf47=_0x5c0a2c*_0x9faea1-_0x455ff7*_0x6776f4,_0x388d9c=_0x455ff7*_0x9faea1+_0x5c0a2c*_0x6776f4,_0x5c0a2c=_0x5bf47,_0x455ff7=_0x388d9c,_0x59fd26=_0x59fd26+this['B_re'][_0x15d9fb]*_0x5c0a2c-this['B_im'][_0x15d9fb]*_0x455ff7,_0x18638a=_0x18638a+this[_0xa2e04d(_0xd7d1d._0x138b52)][_0x15d9fb]*_0x5c0a2c+this['B_re'][_0x15d9fb]*_0x455ff7;}return _0xfaa4a7['x']=_0x18638a*this['a']+this['x0'],_0xfaa4a7['y']=_0x59fd26*this['a']+this['y0'],_0xfaa4a7;}function inverse$c(_0x58c368){const _0x4b03b3={_0x111a8d:0xfb,_0x42654b:0xd6c,_0x18ab42:0x546},_0x269815=_0x35a251;var _0x8a0ee6,_0xf0ee11=_0x58c368['x'],_0x20c1f0=_0x58c368['y'],_0x3ccef5=_0xf0ee11-this['x0'],_0x2d35f2=_0x20c1f0-this['y0'],_0x114295=_0x2d35f2/this['a'],_0x51cd4d=_0x3ccef5/this['a'],_0x4b7926=0x1,_0x5e9154=0x0,_0x42c86e,_0x22bf2f,_0x4b9f31=0x0,_0x217448=0x0;for(_0x8a0ee6=0x1;_0x8a0ee6<=0x6;_0x8a0ee6++){_0x42c86e=_0x4b7926*_0x114295-_0x5e9154*_0x51cd4d,_0x22bf2f=_0x5e9154*_0x114295+_0x4b7926*_0x51cd4d,_0x4b7926=_0x42c86e,_0x5e9154=_0x22bf2f,_0x4b9f31=_0x4b9f31+this['C_re'][_0x8a0ee6]*_0x4b7926-this['C_im'][_0x8a0ee6]*_0x5e9154,_0x217448=_0x217448+this[_0x269815(_0x4b03b3._0x111a8d)][_0x8a0ee6]*_0x4b7926+this['C_re'][_0x8a0ee6]*_0x5e9154;}for(var _0x3282dc=0x0;_0x3282dc<this['iterations'];_0x3282dc++){var _0xca6af5=_0x4b9f31,_0x5f1ad9=_0x217448,_0x5512a9,_0x2b2d43,_0x269a7f=_0x114295,_0x487868=_0x51cd4d;for(_0x8a0ee6=0x2;_0x8a0ee6<=0x6;_0x8a0ee6++){_0x5512a9=_0xca6af5*_0x4b9f31-_0x5f1ad9*_0x217448,_0x2b2d43=_0x5f1ad9*_0x4b9f31+_0xca6af5*_0x217448,_0xca6af5=_0x5512a9,_0x5f1ad9=_0x2b2d43,_0x269a7f=_0x269a7f+(_0x8a0ee6-0x1)*(this['B_re'][_0x8a0ee6]*_0xca6af5-this['B_im'][_0x8a0ee6]*_0x5f1ad9),_0x487868=_0x487868+(_0x8a0ee6-0x1)*(this['B_im'][_0x8a0ee6]*_0xca6af5+this[_0x269815(_0x4b03b3._0x42654b)][_0x8a0ee6]*_0x5f1ad9);}_0xca6af5=0x1,_0x5f1ad9=0x0;var _0x249328=this['B_re'][0x1],_0xb7d5f=this['B_im'][0x1];for(_0x8a0ee6=0x2;_0x8a0ee6<=0x6;_0x8a0ee6++){_0x5512a9=_0xca6af5*_0x4b9f31-_0x5f1ad9*_0x217448,_0x2b2d43=_0x5f1ad9*_0x4b9f31+_0xca6af5*_0x217448,_0xca6af5=_0x5512a9,_0x5f1ad9=_0x2b2d43,_0x249328=_0x249328+_0x8a0ee6*(this['B_re'][_0x8a0ee6]*_0xca6af5-this[_0x269815(0x546)][_0x8a0ee6]*_0x5f1ad9),_0xb7d5f=_0xb7d5f+_0x8a0ee6*(this[_0x269815(_0x4b03b3._0x18ab42)][_0x8a0ee6]*_0xca6af5+this[_0x269815(0xd6c)][_0x8a0ee6]*_0x5f1ad9);}var _0x193669=_0x249328*_0x249328+_0xb7d5f*_0xb7d5f;_0x4b9f31=(_0x269a7f*_0x249328+_0x487868*_0xb7d5f)/_0x193669,_0x217448=(_0x487868*_0x249328-_0x269a7f*_0xb7d5f)/_0x193669;}var _0x5326c5=_0x4b9f31,_0x2e9d0a=_0x217448,_0x201dca=0x1,_0x1db30a=0x0;for(_0x8a0ee6=0x1;_0x8a0ee6<=0x9;_0x8a0ee6++){_0x201dca=_0x201dca*_0x5326c5,_0x1db30a=_0x1db30a+this['D'][_0x8a0ee6]*_0x201dca;}var _0x4903b7=this[_0x269815(0xe40)]+_0x1db30a*SEC_TO_RAD*0x186a0,_0x5622c8=this['long0']+_0x2e9d0a;return _0x58c368['x']=_0x5622c8,_0x58c368['y']=_0x4903b7,_0x58c368;}var names$c=['New_Zealand_Map_Grid','nzmg'],nzmg={'init':init$c,'forward':forward$c,'inverse':inverse$c,'names':names$c};function init$b(){}function forward$b(_0x22f88d){var _0x1c10d4=_0x22f88d['x'],_0x25c6f3=_0x22f88d['y'],_0x13465b=adjust_lon(_0x1c10d4-this['long0']),_0x27452e=this['x0']+this['a']*_0x13465b,_0x206a54=this['y0']+this['a']*Math['log'](Math['tan'](Math['PI']/0x4+_0x25c6f3/2.5))*1.25;return _0x22f88d['x']=_0x27452e,_0x22f88d['y']=_0x206a54,_0x22f88d;}function inverse$b(_0x1b57cd){_0x1b57cd['x']-=this['x0'],_0x1b57cd['y']-=this['y0'];var _0x4e74a2=adjust_lon(this['long0']+_0x1b57cd['x']/this['a']),_0x529d85=2.5*(Math['atan'](Math['exp'](0.8*_0x1b57cd['y']/this['a']))-Math['PI']/0x4);return _0x1b57cd['x']=_0x4e74a2,_0x1b57cd['y']=_0x529d85,_0x1b57cd;}var names$b=['Miller_Cylindrical','mill'],mill={'init':init$b,'forward':forward$b,'inverse':inverse$b,'names':names$b},MAX_ITER=0x14;function init$a(){const _0x590e32={_0x403d20:0xea2},_0x14d16f=_0x35a251;!this['sphere']?this['en']=pj_enfn(this['es']):(this['n']=0x1,this['m']=0x0,this['es']=0x0,this['C_y']=Math['sqrt']((this['m']+0x1)/this['n']),this['C_x']=this[_0x14d16f(_0x590e32._0x403d20)]/(this['m']+0x1));}function forward$a(_0x490529){const _0x66b322=_0x35a251;var _0x10ca14,_0x1072aa,_0x3a25b6=_0x490529['x'],_0x25edca=_0x490529['y'];_0x3a25b6=adjust_lon(_0x3a25b6-this['long0']);if(this['sphere']){if(!this['m'])_0x25edca=this['n']!==0x1?Math['asin'](this['n']*Math['sin'](_0x25edca)):_0x25edca;else{var _0x248fe2=this['n']*Math['sin'](_0x25edca);for(var _0x10c648=MAX_ITER;_0x10c648;--_0x10c648){var _0x1eb8e9=(this['m']*_0x25edca+Math['sin'](_0x25edca)-_0x248fe2)/(this['m']+Math[_0x66b322(0xeec)](_0x25edca));_0x25edca-=_0x1eb8e9;if(Math['abs'](_0x1eb8e9)<EPSLN)break;}}_0x10ca14=this['a']*this['C_x']*_0x3a25b6*(this['m']+Math['cos'](_0x25edca)),_0x1072aa=this['a']*this['C_y']*_0x25edca;}else{var _0x8af0e1=Math['sin'](_0x25edca),_0x4225f3=Math['cos'](_0x25edca);_0x1072aa=this['a']*pj_mlfn(_0x25edca,_0x8af0e1,_0x4225f3,this['en']),_0x10ca14=this['a']*_0x3a25b6*_0x4225f3/Math['sqrt'](0x1-this['es']*_0x8af0e1*_0x8af0e1);}return _0x490529['x']=_0x10ca14,_0x490529['y']=_0x1072aa,_0x490529;}function inverse$a(_0x43bb17){const _0x38dcb3={_0x1d0294:0x64c},_0x28dc38=_0x35a251;var _0x384d4d,_0xee73a8,_0x594a3c,_0x114f7c;_0x43bb17['x']-=this['x0'],_0x594a3c=_0x43bb17['x']/this['a'],_0x43bb17['y']-=this['y0'],_0x384d4d=_0x43bb17['y']/this['a'];if(this[_0x28dc38(_0x38dcb3._0x1d0294)]){_0x384d4d/=this['C_y'],_0x594a3c=_0x594a3c/(this['C_x']*(this['m']+Math[_0x28dc38(0xeec)](_0x384d4d)));if(this['m'])_0x384d4d=asinz((this['m']*_0x384d4d+Math['sin'](_0x384d4d))/this['n']);else this['n']!==0x1&&(_0x384d4d=asinz(Math['sin'](_0x384d4d)/this['n']));_0x594a3c=adjust_lon(_0x594a3c+this['long0']),_0x384d4d=adjust_lat(_0x384d4d);}else{_0x384d4d=pj_inv_mlfn(_0x43bb17['y']/this['a'],this['es'],this['en']),_0x114f7c=Math['abs'](_0x384d4d);if(_0x114f7c<HALF_PI)_0x114f7c=Math['sin'](_0x384d4d),_0xee73a8=this['long0']+_0x43bb17['x']*Math['sqrt'](0x1-this['es']*_0x114f7c*_0x114f7c)/(this['a']*Math['cos'](_0x384d4d)),_0x594a3c=adjust_lon(_0xee73a8);else _0x114f7c-EPSLN<HALF_PI&&(_0x594a3c=this['long0']);}return _0x43bb17['x']=_0x594a3c,_0x43bb17['y']=_0x384d4d,_0x43bb17;}var names$a=[_0x35a251(0x476),'sinu'],sinu={'init':init$a,'forward':forward$a,'inverse':inverse$a,'names':names$a};function init$9(){}function forward$9(_0x4a12c3){const _0x1bfc65={_0x2e3087:0xeec},_0x3faf66=_0x35a251;var _0x55ffe5=_0x4a12c3['x'],_0x48d34b=_0x4a12c3['y'],_0x15f214=adjust_lon(_0x55ffe5-this['long0']),_0x47ed0f=_0x48d34b,_0x356453=Math['PI']*Math['sin'](_0x48d34b);while(!![]){var _0x51a5ff=-(_0x47ed0f+Math['sin'](_0x47ed0f)-_0x356453)/(0x1+Math[_0x3faf66(_0x1bfc65._0x2e3087)](_0x47ed0f));_0x47ed0f+=_0x51a5ff;if(Math['abs'](_0x51a5ff)<EPSLN)break;}_0x47ed0f/=0x2;Math['PI']/0x2-Math['abs'](_0x48d34b)<EPSLN&&(_0x15f214=0x0);var _0x49a813=0.900316316158*this['a']*_0x15f214*Math['cos'](_0x47ed0f)+this['x0'],_0x207904=1.4142135623731*this['a']*Math['sin'](_0x47ed0f)+this['y0'];return _0x4a12c3['x']=_0x49a813,_0x4a12c3['y']=_0x207904,_0x4a12c3;}function inverse$9(_0x24f8d1){const _0x1df299=_0x35a251;var _0x48c8fb,_0x13aa05;_0x24f8d1['x']-=this['x0'],_0x24f8d1['y']-=this['y0'],_0x13aa05=_0x24f8d1['y']/(1.4142135623731*this['a']);Math['abs'](_0x13aa05)>0.999999999999&&(_0x13aa05=0.999999999999);_0x48c8fb=Math['asin'](_0x13aa05);var _0x48023f=adjust_lon(this[_0x1df299(0x9cb)]+_0x24f8d1['x']/(0.900316316158*this['a']*Math['cos'](_0x48c8fb)));_0x48023f<-Math['PI']&&(_0x48023f=-Math['PI']);_0x48023f>Math['PI']&&(_0x48023f=Math['PI']);_0x13aa05=(0x2*_0x48c8fb+Math['sin'](0x2*_0x48c8fb))/Math['PI'];Math['abs'](_0x13aa05)>0x1&&(_0x13aa05=0x1);var _0x2733d5=Math['asin'](_0x13aa05);return _0x24f8d1['x']=_0x48023f,_0x24f8d1['y']=_0x2733d5,_0x24f8d1;}var names$9=['Mollweide',_0x35a251(0x1a4)],moll={'init':init$9,'forward':forward$9,'inverse':inverse$9,'names':names$9};function init$8(){const _0x1531e6={_0x20e850:0x405,_0x3e7b77:0x290,_0x1c650b:0xb0a,_0x6585ae:0xda4,_0x4dd1c4:0x76b,_0x215b63:0xb0a,_0x468a1c:0x84a,_0x193c21:0xdef,_0x5a813a:0xcf5,_0x5f5455:0x7f6,_0x2d8711:0x368},_0x496012=_0x35a251;if(Math[_0x496012(_0x1531e6._0x20e850)](this['lat1']+this['lat2'])<EPSLN)return;this[_0x496012(_0x1531e6._0x3e7b77)]=this['lat2']||this[_0x496012(_0x1531e6._0x1c650b)],this['temp']=this['b']/this['a'],this['es']=0x1-Math[_0x496012(_0x1531e6._0x6585ae)](this['temp'],0x2),this['e']=Math[_0x496012(_0x1531e6._0x4dd1c4)](this['es']),this['e0']=e0fn(this['es']),this['e1']=e1fn(this['es']),this['e2']=e2fn(this['es']),this['e3']=e3fn(this['es']),this['sinphi']=Math['sin'](this[_0x496012(_0x1531e6._0x215b63)]),this['cosphi']=Math['cos'](this['lat1']),this['ms1']=msfnz(this['e'],this['sinphi'],this[_0x496012(0x7f6)]),this['ml1']=mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat1']),Math['abs'](this['lat1']-this[_0x496012(0x290)])<EPSLN?this['ns']=this['sinphi']:(this[_0x496012(_0x1531e6._0x468a1c)]=Math[_0x496012(_0x1531e6._0x193c21)](this['lat2']),this['cosphi']=Math[_0x496012(0xeec)](this['lat2']),this[_0x496012(_0x1531e6._0x5a813a)]=msfnz(this['e'],this['sinphi'],this[_0x496012(_0x1531e6._0x5f5455)]),this['ml2']=mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat2']),this['ns']=(this['ms1']-this['ms2'])/(this['ml2']-this['ml1'])),this['g']=this['ml1']+this[_0x496012(0x765)]/this['ns'],this[_0x496012(_0x1531e6._0x2d8711)]=mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat0']),this['rh']=this['a']*(this['g']-this['ml0']);}function forward$8(_0x30587e){const _0x1626da=_0x35a251;var _0x13e1c3=_0x30587e['x'],_0xedc25a=_0x30587e['y'],_0x41502c;if(this[_0x1626da(0x64c)])_0x41502c=this['a']*(this['g']-_0xedc25a);else{var _0x160a0a=mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0xedc25a);_0x41502c=this['a']*(this['g']-_0x160a0a);}var _0x29502b=this['ns']*adjust_lon(_0x13e1c3-this['long0']),_0x536cfc=this['x0']+_0x41502c*Math['sin'](_0x29502b),_0x4c269f=this['y0']+this['rh']-_0x41502c*Math['cos'](_0x29502b);return _0x30587e['x']=_0x536cfc,_0x30587e['y']=_0x4c269f,_0x30587e;}function inverse$8(_0x2c089c){const _0x76ab20=_0x35a251;_0x2c089c['x']-=this['x0'],_0x2c089c['y']=this['rh']-_0x2c089c['y']+this['y0'];var _0x18d169,_0x6aed68,_0x5a095f,_0x38f354;this['ns']>=0x0?(_0x6aed68=Math['sqrt'](_0x2c089c['x']*_0x2c089c['x']+_0x2c089c['y']*_0x2c089c['y']),_0x18d169=0x1):(_0x6aed68=-Math['sqrt'](_0x2c089c['x']*_0x2c089c['x']+_0x2c089c['y']*_0x2c089c['y']),_0x18d169=-0x1);var _0x4ca7fe=0x0;_0x6aed68!==0x0&&(_0x4ca7fe=Math[_0x76ab20(0x5f5)](_0x18d169*_0x2c089c['x'],_0x18d169*_0x2c089c['y']));if(this['sphere'])return _0x38f354=adjust_lon(this['long0']+_0x4ca7fe/this['ns']),_0x5a095f=adjust_lat(this['g']-_0x6aed68/this['a']),_0x2c089c['x']=_0x38f354,_0x2c089c['y']=_0x5a095f,_0x2c089c;else{var _0x11656c=this['g']-_0x6aed68/this['a'];return _0x5a095f=imlfn(_0x11656c,this['e0'],this['e1'],this['e2'],this['e3']),_0x38f354=adjust_lon(this['long0']+_0x4ca7fe/this['ns']),_0x2c089c['x']=_0x38f354,_0x2c089c['y']=_0x5a095f,_0x2c089c;}}var names$8=['Equidistant_Conic','eqdc'],eqdc={'init':init$8,'forward':forward$8,'inverse':inverse$8,'names':names$8};function init$7(){this['R']=this['a'];}function forward$7(_0x504447){const _0x411dbc=_0x35a251;var _0x3f4e4a=_0x504447['x'],_0x53aef0=_0x504447['y'],_0x4518c7=adjust_lon(_0x3f4e4a-this['long0']),_0x3509a0,_0x381910;Math[_0x411dbc(0x405)](_0x53aef0)<=EPSLN&&(_0x3509a0=this['x0']+this['R']*_0x4518c7,_0x381910=this['y0']);var _0x1040f3=asinz(0x2*Math['abs'](_0x53aef0/Math['PI']));(Math[_0x411dbc(0x405)](_0x4518c7)<=EPSLN||Math['abs'](Math['abs'](_0x53aef0)-HALF_PI)<=EPSLN)&&(_0x3509a0=this['x0'],_0x53aef0>=0x0?_0x381910=this['y0']+Math['PI']*this['R']*Math['tan'](0.5*_0x1040f3):_0x381910=this['y0']+Math['PI']*this['R']*-Math[_0x411dbc(0x9b5)](0.5*_0x1040f3));var _0x29334f=0.5*Math['abs'](Math['PI']/_0x4518c7-_0x4518c7/Math['PI']),_0x27b426=_0x29334f*_0x29334f,_0x325007=Math['sin'](_0x1040f3),_0x3c1e0c=Math['cos'](_0x1040f3),_0x5d6084=_0x3c1e0c/(_0x325007+_0x3c1e0c-0x1),_0x4bc9c7=_0x5d6084*_0x5d6084,_0x3c6530=_0x5d6084*(0x2/_0x325007-0x1),_0x45c53c=_0x3c6530*_0x3c6530,_0x301cdf=Math['PI']*this['R']*(_0x29334f*(_0x5d6084-_0x45c53c)+Math[_0x411dbc(0x76b)](_0x27b426*(_0x5d6084-_0x45c53c)*(_0x5d6084-_0x45c53c)-(_0x45c53c+_0x27b426)*(_0x4bc9c7-_0x45c53c)))/(_0x45c53c+_0x27b426);_0x4518c7<0x0&&(_0x301cdf=-_0x301cdf);_0x3509a0=this['x0']+_0x301cdf;var _0x25dff4=_0x27b426+_0x5d6084;return _0x301cdf=Math['PI']*this['R']*(_0x3c6530*_0x25dff4-_0x29334f*Math['sqrt']((_0x45c53c+_0x27b426)*(_0x27b426+0x1)-_0x25dff4*_0x25dff4))/(_0x45c53c+_0x27b426),_0x53aef0>=0x0?_0x381910=this['y0']+_0x301cdf:_0x381910=this['y0']-_0x301cdf,_0x504447['x']=_0x3509a0,_0x504447['y']=_0x381910,_0x504447;}function inverse$7(_0xaa225){const _0x396590={_0x1ae693:0x405,_0x3a227c:0xeec},_0xc11b5f=_0x35a251;var _0x335306,_0x1381d4,_0x4d34b3,_0x2550fd,_0x5d4bc0,_0x232039,_0x50958f,_0x351f64,_0x3dee44,_0x3cd593,_0x3263ff,_0x43bcd9,_0x4c5687;return _0xaa225['x']-=this['x0'],_0xaa225['y']-=this['y0'],_0x3263ff=Math['PI']*this['R'],_0x4d34b3=_0xaa225['x']/_0x3263ff,_0x2550fd=_0xaa225['y']/_0x3263ff,_0x5d4bc0=_0x4d34b3*_0x4d34b3+_0x2550fd*_0x2550fd,_0x232039=-Math[_0xc11b5f(_0x396590._0x1ae693)](_0x2550fd)*(0x1+_0x5d4bc0),_0x50958f=_0x232039-0x2*_0x2550fd*_0x2550fd+_0x4d34b3*_0x4d34b3,_0x351f64=-0x2*_0x232039+0x1+0x2*_0x2550fd*_0x2550fd+_0x5d4bc0*_0x5d4bc0,_0x4c5687=_0x2550fd*_0x2550fd/_0x351f64+(0x2*_0x50958f*_0x50958f*_0x50958f/_0x351f64/_0x351f64/_0x351f64-0x9*_0x232039*_0x50958f/_0x351f64/_0x351f64)/0x1b,_0x3dee44=(_0x232039-_0x50958f*_0x50958f/0x3/_0x351f64)/_0x351f64,_0x3cd593=0x2*Math['sqrt'](-_0x3dee44/0x3),_0x3263ff=0x3*_0x4c5687/_0x3dee44/_0x3cd593,Math[_0xc11b5f(_0x396590._0x1ae693)](_0x3263ff)>0x1&&(_0x3263ff>=0x0?_0x3263ff=0x1:_0x3263ff=-0x1),_0x43bcd9=Math['acos'](_0x3263ff)/0x3,_0xaa225['y']>=0x0?_0x1381d4=(-_0x3cd593*Math['cos'](_0x43bcd9+Math['PI']/0x3)-_0x50958f/0x3/_0x351f64)*Math['PI']:_0x1381d4=-(-_0x3cd593*Math[_0xc11b5f(_0x396590._0x3a227c)](_0x43bcd9+Math['PI']/0x3)-_0x50958f/0x3/_0x351f64)*Math['PI'],Math['abs'](_0x4d34b3)<EPSLN?_0x335306=this[_0xc11b5f(0x9cb)]:_0x335306=adjust_lon(this['long0']+Math['PI']*(_0x5d4bc0-0x1+Math['sqrt'](0x1+0x2*(_0x4d34b3*_0x4d34b3-_0x2550fd*_0x2550fd)+_0x5d4bc0*_0x5d4bc0))/0x2/_0x4d34b3),_0xaa225['x']=_0x335306,_0xaa225['y']=_0x1381d4,_0xaa225;}var names$7=['Van_der_Grinten_I','VanDerGrinten','vandg'],vandg={'init':init$7,'forward':forward$7,'inverse':inverse$7,'names':names$7};function init$6(){const _0x29796b={_0x5f0f4d:0xdef,_0x16347f:0xe40},_0x362efa=_0x35a251;this['sin_p12']=Math[_0x362efa(_0x29796b._0x5f0f4d)](this[_0x362efa(_0x29796b._0x16347f)]),this[_0x362efa(0xf8e)]=Math[_0x362efa(0xeec)](this['lat0']);}function forward$6(_0x1816b2){const _0x3d7f12={_0x5aeac3:0x2bf,_0x37b9ab:0x405,_0xe545c3:0x76b},_0x5b6deb=_0x35a251;var _0x382e31=_0x1816b2['x'],_0x12cce5=_0x1816b2['y'],_0x2d1009=Math['sin'](_0x1816b2['y']),_0x1cddc7=Math[_0x5b6deb(0xeec)](_0x1816b2['y']),_0x37f266=adjust_lon(_0x382e31-this['long0']),_0x414421,_0x4df4b3,_0x34824f,_0x19517e,_0x5440fa,_0x362b17,_0x222826,_0x145be7,_0x4167c5,_0x51bb82,_0x58e524,_0x106636,_0x3b3da5,_0x294347,_0x1b3362,_0x3cacbe,_0x2ac053,_0x337a6b,_0xcd3ff0,_0x4e4370,_0x408e68,_0x580d0d,_0x2dbe83;if(this['sphere']){if(Math['abs'](this['sin_p12']-0x1)<=EPSLN)return _0x1816b2['x']=this['x0']+this['a']*(HALF_PI-_0x12cce5)*Math['sin'](_0x37f266),_0x1816b2['y']=this['y0']-this['a']*(HALF_PI-_0x12cce5)*Math[_0x5b6deb(0xeec)](_0x37f266),_0x1816b2;else return Math['abs'](this['sin_p12']+0x1)<=EPSLN?(_0x1816b2['x']=this['x0']+this['a']*(HALF_PI+_0x12cce5)*Math['sin'](_0x37f266),_0x1816b2['y']=this['y0']+this['a']*(HALF_PI+_0x12cce5)*Math['cos'](_0x37f266),_0x1816b2):(_0x337a6b=this['sin_p12']*_0x2d1009+this['cos_p12']*_0x1cddc7*Math['cos'](_0x37f266),_0x3cacbe=Math['acos'](_0x337a6b),_0x2ac053=_0x3cacbe?_0x3cacbe/Math['sin'](_0x3cacbe):0x1,_0x1816b2['x']=this['x0']+this['a']*_0x2ac053*_0x1cddc7*Math[_0x5b6deb(0xdef)](_0x37f266),_0x1816b2['y']=this['y0']+this['a']*_0x2ac053*(this['cos_p12']*_0x2d1009-this['sin_p12']*_0x1cddc7*Math['cos'](_0x37f266)),_0x1816b2);}else{_0x414421=e0fn(this['es']),_0x4df4b3=e1fn(this['es']),_0x34824f=e2fn(this['es']),_0x19517e=e3fn(this['es']);if(Math['abs'](this['sin_p12']-0x1)<=EPSLN)return _0x5440fa=this['a']*mlfn(_0x414421,_0x4df4b3,_0x34824f,_0x19517e,HALF_PI),_0x362b17=this['a']*mlfn(_0x414421,_0x4df4b3,_0x34824f,_0x19517e,_0x12cce5),_0x1816b2['x']=this['x0']+(_0x5440fa-_0x362b17)*Math['sin'](_0x37f266),_0x1816b2['y']=this['y0']-(_0x5440fa-_0x362b17)*Math['cos'](_0x37f266),_0x1816b2;else{if(Math['abs'](this['sin_p12']+0x1)<=EPSLN)return _0x5440fa=this['a']*mlfn(_0x414421,_0x4df4b3,_0x34824f,_0x19517e,HALF_PI),_0x362b17=this['a']*mlfn(_0x414421,_0x4df4b3,_0x34824f,_0x19517e,_0x12cce5),_0x1816b2['x']=this['x0']+(_0x5440fa+_0x362b17)*Math['sin'](_0x37f266),_0x1816b2['y']=this['y0']+(_0x5440fa+_0x362b17)*Math['cos'](_0x37f266),_0x1816b2;else{_0x222826=_0x2d1009/_0x1cddc7,_0x145be7=gN(this['a'],this['e'],this['sin_p12']),_0x4167c5=gN(this['a'],this['e'],_0x2d1009),_0x51bb82=Math['atan']((0x1-this['es'])*_0x222826+this['es']*_0x145be7*this['sin_p12']/(_0x4167c5*_0x1cddc7)),_0x58e524=Math[_0x5b6deb(0x5f5)](Math[_0x5b6deb(0xdef)](_0x37f266),this['cos_p12']*Math['tan'](_0x51bb82)-this['sin_p12']*Math['cos'](_0x37f266));if(_0x58e524===0x0)_0xcd3ff0=Math[_0x5b6deb(_0x3d7f12._0x5aeac3)](this[_0x5b6deb(0xf8e)]*Math['sin'](_0x51bb82)-this['sin_p12']*Math['cos'](_0x51bb82));else Math['abs'](Math[_0x5b6deb(_0x3d7f12._0x37b9ab)](_0x58e524)-Math['PI'])<=EPSLN?_0xcd3ff0=-Math['asin'](this['cos_p12']*Math['sin'](_0x51bb82)-this[_0x5b6deb(0x8c6)]*Math['cos'](_0x51bb82)):_0xcd3ff0=Math[_0x5b6deb(_0x3d7f12._0x5aeac3)](Math['sin'](_0x37f266)*Math[_0x5b6deb(0xeec)](_0x51bb82)/Math[_0x5b6deb(0xdef)](_0x58e524));return _0x106636=this['e']*this['sin_p12']/Math[_0x5b6deb(_0x3d7f12._0xe545c3)](0x1-this['es']),_0x3b3da5=this['e']*this['cos_p12']*Math['cos'](_0x58e524)/Math['sqrt'](0x1-this['es']),_0x294347=_0x106636*_0x3b3da5,_0x1b3362=_0x3b3da5*_0x3b3da5,_0x4e4370=_0xcd3ff0*_0xcd3ff0,_0x408e68=_0x4e4370*_0xcd3ff0,_0x580d0d=_0x408e68*_0xcd3ff0,_0x2dbe83=_0x580d0d*_0xcd3ff0,_0x3cacbe=_0x145be7*_0xcd3ff0*(0x1-_0x4e4370*_0x1b3362*(0x1-_0x1b3362)/0x6+_0x408e68/0x8*_0x294347*(0x1-0x2*_0x1b3362)+_0x580d0d/0x78*(_0x1b3362*(0x4-0x7*_0x1b3362)-0x3*_0x106636*_0x106636*(0x1-0x7*_0x1b3362))-_0x2dbe83/0x30*_0x294347),_0x1816b2['x']=this['x0']+_0x3cacbe*Math['sin'](_0x58e524),_0x1816b2['y']=this['y0']+_0x3cacbe*Math['cos'](_0x58e524),_0x1816b2;}}}}function inverse$6(_0x10c896){const _0x59645f={_0x40567a:0x405,_0x270b50:0x76b,_0x27696d:0x9cb,_0x4afa0d:0x8c6,_0x20ade8:0x8c6},_0x4500e4=_0x35a251;_0x10c896['x']-=this['x0'],_0x10c896['y']-=this['y0'];var _0x439626,_0x3506e9,_0xdba850,_0x21b884,_0x130c0c,_0x1fc200,_0x4dd01b,_0x446dfd,_0x2d8342,_0x1fcfb2,_0x19c56b,_0x176413,_0x4e780c,_0x4a5bfe,_0x596254,_0x1ce2f8,_0x3c0909,_0x21c41b,_0x14ab6d,_0x36a449,_0x5880e4,_0x4943a7,_0x486851,_0xa62d52;if(this['sphere']){_0x439626=Math['sqrt'](_0x10c896['x']*_0x10c896['x']+_0x10c896['y']*_0x10c896['y']);if(_0x439626>0x2*HALF_PI*this['a'])return;return _0x3506e9=_0x439626/this['a'],_0xdba850=Math['sin'](_0x3506e9),_0x21b884=Math['cos'](_0x3506e9),_0x130c0c=this['long0'],Math[_0x4500e4(_0x59645f._0x40567a)](_0x439626)<=EPSLN?_0x1fc200=this['lat0']:(_0x1fc200=asinz(_0x21b884*this['sin_p12']+_0x10c896['y']*_0xdba850*this['cos_p12']/_0x439626),_0x4dd01b=Math['abs'](this['lat0'])-HALF_PI,Math[_0x4500e4(_0x59645f._0x40567a)](_0x4dd01b)<=EPSLN?this['lat0']>=0x0?_0x130c0c=adjust_lon(this['long0']+Math[_0x4500e4(0x5f5)](_0x10c896['x'],-_0x10c896['y'])):_0x130c0c=adjust_lon(this['long0']-Math[_0x4500e4(0x5f5)](-_0x10c896['x'],_0x10c896['y'])):_0x130c0c=adjust_lon(this['long0']+Math['atan2'](_0x10c896['x']*_0xdba850,_0x439626*this['cos_p12']*_0x21b884-_0x10c896['y']*this[_0x4500e4(0x8c6)]*_0xdba850))),_0x10c896['x']=_0x130c0c,_0x10c896['y']=_0x1fc200,_0x10c896;}else{_0x446dfd=e0fn(this['es']),_0x2d8342=e1fn(this['es']),_0x1fcfb2=e2fn(this['es']),_0x19c56b=e3fn(this['es']);if(Math['abs'](this['sin_p12']-0x1)<=EPSLN)return _0x176413=this['a']*mlfn(_0x446dfd,_0x2d8342,_0x1fcfb2,_0x19c56b,HALF_PI),_0x439626=Math['sqrt'](_0x10c896['x']*_0x10c896['x']+_0x10c896['y']*_0x10c896['y']),_0x4e780c=_0x176413-_0x439626,_0x1fc200=imlfn(_0x4e780c/this['a'],_0x446dfd,_0x2d8342,_0x1fcfb2,_0x19c56b),_0x130c0c=adjust_lon(this[_0x4500e4(0x9cb)]+Math[_0x4500e4(0x5f5)](_0x10c896['x'],-0x1*_0x10c896['y'])),_0x10c896['x']=_0x130c0c,_0x10c896['y']=_0x1fc200,_0x10c896;else return Math['abs'](this['sin_p12']+0x1)<=EPSLN?(_0x176413=this['a']*mlfn(_0x446dfd,_0x2d8342,_0x1fcfb2,_0x19c56b,HALF_PI),_0x439626=Math[_0x4500e4(_0x59645f._0x270b50)](_0x10c896['x']*_0x10c896['x']+_0x10c896['y']*_0x10c896['y']),_0x4e780c=_0x439626-_0x176413,_0x1fc200=imlfn(_0x4e780c/this['a'],_0x446dfd,_0x2d8342,_0x1fcfb2,_0x19c56b),_0x130c0c=adjust_lon(this[_0x4500e4(_0x59645f._0x27696d)]+Math['atan2'](_0x10c896['x'],_0x10c896['y'])),_0x10c896['x']=_0x130c0c,_0x10c896['y']=_0x1fc200,_0x10c896):(_0x439626=Math['sqrt'](_0x10c896['x']*_0x10c896['x']+_0x10c896['y']*_0x10c896['y']),_0x1ce2f8=Math['atan2'](_0x10c896['x'],_0x10c896['y']),_0x4a5bfe=gN(this['a'],this['e'],this[_0x4500e4(_0x59645f._0x4afa0d)]),_0x3c0909=Math['cos'](_0x1ce2f8),_0x21c41b=this['e']*this['cos_p12']*_0x3c0909,_0x14ab6d=-_0x21c41b*_0x21c41b/(0x1-this['es']),_0x36a449=0x3*this['es']*(0x1-_0x14ab6d)*this[_0x4500e4(_0x59645f._0x20ade8)]*this['cos_p12']*_0x3c0909/(0x1-this['es']),_0x5880e4=_0x439626/_0x4a5bfe,_0x4943a7=_0x5880e4-_0x14ab6d*(0x1+_0x14ab6d)*Math['pow'](_0x5880e4,0x3)/0x6-_0x36a449*(0x1+0x3*_0x14ab6d)*Math['pow'](_0x5880e4,0x4)/0x18,_0x486851=0x1-_0x14ab6d*_0x4943a7*_0x4943a7/0x2-_0x5880e4*_0x4943a7*_0x4943a7*_0x4943a7/0x6,_0x596254=Math['asin'](this['sin_p12']*Math['cos'](_0x4943a7)+this['cos_p12']*Math['sin'](_0x4943a7)*_0x3c0909),_0x130c0c=adjust_lon(this['long0']+Math['asin'](Math['sin'](_0x1ce2f8)*Math[_0x4500e4(0xdef)](_0x4943a7)/Math[_0x4500e4(0xeec)](_0x596254))),_0xa62d52=Math['sin'](_0x596254),_0x1fc200=Math[_0x4500e4(0x5f5)]((_0xa62d52-this['es']*_0x486851*this['sin_p12'])*Math['tan'](_0x596254),_0xa62d52*(0x1-this['es'])),_0x10c896['x']=_0x130c0c,_0x10c896['y']=_0x1fc200,_0x10c896);}}var names$6=['Azimuthal_Equidistant','aeqd'],aeqd={'init':init$6,'forward':forward$6,'inverse':inverse$6,'names':names$6};function init$5(){this['sin_p14']=Math['sin'](this['lat0']),this['cos_p14']=Math['cos'](this['lat0']);}function forward$5(_0x1c00bf){const _0x1a03c2={_0x21ddc5:0xeec,_0x2d5184:0x405},_0x11361e=_0x35a251;var _0x83f241,_0x2c788b,_0x4fe398,_0x25e27d,_0x467021,_0x29d8db,_0x53c4f6,_0x3ae7a3,_0x293233=_0x1c00bf['x'],_0x53cc91=_0x1c00bf['y'];return _0x4fe398=adjust_lon(_0x293233-this['long0']),_0x83f241=Math['sin'](_0x53cc91),_0x2c788b=Math[_0x11361e(_0x1a03c2._0x21ddc5)](_0x53cc91),_0x25e27d=Math['cos'](_0x4fe398),_0x29d8db=this['sin_p14']*_0x83f241+this[_0x11361e(0x2fd)]*_0x2c788b*_0x25e27d,_0x467021=0x1,(_0x29d8db>0x0||Math[_0x11361e(_0x1a03c2._0x2d5184)](_0x29d8db)<=EPSLN)&&(_0x53c4f6=this['a']*_0x467021*_0x2c788b*Math['sin'](_0x4fe398),_0x3ae7a3=this['y0']+this['a']*_0x467021*(this['cos_p14']*_0x83f241-this['sin_p14']*_0x2c788b*_0x25e27d)),_0x1c00bf['x']=_0x53c4f6,_0x1c00bf['y']=_0x3ae7a3,_0x1c00bf;}function inverse$5(_0x408483){const _0x38494f={_0x27d1e8:0xe40},_0x2c7bc6=_0x35a251;var _0x1bb7b3,_0x277933,_0x1edfea,_0x87e20f,_0x50b063,_0x5b1b7b,_0x19c76c;_0x408483['x']-=this['x0'],_0x408483['y']-=this['y0'],_0x1bb7b3=Math['sqrt'](_0x408483['x']*_0x408483['x']+_0x408483['y']*_0x408483['y']),_0x277933=asinz(_0x1bb7b3/this['a']),_0x1edfea=Math['sin'](_0x277933),_0x87e20f=Math[_0x2c7bc6(0xeec)](_0x277933),_0x5b1b7b=this[_0x2c7bc6(0x9cb)];if(Math['abs'](_0x1bb7b3)<=EPSLN)return _0x19c76c=this['lat0'],_0x408483['x']=_0x5b1b7b,_0x408483['y']=_0x19c76c,_0x408483;_0x19c76c=asinz(_0x87e20f*this['sin_p14']+_0x408483['y']*_0x1edfea*this['cos_p14']/_0x1bb7b3),_0x50b063=Math['abs'](this[_0x2c7bc6(_0x38494f._0x27d1e8)])-HALF_PI;if(Math['abs'](_0x50b063)<=EPSLN)return this['lat0']>=0x0?_0x5b1b7b=adjust_lon(this[_0x2c7bc6(0x9cb)]+Math['atan2'](_0x408483['x'],-_0x408483['y'])):_0x5b1b7b=adjust_lon(this['long0']-Math['atan2'](-_0x408483['x'],_0x408483['y'])),_0x408483['x']=_0x5b1b7b,_0x408483['y']=_0x19c76c,_0x408483;return _0x5b1b7b=adjust_lon(this['long0']+Math['atan2'](_0x408483['x']*_0x1edfea,_0x1bb7b3*this['cos_p14']*_0x87e20f-_0x408483['y']*this['sin_p14']*_0x1edfea)),_0x408483['x']=_0x5b1b7b,_0x408483['y']=_0x19c76c,_0x408483;}var names$5=[_0x35a251(0x87f)],ortho={'init':init$5,'forward':forward$5,'inverse':inverse$5,'names':names$5},FACE_ENUM={'FRONT':0x1,'RIGHT':0x2,'BACK':0x3,'LEFT':0x4,'TOP':0x5,'BOTTOM':0x6},AREA_ENUM={'AREA_0':0x1,'AREA_1':0x2,'AREA_2':0x3,'AREA_3':0x4};function init$4(){const _0x93ab01={_0x4e8a01:0xe40,_0x408723:0x732,_0x368b8c:0xa18,_0x1da07b:0xb74,_0xa416af:0x168,_0x1f5324:0x405,_0x549d33:0x9cb,_0x3ab73f:0x70c,_0x3691c8:0x4cb},_0x35dcc8=_0x35a251;this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this[_0x35dcc8(_0x93ab01._0x4e8a01)]=this[_0x35dcc8(0xe40)]||0x0,this['long0']=this[_0x35dcc8(0x9cb)]||0x0,this['lat_ts']=this['lat_ts']||0x0,this['title']=this[_0x35dcc8(_0x93ab01._0x408723)]||'Quadrilateralized\x20Spherical\x20Cube';if(this['lat0']>=HALF_PI-FORTPI/0x2)this[_0x35dcc8(_0x93ab01._0x368b8c)]=FACE_ENUM[_0x35dcc8(_0x93ab01._0x1da07b)];else{if(this[_0x35dcc8(0xe40)]<=-(HALF_PI-FORTPI/0x2))this['face']=FACE_ENUM['BOTTOM'];else{if(Math[_0x35dcc8(0x405)](this['long0'])<=FORTPI)this['face']=FACE_ENUM[_0x35dcc8(_0x93ab01._0xa416af)];else Math[_0x35dcc8(_0x93ab01._0x1f5324)](this['long0'])<=HALF_PI+FORTPI?this[_0x35dcc8(0xa18)]=this[_0x35dcc8(_0x93ab01._0x549d33)]>0x0?FACE_ENUM['RIGHT']:FACE_ENUM['LEFT']:this['face']=FACE_ENUM[_0x35dcc8(_0x93ab01._0x3ab73f)];}}this['es']!==0x0&&(this['one_minus_f']=0x1-(this['a']-this['b'])/this['a'],this['one_minus_f_squared']=this[_0x35dcc8(_0x93ab01._0x3691c8)]*this[_0x35dcc8(0x4cb)]);}function forward$4(_0x558808){const _0x400a2c={_0x2fc020:0xa18,_0xde3d87:0xe20,_0x523092:0x8b3,_0x52307e:0x260,_0x2900d9:0x65d,_0x8270b8:0x168,_0x2d7b40:0xa18,_0x14a37e:0xf73,_0x88f813:0xeec},_0x1df32=_0x35a251;var _0x2dae4c={'x':0x0,'y':0x0},_0x26731a,_0x380486,_0x11eb09,_0x1a5775,_0x4491f8,_0x66b2ec,_0x32a051={'value':0x0};_0x558808['x']-=this[_0x1df32(0x9cb)];this['es']!==0x0?_0x26731a=Math[_0x1df32(0x269)](this['one_minus_f_squared']*Math['tan'](_0x558808['y'])):_0x26731a=_0x558808['y'];_0x380486=_0x558808['x'];if(this[_0x1df32(_0x400a2c._0x2fc020)]===FACE_ENUM['TOP']){_0x1a5775=HALF_PI-_0x26731a;if(_0x380486>=FORTPI&&_0x380486<=HALF_PI+FORTPI)_0x32a051['value']=AREA_ENUM['AREA_0'],_0x11eb09=_0x380486-HALF_PI;else{if(_0x380486>HALF_PI+FORTPI||_0x380486<=-(HALF_PI+FORTPI))_0x32a051[_0x1df32(0x260)]=AREA_ENUM['AREA_1'],_0x11eb09=_0x380486>0x0?_0x380486-SPI:_0x380486+SPI;else _0x380486>-(HALF_PI+FORTPI)&&_0x380486<=-FORTPI?(_0x32a051['value']=AREA_ENUM['AREA_2'],_0x11eb09=_0x380486+HALF_PI):(_0x32a051['value']=AREA_ENUM['AREA_3'],_0x11eb09=_0x380486);}}else{if(this['face']===FACE_ENUM[_0x1df32(_0x400a2c._0xde3d87)]){_0x1a5775=HALF_PI+_0x26731a;if(_0x380486>=FORTPI&&_0x380486<=HALF_PI+FORTPI)_0x32a051['value']=AREA_ENUM['AREA_0'],_0x11eb09=-_0x380486+HALF_PI;else{if(_0x380486<FORTPI&&_0x380486>=-FORTPI)_0x32a051['value']=AREA_ENUM[_0x1df32(_0x400a2c._0x523092)],_0x11eb09=-_0x380486;else _0x380486<-FORTPI&&_0x380486>=-(HALF_PI+FORTPI)?(_0x32a051['value']=AREA_ENUM['AREA_2'],_0x11eb09=-_0x380486-HALF_PI):(_0x32a051[_0x1df32(_0x400a2c._0x52307e)]=AREA_ENUM[_0x1df32(_0x400a2c._0x2900d9)],_0x11eb09=_0x380486>0x0?-_0x380486+SPI:-_0x380486-SPI);}}else{var _0x381013,_0x289ac1,_0x5342d3,_0x181e6e,_0x188ed3,_0x178b50,_0xecd9a0;if(this['face']===FACE_ENUM['RIGHT'])_0x380486=qsc_shift_lon_origin(_0x380486,+HALF_PI);else{if(this['face']===FACE_ENUM['BACK'])_0x380486=qsc_shift_lon_origin(_0x380486,+SPI);else this['face']===FACE_ENUM['LEFT']&&(_0x380486=qsc_shift_lon_origin(_0x380486,-HALF_PI));}_0x181e6e=Math['sin'](_0x26731a),_0x188ed3=Math['cos'](_0x26731a),_0x178b50=Math[_0x1df32(0xdef)](_0x380486),_0xecd9a0=Math[_0x1df32(0xeec)](_0x380486),_0x381013=_0x188ed3*_0xecd9a0,_0x289ac1=_0x188ed3*_0x178b50,_0x5342d3=_0x181e6e;if(this['face']===FACE_ENUM[_0x1df32(_0x400a2c._0x8270b8)])_0x1a5775=Math['acos'](_0x381013),_0x11eb09=qsc_fwd_equat_face_theta(_0x1a5775,_0x5342d3,_0x289ac1,_0x32a051);else{if(this[_0x1df32(_0x400a2c._0x2d7b40)]===FACE_ENUM[_0x1df32(0x64e)])_0x1a5775=Math[_0x1df32(_0x400a2c._0x14a37e)](_0x289ac1),_0x11eb09=qsc_fwd_equat_face_theta(_0x1a5775,_0x5342d3,-_0x381013,_0x32a051);else{if(this['face']===FACE_ENUM['BACK'])_0x1a5775=Math['acos'](-_0x381013),_0x11eb09=qsc_fwd_equat_face_theta(_0x1a5775,_0x5342d3,-_0x289ac1,_0x32a051);else this['face']===FACE_ENUM['LEFT']?(_0x1a5775=Math['acos'](-_0x289ac1),_0x11eb09=qsc_fwd_equat_face_theta(_0x1a5775,_0x5342d3,_0x381013,_0x32a051)):(_0x1a5775=_0x11eb09=0x0,_0x32a051['value']=AREA_ENUM['AREA_0']);}}}}_0x66b2ec=Math['atan'](0xc/SPI*(_0x11eb09+Math[_0x1df32(_0x400a2c._0x14a37e)](Math['sin'](_0x11eb09)*Math['cos'](FORTPI))-HALF_PI)),_0x4491f8=Math['sqrt']((0x1-Math[_0x1df32(0xeec)](_0x1a5775))/(Math['cos'](_0x66b2ec)*Math['cos'](_0x66b2ec))/(0x1-Math['cos'](Math['atan'](0x1/Math[_0x1df32(_0x400a2c._0x88f813)](_0x11eb09)))));if(_0x32a051['value']===AREA_ENUM['AREA_1'])_0x66b2ec+=HALF_PI;else{if(_0x32a051['value']===AREA_ENUM[_0x1df32(0x20d)])_0x66b2ec+=SPI;else _0x32a051['value']===AREA_ENUM['AREA_3']&&(_0x66b2ec+=1.5*SPI);}return _0x2dae4c['x']=_0x4491f8*Math['cos'](_0x66b2ec),_0x2dae4c['y']=_0x4491f8*Math['sin'](_0x66b2ec),_0x2dae4c['x']=_0x2dae4c['x']*this['a']+this['x0'],_0x2dae4c['y']=_0x2dae4c['y']*this['a']+this['y0'],_0x558808['x']=_0x2dae4c['x'],_0x558808['y']=_0x2dae4c['y'],_0x558808;}function inverse$4(_0x2c901c){const _0x361db9={_0x394e32:0x260,_0x1af855:0x260,_0x16ef4e:0x1a9,_0x142cb8:0x712,_0x23200e:0x260,_0x494dec:0x8b3,_0x6067c4:0x712,_0x3c15a8:0x1a9,_0x545b28:0xa18,_0x5b3fdd:0x1f0,_0x54e293:0x712,_0x40eca1:0x1f0},_0x2c7e8e=_0x35a251;var _0x1dea98={'lam':0x0,'phi':0x0},_0x48d5f3,_0xc04cd4,_0x58e5d3,_0x54fb6a,_0x5d17a2,_0x46e3d6,_0x1e3396,_0x3ccb00,_0x400534,_0x39ab8c={'value':0x0};_0x2c901c['x']=(_0x2c901c['x']-this['x0'])/this['a'],_0x2c901c['y']=(_0x2c901c['y']-this['y0'])/this['a'],_0xc04cd4=Math['atan'](Math['sqrt'](_0x2c901c['x']*_0x2c901c['x']+_0x2c901c['y']*_0x2c901c['y'])),_0x48d5f3=Math['atan2'](_0x2c901c['y'],_0x2c901c['x']);if(_0x2c901c['x']>=0x0&&_0x2c901c['x']>=Math[_0x2c7e8e(0x405)](_0x2c901c['y']))_0x39ab8c['value']=AREA_ENUM['AREA_0'];else{if(_0x2c901c['y']>=0x0&&_0x2c901c['y']>=Math['abs'](_0x2c901c['x']))_0x39ab8c[_0x2c7e8e(_0x361db9._0x394e32)]=AREA_ENUM['AREA_1'],_0x48d5f3-=HALF_PI;else _0x2c901c['x']<0x0&&-_0x2c901c['x']>=Math['abs'](_0x2c901c['y'])?(_0x39ab8c[_0x2c7e8e(0x260)]=AREA_ENUM['AREA_2'],_0x48d5f3=_0x48d5f3<0x0?_0x48d5f3+SPI:_0x48d5f3-SPI):(_0x39ab8c[_0x2c7e8e(_0x361db9._0x1af855)]=AREA_ENUM['AREA_3'],_0x48d5f3+=HALF_PI);}_0x400534=SPI/0xc*Math['tan'](_0x48d5f3),_0x5d17a2=Math['sin'](_0x400534)/(Math['cos'](_0x400534)-0x1/Math['sqrt'](0x2)),_0x46e3d6=Math['atan'](_0x5d17a2),_0x58e5d3=Math['cos'](_0x48d5f3),_0x54fb6a=Math['tan'](_0xc04cd4),_0x1e3396=0x1-_0x58e5d3*_0x58e5d3*_0x54fb6a*_0x54fb6a*(0x1-Math['cos'](Math['atan'](0x1/Math['cos'](_0x46e3d6))));if(_0x1e3396<-0x1)_0x1e3396=-0x1;else _0x1e3396>+0x1&&(_0x1e3396=+0x1);if(this['face']===FACE_ENUM['TOP']){_0x3ccb00=Math['acos'](_0x1e3396),_0x1dea98['phi']=HALF_PI-_0x3ccb00;if(_0x39ab8c['value']===AREA_ENUM[_0x2c7e8e(_0x361db9._0x16ef4e)])_0x1dea98[_0x2c7e8e(_0x361db9._0x142cb8)]=_0x46e3d6+HALF_PI;else{if(_0x39ab8c[_0x2c7e8e(_0x361db9._0x23200e)]===AREA_ENUM[_0x2c7e8e(_0x361db9._0x494dec)])_0x1dea98['lam']=_0x46e3d6<0x0?_0x46e3d6+SPI:_0x46e3d6-SPI;else _0x39ab8c[_0x2c7e8e(0x260)]===AREA_ENUM['AREA_2']?_0x1dea98[_0x2c7e8e(_0x361db9._0x6067c4)]=_0x46e3d6-HALF_PI:_0x1dea98['lam']=_0x46e3d6;}}else{if(this['face']===FACE_ENUM['BOTTOM']){_0x3ccb00=Math['acos'](_0x1e3396),_0x1dea98['phi']=_0x3ccb00-HALF_PI;if(_0x39ab8c['value']===AREA_ENUM[_0x2c7e8e(_0x361db9._0x3c15a8)])_0x1dea98[_0x2c7e8e(_0x361db9._0x6067c4)]=-_0x46e3d6+HALF_PI;else{if(_0x39ab8c['value']===AREA_ENUM['AREA_1'])_0x1dea98[_0x2c7e8e(0x712)]=-_0x46e3d6;else _0x39ab8c['value']===AREA_ENUM['AREA_2']?_0x1dea98['lam']=-_0x46e3d6-HALF_PI:_0x1dea98['lam']=_0x46e3d6<0x0?-_0x46e3d6-SPI:-_0x46e3d6+SPI;}}else{var _0x1691ae,_0x2ccc9b,_0x34d101;_0x1691ae=_0x1e3396,_0x400534=_0x1691ae*_0x1691ae;_0x400534>=0x1?_0x34d101=0x0:_0x34d101=Math['sqrt'](0x1-_0x400534)*Math['sin'](_0x46e3d6);_0x400534+=_0x34d101*_0x34d101;_0x400534>=0x1?_0x2ccc9b=0x0:_0x2ccc9b=Math[_0x2c7e8e(0x76b)](0x1-_0x400534);if(_0x39ab8c['value']===AREA_ENUM['AREA_1'])_0x400534=_0x2ccc9b,_0x2ccc9b=-_0x34d101,_0x34d101=_0x400534;else{if(_0x39ab8c['value']===AREA_ENUM[_0x2c7e8e(0x20d)])_0x2ccc9b=-_0x2ccc9b,_0x34d101=-_0x34d101;else _0x39ab8c['value']===AREA_ENUM[_0x2c7e8e(0x65d)]&&(_0x400534=_0x2ccc9b,_0x2ccc9b=_0x34d101,_0x34d101=-_0x400534);}if(this[_0x2c7e8e(_0x361db9._0x545b28)]===FACE_ENUM['RIGHT'])_0x400534=_0x1691ae,_0x1691ae=-_0x2ccc9b,_0x2ccc9b=_0x400534;else{if(this['face']===FACE_ENUM['BACK'])_0x1691ae=-_0x1691ae,_0x2ccc9b=-_0x2ccc9b;else this['face']===FACE_ENUM[_0x2c7e8e(_0x361db9._0x5b3fdd)]&&(_0x400534=_0x1691ae,_0x1691ae=_0x2ccc9b,_0x2ccc9b=-_0x400534);}_0x1dea98['phi']=Math['acos'](-_0x34d101)-HALF_PI,_0x1dea98['lam']=Math['atan2'](_0x2ccc9b,_0x1691ae);if(this['face']===FACE_ENUM['RIGHT'])_0x1dea98[_0x2c7e8e(_0x361db9._0x54e293)]=qsc_shift_lon_origin(_0x1dea98['lam'],-HALF_PI);else{if(this[_0x2c7e8e(0xa18)]===FACE_ENUM['BACK'])_0x1dea98['lam']=qsc_shift_lon_origin(_0x1dea98['lam'],-SPI);else this[_0x2c7e8e(0xa18)]===FACE_ENUM[_0x2c7e8e(_0x361db9._0x40eca1)]&&(_0x1dea98['lam']=qsc_shift_lon_origin(_0x1dea98['lam'],+HALF_PI));}}}if(this['es']!==0x0){var _0xfe8219,_0x4fbbc5,_0x1eedac;_0xfe8219=_0x1dea98['phi']<0x0?0x1:0x0,_0x4fbbc5=Math['tan'](_0x1dea98['phi']),_0x1eedac=this['b']/Math['sqrt'](_0x4fbbc5*_0x4fbbc5+this['one_minus_f_squared']),_0x1dea98['phi']=Math[_0x2c7e8e(0x269)](Math['sqrt'](this['a']*this['a']-_0x1eedac*_0x1eedac)/(this['one_minus_f']*_0x1eedac)),_0xfe8219&&(_0x1dea98['phi']=-_0x1dea98[_0x2c7e8e(0xa21)]);}return _0x1dea98['lam']+=this[_0x2c7e8e(0x9cb)],_0x2c901c['x']=_0x1dea98['lam'],_0x2c901c['y']=_0x1dea98['phi'],_0x2c901c;}function qsc_fwd_equat_face_theta(_0x1c07d8,_0x3430d8,_0x34679f,_0x59a825){const _0xdbb837={_0x129eb8:0x405},_0x4c39ab=_0x35a251;var _0x10ae23;if(_0x1c07d8<EPSLN)_0x59a825[_0x4c39ab(0x260)]=AREA_ENUM[_0x4c39ab(0x1a9)],_0x10ae23=0x0;else{_0x10ae23=Math['atan2'](_0x3430d8,_0x34679f);if(Math[_0x4c39ab(_0xdbb837._0x129eb8)](_0x10ae23)<=FORTPI)_0x59a825[_0x4c39ab(0x260)]=AREA_ENUM[_0x4c39ab(0x1a9)];else{if(_0x10ae23>FORTPI&&_0x10ae23<=HALF_PI+FORTPI)_0x59a825['value']=AREA_ENUM['AREA_1'],_0x10ae23-=HALF_PI;else _0x10ae23>HALF_PI+FORTPI||_0x10ae23<=-(HALF_PI+FORTPI)?(_0x59a825['value']=AREA_ENUM['AREA_2'],_0x10ae23=_0x10ae23>=0x0?_0x10ae23-SPI:_0x10ae23+SPI):(_0x59a825['value']=AREA_ENUM['AREA_3'],_0x10ae23+=HALF_PI);}}return _0x10ae23;}function qsc_shift_lon_origin(_0x38e07d,_0x5cbc49){var _0x64923d=_0x38e07d+_0x5cbc49;if(_0x64923d<-SPI)_0x64923d+=TWO_PI;else _0x64923d>+SPI&&(_0x64923d-=TWO_PI);return _0x64923d;}var names$4=[_0x35a251(0xf55),'Quadrilateralized_Spherical_Cube','qsc'],qsc={'init':init$4,'forward':forward$4,'inverse':inverse$4,'names':names$4},COEFS_X=[[0x1,2.2199e-17,-0.0000715515,0.0000031103],[0.9986,-0.000482243,-0.000024897,-0.0000013309],[0.9954,-0.00083103,-0.0000448605,-9.86701e-7],[0.99,-0.00135364,-0.000059661,0.0000036777],[0.9822,-0.00167442,-0.00000449547,-0.00000572411],[0.973,-0.00214868,-0.0000903571,1.8736e-8],[0.96,-0.00305085,-0.0000900761,0.00000164917],[0.9427,-0.00382792,-0.0000653386,-0.0000026154],[0.9216,-0.00467746,-0.00010457,0.00000481243],[0.8962,-0.00536223,-0.0000323831,-0.00000543432],[0.8679,-0.00609363,-0.000113898,0.00000332484],[0.835,-0.00698325,-0.0000640253,9.34959e-7],[0.7986,-0.00755338,-0.0000500009,9.35324e-7],[0.7597,-0.00798324,-0.000035971,-0.00000227626],[0.7186,-0.00851367,-0.0000701149,-0.0000086303],[0.6732,-0.00986209,-0.000199569,0.0000191974],[0.6213,-0.010418,0.0000883923,0.00000624051],[0.5722,-0.00906601,0.000182,0.00000624051],[0.5322,-0.00677797,0.000275608,0.00000624051]],COEFS_Y=[[-5.20417e-18,0.0124,1.21431e-18,-8.45284e-11],[0.062,0.0124,-1.26793e-9,4.22642e-10],[0.124,0.0124,5.07171e-9,-1.60604e-9],[0.186,0.0123999,-1.90189e-8,6.00152e-9],[0.248,0.0124002,7.10039e-8,-2.24e-8],[0.31,0.0123992,-2.64997e-7,8.35986e-8],[0.372,0.0124029,9.88983e-7,-3.11994e-7],[0.434,0.0123893,-0.00000369093,-4.35621e-7],[0.4958,0.0123198,-0.0000102252,-3.45523e-7],[0.5571,0.0121916,-0.0000154081,-5.82288e-7],[0.6176,0.0119938,-0.0000241424,-5.25327e-7],[0.6769,0.011713,-0.0000320223,-5.16405e-7],[0.7346,0.0113541,-0.0000397684,-6.09052e-7],[0.7903,0.0109107,-0.0000489042,-0.00000104739],[0.8435,0.0103431,-0.000064615,-1.40374e-9],[0.8936,0.00969686,-0.000064636,-0.000008547],[0.9394,0.00840947,-0.000192841,-0.0000042106],[0.9761,0.00616527,-0.000256,-0.0000042106],[0x1,0.00328947,-0.000319159,-0.0000042106]],FXC=0.8487,FYC=1.3523,C1=R2D/0x5,RC1=0x1/C1,NODES=0x12,poly3_val=function(_0x4490ae,_0x32b020){return _0x4490ae[0x0]+_0x32b020*(_0x4490ae[0x1]+_0x32b020*(_0x4490ae[0x2]+_0x32b020*_0x4490ae[0x3]));},poly3_der=function(_0x8e46b2,_0xc3a928){return _0x8e46b2[0x1]+_0xc3a928*(0x2*_0x8e46b2[0x2]+_0xc3a928*0x3*_0x8e46b2[0x3]);};function newton_rapshon(_0x45246b,_0x55c95f,_0x376af4,_0x449ec8){var _0x53044b=_0x55c95f;for(;_0x449ec8;--_0x449ec8){var _0xe7f75b=_0x45246b(_0x53044b);_0x53044b-=_0xe7f75b;if(Math['abs'](_0xe7f75b)<_0x376af4)break;}return _0x53044b;}function init$3(){const _0x21710f=_0x35a251;this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this[_0x21710f(0x9cb)]=this['long0']||0x0,this['es']=0x0,this['title']=this['title']||'Robinson';}function forward$3(_0x12f62b){var _0xe0d796=adjust_lon(_0x12f62b['x']-this['long0']),_0x442302=Math['abs'](_0x12f62b['y']),_0x12cfbe=Math['floor'](_0x442302*C1);if(_0x12cfbe<0x0)_0x12cfbe=0x0;else _0x12cfbe>=NODES&&(_0x12cfbe=NODES-0x1);_0x442302=R2D*(_0x442302-RC1*_0x12cfbe);var _0x3a724c={'x':poly3_val(COEFS_X[_0x12cfbe],_0x442302)*_0xe0d796,'y':poly3_val(COEFS_Y[_0x12cfbe],_0x442302)};return _0x12f62b['y']<0x0&&(_0x3a724c['y']=-_0x3a724c['y']),_0x3a724c['x']=_0x3a724c['x']*this['a']*FXC+this['x0'],_0x3a724c['y']=_0x3a724c['y']*this['a']*FYC+this['y0'],_0x3a724c;}function inverse$3(_0x3a3423){const _0x496e79=_0x35a251;var _0x328955={'x':(_0x3a3423['x']-this['x0'])/(this['a']*FXC),'y':Math['abs'](_0x3a3423['y']-this['y0'])/(this['a']*FYC)};if(_0x328955['y']>=0x1)_0x328955['x']/=COEFS_X[NODES][0x0],_0x328955['y']=_0x3a3423['y']<0x0?-HALF_PI:HALF_PI;else{var _0x5477e8=Math[_0x496e79(0x6ba)](_0x328955['y']*NODES);if(_0x5477e8<0x0)_0x5477e8=0x0;else _0x5477e8>=NODES&&(_0x5477e8=NODES-0x1);for(;;){if(COEFS_Y[_0x5477e8][0x0]>_0x328955['y'])--_0x5477e8;else{if(COEFS_Y[_0x5477e8+0x1][0x0]<=_0x328955['y'])++_0x5477e8;else break;}}var _0x4b08cf=COEFS_Y[_0x5477e8],_0x43dbb4=0x5*(_0x328955['y']-_0x4b08cf[0x0])/(COEFS_Y[_0x5477e8+0x1][0x0]-_0x4b08cf[0x0]);_0x43dbb4=newton_rapshon(function(_0x3db5f1){return(poly3_val(_0x4b08cf,_0x3db5f1)-_0x328955['y'])/poly3_der(_0x4b08cf,_0x3db5f1);},_0x43dbb4,EPSLN,0x64),_0x328955['x']/=poly3_val(COEFS_X[_0x5477e8],_0x43dbb4),_0x328955['y']=(0x5*_0x5477e8+_0x43dbb4)*D2R$1,_0x3a3423['y']<0x0&&(_0x328955['y']=-_0x328955['y']);}return _0x328955['x']=adjust_lon(_0x328955['x']+this[_0x496e79(0x9cb)]),_0x328955;}var names$3=['Robinson','robin'],robin={'init':init$3,'forward':forward$3,'inverse':inverse$3,'names':names$3};function init$2(){this['name']='geocent';}function forward$2(_0x1b5f7f){var _0xd0d0a6=geodeticToGeocentric(_0x1b5f7f,this['es'],this['a']);return _0xd0d0a6;}function inverse$2(_0x9a51df){var _0x447c4d=geocentricToGeodetic(_0x9a51df,this['es'],this['a'],this['b']);return _0x447c4d;}var names$2=['Geocentric',_0x35a251(0xbff),'geocent',_0x35a251(0xc6c)],geocent={'init':init$2,'forward':forward$2,'inverse':inverse$2,'names':names$2},mode={'N_POLE':0x0,'S_POLE':0x1,'EQUIT':0x2,'OBLIQ':0x3},params={'h':{'def':0x186a0,'num':!![]},'azi':{'def':0x0,'num':!![],'degrees':!![]},'tilt':{'def':0x0,'num':!![],'degrees':!![]},'long0':{'def':0x0,'num':!![]},'lat0':{'def':0x0,'num':!![]}};function init$1(){const _0x1409db={_0xd48f0:0xdbd,_0x5b6928:0xef7,_0x5f2dff:0xe40,_0x4fe830:0xdef},_0x2c6c0c={_0x43afbb:0x2e7},_0x2c1ebc=_0x35a251;Object['keys'](params)[_0x2c1ebc(_0x1409db._0xd48f0)](function(_0x503801){const _0x540e78=_0x2c1ebc;if(typeof this[_0x503801]===_0x540e78(0xc19))this[_0x503801]=params[_0x503801]['def'];else{if(params[_0x503801]['num']&&isNaN(this[_0x503801]))throw new Error(_0x540e78(_0x2c6c0c._0x43afbb)+_0x503801+'\x20=\x20'+this[_0x503801]);else params[_0x503801][_0x540e78(0x6f5)]&&(this[_0x503801]=parseFloat(this[_0x503801]));}params[_0x503801]['degrees']&&(this[_0x503801]=this[_0x503801]*D2R$1);}['bind'](this));if(Math['abs'](Math['abs'](this['lat0'])-HALF_PI)<EPSLN)this[_0x2c1ebc(_0x1409db._0x5b6928)]=this['lat0']<0x0?mode['S_POLE']:mode['N_POLE'];else Math[_0x2c1ebc(0x405)](this[_0x2c1ebc(_0x1409db._0x5f2dff)])<EPSLN?this['mode']=mode['EQUIT']:(this['mode']=mode['OBLIQ'],this['sinph0']=Math['sin'](this[_0x2c1ebc(0xe40)]),this['cosph0']=Math['cos'](this['lat0']));this['pn1']=this['h']/this['a'];if(this['pn1']<=0x0||this['pn1']>0x2540be400)throw new Error('Invalid\x20height');this['p']=0x1+this['pn1'],this['rp']=0x1/this['p'],this['h1']=0x1/this['pn1'],this['pfact']=(this['p']+0x1)*this['h1'],this['es']=0x0;var _0x5d09ca=this['tilt'],_0x5cb25a=this['azi'];this['cg']=Math['cos'](_0x5cb25a),this['sg']=Math[_0x2c1ebc(_0x1409db._0x4fe830)](_0x5cb25a),this['cw']=Math['cos'](_0x5d09ca),this['sw']=Math[_0x2c1ebc(0xdef)](_0x5d09ca);}function forward$1(_0x36b759){const _0x419d4d={_0x9fcdb3:0xdef,_0x20a43d:0xee4},_0x2a6dce=_0x35a251;_0x36b759['x']-=this['long0'];var _0x5d5be1=Math[_0x2a6dce(_0x419d4d._0x9fcdb3)](_0x36b759['y']),_0xbe05f8=Math['cos'](_0x36b759['y']),_0x3fee2b=Math['cos'](_0x36b759['x']),_0x599003,_0x37b019;switch(this['mode']){case mode[_0x2a6dce(0xbe)]:_0x37b019=this['sinph0']*_0x5d5be1+this['cosph0']*_0xbe05f8*_0x3fee2b;break;case mode['EQUIT']:_0x37b019=_0xbe05f8*_0x3fee2b;break;case mode[_0x2a6dce(0xd3)]:_0x37b019=-_0x5d5be1;break;case mode[_0x2a6dce(_0x419d4d._0x20a43d)]:_0x37b019=_0x5d5be1;break;}_0x37b019=this['pn1']/(this['p']-_0x37b019),_0x599003=_0x37b019*_0xbe05f8*Math['sin'](_0x36b759['x']);switch(this['mode']){case mode['OBLIQ']:_0x37b019*=this['cosph0']*_0x5d5be1-this['sinph0']*_0xbe05f8*_0x3fee2b;break;case mode[_0x2a6dce(0x28f)]:_0x37b019*=_0x5d5be1;break;case mode['N_POLE']:_0x37b019*=-(_0xbe05f8*_0x3fee2b);break;case mode['S_POLE']:_0x37b019*=_0xbe05f8*_0x3fee2b;break;}var _0x1a150a,_0x477cc4;return _0x1a150a=_0x37b019*this['cg']+_0x599003*this['sg'],_0x477cc4=0x1/(_0x1a150a*this['sw']*this['h1']+this['cw']),_0x599003=(_0x599003*this['cg']-_0x37b019*this['sg'])*this['cw']*_0x477cc4,_0x37b019=_0x1a150a*_0x477cc4,_0x36b759['x']=_0x599003*this['a'],_0x36b759['y']=_0x37b019*this['a'],_0x36b759;}function inverse$1(_0x4b5bee){const _0x3db56e={_0x361c00:0x76b},_0x37ffb2=_0x35a251;_0x4b5bee['x']/=this['a'],_0x4b5bee['y']/=this['a'];var _0x5865a1={'x':_0x4b5bee['x'],'y':_0x4b5bee['y']},_0x39258d,_0x3a057e,_0x5c237b;_0x5c237b=0x1/(this['pn1']-_0x4b5bee['y']*this['sw']),_0x39258d=this['pn1']*_0x4b5bee['x']*_0x5c237b,_0x3a057e=this[_0x37ffb2(0x61c)]*_0x4b5bee['y']*this['cw']*_0x5c237b,_0x4b5bee['x']=_0x39258d*this['cg']+_0x3a057e*this['sg'],_0x4b5bee['y']=_0x3a057e*this['cg']-_0x39258d*this['sg'];var _0x4542b7=hypot(_0x4b5bee['x'],_0x4b5bee['y']);if(Math['abs'](_0x4542b7)<EPSLN)_0x5865a1['x']=0x0,_0x5865a1['y']=_0x4b5bee['y'];else{var _0x2d0d49,_0x282710;_0x282710=0x1-_0x4542b7*_0x4542b7*this[_0x37ffb2(0x7d5)],_0x282710=(this['p']-Math[_0x37ffb2(_0x3db56e._0x361c00)](_0x282710))/(this['pn1']/_0x4542b7+_0x4542b7/this['pn1']),_0x2d0d49=Math[_0x37ffb2(_0x3db56e._0x361c00)](0x1-_0x282710*_0x282710);switch(this['mode']){case mode['OBLIQ']:_0x5865a1['y']=Math['asin'](_0x2d0d49*this[_0x37ffb2(0x445)]+_0x4b5bee['y']*_0x282710*this[_0x37ffb2(0x1dc)]/_0x4542b7),_0x4b5bee['y']=(_0x2d0d49-this['sinph0']*Math['sin'](_0x5865a1['y']))*_0x4542b7,_0x4b5bee['x']*=_0x282710*this['cosph0'];break;case mode['EQUIT']:_0x5865a1['y']=Math['asin'](_0x4b5bee['y']*_0x282710/_0x4542b7),_0x4b5bee['y']=_0x2d0d49*_0x4542b7,_0x4b5bee['x']*=_0x282710;break;case mode['N_POLE']:_0x5865a1['y']=Math['asin'](_0x2d0d49),_0x4b5bee['y']=-_0x4b5bee['y'];break;case mode['S_POLE']:_0x5865a1['y']=-Math['asin'](_0x2d0d49);break;}_0x5865a1['x']=Math['atan2'](_0x4b5bee['x'],_0x4b5bee['y']);}return _0x4b5bee['x']=_0x5865a1['x']+this['long0'],_0x4b5bee['y']=_0x5865a1['y'],_0x4b5bee;}var names$1=[_0x35a251(0x315),'tpers'],tpers={'init':init$1,'forward':forward$1,'inverse':inverse$1,'names':names$1};function init(){const _0x266abe={_0x291fc3:0x49a,_0x4a28f5:0x76b,_0x3ff5fa:0x3f1,_0x33f9e6:0x732},_0x9306f5=_0x35a251;this[_0x9306f5(0x4dd)]=this['sweep']==='x'?0x1:0x0,this['h']=Number(this['h']),this['radius_g_1']=this['h']/this['a'];if(this['radius_g_1']<=0x0||this[_0x9306f5(0x49a)]>0x2540be400)throw new Error();this[_0x9306f5(0xfe)]=0x1+this[_0x9306f5(_0x266abe._0x291fc3)],this['C']=this['radius_g']*this['radius_g']-0x1;if(this['es']!==0x0){var _0x464f1e=0x1-this['es'],_0x13d17d=0x1/_0x464f1e;this['radius_p']=Math[_0x9306f5(_0x266abe._0x4a28f5)](_0x464f1e),this['radius_p2']=_0x464f1e,this['radius_p_inv2']=_0x13d17d,this[_0x9306f5(_0x266abe._0x3ff5fa)]='ellipse';}else this[_0x9306f5(0x147)]=0x1,this['radius_p2']=0x1,this['radius_p_inv2']=0x1,this[_0x9306f5(0x3f1)]='sphere';!this[_0x9306f5(_0x266abe._0x33f9e6)]&&(this[_0x9306f5(0x732)]=_0x9306f5(0x141));}function forward(_0x3acaf2){const _0x1edeb4={_0x55b667:0x269,_0x1ff5e6:0xdef,_0x2d7793:0x269,_0x2e37cb:0x49a},_0x464223=_0x35a251;var _0x5798c7=_0x3acaf2['x'],_0x5c3f45=_0x3acaf2['y'],_0x37fd43,_0x4b8581,_0x1ea9e3,_0x576742;_0x5798c7=_0x5798c7-this[_0x464223(0x9cb)];if(this['shape']===_0x464223(0xedf)){_0x5c3f45=Math[_0x464223(_0x1edeb4._0x55b667)](this['radius_p2']*Math['tan'](_0x5c3f45));var _0x440bed=this['radius_p']/hypot(this[_0x464223(0x147)]*Math[_0x464223(0xeec)](_0x5c3f45),Math['sin'](_0x5c3f45));_0x4b8581=_0x440bed*Math['cos'](_0x5798c7)*Math['cos'](_0x5c3f45),_0x1ea9e3=_0x440bed*Math[_0x464223(_0x1edeb4._0x1ff5e6)](_0x5798c7)*Math['cos'](_0x5c3f45),_0x576742=_0x440bed*Math['sin'](_0x5c3f45);if((this['radius_g']-_0x4b8581)*_0x4b8581-_0x1ea9e3*_0x1ea9e3-_0x576742*_0x576742*this['radius_p_inv2']<0x0)return _0x3acaf2['x']=Number['NaN'],_0x3acaf2['y']=Number['NaN'],_0x3acaf2;_0x37fd43=this[_0x464223(0xfe)]-_0x4b8581,this['flip_axis']?(_0x3acaf2['x']=this['radius_g_1']*Math['atan'](_0x1ea9e3/hypot(_0x576742,_0x37fd43)),_0x3acaf2['y']=this['radius_g_1']*Math['atan'](_0x576742/_0x37fd43)):(_0x3acaf2['x']=this['radius_g_1']*Math['atan'](_0x1ea9e3/_0x37fd43),_0x3acaf2['y']=this['radius_g_1']*Math[_0x464223(_0x1edeb4._0x2d7793)](_0x576742/hypot(_0x1ea9e3,_0x37fd43)));}else this['shape']==='sphere'&&(_0x37fd43=Math['cos'](_0x5c3f45),_0x4b8581=Math['cos'](_0x5798c7)*_0x37fd43,_0x1ea9e3=Math['sin'](_0x5798c7)*_0x37fd43,_0x576742=Math['sin'](_0x5c3f45),_0x37fd43=this['radius_g']-_0x4b8581,this['flip_axis']?(_0x3acaf2['x']=this['radius_g_1']*Math['atan'](_0x1ea9e3/hypot(_0x576742,_0x37fd43)),_0x3acaf2['y']=this[_0x464223(_0x1edeb4._0x2e37cb)]*Math[_0x464223(0x269)](_0x576742/_0x37fd43)):(_0x3acaf2['x']=this['radius_g_1']*Math[_0x464223(0x269)](_0x1ea9e3/_0x37fd43),_0x3acaf2['y']=this['radius_g_1']*Math[_0x464223(_0x1edeb4._0x55b667)](_0x576742/hypot(_0x1ea9e3,_0x37fd43))));return _0x3acaf2['x']=_0x3acaf2['x']*this['a'],_0x3acaf2['y']=_0x3acaf2['y']*this['a'],_0x3acaf2;}function inverse(_0x37f472){const _0x21a3c9={_0x3119b5:0xedf,_0x336743:0x4dd,_0x476ebd:0x49a,_0x39efb0:0x4bf,_0xd8d7d7:0x269,_0x3391bd:0x3f1,_0x36ed9e:0x9b5,_0x55b576:0x76b},_0x439c37=_0x35a251;var _0x572c74=-0x1,_0x5d10a0=0x0,_0x5db85c=0x0,_0x3d80d9,_0x13f01e,_0x49a350,_0x2a8396;_0x37f472['x']=_0x37f472['x']/this['a'],_0x37f472['y']=_0x37f472['y']/this['a'];if(this['shape']===_0x439c37(_0x21a3c9._0x3119b5)){this[_0x439c37(_0x21a3c9._0x336743)]?(_0x5db85c=Math['tan'](_0x37f472['y']/this['radius_g_1']),_0x5d10a0=Math[_0x439c37(0x9b5)](_0x37f472['x']/this[_0x439c37(0x49a)])*hypot(0x1,_0x5db85c)):(_0x5d10a0=Math['tan'](_0x37f472['x']/this[_0x439c37(0x49a)]),_0x5db85c=Math['tan'](_0x37f472['y']/this[_0x439c37(_0x21a3c9._0x476ebd)])*hypot(0x1,_0x5d10a0));var _0x20d46f=_0x5db85c/this['radius_p'];_0x3d80d9=_0x5d10a0*_0x5d10a0+_0x20d46f*_0x20d46f+_0x572c74*_0x572c74,_0x13f01e=0x2*this['radius_g']*_0x572c74,_0x49a350=_0x13f01e*_0x13f01e-0x4*_0x3d80d9*this['C'];if(_0x49a350<0x0)return _0x37f472['x']=Number['NaN'],_0x37f472['y']=Number[_0x439c37(_0x21a3c9._0x39efb0)],_0x37f472;_0x2a8396=(-_0x13f01e-Math['sqrt'](_0x49a350))/(0x2*_0x3d80d9),_0x572c74=this['radius_g']+_0x2a8396*_0x572c74,_0x5d10a0*=_0x2a8396,_0x5db85c*=_0x2a8396,_0x37f472['x']=Math['atan2'](_0x5d10a0,_0x572c74),_0x37f472['y']=Math[_0x439c37(_0x21a3c9._0xd8d7d7)](_0x5db85c*Math['cos'](_0x37f472['x'])/_0x572c74),_0x37f472['y']=Math['atan'](this['radius_p_inv2']*Math['tan'](_0x37f472['y']));}else{if(this[_0x439c37(_0x21a3c9._0x3391bd)]==='sphere'){this['flip_axis']?(_0x5db85c=Math['tan'](_0x37f472['y']/this['radius_g_1']),_0x5d10a0=Math['tan'](_0x37f472['x']/this[_0x439c37(_0x21a3c9._0x476ebd)])*Math[_0x439c37(0x76b)](0x1+_0x5db85c*_0x5db85c)):(_0x5d10a0=Math['tan'](_0x37f472['x']/this[_0x439c37(_0x21a3c9._0x476ebd)]),_0x5db85c=Math[_0x439c37(_0x21a3c9._0x36ed9e)](_0x37f472['y']/this[_0x439c37(0x49a)])*Math['sqrt'](0x1+_0x5d10a0*_0x5d10a0));_0x3d80d9=_0x5d10a0*_0x5d10a0+_0x5db85c*_0x5db85c+_0x572c74*_0x572c74,_0x13f01e=0x2*this['radius_g']*_0x572c74,_0x49a350=_0x13f01e*_0x13f01e-0x4*_0x3d80d9*this['C'];if(_0x49a350<0x0)return _0x37f472['x']=Number['NaN'],_0x37f472['y']=Number['NaN'],_0x37f472;_0x2a8396=(-_0x13f01e-Math[_0x439c37(_0x21a3c9._0x55b576)](_0x49a350))/(0x2*_0x3d80d9),_0x572c74=this['radius_g']+_0x2a8396*_0x572c74,_0x5d10a0*=_0x2a8396,_0x5db85c*=_0x2a8396,_0x37f472['x']=Math['atan2'](_0x5d10a0,_0x572c74),_0x37f472['y']=Math['atan'](_0x5db85c*Math['cos'](_0x37f472['x'])/_0x572c74);}}return _0x37f472['x']=_0x37f472['x']+this['long0'],_0x37f472;}var names=['Geostationary\x20Satellite\x20View','Geostationary_Satellite',_0x35a251(0x8af)],geos={'init':init,'forward':forward,'inverse':inverse,'names':names};function includedProjections(_0x1a4ef8){const _0x35112d={_0x223796:0x684,_0x49f859:0x4af,_0x1072a7:0xbf6,_0x1c82fe:0xbf6,_0x2b8a6b:0x684},_0x31b8b2=_0x35a251;_0x1a4ef8['Proj']['projections']['add'](tmerc),_0x1a4ef8[_0x31b8b2(_0x35112d._0x223796)][_0x31b8b2(0xbf6)]['add'](etmerc),_0x1a4ef8[_0x31b8b2(0x684)]['projections'][_0x31b8b2(_0x35112d._0x49f859)](utm),_0x1a4ef8['Proj']['projections']['add'](sterea),_0x1a4ef8['Proj'][_0x31b8b2(_0x35112d._0x1072a7)]['add'](stere),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](somerc),_0x1a4ef8[_0x31b8b2(_0x35112d._0x223796)]['projections'][_0x31b8b2(0x4af)](omerc),_0x1a4ef8['Proj']['projections']['add'](lcc),_0x1a4ef8['Proj']['projections']['add'](krovak),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](cass),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](laea),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](aea),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](gnom),_0x1a4ef8[_0x31b8b2(0x684)]['projections']['add'](cea),_0x1a4ef8['Proj']['projections']['add'](eqc),_0x1a4ef8[_0x31b8b2(_0x35112d._0x223796)]['projections']['add'](poly),_0x1a4ef8['Proj'][_0x31b8b2(_0x35112d._0x1c82fe)][_0x31b8b2(_0x35112d._0x49f859)](nzmg),_0x1a4ef8['Proj']['projections'][_0x31b8b2(0x4af)](mill),_0x1a4ef8['Proj']['projections'][_0x31b8b2(_0x35112d._0x49f859)](sinu),_0x1a4ef8['Proj'][_0x31b8b2(_0x35112d._0x1c82fe)]['add'](moll),_0x1a4ef8['Proj']['projections'][_0x31b8b2(_0x35112d._0x49f859)](eqdc),_0x1a4ef8['Proj']['projections']['add'](vandg),_0x1a4ef8['Proj'][_0x31b8b2(0xbf6)]['add'](aeqd),_0x1a4ef8[_0x31b8b2(0x684)]['projections'][_0x31b8b2(0x4af)](ortho),_0x1a4ef8['Proj']['projections'][_0x31b8b2(0x4af)](qsc),_0x1a4ef8['Proj']['projections']['add'](robin),_0x1a4ef8['Proj']['projections']['add'](geocent),_0x1a4ef8[_0x31b8b2(_0x35112d._0x2b8a6b)]['projections']['add'](tpers),_0x1a4ef8[_0x31b8b2(0x684)]['projections'][_0x31b8b2(0x4af)](geos);}proj4[_0x35a251(0xc8f)]='WGS84',proj4['Proj']=Projection,proj4['WGS84']=new proj4['Proj']('WGS84'),proj4['Point']=Point,proj4['toPoint']=common,proj4['defs']=defs,proj4[_0x35a251(0xb6a)]=nadgrid,proj4['transform']=transform,proj4[_0x35a251(0xc47)]=mgrs,proj4['version']='__VERSION__',includedProjections(proj4);const CRS={'EPSG3857':'EPSG:3857','EPSG4326':'EPSG:4326','EPSG4490':'EPSG:4490','CGCS2000_GK_Zone_3':'CGCS2000_GK_Zone_3','CGCS2000_GK_Zone_6':_0x35a251(0x3d2),'CGCS2000_GK_CM_3':'CGCS2000_GK_CM_3','CGCS2000_GK_CM_6':'CGCS2000_GK_CM_6'},PI$1=3.141592653589793;class LngLatPoint{constructor(_0x426ee3,_0x399210,_0x58634d){this['_lng']=Number(_0x426ee3||0x0),this['_lat']=Number(_0x399210||0x0),this['_alt']=Number(_0x58634d||0x0);}get['lng'](){return this['_lng'];}set['lng'](_0x3ccbd8){const _0x16cb60=_0x35a251;this['_lng']=+_0x3ccbd8,this[_0x16cb60(0xdb7)]=null;}get['lat'](){return this['_lat'];}set[_0x35a251(0xb9d)](_0x89bfa0){this['_lat']=+_0x89bfa0,this['_position']=null;}get[_0x35a251(0x5d2)](){const _0x586028={_0x53730e:0xc9a},_0x5d3ab5=_0x35a251;return this[_0x5d3ab5(_0x586028._0x53730e)]||0x0;}set['alt'](_0x1f46f4){this['_alt']=+_0x1f46f4,this['_position']&&this['_position']instanceof Cesium__namespace['Cartesian3']&&(this['_position']=null);}['clone'](){const _0x291d0f=new LngLatPoint();return _0x291d0f['lng']=this['lng']||0x0,_0x291d0f['lat']=this['lat']||0x0,_0x291d0f['alt']=this['alt']||0x0,_0x291d0f;}['format'](){const _0xcca823={_0x2ad7e8:0xfa7,_0x1ed8d8:0x5b6},_0xf89b00=_0x35a251;return this[_0xf89b00(_0xcca823._0x2ad7e8)]=formatNum$2(this['lng'],LngLatPoint['FormatLength']),this[_0xf89b00(0xb9d)]=formatNum$2(this['lat'],LngLatPoint[_0xf89b00(_0xcca823._0x1ed8d8)]),this['alt']=formatNum$2(this['alt'],LngLatPoint['FormatAltLength']),this;}['toArray'](_0x1ec363){const _0x1e84d0=_0x35a251;return this['format'](),_0x1ec363?[this['lng'],this['lat']]:[this['lng'],this[_0x1e84d0(0xb9d)],this[_0x1e84d0(0x5d2)]];}['toString'](){const _0x178dba=_0x35a251;return this['format'](),this['lng']+','+this[_0x178dba(0xb9d)]+','+this['alt'];}['toCartesian'](_0x5d0a80=![]){const _0x5a496b=_0x35a251;return!_0x5d0a80&&this['_position']?this['_position']:Cesium__namespace['Cartesian3']['fromDegrees'](this['lng'],this['lat'],this[_0x5a496b(0x5d2)]);}['toCartographic'](){const _0x2ff33e=_0x35a251;return Cesium__namespace['Cartographic'][_0x2ff33e(0xa6d)](this['lng'],this['lat'],this['alt']);}['toMercator'](){const _0x1ff6a1=_0x35a251;let _0x2acc2c=Math['min'](this['lng'],0xb4);_0x2acc2c=Math['max'](_0x2acc2c,-0xb4);let _0x1631fa=Math['min'](this[_0x1ff6a1(0xb9d)],85.05112877980659);_0x1631fa=Math['max'](_0x1631fa,-85.05112877980659);const _0x35efea=_0x2acc2c*20037508.34/0xb4;let _0x25bbc2=Math['log'](Math['tan']((0x5a+_0x1631fa)*PI$1/0x168))/(PI$1/0xb4);return _0x25bbc2=_0x25bbc2*20037508.34/0xb4,[_0x35efea,_0x25bbc2,this['alt']];}[_0x35a251(0x417)](_0x3e233b){const _0x3348cf={_0x972de7:0x2fa},_0x4b17e=_0x35a251;return this===_0x3e233b||_0x3e233b instanceof LngLatPoint&&this['_alt']===_0x3e233b['_alt']&&this[_0x4b17e(0x2fa)]===_0x3e233b[_0x4b17e(_0x3348cf._0x972de7)]&&this['_lng']===_0x3e233b['_lng'];}['valid'](){const _0x1c5927={_0x4e99a1:0xc9a},_0x41fe51=_0x35a251;if(isNaN(this['_lat'])||isNaN(this['_lng']))return![];if(this['_lat']<-0x5a||this[_0x41fe51(0x2fa)]>0x5a||this['_lng']<-0xb4||this['_lng']>0xb4)return![];if(this['_lat']===0x0&&this[_0x41fe51(0x1ed)]===0x0&&this[_0x41fe51(_0x1c5927._0x4e99a1)]===0x0)return![];return!![];}static['parse'](_0x15e923,_0x515063){const _0x4a8017={_0x3220c7:0x8eb},_0x34ef67=_0x35a251;if(!_0x15e923)return new LngLatPoint();if(_0x15e923 instanceof LngLatPoint)return _0x15e923;let _0x2f02b9;if(typeof _0x15e923==='string')_0x2f02b9=LngLatPoint['fromString'](_0x15e923);else{if(Array['isArray'](_0x15e923))_0x2f02b9=LngLatPoint['fromArray'](_0x15e923);else{if(_0x15e923 instanceof LngLatPoint)_0x2f02b9=_0x15e923['clone']();else{if(Cesium__namespace['defined'](_0x15e923['lat'])&&Cesium__namespace[_0x34ef67(0xaa2)](_0x15e923['lng'])){_0x2f02b9=new LngLatPoint(_0x15e923['lng'],_0x15e923['lat'],_0x15e923['alt']);for(const _0x42bfac in _0x15e923){_0x2f02b9[_0x42bfac]=_0x15e923[_0x42bfac];}}else{if(_0x15e923 instanceof Cesium__namespace['Cartesian3']||_0x15e923['_value']||_0x15e923['getValue'])_0x2f02b9=LngLatPoint[_0x34ef67(0x9b1)](_0x15e923,_0x515063),_0x2f02b9['_position']=_0x15e923;else Cesium__namespace['defined'](_0x15e923['x'])&&Cesium__namespace['defined'](_0x15e923['y'])&&Cesium__namespace['defined'](_0x15e923['z'])?(_0x15e923=new Cesium__namespace[(_0x34ef67(_0x4a8017._0x3220c7))](_0x15e923['x'],_0x15e923['y'],_0x15e923['z']),_0x2f02b9=LngLatPoint['fromCartesian'](_0x15e923,_0x515063),_0x2f02b9['_position']=_0x15e923):(_0x2f02b9=new LngLatPoint(),logError$1('坐标解析失败,请确认参数是否无误',_0x15e923));}}}}return _0x2f02b9;}static['fromArray'](_0x4635fa){const _0x57c761=_0x35a251,_0x2004a0=new LngLatPoint();return Array['isArray'](_0x4635fa)&&(_0x2004a0['lng']=_0x4635fa[0x0]||0x0,_0x2004a0['lat']=_0x4635fa[0x1]||0x0,_0x2004a0[_0x57c761(0x5d2)]=_0x4635fa[0x2]||0x0),_0x2004a0;}static[_0x35a251(0xdf5)](_0x5e8f31){const _0x297d9d={_0x590885:0x96e},_0x381bc1=_0x35a251;let _0x136d54=new LngLatPoint();if(_0x5e8f31&&typeof _0x5e8f31==='string'){const _0x5a2f9a=_0x5e8f31['split'](',');_0x136d54=this[_0x381bc1(_0x297d9d._0x590885)](_0x5a2f9a);}return _0x136d54;}static['fromCartesian'](_0x11b405,_0x370773){const _0x1cd516={_0x2fc59f:0x8eb,_0xde3846:0x579,_0xa5a2d0:0x9c5,_0x33872f:0xc26},_0x4529de=_0x35a251,_0x563184=new LngLatPoint();let _0x53eb08;if(_0x11b405){if(_0x11b405 instanceof Cesium__namespace[_0x4529de(_0x1cd516._0x2fc59f)])_0x53eb08=_0x11b405;else{if(_0x11b405['_value']&&_0x11b405[_0x4529de(0xc5d)]instanceof Cesium__namespace['Cartesian3'])_0x53eb08=_0x11b405['_value'];else typeof _0x11b405['getValue']==='function'&&(_0x53eb08=_0x11b405['getValue'](_0x370773||Cesium__namespace[_0x4529de(_0x1cd516._0xde3846)]['now']()));}}if(_0x53eb08){const _0x4235af=Cesium__namespace['Cartographic']['fromCartesian'](_0x53eb08);_0x4235af&&(_0x563184[_0x4529de(0xb9d)]=Cesium__namespace['Math']['toDegrees'](_0x4235af[_0x4529de(0x580)]),_0x563184['lng']=Cesium__namespace[_0x4529de(0x7c0)][_0x4529de(_0x1cd516._0xa5a2d0)](_0x4235af[_0x4529de(_0x1cd516._0x33872f)]),_0x563184['alt']=_0x4235af['height'],_0x563184['format']());}return _0x563184['_position']=_0x11b405,_0x563184;}static['fromCartographic'](_0x54e86f){const _0x108ea7={_0xc9702f:0x7c0},_0x2ae8b6=_0x35a251,_0x355ac8=new LngLatPoint();return _0x355ac8['lat']=Cesium__namespace[_0x2ae8b6(_0x108ea7._0xc9702f)]['toDegrees'](_0x54e86f['latitude']),_0x355ac8['lng']=Cesium__namespace['Math']['toDegrees'](_0x54e86f[_0x2ae8b6(0xc26)]),_0x355ac8['alt']=_0x54e86f['height'],_0x355ac8;}static['fromMercator'](_0x3c5e8e){const _0xfc6be1=Number(_0x3c5e8e[0x0]),_0x37b3b6=Number(_0x3c5e8e[0x1]),_0x29bcb7=_0xfc6be1/20037508.34*0xb4;let _0x43267a=_0x37b3b6/20037508.34*0xb4;_0x43267a=0xb4/PI$1*(0x2*Math['atan'](Math['exp'](_0x43267a*PI$1/0xb4))-PI$1/0x2);const _0x37115b=new LngLatPoint(_0x29bcb7,_0x43267a,_0x3c5e8e[0x2]||0x0);return _0x37115b;}static[_0x35a251(0xa43)](_0x41b1fb,_0x13b296){if(!_0x41b1fb||_0x41b1fb instanceof Cesium__namespace['Cartesian3'])return _0x41b1fb;return LngLatPoint['parse'](_0x41b1fb,_0x13b296)['toCartesian'](!![]);}static[_0x35a251(0x949)](_0x3c861a,_0x35cb8e){if(!_0x3c861a||_0x3c861a instanceof Cesium__namespace['Cartographic'])return _0x3c861a;return LngLatPoint['parse'](_0x3c861a,_0x35cb8e)['toCartographic']();}static['toArray'](_0x4c580d,_0x23a5cc){const _0x5dc750={_0x367965:0x8d0},_0xca39d4=_0x35a251,_0x42f560=LngLatPoint[_0xca39d4(_0x5dc750._0x367965)](_0x4c580d);if(!_0x42f560||!_0x42f560['valid']())return[];return _0x42f560[_0xca39d4(0x769)](_0x23a5cc);}}LngLatPoint['FormatLength']=0x6,LngLatPoint['FormatAltLength']=0x1;function formatNum$2(_0x6eab6f,_0x5b8e63=0x0){const _0x1bd424={_0x36242b:0xda4,_0x295902:0xca6},_0x1a876a=_0x35a251,_0x47faca=Math[_0x1a876a(_0x1bd424._0x36242b)](0xa,_0x5b8e63);return Math[_0x1a876a(_0x1bd424._0x295902)](_0x6eab6f*_0x47faca)/_0x47faca;}class LngLatArray{static[_0x35a251(0xcf)](_0x5b03d3,_0x2ef1a9){if(!_0x5b03d3||!Array['isArray'](_0x5b03d3))return _0x5b03d3;const _0x1cc578=[];return _0x5b03d3['forEach'](function(_0x4ea895){const _0x32f5ee=_0x2767;if(_0x4ea895 instanceof Cesium__namespace['Cartesian3']){_0x2ef1a9?_0x1cc578['push'](_0x4ea895['clone']()):_0x1cc578['push'](_0x4ea895);return;}const _0x415307=LngLatPoint[_0x32f5ee(0x8d0)](_0x4ea895);if(!_0x415307||!_0x415307[_0x32f5ee(0x4a0)]())return;_0x1cc578['push'](_0x415307[_0x32f5ee(0xa43)](!![]));}),_0x1cc578;}static['toCartographics'](_0x3cc8df,_0x891e79){const _0xbe2a69={_0xad0bfe:0xdbd},_0x3fe920=_0x35a251;if(!_0x3cc8df||!Array[_0x3fe920(0x719)](_0x3cc8df))return _0x3cc8df;const _0x438201=[];return _0x3cc8df[_0x3fe920(_0xbe2a69._0xad0bfe)](function(_0x3ad112){const _0x5c6b14=_0x3fe920;if(_0x3ad112 instanceof Cesium__namespace[_0x5c6b14(0x120)]){_0x891e79?_0x438201['push'](_0x3ad112[_0x5c6b14(0xd61)]()):_0x438201['push'](_0x3ad112);return;}const _0x5c6246=LngLatPoint['parse'](_0x3ad112);if(!_0x5c6246||!_0x5c6246['valid']())return;_0x438201['push'](_0x5c6246['toCartographic']());}),_0x438201;}static['toPoints'](_0x1f8d5e,_0x29be33){const _0x4fe333={_0x2a3237:0x8d0,_0x6b6056:0x6de};if(!_0x1f8d5e||!Array['isArray'](_0x1f8d5e))return _0x1f8d5e;const _0x34788c=[];return _0x1f8d5e['forEach'](function(_0x2ee15d){const _0x3ede5a=_0x2767;if(_0x2ee15d instanceof LngLatPoint&&!_0x29be33){_0x34788c[_0x3ede5a(0x6de)](_0x2ee15d);return;}const _0xdd466a=LngLatPoint[_0x3ede5a(_0x4fe333._0x2a3237)](_0x2ee15d);if(!_0xdd466a||!_0xdd466a['valid']())return;_0x34788c[_0x3ede5a(_0x4fe333._0x6b6056)](_0xdd466a);}),_0x34788c;}static[_0x35a251(0x769)](_0x2b5003,_0x9b6287){const _0x12cf2d={_0x300256:0x719,_0x18bcb7:0x6de,_0x26f269:0x769};if(!_0x2b5003||!Array['isArray'](_0x2b5003))return _0x2b5003;const _0x545272=[];return _0x2b5003['forEach'](function(_0x4f8efb){const _0x4444b2=_0x2767;if(Array[_0x4444b2(_0x12cf2d._0x300256)](_0x4f8efb)){_0x545272['push'](_0x4f8efb);return;}const _0x3d96bb=LngLatPoint['parse'](_0x4f8efb);if(!_0x3d96bb||!_0x3d96bb['valid']())return;_0x545272[_0x4444b2(_0x12cf2d._0x18bcb7)](_0x3d96bb[_0x4444b2(_0x12cf2d._0x26f269)](_0x9b6287));}),_0x545272;}}function degree2dms(_0x537b6c){let _0x57a666=0x1;_0x537b6c<0x0&&(_0x57a666=-0x1);_0x537b6c=Math['abs'](_0x537b6c);let _0x5870af=Math['floor'](_0x537b6c);const _0x2439fb=Math['floor']((_0x537b6c-_0x5870af)*0x3c),_0x5556b4=Math['round']((_0x537b6c-_0x5870af)*0xe10%0x3c);return _0x5870af*=_0x57a666,{'degree':_0x5870af,'minute':_0x2439fb,'second':_0x5556b4,'str':_0x5870af+'°\x20'+_0x2439fb+'\x27\x20\x20'+_0x5556b4+'\x22'};}function dms2degree(_0x3882f4,_0x318003,_0x42ebf1){let _0x2dac23=Math['abs'](_0x3882f4)+_0x318003/0x3c+_0x42ebf1/0xe10;return _0x3882f4<0x0&&(_0x2dac23*=-0x1),_0x2dac23;}function getCGCS2000EPSGByLng(_0x2d476d,_0x59b7d8,_0x3b1a41=!![]){let _0x3c6e6b;if(_0x59b7d8){const _0x317c14=parseInt(_0x2d476d/0x6)+0x1;if(_0x317c14<0xd||_0x317c14>0x17)return undefined;_0x3b1a41?_0x3c6e6b=_0x317c14+0x117e:_0x3c6e6b=_0x317c14+0x1189;}else{const _0x5dc0e7=parseInt((_0x2d476d-1.5)/0x3)+0x1;if(_0x5dc0e7<0x19||_0x5dc0e7>0x2d)return undefined;_0x3b1a41?_0x3c6e6b=_0x5dc0e7+0x1188:_0x3c6e6b=_0x5dc0e7+0x119d;}return'EPSG:'+_0x3c6e6b;}function getCGCS2000EPSGByX(_0x377857){const _0xe9bc43={_0xffc3a:0x591},_0x346997=_0x35a251,_0x36bd03=parseInt(_0x377857[_0x346997(_0xe9bc43._0xffc3a)]()['slice'](0x0,0x2));if(_0x36bd03>=0xd&&_0x36bd03<=0x17)return'EPSG:'+(_0x36bd03+0x117e);else return _0x36bd03>=0x19&&_0x36bd03<=0x2d?'EPSG:'+(_0x36bd03+0x1188):undefined;}function proj4Trans(_0x509839,_0x4905ae,_0x2c032a='EPSG:4326'){const _0x5d4e6c={_0x31618e:0xb5c,_0x3366fe:0xb5c},_0x4ccf97=_0x35a251;if(!_0x4905ae||!_0x2c032a||_0x4905ae===_0x2c032a)return _0x509839;try{(_0x4905ae===CRS[_0x4ccf97(_0x5d4e6c._0x31618e)]||_0x4905ae===CRS['CGCS2000_GK_Zone_6'])&&(_0x4905ae=getCGCS2000EPSGByX(_0x509839[0x0]));if(_0x2c032a===CRS[_0x4ccf97(_0x5d4e6c._0x3366fe)])_0x2c032a=getCGCS2000EPSGByLng(_0x509839[0x0],![],!![]);else{if(_0x2c032a===CRS['CGCS2000_GK_Zone_6'])_0x2c032a=getCGCS2000EPSGByLng(_0x509839[0x0],!![],!![]);else{if(_0x2c032a===CRS['CGCS2000_GK_CM_3'])_0x2c032a=getCGCS2000EPSGByLng(_0x509839[0x0],![],![]);else _0x2c032a===CRS['CGCS2000_GK_CM_6']&&(_0x2c032a=getCGCS2000EPSGByLng(_0x509839[0x0],!![],![]));}}if(!_0x4905ae||!_0x2c032a||_0x4905ae===_0x2c032a)return _0x509839;const _0x4379db=proj4(_0x4905ae,_0x2c032a,_0x509839);if(Cesium__namespace['defined'](_0x4379db)&&_0x4379db['length']>0x1&&!isNaN(_0x4379db[0x0])&&_0x4379db[0x0]!==Infinity)return _0x4379db;}catch(_0x209e0c){}return _0x509839;}function proj4TransArr(_0xbbc880,_0x376b6b,_0x63c7a4=_0x35a251(0x4fd)){const _0x1074a9=_0x35a251;if(!_0x376b6b||_0x376b6b===_0x63c7a4)return _0xbbc880;const _0x4377b7=[];for(let _0x195ea9=0x0,_0x5bd908=_0xbbc880['length'];_0x195ea9<_0x5bd908;_0x195ea9++){const _0x172152=_0xbbc880[_0x195ea9];if(Array['isArray'](_0x172152[0x0])){const _0x378204=proj4TransArr(_0x172152,_0x376b6b,_0x63c7a4);_0x378204&&_0x378204['length']>0x0&&_0x4377b7['push'](_0x378204);}else{const _0x132b92=proj4Trans(_0x172152,_0x376b6b,_0x63c7a4);_0x132b92&&_0x4377b7[_0x1074a9(0x6de)](_0x132b92);}}return _0x4377b7;}function cartesian2lonlat(_0x11da9c,_0x2e664d){const _0x442136=_0x35a251;return LngLatPoint[_0x442136(0x769)](_0x11da9c,_0x2e664d);}function cartesians2lonlats(_0x56a60b,_0x4c9d30){return LngLatArray['toArray'](_0x56a60b,_0x4c9d30);}function cartesian2mercator(_0x44827a){if(!_0x44827a)return null;const _0x1f6e15=LngLatPoint['fromCartesian'](_0x44827a);return _0x1f6e15['toMercator']();}function cartesians2mercators(_0x1fc202){const _0x34f3f5=[];for(let _0x369efe=0x0,_0x42cd1f=_0x1fc202['length'];_0x369efe<_0x42cd1f;_0x369efe++){const _0x36a8cb=cartesian2mercator(_0x1fc202[_0x369efe]);_0x36a8cb&&_0x34f3f5['push'](_0x36a8cb);}return _0x34f3f5;}function lonlat2cartesian(_0x15fdc6,_0x513ed0=0x0){if(!_0x15fdc6||_0x15fdc6['length']<0x2)return null;return Cesium__namespace['Cartesian3']['fromDegrees'](_0x15fdc6[0x0],_0x15fdc6[0x1],_0x15fdc6[0x2]||_0x513ed0);}function lonlats2cartesians(_0x38032d,_0x398c86){const _0x80d49f=_0x35a251,_0x4cd738=[];for(let _0x498e6e=0x0,_0x518b69=_0x38032d[_0x80d49f(0xe1e)];_0x498e6e<_0x518b69;_0x498e6e++){const _0x105de0=_0x38032d[_0x498e6e];if(Array['isArray'](_0x105de0[0x0])){const _0x12dd12=lonlats2cartesians(_0x105de0,_0x398c86);_0x12dd12&&_0x12dd12['length']>0x0&&_0x4cd738[_0x80d49f(0x6de)](_0x12dd12);}else{const _0x51fd8a=lonlat2cartesian(_0x105de0,_0x398c86);_0x51fd8a&&_0x4cd738['push'](_0x51fd8a);}}return _0x4cd738;}function lonlat2mercator(_0x455730){const _0x1fcbfe={_0x1ec5c5:0x96e},_0x419e16=_0x35a251,_0x1ba3a6=LngLatPoint[_0x419e16(_0x1fcbfe._0x1ec5c5)](_0x455730);return _0x1ba3a6['toMercator']();}function lonlats2mercators(_0x353464){const _0x3410f2=[];for(let _0x5ab141=0x0,_0x121ae5=_0x353464['length'];_0x5ab141<_0x121ae5;_0x5ab141++){const _0xe2ce7=lonlat2mercator(_0x353464[_0x5ab141]);_0x3410f2['push'](_0xe2ce7);}return _0x3410f2;}function mercator2cartesian(_0x3b6820,_0x10cb98){if(isNaN(_0x3b6820[0x0])||isNaN(_0x3b6820[0x1]))return null;const _0xac2de6=LngLatPoint['fromMercator'](_0x3b6820);return Cesium__namespace['defined'](_0x10cb98)&&(_0xac2de6['alt']=_0x10cb98),_0xac2de6['toCartesian']();}function mercators2cartesians(_0x3d7409,_0x398600){const _0x689fa6={_0x464093:0xe1e},_0x207692=_0x35a251,_0xf34d6=[];for(let _0x5cc8bf=0x0,_0x4f5b03=_0x3d7409[_0x207692(_0x689fa6._0x464093)];_0x5cc8bf<_0x4f5b03;_0x5cc8bf++){const _0x2eb6a4=mercator2cartesian(_0x3d7409[_0x5cc8bf],_0x398600);_0x2eb6a4&&_0xf34d6[_0x207692(0x6de)](_0x2eb6a4);}return _0xf34d6;}function mercator2lonlat(_0x1509be){const _0x307edb=LngLatPoint['fromMercator'](_0x1509be);return _0x307edb['toArray']();}function mercators2lonlats(_0x189eb2){const _0x22f973=[];for(let _0x484dae=0x0,_0xb6b2e7=_0x189eb2['length'];_0x484dae<_0xb6b2e7;_0x484dae++){const _0x46cc34=mercator2lonlat(_0x189eb2[_0x484dae]);_0x22f973['push'](_0x46cc34);}return _0x22f973;}const x_PI=3.141592653589793*0xbb8/0xb4,PI=3.141592653589793,a=0x615305,ee=0.00669342162296594;function transformlat(_0x7c5687,_0x582452){const _0x58e620={_0x5b1faa:0xdef},_0x2da520=_0x35a251;let _0x1da275=-0x64+0x2*_0x7c5687+0x3*_0x582452+0.2*_0x582452*_0x582452+0.1*_0x7c5687*_0x582452+0.2*Math['sqrt'](Math['abs'](_0x7c5687));return _0x1da275+=(0x14*Math['sin'](0x6*_0x7c5687*PI)+0x14*Math['sin'](0x2*_0x7c5687*PI))*0x2/0x3,_0x1da275+=(0x14*Math['sin'](_0x582452*PI)+0x28*Math['sin'](_0x582452/0x3*PI))*0x2/0x3,_0x1da275+=(0xa0*Math[_0x2da520(_0x58e620._0x5b1faa)](_0x582452/0xc*PI)+0x140*Math[_0x2da520(_0x58e620._0x5b1faa)](_0x582452*PI/0x1e))*0x2/0x3,_0x1da275;}function transformlng(_0x46b10d,_0xe5ddcf){const _0xb6b3cb=_0x35a251;let _0x199683=0x12c+_0x46b10d+0x2*_0xe5ddcf+0.1*_0x46b10d*_0x46b10d+0.1*_0x46b10d*_0xe5ddcf+0.1*Math[_0xb6b3cb(0x76b)](Math[_0xb6b3cb(0x405)](_0x46b10d));return _0x199683+=(0x14*Math['sin'](0x6*_0x46b10d*PI)+0x14*Math[_0xb6b3cb(0xdef)](0x2*_0x46b10d*PI))*0x2/0x3,_0x199683+=(0x14*Math[_0xb6b3cb(0xdef)](_0x46b10d*PI)+0x28*Math['sin'](_0x46b10d/0x3*PI))*0x2/0x3,_0x199683+=(0x96*Math['sin'](_0x46b10d/0xc*PI)+0x12c*Math[_0xb6b3cb(0xdef)](_0x46b10d/0x1e*PI))*0x2/0x3,_0x199683;}function out_of_china(_0x526a6c,_0x31e16a){return _0x526a6c<72.004||_0x526a6c>137.8347||_0x31e16a<0.8293||_0x31e16a>55.8271||![];}function bd2gcj(_0x2b9d3a){const _0xa236f2=Number(_0x2b9d3a[0x0]),_0x540785=Number(_0x2b9d3a[0x1]),_0x2218c7=3.141592653589793*0xbb8/0xb4,_0x396c65=_0xa236f2-0.0065,_0x4f1cd1=_0x540785-0.006,_0x2ed35c=Math['sqrt'](_0x396c65*_0x396c65+_0x4f1cd1*_0x4f1cd1)-0.00002*Math['sin'](_0x4f1cd1*_0x2218c7),_0x472a41=Math['atan2'](_0x4f1cd1,_0x396c65)-0.000003*Math['cos'](_0x396c65*_0x2218c7);let _0x2d6920=_0x2ed35c*Math['cos'](_0x472a41),_0x234157=_0x2ed35c*Math['sin'](_0x472a41);return _0x2d6920=Number(_0x2d6920['toFixed'](0x6)),_0x234157=Number(_0x234157['toFixed'](0x6)),[_0x2d6920,_0x234157];}function gcj2bd(_0x2b76cb){const _0x3a771a={_0x119fb5:0xdef},_0xcc4833=_0x35a251,_0x486cec=Number(_0x2b76cb[0x0]),_0x5815fc=Number(_0x2b76cb[0x1]),_0x499c05=Math['sqrt'](_0x486cec*_0x486cec+_0x5815fc*_0x5815fc)+0.00002*Math[_0xcc4833(0xdef)](_0x5815fc*x_PI),_0x42c00a=Math['atan2'](_0x5815fc,_0x486cec)+0.000003*Math['cos'](_0x486cec*x_PI);let _0x17eae7=_0x499c05*Math['cos'](_0x42c00a)+0.0065,_0x49d3f6=_0x499c05*Math[_0xcc4833(_0x3a771a._0x119fb5)](_0x42c00a)+0.006;return _0x17eae7=Number(_0x17eae7['toFixed'](0x6)),_0x49d3f6=Number(_0x49d3f6['toFixed'](0x6)),[_0x17eae7,_0x49d3f6];}function wgs2gcj(_0x53e0f9){const _0xe320e7={_0x3879e5:0xeec},_0x587f53=_0x35a251,_0x100e5b=Number(_0x53e0f9[0x0]),_0x33602c=Number(_0x53e0f9[0x1]);if(out_of_china(_0x100e5b,_0x33602c))return[_0x100e5b,_0x33602c];else{let _0xc55ef1=transformlat(_0x100e5b-0x69,_0x33602c-0x23),_0x20c799=transformlng(_0x100e5b-0x69,_0x33602c-0x23);const _0x4c7455=_0x33602c/0xb4*PI;let _0x418969=Math['sin'](_0x4c7455);_0x418969=0x1-ee*_0x418969*_0x418969;const _0x5d2be6=Math[_0x587f53(0x76b)](_0x418969);_0xc55ef1=_0xc55ef1*0xb4/(a*(0x1-ee)/(_0x418969*_0x5d2be6)*PI),_0x20c799=_0x20c799*0xb4/(a/_0x5d2be6*Math[_0x587f53(_0xe320e7._0x3879e5)](_0x4c7455)*PI);let _0x2cc030=_0x33602c+_0xc55ef1,_0x1163aa=_0x100e5b+_0x20c799;return _0x1163aa=Number(_0x1163aa['toFixed'](0x6)),_0x2cc030=Number(_0x2cc030['toFixed'](0x6)),[_0x1163aa,_0x2cc030];}}function gcj2wgs(_0x67daac){const _0x21d3d8={_0x684455:0xeec},_0x263616=_0x35a251,_0x1b5be4=Number(_0x67daac[0x0]),_0x27c594=Number(_0x67daac[0x1]);if(out_of_china(_0x1b5be4,_0x27c594))return[_0x1b5be4,_0x27c594];else{let _0x5a5e64=transformlat(_0x1b5be4-0x69,_0x27c594-0x23),_0x27b5e1=transformlng(_0x1b5be4-0x69,_0x27c594-0x23);const _0x28e410=_0x27c594/0xb4*PI;let _0x3bd70f=Math['sin'](_0x28e410);_0x3bd70f=0x1-ee*_0x3bd70f*_0x3bd70f;const _0x31bcba=Math[_0x263616(0x76b)](_0x3bd70f);_0x5a5e64=_0x5a5e64*0xb4/(a*(0x1-ee)/(_0x3bd70f*_0x31bcba)*PI),_0x27b5e1=_0x27b5e1*0xb4/(a/_0x31bcba*Math[_0x263616(_0x21d3d8._0x684455)](_0x28e410)*PI);const _0x18e5a4=_0x27c594+_0x5a5e64,_0x42f47a=_0x1b5be4+_0x27b5e1;let _0x930d76=_0x1b5be4*0x2-_0x42f47a,_0x109351=_0x27c594*0x2-_0x18e5a4;return _0x930d76=Number(_0x930d76['toFixed'](0x6)),_0x109351=Number(_0x109351['toFixed'](0x6)),[_0x930d76,_0x109351];}}function bd2wgs(_0x3aded7){return gcj2wgs(bd2gcj(_0x3aded7));}function wgs2bd(_0x1425c9){return gcj2bd(wgs2gcj(_0x1425c9));}var PointTrans={'__proto__':null,'degree2dms':degree2dms,'dms2degree':dms2degree,'getCGCS2000EPSGByLng':getCGCS2000EPSGByLng,'getCGCS2000EPSGByX':getCGCS2000EPSGByX,'proj4Trans':proj4Trans,'proj4TransArr':proj4TransArr,'cartesian2lonlat':cartesian2lonlat,'cartesians2lonlats':cartesians2lonlats,'cartesian2mercator':cartesian2mercator,'cartesians2mercators':cartesians2mercators,'lonlat2cartesian':lonlat2cartesian,'lonlats2cartesians':lonlats2cartesians,'lonlat2mercator':lonlat2mercator,'lonlats2mercators':lonlats2mercators,'mercator2cartesian':mercator2cartesian,'mercators2cartesians':mercators2cartesians,'mercator2lonlat':mercator2lonlat,'mercators2lonlats':mercators2lonlats,'bd2gcj':bd2gcj,'gcj2bd':gcj2bd,'wgs2gcj':wgs2gcj,'gcj2wgs':gcj2wgs,'bd2wgs':bd2wgs,'wgs2bd':wgs2bd};const Lang={'_放大':['放大','放大',_0x35a251(0x4e6)],'_缩小':['缩小','縮小','Zoom\x20Out'],'_查看此处坐标':['查看此处坐标',_0x35a251(0x55f),'Location\x20info'],'_位置信息':[_0x35a251(0xe71),'位置信息','The\x20location\x20information'],'_经度':['经度','經度',_0x35a251(0x6fd)],'_纬度':['纬度','緯度','Lat'],'_海拔':['高程','高程',_0x35a251(0x112)],'_横坐标':['横坐标',_0x35a251(0xed1),'X'],'_纵坐标':[_0x35a251(0xb7c),_0x35a251(0xab9),'Y'],'_查看当前视角':['查看当前视角','查看當前視角','Camera\x20info'],'_当前视角信息':['当前视角信息',_0x35a251(0xde6),'Current\x20Camera\x20Information'],'_视角切换':[_0x35a251(0x9ac),_0x35a251(0xc2a),'Camera'],'_禁止进入地下':['禁止进入地下',_0x35a251(0xe8c),_0x35a251(0x8bc)],'_允许进入地下':['允许进入地下','允許進入地下',_0x35a251(0x760)],'_绕此处环绕飞行':['绕此处环绕飞行',_0x35a251(0xa66),'Fly\x20around\x20here'],'_关闭环绕飞行':['关闭环绕飞行',_0x35a251(0xd97),_0x35a251(0x5fa)],'_移动到此处':['移动到此处','移動到此處','Move\x20it\x20over\x20here'],'_第一视角站到此处':['第一视角站到此处','第一視角站到此處','First\x20view\x20is\x20here'],'_开启键盘漫游':['开启键盘漫游',_0x35a251(0x643),_0x35a251(0xa24)],'_关闭键盘漫游':[_0x35a251(0x82c),'關閉鍵盤漫遊','Turn\x20off\x20keyboard\x20roaming'],'_跟踪锁定':['跟踪锁定','跟踪鎖定','TrackedEntity'],'_取消锁定':[_0x35a251(0xf87),'取消鎖定','Unlocked'],'_三维模型':['三维模型','三維模型','3DTiles'],'_显示三角网':[_0x35a251(0xde2),_0x35a251(0x6be),'Display\x20Wireframe'],'_关闭三角网':['关闭三角网',_0x35a251(0xb0d),'Close\x20Wireframe'],'_显示包围盒':['显示包围盒','顯示包圍盒','Display\x20BoundingVolume'],'_关闭包围盒':['关闭包围盒','關閉包圍盒',_0x35a251(0x5e7)],'_地形服务':['地形服务','地形服務',_0x35a251(0xb7d)],'_开启地形':['开启地形',_0x35a251(0x787),'Open\x20terrain'],'_关闭地形':[_0x35a251(0xb8d),'關閉地形','Close\x20terrain'],'_图上标记':['图上标记','圖上標記','Drawing'],'_标记点':[_0x35a251(0xd0b),_0x35a251(0x630),'Mark\x20points'],'_标记线':['标记线','標記線','Tag\x20line'],'_标记面':[_0x35a251(0x3c3),'標記面',_0x35a251(0xe80)],'_标记圆':['标记圆','標記圓',_0x35a251(0x570)],'_标记矩形':['标记矩形','標記矩形',_0x35a251(0xc6f)],'_允许编辑':['允许编辑','允許編輯','Allowed\x20to\x20edit'],'_禁止编辑':[_0x35a251(0x3fb),_0x35a251(0xeb2),'Prohibit\x20to\x20edit'],'_导出GeoJSON':['导出GeoJSON','導出GeoJSON',_0x35a251(0xa59)],'_清除所有标记':['清除所有标记',_0x35a251(0xdcb),_0x35a251(0xe3c)],'_特效效果':[_0x35a251(0x58c),'特效效果','Effects'],'_开启下雨':['开启下雨','開啓下雨','Enable\x20rain'],'_关闭下雨':[_0x35a251(0xc05),'關閉下雨','Close\x20rain'],'_开启下雪':['开启下雪','開啓下雪',_0x35a251(0xb21)],'_关闭下雪':['关闭下雪','關閉下雪',_0x35a251(0x231)],'_开启雾天气':['开启雾天气','開啓霧天氣',_0x35a251(0x391)],'_关闭雾天气':[_0x35a251(0x1f2),'關閉霧天氣','Close\x20fog'],'_开启泛光':['开启泛光','開啓泛光','Enable\x20bloom'],'_关闭泛光':['关闭泛光','關閉泛光','Close\x20bloom'],'_开启亮度':[_0x35a251(0x16b),'開啓亮度','Enable\x20brightness'],'_关闭亮度':['关闭亮度',_0x35a251(0x5ab),'Close\x20brightness'],'_开启夜视':['开启夜视',_0x35a251(0x2a2),_0x35a251(0xe90)],'_关闭夜视':[_0x35a251(0x33b),'關閉夜視','Close\x20night\x20vision'],'_开启黑白':['开启黑白','開啓黑白','Enable\x20black\x20and\x20white'],'_关闭黑白':['关闭黑白','關閉黑白','Close\x20black\x20and\x20white'],'_开启拾取高亮':['开启拾取高亮','開啓拾取高亮','Enable\x20Pick\x20highlighted'],'_关闭拾取高亮':['关闭拾取高亮',_0x35a251(0x1e3),'Close\x20Pick\x20highlighted'],'_场景设置':['场景设置','場景設置','Scene'],'_开启深度监测':['开启深度监测','開啓深度監測','Enable\x20depth\x20test\x20against\x20terrain'],'_关闭深度监测':[_0x35a251(0xcdf),'關閉深度監測','Close\x20depth\x20test\x20against\x20terrain'],'_显示星空背景':[_0x35a251(0xbb4),_0x35a251(0xd73),'Enable\x20skyBox'],'_关闭星空背景':['关闭星空背景','關閉星空背景','Close\x20skyBox'],'_开启日照阴影':[_0x35a251(0x439),'開啓日照陰影',_0x35a251(0x3af)],'_关闭日照阴影':['关闭日照阴影','關閉日照陰影','Close\x20shadow'],'_开启大气渲染':['开启大气渲染','開啓大氣渲染',_0x35a251(0xb68)],'_关闭大气渲染':['关闭大气渲染','關閉大氣渲染',_0x35a251(0xd09)],'_场景出图':['场景出图','場景出圖','Export\x20image'],'_图上量算':['图上量算','圖上量算','Measure'],'_删除测量':['删除测量','刪除測量','Delete'],'_角度':['角度','角度','Angle'],'_距离':['距离','距離','Distance'],'_面积':['面积','面積','Area'],'_总长':['总长','總長','Total\x20distance'],'_起点':['起点','起點','Start'],'_高度差':['高度差','高度差','Height\x20difference'],'_空间距离':['空间距离','空間距離','Space\x20distance'],'_水平距离':['水平距离','水平距離','Horizontal\x20distance'],'_正在计算体积':['正在计算体积','正在計算體積','Calculating\x20volume'],'_填方体积':['填方体积','填方體積','The\x20volume\x20of\x20fill'],'_挖方体积':[_0x35a251(0x8f7),'挖方體積','Excavation\x20volume'],'_横切面积':['横切面积',_0x35a251(0x11a),'Crosscutting\x20area'],'_面上':['面上','面上','Up'],'_面下':['面下','面下','Down'],'_米':['米','米','m'],'_公里':['公里','公裏','km'],'_万米':['万米','万米','myriametre'],'_海里':['海里','海裏','mile'],'_丈':['丈','丈',_0x35a251(0x316)],'_平方米':['平方米','平方米','m²'],'_平方公里':[_0x35a251(0x6dd),'平方公裏',_0x35a251(0x33a)],'_亩':['亩','畝','mu'],'_公顷':['公顷','公頃','ha'],'_立方米':['方','方','m³'],'_万立方米':['万方','万方','wm³'],'_单击开始绘制':['单击开始绘制','單擊開始繪制','Click\x20to\x20start\x20drawing'],'_单击完成绘制':[_0x35a251(0x8a7),'單擊完成繪制','Click\x20to\x20finish\x20drawing'],'_双击完成绘制':['双击完成绘制','雙擊完成繪制','Double\x20click\x20to\x20finish\x20drawing'],'_单击增加点':[_0x35a251(0x6fa),'單擊增加點',_0x35a251(0xd7c)],'_右击删除点':['右击删除点','右擊刪除點','right\x20click\x20delete\x20point'],'_单击后激活编辑':[_0x35a251(0xdf8),_0x35a251(0x53a),'Click\x20to\x20activate\x20editing'],'_右击菜单删除':[_0x35a251(0x62f),'右擊菜單刪除',_0x35a251(0xfae)],'_更多功能请右击':[_0x35a251(0x39d),_0x35a251(0x43d),_0x35a251(0xc20)],'_停止编辑':['停止编辑','停止編輯',_0x35a251(0x7a1)],'_删除该点':[_0x35a251(0x31b),'刪除該點','Delete\x20that\x20point'],'_按轴平移':[_0x35a251(0x4e5),'按軸平移',_0x35a251(0xa02)],'_停止按轴平移':['停止按轴平移','停止按軸平移','Stop\x20translation\x20along\x20axis'],'_按轴旋转':[_0x35a251(0xa6b),'按軸旋轉','Rotation\x20on\x20axis'],'_停止按轴旋转':['停止按轴旋转','停止按軸旋轉',_0x35a251(0x3b3)],'_调整比例':['调整比例','調整比例','Edit\x20Scale'],'_停止调整比例':[_0x35a251(0xa8c),'停止調整比例','Stop\x20edit\x20scale'],'_释放后完成修改':['释放后完成修改','釋放後完成修改','Complete\x20the\x20modification\x20after\x20release'],'_该对象不允许编辑':[_0x35a251(0xf6c),'該對象不允許編輯',_0x35a251(0x4c5)],'_拖动该点后':['拖动该点后','拖動該點後',_0x35a251(0x36d)],'_拖动对象后':[_0x35a251(0xd51),'拖動對象後',_0x35a251(0xe9c)],'_修改位置':['修改位置','修改位置',_0x35a251(0x541)],'_整体平移':['整体平移','整體平移','The\x20overall\x20translation'],'_增加点':[_0x35a251(0xdb1),_0x35a251(0xc33),_0x35a251(0x545)],'_修改高度':[_0x35a251(0xe21),'修改高度','Modify\x20the\x20height'],'_修改半径':['修改半径',_0x35a251(0x837),_0x35a251(0x9e8)],'_修改长度':['修改长度(X方向)',_0x35a251(0x826),'Modify\x20the\x20length(X\x20direction\x20)'],'_修改宽度':[_0x35a251(0xc94),'修改寬度(Y方向)','Change\x20the\x20width(Y\x20direction)'],'_修改方向':['修改方向','修改方向','Change\x20direction'],'_修改缩放比例':['修改缩放比例','修改縮放比例','Modify\x20the\x20Scale'],'_无法删除不能少于最小点数':[_0x35a251(0x2b7),_0x35a251(0x56a),'Cannot\x20delete,\x20the\x20number\x20of\x20dots\x20cannot\x20be\x20less\x20than'],'_删除':['删除','刪除','Delete'],'_加载模型中':[_0x35a251(0xd87),'加载模型中…',_0x35a251(0xac5)]};function xhrAdapter(_0x337370){const _0xffee9f={_0x46759d:0x888,_0x27141c:0xa4e},_0x4c7f85={_0x2c58a8:0xce2,_0x315eee:0x6d0,_0x56e554:0xf9,_0x54f2b1:0x638,_0x52bde7:0x77e},_0x4539af={_0x16ca9:0x746,_0x52aa2e:0xd81},_0x3ffd93=_0x35a251;return _0x337370={'method':_0x3ffd93(_0xffee9f._0x46759d),'timeout':0x0,'maxContentLength':-0x1,'maxBodyLength':-0x1,'params':_0x337370[_0x3ffd93(_0xffee9f._0x27141c)]||{},..._0x337370},new Promise(function _0x52bc00(_0x1743b1,_0x359e7b){const _0x2fb2bf={_0x1fd2b5:0x7aa,_0x39b281:0x173},_0x36431c=_0x3ffd93;let _0x306f41=_0x337370[_0x36431c(_0x4c7f85._0x2c58a8)];const _0x56a28c=_0x337370[_0x36431c(0xdc0)]||{},_0x1236fa=_0x337370[_0x36431c(0xf9)];isFormData(_0x306f41)&&delete _0x56a28c['Content-Type'];let _0x116ea3=new XMLHttpRequest();_0x116ea3['open'](_0x337370['method']['toUpperCase'](),buildURL(_0x337370['url'],_0x337370['params'],_0x337370[_0x36431c(0xae6)]),!![]),_0x116ea3['timeout']=_0x337370['timeout'];function _0x4ff91b(){const _0x6f40de=_0x36431c;if(!_0x116ea3)return;const _0x3d1fa1='getAllResponseHeaders'in _0x116ea3?parseHeaders(_0x116ea3[_0x6f40de(0xa00)]()):null,_0x394115=!_0x1236fa||_0x1236fa===_0x6f40de(0xe1f)||_0x1236fa==='json'?_0x116ea3['responseText']:_0x116ea3['response'],_0x45b6e3={'data':transformResponse(_0x116ea3,_0x394115),'status':_0x116ea3[_0x6f40de(0x5e8)],'statusText':_0x116ea3['statusText'],'headers':_0x3d1fa1,'options':_0x337370,'request':_0x116ea3};settle(function _0x5724c9(_0xc8bde5){_0x1743b1(_0xc8bde5);},function _0xb7fe02(_0x1dcf4a){_0x359e7b(_0x1dcf4a);},_0x45b6e3),_0x116ea3=null;}'onloadend'in _0x116ea3?_0x116ea3['onloadend']=_0x4ff91b:_0x116ea3['onreadystatechange']=function _0x15d067(){const _0x5261ed=_0x36431c;if(!_0x116ea3||_0x116ea3[_0x5261ed(_0x4539af._0x16ca9)]!==0x4)return;if(_0x116ea3['status']===0x0&&!(_0x116ea3['responseURL']&&_0x116ea3['responseURL']['indexOf'](_0x5261ed(_0x4539af._0x52aa2e))===0x0))return;setTimeout(_0x4ff91b);},_0x116ea3['onabort']=function _0x108108(){if(!_0x116ea3)return;_0x359e7b(createError('Request\x20aborted',_0x337370,'ECONNABORTED',_0x116ea3)),_0x116ea3=null;},_0x116ea3['onerror']=function _0xba1a0(){_0x359e7b(createError('Network\x20Error',_0x337370,null,_0x116ea3)),_0x116ea3=null;},_0x116ea3[_0x36431c(0x279)]=function _0x45c59b(){const _0x45415e=_0x36431c;let _0x300b5e='timeout\x20of\x20'+_0x337370[_0x45415e(_0x2fb2bf._0x1fd2b5)]+_0x45415e(0xb6e);_0x337370['timeoutErrorMessage']&&(_0x300b5e=_0x337370[_0x45415e(_0x2fb2bf._0x39b281)]),_0x359e7b(createError(_0x300b5e,_0x337370,'ECONNABORTED',_0x116ea3)),_0x116ea3=null;},'setRequestHeader'in _0x116ea3&&forEach(_0x56a28c,function _0x4e535b(_0x4c287f,_0x50e36d){const _0x4f1dc8=_0x36431c;typeof _0x306f41==='undefined'&&_0x50e36d['toLowerCase']()==='content-type'?delete _0x56a28c[_0x50e36d]:_0x116ea3[_0x4f1dc8(0xeac)](_0x50e36d,_0x4c287f);}),!isUndefined(_0x337370['withCredentials'])&&(_0x116ea3['withCredentials']=!!_0x337370[_0x36431c(_0x4c7f85._0x315eee)]),_0x1236fa&&_0x1236fa!=='json'&&(_0x116ea3[_0x36431c(_0x4c7f85._0x56e554)]=_0x337370['responseType']),typeof _0x337370['onDownloadProgress']===_0x36431c(_0x4c7f85._0x54f2b1)&&_0x116ea3[_0x36431c(_0x4c7f85._0x52bde7)]('progress',_0x337370['onDownloadProgress']),typeof _0x337370['onUploadProgress']==='function'&&_0x116ea3['upload']&&_0x116ea3[_0x36431c(0xadb)]['addEventListener']('progress',_0x337370['onUploadProgress']),!_0x306f41&&(_0x306f41=null),_0x116ea3['send'](_0x306f41);});}function isString$1(_0x2954cb){return typeof _0x2954cb==='string';}function isDate(_0x5d5558){const _0x53ba9c=_0x35a251;return toString[_0x53ba9c(0xad6)](_0x5d5558)==='[object\x20Date]';}function isObject$1(_0x2e1463){return _0x2e1463!==null&&typeof _0x2e1463==='object';}function isFormData(_0x1b602f){const _0xa706b={_0x35c6c5:0xc19},_0x45dab2=_0x35a251;return typeof FormData!==_0x45dab2(_0xa706b._0x35c6c5)&&_0x1b602f instanceof FormData;}function isUndefined(_0x7a9b94){return typeof _0x7a9b94==='undefined';}function isURLSearchParams(_0xabacee){return typeof URLSearchParams!=='undefined'&&_0xabacee instanceof URLSearchParams;}function forEach(_0x18decf,_0x5a90e4){const _0xe284e7={_0x402068:0x719,_0x17b5b5:0xe1e,_0xdc324:0xad6},_0x295371=_0x35a251;if(_0x18decf===null||typeof _0x18decf==='undefined')return;typeof _0x18decf!=='object'&&(_0x18decf=[_0x18decf]);if(Array[_0x295371(_0xe284e7._0x402068)](_0x18decf))for(let _0x5e848e=0x0,_0x4fc2bd=_0x18decf[_0x295371(_0xe284e7._0x17b5b5)];_0x5e848e<_0x4fc2bd;_0x5e848e++){_0x5a90e4[_0x295371(_0xe284e7._0xdc324)](null,_0x18decf[_0x5e848e],_0x5e848e,_0x18decf);}else for(const _0x227d67 in _0x18decf){Object['prototype']['hasOwnProperty']['call'](_0x18decf,_0x227d67)&&_0x5a90e4['call'](null,_0x18decf[_0x227d67],_0x227d67,_0x18decf);}}function encode(_0x113564){const _0x54f005=_0x35a251;return encodeURIComponent(_0x113564)[_0x54f005(0x20e)](/%3A/gi,':')['replace'](/%24/g,'$')['replace'](/%2C/gi,',')['replace'](/%20/g,'+')['replace'](/%5B/gi,'[')['replace'](/%5D/gi,']');}function trim$1(_0x194654){const _0x232e5a={_0x10529b:0xbca},_0x18a54d=_0x35a251;return _0x194654[_0x18a54d(_0x232e5a._0x10529b)]?_0x194654['trim']():_0x194654['replace'](/^\s+|\s+$/g,'');}function buildURL(_0x26eff1,_0x126eef,_0x3e66e9){const _0x37b917={_0x23c603:0x97a},_0x45933f=_0x35a251;if(!_0x126eef)return _0x26eff1;let _0x131234;if(_0x3e66e9)_0x131234=_0x3e66e9(_0x126eef);else{if(isURLSearchParams(_0x126eef))_0x131234=_0x126eef['toString']();else{const _0x190c9d=[];forEach(_0x126eef,function _0x356f0e(_0x5c2a4f,_0x3d37ae){if(_0x5c2a4f===null||typeof _0x5c2a4f==='undefined')return;Array['isArray'](_0x5c2a4f)?_0x3d37ae=_0x3d37ae+'[]':_0x5c2a4f=[_0x5c2a4f],forEach(_0x5c2a4f,function _0x6dd8ce(_0x576bec){if(isDate(_0x576bec))_0x576bec=_0x576bec['toISOString']();else isObject$1(_0x576bec)&&(_0x576bec=JSON['stringify'](_0x576bec));_0x190c9d['push'](encode(_0x3d37ae)+'='+encode(_0x576bec));});}),_0x131234=_0x190c9d['join']('&');}}if(_0x131234){const _0x464a87=_0x26eff1[_0x45933f(0xd74)]('#');_0x464a87!==-0x1&&(_0x26eff1=_0x26eff1[_0x45933f(_0x37b917._0x23c603)](0x0,_0x464a87)),_0x26eff1+=(_0x26eff1['indexOf']('?')===-0x1?'?':'&')+_0x131234;}return _0x26eff1;}const ignoreDuplicateOf=['age','authorization','content-length','content-type',_0x35a251(0xe99),'expires','from','host','if-modified-since',_0x35a251(0x764),'last-modified','location','max-forwards','proxy-authorization','referer','retry-after','user-agent'];function parseHeaders(_0x5613aa){const _0x3bf9f0={_0x285ad5:0x29f},_0x2cab26={};let _0x69f1be,_0x4c6dda,_0xcfb0ee;if(!_0x5613aa)return _0x2cab26;return forEach(_0x5613aa['split']('\x0a'),function _0x2164a1(_0x2561d4){const _0x549f69=_0x2767;_0xcfb0ee=_0x2561d4['indexOf'](':'),_0x69f1be=trim$1(_0x2561d4['substr'](0x0,_0xcfb0ee))['toLowerCase'](),_0x4c6dda=trim$1(_0x2561d4[_0x549f69(_0x3bf9f0._0x285ad5)](_0xcfb0ee+0x1));if(_0x69f1be){if(_0x2cab26[_0x69f1be]&&ignoreDuplicateOf['indexOf'](_0x69f1be)>=0x0)return;_0x69f1be==='set-cookie'?_0x2cab26[_0x69f1be]=(_0x2cab26[_0x69f1be]?_0x2cab26[_0x69f1be]:[])['concat']([_0x4c6dda]):_0x2cab26[_0x69f1be]=_0x2cab26[_0x69f1be]?_0x2cab26[_0x69f1be]+',\x20'+_0x4c6dda:_0x4c6dda;}}),_0x2cab26;}function settle(_0x1ed5dd,_0x443a6a,_0x33fbb2){const _0x145fa8={_0x8f1d01:0x4fb},_0x220bda=_0x35a251;!_0x33fbb2[_0x220bda(0x5e8)]||validateStatus(_0x33fbb2['status'])?_0x1ed5dd(_0x33fbb2):_0x443a6a(createError(_0x220bda(_0x145fa8._0x8f1d01)+_0x33fbb2['status'],_0x33fbb2[_0x220bda(0xe86)],null,_0x33fbb2['request'],_0x33fbb2));}function validateStatus(_0x560787){return _0x560787>=0xc8&&_0x560787<0x12c;}function createError(_0x1986d6,_0x386e5d,_0xd6859d,_0x39c377,_0x15330d){const _0x53fad3=new Error(_0x1986d6);return enhanceError(_0x53fad3,_0x386e5d,_0xd6859d,_0x39c377,_0x15330d);}function enhanceError(_0x5b9ec7,_0x6008a0,_0x152d42,_0x196023,_0x153cf4){const _0x4cd89b={_0x2b9b80:0x4c3,_0x586b01:0x504,_0x209e0d:0x7b2};return _0x5b9ec7['options']=_0x6008a0,_0x152d42&&(_0x5b9ec7['code']=_0x152d42),_0x5b9ec7['request']=_0x196023,_0x5b9ec7['response']=_0x153cf4,_0x5b9ec7['isAxiosError']=!![],_0x5b9ec7['toJSON']=function _0xc94764(){const _0x3b5342=_0x2767;return{'message':this[_0x3b5342(_0x4cd89b._0x2b9b80)],'name':this[_0x3b5342(_0x4cd89b._0x586b01)],'description':this[_0x3b5342(0x500)],'number':this['number'],'fileName':this[_0x3b5342(0x36a)],'lineNumber':this[_0x3b5342(0x22c)],'columnNumber':this['columnNumber'],'stack':this[_0x3b5342(0xaa8)],'options':this[_0x3b5342(0xe86)],'code':this['code'],'status':this[_0x3b5342(0x7b2)]&&this['response'][_0x3b5342(0x5e8)]?this[_0x3b5342(_0x4cd89b._0x209e0d)]['status']:null};},_0x5b9ec7;}function transformResponse(_0x32e3e0,_0x29881c){const _0x3f6d22=_0x35a251;if(isString$1(_0x29881c)&&_0x29881c[_0x3f6d22(0xe1e)])try{return JSON['parse'](_0x29881c);}catch(_0x493abd){}return _0x29881c;}const version='3.5.10',update='2023-06-05\x2018:30:04',image={'url':'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAUCAYAAAAJD/ojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2NUVFNjVDRUFBMDgxMUU5QUM4NDg4MzU3RThBMzcwQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2NUVFNjVDRkFBMDgxMUU5QUM4NDg4MzU3RThBMzcwQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY1RUU2NUNDQUEwODExRTlBQzg0ODgzNTdFOEEzNzBCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY1RUU2NUNEQUEwODExRTlBQzg0ODgzNTdFOEEzNzBCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+GxQkfQAADBVJREFUeNrsWHtwVNUd/u7u3d1sNtlNNmQTkiyjkfAIqCD4AOQhGUBAqtMahloFq6KOio9qfVu0VVtrpahtrQOlCsgUlYq0QuMDMojQVFrLo0UeaSIGSAJ57SbZ7Otuv9/ds3ETQeto/+jUM/Obe8+55/E73+9xvnO11h/6cMqiabAYCT4pug5PvAN7dD8u8t6Clm4LcOJdtg8G7HdMh8cbRA52gM1o7gZaeoASL7DtFaCzEZi2CGATgvxW14zHr8jBfdNyzGX2798Pp9OJQYMGIZFIqKU1hEIh1NbWoqioCF6v12xvbW3FkSNHkJOTY7ZbrVbE4/GTqi/fwuEw6uvr4XK5UFxcbM4rpaOjAxaLBdnZ2eb4aDRqridF5pZ+hmH06pJe0nVM1VPvsp682+12s27BFylUEl0EaPlSoPpDwHMjkDl3JvK9Vfhg8xw8MAG4n7LtVSCDgJhravh/LvoX6u1wiImA9z8Gyk4AMyaPRRS/gRjabvMhxw8YUb5n9sVVWTxpUn6IJpLyOUU8QSSRNl7exbNS3vV5RfqLh6bPIUXGp7wutc5/BWDLqTxMMoPFkgUtHqdyydgxYgTISgD5nuUbjDjWENyB6GC9bMIIjDzPA4+jA8cCwDEaIZeA211uevO5jJVRlHaEjc00a50786TBw8lxDWUgZUUkEmmQkEsvEtY2m40ZSx/AajmlhOBk8xlLt42KznZ+q2e4/oP9u6SNexnCtjjTRyNlAdsqY7HY8zTCmjQjfIsyi/IMZVfavOdSrqX8ibK+n6PeROGG8RPO39L7IZSIngpfaDF47Zr+uG7VBxsJbQsCx1qcnqFv2R6taYDmfxEhlJmd6bBoqBuB2rcnYficD5FTdBly9bHoxEUYMTMfRqQBDcdWwe54Bx3WjyePzsJNk7MEhHmU0wnkms7Oznq/32+ncj8Q0Cg1wWCwQTbtcDiuYP00ykrm6oaBAwciKyvrBQI0m8Aso2zguLy0fBSRdCjG4thZJSUlTxDEe8WTaaDJ7FvJ3CtPnbl3UyAQOMQc/X22nUODXs01J/CbGPq9fgBPpNzAbxkKYNEzk3XR7SGOG0BD7uUa1aznsd6sRxInPyAsVgu6u3oOOzTbUq/b81IGovfSYwPvWEZFGx3+C/g+vtdnxL/zSrPgXbhefMy0ThZR744dRqhxIZy1K9AVNRA4EyjMwT0Xy6FglV4C3CUE9ig39gIBiFFBQ3lSuLCwEAUFBYVse47f3ATjFQFJDi9uKkeFd4D1iAI1BXBUaRVQXp8jc1IMvj/PZy2bK8QTOX6Wx+ORqJgrBmd9R+ITV470gyWknq3q+Q3KSBUt4hyi2ww+z1JTVOt+z8nPOY0Ah4iVoWk7XXkYhrbGRVtD47VHXE+Vcdl5SJyEcnAJM1h6sA098fsRbn8XHU1cnvTB5iFkFtxZVo8x2gnsrInBV+TfPsjvv4QbHEPgxCOjKnjMIJJ0wHI2xU2F99KjD8kmMjMze09P1rtF5IRQwKbSQxeSvEX6aDSSmV44z1QV5lKGsP2OpqamlwjwXWQqRxhNQebnEkZIKpBT+b6Q4ytVrp7b1dW1js9fiS6c08lvU9nPzX0sZp+DvSnikiVtp2JoiMWSSTGrsyMRGDHqmT9f9trD7Zm+m3vtmJ7xbDC8bXWvavs3L2kpnlEDP6Onx80VMpN5O2jA59Mx7/w8+Lw6gnoc7uzs7QqAin379mH37t2YMmWKReiUgCUbo/JjBRgCsSk3Nzdx9OhRHD9+HPT6vQRhPPsJfyuiZKcZx1D1QqkwBTQJBRP6xZQxlWCO4LwCvp1rlK9atWr86NGjMyoqKvazvpE5e1L/A5GlkXp+QLlIjM22v1OvoWwfrFKFGED2ciVB3qZ0OahvLP/RZxzjcRM5hHI5zXmLYfct7hM0mpI4/vDN8Lp3f2Q8qMN9qO1N/Uq8EVmAxrgNDXE72sP5pG1BLJ0cwNhBPnR25iJ/QIIGjO1gajjETQ8nqGfSK/bQI0xmQ0AsAgrz4pWK626VjbrdbpNjEvAadhtN+ZeEIuXblKXKc6+i1FFkc9dnZGQ0pNiHyuW5wtZVlOSPGzeum8YTUO9gv4vlYEyHQQ5VxUgOKs5by2cXvX0Uc/dt5ObvcC/foQGb2X4p13uTz2Nc7x4dsyo/g+MQTY2UIav0VkRtD5tsIcWeLea5/fGFsc2rH8GjLVONLbcgUz8tVuZpKg+vPnB7aI3JUT70lOHHsRnY7rwUpcUF5sB4PGklghSh3MLXi3t6eo6Wl5dPJ4DCINDW1ja7paVl28iRI5eJE3FTWyQ8JXQlZ7J8l5s4l217+D5GTnCV9+JsG6JAJHHHDILwPo3yRzGYyq8iVsnJwkCGDRvWSS//Ketn0qBZfBYqIMPylMuNsJn8/PyEpBphOVKncTbw/ed0gKt5PjylWMs1CqVfUtbqaDsFh0gYybyp58xFWH+6r8fyW8zyxARjywNb4tPu0q3GzzotBbz12dARiY45lHCtiNH77cwM+fZ/4rHuPdgWWwZreK3slwDZe1ei11bxVlVF4OwE4sFUO29pt/PG9saCBQuWTJo0CZWVleZtT25c3ORMetWF9Ooa1hfTUxrY5mQk3ElAwjRWFds+4sa97JPNlBIUYMQwBKX/6ZFgexHX3i7eR4Ak3Bepb/PZ/yM+3+d8Or/PUCljHL10HJnPjvb29tvpuWv57XW2/41rXk/Pfpn7ekyMQ3NknQRfIymWvArYXCuQTjQsvA6HOm9EyL3bkR1HXPcu1Y1gccJqXZRJ9Jtixph98ZDeTdKcYVhMaiuEwdLdgea963DAPRaWaACyT3oNdu3aZYb97Nmzn6FyEwnY02yvy8vLWzp06NBlhw8fnvjkk0+eIHi4/PLLzXCl9/yF3nifcBfK+RxTwg2XSR8JDH4fyZDNo9cWEuxAY2NjtazBNNB/p8JYxOuGc/zddXV1Z9AQTczvEmqSwsIc2yGGlXNBjGeGSDxexbl3SDvbXqa4OMcK6i9pZj3rV6QuLvqnrrIJnmw6aZ7dfRY0x28JrksloCDlblhjvzZzs0UyhAVRTQ/bE/Fbu7q73w7b7K/7dPv512i+UZx1Z0JFgx46jlDpRBwovRaNLceh97SK8uahM336dPlPsIQK30AP2LV8+fK7hK5dd911pQTl1urq6k1sn02R/GaO40ZaCPSzBONCethAdaDZVYrQOM6hWIWTkdEjoS3jJKzZR0s7QeQM9ygvXVlVVWUylPnz5wu/H0aQ1nKNA3IG0FAxGrKa883j2lryYuuAon8FqRsh39387qIElAf3o2myvmYvgSVjJVXwm2rEIq8h2nkzNNcx2PU+/xc0NXGws2eDMwOnu3LtrwbCsTm8/+00jchIsEUjaM4/D905ZyAzyPODh5TwWQLs56XhJUXga5gqZtXW1sZ8Pp8cZLcpmnU3ARDeOpcKbxIPFp5JkVtck+K0RyjDlddIKPMeDwEtqMCfyDk2CSB8uvhd6JxT3cA8HGfyotLSUjMNiZMKOOybLVxcMRExboXadqdiOE6O3UiZwvrvWH+PxniW41q4v8vY9sYnAJspgQbN8DhhzXiRyJ2NSPQ4jPiNsBm/h+ikJT718ybRezHhfd6Ceq47y4gjVw7sJMDCCJiLc1zwDx0AI8T98nIjChLEc+QOSGXupGLLZR/yd0tYgvLGe9hvBxWeKwcX36vY12DfbMpY9oko7mtRz++Zfzs0bbQ6+GQSckXUs+9bbJer0UoFTL5KEa2U3bLYtGnTUmxhjTJejTiC6ErgT6Nx97P9kYaGhlViaF6CxrF+VNgC5TlGSJB67WbfhZz/DLFZ3xRhEGCnYx0ytKn0nbXoDixEPByENy8ZTVo6pKcszQS2mWD3MYXNpkPul5w/ve/rIv1///X7WbO+371f2t4T+aI/XhQzWP8fdN2oJF0voW4PyQvTRYrybRZJ/5HE9q18bP0kB5t5mxUbDe3KXo/W5pkI1l6F4lGrzVzce5VO4MuUlA5GUos+P2/+14rk5HS90x0j/R9xkhMk1LXNbv8FCcVwtNQOwcG3ViPG9Ge14evyZf8HZxZlIR6dg0B7E+wFF9A8bcmUpn2NzlcCcKTHAyP6VwSaNiDb1/W113615d8CDAB0JaU81/NTEwAAAABJRU5ErkJggg==','rectangle':[0xa,0x5,0x58,0x14]};new Function('czmver','var\x20msg\x20=\x20`%c🌒%c\x20Mars3D三维可视化平台\x20%c\x0a\x0a\x20\x20版\x20本\x20号:3.5.10\x20\x20\x20\x20\x20Cesium版本:${czmver}\x0a\x20\x20编译日期:2023-06-05\x2018:30:04\x0a\x20\x20版权声明:\x0a\x20\x201.\x20Mars3D版权完全属于\x20\x22合肥火星科技有限公司\x22独自所有.\x0a\x20\x202.\x20Mars3D软件包,任何个人或组织在遵守下列条件的前提下可以永久免费使用:\x0a\x20\x20\x20\x201)不进行任何形式的破解和裁剪,程序包完整引用\x0a\x20\x20\x20\x202)保留此版权信息在控制台输出\x0a\x20\x20我们保留对此版权信息的最终解释权.\x0a\x0a\x0a\x20\x20🏠官网:\x20\x20http://mars3d.cn\x0a\x20\x20📞微信:\x20\x20http://marsgis.cn/weixin.html\x0a\x20\x20`;\x0aconsole.log(msg,\x0a\x20\x20\x27font-size:\x2019px;padding-left:\x2010px;\x20\x20color:\x20rgb(240,\x20133,\x2025);\x27,\x0a\x20\x20\x27font-size:\x2015px;\x20\x20line-height:\x201.5;\x20\x20font-family:\x20\x22微软雅黑\x22;color:\x20rgb(240,\x20133,\x2025);\x20\x20padding-bottom:\x205px;\x27,\x0a\x20\x20\x27font-size:\x2012px;\x20\x20line-height:\x201.5;\x20\x20font-family:\x20\x22微软雅黑\x22;color:\x20rgb(0,\x20138,\x20255);\x27\x20\x20);')(Cesium['VERSION']);let customImage;function setImage(_0x512fd2){customImage=_0x512fd2;}function addView(_0x143995){const _0x28070f={_0x4f354f:0x521,_0x41e145:0x100,_0x454959:0x82d},_0x2077bd=_0x35a251,_0x5cde36=image||customImage;if(!_0x5cde36||!_0x143995||!_0x143995[_0x2077bd(0x4e1)])return;const _0x17819b=_0x5cde36['rectangle']||[0xa,0x5,0x58,0x14],_0x2a3fbc=new Cesium__namespace['ViewportQuad']();return _0x2a3fbc[_0x2077bd(0xab1)]=new Cesium__namespace[(_0x2077bd(_0x28070f._0x4f354f))](_0x17819b[0x0],_0x17819b[0x1],_0x17819b[0x2],_0x17819b[0x3]),_0x2a3fbc['material']=new Cesium__namespace[(_0x2077bd(_0x28070f._0x41e145))]({'fabric':{'type':'Image','uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x1,0x1),'image':_0x5cde36['url']}}}),_0x2a3fbc[_0x2077bd(_0x28070f._0x454959)]=!![],_0x143995['primitives'][_0x2077bd(0x4af)](_0x2a3fbc),_0x2a3fbc;}function add(_0x231bdd,_0x38b616){const _0x558749=_0x35a251;if(!_0x231bdd||!_0x231bdd[_0x558749(0x4e1)])return;{addView(_0x231bdd),setInterval(function(){try{!checkHasImage(_0x231bdd)&&addView(_0x231bdd);}catch{}},0x927c0+Math['random']()*0x927c0);}}function checkHasImage(_0x1895ce){const _0x3ea576={_0x3a2b13:0x4e1,_0x189a09:0xe1e},_0x1ac7e9=_0x35a251;if(!(_0x1895ce!==null&&_0x1895ce!==void 0x0&&_0x1895ce[_0x1ac7e9(_0x3ea576._0x3a2b13)])||_0x1895ce['primitives'][_0x1ac7e9(0xe1e)]===0x0)return![];for(let _0x1183af=0x0,_0x46e6bd=_0x1895ce['primitives'][_0x1ac7e9(_0x3ea576._0x189a09)];_0x1183af<_0x46e6bd;++_0x1183af){const _0x247fa6=_0x1895ce['primitives']['get'](_0x1183af);if(_0x247fa6['_muyao'])return!![];}return![];}function isNumber(_0x110441){return typeof _0x110441==='number'&&_0x110441['constructor']===Number;}function isString(_0x37ab90){const _0x268161={_0x408d9a:0xd1},_0x5cda37=_0x35a251;return typeof _0x37ab90==='string'&&_0x37ab90[_0x5cda37(_0x268161._0x408d9a)]===String;}function isBoolean(_0x4533d5){const _0x251433=_0x35a251;return typeof _0x4533d5==='boolean'&&_0x4533d5[_0x251433(0xd1)]===Boolean;}function isObject(_0x58efc5){const _0x1533ed=_0x35a251;return Object[_0x1533ed(0xb1b)]['toString']['call'](_0x58efc5)==='[object\x20Object]';}const hasOwn={}['hasOwnProperty'];function isPlainObject(_0x34475c){const _0x2865c4=_0x35a251;if(!isObject(_0x34475c))return![];return _0x34475c['constructor']&&!hasOwn[_0x2865c4(0xad6)](_0x34475c,_0x2865c4(0xd1))&&!hasOwn[_0x2865c4(0xad6)](_0x34475c['constructor']['prototype'],_0x2865c4(0x8c1))?![]:!![];}function isFunction(_0x59ca0d){return _0x59ca0d&&typeof _0x59ca0d==='function';}function isSimpleType(_0x33af4a){if(_0x33af4a==null||_0x33af4a===undefined)return![];return isString(_0x33af4a)||isBoolean(_0x33af4a)||isNumber(_0x33af4a)||Array['isArray'](_0x33af4a)?!![]:![];}const isMars3DCesium=Boolean(Cesium__namespace['ExpandByMars']||Cesium__namespace['Mars3DEx']);function formatNum$1(_0x3eb016,_0xf3479f=0x0){const _0x284091=Math['pow'](0xa,_0xf3479f);return Math['round'](_0x3eb016*_0x284091)/_0x284091;}function padLeft0(_0x239329,_0x5c5519){_0x239329=String(_0x239329);let _0x41fa3d=_0x239329['length'];while(_0x41fa3d<_0x5c5519){_0x239329='0'+_0x239329,_0x41fa3d++;}return _0x239329;}function splitWords(_0x234351){return trim(_0x234351)['split'](/\s+/);}function trim(_0x1cefa0){const _0x14fc6a=_0x35a251;if(!_0x1cefa0)return;return _0x1cefa0[_0x14fc6a(0xbca)]?_0x1cefa0['trim']():_0x1cefa0['replace'](/^\s+|\s+$/g,'');}function getStrLength(_0x13e0c0){const _0x487283={_0x4e98cb:0x20e},_0x1ea9ec=_0x35a251;if(!_0x13e0c0)return;return _0x13e0c0[_0x1ea9ec(_0x487283._0x4e98cb)](/[\u0391-\uFFE5]/g,'00')['length'];}const templateRe=/\{ *([a-zA-Z0-9_\u4e00-\u9fa5]+) *\}/g;function template(_0x5456d0,_0x28b640,_0x130a84){const _0x22a4f1={_0x53af0f:0x7ec};if(_0x5456d0==null||!_0x28b640||!templateRe['test'](_0x5456d0))return _0x5456d0;return _0x5456d0['replace'](templateRe,function(_0x3a0fd2,_0x10768f,_0xd11474,_0xa3b293){const _0x7e95a0=_0x2767;let _0x54c3da=_0x28b640[_0x10768f];if(!Cesium__namespace['defined'](_0x54c3da)){if(!_0x130a84)return _0x3a0fd2;if(isString(_0x130a84))return _0x130a84;return'';}if(isFunction(_0x54c3da)){_0x54c3da=_0x54c3da(_0x28b640);if(!Cesium__namespace['defined'](_0x54c3da)){if(!_0x130a84)return _0x3a0fd2;if(isString(_0x130a84))return _0x130a84;return'';}}else{if(_0x54c3da[_0x7e95a0(_0x22a4f1._0x53af0f)]&&isFunction(_0x54c3da['getValue'])){_0x54c3da=_0x54c3da['getValue'](Cesium__namespace['JulianDate']['now']());if(!Cesium__namespace['defined'](_0x54c3da)){if(!_0x130a84)return _0x3a0fd2;if(isString(_0x130a84))return _0x130a84;return'';}}}return _0x54c3da;});}let lastId=0x0;function getGlobalId(){return++lastId;}function stampGlobalId(_0x24a564){if(_0x24a564&&isObject(_0x24a564))return _0x24a564['_mars3d_id']=_0x24a564['_mars3d_id']||++lastId,_0x24a564['_mars3d_id'];return-0x1;}function createGuid(_0x3a4870='m-'){const _0x299731={_0x8bbdbc:0x94a},_0x3e50c2=_0x35a251;return _0x3a4870+Cesium__namespace[_0x3e50c2(_0x299731._0x8bbdbc)]();}let callbackIndex=0x0;function getTemplateHtml(_0x18ced2){const _0x5a7a21={_0x3d66a7:0x732,_0x312ad2:0x92c,_0x4be230:0x755,_0x6664c7:0xad6,_0x529e35:0xf95,_0x162409:0xecb,_0x4737d0:0xe1e,_0x1fefaf:0x8ea,_0x4bcc64:0x785,_0x4968f7:0xe7c,_0x43cfe5:0xa53,_0x16903a:0xe1e,_0x5f4a83:0x196,_0x101284:0x504,_0xb9cce4:0x4d2,_0x15d6fa:0x7a7,_0x31cff4:0xf48,_0x3a9bc5:0x19b,_0x482e86:0x183,_0x115b57:0x183},_0x3dcab4={_0x4da7ce:0x1e6},_0x499d8a=_0x35a251;let _0x18ed38=_0x18ced2['attr'];if(!_0x18ed38)return![];const _0x3f1e4c=_0x18ced2[_0x499d8a(_0x5a7a21._0x3d66a7)],_0x3c1072=_0x18ced2[_0x499d8a(_0x5a7a21._0x312ad2)],_0x3d36fb=_0x18ced2[_0x499d8a(_0x5a7a21._0x4be230)];_0x18ed38=getAttrVal(_0x18ed38);if(!_0x3d36fb||_0x3d36fb===_0x499d8a(0x57d)){let _0x4c7890=0x0,_0x170e6f=_0x3f1e4c?'<div\x20class=\x22mars3d-template-titile\x22>'+_0x3f1e4c+_0x499d8a(0xf95):'';_0x170e6f+=_0x499d8a(0xecb);for(const _0x13489b in _0x18ed38){try{let _0x4557ec=_0x18ed38[_0x13489b];if(_0x13489b==null||_0x4557ec==null)continue;if(_0x13489b==='Shape'||_0x13489b==='FID'||_0x13489b===_0x499d8a(0xd06)||_0x13489b==='_definitionChanged'||_0x13489b===_0x499d8a(0x7c2))continue;if(isFunction(_0x4557ec))continue;isObject(_0x4557ec)&&(_0x4557ec=JSON['stringify'](getAttrVal(_0x4557ec,{'onlySimpleType':!![]})));_0x4557ec=String['prototype']['trim'][_0x499d8a(_0x5a7a21._0x6664c7)](_0x4557ec||'');if(_0x4557ec===''||_0x4557ec==='Null'||_0x4557ec==='Unknown')continue;_0x170e6f+='<div><label>'+_0x13489b+'</label>'+_0x4557ec+'</div>',_0x4c7890++;}catch(_0x31f8e2){logError$1('getTemplateHtml:构造all时异常',_0x31f8e2);}}_0x170e6f+=_0x499d8a(_0x5a7a21._0x529e35);if(_0x4c7890===0x0)return![];return _0x170e6f;}else{if(Array['isArray'](_0x3d36fb)){let _0x376a95=0x0,_0x547654=_0x3f1e4c?'<div\x20class=\x22mars3d-template-titile\x22>'+_0x3f1e4c+'</div>':'<div\x20style=\x22height:\x2010px;\x22></div>';_0x547654+=_0x499d8a(_0x5a7a21._0x162409);for(let _0x863eb3=0x0;_0x863eb3<_0x3d36fb[_0x499d8a(_0x5a7a21._0x4737d0)];_0x863eb3++){const _0x5499a7=_0x3d36fb[_0x863eb3];if(_0x5499a7==null)continue;const _0x1cee2d=_0x5499a7['field'],_0x2faed=_0x5499a7['className']||'';if(_0x5499a7['type']==='details'||_0x5499a7[_0x499d8a(_0x5a7a21._0x1fefaf)]==='button'){let _0x3d06c3='';const _0x3b50a2=_0x5499a7['callback'];if(_0x3b50a2){const _0x10f9fb='_cache_getTemplateHtml_'+callbackIndex++;if(isFunction(_0x3b50a2))window[_0x10f9fb]=function(){_0x3b50a2(_0x18ed38);};else isString(_0x3b50a2)&&(window[_0x10f9fb]=function(){const _0x42b2d9=_0x499d8a;eval(_0x3b50a2+'('+JSON[_0x42b2d9(_0x3dcab4._0x4da7ce)](_0x18ed38)+')');});_0x3d06c3='onclick=\x22'+_0x10f9fb+'();\x22\x20\x20';}_0x547654+='<div\x20style=\x22text-align:\x20center;padding:\x202px\x200;\x22\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20\x20'+_0x3d06c3+_0x499d8a(_0x5a7a21._0x4bcc64)+_0x1cee2d+'\x22\x20class=\x22mars3d-popup-btn\x20'+_0x2faed+'\x22\x20>'+(_0x5499a7[_0x499d8a(0x504)]||'查看详情')+_0x499d8a(0x731),_0x376a95++;continue;}else{if(_0x5499a7[_0x499d8a(0x8ea)]==='html'){const _0xced99f=template(_0x5499a7[_0x499d8a(0xc3c)],_0x18ed38,!![]);_0x547654+=_0x499d8a(_0x5a7a21._0x4968f7)+_0x2faed+'\x22>'+_0xced99f+'</div>',_0x376a95++;continue;}}let _0x1ef12a=_0x18ed38[_0x1cee2d];if(!_0x3c1072){if(_0x1cee2d==null||_0x1ef12a==null)continue;if(isFunction(_0x1ef12a))continue;}_0x1ef12a=String['prototype']['trim']['call'](_0x1ef12a||'');if(!_0x3c1072&&(_0x5499a7['hideNull']??!![])){if(_0x1ef12a==null||_0x1ef12a===''||_0x1ef12a===_0x499d8a(_0x5a7a21._0x43cfe5)||_0x1ef12a==='Unknown'||_0x1ef12a[_0x499d8a(_0x5a7a21._0x16903a)]===0x0)continue;}if(_0x5499a7['format'])try{isFunction(_0x5499a7['format'])?_0x1ef12a=_0x5499a7['format'](_0x1ef12a):_0x1ef12a=eval(_0x5499a7['format']+'('+_0x1ef12a+')');}catch(_0x4ad06e){logWarn(_0x499d8a(_0x5a7a21._0x5f4a83),_0x5499a7);}if(_0x3c1072)switch(_0x5499a7['type']){case'textarea':_0x1ef12a=_0x499d8a(0x3c7)+_0x2faed+_0x499d8a(0x5d0)+(_0x18ced2['width']||0xbe)+'px;\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-type=\x22'+_0x1cee2d+'\x22\x20\x20placeholder=\x22请输入\x20'+_0x5499a7[_0x499d8a(_0x5a7a21._0x101284)]+'\x22\x20\x20>'+_0x1ef12a+'</textarea>';break;case'string':case _0x499d8a(0xf91):default:_0x1ef12a=_0x499d8a(_0x5a7a21._0xb9cce4)+(_0x5499a7['type']||_0x499d8a(0xe1f))+_0x499d8a(_0x5a7a21._0x15d6fa)+_0x2faed+'\x22\x20style=\x22width:'+(_0x18ced2[_0x499d8a(_0x5a7a21._0x31cff4)]||0xbe)+'px;\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-type=\x22'+_0x1cee2d+'\x22\x20value=\x22'+_0x1ef12a+_0x499d8a(0xd7f)+_0x5499a7['name']+'\x22\x20\x20/>';break;}_0x5499a7['unit']&&(_0x1ef12a+=_0x5499a7['unit']),_0x547654+=_0x499d8a(_0x5a7a21._0x3a9bc5)+_0x5499a7['name']+_0x499d8a(0x98b)+_0x1ef12a+'</div>',_0x376a95++;}_0x547654+='</div>';if(_0x376a95===0x0)return![];return _0x547654;}else{if(isObject(_0x3d36fb))switch(_0x3d36fb['type']){case'iframe':{const _0x2d6037=template(_0x3d36fb['url'],_0x18ed38,!![]),_0x1c9546='<iframe\x20id=\x22ifarm\x22\x20src=\x22'+_0x2d6037+'\x22\x20\x20style=\x22width:'+(_0x3d36fb['width']||_0x499d8a(_0x5a7a21._0x482e86))+'px;height:'+(_0x3d36fb['height']||_0x499d8a(_0x5a7a21._0x115b57))+'px;overflow:hidden;margin:0;\x22\x20scrolling=\x22no\x22\x20frameborder=\x220\x22\x20></iframe>';return _0x1c9546;}case'javascript':{const _0x3717a7=_0x3d36fb['callback'];return eval(_0x3717a7+'('+JSON['stringify'](_0x18ed38)+')');}}else{if(isString(_0x3d36fb))return template(_0x3d36fb,_0x18ed38,!![]);else{if(isFunction(_0x3d36fb))return _0x3d36fb(_0x3d36fb,_0x18ed38);}}}}return![];}function getCesiumValue(_0x50b655,_0x49f77a,_0x5e945e){const _0x2be9fa={_0x3d3413:0x7ec},_0x2c57ca=_0x35a251;if(!_0x50b655)return _0x50b655;if(_0x49f77a){if(_0x50b655 instanceof _0x49f77a)return _0x50b655;else{if(_0x50b655['_value']&&_0x50b655['_value']instanceof _0x49f77a)return _0x50b655['_value'];}}if(isFunction(_0x50b655[_0x2c57ca(_0x2be9fa._0x3d3413)]))return _0x50b655[_0x2c57ca(_0x2be9fa._0x3d3413)](_0x5e945e||Cesium__namespace[_0x2c57ca(0x579)]['now']());return _0x50b655;}function getCesiumColor(_0xab9427,_0x3a806d,_0x9bdeda){const _0x153309={_0x246de2:0x7ec,_0x1f19f7:0xf29},_0x2579ba=_0x35a251;if(_0xab9427){isFunction(_0xab9427['getValue'])&&(_0xab9427=_0xab9427[_0x2579ba(_0x153309._0x246de2)](_0x9bdeda||Cesium__namespace['JulianDate']['now']()));if(isString(_0xab9427))return Cesium__namespace[_0x2579ba(_0x153309._0x1f19f7)]['fromCssColorString'](_0xab9427);else return isFunction(_0xab9427)?getCesiumColor(_0xab9427(_0x9bdeda),_0x3a806d):_0xab9427;}else return _0x3a806d;}function getColorByStyle(_0x51635b,_0x224be5=Cesium__namespace[_0x35a251(0xf29)]['YELLOW']){const _0x2506dd={_0x1f80c8:0x9db,_0x2b13c8:0x9db,_0x9639b1:0x1a6,_0x13a65a:0xd9a,_0x209a5c:0xbf2,_0x42b179:0x373},_0x5c1aa7=_0x35a251;let _0x278272;if(_0x51635b['color']){if(isString(_0x51635b[_0x5c1aa7(0x9db)]))_0x278272=Cesium__namespace['Color']['fromCssColorString'](_0x51635b['color']);else isFunction(_0x51635b[_0x5c1aa7(_0x2506dd._0x1f80c8)])?_0x278272=_0x51635b[_0x5c1aa7(_0x2506dd._0x2b13c8)](_0x51635b):_0x278272=_0x51635b['color'];}else _0x51635b[_0x5c1aa7(_0x2506dd._0x9639b1)]?_0x278272=Cesium__namespace['Color']['fromRandom']({'minimumRed':_0x51635b[_0x5c1aa7(0x8f8)]??0x0,'maximumRed':_0x51635b[_0x5c1aa7(_0x2506dd._0x13a65a)]??0.75,'minimumGreen':_0x51635b['minimumGreen']??0x0,'maximumGreen':_0x51635b['maximumGreen']??0.75,'minimumBlue':_0x51635b['minimumBlue']??0x0,'maximumBlue':_0x51635b['maximumBlue']??0.75}):_0x278272=_0x224be5;if(!_0x278272)return _0x278272;if(Cesium__namespace['defined'](_0x51635b[_0x5c1aa7(0xbf2)])){if(_0x51635b[_0x5c1aa7(0xbf2)]<0x0)_0x51635b[_0x5c1aa7(_0x2506dd._0x209a5c)]=0x0;else _0x51635b['opacity']>0x1&&(_0x51635b['opacity']=0x1);_0x278272=_0x278272[_0x5c1aa7(_0x2506dd._0x42b179)](Number(_0x51635b['opacity']));}return Cesium__namespace['defined'](_0x51635b['globalAlpha'])&&_0x51635b['globalAlpha']!==0x1&&(_0x278272=_0x278272[_0x5c1aa7(_0x2506dd._0x42b179)](_0x278272['alpha']*_0x51635b[_0x5c1aa7(0x2cf)])),_0x278272;}function getAttrVal(_0x7aef44,_0x33a707={}){const _0x220e30={_0x5a62a4:0x579,_0xc53534:0x7c2},_0x1c88a0=_0x35a251;if(!_0x7aef44)return _0x7aef44;try{isFunction(_0x7aef44[_0x1c88a0(0x7ec)])&&(_0x7aef44=_0x7aef44[_0x1c88a0(0x7ec)](Cesium__namespace[_0x1c88a0(_0x220e30._0x5a62a4)][_0x1c88a0(0x23b)]()));const _0x131cba={};if(_0x7aef44[_0x1c88a0(_0x220e30._0xc53534)]&&_0x7aef44[_0x1c88a0(_0x220e30._0xc53534)]['length']>0x0)for(const _0x4d3bac of _0x7aef44[_0x1c88a0(_0x220e30._0xc53534)]){const _0x38f858=getOneAttrValue(_0x4d3bac,_0x7aef44[_0x4d3bac],_0x33a707);if(_0x38f858==null)continue;_0x131cba[_0x4d3bac]=_0x38f858;}else for(const _0x448dc6 in _0x7aef44){const _0x3cd4b3=getOneAttrValue(_0x448dc6,_0x7aef44[_0x448dc6],_0x33a707);if(_0x3cd4b3==null)continue;_0x131cba[_0x448dc6]=_0x3cd4b3;}return _0x131cba;}catch(_0x1fbc51){logError$1('getAttrVal:出错了',_0x1fbc51);}return _0x7aef44;}function get3DTileFeatureAttr(_0xef3e28){const _0x56621c={_0x454794:0xc56,_0x17b6a2:0xfbe,_0x29d0ae:0xe1e},_0x4bc7fb=_0x35a251,_0x57562e={},_0x447bce=_0xef3e28[_0x4bc7fb(_0x56621c._0x454794)]?_0xef3e28['getPropertyIds']():_0xef3e28[_0x4bc7fb(_0x56621c._0x17b6a2)]();for(let _0x30f13e=0x0;_0x30f13e<_0x447bce[_0x4bc7fb(_0x56621c._0x29d0ae)];_0x30f13e++){const _0x202dfd=_0x447bce[_0x30f13e];if(!_0xef3e28['hasProperty'](_0x202dfd))continue;const _0x4e3e89=_0xef3e28['getProperty'](_0x202dfd);if(_0x4e3e89==null)continue;_0x57562e[_0x202dfd]=_0x4e3e89;}return _0x57562e;}function getOneAttrValue(_0xc092d2,_0x4391b4,_0x4a204a){const _0x47eb31={_0x46931a:0xa54,_0x4adb2e:0xf29},_0x36bd59=_0x35a251;if(_0x4391b4==null||_0x4391b4===''||_0x4391b4==='Null'||_0x4391b4===_0x36bd59(_0x47eb31._0x46931a))return null;_0x4391b4['getValue']&&typeof _0x4391b4[_0x36bd59(0x7ec)]==='function'&&_0xc092d2!=='material'&&(_0x4391b4=_0x4391b4['getValue'](Cesium__namespace['JulianDate'][_0x36bd59(0x23b)]()));if(isFunction(_0x4391b4))return null;if(_0x4a204a['onlySimpleType']){if(_0x4391b4 instanceof Cesium__namespace[_0x36bd59(_0x47eb31._0x4adb2e)])return _0x4391b4['toCssColorString']();if(_0x4a204a['noArray']&&Array['isArray'](_0x4391b4))return null;if(isPlainObject(_0x4391b4))return _0x4391b4;if(!isSimpleType(_0x4391b4))return null;}return _0x4391b4;}function merge(_0xab3402={},..._0x3de296){let _0x5729a8,_0x5e08ee,_0x61d9b9,_0xaf03aa;for(_0x5e08ee=0x0,_0x61d9b9=_0x3de296['length'];_0x5e08ee<_0x61d9b9;_0x5e08ee++){_0xaf03aa=_0x3de296[_0x5e08ee];for(_0x5729a8 in _0xaf03aa){hasMergeObject(_0xab3402[_0x5729a8],_0xaf03aa[_0x5729a8])?_0xab3402[_0x5729a8]=merge(_0xab3402[_0x5729a8],_0xaf03aa[_0x5729a8]):_0xab3402[_0x5729a8]=_0xaf03aa[_0x5729a8];}}return _0xab3402;}function hasMergeObject(_0x5acd17,_0xc05ea7){const _0x2e3dc5=_0x35a251;if(!Cesium__namespace[_0x2e3dc5(0xaa2)](_0x5acd17)||!Cesium__namespace['defined'](_0xc05ea7))return![];if(Array['isArray'](_0x5acd17)||Array['isArray'](_0xc05ea7))return![];if(isPlainObject(_0x5acd17)&&isPlainObject(_0xc05ea7))return!![];return![];}function clone(_0x49261a,_0x239e5f=[],_0x54505b=0x5){const _0xa965b2={_0x16637a:0xd61},_0x12b397=_0x35a251;if(_0x49261a==null||typeof _0x49261a!=='object')return _0x49261a;if(_0x49261a instanceof Date){const _0x55b804=new Date();return _0x55b804['setTime'](_0x49261a['getTime']()),_0x55b804;}if(Array['isArray'](_0x49261a)&&_0x54505b>=0x0){const _0x320610=[];for(let _0x46fd23=0x0,_0xdbcc94=_0x49261a['length'];_0x46fd23<_0xdbcc94;++_0x46fd23){_0x320610[_0x46fd23]=clone(_0x49261a[_0x46fd23],_0x239e5f,_0x54505b-0x1);}return _0x320610;}if(typeof _0x49261a==='object'&&_0x54505b>=0x0)try{if(_0x49261a['clone'])return _0x49261a[_0x12b397(_0xa965b2._0x16637a)]();if(!isPlainObject(_0x49261a))return _0x49261a;const _0x4d479b={};for(const _0x44e34f in _0x49261a){if(isFunction(_0x44e34f))continue;if(_0x239e5f[_0x12b397(0xd74)](_0x44e34f)!==-0x1)continue;_0x49261a['hasOwnProperty'](_0x44e34f)&&(_0x4d479b[_0x44e34f]=clone(_0x49261a[_0x44e34f],_0x239e5f,_0x54505b-0x1));}return _0x4d479b;}catch(_0x4107df){logError$1('clone:出错了',_0x4107df);}return _0x49261a;}function getArrayRandomOne(_0x595257){const _0x258bb6={_0x462d65:0xe1e},_0x446126=_0x35a251,_0xa8e17e=Math['floor'](Math['random']()*_0x595257[_0x446126(_0x258bb6._0x462d65)]+0x1)-0x1;return _0x595257[_0xa8e17e];}function removeArrayItem(_0x5eff1f,_0x38be11){const _0x47c6a1={_0x3d3fbd:0xce0},_0x24f092=_0x35a251;for(let _0xb02233=0x0;_0xb02233<_0x5eff1f[_0x24f092(0xe1e)];_0xb02233++){if(_0x5eff1f[_0xb02233]===_0x38be11)return _0x5eff1f[_0x24f092(_0x47c6a1._0x3d3fbd)](_0xb02233,0x1),!![];}return![];}function getSymbolStyle(_0xe7c504,_0x5b03c7){const _0x58d58e={_0x17d667:0x814,_0x15d805:0x716,_0xbd2889:0xa9b},_0x724da6=_0x35a251;if(!_0xe7c504)return{};let _0x56f041=_0xe7c504['styleOptions']?clone(_0xe7c504['styleOptions']):{};if(_0xe7c504[_0x724da6(_0x58d58e._0x17d667)]&&_0xe7c504[_0x724da6(0xeb3)]&&_0x5b03c7){const _0x1fe7ba=_0x5b03c7[_0xe7c504['styleField']],_0xb2cf71=_0xe7c504['styleFieldOptions'][_0x1fe7ba];_0xb2cf71!=null&&(_0x56f041=merge(_0x56f041,_0xb2cf71));}if(_0x5b03c7)for(const _0x208789 in _0x56f041){_0x56f041[_0x208789]=template(_0x56f041[_0x208789],_0x5b03c7);}_0x56f041['label']&&(_0x56f041['label']=clone(_0x56f041['label']));_0x56f041['highlight']&&(_0x56f041[_0x724da6(_0x58d58e._0x15d805)]=clone(_0x56f041['highlight']));if(isFunction(_0xe7c504[_0x724da6(_0x58d58e._0xbd2889)])){const _0x1a1e96=_0xe7c504['callback'](_0x5b03c7,_0x56f041);_0x1a1e96!=null&&(_0x56f041=merge(_0x56f041,_0x1a1e96));}return _0x56f041;}function geojsonToArcGIS(_0x4034af,_0x318ee9){return geojsonToArcGIS$1(_0x4034af,_0x318ee9);}function arcgisToGeoJSON(_0x265d66,_0x212b9f){return arcgisToGeoJSON$1(_0x265d66,_0x212b9f);}function getGeoJsonFeatures(_0x3d14ec){const _0x4eb0ca={_0x10d408:0x415,_0x27300a:0x723,_0x5bc5a3:0x63f,_0xa21bae:0x93a,_0x54aa66:0x719},_0x12beb2=_0x35a251;if(_0x3d14ec[_0x12beb2(_0x4eb0ca._0x10d408)]&&_0x3d14ec['geometryType']['indexOf']('esri')!==-0x1)_0x3d14ec=arcgisToGeoJSON(_0x3d14ec);else{if(_0x3d14ec['type']==='Topology'){let _0x34c3c5=[];for(const _0x552f09 in _0x3d14ec[_0x12beb2(_0x4eb0ca._0x27300a)]){if(_0x3d14ec['objects'][_0x12beb2(_0x4eb0ca._0x5bc5a3)](_0x552f09)){_0x3d14ec=Cesium__namespace['topojson']['feature'](_0x3d14ec,_0x3d14ec['objects'][_0x552f09]);const _0x118f34=getGeoJsonFeatures(_0x3d14ec);_0x34c3c5=_0x34c3c5[_0x12beb2(_0x4eb0ca._0xa21bae)](_0x118f34);}}return _0x34c3c5;}}let _0xa9d97;if(Array[_0x12beb2(0x719)](_0x3d14ec['features']))_0xa9d97=_0x3d14ec['features'];else Array[_0x12beb2(_0x4eb0ca._0x54aa66)](_0x3d14ec)?_0xa9d97=_0x3d14ec:_0xa9d97=[_0x3d14ec];return _0xa9d97;}function geoJsonToGraphics(_0x22a0a6,_0xddb80={}){const _0x22689a={_0x28f3b9:0xa34,_0x5bec64:0x504,_0xd2ab1f:0xe1e},_0x54287c=_0x35a251;var _0x57b77f,_0x46ba8b;if(!_0x22a0a6)return[];const _0x139d74=getGeoJsonFeatures(_0x22a0a6);if(_0x22a0a6!==null&&_0x22a0a6!==void 0x0&&(_0x57b77f=_0x22a0a6['crs'])!==null&&_0x57b77f!==void 0x0&&(_0x46ba8b=_0x57b77f[_0x54287c(0x7d9)])!==null&&_0x46ba8b!==void 0x0&&_0x46ba8b['name']&&!_0xddb80[_0x54287c(_0x22689a._0x28f3b9)]){const _0xe350d3=_0x22a0a6['crs']['properties'][_0x54287c(_0x22689a._0x5bec64)];_0xe350d3['indexOf']('EPSG:')!==-0x1&&(_0xddb80[_0x54287c(0xa34)]=_0xe350d3);}let _0x3dc318=[];for(let _0x1b1036=0x0,_0x298c0f=_0x139d74[_0x54287c(_0x22689a._0xd2ab1f)];_0x1b1036<_0x298c0f;_0x1b1036++){const _0x4fb252=_0x139d74[_0x1b1036],_0x1d492a=featureToGraphic(_0x4fb252,_0xddb80);_0x1d492a&&_0x1d492a['length']>0x0&&(_0x3dc318=_0x3dc318[_0x54287c(0x93a)](_0x1d492a));}return _0x3dc318;}function featureToGraphic(_0x49d552,_0xc5fbb7={}){const _0x411fa8={_0x531411:0x8ea,_0x53a23d:0x616,_0x529275:0xaa2,_0x151bc9:0xfc8,_0x5ea23a:0x357,_0x405fd3:0xa34,_0x2f201b:0xcdb,_0x43ddb3:0x150,_0x2b7dad:0x150,_0x722b56:0xf30,_0x1955c7:0x909,_0x34f363:0xe1e,_0x21a218:0x854,_0xb4810e:0x98f,_0x59d9d4:0x7d9},_0x475538={_0x1094b5:0x555},_0x249fdc=_0x35a251;var _0x52afd0,_0x31c79b,_0x3aa6eb;let _0x344467=[];_0x49d552['type']==='GeometryCollection'&&(_0x49d552={'geometry':_0x49d552});const _0x5c3158=_0x49d552['geometry'],_0x29a52e=_0x5c3158===null||_0x5c3158===void 0x0?void 0x0:_0x5c3158['coordinates'];if(!_0x29a52e&&!_0x5c3158)return _0x344467;let _0x677482;if(_0xc5fbb7['type'])_0x677482=_0xc5fbb7['type'];else hasType((_0x52afd0=_0x49d552)===null||_0x52afd0===void 0x0?void 0x0:(_0x31c79b=_0x52afd0['properties'])===null||_0x31c79b===void 0x0?void 0x0:_0x31c79b['type'])&&(_0x677482=_0x49d552['properties']['type']);let _0x452359=clone((_0x3aa6eb=_0x49d552)===null||_0x3aa6eb===void 0x0?void 0x0:_0x3aa6eb['properties'],['style'])||{};_0x452359&&_0x452359['type']&&_0x452359['attr']&&(_0x452359=_0x452359['attr']);let _0x19ac3b={};if(_0x49d552['properties']){_0x49d552['properties']['style']&&(_0x19ac3b={..._0x49d552[_0x249fdc(0x7d9)]['style']});const _0xc3f569=_0x452359['marker-symbol'];if(Cesium__namespace['defined'](_0xc3f569)){_0x19ac3b[_0x249fdc(0xdb2)]=_0xc3f569;const _0x211381=_0x452359['marker-color'];Cesium__namespace['defined'](_0x211381)&&(_0x19ac3b['outline']=!![],_0x19ac3b['outlineColor']=_0x211381);}const _0x5a003b=_0x452359['fill'];if(Cesium__namespace[_0x249fdc(0xaa2)](_0x5a003b)&&_0x5c3158[_0x249fdc(_0x411fa8._0x531411)]!==_0x249fdc(_0x411fa8._0x53a23d)&&_0x5c3158[_0x249fdc(_0x411fa8._0x531411)]!=='MultiLineString'){_0x19ac3b['color']=_0x5a003b;const _0x1e8e12=_0x452359[_0x249fdc(0xcab)];Cesium__namespace['defined'](_0x1e8e12)&&_0x1e8e12!==0x1&&(_0x19ac3b[_0x249fdc(0xbf2)]=_0x1e8e12);const _0x450d3a=_0x452359['stroke'];if(Cesium__namespace[_0x249fdc(_0x411fa8._0x529275)](_0x450d3a)){_0x19ac3b['outline']=!![],_0x19ac3b['outlineColor']=_0x450d3a;const _0x303925=_0x452359['stroke-width'];Cesium__namespace['defined'](_0x303925)&&(_0x19ac3b['outlineWidth']=_0x303925);const _0x290683=_0x452359['stroke-opacity'];Cesium__namespace[_0x249fdc(_0x411fa8._0x529275)](_0x290683)&&_0x290683!==0x1&&(_0x19ac3b['outlineOpacity']=_0x290683);}}else{const _0x356c50=_0x452359['stroke'];if(Cesium__namespace['defined'](_0x356c50)){_0x19ac3b['color']=_0x356c50;const _0x3d1e69=_0x452359[_0x249fdc(0xd1b)];Cesium__namespace[_0x249fdc(0xaa2)](_0x3d1e69)&&(_0x19ac3b['width']=_0x3d1e69);const _0x58e702=_0x452359['stroke-opacity'];Cesium__namespace['defined'](_0x58e702)&&_0x58e702!==0x1&&(_0x19ac3b['opacity']=_0x58e702);}}}_0xc5fbb7[_0x249fdc(0xfc8)]&&(_0xc5fbb7['style']['merge']?_0x19ac3b={..._0x19ac3b,..._0xc5fbb7['style']}:_0x19ac3b={..._0xc5fbb7[_0x249fdc(_0x411fa8._0x151bc9)]});if(_0xc5fbb7['symbol']){if(isFunction(_0xc5fbb7[_0x249fdc(_0x411fa8._0x5ea23a)]))_0x19ac3b=_0xc5fbb7['symbol'](_0x452359,_0x19ac3b,_0x49d552)||_0x19ac3b,_0x19ac3b[_0x249fdc(_0x411fa8._0x531411)]&&(_0x677482=_0x19ac3b['type']);else{_0x677482=_0xc5fbb7[_0x249fdc(0x357)][_0x249fdc(_0x411fa8._0x531411)]||_0x677482;const _0x210016=getSymbolStyle(_0xc5fbb7['symbol'],_0x49d552['properties']||{});_0x210016&&Object['keys'](_0x210016)['length']!==0x0&&(_0xc5fbb7[_0x249fdc(_0x411fa8._0x5ea23a)]['merge']?_0x19ac3b={..._0x210016,..._0x19ac3b}:_0x19ac3b=_0x210016);}}let _0x44d480=_0xc5fbb7[_0x249fdc(_0x411fa8._0x405fd3)];_0x44d480==='EPSG:4326'&&(_0x44d480=null);function _0x3d1223(_0x37b285){const _0x46a95a=_0x249fdc;return _0x44d480&&(_0x37b285=proj4Trans(_0x37b285,_0x44d480)),_0xc5fbb7[_0x46a95a(_0x475538._0x1094b5)]?_0xc5fbb7['onPointTrans'](_0x37b285):_0x37b285;}function _0x583933(_0x5a7f0e){const _0x6e43b4=_0x249fdc;if(!_0xc5fbb7['onPointTrans']&&!_0x44d480)return _0x5a7f0e;const _0x5539e1=[];for(let _0x4a46a4=0x0,_0x43f77b=_0x5a7f0e['length'];_0x4a46a4<_0x43f77b;_0x4a46a4++){const _0x15de40=_0x5a7f0e[_0x4a46a4];if(Array['isArray'](_0x15de40[0x0])){const _0x425289=_0x583933(_0x15de40);_0x425289&&_0x425289[_0x6e43b4(0xe1e)]>0x0&&_0x5539e1['push'](_0x425289);}else{const _0x3e7939=_0x3d1223(_0x15de40);_0x3e7939&&_0x5539e1['push'](_0x3e7939);}}return _0x5539e1;}function _0x3a6c1d(_0x5ebac4,_0x5e5ec0){eachGraphicType(function(_0x62115c){isObject(_0x5e5ec0[_0x62115c])&&(_0x5ebac4[_0x62115c]=_0x5e5ec0[_0x62115c],delete _0x5e5ec0[_0x62115c]);});}let _0x13f736,_0x236b78;switch(_0x5c3158[_0x249fdc(0x8ea)]){case'Point':{(!_0x677482||!isPointType(_0x677482))&&(_0x677482=_0x19ac3b['image']?_0x249fdc(_0x411fa8._0x2f201b):_0x249fdc(_0x411fa8._0x43ddb3));const _0x1ef949={'type':_0x677482,'position':_0x3d1223(_0x29a52e),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0x1ef949,_0x452359),_0x344467['push'](_0x1ef949);break;}case _0x249fdc(0x30e):{(!_0x677482||!isPointType(_0x677482))&&(_0x677482=_0x19ac3b['image']?_0x249fdc(0xcdb):_0x249fdc(_0x411fa8._0x2b7dad));for(_0x13f736=0x0,_0x236b78=_0x29a52e['length'];_0x13f736<_0x236b78;_0x13f736++){const _0xcac243={'type':_0x677482,'position':_0x3d1223(_0x29a52e[_0x13f736]),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0xcac243,_0x452359),_0x344467['push'](_0xcac243);}break;}case'LineString':{!_0x677482&&(_0x677482='polylineP');const _0x2e4a9f={'type':_0x677482,'positions':_0x583933(_0x29a52e),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0x2e4a9f,_0x452359),_0x344467['push'](_0x2e4a9f);break;}case'MultiLineString':{!_0x677482&&(_0x677482=_0x249fdc(0x7ad));let _0x211459;const _0x3e4eaa=[];for(_0x13f736=0x0,_0x236b78=_0x29a52e[_0x249fdc(0xe1e)];_0x13f736<_0x236b78;_0x13f736++){const _0x230553={'type':_0x677482,'positions':_0x583933(_0x29a52e[_0x13f736]),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0x230553,_0x452359),_0x344467[_0x249fdc(0x6de)](_0x230553),_0x3e4eaa['push'](_0x230553),(!_0x211459||_0x211459[_0x249fdc(0xb35)]['length']<_0x230553['positions']['length'])&&(_0x211459=_0x230553);}if(_0x211459){_0x211459['isMultiMax']=!![];if(_0x19ac3b['label']&&!_0x19ac3b['label']['showAll'])for(_0x13f736=0x0,_0x236b78=_0x3e4eaa['length'];_0x13f736<_0x236b78;_0x13f736++){const _0x433d24=_0x3e4eaa[_0x13f736];if(_0x211459===_0x433d24)continue;_0x433d24[_0x249fdc(_0x411fa8._0x151bc9)]={..._0x433d24['style']},delete _0x433d24['style']['label'];}}break;}case _0x249fdc(0xa0b):{!_0x677482&&(_0x677482='polygon');if(_0x677482['startsWith'](_0x249fdc(0x909))){const _0x22aadf={'type':_0x677482,'positions':_0x583933(_0x29a52e['length']===0x1?_0x29a52e[0x0]:_0x29a52e),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0x22aadf,_0x452359),_0x344467['push'](_0x22aadf);}else for(_0x13f736=0x0,_0x236b78=_0x29a52e[_0x249fdc(0xe1e)];_0x13f736<_0x236b78;_0x13f736++){const _0x123519=_0x29a52e[_0x13f736],_0x54e1cf={'type':_0x677482,'positions':_0x583933(_0x123519['length']===0x1?_0x123519[0x0]:_0x123519),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0x54e1cf,_0x452359),_0x344467['push'](_0x54e1cf);}break;}case _0x249fdc(_0x411fa8._0x722b56):{!_0x677482&&(_0x677482=_0x249fdc(_0x411fa8._0x1955c7));let _0x1cd0f8;const _0x44c71f=[];for(_0x13f736=0x0,_0x236b78=_0x29a52e['length'];_0x13f736<_0x236b78;_0x13f736++){const _0x1ca1be=_0x29a52e[_0x13f736],_0xad17ca={'type':_0x677482,'positions':_0x583933(_0x1ca1be['length']===0x1?_0x1ca1be[0x0]:_0x1ca1be),'style':_0x19ac3b,'attr':_0x452359};_0x3a6c1d(_0xad17ca,_0x452359),_0x344467['push'](_0xad17ca),_0x44c71f[_0x249fdc(0x6de)](_0xad17ca),(!_0x1cd0f8||_0x1cd0f8['positions'][_0x249fdc(_0x411fa8._0x34f363)]<_0xad17ca['positions']['length'])&&(_0x1cd0f8=_0xad17ca);}if(_0x1cd0f8){_0x1cd0f8['isMultiMax']=!![];if(_0x19ac3b['label']&&!_0x19ac3b['label']['showAll'])for(_0x13f736=0x0,_0x236b78=_0x44c71f[_0x249fdc(0xe1e)];_0x13f736<_0x236b78;_0x13f736++){const _0x2bafb=_0x44c71f[_0x13f736];if(_0x1cd0f8===_0x2bafb)continue;_0x2bafb['style']={..._0x2bafb['style']},delete _0x2bafb[_0x249fdc(0xfc8)][_0x249fdc(_0x411fa8._0x21a218)];}}break;}case'GeometryCollection':{for(let _0x18c542=0x0,_0xd0d703=_0x5c3158['geometries']['length'];_0x18c542<_0xd0d703;_0x18c542++){const _0x46330f=featureToGraphic({'type':_0x249fdc(_0x411fa8._0xb4810e),'geometry':_0x5c3158['geometries'][_0x18c542],'properties':_0x49d552[_0x249fdc(_0x411fa8._0x59d9d4)]},_0xc5fbb7);_0x46330f&&_0x46330f['length']>0x0&&(_0x344467=_0x344467['concat'](_0x46330f));}break;}default:logError$1(_0x249fdc(0x9d3),_0x49d552);}return _0x344467;}function mergeSymbolToGraphic(_0x2f142c,_0x5de092){const _0x2c6f88={_0x227b4a:0xfc8,_0x17f5ba:0x8ea,_0x124435:0xe1e},_0x3c304e=_0x35a251;if(_0x5de092){if(isFunction(_0x5de092))_0x2f142c['style']=_0x5de092(_0x2f142c['attr'],_0x2f142c[_0x3c304e(_0x2c6f88._0x227b4a)],_0x2f142c);else{_0x5de092[_0x3c304e(_0x2c6f88._0x17f5ba)]&&(_0x2f142c[_0x3c304e(0x8ea)]=_0x5de092['type']);const _0x1d3ee6=getSymbolStyle(_0x5de092,_0x2f142c['attr']||{});_0x1d3ee6&&Object[_0x3c304e(0x68f)](_0x1d3ee6)[_0x3c304e(_0x2c6f88._0x124435)]!==0x0&&(_0x5de092['merge']?_0x2f142c['style']={..._0x1d3ee6,..._0x2f142c['style']}:_0x2f142c[_0x3c304e(0xfc8)]=_0x1d3ee6);}}return _0x2f142c;}function heightToZoom(_0x1f5cd5){const _0x4741f7={_0x2fef1c:0xca6},_0x22313c=_0x35a251,_0x41de94=40487.57,_0xae01d0=0.00007096758,_0x5ac1fc=91610.74,_0xc2d333=-40467.74;return Math[_0x22313c(_0x4741f7._0x2fef1c)](_0xc2d333+(_0x41de94-_0xc2d333)/(0x1+Math[_0x22313c(0xda4)](_0x1f5cd5/_0x5ac1fc,_0xae01d0)));}function getUrlResource(_0x277f30){const _0xe3b08a={_0x1198d4:0x741,_0x5e95f1:0x877,_0x37d66b:0xa0a,_0x33a0b5:0xd05,_0x52dbf8:0xd05,_0xa0b94d:0x741},_0x440b58=_0x35a251;if(!_0x277f30['url'])return _0x277f30;let _0x971ad6;if(_0x277f30['url']instanceof Cesium__namespace['Resource']){const _0x5e516f=_0x277f30['url'];return _0x277f30[_0x440b58(0xdc0)]&&(_0x5e516f['headers']=_0x277f30['headers']),_0x277f30['proxy']&&(_0x5e516f[_0x440b58(_0xe3b08a._0x1198d4)]=new Cesium__namespace['DefaultProxy'](_0x277f30[_0x440b58(0x741)])),_0x277f30[_0x440b58(0xa0a)]&&_0x5e516f[_0x440b58(_0xe3b08a._0x5e95f1)](_0x277f30['templateValues']),_0x277f30['queryParameters']&&_0x5e516f[_0x440b58(0xbfd)](_0x277f30['queryParameters']),_0x5e516f;}else _0x277f30[_0x440b58(_0xe3b08a._0x37d66b)]&&(_0x277f30[_0x440b58(_0xe3b08a._0x33a0b5)]=template(_0x277f30['url'],_0x277f30['templateValues'])),_0x971ad6=new Cesium__namespace['Resource']({'url':_0x277f30[_0x440b58(_0xe3b08a._0x52dbf8)],'queryParameters':_0x277f30[_0x440b58(0xa4e)],'templateValues':_0x277f30[_0x440b58(0xa0a)],'headers':_0x277f30[_0x440b58(0xdc0)],'proxy':_0x277f30['proxy']?new Cesium__namespace['DefaultProxy'](_0x277f30[_0x440b58(_0xe3b08a._0xa0b94d)]):null});return _0x971ad6;}function getTextImage(_0x14bc37,_0x507537={}){const _0x1c5434=_0x35a251;!_0x507537[_0x1c5434(0xb94)]&&(_0x507537['backgroundColor']=Cesium__namespace['Color']['TRANSPARENT']);const _0x5b540d=Cesium__namespace[_0x1c5434(0x52b)](_0x14bc37||'',_0x507537);if(_0x5b540d){if(_0x507537['outline']){const _0x5aaa11=_0x5b540d[_0x1c5434(0xf48)],_0x902c27=_0x5b540d['height'],_0x54eea3=_0x5b540d[_0x1c5434(0x5bf)]('2d',{'willReadFrequently':!![]});if(_0x507537['outlineColor'])_0x54eea3['strokeStyle']=_0x507537['outlineColor']['toCssColorString']();else _0x507537['fillColor']?_0x54eea3['strokeStyle']=_0x507537['fillColor']['toCssColorString']():_0x54eea3['strokeStyle']='#ffffff';const _0x139136=_0x507537['outlineWidth']||0x4;_0x54eea3['lineWidth']=_0x139136,_0x54eea3['strokeRect'](_0x139136/0x2,_0x139136/0x2,_0x5aaa11-_0x139136,_0x902c27-_0x139136);}return _0x5b540d;}else return null;}const circleImage={};function getCircleImage(_0x5a686c,_0x25bd83={}){const _0x5316cb={_0x583726:0x9db,_0x3256ec:0xbf2,_0x384108:0xd0f,_0x4a2114:0xe95,_0x377a76:0x925,_0x374a2a:0x892},_0x27317a=_0x35a251,_0x1351ef=_0x25bd83['radius']??0x1a,_0x3d61df=_0x1351ef+(_0x25bd83[_0x27317a(0x7fb)]??0x5);let _0x37de87,_0x42e907;if(_0x25bd83[_0x27317a(_0x5316cb._0x583726)])_0x37de87=_0x25bd83['color'],_0x42e907=_0x25bd83['borderColor']||_0x37de87;else{const _0x39d961=_0x25bd83[_0x27317a(_0x5316cb._0x3256ec)]??0.6,_0x86544a=_0x25bd83['borderOpacity']??_0x39d961*0.8;if(_0x5a686c<0xa)_0x37de87='rgba(110,\x20204,\x2057,\x20'+_0x39d961+')',_0x42e907='rgba(181,\x20226,\x20140,\x20'+_0x86544a+')';else _0x5a686c<0x64?(_0x37de87='rgba(240,\x20194,\x2012,\x20\x20'+_0x39d961+')',_0x42e907=_0x27317a(0x9df)+_0x86544a+')'):(_0x37de87='rgba(241,\x20128,\x2023,\x20\x20'+_0x39d961+')',_0x42e907='rgba(253,\x20156,\x20115,\x20'+_0x86544a+')');}const _0x28f15d=_0x5a686c+'_'+_0x3d61df+'_'+_0x1351ef+'_'+_0x37de87;if(!circleImage[_0x28f15d]){const _0x28dfbc=_0x3d61df*0x2,_0x59c886=document[_0x27317a(_0x5316cb._0x384108)]('canvas');_0x59c886['width']=_0x28dfbc,_0x59c886['height']=_0x28dfbc;const _0xc76eab=_0x59c886[_0x27317a(0x5bf)]('2d',{'willReadFrequently':!![]});_0xc76eab['fillStyle']='#ffffff00',_0xc76eab['globalAlpha']=0x0,_0xc76eab[_0x27317a(_0x5316cb._0x4a2114)](0x0,0x0,_0x28dfbc,_0x28dfbc),_0x1351ef!==_0x3d61df&&(_0xc76eab['globalAlpha']=0x1,_0xc76eab['beginPath'](),_0xc76eab['arc'](_0x3d61df,_0x3d61df,_0x3d61df,0x0,Math['PI']*0x2,!![]),_0xc76eab[_0x27317a(_0x5316cb._0x377a76)](),_0xc76eab['fillStyle']=_0x42e907,_0xc76eab['fill']()),_0xc76eab['globalAlpha']=0x1,_0xc76eab['beginPath'](),_0xc76eab['arc'](_0x3d61df,_0x3d61df,_0x1351ef,0x0,Math['PI']*0x2,!![]),_0xc76eab['closePath'](),_0xc76eab['fillStyle']=_0x37de87,_0xc76eab['fill'](),_0xc76eab['font']=_0x25bd83['font']||_0x1351ef*0.9+'px\x20bold\x20normal',_0xc76eab['fillStyle']=_0x25bd83['fontColor']||'#ffffff',_0xc76eab[_0x27317a(_0x5316cb._0x374a2a)]='center',_0xc76eab[_0x27317a(0x90e)]='middle',_0xc76eab['fillText'](_0x5a686c,_0x3d61df,_0x3d61df),circleImage[_0x28f15d]=_0x59c886[_0x27317a(0x381)]('image/png');}return circleImage[_0x28f15d];}function download(_0xf7ea9e,_0x352fb4){const _0x34597e={_0x2c4207:0x87c,_0x44082e:0xfb4,_0x4b268a:0xfa2},_0x4def10=_0x35a251,_0x187d59=document['createElement']('a');_0x187d59['download']=_0xf7ea9e,_0x187d59['href']=URL['createObjectURL'](_0x352fb4),document['body'][_0x4def10(_0x34597e._0x2c4207)](_0x187d59),_0x187d59[_0x4def10(_0x34597e._0x44082e)](),document[_0x4def10(0x8a6)][_0x4def10(_0x34597e._0x4b268a)](_0x187d59);}function base64Img2Blob(_0x250732){const _0x1f248a={_0x1be02b:0xb0c,_0x2c66a1:0x4a8},_0x4a9041=_0x35a251,_0x4ec94d=_0x250732[_0x4a9041(_0x1f248a._0x1be02b)](';base64,'),_0x4f4e7d=_0x4ec94d[0x0]['split'](':')[0x1],_0x5036c6=window[_0x4a9041(0x407)](_0x4ec94d[0x1]),_0x1f0849=_0x5036c6['length'],_0x44c591=new Uint8Array(_0x1f0849);for(let _0x5dbaac=0x0;_0x5dbaac<_0x1f0849;++_0x5dbaac){_0x44c591[_0x5dbaac]=_0x5036c6[_0x4a9041(_0x1f248a._0x2c66a1)](_0x5dbaac);}return new Blob([_0x44c591],{'type':_0x4f4e7d});}function downloadBase64Image(_0x326327,_0x13a016){const _0x1b08ac={_0x4ac55d:0xb16},_0x3415c8=_0x35a251,_0x36bd96=base64Img2Blob(_0x13a016);!_0x326327['endsWith'](_0x3415c8(_0x1b08ac._0x4ac55d))&&!_0x326327['endsWith']('.png')&&(_0x326327=_0x326327+'.png'),download(_0x326327,_0x36bd96);}function downloadFile(_0x46e73d,_0x5d6f48){const _0x4e4125=new Blob([_0x5d6f48]);download(_0x46e73d,_0x4e4125);}function getExplorerInfo(){const _0x4dfc92={_0x2480e6:0x855,_0xe4ad52:0x29b,_0x3b0fc5:0xf1b,_0x5313d5:0xb87,_0x36d2bd:0xd74},_0x3c235f=_0x35a251;let _0x1d21ac;const _0x5f0fe7=window[_0x3c235f(_0x4dfc92._0x2480e6)]['userAgent'][_0x3c235f(_0x4dfc92._0xe4ad52)]();if(_0x5f0fe7[_0x3c235f(0xd74)]('msie')>=0x0)return _0x1d21ac=Number(_0x5f0fe7[_0x3c235f(_0x4dfc92._0x3b0fc5)](/msie ([\d]+)/)[0x1]),{'type':'IE','version':_0x1d21ac};else{if(_0x5f0fe7['indexOf']('firefox')>=0x0)return _0x1d21ac=Number(_0x5f0fe7[_0x3c235f(0xf1b)](/firefox\/([\d]+)/)[0x1]),{'type':'Firefox','version':_0x1d21ac};else{if(_0x5f0fe7['indexOf'](_0x3c235f(_0x4dfc92._0x5313d5))>=0x0)return _0x1d21ac=Number(_0x5f0fe7['match'](/chrome\/([\d]+)/)[0x1]),{'type':_0x3c235f(0x76f),'version':_0x1d21ac};else{if(_0x5f0fe7[_0x3c235f(_0x4dfc92._0x36d2bd)]('opera')>=0x0)return _0x1d21ac=Number(_0x5f0fe7[_0x3c235f(0xf1b)](/opera.([\d]+)/)[0x1]),{'type':_0x3c235f(0x16d),'version':_0x1d21ac};else{if(_0x5f0fe7['indexOf']('Safari')>=0x0)return _0x1d21ac=Number(_0x5f0fe7[_0x3c235f(0xf1b)](/version\/([\d]+)/)[0x1]),{'type':'Safari','version':_0x1d21ac};}}}}return{'type':_0x5f0fe7,'version':-0x1};}function webglreport(){const _0x5abfbe=_0x35a251,_0x2e9d5e=getExplorerInfo();if(_0x2e9d5e['type']==='IE'&&_0x2e9d5e[_0x5abfbe(0x81e)]<0xb)return![];try{let _0x3ee184;const _0xc8bb1=document[_0x5abfbe(0xd0f)]('canvas'),_0x30c346=typeof WebGL2RenderingContext!=='undefined';_0x30c346&&(_0x3ee184=_0xc8bb1['getContext']('webgl2')||_0xc8bb1['getContext']('experimental-webgl2')||undefined);_0x3ee184==null&&(_0x3ee184=_0xc8bb1['getContext']('webgl')||_0xc8bb1['getContext']('experimental-webgl')||undefined);if(_0x3ee184==null)return![];}catch(_0xb9a5e1){return![];}return!![];}function webglerror(){const _0x584d47={_0x2ad675:0x87,_0x63e337:0xb75,_0x3bd206:0x7e9,_0x2e891f:0xc8a,_0x43e43a:0x8ed},_0x297a63=_0x35a251;var _0x27f134,_0x3d594e;(_0x27f134=window)!==null&&_0x27f134!==void 0x0&&(_0x3d594e=_0x27f134['layer'])!==null&&_0x3d594e!==void 0x0&&_0x3d594e['open']?window[_0x297a63(_0x584d47._0x2ad675)]['open']({'type':0x1,'title':_0x297a63(_0x584d47._0x63e337),'closeBtn':0x0,'shadeClose':![],'resize':![],'area':['530px',_0x297a63(_0x584d47._0x3bd206)],'content':_0x297a63(_0x584d47._0x2e891f)}):alert(_0x297a63(_0x584d47._0x43e43a));}function getRequest(){const _0x784af2={_0x3b0beb:0xb0c},_0x379f20=_0x35a251,_0x423d68=location['search'],_0x5b4434={};if(_0x423d68[_0x379f20(0xd74)]('?')!==-0x1){const _0x318295=_0x423d68['substr'](0x1),_0x43489c=_0x318295['split']('&');for(let _0x4e5403=0x0;_0x4e5403<_0x43489c['length'];_0x4e5403++){_0x5b4434[_0x43489c[_0x4e5403][_0x379f20(_0x784af2._0x3b0beb)]('=')[0x0]]=decodeURI(_0x43489c[_0x4e5403]['split']('=')[0x1]);}}return _0x5b4434;}function getRequestByName(_0x45921c){const _0x5d50bd={_0x269107:0xa46,_0x451423:0x29f},_0x5951c0=_0x35a251,_0x7b4f17=new RegExp('(^|&)'+_0x45921c+_0x5951c0(_0x5d50bd._0x269107),'i'),_0xc67614=window[_0x5951c0(0x3a4)]['search'][_0x5951c0(_0x5d50bd._0x451423)](0x1)['match'](_0x7b4f17);if(_0xc67614!=null)return decodeURI(_0xc67614[0x2]);return null;}let _isPCBroswer;function isPCBroswer(){const _0x1956e0={_0x29890c:0x17c,_0x471c2b:0x4f3},_0xb8589=_0x35a251;if(!Cesium__namespace['defined'](_isPCBroswer)){const _0x27c7ed=navigator['userAgent']['toLowerCase'](),_0x18092f=[_0xb8589(_0x1956e0._0x29890c),_0xb8589(_0x1956e0._0x471c2b),'iphone','ipad','ipod','symbianos'];_isPCBroswer=!![];for(let _0x35ee0c=0x0;_0x35ee0c<_0x18092f['length'];_0x35ee0c++){if(_0x27c7ed['indexOf'](_0x18092f[_0x35ee0c])>0x0){_isPCBroswer=![];break;}}}return _isPCBroswer;}function alert(_0x155b2f,_0x12e563){const _0x14655f={_0x513902:0xa89,_0x1d8ca9:0x87,_0x40953b:0x87,_0xb5c296:0x9f0,_0x305fa2:0x25d},_0x33e173=_0x35a251;if(window['globalAlert'])window[_0x33e173(_0x14655f._0x513902)](_0x155b2f,_0x12e563);else{if(window[_0x33e173(_0x14655f._0x1d8ca9)])window[_0x33e173(_0x14655f._0x40953b)][_0x33e173(_0x14655f._0xb5c296)](_0x155b2f,{'title':_0x12e563||'提示','skin':_0x33e173(_0x14655f._0x305fa2),'closeBtn':0x0,'anim':0x0});else window[_0x33e173(0x250)]?window['toastr']['info'](_0x155b2f,_0x12e563):window[_0x33e173(_0x14655f._0xb5c296)](_0x155b2f);}}function msg(_0x332edb){const _0x5640d9={_0x34c813:0x250},_0x1fe973=_0x35a251;if(window[_0x1fe973(0x612)])window['globalMsg'](_0x332edb);else{if(window['toastr'])window[_0x1fe973(_0x5640d9._0x34c813)]['info'](_0x332edb);else window['layer']?window['layer']['msg'](_0x332edb):window['alert'](_0x332edb);}}function formatDate(_0x1d146b,_0x6641e8='yyyy-MM-dd\x20HH:mm:ss'){const _0xab1669={_0x4501f6:0x4c0,_0x3d7392:0xc25,_0x39238a:0xc25,_0x153881:0x6ba,_0x204c7e:0xc2b,_0x5d9ee1:0xe1e},_0x230bcf=_0x35a251,_0x7d876f={'M+':_0x1d146b[_0x230bcf(_0xab1669._0x4501f6)]()+0x1,'d+':_0x1d146b['getDate'](),'h+':_0x1d146b[_0x230bcf(_0xab1669._0x3d7392)]()%0xc===0x0?0xc:_0x1d146b['getHours']()%0xc,'H+':_0x1d146b[_0x230bcf(_0xab1669._0x39238a)](),'m+':_0x1d146b['getMinutes'](),'s+':_0x1d146b['getSeconds'](),'q+':Math[_0x230bcf(_0xab1669._0x153881)]((_0x1d146b['getMonth']()+0x3)/0x3),'S':_0x1d146b['getMilliseconds']()};/(y+)/[_0x230bcf(0x342)](_0x6641e8)&&(_0x6641e8=_0x6641e8[_0x230bcf(0x20e)](RegExp['$1'],(_0x1d146b[_0x230bcf(_0xab1669._0x204c7e)]()+'')['substr'](0x4-RegExp['$1'][_0x230bcf(_0xab1669._0x5d9ee1)])));for(const _0x568adf in _0x7d876f){new RegExp('('+_0x568adf+')')['test'](_0x6641e8)&&(_0x6641e8=_0x6641e8['replace'](RegExp['$1'],RegExp['$1'][_0x230bcf(0xe1e)]===0x1?_0x7d876f[_0x568adf]:('00'+_0x7d876f[_0x568adf])['substr']((''+_0x7d876f[_0x568adf])[_0x230bcf(0xe1e)])));}return _0x6641e8;}function formatTime(_0x546528){const _0x3cc98f=_0x35a251;_0x546528=Number(_0x546528)||0x0;if(_0x546528<0x3c)return _0x546528['toFixed'](0x0)+'秒';else{if(_0x546528>=0x3c&&_0x546528<0xe10){const _0x125410=Math['floor'](_0x546528%0x3c);return Math['floor'](_0x546528/0x3c)+'分钟'+(_0x125410!==0x0?_0x125410+'秒':'');}else return _0x546528=Math[_0x3cc98f(0x6ba)](_0x546528/0x3c),Math['floor'](_0x546528/0x3c)+'小时'+Math[_0x3cc98f(0x6ba)](_0x546528%0x3c)+'分钟';}}function fetchJson(_0x5d36b9){const _0x66e1ae={_0x34b651:0x4db},_0x2d70cb=_0x35a251;return _0x5d36b9=replaceOnlineUrlDomain(_0x5d36b9),_0x5d36b9['method']===_0x2d70cb(_0x66e1ae._0x34b651)?(_0x5d36b9['data']=_0x5d36b9['queryParameters'],delete _0x5d36b9[_0x2d70cb(0xa4e)],Cesium__namespace['Resource']['post'](_0x5d36b9)):Cesium__namespace['Resource']['fetchJson'](_0x5d36b9);}function sendAjax(_0x44354e){const _0x2f4d0c={_0x247f53:0x4db},_0x5536e4=_0x35a251;return _0x44354e=replaceOnlineUrlDomain(_0x44354e),_0x44354e['method']===_0x5536e4(_0x2f4d0c._0x247f53)&&(_0x44354e[_0x5536e4(0xce2)]=_0x44354e['queryParameters'],delete _0x44354e[_0x5536e4(0xa4e)]),xhrAdapter(_0x44354e)['then'](_0x14303d=>{const _0x2841a8=_0x14303d===null||_0x14303d===void 0x0?void 0x0:_0x14303d['data'];return _0x2841a8;})['catch'](_0x1fd675=>{const _0x472237=_0x5536e4;console[_0x472237(0x3a8)](_0x1fd675),logError$1('axios请求出错',_0x1fd675);});}function getLangText(_0x5af592,_0x2a3487=0x0){const _0x486ef8=Lang[_0x5af592];if(!_0x486ef8)return _0x5af592;const _0x2c16d0=_0x486ef8[_0x2a3487]||_0x5af592;return _0x2c16d0;}function requestFullscreen(_0xad589e){return Cesium__namespace['Fullscreen']['requestFullscreen'](_0xad589e),Cesium__namespace['Fullscreen']['fullscreen'];}function exitFullscreen(){return Cesium__namespace['Fullscreen']['exitFullscreen'](),Cesium__namespace['Fullscreen']['fullscreen'];}function replaceOnlineUrlDomain(_0x2184a7){const _0x50c4e6={_0x2e495f:0xd05,_0x2fd190:0xd74,_0x379a1e:0xd74,_0x1ff1ac:0x292,_0x312c19:0x20e},_0x17ed9b=_0x35a251;var _0x32a9a7,_0x6fc480,_0x11fc6e;if(!_0x2184a7[_0x17ed9b(_0x50c4e6._0x2e495f)]||!isString(_0x2184a7['url']))return _0x2184a7;if((_0x32a9a7=window)!==null&&_0x32a9a7!==void 0x0&&(_0x6fc480=_0x32a9a7['location'])!==null&&_0x6fc480!==void 0x0&&(_0x11fc6e=_0x6fc480['hostname'])!==null&&_0x11fc6e!==void 0x0&&_0x11fc6e[_0x17ed9b(_0x50c4e6._0x2fd190)]&&window[_0x17ed9b(0x3a4)]['hostname'][_0x17ed9b(_0x50c4e6._0x379a1e)]('mars3d.cn')===-0x1)return _0x2184a7;if(_0x2184a7['url']['indexOf']('data.mars3d.cn')===-0x1||_0x2184a7['url'][_0x17ed9b(_0x50c4e6._0x2fd190)](_0x17ed9b(_0x50c4e6._0x1ff1ac))!==-0x1)return _0x2184a7;return _0x2184a7['url']=_0x2184a7['url'][_0x17ed9b(_0x50c4e6._0x312c19)]('data.mars3d.cn',_0x17ed9b(0xa70)),_0x2184a7;}var Util={'__proto__':null,'isNumber':isNumber,'isString':isString,'isBoolean':isBoolean,'isObject':isObject,'isPlainObject':isPlainObject,'isFunction':isFunction,'isSimpleType':isSimpleType,'isMars3DCesium':isMars3DCesium,'formatNum':formatNum$1,'padLeft0':padLeft0,'splitWords':splitWords,'trim':trim,'getStrLength':getStrLength,'template':template,get 'lastId'(){return lastId;},'getGlobalId':getGlobalId,'stampGlobalId':stampGlobalId,'createGuid':createGuid,'getTemplateHtml':getTemplateHtml,'getCesiumValue':getCesiumValue,'getCesiumColor':getCesiumColor,'getColorByStyle':getColorByStyle,'getAttrVal':getAttrVal,'get3DTileFeatureAttr':get3DTileFeatureAttr,'merge':merge,'clone':clone,'getArrayRandomOne':getArrayRandomOne,'removeArrayItem':removeArrayItem,'getSymbolStyle':getSymbolStyle,'geojsonToArcGIS':geojsonToArcGIS,'arcgisToGeoJSON':arcgisToGeoJSON,'getGeoJsonFeatures':getGeoJsonFeatures,'geoJsonToGraphics':geoJsonToGraphics,'featureToGraphic':featureToGraphic,'mergeSymbolToGraphic':mergeSymbolToGraphic,'heightToZoom':heightToZoom,'getUrlResource':getUrlResource,'getTextImage':getTextImage,'getCircleImage':getCircleImage,'downloadBase64Image':downloadBase64Image,'downloadFile':downloadFile,'getExplorerInfo':getExplorerInfo,'webglreport':webglreport,'webglerror':webglerror,'getRequest':getRequest,'getRequestByName':getRequestByName,'isPCBroswer':isPCBroswer,'alert':alert,'msg':msg,'formatDate':formatDate,'formatTime':formatTime,'fetchJson':fetchJson,'sendAjax':sendAjax,'getLangText':getLangText,'requestFullscreen':requestFullscreen,'exitFullscreen':exitFullscreen,'replaceOnlineUrlDomain':replaceOnlineUrlDomain,'setImage':setImage};Object['defineProperties'](Cesium__namespace['ColorMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x4db349){const _0x481bbf={_0xbcc980:0xaa2},_0xbd7da4=_0x35a251;this['_globalAlpha']=_0x4db349;const _0x48ba33=getCesiumColor(this[_0xbd7da4(0x9db)],Cesium__namespace['Color']['WHITE']);!Cesium__namespace[_0xbd7da4(_0x481bbf._0xbcc980)](this['_color_alpha'])&&(this['_color_alpha']=_0x48ba33['alpha']),this['color']=_0x48ba33['withAlpha'](this['_color_alpha']*_0x4db349);},'get':function(){return this['_globalAlpha']??0x1;}}}),Object['defineProperties'](Cesium__namespace['GridMaterialProperty'][_0x35a251(0xb1b)],{'globalAlpha':{'set':function(_0x23d361){const _0x36d596={_0x1ff2c4:0xb8},_0x4f5283=_0x35a251;this[_0x4f5283(_0x36d596._0x1ff2c4)]=_0x23d361;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$5=Cesium__namespace[_0x35a251(0x5ce)]['prototype']['getValue'];Cesium__namespace['GridMaterialProperty'][_0x35a251(0xb1b)]['getValue']=function(_0x2fedcc,_0x5b7562){return _0x5b7562=getValue_old$5['bind'](this)(_0x2fedcc,_0x5b7562),this['globalAlpha']!==0x1&&(_0x5b7562['color']&&(_0x5b7562['color']['alpha']*=this['globalAlpha']),_0x5b7562['cellAlpha']&&(_0x5b7562['cellAlpha']*=this['globalAlpha'])),_0x5b7562;},Object['defineProperties'](Cesium__namespace[_0x35a251(0x901)][_0x35a251(0xb1b)],{'globalAlpha':{'set':function(_0x4fde9c){const _0x4f2b74={_0x4626e6:0x1f4},_0x5ad8fc=_0x35a251;this[_0x5ad8fc(0xb8)]=_0x4fde9c;const _0x156633=getCesiumColor(this['color'],Cesium__namespace['Color']['WHITE']);!Cesium__namespace['defined'](this['_color_alpha'])&&(this['_color_alpha']=_0x156633[_0x5ad8fc(_0x4f2b74._0x4626e6)]),this['color']=_0x156633['withAlpha'](this[_0x5ad8fc(0x326)]*_0x4fde9c);},'get':function(){return this['_globalAlpha']??0x1;}}}),Object['defineProperties'](Cesium__namespace[_0x35a251(0x820)]['prototype'],{'globalAlpha':{'set':function(_0x376b56){this['_globalAlpha']=_0x376b56;},'get':function(){const _0x234c1b=_0x35a251;return this[_0x234c1b(0xb8)]??0x1;}}});const getValue_old$4=Cesium__namespace['PolylineArrowMaterialProperty'][_0x35a251(0xb1b)]['getValue'];Cesium__namespace[_0x35a251(0x820)]['prototype']['getValue']=function(_0x17db0c,_0x2d8446){const _0x464a44={_0x364295:0x154,_0x43c17b:0x1f4},_0x47770f=_0x35a251;return _0x2d8446=getValue_old$4[_0x47770f(_0x464a44._0x364295)](this)(_0x17db0c,_0x2d8446),_0x2d8446[_0x47770f(0x9db)]&&this['globalAlpha']!==0x1&&(_0x2d8446[_0x47770f(0x9db)][_0x47770f(_0x464a44._0x43c17b)]*=this['globalAlpha']),_0x2d8446;},Object['defineProperties'](Cesium__namespace[_0x35a251(0x157)]['prototype'],{'globalAlpha':{'set':function(_0x363940){const _0x5448be=_0x35a251;this[_0x5448be(0xb8)]=_0x363940;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$3=Cesium__namespace['PolylineDashMaterialProperty']['prototype']['getValue'];Cesium__namespace['PolylineDashMaterialProperty']['prototype']['getValue']=function(_0x305a50,_0x316966){const _0x323d52=_0x35a251;return _0x316966=getValue_old$3[_0x323d52(0x154)](this)(_0x305a50,_0x316966),this['globalAlpha']!==0x1&&(_0x316966['color']&&(_0x316966['color']['alpha']*=this['globalAlpha']),_0x316966['gapColor']&&(_0x316966['gapColor']['alpha']*=this['globalAlpha'])),_0x316966;},Object['defineProperties'](Cesium__namespace['PolylineGlowMaterialProperty'][_0x35a251(0xb1b)],{'globalAlpha':{'set':function(_0x57f230){this['_globalAlpha']=_0x57f230;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$2=Cesium__namespace[_0x35a251(0x94c)]['prototype'][_0x35a251(0x7ec)];Cesium__namespace[_0x35a251(0x94c)]['prototype']['getValue']=function(_0x130a80,_0xed8295){const _0x5ad5cc=_0x35a251;return _0xed8295=getValue_old$2['bind'](this)(_0x130a80,_0xed8295),_0xed8295[_0x5ad5cc(0x9db)]&&this['globalAlpha']!==0x1&&(_0xed8295['color'][_0x5ad5cc(0x1f4)]*=this['globalAlpha']),_0xed8295;},Object['defineProperties'](Cesium__namespace['PolylineOutlineMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x302344){const _0x1bae33=_0x35a251;this[_0x1bae33(0xb8)]=_0x302344;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$1=Cesium__namespace['PolylineOutlineMaterialProperty']['prototype']['getValue'];Cesium__namespace['PolylineOutlineMaterialProperty'][_0x35a251(0xb1b)]['getValue']=function(_0x49aa9b,_0x4aeab3){const _0x50c1ce={_0x3b339e:0x1f4},_0x1bb707=_0x35a251;return _0x4aeab3=getValue_old$1['bind'](this)(_0x49aa9b,_0x4aeab3),this['globalAlpha']!==0x1&&(_0x4aeab3[_0x1bb707(0x9db)]&&(_0x4aeab3['color'][_0x1bb707(_0x50c1ce._0x3b339e)]*=this['globalAlpha']),_0x4aeab3['outlineColor']&&(_0x4aeab3['outlineColor']['alpha']*=this['globalAlpha'])),_0x4aeab3;},Object[_0x35a251(0x1bd)](Cesium__namespace[_0x35a251(0x701)]['prototype'],{'globalAlpha':{'set':function(_0x351ff6){this['_globalAlpha']=_0x351ff6;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old=Cesium__namespace['StripeMaterialProperty']['prototype']['getValue'];Cesium__namespace['StripeMaterialProperty'][_0x35a251(0xb1b)][_0x35a251(0x7ec)]=function(_0x3d0701,_0x52867b){const _0x3fa95d=_0x35a251;return _0x52867b=getValue_old['bind'](this)(_0x3d0701,_0x52867b),this[_0x3fa95d(0x2cf)]!==0x1&&(_0x52867b['evenColor']&&(_0x52867b['evenColor']['alpha']*=this['globalAlpha']),_0x52867b['oddColor']&&(_0x52867b['oddColor'][_0x3fa95d(0x1f4)]*=this['globalAlpha'])),_0x52867b;},proj4[_0x35a251(0x7da)](_0x35a251(0xc5f),'+proj=longlat\x20+ellps=GRS80\x20+no_defs'),proj4['defs']('EPSG:4491',_0x35a251(0x43f)),proj4[_0x35a251(0x7da)]('EPSG:4492',_0x35a251(0x16a)),proj4[_0x35a251(0x7da)]('EPSG:4493',_0x35a251(0xe6e)),proj4['defs']('EPSG:4494',_0x35a251(0x106)),proj4['defs']('EPSG:4495',_0x35a251(0x955)),proj4['defs']('EPSG:4496',_0x35a251(0x1b0)),proj4['defs'](_0x35a251(0xb3),_0x35a251(0xaed)),proj4['defs'](_0x35a251(0x462),'+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=20500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0xb9),'+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=21500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0x46f),'+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=22500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4501','+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=23500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4513','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=25500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4514','+proj=tmerc\x20+lat_0=0\x20+lon_0=78\x20+k=1\x20+x_0=26500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0x809),_0x35a251(0x520)),proj4['defs']('EPSG:4516','+proj=tmerc\x20+lat_0=0\x20+lon_0=84\x20+k=1\x20+x_0=28500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4517','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=29500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0xb6f),'+proj=tmerc\x20+lat_0=0\x20+lon_0=90\x20+k=1\x20+x_0=30500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4519','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=31500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0xbd),'+proj=tmerc\x20+lat_0=0\x20+lon_0=96\x20+k=1\x20+x_0=32500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0xa64),'+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=33500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4522',_0x35a251(0xf5e)),proj4['defs'](_0x35a251(0x8ba),_0x35a251(0x751)),proj4[_0x35a251(0x7da)]('EPSG:4524','+proj=tmerc\x20+lat_0=0\x20+lon_0=108\x20+k=1\x20+x_0=36500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4525',_0x35a251(0x1ce)),proj4['defs'](_0x35a251(0xf25),'+proj=tmerc\x20+lat_0=0\x20+lon_0=114\x20+k=1\x20+x_0=38500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4527','+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=39500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)]('EPSG:4528','+proj=tmerc\x20+lat_0=0\x20+lon_0=120\x20+k=1\x20+x_0=40500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4529','+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=41500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0x346),_0x35a251(0xc4f)),proj4['defs']('EPSG:4531','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=43500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4532','+proj=tmerc\x20+lat_0=0\x20+lon_0=132\x20+k=1\x20+x_0=44500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)]('EPSG:4533',_0x35a251(0x849)),proj4[_0x35a251(0x7da)]('EPSG:4502',_0x35a251(0x959)),proj4['defs']('EPSG:4503','+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0x69a),_0x35a251(0x961)),proj4['defs']('EPSG:4505',_0x35a251(0x39f)),proj4[_0x35a251(0x7da)]('EPSG:4506',_0x35a251(0x646)),proj4[_0x35a251(0x7da)]('EPSG:4507','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)]('EPSG:4508','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0x1e9),'+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0x28c),_0x35a251(0xc63)),proj4['defs']('EPSG:4511',_0x35a251(0xa12)),proj4[_0x35a251(0x7da)](_0x35a251(0xbe5),'+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0x737),'+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0x34b),_0x35a251(0xe0d)),proj4['defs'](_0x35a251(0xd55),'+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0xe88),'+proj=tmerc\x20+lat_0=0\x20+lon_0=84\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4538','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0x309),_0x35a251(0xf2e)),proj4['defs']('EPSG:4540','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)]('EPSG:4541','+proj=tmerc\x20+lat_0=0\x20+lon_0=96\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0xd45),_0x35a251(0x646)),proj4['defs']('EPSG:4543','+proj=tmerc\x20+lat_0=0\x20+lon_0=102\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4544','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x35a251(0x7da)](_0x35a251(0xf14),_0x35a251(0xa38)),proj4[_0x35a251(0x7da)]('EPSG:4546',_0x35a251(0x362)),proj4[_0x35a251(0x7da)](_0x35a251(0xf58),'+proj=tmerc\x20+lat_0=0\x20+lon_0=114\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4548','+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4549','+proj=tmerc\x20+lat_0=0\x20+lon_0=120\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4550','+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4551','+proj=tmerc\x20+lat_0=0\x20+lon_0=126\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4552','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4553','+proj=tmerc\x20+lat_0=0\x20+lon_0=132\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x35a251(0xef8),'+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs');class BaseClass{constructor(_0x17f549){const _0x4d17dd=_0x35a251;this['options']=_0x17f549,this[_0x4d17dd(0x195)]=(_0x17f549===null||_0x17f549===void 0x0?void 0x0:_0x17f549['enabledEvent'])??!![];}get['enabledEvent'](){return this['_enabledEvent'];}set['enabledEvent'](_0x267ba2){this['_enabledEvent']=_0x267ba2;}[_0x35a251(0xa63)](_0x25939c){if(!_0x25939c)for(const _0x45a852 in this){delete this[_0x45a852];}}['on'](_0x2bde58,_0xeaed33,_0x256909){const _0x3d9976={_0xaa6c08:0xe1e,_0x2e4bdf:0xf1f},_0x151888=_0x35a251;if(!_0x2bde58)return logError$1('绑定事件时传入了空值',_0xeaed33),this;if(Array['isArray'](_0x2bde58))for(let _0x2fa22f=0x0,_0x34f01e=_0x2bde58[_0x151888(_0x3d9976._0xaa6c08)];_0x2fa22f<_0x34f01e;_0x2fa22f++){this['_on'](_0x2bde58[_0x2fa22f],_0xeaed33,_0x256909);}else{if(isObject(_0x2bde58))for(const _0x51c0f6 in _0x2bde58){this['_on'](_0x51c0f6,_0x2bde58[_0x51c0f6],_0xeaed33);}else{_0x2bde58=splitWords(_0x2bde58);for(let _0x3a25a5=0x0,_0x2ec9b3=_0x2bde58['length'];_0x3a25a5<_0x2ec9b3;_0x3a25a5++){this['_on'](_0x2bde58[_0x3a25a5],_0xeaed33,_0x256909);}}}return this[_0x151888(_0x3d9976._0x2e4bdf)]&&this['_onEventHook'](_0x2bde58),this;}[_0x35a251(0x6b2)](_0x1b34d8,_0x1dc206,_0x2cd407){if(!_0x1b34d8)delete this['_events'];else{if(Array['isArray'](_0x1b34d8))for(let _0x161108=0x0,_0x7e101=_0x1b34d8['length'];_0x161108<_0x7e101;_0x161108++){this['_off'](_0x1b34d8[_0x161108],_0x1dc206,_0x2cd407);}else{if(isObject(_0x1b34d8))for(const _0x4bedbd in _0x1b34d8){this['_off'](_0x4bedbd,_0x1b34d8[_0x4bedbd],_0x1dc206);}else{_0x1b34d8=splitWords(_0x1b34d8);for(let _0x5dfe63=0x0,_0x44c483=_0x1b34d8['length'];_0x5dfe63<_0x44c483;_0x5dfe63++){this['_off'](_0x1b34d8[_0x5dfe63],_0x1dc206,_0x2cd407);}}}}return this;}['_on'](_0x4646b8,_0x2b44e8,_0x28a075){const _0x3d9367={_0x59711a:0x997,_0x233195:0x997,_0x42535e:0xa01},_0x2f076b=_0x35a251;this['_events']=this[_0x2f076b(_0x3d9367._0x59711a)]||{};let _0x507e69=this[_0x2f076b(_0x3d9367._0x233195)][_0x4646b8];!_0x507e69&&(_0x507e69=[],this[_0x2f076b(0x997)][_0x4646b8]=_0x507e69);_0x28a075===this&&(_0x28a075=undefined);const _0x2cb70c={'fn':_0x2b44e8,'ctx':_0x28a075},_0x1fcfb5=_0x507e69;for(let _0x2a32b3=0x0,_0x4ab044=_0x1fcfb5['length'];_0x2a32b3<_0x4ab044;_0x2a32b3++){if(_0x1fcfb5[_0x2a32b3]['fn']===_0x2b44e8&&_0x1fcfb5[_0x2a32b3][_0x2f076b(_0x3d9367._0x42535e)]===_0x28a075)return;}_0x1fcfb5['push'](_0x2cb70c);}['_off'](_0x178075,_0x173418,_0x3baf7e){const _0x271759={_0xf6de3f:0xafa},_0x3cbe31=_0x35a251;let _0x1aa4c1,_0x28f711,_0x55e729;if(!this[_0x3cbe31(0x997)])return;_0x1aa4c1=this['_events'][_0x178075];if(!_0x1aa4c1)return;if(!_0x173418){for(_0x28f711=0x0,_0x55e729=_0x1aa4c1['length'];_0x28f711<_0x55e729;_0x28f711++){_0x1aa4c1[_0x28f711]['fn']=falseFn;}delete this[_0x3cbe31(0x997)][_0x178075];return;}_0x3baf7e===this&&(_0x3baf7e=undefined);if(_0x1aa4c1)for(_0x28f711=0x0,_0x55e729=_0x1aa4c1['length'];_0x28f711<_0x55e729;_0x28f711++){const _0x993f96=_0x1aa4c1[_0x28f711];if(_0x993f96[_0x3cbe31(0xa01)]!==_0x3baf7e)continue;if(_0x993f96['fn']===_0x173418){_0x993f96['fn']=falseFn;this[_0x3cbe31(_0x271759._0xf6de3f)]&&(this[_0x3cbe31(0x997)][_0x178075]=_0x1aa4c1=_0x1aa4c1['slice']());_0x1aa4c1['splice'](_0x28f711,0x1);return;}}}[_0x35a251(0x264)](_0x275406,_0x3461cd,_0x390a36){const _0x4ef559={_0x557bb9:0x752,_0x23debd:0x997},_0x4c7bde=_0x35a251;if(!this[_0x4c7bde(0x78c)](_0x275406,_0x390a36)||!this[_0x4c7bde(_0x4ef559._0x557bb9)])return this;const _0x58d903={'sourceTarget':this,..._0x3461cd,'type':_0x275406,'target':this,'stopPropagation':function(){const _0x55b244=_0x4c7bde;this[_0x55b244(0x6fc)]=!![];}};if(this[_0x4c7bde(0x997)]){const _0x5b8e36=this[_0x4c7bde(_0x4ef559._0x23debd)][_0x275406];if(_0x5b8e36){this['_firingCount']=this['_firingCount']+0x1||0x1;for(let _0x26f6e7=0x0,_0x2a944e=_0x5b8e36['length'];_0x26f6e7<_0x2a944e;_0x26f6e7++){const _0x1d362f=_0x5b8e36[_0x26f6e7];_0x1d362f['fn']['call'](_0x1d362f['ctx']||this,_0x58d903);}this['_firingCount']--;}}return _0x390a36&&!_0x58d903['_stopPropagation']&&this['_propagateEvent'](_0x58d903),this;}['listens'](_0x21c7dd,_0xdaa4d6){const _0x4796cb={_0x4b6cb4:0x78c},_0x58d228=_0x35a251,_0x53e009=this['_events']&&this[_0x58d228(0x997)][_0x21c7dd];if(_0x53e009&&_0x53e009[_0x58d228(0xe1e)])return!![];if(_0xdaa4d6)for(const _0x26481e in this['_eventParents']){if(this[_0x58d228(0xd92)][_0x26481e][_0x58d228(_0x4796cb._0x4b6cb4)](_0x21c7dd,_0xdaa4d6))return!![];}return![];}['once'](_0x293cc9,_0x35905d,_0x5f2749){const _0x108e34={_0x2796b8:0x1fd},_0x39bc6a=_0x35a251;if(isObject(_0x293cc9)){for(const _0x3588f8 in _0x293cc9){this[_0x39bc6a(_0x108e34._0x2796b8)](_0x3588f8,_0x293cc9[_0x3588f8],_0x35905d);}return this;}const _0x1f9637=bind(()=>{this['off'](_0x293cc9,_0x35905d,_0x5f2749)['off'](_0x293cc9,_0x1f9637,_0x5f2749);},this);return this['on'](_0x293cc9,_0x35905d,_0x5f2749)['on'](_0x293cc9,_0x1f9637,_0x5f2749);}['addEventParent'](_0x33bfbf){const _0x4ece8d={_0xac1d87:0xd92},_0x8c17af=_0x35a251;return this['_eventParents']=this[_0x8c17af(_0x4ece8d._0xac1d87)]||{},this['_eventParents'][stampGlobalId(_0x33bfbf)]=_0x33bfbf,this;}[_0x35a251(0x3c4)](_0x5d60f3){const _0x35f50f={_0x4c3493:0xd92},_0x4c10b5=_0x35a251;return this['_eventParents']&&delete this[_0x4c10b5(_0x35f50f._0x4c3493)][stampGlobalId(_0x5d60f3)],this;}[_0x35a251(0x3f9)](_0x3b7bef){return this['_eventParents']&&this['_eventParents'][stampGlobalId(_0x3b7bef)]?!![]:![];}[_0x35a251(0xa52)](_0x4105fc){for(const _0x7010dc in this['_eventParents']){const _0x204417=this['_eventParents'][_0x7010dc];this['_filterPropagateEvent'](_0x204417,_0x4105fc)&&_0x204417['fire'](_0x4105fc['type'],{'layer':_0x4105fc['target'],'propagatedFrom':_0x4105fc['target'],..._0x4105fc},!![]);}}[_0x35a251(0x5a6)](_0x36803b,_0x1d72df){return!![];}}function falseFn(){return![];}function bind(_0x403e09,_0x375b8f){const _0x14bc50={_0x7c0238:0x240},_0x3f1881=_0x35a251,_0x294761=Array['prototype']['slice'];if(_0x403e09['bind'])return _0x403e09['bind'][_0x3f1881(_0x14bc50._0x7c0238)](_0x403e09,_0x294761['call'](arguments,0x1));const _0x3aa776=_0x294761[_0x3f1881(0xad6)](arguments,0x2);return function(){return _0x403e09['apply'](_0x375b8f,_0x3aa776['length']?_0x3aa776['concat'](_0x294761['call'](arguments)):arguments);};}const State={'INITIALIZED':'inited','ADD':'add','ADDED':_0x35a251(0xaa),'REMOVED':_0x35a251(0x913),'DESTROY':_0x35a251(0xa63)},EventType={'add':_0x35a251(0x4af),'remove':'remove','addItem':_0x35a251(0xe5f),'removeItem':'removeItem','addGraphic':_0x35a251(0x8b5),'removeGraphic':'removeGraphic','addLayer':'addLayer','removeLayer':_0x35a251(0xad7),'changeBasemap':_0x35a251(0xa99),'addControl':'addControl','removeControl':'removeControl','updateControl':'updateControl','addEffect':'addEffect','removeEffect':'removeEffect','update':'update','updatePosition':'updatePosition','updateStyle':'updateStyle','updateAttr':'updateAttr','show':'show','hide':'hide','start':'start','change':'change','endItem':'endItem','end':'end','stop':_0x35a251(0xf9b),'zoom':_0x35a251(0xf20),'loadBefore':'loadBefore','load':'load','error':'error','loadConfig':'loadConfig','popupOpen':'popupOpen','popupClose':'popupClose','tooltipOpen':'tooltipOpen','tooltipClose':_0x35a251(0xac0),'contextMenuOpen':'contextMenuOpen','contextMenuClose':'contextMenuClose','contextMenuClick':'contextMenuClick','highlightOpen':'highlightOpen','highlightClose':_0x35a251(0x77b),'click':'click','clickGraphic':_0x35a251(0x4cf),'clickTileGraphic':_0x35a251(0xe7a),'clickMap':'clickMap','dblClick':'dblClick','leftDown':'leftDown','leftUp':'leftUp','mouseMove':'mouseMove','mouseMoveTarget':'mouseMoveTarget','wheel':'wheel','rightClick':'rightClick','rightDown':_0x35a251(0xd9f),'rightUp':'rightUp','middleClick':'middleClick','middleDown':_0x35a251(0x851),'middleUp':'middleUp','pinchStart':'pinchStart','pinchEnd':_0x35a251(0xc17),'pinchMove':'pinchMove','mouseDown':'mouseDown','mouseUp':_0x35a251(0x34d),'mouseOver':'mouseOver','mouseOut':'mouseOut','keydown':'keydown','keyup':'keyup','drawStart':'drawStart','drawMouseMove':_0x35a251(0xc48),'drawAddPoint':'drawAddPoint','drawRemovePoint':'drawRemovePoint','drawCreated':'drawCreated','editStart':'editStart','editMouseDown':'editMouseDown','editMouseMove':'editMouseMove','editMovePoint':_0x35a251(0x6ae),'editAddPoint':_0x35a251(0xf08),'editRemovePoint':'editRemovePoint','editStyle':'editStyle','editStop':'editStop','move':'move','initialTilesLoaded':'initialTilesLoaded','allTilesLoaded':_0x35a251(0x245),'addTile':'addTile','addTileSuccess':'addTileSuccess','addTileError':'addTileError','removeTile':'removeTile','cameraMoveStart':_0x35a251(0xbbf),'cameraMoveEnd':'cameraMoveEnd','cameraChanged':'cameraChanged','preUpdate':'preUpdate','postUpdate':'postUpdate','preRender':'preRender','postRender':'postRender','renderError':'renderError','morphStart':'morphStart','morphComplete':'morphComplete','clockTick':'clockTick','clockStop':'clockStop','terrainChange':'terrainChange','terrainLoadError':'terrainLoadError','terrainLoadSuccess':'terrainLoadSuccess','tileLoadProgress':'tileLoadProgress'};class BaseThing extends BaseClass{constructor(_0x49bd5a={}){const _0xcf2776=_0x35a251;isBoolean(_0x49bd5a)&&(_0x49bd5a={'enabled':_0x49bd5a}),super(_0x49bd5a),this['_id']=_0x49bd5a['id']??createGuid(),this[_0xcf2776(0x706)]=_0x49bd5a['enabled']??!![],this[_0xcf2776(0xf96)]=State['INITIALIZED'],this['options']=_0x49bd5a;}get['state'](){const _0x29f8e8={_0x5e42d6:0xf96},_0x5f2c7b=_0x35a251;return this[_0x5f2c7b(_0x29f8e8._0x5e42d6)];}get[_0x35a251(0x47f)](){return this['_state']===State['ADDED'];}get['id'](){return this['_id'];}set['id'](_0x1fbeaf){const _0x7fd04d={_0x2ec11a:0xe86},_0x544c18=_0x35a251;this[_0x544c18(_0x7fd04d._0x2ec11a)]['id']=_0x1fbeaf;}get['uuid'](){return this['_id'];}get[_0x35a251(0x2a6)](){const _0x3b6cda=_0x35a251;return this[_0x3b6cda(0x706)];}set[_0x35a251(0x2a6)](_0x553ae3){const _0x1cdd9c={_0x5d8610:0xefe},_0x4e0bfc=_0x35a251;if(this['_enabled']===_0x553ae3)return;this['_enabled']=_0x553ae3,this[_0x4e0bfc(_0x1cdd9c._0x5d8610)]&&this['_enabledHook'](_0x553ae3);}['addTo'](_0x4e750f){return _0x4e750f&&_0x4e750f['addThing']&&_0x4e750f['addThing'](this),this;}['remove'](_0x11c71f){const _0x468c34=_0x35a251;this[_0x468c34(0xd79)]&&this['_map']['removeThing'](this,_0x11c71f);}['_onAdd'](_0x1ad6fa){const _0x4798ec={_0x4511d0:0xf96,_0x2a18fb:0x9b4,_0x137009:0xd79,_0x1b708c:0x700},_0x540bf2=_0x35a251;var _0x425a23;if(this['isAdded']||this[_0x540bf2(_0x4798ec._0x4511d0)]===State[_0x540bf2(_0x4798ec._0x2a18fb)])return;this[_0x540bf2(0xf96)]=State['ADD'],this[_0x540bf2(_0x4798ec._0x137009)]=_0x1ad6fa;if(this['options']['eventParent'])this['addEventParent'](this[_0x540bf2(0xe86)]['eventParent']);else{if(((_0x425a23=this[_0x540bf2(0xe86)])===null||_0x425a23===void 0x0?void 0x0:_0x425a23[_0x540bf2(0x6ec)])===![]);else this['addEventParent'](_0x1ad6fa);}this['_mountedHook']&&!this['_createOK']&&(this[_0x540bf2(_0x4798ec._0x1b708c)](),this['_createOK']=!![]),this['_addedBaseHook']&&this['_addedBaseHook'](),this['_addedHook']&&this['_addedHook'](),this['_state']=State['ADDED'],this['fire'](EventType['add']);}['_onRemove'](){const _0x2a2c14={_0x35db26:0xf96,_0x41a4c5:0xe86},_0x18ab10=_0x35a251;var _0x397a42,_0xd671b1;if(this['_state']!==State[_0x18ab10(0xef0)])return;if(!this['_map'])return;this['_removedBaseHook']&&this[_0x18ab10(0x88)](),this['_removedHook']&&this[_0x18ab10(0xa9a)](),this[_0x18ab10(_0x2a2c14._0x35db26)]=State['REMOVED'],this['fire'](EventType[_0x18ab10(0x1ee)]);if((_0x397a42=this[_0x18ab10(_0x2a2c14._0x41a4c5)])!==null&&_0x397a42!==void 0x0&&_0x397a42['eventParent'])this['removeEventParent'](this[_0x18ab10(0xe86)]['eventParent']);else{if(((_0xd671b1=this['options'])===null||_0xd671b1===void 0x0?void 0x0:_0xd671b1['eventParent'])===![]);else this[_0x18ab10(0x3c4)](this['_map']);}this['_map']=null;}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){}['setOptions'](_0xf0e868){const _0x44dec6=_0x35a251;if(!_0xf0e868||Object[_0x44dec6(0x68f)](_0xf0e868)['length']===0x0)return this;return this['options']=merge(this['options'],_0xf0e868),Cesium__namespace['defined'](_0xf0e868[_0x44dec6(0x2a6)])&&(this['enabled']=_0xf0e868['enabled']),this['_setOptionsHook']&&this[_0x44dec6(0xbfc)](this['options'],_0xf0e868),this;}[_0x35a251(0xa63)](_0x1ff9a3){const _0x2d0056=_0x35a251;this[_0x2d0056(0xf96)]!==State['REMOVED']&&(this[_0x2d0056(0x386)]&&this['clear'](),this['remove']()),super['destroy'](_0x1ff9a3);}}class GroupThing extends BaseThing{constructor(_0x17fedb={}){const _0x35a1a9={_0x58d918:0x783},_0x14a895=_0x35a251;super(_0x17fedb),this[_0x14a895(_0x35a1a9._0x58d918)]=[];}get['arrThing'](){return this['_arrThing'];}get[_0x35a251(0x804)](){const _0x5840d7={_0x49c06a:0xe1e},_0x1ff7e7=_0x35a251;return this[_0x1ff7e7(_0x5840d7._0x49c06a)]===0x0;}get['hasChildThing'](){return this['length']>0x0;}get['length'](){const _0x22e15e={_0x38b9e2:0x6b7},_0x3251aa=_0x35a251;var _0x3b6585;return((_0x3b6585=this['options']['things'])===null||_0x3b6585===void 0x0?void 0x0:_0x3b6585[_0x3251aa(0xe1e)])>0x0?this['options'][_0x3251aa(_0x22e15e._0x38b9e2)]['length']:this['_arrThing']['length'];}['_enabledHook'](_0x217ebb){this['eachThing'](_0x10218a=>{_0x10218a['enabled']=_0x217ebb;},this);}[_0x35a251(0x97b)](){this['addChildsToMap']();}[_0x35a251(0xa9a)](){const _0x5d4951={_0x2cdaef:0x9bf},_0x1c7a83=_0x35a251;this[_0x1c7a83(_0x5d4951._0x2cdaef)]();}[_0x35a251(0xec8)](){this['eachThing'](_0x3ccd9e=>{this['_map']['addThing'](_0x3ccd9e);},this);}['removeMapChilds'](){const _0x37b96e={_0x3eff0c:0xd0},_0x9e72a2={_0x369c0c:0xd79},_0x3f86b5=_0x35a251;this[_0x3f86b5(_0x37b96e._0x3eff0c)](_0x45ac18=>{const _0x368cfd=_0x3f86b5;this[_0x368cfd(_0x9e72a2._0x369c0c)]['removeThing'](_0x45ac18);},this);}['addThing'](_0x48bbcb){const _0x4b861f={_0x364904:0x605,_0x25641f:0x6de,_0x1ba2b8:0x47f,_0x545901:0x3c4},_0x174a35=_0x35a251;return _0x48bbcb['parent']&&(_0x48bbcb['removeEventParent'](_0x48bbcb[_0x174a35(_0x4b861f._0x364904)]),_0x48bbcb[_0x174a35(_0x4b861f._0x364904)]=null),_0x48bbcb['parent']=this,_0x48bbcb['options']['eventParent']=this,this['_arrThing'][_0x174a35(_0x4b861f._0x25641f)](_0x48bbcb),this[_0x174a35(_0x4b861f._0x1ba2b8)]&&!_0x48bbcb['isAdded']?this['_map']['addThing'](_0x48bbcb):(_0x48bbcb[_0x174a35(_0x4b861f._0x545901)](this['_map']),_0x48bbcb['addEventParent'](this)),this;}['removeThing'](_0xb1f51f){const _0xd7cd15={_0x31fd00:0x605,_0x5a1067:0x3c4},_0x3adeeb=_0x35a251;return _0xb1f51f[_0x3adeeb(_0xd7cd15._0x31fd00)]=null,_0xb1f51f[_0x3adeeb(_0xd7cd15._0x5a1067)](this),removeArrayItem(this['_arrThing'],_0xb1f51f),this[_0x3adeeb(0xd79)]&&_0xb1f51f['isAdded']&&this['_map']['removeThing'](_0xb1f51f),this;}[_0x35a251(0xd0)](_0x4e9d3,_0xd6a2c1){const _0x16d43c={_0x18b859:0xad6};if(!this['_arrThing'])return;return this['_arrThing']['forEach'](_0x3f6834=>{const _0x5e9314=_0x2767;_0x4e9d3[_0x5e9314(_0x16d43c._0x18b859)](_0xd6a2c1,_0x3f6834);}),this;}[_0x35a251(0x932)](){const _0x83e1eb={_0x576649:0x783},_0x4b7b05=_0x35a251;return this[_0x4b7b05(_0x83e1eb._0x576649)];}[_0x35a251(0x2f0)](){const _0x24d2bc=this['_arrThing']||[];return this['_map']['eachThing'](_0x40acd7=>{if(_0x40acd7['pid']!==this['id'])return;if(this['_arrThing']['indexOf'](_0x40acd7)!==-0x1)return;_0x24d2bc['push'](_0x40acd7);},this),_0x24d2bc;}[_0x35a251(0xb96)](_0x17c228){const _0x392d66={_0x523965:0x783},_0x65c59c=_0x35a251,_0x4eea75=this[_0x65c59c(_0x392d66._0x523965)];if(!this['_arrThing']||this['_arrThing']['length']===0x0)return;for(let _0x1df1e0=0x0,_0x4f6d3c=_0x4eea75['length'];_0x1df1e0<_0x4f6d3c;_0x1df1e0++){const _0x3d0c02=_0x4eea75[_0x1df1e0];if(_0x3d0c02['id']===_0x17c228)return _0x3d0c02;}return undefined;}['destroy'](_0x5d8724){this['eachThing'](_0x337c97=>{_0x337c97!==null&&_0x337c97!==void 0x0&&_0x337c97['destroy']&&_0x337c97['destroy'](_0x5d8724);},this),super['destroy'](_0x5d8724);}}var GroundSkyBoxFS='uniform\x20samplerCube\x20u_cubeMap;\x0ain\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap,\x20normalize(v_texCoord));\x0a\x20\x20out_FragColor\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a}\x0a',GroundSkyBoxVS=_0x35a251(0xbda);class GroundSkyBox extends Cesium__namespace[_0x35a251(0xd8d)]{constructor(_0x3d40c2){super(_0x3d40c2),this['_skyboxMatrix3']=new Cesium__namespace['Matrix3']();}[_0x35a251(0x182)](_0x244527,_0x2a3b11){const _0x4c9dd4={_0x4cc0f2:0xaa2,_0x55e88a:0xdba,_0x59b2d3:0x7a0,_0x4d2abb:0x45f,_0x1b64ee:0xa9e,_0x18639d:0xa98,_0x469a4c:0x8a8,_0x40b3f2:0xb48,_0x55d515:0xf7c,_0x420ff2:0xd48,_0x2852f6:0x85c},_0x544fc8={_0x30a69c:0x67b,_0x2373d2:0x7d,_0x3aaf3a:0x677},_0x3a0fbf=_0x35a251,_0x3caba4=this;if(!this[_0x3a0fbf(0x987)])return undefined;if(_0x244527[_0x3a0fbf(0xef7)]!==Cesium__namespace['SceneMode']['SCENE3D']&&_0x244527['mode']!==Cesium__namespace['SceneMode']['MORPHING'])return undefined;if(!_0x244527['passes']['render'])return undefined;const _0x3bdd78=_0x244527[_0x3a0fbf(0x390)];if(this['_sources']!==this['sources']){this[_0x3a0fbf(0x8a8)]=this['sources'];const _0x4f3782=this['sources'];if(!Cesium__namespace['defined'](_0x4f3782['positiveX'])||!Cesium__namespace[_0x3a0fbf(_0x4c9dd4._0x4cc0f2)](_0x4f3782['negativeX'])||!Cesium__namespace['defined'](_0x4f3782['positiveY'])||!Cesium__namespace['defined'](_0x4f3782['negativeY'])||!Cesium__namespace['defined'](_0x4f3782['positiveZ'])||!Cesium__namespace['defined'](_0x4f3782['negativeZ']))throw new Cesium__namespace[(_0x3a0fbf(0x50f))](_0x3a0fbf(_0x4c9dd4._0x55e88a));if(typeof _0x4f3782['positiveX']!==typeof _0x4f3782[_0x3a0fbf(0xc38)]||typeof _0x4f3782['positiveX']!==typeof _0x4f3782['positiveY']||typeof _0x4f3782['positiveX']!==typeof _0x4f3782['negativeY']||typeof _0x4f3782['positiveX']!==typeof _0x4f3782['positiveZ']||typeof _0x4f3782[_0x3a0fbf(_0x4c9dd4._0x59b2d3)]!==typeof _0x4f3782[_0x3a0fbf(_0x4c9dd4._0x4d2abb)])throw new Cesium__namespace['DeveloperError'](_0x3a0fbf(_0x4c9dd4._0x1b64ee));typeof _0x4f3782[_0x3a0fbf(0x7a0)]==='string'?Cesium__namespace[_0x3a0fbf(_0x4c9dd4._0x18639d)](_0x3bdd78,this[_0x3a0fbf(_0x4c9dd4._0x469a4c)])['then'](function(_0x1d00fe){const _0x3c9657=_0x3a0fbf;_0x3caba4['_cubeMap']=_0x3caba4[_0x3c9657(0x799)]&&_0x3caba4['_cubeMap'][_0x3c9657(0xa63)](),_0x3caba4[_0x3c9657(0x799)]=_0x1d00fe;}):(this['_cubeMap']=this['_cubeMap']&&this['_cubeMap']['destroy'](),this['_cubeMap']=new Cesium__namespace[(_0x3a0fbf(0x3e6))]({'context':_0x3bdd78,'source':_0x4f3782}));}const _0x477676=this['_command'];if(!Cesium__namespace[_0x3a0fbf(_0x4c9dd4._0x4cc0f2)](_0x477676['vertexArray'])){_0x477676['uniformMap']={'u_cubeMap':()=>{const _0xf9af5c=_0x3a0fbf;return _0x3caba4[_0xf9af5c(0x799)];},'u_rotateMatrix':()=>{const _0x22e6fd=_0x3a0fbf;return _0x477676['modelMatrix']=Cesium__namespace['Transforms'][_0x22e6fd(_0x544fc8._0x30a69c)](_0x244527[_0x22e6fd(_0x544fc8._0x2373d2)]['_positionWC']),Cesium__namespace['Matrix4']['getMatrix3'](_0x477676['modelMatrix'],this[_0x22e6fd(_0x544fc8._0x3aaf3a)]);}};const _0x52a648=Cesium__namespace['BoxGeometry']['createGeometry'](Cesium__namespace[_0x3a0fbf(0xc98)][_0x3a0fbf(0x6d3)]({'dimensions':new Cesium__namespace['Cartesian3'](0x2,0x2,0x2),'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']})),_0x184e24=this['_attributeLocations']=Cesium__namespace['GeometryPipeline'][_0x3a0fbf(_0x4c9dd4._0x40b3f2)](_0x52a648);_0x477676[_0x3a0fbf(_0x4c9dd4._0x55d515)]=Cesium__namespace['VertexArray']['fromGeometry']({'context':_0x3bdd78,'geometry':_0x52a648,'attributeLocations':_0x184e24,'bufferUsage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),_0x477676[_0x3a0fbf(0x5b0)]=Cesium__namespace['RenderState']['fromCache']({'blending':Cesium__namespace['BlendingState']['ALPHA_BLEND']});}if(!Cesium__namespace['defined'](_0x477676['shaderProgram'])||this['_useHdr']!==_0x2a3b11){const _0x2b7c77=new Cesium__namespace['ShaderSource']({'defines':[_0x2a3b11?'HDR':''],'sources':[GroundSkyBoxFS]});_0x477676['shaderProgram']=Cesium__namespace['ShaderProgram'][_0x3a0fbf(_0x4c9dd4._0x420ff2)]({'context':_0x3bdd78,'vertexShaderSource':GroundSkyBoxVS,'fragmentShaderSource':_0x2b7c77,'attributeLocations':this[_0x3a0fbf(_0x4c9dd4._0x2852f6)]}),this['_useHdr']=_0x2a3b11;}if(!Cesium__namespace['defined'](this['_cubeMap']))return undefined;return _0x477676;}}var MultipleSkyBoxFS='uniform\x20samplerCube\x20u_cubeMap;\x0auniform\x20samplerCube\x20u_cubeMap2;\x0auniform\x20samplerCube\x20u_cubeMap3;\x0auniform\x20float\x20u_select;\x0ain\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20fragColor;\x0a\x20\x20if(u_select\x20<=\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20vec4\x20color2\x20=\x20czm_textureCube(u_cubeMap2,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color2\x20=\x20vec4(czm_gammaCorrect(color2).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20fragColor\x20=\x20mix(color,\x20color2,\x20u_select);\x0a\x20\x20}\x0a\x20\x20if(u_select\x20>\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap2,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20vec4\x20color2\x20=\x20czm_textureCube(u_cubeMap3,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color2\x20=\x20vec4(czm_gammaCorrect(color2).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20fragColor\x20=\x20mix(color,\x20color2,\x20u_select\x20-\x201.0);\x0a\x20\x20}\x0a\x20\x20out_FragColor\x20=\x20fragColor;\x0a}\x0a',MultipleSkyBoxVS='in\x20vec3\x20position;\x0aout\x20vec3\x20v_texCoord;\x0auniform\x20mat3\x20u_rotateMatrix;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20p\x20=\x20czm_viewRotation\x20*\x20u_rotateMatrix\x20*\x20(czm_temeToPseudoFixed\x20*\x20(czm_entireFrustum.y\x20*\x20position));\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20vec4(p,\x201.0);\x0a\x20\x20v_texCoord\x20=\x20position.xyz;\x0a}\x0a';class MultipleSkyBox extends Cesium__namespace[_0x35a251(0xd8d)]{constructor(_0x61d8fe){const _0x429be4={_0xcea701:0x75e},_0x51a2c1=_0x35a251;super(_0x61d8fe),this[_0x51a2c1(0xc09)]=_0x61d8fe['sources2'],this['sources3']=_0x61d8fe[_0x51a2c1(0x96b)],this[_0x51a2c1(_0x429be4._0xcea701)]=undefined,this['_sources3']=undefined,this[_0x51a2c1(0x85)]=undefined,this['_cubeMap3']=undefined,this['_skyboxMatrix3']=new Cesium__namespace['Matrix3'](),this['select']=_0x61d8fe[_0x51a2c1(0x97f)]||0x0;}[_0x35a251(0x182)](_0x242dc8,_0x56b50d){const _0x3b6172={_0x84d511:0x266,_0x457317:0x390,_0x4ccd53:0x8a8,_0x596eec:0x8a8,_0x4575ed:0x75e,_0x2ac2e5:0x96b,_0x96996f:0x46a,_0x38b152:0x6e5,_0x326a0c:0xdba,_0x12b2a3:0xc38,_0x1a8a25:0x45f,_0x19bb70:0x799,_0xbda188:0x85,_0x126a06:0x609,_0x3ff7de:0x3e6,_0x232f1c:0x49c,_0x53fd4f:0x6d3,_0x4c20c4:0xd48,_0x4c1532:0x85c},_0x35f62a={_0x3c633f:0x6a7},_0x14bb24={_0xc87241:0x85},_0xa2768a={_0x54e2dd:0x799},_0x3a8f32=_0x35a251,_0x47f50a=this;if(!this['show'])return undefined;if(_0x242dc8[_0x3a8f32(0xef7)]!==Cesium__namespace[_0x3a8f32(0x637)]['SCENE3D']&&_0x242dc8['mode']!==Cesium__namespace['SceneMode']['MORPHING'])return undefined;if(!_0x242dc8['passes'][_0x3a8f32(_0x3b6172._0x84d511)])return undefined;const _0x3b4b4e=_0x242dc8[_0x3a8f32(_0x3b6172._0x457317)];if(this[_0x3a8f32(_0x3b6172._0x4ccd53)]!==this['sources']){this[_0x3a8f32(_0x3b6172._0x596eec)]=this['sources'];const _0x1a0a97=this['sources'];this[_0x3a8f32(_0x3b6172._0x4575ed)]=this['sources2'];const _0x4078f8=this['sources2'];this['_sources3']=this['sources3'];const _0x142c66=this[_0x3a8f32(_0x3b6172._0x2ac2e5)];if(!Cesium__namespace['defined'](_0x1a0a97['positiveX'])||!Cesium__namespace[_0x3a8f32(0xaa2)](_0x1a0a97['negativeX'])||!Cesium__namespace['defined'](_0x1a0a97[_0x3a8f32(_0x3b6172._0x96996f)])||!Cesium__namespace['defined'](_0x1a0a97[_0x3a8f32(_0x3b6172._0x38b152)])||!Cesium__namespace['defined'](_0x1a0a97['positiveZ'])||!Cesium__namespace['defined'](_0x1a0a97['negativeZ']))throw new Cesium__namespace['DeveloperError'](_0x3a8f32(_0x3b6172._0x326a0c));if(typeof _0x1a0a97[_0x3a8f32(0x7a0)]!==typeof _0x1a0a97[_0x3a8f32(_0x3b6172._0x12b2a3)]||typeof _0x1a0a97['positiveX']!==typeof _0x1a0a97[_0x3a8f32(_0x3b6172._0x96996f)]||typeof _0x1a0a97['positiveX']!==typeof _0x1a0a97[_0x3a8f32(0x6e5)]||typeof _0x1a0a97['positiveX']!==typeof _0x1a0a97['positiveZ']||typeof _0x1a0a97['positiveX']!==typeof _0x1a0a97[_0x3a8f32(_0x3b6172._0x1a8a25)])throw new Cesium__namespace[(_0x3a8f32(0x50f))](_0x3a8f32(0xa9e));typeof _0x1a0a97['positiveX']==='string'?(Cesium__namespace['loadCubeMap'](_0x3b4b4e,this['_sources'])['then'](function(_0x1da7c3){const _0x18514d=_0x3a8f32;_0x47f50a['_cubeMap']=_0x47f50a['_cubeMap']&&_0x47f50a[_0x18514d(_0xa2768a._0x54e2dd)]['destroy'](),_0x47f50a['_cubeMap']=_0x1da7c3;}),Cesium__namespace['loadCubeMap'](_0x3b4b4e,this['_sources2'])['then'](function(_0x32cd96){const _0x2c96b1=_0x3a8f32;_0x47f50a['_cubeMap2']=_0x47f50a[_0x2c96b1(_0x14bb24._0xc87241)]&&_0x47f50a['_cubeMap2'][_0x2c96b1(0xa63)](),_0x47f50a['_cubeMap2']=_0x32cd96;}),Cesium__namespace['loadCubeMap'](_0x3b4b4e,this['_sources3'])['then'](function(_0x103bc1){const _0x57ea1c=_0x3a8f32;_0x47f50a['_cubeMap3']=_0x47f50a['_cubeMap3']&&_0x47f50a['_cubeMap3'][_0x57ea1c(0xa63)](),_0x47f50a['_cubeMap3']=_0x103bc1;})):(this['_cubeMap']=this['_cubeMap']&&this['_cubeMap'][_0x3a8f32(0xa63)](),this[_0x3a8f32(_0x3b6172._0x19bb70)]=new Cesium__namespace['CubeMap']({'context':_0x3b4b4e,'source':_0x1a0a97}),this[_0x3a8f32(_0x3b6172._0xbda188)]=this['_cubeMap2']&&this['_cubeMap2'][_0x3a8f32(0xa63)](),this[_0x3a8f32(0x85)]=new Cesium__namespace['CubeMap']({'context':_0x3b4b4e,'source':_0x4078f8}),this[_0x3a8f32(_0x3b6172._0x126a06)]=this['_cubeMap3']&&this[_0x3a8f32(0x609)]['destroy'](),this[_0x3a8f32(0x609)]=new Cesium__namespace[(_0x3a8f32(_0x3b6172._0x3ff7de))]({'context':_0x3b4b4e,'source':_0x142c66}));}const _0x55c9f0=this['_command'];_0x55c9f0['modelMatrix']=Cesium__namespace[_0x3a8f32(_0x3b6172._0x232f1c)]['eastNorthUpToFixedFrame'](_0x242dc8[_0x3a8f32(0x7d)]['_positionWC']);if(!Cesium__namespace[_0x3a8f32(0xaa2)](_0x55c9f0['vertexArray'])){_0x55c9f0['uniformMap']={'u_cubeMap':function(){const _0x4390ac=_0x3a8f32;return _0x47f50a[_0x4390ac(0x799)];},'u_cubeMap2':function(){const _0x225588=_0x3a8f32;return _0x47f50a[_0x225588(0x85)];},'u_cubeMap3':function(){return _0x47f50a['_cubeMap3'];},'u_select':()=>{return this['select'];},'u_rotateMatrix':()=>{const _0x3ed9bd=_0x3a8f32;return _0x55c9f0['modelMatrix']=Cesium__namespace[_0x3ed9bd(0x49c)]['eastNorthUpToFixedFrame'](_0x242dc8['camera']['_positionWC']),Cesium__namespace[_0x3ed9bd(_0x35f62a._0x3c633f)]['getMatrix3'](_0x55c9f0['modelMatrix'],this['_skyboxMatrix3']);}};const _0x333241=Cesium__namespace['BoxGeometry'][_0x3a8f32(0x1f9)](Cesium__namespace['BoxGeometry'][_0x3a8f32(_0x3b6172._0x53fd4f)]({'dimensions':new Cesium__namespace['Cartesian3'](0x2,0x2,0x2),'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']})),_0x169967=this['_attributeLocations']=Cesium__namespace['GeometryPipeline'][_0x3a8f32(0xb48)](_0x333241);_0x55c9f0['vertexArray']=Cesium__namespace['VertexArray']['fromGeometry']({'context':_0x3b4b4e,'geometry':_0x333241,'attributeLocations':_0x169967,'bufferUsage':Cesium__namespace['BufferUsage']['_DRAW']}),_0x55c9f0[_0x3a8f32(0x5b0)]=Cesium__namespace[_0x3a8f32(0x7be)][_0x3a8f32(_0x3b6172._0x4c20c4)]({'blending':Cesium__namespace['BlendingState'][_0x3a8f32(0xe68)]});}if(!Cesium__namespace['defined'](_0x55c9f0['shaderProgram'])||this['_useHdr']!==_0x56b50d){const _0x1ab2e3=new Cesium__namespace['ShaderSource']({'defines':[_0x56b50d?'HDR':''],'sources':[MultipleSkyBoxFS]});_0x55c9f0[_0x3a8f32(0x57f)]=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x3b4b4e,'vertexShaderSource':MultipleSkyBoxVS,'fragmentShaderSource':_0x1ab2e3,'attributeLocations':this[_0x3a8f32(_0x3b6172._0x4c1532)]}),this['_useHdr']=_0x56b50d;}if(!Cesium__namespace['defined'](this[_0x3a8f32(0x799)]))return undefined;if(!Cesium__namespace['defined'](this[_0x3a8f32(_0x3b6172._0xbda188)]))return undefined;if(!Cesium__namespace['defined'](this[_0x3a8f32(_0x3b6172._0x126a06)]))return undefined;return _0x55c9f0;}['isDestroyed'](){return![];}[_0x35a251(0xa63)](){const _0x1bc0ac={_0x4e3226:0x9ce,_0x5a9daf:0x57f,_0x6852ee:0x85},_0x19d3f0=_0x35a251,_0x550314=this[_0x19d3f0(_0x1bc0ac._0x4e3226)];return _0x550314['vertexArray']=_0x550314['vertexArray']&&_0x550314['vertexArray']['destroy'](),_0x550314['shaderProgram']=_0x550314[_0x19d3f0(0x57f)]&&_0x550314[_0x19d3f0(_0x1bc0ac._0x5a9daf)]['destroy'](),this['_cubeMap']=this['_cubeMap']&&this['_cubeMap']['destroy'](),this[_0x19d3f0(_0x1bc0ac._0x6852ee)]=this['_cubeMap2']&&this['_cubeMap2'][_0x19d3f0(0xa63)](),this['_cubeMap3']=this['_cubeMap3']&&this[_0x19d3f0(0x609)]['destroy'](),this['destroyObject'](this);}}class LocalWorldTransform{constructor(_0x3ed3a4,_0x4afd93){const _0x2474eb=_0x35a251;_0x4afd93=_0x4afd93||Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'],this[_0x2474eb(0x7f3)]=_0x4afd93(_0x3ed3a4),this['_inverseMatrix']=Cesium__namespace['Matrix4'][_0x2474eb(0x8b6)](this['_matrix'],new Cesium__namespace['Matrix4']());}['localToWorld'](_0xf41edd,_0x5f9c59){const _0x198f32={_0x136026:0x8eb,_0x4f8ab0:0x7f3},_0xd98a25=_0x35a251;return!_0x5f9c59&&(_0x5f9c59=new Cesium__namespace[(_0xd98a25(_0x198f32._0x136026))]()),Cesium__namespace[_0xd98a25(0x6a7)][_0xd98a25(0x7e2)](this[_0xd98a25(_0x198f32._0x4f8ab0)],_0xf41edd,_0x5f9c59),_0x5f9c59;}[_0x35a251(0x8d1)](_0x39d400,_0x240580){const _0x1dd988={_0x19c127:0x2eb},_0x3b4233=_0x35a251;return!_0x240580&&(_0x240580=new Cesium__namespace['Cartesian3']()),Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x3b4233(_0x1dd988._0x19c127)],_0x39d400,_0x240580),_0x240580;}}class MarsArray{constructor(){const _0x5382ca={_0x71d069:0xef9},_0x320312=_0x35a251;this[_0x320312(_0x5382ca._0x71d069)]=[],this[_0x320312(0xeb9)]={};}get['length'](){const _0x18da73=_0x35a251;return this['_array'][_0x18da73(0xe1e)];}get['values'](){return this['_array'];}['contains'](_0x4fb5f7){if(!_0x4fb5f7)return![];return Cesium__namespace['defined'](this['_hash'][_0x4fb5f7]);}['set'](_0x342ec0,_0x3fc3e5){const _0x23a867={_0x107ee0:0xeb9},_0x47b93e=_0x35a251,_0x5aab31=this[_0x47b93e(_0x23a867._0x107ee0)][_0x342ec0];_0x3fc3e5!==_0x5aab31&&(this[_0x47b93e(0x1ee)](_0x342ec0),this['_hash'][_0x342ec0]=_0x3fc3e5,this['_array']['push'](_0x3fc3e5));}['getLast'](){const _0x4e927c={_0x4344e6:0xef9,_0x682fac:0xef9},_0x4a4b99=_0x35a251;return this[_0x4a4b99(_0x4e927c._0x4344e6)]['length']>0x0?this['_array'][this[_0x4a4b99(_0x4e927c._0x682fac)]['length']-0x1]:undefined;}['get'](_0x12d70c){return _0x12d70c?this['_hash'][_0x12d70c]:undefined;}[_0x35a251(0x9fb)](_0x27cd19,_0x4e32ac='id',_0x4b4195='options'){if(_0x4e32ac==='id'&&this['_hash'][_0x27cd19])return this['_hash'][_0x27cd19];for(let _0x1efe50=0x0,_0x5bc9dd=this['_array']['length'];_0x1efe50<_0x5bc9dd;_0x1efe50++){const _0x14d3ef=this['_array'][_0x1efe50];if(_0x14d3ef[_0x4e32ac]==_0x27cd19||_0x14d3ef[_0x4b4195]&&_0x14d3ef[_0x4b4195][_0x4e32ac]==_0x27cd19)return _0x14d3ef;}return undefined;}['getListByAttr'](_0x94e7f6,_0x12fa8f='id',_0x5ce883='options'){const _0x149b77=[];for(let _0x522f9b=0x0,_0x74370d=this['_array']['length'];_0x522f9b<_0x74370d;_0x522f9b++){const _0x1f9333=this['_array'][_0x522f9b];(_0x1f9333[_0x12fa8f]==_0x94e7f6||_0x1f9333[_0x5ce883]&&_0x1f9333[_0x5ce883][_0x12fa8f]==_0x94e7f6)&&_0x149b77['push'](_0x1f9333);}return _0x149b77;}['remove'](_0x1cb12a){const _0x4c1fab={_0x44989a:0xce0,_0x46ef44:0xd74},_0x11c976=_0x35a251;if(!this['_hash'])return;const _0x3fcf2f=this['_hash'][_0x1cb12a],_0x3998c7=Cesium__namespace[_0x11c976(0xaa2)](_0x3fcf2f);if(_0x3998c7){const _0x17c930=this['_array'];_0x17c930[_0x11c976(_0x4c1fab._0x44989a)](_0x17c930[_0x11c976(_0x4c1fab._0x46ef44)](_0x3fcf2f),0x1),delete this[_0x11c976(0xeb9)][_0x1cb12a];}return _0x3998c7;}[_0x35a251(0xdbd)](_0x5cc934,_0x41ca66,_0x522c60){const _0x4a9ad4=_0x35a251;if(_0x522c60)for(let _0x5d9189=this['_array'][_0x4a9ad4(0xe1e)]-0x1;_0x5d9189>=0x0;_0x5d9189--){const _0x6b8e35=this[_0x4a9ad4(0xef9)][_0x5d9189];_0x5cc934['call'](_0x41ca66||this,_0x6b8e35,_0x5d9189);}else for(let _0x2261d4=0x0,_0x247e47=this['_array']['length'];_0x2261d4<_0x247e47;_0x2261d4++){const _0x921be4=this['_array'][_0x2261d4];_0x5cc934['call'](_0x41ca66||this,_0x921be4,_0x2261d4);}}[_0x35a251(0xb05)](){const _0x1d1b7c=this['_array'];_0x1d1b7c['length']>0x0&&(this['_hash']={},_0x1d1b7c['length']=0x0);}['destroy'](){const _0x4b07d6={_0x1ec15f:0xe1e,_0xc46e6d:0xa63},_0x59daae=_0x35a251;if(this['_array'][_0x59daae(_0x4b07d6._0x1ec15f)]>0x0&&this['_array'][0x0]['destroy']){this['remove']=function(){};for(let _0x3d0909=this['_array']['length']-0x1;_0x3d0909>=0x0;_0x3d0909--){const _0x3d9e68=this['_array'][_0x3d0909];if(_0x3d9e68!==null&&_0x3d9e68!==void 0x0&&_0x3d9e68[_0x59daae(_0x4b07d6._0xc46e6d)])try{_0x3d9e68[_0x59daae(0xa63)]();}catch(_0x47b9c3){logWarn('MarsArray\x20item.destroy\x20异常',_0x47b9c3);}}}this[_0x59daae(0xb05)]();for(const _0x5d3b93 in this){delete this[_0x5d3b93];}}}class Texture3{constructor(_0x3669a1={}){const _0x4503cc={_0x260ed9:0x682,_0x5b05aa:0x883,_0x58b1a6:0x50c,_0x4d1ed6:0xaa2,_0x3986d1:0x4d7,_0x2a19f4:0xb7,_0x4d253b:0xbcf,_0x2554fd:0xae0,_0x483af3:0x4ee,_0x3ad05f:0x94a,_0xb6dfc4:0xac6,_0xb48d76:0xe19,_0x109665:0x383},_0x484bf2=_0x35a251,_0x5cd37e=_0x3669a1['context'],_0x58959e=_0x5cd37e['_gl'],_0x136fb7=_0x3669a1[_0x484bf2(0x498)];let _0x5a3e1f=_0x3669a1['width'],_0x42be59=_0x3669a1['height'],_0x2ed430=_0x3669a1['depth'];Cesium__namespace['defined'](_0x136fb7)&&(!Cesium__namespace['defined'](_0x5a3e1f)&&(_0x5a3e1f=Cesium__namespace['defaultValue'](_0x136fb7['videoWidth'],_0x136fb7['width'])),!Cesium__namespace[_0x484bf2(0xaa2)](_0x42be59)&&(_0x42be59=Cesium__namespace['defaultValue'](_0x136fb7[_0x484bf2(0x724)],_0x136fb7[_0x484bf2(_0x4503cc._0x260ed9)])),!Cesium__namespace['defined'](_0x2ed430)&&(_0x2ed430=Cesium__namespace[_0x484bf2(_0x4503cc._0x5b05aa)](_0x136fb7['videoDepth'],_0x136fb7[_0x484bf2(_0x4503cc._0x58b1a6)])));if(!Cesium__namespace['defined'](_0x5a3e1f)||!Cesium__namespace['defined'](_0x42be59)||!Cesium__namespace[_0x484bf2(_0x4503cc._0x4d1ed6)](_0x2ed430))throw new Cesium__namespace['DeveloperError']('options\x20requires\x20a\x20source\x20field\x20to\x20create\x20an\x20initialized\x20texture\x20or\x20width\x20or\x20height\x20and\x20depth\x20fields\x20to\x20create\x20a\x20blank\x20texture.');const _0x2235d8=Cesium__namespace[_0x484bf2(0x883)](_0x3669a1[_0x484bf2(0x216)],Cesium__namespace['PixelFormat']['RGBA']),_0x8e0a60=Cesium__namespace[_0x484bf2(_0x4503cc._0x5b05aa)](_0x3669a1['pixelDatatype'],Cesium__namespace[_0x484bf2(0xc3d)]['FLOAT']),_0x437e31=Cesium__namespace[_0x484bf2(0x8b1)]['toInternalFormat'](_0x2235d8,_0x8e0a60,_0x5cd37e),_0x583774=![],_0x164767=![];let _0x365621=0x4;Cesium__namespace[_0x484bf2(_0x4503cc._0x4d1ed6)](_0x136fb7)&&Cesium__namespace['defined'](_0x136fb7['arrayBufferView'])&&(_0x365621=Cesium__namespace['PixelFormat'][_0x484bf2(_0x4503cc._0x3986d1)](_0x2235d8,_0x8e0a60,_0x5a3e1f));const _0x30c1e7=_0x58959e['TEXTURE_3D'],_0x1943ad=_0x58959e['createTexture']();_0x58959e['activeTexture'](_0x58959e['TEXTURE0']),_0x58959e[_0x484bf2(_0x4503cc._0x2a19f4)](_0x30c1e7,_0x1943ad),_0x58959e['pixelStorei'](_0x58959e['UNPACK_ALIGNMENT'],_0x365621),_0x58959e['pixelStorei'](_0x58959e[_0x484bf2(_0x4503cc._0x4d253b)],_0x58959e[_0x484bf2(0x80b)]),_0x58959e[_0x484bf2(0xf35)](_0x58959e['UNPACK_FLIP_Y_WEBGL'],_0x164767);if(Cesium__namespace[_0x484bf2(0xaa2)](_0x136fb7)&&Cesium__namespace[_0x484bf2(_0x4503cc._0x4d1ed6)](_0x136fb7['arrayBufferView'])){const _0xa7082b=_0x136fb7['arrayBufferView'];_0x58959e[_0x484bf2(_0x4503cc._0x2554fd)](_0x30c1e7,0x0,_0x437e31,_0x5a3e1f,_0x42be59,_0x2ed430,0x0,_0x2235d8,Cesium__namespace['PixelDatatype']['toWebGLConstant'](_0x8e0a60,_0x5cd37e),_0xa7082b);}_0x58959e['bindTexture'](_0x30c1e7,null);const _0x2c08a9=texture3DSizeInBytes(_0x2235d8,_0x8e0a60,_0x5a3e1f,_0x42be59,_0x2ed430);this[_0x484bf2(_0x4503cc._0x483af3)]=Cesium__namespace[_0x484bf2(_0x4503cc._0x3ad05f)](),this[_0x484bf2(0x5b7)]=_0x5cd37e,this['_textureFilterAnisotropic']=_0x5cd37e[_0x484bf2(_0x4503cc._0xb6dfc4)],this[_0x484bf2(0xccf)]=_0x1943ad,this['_textureTarget']=_0x30c1e7,this['_internalFormat']=_0x437e31,this[_0x484bf2(0xcff)]=_0x2235d8,this['_pixelDatatype']=_0x8e0a60,this['_width']=_0x5a3e1f,this['_height']=_0x42be59,this[_0x484bf2(_0x4503cc._0xb48d76)]=_0x2ed430,this['_hasMipmap']=![],this[_0x484bf2(_0x4503cc._0x109665)]=_0x2c08a9,this['_preMultiplyAlpha']=_0x583774,this['_flipY']=_0x164767,this[_0x484bf2(0x740)]=!![],this[_0x484bf2(0xb85)]=new Cesium__namespace[(_0x484bf2(0x8eb))](_0x5a3e1f,_0x42be59,_0x2ed430),this['_sampler']=undefined,this[_0x484bf2(0xe9e)]=Cesium__namespace['defaultValue'](_0x3669a1['sampler'],new Cesium__namespace[(_0x484bf2(0x67f))]());}get['id'](){return this['_id'];}get['sampler'](){return this['_sampler'];}set['sampler'](_0x718f37){const _0x282b47={_0x5abd61:0x5b7,_0x10aabe:0xccf,_0x5b4035:0x8dc,_0x415d0e:0xb7,_0x21b452:0x8a5},_0x45e8b6=_0x35a251,_0x1b07c8=_0x718f37['minificationFilter'],_0x32c576=_0x718f37['magnificationFilter'],_0x1a9a2f=this[_0x45e8b6(_0x282b47._0x5abd61)],_0x2c8783=_0x1a9a2f['_gl'],_0x3b8366=this['_textureTarget'];_0x2c8783['activeTexture'](_0x2c8783['TEXTURE0']),_0x2c8783['bindTexture'](_0x3b8366,this[_0x45e8b6(_0x282b47._0x10aabe)]),_0x2c8783['texParameteri'](_0x3b8366,_0x2c8783['TEXTURE_MIN_FILTER'],_0x1b07c8),_0x2c8783['texParameteri'](_0x3b8366,_0x2c8783['TEXTURE_MAG_FILTER'],_0x32c576),_0x2c8783['texParameteri'](_0x3b8366,_0x2c8783['TEXTURE_WRAP_S'],_0x718f37['wrapS']),_0x2c8783['texParameteri'](_0x3b8366,_0x2c8783[_0x45e8b6(_0x282b47._0x5b4035)],_0x718f37['wrapT']),_0x2c8783['texParameteri'](_0x3b8366,_0x2c8783['TEXTURE_WRAP_R'],_0x2c8783['CLAMP_TO_EDGE']),_0x2c8783[_0x45e8b6(_0x282b47._0x415d0e)](_0x3b8366,null),this[_0x45e8b6(_0x282b47._0x21b452)]=_0x718f37;}get['pixelFormat'](){const _0x33c792={_0x146894:0xcff},_0x5249ca=_0x35a251;return this[_0x5249ca(_0x33c792._0x146894)];}get['pixelDatatype'](){return this['_pixelDatatype'];}get[_0x35a251(0x6ea)](){return this['_dimensions'];}get['height'](){return this['_height'];}get['depth'](){return this['_depth'];}get['preMultiplyAlpha'](){return this['_preMultiplyAlpha'];}get['flipY'](){const _0x2563d6=_0x35a251;return this[_0x2563d6(0x999)];}get[_0x35a251(0x88e)](){const _0x388759=_0x35a251;return this[_0x388759(0x383)];}get['_target'](){const _0x47744e=_0x35a251;return this[_0x47744e(0x869)];}['isDestroyed'](){return![];}['destroy'](){const _0x516e46={_0x1f72f5:0x5b7},_0x50b821=_0x35a251;return this[_0x50b821(_0x516e46._0x1f72f5)]['_gl']['deleteTexture'](this['_texture']),Cesium__namespace['destroyObject'](this);}}function texture3DSizeInBytes(_0x482770,_0xa6fc,_0x5c18bd,_0x419779,_0x4b4c33){const _0x5e28e1=_0x35a251,_0x34c79b=Cesium__namespace['PixelFormat'][_0x5e28e1(0x730)](_0x482770),_0x13554a=Cesium__namespace['PixelDatatype']['sizeInBytes'](_0xa6fc);return _0x5c18bd*_0x419779*_0x4b4c33*_0x34c79b*_0x13554a;}const ChinaCRS={'WGS84':'WGS84','GCJ02':'GCJ02','BAIDU':_0x35a251(0x304)};let ion='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZDJjMTcwNS04ZDVmLTQzNWQtYWUyZC0yMTJkMDkyMzkyMjMiLCJpZCI6MTQ4MiwiaWF0IjoxNjQ4NDQ2OTIwfQ.7e1QUkx_k-mZBxKz9tV8a5TFEorrlLlkfcVNNPzfTQY';function updateIon(_0xf83ca1){const _0x1363ce={_0x41f28a:0x5de,_0x4cb097:0xc75},_0x5f5c38=_0x35a251;ion=_0xf83ca1,Cesium__namespace[_0x5f5c38(_0x1363ce._0x41f28a)][_0x5f5c38(_0x1363ce._0x4cb097)]=_0xf83ca1;}let mapbox=_0x35a251(0xe67);function updateMapbox(_0x5c35e6){mapbox=_0x5c35e6;}let bing='Am5SdKm6pNdkP1P5zuUOMZwleCHeA7GD5vuQgZ3xBUbEMBeQ5cQ1WN4B8xqqV1Vt';function updateBing(_0x21fa53){bing=_0x21fa53;}const tiandituArr=['789e558be762ff832392a0393fd8a4f1','bcc62222fc634ec736589c483de933e6','d083e4cf30bfc438ef93436c10c2c20a','5e5949f7e96e8a136ef36a6594f18cdf'];let tianditu=getArrayRandomOne(tiandituArr);function updateTianditu(_0x24bdae){const _0x37e5aa={_0x4ffc76:0xe1e,_0x58d646:0x6de},_0x33b2f2=_0x35a251;tiandituArr['splice'](0x0,tiandituArr[_0x33b2f2(_0x37e5aa._0x4ffc76)]),Array['isArray'](_0x24bdae)?_0x24bdae['forEach'](_0x125f28=>{tiandituArr['push'](_0x125f28);}):tiandituArr[_0x33b2f2(_0x37e5aa._0x58d646)](_0x24bdae),tianditu=getArrayRandomOne(tiandituArr);}const gaodeArr=['0ee24126ea61ec60a670675fd8cd29b1',_0x35a251(0x276),_0x35a251(0x2f9),'25962df421fcad3cc2a8ceb55aafd04f','6e5d9f46b78cfb5b5ab3d407dad8fd14',_0x35a251(0x43b),_0x35a251(0x8e3),'ee24b622294b5bc659fb92fe81084776'];let gaode=getArrayRandomOne(gaodeArr);function updateGaode(_0x5c7b16){const _0x4d0bf5=_0x35a251;gaodeArr['splice'](0x0,gaodeArr[_0x4d0bf5(0xe1e)]),Array['isArray'](_0x5c7b16)?_0x5c7b16['forEach'](_0x512546=>{gaodeArr['push'](_0x512546);}):gaodeArr['push'](_0x5c7b16),gaode=getArrayRandomOne(gaodeArr);}const baiduArr=['LvhIlDXT60I3NePicXWQT5K0eHFCR4hD','nLUUSRsSBRSVmtxfaGKPaN3mXf6jiivf','qWM3MBm5oWLI06sa3A3otnpaxGQr8jIw','R7KAL3f6AttldwwicmVXnYkN7EHCY729'];let baidu=getArrayRandomOne(baiduArr);function updateBaidu(_0x36a103){const _0x31ab7d={_0x26b9ab:0x6de},_0x1404c6=_0x35a251;baiduArr[_0x1404c6(0xce0)](0x0,baiduArr['length']),Array['isArray'](_0x36a103)?_0x36a103[_0x1404c6(0xdbd)](_0x3c7acb=>{const _0x459924=_0x1404c6;baiduArr[_0x459924(_0x31ab7d._0x26b9ab)](_0x3c7acb);}):baiduArr[_0x1404c6(0x6de)](_0x36a103),baidu=getArrayRandomOne(baiduArr);}function updateAll(_0x1f0d38){const _0x456155={_0xe245a7:0xaff,_0x3ca32b:0x6cd},_0x143f88=_0x35a251;_0x1f0d38['tianditu']&&updateTianditu(_0x1f0d38['tianditu']),_0x1f0d38['gaode']&&updateGaode(_0x1f0d38['gaode']),_0x1f0d38['baidu']&&updateBaidu(_0x1f0d38['baidu']),_0x1f0d38[_0x143f88(_0x456155._0xe245a7)]&&updateIon(_0x1f0d38[_0x143f88(_0x456155._0xe245a7)]),_0x1f0d38['mapbox']&&updateMapbox(_0x1f0d38['mapbox']),_0x1f0d38[_0x143f88(_0x456155._0x3ca32b)]&&updateBing(_0x1f0d38[_0x143f88(0x6cd)]);}var Token={'__proto__':null,get 'ion'(){return ion;},'updateIon':updateIon,get 'mapbox'(){return mapbox;},'updateMapbox':updateMapbox,get 'bing'(){return bing;},'updateBing':updateBing,'tiandituArr':tiandituArr,get 'tianditu'(){return tianditu;},'updateTianditu':updateTianditu,'gaodeArr':gaodeArr,get 'gaode'(){return gaode;},'updateGaode':updateGaode,'baiduArr':baiduArr,get 'baidu'(){return baidu;},'updateBaidu':updateBaidu,'updateAll':updateAll};const Color$2=Cesium__namespace[_0x35a251(0x100)]['ColorType'],PolylineDash=Cesium__namespace['Material']['PolylineDashType'],LineDotDash='LineDotDash',PolylineOutline=Cesium__namespace[_0x35a251(0x100)]['PolylineOutlineType'],PolylineArrow=Cesium__namespace['Material']['PolylineArrowType'],PolylineGlow=Cesium__namespace['Material']['PolylineGlowType'],LineFlow='LineFlow',LineFlowColor=_0x35a251(0xc8e),ODLine='ODLine',LineFlicker='LineFlicker',LineTrail='LineTrail',LineBloom='LineBloom',DigitalFlow='DigitalFlow',LineThreeDash='LineThreeDash',WallScroll=_0x35a251(0x708),Image$1=Cesium__namespace[_0x35a251(0x100)]['ImageType'],Image2='Image2',Text='Text',Grid=Cesium__namespace['Material'][_0x35a251(0x53f)],Checkerboard=Cesium__namespace['Material'][_0x35a251(0x461)],Stripe=Cesium__namespace['Material']['StripeType'],PolyGradient='PolyGradient',PolyAsphalt='PolyAsphalt',PolyBlob='PolyBlob',PolyFacet='PolyFacet',PolyGrass='PolyGrass',PolyWood=_0x35a251(0x235),NeonLight='NeonLight',Water$1=Cesium__namespace['Material'][_0x35a251(0x6bf)],WaterLight='WaterLight',RectSlide='RectSlide',ScanLine='ScanLine',CircleScan=_0x35a251(0xc14),CircleWave=_0x35a251(0x9e0),RadarLine='RadarLine',RadarWave=_0x35a251(0x2e9),CylinderWave='CylinderWave',EllipsoidElectric='EllipsoidElectric',EllipsoidWave='EllipsoidWave';var MaterialType$1={'__proto__':null,'Color':Color$2,'PolylineDash':PolylineDash,'LineDotDash':LineDotDash,'PolylineOutline':PolylineOutline,'PolylineArrow':PolylineArrow,'PolylineGlow':PolylineGlow,'LineFlow':LineFlow,'LineFlowColor':LineFlowColor,'ODLine':ODLine,'LineFlicker':LineFlicker,'LineTrail':LineTrail,'LineBloom':LineBloom,'DigitalFlow':DigitalFlow,'LineThreeDash':LineThreeDash,'WallScroll':WallScroll,'Image':Image$1,'Image2':Image2,'Text':Text,'Grid':Grid,'Checkerboard':Checkerboard,'Stripe':Stripe,'PolyGradient':PolyGradient,'PolyAsphalt':PolyAsphalt,'PolyBlob':PolyBlob,'PolyFacet':PolyFacet,'PolyGrass':PolyGrass,'PolyWood':PolyWood,'NeonLight':NeonLight,'Water':Water$1,'WaterLight':WaterLight,'RectSlide':RectSlide,'ScanLine':ScanLine,'CircleScan':CircleScan,'CircleWave':CircleWave,'RadarLine':RadarLine,'RadarWave':RadarWave,'CylinderWave':CylinderWave,'EllipsoidElectric':EllipsoidElectric,'EllipsoidWave':EllipsoidWave};const LayerType={},ControlType={},EffectType={},LangType={'ZH':0x0,'ZHHK':0x1,'EN':0x2},MoveType={'ENLARGE':0x0,'NARROW':0x1,'LEFT_ROTATE':0x2,'RIGHT_ROTATE':0x3,'TOP_ROTATE':0x4,'BOTTOM_ROTATE':0x5},ClipType={'Z':0x1,'ZR':0x2,'X':0x3,'XR':0x4,'Y':0x5,'YR':0x6},Icon={'Delete':'fa\x20fa-trash-o','Coordinates':_0x35a251(0xcc0),'CameraInfo':'fa\x20fa-camera-retro','Camera':'fa\x20fa-street-view','UndergroundNo':'fa\x20fa-ban','UndergroundYes':'fa\x20fa-sort-amount-desc','RotatePointStart':'fa\x20fa-retweet','RotatePointStop':'fa\x20fa-remove','FlyToPoint':'fa\x20fa-send-o','FirstPerspective':'fa\x20fa-male','KeyboardRoamYes':'fa\x20fa-keyboard-o','KeyboardRoamNo':'fa\x20fa-keyboard-o','TrackedEntityYes':'fa\x20fa-lock','TrackedEntityNo':'fa\x20fa-unlock-alt','Tileset':'fa\x20fa-building-o','TilesetWireframeYes':'fa\x20fa-connectdevelop','TilesetWireframeNo':'fa\x20fa-connectdevelop','TilesetBoundingVolumeYes':'fa\x20fa-codepen','TilesetBoundingVolumeNo':'fa\x20fa-codepen','Terrain':'fa\x20fa-globe','TerrainYes':'fa\x20fa-medium','TerrainNo':'fa\x20fa-medium','TerrainWireframeYes':'fa\x20fa-connectdevelop','TerrainWireframeNo':_0x35a251(0xf8d),'Measure':_0x35a251(0xbd5),'MeasureDistance':'fa\x20fa-minus','MeasureArea':'fa\x20fa-medium','MeasureHeight':'fa\x20fa-sort-amount-asc','MeasureAngle':'fa\x20fa-road','Draw':'fa\x20fa-eyedropper','DrawPoint':_0x35a251(0x335),'DrawPolyline':'fa\x20fa-reorder','DrawPolygon':'fa\x20fa-medium','DrawCircle':_0x35a251(0xd59),'DrawRectangle':'fa\x20fa-retweet','DrawEditYes':_0x35a251(0xdc5),'DrawEditNo':'fa\x20fa-pencil-square','DrawDownJson':'fa\x20fa-file-text-o','Effect':'fa\x20fa-rss','RainEffectYes':'fa\x20fa-tint','RainEffectNo':'fa\x20fa-tint','SnowEffectYes':'fa\x20fa-yelp','SnowEffectNo':_0x35a251(0xbd2),'FogEffectYes':'fa\x20fa-spinner','FogEffectNo':_0x35a251(0x6a0),'BloomEffectYes':_0x35a251(0xaa7),'BloomEffectNo':_0x35a251(0xaa7),'BrightnessEffectYes':'fa\x20fa-trello','BrightnessEffectNo':_0x35a251(0x863),'NightVisionEffectYes':'fa\x20fa-dashboard','NightVisionEffectNo':'fa\x20fa-dashboard','BlackAndWhiteEffectYes':'fa\x20fa-star-half-full','BlackAndWhiteEffectNo':'fa\x20fa-star-half-full','OutlineEffectYes':'fa\x20fa-ticket','OutlineEffectNo':'fa\x20fa-ticket','Scene':_0x35a251(0x40b),'DepthTestYes':'fa\x20fa-eye-slash','DepthTestNo':'fa\x20fa-eye','SkyBoxYes':'fa\x20fa-moon-o','SkyBoxNo':_0x35a251(0x8ff),'ShadowYes':'fa\x20fa-sun-o','ShadowNo':'fa\x20fa-sun-o','SkyAtmosphereYes':'fa\x20fa-soundcloud','SkyAtmosphereNo':'fa\x20fa-soundcloud','ExpImage':_0x35a251(0x1b5)};function create$3(_0x221cb1,_0x4750d5,_0x26c4c6){const _0x28616c=document['createElement'](_0x221cb1);return _0x28616c['className']=_0x4750d5||'',_0x26c4c6&&_0x26c4c6['appendChild'](_0x28616c),_0x28616c;}function createSvg(_0x33684a,_0x352fec,_0x4d35c9,_0x3fb037){const _0x50de33={_0x405a78:0x4b8,_0xb20b42:0x682,_0x3b9225:0xa06,_0x24b8cb:0x87c},_0x47e7db=_0x35a251,_0x1bc40a=document['createElementNS'](_0x47e7db(_0x50de33._0x405a78),'svg:svg');_0x1bc40a[_0x47e7db(0x538)]('class',_0x47e7db(0x542)),_0x1bc40a[_0x47e7db(0x538)]('width',_0x33684a),_0x1bc40a['setAttribute'](_0x47e7db(_0x50de33._0xb20b42),_0x352fec),_0x1bc40a['setAttribute']('viewBox','0\x200\x20'+_0x33684a+'\x20'+_0x352fec);const _0x17c5b9=document['createElementNS']('http://www.w3.org/2000/svg',_0x47e7db(_0x50de33._0x3b9225));return _0x17c5b9['setAttribute']('d',_0x4d35c9),_0x1bc40a['appendChild'](_0x17c5b9),_0x3fb037&&_0x3fb037[_0x47e7db(_0x50de33._0x24b8cb)](_0x1bc40a),_0x1bc40a;}function createVideo(_0xcf3878,_0x53e101,_0x2e8cff,_0x240734){const _0x414aae={_0x458afd:0x564,_0x4d3cdc:0x4cc,_0x3d4251:0x538,_0x11c275:0x8ea},_0x31b96b=_0x35a251,_0x130d9c=create$3('video',_0x2e8cff,_0x240734);_0x130d9c[_0x31b96b(0x538)](_0x31b96b(0xb04),!![]),_0x130d9c['setAttribute']('loop',!![]),_0x130d9c['setAttribute'](_0x31b96b(_0x414aae._0x458afd),!![]);!_0x53e101&&(_0x53e101=_0xcf3878[_0x31b96b(_0x414aae._0x4d3cdc)](_0xcf3878['lastIndexOf']('.')+0x1,_0xcf3878['length']));const _0x617604=create$3('source','',_0x130d9c);return _0x617604[_0x31b96b(_0x414aae._0x3d4251)](_0x31b96b(0x52e),_0xcf3878),_0x617604['setAttribute'](_0x31b96b(_0x414aae._0x11c275),_0x31b96b(0x3c2)+_0x53e101),_0x130d9c;}function get(_0x4961fa){return typeof _0x4961fa==='string'?document['getElementById'](_0x4961fa):_0x4961fa;}function parseDom(_0x327ea4,_0x1871e0,_0x375555){const _0x1c46cc=_0x35a251,_0x59245a=document['createElement']('div');return _0x375555&&(_0x59245a['className']=_0x375555),_0x59245a['innerHTML']=_0x327ea4,_0x1871e0?_0x59245a:_0x59245a[_0x1c46cc(0xde4)];}function remove(_0x3d0d51){_0x3d0d51=get(_0x3d0d51);if(!_0x3d0d51)return;const _0x2f50b5=_0x3d0d51['parentNode'];_0x2f50b5&&_0x2f50b5['removeChild'](_0x3d0d51);}function empty(_0x558051){while(_0x558051['firstChild']){_0x558051['removeChild'](_0x558051['firstChild']);}}function getStyle(_0x224730,_0x5c93f8){let _0x45709d=_0x224730['style'][_0x5c93f8]||_0x224730['currentStyle']&&_0x224730['currentStyle'][_0x5c93f8];if((!_0x45709d||_0x45709d==='auto')&&document['defaultView']){const _0x5d3b90=document['defaultView']['getComputedStyle'](_0x224730,null);_0x45709d=_0x5d3b90?_0x5d3b90[_0x5c93f8]:null;}return _0x45709d==='auto'?null:_0x45709d;}function hasClass(_0x41600d,_0x3380a1){const _0x5a35b7={_0x5f4f5d:0xcdc},_0x31fd33=_0x35a251;if(!_0x41600d)return![];if(_0x41600d[_0x31fd33(0x12b)]!==undefined)return _0x41600d['classList']['contains'](_0x3380a1);const _0x599561=getClass$3(_0x41600d);return _0x599561['length']>0x0&&new RegExp('(^|\x5cs)'+_0x3380a1+_0x31fd33(_0x5a35b7._0x5f4f5d))['test'](_0x599561);}function addClass(_0x5597f6,_0x47d272){const _0xcd0106=_0x35a251;if(!_0x5597f6)return;if(_0x5597f6['classList']!==undefined){const _0x69c0fd=splitWords(_0x47d272);for(let _0x1ace40=0x0,_0x23738a=_0x69c0fd['length'];_0x1ace40<_0x23738a;_0x1ace40++){_0x5597f6[_0xcd0106(0x12b)]['add'](_0x69c0fd[_0x1ace40]);}}else{if(!hasClass(_0x5597f6,_0x47d272)){const _0x241d9b=getClass$3(_0x5597f6);setClass(_0x5597f6,(_0x241d9b?_0x241d9b+'\x20':'')+_0x47d272);}}}function removeClass(_0x550c95,_0x40c462){if(!_0x550c95)return;_0x550c95['classList']!==undefined?_0x550c95['classList']['remove'](_0x40c462):setClass(_0x550c95,trim(('\x20'+getClass$3(_0x550c95)+'\x20')['replace']('\x20'+_0x40c462+'\x20','\x20')));}function setClass(_0x389a2e,_0x249d06){!_0x389a2e['className']||!_0x389a2e['className']['baseVal']?_0x389a2e['className']=_0x249d06:_0x389a2e['className']['baseVal']=_0x249d06;}function getClass$3(_0x529251){const _0x3515e2={_0x5c6b78:0x15a,_0x25d0cd:0x15a},_0x1f059c=_0x35a251;var _0x3956d2;return _0x529251['correspondingElement']&&(_0x529251=_0x529251['correspondingElement']),(_0x3956d2=_0x529251[_0x1f059c(_0x3515e2._0x5c6b78)])!==null&&_0x3956d2!==void 0x0&&_0x3956d2['baseVal']?_0x529251['className'][_0x1f059c(0xa37)]:_0x529251[_0x1f059c(_0x3515e2._0x25d0cd)];}function copyCanvas(_0x3611f0){const _0x2cbb02=_0x35a251,_0x994fd1=_0x3611f0['getContext']('2d',{'willReadFrequently':!![]})['getImageData'](0x0,0x0,_0x3611f0['width'],_0x3611f0['height']),_0x56e282=document['createElement']('canvas');_0x56e282['width']=_0x3611f0['width'],_0x56e282['height']=_0x3611f0['height'];const _0x4170b7=_0x56e282['getContext']('2d',{'willReadFrequently':!![]});return _0x4170b7['clearRect'](0x0,0x0,_0x56e282[_0x2cbb02(0xf48)],_0x56e282['height']),_0x4170b7['putImageData'](_0x994fd1,0x0,0x0),_0x56e282;}var DomUtil={'__proto__':null,'create':create$3,'createSvg':createSvg,'createVideo':createVideo,'get':get,'parseDom':parseDom,'remove':remove,'empty':empty,'getStyle':getStyle,'hasClass':hasClass,'addClass':addClass,'removeClass':removeClass,'setClass':setClass,'getClass':getClass$3,'copyCanvas':copyCanvas};function getCenter(_0x447706){const _0x37c774=_0x35a251;try{const _0x2ef0f9=_0x447706['canvas'],_0x455d3e=new Cesium__namespace['Cartesian2'](_0x2ef0f9['clientWidth']/0x2,_0x2ef0f9[_0x37c774(0x4e7)]/0x2),_0x4bf2f1=_0x447706[_0x37c774(0x7d)]['getPickRay'](_0x455d3e);let _0x475b15=_0x447706['globe']['pick'](_0x4bf2f1,_0x447706);return!_0x475b15&&(_0x475b15=_0x447706['camera']['pickEllipsoid'](_0x455d3e)),_0x475b15?LngLatPoint[_0x37c774(0x9b1)](_0x475b15):undefined;}catch(_0x4ef18b){return undefined;}}function getExtent(_0x3e71d8,_0x4b4541={}){const _0x1e0350={_0xf3de35:0x3f4,_0x444e06:0x9c5,_0x43cdef:0xc26,_0x567e36:0x7c0,_0x453b43:0x7d,_0x29a80e:0xaab,_0x346a2f:0x682,_0x18e82e:0xc9d,_0x2dec67:0x248,_0x4bb26e:0x682,_0x52b838:0xc26,_0x304526:0x1cb},_0x378f09=_0x35a251,_0x199413={'xmin':0x46,'xmax':0x8c,'ymin':0x0,'ymax':0x37,'height':0x0},_0x16aca8=_0x3e71d8['scene'],_0x3a4951=_0x16aca8[_0x378f09(0x22f)][_0x378f09(_0x1e0350._0xf3de35)],_0x21f5fc=_0x16aca8['canvas'],_0x481752=_0x3e71d8['camera']['pickEllipsoid'](new Cesium__namespace[(_0x378f09(0x248))](0x0,0x0),_0x3a4951);if(_0x481752){const _0x407ab4=_0x3a4951['cartesianToCartographic'](_0x481752);_0x199413['xmin']=Cesium__namespace['Math'][_0x378f09(_0x1e0350._0x444e06)](_0x407ab4[_0x378f09(_0x1e0350._0x43cdef)]),_0x199413[_0x378f09(0xcea)]=Cesium__namespace[_0x378f09(_0x1e0350._0x567e36)]['toDegrees'](_0x407ab4['latitude']),_0x199413['height']=Math['max'](_0x199413['height'],_0x407ab4['height']);}else{const _0x28a377=_0x21f5fc['width']/0x2,_0x18727f=_0x21f5fc['height']/0x2;let _0x16a1e5;for(let _0x503e71=0x0;_0x503e71<=_0x18727f;_0x503e71+=0xa){const _0x236985=_0x503e71<=_0x28a377?_0x503e71:_0x28a377;_0x16a1e5=_0x3e71d8[_0x378f09(_0x1e0350._0x453b43)][_0x378f09(_0x1e0350._0x29a80e)](new Cesium__namespace['Cartesian2'](_0x236985,_0x503e71),_0x3a4951);if(_0x16a1e5)break;}if(_0x16a1e5){const _0x53bd42=_0x3a4951['cartesianToCartographic'](_0x16a1e5);_0x199413['xmin']=Cesium__namespace[_0x378f09(0x7c0)]['toDegrees'](_0x53bd42['longitude']),_0x199413['ymax']=Cesium__namespace[_0x378f09(0x7c0)]['toDegrees'](_0x53bd42['latitude']),_0x199413[_0x378f09(_0x1e0350._0x346a2f)]=Math[_0x378f09(_0x1e0350._0x18e82e)](_0x199413['height'],_0x53bd42['height']);}}const _0x4d5af3=_0x3e71d8['camera']['pickEllipsoid'](new Cesium__namespace[(_0x378f09(_0x1e0350._0x2dec67))](_0x21f5fc['width'],_0x21f5fc['height']),_0x3a4951);if(_0x4d5af3){const _0x2dd65d=_0x3a4951['cartesianToCartographic'](_0x4d5af3);_0x199413['xmax']=Cesium__namespace[_0x378f09(0x7c0)]['toDegrees'](_0x2dd65d[_0x378f09(0xc26)]),_0x199413['ymin']=Cesium__namespace[_0x378f09(_0x1e0350._0x567e36)]['toDegrees'](_0x2dd65d['latitude']),_0x199413['height']=Math['max'](_0x199413['height'],_0x2dd65d[_0x378f09(_0x1e0350._0x4bb26e)]);}else{const _0x1865c4=_0x21f5fc['width']/0x2,_0x29ff0a=_0x21f5fc[_0x378f09(_0x1e0350._0x346a2f)]/0x2;let _0x1ec844;for(let _0x43e9d2=_0x21f5fc['height'];_0x43e9d2>=_0x29ff0a;_0x43e9d2-=0xa){const _0x1c61ce=_0x43e9d2>=_0x1865c4?_0x43e9d2:_0x1865c4;_0x1ec844=_0x3e71d8['camera']['pickEllipsoid'](new Cesium__namespace['Cartesian2'](_0x1c61ce,_0x43e9d2),_0x3a4951);if(_0x1ec844)break;}if(_0x1ec844){const _0x2b841c=_0x3a4951['cartesianToCartographic'](_0x1ec844);_0x199413['xmax']=Cesium__namespace['Math']['toDegrees'](_0x2b841c[_0x378f09(_0x1e0350._0x52b838)]),_0x199413['ymin']=Cesium__namespace[_0x378f09(0x7c0)]['toDegrees'](_0x2b841c['latitude']),_0x199413['height']=Math['max'](_0x199413['height'],_0x2b841c['height']);}}if(!_0x199413)return;if(_0x199413['xmax']<_0x199413[_0x378f09(0x5e2)]){const _0x2637c8=_0x199413['xmax'];_0x199413['xmax']=_0x199413[_0x378f09(0x5e2)],_0x199413['xmin']=_0x2637c8;}if(_0x199413['ymax']<_0x199413['ymin']){const _0x2c8ecf=_0x199413['ymax'];_0x199413[_0x378f09(0xcea)]=_0x199413[_0x378f09(0x15b)],_0x199413['ymin']=_0x2c8ecf;}if(Cesium__namespace['defined'](_0x4b4541[_0x378f09(_0x1e0350._0x304526)])){const _0x54b6ad=_0x4b4541['scale'],_0x5a1ce6=(_0x199413['xmax']-_0x199413['xmin'])/0x2*_0x54b6ad,_0x40e9ff=(_0x199413['ymax']-_0x199413['ymin'])/0x2*_0x54b6ad;_0x199413['xmin']-=_0x5a1ce6,_0x199413['xmax']+=_0x5a1ce6,_0x199413['ymin']-=_0x40e9ff,_0x199413['ymax']+=_0x40e9ff;}return _0x4b4541[_0x378f09(0x4ec)]&&(_0x199413['xmin']=formatNum$1(_0x199413['xmin'],LngLatPoint['FormatLength']),_0x199413['xmax']=formatNum$1(_0x199413['xmax'],LngLatPoint['FormatLength']),_0x199413['ymin']=formatNum$1(_0x199413['ymin'],LngLatPoint[_0x378f09(0x5b6)]),_0x199413['ymax']=formatNum$1(_0x199413['ymax'],LngLatPoint['FormatLength'])),_0x199413;}function getCameraView(_0x4d9cfe,_0x1aae48){const _0x4c317e={_0x218e4e:0x9c5,_0x53ef66:0x7c0,_0x5a3577:0x5d2,_0x589f44:0x527},_0x1ef378=_0x35a251,_0x3e4ec7=_0x4d9cfe['positionCartographic'],_0xa97cba={};return _0xa97cba[_0x1ef378(0xb9d)]=formatNum$1(Cesium__namespace['Math'][_0x1ef378(_0x4c317e._0x218e4e)](_0x3e4ec7['latitude']),LngLatPoint['FormatLength']),_0xa97cba['lng']=formatNum$1(Cesium__namespace[_0x1ef378(_0x4c317e._0x53ef66)]['toDegrees'](_0x3e4ec7['longitude']),LngLatPoint[_0x1ef378(0x5b6)]),(_0x1aae48===null||_0x1aae48===void 0x0?void 0x0:_0x1aae48['simplify'])??!![]?(_0xa97cba[_0x1ef378(_0x4c317e._0x5a3577)]=formatNum$1(_0x3e4ec7['height'],0x1),_0xa97cba['heading']=formatNum$1(Cesium__namespace['Math'][_0x1ef378(0x9c5)](_0x4d9cfe['heading']||0x0)%0x168,0x1),_0xa97cba['pitch']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4d9cfe[_0x1ef378(0x527)]||0x0)%0x168,0x1)):(_0xa97cba['alt']=formatNum$1(_0x3e4ec7[_0x1ef378(0x682)],LngLatPoint['FormatAltLength']),_0xa97cba['heading']=formatNum$1(Cesium__namespace[_0x1ef378(0x7c0)]['toDegrees'](_0x4d9cfe['heading']||0x0)%0x168,0x2),_0xa97cba['pitch']=formatNum$1(Cesium__namespace[_0x1ef378(0x7c0)]['toDegrees'](_0x4d9cfe[_0x1ef378(_0x4c317e._0x589f44)]||0x0)%0x168,0x2),_0xa97cba['roll']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4d9cfe['roll']||0x0)%0x168,0x2)),_0xa97cba;}function expImage(_0x55e576,_0x3022b4={}){const _0xe3f24={_0x2e0a73:0x4e3,_0x4b07e3:0x8ea,_0x4a4205:0xf6e,_0x172a2a:0xa9b};return new Promise((_0x3fa485,_0x495278)=>{const _0x52a3c9={_0x534d64:0x682,_0x52c1d5:0xaa2,_0x5f4535:0x682,_0x245bf2:0xd0f,_0x1b636c:0xee1,_0x5761fe:0xf48,_0x183725:0x5bf,_0x19ffc7:0xf48},_0x5dda5c=_0x2767;_0x3022b4[_0x5dda5c(_0xe3f24._0x2e0a73)]=_0x3022b4['download']??!![],_0x3022b4['type']=_0x3022b4['type']??'image/jpeg',_0x55e576[_0x5dda5c(0x266)]();const _0x412349=_0x55e576['canvas']['toDataURL'](_0x3022b4[_0x5dda5c(_0xe3f24._0x4b07e3)],_0x3022b4[_0x5dda5c(0x635)]),_0x3ba81b=_0x55e576['canvas']['height'],_0x58c58e=_0x55e576['canvas']['width'];if(Cesium__namespace['defined'](_0x3022b4['width'])||Cesium__namespace['defined'](_0x3022b4['height'])){const _0x39723f=new Image();_0x39723f['onload']=function(){const _0x328d2d=_0x5dda5c;let _0x10ed10,_0x565748;if(Cesium__namespace['defined'](_0x3022b4['width'])&&!Cesium__namespace['defined'](_0x3022b4[_0x328d2d(_0x52a3c9._0x534d64)]))_0x10ed10=_0x3022b4[_0x328d2d(0xf48)],_0x565748=Math['round'](_0x10ed10*_0x3ba81b/_0x58c58e);else{if(Cesium__namespace[_0x328d2d(_0x52a3c9._0x52c1d5)](_0x3022b4['height'])&&!Cesium__namespace[_0x328d2d(0xaa2)](_0x3022b4['width']))_0x565748=_0x3022b4['height'],_0x10ed10=Math['round'](_0x565748*_0x58c58e/_0x3ba81b);else{const _0x29988e=_0x3022b4['width']/_0x58c58e,_0x4bdae1=_0x3022b4[_0x328d2d(_0x52a3c9._0x5f4535)]/_0x3ba81b;_0x29988e>_0x4bdae1?(_0x10ed10=_0x3022b4[_0x328d2d(0xf48)],_0x565748=Math['round'](_0x10ed10*_0x3ba81b/_0x58c58e)):(_0x565748=_0x3022b4['height'],_0x10ed10=Math['round'](_0x565748*_0x58c58e/_0x3ba81b));}}const _0x2798c3=document[_0x328d2d(_0x52a3c9._0x245bf2)](_0x328d2d(_0x52a3c9._0x1b636c));_0x2798c3[_0x328d2d(_0x52a3c9._0x5761fe)]=_0x3022b4['width']||_0x10ed10,_0x2798c3['height']=_0x3022b4['height']||_0x565748;const _0x473ca9=_0x2798c3[_0x328d2d(_0x52a3c9._0x183725)]('2d',{'willReadFrequently':!![]}),_0xc499df=(_0x2798c3['width']-_0x10ed10)/0x2,_0x5b38d8=(_0x2798c3['height']-_0x565748)/0x2;_0x473ca9['drawImage'](_0x39723f,_0xc499df,_0x5b38d8,_0x10ed10,_0x565748);const _0x257a94=_0x2798c3['toDataURL'](_0x3022b4['type'],_0x3022b4[_0x328d2d(0x635)]);!_0x3022b4[_0x328d2d(0xf6e)]&&(_0x3022b4['filename']='场景出图_'+_0x2798c3[_0x328d2d(_0x52a3c9._0x19ffc7)]+'x'+_0x2798c3['height']);if(_0x3022b4['download']){let _0x3cc6e7=_0x3022b4['filename'];_0x3022b4['type']==='image/jpeg'&&(_0x3cc6e7=_0x3cc6e7+'.jpg'),downloadBase64Image(_0x3cc6e7,_0x257a94);}const _0x42b3fe={'image':_0x257a94,'width':_0x2798c3['width'],'height':_0x2798c3[_0x328d2d(0x682)]};_0x3022b4['callback']&&_0x3022b4['callback'](_0x42b3fe),_0x3fa485(_0x42b3fe);},_0x39723f['src']=_0x412349;}else{!_0x3022b4['filename']&&(_0x3022b4[_0x5dda5c(_0xe3f24._0x4a4205)]=_0x5dda5c(0x68a)+_0x58c58e+'x'+_0x3ba81b);_0x3022b4['download']&&downloadBase64Image(_0x3022b4['filename'],_0x412349);const _0x225182={'image':_0x412349,'width':_0x58c58e,'height':_0x3ba81b};_0x3022b4[_0x5dda5c(_0xe3f24._0x172a2a)]&&_0x3022b4['callback'](_0x225182),_0x3fa485(_0x225182);}});}function pick3DTileset(_0x3d7f68,_0x588f28){const _0x479052={_0x18e65a:0xaa2,_0x2636ac:0x6f2},_0x19b378=_0x35a251;if(!_0x588f28)return null;_0x588f28 instanceof Cesium__namespace['Cartesian3']&&(_0x588f28=[_0x588f28]);for(let _0x23cc53=0x0,_0x44555c=_0x588f28['length'];_0x23cc53<_0x44555c;++_0x23cc53){const _0x221440=_0x588f28[_0x23cc53],_0x539c68=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](_0x3d7f68,_0x221440);if(!Cesium__namespace['defined'](_0x539c68))continue;const _0x2be17f=_0x3d7f68['pick'](_0x539c68,0xa,0xa);if(Cesium__namespace['defined'](_0x2be17f)&&Cesium__namespace[_0x19b378(_0x479052._0x18e65a)](_0x2be17f[_0x19b378(0x6f2)])&&_0x2be17f[_0x19b378(0x6f2)]instanceof Cesium__namespace['Cesium3DTileset'])return _0x2be17f[_0x19b378(_0x479052._0x2636ac)];}return null;}class SurfacePoint{constructor(_0x4ee645){const _0x2931bb={_0x17091e:0xc60,_0x5f0179:0xb61,_0xd57c64:0xdb7,_0x4b125f:0xa43,_0x2f15e1:0x7ea,_0x5730d9:0xf44},_0x1b8bd8=_0x35a251;this['options']=_0x4ee645,this[_0x1b8bd8(_0x2931bb._0x17091e)]=_0x4ee645['map']?_0x4ee645['map']['scene']:_0x4ee645['scene'],!this[_0x1b8bd8(0xc60)]&&logError$1('SurfacePoint:\x20请传入scene参数',this['options']),this['_point']=LngLatPoint['parse'](_0x4ee645[_0x1b8bd8(_0x2931bb._0x5f0179)]),this['_point']&&(this[_0x1b8bd8(_0x2931bb._0xd57c64)]=this[_0x1b8bd8(0xf44)][_0x1b8bd8(_0x2931bb._0x4b125f)](),this['_cartographic']=this['_point']['toCartographic'](),this[_0x1b8bd8(_0x2931bb._0x2f15e1)]=this[_0x1b8bd8(_0x2931bb._0x5730d9)]['alt']);}['start'](){const _0x2cf3aa={_0xe37a1:0xc60,_0x5274fb:0xb1d};return new Promise((_0x26f8b6,_0x48ed54)=>{const _0x533466=_0x2767;this['_promise']={'resolve':_0x26f8b6,'reject':_0x48ed54};if(!this['_point']){_0x26f8b6({'height':0x0});return;}const _0x1eeeb6=this['options']['has3dtiles']??Cesium__namespace['defined'](pick3DTileset(this['scene'],this['_position'])),_0x54f741=Boolean(this[_0x533466(_0x2cf3aa._0xe37a1)]['terrainProvider'][_0x533466(_0x2cf3aa._0x5274fb)]);this[_0x533466(0x3c0)]=_0x1eeeb6,this['_hasTerrain']=_0x54f741;if(!_0x54f741&&!_0x1eeeb6){this['end'](0x0);return;}_0x1eeeb6?this['clampTo3DTileset']():this['clampToTerrain']();});}[_0x35a251(0x908)](){const _0x276aa8={_0x4c7e82:0xd61},_0x16877e={_0x3583c5:0x9b1,_0x1b854e:0x682},_0x128811=_0x35a251;this['scene']['clampToHeightMostDetailed']([this['_position'][_0x128811(_0x276aa8._0x4c7e82)]()],this['options']['objectsToExclude'],0.05)['then'](_0xa95800=>{const _0x25c9d0=_0x128811,_0x1d08cd=_0xa95800[0x0];if(Cesium__namespace['defined'](_0x1d08cd)){const _0x36d84a=Cesium__namespace[_0x25c9d0(0x120)][_0x25c9d0(_0x16877e._0x3583c5)](_0x1d08cd),_0xed746c=_0x36d84a[_0x25c9d0(_0x16877e._0x1b854e)];if(Cesium__namespace['defined'](_0xed746c)&&_0xed746c>-0x3e8){this['end'](_0xed746c);return;}}this['clampToTerrain']();});}[_0x35a251(0x302)](){this['_hasTerrain']?Cesium__namespace['sampleTerrainMostDetailed'](this['scene']['terrainProvider'],[this['_cartographic']])['then'](_0x41a8de=>{const _0x228f47=_0x2767,_0x308925=_0x41a8de[0x0];let _0x36a1b2;Cesium__namespace['defined'](_0x308925)&&Cesium__namespace['defined'](_0x308925['height'])?_0x36a1b2=_0x308925['height']:_0x36a1b2=this['scene']['globe']['getHeight'](this['_cartographic'])||0x0,this[_0x228f47(0xa2d)](_0x36a1b2);}):this['end'](0x0);}[_0x35a251(0xa2d)](_0x352a6a){const _0x42f86a={_0x584461:0x7ea,_0x49ebc3:0x2dc},_0x41dcb4=_0x35a251;this['options']['callback']&&this['options'][_0x41dcb4(0xa9b)](_0x352a6a),this['_point'][_0x41dcb4(0x5d2)]=_0x352a6a,this[_0x41dcb4(0xf13)][_0x41dcb4(0xc74)]({'height':_0x352a6a,'height_original':this[_0x41dcb4(_0x42f86a._0x584461)],'point':this['_point'],'position':Cesium__namespace[_0x41dcb4(0x8eb)]['fromRadians'](this[_0x41dcb4(_0x42f86a._0x49ebc3)]['longitude'],this['_cartographic']['latitude'],_0x352a6a),'position_original':this[_0x41dcb4(0xdb7)],'has3dtiles':this['_has3dtiles'],'hasTerrain':this['_hasTerrain']});}}function getTransFun(_0x499d77,_0x5d0b08){if(!_0x499d77||!_0x5d0b08)return![];_0x499d77=crsName2FunName(_0x499d77),_0x5d0b08=crsName2FunName(_0x5d0b08);if(_0x5d0b08===_0x499d77)return![];const _0x202916=_0x499d77+'2'+_0x5d0b08;if(!PointTrans[_0x202916])return![];return PointTrans[_0x202916];}function crsName2FunName(_0x5f4dc7){const _0x55e060=_0x35a251;switch(_0x5f4dc7){case ChinaCRS['GCJ02']:return'gcj';case ChinaCRS[_0x55e060(0x98)]:return'bd';case ChinaCRS['WGS84']:default:return _0x55e060(0x7ee);}}function getPositionValue(_0x328124,_0xbd44c2){const _0x5232d4={_0x4d1e52:0x7ec,_0xff567d:0x579},_0xbcbced=_0x35a251;if(!_0x328124)return _0x328124;let _0x56ad86;if(_0x328124 instanceof Cesium__namespace['Cartesian3'])_0x56ad86=_0x328124;else{if(_0x328124[_0xbcbced(0xc5d)]&&_0x328124['_value']instanceof Cesium__namespace['Cartesian3'])_0x56ad86=_0x328124['_value'];else typeof _0x328124['getValue']==='function'&&(_0x56ad86=_0x328124[_0xbcbced(_0x5232d4._0x4d1e52)](_0xbd44c2||Cesium__namespace[_0xbcbced(_0x5232d4._0xff567d)]['now']()));}return _0x56ad86;}function getMaxHeight(_0x101ed6,_0x506be8=0x0){const _0x53cd68={_0xada970:0xe1e},_0x133f50=_0x35a251;if(_0x101ed6==null||_0x101ed6['length']===0x0)return _0x506be8;let _0x420582=_0x506be8;for(let _0x15c246=0x0;_0x15c246<_0x101ed6[_0x133f50(_0x53cd68._0xada970)];_0x15c246++){const _0x470ef3=LngLatPoint['parse'](_0x101ed6[_0x15c246]);_0x15c246===0x0&&(_0x420582=_0x470ef3['alt']),_0x470ef3['alt']>_0x420582&&(_0x420582=_0x470ef3['alt']);}return formatNum(_0x420582,LngLatPoint['FormatAltLength']);}function formatNum(_0x3d4230,_0x2cf618=0x0){const _0x2a53b4=_0x35a251,_0x3ad188=Math['pow'](0xa,_0x2cf618);return Math[_0x2a53b4(0xca6)](_0x3d4230*_0x3ad188)/_0x3ad188;}function getMinHeight(_0x20196d,_0x92f8da=0x0){if(_0x20196d==null||_0x20196d['length']===0x0)return _0x92f8da;let _0x28d631=_0x92f8da;for(let _0x5eb4e4=0x0;_0x5eb4e4<_0x20196d['length'];_0x5eb4e4++){const _0x545eeb=Cesium__namespace['Cartographic']['fromCartesian'](_0x20196d[_0x5eb4e4]);_0x5eb4e4===0x0&&(_0x28d631=_0x545eeb['height']),_0x545eeb['height']<_0x28d631&&(_0x28d631=_0x545eeb['height']);}return formatNum(_0x28d631,LngLatPoint['FormatAltLength']);}function addPositionsHeight(_0x2cb31b,_0x459f23=0x0){const _0x3d2374={_0x40bb03:0xc26,_0x2eafee:0x9b1},_0x15395a=_0x35a251;_0x459f23=Number(_0x459f23);if(isNaN(_0x459f23)||_0x459f23===0x0)return _0x2cb31b;if(Array['isArray'](_0x2cb31b)){const _0x4d1711=[];for(let _0x739068=0x0,_0x31dc23=_0x2cb31b['length'];_0x739068<_0x31dc23;_0x739068++){const _0x28b1e3=Cesium__namespace['Cartographic']['fromCartesian'](_0x2cb31b[_0x739068]),_0x427be4=Cesium__namespace['Cartesian3']['fromRadians'](_0x28b1e3[_0x15395a(_0x3d2374._0x40bb03)],_0x28b1e3['latitude'],_0x28b1e3['height']+_0x459f23);_0x4d1711['push'](_0x427be4);}return _0x4d1711;}else{const _0x25aea8=Cesium__namespace['Cartographic'][_0x15395a(_0x3d2374._0x2eafee)](_0x2cb31b);return Cesium__namespace['Cartesian3'][_0x15395a(0x175)](_0x25aea8['longitude'],_0x25aea8['latitude'],_0x25aea8['height']+_0x459f23);}}function setPositionsHeight(_0x1667d7,_0x3fa489=0x0){const _0x10a04f={_0x4eee13:0xe1e,_0x5d3813:0x120,_0x45b460:0xc26,_0x314335:0x580,_0x347367:0x8eb,_0x1beecf:0x175},_0x37e6a8=_0x35a251;if(!_0x1667d7)return _0x1667d7;if(Array[_0x37e6a8(0x719)](_0x1667d7)){const _0x47f325=[];for(let _0xed217e=0x0,_0x4efc62=_0x1667d7[_0x37e6a8(_0x10a04f._0x4eee13)];_0xed217e<_0x4efc62;_0xed217e++){const _0x9c99c5=Cesium__namespace[_0x37e6a8(_0x10a04f._0x5d3813)]['fromCartesian'](_0x1667d7[_0xed217e]),_0x288574=Cesium__namespace['Cartesian3']['fromRadians'](_0x9c99c5[_0x37e6a8(_0x10a04f._0x45b460)],_0x9c99c5[_0x37e6a8(_0x10a04f._0x314335)],_0x3fa489);_0x47f325['push'](_0x288574);}return _0x47f325;}else{const _0x507705=Cesium__namespace['Cartographic']['fromCartesian'](_0x1667d7);return Cesium__namespace[_0x37e6a8(_0x10a04f._0x347367)][_0x37e6a8(_0x10a04f._0x1beecf)](_0x507705['longitude'],_0x507705['latitude'],_0x3fa489);}}function getHeight(_0x3cf26b,_0x49793e,_0x11e1f1={}){const _0x27abe5={_0x4b08df:0xb1d,_0x37dce7:0xf48},_0x42d11f=_0x35a251,_0x118bc8=LngLatPoint['parse'](_0x49793e);if(!_0x3cf26b||!_0x118bc8)return 0x0;const _0x553f70=_0x118bc8['toCartesian'](),_0x513bd4=_0x11e1f1['has3dtiles']??Cesium__namespace['defined'](pick3DTileset(_0x3cf26b,_0x553f70)),_0xcb32a9=Boolean(_0x3cf26b['terrainProvider'][_0x42d11f(_0x27abe5._0x4b08df)]);if(!_0xcb32a9&&!_0x513bd4)return 0x0;const _0x496089=_0x118bc8['toCartographic']();if(_0x513bd4){const _0x30d7c8=_0x3cf26b['sampleHeight'](_0x496089,_0x11e1f1['objectsToExclude'],_0x11e1f1[_0x42d11f(_0x27abe5._0x37dce7)]);if(Cesium__namespace['defined'](_0x30d7c8)&&_0x30d7c8>-0x3e8)return _0x30d7c8;}const _0x29744f=_0x3cf26b['globe']['getHeight'](_0x496089);if(Cesium__namespace['defined'](_0x29744f)&&_0x29744f>-0x3e8)return _0x29744f;return 0x0;}function getSurfaceHeight(_0x7a5be4,_0x2f9175,_0x151090={}){return _0x151090['scene']=_0x7a5be4,_0x151090['position']=_0x2f9175,new SurfacePoint(_0x151090)['start']();}function getSurfaceTerrainHeight(_0x2d85a5,_0x376d0e){const _0x2d6080={'scene':_0x2d85a5,'position':_0x376d0e,'has3dtiles':![]};return new SurfacePoint(_0x2d6080)['start']();}function getSurfacePosition(_0x5987d2,_0x599a5f,_0x394395={}){const _0x29c145=_0x35a251;if(!_0x599a5f)return _0x599a5f;_0x5987d2['scene']&&(_0x5987d2=_0x5987d2['scene']);let _0x3bec79=getHeight(_0x5987d2,_0x599a5f,_0x394395);if(_0x3bec79!==0x0||Cesium__namespace['defined'](_0x394395['maxHeight'])&&_0x3bec79<=_0x394395['maxHeight']){const _0x5c26bb=Cesium__namespace[_0x29c145(0x120)]['fromCartesian'](_0x599a5f);_0x394395['relativeHeight']&&(_0x3bec79+=_0x5c26bb[_0x29c145(0x682)]);const _0x546f27=Cesium__namespace['Cartesian3']['fromRadians'](_0x5c26bb['longitude'],_0x5c26bb['latitude'],_0x3bec79);return _0x546f27;}return _0x599a5f;}function hasPickedModel(_0x15fbde,_0x38a068){const _0x7c7552={_0x247a06:0xaa2},_0x5b4027=_0x35a251;if(Cesium__namespace['defined'](_0x15fbde['id'])){const _0x41095d=_0x15fbde['id'];if(_0x41095d['_noMousePick'])return _0x41095d;if(_0x38a068&&_0x41095d===_0x38a068)return _0x41095d;}if(Cesium__namespace[_0x5b4027(_0x7c7552._0x247a06)](_0x15fbde[_0x5b4027(0x6f2)])){const _0x1d41fc=_0x15fbde[_0x5b4027(0x6f2)];if(_0x1d41fc['_noMousePick'])return _0x1d41fc;if(_0x38a068&&_0x1d41fc===_0x38a068)return _0x1d41fc;}if(Cesium__namespace['defined'](_0x15fbde['tileset'])){const _0x7a281c=_0x15fbde['tileset'];if(_0x7a281c['_noMousePick'])return _0x7a281c;if(_0x38a068&&_0x7a281c===_0x38a068)return _0x7a281c;}return null;}function getCurrentMousePosition(_0x1db101,_0xf91986,_0x583c50){const _0x476c1b={_0x2477c6:0x3f4,_0x537e21:0xb61,_0x555b6a:0x987,_0x1c4743:0x987,_0x4df6c2:0xaa2,_0x319626:0xa9c,_0xac4704:0xcbd,_0x1a2272:0x22f,_0x164a61:0x682},_0x3e223c=_0x35a251;let _0x767b47,_0x4664fb;try{_0x4664fb=_0x1db101['pick'](_0xf91986,0x5,0x5);}catch(_0x192825){logWarn('getCurrentMousePosition:\x20scene.pick\x20拾取时异常',_0x192825);}if(_0x1db101['pickPositionSupported']&&!_0x1db101['onlyPickTerrainPosition']&&Cesium__namespace[_0x3e223c(0xaa2)](_0x4664fb)){const _0x29dfef=hasPickedModel(_0x4664fb,_0x583c50);if(_0x29dfef){if((_0x29dfef['billboard']||_0x29dfef['point']||_0x29dfef['label'])&&!_0x29dfef[_0x3e223c(0xedf)]&&!_0x29dfef['model']&&!_0x29dfef[_0x3e223c(_0x476c1b._0x2477c6)])return getPositionValue(_0x29dfef[_0x3e223c(_0x476c1b._0x537e21)]);if(_0x29dfef[_0x3e223c(0x987)]){_0x29dfef[_0x3e223c(_0x476c1b._0x555b6a)]=![],_0x1db101['requestRender'](),_0x767b47=getCurrentMousePosition(_0x1db101,_0xf91986,_0x583c50),_0x29dfef['show']=!![];if(_0x767b47)return _0x767b47;}if(!_0x1db101['globe'][_0x3e223c(_0x476c1b._0x1c4743)])return _0x1db101['pickPosition'](_0xf91986);}else{if(Cesium__namespace[_0x3e223c(_0x476c1b._0x4df6c2)](_0x4664fb['id'])){const _0x2b067b=_0x4664fb['id'];if((_0x2b067b['billboard']||_0x2b067b['point']||_0x2b067b['label'])&&!_0x2b067b['model'])return getPositionValue(_0x2b067b['position']);}_0x767b47=_0x1db101['pickPosition'](_0xf91986);if(Cesium__namespace['defined'](_0x767b47)){const _0x185739=Cesium__namespace['Cartographic']['fromCartesian'](_0x767b47);if(_0x185739['height']>=0x0)return _0x767b47;if(!Cesium__namespace[_0x3e223c(_0x476c1b._0x4df6c2)](_0x4664fb['id'])&&_0x185739['height']>=-0x1388)return _0x767b47;}}}if(Cesium__namespace['defined'](Cesium__namespace['S3MTilesLayer'])){_0x767b47=_0x1db101[_0x3e223c(_0x476c1b._0x319626)](_0xf91986);if(Cesium__namespace['defined'](_0x767b47))return _0x767b47;}if(!_0x1db101['onlyPickTerrainPosition']&&_0x1db101['onlyPickModelPosition'])return _0x767b47;if(_0x1db101['mode']===Cesium__namespace['SceneMode']['SCENE3D']){const _0x3e7c2e=_0x1db101['camera'][_0x3e223c(_0x476c1b._0xac4704)](_0xf91986);_0x767b47=_0x1db101['globe']['pick'](_0x3e7c2e,_0x1db101),!_0x767b47&&(_0x767b47=_0x1db101['camera'][_0x3e223c(0xaab)](_0xf91986,_0x1db101['globe'][_0x3e223c(_0x476c1b._0x2477c6)]));}else _0x767b47=_0x1db101['camera']['pickEllipsoid'](_0xf91986,_0x1db101[_0x3e223c(_0x476c1b._0x1a2272)]['ellipsoid']);if(Cesium__namespace['defined'](_0x767b47)&&_0x1db101[_0x3e223c(0x7d)]['positionCartographic']['height']<0x2710){const _0x12d81a=Cesium__namespace['Cartographic']['fromCartesian'](_0x767b47);if(_0x12d81a[_0x3e223c(_0x476c1b._0x164a61)]<-0x1388)return null;}return _0x767b47;}function getCurrentMouseTerrainPosition(_0x357cd6,_0x24a9bb){const _0x16579f={_0x3ac0d4:0xaab},_0x11f395=_0x35a251;let _0x4601ff;if(_0x357cd6['mode']===Cesium__namespace['SceneMode']['SCENE3D']){const _0xd713ee=_0x357cd6['camera']['getPickRay'](_0x24a9bb);_0x4601ff=_0x357cd6['globe']['pick'](_0xd713ee,_0x357cd6),!_0x4601ff&&(_0x4601ff=_0x357cd6['camera'][_0x11f395(_0x16579f._0x3ac0d4)](_0x24a9bb,_0x357cd6['globe']['ellipsoid']));}else _0x4601ff=_0x357cd6['camera']['pickEllipsoid'](_0x24a9bb,_0x357cd6[_0x11f395(0x22f)]['ellipsoid']);return _0x4601ff;}function getMidpoint(_0x1fb95b,_0x5eae48){const _0x24a2e5={_0xcc7b07:0x949,_0x536904:0xc26},_0x4af8b8=_0x35a251;if(!_0x5eae48||!_0x1fb95b)return undefined;const _0xdf9c25=LngLatPoint[_0x4af8b8(_0x24a2e5._0xcc7b07)](_0x1fb95b),_0x2236a8=LngLatPoint['toCartographic'](_0x5eae48),_0x5ebabf=(_0xdf9c25['height']+_0x2236a8[_0x4af8b8(0x682)])/0x2,_0x251908=new Cesium__namespace[(_0x4af8b8(0xd43))](_0xdf9c25,_0x2236a8)['interpolateUsingFraction'](0.5);return Cesium__namespace['Cartesian3']['fromRadians'](_0x251908[_0x4af8b8(_0x24a2e5._0x536904)],_0x251908['latitude'],_0x5ebabf);}function isRepeatPoint(_0x5dae86,_0x4e4216){const _0x18ec90=_0x35a251;if(!_0x4e4216||!_0x5dae86)return![];return Math[_0x18ec90(0x405)](_0x5dae86['x']-_0x4e4216['x'])<0.1&&Math[_0x18ec90(0x405)](_0x5dae86['y']-_0x4e4216['y'])<0.1&&Math['abs'](_0x5dae86['z']-_0x4e4216['z'])<0.1?!![]:![];}function getRotateCenterPoint(_0x3b6bb7,_0x53e237,_0x51b8e7){const _0x5890c3={_0x423dbb:0x8eb,_0x36b8aa:0xf43},_0x342dbb=_0x35a251,_0x2ceae0=Cesium__namespace['Cartographic'][_0x342dbb(0x9b1)](_0x3b6bb7);_0x2ceae0['height']=0x0;const _0x5cfa95=Cesium__namespace['Cartographic']['toCartesian'](_0x2ceae0);let _0x3ea241=Cesium__namespace[_0x342dbb(_0x5890c3._0x423dbb)]['subtract'](_0x5cfa95,_0x3b6bb7,new Cesium__namespace['Cartesian3']());_0x3ea241=Cesium__namespace['Cartesian3']['normalize'](_0x3ea241,new Cesium__namespace[(_0x342dbb(0x8eb))]());const _0x5e2a3f=Cesium__namespace['Quaternion']['fromAxisAngle'](_0x3ea241,Cesium__namespace['Math']['toRadians'](_0x51b8e7)),_0xc751f8=Cesium__namespace['Matrix3']['fromQuaternion'](_0x5e2a3f),_0x35650a=Cesium__namespace['Matrix4'][_0x342dbb(_0x5890c3._0x36b8aa)](_0xc751f8),_0x456b05=Cesium__namespace[_0x342dbb(_0x5890c3._0x423dbb)]['subtract'](_0x53e237,_0x3b6bb7,new Cesium__namespace['Cartesian3']()),_0x1133d0=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x35650a,_0x456b05,new Cesium__namespace['Cartesian3']()),_0x1693a0=Cesium__namespace[_0x342dbb(0x8eb)]['add'](_0x1133d0,_0x3b6bb7,new Cesium__namespace['Cartesian3']());return _0x1693a0;}function getOnLinePointByLen(_0x572f51,_0x45233e,_0x3e4531,_0x58fc52){const _0x1b4917={_0x2da4de:0x67b,_0x314ee2:0x6a7,_0x73903d:0x7e2,_0x2a965e:0x6a7,_0x2a538c:0x8eb,_0x14159f:0xddc},_0x57fa54=_0x35a251,_0x5987c5=Cesium__namespace['Transforms'][_0x57fa54(_0x1b4917._0x2da4de)](_0x572f51),_0x4b6a7f=Cesium__namespace[_0x57fa54(_0x1b4917._0x314ee2)]['inverse'](_0x5987c5,new Cesium__namespace['Matrix4']());_0x572f51=Cesium__namespace['Matrix4'][_0x57fa54(_0x1b4917._0x73903d)](_0x4b6a7f,_0x572f51,new Cesium__namespace['Cartesian3']()),_0x45233e=Cesium__namespace[_0x57fa54(_0x1b4917._0x2a965e)][_0x57fa54(0x7e2)](_0x4b6a7f,_0x45233e,new Cesium__namespace[(_0x57fa54(_0x1b4917._0x2a538c))]());const _0x414cc7=Cesium__namespace['Cartesian3']['subtract'](_0x45233e,_0x572f51,new Cesium__namespace['Cartesian3']()),_0x49bf02=Cesium__namespace[_0x57fa54(_0x1b4917._0x2a538c)]['distance'](_0x572f51,_0x45233e);let _0x4e77b8;_0x49bf02!==0x0?_0x4e77b8=_0x3e4531/_0x49bf02:_0x4e77b8=0.001;_0x58fc52&&(_0x4e77b8+=0x1);let _0xe1d55f=Cesium__namespace[_0x57fa54(0x8eb)][_0x57fa54(_0x1b4917._0x14159f)](_0x414cc7,_0x4e77b8,new Cesium__namespace['Cartesian3']());return _0xe1d55f=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x5987c5,_0xe1d55f,new Cesium__namespace['Cartesian3']()),_0xe1d55f;}function getPositionByHprAndOffset(_0x540188,_0x367c8e,_0x411cf7,_0x1ee895,_0x3e1a7c){const _0x10e7f5={_0x1e45ea:0xa43},_0x2f56fd=_0x35a251;_0x540188=LngLatPoint[_0x2f56fd(_0x10e7f5._0x1e45ea)](_0x540188);!_0x411cf7&&(_0x411cf7=new Cesium__namespace['HeadingPitchRoll']());const _0x145233=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x540188,_0x411cf7,_0x1ee895,_0x3e1a7c),_0x8e086=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromQuaternion'](_0x145233,new Cesium__namespace['Matrix3']()),_0x540188,new Cesium__namespace['Matrix4']()),_0x41fcd4=Cesium__namespace[_0x2f56fd(0x6a7)]['multiplyByPoint'](_0x8e086,_0x367c8e,new Cesium__namespace['Cartesian3']());return _0x41fcd4;}function getPositionByDirectionAndLen(_0x18e057,_0x2c7306,_0x445939){const _0x2a4410={_0x14b5b9:0xa43,_0x7d7e2c:0x49c,_0xcaf1c5:0x67b,_0x4904ce:0xd9d,_0x5ee026:0x6a7},_0x325d70=_0x35a251;_0x18e057=LngLatPoint[_0x325d70(_0x2a4410._0x14b5b9)](_0x18e057);const _0x4ae170=Cesium__namespace[_0x325d70(_0x2a4410._0x7d7e2c)][_0x325d70(_0x2a4410._0xcaf1c5)](_0x18e057),_0x26f1d2=Cesium__namespace[_0x325d70(_0x2a4410._0x4904ce)]['fromRotationZ'](Cesium__namespace['Math'][_0x325d70(0x7ba)](0x168-(_0x2c7306||0x0))),_0x2bf450=Cesium__namespace[_0x325d70(_0x2a4410._0x5ee026)][_0x325d70(0xf43)](_0x26f1d2);Cesium__namespace['Matrix4']['multiply'](_0x4ae170,_0x2bf450,_0x4ae170);const _0x52f841=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x4ae170,new Cesium__namespace['Cartesian3'](_0x445939,0x0,0x0),new Cesium__namespace['Cartesian3']());return _0x52f841;}function getPositionByHprAndLen(_0x1eb297,_0x11c605,_0x200a0e){const _0x506a13={_0xf4400f:0x711,_0x12ec98:0xd9d,_0x5326c7:0x6a7},_0x109969=_0x35a251;_0x1eb297=LngLatPoint['toCartesian'](_0x1eb297);const _0x591b65=Cesium__namespace['Transforms'][_0x109969(_0x506a13._0xf4400f)](_0x1eb297,_0x11c605),_0x3dbb7f=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3'][_0x109969(0x79d)](_0x591b65,new Cesium__namespace[(_0x109969(_0x506a13._0x12ec98))]()),_0x1eb297,new Cesium__namespace[(_0x109969(_0x506a13._0x5326c7))]()),_0x147b39=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x3dbb7f,new Cesium__namespace['Cartesian3'](0x0,0x0,-_0x200a0e),new Cesium__namespace['Cartesian3']());return _0x147b39;}function getRayEarthPosition(_0x2c5132,_0x10acad,_0xcec468,_0x2fd6c9){const _0x3eac23={_0xf7daee:0xd9d},_0x30c95c=_0x35a251;if(!_0x2c5132||!_0x10acad)return;_0x10acad instanceof Cesium__namespace['HeadingPitchRoll']&&(_0x10acad=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x2c5132,_0x10acad));const _0x2a13cb=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace[_0x30c95c(_0x3eac23._0xf7daee)]['fromQuaternion'](_0x10acad,new Cesium__namespace['Matrix3']()),_0x2c5132,new Cesium__namespace['Matrix4']());return getRayEarthPositionByMatrix(_0x2a13cb,_0xcec468,_0x2fd6c9);}function getRayEarthPositionByMatrix(_0x2a27c0,_0xd8f70f,_0x4c8bfc){const _0x18e54e={_0x36e44c:0x8eb,_0xe3878a:0xa84,_0x4f77c2:0x8eb},_0x4eabf0=_0x35a251,_0x502acf=new Cesium__namespace[(_0x4eabf0(0x8eb))](),_0x4a4ae5=new Cesium__namespace['Ray']();Cesium__namespace['Matrix4']['multiplyByPoint'](_0x2a27c0,Cesium__namespace[_0x4eabf0(_0x18e54e._0x36e44c)][_0x4eabf0(_0x18e54e._0xe3878a)],_0x502acf),_0x502acf['clone'](_0x4a4ae5['origin']);const _0x59829c=new Cesium__namespace[(_0x4eabf0(_0x18e54e._0x4f77c2))](0x0,0x0,_0xd8f70f?-0x64:0x64),_0x19b3a1=extend2Earth(_0x59829c,_0x2a27c0,_0x4a4ae5,_0x4c8bfc);return _0x19b3a1;}function extend2Earth(_0x38207,_0xb9715b,_0x4664ba,_0x12cd76){const _0x57adb0={_0x1ee7f2:0x79b,_0x1f72ba:0x8eb,_0x4e2ca0:0xa90},_0x59f2bd=_0x35a251;_0x12cd76=_0x12cd76||Cesium__namespace['Ellipsoid']['WGS84'];const _0x538ebb=new Cesium__namespace[(_0x59f2bd(0x8eb))]();Cesium__namespace['Matrix4']['multiplyByPoint'](_0xb9715b,_0x38207,_0x538ebb),Cesium__namespace['Cartesian3']['subtract'](_0x538ebb,_0x4664ba['origin'],_0x4664ba[_0x59f2bd(_0x57adb0._0x1ee7f2)]),Cesium__namespace[_0x59f2bd(_0x57adb0._0x1f72ba)]['normalize'](_0x4664ba[_0x59f2bd(0x79b)],_0x4664ba['direction']);const _0x30e591=Cesium__namespace['IntersectionTests'][_0x59f2bd(_0x57adb0._0x4e2ca0)](_0x4664ba,_0x12cd76);let _0x44b408=null;_0x30e591&&(_0x44b408=Cesium__namespace['Ray']['getPoint'](_0x4664ba,_0x30e591[_0x59f2bd(0xaa1)]));if(_0x44b408)try{const _0x3225bb=new Cesium__namespace['Cartographic']();Cesium__namespace['Cartographic']['fromCartesian'](_0x44b408,null,_0x3225bb);}catch(_0xed3870){return null;}return _0x44b408;}function getHeadingPitchRollByOrientation(_0x2a6dc6,_0x216f3b,_0xa54fb0,_0xa1a8be){const _0x45aefe={_0x48d9b4:0x513},_0x66e295=_0x35a251;if(!Cesium__namespace['defined'](_0x216f3b)||!Cesium__namespace['defined'](_0x2a6dc6))return new Cesium__namespace[(_0x66e295(_0x45aefe._0x48d9b4))]();const _0x3af9cf=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromQuaternion'](_0x216f3b,new Cesium__namespace['Matrix3']()),_0x2a6dc6,new Cesium__namespace['Matrix4']()),_0x4a8c29=getHeadingPitchRollByMatrix(_0x3af9cf,_0xa54fb0,_0xa1a8be);return _0x4a8c29;}function getHeadingPitchRollByMatrix(_0x5bdd04,_0x3987e3,_0x1530d1,_0x3ab46f){return Cesium__namespace['Transforms']['fixedFrameToHeadingPitchRoll'](_0x5bdd04,_0x3987e3,_0x1530d1,_0x3ab46f);}function getHeadingPitchRollForLine(_0x3c9628,_0xd8fdfe,_0x6e21bd,_0x39b2f1){const _0x13a9af={_0x2e20f6:0xa43,_0x3a9331:0x6a7,_0x2b05b8:0x8eb,_0x37de74:0x6a7},_0x5bc707=_0x35a251;_0x3c9628=LngLatPoint['toCartesian'](_0x3c9628),_0xd8fdfe=LngLatPoint[_0x5bc707(_0x13a9af._0x2e20f6)](_0xd8fdfe),_0x6e21bd=_0x6e21bd||Cesium__namespace['Ellipsoid']['WGS84'];const _0x1d4f9e=new Cesium__namespace[(_0x5bc707(0x8eb))](),_0x2e82ac=new Cesium__namespace[(_0x5bc707(_0x13a9af._0x3a9331))](),_0x415db1=new Cesium__namespace['Matrix3'](),_0x8ac7c8=Cesium__namespace[_0x5bc707(_0x13a9af._0x2b05b8)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0xd8fdfe,_0x3c9628,_0x1d4f9e),_0x1d4f9e);Cesium__namespace['Transforms']['rotationMatrixFromPositionVelocity'](_0x3c9628,_0x8ac7c8,_0x6e21bd,_0x415db1);const _0x4d4c9f=Cesium__namespace['Matrix4'][_0x5bc707(0xf43)](_0x415db1,_0x3c9628,_0x2e82ac);Cesium__namespace[_0x5bc707(_0x13a9af._0x37de74)]['multiplyTransformation'](_0x4d4c9f,Cesium__namespace['Axis']['Z_UP_TO_X_UP'],_0x4d4c9f);const _0x4295cd=getHeadingPitchRollByMatrix(_0x4d4c9f,_0x6e21bd,_0x39b2f1);return _0x4295cd;}function getReflectVector(_0x5a75bd,_0x394101){const _0x12e46a=_0x35a251,_0x163185=_0x394101[_0x12e46a(0xd61)](),_0x55f51c=_0x5a75bd['clone'](),_0x5c331e=0x2*Cesium__namespace['Cartesian3']['dot'](_0x5a75bd,_0x394101);return Cesium__namespace['Cartesian3'][_0x12e46a(0xddc)](_0x394101,_0x5c331e,_0x163185),Cesium__namespace['Cartesian3'][_0x12e46a(0xc61)](_0x5a75bd,_0x163185,_0x55f51c);}var PointUtil={'__proto__':null,'getTransFun':getTransFun,'getPositionValue':getPositionValue,'getMaxHeight':getMaxHeight,'getMinHeight':getMinHeight,'addPositionsHeight':addPositionsHeight,'setPositionsHeight':setPositionsHeight,'getHeight':getHeight,'getSurfaceHeight':getSurfaceHeight,'getSurfaceTerrainHeight':getSurfaceTerrainHeight,'getSurfacePosition':getSurfacePosition,'getCurrentMousePosition':getCurrentMousePosition,'getCurrentMouseTerrainPosition':getCurrentMouseTerrainPosition,'getMidpoint':getMidpoint,'isRepeatPoint':isRepeatPoint,'getRotateCenterPoint':getRotateCenterPoint,'getOnLinePointByLen':getOnLinePointByLen,'getPositionByHprAndOffset':getPositionByHprAndOffset,'getPositionByDirectionAndLen':getPositionByDirectionAndLen,'getPositionByHprAndLen':getPositionByHprAndLen,'getRayEarthPosition':getRayEarthPosition,'getRayEarthPositionByMatrix':getRayEarthPositionByMatrix,'extend2Earth':extend2Earth,'getHeadingPitchRollByOrientation':getHeadingPitchRollByOrientation,'getHeadingPitchRollByMatrix':getHeadingPitchRollByMatrix,'getHeadingPitchRollForLine':getHeadingPitchRollForLine,'getReflectVector':getReflectVector};class SurfacePoints{constructor(_0x2dac2d){const _0x496416={_0x12281d:0xc60,_0x46d8ab:0xc60},_0x46e4a5=_0x35a251;this['options']=_0x2dac2d,this[_0x46e4a5(_0x496416._0x12281d)]=_0x2dac2d[_0x46e4a5(0x457)]?_0x2dac2d[_0x46e4a5(0x457)]['scene']:_0x2dac2d[_0x46e4a5(_0x496416._0x46d8ab)],!this['scene']&&logError$1('SurfacePoints:\x20请传入scene参数',this['options']),this[_0x46e4a5(0xb35)]=LngLatArray['toCartesians'](this['options']['positions']);}['start'](){const _0x35ef2f={_0x3cb870:0xf13,_0x53994b:0xc60,_0x4d2eb0:0xb35,_0x23f216:0xbcd,_0x3fe25e:0xb1d,_0x330012:0x9b1,_0x171d9d:0xaa2,_0x5ab1f4:0x22f,_0x1e0c3b:0xc26,_0x5db412:0x682};return new Promise((_0x3a6c88,_0x42a833)=>{const _0x2d2bde=_0x2767;this[_0x2d2bde(_0x35ef2f._0x3cb870)]={'resolve':_0x3a6c88,'reject':_0x42a833};if(this['positions']==null||this['positions']['length']===0x0){this['end'](this['positions']);return;}const _0x304b78=this[_0x2d2bde(0xe86)]['has3dtiles']??Cesium__namespace['defined'](pick3DTileset(this[_0x2d2bde(_0x35ef2f._0x53994b)],this[_0x2d2bde(_0x35ef2f._0x4d2eb0)])),_0x34786a=Boolean(this['scene'][_0x2d2bde(_0x35ef2f._0x23f216)][_0x2d2bde(_0x35ef2f._0x3fe25e)]);this['_has3dtiles']=_0x304b78,this['_hasTerrain']=_0x34786a;if(!_0x34786a&&!_0x304b78){this['end'](this['positions']);return;}if(this['options']['exact'])_0x304b78?this['clampTo3DTileset'](this['positions']):this['clampToTerrain'](this['positions']);else{const _0x1d7ee8=[];for(let _0x402eb2=0x0,_0x1a0d20=this['positions']['length'];_0x402eb2<_0x1a0d20;++_0x402eb2){const _0x380f87=Cesium__namespace['Cartographic'][_0x2d2bde(_0x35ef2f._0x330012)](this['positions'][_0x402eb2]);let _0x57b24c;if(_0x304b78){const _0xd8b27d=this['scene']['sampleHeight'](_0x380f87,this['options']['objectsToExclude'],this['options']['width']);Cesium__namespace[_0x2d2bde(_0x35ef2f._0x171d9d)](_0xd8b27d)&&_0xd8b27d>-0x3e8&&(_0x57b24c=_0xd8b27d);}if(!Cesium__namespace['defined'](_0x57b24c)){const _0x4cf405=this[_0x2d2bde(_0x35ef2f._0x53994b)][_0x2d2bde(_0x35ef2f._0x5ab1f4)]['getHeight'](_0x380f87);Cesium__namespace['defined'](_0x4cf405)&&_0x4cf405>-0x3e8&&(_0x57b24c=_0x4cf405);}_0x1d7ee8['push'](Cesium__namespace['Cartesian3']['fromRadians'](_0x380f87[_0x2d2bde(_0x35ef2f._0x1e0c3b)],_0x380f87[_0x2d2bde(0x580)],_0x57b24c??_0x380f87[_0x2d2bde(_0x35ef2f._0x5db412)]));}this['end'](_0x1d7ee8);}});}['clampTo3DTileset'](_0x5be53d){const _0x371f4c={_0x45751b:0xe86},_0x55615e=_0x35a251,_0x51ab2b=[];for(let _0x15f5ae=0x0,_0x5630c2=_0x5be53d['length'];_0x15f5ae<_0x5630c2;++_0x15f5ae){_0x51ab2b['push'](_0x5be53d[_0x15f5ae]['clone']());}this[_0x55615e(0xc60)]['clampToHeightMostDetailed'](_0x51ab2b,this[_0x55615e(_0x371f4c._0x45751b)]['objectsToExclude'])['then'](_0x44a096=>{_0x44a096=this['removeNullData'](_0x44a096),_0x44a096['length']>0x0?this['end'](_0x44a096):this['clampToTerrain'](_0x5be53d);});}['clampToTerrain'](_0x4f87cd){const _0x2e8399={_0xa9bc6f:0xd11},_0x211a85=_0x35a251;if(this[_0x211a85(0xa3d)]){const _0x414b67=this['scene']['globe']['ellipsoid'],_0x5d2e06=_0x414b67['cartesianArrayToCartographicArray'](_0x4f87cd),_0x120f9a=Cesium__namespace['Cartographic']['fromCartesian'](_0x4f87cd[0x0])[_0x211a85(0x682)];Cesium__namespace['sampleTerrainMostDetailed'](this['scene']['terrainProvider'],_0x5d2e06)['then'](_0x35fbe5=>{const _0x484822=_0x211a85;_0x35fbe5=this[_0x484822(_0x2e8399._0xa9bc6f)](_0x35fbe5);let _0x56ee28=![];const _0xf4601d=this['options']['offset']??0x0;for(let _0x5b284b=0x0;_0x5b284b<_0x35fbe5[_0x484822(0xe1e)];++_0x5b284b){_0x35fbe5[_0x5b284b]['height']==null?(_0x56ee28=!![],_0x35fbe5[_0x5b284b][_0x484822(0x682)]=_0x120f9a):_0x35fbe5[_0x5b284b]['height']=_0xf4601d+_0x35fbe5[_0x5b284b]['height'];}const _0x267bf5=_0x414b67[_0x484822(0x301)](_0x35fbe5);this['end'](_0x267bf5,_0x56ee28);});}else this['end'](_0x4f87cd);}[_0x35a251(0xa2d)](_0x328ab0,_0x52d26a){const _0x43c684={_0xc0dfb3:0xe86,_0x1f9717:0xe86,_0x161a99:0xa3d},_0x12e53f=_0x35a251;this[_0x12e53f(_0x43c684._0xc0dfb3)]['callback']&&this[_0x12e53f(_0x43c684._0x1f9717)]['callback'](_0x328ab0,_0x52d26a,this['positions']),this['_promise']['resolve']({'positions':_0x328ab0,'positions_original':this[_0x12e53f(0xb35)],'noHeight':_0x52d26a,'has3dtiles':this['_has3dtiles'],'hasTerrain':this[_0x12e53f(_0x43c684._0x161a99)]});}[_0x35a251(0xd11)](_0x3899bf){const _0x4803cf={_0x5c2dab:0xe1e},_0x5a6661=_0x35a251,_0x10c8f3=[];for(let _0x9be5e1=0x0;_0x9be5e1<_0x3899bf[_0x5a6661(_0x4803cf._0x5c2dab)];++_0x9be5e1){_0x3899bf[_0x9be5e1]!=null&&_0x10c8f3['push'](_0x3899bf[_0x9be5e1]);}return _0x10c8f3;}}function logError(_0x43b7f4,_0x2711a8){console['error']('turf.'+_0x43b7f4+'\x20不存在,该方法需引入\x20turf.js\x20库生效。',_0x2711a8);}function area(_0x4713a1){try{return turf['area'](_0x4713a1);}catch(_0x236180){logError('area',_0x236180);}return 0x0;}function bbox(_0x457220){try{return turf['bbox'](_0x457220);}catch(_0x5c31dc){logError('bbox',_0x5c31dc);}return null;}function bezierSpline(_0x34ee54,_0x3e5d2b){const _0x310f24={_0x545f6c:0x5dc},_0x3c9720=_0x35a251;try{return turf['bezierSpline'](_0x34ee54,_0x3e5d2b);}catch(_0x273211){logError(_0x3c9720(_0x310f24._0x545f6c),_0x273211);}return _0x34ee54;}function booleanPointInPolygon(_0x5ce09a,_0x435506,_0x5c6cc2){const _0x1b4304=_0x35a251;try{return turf['booleanPointInPolygon'](_0x5ce09a,_0x435506,_0x5c6cc2);}catch(_0x177dd6){logError(_0x1b4304(0x92b),_0x177dd6);}return![];}function buffer$1(_0x5f22c3,_0x31af9e,_0x6049db){try{return turf['buffer'](_0x5f22c3,_0x31af9e,_0x6049db);}catch(_0x19382b){logError('buffer',_0x19382b);}return _0x5f22c3;}function convex$1(_0x2adeeb,_0x4bd189){const _0x2744f8=_0x35a251;try{return turf[_0x2744f8(0x81b)](_0x2adeeb,_0x4bd189);}catch(_0x4e3484){logError('convex',_0x4e3484);}return _0x2adeeb;}function pointGrid(_0x33fc89,_0x2b3786,_0x327851){const _0x2a8f63=_0x35a251;try{return turf['pointGrid'](_0x33fc89,_0x2b3786,_0x327851);}catch(_0x2bc544){logError(_0x2a8f63(0xbc8),_0x2bc544);}return{'features':[]};}const pickTilesetPassState=new Cesium__namespace['Cesium3DTilePassState']({'pass':Cesium__namespace['Cesium3DTilePass']['PICK']}),packedDepthScale=new Cesium__namespace['Cartesian4'](0x1,0x1/0xff,0x1/0xfe01,0x1/0xfd02ff),scratchRectangle=new Cesium__namespace['BoundingRectangle'](0x0,0x0,0x3,0x3),scratchColorZero=new Cesium__namespace[(_0x35a251(0xf29))](0x0,0x0,0x0,0x0),scratchRight=new Cesium__namespace['Cartesian3'](),scratchUp=new Cesium__namespace['Cartesian3'](),scratchPackedDepthArray=[];function interPolygonByDepth$1(_0x153eb1){const _0x1bd0ff={_0x1eae94:0x521,_0x183a83:0x729,_0x534b5f:0x8eb,_0x96cb2b:0xddc},_0xc8b8fd={_0x53164a:0x9b1},_0xd584b2=_0x35a251,_0x5bc4fd=_0x153eb1['scene'],_0x66a2=LngLatArray['toCartesians'](_0x153eb1['positions']),_0x436701=_0x5bc4fd[_0xd584b2(0x22f)]['depthTestAgainstTerrain'];_0x5bc4fd['globe']['depthTestAgainstTerrain']=!![];const _0x14bb33=_0x153eb1['cameraHeight']??_0x5bc4fd[_0xd584b2(0x7d)][_0xd584b2(0x78e)][_0xd584b2(0x682)],{ray:_0x5bf750,frustumWidth:_0x45db6d,frustumHeight:_0x132d6d,cameraUp:_0x500619}=getCameraInforForPoints(_0x66a2,_0x14bb33),_0x454a17=Number(_0x153eb1['splitNum']??0x200),_0xd10971=_0x45db6d/_0x454a17,_0x11bb2b=_0x132d6d/_0x454a17,_0xa16da4=new Cesium__namespace[(_0xd584b2(0x1ef))](_0x5bc4fd),_0x513787=_0xa16da4[_0xd584b2(0x2d3)],_0x157886=new Cesium__namespace['BoundingRectangle'](0x0,0x0,_0x454a17,_0x454a17);_0x513787['viewport']=_0x157886,_0x513787[_0xd584b2(0xb47)]['viewport']=_0x157886,_0x5bc4fd[_0xd584b2(0x5c1)]=_0x513787,updateOffscreenCamera(_0x5bf750['origin'],_0x5bf750['direction'],_0x500619,_0x45db6d,_0x132d6d,_0x513787['camera']),Cesium__namespace[_0xd584b2(_0x1bd0ff._0x1eae94)]['clone'](_0x513787['viewport'],scratchRectangle);const _0x1105e0=_0x513787['pickFramebuffer']['begin'](scratchRectangle,_0x513787['viewport']);_0x5bc4fd[_0xd584b2(0x28b)]['disableThisFrame'](),_0x5bc4fd['updateFrameState'](),_0x5bc4fd['frameState']['invertClassification']=![],_0x5bc4fd['frameState']['passes']['pick']=!![],_0x5bc4fd['frameState']['passes']['offscreen']=!![],_0x5bc4fd['frameState']['tilesetPassState']=pickTilesetPassState,_0x5bc4fd['context']['uniformState']['update'](_0x5bc4fd['frameState']),_0x5bc4fd['updateEnvironment'](),_0x5bc4fd['updateAndExecuteCommands'](_0x1105e0,scratchColorZero),_0x5bc4fd[_0xd584b2(0x7bd)](_0x1105e0);const _0x1d0f49=[];if(_0x5bc4fd['context']['depthTexture']){const _0x31d27d=_0x513787[_0xd584b2(_0x1bd0ff._0x183a83)]['length'],_0x32a1cb=new Cesium__namespace[(_0xd584b2(_0x1bd0ff._0x534b5f))]();for(let _0xbdec8f=0x0;_0xbdec8f<_0x31d27d;++_0xbdec8f){const _0x41b430=_0xa16da4['getPickDepth'](_0x5bc4fd,_0xbdec8f),_0x325ec4=getDepth(_0x5bc4fd['context'],0x0,0x0,_0x454a17,_0x454a17,_0x41b430);for(let _0x24c8cd=0x0;_0x24c8cd<_0x325ec4[_0xd584b2(0xe1e)];_0x24c8cd++){const _0x305dd6=_0x325ec4[_0x24c8cd];if(_0x305dd6>0x0&&_0x305dd6<0x1){const _0x36f6f9=_0x513787['frustumCommandsList'][_0xbdec8f],_0xc1f0cb=_0x36f6f9['near']*(_0x24c8cd!==0x0?_0x5bc4fd['opaqueFrustumNearOffset']:0x1),{far:_0x3cab5f}=_0x36f6f9,_0x5a3591=_0xc1f0cb+_0x305dd6*(_0x3cab5f-_0xc1f0cb),_0x4e997f=Math['floor'](_0x24c8cd/_0x454a17),_0x42db79=_0x24c8cd%_0x454a17,_0x2b9e69=(_0x4e997f-_0x454a17/0x2)*_0x132d6d/_0x454a17,_0x445fa1=(_0x42db79-_0x454a17/0x2)*_0x45db6d/_0x454a17,_0x44908c=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x500619,_0x2b9e69,_0x32a1cb),Cesium__namespace['Cartesian3']['add'](_0x32a1cb,_0x513787[_0xd584b2(0x7d)]['position'],_0x44908c),Cesium__namespace['Cartesian3'][_0xd584b2(_0x1bd0ff._0x96cb2b)](_0x513787['camera']['right'],_0x445fa1,_0x32a1cb),Cesium__namespace['Cartesian3']['add'](_0x32a1cb,_0x44908c,_0x44908c);const _0x30ac22=Cesium__namespace[_0xd584b2(0xd31)]['clone'](_0x5bf750);_0x30ac22['origin']=_0x44908c;const _0x10f248=Cesium__namespace['Ray']['getPoint'](_0x30ac22,_0x5a3591);!_0x1d0f49[_0x24c8cd]&&(_0x1d0f49[_0x24c8cd]=_0x10f248);}}}}const _0x57e8a5=[];let _0x5c6e93=Number['MAX_VALUE'],_0x5cde80=-Number['MAX_VALUE'];const _0x4cbf48=_0x66a2['map'](_0x91a317=>{const _0x269c46=_0xd584b2,_0x4e9216=Cesium__namespace[_0x269c46(0x120)]['fromCartesian'](_0x91a317);return[_0x4e9216['longitude'],_0x4e9216['latitude']];});_0x1d0f49[_0xd584b2(0xdbd)](_0x2397db=>{const _0x17004f=_0xd584b2,_0x2f5bb2=Cesium__namespace['Cartographic'][_0x17004f(_0xc8b8fd._0x53164a)](_0x2397db);if(_0x2f5bb2&&pointInPolygonNested([_0x2f5bb2['longitude'],_0x2f5bb2['latitude']],_0x4cbf48)){const _0x333180=_0x2f5bb2['height'];_0x5cde80<_0x333180&&(_0x5cde80=_0x333180),_0x5c6e93>_0x333180&&(_0x5c6e93=_0x333180),_0x2397db['height']=_0x333180,_0x2397db[_0x17004f(0x4f5)]=function(){return getBoxOutLine(this,_0xd10971,_0x11bb2b,_0x500619);},_0x57e8a5['push'](_0x2397db);}}),_0x5bc4fd[_0xd584b2(0x22f)]['depthTestAgainstTerrain']=_0x436701,_0x5bc4fd['view']=_0x5bc4fd['defaultView'],_0x5bc4fd['context']['endFrame'](),_0xa16da4['destroy']();const _0x41379b=_0xd10971*_0x11bb2b;return{'positions':_0x57e8a5,'count':_0x57e8a5['length'],'minHeight':_0x5c6e93,'maxHeight':_0x5cde80,'box':{'width':_0xd10971,'height':_0x11bb2b,'area':_0x41379b},'totalArea':_0x41379b*_0x57e8a5['length']};}function interPolylineByDepth$1(_0x1c728f){const _0x58dab8={_0x2422c9:0x22f,_0x13ddf9:0x78e,_0x5e882a:0x8eb,_0x66d767:0xf9e,_0x4446e2:0x120,_0x3762fa:0x19f,_0x2bcc60:0x5c1,_0x552733:0x79b,_0x55cac6:0xd61,_0x2d2b49:0x3b5,_0x3f6ca4:0xddc,_0x345be2:0xd31,_0x17aa52:0xe1e,_0x347327:0x6de},_0x1dea43=_0x35a251,_0x37d019=_0x1c728f['scene'],_0x3694c7=LngLatArray[_0x1dea43(0xcf)](_0x1c728f['positions']),_0x45a313=_0x37d019[_0x1dea43(_0x58dab8._0x2422c9)]['depthTestAgainstTerrain'];_0x37d019[_0x1dea43(0x22f)][_0x1dea43(0x895)]=!![];const _0x37d9b4=Cesium__namespace['defined'](_0x37d019['globe'])?_0x37d019['globe']['ellipsoid']:_0x37d019['mapProjection']['ellipsoid'],_0x4c3974=_0x37d019['context'],_0x29a964=_0x4c3974['uniformState'],_0x449e50=_0x37d019[_0x1dea43(0xf19)],_0x43bc2d=_0x1c728f['cameraHeight']??_0x37d019['camera'][_0x1dea43(_0x58dab8._0x13ddf9)]['height'],_0x469c42=new Cesium__namespace[(_0x1dea43(0x1ef))](_0x37d019),_0x33de10=_0x469c42['_pickOffscreenView'],_0x181f4d=0.1;let _0x195d9f=[];const _0x5bc7e7=[];for(let _0x494074=0x0,_0x348b5=_0x3694c7['length']-0x1;_0x494074<_0x348b5;_0x494074++){const _0x27cde1=_0x3694c7[_0x494074],_0x53b664=_0x3694c7[_0x494074+0x1],_0x13d6e0=Cesium__namespace['Cartographic'][_0x1dea43(0x9b1)](_0x27cde1),_0x31b640=Cesium__namespace['Cartographic']['fromCartesian'](_0x53b664),_0x338eb9=Cesium__namespace[_0x1dea43(_0x58dab8._0x5e882a)]['fromRadians'](_0x13d6e0[_0x1dea43(0xc26)],_0x13d6e0['latitude']),_0x124b41=Cesium__namespace[_0x1dea43(0x8eb)]['fromRadians'](_0x31b640['longitude'],_0x31b640['latitude']),_0x3bb238=Cesium__namespace['Cartesian3'][_0x1dea43(0xeed)](_0x338eb9,_0x124b41);let _0x2e3b81=0x64;Cesium__namespace['defined'](_0x1c728f[_0x1dea43(0x453)])&&(_0x2e3b81=Number(_0x1c728f['splitNum']));Cesium__namespace[_0x1dea43(0xaa2)](_0x1c728f[_0x1dea43(_0x58dab8._0x66d767)])&&(_0x2e3b81=Math['floor'](_0x3bb238/_0x1c728f[_0x1dea43(_0x58dab8._0x66d767)]));_0x2e3b81>Cesium__namespace['ContextLimits']['maximumTextureSize']&&(_0x2e3b81=Cesium__namespace['ContextLimits']['maximumTextureSize']);const _0x3e218b=new Cesium__namespace['Ray'](),_0xbba07=Cesium__namespace['Cartesian3']['lerp'](_0x338eb9,_0x124b41,0.5,new Cesium__namespace['Cartesian3']()),_0x24176f=Cesium__namespace[_0x1dea43(_0x58dab8._0x4446e2)]['fromCartesian'](_0xbba07),_0x32c568=_0x37d9b4['geodeticSurfaceNormalCartographic'](_0x24176f,new Cesium__namespace[(_0x1dea43(0x8eb))]());Cesium__namespace[_0x1dea43(_0x58dab8._0x5e882a)]['negate'](_0x32c568,_0x3e218b['direction']),_0x3e218b[_0x1dea43(0x39a)]=Cesium__namespace['Cartesian3']['fromRadians'](_0x24176f['longitude'],_0x24176f['latitude'],_0x43bc2d);const _0x3d954f=Cesium__namespace['Cartesian3'][_0x1dea43(0xc61)](_0x124b41,_0x338eb9,scratchUp);Cesium__namespace['Cartesian3']['normalize'](_0x3d954f,_0x3d954f);const _0x1e737a=_0x3bb238,_0x138f97=new Cesium__namespace[(_0x1dea43(0x521))](0x0,0x0,0x1,_0x2e3b81);_0x33de10[_0x1dea43(_0x58dab8._0x3762fa)]=_0x138f97,_0x33de10['passState']['viewport']=_0x138f97,_0x37d019[_0x1dea43(_0x58dab8._0x2bcc60)]=_0x33de10,updateOffscreenCamera(_0x3e218b['origin'],_0x3e218b[_0x1dea43(_0x58dab8._0x552733)],_0x3d954f,_0x181f4d,_0x1e737a,_0x33de10['camera']),Cesium__namespace['BoundingRectangle'][_0x1dea43(_0x58dab8._0x55cac6)](_0x33de10[_0x1dea43(_0x58dab8._0x3762fa)],scratchRectangle);const _0x3e4345=_0x33de10[_0x1dea43(0x431)]['begin'](scratchRectangle,_0x33de10['viewport']);_0x37d019['jobScheduler']['disableThisFrame'](),_0x37d019['updateFrameState'](),_0x449e50[_0x1dea43(0x9da)]=![],_0x449e50[_0x1dea43(_0x58dab8._0x2d2b49)][_0x1dea43(0xa39)]=!![],_0x449e50['passes']['offscreen']=!![],_0x449e50['tilesetPassState']=pickTilesetPassState,_0x29a964['update'](_0x449e50),_0x37d019[_0x1dea43(0xc15)](),_0x37d019['updateAndExecuteCommands'](_0x3e4345,scratchColorZero),_0x37d019['resolveFramebuffers'](_0x3e4345);const _0x35719b=[];if(_0x37d019['context']['depthTexture']){const _0x571026=_0x33de10[_0x1dea43(0x729)]['length'],_0x47e94a=new Cesium__namespace['Cartesian3']();for(let _0x3ea998=0x0;_0x3ea998<_0x571026;++_0x3ea998){const _0x3affdf=_0x469c42['getPickDepth'](_0x37d019,_0x3ea998),_0x3bbe56=getDepth(_0x4c3974,0x0,0x0,0x1,_0x2e3b81,_0x3affdf);for(let _0x446fb2=0x0,_0x20f76a=_0x3bbe56['length'];_0x446fb2<_0x20f76a;_0x446fb2++){const _0x112188=_0x3bbe56[_0x446fb2];if(_0x112188>0x0&&_0x112188<0x1){const _0x138659=_0x33de10['frustumCommandsList'][_0x3ea998],_0x429622=_0x138659['near']*(_0x446fb2!==0x0?_0x37d019['opaqueFrustumNearOffset']:0x1),_0x18f19c=_0x138659['far'],_0x1b63e2=_0x429622+_0x112188*(_0x18f19c-_0x429622);if(_0x20f76a>0x1){const _0x592d99=(_0x446fb2/(_0x3bbe56[_0x1dea43(0xe1e)]-0x1)-0.5)*_0x1e737a;Cesium__namespace[_0x1dea43(0x8eb)][_0x1dea43(_0x58dab8._0x3f6ca4)](_0x3d954f,_0x592d99,_0x47e94a);}const _0x2b1b00=Cesium__namespace[_0x1dea43(0xd31)]['clone'](_0x3e218b);Cesium__namespace['Cartesian3'][_0x1dea43(0x4af)](_0x2b1b00[_0x1dea43(0x39a)],_0x47e94a,_0x2b1b00['origin']);const _0x5cbe39=Cesium__namespace[_0x1dea43(_0x58dab8._0x345be2)]['getPoint'](_0x2b1b00,_0x1b63e2);!_0x35719b[_0x446fb2]&&(_0x35719b[_0x446fb2]=_0x5cbe39);}}}}_0x37d019[_0x1dea43(0x5c1)]=_0x37d019['defaultView'],_0x4c3974['endFrame']();const _0x459025=[];for(let _0xe935e9=0x0,_0x18ed9c=_0x35719b[_0x1dea43(_0x58dab8._0x17aa52)];_0xe935e9<_0x18ed9c;_0xe935e9++){const _0x1c85b8=_0x35719b[_0xe935e9];Cesium__namespace['defined'](_0x1c85b8)&&_0x459025['push'](_0x1c85b8);}_0x195d9f=_0x195d9f['concat'](_0x459025),_0x5bc7e7[_0x1dea43(_0x58dab8._0x347327)]({'distance':_0x3bb238,'positions':_0x459025});}return _0x37d019[_0x1dea43(0x22f)]['depthTestAgainstTerrain']=_0x45a313,_0x469c42['destroy'](),{'positions':_0x195d9f,'list':_0x5bc7e7};}function getDepth(_0x4d0cb9,_0x5d04d4,_0x548730,_0x14ee72,_0x3f6005,_0x2e77a5){const _0x4c513d={_0x4553f6:0x884,_0x23d193:0x6de},_0x4aacbc=_0x35a251,_0x43afdf=_0x4d0cb9[_0x4aacbc(_0x4c513d._0x4553f6)]({'x':_0x5d04d4,'y':_0x548730,'width':_0x14ee72,'height':_0x3f6005,'framebuffer':_0x2e77a5[_0x4aacbc(0x52f)]}),_0x5e483e=Cesium__namespace['Cartesian4']['unpackArray'](_0x43afdf,scratchPackedDepthArray),_0x12491c=[];for(let _0x39a1d0=0x0;_0x39a1d0<_0x5e483e['length'];++_0x39a1d0){const _0x186721=_0x5e483e[_0x39a1d0];Cesium__namespace['Cartesian4']['divideByScalar'](_0x186721,0xff,_0x186721);const _0x5da9d6=Cesium__namespace['Cartesian4']['dot'](_0x186721,packedDepthScale);_0x12491c[_0x4aacbc(_0x4c513d._0x23d193)](_0x5da9d6);}return _0x12491c;}function updateOffscreenCamera(_0x250b71,_0x123936,_0xb6d836,_0x4c3ec1,_0x5793d2,_0x5a170f){const _0x3fecf3={_0x5f51ec:0xb61},_0x4d0f1f=_0x35a251,_0x35a271=Cesium__namespace['Cartesian3']['cross'](_0x123936,_0xb6d836,scratchRight);return _0x5a170f[_0x4d0f1f(_0x3fecf3._0x5f51ec)]=_0x250b71,_0x5a170f['direction']=_0x123936,_0x5a170f['up']=_0xb6d836,_0x5a170f['right']=_0x35a271,_0x5a170f['frustum']['width']=_0x4c3ec1,_0x5a170f['frustum']['aspectRatio']=_0x4c3ec1/_0x5793d2,_0x5a170f['frustum']['computeCullingVolume'](_0x5a170f['positionWC'],_0x5a170f['directionWC'],_0x5a170f['upWC']);}function getCameraInforForPoints(_0x4c3e6e,_0x325a62){const _0x5cf4b5={_0x4b6177:0x580,_0x1dd0a0:0xf39,_0x21502d:0x8eb,_0x1026c9:0x682,_0x53f47f:0xd6,_0x2687fa:0xa43},_0x367f8f=_0x35a251,_0x381eee=Cesium__namespace['Rectangle']['fromCartesianArray'](_0x4c3e6e),_0x3c7761=Cesium__namespace['Rectangle']['center'](_0x381eee),_0x1b5e9c=Cesium__namespace['Cartesian3']['fromRadians'](_0x3c7761['longitude'],_0x3c7761[_0x367f8f(_0x5cf4b5._0x4b6177)],_0x325a62),_0x510796=Cesium__namespace['Ellipsoid'][_0x367f8f(_0x5cf4b5._0x1dd0a0)][_0x367f8f(0x5b8)](_0x1b5e9c);Cesium__namespace[_0x367f8f(_0x5cf4b5._0x21502d)]['multiplyByScalar'](_0x510796,-0x1,_0x510796);const _0x482b9c=Cesium__namespace['Cartesian3']['fromRadians'](_0x3c7761['longitude'],_0x3c7761['latitude']+_0x381eee[_0x367f8f(_0x5cf4b5._0x1026c9)]/0x2,_0x325a62),_0x188fb8=Cesium__namespace['Cartesian3'][_0x367f8f(0xc61)](_0x482b9c,_0x1b5e9c,new Cesium__namespace['Cartesian3']()),_0x390d35=new Cesium__namespace['Ray'](_0x1b5e9c,_0x510796),_0x2b1ecf=Cesium__namespace['Rectangle']['southwest'](_0x381eee),_0x30144c=Cesium__namespace[_0x367f8f(_0x5cf4b5._0x53f47f)]['southeast'](_0x381eee),_0x19b97d=Cesium__namespace[_0x367f8f(_0x5cf4b5._0x53f47f)]['northwest'](_0x381eee),_0x80295=Cesium__namespace['Cartographic'][_0x367f8f(_0x5cf4b5._0x2687fa)](_0x2b1ecf),_0x4de231=Cesium__namespace['Cartographic']['toCartesian'](_0x30144c),_0x1e1b2a=Cesium__namespace['Cartographic']['toCartesian'](_0x19b97d),_0x498a78=Cesium__namespace['Cartesian3']['distance'](_0x80295,_0x4de231),_0x36b294=Cesium__namespace['Cartesian3']['distance'](_0x80295,_0x1e1b2a);return{'ray':_0x390d35,'frustumWidth':_0x498a78,'frustumHeight':_0x36b294,'cameraUp':_0x188fb8};}function pointInPolygonNested(_0x177126,_0x6101aa){const _0x1de7c2=_0x177126[0x0],_0x455064=_0x177126[0x1];let _0xe679bb=![];const _0x1fe22b=_0x6101aa['length'];for(let _0x4f6508=0x0,_0x11291e=_0x1fe22b-0x1;_0x4f6508<_0x1fe22b;_0x11291e=_0x4f6508++){const _0x3b5ed9=_0x6101aa[_0x4f6508][0x0],_0x3769df=_0x6101aa[_0x4f6508][0x1],_0x3e85be=_0x6101aa[_0x11291e][0x0],_0x27f849=_0x6101aa[_0x11291e][0x1],_0x193d10=_0x3769df>_0x455064!==_0x27f849>_0x455064&&_0x1de7c2<(_0x3e85be-_0x3b5ed9)*(_0x455064-_0x3769df)/(_0x27f849-_0x3769df)+_0x3b5ed9;_0x193d10&&(_0xe679bb=!_0xe679bb);}return _0xe679bb;}function getBoxOutLine(_0x1d9330,_0x34e15e,_0x3d4c0d,_0x47dfe3){const _0x589719={_0x214153:0x8eb,_0x306a5d:0x8eb,_0x2b193d:0x8eb,_0x306915:0x4af,_0x3ec821:0xc61,_0x27fa49:0xc61},_0x1ed70b=_0x35a251,_0x5c61d8=Cesium__namespace[_0x1ed70b(0x8eb)][_0x1ed70b(0xebd)](_0x1d9330,new Cesium__namespace['Cartesian3']()),_0x39dabb=Cesium__namespace[_0x1ed70b(0x8eb)]['cross'](_0x47dfe3,_0x5c61d8,_0x5c61d8);Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x39dabb,_0x34e15e/0x2,_0x39dabb);const _0x32ab80=Cesium__namespace['Cartesian3'][_0x1ed70b(0xddc)](_0x47dfe3,_0x3d4c0d/0x2,new Cesium__namespace[(_0x1ed70b(_0x589719._0x214153))]()),_0xf50681=Cesium__namespace[_0x1ed70b(_0x589719._0x306a5d)]['add'](_0x1d9330,_0x32ab80,new Cesium__namespace['Cartesian3']());Cesium__namespace[_0x1ed70b(_0x589719._0x2b193d)]['add'](_0xf50681,_0x39dabb,_0xf50681);const _0x35ad11=Cesium__namespace[_0x1ed70b(_0x589719._0x306a5d)][_0x1ed70b(_0x589719._0x306915)](_0x1d9330,_0x32ab80,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3'][_0x1ed70b(_0x589719._0x3ec821)](_0x35ad11,_0x39dabb,_0x35ad11);const _0xffbcaf=Cesium__namespace['Cartesian3']['subtract'](_0x1d9330,_0x32ab80,new Cesium__namespace[(_0x1ed70b(0x8eb))]());Cesium__namespace[_0x1ed70b(0x8eb)]['add'](_0xffbcaf,_0x39dabb,_0xffbcaf);const _0x52930a=Cesium__namespace[_0x1ed70b(0x8eb)][_0x1ed70b(_0x589719._0x3ec821)](_0x1d9330,_0x32ab80,new Cesium__namespace['Cartesian3']());return Cesium__namespace[_0x1ed70b(_0x589719._0x306a5d)][_0x1ed70b(_0x589719._0x27fa49)](_0x52930a,_0x39dabb,_0x52930a),[_0xf50681,_0xffbcaf,_0x52930a,_0x35ad11];}const scratchPerspectiveFrustum$1=new Cesium__namespace[(_0x35a251(0xc7c))](),scratchPerspectiveOffCenterFrustum$1=new Cesium__namespace['PerspectiveOffCenterFrustum'](),scratchOrthographicFrustum$1=new Cesium__namespace['OrthographicFrustum'](),scratchOrthographicOffCenterFrustum$1=new Cesium__namespace['OrthographicOffCenterFrustum']();function getRayIntersectingPositions(_0x26ba69,_0x69d412,_0x11b141){const _0x235bb0={_0x210a08:0x2d3,_0x390ce9:0x19f,_0x4dad30:0xb47,_0x21a7f5:0x521,_0x230c01:0x431,_0x2e5f4b:0xcb6,_0x4f247f:0x28b,_0x1870f8:0x3b5,_0x879c75:0x19c,_0x1f25c5:0x7d,_0x28850a:0xcaf,_0x5a32f5:0x169},_0x376ff6=_0x35a251,{context:_0x4d212a,frameState:_0x14e44f}=_0x26ba69,{uniformState:_0x4c3794}=_0x4d212a,_0x33361d=_0x26ba69['camera'],_0x109478=_0x69d412[_0x376ff6(_0x235bb0._0x210a08)],_0x5f1c45=new Cesium__namespace['BoundingRectangle'](0x0,0x0,_0x11b141,_0x11b141);_0x109478[_0x376ff6(_0x235bb0._0x390ce9)]=_0x5f1c45,_0x109478[_0x376ff6(_0x235bb0._0x4dad30)]['viewport']=_0x5f1c45,_0x26ba69['view']=_0x109478,_0x109478['camera']=_0x33361d,Cesium__namespace[_0x376ff6(_0x235bb0._0x21a7f5)]['clone'](_0x109478['viewport'],scratchRectangle);const _0x385202=_0x109478[_0x376ff6(_0x235bb0._0x230c01)][_0x376ff6(_0x235bb0._0x2e5f4b)](scratchRectangle,_0x109478['viewport']);_0x26ba69[_0x376ff6(_0x235bb0._0x4f247f)]['disableThisFrame'](),_0x26ba69['updateFrameState'](),_0x14e44f[_0x376ff6(0x9da)]=![],_0x14e44f[_0x376ff6(_0x235bb0._0x1870f8)]['pick']=!![],_0x14e44f['passes']['offscreen']=!![],_0x14e44f['tilesetPassState']=pickTilesetPassState,_0x4c3794['update'](_0x14e44f),_0x26ba69[_0x376ff6(0xc15)](),_0x26ba69[_0x376ff6(0x872)](_0x385202,scratchColorZero),_0x26ba69['resolveFramebuffers'](_0x385202);let _0x128439;if(Cesium__namespace['defined'](_0x109478['camera'][_0x376ff6(_0x235bb0._0x879c75)][_0x376ff6(0xc1)]))_0x128439=_0x109478['camera']['frustum']['clone'](scratchPerspectiveFrustum$1);else{if(Cesium__namespace['defined'](_0x109478[_0x376ff6(0x7d)]['frustum']['infiniteProjectionMatrix']))_0x128439=_0x109478[_0x376ff6(_0x235bb0._0x1f25c5)]['frustum']['clone'](scratchPerspectiveOffCenterFrustum$1);else Cesium__namespace['defined'](_0x109478[_0x376ff6(0x7d)]['frustum']['width'])?_0x128439=_0x109478['camera'][_0x376ff6(0x19c)]['clone'](scratchOrthographicFrustum$1):_0x128439=_0x109478['camera']['frustum']['clone'](scratchOrthographicOffCenterFrustum$1);}const _0x3fc570=new Array(_0x11b141);for(let _0x29fbb3=0x0;_0x29fbb3<_0x11b141;_0x29fbb3++){_0x3fc570[_0x29fbb3]=new Array(_0x11b141);}if(_0x4d212a['depthTexture']){const _0x470046=_0x69d412['getPickDepth'](_0x26ba69,0x0),_0x4a691a=getDepth(_0x4d212a,0x0,0x0,_0x11b141,_0x11b141,_0x470046);for(let _0x5d2430=0x0;_0x5d2430<_0x4a691a[_0x376ff6(0xe1e)];_0x5d2430++){const _0xb11be=_0x4a691a[_0x5d2430];if(_0xb11be>0x0&&_0xb11be<0x1){const _0x3e5600=_0x109478[_0x376ff6(0x729)][0x0];if(!_0x3e5600)continue;const _0x599642=Math['floor'](_0x5d2430/_0x11b141),_0x3a11f9=_0x5d2430%_0x11b141;_0x128439['near']=_0x3e5600['near']*_0x26ba69['opaqueFrustumNearOffset'],_0x128439['far']=_0x3e5600['far'],_0x4c3794['updateFrustum'](_0x128439);const _0x2bbea4=Cesium__namespace[_0x376ff6(_0x235bb0._0x28850a)]['drawingBufferToWgs84Coordinates'](_0x26ba69,new Cesium__namespace['Cartesian2'](_0x3a11f9,_0x599642),_0xb11be,new Cesium__namespace[(_0x376ff6(0x8eb))]());_0x3fc570[_0x3a11f9][_0x599642]=_0x2bbea4;}}}return _0x26ba69[_0x376ff6(0x5c1)]=_0x26ba69[_0x376ff6(_0x235bb0._0x5a32f5)],_0x4d212a['endFrame'](),_0x3fc570;}function centerOfMass(_0x675a2b,_0x54e13d){const _0x37aeb2={_0x58dab0:0xcf,_0x1be643:0x176},_0xb9840b=_0x35a251;if(!_0x675a2b||_0x675a2b['length']===0x0)return;const _0x4c88ed=LngLatArray[_0xb9840b(_0x37aeb2._0x58dab0)](_0x675a2b);try{if(_0x4c88ed['length']===0x1)return _0x4c88ed[0x0];else{if(_0x4c88ed['length']===0x2)return getMidpoint(_0x4c88ed[0x0],_0x4c88ed[0x1]);}_0x54e13d==null&&(_0x54e13d=getMaxHeight(_0x4c88ed));const _0x46fc91=Cesium__namespace['Rectangle']['fromCartesianArray'](_0x4c88ed),_0x517c7c=Cesium__namespace['Rectangle'][_0xb9840b(_0x37aeb2._0x1be643)](_0x46fc91),_0x4595da=Cesium__namespace['Cartesian3']['fromRadians'](_0x517c7c[_0xb9840b(0xc26)],_0x517c7c['latitude'],_0x54e13d);return _0x4595da;}catch(_0xcd0caa){return _0x4c88ed[Math['floor'](_0x4c88ed['length']/0x2)];}}function buffer(_0x449582,_0x5864ca=0x1,_0x25dde7=0x8){const _0x40bd60={_0x25e96c:0xa0b,_0x351800:0xcee},_0x2da4e7=_0x35a251;try{var _0x1bcecf,_0x3b56f6;if(((_0x1bcecf=_0x449582)===null||_0x1bcecf===void 0x0?void 0x0:(_0x3b56f6=_0x1bcecf['geometry'])===null||_0x3b56f6===void 0x0?void 0x0:_0x3b56f6['type'])===_0x2da4e7(_0x40bd60._0x25e96c)){const _0x2203bd=_0x449582['geometry'][_0x2da4e7(0x310)][0x0],_0x50712f=_0x2203bd[0x0],_0x514ad2=_0x2203bd[_0x2203bd['length']-0x1];(_0x50712f[0x0]!==_0x514ad2[0x0]||_0x50712f[0x1]!==_0x514ad2[0x1])&&_0x2203bd['push'](_0x50712f);}_0x449582=buffer$1(_0x449582,_0x5864ca,{'units':'meters','steps':_0x25dde7});}catch(_0x84f526){logError$1(_0x2da4e7(_0x40bd60._0x351800),_0x84f526);}return _0x449582;}function bufferPoints(_0x396668,_0x52921b=0x1,_0x3c10ad=0x8){const _0x583912={_0x123cc2:0xe1e},_0x3c78d3=_0x35a251;try{const _0x289000=LngLatArray['toArray'](_0x396668),_0x356c7f=_0x289000[0x0],_0x3d8895=_0x289000[_0x289000[_0x3c78d3(_0x583912._0x123cc2)]-0x1];(_0x356c7f[0x0]!==_0x3d8895[0x0]||_0x356c7f[0x1]!==_0x3d8895[0x1])&&_0x289000['push'](_0x289000[0x0]);const _0x1e5d98={'type':'Feature','geometry':{'type':'Polygon','coordinates':[_0x289000]}},_0x33c349=buffer$1(_0x1e5d98,_0x52921b,{'units':'meters','steps':_0x3c10ad});return LngLatArray[_0x3c78d3(0xb17)](_0x33c349[_0x3c78d3(0x58f)]['coordinates'][0x0]);}catch(_0x4cbb9e){logError$1('PolyUtil\x20buffer:缓冲分析异常',_0x4cbb9e);}return _0x396668;}function getGranularity(_0x4adce0,_0x3b9a77=0xa){const _0x255807=Cesium__namespace['Rectangle']['fromCartesianArray'](LngLatArray['toCartesians'](_0x4adce0));let _0x5c9839=Math['max'](_0x255807['height'],_0x255807['width']);return _0x5c9839/=_0x3b9a77,_0x5c9839;}function interPolygon(_0x1e3cc3){const _0x546cc4={_0x564d84:0xc60,_0x81a071:0xb35},_0x339b0d={_0x23b997:0xe1e,_0x3e7c62:0x523,_0x3e8518:0x523,_0x2851f8:0x6de,_0x3d99cc:0xb61,_0x2f3b81:0xea3,_0x91563d:0xea3},_0x2b602c=_0x35a251,_0x3fbc2e=_0x1e3cc3[_0x2b602c(_0x546cc4._0x564d84)],_0x17f88e=LngLatArray['toCartesians'](_0x1e3cc3[_0x2b602c(_0x546cc4._0x81a071)],!![]),_0x5c2725=getGranularity(_0x17f88e,_0x1e3cc3['splitNum']);return new Promise((_0x64bbbc,_0x4b709b)=>{setTimeout(()=>{const _0xe58a25={_0x518a41:0xb35,_0x107e95:0x6de},_0x1c9ff2={_0x39f9e4:0x9b1,_0x495e5e:0xc26,_0x382a62:0x8eb,_0x3c144e:0x175},_0x7c3949=_0x2767,_0x3f294a=[],_0x1e7682=new Cesium__namespace['PolygonGeometry']['fromPositions']({'positions':_0x17f88e,'vertexFormat':Cesium__namespace['PerInstanceColorAppearance']['FLAT_VERTEX_FORMAT'],'granularity':_0x5c2725}),_0x2d4dd0=new Cesium__namespace['PolygonGeometry']['createGeometry'](_0x1e7682);let _0x38f1bd,_0x508202,_0x8c3769,_0x41c8a4,_0x174c22,_0x4e0d57;for(let _0x2f7533=0x0;_0x2f7533<_0x2d4dd0['indices'][_0x7c3949(_0x339b0d._0x23b997)];_0x2f7533+=0x3){_0x38f1bd=_0x2d4dd0[_0x7c3949(0x9b)][_0x2f7533],_0x508202=_0x2d4dd0['indices'][_0x2f7533+0x1],_0x8c3769=_0x2d4dd0['indices'][_0x2f7533+0x2],_0x41c8a4=new Cesium__namespace['Cartesian3'](_0x2d4dd0[_0x7c3949(_0x339b0d._0x3e7c62)]['position']['values'][_0x38f1bd*0x3],_0x2d4dd0['attributes']['position']['values'][_0x38f1bd*0x3+0x1],_0x2d4dd0[_0x7c3949(_0x339b0d._0x3e8518)]['position']['values'][_0x38f1bd*0x3+0x2]),_0x3f294a[_0x7c3949(_0x339b0d._0x2851f8)](_0x41c8a4),_0x174c22=new Cesium__namespace['Cartesian3'](_0x2d4dd0[_0x7c3949(0x523)]['position']['values'][_0x508202*0x3],_0x2d4dd0['attributes']['position']['values'][_0x508202*0x3+0x1],_0x2d4dd0[_0x7c3949(0x523)][_0x7c3949(_0x339b0d._0x3d99cc)][_0x7c3949(_0x339b0d._0x2f3b81)][_0x508202*0x3+0x2]),_0x3f294a['push'](_0x174c22),_0x4e0d57=new Cesium__namespace['Cartesian3'](_0x2d4dd0['attributes']['position']['values'][_0x8c3769*0x3],_0x2d4dd0[_0x7c3949(0x523)]['position'][_0x7c3949(_0x339b0d._0x91563d)][_0x8c3769*0x3+0x1],_0x2d4dd0['attributes']['position']['values'][_0x8c3769*0x3+0x2]),_0x3f294a['push'](_0x4e0d57);}let _0x27b31b=0x0,_0x5e176d=0x270f;const _0x5291a3=_0x1e3cc3['onlyPoint']??![];function _0x190673(_0x4220c1,_0xb1dec8){const _0x1a168a=_0x7c3949;let _0x16e16a,_0x51f697,_0x581679,_0x489799;return _0xb1dec8?(delete _0x1e3cc3[_0x1a168a(0xa9b)],_0x16e16a=getHeight(_0x3fbc2e,_0x4220c1,_0x1e3cc3),_0x489799=Cesium__namespace['Cartographic'][_0x1a168a(_0x1c9ff2._0x39f9e4)](_0x4220c1),_0x51f697=Cesium__namespace['Cartesian3']['fromRadians'](_0x489799['longitude'],_0x489799['latitude'],0x0),_0x581679=Cesium__namespace['Cartesian3']['fromRadians'](_0x489799[_0x1a168a(_0x1c9ff2._0x495e5e)],_0x489799['latitude'],_0x16e16a)):(_0x489799=Cesium__namespace['Cartographic']['fromCartesian'](_0x4220c1),_0x16e16a=_0x489799['height'],_0x51f697=Cesium__namespace[_0x1a168a(_0x1c9ff2._0x382a62)][_0x1a168a(_0x1c9ff2._0x3c144e)](_0x489799['longitude'],_0x489799['latitude'],0x0),_0x581679=_0x4220c1),_0x27b31b<_0x16e16a&&(_0x27b31b=_0x16e16a),_0x5e176d>_0x16e16a&&(_0x5e176d=_0x16e16a),{'height':_0x16e16a,'point':_0x51f697,'pointDM':_0x581679};}function _0x1d6473(_0x416938){const _0x212e70=_0x7c3949,_0xf3f20f=[];let _0x58469a,_0x5159a7,_0x2d83f2;for(let _0x148202=0x0;_0x148202<_0x416938[_0x212e70(_0xe58a25._0x518a41)]['length'];_0x148202+=0x3){_0x58469a=_0x190673(_0x416938['positions'][_0x148202],_0x416938['noHeight']),_0x5159a7=_0x190673(_0x416938[_0x212e70(_0xe58a25._0x518a41)][_0x148202+0x1],_0x416938['noHeight']),_0x2d83f2=_0x190673(_0x416938['positions'][_0x148202+0x2],_0x416938['noHeight']),_0x5291a3?(addPointFoyArrOnly(_0xf3f20f,_0x58469a),addPointFoyArrOnly(_0xf3f20f,_0x5159a7),addPointFoyArrOnly(_0xf3f20f,_0x2d83f2)):_0xf3f20f[_0x212e70(_0xe58a25._0x107e95)]({'point1':_0x58469a,'point2':_0x5159a7,'point3':_0x2d83f2});}Cesium__namespace['defined'](_0x1e3cc3['minHeight'])&&(_0x5e176d=Math['max'](_0x1e3cc3['minHeight'],_0x5e176d),_0x27b31b=Math['max'](_0x27b31b,_0x5e176d)),_0x416938[_0x212e70(0x4ea)]=_0x5c2725,_0x416938['maxHeight']=_0x27b31b,_0x416938['minHeight']=_0x5e176d,_0x416938['list']=_0xf3f20f,_0x1e3cc3['callback']&&_0x1e3cc3['callback'](_0x416938),_0x64bbbc(_0x416938);}_0x1e3cc3['exact']?computeSurfacePoints({'scene':_0x3fbc2e,'positions':_0x3f294a,'has3dtiles':_0x1e3cc3['has3dtiles'],'exact':_0x1e3cc3['exact']})['then'](_0x1d6473):_0x1d6473({'positions':_0x3f294a,'noHeight':!![],'has3dtiles':_0x1e3cc3['has3dtiles'],'hasTerrain':_0x1e3cc3[_0x7c3949(0x234)]});},0x32);});}function addPointFoyArrOnly(_0x279432,_0x5a9131){const _0x50733c={_0x146576:0xe1e},_0x3df8b7=_0x35a251;let _0x14eb25=![];const _0x29be87=_0x5a9131['point'];for(let _0x133c14=0x0;_0x133c14<_0x279432[_0x3df8b7(_0x50733c._0x146576)];_0x133c14++){const _0x2e5617=_0x279432[_0x133c14]['point'];if(_0x29be87['x']===_0x2e5617['x']&&_0x29be87['y']===_0x2e5617['y']&&_0x29be87['z']===_0x2e5617['z']){_0x14eb25=!![];break;}}!_0x14eb25&&_0x279432['push'](_0x5a9131);}function getHeightRange(_0x2a2f4f,_0x344b42,_0x52a011){return interPolygon({'positions':_0x2a2f4f,'scene':_0x344b42,..._0x52a011});}function getTriangleArea$1(_0x364303,_0x232d08,_0x39eb13){const _0x592b44=_0x35a251,_0x5af398=Cesium__namespace[_0x592b44(0x8eb)]['distance'](_0x364303,_0x232d08),_0x5e8b57=Cesium__namespace['Cartesian3']['distance'](_0x232d08,_0x39eb13),_0x17c091=Cesium__namespace['Cartesian3']['distance'](_0x39eb13,_0x364303),_0x3eff95=(_0x5af398+_0x5e8b57+_0x17c091)/0x2;return Math['sqrt'](_0x3eff95*(_0x3eff95-_0x5af398)*(_0x3eff95-_0x5e8b57)*(_0x3eff95-_0x17c091));}function computeVolume(_0x3d79d6){return interPolygon(_0x3d79d6)['then'](_0x3c4b45=>{return updateVolumeByMinHeight(_0x3c4b45);});}function updateVolumeByMinHeight(_0x2112c4){const _0x93153b={_0x4a3442:0x655},_0x215b3e=_0x35a251,_0x560460=_0x2112c4[_0x215b3e(0x543)];let _0x3769ee=0x0,_0x3498ee=0x0;for(let _0x41a2af=0x0,_0x303006=_0x2112c4[_0x215b3e(0xb69)]['length'];_0x41a2af<_0x303006;_0x41a2af++){const _0x126a1c=_0x2112c4['list'][_0x41a2af],_0x30619e=_0x126a1c['point1'],_0x3ce8a9=_0x126a1c[_0x215b3e(_0x93153b._0x4a3442)],_0x45cebc=_0x126a1c['point3'],_0x3cedfc=getTriangleArea$1(_0x30619e['point'],_0x3ce8a9[_0x215b3e(0x1ba)],_0x45cebc['point']);_0x126a1c['area']=_0x3cedfc,_0x3769ee+=_0x3cedfc;let _0x182084=_0x30619e['height'],_0x11fb3b=_0x3ce8a9['height'],_0x513bcc=_0x45cebc['height'];_0x182084<_0x560460&&(_0x182084=_0x560460);_0x11fb3b<_0x560460&&(_0x11fb3b=_0x560460);_0x513bcc<_0x560460&&(_0x513bcc=_0x560460);const _0xc4c934=_0x3cedfc*(_0x182084-_0x560460+_0x11fb3b-_0x560460+_0x513bcc-_0x560460)/0x3;_0x126a1c['cutVolume']=_0xc4c934,_0x3498ee=_0x3498ee+_0xc4c934;}return _0x2112c4['totalArea']=_0x3769ee,_0x2112c4['totalVolume']=_0x3498ee,_0x2112c4;}function updateVolume(_0x5f0b94,_0x31c4f6){const _0x162153={_0x368c2:0xe1e},_0x12855e=_0x35a251;if(!_0x5f0b94)return;const _0x577367=_0x5f0b94['minHeight'],_0x425cae=_0x5f0b94['totalVolume'];if(_0x31c4f6<=_0x577367)return _0x5f0b94['fillVolume']=0x0,_0x5f0b94['digVolume']=_0x425cae,_0x5f0b94;let _0x217c41=0x0,_0x333dcc=0x0;for(let _0x28273d=0x0,_0x404f11=_0x5f0b94['list'][_0x12855e(_0x162153._0x368c2)];_0x28273d<_0x404f11;_0x28273d++){const _0xb03e6f=_0x5f0b94['list'][_0x28273d];_0x217c41+=_0xb03e6f['area']*(_0x31c4f6-_0x577367);const _0x3b6d40=_0xb03e6f['point1'],_0x4166b7=_0xb03e6f['point2'],_0x27362e=_0xb03e6f['point3'];let _0x55231e=_0x3b6d40[_0x12855e(0x682)],_0x50c85c=_0x4166b7['height'],_0x396495=_0x27362e['height'];_0x55231e<_0x31c4f6&&(_0x55231e=_0x31c4f6),_0x50c85c<_0x31c4f6&&(_0x50c85c=_0x31c4f6),_0x396495<_0x31c4f6&&(_0x396495=_0x31c4f6),_0x333dcc+=_0xb03e6f['area']*(_0x55231e-_0x31c4f6+_0x50c85c-_0x31c4f6+_0x396495-_0x31c4f6)/0x3;}return _0x5f0b94['digVolume']=_0x333dcc,_0x5f0b94['fillVolume']=_0x217c41-(_0x425cae-_0x333dcc),_0x5f0b94;}function getEllipseOuterPositions(_0x418ece){const _0x17dd84={_0x5846d3:0xb61,_0x5a7560:0xb7a,_0x1e772d:0xabc,_0x1805c8:0xe1e},_0x492f98=_0x35a251;let _0x449435=_0x418ece[_0x492f98(_0x17dd84._0x5846d3)];if(!_0x449435)return null;_0x449435=LngLatPoint['toCartesian'](_0x449435);const _0x24f984=_0x418ece[_0x492f98(0x76a)]??_0x418ece[_0x492f98(0x907)],_0x4344f7=_0x418ece['semiMinorAxis']??_0x418ece[_0x492f98(0x907)];if(!_0x24f984||!_0x4344f7)return[_0x449435,_0x449435,_0x449435];const _0x4eae86=_0x418ece[_0x492f98(_0x17dd84._0x5a7560)]??0x0;let _0x25d0ca=_0x418ece['granularity']||Cesium__namespace['Math'][_0x492f98(_0x17dd84._0x1e772d)];_0x418ece['count']&&(_0x25d0ca=Math['PI']/(0x10*_0x418ece['count']));const _0x2d2848=Cesium__namespace['EllipseGeometryLibrary']['computeEllipsePositions']({'center':_0x449435,'semiMajorAxis':_0x24f984,'semiMinorAxis':_0x4344f7,'rotation':_0x4eae86,'granularity':_0x25d0ca},!![],!![]),_0x54d436=_0x2d2848['outerPositions'],_0x408d3e=[];for(let _0x4d1d66=0x0,_0x3d1449=_0x54d436[_0x492f98(_0x17dd84._0x1805c8)];_0x4d1d66<_0x3d1449;_0x4d1d66+=0x3){const _0x3d6848=new Cesium__namespace['Cartesian3'](_0x54d436[_0x4d1d66],_0x54d436[_0x4d1d66+0x1],_0x54d436[_0x4d1d66+0x2]);_0x408d3e['push'](_0x3d6848);}return _0x408d3e;}function _0x398f(){const _0x5e3c3b=['createDragger','_hasRemoveByMapSplit','_ready','moveForward','clockTick','Ellipsoid','_arrData','editAddPoint','dimian.length','toFixed','getNextLayerId','deleteLayer','enablePickFeatures','maximumClockDegree','BloomEffectYes','%\x27\x20','unpackInterpolationResult','CTRL','_promise','EPSG:4545','_container_outer','_setViewerOption','_reflectorViewMatrix','_hasMapInit','frameState','uniform\x20vec4\x20bgColor;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20vec3\x20fragColor\x20=\x20color.rgb;\x0a\x20\x20if(st.t\x20>\x200.45\x20&&\x20st.t\x20<\x200.55)\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec3(1.0);\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x201.5\x20*\x20smoothstep(.0,\x201.,\x20fract(st.s\x20-\x20time));\x0a\x20\x20material.diffuse\x20=\x20max(fragColor.rgb\x20*\x20material.alpha,\x20fragColor.rgb);\x0a\x0a\x20\x20if(material.alpha\x20<\x20bgColor.a)\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20bgColor.a;\x0a\x20\x20\x20\x20material.diffuse\x20=\x20bgColor.rgb;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20material.alpha\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a','match','animation','#D33038','_moveMaxHeight','_onEventHook','zoom','Stereographic_North_Pole','editHeight','clock_onTickHandler','prepareTexture','EPSG:4526','minimumCollisionTerrainHeight','hdr','hasShadows','Color','单指拖动','_orbitIsLook','lowerLongitude','closeOnClick','+proj=tmerc\x20+lat_0=0\x20+lon_0=90\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_hasUpdate_modelMatrix','MultiPolygon','updateMatrix','fromUniformScale','_contourWidth','onTimelineScrubfunction','pixelStorei','unpack','TdtPOI\x20请求出错','reflectorProjectionMatrix','WGS84','102113','0px','enableRotate','filterColor','HOLD','showArea','_surface','_getFixedFrameToEastNorthUpTransformFromWorldMatrix','cndesc','fromRotationTranslation','_point','_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer=','material_bak','FeatureCollection','width','_updateMoveAllHook','innerHTML','mousedown','_updateDrawEntityToThis','_last_success','FLOAT','neckWidthFactor','bern','billboardStyleConver','_createGeometryInstanceItem','Lambert_Azimuthal_Equal_Area','LINEAR','Quadrilateralized\x20Spherical\x20Cube','hiddenAreaColor','EPSG3857','EPSG:4547','Point','HAS_NORMAL_MARS3D','_onMap_mouseMove','isProperty','outlineWidth','+proj=tmerc\x20+lat_0=0\x20+lon_0=102\x20+k=1\x20+x_0=34500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','addColorStop','availability','middle','_sceneEvent','phic0','_moveDistanceStep','_wall_positions','imageryLayers','majorDragger','followedX','_camera_cache','parameters','_last_contextmenuConfig','该对象不允许编辑','ready','filename','_map_clockStopTickHandler','pick3DTileset','polylineC','Greek_Geodetic_Reference_System_1987','acos','HALF_FLOAT','defer','showResult','fetchJson出错了','Fischer\x201960','_errorEvent','cosb1','scene\x20is\x20required.','vertexArray','moveTimer','boderColor','multiplyByVector','_last_clickPositionX','WebGL发生渲染错误,渲染已经停止,请刷新页面。','ceil','getCenter','_关闭日照阴影','_virtualCamera','setPositions','取消锁定','zoomFactor','Clarke\x201866','far','_initChildGraphic','graphic','fa\x20fa-connectdevelop','cos_p12','Soviet\x20Geodetic\x20System\x2085','LEFT_DOWN','number','_labelEl','VerticalOrigin','distanceMeasure','</div>','_state','gradient','PathStyleConver','tilesetLayer','Additive','stop','bidirectional','numberOfDerivatives','minDistance','请确认高度是非零数值!','fps','cesium-navigation-button-right','removeChild','left','_updateEntityOpacity','_createFramebuffer','_toJSONValBefore','lng','_frustum','worldToCameraCoordinatesPoint','removeEffect','types','stopMoveBackward','projection','Right\x20click\x20menu\x20to\x20delete','removeNearPoint','_opacity','FIXED','pixelOffset_original','localStorage','click','crsy','DrawCircle','_开启黑白','createMaterialProperty:未找到该类型的对应材质属性','_msFrameCount','proj4','leftLayer','lineColor','10000','getPropertyNames','quoted','_bindEvent','_initByMars3D','_depthTestAgainstTerrain_reset','mod_airy','uniform\x20bool\x20u_showIntersection;\x0auniform\x20bool\x20u_showThroughEllipsoid;\x0a\x0auniform\x20float\x20u_radius;\x0auniform\x20float\x20u_xHalfAngle;\x0auniform\x20float\x20u_yHalfAngle;\x0auniform\x20float\x20u_normalDirection;\x0auniform\x20float\x20u_type;\x0a\x0ain\x20vec3\x20v_position;\x0ain\x20vec3\x20v_positionWC;\x0ain\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0a\x0avec4\x20getColor(float\x20sensorRadius,\x20vec3\x20pointEC)\x20{\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x0a\x20\x20vec3\x20pointMC\x20=\x20(czm_inverseModelView\x20*\x20vec4(pointEC,\x201.0)).xyz;\x0a\x20\x20materialInput.st\x20=\x20sensor2dTextureCoordinates(sensorRadius,\x20pointMC);\x0a\x20\x20materialInput.str\x20=\x20pointMC\x20/\x20sensorRadius;\x0a\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20materialInput.normalEC\x20=\x20u_normalDirection\x20*\x20normalEC;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x20\x20\x20\x20//\x20czm_lightDirectionEC在cesium1.66开始加入的\x0a\x20\x20return\x20mix(czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC),\x20vec4(material.diffuse,\x20material.alpha),\x200.4);\x0a\x0a}\x0a\x0abool\x20isOnBoundary(float\x20value,\x20float\x20epsilon)\x20{\x0a\x20\x20float\x20width\x20=\x20getIntersectionWidth();\x0a\x20\x20float\x20tolerance\x20=\x20width\x20*\x20epsilon;\x0a\x0a\x20\x20float\x20delta\x20=\x20max(abs(dFdx(value)),\x20abs(dFdy(value)));\x0a\x20\x20float\x20pixels\x20=\x20width\x20*\x20delta;\x0a\x20\x20float\x20temp\x20=\x20abs(value);\x0a\x20\x20return\x20temp\x20<\x20tolerance\x20&&\x20temp\x20<\x20pixels\x20||\x20(delta\x20<\x2010.0\x20*\x20tolerance\x20&&\x20temp\x20-\x20delta\x20<\x20tolerance\x20&&\x20temp\x20<\x20pixels);\x0a}\x0a\x0avec4\x20shade(bool\x20isOnBoundary)\x20{\x0a\x20\x20if(u_showIntersection\x20&&\x20isOnBoundary)\x20{\x0a\x20\x20\x20\x20return\x20getIntersectionColor();\x0a\x20\x20}\x0a\x20\x20if(u_type\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20return\x20getLineColor();\x0a\x20\x20}\x0a\x20\x20return\x20getColor(u_radius,\x20v_positionEC);\x0a}\x0a\x0afloat\x20ellipsoidSurfaceFunction(vec3\x20point)\x20{\x0a\x20\x20vec3\x20scaled\x20=\x20czm_ellipsoidInverseRadii\x20*\x20point;\x0a\x20\x20return\x20dot(scaled,\x20scaled)\x20-\x201.0;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20sensorVertexWC\x20=\x20czm_model[3].xyz;\x20\x20\x20\x20\x20\x20//\x20(0.0,\x200.0,\x200.0)\x20in\x20model\x20coordinates\x0a\x0a\x20\x20float\x20positionX\x20=\x20v_position.x;\x0a\x20\x20float\x20positionY\x20=\x20v_position.y;\x0a\x20\x20float\x20positionZ\x20=\x20v_position.z;\x0a\x0a\x20\x20vec3\x20zDir\x20=\x20vec3(0.0,\x200.0,\x201.0);\x0a\x20\x20vec3\x20lineX\x20=\x20vec3(positionX,\x200,\x20positionZ);\x0a\x20\x20vec3\x20lineY\x20=\x20vec3(0,\x20positionY,\x20positionZ);\x0a\x20\x20float\x20resX\x20=\x20dot(normalize(lineX),\x20zDir);\x0a\x20\x20if(resX\x20<\x20cos(u_xHalfAngle)\x20-\x200.00001)\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20float\x20resY\x20=\x20dot(normalize(lineY),\x20zDir);\x0a\x20\x20if(resY\x20<\x20cos(u_yHalfAngle)\x20-\x200.00001)\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x0a\x20\x20float\x20ellipsoidValue\x20=\x20ellipsoidSurfaceFunction(v_positionWC);\x0a\x20\x20if(!u_showThroughEllipsoid)\x20{\x0a\x20\x20\x20\x20if(ellipsoidValue\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(inSensorShadow(sensorVertexWC,\x20v_positionWC))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20bool\x20isOnEllipsoid\x20=\x20isOnBoundary(ellipsoidValue,\x20czm_epsilon3);\x0a\x20\x20out_FragColor\x20=\x20shade(isOnEllipsoid);\x0a}\x0a','tmerc','{s}','clrk66','style','uniform\x20float\x20mars3d_xAngle;\x0auniform\x20float\x20mars3d_yAngle;\x0auniform\x20float\x20mars3d_distance;\x0auniform\x20float\x20mars3d_opacity;\x0a\x0auniform\x20vec3\x20mars3d_visibleAreaColor;\x0auniform\x20vec3\x20mars3d_hiddenAreaColor;\x0a\x0auniform\x20sampler2D\x20shadowMap_texture;\x0auniform\x20mat4\x20shadowMap_matrix;\x0auniform\x20vec4\x20shadowMap_lightPositionEC;\x0auniform\x20vec4\x20shadowMap_lightDirectionEC;\x0auniform\x20vec3\x20shadowMap_lightUp;\x0auniform\x20vec3\x20shadowMap_lightDir;\x0auniform\x20vec3\x20shadowMap_lightRight;\x0auniform\x20vec4\x20shadowMap_texelSizeDepthBias;\x0auniform\x20vec4\x20shadowMap_normalOffsetScale;\x0a\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0a\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0afloat\x20_czm_sampleShadowMap(sampler2D\x20shadowMap,\x20vec2\x20uv)\x20{\x0a\x20\x20return\x20texture(shadowMap,\x20uv).r;\x0a}\x0afloat\x20_czm_shadowDepthCompare(sampler2D\x20shadowMap,\x20vec2\x20uv,\x20float\x20depth)\x20{\x0a\x20\x20return\x20step(depth,\x20_czm_sampleShadowMap(shadowMap,\x20uv));\x0a}\x0afloat\x20_czm_shadowVisibility(sampler2D\x20shadowMap,\x20czm_shadowParameters\x20shadowParameters)\x20{\x0a\x20\x20float\x20depthBias\x20=\x20shadowParameters.depthBias;\x0a\x20\x20float\x20depth\x20=\x20shadowParameters.depth;\x0a\x20\x20float\x20nDotL\x20=\x20shadowParameters.nDotL;\x0a\x20\x20float\x20normalShadingSmooth\x20=\x20shadowParameters.normalShadingSmooth;\x0a\x20\x20float\x20darkness\x20=\x20shadowParameters.darkness;\x0a\x20\x20vec2\x20uv\x20=\x20shadowParameters.texCoords;\x0a\x20\x20depth\x20-=\x20depthBias;\x0a\x20\x20vec2\x20texelStepSize\x20=\x20shadowParameters.texelStepSize;\x0a\x20\x20float\x20radius\x20=\x201.0;\x0a\x20\x20float\x20dx0\x20=\x20-texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy0\x20=\x20-texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20dx1\x20=\x20texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy1\x20=\x20texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20visibility\x20=\x20(_czm_shadowDepthCompare(shadowMap,\x20uv,\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy1),\x20depth))\x20*\x20(1.0\x20/\x209.0);\x0a\x20\x20return\x20visibility;\x0a}\x0a\x0avec3\x20pointProjectOnPlane(in\x20vec3\x20planeNormal,\x20in\x20vec3\x20planeOrigin,\x20in\x20vec3\x20point)\x20{\x0a\x20\x20vec3\x20v01\x20=\x20point\x20-\x20planeOrigin;\x0a\x20\x20float\x20d\x20=\x20dot(planeNormal,\x20v01);\x0a\x20\x20return\x20(point\x20-\x20planeNormal\x20*\x20d);\x0a}\x0afloat\x20ptm(vec3\x20pt)\x20{\x0a\x20\x20return\x20sqrt(pt.x\x20*\x20pt.x\x20+\x20pt.y\x20*\x20pt.y\x20+\x20pt.z\x20*\x20pt.z);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20const\x20float\x20PI\x20=\x203.141592653589793;\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20czm_shadowParameters\x20shadowParameters;\x0a\x20\x20shadowParameters.texelStepSize\x20=\x20shadowMap_texelSizeDepthBias.xy;\x0a\x20\x20shadowParameters.depthBias\x20=\x20shadowMap_texelSizeDepthBias.z;\x0a\x20\x20shadowParameters.normalShadingSmooth\x20=\x20shadowMap_texelSizeDepthBias.w;\x0a\x20\x20shadowParameters.darkness\x20=\x20shadowMap_normalOffsetScale.w;\x0a\x20\x20shadowParameters.depthBias\x20*=\x20max(depth\x20*\x200.01,\x201.0);\x0a\x0a\x20\x20vec3\x20directionEC\x20=\x20normalize(positionEC.xyz\x20-\x20shadowMap_lightPositionEC.xyz);\x0a\x20\x20float\x20nDotL\x20=\x20clamp(dot(normalEC,\x20-directionEC),\x200.0,\x201.0);\x0a\x20\x20vec4\x20shadowPosition\x20=\x20shadowMap_matrix\x20*\x20positionEC;\x0a\x20\x20shadowPosition\x20/=\x20shadowPosition.w;\x0a\x20\x20if(any(lessThan(shadowPosition.xyz,\x20vec3(0.0)))\x20||\x20any(greaterThan(shadowPosition.xyz,\x20vec3(1.0))))\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//坐标与视点位置距离,大于最大距离则舍弃阴影效果\x0a\x20\x20vec4\x20lw\x20=\x20czm_inverseView\x20*\x20vec4(shadowMap_lightPositionEC.xyz,\x201.0);\x0a\x20\x20vec4\x20vw\x20=\x20czm_inverseView\x20*\x20vec4(positionEC.xyz,\x201.0);\x0a\x20\x20if(distance(lw.xyz,\x20vw.xyz)\x20>\x20mars3d_distance)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//水平夹角限制\x0a\x20\x20vec3\x20ptOnSP\x20=\x20pointProjectOnPlane(shadowMap_lightUp,\x20lw.xyz,\x20vw.xyz);\x0a\x20\x20directionEC\x20=\x20ptOnSP\x20-\x20lw.xyz;\x0a\x20\x20float\x20directionECMO\x20=\x20ptm(directionEC.xyz);\x0a\x20\x20float\x20shadowMap_lightDirMO\x20=\x20ptm(shadowMap_lightDir.xyz);\x0a\x20\x20float\x20cosJJ\x20=\x20dot(directionEC,\x20shadowMap_lightDir)\x20/\x20(directionECMO\x20*\x20shadowMap_lightDirMO);\x0a\x20\x20float\x20degJJ\x20=\x20abs(acos(cosJJ)\x20*\x20(180.0\x20/\x20PI));\x0a\x20\x20if(degJJ\x20>\x20mars3d_xAngle)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//垂直夹角限制\x0a\x20\x20vec3\x20ptOnCZ\x20=\x20pointProjectOnPlane(shadowMap_lightRight,\x20lw.xyz,\x20vw.xyz);\x0a\x20\x20vec3\x20dirOnCZ\x20=\x20ptOnCZ\x20-\x20lw.xyz;\x0a\x20\x20float\x20dirOnCZMO\x20=\x20ptm(dirOnCZ);\x0a\x20\x20float\x20cosJJCZ\x20=\x20dot(dirOnCZ,\x20shadowMap_lightDir)\x20/\x20(dirOnCZMO\x20*\x20shadowMap_lightDirMO);\x0a\x20\x20float\x20degJJCZ\x20=\x20abs(acos(cosJJCZ)\x20*\x20(180.0\x20/\x20PI));\x0a\x20\x20if(degJJCZ\x20>\x20mars3d_yAngle)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20shadowParameters.texCoords\x20=\x20shadowPosition.xy;\x0a\x20\x20shadowParameters.depth\x20=\x20shadowPosition.z;\x0a\x20\x20shadowParameters.nDotL\x20=\x20nDotL;\x0a\x20\x20float\x20visibility\x20=\x20_czm_shadowVisibility(shadowMap_texture,\x20shadowParameters);\x0a\x0a\x20\x20//可视域\x0a\x20\x20if(visibility\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(mars3d_visibleAreaColor,\x201.0),\x20mars3d_opacity);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(mars3d_hiddenAreaColor,\x201.0),\x20mars3d_opacity);\x0a\x20\x20}\x0a}\x0a','eachGraphic','inverse','blur_y','camera','_draggerMove','size','getArrowBodyPoints','_primitive2','frequency','_log2FarDepthFromNearPlusOne','&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk=','_cubeMap2','animationTicks','layer','_removedBaseHook','offsetLeft','planeStyleConver','_updatePosition','Y_TRANSLATION','scanPlaneRate','False\x20easting','_sectorVA','vertex_L','maximumHeights','_enableScreenSpaceCameraController','timeline','uniform','_polyline_positions','_containerUl','AXIS','BAIDU','createImageryProvider:存在未识别的图层','POI\x20请求失败(','indices','startRate','EllipsoidalOccluder','spatialRel','VertexFormat','DistanceDisplayConditionGeometryInstanceAttribute','_farDepthFromNearPlusOne','prepareVAO','startDate','VERT_DATUM','_tikRender','hostname','_updateMaxMinHeights','DEPTH_STENCIL','imageryProviderViewModels','added','neutral','PlaneOutlineGeometry','_material_color_alpha','_initTilesetClip','showSkirts','mouseEvent','fromElements','_uniforms_color_alpha','EPSG:4497','_mergePostion','polygonStyleConver','topRadius','bindTexture','_globalAlpha','EPSG:4499','minimumHeights','_conversionStyle','XYZ','EPSG:4520','OBLIQ','onlyPickTerrainPosition','TextureWrap','fov','queryText','_idField','focalDistance','surfaceHeight','_graticuleProvider','editMouseDown','getTailPoints','_pitch_max','9xcFGnr','fromUrl','telephone','esriGeometryEnvelope','_graphicLayer_leftDown','toCartesians','eachThing','constructor','_pickCommands','S_POLE','Gunung\x20Segara\x20Jakarta','fillColor','Rectangle','_indice','_last_velocity','textureDef','_clipOutSide','bindUpdateEvent','u_0','OPAQUE','_poinst','_getKeywords','SampledProperty','_outlineEx','_navigationHelpButton','apa','wfs请求getMetadata出错','roiUV','highlightEnabled','getTileLayers','_cacheGrid','font_size','normalOffsetScale','dimensions_y','outlinePositions','exp','terrainLoadSuccess','ENLARGE','color()\x20*vec4(1,1,1,','_显示三角网','rotationDegree','getPoint','lineStyle','未处理参数','isEditing','onBeforeCreate','appearance','responseType','getInnerHTML','C_im','_mouseUpHandler','_地形服务','radius_g','_forPositionProperty','Material','spatialReference','LightingModel','gravity','_createI3SDataProvider','setCursor','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=16500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','PolylineVolumeOutlineGeometry','PolylineGeometry','isCombine','X_TRANSLATION','measure','getPositionByOrginMatrix','skyAtmosphere','sceneModePicker','hasRotateMatrix','lightColor','normalShadingSmooth','Alt','parentElement','_isComplete','_hasZIndex','fetchJson','Model','_setRectangleByOptions','long1','橫切面積','kilometers','featureIndex','_onClockTickHanlder','endDraw','_map_extentChangeHandler','Cartographic','_filterPOIData_circle','polygonWallStyle','YELLOW','_onRightUpHandler','beginPath','_rotate_onPreRenderHandler','_onRemove','noWhite','getRequiredDataPoints','_primitive3','classList','_oldPickedId','ArcGISTiledElevationTerrainProvider','getControl','_clampToGround_last','s45','author','maximumSize','_positions_CallbackProperty','mapChinaCRS','tag','maximumSizeX','wrapS','53002IduveY','reflectivity','Entity','.svg','wkid','updateBox','plane类型未识别','positionWC','postProcessStages','Geostationary\x20Satellite\x20View','_computedModelMatrix','_pointEx','px;','headHeightFactor','_metadataSuccess','radius_p','\x22\x20in\x20afterquote\x20yet,\x20index\x20','updateAttrForDrawing','_updateDomAttribute','distanceDisplayCondition_near','dynamicView','grids','osm','corners','pointP','_matrix3Scratch','horizontal','_moveActive','bind','createCommand','stopBounce','PolylineDashMaterialProperty','tileLoadProgressEvent','_initCollectionBy3D','className','ymin','contextmenu-icon','_getItemHtml','rightUp','rotatePoint','CheckerboardMaterialProperty','_last_shouldAnimate','code','_graphic','oddColor','mandatory','_updateOutlineToCallback','particleSize','FRONT','defaultView','+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=14500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','开启亮度','parentContainer','Opera','_highlight_mouseEventHandler','_mouseDownHandler','near','default','HorizontalOrigin','timeoutErrorMessage','WFS','fromRadians','center','getTooltip','_createCesium3DTileset','city_type','active','setCallbackPositions','android','_sceneOption','mars3d-container\x20\x20mars3d-mapCompare','unbindPopup','shadingAlpha','chordLength','update','300','stroke','json','disableEdit','Assets/Textures/NaturalEarthII','编辑时_map不能为空,请将对象添加到图层,并且图层已添加到Map','approx','CallbackProperty','currentTime','_positionTexture','pid','worldToModel','_heightReference','in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20globalAlpha;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20#endif\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20material.alpha\x20=\x20(mix(0.1,\x201.0,\x20clamp((1.0\x20-\x20st.t)\x20*\x20color.a,\x200.0,\x201.0))\x20+\x20(1.0\x20-\x20sign(st.t\x20-\x20czm_frameNumber\x20*\x200.001))\x20*\x200.2\x20+\x200.4)\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x0a\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20#endif\x0a}\x0a','COLUMBUS_VIEW','_tilesetFlood','_keyboardRoam','getMaxHeight','_enabledEvent','getTemplateHtml:格式化出错','rgba(4,194,201,0.3)','silhouetteAlpha','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<svg\x20width=\x2224\x22\x20height=\x2224\x22\x20viewBox=\x220\x200\x2048\x2048\x22\x20fill=\x22none\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22>\x0a\x20\x20<rect\x20width=\x2248\x22\x20height=\x2248\x22\x20fill=\x22white\x22\x20fill-opacity=\x220.01\x22/>\x0a\x20\x20<path\x20d=\x22M10.5\x2024L38.5\x2024\x22\x20stroke=\x22#ffffff\x22\x20stroke-width=\x225\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22/>\x0a</svg>','numberOfLevelZeroTilesY','<div><label>','frustum','localPos','_goHistoryView','viewport','_highlightAll','_last_planeGraphics','holes','_dataSource','moll','_updateMatrixMovePosition','randomColor','PerInstanceColorAppearance','updateModelMatrix','AREA_0','ColorMaterialProperty','_initByMetaData','hasUpdate','_lastMouseOverItem','getBoundingClientRect','tilesetMaxTotalMemory','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=18500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_updateControlHandler','sourceTarget','showFirstPage','_rate_positions','fa\x20fa-download','APL4','_primitive1','_positions_grid','_graphic_move_x','point','_polylineCollection','index','defineProperties','ImageryProvider','angleIsGreaterThanPi','minimumRadius','lock','region','innerRadii_x','_colorFramebuffer','color_bak','nightVisionEffect','_container2','minimumZoomDistance','query','_toCesiumValBefore','scale','keywords','cosrot','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=37500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','draggers','_position_draw','Hotine_Oblique_Mercator_Azimuth_Center','stere','_标记圆','_intersectionWidth','_matrixMove','\x20\x20like\x20\x27%','aspectRatio','font_family','LIGHTCYAN','_onMap_leftUp','xmax','cosph0','_update','_viewProjectionDirty','lineCount','_style2Json','stRotation','proceedCameraViewList','關閉拾取高亮','setCameraView','createIndexBuffer','stringify','page','onStop','EPSG:4509','{content}','updateText','_formatPOIData','_lng','remove','Picking','LEFT','_lastUpdate','关闭雾天气','_last_startTime','alpha','showSectorSegmentLines','_tooltipMgr','createLinearGradient','LEQUAL','createGeometry','extent','getAreaById','cartographicToCartesian','once','imageBottom','flyToByAnimationEnd','postUpdate','_onMouseOut','geometryName','bindVisibleDistance','transY','i3sNode','Naval\x20Weapons\x20Lab.,\x201965','_eventResult','startPosition','raiseToTop','fillText','_noDestroy','未处理的属性','AREA_2','replace','clockStop','_wrapper','PolylinePipeline','setStyle','pitPrimitive','osni_1952','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20title=\x22大地2000坐标\x22><label>纵坐标</label>','pixelFormat','result_type','outlineColor','_lastPickedInfo','transform','shouldAnimate','Primitive','eventType','_maxCanvasSize','hasContextMenu','UniformState','interpolationAlgorithm','_isStart','WMS','defaultDateFormatter','attackArrowYW','_postProcessStage','cursor','onEachFeature','_zoomFactor','_pickId','_frameTime','lineNumber','_last_graphicsOptions','geoJsonLayer_onClickHandler','globe','_smallTooltip','Close\x20snow','upperLongitude','outlineOpacity','hasTerrain','PolyWood','subdomains','trs','CENTER','depthFailColor','minimumLevel','now','_entitiesToVisualize','setPlanes','_inverseViewProjectionDirty','_showDomeSurfaces','apply','_textStyles','coordinate','interVal','_uniforms_baseWaterColor_alpha','allTilesLoaded','_updatePrimitiveOpacity','_sunlight','Cartesian2','_entity','44056GidGGl','\x0a#define\x20CZM_SELECTED_FEATURE\x0auniform\x20sampler2D\x20czm_selectedIdTexture;\x0auniform\x20float\x20czm_selectedIdTextureStep;\x0auniform\x20float\x20czm_selectedIdTextureWidth;\x0a\x0abool\x20czm_selected(vec4\x20id)\x20{\x0a\x20\x20bool\x20selected\x20=\x20false;\x0a\x20\x20for(int\x20i\x20=\x200;\x20i\x20<\x201024000;\x20i++)\x20{\x0a\x20\x20\x20\x20vec4\x20selectedId\x20=\x20texture(czm_selectedIdTexture,\x20vec2((float(i)\x20+\x200.5)\x20*\x20czm_selectedIdTextureStep,\x200.5));\x0a\x20\x20\x20\x20if(all(equal(id,\x20selectedId)))\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(float(i)\x20>\x20czm_selectedIdTextureWidth)\x0a\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20}\x0a\x20\x20return\x20false;\x0a}\x0a\x0a','高分辨率全球地形图块集由几个数据源组成,由Cesium\x20ion托管','updateTimer','silhouetteSize','inverseViewMatrix','toastr','scope','dashPattern','Mars3DEx','cons','_crs','BufferUsage','isObject3D','PointPrimitiveCollection','accessToken','Cesium3DTileStyle','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20position\x20=\x20czm_inverseModelView\x20*\x20vec4(fsInput.attributes.positionEC,1);\x20//\x20位置\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20注意shader中写浮点数是,一定要带小数点,否则会报错,比如0需要写成0.0,1要写成1.0\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_baseHeight\x20=\x200.0;\x20//\x20物体的基础高度,需要修改成一个合适的建筑基础高度\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_heightRange\x20=\x2080.0;\x20//\x20高亮的范围(_baseHeight\x20~\x20_baseHeight\x20+\x20_heightRange)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_glowRange\x20=\x20100.0;\x20//\x20光环的移动范围(高度)\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20建筑基础色\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_height\x20=\x20(u_mars3d_jzw_upz\x20?\x20position.z\x20:\x20position.y)\x20-\x20_baseHeight;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_a11\x20=\x20fract(czm_frameNumber\x20/\x20120.0)\x20*\x203.14159265\x20*\x202.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_a12\x20=\x20mars_height\x20/\x20_heightRange\x20+\x20sin(mars_a11)\x20*\x200.1;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20vec3(0.0,\x200.0,\x201.0),\x200.5);\x20//\x20颜色\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20*=\x20vec3(mars_a12);//\x20渐变\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20动态光环\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20/\x20360.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20time\x20=\x20abs(time\x20-\x200.5)\x20*\x202.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_h\x20=\x20clamp(mars_height\x20/\x20_glowRange,\x200.0,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_diff\x20=\x20step(0.005,\x20abs(mars_h\x20-\x20time));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20+=\x20material.diffuse\x20*\x20(1.0\x20-\x20mars_diff);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20','highlightOpen','layui-layer-lan\x20layer-mars-dialog','hasPopup','_pickedId','value','_isCircle','duration','positionsShow','fire','crsDecimal','render','MaterialSupport','_optionsBasemapsList','atan','dimensions_x','showScanPlane','fireTarget','getContextMenu','False_Northing','_map_clickHandler','sinrot','derivedCommands','cosX0','_map_mouseMove','none','textures','fe80f2290b380cfed86c62e3edec169e','_toCesiumValEnd','rotation_z','ontimeout','_depthFailColor','setLayerSplitDirection','bessel','west','updateFrustum','material','_toOneJson_Point','onDragEnd','polyline','_cloudCollection','cosgam','_cascadeSplits','_wall_minimumHeights','limit','<div>区域:','_performanceDisplay','sinb1','jobScheduler','EPSG:4510','sun','VertexArray','EQUIT','lat2','GeometryInstance','/tile/','primitiveCollection','createShader','_attr','right','createDrawCommand','_onMap_leftDown','wheel','contextMenuClose','toLowerCase','行政地标','silhouette','getDraggerContextMenu','substr','maximumZoomDistance','_tooltipId','開啓夜視','UNIT_Y','pinchStart','glowColor','enabled','Z_UP_TO_X_UP','u_mars3d_flat_upAxis','rayPlane','();\x20\x0a','_computedNewPos','intersectionColor','maxx','frontFaceAlpha','fromRotationX','Southeast\x20Asia','wall','strokeType','_uniforms','views','_updatePointerEvents','ripple','无法删除,点数量不能少于','_frustumPlanes','datumCode','editStop','osmBuildings','地形服务','shiny','angle1','asin','_海里','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','_createAppearance','hide','z4490','city','_onTerrainChangeHandler','_view','standard_parallel_1','angle','cartesianArrayToCartographicArray','EPSG4326','delta','divUpLabel','_cameraHandler','globalAlpha','_layer','BLACK','RequestScheduler','_pickOffscreenView','multiplyByUniformScale','_createPolylineOutline','_scanPlaneFrontCommand',');\x0a}','Unable\x20to\x20find\x20mandatory\x20grid\x20\x27','visible','_toChineseLang','polylineVolumeP','_cartographic','lineOffset','unbindEvent','tileProvider','lookAtTransform','reportError','flyToOptions','process','getOutlineCoordinates','\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20float\x20direction;\x0a\x0a\x20\x20\x20\x20uniform\x20float\x20delta;\x0a\x20\x20\x20\x20uniform\x20float\x20sigma;\x0a\x20\x20\x20\x20uniform\x20float\x20stepSize;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20void\x20main()\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20vec2\x20st\x20=\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20vec2\x20dir\x20=\x20vec2(1.0\x20-\x20direction,\x20direction);\x0a\x20\x20\x20\x20\x20\x20vec2\x20step\x20=\x20vec2(stepSize\x20*\x20(czm_pixelRatio\x20/\x20czm_viewport.zw));\x0a\x0a\x20\x20\x20\x20\x20\x20vec3\x20g;\x0a\x20\x20\x20\x20\x20\x20g.x\x20=\x201.0\x20/\x20(sqrt(czm_twoPi)\x20*\x20sigma);\x0a\x20\x20\x20\x20\x20\x20g.y\x20=\x20exp((-0.5\x20*\x20delta\x20*\x20delta)\x20/\x20(sigma\x20*\x20sigma));\x0a\x20\x20\x20\x20\x20\x20g.z\x20=\x20g.y\x20*\x20g.y;\x0a\x20\x20\x20\x20\x20\x20vec4\x20result\x20=\x20texture(colorTexture,\x20st)\x20*\x20g.x;\x0a\x0a\x20\x20\x20\x20\x20\x20for\x20(float\x20i\x20=\x201.0;\x20i\x20<\x20float(SAMPLES);\x20i+=1.0)\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20g.xy\x20*=\x20g.yz;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20offset\x20=\x20i\x20*\x20dir\x20*\x20step;\x0a\x20\x20\x20\x20\x20\x20\x20\x20result\x20+=\x20texture(colorTexture,\x20st\x20-\x20offset)\x20*\x20g.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20result\x20+=\x20texture(colorTexture,\x20st\x20+\x20offset)\x20*\x20g.x;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20result;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20','logDepth','Invalid\x20parameter\x20value,\x20must\x20be\x20numeric\x20','_maximumLevel','RadarWave','FlyToPoint','_inverseMatrix','_updateImage','BoundingSphere','getArrowPoints','startDraw','getInMapChilds','RIGHT_UP','TerrainNo','longitude_of_center','getDistanceByLL','bindPopup','_positions_line_z','activate','visibility','65892a265537810eba29eeae73649a71','_lat','DepthTestYes','GetFeature','cos_p14','_flyTo','-outline','formatPosition','cartographicArrayToCartesianArray','clampToTerrain','defaultVisualizersCallback','BD09','73199UqZVgq','join','_map_click','_mars3d_graphicId','EPSG:4539','GroundPolylinePrimitive','_pointSize','updateHeight','offsetHeight','MultiPoint','LEFT_CLICK','coordinates','AZURE','arcgis_wfs','entities','showGroundAtmosphere','Tilted_Perspective','zhang','pixelOffset','pathStyleConver','_tilesetPlanClip','ggrs87','删除该点','selectedImageryProviderViewModel','sinlat0','_scanePlaneXHalfAngle','zIndex','PostProcessStageLibrary','SnowEffectYes','PointUtil','_wkid','baseWaterColor','nzgd49','_color_alpha','MoveType','disTerrainScale','_fxOnePoint','RHUMB','maxDistance','_removeLabel','stopMoveMatrix','_positions_line_x','specularMap','cancelFlight',';\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20image_0;\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20roiUV0;\x0a\x20\x20\x20\x20\x20\x20uniform\x20bool\x20useROI;\x0a\x20\x20\x20\x20\x20\x20uniform\x20bool\x20reverseROI;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20opacity;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20获取指定的由UV坐标定义的poi边界点\x0a\x20\x20\x20\x20\x20\x20vec2\x20getROIuv(sampler2D\x20roi,\x20int\x20index){\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20poiuv\x20=\x20texture(roi,\x20vec2((float(index)\x20+\x200.5)\x20/\x20float(WIDTH),\x200)).xy;\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20poiuv;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20判断UV坐标在不在范围内\x0a\x20\x20\x20\x20\x20\x20bool\x20isInside(vec2\x20uv,\x20sampler2D\x20roi){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bool\x20ifInside\x20=\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20uv.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20uv.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20sP\x20=\x20getROIuv(roi,\x200);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for\x20(int\x20i\x20=\x200;\x20i\x20<\x20100000;\x20i++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(i\x20>=\x20WIDTH)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20i\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20nextIndex\x20==\x20WIDTH\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20eP\x20=\x20getROIuv(roi,\x20nextIndex);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((sP.x\x20==\x20u\x20&&\x20sP.y\x20==\x20v)\x20||\x20(eP.x\x20==\x20u\x20&&\x20eP.y\x20==\x20v)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if((sP.y\x20<\x20v\x20&&\x20eP.y\x20>=\x20v)\x20||\x20(sP.y\x20>=\x20v\x20&&\x20eP.y\x20<\x20v))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20x\x20=\x20sP.x\x20+\x20(v\x20-\x20sP.y)\x20*\x20(eP.x\x20-\x20sP.x)\x20/\x20(eP.y\x20-\x20sP.y);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(x\x20==\x20u){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if(x\x20>\x20u)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ifInside\x20=\x20!ifInside;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sP\x20=\x20eP;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20ifInside;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20czm_material\x20getMaterial(czm_materialInput\x20materialInput){\x0a\x20\x20\x20\x20\x20\x20\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20imageColor\x20=\x20texture(image_0,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20imageColor.rgb;\x0a\x20\x20\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20imageColor.a\x20*\x20opacity\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20material;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(useROI){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bool\x20inside\x20=\x20isInside(uv,\x20roiUV0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(inside\x20!=\x20reverseROI)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20getMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20getMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','_backwardExtrapolationDuration','<li\x20class=\x22line\x22></li>','gaodekey','fa\x20fa-map-marker','loadGeoJSON','getPropertyValue','stopEditing','_onMap_wheel','km²','关闭夜视','Inverse\x20grid\x20shift\x20iteration\x20failed,\x20presumably\x20at\x20grid\x20edge.\x20\x20Using\x20first\x20approximation.','labelHeight','_objectsToExcludee','negate','PostProcessStageComposite','contains','test','Lerch\x201979','_pickCommand','latitudeInterval','EPSG:4530','fschr68','//data.mars3d.cn/terrain','BOTH','points','EPSG:4535','_layerList','mouseUp','_rebindCzmContainer','snow','_sectorLineVA','LEFT_UP','WebMercatorTilingScheme','_removeChildGraphic','magnitude','clockRange','BaiduPOI\x20请求出错','symbol','isDestroy','_showSectorSegmentLines','getInt32','_autoStyle','yyyy-MM-dd','allPage','MeasureUtil','_roll_reality','EPSG:4269','fromFramebuffer','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_properties','_三维模型','hasPixelOffset','maximumArr','EPSG:3857','ml0','mouseout','fileName','in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20out_FragColor\x20=\x20xh_getMaterial(v_st);\x0a}\x0a','Transverse_Mercator','Drag\x20that\x20point','_getExcludedStyle',';\x22></div>\x0a\x20\x20\x20\x20<div\x20style=\x22border-radius:\x2050%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','Widgets/Images/TerrainProviders/CesiumWorldTerrain.png','czmObject','distanceStr','withAlpha','_data','_drawCreatedHandler','gtu','chinaCRS','temp','particleSystem','_mars_type','_formatForMask','styleOpt','\x0a//\x20Permutation\x20polynomial:\x20(34x^2\x20+\x20x)\x20mod\x20289\x0avec3\x20_czm_permute289(vec3\x20x)\x20{\x0a\x20\x20return\x20mod((34.0\x20*\x20x\x20+\x201.0)\x20*\x20x,\x20289.0);\x0a}\x0a\x0avec2\x20czm_cellular(vec2\x20P)\x20{\x0a\x20\x20#define\x20K\x200.142857142857\x20//\x201/7\x0a\x20\x20#define\x20Ko\x200.428571428571\x20//\x203/7\x0a\x20\x20#define\x20jitter\x201.0\x20//\x20Less\x20gives\x20more\x20regular\x20pattern\x0a\x20\x20vec2\x20Pi\x20=\x20mod(floor(P),\x20289.0);\x0a\x20\x20vec2\x20Pf\x20=\x20fract(P);\x0a\x20\x20vec3\x20oi\x20=\x20vec3(-1.0,\x200.0,\x201.0);\x0a\x20\x20vec3\x20of\x20=\x20vec3(-0.5,\x200.5,\x201.5);\x0a\x20\x20vec3\x20px\x20=\x20_czm_permute289(Pi.x\x20+\x20oi);\x0a\x20\x20vec3\x20p\x20=\x20_czm_permute289(px.x\x20+\x20Pi.y\x20+\x20oi);\x20//\x20p11,\x20p12,\x20p13\x0a\x20\x20vec3\x20ox\x20=\x20fract(p\x20*\x20K)\x20-\x20Ko;\x0a\x20\x20vec3\x20oy\x20=\x20mod(floor(p\x20*\x20K),\x207.0)\x20*\x20K\x20-\x20Ko;\x0a\x20\x20vec3\x20dx\x20=\x20Pf.x\x20+\x200.5\x20+\x20jitter\x20*\x20ox;\x0a\x20\x20vec3\x20dy\x20=\x20Pf.y\x20-\x20of\x20+\x20jitter\x20*\x20oy;\x0a\x20\x20vec3\x20d1\x20=\x20dx\x20*\x20dx\x20+\x20dy\x20*\x20dy;\x20//\x20d11,\x20d12\x20and\x20d13,\x20squared\x0a\x20\x20p\x20=\x20_czm_permute289(px.y\x20+\x20Pi.y\x20+\x20oi);\x20//\x20p21,\x20p22,\x20p23\x0a\x20\x20ox\x20=\x20fract(p\x20*\x20K)\x20-\x20Ko;\x0a\x20\x20oy\x20=\x20mod(floor(p\x20*\x20K),\x207.0)\x20*\x20K\x20-\x20Ko;\x0a\x20\x20dx\x20=\x20Pf.x\x20-\x200.5\x20+\x20jitter\x20*\x20ox;\x0a\x20\x20dy\x20=\x20Pf.y\x20-\x20of\x20+\x20jitter\x20*\x20oy;\x0a\x20\x20vec3\x20d2\x20=\x20dx\x20*\x20dx\x20+\x20dy\x20*\x20dy;\x20//\x20d21,\x20d22\x20and\x20d23,\x20squared\x0a\x20\x20p\x20=\x20_czm_permute289(px.z\x20+\x20Pi.y\x20+\x20oi);\x20//\x20p31,\x20p32,\x20p33\x0a\x20\x20ox\x20=\x20fract(p\x20*\x20K)\x20-\x20Ko;\x0a\x20\x20oy\x20=\x20mod(floor(p\x20*\x20K),\x207.0)\x20*\x20K\x20-\x20Ko;\x0a\x20\x20dx\x20=\x20Pf.x\x20-\x201.5\x20+\x20jitter\x20*\x20ox;\x0a\x20\x20dy\x20=\x20Pf.y\x20-\x20of\x20+\x20jitter\x20*\x20oy;\x0a\x20\x20vec3\x20d3\x20=\x20dx\x20*\x20dx\x20+\x20dy\x20*\x20dy;\x20//\x20d31,\x20d32\x20and\x20d33,\x20squared\x0a\x20\x20\x20\x20//\x20Sort\x20out\x20the\x20two\x20smallest\x20distances\x20(F1,\x20F2)\x0a\x20\x20vec3\x20d1a\x20=\x20min(d1,\x20d2);\x0a\x20\x20d2\x20=\x20max(d1,\x20d2);\x20//\x20Swap\x20to\x20keep\x20candidates\x20for\x20F2\x0a\x20\x20d2\x20=\x20min(d2,\x20d3);\x20//\x20neither\x20F1\x20nor\x20F2\x20are\x20now\x20in\x20d3\x0a\x20\x20d1\x20=\x20min(d1a,\x20d2);\x20//\x20F1\x20is\x20now\x20in\x20d1\x0a\x20\x20d2\x20=\x20max(d1a,\x20d2);\x20//\x20Swap\x20to\x20keep\x20candidates\x20for\x20F2\x0a\x20\x20d1.xy\x20=\x20(d1.x\x20<\x20d1.y)\x20?\x20d1.xy\x20:\x20d1.yx;\x20//\x20Swap\x20if\x20smaller\x0a\x20\x20d1.xz\x20=\x20(d1.x\x20<\x20d1.z)\x20?\x20d1.xz\x20:\x20d1.zx;\x20//\x20F1\x20is\x20in\x20d1.x\x0a\x20\x20d1.yz\x20=\x20min(d1.yz,\x20d2.yz);\x20//\x20F2\x20is\x20now\x20not\x20in\x20d2.yz\x0a\x20\x20d1.y\x20=\x20min(d1.y,\x20d1.z);\x20//\x20nor\x20in\x20\x20d1.z\x0a\x20\x20d1.y\x20=\x20min(d1.y,\x20d2.x);\x20//\x20F2\x20is\x20in\x20d1.y,\x20we\x27re\x20done.\x0a\x20\x20return\x20sqrt(d1.xy);\x0a}\x0a','endPosition','from_greenwich','YZ_TRANSLATION','toDataURL','u_mars3d_flat_maxRangeLength','_sizeInBytes','TextureMinificationFilter','moveDelay','clear','plane','BOTTOM_ROTATE','viewMatrix','updatePass','rightLayer','getQuadricBSplineFactor','latDecimal','lower','digVolume','context','Enable\x20fog','_pointType','distanceDisplayCondition','Modified\x20Airy','orginRotation','pickedObject','snowEffect','PositionProperty','rainEffect','origin','_getConfig','_times','更多功能请右击','bufferSteps','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','EffectType','674.374,15.056,405.346','centerAt','culture','location','uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20plot(float\x20st,\x20float\x20pct)\x20{\x0a\x20\x20return\x20smoothstep(pct,\x20pct,\x20st)\x20-\x20smoothstep(pct,\x20pct\x20+\x200.5,\x20st);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time2\x20=\x20czm_frameNumber\x20/\x20speed;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s),\x20fract(float(st.t\x20*\x20segment)\x20-\x20time2)));\x0a\x20\x20float\x20percent\x20=\x20distance(st.y,\x20.5)\x20/\x200.9;\x0a\x20\x20float\x20distance\x20=\x20length(vec2(st.x,\x20st.y));\x0a\x20\x20float\x20pf\x20=\x20plot(distance,\x20fract(czm_frameNumber\x20/\x20200.0)\x20*\x2010.);\x0a\x20\x20vec4\x20gradient\x20=\x20mix(vec4(1.0,\x201.0,\x201.0,\x201.0),\x20vec4(pf,\x20pf,\x20pf,\x201.0),\x200.8);\x0a\x20\x20float\x20alpha\x20=\x20(colorImage.a\x20*\x20(1.0\x20-\x20percent));\x0a\x20\x20vec3\x20diffuse\x20=\x20max(color.rgb\x20*\x20alpha\x20*\x20glow,\x20color.rgb);\x0a\x0a\x20\x20if(flowGlow\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20rgba\x20=\x20mix(vec4(diffuse,\x20alpha),\x20gradient,\x20pf);\x0a\x20\x20\x20\x20material.diffuse\x20=\x20rgba.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20rgba.a\x20*\x20globalAlpha;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20diffuse;\x0a\x20\x20\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a','pause','_updateTile','log','headAngle','wallStyleConver','depthTestOld','max(contourMaterial.alpha,\x20slopeRampMaterial.alpha)','_sp','offsetWidth','Enable\x20shadow','addEffect','_unbindEditEvent','_entity_label','Stop\x20rotation\x20on\x20axis','_onMouseMoveHandler','passes','PerformanceDisplay','terrainProviderViewModels','IDENTITY','_startJulian','ReplaceUrl','esriGeometryPoint','Longitude_of_center','world_geodetic_system_1984','Style','#ffff00','_has3dtiles','GaodePOI\x20请求出错','video/','标记面','removeEventParent','<span\x20style=\x22color:\x20red;\x22>红色</span>\x20是\x20X轴<br/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22color:\x20green;\x22>绿色</span>\x20是\x20Y轴<br/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20style=\x22color:\x20blue;\x22>蓝色</span>\x20是\x20Z轴','PINCH_MOVE','<textarea\x20class=\x22mars3d-popup-edititem\x20','_graphic_dragger_ing','GridImageryProvider','closeHighlight','Event','gridList','</PropertyName>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<gml:Polygon>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<gml:outerBoundaryIs>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<gml:LinearRing>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<gml:coordinates>','loadImage','Popular\x20Visualisation\x20Pseudo\x20Mercator','asphaltColor','_startHeading','CGCS2000_GK_Zone_6','fi0','Failed\x20to\x20detect\x20nadgrid\x20endian-ness,\x20defaulting\x20to\x20little-endian','uniform\x20sampler2D\x20image;\x0auniform\x20float\x20speed;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20count;\x0auniform\x20bool\x20axisY;\x0auniform\x20bool\x20reverse;\x0auniform\x20bool\x20bloom;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(axisY)\x20{\x0a\x20\x20\x20\x20if(reverse)\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.s\x20-\x20time)));\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.s\x20+\x20time)));\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20if(reverse)\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.t\x20-\x20time)));\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.t\x20+\x20time)));\x0a\x20\x20}\x0a\x0a\x20\x20float\x20perDis\x20=\x201.0\x20/\x20count\x20/\x203.0;\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20smoothstep(.2,\x201.,\x20distance(st.t\x20*\x20perDis,\x201.\x20+\x20perDis))\x20*\x20globalAlpha;\x0a\x0a\x20\x20if(bloom)\x20{\x0a\x20\x20\x20\x20//泛光\x0a\x20\x20\x20\x20vec4\x20fragColor;\x0a\x20\x20\x20\x20fragColor.rgb\x20=\x20(colorImage.rgb\x20+\x20color.rgb)\x20/\x201.0;\x0a\x20\x20\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20\x20\x20material.emission\x20=\x20fragColor.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x201.5,\x20color.rgb);\x0a\x20\x20\x20\x20material.emission\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x201.5,\x20color.rgb);\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a','baseLayerPicker','instances','_onClickHandler','swallowTailFactor','scaleX','second_all','horizontalOrigin','computeModelMatrix','innerRadii','editingGrid','27rGKsBE','graphicLayer','readyPromise','CorridorOutlineGeometry','uniform\x20sampler2D\x20colorTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0aconst\x20int\x20KERNEL_WIDTH\x20=\x2016;\x0avoid\x20main(void)\x20{\x0a\x20\x20vec2\x20step\x20=\x201.0\x20/\x20czm_viewport.zw;\x0a\x20\x20vec2\x20integralPos\x20=\x20v_textureCoordinates\x20-\x20mod(v_textureCoordinates,\x208.0\x20*\x20step);\x0a\x20\x20vec3\x20averageValue\x20=\x20vec3(0.0);\x0a\x20\x20for(int\x20i\x20=\x200;\x20i\x20<\x20KERNEL_WIDTH;\x20i++)\x20{\x0a\x20\x20\x20\x20for(int\x20j\x20=\x200;\x20j\x20<\x20KERNEL_WIDTH;\x20j++)\x20{\x0a\x20\x20\x20\x20\x20\x20averageValue\x20+=\x20texture(colorTexture,\x20integralPos\x20+\x20step\x20*\x20vec2(i,\x20j)).rgb;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20averageValue\x20/=\x20float(KERNEL_WIDTH\x20*\x20KERNEL_WIDTH);\x0a\x20\x20out_FragColor\x20=\x20vec4(averageValue,\x201.0);\x0a}\x0a','_primitive_outline','CubeMap','getOrientation','moveVar','hpr','czm_pickColor','_highlightOptions','_mouseClickHandler','633395CDHhUb','_总长','projName','DESTROY','shape','zoomEventTypes','setColumn','ellipsoid','_onMarkerDrag','showStop','_darkness','<br/>','hasEventParent','positionToTileXY','禁止编辑','repeat_y','tileLoad','handler','_onClockTick','_closeAllControl','greaterThanOrEquals','czmObjectEx','_czmContainerKey','_removedBeforeHook','abs','_start','atob','EllipsoidSurfaceAppearance','upHeight','_fireAddPoint','fa\x20fa-gear','bboxSR','_direction','fromAxisAngle','_onBeforeCreate','entitys','clearPitchRange','lookRight','rgba(255,\x20255,\x20255,\x200.0)','radiuslimit','geometryType','CustomShader','equals','destroyPrimitives','projectionMatrix','oProj','IAU76','UndergroundNo','getFieldsForPickedPosition','MaterialType','heading','leadTime','_cache_','C_re','rois','flipx','TimeInterval','PROJCRS','outer_controlPoints','unbindHighlight','mouseOver','lblAddFun','_selectedIdTexture','false_easting','clock','WGS\x2066','_hasRightTilt','_last_depthTestAgainstTerrain','pickFramebuffer','_downHandler','_stopDrawHook','insertBefore','_show','depthRange','fadeFactor','baseMaterialConver','开启日照阴影','fromTranslationRotationScale','044b5684de2b2009a15084eb8b88f822','PolygonOutlineGeometry','更多功能請右擊','dblClick','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=13500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','model','GeographicProjection','debugAxisPrimitive','rotateStart','_关闭三角网','sinph0','Image','_updateDraw','_getPickIds','skyBox','59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993','_packedLength','_createCzmContainer','totalAreaStr','getLangText','_frameState','_renderRequested','GroundSkyBox','pixelOffsetY','splitNum','<div\x20id=\x22tooltip-','uid','_videoContainer','map','_czmContrl','tileWidth','pickId','156','setOpacity','GroupThing','minificationFilter','negativeZ','WebMapTileServiceImageryProvider','CheckerboardType','EPSG:4498','popup','typeOf','Y_UP_TO_Z_UP','_containerBtnStart','_corridorEx','_measureExLine','_outlineColor_alpha_bak','positiveY','getTime','multiple','autoTip','KeyboardEventModifier','EPSG:4500','VRButton','_setPitchRange_cameraChangedHandler','materialType','_toOneCesiumVal_Poly','_onMap_middleClick','editColor','Sinusoidal','autoStopAngle','v_pole_s','_createWellWall','RED','isAll','grainFrequency','repeat_x','_mousMiddleUpHandler','isAdded','类型已存在','onDragStart','ctrlKey','_toOneJson_Poly','VERTICAL','0.00','_load_data','gapColor','_wallHeights','editMouseMove','_selected','updateDivPosition','_createPostProcessStage','_bindExType','_unionRectangle','scaleByDistance_far','glowWidth','An\x20error\x20occurred\x20while\x20accessing\x20','_setEditCursor','EllipsoidStyleConver','_shadingType','#001e0f','fxaa','flyToExtent','source','blackAndWhiteEffect','radius_g_1','DATUM','Transforms','effect','hasZ','_updateImage_delay','valid','outlineCoordinates','_readyOk','destination','AspectRamp','ImageType','paths','_tileDiscardPolicy','charCodeAt','convertLL2MC','_updateMatrixRotatePosition','rectangularSensor','_readyPromise','\x20\x20\x20\x20','_updateForEvent','add','fillStyle','配置中的特效未处理','heightReference','_handler','zeroToTwoPi','Delambre\x201810\x20(Belgium)','_map_timeTik','isPrivate','http://www.w3.org/2000/svg','_readChildNodeVal','requestVertexNormals','cartesian','downGraphic','drawAddPoint','_getDrawEntityClass','NaN','getMonth','getTranslation','fromCartesianArray','message','TRANSPARENT','This\x20object\x20does\x20not\x20allow\x20editing','_rotateStep','total','fixedTop','requestImage','afterItem','one_minus_f','substring','targetPosition','Mercator','clickGraphic','createImageryProvider','PolylineMaterialAppearance','<input\x20type=\x22','accuracy','不存在graphicType无法解析数据对Graphic','_toJSON_Ex','removeEventListener','alignmentInBytes','polygonP','getFeature','_gaze','post','debugAxis','flip_axis','Blur1','oddcolor','state','primitives','scaleByDistance_farValue','download','crsx','按轴平移','Zoom\x20In','clientHeight','_splitOptionsToStyle','cross','granularity','_pickSP','formatNum','getState','_id','outlineEffect','_currentFrustum','_offCenterFrustum','FILL','phone','EventType','getOutline','cameraController','diffHeight','getListByAttr','viewModel','PolygonGeometry','Request\x20failed\x20with\x20status\x20code\x20','_outlinePositions','EPSG:4326','_stateOkIndex','_getTargetDistanceDisplayCondition','description','_arrowInstances','_toOneJson','activateMouseOver','name','nodeValue','_globe','_minimumLevel','defines','jakarta','dot','czm_selectedIdTextureStep','depth','_height','snowCover','DeveloperError','isEntity','_toOneCesiumVal','BillboardCollection','HeadingPitchRoll','有地形','+title=NAD83\x20(long/lat)\x20+proj=longlat\x20+a=6378137.0\x20+b=6356752.31414036\x20+ellps=GRS80\x20+datum=NAD83\x20+units=degrees','_createFrustumPrimitive','DepthTestNo','ellipsoidP','_last_material','getBinomialFactor','_关闭黑白','_pitchWhenLeftClicked','aspect','STATIC_DRAW','_pointCollection','+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=27500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','BoundingRectangle','ENGCRS','attributes','POSITION_ONLY','addControl','arc','pitch','_tileHeight','shadows','getSeconds','writeTextToCanvas','RectangleStyleConver','toMercator','src','framebuffer','updateVideoContainer','_popupMgr','_domeLineCommand','#ebe12c','bindPickId','_tilesets','_time','_boundingSphereWC','setAttribute','_container_onClickHandler','單擊後\x20激活編輯','rgba(0,0,0,0)','maximumSizeY','editStyle','bindDraggers','GridType','_updateNormal','Modify\x20the\x20position','svg-path','minHeight','verticalOrigin','Add\x20point','B_im','PARAMETER','ScreenSpaceEventHandler','_hasFX','updateAllDistance','{arc_z4490}','cos_phi','R{arc_y}','_projectionPicker','rgba(255,\x20255,\x20255,\x201.0)','terrainLoadError','noiseScale','extrudedHeight','_dataProvider','disableDepthTestDistance','onPointTrans','_normal_angle1','uplift','_normal_angle2','New\x20Zealand\x20Geodetic\x20Datum\x201949','belge','heightStep','corridor','equalsEpsilon','cosc0','查看此處坐標','PINCH','_lightCamera','_initTilesetFlat','entityAngle','crossorigin','_clockStep','ClippingPlaneCollection','_isLeftDown','_getDefaultTemplate','i3s','無法刪除,點數量不能少于','_init','address','ClippingPlane','metaData','\x0a(+','Mark\x20round','maxHeight','percent','brightnessEffect','fineArrow','valueFD','wholeDistance','_domeLineVA','_primitive_billboard','JulianDate','depthFailMaterial','startCompute','GEOGCS','all','getLayerById','shaderProgram','latitude','ArcType','_last_pickedObject','lastPointTemporary','_距离','_updateDomInnerHtml','startTime','_graphicList','_pickIds','PolylineVolumeStyleConver','_positions','ellipsoidC','特效效果','Resource','getCameraDistance','geometry','getRayEarthPositions','toString','getTimestamp','min-width:\x20','getOutlinePositions','sharpness','_getLablePosition','domtoimage','_setCameraViewListState','fromCharCode','objectsToExclude','_unbindFun','_terrainProviderPromise','\x0a\x20\x20\x20\x20\x20\x20\x20\x20#extension\x20GL_OES_standard_derivatives\x20:\x20enable\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(enabled){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionEC\x20=\x20fsInput.attributes.positionEC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20positionWC\x20=\x20normalize(czm_inverseView\x20*\x20vec4(positionEC,\x201.0));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20dx\x20=\x20dFdx(fsInput.attributes.positionEC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20dy\x20=\x20dFdy(fsInput.attributes.positionEC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20nor\x20=\x20normalize(cross(dx,\x20dy));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20normalWC\x20=\x20normalize(czm_inverseViewRotation\x20*\x20nor);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dotNumWC\x20=\x20dot(positionWC.xyz,\x20normalWC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(dotNumWC\x20<=\x200.2)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20vec3(1.0),\x20alpha*0.2);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20vec3(1.0),\x20dotNumWC*alpha);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','_readChildNode','flat','icon','entityGraphic','updateAttrForEditing','img_e','_controlList','checkHasBreak','_filterPropagateEvent','#000000','updateOutlinesDistanceDisplayCondition','I3SLayer','reflectMatrix','關閉亮度','styleOptions','source\x20is\x20required.','contextMenuClick','CoplanarPolygonGeometry','renderState','getFloat64','flyTo','registerTerrainProvider:\x20','ImageBasedLighting','moon','FormatLength','_context','geodeticSurfaceNormal','ssfn_','has3dtiles','angleDecimal','updateExLine','noPickEntity','EditAttr','getContext','tiltEventTypes','view','该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!','_objectsToExclude','pickLimit','_postRenderHandler','HermitePolynomialApproximation','hierarchy','showLateralSurfaces','grid','backToFirst','u_mars3d_flat_texture','osgb_1936','Bessel\x201841\x20(Namibia)','GridMaterialProperty','PolylineVolumeGeometryLibrary','\x22\x20style=\x22width:','_alt_bak','alt','_ferro','_scene','showUp','convertPackedArrayForInterpolation','EllipsoidOutlineGeometry','createControl:无该类型控件暂不能创建','entityCollection','_last_isFireStop','FogEffectNo','bezierSpline','isStart','Ion','_clampToTilesetFrame','stopEdit','minx','xmin','infocode','_getTerrainHeight_ing','ids','_startMousePosition','Close\x20BoundingVolume','status','close','scaleByDistance','cylinderC','angleBetween','entityCollection\x20is\x20required.','onerror','getDefaultRenderState','restore','_tileset','_enabledDraw','_onClockTickHandler','_container','atan2','Fischer\x20(Mercury\x20Datum)\x201960','towgs84','getTooltipConfig','60tzAwoZ','Close\x20off\x20circling','_单击开始绘制','mapProjection','_normal','closed','_pitch_reality','_labels','_maximumDistance','getDistance','Y_TRANSLATION_COLOR','closeSmallTooltip','parent','_contextmenuConfig','getProperty','onSetOpacity','_cubeMap3','addThing','_roll','min','_rotateFrame','_normalZ','selectedTerrainProviderViewModel','createLayer','_hiddenColor','globalMsg','rightPositions','ComponentDatatype','LngLatPoint','LineString','TileMatrixSet','getPopupConfig','rectangularSensorStyleConver','BYTES_PER_ELEMENT','MipmapHint','pn1','getOwnPropertyDescriptor','_colorTexture','UNIT_Z','down','rotateSpeed','terrainChange','setVisible','computeNormal','53300JrpgxB','_updateHeight','_getCssText','fabric','israel','route','North_American_Datum_1927','rotateStop','_tileset_tileLoadHandler','_currentExtent','右击菜单删除','標記點','tooltip','addInner','activateEdit','drawingBufferWidth','encoderOptions','disable','SceneMode','function','zoomTo','_setCameraViewListItem','qs0','autoSurfaceHeight','dashLength','isTile','hasOwnProperty','_formatRouteData','defaultTexture','_scanPlaneMode','開啓鍵盤漫遊','_containerCon','maxPitch','+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_tileLayer_removeTileHandler','stopRotateMatrix','_element','load','invertColor','sphere','getShapeForCircle','RIGHT','Dimensions','_flyok_index','addSample','polygonCombine','Quaternion','initialTilesLoaded','point2','_getVector','_maxPointNum','layers','scanPlaneColor','hasHeightEdit','_zhStyle','ProviderViewModel','AREA_3','moveBackward','_color','xHalfAngle','fogByDistance_far','timeTik','rectangularSensorMars','uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20cmi)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(cmi);\x0a\x20\x20vec2\x20st\x20=\x20cmi.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0)\x20*\x20direction;\x0a\x20\x20vec2\x20st1\x20=\x20vec2(fract(st.s\x20-\x20t),\x20st.t);\x0a\x20\x20vec4\x20color\x20=\x20vec4(0.,\x200.,\x200.,\x200.);\x0a\x20\x20float\x20alpha\x20=\x201.\x20-\x20st.t;\x0a\x20\x20float\x20value\x20=\x20fract(st1.s\x20/\x200.25);\x0a\x20\x20alpha\x20*=\x20sin(value\x20*\x203.1415926);\x0a\x20\x20color\x20=\x20vec4(u_color.rgb\x20*\x20u_color.a,\x20alpha\x20*\x201.2);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a','_updateVirtualCamera','_onMouseMove','LEFT_ROTATE','closeContextMenu','RIGHT_ROTATE','startFlicker','sin_phi','getAngleOfThreePoints','DIRECTION_FORWARD','sign','zoomOut','replaceMain','_getEventTarget','units','ymf','_draggerIng','_updatePositionHook','allowDrillPick','_skyboxMatrix3','block','PrimitiveCollection','PolylineArrow','eastNorthUpToFixedFrame','templateEmptyStr','_onMouseMoveDraggerHandler','_drawAddPointHandler','Sampler','_mousePosition','01234567','height','LabelStyle','Proj','_canrefresh','autoStop','GoogleEarthEnterpriseMetadata','_visibleAreaColor','fillVolume','场景出图_','_startEditingHook','_areaList','_updateDiffHeight','DOUBLE','keys','hasSelected','ground','navigationHelpButton','widthRatio','toGeoJSON','extensions','AddMidPoint','showText','_controls','getPositions','EPSG:4504','dataSources','#ifdef\x20GL_ES\x0aprecision\x20mediump\x20float;\x0a#endif\x0auniform\x20sampler2D\x20mars_image;\x0auniform\x20vec2\x20mars_distanceDisplayCondition;\x0auniform\x20vec3\x20mars_positionWC;\x0ain\x20vec3\x20v_worldPos;\x0ain\x20vec2\x20v_st;\x0auniform\x20float\x20globalAlpha;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20float\x20dis\x20=\x20distance(mars_positionWC,\x20v_worldPos);\x0a\x20\x20if(dis\x20<\x20mars_distanceDisplayCondition.x\x20||\x20dis\x20>\x20mars_distanceDisplayCondition.y)\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(mars_image,\x20v_st);\x0a\x20\x20\x20\x20color.a\x20*=\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20//\x20Fully\x20transparent\x20parts\x20of\x20the\x20billboard\x20are\x20not\x20pickable.\x0a\x20\x20\x20\x20#if\x20!defined(OPAQUE)\x20&&\x20!defined(TRANSLUCENT)\x0a\x20\x20\x20\x20if(color.a\x20<\x200.005)\x20\x20\x20//\x20matches\x200/255\x20and\x201/255\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20//\x20The\x20billboard\x20is\x20rendered\x20twice.\x20The\x20opaque\x20pass\x20discards\x20translucent\x20fragments\x0a\x20\x20\x20\x20//\x20and\x20the\x20translucent\x20pass\x20discards\x20opaque\x20fragments.\x0a\x20\x20\x20\x20#ifdef\x20OPAQUE\x0a\x20\x20\x20\x20if(color.a\x20<\x200.995)\x20\x20\x20//\x20matches\x20<\x20254/255\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20if(color.a\x20>=\x200.995)\x20\x20//\x20matches\x20254/255\x20and\x20255/255\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20#endif\x0a\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x0a\x20\x20}\x0a}\x0a','tooltipOptions','_frustumPrimitive','_showScanPlane','fa\x20fa-spinner','_updateStyleHook','speed','_proxy','endItem','doubleSidedPlane','_primitive_boxs','Matrix4','11561zcQmmr','normalX','gradations','heightTriangle','TextureMagnificationFilter','flood','editMovePoint','绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20','sin_p14','off','attr','_getPopupPosition','materials','getLayer','things','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div><label>','spacing','floor','scaleY','selected','_showWall','顯示三角網','WaterType','flickerEntity','renderPass','_modelMatrix','Camera','PrimitiveType','splitPosition','keyword','radii_z','_onPreRenderHandler','qs1','_openByClick','showPage','mouseOut','bing','_default_tiltEventTypes','MathDistance','withCredentials','_textureSize','QueryGeoServer\x20请求出错','fromDimensions','addRing','currentObject','eventTarget','/query','execute','_updateLabelStyleHook','_bindHeightDraggers','UrlTemplateImageryProvider','epsg','平方公里','push','PointCloud3DTileContent','_measureExLine_positions','_trackedEntity','Oblique\x20Stereographic\x20Alternative','debugExtentEntity','con','negativeY','addDays','translucent','keydown','Z_TRANSLATION','dimensions','_divWidth','eventParent','_mars3d_layerId','bindTooltip','locationBar','getArrowHeadPoints','#ff7800','primitive','_colorHidden','全屏不可用','num','_getAddress_ing','addLayer','analysisOptions','fromColor','单击增加点','prevStageUpdate','_stopPropagation','Lon','selectedIndex','AnimationViewModel','_mountedHook','StripeMaterialProperty','挖地坐标数据存在问题!','_bak_clockRange','_radius','area','_enabled','https://restapi.amap.com/v3/place/text','WallScroll','LabelCollection','_shadowMap','reload','BACK','_imageryLayer','_limitGlobe','loadConfig','hasMidPoint','headingPitchRollQuaternion','lam','WGS\x2084','_onKeyUp','pit','highlight','_sampledPositionProperty','_depthStencilTexture','isArray','ColorGeometryInstanceAttribute','_outlineColor_alpha','getMatrix3','ShowGeometryInstanceAttribute','_wallEntity','leftDown','XY_TRANSLATION','utg','tileHeight','objects','videoHeight','\x0a\x20\x20\x20\x20in\x20vec4\x20position;\x0a\x20\x20\x20\x20in\x20vec2\x20textureCoordinates;\x0a\x20\x20\x20\x20out\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20void\x20main()\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20position;\x0a\x20\x20\x20\x20\x20\x20\x20\x20v_textureCoordinates\x20=\x20textureCoordinates;\x0a\x20\x20\x20\x20}\x0a\x20\x20','commands','cgb','maximumTerrainLevel','frustumCommandsList','Buffer','setOptions','animationSpeed','scaleByDistance_nearValue','dhEvent','addEventParent','componentsLength','</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','title','_positions_circle_z','blendColor','getMetadata','_cancelPositionsCallback','EPSG:4534','flatHeight','_targetPosition','segment','removeGraphic','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22\x20standalone=\x22no\x22?>\x0a<svg\x20width=\x22162px\x22\x20height=\x22162px\x22\x20viewBox=\x220\x200\x20162\x20162\x22\x20version=\x221.1\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22\x20xmlns:xlink=\x22http://www.w3.org/1999/xlink\x22>\x0a\x20\x20\x20\x20<title>拖拽调整四周方向角,双击回正北\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a','contextmenuItemsOptions','_bindEditEvent','tabIndex','_initialized','proxy','_measured','getFactorial','_thingList.destroy\x20异常','textStyles','readyState','getFeatureInfoParameters','GroundPrimitive','_currentHeight','cvs','_orginCenterPoint','cos_po','_url','GetCapabilities','未查询到相关结果!','gnom','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=35500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','enabledEvent','getAddress','vec_d','template','startEditing','createNightVisionStage','destroyDraggers','00000','endDate','timetik','TEXTURED','reportSuccess','_sources2','_getTerrainOptions','Access\x20to\x20the\x20ground','runAnimations','_default_zoomEventTypes','heightTriangleMeasure','if-unmodified-since','ms1','updateMaterial','complete','MaterialAppearance','toArray','semiMajorAxis','sqrt','路径规划\x20请求失败(','selectedImagery','heights','Chrome','stepSize','openSmallTooltip','_纬度','_startTime','mouseDown','videoPrimitive','vec_e','mercatorToLngLat','_baseLayerPicker','3857','createPropertyDescriptor','highlightClose','stopDraw','CameraEventType','addEventListener','oslo','translation','_terrain_onLoadError','long2','_arrThing','_czmBuiltinsAndUniforms','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-type=\x22','_tilesetClip','顯示地形','showAddText','_appendHtmlHook','getCameraView','_fireBindDataEx','listens','showDomeSurfaces','positionCartographic','selectedLayer','addressComponent','root','透视投影','decimal','queryCircle','pointerEvents','clearLastCamera','getCoordinates','_stopTime','_cubeMap','event','direction','angle2','fromQuaternion','TRANSLUCENT','TileMapServiceImageryProvider','positiveX','Stop\x20editing','DirectionalLight','CzmlDataSource','_distanceDisplayConditionCartesian2','{z4490}','ENABLED','\x22\x20class=\x22mars3d-popup-edititem\x20','ClearCommand','_关闭下雪','timeout','distanceLegend',',POLYGON((','polylineP','_measureDistanceLable','_createCzmControl','_geoJsonLayer','PostProcessStageSampleMode','response','_onDbClickHandler','#FF9742','havn\x27t\x20handled\x20\x22','endAngle','specularIntensity','BaseClass','_name','toRadians','creditContainer','createGraphic','resolveFramebuffers','RenderState','polygonTexture','Math','_onKeyDown','_propertyNames','domeSurfaceMaterial','_drawCommands','alfa','repeat','finish','StripeOrientation','cylinderStyleConver','pointCollection','_hierarchyPositions','TileProviderError','_speed','mars3d-mousedownview-show','emitterModelMatrix','Easting\x20at\x20false\x20origin','Lambert\x20Conic\x20Conformal\x20(1SP)','ter_z','fields','volumeDepthMeasure','pfact','bbox','https://tm.amap.com/trafficengine/mapabc/traffictile?v=1.0&t=1&x={x}&y={y}&z={z}&&t=','gcj02ll','properties','defs','\x20me_isSelected\x20=\x200.0;\x0a\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20me_isSelected=czm_selected()?1.0:0.0;\x0a\x20#endif\x0a','toDate','configureDescriptionFromProperties','interpolationDegree','currentTarget','tileset','singam','multiplyByPoint','boxStyleConver','_contourColor','addSeconds','updatePositionsHeightByAttr','_selectedLayer','isPoint','170px','_height_original','_smallMap','getValue','video3D','wgs','object','fireTargetEvent','clearRect','_allowDrillPick','_matrix','_draw_holes','getUrlComponent','cosphi','_planeAngleRadians','https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}','flags','the_geom','borderWidth','showSectorLines','_tilingScheme','flyToBoundingSphere','isFormat','VelocityOrientationProperty','cameraMoveEnd','xyz','parentNode','hasEmptyGroup','_requiredResolution','maximumClock','CESIUM_3D_TILE','fogByDistance','EPSG:4515','html2canvas','NONE','updateGraphic','slope','setInputAction','EDATUM','shadingType','RuntimeError','depthTest','_updatEntityAlpha','styleField','hasClosure','hasLayer','_clampToGround_reload','createPickId','getShowPositions','-mars3d-mousedownview','convex','mars3d-divGraphic-edit','getPicked','version','getCoordinate','PolylineArrowMaterialProperty','PostProcessStage','PROJECTEDCRS','_getTileEventParams','_visibilitys','Degree','修改長度(X方向)','_maxCacheCount','removeThing','not\x20a\x20string','RectangularSensorStyleConver','querySelectorAll','关闭键盘漫游','_muyao','top','_onRightClickHandler','features','glowPower','timeRender','delProperties','headTailFactor','_map_preRenderHandler','_pageIndex','修改半徑','pickFeatures','ArB','offsetY','thicknes','openPopup','avoidpolygons','#FFFFFF','enableTilt','_noPickEntity','hasMoveMatrix','coneTrack','getHeadingPitchRoll','_19','cesium-button\x20cesium-toolbar-button\x20mar3d-toolButton','FormatAltLength','Comm.\x20des\x20Poids\x20et\x20Mesures\x201799','_setCameraViewListArr','+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=45500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','sinphi','positionsWall','custom','_bindUpdateCallback','_measureHorLable','_bindToLayer','CylinderStyleConver','middleDown','directionWC','cirdrawGradientCircleCanvas','label','navigator','enableInputs','_orientation','getType','_type','multiplyByPointAsVector','_maxRangeLength','_attributeLocations','clippingPlanes','getBasemaps','_onAdd','lines','scanPlaneOpacity','pageSize','fa\x20fa-trello','_drawMouseMoveHandler','tilingScheme','1.0.0','uri','DataSourceDisplay','_textureTarget','_addLabel','_createGraphics','then','lam0','_points','zone','updateRadii','graphic_parent','updateAndExecuteCommands','initMinMap','neckHeightFactor','filter','local','setTemplateValues','getRectangle','_visibleColor','rotateAnimation','RENDER','appendChild','FeatureDetection','esriGeometryPolyline','ortho','PINCH_END','pickedObjects','_changeHeadingPitch','defaultValue','readPixels','potsdam','_canvas','_key_index','get','excludedKeys','_orientation_show','lastCameraView','getElementsByTagName','_map_preUpdateHandler','sizeInBytes','_frontFaceRS','FrustumOutlineGeometry','DefaultImageId','textAlign','_dragger_index','_isCallbackPositions','depthTestAgainstTerrain','_openByMouseEvent','_setPositions','EasingFunction','20210830','{\x20\x0a','_hasEditScale','退出全屏','clearMoveTargetDelay','fromScale','processFeatureCollection','modelMatrix','TranslationRotationScale','setCzmlTime','DrawDownJson','coord_type','_sampler','body','单击完成绘制','_sources','maximumLevel','afterquote','cancel','evrstSS','_popupPosition','graphicOptions','geos','insertIndex','PixelFormat','用于与DIV点进行对比测试位置的点','AREA_1','enableZoom','addGraphic','inverseTransformation','_createLabel','_isBindTileVisible','_mouseMoveHandle','EPSG:4523','_entity_outlines','Do\x20not\x20go\x20underground','undergroundColor','4326','string','fetchJsonp','isPrototypeOf','somerc','_updateOutlineStyle','_setPitchRange_mouseMoveHandler','closeTooltip','sin_p12','Airy\x201830','moveRight','\x0a\x0a\x20\x20\x0a\x20\x20\x0a','createVertices','MoveAll','MIDDLE_DRAG','_grids','yHalfAngle','polygonWall','parse','worldToLocal','buildModuleUrl','viewer','_videoPlay','_orbitMouseMoveFunction','toUpperCase','getSlope','open','longc','ows:Identifier','_material','TEXTURE_WRAP_T','content','onlyPickModelPosition','getBezierPoints','enabledMoveTarget','minPointNum','ellps','ad5f8b9d03f38f8f312025c80cfff4e3','_showPolyline','updateOrientation','rome','contextMenu','_useTiles','lat_ts','type','Cartesian3','Viewer','系统检测到您使用的浏览器不支持WebGL功能','mars3d-compass-rotation-arc','isInPush','handleSuccess','HeightReference','_tooltipConfig','raiseEvent','_getExtentView','in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20color;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0a\x0auniform\x20mat4\x20mars_orthographicMatrix;\x0auniform\x20mat4\x20mars_viewMatrix;\x0auniform\x20vec2\x20mars_resolution;\x0auniform\x20float\x20mars_pointSize;\x0aout\x20vec2\x20v_st;\x0aout\x20vec3\x20v_worldPos;\x0a\x0avec4\x20transform(mat4\x20m,\x20mat4\x20v,\x20vec3\x20coord)\x20{\x0a\x20\x20return\x20m\x20*\x20v\x20*\x20vec4(coord,\x201.0);\x0a}\x0avec2\x20project(vec4\x20device)\x20{\x0a\x20\x20vec3\x20device_normal\x20=\x20device.xyz\x20/\x20device.w;\x0a\x20\x20vec2\x20clip_pos\x20=\x20(device_normal\x20*\x200.5\x20+\x200.5).xy;\x0a\x20\x20return\x20clip_pos\x20*\x20mars_resolution;\x0a}\x0avec4\x20unproject(vec2\x20screen,\x20float\x20z,\x20float\x20w)\x20{\x0a\x20\x20vec2\x20clip_pos\x20=\x20screen\x20/\x20mars_resolution;\x0a\x20\x20vec2\x20device_normal\x20=\x20clip_pos\x20*\x202.0\x20-\x201.0;\x0a\x20\x20return\x20vec4(device_normal\x20*\x20w,\x20z,\x20w);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20vec3\x20currP\x20=\x20position3DHigh.xyz\x20+\x20position3DLow.xyz;\x0a\x20\x20v_worldPos\x20=\x20currP;\x0a\x20\x20vec4\x20eyeCurrP\x20=\x20transform(mars_orthographicMatrix,\x20mars_viewMatrix,\x20currP);\x0a\x20\x20vec2\x20winCurrP\x20=\x20project(eyeCurrP);\x0a\x20\x20vec3\x20dirEye\x20=\x20czm_viewRotation\x20*\x20color;\x0a\x20\x20dirEye\x20=\x20normalize(dirEye);\x0a\x0a\x20\x20vec2\x20newWinCurrP\x20=\x20winCurrP\x20+\x20dirEye.xy\x20*\x20mars_pointSize;\x0a\x20\x20gl_Position\x20=\x20unproject(newWinCurrP,\x20eyeCurrP.z,\x20eyeCurrP.w);\x0a\x20\x20gl_PointSize\x20=\x20mars_pointSize;\x0a}\x0a','ConstantPositionProperty','挖方体积','minimumRed','sources','Latitude_of_center','getQBSplinePoints','_showDomeLines','orientation','_framebuffer','fa\x20fa-moon-o','_xTable','ImageMaterialProperty','hue','getLoop','leftUp','minPitch','\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20vec2\x20colorTextureDimensions;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20depthTexture;\x0a\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskDepthTexture;\x0a\x20\x20\x20\x20uniform\x20float\x20thresholdAngle;\x0a\x20\x20\x20\x20uniform\x20bool\x20showOutlineOnly;\x0a\x0a\x20\x20\x20\x20uniform\x20float\x20outlineWidth;\x0a\x20\x20\x20\x20uniform\x20float\x20devicePixelRatio;\x0a\x20\x20\x20\x20uniform\x20vec3\x20visibleEdgeColor;\x0a\x20\x20\x20\x20uniform\x20vec3\x20hiddenEdgeColor;\x0a\x20\x20\x20\x20uniform\x20bool\x20useSingleColor;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20float\x20lengthSq(vec3\x20v){\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20v.x\x20*\x20v.x\x20+\x20v.y\x20*\x20v.y\x20+\x20v.z\x20*\x20v.z;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20float\x20normal_angleTo(vec3\x20a,vec3\x20b){\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20denominator\x20=\x20\x20sqrt(\x20\x20lengthSq(a)\x20*\x20lengthSq(b)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(\x20denominator\x20==\x200.\x20)\x20return\x20czm_pi\x20/\x202.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20theta\x20=\x20dot(a,\x20b\x20)\x20/\x20denominator;\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20clamp,\x20to\x20handle\x20numerical\x20problems\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20\x20acos(\x20\x20clamp(\x20theta,\x20-\x201.,\x201.\x20)\x20);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20compareNormal(vec4\x20n1,vec4\x20n2){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(\x20\x20abs\x20(\x20\x20normal_angleTo(\x20n1.xyz\x20,\x20n2.xyz\x20)\x20)\x20<\x20thresholdAngle\x20){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x200.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x201.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20compareDepth(const\x20in\x20vec2\x20uv){\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20maskDepth\x20=\x20czm_readDepth(\x20maskDepthTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20nonDepth\x20=\x20czm_readDepth(\x20depthTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20maskDepth>nonDepth?1.:0.;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20void\x20main(){\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv=v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20vec4\x20color\x20=\x20texture(\x20colorTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20maskColor\x20=\x20texture(\x20maskTexture,\x20vUv);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(\x20maskColor.a\x20<\x200.0001){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20invSize\x20=\x20outlineWidth\x20/\x20colorTextureDimensions;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20uvOffset\x20=\x20vec4(1.0,\x200.0,\x200.0,\x201.0)\x20*\x20vec4(invSize,\x20invSize);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c1\x20=\x20texture(\x20maskTexture,\x20vUv\x20+\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c2\x20=\x20texture(\x20maskTexture,\x20vUv\x20-\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c3\x20=\x20texture(\x20maskTexture,\x20vUv\x20+\x20uvOffset.yw);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c4\x20=\x20texture(\x20maskTexture,\x20vUv\x20-\x20uvOffset.yw);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(showOutlineOnly){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff1\x20=\x20(c1.a\x20-\x20c2.a)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff2\x20=\x20(c3.a\x20-\x20c4.a)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d\x20=\x20length(\x20vec2(diff1,\x20diff2)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff1\x20=\x20compareNormal(c1,c2)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff2\x20=\x20compareNormal(c3,c4)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d\x20=\x20length(\x20vec2(diff1,\x20diff2)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(useSingleColor==false){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp1\x20=\x20compareDepth(\x20vUv\x20+\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp2\x20=\x20compareDepth(\x20vUv\x20-\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp3\x20=\x20compareDepth(\x20vUv\x20+\x20uvOffset.yw);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp4\x20=\x20compareDepth(\x20vUv\x20-\x20uvOffset.yw);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20a1\x20=\x20min(dp1,\x20dp2);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20a2\x20=\x20min(dp3,\x20dp4);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20visibilityFactor\x20=\x20min(a1,\x20a2);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20edgeColor\x20=\x201.0\x20-\x20visibilityFactor\x20>\x200.001\x20?\x20visibleEdgeColor\x20:\x20hiddenEdgeColor;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color+\x20vec4(\x20edgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(\x20edgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color+\x20vec4(\x20visibleEdgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20\x20vec4(\x20visibleEdgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20','radius','clampTo3DTileset','polygon','_primitive','closePopup','evenColor','enableCollisionDetection','textBaseline','setValue','maxRadius','ENGINEERINGCRS','shapePositions','removed','velocity','__esModule','GeometryPipeline','tailWidthFactor','_fpsText','innerSvg','_level','last_highlighGraphic','_czmControlKey','getOutlineColorByStyle','GaodeRoute\x20请求出错','SkyAtmosphereNo','_minPointNum','isAnimate','display','bloomTarget','rotation_y','closePath','dimensions_z','sidesDashLength','clipTarget','offsetX','_rotateHpr','booleanPointInPolygon','edit','构造CesiumWidget时出错','DistanceDisplayCondition','areaSurfaceMeasure','_positions_circle_y','darkColor','getThings','CircleOutlineGeometry','SnowEffectNo','2830552Gjlwhd','startRotateMatrix','_positions_draw','qs2','_高度','concat','province','DrawRectangle','getParticleImage','_fireTarget_open','_moveDelayTik','beforeExecute','_removePit','frameNumber','_graphic_drawing','_rotateAutoStopAngle','BaseThing','debugAxisLength','_debug','buffer','toCartographic','createGuid','strokeColor','PolylineGlowMaterialProperty','perPositionHeight','easingFunction2','container','577.326,90.129,463.919,5.137,1.474,5.297,2.4232','moveToLayer','cesium-navigation-button-left','_removeMeasureLabelAndEx','_terrainHeight','+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=17500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_drawEndEventType','图片加载失败:','_createImageryProvider','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','rectangleP','鼠标左键+拖拽','SPHEROID','specify','_vertexFormat','positionShow','showIntersection','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','598.1,73.7,418.2,0.202,0.045,-2.455,6.7','keyup','_initSampledPositionProperty','_domeBackCommand','drawingBufferHeight','cssText','addMaterial','_updateLabelOpacity','TRIANGLES','sources3','visibleColor','_domeFrontCommand','fromArray','_hasEdit','unshift','mouseMove','_cylinderLength','tailRight','_angle','请输入地址...','debugExtent','hasChildLayer','cancelFlyTo','clampToGround','slice','_addedHook','_rangeNumber','_scanPlaneVA','convertMC2LL','select','DIRECTION_NONE','
地址:','backwardExtrapolationType','marsJzwStyle','diffusePower','getPixelSize','formatted_address','show','_oldPickPrimitive','utmSouth','_resource','','fromCartographic','layerDefs','drawAreaCommand','Feature','Oblique_Mercator','_addGraphic','_entity_scanPlane','czm_selectedIdTextureWidth','https://restapi.amap.com/v4/direction/bicycling','RELATIVE_TO_GROUND','getEntityPositions','_events','_hasResetEnableLighting','_flipY','wfs请求GetCapabilities出错','uniformMap','GroundPolylineGeometry','getValueOrDefault','toJSON','_initLayers','UNIT_X','arrayRemoveDuplicates','WHITE','img_z','padding','_packedInterpolationLength','updateAllNormal','BrA','neckAngle','Effect','geometryInstances','graphicGroup','视角切换','results','shaderCache','_removeGraphic','matrix','fromCartesian','labelCollection','bottomRadius','ADD','tan','_removeAreaHook','_jzmHeight','rotateMatrix','tileMatrixLabels','getDerivedResource','WGS84标准椭球,即\x20EPSG:4326','engelis','find','arrIDS','removeMapChilds','distanceSurfaceMeasure','clip','billboard','handleError','hasDrawDelPoint','toDegrees','_drawRemovePointHandler','ShadowMode','control','uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st\x20*\x202.0\x20-\x201.0;\x0a\x20\x20float\x20t\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0;\x0a\x20\x20vec3\x20col\x20=\x20vec3(0.0);\x0a\x20\x20vec2\x20p\x20=\x20vec2(sin(t),\x20cos(t));\x0a\x20\x20float\x20d\x20=\x20length(st\x20-\x20dot(p,\x20st)\x20*\x20p);\x0a\x20\x20if(dot(st,\x20p)\x20<\x200.)\x20{\x0a\x20\x20\x20\x20d\x20=\x20length(st);\x0a\x20\x20}\x0a\x0a\x20\x20col\x20=\x20.006\x20/\x20d\x20*\x20color.rgb;\x0a\x0a\x20\x20if(distance(st,\x20vec2(0))\x20>\x200.99)\x20{\x0a\x20\x20\x20\x20col\x20=\x20color.rgb;\x0a\x20\x20}\x0a\x0a\x20\x20material.alpha\x20=\x20pow(length(col),\x202.0)\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20col\x20*\x203.0;\x0a\x20\x20return\x20material;\x0a}\x0a','normalMap','long0','_lights','BaseLayerPicker','_command','ImageryLayer','false_northing','infinity_dist','floatToByte','Invalid\x20GeoJSON\x20object.','_updateStyleByEdit','mars3d-popup-animation','_setInsertIndex','_maxHeight','sceneMode','percentageChanged','invertClassification','color','pickImageryLayerFeatures','_initTilesetFlood','scanPlaneMode','rgba(241,\x20211,\x2087,\x20','CircleWave','MAX_VALUE','animateFrame','lang','pauseTime','_projection','radii_x','fetchXML','Modify\x20the\x20radius','toCssColorString','mars3d-clockAnimate','_positions_show','result','inverMatrix','cbg','mouseMoveTarget','alert','zoneLetter','change','arrLen','FID','_isColorMaterial','_viewMatrix','DiscardMissingTileImagePolicy','elevation','camera_changedHandler','inline','getByAttr','_updateClr','altColumn','cameraChanged','_getPolylineOutlinePositions','getAllResponseHeaders','ctx','Translation\x20by\x20axis','key','labelHeightStyle','sinX0','path','_createPit','toValue','_initByPosition','templateValues','Polygon','_measureLable','crosshair','_updateView','_enabledEditGrid','_updateDomAttributeByEvent','generateArc','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','FloodByMaterialType','uniform\x20float\x20globalAlpha;\x0auniform\x20float\x20opacity;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20if(move)\x20{\x0a\x20\x20\x20\x20float\x20r\x20=\x20sqrt((st.x\x20-\x200.8)\x20*\x20(st.x\x20-\x200.8)\x20+\x20(st.y\x20-\x200.8)\x20*\x20(st.y\x20-\x200.8));\x0a\x20\x20\x20\x20float\x20r2\x20=\x20sqrt((st.x\x20-\x200.2)\x20*\x20(st.x\x20-\x200.2)\x20+\x20(st.y\x20-\x200.2)\x20*\x20(st.y\x20-\x200.2));\x0a\x20\x20\x20\x20float\x20z\x20=\x20cos(moveVar.x\x20*\x20r\x20+\x20czm_frameNumber\x20/\x20100.0\x20*\x20moveVar.y)\x20/\x20moveVar.z;\x0a\x20\x20\x20\x20float\x20z2\x20=\x20cos(moveVar.x\x20*\x20r2\x20+\x20czm_frameNumber\x20/\x20100.0\x20*\x20moveVar.y)\x20/\x20moveVar.z;\x0a\x20\x20\x20\x20st\x20+=\x20sqrt(z\x20*\x20z\x20+\x20z2\x20*\x20z2);\x0a\x20\x20\x20\x20st.s\x20+=\x20direction\x20*\x20czm_frameNumber\x20/\x201000.0\x20*\x20speed;\x0a\x20\x20\x20\x20st.s\x20=\x20mod(st.s,\x201.0);\x0a\x20\x20}\x0a\x20\x20if(axisY)\x20{\x0a\x20\x20\x20\x20st\x20=\x20vec2(st.t,\x20st.s);\x0a\x20\x20}\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20material.alpha\x20=\x20opacity\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a','_last_url','labelStyleConver','SampledPositionProperty','face','_auto_availability','bloom','dirStep','getDate','commandList','luminanceAtZenith','labelStyle','clipOutSide','phi','star','heightLabel','Enable\x20keyboard\x20roaming','_container_rotationArc','GeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。','addOuter','minimumArr','tiles','_hideFeatures','regular','supportsImageRenderingPixelated','end','492yCwUqU','CylinderGeometry','BlackAndWhiteEffectYes','materialOptions','cereatePositionsAndIndice','divWidth','crs','_maskTexture','SlopeRamp','baseVal','+proj=tmerc\x20+lat_0=0\x20+lon_0=108\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','pick','column','names','https://api.map.baidu.com/reverse_geocoding/v3/','_hasTerrain','_noMousePick','lambda0','_showHook','keyCode','updatePlane','toCartesian','_updateTableLength','closeVurve','=([^&]*)(&|$)','east','noCenter','viewFrom','Texture','_workerName','PI_OVER_TWO','_rotateMouseUpFunction','queryParameters','enableControl','editing','fromDate','_propagateEvent','Null','Unknown','.cesium-performanceDisplay','默认数据图层','keyboardRoam','titleField','Export\x20GeoJSON','_positions_circle_x','time\x20is\x20required.','HomeButton','colorScheme','circleStyleConver','_arrPartMeasureLable','bloomEffect','_setPitchRange_rightUpHandler','webearth2','destroy','EPSG:4521','Scale_Factor','繞此處環繞飛行','Globe','drawShow','_readNode','circular_clone_topPoints','按轴旋转','TdtPOI:\x20请传入参location数','fromDegrees','onChange','#txt-clockAnimate-time','data1.mars3d.cn','unproject','_getItemDataId','_islosdImg','_PointEdit_YZ_TRANSLATION','colorHidden','stopMoveRight','editRemovePoint','promise','_updateDistanceDisplayConditionByEdit','getBaseLength','_mouseDown','_limitAngle','updateLengthForTerrain','_createOK','dataTypes','loadFields','_child','_labelEx','SCENE3D','ZERO','Mid','floodRect','sin_po','https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&gl=CN&x={x}&y={y}&z={z}','globalAlert','_uniforms_blendColor_alpha','uniforms','停止调整比例','停止编辑方向','polygonHierarchy','command','rayEllipsoid','showDomeLines','transparent','_createPlaneByLine','rotateStep','addHeight','silhouetteColor','maxSpan','loadCubeMap','changeBasemap','_removedHook','callback','pickPosition','_style2JsonBase','this.sources\x20properties\x20must\x20all\x20be\x20the\x20same\x20type.','visibleAreaColor','polylineVolumeStyleConver','start','defined','coslat0','swiss','arcgis_cache','_updateExOpacity','fa\x20fa-bullseye','stack','_pointEditElementIDs','_inverseProjectionDirty','pickEllipsoid','_yHalfAngle','_rotateInitialCameraAngle','_graphic_rotate_y','_rate_total','_heading','rectangle','editPlane','_layerIdx','floodAll','_frustumFar','_conventMarsOptions','_matrixRotate','locationData','縱坐標','central_meridian','_compassRectangle','RADIANS_PER_DEGREE','_unbindEvent','fillVolumeStr','uniform\x20vec4\x20color;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20out_FragColor\x20=\x20color;\x0a}\x0a','tooltipClose','#007be6','export','_getColorByColorMaterial','900913','Load\x20Model…','_textureFilterAnisotropic','_setPositionsToCallback','updateMatrix2','_clock','word','like','请求出错','updateStatus','alphaPower','_toOneCesiumVal_Point','moveStep','RIGHT_CLICK','WGS66','totalArea','_cluster','dataSource','call','removeLayer','_blur_comp','rightPoints','waypoints','upload','top:\x2010px;right:\x2010px;','482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15','_hasUpdate','_composites','texImage3D','loadBefore','midpoint','highDynamicRange','LINES','contourMaterial','paramsSerializer','Cesium3DTileset','createVertexBuffer','_buildImageResource',';\x0a\x20\x20\x20\x20\x20\x20if\x20(item.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20arrVec\x20=\x20[]\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(let\x20index\x20=\x200;\x20index\x20<\x20item.layers.length;\x20index++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20item2\x20=\x20item.layers[index]\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(item.templateValues)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20item2.templateValues\x20=\x20item.templateValues\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20temp\x20=\x20window._temp_mars3d_createImageryProvider(item2)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(temp\x20==\x20null)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20continue\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20arrVec.push(temp)\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20arrVec\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20window._temp_mars3d_createImageryProvider(item)\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}','scaleZ','fromPointNormal','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=19500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','lineOpacity','owner','openHighlight','openContextMenu','dth','eqc','双指向内或向外滑动','areaMeasure','CLAMP_TO_EDGE','_containerContent','offsetZ','redraw','_firingCount','tailorRect','changeMouseModel','_查看当前视角','_tileWidth','ion','_target','isPause','shaderSource','wfs','autoplay','removeAll','_zoomNavigation','cylinder','bgColor','geoidTiledTerrainProvider','lat1','testPoint','split','關閉三角網','_getEventByType','middleUp','offsetTop','autoMiddleDynamicPosition','activeAnimations','_graphicLayer','_updateDivPosition','resetFloodValue','.jpg','toPoints','PolygonStyleConver','onload','_polygonTexture','prototype','pointDM','_layers','cesium-baseLayerPicker-categoryTitle','_mScale','polylineVolume','Enable\x20snow','请引入\x20Cesium\x20库','_polylines','_resetCamera','wireframe','tabindex','_promise_resolve','_defaultTerrainProvider','pointer','_videoTexture','contextMenuOpen','_orbitCursorOpacity','originalColor','threshold','updatePosition','detail_info','airy','_drawLayer','bindContextMenu','_mouseMoveHandler','positions','hasMoveEdit','rings','getCacheOrAdd','PolygonHierarchy','closure','plane_normal','_index','_isDragger','rad);\x0a\x20\x20\x20\x20\x20\x20-webkit-transform\x20:\x20rotate(-','未知原因,导出失败!','getIntersectPoint','_billboardCollection','openSmallTooltipByMinPointNum','Northing\x20at\x20false\x20origin','polygonMaxHeight','gauss','_targetPoint','passState','createAttributeLocations','error','fogEffect','_reflectorProjectionMatrix','_boundingSphere','allCount','defaultLayer','_property','_highlightEnabled','LEFT_DOUBLE_CLICK','_last_picked','depthFail','flipy','_objectsToExclude_auto','CorridorGeometry','imageOptsConver','digVolumeStr','tips','_rotationAngle','_container_onMouseMoveHandler','CGCS2000_GK_Zone_3','terrainShadows','&label=','zoy','ShaderSource','position','multiplyByMatrix3','centerOfLine','cesium-baseLayerPicker-sectionTitle','preRender','thickWall','10px','Enable\x20sky\x20atmosphere','list','nadgrid','depthBias','_角度','_counts','ms\x20exceeded','EPSG:4518','hasEdit','loadOk','Central_Parallel','_last_preUpdateTime','TOP','当前浏览器不支持WebGL功能','lerch','RIGHT_DRAG','_右击菜单删除','showBox','rotation','multiply','纵坐标','Terrain','_scopeIds_last','toTop','getBisectorNormals','_clampToTilesetHeight','_center','outline','updateSectionForTerrain','_dimensions','property','chrome','EPSG4490','getArrayRandomOne','_prevCameraHeight','_关闭环绕飞行','_last_clockRange','关闭地形','_billboard2DList','polylineStyleConver','_cameraMoveStartHandler','contextmenu','info','WHEEL','background','showFrustum','getThingById','minimumTerrainLevel','TOP_ROTATE','_inverMatrix','_definitionChanged','postProcessStage','Latitude\x20of\x202nd\x20standard\x20parallel','lat','setIcon','Cartesian4','_arrLayer','UniformType','move','logarithmicDepthBuffer','Pass','backgroundColor','getAddHeight','roll','areaStr','standard_parallel_2','geocent','_bindControl','WallOutlineGeometry','moveLeft','EditClass','enu','#btn-clockAnimate-now','upGraphic','hiddenColor','_createVideoPrimitive','显示星空背景','billboardCollection','startMoveMatrix','drawCreated','tdt','_drawGrid','getPickedObject','screenSpaceCameraController','_lineColor_alpha','outlineStyle','_getDrawPointEntityClass','cameraMoveStart','brightness','uniform\x20vec4\x20color;\x0auniform\x20float\x20size;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20//Main\x20cellular\x20pattern\x0a\x20\x20vec4\x20color\x20=\x20color;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(st\x20/\x20size);\x0a\x20\x20color.rgb\x20-=\x20(F.x\x20/\x20F.y)\x20*\x200.1;\x0a\x0a\x20\x20//Extra\x20bumps\x20for\x20frequency\x0a\x20\x20float\x20noise\x20=\x20czm_snoise(st\x20/\x20size);\x0a\x20\x20noise\x20=\x20pow(noise,\x205.0)\x20*\x20frequency;\x0a\x20\x20color.rgb\x20+=\x20noise;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a','getCurrentOptions','_hasRemoveElement','startMoveRight','hough','_morphCompleteHandler','cesium-performanceDisplay','pointGrid','contextmenuItems','trim','_getOutlinePositions','layerY','terrainProvider','corridorStyleConver','UNPACK_COLORSPACE_CONVERSION_WEBGL','ns0','getAzimuth','fa\x20fa-yelp','showElseArea','entity','fa\x20fa-share-alt','_hasMouseOver','Clarke\x201858','pageIndex','multiplier','in\x20vec3\x20position;\x0auniform\x20mat3\x20u_rotateMatrix;\x0aout\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20p\x20=\x20czm_viewRotation\x20*\x20u_rotateMatrix\x20*\x20(czm_temeToPseudoFixed\x20*\x20(czm_entireFrustum.y\x20*\x20position));//【火星科技marsgis.cn】\x20Hao\x202019-9-18\x20\x20\x20天空盒\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20vec4(p,\x201.0);\x0a\x20\x20v_texCoord\x20=\x20position.xyz;\x0a}\x0a','_toJsonEx','ClassificationType','authority','_initTilingSchemeByCrs','drawCommand','offset','_updateContent','unbindUpdateEvent','thickness','ellipsoidStyleConver','EPSG:4512','Driving','_graphic_rotate_x','minimumImageSize','eia','realAlt','_pickImageryLayerFeatures','_mergeStyleToOptions','Control','stopPropagation','_attributes_color_alpha','getArcPoints','_tilesetMatrix','opacity','_primitive_label','mars3d-smallTooltip-rightArrow','frustumC','projections','clustering','fromRotationMatrix','step','_css_transform_origin','shadowMap','_setOptionsHook','setQueryParameters',');\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20return\x20isSelected;\x0a}\x0a\x20\x20\x20\x20','geocentric','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bindHighlight','_rectangle','HALF_PI','toCesiumVal','关闭下雨','mars3d-locationbar-content','axis','_originalreflectorWorldPosition','sources2','setRotationSvg','HH:mm:ss','SHORT','Axis','glow','getElementsByClassName','addAsync','Draw','_editMatrix','axisY','CircleScan','updateEnvironment','_停止按轴旋转','pinchEnd','getColorByStyle','undefined','_getWindowPosition','u_mars3d_flood_rangeNumber','_drawDelEventType','_stateAll','featureToGraphic','_tileLayer_addTileHandler','For\x20more\x20functions,\x20right\x20click','radii_y','DEFAULT_VIEW_RECTANGLE','image2','offsetLabel','getHours','longitude','maximumImageSize','(window._contextmenuItemClickResult)','splitDirection','視角切換','getFullYear','_fpsFrameCount','hasMeasure','_getModelMatrix','_last_fireIndex','ScreenSpaceEventType','_removeDynamicPosition','intersectionWidth','增加點','    ','LangType','_关闭包围盒','_clusterData','negativeX','_平方公里','farValue','_hasMoveEdit','html','PixelDatatype','LEFT_DRAG','controls','showDigVolume','_mapEx','divBillboard','UNLIT','_globeMouseHandler','MIDDLE_DOWN','upWC','mgrs','drawMouseMove','no_rot','updateDistanceDisplayCondition','cesium-viewer-animationContainer','SCENE2D','_contextmenuMgr','_enabledEdit','+proj=tmerc\x20+lat_0=0\x20+lon_0=126\x20+k=1\x20+x_0=42500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','leftPositions','_lateralSurfaceTranslucent','timeEndVal','azimuth','https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=','normalY','getPropertyIds','getPickTarget','queryGridData','_scopes','_clickTileGraphic','_initEffect','addScanPlane','_value','CLAMP_TO_GROUND','EPSG:4490','scene','subtract','_updateTerrainProvider','+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','uuid','_tilesetFlat','_cylinderBottomRadius','enableTranslate','I3SDataProvider','contourUniforms','colorOptsConver','referenceFrame','Geocent','MultipleSkyBox','https://restapi.amap.com/v3/assistant/inputtips','Mark\x20rectangular','planClip','_bottomPrimitive','inverseMatrix','stopFlicker','resolve','defaultAccessToken','setProperties','lune','lowerLatitude','_createDivGraphic','pointer-events','centerPoint','PerspectiveFrustum','_renderPassCache','_container_onMouseoutHandler','_initCollectionBy2D','interpolation','unit','credit','_values','_fixedLight','_getCreateEntityAttr','getAttribute','BLUE','1=1','place','

系统检测到您使用的浏览器不支持WebGL功能!

\x20\x20

1、请您检查浏览器版本,安装使用最新版chrome、火狐或IE11以上浏览器!

\x20

2、WebGL支持取决于GPU支持,请保证客户端电脑已安装显卡驱动程序!

','WGS60','geojson','updateClock','LineFlowColor','defaultDatum','_last_clickTime','_materialCache','_autoStopAngle','tileXYToNativeRectangle','修改宽度(Y方向)','Everest\x201830','_extentGraphic','Double_Stereographic','BoxGeometry','GEOCCS','_alt','distanceLastFd','frameRate','max','_reflectorWorldPosition','_isRotateStart','contextmenuOptions','pickWidth','headWidthFactor','_useSingleColor','UNIT','https://api.map.baidu.com/place/v2/search','round','_subdomains','maxScale','lon','_alpha','fill-opacity','del','classificationType','_editPointHandler','SceneTransforms','_释放后完成修改','formatData','maxCacheCount','px;\x20left:\x20','modelStyleConver','startAngle','begin','defineProperty','arrLayer','getPopup','_labelCollection','http://api.tianditu.gov.cn/v2/search','_instanceIds','getPickRay','ShadowMapShader','uniqueKey','fa\x20fa-info-circle','geocode','texture','distanceDisplayBillboard','_thingList','_修改宽度','latitude_of_center','_tileLayer','cesium-navigation-help-rotate','_waterPlane','getGraphics','web2D','_rotateDirection','_updateStyleBaseHook','REMOVED','_texture','_cylinderPosition','maxAlpha','drawStart','set','geometryInstanceAttributes','lastParameters','Cesium','GREEN','orderIndependentTranslucency','updateAreaForTerrain','Tileset','billboardP','(\x5cs|$)','_planeAngle','showPlane','关闭深度监测','splice','_showBox','data','_depthTest','intl','arrow','_updateOutlineOpacity','_frameRateHeight','ElevationContour','numberOfLevelZeroTilesX','ymax','angleStr','str','_shadowMapCamera','PolyUtil\x20turf.buffer:缓冲分析异常\x20','_wall_maximumHeights','stopTime','_clearDrawCommand','north','Oblique_Stereographic','getColumn','ms2','success','bjColor','_private','GRS\x201980(IUGG,\x201980)','_primitive4','_matrix4','_drawCommand','_mars3d_config','pixelOffsetX','_pixelFormat','updateStyle','updateVolume','_mapEx_extentChangeHandler','kml','fromRotationY','url','OBJECTID','mapBound','blue','Close\x20sky\x20atmosphere','divGraphicStyleConver','标记点','level','cesiumWidget','mergeOrientation','createElement','minorDragger','removeNullData','addLayer:图层id存在冲突,已重新赋值id','to_meter','windowPosition','_orbitCursorAngle','addArea','Property','showPointHeightLabel','hbgd','_backFaceRS','stroke-width','in\x20vec3\x20v_positionMC;\x0ain\x20vec3\x20v_positionEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(czm_normal3D\x20*\x20czm_geodeticSurfaceNormal(v_positionMC,\x20vec3(0.0),\x20vec3(1.0)));\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x20\x20materialInput.s\x20=\x20v_st.s;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x20\x20materialInput.str\x20=\x20vec3(v_st,\x200.0);\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.tangentToEyeMatrix\x20=\x20czm_eastNorthUpToEyeCoordinates(v_positionMC,\x20materialInput.normalEC);\x0a\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20\x20\x20#endif\x0a}\x0a','EPSILON6','onEnd','_isFlyAnimation','_effects',');\x0a}\x0a','fill','fromCartographicArray','keyWord','wms\x20extent:','rectangleStyleConver','_经度','_setClockOption','hasImage2','_hasLoad','rotateRight','moveCamera','algorithmUtil','_graphic_editing','_fxOnePointOk','_enabledMoveTarget','Ray','_showLateralSurfaces','morphStart','etmerc','446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894','effects','rectangles','cursorCSS','ZHHK','distortion','scaleByDistance_near','_primitiveCollection','Polyconic','maximumRequestsPerServer','getValueOrUndefined','isAutoEditing','digVolumeName','customProjectionMatrix','EllipsoidGeodesic','IndexDatatype','EPSG:4542','onDrag','_highlight_mouseOutHandler','fromCache','_arrLayerIdx','_debugAxis','_geocoder','请求失败(','_initMeasureLable','_面下','_translucent','contrast','拖动对象后','shallowClone','format','cacheTime','EPSG:4536','_orbitTickFunction','_root','transX','fa\x20fa-genderless','maxCanvasSize','_hasEditHeading','GaodePOI:\x20请传入参location数','miny','shift','lowerToBottom','toBottom','clone','heightStr','color2','DIRECTION_LEFT','VR模式不可用','normal','fromVertices','licenseUrl','morphComplete','_last_multiplier','high','B_re','circle','clockAnimate','esriGeometryPolygon','GeographicTilingScheme','rotateCamera','\x22.\x20State\x20is\x20','顯示星空背景','indexOf','getGeometryInstanceAttributes','GEODESIC','HH:mm:ss\x20S','datum','_map','sidesWidthRatio','_空间距离','left\x20click\x20add\x20point','vertex_H','output','\x22\x20placeholder=\x22请输入\x20','_orginCenterPosition','file:','#2747E0','_单击后激活编辑','_orbitFrame','TimeIntervalCollection','interPolygonObj','加载模型中…','debuggerPointEntity','modelToWorld','terrainExaggeration','_关闭下雨','union','SkyBox','sterea','_hasChangeDepthTestAgainstTerrain','\x22\x20in\x20keyword\x20yet,\x20index\x20','rgba(255,255,255,0.4)','_eventParents','_getOutlineStyle','EPSG:900913','RainEffectYes','arcType','關閉環繞飛行','username','lngLatToMercator','maximumRed','convertToReferenceFrame','Hotine\x20Oblique\x20Mercator','Matrix3','datum_type','rightDown','fromCssColorString','easting','centerOfMass','_metadataError','pow','getGridKey','_bindHierarchy','_modelUpAxis','_修改半径','pop','setHeight','lim','ShaderProgram','SkyBoxYes','extendedData','bottom','clampToTileset','增加点','image','DrawEditYes','_rightLayer','boundingSphere','_maxPitch','_position','useROI','drawCanvas','this.sources\x20is\x20required\x20and\x20must\x20have\x20positiveX,\x20negativeX,\x20positiveY,\x20negativeY,\x20positiveZ,\x20and\x20negativeZ\x20properties.','drawShowRadius','pois','forEach','vertexFormat','showFillVolume','headers','mousemove','mars3d-smallTooltip-arrow\x20mars3d-smallTooltip-rightArrow','addTo','flyToGraphic','fa\x20fa-pencil','setView','south','_clearDraw','_updateLabelPosition','_city','清除所有標記','toPng','_initTilesetPlanClip','left:\x20120px;\x20bottom:\x20','hasTooltip','_heightDraggers','_imageryProvider','_hasTerrainShadows','_distance','_colorCommands','pixelRange','_beginAnalysis','_addChildContainer','_graphicLayer_leftUp','_showThroughEllipsoid','LOCAL_CS','_hasChangeEnableInputs','multiplyByScalar','preventDefault','children','hasOpacity','flowGlow','maximumConeDegree','显示三角网','Framebuffer','childNodes','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out\x20vec3\x20vOutlineNormal_mars3d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20HAS_NORMAL_MARS3D\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d\x20=\x20normal;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20HAS_V_NORMAL_MARS3D\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d\x20=\x20v_normal;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d=vec3(0.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20','當前視角信息','120000|130000|190000','capabilities','imageryLayer','font','GeometryAttribute','fullExtent','addTileError','fullscreenElement','sin','fromGeometry','INERTIAL','scanPlane-','\x22\x20\x20class=\x22mars3d-tooltip\x20mars3d-tooltip-','_extrudedHeight','fromString','uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20glow;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0);\x0a\x20\x20t\x20*=\x201.03;\x0a\x0a\x20\x20float\x20alpha\x20=\x20smoothstep(t\x20-\x200.03,\x20t,\x20st.s)\x20*\x20step(-t,\x20-st.s);\x0a\x20\x20alpha\x20+=\x200.1;\x0a\x0a\x20\x20vec4\x20fragColor;\x0a\x20\x20fragColor.rgb\x20=\x20(color.rgb)\x20/\x200.5;\x0a\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x20\x20material.diffuse\x20=\x20fragColor.rgb;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.emission\x20=\x20fragColor.rgb\x20*\x20glow;\x0a\x20\x20return\x20material;\x0a}\x0a','_popupConfig','单击后激活编辑','_computedScanPlaneModelMatrix','_正在计算体积','areas','旋转视图','_clickHandler','_primitive_point','isClockWise','\x20and\x20BBOX(','addTile','_template','arcgis','definitionChanged','international','parentContainerId','getThirdPoint','_roiUV','div','ExtrapolationType','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjExQTg0NDEyMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjExQTg0NDEzMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTFBODQ0MTAwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTFBODQ0MTEwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz41vRwAAAAE90lEQVR42uydyW4UMRCG3T2dgYSAEGs4sp44cCJBcGUJbwCvALwWPAI8ABwAiUVwgLBdkEikJEiAGMhkZqhfU1aa1sy0g+yaJPyWSupOpPjz0uVyucrJer2eG2fJ3ZgLAQhAgC0PgN8XIlkqgGLE75oih0WmRVZEvop0rHog18rnRe6IzInsthyCXFt+TuSKyGmRXZZDgK5eFrkv8l7kiUhrxN/JSo3pigSvcNmI1bCh3b5LK2+NqHyvyEF9x3z5HgqRRViOAXhW5JrCoNdei/y20gMYxhmRSyIXRY6JTMT4DENLW+SdyD19x/NajDmwmYIW79Hnn+MA4GJEAAIQgABJbMJB+n5Sl9zWZvR9DABUfkJkVt8fi3zUldAEoKl24Y2S1fPZEmBdZFHkkb4vxTLRQ5djbyUf0ncYrD/UADUB8MZno2Q19yx7gIqIAAQgAAEIQIAtYZT+85LvRnjQCoPKR3rQUgN4Y3ZeK30g8qps0qeeAzDn4TWD9+ySG+BBS90DaGnVg9a2tgnR4il9/jkOACoiAhCAAASIZpAAFl6yulO0JACo/IDrn6CedP1zxOciv6wAYNnAP3RVBeWtJQCWzG8iL/X9g4vkqNzMctzUXtintt2KM/aS+bmQaY90rb8CF6tSKiICEIAABCAAAQiwbfcFIWVCbUcc9bZDLKiYAKj4uOv7Bb+ILLj+8W7PCgC7Jhzv44Qdh9yrru8V61jPgd645gD2io+15RiC5ZA5ENNPmGmDmtrta9YAVEQE2FlrQUM/J6efU8cSAD87ojodBaccS6kgiiErGiq/qe93XT+3oGU5BJnbyKrIUs6BQZoQUEcrQ7CYagiGqeKiMgnXLXsg5uJUm/RQJKy8fGS7PMw6SgVQPrJFGZr0kCfUL/7IFjIzrLGpemBQ0kPbehL6I9vMjUh6oEVEAAIQgAAEIAABdpyj0qcK71YrqGUJANNrv+sHOcAiRpDDM1cTY1BEHk7kqyP/2Ac5vLEEQEG8aDnIoTb5ObZRWg5ywG5o1dX4ClNYxT7IISgJPsXGpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=','noAlt','+proj=tmerc\x20+lat_0=0\x20+lon_0=78\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','PolylineColorAppearance','fromType','_minHeight','_modelViewProjectionDirty','unbindContextMenu','out_FragColor.rgb\x20=\x20out_FragColor.rgb;','_pageSize','time','calcVolume','terrain','_tags','_depth','_destroyResource','_hdr','flyToPoint','toolbar','length','text','BOTTOM','修改高度','querySelector','resolutionScale','aspectRampMaterial','ColorType','forwardExtrapolationType','_positionScratch','target','#f33349','MoveHeight','drawRemovePoint','11UbvTZr','basemaps','isInPoly','token','edgeWidth','loop','datum_params','updateControl','_onLeftDownHandler','eachChildGraphic','_getTargetInfo','_useROI','_maximumHeights','_intersectionColor','PROJECTION','_backwardExtrapolationType','Clear','secondsDifference','reverse','_addAreaHook','lat0','_getGeoJsonGeometry','setWhere','updateCamera','_keys','graphics','showVolume','Krovak','customShader','sigma','normalZ','bottomHeight','_onClickHandler_point','_startDrawHook','ondblclick','GEODCRS','box','_contextmenuItemClickShowResult','DrawEditNo','_previousTime','u_mars3d_flood_texture','_addPitGraphic','distanceDisplayCondition_far','MORPHING','Texture3','customTags','_fillColor','low','objectIds','WebMercatorProjection','heightVal','addItem','longlat','showMoon','_headingWhenLeftClicked','_pitch_min','_looking','wfs:','IAU\x201976','sk.eyJ1IjoibWFyc2dpcyIsImEiOiJjbDFhYXQ3a2EwaHF6M2NvdnhmdjR6ajZ2In0.-sahm9R0QuPP3pAihJHC4A','ALPHA_BLEND','getTileCredits','BOOL','.mars3d-sub-menu','_stat','_terrain_onLoadSuccess','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=15500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','Layer','eachLayer','位置信息','sidesColor','baseLayerPicker打开时,由baseLayerPicker机制决定,无法获取底图图层。','{z}','light','citylimit','img_d','_addCameraView','','maximumRadius','onlySelected','mouseover','_hasAsynSurfacePosition','_ellipsoid','橫坐標','_draw_tooltip','project','moveDuration','buildings','styleType','GEODETICDATUM','editType','mapCompare','surfaceDistance','_createPrimitive','showThroughEllipsoid','_updatePositionsHook','_createEntity','ellipse','stRotationDegree','canvas','_i3sProvider','maximumSizeZ','N_POLE','black','_graphic_move_z','MeasureHeight','hasClickEvent','GEODETICCRS','targetPoint','2060hYxdYZ','cos','distance','count','cloudStyleConver','ADDED','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20*','_container_inner','_processForRemoveLayer','enableLighting','lngLatToPoint','warn','mode','EPSG:4554','_array','imageryProvider','pointStyleConver','Plane','_getDrawEntityStyle','_enabledHook','tileLoadProgress','no_off'];_0x398f=function(){return _0x5e3c3b;};return _0x398f();}function formatRectangle(_0x149bfc,_0x1a0aeb=LngLatPoint['FormatLength']){const _0xab127a={_0x2ad8ac:0x27d,_0x943867:0x9c5},_0xe428b1=_0x35a251;let _0x243c15=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x149bfc[_0xe428b1(_0xab127a._0x2ad8ac)]),_0x1a0aeb),_0x27d657=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x149bfc['east']),_0x1a0aeb),_0x49c6ca=formatNum$1(Cesium__namespace['Math'][_0xe428b1(_0xab127a._0x943867)](_0x149bfc[_0xe428b1(0xcf2)]),_0x1a0aeb),_0x263fa7=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x149bfc['south']),_0x1a0aeb);if(_0x243c15>_0x27d657){const _0x4aa52a=_0x243c15;_0x243c15=_0x27d657,_0x27d657=_0x4aa52a;}if(_0x263fa7>_0x49c6ca){const _0x380353=_0x263fa7;_0x263fa7=_0x49c6ca,_0x49c6ca=_0x380353;}return{'xmin':_0x243c15,'xmax':_0x27d657,'ymin':_0x263fa7,'ymax':_0x49c6ca};}function getExtentByGeoJSON(_0x577577){const _0xdbbe05=bbox(_0x577577);if(_0xdbbe05&&_0xdbbe05['length']===0x4)return{'xmin':_0xdbbe05[0x0],'ymin':_0xdbbe05[0x1],'xmax':_0xdbbe05[0x2],'ymax':_0xdbbe05[0x3]};return null;}function getRectangle(_0x4f4e35,_0x1c9a28){const _0x530248=_0x35a251;if(!_0x4f4e35)return null;for(let _0x353afe=_0x4f4e35['length']-0x1;_0x353afe>=0x0;_0x353afe--){!Cesium__namespace['defined'](_0x4f4e35[_0x353afe])&&_0x4f4e35[_0x530248(0xce0)](_0x353afe,0x1);}_0x4f4e35=LngLatArray[_0x530248(0xcf)](_0x4f4e35);const _0x4a1784=Cesium__namespace['Rectangle']['fromCartesianArray'](_0x4f4e35);return _0x1c9a28?formatRectangle(_0x4a1784):_0x4a1784;}function getPositionsRectVertex(_0x4045c7,_0xad2460=0x0){const _0x109653={_0x385d00:0xcf},_0x5ec073=_0x35a251;_0x4045c7=LngLatArray[_0x5ec073(_0x109653._0x385d00)](_0x4045c7);const _0x254f9f=Cesium__namespace['Rectangle']['fromCartesianArray'](_0x4045c7),_0x7aacca=getMaxHeight(_0x4045c7),_0x20914c=getRectangleOuterPositions({'rectangle':_0x254f9f,'rotation':_0xad2460,'height':_0x7aacca});return _0x20914c;}function getRectangleOuterPositions(_0x1ec0ea){const _0x2491ab={_0x68d654:0x175,_0x446b93:0x175,_0x4530d7:0xf48,_0x614999:0x8eb},_0x58dbdc=_0x35a251,_0xa2f13=_0x1ec0ea[_0x58dbdc(0xab1)],_0x3b0550=_0x1ec0ea['rotation']??0x0,_0x1cc528=_0x1ec0ea[_0x58dbdc(0x682)]??0x0;if(_0x3b0550===0x0)return[Cesium__namespace['Cartesian3']['fromRadians'](_0xa2f13['west'],_0xa2f13['south'],_0x1cc528),Cesium__namespace['Cartesian3']['fromRadians'](_0xa2f13['east'],_0xa2f13['south'],_0x1cc528),Cesium__namespace['Cartesian3'][_0x58dbdc(_0x2491ab._0x68d654)](_0xa2f13['east'],_0xa2f13[_0x58dbdc(0xcf2)],_0x1cc528),Cesium__namespace['Cartesian3'][_0x58dbdc(_0x2491ab._0x446b93)](_0xa2f13['west'],_0xa2f13['north'],_0x1cc528)];const _0x44477a=_0x1ec0ea['granularity']??Cesium__namespace['Math'][_0x58dbdc(0xabc)],_0x4c05ee=new Cesium__namespace[(_0x58dbdc(0xd6))](),_0x469e2f=new Cesium__namespace['Cartographic'](),_0x34e24d=Cesium__namespace['RectangleGeometryLibrary']['computeOptions'](_0xa2f13,_0x44477a,_0x3b0550,0x0,_0x4c05ee,_0x469e2f),_0x5eca1d=_0x34e24d['height'],_0x185345=_0x34e24d[_0x58dbdc(_0x2491ab._0x4530d7)],_0x49cc16=_0x1ec0ea['ellipsoid']??Cesium__namespace['Ellipsoid']['WGS84'];let _0xf99396=[new Cesium__namespace['Cartesian3'](),new Cesium__namespace[(_0x58dbdc(0x8eb))](),new Cesium__namespace['Cartesian3'](),new Cesium__namespace[(_0x58dbdc(_0x2491ab._0x614999))]()];return Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x34e24d,_0x49cc16,![],0x0,0x0,_0xf99396[0x0]),Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x34e24d,_0x49cc16,![],0x0,_0x185345-0x1,_0xf99396[0x1]),Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x34e24d,_0x49cc16,![],_0x5eca1d-0x1,_0x185345-0x1,_0xf99396[0x2]),Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x34e24d,_0x49cc16,![],_0x5eca1d-0x1,0x0,_0xf99396[0x3]),_0x1cc528!==0x0&&(_0xf99396=setPositionsHeight(_0xf99396,_0x1cc528)),_0xf99396;}function getRectPositionsByCenter(_0x2587ca){const _0x45b209={_0x224f3c:0x176,_0x584033:0xb7a,_0x512477:0xb1,_0x26f57f:0xf39,_0x41b374:0x653,_0x45a4d9:0x40e,_0x1ae129:0x8eb},_0x9172c6=_0x35a251,_0x56017f=LngLatPoint['toCartesian'](_0x2587ca[_0x9172c6(_0x45b209._0x224f3c)]),_0x502046=_0x2587ca['width'],_0x2f5c04=_0x2587ca[_0x9172c6(0x682)],_0x3b06e9=_0x2587ca[_0x9172c6(_0x45b209._0x584033)]??0x0,_0x49fc09=_0x2587ca['originX']??0.5,_0x2725ad=_0x2587ca['originY']??0.5,_0x1d71bc=new Cesium__namespace['Matrix4'](),_0x56737f=new Cesium__namespace['Quaternion'](),_0x25a9d3=new Cesium__namespace['Matrix4'](),_0x9c1958=[Cesium__namespace[_0x9172c6(0x8eb)]['fromElements'](-_0x49fc09,-_0x2725ad,0x0),Cesium__namespace['Cartesian3'][_0x9172c6(_0x45b209._0x512477)](0x1-_0x49fc09,-_0x2725ad,0x0),Cesium__namespace['Cartesian3']['fromElements'](0x1-_0x49fc09,0x1-_0x2725ad,0x0),Cesium__namespace['Cartesian3']['fromElements'](-_0x49fc09,0x1-_0x2725ad,0x0)],_0x5af8d2=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x56017f,Cesium__namespace['Ellipsoid'][_0x9172c6(_0x45b209._0x26f57f)],_0x1d71bc),_0x147217=Cesium__namespace[_0x9172c6(_0x45b209._0x41b374)][_0x9172c6(_0x45b209._0x45a4d9)](Cesium__namespace[_0x9172c6(_0x45b209._0x1ae129)][_0x9172c6(0x61f)],_0x3b06e9,_0x56737f),_0x559f1a=Cesium__namespace['Matrix4']['fromTranslationQuaternionRotationScale'],_0x264617=_0x559f1a(Cesium__namespace['Cartesian3']['ZERO'],_0x147217,Cesium__namespace['Cartesian3'][_0x9172c6(_0x45b209._0x512477)](_0x502046,_0x2f5c04),_0x25a9d3),_0x4eb901=Cesium__namespace['Matrix4']['multiply'](_0x5af8d2,_0x264617,_0x264617),_0xc30dd5=[];return _0x9c1958['forEach'](function(_0x426c16,_0x49e741){typeof _0xc30dd5[_0x49e741]==='undefined'&&(_0xc30dd5[_0x49e741]=new Cesium__namespace['Cartesian3']()),Cesium__namespace['Matrix4']['multiplyByPoint'](_0x4eb901,_0x426c16,_0xc30dd5[_0x49e741]);}),_0xc30dd5;}function isInPoly(_0x176c79,_0x5006ce){const _0x36698a={_0x377173:0x98f},_0x1c6fcb=_0x35a251,_0x1325dc={'type':_0x1c6fcb(_0x36698a._0x377173),'geometry':{'type':'Point','coordinates':LngLatPoint['parse'](_0x176c79)['toArray']()}},_0x35a1c0={'type':_0x1c6fcb(0xa0b),'coordinates':[LngLatArray['toArray'](_0x5006ce)]};return booleanPointInPolygon(_0x1325dc,_0x35a1c0);}function getBezierCurve(_0x3e8124,_0x106734){const _0x1d0ec1={_0x3d9f09:0xe1e,_0x18f5c2:0x98f,_0x22857d:0x595},_0x44e498=_0x35a251;if(!_0x3e8124||_0x3e8124['length']<0x3)return _0x3e8124;const _0x49173f=LngLatArray['toArray'](_0x3e8124);_0x106734!==null&&_0x106734!==void 0x0&&_0x106734['closure']&&_0x49173f['push'](_0x49173f[0x0]);const _0x461899=_0x49173f[_0x49173f[_0x44e498(_0x1d0ec1._0x3d9f09)]-0x1][0x2],_0x575f4c=bezierSpline({'type':_0x44e498(_0x1d0ec1._0x18f5c2),'geometry':{'type':'LineString','coordinates':_0x49173f}},{'resolution':(_0x106734===null||_0x106734===void 0x0?void 0x0:_0x106734['resolution'])??0x2710,'sharpness':(_0x106734===null||_0x106734===void 0x0?void 0x0:_0x106734[_0x44e498(_0x1d0ec1._0x22857d)])??0.85}),_0x34f093=lonlats2cartesians(_0x575f4c['geometry'][_0x44e498(0x310)],_0x461899);return _0x106734!==null&&_0x106734!==void 0x0&&_0x106734['closure']&&_0x34f093['push'](_0x34f093[0x0]),_0x34f093;}function interPolyline(_0x266317){const _0xae01ae={_0x413889:0xc60,_0x2f8907:0xf9e,_0x4cfb04:0xc26,_0x4f29b9:0x6de},_0x25ba14=_0x35a251,_0x29653f=LngLatArray['toCartesians'](_0x266317['positions']),_0x12cbaa=_0x266317[_0x25ba14(_0xae01ae._0x413889)];let _0x3e04e6=getGranularity(_0x29653f,_0x266317['splitNum']||(_0x266317[_0x25ba14(0x5ba)]?0xa:0x64));_0x3e04e6<=0x0&&(_0x3e04e6=null);const _0x519402=Cesium__namespace[_0x25ba14(0x211)]['generateArc']({'positions':_0x29653f,'height':_0x266317[_0x25ba14(0x682)],'minDistance':_0x266317[_0x25ba14(_0xae01ae._0x2f8907)],'granularity':_0x3e04e6}),_0x3ad019=[];for(let _0x589d51=0x0;_0x589d51<_0x519402[_0x25ba14(0xe1e)];_0x589d51+=0x3){let _0x2dd386=Cesium__namespace['Cartesian3']['unpack'](_0x519402,_0x589d51);if(_0x12cbaa&&(_0x266317[_0x25ba14(0xc5)]??!![])){delete _0x266317['callback'];const _0x3c29ce=getHeight(_0x12cbaa,_0x2dd386,_0x266317),_0x32be26=Cesium__namespace['Cartographic']['fromCartesian'](_0x2dd386);_0x2dd386=Cesium__namespace['Cartesian3']['fromRadians'](_0x32be26[_0x25ba14(_0xae01ae._0x4cfb04)],_0x32be26['latitude'],_0x3c29ce);}_0x3ad019[_0x25ba14(_0xae01ae._0x4f29b9)](_0x2dd386);}return _0x3ad019;}function interLine(_0xc0758f,_0x544450={}){const _0x154607={_0x26b305:0xe1e,_0x461d54:0xaa2,_0x3b104d:0xf9e,_0x352050:0x60c,_0x39e5bf:0xa11,_0x18c677:0x682,_0x1372b6:0x120,_0x3da299:0x682,_0x5d28d8:0x8eb},_0x2047d0=_0x35a251;if(!_0xc0758f||_0xc0758f[_0x2047d0(_0x154607._0x26b305)]<0x2)return _0xc0758f;_0xc0758f=LngLatArray['toCartesians'](_0xc0758f);let _0x3dc114;_0x544450['splitNum']&&!Cesium__namespace[_0x2047d0(_0x154607._0x461d54)](_0x544450['minDistance'])&&(_0x3dc114=getGranularity(_0xc0758f,_0x544450['splitNum']),_0x3dc114<=0x0&&(_0x3dc114=null));if(_0x544450[_0x2047d0(_0x154607._0x3b104d)]==='auto'){let _0x5e4277=Number['MAX_VALUE'];for(let _0x1029f0=0x1,_0x15fe7c=_0xc0758f['length'];_0x1029f0<_0x15fe7c;_0x1029f0++){_0x5e4277=Math[_0x2047d0(_0x154607._0x352050)](_0x5e4277,Cesium__namespace['Cartesian3']['distance'](_0xc0758f[_0x1029f0-0x1],_0xc0758f[_0x1029f0]));}_0x544450[_0x2047d0(_0x154607._0x3b104d)]=_0x5e4277;}const _0xb00f18=[_0xc0758f[0x0]];for(let _0x48b4c1=0x1,_0x5f51d1=_0xc0758f['length'];_0x48b4c1<_0x5f51d1;_0x48b4c1++){const _0x56fdb2=_0xc0758f[_0x48b4c1-0x1],_0x35f148=_0xc0758f[_0x48b4c1],_0x4ec799=Cesium__namespace['PolylinePipeline'][_0x2047d0(_0x154607._0x39e5bf)]({'positions':[_0x56fdb2,_0x35f148],'minDistance':_0x544450[_0x2047d0(_0x154607._0x3b104d)],'granularity':_0x3dc114}),_0x1f74f2=Cesium__namespace[_0x2047d0(0x120)]['fromCartesian'](_0x56fdb2)[_0x2047d0(_0x154607._0x18c677)],_0x1394f5=Cesium__namespace[_0x2047d0(_0x154607._0x1372b6)]['fromCartesian'](_0x35f148)[_0x2047d0(_0x154607._0x3da299)],_0x32d0e5=(_0x1394f5-_0x1f74f2)/_0x4ec799['length'];for(let _0x545ce4=0x3,_0x38da70=_0x4ec799['length'];_0x545ce4<_0x38da70;_0x545ce4+=0x3){let _0x177b4d=Cesium__namespace['Cartesian3']['unpack'](_0x4ec799,_0x545ce4);const _0x1677ac=Cesium__namespace['Cartographic']['fromCartesian'](_0x177b4d),_0x5765ed=Number((_0x1f74f2+_0x32d0e5*_0x545ce4)['toFixed'](0x1));_0x177b4d=Cesium__namespace[_0x2047d0(_0x154607._0x5d28d8)][_0x2047d0(0x175)](_0x1677ac['longitude'],_0x1677ac[_0x2047d0(0x580)],_0x5765ed),_0xb00f18['push'](_0x177b4d);}}return _0xb00f18;}function computeSurfaceLine(_0xdefe00){const _0x19b43a={_0x18687e:0xe1e,_0xb9a152:0xaa1},_0x3ac4a4=_0x35a251,_0x2afe90=interPolyline({..._0xdefe00,'surfaceHeight':![]}),_0x132e22=[];for(let _0x4db8b7=0x0,_0x31beb3=_0x2afe90[_0x3ac4a4(_0x19b43a._0x18687e)];_0x4db8b7<_0x31beb3;++_0x4db8b7){_0x132e22['push'](_0x2afe90[_0x4db8b7]['clone']());}return _0xdefe00['positions']=_0x132e22,new SurfacePoints(_0xdefe00)[_0x3ac4a4(_0x19b43a._0xb9a152)]();}function computeSurfacePoints(_0x9cf3af){return new SurfacePoints(_0x9cf3af)['start']();}function computeStepSurfaceLine(_0x27f871){const _0x2fa931={_0x1efbc7:0xa9b,_0x22526c:0x6a4},_0x59ebe5=_0x35a251,_0x325aed=_0x27f871[_0x59ebe5(0xb35)],_0x104f6b=[],_0x502414={};for(const _0x346443 in _0x27f871){if(_0x346443==='positions'||_0x346443===_0x59ebe5(_0x2fa931._0x1efbc7)||_0x346443==='end'||_0x346443===_0x59ebe5(_0x2fa931._0x22526c))continue;_0x502414[_0x346443]=_0x27f871[_0x346443];}return new Promise((_0x2cce86,_0x314e10)=>{const _0x302016={_0x108ec9:0xa2d,_0x354bc0:0xb35};setTimeout(()=>{const _0x1d5b3c=_0x2767;let _0x12e90c=0x0;const _0x34e81d=_0x325aed[_0x1d5b3c(0xe1e)]-0x1;function _0x5058cc(){const _0x4330ac={_0x3e492e:0xb35},_0x4d5d54=_0x1d5b3c;if(_0x12e90c>=_0x34e81d){_0x27f871['callback']&&_0x27f871['callback'](_0x104f6b);_0x27f871['end']&&_0x27f871[_0x4d5d54(_0x302016._0x108ec9)](_0x104f6b);_0x2cce86(_0x104f6b);return;}_0x502414[_0x4d5d54(_0x302016._0x354bc0)]=interPolyline({..._0x27f871,'positions':[_0x325aed[_0x12e90c],_0x325aed[_0x12e90c+0x1]],'surfaceHeight':![]}),new SurfacePoints(_0x502414)['start']()['then'](_0x3e0dd2=>{const _0x1308b3=_0x4d5d54;_0x27f871['endItem']&&_0x27f871['endItem'](_0x3e0dd2[_0x1308b3(_0x4330ac._0x3e492e)],_0x3e0dd2['noHeight'],_0x12e90c),_0x104f6b[_0x1308b3(0x6de)](_0x3e0dd2['positions']),_0x12e90c++,_0x5058cc();});}_0x5058cc();},0x32);});}function getLinkedPointList(_0x2200fa,_0x423678,_0x1f4d30,_0x209414){const _0x3057c5={_0x626375:0x8eb,_0x44adfd:0x8eb,_0x2736d5:0xdef,_0x329d77:0x8eb,_0x3545e5:0xddc},_0x44137a=_0x35a251,_0x24ee4a=[];_0x2200fa=LngLatPoint['toCartesian'](_0x2200fa),_0x423678=LngLatPoint['toCartesian'](_0x423678);const _0x307679=Cesium__namespace['Cartographic']['fromCartesian'](_0x2200fa),_0x4f4a64=Cesium__namespace[_0x44137a(0x120)]['fromCartesian'](_0x423678),_0x4bcf5b=_0x307679['longitude']*0xb4/Math['PI'],_0x17dffb=_0x307679['latitude']*0xb4/Math['PI'],_0x5e1ce1=_0x4f4a64['longitude']*0xb4/Math['PI'],_0x46e9ca=_0x4f4a64['latitude']*0xb4/Math['PI'],_0xb5e69c=Math['sqrt']((_0x4bcf5b-_0x5e1ce1)*(_0x4bcf5b-_0x5e1ce1)+(_0x17dffb-_0x46e9ca)*(_0x17dffb-_0x46e9ca)),_0x4617c=_0xb5e69c*_0x1f4d30,_0x643540=Cesium__namespace['Cartesian3'][_0x44137a(0xd61)](_0x2200fa),_0x4a7d2b=Cesium__namespace['Cartesian3']['clone'](_0x423678),_0x2c2f69=Cesium__namespace['Cartesian3']['distance'](_0x643540,Cesium__namespace[_0x44137a(0x8eb)]['ZERO']),_0x111b1f=Cesium__namespace['Cartesian3']['distance'](_0x4a7d2b,Cesium__namespace[_0x44137a(_0x3057c5._0x626375)]['ZERO']);Cesium__namespace['Cartesian3']['normalize'](_0x643540,_0x643540),Cesium__namespace['Cartesian3']['normalize'](_0x4a7d2b,_0x4a7d2b);if(Cesium__namespace['Cartesian3']['distance'](_0x643540,_0x4a7d2b)===0x0)return _0x24ee4a;const _0x215420=Cesium__namespace[_0x44137a(_0x3057c5._0x44adfd)]['angleBetween'](_0x643540,_0x4a7d2b);_0x24ee4a['push'](_0x2200fa);for(let _0x271101=0x1;_0x271101<_0x209414-0x1;_0x271101++){const _0xd0858b=_0x271101*0x1/(_0x209414-0x1),_0x3f6562=0x1-_0xd0858b,_0x3694e5=Math[_0x44137a(_0x3057c5._0x2736d5)](_0x3f6562*_0x215420)/Math['sin'](_0x215420),_0x29d102=Math['sin'](_0xd0858b*_0x215420)/Math['sin'](_0x215420),_0x5e24c0=Cesium__namespace[_0x44137a(_0x3057c5._0x44adfd)]['multiplyByScalar'](_0x643540,_0x3694e5,new Cesium__namespace['Cartesian3']()),_0x56f61e=Cesium__namespace[_0x44137a(_0x3057c5._0x329d77)]['multiplyByScalar'](_0x4a7d2b,_0x29d102,new Cesium__namespace['Cartesian3']());let _0x2cb5ce=Cesium__namespace['Cartesian3']['add'](_0x5e24c0,_0x56f61e,new Cesium__namespace[(_0x44137a(0x8eb))]());const _0x3f403d=_0xd0858b*Math['PI'],_0x2f9c4f=_0x2c2f69*_0x3f6562+_0x111b1f*_0xd0858b+Math[_0x44137a(0xdef)](_0x3f403d)*_0x4617c;_0x2cb5ce=Cesium__namespace['Cartesian3'][_0x44137a(_0x3057c5._0x3545e5)](_0x2cb5ce,_0x2f9c4f,_0x2cb5ce),_0x24ee4a['push'](_0x2cb5ce);}return _0x24ee4a['push'](_0x423678),_0x24ee4a;}function getOffsetLine(_0x1fe6cc,_0x16574f){const _0x171e27={_0x38e1a2:0xe1e,_0x1b7910:0x8eb},_0xcb1572=_0x35a251;_0x1fe6cc=LngLatArray['toCartesians'](_0x1fe6cc);const _0x17edfc=[];for(let _0x44a446=0x1;_0x44a446<_0x1fe6cc[_0xcb1572(_0x171e27._0x38e1a2)];_0x44a446++){const _0x3c2814=_0x1fe6cc[_0x44a446-0x1],_0x2f8783=_0x1fe6cc[_0x44a446],_0x82c2d9=Cesium__namespace[_0xcb1572(_0x171e27._0x1b7910)]['subtract'](_0x3c2814,_0x2f8783,new Cesium__namespace['Cartesian3']()),_0x31301b=Cesium__namespace['Cartesian3']['cross'](_0x3c2814,_0x82c2d9,new Cesium__namespace['Cartesian3']()),_0x586ff1=computedOffsetData(_0x3c2814,_0x31301b,_0x16574f*0x3e8),_0x5dda23=computedOffsetData(_0x2f8783,_0x31301b,_0x16574f*0x3e8);_0x44a446===0x1&&_0x17edfc[_0xcb1572(0x6de)](_0x586ff1),_0x17edfc['push'](_0x5dda23);}return _0x17edfc;}function computedOffsetData(_0x5cb2f0,_0x27a9b4,_0x366624){const _0x212111={_0x1b2e20:0xf3},_0x5a9011=_0x35a251,_0x774ad4=new Cesium__namespace['Ray'](_0x5cb2f0,_0x27a9b4);return Cesium__namespace['Ray'][_0x5a9011(_0x212111._0x1b2e20)](_0x774ad4,_0x366624,new Cesium__namespace['Cartesian3']());}function sliceByMaxDistance(_0x3491b3,_0x37d5a0,_0x2e70a4={}){const _0x5d29cf={_0x36cc02:0xe1e,_0xcad081:0xe1e,_0x6a4db:0xeed,_0x5bdc94:0x97a,_0x427632:0x1ba},_0xff617f=_0x35a251;if(!_0x3491b3||_0x3491b3[_0xff617f(_0x5d29cf._0x36cc02)]<0x2)return _0x2e70a4['point']?_0x3491b3[_0xff617f(_0x5d29cf._0xcad081)]===0x1?_0x3491b3[0x0]:undefined:_0x3491b3;_0x3491b3=LngLatArray['toCartesians'](_0x3491b3);for(let _0x3e664f=_0x3491b3['length']-0x1;_0x3e664f>=0x1;_0x3e664f--){const _0x142ba9=_0x3491b3[_0x3e664f],_0x42e769=_0x3491b3[_0x3e664f-0x1],_0xedcbdc=Cesium__namespace['Cartesian3'][_0xff617f(_0x5d29cf._0x6a4db)](_0x142ba9,_0x42e769);_0x37d5a0-=_0xedcbdc;if(_0x37d5a0===0x0)return _0x2e70a4['point']?_0x142ba9:_0x3491b3[_0xff617f(_0x5d29cf._0x5bdc94)](_0x3e664f);else{if(_0x37d5a0<0x0){_0x37d5a0+=_0xedcbdc;const _0x16d883=getOnLinePointByLen(_0x142ba9,_0x42e769,_0x37d5a0);return _0x2e70a4[_0xff617f(0x1ba)]?_0x16d883:[_0x16d883]['concat'](_0x3491b3['slice'](_0x3e664f));}}}return _0x2e70a4[_0xff617f(_0x5d29cf._0x427632)]?_0x3491b3[_0x3491b3['length']-0x1]:_0x3491b3;}function convex(_0x519ece){const _0xce62fd={_0x54d420:0xe1e,_0x81a19f:0x98f},_0x1c026b=_0x35a251;if(_0x519ece['length']>0x0){const _0x2d9cf1=[];for(let _0x575441=0x0;_0x575441<_0x519ece[_0x1c026b(_0xce62fd._0x54d420)];_0x575441++){_0x2d9cf1['push']({'type':_0x1c026b(_0xce62fd._0x81a19f),'geometry':{'type':'Point','coordinates':_0x519ece[_0x575441]}});}const _0x12d51b=convex$1({'type':'FeatureCollection','features':_0x2d9cf1});if(_0x12d51b){var _0x49912e;const _0x43e4b2=_0x12d51b===null||_0x12d51b===void 0x0?void 0x0:(_0x49912e=_0x12d51b['geometry'])===null||_0x49912e===void 0x0?void 0x0:_0x49912e['coordinates'];_0x43e4b2&&_0x43e4b2['length']>0x0&&(_0x519ece=_0x43e4b2[0x0]);}}return _0x519ece;}function getGridPoints(_0x31a25c,_0x590ba8,_0x4b9c86){const _0x33d238={_0x4b7f60:0x8eb,_0x32494c:0xa6d,_0x38e925:0x76b},_0x279008=_0x35a251,_0xcfd7f5=Cesium__namespace[_0x279008(_0x33d238._0x4b7f60)]['distance'](Cesium__namespace['Cartesian3']['fromDegrees'](_0x31a25c[0x0],_0x31a25c[0x1]),Cesium__namespace['Cartesian3'][_0x279008(_0x33d238._0x32494c)](_0x31a25c[0x2],_0x31a25c[0x3]))/(Math['sqrt'](0x2)*0x3e8),_0x211f86=_0xcfd7f5/Math[_0x279008(_0x33d238._0x38e925)](_0x590ba8),_0x2a3e9d=pointGrid(_0x31a25c,_0x211f86,{'units':_0x279008(0x11b)}),_0x552bee=[];return _0x2a3e9d['features']['forEach'](_0x2d293e=>{const _0x148eb1=_0x279008,_0x161f81=_0x2d293e['geometry']['coordinates'];_0x552bee[_0x148eb1(0x6de)](new LngLatPoint(_0x161f81[0x0],_0x161f81[0x1],_0x4b9c86));}),{'points':_0x552bee,'radius':Math['floor'](_0x211f86*0x3e8/0x2)};}function getGridPointsByPoly(_0x1c8d42,_0x3eb490,_0x495ad1){const _0x1ca2ad={_0x54921d:0x6ba},_0x8d3158={_0x49d815:0x682},_0x44f9f0=_0x35a251;if(_0x1c8d42[_0x44f9f0(0xe1e)]<0x3)return;const _0x16827b=LngLatArray['toCartographics'](_0x1c8d42),_0x570c0a=Cesium__namespace[_0x44f9f0(0xaa2)](_0x495ad1),_0x208a1b=_0x16827b[0x0];let _0x13688f=_0x208a1b['longitude'],_0x5c9d23=_0x208a1b['longitude'],_0xccc01b=_0x208a1b['latitude'],_0x499e8a=_0x208a1b['latitude'],_0x2e7897=_0x570c0a?_0x495ad1:_0x208a1b['height'];const _0x3f5e93=_0x16827b[_0x44f9f0(0x457)](_0x5b74e2=>{const _0xfdcc04=_0x44f9f0;return _0x13688f=Math['min'](_0x13688f,_0x5b74e2['longitude']),_0xccc01b=Math['max'](_0xccc01b,_0x5b74e2[_0xfdcc04(0xc26)]),_0x5c9d23=Math['min'](_0x5c9d23,_0x5b74e2['latitude']),_0x499e8a=Math[_0xfdcc04(0xc9d)](_0x499e8a,_0x5b74e2['latitude']),!_0x570c0a&&(_0x2e7897=Math['max'](_0x2e7897,_0x5b74e2[_0xfdcc04(_0x8d3158._0x49d815)])),_0x5b74e2;}),_0x110566=[],_0x269e3b=_0xccc01b-_0x13688f,_0x658832=_0x499e8a-_0x5c9d23,_0x388ac4=_0x3eb490/distanceCoor([_0x13688f,_0x5c9d23],[_0xccc01b,_0x5c9d23]),_0x1b77aa=_0x3eb490/distanceCoor([_0x13688f,_0x5c9d23],[_0x13688f,_0x499e8a]),_0xac306=_0x388ac4*_0x269e3b,_0x4a2704=_0x1b77aa*_0x658832,_0x5cab04=Math[_0x44f9f0(_0x1ca2ad._0x54921d)](_0x269e3b/_0xac306),_0x46d274=Math['floor'](_0x658832/_0x4a2704),_0x627d3=(_0x269e3b-_0x5cab04*_0xac306)/0x2,_0x122b71=(_0x658832-_0x46d274*_0x4a2704)/0x2;let _0x141a5d=_0x13688f+_0x627d3;while(_0x141a5d<=_0xccc01b){let _0x1b9e60=_0x5c9d23+_0x122b71;while(_0x1b9e60<=_0x499e8a){if(isInside([_0x141a5d,_0x1b9e60],_0x3f5e93)){const _0x29841f=Cesium__namespace['Math']['toDegrees'](_0x141a5d),_0x5ee37d=Cesium__namespace['Math']['toDegrees'](_0x1b9e60);_0x110566['push'](new LngLatPoint(_0x29841f,_0x5ee37d,_0x2e7897));}_0x1b9e60+=_0x4a2704;}_0x141a5d+=_0xac306;}return _0x110566;}function distanceCoor(_0x338acd,_0x46c896){const _0x4ed0f4={_0xc1e738:0xda4},_0x2eb5db=_0x35a251,_0x129550=_0x46c896[0x1]-_0x338acd[0x1],_0x2b5554=_0x46c896[0x0]-_0x338acd[0x0],_0x2658cb=_0x338acd[0x1],_0x2e77dd=_0x46c896[0x1],_0x4f085d=Math[_0x2eb5db(0xda4)](Math['sin'](_0x129550/0x2),0x2)+Math[_0x2eb5db(_0x4ed0f4._0xc1e738)](Math['sin'](_0x2b5554/0x2),0x2)*Math['cos'](_0x2658cb)*Math[_0x2eb5db(0xeec)](_0x2e77dd);return 0x2*Math['atan2'](Math['sqrt'](_0x4f085d),Math['sqrt'](0x1-_0x4f085d))*6371008.8;}function isInside(_0x5196a1,_0x33de63){const _0x482cd1={_0x244f88:0x580,_0x49d983:0xc26},_0x57ea0a=_0x35a251;let _0x4d42ce=![];const _0x24002d=_0x33de63['length'],_0x398907=_0x5196a1[0x0],_0x58b0d6=_0x5196a1[0x1];let _0x2a756b=_0x33de63[0x0];for(let _0x590e47=0x0;_0x590e47<_0x24002d;_0x590e47++){let _0x1beb1a=_0x590e47+0x1;_0x1beb1a=_0x1beb1a===_0x24002d?0x0:_0x1beb1a;const _0x295adf=_0x33de63[_0x1beb1a];if(_0x2a756b['longitude']===_0x398907&&_0x2a756b['latitude']===_0x58b0d6||_0x295adf[_0x57ea0a(0xc26)]===_0x398907&&_0x295adf[_0x57ea0a(_0x482cd1._0x244f88)]===_0x58b0d6)return!![];else{if(_0x2a756b[_0x57ea0a(0x580)]<_0x58b0d6&&_0x295adf['latitude']>=_0x58b0d6||_0x2a756b['latitude']>=_0x58b0d6&&_0x295adf['latitude']<_0x58b0d6){const _0x4a9089=_0x2a756b[_0x57ea0a(0xc26)]+(_0x58b0d6-_0x2a756b['latitude'])*(_0x295adf['longitude']-_0x2a756b[_0x57ea0a(_0x482cd1._0x49d983)])/(_0x295adf['latitude']-_0x2a756b['latitude']);if(_0x4a9089===_0x398907)return!![];else _0x4a9089>_0x398907&&(_0x4d42ce=!_0x4d42ce);}}_0x2a756b=_0x295adf;}return _0x4d42ce;}function getHeightRangeByDepth(_0x4ce5cd,_0x4ce71f,_0x284d37){return new Promise((_0x1203b1,_0x112945)=>{setTimeout(()=>{const _0x3a1a35=interPolygonByDepth$1({..._0x284d37,'positions':_0x4ce5cd,'scene':_0x4ce71f});setTimeout(()=>{_0x1203b1(_0x3a1a35);},0xa);},0xa);});}function interPolygonByDepth(_0x5ab11a){return new Promise((_0x4860be,_0x2c8d47)=>{setTimeout(()=>{const _0x5a81c9=interPolygonByDepth$1(_0x5ab11a);setTimeout(()=>{_0x4860be(_0x5a81c9);},0xa);},0xa);});}function interPolylineByDepth(_0x258b81){return new Promise((_0x504fbe,_0x26a97d)=>{setTimeout(()=>{const _0x3d4cb0=interPolylineByDepth$1(_0x258b81);setTimeout(()=>{_0x504fbe(_0x3d4cb0);},0xa);},0xa);});}var PolyUtil={'__proto__':null,'centerOfMass':centerOfMass,'buffer':buffer,'bufferPoints':bufferPoints,'getGranularity':getGranularity,'interPolygon':interPolygon,'getHeightRange':getHeightRange,'computeVolume':computeVolume,'updateVolumeByMinHeight':updateVolumeByMinHeight,'updateVolume':updateVolume,'getEllipseOuterPositions':getEllipseOuterPositions,'formatRectangle':formatRectangle,'getExtentByGeoJSON':getExtentByGeoJSON,'getRectangle':getRectangle,'getPositionsRectVertex':getPositionsRectVertex,'getRectangleOuterPositions':getRectangleOuterPositions,'getRectPositionsByCenter':getRectPositionsByCenter,'isInPoly':isInPoly,'getBezierCurve':getBezierCurve,'interPolyline':interPolyline,'interLine':interLine,'computeSurfaceLine':computeSurfaceLine,'computeSurfacePoints':computeSurfacePoints,'computeStepSurfaceLine':computeStepSurfaceLine,'getLinkedPointList':getLinkedPointList,'getOffsetLine':getOffsetLine,'sliceByMaxDistance':sliceByMaxDistance,'convex':convex,'getGridPoints':getGridPoints,'getGridPointsByPoly':getGridPointsByPoly,'getHeightRangeByDepth':getHeightRangeByDepth,'interPolygonByDepth':interPolygonByDepth,'interPolylineByDepth':interPolylineByDepth};function getDistance(_0x3a7ae6,_0x3f2a9c){const _0xce3129={_0x3b3343:0x8eb},_0x29a206=_0x35a251,_0x4fb05e=_0x3a7ae6['length'];if(!Cesium__namespace[_0x29a206(0xaa2)](_0x3a7ae6)||_0x4fb05e<0x2)return 0x0;_0x3a7ae6=LngLatArray['toCartesians'](_0x3a7ae6);let _0x50e197=0x0;for(let _0x212b12=0x1;_0x212b12<_0x4fb05e;_0x212b12++){_0x50e197+=Cesium__namespace[_0x29a206(0x8eb)]['distance'](_0x3a7ae6[_0x212b12-0x1],_0x3a7ae6[_0x212b12]);}return _0x3f2a9c&&(_0x50e197+=Cesium__namespace[_0x29a206(_0xce3129._0x3b3343)]['distance'](_0x3a7ae6[0x0],_0x3a7ae6[_0x4fb05e-0x1])),_0x50e197;}function getSurfaceDistance(_0x1f543f){const _0x59bc20={_0x5be6bf:0x9b1,_0x34965e:0xeda},_0x52bb64=_0x35a251;if(!Cesium__namespace['defined'](_0x1f543f)||_0x1f543f[_0x52bb64(0xe1e)]<0x2)return 0x0;_0x1f543f=LngLatArray[_0x52bb64(0xcf)](_0x1f543f);let _0x43f34d=0x0;for(let _0x44c98e=0x1,_0x5e99ec=_0x1f543f['length'];_0x44c98e<_0x5e99ec;_0x44c98e++){const _0x4f5f5d=Cesium__namespace[_0x52bb64(0x120)]['fromCartesian'](_0x1f543f[_0x44c98e-0x1]),_0x201b48=Cesium__namespace['Cartographic'][_0x52bb64(_0x59bc20._0x5be6bf)](_0x1f543f[_0x44c98e]),_0x380401=new Cesium__namespace[(_0x52bb64(0xd43))]();_0x380401['setEndPoints'](_0x4f5f5d,_0x201b48);let _0x4f65f4=_0x380401[_0x52bb64(_0x59bc20._0x34965e)];_0x4f65f4=Math['sqrt'](Math['pow'](_0x4f65f4,0x2)+Math['pow'](_0x201b48['height']-_0x4f5f5d['height'],0x2)),_0x43f34d+=_0x4f65f4;}return _0x43f34d;}function getClampDistance(_0xbb6afe,_0x1dabd5){let _0x8af8ef=0x0;const _0x200811=[];return new Promise((_0x525ef9,_0x393b4b)=>{setTimeout(()=>{const _0x5cd17b={_0x10375d:0x328,_0x4b5a0a:0x6de,_0x4ab3e3:0x6a4},_0x507975=_0x2767;computeStepSurfaceLine({'scene':_0x1dabd5[_0x507975(0xc60)],'positions':_0xbb6afe,'splitNum':_0x1dabd5['splitNum'],'has3dtiles':_0x1dabd5['has3dtiles'],'exact':_0x1dabd5['exact']??!![],'endItem':function(_0x17b5f8,_0x24013b,_0x271fec){const _0x4a3857=_0x507975;let _0x46f59e=getSurfaceDistance(_0x17b5f8);_0x24013b&&_0x1dabd5[_0x4a3857(0x328)]&&(_0x46f59e=_0x46f59e*_0x1dabd5[_0x4a3857(_0x5cd17b._0x10375d)]),_0x8af8ef+=_0x46f59e,_0x200811[_0x4a3857(_0x5cd17b._0x4b5a0a)](_0x46f59e),_0x1dabd5[_0x4a3857(_0x5cd17b._0x4ab3e3)]&&_0x1dabd5['endItem']({'index':_0x271fec,'positions':_0x17b5f8,'distance':_0x46f59e,'arrDistance':_0x200811,'all_distance':_0x8af8ef});},'end':function(_0x1ffa0e){_0x1dabd5['callback']&&_0x1dabd5['callback'](_0x8af8ef),_0x1dabd5['end']&&_0x1dabd5['end'](_0x8af8ef),_0x525ef9({'distance':_0x8af8ef,'arrDistance':_0x200811,'arrPositions':_0x1ffa0e});}});},0x32);});}function getArea(_0x476610){const _0x1a815d={_0x261ce0:0xb61,_0x566916:0x8eb},_0x3cb230=_0x35a251;if(!_0x476610||!Array['isArray'](_0x476610)||_0x476610['length']<0x3)return 0x0;_0x476610=LngLatArray['toCartesians'](_0x476610);const _0x1c2ce0=Cesium__namespace[_0x3cb230(0x5af)]['createGeometry'](Cesium__namespace['CoplanarPolygonGeometry']['fromPositions']({'positions':_0x476610,'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']}));let _0x39581c=0x0;if(!_0x1c2ce0)return _0x39581c;const _0x481d6a=_0x1c2ce0['attributes'][_0x3cb230(_0x1a815d._0x261ce0)]['values'],_0x9c4e1f=_0x1c2ce0['indices'];for(let _0x564045=0x0;_0x564045<_0x9c4e1f['length'];_0x564045+=0x3){const _0x585084=Cesium__namespace['Cartesian3']['unpack'](_0x481d6a,_0x9c4e1f[_0x564045]*0x3,new Cesium__namespace['Cartesian3']()),_0x36b0af=Cesium__namespace[_0x3cb230(0x8eb)]['unpack'](_0x481d6a,_0x9c4e1f[_0x564045+0x1]*0x3,new Cesium__namespace[(_0x3cb230(_0x1a815d._0x566916))]()),_0x30f7f4=Cesium__namespace['Cartesian3']['unpack'](_0x481d6a,_0x9c4e1f[_0x564045+0x2]*0x3,new Cesium__namespace[(_0x3cb230(_0x1a815d._0x566916))]());_0x39581c+=getTriangleArea(_0x585084,_0x36b0af,_0x30f7f4);}return _0x39581c;}function getSurfaceArea(_0x57b077){const _0xde7466=_0x35a251;if(!_0x57b077||!Array['isArray'](_0x57b077)||_0x57b077['length']<0x3)return 0x0;const _0x3c7e9f=LngLatArray['toArray'](_0x57b077);_0x3c7e9f['length']>0x0&&_0x3c7e9f[_0xde7466(0x6de)](_0x3c7e9f[0x0]);const _0x185e10=area({'type':'Feature','geometry':{'type':'Polygon','coordinates':[_0x3c7e9f]}});return _0x185e10;}function getTriangleArea(_0x5c4328,_0xbd8204,_0x133135){const _0x3e5bc8={_0x1d2125:0x8eb},_0x1fc5be=_0x35a251,_0xb4a4d1=Cesium__namespace['Cartesian3']['subtract'](_0x5c4328,_0xbd8204,new Cesium__namespace['Cartesian3']()),_0xe6844e=Cesium__namespace['Cartesian3']['subtract'](_0x133135,_0xbd8204,new Cesium__namespace['Cartesian3']()),_0x1994cd=Cesium__namespace[_0x1fc5be(_0x3e5bc8._0x1d2125)]['cross'](_0xb4a4d1,_0xe6844e,_0xb4a4d1);return Cesium__namespace['Cartesian3']['magnitude'](_0x1994cd)*0.5;}function getClampArea(_0x2a1a56,_0x8dd9f){return interPolygon({'positions':_0x2a1a56,'exact':!![],..._0x8dd9f})['then'](_0x81c05a=>{let _0x129217=0x0;for(let _0x3bfd85=0x0,_0x4efad4=_0x81c05a['list']['length'];_0x3bfd85<_0x4efad4;_0x3bfd85++){const _0x4cec9a=_0x81c05a['list'][_0x3bfd85],_0x14807a=_0x4cec9a['point1'],_0x182e1d=_0x4cec9a['point2'],_0x353928=_0x4cec9a['point3'];_0x129217+=getTriangleArea(_0x14807a['pointDM'],_0x182e1d['pointDM'],_0x353928['pointDM']);}return _0x81c05a['area']=_0x129217,_0x8dd9f['callback']&&_0x8dd9f['callback'](_0x129217,_0x81c05a),_0x81c05a;});}function getAngle(_0x2fa7a7,_0x795c75,_0x40ce56){const _0x833680={_0xb0328a:0xd9d,_0x3f15d6:0xcf4,_0x1926a1:0xd9d,_0x2bf374:0xa84,_0x36b079:0x8eb,_0x129b34:0x5ec},_0x2a27da=_0x35a251;let _0x4b7b04=Cesium__namespace['Transforms'][_0x2a27da(0x67b)](_0x795c75);_0x4b7b04=Cesium__namespace[_0x2a27da(0x6a7)]['getMatrix3'](_0x4b7b04,new Cesium__namespace['Matrix3']());const _0x5263c2=Cesium__namespace[_0x2a27da(_0x833680._0xb0328a)]['getColumn'](_0x4b7b04,0x0,new Cesium__namespace['Cartesian3']()),_0xa45920=Cesium__namespace['Matrix3'][_0x2a27da(_0x833680._0x3f15d6)](_0x4b7b04,0x1,new Cesium__namespace[(_0x2a27da(0x8eb))]()),_0x44917c=Cesium__namespace[_0x2a27da(_0x833680._0x1926a1)]['getColumn'](_0x4b7b04,0x2,new Cesium__namespace[(_0x2a27da(0x8eb))]());let _0x58574e=Cesium__namespace[_0x2a27da(0x8eb)]['subtract'](_0x2fa7a7,_0x795c75,new Cesium__namespace['Cartesian3']());if(isNaN(_0x58574e['x'])||isNaN(_0x58574e['y'])||isNaN(_0x58574e['z'])||_0x58574e['equals'](Cesium__namespace['Cartesian3'][_0x2a27da(_0x833680._0x2bf374)]))return 0x0;_0x58574e=Cesium__namespace['Cartesian3']['cross'](_0x58574e,_0x44917c,_0x58574e),_0x58574e=Cesium__namespace[_0x2a27da(_0x833680._0x36b079)]['cross'](_0x44917c,_0x58574e,_0x58574e),_0x58574e=Cesium__namespace['Cartesian3']['normalize'](_0x58574e,_0x58574e);let _0x31d4f6=Cesium__namespace['Cartesian3']['angleBetween'](_0x5263c2,_0x58574e);const _0x57a7d1=Cesium__namespace['Cartesian3'][_0x2a27da(_0x833680._0x129b34)](_0xa45920,_0x58574e);_0x57a7d1>Math['PI']*0.5&&(_0x31d4f6=0x2*Math['PI']-_0x31d4f6);let _0x5c14ac=0x168-Cesium__namespace['Math'][_0x2a27da(0x9c5)](_0x31d4f6)-0xb4;_0x40ce56&&(_0x5c14ac+=0x5a);if(_0x5c14ac<0x0)_0x5c14ac=_0x5c14ac+0x168;else _0x5c14ac>0x168&&(_0x5c14ac=_0x5c14ac-0x168);return _0x5c14ac;}function formatDistance(_0x5acc31,_0x5026e0={}){const _0x35df33={_0x482181:0xc81,_0x5aec9e:0xf0a,_0x4d317b:0x793,_0x4a0493:0x9e3,_0x3e430d:0x2c0},_0x2263f5=_0x35a251;if(_0x5acc31==null)return'';_0x5acc31=Number(_0x5acc31);if(isNaN(_0x5acc31)||_0x5acc31===0x0)return'';isString(_0x5026e0)&&(_0x5026e0={'unit':_0x5026e0});(_0x5026e0[_0x2263f5(_0x35df33._0x482181)]==null||_0x5026e0[_0x2263f5(_0x35df33._0x482181)]==='auto')&&(_0x5acc31<0x3e8?_0x5026e0['unit']='m':_0x5026e0['unit']='km');_0x5026e0['decimal']=_0x5026e0['decimal']??0x2;let _0x3e9fa5='';switch(_0x5026e0[_0x2263f5(_0x35df33._0x482181)]){case'km':_0x3e9fa5=(_0x5acc31*0.001)[_0x2263f5(_0x35df33._0x5aec9e)](_0x5026e0[_0x2263f5(_0x35df33._0x4d317b)])+getLangText('_公里',_0x5026e0[_0x2263f5(_0x35df33._0x4a0493)]);break;case'wm':_0x3e9fa5=(_0x5acc31*0.0001)['toFixed'](_0x5026e0['decimal'])+getLangText('_万米',_0x5026e0['lang']);break;case'mile':_0x3e9fa5=(_0x5acc31*0.00054)[_0x2263f5(0xf0a)](_0x5026e0[_0x2263f5(_0x35df33._0x4d317b)])+getLangText(_0x2263f5(_0x35df33._0x3e430d),_0x5026e0['lang']);break;case'zhang':_0x3e9fa5=(_0x5acc31*0.3)['toFixed'](_0x5026e0['decimal'])+getLangText('_丈',_0x5026e0['lang']);break;case'm':default:_0x3e9fa5=_0x5acc31['toFixed'](_0x5026e0['decimal'])+getLangText('_米',_0x5026e0['lang']);break;}return _0x3e9fa5;}function formatArea(_0x54c80d,_0x4d584e={}){const _0x4cb51b={_0x3ec642:0xc81,_0x2a42bf:0x9e3,_0x453715:0x9e3},_0x40f052=_0x35a251;if(_0x54c80d==null)return'';_0x54c80d=Number(_0x54c80d);if(isNaN(_0x54c80d)||_0x54c80d===0x0)return'';isString(_0x4d584e)&&(_0x4d584e={'unit':_0x4d584e});(_0x4d584e['unit']==null||_0x4d584e['unit']==='auto')&&(_0x54c80d<0xf4240?_0x4d584e['unit']='m':_0x4d584e[_0x40f052(_0x4cb51b._0x3ec642)]='km');_0x4d584e['decimal']=_0x4d584e['decimal']??0x2;let _0x42ec27='';switch(_0x4d584e['unit']){case'km':_0x42ec27=(_0x54c80d/0xf4240)['toFixed'](_0x4d584e['decimal'])+getLangText(_0x40f052(0xc39),_0x4d584e[_0x40f052(_0x4cb51b._0x2a42bf)]);break;case'mu':_0x42ec27=(_0x54c80d*0.0015)['toFixed'](_0x4d584e['decimal'])+getLangText('_亩',_0x4d584e[_0x40f052(_0x4cb51b._0x453715)]);break;case'ha':_0x42ec27=(_0x54c80d*0.0001)[_0x40f052(0xf0a)](_0x4d584e[_0x40f052(0x793)])+getLangText('_公顷',_0x4d584e['lang']);break;case'm':default:_0x42ec27=_0x54c80d['toFixed'](_0x4d584e['decimal'])+getLangText('_平方米',_0x4d584e['lang']);break;}return _0x42ec27;}function formatVolume(_0xa371d9,_0x43769a={}){const _0x5b7ace={_0xee2c4b:0xf0a,_0x30d1a0:0x793,_0x498289:0xf0a},_0x3eaf6c=_0x35a251;if(_0xa371d9==null)return'';_0xa371d9=Number(_0xa371d9);if(isNaN(_0xa371d9)||_0xa371d9===0x0)return'';_0x43769a[_0x3eaf6c(0x793)]=_0x43769a[_0x3eaf6c(0x793)]??0x2;if(_0x43769a[_0x3eaf6c(0x9e3)]===LangType['EN'])return _0xa371d9[_0x3eaf6c(_0x5b7ace._0xee2c4b)](_0x43769a['decimal'])+getLangText('_立方米',_0x43769a['lang']);return _0xa371d9<0x2710?_0xa371d9['toFixed'](_0x43769a[_0x3eaf6c(_0x5b7ace._0x30d1a0)])+getLangText('_立方米',_0x43769a[_0x3eaf6c(0x9e3)]):(_0xa371d9/0x2710)[_0x3eaf6c(_0x5b7ace._0x498289)](_0x43769a['decimal'])+getLangText('_万立方米',_0x43769a['lang']);}var MeasureUtil={'__proto__':null,'getDistance':getDistance,'getSurfaceDistance':getSurfaceDistance,'getClampDistance':getClampDistance,'getArea':getArea,'getSurfaceArea':getSurfaceArea,'getTriangleArea':getTriangleArea,'getClampArea':getClampArea,'getAngle':getAngle,'formatDistance':formatDistance,'formatArea':formatArea,'formatVolume':formatVolume};function register$3(_0x158d36,_0x2d19be){const _0x1f8fcd={_0x2a752a:0xc91,_0x3e0f7f:0x8ea},_0x4681c0=_0x35a251;Cesium__namespace[_0x4681c0(0x100)][_0x4681c0(_0x1f8fcd._0x2a752a)]['getMaterial'](_0x158d36)&&logError$1('MaterialUtil\x20register:\x20'+_0x158d36+'类型已存在',_0x2d19be),MaterialTypes[_0x158d36]=_0x158d36,Cesium__namespace['Material'][_0x158d36+'Type']=_0x158d36,_0x2d19be[_0x4681c0(0x628)]&&(_0x2d19be['fabric'][_0x4681c0(_0x1f8fcd._0x3e0f7f)]=_0x158d36),Cesium__namespace['Material']['_materialCache'][_0x4681c0(0x968)](_0x158d36,_0x2d19be);}const OptsConverClass={};function registerOptsConver(_0x343d6c,_0x5cc1ed){OptsConverClass[_0x343d6c]&&logError$1('MaterialUtil\x20registerOptsConver:\x20'+_0x343d6c+'类型已存在',_0x5cc1ed),OptsConverClass[_0x343d6c]=_0x5cc1ed;}const MaterialClass={},MaterialTypes={};function registerClass(_0x27b071,_0x49d3cf){const _0x11848f=_0x35a251;MaterialTypes[_0x27b071]&&logError$1('MaterialUtil\x20registerClass:\x20'+_0x27b071+_0x11848f(0x480),_0x49d3cf),MaterialClass[_0x27b071]=_0x49d3cf,MaterialTypes[_0x27b071]=_0x27b071;}const MaterialPropertyClass={};function registerPropertyClass(_0x576af0,_0x578d86){MaterialPropertyClass[_0x576af0]&&logError$1('MaterialUtil\x20registerPropertyClass:\x20'+_0x576af0+'属性类型已存在',_0x578d86),MaterialPropertyClass[_0x576af0]=_0x578d86;}function createMaterialProperty(_0x54b6c2,_0x4c1100){const _0xe9a00c={_0x3a06c1:0xe86,_0x2e5429:0xfb8},_0x4c201e=_0x35a251,_0x34d818=MaterialPropertyClass[_0x54b6c2];if(_0x34d818){const _0x184047=OptsConverClass[_0x54b6c2]||OptsConverClass['default'];_0x184047&&(_0x4c1100['materialType']=_0x54b6c2,_0x4c1100=_0x184047['toCesiumVal'](_0x4c1100,{},!![]));const _0x568830=new _0x34d818(_0x4c1100);return _0x568830['_mars_type']=_0x54b6c2,_0x568830[_0x4c201e(_0xe9a00c._0x3a06c1)]=_0x4c1100,_0x568830;}else logWarn(_0x4c201e(_0xe9a00c._0x2e5429),_0x54b6c2);}function createMaterial(_0x471f6c,_0x550688){const _0x4ec2a8={_0x4c0911:0x171},_0x409b82=_0x35a251;if(!_0x471f6c){logError$1('createMaterial:请指定mars3d.MaterialType类型');return;}const _0x55be86=OptsConverClass[_0x471f6c]||OptsConverClass[_0x409b82(_0x4ec2a8._0x4c0911)];_0x55be86&&(_0x550688['materialType']=_0x471f6c,_0x550688=_0x55be86[_0x409b82(0xc04)](_0x550688));let _0x27b8af;const _0x724671=MaterialClass[_0x471f6c];return _0x724671?_0x27b8af=new _0x724671(_0x550688):_0x27b8af=Cesium__namespace[_0x409b82(0x100)]['fromType'](_0x471f6c,_0x550688),_0x27b8af['options']=_0x550688,_0x27b8af['_mars_type']=_0x471f6c,_0x27b8af;}function hasMaterial(_0x3948b3,_0x15f9fe){return _0x15f9fe?Boolean(MaterialPropertyClass[_0x3948b3]):Boolean(MaterialTypes[_0x3948b3]);}function toJSON(_0xeef508,_0x32b703={}){const _0x3a98f7={_0x8628bb:0x37a,_0x22698e:0x171,_0x5b0cb8:0x99e},_0x313b43=_0x35a251;var _0x4d55e4;let _0x4ed9c1;if(_0xeef508['_mars_type'])_0x4ed9c1=_0xeef508[_0x313b43(_0x3a98f7._0x8628bb)];else{if(_0xeef508!==null&&_0xeef508!==void 0x0&&(_0x4d55e4=_0xeef508[_0x313b43(0xe02)])!==null&&_0x4d55e4!==void 0x0&&_0x4d55e4['type'])_0x4ed9c1=_0xeef508['_template']['type'];else _0xeef508!==null&&_0xeef508!==void 0x0&&_0xeef508['getType']&&(_0x4ed9c1=_0xeef508['getType']());}if(!_0x4ed9c1){if(_0xeef508 instanceof Cesium__namespace[_0x313b43(0xf29)])_0x4ed9c1='Color';else{if(_0xeef508 instanceof HTMLVideoElement)return;else logWarn('toJSON:未识别的材质类型',_0xeef508);}}const _0xa78fd3=OptsConverClass[_0x4ed9c1]||OptsConverClass[_0x313b43(_0x3a98f7._0x22698e)];return _0xa78fd3&&(_0x32b703['materialType']=_0x4ed9c1,_0x32b703['materialOptions']=_0xa78fd3[_0x313b43(_0x3a98f7._0x5b0cb8)](_0xeef508)),_0x32b703;}function toJSONByType(_0x2cde90,_0x1cca69){const _0x2eec1e={_0x2f9399:0x171},_0x2eec70=_0x35a251,_0x3e1834=OptsConverClass[_0x2cde90]||OptsConverClass[_0x2eec70(_0x2eec1e._0x2f9399)];return _0x3e1834?_0x3e1834['toJSON'](_0x1cca69):_0x1cca69;}function addTextureUniform(_0x1c1713){const _0xa142af={_0x4b2f50:0x137,_0xc29f18:0x45e,_0x438a31:0xf54},_0x1c3d00={_0x3ab108:0xf48,_0xc8365f:0x61b},_0x358b2c=_0x35a251,{context:_0x564a74,material:_0x7bea14,uniformName:_0x51d94a,image:_0x5b980b}=_0x1c1713,_0x346598=_0x1c1713[_0x358b2c(_0xa142af._0x4b2f50)]||Cesium__namespace['TextureWrap']['REPEAT'],_0xd2d74d=_0x1c1713['wrapT']||Cesium__namespace['TextureWrap']['REPEAT'],_0x1a4f6d=_0x1c1713[_0x358b2c(_0xa142af._0xc29f18)]||Cesium__namespace['TextureMinificationFilter']['LINEAR'],_0x22c67d=_0x1c1713['magnificationFilter']||Cesium__namespace[_0x358b2c(0x6ac)][_0x358b2c(_0xa142af._0x438a31)],_0x183b70=new Image();_0x183b70['src']=_0x5b980b,_0x183b70['addEventListener']('load',()=>{const _0xc7d8f1=_0x358b2c,_0x3c7ade=new Cesium__namespace['Texture']({'context':_0x564a74,'source':_0x183b70,'sampler':new Cesium__namespace['Sampler']({'wrapS':_0x346598,'wrapT':_0xd2d74d,'minificationFilter':_0x1a4f6d,'magnificationFilter':_0x22c67d})});_0x3c7ade['type']='sampler2D',isPowerOfTwo(_0x183b70[_0xc7d8f1(_0x1c3d00._0x3ab108)])&&isPowerOfTwo(_0x183b70['height'])&&_0x3c7ade['generateMipmap'](Cesium__namespace[_0xc7d8f1(_0x1c3d00._0xc8365f)]['NICEST']),_0x7bea14['uniforms'][_0x51d94a]=_0x3c7ade;});}function isPowerOfTwo(_0x5aa993){return(_0x5aa993&_0x5aa993-0x1)===0x0&&_0x5aa993!==0x0;}var MaterialUtil={'__proto__':null,'register':register$3,'registerOptsConver':registerOptsConver,'registerClass':registerClass,'registerPropertyClass':registerPropertyClass,'createMaterialProperty':createMaterialProperty,'createMaterial':createMaterial,'hasMaterial':hasMaterial,'toJSON':toJSON,'toJSONByType':toJSONByType,'addTextureUniform':addTextureUniform};const PointType={'Control':0x1,'MoveAll':0x2,'AddMidPoint':0x3,'MoveHeight':0x4,'EditAttr':0x5,'EditRotation':0x6},PointColor={'Control':'rgba(28,25,125,0.99)','MoveAll':'rgba(140,0,58,0.99)','MoveHeight':'rgba(149,0,235,0.99)','EditAttr':_0x35a251(0xe98),'AddMidPoint':_0x35a251(0x197)};let defaultEditStyle={'pixelSize':0xc,'outline':!![],'outlineColor':'rgba(255,255,255,0.5)','outlineWidth':0x2,'scaleByDistance':new Cesium__namespace['NearFarScalar'](0x3e8,0x1,0xf4240,0.5),'disableDepthTestDistance':Number['POSITIVE_INFINITY']};function setPointStyle(_0x53d76c){defaultEditStyle=merge(defaultEditStyle,_0x53d76c);}function getEditPointStyle(_0x36761a){const _0x33db39={_0xaa3db:0x696,_0x42779f:0xd91,_0x58e2fa:0x9db,_0x16cee1:0x5be},_0x536289=_0x35a251,_0x370925={...defaultEditStyle};switch(_0x36761a){case PointType[_0x536289(_0x33db39._0xaa3db)]:_0x370925['color']=PointColor[_0x536289(0x696)],_0x370925['outlineColor']=_0x536289(_0x33db39._0x42779f);break;case PointType['MoveAll']:_0x370925['color']=PointColor['MoveAll'];break;case PointType['MoveHeight']:_0x370925[_0x536289(_0x33db39._0x58e2fa)]=PointColor['MoveHeight'];break;case PointType[_0x536289(_0x33db39._0x16cee1)]:_0x370925[_0x536289(_0x33db39._0x58e2fa)]=PointColor['EditAttr'];break;case PointType['Control']:default:_0x370925['color']=PointColor['Control'];break;}return _0x370925;}var DrawUtil={'__proto__':null,'PointType':PointType,'PointColor':PointColor,'setPointStyle':setPointStyle,'getEditPointStyle':getEditPointStyle};const TerrainType={'NONE':'none','XYZ':'xyz','ARCGIS':_0x35a251(0xe03),'ION':'ion','GEE':'gee','VR':'vr'};class GCJMercatorTilingScheme extends Cesium__namespace['WebMercatorTilingScheme']{constructor(_0xfe948e){const _0x195cf6={_0x1baeb3:0x9e5},_0x35f08f={_0x447f68:0x7c0,_0x264d8d:0x120,_0x283c5d:0x7ba},_0x43ff12={_0x5ca3de:0x7c0},_0x5e6115=_0x35a251;super(_0xfe948e);const _0x67315f=_0xfe948e['mapChinaCRS'],_0x237bc8=_0xfe948e['chinaCRS'],_0x47ce26=getTransFun(_0x67315f,_0x237bc8),_0x525eeb=getTransFun(_0x237bc8,_0x67315f);if(_0x47ce26){const _0x59a35f=new Cesium__namespace['WebMercatorProjection']();this[_0x5e6115(0x9e5)]['project']=function(_0x4cc5d3,_0x57f47f){const _0x7be184=_0x5e6115;return _0x57f47f=_0x47ce26([Cesium__namespace['Math']['toDegrees'](_0x4cc5d3['longitude']),Cesium__namespace['Math']['toDegrees'](_0x4cc5d3['latitude'])]),_0x57f47f=_0x59a35f['project'](new Cesium__namespace['Cartographic'](Cesium__namespace[_0x7be184(0x7c0)][_0x7be184(0x7ba)](_0x57f47f[0x0]),Cesium__namespace[_0x7be184(_0x43ff12._0x5ca3de)][_0x7be184(0x7ba)](_0x57f47f[0x1]))),new Cesium__namespace['Cartesian2'](_0x57f47f['x'],_0x57f47f['y']);},this[_0x5e6115(_0x195cf6._0x1baeb3)]['unproject']=function(_0x1779a4,_0x2e7d8a){const _0x14d2c7=_0x5e6115,_0x259c30=_0x59a35f['unproject'](_0x1779a4);return _0x2e7d8a=_0x525eeb([Cesium__namespace[_0x14d2c7(_0x35f08f._0x447f68)]['toDegrees'](_0x259c30['longitude']),Cesium__namespace['Math']['toDegrees'](_0x259c30['latitude'])]),new Cesium__namespace[(_0x14d2c7(_0x35f08f._0x264d8d))](Cesium__namespace['Math'][_0x14d2c7(_0x35f08f._0x283c5d)](_0x2e7d8a[0x0]),Cesium__namespace['Math']['toRadians'](_0x2e7d8a[0x1]));};}}}const LayerClass={};function register$2(_0xb5d03e,_0x45f3a2){const _0x5170a4={_0x288d52:0xb1b},_0xaf72bb=_0x35a251;LayerClass[_0xb5d03e]&&logError$1('register:\x20'+_0xb5d03e+'类型已存在',_0x45f3a2),LayerType[_0xb5d03e]=_0xb5d03e,LayerClass[_0xb5d03e]=_0x45f3a2,_0x45f3a2['type']=_0xb5d03e,_0x45f3a2[_0xaf72bb(_0x5170a4._0x288d52)]['_type']=_0xb5d03e;}function getClass$2(_0x186267){return LayerClass[_0x186267];}function create$2(_0x4a0828,_0x5bda98){const _0x167eb1={_0x4f064d:0x8ea},_0x55fe20=_0x35a251,_0x160f50=getClass$2(_0x4a0828[_0x55fe20(_0x167eb1._0x4f064d)]);if(_0x160f50){_0x5bda98&&(_0x4a0828['templateValues']=_0x5bda98);const _0x43cd41=new _0x160f50(_0x4a0828);return _0x43cd41;}else logWarn('配置中的图层未处理',_0x4a0828);}function converOptions(_0x96a513){const _0x2c7dd3={_0xa6430a:0x2cb,_0x55d42f:0x19a,_0x2e3d54:0xb88,_0x452abd:0x377,_0x30f04f:0xf39,_0x3f9218:0xce9,_0x3d5498:0xaa2,_0x1f5f1d:0xab1,_0x5935cb:0xd6,_0x2d2279:0xd6,_0x16ece0:0xb88,_0x283ce7:0xd05,_0x3ba224:0xb97,_0x1ba0dd:0x8a9,_0x2ba2b8:0x23a},_0x26521d=_0x35a251,_0x50caad={};for(const _0x422def in _0x96a513){let _0xf59fa7=_0x96a513[_0x422def];if(_0xf59fa7==null)continue;switch(_0x422def){case'crs':_0xf59fa7=(_0xf59fa7+'')['toUpperCase']();if(_0xf59fa7===CRS['EPSG4326']||_0xf59fa7===_0x26521d(0x8be)||_0xf59fa7===_0x26521d(_0x2c7dd3._0xa6430a))_0x50caad['crs']=CRS['EPSG4326'],_0x50caad['tilingScheme']=new Cesium__namespace['GeographicTilingScheme']({'numberOfLevelZeroTilesX':_0x96a513['numberOfLevelZeroTilesX']||0x2,'numberOfLevelZeroTilesY':_0x96a513[_0x26521d(_0x2c7dd3._0x55d42f)]||0x1});else _0xf59fa7===CRS['EPSG4490']||_0xf59fa7==='4490'||_0xf59fa7==='EPSG4490'?(_0x50caad['crs']=CRS[_0x26521d(_0x2c7dd3._0x2e3d54)],_0x50caad['tilingScheme']=new Cesium__namespace['GeographicTilingScheme']({'numberOfLevelZeroTilesX':_0x96a513[_0x26521d(0xce9)]||0x2,'numberOfLevelZeroTilesY':_0x96a513['numberOfLevelZeroTilesY']||0x1})):(_0x50caad['crs']=CRS['EPSG3857'],_0x50caad['tilingScheme']=new Cesium__namespace['WebMercatorTilingScheme']({'numberOfLevelZeroTilesX':_0x96a513[_0x26521d(0xce9)]||0x1,'numberOfLevelZeroTilesY':_0x96a513['numberOfLevelZeroTilesY']||0x1}));break;case'chinaCRS':{_0x96a513[_0x26521d(0x134)]!==_0x96a513[_0x26521d(_0x2c7dd3._0x452abd)]&&(_0x50caad['tilingScheme']=new GCJMercatorTilingScheme({'mapChinaCRS':_0x96a513['mapChinaCRS']||ChinaCRS[_0x26521d(_0x2c7dd3._0x30f04f)],'chinaCRS':_0x96a513['chinaCRS'],'numberOfLevelZeroTilesX':_0x96a513[_0x26521d(_0x2c7dd3._0x3f9218)]||0x1,'numberOfLevelZeroTilesY':_0x96a513['numberOfLevelZeroTilesY']||0x1}));break;}case'rectangle':if(Cesium__namespace['defined'](_0xf59fa7)&&Cesium__namespace['defined'](_0xf59fa7['xmin'])&&Cesium__namespace[_0x26521d(_0x2c7dd3._0x3d5498)](_0xf59fa7['xmax'])&&Cesium__namespace['defined'](_0xf59fa7['ymin'])&&Cesium__namespace['defined'](_0xf59fa7['ymax']))_0x50caad[_0x26521d(_0x2c7dd3._0x1f5f1d)]=Cesium__namespace[_0x26521d(_0x2c7dd3._0x5935cb)]['fromDegrees'](_0xf59fa7['xmin'],_0xf59fa7['ymin'],_0xf59fa7['xmax'],_0xf59fa7[_0x26521d(0xcea)]);else _0xf59fa7 instanceof Cesium__namespace[_0x26521d(_0x2c7dd3._0x2d2279)]&&(_0x50caad[_0x26521d(0xab1)]=_0xf59fa7);break;case'bbox':_0x50caad['rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0xf59fa7[0x0],_0xf59fa7[0x1],_0xf59fa7[0x2],_0xf59fa7[0x3]);break;default:_0x50caad[_0x422def]=_0xf59fa7;break;}}return _0x50caad['crs']===CRS[_0x26521d(_0x2c7dd3._0x16ece0)]&&_0x50caad[_0x26521d(0xd05)]&&(_0x50caad['url']=_0x50caad['url']['replace'](/\{z\}/gm,_0x26521d(0x7a5)),_0x50caad[_0x26521d(0xd05)]=_0x50caad['url']['replace'](/\{arc_z\}/gm,_0x26521d(0x54b)),_0x50caad['url']=_0x50caad['url']['replace'](/\{arc_Z\}/gm,'{arc_Z4490}')),_0x96a513['tms']&&(_0x50caad['url']=_0x50caad[_0x26521d(_0x2c7dd3._0x283ce7)]['replace'](/\{y\}/gm,'{reverseY}')),Cesium__namespace['defined'](_0x96a513['minimumTerrainLevel'])&&Cesium__namespace[_0x26521d(0xaa2)](_0x96a513['minimumLevel'])&&_0x96a513['minimumTerrainLevel']<_0x96a513['minimumLevel']&&(_0x50caad[_0x26521d(_0x2c7dd3._0x3ba224)]=_0x96a513[_0x26521d(0x23a)]),Cesium__namespace['defined'](_0x96a513[_0x26521d(0x728)])&&Cesium__namespace[_0x26521d(_0x2c7dd3._0x3d5498)](_0x96a513['maximumLevel'])&&_0x96a513['maximumTerrainLevel']>_0x96a513[_0x26521d(_0x2c7dd3._0x1ba0dd)]&&(_0x50caad['maximumTerrainLevel']=_0x96a513[_0x26521d(0x8a9)]),!Cesium__namespace[_0x26521d(0xaa2)](_0x96a513['minimumTerrainLevel'])&&Cesium__namespace['defined'](_0x96a513['minimumLevel'])&&_0x96a513['minimumLevel']>0x0&&(_0x50caad['minimumTerrainLevel']=_0x96a513[_0x26521d(_0x2c7dd3._0x2ba2b8)]),_0x50caad[_0x26521d(_0x2c7dd3._0x283ce7)]&&(_0x96a513['queryParameters']||_0x96a513['templateValues']||_0x96a513[_0x26521d(0xdc0)]||_0x96a513['proxy'])&&(_0x50caad['url']=getUrlResource(_0x50caad)),_0x50caad;}const ImageryProviderClass={};function registerImageryProvider(_0xd0da61,_0x5856f9){const _0x214938=_0x35a251;ImageryProviderClass[_0xd0da61]&&logError$1('registerImageryProvider:\x20'+_0xd0da61+_0x214938(0x480)),ImageryProviderClass[_0xd0da61]=_0x5856f9;}function getProviderClass(_0x503092){return ImageryProviderClass[_0x503092];}async function createImageryProvider$k(_0x3bb1bc){const _0x35c925={_0x20ac68:0xe86,_0x1e288d:0x64b,_0x34e6a7:0xaa2,_0x5a6fb0:0xf3d},_0x5ea678=_0x35a251,_0x2b73d6=getProviderClass(_0x3bb1bc['type']);if(_0x2b73d6){const _0x15df72=new _0x2b73d6(_0x3bb1bc);return!_0x15df72['options']&&(_0x15df72[_0x5ea678(_0x35c925._0x20ac68)]=_0x3bb1bc),Cesium__namespace['defined'](_0x3bb1bc['invertColor'])&&(_0x15df72['invertColor']=_0x3bb1bc[_0x5ea678(_0x35c925._0x1e288d)]),Cesium__namespace[_0x5ea678(_0x35c925._0x34e6a7)](_0x3bb1bc[_0x5ea678(_0x35c925._0x5a6fb0)])&&(_0x15df72[_0x5ea678(0xf3d)]=getCesiumColor(_0x3bb1bc['filterColor'])),_0x15df72;}else logWarn(_0x5ea678(0x99),_0x3bb1bc);}function getImageryProviderViewModels(_0x4ba80a,_0x2a57ff){const _0x30788f=_0x35a251,_0x5d2b47=[];let _0x2db7f5=-0x1;for(let _0x221134=0x0;_0x221134<_0x4ba80a['length'];_0x221134++){const _0x3889a1=_0x4ba80a[_0x221134];if(_0x3889a1['type']==='group'&&_0x3889a1['layers']==null)continue;_0x2a57ff&&(_0x3889a1['templateValues']=_0x2a57ff),_0x3889a1[_0x30788f(0x987)]?_0x2db7f5=_0x5d2b47['length']:delete _0x3889a1['show'],_0x5d2b47['push'](createProviderViewModel(_0x3889a1,_0x221134));}return{'imageryProviderViewModels':_0x5d2b47,'selectedIndex':_0x2db7f5};}function createProviderViewModel(_0x4befbc,_0x4ca24a){const _0x366aa0={_0x267b64:0xaea,_0x19b410:0x504},_0x224536=_0x35a251;window['_temp_mars3d_createImageryProvider']=createImageryProvider$k;const _0x21d5bf='window._temp_mars3d_basemaps'+_0x4ca24a;return new Function('\x0a\x20\x20\x20\x20'+_0x21d5bf+'\x20=\x20function\x20(item)\x20{\x0a\x20\x20\x20\x20\x20\x20item\x20=\x20item\x20||\x20'+JSON['stringify'](getAttrVal(_0x4befbc,{'onlySimpleType':!![]}))+_0x224536(_0x366aa0._0x267b64))(),new Cesium__namespace['ProviderViewModel']({'name':_0x4befbc['name']||'','tooltip':_0x4befbc[_0x224536(_0x366aa0._0x19b410)]||'','iconUrl':_0x4befbc[_0x224536(0x5a0)]||'','category':_0x4befbc['category']||'','creationFunction':eval(_0x21d5bf),'marsOptions':{'layerId':_0x4befbc['id']}});}const _ellipsoid=new Cesium__namespace['EllipsoidTerrainProvider']({'ellipsoid':Cesium__namespace['Ellipsoid']['WGS84']});function getNoTerrainProvider(){return _ellipsoid;}const TerrainProviderClass={};function registerTerrainProvider(_0x1881eb,_0x4669b4){const _0x58f435=_0x35a251;TerrainProviderClass[_0x1881eb]&&logError$1(_0x58f435(0x5b3)+_0x1881eb+'类型已存在'),TerrainProviderClass[_0x1881eb]=_0x4669b4;}function getTerrainProviderClass(_0x39633a){return TerrainProviderClass[_0x39633a];}async function createTerrainProvider(_0x4d4b84){const _0x605cb1={_0x1bd763:0xbc,_0x49a266:0x4ba,_0x2b731d:0xe17,_0x5c6b20:0xcb,_0x2ccfd5:0xcb,_0x599096:0xcb,_0xec7143:0xcb},_0x43cc85=_0x35a251;_0x4d4b84=_0x4d4b84||{'type':TerrainType['ION']},_0x4d4b84['type']=_0x4d4b84[_0x43cc85(0x8ea)]||TerrainType[_0x43cc85(_0x605cb1._0x1bd763)],_0x4d4b84['requestVertexNormals']=_0x4d4b84[_0x43cc85(_0x605cb1._0x49a266)]??!![];let _0x497217;switch(_0x4d4b84['type']){case TerrainType['XYZ']:case _0x43cc85(_0x605cb1._0x2b731d):{replaceOnlineUrlDomain(_0x4d4b84);const _0x2340bc={..._0x4d4b84};delete _0x2340bc['url'],_0x497217=await Cesium__namespace['CesiumTerrainProvider'][_0x43cc85(_0x605cb1._0x5c6b20)](getUrlResource(_0x4d4b84),_0x2340bc);break;}case TerrainType['NONE']:case'ellipsoid':_0x497217=_ellipsoid;break;case TerrainType['ION']:_0x497217=await Cesium__namespace['CesiumTerrainProvider']['fromIonAssetId'](_0x4d4b84[_0x43cc85(0xe7e)]??0x1,{'requestWaterMask':_0x4d4b84['requestWaterMask'],'requestVertexNormals':_0x4d4b84['requestVertexNormals']});break;case TerrainType['GEE']:case'google':{const _0x4fb78a=await Cesium__namespace['GoogleEarthEnterpriseMetadata'][_0x43cc85(_0x605cb1._0x2ccfd5)](getUrlResource(_0x4d4b84),_0x4d4b84);_0x497217=await Cesium__namespace['GoogleEarthEnterpriseTerrainProvider']['fromMetadata'](_0x4fb78a,_0x4d4b84);}break;case TerrainType['ARCGIS']:_0x497217=await Cesium__namespace['ArcGISTiledElevationTerrainProvider'][_0x43cc85(_0x605cb1._0x599096)](getUrlResource(_0x4d4b84),_0x4d4b84);break;case TerrainType['VR']:_0x497217=await Cesium__namespace['VRTheWorldTerrainProvider'][_0x43cc85(0xcb)](getUrlResource(_0x4d4b84),_0x4d4b84);break;default:{const _0x11ac96=getTerrainProviderClass(_0x4d4b84['type']);_0x11ac96&&(_0x11ac96[_0x43cc85(_0x605cb1._0xec7143)]?_0x497217=await _0x11ac96['fromUrl'](getUrlResource(_0x4d4b84),_0x4d4b84):_0x497217=new _0x11ac96(_0x4d4b84));}break;}return _0x497217;}function getTerrainProviderViewModels(_0x23ba34){const _0x209df4={_0x5aee85:0x65c,_0x5f0407:0x8d2,_0x2c46f4:0x9bb,_0x33227b:0x8d2,_0x3e0462:0x370},_0x17d9ac={_0x10b4ab:0xe03},_0x30d72c={_0x59fb5f:0x348},_0x2cdeed=_0x35a251;return _0x23ba34?[new Cesium__namespace[(_0x2cdeed(_0x209df4._0x5aee85))]({'name':'无地形','iconUrl':Cesium__namespace[_0x2cdeed(_0x209df4._0x5f0407)]('Widgets/Images/TerrainProviders/Ellipsoid.png'),'tooltip':_0x2cdeed(_0x209df4._0x2c46f4),'category':'','creationFunction':function(){return getNoTerrainProvider();}}),new Cesium__namespace['ProviderViewModel']({'name':_0x23ba34['name']||_0x2cdeed(0x514),'iconUrl':Cesium__namespace['buildModuleUrl'](_0x2cdeed(0x370)),'tooltip':_0x23ba34['tooltip']||'提供的高精度的DEM地形服务','category':'','creationFunction':function(){return createTerrainProvider(_0x23ba34);}})]:[new Cesium__namespace['ProviderViewModel']({'name':'无地形','iconUrl':Cesium__namespace['buildModuleUrl']('Widgets/Images/TerrainProviders/Ellipsoid.png'),'tooltip':'WGS84标准椭球,即\x20EPSG:4326','category':'','creationFunction':function(){return getNoTerrainProvider();}}),new Cesium__namespace['ProviderViewModel']({'name':'Mar3D\x20中国地形','iconUrl':Cesium__namespace[_0x2cdeed(_0x209df4._0x33227b)]('Widgets/Images/TerrainProviders/CesiumWorldTerrain.png'),'tooltip':'Mar3D提供的12.5米精度的中国地形','category':'','creationFunction':function(){const _0x500c58=_0x2cdeed;return createTerrainProvider({'url':_0x500c58(_0x30d72c._0x59fb5f)});}}),new Cesium__namespace['ProviderViewModel']({'name':'Ion\x20全球地形','iconUrl':Cesium__namespace[_0x2cdeed(0x8d2)]('Widgets/Images/TerrainProviders/CesiumWorldTerrain.png'),'tooltip':'Cesium官方Ion提供的高分辨率全球地形','category':'','creationFunction':function(){return createTerrainProvider({'type':'ion'});}}),new Cesium__namespace[(_0x2cdeed(0x65c))]({'name':'ArcGIS\x20全球地形','iconUrl':Cesium__namespace['buildModuleUrl'](_0x2cdeed(_0x209df4._0x3e0462)),'tooltip':'arcgis官方提供的高分辨率全球地形','category':'','creationFunction':function(){const _0x139e85=_0x2cdeed;return createTerrainProvider({'type':_0x139e85(_0x17d9ac._0x10b4ab),'url':'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer'});}})];}var LayerUtil={'__proto__':null,'register':register$2,'getClass':getClass$2,'create':create$2,'converOptions':converOptions,'registerImageryProvider':registerImageryProvider,'getProviderClass':getProviderClass,'createImageryProvider':createImageryProvider$k,'getImageryProviderViewModels':getImageryProviderViewModels,'getNoTerrainProvider':getNoTerrainProvider,'registerTerrainProvider':registerTerrainProvider,'getTerrainProviderClass':getTerrainProviderClass,'createTerrainProvider':createTerrainProvider,'getTerrainProviderViewModels':getTerrainProviderViewModels};const ControlClass={};function register$1(_0x2729d5,_0x502b01){const _0x33e8cd={_0x27a8ae:0x480},_0x4887c3=_0x35a251;ControlClass[_0x2729d5]&&logError$1('register:\x20'+_0x2729d5+_0x4887c3(_0x33e8cd._0x27a8ae),_0x502b01),ControlType[_0x2729d5]=_0x2729d5,ControlClass[_0x2729d5]=_0x502b01,_0x502b01[_0x4887c3(0x8ea)]=_0x2729d5,_0x502b01[_0x4887c3(0xb1b)]['_type']=_0x2729d5;}function getClass$1(_0x33b8b1){return ControlClass[_0x33b8b1];}function create$1(_0x4a2305,_0x1afd41){const _0x1504ff=getClass$1(_0x4a2305);if(_0x1504ff){const _0x49c01c=new _0x1504ff(_0x1afd41);return _0x49c01c;}}var ControlUtil={'__proto__':null,'register':register$1,'getClass':getClass$1,'create':create$1};const EffectClass={};function register(_0x1034c4,_0x14bc12){const _0x249153={_0x127532:0x480},_0x4132da=_0x35a251;EffectClass[_0x1034c4]&&logError$1('register:\x20'+_0x1034c4+_0x4132da(_0x249153._0x127532),_0x14bc12),EffectType[_0x1034c4]=_0x1034c4,EffectClass[_0x1034c4]=_0x14bc12,_0x14bc12['type']=_0x1034c4,_0x14bc12['prototype']['_type']=_0x1034c4;}function getClass(_0x403248){return EffectClass[_0x403248];}function create(_0x265376,_0x36eff2){const _0x4724c7={_0x38a07b:0x4b1},_0x5dfd39=_0x35a251,_0x43b529=getClass(_0x265376);if(_0x43b529){const _0x324e3f=new _0x43b529(_0x36eff2);return _0x324e3f;}else logWarn(_0x5dfd39(_0x4724c7._0x38a07b),_0x265376,_0x36eff2);}var EffectUtil={'__proto__':null,'register':register,'getClass':getClass,'create':create};class BaseOptsConver{constructor(_0x48a619={}){this['options']=_0x48a619;}get['excludedKeys'](){return null;}get['includeKeys'](){const _0x2718c9={_0x2304c8:0x9db,_0x910533:0xba5},_0x1538e4=_0x35a251;return[_0x1538e4(_0x2718c9._0x2304c8),'outlineColor',_0x1538e4(_0x2718c9._0x910533),'strokeColor'];}[_0x35a251(0xc04)](_0x438b46,_0x317fcc={}){const _0x73d89d=_0x35a251;this['_toCesiumValBefore'](_0x438b46,_0x317fcc);for(const _0x2ac7eb in _0x438b46){const _0x19ed1c=_0x438b46[_0x2ac7eb];if(this['includeKeys']['indexOf'](_0x2ac7eb)===-0x1){if(!isSimpleType(_0x19ed1c)){_0x317fcc[_0x2ac7eb]=_0x19ed1c;continue;}if(this[_0x73d89d(0x889)]&&this['excludedKeys']['indexOf'](_0x2ac7eb)!==-0x1)continue;}const _0xfeb4d9=this['_toOneCesiumVal'](_0x2ac7eb,_0x19ed1c,_0x438b46,_0x317fcc);if(_0xfeb4d9==null)continue;_0x317fcc[_0x2ac7eb]=_0xfeb4d9;}return this['_toCesiumValEnd'](_0x438b46,_0x317fcc),_0x317fcc;}['_toCesiumValBefore'](_0x2169e7,_0xa07dd9){}[_0x35a251(0x277)](_0x29e92c,_0xc4fa49){}['_toOneCesiumVal'](_0x4f5f5f,_0x30b932,_0x5022b7,_0x51875d){switch(_0x4f5f5f){default:_0x51875d[_0x4f5f5f]=_0x30b932;break;}}['toJSON'](_0x11103e,_0x820c60={}){const _0x1519eb={_0x1ce2ca:0xfa6},_0x40ebbf=_0x35a251;_0x11103e=getAttrVal(_0x11103e);this[_0x40ebbf(_0x1519eb._0x1ce2ca)]&&this['_toJSONValBefore'](_0x820c60,_0x11103e);for(const _0x293cf0 in _0x11103e){const _0x33c020=_0x11103e[_0x293cf0];isSimpleType(_0x33c020)?_0x820c60[_0x293cf0]=_0x33c020:this[_0x40ebbf(0x502)](_0x293cf0,_0x11103e[_0x293cf0],_0x820c60);}return this['_toJSONValEnd']&&this['_toJSONValEnd'](_0x820c60,_0x11103e),_0x820c60;}['_toOneJson'](_0x17162c,_0x252967,_0x5865cd){}static['getColorByStyle'](_0x1b62d7){return!this['baseOptsConver']&&(this['baseOptsConver']=new BaseOptsConver()),this['baseOptsConver']['getColorByStyle'](_0x1b62d7);}['getColorByStyle'](_0x2424e6){return getColorByStyle(_0x2424e6,this['options']['color']);}[_0x35a251(0x91d)](_0x1d64c1){const _0x44aa56=_0x35a251;let _0x4e3950;_0x1d64c1['outlineColor']?isString(_0x1d64c1['outlineColor'])?_0x4e3950=Cesium__namespace['Color']['fromCssColorString'](_0x1d64c1['outlineColor']):_0x4e3950=_0x1d64c1['outlineColor']:_0x4e3950=this['options']['outlineColor'];if(!_0x4e3950)return _0x4e3950;if(Cesium__namespace['defined'](_0x1d64c1['outlineOpacity']))_0x4e3950=_0x4e3950['withAlpha'](Number(_0x1d64c1['outlineOpacity']));else Cesium__namespace[_0x44aa56(0xaa2)](_0x1d64c1['opacity'])&&(_0x4e3950=_0x4e3950['withAlpha'](Number(_0x1d64c1['opacity'])));return Cesium__namespace['defined'](_0x1d64c1['globalAlpha'])&&_0x1d64c1['globalAlpha']!==0x1&&(_0x4e3950=_0x4e3950['withAlpha'](_0x4e3950['alpha']*_0x1d64c1['globalAlpha'])),_0x4e3950;}}class BaseMaterialConver extends BaseOptsConver{get['excludedKeys'](){const _0x547dcb=_0x35a251,_0x564eb6=['label'];return _0x564eb6['concat'](this[_0x547dcb(0x36e)]());}['_getExcludedStyle'](){return[];}static['toCesiumVal'](_0x3f0795,_0x1882c0){return!this['baseMaterialConver']&&(this['baseMaterialConver']=new BaseMaterialConver()),this['baseMaterialConver']['toCesiumVal'](_0x3f0795,_0x1882c0);}['_toOneCesiumVal'](_0x3e0e9a,_0x335a83,_0x58f09e,_0x1d1ed6){const _0x6a8e83={_0x503d5a:0x931,_0xdfb7d:0xbf2,_0x3d0c47:0x7c6,_0x5be14f:0x248,_0x207f84:0x3fc,_0x3ec1cb:0x7c8,_0x55768c:0x484},_0x24ca01=_0x35a251;switch(_0x3e0e9a){case'color':case'randomColor':_0x1d1ed6[_0x24ca01(0x9db)]=this['getColorByStyle'](_0x58f09e);break;case'color2':case'bgColor':case'outlineColor':case'evenColor':case'oddColor':case'lightColor':case _0x24ca01(_0x6a8e83._0x503d5a):case'baseWaterColor':case'blendColor':case'gapColor':case'strokeColor':case'backgroundColor':case'asphaltColor':{let _0x2f0b57=getCesiumColor(_0x335a83);Cesium__namespace['defined'](_0x58f09e['opacity'])&&_0x58f09e[_0x24ca01(_0x6a8e83._0xdfb7d)]!==0x1&&(_0x2f0b57=_0x2f0b57[_0x24ca01(0x373)](_0x58f09e['opacity']));Cesium__namespace[_0x24ca01(0xaa2)](_0x58f09e[_0x24ca01(0x2cf)])&&_0x58f09e['globalAlpha']!==0x1&&(_0x2f0b57=_0x2f0b57[_0x24ca01(0x373)](_0x2f0b57['alpha']*_0x58f09e['globalAlpha']));_0x1d1ed6[_0x3e0e9a]=_0x2f0b57;break;}case'repeat_x':case _0x24ca01(0x3fc):{const _0x4397d2=_0x58f09e['repeat_x']??0x1,_0x3b8db9=_0x58f09e['repeat_y']??0x1;_0x1d1ed6[_0x24ca01(_0x6a8e83._0x3d0c47)]=new Cesium__namespace[(_0x24ca01(_0x6a8e83._0x5be14f))](_0x4397d2,_0x3b8db9);break;}case'repeat':{_0x58f09e['materialType']===Stripe||_0x58f09e[_0x24ca01(0x472)]===CylinderWave?_0x1d1ed6[_0x3e0e9a]=_0x335a83:_0x1d1ed6[_0x3e0e9a]=new Cesium__namespace['Cartesian2'](_0x58f09e['repeat_x']||_0x335a83,_0x58f09e[_0x24ca01(_0x6a8e83._0x207f84)]||_0x335a83);break;}case _0x24ca01(0x1df):case'lineThickness':case _0x24ca01(0x2dd):case'noiseScale':{_0x1d1ed6[_0x3e0e9a]=new Cesium__namespace['Cartesian2'](_0x335a83,_0x335a83);break;}case'orientation':{_0x335a83?_0x1d1ed6[_0x3e0e9a]=Cesium__namespace[_0x24ca01(_0x6a8e83._0x3ec1cb)][_0x24ca01(_0x6a8e83._0x55768c)]:_0x1d1ed6[_0x3e0e9a]=Cesium__namespace['StripeOrientation']['HORIZONTAL'];break;}default:_0x1d1ed6[_0x3e0e9a]=_0x335a83;break;}}static['toJSON'](_0x339d2b,_0x30cca0){const _0x312d56={_0x39bb81:0x438,_0x633696:0x438},_0x41eccb=_0x35a251;return!this[_0x41eccb(_0x312d56._0x39bb81)]&&(this[_0x41eccb(_0x312d56._0x633696)]=new BaseMaterialConver()),this[_0x41eccb(_0x312d56._0x633696)]['toJSON'](_0x339d2b,_0x30cca0);}['toJSON'](_0x36a0f8,_0x1ae94e={}){var _0x3831fc;if((_0x3831fc=_0x36a0f8)!==null&&_0x3831fc!==void 0x0&&_0x3831fc['options']){const _0x3282b1=_0x36a0f8['options'];for(const _0x4821aa in _0x3282b1){Cesium__namespace['defined'](_0x36a0f8[_0x4821aa])&&(_0x3282b1[_0x4821aa]=_0x36a0f8[_0x4821aa]);}_0x36a0f8=_0x3282b1;}return super['toJSON'](_0x36a0f8,_0x1ae94e);}[_0x35a251(0x502)](_0x1c3444,_0x1f94ee,_0x3c1de8){const _0x3ee609={_0x3ce885:0x854,_0x520ed1:0x9db,_0x5d245f:0x90c,_0x2630c4:0x94b,_0x318844:0x3d0,_0x3ce137:0x2dd},_0xc99b24=_0x35a251;if(_0x1f94ee instanceof Cesium__namespace['Color']){_0x3c1de8[_0x1c3444]=_0x1f94ee[_0xc99b24(0x9e9)]();return;}switch(_0x1c3444){case _0xc99b24(_0x3ee609._0x3ce885):break;case _0xc99b24(_0x3ee609._0x520ed1):case'fillColor':case _0xc99b24(0x218):case _0xc99b24(_0x3ee609._0x5d245f):case'oddColor':case _0xc99b24(0x324):case'blendColor':case'gapColor':case _0xc99b24(_0x3ee609._0x2630c4):case _0xc99b24(0xba5):case _0xc99b24(_0x3ee609._0x318844):case'lightColor':{const _0x4cc155=getCesiumColor(_0x1f94ee);_0x4cc155&&(_0x3c1de8[_0x1c3444]=_0x4cc155[_0xc99b24(0x9e9)]());break;}case'repeat':{_0x1f94ee instanceof Cesium__namespace['Cartesian2']?_0x1f94ee['x']!==_0x1f94ee['y']?(_0x3c1de8[_0x1c3444+'_x']=_0x1f94ee['x'],_0x3c1de8[_0x1c3444+'_y']=_0x1f94ee['y']):_0x3c1de8[_0x1c3444]=_0x1f94ee['x']:_0x3c1de8[_0x1c3444]=_0x1f94ee;break;}case'lineCount':case'lineThickness':case _0xc99b24(_0x3ee609._0x3ce137):case'noiseScale':{_0x3c1de8[_0x1c3444+'_x']=_0x1f94ee['x'],_0x3c1de8[_0x1c3444+'_y']=_0x1f94ee['y'];break;}default:console['log']('未处理的属性',_0x1c3444,_0x1f94ee);break;}}}registerOptsConver(_0x35a251(0x171),BaseMaterialConver);class ColorOptsConver extends BaseMaterialConver{static[_0x35a251(0xc04)](_0x9c0ddf,_0x5be01f,_0x38d92b){const _0xc128e6={_0x5aa917:0xc6a},_0x46fab4=_0x35a251;if(_0x9c0ddf instanceof Cesium__namespace['Color'])return _0x9c0ddf;return!this['colorOptsConver']&&(this['colorOptsConver']=new ColorOptsConver()),this[_0x46fab4(_0xc128e6._0x5aa917)][_0x46fab4(0xf5c)]=_0x38d92b,this[_0x46fab4(_0xc128e6._0x5aa917)]['toCesiumVal'](_0x9c0ddf,_0x5be01f);}['toCesiumVal'](_0x10f609){const _0x581aed=_0x35a251;return this[_0x581aed(0xf5c)]?this['getColorByStyle'](_0x10f609):{'color':this['getColorByStyle'](_0x10f609)};}static['toJSON'](_0x38b793,_0x52c80a={},_0x328039=![]){const _0x1c335b={_0x5d98c3:0xc6a},_0x17a26b=_0x35a251;return!this[_0x17a26b(0xc6a)]&&(this[_0x17a26b(_0x1c335b._0x5d98c3)]=new ColorOptsConver()),this[_0x17a26b(_0x1c335b._0x5d98c3)]['isProperty']=_0x328039,this['colorOptsConver']['toJSON'](_0x38b793,_0x52c80a);}['toJSON'](_0x305368,_0x42c902={}){const _0x3289d7={_0x221ca7:0x9db},_0x3d8f0c=_0x35a251;var _0xdc21ce;(_0xdc21ce=_0x305368)!==null&&_0xdc21ce!==void 0x0&&_0xdc21ce['color']&&(_0x305368=_0x305368['color']);let _0x23304e=getCesiumValue(_0x305368,Cesium__namespace['Color']);_0x23304e['color']&&(_0x23304e=_0x23304e['color']);if(_0x23304e){if(_0x23304e instanceof Cesium__namespace[_0x3d8f0c(0xf29)])_0x42c902[_0x3d8f0c(0x9db)]=_0x23304e['toCssColorString']();else isString(_0x23304e)&&(_0x42c902[_0x3d8f0c(_0x3289d7._0x221ca7)]=_0x23304e);}return _0x42c902;}}registerOptsConver(Color$2,ColorOptsConver),registerOptsConver(PolylineArrow,ColorOptsConver);class ImageOptsConver extends BaseMaterialConver{get[_0x35a251(0x889)](){const _0x9f6efe={_0xcba0ef:0x3fc},_0x111db6=_0x35a251;return[_0x111db6(_0x9f6efe._0xcba0ef)];}static[_0x35a251(0xc04)](_0x2972c8,_0x53226c){const _0x11c7c3={_0x296f43:0xc04},_0x3f8c82=_0x35a251;return!this['imageOptsConver']&&(this[_0x3f8c82(0xb57)]=new ImageOptsConver()),this['imageOptsConver'][_0x3f8c82(_0x11c7c3._0x296f43)](_0x2972c8,_0x53226c);}['_toOneCesiumVal'](_0x34ca55,_0x1e4722,_0x485786,_0x49b8ff){const _0xe125de={_0x44169b:0x248,_0x571c5c:0x9db},_0x259ac1=_0x35a251;switch(_0x34ca55){case _0x259ac1(0x47d):{const _0x75717f=_0x485786['repeat_x']??0x1,_0x3f37ab=_0x485786['repeat_y']??0x1;_0x49b8ff[_0x259ac1(0x7c6)]=new Cesium__namespace['Cartesian2'](_0x75717f,_0x3f37ab);break;}case'repeat':{_0x49b8ff[_0x34ca55]=new Cesium__namespace[(_0x259ac1(_0xe125de._0x44169b))](_0x485786['repeat_x']||_0x1e4722,_0x485786['repeat_y']||_0x1e4722);break;}case _0x259ac1(_0xe125de._0x571c5c):break;case _0x259ac1(0xbf2):if(Cesium__namespace['defined'](_0x485786[_0x259ac1(0x2cf)])&&_0x485786['globalAlpha']!==0x1)_0x49b8ff['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x485786['globalAlpha']*(_0x1e4722??0x1));else _0x485786[_0x259ac1(0xa92)]??!![]?_0x49b8ff['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x1e4722??0x1):_0x49b8ff['color']=Cesium__namespace['Color'][_0x259ac1(0x9a2)];break;default:_0x49b8ff[_0x34ca55]=_0x1e4722;break;}}['_toCesiumValEnd'](_0x2895bb,_0x4e42b2){_0x4e42b2['transparent']=_0x4e42b2['transparent']??!![];}static[_0x35a251(0x99e)](_0x45709f,_0x3093bf){const _0x23c85a=_0x35a251;return!this[_0x23c85a(0xb57)]&&(this['imageOptsConver']=new ImageOptsConver()),this['imageOptsConver']['toJSON'](_0x45709f,_0x3093bf);}['_toOneJson'](_0x3c31c6,_0x33565b,_0x45020c){const _0x1a8d04={_0x2f1671:0x47d},_0x4727eb=_0x35a251;switch(_0x3c31c6){case'repeat':{_0x45020c[_0x4727eb(_0x1a8d04._0x2f1671)]=_0x33565b['x'],_0x45020c['repeat_y']=_0x33565b['y'];break;}case _0x4727eb(0x9db):{var _0x2b10b5;_0x45020c['opacity']=((_0x2b10b5=getCesiumColor(_0x33565b))===null||_0x2b10b5===void 0x0?void 0x0:_0x2b10b5['alpha'])??0x1;break;}default:console['log'](_0x4727eb(0x20c),_0x3c31c6,_0x33565b);break;}}}registerOptsConver(Image$1,ImageOptsConver);class BaseStyleConver extends BaseOptsConver{get['excludedKeys'](){const _0x5edfc8={_0x54d1e5:0x4df,_0x4afa5c:0x6a2},_0x3ccacc=_0x35a251,_0x1531ea=[_0x3ccacc(0x8ea),'label','outlineOpacity','outlineStyle','lineCount','lineThickness','cellAlpha',_0x3ccacc(_0x5edfc8._0x54d1e5),_0x3ccacc(_0x5edfc8._0x4afa5c),'axisY','image2','color2','scaleByDistance_near','scaleByDistance_nearValue',_0x3ccacc(0x48f),'scaleByDistance_farValue','distanceDisplayCondition_far','distanceDisplayCondition_near'];return _0x1531ea['concat'](this['_getExcludedStyle']());}[_0x35a251(0x36e)](){return[];}[_0x35a251(0x1ca)](_0x4cb784,_0xadd7c4){const _0x11e6ad=_0x35a251;if(!_0x4cb784['material']&&!_0x4cb784[_0x11e6ad(0x472)]){var _0x48b112;if(_0x4cb784['color']||_0x4cb784['randomColor']||(_0x48b112=_0x4cb784['materialOptions'])!==null&&_0x48b112!==void 0x0&&_0x48b112['color'])_0x4cb784['materialType']=Color$2;else _0x4cb784['image']&&(_0x4cb784['materialType']=Image$1);}}[_0x35a251(0xacf)](_0x150471,_0x38adcf,_0x1efb95,_0x2222c9){const _0x1f3a0b={_0x2863a0:0x8f1,_0x342c91:0x9c7,_0x201b7e:0xd3b,_0x41a7ab:0x883,_0x318045:0x4e2,_0x352156:0x9e1},_0x12431f=_0x35a251;switch(_0x150471){case'clampToGround':_0x38adcf?_0x2222c9['heightReference']=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:_0x2222c9['heightReference']=Cesium__namespace[_0x12431f(_0x1f3a0b._0x2863a0)]['NONE'];break;case'visibleDepth':_0x38adcf?_0x2222c9['disableDepthTestDistance']=0x0:_0x2222c9['disableDepthTestDistance']=Number['POSITIVE_INFINITY'];break;case'hasShadows':_0x38adcf?_0x2222c9['shadows']=Cesium__namespace['ShadowMode']['ENABLED']:_0x2222c9['shadows']=Cesium__namespace[_0x12431f(_0x1f3a0b._0x342c91)]['DISABLED'];break;case'scaleByDistance':_0x38adcf?_0x2222c9['scaleByDistance']=new Cesium__namespace['NearFarScalar'](Number(Cesium__namespace[_0x12431f(0x883)](_0x1efb95[_0x12431f(_0x1f3a0b._0x201b7e)],0x3e8)),Number(Cesium__namespace['defaultValue'](_0x1efb95[_0x12431f(0x72d)],0x1)),Number(Cesium__namespace['defaultValue'](_0x1efb95['scaleByDistance_far'],0xf4240)),Number(Cesium__namespace[_0x12431f(_0x1f3a0b._0x41a7ab)](_0x1efb95[_0x12431f(_0x1f3a0b._0x318045)],0.1))):_0x2222c9['scaleByDistance']=undefined;break;case'distanceDisplayCondition':_0x38adcf?_0x2222c9['distanceDisplayCondition']=new Cesium__namespace['DistanceDisplayCondition'](Number(Cesium__namespace['defaultValue'](_0x1efb95['distanceDisplayCondition_near'],0x0)),Number(Cesium__namespace['defaultValue'](_0x1efb95[_0x12431f(0xe56)],Number[_0x12431f(_0x1f3a0b._0x352156)]))):_0x2222c9[_0x12431f(0x393)]=undefined;break;default:_0x2222c9[_0x150471]=_0x38adcf;break;}}['_toOneCesiumVal_Poly'](_0x48bbd8,_0x16a544,_0x199061,_0x17fef5){const _0xbad2a7={_0x731df8:0x9db,_0xf5b94e:0x91d,_0x28151a:0xf28,_0x24ac43:0x9c7,_0x3a508c:0xe56,_0x3c2f44:0x393,_0x2f5960:0x18a},_0x53ff2e=_0x35a251;switch(_0x48bbd8){case _0x53ff2e(0x472):{this[_0x53ff2e(0x510)]?_0x17fef5['material']=createMaterialProperty(_0x199061['materialType'],_0x199061['materialOptions']||_0x199061):_0x17fef5['material']=createMaterial(_0x199061['materialType'],_0x199061['materialOptions']||_0x199061);break;}case _0x53ff2e(_0xbad2a7._0x731df8):case'randomColor':{_0x17fef5['color']=this[_0x53ff2e(0xc18)](_0x199061);break;}case'outlineColor':{_0x17fef5['outlineColor']=this[_0x53ff2e(_0xbad2a7._0xf5b94e)](_0x199061);break;}case _0x53ff2e(_0xbad2a7._0x28151a):_0x16a544?_0x17fef5[_0x53ff2e(0x529)]=Cesium__namespace[_0x53ff2e(_0xbad2a7._0x24ac43)]['ENABLED']:_0x17fef5['shadows']=Cesium__namespace['ShadowMode']['DISABLED'];break;case _0x53ff2e(0x393):_0x16a544?this['isEntity']?_0x17fef5['distanceDisplayCondition']=new Cesium__namespace['DistanceDisplayCondition'](Number(Cesium__namespace[_0x53ff2e(0x883)](_0x199061['distanceDisplayCondition_near'],0x0)),Number(Cesium__namespace['defaultValue'](_0x199061[_0x53ff2e(_0xbad2a7._0x3a508c)],Number[_0x53ff2e(0x9e1)]))):_0x17fef5[_0x53ff2e(_0xbad2a7._0x3c2f44)]=new Cesium__namespace['DistanceDisplayConditionGeometryInstanceAttribute'](Number(Cesium__namespace['defaultValue'](_0x199061['distanceDisplayCondition_near'],0x0)),Number(Cesium__namespace['defaultValue'](_0x199061[_0x53ff2e(0xe56)],Number['MAX_VALUE']))):_0x17fef5['distanceDisplayCondition']=undefined;break;default:_0x17fef5[_0x48bbd8]instanceof Cesium__namespace[_0x53ff2e(_0xbad2a7._0x2f5960)]?logWarn('回调属性未覆盖更新',_0x48bbd8,_0x16a544):_0x17fef5[_0x48bbd8]=_0x16a544;break;}}['_toJSONValEnd'](_0x27471d,_0x5b7a1d){}['_toOneJson_Poly'](_0x1ed70c,_0x3f6290,_0x1cdfeb){const _0x87c36a={_0x2f0b35:0xbbd,_0x50da53:0x716,_0x5bd92e:0xe56},_0x31a9c7=_0x35a251;switch(_0x1ed70c){case'label':case _0x31a9c7(_0x87c36a._0x2f0b35):case _0x31a9c7(_0x87c36a._0x50da53):{break;}case'material':{toJSON(_0x3f6290,_0x1cdfeb);break;}case _0x31a9c7(0xa31):{_0x1cdfeb[_0x1ed70c]=toJSONByType(_0x1cdfeb[_0x31a9c7(0x472)],_0x3f6290);break;}case'color':{const _0x5a0fbe=getCesiumColor(_0x3f6290);_0x5a0fbe&&(_0x1cdfeb[_0x1ed70c]=_0x5a0fbe['toCssColorString']());break;}case'outlineColor':{const _0x326c05=getCesiumColor(_0x3f6290);_0x326c05&&(_0x1cdfeb[_0x1ed70c]=_0x326c05['toCssColorString']());break;}case'rotation':_0x1cdfeb['rotationDegree']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x3f6290),0x2);break;case _0x31a9c7(0x1e1):_0x1cdfeb['stRotationDegree']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x3f6290),0x2);break;case'shadows':{_0x3f6290===Cesium__namespace['ShadowMode']['ENABLED']?_0x1cdfeb['shadows']=!![]:_0x1cdfeb[_0x1ed70c]=_0x3f6290;break;}case'distanceDisplayCondition':{_0x1cdfeb['distanceDisplayCondition_near']=_0x3f6290['near'],_0x1cdfeb[_0x31a9c7(_0x87c36a._0x5bd92e)]=_0x3f6290[_0x31a9c7(0xf8a)];break;}default:logWarn('未处理的属性',_0x1ed70c,_0x3f6290);break;}}['_toOneJson_Point'](_0x7a403b,_0x33458d,_0x5227e1){const _0x271ab4={_0xb5df10:0x854,_0x3070e7:0xbbd,_0xd676c4:0x218,_0x2c9b8a:0x94b,_0x4c94a7:0x8f1,_0x34df86:0xc5e,_0x1fd8ea:0x554,_0x6cde98:0x170},_0x27ddef=_0x35a251;switch(_0x7a403b){case _0x27ddef(_0x271ab4._0xb5df10):case _0x27ddef(_0x271ab4._0x3070e7):case _0x27ddef(0x716):{break;}case'material':{toJSON(_0x33458d,_0x5227e1);break;}case'materialOptions':{_0x5227e1[_0x7a403b]=toJSONByType(_0x5227e1['materialType'],_0x33458d);break;}case _0x27ddef(0x9db):case'fillColor':case _0x27ddef(_0x271ab4._0xd676c4):case _0x27ddef(0xba5):case _0x27ddef(_0x271ab4._0x2c9b8a):{const _0x39aa14=getCesiumColor(_0x33458d);_0x39aa14&&(_0x5227e1[_0x7a403b]=_0x39aa14['toCssColorString']());break;}case _0x27ddef(0x4b2):{_0x33458d===Cesium__namespace[_0x27ddef(_0x271ab4._0x4c94a7)][_0x27ddef(_0x271ab4._0x34df86)]&&(_0x5227e1['clampToGround']=!![]);break;}case'rotation':_0x5227e1['rotationDegree']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x33458d),0x2);break;case'stRotation':_0x5227e1[_0x27ddef(0xee0)]=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x33458d),0x2);break;case _0x27ddef(_0x271ab4._0x1fd8ea):{_0x33458d===Number['POSITIVE_INFINITY']?_0x5227e1['visibleDepth']=![]:_0x5227e1['disableDepthTestDistance']=_0x33458d;break;}case'scaleByDistance':{_0x5227e1['scaleByDistance']=!![],_0x5227e1['scaleByDistance_near']=_0x33458d[_0x27ddef(0x170)],_0x5227e1['scaleByDistance_nearValue']=_0x33458d['nearValue'],_0x5227e1['scaleByDistance_far']=_0x33458d['far'],_0x5227e1[_0x27ddef(0x4e2)]=_0x33458d[_0x27ddef(0xc3a)];break;}case'distanceDisplayCondition':{_0x5227e1['distanceDisplayCondition']=!![],_0x5227e1['distanceDisplayCondition_near']=_0x33458d[_0x27ddef(_0x271ab4._0x6cde98)],_0x5227e1['distanceDisplayCondition_far']=_0x33458d['far'];break;}default:logWarn('未处理的属性',_0x7a403b,_0x33458d);break;}}}class BillboardStyleConver extends BaseStyleConver{['_getExcludedStyle'](){const _0x49f3c1={_0x2049dd:0xba5,_0x5c0d4c:0xe9,_0x19b1e6:0xd22},_0x575e38=_0x35a251;return['outlineColor',_0x575e38(_0x49f3c1._0x2049dd),'font_style','font_weight',_0x575e38(_0x49f3c1._0x5c0d4c),'font_family','backgroundOpacity',_0x575e38(_0x49f3c1._0x19b1e6),'outline'];}static[_0x35a251(0xc04)](_0x20bcbf,_0x34aa19,_0x26e30b){const _0x558db0={_0x5d9bd1:0xf51},_0x2111c5=_0x35a251;return!this[_0x2111c5(_0x558db0._0x5d9bd1)]&&(this['billboardStyleConver']=new BillboardStyleConver()),this['billboardStyleConver']['isEntity']=_0x26e30b,this['billboardStyleConver']['toCesiumVal'](_0x20bcbf,_0x34aa19);}['_toCesiumValBefore'](_0x520422,_0x3c3bce){_0x3c3bce['horizontalOrigin']=_0x3c3bce['horizontalOrigin']??Cesium__namespace['HorizontalOrigin']['CENTER'],_0x3c3bce['verticalOrigin']=_0x3c3bce['verticalOrigin']??Cesium__namespace['HorizontalOrigin']['BOTTOM'];}['_toOneCesiumVal'](_0x51739f,_0x2534d2,_0x210daf,_0x4de17c){const _0x9bba85={_0x13b8d6:0x2cf,_0x35fa73:0x9db,_0x4d3aaa:0x9a2,_0x2aa729:0x248,_0x547d94:0x317,_0x33d57e:0x248,_0xd47a2:0xacf},_0x1ad10b=_0x35a251;switch(_0x51739f){case _0x1ad10b(0x9db):{_0x4de17c['color']=this['getColorByStyle'](_0x210daf);break;}case'opacity':Cesium__namespace['defined'](_0x210daf['globalAlpha'])&&_0x210daf[_0x1ad10b(_0x9bba85._0x13b8d6)]!==0x1?_0x4de17c['color']=Cesium__namespace['Color'][_0x1ad10b(0x9a2)][_0x1ad10b(0x373)](_0x210daf['globalAlpha']*(_0x2534d2??0x1)):_0x4de17c[_0x1ad10b(_0x9bba85._0x35fa73)]=Cesium__namespace['Color'][_0x1ad10b(_0x9bba85._0x4d3aaa)]['withAlpha'](_0x2534d2??0x1);break;case'rotationDegree':_0x4de17c['rotation']=Cesium__namespace[_0x1ad10b(0x7c0)]['toRadians'](_0x2534d2);break;case'hasPixelOffset':!_0x2534d2&&(_0x4de17c['pixelOffset']=new Cesium__namespace['Cartesian2'](0x0,0x0));break;case _0x1ad10b(0xcfe):case _0x1ad10b(0x452):_0x4de17c['pixelOffset']=new Cesium__namespace[(_0x1ad10b(_0x9bba85._0x2aa729))](_0x210daf['pixelOffsetX']||0x0,_0x210daf[_0x1ad10b(0x452)]||0x0);break;case'pixelOffset':Cesium__namespace['defined'](_0x2534d2[0x0])&&Cesium__namespace['defined'](_0x2534d2[0x1])?_0x4de17c[_0x1ad10b(_0x9bba85._0x547d94)]=new Cesium__namespace[(_0x1ad10b(_0x9bba85._0x33d57e))](_0x2534d2[0x0],_0x2534d2[0x1]):_0x4de17c[_0x1ad10b(_0x9bba85._0x547d94)]=_0x2534d2;break;default:this[_0x1ad10b(_0x9bba85._0xd47a2)](_0x51739f,_0x2534d2,_0x210daf,_0x4de17c);break;}}static['toJSON'](_0x320d7f,_0x41d302,_0x5ca7ec){const _0x34b621=_0x35a251;return!this['billboardStyleConver']&&(this['billboardStyleConver']=new BillboardStyleConver()),this['billboardStyleConver'][_0x34b621(0x510)]=_0x5ca7ec,this['billboardStyleConver']['toJSON'](_0x320d7f,_0x41d302);}['_toOneJson'](_0x1cb097,_0x798a7a,_0x1a67ae){const _0xe62966=_0x35a251;switch(_0x1cb097){case'pixelOffset':{_0x1a67ae[_0xe62966(0xcfe)]=_0x798a7a['x'],_0x1a67ae['pixelOffsetY']=_0x798a7a['y'];break;}default:this['_toOneJson_Point'](_0x1cb097,_0x798a7a,_0x1a67ae);break;}}}class CloudStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x3c4ac9,_0x3caec4){const _0x4d97df=_0x35a251;return!this['cloudStyleConver']&&(this[_0x4d97df(0xeef)]=new CloudStyleConver()),this['cloudStyleConver']['toCesiumVal'](_0x3c4ac9,_0x3caec4);}[_0x35a251(0x1ca)](_0x545739,_0x17f195){}[_0x35a251(0x511)](_0x4a8d2b,_0x2eec02,_0x5ed61a,_0x3f1321){const _0x1bd7f8={_0x1a3179:0xee3},_0x5d9182=_0x35a251;switch(_0x4a8d2b){case'scaleX':case'scaleY':_0x3f1321['scale']=new Cesium__namespace['Cartesian2'](_0x5ed61a[_0x5d9182(0x3da)]||0x1,_0x5ed61a['scaleY']||0x1);break;case'maximumSizeX':case _0x5d9182(0x53c):case'maximumSizeZ':_0x3f1321['maximumSize']=new Cesium__namespace[(_0x5d9182(0x8eb))](_0x5ed61a[_0x5d9182(0x136)]||0x1,_0x5ed61a[_0x5d9182(0x53c)]||0x1,_0x5ed61a[_0x5d9182(_0x1bd7f8._0x1a3179)]||0x1);break;default:this['_toOneCesiumVal_Point'](_0x4a8d2b,_0x2eec02,_0x5ed61a,_0x3f1321);break;}}static['toJSON'](_0x2a679f,_0x21e6a1){const _0x220fd8={_0x5f5c5f:0xeef},_0x2e8a3d=_0x35a251;return!this['cloudStyleConver']&&(this['cloudStyleConver']=new CloudStyleConver()),this[_0x2e8a3d(_0x220fd8._0x5f5c5f)]['toJSON'](_0x2a679f,_0x21e6a1);}[_0x35a251(0x502)](_0x3a794d,_0x28427a,_0x12e10a){const _0x1bc7f8={_0x243ee7:0x136,_0x535ca6:0x53c},_0x1e096f=_0x35a251;switch(_0x3a794d){case _0x1e096f(0x1cb):_0x12e10a['scaleX']=formatNum$1(_0x28427a['x'],0x2),_0x12e10a['scaleY']=formatNum$1(_0x28427a['y'],0x2);break;case'maximumSize':_0x12e10a[_0x1e096f(_0x1bc7f8._0x243ee7)]=formatNum$1(_0x28427a['x'],0x2),_0x12e10a[_0x1e096f(_0x1bc7f8._0x535ca6)]=formatNum$1(_0x28427a['y'],0x2),_0x12e10a[_0x1e096f(0xee3)]=formatNum$1(_0x28427a['z'],0x2);break;default:this[_0x1e096f(0x280)](_0x3a794d,_0x28427a,_0x12e10a);break;}}}class BoxStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x4021c7,_0x1f1fa3,_0x84a863){const _0x28e264={_0x41e564:0x510},_0x5b675c=_0x35a251;return!this['boxStyleConver']&&(this['boxStyleConver']=new BoxStyleConver()),this['boxStyleConver'][_0x5b675c(_0x28e264._0x41e564)]=_0x84a863,this[_0x5b675c(0x7e3)]['toCesiumVal'](_0x4021c7,_0x1f1fa3);}[_0x35a251(0x36e)](){return['opacity','dimensions_y','dimensions_z'];}['_toOneCesiumVal'](_0xd2b937,_0x2f00e6,_0x5867f2,_0x467ecc){const _0x6620a8={_0x29c269:0xeb,_0xd1bd78:0x926,_0x494f89:0x6ea},_0x5740e0=_0x35a251;switch(_0xd2b937){case'outlineColor':{_0x467ecc['outlineColor']=this['getOutlineColorByStyle'](_0x5867f2);break;}case'dimensions_x':{const _0x335b21=_0x5867f2[_0x5740e0(0x26a)]??0x64,_0x2b502a=_0x5867f2[_0x5740e0(_0x6620a8._0x29c269)]??0x64,_0x530b88=_0x5867f2[_0x5740e0(_0x6620a8._0xd1bd78)]??0x64;_0x467ecc[_0x5740e0(_0x6620a8._0x494f89)]=new Cesium__namespace[(_0x5740e0(0x8eb))](_0x335b21,_0x2b502a,_0x530b88);break;}default:this['_toOneCesiumVal_Poly'](_0xd2b937,_0x2f00e6,_0x5867f2,_0x467ecc);break;}}static['toJSON'](_0x2b7036,_0x4b0f7d,_0xe09f89){const _0x203ba0={_0x1372cf:0x7e3,_0x1b88d4:0x99e},_0x5b9efd=_0x35a251;return!this['boxStyleConver']&&(this[_0x5b9efd(_0x203ba0._0x1372cf)]=new BoxStyleConver()),this['boxStyleConver'][_0x5b9efd(0x510)]=_0xe09f89,this['boxStyleConver'][_0x5b9efd(_0x203ba0._0x1b88d4)](_0x2b7036,_0x4b0f7d);}['_toOneJson'](_0x8d302b,_0x217ddb,_0x49ee92){switch(_0x8d302b){case'dimensions':{_0x49ee92['dimensions_x']=_0x217ddb['x'],_0x49ee92['dimensions_y']=_0x217ddb['y'],_0x49ee92['dimensions_z']=_0x217ddb['z'];break;}default:this['_toOneJson_Poly'](_0x8d302b,_0x217ddb,_0x49ee92);break;}}}class CircleStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x30a105,_0x5a3b0b,_0x3dad41){const _0x1d7ac3=_0x35a251;return!this['circleStyleConver']&&(this['circleStyleConver']=new CircleStyleConver()),this['circleStyleConver']['isEntity']=_0x3dad41,this[_0x1d7ac3(0xa5e)]['toCesiumVal'](_0x30a105,_0x5a3b0b);}['_toCesiumValBefore'](_0x4cd7a9,_0x3d39ae){const _0x351c2b={_0x5c36c0:0x63f,_0x602ef:0x979},_0x3df140=_0x35a251;super['_toCesiumValBefore'](_0x4cd7a9,_0x3d39ae),_0x4cd7a9['clampToGround']&&(_0x4cd7a9['hasOwnProperty'](_0x3df140(0x682))&&delete _0x4cd7a9['height'],_0x4cd7a9[_0x3df140(_0x351c2b._0x5c36c0)](_0x3df140(0x552))&&delete _0x4cd7a9['extrudedHeight'],_0x4cd7a9['hasOwnProperty']('diffHeight')&&delete _0x4cd7a9['diffHeight']),Cesium__namespace['defined'](_0x4cd7a9[_0x3df140(0x682)])&&(_0x4cd7a9[_0x3df140(_0x351c2b._0x602ef)]=![]);}['_toOneCesiumVal'](_0x196d63,_0x18e49c,_0x39aea5,_0x454636){const _0x21a6e8={_0x2f5a0e:0xb7a,_0x1fd515:0xf2,_0x3fa969:0x682},_0x43b67f=_0x35a251;switch(_0x196d63){case'rotation':_0x454636[_0x43b67f(_0x21a6e8._0x2f5a0e)]=_0x18e49c;!_0x39aea5[_0x43b67f(0x1e1)]&&(_0x454636['stRotation']=_0x454636['rotation']);break;case _0x43b67f(_0x21a6e8._0x1fd515):_0x454636[_0x43b67f(0xb7a)]=Cesium__namespace['Math']['toRadians'](_0x18e49c);!_0x39aea5[_0x43b67f(0x1e1)]&&(_0x454636['stRotation']=_0x454636['rotation']);break;case'stRotationDegree':_0x454636['stRotation']=Cesium__namespace['Math'][_0x43b67f(0x7ba)](_0x18e49c);break;case'height':_0x454636[_0x43b67f(_0x21a6e8._0x3fa969)]=_0x18e49c;_0x39aea5['diffHeight']&&(_0x454636['extrudedHeight']=Number(_0x39aea5['diffHeight'])+Number(_0x18e49c));break;case'diffHeight':Cesium__namespace[_0x43b67f(0xaa2)](_0x39aea5['height'])&&(_0x454636[_0x43b67f(0x552)]=_0x39aea5[_0x43b67f(0x682)]+_0x18e49c);break;case'radius':this['isEntity']?(_0x454636['semiMinorAxis']=Number(_0x18e49c),_0x454636['semiMajorAxis']=Number(_0x18e49c)):_0x454636['radius']=Number(_0x18e49c);break;case'clampToGround':_0x18e49c?_0x454636['heightReference']=Cesium__namespace[_0x43b67f(0x8f1)]['CLAMP_TO_GROUND']:_0x454636['heightReference']=Cesium__namespace[_0x43b67f(0x8f1)]['NONE'];break;default:this[_0x43b67f(0x473)](_0x196d63,_0x18e49c,_0x39aea5,_0x454636);break;}}static[_0x35a251(0x99e)](_0x22d578,_0x31301d,_0xa19f21){const _0x1584e7=_0x35a251;return!this[_0x1584e7(0xa5e)]&&(this[_0x1584e7(0xa5e)]=new CircleStyleConver()),this['circleStyleConver']['isEntity']=_0xa19f21,this[_0x1584e7(0xa5e)]['toJSON'](_0x22d578,_0x31301d);}[_0x35a251(0x502)](_0x437c92,_0x3d3a54,_0x56eff8){const _0x204825={_0x16602c:0x7c0},_0x1491e4=_0x35a251;switch(_0x437c92){case'rotation':{_0x56eff8['rotationDegree']=formatNum$1(Cesium__namespace[_0x1491e4(_0x204825._0x16602c)]['toDegrees'](_0x3d3a54),0x1);break;}case'stRotation':{_0x56eff8['stRotationDegree']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x3d3a54),0x1);break;}default:this['_toOneJson_Poly'](_0x437c92,_0x3d3a54,_0x56eff8);break;}}}class CorridorStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x16ce31,_0x4a8f48,_0x377179){const _0x547793=_0x35a251;return!this['corridorStyleConver']&&(this['corridorStyleConver']=new CorridorStyleConver()),this['corridorStyleConver']['isEntity']=_0x377179,this[_0x547793(0xbce)]['toCesiumVal'](_0x16ce31,_0x4a8f48);}[_0x35a251(0x1ca)](_0x2097f8,_0x3bd173){const _0x48f9fe={_0x1076e6:0x63f,_0x74fb96:0x682,_0x201c19:0x63f},_0xfcd5da=_0x35a251;super['_toCesiumValBefore'](_0x2097f8,_0x3bd173),_0x2097f8['clampToGround']&&(_0x2097f8[_0xfcd5da(_0x48f9fe._0x1076e6)](_0xfcd5da(_0x48f9fe._0x74fb96))&&delete _0x2097f8['height'],_0x2097f8['hasOwnProperty'](_0xfcd5da(0x552))&&delete _0x2097f8['extrudedHeight'],_0x2097f8[_0xfcd5da(_0x48f9fe._0x201c19)](_0xfcd5da(0x4f7))&&delete _0x2097f8['diffHeight']);}['_toOneCesiumVal'](_0x5be099,_0x569a67,_0x12cec4,_0x5e04be){const _0xa51b8f={_0x1c6eda:0x682},_0x1d1f4e=_0x35a251;switch(_0x5be099){case _0x1d1f4e(0x218):{_0x5e04be['outlineColor']=this[_0x1d1f4e(0x91d)](_0x12cec4);break;}case _0x1d1f4e(_0xa51b8f._0x1c6eda):_0x5e04be[_0x1d1f4e(_0xa51b8f._0x1c6eda)]=_0x569a67;_0x12cec4['diffHeight']&&(_0x5e04be['extrudedHeight']=Number(_0x12cec4['diffHeight'])+Number(_0x569a67));break;case'diffHeight':Cesium__namespace['defined'](_0x12cec4[_0x1d1f4e(0x682)])&&(_0x5e04be['extrudedHeight']=_0x12cec4['height']+_0x569a67);break;default:this['_toOneCesiumVal_Poly'](_0x5be099,_0x569a67,_0x12cec4,_0x5e04be);break;}}static['toJSON'](_0x13ea09,_0x373e1a,_0x598fa6){const _0x4144c0=_0x35a251;return!this[_0x4144c0(0xbce)]&&(this['corridorStyleConver']=new CorridorStyleConver()),this['corridorStyleConver']['isEntity']=_0x598fa6,this['corridorStyleConver']['toJSON'](_0x13ea09,_0x373e1a);}['_toOneJson'](_0x21b596,_0x470526,_0x55cf98){this['_toOneJson_Poly'](_0x21b596,_0x470526,_0x55cf98);}}class CylinderStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x110728,_0x4463d3,_0x5cfaab){const _0x2669b7=_0x35a251;return!this['cylinderStyleConver']&&(this[_0x2669b7(0x7c9)]=new CylinderStyleConver()),this['cylinderStyleConver']['isEntity']=_0x5cfaab,this['cylinderStyleConver'][_0x2669b7(0xc04)](_0x110728,_0x4463d3);}['_toCesiumValBefore'](_0x5d5757,_0x70ad1f){super['_toCesiumValBefore'](_0x5d5757,_0x70ad1f),!_0x5d5757['topRadius']&&(_0x5d5757['topRadius']=0x0);}['_toOneCesiumVal'](_0x5be6d9,_0x349d7e,_0x35b620,_0x222a7b){const _0x4be665=_0x35a251;switch(_0x5be6d9){case _0x4be665(0x4f7):if(_0x222a7b[_0x4be665(0xe1e)]instanceof Cesium__namespace['CallbackProperty']);else _0x222a7b['length']=Number(_0x349d7e);break;default:this['_toOneCesiumVal_Poly'](_0x5be6d9,_0x349d7e,_0x35b620,_0x222a7b);break;}}static['toJSON'](_0xf20e62,_0x4bfd8a,_0x423849){const _0x5bb133={_0x435b62:0x7c9},_0x2ffc74=_0x35a251;return!this['cylinderStyleConver']&&(this['cylinderStyleConver']=new CylinderStyleConver()),this[_0x2ffc74(_0x5bb133._0x435b62)]['isEntity']=_0x423849,this['cylinderStyleConver']['toJSON'](_0xf20e62,_0x4bfd8a);}[_0x35a251(0x502)](_0x5e2bbe,_0xf60419,_0x165444){this['_toOneJson_Poly'](_0x5e2bbe,_0xf60419,_0x165444);}}class DivGraphicStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x3bd0cc,_0x16c461){const _0x4e7f31={_0x10c4b1:0xd0a},_0x52d00a=_0x35a251;return!this[_0x52d00a(_0x4e7f31._0x10c4b1)]&&(this['divGraphicStyleConver']=new DivGraphicStyleConver()),this['divGraphicStyleConver'][_0x52d00a(0xc04)](_0x3bd0cc,_0x16c461);}['_toCesiumValBefore'](_0x218883,_0x5b2a67){}[_0x35a251(0x511)](_0x18dc20,_0x423685,_0x711a26,_0x23501b){const _0x23ff09=_0x35a251;this[_0x23ff09(0xacf)](_0x18dc20,_0x423685,_0x711a26,_0x23501b);}static[_0x35a251(0x99e)](_0x101226,_0x44cbb4){const _0xa5dbc9={_0x4ab276:0x99e},_0x139a52=_0x35a251;return!this['divGraphicStyleConver']&&(this['divGraphicStyleConver']=new DivGraphicStyleConver()),this['divGraphicStyleConver'][_0x139a52(_0xa5dbc9._0x4ab276)](_0x101226,_0x44cbb4);}[_0x35a251(0x502)](_0x39f4e5,_0x11c1e3,_0x42a928){const _0xde3ef1=_0x35a251;this[_0xde3ef1(0x280)](_0x39f4e5,_0x11c1e3,_0x42a928);}}class EllipsoidStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x13b592,_0x4edc56,_0x4b3837){const _0x5ee5ff={_0x1b55b3:0xbe4,_0x316f34:0xbe4,_0x5c7b82:0xc04},_0x529212=_0x35a251;return!this['ellipsoidStyleConver']&&(this[_0x529212(_0x5ee5ff._0x1b55b3)]=new EllipsoidStyleConver()),this['ellipsoidStyleConver']['isEntity']=_0x4b3837,this[_0x529212(_0x5ee5ff._0x316f34)][_0x529212(_0x5ee5ff._0x5c7b82)](_0x13b592,_0x4edc56);}['_toCesiumValBefore'](_0x263ba5,_0x1346e7){super['_toCesiumValBefore'](_0x263ba5,_0x1346e7);}['_getExcludedStyle'](){const _0x3f51fc={_0x5a0cba:0xc21,_0x5a7e8b:0x6c7},_0x55783a=_0x35a251;return[_0x55783a(_0x3f51fc._0x5a0cba),_0x55783a(_0x3f51fc._0x5a7e8b),'innerRadii_y','innerRadii_z'];}[_0x35a251(0x511)](_0x4127d3,_0x76f2c7,_0x1b984e,_0x3ecdb2){const _0x52a159={_0x1aaf98:0x825,_0xd9024e:0x7c0},_0x46e8bd=_0x35a251;switch(_0x4127d3){case'radii':_0x3ecdb2['radii']=new Cesium__namespace[(_0x46e8bd(0x8eb))](_0x76f2c7,_0x76f2c7,_0x76f2c7);break;case _0x46e8bd(0x9e6):_0x3ecdb2['radii']=new Cesium__namespace['Cartesian3'](_0x1b984e['radii_x']??0x64,_0x1b984e['radii_y']??0x64,_0x1b984e['radii_z']??0x64);break;case'innerRadii':_0x3ecdb2[_0x46e8bd(0x3de)]=new Cesium__namespace[(_0x46e8bd(0x8eb))](_0x76f2c7,_0x76f2c7,_0x76f2c7);break;case'innerRadii_x':_0x1b984e['innerRadii_x']>0x0&&_0x1b984e['innerRadii_y']>0x0&&_0x1b984e['innerRadii_z']>0x0?_0x3ecdb2[_0x46e8bd(0x3de)]=new Cesium__namespace['Cartesian3'](_0x1b984e[_0x46e8bd(0x1c3)]??0x0,_0x1b984e['innerRadii_y']??0x0,_0x1b984e['innerRadii_z']??0x0):_0x3ecdb2['innerRadii']=new Cesium__namespace['Cartesian3'](0.001,0.001,0.001);break;case'minimumClockDegree':case _0x46e8bd(0xf0e):case'minimumConeDegree':case'maximumConeDegree':_0x3ecdb2[_0x4127d3[_0x46e8bd(0x20e)](_0x46e8bd(_0x52a159._0x1aaf98),'')]=Cesium__namespace[_0x46e8bd(_0x52a159._0xd9024e)]['toRadians'](_0x76f2c7||0x0);break;default:this['_toOneCesiumVal_Poly'](_0x4127d3,_0x76f2c7,_0x1b984e,_0x3ecdb2);break;}}static['toJSON'](_0x4afcc1,_0x199cc9,_0x59afa5){const _0x1bb745={_0x3b4f02:0x99e},_0x40eb2b=_0x35a251;return!this['ellipsoidStyleConver']&&(this[_0x40eb2b(0xbe4)]=new EllipsoidStyleConver()),this[_0x40eb2b(0xbe4)]['isEntity']=_0x59afa5,this['ellipsoidStyleConver'][_0x40eb2b(_0x1bb745._0x3b4f02)](_0x4afcc1,_0x199cc9);}['_toOneJson'](_0xde7890,_0x5f1c6b,_0x4a9a3f){const _0x56a249={_0x1bf8d6:0xc21,_0xab4bc9:0x9c5},_0x3705e6=_0x35a251;switch(_0xde7890){case'radii':{_0x4a9a3f['radii_x']=_0x5f1c6b['x'],_0x4a9a3f[_0x3705e6(_0x56a249._0x1bf8d6)]=_0x5f1c6b['y'],_0x4a9a3f['radii_z']=_0x5f1c6b['z'];break;}case'innerRadii':{_0x4a9a3f['innerRadii_x']=_0x5f1c6b['x'],_0x4a9a3f['innerRadii_y']=_0x5f1c6b['y'],_0x4a9a3f['innerRadii_z']=_0x5f1c6b['z'];break;}case'minimumClock':case _0x3705e6(0x806):case'minimumCone':case'maximumCone':_0x4a9a3f[_0xde7890+'Degree']=formatNum$1(Cesium__namespace['Math'][_0x3705e6(_0x56a249._0xab4bc9)](_0x5f1c6b),0x2);break;default:this[_0x3705e6(0x483)](_0xde7890,_0x5f1c6b,_0x4a9a3f);break;}}}class LabelStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x42009f,_0x293bb1,_0x1f7e3a){const _0x57966f={_0x224897:0xa16},_0x58e0a9=_0x35a251;return!this[_0x58e0a9(0xa16)]&&(this['labelStyleConver']=new LabelStyleConver()),this[_0x58e0a9(_0x57966f._0x224897)]['attr']=_0x1f7e3a,_0x293bb1=this[_0x58e0a9(0xa16)]['toCesiumVal'](_0x42009f,_0x293bb1),_0x293bb1;}['_toCesiumValBefore'](_0x51bdbe,_0x210dc1){const _0x3a65fe={_0x5766f5:0x3dc,_0x367001:0x172},_0x5a6d64=_0x35a251;_0x210dc1[_0x5a6d64(_0x3a65fe._0x5766f5)]=_0x210dc1[_0x5a6d64(0x3dc)]??Cesium__namespace['HorizontalOrigin']['CENTER'],_0x210dc1['verticalOrigin']=_0x210dc1['verticalOrigin']??Cesium__namespace[_0x5a6d64(_0x3a65fe._0x367001)]['BOTTOM'];}[_0x35a251(0x277)](_0xcb2611,_0x5ec6e2){const _0x2f7c9e={_0x2e162a:0xdea,_0x5d82ea:0xd22,_0x3959c0:0xb83,_0x244d6c:0x683},_0x3c09b7=_0x35a251;!Cesium__namespace['defined'](_0xcb2611['font'])&&(_0x5ec6e2[_0x3c09b7(_0x2f7c9e._0x2e162a)]=(_0xcb2611['font_style']||'')+'\x20'+(_0xcb2611['font_weight']||'')+'\x20'+(_0xcb2611['font_size']||0x12)+'px\x20\x20'+(_0xcb2611['font_family']||'微软雅黑')),!Cesium__namespace['defined'](_0xcb2611['style'])&&(_0xcb2611[_0x3c09b7(_0x2f7c9e._0x5d82ea)]??!![])&&(_0xcb2611[_0x3c09b7(_0x2f7c9e._0x3959c0)]?_0x5ec6e2['style']=Cesium__namespace['LabelStyle']['FILL_AND_OUTLINE']:_0x5ec6e2['style']=Cesium__namespace[_0x3c09b7(_0x2f7c9e._0x244d6c)][_0x3c09b7(0x4f2)]);}['_getExcludedStyle'](){const _0x12e409={_0x9ffe2b:0xd22},_0x21917c=_0x35a251;return['font_style','font_weight','font_size','font_family','backgroundOpacity',_0x21917c(_0x12e409._0x9ffe2b)];}['_toOneCesiumVal'](_0x1e6297,_0x131576,_0x23ec3d,_0x328a43){const _0x119666={_0x3110ca:0x91d,_0x10a889:0x373,_0x3521d7:0x452},_0x318f26=_0x35a251;switch(_0x1e6297){case _0x318f26(0xe1f):{this[_0x318f26(0x6b3)]&&(_0x131576=template(_0x131576,this['attr'],_0x23ec3d['templateEmptyStr']??!![]));_0x328a43['text']=String(_0x131576||'')[_0x318f26(0x20e)](/
/gm,'\x0a');break;}case'color':{_0x328a43['fillColor']=this['getColorByStyle'](_0x23ec3d);break;}case'outlineColor':{_0x328a43['outlineColor']=this[_0x318f26(_0x119666._0x3110ca)](_0x23ec3d);break;}case _0x318f26(0x94b):case'fillColor':{_0x328a43[_0x1e6297]=getCesiumColor(_0x131576);break;}case _0x318f26(0xb94):_0x328a43['background']=_0x131576,_0x328a43['showBackground']=_0x131576;break;case'backgroundColor':{let _0x21dda7=getCesiumColor(_0x131576,Cesium__namespace['Color']['BLACK']);if(Cesium__namespace[_0x318f26(0xaa2)](_0x23ec3d['backgroundOpacity']))_0x21dda7=_0x21dda7['withAlpha'](Number(_0x23ec3d['backgroundOpacity']));else Cesium__namespace['defined'](_0x23ec3d['opacity'])&&(_0x21dda7=_0x21dda7[_0x318f26(_0x119666._0x10a889)](Number(_0x23ec3d['opacity'])));_0x328a43['backgroundColor']=_0x21dda7;break;}case'backgroundPadding':_0x328a43['backgroundPadding']=new Cesium__namespace[(_0x318f26(0x248))](_0x131576*1.2,_0x131576),_0x328a43[_0x318f26(0x9a4)]=_0x131576;break;case _0x318f26(0x365):!_0x131576&&(_0x328a43[_0x318f26(0x317)]=new Cesium__namespace['Cartesian2'](0x0,0x0));break;case'pixelOffsetX':case'pixelOffsetY':_0x328a43[_0x318f26(0x317)]=new Cesium__namespace['Cartesian2'](_0x23ec3d['pixelOffsetX']||0x0,_0x23ec3d[_0x318f26(_0x119666._0x3521d7)]||0x0);break;case'pixelOffset':Cesium__namespace['defined'](_0x131576[0x0])&&Cesium__namespace['defined'](_0x131576[0x1])?_0x328a43['pixelOffset']=new Cesium__namespace['Cartesian2'](_0x131576[0x0],_0x131576[0x1]):_0x328a43['pixelOffset']=_0x131576;break;default:this['_toOneCesiumVal_Point'](_0x1e6297,_0x131576,_0x23ec3d,_0x328a43);break;}}static['toJSON'](_0xaf3118,_0x983ffa){const _0x5817a8={_0x322299:0xa16},_0x196304=_0x35a251;return!this[_0x196304(_0x5817a8._0x322299)]&&(this['labelStyleConver']=new LabelStyleConver()),this['labelStyleConver']['toJSON'](_0xaf3118,_0x983ffa);}['_toOneJson'](_0x1796d3,_0x246b95,_0x5db0df){const _0x185e9c=_0x35a251;switch(_0x1796d3){case'pixelOffset':{_0x5db0df['pixelOffsetX']=_0x246b95['x'],_0x5db0df[_0x185e9c(0x452)]=_0x246b95['y'];break;}case'disableDepthTestDistance':{_0x246b95===Number['POSITIVE_INFINITY']?_0x5db0df['visibleDepth']=![]:_0x5db0df['disableDepthTestDistance']=_0x246b95;break;}default:this['_toOneJson_Point'](_0x1796d3,_0x246b95,_0x5db0df);break;}}static[_0x35a251(0x45c)](_0xa72a12,_0x338000){const _0x37133a={_0x413936:0x1f4,_0x446bef:0x9a2,_0x304179:0x373,_0x5e22eb:0xaa2,_0x10a621:0x469},_0x5afc2f=_0x35a251,_0xd5a04=getCesiumValue(_0xa72a12['fillColor'],Cesium__namespace['Color']);_0xd5a04?(!Cesium__namespace[_0x5afc2f(0xaa2)](_0xa72a12['_fillColor_alpha_bak'])&&(_0xa72a12['_fillColor_alpha_bak']=_0xd5a04[_0x5afc2f(_0x37133a._0x413936)]??0x1),_0xa72a12['fillColor']=_0xd5a04['withAlpha'](_0x338000*_0xa72a12['_fillColor_alpha_bak'])):_0xa72a12['fillColor']=Cesium__namespace[_0x5afc2f(0xf29)][_0x5afc2f(_0x37133a._0x446bef)][_0x5afc2f(_0x37133a._0x304179)](_0x338000);const _0x40dd91=getCesiumValue(_0xa72a12['outlineColor'],Cesium__namespace['Color']);_0x40dd91&&(!Cesium__namespace[_0x5afc2f(_0x37133a._0x5e22eb)](_0xa72a12['_outlineColor_alpha_bak'])&&(_0xa72a12[_0x5afc2f(0x469)]=_0x40dd91['alpha']??0x1),_0xa72a12['outlineColor']=_0x40dd91[_0x5afc2f(0x373)](_0x338000*_0xa72a12[_0x5afc2f(_0x37133a._0x10a621)]));const _0x2cc2b4=getCesiumValue(_0xa72a12['backgroundColor'],Cesium__namespace['Color']);_0x2cc2b4&&(!Cesium__namespace['defined'](_0xa72a12['_backgroundColor_alpha_bak'])&&(_0xa72a12['_backgroundColor_alpha_bak']=_0x2cc2b4['alpha']??0x1),_0xa72a12['backgroundColor']=_0x2cc2b4[_0x5afc2f(0x373)](_0x338000*_0xa72a12['_backgroundColor_alpha_bak']));}}class ModelStyleConver extends BaseStyleConver{static['toCesiumVal'](_0xa1b13e,_0x4a8e63,_0x221449){const _0x4d1980=_0x35a251;return!this['modelStyleConver']&&(this['modelStyleConver']=new ModelStyleConver()),this['modelStyleConver']['isEntity']=_0x221449,this[_0x4d1980(0xcb4)]['toCesiumVal'](_0xa1b13e,_0x4a8e63);}['_toCesiumValBefore'](_0x150223,_0x189d4f){}['_getExcludedStyle'](){const _0x2e0058={_0x258bd9:0x29d,_0xb38a9f:0x24e},_0x16af1c=_0x35a251;return[_0x16af1c(_0x2e0058._0x258bd9),_0x16af1c(0xa96),'silhouetteAlpha',_0x16af1c(_0x2e0058._0xb38a9f),'fill','opacity'];}['_toOneCesiumVal'](_0x3a6d3e,_0x44fcca,_0x409c05,_0x47fef0){const _0x56519d={_0x5ad746:0xd05},_0x192375=_0x35a251;switch(_0x3a6d3e){case'url':case'modelUrl':case'uri':_0x44fcca=replaceOnlineUrlDomain({'url':_0x44fcca})[_0x192375(_0x56519d._0x5ad746)];this[_0x192375(0x510)]?_0x47fef0['uri']=_0x44fcca:_0x47fef0['url']=_0x44fcca;break;case'scale':!isNaN(_0x44fcca)&&(_0x47fef0[_0x3a6d3e]=_0x44fcca);break;default:this['_toOneCesiumVal_Point'](_0x3a6d3e,_0x44fcca,_0x409c05,_0x47fef0);break;}}['_toCesiumValEnd'](_0x5732a6,_0x250396){const _0x1c8f22={_0x328540:0xf29,_0x2333f1:0xbf2,_0x5da5c8:0x198,_0x13383f:0x2cf},_0x2de299=_0x35a251;_0x250396['show']=Boolean(_0x250396['uri']||_0x250396['url']);if(_0x5732a6[_0x2de299(0xd22)])_0x250396['color']=getColorByStyle(_0x5732a6,Cesium__namespace[_0x2de299(_0x1c8f22._0x328540)][_0x2de299(0x9a2)]);else Cesium__namespace['defined'](_0x5732a6[_0x2de299(_0x1c8f22._0x2333f1)])&&_0x5732a6['opacity']!==0x1?_0x250396['color']=Cesium__namespace['Color']['WHITE'][_0x2de299(0x373)](_0x5732a6['opacity']):_0x250396['color']=Cesium__namespace['Color']['WHITE'];if(_0x5732a6['silhouette']){let _0x328181=getCesiumColor(_0x5732a6['silhouetteColor'],Cesium__namespace['Color']['WHITE']);Cesium__namespace['defined'](_0x5732a6[_0x2de299(_0x1c8f22._0x5da5c8)])&&(_0x328181=_0x328181['withAlpha'](Number(_0x5732a6['silhouetteAlpha']))),Cesium__namespace['defined'](_0x5732a6['globalAlpha'])&&_0x5732a6[_0x2de299(_0x1c8f22._0x13383f)]!==0x1&&(_0x328181=_0x328181['withAlpha'](_0x328181['alpha']*_0x5732a6['globalAlpha'])),_0x250396['silhouetteColor']=_0x328181,_0x250396['silhouetteSize']=Number(_0x5732a6['silhouetteSize']||0x1);}else _0x250396['silhouetteColor']=undefined,_0x250396['silhouetteSize']=0x0;}static['toJSON'](_0x2e4219,_0x226ef5,_0x5c84bd){const _0x2657cb=_0x35a251;return!this['modelStyleConver']&&(this[_0x2657cb(0xcb4)]=new ModelStyleConver()),this[_0x2657cb(0xcb4)]['isEntity']=_0x5c84bd,this[_0x2657cb(0xcb4)]['toJSON'](_0x2e4219,_0x226ef5);}['_toOneJson'](_0xadc556,_0x28b36d,_0x4c02fa){const _0x2185b7={_0x1c2e75:0x280},_0x199f23=_0x35a251;switch(_0xadc556){case'uri':{_0x4c02fa['url']=_0x28b36d;break;}default:this[_0x199f23(_0x2185b7._0x1c2e75)](_0xadc556,_0x28b36d,_0x4c02fa);break;}}static['setOpacity'](_0x24520a,_0x501434){const _0x1e1642={_0x115ac6:0x9db},_0x349e16=_0x35a251,_0x1e59b1=getCesiumValue(_0x24520a['color'],Cesium__namespace['Color']);!Cesium__namespace['defined'](_0x24520a['_color_alpha_bak'])&&(_0x24520a['_color_alpha_bak']=(_0x1e59b1===null||_0x1e59b1===void 0x0?void 0x0:_0x1e59b1['alpha'])??0x1);_0x1e59b1?_0x24520a[_0x349e16(_0x1e1642._0x115ac6)]=_0x1e59b1['withAlpha'](_0x501434*_0x24520a['_color_alpha_bak']):_0x24520a['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x501434);const _0x492f7e=getCesiumValue(_0x24520a[_0x349e16(0xa96)],Cesium__namespace['Color']);_0x492f7e&&(!Cesium__namespace['defined'](_0x24520a['_silhouetteColor_alpha_bak'])&&(_0x24520a['_silhouetteColor_alpha_bak']=_0x492f7e[_0x349e16(0x1f4)]??0x1),_0x24520a[_0x349e16(0xa96)]=_0x492f7e['withAlpha'](_0x501434*_0x24520a['_silhouetteColor_alpha_bak']));}}class PathStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x5034bf,_0x4c910c,_0x4d2c38){const _0x2bc433={_0x229017:0x318},_0x2c330b=_0x35a251;return!this['pathStyleConver']&&(this[_0x2c330b(0x318)]=new PathStyleConver()),this[_0x2c330b(_0x2bc433._0x229017)][_0x2c330b(0x510)]=_0x4d2c38,this[_0x2c330b(0x318)]['toCesiumVal'](_0x5034bf,_0x4c910c);}['_toOneCesiumVal'](_0xf4359e,_0x33f8da,_0x34e731,_0xda0956){this['_toOneCesiumVal_Poly'](_0xf4359e,_0x33f8da,_0x34e731,_0xda0956);}static['toJSON'](_0x10b78b,_0x124c7a,_0x186696){const _0x5a534e={_0x3109b0:0x318},_0xbb2228=_0x35a251;return!this['pathStyleConver']&&(this['pathStyleConver']=new PathStyleConver()),this['pathStyleConver']['isEntity']=_0x186696,this[_0xbb2228(_0x5a534e._0x3109b0)]['toJSON'](_0x10b78b,_0x124c7a);}['_toOneJson'](_0x3d62c5,_0x5591cd,_0x19b8b0){const _0x54a9be={_0x56af59:0x483},_0x6b49f5=_0x35a251;this[_0x6b49f5(_0x54a9be._0x56af59)](_0x3d62c5,_0x5591cd,_0x19b8b0);}}class PlaneStyleConver extends BaseStyleConver{static[_0x35a251(0xc04)](_0x227525,_0x561f57,_0x249271){const _0x4c32d7={_0x351fa5:0x510},_0x5d3bd4=_0x35a251;return!this['planeStyleConver']&&(this['planeStyleConver']=new PlaneStyleConver()),this['planeStyleConver'][_0x5d3bd4(_0x4c32d7._0x351fa5)]=_0x249271,this['planeStyleConver']['toCesiumVal'](_0x227525,_0x561f57);}[_0x35a251(0x1ca)](_0x36dce5,_0x5070fe){super['_toCesiumValBefore'](_0x36dce5,_0x5070fe);}[_0x35a251(0x511)](_0x5811b7,_0x39aba7,_0x2e567a,_0x27a5ca){const _0x2ca840={_0x22ce08:0xeb},_0xa3989d=_0x35a251;switch(_0x5811b7){case'dimensions_x':{const _0x522e69=_0x2e567a['dimensions_x']??0x64,_0x197f1c=_0x2e567a[_0xa3989d(_0x2ca840._0x22ce08)]??0x64;_0x27a5ca[_0xa3989d(0x6ea)]=new Cesium__namespace[(_0xa3989d(0x248))](_0x522e69,_0x197f1c);break;}case'plane_normal':{let _0x3b299f;switch(_0x39aba7){case'x':_0x3b299f=Cesium__namespace['Cartesian3']['UNIT_X'];break;case'y':_0x3b299f=Cesium__namespace['Cartesian3']['UNIT_Y'];break;case'z':_0x3b299f=Cesium__namespace['Cartesian3']['UNIT_Z'];break;default:_0x3b299f=_0x39aba7;break;}const _0x3849da=_0x2e567a['plane_distance']??0x0;_0x27a5ca['plane']=new Cesium__namespace['Plane'](_0x3b299f,_0x3849da);break;}default:this[_0xa3989d(0x473)](_0x5811b7,_0x39aba7,_0x2e567a,_0x27a5ca);break;}}static['toJSON'](_0x4274d0,_0x2a29a5,_0x545f2a){const _0x50c087={_0x131a1a:0x8a},_0x24ee16=_0x35a251;return!this['planeStyleConver']&&(this['planeStyleConver']=new PlaneStyleConver()),this[_0x24ee16(0x8a)]['isEntity']=_0x545f2a,this[_0x24ee16(_0x50c087._0x131a1a)]['toJSON'](_0x4274d0,_0x2a29a5);}static['toOneJson'](_0x4b593d,_0xa8bf51,_0xd4cc21){const _0x3085f4={_0x9b0265:0x8a},_0x73738c=_0x35a251;return!this['planeStyleConver']&&(this['planeStyleConver']=new PlaneStyleConver()),this[_0x73738c(_0x3085f4._0x9b0265)]['_toOneJson'](_0x4b593d,_0xa8bf51,_0xd4cc21);}['_toOneJson'](_0x7a1a38,_0x1700bb,_0x1b93e0){const _0x41fe89={_0x1b55d5:0x8eb,_0x10de97:0x417,_0x249491:0x8eb,_0x3e26a6:0xd66,_0x96593d:0xb3b,_0x1b1a48:0x13e},_0x361c11=_0x35a251;switch(_0x7a1a38){case'dimensions':{_0x1b93e0['dimensions_x']=_0x1700bb['x'],_0x1b93e0['dimensions_y']=_0x1700bb['y'];break;}case'plane_normal':{if(_0x1700bb['equals'](Cesium__namespace['Cartesian3']['UNIT_X']))_0x1b93e0['plane_normal']='x';else{if(_0x1700bb['equals'](Cesium__namespace[_0x361c11(_0x41fe89._0x1b55d5)]['UNIT_Y']))_0x1b93e0[_0x361c11(0xb3b)]='y';else _0x1700bb['equals'](Cesium__namespace[_0x361c11(_0x41fe89._0x1b55d5)]['UNIT_Z'])?_0x1b93e0['plane_normal']='z':(logWarn('plane类型未识别',_0x1700bb),_0x1b93e0['plane_normal']='z');}break;}case'plane':{if(_0x1700bb['normal'][_0x361c11(_0x41fe89._0x10de97)](Cesium__namespace[_0x361c11(0x8eb)]['UNIT_X']))_0x1b93e0['plane_normal']='x';else{if(_0x1700bb['normal']['equals'](Cesium__namespace[_0x361c11(_0x41fe89._0x249491)][_0x361c11(0x2a3)]))_0x1b93e0[_0x361c11(0xb3b)]='y';else _0x1700bb[_0x361c11(_0x41fe89._0x3e26a6)]['equals'](Cesium__namespace['Cartesian3'][_0x361c11(0x61f)])?_0x1b93e0[_0x361c11(_0x41fe89._0x96593d)]='z':(logWarn(_0x361c11(_0x41fe89._0x1b1a48),_0x1700bb),_0x1b93e0['plane_normal']='z');}_0x1b93e0['plane_distance']=_0x1700bb['distance'];break;}default:this['_toOneJson_Poly'](_0x7a1a38,_0x1700bb,_0x1b93e0);break;}}}class PointStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x733b82,_0x42956a,_0x2639c5){const _0x4e3c9b={_0x362aba:0xefb,_0x2a48f2:0x510},_0x4b0661=_0x35a251;return!this['pointStyleConver']&&(this[_0x4b0661(_0x4e3c9b._0x362aba)]=new PointStyleConver()),this['pointStyleConver'][_0x4b0661(_0x4e3c9b._0x2a48f2)]=_0x2639c5,this[_0x4b0661(_0x4e3c9b._0x362aba)]['toCesiumVal'](_0x733b82,_0x42956a);}[_0x35a251(0x1ca)](_0x201af9,_0x463571){_0x463571['pixelSize']=0x6;}['_toCesiumValEnd'](_0x34976e,_0xcd7240){const _0x25ed18={_0x3713ad:0xb83},_0x3ab816=_0x35a251;_0x34976e[_0x3ab816(_0x25ed18._0x3713ad)]===![]&&(_0xcd7240['outlineWidth']=0x0);}['_toOneCesiumVal'](_0x448212,_0x1cc61b,_0x12e0b1,_0x348d4d){const _0x3dd507=_0x35a251;switch(_0x448212){case'color':case _0x3dd507(0x1a6):{_0x348d4d['color']=this['getColorByStyle'](_0x12e0b1);break;}case'outlineColor':{_0x348d4d['outlineColor']=this['getOutlineColorByStyle'](_0x12e0b1);break;}default:this[_0x3dd507(0xacf)](_0x448212,_0x1cc61b,_0x12e0b1,_0x348d4d);break;}}static[_0x35a251(0x99e)](_0x388f95,_0x5f033b,_0x5d85d5){const _0x192ea6={_0xd6de2d:0x510},_0x519169=_0x35a251;return!this['pointStyleConver']&&(this['pointStyleConver']=new PointStyleConver()),this['pointStyleConver'][_0x519169(_0x192ea6._0xd6de2d)]=_0x5d85d5,this['pointStyleConver']['toJSON'](_0x388f95,_0x5f033b);}['_toOneJson'](_0x5504af,_0x2a85ed,_0x17e603){this['_toOneJson_Point'](_0x5504af,_0x2a85ed,_0x17e603);}}class PolygonStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x4d0d57,_0x284923,_0x921ef4){const _0x7400e8={_0x1f6aec:0x510},_0x144f33=_0x35a251;return!this['polygonStyleConver']&&(this['polygonStyleConver']=new PolygonStyleConver()),this['polygonStyleConver'][_0x144f33(_0x7400e8._0x1f6aec)]=_0x921ef4,this[_0x144f33(0xb5)]['toCesiumVal'](_0x4d0d57,_0x284923);}[_0x35a251(0x1ca)](_0x2a7bf0,_0x556c25){const _0x4711d4={_0x28dbfe:0x581,_0xd06e58:0x979},_0x59194b=_0x35a251;super['_toCesiumValBefore'](_0x2a7bf0,_0x556c25);if(_0x2a7bf0['clampToGround'])_0x556c25['arcType']=Cesium__namespace[_0x59194b(_0x4711d4._0x28dbfe)]['GEODESIC'],_0x2a7bf0[_0x59194b(0x63f)]('height')&&delete _0x2a7bf0['height'],_0x2a7bf0['hasOwnProperty']('diffHeight')&&delete _0x2a7bf0[_0x59194b(0x4f7)],_0x2a7bf0['hasOwnProperty'](_0x59194b(0x552))&&delete _0x2a7bf0['extrudedHeight'];else Cesium__namespace['defined'](_0x2a7bf0['height'])?(_0x2a7bf0[_0x59194b(0x979)]=![],_0x556c25['perPositionHeight']=![]):(_0x2a7bf0[_0x59194b(_0x4711d4._0xd06e58)]=![],_0x556c25['perPositionHeight']=!![]);}['_toOneCesiumVal'](_0x1b231f,_0x374f02,_0x4c0a40,_0x1c7908){const _0x45a9c3={_0x385441:0x91d,_0x3390ea:0xaa2},_0x1283b8=_0x35a251;switch(_0x1b231f){case'outlineColor':{_0x1c7908['outlineColor']=this[_0x1283b8(_0x45a9c3._0x385441)](_0x4c0a40);break;}case _0x1283b8(0x682):{_0x1c7908[_0x1b231f]=_0x374f02,_0x1c7908['perPositionHeight']=![];break;}case'diffHeight':{Cesium__namespace['defined'](_0x4c0a40['height'])&&(_0x1c7908['extrudedHeight']=_0x4c0a40['height']+_0x374f02);break;}case _0x1283b8(0x979):_0x1c7908[_0x1b231f]=_0x374f02,_0x1c7908['perPositionHeight']=!_0x374f02&&!Cesium__namespace[_0x1283b8(_0x45a9c3._0x3390ea)](_0x4c0a40['height']);break;case'stRotation':_0x1c7908[_0x1283b8(0x1e1)]=_0x374f02;break;case'stRotationDegree':_0x1c7908['stRotation']=Cesium__namespace['Math']['toRadians'](_0x374f02);break;default:this['_toOneCesiumVal_Poly'](_0x1b231f,_0x374f02,_0x4c0a40,_0x1c7908);break;}}static['toJSON'](_0x13db50,_0x50d0b0,_0x18279b){const _0x4eed73=_0x35a251;return!this['polygonStyleConver']&&(this['polygonStyleConver']=new PolygonStyleConver()),this['polygonStyleConver']['isEntity']=_0x18279b,this['polygonStyleConver'][_0x4eed73(0x99e)](_0x13db50,_0x50d0b0);}[_0x35a251(0x502)](_0x1dd9f5,_0x30bab1,_0x174130){const _0x3d04b3={_0x549f07:0x483},_0x14610e=_0x35a251;switch(_0x1dd9f5){case'stRotation':{_0x174130['stRotationDegree']=formatNum$1(Cesium__namespace['Math'][_0x14610e(0x9c5)](_0x30bab1),0x1);break;}default:this[_0x14610e(_0x3d04b3._0x549f07)](_0x1dd9f5,_0x30bab1,_0x174130);break;}}}class PolylineStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x36c0a0,_0xc5bda5,_0x19a4c2){const _0x53544d={_0x26af26:0xb8f},_0x837b61=_0x35a251;return!this['polylineStyleConver']&&(this['polylineStyleConver']=new PolylineStyleConver()),this[_0x837b61(_0x53544d._0x26af26)]['isEntity']=_0x19a4c2,this[_0x837b61(0xb8f)]['toCesiumVal'](_0x36c0a0,_0xc5bda5);}['_toCesiumValBefore'](_0x1f02d3,_0x16bef9){const _0x9e0cc3=_0x35a251;super['_toCesiumValBefore'](_0x1f02d3,_0x16bef9),_0x1f02d3['clampToGround']&&(_0x16bef9['arcType']=Cesium__namespace['ArcType']['GEODESIC']),_0x1f02d3[_0x9e0cc3(0x472)]===Color$2&&_0x1f02d3['outline']&&_0x1f02d3['outlineColor']&&(_0x1f02d3[_0x9e0cc3(0x472)]=PolylineOutline);}[_0x35a251(0x511)](_0x26c313,_0x58569b,_0x32619a,_0x40d43c){const _0x3f81e5={_0x21f02c:0x373,_0x3d16fd:0xbf2,_0x212ee2:0x510,_0x3bca47:0xe31},_0x1a7252=_0x35a251;switch(_0x26c313){case'depthFail':if(_0x58569b){let _0x2dd017=getCesiumColor(_0x32619a[_0x1a7252(0x239)]||_0x32619a['color'],Cesium__namespace['Color']['YELLOW']);Cesium__namespace['defined'](_0x32619a['depthFailOpacity'])&&(_0x2dd017=_0x2dd017[_0x1a7252(_0x3f81e5._0x21f02c)](Number(_0x32619a['depthFailOpacity']))),this['isEntity']?_0x40d43c['depthFailMaterial']=_0x2dd017:_0x40d43c['depthFailColor']=_0x2dd017,_0x32619a[_0x1a7252(_0x3f81e5._0x3d16fd)]===0x1&&(_0x32619a[_0x1a7252(_0x3f81e5._0x3d16fd)]=0.98);}else _0x40d43c['depthFailMaterial']=undefined;_0x40d43c[_0x26c313]=_0x58569b;break;case'closure':!this[_0x1a7252(_0x3f81e5._0x212ee2)]&&(_0x40d43c[_0x1a7252(_0x3f81e5._0x3bca47)]=_0x58569b);_0x40d43c['closure']=_0x58569b;break;default:this['_toOneCesiumVal_Poly'](_0x26c313,_0x58569b,_0x32619a,_0x40d43c);break;}}static['toJSON'](_0x20f3dd,_0x2eb22f,_0x2cbf48){const _0x37aa62={_0x5845df:0xb8f},_0x2e78d6=_0x35a251;return!this['polylineStyleConver']&&(this['polylineStyleConver']=new PolylineStyleConver()),this[_0x2e78d6(_0x37aa62._0x5845df)][_0x2e78d6(0x510)]=_0x2cbf48,this['polylineStyleConver']['toJSON'](_0x20f3dd,_0x2eb22f);}[_0x35a251(0x502)](_0x2817cb,_0x2756b4,_0x10c852){const _0xf179af={_0x1a7677:0x483},_0x34191a=_0x35a251;switch(_0x2817cb){case'loop':_0x10c852[_0x34191a(0xb3a)]=_0x2756b4;break;default:this[_0x34191a(_0xf179af._0x1a7677)](_0x2817cb,_0x2756b4,_0x10c852);break;}}}class PolylineVolumeStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x301fb5,_0x230fb2,_0x2697b4){const _0x2ea471=_0x35a251;return!this[_0x2ea471(0xaa0)]&&(this['polylineVolumeStyleConver']=new PolylineVolumeStyleConver()),this[_0x2ea471(0xaa0)]['isEntity']=_0x2697b4,this[_0x2ea471(0xaa0)][_0x2ea471(0xc04)](_0x301fb5,_0x230fb2);}[_0x35a251(0x277)](_0x276bc3,_0x56a7bb){const _0x24658d={_0x4e550e:0x64d},_0x12a33c=_0x35a251,_0x1f1fbe=_0x276bc3['shape']||_0x276bc3[_0x12a33c(0x912)];_0x276bc3[_0x12a33c(0x907)]=_0x276bc3['radius']||0xa;switch(_0x1f1fbe){case'pipeline':_0x56a7bb['shape']=PolylineVolumeStyleConver['getShapeForPipeline'](_0x276bc3);break;case'circle':_0x56a7bb['shape']=PolylineVolumeStyleConver[_0x12a33c(_0x24658d._0x4e550e)](_0x276bc3);break;case _0x12a33c(0xa22):_0x56a7bb['shape']=PolylineVolumeStyleConver['getShapeForStar'](_0x276bc3);break;default:_0x56a7bb[_0x12a33c(0x3f1)]=_0x1f1fbe;break;}}['_toOneCesiumVal'](_0x1e9be6,_0x822f63,_0x2b6154,_0x2b612a){this['_toOneCesiumVal_Poly'](_0x1e9be6,_0x822f63,_0x2b6154,_0x2b612a);}static['toJSON'](_0x2d331c,_0x57c55b,_0x239e88){const _0x3e0843={_0x197c5a:0xaa0},_0x1e70e8=_0x35a251;return!this['polylineVolumeStyleConver']&&(this['polylineVolumeStyleConver']=new PolylineVolumeStyleConver()),this['polylineVolumeStyleConver']['isEntity']=_0x239e88,this[_0x1e70e8(_0x3e0843._0x197c5a)]['toJSON'](_0x2d331c,_0x57c55b);}[_0x35a251(0x502)](_0x4e2eaa,_0x3ea2af,_0x534d68){this['_toOneJson_Poly'](_0x4e2eaa,_0x3ea2af,_0x534d68);}static['getShapeForPipeline'](_0x3b16e5){const _0x3c68e3={_0x2c62f5:0x83b,_0x30295b:0xf82,_0xa55ac8:0x7ba,_0x3e6d9f:0x248,_0x1c5ec7:0x6de},_0x111950=_0x35a251,_0x4cbcdd=_0x3b16e5[_0x111950(0x907)]??0x1,_0x2d4175=_0x3b16e5[_0x111950(_0x3c68e3._0x2c62f5)]??_0x4cbcdd/0x3,_0x43d782=Math[_0x111950(_0x3c68e3._0x30295b)](0x168/(_0x3b16e5['slices']??0x3c)),_0x1a08fa=_0x3b16e5['startAngle']??0x0,_0x21044a=_0x3b16e5['endAngle']??_0x1a08fa+0x168,_0xe73e5f=_0x3b16e5['vscale']??0x1,_0x19231b=_0x3b16e5['hscale']??0x1,_0x7794f1=[];for(let _0x5f335f=_0x1a08fa;_0x5f335f<=_0x21044a;_0x5f335f+=_0x43d782){const _0x1687fc=Cesium__namespace['Math'][_0x111950(_0x3c68e3._0xa55ac8)](_0x5f335f);_0x7794f1['push'](new Cesium__namespace[(_0x111950(_0x3c68e3._0x3e6d9f))](_0x4cbcdd*_0x19231b*Math['cos'](_0x1687fc),_0x4cbcdd*_0xe73e5f*Math['sin'](_0x1687fc)));}for(let _0x375040=_0x21044a;_0x375040>=_0x1a08fa;_0x375040-=_0x43d782){const _0x260900=Cesium__namespace['Math']['toRadians'](_0x375040);_0x7794f1[_0x111950(_0x3c68e3._0x1c5ec7)](new Cesium__namespace[(_0x111950(_0x3c68e3._0x3e6d9f))]((_0x4cbcdd-_0x2d4175)*_0x19231b*Math['cos'](_0x260900),(_0x4cbcdd-_0x2d4175)*_0xe73e5f*Math['sin'](_0x260900)));}return _0x7794f1;}static['getShapeForCircle'](_0x3c8800){const _0x185774={_0x49a6cd:0x907,_0x2cf5c5:0xeec},_0x4d9b8d=_0x35a251,_0x1a6a13=_0x3c8800[_0x4d9b8d(_0x185774._0x49a6cd)]??0x1,_0x371148=Math[_0x4d9b8d(0xf82)](0x168/(_0x3c8800['slices']??0x3c)),_0x1666f6=_0x3c8800['startAngle']??0x0,_0x314e62=_0x3c8800[_0x4d9b8d(0x7b6)]??_0x1666f6+0x168,_0x4259e5=_0x3c8800['vscale']??0x1,_0xf921b7=_0x3c8800['hscale']??0x1,_0x55b22f=[];for(let _0xf5e0b9=_0x1666f6;_0xf5e0b9<=_0x314e62;_0xf5e0b9+=_0x371148){const _0x3f2ca7=Cesium__namespace[_0x4d9b8d(0x7c0)]['toRadians'](_0xf5e0b9);_0x55b22f['push'](new Cesium__namespace['Cartesian2'](_0x1a6a13*_0xf921b7*Math[_0x4d9b8d(_0x185774._0x2cf5c5)](_0x3f2ca7),_0x1a6a13*_0x4259e5*Math['sin'](_0x3f2ca7)));}return _0x55b22f;}static['getShapeForStar'](_0x1b64d5){const _0x490ec2={_0xb837bb:0x7ba},_0x20df64=_0x35a251,_0x2a1234=_0x1b64d5['radius']??0x1,_0x7c3f0f=_0x2a1234-(_0x1b64d5['thicknes']??_0x2a1234/0x3),_0x5d7fb6=_0x1b64d5['slices']??0x6,_0x14d42c=Cesium__namespace['Math'][_0x20df64(_0x490ec2._0xb837bb)](_0x1b64d5['startAngle']??0x0),_0x350006=Math['PI']/_0x5d7fb6,_0x1b6d69=0x2*_0x5d7fb6,_0xcb657=new Array(_0x1b6d69);for(let _0x2f3852=0x0;_0x2f3852<_0x1b6d69;_0x2f3852++){const _0x1e7b1b=_0x2f3852%0x2===0x0?_0x2a1234:_0x7c3f0f,_0x46f089=_0x14d42c+_0x2f3852*_0x350006;_0xcb657[_0x2f3852]=new Cesium__namespace['Cartesian2'](Math['cos'](_0x46f089)*_0x1e7b1b,Math['sin'](_0x46f089)*_0x1e7b1b);}return _0xcb657;}}class RectangleStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x5717b9,_0x14448e,_0x433a18){const _0x23bbd8={_0x576ad8:0xd26,_0x228b23:0xd26,_0x2f9a99:0xd26},_0x1518c0=_0x35a251;return!this[_0x1518c0(_0x23bbd8._0x576ad8)]&&(this[_0x1518c0(_0x23bbd8._0x228b23)]=new RectangleStyleConver()),this['rectangleStyleConver']['isEntity']=_0x433a18,this[_0x1518c0(_0x23bbd8._0x2f9a99)]['toCesiumVal'](_0x5717b9,_0x14448e);}['_toCesiumValBefore'](_0x5c6e10,_0x41db9c){const _0x1e4f43={_0x5a3143:0x979,_0x2a5ef2:0x682,_0x175b27:0x552},_0x431f64=_0x35a251;super['_toCesiumValBefore'](_0x5c6e10,_0x41db9c),_0x5c6e10[_0x431f64(_0x1e4f43._0x5a3143)]?(_0x5c6e10['hasOwnProperty'](_0x431f64(_0x1e4f43._0x2a5ef2))&&delete _0x5c6e10['height'],_0x5c6e10[_0x431f64(0x63f)]('diffHeight')&&delete _0x5c6e10['diffHeight'],_0x5c6e10['hasOwnProperty']('extrudedHeight')&&delete _0x5c6e10[_0x431f64(_0x1e4f43._0x175b27)]):(_0x5c6e10['clampToGround']=![],_0x41db9c[_0x431f64(_0x1e4f43._0x2a5ef2)]=0x0);}['_toOneCesiumVal'](_0x398c07,_0x2dc452,_0x52f768,_0x425752){const _0x5176cb={_0x248dcc:0x682,_0x4ec285:0x7c0,_0x1e797c:0x4b2},_0x553ec3=_0x35a251;switch(_0x398c07){case'height':_0x425752['height']=_0x2dc452;_0x52f768['diffHeight']&&(_0x425752['extrudedHeight']=Number(_0x52f768['diffHeight'])+Number(_0x2dc452));break;case'diffHeight':Cesium__namespace['defined'](_0x52f768['height'])&&(_0x425752[_0x553ec3(0x552)]=_0x52f768[_0x553ec3(_0x5176cb._0x248dcc)]+_0x2dc452);break;case'rotation':_0x425752['rotation']=_0x2dc452;!_0x52f768['stRotation']&&(_0x425752['stRotation']=_0x425752['rotation']);break;case'rotationDegree':_0x425752['rotation']=Cesium__namespace['Math']['toRadians'](_0x2dc452);!_0x52f768['stRotation']&&(_0x425752['stRotation']=_0x425752['rotation']);break;case _0x553ec3(0x1e1):_0x425752['stRotation']=_0x2dc452;break;case'stRotationDegree':_0x425752[_0x553ec3(0x1e1)]=Cesium__namespace[_0x553ec3(_0x5176cb._0x4ec285)]['toRadians'](_0x2dc452);break;case'clampToGround':_0x2dc452?_0x425752['heightReference']=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:_0x425752[_0x553ec3(_0x5176cb._0x1e797c)]=Cesium__namespace[_0x553ec3(0x8f1)]['NONE'];break;default:this['_toOneCesiumVal_Poly'](_0x398c07,_0x2dc452,_0x52f768,_0x425752);break;}}static['toJSON'](_0x457ff2,_0x194429,_0x46581c){return!this['rectangleStyleConver']&&(this['rectangleStyleConver']=new RectangleStyleConver()),this['rectangleStyleConver']['isEntity']=_0x46581c,this['rectangleStyleConver']['toJSON'](_0x457ff2,_0x194429);}['_toOneJson'](_0x207335,_0x46f96f,_0x54cc9f){this['_toOneJson_Poly'](_0x207335,_0x46f96f,_0x54cc9f);}}class RectangularSensorStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x293e88,_0x57de71){const _0x36d1f4=_0x35a251;return!this[_0x36d1f4(0x619)]&&(this['rectangularSensorStyleConver']=new RectangularSensorStyleConver()),this['rectangularSensorStyleConver']['isEntity']=!![],this['rectangularSensorStyleConver']['toCesiumVal'](_0x293e88,_0x57de71);}[_0x35a251(0x1ca)](_0xbed533,_0x512f94){const _0x305a08=_0x35a251;super[_0x305a08(0x1ca)](_0xbed533,_0x512f94);}['_getExcludedStyle'](){const _0x387796={_0x4b9b1d:0x861},_0x54caa9=_0x35a251;return['lineOpacity',_0x54caa9(_0x387796._0x4b9b1d)];}[_0x35a251(0x511)](_0x51d902,_0x5eb246,_0x2dda1b,_0x218b23){const _0xdbb773={_0x15a7e7:0x2cf,_0x308dfe:0xda0,_0x5b86f8:0xbf2,_0x1fbbc4:0x1f4,_0x269ce7:0x660,_0x2c72a4:0x7ba},_0x1f3006=_0x35a251;switch(_0x51d902){case'lineColor':{let _0x37eb8e=Cesium__namespace[_0x1f3006(0xf29)][_0x1f3006(0xda0)](_0x5eb246||'#ffffff');if(Cesium__namespace['defined'](_0x2dda1b[_0x1f3006(0xaee)]))_0x37eb8e=_0x37eb8e['withAlpha'](Number(_0x2dda1b['lineOpacity']));else Cesium__namespace['defined'](_0x2dda1b['opacity'])&&(_0x37eb8e=_0x37eb8e['withAlpha'](Number(_0x2dda1b['opacity'])));Cesium__namespace['defined'](_0x2dda1b[_0x1f3006(_0xdbb773._0x15a7e7)])&&_0x2dda1b['globalAlpha']!==0x1&&(_0x37eb8e=_0x37eb8e['withAlpha'](_0x37eb8e['alpha']*_0x2dda1b[_0x1f3006(_0xdbb773._0x15a7e7)]));_0x218b23[_0x1f3006(0xfbc)]=_0x37eb8e;break;}case'scanPlaneColor':{let _0x34cb1a=Cesium__namespace['Color'][_0x1f3006(_0xdbb773._0x308dfe)](_0x5eb246||'#ffffff');if(Cesium__namespace['defined'](_0x2dda1b['scanPlaneOpacity']))_0x34cb1a=_0x34cb1a['withAlpha'](Number(_0x2dda1b['scanPlaneOpacity']));else Cesium__namespace[_0x1f3006(0xaa2)](_0x2dda1b[_0x1f3006(_0xdbb773._0x5b86f8)])&&(_0x34cb1a=_0x34cb1a['withAlpha'](Number(_0x2dda1b['opacity'])));Cesium__namespace['defined'](_0x2dda1b['globalAlpha'])&&_0x2dda1b['globalAlpha']!==0x1&&(_0x34cb1a=_0x34cb1a['withAlpha'](_0x34cb1a[_0x1f3006(_0xdbb773._0x1fbbc4)]*_0x2dda1b['globalAlpha']));_0x218b23[_0x1f3006(0x659)]=_0x34cb1a;break;}case'xHalfAngleDegree':_0x218b23[_0x1f3006(_0xdbb773._0x269ce7)]=Cesium__namespace['Math'][_0x1f3006(_0xdbb773._0x2c72a4)](_0x5eb246);break;case'yHalfAngleDegree':_0x218b23['yHalfAngle']=Cesium__namespace['Math']['toRadians'](_0x5eb246);break;case'depthTest':_0x218b23['showThroughEllipsoid']=!_0x5eb246;break;default:this['_toOneCesiumVal_Poly'](_0x51d902,_0x5eb246,_0x2dda1b,_0x218b23);break;}}static['toJSON'](_0xb20206,_0x302284){const _0x10fe2a={_0x1e9e76:0x619},_0x36104a=_0x35a251;return!this[_0x36104a(_0x10fe2a._0x1e9e76)]&&(this['rectangularSensorStyleConver']=new RectangularSensorStyleConver()),this['rectangularSensorStyleConver'][_0x36104a(0x510)]=!![],this['rectangularSensorStyleConver']['toJSON'](_0xb20206,_0x302284);}[_0x35a251(0x502)](_0x57f8de,_0xecdd81,_0xafa557){this['_toOneJson_Poly'](_0x57f8de,_0xecdd81,_0xafa557);}}class WallStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x24f35b,_0x136c6d,_0xbb8966){const _0x2446a3={_0x5e120d:0x3aa},_0x261a07=_0x35a251;return!this[_0x261a07(_0x2446a3._0x5e120d)]&&(this[_0x261a07(0x3aa)]=new WallStyleConver()),this['wallStyleConver']['isEntity']=_0xbb8966,this[_0x261a07(_0x2446a3._0x5e120d)]['toCesiumVal'](_0x24f35b,_0x136c6d);}[_0x35a251(0x511)](_0x3bde69,_0x22568e,_0x1cb3c9,_0x9bd5){this['_toOneCesiumVal_Poly'](_0x3bde69,_0x22568e,_0x1cb3c9,_0x9bd5);}static['toJSON'](_0x3fd6b5,_0x1c38ea,_0x96af78){const _0x51bf0f={_0x14eb12:0x99e},_0x1a1bb6=_0x35a251;return!this['wallStyleConver']&&(this['wallStyleConver']=new WallStyleConver()),this[_0x1a1bb6(0x3aa)]['isEntity']=_0x96af78,this[_0x1a1bb6(0x3aa)][_0x1a1bb6(_0x51bf0f._0x14eb12)](_0x3fd6b5,_0x1c38ea);}['_toOneJson'](_0x59ffde,_0x432443,_0x2a3e15){this['_toOneJson_Poly'](_0x59ffde,_0x432443,_0x2a3e15);}}var czm_cellular=_0x35a251(0x37d),czm_snoise='/**\x0a\x20*\x20@license\x0a\x20*\x20Description\x20:\x20Array\x20and\x20textureless\x20GLSL\x202D/3D/4D\x20simplex\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20noise\x20functions.\x0a\x20*\x20\x20\x20\x20\x20\x20Author\x20:\x20Ian\x20McEwan,\x20Ashima\x20Arts.\x0a\x20*\x20\x20Maintainer\x20:\x20ijm\x0a\x20*\x20\x20\x20\x20\x20Lastmod\x20:\x2020110822\x20(ijm)\x0a\x20*\x20\x20\x20\x20\x20License\x20:\x20Copyright\x20(C)\x202011\x20Ashima\x20Arts.\x20All\x20rights\x20reserved.\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Distributed\x20under\x20the\x20MIT\x20License.\x20See\x20LICENSE\x20file.\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20https://github.com/ashima/webgl-noise\x0a\x20*/\x0a\x0avec4\x20_czm_mod289(vec4\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec3\x20_czm_mod289(vec3\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec2\x20_czm_mod289(vec2\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0afloat\x20_czm_mod289(float\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec4\x20_czm_permute(vec4\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0avec3\x20_czm_permute(vec3\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0afloat\x20_czm_permute(float\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0avec4\x20_czm_taylorInvSqrt(vec4\x20r)\x20{\x0a\x20\x20return\x201.79284291400159\x20-\x200.85373472095314\x20*\x20r;\x0a}\x0a\x0afloat\x20_czm_taylorInvSqrt(float\x20r)\x20{\x0a\x20\x20return\x201.79284291400159\x20-\x200.85373472095314\x20*\x20r;\x0a}\x0a\x0avec4\x20_czm_grad4(float\x20j,\x20vec4\x20ip)\x20{\x0a\x20\x20const\x20vec4\x20ones\x20=\x20vec4(1.0,\x201.0,\x201.0,\x20-1.0);\x0a\x20\x20vec4\x20p,\x20s;\x0a\x0a\x20\x20p.xyz\x20=\x20floor(fract(vec3(j)\x20*\x20ip.xyz)\x20*\x207.0)\x20*\x20ip.z\x20-\x201.0;\x0a\x20\x20p.w\x20=\x201.5\x20-\x20dot(abs(p.xyz),\x20ones.xyz);\x0a\x20\x20s\x20=\x20vec4(lessThan(p,\x20vec4(0.0)));\x0a\x20\x20p.xyz\x20=\x20p.xyz\x20+\x20(s.xyz\x20*\x202.0\x20-\x201.0)\x20*\x20s.www;\x0a\x0a\x20\x20return\x20p;\x0a}\x0a\x0a/**\x0a\x20*\x20DOC_TBA\x0a\x20*\x0a\x20*\x20Implemented\x20by\x20Ian\x20McEwan,\x20Ashima\x20Arts,\x20and\x20distributed\x20under\x20the\x20MIT\x20License.\x20\x20{@link\x20https://github.com/ashima/webgl-noise}\x0a\x20*\x0a\x20*\x20@name\x20czm_snoise\x0a\x20*\x20@glslFunction\x0a\x20*\x0a\x20*\x20@see\x20https://github.com/ashima/webgl-noise\x0a\x20*\x20@see\x20Stefan\x20Gustavson\x27s\x20paper\x20Simplex\x20noise\x20demystified\x0a\x20*/\x0afloat\x20czm_snoise(vec2\x20v)\x20{\x0a\x20\x20const\x20vec4\x20C\x20=\x20vec4(0.211324865405187,\x20\x20//\x20(3.0-sqrt(3.0))/6.0\x0a\x20\x200.366025403784439,\x20\x20//\x200.5*(sqrt(3.0)-1.0)\x0a\x20\x20-0.577350269189626,\x20\x20//\x20-1.0\x20+\x202.0\x20*\x20C.x\x0a\x20\x200.024390243902439);\x20//\x201.0\x20/\x2041.0\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec2\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20C.yy));\x0a\x20\x20vec2\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x20\x20vec2\x20i1;\x0a\x20\x20\x20\x20//i1.x\x20=\x20step(\x20x0.y,\x20x0.x\x20);\x20//\x20x0.x\x20>\x20x0.y\x20?\x201.0\x20:\x200.0\x0a\x20\x20\x20\x20//i1.y\x20=\x201.0\x20-\x20i1.x;\x0a\x20\x20i1\x20=\x20(x0.x\x20>\x20x0.y)\x20?\x20vec2(1.0,\x200.0)\x20:\x20vec2(0.0,\x201.0);\x0a\x20\x20\x20\x20//\x20x0\x20=\x20x0\x20-\x200.0\x20+\x200.0\x20*\x20C.xx\x20;\x0a\x20\x20\x20\x20//\x20x1\x20=\x20x0\x20-\x20i1\x20+\x201.0\x20*\x20C.xx\x20;\x0a\x20\x20\x20\x20//\x20x2\x20=\x20x0\x20-\x201.0\x20+\x202.0\x20*\x20C.xx\x20;\x0a\x20\x20vec4\x20x12\x20=\x20x0.xyxy\x20+\x20C.xxzz;\x0a\x20\x20x12.xy\x20-=\x20i1;\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x20//\x20Avoid\x20truncation\x20effects\x20in\x20permutation\x0a\x20\x20vec3\x20p\x20=\x20_czm_permute(_czm_permute(i.y\x20+\x20vec3(0.0,\x20i1.y,\x201.0))\x20+\x20i.x\x20+\x20vec3(0.0,\x20i1.x,\x201.0));\x0a\x0a\x20\x20vec3\x20m\x20=\x20max(0.5\x20-\x20vec3(dot(x0,\x20x0),\x20dot(x12.xy,\x20x12.xy),\x20dot(x12.zw,\x20x12.zw)),\x200.0);\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x2041\x20points\x20uniformly\x20over\x20a\x20line,\x20mapped\x20onto\x20a\x20diamond.\x0a\x20\x20\x20\x20//\x20The\x20ring\x20size\x2017*17\x20=\x20289\x20is\x20close\x20to\x20a\x20multiple\x20of\x2041\x20(41*7\x20=\x20287)\x0a\x20\x20vec3\x20x\x20=\x202.0\x20*\x20fract(p\x20*\x20C.www)\x20-\x201.0;\x0a\x20\x20vec3\x20h\x20=\x20abs(x)\x20-\x200.5;\x0a\x20\x20vec3\x20ox\x20=\x20floor(x\x20+\x200.5);\x0a\x20\x20vec3\x20a0\x20=\x20x\x20-\x20ox;\x0a\x0a\x20\x20\x20\x20//\x20Normalise\x20gradients\x20implicitly\x20by\x20scaling\x20m\x0a\x20\x20\x20\x20//\x20Approximation\x20of:\x20m\x20*=\x20inversesqrt(\x20a0*a0\x20+\x20h*h\x20);\x0a\x20\x20m\x20*=\x201.79284291400159\x20-\x200.85373472095314\x20*\x20(a0\x20*\x20a0\x20+\x20h\x20*\x20h);\x0a\x0a\x20\x20\x20\x20//\x20Compute\x20final\x20noise\x20value\x20at\x20P\x0a\x20\x20vec3\x20g;\x0a\x20\x20g.x\x20=\x20a0.x\x20*\x20x0.x\x20+\x20h.x\x20*\x20x0.y;\x0a\x20\x20g.yz\x20=\x20a0.yz\x20*\x20x12.xz\x20+\x20h.yz\x20*\x20x12.yw;\x0a\x20\x20return\x20130.0\x20*\x20dot(m,\x20g);\x0a}\x0a\x0afloat\x20czm_snoise(vec3\x20v)\x20{\x0a\x20\x20const\x20vec2\x20C\x20=\x20vec2(1.0\x20/\x206.0,\x201.0\x20/\x203.0);\x0a\x20\x20const\x20vec4\x20D\x20=\x20vec4(0.0,\x200.5,\x201.0,\x202.0);\x0a\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec3\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20C.yyy));\x0a\x20\x20vec3\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xxx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x20\x20vec3\x20g\x20=\x20step(x0.yzx,\x20x0.xyz);\x0a\x20\x20vec3\x20l\x20=\x201.0\x20-\x20g;\x0a\x20\x20vec3\x20i1\x20=\x20min(g.xyz,\x20l.zxy);\x0a\x20\x20vec3\x20i2\x20=\x20max(g.xyz,\x20l.zxy);\x0a\x0a\x20\x20vec3\x20x1\x20=\x20x0\x20-\x20i1\x20+\x20C.xxx;\x0a\x20\x20vec3\x20x2\x20=\x20x0\x20-\x20i2\x20+\x20C.yyy;\x20//\x202.0*C.x\x20=\x201/3\x20=\x20C.y\x0a\x20\x20vec3\x20x3\x20=\x20x0\x20-\x20D.yyy;\x20\x20\x20\x20\x20\x20//\x20-1.0+3.0*C.x\x20=\x20-0.5\x20=\x20-D.y\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x0a\x20\x20vec4\x20p\x20=\x20_czm_permute(_czm_permute(_czm_permute(i.z\x20+\x20vec4(0.0,\x20i1.z,\x20i2.z,\x201.0))\x20+\x20i.y\x20+\x20vec4(0.0,\x20i1.y,\x20i2.y,\x201.0))\x20+\x20i.x\x20+\x20vec4(0.0,\x20i1.x,\x20i2.x,\x201.0));\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x207x7\x20points\x20over\x20a\x20square,\x20mapped\x20onto\x20an\x20octahedron.\x0a\x20\x20\x20\x20//\x20The\x20ring\x20size\x2017*17\x20=\x20289\x20is\x20close\x20to\x20a\x20multiple\x20of\x2049\x20(49*6\x20=\x20294)\x0a\x20\x20float\x20n_\x20=\x200.142857142857;\x20//\x201.0/7.0\x0a\x20\x20vec3\x20ns\x20=\x20n_\x20*\x20D.wyz\x20-\x20D.xzx;\x0a\x0a\x20\x20vec4\x20j\x20=\x20p\x20-\x2049.0\x20*\x20floor(p\x20*\x20ns.z\x20*\x20ns.z);\x20\x20//\x20\x20mod(p,7*7)\x0a\x0a\x20\x20vec4\x20x_\x20=\x20floor(j\x20*\x20ns.z);\x0a\x20\x20vec4\x20y_\x20=\x20floor(j\x20-\x207.0\x20*\x20x_);\x20\x20\x20\x20//\x20mod(j,N)\x0a\x0a\x20\x20vec4\x20x\x20=\x20x_\x20*\x20ns.x\x20+\x20ns.yyyy;\x0a\x20\x20vec4\x20y\x20=\x20y_\x20*\x20ns.x\x20+\x20ns.yyyy;\x0a\x20\x20vec4\x20h\x20=\x201.0\x20-\x20abs(x)\x20-\x20abs(y);\x0a\x0a\x20\x20vec4\x20b0\x20=\x20vec4(x.xy,\x20y.xy);\x0a\x20\x20vec4\x20b1\x20=\x20vec4(x.zw,\x20y.zw);\x0a\x0a\x20\x20\x20\x20//vec4\x20s0\x20=\x20vec4(lessThan(b0,0.0))*2.0\x20-\x201.0;\x0a\x20\x20\x20\x20//vec4\x20s1\x20=\x20vec4(lessThan(b1,0.0))*2.0\x20-\x201.0;\x0a\x20\x20vec4\x20s0\x20=\x20floor(b0)\x20*\x202.0\x20+\x201.0;\x0a\x20\x20vec4\x20s1\x20=\x20floor(b1)\x20*\x202.0\x20+\x201.0;\x0a\x20\x20vec4\x20sh\x20=\x20-step(h,\x20vec4(0.0));\x0a\x0a\x20\x20vec4\x20a0\x20=\x20b0.xzyw\x20+\x20s0.xzyw\x20*\x20sh.xxyy;\x0a\x20\x20vec4\x20a1\x20=\x20b1.xzyw\x20+\x20s1.xzyw\x20*\x20sh.zzww;\x0a\x0a\x20\x20vec3\x20p0\x20=\x20vec3(a0.xy,\x20h.x);\x0a\x20\x20vec3\x20p1\x20=\x20vec3(a0.zw,\x20h.y);\x0a\x20\x20vec3\x20p2\x20=\x20vec3(a1.xy,\x20h.z);\x0a\x20\x20vec3\x20p3\x20=\x20vec3(a1.zw,\x20h.w);\x0a\x0a\x20\x20\x20\x20//Normalise\x20gradients\x0a\x20\x20vec4\x20norm\x20=\x20_czm_taylorInvSqrt(vec4(dot(p0,\x20p0),\x20dot(p1,\x20p1),\x20dot(p2,\x20p2),\x20dot(p3,\x20p3)));\x0a\x20\x20p0\x20*=\x20norm.x;\x0a\x20\x20p1\x20*=\x20norm.y;\x0a\x20\x20p2\x20*=\x20norm.z;\x0a\x20\x20p3\x20*=\x20norm.w;\x0a\x0a\x20\x20\x20\x20//\x20Mix\x20final\x20noise\x20value\x0a\x20\x20vec4\x20m\x20=\x20max(0.6\x20-\x20vec4(dot(x0,\x20x0),\x20dot(x1,\x20x1),\x20dot(x2,\x20x2),\x20dot(x3,\x20x3)),\x200.0);\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x20\x20return\x2042.0\x20*\x20dot(m\x20*\x20m,\x20vec4(dot(p0,\x20x0),\x20dot(p1,\x20x1),\x20dot(p2,\x20x2),\x20dot(p3,\x20x3)));\x0a}\x0a\x0afloat\x20czm_snoise(vec4\x20v)\x20{\x0a\x20\x20const\x20vec4\x20C\x20=\x20vec4(0.138196601125011,\x20\x20//\x20(5\x20-\x20sqrt(5))/20\x20\x20G4\x0a\x20\x200.276393202250021,\x20\x20//\x202\x20*\x20G4\x0a\x20\x200.414589803375032,\x20\x20//\x203\x20*\x20G4\x0a\x20\x20-0.447213595499958);\x20//\x20-1\x20+\x204\x20*\x20G4\x0a\x0a\x20\x20\x20\x20//\x20(sqrt(5)\x20-\x201)/4\x20=\x20F4,\x20used\x20once\x20below\x0a\x20\x20\x20\x20#define\x20F4\x200.309016994374947451\x0a\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec4\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20vec4(F4)));\x0a\x20\x20vec4\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xxxx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x0a\x20\x20\x20\x20//\x20Rank\x20sorting\x20originally\x20contributed\x20by\x20Bill\x20Licea-Kane,\x20AMD\x20(formerly\x20ATI)\x0a\x20\x20vec4\x20i0;\x0a\x20\x20vec3\x20isX\x20=\x20step(x0.yzw,\x20x0.xxx);\x0a\x20\x20vec3\x20isYZ\x20=\x20step(x0.zww,\x20x0.yyz);\x0a\x20\x20\x20\x20//\x20\x20i0.x\x20=\x20dot(\x20isX,\x20vec3(\x201.0\x20)\x20);\x0a\x20\x20i0.x\x20=\x20isX.x\x20+\x20isX.y\x20+\x20isX.z;\x0a\x20\x20i0.yzw\x20=\x201.0\x20-\x20isX;\x0a\x20\x20\x20\x20//\x20\x20i0.y\x20+=\x20dot(\x20isYZ.xy,\x20vec2(\x201.0\x20)\x20);\x0a\x20\x20i0.y\x20+=\x20isYZ.x\x20+\x20isYZ.y;\x0a\x20\x20i0.zw\x20+=\x201.0\x20-\x20isYZ.xy;\x0a\x20\x20i0.z\x20+=\x20isYZ.z;\x0a\x20\x20i0.w\x20+=\x201.0\x20-\x20isYZ.z;\x0a\x0a\x20\x20\x20\x20//\x20i0\x20now\x20contains\x20the\x20unique\x20values\x200,1,2,3\x20in\x20each\x20channel\x0a\x20\x20vec4\x20i3\x20=\x20clamp(i0,\x200.0,\x201.0);\x0a\x20\x20vec4\x20i2\x20=\x20clamp(i0\x20-\x201.0,\x200.0,\x201.0);\x0a\x20\x20vec4\x20i1\x20=\x20clamp(i0\x20-\x202.0,\x200.0,\x201.0);\x0a\x0a\x20\x20\x20\x20//\x20\x20x0\x20=\x20x0\x20-\x200.0\x20+\x200.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x1\x20=\x20x0\x20-\x20i1\x20\x20+\x201.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x2\x20=\x20x0\x20-\x20i2\x20\x20+\x202.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x3\x20=\x20x0\x20-\x20i3\x20\x20+\x203.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x4\x20=\x20x0\x20-\x201.0\x20+\x204.0\x20*\x20C.xxxx\x0a\x20\x20vec4\x20x1\x20=\x20x0\x20-\x20i1\x20+\x20C.xxxx;\x0a\x20\x20vec4\x20x2\x20=\x20x0\x20-\x20i2\x20+\x20C.yyyy;\x0a\x20\x20vec4\x20x3\x20=\x20x0\x20-\x20i3\x20+\x20C.zzzz;\x0a\x20\x20vec4\x20x4\x20=\x20x0\x20+\x20C.wwww;\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x0a\x20\x20float\x20j0\x20=\x20_czm_permute(_czm_permute(_czm_permute(_czm_permute(i.w)\x20+\x20i.z)\x20+\x20i.y)\x20+\x20i.x);\x0a\x20\x20vec4\x20j1\x20=\x20_czm_permute(_czm_permute(_czm_permute(_czm_permute(i.w\x20+\x20vec4(i1.w,\x20i2.w,\x20i3.w,\x201.0))\x20+\x20i.z\x20+\x20vec4(i1.z,\x20i2.z,\x20i3.z,\x201.0))\x20+\x20i.y\x20+\x20vec4(i1.y,\x20i2.y,\x20i3.y,\x201.0))\x20+\x20i.x\x20+\x20vec4(i1.x,\x20i2.x,\x20i3.x,\x201.0));\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x207x7x6\x20points\x20over\x20a\x20cube,\x20mapped\x20onto\x20a\x204-cross\x20polytope\x0a\x20\x20\x20\x20//\x207*7*6\x20=\x20294,\x20which\x20is\x20close\x20to\x20the\x20ring\x20size\x2017*17\x20=\x20289.\x0a\x20\x20vec4\x20ip\x20=\x20vec4(1.0\x20/\x20294.0,\x201.0\x20/\x2049.0,\x201.0\x20/\x207.0,\x200.0);\x0a\x0a\x20\x20vec4\x20p0\x20=\x20_czm_grad4(j0,\x20ip);\x0a\x20\x20vec4\x20p1\x20=\x20_czm_grad4(j1.x,\x20ip);\x0a\x20\x20vec4\x20p2\x20=\x20_czm_grad4(j1.y,\x20ip);\x0a\x20\x20vec4\x20p3\x20=\x20_czm_grad4(j1.z,\x20ip);\x0a\x20\x20vec4\x20p4\x20=\x20_czm_grad4(j1.w,\x20ip);\x0a\x0a\x20\x20\x20\x20//\x20Normalise\x20gradients\x0a\x20\x20vec4\x20norm\x20=\x20_czm_taylorInvSqrt(vec4(dot(p0,\x20p0),\x20dot(p1,\x20p1),\x20dot(p2,\x20p2),\x20dot(p3,\x20p3)));\x0a\x20\x20p0\x20*=\x20norm.x;\x0a\x20\x20p1\x20*=\x20norm.y;\x0a\x20\x20p2\x20*=\x20norm.z;\x0a\x20\x20p3\x20*=\x20norm.w;\x0a\x20\x20p4\x20*=\x20_czm_taylorInvSqrt(dot(p4,\x20p4));\x0a\x0a\x20\x20\x20\x20//\x20Mix\x20contributions\x20from\x20the\x20five\x20corners\x0a\x20\x20vec3\x20m0\x20=\x20max(0.6\x20-\x20vec3(dot(x0,\x20x0),\x20dot(x1,\x20x1),\x20dot(x2,\x20x2)),\x200.0);\x0a\x20\x20vec2\x20m1\x20=\x20max(0.6\x20-\x20vec2(dot(x3,\x20x3),\x20dot(x4,\x20x4)),\x200.0);\x0a\x20\x20m0\x20=\x20m0\x20*\x20m0;\x0a\x20\x20m1\x20=\x20m1\x20*\x20m1;\x0a\x20\x20return\x2049.0\x20*\x20(dot(m0\x20*\x20m0,\x20vec3(dot(p0,\x20x0),\x20dot(p1,\x20x1),\x20dot(p2,\x20x2)))\x20+\x20dot(m1\x20*\x20m1,\x20vec2(dot(p3,\x20x3),\x20dot(p4,\x20x4))));\x0a}\x0a',LineDotDashMaterial='uniform\x20vec4\x20color;\x0auniform\x20vec4\x20gapColor;\x0auniform\x20float\x20dashLength;\x0auniform\x20float\x20dashPattern;\x0ain\x20float\x20v_polylineAngle;\x0a\x0aconst\x20float\x20maskLength\x20=\x2016.0;\x0a\x0amat2\x20rotate(float\x20rad)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(rad);\x0a\x20\x20float\x20s\x20=\x20sin(rad);\x0a\x20\x20return\x20mat2(c,\x20s,\x20-s,\x20c);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20pos\x20=\x20rotate(v_polylineAngle)\x20*\x20gl_FragCoord.xy;\x0a\x0a\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x0a\x20\x20vec4\x20fragColor\x20=\x20(mod(maskTest,\x202.0)\x20<\x201.0)\x20?\x20gapColor\x20:\x20color;\x0a\x20\x20if(fragColor.a\x20<\x200.005)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition2\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x200.25\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex2\x20=\x20floor(dashPosition2\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest2\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex2));\x0a\x20\x20\x20\x20fragColor\x20=\x20(mod(maskTest2,\x202.0)\x20<\x201.0)\x20?\x20gapColor\x20:\x20color;\x0a\x20\x20\x20\x20if(fragColor.a\x20<\x200.005)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x20\x20material.emission\x20=\x20fragColor.rgb;\x0a\x20\x20material.alpha\x20=\x20fragColor.a;\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlowMaterial='uniform\x20float\x20globalAlpha;\x0auniform\x20bool\x20axisY;\x0auniform\x20bool\x20mixt;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20repeat\x20*\x20materialInput.st;\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(speed\x20!=\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20currTime;\x0a\x20\x20\x20\x20if(time\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20currTime\x20=\x20speed\x20*\x20czm_frameNumber\x20/\x201000.0;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20currTime\x20=\x20time;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract((axisY\x20?\x20st.t\x20:\x20st.s)\x20-\x20currTime),\x20st.t));\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20}\x0a\x0a\x20\x20if(color.a\x20==\x200.0)\x20{\x0a\x20\x20\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20if(color.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20if(mixt)\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20max(colorImage.rgb\x20*\x20color.rgb\x20*\x20material.alpha\x20*\x203.0,\x20colorImage.rgb\x20*\x20color.rgb);\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x203.0,\x20color.rgb);\x0a\x20\x20}\x0a\x0a\x20\x20if(hasImage2)\x20{\x0a\x20\x20\x20\x20vec4\x20colorBG\x20=\x20texture(image2,\x20materialInput.st);\x0a\x20\x20\x20\x20if(colorBG.a\x20>\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20color2.rgb;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlowColorMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20startTime;\x0auniform\x20float\x20percent;\x0auniform\x20float\x20alpha;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(startTime\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20t\x20*=\x20(1.0\x20+\x20percent);\x0a\x20\x20float\x20alpha1\x20=\x20smoothstep(t\x20-\x20percent,\x20t,\x20st.s)\x20*\x20step(-t,\x20-st.s);\x0a\x20\x20alpha1\x20+=\x20alpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20alpha1\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ODLineMaterial='uniform\x20vec4\x20color;\x0auniform\x20vec4\x20bgColor;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20startTime;\x0auniform\x20float\x20bidirectional;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(startTime\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20t\x20*=\x201.03;\x0a\x20\x20float\x20alpha0\x20=\x20smoothstep(t\x20-\x200.03,\x20t,\x20st.s)\x20*\x20step(st.s,\x20t);\x0a\x20\x20float\x20mt\x20=\x201.\x20-\x20t;\x0a\x20\x20float\x20alpha1\x20=\x20smoothstep(mt\x20+\x200.03,\x20mt,\x20st.s)\x20*\x20step(mt,\x20st.s);\x0a\x0a\x20\x20float\x20a0\x20=\x20step(abs(bidirectional\x20-\x200.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20a1\x20=\x20step(abs(bidirectional\x20-\x201.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20db\x20=\x20step(abs(bidirectional\x20-\x202.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20alpha\x20=\x20alpha0\x20*\x20(a0\x20+\x20db)\x20+\x20alpha1\x20*\x20(a1\x20+\x20db);\x0a\x20\x20alpha\x20=\x20clamp(alpha,\x200.,\x201.);\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20alpha\x20+\x20bgColor.rgb\x20*\x20(1.\x20-\x20alpha);\x0a\x20\x20material.alpha\x20=\x20(color.a\x20*\x20alpha\x20+\x20bgColor.a\x20*\x20(1.\x20-\x20alpha))\x20*\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20//\x20if\x20(useImageAndRepeat.x\x20!=\x200.)\x20{\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20float\x20repeat\x20=\x20useImageAndRepeat.y;\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20vec4\x20marsImageColor\x20=\x20texture(image,\x20fract(vec2(fract((st.s-t)*repeat),\x20st.t)));\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20material.diffuse\x20=\x20marsImageColor.rgb;\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20material.alpha\x20=\x20marsImageColor.a;\x0a\x20\x20\x20\x20//\x20}\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlickerMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20scalar\x20=\x20smoothstep(0.0,\x201.0,\x20time);\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20scalar;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20scalar\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',LineTrailMaterial=_0x35a251(0xf1a),LineBloomMaterial=_0x35a251(0xdf6),DigitalFlowMaterial=_0x35a251(0x3a5),LineThreeDashMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20dashLength;\x0auniform\x20float\x20dashPattern;\x0a\x0auniform\x20vec4\x20sidesColor;\x0auniform\x20float\x20sidesDashLength;\x0auniform\x20float\x20globalAlpha;\x0a\x0ain\x20float\x20v_polylineAngle;\x0a\x0aconst\x20float\x20maskLength\x20=\x2016.0;\x0a\x0amat2\x20rotate(float\x20rad)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(rad);\x0a\x20\x20float\x20s\x20=\x20sin(rad);\x0a\x20\x20return\x20mat2(c,\x20s,\x20-s,\x20c);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20pos\x20=\x20rotate(v_polylineAngle)\x20*\x20gl_FragCoord.xy;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x0a\x20\x20float\x20centerGlow\x20=\x20widthRatio\x20/\x20abs(st.t\x20-\x200.5)\x20-\x20(widthRatio\x20/\x200.5)\x20-\x201.0;\x0a\x20\x20if(centerGlow\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x20\x20\x20\x20if((mod(maskTest,\x202.0)\x20<\x201.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20material.emission\x20=\x20color.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20color.a;\x0a\x20\x20\x20\x20return\x20material;\x0a\x20\x20}\x0a\x0a\x20\x20float\x20sidesGlow\x20=\x20(1.0\x20-\x20sidesWidthRatio)\x20/\x20abs(st.t\x20-\x200.5)\x20-\x20((1.0\x20-\x20sidesWidthRatio)\x20/\x200.5)\x20-\x201.0;\x0a\x20\x20if(sidesGlow\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(sidesDashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x20\x20\x20\x20if((mod(maskTest,\x202.0)\x20<\x201.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20material.emission\x20=\x20sidesColor.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20sidesColor.a*\x20globalAlpha;\x0a\x20\x20\x20\x20return\x20material;\x0a\x20\x20}\x0a\x0a\x20\x20discard;\x0a}\x0a',WallScrollMaterial=_0x35a251(0x3d5),ScanLineMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20globalAlpha;\x0a\x0afloat\x20circle(vec2\x20uv,\x20float\x20r,\x20float\x20blur)\x20{\x0a\x20\x20float\x20d\x20=\x20length(uv)\x20*\x202.0;\x0a\x20\x20float\x20c\x20=\x20smoothstep(r\x20+\x20blur,\x20r,\x20d);\x0a\x20\x20return\x20c;\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st\x20-\x20.5;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.emission\x20=\x20vec3(0);\x0a\x0a\x20\x20float\x20t\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20float\x20s\x20=\x200.3;\x0a\x20\x20float\x20radius1\x20=\x20smoothstep(.0,\x20s,\x20t)\x20*\x200.9;\x0a\x20\x20float\x20alpha1\x20=\x20circle(st,\x20radius1,\x200.01)\x20*\x20circle(st,\x20radius1,\x20-0.01);\x0a\x20\x20float\x20alpha2\x20=\x20circle(st,\x20radius1,\x200.01\x20-\x20radius1)\x20*\x20circle(st,\x20radius1,\x200.01);\x0a\x20\x20float\x20radius2\x20=\x200.5\x20+\x20smoothstep(s,\x201.0,\x20t)\x20*\x200.5;\x0a\x20\x20float\x20alpha3\x20=\x20circle(st,\x20radius1,\x20radius2\x20+\x200.01\x20-\x20radius1)\x20*\x20circle(st,\x20radius1,\x20-0.01);\x0a\x0a\x20\x20material.alpha\x20=\x20smoothstep(1.0,\x20s,\x20t)\x20*\x20(alpha1\x20+\x20alpha2\x20*\x200.1\x20+\x20alpha3\x20*\x200.1);\x0a\x20\x20material.alpha\x20*=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',CircleScanMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20imgC\x20=\x20texture(image,\x20st);\x0a\x20\x20if(imgC.a\x20>\x20.0)\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20imgC.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',CircleWaveMaterial='uniform\x20float\x20globalAlpha;\x0auniform\x20vec4\x20color;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.diffuse\x20=\x201.5\x20*\x20color.rgb;\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20dis\x20=\x20distance(st,\x20vec2(0.5,\x200.5));\x0a\x20\x20float\x20currTime;\x0a\x20\x20if(time\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20currTime\x20=\x20speed\x20*\x20czm_frameNumber\x20/\x201000.0;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20currTime\x20=\x20time;\x0a\x20\x20}\x0a\x0a\x20\x20float\x20per\x20=\x20fract(currTime);\x0a\x20\x20if(count\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20if(dis\x20>\x20per\x20*\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20color.a\x20*\x20dis\x20/\x20per\x20/\x202.0\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20vec3\x20str\x20=\x20materialInput.str;\x0a\x20\x20\x20\x20if(abs(str.z)\x20>\x200.001)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(dis\x20>\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20float\x20perDis\x20=\x200.5\x20/\x20count;\x0a\x20\x20\x20\x20\x20\x20float\x20disNum;\x0a\x20\x20\x20\x20\x20\x20float\x20bl\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20for(float\x20i\x20=\x200.0;\x20i\x20<=\x2099.0;\x20i+=1.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(i\x20<=\x20count)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20disNum\x20=\x20perDis\x20*\x20i\x20-\x20dis\x20+\x20per\x20/\x20count;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(disNum\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(disNum\x20<\x20perDis)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bl\x20=\x201.0\x20-\x20disNum\x20/\x20perDis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if(disNum\x20-\x20perDis\x20<\x20perDis)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bl\x20=\x201.0\x20-\x20abs(1.0\x20-\x20disNum\x20/\x20perDis);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20pow(bl,\x20(1.0\x20+\x2010.0\x20*\x20(1.0\x20-\x20gradient)))\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',RadarLineMaterial=_0x35a251(0x9c9),RadarWaveMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0a#define\x20PI\x203.14159265359\x0a\x0afloat\x20rand(vec2\x20co)\x20{\x0a\x20\x20return\x20fract(sin(dot(co.xy,\x20vec2(12.9898,\x2078.233)))\x20*\x2043758.5453);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20pos\x20=\x20st\x20-\x20vec2(0.5);\x0a\x20\x20float\x20time\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0;\x0a\x20\x20float\x20r\x20=\x20length(pos);\x0a\x20\x20float\x20t\x20=\x20atan(pos.y,\x20pos.x)\x20-\x20time\x20*\x202.5;\x0a\x20\x20float\x20a\x20=\x20(atan(sin(t),\x20cos(t))\x20+\x20PI)\x20/\x20(2.0\x20*\x20PI);\x0a\x20\x20float\x20ta\x20=\x200.5;\x0a\x20\x20float\x20v\x20=\x20smoothstep(ta\x20-\x200.05,\x20ta\x20+\x200.05,\x20a)\x20*\x20smoothstep(ta\x20+\x200.05,\x20ta\x20-\x200.05,\x20a);\x0a\x20\x20vec3\x20flagColor\x20=\x20color.rgb\x20*\x20v;\x0a\x20\x20float\x20blink\x20=\x20pow(sin(time\x20*\x201.5)\x20*\x200.5\x20+\x200.5,\x200.8);\x0a\x20\x20flagColor\x20=\x20color.rgb\x20*\x20pow(a,\x208.0\x20*\x20(.2\x20+\x20blink))\x20*\x20(sin(r\x20*\x20500.0)\x20*\x20.5\x20+\x20.5);\x0a\x20\x20flagColor\x20=\x20flagColor\x20*\x20pow(r,\x200.4);\x0a\x20\x20material.alpha\x20=\x20length(flagColor)\x20*\x201.3\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20flagColor\x20*\x203.0;\x0a\x20\x20return\x20material;\x0a}\x0a',RectSlideMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0),\x20fract(st.t)));\x0a\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20if(pure)\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20diffusePower\x20*\x20color.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',EllipsoidElectricMaterial='precision\x20highp\x20float;\x0aprecision\x20highp\x20int;\x0a\x0a#define\x20pi\x203.1415926535\x0a#define\x20PI2RAD\x200.01745329252\x0a#define\x20TWO_PI\x20(2.\x20*\x20PI)\x0a\x0auniform\x20vec4\x20marscolor;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0afloat\x20time;\x0afloat\x20rands(float\x20p)\x20{\x0a\x20\x20return\x20fract(sin(p)\x20*\x2010000.0);\x0a}\x0afloat\x20noise(vec2\x20p)\x20{\x0a\x20\x20float\x20t\x20=\x20time\x20/\x2020000.0;\x0a\x20\x20if(t\x20>\x201.0)\x0a\x20\x20\x20\x20t\x20-=\x20floor(t);\x0a\x20\x20return\x20rands(p.x\x20*\x2014.\x20+\x20p.y\x20*\x20sin(t)\x20*\x200.5);\x0a}\x0avec2\x20sw(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(floor(p.x),\x20floor(p.y));\x0a}\x0avec2\x20se(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(ceil(p.x),\x20floor(p.y));\x0a}\x0avec2\x20nw(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(floor(p.x),\x20ceil(p.y));\x0a}\x0avec2\x20ne(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(ceil(p.x),\x20ceil(p.y));\x0a}\x0afloat\x20smoothNoise(vec2\x20p)\x20{\x0a\x20\x20vec2\x20inter\x20=\x20smoothstep(0.0,\x201.0,\x20fract(p));\x0a\x20\x20float\x20s\x20=\x20mix(noise(sw(p)),\x20noise(se(p)),\x20inter.x);\x0a\x20\x20float\x20n\x20=\x20mix(noise(nw(p)),\x20noise(ne(p)),\x20inter.x);\x0a\x20\x20return\x20mix(s,\x20n,\x20inter.y);\x0a}\x0afloat\x20fbm(vec2\x20p)\x20{\x0a\x20\x20float\x20z\x20=\x202.0;\x0a\x20\x20float\x20rz\x20=\x200.0;\x0a\x20\x20vec2\x20bp\x20=\x20p;\x0a\x20\x20for(float\x20i\x20=\x201.0;\x20i\x20<\x206.0;\x20i++)\x20{\x0a\x20\x20\x20\x20rz\x20+=\x20abs((smoothNoise(p)\x20-\x200.5)\x20*\x202.0)\x20/\x20z;\x0a\x20\x20\x20\x20z\x20*=\x202.0;\x0a\x20\x20\x20\x20p\x20*=\x202.0;\x0a\x20\x20}\x0a\x20\x20return\x20rz;\x0a}\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20time\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x20100.0;\x0a\x0a\x20\x20vec2\x20uv\x20=\x20vUv;\x0a\x20\x20vec2\x20uv2\x20=\x20vUv;\x0a\x20\x20//\x20if\x20(uv.y\x20<\x200.5)\x20{\x0a\x20\x20//\x20\x20\x20\x20\x20discard;\x0a\x20\x20//\x20}\x0a\x20\x20uv\x20*=\x204.;\x0a\x20\x20float\x20rz\x20=\x20fbm(uv);\x0a\x20\x20uv\x20/=\x20exp(mod(time\x20*\x202.0,\x20pi));\x0a\x20\x20rz\x20*=\x20pow(15.,\x201.0);\x0a\x20\x20vec4\x20marscolor\x20=\x20mix(vec4(color.rgb,\x201.0)\x20/\x20rz,\x20vec4(color.rgb,\x200.1),\x200.5);\x0a\x20\x20if(uv2.x\x20<\x200.05)\x20{\x0a\x20\x20\x20\x20marscolor\x20=\x20mix(vec4(color.rgb,\x200.1),\x20marscolor,\x20uv2.x\x20/\x200.05);\x0a\x20\x20}\x0a\x20\x20if(uv2.x\x20>\x200.95)\x20{\x0a\x20\x20\x20\x20marscolor\x20=\x20mix(marscolor,\x20vec4(color.rgb,\x200.1),\x20(uv2.x\x20-\x200.95)\x20/\x200.05);\x0a\x20\x20}\x0a\x0a\x20\x20material.alpha\x20=\x20marscolor.a\x20*\x202.0\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20max(marscolor.rgb\x20+\x20marscolor.rgb\x20*\x20material.alpha,\x20marscolor.rgb);\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',EllipsoidWaveMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20float\x20alpha\x20=\x20abs(smoothstep(0.5,\x201.,\x20fract(-st.t\x20-\x20time)));\x0a\x20\x20alpha\x20+=\x20.1;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a',PolyGradientMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20diffusePower;\x0auniform\x20float\x20alphaPower;\x0auniform\x20float\x20globalAlpha;\x0auniform\x20vec2\x20center;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20alpha\x20=\x20distance(st,\x20center);\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20alpha\x20*\x20alphaPower\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20diffusePower;\x0a\x20\x20return\x20material;\x0a}\x0a',AsphaltMaterial=_0x35a251(0xbc1),BlobMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(materialInput.st\x20*\x20frequency);\x0a\x20\x20float\x20t\x20=\x201.0\x20-\x20F.x\x20*\x20F.x;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20t);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',FacetMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(materialInput.st\x20*\x20frequency);\x0a\x20\x20float\x20t\x20=\x200.1\x20+\x20(F.y\x20-\x20F.x);\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20t);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',PolyGrassMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20noise1\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x201.0))\x20*\x201.0;\x0a\x20\x20float\x20noise2\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x202.0))\x20*\x200.5;\x0a\x20\x20float\x20noise3\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x204.0))\x20*\x200.25;\x0a\x20\x20float\x20noise\x20=\x20sin(noise1\x20+\x20noise2\x20+\x20noise3)\x20*\x200.1;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20noise);\x0a\x0a\x20\x20//Make\x20thatch\x20patterns\x0a\x20\x20float\x20verticalNoise\x20=\x20czm_snoise(vec2(st.x\x20*\x20100.0,\x20st.y\x20*\x2020.0))\x20*\x200.02;\x0a\x20\x20float\x20horizontalNoise\x20=\x20czm_snoise(vec2(st.x\x20*\x2020.0,\x20st.y\x20*\x20100.0))\x20*\x200.02;\x0a\x20\x20float\x20stripeNoise\x20=\x20min(verticalNoise,\x20horizontalNoise);\x0a\x0a\x20\x20color.rgb\x20+=\x20stripeNoise;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',PolyWoodMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20vec2\x20noiseScale;\x0auniform\x20float\x20grainFrequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//Based\x20on\x20wood\x20shader\x20from\x20OpenGL\x20Shading\x20Language\x20(3rd\x20edition)\x20pg.\x20455\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x0a\x20\x20vec2\x20noisevec;\x0a\x20\x20noisevec.x\x20=\x20czm_snoise(st\x20*\x20noiseScale.x);\x0a\x20\x20noisevec.y\x20=\x20czm_snoise(st\x20*\x20noiseScale.y);\x0a\x0a\x20\x20vec2\x20location\x20=\x20st\x20+\x20noisevec;\x0a\x20\x20float\x20dist\x20=\x20sqrt(location.x\x20*\x20location.x\x20+\x20location.y\x20*\x20location.y);\x0a\x20\x20dist\x20*=\x20frequency;\x0a\x0a\x20\x20float\x20r\x20=\x20fract(dist\x20+\x20noisevec[0]\x20+\x20noisevec[1])\x20*\x202.0;\x0a\x20\x20if(r\x20>\x201.0)\x0a\x20\x20\x20\x20r\x20=\x202.0\x20-\x20r;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20r);\x0a\x0a\x20\x20//streaks\x0a\x20\x20r\x20=\x20abs(czm_snoise(vec2(st.x\x20*\x20grainFrequency,\x20st.y\x20*\x20grainFrequency\x20*\x200.02)))\x20*\x200.2;\x0a\x20\x20color.rgb\x20+=\x20evenColor.rgb\x20*\x20r;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',ImageMaterial='uniform\x20sampler2D\x20image;\x0auniform\x20float\x20opacity;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20globalAlpha;\x0auniform\x20bool\x20flipx;\x0auniform\x20bool\x20flipy;\x0auniform\x20bool\x20noWhite;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20if(flipx){\x0a\x20\x20\x20\x20st.x\x20=\x20st.x\x20+\x20(0.5\x20-\x20st.x)\x20*\x202.0;\x0a\x20\x20}\x0a\x20\x20if(flipy){\x0a\x20\x20\x20\x20st.y\x20=\x20st.y\x20+\x20(0.5\x20-\x20st.y)\x20*\x202.0;\x0a\x20\x20}\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(speed\x20!=\x200.0)\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0),\x20fract(st.t)));\x0a\x20\x20else\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x0a\x20\x20if(noWhite\x20&&\x20colorImage.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20opacity\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb\x20*\x20color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a',WaterLightMaterial='uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20time\x20=\x200.0;\x0amat2\x20m2\x20=\x20mat2(0.80,\x200.60,\x20-0.60,\x200.80);\x0a\x0amat2\x20mars3d_makem(in\x20float\x20theta)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(theta);\x0a\x20\x20float\x20s\x20=\x20sin(theta);\x0a\x20\x20return\x20mat2(c,\x20-s,\x20s,\x20c);\x0a}\x0a\x0afloat\x20noise(in\x20vec2\x20x)\x20{\x0a\x20\x20return\x20texture(specularMap,\x20x\x20*\x20.01).x;\x0a}\x0a\x0afloat\x20mars3d_fbm(in\x20vec2\x20p)\x20{\x0a\x20\x20float\x20z\x20=\x202.;\x0a\x20\x20float\x20rz\x20=\x200.;\x0a\x20\x20for(float\x20i\x20=\x201.;\x20i\x20<\x207.;\x20i++)\x20{\x0a\x20\x20\x20\x20rz\x20+=\x20abs((noise(p)\x20-\x200.5)\x20*\x202.)\x20/\x20z;\x0a\x20\x20\x20\x20z\x20=\x20z\x20*\x202.;\x0a\x20\x20\x20\x20p\x20=\x20p\x20*\x202.;\x0a\x20\x20\x20\x20p\x20*=\x20m2;\x0a\x20\x20}\x0a\x20\x20return\x20rz;\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20time\x20=\x20czm_frameNumber\x20/\x20200.0;\x0a\x20\x20vec2\x20p\x20=\x202.\x20*\x20vUv.xy\x20-\x20vec2(1.,\x201.);\x0a\x20\x20vec2\x20bp\x20=\x20p;\x0a\x0a\x20\x20#ifndef\x20CENTERED\x0a\x20\x20p\x20+=\x205.;\x0a\x20\x20p\x20*=\x2030.;\x0a\x20\x20#endif\x0a\x20\x20float\x20rb\x20=\x20mars3d_fbm(p\x20*\x20.5\x20+\x20time\x20*\x20.17)\x20*\x20.1;\x0a\x20\x20rb\x20=\x20sqrt(rb);\x0a\x20\x20#ifndef\x20CENTERED\x0a\x20\x20p\x20*=\x20mars3d_makem(rb\x20*\x20.2\x20+\x20atan(p.y,\x20p.x)\x20*\x201.);\x0a\x20\x20#else\x0a\x20\x20p\x20*=\x20mars3d_makem(rb\x20*\x20.2\x20+\x20atan(p.y,\x20p.x)\x20*\x202.);\x0a\x20\x20#endif\x0a\x0a\x20\x20\x20\x20//coloring\x0a\x20\x20float\x20rz\x20=\x20mars3d_fbm(p\x20*\x20.9\x20-\x20time\x20*\x20.7);\x0a\x20\x20rz\x20*=\x20dot(bp\x20*\x205.,\x20bp)\x20+\x20.5;\x0a\x20\x20rz\x20*=\x20sin(p.x\x20*\x20.5\x20+\x20time\x20*\x204.)\x20*\x201.5;\x0a\x20\x20vec3\x20col\x20=\x20vec3(.04,\x200.07,\x200.45)\x20/\x20(.1\x20-\x20rz);\x0a\x20\x20vec4\x20fragColor\x20=\x20vec4(sqrt(abs(col)),\x201.0);\x0a\x20\x20material.alpha\x20=\x20fragColor.a\x20*\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20fragColor.rgb\x20*\x20.5;\x0a\x0a\x20\x20\x20\x20//\x20cesium\x0a\x20\x20float\x20frequency\x20=\x202000.0;\x0a\x20\x20float\x20amplitude\x20=\x2010.0;\x0a\x20\x20float\x20fadeFactor\x20=\x201.0;\x0a\x20\x20vec4\x20mapColor\x20=\x20texture(normalMap,\x20materialInput.st);\x0a\x20\x20float\x20specularMapValue\x20=\x20texture(normalMap,\x20materialInput.st).r;\x0a\x20\x20specularMapValue\x20=\x201.0;\x0a\x0a\x20\x20float\x20fade\x20=\x20max(1.0,\x20(length(materialInput.positionToEyeEC)\x20/\x2010000000000.0)\x20*\x20frequency\x20*\x20fadeFactor);\x0a\x20\x20vec4\x20noise\x20=\x20czm_getWaterNoise(normalMap,\x20materialInput.st\x20*\x20frequency,\x20time,\x200.0);\x0a\x20\x20vec3\x20normalTangentSpace\x20=\x20noise.xyz\x20*\x20vec3(1.0,\x201.0,\x20(1.0\x20/\x20amplitude));\x0a\x20\x20normalTangentSpace.xy\x20/=\x20fade;\x0a\x20\x20normalTangentSpace\x20=\x20mix(vec3(0.0,\x200.0,\x2050.0),\x20normalTangentSpace,\x20specularMapValue);\x0a\x20\x20normalTangentSpace\x20=\x20normalize(normalTangentSpace);\x0a\x0a\x20\x20float\x20mars3dPerturbationRatio\x20=\x20clamp(dot(normalTangentSpace,\x20vec3(0.0,\x200.0,\x200.1)),\x200.0,\x201.0);\x0a\x20\x20material.diffuse\x20+=\x20(0.1\x20*\x20mars3dPerturbationRatio);\x0a\x20\x20material.normal\x20=\x20normalize(materialInput.tangentToEyeMatrix\x20*\x20normalTangentSpace);\x0a\x20\x20material.specular\x20=\x200.5;\x0a\x20\x20material.shininess\x20=\x2010.0;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',NeonLightMaterial='uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20marsstepping(float\x20t)\x20{\x0a\x20\x20if(t\x20<\x200.)\x0a\x20\x20\x20\x20return\x20-1.\x20+\x20pow(1.\x20+\x20t,\x202.);\x0a\x20\x20else\x0a\x20\x20\x20\x20return\x201.\x20-\x20pow(1.\x20-\x20t,\x202.);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20uv\x20=\x202.\x20*\x20vUv.xy\x20-\x20vec2(1.,\x201.);\x0a\x0a\x20\x20uv\x20*=\x202.0;\x0a\x20\x20vec4\x20fragColor\x20=\x20vec4(0.);\x0a\x20\x20uv\x20=\x20normalize(uv)\x20*\x20length(uv);\x0a\x0a\x20\x20float\x20time\x20=\x20czm_frameNumber\x20/\x20speed;\x0a\x20\x20for(float\x20i\x20=\x200.0;\x20i\x20<\x2012.0;\x20i+=1.0)\x20{\x0a\x20\x20\x20\x20float\x20t\x20=\x20time\x20+\x20i\x20*\x203.141592\x20/\x2012.\x20*\x20(5.\x20+\x201.\x20*\x20marsstepping(sin(time\x20*\x203.)));\x0a\x20\x20\x20\x20vec2\x20p\x20=\x20vec2(cos(t),\x20sin(t));\x0a\x20\x20\x20\x20p\x20*=\x20cos(time\x20+\x20i\x20*\x203.141592\x20*\x20cos(time\x20/\x208.));\x0a\x20\x20\x20\x20vec3\x20col\x20=\x20cos(vec3(0,\x201,\x20-1)\x20*\x203.141592\x20*\x202.\x20/\x203.\x20+\x203.141925\x20*\x20(time\x20/\x202.\x20+\x20i\x20/\x205.))\x20*\x200.5\x20+\x200.5;\x0a\x20\x20\x20\x20fragColor\x20+=\x20vec4(0.05\x20/\x20length(uv\x20-\x20p\x20*\x200.9)\x20*\x20col,\x201.0);\x0a\x20\x20}\x0a\x20\x20fragColor.xyz\x20=\x20pow(fragColor.xyz,\x20vec3(3.));\x0a\x20\x20fragColor.w\x20=\x201.0;\x0a\x0a\x20\x20vec4\x20baseColor\x20=\x20vec4(fragColor.rgb\x20+\x20color.rgb\x20*\x202.0,\x20fragColor.r\x20*\x200.2);\x0a\x20\x20material.alpha\x20=\x20baseColor.a\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20baseColor.rgb;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a';Cesium__namespace[_0x35a251(0xb60)][_0x35a251(0x784)]['czm_cellular']=czm_cellular,Cesium__namespace['ShaderSource']['_czmBuiltinsAndUniforms']['czm_snoise']=czm_snoise,register$3(LineDotDash,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x1,0x1),'gapColor':new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),'dashLength':0x10,'dashPattern':0xff},'source':LineDotDashMaterial},'translucent':!![]}),register$3(LineFlow,{'fabric':{'uniforms':{'image':Cesium__namespace['Material']['DefaultImageId'],'color':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x1,0x0),'repeat':new Cesium__namespace[(_0x35a251(0x248))](0x1,0x1),'axisY':![],'mixt':![],'speed':0xa,'time':-0x1,'hasImage2':![],'image2':Cesium__namespace['Material']['DefaultImageId'],'color2':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x1),'globalAlpha':0x1},'source':LineFlowMaterial},'translucent':!![]}),register$3(LineFlowColor,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0.7),'startTime':0x0,'speed':0x2,'percent':0.04,'alpha':0.1,'globalAlpha':0x1},'source':LineFlowColorMaterial},'translucent':!![]}),register$3(ODLine,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x0,0.7),'startTime':0x0,'speed':0x14,'bgColor':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x0,0.1),'bidirectional':0x0,'globalAlpha':0x1},'source':ODLineMaterial},'translucent':!![]}),register$3(LineFlicker,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0.7),'speed':0xa,'globalAlpha':0x1},'source':LineFlickerMaterial},'translucent':!![]}),register$3(LineTrail,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0.7),'bgColor':new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),'speed':0x5,'globalAlpha':0x1},'source':LineTrailMaterial},'translucent':!![]}),register$3(LineBloom,{'fabric':{'uniforms':{'color':Cesium__namespace['Color']['ORANGE'],'glow':0x1,'speed':0x5,'globalAlpha':0x1},'source':LineBloomMaterial},'translucent':!![]}),register$3(DigitalFlow,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x35a251(0xf29))](0x0,0x0,0x0,0.8),'image':Cesium__namespace['Material']['DefaultImageId'],'speed':0xa,'glow':0xa,'flowGlow':0x1,'segment':0x3,'globalAlpha':0x1},'source':DigitalFlowMaterial},'translucent':!![]}),register$3(LineThreeDash,{'fabric':{'uniforms':{'color':Cesium__namespace[_0x35a251(0xf29)]['RED'],'dashLength':0x40,'widthRatio':0.1,'sidesColor':Cesium__namespace['Color']['WHITE'],'sidesDashLength':0x20,'sidesWidthRatio':0.1,'dashPattern':0xff,'globalAlpha':0x1},'source':LineThreeDashMaterial},'translucent':!![]}),register$3(WallScroll,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x0,0x0,0x1),'image':Cesium__namespace[_0x35a251(0x100)][_0x35a251(0x891)],'count':0x1,'speed':0x5,'reverse':![],'axisY':![],'bloom':![],'globalAlpha':0x1},'source':WallScrollMaterial},'translucent':!![]}),register$3(ScanLine,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x0,0x1),'speed':0xa,'globalAlpha':0x1},'source':ScanLineMaterial},'translucent':!![]}),register$3(CircleScan,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0x1),'image':Cesium__namespace['Material']['DefaultImageId'],'globalAlpha':0x1},'source':CircleScanMaterial},'translucent':!![]}),register$3(CircleWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'speed':0xa,'time':-0x1,'count':0x1,'gradient':0.1,'globalAlpha':0x1},'source':CircleWaveMaterial},'translucent':!![]}),register$3(RadarLine,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x35a251(0xf29))](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':RadarLineMaterial},'translucent':!![]}),register$3(RadarWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':RadarWaveMaterial},'translucent':!![]}),register$3(RectSlide,{'fabric':{'uniforms':{'image':Cesium__namespace['Material']['DefaultImageId'],'color':Cesium__namespace['Color']['WHITE'],'speed':0xa,'pure':![],'diffusePower':1.3,'globalAlpha':0x1},'source':RectSlideMaterial},'translucent':!![]}),register$3(EllipsoidElectric,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':EllipsoidElectricMaterial},'translucent':!![]}),register$3(EllipsoidWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':EllipsoidWaveMaterial},'translucent':!![]}),register$3(PolyGradient,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x0,0.5),'diffusePower':1.6,'alphaPower':1.5,'center':new Cesium__namespace['Cartesian2'](0.5,0.5),'globalAlpha':0x1},'source':PolyGradientMaterial},'translucent':!![]}),register$3(PolyAsphalt,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0.15,0.15,0.15,0x1),'size':0.02,'frequency':0.2,'globalAlpha':0x1},'source':AsphaltMaterial},'translucent':function(_0x272911){const _0x32fedb={_0x32562d:0x1f4},_0x51ecdc=_0x35a251;return _0x272911['uniforms']['color'][_0x51ecdc(_0x32fedb._0x32562d)]<0x1;}}),register$3(PolyBlob,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace[(_0x35a251(0xf29))](0x1,0x1,0x1,0.5),'oddColor':new Cesium__namespace[(_0x35a251(0xf29))](0x0,0x0,0x1,0.5),'frequency':0xa,'globalAlpha':0x1},'source':BlobMaterial},'translucent':function(_0x5cf29c){const _0xa4a2ed=_0x35a251,_0x3f610b=_0x5cf29c['uniforms'];return _0x3f610b['evenColor']['alpha']<0x1||_0x3f610b[_0xa4a2ed(0x164)][_0xa4a2ed(0x1f4)]<0x0;}}),register$3(PolyFacet,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.25,0.25,0.25,0.75),'oddColor':new Cesium__namespace[(_0x35a251(0xf29))](0.75,0.75,0.75,0.75),'frequency':0xa,'globalAlpha':0x1},'source':FacetMaterial},'translucent':function(_0x567419){const _0x3825f9=_0x35a251,_0x4eb51e=_0x567419['uniforms'];return _0x4eb51e['evenColor'][_0x3825f9(0x1f4)]<0x1||_0x4eb51e[_0x3825f9(0x164)]['alpha']<0x0;}}),register$3(PolyGrass,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.25,0.4,0.1,0x1),'oddColor':new Cesium__namespace['Color'](0.1,0.1,0.1,0x1),'frequency':1.5,'globalAlpha':0x1},'source':PolyGrassMaterial},'translucent':function(_0x28498d){const _0x179cde={_0x294d87:0x1f4},_0x344c0a=_0x35a251,_0x5661f2=_0x28498d['uniforms'];return _0x5661f2['evenColor']['alpha']<0x1||_0x5661f2['oddColor'][_0x344c0a(_0x179cde._0x294d87)]<0x1;}}),register$3(PolyWood,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.6,0.3,0.1,0x1),'oddColor':new Cesium__namespace[(_0x35a251(0xf29))](0.4,0.2,0.07,0x1),'frequency':0x3,'noiseScale':new Cesium__namespace['Cartesian2'](0.7,0.5),'grainFrequency':0x1b,'globalAlpha':0x1},'source':PolyWoodMaterial},'translucent':function(_0x4c2227){const _0x1fe861={_0x9b13df:0x90c,_0x24d1b5:0x164},_0x289152=_0x35a251,_0xef9ae7=_0x4c2227['uniforms'];return _0xef9ae7[_0x289152(_0x1fe861._0x9b13df)]['alpha']<0x1||_0xef9ae7[_0x289152(_0x1fe861._0x24d1b5)]['alpha']<0x1;}}),register$3(Image2,{'fabric':{'uniforms':{'image':Cesium__namespace['Material'][_0x35a251(0x891)],'color':Cesium__namespace['Color']['WHITE'],'opacity':0x1,'speed':0x0,'flipx':![],'flipy':![],'noWhite':!![],'globalAlpha':0x1},'source':ImageMaterial},'translucent':!![]}),register$3(WaterLight,{'fabric':{'uniforms':{'alpha':0.3,'specularMap':Cesium__namespace['Material']['DefaultImageId'],'normalMap':Cesium__namespace['buildModuleUrl']('Assets/Textures/waterNormals.jpg'),'globalAlpha':0x1},'source':WaterLightMaterial},'translucent':!![]}),register$3(NeonLight,{'fabric':{'uniforms':{'color':Cesium__namespace['Color'][_0x35a251(0x9a2)],'speed':0x1,'globalAlpha':0x1},'source':NeonLightMaterial},'translucent':!![]}),registerPropertyClass(Color$2,Cesium__namespace['ColorMaterialProperty']),registerPropertyClass(Image$1,Cesium__namespace['ImageMaterialProperty']),registerPropertyClass(PolylineArrow,Cesium__namespace['PolylineArrowMaterialProperty']),registerPropertyClass(PolylineOutline,Cesium__namespace['PolylineOutlineMaterialProperty']),registerPropertyClass(PolylineDash,Cesium__namespace[_0x35a251(0x157)]),registerPropertyClass(PolylineGlow,Cesium__namespace[_0x35a251(0x94c)]),registerPropertyClass(Grid,Cesium__namespace[_0x35a251(0x5ce)]),registerPropertyClass(Checkerboard,Cesium__namespace['CheckerboardMaterialProperty']),registerPropertyClass(Stripe,Cesium__namespace['StripeMaterialProperty']);class TextMaterial extends Cesium__namespace[_0x35a251(0x100)]{constructor(_0x10dd28={}){super(conventOptions$1(_0x10dd28));}}function conventOptions$1(_0xfe2cee){const _0x3e44dc={_0x3e1a47:0x6a2},_0x2e254f=_0x35a251,_0x1e0a54=_0xfe2cee['text'];_0xfe2cee['font_size']=_0xfe2cee['font_size']||0x46;const _0x31beaf=LabelStyleConver['toCesiumVal'](_0xfe2cee,{'fill':!![],'fillColor':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'textBaseline':_0x2e254f(0xf61),'padding':0xa}),_0x48b66e=getTextImage(_0x1e0a54,_0x31beaf);let _0x3a36ef;return _0x48b66e&&(_0x3a36ef=_0x48b66e['toDataURL']('image/png')),{'fabric':{'uniforms':{'image':_0x3a36ef,'opacity':0x1,'color':Cesium__namespace['Color']['WHITE'],'speed':_0xfe2cee[_0x2e254f(_0x3e44dc._0x3e1a47)]||0x0,'flipx':![],'flipy':![],'noWhite':!![],'globalAlpha':0x1},'source':ImageMaterial},'translucent':!![]};}registerClass(Text,TextMaterial);var CylinderWaveMaterialGlsl='uniform\x20vec4\x20color;\x0auniform\x20float\x20repeat;\x0auniform\x20float\x20offset;\x0auniform\x20float\x20thickness;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20float\x20sp\x20=\x201.0\x20/\x20repeat;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20dis\x20=\x20distance(st,\x20vec2(0.5));\x0a\x20\x20float\x20m\x20=\x20mod(dis\x20+\x20offset,\x20sp);\x0a\x20\x20float\x20a\x20=\x20step(sp\x20*\x20(1.0\x20-\x20thickness),\x20m);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a';class CylinderWaveMaterial extends Cesium__namespace[_0x35a251(0x100)]{constructor(_0x4db82a={}){const _0x398bc2={_0x2defa1:0x6a2},_0x15f053=_0x35a251;super(conventOptions(_0x4db82a)),this['_frameTime']=0x3e8/(_0x4db82a['frameRate']||0x3c),this[_0x15f053(0x7cd)]=_0x4db82a[_0x15f053(_0x398bc2._0x2defa1)]??0xa;const _0x1900b2=this;let _0x4a9c92=Date['now']();(function _0x2217e1(){const _0x245a0a=_0x15f053;_0x1900b2[_0x245a0a(0x9e2)]=window['requestAnimationFrame'](_0x2217e1);const _0x509e59=Date['now'](),_0x5116d1=_0x509e59-_0x4a9c92;_0x5116d1>_0x1900b2[_0x245a0a(0x22b)]&&(_0x4a9c92=_0x509e59-_0x5116d1%_0x1900b2['_frameTime'],_0x1900b2['updateOffset']());}());}['updateOffset'](){const _0x1d9002={_0x515d90:0x7cd,_0x281f84:0xbe0},_0x192eab=_0x35a251;let _0x37f6ab=this['uniforms']['offset'];_0x37f6ab-=0.0001*this[_0x192eab(_0x1d9002._0x515d90)],_0x37f6ab>0x1&&(_0x37f6ab=0x0),this[_0x192eab(0xa8b)][_0x192eab(_0x1d9002._0x281f84)]=_0x37f6ab;}['destroy'](_0x3d8806){const _0xba0f7=_0x35a251;return window['cancelAnimationFrame'](this[_0xba0f7(0x9e2)]),delete this[_0xba0f7(0x9e2)],super['destroy'](_0x3d8806);}}function conventOptions(_0x4ae355){const _0x4685c8=_0x35a251;return{'fabric':{'uniforms':{'color':getCesiumColor(_0x4ae355['color'],new Cesium__namespace['Color'](0x2,0x1,0x0,0.8)),'repeat':_0x4ae355[_0x4685c8(0x7c6)]??0x1e,'thickness':_0x4ae355['thickness']??0.3,'offset':_0x4ae355['offset']??0x0,'globalAlpha':0x1},'source':CylinderWaveMaterialGlsl},'translucent':function(_0xdad47a){const _0x47c872=_0x4685c8;return _0xdad47a[_0x47c872(0xa8b)]['color'][_0x47c872(0x1f4)]<0x1;}};}registerClass(CylinderWave,CylinderWaveMaterial);class BaseMaterialProperty{constructor(_0x3f3a0a={}){this['options']=_0x3f3a0a,this['_definitionChanged']=new Cesium__namespace['Event']();}get['isConstant'](){return!![];}get[_0x35a251(0xe04)](){return this['_definitionChanged'];}['getType'](_0x1bc3d4){return null;}[_0x35a251(0x7ec)](_0x2e090e,_0x3a7a4a={}){return _0x3a7a4a;}['equals'](_0x1137fc){return this===_0x1137fc;}}class CircleScanMaterialProperty extends BaseMaterialProperty{constructor(_0x328032={}){const _0x10fb08={_0x325868:0xdb2,_0x145a7e:0x9db},_0xede488=_0x35a251;super(_0x328032),this[_0xede488(_0x10fb08._0x325868)]=_0x328032['image']??_0x328032[_0xede488(0xd05)],this['color']=_0x328032[_0xede488(_0x10fb08._0x145a7e)],this['globalAlpha']=_0x328032['globalAlpha']??0x1;}['getType'](_0x2883d8){return CircleScan;}[_0x35a251(0x7ec)](_0x13106d,_0x227387){const _0x2b5c75={_0x34c749:0x9db,_0x2fdca3:0xf29,_0x3f652c:0x2cf},_0x279910=_0x35a251;return!Cesium__namespace[_0x279910(0xaa2)](_0x227387)&&(_0x227387={}),_0x227387['color']=getCesiumColor(this[_0x279910(_0x2b5c75._0x34c749)],new Cesium__namespace[(_0x279910(_0x2b5c75._0x2fdca3))](0x1,0x0,0x0,0.5),_0x13106d),_0x227387['image']=this['image'],_0x227387[_0x279910(_0x2b5c75._0x3f652c)]=this['globalAlpha'],_0x227387;}['equals'](_0x28a436){const _0x461372={_0x39a094:0xd17,_0xaa6a94:0x9db},_0x13e08c=_0x35a251;return this===_0x28a436||_0x28a436 instanceof CircleScanMaterialProperty&&Cesium__namespace[_0x13e08c(_0x461372._0x39a094)][_0x13e08c(0x417)](this['color'],_0x28a436[_0x13e08c(_0x461372._0xaa6a94)])&&this['image']===_0x28a436['image'];}}registerPropertyClass(CircleScan,CircleScanMaterialProperty);class CircleWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x52f7f6={}){const _0x5b903d={_0x47664b:0x262},_0x3ad49d=_0x35a251;super(_0x52f7f6),this['color']=_0x52f7f6['color'],this[_0x3ad49d(0x6a2)]=_0x52f7f6['speed']??0xa,this[_0x3ad49d(_0x5b903d._0x47664b)]=_0x52f7f6[_0x3ad49d(0x262)],this['count']=_0x52f7f6[_0x3ad49d(0xeee)]??0x1,this['gradient']=_0x52f7f6['gradient']??0.1,this['globalAlpha']=_0x52f7f6['globalAlpha']??0x1,this[_0x3ad49d(0xeee)]<=0x0&&(this['count']=0x1),this['gradient']<0x0&&(this[_0x3ad49d(0xf97)]=0x0),this['gradient']>0x1&&(this['gradient']=0x1);}['getType'](_0x57115c){return CircleWave;}['getValue'](_0x41e7d0,_0x4ab428){const _0x1eb482={_0x3c56c9:0xf29,_0x482cd9:0xf97},_0x39f6fe=_0x35a251;return!Cesium__namespace['defined'](_0x4ab428)&&(_0x4ab428={}),_0x4ab428['color']=getCesiumColor(this['color'],Cesium__namespace[_0x39f6fe(_0x1eb482._0x3c56c9)]['YELLOW'],_0x41e7d0),_0x4ab428[_0x39f6fe(0xeee)]=this['count'],_0x4ab428['gradient']=this[_0x39f6fe(_0x1eb482._0x482cd9)],_0x4ab428['speed']=this['speed'],_0x4ab428[_0x39f6fe(0x2cf)]=this['globalAlpha'],this['duration']?(this['_time']===undefined&&(this['_time']=new Date()['getTime']()),_0x4ab428['time']=(new Date()['getTime']()-this['_time'])/(this['duration']*0x3e8)):_0x4ab428['time']=-0x1,_0x4ab428;}['equals'](_0x5bc416){const _0x344067={_0x4c264:0x417},_0x3e9fc6=_0x35a251;return this===_0x5bc416||_0x5bc416 instanceof CircleWaveMaterialProperty&&Cesium__namespace[_0x3e9fc6(0xd17)][_0x3e9fc6(_0x344067._0x4c264)](this['color'],_0x5bc416['color'])&&this['count']===_0x5bc416['count']&&this['speed']===_0x5bc416['speed']&&this[_0x3e9fc6(0xf97)]===_0x5bc416['gradient'];}}registerPropertyClass(CircleWave,CircleWaveMaterialProperty),register$3(CylinderWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x2,0x1,0x0,0.8),'repeat':0x1e,'thickness':0.3,'offset':0x0,'globalAlpha':0x1},'source':CylinderWaveMaterialGlsl},'translucent':!![]});class CylinderWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x3593d5={}){const _0x61e3c0={_0x4eb794:0xbe3,_0x1b4bad:0xbe0},_0x503e65=_0x35a251;super(_0x3593d5),this['color']=_0x3593d5['color'],this['repeat']=_0x3593d5[_0x503e65(0x7c6)]??0x1e,this[_0x503e65(_0x61e3c0._0x4eb794)]=_0x3593d5['thickness']??0.3,this['speed']=_0x3593d5['speed']??0xa,this[_0x503e65(_0x61e3c0._0x1b4bad)]=0x0,this['globalAlpha']=_0x3593d5[_0x503e65(0x2cf)]??0x1;}[_0x35a251(0x858)](_0x14868a){return CylinderWave;}['getValue'](_0xb6f943,_0x203714){const _0x49b41a={_0xc85685:0xaa2,_0x2ffc95:0xbe0,_0x2d6a69:0x7c6,_0x383d90:0xbe3,_0x5aedb5:0xbe3},_0x36a4f5=_0x35a251;return!Cesium__namespace[_0x36a4f5(_0x49b41a._0xc85685)](_0x203714)&&(_0x203714={}),this['offset']-=0.0001*this[_0x36a4f5(0x6a2)],this['offset']>0x1&&(this[_0x36a4f5(_0x49b41a._0x2ffc95)]=0x0),_0x203714[_0x36a4f5(0x9db)]=getCesiumColor(this[_0x36a4f5(0x9db)],new Cesium__namespace['Color'](0x2,0x1,0x0,0.8),_0xb6f943),_0x203714['repeat']=this[_0x36a4f5(_0x49b41a._0x2d6a69)],_0x203714['offset']=this['offset'],_0x203714[_0x36a4f5(_0x49b41a._0x383d90)]=this[_0x36a4f5(_0x49b41a._0x5aedb5)],_0x203714['globalAlpha']=this['globalAlpha'],_0x203714;}['equals'](_0x3eddee){const _0x44fc37={_0x5eb632:0x9db},_0x562dca=_0x35a251;return this===_0x3eddee||_0x3eddee instanceof CylinderWaveMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0x562dca(0x9db)],_0x3eddee[_0x562dca(_0x44fc37._0x5eb632)])&&this['repeat']===_0x3eddee[_0x562dca(0x7c6)]&&this['thickness']===_0x3eddee['thickness'];}}registerPropertyClass(CylinderWave,CylinderWaveMaterialProperty);class DigitalFlowMaterialProperty extends BaseMaterialProperty{constructor(_0x928fd1={}){const _0x239d09={_0x16a729:0x6a2},_0x19edfe=_0x35a251;super(_0x928fd1),this['color']=getCesiumColor(_0x928fd1['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['speed']=_0x928fd1[_0x19edfe(_0x239d09._0x16a729)]??0x5,this['glow']=_0x928fd1['glow']??0x1,this['flowGlow']=_0x928fd1['flowGlow']??0x1,this[_0x19edfe(0x73a)]=_0x928fd1[_0x19edfe(0x73a)]??0x3,this['globalAlpha']=_0x928fd1['globalAlpha']??0x1;}['getType'](_0x3cc7e2){return DigitalFlow;}[_0x35a251(0x7ec)](_0x47190d,_0x48def9){const _0x18cf5f={_0xb544c9:0x73a},_0x559a2e=_0x35a251;return!Cesium__namespace['defined'](_0x48def9)&&(_0x48def9={}),_0x48def9['color']=this['color'],_0x48def9['speed']=this['speed'],_0x48def9['glow']=this['glow'],_0x48def9[_0x559a2e(0xde0)]=this['flowGlow'],_0x48def9['segment']=this[_0x559a2e(_0x18cf5f._0xb544c9)],_0x48def9['globalAlpha']=this['globalAlpha'],_0x48def9;}['equals'](_0x539e71){return this===_0x539e71||_0x539e71 instanceof DigitalFlowMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x539e71['color'])&&this['glow']===_0x539e71['glow']&&this['speed']===_0x539e71['speed'];}}registerPropertyClass(DigitalFlow,DigitalFlowMaterialProperty);class EllipsoidElectricMaterialProperty extends BaseMaterialProperty{constructor(_0x1e0deb={}){const _0x3c2202=_0x35a251;super(_0x1e0deb),this['color']=getCesiumColor(_0x1e0deb[_0x3c2202(0x9db)],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['speed']=_0x1e0deb['speed']??0x5,this['globalAlpha']=_0x1e0deb['globalAlpha']??0x1;}['getType'](_0x50d83c){return EllipsoidElectric;}['getValue'](_0x1f6fc0,_0x5247e8){const _0x5610a5=_0x35a251;return!Cesium__namespace['defined'](_0x5247e8)&&(_0x5247e8={}),_0x5247e8['color']=this[_0x5610a5(0x9db)],_0x5247e8['speed']=this['speed'],_0x5247e8['globalAlpha']=this['globalAlpha'],_0x5247e8;}[_0x35a251(0x417)](_0x3cd85c){const _0x29fc={_0x2d6105:0x417},_0xf75eb=_0x35a251;return this===_0x3cd85c||_0x3cd85c instanceof EllipsoidElectricMaterialProperty&&Cesium__namespace['Property'][_0xf75eb(_0x29fc._0x2d6105)](this['color'],_0x3cd85c['color'])&&this['speed']===_0x3cd85c['speed'];}}registerPropertyClass(EllipsoidElectric,EllipsoidElectricMaterialProperty);class EllipsoidWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x42032e={}){const _0x4416e2={_0x2ec9df:0x6a2},_0x2d6db6=_0x35a251;super(_0x42032e),this['color']=getCesiumColor(_0x42032e['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['speed']=_0x42032e[_0x2d6db6(_0x4416e2._0x2ec9df)]??0x5,this['globalAlpha']=_0x42032e['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x5c0a43){return EllipsoidWave;}['getValue'](_0x5c1137,_0x5e9629){const _0x1df7b5={_0x3170f3:0x6a2},_0x54cea4=_0x35a251;return!Cesium__namespace['defined'](_0x5e9629)&&(_0x5e9629={}),_0x5e9629['color']=this['color'],_0x5e9629[_0x54cea4(0x6a2)]=this[_0x54cea4(_0x1df7b5._0x3170f3)],_0x5e9629['globalAlpha']=this['globalAlpha'],_0x5e9629;}['equals'](_0x24f180){const _0x5983e2={_0x165c64:0x9db},_0x2cb987=_0x35a251;return this===_0x24f180||_0x24f180 instanceof EllipsoidWaveMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x24f180[_0x2cb987(_0x5983e2._0x165c64)])&&this['speed']===_0x24f180['speed'];}}registerPropertyClass(EllipsoidWave,EllipsoidWaveMaterialProperty);class Image2MaterialProperty extends BaseMaterialProperty{constructor(_0x5b45a0={}){const _0x2532ea={_0x5ec064:0x9db,_0x4040e2:0x424},_0x2056e5=_0x35a251;super(_0x5b45a0),this['image']=_0x5b45a0['image'],this[_0x2056e5(0xbf2)]=_0x5b45a0['opacity']??0x1,this[_0x2056e5(_0x2532ea._0x5ec064)]=_0x5b45a0[_0x2056e5(0x9db)]??Cesium__namespace['Color']['WHITE'],this[_0x2056e5(0x6a2)]=_0x5b45a0['speed']??0x0,this['flipx']=_0x5b45a0[_0x2056e5(_0x2532ea._0x4040e2)]??![],this[_0x2056e5(0xb54)]=_0x5b45a0[_0x2056e5(0xb54)]??![],this['noWhite']=_0x5b45a0['noWhite']??!![],this['globalAlpha']=_0x5b45a0['globalAlpha']??0x1;}['getType'](_0x198bfd){return Image2;}['getValue'](_0x141eb7,_0x51e328){const _0x2dde46={_0x9fdeff:0xb54,_0x5b362f:0x128,_0x2d78fa:0x2cf},_0x3057aa=_0x35a251;return!Cesium__namespace['defined'](_0x51e328)&&(_0x51e328={}),_0x51e328['image']=this[_0x3057aa(0xdb2)],_0x51e328['color']=this['color'],_0x51e328[_0x3057aa(0xbf2)]=this[_0x3057aa(0xbf2)],_0x51e328['speed']=this['speed'],_0x51e328['flipx']=this['flipx'],_0x51e328['flipy']=this[_0x3057aa(_0x2dde46._0x9fdeff)],_0x51e328[_0x3057aa(_0x2dde46._0x5b362f)]=this['noWhite'],_0x51e328[_0x3057aa(0x2cf)]=this[_0x3057aa(_0x2dde46._0x2d78fa)],_0x51e328;}['equals'](_0x2aab62){const _0x21878f=_0x35a251;return this===_0x2aab62||_0x2aab62 instanceof Image2MaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x2aab62['color'])&&this['opacity']===_0x2aab62[_0x21878f(0xbf2)]&&this['image']===_0x2aab62['image'];}}registerPropertyClass(Image2,Image2MaterialProperty);class LineBloomMaterialProperty extends BaseMaterialProperty{constructor(_0x2e4826={}){const _0x3182c5=_0x35a251;super(_0x2e4826),this['color']=getCesiumColor(_0x2e4826['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this[_0x3182c5(0x6a2)]=_0x2e4826['speed']??0x5,this['glow']=_0x2e4826['glow']??0x1,this['globalAlpha']=_0x2e4826['globalAlpha']??0x1;}['getType'](_0x16a35e){return LineBloom;}['getValue'](_0x48b6a5,_0x18794d){const _0x4b63af={_0x5749cd:0x6a2,_0x36f71e:0xc0e},_0x2b7458=_0x35a251;return!Cesium__namespace['defined'](_0x18794d)&&(_0x18794d={}),_0x18794d['color']=this[_0x2b7458(0x9db)],_0x18794d[_0x2b7458(0x6a2)]=this[_0x2b7458(_0x4b63af._0x5749cd)],_0x18794d[_0x2b7458(_0x4b63af._0x36f71e)]=this['glow'],_0x18794d['globalAlpha']=this['globalAlpha'],_0x18794d;}['equals'](_0x3110b6){const _0xaf548e=_0x35a251;return this===_0x3110b6||_0x3110b6 instanceof LineBloomMaterialProperty&&Cesium__namespace[_0xaf548e(0xd17)]['equals'](this['color'],_0x3110b6['color'])&&this['glow']===_0x3110b6[_0xaf548e(0xc0e)]&&this[_0xaf548e(0x6a2)]===_0x3110b6['speed'];}}registerPropertyClass(LineBloom,LineBloomMaterialProperty);class LineFlickerMaterialProperty extends BaseMaterialProperty{constructor(_0x229116={}){const _0x554970={_0x5a8650:0x9db},_0x2383f1=_0x35a251;super(_0x229116),this['color']=_0x229116[_0x2383f1(_0x554970._0x5a8650)],this['speed']=_0x229116['speed']??0x2,this['globalAlpha']=_0x229116['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x209f66){return LineFlicker;}['getValue'](_0x1d664a,_0x1b417c){const _0x344649=_0x35a251;return!Cesium__namespace[_0x344649(0xaa2)](_0x1b417c)&&(_0x1b417c={}),_0x1b417c['color']=getCesiumColor(this['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),_0x1d664a),_0x1b417c[_0x344649(0x6a2)]=this['speed'],_0x1b417c['globalAlpha']=this['globalAlpha'],_0x1b417c;}['equals'](_0x71c449){const _0x30a77c={_0x37a669:0x9db},_0x97bd07=_0x35a251;return this===_0x71c449||_0x71c449 instanceof LineFlickerMaterialProperty&&Cesium__namespace['Property'][_0x97bd07(0x417)](this[_0x97bd07(_0x30a77c._0x37a669)],_0x71c449['color'])&&this['speed']===_0x71c449['speed'];}}registerPropertyClass(LineFlicker,LineFlickerMaterialProperty);class LineFlowColorMaterialProperty extends BaseMaterialProperty{constructor(_0xa818d4={}){const _0x5993b4={_0x1fdb11:0x586},_0x5c08a8=_0x35a251;super(_0xa818d4),this[_0x5c08a8(0x9db)]=_0xa818d4['color'],this['speed']=_0xa818d4['speed']??0x2,this['percent']=_0xa818d4['percent']??0.04,this['alpha']=_0xa818d4['alpha']??0.1,this[_0x5c08a8(_0x5993b4._0x1fdb11)]=_0xa818d4['startTime']??0x0,this['globalAlpha']=_0xa818d4['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x4133a2){return LineFlowColor;}['getValue'](_0x3a9450,_0x14e410){const _0x51e40c={_0x437bfd:0x1f4},_0x25ddc6=_0x35a251;return!Cesium__namespace['defined'](_0x14e410)&&(_0x14e410={}),_0x14e410['color']=getCesiumColor(this['color'],new Cesium__namespace['Color'](0x1,0x0,0x0,0x1),_0x3a9450),_0x14e410['speed']=this['speed'],_0x14e410['percent']=this['percent'],_0x14e410[_0x25ddc6(_0x51e40c._0x437bfd)]=this['alpha'],_0x14e410['startTime']=this[_0x25ddc6(0x586)],_0x14e410['globalAlpha']=this['globalAlpha'],_0x14e410;}['equals'](_0x31937f){const _0x1de556={_0x3352d3:0x572,_0x4e786e:0x586},_0x35488d=_0x35a251;return this===_0x31937f||_0x31937f instanceof LineFlowColorMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x31937f['color'])&&this['speed']===_0x31937f[_0x35488d(0x6a2)]&&this['percent']===_0x31937f[_0x35488d(_0x1de556._0x3352d3)]&&this[_0x35488d(_0x1de556._0x4e786e)]===_0x31937f['startTime']&&this['alpha']===_0x31937f['alpha'];}}registerPropertyClass(LineFlowColor,LineFlowColorMaterialProperty);class LineFlowMaterialProperty extends BaseMaterialProperty{constructor(_0x4adbb3={}){const _0x1a7f8d={_0x5b44b4:0x9db,_0x208418:0xf29,_0x10781b:0xaa2,_0x273ea9:0xc23},_0x3c07a0=_0x35a251;super(_0x4adbb3),this['image']=_0x4adbb3['image']??_0x4adbb3['url'],this['color']=_0x4adbb3[_0x3c07a0(_0x1a7f8d._0x5b44b4)]??new Cesium__namespace[(_0x3c07a0(_0x1a7f8d._0x208418))](0x1,0x1,0x1,0x0),this['axisY']=_0x4adbb3['axisY']??![],this['mixt']=_0x4adbb3['mixt']??![],this['speed']=_0x4adbb3[_0x3c07a0(0x6a2)]??0xa,this['duration']=_0x4adbb3['duration'],this[_0x3c07a0(0x7c6)]=_0x4adbb3['repeat']??new Cesium__namespace['Cartesian2'](0x1,0x1),this[_0x3c07a0(0xc23)]=_0x4adbb3['image2']??_0x4adbb3['bgUrl'],this['color2']=_0x4adbb3['color2']??_0x4adbb3['bgColor']??new Cesium__namespace['Color'](0x1,0x1,0x1),this['hasImage2']=Cesium__namespace[_0x3c07a0(_0x1a7f8d._0x10781b)](this[_0x3c07a0(_0x1a7f8d._0x273ea9)]),this['globalAlpha']=_0x4adbb3['globalAlpha']??0x1;}[_0x35a251(0x858)](_0xa7263a){return LineFlow;}['getValue'](_0x454e63,_0x333e40){const _0x39cd66={_0xc9c624:0x7c6,_0x50f6e1:0x6a2,_0x3b08e1:0x536,_0x2a199b:0x46b,_0x5081c2:0xe15,_0x525fa5:0xd63,_0x44123d:0x2cf},_0x2193da=_0x35a251;return!Cesium__namespace[_0x2193da(0xaa2)](_0x333e40)&&(_0x333e40={}),_0x333e40['image']=this['image'],_0x333e40['color']=getCesiumColor(this['color'],new Cesium__namespace['Color'](0x1,0x1,0x1,0x0),_0x454e63),_0x333e40[_0x2193da(_0x39cd66._0xc9c624)]=getCesiumValue(this['repeat'],Cesium__namespace[_0x2193da(0x248)],_0x454e63),_0x333e40['axisY']=this['axisY'],_0x333e40['mixt']=this['mixt'],_0x333e40['speed']=getCesiumValue(this[_0x2193da(_0x39cd66._0x50f6e1)],Number,_0x454e63),this['duration']?(this[_0x2193da(_0x39cd66._0x3b08e1)]===undefined&&(this[_0x2193da(0x536)]=new Date()[_0x2193da(_0x39cd66._0x2a199b)]()),_0x333e40[_0x2193da(0xe15)]=(new Date()['getTime']()-this['_time'])/(this['duration']*0x3e8)):_0x333e40[_0x2193da(_0x39cd66._0x5081c2)]=-0x1,_0x333e40['hasImage2']=this['hasImage2'],_0x333e40['image2']=this['image2'],_0x333e40[_0x2193da(_0x39cd66._0x525fa5)]=getCesiumColor(this['color2'],new Cesium__namespace['Color'](0x1,0x1,0x1),_0x454e63),_0x333e40[_0x2193da(_0x39cd66._0x44123d)]=this[_0x2193da(0x2cf)],_0x333e40;}[_0x35a251(0x417)](_0x92c22a){const _0x55f8a1={_0x2c7e16:0xd17,_0x44b80b:0xc13,_0x5cfb41:0xd63},_0x238aaf=_0x35a251;return this===_0x92c22a||_0x92c22a instanceof LineFlowMaterialProperty&&Cesium__namespace['Property'][_0x238aaf(0x417)](this['color'],_0x92c22a[_0x238aaf(0x9db)])&&Cesium__namespace[_0x238aaf(_0x55f8a1._0x2c7e16)]['equals'](this['repeat'],_0x92c22a['repeat'])&&this['image']===_0x92c22a['image']&&this['axisY']===_0x92c22a[_0x238aaf(_0x55f8a1._0x44b80b)]&&this[_0x238aaf(0x6a2)]===_0x92c22a['speed']&&this[_0x238aaf(0xd29)]===_0x92c22a['hasImage2']&&this['image2']===_0x92c22a[_0x238aaf(0xc23)]&&Cesium__namespace['Property']['equals'](this['color2'],_0x92c22a[_0x238aaf(_0x55f8a1._0x5cfb41)]);}}registerPropertyClass(LineFlow,LineFlowMaterialProperty);class LineTrailMaterialProperty extends BaseMaterialProperty{constructor(_0x3ad382={}){const _0x3ee7c6={_0x1bd351:0x2cf},_0x400a35=_0x35a251;super(_0x3ad382),this['color']=getCesiumColor(_0x3ad382['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['bgColor']=getCesiumColor(_0x3ad382['bgColor'],this[_0x400a35(0x9db)][_0x400a35(0x373)](0.1)),this['speed']=_0x3ad382['speed']??0x2,this[_0x400a35(_0x3ee7c6._0x1bd351)]=_0x3ad382['globalAlpha']??0x1;}['getType'](_0x194d06){return LineTrail;}['getValue'](_0x3d501e,_0x7975dd){const _0x3e8de0={_0x5e3900:0x6a2},_0x43aa7a=_0x35a251;return!Cesium__namespace['defined'](_0x7975dd)&&(_0x7975dd={}),_0x7975dd['color']=this[_0x43aa7a(0x9db)],_0x7975dd['bgColor']=this[_0x43aa7a(0xb08)],_0x7975dd['speed']=this[_0x43aa7a(_0x3e8de0._0x5e3900)],_0x7975dd['globalAlpha']=this['globalAlpha'],_0x7975dd;}['equals'](_0x8e9d49){const _0x44bb93={_0x5339bf:0x417,_0x18d1c8:0x9db},_0x38fba6=_0x35a251;return this===_0x8e9d49||_0x8e9d49 instanceof LineTrailMaterialProperty&&Cesium__namespace['Property'][_0x38fba6(_0x44bb93._0x5339bf)](this['color'],_0x8e9d49[_0x38fba6(_0x44bb93._0x18d1c8)])&&Cesium__namespace[_0x38fba6(0xd17)]['equals'](this['bgColor'],_0x8e9d49['bgColor'])&&this['speed']===_0x8e9d49['speed'];}}registerPropertyClass(LineTrail,LineTrailMaterialProperty);class LineDotDashMaterialProperty extends BaseMaterialProperty{constructor(_0x336516={}){const _0x5eea25={_0x2f7ed2:0xf29},_0x2816ae=_0x35a251;super(_0x336516),this[_0x2816ae(0x9db)]=getCesiumColor(_0x336516['color'],new Cesium__namespace[(_0x2816ae(_0x5eea25._0x2f7ed2))](0x0,0x0,0x0,0x0)),this['gapColor']=getCesiumColor(_0x336516['gapColor'],Cesium__namespace['Color']['TRANSPARENT']),this[_0x2816ae(0x63d)]=_0x336516['dashLength']??0x10,this[_0x2816ae(0x252)]=_0x336516['dashPattern']??0xff,this['globalAlpha']=_0x336516['globalAlpha']??0x1;}['getType'](_0x151e1c){return LineDotDash;}[_0x35a251(0x7ec)](_0x28a69e,_0x226cf3){const _0x82c1c4={_0x210230:0x487,_0x36993a:0x63d,_0x1cc409:0x252},_0x1cda5c=_0x35a251;return!Cesium__namespace['defined'](_0x226cf3)&&(_0x226cf3={}),_0x226cf3[_0x1cda5c(0x9db)]=this['color'],_0x226cf3['gapColor']=this[_0x1cda5c(_0x82c1c4._0x210230)],_0x226cf3[_0x1cda5c(_0x82c1c4._0x36993a)]=this[_0x1cda5c(0x63d)],_0x226cf3['dashPattern']=this[_0x1cda5c(_0x82c1c4._0x1cc409)],_0x226cf3['globalAlpha']=this[_0x1cda5c(0x2cf)],_0x226cf3;}['equals'](_0x53c676){const _0x36df6e={_0x3573d7:0x63d,_0x5831a4:0x252},_0x31554f=_0x35a251;return this===_0x53c676||_0x53c676 instanceof LineDotDashMaterialProperty&&Cesium__namespace[_0x31554f(0xd17)]['equals'](this['color'],_0x53c676[_0x31554f(0x9db)])&&Cesium__namespace['Property']['equals'](this['gapColor'],_0x53c676['gapColor'])&&this['dashLength']===_0x53c676[_0x31554f(_0x36df6e._0x3573d7)]&&this[_0x31554f(_0x36df6e._0x5831a4)]===_0x53c676['dashPattern'];}}registerPropertyClass(LineDotDash,LineDotDashMaterialProperty);class NeonLightMaterialProperty extends BaseMaterialProperty{constructor(_0x4a91a2={}){const _0x116991={_0x182c26:0xf29},_0x574820=_0x35a251;super(_0x4a91a2),this['color']=getCesiumColor(_0x4a91a2['color'],Cesium__namespace[_0x574820(_0x116991._0x182c26)]['fromCssColorString']('#9b08fd')),this[_0x574820(0x6a2)]=_0x4a91a2['speed']??0x2,this['globalAlpha']=_0x4a91a2['globalAlpha']??0x1;}['getType'](_0x32c6fe){return NeonLight;}[_0x35a251(0x7ec)](_0x23e779,_0x269799){const _0x4831a8=_0x35a251;return!Cesium__namespace['defined'](_0x269799)&&(_0x269799={}),_0x269799['color']=this['color'],_0x269799['speed']=this['speed'],_0x269799['globalAlpha']=this[_0x4831a8(0x2cf)],_0x269799;}['equals'](_0x6f5d4a){const _0x281507={_0x216390:0x417,_0x371937:0x9db},_0x2c9720=_0x35a251;return this===_0x6f5d4a||_0x6f5d4a instanceof NeonLightMaterialProperty&&Cesium__namespace[_0x2c9720(0xd17)][_0x2c9720(_0x281507._0x216390)](this['color'],_0x6f5d4a[_0x2c9720(_0x281507._0x371937)])&&this['speed']===_0x6f5d4a['speed'];}}registerPropertyClass(NeonLight,NeonLightMaterialProperty);class LineThreeDashMaterialProperty extends BaseMaterialProperty{constructor(_0xad9bef={}){const _0x5659b1={_0xe853ee:0x693,_0x4c2a7a:0xe72,_0x33bf09:0xf29},_0x6f4bdb=_0x35a251;super(_0xad9bef),this[_0x6f4bdb(0x9db)]=getCesiumColor(_0xad9bef['color'],Cesium__namespace['Color']['RED']),this[_0x6f4bdb(0x63d)]=_0xad9bef['dashLength']??0x10,this['widthRatio']=_0xad9bef[_0x6f4bdb(_0x5659b1._0xe853ee)]??0.1,this[_0x6f4bdb(_0x5659b1._0x4c2a7a)]=getCesiumColor(_0xad9bef[_0x6f4bdb(0xe72)],Cesium__namespace[_0x6f4bdb(_0x5659b1._0x33bf09)]['WHITE']),this['sidesDashLength']=_0xad9bef['sidesDashLength']??0x20,this['sidesWidthRatio']=_0xad9bef[_0x6f4bdb(0xd7a)]??0.1,this['dashPattern']=_0xad9bef[_0x6f4bdb(0x252)]??0xff,this['globalAlpha']=_0xad9bef['globalAlpha']??0x1;}['getType'](_0x1757ad){return LineThreeDash;}[_0x35a251(0x7ec)](_0x2b3b0a,_0x3d6028){const _0x28bbeb={_0x2eb46c:0xf29,_0x5dce1f:0x63d,_0x209a85:0x927},_0x3c4d5f=_0x35a251;return!Cesium__namespace['defined'](_0x3d6028)&&(_0x3d6028={}),_0x3d6028['color']=getCesiumColor(this['color'],Cesium__namespace[_0x3c4d5f(_0x28bbeb._0x2eb46c)]['RED'],_0x2b3b0a),_0x3d6028[_0x3c4d5f(_0x28bbeb._0x5dce1f)]=this['dashLength'],_0x3d6028['widthRatio']=this['widthRatio'],_0x3d6028['sidesColor']=getCesiumColor(this['sidesColor'],Cesium__namespace['Color']['WHITE'],_0x2b3b0a),_0x3d6028['sidesDashLength']=this[_0x3c4d5f(_0x28bbeb._0x209a85)],_0x3d6028['sidesWidthRatio']=this['sidesWidthRatio'],_0x3d6028['dashLength']=this[_0x3c4d5f(0x63d)],_0x3d6028['globalAlpha']=this['globalAlpha'],_0x3d6028;}['equals'](_0x564990){const _0x13c78f={_0x578bfd:0xd17},_0x310d39=_0x35a251;return this===_0x564990||_0x564990 instanceof LineThreeDashMaterialProperty&&Cesium__namespace[_0x310d39(_0x13c78f._0x578bfd)]['equals'](this[_0x310d39(0x9db)],_0x564990['color'])&&this[_0x310d39(0x6a2)]===_0x564990['speed'];}}registerPropertyClass(LineThreeDash,LineThreeDashMaterialProperty);class ODLineMaterialProperty extends BaseMaterialProperty{constructor(_0x137a59={}){const _0x443903={_0x100cef:0x6a2},_0x47fb93=_0x35a251;super(_0x137a59),this['color']=getCesiumColor(_0x137a59['color'],new Cesium__namespace['Color'](Math['random']()*0.5+0.5,Math['random']()*0.8+0.2,0x0,0x1)),this['bgColor']=getCesiumColor(_0x137a59['bgColor'],this['color']['withAlpha'](0.1)),this[_0x47fb93(_0x443903._0x100cef)]=_0x137a59[_0x47fb93(_0x443903._0x100cef)]??0x14+0xa*Math['random'](),this['startTime']=_0x137a59['startTime']??Math['random'](),this['bidirectional']=_0x137a59['bidirectional']??0x0,this['globalAlpha']=_0x137a59['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x54e10d){return ODLine;}['getValue'](_0x432059,_0x370b9d){const _0x550159={_0x3dcd68:0x9db},_0x93c53f=_0x35a251;return!_0x370b9d&&(_0x370b9d={}),_0x370b9d['color']=this[_0x93c53f(_0x550159._0x3dcd68)],_0x370b9d['speed']=this['speed'],_0x370b9d['startTime']=this['startTime'],_0x370b9d['bgColor']=this['bgColor'],_0x370b9d[_0x93c53f(0xf9c)]=this[_0x93c53f(0xf9c)],_0x370b9d['globalAlpha']=this['globalAlpha'],_0x370b9d;}[_0x35a251(0x417)](_0x46aa36){const _0x10d6d3=_0x35a251;return this===_0x46aa36||_0x46aa36 instanceof ODLineMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x46aa36['color'])&&Cesium__namespace['Property']['equals'](this[_0x10d6d3(0xb08)],_0x46aa36['bgColor'])&&this['speed']===_0x46aa36['speed']&&this['startTime']===_0x46aa36['startTime']&&this['bidirectional']===_0x46aa36['bidirectional'];}}registerPropertyClass(ODLine,ODLineMaterialProperty);class PolyAsphaltMaterialProperty extends BaseMaterialProperty{constructor(_0x283d23={}){const _0x5ad180=_0x35a251;super(_0x283d23),this[_0x5ad180(0x9db)]=getCesiumColor(_0x283d23['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['size']=_0x283d23['size']??0.02,this['frequency']=_0x283d23['frequency']??0.2,this['globalAlpha']=_0x283d23['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x25a598){return PolyAsphalt;}['getValue'](_0x291b32,_0xeb9eed){const _0x270613=_0x35a251;return!Cesium__namespace['defined'](_0xeb9eed)&&(_0xeb9eed={}),_0xeb9eed['color']=this['color'],_0xeb9eed[_0x270613(0x7f)]=this[_0x270613(0x7f)],_0xeb9eed['frequency']=this[_0x270613(0x82)],_0xeb9eed['globalAlpha']=this['globalAlpha'],_0xeb9eed;}['equals'](_0x2cfa95){const _0x272da4={_0x5b81ef:0x9db},_0x42258e=_0x35a251;return this===_0x2cfa95||_0x2cfa95 instanceof PolyAsphaltMaterialProperty&&Cesium__namespace['Property'][_0x42258e(0x417)](this['color'],_0x2cfa95[_0x42258e(_0x272da4._0x5b81ef)])&&this['frequency']===_0x2cfa95['frequency']&&this['size']===_0x2cfa95[_0x42258e(0x7f)];}}registerPropertyClass(PolyAsphalt,PolyAsphaltMaterialProperty);class PolyBlobMaterialProperty extends BaseMaterialProperty{constructor(_0x1eca46={}){const _0x225aa8={_0x18238a:0xf29,_0x27ae07:0x164,_0x5556e0:0x82},_0x4b5ed0=_0x35a251;super(_0x1eca46),this[_0x4b5ed0(0x90c)]=getCesiumColor(_0x1eca46['evenColor'],new Cesium__namespace[(_0x4b5ed0(_0x225aa8._0x18238a))](0x1,0x1,0x1,0.5)),this[_0x4b5ed0(_0x225aa8._0x27ae07)]=getCesiumColor(_0x1eca46['evenColor'],new Cesium__namespace[(_0x4b5ed0(0xf29))](0x0,0x0,0x1,0.5)),this[_0x4b5ed0(_0x225aa8._0x5556e0)]=_0x1eca46['frequency']??0xa,this[_0x4b5ed0(0x2cf)]=_0x1eca46['globalAlpha']??0x1;}['getType'](_0x275520){return PolyBlob;}['getValue'](_0x3cdfd0,_0x4b5bf5){const _0x4f8409=_0x35a251;return!Cesium__namespace['defined'](_0x4b5bf5)&&(_0x4b5bf5={}),_0x4b5bf5['evenColor']=this['evenColor'],_0x4b5bf5['evenColor']=this['oddColor'],_0x4b5bf5[_0x4f8409(0x82)]=this['frequency'],_0x4b5bf5['globalAlpha']=this['globalAlpha'],_0x4b5bf5;}['equals'](_0x124769){const _0x3a7035={_0x513406:0x90c,_0x29ec6c:0x164},_0x3e49ec=_0x35a251;return this===_0x124769||_0x124769 instanceof PolyBlobMaterialProperty&&Cesium__namespace[_0x3e49ec(0xd17)][_0x3e49ec(0x417)](this[_0x3e49ec(_0x3a7035._0x513406)],_0x124769['evenColor'])&&Cesium__namespace['Property']['equals'](this['oddColor'],_0x124769[_0x3e49ec(_0x3a7035._0x29ec6c)])&&this[_0x3e49ec(0x82)]===_0x124769[_0x3e49ec(0x82)];}}registerPropertyClass(PolyBlob,PolyBlobMaterialProperty);class PolyFacetMaterialProperty extends PolyBlobMaterialProperty{['getType'](_0x1c924a){return PolyFacet;}}registerPropertyClass(PolyFacet,PolyFacetMaterialProperty);class PolyGradientMaterialProperty extends BaseMaterialProperty{constructor(_0x46cbb3={}){const _0x3c97c8={_0x4b6c5b:0x9db,_0x985981:0x984,_0x352805:0xace},_0x5993e0=_0x35a251;super(_0x46cbb3),this[_0x5993e0(_0x3c97c8._0x4b6c5b)]=getCesiumColor(_0x46cbb3[_0x5993e0(0x9db)],new Cesium__namespace['Color'](0x1,0x1,0x0,0.5)),this[_0x5993e0(_0x3c97c8._0x985981)]=_0x46cbb3[_0x5993e0(0x984)]??1.6,this[_0x5993e0(_0x3c97c8._0x352805)]=_0x46cbb3[_0x5993e0(_0x3c97c8._0x352805)]??1.5,this[_0x5993e0(0x176)]=_0x46cbb3['center']??new Cesium__namespace[(_0x5993e0(0x248))](0.5,0.5),this['globalAlpha']=_0x46cbb3['globalAlpha']??0x1;}['getType'](_0x49ea46){return PolyGradient;}['getValue'](_0x3c26b4,_0x3647c7){const _0x299864={_0x145197:0x984,_0xe0cea4:0x984},_0x54ba0a=_0x35a251;return!Cesium__namespace['defined'](_0x3647c7)&&(_0x3647c7={}),_0x3647c7['color']=this['color'],_0x3647c7[_0x54ba0a(_0x299864._0x145197)]=this[_0x54ba0a(_0x299864._0xe0cea4)],_0x3647c7['alphaPower']=this['alphaPower'],_0x3647c7[_0x54ba0a(0x176)]=this['center'],_0x3647c7['globalAlpha']=this['globalAlpha'],_0x3647c7;}[_0x35a251(0x417)](_0x25dc2f){const _0x4636e5=_0x35a251;return this===_0x25dc2f||_0x25dc2f instanceof PolyGradientMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x25dc2f[_0x4636e5(0x9db)])&&this['diffusePower']===_0x25dc2f['diffusePower'];}}registerPropertyClass(PolyGradient,PolyGradientMaterialProperty);class PolyGrassMaterialProperty extends PolyBlobMaterialProperty{['getType'](_0x2f59a7){return PolyGrass;}}registerPropertyClass(PolyGrass,PolyGrassMaterialProperty);class PolyWoodMaterialProperty extends BaseMaterialProperty{constructor(_0x19b6c6={}){const _0x48093f={_0x23369f:0x90c,_0x3cc9a7:0x164,_0x31cf68:0x551,_0x250cef:0x2cf},_0x5ec147=_0x35a251;super(_0x19b6c6),this['evenColor']=getCesiumColor(_0x19b6c6[_0x5ec147(_0x48093f._0x23369f)],new Cesium__namespace['Color'](0x1,0x1,0x1,0.5)),this[_0x5ec147(_0x48093f._0x3cc9a7)]=getCesiumColor(_0x19b6c6['evenColor'],new Cesium__namespace['Color'](0x0,0x0,0x1,0.5)),this['frequency']=_0x19b6c6['frequency']??0xa,this['noiseScale']=_0x19b6c6[_0x5ec147(_0x48093f._0x31cf68)]??new Cesium__namespace['Cartesian2'](0.7,0.5),this['grainFrequency']=_0x19b6c6['grainFrequency']??0x1b,this['globalAlpha']=_0x19b6c6[_0x5ec147(_0x48093f._0x250cef)]??0x1;}[_0x35a251(0x858)](_0x2a1397){return PolyWood;}['getValue'](_0x27e1c4,_0x3e45a9){const _0x3e8e02={_0x4c7682:0xaa2,_0x438136:0x90c,_0x129f72:0x551,_0x5c7304:0x47c},_0x7663fc=_0x35a251;return!Cesium__namespace[_0x7663fc(_0x3e8e02._0x4c7682)](_0x3e45a9)&&(_0x3e45a9={}),_0x3e45a9[_0x7663fc(_0x3e8e02._0x438136)]=this['evenColor'],_0x3e45a9['evenColor']=this['oddColor'],_0x3e45a9['frequency']=this[_0x7663fc(0x82)],_0x3e45a9[_0x7663fc(_0x3e8e02._0x129f72)]=this['noiseScale'],_0x3e45a9[_0x7663fc(_0x3e8e02._0x5c7304)]=this['grainFrequency'],_0x3e45a9['globalAlpha']=this['globalAlpha'],_0x3e45a9;}[_0x35a251(0x417)](_0x5196f6){const _0x3bb6c0={_0x47d5b1:0xd17},_0xb6a757=_0x35a251;return this===_0x5196f6||_0x5196f6 instanceof PolyWoodMaterialProperty&&Cesium__namespace['Property']['equals'](this['evenColor'],_0x5196f6[_0xb6a757(0x90c)])&&Cesium__namespace[_0xb6a757(_0x3bb6c0._0x47d5b1)][_0xb6a757(0x417)](this[_0xb6a757(0x164)],_0x5196f6['oddColor'])&&this['frequency']===_0x5196f6['frequency'];}}registerPropertyClass(PolyWood,PolyWoodMaterialProperty);class RadarLineMaterialProperty extends BaseMaterialProperty{constructor(_0x40ff7e={}){const _0x56ca5d={_0x33062f:0xf29,_0x5a7543:0x6a2},_0x2e1c1a=_0x35a251;super(_0x40ff7e),this['color']=getCesiumColor(_0x40ff7e['color'],new Cesium__namespace[(_0x2e1c1a(_0x56ca5d._0x33062f))](0x0,0x0,0x0,0x0)),this[_0x2e1c1a(_0x56ca5d._0x5a7543)]=_0x40ff7e['speed']??0x5,this['globalAlpha']=_0x40ff7e['globalAlpha']??0x1;}['getType'](_0x431a3f){return RadarLine;}[_0x35a251(0x7ec)](_0x55904c,_0x389dc7){const _0x13b21a={_0x1ac1ee:0x2cf},_0x2ec10a=_0x35a251;return!Cesium__namespace[_0x2ec10a(0xaa2)](_0x389dc7)&&(_0x389dc7={}),_0x389dc7['color']=this['color'],_0x389dc7[_0x2ec10a(0x6a2)]=this['speed'],_0x389dc7['globalAlpha']=this[_0x2ec10a(_0x13b21a._0x1ac1ee)],_0x389dc7;}['equals'](_0x389e5c){const _0x2406a5=_0x35a251;return this===_0x389e5c||_0x389e5c instanceof RadarLineMaterialProperty&&Cesium__namespace['Property'][_0x2406a5(0x417)](this['color'],_0x389e5c['color'])&&this['speed']===_0x389e5c[_0x2406a5(0x6a2)];}}registerPropertyClass(RadarLine,RadarLineMaterialProperty);class RadarWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x1d57f5={}){const _0x533973={_0x34a7ce:0xf29},_0x78f6c2=_0x35a251;super(_0x1d57f5),this['color']=getCesiumColor(_0x1d57f5[_0x78f6c2(0x9db)],new Cesium__namespace[(_0x78f6c2(_0x533973._0x34a7ce))](0x0,0x0,0x0,0x0)),this['speed']=_0x1d57f5[_0x78f6c2(0x6a2)]??0x5,this['globalAlpha']=_0x1d57f5['globalAlpha']??0x1;}['getType'](_0x1e678e){return RadarWave;}[_0x35a251(0x7ec)](_0x2f4d38,_0x5c467d){const _0x5cd61c={_0x42067f:0xaa2},_0x5ed74a=_0x35a251;return!Cesium__namespace[_0x5ed74a(_0x5cd61c._0x42067f)](_0x5c467d)&&(_0x5c467d={}),_0x5c467d['color']=this['color'],_0x5c467d['speed']=this['speed'],_0x5c467d['globalAlpha']=this['globalAlpha'],_0x5c467d;}[_0x35a251(0x417)](_0x522ba7){const _0x57db33=_0x35a251;return this===_0x522ba7||_0x522ba7 instanceof RadarWaveMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x522ba7['color'])&&this[_0x57db33(0x6a2)]===_0x522ba7['speed'];}}registerPropertyClass(RadarWave,RadarWaveMaterialProperty);class RectSlideMaterialProperty extends BaseMaterialProperty{constructor(_0x4cdc46={}){const _0x35a4a9={_0x2d0f46:0x6a2},_0x2fb1e6=_0x35a251;super(_0x4cdc46),this[_0x2fb1e6(0xdb2)]=_0x4cdc46['image'],this['color']=getCesiumColor(_0x4cdc46['color'],new Cesium__namespace['Color'](0x1,0x1,0x1,0.9)),this[_0x2fb1e6(0x6a2)]=_0x4cdc46[_0x2fb1e6(_0x35a4a9._0x2d0f46)]??0x1,this['pure']=!!_0x4cdc46['pure'],this[_0x2fb1e6(0x2cf)]=_0x4cdc46['globalAlpha']??0x1;}['getType'](_0x509b39){return RectSlide;}[_0x35a251(0x7ec)](_0xaf0e92,_0x4e1b86){const _0x18314d={_0x422a4c:0x6a2,_0x7bc1a6:0x2cf,_0x420411:0x2cf},_0x3184ef=_0x35a251;return!Cesium__namespace['defined'](_0x4e1b86)&&(_0x4e1b86={}),_0x4e1b86['image']=this['image'],_0x4e1b86['color']=this['color'],_0x4e1b86['speed']=this[_0x3184ef(_0x18314d._0x422a4c)],_0x4e1b86['pure']=this['pure'],_0x4e1b86[_0x3184ef(_0x18314d._0x7bc1a6)]=this[_0x3184ef(_0x18314d._0x420411)],_0x4e1b86;}['equals'](_0x7d0c96){const _0x378afb={_0x236b13:0x9db,_0x443677:0xdb2},_0xdb8424=_0x35a251;return this===_0x7d0c96||_0x7d0c96 instanceof RectSlideMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0xdb8424(_0x378afb._0x236b13)],_0x7d0c96['color'])&&this[_0xdb8424(_0x378afb._0x443677)]===_0x7d0c96['image']&&this['pure']===_0x7d0c96['pure']&&this['speed']===_0x7d0c96['speed'];}}registerPropertyClass(RectSlide,RectSlideMaterialProperty);class ScanLineMaterialProperty extends BaseMaterialProperty{constructor(_0x71151d={}){const _0x186c7d=_0x35a251;super(_0x71151d),this['color']=getCesiumColor(_0x71151d[_0x186c7d(0x9db)],Cesium__namespace[_0x186c7d(0xf29)]['YELLOW']),this['speed']=_0x71151d['speed']??0xa,this['globalAlpha']=_0x71151d['globalAlpha']??0x1;}['getType'](_0x8b83aa){return ScanLine;}['getValue'](_0x1614f3,_0x35e742){const _0x58dbd2={_0x187e23:0x6a2},_0x4dd567=_0x35a251;return!Cesium__namespace['defined'](_0x35e742)&&(_0x35e742={}),_0x35e742[_0x4dd567(0x9db)]=this[_0x4dd567(0x9db)],_0x35e742[_0x4dd567(_0x58dbd2._0x187e23)]=this['speed'],_0x35e742[_0x4dd567(0x2cf)]=this['globalAlpha'],_0x35e742;}['equals'](_0xce8567){const _0x28453e=_0x35a251;return this===_0xce8567||_0xce8567 instanceof ScanLineMaterialProperty&&Cesium__namespace[_0x28453e(0xd17)][_0x28453e(0x417)](this['color'],_0xce8567['color'])&&this[_0x28453e(0x6a2)]===_0xce8567[_0x28453e(0x6a2)];}}registerPropertyClass(ScanLine,ScanLineMaterialProperty);class TextMaterialProperty extends Image2MaterialProperty{constructor(_0x19335b={}){const _0x103d5b={_0x1cdc8a:0xe9,_0x4b5c5e:0xa92,_0x429be3:0xf61},_0xc38f82=_0x35a251;_0x19335b['font_size']=_0x19335b[_0xc38f82(_0x103d5b._0x1cdc8a)]??0x46,super(_0x19335b),this['transparent']=_0x19335b[_0xc38f82(_0x103d5b._0x4b5c5e)]??!![],this['_textStyles']=LabelStyleConver['toCesiumVal'](_0x19335b,{'fill':!![],'fillColor':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'textBaseline':_0xc38f82(_0x103d5b._0x429be3),'padding':0xa}),this['_updateImage']();}get['text'](){const _0x103876=_0x35a251;return this['options'][_0x103876(0xe1f)];}set['text'](_0x1d48ca){this['options']['text']=_0x1d48ca,this['_updateImage']();}get[_0x35a251(0x745)](){const _0x35ec80={_0x349606:0x241},_0x5ee20e=_0x35a251;return this[_0x5ee20e(_0x35ec80._0x349606)];}set['textStyles'](_0x2baa27){const _0x14888f={_0x1db755:0x2ec},_0x507b6f=_0x35a251;this['_textStyles']=LabelStyleConver['toCesiumVal'](_0x2baa27,this['_textStyles']),this[_0x507b6f(_0x14888f._0x1db755)]();}['_updateImage'](){const _0x99bf1c={_0x37152d:0xe1f},_0x2701ce=_0x35a251;this['_canvas']=getTextImage(this[_0x2701ce(0xe86)][_0x2701ce(_0x99bf1c._0x37152d)],this['_textStyles']);if(this['_canvas']){var _0x3b9f20;this['image']=this['_canvas'];const _0x515f8f=(_0x3b9f20=this[_0x2701ce(0xe86)])===null||_0x3b9f20===void 0x0?void 0x0:_0x3b9f20['onCustomCanvas'];_0x515f8f&&_0x515f8f(this[_0x2701ce(0x886)],this)['then'](_0x4e2f7e=>{this['image']=copyCanvas(_0x4e2f7e);});}}}registerPropertyClass(Text,TextMaterialProperty);class WallScrollMaterialProperty extends BaseMaterialProperty{constructor(_0x2e5225={}){const _0x5472e8={_0x48883d:0xdb2,_0x1bb0da:0xc13},_0x216ffc=_0x35a251;super(_0x2e5225),this[_0x216ffc(_0x5472e8._0x48883d)]=_0x2e5225['image'],this['color']=getCesiumColor(_0x2e5225['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x1)),this['speed']=_0x2e5225['speed']??0xa,this['count']=_0x2e5225['count']??0x1,this['reverse']=_0x2e5225['reverse']??![],this[_0x216ffc(_0x5472e8._0x1bb0da)]=_0x2e5225['axisY']??![],this['bloom']=_0x2e5225['bloom']??![],this['globalAlpha']=_0x2e5225['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x1393c0){return WallScroll;}['getValue'](_0x4c71ec,_0x5ec89e){const _0x25b398={_0x516401:0xe3e,_0x45cca7:0xc13},_0x165758=_0x35a251;return!Cesium__namespace['defined'](_0x5ec89e)&&(_0x5ec89e={}),_0x5ec89e['image']=this['image'],_0x5ec89e['color']=this['color'],_0x5ec89e['speed']=this[_0x165758(0x6a2)],_0x5ec89e[_0x165758(0xeee)]=this['count'],_0x5ec89e[_0x165758(_0x25b398._0x516401)]=this['reverse'],_0x5ec89e[_0x165758(_0x25b398._0x45cca7)]=this['axisY'],_0x5ec89e[_0x165758(0xa1a)]=this['bloom'],_0x5ec89e['globalAlpha']=this['globalAlpha'],_0x5ec89e;}[_0x35a251(0x417)](_0x38174a){const _0x301450=_0x35a251;return this===_0x38174a||_0x38174a instanceof WallScrollMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x38174a['color'])&&this['image']===_0x38174a['image']&&this['count']===_0x38174a[_0x301450(0xeee)]&&this['reverse']===_0x38174a['reverse']&&this['bloom']===_0x38174a[_0x301450(0xa1a)]&&this['speed']===_0x38174a['speed'];}}registerPropertyClass(WallScroll,WallScrollMaterialProperty);class WaterLightMaterialProperty extends BaseMaterialProperty{constructor(_0x4ccf96={}){const _0xc1633e=_0x35a251;super(_0x4ccf96),this['specularMap']=_0x4ccf96[_0xc1633e(0x32f)],this['normalMap']=_0x4ccf96['normalMap']||Cesium__namespace['Material']['DefaultImageId'],this['alpha']=_0x4ccf96['alpha']??0.2,this['globalAlpha']=_0x4ccf96['globalAlpha']??0x1;}['getType'](_0x5622b0){return WaterLight;}['getValue'](_0x3c71fa,_0x1dd896){const _0x575e24={_0x596d24:0x32f},_0x2d8cc1=_0x35a251;return!Cesium__namespace['defined'](_0x1dd896)&&(_0x1dd896={}),_0x1dd896[_0x2d8cc1(_0x575e24._0x596d24)]=this[_0x2d8cc1(_0x575e24._0x596d24)],_0x1dd896['normalMap']=this['normalMap'],_0x1dd896['alpha']=this['alpha'],_0x1dd896['globalAlpha']=this['globalAlpha'],_0x1dd896;}['equals'](_0x1a42c1){const _0x5435e6={_0x47eb93:0x32f,_0x4831d1:0x9ca,_0x2a41d1:0x9ca,_0x140f24:0x1f4},_0x38c66d=_0x35a251;return this===_0x1a42c1||_0x1a42c1 instanceof WaterLightMaterialProperty&&this[_0x38c66d(_0x5435e6._0x47eb93)]===_0x1a42c1['specularMap']&&this[_0x38c66d(_0x5435e6._0x4831d1)]===_0x1a42c1[_0x38c66d(_0x5435e6._0x2a41d1)]&&this['alpha']===_0x1a42c1[_0x38c66d(_0x5435e6._0x140f24)];}}registerPropertyClass(WaterLight,WaterLightMaterialProperty);class WaterMaterialProperty extends BaseMaterialProperty{constructor(_0x4a85f7={}){const _0x11f1ec={_0x1585c1:0x324,_0x3a677e:0x891},_0x144907=_0x35a251;super(_0x4a85f7),this['baseWaterColor']=getCesiumColor(_0x4a85f7[_0x144907(_0x11f1ec._0x1585c1)],new Cesium__namespace['Color'](0.2,0.3,0.6,0x1)),this[_0x144907(0x734)]=getCesiumColor(_0x4a85f7['blendColor'],new Cesium__namespace['Color'](0x0,0x1,0.699,0x1)),this['specularMap']=_0x4a85f7['specularMap']||Cesium__namespace['Material']['DefaultImageId'],this['normalMap']=_0x4a85f7['normalMap']||Cesium__namespace['Material'][_0x144907(_0x11f1ec._0x3a677e)],this[_0x144907(0x82)]=_0x4a85f7['frequency']??0x3e8,this['animationSpeed']=_0x4a85f7['animationSpeed']??0.01,this['amplitude']=_0x4a85f7['amplitude']??0xa,this[_0x144907(0x7b7)]=_0x4a85f7['specularIntensity']??0.5,this[_0x144907(0x437)]=_0x4a85f7['fadeFactor']??0x1,this['globalAlpha']=_0x4a85f7['globalAlpha']??0x1;}[_0x35a251(0x858)](_0x4ad4aa){return Water$1;}['getValue'](_0x301139,_0x1e1116){const _0x21e057={_0x10d53b:0x734,_0x45ed9c:0x32f,_0x283770:0x82,_0x5a6875:0x72c,_0x3ff7cc:0x1f4},_0x4d5758=_0x35a251;return!_0x1e1116&&(_0x1e1116={}),_0x1e1116['baseWaterColor']=this['baseWaterColor'],_0x1e1116['blendColor']=this[_0x4d5758(_0x21e057._0x10d53b)],_0x1e1116['specularMap']=this[_0x4d5758(_0x21e057._0x45ed9c)],_0x1e1116['normalMap']=this[_0x4d5758(0x9ca)],_0x1e1116[_0x4d5758(_0x21e057._0x283770)]=this['frequency'],_0x1e1116[_0x4d5758(_0x21e057._0x5a6875)]=this['animationSpeed'],_0x1e1116['amplitude']=this['amplitude'],_0x1e1116['specularIntensity']=this['specularIntensity'],_0x1e1116['fadeFactor']=this['fadeFactor'],this['globalAlpha']!==0x1&&(_0x1e1116['baseWaterColor'][_0x4d5758(_0x21e057._0x3ff7cc)]*=this[_0x4d5758(0x2cf)],_0x1e1116['blendColor']['alpha']*=this['globalAlpha']),_0x1e1116;}['equals'](_0x3fcc83){const _0x5911b1={_0x252347:0x417,_0xbb23ad:0x9ca,_0xe056b6:0x72c,_0x233eea:0x7b7},_0x216be7=_0x35a251;return this===_0x3fcc83||_0x3fcc83 instanceof WaterMaterialProperty&&this['baseWaterColor'][_0x216be7(0x417)](_0x3fcc83['baseWaterColor'])&&this['blendColor'][_0x216be7(_0x5911b1._0x252347)](_0x3fcc83['blendColor'])&&this['specularMap']===_0x3fcc83['specularMap']&&this[_0x216be7(_0x5911b1._0xbb23ad)]===_0x3fcc83['normalMap']&&this['frequency']===_0x3fcc83['frequency']&&this[_0x216be7(_0x5911b1._0xe056b6)]===_0x3fcc83[_0x216be7(0x72c)]&&this['amplitude']===_0x3fcc83[_0x216be7(0xe8f)]&&this[_0x216be7(_0x5911b1._0x233eea)]===_0x3fcc83['specularIntensity']&&this['fadeFactor']===_0x3fcc83['fadeFactor'];}}registerPropertyClass(Water$1,WaterMaterialProperty);var index$7={'__proto__':null,'TextMaterial':TextMaterial,'CylinderWaveMaterial':CylinderWaveMaterial,'BaseMaterialProperty':BaseMaterialProperty,'CircleScanMaterialProperty':CircleScanMaterialProperty,'CircleWaveMaterialProperty':CircleWaveMaterialProperty,'CylinderWaveMaterialProperty':CylinderWaveMaterialProperty,'DigitalFlowMaterialProperty':DigitalFlowMaterialProperty,'EllipsoidElectricMaterialProperty':EllipsoidElectricMaterialProperty,'EllipsoidWaveMaterialProperty':EllipsoidWaveMaterialProperty,'Image2MaterialProperty':Image2MaterialProperty,'LineBloomMaterialProperty':LineBloomMaterialProperty,'LineFlickerMaterialProperty':LineFlickerMaterialProperty,'LineFlowColorMaterialProperty':LineFlowColorMaterialProperty,'LineFlowMaterialProperty':LineFlowMaterialProperty,'LineTrailMaterialProperty':LineTrailMaterialProperty,'LineDotDashMaterialProperty':LineDotDashMaterialProperty,'NeonLightMaterialProperty':NeonLightMaterialProperty,'LineThreeDashMaterialProperty':LineThreeDashMaterialProperty,'ODLineMaterialProperty':ODLineMaterialProperty,'PolyAsphaltMaterialProperty':PolyAsphaltMaterialProperty,'PolyBlobMaterialProperty':PolyBlobMaterialProperty,'PolyFacetMaterialProperty':PolyFacetMaterialProperty,'PolyGradientMaterialProperty':PolyGradientMaterialProperty,'PolyGrassMaterialProperty':PolyGrassMaterialProperty,'PolyWoodMaterialProperty':PolyWoodMaterialProperty,'RadarLineMaterialProperty':RadarLineMaterialProperty,'RadarWaveMaterialProperty':RadarWaveMaterialProperty,'RectSlideMaterialProperty':RectSlideMaterialProperty,'ScanLineMaterialProperty':ScanLineMaterialProperty,'TextMaterialProperty':TextMaterialProperty,'WallScrollMaterialProperty':WallScrollMaterialProperty,'WaterLightMaterialProperty':WaterLightMaterialProperty,'WaterMaterialProperty':WaterMaterialProperty};class BaseGraphic extends BaseClass{constructor(_0x1d6e76={}){const _0xfa2d7a={_0x45fed1:0x6b3,_0x58ee5b:0x2f5,_0x1b429a:0x6ee,_0x509f54:0xbc9},_0x46b8eb=_0x35a251;_0x1d6e76['style']=_0x1d6e76[_0x46b8eb(0xfc8)]||{},_0x1d6e76['attr']=_0x1d6e76['attr']||{},super(_0x1d6e76),this[_0x46b8eb(0xe86)]=_0x1d6e76,this['_id']=_0x1d6e76['id']??_0x1d6e76['attr']['id']??createGuid(),this['_name']=_0x1d6e76[_0x46b8eb(0x504)]||_0x1d6e76[_0x46b8eb(_0xfa2d7a._0x45fed1)]['name']||'',this['_show']=_0x1d6e76['show']??!![],this[_0x46b8eb(0xcf8)]=_0x1d6e76['private'],_0x1d6e76['popup']&&this[_0x46b8eb(_0xfa2d7a._0x58ee5b)](_0x1d6e76['popup'],_0x1d6e76['popupOptions']),_0x1d6e76['tooltip']&&this[_0x46b8eb(_0xfa2d7a._0x1b429a)](_0x1d6e76['tooltip'],_0x1d6e76['tooltipOptions']),_0x1d6e76[_0x46b8eb(_0xfa2d7a._0x509f54)]&&this['bindContextMenu'](_0x1d6e76['contextmenuItems'],_0x1d6e76['contextmenuItemsOptions']),this[_0x46b8eb(0xf96)]=State['INITIALIZED'];}get['type'](){return this['_type'];}get['id'](){const _0x272905={_0x26ba06:0x4ee},_0x553e72=_0x35a251;return this[_0x553e72(_0x272905._0x26ba06)];}set['id'](_0x5db4da){this['_id']=_0x5db4da;}get[_0x35a251(0xc64)](){return this['_id'];}get[_0x35a251(0x4e0)](){return this['_state'];}get['isAdded'](){const _0x39b014=_0x35a251;return this[_0x39b014(0xf96)]===State['ADDED'];}get['isDestroy'](){const _0x4181c0={_0x56a01a:0x3f0},_0x24766a=_0x35a251;return this['_state']===State[_0x24766a(_0x4181c0._0x56a01a)]||!this['options'];}get[_0x35a251(0x4b7)](){if(this['_private'])return!![];return![];}get['czmObject'](){return null;}get['czmObjectEx'](){return null;}get['show'](){return this['_show'];}set['show'](_0x42fcef){const _0x2167d2={_0x28898d:0x435,_0x2a70eb:0x987,_0x24270b:0x402},_0x131816=_0x35a251;if(this[_0x131816(_0x2167d2._0x28898d)]===_0x42fcef)return;this[_0x131816(0x435)]=_0x42fcef,this['czmObject']&&(this['czmObject'][_0x131816(_0x2167d2._0x2a70eb)]=this['_show']),this['czmObjectEx']&&this[_0x131816(_0x2167d2._0x24270b)]['forEach'](function(_0x4257a6){_0x4257a6['show']=_0x42fcef;}),this[_0x131816(0xa40)]&&this[_0x131816(0xa40)](_0x42fcef),_0x42fcef?this['fire'](EventType['show']):this['fire'](EventType['hide']);}get['name'](){return this['_name'];}set['name'](_0x2f3dd8){const _0x408719={_0x408082:0x7b9},_0x2f6037=_0x35a251;this[_0x2f6037(_0x408719._0x408082)]=_0x2f3dd8;}get[_0x35a251(0x6b3)](){return this['options']['attr'];}set[_0x35a251(0x6b3)](_0x57c591){const _0x3df446={_0x15f1f3:0x264},_0x272cf7=_0x35a251;this['options']['attr']=_0x57c591,this[_0x272cf7(_0x3df446._0x15f1f3)](EventType['updateAttr'],{'attr':_0x57c591},!![]);}get[_0x35a251(0xfc8)](){var _0x3e63e9;return(_0x3e63e9=this['options'])===null||_0x3e63e9===void 0x0?void 0x0:_0x3e63e9['style'];}set['style'](_0x2c2f46){this['setStyle'](_0x2c2f46);}get[_0x35a251(0x676)](){const _0x5523fa=_0x35a251;return this[_0x5523fa(0xe86)]['allowDrillPick'];}set['allowDrillPick'](_0x4f7c07){this['options']['allowDrillPick']=_0x4f7c07;}get[_0x35a251(0xb70)](){return this['_hasEdit']&&Boolean(this['EditClass']||this['_getDrawEntityClass']);}set['hasEdit'](_0x37d3b0){this['_hasEdit']=_0x37d3b0;}get['enabledEvent'](){const _0x1162f0=_0x35a251;if(this['_layer'])return this[_0x1162f0(0x2d0)]['enabledEvent']&&this['_enabledEvent'];return this['_enabledEvent'];}set['enabledEvent'](_0x35edd1){this['_enabledEvent']=_0x35edd1;}get[_0x35a251(0x176)](){return null;}get['centerPoint'](){return LngLatPoint['fromCartesian'](this['center']);}get['hasOpacity'](){return!![];}['addTo'](_0x5d0336){const _0x5271a9={_0x2d5bb5:0x8b5},_0x5e18c6=_0x35a251;return _0x5d0336&&_0x5d0336[_0x5e18c6(_0x5271a9._0x2d5bb5)]&&_0x5d0336['addGraphic'](this),this;}[_0x35a251(0x1ee)](_0x5d1d84){this['_layer']&&this['_layer']['removeGraphic'](this,_0x5d1d84);}['bindPickId'](_0x15c102){const _0x3e5478={_0x5d6241:0x308},_0x1d1658=_0x35a251;var _0x3ef59d;return _0x15c102['_mars3d_layerId']=(_0x3ef59d=this['_layer'])===null||_0x3ef59d===void 0x0?void 0x0:_0x3ef59d['id'],_0x15c102[_0x1d1658(_0x3e5478._0x5d6241)]=this['id'],this;}['_onAdd'](_0x5e9c18){const _0x4f034d={_0x1d3c65:0x47f,_0x5e5c96:0x97b,_0x1fe747:0xc01,_0x18c049:0x264},_0x5eeb0a=_0x35a251;var _0x22f763,_0x568068;if(this[_0x5eeb0a(_0x4f034d._0x1d3c65)])return;this['_state']=State['ADD'],this['_layer']=_0x5e9c18,this['_map']=_0x5e9c18['_map'];!this['_map']&&logWarn('BaseGraphic:为了避免异常问题,请将图层添加到Map上再进行添加矢量数据的操作!');if(this[_0x5eeb0a(0xe86)]['eventParent'])this['addEventParent'](this['options']['eventParent']);else{if(((_0x22f763=this['options'])===null||_0x22f763===void 0x0?void 0x0:_0x22f763['eventParent'])===![]);else this['addEventParent'](_0x5e9c18);}!this['czmObject']&&this['_mountedHook']&&this[_0x5eeb0a(0x700)]();this[_0x5eeb0a(0x97b)]&&this[_0x5eeb0a(_0x4f034d._0x5e5c96)](this['style']);if(!((_0x568068=this['_layer'])!==null&&_0x568068!==void 0x0&&_0x568068['_highlightOptions'])){if(this[_0x5eeb0a(0xfc8)]['highlight'])this['bindHighlight'](this[_0x5eeb0a(0xfc8)][_0x5eeb0a(0x716)]);else this['options']['highlight']&&this[_0x5eeb0a(_0x4f034d._0x1fe747)](this['options']['highlight']);}this['czmObject']&&this['bindPickId'](this['czmObject']),this['czmObjectEx']&&this['czmObjectEx']['forEach'](_0xc13745=>{this['bindPickId'](_0xc13745);}),this['options'][_0x5eeb0a(0x5b2)]&&this['flyTo']({'duration':0x0}),this['_state']=State['ADDED'],this['fire'](EventType['add']),!this['isPrivate']&&this['enabledEvent']&&this['_layer'][_0x5eeb0a(_0x4f034d._0x18c049)](EventType['addGraphic'],{'graphic':this},!![]);}['_onRemove'](){const _0x46df08={_0x1768dc:0x2d0,_0x3697a3:0x2d0,_0x495be5:0xd79},_0x1c44e1=_0x35a251;var _0x3f37a6,_0x5105c8;if(this['_state']!==State['ADDED'])return;if(!this[_0x1c44e1(_0x46df08._0x1768dc)]||!this['options'])return;this['_closeAllControl'](),this[_0x1c44e1(0x428)]();this['update']&&this['unbindUpdateEvent']();this['_removedHook']&&this['_removedHook']();if(!this['options'])return;this['_state']=State['REMOVED'],this['fire'](EventType['remove']);!this[_0x1c44e1(0x4b7)]&&this['enabledEvent']&&this[_0x1c44e1(_0x46df08._0x1768dc)]['fire'](EventType[_0x1c44e1(0x73b)],{'graphic':this},!![]);if((_0x3f37a6=this['options'])!==null&&_0x3f37a6!==void 0x0&&_0x3f37a6['eventParent'])this['removeEventParent'](this['options']['eventParent']);else{if(((_0x5105c8=this['options'])===null||_0x5105c8===void 0x0?void 0x0:_0x5105c8['eventParent'])===![]);else this['removeEventParent'](this['_layer']);}this[_0x1c44e1(_0x46df08._0x3697a3)]=null,this[_0x1c44e1(_0x46df08._0x495be5)]=null;}['_mountedHook'](){}['_addedHook'](_0x1d467a){}['_removedHook'](){}['enableControl'](_0x1249a9){const _0x5547bc={_0x4552cc:0xb0,_0xc84551:0x463,_0x493aae:0xd79},_0x20f0c2=_0x35a251;this['_map'][_0x20f0c2(_0x5547bc._0x4552cc)]['enabledMoveTarget']=_0x1249a9,this['_map'][_0x20f0c2(_0x5547bc._0xc84551)]&&(this['_map']['popup']['enabled']=_0x1249a9),this[_0x20f0c2(0xd79)]['tooltip']&&(this[_0x20f0c2(_0x5547bc._0x493aae)]['tooltip']['enabled']=_0x1249a9),this['_map']['contextmenu']&&(this['_map']['contextmenu']['enabled']=_0x1249a9);}['setOptions'](_0x3d7f10){const _0x181d9b={_0x27d170:0x504,_0x22a5f2:0x4cd,_0x45224a:0xe86,_0x1ba4f0:0x6b3,_0x1e33e3:0xe86,_0x30df08:0x463,_0x2d29cc:0xe86,_0xa05be:0xb33,_0x4aa91c:0xbc9,_0x6564aa:0xbfc},_0x2160ce=_0x35a251;if(!_0x3d7f10||Object['keys'](_0x3d7f10)[_0x2160ce(0xe1e)]===0x0)return this;for(const _0x254bf8 in _0x3d7f10){const _0x2320dc=_0x3d7f10[_0x254bf8];switch(_0x254bf8){case _0x2160ce(_0x181d9b._0x27d170):case'show':case'position':case _0x2160ce(0xb35):case _0x2160ce(_0x181d9b._0x22a5f2):this[_0x2160ce(_0x181d9b._0x45224a)][_0x254bf8]=_0x2320dc,this[_0x254bf8]=_0x2320dc;break;case _0x2160ce(0x8fd):this['options'][_0x254bf8]=_0x2320dc,this['czmObject'][_0x254bf8]=_0x2320dc;break;case'attr':{this['options']['attr']=merge(this['options'][_0x2160ce(0x6b3)],_0x3d7f10['attr']),this['fire'](EventType['updateAttr'],{'attr':_0x3d7f10[_0x2160ce(_0x181d9b._0x1ba4f0)]},!![]);break;}case'style':{this[_0x2160ce(0xe86)]['style']=merge(this['options']['style'],_0x3d7f10['style']),this['_updateStyleBaseHook'](_0x3d7f10['style']),this['fire'](EventType['updateStyle'],{'style':_0x3d7f10['style']},!![]);break;}default:{isObject(_0x2320dc)?this['options'][_0x254bf8]=merge(this[_0x2160ce(_0x181d9b._0x1e33e3)][_0x254bf8],_0x2320dc):this['options'][_0x254bf8]=_0x2320dc;break;}}}return(_0x3d7f10[_0x2160ce(_0x181d9b._0x30df08)]||_0x3d7f10['popupOptions'])&&this['bindPopup'](this[_0x2160ce(_0x181d9b._0x2d29cc)][_0x2160ce(0x463)],this['options']['popupOptions']),(_0x3d7f10['tooltip']||_0x3d7f10['tooltipOptions'])&&this['bindTooltip'](this['options']['tooltip'],this['options']['tooltipOptions']),(_0x3d7f10['contextmenuItems']||_0x3d7f10['contextmenuItemsOptions'])&&this[_0x2160ce(_0x181d9b._0xa05be)](this['options'][_0x2160ce(_0x181d9b._0x4aa91c)],this['options'][_0x2160ce(0x73d)]),this['_setOptionsHook']&&this[_0x2160ce(_0x181d9b._0x6564aa)](this['options'],_0x3d7f10),this;}['setStyle'](_0x36582e){const _0x40d8c2={_0x3e2787:0xa31,_0x424480:0xfc8,_0x4905e2:0x2d0,_0x4b25b8:0xd00},_0x3957b0=_0x35a251;var _0x1937f8;return _0x36582e['material']&&delete this['options']['style']['material'],_0x36582e['materialType']&&this['options']['style'][_0x3957b0(_0x40d8c2._0x3e2787)]&&delete this['options'][_0x3957b0(_0x40d8c2._0x424480)][_0x3957b0(0xa31)],this[_0x3957b0(0xe86)]['style']=merge(this['options']['style'],_0x36582e),!((_0x1937f8=this[_0x3957b0(_0x40d8c2._0x4905e2)])!==null&&_0x1937f8!==void 0x0&&_0x1937f8[_0x3957b0(0x3eb)])&&Cesium__namespace[_0x3957b0(0xaa2)](_0x36582e['highlight'])&&(_0x36582e['highlight']?this['bindHighlight'](this[_0x3957b0(0xfc8)]['highlight']):this['unbindHighlight']()),this['_updateStyleBaseHook'](_0x36582e),this['fire'](EventType[_0x3957b0(_0x40d8c2._0x4b25b8)],{'style':_0x36582e},!![]),this;}['_updateStyleBaseHook'](_0x356c42){}[_0x35a251(0x45c)](_0xe11836){const _0x3c0157={_0x2ca6e9:0x685},_0x112b9c={_0x2ff62b:0x47f},_0x393210=_0x35a251;clearTimeout(this['_canrefresh']),this[_0x393210(_0x3c0157._0x2ca6e9)]=setTimeout(()=>{const _0x807756=_0x393210;this[_0x807756(_0x112b9c._0x2ff62b)]&&this['setStyle']({'globalAlpha':_0xe11836});},0x1f4);}['toGeoJSON'](_0x28bd65){const _0x1f149e={_0x491dae:0x504,_0x2d016c:0xfc8,_0x46eed6:0x797,_0xdb8126:0x7d9},_0x5acaf4=_0x35a251,_0xfec4da={'type':'Feature','properties':{'name':this[_0x5acaf4(_0x1f149e._0x491dae)],...this['attr'],'id':this['id'],'type':this[_0x5acaf4(0x8ea)],'style':this['_style2JsonBase'](this[_0x5acaf4(_0x1f149e._0x2d016c)],!![])}};if(this[_0x5acaf4(0xe41)])_0xfec4da['geometry']=this[_0x5acaf4(0xe41)](_0x28bd65);else{if(this[_0x5acaf4(0xb61)])_0xfec4da['geometry']={'type':'Point','coordinates':this['getCoordinate'](_0x28bd65===null||_0x28bd65===void 0x0?void 0x0:_0x28bd65['noAlt'])};else this[_0x5acaf4(0xb35)]&&(_0xfec4da['geometry']={'type':'LineString','coordinates':this[_0x5acaf4(_0x1f149e._0x46eed6)](_0x28bd65===null||_0x28bd65===void 0x0?void 0x0:_0x28bd65['noAlt'])});}return Cesium__namespace['defined'](this['options']['styleType'])&&(_0xfec4da[_0x5acaf4(_0x1f149e._0xdb8126)][_0x5acaf4(0xed6)]=this['options']['styleType']),this['_toJSON_Ex']&&this['_toJSON_Ex'](_0xfec4da[_0x5acaf4(_0x1f149e._0xdb8126)]),_0xfec4da;}[_0x35a251(0x99e)](){const _0x4c9ad6={_0x51f2fc:0x4d5},_0x4e2c79=_0x35a251,_0xa08467={...getAttrVal(this['options'],{'onlySimpleType':!![]}),'id':this['id'],'name':this[_0x4e2c79(0x504)],'type':this['type'],'attr':this[_0x4e2c79(0x6b3)],'style':this['_style2JsonBase'](this[_0x4e2c79(0xfc8)],![])};if(this['_getJsonPositions'])this['_getJsonPositions'](_0xa08467);else{if(this['coordinate'])_0xa08467['position']=this['coordinate'];else this['coordinates']?_0xa08467[_0x4e2c79(0xb35)]=this[_0x4e2c79(0x310)]:logError$1('toJSON:缺少坐标信息',this);}return Cesium__namespace['defined'](this['options'][_0x4e2c79(0xed6)])&&this['options'][_0x4e2c79(0xed6)]!==this['type']&&(_0xa08467['styleType']=this['options']['styleType']),this[_0x4e2c79(_0x4c9ad6._0x51f2fc)]&&this['_toJSON_Ex'](_0xa08467),_0xa08467;}['_style2JsonBase'](_0x399b67,_0x4263fd){const _0x569d3f={_0x1e2ee4:0x716,_0x3387ee:0x99e,_0x35a532:0x854,_0x41bc29:0xbbd,_0x1f9f2f:0x99e},_0x3d51ec=_0x35a251;let _0x156940;return this['_style2Json']?(_0x156940=this['_style2Json'](_0x399b67),_0x399b67[_0x3d51ec(_0x569d3f._0x1e2ee4)]&&(_0x156940['highlight']=this[_0x3d51ec(0x1e0)](_0x399b67['highlight']))):_0x156940=getAttrVal(_0x399b67,{'onlySimpleType':!![]}),_0x399b67['label']&&(_0x156940['label']=LabelStyleConver[_0x3d51ec(_0x569d3f._0x3387ee)](_0x399b67[_0x3d51ec(_0x569d3f._0x35a532)])),_0x399b67['outlineStyle']&&(_0x156940[_0x3d51ec(_0x569d3f._0x41bc29)]=PolylineStyleConver[_0x3d51ec(_0x569d3f._0x1f9f2f)](_0x399b67['outlineStyle'])),_0x156940;}['bindUpdateEvent'](){const _0x202821={_0x226f8d:0xd79,_0x3d52d8:0xb65,_0x163efa:0x835,_0x13fb0e:0x835},_0xdedb69=_0x35a251;if(!this['update']||!this['_map'])return;this['unbindUpdateEvent'](),this[_0xdedb69(_0x202821._0x226f8d)]['on'](EventType[_0xdedb69(_0x202821._0x3d52d8)],this[_0xdedb69(_0x202821._0x163efa)],this),this[_0xdedb69(_0x202821._0x13fb0e)](this['_map']['scene']);}['unbindUpdateEvent'](){this['_map']&&this['_map']['off'](EventType['preRender'],this['_map_preRenderHandler'],this);}['_map_preRenderHandler'](_0x2fcf96){const _0x4f9f51={_0xf4f4e4:0x182},_0x3dcb7d=_0x35a251;var _0x140139;if(!this['_map'])return;if((_0x140139=this[_0x3dcb7d(0xe86)])!==null&&_0x140139!==void 0x0&&_0x140139[_0x3dcb7d(0xc9c)]&&this['_last_preUpdateTime']){const _0x2d1749=_0x2fcf96[_0x3dcb7d(0x44f)]['frameNumber']-this[_0x3dcb7d(0xb73)];if(_0x2d17490x0)return getRectangle(_0x4ef4b1,_0x3bc877===null||_0x3bc877===void 0x0?void 0x0:_0x3bc877['isFormat']);if(this['position'])return getRectangle([this['position']],_0x3bc877===null||_0x3bc877===void 0x0?void 0x0:_0x3bc877['isFormat']);}[_0x35a251(0x194)](){const _0x43c498=_0x35a251,_0x56becc=this[_0x43c498(0x263)]||this['positions'];if(_0x56becc&&_0x56becc[_0x43c498(0xe1e)]>0x0)return getMaxHeight(_0x56becc);if(this['position'])return getRectangle(this['position']);return 0x0;}['fire'](_0x45094e,_0x4c021a={},_0x23b2fe){const _0x337101=_0x35a251;return _0x4c021a['graphic']=this,super[_0x337101(0x264)](_0x45094e,_0x4c021a,_0x23b2fe);}[_0x35a251(0x5b2)](_0x3decba={}){const _0x16b97c={_0x9e237d:0xe86},_0x547dc1=_0x35a251;if(!this[_0x547dc1(0xd79)])return Promise['resolve'](![]);this[_0x547dc1(_0x16b97c._0x9e237d)][_0x547dc1(0x2e2)]&&(_0x3decba={...this['options']['flyToOptions'],..._0x3decba});let _0x1343e4;if(this['positionsShow'])_0x1343e4=this[_0x547dc1(0x263)];else{if(this[_0x547dc1(0xb35)])_0x1343e4=this['positions'];else this['position']&&(_0x1343e4=[this['position']]);}return _0x3decba['clampToGround']=this['style']['clampToGround'],this['_map']['flyToPositions'](_0x1343e4,_0x3decba);}[_0x35a251(0xba6)](_0x902db3=0x0){let _0x3e79f8=this['style']['addHeight'];if(Cesium__namespace['defined'](_0x3e79f8)){if(isString(_0x3e79f8))_0x3e79f8=Number(template(_0x3e79f8,this['attr'],!![])),isNaN(_0x3e79f8)&&(_0x3e79f8=0x0);else Array['isArray'](_0x3e79f8)&&(_0x3e79f8=_0x3e79f8[_0x902db3]||0x0);return _0x3e79f8;}return 0x0;}[_0x35a251(0xc01)](_0x4d2981){const _0x503afe={_0x505b5b:0x3eb,_0x13353a:0x16e,_0x1cdcf9:0x6cc},_0x3a3740=_0x35a251;this['unbindHighlight'](),this[_0x3a3740(_0x503afe._0x505b5b)]=_0x4d2981,this[_0x3a3740(_0x503afe._0x505b5b)]['type']===EventType['click']?this['on'](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['on'](EventType['mouseOver'],this[_0x3a3740(_0x503afe._0x13353a)],this),this['on'](EventType[_0x3a3740(_0x503afe._0x1cdcf9)],this['_highlight_mouseOutHandler'],this));}['unbindHighlight'](){const _0x1b5900={_0x18ea42:0x6b2,_0x5a6a34:0x429,_0x7de6f:0xd79},_0x316336=_0x35a251;this['_highlightOptions']&&(this['_highlightOptions'][_0x316336(0x8ea)]===EventType['click']?this[_0x316336(_0x1b5900._0x18ea42)](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['off'](EventType[_0x316336(_0x1b5900._0x5a6a34)],this['_highlight_mouseEventHandler'],this),this[_0x316336(_0x1b5900._0x18ea42)](EventType['mouseOut'],this['_highlight_mouseOutHandler'],this)),this[_0x316336(_0x1b5900._0x7de6f)]['closeHighlight'](),this['_highlightOptions']=null);}['_highlight_mouseEventHandler'](_0x780684){const _0x2ff77a=_0x35a251;if(!this['_map'])return;const _0xb02af1=_0x780684===null||_0x780684===void 0x0?void 0x0:_0x780684[_0x2ff77a(0xf8c)];_0xb02af1?this['_map']['openHighlight'](_0xb02af1,this[_0x2ff77a(0x3eb)],_0x780684):this['_map']['closeHighlight']();}['_highlight_mouseOutHandler'](_0x1951af){const _0x263994=_0x35a251;this[_0x263994(0xd79)]['closeHighlight']();}['_closeAllControl'](){const _0x5c4be2={_0x5594b1:0x90b},_0xc1dbf7=_0x35a251;this[_0xc1dbf7(_0x5c4be2._0x5594b1)](),this['closeTooltip'](),this['closeSmallTooltip'](),this['closeContextMenu']();}[_0x35a251(0x6b4)](){return this['position']||this['center'];}['hasPopup'](_0x474599){const _0x399bd8=_0x35a251;return Boolean(this[_0x399bd8(0x618)](_0x474599));}['getPopupConfig'](_0x5b72be=!![]){const _0x10cdff={_0xcf5ba1:0xdf7},_0x2ffa98=_0x35a251;var _0x5ebc16;if(this['_popupConfig'])return{...this['_popupConfig']};if(_0x5b72be&&(_0x5ebc16=this['_layer'])!==null&&_0x5ebc16!==void 0x0&&_0x5ebc16['_popupConfig'])return{...this['_layer'][_0x2ffa98(_0x10cdff._0xcf5ba1)]};return null;}['bindPopup'](_0x32531e,_0x2ee8a9={}){const _0x333c1f=_0x35a251;return this['_popupConfig']={'content':_0x32531e,'options':_0x2ee8a9||this[_0x333c1f(0xe86)]['popupOptions'],'graphic':this,'layer':this['_layer']},this['_onEventHook']&&this[_0x333c1f(0xf1f)]('popup'),this;}[_0x35a251(0x17f)](_0x4ebd41){const _0x28f2ba={_0x3a1b7c:0xdf7,_0x45a4e3:0x463},_0x4a4b85=_0x35a251;return _0x4ebd41?this['_popupConfig']=![]:this[_0x4a4b85(_0x28f2ba._0x3a1b7c)]=null,this['_onEventHook']&&this['_onEventHook'](_0x4a4b85(_0x28f2ba._0x45a4e3)),this;}['openPopup'](_0x3738c6,_0x30f7a7){const _0x212453={_0x30c038:0xf8c,_0x21e715:0x2d0,_0x4a5152:0x6b4},_0x2c8f28=_0x35a251,_0xbe36f6=this['getPopupConfig']();return _0xbe36f6&&this['_map']&&(_0x30f7a7&&(_0xbe36f6['event']=_0x30f7a7),_0xbe36f6[_0x2c8f28(_0x212453._0x30c038)]=this,_0xbe36f6['layer']=this[_0x2c8f28(_0x212453._0x21e715)],this['_map']['popup']['open'](_0x3738c6||this[_0x2c8f28(_0x212453._0x4a5152)](),_0xbe36f6)),this;}['closePopup'](){const _0x4e2eec={_0x2c4468:0x463},_0x18771a=_0x35a251;return this[_0x18771a(0xd79)]&&this['_map'][_0x18771a(_0x4e2eec._0x2c4468)]['close'](this),this;}['getPopup'](){const _0x469616={_0x2b74da:0xcb9},_0x9708a7=_0x35a251;if(this[_0x9708a7(0xd79)])return this[_0x9708a7(0xd79)]['popup'][_0x9708a7(_0x469616._0x2b74da)](this);}[_0x35a251(0xdcf)](_0x313ab5){return Boolean(this['getTooltipConfig'](_0x313ab5));}['getTooltipConfig'](_0xe938ec=!![]){const _0x13627b={_0x91ab11:0x2d0,_0x101d5b:0x8f2,_0x17890d:0x8f2},_0x180c6a=_0x35a251;var _0x2821a5;if(this['_tooltipConfig'])return{...this['_tooltipConfig']};if(_0xe938ec&&(_0x2821a5=this[_0x180c6a(_0x13627b._0x91ab11)])!==null&&_0x2821a5!==void 0x0&&_0x2821a5[_0x180c6a(_0x13627b._0x101d5b)])return{...this[_0x180c6a(0x2d0)][_0x180c6a(_0x13627b._0x17890d)]};return null;}['bindTooltip'](_0x19b12c,_0x1834d0){const _0x45f8de={_0x38be25:0x8f2,_0xc7f93:0xf1f},_0xc36009=_0x35a251;return this[_0xc36009(_0x45f8de._0x38be25)]={'content':_0x19b12c,'options':_0x1834d0||this['options']['tooltipOptions']},this[_0xc36009(_0x45f8de._0xc7f93)]&&this['_onEventHook']('tooltip'),this;}['unbindTooltip'](_0x2b6b61){const _0x8fc11={_0x296e33:0x8f2,_0x2078b3:0xf1f},_0x257289=_0x35a251;return _0x2b6b61?this[_0x257289(0x8f2)]=![]:this[_0x257289(_0x8fc11._0x296e33)]=null,this[_0x257289(_0x8fc11._0x2078b3)]&&this['_onEventHook']('tooltip'),this;}['openTooltip'](_0x1b486e,_0x134751){const _0x3ff966={_0x56191b:0x87,_0x5c77dd:0x2d0,_0x3630eb:0x8d8},_0x3ba561=_0x35a251,_0x42a77d=this['getTooltipConfig']();return _0x42a77d&&this['_map']&&(_0x42a77d[_0x3ba561(0xf8c)]=this,_0x42a77d[_0x3ba561(_0x3ff966._0x56191b)]=this[_0x3ba561(_0x3ff966._0x5c77dd)],_0x134751&&(_0x42a77d['event']=_0x134751),this['_map'][_0x3ba561(0x631)][_0x3ba561(_0x3ff966._0x3630eb)](_0x1b486e||this['_getPopupPosition'](),_0x42a77d)),this;}[_0x35a251(0x8c5)](){const _0x107d95={_0x11ba64:0xd79},_0xe9b2e4=_0x35a251;return this[_0xe9b2e4(_0x107d95._0x11ba64)]&&this[_0xe9b2e4(_0x107d95._0x11ba64)]['tooltip']['close'](this),this;}['getTooltip'](){if(this['_map'])return this['_map']['tooltip']['getTooltip'](this);}['hasContextMenu'](_0x5e41a5){return Boolean(this['getContextMenu'](_0x5e41a5));}['getContextMenu'](_0x49cdbc=!![]){const _0x42b430={_0x403ab9:0x606},_0x3e4bb0=_0x35a251;var _0x3854a3;if(this['_contextmenuConfig'])return this['_contextmenuConfig'];if(_0x49cdbc&&(_0x3854a3=this['_layer'])!==null&&_0x3854a3!==void 0x0&&_0x3854a3['_contextmenuConfig'])return this[_0x3e4bb0(0x2d0)][_0x3e4bb0(_0x42b430._0x403ab9)];return null;}['bindContextMenu'](_0xab0057,_0x3f24fd){const _0x81bd33={_0x18d004:0xca0,_0x28a5b1:0x2d0},_0x26d3fc=_0x35a251;return this[_0x26d3fc(0x606)]={'content':_0xab0057,'options':_0x3f24fd||this[_0x26d3fc(0xe86)][_0x26d3fc(_0x81bd33._0x18d004)],'graphic':this,'layer':this[_0x26d3fc(_0x81bd33._0x28a5b1)]},this['_onEventHook']&&this[_0x26d3fc(0xf1f)]('contextMenu'),this;}['unbindContextMenu'](_0x1589a0){const _0x5587b5=_0x35a251;return _0x1589a0?this['_contextmenuConfig']=![]:this['_contextmenuConfig']=null,this['_onEventHook']&&this[_0x5587b5(0xf1f)]('contextMenu'),this;}['openContextMenu'](_0x23ae71){const _0x15e87d={_0x40509d:0x26d,_0xa4d7ae:0xf8c,_0x33bcec:0x6b4},_0x170a2d=_0x35a251,_0x30503d=this[_0x170a2d(_0x15e87d._0x40509d)]();return _0x30503d&&this['_map']&&(_0x30503d[_0x170a2d(_0x15e87d._0xa4d7ae)]=this,_0x30503d['layer']=this[_0x170a2d(0x2d0)],this[_0x170a2d(0xd79)]['contextmenu']['open'](_0x23ae71||this[_0x170a2d(_0x15e87d._0x33bcec)](),_0x30503d)),this;}['closeContextMenu'](){const _0x5a7309={_0xb8e7a6:0x21f},_0x36d4ce=_0x35a251;return this[_0x36d4ce(_0x5a7309._0xb8e7a6)]()&&this['_map']&&this['_map'][_0x36d4ce(0xb91)]['close'](this),this;}['openSmallTooltip'](_0x5bdfaa,_0x1b954e){return this['_map']&&this['_map']['openSmallTooltip'](_0x5bdfaa,_0x1b954e),this;}['closeSmallTooltip'](){return this['_map']&&this['_map']['closeSmallTooltip'](),this;}['destroy'](_0x3a1484){const _0xd634eb=_0x35a251;if(this['_state']===State['DESTROY']||this['_noDestroy'])return;this['_state']!==State['REMOVED']&&(this['clear']&&this['clear'](),this['remove']()),super['destroy'](_0x3a1484),this['_state']=State[_0xd634eb(0x3f0)];}}class FlickerEntity{constructor(_0x33242a={}){const _0x3128c0={_0x8edf35:0x373},_0x2f8083=_0x35a251;this[_0x2f8083(0x9db)]=Cesium__namespace['Color']['YELLOW'][_0x2f8083(_0x3128c0._0x8edf35)](0x0);}[_0x35a251(0x66a)](_0x1d28a4,_0x345fc2={}){const _0x1c99a2={_0x28ff74:0x410,_0x1bc6da:0x9db,_0x154f97:0xf29},_0x46800d={_0x5c0c12:0x1aa,_0x1e9403:0x27f,_0x3ed0c3:0xf46,_0x14c4c9:0xab1,_0x51103e:0x2b1,_0x4c1a89:0x440,_0xa84cf1:0x854,_0x5e91c0:0x854,_0x2d68f5:0xd5},_0xe99f16=_0x35a251,_0x5b891c=this;return this[_0xe99f16(0xc73)](),this[_0xe99f16(_0x1c99a2._0x28ff74)]=_0x1d28a4,this['maxAlpha']=_0x345fc2['maxAlpha']??0.3,this['time']=_0x345fc2['time'],this[_0xe99f16(_0x1c99a2._0x1bc6da)]=_0x345fc2['color']??Cesium__namespace[_0xe99f16(_0x1c99a2._0x154f97)]['YELLOW'],this['color']=this['color'][_0xe99f16(0x373)](this['maxAlpha']),this['onEnd']=_0x345fc2['onEnd'],this['_startTime'](),loopArrayForFun(_0x1d28a4,function(_0x4f7ec9){const _0x1309ef={_0xa0a20b:0x9db},_0x3f312f=_0xe99f16;_0x4f7ec9[_0x3f312f(0x909)]&&(_0x4f7ec9['polygon']['material_bak']=_0x4f7ec9['polygon']['material'],_0x4f7ec9['polygon']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x164f16=>{return _0x5b891c['color'];},![]))),_0x4f7ec9['polyline']&&(_0x4f7ec9['polyline']['material_bak']=_0x4f7ec9['polyline'][_0x3f312f(0x27f)],_0x4f7ec9['polyline']['material']=new Cesium__namespace[(_0x3f312f(_0x46800d._0x5c0c12))](new Cesium__namespace['CallbackProperty'](_0x45f4ad=>{return _0x5b891c['color'];},![]))),_0x4f7ec9['ellipsoid']&&(_0x4f7ec9['ellipsoid']['material_bak']=_0x4f7ec9['ellipsoid'][_0x3f312f(0x27f)],_0x4f7ec9['ellipsoid']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x282e0f=>{return _0x5b891c['color'];},![]))),_0x4f7ec9['ellipse']&&(_0x4f7ec9['ellipse']['material_bak']=_0x4f7ec9[_0x3f312f(0xedf)][_0x3f312f(_0x46800d._0x1e9403)],_0x4f7ec9['ellipse'][_0x3f312f(_0x46800d._0x1e9403)]=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x58a6dc=>{const _0x276051=_0x3f312f;return _0x5b891c[_0x276051(_0x1309ef._0xa0a20b)];},![]))),_0x4f7ec9['rectangle']&&(_0x4f7ec9['rectangle'][_0x3f312f(_0x46800d._0x3ed0c3)]=_0x4f7ec9[_0x3f312f(_0x46800d._0x14c4c9)][_0x3f312f(0x27f)],_0x4f7ec9['rectangle']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x333c29=>{return _0x5b891c['color'];},![]))),_0x4f7ec9['wall']&&(_0x4f7ec9[_0x3f312f(_0x46800d._0x51103e)][_0x3f312f(_0x46800d._0x3ed0c3)]=_0x4f7ec9['wall'][_0x3f312f(0x27f)],_0x4f7ec9['wall']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x39fd21=>{return _0x5b891c['color'];},![]))),_0x4f7ec9['point']&&(_0x4f7ec9['point']['color_bak']=_0x4f7ec9['point']['color'],_0x4f7ec9[_0x3f312f(0x1ba)]['color']=_0x5b891c['color']),_0x4f7ec9['billboard']&&(_0x4f7ec9[_0x3f312f(0x9c2)]['color_bak']=_0x4f7ec9['billboard']['color'],_0x4f7ec9['billboard']['color']=_0x5b891c['color']),_0x4f7ec9['model']&&(_0x4f7ec9[_0x3f312f(0x440)][_0x3f312f(0x1c5)]=_0x4f7ec9[_0x3f312f(_0x46800d._0x4c1a89)]['color'],_0x4f7ec9['model']['color']=_0x5b891c['color']),_0x4f7ec9[_0x3f312f(0x854)]&&(_0x4f7ec9[_0x3f312f(_0x46800d._0xa84cf1)]['fillColor_bak']=_0x4f7ec9[_0x3f312f(_0x46800d._0x5e91c0)][_0x3f312f(0xd5)],_0x4f7ec9[_0x3f312f(0x854)][_0x3f312f(_0x46800d._0x2d68f5)]=_0x5b891c['color']);}),this;}['stopFlicker'](){const _0x230d5e={_0x57d82b:0x410},_0x75525={_0x3928a2:0x909,_0xdbe0ce:0x27f,_0x322b8a:0xf46,_0x66de5f:0x3f4,_0x515b08:0x2b1,_0x1c23e9:0x1c5,_0x47eaa7:0x1c5,_0x199791:0x9db,_0x34e520:0x440},_0x432085=_0x35a251;return this['_stopTime'](),this['entitys']&&(loopArrayForFun(this[_0x432085(_0x230d5e._0x57d82b)],function(_0x1ebf3e){const _0x312573=_0x432085;_0x1ebf3e['polygon']&&(_0x1ebf3e['polygon']['material_bak']&&(_0x1ebf3e['polygon']['material']=_0x1ebf3e[_0x312573(_0x75525._0x3928a2)]['material_bak'])),_0x1ebf3e['polyline']&&(_0x1ebf3e[_0x312573(0x282)]['material_bak']&&(_0x1ebf3e['polyline'][_0x312573(_0x75525._0xdbe0ce)]=_0x1ebf3e['polyline'][_0x312573(_0x75525._0x322b8a)])),_0x1ebf3e['ellipsoid']&&(_0x1ebf3e['ellipsoid']['material_bak']&&(_0x1ebf3e[_0x312573(_0x75525._0x66de5f)]['material']=_0x1ebf3e['ellipsoid']['material_bak'])),_0x1ebf3e['ellipse']&&(_0x1ebf3e['ellipse']['material_bak']&&(_0x1ebf3e['ellipse']['material']=_0x1ebf3e['ellipse'][_0x312573(_0x75525._0x322b8a)])),_0x1ebf3e['rectangle']&&(_0x1ebf3e['rectangle']['material_bak']&&(_0x1ebf3e['rectangle']['material']=_0x1ebf3e['rectangle']['material_bak'])),_0x1ebf3e['wall']&&(_0x1ebf3e[_0x312573(_0x75525._0x515b08)]['material_bak']&&(_0x1ebf3e['wall']['material']=_0x1ebf3e[_0x312573(0x2b1)][_0x312573(_0x75525._0x322b8a)])),_0x1ebf3e['point']&&(_0x1ebf3e['point']['color_bak']&&(_0x1ebf3e['point']['color']=_0x1ebf3e['point'][_0x312573(_0x75525._0x1c23e9)])),_0x1ebf3e['billboard']&&(_0x1ebf3e[_0x312573(0x9c2)][_0x312573(_0x75525._0x47eaa7)]?_0x1ebf3e['billboard'][_0x312573(_0x75525._0x199791)]=_0x1ebf3e['billboard'][_0x312573(_0x75525._0x1c23e9)]:_0x1ebf3e['billboard']['color']=undefined),_0x1ebf3e['model']&&(_0x1ebf3e['model']['color_bak']?_0x1ebf3e[_0x312573(_0x75525._0x34e520)]['color']=_0x1ebf3e['model']['color_bak']:_0x1ebf3e['model']['color']=undefined),_0x1ebf3e['label']&&(_0x1ebf3e['label']['fillColor_bak']&&(_0x1ebf3e[_0x312573(0x854)]['fillColor']=_0x1ebf3e[_0x312573(0x854)]['fillColor_bak']));}),this['onEnd']&&this['onEnd'](this[_0x432085(_0x230d5e._0x57d82b)]),delete this[_0x432085(_0x230d5e._0x57d82b)]),this;}[_0x35a251(0x9fc)](){const _0x3efa0d={_0x125a4c:0x9db},_0x4f6fc1=this;this['entitys']&&loopArrayForFun(this['entitys'],function(_0x438c5f){const _0x3d8c6d=_0x2767;_0x438c5f[_0x3d8c6d(0x1ba)]&&(_0x438c5f[_0x3d8c6d(0x1ba)]['color']=_0x4f6fc1['color']),_0x438c5f[_0x3d8c6d(0x9c2)]&&(_0x438c5f[_0x3d8c6d(0x9c2)][_0x3d8c6d(_0x3efa0d._0x125a4c)]=_0x4f6fc1['color']),_0x438c5f[_0x3d8c6d(0x440)]&&(_0x438c5f['model']['color']=_0x4f6fc1['color']),_0x438c5f['label']&&(_0x438c5f['label']['fillColor']=_0x4f6fc1[_0x3d8c6d(_0x3efa0d._0x125a4c)]);});}['_startTime'](){const _0x3efba3={_0x1b6686:0xcd1},_0x3dc4fe=_0x35a251,_0x273866=0x1e,_0x3c1606=this['maxAlpha']/_0x273866;let _0x2c1f0a=0x0;this[_0x3dc4fe(0x243)]=setInterval(()=>{const _0x3aa489=_0x3dc4fe;_0x2c1f0a+=_0x3c1606,_0x2c1f0a>this[_0x3aa489(_0x3efba3._0x1b6686)]&&(_0x2c1f0a=0x0),this['color']=this['color']['withAlpha'](_0x2c1f0a),this['_updateClr']();},_0x273866),this[_0x3dc4fe(0xe15)]&&(this['timeEndVal']=setTimeout(()=>{const _0x5a216d=_0x3dc4fe;this[_0x5a216d(0xc73)]();},this['time']*0x3e8));}['_stopTime'](){const _0x30ea94=_0x35a251;this['interVal']&&(clearInterval(this['interVal']),this[_0x30ea94(0x243)]=null),this['timeEndVal']&&(clearTimeout(this[_0x30ea94(0xc52)]),this['timeEndVal']=null);}}function loopArrayForFun(_0x338979,_0x47cfcd){const _0x22b910=_0x35a251;if(_0x338979==null)return;if(Array['isArray'](_0x338979)){const _0xd62557=[];for(let _0x2735ee=0x0,_0x537a55=_0x338979[_0x22b910(0xe1e)];_0x2735ee<_0x537a55;_0x2735ee++){_0xd62557['push'](_0x47cfcd(_0x338979[_0x2735ee]));}return _0xd62557;}else return _0x47cfcd(_0x338979);}class BaseEntity extends BaseGraphic{get['dataSource'](){var _0xd6b246;return(_0xd6b246=this['_layer'])===null||_0xd6b246===void 0x0?void 0x0:_0xd6b246['dataSource'];}get['czmObject'](){return this['_entity'];}get['czmObjectEx'](){const _0x2e0fad={_0x23b361:0x8bb},_0x5ea14=_0x35a251;let _0x13eb5c=[];return this['_primitive_label']&&_0x13eb5c['push'](this['_primitive_label']),this['_entity_outlines']&&(_0x13eb5c=_0x13eb5c['concat'](this[_0x5ea14(_0x2e0fad._0x23b361)])),_0x13eb5c;}get['entity'](){return this['_entity'];}get['entityGraphic'](){const _0x590cad={_0x3691a0:0x1ba},_0x45fb0e=_0x35a251;var _0xa3b299;return(_0xa3b299=this['_entity'])===null||_0xa3b299===void 0x0?void 0x0:_0xa3b299[_0x45fb0e(_0x590cad._0x3691a0)];}get[_0x35a251(0x854)](){const _0xb01f6b={_0x3d9063:0x854},_0x5aa92c=_0x35a251;var _0x206762,_0x52215b;if(this['_primitive_label'])return this['_primitive_label'];if((_0x206762=this['_entity'])!==null&&_0x206762!==void 0x0&&_0x206762['label'])return this['_entity']['label'];if((_0x52215b=this['style'])!==null&&_0x52215b!==void 0x0&&_0x52215b[_0x5aa92c(_0xb01f6b._0x3d9063)]){var _0x497af1;return(_0x497af1=this['style'])===null||_0x497af1===void 0x0?void 0x0:_0x497af1[_0x5aa92c(0x854)];}return{};}get['isEditing'](){return this['_enabledEdit'];}['reload'](){const _0x28a0f={_0x43e146:0x752,_0x5055f9:0xe86,_0x4148e1:0xb35},_0x317e11=_0x35a251;this[_0x317e11(_0x28a0f._0x43e146)]=![],this[_0x317e11(0x736)]();const _0x29f66d=this['_layer'];this['_onRemove'](),delete this['_entity'],this[_0x317e11(_0x28a0f._0x5055f9)][_0x317e11(0xb35)]&&(this[_0x317e11(_0x28a0f._0x4148e1)]=this['options'][_0x317e11(_0x28a0f._0x4148e1)]),this['options']['position']&&(this['position']=this['options']['position']),this['_onAdd'](_0x29f66d),this['enabledEvent']=!![];}[_0x35a251(0x700)](){}[_0x35a251(0x97b)](_0x54fbe4){const _0x490d68={_0x98f654:0xad5,_0x42cbc3:0x371,_0x2b33e7:0x979},_0x390de4={_0x5b29a1:0x313,_0x1b22e3:0x4af},_0x5cd516=_0x35a251;this[_0x5cd516(_0x490d68._0x98f654)]['entities']['add'](this[_0x5cd516(_0x490d68._0x42cbc3)]),this['czmObjectEx']['forEach'](_0x10ae04=>{const _0x1c655f=_0x5cd516;_0x10ae04 instanceof Cesium__namespace['Entity']&&this['dataSource'][_0x1c655f(_0x390de4._0x5b29a1)][_0x1c655f(_0x390de4._0x1b22e3)](_0x10ae04);}),this['_clampToGround_reload']&&(this['_clampToGround_last']=this['style'][_0x5cd516(_0x490d68._0x2b33e7)]);}['_removedHook'](){const _0x3a478a={_0x15d3a7:0x338},_0x3f84c7=_0x35a251;this['stopDraw'](),this[_0x3f84c7(_0x3a478a._0x15d3a7)](),this['czmObject']&&this[_0x3f84c7(0xad5)]['entities']['remove'](this[_0x3f84c7(0x371)]),this['czmObjectEx']&&this['czmObjectEx'][_0x3f84c7(0xdbd)](_0x4b1042=>{const _0x394443=_0x3f84c7;_0x4b1042 instanceof Cesium__namespace['Entity']&&this[_0x394443(0xad5)]['entities']['remove'](_0x4b1042);}),this[_0x3f84c7(0xbf3)]&&(this['_layer'][_0x3f84c7(0x9b2)]['remove'](this[_0x3f84c7(0xbf3)]),delete this['_primitive_label']);}['_initFromEntity'](_0x53d737){const _0x44423c={_0x4db56b:0x5d9},_0x54dfda=_0x35a251;return _0x53d737[_0x54dfda(_0x44423c._0x4db56b)]&&_0x53d737['entityCollection']['remove'](_0x53d737),_0x53d737['_id']=this['id'],_0x53d737;}['_updateEditDraggers'](){const _0x491d01=_0x35a251;var _0x58fd0a;(_0x58fd0a=this['editing'])!==null&&_0x58fd0a!==void 0x0&&_0x58fd0a[_0x491d01(0x2a6)]&&this['editing']['updateDraggers']();}['_updateStyleBaseHook'](_0x208dd0){const _0x1064ba={_0x28bb8c:0xaa2,_0x50fae6:0x12f,_0x3fbabb:0xa95,_0xa2fa31:0xb35,_0x4ed761:0x149,_0x1d0268:0x6a1},_0x2d89ab=_0x35a251;var _0x3352d4;if(!this['czmObject']||!_0x208dd0)return;if(this['_clampToGround_reload']&&Cesium__namespace[_0x2d89ab(_0x1064ba._0x28bb8c)](_0x208dd0[_0x2d89ab(0x979)])){if(_0x208dd0['clampToGround']!==this['_clampToGround_last']){this['reload'](),this[_0x2d89ab(_0x1064ba._0x50fae6)]=_0x208dd0['clampToGround'];return;}}return(Cesium__namespace['defined'](_0x208dd0['setHeight'])||Cesium__namespace['defined'](_0x208dd0[_0x2d89ab(_0x1064ba._0x3fbabb)]))&&(this['_positions_draw']?(this[_0x2d89ab(_0x1064ba._0xa2fa31)]=this['_positions_draw'],this[_0x2d89ab(_0x1064ba._0x4ed761)](![])):this['positions']=this[_0x2d89ab(0x263)]),this[_0x2d89ab(_0x1064ba._0x1d0268)](this['style'],_0x208dd0),this[_0x2d89ab(0x6d9)](this['style'],_0x208dd0),this['_getOutlinePositions']&&this[_0x2d89ab(0x8c3)](this['_getOutlinePositions'](),this['style']),this[_0x2d89ab(0xaa6)]&&Cesium__namespace['defined'](_0x208dd0['globalAlpha'])&&this['_updateExOpacity'](_0x208dd0['globalAlpha']),this['_isCallbackPositions']&&this['_updateDistanceDisplayConditionByEdit'](),(_0x3352d4=this['editing'])!==null&&_0x3352d4!==void 0x0&&_0x3352d4['enabled']&&this[_0x2d89ab(0xa50)][_0x2d89ab(0x6a1)](_0x208dd0),this;}[_0x35a251(0xa79)](){const _0x44b416={_0x179bab:0x176,_0x1394af:0xc4a,_0x36082b:0xb35,_0x4045f8:0xfc8},_0x54394a=_0x35a251;let _0x256417;const _0xfd25df=this[_0x54394a(_0x44b416._0x179bab)];_0xfd25df?_0x256417=Cesium__namespace[_0x54394a(0x8eb)][_0x54394a(0xeed)](_0xfd25df,new Cesium__namespace['Cartesian3']()):_0x256417=(Cesium__namespace['Ellipsoid']['WGS84'][_0x54394a(0x1c0)]+Cesium__namespace['Ellipsoid']['WGS84']['maximumRadius'])/0x2;this['_isCallbackPositions']?this[_0x54394a(_0x44b416._0x1394af)](_0x256417):this[_0x54394a(0xc4a)]();if(this['_entity_outlines'])for(let _0x57c3e9=0x0,_0x11ede1=this['_entity_outlines']['length'];_0x57c3e9<_0x11ede1;_0x57c3e9++){const _0xc48ee2=this['_entity_outlines'][_0x57c3e9]['polyline'];this[_0x54394a(0xfc8)]['distanceDisplayCondition']?_0xc48ee2[_0x54394a(_0x44b416._0x36082b)]instanceof Cesium__namespace['CallbackProperty']&&this[_0x54394a(_0x44b416._0x4045f8)]['clampToGround']?this['updateOutlinesDistanceDisplayCondition'](_0xc48ee2,_0x256417):this['updateOutlinesDistanceDisplayCondition'](_0xc48ee2):_0xc48ee2[_0x54394a(0x393)]=undefined;}}['updateDistanceDisplayCondition'](_0x17d36d=0x0){const _0x492839=_0x35a251;this['style']['distanceDisplayCondition']?this['entityGraphic']['distanceDisplayCondition']=new Cesium__namespace['DistanceDisplayCondition'](Number((this['style']['distanceDisplayCondition_near']??0x0)+_0x17d36d),Number((this[_0x492839(0xfc8)]['distanceDisplayCondition_far']??Number['MAX_VALUE'])+_0x17d36d)):this['entityGraphic'][_0x492839(0x393)]=undefined;}[_0x35a251(0x5a8)](_0x94c3cd,_0x48bb36=0x0){const _0x183d18={_0x32946a:0x92e},_0x1205be=_0x35a251;_0x94c3cd[_0x1205be(0x393)]=new Cesium__namespace[(_0x1205be(_0x183d18._0x32946a))](Number((this['style']['distanceDisplayCondition_near']??0x0)+_0x48bb36),Number((this['style'][_0x1205be(0xe56)]??Number['MAX_VALUE'])+_0x48bb36));}[_0x35a251(0x6a1)](_0x207816,_0x40d0aa){}['openHighlight'](_0x5f2a23,_0x455d34=!![]){const _0x4f3c40={_0x546e16:0xd79,_0x3ce31a:0x6d9},_0x35879f=_0x35a251;var _0x216186;_0x455d34&&(this['_map']['closeHighlight'](),this[_0x35879f(_0x4f3c40._0x546e16)]['last_highlighGraphic']=this);const _0x1ba110=_0x5f2a23||this['_highlightOptions']||((_0x216186=this['_layer'])===null||_0x216186===void 0x0?void 0x0:_0x216186['_highlightOptions']);if(_0x1ba110){const _0x4da830=[];for(const _0x3747c8 in _0x1ba110){if(_0x3747c8===_0x35879f(0x8ea))continue;!Cesium__namespace['defined'](this['style'][_0x3747c8])&&_0x4da830['push'](_0x3747c8);}_0x4da830['length']>0x0&&logWarn('openHighlight:原有style中不存在以下属性,关闭高亮时将无法恢复',_0x4da830);const _0x4ac14c=merge(clone(this['style']),_0x1ba110);this['_updateStyleHook'](_0x4ac14c,_0x1ba110),this[_0x35879f(_0x4f3c40._0x3ce31a)](_0x4ac14c,_0x1ba110),this['fire'](EventType['highlightOpen'],{},!![]);}}['closeHighlight'](){const _0x43bbdb={_0x5298ba:0xd79,_0x3425a1:0x91b,_0x839a6b:0xd79},_0x33a331=_0x35a251;var _0x22b30b;if(!this['isAdded']||((_0x22b30b=this[_0x33a331(_0x43bbdb._0x5298ba)])===null||_0x22b30b===void 0x0?void 0x0:_0x22b30b[_0x33a331(_0x43bbdb._0x3425a1)])!==this)return;this[_0x33a331(0x6a1)](this['style'],this['style']),this[_0x33a331(0x6d9)](this['style'],this['style']),this[_0x33a331(_0x43bbdb._0x839a6b)]['_clearLastHighlight'](),this['fire'](EventType['highlightClose'],{},!![]);}['_createEntity'](_0xe4622){const _0x57fbf8={_0x26ee44:0xf7,_0x3a3dac:0x6b3,_0x31eea4:0x987,_0x5a67a9:0xf60,_0x16935b:0xe86,_0xd3a28a:0x500,_0x22f15a:0xa49,_0x464ea3:0x605},_0x3ec8c3=_0x35a251;this['options'][_0x3ec8c3(_0x57fbf8._0x26ee44)]&&(_0xe4622=this['options']['onBeforeCreate'](_0xe4622)||_0xe4622);this[_0x3ec8c3(0x40f)]&&(_0xe4622=this['_onBeforeCreate'](_0xe4622)||_0xe4622);const _0x17806c={'id':this['id'],'name':this['name']||this['id'],'properties':this[_0x3ec8c3(_0x57fbf8._0x3a3dac)],'show':this[_0x3ec8c3(_0x57fbf8._0x31eea4)],'parent':this[_0x3ec8c3(0xe86)]['parent']};this['options']['availability']&&(_0x17806c['availability']=this['options'][_0x3ec8c3(_0x57fbf8._0x5a67a9)]);this[_0x3ec8c3(_0x57fbf8._0x16935b)]['description']&&(_0x17806c[_0x3ec8c3(0x500)]=this['options'][_0x3ec8c3(_0x57fbf8._0xd3a28a)]);this['options'][_0x3ec8c3(_0x57fbf8._0x22f15a)]&&(_0x17806c['viewFrom']=this['options']['viewFrom']);this[_0x3ec8c3(0xe86)]['parent']&&(_0x17806c[_0x3ec8c3(_0x57fbf8._0x464ea3)]=this['options'][_0x3ec8c3(_0x57fbf8._0x464ea3)]);const _0xb8bd2f=new Cesium__namespace['Entity']({..._0x17806c,..._0xe4622});return _0xb8bd2f;}['_updateLabelStyleHook'](_0x24928d,_0x414ba2){const _0xaf1044={_0xef86a5:0xaa2,_0x21abd7:0x979,_0x3dcb75:0xaa2,_0x3ac820:0xc04,_0x34dd7d:0x6b3,_0x33f024:0xb61,_0x5f5d7b:0x854,_0x3c3633:0xaa2,_0x2a4595:0x2cf},_0x59274f=_0x35a251;if(_0x414ba2!==null&&_0x414ba2!==void 0x0&&_0x414ba2['label']){Cesium__namespace[_0x59274f(_0xaf1044._0xef86a5)](_0x24928d[_0x59274f(_0xaf1044._0x21abd7)])&&!Cesium__namespace[_0x59274f(_0xaf1044._0x3dcb75)](_0x24928d['label']['clampToGround'])&&(_0x414ba2['label'][_0x59274f(0x979)]=_0x24928d['clampToGround']);if(this['_primitive_label']){var _0x3d8e4f,_0x10b283,_0x270a21,_0x889ff4;LabelStyleConver[_0x59274f(_0xaf1044._0x3ac820)](_0x24928d['label'],this['_primitive_label'],this[_0x59274f(_0xaf1044._0x34dd7d)]),(Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x3d8e4f=_0x414ba2['label'])===null||_0x3d8e4f===void 0x0?void 0x0:_0x3d8e4f[_0x59274f(_0xaf1044._0x33f024)])||Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x10b283=_0x414ba2[_0x59274f(_0xaf1044._0x5f5d7b)])===null||_0x10b283===void 0x0?void 0x0:_0x10b283['height'])||Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x270a21=_0x414ba2[_0x59274f(_0xaf1044._0x5f5d7b)])===null||_0x270a21===void 0x0?void 0x0:_0x270a21['addHeight'])||Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x889ff4=_0x414ba2['label'])===null||_0x889ff4===void 0x0?void 0x0:_0x889ff4['setHeight']))&&this['_updateLabelPosition']();}else{if(this['_entity'][_0x59274f(_0xaf1044._0x5f5d7b)]){var _0x3a6c01,_0x3b2980,_0xc357d6;LabelStyleConver[_0x59274f(0xc04)](_0x24928d['label'],this['_entity']['label'],this['attr']),(Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x3a6c01=_0x414ba2[_0x59274f(0x854)])===null||_0x3a6c01===void 0x0?void 0x0:_0x3a6c01['height'])||Cesium__namespace['defined'](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0x3b2980=_0x414ba2['label'])===null||_0x3b2980===void 0x0?void 0x0:_0x3b2980['addHeight'])||Cesium__namespace[_0x59274f(_0xaf1044._0x3c3633)](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:(_0xc357d6=_0x414ba2['label'])===null||_0xc357d6===void 0x0?void 0x0:_0xc357d6['setHeight']))&&this[_0x59274f(0xdc9)]();}else this[_0x59274f(0x86a)]();}}else Cesium__namespace[_0x59274f(_0xaf1044._0x3dcb75)](_0x414ba2===null||_0x414ba2===void 0x0?void 0x0:_0x414ba2['globalAlpha'])&&this['_updateLabelOpacity'](_0x414ba2[_0x59274f(_0xaf1044._0x2a4595)]);}['_addLabel'](){const _0x36e522={_0x3ed635:0xfc8,_0x11663d:0xe1f,_0x5a842a:0xaa2,_0x3b0785:0x987,_0x430d23:0xbf3,_0xd9b137:0xbf3},_0xc5684d=_0x35a251,_0x1ef773=this[_0xc5684d(_0x36e522._0x3ed635)]['label'];if(!_0x1ef773||!_0x1ef773[_0xc5684d(_0x36e522._0x11663d)])return;Cesium__namespace['defined'](this['style']['clampToGround'])&&!Cesium__namespace[_0xc5684d(_0x36e522._0x5a842a)](_0x1ef773['clampToGround'])&&!Cesium__namespace[_0xc5684d(_0x36e522._0x5a842a)](_0x1ef773['height'])&&(_0x1ef773['clampToGround']=this['style']['clampToGround']);const _0x1472f3=LabelStyleConver['toCesiumVal'](this[_0xc5684d(0xfc8)][_0xc5684d(0x854)],{},this['attr']);return _0x1472f3[_0xc5684d(_0x36e522._0x3b0785)]=this['show'],_0x1472f3['position']=this['_getLablePosition'](),this['_primitive_label']&&this['_layer'][_0xc5684d(0x9b2)]['remove'](this['_primitive_label']),this[_0xc5684d(_0x36e522._0x430d23)]=this['_layer']['labelCollection']['add'](_0x1472f3),this['bindPickId'](this['_primitive_label']),this[_0xc5684d(_0x36e522._0xd9b137)];}['_updateLabelPosition'](){const _0x464b11=_0x35a251;this[_0x464b11(0xbf3)]&&(this['_primitive_label']['position']=this['_getLablePosition']());}['_updateLabelOpacity'](_0x210306){const _0x4bc718=_0x35a251;var _0xe3a4cd;(_0xe3a4cd=this['_entity'])!==null&&_0xe3a4cd!==void 0x0&&_0xe3a4cd[_0x4bc718(0x854)]&&LabelStyleConver['setOpacity'](this[_0x4bc718(0x249)]['label'],_0x210306),this['_primitive_label']&&this[_0x4bc718(0xbf3)]['show']&&LabelStyleConver['setOpacity'](this['_primitive_label'],_0x210306);}[_0x35a251(0x596)](){const _0x47c25e={_0x45c24a:0x6b3,_0x34bc12:0xaa2,_0x5c4880:0xaa2,_0xe0817f:0xfc8,_0x1060cb:0xa95},_0x4c7c27=_0x35a251,_0x586fe7=this['style']['label'];let _0x4fb83b;if(_0x586fe7['position']){if(_0x586fe7['position']===_0x4c7c27(0x176))_0x4fb83b=this['centerOfMass'];else{if(isString(_0x586fe7['position'])){const _0x576cb3=template(_0x586fe7[_0x4c7c27(0xb61)],this[_0x4c7c27(_0x47c25e._0x45c24a)],!![]);_0x576cb3&&(_0x4fb83b=LngLatPoint['parse'](_0x576cb3)['toCartesian']());}else _0x4fb83b=LngLatPoint['parse'](_0x586fe7['position'])[_0x4c7c27(0xa43)]();}}!_0x4fb83b&&(_0x4fb83b=this['center']);if(!_0x4fb83b)return new Cesium__namespace[(_0x4c7c27(0x8eb))]();if(Cesium__namespace[_0x4c7c27(_0x47c25e._0x34bc12)](_0x586fe7['height'])||Cesium__namespace['defined'](this[_0x4c7c27(0xfc8)]['height'])){const _0x5508cc=_0x586fe7['height']??this['style']['height'];_0x4fb83b=setPositionsHeight(_0x4fb83b,_0x5508cc);}Cesium__namespace[_0x4c7c27(_0x47c25e._0x5c4880)](this[_0x4c7c27(_0x47c25e._0xe0817f)]['diffHeight'])&&(_0x4fb83b=addPositionsHeight(_0x4fb83b,this['style']['diffHeight']));let _0xddf917=_0x586fe7['setHeight'];Cesium__namespace['defined'](_0xddf917)&&(isString(_0xddf917)&&(_0xddf917=Number(template(_0xddf917,this['attr'],!![])),isNaN(_0xddf917)&&(_0xddf917=0x0)),_0x4fb83b=setPositionsHeight(_0x4fb83b,_0xddf917));let _0x5b4b03=_0x586fe7[_0x4c7c27(_0x47c25e._0x1060cb)];return Cesium__namespace['defined'](_0x5b4b03)&&(isString(_0x5b4b03)&&(_0x5b4b03=Number(template(_0x5b4b03,this['attr'],!![])),isNaN(_0x5b4b03)&&(_0x5b4b03=0x0)),_0x4fb83b=addPositionsHeight(_0x4fb83b,_0x5b4b03)),_0x4fb83b;}[_0x35a251(0x8b7)](_0x2c0e4e={},_0x555873){const _0x234b87={_0x2e9f52:0x1f0,_0x3e9722:0xe20,_0x765e12:0x2d0,_0x2e44a5:0x534},_0x10fc56={_0x4e5ccb:0x6b3},_0xadd554=_0x35a251;if(_0x2c0e4e['type']&&_0x2c0e4e[_0xadd554(0x8ea)]!=='label'){const _0x4cb187=create$4(_0x2c0e4e['type'],{'position':_0x555873,'style':_0x2c0e4e,'hasEdit':![],'isPrivate':!![]});return Object['defineProperties'](_0x4cb187,{'text':{'set':function(_0x32d832){this['attr']['text']=_0x32d832,this['style']['updateText'](_0x32d832,this);},'get':function(){const _0x56be7e=_0xadd554;return this[_0x56be7e(_0x10fc56._0x4e5ccb)]['text'];}}}),this['_layer']['addGraphic'](_0x4cb187),_0x4cb187;}else{const _0x5c36cc=LabelStyleConver['toCesiumVal']({'color':'#ffffff','font_size':0x14,'outline':!![],'outlineColor':'#000000','outlineWidth':0x3,'background':!![],'backgroundColor':'#000000','backgroundOpacity':0.5,'scaleByDistance':!![],'scaleByDistance_far':0xc3500,'scaleByDistance_farValue':0.5,'scaleByDistance_near':0x3e8,'scaleByDistance_nearValue':0x1,'pixelOffsetY':-0xf,'horizontalOrigin':Cesium__namespace['HorizontalOrigin'][_0xadd554(_0x234b87._0x2e9f52)],'verticalOrigin':Cesium__namespace['VerticalOrigin'][_0xadd554(_0x234b87._0x3e9722)],'visibleDepth':![],..._0x2c0e4e});_0x555873&&(_0x5c36cc['position']=_0x555873);const _0x1e8e26=this[_0xadd554(_0x234b87._0x765e12)]['labelCollection']['add'](_0x5c36cc);return this[_0xadd554(_0x234b87._0x2e44a5)](_0x1e8e26),_0x1e8e26['_noMousePick']=!![],_0x1e8e26[_0xadd554(0xb70)]=![],_0x1e8e26;}}['_removeLabel'](_0x4942ee){const _0x9cd30b={_0x347210:0x1ee},_0x432d2=_0x35a251;_0x4942ee['isAdded']?this['_layer']['removeGraphic'](_0x4942ee,!![]):this['_layer'][_0x432d2(0x9b2)][_0x432d2(_0x9cd30b._0x347210)](_0x4942ee);}['_getOutlineStyle'](_0x1ab21b,_0x16368a){const _0x270547={_0x1663b6:0xa31,_0x1f6249:0xf5d,_0x56fbef:0x581},_0x55ca81=_0x35a251,_0x288fac={..._0x1ab21b};return delete _0x288fac['material'],delete _0x288fac['materialType'],delete _0x288fac[_0x55ca81(_0x270547._0x1663b6)],delete _0x288fac['outline'],delete _0x288fac['outlineColor'],delete _0x288fac['outlineOpacity'],delete _0x288fac[_0x55ca81(_0x270547._0x1f6249)],delete _0x288fac['outlineStyle'],{..._0x288fac,'show':_0x1ab21b['outline']??![],'color':_0x1ab21b[_0x55ca81(0x218)]??Cesium__namespace['Color']['WHITE'],'opacity':_0x1ab21b['outlineOpacity'],'width':_0x1ab21b['outlineWidth']??0x1,'arcType':_0x1ab21b['arcType']??_0x1ab21b['clampToGround']?Cesium__namespace['ArcType']['GEODESIC']:Cesium__namespace[_0x55ca81(_0x270547._0x56fbef)]['NONE'],..._0x1ab21b['outlineStyle']||{},..._0x16368a||{}};}['_updateOutlineStyle'](_0xef39df,_0x2a5889,_0x54f153){const _0x49ba65={_0x2bf9bc:0xd93,_0x2a75b0:0x4f7,_0x246520:0x8bb,_0x38fe13:0x18a,_0x680c65:0xaa2,_0x3867de:0xb3a,_0x2ba4a0:0xb35,_0x1f35d8:0xaa2,_0x1f455a:0x93a,_0x1baeb4:0x5a1},_0x2a0cde=_0x35a251;var _0xc8e62d;if(!this['entityGraphic'])return;const _0x2d4f1d=this[_0x2a0cde(_0x49ba65._0x2bf9bc)](_0x2a5889,_0x54f153);if(_0x2d4f1d['show']&&(this[_0x2a0cde(0xfc8)][_0x2a0cde(_0x49ba65._0x2a75b0)]??0x0)===0x0&&(_0x2d4f1d['width']>0x1||_0x2a5889['clampToGround']||((_0xc8e62d=this[_0x2a0cde(0x8bb)])===null||_0xc8e62d===void 0x0?void 0x0:_0xc8e62d['length'])>0x0)){this['entityGraphic']['outline']=![];if(this[_0x2a0cde(_0x49ba65._0x246520)])for(let _0x327c10=0x0,_0xcfe32e=this['_entity_outlines']['length'];_0x327c10<_0xcfe32e;_0x327c10++){const _0x10b6d5=this[_0x2a0cde(0x8bb)][_0x327c10]['polyline'];if(_0xef39df&&_0xef39df[_0x327c10]){let _0xdb315e=_0xef39df[_0x327c10];if(_0xdb315e instanceof Cesium__namespace[_0x2a0cde(_0x49ba65._0x38fe13)])_0x10b6d5['positions']=_0xdb315e;else Array['isArray'](_0xdb315e)&&_0xdb315e[_0x2a0cde(0xe1e)]>0x0&&(Cesium__namespace[_0x2a0cde(_0x49ba65._0x680c65)](_0x2d4f1d['height'])&&(_0xdb315e=setPositionsHeight(_0xdb315e,_0x2d4f1d['height'])),Cesium__namespace['defined'](_0x2d4f1d['setHeight'])&&(_0xdb315e=setPositionsHeight(_0xdb315e,_0x2d4f1d['setHeight'])),Cesium__namespace['defined'](_0x2d4f1d['addHeight'])&&(_0xdb315e=addPositionsHeight(_0xdb315e,_0x2d4f1d['addHeight'])),_0x2d4f1d[_0x2a0cde(_0x49ba65._0x3867de)]??!![]?_0x10b6d5[_0x2a0cde(_0x49ba65._0x2ba4a0)]=_0xdb315e['concat'](_0xdb315e[0x0]):_0x10b6d5['positions']=_0xdb315e);}PolylineStyleConver['toCesiumVal'](_0x2d4f1d,_0x10b6d5,!![]);}else{if(_0xef39df){this['_entity_outlines']=[];for(let _0x1e9ee9=0x0,_0x669a2a=_0xef39df['length'];_0x1e9ee9<_0x669a2a;_0x1e9ee9++){let _0xa03e1c=_0xef39df[_0x1e9ee9];const _0xec98b9=PolylineStyleConver['toCesiumVal'](_0x2d4f1d,{},!![]);if(_0xa03e1c instanceof Cesium__namespace['CallbackProperty'])_0xec98b9[_0x2a0cde(_0x49ba65._0x2ba4a0)]=_0xa03e1c;else Array['isArray'](_0xa03e1c)&&_0xa03e1c[_0x2a0cde(0xe1e)]>0x0&&(Cesium__namespace[_0x2a0cde(_0x49ba65._0x1f35d8)](_0x2d4f1d['height'])&&(_0xa03e1c=setPositionsHeight(_0xa03e1c,_0x2d4f1d['height'])),Cesium__namespace['defined'](_0x2d4f1d['setHeight'])&&(_0xa03e1c=setPositionsHeight(_0xa03e1c,_0x2d4f1d[_0x2a0cde(0xdaa)])),Cesium__namespace[_0x2a0cde(0xaa2)](_0x2d4f1d['addHeight'])&&(_0xa03e1c=addPositionsHeight(_0xa03e1c,_0x2d4f1d['addHeight'])),_0x2d4f1d['closure']??!![]?_0xec98b9[_0x2a0cde(_0x49ba65._0x2ba4a0)]=_0xa03e1c[_0x2a0cde(_0x49ba65._0x1f455a)](_0xa03e1c[0x0]):_0xec98b9[_0x2a0cde(0xb35)]=_0xa03e1c);const _0x2c4f90=this['_createEntity']({'id':this['id']+_0x2a0cde(0x2ff)+_0x1e9ee9,'polyline':_0xec98b9,'show':this['show']});this[_0x2a0cde(0x534)](_0x2c4f90),this['_entity_outlines']['push'](_0x2c4f90),this['isAdded']&&this['dataSource']['entities'][_0x2a0cde(0x4af)](_0x2c4f90);}}}return!![];}else{if(this[_0x2a0cde(_0x49ba65._0x246520)])for(let _0x5ba5e8=0x0,_0x5e3694=this['_entity_outlines']['length'];_0x5ba5e8<_0x5e3694;_0x5ba5e8++){const _0x1742ed=this['_entity_outlines'][_0x5ba5e8]['polyline'];_0x1742ed['show']=![];}return this['entityGraphic']['outline']=_0x2d4f1d['show'],this[_0x2a0cde(_0x49ba65._0x1baeb4)]['outlineWidth']=_0x2d4f1d['width'],_0x2d4f1d['show']&&(this['entityGraphic']['outlineColor']=getCesiumColor(_0x2d4f1d['color'],Cesium__namespace['Color']['WHITE'])),![];}}[_0x35a251(0xce6)](_0x26d729){const _0x358869={_0x1aca72:0x7ec,_0x2a4f34:0x5a1,_0x2abb7a:0x373},_0x19bb7c=_0x35a251;var _0x530c18;if(this[_0x19bb7c(0x8bb)]&&this['_entity_outlines']['length']>0x0)for(let _0x2e9d1f=0x0,_0x38ed22=this['_entity_outlines']['length'];_0x2e9d1f<_0x38ed22;_0x2e9d1f++){var _0x1411b0;const _0x3024f3=this['_entity_outlines'][_0x2e9d1f][_0x19bb7c(0x282)];Cesium__namespace[_0x19bb7c(0xaa2)](_0x3024f3===null||_0x3024f3===void 0x0?void 0x0:(_0x1411b0=_0x3024f3['material'])===null||_0x1411b0===void 0x0?void 0x0:_0x1411b0['globalAlpha'])?_0x3024f3['material']['globalAlpha']=_0x26d729:this['_updateOutlineStyle'](null,this['style']);}if((_0x530c18=this['entityGraphic'])!==null&&_0x530c18!==void 0x0&&_0x530c18['outline']&&this['entityGraphic']['outline'][_0x19bb7c(_0x358869._0x1aca72)]()){const _0x17c0e5=getCesiumColor(this['entityGraphic']['outlineColor'],Cesium__namespace['Color'][_0x19bb7c(0x9a2)]);!Cesium__namespace['defined'](this[_0x19bb7c(_0x358869._0x2a4f34)]['_outlineColor_alpha'])&&(this['entityGraphic'][_0x19bb7c(0x71b)]=_0x17c0e5['alpha']),this[_0x19bb7c(0x5a1)]['outlineColor']=_0x17c0e5[_0x19bb7c(_0x358869._0x2abb7a)](this[_0x19bb7c(0x5a1)]['_outlineColor_alpha']*_0x26d729);}}['_updateOutlineToCallback'](){const _0x445b60={_0x1b86e2:0x8bb},_0x2455d5=_0x35a251;if(this['_entity_outlines'])for(let _0x24cda6=0x0,_0x35a2f2=this[_0x2455d5(_0x445b60._0x1b86e2)]['length'];_0x24cda6<_0x35a2f2;_0x24cda6++){const _0x2f4c55=this['_entity_outlines'][_0x24cda6];if(_0x2f4c55['polyline'][_0x2455d5(0xb35)]instanceof Cesium__namespace['CallbackProperty'])continue;_0x2f4c55[_0x2455d5(0x282)]['positions']=new Cesium__namespace[(_0x2455d5(0x18a))](_0x2b11a8=>{const _0x31ab65=_0x2455d5;return this[_0x31ab65(0xec)];},![]);}}['_cancelOutlinePositionsCallback'](){const _0x4befd2=_0x35a251;if(this['_entity_outlines'])for(let _0x1490d6=0x0,_0x4dc391=this[_0x4befd2(0x8bb)][_0x4befd2(0xe1e)];_0x1490d6<_0x4dc391;_0x1490d6++){const _0x23445c=this['_entity_outlines'][_0x1490d6];if(!(_0x23445c['polyline'][_0x4befd2(0xb35)]instanceof Cesium__namespace['CallbackProperty']))continue;_0x23445c['polyline']['positions']=this[_0x4befd2(0xec)];}}[_0x35a251(0x45c)](_0x1200ef){const _0x59de35={_0x428ccc:0xfc8,_0xde186c:0x2cf,_0x1414a8:0xaa6},_0x53d78b=_0x35a251;this[_0x53d78b(_0x59de35._0x428ccc)][_0x53d78b(_0x59de35._0xde186c)]=_0x1200ef;const _0x19fcff=this[_0x53d78b(0xfa4)](this[_0x53d78b(0x5a1)],_0x1200ef);if(_0x19fcff){this[_0x53d78b(0x969)](_0x1200ef),this[_0x53d78b(0xce6)](_0x1200ef),this[_0x53d78b(_0x59de35._0x1414a8)]&&this['_updateExOpacity'](_0x1200ef);return;}super['setOpacity'](_0x1200ef);}[_0x35a251(0xfa4)](_0x2c5bea,_0x3b135d){const _0xd2319a={_0x542e83:0x27f,_0x4c719a:0x446,_0x131bdd:0x1f4},_0x2c6caa=_0x35a251,_0x429396=_0x2c5bea===null||_0x2c5bea===void 0x0?void 0x0:_0x2c5bea[_0x2c6caa(_0xd2319a._0x542e83)];if(!_0x429396)return![];if(Cesium__namespace['defined'](_0x429396===null||_0x429396===void 0x0?void 0x0:_0x429396['globalAlpha']))return _0x429396[_0x2c6caa(0x2cf)]=_0x3b135d,!![];if(_0x429396['_mars_type']==='Color'||_0x429396['_mars_type']===_0x2c6caa(_0xd2319a._0x4c719a)){const _0x92db0=getCesiumColor(_0x429396['color'],Cesium__namespace['Color'][_0x2c6caa(0x9a2)]);return!Cesium__namespace[_0x2c6caa(0xaa2)](_0x429396['_color_alpha'])&&(_0x429396[_0x2c6caa(0x326)]=_0x92db0[_0x2c6caa(_0xd2319a._0x131bdd)]),_0x429396['color']=_0x92db0[_0x2c6caa(0x373)](_0x429396['_color_alpha']*_0x3b135d),!![];}return![];}[_0x35a251(0x66a)](_0x2752ce){const _0x177ff1=_0x35a251;!this[_0x177ff1(0x6c0)]&&(this['flickerEntity']=new FlickerEntity());const _0x34fb40=this['czmObjectEx'][_0x177ff1(0x93a)](this[_0x177ff1(0x371)]);return this['flickerEntity']['startFlicker'](_0x34fb40,_0x2752ce),this['flickerEntity'];}[_0x35a251(0xc73)](){const _0x3efcfe={_0x5b4bfb:0x6c0},_0x2eee91=_0x35a251;return this[_0x2eee91(_0x3efcfe._0x5b4bfb)]?this['flickerEntity']['stopFlicker']():null;}['startDraw'](_0x195356){const _0x3ad01d={_0x10b446:0xd79,_0x5585e8:0x43e,_0x311b5c:0xe86,_0x588a2d:0xd79,_0x278bd0:0x492},_0x504572=_0x35a251;if(this['_enabledDraw'])return this;this['_enabledDraw']=!![];_0x195356&&this['addTo'](_0x195356);if(!this[_0x504572(_0x3ad01d._0x10b446)])throw new Error(_0x504572(0x6af));this['_drawEndEventType']=_0x195356['options']['drawEndEventType']??EventType[_0x504572(_0x3ad01d._0x5585e8)],this[_0x504572(0xc1c)]=_0x195356[_0x504572(_0x3ad01d._0x311b5c)]['drawDelEventType']??EventType['rightClick'],this['_map'][_0x504572(0xb0)]['noPickEntity']=this['_entity'],this[_0x504572(_0x3ad01d._0x588a2d)][_0x504572(_0x3ad01d._0x278bd0)](!![]),this[_0x504572(0xa4f)](![]),this['_setPositionsToCallback'](),this['_startDrawHook'](),this[_0x504572(0x264)](EventType['drawStart'],{'drawtype':this[_0x504572(0x8ea)],'graphic':this},!![]);}[_0x35a251(0x77c)](){const _0x5c14a1={_0x5ed3a6:0xd79,_0x1721b9:0x5bd,_0x942637:0xe1e,_0x3c7425:0x1d0,_0x3866eb:0x937,_0x122df3:0xe86,_0x22f9f3:0x264,_0x38c10c:0xe86,_0x531a3d:0xf13},_0x42c0cf=_0x35a251;var _0x36b1be,_0x8860b5,_0x54df8f,_0x37f068;if(!this['_enabledDraw'])return this;this['_stopDrawHook'](),this['_updateLabelPosition'](),this['_map'][_0x42c0cf(0x492)](![]),this['enableControl'](!![]),this['_map']['closeSmallTooltip'](),this[_0x42c0cf(_0x5c14a1._0x5ed3a6)]['mouseEvent'][_0x42c0cf(_0x5c14a1._0x1721b9)]=null,this[_0x42c0cf(0x5f2)]=![];if(this['lastPointTemporary']){var _0x3670a1;((_0x3670a1=this['_positions_draw'])===null||_0x3670a1===void 0x0?void 0x0:_0x3670a1[_0x42c0cf(_0x5c14a1._0x942637)])>0x0&&this[_0x42c0cf(0x937)]['pop'](),this['_position_draw']&&(this[_0x42c0cf(_0x5c14a1._0x3c7425)]=undefined);}this['lastPointTemporary']=![];if(!this['_position_draw']&&(!this['_positions_draw']||((_0x36b1be=this[_0x42c0cf(_0x5c14a1._0x3866eb)])===null||_0x36b1be===void 0x0?void 0x0:_0x36b1be['length'])===0x0))return this['remove'](!![]),undefined;if(this[_0x42c0cf(_0x5c14a1._0x3866eb)]&&this['_positions_draw'][_0x42c0cf(0xe1e)]=this['_maxPointNum'])this[_0x15dcf0(_0x5801a8._0x4020cc)]['openSmallTooltip'](_0x2208e0,this[_0x15dcf0(0xd79)]['getLangText']('_单击完成绘制'));else{let _0x3ad168;if(isPCBroswer()){let _0x545d5a='';(this['options']['hasDrawDelPoint']??!![])&&(_0x545d5a=',\x20'+this[_0x15dcf0(_0x5801a8._0x4020cc)]['getLangText']('_右击删除点')),_0x3ad168=this[_0x15dcf0(_0x5801a8._0x4020cc)][_0x15dcf0(0x44e)]('_单击增加点')+_0x545d5a+'
'+this['_map']['getLangText']('_双击完成绘制');}else _0x3ad168=this[_0x15dcf0(_0x5801a8._0x4020cc)]['getLangText']('_单击增加点');this['_map']['openSmallTooltip'](_0x2208e0,_0x3ad168);}}}}[_0x35a251(0x3b4)](_0x535a3c){const _0x25a8dc={_0x15c6c6:0x4bb,_0x3b97c5:0xe86,_0x5a5fe6:0x8ea,_0x1b6882:0x937},_0x16e918=_0x35a251;this['_showDrawMouseMoveSmallTooltip'](_0x535a3c);const _0x3103e9=_0x535a3c[_0x16e918(_0x25a8dc._0x15c6c6)];if(_0x3103e9){if(this['options']['validDrawPosition']){const _0x3cd6b2=this[_0x16e918(_0x25a8dc._0x3b97c5)]['validDrawPosition'](_0x3103e9,this);if(!_0x3cd6b2)return;}this[_0x16e918(0x583)]&&this['_positions_draw']['pop'](),this['lastPointTemporary']=!![],this['_positions_draw']['push'](_0x3103e9),this['updateAttrForDrawing'](![]),this['fire'](EventType[_0x16e918(0xc48)],{..._0x535a3c,'drawtype':this[_0x16e918(_0x25a8dc._0x5a5fe6)],'positions':this[_0x16e918(_0x25a8dc._0x1b6882)]},!![]);}}['_onClickHandler'](_0x303861){const _0x4ce224={_0x711db6:0xc90,_0x2fc43f:0xf80,_0x165aea:0xd14,_0x33eec3:0x4bb,_0x1c7084:0xe86,_0x449249:0xfaf},_0x1bc71c=_0x35a251,_0x16dd73=new Date()['getTime']()-(this[_0x1bc71c(_0x4ce224._0x711db6)]||0x0);if(this['_last_clickTime']&&_0x16dd73<0xc8)return;this['_last_clickTime']=new Date()['getTime']();if(this[_0x1bc71c(_0x4ce224._0x2fc43f)]&&Math['abs'](this['_last_clickPositionX']-_0x303861[_0x1bc71c(_0x4ce224._0x165aea)]['x'])<0xa&&Math[_0x1bc71c(0x405)](this['_last_clickPositionY']-_0x303861[_0x1bc71c(0xd14)]['y'])<0xa)return;this['_last_clickPositionX']=_0x303861['windowPosition']['x'],this['_last_clickPositionY']=_0x303861[_0x1bc71c(0xd14)]['y'];let _0x410737=_0x303861[_0x1bc71c(_0x4ce224._0x33eec3)];!_0x410737&&this['lastPointTemporary']&&(_0x410737=this['_positions_draw'][this['_positions_draw'][_0x1bc71c(0xe1e)]-0x1]);if(_0x410737){var _0x1f659a;if(this['options']['validDrawPosition']){const _0x1a782a=this[_0x1bc71c(_0x4ce224._0x1c7084)]['validDrawPosition'](_0x410737,this);if(!_0x1a782a)return;}this['lastPointTemporary']&&this['_positions_draw']['pop'](),this['lastPointTemporary']=![],this[_0x1bc71c(_0x4ce224._0x449249)](),(_0x1f659a=this['options'])!==null&&_0x1f659a!==void 0x0&&_0x1f659a['addHeight']&&(_0x410737=addPositionsHeight(_0x410737,this['options'][_0x1bc71c(0xa95)])),this['_positions_draw']['push'](_0x410737),this['updateAttrForDrawing'](![]),!isPCBroswer()&&this['_showDrawMouseMoveSmallTooltip'](_0x303861),this['fire'](EventType['drawAddPoint'],{..._0x303861,'drawtype':this['type'],'positions':this['_positions_draw']},!![]),this['_positions_draw']['length']>=this['_maxPointNum']&&this['stopDraw']();}}[_0x35a251(0x82f)](_0x216a4e){const _0x196938={_0x332265:0x4bb},_0x370817=_0x35a251;this['_positions_draw']['pop']();const _0x51e337=_0x216a4e[_0x370817(_0x196938._0x332265)];_0x51e337&&(this['lastPointTemporary']&&this['_positions_draw']['pop'](),this['lastPointTemporary']=!![],this['fire'](EventType['drawRemovePoint'],{..._0x216a4e,'drawtype':this['type'],'positions':this['_positions_draw']},!![]),this['_positions_draw']['push'](_0x51e337),this['updateAttrForDrawing'](![]));}['_onDbClickHandler'](_0x21ffb3){const _0x5baefa={_0x36269d:0x43e},_0x1d876a=_0x35a251;_0x21ffb3[_0x1d876a(0x8ea)]!==EventType[_0x1d876a(_0x5baefa._0x36269d)]&&(this['lastPointTemporary']=![]),this['removeNearPoint'](),this['endDraw']();}[_0x35a251(0xfaf)](){const _0x37d348={_0x33f7c9:0x937,_0x391c86:0xe1e,_0x10a15b:0x937,_0x2b74e5:0xeed},_0x5a082c=_0x35a251;if(this[_0x5a082c(_0x37d348._0x33f7c9)]['length']<0x3)return;for(let _0x12af6b=this['_positions_draw'][_0x5a082c(_0x37d348._0x391c86)]-0x1;_0x12af6b>0x0;_0x12af6b--){const _0x5e5548=this[_0x5a082c(0x937)][_0x12af6b],_0x4648c0=this[_0x5a082c(_0x37d348._0x10a15b)][_0x12af6b-0x1],_0x3f92cb=Cesium__namespace['Cartesian3'][_0x5a082c(_0x37d348._0x2b74e5)](_0x5e5548,_0x4648c0);if(_0x3f92cb<0.01)this['_positions_draw']['splice'](_0x12af6b,0x1);else break;}}['endDraw'](){const _0x30e421={_0x491da0:0x920,_0x5adfaa:0x149},_0x4daee0=_0x35a251;if(!this['_enabledDraw'])return![];if(this['_positions_draw']&&this['_positions_draw']['length']0x1&&(this[_0x23401f(_0x35060a._0x14bee5)]['diffHeight']??0x0)===0x0||_0x490814[_0x23401f(_0x35060a._0x51e946)]?this['_primitive_outline']=this[_0x23401f(_0x35060a._0x593432)](_0x490814):(_0x106d07['outlineStyle']=_0x490814,this[_0x23401f(_0x35060a._0x2901be)]=this['_createPrimitive'](_0x106d07,!![]));}_0x48e112[_0x23401f(0x854)]&&this['_addLabel']();}['_removedHook'](){const _0x7dedc5={_0x555558:0x77c,_0x15030f:0x90a,_0x1df3e0:0x3e5},_0x5b2b29=_0x35a251;!this['_noDestroy']&&(this[_0x5b2b29(_0x7dedc5._0x555558)](),this['stopEditing']()),this['_primitive']&&(this['primitiveCollection']['remove'](this['_primitive']),delete this[_0x5b2b29(_0x7dedc5._0x15030f)]),this[_0x5b2b29(0x3e5)]&&(this['primitiveCollection']['remove'](this[_0x5b2b29(_0x7dedc5._0x1df3e0)]),delete this['_primitive_outline']),this['_primitive_label']&&(this['_layer']['labelCollection']['remove'](this['_primitive_label']),delete this[_0x5b2b29(0xbf3)]);}['_showHook'](_0x2efe4d){const _0x22b16c={_0x5b0248:0xdbd},_0x352d69=_0x35a251;if(!this['isAdded'])return;_0x2efe4d?(this[_0x352d69(0x97b)](this[_0x352d69(0xfc8)]),this['czmObject']&&this['bindPickId'](this['czmObject']),this['czmObjectEx']&&this['czmObjectEx'][_0x352d69(_0x22b16c._0x5b0248)](_0x1c4d5e=>{this['bindPickId'](_0x1c4d5e);})):(this['_noDestroy']=!![],this['_removedHook'](),this['_noDestroy']=![]);}['_conversionStyle'](_0x5001dd){return _0x5001dd;}['_createPrimitive'](_0x1dba56,_0x398f74){const _0x4c4e38={_0x41ce7f:0xe86,_0x9b58f:0x9aa,_0x5ef64c:0x393,_0x191c8c:0x2c2,_0x32f0b0:0xfc8,_0x2bfbe5:0x8ea,_0xefb392:0x748,_0x168890:0x4af},_0x21ed22=_0x35a251;(!_0x1dba56['vertexFormat']&&_0x1dba56['_isColorMaterial']||_0x398f74)&&(_0x1dba56['vertexFormat']=this['defaultVertexFormat']||Cesium__namespace['PerInstanceColorAppearance']['VERTEX_FORMAT']);const _0x392340={...this[_0x21ed22(_0x4c4e38._0x41ce7f)],'geometryInstances':this['_createGeometryInstance'](_0x1dba56,_0x398f74),'show':this['show'],'shadows':_0x1dba56['shadows']};delete _0x392340['style'],delete _0x392340['attr'],delete _0x392340['modelMatrix'],_0x392340['geometryInstances']['attributes']=_0x392340['geometryInstances'][_0x21ed22(0x523)]||{},_0x392340[_0x21ed22(_0x4c4e38._0x9b58f)][_0x21ed22(0x523)]['show']=new Cesium__namespace['ShowGeometryInstanceAttribute'](this['show']);_0x1dba56['distanceDisplayCondition']&&(_0x392340['geometryInstances']['attributes'][_0x21ed22(0x393)]=_0x1dba56[_0x21ed22(_0x4c4e38._0x5ef64c)]);!_0x392340['appearance']&&(_0x392340['appearance']=this[_0x21ed22(0x2c2)](_0x1dba56,_0x392340,_0x398f74));_0x1dba56['depthFail']&&!_0x392340['depthFailAppearance']&&(_0x392340['depthFailAppearance']=this[_0x21ed22(_0x4c4e38._0x191c8c)](_0x1dba56,_0x392340,_0x398f74));let _0x4b9e5e;if(this[_0x21ed22(_0x4c4e38._0x32f0b0)]['clampToGround'])_0x392340['classificationType']=_0x1dba56['classificationType'],this[_0x21ed22(_0x4c4e38._0x2bfbe5)]==='polylineP'||this['type']===_0x21ed22(0xf71)?_0x4b9e5e=this[_0x21ed22(0x293)]['add'](new Cesium__namespace['GroundPolylinePrimitive'](_0x392340)):_0x4b9e5e=this[_0x21ed22(0x293)]['add'](new Cesium__namespace[(_0x21ed22(_0x4c4e38._0xefb392))](_0x392340));else _0x1dba56['classification']?(_0x392340['classificationType']=_0x1dba56['classificationType']||Cesium__namespace['ClassificationType']['CESIUM_3D_TILE'],_0x4b9e5e=this['primitiveCollection']['add'](new Cesium__namespace['ClassificationPrimitive'](_0x392340))):_0x4b9e5e=this['primitiveCollection'][_0x21ed22(_0x4c4e38._0x168890)](new Cesium__namespace[(_0x21ed22(0x21c))](_0x392340));return this[_0x21ed22(0x534)](_0x4b9e5e),_0x4b9e5e;}['_getColorByColorMaterial'](_0x3b469f,_0x453746=Cesium__namespace['Color']['WHITE'][_0x35a251(0x373)](0.5)){const _0x1232d5={_0x1c9fbf:0xa8b},_0x4bb3de=_0x35a251;var _0x408da3,_0x63c928,_0x3ab3e0,_0x3e4b2c;return((_0x408da3=_0x3b469f['material'])===null||_0x408da3===void 0x0?void 0x0:(_0x63c928=_0x408da3[_0x4bb3de(_0x1232d5._0x1c9fbf)])===null||_0x63c928===void 0x0?void 0x0:_0x63c928['color'])||((_0x3ab3e0=_0x3b469f[_0x4bb3de(0x27f)])===null||_0x3ab3e0===void 0x0?void 0x0:(_0x3e4b2c=_0x3ab3e0['options'])===null||_0x3e4b2c===void 0x0?void 0x0:_0x3e4b2c['color'])||_0x3b469f['color']||_0x453746;}['_createAppearance'](_0x157cf2,_0x39c108,_0xe31f23){const _0x3c3c18={_0x54e1b8:0x768,_0x2a9ad9:0x9aa,_0x19c00e:0x6f9,_0x280ab9:0x239,_0x3c7743:0x6f9},_0x2ee771=_0x35a251;if(_0x157cf2['material']&&!_0x157cf2['_isColorMaterial']&&!_0xe31f23)return new Cesium__namespace[(_0x2ee771(_0x3c3c18._0x54e1b8))]({..._0x157cf2});else{if(_0x39c108['geometryInstances']instanceof Cesium__namespace['GeometryInstance']){let _0x314398;_0xe31f23&&_0x157cf2['outlineStyle']?_0x314398=getColorByStyle(_0x157cf2['outlineStyle'],Cesium__namespace['Color']['WHITE']):_0x314398=this['_getColorByColorMaterial'](_0x157cf2),_0x157cf2['translucent']=_0x314398['alpha']!==0x1,_0x39c108[_0x2ee771(_0x3c3c18._0x2a9ad9)]['attributes']=_0x39c108[_0x2ee771(0x9aa)]['attributes']||{},_0x39c108[_0x2ee771(_0x3c3c18._0x2a9ad9)]['attributes']['color']=Cesium__namespace[_0x2ee771(0x71a)][_0x2ee771(_0x3c3c18._0x19c00e)](_0x314398),_0x157cf2[_0x2ee771(0xb53)]&&(_0x39c108['geometryInstances']['attributes'][_0x2ee771(_0x3c3c18._0x280ab9)]=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x2ee771(_0x3c3c18._0x3c7743)](_0x157cf2['depthFailColor']||_0x314398));}return Cesium__namespace['defined'](this['translucent'])&&(_0x157cf2['translucent']=this[_0x2ee771(0x6e7)]),new Cesium__namespace[(_0x2ee771(0x1a7))]({..._0x157cf2});}}['_createGeometryInstance'](_0x8b070a,_0x14a169){return this['options']['geometryInstances'];}[_0x35a251(0x68d)](_0x1653a5,_0x29df0a){const _0x4f20ac={_0x5ae3f6:0xfc8,_0x305df0:0x4f7,_0x31d535:0x552,_0x5807e6:0x682},_0x35541e=_0x35a251;if(this['style']['clampToGround'])return;if(_0x29df0a){let _0x32b1f7=0x0;Cesium__namespace['defined'](this['style']['height'])?_0x32b1f7=this['style']['height']:_0x32b1f7=getMaxHeight(this['positions']),_0x1653a5['height']=_0x32b1f7;}if(Cesium__namespace['defined'](this[_0x35541e(_0x4f20ac._0x5ae3f6)][_0x35541e(_0x4f20ac._0x305df0)])&&!Cesium__namespace['defined'](_0x1653a5[_0x35541e(_0x4f20ac._0x31d535)])){let _0xd4b41f=0x0;if(Cesium__namespace[_0x35541e(0xaa2)](_0x1653a5['height']))_0xd4b41f=_0x1653a5['height'];else Cesium__namespace[_0x35541e(0xaa2)](this['style']['height'])?_0xd4b41f=this[_0x35541e(0xfc8)][_0x35541e(_0x4f20ac._0x5807e6)]:_0xd4b41f=getMaxHeight(this['positions']);_0x1653a5['extrudedHeight']=_0xd4b41f+this[_0x35541e(_0x4f20ac._0x5ae3f6)][_0x35541e(_0x4f20ac._0x305df0)];}}['_updateStyleBaseHook'](_0x590f6a){const _0x52db3e={_0x3b8d66:0x371,_0x2e1872:0xaa6,_0x4005af:0xaa2,_0x272895:0xdaa,_0x2eda0b:0x6a1},_0x325417=_0x35a251;if(!_0x590f6a)return;if(this['_editing_entity']&&this['type']['startsWith'](this['_editing_entity']['type']))this['_editing_entity']['setStyle'](_0x590f6a);else this[_0x325417(_0x52db3e._0x3b8d66)]&&(this['_updateLabelStyleHook'](this['style'],_0x590f6a),this['_updateExOpacity']&&Cesium__namespace['defined'](_0x590f6a['globalAlpha'])&&this[_0x325417(_0x52db3e._0x2e1872)](_0x590f6a['globalAlpha']),(Cesium__namespace[_0x325417(_0x52db3e._0x4005af)](_0x590f6a[_0x325417(_0x52db3e._0x272895)])||Cesium__namespace['defined'](_0x590f6a['addHeight']))&&(this['positions']=this['positionsShow']),this[_0x325417(_0x52db3e._0x2eda0b)](this['style'],_0x590f6a));}['_updateStyleHook'](_0x33a322,_0x4e47fb){const _0x5c40ba={_0x1c43e7:0x472},_0x45c755=_0x35a251;if(_0x33a322[_0x45c755(_0x5c40ba._0x1c43e7)]===Color$2&&(Cesium__namespace['defined'](_0x4e47fb['color'])||Cesium__namespace['defined'](_0x4e47fb['opacity']))){const _0x4a8482=getColorByStyle(_0x33a322);if(_0x4a8482){const _0xb8e01=this['_updatePrimitiveForColorMaterial'](this[_0x45c755(0x90a)],_0x4a8482,_0x33a322);if(_0xb8e01){if(Cesium__namespace['defined'](_0x4e47fb[_0x45c755(0xb83)])){if(this['_primitive_outline']){const _0x3da799=this['_getOutlineStyle'](_0x33a322);if(!_0x3da799['materialType']){if(_0x3da799['show']){const _0x2fc57e=this['_updatePrimitiveForColorMaterial'](this['_primitive_outline'],getCesiumColor(_0x3da799['color']),_0x33a322);if(_0x2fc57e)return;}else{this['_primitive_outline']&&(this['primitiveCollection']['remove'](this['_primitive_outline']),delete this['_primitive_outline']);return;}}}}else return;}}}this['redraw'](_0x33a322);}['_updatePrimitiveForColorMaterial'](_0x55d389,_0x25a0d8,_0x556ab8){const _0x24c8d8={_0x3a48c2:0xaa2,_0x342e42:0x6e7,_0x32554b:0xa08},_0x154377=_0x35a251;var _0x318a31,_0x379d61;if(!_0x55d389)return![];const _0xb0a559=_0x55d389===null||_0x55d389===void 0x0?void 0x0:(_0x318a31=_0x55d389[_0x154377(0xf8)])===null||_0x318a31===void 0x0?void 0x0:(_0x379d61=_0x318a31[_0x154377(0x27f)])===null||_0x379d61===void 0x0?void 0x0:_0x379d61['uniforms'];if(Cesium__namespace[_0x154377(_0x24c8d8._0x3a48c2)](_0xb0a559===null||_0xb0a559===void 0x0?void 0x0:_0xb0a559['color'])&&_0x55d389['appearance']['material'][_0x154377(0x8ea)]===Color$2)return _0x55d389['appearance'][_0x154377(_0x24c8d8._0x342e42)]=_0x25a0d8['alpha']!==0x1,_0xb0a559['color']=_0x25a0d8,!![];const _0x2a4120=this['getGeometryInstanceAttributes'](this['id'],_0x55d389);if(_0x2a4120!==null&&_0x2a4120!==void 0x0&&_0x2a4120['color'])return _0x2a4120['color']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x154377(_0x24c8d8._0x32554b)](_0x25a0d8),_0x2a4120['depthFailColor']&&(_0x556ab8['depthFailColor']||_0x556ab8['depthFail'])&&(_0x2a4120['depthFailColor']=Cesium__namespace['ColorGeometryInstanceAttribute']['toValue'](getCesiumColor(_0x556ab8['depthFailColor'],_0x25a0d8))),!![];return![];}['setOpacity'](_0x1b9ad2){const _0x146708={_0x23e64a:0x246,_0xbbae38:0xaa6},_0x4e5b92=_0x35a251;this[_0x4e5b92(0xfc8)]['globalAlpha']=_0x1b9ad2;const _0x40e4ba=this[_0x4e5b92(0x246)](this['_primitive'],_0x1b9ad2);if(_0x40e4ba){this[_0x4e5b92(_0x146708._0x23e64a)](this[_0x4e5b92(0x3e5)],_0x1b9ad2),this['_updateLabelOpacity'](_0x1b9ad2),this[_0x4e5b92(_0x146708._0xbbae38)]&&this['_updateExOpacity'](_0x1b9ad2);return;}super['setOpacity'](_0x1b9ad2);}['_updatePrimitiveOpacity'](_0x145e67,_0x3269d2){const _0x115a67={_0x39048a:0x27f,_0x1b9fb1:0xaa2,_0x3ad3ac:0xb2,_0x47ff9b:0x9db,_0x1c34aa:0x1f4,_0x54aae6:0x1f4,_0x4d9574:0x324,_0x234a77:0x734,_0x355e44:0xf29,_0x1ad3e5:0x9d2,_0x5e6e08:0xf8,_0x4e2485:0x239},_0x468ce3=_0x35a251;if(!_0x145e67)return![];try{var _0x2a6686,_0x22f911;const _0x1b6888=_0x145e67===null||_0x145e67===void 0x0?void 0x0:(_0x2a6686=_0x145e67['appearance'])===null||_0x2a6686===void 0x0?void 0x0:(_0x22f911=_0x2a6686['material'])===null||_0x22f911===void 0x0?void 0x0:_0x22f911['uniforms'];if(_0x1b6888){if(Cesium__namespace[_0x468ce3(0xaa2)](_0x1b6888['globalAlpha']))return _0x145e67['appearance']['translucent']=_0x3269d2!==0x1,_0x1b6888['globalAlpha']=_0x3269d2,!![];if((_0x145e67['appearance'][_0x468ce3(_0x115a67._0x39048a)][_0x468ce3(0x8ea)]===Color$2||_0x145e67['appearance'][_0x468ce3(0x27f)][_0x468ce3(0x8ea)]===Image$1)&&Cesium__namespace[_0x468ce3(_0x115a67._0x1b9fb1)](_0x1b6888['color']))return!Cesium__namespace['defined'](_0x145e67['_uniforms_color_alpha'])&&(_0x145e67[_0x468ce3(_0x115a67._0x3ad3ac)]=_0x1b6888['color']['alpha']),_0x1b6888['color']['alpha']=_0x145e67[_0x468ce3(_0x115a67._0x3ad3ac)]*_0x3269d2,_0x145e67['appearance']['translucent']=_0x1b6888[_0x468ce3(_0x115a67._0x47ff9b)][_0x468ce3(_0x115a67._0x1c34aa)]!==0x1,!![];if(_0x145e67['appearance']['material']['type']===Water$1)return!Cesium__namespace[_0x468ce3(0xaa2)](_0x145e67['_uniforms_baseWaterColor_alpha'])&&(_0x145e67[_0x468ce3(0x244)]=_0x1b6888['baseWaterColor'][_0x468ce3(_0x115a67._0x54aae6)],_0x145e67['_uniforms_blendColor_alpha']=_0x1b6888['blendColor']['alpha']),this['globalAlpha']!==0x1&&(_0x1b6888[_0x468ce3(_0x115a67._0x4d9574)]['alpha']=_0x145e67['_uniforms_baseWaterColor_alpha']*_0x3269d2,_0x1b6888[_0x468ce3(_0x115a67._0x234a77)]['alpha']=_0x145e67[_0x468ce3(0xa8a)]*_0x3269d2),!![];}const _0x145fe1=this['getGeometryInstanceAttributes'](this['id'],_0x145e67);if(_0x145fe1!==null&&_0x145fe1!==void 0x0&&_0x145fe1[_0x468ce3(_0x115a67._0x47ff9b)]){!Cesium__namespace['defined'](_0x145e67['_attributes_color_alpha'])&&(_0x145e67[_0x468ce3(0xbef)]=_0x145fe1['color'][0x3]/0xff);const _0x54049e=_0x145e67['_attributes_color_alpha']*_0x3269d2;return _0x145fe1[_0x468ce3(_0x115a67._0x47ff9b)]=new Uint8Array([_0x145fe1['color'][0x0],_0x145fe1['color'][0x1],_0x145fe1['color'][0x2],Cesium__namespace[_0x468ce3(_0x115a67._0x355e44)][_0x468ce3(_0x115a67._0x1ad3e5)](_0x54049e)]),_0x145e67[_0x468ce3(_0x115a67._0x5e6e08)]['translucent']=_0x54049e!==0x1,_0x145fe1['depthFailColor']&&(!Cesium__namespace['defined'](_0x145e67[_0x468ce3(0xec7)])&&(_0x145e67['_attributes_depthFailColor_alpha']=_0x145fe1['depthFailColor'][0x3]/0xff),_0x145fe1['depthFailColor']=new Uint8Array([_0x145fe1['depthFailColor'][0x0],_0x145fe1[_0x468ce3(_0x115a67._0x4e2485)][0x1],_0x145fe1['depthFailColor'][0x2],Cesium__namespace[_0x468ce3(0xf29)]['floatToByte'](_0x145e67['_attributes_depthFailColor_alpha']*_0x3269d2)])),!![];}}catch(_0x59191b){}return![];}[_0x35a251(0xd75)](_0x5b634f,_0x4526a2){const _0x2136b5=_0x35a251;_0x4526a2=_0x4526a2||this['_primitive'];if(!_0x4526a2||!_0x4526a2['getGeometryInstanceAttributes'])return null;if(this['style'][_0x2136b5(0x979)]&&!_0x4526a2[_0x2136b5(0x90a)])return null;return _0x4526a2['getGeometryInstanceAttributes'](_0x5b634f);}['_updateLabelOpacity'](_0x406925){const _0x3eb112={_0x14b6f6:0xbf3,_0x22d715:0x45c},_0x3c08dc=_0x35a251;this[_0x3c08dc(_0x3eb112._0x14b6f6)]&&this['_primitive_label']['show']&&LabelStyleConver[_0x3c08dc(_0x3eb112._0x22d715)](this['_primitive_label'],_0x406925);}['redraw'](_0x2d81f4){const _0x2ea20e={_0x3dae5c:0xa9a,_0x332409:0x402},_0x52e603=_0x35a251;return this['isAdded']&&this['show']&&(this['_noDestroy']=!![],this[_0x52e603(_0x2ea20e._0x3dae5c)](),this['_noDestroy']=![],this[_0x52e603(0x97b)](_0x2d81f4||this[_0x52e603(0xfc8)]),this['czmObject']&&this['bindPickId'](this['czmObject']),this['czmObjectEx']&&this[_0x52e603(_0x2ea20e._0x332409)]['forEach'](_0x19d2ab=>{this['bindPickId'](_0x19d2ab);})),this;}['_updatePositionsHook'](){const _0x64c890=_0x35a251;this[_0x64c890(0xaf9)]();}['_updateLabelStyleHook'](_0x15821f,_0x3c7568){const _0x6576a6={_0x41d63a:0x2cf},_0x2c7824=_0x35a251;if(_0x3c7568!==null&&_0x3c7568!==void 0x0&&_0x3c7568['label']){if(this[_0x2c7824(0xbf3)]){var _0x273b37,_0x3097d1,_0x52a075,_0x32ce84;LabelStyleConver[_0x2c7824(0xc04)](_0x15821f['label'],this['_primitive_label'],this['attr']),(Cesium__namespace['defined'](_0x3c7568===null||_0x3c7568===void 0x0?void 0x0:(_0x273b37=_0x3c7568['label'])===null||_0x273b37===void 0x0?void 0x0:_0x273b37['position'])||Cesium__namespace[_0x2c7824(0xaa2)](_0x3c7568===null||_0x3c7568===void 0x0?void 0x0:(_0x3097d1=_0x3c7568[_0x2c7824(0x854)])===null||_0x3097d1===void 0x0?void 0x0:_0x3097d1['height'])||Cesium__namespace['defined'](_0x3c7568===null||_0x3c7568===void 0x0?void 0x0:(_0x52a075=_0x3c7568['label'])===null||_0x52a075===void 0x0?void 0x0:_0x52a075['addHeight'])||Cesium__namespace['defined'](_0x3c7568===null||_0x3c7568===void 0x0?void 0x0:(_0x32ce84=_0x3c7568[_0x2c7824(0x854)])===null||_0x32ce84===void 0x0?void 0x0:_0x32ce84['setHeight']))&&this['_updateLabelPosition']();}else this['_addLabel']();}else Cesium__namespace['defined'](_0x3c7568===null||_0x3c7568===void 0x0?void 0x0:_0x3c7568[_0x2c7824(_0x6576a6._0x41d63a)])&&this[_0x2c7824(0x969)](_0x3c7568['globalAlpha']);}[_0x35a251(0x86a)](){const _0x2e9fbb={_0x475e5a:0x987},_0x2aacb8=_0x35a251,_0x3da582=this['style'][_0x2aacb8(0x854)];if(!_0x3da582||!_0x3da582[_0x2aacb8(0xe1f)])return;Cesium__namespace['defined'](this[_0x2aacb8(0xfc8)]['clampToGround'])&&!Cesium__namespace[_0x2aacb8(0xaa2)](_0x3da582[_0x2aacb8(0x979)])&&!Cesium__namespace['defined'](_0x3da582['height'])&&(_0x3da582[_0x2aacb8(0x979)]=this['style']['clampToGround']);const _0x439b72=LabelStyleConver['toCesiumVal'](_0x3da582,{},this['attr']);return _0x439b72[_0x2aacb8(0x987)]=this[_0x2aacb8(_0x2e9fbb._0x475e5a)],_0x439b72['position']=this['_getLablePosition'](),this['_primitive_label']&&this['_layer']['labelCollection']['remove'](this['_primitive_label']),this['_primitive_label']=this['_layer']['labelCollection']['add'](_0x439b72),this['bindPickId'](this['_primitive_label']),this['_primitive_label'];}[_0x35a251(0xdc9)](){const _0x51085a={_0x9f4d83:0x596},_0x4b484f=_0x35a251;this['_primitive_label']&&!this['_primitive_label']['isDestroyed']()&&(this['_primitive_label']['position']=this[_0x4b484f(_0x51085a._0x9f4d83)]());}[_0x35a251(0x596)](){const _0x211722={_0x50ea98:0xfc8,_0x38397b:0xfc8,_0xbed8a1:0x682},_0x3fbb43=_0x35a251,_0x2838a3=this[_0x3fbb43(_0x211722._0x50ea98)]['label'];let _0x3cfb87;if(_0x2838a3['position']){if(_0x2838a3['position']==='center')_0x3cfb87=this['centerOfMass'];else{if(isString(_0x2838a3['position'])){const _0x512c57=template(_0x2838a3['position'],this[_0x3fbb43(0x6b3)],!![]);_0x512c57&&(_0x3cfb87=LngLatPoint[_0x3fbb43(0x8d0)](_0x512c57)['toCartesian']());}else _0x3cfb87=LngLatPoint['parse'](_0x2838a3['position'])[_0x3fbb43(0xa43)]();}}!_0x3cfb87&&(_0x3cfb87=this['center']);if(!_0x3cfb87)return new Cesium__namespace[(_0x3fbb43(0x8eb))]();if(Cesium__namespace['defined'](_0x2838a3['height'])||Cesium__namespace['defined'](this[_0x3fbb43(_0x211722._0x38397b)]['height'])){const _0x756d69=_0x2838a3[_0x3fbb43(0x682)]??this['style'][_0x3fbb43(_0x211722._0xbed8a1)];_0x3cfb87=setPositionsHeight(_0x3cfb87,_0x756d69);}Cesium__namespace[_0x3fbb43(0xaa2)](this['style'][_0x3fbb43(0x4f7)])&&(_0x3cfb87=addPositionsHeight(_0x3cfb87,this[_0x3fbb43(0xfc8)]['diffHeight']));let _0x16c68c=_0x2838a3['setHeight'];Cesium__namespace['defined'](_0x16c68c)&&(isString(_0x16c68c)&&(_0x16c68c=Number(template(_0x16c68c,this[_0x3fbb43(0x6b3)],!![])),isNaN(_0x16c68c)&&(_0x16c68c=0x0)),_0x3cfb87=setPositionsHeight(_0x3cfb87,_0x16c68c));let _0x119e1e=_0x2838a3['addHeight'];return Cesium__namespace['defined'](_0x119e1e)&&(isString(_0x119e1e)&&(_0x119e1e=Number(template(_0x119e1e,this['attr'],!![])),isNaN(_0x119e1e)&&(_0x119e1e=0x0)),_0x3cfb87=addPositionsHeight(_0x3cfb87,_0x119e1e)),_0x3cfb87;}['_getOutlineStyle'](_0x55a751,_0x51e356){const _0x4d9afe={_0x4aab9f:0xf29,_0x4fd3c7:0xf5d,_0x5525d9:0x979,_0x113bd4:0x80b},_0x67c6be=_0x35a251,_0x1b6629={..._0x55a751};return delete _0x1b6629[_0x67c6be(0x27f)],delete _0x1b6629[_0x67c6be(0x472)],delete _0x1b6629['materialOptions'],delete _0x1b6629['outline'],delete _0x1b6629['outlineColor'],delete _0x1b6629['outlineOpacity'],delete _0x1b6629['outlineWidth'],delete _0x1b6629['outlineStyle'],{..._0x1b6629,'show':_0x55a751['outline']??![],'color':_0x55a751['outlineColor']??Cesium__namespace[_0x67c6be(_0x4d9afe._0x4aab9f)]['WHITE'],'opacity':_0x55a751['outlineOpacity'],'width':_0x55a751[_0x67c6be(_0x4d9afe._0x4fd3c7)]??0x1,'arcType':_0x55a751[_0x67c6be(0xd96)]??_0x55a751[_0x67c6be(_0x4d9afe._0x5525d9)]?Cesium__namespace['ArcType'][_0x67c6be(0xd76)]:Cesium__namespace['ArcType'][_0x67c6be(_0x4d9afe._0x113bd4)],..._0x55a751['outlineStyle']||{},..._0x51e356||{}};}[_0x35a251(0x9ff)](){return[this['positions']];}[_0x35a251(0x2d5)](_0x5c4b3b){const _0x5316bd={_0x3a719a:0x99c,_0x365750:0x682,_0x16df1b:0xaa2,_0x1ba1c7:0xe0e,_0x1d302a:0x71a,_0x49b43e:0x393,_0x57f783:0x71d,_0xe502ed:0x6b3,_0x413ce3:0xf8,_0x4aff55:0x21c,_0x9d9035:0x534},_0x20629a=_0x35a251,_0x4d433e=PolylineStyleConver['toCesiumVal'](_0x5c4b3b),_0x3d914d=_0x4d433e['clampToGround']?Cesium__namespace[_0x20629a(_0x5316bd._0x3a719a)]:Cesium__namespace['PolylineGeometry'],_0x4f5381=[],_0x3074cd=this['_getPolylineOutlinePositions']();for(let _0x3656ee=0x0,_0x2133b3=_0x3074cd['length'];_0x3656ee<_0x2133b3;_0x3656ee++){let _0x1ae32f=_0x3074cd[_0x3656ee];if(!_0x1ae32f||_0x1ae32f['length']===0x0)continue;Cesium__namespace['defined'](_0x5c4b3b['height'])&&(_0x1ae32f=setPositionsHeight(_0x1ae32f,_0x5c4b3b[_0x20629a(_0x5316bd._0x365750)]));Cesium__namespace[_0x20629a(_0x5316bd._0x16df1b)](_0x5c4b3b['setHeight'])&&(_0x1ae32f=setPositionsHeight(_0x1ae32f,_0x5c4b3b['setHeight']));Cesium__namespace['defined'](_0x5c4b3b['addHeight'])&&(_0x1ae32f=addPositionsHeight(_0x1ae32f,_0x5c4b3b['addHeight']));_0x1ae32f[_0x20629a(0xe1e)]>0x0&&(_0x1ae32f=_0x1ae32f['concat'](_0x1ae32f[0x0]));const _0x7fb252={..._0x4d433e};_0x7fb252['positions']=_0x1ae32f;(!_0x7fb252['material']||_0x7fb252[_0x20629a(0x27f)]['type']==='Color')&&(_0x7fb252['vertexFormat']=Cesium__namespace[_0x20629a(_0x5316bd._0x1ba1c7)]['VERTEX_FORMAT']);const _0x1de772=this['_getColorByColorMaterial'](_0x7fb252),_0x5aaf18=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x3d914d(_0x7fb252),'attributes':{'color':Cesium__namespace[_0x20629a(_0x5316bd._0x1d302a)]['fromColor'](_0x1de772),'distanceDisplayCondition':_0x4d433e[_0x20629a(_0x5316bd._0x49b43e)],'show':new Cesium__namespace[(_0x20629a(_0x5316bd._0x57f783))](this['show'])}});_0x4f5381[_0x20629a(0x6de)](_0x5aaf18);}if(_0x4f5381['length']===0x0)return;const _0x23557c={...this['options'],'geometryInstances':_0x4f5381,'show':this['show'],'shadows':_0x4d433e['shadows']};delete _0x23557c['style'],delete _0x23557c[_0x20629a(_0x5316bd._0xe502ed)];_0x4d433e['material']&&!_0x4d433e['classification']?_0x23557c['appearance']=new Cesium__namespace['PolylineMaterialAppearance']({..._0x4d433e}):_0x23557c[_0x20629a(_0x5316bd._0x413ce3)]=new Cesium__namespace[(_0x20629a(0xe0e))]({..._0x4d433e});let _0x4c0624;return this[_0x20629a(0xfc8)]['clampToGround']?(_0x23557c['classificationType']=_0x4d433e[_0x20629a(0xcad)],_0x4c0624=this['primitiveCollection'][_0x20629a(0x4af)](new Cesium__namespace['GroundPolylinePrimitive'](_0x23557c))):_0x4c0624=this['primitiveCollection']['add'](new Cesium__namespace[(_0x20629a(_0x5316bd._0x4aff55))](_0x23557c)),this[_0x20629a(_0x5316bd._0x9d9035)](_0x4c0624),_0x4c0624;}['openHighlight'](_0x23689d,_0x3295a0=!![]){const _0x21d784=_0x35a251;var _0x1a9061;_0x3295a0&&(this['_map']['closeHighlight'](),this['_map']['last_highlighGraphic']=this);const _0x29b33a=_0x23689d||this['_highlightOptions']||((_0x1a9061=this['_layer'])===null||_0x1a9061===void 0x0?void 0x0:_0x1a9061['_highlightOptions']);if(_0x29b33a){const _0x56068a=[];for(const _0x2d5a54 in _0x29b33a){if(_0x2d5a54==='type')continue;!Cesium__namespace['defined'](this[_0x21d784(0xfc8)][_0x2d5a54])&&_0x56068a['push'](_0x2d5a54);}_0x56068a['length']>0x0&&logWarn('openHighlight:原有style中不存在以下属性,关闭高亮时将无法恢复',_0x56068a);const _0x49ecd2=merge(clone(this['style']),_0x29b33a);this['_updateStyleHook'](_0x49ecd2,_0x29b33a),this['_updateLabelStyleHook'](_0x49ecd2,_0x29b33a),this['fire'](EventType[_0x21d784(0x25c)],{},!![]);}}['closeHighlight'](){const _0x14ae01={_0x5dbae7:0x47f,_0x34e5f2:0x6d9,_0x2b0b27:0x264},_0x2aafbd=_0x35a251;var _0xe90eae;if(!this[_0x2aafbd(_0x14ae01._0x5dbae7)]||((_0xe90eae=this[_0x2aafbd(0xd79)])===null||_0xe90eae===void 0x0?void 0x0:_0xe90eae['last_highlighGraphic'])!==this)return;this['_updateStyleHook'](this['style'],this['style']),this[_0x2aafbd(_0x14ae01._0x34e5f2)](this['style'],this[_0x2aafbd(0xfc8)]),this['_map']['_clearLastHighlight'](),this[_0x2aafbd(_0x14ae01._0x2b0b27)](EventType[_0x2aafbd(0x77b)],{},!![]);}['_replaceFragmentShaderSourceByStyle'](_0x3897b){const _0x495fde=_0x35a251;return this[_0x495fde(0xfc8)][_0x495fde(0x59f)]&&(_0x3897b='#define\x20FLAT\x0a'+_0x3897b),this['style']['faceForward']&&(_0x3897b='#define\x20FACE_FORWARD\x0a'+_0x3897b),_0x3897b;}['startDraw'](_0x1bac23){const _0x5c695a={_0x5704bc:0xdc3,_0x25c007:0xeb1,_0x2a58ac:0x4bd},_0x48e9f4={_0x1118f6:0xf8c,_0x48104e:0x264},_0x28dd83=_0x35a251;if(!this['_getDrawEntityClass']){logInfo('对象不支持标绘',this);return;}if(this['_enabledDraw'])return this;this['_enabledDraw']=!![],this['show']=![];_0x1bac23&&this[_0x28dd83(_0x5c695a._0x5704bc)](_0x1bac23);if(!this['_map'])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this['_editing_entity']=this['_getDrawEntityClass']({'minPointNum':this['options']['minPointNum'],'maxPointNum':this['options']['maxPointNum'],'style':this['_getDrawEntityStyle'](),'private':!![]},!![]),this['_editing_entity'][_0x28dd83(0x605)]=this,this[_0x28dd83(_0x5c695a._0x25c007)]['once'](EventType['drawCreated'],_0x7664e6=>{this['stopDraw']();}),this['_editing_entity']['on']([EventType[_0x28dd83(_0x5c695a._0x2a58ac)],EventType['drawMouseMove'],EventType['drawRemovePoint']],_0x25e551=>{const _0x38cad7=_0x28dd83;_0x25e551[_0x38cad7(_0x48e9f4._0x1118f6)]=this,_0x25e551['drawtype']=this['type'],this[_0x38cad7(_0x48e9f4._0x48104e)](_0x25e551[_0x38cad7(0x8ea)],_0x25e551,!![]);}),this['_editing_entity']['startDraw'](this['_map']['graphicLayer']),this['fire'](EventType[_0x28dd83(0xcd2)],{'drawtype':this[_0x28dd83(0x8ea)]},!![]);}[_0x35a251(0x77c)](){const _0x4fb8cc={_0x3d5781:0x1ee,_0x19255e:0xe86},_0x43f0aa=_0x35a251;var _0x2493c0,_0x14aee1,_0x250aef;if(!this[_0x43f0aa(0x5f2)]||!this['_editing_entity'])return this;this['_enabledDraw']=![];if(!this['_editing_entity']['stopDraw']()){this[_0x43f0aa(_0x4fb8cc._0x3d5781)](!![]);return;}this['_updateDrawEntityToThis'](),this['fire'](EventType['drawCreated'],{'drawtype':this['type'],'positions':this[_0x43f0aa(0xb35)]},!![]),(_0x2493c0=this[_0x43f0aa(0xe86)])!==null&&_0x2493c0!==void 0x0&&_0x2493c0['success']&&this['options']['success'](this),(_0x14aee1=this[_0x43f0aa(_0x4fb8cc._0x19255e)])!==null&&_0x14aee1!==void 0x0&&(_0x250aef=_0x14aee1['_promise'])!==null&&_0x250aef!==void 0x0&&_0x250aef['resolve']&&this['options'][_0x43f0aa(0xf13)][_0x43f0aa(0xc74)](this);}[_0x35a251(0x11e)](){if(!this['_enabledDraw']||!this['_editing_entity'])return![];if(!this['_editing_entity']['endDraw']())return![];return!![];}[_0x35a251(0xefd)](){const _0x33a83a=this['_style2JsonBase'](this['style'],![]);return delete _0x33a83a['highlight'],_0x33a83a;}['_getDrawPointEntityClass'](_0x4ec1d1,_0x9de66f){const _0x405c59={_0x225761:0xfc8},_0x44a89e=_0x35a251;return _0x4ec1d1['drawShow']=!_0x9de66f,_0x4ec1d1[_0x44a89e(_0x405c59._0x225761)]=getEditPointStyle(),create$4('point',_0x4ec1d1);}['_updateDrawEntityToThis'](){const _0x3e9be8={_0x4b9c2c:0xfc8,_0x4bdfc7:0xccd,_0x583c4f:0xb61,_0x4d0b2a:0xb35},_0xa36805=_0x35a251,_0x437b02=this['_editing_entity']['toJSON']();this['_editing_entity']['remove'](!![]),delete this['_editing_entity'];if(_0x437b02['style']&&this[_0xa36805(0x8ea)]['startsWith'](_0x437b02['type']))this['options']['style']=merge(this['options'][_0xa36805(_0x3e9be8._0x4b9c2c)],_0x437b02[_0xa36805(0xfc8)]),this[_0xa36805(_0x3e9be8._0x4bdfc7)](this['options']['style']);else this[_0xa36805(0x9d4)]&&this['_updateStyleByEdit'](_0x437b02['style'],_0x437b02);if(_0x437b02['position'])this[_0xa36805(_0x3e9be8._0x583c4f)]=_0x437b02['position'];else _0x437b02[_0xa36805(0xb35)]&&(this[_0xa36805(_0x3e9be8._0x4d0b2a)]=_0x437b02['positions']);this['show']=!![];}['startEditing'](){const _0x538e59={_0x13524c:0xd79,_0x5c6683:0x4be,_0x564304:0x8ea,_0x401da9:0xeb1,_0x4548bb:0x1fd,_0x2ad0a2:0x2ba,_0x259972:0x756},_0x25a427={_0x5eecb6:0x1d0,_0x2bebff:0xdb7,_0x31de90:0xeb1,_0x52a01e:0xb61,_0x537df1:0x86e,_0x1b423b:0x937},_0xcd9132={_0x1a7b0d:0xfc8},_0x31099e=_0x35a251;if(this['_enabledEdit'])return this;this['_enabledEdit']=!![];if(!this[_0x31099e(_0x538e59._0x13524c)])throw new Error('编辑时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this[_0x31099e(0xeb1)]=this[_0x31099e(_0x538e59._0x5c6683)]({'hasMoveEdit':this['options']['hasMoveEdit'],'hasHeightEdit':this['options']['hasHeightEdit'],'style':this[_0x31099e(0xefd)](),'position':this['position'],'positions':this['positions'],'private':!![]},![]);this[_0x31099e(0x68b)]&&this[_0x31099e(0x68b)](this['_editing_entity']);this['_editing_entity']['parent']=this;const _0x3ff301=this[_0x31099e(0x8ea)]['startsWith'](this['_editing_entity'][_0x31099e(_0x538e59._0x564304)]);this[_0x31099e(_0x538e59._0x401da9)][_0x31099e(_0x538e59._0x4548bb)](EventType[_0x31099e(_0x538e59._0x2ad0a2)],_0x597157=>{this['stopEditing']();}),this['_editing_entity']['on'](EventType[_0x31099e(0x53d)],_0x4de79e=>{const _0x5371e0=_0x31099e,_0x23da9b=this['_editing_entity']['toJSON']();if(_0x23da9b[_0x5371e0(_0xcd9132._0x1a7b0d)]&&_0x3ff301)this['options']['style']=merge(this['options'][_0x5371e0(0xfc8)],_0x23da9b['style']);else this['_updateStyleByEdit']&&this[_0x5371e0(0x9d4)](_0x23da9b['style'],_0x23da9b);}),this[_0x31099e(0xeb1)]['on']([EventType['editAddPoint'],EventType['editMovePoint'],EventType['editRemovePoint']],_0x59d5da=>{const _0x590f0a=_0x31099e;if(this['_editing_entity']['_position_draw'])_0x3ff301?(this['_point']=LngLatPoint['parse'](this['_editing_entity'][_0x590f0a(_0x25a427._0x5eecb6)]),this[_0x590f0a(_0x25a427._0x2bebff)]=this[_0x590f0a(_0x25a427._0x31de90)]['_position_draw']):this[_0x590f0a(_0x25a427._0x52a01e)]=this[_0x590f0a(_0x25a427._0x31de90)]['_position_draw'];else this['_editing_entity']['_positions_draw']&&(_0x3ff301?(this[_0x590f0a(_0x25a427._0x537df1)]=LngLatArray['toPoints'](this['_editing_entity'][_0x590f0a(_0x25a427._0x1b423b)]),this['_positions']=this['_editing_entity']['_positions_draw']):this['positions']=this['_editing_entity']['_positions_draw']);}),this[_0x31099e(0xd79)]['graphicLayer'][_0x31099e(0x8b5)](this['_editing_entity']),this['_editing_entity'][_0x31099e(_0x538e59._0x259972)](),_0x3ff301?this['show']=![]:this[_0x31099e(_0x538e59._0x401da9)]['type']!=='point'&&(this[_0x31099e(_0x538e59._0x401da9)][_0x31099e(0x5a1)][_0x31099e(0x987)]=![]);}['stopEditing'](){const _0x3f3486={_0x32ce40:0xc4e},_0x106065=_0x35a251;if(!this[_0x106065(_0x3f3486._0x32ce40)]||!this[_0x106065(0xeb1)])return this;this['_enabledEdit']=![],this['_updateDrawEntityToThis']();}}class BasePointPrimitive extends BasePrimitive{constructor(_0x57487f={}){const _0x457ca6={_0x4b9887:0x96f,_0x6f66f6:0xe86,_0xfeb17c:0xf44,_0x4cb20c:0x41f,_0x4bdb2b:0x71c,_0x5cc93b:0x49c,_0x558ad3:0xd9d,_0x63de39:0xfc8,_0x595c88:0x9c5},_0xef5aaf=_0x35a251;super(_0x57487f),this[_0xef5aaf(_0x457ca6._0x4b9887)]=this[_0xef5aaf(_0x457ca6._0x6f66f6)]['hasEdit']??!![];_0x57487f['positions']&&(this[_0xef5aaf(0xb35)]=_0x57487f['positions']);if(_0x57487f['position'])this[_0xef5aaf(0xb61)]=_0x57487f['position'];else{if(_0x57487f['modelMatrix']){this['_position']=Cesium__namespace['Matrix4'][_0xef5aaf(0x4c1)](_0x57487f['modelMatrix'],new Cesium__namespace[(_0xef5aaf(0x8eb))]()),this[_0xef5aaf(_0x457ca6._0xfeb17c)]=LngLatPoint['parse'](this['_position']);if(!Cesium__namespace['defined'](this['style'][_0xef5aaf(_0x457ca6._0x4cb20c)])){const _0x1b5f2f=Cesium__namespace['Matrix4']['getMatrix3'](_0x57487f['modelMatrix'],new Cesium__namespace[(_0xef5aaf(0xd9d))]()),_0x463932=Cesium__namespace['Matrix4'][_0xef5aaf(_0x457ca6._0x4bdb2b)](Cesium__namespace[_0xef5aaf(_0x457ca6._0x5cc93b)]['eastNorthUpToFixedFrame'](this['_position']),new Cesium__namespace[(_0xef5aaf(0xd9d))]()),_0x3ba6f4=Cesium__namespace['Matrix3']['getColumn'](_0x463932,0x0,new Cesium__namespace['Cartesian3']()),_0x227eb9=Cesium__namespace['Matrix3']['getColumn'](_0x463932,0x1,new Cesium__namespace[(_0xef5aaf(0x8eb))]()),_0x430e34=Cesium__namespace[_0xef5aaf(_0x457ca6._0x558ad3)]['getColumn'](_0x463932,0x2,new Cesium__namespace[(_0xef5aaf(0x8eb))]());let _0x4334c9=Cesium__namespace['Matrix3'][_0xef5aaf(0xcf4)](_0x1b5f2f,0x0,new Cesium__namespace['Cartesian3']());_0x4334c9=Cesium__namespace['Cartesian3']['cross'](_0x4334c9,_0x430e34,_0x4334c9),_0x4334c9=Cesium__namespace['Cartesian3']['cross'](_0x430e34,_0x4334c9,_0x4334c9),_0x4334c9=Cesium__namespace['Cartesian3'][_0xef5aaf(0xebd)](_0x4334c9,_0x4334c9);let _0x2172f0=Cesium__namespace['Cartesian3']['angleBetween'](_0x3ba6f4,_0x4334c9);const _0x2e3c7e=Cesium__namespace['Cartesian3']['angleBetween'](_0x227eb9,_0x4334c9);_0x2e3c7e>Math['PI']*0.5&&(_0x2172f0=0x2*Math['PI']-_0x2172f0),this[_0xef5aaf(_0x457ca6._0x63de39)]['heading']=Cesium__namespace[_0xef5aaf(0x7c0)][_0xef5aaf(_0x457ca6._0x595c88)](_0x2172f0);}}}}get['position'](){const _0x924e7a=_0x35a251;if(this['_position'])return this['_position'];if(this['property']){var _0xdc090e,_0x455d71;return this['property']['getValue']((_0xdc090e=this[_0x924e7a(0xd79)])===null||_0xdc090e===void 0x0?void 0x0:(_0x455d71=_0xdc090e['clock'])===null||_0x455d71===void 0x0?void 0x0:_0x455d71['currentTime']);}}set[_0x35a251(0xb61)](_0x597773){const _0x28934b={_0x2de885:0x5d2,_0x4ebc34:0xa43,_0x1ed4ed:0xe86,_0x2f57bb:0x371,_0x37f5c1:0xb2f},_0x5339e7=_0x35a251;var _0x1080a2;if(this['_forPositionProperty'](_0x597773))return this['_position'];this[_0x5339e7(0xf44)]=LngLatPoint['parse'](_0x597773);if(this['_point']){let _0x533e21=this['style']['setHeight'];Cesium__namespace['defined'](_0x533e21)&&(isString(_0x533e21)&&(_0x533e21=Number(template(_0x533e21,this['attr'],!![])),isNaN(_0x533e21)&&(_0x533e21=0x0)),this['_point'][_0x5339e7(_0x28934b._0x2de885)]=_0x533e21);const _0x289b58=this['getAddHeight']();_0x289b58!==0x0&&(this['_point']['alt']=this['_point']['alt']+_0x289b58);}this['_position']=(_0x1080a2=this['_point'])===null||_0x1080a2===void 0x0?void 0x0:_0x1080a2[_0x5339e7(_0x28934b._0x4ebc34)](),this[_0x5339e7(_0x28934b._0x1ed4ed)]['modelMatrix']&&delete this['options']['modelMatrix'],this[_0x5339e7(_0x28934b._0x2f57bb)]&&this['_updatePositionsHook'](),this['_primitive_label']&&this['_updateLabelPosition'](),this['_editing_entity']&&(this['_editing_entity'][_0x5339e7(0xb61)]=this['_position']),this['fire'](EventType[_0x5339e7(_0x28934b._0x37f5c1)],{'position':this[_0x5339e7(0xdb7)]});}get[_0x35a251(0x263)](){return this['positions'];}get['positionShow'](){return this['_position'];}get[_0x35a251(0x1ba)](){return this['_point'];}get['coordinate'](){return this['getCoordinate']();}get['center'](){return this['position'];}get[_0x35a251(0xc7b)](){return this['point'];}get['height'](){const _0x268ea4=_0x35a251;var _0x47774a;return(_0x47774a=this[_0x268ea4(0x1ba)])===null||_0x47774a===void 0x0?void 0x0:_0x47774a[_0x268ea4(0x5d2)];}set['height'](_0x45c460){const _0x521bd4={_0x4aeb12:0x5d2},_0x4aa699=_0x35a251;this['point'][_0x4aa699(_0x521bd4._0x4aeb12)]=_0x45c460,this['position']=this['point'];}get['positions'](){const _0x14a8df=_0x35a251;return this[_0x14a8df(0xb61)]?[this['position']]:null;}set['positions'](_0x4c98d8){const _0x3196bb={_0x55774f:0xb61},_0x3f6af5=_0x35a251;_0x4c98d8&&_0x4c98d8['length']>0x0&&(this[_0x3f6af5(_0x3196bb._0x55774f)]=_0x4c98d8[0x0]);}get[_0x35a251(0x34a)](){const _0xbaccfa=_0x35a251;return[this[_0xbaccfa(0x1ba)]];}get[_0x35a251(0x310)](){return[this['coordinate']];}get['orientation'](){const _0x345b4d={_0x402620:0x857},_0x142165=_0x35a251;return this[_0x142165(_0x345b4d._0x402620)]||this['options'][_0x142165(0x8fd)];}set[_0x35a251(0x8fd)](_0x13f60e){this['_orientation']=_0x13f60e;}get['modelMatrix'](){const _0x354a54={_0x5773a7:0xe86},_0x56c715=_0x35a251;return this['options'][_0x56c715(0x8a0)]?this[_0x56c715(_0x354a54._0x5773a7)][_0x56c715(0x8a0)]:this['_getModelMatrix'](this['position'],this['_orientation']);}get['heading'](){const _0x484558={_0x26e765:0x7c0,_0xc93961:0x9c5,_0x2043dd:0x41f},_0x3144de=_0x35a251;if(Cesium__namespace['defined'](this['_heading_reality']))return Cesium__namespace[_0x3144de(_0x484558._0x26e765)][_0x3144de(_0x484558._0xc93961)](this['_heading_reality']);return this['style'][_0x3144de(_0x484558._0x2043dd)]??0x0;}set['heading'](_0x1500b6){const _0x2a7540=_0x35a251;this['style']['heading']=_0x1500b6,this[_0x2a7540(0x1a8)]();}get[_0x35a251(0x527)](){const _0x1cb694={_0x1ab969:0xaa2},_0x4f6987=_0x35a251;if(Cesium__namespace[_0x4f6987(_0x1cb694._0x1ab969)](this[_0x4f6987(0x5ff)]))return Cesium__namespace['Math']['toDegrees'](this['_pitch_reality']);return this['style']['pitch']??0x0;}set['pitch'](_0x38f159){const _0x590ebd=_0x35a251;this[_0x590ebd(0xfc8)][_0x590ebd(0x527)]=_0x38f159,this['updateModelMatrix']();}get['roll'](){const _0x4b2693=_0x35a251;if(Cesium__namespace['defined'](this['_roll_reality']))return Cesium__namespace['Math']['toDegrees'](this[_0x4b2693(0x35f)]);return this['style']['roll']??0x0;}set['roll'](_0x3ff5d2){const _0x27e25d=_0x35a251;this['style']['roll']=_0x3ff5d2,this[_0x27e25d(0x1a8)]();}get[_0x35a251(0x59a)](){const _0x2e0113=_0x35a251;if(this['options'][_0x2e0113(0x59a)])return this[_0x2e0113(0xe86)][_0x2e0113(0x59a)];if(this[_0x2e0113(0x33e)])return this['_objectsToExclude'];return undefined;}set['objectsToExclude'](_0xb9a8bb){this['_objectsToExclude']=_0xb9a8bb;}get[_0x35a251(0xec6)](){const _0x3634a3={_0x2bab63:0x373,_0x22fb17:0x6e1},_0x377182=_0x35a251;return!this['_trackedEntity']&&(this[_0x377182(0x6e1)]=this[_0x377182(0x2d0)]['dataSource']['entities']['add']({'position':this[_0x377182(0xb86)]||new Cesium__namespace['CallbackProperty'](_0x14f514=>{return this['_position'];},![]),'point':{'pixelSize':0x2,'color':Cesium__namespace['Color']['WHITE'][_0x377182(_0x3634a3._0x2bab63)](0.01)}})),this[_0x377182(_0x3634a3._0x22fb17)];}get['debugAxis'](){return this['_debugAxis'];}set[_0x35a251(0x4dc)](_0x59a9a7){const _0x488b6f={_0x42dd53:0x682,_0x1e10f9:0x4af,_0x2d1a40:0x69d,_0xc4e3db:0x442},_0x3c28b4={_0x46d412:0x8a0},_0x3d6cf0=_0x35a251;this[_0x3d6cf0(0xd4a)]=_0x59a9a7;if(!this['debugAxisPrimitive']){const _0x55848f=Math[_0x3d6cf0(0xc9d)](Cesium__namespace['Cartographic']['fromCartesian'](this['positionShow'])[_0x3d6cf0(_0x488b6f._0x42dd53)]*0.06,0x64);this['debugAxisPrimitive']=this[_0x3d6cf0(0x2d0)]['primitiveCollection'][_0x3d6cf0(_0x488b6f._0x1e10f9)](new Cesium__namespace['DebugModelMatrixPrimitive']({'modelMatrix':this[_0x3d6cf0(0x8a0)],'length':_0x55848f,'width':0x5})),this[_0x3d6cf0(0x442)]['_tooltipConfig']={'content':'红色\x20是\x20X轴
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20绿色\x20是\x20Y轴
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20蓝色\x20是\x20Z轴','options':this[_0x3d6cf0(0xe86)][_0x3d6cf0(_0x488b6f._0x2d1a40)]},this[_0x3d6cf0(0xb86)]&&(this[_0x3d6cf0(_0x488b6f._0xc4e3db)]['_timeTik']=setInterval(()=>{const _0x1c16f3=_0x3d6cf0;this['debugAxisPrimitive'][_0x1c16f3(_0x3c28b4._0x46d412)]=this['modelMatrix'];},0x12c)),this['bindPickId'](this['debugAxisPrimitive']);}this[_0x3d6cf0(0x442)][_0x3d6cf0(0x987)]=_0x59a9a7;}get['debugAxisLength'](){const _0x2f4c4e={_0x56ff74:0x442},_0x10b868=_0x35a251;return this[_0x10b868(_0x2f4c4e._0x56ff74)]?this['debugAxisPrimitive']['length']:0x0;}set['debugAxisLength'](_0x351b20){!this['debugAxisPrimitive']&&(this['debugAxis']=!![]),this['debugAxisPrimitive']['length']=_0x351b20;}['_addedHook'](_0x3fc73a){const _0x1233f1={_0x4e6232:0x987},_0x42e25e=_0x35a251;if(!this[_0x42e25e(_0x1233f1._0x4e6232)]||!this['position'])return;this['_forPositionProperty'](this['options'][_0x42e25e(0xb61)]),super['_addedHook'](_0x3fc73a);}['_removedHook'](_0x5ece07){const _0x24fbee={_0x3bd964:0xd79},_0x3de31d=_0x35a251;this['_trackedEntity']&&(this['_map']['trackedEntity']===this[_0x3de31d(0x6e1)]&&(this[_0x3de31d(_0x24fbee._0x3bd964)]['trackedEntity']=undefined),this['_layer']['dataSource'][_0x3de31d(0x313)]['remove'](this['_trackedEntity']),delete this['_trackedEntity']),super['_removedHook'](_0x5ece07);}[_0x35a251(0x1a8)](){const _0x1a1171=_0x35a251;this['_primitive']&&(this['_primitive'][_0x1a1171(0x8a0)]=this[_0x1a1171(0x8a0)]);}[_0x35a251(0xc2e)](_0x4a1cd7,_0x35ba4b){const _0x1b2860={_0x31e79a:0xfc8,_0x243c3c:0x41f,_0xbcce29:0xaa2,_0x7bf52f:0x41f,_0x4303e1:0xf39,_0x1d4f63:0x6bb,_0x548c09:0xaa2,_0x5d495b:0x6bb},_0xae0974=_0x35a251;if(!_0x4a1cd7)return Cesium__namespace['Matrix4']['IDENTITY'];let _0x3a4bdd=Cesium__namespace['Math']['toRadians'](this['style']['heading']||0x0),_0xace00f=Cesium__namespace['Math']['toRadians'](this['style']['pitch']||0x0),_0x268a19=Cesium__namespace['Math'][_0xae0974(0x7ba)](this['style']['roll']||0x0);const _0x45ec78=this[_0xae0974(_0x1b2860._0x31e79a)]['mergeOrientation']||!Cesium__namespace['defined'](this['style'][_0xae0974(_0x1b2860._0x243c3c)])||!Cesium__namespace['defined'](this['style']['pitch'])||!Cesium__namespace[_0xae0974(_0x1b2860._0xbcce29)](this['style'][_0xae0974(0xba7)]);if(_0x35ba4b&&_0x45ec78){if(_0x35ba4b['getValue']){var _0x46c877,_0x425d3a;_0x35ba4b=_0x35ba4b['getValue']((_0x46c877=this['_map'])===null||_0x46c877===void 0x0?void 0x0:(_0x425d3a=_0x46c877['clock'])===null||_0x425d3a===void 0x0?void 0x0:_0x425d3a['currentTime']);}if(_0x35ba4b){const _0x1ea647=getHeadingPitchRollByOrientation(_0x4a1cd7,_0x35ba4b);this['style']['mergeOrientation']?(_0x3a4bdd+=_0x1ea647['heading'],_0x268a19+=_0x1ea647['roll'],_0xace00f+=_0x1ea647['pitch']):(!Cesium__namespace['defined'](this['style'][_0xae0974(_0x1b2860._0x243c3c)])&&(_0x3a4bdd=_0x1ea647[_0xae0974(_0x1b2860._0x7bf52f)]),!Cesium__namespace['defined'](this[_0xae0974(0xfc8)]['roll'])&&(_0x268a19=_0x1ea647['roll']),!Cesium__namespace['defined'](this['style']['pitch'])&&(_0xace00f=_0x1ea647[_0xae0974(0x527)]));}}this['_heading_reality']=_0x3a4bdd,this[_0xae0974(0x5ff)]=_0xace00f,this[_0xae0974(0x35f)]=_0x268a19;const _0x39112d=Cesium__namespace['Transforms']['headingPitchRollToFixedFrame'](_0x4a1cd7,new Cesium__namespace['HeadingPitchRoll'](_0x3a4bdd,_0xace00f,_0x268a19),Cesium__namespace['Ellipsoid'][_0xae0974(_0x1b2860._0x4303e1)],this['options']['fixedFrameTransform']);if(Cesium__namespace['defined'](this[_0xae0974(0x3da)])&&Cesium__namespace['defined'](this[_0xae0974(_0x1b2860._0x1d4f63)])&&Cesium__namespace[_0xae0974(_0x1b2860._0x548c09)](this['scaleZ']))Cesium__namespace['Matrix4']['multiplyByScale'](_0x39112d,new Cesium__namespace['Cartesian3'](this['scaleX'],this[_0xae0974(_0x1b2860._0x5d495b)],this['scaleZ']),_0x39112d);else Cesium__namespace['defined'](this['style']['scale'])&&Cesium__namespace['Matrix4']['multiplyByScale'](_0x39112d,new Cesium__namespace['Cartesian3'](this['style']['scale'],this['style']['scale'],this['style']['scale']),_0x39112d);return _0x39112d;}['_getGeoJsonGeometry'](_0x540af0){const _0xe20a1f={_0x4d45dd:0xe0c},_0x338a14=_0x35a251;return{'type':'Point','coordinates':this['getCoordinate'](_0x540af0===null||_0x540af0===void 0x0?void 0x0:_0x540af0[_0x338a14(_0xe20a1f._0x4d45dd)])};}['_forPositionProperty'](_0x350ef8){const _0x5aa6b4={_0x86b766:0xc9c,_0x2a160c:0x800},_0x1f2f51=_0x35a251;return _0x350ef8 instanceof Cesium__namespace['CallbackProperty']||_0x350ef8 instanceof Cesium__namespace['SampledPositionProperty']?(this['options']['frameRate']=this['options'][_0x1f2f51(_0x5aa6b4._0x86b766)]??0x14,this['_orientation']=this[_0x1f2f51(0xe86)]['orientation']||new Cesium__namespace[(_0x1f2f51(_0x5aa6b4._0x2a160c))](_0x350ef8),this[_0x1f2f51(0xb86)]=_0x350ef8,this['bindUpdateEvent'](),!![]):![];}['update'](_0x44e12e){const _0x482d61={_0x5d2bb3:0xdb7},_0x2b4632=_0x35a251;if(!this['show'])return;this['property']&&(this[_0x2b4632(_0x482d61._0x5d2bb3)]=this['property']['getValue'](_0x44e12e['time']),this['czmObject']&&this['_updatePositionsHook'](),this['_primitive_label']&&this['_updateLabelPosition']());}['_getPopupPosition'](){const _0x3a8cbb={_0x5e15ad:0xb86},_0x273605=_0x35a251;return this[_0x273605(_0x3a8cbb._0x5e15ad)]||this['position']||this['center'];}['addDynamicPosition'](_0x18bd25,_0x53fd4d){const _0x1e39cb={_0x11687e:0x7e5,_0x4a56b8:0x717,_0x5b7d2c:0xe86},_0x67b424=_0x35a251;var _0x4e784a,_0x4c3d22,_0xb6e223,_0x48d9d8;!this['_sampledPositionProperty']&&this[_0x67b424(0x964)]();this['_removeDynamicPosition']();const _0x7e439b=((_0x4e784a=this['_map'])===null||_0x4e784a===void 0x0?void 0x0:(_0x4c3d22=_0x4e784a['clock'])===null||_0x4c3d22===void 0x0?void 0x0:_0x4c3d22['currentTime'])||Cesium__namespace['JulianDate']['now']();if(!_0x53fd4d)_0x53fd4d=_0x7e439b;else{if(isNumber(_0x53fd4d))_0x53fd4d=Cesium__namespace['JulianDate'][_0x67b424(_0x1e39cb._0x11687e)](_0x7e439b,_0x53fd4d,new Cesium__namespace['JulianDate']());else{if(isString(_0x53fd4d))_0x53fd4d['indexOf']('Z')===-0x1?_0x53fd4d=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x53fd4d)):_0x53fd4d=Cesium__namespace['JulianDate']['fromIso8601'](_0x53fd4d);else _0x53fd4d instanceof Date&&(_0x53fd4d=Cesium__namespace['JulianDate'][_0x67b424(0xa51)](_0x53fd4d));}}_0x18bd25=LngLatPoint['parse'](_0x18bd25);const _0x4a9738=(_0xb6e223=this[_0x67b424(_0x1e39cb._0x4a56b8)])===null||_0xb6e223===void 0x0?void 0x0:(_0x48d9d8=_0xb6e223['_property'])===null||_0x48d9d8===void 0x0?void 0x0:_0x48d9d8['_times'];if(this[_0x67b424(_0x1e39cb._0x5b7d2c)][_0x67b424(0xb11)]&&(_0x4a9738===null||_0x4a9738===void 0x0?void 0x0:_0x4a9738[_0x67b424(0xe1e)])>0x0&&this['_position']){const _0x5f2409=_0x4a9738[_0x4a9738['length']-0x1];if(Cesium__namespace['JulianDate']['secondsDifference'](_0x7e439b,_0x5f2409)>0.3){let _0x50fd70=this[_0x67b424(0xdb7)];if(this['_lastDynamicPosition']){const _0x1773b1=0.01;_0x50fd70=getOnLinePointByLen(this['_lastDynamicPosition'],this['_position'],_0x1773b1,!![]);}_0x50fd70=setPositionsHeight(_0x50fd70,_0x18bd25['alt']||0x0),this['_sampledPositionProperty']['addSample'](_0x7e439b,_0x50fd70);}}const _0x38ba0f=_0x18bd25['toCartesian']();return this['_sampledPositionProperty']['addSample'](_0x53fd4d,_0x38ba0f),this['_lastDynamicPosition']=_0x38ba0f,this;}[_0x35a251(0x964)](){const _0x5ab320={_0x53f01c:0x827,_0x4e1823:0xcb2,_0x3594b7:0xe86,_0xbeb569:0xb86},_0x4258d3={_0x2278ad:0x5df,_0x21c78f:0xb81,_0x1c4530:0x5df},_0x4fecb3=_0x35a251;this['_clampToTilesetFrame']=-0x1,this['_frameRateHeight']=this['options']['frameRateHeight']??0x1e,this[_0x4fecb3(_0x5ab320._0x53f01c)]=this['options'][_0x4fecb3(_0x5ab320._0x4e1823)]??0x32;let _0x31d0c9;this[_0x4fecb3(0x717)]?_0x31d0c9=this['_sampledPositionProperty']:(_0x31d0c9=new Cesium__namespace['SampledPositionProperty'](this['options'][_0x4fecb3(0xc6b)],this[_0x4fecb3(_0x5ab320._0x3594b7)]['numberOfDerivatives']),_0x31d0c9['forwardExtrapolationType']=this['options'][_0x4fecb3(0xe26)]??Cesium__namespace['ExtrapolationType']['NONE'],_0x31d0c9['backwardExtrapolationType']=this[_0x4fecb3(_0x5ab320._0x3594b7)]['backwardExtrapolationType']??Cesium__namespace['ExtrapolationType'][_0x4fecb3(0x80b)],this['_sampledPositionProperty']=_0x31d0c9),this[_0x4fecb3(_0x5ab320._0xbeb569)]=new Cesium__namespace['CallbackProperty'](_0x354a6f=>{const _0xbb7c3=_0x4fecb3;if(!this['_map'])return undefined;let _0x1b2bd=_0x31d0c9[_0xbb7c3(0x7ec)](_0x354a6f);if(_0x1b2bd&&this['options']['clampToTileset']){this[_0xbb7c3(_0x4258d3._0x2278ad)]++;if(!this[_0xbb7c3(_0x4258d3._0x21c78f)]||this[_0xbb7c3(_0x4258d3._0x1c4530)]%this[_0xbb7c3(0xce7)]===0x0){const _0xa0046d=getHeight(this[_0xbb7c3(0xd79)]['scene'],_0x1b2bd,{'objectsToExclude':this['_layer']['objectsToExclude'],'has3dtiles':!![]});_0xa0046d&&(this['_clampToTilesetHeight']=_0xa0046d);}if(this['_clampToTilesetHeight']){const _0x25b028=Cesium__namespace[_0xbb7c3(0x120)][_0xbb7c3(0x9b1)](_0x1b2bd);_0x1b2bd=Cesium__namespace['Cartesian3']['fromRadians'](_0x25b028['longitude'],_0x25b028['latitude'],this[_0xbb7c3(0xb81)]+this['getAddHeight']());}}return _0x1b2bd;},![]),this[_0x4fecb3(0x857)]=this['options']['orientation']||new Cesium__namespace['VelocityOrientationProperty'](_0x31d0c9),this['bindUpdateEvent']();}[_0x35a251(0xc31)](){var _0x330592,_0xbe19d3;if(this['_maxCacheCount']<0x1)return;const _0x5552ab=(_0x330592=this['_sampledPositionProperty'])===null||_0x330592===void 0x0?void 0x0:(_0xbe19d3=_0x330592['_property'])===null||_0xbe19d3===void 0x0?void 0x0:_0xbe19d3['_times'];if(!_0x5552ab||_0x5552ab['length']===0x0)return;const _0x244e83=_0x5552ab['length']-this['_maxCacheCount']-0x1;_0x244e83>0x0&&this['_sampledPositionProperty']['removeSamples'](new Cesium__namespace['TimeInterval']({'start':_0x5552ab[0x0],'stop':_0x5552ab[_0x244e83]}));}['autoSurfaceHeight'](_0x3f8da3={}){return getSurfaceHeight(this['_map']['scene'],this['position'],_0x3f8da3)['then'](_0x3c50d5=>{_0x3c50d5['position']&&(this['position']=_0x3c50d5['position']);});}[_0x35a251(0x979)](_0x457ff9){const _0x4b5948=_0x35a251;return this[_0x4b5948(0x63c)](_0x457ff9);}['getCoordinate'](_0xa689ac){return this['point']?this['point']['toArray'](_0xa689ac):[];}}class PointPrimitive extends BasePointPrimitive{get[_0x35a251(0x293)](){var _0x490597;return(_0x490597=this['_layer'])===null||_0x490597===void 0x0?void 0x0:_0x490597['pointCollection'];}['_showHook'](_0x2a6acb){const _0x45e6df=_0x35a251;if(this['_primitive'])this['_primitive'][_0x45e6df(0x987)]=_0x2a6acb;else _0x2a6acb&&super['_showHook'](_0x2a6acb);}['_addedHook'](_0x40abe1){const _0x56cfdf={_0x598403:0x987,_0x5db254:0xff,_0x2e8cb9:0xe86,_0x4fefd1:0xfc8,_0x4129e0:0x854},_0x5d60d2=_0x35a251;if(!this[_0x5d60d2(_0x56cfdf._0x598403)])return;this[_0x5d60d2(_0x56cfdf._0x5db254)](this[_0x5d60d2(_0x56cfdf._0x2e8cb9)]['position']);this['_primitive']&&this['primitiveCollection']['remove'](this['_primitive']);const _0x400abc=PointStyleConver['toCesiumVal'](this['style'],{'show':this[_0x5d60d2(0x987)],'position':this['position']});this['_primitive']=this['primitiveCollection']['add'](_0x400abc),this[_0x5d60d2(_0x56cfdf._0x4fefd1)][_0x5d60d2(_0x56cfdf._0x4129e0)]&&this[_0x5d60d2(0x86a)]();}['_updateStyleHook'](_0x1077f1,_0x26f58a){const _0x340180={_0x5d634b:0x6f2},_0x1de678=_0x35a251;PointStyleConver['toCesiumVal'](_0x1077f1,this[_0x1de678(_0x340180._0x5d634b)]);}[_0x35a251(0x1e0)](_0x38defe,_0x33f433){const _0x55c116=_0x35a251;return PointStyleConver[_0x55c116(0x99e)](_0x38defe,_0x33f433);}['_updatePositionsHook'](){this['_primitive']['position']=this['position'];}['_getDrawEntityClass'](_0x295673,_0x33f4d9){const _0x3d96f8={_0x2818c4:0x1ba},_0x564b92=_0x35a251;return create$4(_0x564b92(_0x3d96f8._0x2818c4),_0x295673);}}register$4('pointP',PointPrimitive,!![]);class BasePolyPrimitive extends BasePrimitive{constructor(_0x8963a3={}){const _0x5a5b98={_0x432d07:0xe86,_0x234fc6:0xb35,_0x182a54:0xb35,_0x926382:0x948},_0x16c49e=_0x35a251;super(_0x8963a3),this['_hasEdit']=this[_0x16c49e(_0x5a5b98._0x432d07)]['hasEdit']??!![],_0x8963a3[_0x16c49e(0xb35)]&&(this['style']['buffer']>0x0?this[_0x16c49e(_0x5a5b98._0x234fc6)]=bufferPoints(_0x8963a3[_0x16c49e(_0x5a5b98._0x182a54)],this['style'][_0x16c49e(_0x5a5b98._0x926382)],this['style']['bufferSteps']):this['positions']=_0x8963a3['positions']);}get['center'](){const _0x4e85ec={_0x46b371:0xda2},_0x4dc7c3=_0x35a251;return this['style'][_0x4dc7c3(0xb3a)]?this[_0x4dc7c3(_0x4e85ec._0x46b371)]:this['centerOfLine'];}get['centerOfMass'](){const _0x4b8d32={_0xbb5ac1:0xb35},_0x270f4e=_0x35a251;return centerOfMass(this[_0x270f4e(_0x4b8d32._0xbb5ac1)]);}get[_0x35a251(0xb63)](){const _0xf3fd94=_0x35a251,_0x2ee80e=this[_0xf3fd94(0xb35)];if(!_0x2ee80e||_0x2ee80e['length']===0x0)return null;else{if(_0x2ee80e['length']===0x1)return _0x2ee80e[0x0];}return _0x2ee80e['length']<0xa?sliceByMaxDistance(_0x2ee80e,this['distance']/0x2,{'point':!![]}):_0x2ee80e[Math['floor'](_0x2ee80e['length']/0x2)];}get[_0x35a251(0xeed)](){return getDistance(this['positions']);}get[_0x35a251(0x705)](){const _0x424c9c={_0x51434d:0xb35},_0xa91718=_0x35a251;return getSurfaceArea(this[_0xa91718(_0x424c9c._0x51434d)]);}get['positions'](){const _0x2710d1=_0x35a251;return this[_0x2710d1(0x58a)];}set['positions'](_0x5cd6de){const _0x3a7da0={_0x4bcc3b:0x58a},_0x2d7b82={_0x3486be:0xdaa,_0x391037:0x5d2,_0x507245:0x6de,_0x57582e:0x6de},_0x599bdb=_0x35a251;if(!_0x5cd6de)return;const _0x4acd44=[],_0x315c5b=[];_0x5cd6de['forEach']((_0x56d13d,_0x3ef655)=>{const _0x339391=_0x2767,_0x131d66=LngLatPoint['parse'](_0x56d13d);if(!_0x131d66||!_0x131d66['valid']())return;let _0x5c30c4=this['style'][_0x339391(_0x2d7b82._0x3486be)];if(Cesium__namespace['defined'](_0x5c30c4)){if(isString(_0x5c30c4))_0x5c30c4=Number(template(_0x5c30c4,this['attr'],!![])),isNaN(_0x5c30c4)&&(_0x5c30c4=0x0);else Array['isArray'](_0x5c30c4)&&(_0x5c30c4=_0x5c30c4[_0x3ef655]||0x0);_0x131d66['alt']=_0x5c30c4;}const _0x2387ea=this['getAddHeight'](_0x3ef655);_0x2387ea!==0x0&&(_0x131d66[_0x339391(0x5d2)]=_0x131d66[_0x339391(_0x2d7b82._0x391037)]+_0x2387ea),_0x4acd44[_0x339391(_0x2d7b82._0x507245)](_0x131d66),_0x315c5b[_0x339391(_0x2d7b82._0x57582e)](_0x131d66['toCartesian']());}),this[_0x599bdb(0x86e)]=_0x4acd44,this[_0x599bdb(_0x3a7da0._0x4bcc3b)]=_0x315c5b,this[_0x599bdb(0x90a)]&&this['_updatePositionsHook'](),this['_primitive_label']&&this['_updateLabelPosition'](),this['_editing_entity']&&(this['_editing_entity'][_0x599bdb(0xb35)]=_0x315c5b),this[_0x599bdb(0x264)](EventType['updatePosition'],{'positions':this['_positions']});}get[_0x35a251(0x263)](){const _0x5978be=_0x35a251;return this[_0x5978be(0xb35)];}get['points'](){const _0x2eb59b={_0x1823b5:0x86e,_0x13fd1b:0xb17,_0x5db50d:0x58a},_0x1b4e72=_0x35a251;return!this[_0x1b4e72(_0x2eb59b._0x1823b5)]&&(this['_points']=LngLatArray[_0x1b4e72(_0x2eb59b._0x13fd1b)](this[_0x1b4e72(_0x2eb59b._0x5db50d)])),this['_points'];}get['coordinates'](){const _0x34a668={_0x513dad:0x797},_0x4861e6=_0x35a251;return this[_0x4861e6(_0x34a668._0x513dad)]();}get['rectangle'](){const _0x1cd457=_0x35a251;return Cesium__namespace[_0x1cd457(0xd6)]['fromCartesianArray'](this['positions']);}['_getGeoJsonGeometry'](_0x49c6b4){const _0x33c8fa=_0x35a251;return{'type':'LineString','coordinates':this['getCoordinates'](_0x49c6b4===null||_0x49c6b4===void 0x0?void 0x0:_0x49c6b4[_0x33c8fa(0xe0c)])};}['getCoordinates'](_0xb88a45){const _0x334225={_0x4a17a6:0x769},_0x1c4a8e=_0x35a251,_0x274010=[];return this['points'][_0x1c4a8e(0xdbd)](_0x549d22=>{const _0x4fb03f=_0x1c4a8e;_0x274010[_0x4fb03f(0x6de)](_0x549d22[_0x4fb03f(_0x334225._0x4a17a6)](_0xb88a45));}),_0x274010;}[_0x35a251(0xe2e)](_0x55bde2){const _0x178894={_0x216138:0x341,_0x22e606:0x4c2,_0x1fa402:0x949},_0x50229c=_0x35a251,_0x15fbc8=LngLatPoint['parse'](_0x55bde2),_0x2de74e=Cesium__namespace['Rectangle'][_0x50229c(_0x178894._0x216138)](Cesium__namespace['Rectangle'][_0x50229c(_0x178894._0x22e606)](this['positions']),_0x15fbc8[_0x50229c(_0x178894._0x1fa402)]());if(!_0x2de74e)return![];return isInPoly(_0x15fbc8,this['coordinates']);}['autoSurfaceHeight'](_0x1367aa={}){const _0x374131=_0x35a251;return computeSurfacePoints({..._0x1367aa,'map':this['_map'],'positions':this[_0x374131(0xb35)]})['then'](_0x4c71c5=>{return!_0x4c71c5['noHeight']&&(this['positions']=_0x4c71c5['positions']),_0x4c71c5;});}[_0x35a251(0x979)](_0x3c2800){const _0x26ca36={_0x4f395f:0x63c},_0x1a678d=_0x35a251;return this[_0x1a678d(_0x26ca36._0x4f395f)](_0x3c2800);}}class PolylinePrimitive extends BasePolyPrimitive{['_conversionStyle'](_0x3c4a1b){return PolylineStyleConver['toCesiumVal'](_0x3c4a1b);}['_style2Json'](_0x452df3,_0x343e5b){const _0x4cdeff={_0x2535e3:0x99e},_0x28a176=_0x35a251;return PolylineStyleConver[_0x28a176(_0x4cdeff._0x2535e3)](_0x452df3,_0x343e5b);}['_createGeometryInstance'](_0x7bec1e,_0x4b5a26){const _0x39e257={_0x473918:0xb3a,_0x343471:0xb35,_0x83dfa1:0x108,_0x563107:0xe86},_0x55a3b3=_0x35a251;var _0x54ec78;_0x7bec1e['positions']=this[_0x55a3b3(0xb35)]||[];_0x7bec1e[_0x55a3b3(_0x39e257._0x473918)]&&((_0x54ec78=_0x7bec1e['positions'])===null||_0x54ec78===void 0x0?void 0x0:_0x54ec78['length'])>0x0&&(_0x7bec1e[_0x55a3b3(_0x39e257._0x343471)]=_0x7bec1e['positions']['concat'](_0x7bec1e['positions'][0x0]));const _0x4bf77b=_0x7bec1e['clampToGround']?Cesium__namespace['GroundPolylineGeometry']:Cesium__namespace[_0x55a3b3(_0x39e257._0x83dfa1)];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x4bf77b(_0x7bec1e),'attributes':this[_0x55a3b3(_0x39e257._0x563107)]['attributes']});}['_createAppearance'](_0x3ba6d8,_0x549cb1){const _0x40d2c3={_0x58924a:0x9aa},_0xe21e55=_0x35a251;if(_0x3ba6d8[_0xe21e55(0x9f5)]){_0x549cb1['geometryInstances']['geometry'][_0xe21e55(0xdbe)]=Cesium__namespace['PolylineColorAppearance']['VERTEX_FORMAT'];if(!_0x3ba6d8['colors']){const _0x2aefc2=this['_getColorByColorMaterial'](_0x3ba6d8);_0x549cb1['geometryInstances']['attributes']=_0x549cb1[_0xe21e55(_0x40d2c3._0x58924a)]['attributes']||{},_0x549cb1['geometryInstances']['attributes']['color']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0xe21e55(0x6f9)](_0x2aefc2),_0x3ba6d8['depthFail']&&(_0x549cb1['geometryInstances']['attributes'][_0xe21e55(0x239)]=Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x3ba6d8['depthFailColor']||_0x2aefc2));}return new Cesium__namespace['PolylineColorAppearance']({..._0x3ba6d8});}else return new Cesium__namespace['PolylineMaterialAppearance']({..._0x3ba6d8});}['_updateStyleHook'](_0x46d03c,_0x58a034){const _0x46685f=_0x35a251;Cesium__namespace['defined'](_0x58a034[_0x46685f(0x9db)])&&Object['keys'](_0x58a034)===0x1?super['_updateStyleHook'](_0x46d03c,_0x58a034):this[_0x46685f(0xaf9)](_0x46d03c);}['_getDrawEntityClass'](_0x2bda01,_0x2065b5){const _0xc420ee={_0x5b5dcd:0x282},_0x20d4bc=_0x35a251;return create$4(_0x20d4bc(_0xc420ee._0x5b5dcd),_0x2bda01);}}register$4('polylineP',PolylinePrimitive);class BaseLayer extends BaseClass{constructor(_0x45b449={}){const _0x5693df={_0x2b6937:0xe86,_0x42461d:0x435,_0x4aa6a7:0x1f4,_0xfe1cb6:0xfb0,_0x3e6511:0x6a3,_0x331360:0x741},_0x5b1fa2=_0x35a251;super(_0x45b449),this[_0x5b1fa2(_0x5693df._0x2b6937)]=_0x45b449,_0x45b449['id']=_0x45b449['id']??createGuid(),_0x45b449['pid']=_0x45b449['pid']??-0x1,this[_0x5b1fa2(_0x5693df._0x42461d)]=_0x45b449['show']??!![],this['_private']=_0x45b449['private'],this[_0x5b1fa2(0xfb0)]=_0x45b449['opacity']??0x1,Cesium__namespace['defined'](_0x45b449[_0x5b1fa2(_0x5693df._0x4aa6a7)])&&(this[_0x5b1fa2(_0x5693df._0xfe1cb6)]=_0x45b449['alpha']),this[_0x5b1fa2(0xe86)]['proxy']&&(isString(this['options']['proxy'])?this['_proxy']=new Cesium__namespace['DefaultProxy'](this['options']['proxy']):this[_0x5b1fa2(_0x5693df._0x3e6511)]=this[_0x5b1fa2(_0x5693df._0x2b6937)][_0x5b1fa2(_0x5693df._0x331360)]),replaceOnlineUrlDomain(this['options']),this['_bindControl'](),this['_readyPromise']=Cesium__namespace[_0x5b1fa2(0xf75)](),this['_state']=State['INITIALIZED'];}get['id'](){return this['options']['id'];}set['id'](_0x22c064){this['options']['id']=_0x22c064;}get['uuid'](){return this['options']['id'];}get['name'](){return this['options']['name'];}set['name'](_0x5489b4){this['options']['name']=_0x5489b4;}get[_0x35a251(0x18d)](){const _0x5748e1={_0x3a10f0:0x18d},_0x37109d=_0x35a251;return this[_0x37109d(0xe86)][_0x37109d(_0x5748e1._0x3a10f0)];}set['pid'](_0x20b92b){this['options']['pid']=_0x20b92b;}get['type'](){return this['_type'];}get['state'](){const _0x1c2256={_0xe061ae:0xf96},_0x170a31=_0x35a251;return this[_0x170a31(_0x1c2256._0xe061ae)];}get['isAdded'](){return this['_state']===State['ADDED'];}get['isDestroy'](){return this['_state']===State['DESTROY'];}get['isPrivate'](){if(this['_private'])return!![];return![];}get[_0x35a251(0x3e2)](){const _0x409ac5={_0x4a1108:0x4ac},_0x15144e=_0x35a251;return this[_0x15144e(_0x409ac5._0x4a1108)]['promise'];}get[_0x35a251(0x87)](){return null;}get['show'](){return this['_show'];}set[_0x35a251(0x987)](_0x4431e8){const _0xa8d2c2={_0x4972ef:0x87,_0x57e3b7:0xa40,_0x1fdd02:0x987,_0x53948c:0x264,_0x4220dc:0x2c3},_0x148e78=_0x35a251;if(this['_show']===_0x4431e8||this['isDestroy'])return;this['options']['show']=_0x4431e8,this['_show']=_0x4431e8,this['layer']&&(Array['isArray'](this['layer'])?this[_0x148e78(_0xa8d2c2._0x4972ef)]['forEach'](function(_0x3d320f){const _0x21b7cc=_0x148e78;_0x3d320f[_0x21b7cc(0x987)]=_0x4431e8;}):this[_0x148e78(0x87)]['show']=_0x4431e8),this[_0x148e78(0x47f)]&&(this['_showHook']&&this[_0x148e78(_0xa8d2c2._0x57e3b7)](_0x4431e8),_0x4431e8?this['fire'](EventType[_0x148e78(_0xa8d2c2._0x1fdd02)]):this[_0x148e78(_0xa8d2c2._0x53948c)](EventType[_0x148e78(_0xa8d2c2._0x4220dc)]));}get[_0x35a251(0xddf)](){const _0x530258=_0x35a251;if(this['options']['hasOpacity']===![])return![];return!!this[_0x530258(0x45c)];}get[_0x35a251(0xbf2)](){return this['_opacity'];}set[_0x35a251(0xbf2)](_0x26b1e9){const _0x999252=_0x35a251;this['_opacity']=_0x26b1e9,this['setOpacity']&&this[_0x999252(0x45c)](_0x26b1e9);}['addTo'](_0x12e5bb){const _0x1e1f0b={_0x5c48fc:0x6f7},_0xb9fb02=_0x35a251;return _0x12e5bb&&_0x12e5bb['addLayer']&&_0x12e5bb[_0xb9fb02(_0x1e1f0b._0x5c48fc)](this),this;}['remove'](_0x14267d){const _0x54b351=_0x35a251;this['_map']&&this['_map'][_0x54b351(0xad7)](this,_0x14267d);}[_0x35a251(0x85f)](_0x28ca67){const _0x49589c={_0x239d9e:0x6ec,_0x5d62eb:0xa7e,_0x5c4e07:0x6f7},_0x308018=_0x35a251;var _0x4cac4d;if(this['isAdded']||this['_state']===State[_0x308018(0x9b4)])return;this['_state']=State['ADD'],this['_map']=_0x28ca67;if(this['options'][_0x308018(_0x49589c._0x239d9e)])this[_0x308018(0x72f)](this['options']['eventParent']);else{if(((_0x4cac4d=this['options'])===null||_0x4cac4d===void 0x0?void 0x0:_0x4cac4d['eventParent'])===![]);else this['addEventParent'](_0x28ca67);}this['_mountedHook']&&!this['_createOK']&&(this['_mountedHook'](),this[_0x308018(_0x49589c._0x5d62eb)]=!![]),this['_addedHook']&&this['_addedHook'](),this['options']['flyTo']&&this[_0x308018(0x1ff)]({'duration':0x0}),this[_0x308018(0xf96)]=State['ADDED'],this['fire'](EventType['add']),this['fire'](EventType[_0x308018(_0x49589c._0x5c4e07)],{},!![]);}['_onRemove'](){const _0x19ff63={_0x1db34b:0xf96,_0x1e02ff:0x264},_0x13ea63=_0x35a251;var _0x3b1f9d,_0xb1d386;if(this[_0x13ea63(0xf96)]!==State['ADDED'])return;if(!this['_map'])return;this['_removedHook']&&this['_removedHook'](),this[_0x13ea63(_0x19ff63._0x1db34b)]=State['REMOVED'],this[_0x13ea63(_0x19ff63._0x1e02ff)](EventType['remove']),this[_0x13ea63(0x264)](EventType[_0x13ea63(0xad7)],{},!![]);if((_0x3b1f9d=this['options'])!==null&&_0x3b1f9d!==void 0x0&&_0x3b1f9d['eventParent'])this['removeEventParent'](this['options']['eventParent']);else{if(((_0xb1d386=this[_0x13ea63(0xe86)])===null||_0xb1d386===void 0x0?void 0x0:_0xb1d386['eventParent'])===![]);else this['removeEventParent'](this[_0x13ea63(0xd79)]);}this['_map']=null;}['_mountedHook'](){}[_0x35a251(0x97b)](){}['_removedHook'](){}['fire'](_0x5e09ff,_0x3bb112={},_0x4021f7){return!_0x3bb112['layer']&&(_0x3bb112['layer']=this),super['fire'](_0x5e09ff,_0x3bb112,_0x4021f7);}['flyToByAnimationEnd'](_0x2cf395){const _0x1da043={_0x2a615a:0x5b2},_0x23e6aa=_0x35a251;if(!this['_map']||!this[_0x23e6aa(0x987)])return this;return this['_map']['isFlyAnimation']()?this[_0x23e6aa(0xd79)]['openFlyAnimationEndFun']=()=>{const _0x1fb889=_0x23e6aa;this[_0x1fb889(_0x1da043._0x2a615a)](_0x2cf395);}:this['flyTo'](_0x2cf395),this;}[_0x35a251(0x5b2)](_0x2a61b9){const _0x3e76f5={_0x692023:0x2fe},_0x28f00e=_0x35a251,_0x336b79=this[_0x28f00e(_0x3e76f5._0x692023)](_0x2a61b9);return _0x336b79?_0x336b79:this['readyPromise']['then'](_0x5846ba=>{return this['_flyTo'](_0x2a61b9);});}[_0x35a251(0x2fe)](_0x149dff={}){const _0x34e782={_0x5a54e0:0xe86,_0x55123c:0xd79,_0x3a8e35:0xe86,_0x209e53:0x176},_0x313841=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);this['options']['flyToOptions']&&(_0x149dff={...this[_0x313841(_0x34e782._0x5a54e0)]['flyToOptions'],..._0x149dff});this['_map']['cancelFlyTo']();if(this['options']['center'])return this[_0x313841(_0x34e782._0x55123c)][_0x313841(0x1e4)](this[_0x313841(_0x34e782._0x3a8e35)][_0x313841(_0x34e782._0x209e53)],_0x149dff);const _0x3bdfa8=this['options']['extent']||this[_0x313841(0xe84)]||this['getRectangle']&&this[_0x313841(0x878)]();if(_0x3bdfa8)return this['_map']['flyToExtent'](_0x3bdfa8,_0x149dff);}['setOptions'](_0x2f7e5d){const _0x5d82ca={_0x379b8c:0xbf2,_0x5df94b:0xbab,_0x1ff4d0:0xbfc},_0x571fdb=_0x35a251;if(!_0x2f7e5d||Object['keys'](_0x2f7e5d)['length']===0x0)return this;return this['options']=merge(this['options'],_0x2f7e5d),Cesium__namespace[_0x571fdb(0xaa2)](_0x2f7e5d['opacity'])&&(this[_0x571fdb(_0x5d82ca._0x379b8c)]=_0x2f7e5d['opacity']),Cesium__namespace['defined'](_0x2f7e5d['name'])&&(this['name']=_0x2f7e5d['name']),Cesium__namespace['defined'](_0x2f7e5d['show'])&&(this['show']=_0x2f7e5d['show']),this[_0x571fdb(_0x5d82ca._0x5df94b)](),this[_0x571fdb(_0x5d82ca._0x1ff4d0)]&&this['_setOptionsHook'](this[_0x571fdb(0xe86)],_0x2f7e5d),this;}[_0x35a251(0x99e)](){const _0x30c20a=clone(this['options'],['parent','eventParent']);return _0x30c20a['id']=this['id'],_0x30c20a['type']=this['type'],_0x30c20a['show']=this['show'],this['_toJsonEx'](_0x30c20a),_0x30c20a;}[_0x35a251(0xbdb)](_0x2b7b58){}['_bindControl'](){const _0x1e05ec={_0x5d9358:0x606,_0x5b564d:0xaa2,_0x5e8536:0xe86,_0x364d95:0xdf7,_0x354988:0x504},_0x479d6b=_0x35a251;Cesium__namespace['defined'](this['options']['contextmenuItems'])&&(this[_0x479d6b(0xe86)]['contextmenuItems']?this['_contextmenuConfig']={'content':this['options']['contextmenuItems'],'options':this['options']['contextmenuOptions'],'layer':this}:this[_0x479d6b(_0x1e05ec._0x5d9358)]=null);if(Cesium__namespace[_0x479d6b(_0x1e05ec._0x5b564d)](this['options']['popup'])){if(this['options']['popup']){const _0x5e8644=this[_0x479d6b(_0x1e05ec._0x5e8536)]['popupOptions']||{};this[_0x479d6b(_0x1e05ec._0x364d95)]={'options':_0x5e8644,'content':bindLayerPopup(_0x5e8644,this['options']['popup'],this['name']),'layer':this};}else this[_0x479d6b(_0x1e05ec._0x364d95)]=null;}if(Cesium__namespace['defined'](this['options']['tooltip'])){if(this['options']['tooltip']){const _0x3f5aec=this['options']['tooltipOptions']||{};this['_tooltipConfig']={'options':_0x3f5aec,'content':bindLayerPopup(_0x3f5aec,this['options'][_0x479d6b(0x631)],this[_0x479d6b(_0x1e05ec._0x354988)]),'layer':this};}else this['_tooltipConfig']=null;}}['_filterPropagateEvent'](_0x237af9,_0x257b80){if(_0x257b80['type']==='load')return![];return!![];}[_0x35a251(0xa63)](_0x5eb71c){const _0x16caf1={_0x269b4c:0x386},_0x4e89d4=_0x35a251;if(this['_state']===State['DESTROY'])return;this['_state']!==State['REMOVED']&&(this[_0x4e89d4(_0x16caf1._0x269b4c)]&&this['clear'](),this['remove']()),super['destroy'](_0x5eb71c),this['_state']=State['DESTROY'];}}function bindLayerPopup(_0x5eb1e7,_0x3a3b66,_0x178b85){return typeof _0x3a3b66==='function'?function(_0x236485){return _0x3a3b66(_0x236485);}:function(_0x59ad5f){const _0x1b0a97=_0x2767;let _0x46925d=_getAttrForPopup(_0x59ad5f);if(_0x46925d instanceof Promise)return _0x46925d['then'](_0x1c8293=>{const _0x427b9e=_0x2767;_0x46925d={'layer_name':_0x178b85,..._0x1c8293};let _0x5bba0d=_0x178b85;if(_0x5eb1e7['noTitle'])_0x5bba0d=null;else{if(_0x5eb1e7['title'])_0x5bba0d=_0x5eb1e7[_0x427b9e(0x732)];else _0x5eb1e7[_0x427b9e(0xa58)]&&(_0x5bba0d=_0x46925d[_0x5eb1e7[_0x427b9e(0xa58)]]);}return getTemplateHtml({'title':_0x5bba0d,'template':_0x3a3b66,'attr':_0x46925d});});else{_0x46925d={'layer_name':_0x178b85,..._0x46925d};let _0x2cc088=_0x178b85;if(_0x5eb1e7['noTitle'])_0x2cc088=null;else{if(_0x5eb1e7[_0x1b0a97(0x732)])_0x2cc088=_0x5eb1e7['title'];else _0x5eb1e7['titleField']&&(_0x2cc088=_0x46925d[_0x5eb1e7[_0x1b0a97(0xa58)]]);}return getTemplateHtml({'title':_0x2cc088,'template':_0x3a3b66,'attr':_0x46925d});}};}function _getAttrForPopup(_0x50081d){const _0x2d955b={_0x20bb69:0x6b3,_0x5598f4:0x371},_0x17d76e=_0x35a251;var _0x5e8e8a;if(_0x50081d!==null&&_0x50081d!==void 0x0&&_0x50081d[_0x17d76e(_0x2d955b._0x20bb69)])return _0x50081d['attr'];if(_0x50081d!==null&&_0x50081d!==void 0x0&&(_0x5e8e8a=_0x50081d['graphic'])!==null&&_0x5e8e8a!==void 0x0&&_0x5e8e8a['attr'])return _0x50081d['graphic']['attr'];if(!_0x50081d['czmObject'])return{};let _0x44a8b2=_0x50081d[_0x17d76e(_0x2d955b._0x5598f4)]['_attr']||_0x50081d['czmObject']['properties']||_0x50081d['czmObject']['attribute'];return _0x44a8b2&&_0x44a8b2['type']&&_0x44a8b2[_0x17d76e(0x6b3)]&&(_0x44a8b2=_0x44a8b2['attr']),_0x44a8b2??{};}class BaseGraphicLayer extends BaseLayer{constructor(_0x4f1efa={}){const _0x56458a={_0x5452af:0xd05,_0xf0157a:0xd05},_0x59c3e4=_0x35a251;_0x4f1efa[_0x59c3e4(_0x56458a._0x5452af)]&&_0x4f1efa['templateValues']&&(_0x4f1efa[_0x59c3e4(_0x56458a._0xf0157a)]=template(_0x4f1efa['url'],_0x4f1efa['templateValues'])),super(_0x4f1efa);}['_showHook'](_0x25ed1c){const _0x2e562c={_0x32ea55:0x400},_0x5a76df=_0x35a251;!_0x25ed1c&&this[_0x5a76df(_0x2e562c._0x32ea55)]();}['_addedHook'](){const _0x55a642={_0x2a5b99:0x716,_0x58cd32:0xe86},_0x68f32b=_0x35a251;var _0x20cde5,_0x5c33cc;if(this['options'][_0x68f32b(_0x55a642._0x2a5b99)])this['bindHighlight'](this[_0x68f32b(0xe86)]['highlight']);else(_0x20cde5=this[_0x68f32b(_0x55a642._0x58cd32)]['symbol'])!==null&&_0x20cde5!==void 0x0&&(_0x5c33cc=_0x20cde5['styleOptions'])!==null&&_0x5c33cc!==void 0x0&&_0x5c33cc['highlight']&&this['bindHighlight'](this[_0x68f32b(0xe86)]['symbol']['styleOptions']['highlight']);}['_removedHook'](){const _0x339f75=_0x35a251;this['_closeAllControl'](),this[_0x339f75(0x428)]();}[_0x35a251(0xbfc)](_0x1a6164,_0xde9c2a){const _0x4406d0={_0x10cd3a:0x5ac,_0x447382:0x716},_0x225fca=_0x35a251;var _0x3cf084,_0x1a16b8;this['_highlightOptions']&&this['unbindHighlight']();if(_0xde9c2a['highlight'])this['bindHighlight'](_0x1a6164['highlight']);else(_0x3cf084=_0xde9c2a['symbol'])!==null&&_0x3cf084!==void 0x0&&(_0x1a16b8=_0x3cf084['styleOptions'])!==null&&_0x1a16b8!==void 0x0&&_0x1a16b8['highlight']&&this[_0x225fca(0xc01)](_0x1a6164[_0x225fca(0x357)][_0x225fca(_0x4406d0._0x10cd3a)][_0x225fca(_0x4406d0._0x447382)]);}['_closeAllControl'](){const _0x3d1a00={_0x2e713d:0x90b,_0x60c496:0x668},_0x5deaea=_0x35a251;this[_0x5deaea(_0x3d1a00._0x2e713d)](),this['closeTooltip'](),this['closeSmallTooltip'](),this[_0x5deaea(_0x3d1a00._0x60c496)]();}['bindHighlight'](_0x34be8c){const _0x31e26c={_0x543a13:0x3eb,_0x3234cc:0x6cc,_0x318fb2:0xd47},_0x15c2f9=_0x35a251;this['unbindHighlight'](),this[_0x15c2f9(_0x31e26c._0x543a13)]=_0x34be8c,this[_0x15c2f9(0x3eb)][_0x15c2f9(0x8ea)]===EventType['click']?this['on'](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['on'](EventType['mouseOver'],this['_highlight_mouseEventHandler'],this),this['on'](EventType[_0x15c2f9(_0x31e26c._0x3234cc)],this[_0x15c2f9(_0x31e26c._0x318fb2)],this));}['unbindHighlight'](){const _0x51ab62=_0x35a251;this['_highlightOptions']&&(this['off'](EventType['click'],this['_highlight_mouseEventHandler'],this),this[_0x51ab62(0x6b2)](EventType['mouseOver'],this['_highlight_mouseEventHandler'],this),this['off'](EventType[_0x51ab62(0x6cc)],this['_highlight_mouseOutHandler'],this),this['_map']['closeHighlight'](),this['_highlightOptions']=null);}['_highlight_mouseEventHandler'](_0x48e995){const _0x372947={_0x5efa8a:0xd79},_0x71533f=_0x35a251;if(!this[_0x71533f(_0x372947._0x5efa8a)])return;const _0x162e86=_0x48e995===null||_0x48e995===void 0x0?void 0x0:_0x48e995['graphic'];_0x162e86?this['_map']['openHighlight'](_0x162e86,this['_highlightOptions'],_0x48e995):this['_map']['closeHighlight']();}['_highlight_mouseOutHandler'](_0x19a94b){const _0x4cfaf7=_0x35a251;this[_0x4cfaf7(0xd79)]['closeHighlight']();}[_0x35a251(0xaf0)](_0x3e4e4c,_0x4a2a13){const _0x567bcc={_0x149931:0x3eb},_0x1ebfe7=_0x35a251;if(!this['_map']||!_0x3e4e4c)return;this['_map'][_0x1ebfe7(0xaf0)](_0x3e4e4c,this[_0x1ebfe7(_0x567bcc._0x149931)],_0x4a2a13);}['closeHighlight'](){const _0xd56b98={_0x17a167:0xd79},_0x5923c5=_0x35a251;this[_0x5923c5(_0xd56b98._0x17a167)]['closeHighlight']();}['hasPopup'](){const _0x17b6db=_0x35a251;if(this['_popupConfig'])return!![];if(this['_graphicList']){const _0x59aa02=this['_graphicList']['values'];for(let _0x16ae83=0x0,_0x44804b=_0x59aa02[_0x17b6db(0xe1e)];_0x16ae83<_0x44804b;_0x16ae83++){const _0x185990=_0x59aa02[_0x16ae83];if(_0x185990[_0x17b6db(0xdf7)])return!![];}}return![];}['bindPopup'](_0x951c09,_0x4f46a1){const _0x5e8833={_0x2389e8:0xebc},_0x43b82d=_0x35a251;return this['_popupConfig']={'content':_0x951c09,'options':_0x4f46a1||this['options'][_0x43b82d(_0x5e8833._0x2389e8)],'layer':this},this;}['unbindPopup'](_0x4eb573){const _0x2c5cef=_0x35a251;return this['closePopup'](),_0x4eb573?this['_popupConfig']=![]:this[_0x2c5cef(0xdf7)]=null,this;}[_0x35a251(0x83c)](_0x2c25e1){const _0x3ca055={_0x37c635:0x83c},_0x2e9d2a=_0x35a251;if(_0x2c25e1[_0x2e9d2a(_0x3ca055._0x37c635)])_0x2c25e1[_0x2e9d2a(0x83c)]();else this['_popupConfig']&&_0x2c25e1&&this['_map']&&(this['_popupConfig']['graphic']=null,this['_map']['popup'][_0x2e9d2a(0x8d8)](_0x2c25e1,this['_popupConfig']));return this;}[_0x35a251(0x90b)](){const _0x48dce8=_0x35a251;return this['_map']&&this[_0x48dce8(0x25e)]()&&this[_0x48dce8(0xd79)]['popup']['close'](null,this),this;}['hasTooltip'](){const _0x4eeab7={_0x240e37:0x587},_0x55cf73=_0x35a251;if(this['_tooltipConfig'])return!![];if(this['_graphicList']){const _0xe6be5b=this[_0x55cf73(_0x4eeab7._0x240e37)]['values'];for(let _0x46d87f=0x0,_0x34aab3=_0xe6be5b['length'];_0x46d87f<_0x34aab3;_0x46d87f++){const _0x578d01=_0xe6be5b[_0x46d87f];if(_0x578d01['_tooltipConfig'])return!![];}}return![];}['bindTooltip'](_0x5c717f,_0x201d54){const _0x22699a=_0x35a251;return this['_tooltipConfig']={'content':_0x5c717f,'options':_0x201d54||this['options'][_0x22699a(0x69d)],'layer':this},this;}['unbindTooltip'](_0x334190){return _0x334190?this['_tooltipConfig']=![]:this['_tooltipConfig']=null,this['closeTooltip'](),this;}['openTooltip'](_0x1fd459){const _0xb2a3ee={_0x9f778c:0x8f2,_0x12bfeb:0xd79,_0xa377a2:0x631},_0xf6e964=_0x35a251;if(_0x1fd459['openTooltip'])_0x1fd459['openTooltip']();else this['_tooltipConfig']&&_0x1fd459&&this['_map']&&(this[_0xf6e964(_0xb2a3ee._0x9f778c)]['graphic']=null,this[_0xf6e964(_0xb2a3ee._0x12bfeb)][_0xf6e964(_0xb2a3ee._0xa377a2)]['open'](_0x1fd459,this['_tooltipConfig']));return this;}[_0x35a251(0x8c5)](){return this['_map']&&this['hasTooltip']()&&this['_map']['tooltip']['close'](null,this),this;}['hasContextMenu'](){const _0xc15d57={_0x1b2bb7:0x606},_0x51590f=_0x35a251;if(this[_0x51590f(_0xc15d57._0x1b2bb7)])return!![];if(this[_0x51590f(0x587)]){const _0x3cf5bc=this[_0x51590f(0x587)]['values'];for(let _0x4cf006=0x0,_0x5a8fb5=_0x3cf5bc['length'];_0x4cf006<_0x5a8fb5;_0x4cf006++){const _0x47eab7=_0x3cf5bc[_0x4cf006];if(_0x47eab7['_contextmenuConfig'])return!![];}}return![];}['getContextMenu'](){return this['_contextmenuConfig'];}['bindContextMenu'](_0xbb0279,_0x12af0d){const _0x4df5b3={_0x33463c:0x606,_0x4b4345:0xe86,_0x462cf1:0xca0},_0x24b79d=_0x35a251;return this[_0x24b79d(_0x4df5b3._0x33463c)]={'content':_0xbb0279,'options':_0x12af0d||this[_0x24b79d(_0x4df5b3._0x4b4345)][_0x24b79d(_0x4df5b3._0x462cf1)],'layer':this},this;}[_0x35a251(0xe12)](_0x150108){const _0x5625f0={_0x1f119c:0x606},_0x49482b=_0x35a251;return _0x150108?this[_0x49482b(_0x5625f0._0x1f119c)]=![]:this[_0x49482b(0x606)]=null,this['closeContextMenu'](),this;}[_0x35a251(0xaf1)](_0x3a5cf6){const _0x218534={_0x267bfb:0x606,_0x9b7aff:0xf8c},_0x14c791=_0x35a251;if(_0x3a5cf6['openContextMenu'])_0x3a5cf6[_0x14c791(0xaf1)]();else this[_0x14c791(0x606)]&&_0x3a5cf6&&this['_map']&&(this[_0x14c791(_0x218534._0x267bfb)][_0x14c791(_0x218534._0x9b7aff)]=null,this[_0x14c791(0xd79)]['contextmenu']['open'](_0x3a5cf6,this['_contextmenuConfig']));return this;}['closeContextMenu'](){const _0x174a90={_0x4b4b99:0x5e9},_0x593ec0=_0x35a251;return this['_map']&&this['hasContextMenu']()&&this['_map']['contextmenu'][_0x593ec0(_0x174a90._0x4b4b99)](null,this),this;}['openSmallTooltip'](_0x3d6d6e,_0x422be6){const _0x5b9667={_0x8ec32d:0xd79},_0xd64b17=_0x35a251;return this['_map']&&this[_0xd64b17(_0x5b9667._0x8ec32d)][_0xd64b17(0x771)](_0x3d6d6e,_0x422be6),this;}['closeSmallTooltip'](){return this['_map']&&this['_map']['closeSmallTooltip'](),this;}}class GraphicLayer extends BaseGraphicLayer{constructor(_0x5cf407={}){const _0x595d86=_0x35a251;super(_0x5cf407),this[_0x595d86(0xbfc)](_0x5cf407,_0x5cf407),this['_graphicList']=new MarsArray();}['_setOptionsHook'](_0x29456c,_0x22edcc){super['_setOptionsHook'](_0x29456c,_0x22edcc),this['hasEdit']=_0x29456c['hasEdit']??![],this['isAutoEditing']=_0x29456c['isAutoEditing']??!![],this['isContinued']=_0x29456c['isContinued']??![];}get['layer'](){const _0x3f80ea={_0x165843:0xd3c,_0x5944ff:0xb41,_0x90edd4:0xb41,_0x5875b6:0x283,_0x229ce8:0x1bb},_0x2e32b9=_0x35a251,_0x54f127=[];return this['_dataSource']&&_0x54f127['push'](this['_dataSource']),this[_0x2e32b9(0xd3c)]&&_0x54f127['push'](this[_0x2e32b9(_0x3f80ea._0x165843)]),this['_labelCollection']&&_0x54f127['push'](this['_labelCollection']),this[_0x2e32b9(_0x3f80ea._0x5944ff)]&&_0x54f127['push'](this[_0x2e32b9(_0x3f80ea._0x90edd4)]),this[_0x2e32b9(_0x3f80ea._0x5875b6)]&&_0x54f127['push'](this[_0x2e32b9(0x283)]),this['_pointCollection']&&_0x54f127['push'](this['_pointCollection']),this[_0x2e32b9(_0x3f80ea._0x229ce8)]&&_0x54f127['push'](this['_polylineCollection']),_0x54f127;}get['clustering'](){const _0x55dfcb={_0x264459:0xad5},_0x24c92a=_0x35a251;var _0xf960a6,_0x2db1bf;return(_0xf960a6=this[_0x24c92a(_0x55dfcb._0x264459)])===null||_0xf960a6===void 0x0?void 0x0:(_0x2db1bf=_0xf960a6['clustering'])===null||_0x2db1bf===void 0x0?void 0x0:_0x2db1bf['enabled'];}set[_0x35a251(0xbf7)](_0x8978a9){const _0x559a37=_0x35a251;var _0x1199f1;(_0x1199f1=this[_0x559a37(0xad5)])!==null&&_0x1199f1!==void 0x0&&_0x1199f1['clustering']&&(this['dataSource']['clustering']['enabled']=_0x8978a9);}get['dataSource'](){const _0x195bc4={_0x34c4fe:0x987,_0x273694:0x987,_0x5b0972:0xaa2},_0xf21fc=_0x35a251;return!this['_dataSource']&&(this['_dataSource']=new Cesium__namespace['CustomDataSource'](this['id']),this['_dataSource'][_0xf21fc(_0x195bc4._0x34c4fe)]=this[_0xf21fc(_0x195bc4._0x273694)],this['_map']&&(this['_map']['dataSources']['add'](this['_dataSource']),Cesium__namespace[_0xf21fc(_0x195bc4._0x5b0972)](this['options']['zIndex'])&&(this[_0xf21fc(0x31f)]=this['options']['zIndex']))),this['_dataSource'];}get[_0x35a251(0x293)](){const _0x401f28={_0x3d4a4c:0x31f},_0x5f1b79=_0x35a251;return!this[_0x5f1b79(0xd3c)]&&(this['_primitiveCollection']=new Cesium__namespace['PrimitiveCollection'](this['options']),this['_primitiveCollection']['show']=this['show'],this['_map']&&(this['_map'][_0x5f1b79(0xc60)][_0x5f1b79(0x4e1)]['add'](this[_0x5f1b79(0xd3c)]),Cesium__namespace['defined'](this['options']['zIndex'])&&(this[_0x5f1b79(_0x401f28._0x3d4a4c)]=this['options']['zIndex']))),this['_primitiveCollection'];}get['labelCollection'](){const _0x4989b6={_0xcddb14:0x987},_0x32c2d6=_0x35a251;return!this[_0x32c2d6(0xcba)]&&(this['_labelCollection']=new Cesium__namespace['LabelCollection']({...this['options'],'scene':this['_map'][_0x32c2d6(0xc60)]}),this['_labelCollection'][_0x32c2d6(0x987)]=this[_0x32c2d6(_0x4989b6._0xcddb14)],this['_map']&&this['_map'][_0x32c2d6(0xc60)]['primitives']['add'](this['_labelCollection'])),this['_labelCollection'];}get[_0x35a251(0x7ca)](){const _0xf1a98b={_0x329bb2:0x51f},_0x354f35=_0x35a251;return!this['_pointCollection']&&(this['_pointCollection']=new Cesium__namespace[(_0x354f35(0x258))](this['options']),this['_pointCollection']['show']=this[_0x354f35(0x987)],this['_map']&&this[_0x354f35(0xd79)]['scene']['primitives']['add'](this[_0x354f35(_0xf1a98b._0x329bb2)])),this['_pointCollection'];}get[_0x35a251(0xbb5)](){const _0x5f4c08={_0xac265f:0xb41,_0xd4e082:0xd79,_0x59e1ea:0x987},_0x5a08d9=_0x35a251;return!this['_billboardCollection']&&(this[_0x5a08d9(_0x5f4c08._0xac265f)]=new Cesium__namespace[(_0x5a08d9(0x512))]({...this['options'],'scene':this[_0x5a08d9(_0x5f4c08._0xd4e082)]['scene']}),this['_billboardCollection'][_0x5a08d9(_0x5f4c08._0x59e1ea)]=this[_0x5a08d9(_0x5f4c08._0x59e1ea)],this['_map']&&this['_map']['scene']['primitives']['add'](this['_billboardCollection'])),this['_billboardCollection'];}get['cloudCollection'](){const _0x5c89ee={_0x280016:0xe86,_0x3f2ecd:0x987},_0x41fa6c=_0x35a251;return!this['_cloudCollection']&&(this['_cloudCollection']=new Cesium__namespace['CloudCollection'](this[_0x41fa6c(_0x5c89ee._0x280016)]['cloud']),this['_cloudCollection'][_0x41fa6c(0x987)]=this[_0x41fa6c(_0x5c89ee._0x3f2ecd)],this[_0x41fa6c(0xd79)]&&this['_map']['scene']['primitives']['add'](this['_cloudCollection'])),this['_cloudCollection'];}get['polylineCollection'](){const _0x56db6d={_0x26affb:0x4af,_0x43ec1a:0x1bb},_0x1ae163=_0x35a251;return!this['_polylineCollection']&&(this['_polylineCollection']=new Cesium__namespace['PolylineCollection'](this['options']),this['_polylineCollection']['show']=this['show'],this[_0x1ae163(0xd79)]&&this['_map']['scene']['primitives'][_0x1ae163(_0x56db6d._0x26affb)](this['_polylineCollection'])),this[_0x1ae163(_0x56db6d._0x43ec1a)];}get['container'](){const _0x1f3dba={_0x297d1f:0xd79},_0x101848=_0x35a251;return!this[_0x101848(0x5f4)]&&(this['_container']=create$3('div','mars3d-divlayer'),this['show']?this['_container']['style'][_0x101848(0x922)]=_0x101848(0x678):this[_0x101848(0x5f4)]['style']['display']='none',this[_0x101848(_0x1f3dba._0x297d1f)]&&this['_map']['container']['appendChild'](this['_container'])),this['_container'];}get[_0x35a251(0x795)](){return this['_pointerEvents'];}set['pointerEvents'](_0x4d4431){const _0x5f52f8=_0x35a251;this['_pointerEvents']=_0x4d4431,_0x4d4431?this['container']['style']['pointer-events']='all':this['container'][_0x5f52f8(0xfc8)]['pointer-events']=_0x5f52f8(0x274);}get['objectsToExclude'](){const _0x48d1b0={_0x330739:0xdbd},_0x27b171=_0x35a251;if(this[_0x27b171(0x5c3)])return this['_objectsToExclude'];return!this['_objectsToExclude_auto']&&(this[_0x27b171(0xb55)]=[],this[_0x27b171(0x587)]['forEach'](_0x3eb3bc=>{const _0x56fad3={_0x5f0a30:0x6de},_0x1070e8=_0x27b171,_0x34f1ba=_0x3eb3bc[_0x1070e8(0x59a)];if(_0x34f1ba&&_0x34f1ba['length']>0x0)_0x34f1ba[_0x1070e8(_0x48d1b0._0x330739)](_0x487d9d=>{const _0x5ec60d=_0x1070e8;this[_0x5ec60d(0xb55)]['indexOf'](_0x487d9d)===-0x1&&this['_objectsToExclude_auto'][_0x5ec60d(_0x56fad3._0x5f0a30)](_0x487d9d);});else{if(_0x3eb3bc['czmObject']){const _0x2d6c28=_0x3eb3bc['czmObject'];this['_objectsToExclude_auto']['indexOf'](_0x2d6c28)===-0x1&&this['_objectsToExclude_auto']['push'](_0x2d6c28);}}},this)),this['_objectsToExclude_auto'];}set[_0x35a251(0x59a)](_0x3742d6){this['_objectsToExclude']=_0x3742d6;}get[_0x35a251(0xe8e)](){return!![];}get['zIndex'](){return this['options']['zIndex'];}set[_0x35a251(0x31f)](_0x458c2a){const _0x510001=_0x35a251;this['options'][_0x510001(0x31f)]=_0x458c2a;if(_0x458c2a==null)return;setTimeout(()=>{this['_setZIndex'](_0x458c2a);},0x64);}['_setZIndex'](_0x5db6ba){const _0x17c82a={_0x584abb:0xc60,_0x5db8c4:0xd3c,_0x131b72:0xd79,_0xdf5fc0:0x888,_0x13bc7b:0x69b,_0x3e4dcd:0x38e},_0x5bec8f=_0x35a251;if(!this[_0x5bec8f(0x47f)])return;if(this['_primitiveCollection']){this[_0x5bec8f(0xd3c)]['zIndex']=_0x5db6ba,this[_0x5bec8f(0xd79)]['scene']['primitives']['raiseToTop'](this[_0x5bec8f(0xd3c)]);const _0x4b6683=this[_0x5bec8f(0xd79)]['scene']['primitives'];for(let _0x474c5a=_0x4b6683['length']-0x1;_0x474c5a>=0x0;_0x474c5a--){const _0x271778=_0x4b6683['get'](_0x474c5a);if(_0x271778===this[_0x5bec8f(0xd3c)])continue;Cesium__namespace['defined'](_0x271778['zIndex'])&&_0x5db6ba<_0x271778['zIndex']&&this['_map'][_0x5bec8f(_0x17c82a._0x584abb)][_0x5bec8f(0x4e1)]['lower'](this[_0x5bec8f(_0x17c82a._0x5db8c4)]);}}if(this['_dataSource']){this[_0x5bec8f(0x1a3)]['zIndex']=_0x5db6ba,this[_0x5bec8f(_0x17c82a._0x131b72)]['dataSources'][_0x5bec8f(0x209)](this['_dataSource']);const _0x97b264=this['_map']['dataSources'];for(let _0x69e86d=_0x97b264['length']-0x1;_0x69e86d>=0x0;_0x69e86d--){const _0x378d43=_0x97b264[_0x5bec8f(_0x17c82a._0xdf5fc0)](_0x69e86d);if(_0x378d43===this[_0x5bec8f(0x1a3)])continue;Cesium__namespace['defined'](_0x378d43['zIndex'])&&_0x5db6ba<_0x378d43['zIndex']&&this['_map'][_0x5bec8f(_0x17c82a._0x13bc7b)][_0x5bec8f(_0x17c82a._0x3e4dcd)](this['_dataSource']);}}}[_0x35a251(0xb7f)](){const _0x20d078={_0x32447c:0xd79,_0xd5fd5f:0xd79},_0x19d0d5=_0x35a251;if(this[_0x19d0d5(_0x20d078._0x32447c)]){if(this['_primitiveCollection'])return this['_map']['scene']['primitives']['raiseToTop'](this[_0x19d0d5(0xd3c)]);if(this['_dataSource'])return this[_0x19d0d5(_0x20d078._0xd5fd5f)]['dataSources']['raiseToTop'](this[_0x19d0d5(0x1a3)]);}}[_0x35a251(0xd60)](){const _0x3e2a63={_0x1f4019:0xd79},_0x27a736=_0x35a251;if(this['_map']){if(this[_0x27a736(0xd3c)])return this[_0x27a736(_0x3e2a63._0x1f4019)]['scene'][_0x27a736(0x4e1)][_0x27a736(0xd5f)](this[_0x27a736(0xd3c)]);if(this['_dataSource'])return this[_0x27a736(0xd79)]['dataSources']['lowerToBottom'](this['_dataSource']);}}get[_0x35a251(0xe1e)](){return this['_graphicList']['length'];}get['graphics'](){return this['getGraphics']();}get[_0x35a251(0xb70)](){const _0x3e4446=_0x35a251;return this[_0x3e4446(0x96f)];}set['hasEdit'](_0x2d59f5){_0x2d59f5?this['activateEdit']():this['disableEdit']();}get['isEditing'](){return this['_graphic_editing']!=null;}get['allowDrillPick'](){return this['options']['allowDrillPick'];}set['allowDrillPick'](_0x40a479){const _0x24fc9d=_0x35a251;this['options'][_0x24fc9d(0x676)]=_0x40a479;}[_0x35a251(0x85f)](_0xa81c12){const _0x4cfd6e={_0x3634ba:0x72f,_0x464405:0xc60,_0x39bd0c:0x4e1,_0x2b7a16:0xd79,_0x470960:0x4af,_0x117a7f:0x4af,_0xc02d1:0x97b},_0x1d28ef=_0x35a251;var _0x295b8f;if(this['_map'])return;this['_state']=State['ADD'],this['_map']=_0xa81c12;if(this[_0x1d28ef(0xe86)]['eventParent'])this['addEventParent'](this[_0x1d28ef(0xe86)]['eventParent']);else{if(((_0x295b8f=this['options'])===null||_0x295b8f===void 0x0?void 0x0:_0x295b8f['eventParent'])===![]);else this[_0x1d28ef(_0x4cfd6e._0x3634ba)](_0xa81c12);}this['_dataSource']&&this['_map']['dataSources']['add'](this['_dataSource']),this['_primitiveCollection']&&this['_map'][_0x1d28ef(_0x4cfd6e._0x464405)][_0x1d28ef(_0x4cfd6e._0x39bd0c)]['add'](this['_primitiveCollection']),this['_labelCollection']&&this['_map']['scene']['primitives']['add'](this['_labelCollection']),this['_billboardCollection']&&this[_0x1d28ef(_0x4cfd6e._0x2b7a16)]['scene']['primitives'][_0x1d28ef(_0x4cfd6e._0x470960)](this['_billboardCollection']),this['_cloudCollection']&&this['_map']['scene']['primitives'][_0x1d28ef(0x4af)](this['_cloudCollection']),this['_pointCollection']&&this[_0x1d28ef(0xd79)]['scene']['primitives']['add'](this['_pointCollection']),this['_polylineCollection']&&this['_map']['scene']['primitives'][_0x1d28ef(_0x4cfd6e._0x117a7f)](this['_polylineCollection']),this['_container']&&this['_map']['container']['appendChild'](this['_container']),this['_mountedHook']&&(!this[_0x1d28ef(0xa7e)]&&(this['_createOK']=!![],this['_mountedHook']())),this['_addedHook']&&this[_0x1d28ef(_0x4cfd6e._0xc02d1)](),this['_graphicList']['forEach'](_0x37e0fa=>{_0x37e0fa!==null&&_0x37e0fa!==void 0x0&&_0x37e0fa['_onAdd']&&_0x37e0fa['_onAdd'](this);},this),Cesium__namespace['defined'](this['options']['zIndex'])&&(this['zIndex']=this['options']['zIndex']),this[_0x1d28ef(0xf96)]=State['ADDED'],this['fire'](EventType[_0x1d28ef(0x6f7)],{'layer':this},!![]);}[_0x35a251(0x127)](){const _0x32ced8={_0x28db2d:0x1a3,_0x352b8f:0xd79,_0x24d43c:0xcba,_0x3a34f9:0xc60,_0x5e268a:0x283,_0x1853c8:0x5f4,_0x5cceda:0xfa2,_0x18198d:0x5f4,_0x4aa9e8:0x418,_0x3119d3:0xe86,_0x22de88:0x6ec,_0x207ec6:0x6ec},_0x547ab2={_0x12d769:0x127},_0x526ed3=_0x35a251;var _0x5daeef,_0x1e3950;if(this['_state']!==State['ADDED'])return;if(!this['_map'])return;this['_graphicList']['forEach'](_0x5b614e=>{const _0x3fb37b=_0x2767;(_0x5b614e===null||_0x5b614e===void 0x0?void 0x0:_0x5b614e['_onRemove'])&&_0x5b614e[_0x3fb37b(_0x547ab2._0x12d769)]();},this);this[_0x526ed3(_0x32ced8._0x28db2d)]&&this['_map'][_0x526ed3(0x69b)]['remove'](this['_dataSource']);this['_primitiveCollection']&&this[_0x526ed3(_0x32ced8._0x352b8f)]['scene']['primitives']['remove'](this['_primitiveCollection']);this['_labelCollection']&&this['_map']['scene']['primitives']['remove'](this[_0x526ed3(_0x32ced8._0x24d43c)]);this['_billboardCollection']&&this[_0x526ed3(0xd79)][_0x526ed3(_0x32ced8._0x3a34f9)]['primitives']['remove'](this['_billboardCollection']);this[_0x526ed3(_0x32ced8._0x5e268a)]&&this['_map']['scene']['primitives']['remove'](this[_0x526ed3(0x283)]);this['_pointCollection']&&this['_map']['scene']['primitives']['remove'](this['_pointCollection']);this['_polylineCollection']&&this[_0x526ed3(0xd79)][_0x526ed3(0xc60)]['primitives'][_0x526ed3(0x1ee)](this['_polylineCollection']);this['_container']&&this[_0x526ed3(_0x32ced8._0x1853c8)][_0x526ed3(0x803)]&&this['_map']['container'][_0x526ed3(_0x32ced8._0x5cceda)](this[_0x526ed3(_0x32ced8._0x18198d)]);this['_map']['scene']['primitives'][_0x526ed3(_0x32ced8._0x4aa9e8)]&&(this['_primitiveCollection']=null,this[_0x526ed3(0xcba)]=null,this[_0x526ed3(0xb41)]=null,this[_0x526ed3(_0x32ced8._0x5e268a)]=null,this['_pointCollection']=null,this['_polylineCollection']=null);this['_removedHook']&&this['_removedHook'](),this['_state']=State['REMOVED'],this['fire'](EventType['remove']),this[_0x526ed3(0x264)](EventType['removeLayer'],{'layer':this},!![]);if((_0x5daeef=this[_0x526ed3(_0x32ced8._0x3119d3)])!==null&&_0x5daeef!==void 0x0&&_0x5daeef[_0x526ed3(_0x32ced8._0x22de88)])this['removeEventParent'](this['options'][_0x526ed3(_0x32ced8._0x207ec6)]);else{if(((_0x1e3950=this['options'])===null||_0x1e3950===void 0x0?void 0x0:_0x1e3950['eventParent'])===![]);else this['removeEventParent'](this[_0x526ed3(0xd79)]);}this['_map']=null;}[_0x35a251(0xa40)](_0x39d70e){const _0x531a14={_0x5ae793:0xfc8,_0x209a30:0x587,_0x49f4c1:0x274},_0x4e619f={_0x1b6884:0x48b},_0x22944f=_0x35a251;super['_showHook'](_0x39d70e),_0x39d70e?this['_container']&&(this[_0x22944f(0x5f4)][_0x22944f(_0x531a14._0x5ae793)]['display']='block',this[_0x22944f(_0x531a14._0x209a30)][_0x22944f(0xdbd)](_0x12a1c4=>{const _0x17822b=_0x22944f;_0x12a1c4[_0x17822b(_0x4e619f._0x1b6884)]&&_0x12a1c4['updateDivPosition']();},this)):(this['_container']&&(this['_container']['style']['display']=_0x22944f(_0x531a14._0x49f4c1)),this['stopDraw']());}[_0x35a251(0x700)](){const _0x176772={_0x2c0e02:0x8ea,_0x15c407:0x336},_0xfad348={_0x5b9fab:0x943},_0x322595=_0x35a251;super['_mountedHook'](),this['on'](EventType['drawCreated'],_0x4a7208=>{this['stopDraw']();if(this['isContinued'])this['startDraw'](clone(_0x4a7208['graphic']['options']));else this['hasEdit']&&this['isAutoEditing']&&this['startEditing'](_0x4a7208['graphic']);},this),this['on'](EventType['load'],_0x103771=>{const _0x114bea=_0x2767;this['hasEdit']&&this[_0x114bea(0xd40)]&&this['_graphic_editing']===_0x103771['graphic']&&this['startEditing'](_0x103771['graphic']);},this),this['on'](EventType['removeGraphic'],_0x38e04f=>{const _0x2f49ae=_0x2767;this[_0x2f49ae(_0xfad348._0x5b9fab)]===_0x38e04f[_0x2f49ae(0xf8c)]&&(this[_0x2f49ae(_0xfad348._0x5b9fab)]=null),this['_graphic_editing']===_0x38e04f['graphic']&&(this['_graphic_editing']=null);},this),this['on'](EventType['editStart'],_0x34bfe9=>{this['_graphic_editing']=_0x34bfe9['graphic'];},this),this['on'](EventType['editStop'],_0x1aaa06=>{this['_graphic_editing']=null;},this),this['options']['clustering']&&this['_bindClustering'](this['options']['clustering']),this[_0x322595(_0x176772._0x2c0e02)]==='graphic'&&(this['options']['data']&&this['addGraphic'](this[_0x322595(0xe86)]['data']),this['_readyPromise']['resolve'](this)),this[_0x322595(0xe86)]['geojson']&&this[_0x322595(_0x176772._0x15c407)](this['options']['geojson']);}['_addedHook'](){const _0x4582f8={_0x91a9e3:0x97b,_0x11db9e:0x96f},_0x1b7039=_0x35a251;super[_0x1b7039(_0x4582f8._0x91a9e3)](),this[_0x1b7039(_0x4582f8._0x11db9e)]&&this['_bindEditEvent'](),this['options']['flyTo']&&this[_0x1b7039(0x1ff)]();}['_removedHook'](){const _0x391b55={_0x24175f:0xa9a,_0x3ac9c5:0x3b1},_0x51a955=_0x35a251;super[_0x51a955(_0x391b55._0x24175f)](),this['_hasEdit']&&(this['stopDraw'](),this[_0x51a955(_0x391b55._0x3ac9c5)]());}['getRectangle'](_0x32731a){const _0x27a072={_0x1c101d:0xdbd},_0x58a5c3=_0x35a251;let _0x123985;return this['_graphicList'][_0x58a5c3(_0x27a072._0x1c101d)](_0xbe9505=>{const _0x53629a=_0x58a5c3;if(!_0xbe9505['getRectangle'])return;const _0x22376b=_0xbe9505['getRectangle']();if(!Cesium__namespace['defined'](_0x22376b))return;_0x123985?_0x123985=Cesium__namespace['Rectangle'][_0x53629a(0xd8c)](_0x22376b,_0x123985):_0x123985=_0x22376b;},this),_0x32731a?formatRectangle(_0x123985):_0x123985;}['getMaxHeight'](){const _0x38f8d6=_0x35a251;let _0xd28525=0x0;return this[_0x38f8d6(0x587)]['forEach'](_0x1b9afd=>{if(!_0x1b9afd['getMaxHeight'])return;_0xd28525=Math['max'](_0x1b9afd['getMaxHeight'](),_0xd28525);},this),_0xd28525;}[_0x35a251(0x694)](_0x46ddf1){const _0x1ab125={_0x59c3c0:0x587,_0x57ff35:0xf47},_0x58277a={_0x48c89b:0x4b7},_0x1e9db8=_0x35a251;_0x46ddf1!==null&&_0x46ddf1!==void 0x0&&_0x46ddf1['stopEdit']&&this['stopEditing']();let _0x585dc1=[];return this[_0x1e9db8(_0x1ab125._0x59c3c0)]['forEach'](_0x369407=>{const _0x14e95c=_0x1e9db8;if(_0x369407[_0x14e95c(_0x58277a._0x48c89b)])return;const _0x6c5a53=_0x369407[_0x14e95c(0x694)](_0x46ddf1);if(!_0x6c5a53)return;Array['isArray'](_0x6c5a53)?_0x585dc1=_0x585dc1['concat'](_0x6c5a53):_0x585dc1[_0x14e95c(0x6de)](_0x6c5a53);},this),{'type':_0x1e9db8(_0x1ab125._0x57ff35),'layer':{'id':this['id'],'name':this['name']},'features':_0x585dc1};}['_toJsonEx'](_0x7d30f2){const _0x453098=_0x35a251;this['stopEditing']();let _0x29c271=[];this['_graphicList']['forEach'](_0x2e99f8=>{const _0x5502b2=_0x2767;if(_0x2e99f8['isPrivate']||!_0x2e99f8['state'])return;const _0x23a4f1=_0x2e99f8['toJSON']();if(!_0x23a4f1)return;Array[_0x5502b2(0x719)](_0x23a4f1)?_0x29c271=_0x29c271['concat'](_0x23a4f1):_0x29c271['push'](_0x23a4f1);},this),_0x7d30f2[_0x453098(0xce2)]=_0x29c271;}[_0x35a251(0x336)](_0x2e01f4,_0x526c49={}){const _0x1a5f41={_0x46cd5b:0xe86,_0x3209e9:0x357},_0x376146=_0x35a251;var _0xa8a15;try{isString(_0x2e01f4)&&(_0x2e01f4=JSON['parse'](_0x2e01f4));}catch(_0x38a3a7){logError$1('loadGeoJSON:请确认json文件格式正确!',_0x38a3a7);return;}const _0x1a38c5=(_0xa8a15=this[_0x376146(0xd79)])===null||_0xa8a15===void 0x0?void 0x0:_0xa8a15['chinaCRS'],_0x259843=this[_0x376146(_0x1a5f41._0x46cd5b)]['chinaCRS'],_0x2dda13=getTransFun(_0x259843,_0x1a38c5),_0x3304e5=geoJsonToGraphics(_0x2e01f4,{..._0x526c49,'symbol':this['options'][_0x376146(_0x1a5f41._0x3209e9)],'crs':this['options']['crs'],'onPointTrans':_0x2dda13});return this['_addGraphicByArrOptions'](_0x3304e5,_0x526c49);}['_addGraphicByArrOptions'](_0x447ee3,_0x2dd17c={}){const _0x418c82={_0x5ad39b:0x8ea,_0x17dfa1:0xe86,_0x531e4b:0x8ae,_0x2cadc8:0x991,_0xdc294c:0x6de,_0x4d0527:0x93a,_0x11fc0b:0x6de},_0x429496=_0x35a251;_0x2dd17c[_0x429496(0x386)]&&this['clear']();let _0x18d4ba=[];if(_0x447ee3['length']===0x0)return _0x18d4ba;let _0x6f4acb;_0x2dd17c['enabledEvent']===![]&&(this['enabledEvent']=![],_0x6f4acb=!![]);const _0x34fd31=_0x447ee3[0x0][_0x429496(_0x418c82._0x5ad39b)],_0x3cf22a=this[_0x429496(_0x418c82._0x17dfa1)][_0x429496(_0x418c82._0x531e4b)]||{};if(isCombineType(_0x34fd31)){const _0x3b4caa={..._0x3cf22a,'type':_0x34fd31,'instances':_0x447ee3};_0x2dd17c['onEachFeature']&&_0x2dd17c[_0x429496(0x228)](_0x3b4caa);const _0x13c499=this[_0x429496(_0x418c82._0x2cadc8)](_0x3b4caa);_0x18d4ba[_0x429496(_0x418c82._0xdc294c)](_0x13c499);}else for(let _0xe3219e=0x0,_0x3ed627=_0x447ee3['length'];_0xe3219e<_0x3ed627;_0xe3219e++){const _0x2e9cfc={..._0x3cf22a,..._0x447ee3[_0xe3219e]};_0x2dd17c['onEachFeature']&&_0x2dd17c['onEachFeature'](_0x2e9cfc);if(this['options']['onCreateGraphic']){const _0x77c3bb=this['options']['onCreateGraphic'](_0x2e9cfc);_0x77c3bb&&(this['addGraphic'](_0x77c3bb),Array['isArray'](_0x77c3bb)?_0x18d4ba=_0x18d4ba[_0x429496(_0x418c82._0x4d0527)](_0x77c3bb):_0x18d4ba['push'](_0x77c3bb));}else{const _0x29d459=this['_addGraphic'](_0x2e9cfc);_0x18d4ba[_0x429496(_0x418c82._0x11fc0b)](_0x29d459);}}return _0x6f4acb&&(this['enabledEvent']=!![]),_0x2dd17c['flyTo']&&this['show']&&this['_map']['flyToGraphic'](_0x18d4ba),_0x18d4ba;}['_bindClustering'](_0x34b4a0={}){const _0x34685c={_0x37b338:0xdd5},_0xb323ea={_0x18f93b:0x6ed,_0x4a5a85:0x1ba,_0x9e9502:0x979,_0x2dc797:0xc04,_0x45e8a0:0x9c2,_0x2df02a:0xb61,_0x2490c1:0xfc8,_0x2344d8:0x9c2,_0x22eb74:0xc37,_0x3864ac:0x264},_0x2cdb92={_0x5b81e2:0xdb2},_0x43ad0f=_0x35a251;var _0x34bf14;const _0x58bcb6=(_0x34bf14=this['dataSource'])===null||_0x34bf14===void 0x0?void 0x0:_0x34bf14['clustering'];if(!_0x58bcb6)return;_0x58bcb6['enabled']=_0x34b4a0['enabled']??![],_0x58bcb6[_0x43ad0f(_0x34685c._0x37b338)]=_0x34b4a0[_0x43ad0f(_0x34685c._0x37b338)]??0x14;let _0x717a5e=setInterval(function(){const _0x50b46c=_0x43ad0f;_0x58bcb6['_cluster']&&_0x58bcb6[_0x50b46c(0xad4)]();},0x320);_0x58bcb6['clusterEvent'][_0x43ad0f(0x77e)]((_0xf56caa,_0x32b248)=>{const _0x414379=_0x43ad0f;_0x717a5e&&(clearInterval(_0x717a5e),_0x717a5e=null);_0x32b248['label'][_0x414379(_0xb323ea._0x18f93b)]=this['id'],_0x32b248['label'][_0x414379(0x987)]=![],_0x32b248[_0x414379(_0xb323ea._0x4a5a85)][_0x414379(0x6ed)]=this['id'],_0x32b248[_0x414379(0x9c2)]['_mars3d_layerId']=this['id'],_0x32b248['billboard']['show']=!![],_0x32b248['billboard']['id']=_0x32b248['label']['id'],_0x32b248['billboard']['verticalOrigin']=Cesium__namespace['VerticalOrigin']['BOTTOM'],_0x32b248[_0x414379(0x9c2)]['heightReference']=_0x34b4a0[_0x414379(_0xb323ea._0x9e9502)]?Cesium__namespace['HeightReference'][_0x414379(0xc5e)]:Cesium__namespace['HeightReference']['NONE'],_0x32b248['billboard']['scale']=0.5;_0x34b4a0['style']&&(BillboardStyleConver[_0x414379(_0xb323ea._0x2dc797)](_0x34b4a0['style'],_0x32b248['billboard']),_0x34b4a0[_0x414379(0xfc8)][_0x414379(0xdaa)]&&(_0x32b248[_0x414379(_0xb323ea._0x45e8a0)][_0x414379(_0xb323ea._0x2df02a)]=setPositionsHeight(_0x32b248['billboard']['position'],_0x34b4a0['style']['setHeight'])),_0x34b4a0['style']['addHeight']&&(_0x32b248['billboard'][_0x414379(0xb61)]=addPositionsHeight(_0x32b248['billboard']['position'],_0x34b4a0[_0x414379(_0xb323ea._0x2490c1)]['addHeight'])));if(_0x34b4a0['getImage']){const _0x9e8f5f=_0x34b4a0['getImage'](_0xf56caa[_0x414379(0xe1e)],_0x34b4a0);_0x9e8f5f['then']?_0x9e8f5f['then'](function(_0x3d32b7){const _0x2b4f63=_0x414379;_0x32b248[_0x2b4f63(0x9c2)][_0x2b4f63(_0x2cdb92._0x5b81e2)]=_0x3d32b7;}):_0x32b248[_0x414379(_0xb323ea._0x2344d8)]['image']=_0x9e8f5f;}else _0x32b248['billboard']['image']=getCircleImage(_0xf56caa[_0x414379(0xe1e)],_0x34b4a0);const _0x22b18c=this,_0x5c83ce={'entities':_0xf56caa,'cluster':_0x32b248,'getGraphics':function(){const _0x5df3ff=[],_0x3d4d29=this['entities'];for(let _0x371cc9=0x0,_0xad4326=_0x3d4d29['length'];_0x371cc9<_0xad4326;_0x371cc9++){const _0x203602=_0x3d4d29[_0x371cc9],_0x3f8014=_0x22b18c['getGraphicById'](_0x203602['_mars3d_graphicId']);_0x5df3ff['push'](_0x3f8014);}return _0x5df3ff;}};_0x32b248['billboard'][_0x414379(_0xb323ea._0x22eb74)]=_0x5c83ce,this[_0x414379(_0xb323ea._0x3864ac)]('clustering',_0x5c83ce);});}['getClusterList'](){const _0x531899={_0x52a42e:0xbf7,_0x1fc7d0:0x888},_0x2e644c=_0x35a251;var _0x2bf21b;const _0x16aa28=(_0x2bf21b=this['dataSource'])===null||_0x2bf21b===void 0x0?void 0x0:_0x2bf21b[_0x2e644c(_0x531899._0x52a42e)];if(!_0x16aa28)return;const _0x3847f2=_0x16aa28['_clusterBillboardCollection'],_0x1d6ac8=_0x16aa28['_previousClusters'],_0x1bc600=[];for(let _0x46bbd8=0x0,_0x1cb57f=_0x3847f2['length'];_0x46bbd8<_0x1cb57f;_0x46bbd8++){const _0x59a511=_0x3847f2[_0x2e644c(_0x531899._0x1fc7d0)](_0x46bbd8);_0x1bc600['push']({..._0x1d6ac8[_0x46bbd8],..._0x59a511['_clusterData'],'billboard':_0x59a511});}return _0x1bc600;}['setOpacity'](_0x15071f){const _0x665b00={_0x4dead0:0xfb0},_0x398e88=_0x35a251;this[_0x398e88(_0x665b00._0x4dead0)]=_0x15071f,this['_graphicList']['forEach'](_0x2ee8ff=>{const _0x272ba0=_0x398e88;_0x2ee8ff['setOpacity']&&_0x2ee8ff[_0x272ba0(0x45c)](_0x15071f);},this);}['addGraphic'](_0x465dc0){const _0x5774be={_0x4a0b39:0xe1e,_0x4e00cb:0x991},_0x328fc4=_0x35a251;!this['_createOK']&&this['_mountedHook']&&(this['_createOK']=!![],this['_mountedHook']());if(Array['isArray'](_0x465dc0)){if(_0x465dc0[_0x328fc4(_0x5774be._0x4a0b39)]===0x0)return;const _0x1119e7=_0x465dc0[0x0]['type'];if(isCombineType(_0x1119e7)&&!_0x465dc0[0x0]['instances']){const _0x3d801c={'type':_0x1119e7,'instances':_0x465dc0};return this['_addGraphic'](_0x3d801c);}else{const _0x47a640=[];for(let _0x5e03db=0x0,_0x5612a3=_0x465dc0['length'];_0x5e03db<_0x5612a3;_0x5e03db++){const _0x59dc28=this[_0x328fc4(0x991)](_0x465dc0[_0x5e03db]);_0x59dc28&&_0x47a640['push'](_0x59dc28);}return _0x47a640;}}else return this[_0x328fc4(_0x5774be._0x4e00cb)](_0x465dc0);}['_addGraphic'](_0x1088a6){const _0x4dda21={_0xcc0b45:0xb55,_0x3a8b2e:0x888,_0x2e59b0:0x85f,_0xc9fd8:0xcd3},_0x47c3d8=_0x35a251;var _0x3410b9;return delete this[_0x47c3d8(_0x4dda21._0xcc0b45)],this['_graphicList'][_0x47c3d8(_0x4dda21._0x3a8b2e)]((_0x3410b9=_0x1088a6)===null||_0x3410b9===void 0x0?void 0x0:_0x3410b9['id'])&&(_0x1088a6['id']=createGuid(),logWarn('addGraphic:数据id存在冲突,已重新赋值id',_0x1088a6)),!_0x1088a6[_0x47c3d8(_0x4dda21._0x2e59b0)]&&(_0x1088a6['type']||this['options']['symbol'])&&(this['options']['symbol']&&(_0x1088a6=mergeSymbolToGraphic(_0x1088a6,this['options']['symbol'])),_0x1088a6=create$4(_0x1088a6['type'],_0x1088a6)),_0x1088a6&&(_0x1088a6['_onAdd'](this),this['_graphicList'][_0x47c3d8(_0x4dda21._0xc9fd8)](_0x1088a6['id'],_0x1088a6)),_0x1088a6;}[_0x35a251(0x73b)](_0x185a14,_0x2c494c){const _0x460cb6=_0x35a251;return this[_0x460cb6(0x9af)](_0x185a14,_0x2c494c),this;}['_removeGraphic'](_0x444bcf,_0x54ec31,_0x7a417a){const _0x5b2356={_0xc9970d:0x127,_0x114932:0xb55},_0x2eaea1=_0x35a251;if(!_0x444bcf||!_0x444bcf[_0x2eaea1(_0x5b2356._0xc9970d)])return this;delete this[_0x2eaea1(_0x5b2356._0x114932)],!_0x7a417a&&this[_0x2eaea1(0x587)]['remove'](_0x444bcf['id']),_0x444bcf['_onRemove'](),_0x54ec31&&_0x444bcf['destroy']();}['getGraphicById'](_0x2b852b){const _0x2c9889={_0x45ea76:0x587},_0x340843=_0x35a251;return this[_0x340843(_0x2c9889._0x45ea76)][_0x340843(0x888)](_0x2b852b);}['getGraphicByAttr'](_0x425f4d,_0x2c1c3f){const _0x4a2853={_0x39bbb9:0x9fb},_0x5d2e54=_0x35a251;return this['_graphicList'][_0x5d2e54(_0x4a2853._0x39bbb9)](_0x425f4d,_0x2c1c3f,'attr');}['getGraphicsByAttr'](_0x5db7e9,_0x589245){return this['_graphicList']['getListByAttr'](_0x5db7e9,_0x589245,'attr');}['getGraphicsByStyle'](_0x5b28d1,_0x514add){const _0x1f56f0={_0x21b9c6:0x587},_0xabd07e=_0x35a251,_0x592634=[];return this[_0xabd07e(_0x1f56f0._0x21b9c6)]['forEach'](_0x2857bc=>{const _0x590e8c=_0xabd07e;_0x2857bc[_0x590e8c(0xfc8)][_0x5b28d1]===_0x514add&&_0x592634['push'](_0x2857bc);},this),_0x592634;}['eachGraphic'](_0x2cf9f4,_0x3c9686){return this['_graphicList']['forEach'](_0x2cf9f4,_0x3c9686||this),this;}['getGraphics'](_0x3d629f=![]){const _0x139ca8={_0x3241bc:0x587},_0x26711b=_0x35a251;if(_0x3d629f)return this[_0x26711b(_0x139ca8._0x3241bc)]['values'];else{const _0x470fc2=[];return this['_graphicList']['forEach'](_0x58b470=>{!_0x58b470['isPrivate']&&_0x470fc2['push'](_0x58b470);},this),_0x470fc2;}}['clear'](_0x2f28be=!![]){const _0x2d9120={_0x126830:0x77c,_0x3cdc28:0x313,_0x2a9101:0xd3c,_0x215f18:0xadf,_0x29925b:0xb05,_0x4dd3b6:0xb05,_0x120a20:0x283,_0x312157:0xb05},_0x4234d8=_0x35a251;this[_0x4234d8(_0x2d9120._0x126830)]();this['_graphicList']&&(this[_0x4234d8(0x587)][_0x4234d8(0xdbd)](_0x1f21bf=>{const _0x1e96db=_0x4234d8;this[_0x1e96db(0x9af)](_0x1f21bf,_0x2f28be,!![]);},this),this['_graphicList']['removeAll']());this['_dataSource']&&this[_0x4234d8(0x1a3)][_0x4234d8(_0x2d9120._0x3cdc28)][_0x4234d8(0xb05)]();if(this['_primitiveCollection'])try{this['_primitiveCollection']['removeAll']();}catch(_0x107b7c){const _0x30553e=this[_0x4234d8(_0x2d9120._0x2a9101)]['_primitives'],_0x12d74e=_0x30553e['length'];for(let _0x54b53e=0x0;_0x54b53e<_0x12d74e;++_0x54b53e){var _0x56d446,_0x4244f1;(_0x56d446=_0x30553e[_0x54b53e])!==null&&_0x56d446!==void 0x0&&(_0x4244f1=_0x56d446['_external'])!==null&&_0x4244f1!==void 0x0&&_0x4244f1['_composites']&&(delete _0x30553e[_0x54b53e]['_external'][_0x4234d8(_0x2d9120._0x215f18)][this['_guid']],this[_0x4234d8(0xd3c)][_0x4234d8(0x418)]&&_0x30553e[_0x54b53e]['destroy']());}this[_0x4234d8(0xd3c)]['_primitives']=[];}this['_labelCollection']&&this['_labelCollection'][_0x4234d8(_0x2d9120._0x29925b)](),this['_billboardCollection']&&this['_billboardCollection'][_0x4234d8(_0x2d9120._0x4dd3b6)](),this[_0x4234d8(_0x2d9120._0x120a20)]&&this['_cloudCollection'][_0x4234d8(0xb05)](),this['_pointCollection']&&this['_pointCollection']['removeAll'](),this['_polylineCollection']&&this['_polylineCollection'][_0x4234d8(_0x2d9120._0x312157)](),this['_closeAllControl']();}['autoSurfaceHeight'](_0x2139b8={}){const _0x19d0b6={_0x5c3862:0x86c};return new Promise((_0x1b9648,_0x4c28cc)=>{const _0x289c6a=_0x2767,_0x3b9bed=this[_0x289c6a(0xcca)]();let _0x3b5210=-0x1;const _0x582b70=_0x3b9bed['length'];function _0x2e060b(){const _0xc42703=_0x289c6a;_0x3b5210++;if(_0x3b5210>=_0x582b70){_0x2139b8[_0xc42703(0xa2d)]&&_0x2139b8['end']({'index':_0x3b5210,'count':_0x582b70,'graphics':_0x3b9bed});_0x1b9648(_0x3b9bed);return;}const _0x248fa0=_0x3b9bed[_0x3b5210];_0x248fa0['autoSurfaceHeight']?_0x248fa0['autoSurfaceHeight'](_0x2139b8)[_0xc42703(_0x19d0b6._0x5c3862)](()=>{_0x2139b8['endItem']&&_0x2139b8['endItem']({'graphic':_0x248fa0,'index':_0x3b5210,'count':_0x582b70}),_0x2e060b();}):(_0x2139b8['endItem']&&_0x2139b8['endItem']({'graphic':_0x248fa0,'index':_0x3b5210,'count':_0x582b70}),_0x2e060b());}_0x2e060b();});}['clampToGround'](_0x49ce70){return this['autoSurfaceHeight'](_0x49ce70);}[_0x35a251(0x2ef)](_0x391112){return new Promise((_0xd311b5,_0x42248f)=>{const _0xa09f=_0x2767;this['stopDraw']();if(!this[_0xa09f(0xd79)])throw new Error('startDraw:需要\x20map.addLayer(当前图层)\x20后,才行使用本方法');_0x391112['_promise']={'resolve':_0xd311b5,'reject':_0x42248f};const _0xc0a77f=fromDraw(this,_0x391112);_0xc0a77f!=null&&(this[_0xa09f(0x943)]=_0xc0a77f);});}['endDraw'](){const _0x398d33={_0x5c27cb:0x338},_0x29a1ad=_0x35a251;this[_0x29a1ad(_0x398d33._0x5c27cb)]();if(this['_graphic_drawing']){const _0x43ebdc=this['_graphic_drawing'][_0x29a1ad(0x11e)]();return _0x43ebdc&&(this[_0x29a1ad(0x943)]=null),_0x43ebdc;}return![];}['stopDraw'](){const _0xfcc3e8=_0x35a251;return this['stopEditing'](),this['_graphic_drawing']?(this['_graphic_drawing'][_0xfcc3e8(0x77c)](),this['_graphic_drawing']=null,!![]):![];}['clearDrawing'](){const _0x32da10={_0x4bf2a5:0x943,_0x14a474:0x943},_0x53f96c=_0x35a251;return this['_graphic_drawing']?(this[_0x53f96c(_0x32da10._0x4bf2a5)]['remove'](!![]),this[_0x53f96c(_0x32da10._0x14a474)]=null,!![]):![];}['activateEdit'](){const _0x572983=_0x35a251;if(this['_hasEdit'])return;return this[_0x572983(0x96f)]=!![],this['_map']&&this['_bindEditEvent'](),this;}['disableEdit'](){const _0x208208={_0x22793d:0x96f},_0x7f8c6b=_0x35a251;if(!this[_0x7f8c6b(_0x208208._0x22793d)])return;return this['_hasEdit']=![],this['_unbindEditEvent'](),this['stopEditing'](),this;}[_0x35a251(0x73e)](){const _0x419943={_0x715305:0x9ef,_0x4a20dc:0x3b4},_0x443457=_0x35a251;this[_0x443457(0xd79)]['on'](EventType['click'],this[_0x443457(0x3d8)],this),this['_map']['on'](EventType[_0x443457(_0x419943._0x715305)],this[_0x443457(_0x419943._0x4a20dc)],this);}['_unbindEditEvent'](){const _0x4b348b={_0x22bd9b:0x6b2},_0x272cf2=_0x35a251;this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this['_map'][_0x272cf2(_0x4b348b._0x22bd9b)](EventType['mouseMoveTarget'],this['_onMouseMoveHandler'],this);}[_0x35a251(0x3b4)](_0x2aaeba){const _0x2d7b5f={_0x5e6607:0xd79,_0x3c98c0:0xd83,_0x85704f:0xb78},_0x4f68eb=_0x35a251;if(!this['_hasEdit'])return;if(!this['_map']['scene']['screenSpaceCameraController']['enableInputs'])return;let _0x790377=_0x2aaeba['graphic'];if(!_0x790377){const _0x2a3291=this['_map']['mouseEvent']['getPickTarget'](_0x2aaeba['endPosition'],_0x2aaeba);_0x790377=_0x2a3291===null||_0x2a3291===void 0x0?void 0x0:_0x2a3291['graphic'];}if(_0x790377==null||_0x790377['_layer']!==this){this['_map']['closeSmallTooltip']();return;}if(_0x790377['_enabledDraw']||_0x790377['isPrivate']||!_0x790377['hasEdit'])return;if(this['_map']['contextmenu'][_0x4f68eb(0x987)]&&this['_map']['contextmenu'][_0x4f68eb(0xe28)]===_0x790377)return;let _0x3e62f4;isPCBroswer()?_0x3e62f4=this[_0x4f68eb(_0x2d7b5f._0x5e6607)]['getLangText'](_0x4f68eb(_0x2d7b5f._0x3c98c0))+_0x4f68eb(0x3f8)+this['_map']['getLangText'](_0x4f68eb(_0x2d7b5f._0x85704f)):_0x3e62f4=this[_0x4f68eb(0xd79)]['getLangText'](_0x4f68eb(0xd83)),this[_0x4f68eb(0xd79)]['openSmallTooltip'](_0x2aaeba['windowPosition'],_0x3e62f4);}[_0x35a251(0x3d8)](_0x485240){const _0x13c124=_0x35a251;if(this['_graphic_drawing'])return;const _0x41e60f=_0x485240[_0x13c124(0xf8c)];if(_0x41e60f&&(_0x41e60f['isPrivate']||!_0x41e60f['hasEdit']))return;this[_0x13c124(0xb70)]&&_0x41e60f&&_0x485240['layer']===this?this['startEditing'](_0x41e60f,_0x485240):this['stopEditing']();}[_0x35a251(0x756)](_0x2fe533,_0x57783a){const _0x3fc237={_0x592a83:0xd2e,_0x4577ec:0xd79},_0x18f0f2=_0x35a251;if(!_0x2fe533||!_0x2fe533['startEditing']||!_0x2fe533['isAdded']||!_0x2fe533['hasEdit'])return;if(this[_0x18f0f2(_0x3fc237._0x592a83)]===_0x2fe533||_0x2fe533['_enabledDraw'])return;return this['stopEditing'](),_0x2fe533['startEditing'](),_0x57783a&&_0x2fe533['_draw_tooltip']&&this[_0x18f0f2(_0x3fc237._0x4577ec)]['openSmallTooltip'](_0x57783a[_0x18f0f2(0xb61)],_0x2fe533['_draw_tooltip']),this['_graphic_editing']=_0x2fe533,this;}[_0x35a251(0x338)](){return this['_graphic_editing']&&(this['_graphic_editing']['stopEditing'](),this['_graphic_editing']=null),this;}}register$2('graphic',GraphicLayer);class MatrixMove extends BaseThing{constructor(_0x1c8945={}){const _0x36be10={_0x2d918c:0x780,_0x387764:0xb61},_0x5b049c=_0x35a251;super(_0x1c8945),this[_0x5b049c(_0x36be10._0x2d918c)]=new Cesium__namespace['Cartesian3'](0x0,0x0,0x0),this[_0x5b049c(0x9b8)]=new Cesium__namespace['Matrix3'](0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1),_0x1c8945[_0x5b049c(0xb61)]&&(this[_0x5b049c(_0x36be10._0x387764)]=_0x1c8945['position']);}get['position'](){return this['_position'];}set[_0x35a251(0xb61)](_0x4e0aa1){const _0x3fea12={_0x4aab86:0xa09},_0x28afb4=_0x35a251;this['_position']=LngLatPoint[_0x28afb4(0xa43)](_0x4e0aa1),this[_0x28afb4(_0x3fea12._0x4aab86)](),this['_updatePositionHook'](!![]);}get['isMoveing'](){if(!this['_map'])return![];return this['_hasChangeEnableInputs'];}['_mountedHook'](){this['_graphicLayer']=new GraphicLayer({'private':!![]});}[_0x35a251(0x97b)](){const _0x4c8110={_0x1f68db:0xd79},_0x383b54=_0x35a251;this[_0x383b54(_0x4c8110._0x1f68db)]['addLayer'](this['_graphicLayer']),this['_updatePositionHook'](!![]),this['_createGraphics'](),this['_bindEvent']();}['_removedHook'](){const _0x1097bb=_0x35a251;this['_graphic_move_x']&&delete this[_0x1097bb(0x1b9)],this['_graphic_move_y']&&delete this['_graphic_move_y'],this['_graphic_move_z']&&delete this['_graphic_move_z'],this['_graphic_dragger_ing']&&delete this['_graphic_dragger_ing'],this['_graphicLayer'][_0x1097bb(0x386)](),this['_map'][_0x1097bb(0xad7)](this['_graphicLayer']),this['_unbindEvent']();}[_0x35a251(0x86b)](){const _0x35f81a={_0x197f5d:0xb13,_0x2f95ce:0x32e,_0x3e0e2f:0x80b,_0x3c2a72:0xc0d,_0x3be50c:0x2f6,_0x25b337:0xb13,_0x122a66:0x581,_0x50a63e:0x3c8},_0x4ba07d=_0x35a251;this[_0x4ba07d(_0x35f81a._0x197f5d)][_0x4ba07d(0x386)](),this['_graphic_move_x']=new PolylinePrimitive({'positions':this[_0x4ba07d(_0x35f81a._0x2f95ce)],'style':{'width':0xf,'arcType':Cesium__namespace[_0x4ba07d(0x581)][_0x4ba07d(_0x35f81a._0x3e0e2f)],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['RED'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace[_0x4ba07d(_0x35f81a._0x3c2a72)]['X']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this['_graphic_move_x']),this['_graphic_move_y']=new PolylinePrimitive({'positions':this['_positions_line_y'],'style':{'width':0xf,'arcType':Cesium__namespace['ArcType']['NONE'],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['GREEN'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace['Axis']['Y']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this['_graphic_move_y']),this['_graphic_move_z']=new PolylinePrimitive({'positions':this[_0x4ba07d(_0x35f81a._0x3be50c)],'style':{'width':0xf,'arcType':Cesium__namespace['ArcType'][_0x4ba07d(0x80b)],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['BLUE'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace['Axis']['Z']},'asynchronous':![]}),this[_0x4ba07d(_0x35f81a._0x25b337)][_0x4ba07d(0x8b5)](this['_graphic_move_z']),this['_graphic_dragger_ing']=new PolylinePrimitive({'positions':[],'style':{'width':0x3,'arcType':Cesium__namespace[_0x4ba07d(_0x35f81a._0x122a66)]['NONE'],'materialType':PolylineDash,'color':Cesium__namespace[_0x4ba07d(0xf29)]['YELLOW'],'depthFail':!![]},'asynchronous':![],'show':![]}),this[_0x4ba07d(0xb13)]['addGraphic'](this[_0x4ba07d(_0x35f81a._0x50a63e)]);}['_initByPosition'](){const _0x5d6b2c={_0x551a72:0x18e,_0x572b24:0x6a9,_0x3fb872:0x9b0,_0x22f33f:0x2a3,_0x34b63c:0x6a7,_0x2ec81e:0x85a,_0x9fd9c4:0x8eb},_0x282b33=_0x35a251;this[_0x282b33(0xd89)]=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](this['position']),this[_0x282b33(_0x5d6b2c._0x551a72)]=Cesium__namespace[_0x282b33(0x6a7)]['inverse'](this['modelToWorld'],new Cesium__namespace['Matrix4']()),this['matrix']=this['modelToWorld']['clone'](),this[_0x282b33(0xc72)]=Cesium__namespace['Matrix4']['inverse'](this['matrix'],new Cesium__namespace['Matrix4']()),this[_0x282b33(_0x5d6b2c._0x572b24)]=Cesium__namespace[_0x282b33(0x6a7)]['multiplyByPointAsVector'](this[_0x282b33(_0x5d6b2c._0x3fb872)],Cesium__namespace['Cartesian3']['UNIT_X'],new Cesium__namespace['Cartesian3']()),this[_0x282b33(0xc55)]=Cesium__namespace['Matrix4'][_0x282b33(0x85a)](this['matrix'],Cesium__namespace[_0x282b33(0x8eb)][_0x282b33(_0x5d6b2c._0x22f33f)],new Cesium__namespace['Cartesian3']()),this[_0x282b33(0xe4a)]=Cesium__namespace[_0x282b33(_0x5d6b2c._0x34b63c)][_0x282b33(_0x5d6b2c._0x2ec81e)](this['matrix'],Cesium__namespace[_0x282b33(_0x5d6b2c._0x9fd9c4)]['UNIT_Z'],new Cesium__namespace['Cartesian3']()),this[_0x282b33(0x32e)]=[],this['_positions_line_y']=[],this['_positions_line_z']=[];}[_0x35a251(0x675)](_0xe1b7f9){const _0x4b2629={_0x48e5d8:0xd79,_0x46ed30:0xf48,_0x3f865c:0x907},_0x2306db=_0x35a251;if(!this['_map'])return;const _0x40ebdc=this['position']['clone']();if(_0xe1b7f9){const _0x14d9a5=new Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x2306db(_0x4b2629._0x48e5d8)][_0x2306db(0x7d)]['viewMatrix'],_0x40ebdc,new Cesium__namespace['Cartesian3']()),_0x3a7906=-_0x14d9a5['z']*Math['tan'](this['_map']['camera']['frustum']['fov']/0x2)*0x2,_0x44f9f7=_0x3a7906/this[_0x2306db(_0x4b2629._0x48e5d8)]['canvas'][_0x2306db(_0x4b2629._0x46ed30)];this[_0x2306db(_0x4b2629._0x3f865c)]=0xc8*_0x44f9f7;}this['_positions_line_x']=[_0x40ebdc,Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x2306db(0x9b0)],new Cesium__namespace['Cartesian3'](this['radius'],0x0,0x0),new Cesium__namespace[(_0x2306db(0x8eb))]())],this['_positions_line_y']=[_0x40ebdc,Cesium__namespace['Matrix4']['multiplyByPoint'](this['matrix'],new Cesium__namespace['Cartesian3'](0x0,this['radius'],0x0),new Cesium__namespace['Cartesian3']())],this['_positions_line_z']=[_0x40ebdc,Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x2306db(0x9b0)],new Cesium__namespace[(_0x2306db(0x8eb))](0x0,0x0,this['radius']),new Cesium__namespace[(_0x2306db(0x8eb))]())],this['_graphic_move_x']&&(this['_graphic_move_x'][_0x2306db(0xb35)]=this[_0x2306db(0x32e)]),this['_graphic_move_y']&&(this['_graphic_move_y']['positions']=this['_positions_line_y']),this[_0x2306db(0xee6)]&&(this['_graphic_move_z'][_0x2306db(0xb35)]=this['_positions_line_z']);}['_bindEvent'](){const _0x2140f8={_0xd37b6b:0xd79},_0x3d5f24=_0x35a251;this['_graphicLayer']['on'](EventType['leftDown'],this['_onMap_leftDown'],this),this['_map']['on'](EventType['leftUp'],this['_onMap_leftUp'],this),this['_map']['on'](EventType['middleClick'],this['_onMap_middleClick'],this),this[_0x3d5f24(_0x2140f8._0xd37b6b)]['on'](EventType['wheel'],this[_0x3d5f24(0x339)],this);}['_unbindEvent'](){const _0x43d30b={_0xb98541:0xb13,_0x1eccba:0x298,_0x2051a0:0x6b2,_0x5d899a:0x1da,_0x89b221:0x474},_0x390c4c=_0x35a251;this[_0x390c4c(_0x43d30b._0xb98541)]['off'](EventType['leftDown'],this[_0x390c4c(_0x43d30b._0x1eccba)],this),this['_map'][_0x390c4c(_0x43d30b._0x2051a0)](EventType['leftUp'],this[_0x390c4c(_0x43d30b._0x5d899a)],this),this[_0x390c4c(0xd79)]['off'](EventType['mouseMove'],this['_onMap_mouseMove'],this),this['_map']['off'](EventType['middleClick'],this[_0x390c4c(_0x43d30b._0x89b221)],this),this['_map']['off'](EventType[_0x390c4c(0x299)],this['_onMap_wheel'],this);}['_onMap_leftDown'](_0x526f58){const _0x1bbae9={_0x150fdc:0xfc8,_0x1e7740:0x6b3,_0x1a5097:0x8ea,_0x229338:0xc60,_0x3b805f:0xbbb,_0x19d72a:0xd79},_0x8cc6e=_0x35a251;this[_0x8cc6e(0x163)]=undefined;if(_0x526f58['layer']!==this['_graphicLayer'])return;const _0x47d20f=_0x526f58['graphic'];if(!_0x47d20f||!(_0x47d20f[_0x8cc6e(0x6b3)]['move']||_0x47d20f['attr']['rotate']))return;this['_graphic']=_0x47d20f;!_0x47d20f[_0x8cc6e(_0x1bbae9._0x150fdc)]['color_bak']&&(_0x47d20f['style']['color_bak']=_0x47d20f['style']['color']);_0x47d20f['setStyle']({'color':Cesium__namespace['Color']['YELLOW']}),this['_graphic_dragger_ing']['positions']=[this['position'],this['position']],this['_graphic_dragger_ing']['show']=!![];const _0x464c5f=this['_graphic'][_0x8cc6e(_0x1bbae9._0x1e7740)][_0x8cc6e(_0x1bbae9._0x1a5097)];this['fire'](EventType['start'],{..._0x526f58,'editType':_0x464c5f,'graphic':_0x47d20f}),this['_map'][_0x8cc6e(_0x1bbae9._0x229338)][_0x8cc6e(_0x1bbae9._0x3b805f)]['enableInputs']&&(this[_0x8cc6e(_0x1bbae9._0x19d72a)]['scene'][_0x8cc6e(0xbbb)][_0x8cc6e(0x856)]=![],this['_hasChangeEnableInputs']=!![]),this[_0x8cc6e(0xd79)]['on'](EventType['mouseMove'],this['_onMap_mouseMove'],this);}['_onMap_mouseMove'](_0x121257){const _0x39c608={_0x5975ec:0x163,_0x14b1f6:0x85a,_0x5d20c5:0x8eb,_0x1b8256:0x85a,_0x7e8403:0x8eb,_0xc5df55:0x9b0,_0x5233ee:0x6a7,_0x569747:0x9b0,_0x2985ba:0x8eb,_0x4286d3:0x6a7,_0x59826b:0x7b,_0x512bf5:0xd9d,_0x39d37d:0x85a,_0x16109f:0x18e,_0x3081ff:0xd9d},_0x4f9280=_0x35a251;if(!this[_0x4f9280(_0x39c608._0x5975ec)])return;const _0x41d5a2=_0x121257['startPosition'],_0x2924b5=_0x121257['endPosition'];let _0xf1e358;const _0x37280c=this['_graphic']['attr'][_0x4f9280(0x8ea)];_0x37280c===Cesium__namespace[_0x4f9280(0xc0d)]['X']&&(_0xf1e358=this['normalX']);_0x37280c===Cesium__namespace['Axis']['Y']&&(_0xf1e358=this['normalY']);_0x37280c===Cesium__namespace['Axis']['Z']&&(_0xf1e358=this[_0x4f9280(0xe4a)]);const _0x147eea=new Cesium__namespace['Cartesian3'](_0x2924b5['x']-_0x41d5a2['x'],-(_0x2924b5['y']-_0x41d5a2['y']),0x0),_0x439284=new Cesium__namespace['Matrix4'][(_0x4f9280(_0x39c608._0x14b1f6))](this['_map']['camera'][_0x4f9280(0x24f)],_0x147eea,new Cesium__namespace[(_0x4f9280(_0x39c608._0x5d20c5))]()),_0x30a874=new Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x4f9280(0xd79)]['camera']['viewMatrix'],this[_0x4f9280(0xb61)],new Cesium__namespace['Cartesian3']()),_0x274527=-_0x30a874['z']*Math['tan'](this['_map']['camera']['frustum']['fov']/0x2)*0x2,_0xa8b6e=_0x274527/this['_map'][_0x4f9280(0xee1)]['width'],_0x3ab86d=Cesium__namespace['Cartesian3']['dot'](_0x439284,_0xf1e358)*_0xa8b6e,_0x26d325=Cesium__namespace['Cartographic']['fromCartesian'](this['position']);let _0x5b4ccf=new Cesium__namespace['Cartesian3'](this['position']['x']+_0xf1e358['x']*_0x3ab86d,this['position']['y']+_0xf1e358['y']*_0x3ab86d,this['position']['z']+_0xf1e358['z']*_0x3ab86d);_0x37280c!==Cesium__namespace['Axis']['Z']&&(_0x5b4ccf=Cesium__namespace['Cartographic']['fromCartesian'](_0x5b4ccf),_0x5b4ccf['height']=_0x26d325['height'],_0x37280c===Cesium__namespace['Axis']['X']?_0x5b4ccf['latitude']=_0x26d325[_0x4f9280(0x580)]:_0x5b4ccf['longitude']=_0x26d325['longitude'],_0x5b4ccf=Cesium__namespace[_0x4f9280(_0x39c608._0x5d20c5)]['fromRadians'](_0x5b4ccf['longitude'],_0x5b4ccf['latitude'],_0x5b4ccf[_0x4f9280(0x682)]));const _0x55ae85=Cesium__namespace['Matrix4']['multiplyByPoint'](this['inverseMatrix'],_0x5b4ccf,new Cesium__namespace['Cartesian3']());Cesium__namespace['Matrix4'][_0x4f9280(_0x39c608._0x1b8256)](this['matrix'],_0x55ae85,_0x55ae85),Cesium__namespace['Matrix4'][_0x4f9280(0xf7f)](this['worldToModel'],new Cesium__namespace['Cartesian4'](_0x55ae85['x'],_0x55ae85['y'],_0x55ae85['z'],0x0),_0x55ae85),Cesium__namespace[_0x4f9280(_0x39c608._0x7e8403)]['add'](this['translation'],_0x55ae85,this[_0x4f9280(0x780)]),this['position']=_0x5b4ccf,this[_0x4f9280(_0x39c608._0xc5df55)]=Cesium__namespace[_0x4f9280(0x49c)][_0x4f9280(0x67b)](this['position']),Cesium__namespace[_0x4f9280(_0x39c608._0x5233ee)]['inverse'](this[_0x4f9280(_0x39c608._0x569747)],this['inverseMatrix']);const _0x5bcd07=this['normalX'],_0xa33e3f=this['normalY'],_0x2a4f24=this[_0x4f9280(0xe4a)];this['normalX']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace[_0x4f9280(_0x39c608._0x5d20c5)]['UNIT_X'],new Cesium__namespace[(_0x4f9280(0x8eb))]()),this['normalY']=Cesium__namespace[_0x4f9280(0x6a7)]['multiplyByPointAsVector'](this['matrix'],Cesium__namespace[_0x4f9280(_0x39c608._0x7e8403)]['UNIT_Y'],new Cesium__namespace['Cartesian3']()),this['normalZ']=Cesium__namespace['Matrix4'][_0x4f9280(0x85a)](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_Z'],new Cesium__namespace[(_0x4f9280(_0x39c608._0x2985ba))]());if(_0x37280c===Cesium__namespace['Axis']['X']){let _0x728545=Cesium__namespace['Cartesian3']['angleBetween'](_0xa33e3f,this[_0x4f9280(0xc55)]),_0x3244b6=Cesium__namespace['Cartesian3'][_0x4f9280(0x5ec)](_0x2a4f24,this['normalZ']);_0x3ab86d<0x0&&(_0x3244b6=-_0x3244b6,_0x728545=-_0x728545);const _0x2f6d03=Cesium__namespace[_0x4f9280(_0x39c608._0x4286d3)]['multiplyByPointAsVector'](this['worldToModel'],_0x2a4f24,new Cesium__namespace['Cartesian3']());let _0x4de192=Cesium__namespace['Matrix3'][_0x4f9280(_0x39c608._0x59826b)](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x2d8cbf=Cesium__namespace['Matrix3']['multiplyByVector'](_0x4de192,_0x2f6d03,new Cesium__namespace['Cartesian3']()),_0x16aa96=this['_axisRotation'](_0x2d8cbf,_0x728545);Cesium__namespace[_0x4f9280(_0x39c608._0x512bf5)]['multiply'](this['rotateMatrix'],_0x16aa96,this['rotateMatrix']);const _0x4f7204=Cesium__namespace['Matrix4'][_0x4f9280(_0x39c608._0x39d37d)](this[_0x4f9280(_0x39c608._0x16109f)],_0xa33e3f,new Cesium__namespace['Cartesian3']());_0x4de192=Cesium__namespace['Matrix3'][_0x4f9280(_0x39c608._0x59826b)](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x2d8cbf=Cesium__namespace['Matrix3']['multiplyByVector'](_0x4de192,_0x4f7204,new Cesium__namespace['Cartesian3']()),_0x16aa96=this['_axisRotation'](_0x2d8cbf,_0x3244b6),Cesium__namespace['Matrix3']['multiply'](this['rotateMatrix'],_0x16aa96,this['rotateMatrix']);}if(_0x37280c===Cesium__namespace['Axis']['Y']){let _0x399801=Cesium__namespace[_0x4f9280(0x8eb)]['angleBetween'](_0x2a4f24,this['normalZ']);_0x3ab86d>0x0&&(_0x399801=-_0x399801);const _0x4a9cdc=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],_0x5bcd07,new Cesium__namespace['Cartesian3']()),_0x4ed616=Cesium__namespace['Matrix3']['inverse'](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x59ee5c=Cesium__namespace['Matrix3']['multiplyByVector'](_0x4ed616,_0x4a9cdc,new Cesium__namespace['Cartesian3']()),_0x115f20=this['_axisRotation'](_0x59ee5c,_0x399801);Cesium__namespace[_0x4f9280(_0x39c608._0x3081ff)]['multiply'](this['rotateMatrix'],_0x115f20,this['rotateMatrix']);}this['_graphic_dragger_ing']['positions']=[this['_graphic_dragger_ing']['positions'][0x0],_0x5b4ccf],this['_updatePositionHook']();const _0x15d427={..._0x121257,'editType':_0x37280c,'position':_0x5b4ccf};this[_0x4f9280(0xa6e)](_0x15d427);}['_onMap_leftUp'](_0x124f56){const _0x48ef9e={_0x27e1c7:0x163,_0x1a4d2a:0x212,_0x379a5c:0x3c8,_0x577822:0xb35,_0x4d7329:0xf5b},_0x4b9259=_0x35a251;if(!this[_0x4b9259(_0x48ef9e._0x27e1c7)])return;this['_graphic'][_0x4b9259(_0x48ef9e._0x1a4d2a)]({'color':this[_0x4b9259(_0x48ef9e._0x27e1c7)][_0x4b9259(0xfc8)]['color_bak']}),this[_0x4b9259(0x163)]=null,this[_0x4b9259(_0x48ef9e._0x379a5c)][_0x4b9259(_0x48ef9e._0x577822)]=[],this[_0x4b9259(0x3c8)]['show']=![],this['_hasChangeEnableInputs']&&(this['_map']['scene']['screenSpaceCameraController']['enableInputs']=!![],delete this['_hasChangeEnableInputs']),this['_map']['off'](EventType['mouseMove'],this[_0x4b9259(_0x48ef9e._0x4d7329)],this),this['fire'](EventType['stop'],_0x124f56);}['_axisRotation'](_0x28e1c3,_0x892519,_0x482b38){const _0x53f89c={_0x1685e3:0xeec,_0x3fd34c:0xd9d},_0x5c018b=_0x35a251;let _0x579a2b=_0x28e1c3['x'],_0x5b053b=_0x28e1c3['y'],_0x4e2dbc=_0x28e1c3['z'];const _0xdb24e=Math['sqrt'](_0x579a2b*_0x579a2b+_0x5b053b*_0x5b053b+_0x4e2dbc*_0x4e2dbc);_0x579a2b=_0x579a2b/_0xdb24e,_0x5b053b=_0x5b053b/_0xdb24e,_0x4e2dbc=_0x4e2dbc/_0xdb24e;const _0x26e292=_0x579a2b*_0x579a2b,_0xd7c5c7=_0x5b053b*_0x5b053b,_0x36a1ed=_0x4e2dbc*_0x4e2dbc,_0x11f04f=Math[_0x5c018b(_0x53f89c._0x1685e3)](_0x892519),_0x5e633b=Math['sin'](_0x892519),_0x2e842a=0x1-_0x11f04f;return _0x482b38=_0x482b38||new Cesium__namespace['Matrix3'](),_0x482b38[Cesium__namespace[_0x5c018b(0xd9d)]['COLUMN0ROW0']]=_0x26e292+(0x1-_0x26e292)*_0x11f04f,_0x482b38[Cesium__namespace['Matrix3']['COLUMN0ROW1']]=_0x579a2b*_0x5b053b*_0x2e842a+_0x4e2dbc*_0x5e633b,_0x482b38[Cesium__namespace['Matrix3']['COLUMN0ROW2']]=_0x579a2b*_0x4e2dbc*_0x2e842a-_0x5b053b*_0x5e633b,_0x482b38[Cesium__namespace['Matrix3']['COLUMN1ROW0']]=_0x579a2b*_0x5b053b*_0x2e842a-_0x4e2dbc*_0x5e633b,_0x482b38[Cesium__namespace[_0x5c018b(0xd9d)]['COLUMN1ROW1']]=_0xd7c5c7+(0x1-_0xd7c5c7)*_0x11f04f,_0x482b38[Cesium__namespace[_0x5c018b(_0x53f89c._0x3fd34c)]['COLUMN1ROW2']]=_0x5b053b*_0x4e2dbc*_0x2e842a+_0x579a2b*_0x5e633b,_0x482b38[Cesium__namespace[_0x5c018b(0xd9d)]['COLUMN2ROW0']]=_0x579a2b*_0x4e2dbc*_0x2e842a+_0x5b053b*_0x5e633b,_0x482b38[Cesium__namespace['Matrix3']['COLUMN2ROW1']]=_0x5b053b*_0x4e2dbc*_0x2e842a-_0x579a2b*_0x5e633b,_0x482b38[Cesium__namespace['Matrix3']['COLUMN2ROW2']]=_0x36a1ed+(0x1-_0x36a1ed)*_0x11f04f,_0x482b38;}[_0x35a251(0x339)](){this['_updatePositionHook'](!![]);}[_0x35a251(0x474)](_0x3d447a){const _0x1c8310={_0x3d2ee1:0x67b},_0x384ee8=_0x35a251,_0x10843d=this['_map']['scene']['pickPosition'](_0x3d447a['position']);_0x10843d&&(this['position']=_0x10843d,this['matrix']=Cesium__namespace['Transforms'][_0x384ee8(_0x1c8310._0x3d2ee1)](this[_0x384ee8(0xb61)]),Cesium__namespace['Matrix4']['inverse'](this['matrix'],this[_0x384ee8(0xc72)]),this[_0x384ee8(0x675)]());}[_0x35a251(0xa6e)](_0x4c93b3){const _0x504e8c={_0x41fbcf:0xe86},_0x1e25d0=_0x35a251;this['options']['onChange']&&this[_0x1e25d0(_0x504e8c._0x41fbcf)]['onChange'](_0x4c93b3),this[_0x1e25d0(0x264)](EventType['change'],_0x4c93b3,!![]);}}class MatrixRotate extends MatrixMove{get['heading'](){return this['options']['heading']??0x0;}set['heading'](_0x3685f8){this['options']['heading']=_0x3685f8;}get[_0x35a251(0x527)](){return this['options']['pitch']??0x0;}set['pitch'](_0xaf88e4){const _0x43585b=_0x35a251;this[_0x43585b(0xe86)]['pitch']=_0xaf88e4;}get['roll'](){const _0x435651={_0x14895e:0xba7},_0x3e1f4f=_0x35a251;return this['options'][_0x3e1f4f(_0x435651._0x14895e)]??0x0;}set['roll'](_0x1fd616){const _0x74aacb={_0x5dde29:0xe86,_0x410d4a:0xba7},_0x38a29e=_0x35a251;this[_0x38a29e(_0x74aacb._0x5dde29)][_0x38a29e(_0x74aacb._0x410d4a)]=_0x1fd616;}['_removedHook'](){const _0x23c64f={_0x57e139:0xbe7,_0x64a5df:0xa9a},_0x4f16ee=_0x35a251;delete this['_graphic_rotate_z'],delete this[_0x4f16ee(_0x23c64f._0x57e139)],delete this['_graphic_rotate_y'],super[_0x4f16ee(_0x23c64f._0x64a5df)]();}['_createGraphics'](){const _0x1cd679={_0x2891c7:0xcd7,_0x3fb900:0xcd7,_0x31bbdc:0x373,_0x302bd8:0xaae,_0x121365:0xf29},_0x44f494=_0x35a251;this['_graphicLayer']['clear'](),this['_graphic_rotate_x']=new PolylinePrimitive({'positions':this[_0x44f494(0xa5a)],'style':{'width':0x8,'color':Cesium__namespace[_0x44f494(0xf29)]['RED'],'depthFail':!![],'depthFailColor':Cesium__namespace[_0x44f494(0xf29)]['RED']['withAlpha'](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace['Axis']['X']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this['_graphic_rotate_x']),this['_graphic_rotate_y']=new PolylinePrimitive({'positions':this['_positions_circle_y'],'style':{'width':0x8,'color':Cesium__namespace['Color'][_0x44f494(_0x1cd679._0x2891c7)],'depthFail':!![],'depthFailColor':Cesium__namespace['Color'][_0x44f494(_0x1cd679._0x3fb900)][_0x44f494(_0x1cd679._0x31bbdc)](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace['Axis']['Y']},'asynchronous':![]}),this['_graphicLayer'][_0x44f494(0x8b5)](this[_0x44f494(_0x1cd679._0x302bd8)]),this['_graphic_rotate_z']=new PolylinePrimitive({'positions':this['_positions_circle_z'],'style':{'width':0x8,'color':Cesium__namespace[_0x44f494(0xf29)][_0x44f494(0xc87)],'depthFail':!![],'depthFailColor':Cesium__namespace['Color']['BLUE']['withAlpha'](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace[_0x44f494(0xc0d)]['Z']},'asynchronous':![]}),this[_0x44f494(0xb13)][_0x44f494(0x8b5)](this['_graphic_rotate_z']),this[_0x44f494(0x3c8)]=new PolylinePrimitive({'positions':[],'style':{'width':0x3,'arcType':Cesium__namespace['ArcType']['NONE'],'materialType':PolylineDash,'color':Cesium__namespace[_0x44f494(_0x1cd679._0x121365)]['YELLOW'],'depthFail':!![]},'asynchronous':![],'show':![]}),this['_graphicLayer']['addGraphic'](this['_graphic_dragger_ing']);}['_initByPosition'](){const _0x184ce3={_0x1a9e4c:0xd89,_0x2da2be:0x9b0,_0x4a26d5:0x6a9,_0x513d72:0x8eb,_0xf36d78:0x733,_0x262ad3:0xa5a},_0x481123=_0x35a251;this[_0x481123(_0x184ce3._0x1a9e4c)]=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](this['position']),this['worldToModel']=Cesium__namespace['Matrix4']['inverse'](this['modelToWorld'],new Cesium__namespace[(_0x481123(0x6a7))]()),this['matrix']=this['modelToWorld']['clone'](),this['inverseMatrix']=Cesium__namespace['Matrix4'][_0x481123(0x7b)](this[_0x481123(_0x184ce3._0x2da2be)],new Cesium__namespace['Matrix4']()),this[_0x481123(_0x184ce3._0x4a26d5)]=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3'][_0x481123(0x9a0)],new Cesium__namespace['Cartesian3']()),this['normalY']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this[_0x481123(0x9b0)],Cesium__namespace[_0x481123(_0x184ce3._0x513d72)][_0x481123(0x2a3)],new Cesium__namespace[(_0x481123(0x8eb))]()),this['normalZ']=Cesium__namespace['Matrix4'][_0x481123(0x85a)](this[_0x481123(0x9b0)],Cesium__namespace['Cartesian3'][_0x481123(0x61f)],new Cesium__namespace['Cartesian3']()),this[_0x481123(_0x184ce3._0xf36d78)]=[],this[_0x481123(_0x184ce3._0x262ad3)]=[],this[_0x481123(0x930)]=[];}[_0x35a251(0x675)](_0x142b37){const _0x36370b={_0x74a35:0xd79,_0x26d8c0:0x389,_0x5b47f1:0xf48,_0x287d10:0x733,_0x3ef8c7:0xeec,_0x1a934a:0x8eb,_0x3a8948:0x4af,_0x6d460b:0x6de,_0x5160a1:0xc55,_0x35de87:0x4af,_0x16c14f:0x6de,_0x428452:0xbe7,_0x5b4cdd:0xbe7},_0x32404f=_0x35a251;if(!this[_0x32404f(_0x36370b._0x74a35)])return;const _0x595e23=this['position']['clone']();if(_0x142b37){const _0x144d84=new Cesium__namespace['Matrix4']['multiplyByPoint'](this['_map']['camera'][_0x32404f(_0x36370b._0x26d8c0)],_0x595e23,new Cesium__namespace['Cartesian3']()),_0x5b9e9a=-_0x144d84['z']*Math['tan'](this['_map']['camera']['frustum']['fov']/0x2)*0x2,_0x3a89ca=_0x5b9e9a/this['_map']['canvas'][_0x32404f(_0x36370b._0x5b47f1)];this['radius']=0xc8*_0x3a89ca;}this[_0x32404f(_0x36370b._0x287d10)]=[],this[_0x32404f(0xa5a)]=[],this['_positions_circle_y']=[];for(let _0x3687d8=0x0;_0x3687d8<=0x168;_0x3687d8++){const _0x50b385=this['radius']*Math[_0x32404f(_0x36370b._0x3ef8c7)](_0x3687d8/0xb4*Math['PI']),_0x2f66b2=this['radius']*Math['sin'](_0x3687d8/0xb4*Math['PI']),_0x49c7fb=new Cesium__namespace[(_0x32404f(0x8eb))]();Cesium__namespace[_0x32404f(_0x36370b._0x1a934a)][_0x32404f(_0x36370b._0x3a8948)](_0x595e23,Cesium__namespace['Cartesian3'][_0x32404f(0xddc)](this['normalX'],_0x50b385,new Cesium__namespace[(_0x32404f(_0x36370b._0x1a934a))]()),_0x49c7fb),Cesium__namespace['Cartesian3']['add'](_0x49c7fb,Cesium__namespace['Cartesian3'][_0x32404f(0xddc)](this['normalY'],_0x2f66b2,new Cesium__namespace['Cartesian3']()),_0x49c7fb),this['_positions_circle_z'][_0x32404f(_0x36370b._0x6d460b)](_0x49c7fb);const _0x43cf08=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['add'](_0x595e23,Cesium__namespace['Cartesian3']['multiplyByScalar'](this['normalX'],_0x50b385,new Cesium__namespace['Cartesian3']()),_0x43cf08),Cesium__namespace[_0x32404f(_0x36370b._0x1a934a)]['add'](_0x43cf08,Cesium__namespace['Cartesian3'][_0x32404f(0xddc)](this['normalZ'],_0x2f66b2,new Cesium__namespace['Cartesian3']()),_0x43cf08),this['_positions_circle_x']['push'](_0x43cf08);const _0x5a1e28=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['add'](_0x595e23,Cesium__namespace['Cartesian3'][_0x32404f(0xddc)](this[_0x32404f(_0x36370b._0x5160a1)],_0x50b385,new Cesium__namespace['Cartesian3']()),_0x5a1e28),Cesium__namespace['Cartesian3'][_0x32404f(_0x36370b._0x35de87)](_0x5a1e28,Cesium__namespace['Cartesian3']['multiplyByScalar'](this['normalZ'],_0x2f66b2,new Cesium__namespace['Cartesian3']()),_0x5a1e28),this['_positions_circle_y'][_0x32404f(_0x36370b._0x16c14f)](_0x5a1e28);}this['_graphic_rotate_z']&&(this['_graphic_rotate_z'][_0x32404f(0xb35)]=this['_positions_circle_z']),this[_0x32404f(_0x36370b._0x428452)]&&(this[_0x32404f(_0x36370b._0x5b4cdd)]['positions']=this['_positions_circle_x']),this['_graphic_rotate_y']&&(this[_0x32404f(0xaae)][_0x32404f(0xb35)]=this[_0x32404f(0x930)]);}['_onMap_mouseMove'](_0x3badc4){const _0x2842d9={_0x2c4a21:0x6a7,_0x4e4919:0x7d,_0x36053e:0x389,_0x4be300:0x6b3,_0xd24b32:0x8ea,_0x5f183c:0x8eb,_0x38569e:0x85a,_0x5a049f:0xc0d,_0x8fc6e9:0x79b,_0x39869e:0xee1,_0x1aa2f7:0xd79,_0x135f80:0x7e2,_0x564183:0x7d,_0x8b2da0:0x24f,_0x1e2daa:0x24f,_0x4b84b6:0xc55,_0xfcc2d9:0x527,_0x4a046e:0x7c0,_0x51deea:0x6a9,_0xb3d485:0xba7,_0x101777:0xd9d},_0x255dba=_0x35a251,_0x46f4ad=_0x3badc4['startPosition'],_0x2ca492=_0x3badc4['endPosition'],_0x4a289d=new Cesium__namespace[(_0x255dba(_0x2842d9._0x2c4a21))]['multiplyByPoint'](this[_0x255dba(0xd79)][_0x255dba(_0x2842d9._0x4e4919)][_0x255dba(_0x2842d9._0x36053e)],this['position'],new Cesium__namespace['Cartesian3']()),_0x5df328=-_0x4a289d['z']*Math['tan'](this['_map']['camera']['frustum']['fov']/0x2)*0x2;let _0x650b6a=_0x5df328/this['_map']['canvas']['width'];const _0x8e38db=new Cesium__namespace['Cartesian3'](0x1,0x1,0x1);let _0x2e16c3;const _0x423e9b=this['_graphic'][_0x255dba(_0x2842d9._0x4be300)][_0x255dba(_0x2842d9._0xd24b32)];_0x423e9b===Cesium__namespace['Axis']['Z']&&(_0x8e38db['z']=0x0,_0x2e16c3=Cesium__namespace['Cartesian3']['angleBetween'](Cesium__namespace[_0x255dba(0x6a7)]['multiplyByPointAsVector'](this['matrix'],new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),new Cesium__namespace[(_0x255dba(_0x2842d9._0x5f183c))]()),this['_map'][_0x255dba(0x7d)]['direction']));_0x423e9b===Cesium__namespace['Axis']['X']&&(_0x8e38db['y']=0x0,_0x2e16c3=Cesium__namespace['Cartesian3']['angleBetween'](Cesium__namespace['Matrix4'][_0x255dba(_0x2842d9._0x38569e)](this['matrix'],new Cesium__namespace[(_0x255dba(0x8eb))](0x0,0x1,0x0),new Cesium__namespace['Cartesian3']()),this['_map'][_0x255dba(0x7d)][_0x255dba(0x79b)]));_0x423e9b===Cesium__namespace[_0x255dba(_0x2842d9._0x5a049f)]['Y']&&(_0x8e38db['x']=0x0,_0x2e16c3=Cesium__namespace[_0x255dba(0x8eb)]['angleBetween'](Cesium__namespace['Matrix4'][_0x255dba(0x85a)](this['matrix'],new Cesium__namespace[(_0x255dba(0x8eb))](0x1,0x0,0x0),new Cesium__namespace['Cartesian3']()),this['_map']['camera'][_0x255dba(_0x2842d9._0x8fc6e9)]));Math['abs'](_0x2e16c3-Math['PI']/0x2)<0.1&&(_0x650b6a=0x1,_0x4a289d['z']=0x0);let _0x5ec1ad=new Cesium__namespace['Cartesian3']((_0x46f4ad['x']-this[_0x255dba(0xd79)][_0x255dba(_0x2842d9._0x39869e)][_0x255dba(0xf48)]/0x2)*_0x650b6a,(-_0x46f4ad['y']+this[_0x255dba(_0x2842d9._0x1aa2f7)]['canvas'][_0x255dba(0x682)]/0x2)*_0x650b6a,_0x4a289d['z']),_0x2bec44=new Cesium__namespace['Cartesian3']((_0x2ca492['x']-this['_map']['canvas']['width']/0x2)*_0x650b6a,(-_0x2ca492['y']+this['_map'][_0x255dba(0xee1)][_0x255dba(0x682)]/0x2)*_0x650b6a,_0x4a289d['z']);Cesium__namespace['Matrix4'][_0x255dba(_0x2842d9._0x135f80)](this['_map'][_0x255dba(_0x2842d9._0x564183)][_0x255dba(_0x2842d9._0x8b2da0)],_0x5ec1ad,_0x5ec1ad),Cesium__namespace[_0x255dba(0x6a7)]['multiplyByPoint'](this[_0x255dba(_0x2842d9._0x1aa2f7)]['camera'][_0x255dba(_0x2842d9._0x1e2daa)],_0x2bec44,_0x2bec44),Cesium__namespace[_0x255dba(_0x2842d9._0x2c4a21)]['multiplyByPoint'](this[_0x255dba(0xc72)],_0x5ec1ad,_0x5ec1ad),Cesium__namespace['Matrix4'][_0x255dba(0x7e2)](this['inverseMatrix'],_0x2bec44,_0x2bec44),_0x5ec1ad=new Cesium__namespace['Cartesian3'](_0x5ec1ad['x']*_0x8e38db['x'],_0x5ec1ad['y']*_0x8e38db['y'],_0x5ec1ad['z']*_0x8e38db['z']),_0x2bec44=new Cesium__namespace[(_0x255dba(0x8eb))](_0x2bec44['x']*_0x8e38db['x'],_0x2bec44['y']*_0x8e38db['y'],_0x2bec44['z']*_0x8e38db['z']),_0x2e16c3=Cesium__namespace['Cartesian3'][_0x255dba(0x5ec)](_0x5ec1ad,_0x2bec44);let _0x672796;if(_0x423e9b===Cesium__namespace['Axis']['Z']){const _0x3c8dec=_0x5ec1ad['x']*_0x2bec44['y']-_0x5ec1ad['y']*_0x2bec44['x'];_0x672796=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],this['normalZ'],new Cesium__namespace['Cartesian3']()),_0x3c8dec>0x0&&(_0x2e16c3=-_0x2e16c3),this[_0x255dba(0x41f)]=(this['heading']+Cesium__namespace['Math']['toDegrees'](_0x2e16c3))%0x168;}else{if(_0x423e9b===Cesium__namespace['Axis']['X']){const _0x237374=_0x5ec1ad['x']*_0x2bec44['z']-_0x5ec1ad['z']*_0x2bec44['x'];_0x672796=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],this[_0x255dba(_0x2842d9._0x4b84b6)],new Cesium__namespace['Cartesian3']()),_0x237374>0x0&&(_0x2e16c3=-_0x2e16c3),this['pitch']=(this[_0x255dba(_0x2842d9._0xfcc2d9)]+Cesium__namespace[_0x255dba(_0x2842d9._0x4a046e)]['toDegrees'](_0x2e16c3))%0x168;}else{if(_0x423e9b===Cesium__namespace['Axis']['Y']){const _0x55cb4e=_0x5ec1ad['y']*_0x2bec44['z']-_0x5ec1ad['z']*_0x2bec44['y'];_0x672796=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],this[_0x255dba(_0x2842d9._0x51deea)],new Cesium__namespace[(_0x255dba(0x8eb))]()),_0x55cb4e<0x0&&(_0x2e16c3=-_0x2e16c3),this['roll']=(this[_0x255dba(_0x2842d9._0xb3d485)]+Cesium__namespace['Math']['toDegrees'](_0x2e16c3))%0x168;}}}const _0x5a64f8=Cesium__namespace['Matrix3'][_0x255dba(0x7b)](this[_0x255dba(0x9b8)],new Cesium__namespace[(_0x255dba(_0x2842d9._0x101777))]()),_0x5d9be8=Cesium__namespace['Matrix3'][_0x255dba(0xf7f)](_0x5a64f8,_0x672796,new Cesium__namespace['Cartesian3']()),_0x1d409d=this['_axisRotation'](_0x5d9be8,_0x2e16c3);Cesium__namespace['Matrix3']['multiply'](this['rotateMatrix'],_0x1d409d,this['rotateMatrix']);const _0x3b8a17={..._0x3badc4,'editType':_0x423e9b,'position':this['position'],'heading':this['heading'],'pitch':this['pitch'],'roll':this['roll']};this['onChange'](_0x3b8a17);}[_0x35a251(0x474)](_0x5121fa){}}class EditBase{constructor(_0x5819a7){const _0x6a3688={_0x107254:0xd79},_0x36e889=_0x35a251;this['_graphic']=_0x5819a7,this[_0x36e889(_0x6a3688._0x107254)]=_0x5819a7[_0x36e889(_0x6a3688._0x107254)],this[_0x36e889(0x1cf)]=[];}get[_0x35a251(0x2a6)](){return this['_enabled'];}get['map'](){return this['_map'];}get['layer'](){const _0x58edc7={_0x541603:0x163},_0x202b5d=_0x35a251;return this[_0x202b5d(_0x58edc7._0x541603)]['_layer'];}get[_0x35a251(0xfc8)](){return this['_graphic']['style'];}get['clampToGround'](){const _0x2242bc=_0x35a251;var _0x391532,_0x5dd190;return(_0x391532=this[_0x2242bc(0x163)])===null||_0x391532===void 0x0?void 0x0:(_0x5dd190=_0x391532['style'])===null||_0x5dd190===void 0x0?void 0x0:_0x5dd190[_0x2242bc(0x979)];}get['type'](){return this['_graphic']['type'];}get['entityGraphic'](){const _0x1e9fbc=_0x35a251;return this[_0x1e9fbc(0x163)]['entityGraphic'];}set['positions'](_0x1cd1a1){const _0x5903b0={_0x37c5a8:0x937},_0x5b276a=_0x35a251;this[_0x5b276a(0x163)][_0x5b276a(_0x5903b0._0x37c5a8)]=_0x1cd1a1;}get['positions'](){return this['_graphic']['_positions_draw']||this['_graphic']['_positions']||[];}get[_0x35a251(0x10f)](){return Boolean(this['_matrixRotate']);}get[_0x35a251(0x841)](){return Boolean(this['_matrixMove']);}[_0x35a251(0x264)](_0x2fefce,_0x530502={},_0x3c88b6=!![]){const _0x3cab4c={_0x4b4d92:0xed8},_0xef6300=_0x35a251;if(this['_graphic']){const _0x381a76=this['_graphic']['parent'];_0x530502[_0xef6300(_0x3cab4c._0x4b4d92)]=this['type'],this['_graphic']['fire'](_0x2fefce,_0x530502,_0x3c88b6),_0x381a76&&(_0x530502['editType']=_0x381a76['type'],_0x381a76['fire'](_0x2fefce,_0x530502,_0x3c88b6));}}['formatNum'](_0x3af686,_0x2bee16){return formatNum$1(_0x3af686,_0x2bee16);}[_0x35a251(0x2f7)](){const _0x5706e7={_0x1b4601:0x264},_0x4ebf83=_0x35a251;if(this[_0x4ebf83(0x706)])return this;return this['_enabled']=!![],this['_graphic']['_setPositionsToCallback']&&this[_0x4ebf83(0x163)][_0x4ebf83(0xac7)](),this['destroyDraggers'](),this['bindDraggers'](),this['bindEvent'](),this[_0x4ebf83(_0x5706e7._0x1b4601)](EventType['editStart']),this;}['disable'](){const _0x32293d={_0x403866:0x2d0,_0x2e92c5:0x736},_0x27b3da=_0x35a251;var _0x175541,_0x2a3a04,_0x1266e9;if(!this['_enabled'])return this;return this['_enabled']=![],this['stopMoveMatrix'](),this['stopRotateMatrix'](),this['unbindEvent'](),this[_0x27b3da(0x758)](),this[_0x27b3da(0x7c7)](),(_0x175541=this['_graphic'])!==null&&_0x175541!==void 0x0&&(_0x2a3a04=_0x175541[_0x27b3da(_0x32293d._0x403866)])!==null&&_0x2a3a04!==void 0x0&&(_0x1266e9=_0x2a3a04['options'])!==null&&_0x1266e9!==void 0x0&&_0x1266e9['isRestorePositions']&&this['_graphic'][_0x27b3da(_0x32293d._0x2e92c5)](),this['fire'](EventType[_0x27b3da(0x2ba)]),this;}['finish'](){}['bindEvent'](){this['_map']['on'](EventType['leftDown'],this['_onLeftDownHandler'],this),this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['leftUp'],this['_onLeftUpHandler'],this);}['unbindEvent'](){const _0x308a65={_0x12930f:0x6b2,_0x4a1bf4:0xd79,_0x4d58ad:0x163,_0x329ada:0x987},_0x390f53=_0x35a251;this['_map'][_0x390f53(_0x308a65._0x12930f)](EventType['leftDown'],this['_onLeftDownHandler'],this),this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this[_0x390f53(_0x308a65._0x4a1bf4)]['off'](EventType['leftUp'],this['_onLeftUpHandler'],this),this[_0x390f53(0xddb)]&&(this[_0x390f53(_0x308a65._0x4a1bf4)]['scene']['screenSpaceCameraController']['enableInputs']=!![],delete this['_hasChangeEnableInputs']),this['_map'][_0x390f53(0x492)](![]),!this[_0x390f53(_0x308a65._0x4d58ad)][_0x390f53(_0x308a65._0x329ada)]&&(this['_graphic'][_0x390f53(0x987)]=!![]);}[_0x35a251(0xe34)](_0x5bbfc2){const _0x211330={_0x5c5269:0xd79,_0x26ffa1:0x856,_0x3e410e:0xc60,_0x2b5207:0xc7},_0x298361=_0x35a251,_0x36e7e7=this[_0x298361(_0x211330._0x5c5269)]['mouseEvent']['getPickTarget'](_0x5bbfc2[_0x298361(0xb61)],_0x5bbfc2);if(_0x36e7e7[_0x298361(0x87)]!==this['layer'])return;const _0x199871=_0x36e7e7===null||_0x36e7e7===void 0x0?void 0x0:_0x36e7e7['graphic'];if(!_0x199871||!_0x199871['_isDragger'])return;this['_map']['scene']['screenSpaceCameraController'][_0x298361(_0x211330._0x26ffa1)]&&(this[_0x298361(_0x211330._0x5c5269)][_0x298361(_0x211330._0x3e410e)]['screenSpaceCameraController']['enableInputs']=![],this['_hasChangeEnableInputs']=!![]),this['_map']['_setEditCursor'](!![]),_0x199871['_closeAllControl'](),this['_draggerIng']=_0x199871,this['_draggerIng']['show']=_0x199871['options']['drawShow']??![],_0x199871['onDragStart']&&_0x199871[_0x298361(0x481)](_0x199871,_0x36e7e7['cartesian']||_0x199871['position']),this[_0x298361(0x264)](EventType[_0x298361(_0x211330._0x2b5207)],{..._0x5bbfc2,..._0x36e7e7,'index':this['_draggerIng']['index']});}['_onMouseMoveHandler'](_0x471d13){const _0x102db6={_0x163f4a:0x67d},_0x150b1b=_0x35a251;this['_draggerIng']?this[_0x150b1b(_0x102db6._0x163f4a)](_0x471d13):this['_onMouseMoveMapHandler'](_0x471d13);}['_onMouseMoveDraggerHandler'](_0x20bec7){const _0x3d9ba3={_0x1ba868:0x674,_0x2025a9:0xd79,_0x3731b9:0x390,_0x348721:0x966,_0x42ccc3:0xd46,_0x3fca5c:0x53d,_0x4275a2:0x771,_0x550c28:0x249,_0x57ea72:0x674,_0xc2af8d:0x674,_0x58d09a:0x489,_0x21807b:0x1bc,_0x24e9b0:0x37e},_0x20e59d=_0x35a251;let _0x57a77c;switch(this[_0x20e59d(_0x3d9ba3._0x1ba868)]['_pointType']){case PointType[_0x20e59d(0xe2a)]:{var _0x60c753;const _0x40b609=_0x20bec7['endPosition']['y']-_0x20bec7[_0x20e59d(0x208)]['y'],_0x34f22a=getPositionValue(this['_draggerIng'][_0x20e59d(0xb61)],(_0x60c753=this['_map'])===null||_0x60c753===void 0x0?void 0x0:_0x60c753['clock']['currentTime']),_0x2c0997=new Cesium__namespace['EllipsoidTangentPlane'](_0x34f22a),_0x39364c=new Cesium__namespace['BoundingSphere'](),_0x472f7e=new Cesium__namespace['Cartesian3']();_0x39364c['center']=_0x34f22a,_0x39364c['radius']=0x1;const _0x24e1b2=this[_0x20e59d(_0x3d9ba3._0x2025a9)]['scene']['frameState']['camera'][_0x20e59d(0x985)](_0x39364c,this['_map']['scene']['frameState'][_0x20e59d(_0x3d9ba3._0x3731b9)]['drawingBufferWidth'],this['_map']['scene']['frameState']['context'][_0x20e59d(_0x3d9ba3._0x348721)])*1.5;Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x2c0997['zAxis'],-_0x40b609*_0x24e1b2,_0x472f7e),_0x57a77c=Cesium__namespace['Cartesian3'][_0x20e59d(0xd61)](_0x34f22a),Cesium__namespace['Cartesian3'][_0x20e59d(0x4af)](_0x34f22a,_0x472f7e,_0x57a77c),this['_draggerIng']['position']=_0x57a77c;this['_draggerIng']['onDrag']&&this['_draggerIng'][_0x20e59d(_0x3d9ba3._0x42ccc3)](this[_0x20e59d(0x674)],_0x57a77c,_0x34f22a);this['updateAttrForEditing'](),this['fire'](EventType[_0x20e59d(_0x3d9ba3._0x3fca5c)],_0x20bec7);break;}default:{this['_map'][_0x20e59d(_0x3d9ba3._0x4275a2)](_0x20bec7['endPosition'],this['_map']['getLangText']('_释放后完成修改'));let _0x220d92=this['_graphic'][_0x20e59d(_0x3d9ba3._0x550c28)];this[_0x20e59d(0x979)]&&(_0x220d92=null);_0x57a77c=getCurrentMousePosition(this['_map']['scene'],_0x20bec7['endPosition'],_0x220d92);if(_0x57a77c){if(this['_graphic']['options']['validDrawPosition']){const _0x2d7705=this['_graphic']['options']['validDrawPosition'](_0x57a77c,this['_graphic']);if(!_0x2d7705)return;}this[_0x20e59d(_0x3d9ba3._0x1ba868)]['position']=_0x57a77c,this['_draggerIng'][_0x20e59d(_0x3d9ba3._0x42ccc3)]&&this[_0x20e59d(_0x3d9ba3._0x57ea72)][_0x20e59d(_0x3d9ba3._0x42ccc3)](this[_0x20e59d(_0x3d9ba3._0xc2af8d)],_0x57a77c),this['updateAttrForEditing']();}}break;}this['fire'](EventType[_0x20e59d(_0x3d9ba3._0x58d09a)],{..._0x20bec7,'index':this['_draggerIng'][_0x20e59d(_0x3d9ba3._0x21807b)],'cartesian':_0x57a77c,'windowPosition':_0x20bec7[_0x20e59d(_0x3d9ba3._0x24e9b0)]});}['_onMouseMoveMapHandler'](_0x36ce4f){const _0x4d40c8={_0xaf3af4:0xb0,_0x52bf70:0xe1e,_0x411d3f:0xd79,_0x4bb862:0x37e},_0x4045c5=_0x35a251;var _0x5c9704,_0x367160;const _0x54d308=this[_0x4045c5(0xd79)][_0x4045c5(_0x4d40c8._0xaf3af4)]['getPickTarget'](_0x36ce4f[_0x4045c5(0x37e)],_0x36ce4f),_0x265d5e=_0x54d308===null||_0x54d308===void 0x0?void 0x0:_0x54d308['graphic'];if(_0x265d5e==null){this['_map']['closeSmallTooltip']();return;}if(_0x54d308['layer']!==this['layer']||!_0x265d5e['_isDragger'])return;if(this['_map']['contextmenu']['show']&&this['_map']['contextmenu'][_0x4045c5(0xe28)]===_0x265d5e)return;let _0x38b57d=_0x265d5e['_draw_tooltip'];if(!_0x38b57d)return;PointType['Control']===_0x265d5e['_pointType']&&((_0x5c9704=this['_graphic'])===null||_0x5c9704===void 0x0?void 0x0:(_0x367160=_0x5c9704[_0x4045c5(0x937)])===null||_0x367160===void 0x0?void 0x0:_0x367160[_0x4045c5(_0x4d40c8._0x52bf70)])>this[_0x4045c5(0x163)]['_minPointNum']&&(_0x38b57d+='
'+this[_0x4045c5(_0x4d40c8._0x411d3f)][_0x4045c5(0x44e)]('_右击删除点')),this['_map']['openSmallTooltip'](_0x36ce4f[_0x4045c5(_0x4d40c8._0x4bb862)],_0x38b57d);}['_onLeftUpHandler'](_0x25d724){const _0x3636a0={_0xdad6bd:0x674,_0x5d9ead:0xb61,_0x1cadbb:0x674,_0x14bf7e:0x6ae,_0x289dfc:0xc60,_0x4a42a5:0xbbb},_0xb5d712=_0x35a251;var _0x1afb3a;if(!this['_draggerIng'])return;this[_0xb5d712(_0x3636a0._0xdad6bd)]['show']=!![];const _0x5c9e3d=getPositionValue(this['_draggerIng'][_0xb5d712(_0x3636a0._0x5d9ead)],(_0x1afb3a=this['_map'])===null||_0x1afb3a===void 0x0?void 0x0:_0x1afb3a['clock']['currentTime']),_0x3c989f=this[_0xb5d712(_0x3636a0._0xdad6bd)]['index'];this['_draggerIng']['onDragEnd']&&this[_0xb5d712(_0x3636a0._0x1cadbb)][_0xb5d712(0x281)](this[_0xb5d712(_0x3636a0._0x1cadbb)],_0x5c9e3d),this['updateAttrForEditing'](),this['fire'](EventType[_0xb5d712(_0x3636a0._0x14bf7e)],{..._0x25d724,'index':_0x3c989f,'cartesian':_0x5c9e3d}),this[_0xb5d712(0x674)]=null,this['_map']['_setEditCursor'](![]),this['_hasChangeEnableInputs']&&(this['_map'][_0xb5d712(_0x3636a0._0x289dfc)][_0xb5d712(_0x3636a0._0x4a42a5)]['enableInputs']=!![],delete this['_hasChangeEnableInputs']);}[_0x35a251(0xb42)](_0x41093e){const _0x506589=_0x35a251;this['_map']['openSmallTooltip'](_0x41093e,this[_0x506589(0xd79)]['getLangText']('_无法删除不能少于最小点数')+'\x20'+this['_graphic'][_0x506589(0x920)]);}[_0x35a251(0xf01)](_0x3f0677){const _0x59cc06={_0x2ceb23:0xa84,_0x4f9d6a:0x87,_0x14c32a:0x44e,_0x437014:0xa3e,_0x4c55a7:0x392,_0x5731e1:0xed2,_0x4e2df7:0xd79},_0x579649=_0x35a251;let _0x24abc4;return _0x3f0677['dragger']?_0x24abc4=_0x3f0677['dragger']:(_0x24abc4=new PointPrimitive({'position':_0x3f0677[_0x579649(0xb61)]??Cesium__namespace['Cartesian3'][_0x579649(_0x59cc06._0x2ceb23)],'style':getEditPointStyle(_0x3f0677['type']),'hasEdit':![],'private':!![]}),_0x24abc4['parent']=this['_graphic'],this[_0x579649(_0x59cc06._0x4f9d6a)]['addGraphic'](_0x24abc4)),_0x24abc4['_draw_tooltip']=this['_map']['getLangText']('_拖动该点后')+'\x20'+(_0x3f0677['tooltip']||this[_0x579649(0xd79)][_0x579649(_0x59cc06._0x14c32a)]('_修改位置')),_0x24abc4['_isDragger']=!![],_0x24abc4[_0x579649(_0x59cc06._0x437014)]=!![],_0x24abc4['_pointType']=_0x3f0677['type']||PointType['Control'],_0x24abc4[_0x579649(0x481)]=_0x3f0677['onDragStart'],_0x24abc4['onDrag']=_0x3f0677['onDrag'],_0x24abc4['onDragEnd']=_0x3f0677['onDragEnd'],(_0x24abc4['_pointType']===PointType['Control']||_0x24abc4[_0x579649(_0x59cc06._0x4c55a7)]===PointType['MoveAll'])&&(this['_graphic']['options']['hasEditContextMenu']??!![])&&(_0x24abc4[_0x579649(_0x59cc06._0x5731e1)]+='
'+this[_0x579649(_0x59cc06._0x4e2df7)][_0x579649(_0x59cc06._0x14c32a)]('_更多功能请右击'),_0x24abc4['bindContextMenu'](this['getDraggerContextMenu'](_0x24abc4))),_0x24abc4;}['bindDraggers'](){}['destroyDraggers'](){const _0x3157b0={_0x39246a:0x1cf},_0xe3d823=_0x35a251;for(let _0x50d13e=0x0,_0x40a664=this['draggers']['length'];_0x50d13e<_0x40a664;_0x50d13e++){this['layer']['removeGraphic'](this[_0xe3d823(_0x3157b0._0x39246a)][_0x50d13e],!![]);}this['draggers']=[];}['updateDraggers'](){const _0x22334d={_0x2d46a8:0x1cf},_0x36fc05=_0x35a251;var _0x4783e1;if(!this['_enabled'])return this;const _0x5058a0=(_0x4783e1=this['_matrixMove'])===null||_0x4783e1===void 0x0?void 0x0:_0x4783e1['_dragger_index'];this['destroyDraggers'](),this['bindDraggers']();if(Cesium__namespace['defined'](_0x5058a0))for(let _0x2ab709=0x0,_0x43fdc8=this['draggers'][_0x36fc05(0xe1e)];_0x2ab709<_0x43fdc8;_0x2ab709++){const _0x4218cb=this[_0x36fc05(_0x22334d._0x2d46a8)][_0x2ab709];if(_0x4218cb['_pointType']!==PointType[_0x36fc05(0xbed)]&&_0x4218cb['_pointType']!==PointType['MoveAll'])continue;if(_0x4218cb['index']===_0x5058a0){this['startMoveMatrix'](_0x4218cb);break;}}}['updateAttrForEditing'](){const _0xf491a3={_0x36e21f:0x149},_0x2faeb9=_0x35a251;this[_0x2faeb9(0x163)][_0x2faeb9(0x149)]&&this['_graphic'][_0x2faeb9(_0xf491a3._0x36e21f)](!![]),this['_graphic'][_0x2faeb9(0xdc9)]&&this[_0x2faeb9(0x163)]['_updateLabelPosition']();}['getDraggerContextMenu'](_0x12ac77){const _0x3f59c1={_0x421bfa:0xdb3},_0x530c56={_0x37983d:0x32d},_0x48e5ce={_0x167f77:0x87,_0x48ac80:0xbb6},_0x4b3f94={_0x106ba3:0x1d5,_0x47c19b:0x893},_0x5221ed={_0x5e487d:0x1bc,_0x41e829:0xe87},_0x343918=_0x35a251;return[{'text':this['_map']['getLangText']('_停止编辑'),'icon':Icon['DrawEditNo'],'show':_0x513e6e=>{var _0x4d197e;return(_0x4d197e=this['_graphic'])===null||_0x4d197e===void 0x0?void 0x0:_0x4d197e['isEditing'];},'callback':_0x2a2360=>{const _0x499543=_0x2767;this['_graphic'][_0x499543(0x338)]();}},{'text':this[_0x343918(0xd79)]['getLangText']('_删除该点'),'icon':Icon['Delete'],'show':_0x2da6da=>{const _0x3a3783=_0x343918;var _0x3ca1a1;if(!((_0x3ca1a1=this['_graphic'])!==null&&_0x3ca1a1!==void 0x0&&_0x3ca1a1[_0x3a3783(0x937)])||_0x12ac77['_pointType']===PointType['MoveAll'])return![];if(this['_graphic']['_positions_draw']['length']-0x1{const _0x3259f5=_0x343918,_0x3fbaae=_0x43773c['graphic'];if(_0x3fbaae){const _0x3c3e32=_0x3fbaae[_0x3259f5(_0x5221ed._0x5e487d)];_0x3c3e32>=0x0&&_0x3c3e32{const _0xa29591=_0x343918;return!this[_0xa29591(_0x4b3f94._0x106ba3)]||this['_matrixMove'][_0xa29591(_0x4b3f94._0x47c19b)]!==_0x12ac77['index'];},'callback':_0x4f9821=>{const _0xc5d936=_0x343918;var _0x256b0a;const _0x302c3c=(_0x256b0a=_0x4f9821['graphic'])!==null&&_0x256b0a!==void 0x0&&_0x256b0a['position']?_0x4f9821['graphic']:_0x4f9821[_0xc5d936(_0x48e5ce._0x167f77)];this[_0xc5d936(_0x48e5ce._0x48ac80)](_0x302c3c,_0x4f9821);}},{'text':this['_map']['getLangText']('_停止按轴平移'),'icon':Icon[_0x343918(0xe52)],'show':_0x3035bd=>{return this['_matrixMove']&&this['_matrixMove']['_dragger_index']===_0x12ac77['index'];},'callback':_0x52749c=>{const _0x9a25aa=_0x343918;this[_0x9a25aa(_0x530c56._0x37983d)]();}}];}[_0x35a251(0x6a1)](_0x4f5bcc){const _0x4ac6d5={_0x683abb:0x648},_0x305739=_0x35a251;Cesium__namespace[_0x305739(0xaa2)](_0x4f5bcc['clampToGround'])&&(this['stopMoveMatrix'](),this[_0x305739(_0x4ac6d5._0x683abb)](),this['updateDraggers']());}[_0x35a251(0x40a)](_0x4b3457,_0x2970e5){const _0x1d589e=_0x35a251;this['fire'](EventType['editAddPoint'],{'index':_0x4b3457[_0x1d589e(0x1bc)],'cartesian':_0x2970e5});}['startMoveMatrix'](_0x9d4ad1,_0x5deac1={}){const _0x380a6e={_0x119a47:0x60a,_0x18cd0d:0x1d5,_0x2df171:0x1bc,_0x43864e:0x1d5,_0x569d4e:0xb2f},_0x4ace5c={_0x2249a5:0x1d5,_0x3053ba:0xed8,_0x290e05:0x626,_0x1c34c5:0xd46},_0x152592={_0x23bb7e:0x1d5},_0x4670b9=_0x35a251;this[_0x4670b9(0x32d)](),this[_0x4670b9(0x648)]();!_0x9d4ad1&&(_0x9d4ad1=this['_graphic']);let _0x59b538=_0x9d4ad1[_0x4670b9(0x95f)]||_0x9d4ad1['position'];this['clampToGround']&&(_0x59b538=getSurfacePosition(this['_map']['scene'],_0x59b538)),this['_matrixMove']=new MatrixMove({'position':_0x59b538}),this['_map'][_0x4670b9(_0x380a6e._0x119a47)](this['_matrixMove']),this[_0x4670b9(_0x380a6e._0x18cd0d)]['_graphicLayer']['bindContextMenu']([{'text':this['_map']['getLangText']('_停止按轴平移'),'icon':Icon[_0x4670b9(0xe52)],'show':_0x41b3a7=>{return this['_matrixMove'];},'callback':_0xa62bfa=>{this['stopMoveMatrix']();}}]),this['clampToGround']&&this[_0x4670b9(0x1d5)]['_graphic_move_z']&&(this['_matrixMove'][_0x4670b9(0xee6)]['show']=![]),this['_matrixMove']['_dragger_index']=_0x9d4ad1[_0x4670b9(_0x380a6e._0x2df171)],this['_matrixMove']['on'](EventType['start'],_0xd90e80=>{const _0x203333=_0x4670b9;_0x9d4ad1['onDragStart']&&_0x9d4ad1['onDragStart'](_0x9d4ad1,this[_0x203333(_0x152592._0x23bb7e)]['position']);}),this[_0x4670b9(_0x380a6e._0x43864e)]['on'](EventType['stop'],_0x2cbbd3=>{const _0x128998=_0x4670b9;_0x9d4ad1['onDragEnd']?_0x9d4ad1['onDragEnd'](_0x9d4ad1,this['_matrixMove']['position'],_0x2cbbd3):_0x9d4ad1['position']=this['_matrixMove']['position'],_0x9d4ad1['fire'](EventType['updatePosition'],{'position':this['_matrixMove']['position']}),this[_0x128998(0x264)](EventType['editMovePoint'],{..._0x5deac1,..._0x2cbbd3,'index':_0x9d4ad1[_0x128998(0x1bc)],'cartesian':_0x59b538});}),this[_0x4670b9(_0x380a6e._0x18cd0d)]['on'](EventType['change'],_0x1c4803=>{const _0x1c1133=_0x4670b9;var _0x2488a2;const _0x56312d=this[_0x1c1133(_0x4ace5c._0x2249a5)]['position'];if(_0x9d4ad1['isPrivate'])_0x9d4ad1['position']=_0x56312d;else Cesium__namespace['defined']((_0x2488a2=this['_graphic'])===null||_0x2488a2===void 0x0?void 0x0:_0x2488a2['_position_draw'])?this['_graphic']['_position_draw']=_0x56312d:_0x9d4ad1['position']=_0x56312d;if(_0x1c4803[_0x1c1133(_0x4ace5c._0x3053ba)]===Cesium__namespace['Axis']['Z']&&this['_updateHeight']){const _0x8787d4=Cesium__namespace['Cartographic'][_0x1c1133(0x9b1)](_0x56312d)['height'];this[_0x1c1133(_0x4ace5c._0x290e05)](_0x8787d4);}else _0x9d4ad1['onDrag']&&_0x9d4ad1[_0x1c1133(_0x4ace5c._0x1c34c5)](_0x9d4ad1,_0x56312d);this['updateAttrForEditing'](),this['fire'](EventType['editMouseMove'],{..._0x5deac1,..._0x1c4803,'index':_0x9d4ad1['index'],'cartesian':_0x56312d});}),_0x9d4ad1['off'](EventType[_0x4670b9(0xb2f)],this['_updateMatrixMovePosition'],this),_0x9d4ad1['off'](EventType[_0x4670b9(_0x380a6e._0x569d4e)],this[_0x4670b9(0x4aa)],this),_0x9d4ad1['on'](EventType['updatePosition'],this[_0x4670b9(0x1a5)],this);}['_updateMatrixMovePosition'](_0x36ac79){const _0x580f17={_0x2c85ac:0x1d5,_0x5258cf:0x1d5,_0x3a8834:0xb61,_0x17b241:0x893,_0x4a3e61:0x1bc,_0xeab8bb:0x1d5},_0x5bfb3f=_0x35a251;var _0x307dd6;if(!this[_0x5bfb3f(_0x580f17._0x2c85ac)]||this[_0x5bfb3f(_0x580f17._0x5258cf)]['isMoveing']||!_0x36ac79[_0x5bfb3f(_0x580f17._0x3a8834)]||this['_matrixMove'][_0x5bfb3f(_0x580f17._0x17b241)]!==((_0x307dd6=_0x36ac79['graphic'])===null||_0x307dd6===void 0x0?void 0x0:_0x307dd6[_0x5bfb3f(_0x580f17._0x4a3e61)]))return;this[_0x5bfb3f(_0x580f17._0xeab8bb)]['position']=_0x36ac79['position'];}['stopMoveMatrix'](){const _0x5054d7={_0x430d56:0x1d5},_0x535667=_0x35a251;this['_matrixMove']&&(this['_map'][_0x535667(0x828)](this[_0x535667(_0x5054d7._0x430d56)],!![]),delete this[_0x535667(_0x5054d7._0x430d56)]);}['startRotateMatrix'](_0x5bd6ea){const _0x2b80b8={_0x43f2b6:0x41f,_0x5d72c0:0xd79,_0x23a2e1:0xc16,_0xd59fe4:0xb2f},_0x4f875c={_0x3fcaeb:0x527},_0x1bc0f4={_0x3ba89e:0x648},_0x476c02=_0x35a251;this[_0x476c02(0x32d)](),this['stopRotateMatrix'](),!_0x5bd6ea&&(_0x5bd6ea=this['_graphic']),this['_matrixRotate']=new MatrixRotate({'position':_0x5bd6ea['positionShow']||_0x5bd6ea['position'],'heading':this['style'][_0x476c02(_0x2b80b8._0x43f2b6)]||0x0,'pitch':this['style']['pitch']||0x0,'roll':this['style']['roll']||0x0}),this[_0x476c02(_0x2b80b8._0x5d72c0)]['addThing'](this['_matrixRotate']),this['_matrixRotate']['_graphicLayer']['bindContextMenu']([{'text':this['_map']['getLangText'](_0x476c02(_0x2b80b8._0x23a2e1)),'icon':Icon['BloomEffectNo'],'show':_0x46a1c1=>{return this['_matrixRotate'];},'callback':_0x5130ba=>{const _0x431d9e=_0x476c02;this[_0x431d9e(_0x1bc0f4._0x3ba89e)]();}}]),this['_matrixRotate']['on'](EventType['change'],_0x2c5ffb=>{const _0x1199f5=_0x476c02;this['style']['heading']=formatNum$1(_0x2c5ffb['heading'],0x2),this[_0x1199f5(0xfc8)][_0x1199f5(_0x4f875c._0x3fcaeb)]=formatNum$1(_0x2c5ffb['pitch'],0x2),this['style']['roll']=formatNum$1(_0x2c5ffb['roll'],0x2),this[_0x1199f5(0x163)]['updateOrientation'](),this['fire'](EventType['editStyle']);}),_0x5bd6ea['off'](EventType['updatePosition'],this['_updateMatrixMovePosition'],this),_0x5bd6ea['off'](EventType[_0x476c02(0xb2f)],this['_updateMatrixRotatePosition'],this),_0x5bd6ea['on'](EventType[_0x476c02(_0x2b80b8._0xd59fe4)],this['_updateMatrixRotatePosition'],this);}['_updateMatrixRotatePosition'](_0x3e177e){const _0x1ba519=_0x35a251;var _0x28ea2d;if(!this['_matrixRotate']||this[_0x1ba519(0xab7)]['isMoveing']||!_0x3e177e['position']||this['_matrixRotate']['_dragger_index']!==((_0x28ea2d=_0x3e177e['graphic'])===null||_0x28ea2d===void 0x0?void 0x0:_0x28ea2d[_0x1ba519(0x1bc)]))return;this['_matrixRotate']['position']=_0x3e177e[_0x1ba519(0xb61)];}['stopRotateMatrix'](){const _0x24000e=_0x35a251;this[_0x24000e(0xab7)]&&(this['_map']['removeThing'](this['_matrixRotate'],!![]),delete this['_matrixRotate']);}['destroy'](){this['disable']();for(const _0x13a5d8 in this){delete this[_0x13a5d8];}}}class EditPoint extends EditBase{[_0x35a251(0x53e)](){const _0x141c1c={_0x861f52:0x163};this['createDragger']({'dragger':this['_graphic'],'onDrag':(_0x540efe,_0x4787d2)=>{const _0x282afe=_0x2767;this[_0x282afe(_0x141c1c._0x861f52)]['_position_draw']=_0x4787d2;}});}[_0x35a251(0x7c7)](){const _0x4fdc70={_0x3fb8a5:0x163},_0x553ac7=_0x35a251;delete this[_0x553ac7(_0x4fdc70._0x3fb8a5)]['_draw_tooltip'],delete this['_graphic']['_isDragger'],delete this[_0x553ac7(0x163)]['_noMousePick'],delete this['_graphic']['_pointType'],delete this['_graphic'][_0x553ac7(0xd46)],this['_graphic']['unbindContextMenu']();}}class BasePointEntity extends BaseEntity{constructor(_0x1f16fa={}){const _0x528a9e={_0x2a35b9:0xa68,_0x24837d:0x8e1,_0x503eaa:0xb61},_0x154101=_0x35a251;_0x1f16fa[_0x154101(0xa68)]=_0x1f16fa[_0x154101(_0x528a9e._0x2a35b9)]??!![],super(_0x1f16fa),this['_minPointNum']=_0x1f16fa[_0x154101(_0x528a9e._0x24837d)]??0x1,this[_0x154101(0x657)]=_0x1f16fa['maxPointNum']??0x1,this['_hasEdit']=this['options'][_0x154101(0xb70)]??!![],_0x1f16fa[_0x154101(0xb35)]&&(this['positions']=_0x1f16fa['positions']),_0x1f16fa[_0x154101(0xb61)]&&(this['position']=_0x1f16fa[_0x154101(_0x528a9e._0x503eaa)]);}get['EditClass'](){return EditPoint;}get[_0x35a251(0xb61)](){return this['_position'];}set['position'](_0x267c25){const _0x58bf16={_0x2a8515:0xfa7,_0x4b21e7:0xaa2,_0x472c85:0x5d2,_0x2b3e57:0xedd},_0x515bcc=_0x35a251;var _0x1178b8,_0x5dca62;this[_0x515bcc(0xf44)]=LngLatPoint['parse'](_0x267c25);if(this['_point']&&!(this['_point']['lat']===0x0&&this['_point'][_0x515bcc(_0x58bf16._0x2a8515)]===0x0)){let _0x4ab212=this['style']['setHeight'];Cesium__namespace[_0x515bcc(_0x58bf16._0x4b21e7)](_0x4ab212)&&(isString(_0x4ab212)&&(_0x4ab212=Number(template(_0x4ab212,this['attr'],!![])),isNaN(_0x4ab212)&&(_0x4ab212=0x0)),this[_0x515bcc(0xf44)]['alt']=_0x4ab212);const _0x48c23c=this['getAddHeight']();_0x48c23c!==0x0&&(this['_point'][_0x515bcc(_0x58bf16._0x472c85)]=this[_0x515bcc(0xf44)]['alt']+_0x48c23c);}const _0x1c995f=(_0x1178b8=this[_0x515bcc(0xf44)])===null||_0x1178b8===void 0x0?void 0x0:_0x1178b8[_0x515bcc(0xa43)]();if((_0x5dca62=this[_0x515bcc(0xa50)])!==null&&_0x5dca62!==void 0x0&&_0x5dca62[_0x515bcc(0x2a6)]&&_0x1c995f instanceof Cesium__namespace['Cartesian3']){var _0x9ef1a2;this['_position_draw']=_0x1c995f,_0x1c995f&&((_0x9ef1a2=this['_positions_draw'])===null||_0x9ef1a2===void 0x0?void 0x0:_0x9ef1a2['length'])>0x0&&(this[_0x515bcc(0x937)][0x0]=_0x1c995f);}else this['_isCallbackPositions']&&_0x1c995f instanceof Cesium__namespace['Cartesian3']&&this['_cancelPositionsCallback'](),this['_position']=_0x1c995f;this[_0x515bcc(0x249)]&&this[_0x515bcc(_0x58bf16._0x2b3e57)](),this['fire'](EventType['updatePosition'],{'position':this['_position']});}get['positionShow'](){const _0x37efcb={_0x29e813:0xb61},_0x1e7359=_0x35a251;var _0x4e828e;return getPositionValue(this[_0x1e7359(_0x37efcb._0x29e813)],(_0x4e828e=this['_map'])===null||_0x4e828e===void 0x0?void 0x0:_0x4e828e['clock']['currentTime']);}get['point'](){const _0x420a4b={_0x49beee:0x95f,_0xe6b81e:0xf44},_0x1fb82f=_0x35a251;return!(this['_position']instanceof Cesium__namespace[_0x1fb82f(0x8eb)])&&(this[_0x1fb82f(0xf44)]=LngLatPoint['parse'](this[_0x1fb82f(_0x420a4b._0x49beee)])),this[_0x1fb82f(_0x420a4b._0xe6b81e)];}get[_0x35a251(0x242)](){return this['getCoordinate']();}get['center'](){const _0x326cbc={_0x545788:0x42d},_0x361af0=_0x35a251;var _0x508544;return getPositionValue(this['positionShow'],(_0x508544=this[_0x361af0(0xd79)])===null||_0x508544===void 0x0?void 0x0:_0x508544[_0x361af0(_0x326cbc._0x545788)]['currentTime']);}get['centerPoint'](){const _0x19156b=_0x35a251;return this[_0x19156b(0x1ba)];}get[_0x35a251(0xb35)](){return this['position']?[this['position']]:[];}set['positions'](_0x4217e9){const _0x49a013={_0x375a22:0xb61},_0x1af69a=_0x35a251;_0x4217e9&&_0x4217e9['length']>0x0&&(this[_0x1af69a(_0x49a013._0x375a22)]=_0x4217e9[0x0]);}get[_0x35a251(0x34a)](){return this['point']?[this['point']]:[];}get['coordinates'](){const _0x42faa0={_0x5b0ba6:0x242},_0x85ea38=_0x35a251;return this[_0x85ea38(_0x42faa0._0x5b0ba6)]?[this[_0x85ea38(0x242)]]:[];}get['positionsShow'](){return this['positionShow']?[this['positionShow']]:[];}get['orientation'](){return this['getOrientation']();}set[_0x35a251(0x8fd)](_0x3db9e7){const _0x3b2301={_0x44a9b4:0x8e5},_0x2a7475=_0x35a251;this[_0x2a7475(0x857)]=_0x3db9e7,this[_0x2a7475(_0x3b2301._0x44a9b4)]();}get['heading'](){return this['style']['heading']??0x0;}set[_0x35a251(0x41f)](_0x5370c2){const _0x42568d={_0x4000b1:0x8e5},_0x46020e=_0x35a251;this['style']['heading']=_0x5370c2,this[_0x46020e(_0x42568d._0x4000b1)]();}get['pitch'](){return this['style']['pitch']??0x0;}set['pitch'](_0x375f9d){const _0x4132b9={_0x3f220a:0xfc8},_0x5a6d23=_0x35a251;this[_0x5a6d23(_0x4132b9._0x3f220a)]['pitch']=_0x375f9d,this['updateOrientation']();}get['roll'](){const _0x392a99={_0xaeef82:0xfc8,_0x5bf959:0xba7},_0x1f2d59=_0x35a251;return this[_0x1f2d59(_0x392a99._0xaeef82)][_0x1f2d59(_0x392a99._0x5bf959)]??0x0;}set[_0x35a251(0xba7)](_0x560e26){const _0x4fbceb=_0x35a251;this[_0x4fbceb(0xfc8)]['roll']=_0x560e26,this['updateOrientation']();}get['height'](){const _0x334821=_0x35a251;var _0x589d02;return(_0x589d02=this['point'])===null||_0x589d02===void 0x0?void 0x0:_0x589d02[_0x334821(0x5d2)];}set['height'](_0x488197){this['point']['alt']=_0x488197,this['position']=this['point'];}get[_0x35a251(0x8a0)](){const _0xbae068={_0x366432:0x42d},_0x11f84d=_0x35a251;if(this['_entity']){var _0x580f62,_0x4c3fd4;return this['_entity'][_0x11f84d(0x3dd)]((_0x580f62=this[_0x11f84d(0xd79)])===null||_0x580f62===void 0x0?void 0x0:(_0x4c3fd4=_0x580f62[_0x11f84d(_0xbae068._0x366432)])===null||_0x4c3fd4===void 0x0?void 0x0:_0x4c3fd4['currentTime'],new Cesium__namespace['Matrix4']());}else return undefined;}get[_0x35a251(0x4dc)](){return this['_debugAxis'];}set[_0x35a251(0x4dc)](_0x23a980){const _0xa4b37={_0x380267:0xd4a,_0x783d85:0x3c5,_0x5ce78b:0xe86,_0xfff0ec:0x442},_0x9e5e40=_0x35a251;this[_0x9e5e40(_0xa4b37._0x380267)]=_0x23a980;if(!this['debugAxisPrimitive']){const _0x43ed7b=Math['max'](Cesium__namespace['Cartographic']['fromCartesian'](this['positionShow'])['height']*0.06,0x64);this['debugAxisPrimitive']=this['_layer'][_0x9e5e40(0x293)]['add'](new Cesium__namespace['DebugModelMatrixPrimitive']({'modelMatrix':this['modelMatrix'],'length':_0x43ed7b,'width':0x5})),this['debugAxisPrimitive'][_0x9e5e40(0x8f2)]={'content':_0x9e5e40(_0xa4b37._0x783d85),'options':this[_0x9e5e40(_0xa4b37._0x5ce78b)]['tooltipOptions']},(this[_0x9e5e40(0xb61)]instanceof Cesium__namespace['CallbackProperty']||this[_0x9e5e40(0xb61)]instanceof Cesium__namespace['SampledPositionProperty'])&&(this['debugAxisPrimitive']['_timeTik']=setInterval(()=>{const _0xb2dfe=_0x9e5e40;this['debugAxisPrimitive'][_0xb2dfe(0x8a0)]=this['modelMatrix'];},0x12c)),this[_0x9e5e40(0x534)](this['debugAxisPrimitive']);}this[_0x9e5e40(_0xa4b37._0xfff0ec)]['show']=_0x23a980;}get[_0x35a251(0x946)](){const _0x3daa82=_0x35a251;return this[_0x3daa82(0x442)]?this['debugAxisPrimitive']['length']:0x0;}set['debugAxisLength'](_0x1d95ae){const _0xfa9a53=_0x35a251;!this['debugAxisPrimitive']&&(this[_0xfa9a53(0x4dc)]=!![]),this['debugAxisPrimitive']['length']=_0x1d95ae;}get['objectsToExclude'](){const _0x2d8229=_0x35a251;if(this['options']['objectsToExclude'])return this['options'][_0x2d8229(0x59a)];if(this['_objectsToExcludee'])return this['_objectsToExclude'];return undefined;}set[_0x35a251(0x59a)](_0x51c36f){this['_objectsToExclude']=_0x51c36f;}['_mountedHook'](){}['_removedHook'](){const _0x162e52={_0x10a033:0xa9a},_0x58212b=_0x35a251;super[_0x58212b(_0x162e52._0x10a033)](),this['debugAxisPrimitive']&&(clearInterval(this['debugAxisPrimitive']['_timeTik']),this['_layer']['primitiveCollection']['remove'](this['debugAxisPrimitive']),delete this['debugAxisPrimitive']);}['_updatePositionsHook'](){const _0x26f521={_0x1fb29c:0xdc9},_0x1ea862=_0x35a251;this['_entity']['position']=this['_position'],this['debugAxisPrimitive']&&(this['debugAxisPrimitive']['modelMatrix']=this['modelMatrix']),this['_updateEditDraggers'](),this[_0x1ea862(_0x26f521._0x1fb29c)]();}[_0x35a251(0x8e5)](){const _0x4a916d=_0x35a251;return this['_entity']['orientation']=this['getOrientation'](),this['debugAxisPrimitive']&&(this['debugAxisPrimitive']['modelMatrix']=this[_0x4a916d(0x8a0)]),this['_entity']['orientation'];}['getOrientation'](_0x2b406c){const _0x114793={_0x49587c:0x7c0,_0x43e4a1:0x7ba,_0x20a9a9:0x41f,_0x4467b2:0x7c0},_0x479d22={_0x5262a0:0xba7,_0x1fc026:0x41f,_0x1dea13:0xaa2,_0x458457:0x49c,_0x5c0ab5:0x22f},_0x6a26e=_0x35a251;_0x2b406c=_0x2b406c||this['style'];let _0x49d2e4=this['options']['orientation']||this['_orientation'];if(_0x49d2e4){const _0x628e1d=_0x2b406c[_0x6a26e(0xd0e)]||!Cesium__namespace['defined'](_0x2b406c[_0x6a26e(0x41f)])||!Cesium__namespace[_0x6a26e(0xaa2)](_0x2b406c['pitch'])||!Cesium__namespace['defined'](_0x2b406c['roll']);if(_0x49d2e4 instanceof Cesium__namespace['VelocityOrientationProperty']&&_0x628e1d){const _0x3de5d9=_0x49d2e4,_0x5948a7=Cesium__namespace['Math']['toRadians'](this[_0x6a26e(0x41f)]),_0x1378ba=Cesium__namespace[_0x6a26e(_0x114793._0x49587c)][_0x6a26e(_0x114793._0x43e4a1)](this['pitch']),_0x5114ee=Cesium__namespace[_0x6a26e(0x7c0)][_0x6a26e(0x7ba)](this['roll']);_0x49d2e4=new Cesium__namespace[(_0x6a26e(0x18a))](_0x2b6886=>{const _0x40a286=_0x6a26e;var _0x261332,_0x17a492;const _0x3b0b63=getPositionValue(this[_0x40a286(0xb61)],_0x2b6886),_0x48e3f3=_0x3de5d9['getValue'](_0x2b6886);if(!_0x3b0b63||!_0x48e3f3)return null;const _0x2e080c=getHeadingPitchRollByOrientation(_0x3b0b63,_0x48e3f3);return _0x2b406c['mergeOrientation']?(_0x2e080c['heading']+=_0x5948a7,_0x2e080c[_0x40a286(_0x479d22._0x5262a0)]+=_0x5114ee,_0x2e080c['pitch']+=_0x1378ba):(Cesium__namespace['defined'](_0x2b406c[_0x40a286(_0x479d22._0x1fc026)])&&(_0x2e080c['heading']=_0x5948a7),Cesium__namespace[_0x40a286(_0x479d22._0x1dea13)](_0x2b406c['roll'])&&(_0x2e080c['roll']=_0x5114ee),Cesium__namespace['defined'](_0x2b406c['pitch'])&&(_0x2e080c['pitch']=_0x1378ba)),Cesium__namespace[_0x40a286(_0x479d22._0x458457)]['headingPitchRollQuaternion'](_0x3b0b63,_0x2e080c,(_0x261332=this['_map'])===null||_0x261332===void 0x0?void 0x0:(_0x17a492=_0x261332['scene'])===null||_0x17a492===void 0x0?void 0x0:_0x17a492[_0x40a286(_0x479d22._0x5c0ab5)][_0x40a286(0x3f4)]);},![]);}return _0x49d2e4;}const _0x1e6687=this['positionShow'];if(_0x1e6687==null)return;const _0x2b37e9=Cesium__namespace['Math']['toRadians'](_0x2b406c[_0x6a26e(_0x114793._0x20a9a9)]??0x0),_0x372b27=Cesium__namespace['Math'][_0x6a26e(_0x114793._0x43e4a1)](_0x2b406c['pitch']??0x0),_0x3408b7=Cesium__namespace[_0x6a26e(_0x114793._0x4467b2)]['toRadians'](_0x2b406c['roll']??0x0),_0x433f67=new Cesium__namespace['HeadingPitchRoll'](_0x2b37e9,_0x372b27,_0x3408b7);return Cesium__namespace[_0x6a26e(0x49c)]['headingPitchRollQuaternion'](_0x1e6687,_0x433f67);}[_0x35a251(0xe41)](_0x3279db){return{'type':'Point','coordinates':this['getCoordinate'](_0x3279db===null||_0x3279db===void 0x0?void 0x0:_0x3279db['noAlt'])};}['clearDynamicPosition'](){return this['_orientation']=undefined,this['property']=null,this['position']=undefined,this;}['_initSampledPositionProperty'](){const _0x351b27={_0x1cbaec:0x5df,_0x571293:0xc6b,_0x249a37:0xe26,_0x4f6e40:0x3e7},_0x4eb2a5={_0x1223c6:0xd79,_0x20dceb:0xdb0,_0x205d1b:0x9b1},_0x3e3838=_0x35a251;this[_0x3e3838(_0x351b27._0x1cbaec)]=-0x1,this['_frameRateHeight']=this['options']['frameRateHeight']??0x1e,this['_maxCacheCount']=this['options']['maxCacheCount']??0x32;const _0x417ceb=new Cesium__namespace['SampledPositionProperty'](this['options'][_0x3e3838(_0x351b27._0x571293)],this['options']['numberOfDerivatives']);_0x417ceb['forwardExtrapolationType']=this['options'][_0x3e3838(_0x351b27._0x249a37)]??Cesium__namespace['ExtrapolationType']['HOLD'],_0x417ceb['backwardExtrapolationType']=this['options'][_0x3e3838(0x982)]??Cesium__namespace['ExtrapolationType']['HOLD'],!this[_0x3e3838(0x857)]&&(this[_0x3e3838(0x857)]=new Cesium__namespace['VelocityOrientationProperty'](_0x417ceb),this['_entity']&&(this[_0x3e3838(0x249)]['orientation']=this[_0x3e3838(_0x351b27._0x4f6e40)]())),this['property']=_0x417ceb,this['position']=new Cesium__namespace['CallbackProperty'](_0x4b718f=>{const _0x43046f=_0x3e3838;if(!this[_0x43046f(_0x4eb2a5._0x1223c6)])return undefined;let _0x49e4d1=_0x417ceb['getValue'](_0x4b718f);if(!_0x49e4d1)return!this['_last_isFireStop']&&this['_stopTime']&&Cesium__namespace['JulianDate'][_0x43046f(0x401)](_0x4b718f,this['_stopTime'])&&(this['fire'](EventType['stop']),this['_last_isFireStop']=!![]),this['_last_position'];if(_0x49e4d1&&this['options'][_0x43046f(_0x4eb2a5._0x20dceb)]){this['_clampToTilesetFrame']++;if(!this['_clampToTilesetHeight']||this['_clampToTilesetFrame']%this['_frameRateHeight']===0x0){const _0x448c57=getHeight(this['_map'][_0x43046f(0xc60)],_0x49e4d1,{'objectsToExclude':this['_layer']['objectsToExclude'],'has3dtiles':!![]});_0x448c57&&(this['_clampToTilesetHeight']=_0x448c57);}if(this['_clampToTilesetHeight']){const _0x1b6f9a=Cesium__namespace['Cartographic'][_0x43046f(_0x4eb2a5._0x205d1b)](_0x49e4d1);_0x49e4d1=Cesium__namespace['Cartesian3'][_0x43046f(0x175)](_0x1b6f9a['longitude'],_0x1b6f9a[_0x43046f(0x580)],this['_clampToTilesetHeight']+this['getAddHeight']());}}return this[_0x43046f(0xbf3)]&&(this[_0x43046f(0xbf3)]['position']=_0x49e4d1),this['_last_position']=_0x49e4d1,this[_0x43046f(0x5da)]=![],_0x49e4d1;},![]);}['addDynamicPosition'](_0x476ee4,_0x2398ff){const _0x191d9d={_0x34167a:0xc31,_0x5e7c98:0x7e5,_0x277129:0xb4f,_0x43b83d:0xea1,_0x27bffe:0xa43,_0x276b3d:0x651},_0x3ac958=_0x35a251;var _0x1feb49,_0x2af9cf,_0x1f1fed,_0x3b733a;!this['property']&&this['_initSampledPositionProperty']();this[_0x3ac958(_0x191d9d._0x34167a)]();const _0x15d0c4=((_0x1feb49=this['_map'])===null||_0x1feb49===void 0x0?void 0x0:(_0x2af9cf=_0x1feb49['clock'])===null||_0x2af9cf===void 0x0?void 0x0:_0x2af9cf['currentTime'])||Cesium__namespace['JulianDate'][_0x3ac958(0x23b)]();if(!_0x2398ff)_0x2398ff=_0x15d0c4;else{if(isNumber(_0x2398ff))_0x2398ff=Cesium__namespace['JulianDate'][_0x3ac958(_0x191d9d._0x5e7c98)](_0x15d0c4,_0x2398ff,new Cesium__namespace['JulianDate']());else{if(isString(_0x2398ff))_0x2398ff['indexOf']('Z')===-0x1?_0x2398ff=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x2398ff)):_0x2398ff=Cesium__namespace[_0x3ac958(0x579)]['fromIso8601'](_0x2398ff);else _0x2398ff instanceof Date&&(_0x2398ff=Cesium__namespace['JulianDate'][_0x3ac958(0xa51)](_0x2398ff));}}_0x476ee4=LngLatPoint['parse'](_0x476ee4);const _0x6ef55d=(_0x1f1fed=this['_sampledPositionProperty'])===null||_0x1f1fed===void 0x0?void 0x0:(_0x3b733a=_0x1f1fed[_0x3ac958(_0x191d9d._0x277129)])===null||_0x3b733a===void 0x0?void 0x0:_0x3b733a['_times'];if(this['options']['autoMiddleDynamicPosition']&&(_0x6ef55d===null||_0x6ef55d===void 0x0?void 0x0:_0x6ef55d['length'])>0x0&&this[_0x3ac958(0xdb7)]){const _0xa20e85=_0x6ef55d[_0x6ef55d['length']-0x1];if(Cesium__namespace['JulianDate']['secondsDifference'](_0x15d0c4,_0xa20e85)>0.3){let _0x4e3c97=this['_position'];if(this['_lastDynamicPosition']){const _0x176f72=0.01;_0x4e3c97=getOnLinePointByLen(this[_0x3ac958(_0x191d9d._0x43b83d)],this['_position'],_0x176f72,!![]);}_0x4e3c97=setPositionsHeight(_0x4e3c97,_0x476ee4['alt']||0x0),this[_0x3ac958(0x717)]['addSample'](_0x15d0c4,_0x4e3c97);}}const _0x3b413a=_0x476ee4[_0x3ac958(_0x191d9d._0x27bffe)]();return this['property'][_0x3ac958(_0x191d9d._0x276b3d)](_0x2398ff,_0x3b413a),this['_lastDynamicPosition']=_0x3b413a,this[_0x3ac958(0x798)]=_0x2398ff,this;}['_removeDynamicPosition'](){const _0x30051a={_0x51ee6a:0x827,_0x34272c:0xb86},_0x1afde9=_0x35a251;var _0x569e13,_0x53fee1;if(this[_0x1afde9(_0x30051a._0x51ee6a)]<0x1)return;const _0x1e8d28=(_0x569e13=this[_0x1afde9(_0x30051a._0x34272c)])===null||_0x569e13===void 0x0?void 0x0:(_0x53fee1=_0x569e13[_0x1afde9(0xb4f)])===null||_0x53fee1===void 0x0?void 0x0:_0x53fee1['_times'];if(!_0x1e8d28||(_0x1e8d28===null||_0x1e8d28===void 0x0?void 0x0:_0x1e8d28['length'])===0x0)return;const _0x501f83=_0x1e8d28['length']-this['_maxCacheCount']-0x1;_0x501f83>0x0&&this['property']['removeSamples'](new Cesium__namespace['TimeInterval']({'start':_0x1e8d28[0x0],'stop':_0x1e8d28[_0x501f83]}));}['_getPopupPosition'](){const _0x20e319=_0x35a251;return this['property']||this['position']||this[_0x20e319(0x176)];}[_0x35a251(0x63c)](_0x4a7ead={}){const _0x3c9bf9={_0x4728f8:0x86c},_0x543d09={_0x3c665e:0xb61},_0x5b6af6=_0x35a251;return getSurfaceHeight(this['_map']['scene'],this['position'],{'objectsToExclude':this['_layer']['objectsToExclude'],..._0x4a7ead})[_0x5b6af6(_0x3c9bf9._0x4728f8)](_0x13afc6=>{const _0x204113=_0x5b6af6;_0x13afc6['position']&&(this[_0x204113(_0x543d09._0x3c665e)]=_0x13afc6[_0x204113(_0x543d09._0x3c665e)]);});}[_0x35a251(0x979)](_0x429bc2){return this['autoSurfaceHeight'](_0x429bc2);}[_0x35a251(0x81f)](_0x3d420b){const _0x1a8d20={_0x3b346b:0x769},_0x31720b=_0x35a251;return this[_0x31720b(0x1ba)]?this['point'][_0x31720b(_0x1a8d20._0x3b346b)](_0x3d420b):[];}['setCallbackPosition'](_0x31ef9e){const _0x511e87={_0x378ff5:0x1d0},_0x497ea0=_0x35a251;return this['_setPositionsToCallback'](),_0x31ef9e&&(this['_position_draw']=LngLatPoint['toCartesian'](_0x31ef9e)),this[_0x497ea0(_0x511e87._0x378ff5)];}['_setPositionsToCallback'](){const _0x40e70f={_0x10f60a:0x18a},_0x18a956=_0x35a251;if(this[_0x18a956(0x894)])return;this['_isCallbackPositions']=!![],this[_0x18a956(0x987)]=this['options']['drawShow'],this['_position_draw']=this[_0x18a956(0x95f)],this['position']=new Cesium__namespace[(_0x18a956(_0x40e70f._0x10f60a))](_0x2b3e11=>{return this['_position_draw'];},![]),this['updateAttrForDrawing']&&this['updateAttrForDrawing'](!![]),this['_updateOutlineToCallback'](),this['_updateLabelPosition']();}[_0x35a251(0x736)](){const _0x7de015={_0x49f964:0x894},_0x71c3cc=_0x35a251;if(!this[_0x71c3cc(_0x7de015._0x49f964)])return;this['_isCallbackPositions']=![],this['_position']=this['_position_draw'],this['_point']=LngLatPoint['fromCartesian'](this['_position']),delete this[_0x71c3cc(0x1d0)],this[_0x71c3cc(0x249)]['position']=this['_position'];}['_startDrawHook'](){const _0x4c8510={_0x3bbc56:0xe4c},_0x52c04c=_0x35a251;this[_0x52c04c(0xd79)]['on'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['on'](EventType[_0x52c04c(0xfb4)],this[_0x52c04c(_0x4c8510._0x3bbc56)],this);}[_0x35a251(0x433)](){this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['off'](EventType['click'],this['_onClickHandler_point'],this),this['show']=!![];}['_onMouseMoveHandler_point'](_0x44057a){const _0x38ea96={_0x25f9da:0x4bb,_0x593101:0x264},_0x5e3512=_0x35a251,_0x8ee401=_0x44057a[_0x5e3512(_0x38ea96._0x25f9da)];_0x8ee401&&(this[_0x5e3512(0x1d0)]=_0x8ee401,this['lastPointTemporary']=!![]),this['_map'][_0x5e3512(0x771)](_0x44057a['endPosition'],this['_draw_tooltip']||this['_map'][_0x5e3512(0x44e)]('_单击完成绘制')),this[_0x5e3512(_0x38ea96._0x593101)](EventType['drawMouseMove'],{..._0x44057a,'drawtype':this['type'],'graphic':this},!![]);}['_onClickHandler_point'](_0x1d7b55){const _0x244e8f=_0x1d7b55['cartesian'];_0x244e8f&&(this['_position_draw']=_0x244e8f),this['_position_draw']&&(this['lastPointTemporary']=![],this['stopDraw']());}}class EditPoly extends EditBase{get['hasClosure'](){return this['style']['closure'];}get[_0x35a251(0x710)](){const _0x4de99a={_0x280f26:0x163},_0x35b4c9=_0x35a251;return this['positions']['length']{const _0x22206b=_0x3e5154;var _0x2a720f;_0x4baa1b=this['updatePositionsHeightByAttr'](_0x4baa1b),_0x46486b['position']=_0x4baa1b,this['positions'][_0x46486b['index']]=_0x4baa1b;if(((_0x2a720f=this['_heightDraggers'])===null||_0x2a720f===void 0x0?void 0x0:_0x2a720f['length'])>0x0)return;if(this['hasMidPoint']){let _0xfb34f9,_0x33424a,_0xd374d6;if(this['hasClosure']||!this['hasClosure']&&_0x46486b['index']!==0x0){_0x46486b['index']===0x0?(_0xfb34f9=_0x153c8a*0x2-0x1,_0x33424a=_0x153c8a-0x1):(_0xfb34f9=_0x46486b['index']*0x2-0x1,_0x33424a=_0x46486b['index']-0x1);const _0x5c1781=_0x1e1c16[_0x33424a];_0xd374d6=getMidpoint(_0x4baa1b,_0x5c1781),_0xd374d6=this['updatePositionsHeightByAttr'](_0xd374d6),this['draggers'][_0xfb34f9]['position']=_0xd374d6;}(this['hasClosure']||!this['hasClosure']&&_0x46486b[_0x22206b(0x1bc)]!==_0x153c8a-0x1)&&(_0x46486b['index']===_0x153c8a-0x1?(_0xfb34f9=_0x46486b['index']*0x2+0x1,_0x33424a=0x0):(_0xfb34f9=_0x46486b['index']*0x2+0x1,_0x33424a=_0x46486b['index']+0x1),_0xd374d6=getMidpoint(_0x4baa1b,_0x1e1c16[_0x33424a]),_0xd374d6=this['updatePositionsHeightByAttr'](_0xd374d6),this['draggers'][_0xfb34f9]['position']=_0xd374d6);}if(this[_0x22206b(_0x3c8566._0x340ee9)]){let _0x3254ee=centerOfMass(_0x1e1c16);_0x3254ee=this[_0x22206b(_0x3c8566._0x1efac0)](_0x3254ee),this['_draggerMove']['position']=_0x3254ee;}},'onDragStart':(_0x25247f,_0x3b55d8)=>{const _0x4302fc=_0x3e5154;var _0xa18ed9;if(((_0xa18ed9=this[_0x4302fc(0xdd0)])===null||_0xa18ed9===void 0x0?void 0x0:_0xa18ed9['length'])>0x0)for(let _0x51c607=0x0,_0x468a48=this['draggers']['length'];_0x51c607<_0x468a48;_0x51c607++){this['draggers'][_0x51c607]['show']=![];}},'onDragEnd':(_0x3f20b1,_0x3cb71f)=>{const _0x139888=_0x3e5154;var _0x3dcf6f;((_0x3dcf6f=this['_heightDraggers'])===null||_0x3dcf6f===void 0x0?void 0x0:_0x3dcf6f['length'])>0x0&&this[_0x139888(_0x1c8d90._0x2474ba)]();}});_0x5637c7['index']=_0x1bb8b0,this[_0x3e5154(_0x216475._0x2ad980)]['push'](_0x5637c7);if(this['hasMidPoint']&&(this['hasClosure']||!this['hasClosure']&&_0x1bb8b0<_0x153c8a-0x1)){const _0x3e7149=(_0x1bb8b0+0x1)%_0x153c8a;let _0x599b15=getMidpoint(_0x4909bc,_0x1e1c16[_0x3e7149]);_0x599b15=this['updatePositionsHeightByAttr'](_0x599b15);const _0x4ef162=this['createDragger']({'position':_0x599b15,'type':PointType[_0x3e5154(0x696)],'tooltip':this[_0x3e5154(_0x216475._0x382e34)]['getLangText']('_增加点'),'onDragStart':(_0x4e6bd3,_0x52978c)=>{this['positions']['splice'](_0x4e6bd3['index'],0x0,_0x52978c);},'onDrag':(_0x94cbda,_0x12dbc4)=>{const _0x2dc15b=_0x3e5154;this['positions'][_0x94cbda[_0x2dc15b(_0x2d0e38._0x14121e)]]=_0x12dbc4;},'onDragEnd':(_0x571e4e,_0x30365e)=>{const _0x3493b1=_0x3e5154;this[_0x3493b1(0x40a)](_0x571e4e,_0x30365e),this['updateDraggers']();}});_0x4ef162[_0x3e5154(_0x216475._0x5926d9)]=_0x3e7149,this['draggers']['push'](_0x4ef162);}}this['_bindMoveAllDragger'](),this[_0x3e5154(_0x216475._0x38dd0c)]['extrudedHeight']&&this['_bindHeightDraggers']();}['_bindMoveAllDragger'](){const _0xeb830a={_0x11466d:0xc3b,_0x367f67:0xf01,_0x2d3942:0x8cb},_0x1c13e2={_0x54e84c:0x8eb,_0x2129e0:0xc61,_0x51475b:0x7f4,_0x680d23:0xe1e,_0x42fe6d:0x1cf,_0x4acb41:0x4af,_0x562b40:0x1cf,_0x16535e:0xf49},_0x31ced4=_0x35a251;if(!this['_graphic'][_0x31ced4(_0xeb830a._0x11466d)])return;let _0x19c353=centerOfMass(this[_0x31ced4(0xb35)]);_0x19c353=this['updatePositionsHeightByAttr'](_0x19c353);const _0x584321=this[_0x31ced4(_0xeb830a._0x367f67)]({'position':_0x19c353,'type':PointType[_0x31ced4(_0xeb830a._0x2d3942)],'tooltip':this['_map']['getLangText']('_整体平移'),'onDragStart':(_0x2a3b41,_0x445ec1)=>{_0x19c353=_0x445ec1;},'onDrag':(_0x2aa4d1,_0x3a135b)=>{const _0x594ebb={_0x35a6c0:0x4af},_0x46f42d=_0x31ced4;var _0x57bc27;const _0x52f4b9=Cesium__namespace[_0x46f42d(_0x1c13e2._0x54e84c)][_0x46f42d(_0x1c13e2._0x2129e0)](_0x3a135b,_0x19c353,new Cesium__namespace['Cartesian3']());_0x19c353=_0x3a135b,this['positions']['forEach']((_0x992198,_0x34448b,_0x3bc2fa)=>{const _0x284cc4=_0x46f42d,_0x2f71a2=Cesium__namespace['Cartesian3'][_0x284cc4(_0x594ebb._0x35a6c0)](_0x992198,_0x52f4b9,new Cesium__namespace['Cartesian3']());this['positions'][_0x34448b]=_0x2f71a2;});if(((_0x57bc27=this['_graphic'][_0x46f42d(_0x1c13e2._0x51475b)])===null||_0x57bc27===void 0x0?void 0x0:_0x57bc27[_0x46f42d(_0x1c13e2._0x680d23)])>0x0)for(let _0x1815a1=0x0,_0x57d31b=this['_graphic']['_draw_holes']['length'];_0x1815a1<_0x57d31b;_0x1815a1++){const _0x4cd9cf=this[_0x46f42d(0x163)]['_draw_holes'][_0x1815a1];_0x4cd9cf['forEach']((_0x17843,_0x31f2e2,_0x26c65c)=>{const _0x16c567=Cesium__namespace['Cartesian3']['add'](_0x17843,_0x52f4b9,new Cesium__namespace['Cartesian3']());_0x4cd9cf[_0x31f2e2]=_0x16c567;});}for(let _0x22b99a=0x0,_0x3e3f22=this[_0x46f42d(_0x1c13e2._0x42fe6d)]['length'];_0x22b99a<_0x3e3f22;_0x22b99a++){_0x584321!==this['draggers'][_0x22b99a]&&(this['draggers'][_0x22b99a]['position']=Cesium__namespace['Cartesian3'][_0x46f42d(_0x1c13e2._0x4acb41)](this[_0x46f42d(_0x1c13e2._0x562b40)][_0x22b99a]['position'],_0x52f4b9,new Cesium__namespace['Cartesian3']()));}this[_0x46f42d(_0x1c13e2._0x16535e)](_0x3a135b);}});this['_draggerMove']=_0x584321,this['draggers']['push'](_0x584321);}['_updateMoveAllHook'](_0x4a273b){}[_0x35a251(0x6da)](_0x277923){const _0x7c71a9={_0x40e0e4:0x6de},_0x35782b={_0x584954:0x9b1,_0x5c9073:0x682,_0x43f5bf:0x552,_0xd6295c:0x4f7,_0x3dbc03:0x5a2,_0x7357ef:0x53d},_0xc273c9=_0x35a251;if(!this['_graphic']['_hasHeightEdit'])return;this[_0xc273c9(0xdd0)]=[],_0x277923=_0x277923||this[_0xc273c9(0xb35)];const _0x5d0e27=getCesiumValue(this['entityGraphic']['extrudedHeight'],Number,this['_map']['clock']['currentTime']);for(let _0xf1797=0x0,_0x567a0e=_0x277923['length'];_0xf1797<_0x567a0e;_0xf1797++){const _0x22de69=setPositionsHeight(_0x277923[_0xf1797],_0x5d0e27),_0x1b3d64=this[_0xc273c9(0xf01)]({'position':_0x22de69,'type':PointType['MoveHeight'],'tooltip':this['_map']['getLangText']('_修改高度'),'onDrag':(_0x309ba7,_0x210e8f)=>{const _0x2f2a76=_0xc273c9,_0x3c5e14=Cesium__namespace['Cartographic'][_0x2f2a76(_0x35782b._0x584954)](_0x210e8f)[_0x2f2a76(_0x35782b._0x5c9073)];this['entityGraphic'][_0x2f2a76(_0x35782b._0x43f5bf)]=_0x3c5e14;const _0x100464=getMaxHeight(this['positions']);this['style'][_0x2f2a76(_0x35782b._0xd6295c)]=this['formatNum'](_0x3c5e14-_0x100464,0x2),this['updateHeightDraggers'](_0x3c5e14),this[_0x2f2a76(_0x35782b._0x3dbc03)](),this['fire'](EventType[_0x2f2a76(_0x35782b._0x7357ef)]);}});this['draggers'][_0xc273c9(_0x7c71a9._0x40e0e4)](_0x1b3d64),this['_heightDraggers']['push'](_0x1b3d64);}}['updateHeightDraggers'](_0x4b5612){const _0x55518e={_0x5376c9:0xe1e},_0x1e9cae=_0x35a251;for(let _0x24ec70=0x0;_0x24ec700x0?this['positions']=bufferPoints(_0x152a85[_0x44d51e(_0x5ccd29._0x56e3cd)],this['style']['buffer'],this[_0x44d51e(0xfc8)][_0x44d51e(0x39e)]):this['positions']=_0x152a85[_0x44d51e(0xb35)]);}get[_0x35a251(0xb36)](){const _0x54fe23=_0x35a251;return this[_0x54fe23(0xc3b)];}get['hasHeightEdit'](){return this['_hasHeightEdit'];}get['EditClass'](){return EditPoly;}get['center'](){const _0x107b91={_0x45f4d4:0xda2,_0x28b33a:0xb63},_0xdc9287=_0x35a251;return this['style']['closure']?this[_0xdc9287(_0x107b91._0x45f4d4)]:this[_0xdc9287(_0x107b91._0x28b33a)];}get['centerOfMass'](){return centerOfMass(this['positionsShow']);}get['centerOfLine'](){const _0x481040=_0x35a251,_0x65e300=this['positionsShow'];if(!_0x65e300||_0x65e300['length']===0x0)return null;else{if(_0x65e300['length']===0x1)return _0x65e300[0x0];}return _0x65e300['length']<0xa?sliceByMaxDistance(_0x65e300,this['distance']/0x2,{'point':!![]}):_0x65e300[Math['floor'](_0x65e300[_0x481040(0xe1e)]/0x2)];}get['distance'](){return getDistance(this['positionsShow']);}get['area'](){return getSurfaceArea(this['positionsShow']);}get['positions'](){if(this['_getPositions'])return this['_getPositions']();return this['_positions'];}set['positions'](_0x3f720a){const _0xabcb43={_0x3a651a:0x2a6,_0x3de0f5:0x264},_0x52cb4a=_0x35a251;if(!_0x3f720a)return;if(Array['isArray'](_0x3f720a)){var _0x2cf6fd;const _0x5a610b=[],_0x119228=[];_0x3f720a['forEach']((_0x286e9f,_0x3c8044)=>{const _0x5b4cf5=_0x2767,_0xed4f5a=LngLatPoint[_0x5b4cf5(0x8d0)](_0x286e9f);if(!_0xed4f5a||!_0xed4f5a['valid']())return;let _0x1a0e1a=this[_0x5b4cf5(0xfc8)]['setHeight'];if(Cesium__namespace['defined'](_0x1a0e1a)){if(isString(_0x1a0e1a))_0x1a0e1a=Number(template(_0x1a0e1a,this['attr'],!![])),isNaN(_0x1a0e1a)&&(_0x1a0e1a=0x0);else Array[_0x5b4cf5(0x719)](_0x1a0e1a)&&(_0x1a0e1a=_0x1a0e1a[_0x3c8044]||0x0);_0xed4f5a[_0x5b4cf5(0x5d2)]=_0x1a0e1a;}const _0x4c6027=this['getAddHeight'](_0x3c8044);_0x4c6027!==0x0&&(_0xed4f5a['alt']=_0xed4f5a['alt']+_0x4c6027),_0x5a610b[_0x5b4cf5(0x6de)](_0xed4f5a),_0x119228['push'](_0xed4f5a[_0x5b4cf5(0xa43)]());}),(_0x2cf6fd=this['editing'])!==null&&_0x2cf6fd!==void 0x0&&_0x2cf6fd[_0x52cb4a(_0xabcb43._0x3a651a)]?this['_positions_draw']=_0x119228:(this['_positions_draw']&&this['_cancelPositionsCallback'](),this['_positions']=_0x119228),this['_points']=_0x5a610b;}else this['_positions']=_0x3f720a;this[_0x52cb4a(0x249)]&&this['_updatePositionsHook'](),this[_0x52cb4a(_0xabcb43._0x3de0f5)](EventType['updatePosition'],{'positions':this['_positions']});}get[_0x35a251(0x263)](){let _0x2f4c89=getCesiumValue(this['_positions']);return _0x2f4c89 instanceof Cesium__namespace['Rectangle']&&(_0x2f4c89=this['outlinePositions']),_0x2f4c89;}get[_0x35a251(0x34a)](){const _0x3e3a70={_0x341687:0x263,_0x52c59e:0xb3a,_0x4c2423:0x86e},_0x173b0b=_0x35a251;if(this['_positions']instanceof Cesium__namespace['CallbackProperty']){let _0x55e3f1;this['_positions_draw']?_0x55e3f1=this['_positions_draw']:(_0x55e3f1=this[_0x173b0b(_0x3e3a70._0x341687)],this['style'][_0x173b0b(_0x3e3a70._0x52c59e)]&&_0x55e3f1[_0x173b0b(0xda9)]());const _0x4082a1=[];_0x55e3f1['forEach'](function(_0x17d3ae){const _0x83e7a4=LngLatPoint['parse'](_0x17d3ae);if(!_0x83e7a4)return;_0x4082a1['push'](_0x83e7a4);}),this['_points']=_0x4082a1;}return!this[_0x173b0b(0x86e)]&&(this[_0x173b0b(_0x3e3a70._0x4c2423)]=LngLatArray[_0x173b0b(0xb17)](this['_positions'])),this['_points'];}get[_0x35a251(0x310)](){const _0x4555f6=_0x35a251;return this[_0x4555f6(0x797)]();}get[_0x35a251(0xab1)](){const _0x1b0b88=_0x35a251;return Cesium__namespace['Rectangle'][_0x1b0b88(0x4c2)](this['positions']);}[_0x35a251(0x996)](){const _0x6a4ffb={_0x3ae957:0x5a1},_0x518f0e=_0x35a251;return this[_0x518f0e(_0x6a4ffb._0x3ae957)]['positions'];}['_mountedHook'](){}['_updatePositionsHook'](){this['_updateLabelPosition'](),this['_updateEditDraggers']();}[_0x35a251(0xe41)](_0x5d3a88){return{'type':'LineString','coordinates':this['getCoordinates'](_0x5d3a88===null||_0x5d3a88===void 0x0?void 0x0:_0x5d3a88['noAlt'])};}['getCoordinates'](_0x4c5d21){const _0x4a97e8={_0x360fac:0x769},_0x1289f1=[];return this['points']['forEach'](_0xe7f664=>{const _0x5d44e2=_0x2767;_0x1289f1['push'](_0xe7f664[_0x5d44e2(_0x4a97e8._0x360fac)](_0x4c5d21));}),_0x1289f1;}['isInPoly'](_0x42a202){const _0x49575a=LngLatPoint['parse'](_0x42a202),_0x49c3e1=Cesium__namespace['Rectangle']['contains'](Cesium__namespace['Rectangle']['fromCartesianArray'](this['positionsShow']),_0x49575a['toCartographic']());if(!_0x49c3e1)return![];return isInPoly(_0x49575a,this['coordinates']);}['autoSurfaceHeight'](_0xd99eb4={}){const _0x22cc51=_0x35a251;return computeSurfacePoints({..._0xd99eb4,'map':this['_map'],'positions':this[_0x22cc51(0x263)]})['then'](_0x313633=>{return!_0x313633['noHeight']&&(this['positions']=_0x313633['positions']),_0x313633;});}['clampToGround'](_0x1c86f9){return this['autoSurfaceHeight'](_0x1c86f9);}[_0x35a251(0x17b)](_0x525cc0){const _0x5e598c={_0x5251ce:0xcf},_0x2de690=_0x35a251;return this['_setPositionsToCallback'](),_0x525cc0&&(this[_0x2de690(0x937)]=LngLatArray[_0x2de690(_0x5e598c._0x5251ce)](_0x525cc0)),this[_0x2de690(0x937)];}['_setPositionsToCallback'](){const _0x1c4d52={_0x2c9d3f:0xec,_0x393b8c:0xdc9},_0x1e8685=_0x35a251;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];let _0x3adb97=getCesiumValue(this[_0x1e8685(0x58a)]);if(_0x3adb97 instanceof Cesium__namespace['PolygonHierarchy'])_0x3adb97=_0x3adb97['positions'];else _0x3adb97 instanceof Cesium__namespace['Rectangle']&&(_0x3adb97=this[_0x1e8685(_0x1c4d52._0x2c9d3f)]);this['_positions_draw']=_0x3adb97||this['positionsShow']||[],this['positions']=new Cesium__namespace['CallbackProperty'](_0x432e79=>{const _0x15d253=_0x1e8685;return this[_0x15d253(0x133)]();},![]),this['_updateOutlineToCallback'](),this['updateAttrForDrawing']&&this['updateAttrForDrawing'](!![]),this[_0x1e8685(_0x1c4d52._0x393b8c)]();}[_0x35a251(0x133)](){return this['_positions_draw'];}['_cancelPositionsCallback'](){const _0xc8f110={_0x4eff79:0x894,_0x193bc5:0x937},_0x102f27=_0x35a251;if(!this[_0x102f27(_0xc8f110._0x4eff79)])return;this['_isCallbackPositions']=![],this[_0x102f27(0x58a)]=this[_0x102f27(_0xc8f110._0x193bc5)],this['_points']=LngLatArray[_0x102f27(0xb17)](this[_0x102f27(_0xc8f110._0x193bc5)]),delete this['_positions_draw'],this['_updatePositionsHook'](),this['_cancelOutlinePositionsCallback']();}['_startDrawHook'](){const _0x2afa0a=_0x35a251;this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this[_0x2afa0a(0xd79)]['on'](EventType[_0x2afa0a(0xfb4)],this['_onClickHandler'],this),this['_map']['on'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this['options']['hasDrawDelPoint']??!![])&&this['_map']['on'](this['_drawDelEventType'],this['_onRightClickHandler'],this);}[_0x35a251(0x433)](){const _0x1f4119={_0x16e1e1:0xd79,_0x394e9a:0x3b4,_0x17d71b:0x7b3,_0xf9f2ab:0x6b2},_0x3e1739=_0x35a251;this[_0x3e1739(_0x1f4119._0x16e1e1)]['off'](EventType[_0x3e1739(0x971)],this[_0x3e1739(_0x1f4119._0x394e9a)],this),this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this['_map']['off'](this[_0x3e1739(0x956)],this[_0x3e1739(_0x1f4119._0x17d71b)],this),(this['options']['hasDrawDelPoint']??!![])&&this['_map'][_0x3e1739(_0x1f4119._0xf9f2ab)](this['_drawDelEventType'],this['_onRightClickHandler'],this);}}class PointEntity extends BasePointEntity{get[_0x35a251(0x5a1)](){var _0x4f65bc;return(_0x4f65bc=this['_entity'])===null||_0x4f65bc===void 0x0?void 0x0:_0x4f65bc['point'];}['_mountedHook'](){const _0x4a32e5={_0x4b7bcd:0xb61,_0x3dd6e5:0xc04,_0x44653b:0x854,_0x45e9ef:0x9c2,_0x5b4685:0xc04,_0x58d94d:0xc04,_0x4a6f74:0x440,_0x4c9a50:0xe86,_0x4d45ea:0xa06,_0x12daee:0xf60,_0x5553e2:0xd85,_0x12259b:0x425},_0x62de8e=_0x35a251,_0x441bbb={'position':this[_0x62de8e(_0x4a32e5._0x4b7bcd)],'point':PointStyleConver[_0x62de8e(_0x4a32e5._0x3dd6e5)](this['style'])};this['style'][_0x62de8e(_0x4a32e5._0x44653b)]&&(_0x441bbb[_0x62de8e(0x854)]=LabelStyleConver[_0x62de8e(_0x4a32e5._0x3dd6e5)](this[_0x62de8e(0xfc8)]['label'],{},this['attr']));this['options'][_0x62de8e(_0x4a32e5._0x45e9ef)]&&(_0x441bbb['billboard']=BillboardStyleConver[_0x62de8e(_0x4a32e5._0x5b4685)](this[_0x62de8e(0xe86)]['billboard'],{},!![]));this['options']['circle']&&(_0x441bbb['ellipse']=CircleStyleConver[_0x62de8e(_0x4a32e5._0x58d94d)](this['options']['circle'],{},!![]));this['options']['model']&&(_0x441bbb['orientation']=this[_0x62de8e(0x3e7)](this['options']['model']),_0x441bbb[_0x62de8e(_0x4a32e5._0x4a6f74)]=ModelStyleConver['toCesiumVal'](this[_0x62de8e(_0x4a32e5._0x4c9a50)][_0x62de8e(_0x4a32e5._0x4a6f74)],{},!![]));if(this['options'][_0x62de8e(_0x4a32e5._0x4d45ea)]){var _0x3ad4a6,_0x456e45;const _0x16555a=PathStyleConver['toCesiumVal'](this['options']['path'],{},!![]);!_0x16555a['isAll']&&(_0x16555a[_0x62de8e(0x420)]=0x0);_0x441bbb[_0x62de8e(0xa06)]=_0x16555a;const _0x1c94ea=(_0x3ad4a6=this['position'])===null||_0x3ad4a6===void 0x0?void 0x0:(_0x456e45=_0x3ad4a6['_property'])===null||_0x456e45===void 0x0?void 0x0:_0x456e45['_times'];if(_0x1c94ea&&_0x1c94ea['length']>0x0){var _0x4e17de;const _0x28c47a=_0x1c94ea[0x0];let _0x1aa3f1=_0x1c94ea[_0x1c94ea['length']-0x1];((_0x4e17de=this['position'])===null||_0x4e17de===void 0x0?void 0x0:_0x4e17de['forwardExtrapolationType'])===Cesium__namespace[_0x62de8e(0xe0a)]['HOLD']&&(_0x1aa3f1=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),_0x441bbb[_0x62de8e(_0x4a32e5._0x12daee)]=new Cesium__namespace[(_0x62de8e(_0x4a32e5._0x5553e2))]([new Cesium__namespace[(_0x62de8e(_0x4a32e5._0x12259b))]({'start':_0x28c47a,'stop':_0x1aa3f1})]);}}this['_entity']=this['_createEntity'](_0x441bbb);}['_addLabel'](){const _0x5e0772={_0x2e7713:0xc04},_0xab0d6a=_0x35a251;this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver[_0xab0d6a(_0x5e0772._0x2e7713)](this['style']['label'],this['_entity']['label'],this['attr']);}['_updateStyleHook'](_0x18f468,_0x371d08){PointStyleConver['toCesiumVal'](_0x18f468,this['entityGraphic']);}[_0x35a251(0x1e0)](_0x403c0a,_0x3ec25b){return PointStyleConver['toJSON'](_0x403c0a,_0x3ec25b,!![]);}['_setOptionsHook'](_0x3eb2cb,_0xaea11){const _0x433329={_0x58a693:0xa06,_0x51af60:0xc04,_0x11876d:0xedf},_0x5a5ad8=_0x35a251;_0xaea11['model']&&ModelStyleConver['toCesiumVal'](_0x3eb2cb['model'],this['_entity']['model'],!![]),_0xaea11['billboard']&&BillboardStyleConver[_0x5a5ad8(0xc04)](_0x3eb2cb['billboard'],this['_entity']['billboard'],!![]),_0xaea11['path']&&PathStyleConver['toCesiumVal'](_0x3eb2cb['path'],this['_entity'][_0x5a5ad8(_0x433329._0x58a693)],!![]),_0xaea11[_0x5a5ad8(0xd6d)]&&CircleStyleConver[_0x5a5ad8(_0x433329._0x51af60)](_0x3eb2cb['circle'],this['_entity'][_0x5a5ad8(_0x433329._0x11876d)],!![]);}['_toJSON_Ex'](_0x593206){const _0x3f547e={_0x3673f9:0xe86,_0x25d931:0x440,_0x3c5b0b:0xa06},_0x3fe032=_0x35a251;this['options'][_0x3fe032(0x440)]&&(_0x593206[_0x3fe032(0x440)]={},ModelStyleConver['toJSON'](this[_0x3fe032(_0x3f547e._0x3673f9)]['model'],_0x593206[_0x3fe032(_0x3f547e._0x25d931)],!![])),this['options']['billboard']&&(_0x593206[_0x3fe032(0x9c2)]={},BillboardStyleConver['toJSON'](this[_0x3fe032(_0x3f547e._0x3673f9)][_0x3fe032(0x9c2)],_0x593206['billboard'],!![])),this['options']['path']&&(_0x593206[_0x3fe032(0xa06)]={},PathStyleConver[_0x3fe032(0x99e)](this['options'][_0x3fe032(_0x3f547e._0x3c5b0b)],_0x593206['path'],!![])),this['options']['circle']&&(_0x593206['circle']={},CircleStyleConver['toJSON'](this[_0x3fe032(0xe86)]['circle'],_0x593206['circle'],!![]));}['_updateExOpacity'](_0x3b49f8){const _0x41c33c={_0x32048d:0x373,_0x1769bf:0xfa4,_0x2959cc:0xe86,_0x8f7d9a:0xedf},_0x376975=_0x35a251;this['_entity']['model']&&(this['_entity']['model']['color']=Cesium__namespace['Color']['WHITE'][_0x376975(_0x41c33c._0x32048d)](_0x3b49f8));this['_entity']['billboard']&&(this['_entity'][_0x376975(0x9c2)]['color']=Cesium__namespace[_0x376975(0xf29)]['WHITE']['withAlpha'](_0x3b49f8));if(this['_entity']['path']){const _0x25ba6d=this[_0x376975(_0x41c33c._0x1769bf)](this['_entity'][_0x376975(0xa06)],_0x3b49f8);!_0x25ba6d&&PathStyleConver[_0x376975(0xc04)]({...this[_0x376975(_0x41c33c._0x2959cc)]['path'],'globalAlpha':_0x3b49f8},this['_entity']['path'],!![]);}if(this['_entity']['circle']){const _0x594aee=this['_updateEntityOpacity'](this['_entity']['circle'],_0x3b49f8);!_0x594aee&&CircleStyleConver['toCesiumVal']({...this['options']['circle'],'globalAlpha':_0x3b49f8},this['_entity'][_0x376975(_0x41c33c._0x8f7d9a)],!![]);}}['_updateDistanceDisplayConditionByEdit'](){}}register$4('point',PointEntity,!![]);class BillboardEntity extends BasePointEntity{get[_0x35a251(0x5a1)](){var _0x243924;return(_0x243924=this['_entity'])===null||_0x243924===void 0x0?void 0x0:_0x243924['billboard'];}get['image'](){return this['style']['image'];}set['image'](_0x3ce460){this['style']['image']=_0x3ce460,this['_entity']&&(this['_entity']['billboard']['image']=_0x3ce460);}[_0x35a251(0x700)](){const _0x31adee={_0x2d79ff:0xb61,_0x1002a2:0xaa2,_0x412b28:0x854,_0x20f47a:0x1ba,_0x44d604:0xc04,_0x18c3f5:0xe86,_0x239fa8:0xe86,_0x249f71:0x440,_0x212a6e:0x579},_0x785e0d=_0x35a251,_0x155b28={'position':this[_0x785e0d(_0x31adee._0x2d79ff)],'billboard':BillboardStyleConver['toCesiumVal'](this['style'])};this['style'][_0x785e0d(0x854)]&&(Cesium__namespace['defined'](this['style']['clampToGround'])&&!Cesium__namespace[_0x785e0d(_0x31adee._0x1002a2)](this[_0x785e0d(0xfc8)][_0x785e0d(_0x31adee._0x412b28)]['clampToGround'])&&(this['style']['label']['clampToGround']=this['style']['clampToGround']),_0x155b28['label']=LabelStyleConver['toCesiumVal'](this['style']['label'],{},this['attr']));this['options'][_0x785e0d(0x1ba)]&&(_0x155b28['point']=PointStyleConver['toCesiumVal'](this['options'][_0x785e0d(_0x31adee._0x20f47a)],{},!![]));this['options']['circle']&&(_0x155b28[_0x785e0d(0xedf)]=CircleStyleConver[_0x785e0d(_0x31adee._0x44d604)](this[_0x785e0d(_0x31adee._0x18c3f5)]['circle'],{},!![]));this[_0x785e0d(_0x31adee._0x239fa8)][_0x785e0d(_0x31adee._0x249f71)]&&(_0x155b28['orientation']=this['getOrientation'](this[_0x785e0d(0xe86)][_0x785e0d(0x440)]),_0x155b28['model']=ModelStyleConver[_0x785e0d(0xc04)](this['options'][_0x785e0d(0x440)],{},!![]));if(this['options']['path']){var _0x2c53ca,_0x53b6e8;const _0xce89f2=PathStyleConver['toCesiumVal'](this['options']['path'],{},!![]);!_0xce89f2['isAll']&&(_0xce89f2['leadTime']=0x0);_0x155b28['path']=_0xce89f2;const _0x44b571=(_0x2c53ca=this['position'])===null||_0x2c53ca===void 0x0?void 0x0:(_0x53b6e8=_0x2c53ca['_property'])===null||_0x53b6e8===void 0x0?void 0x0:_0x53b6e8['_times'];if(_0x44b571&&_0x44b571['length']>0x0){var _0x511c89;const _0x43bf15=_0x44b571[0x0];let _0x5881b3=_0x44b571[_0x44b571['length']-0x1];((_0x511c89=this['position'])===null||_0x511c89===void 0x0?void 0x0:_0x511c89['forwardExtrapolationType'])===Cesium__namespace[_0x785e0d(0xe0a)]['HOLD']&&(_0x5881b3=Cesium__namespace[_0x785e0d(_0x31adee._0x212a6e)]['fromDate'](new Date(0x834,0x1,0x1))),_0x155b28['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x43bf15,'stop':_0x5881b3})]);}}this['_entity']=this['_createEntity'](_0x155b28);}['_addLabel'](){const _0xa334d2={_0x16d158:0x854},_0x35499e=_0x35a251;this[_0x35499e(0x249)]['label']=this['_entity'][_0x35499e(_0xa334d2._0x16d158)]||{},LabelStyleConver['toCesiumVal'](this['style'][_0x35499e(0x854)],this[_0x35499e(0x249)]['label'],this['attr']);}['_style2Json'](_0x1f4ad5,_0x15cf55){return BillboardStyleConver['toJSON'](_0x1f4ad5,_0x15cf55,!![]);}[_0x35a251(0x6a1)](_0xecb5c7,_0x58bde6){BillboardStyleConver['toCesiumVal'](_0xecb5c7,this['entityGraphic']);}['_setOptionsHook'](_0x23b074,_0x39353d){const _0x4a5ff9={_0x58bc4e:0x440,_0x24b7ab:0x249,_0x54d645:0xc04,_0x41477b:0xedf},_0x1cfae1=_0x35a251;_0x39353d[_0x1cfae1(_0x4a5ff9._0x58bc4e)]&&ModelStyleConver['toCesiumVal'](_0x23b074['model'],this[_0x1cfae1(0x249)]['model'],!![]),_0x39353d['point']&&PointStyleConver['toCesiumVal'](_0x23b074['point'],this['_entity']['point'],!![]),_0x39353d['path']&&PathStyleConver['toCesiumVal'](_0x23b074['path'],this[_0x1cfae1(_0x4a5ff9._0x24b7ab)]['path'],!![]),_0x39353d[_0x1cfae1(0xd6d)]&&CircleStyleConver[_0x1cfae1(_0x4a5ff9._0x54d645)](_0x23b074['circle'],this[_0x1cfae1(_0x4a5ff9._0x24b7ab)][_0x1cfae1(_0x4a5ff9._0x41477b)],!![]);}[_0x35a251(0xaa6)](_0x48325e){const _0x1a9e1a={_0x2531a6:0x249,_0xe1705a:0x9a2,_0x10f7b3:0x249,_0x13d0c2:0xfa4,_0x31ea74:0x249,_0x304131:0x249,_0x5a7a86:0x1ba,_0x419f4a:0xedf},_0x4fd695=_0x35a251;this[_0x4fd695(_0x1a9e1a._0x2531a6)]['model']&&(this['_entity']['model'][_0x4fd695(0x9db)]=Cesium__namespace[_0x4fd695(0xf29)][_0x4fd695(_0x1a9e1a._0xe1705a)]['withAlpha'](_0x48325e));if(this[_0x4fd695(_0x1a9e1a._0x10f7b3)]['point']){const _0x554e1f=this[_0x4fd695(_0x1a9e1a._0x13d0c2)](this[_0x4fd695(_0x1a9e1a._0x31ea74)]['point'],_0x48325e);!_0x554e1f&&PointStyleConver['toCesiumVal']({...this['options']['point'],'globalAlpha':_0x48325e},this[_0x4fd695(_0x1a9e1a._0x304131)][_0x4fd695(_0x1a9e1a._0x5a7a86)],!![]);}if(this['_entity']['path']){const _0x5ddc62=this['_updateEntityOpacity'](this['_entity']['path'],_0x48325e);!_0x5ddc62&&PathStyleConver['toCesiumVal']({...this['options'][_0x4fd695(0xa06)],'globalAlpha':_0x48325e},this[_0x4fd695(0x249)]['path'],!![]);}if(this['_entity']['circle']){const _0x455b58=this[_0x4fd695(0xfa4)](this[_0x4fd695(0x249)]['circle'],_0x48325e);!_0x455b58&&CircleStyleConver['toCesiumVal']({...this[_0x4fd695(0xe86)]['circle'],'globalAlpha':_0x48325e},this['_entity'][_0x4fd695(_0x1a9e1a._0x419f4a)],!![]);}}['_toJSON_Ex'](_0x1d2e6a){const _0x3ecd0a={_0x525c32:0x99e,_0x383380:0xa06,_0x310d13:0xd6d,_0x4182fe:0x99e},_0x56d764=_0x35a251;this['options']['model']&&(_0x1d2e6a[_0x56d764(0x440)]={},ModelStyleConver['toJSON'](this['options']['model'],_0x1d2e6a['model'],!![])),this['options']['point']&&(_0x1d2e6a[_0x56d764(0x1ba)]={},PointStyleConver[_0x56d764(0x99e)](this['options']['point'],_0x1d2e6a['point'],!![])),this['options']['path']&&(_0x1d2e6a['path']={},PathStyleConver[_0x56d764(_0x3ecd0a._0x525c32)](this['options'][_0x56d764(_0x3ecd0a._0x383380)],_0x1d2e6a['path'],!![])),this['options']['circle']&&(_0x1d2e6a[_0x56d764(_0x3ecd0a._0x310d13)]={},CircleStyleConver[_0x56d764(_0x3ecd0a._0x4182fe)](this['options'][_0x56d764(_0x3ecd0a._0x310d13)],_0x1d2e6a[_0x56d764(0xd6d)],!![]));}['_updateDistanceDisplayConditionByEdit'](){}[_0x35a251(0x45c)](_0xd5fa2){const _0x5b1cfd=_0x35a251;this['style']['globalAlpha']=_0xd5fa2,this['_entity']&&(this['_entity']['billboard']['color']=Cesium__namespace[_0x5b1cfd(0xf29)][_0x5b1cfd(0x9a2)]['withAlpha'](_0xd5fa2)),this['_updateLabelOpacity'](_0xd5fa2);}['startBounce'](_0x24f40a={}){const _0xf9ceb7={_0xd13c50:0x854,_0x2c1793:0xfb2,_0x1d4cc4:0x18a},_0x4742fe=_0x35a251;if(!this['_entity'])return;let _0x378912=-(_0x24f40a['maxHeight']||0x32);const _0x435ea1=_0x24f40a['step']||0x1,_0x32e0ba=_0x24f40a['autoStop'];let _0x59bec4=_0x378912,_0x528a6f=-0x1;const _0x4dccec=this;function _0x425b6a(){if(_0x59bec4<=_0x378912&&_0x528a6f!==0x1)_0x528a6f=0x1,_0x32e0ba&&(_0x378912*=0.55,_0x435ea1*0x2>=-_0x378912&&_0x4dccec['stopBounce']());else _0x59bec4>=0x0&&_0x528a6f!==-0x1&&(_0x528a6f=-0x1);_0x59bec4+=_0x435ea1*_0x528a6f;}const _0x757d2c=getCesiumValue(this[_0x4742fe(0x5a1)]['pixelOffset'],Cesium__namespace['Cartesian2'])||new Cesium__namespace['Cartesian2'](0x0,0x0),_0x4a5adb=_0x757d2c['clone']();this[_0x4742fe(0x5a1)]['pixelOffset_original']=_0x757d2c,this['entityGraphic']['pixelOffset']=new Cesium__namespace['CallbackProperty'](_0x35d6ca=>{return _0x425b6a(),_0x4a5adb['y']=_0x757d2c['y']+_0x59bec4,_0x4a5adb;});if(this[_0x4742fe(0x249)]['label']){const _0x11afb9=getCesiumValue(this['_entity'][_0x4742fe(_0xf9ceb7._0xd13c50)]['pixelOffset'],Cesium__namespace['Cartesian2'])||new Cesium__namespace['Cartesian2'](0x0,0x0),_0x44bb4d=_0x11afb9['clone']();this[_0x4742fe(0x249)]['label'][_0x4742fe(_0xf9ceb7._0x2c1793)]=_0x11afb9,this['_entity'][_0x4742fe(_0xf9ceb7._0xd13c50)][_0x4742fe(0x317)]=new Cesium__namespace[(_0x4742fe(_0xf9ceb7._0x1d4cc4))](_0xadb43d=>{return _0x44bb4d['y']=_0x11afb9['y']+_0x59bec4,_0x44bb4d;});}}[_0x35a251(0x156)](){const _0x34f008={_0x567e2b:0x317,_0xcd8258:0x5a1,_0x161715:0x249,_0x9a49dd:0x317,_0x40ee0e:0xfb2},_0x49f6ce=_0x35a251;this['entityGraphic'][_0x49f6ce(_0x34f008._0x567e2b)]=this[_0x49f6ce(_0x34f008._0xcd8258)][_0x49f6ce(0xfb2)],this['_entity']['label']&&(this[_0x49f6ce(_0x34f008._0x161715)]['label'][_0x49f6ce(_0x34f008._0x9a49dd)]=this[_0x49f6ce(0x249)]['label'][_0x49f6ce(_0x34f008._0x40ee0e)]);}}register$4(_0x35a251(0x9c2),BillboardEntity,!![]);class DivBillboardEntity extends BillboardEntity{['_mountedHook'](){super['_mountedHook'](),this['_updateImage_delay']();}['_updateStyleHook'](_0x3aeb20,_0x36a89a){const _0x1f200a={_0x28914a:0xdb2,_0x5171c2:0xc3c},_0x3826f5=_0x35a251;delete _0x3aeb20[_0x3826f5(_0x1f200a._0x28914a)],super['_updateStyleHook'](_0x3aeb20,_0x36a89a),_0x36a89a&&(_0x36a89a[_0x3826f5(_0x1f200a._0x5171c2)]||_0x36a89a['iconSize']||_0x36a89a['color'])&&this[_0x3826f5(0x49f)]();}[_0x35a251(0x49f)](){const _0x52b2e9={_0x580d03:0x2ec};this['updateTimer']&&clearTimeout(this['updateTimer']),this['updateTimer']=setTimeout(()=>{const _0xe3bd5d=_0x2767;delete this[_0xe3bd5d(0x24d)];if(!this['_entity'])return;this[_0xe3bd5d(_0x52b2e9._0x580d03)]();},0x12c);}['_updateImage'](){const _0x73af0d={_0x53c4d3:0xe09,_0xa49e05:0xfc8,_0x2243d0:0xc3c,_0x1641f4:0xf4a,_0x1498f8:0x86c,_0x339fc5:0x80a,_0x14d1ff:0xeb7},_0x21cc7a={_0x58d15b:0x8a6},_0x189f90={_0x378c7c:0x264},_0x3b63c0=_0x35a251,_0x5816cb=create$3(_0x3b63c0(_0x73af0d._0x53c4d3),'mars3d-hideDiv'),_0x56e425=this[_0x3b63c0(_0x73af0d._0xa49e05)][_0x3b63c0(_0x73af0d._0x2243d0)];if(isString(_0x56e425))_0x5816cb[_0x3b63c0(_0x73af0d._0x1641f4)]=_0x56e425;else _0x56e425 instanceof Element&&_0x5816cb['appendChild'](_0x56e425);document['body']['appendChild'](_0x5816cb),this['_islosdImg']=!![];if(window[_0x3b63c0(0x597)])window['domtoimage'][_0x3b63c0(0xdcc)](_0x5816cb)[_0x3b63c0(_0x73af0d._0x1498f8)](_0x20cbb3=>{const _0x3c5b1a=_0x3b63c0;this['entityGraphic'][_0x3c5b1a(0xdb2)]=''+_0x20cbb3,document[_0x3c5b1a(0x8a6)]['removeChild'](_0x5816cb),this['_islosdImg']=![],this[_0x3c5b1a(_0x189f90._0x378c7c)]('image',{'image':_0x20cbb3});})['catch'](_0x482cf1=>{const _0x129f83=_0x3b63c0;logError$1('未知原因,导出失败!',_0x482cf1),document[_0x129f83(_0x21cc7a._0x58d15b)]['removeChild'](_0x5816cb),this['_islosdImg']=![];});else window['html2canvas']&&window[_0x3b63c0(_0x73af0d._0x339fc5)](_0x5816cb,{'backgroundColor':null,'allowTaint':!![]})['then'](_0x1545ca=>{this['entityGraphic']['image']=_0x1545ca,document['body']['removeChild'](_0x5816cb),this['_islosdImg']=![],this['fire']('image',{'canvas':_0x1545ca});})[_0x3b63c0(_0x73af0d._0x14d1ff)](_0x369a69=>{const _0x5d3c52=_0x3b63c0;logError$1(_0x5d3c52(0xb3f),_0x369a69),document['body']['removeChild'](_0x5816cb),this['_islosdImg']=![];});}}register$4(_0x35a251(0xc42),DivBillboardEntity,!![]);class FontBillboardEntity extends DivBillboardEntity{['_updateImage'](){const _0x4734f2={_0x598a51:0x538,_0x81fbba:0xeb4,_0x46a9d6:0x80a},_0x3bd62f={_0x40e156:0x8a6},_0x10c6a9={_0x3f080d:0x8a6},_0x390c7b=_0x35a251,_0x2fd9b6=this[_0x390c7b(0xfc8)]['iconSize']??0x32,_0xd5a376=this['style']['iconPadding']??0xa,_0x5d4b9d=this['style']['color']??'#ff0000',_0x1244f1=create$3('div','mars3d-hideDiv');_0x1244f1['setAttribute']('style','padding:\x20'+_0xd5a376+'px;text-align:center;max-width:'+_0x2fd9b6+'px;max-height:'+_0x2fd9b6+'px;');const _0x23d3f9=document[_0x390c7b(0xd0f)]('i');_0x23d3f9[_0x390c7b(_0x4734f2._0x598a51)](_0x390c7b(_0x4734f2._0x81fbba),this['style']['iconClass']),_0x23d3f9['setAttribute']('style','font-size:'+_0x2fd9b6+'px;color:'+_0x5d4b9d+';'),_0x1244f1[_0x390c7b(0x87c)](_0x23d3f9),document['body'][_0x390c7b(0x87c)](_0x1244f1),this['_islosdImg']=!![];if(window['domtoimage'])window['domtoimage']['toPng'](_0x1244f1)['then'](_0x5096fe=>{const _0x2bcc34=_0x390c7b;this[_0x2bcc34(0x5a1)]['image']=''+_0x5096fe,document[_0x2bcc34(0x8a6)]['removeChild'](_0x1244f1),this['_islosdImg']=![],this['fire']('image',{'image':_0x5096fe});})[_0x390c7b(0xeb7)](_0x28c7dd=>{const _0x3a2d57=_0x390c7b;logError$1('未知原因,导出失败!',_0x28c7dd),document[_0x3a2d57(_0x10c6a9._0x3f080d)]['removeChild'](_0x1244f1),this[_0x3a2d57(0xa73)]=![];});else window[_0x390c7b(_0x4734f2._0x46a9d6)]&&window['html2canvas'](_0x1244f1,{'backgroundColor':null,'allowTaint':!![]})['then'](_0x4744a2=>{const _0x44aeca=_0x390c7b;this['entityGraphic']['image']=_0x4744a2,document[_0x44aeca(_0x3bd62f._0x40e156)]['removeChild'](_0x1244f1),this['_islosdImg']=![],this['fire']('image',{'canvas':_0x4744a2});})[_0x390c7b(0xeb7)](_0x24a144=>{const _0x3b357a=_0x390c7b;logError$1('未知原因,导出失败!',_0x24a144),document['body'][_0x3b357a(0xfa2)](_0x1244f1),this['_islosdImg']=![];});}}register$4('fontBillboard',FontBillboardEntity,!![]);class LabelEntity extends BasePointEntity{get['entityGraphic'](){var _0x5c82ee;return(_0x5c82ee=this['_entity'])===null||_0x5c82ee===void 0x0?void 0x0:_0x5c82ee['label'];}get[_0x35a251(0x854)](){return this['_entity']?this['_entity']['label']:this['style'];}get[_0x35a251(0xe1f)](){const _0x90d44b=_0x35a251;return this[_0x90d44b(0xfc8)]['text'];}set['text'](_0x70bf13){const _0x44560d=_0x35a251;this[_0x44560d(0xfc8)]['text']=_0x70bf13,this['_entity']&&(this['entityGraphic']['text']=_0x70bf13);}['_mountedHook'](){const _0x3f47f8=_0x35a251,_0x468b1b={'position':this['position'],'label':LabelStyleConver[_0x3f47f8(0xc04)](this['style'])};this['_entity']=this['_createEntity'](_0x468b1b);}['_addLabel'](){}['_style2Json'](_0x2fb57b,_0x3de578){return LabelStyleConver['toJSON'](_0x2fb57b,_0x3de578,!![]);}['_updateStyleHook'](_0x278dd1,_0x1648c0){LabelStyleConver['toCesiumVal'](_0x278dd1,this['entityGraphic']);}['_updateDistanceDisplayConditionByEdit'](){}['startBounce'](_0x2ddb51={}){const _0x56b3c0={_0x3b2695:0x317,_0x597398:0xfb2},_0x2722e6=_0x35a251;if(!this['_entity'])return;let _0x1c301d=-(_0x2ddb51['maxHeight']||0x32);const _0x1e94e4=_0x2ddb51['step']||0x1,_0x4821c3=_0x2ddb51[_0x2722e6(0x686)];let _0x4aa0c3=_0x1c301d,_0x4189da=-0x1;const _0xacce62=this;function _0x41fbe0(){if(_0x4aa0c3<=_0x1c301d&&_0x4189da!==0x1)_0x4189da=0x1,_0x4821c3&&(_0x1c301d*=0.55,_0x1e94e4*0x2>=-_0x1c301d&&_0xacce62['stopBounce']());else _0x4aa0c3>=0x0&&_0x4189da!==-0x1&&(_0x4189da=-0x1);_0x4aa0c3+=_0x1e94e4*_0x4189da;}const _0x32cac2=getCesiumValue(this['entityGraphic'][_0x2722e6(_0x56b3c0._0x3b2695)],Cesium__namespace['Cartesian2'])||new Cesium__namespace['Cartesian2'](0x0,0x0),_0x186e69=_0x32cac2['clone']();this['entityGraphic'][_0x2722e6(_0x56b3c0._0x597398)]=_0x32cac2,this['entityGraphic']['pixelOffset']=new Cesium__namespace['CallbackProperty'](_0x1b3d70=>{return _0x41fbe0(),_0x186e69['y']=_0x32cac2['y']+_0x4aa0c3,_0x186e69;});}[_0x35a251(0x156)](){this['entityGraphic']['pixelOffset']=this['entityGraphic']['pixelOffset_original'];}[_0x35a251(0x45c)](_0x30eeea){const _0x3f3dd3={_0xeb58b4:0x2cf},_0x5df733=_0x35a251;this['style'][_0x5df733(_0x3f3dd3._0xeb58b4)]=_0x30eeea,this['_entity']&&LabelStyleConver['setOpacity'](this['entityGraphic'],_0x30eeea);}}register$4(_0x35a251(0x854),LabelEntity,!![]);class CanvasLabelEntity extends BillboardEntity{['_mountedHook'](){const _0x4647fc=_0x35a251;super['_mountedHook'](),this[_0x4647fc(0x49f)](this[_0x4647fc(0xfc8)]);}['_onBeforeCreate'](_0x2cfda7){const _0x4b894c={_0x5ec448:0xaa2,_0x1c00c1:0x9c2},_0x543f84=_0x35a251;var _0x77af20,_0x294a1d;return Cesium__namespace[_0x543f84(_0x4b894c._0x5ec448)](_0x2cfda7===null||_0x2cfda7===void 0x0?void 0x0:(_0x77af20=_0x2cfda7[_0x543f84(_0x4b894c._0x1c00c1)])===null||_0x77af20===void 0x0?void 0x0:_0x77af20['image'])&&delete _0x2cfda7[_0x543f84(_0x4b894c._0x1c00c1)]['image'],Cesium__namespace['defined'](_0x2cfda7===null||_0x2cfda7===void 0x0?void 0x0:(_0x294a1d=_0x2cfda7[_0x543f84(_0x4b894c._0x1c00c1)])===null||_0x294a1d===void 0x0?void 0x0:_0x294a1d['color'])&&delete _0x2cfda7['billboard']['color'],_0x2cfda7;}['_updateStyleHook'](_0x719fc,_0x39854f){const _0xe67f3b={..._0x719fc};delete _0xe67f3b['image'],delete _0xe67f3b['color'],super['_updateStyleHook'](_0xe67f3b,_0x39854f),this['_updateImage_delay'](_0x719fc);}['_updateImage_delay'](_0x48bad8){const _0x89f6a9={_0x549db7:0x24d,_0x106c24:0x249},_0x3005b7=_0x35a251;this['updateTimer']&&clearTimeout(this['updateTimer']),this[_0x3005b7(0x24d)]=setTimeout(()=>{const _0x1deda7=_0x3005b7;delete this[_0x1deda7(_0x89f6a9._0x549db7)];if(!this[_0x1deda7(_0x89f6a9._0x106c24)])return;this['_updateImage'](_0x48bad8);},0x64);}['_updateImage'](_0x2b2beb){const _0x5ea9a8={_0x3842d6:0xe1f},_0x2a1d6a=_0x35a251,_0x4cc351=LabelStyleConver['toCesiumVal'](_0x2b2beb),_0x3c5d3e=getTextImage(_0x4cc351[_0x2a1d6a(_0x5ea9a8._0x3842d6)],_0x4cc351);_0x3c5d3e&&(this[_0x2a1d6a(0x5a1)]['image']=_0x3c5d3e);}}register$4('canvasLabel',CanvasLabelEntity,!![]);class EditCircle extends EditPoly{['bindDraggers'](){const _0x5997f5={_0x46a74d:0x5a1,_0xe5d3dc:0x5be,_0x1ecd65:0x5be,_0x165e50:0x1bc,_0x35f1b1:0xf67,_0x13c9cc:0x5a1},_0x33f9af={_0x56006:0x987},_0x180ffc={_0x321a3f:0x5a1,_0x19db75:0x1bc,_0x33052d:0xeae,_0x1d5ff1:0xfc8,_0x1b3dc6:0x264},_0xda90ec={_0x2ba797:0xdd0,_0x984909:0xdd0},_0x13c303={_0x3efb99:0x5a1,_0x2b6503:0x4ec,_0x3a0b31:0xeed,_0x5de2e5:0x163,_0x147297:0xfc8},_0x2657ef=_0x35a251,_0x4b0bf3=this['positions'],_0xf1eb42=this['updatePositionsHeightByAttr'](_0x4b0bf3[0x0]),_0x182fde=this['_map']['clock']['currentTime'],_0x1fe7f3=getEllipseOuterPositions({'position':_0xf1eb42,'semiMajorAxis':getCesiumValue(this[_0x2657ef(0x5a1)]['semiMajorAxis'],Number,_0x182fde),'semiMinorAxis':getCesiumValue(this[_0x2657ef(_0x5997f5._0x46a74d)]['semiMinorAxis'],Number,_0x182fde),'rotation':getCesiumValue(this['entityGraphic'][_0x2657ef(0xb7a)],Number,_0x182fde)??0x0,'count':0x1}),_0x469e12=this[_0x2657ef(0x7e6)](_0x1fe7f3[0x1]);_0x4b0bf3[0x1]=_0x469e12;const _0x29fcdf=this['createDragger']({'position':_0x469e12,'type':PointType[_0x2657ef(_0x5997f5._0xe5d3dc)],'tooltip':this['_map'][_0x2657ef(0x44e)](_0x2657ef(0xda8)),'onDragStart':(_0x235681,_0x53eb65)=>{const _0xc67cbc=_0x2657ef;if(!this['_heightDraggers'])return;for(let _0x4bc90a=0x0,_0x3fb8cb=this['_heightDraggers']['length'];_0x4bc90a<_0x3fb8cb;_0x4bc90a++){this['_heightDraggers'][_0x4bc90a][_0xc67cbc(0x987)]=![];}},'onDrag':(_0x164897,_0x2b6f1e)=>{const _0x2c5837=_0x2657ef;if(this['entityGraphic']['height']!==undefined){const _0x3f517c=getCesiumValue(this[_0x2c5837(_0x13c303._0x3efb99)]['height'],Number,_0x182fde);_0x2b6f1e=setPositionsHeight(_0x2b6f1e,_0x3f517c),_0x164897['position']=_0x2b6f1e;}_0x4b0bf3[_0x164897['index']]=_0x2b6f1e;const _0x479279=this[_0x2c5837(_0x13c303._0x2b6503)](Cesium__namespace['Cartesian3'][_0x2c5837(_0x13c303._0x3a0b31)](_0x4b0bf3[0x0],_0x2b6f1e),0x2);this['entityGraphic'][_0x2c5837(0x76a)]=_0x479279,this[_0x2c5837(_0x13c303._0x5de2e5)][_0x2c5837(0x657)]===0x3||!Cesium__namespace[_0x2c5837(0xaa2)](this['style']['radius'])?this[_0x2c5837(_0x13c303._0x147297)]['semiMajorAxis']=_0x479279:(this['entityGraphic']['semiMinorAxis']=_0x479279,this['style']['radius']=_0x479279),this['fire'](EventType['editStyle']);},'onDragEnd':(_0x530cf5,_0x4600b0)=>{this['updateDraggers']();}});_0x29fcdf['index']=0x1,this[_0x2657ef(0x1cf)]['push'](_0x29fcdf);let _0x4df24d;if(this['_graphic']['_maxPointNum']===0x3){const _0x3d8cf6=this['updatePositionsHeightByAttr'](_0x1fe7f3[0x0]);_0x4b0bf3[0x2]=_0x3d8cf6,_0x4df24d=this['createDragger']({'position':_0x3d8cf6,'type':PointType[_0x2657ef(_0x5997f5._0x1ecd65)],'tooltip':this['_map']['getLangText'](_0x2657ef(0xda8)),'onDragStart':(_0x43c29b,_0x5bb1a1)=>{const _0x152429=_0x2657ef;if(!this[_0x152429(_0xda90ec._0x2ba797)])return;for(let _0xa38382=0x0,_0x385bb5=this['_heightDraggers']['length'];_0xa38382<_0x385bb5;_0xa38382++){this[_0x152429(_0xda90ec._0x984909)][_0xa38382][_0x152429(0x987)]=![];}},'onDrag':(_0x5d8c06,_0x23cbfc)=>{const _0x358f59=_0x2657ef;if(this['entityGraphic'][_0x358f59(0x682)]!==undefined){const _0x31ef17=getCesiumValue(this[_0x358f59(_0x180ffc._0x321a3f)]['height'],Number,_0x182fde);_0x23cbfc=setPositionsHeight(_0x23cbfc,_0x31ef17),_0x5d8c06['position']=_0x23cbfc;}_0x4b0bf3[_0x5d8c06[_0x358f59(_0x180ffc._0x19db75)]]=_0x23cbfc;let _0x30ef3d=this[_0x358f59(0x4ec)](Cesium__namespace['Cartesian3']['distance'](_0x4b0bf3[0x0],_0x23cbfc),0x2);const _0x16874a=getCesiumValue(this['entityGraphic']['semiMajorAxis'],Number,_0x182fde);_0x30ef3d>_0x16874a&&(_0x30ef3d=_0x16874a),this['entityGraphic'][_0x358f59(_0x180ffc._0x33052d)]=_0x30ef3d,this['_graphic']['_maxPointNum']===0x3||!Cesium__namespace[_0x358f59(0xaa2)](this[_0x358f59(0xfc8)]['radius'])?this[_0x358f59(0xfc8)]['semiMinorAxis']=_0x30ef3d:(this['entityGraphic']['semiMajorAxis']=_0x30ef3d,this[_0x358f59(_0x180ffc._0x1d5ff1)]['radius']=_0x30ef3d),this[_0x358f59(_0x180ffc._0x1b3dc6)](EventType['editStyle']);},'onDragEnd':(_0x426468,_0x4476e2)=>{this['updateDraggers']();}}),_0x4df24d[_0x2657ef(_0x5997f5._0x165e50)]=0x2,this['draggers']['push'](_0x4df24d);}if(this['_graphic']['_hasMoveEdit']){const _0x433a28=this['createDragger']({'position':_0xf1eb42,'onDragStart':(_0x436bc3,_0x475dac)=>{const _0x2fb75c=_0x2657ef;for(let _0x33a5bf=0x0,_0x4328f7=this['draggers'][_0x2fb75c(0xe1e)];_0x33a5bf<_0x4328f7;_0x33a5bf++){this['draggers'][_0x33a5bf][_0x2fb75c(_0x33f9af._0x56006)]=![];}},'onDrag':(_0x2c0035,_0x111288)=>{_0x4b0bf3[0x0]=_0x111288;},'onDragEnd':(_0xe4043b,_0x471352)=>{this['updateDraggers']();}});_0x433a28['index']=0x0,this[_0x2657ef(0x1cf)]['push'](_0x433a28),_0x433a28[_0x2657ef(_0x5997f5._0x35f1b1)]=_0x29fcdf,_0x433a28['minorDragger']=_0x4df24d;}if(this[_0x2657ef(_0x5997f5._0x13c9cc)]['extrudedHeight']){const _0x1b6c70=this['_graphic']['_maxPointNum']===0x3?[_0x4b0bf3[0x1],_0x4b0bf3[0x2]]:[_0x4b0bf3[0x1]];this[_0x2657ef(0x6da)](_0x1b6c70);}}['updatePositionsHeightByAttr'](_0x30f29e){const _0x2e96e9={_0x94f498:0xc60,_0x32abda:0x5a1},_0x485620=_0x35a251;this[_0x485620(0x979)]&&(_0x30f29e=getSurfacePosition(this['_map'][_0x485620(_0x2e96e9._0x94f498)],_0x30f29e));if(this[_0x485620(_0x2e96e9._0x32abda)]['height']!==undefined){const _0x317d23=getCesiumValue(this['entityGraphic']['height'],Number,this['_map']['clock']['currentTime']);_0x30f29e=setPositionsHeight(_0x30f29e,_0x317d23);}return _0x30f29e;}['_updateStyleHook'](_0x41e1af){const _0x53d222={_0x7efa16:0x907},_0x27182f=_0x35a251;super['_updateStyleHook'](_0x41e1af),(Cesium__namespace['defined'](_0x41e1af[_0x27182f(_0x53d222._0x7efa16)])||Cesium__namespace['defined'](_0x41e1af['semiMinorAxis'])||Cesium__namespace[_0x27182f(0xaa2)](_0x41e1af['semiMajorAxis'])||Cesium__namespace['defined'](_0x41e1af['height'])||Cesium__namespace['defined'](_0x41e1af[_0x27182f(0x4f7)]))&&this['updateDraggers']();}['openSmallTooltipByMinPointNum'](_0x269f0a){}}class CircleEntity extends BasePointEntity{constructor(_0x4704b8={}){const _0x304e08={_0x571a32:0xc3b,_0x4cb544:0xe86},_0x3a06cb=_0x35a251;super(_0x4704b8),this['_minPointNum']=0x2,this['_maxPointNum']=0x2,this[_0x3a06cb(_0x304e08._0x571a32)]=_0x4704b8['hasMoveEdit']??!![],this['_clampToGround_reload']=!![],this[_0x3a06cb(_0x304e08._0x4cb544)]['drawShowRadius']=this['options']['drawShowRadius']??!![];}get['entityGraphic'](){const _0x2235a4={_0x36e965:0xedf},_0x5ef903=_0x35a251;var _0x2494f2;return(_0x2494f2=this['_entity'])===null||_0x2494f2===void 0x0?void 0x0:_0x2494f2[_0x5ef903(_0x2235a4._0x36e965)];}get['EditClass'](){return EditCircle;}get['outlinePositions'](){const _0x2f8d62={_0x585385:0x249},_0x4f6f60=_0x35a251;return this[_0x4f6f60(_0x2f8d62._0x585385)]&&(this['_outlinePositions']=this['getOutlinePositions']()),this['_outlinePositions'];}set['outlinePositions'](_0x51a037){const _0x2a0a99={_0x244ded:0x4fc},_0x14532f=_0x35a251;this[_0x14532f(_0x2a0a99._0x244ded)]=_0x51a037;}get['outlineCoordinates'](){return cartesians2lonlats(this['outlinePositions']);}get[_0x35a251(0xeed)](){return Math['PI']*0x2*this['radius'];}get['area'](){const _0x15f08a=this['radius'];return Math['PI']*_0x15f08a*_0x15f08a;}get[_0x35a251(0x907)](){const _0x11dd13=_0x35a251;var _0x58c1fc;if(this['style']['radius'])return this['style'][_0x11dd13(0x907)];return getCesiumValue((_0x58c1fc=this['entityGraphic'])===null||_0x58c1fc===void 0x0?void 0x0:_0x58c1fc['semiMajorAxis'],Number,Cesium__namespace['JulianDate'][_0x11dd13(0x23b)]());}set['radius'](_0x1d4a90){const _0x4af4d8={_0x2c894f:0x8c3},_0x1efb4f=_0x35a251;this['style'][_0x1efb4f(0x907)]=_0x1d4a90,this['entityGraphic']&&(this['entityGraphic']['semiMajorAxis']=_0x1d4a90,this['entityGraphic']['semiMinorAxis']=_0x1d4a90,this[_0x1efb4f(_0x4af4d8._0x2c894f)](this['_getOutlinePositions'](),this['style']));}get[_0x35a251(0x682)](){const _0x4d0215=_0x35a251;var _0xddc34d;if(this[_0x4d0215(0xfc8)]['height'])return this[_0x4d0215(0xfc8)]['height'];return getCesiumValue((_0xddc34d=this['entityGraphic'])===null||_0xddc34d===void 0x0?void 0x0:_0xddc34d['height'],Number)??0x0;}set['height'](_0x39e4a3){const _0x26f261={_0x229fdc:0x5a1},_0x1e217e=_0x35a251;this['style']['height']=_0x39e4a3,this['entityGraphic']&&(this[_0x1e217e(_0x26f261._0x229fdc)]['height']=_0x39e4a3);}['_mountedHook'](){const _0x261066={_0x3e2393:0xaa2,_0x130c9a:0x979,_0x3a2dd2:0xdaa},_0x2d08ba=_0x35a251,_0x2c4036={'position':this['position'],'ellipse':CircleStyleConver['toCesiumVal'](this['style'],{},!![])},_0xc3e685=this['style']['label'];_0xc3e685&&(Cesium__namespace[_0x2d08ba(_0x261066._0x3e2393)](this[_0x2d08ba(0xfc8)]['clampToGround'])&&!Cesium__namespace['defined'](_0xc3e685[_0x2d08ba(_0x261066._0x130c9a)])&&(_0xc3e685['clampToGround']=this['style'][_0x2d08ba(_0x261066._0x130c9a)]),Cesium__namespace['defined'](_0xc3e685[_0x2d08ba(_0x261066._0x3a2dd2)])||Cesium__namespace[_0x2d08ba(_0x261066._0x3e2393)](_0xc3e685['addHeight'])?this['_addLabel']():_0x2c4036['label']=LabelStyleConver['toCesiumVal'](this['style']['label'],{},this[_0x2d08ba(0x6b3)])),this['_entity']=this[_0x2d08ba(0xede)](_0x2c4036),this['_updateHeight'](),this['_updateOutlineStyle'](this['_getOutlinePositions'](),this['style']),(this['position']instanceof Cesium__namespace[_0x2d08ba(0x18a)]||this['position']instanceof Cesium__namespace['SampledPositionProperty'])&&this[_0x2d08ba(0x166)]();}['_addLabel'](){const _0x1f1e30={_0x4ec2f0:0x854},_0x451655=_0x35a251,_0x2afaab=this['style'][_0x451655(0x854)];if(Cesium__namespace['defined'](_0x2afaab['setHeight'])||Cesium__namespace['defined'](_0x2afaab['addHeight'])){var _0x4f4958;(_0x4f4958=this['_entity'])!==null&&_0x4f4958!==void 0x0&&_0x4f4958[_0x451655(_0x1f1e30._0x4ec2f0)]&&(this['_entity']['label'][_0x451655(0x987)]=![]),super['_addLabel']();}else this['_entity'][_0x451655(0x854)]=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](this['style']['label'],this['_entity']['label'],this[_0x451655(0x6b3)]);}['_style2Json'](_0x513301,_0x32ed44){return CircleStyleConver['toJSON'](_0x513301,_0x32ed44,!![]);}['toGeoJSON'](_0x5a8cb0){const _0x189ee8={_0x384b19:0x694},_0x14577b=_0x35a251;return super[_0x14577b(_0x189ee8._0x384b19)](_0x5a8cb0);}['_getGeoJsonGeometry'](_0x201ad4){const _0x6fe785=_0x35a251;return _0x201ad4!==null&&_0x201ad4!==void 0x0&&_0x201ad4['outline']?{'type':'Polygon','coordinates':[this['getOutlineCoordinates'](_0x201ad4===null||_0x201ad4===void 0x0?void 0x0:_0x201ad4['closure'],_0x201ad4===null||_0x201ad4===void 0x0?void 0x0:_0x201ad4['count'],_0x201ad4===null||_0x201ad4===void 0x0?void 0x0:_0x201ad4[_0x6fe785(0xe0c)])]}:{'type':'Point','coordinates':this['getCoordinate'](_0x201ad4===null||_0x201ad4===void 0x0?void 0x0:_0x201ad4['noAlt'])};}['_updateStyleHook'](_0x27fe5a,_0x4f4276){const _0x5cdc99={_0x12f52f:0x5a1,_0x6b045a:0x979,_0x42d8d9:0x854,_0x3b8671:0x854,_0x13fa32:0x854,_0x4bbdfa:0x987},_0x1c2506=_0x35a251;CircleStyleConver['toCesiumVal'](_0x27fe5a,this[_0x1c2506(_0x5cdc99._0x12f52f)],!![]);(Cesium__namespace[_0x1c2506(0xaa2)](_0x4f4276['diffHeight'])||Cesium__namespace['defined'](_0x4f4276['height']))&&this['_updateHeight']();if(_0x4f4276!==null&&_0x4f4276!==void 0x0&&_0x4f4276['label']){Cesium__namespace['defined'](_0x27fe5a[_0x1c2506(_0x5cdc99._0x6b045a)])&&!Cesium__namespace['defined'](_0x27fe5a[_0x1c2506(0x854)]['clampToGround'])&&(_0x27fe5a[_0x1c2506(0x854)][_0x1c2506(0x979)]=_0x27fe5a['clampToGround']);if(Cesium__namespace['defined'](_0x27fe5a[_0x1c2506(_0x5cdc99._0x42d8d9)]['setHeight'])||Cesium__namespace['defined'](_0x27fe5a[_0x1c2506(_0x5cdc99._0x3b8671)][_0x1c2506(0xa95)])){var _0x4c934e;(_0x4c934e=this['_entity'])!==null&&_0x4c934e!==void 0x0&&_0x4c934e[_0x1c2506(_0x5cdc99._0x42d8d9)]&&(this['_entity'][_0x1c2506(_0x5cdc99._0x13fa32)][_0x1c2506(_0x5cdc99._0x4bbdfa)]=![]),this['_addLabel']();}else this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](_0x27fe5a['label'],this['_entity']['label'],this['attr']);}}['_updatePositionsHook'](){const _0x579bf7={_0x10eb68:0xb61,_0x5c4efa:0xbcb,_0x3256de:0xdc9},_0xa54053=_0x35a251;this['_entity']['position']=this[_0xa54053(_0x579bf7._0x10eb68)],this['_updateHeight'](),this['_updateOutlineStyle'](this[_0xa54053(_0x579bf7._0x5c4efa)](),this['style']),this[_0xa54053(_0x579bf7._0x3256de)](),this['_updateEditDraggers']();}['_getOutlinePositions'](){return[this['outlinePositions']];}['_setPositionsToCallback'](){const _0x4be277={_0x3654df:0x894,_0x2a3f28:0x166},_0x43e479={_0x37abef:0x937},_0x494297=_0x35a251;if(this[_0x494297(_0x4be277._0x3654df)])return;this['_isCallbackPositions']=!![],this['_positions_draw']=this['positions']||[],this['position']=new Cesium__namespace['CallbackProperty'](_0x33ab1e=>{const _0x16dedd=_0x494297;if(this['_positions_draw'][_0x16dedd(0xe1e)]<0x1)return null;return this[_0x16dedd(_0x43e479._0x37abef)][0x0];},![]),this[_0x494297(_0x4be277._0x2a3f28)]();}['_cancelPositionsCallback'](){const _0x36bff2={_0x222f24:0xf44,_0x17ac4d:0x9b1},_0x5708f4=_0x35a251;if(!this[_0x5708f4(0x894)])return;this['_isCallbackPositions']=![],this['_position']=this['_positions_draw'][0x0],this[_0x5708f4(_0x36bff2._0x222f24)]=LngLatPoint[_0x5708f4(_0x36bff2._0x17ac4d)](this['_position']),this[_0x5708f4(0xedd)]();}['_updateHeight'](){const _0x5d4243=_0x35a251;var _0x2b2afb;if(this['style'][_0x5d4243(0x979)])return;let _0x2224a4=this['_position'];((_0x2b2afb=this['_positions_draw'])===null||_0x2b2afb===void 0x0?void 0x0:_0x2b2afb['length'])>0x0&&(_0x2224a4=this['_positions_draw'][0x0]);if(!_0x2224a4)return;const _0x31dd5b=this['style']['height']??LngLatPoint['fromCartesian'](_0x2224a4)[_0x5d4243(0x5d2)];this[_0x5d4243(0x5a1)]['height']=_0x31dd5b,Cesium__namespace['defined'](this[_0x5d4243(0xfc8)]['diffHeight'])&&(Cesium__namespace['defined'](this[_0x5d4243(0xfc8)]['diffHeight'])&&this['style'][_0x5d4243(0x4f7)]!==0x0?this['entityGraphic']['extrudedHeight']=_0x31dd5b+this['style']['diffHeight']:this['entityGraphic'][_0x5d4243(0x552)]=undefined),this[_0x5d4243(0x264)](EventType['editStyle']);}['_startDrawHook'](){const _0xa638e1=_0x35a251;this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this[_0xa638e1(0xd79)]['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](this[_0xa638e1(0x956)],this['_onDbClickHandler'],this),(this[_0xa638e1(0xe86)]['hasDrawDelPoint']??!![])&&this['_map']['on'](this[_0xa638e1(0xc1c)],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x5e612e={_0xe5ae77:0xfb4,_0x1611e6:0xd79,_0x222ca4:0xc1c},_0x2479f2=_0x35a251;this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['off'](EventType[_0x2479f2(_0x5e612e._0xe5ae77)],this[_0x2479f2(0x3d8)],this),this['_map']['off'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this[_0x2479f2(0xe86)]['hasDrawDelPoint']??!![])&&this[_0x2479f2(_0x5e612e._0x1611e6)][_0x2479f2(0x6b2)](this[_0x2479f2(_0x5e612e._0x222ca4)],this['_onRightClickHandler'],this);}['_showDrawMouseMoveSmallTooltip'](_0x13196a){const _0x1c1b29={_0x4add0c:0xd79,_0x20eaea:0x44e,_0x577c7a:0xdbb,_0x13b495:0xe1e},_0x40faf7=_0x35a251;if(this['_positions_draw']['length']<=0x1){this['_map'][_0x40faf7(0x771)](_0x13196a[_0x40faf7(0x37e)],this[_0x40faf7(_0x1c1b29._0x4add0c)][_0x40faf7(_0x1c1b29._0x20eaea)]('_单击开始绘制'));return;}let _0x353bd7='';if(this['options'][_0x40faf7(_0x1c1b29._0x577c7a)]&&this['_positions_draw'][_0x40faf7(_0x1c1b29._0x13b495)]>0x0&&_0x13196a[_0x40faf7(0x4bb)]){const _0x21a357=Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],_0x13196a['cartesian']);_0x21a357>0x0&&(_0x353bd7='半径:'+formatDistance(_0x21a357)+'');}this[_0x40faf7(_0x1c1b29._0x4add0c)][_0x40faf7(0x771)](_0x13196a['endPosition'],_0x353bd7+this['_map']['getLangText']('_单击完成绘制'));}[_0x35a251(0x149)](_0x5b8382){const _0x45353b={_0x2069a5:0x8eb,_0x19ce9d:0x937,_0x140f8f:0x5a1,_0x29f355:0xeae,_0x480a9d:0xfc8},_0x48ab49=_0x35a251;if(this['_positions_draw']['length']<0x2)return;this['_updateHeight']();if(!_0x5b8382){const _0x4d5f73=formatNum$1(Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],this['_positions_draw'][0x1]),0x2);if(_0x4d5f73<0x1)return;if(this['_maxPointNum']===0x3){let _0x2f2e24=_0x4d5f73,_0x2a8ae9=_0x4d5f73;this[_0x48ab49(0x937)]['length']===0x3&&(_0x2a8ae9=formatNum$1(Cesium__namespace[_0x48ab49(_0x45353b._0x2069a5)]['distance'](this[_0x48ab49(_0x45353b._0x19ce9d)][0x0],this[_0x48ab49(0x937)][0x2]),0x2));if(_0x2f2e24>_0x2a8ae9){const _0x355884=_0x2f2e24;_0x2f2e24=_0x2a8ae9,_0x2a8ae9=_0x355884;}this[_0x48ab49(_0x45353b._0x140f8f)]['semiMajorAxis']=_0x2a8ae9,this['entityGraphic'][_0x48ab49(_0x45353b._0x29f355)]=_0x2f2e24,this[_0x48ab49(0xfc8)][_0x48ab49(0x76a)]=_0x2a8ae9,this[_0x48ab49(0xfc8)]['semiMinorAxis']=_0x2f2e24;}else this['entityGraphic']['semiMajorAxis']=_0x4d5f73,this['entityGraphic'][_0x48ab49(_0x45353b._0x29f355)]=_0x4d5f73,this[_0x48ab49(_0x45353b._0x480a9d)][_0x48ab49(0x907)]=_0x4d5f73;}this['_entity_outlines']&&(this['_outlinePositions']=this['getOutlinePositions'](),this['_updateOutlineToCallback']());}['_onRightClickHandler'](_0x1890db){const _0x59ac62={_0x580f89:0x76a,_0x35f993:0x5a1,_0x9dd9f6:0xeae},_0x1a2651=_0x35a251;super['_onRightClickHandler'](_0x1890db),this['entityGraphic'][_0x1a2651(_0x59ac62._0x580f89)]=0x0,this[_0x1a2651(_0x59ac62._0x35f993)][_0x1a2651(_0x59ac62._0x9dd9f6)]=0x0,this['style'][_0x1a2651(0x907)]=0x0;}['getOutlinePositions'](_0x1f3f5f=!![],_0x248e9b){const _0x30c7ac={_0x3f4432:0x579,_0x327a25:0x76a,_0x32513b:0xedf,_0x27eff1:0x249,_0x1454bc:0xf5d},_0x5d812b=_0x35a251;var _0x4efd00,_0x13d63c,_0x2cce53,_0x14cdad;const _0x556a7d=Cesium__namespace[_0x5d812b(_0x30c7ac._0x3f4432)]['now'](),_0xbdaf7f=getEllipseOuterPositions({'position':getPositionValue(this['_entity']['position']),'semiMajorAxis':getCesiumValue((_0x4efd00=this['_entity']['ellipse'])===null||_0x4efd00===void 0x0?void 0x0:_0x4efd00[_0x5d812b(_0x30c7ac._0x327a25)],Number,_0x556a7d),'semiMinorAxis':getCesiumValue((_0x13d63c=this['_entity']['ellipse'])===null||_0x13d63c===void 0x0?void 0x0:_0x13d63c['semiMinorAxis'],Number,_0x556a7d),'rotation':getCesiumValue((_0x2cce53=this['_entity'][_0x5d812b(_0x30c7ac._0x32513b)])===null||_0x2cce53===void 0x0?void 0x0:_0x2cce53['rotation'],Number,_0x556a7d)??0x0,'granularity':getCesiumValue((_0x14cdad=this[_0x5d812b(_0x30c7ac._0x27eff1)][_0x5d812b(0xedf)])===null||_0x14cdad===void 0x0?void 0x0:_0x14cdad['granularity'],Number,_0x556a7d),'count':_0x248e9b});if(_0x1f3f5f&&_0xbdaf7f){var _0x9956c5;_0xbdaf7f['push'](_0xbdaf7f[0x0]),(this[_0x5d812b(0xfc8)][_0x5d812b(_0x30c7ac._0x1454bc)]>0x4||((_0x9956c5=this['style'][_0x5d812b(0xbbd)])===null||_0x9956c5===void 0x0?void 0x0:_0x9956c5[_0x5d812b(0xf48)])>0x4)&&_0xbdaf7f['push'](_0xbdaf7f[0x1]);}return _0xbdaf7f;}['getOutlineCoordinates'](_0xd97c52,_0x1c2f36,_0x594303){return cartesians2lonlats(this['getOutlinePositions'](_0xd97c52,_0x1c2f36),_0x594303);}[_0x35a251(0xd93)](_0x2d6bbb,_0x332f5e){const _0x8a5a08={_0x565f29:0xd96,_0x4946d0:0x581},_0x53b8a9=_0x35a251,_0x2252ca=super['_getOutlineStyle'](_0x2d6bbb,_0x332f5e);return _0x2252ca[_0x53b8a9(_0x8a5a08._0x565f29)]=Cesium__namespace[_0x53b8a9(_0x8a5a08._0x4946d0)]['RHUMB'],_0x2252ca;}['getRectangle'](_0x2640fe){const _0xa4b34=this['getOutlinePositions'](![],0x1);if(!_0xa4b34||_0xa4b34['length']===0x0)return;const _0x34c4f6=getRectangle(_0xa4b34,_0x2640fe===null||_0x2640fe===void 0x0?void 0x0:_0x2640fe['isFormat']);return _0x34c4f6;}['isInPoly'](_0x5457d8){_0x5457d8=LngLatPoint['parse'](_0x5457d8)['toCartesian'](),_0x5457d8=setPositionsHeight(_0x5457d8,this['height']);const _0x1fab00=Cesium__namespace['Cartesian3']['distance'](this['positionShow'],_0x5457d8);return _0x1fab00<=this['radius'];}['flyTo'](_0x59b5e1={}){const _0x4c32c0=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);return _0x59b5e1['radius']=this[_0x4c32c0(0x907)]*0x2*(_0x59b5e1['scale']||1.8),this[_0x4c32c0(0xd79)]['flyToPoint'](this[_0x4c32c0(0x1ba)],_0x59b5e1);}}register$4('circle',CircleEntity,!![]);class EditModel extends EditBase{get['position'](){return this['_graphic']['_position_draw'];}set['position'](_0x3de15f){this['_graphic']['_position_draw']=_0x3de15f;}['updatePositionsHeightByAttr'](_0x1fbfd7){const _0x4e164a=_0x35a251;return this[_0x4e164a(0x979)]&&(_0x1fbfd7=getSurfacePosition(this['_map']['scene'],_0x1fbfd7)),_0x1fbfd7;}['bindDraggers'](){const _0x556926={_0x2f4f04:0xed2,_0x167a50:0xfc8,_0x2b62ed:0x7e6,_0x19c130:0x3bf,_0x5d2e58:0x89b},_0x3f6034={_0x27f5fe:0x563,_0x46a192:0x1cf},_0x387ce7={_0x3821d3:0x41f,_0x35de85:0xfc8},_0x52a0ca=_0x35a251;this['_graphic'][_0x52a0ca(_0x556926._0x2f4f04)]=this['_map']['getLangText']('_拖动该点后')+'
'+this['_map'][_0x52a0ca(0x44e)]('_修改位置'),this['createDragger']({'dragger':this['_graphic'],'onDragStart':(_0x212bbf,_0x9e6bb3)=>{const _0x3dcef8=_0x52a0ca;for(let _0x2a7d27=0x0,_0x20e4dc=this['draggers']['length'];_0x2a7d27<_0x20e4dc;_0x2a7d27++){this[_0x3dcef8(0x1cf)][_0x2a7d27]['show']=![];}},'onDrag':(_0x452f3d,_0x21f962)=>{this['position']=_0x21f962;},'onDragEnd':(_0x503640,_0x452897)=>{this['updateDraggers']();}});const _0x1117e1=this[_0x52a0ca(_0x556926._0x167a50)][_0x52a0ca(0x907)],_0x1c7aac=this[_0x52a0ca(_0x556926._0x2b62ed)](this['position']),_0x26f9f9=Cesium__namespace['Cartographic'][_0x52a0ca(0x9b1)](_0x1c7aac)['height'];if(this['_hasEditHeading']){this['entityAngle']=new CircleEntity({'name':'角度调整底部圆','position':new Cesium__namespace['CallbackProperty'](_0x476758=>{return _0x1c7aac;},![]),'style':{'fill':![],'outline':!![],'outlineColor':_0x52a0ca(_0x556926._0x19c130),'outlineOpacity':0.8,'radius':_0x1117e1,'height':_0x26f9f9},'private':!![]}),this['layer']['addGraphic'](this['entityAngle']);const _0x3d9a22=getPositionByDirectionAndLen(_0x1c7aac,this['style']['heading'],_0x1117e1),_0x1dff8c=this['createDragger']({'position':_0x3d9a22,'type':PointType[_0x52a0ca(0x5be)],'tooltip':this['_map']['getLangText']('_修改方向'),'onDrag':(_0x20df26,_0x4315c9)=>{const _0x16767f=_0x52a0ca,_0x267c09=getAngle(_0x1c7aac,_0x4315c9);this['style'][_0x16767f(_0x387ce7._0x3821d3)]=formatNum$1(_0x267c09,0x2),_0x20df26['position']=getPositionByDirectionAndLen(_0x1c7aac,this['style'][_0x16767f(_0x387ce7._0x3821d3)],this[_0x16767f(_0x387ce7._0x35de85)]['radius']),this[_0x16767f(0x163)]['updateOrientation'](_0x1c7aac);}});this['draggers']['push'](_0x1dff8c);}if(this[_0x52a0ca(_0x556926._0x5d2e58)]){const _0x5da841=addPositionsHeight(_0x1c7aac,_0x1117e1),_0x1a3e43=this[_0x52a0ca(0xf01)]({'position':_0x5da841,'type':PointType['MoveHeight'],'tooltip':this['_map']['getLangText']('_修改缩放比例'),'onDragStart':(_0x392600,_0x5365c9)=>{const _0x33bb15=_0x52a0ca;this[_0x33bb15(_0x3f6034._0x27f5fe)]&&(this[_0x33bb15(_0x3f6034._0x27f5fe)]['show']=![]);for(let _0x5dcc1d=0x0,_0x35f3ca=this['draggers'][_0x33bb15(0xe1e)];_0x5dcc1d<_0x35f3ca;_0x5dcc1d++){this[_0x33bb15(_0x3f6034._0x46a192)][_0x5dcc1d]['show']=![];}},'onDrag':(_0x31d208,_0x58e4ac)=>{const _0xa84537=_0x52a0ca,_0x46af6c=Cesium__namespace['Cartesian3']['distance'](_0x58e4ac,_0x1c7aac),_0x9c1c43=_0x31d208[_0xa84537(0x907)]/(this[_0xa84537(0xfc8)]['scale']||0x1);let _0x26d8d2=formatNum$1(_0x46af6c/_0x9c1c43,0x3);if(isNaN(_0x26d8d2))return;_0x26d8d2<=0x0&&(_0x26d8d2=0.001),this['style'][_0xa84537(0x1cb)]=_0x26d8d2,this['entityGraphic'][_0xa84537(0x1cb)]=_0x26d8d2,_0x31d208['radius']=_0x46af6c,this['style']['radius']=_0x46af6c;},'onDragEnd':(_0x70fe57,_0x4802fa)=>{this['updateDraggers'](),this['fire'](EventType['editStyle']);}});_0x1a3e43['radius']=_0x1117e1,this['draggers']['push'](_0x1a3e43);}}['destroyDraggers'](){const _0x58fa0c={_0x37a326:0x87,_0x1de0c7:0x563},_0x491793=_0x35a251;super[_0x491793(0x758)](),this['entityAngle']&&(this[_0x491793(_0x58fa0c._0x37a326)]['removeGraphic'](this[_0x491793(_0x58fa0c._0x1de0c7)],!![]),delete this[_0x491793(_0x58fa0c._0x1de0c7)]);}['getDraggerContextMenu'](_0x1cb544){const _0x3b3c12={_0xfc1d0a:0xd79,_0x26af63:0x44e,_0x2e8fbe:0x163,_0x298a55:0xe86},_0x34d9c4={_0x521f4a:0xe87},_0x1aec82={_0x1dfdc2:0x648,_0x19b32a:0xe87},_0x3b96ef=_0x35a251,_0x4158ce=super['getDraggerContextMenu'](_0x1cb544);return(this['style']['hasEditRotate']??!![])&&(_0x4158ce['push']({'text':this[_0x3b96ef(_0x3b3c12._0xfc1d0a)][_0x3b96ef(_0x3b3c12._0x26af63)]('_按轴旋转'),'icon':Icon['BloomEffectYes'],'show':_0x1ccbb6=>{const _0x6c1412=_0x3b96ef;return!this['_matrixRotate']||this[_0x6c1412(0xab7)]['_dragger_index']!==_0x1cb544['index'];},'callback':_0x5625e3=>{const _0x46306c=_0x3b96ef;this['entityAngle']&&(this['layer']['removeGraphic'](this['entityAngle'],!![]),delete this['entityAngle'],this[_0x46306c(0xd5b)]=![],this['updateDraggers']()),this[_0x46306c(0x936)](_0x5625e3['graphic'],_0x5625e3);}}),_0x4158ce[_0x3b96ef(0x6de)]({'text':this[_0x3b96ef(0xd79)]['getLangText'](_0x3b96ef(0xc16)),'icon':Icon[_0x3b96ef(0xe8a)],'show':_0x11b425=>{const _0x1e842f=_0x3b96ef;return this[_0x1e842f(0xab7)]&&this['_matrixRotate']['_dragger_index']===_0x1cb544['index'];},'callback':_0x3fc729=>{this['stopRotateMatrix']();}})),!Cesium__namespace['defined'](this['_hasEditHeading'])&&(this[_0x3b96ef(0xd5b)]=this[_0x3b96ef(_0x3b3c12._0x2e8fbe)][_0x3b96ef(_0x3b3c12._0x298a55)]['hasEditHeading']??![]),_0x4158ce['push']({'text':'编辑方向','icon':Icon['DrawCircle'],'show':_0x500b2a=>{return!this['_hasEditHeading'];},'callback':_0x2ceaf7=>{const _0x41d223=_0x3b96ef;this[_0x41d223(_0x1aec82._0x1dfdc2)](),this['_hasEditHeading']=!![],this[_0x41d223(_0x1aec82._0x19b32a)]();}}),_0x4158ce['push']({'text':_0x3b96ef(0xa8d),'icon':Icon['DrawCircle'],'show':_0x5784a8=>{const _0x422e8f=_0x3b96ef;return this[_0x422e8f(0xd5b)];},'callback':_0x36b1c9=>{this['_hasEditHeading']=![],this['updateDraggers']();}}),!Cesium__namespace['defined'](this['_hasEditScale'])&&(this[_0x3b96ef(0x89b)]=this['_graphic']['options']['hasEditScale']??![]),_0x4158ce['push']({'text':this['_map']['getLangText']('_调整比例'),'icon':Icon['UndergroundYes'],'show':_0x2089fa=>{return!this['_hasEditScale'];},'callback':_0x1db0be=>{this['_hasEditScale']=!![],this['updateDraggers']();}}),_0x4158ce['push']({'text':this['_map']['getLangText']('_停止调整比例'),'icon':Icon[_0x3b96ef(0x41c)],'show':_0x2788a6=>{return this['_hasEditScale'];},'callback':_0x54bc28=>{const _0x205506=_0x3b96ef;this['_hasEditScale']=![],this[_0x205506(_0x34d9c4._0x521f4a)]();}}),_0x4158ce;}['finish'](){const _0xe9f450={_0x493679:0x163},_0x298944=_0x35a251;delete this['_graphic'][_0x298944(0xed2)],delete this['_graphic']['_isDragger'],delete this[_0x298944(0x163)]['_noMousePick'],delete this['_graphic'][_0x298944(0x392)],delete this[_0x298944(_0xe9f450._0x493679)]['onDrag'],this['_graphic']['unbindContextMenu']();}}class ModelEntity extends BasePointEntity{constructor(_0x14c182={}){const _0x4c3128={_0x3adfc1:0xfc8},_0x1c881d=_0x35a251;_0x14c182['drawShow']=_0x14c182['drawShow']??!![],super(_0x14c182),this[_0x1c881d(0xfc8)][_0x1c881d(0x907)]=this[_0x1c881d(_0x4c3128._0x3adfc1)][_0x1c881d(0x907)]??0x32,this[_0x1c881d(0x4ac)]=Cesium__namespace['defer']();}get['entityGraphic'](){var _0x934eb0;return(_0x934eb0=this['_entity'])===null||_0x934eb0===void 0x0?void 0x0:_0x934eb0['model'];}get['EditClass'](){return EditModel;}get['scale'](){const _0x297aa7={_0x8b2aa2:0xfc8},_0x3dbbf3=_0x35a251;return this[_0x3dbbf3(_0x297aa7._0x8b2aa2)]['scale']??0x1;}set['scale'](_0x61c91f){this['style']['scale']=_0x61c91f,this['_updateStyleHook'](this['style'],{'scale':_0x61c91f});}get['readyPromise'](){const _0x2a699e={_0x38b7ab:0xa78},_0x171ecd=_0x35a251;return this['_readyPromise'][_0x171ecd(_0x2a699e._0x38b7ab)];}['_mountedHook'](){const _0x4e3bbf={_0x225bcc:0xb71,_0x20b57f:0xd05,_0x3dc02e:0x440,_0x565730:0xaa2,_0x3a3a68:0xc04,_0x1486a5:0xa06,_0x4de6a8:0x39c,_0x541427:0xe1e,_0x18dbaf:0xe26,_0x213934:0xfc8,_0x50d4ef:0x1ba,_0x361710:0x393,_0x2f47b6:0xcc3,_0x48cd2b:0x9c2,_0x1b1bd6:0xfc8},_0x36047b={_0x812021:0x907},_0x36ab7a=_0x35a251,_0x490aa7={'occlusion':this[_0x36ab7a(0xfc8)]['marsOcclusion']};isMars3DCesium&&(this[_0x36ab7a(_0x4e3bbf._0x225bcc)]=![],this[_0x36ab7a(0xed2)]=this['_map']['getLangText']('_加载模型中'),this['fire'](EventType[_0x36ab7a(0xae1)],{'url':this['options']['url']}),_0x490aa7['callback']=(_0x5f0fec,_0x124717)=>{const _0x236f68=_0x36ab7a;delete this['_draw_tooltip'],this['loadOk']=!![],this['_model']=_0x124717,_0x124717['boundingSphere']['radius']<(this['style'][_0x236f68(0x910)],0x3e8)&&(this['style']['radius']=_0x124717['boundingSphere'][_0x236f68(_0x36047b._0x812021)]),this['fire'](EventType['load'],{'drawtype':this['type'],'entity':_0x5f0fec,'model':_0x124717,'graphic':this},!![]),this['_readyPromise'][_0x236f68(0xc74)](this);});const _0x266341={'position':this['position'],'orientation':this['getOrientation'](),'model':ModelStyleConver['toCesiumVal'](this['style'],{},!![])};!_0x266341['model'][_0x36ab7a(0x867)]&&this['options'][_0x36ab7a(_0x4e3bbf._0x20b57f)]&&(_0x266341[_0x36ab7a(_0x4e3bbf._0x3dc02e)]['uri']=this[_0x36ab7a(0xe86)][_0x36ab7a(0xd05)],_0x266341['model']['show']=!![]);const _0x360b2d=this['style']['label'];_0x360b2d&&(Cesium__namespace['defined'](this['style']['clampToGround'])&&!Cesium__namespace[_0x36ab7a(_0x4e3bbf._0x565730)](_0x360b2d['clampToGround'])&&(_0x360b2d['clampToGround']=this['style']['clampToGround']),Cesium__namespace['defined'](_0x360b2d['setHeight'])||Cesium__namespace['defined'](_0x360b2d['addHeight'])?this['_addLabel']():_0x266341['label']=LabelStyleConver[_0x36ab7a(0xc04)](this['style']['label'],{},this['attr']));this['options']['billboard']&&(_0x266341['billboard']=BillboardStyleConver[_0x36ab7a(_0x4e3bbf._0x3a3a68)](this['options']['billboard'],{},!![]));this[_0x36ab7a(0xe86)]['point']&&(_0x266341['point']=PointStyleConver[_0x36ab7a(_0x4e3bbf._0x3a3a68)](this['options']['point'],{},!![]));this['options'][_0x36ab7a(0xd6d)]&&(_0x266341['ellipse']=CircleStyleConver['toCesiumVal'](this[_0x36ab7a(0xe86)][_0x36ab7a(0xd6d)],{},!![]));if(this['options']['path']){var _0x143966,_0xdb4663;const _0xeb0e0b=PathStyleConver['toCesiumVal'](this['options'][_0x36ab7a(_0x4e3bbf._0x1486a5)],{},!![]);!_0xeb0e0b[_0x36ab7a(0x47b)]&&(_0xeb0e0b['leadTime']=0x0);_0x266341[_0x36ab7a(0xa06)]=_0xeb0e0b;const _0x2afc7f=(_0x143966=this['position'])===null||_0x143966===void 0x0?void 0x0:(_0xdb4663=_0x143966[_0x36ab7a(0xb4f)])===null||_0xdb4663===void 0x0?void 0x0:_0xdb4663[_0x36ab7a(_0x4e3bbf._0x4de6a8)];if(_0x2afc7f&&_0x2afc7f[_0x36ab7a(_0x4e3bbf._0x541427)]>0x0){var _0x28faa1;const _0x325c55=_0x2afc7f[0x0];let _0x3ec916=_0x2afc7f[_0x2afc7f['length']-0x1];((_0x28faa1=this['position'])===null||_0x28faa1===void 0x0?void 0x0:_0x28faa1[_0x36ab7a(_0x4e3bbf._0x18dbaf)])===Cesium__namespace[_0x36ab7a(0xe0a)]['HOLD']&&(_0x3ec916=Cesium__namespace['JulianDate'][_0x36ab7a(0xa51)](new Date(0x834,0x1,0x1))),_0x266341['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x325c55,'stop':_0x3ec916})]);}}if(this['style']['distanceDisplayCondition']){if(this[_0x36ab7a(_0x4e3bbf._0x213934)][_0x36ab7a(0xeba)])_0x266341[_0x36ab7a(_0x4e3bbf._0x50d4ef)]=PointStyleConver['toCesiumVal'](this['style']['distanceDisplayPoint']),_0x266341['point'][_0x36ab7a(_0x4e3bbf._0x361710)]=this['_getTargetDistanceDisplayCondition'](this['style']['distanceDisplayPoint']);else this[_0x36ab7a(0xfc8)][_0x36ab7a(_0x4e3bbf._0x2f47b6)]&&(_0x266341['billboard']=BillboardStyleConver[_0x36ab7a(_0x4e3bbf._0x3a3a68)](this[_0x36ab7a(_0x4e3bbf._0x213934)][_0x36ab7a(0xcc3)]),_0x266341[_0x36ab7a(_0x4e3bbf._0x48cd2b)]['distanceDisplayCondition']=this['_getTargetDistanceDisplayCondition'](this[_0x36ab7a(_0x4e3bbf._0x1b1bd6)]['distanceDisplayBillboard']));}_0x266341['model']['marsOptions']=_0x490aa7,this['_entity']=this['_createEntity'](_0x266341);}['_removedHook'](){const _0x21a1de=_0x35a251;this[_0x21a1de(0x62c)](),super['_removedHook']();}[_0x35a251(0x1e0)](_0xc0bea2,_0x537ed2){const _0x3927f1={_0xfb5889:0xcc3,_0x50634a:0xfc8,_0x14305f:0xcc3},_0x2f18a4=_0x35a251,_0x9c3f4e=ModelStyleConver[_0x2f18a4(0x99e)](_0xc0bea2,_0x537ed2,!![]);if(this['style']['distanceDisplayPoint'])_0x9c3f4e['distanceDisplayPoint']=PointStyleConver['toJSON'](this['style']['distanceDisplayPoint'],{},!![]);else this[_0x2f18a4(0xfc8)]['distanceDisplayBillboard']&&(_0x9c3f4e[_0x2f18a4(_0x3927f1._0xfb5889)]=BillboardStyleConver['toJSON'](this[_0x2f18a4(_0x3927f1._0x50634a)][_0x2f18a4(_0x3927f1._0x14305f)],{},!![]));return _0x9c3f4e;}[_0x35a251(0x6a1)](_0x48a103,_0x4518ce){const _0x21d0dd={_0x4a12af:0xd05,_0x53f048:0x249,_0x39778a:0x854},_0x5e04bf=_0x35a251;_0x4518ce!==null&&_0x4518ce!==void 0x0&&_0x4518ce['url']&&(this['loadOk']=![],this[_0x5e04bf(0x5a1)][_0x5e04bf(0x4a2)]=![],this['fire'](EventType['loadBefore'],{'url':_0x4518ce===null||_0x4518ce===void 0x0?void 0x0:_0x4518ce[_0x5e04bf(_0x21d0dd._0x4a12af)]}));this['_entity']['orientation']=this[_0x5e04bf(0x3e7)](),ModelStyleConver[_0x5e04bf(0xc04)](_0x48a103,this['entityGraphic'],!![]);if(_0x4518ce!==null&&_0x4518ce!==void 0x0&&_0x4518ce['label']){Cesium__namespace[_0x5e04bf(0xaa2)](_0x48a103['clampToGround'])&&!Cesium__namespace['defined'](_0x48a103['label']['clampToGround'])&&(_0x48a103['label']['clampToGround']=_0x48a103['clampToGround']);if(Cesium__namespace['defined'](_0x48a103['label']['setHeight'])||Cesium__namespace['defined'](_0x48a103[_0x5e04bf(0x854)]['addHeight'])){var _0x4da70d;(_0x4da70d=this[_0x5e04bf(_0x21d0dd._0x53f048)])!==null&&_0x4da70d!==void 0x0&&_0x4da70d[_0x5e04bf(_0x21d0dd._0x39778a)]&&(this['_entity']['label']['show']=![]),this['_addLabel']();}else this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](_0x48a103['label'],this['_entity']['label'],this['attr']);}}[_0x35a251(0xedd)](){const _0xb2cde5={_0x238825:0xe26},_0x367129=_0x35a251;super['_updatePositionsHook']();if(this['_entity']['path']){var _0x47253c,_0x226a46;const _0x1b199b=(_0x47253c=this['position'])===null||_0x47253c===void 0x0?void 0x0:(_0x226a46=_0x47253c[_0x367129(0xb4f)])===null||_0x226a46===void 0x0?void 0x0:_0x226a46['_times'];if(_0x1b199b&&_0x1b199b['length']>0x0){var _0x4c59f9;const _0xc86ed9=_0x1b199b[0x0];let _0x573f4a=_0x1b199b[_0x1b199b['length']-0x1];((_0x4c59f9=this['position'])===null||_0x4c59f9===void 0x0?void 0x0:_0x4c59f9[_0x367129(_0xb2cde5._0x238825)])===Cesium__namespace[_0x367129(0xe0a)]['HOLD']&&(_0x573f4a=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),this['_entity'][_0x367129(0xf60)]=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace[(_0x367129(0x425))]({'start':_0xc86ed9,'stop':_0x573f4a})]);}}}[_0x35a251(0xbfc)](_0x47a134,_0x1d5033){const _0x420fb5={_0x56a23b:0x249,_0x4b3c5c:0xc04,_0x301fc0:0x249,_0x454966:0xa06},_0x56a9e2=_0x35a251;_0x1d5033['billboard']&&BillboardStyleConver['toCesiumVal'](_0x47a134['billboard'],this[_0x56a9e2(_0x420fb5._0x56a23b)]['billboard'],!![]),_0x1d5033['point']&&PointStyleConver[_0x56a9e2(_0x420fb5._0x4b3c5c)](_0x47a134['point'],this[_0x56a9e2(0x249)][_0x56a9e2(0x1ba)],!![]),_0x1d5033[_0x56a9e2(0xa06)]&&(PathStyleConver['toCesiumVal'](_0x47a134['path'],this['_entity']['path'],!![]),!_0x47a134['path'][_0x56a9e2(0x47b)]&&(this[_0x56a9e2(_0x420fb5._0x301fc0)][_0x56a9e2(_0x420fb5._0x454966)]['leadTime']=0x0)),_0x1d5033['circle']&&CircleStyleConver[_0x56a9e2(0xc04)](_0x47a134['circle'],this['_entity']['ellipse'],!![]);}[_0x35a251(0x4d5)](_0x3d553e){const _0x21a0d4={_0x16ad13:0x9c2,_0x2fd397:0x1ba},_0x2602d1=_0x35a251;this['options']['billboard']&&(_0x3d553e['billboard']={},BillboardStyleConver['toJSON'](this['options']['billboard'],_0x3d553e[_0x2602d1(_0x21a0d4._0x16ad13)],!![])),this['options'][_0x2602d1(0x1ba)]&&(_0x3d553e['point']={},PointStyleConver['toJSON'](this['options'][_0x2602d1(_0x21a0d4._0x2fd397)],_0x3d553e['point'],!![])),this['options']['path']&&(_0x3d553e['path']={},PathStyleConver['toJSON'](this['options']['path'],_0x3d553e['path'],!![])),this[_0x2602d1(0xe86)]['circle']&&(_0x3d553e['circle']={},CircleStyleConver['toJSON'](this['options']['circle'],_0x3d553e['circle'],!![]));}['_addLabel'](){const _0x452a9c={_0x4b82c0:0x987,_0x40cb88:0x86a,_0x369b4f:0xc04,_0x49328d:0x6b3},_0x35ab94=_0x35a251,_0x4544b2=this['style']['label'];if(Cesium__namespace['defined'](_0x4544b2[_0x35ab94(0xdaa)])||Cesium__namespace['defined'](_0x4544b2[_0x35ab94(0xa95)])){var _0x30c769;(_0x30c769=this['_entity'])!==null&&_0x30c769!==void 0x0&&_0x30c769['label']&&(this['_entity']['label'][_0x35ab94(_0x452a9c._0x4b82c0)]=![]),super[_0x35ab94(_0x452a9c._0x40cb88)]();}else this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver[_0x35ab94(_0x452a9c._0x369b4f)](this['style']['label'],this['_entity']['label'],this[_0x35ab94(_0x452a9c._0x49328d)]);}['updateAttrForDrawing'](_0x3b9e53){}['_updateDistanceDisplayConditionByEdit'](){}['_getTargetDistanceDisplayCondition'](_0x2de82c){const _0x3222f4={_0x2c5590:0xf8a,_0x471ebd:0xfc8,_0x2b4097:0xe56,_0x5d32cc:0x9e1},_0x2fac9b=_0x35a251;let _0x2e0336;if(this['style']['distanceDisplayCondition']instanceof Cesium__namespace['DistanceDisplayCondition'])_0x2e0336=this['style']['distanceDisplayCondition'][_0x2fac9b(_0x3222f4._0x2c5590)];else this[_0x2fac9b(_0x3222f4._0x471ebd)][_0x2fac9b(0xe56)]&&(_0x2e0336=this[_0x2fac9b(_0x3222f4._0x471ebd)]['distanceDisplayCondition_far']);return new Cesium__namespace['DistanceDisplayCondition']((_0x2de82c['distanceDisplayCondition_near'],_0x2e0336),(_0x2de82c[_0x2fac9b(_0x3222f4._0x2b4097)],Number[_0x2fac9b(_0x3222f4._0x5d32cc)]));}['getHeadingPitchRoll'](){const _0x54c509={_0x1ca545:0x18b,_0x106c7c:0xd3f,_0x6db543:0x653},_0xcc4bce=_0x35a251,_0x3caf65=this['_map']['clock'][_0xcc4bce(_0x54c509._0x1ca545)],_0x50244a=this[_0xcc4bce(0x95f)],_0x5e96a3=Cesium__namespace[_0xcc4bce(0xd17)][_0xcc4bce(_0x54c509._0x106c7c)](this['_entity']['orientation'],_0x3caf65,new Cesium__namespace[(_0xcc4bce(_0x54c509._0x6db543))]()),_0x4e3e00=getHeadingPitchRollByOrientation(_0x50244a,_0x5e96a3);return _0x4e3e00;}[_0x35a251(0x443)](_0x55fd2f={}){const _0x2cee5e={_0x5f45b6:0xccc,_0x384c4b:0x41f},_0x589579={_0x24f43f:0x3f4},_0x43918a=_0x35a251;this['_isRotateStart']&&this['rotateStop'](),this[_0x43918a(_0x2cee5e._0x5f45b6)]=_0x55fd2f['direction']?0x1:-0x1,this['_rotateAngle']=0x168/(0x3c*(_0x55fd2f['time']||0x3c)),this[_0x43918a(0x944)]=_0x55fd2f['autoStopAngle'],this['_rotateHpr']=this[_0x43918a(0x843)](),this[_0x43918a(0x3d1)]=this['_rotateHpr'][_0x43918a(_0x2cee5e._0x384c4b)],this['_tikRender']=0x0,this['_isRotateStart']=!![],this['entity']['orientation']=new Cesium__namespace['CallbackProperty'](_0x54db65=>{const _0x73b6b3=_0x43918a;var _0x44a8f5,_0x5168be;const _0x83353=getPositionValue(this['position'],_0x54db65);return Cesium__namespace[_0x73b6b3(0x49c)][_0x73b6b3(0x711)](_0x83353,this['_rotateHpr'],(_0x44a8f5=this[_0x73b6b3(0xd79)])===null||_0x44a8f5===void 0x0?void 0x0:(_0x5168be=_0x44a8f5['scene'])===null||_0x5168be===void 0x0?void 0x0:_0x5168be['globe'][_0x73b6b3(_0x589579._0x24f43f)]);},![]),this[_0x43918a(0xd79)]['on'](EventType[_0x43918a(0xb65)],this['_rotate_onPreRenderHandler'],this);}['_rotate_onPreRenderHandler'](_0x4aa7de){const _0x5f0d6c={_0x23f931:0x7ba,_0x6e1928:0xccc},_0x2e5310=_0x35a251;if(!this['_map'])return;this[_0x2e5310(0xa5)]++;const _0x9d5900=this['_tikRender']*this['_rotateAngle'];if(this['_rotateAutoStopAngle']&&_0x9d5900>=this['_rotateAutoStopAngle']){this['rotateStop']();return;}const _0xa6d854=Cesium__namespace['Math'][_0x2e5310(_0x5f0d6c._0x23f931)](_0x9d5900*this[_0x2e5310(_0x5f0d6c._0x6e1928)])+this['_startHeading'];this[_0x2e5310(0x92a)]['heading']=_0xa6d854;}['rotateStop'](){const _0x5bf7ae={_0x1d09a9:0xc9f,_0x44804f:0x92a,_0x43a91c:0xa5},_0x30bbfd=_0x35a251;if(!this['_isRotateStart'])return;this[_0x30bbfd(_0x5bf7ae._0x1d09a9)]=![],this['_map']['off'](EventType['preRender'],this[_0x30bbfd(0x126)],this),this['heading']=Cesium__namespace['Math']['toDegrees'](this[_0x30bbfd(_0x5bf7ae._0x44804f)]['heading']),delete this['_rotateDirection'],delete this['_rotateAngle'],delete this['_rotateAutoStopAngle'],delete this[_0x30bbfd(0x92a)],delete this['_startHeading'],delete this[_0x30bbfd(_0x5bf7ae._0x43a91c)];}['moveTo'](_0x444b4b){const _0x3392d2={_0x47a1f5:0xa17,_0x19c8a3:0xe0a,_0x347edd:0x651,_0xd07a90:0xe15,_0x11a556:0x42d};return new Promise((_0x296eda,_0x2f3278)=>{const _0x5c1135=_0x2767,_0xe07fe6=new Cesium__namespace[(_0x5c1135(_0x3392d2._0x47a1f5))]();_0xe07fe6['forwardExtrapolationType']=Cesium__namespace[_0x5c1135(_0x3392d2._0x19c8a3)]['HOLD'];const _0x246f36=this['_map'][_0x5c1135(0x42d)]['currentTime']['clone'](),_0x344385=this[_0x5c1135(0x95f)];_0xe07fe6[_0x5c1135(_0x3392d2._0x347edd)](_0x246f36,_0x344385);const _0x40f8e3=LngLatPoint['parse'](_0x444b4b['position'])[_0x5c1135(0xa43)](),_0x42086a=_0x444b4b[_0x5c1135(_0x3392d2._0xd07a90)]||0x5,_0x523fc0=Cesium__namespace['JulianDate']['addSeconds'](_0x246f36,_0x42086a,new Cesium__namespace['JulianDate']());_0xe07fe6['addSample'](_0x523fc0,_0x40f8e3),this['_entity']['position']=_0xe07fe6;const _0x53ac12=this['_map'][_0x5c1135(_0x3392d2._0x11a556)]['multiplier'];this['_map']['clock']['shouldAnimate']=!![],this['_map']['clock']['multiplier']=_0x444b4b['speed']||0x1,setTimeout(()=>{const _0x4fdb0f=_0x5c1135;if(!this[_0x4fdb0f(0xd79)])return;this['position']=_0x40f8e3,this['_map'][_0x4fdb0f(0x42d)]['multiplier']=_0x53ac12,_0x444b4b['onEnd']&&_0x444b4b['onEnd'](),_0x296eda(this);},_0x42086a*0x3e8);});}['_getPopupPosition'](){return this['_entity']['position'];}['flyTo'](_0x1f141b={}){const _0x4b5b0e={_0x3647bc:0x907},_0x570c6b=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);return!Cesium__namespace['defined'](_0x1f141b['radius'])&&(_0x1f141b['radius']=this[_0x570c6b(0xfc8)][_0x570c6b(_0x4b5b0e._0x3647bc)]*0x2*(_0x1f141b['scale']||1.8)),this['_map']['flyToPoint'](this['point'],_0x1f141b);}['setOpacity'](_0x5bab62){const _0x43c175={_0x2d13ed:0xfc8,_0x271c8c:0x45c},_0x5d645a=_0x35a251;this[_0x5d645a(_0x43c175._0x2d13ed)]['globalAlpha']=_0x5bab62,this['_entity']&&(ModelStyleConver[_0x5d645a(_0x43c175._0x271c8c)](this['entityGraphic'],_0x5bab62),this['_updateLabelOpacity'](_0x5bab62));}}register$4('model',ModelEntity,!![]);class EditBox extends EditBase{get['position'](){return this['_graphic']['_position_draw'];}set['position'](_0x1e55c6){const _0x33b57f={_0x1b4a6b:0x163},_0x30199c=_0x35a251;this[_0x30199c(_0x33b57f._0x1b4a6b)]['_position_draw']=_0x1e55c6;}['bindDraggers'](){const _0x4a3f6e={_0x22ef0c:0x7ba,_0x226742:0x5be,_0x5bdebd:0xcc5},_0x187de0={_0x45dbbc:0x8eb,_0x238d91:0x264},_0x5cbc17={_0x4bcae7:0x8eb},_0x17d04b={_0x1c3c47:0x682},_0x555efc={_0x248e1f:0xb61,_0x1994df:0x4af},_0x1f99c8=_0x35a251,_0x391871=this['style'];let _0x50a43a;const _0x7432f8=this['position'];_0x50a43a=this['createDragger']({'position':_0x7432f8,'onDrag':(_0x4b12f5,_0x130c16)=>{const _0x321d0f=_0x2767,_0x239cf3=Cesium__namespace['Cartesian3']['subtract'](_0x130c16,this[_0x321d0f(_0x555efc._0x248e1f)],new Cesium__namespace['Cartesian3']());this['position']=_0x130c16;for(let _0x4d8375=0x0,_0x5bb477=this[_0x321d0f(0x1cf)]['length'];_0x4d8375<_0x5bb477;_0x4d8375++){if(this['draggers'][_0x4d8375]===_0x4b12f5)continue;this['draggers'][_0x4d8375][_0x321d0f(_0x555efc._0x248e1f)]=Cesium__namespace['Cartesian3'][_0x321d0f(_0x555efc._0x1994df)](this['draggers'][_0x4d8375]['position'],_0x239cf3,new Cesium__namespace[(_0x321d0f(0x8eb))]());}}}),this['draggers'][_0x1f99c8(0x6de)](_0x50a43a);const _0x571cc9=Cesium__namespace['Math'][_0x1f99c8(_0x4a3f6e._0x22ef0c)](this['_graphic']['heading']),_0x1d7b44=Cesium__namespace['Math']['toRadians'](this['_graphic']['pitch']),_0x144c3a=Cesium__namespace['Math']['toRadians'](this['_graphic']['roll']),_0x1cc748=new Cesium__namespace['HeadingPitchRoll'](_0x571cc9,_0x1d7b44,_0x144c3a),_0x532f76=getPositionByHprAndOffset(_0x7432f8,new Cesium__namespace['Cartesian3'](_0x391871['dimensions_x']/0x2,0x0,0x0),_0x1cc748);_0x50a43a=this['createDragger']({'position':_0x532f76,'type':PointType[_0x1f99c8(_0x4a3f6e._0x226742)],'tooltip':this['_map']['getLangText']('_修改长度'),'onDrag':(_0x3b04ac,_0x432fa9)=>{const _0x33d2f7=_0x1f99c8,_0x2e3a05=Cesium__namespace['Cartographic']['fromCartesian'](this['position'])[_0x33d2f7(_0x17d04b._0x1c3c47)];_0x432fa9=setPositionsHeight(_0x432fa9,_0x2e3a05),_0x3b04ac['position']=_0x432fa9;const _0x4725f2=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](this['position'],_0x432fa9),0x2);_0x391871['dimensions_x']=_0x4725f2*0x2,this['updateBox'](_0x391871),this['fire'](EventType['editStyle']);},'onDragEnd':(_0xc9360e,_0x383910)=>{this['updateDraggers']();}}),this['draggers']['push'](_0x50a43a);const _0x793b3=getPositionByHprAndOffset(_0x7432f8,new Cesium__namespace['Cartesian3'](0x0,_0x391871['dimensions_y']/0x2,0x0),_0x1cc748);_0x50a43a=this[_0x1f99c8(0xf01)]({'position':_0x793b3,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText'](_0x1f99c8(_0x4a3f6e._0x5bdebd)),'onDrag':(_0x3f8ff0,_0x52dcf9)=>{const _0x30588c=_0x1f99c8,_0xce81f7=Cesium__namespace['Cartographic']['fromCartesian'](_0x7432f8)['height'];_0x52dcf9=setPositionsHeight(_0x52dcf9,_0xce81f7),_0x3f8ff0['position']=_0x52dcf9;const _0x31cfe4=this['formatNum'](Cesium__namespace[_0x30588c(_0x5cbc17._0x4bcae7)][_0x30588c(0xeed)](this['position'],_0x52dcf9),0x2);_0x391871['dimensions_y']=_0x31cfe4*0x2,this['updateBox'](_0x391871),this['fire'](EventType['editStyle']);},'onDragEnd':(_0x3a39ea,_0x4f6e9c)=>{this['updateDraggers']();}}),this['draggers'][_0x1f99c8(0x6de)](_0x50a43a);const _0x130507=getPositionByHprAndOffset(_0x7432f8,new Cesium__namespace['Cartesian3'](0x0,0x0,_0x391871['dimensions_z']/0x2),_0x1cc748);_0x50a43a=this['createDragger']({'position':_0x130507,'type':PointType['MoveHeight'],'tooltip':this['_map'][_0x1f99c8(0x44e)]('_修改高度'),'onDrag':(_0x13c60c,_0x35908b)=>{const _0x27b797=_0x1f99c8,_0x1996a8=this['formatNum'](Cesium__namespace[_0x27b797(_0x187de0._0x45dbbc)]['distance'](this['position'],_0x35908b),0x2);_0x391871['dimensions_z']=_0x1996a8*0x2,this['updateBox'](_0x391871),this[_0x27b797(_0x187de0._0x238d91)](EventType[_0x27b797(0x53d)]);},'onDragEnd':(_0x54b07c,_0xddd9ae)=>{const _0x1d7f8d=_0x1f99c8;this[_0x1d7f8d(0xe87)]();}}),this['draggers']['push'](_0x50a43a);}[_0x35a251(0x13d)](_0x4dee5e){const _0x3f34e5={_0x28e1e0:0x926,_0x4b7170:0x6ea},_0x287f80=_0x35a251,_0x4b605e=new Cesium__namespace['Cartesian3'](_0x4dee5e['dimensions_x'],_0x4dee5e['dimensions_y'],_0x4dee5e[_0x287f80(_0x3f34e5._0x28e1e0)]);this['entityGraphic'][_0x287f80(_0x3f34e5._0x4b7170)][_0x287f80(0x90f)](_0x4b605e);}[_0x35a251(0x6a1)](_0x3c885b){const _0x1f5cda={_0x1ba843:0x6a1},_0x2d9623=_0x35a251;super[_0x2d9623(_0x1f5cda._0x1ba843)](_0x3c885b),(Cesium__namespace['defined'](_0x3c885b[_0x2d9623(0x26a)])||Cesium__namespace['defined'](_0x3c885b['dimensions_y'])||Cesium__namespace['defined'](_0x3c885b['dimensions_z']))&&this[_0x2d9623(0xe87)]();}}class BoxEntity extends BasePointEntity{get['entityGraphic'](){const _0x57a91c=_0x35a251;var _0x1c9513;return(_0x1c9513=this['_entity'])===null||_0x1c9513===void 0x0?void 0x0:_0x1c9513[_0x57a91c(0xe50)];}get['EditClass'](){return EditBox;}['_mountedHook'](){const _0x5c4a57={_0x227a9a:0xb61,_0x30ac5d:0x3e7},_0x224599=_0x35a251,_0x314443={'position':this[_0x224599(_0x5c4a57._0x227a9a)],'orientation':this[_0x224599(_0x5c4a57._0x30ac5d)](),'box':BoxStyleConver['toCesiumVal'](this[_0x224599(0xfc8)],{},!![])};this[_0x224599(0x249)]=this['_createEntity'](_0x314443),this['style']['label']&&this['_addLabel']();}['_style2Json'](_0x4fc7d9,_0x333ef6){return BoxStyleConver['toJSON'](_0x4fc7d9,_0x333ef6,!![]);}['_updateStyleHook'](_0x1b313f,_0x1b41d2){const _0x106a1d={_0x5d3e95:0x8fd},_0x22c58f=_0x35a251;_0x1b41d2&&(Cesium__namespace[_0x22c58f(0xaa2)](_0x1b41d2['heading'])||Cesium__namespace['defined'](_0x1b41d2[_0x22c58f(0x527)])||Cesium__namespace['defined'](_0x1b41d2['roll']))&&(this['_entity'][_0x22c58f(_0x106a1d._0x5d3e95)]=this['getOrientation']()),BoxStyleConver['toCesiumVal'](_0x1b313f,this['entityGraphic'],!![]);}['_setPositionsToCallback'](){const _0x4ee964={_0x313689:0xd79,_0xd534bd:0x26a},_0x45be4f=_0x35a251;super['_setPositionsToCallback']();const _0x49ea39=getCesiumValue(this['entityGraphic']['dimensions'],Number,this[_0x45be4f(_0x4ee964._0x313689)]['clock']['currentTime']);this['style'][_0x45be4f(_0x4ee964._0xd534bd)]=this['style'][_0x45be4f(_0x4ee964._0xd534bd)]??_0x49ea39['x'],this['style']['dimensions_y']=this['style']['dimensions_y']??_0x49ea39['y'],this['style']['dimensions_z']=this[_0x45be4f(0xfc8)]['dimensions_z']??_0x49ea39['z'],delete this['style']['dimensions'];}}register$4('box',BoxEntity,!![]);class EditPlane extends EditBase{get['position'](){const _0x15e716={_0xd6ef9f:0x163},_0x192ce2=_0x35a251;return this[_0x192ce2(_0x15e716._0xd6ef9f)]['_position_draw'];}set['position'](_0x198102){const _0x31f9cd={_0x5be00b:0x1d0},_0x4fb27e=_0x35a251;this['_graphic'][_0x4fb27e(_0x31f9cd._0x5be00b)]=_0x198102;}['bindDraggers'](){const _0x256e8d={_0x5796aa:0xfc8,_0x36e12f:0x7c0,_0x57091f:0x7ba,_0x285306:0x26a,_0x1c2718:0xb3b,_0x221517:0x6de,_0x101f01:0xeb,_0x51417c:0xeb,_0x43c4ed:0xe2a},_0x28ee9e={_0x17ca41:0xb61,_0x45d5b8:0xa42},_0xc16b1e={_0x1b90e3:0xeed,_0x1c1041:0xa42},_0xc06fd3={_0x2832a0:0x1cf,_0x330198:0x1cf},_0x1f2bb6=_0x35a251,_0x342223=this[_0x1f2bb6(_0x256e8d._0x5796aa)];let _0x47daa7;const _0x33af28=this['position'];_0x47daa7=this['createDragger']({'position':_0x33af28,'onDrag':(_0x1915f4,_0x21aee0)=>{const _0x19130d=_0x1f2bb6,_0x590866=Cesium__namespace['Cartesian3']['subtract'](_0x21aee0,this['position'],new Cesium__namespace['Cartesian3']());this['position']=_0x21aee0;for(let _0x3f735c=0x0,_0x193406=this['draggers']['length'];_0x3f735c<_0x193406;_0x3f735c++){if(this[_0x19130d(_0xc06fd3._0x2832a0)][_0x3f735c]===_0x1915f4)continue;this[_0x19130d(_0xc06fd3._0x330198)][_0x3f735c]['position']=Cesium__namespace['Cartesian3']['add'](this['draggers'][_0x3f735c]['position'],_0x590866,new Cesium__namespace['Cartesian3']());}}}),this['draggers']['push'](_0x47daa7);const _0x34e8f2=Cesium__namespace[_0x1f2bb6(_0x256e8d._0x36e12f)][_0x1f2bb6(_0x256e8d._0x57091f)](this['_graphic'][_0x1f2bb6(0x41f)]),_0x250229=Cesium__namespace['Math'][_0x1f2bb6(_0x256e8d._0x57091f)](this['_graphic']['pitch']),_0x7901e1=Cesium__namespace['Math']['toRadians'](this[_0x1f2bb6(0x163)][_0x1f2bb6(0xba7)]),_0x524784=new Cesium__namespace['HeadingPitchRoll'](_0x34e8f2,_0x250229,_0x7901e1),_0x1f4566=new Cesium__namespace['Cartesian3']();switch(_0x342223['plane_normal']){case'x':_0x1f4566['y']=_0x342223[_0x1f2bb6(_0x256e8d._0x285306)]/0x2;break;default:_0x1f4566['x']=_0x342223['dimensions_x']/0x2;break;}_0x47daa7=this['createDragger']({'position':getPositionByHprAndOffset(_0x33af28,_0x1f4566,_0x524784),'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改长度'),'onDrag':(_0x58c995,_0x1260a4)=>{const _0x49b54f=_0x1f2bb6,_0x5ade37=Cesium__namespace['Cartographic']['fromCartesian'](this['position'])['height'];_0x1260a4=setPositionsHeight(_0x1260a4,_0x5ade37),_0x58c995['position']=_0x1260a4;const _0x1ee9f7=this['formatNum'](Cesium__namespace[_0x49b54f(0x8eb)]['distance'](this['position'],_0x1260a4),0x2);_0x342223[_0x49b54f(0x26a)]=_0x1ee9f7*0x2,this['updatePlane'](_0x342223);},'onDragEnd':(_0x174ccc,_0x216888)=>{this['updateDraggers']();}}),this['draggers'][_0x1f2bb6(0x6de)](_0x47daa7);if(_0x342223[_0x1f2bb6(_0x256e8d._0x1c2718)]==='z')_0x47daa7=this[_0x1f2bb6(0xf01)]({'position':getPositionByHprAndOffset(_0x33af28,new Cesium__namespace['Cartesian3'](0x0,_0x342223['dimensions_y']/0x2,0x0),_0x524784),'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText'](_0x1f2bb6(0xcc5)),'onDrag':(_0x56147d,_0x1243b4)=>{const _0x3e75b5=_0x1f2bb6,_0x1a8cfd=Cesium__namespace['Cartographic']['fromCartesian'](this['position'])['height'];_0x1243b4=setPositionsHeight(_0x1243b4,_0x1a8cfd),_0x56147d['position']=_0x1243b4;const _0x356455=this['formatNum'](Cesium__namespace['Cartesian3'][_0x3e75b5(_0xc16b1e._0x1b90e3)](this['position'],_0x1243b4),0x2);_0x342223['dimensions_y']=_0x356455*0x2,this[_0x3e75b5(_0xc16b1e._0x1c1041)](_0x342223);},'onDragEnd':(_0x4a897a,_0x47ffae)=>{this['updateDraggers']();}}),this['draggers'][_0x1f2bb6(_0x256e8d._0x221517)](_0x47daa7);else{const _0x76813e={'x':0x0,'y':0x0,'z':0x0};switch(_0x342223['plane_normal']){case'x':case'y':_0x76813e['z']=_0x342223[_0x1f2bb6(_0x256e8d._0x101f01)]/0x2;break;default:_0x76813e['y']=_0x342223[_0x1f2bb6(_0x256e8d._0x51417c)]/0x2;break;}_0x47daa7=this[_0x1f2bb6(0xf01)]({'position':getPositionByHprAndOffset(_0x33af28,_0x76813e,_0x524784),'type':PointType[_0x1f2bb6(_0x256e8d._0x43c4ed)],'tooltip':this['_map']['getLangText']('_修改宽度'),'onDrag':(_0x44d559,_0x282d56)=>{const _0x8964a3=_0x1f2bb6,_0x39d2a1=this['formatNum'](Cesium__namespace['Cartesian3'][_0x8964a3(0xeed)](this[_0x8964a3(_0x28ee9e._0x17ca41)],_0x282d56),0x2);_0x342223['dimensions_y']=_0x39d2a1*0x2,this[_0x8964a3(_0x28ee9e._0x45d5b8)](_0x342223);},'onDragEnd':(_0x401cf2,_0x3077a8)=>{this['updateDraggers']();}}),this['draggers']['push'](_0x47daa7);}}['updatePlane'](_0x32ce56){const _0x5d8f2b={_0x1f52b3:0x6ea},_0x4fa22c=_0x35a251,_0x505003=new Cesium__namespace['Cartesian2'](_0x32ce56['dimensions_x'],_0x32ce56['dimensions_y']);this[_0x4fa22c(0x5a1)][_0x4fa22c(_0x5d8f2b._0x1f52b3)][_0x4fa22c(0x90f)](_0x505003),this['fire'](EventType[_0x4fa22c(0x53d)]);}['_updateStyleHook'](_0x59c27d){super['_updateStyleHook'](_0x59c27d),(Cesium__namespace['defined'](_0x59c27d['dimensions_x'])||Cesium__namespace['defined'](_0x59c27d['dimensions_y']))&&this['updateDraggers']();}}class PlaneEntity extends BasePointEntity{get['entityGraphic'](){const _0x5bee5b={_0x435431:0x249},_0x290cfb=_0x35a251;var _0x675510;return(_0x675510=this[_0x290cfb(_0x5bee5b._0x435431)])===null||_0x675510===void 0x0?void 0x0:_0x675510['plane'];}get['EditClass'](){return EditPlane;}['_mountedHook'](){const _0x4b5678={_0x154969:0xb61},_0x24ed31=_0x35a251,_0x3e5fda={'position':this[_0x24ed31(_0x4b5678._0x154969)],'orientation':this['getOrientation'](),'plane':PlaneStyleConver['toCesiumVal'](this['style'],{},!![])};this['_entity']=this['_createEntity'](_0x3e5fda),this['style']['label']&&this['_addLabel']();}['_style2Json'](_0x48386c,_0x24557d){return PlaneStyleConver['toJSON'](_0x48386c,_0x24557d,!![]);}[_0x35a251(0x6a1)](_0x2df60f,_0x4a16f9){const _0x467e7e={_0x4c0093:0x5a1},_0x5653ee=_0x35a251;_0x4a16f9&&(Cesium__namespace['defined'](_0x4a16f9['heading'])||Cesium__namespace['defined'](_0x4a16f9['pitch'])||Cesium__namespace['defined'](_0x4a16f9['roll']))&&(this['_entity']['orientation']=this[_0x5653ee(0x3e7)]()),PlaneStyleConver['toCesiumVal'](_0x2df60f,this[_0x5653ee(_0x467e7e._0x4c0093)],!![]);}['_setPositionsToCallback'](){const _0x301faa={_0x52b5e1:0x42d,_0x4d44c9:0x5a1,_0x1fd6a9:0xd79,_0x485798:0x387},_0x2f4dbd=_0x35a251;super['_setPositionsToCallback']();const _0x9bef7a=getCesiumValue(this[_0x2f4dbd(0x5a1)][_0x2f4dbd(0x6ea)],Cesium__namespace['Cartesian2'],this[_0x2f4dbd(0xd79)][_0x2f4dbd(_0x301faa._0x52b5e1)]['currentTime']);_0x9bef7a&&PlaneStyleConver['toOneJson']('dimensions',_0x9bef7a,this[_0x2f4dbd(0xfc8)]);const _0x70f556=getCesiumValue(this[_0x2f4dbd(_0x301faa._0x4d44c9)]['plane'],Cesium__namespace[_0x2f4dbd(0xefc)],this[_0x2f4dbd(_0x301faa._0x1fd6a9)]['clock']['currentTime']);_0x70f556&&PlaneStyleConver['toOneJson'](_0x2f4dbd(_0x301faa._0x485798),_0x70f556,this['style']);}}register$4(_0x35a251(0x387),PlaneEntity,!![]);class EditCylinder extends EditPoly{[_0x35a251(0x53e)](){const _0x36de08={_0x58874d:0xb35,_0xbff72f:0xfc8,_0x4836f2:0xb7a,_0x3a95fc:0x6de,_0x15f6e4:0xd79},_0x2a218e={_0x397734:0x1bc,_0x4a8873:0x8eb,_0x4cb217:0xfc8},_0x45f577={_0x291084:0x53d},_0xd9d524=_0x35a251,_0x4f020b=this[_0xd9d524(_0x36de08._0x58874d)],_0xabbb0e=_0x4f020b[0x0];let _0x970bbd=0x0;const _0x52210e=this['createDragger']({'position':_0xabbb0e,'onDragStart':(_0x5de991,_0x492fb9)=>{for(let _0x3c713a=0x0,_0x3b390e=this['draggers']['length'];_0x3c713a<_0x3b390e;_0x3c713a++){this['draggers'][_0x3c713a]['show']=![];}},'onDrag':(_0x300024,_0x585c17)=>{_0x4f020b[0x0]=_0x585c17;},'onDragEnd':(_0x4efec0,_0x11fea9)=>{this['updateDraggers']();}});_0x52210e['index']=_0x970bbd,this['draggers']['push'](_0x52210e);const _0x43a45a=getEllipseOuterPositions({'position':_0xabbb0e,'semiMajorAxis':this['style']['bottomRadius'],'semiMinorAxis':this[_0xd9d524(0xfc8)]['bottomRadius'],'rotation':Cesium__namespace['Math']['toRadians'](Number(this[_0xd9d524(_0x36de08._0xbff72f)][_0xd9d524(_0x36de08._0x4836f2)]||0x0))});_0x970bbd=0x1;const _0x4e5c22=_0x43a45a[0x0];_0x4f020b[_0x970bbd]=_0x4e5c22;const _0x3eac30=this['createDragger']({'position':_0x4e5c22,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改半径'),'onDrag':(_0x1ff62e,_0x11c2e3)=>{const _0x23ffbf=_0xd9d524;_0x4f020b[0x1]=_0x11c2e3;const _0x3a4bc0=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](_0x4f020b[0x0],_0x11c2e3),0x2);this['style']['bottomRadius']=_0x3a4bc0,this[_0x23ffbf(0x264)](EventType[_0x23ffbf(_0x45f577._0x291084)]);},'onDragEnd':(_0x4a0a30,_0x4ea2ee)=>{this['updateDraggers']();}});_0x3eac30['index']=_0x970bbd,this['draggers'][_0xd9d524(_0x36de08._0x3a95fc)](_0x3eac30),_0x970bbd=0x2;const _0x3fe5e1=addPositionsHeight(_0xabbb0e,this['style']['length']);_0x4f020b[_0x970bbd]=_0x3fe5e1;const _0x3584ae=this[_0xd9d524(0xf01)]({'position':_0x3fe5e1,'type':PointType['MoveHeight'],'tooltip':this[_0xd9d524(_0x36de08._0x15f6e4)]['getLangText']('_修改高度'),'onDrag':(_0x40d192,_0x5d8cac)=>{const _0xc985ef=_0xd9d524;_0x4f020b[_0x40d192[_0xc985ef(_0x2a218e._0x397734)]]=_0x5d8cac;const _0x38424a=this['formatNum'](Cesium__namespace[_0xc985ef(_0x2a218e._0x4a8873)]['distance'](_0x4f020b[0x0],_0x5d8cac),0x2);this[_0xc985ef(_0x2a218e._0x4cb217)]['length']=_0x38424a,this['fire'](EventType['editStyle']);},'onDragEnd':(_0x3063de,_0x3bcf7e)=>{this['updateDraggers']();}});_0x3584ae['index']=_0x970bbd,this[_0xd9d524(0x1cf)]['push'](_0x3584ae);}['_updateStyleHook'](_0x26df21){const _0x221729={_0x3b5727:0x6a1},_0x27e0f3=_0x35a251;super[_0x27e0f3(_0x221729._0x3b5727)](_0x26df21),(Cesium__namespace['defined'](_0x26df21['topRadius'])||Cesium__namespace['defined'](_0x26df21[_0x27e0f3(0x9b3)])||Cesium__namespace['defined'](_0x26df21['length'])||Cesium__namespace['defined'](_0x26df21['diffHeight']))&&this[_0x27e0f3(0xe87)]();}}class CylinderEntity extends BasePointEntity{constructor(_0x21d0d4={}){super(_0x21d0d4),this['_minPointNum']=0x2,this['_maxPointNum']=0x2;}get['entityGraphic'](){const _0x40d421={_0x228c70:0x249,_0x31887f:0xb07},_0xfe8fa2=_0x35a251;var _0x4407ca;return(_0x4407ca=this[_0xfe8fa2(_0x40d421._0x228c70)])===null||_0x4407ca===void 0x0?void 0x0:_0x4407ca[_0xfe8fa2(_0x40d421._0x31887f)];}get['EditClass'](){return EditCylinder;}['_mountedHook'](){const _0x18bc06=_0x35a251;this['_entity']=this['_createEntity'](this['_getCreateEntityAttr']()),this['style'][_0x18bc06(0x854)]&&this[_0x18bc06(0x86a)]();}['_getCreateEntityAttr'](){const _0x434db3=_0x35a251,_0x4cbd75={'position':this[_0x434db3(0xb61)],'orientation':this['getOrientation'](),'cylinder':CylinderStyleConver[_0x434db3(0xc04)](this['style'],{},!![])};return _0x4cbd75;}[_0x35a251(0x1e0)](_0x656d2,_0x3676ee){return CylinderStyleConver['toJSON'](_0x656d2,_0x3676ee,!![]);}['_updateStyleHook'](_0x48fa85,_0x16cf9){const _0x49182c={_0x8524fd:0xc04,_0xf33323:0x5a1,_0x4bdf94:0xaa2,_0xde919d:0xba7},_0x44f9d2=_0x35a251;CylinderStyleConver[_0x44f9d2(_0x49182c._0x8524fd)](_0x48fa85,this[_0x44f9d2(_0x49182c._0xf33323)],{},!![]);(Cesium__namespace[_0x44f9d2(_0x49182c._0x4bdf94)](_0x16cf9[_0x44f9d2(0x41f)])||Cesium__namespace['defined'](_0x16cf9['pitch'])||Cesium__namespace[_0x44f9d2(0xaa2)](_0x16cf9[_0x44f9d2(_0x49182c._0xde919d)]))&&(this['_entity'][_0x44f9d2(0x8fd)]=this['getOrientation']());if(Cesium__namespace['defined'](_0x16cf9['length'])||Cesium__namespace['defined'](_0x16cf9['diffHeight'])){var _0x26a750;((_0x26a750=this['_positions_draw'])===null||_0x26a750===void 0x0?void 0x0:_0x26a750['length'])>0x0&&(this['_position_show']=addPositionsHeight(this['_positions_draw'][0x0],_0x48fa85['length']/0x2));}}['_updatePositionsHook'](){const _0x4900a4=_0x35a251;var _0xf9170a,_0x3b3904;(_0xf9170a=this['editing'])!==null&&_0xf9170a!==void 0x0&&_0xf9170a['enabled']&&((_0x3b3904=this[_0x4900a4(0x937)])===null||_0x3b3904===void 0x0?void 0x0:_0x3b3904['length'])>0x0&&(this['_position_show']=addPositionsHeight(this['_positions_draw'][0x0],this['style'][_0x4900a4(0xe1e)]/0x2)),super['_updatePositionsHook']();}['_setPositionsToCallback'](){const _0x4a6507={_0x508a29:0x18b,_0x4f6a73:0x5a1,_0x164462:0xb6,_0x1f3aa2:0xe1e,_0x153525:0xb35,_0x321a15:0xb61,_0x10efae:0xfc8,_0x4737f9:0x937},_0x3947f9={_0xd855ab:0x9b3},_0x1e66e1=_0x35a251;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];const _0x345633=this['_map'][_0x1e66e1(0x42d)][_0x1e66e1(_0x4a6507._0x508a29)];this['style']['topRadius']=getCesiumValue(this['entityGraphic']['topRadius'],Number,_0x345633),this[_0x1e66e1(_0x4a6507._0x4f6a73)][_0x1e66e1(_0x4a6507._0x164462)]=new Cesium__namespace['CallbackProperty'](_0x23a5c8=>{return this['style']['topRadius'];},![]),this['style']['bottomRadius']=getCesiumValue(this['entityGraphic'][_0x1e66e1(0x9b3)],Number,_0x345633),this['entityGraphic']['bottomRadius']=new Cesium__namespace['CallbackProperty'](_0x346dd1=>{const _0x456516=_0x1e66e1;return this['style'][_0x456516(_0x3947f9._0xd855ab)];},![]),this['style']['length']=getCesiumValue(this[_0x1e66e1(0x5a1)]['length'],Number,_0x345633),this['entityGraphic'][_0x1e66e1(_0x4a6507._0x1f3aa2)]=new Cesium__namespace['CallbackProperty'](_0x159b06=>{return this['style']['length'];},![]),this['position']?(this['_positions_draw']=this[_0x1e66e1(_0x4a6507._0x153525)],this[_0x1e66e1(0x937)][0x0]=addPositionsHeight(this[_0x1e66e1(_0x4a6507._0x321a15)],-this[_0x1e66e1(_0x4a6507._0x10efae)]['length']/0x2)):this[_0x1e66e1(_0x4a6507._0x4737f9)]=[],this['_position_show']=this[_0x1e66e1(0xb61)],this['position']=new Cesium__namespace['CallbackProperty'](_0x2e2015=>{return this['_position_show'];},![]);}[_0x35a251(0x736)](){const _0x1e6814={_0x13116b:0xe1e,_0x50d130:0xfc8,_0xb47954:0xedd},_0x214f41=_0x35a251;if(!this['_isCallbackPositions'])return;this['_isCallbackPositions']=![],this[_0x214f41(0x5a1)][_0x214f41(_0x1e6814._0x13116b)]=this['style']['length'],this['entityGraphic']['topRadius']=this[_0x214f41(_0x1e6814._0x50d130)]['topRadius'],this['entityGraphic']['bottomRadius']=this[_0x214f41(0xfc8)]['bottomRadius'],this[_0x214f41(0xdb7)]=this['_position_show'],this['_point']=LngLatPoint['fromCartesian'](this['_position']),this[_0x214f41(_0x1e6814._0xb47954)]();}[_0x35a251(0xe4d)](){const _0x4e04b4={_0x1fd6d3:0xd79,_0x16b9c5:0x3b4,_0x1e50ec:0xd79},_0x83f45d=_0x35a251;this[_0x83f45d(_0x4e04b4._0x1fd6d3)]['on'](EventType['mouseMove'],this[_0x83f45d(_0x4e04b4._0x16b9c5)],this),this[_0x83f45d(_0x4e04b4._0x1e50ec)]['on'](EventType[_0x83f45d(0xfb4)],this[_0x83f45d(0x3d8)],this),this['_map']['on'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this[_0x83f45d(0xe86)][_0x83f45d(0x9c4)]??!![])&&this['_map']['on'](this['_drawDelEventType'],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x28f56f={_0x17bf9d:0x6b2,_0x119c31:0x971,_0x206e74:0xd79},_0x38d3ce=_0x35a251;this['_map'][_0x38d3ce(_0x28f56f._0x17bf9d)](EventType[_0x38d3ce(_0x28f56f._0x119c31)],this['_onMouseMoveHandler'],this),this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this[_0x38d3ce(_0x28f56f._0x206e74)]['off'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this['options']['hasDrawDelPoint']??!![])&&this['_map']['off'](this['_drawDelEventType'],this['_onRightClickHandler'],this);}[_0x35a251(0x149)](_0xfb3c17){const _0x42eeef={_0x51b9c8:0x937},_0x57c821=_0x35a251;this['_position_show']=addPositionsHeight(this['_positions_draw'][0x0],this['style']['length']/0x2);if(!_0xfb3c17&&this[_0x57c821(_0x42eeef._0x51b9c8)]['length']>0x1){const _0x5d4d1d=formatNum$1(Cesium__namespace[_0x57c821(0x8eb)]['distance'](this[_0x57c821(_0x42eeef._0x51b9c8)][0x0],this['_positions_draw'][0x1]),0x2);this['style']['bottomRadius']=_0x5d4d1d,this['style']['length']=_0x5d4d1d*0x2;}}['_onRightClickHandler'](_0x42f234){const _0x421370={_0x47e91f:0xfc8},_0x5c2116=_0x35a251;super['_onRightClickHandler'](_0x42f234),this['style']['bottomRadius']=0x0,this[_0x5c2116(_0x421370._0x47e91f)]['length']=0x0;}}register$4('cylinder',CylinderEntity,!![]);class ConeTrack extends CylinderEntity{constructor(_0x31592b={}){const _0xf476ea=_0x35a251;super(_0x31592b),_0x31592b[_0xf476ea(0x4cd)]&&(this['targetPosition']=_0x31592b['targetPosition']);}get['hasEdit'](){return![];}get['EditClass'](){return undefined;}get['targetPosition'](){return this['_targetPosition'];}set['targetPosition'](_0x7a158c){const _0x3df9b3={_0x37206c:0xb46,_0x1ce910:0xa43},_0xd442db=_0x35a251;this['_targetPoint']=LngLatPoint['parse'](_0x7a158c),this[_0xd442db(0x739)]=this[_0xd442db(_0x3df9b3._0x37206c)][_0xd442db(_0x3df9b3._0x1ce910)]();}get['targetPoint'](){return this['_targetPoint'];}get[_0x35a251(0x2c9)](){return this['style']['angle'];}set['angle'](_0x2ad14d){this['style']['angle']=_0x2ad14d;}['_mountedHook'](){super['_mountedHook'](),this['_updateDistanceDisplayConditionByEdit']();}[_0x35a251(0xc85)](){const _0x30aabe={_0x25b414:0xaa2,_0x2a47b2:0x894},_0x41a684={_0x4b4a6f:0xcd0},_0x5588e8=_0x35a251,_0x120f35=super['_getCreateEntityAttr']();return _0x120f35['position']=new Cesium__namespace[(_0x5588e8(0x18a))](_0x353e62=>{const _0x3da6c8=_0x5588e8;return this[_0x3da6c8(0x1dd)](_0x353e62),this[_0x3da6c8(_0x41a684._0x4b4a6f)];},![]),_0x120f35['orientation']=new Cesium__namespace['CallbackProperty'](_0x39cfc1=>{return this['_orientation'];},![]),_0x120f35['cylinder'][_0x5588e8(0xe1e)]=new Cesium__namespace['CallbackProperty'](_0x26d0a0=>{return this['_cylinderLength'];},![]),!Cesium__namespace[_0x5588e8(_0x30aabe._0x25b414)](_0x120f35['cylinder']['topRadius'])&&(_0x120f35['cylinder']['topRadius']=0x0),Cesium__namespace['defined'](this['style']['angle'])&&(_0x120f35['cylinder'][_0x5588e8(0x9b3)]=new Cesium__namespace['CallbackProperty'](_0x3c507a=>{return this['_cylinderBottomRadius'];},![])),this[_0x5588e8(_0x30aabe._0x2a47b2)]=!![],_0x120f35;}['_update'](_0x5942e9){const _0x3c5388={_0x55886d:0xcd0,_0x106ea5:0x711,_0x10ed24:0x972,_0x495ab6:0x49c,_0x55be99:0xfc8,_0x285ad4:0xc66},_0x1cb2a5=_0x35a251,_0x34acf8=getPositionValue(this[_0x1cb2a5(0xb61)],_0x5942e9);if(!_0x34acf8){this[_0x1cb2a5(_0x3c5388._0x55886d)]=undefined;return;}if(Cesium__namespace['defined'](this[_0x1cb2a5(0x4cd)])){const _0x5afdee=getPositionValue(this['targetPosition'],_0x5942e9);_0x5afdee&&(this[_0x1cb2a5(0x972)]=Cesium__namespace['Cartesian3'][_0x1cb2a5(0xeed)](_0x34acf8,_0x5afdee),this['_cylinderPosition']=Cesium__namespace['Cartesian3']['midpoint'](_0x34acf8,_0x5afdee,new Cesium__namespace['Cartesian3']()),this['_orientation']=Cesium__namespace['Transforms'][_0x1cb2a5(_0x3c5388._0x106ea5)](_0x5afdee,getHeadingPitchRollForLine(_0x5afdee,_0x34acf8)));}else{this[_0x1cb2a5(_0x3c5388._0x10ed24)]=this['style']['length'];if(!this['_cylinderLength']){const _0x52e60f=LngLatPoint['parse'](_0x34acf8);this[_0x1cb2a5(0x972)]=_0x52e60f[_0x1cb2a5(0x5d2)]-getHeight(this['_map']['scene'],_0x52e60f,{'has3dtiles':![]});}const _0x240b95=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math'][_0x1cb2a5(0x7ba)](this['heading']),Cesium__namespace['Math']['toRadians'](this[_0x1cb2a5(0x527)]),Cesium__namespace[_0x1cb2a5(0x7c0)]['toRadians'](this[_0x1cb2a5(0xba7)]));this['_orientation']=Cesium__namespace[_0x1cb2a5(_0x3c5388._0x495ab6)]['headingPitchRollQuaternion'](_0x34acf8,_0x240b95),this['_cylinderPosition']=getPositionByHprAndLen(_0x34acf8,_0x240b95,this['_cylinderLength']/0x2);}Cesium__namespace['defined'](this[_0x1cb2a5(_0x3c5388._0x55be99)]['angle'])&&(this[_0x1cb2a5(_0x3c5388._0x285ad4)]=this[_0x1cb2a5(0x972)]*Math['cos'](Cesium__namespace['Math']['toRadians'](0x5a-this['angle'])));}['_updatePositionsHook'](){}}register$4(_0x35a251(0x842),ConeTrack);class EditEllipsoid extends EditBase{['bindDraggers'](){const _0x12aad6={_0x360071:0xe86,_0x2cd4fe:0x7c0,_0x2fec09:0x6de},_0x23c016={_0x35fcbc:0x8eb,_0x5eccbe:0x163},_0x3df2e0={_0x2b3afe:0x8eb,_0x51e9cd:0x264},_0x3cf388={_0x3ca135:0xb35,_0x575e18:0x4ec,_0x5ee084:0x870},_0x1570d2=_0x35a251;let _0x35cbe6;const _0x5d85ee=this['positions'][0x0];_0x35cbe6=this['createDragger']({'position':_0x5d85ee,'onDragStart':(_0x598d7c,_0x1548f3)=>{for(let _0x2b21ae=0x0,_0x28e2dd=this['draggers']['length'];_0x2b21ae<_0x28e2dd;_0x2b21ae++){this['draggers'][_0x2b21ae]['show']=![];}},'onDrag':(_0x1af789,_0x4f04a2)=>{this['positions'][0x0]=_0x4f04a2;},'onDragEnd':(_0xb168ee,_0x283854)=>{this['updateDraggers']();}}),_0x35cbe6['index']=0x0,this[_0x1570d2(0x1cf)]['push'](_0x35cbe6);const _0x486221=this['_graphic'][_0x1570d2(_0x12aad6._0x360071)]['hasEditRadii']??!![];if(_0x486221){_0x35cbe6=this['createDragger']({'position':addPositionsHeight(_0x5d85ee,this['style']['radii_z']),'type':PointType['MoveHeight'],'tooltip':this['_map']['getLangText'](_0x1570d2(0xda8)),'onDrag':(_0x4bf9a7,_0x215dda)=>{const _0x3f37e6=_0x1570d2,_0x5cd6b7=this[_0x3f37e6(_0x3cf388._0x3ca135)][0x0],_0xfbdc71=this[_0x3f37e6(_0x3cf388._0x575e18)](Cesium__namespace[_0x3f37e6(0x8eb)]['distance'](_0x5cd6b7,_0x215dda),0x2);this[_0x3f37e6(0xfc8)]['radii_z']=_0xfbdc71,this['_graphic'][_0x3f37e6(_0x3cf388._0x5ee084)](this['style']),this['fire'](EventType['editStyle']);}}),this['draggers']['push'](_0x35cbe6);const _0x5bb2a3=getEllipseOuterPositions({'position':_0x5d85ee,'semiMajorAxis':Number(this[_0x1570d2(0xfc8)]['radii_x']),'semiMinorAxis':Number(this['style']['radii_y']),'rotation':Cesium__namespace[_0x1570d2(_0x12aad6._0x2cd4fe)]['toRadians'](Number(this[_0x1570d2(0xfc8)]['rotation']||0x0))}),_0x492002=_0x5bb2a3[0x0],_0xfaf0f=this[_0x1570d2(0xf01)]({'position':_0x492002,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改半径'),'onDrag':(_0x32c5b5,_0x34b768)=>{const _0x509429=_0x1570d2,_0x4a8353=this['positions'][0x0],_0x491901=Cesium__namespace['Cartographic']['fromCartesian'](_0x4a8353)['height'];_0x34b768=setPositionsHeight(_0x34b768,_0x491901),_0x32c5b5['position']=_0x34b768;const _0x1f2613=this['formatNum'](Cesium__namespace[_0x509429(_0x3df2e0._0x2b3afe)]['distance'](_0x4a8353,_0x34b768),0x2);this[_0x509429(0xfc8)]['radii_y']=_0x1f2613,this['_graphic']['updateRadii'](this['style']),this[_0x509429(_0x3df2e0._0x51e9cd)](EventType['editStyle']);}});_0x35cbe6['majorDragger']=_0xfaf0f,this['draggers'][_0x1570d2(_0x12aad6._0x2fec09)](_0xfaf0f);const _0x1c2130=_0x5bb2a3[0x1],_0x247e15=this['createDragger']({'position':_0x1c2130,'type':PointType['EditAttr'],'tooltip':this[_0x1570d2(0xd79)]['getLangText']('_修改半径'),'onDrag':(_0x2e41c9,_0xa6fa1a)=>{const _0x187377=_0x1570d2,_0x497bbc=this['positions'][0x0],_0x1bf675=Cesium__namespace[_0x187377(0x120)]['fromCartesian'](_0x497bbc)[_0x187377(0x682)];_0xa6fa1a=setPositionsHeight(_0xa6fa1a,_0x1bf675),_0x2e41c9[_0x187377(0xb61)]=_0xa6fa1a;const _0x305d4c=this['formatNum'](Cesium__namespace[_0x187377(_0x23c016._0x35fcbc)]['distance'](_0x497bbc,_0xa6fa1a),0x2);this['style']['radii_x']=_0x305d4c,this[_0x187377(_0x23c016._0x5eccbe)]['updateRadii'](this['style']),this['fire'](EventType['editStyle']);}});_0x35cbe6[_0x1570d2(0xd10)]=_0x247e15,this['draggers']['push'](_0x247e15);}}['_updateStyleHook'](_0x3f7703){const _0x240272={_0x45093f:0xaa2},_0x46c59b=_0x35a251;super['_updateStyleHook'](_0x3f7703),(Cesium__namespace[_0x46c59b(_0x240272._0x45093f)](_0x3f7703['radii_x'])||Cesium__namespace['defined'](_0x3f7703['radii_y'])||Cesium__namespace['defined'](_0x3f7703['radii_z']))&&this[_0x46c59b(0xe87)]();}}class EllipsoidEntity extends BasePointEntity{constructor(_0x179bd3={}){const _0x5c6dcc=_0x35a251;super(_0x179bd3),this[_0x5c6dcc(0x920)]=0x2,this['_maxPointNum']=0x3;}get['entityGraphic'](){var _0x46d8a3;return(_0x46d8a3=this['_entity'])===null||_0x46d8a3===void 0x0?void 0x0:_0x46d8a3['ellipsoid'];}get[_0x35a251(0xbae)](){return EditEllipsoid;}get['czmObjectEx'](){let _0x808ebd=[];return this['_primitive_label']&&_0x808ebd['push'](this['_primitive_label']),this['_entity_scanPlane']&&(_0x808ebd=_0x808ebd['concat'](this['_entity_scanPlane'])),_0x808ebd;}['_mountedHook'](){const _0x165110={_0x2d5603:0xfc8,_0x5e2534:0x854},_0x34c64e=_0x35a251,_0x52195d={'position':this['position'],'orientation':this['getOrientation'](),'ellipsoid':EllipsoidStyleConver['toCesiumVal'](this[_0x34c64e(_0x165110._0x2d5603)],{},!![])};this['_entity']=this['_createEntity'](_0x52195d);this['style'][_0x34c64e(_0x165110._0x5e2534)]&&this['_addLabel']();const _0x3d4736=this['options']['scanPlane']||this['style']['scanPlane'];_0x3d4736&&(Array['isArray'](_0x3d4736)?_0x3d4736[_0x34c64e(0xdbd)](_0x1dbc78=>{this['addScanPlane'](_0x1dbc78);}):this['addScanPlane'](_0x3d4736));}['_style2Json'](_0x13f6ac,_0x53bb6a){_0x53bb6a=EllipsoidStyleConver['toJSON'](_0x13f6ac,_0x53bb6a,!![]);if(this['_entity_scanPlane']&&this['_entity_scanPlane']['length']>0x0){const _0x2c45d3=[];this['_entity_scanPlane']['forEach'](_0x5e3e0d=>{_0x2c45d3['push'](_0x5e3e0d['_planeOptions']);}),_0x53bb6a['scanPlane']=_0x2c45d3;}return _0x53bb6a;}[_0x35a251(0x6a1)](_0x2cbc9a,_0x1c33b4){const _0x3739eb={_0x8ad885:0xaa2,_0x438b19:0xaa2,_0x3a0d16:0x6c7,_0x268c12:0x870},_0x5a644f=_0x35a251;EllipsoidStyleConver['toCesiumVal'](_0x2cbc9a,this['entityGraphic'],!![]),(Cesium__namespace[_0x5a644f(_0x3739eb._0x8ad885)](_0x1c33b4['heading'])||Cesium__namespace[_0x5a644f(_0x3739eb._0x438b19)](_0x1c33b4['pitch'])||Cesium__namespace['defined'](_0x1c33b4['roll']))&&(this['_entity']['orientation']=this[_0x5a644f(0x3e7)]()),(Cesium__namespace['defined'](_0x1c33b4['radii_x'])||Cesium__namespace['defined'](_0x1c33b4['radii_y'])||Cesium__namespace['defined'](_0x1c33b4[_0x5a644f(_0x3739eb._0x3a0d16)]))&&this[_0x5a644f(_0x3739eb._0x268c12)](_0x2cbc9a);}['_updatePositionsHook'](){const _0x562056={_0x3f2248:0x992},_0x19e1e6=_0x35a251;super['_updatePositionsHook'](),this['_entity_scanPlane']&&this[_0x19e1e6(_0x562056._0x3f2248)]['forEach'](_0x400604=>{_0x400604['position']=this['position'];});}[_0x35a251(0xbfc)](_0x4a5c3e,_0x4fd90d){const _0x26a71a={_0x173345:0x719},_0x9ddb42=_0x35a251;if(_0x4fd90d['scanPlane']){this['removeAllScanPlan']();const _0xbbfafe=_0x4a5c3e['scanPlane'];Array[_0x9ddb42(_0x26a71a._0x173345)](_0xbbfafe)?_0xbbfafe[_0x9ddb42(0xdbd)](_0x10c16e=>{this['addScanPlane'](_0x10c16e);}):this['addScanPlane'](_0xbbfafe);}}['_updateExOpacity'](_0x4db2d1){const _0x2ca0a9={_0x4f7052:0xdbd},_0x55ad27={_0x3e304c:0x3f4,_0x1da50c:0xc04},_0x1306fd=_0x35a251;var _0x4704e8;((_0x4704e8=this['_entity_scanPlane'])===null||_0x4704e8===void 0x0?void 0x0:_0x4704e8['length'])>0x0&&this['_entity_scanPlane'][_0x1306fd(_0x2ca0a9._0x4f7052)](_0x948e22=>{const _0x5a6c32=_0x1306fd,_0x1d392a=this[_0x5a6c32(0xfa4)](_0x948e22[_0x5a6c32(_0x55ad27._0x3e304c)],_0x4db2d1);!_0x1d392a&&(_0x948e22['_planeOptions']['style'][_0x5a6c32(0x2cf)]=_0x4db2d1,EllipsoidStyleConver[_0x5a6c32(_0x55ad27._0x1da50c)](_0x948e22['_planeOptions']['style'],_0x948e22['ellipsoid'],!![]));});}[_0x35a251(0x870)](_0x15dc90){const _0x5962ee={_0x5afd79:0x6c7},_0x2987e1=_0x35a251,_0x449b2d=new Cesium__namespace['Cartesian3'](_0x15dc90['radii_x'],_0x15dc90[_0x2987e1(0xc21)],_0x15dc90[_0x2987e1(_0x5962ee._0x5afd79)]);this['entityGraphic']['radii']?this['entityGraphic']['radii']['setValue'](_0x449b2d):this['entityGraphic']['radii']=_0x449b2d;}['_setPositionsToCallback'](){const _0x6ce23d={_0x295510:0x8eb,_0x2449c3:0xfc8},_0x2fc0f1={_0x196680:0x937},_0x14c30c=_0x35a251;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];const _0x1b996b=getCesiumValue(this['entityGraphic']['radii'],Cesium__namespace[_0x14c30c(_0x6ce23d._0x295510)],this['_map']['clock']['currentTime']);_0x1b996b&&(this['style'][_0x14c30c(0x9e6)]=this['style']['radii_x']??_0x1b996b['x'],this[_0x14c30c(_0x6ce23d._0x2449c3)]['radii_y']=this['style']['radii_y']??_0x1b996b['y'],this['style']['radii_z']=this[_0x14c30c(0xfc8)]['radii_z']??_0x1b996b['z']),this['_positions_draw']=this['positions']||[],this[_0x14c30c(0xb61)]=new Cesium__namespace[(_0x14c30c(0x18a))](_0x2ee3b1=>{const _0x59ad1d=_0x14c30c;if(this[_0x59ad1d(_0x2fc0f1._0x196680)]['length']<0x1)return null;return this['_positions_draw'][0x0];},![]);}[_0x35a251(0x736)](){const _0x544463={_0x4ec496:0x937,_0x4188e1:0x9b1},_0x1fe102=_0x35a251;if(!this['_isCallbackPositions'])return;this['_isCallbackPositions']=![],this['_position']=this[_0x1fe102(_0x544463._0x4ec496)][0x0],this['_point']=LngLatPoint[_0x1fe102(_0x544463._0x4188e1)](this['_position']),this['_updatePositionsHook']();}[_0x35a251(0xe4d)](){const _0x25b29d={_0x46ee4e:0xd79,_0x1531b7:0xe86},_0x212f5f=_0x35a251;this[_0x212f5f(0xd79)]['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this[_0x212f5f(_0x25b29d._0x46ee4e)]['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this[_0x212f5f(_0x25b29d._0x1531b7)]['hasDrawDelPoint']??!![])&&this['_map']['on'](this['_drawDelEventType'],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x2e2594={_0x30a4be:0xfb4,_0x58256a:0x3d8,_0xfdb48b:0x956,_0x5e187c:0x7b3,_0x33f0e8:0x9c4,_0x124e2a:0x82f},_0xaffbdb=_0x35a251;this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['off'](EventType[_0xaffbdb(_0x2e2594._0x30a4be)],this[_0xaffbdb(_0x2e2594._0x58256a)],this),this['_map']['off'](this[_0xaffbdb(_0x2e2594._0xfdb48b)],this[_0xaffbdb(_0x2e2594._0x5e187c)],this),(this['options'][_0xaffbdb(_0x2e2594._0x33f0e8)]??!![])&&this['_map']['off'](this['_drawDelEventType'],this[_0xaffbdb(_0x2e2594._0x124e2a)],this);}['updateAttrForDrawing'](_0x555468){const _0x49a980={_0x5b7691:0xeed,_0x433b12:0x6c7,_0x1c33c1:0xc21},_0x4ffe49=_0x35a251;if(this['_positions_draw']['length']<0x2)return;if(!_0x555468){const _0x2d978c=formatNum$1(Cesium__namespace['Cartesian3'][_0x4ffe49(_0x49a980._0x5b7691)](this['_positions_draw'][0x0],this['_positions_draw'][0x1]),0x2);this['style']['radii_x']=_0x2d978c,this['style'][_0x4ffe49(_0x49a980._0x433b12)]=_0x2d978c;let _0x381e11;this['_positions_draw']['length']===0x3?_0x381e11=formatNum$1(Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],this[_0x4ffe49(0x937)][0x2]),0x2):_0x381e11=_0x2d978c,this['style'][_0x4ffe49(_0x49a980._0x1c33c1)]=_0x381e11,this['updateRadii'](this['style']);}}['_onRightClickHandler'](_0x3ca2cf){const _0x4e942c={_0x13c1a3:0xfc8},_0x142437=_0x35a251;super['_onRightClickHandler'](_0x3ca2cf),this['style']['radii_y']=0x0,this['_positions_draw']['length']===0x1&&(this['style']['radii_x']=0x0,this[_0x142437(_0x4e942c._0x13c1a3)][_0x142437(0x6c7)]=0x0),this['updateRadii'](this['style']);}[_0x35a251(0xc5c)](_0x495f10={}){const _0x5e7206={_0x626fa4:0xfc8,_0x5c5164:0x9db,_0x5d5a4a:0xbf2,_0x434341:0x233,_0x22fca0:0x7ba,_0x2e1095:0x41f,_0x37142c:0x7ba,_0x2621d5:0x7ba,_0x25a218:0xba7,_0x4595e1:0x18a,_0xf4a2c6:0xc04},_0x99a996={_0x125e07:0x41f,_0x3ca398:0x49c},_0x12e6ef={_0x1de622:0x21b},_0x1f3394={_0x441dfb:0x527},_0x1fa529=_0x35a251;this[_0x1fa529(0x992)]=this[_0x1fa529(0x992)]||[],_0x495f10[_0x1fa529(_0x5e7206._0x626fa4)]=_0x495f10['style']||{};const _0x45e5cd={'radii':this['entityGraphic']['radii'],'innerRadii':0.00001,'minimumClockDegree':-0.00001,'maximumClockDegree':0.00001,'minimumConeDegree':this['style']['minimumConeDegree']||0x0,'maximumConeDegree':this['style'][_0x1fa529(0xde1)]||0x5a,'outline':![]};if(this['style']['color'])_0x45e5cd[_0x1fa529(_0x5e7206._0x5c5164)]=this['style'][_0x1fa529(0x9db)],this['style']['opacity']&&(_0x45e5cd['opacity']=this['style'][_0x1fa529(_0x5e7206._0x5d5a4a)]);else this[_0x1fa529(_0x5e7206._0x626fa4)]['outlineColor']&&(_0x45e5cd['color']=this['style']['outlineColor'],this[_0x1fa529(0xfc8)]['outlineOpacity']&&(_0x45e5cd['opacity']=this['style'][_0x1fa529(_0x5e7206._0x434341)]));let _0x5b49dd;const _0x35f534=Cesium__namespace['Math']['toRadians'](_0x495f10['step']||0.5),_0x5848f5=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math'][_0x1fa529(_0x5e7206._0x22fca0)](_0x495f10[_0x1fa529(_0x5e7206._0x626fa4)][_0x1fa529(_0x5e7206._0x2e1095)]||this['heading']),Cesium__namespace['Math']['toRadians'](_0x495f10[_0x1fa529(_0x5e7206._0x626fa4)]['pitch']||this[_0x1fa529(0x527)]),Cesium__namespace[_0x1fa529(0x7c0)][_0x1fa529(_0x5e7206._0x37142c)](_0x495f10['style'][_0x1fa529(0xba7)]||this['roll']));let _0x325dfe=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](this['positionShow'],_0x5848f5);switch(_0x495f10['type']){case'pitch':{const _0x71a318=Cesium__namespace['Math']['toRadians'](_0x495f10['min']??0x0),_0x505343=Cesium__namespace['Math'][_0x1fa529(_0x5e7206._0x2621d5)](_0x495f10[_0x1fa529(0xc9d)]??0xb4);_0x5b49dd=new Cesium__namespace[(_0x1fa529(0x18a))](_0x2851b5=>{const _0x3ce9a0=_0x1fa529;if(!this[_0x3ce9a0(0xd79)]['clock']['shouldAnimate'])return _0x325dfe;return _0x5848f5['pitch']+=_0x35f534,_0x5848f5['pitch']>=_0x505343&&(_0x5848f5[_0x3ce9a0(_0x1f3394._0x441dfb)]=_0x71a318),_0x325dfe=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](this['positionShow'],_0x5848f5),_0x325dfe;},![]);}break;case _0x1fa529(_0x5e7206._0x25a218):{const _0xd8ab2c=Cesium__namespace['Math'][_0x1fa529(0x7ba)](_0x495f10['min']??-0x5a),_0x459352=Cesium__namespace['Math']['toRadians'](_0x495f10[_0x1fa529(0xc9d)]??0x5a);_0x5b49dd=new Cesium__namespace[(_0x1fa529(_0x5e7206._0x4595e1))](_0x2c639e=>{const _0xea12a9=_0x1fa529;if(!this['_map']['clock'][_0xea12a9(_0x12e6ef._0x1de622)])return _0x325dfe;return _0x5848f5['roll']+=_0x35f534,_0x5848f5['roll']>=_0x459352&&(_0x5848f5['roll']=_0xd8ab2c),_0x325dfe=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](this[_0xea12a9(0x95f)],_0x5848f5),_0x325dfe;},![]);}break;case'heading':default:{const _0xab4dd5=Cesium__namespace['Math']['toRadians'](_0x495f10['min']??-0xb4),_0x144c4c=Cesium__namespace['Math']['toRadians'](_0x495f10['max']??0xb4);_0x5b49dd=new Cesium__namespace['CallbackProperty'](_0x13fe4d=>{const _0x49b6f7=_0x1fa529;if(!this['_map'][_0x49b6f7(0x42d)][_0x49b6f7(0x21b)])return _0x325dfe;return _0x5848f5['heading']+=_0x35f534,_0x5848f5[_0x49b6f7(_0x99a996._0x125e07)]>=_0x144c4c&&(_0x5848f5['heading']=_0xab4dd5),_0x325dfe=Cesium__namespace[_0x49b6f7(_0x99a996._0x3ca398)]['headingPitchRollQuaternion'](this[_0x49b6f7(0x95f)],_0x5848f5),_0x325dfe;},![]);break;}}const _0x317efb={'id':_0x1fa529(0xdf2)+createGuid(),'position':this['position'],'orientation':_0x5b49dd,'ellipsoid':EllipsoidStyleConver[_0x1fa529(_0x5e7206._0xf4a2c6)]({..._0x45e5cd,..._0x495f10[_0x1fa529(0xfc8)]},{},!![])},_0x28e4e8=this['_createEntity'](_0x317efb);return this['dataSource']&&this['isAdded']&&this[_0x1fa529(0xad5)]['entities']['add'](_0x28e4e8),this['bindPickId'](_0x28e4e8),_0x28e4e8['_planeOptions']=_0x495f10,this['_entity_scanPlane'][_0x1fa529(0x6de)](_0x28e4e8),_0x28e4e8;}['removeScanPlan'](_0x439bd0){const _0x94d3fc=_0x35a251;this[_0x94d3fc(0xad5)]&&this[_0x94d3fc(0x47f)]&&this['dataSource']['entities']['remove'](_0x439bd0),removeArrayItem(this[_0x94d3fc(0x992)],_0x439bd0);}['removeAllScanPlan'](){const _0x259a5f={_0x30a752:0x992},_0x5b418b={_0x34920f:0xad5},_0x3a3261=_0x35a251;this['dataSource']&&this['isAdded']&&this[_0x3a3261(_0x259a5f._0x30a752)]['forEach'](_0x18259d=>{const _0x5528e1=_0x3a3261;this[_0x5528e1(_0x5b418b._0x34920f)]['entities']['remove'](_0x18259d);}),this[_0x3a3261(_0x259a5f._0x30a752)]=[];}}register$4('ellipsoid',EllipsoidEntity,!![]);class PolylineEntity extends BasePolyEntity{get['entityGraphic'](){const _0x5d17eb={_0xba026d:0x282},_0x56e0ef=_0x35a251;var _0xb38642;return(_0xb38642=this['_entity'])===null||_0xb38642===void 0x0?void 0x0:_0xb38642[_0x56e0ef(_0x5d17eb._0xba026d)];}['_mountedHook'](){const _0x413d6d={_0x482ffb:0xb35},_0x31afc5=_0x35a251;this['_positions_show']=this[_0x31afc5(0x819)](this[_0x31afc5(_0x413d6d._0x482ffb)]);const _0x1e66d1={'polyline':PolylineStyleConver['toCesiumVal'](this['style'],{},!![])};_0x1e66d1[_0x31afc5(0x282)]['positions']=this['_positions_show'],this['_entity']=this['_createEntity'](_0x1e66d1),this['style']['label']&&this[_0x31afc5(0x86a)]();}['getShowPositions'](_0x2fe3fb){return this['style']['closure']&&(_0x2fe3fb===null||_0x2fe3fb===void 0x0?void 0x0:_0x2fe3fb['length'])>0x0?_0x2fe3fb['concat'](_0x2fe3fb[0x0]):_0x2fe3fb;}['_style2Json'](_0x2451bd,_0x5dc149){const _0x4d42f8={_0x5578a4:0x99e},_0x2ad0ce=_0x35a251;return PolylineStyleConver[_0x2ad0ce(_0x4d42f8._0x5578a4)](_0x2451bd,_0x5dc149,!![]);}['_updateStyleHook'](_0x2ea242,_0x2a9a8b){const _0x3f2bc9={_0x38d846:0xc04},_0x571961=_0x35a251;PolylineStyleConver[_0x571961(_0x3f2bc9._0x38d846)](_0x2ea242,this['entityGraphic'],!![]),Cesium__namespace['defined'](_0x2a9a8b===null||_0x2a9a8b===void 0x0?void 0x0:_0x2a9a8b['closure'])&&(!this['_isCallbackPositions']&&(this['_positions_show']=this['getShowPositions'](this['_positions']),this['entityGraphic']['positions']=this['_positions_show']),this['updateAttrForDrawing']());}['_updatePositionsHook'](){const _0x4aba7c={_0x46a27b:0x819,_0xf79e60:0x5a1,_0x46daad:0x9eb},_0x5e28da=_0x35a251;this['_positions']instanceof Cesium__namespace[_0x5e28da(0x18a)]?this['entityGraphic']['positions']=this['_positions']:(this['_positions_show']=this[_0x5e28da(_0x4aba7c._0x46a27b)](this['_positions']),this[_0x5e28da(_0x4aba7c._0xf79e60)]['positions']=this[_0x5e28da(_0x4aba7c._0x46daad)]),this[_0x5e28da(0xdc9)](),this['_updateEditDraggers']();}[_0x35a251(0x133)](){return this['_positions_show'];}['updateAttrForDrawing'](_0x472226){const _0x1b4f50={_0x935372:0xaa2,_0x59d93d:0x819},_0x402804=_0x35a251;Cesium__namespace[_0x402804(_0x1b4f50._0x935372)](this['entityGraphic'][_0x402804(0x57a)])&&(this['entityGraphic'][_0x402804(0xb35)]=this['_positions_CallbackProperty']()),this['_positions_show']=this[_0x402804(_0x1b4f50._0x59d93d)](this[_0x402804(0x937)]);}['_stopDrawHook'](){const _0x7d0c75={_0x15a97a:0xb35},_0x1924f3=_0x35a251;super['_stopDrawHook'](),Cesium__namespace['defined'](this['entityGraphic']['depthFailMaterial'])&&(this[_0x1924f3(_0x7d0c75._0x15a97a)]=this[_0x1924f3(0x937)]);}['_updateDistanceDisplayConditionByEdit'](){const _0x1aed22={_0x644a9b:0xf06,_0x3d3144:0xc4a},_0x51576c=_0x35a251;if(this['_isCallbackPositions']&&this['style']['clampToGround']){let _0x52a812;const _0x49bbf3=this['center'];_0x49bbf3?_0x52a812=Cesium__namespace['Cartesian3'][_0x51576c(0xeed)](_0x49bbf3,new Cesium__namespace[(_0x51576c(0x8eb))]()):_0x52a812=(Cesium__namespace['Ellipsoid'][_0x51576c(0xf39)]['minimumRadius']+Cesium__namespace[_0x51576c(_0x1aed22._0x644a9b)]['WGS84']['maximumRadius'])/0x2,this[_0x51576c(0xc4a)](_0x52a812);}else this[_0x51576c(_0x1aed22._0x3d3144)]();}}register$4('polyline',PolylineEntity);class CurveEntity extends PolylineEntity{['getShowPositions'](_0x5eb7f5){const _0x17dd34={_0x3818a2:0xe1e},_0x2873f9=_0x35a251;if(!_0x5eb7f5||_0x5eb7f5[_0x2873f9(_0x17dd34._0x3818a2)]<0x2)return _0x5eb7f5;return getBezierCurve(_0x5eb7f5,this['style']);}}register$4('curve',CurveEntity);class EditPolylineVolume extends EditPoly{}class PolylineVolumeEntity extends BasePolyEntity{get['entityGraphic'](){var _0x34594f;return(_0x34594f=this['_entity'])===null||_0x34594f===void 0x0?void 0x0:_0x34594f['polylineVolume'];}get['EditClass'](){return EditPolylineVolume;}['_mountedHook'](){const _0x5994a0={_0x2e9653:0xfc8,_0x25fb3e:0xb20},_0x37ca7b=_0x35a251,_0x5d6362={'polylineVolume':PolylineVolumeStyleConver['toCesiumVal'](this[_0x37ca7b(_0x5994a0._0x2e9653)],{},!![])};_0x5d6362[_0x37ca7b(_0x5994a0._0x25fb3e)]['positions']=this['positions'],this[_0x37ca7b(0x249)]=this[_0x37ca7b(0xede)](_0x5d6362),this['style']['label']&&this['_addLabel']();}[_0x35a251(0x1e0)](_0x2b15ae,_0x2f214f){const _0x40f0a6=_0x35a251;return PolylineVolumeStyleConver[_0x40f0a6(0x99e)](_0x2b15ae,_0x2f214f,!![]);}[_0x35a251(0x6a1)](_0x19228e,_0x1c97be){PolylineVolumeStyleConver['toCesiumVal'](_0x19228e,this['entityGraphic'],!![]);}['_updatePositionsHook'](){const _0x350878={_0x3bcc39:0xb35},_0x52d378=_0x35a251;this['entityGraphic']['positions']=this[_0x52d378(_0x350878._0x3bcc39)],this['_updateLabelPosition'](),this['_updateEditDraggers']();}}register$4('polylineVolume',PolylineVolumeEntity);class PathEntity extends BasePointEntity{constructor(_0x51f6bc={}){const _0x18b6c8={_0x55345d:0x756},_0x577d65=_0x35a251;super(_0x51f6bc),delete this[_0x577d65(_0x18b6c8._0x55345d)],this[_0x577d65(0x96f)]=![];}get[_0x35a251(0x5a1)](){var _0x5ae447;return(_0x5ae447=this['_entity'])===null||_0x5ae447===void 0x0?void 0x0:_0x5ae447['path'];}get['orientationShow'](){const _0x49d5ce={_0x1ffb8f:0x42d,_0x58781a:0x653},_0x6d1020=_0x35a251,_0x49d208=Cesium__namespace['Property']['getValueOrUndefined'](this[_0x6d1020(0x8fd)],this['_map'][_0x6d1020(_0x49d5ce._0x1ffb8f)][_0x6d1020(0x18b)],new Cesium__namespace[(_0x6d1020(_0x49d5ce._0x58781a))]());return _0x49d208;}get[_0x35a251(0x3e9)](){return getHeadingPitchRollByOrientation(this['positionShow'],this['orientationShow']);}get['pitch'](){const _0x3c509d={_0x1c61de:0xfc8},_0x4cf7c6=_0x35a251;return this[_0x4cf7c6(_0x3c509d._0x1c61de)]['pitch']??0x0;}set['pitch'](_0x1c5352){const _0x12eb6c={_0x2703cc:0xfc8},_0x381039=_0x35a251;this[_0x381039(_0x12eb6c._0x2703cc)]['pitch']=_0x1c5352,this['updateOrientation']();}get[_0x35a251(0xba7)](){const _0x3ea3ed=_0x35a251;return this[_0x3ea3ed(0xfc8)]['roll']??0x0;}set['roll'](_0x5a39c3){this['style']['roll']=_0x5a39c3,this['updateOrientation']();}get['positions'](){return this['_positions'];}set['positions'](_0x210032){const _0x52d385=_0x35a251;if(!_0x210032)return;const _0x3573cd=new Cesium__namespace[(_0x52d385(0xa17))]();_0x210032[_0x52d385(0xdbd)]((_0x229b29,_0x3f86e1)=>{const _0x4a63f5=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x229b29[0x3]));_0x3573cd['addSample'](_0x4a63f5,Cesium__namespace['Cartesian3']['fromDegrees'](_0x229b29[0x0],_0x229b29[0x1],_0x229b29[0x2]));}),this[_0x52d385(0xb61)]=_0x3573cd;}get['coordinates'](){return this['getCoordinates']();}[_0x35a251(0xedd)](){const _0x3c4296={_0x1412cf:0xe1e,_0x16d4ea:0xe1e,_0x348505:0xe0a},_0x420b36=_0x35a251;super['_updatePositionsHook']();if(!this['position']||this[_0x420b36(0xb61)]instanceof Cesium__namespace['Cartesian3'])this['_entity']['orientation']=undefined,this[_0x420b36(0x249)]['availability']=undefined;else{var _0x25b0fc,_0x5c1bba,_0x170b73;this['options']['_auto_orientation']&&(this[_0x420b36(0x249)]['orientation']=new Cesium__namespace[(_0x420b36(0x800))](this['position']));if(this[_0x420b36(0xe86)][_0x420b36(0xa19)]&&((_0x25b0fc=this['position'])===null||_0x25b0fc===void 0x0?void 0x0:(_0x5c1bba=_0x25b0fc['_property'])===null||_0x5c1bba===void 0x0?void 0x0:(_0x170b73=_0x5c1bba['_times'])===null||_0x170b73===void 0x0?void 0x0:_0x170b73[_0x420b36(_0x3c4296._0x1412cf)])>0x0){var _0x3592d4;const _0x5219da=this['position']['_property']['_times'],_0x287c95=_0x5219da[0x0];let _0x415e42=_0x5219da[_0x5219da[_0x420b36(_0x3c4296._0x16d4ea)]-0x1];((_0x3592d4=this['position'])===null||_0x3592d4===void 0x0?void 0x0:_0x3592d4['forwardExtrapolationType'])===Cesium__namespace[_0x420b36(_0x3c4296._0x348505)]['HOLD']&&(_0x415e42=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),this['_entity']['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace[(_0x420b36(0x425))]({'start':_0x287c95,'stop':_0x415e42})]);}}}['_mountedHook'](){const _0x3dc3fd={_0x4cb568:0x579,_0x409975:0x425,_0x5063be:0x42d,_0x4ab0e4:0x18b,_0x5a6bab:0xe26,_0x3444ba:0x579,_0x58756d:0x854,_0x2ce6c2:0xc04,_0x2ab653:0xe86,_0x5d5a31:0x1ba,_0x801a90:0xe86,_0x462abf:0x8fd},_0x13281e={_0x3fbb51:0xb61},_0x2e8a42=_0x35a251;this[_0x2e8a42(0xb61)]&&!this[_0x2e8a42(0xe86)]['orientation']&&(this['options']['orientation']=new Cesium__namespace['VelocityOrientationProperty'](this['position']),this['_auto_orientation']=!![]);const _0x18e699={'position':this['position'],'orientation':this['options'][_0x2e8a42(0x8fd)],'path':PathStyleConver[_0x2e8a42(0xc04)](this['style']||this['options'][_0x2e8a42(0xa06)],{},!![])};if(!this['options']['availability']){var _0x3d4db5,_0x5a6a54,_0x1350df;if(((_0x3d4db5=this['position'])===null||_0x3d4db5===void 0x0?void 0x0:(_0x5a6a54=_0x3d4db5['_property'])===null||_0x5a6a54===void 0x0?void 0x0:(_0x1350df=_0x5a6a54['_times'])===null||_0x1350df===void 0x0?void 0x0:_0x1350df[_0x2e8a42(0xe1e)])>0x0){var _0x43bde0;const _0x4ed074=this[_0x2e8a42(0xb61)]['_property']['_times'],_0x391ae6=_0x4ed074[0x0];let _0x46294c=_0x4ed074[_0x4ed074[_0x2e8a42(0xe1e)]-0x1];((_0x43bde0=this['position'])===null||_0x43bde0===void 0x0?void 0x0:_0x43bde0['forwardExtrapolationType'])===Cesium__namespace['ExtrapolationType']['HOLD']&&(_0x46294c=Cesium__namespace[_0x2e8a42(_0x3dc3fd._0x4cb568)]['fromDate'](new Date(0x834,0x1,0x1))),_0x18e699['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace[(_0x2e8a42(_0x3dc3fd._0x409975))]({'start':_0x391ae6,'stop':_0x46294c})]),this[_0x2e8a42(0xa19)]=!![];}else{var _0x387b0c;const _0x5981fb=this['_map'][_0x2e8a42(_0x3dc3fd._0x5063be)][_0x2e8a42(_0x3dc3fd._0x4ab0e4)];let _0x43ece9=Cesium__namespace['JulianDate']['addDays'](_0x5981fb,0x1,new Cesium__namespace['JulianDate']());((_0x387b0c=this['position'])===null||_0x387b0c===void 0x0?void 0x0:_0x387b0c[_0x2e8a42(_0x3dc3fd._0x5a6bab)])===Cesium__namespace['ExtrapolationType']['HOLD']&&(_0x43ece9=Cesium__namespace['JulianDate']['addDays'](_0x43ece9,0x16d,new Cesium__namespace[(_0x2e8a42(_0x3dc3fd._0x3444ba))]())),_0x18e699['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x5981fb,'stop':_0x43ece9})]);}}this['options'][_0x2e8a42(_0x3dc3fd._0x58756d)]&&(this['options']['label']['text']=this['options'][_0x2e8a42(0x854)]['text']||this['name'],_0x18e699['label']=LabelStyleConver[_0x2e8a42(0xc04)](this['options']['label']));this['options'][_0x2e8a42(0x9c2)]&&(_0x18e699['billboard']=BillboardStyleConver[_0x2e8a42(_0x3dc3fd._0x2ce6c2)](this['options']['billboard']));this[_0x2e8a42(_0x3dc3fd._0x2ab653)][_0x2e8a42(_0x3dc3fd._0x5d5a31)]&&(_0x18e699['point']=PointStyleConver['toCesiumVal'](this['options']['point']));this['options']['circle']&&(_0x18e699['ellipse']=CircleStyleConver['toCesiumVal'](this['options'][_0x2e8a42(0xd6d)],{},!![]));if(this[_0x2e8a42(0xe86)]['model']){_0x18e699['model']=ModelStyleConver['toCesiumVal'](this[_0x2e8a42(_0x3dc3fd._0x2ab653)]['model'],{},!![]);const _0x597721=this[_0x2e8a42(_0x3dc3fd._0x801a90)]['model'];(_0x597721['mergeOrientation']||!Cesium__namespace['defined'](_0x597721['heading'])||!Cesium__namespace['defined'](_0x597721['pitch'])||!Cesium__namespace['defined'](_0x597721['roll']))&&(_0x18e699[_0x2e8a42(_0x3dc3fd._0x462abf)]=new Cesium__namespace['CallbackProperty'](_0x5bb576=>{const _0x13d035=_0x2e8a42;return this['_getCustomQuaternion'](this[_0x13d035(_0x13281e._0x3fbb51)],this['options']['orientation']);},![]));}this['_entity']=this['_createEntity'](_0x18e699);}['_getCustomQuaternion'](_0x4a53d9,_0x2dd59b){const _0x13ce75={_0x20005c:0x7ec,_0x589de1:0x42d},_0x5c0d76=_0x35a251;var _0x2f4fde,_0x2cf0d8;if(_0x4a53d9['getValue']){var _0x6ddcf1,_0x386d20;_0x4a53d9=_0x4a53d9[_0x5c0d76(0x7ec)]((_0x6ddcf1=this['_map'])===null||_0x6ddcf1===void 0x0?void 0x0:(_0x386d20=_0x6ddcf1[_0x5c0d76(0x42d)])===null||_0x386d20===void 0x0?void 0x0:_0x386d20['currentTime']);}if(_0x2dd59b['getValue']){var _0x75c9a9,_0x1e1dd3;_0x2dd59b=_0x2dd59b[_0x5c0d76(_0x13ce75._0x20005c)]((_0x75c9a9=this[_0x5c0d76(0xd79)])===null||_0x75c9a9===void 0x0?void 0x0:(_0x1e1dd3=_0x75c9a9[_0x5c0d76(_0x13ce75._0x589de1)])===null||_0x1e1dd3===void 0x0?void 0x0:_0x1e1dd3['currentTime']);}const _0x143314=this['options']['model'];let _0x5e8679=Cesium__namespace['Math']['toRadians'](_0x143314['heading']||0x0),_0x1da3a9=Cesium__namespace['Math']['toRadians'](_0x143314['pitch']||0x0),_0x5bd413=Cesium__namespace['Math']['toRadians'](_0x143314['roll']||0x0);if(_0x2dd59b){const _0x10b2a3=getHeadingPitchRollByOrientation(_0x4a53d9,_0x2dd59b);_0x143314['mergeOrientation']?(_0x5e8679+=_0x10b2a3['heading'],_0x5bd413+=_0x10b2a3['roll'],_0x1da3a9+=_0x10b2a3['pitch']):(!Cesium__namespace['defined'](_0x143314['heading'])&&(_0x5e8679=_0x10b2a3[_0x5c0d76(0x41f)]),!Cesium__namespace['defined'](_0x143314['roll'])&&(_0x5bd413=_0x10b2a3['roll']),!Cesium__namespace['defined'](_0x143314['pitch'])&&(_0x1da3a9=_0x10b2a3['pitch']));}return Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x4a53d9,new Cesium__namespace[(_0x5c0d76(0x513))](_0x5e8679,_0x1da3a9,_0x5bd413),(_0x2f4fde=this[_0x5c0d76(0xd79)])===null||_0x2f4fde===void 0x0?void 0x0:(_0x2cf0d8=_0x2f4fde['scene'])===null||_0x2cf0d8===void 0x0?void 0x0:_0x2cf0d8['globe']['ellipsoid']);}[_0x35a251(0x964)](){const _0x252bb7={_0x36b777:0xe86,_0x5cc390:0xcb2,_0x11abee:0x579,_0x437179:0xe26,_0x2a4ba9:0xb86},_0x5a373f=_0x35a251;if(!this[_0x5a373f(_0x252bb7._0x36b777)])return;this[_0x5a373f(0x827)]=this['options'][_0x5a373f(_0x252bb7._0x5cc390)]??0x32;if(!this['position']){const _0xf01da4=new Cesium__namespace['SampledPositionProperty'](this['options']['referenceFrame']);_0xf01da4['forwardExtrapolationType']=this['options']['forwardExtrapolationType']??Cesium__namespace['ExtrapolationType']['HOLD'],_0xf01da4['backwardExtrapolationType']=this['options']['backwardExtrapolationType']??Cesium__namespace['ExtrapolationType']['HOLD'];!this[_0x5a373f(0xe86)][_0x5a373f(0x8fd)]&&(this[_0x5a373f(_0x252bb7._0x36b777)]['orientation']=new Cesium__namespace['VelocityOrientationProperty'](_0xf01da4),this['_entity']&&(this['_entity']['orientation']=this['getOrientation']()));if(this['_entity']&&!this['_entity']['availability']&&this[_0x5a373f(0xd79)]){var _0x1a2e8b;const _0x1c4817=this['_map']['clock']['currentTime'];let _0xdee4f4=Cesium__namespace[_0x5a373f(_0x252bb7._0x11abee)]['addDays'](_0x1c4817,0x1,new Cesium__namespace['JulianDate']());((_0x1a2e8b=this['position'])===null||_0x1a2e8b===void 0x0?void 0x0:_0x1a2e8b[_0x5a373f(_0x252bb7._0x437179)])===Cesium__namespace['ExtrapolationType']['HOLD']&&(_0xdee4f4=Cesium__namespace[_0x5a373f(0x579)]['addDays'](_0xdee4f4,0x16d,new Cesium__namespace[(_0x5a373f(0x579))]())),this['_entity']['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x1c4817,'stop':_0xdee4f4})]);}this['position']=_0xf01da4;}this[_0x5a373f(_0x252bb7._0x2a4ba9)]=this[_0x5a373f(0xb61)];}['_updateStyleHook'](_0x3e83f7,_0x1d75a0){PathStyleConver['toCesiumVal'](_0x3e83f7,this['entityGraphic'],{},!![]);}['_style2Json'](_0x3e92d7,_0x422335){return PathStyleConver['toJSON'](_0x3e92d7,_0x422335,!![]);}['_getGeoJsonGeometry'](_0xe891f){const _0x4c5d90={_0x3b19a5:0xe0c},_0x292378=_0x35a251;return{'type':'LineString','coordinates':this['getCoordinates'](_0xe891f===null||_0xe891f===void 0x0?void 0x0:_0xe891f[_0x292378(_0x4c5d90._0x3b19a5)])};}['_getJsonPositions'](_0x291a96){const _0x46ffe8={_0x40f5d5:0xb35},_0xa64c64=_0x35a251;_0x291a96[_0xa64c64(_0x46ffe8._0x40f5d5)]=this['getCoordinates']();}[_0x35a251(0x4d5)](_0x202ca3){const _0x5b3fb3={_0x4784df:0x99e,_0x2088a7:0x440,_0x460905:0x9c2,_0x4380e5:0xe86,_0x4e4faf:0xd6d},_0x5cd246=_0x35a251;this['options']['label']&&(_0x202ca3['label']={},LabelStyleConver[_0x5cd246(0x99e)](this['options'][_0x5cd246(0x854)],_0x202ca3[_0x5cd246(0x854)],!![])),this['options']['model']&&(_0x202ca3['model']={},ModelStyleConver[_0x5cd246(_0x5b3fb3._0x4784df)](this['options']['model'],_0x202ca3[_0x5cd246(_0x5b3fb3._0x2088a7)],!![])),this['options']['billboard']&&(_0x202ca3['billboard']={},BillboardStyleConver['toJSON'](this['options'][_0x5cd246(_0x5b3fb3._0x460905)],_0x202ca3['billboard'],!![])),this['options']['point']&&(_0x202ca3['point']={},PointStyleConver['toJSON'](this[_0x5cd246(_0x5b3fb3._0x4380e5)]['point'],_0x202ca3['point'],!![])),this['options'][_0x5cd246(_0x5b3fb3._0x4e4faf)]&&(_0x202ca3['circle']={},CircleStyleConver[_0x5cd246(_0x5b3fb3._0x4784df)](this['options'][_0x5cd246(_0x5b3fb3._0x4e4faf)],_0x202ca3['circle'],!![]));}['_setOptionsHook'](_0x31997f,_0x6516e9){const _0x4806db={_0x2751da:0x440,_0x4d7bd6:0x9c2,_0x466b9b:0x1ba,_0x556e39:0xedf},_0x4bbdf8=_0x35a251;_0x6516e9[_0x4bbdf8(0x854)]&&LabelStyleConver['toCesiumVal'](_0x31997f[_0x4bbdf8(0x854)],this['_entity']['label'],this),_0x6516e9[_0x4bbdf8(_0x4806db._0x2751da)]&&ModelStyleConver[_0x4bbdf8(0xc04)](_0x31997f['model'],this[_0x4bbdf8(0x249)]['model'],!![]),_0x6516e9[_0x4bbdf8(_0x4806db._0x4d7bd6)]&&BillboardStyleConver['toCesiumVal'](_0x31997f['billboard'],this['_entity']['billboard'],!![]),_0x6516e9[_0x4bbdf8(_0x4806db._0x466b9b)]&&PointStyleConver['toCesiumVal'](_0x31997f['point'],this['_entity']['point'],!![]),_0x6516e9['circle']&&CircleStyleConver['toCesiumVal'](_0x31997f['circle'],this['_entity'][_0x4bbdf8(_0x4806db._0x556e39)],!![]);}['_updateExOpacity'](_0x709f3){const _0x591d56={_0x265245:0x249,_0x1e14b4:0xfa4,_0x21ac94:0x1ba,_0x466042:0x249,_0x4203cb:0xedf},_0x135210=_0x35a251;this['_entity']['model']&&(this['_entity']['model'][_0x135210(0x9db)]=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x709f3));this[_0x135210(_0x591d56._0x265245)]['billboard']&&(this['_entity']['billboard']['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x709f3));if(this[_0x135210(_0x591d56._0x265245)]['point']){const _0x55ba5f=this[_0x135210(_0x591d56._0x1e14b4)](this['_entity']['point'],_0x709f3);!_0x55ba5f&&PointStyleConver['toCesiumVal']({...this['options'][_0x135210(_0x591d56._0x21ac94)],'globalAlpha':_0x709f3},this['_entity'][_0x135210(_0x591d56._0x21ac94)],!![]);}if(this['_entity']['circle']){const _0x51105d=this['_updateEntityOpacity'](this[_0x135210(0x249)]['circle'],_0x709f3);!_0x51105d&&CircleStyleConver['toCesiumVal']({...this[_0x135210(0xe86)]['circle'],'globalAlpha':_0x709f3},this[_0x135210(_0x591d56._0x466042)][_0x135210(_0x591d56._0x4203cb)],!![]);}}['getIndex'](_0x1571ff){const _0x35acee={_0x28498c:0x42d},_0x29a76c=_0x35a251;var _0x476afe,_0x5c4551,_0x209cee,_0x276d19;const _0x3ade05=(_0x476afe=this['position'])===null||_0x476afe===void 0x0?void 0x0:(_0x5c4551=_0x476afe['_property'])===null||_0x5c4551===void 0x0?void 0x0:_0x5c4551['_times'],_0x5e48e4=_0x3ade05['length'];if(_0x5e48e4===0x0)return 0x0;const _0x50bab9=_0x1571ff||((_0x209cee=this['_map'])===null||_0x209cee===void 0x0?void 0x0:(_0x276d19=_0x209cee[_0x29a76c(_0x35acee._0x28498c)])===null||_0x276d19===void 0x0?void 0x0:_0x276d19['currentTime'])||Cesium__namespace['JulianDate']['now']();let _0x32f773=Cesium__namespace['binarySearch'](_0x3ade05,_0x50bab9,Cesium__namespace['JulianDate']['compare']);return _0x32f773<0x0&&(_0x32f773=~_0x32f773),_0x32f773<0x0&&(_0x32f773=0x0),_0x32f773>=_0x5e48e4&&(_0x32f773=_0x5e48e4-0x1),_0x32f773;}[_0x35a251(0x878)](_0x539e09){const _0x4405ba=_0x35a251;var _0x5238e5,_0x26fa28,_0x2711c1,_0x39f291;const _0x21fb93=(_0x5238e5=this['position'])===null||_0x5238e5===void 0x0?void 0x0:(_0x26fa28=_0x5238e5['_property'])===null||_0x26fa28===void 0x0?void 0x0:_0x26fa28['_times'],_0x3132d0=(_0x2711c1=this['position'])===null||_0x2711c1===void 0x0?void 0x0:(_0x39f291=_0x2711c1[_0x4405ba(0xb4f)])===null||_0x39f291===void 0x0?void 0x0:_0x39f291['_values'];if(!_0x21fb93||_0x21fb93['length']===0x0)return;const _0x21ef18=[];for(let _0x9b27fe=0x0,_0x2e7b83=_0x21fb93['length'];_0x9b27fe<_0x2e7b83;_0x9b27fe++){_0x21ef18['push'](new Cesium__namespace['Cartesian3'](_0x3132d0[_0x9b27fe*0x3],_0x3132d0[_0x9b27fe*0x3+0x1],_0x3132d0[_0x9b27fe*0x3+0x2]));}const _0x2b77b8=getRectangle(_0x21ef18,_0x539e09===null||_0x539e09===void 0x0?void 0x0:_0x539e09['isFormat']);return _0x2b77b8;}[_0x35a251(0x797)](_0x3d314d){const _0x23db09={_0x3ab7fa:0xb61,_0x7f60d5:0xb61,_0x4e020a:0x9b1},_0x1185c0=_0x35a251;var _0x41298f,_0x51e693,_0x57d38a,_0x209304;const _0x369922=(_0x41298f=this[_0x1185c0(_0x23db09._0x3ab7fa)])===null||_0x41298f===void 0x0?void 0x0:(_0x51e693=_0x41298f['_property'])===null||_0x51e693===void 0x0?void 0x0:_0x51e693['_times'],_0x1ce7e7=(_0x57d38a=this[_0x1185c0(_0x23db09._0x7f60d5)])===null||_0x57d38a===void 0x0?void 0x0:(_0x209304=_0x57d38a['_property'])===null||_0x209304===void 0x0?void 0x0:_0x209304[_0x1185c0(0xc83)];if(!_0x369922||_0x369922['length']===0x0)return[];const _0x1d7524=[];for(let _0x1094d4=0x0,_0x54264c=_0x369922['length'];_0x1094d4<_0x54264c;_0x1094d4++){const _0x8d9b05=LngLatPoint[_0x1185c0(_0x23db09._0x4e020a)](new Cesium__namespace['Cartesian3'](_0x1ce7e7[_0x1094d4*0x3],_0x1ce7e7[_0x1094d4*0x3+0x1],_0x1ce7e7[_0x1094d4*0x3+0x2])),_0xdadc99=_0x8d9b05['toArray'](_0x3d314d);_0xdadc99['push'](Cesium__namespace['JulianDate']['toDate'](_0x369922[_0x1094d4])[_0x1185c0(0x46b)]()),_0x1d7524['push'](_0xdadc99);}return _0x1d7524;}['flyToPoint'](_0x335651={}){const _0x29d9eb={_0x4ce0a:0xc74},_0x571706=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);const _0x307794=this['positionShow'];if(!_0x307794)return Promise[_0x571706(_0x29d9eb._0x4ce0a)](![]);let _0x46a734;if(Cesium__namespace['defined'](_0x335651['heading'])){var _0x32776b;_0x46a734=_0x335651['heading']+Cesium__namespace['Math']['toDegrees'](((_0x32776b=this[_0x571706(0x3e9)])===null||_0x32776b===void 0x0?void 0x0:_0x32776b['heading'])||0x0);}return this['_map']['flyToPoint'](_0x307794,{..._0x335651,'heading':_0x46a734});}}register$4('path',PathEntity,!![]);class EditCorridor extends EditPoly{[_0x35a251(0x7e6)](_0x3f4bc0){const _0x2a9937=_0x35a251;if(this[_0x2a9937(0x5a1)][_0x2a9937(0x682)]!==undefined){const _0x8fbeef=getCesiumValue(this[_0x2a9937(0x5a1)][_0x2a9937(0x682)],Number,this['_map']['clock']['currentTime']);_0x3f4bc0=setPositionsHeight(_0x3f4bc0,_0x8fbeef);}return _0x3f4bc0;}['createDragger'](_0x4aec6f){const _0x2a442a={_0x139d8c:0xd79,_0x569841:0xc60,_0x54a2f2:0xb61},_0x5dbb1c=_0x35a251;return this['clampToGround']&&(_0x4aec6f['position']=getSurfacePosition(this[_0x5dbb1c(_0x2a442a._0x139d8c)][_0x5dbb1c(_0x2a442a._0x569841)],_0x4aec6f[_0x5dbb1c(_0x2a442a._0x54a2f2)])),super[_0x5dbb1c(0xf01)](_0x4aec6f);}['_updateMoveAllHook'](_0xbe9759){const _0x2772ed={_0x32e42c:0x120,_0x424a82:0x4ec},_0x5193a7=_0x35a251;if(this['clampToGround'])return;const _0xf3172d=Cesium__namespace[_0x5193a7(_0x2772ed._0x32e42c)]['fromCartesian'](_0xbe9759)['height'];this['entityGraphic']['height']=_0xf3172d,this['style']['height']=this[_0x5193a7(_0x2772ed._0x424a82)](_0xf3172d,0x2);}['_updateHeight'](_0x58300c){const _0x543f48={_0x3a998a:0xfc8},_0x344f87=_0x35a251;this['entityGraphic']['height']=_0x58300c,this[_0x344f87(_0x543f48._0x3a998a)]['height']=this['formatNum'](_0x58300c,0x2);const _0x7cdb0d=this['positions'];for(let _0x3c7fbf=0x0,_0xfced6b=_0x7cdb0d['length'];_0x3c7fbf<_0xfced6b;_0x3c7fbf++){_0x7cdb0d[_0x3c7fbf]=setPositionsHeight(_0x7cdb0d[_0x3c7fbf],_0x58300c);}for(let _0x5ac8e4=0x0,_0x5cbe86=this['draggers']['length'];_0x5ac8e4<_0x5cbe86;_0x5ac8e4++){const _0x2c288f=this['draggers'][_0x5ac8e4];_0x2c288f['position']=setPositionsHeight(_0x2c288f['position'],_0x58300c);}this['fire'](EventType['editStyle']);}}class CorridorEntity extends BasePolyEntity{get['entityGraphic'](){var _0x55b999;return(_0x55b999=this['_entity'])===null||_0x55b999===void 0x0?void 0x0:_0x55b999['corridor'];}get['EditClass'](){return EditCorridor;}[_0x35a251(0x700)](){const _0x21d6aa=_0x35a251,_0x4dde00={'corridor':CorridorStyleConver[_0x21d6aa(0xc04)](this['style'],{},!![])};_0x4dde00[_0x21d6aa(0x55c)]['positions']=this['positions'],this[_0x21d6aa(0x249)]=this['_createEntity'](_0x4dde00),this['style']['label']&&this['_addLabel']();}['_style2Json'](_0x8356de,_0x543c90){return CorridorStyleConver['toJSON'](_0x8356de,_0x543c90,!![]);}['_updateStyleHook'](_0x78e368,_0x218262){const _0x2470c3={_0x5b7cce:0x682},_0x496efd=_0x35a251;CorridorStyleConver[_0x496efd(0xc04)](_0x78e368,this['entityGraphic'],!![]),_0x218262&&(Cesium__namespace[_0x496efd(0xaa2)](_0x218262[_0x496efd(0x4f7)])||Cesium__namespace['defined'](_0x218262[_0x496efd(_0x2470c3._0x5b7cce)]))&&this['_updateHeight']();}['_updatePositionsHook'](){const _0x47fc04={_0x5b893b:0xdc9},_0x3f7c8e=_0x35a251;this['entityGraphic']['positions']=this['positions'],this[_0x3f7c8e(_0x47fc04._0x5b893b)](),this['_updateEditDraggers']();}['_updateHeight'](_0x5763d7=!![]){const _0x5d36d4={_0x3b3d48:0xfc8,_0x2c7be4:0x4f7},_0x10d647=_0x35a251;if(this['style']['clampToGround'])return;let _0x479c27=0x0;_0x5763d7&&Cesium__namespace['defined'](this[_0x10d647(0xfc8)]['height'])?_0x479c27=this[_0x10d647(_0x5d36d4._0x3b3d48)]['height']:_0x479c27=getMaxHeight(this[_0x10d647(0x937)]||this['_positions']),this['entityGraphic']['height']=_0x479c27,this['style']['height']=_0x479c27,Cesium__namespace['defined'](this['style']['diffHeight'])&&(Cesium__namespace['defined'](this[_0x10d647(0xfc8)]['diffHeight'])&&this[_0x10d647(0xfc8)][_0x10d647(_0x5d36d4._0x2c7be4)]!==0x0?this['entityGraphic'][_0x10d647(0x552)]=_0x479c27+this[_0x10d647(0xfc8)]['diffHeight']:this['entityGraphic']['extrudedHeight']=undefined);}['updateAttrForDrawing'](_0x566bef){const _0x517887={_0x2c7ae0:0x937,_0x2cb1cb:0xfc8,_0x1c1111:0xaa2,_0xbf1cc2:0xfc8},_0x279851=_0x35a251;if(!_0x566bef){if(!this['style']['clampToGround']){const _0x57167a=getMaxHeight(this[_0x279851(_0x517887._0x2c7ae0)]);_0x57167a!==0x0&&(this['entityGraphic']['height']=_0x57167a,this[_0x279851(_0x517887._0x2cb1cb)]['height']=_0x57167a,Cesium__namespace[_0x279851(_0x517887._0x1c1111)](this['style']['diffHeight'])&&(Cesium__namespace['defined'](this['style'][_0x279851(0x4f7)])&&this[_0x279851(_0x517887._0xbf1cc2)]['diffHeight']!==0x0?this['entityGraphic']['extrudedHeight']=_0x57167a+Number(this[_0x279851(_0x517887._0x2cb1cb)]['diffHeight']):this['entityGraphic']['extrudedHeight']=undefined));}}else this['_updateHeight']();}}register$4(_0x35a251(0x55c),CorridorEntity);class EditWall extends EditPoly{['bindDraggers'](){const _0x451a06={_0x2a3e0f:0xf01,_0x269096:0x815,_0x17163a:0x6da},_0x309bec={_0xd27572:0x40a,_0x1c0600:0xe87},_0x34c601={_0x24c30c:0x1bc,_0x4c7810:0xdd0,_0x737451:0x1cf,_0x27bc1c:0xe1e,_0x42bca3:0xb61},_0x3d1c2a=_0x35a251,_0x562c5d=this['positions'],_0xab8a9b=this['style'],_0x12a559=this['hasMidPoint'];for(let _0x25a700=0x0,_0x5d8753=_0x562c5d[_0x3d1c2a(0xe1e)];_0x25a700<_0x5d8753;_0x25a700++){const _0x1ae2ef=_0x562c5d[_0x25a700],_0x6098fe=this[_0x3d1c2a(_0x451a06._0x2a3e0f)]({'position':_0x1ae2ef,'onDrag':(_0x44f932,_0x381e30)=>{const _0x4e2a8b=_0x3d1c2a;_0x562c5d[_0x44f932[_0x4e2a8b(_0x34c601._0x24c30c)]]=_0x381e30;this['_heightDraggers']&&this[_0x4e2a8b(_0x34c601._0x4c7810)]['length']>0x0&&(this['_heightDraggers'][_0x44f932[_0x4e2a8b(0x1bc)]]['position']=addPositionsHeight(_0x381e30,_0xab8a9b['diffHeight']));_0x12a559&&(_0x44f932['index']>0x0&&(this[_0x4e2a8b(_0x34c601._0x737451)][_0x44f932[_0x4e2a8b(0x1bc)]*0x2-0x1]['position']=getMidpoint(_0x381e30,_0x562c5d[_0x44f932['index']-0x1],new Cesium__namespace['Cartesian3']())),_0x44f932[_0x4e2a8b(0x1bc)]<_0x562c5d[_0x4e2a8b(_0x34c601._0x27bc1c)]-0x1&&(this['draggers'][_0x44f932['index']*0x2+0x1][_0x4e2a8b(_0x34c601._0x42bca3)]=getMidpoint(_0x381e30,_0x562c5d[_0x44f932['index']+0x1])));const _0xb16525=centerOfMass(_0x562c5d);this['_draggerMove']['position']=_0xb16525;}});_0x6098fe['index']=_0x25a700,this['draggers']['push'](_0x6098fe);if(this['hasMidPoint']&&(this[_0x3d1c2a(_0x451a06._0x269096)]||!this['hasClosure']&&_0x25a700<_0x5d8753-0x1)){const _0xdeb9f9=(_0x25a700+0x1)%_0x5d8753,_0x168c4c=getMidpoint(_0x1ae2ef,_0x562c5d[_0xdeb9f9]),_0x43eb10=this['createDragger']({'position':_0x168c4c,'type':PointType['AddMidPoint'],'tooltip':this['_map']['getLangText']('_增加点'),'onDragStart':(_0x101f35,_0x101d6e)=>{const _0x269040=_0x3d1c2a;this['positions']['splice'](_0x101f35[_0x269040(0x1bc)],0x0,_0x101d6e),this['updateAttrForEditing']();},'onDrag':(_0x2a2d8c,_0x43e463)=>{this['positions'][_0x2a2d8c['index']]=_0x43e463;},'onDragEnd':(_0x5016f5,_0x3c416c)=>{const _0x5dc986=_0x3d1c2a;this[_0x5dc986(_0x309bec._0xd27572)](_0x5016f5,_0x3c416c),this[_0x5dc986(_0x309bec._0x1c0600)]();}});_0x43eb10['index']=_0xdeb9f9,this['draggers']['push'](_0x43eb10);}}this['_bindMoveAllDragger'](),this[_0x3d1c2a(_0x451a06._0x17163a)]();}[_0x35a251(0x6da)](){const _0x9593e={_0x113fc9:0xe2a,_0x404e0c:0xd79,_0x506c1d:0xdd0},_0x5378a0={_0xec3390:0x53d},_0x3c29f1=_0x35a251;if(!this['_graphic']['_hasHeightEdit'])return;this['_heightDraggers']=[];const _0x25a6d2=this['positions'],_0x10f366=Number(this['style'][_0x3c29f1(0x4f7)]);for(let _0x9c98d1=0x0,_0x463061=_0x25a6d2['length'];_0x9c98d1<_0x463061;_0x9c98d1++){const _0x1f7fbd=addPositionsHeight(_0x25a6d2[_0x9c98d1],_0x10f366),_0x152370=this['createDragger']({'position':_0x1f7fbd,'type':PointType[_0x3c29f1(_0x9593e._0x113fc9)],'tooltip':this[_0x3c29f1(_0x9593e._0x404e0c)][_0x3c29f1(0x44e)]('_修改高度'),'onDrag':(_0x2f9d12,_0x2c87b3)=>{const _0x45c80b=_0x3c29f1,_0x2705d8=Cesium__namespace['Cartographic']['fromCartesian'](_0x2c87b3)['height'];this['style']['diffHeight']=formatNum$1(_0x2705d8-this['_graphic']['_minimumHeights'][_0x2f9d12['index']],0x2);for(let _0x11d637=0x0;_0x11d637<_0x25a6d2['length'];_0x11d637++){if(_0x11d637===_0x2f9d12['index'])continue;this['_heightDraggers'][_0x11d637]['position']=addPositionsHeight(_0x25a6d2[_0x11d637],this['style']['diffHeight']);}this['updateAttrForEditing'](),this['fire'](EventType[_0x45c80b(_0x5378a0._0xec3390)]);}});_0x152370['index']=_0x9c98d1,this['draggers']['push'](_0x152370),this[_0x3c29f1(_0x9593e._0x506c1d)]['push'](_0x152370);}}}class WallEntity extends BasePolyEntity{get[_0x35a251(0x5a1)](){var _0x2abae2;return(_0x2abae2=this['_entity'])===null||_0x2abae2===void 0x0?void 0x0:_0x2abae2['wall'];}get['EditClass'](){return EditWall;}[_0x35a251(0x700)](){const _0x552f10={_0x129847:0x91},_0x568c3f=_0x35a251;var _0xec50a8;this['style']['diffHeight']=this['style'][_0x568c3f(0x4f7)]||0x64;const _0x3cca0a={'wall':WallStyleConver['toCesiumVal'](this['style'],{},!![])};this['style']['closure']&&((_0xec50a8=this['positions'])===null||_0xec50a8===void 0x0?void 0x0:_0xec50a8['length'])>0x0?_0x3cca0a['wall']['positions']=this['positions']['concat'](this['positions'][0x0]):_0x3cca0a['wall']['positions']=this[_0x568c3f(0xb35)],(!this['style'][_0x568c3f(_0x552f10._0x129847)]||!this['style']['minimumHeights'])&&this[_0x568c3f(0xa7)](_0x3cca0a),this['_entity']=this['_createEntity'](_0x3cca0a),this['style'][_0x568c3f(0x854)]&&this['_addLabel']();}['_style2Json'](_0x26c084,_0xb7d1a9){return WallStyleConver['toJSON'](_0x26c084,_0xb7d1a9,!![]);}['_updateStyleHook'](_0x1d4f3f,_0x13eb4f){const _0x17da37={_0x2ccfee:0x5a1},_0x9f819a=_0x35a251;WallStyleConver['toCesiumVal'](_0x1d4f3f,this[_0x9f819a(_0x17da37._0x2ccfee)],!![]),Cesium__namespace['defined'](_0x13eb4f['closure'])&&this[_0x9f819a(0xedd)](),Cesium__namespace['defined'](_0x13eb4f===null||_0x13eb4f===void 0x0?void 0x0:_0x13eb4f['diffHeight'])&&this['_updateMaxMinHeights'](this['_entity']);}['_updatePositionsHook'](){const _0x50cc37={_0x46bcab:0xb35,_0x304ced:0xe1e,_0x370bb7:0xb35,_0x2f331b:0x91,_0x13daa1:0xfc8,_0x882785:0xa7,_0x2504bd:0xdc9},_0x556707=_0x35a251;var _0x204b58;this['style']['closure']&&((_0x204b58=this[_0x556707(_0x50cc37._0x46bcab)])===null||_0x204b58===void 0x0?void 0x0:_0x204b58[_0x556707(_0x50cc37._0x304ced)])>0x0?this['entityGraphic']['positions']=this['positions']['concat'](this[_0x556707(_0x50cc37._0x370bb7)][0x0]):this['entityGraphic']['positions']=this[_0x556707(0xb35)],(!this['style'][_0x556707(_0x50cc37._0x2f331b)]||!this[_0x556707(_0x50cc37._0x13daa1)]['minimumHeights'])&&this[_0x556707(_0x50cc37._0x882785)](this['_entity']),this[_0x556707(_0x50cc37._0x2504bd)](),this['_updateEditDraggers']();}[_0x35a251(0xa7)](_0x13204c){const _0x3ed890={_0x2fbad3:0x34a,_0x6aeb3a:0x4c8,_0x5ffcf4:0xfc8,_0x39ea6c:0xb3a},_0x4fb476=_0x35a251,_0x3b958c=this[_0x4fb476(_0x3ed890._0x2fbad3)];if(!_0x3b958c||_0x3b958c[_0x4fb476(0xe1e)]===0x0)return;const _0x570def=_0x3b958c['length'],_0xb34433=new Array(_0x570def),_0x353f67=new Array(_0x570def);for(let _0x3b08b3=0x0;_0x3b08b3<_0x570def;_0x3b08b3++){const _0xeedbdb=_0x3b958c[_0x3b08b3]['alt'];_0xb34433[_0x3b08b3]=_0xeedbdb,this['style'][_0x4fb476(_0x3ed890._0x6aeb3a)]?_0x353f67[_0x3b08b3]=_0x3b958c[0x0][_0x4fb476(0x5d2)]+this[_0x4fb476(_0x3ed890._0x5ffcf4)]['diffHeight']:_0x353f67[_0x3b08b3]=_0xeedbdb+this['style']['diffHeight'];}this['style'][_0x4fb476(_0x3ed890._0x39ea6c)]&&_0x570def>0x0&&(_0xb34433['push'](_0xb34433[0x0]),_0x353f67['push'](_0x353f67[0x0])),this['_minimumHeights']=_0xb34433,this['_maximumHeights']=_0x353f67,_0x13204c&&(!(_0x13204c[_0x4fb476(0x2b1)]['minimumHeights']instanceof Cesium__namespace['CallbackProperty'])&&(_0x13204c['wall'][_0x4fb476(0xba)]=_0xb34433),!(_0x13204c['wall']['maximumHeights']instanceof Cesium__namespace['CallbackProperty'])&&(_0x13204c['wall']['maximumHeights']=_0x353f67));}['_setPositionsToCallback'](){const _0x2b1b8c={_0x470558:0x894,_0x54eb3d:0x18a},_0x80589b={_0x113848:0xe38},_0x120208=_0x35a251;if(this[_0x120208(_0x2b1b8c._0x470558)])return;super[_0x120208(0xac7)](),this[_0x120208(0x5a1)][_0x120208(0xba)]=new Cesium__namespace[(_0x120208(_0x2b1b8c._0x54eb3d))](_0x4c726a=>{return this['_minimumHeights'];},![]),this['entityGraphic']['maximumHeights']=new Cesium__namespace['CallbackProperty'](_0x5d623a=>{const _0x41882e=_0x120208;return this[_0x41882e(_0x80589b._0x113848)];},![]);}['_positions_CallbackProperty'](){const _0x2d3def={_0x2fd4de:0x937},_0x304ee3=_0x35a251;var _0x2e860b;return this['style']['closure']&&((_0x2e860b=this['_positions_draw'])===null||_0x2e860b===void 0x0?void 0x0:_0x2e860b['length'])>0x0?this[_0x304ee3(0x937)]['concat'](this[_0x304ee3(_0x2d3def._0x2fd4de)][0x0]):this[_0x304ee3(_0x2d3def._0x2fd4de)];}['_cancelPositionsCallback'](){const _0x206b6a={_0x47a851:0x5a1},_0x2be9f7=_0x35a251;if(!this['_isCallbackPositions'])return;super['_cancelPositionsCallback'](),this[_0x2be9f7(_0x206b6a._0x47a851)][_0x2be9f7(0xba)]=this['_minimumHeights'],this['entityGraphic']['maximumHeights']=this['_maximumHeights'];}['updateAttrForDrawing'](_0x4da45c){const _0x47a4fd={_0x1a073a:0x249},_0xd310fd=_0x35a251;this['_updateMaxMinHeights'](this[_0xd310fd(_0x47a4fd._0x1a073a)]);}}register$4('wall',WallEntity);class EditRectangle extends EditPoly{['bindDraggers'](){const _0x23ad96={_0x1370b6:0x5a1},_0x14ff07={_0x41c63d:0x18b,_0x17a7ff:0x682,_0x58ccc7:0xb61,_0x1bafbd:0xe1e,_0x443a17:0x5a1,_0x14d991:0x1bc},_0x13c8c1=_0x35a251,_0x51e503=this['positions'];for(let _0x15f8f3=0x0,_0x535083=_0x51e503[_0x13c8c1(0xe1e)];_0x15f8f3<_0x535083;_0x15f8f3++){const _0x454dfc=this['updatePositionsHeightByAttr'](_0x51e503[_0x15f8f3]),_0xde5d4b=this['createDragger']({'position':_0x454dfc,'onDrag':(_0x596996,_0xc04806)=>{const _0x59b4e9=_0x13c8c1,_0x2df19c=this['_map']['clock'][_0x59b4e9(_0x14ff07._0x41c63d)],_0x2ea1d2=getCesiumValue(this['entityGraphic'][_0x59b4e9(_0x14ff07._0x17a7ff)],Number,_0x2df19c);this['positions'][_0x596996['index']]=_0xc04806;if(this['entityGraphic']['height']!==undefined)for(let _0x34f064=0x0,_0x8fcd56=this[_0x59b4e9(0x1cf)]['length'];_0x34f064<_0x8fcd56;_0x34f064++){const _0x3482e9=this['draggers'][_0x34f064],_0x3b9c07=setPositionsHeight(this['positions'][_0x3482e9['index']],_0x2ea1d2);_0x3482e9[_0x59b4e9(_0x14ff07._0x58ccc7)]=_0x3b9c07,this['positions'][_0x3482e9['index']]=_0x3b9c07;}if(this[_0x59b4e9(0xdd0)]&&this['_heightDraggers'][_0x59b4e9(_0x14ff07._0x1bafbd)]>0x0){const _0x5c146e=getCesiumValue(this[_0x59b4e9(_0x14ff07._0x443a17)]['extrudedHeight'],Number,_0x2df19c);this['_heightDraggers'][_0x596996[_0x59b4e9(_0x14ff07._0x14d991)]][_0x59b4e9(_0x14ff07._0x58ccc7)]=setPositionsHeight(_0xc04806,_0x5c146e);}let _0x5f2678=centerOfMass(this[_0x59b4e9(0xb35)]);_0x5f2678=this['updatePositionsHeightByAttr'](_0x5f2678),this[_0x59b4e9(0x7e)]['position']=_0x5f2678;}});_0xde5d4b[_0x13c8c1(0x1bc)]=_0x15f8f3,this['draggers']['push'](_0xde5d4b);}this['_bindMoveAllDragger'](),this[_0x13c8c1(_0x23ad96._0x1370b6)]['extrudedHeight']&&this['_bindHeightDraggers']();}[_0x35a251(0x7e6)](_0x3dba72){const _0x27a608={_0x2ef2c1:0x42d},_0x5d76c6=_0x35a251;this[_0x5d76c6(0x979)]&&(_0x3dba72=getSurfacePosition(this[_0x5d76c6(0xd79)]['scene'],_0x3dba72));if(this['entityGraphic']['height']!==undefined){const _0x1ec1f7=getCesiumValue(this['entityGraphic']['height'],Number,this['_map'][_0x5d76c6(_0x27a608._0x2ef2c1)]['currentTime']);_0x3dba72=setPositionsHeight(_0x3dba72,_0x1ec1f7);}return _0x3dba72;}['_updateHeight'](_0x23c7a1){const _0x4338fb={_0x2a694a:0x5a1,_0x22202f:0xb35,_0x2ab98b:0x1cf},_0x496f04=_0x35a251;this[_0x496f04(_0x4338fb._0x2a694a)]['height']=_0x23c7a1,this['style']['height']=this['formatNum'](_0x23c7a1,0x2);const _0x4f6ec1=this[_0x496f04(_0x4338fb._0x22202f)];for(let _0x4f34ef=0x0,_0xfb07ca=_0x4f6ec1['length'];_0x4f34ef<_0xfb07ca;_0x4f34ef++){_0x4f6ec1[_0x4f34ef]=setPositionsHeight(_0x4f6ec1[_0x4f34ef],_0x23c7a1);}for(let _0x7828ff=0x0,_0x1cb574=this['draggers']['length'];_0x7828ff<_0x1cb574;_0x7828ff++){const _0x2ba9f3=this[_0x496f04(_0x4338fb._0x2ab98b)][_0x7828ff];_0x2ba9f3['position']=setPositionsHeight(_0x2ba9f3['position'],_0x23c7a1);}this[_0x496f04(0x264)](EventType[_0x496f04(0x53d)]);}}class RectangleEntity extends BasePolyEntity{constructor(_0x434566={}){const _0x5ab345={_0x5ead26:0xe86,_0x459c5f:0xc02,_0x10a48f:0xe86,_0x1c97e1:0xc02,_0x56ae79:0x310},_0x3a5afc=_0x35a251;super(_0x434566),this['_minPointNum']=0x2,this['_maxPointNum']=0x2,this[_0x3a5afc(0x817)]=!![];if(this[_0x3a5afc(_0x5ab345._0x5ead26)]['rectangle'])this[_0x3a5afc(_0x5ab345._0x459c5f)]=this['options']['rectangle'];else this[_0x3a5afc(_0x5ab345._0x10a48f)]['coordinates']&&(this[_0x3a5afc(_0x5ab345._0x1c97e1)]=this['options'][_0x3a5afc(_0x5ab345._0x56ae79)]);}get['entityGraphic'](){var _0x279c1f;return(_0x279c1f=this['_entity'])===null||_0x279c1f===void 0x0?void 0x0:_0x279c1f['rectangle'];}get['EditClass'](){return EditRectangle;}get[_0x35a251(0x176)](){const _0x48cb60={_0x4ef59b:0xab1},_0x4e5406=_0x35a251,_0x19b14d=getCesiumValue(this[_0x4e5406(_0x48cb60._0x4ef59b)]);if(!_0x19b14d)return null;const _0x5cd034=Cesium__namespace[_0x4e5406(0x120)]['toCartesian'](Cesium__namespace['Rectangle']['center'](_0x19b14d));return _0x5cd034;}get['outlinePositions'](){const _0x283bca={_0x6ca9f6:0x249,_0x58f297:0x249},_0x216deb=_0x35a251;return this[_0x216deb(_0x283bca._0x6ca9f6)]&&(this['_outlinePositions']=getOutlinePositions(this[_0x216deb(_0x283bca._0x58f297)])),this[_0x216deb(0x4fc)];}set[_0x35a251(0xec)](_0x406fc6){this['_outlinePositions']=_0x406fc6;}get[_0x35a251(0x4a1)](){const _0x360157=_0x35a251;return cartesians2lonlats(this[_0x360157(0xec)]);}get[_0x35a251(0xab1)](){const _0x96b1eb={_0x8f32d:0xd6},_0x5773bb=_0x35a251;return!this['_rectangle']&&this['positions']&&(this['_rectangle']=Cesium__namespace[_0x5773bb(_0x96b1eb._0x8f32d)]['fromCartesianArray'](this['positions'])),this['_rectangle'];}set['rectangle'](_0x3c5fd9){const _0x57f5ad={_0x1ee859:0x5a1},_0xec479c=_0x35a251;var _0x55ee10;(_0x55ee10=this['editing'])!==null&&_0x55ee10!==void 0x0&&_0x55ee10[_0xec479c(0x2a6)]&&!(_0x3c5fd9 instanceof Cesium__namespace[_0xec479c(0x18a)])?this['_rectangle_draw']=_0x3c5fd9:(this['_rectangle']=_0x3c5fd9,this['_entity']&&(this[_0xec479c(_0x57f5ad._0x1ee859)]['coordinates']=_0x3c5fd9));}get[_0x35a251(0x34a)](){const _0x211fdc=_0x35a251,_0xe2ff7a=[];let _0x5d1cb2;return this['_positions_draw']?_0x5d1cb2=this['_positions_draw']:_0x5d1cb2=this[_0x211fdc(0x58a)],!_0x5d1cb2&&(_0x5d1cb2=getOutlinePositions(this['_entity'],![])),_0x5d1cb2[_0x211fdc(0xdbd)](function(_0x4c09bf){const _0x3ee183=LngLatPoint['parse'](_0x4c09bf);if(!_0x3ee183||!_0x3ee183['valid']())return;_0xe2ff7a['push'](_0x3ee183);}),this['_points']=_0xe2ff7a,this[_0x211fdc(0x86e)];}get['distance'](){return getDistance(this['outlinePositions'],!![]);}get['area'](){return getSurfaceArea(this['outlinePositions']);}['getEntityPositions'](){const _0x977722={_0x14a7dc:0x249,_0x17b72:0x27d},_0x459e62=_0x35a251;if(!this['_entity']['rectangle'])return null;const _0x4a10ea=getCesiumValue(this[_0x459e62(_0x977722._0x14a7dc)]['rectangle']['coordinates'],Cesium__namespace[_0x459e62(0xd6)]),_0x11206d=getCesiumValue(this['_entity']['rectangle']['height'],Number)||0x0,_0x1f4a36=Cesium__namespace['Cartesian3']['fromRadians'](_0x4a10ea[_0x459e62(_0x977722._0x17b72)],_0x4a10ea[_0x459e62(0xdc7)],_0x11206d),_0x42429e=Cesium__namespace['Cartesian3']['fromRadians'](_0x4a10ea['east'],_0x4a10ea['north'],_0x11206d);return[_0x1f4a36,_0x42429e];}[_0x35a251(0x700)](){const _0x42f313={_0x35c587:0x8c3,_0x5f23ef:0x86a},_0x32034a=_0x35a251,_0x8d882b={'rectangle':RectangleStyleConver['toCesiumVal'](this['style'],{},!![])};_0x8d882b['rectangle']['coordinates']=this['rectangle'],this['_positions']instanceof Cesium__namespace[_0x32034a(0x18a)]&&(_0x8d882b['rectangle']['coordinates']=new Cesium__namespace[(_0x32034a(0x18a))](_0xc5b5c0=>{const _0x2c92c0=_0x32034a,_0x1b1761=this['_positions']['getValue'](_0xc5b5c0);return _0x1b1761&&_0x1b1761['length']>0x0?(this[_0x2c92c0(0xc02)]=Cesium__namespace['Rectangle']['fromCartesianArray'](_0x1b1761),this['_rectangle']):undefined;},![])),this['_entity']=this['_createEntity'](_0x8d882b),this['_updateHeight'](),this[_0x32034a(_0x42f313._0x35c587)](this['_getOutlinePositions'](),this['style']),this['_entity_outlines']&&this['entityGraphic']['coordinates']instanceof Cesium__namespace['CallbackProperty']&&this['_updateOutlineToCallback'](),this['style']['label']&&this[_0x32034a(_0x42f313._0x5f23ef)]();}['_style2Json'](_0x1f7926,_0x5d3d6c){return RectangleStyleConver['toJSON'](_0x1f7926,_0x5d3d6c,!![]);}['_updateStyleHook'](_0x422c9a,_0x3127c2){const _0x2afc8c={_0x3a7288:0x4f7},_0xc499c7=_0x35a251;RectangleStyleConver['toCesiumVal'](_0x422c9a,this['entityGraphic'],!![]),(Cesium__namespace['defined'](_0x3127c2[_0xc499c7(_0x2afc8c._0x3a7288)])||Cesium__namespace['defined'](_0x3127c2[_0xc499c7(0x682)]))&&this['_updateHeight']();}['_updatePositionsHook'](){const _0x2f24ca={_0xa8424a:0x937},_0xb39be9=_0x35a251;this['positions']?this['rectangle']=Cesium__namespace['Rectangle']['fromCartesianArray'](this['positions']):this['_rectangle_draw']=Cesium__namespace[_0xb39be9(0xd6)]['fromCartesianArray'](this[_0xb39be9(_0x2f24ca._0xa8424a)]),this[_0xb39be9(0xec)]=getOutlinePositions(this['_entity']),this['_updateOutlineStyle'](this['_getOutlinePositions'](),this['style']),this['_updateLabelPosition'](),this['_updateHeight'](),this['_updateEditDraggers']();}['_getOutlineStyle'](_0x5db242,_0x1ae97c){const _0x5d60f6={_0x398e0c:0xd96,_0x10a618:0x32a},_0x2bd4e9=_0x35a251,_0x4fbdab=super['_getOutlineStyle'](_0x5db242,_0x1ae97c);return _0x4fbdab[_0x2bd4e9(_0x5d60f6._0x398e0c)]=Cesium__namespace['ArcType'][_0x2bd4e9(_0x5d60f6._0x10a618)],_0x4fbdab;}['_getOutlinePositions'](){return[this['outlinePositions']];}['toGeoJSON'](_0x1c23d4){return super['toGeoJSON'](_0x1c23d4);}['_getGeoJsonGeometry'](_0x21f6e6){const _0x234c03=_0x35a251;return _0x21f6e6!==null&&_0x21f6e6!==void 0x0&&_0x21f6e6[_0x234c03(0xb83)]?{'type':_0x234c03(0xa0b),'coordinates':[this['getOutlineCoordinates'](_0x21f6e6===null||_0x21f6e6===void 0x0?void 0x0:_0x21f6e6['closure'],_0x21f6e6===null||_0x21f6e6===void 0x0?void 0x0:_0x21f6e6['noAlt'])]}:{'type':'LineString','coordinates':this['getCoordinates'](_0x21f6e6===null||_0x21f6e6===void 0x0?void 0x0:_0x21f6e6['noAlt'])};}[_0x35a251(0xac7)](){const _0x1bf664={_0x4cbdb3:0x894},_0x2c994a=_0x35a251;if(this['_isCallbackPositions'])return;this[_0x2c994a(_0x1bf664._0x4cbdb3)]=!![];const _0x4c32ce=this[_0x2c994a(0xb35)];_0x4c32ce?(_0x4c32ce instanceof Cesium__namespace['CallbackProperty']?this['_positions_draw']=this['getEntityPositions']():this['_positions_draw']=this[_0x2c994a(0xb35)],this['_rectangle_draw']=Cesium__namespace['Rectangle']['fromCartesianArray'](this['_positions_draw'])):(this[_0x2c994a(0x937)]=[],this['_rectangle_draw']=null),this['rectangle']=new Cesium__namespace['CallbackProperty'](_0x5b5172=>{return this['_rectangle_draw'];},![]),this[_0x2c994a(0x166)]();}['_cancelPositionsCallback'](){const _0x636895={_0x283fcd:0x894,_0x7a8e52:0x5a1,_0x296bc7:0x937},_0x2836e5=_0x35a251;if(!this['_isCallbackPositions'])return;this[_0x2836e5(_0x636895._0x283fcd)]=![],this['_positions']=this[_0x2836e5(0x937)],this['_rectangle']=this['_rectangle_draw'],this['_entity']&&(this[_0x2836e5(_0x636895._0x7a8e52)]['coordinates']=this['_rectangle_draw']),delete this[_0x2836e5(_0x636895._0x296bc7)],delete this['_rectangle_draw'],this['_cancelOutlinePositionsCallback']();}[_0x35a251(0x149)](_0x4d26ff){const _0x53f735={_0x530ba6:0x249},_0x48d44e=_0x35a251;this['_rectangle_draw']=Cesium__namespace['Rectangle']['fromCartesianArray'](this['_positions_draw']),this['_entity_outlines']&&(this['_updateOutlineToCallback'](),this[_0x48d44e(0x4fc)]=getOutlinePositions(this[_0x48d44e(_0x53f735._0x530ba6)])),this['_updateHeight'](![]);}[_0x35a251(0x626)](_0x222a10=!![]){const _0x15f595={_0x56bdc0:0x682,_0x2276f8:0x937,_0x54e41e:0x4f7},_0x587c70=_0x35a251;if(this['style']['clampToGround'])return;let _0x39c3e3=0x0;_0x222a10&&Cesium__namespace['defined'](this['style'][_0x587c70(_0x15f595._0x56bdc0)])?_0x39c3e3=this['style']['height']:_0x39c3e3=getMaxHeight(this[_0x587c70(_0x15f595._0x2276f8)]||this['_positions']),this['entityGraphic']['height']=_0x39c3e3,this['style']['height']=_0x39c3e3,Cesium__namespace['defined'](this[_0x587c70(0xfc8)][_0x587c70(0x4f7)])&&(Cesium__namespace['defined'](this['style']['diffHeight'])&&this['style']['diffHeight']!==0x0?this['entityGraphic']['extrudedHeight']=_0x39c3e3+this['style'][_0x587c70(_0x15f595._0x54e41e)]:this[_0x587c70(0x5a1)]['extrudedHeight']=undefined),this['fire'](EventType['editStyle']);}['getOutlinePositions'](_0x40152b){return getOutlinePositions(this['_entity'],_0x40152b);}['getOutlineCoordinates'](_0x1b7567,_0x538fec){return cartesians2lonlats(this['getOutlinePositions'](_0x1b7567),_0x538fec);}['getRectangle'](_0x5ec2c9){const _0x1f30e6=this['_rectangle_draw']||this['rectangle'];return _0x5ec2c9!==null&&_0x5ec2c9!==void 0x0&&_0x5ec2c9['isFormat']?formatRectangle(_0x1f30e6):_0x1f30e6;}['isInPoly'](_0x23b19e){const _0x824398={_0xc7df84:0x249,_0x52d225:0x8d0},_0x37b4ea=_0x35a251;var _0x239246;const _0x3789ec=getCesiumValue((_0x239246=this[_0x37b4ea(_0x824398._0xc7df84)]['rectangle'])===null||_0x239246===void 0x0?void 0x0:_0x239246['coordinates'],Cesium__namespace['Rectangle']),_0x1dc102=Cesium__namespace['Rectangle']['contains'](_0x3789ec,LngLatPoint[_0x37b4ea(_0x824398._0x52d225)](_0x23b19e)['toCartographic']());return _0x1dc102;}[_0x35a251(0x5b2)](_0x27f075={}){const _0x3549ed={_0xddb8a9:0xd79,_0x369ee8:0xfc8,_0x1c7669:0x497},_0x17520a=_0x35a251;if(!this[_0x17520a(_0x3549ed._0xddb8a9)])return;return _0x27f075[_0x17520a(0x979)]=this[_0x17520a(_0x3549ed._0x369ee8)]['clampToGround'],this['_map'][_0x17520a(_0x3549ed._0x1c7669)](getCesiumValue(this['rectangle'],Cesium__namespace['Rectangle']),_0x27f075),this;}}register$4('rectangle',RectangleEntity);function getOutlinePositions(_0x205487,_0x3487a4=!![]){const _0x5f4ad6={_0x12305c:0x310,_0x5321da:0x6de},_0x1f4a97=_0x35a251;if(!_0x205487||!_0x205487['rectangle'])return[];const _0x30d9a0=getCesiumValue(_0x205487['rectangle'][_0x1f4a97(_0x5f4ad6._0x12305c)],Cesium__namespace['Rectangle']);if(!_0x30d9a0)return[];const _0x145d04=getCesiumValue(_0x205487['rectangle']['rotation'],Number)||0x0,_0x272c66=getCesiumValue(_0x205487['rectangle'][_0x1f4a97(0x682)],Number)||0x0,_0x1f579c=getRectangleOuterPositions({'rectangle':_0x30d9a0,'rotation':_0x145d04,'height':_0x272c66});return _0x3487a4&&_0x1f579c[_0x1f4a97(_0x5f4ad6._0x5321da)](_0x1f579c[0x0]),_0x1f579c;}function getAllPositions(_0x313758){const _0x59469d={_0x432636:0x909},_0x15ac53=_0x35a251,_0x173c5e=getCesiumValue(_0x313758[_0x15ac53(_0x59469d._0x432636)]['hierarchy'],Cesium__namespace[_0x15ac53(0xb39)]),_0x256192=getHierarchyVal(_0x173c5e);return _0x256192;}function getPositions(_0x155c5d,_0x42723f){const _0x3b08d9=_0x35a251;if(!_0x42723f&&_0x155c5d['_positions_draw']&&_0x155c5d['_positions_draw']['length']>0x0)return _0x155c5d['_positions_draw'];let _0x581ded=getCesiumValue(_0x155c5d[_0x3b08d9(0x909)]['hierarchy'],Cesium__namespace['PolygonHierarchy']);return _0x581ded&&_0x581ded instanceof Cesium__namespace['PolygonHierarchy']&&(_0x581ded=_0x581ded['positions']),_0x581ded;}function getHolesPositions(_0x569caf){const _0x4ce58a={_0x3fcb58:0x97a},_0x16694a=_0x35a251,_0x52b8c6=getCesiumValue(_0x569caf['polygon']['hierarchy'],Cesium__namespace[_0x16694a(0xb39)]),_0x501df0=getHierarchyVal(_0x52b8c6);return _0x501df0[_0x16694a(0xe1e)]>0x1?_0x501df0[_0x16694a(_0x4ce58a._0x3fcb58)](0x1):null;}function getHierarchyVal(_0x928c27){const _0x5ef3bf={_0x178358:0xb39,_0x4249b0:0xb35},_0x309aaa=_0x35a251;if(!_0x928c27)return[];if(_0x928c27&&_0x928c27 instanceof Cesium__namespace[_0x309aaa(_0x5ef3bf._0x178358)]){let _0x1935a9=[_0x928c27[_0x309aaa(_0x5ef3bf._0x4249b0)]];for(let _0x519ed9=0x0,_0x134ecc=_0x928c27[_0x309aaa(0x1a2)]['length'];_0x519ed9<_0x134ecc;_0x519ed9++){const _0x434aef=_0x928c27['holes'][_0x519ed9];_0x1935a9=_0x1935a9['concat'](getHierarchyVal(_0x434aef));}return _0x1935a9;}else return[_0x928c27];}function getPolygonHierarchy(_0xa0265f,_0x57341c){const _0xa495d={_0x23c5d2:0xe1e,_0x52fdd3:0xb39},_0x293996=_0x35a251;if(_0xa0265f['length']===0x0)return new Cesium__namespace[(_0x293996(0xb39))]();const _0x1e7c71=[];if(_0xa0265f[_0x293996(_0xa495d._0x23c5d2)]>0x1)for(let _0x4e0262=0x1,_0x164b13=_0xa0265f[_0x293996(0xe1e)];_0x4e0262<_0x164b13;_0x4e0262++){_0x1e7c71['push'](new Cesium__namespace[(_0x293996(0xb39))](lonlats2cartesians(_0xa0265f[_0x4e0262],_0x57341c)));}const _0x562118=_0xa0265f[0x0],_0x27e6bd=new Cesium__namespace[(_0x293996(_0xa495d._0x52fdd3))](lonlats2cartesians(_0x562118,_0x57341c),_0x1e7c71);return _0x27e6bd;}function getPolygonHierarchy2(_0x125400){const _0x2b062d={_0x5069a6:0xe1e,_0x5ef59a:0xe1e,_0x3106df:0x6de,_0x58f41b:0xb39},_0x32c9a0=_0x35a251;if(_0x125400['length']===0x0)return new Cesium__namespace['PolygonHierarchy']();const _0x5c7a82=[];if(_0x125400[_0x32c9a0(_0x2b062d._0x5069a6)]>0x1)for(let _0xd784a6=0x1,_0x59452b=_0x125400[_0x32c9a0(_0x2b062d._0x5ef59a)];_0xd784a6<_0x59452b;_0xd784a6++){_0x5c7a82[_0x32c9a0(_0x2b062d._0x3106df)](new Cesium__namespace[(_0x32c9a0(0xb39))](LngLatArray['toCartesians'](_0x125400[_0xd784a6])));}const _0x275e58=_0x125400[0x0],_0x76493=new Cesium__namespace[(_0x32c9a0(_0x2b062d._0x58f41b))](LngLatArray['toCartesians'](_0x275e58),_0x5c7a82);return _0x76493;}class EditPolygon extends EditPoly{get['hasClosure'](){const _0x29c9dd=_0x35a251;return this['_graphic'][_0x29c9dd(0x815)]??!![];}get['clampToGround'](){const _0x15483a={_0x3cbe73:0x163,_0x3bd829:0x94d},_0x5e7388=_0x35a251;var _0x19b47f,_0x3a3dcf;return this['style']['clampToGround']??!getCesiumValue((_0x19b47f=this[_0x5e7388(_0x15483a._0x3cbe73)])===null||_0x19b47f===void 0x0?void 0x0:(_0x3a3dcf=_0x19b47f['entityGraphic'])===null||_0x3a3dcf===void 0x0?void 0x0:_0x3a3dcf[_0x5e7388(_0x15483a._0x3bd829)],Boolean);}['bindDraggers'](){const _0x143a9c={_0x34ae5f:0x7f4,_0xc739d6:0x163},_0x4106fd=_0x35a251;var _0x182d73;super['bindDraggers']();if(((_0x182d73=this[_0x4106fd(0x163)]['_draw_holes'])===null||_0x182d73===void 0x0?void 0x0:_0x182d73['length'])>0x0)for(let _0x5c8ff1=0x0,_0x1c62f6=this['_graphic'][_0x4106fd(_0x143a9c._0x34ae5f)]['length'];_0x5c8ff1<_0x1c62f6;_0x5c8ff1++){this['bindHolesDraggers'](this[_0x4106fd(_0x143a9c._0xc739d6)]['_draw_holes'][_0x5c8ff1],_0x5c8ff1);}}['bindHolesDraggers'](_0x29aca0,_0x2522b9){const _0x10dc60={_0x2773a8:0xd79},_0x4dedd1={_0x4921ce:0xe87},_0x30da94={_0x2b2f2e:0x1bc},_0x203e53={_0x50f4e9:0xe87},_0x5796c2={_0x249713:0x7e6,_0x307a5a:0xb61},_0x37ad9e=_0x35a251;for(let _0x4e6675=0x0,_0x2128cd=_0x29aca0['length'];_0x4e6675<_0x2128cd;_0x4e6675++){const _0x35b365=this[_0x37ad9e(0x7e6)](_0x29aca0[_0x4e6675]),_0x1ea466=this['createDragger']({'position':_0x35b365,'onDrag':(_0x5e3869,_0x200c1a)=>{const _0x43c3e0=_0x37ad9e;_0x200c1a=this[_0x43c3e0(_0x5796c2._0x249713)](_0x200c1a),_0x5e3869[_0x43c3e0(_0x5796c2._0x307a5a)]=_0x200c1a,_0x29aca0[_0x5e3869['index']]=_0x200c1a;},'onDragEnd':(_0x2fed46,_0x53868c)=>{const _0x4dece1=_0x37ad9e;this[_0x4dece1(_0x203e53._0x50f4e9)]();}});_0x1ea466['index']=_0x4e6675,this['draggers']['push'](_0x1ea466);if(this[_0x37ad9e(0x710)]&&(this[_0x37ad9e(0x815)]||!this['hasClosure']&&_0x4e6675<_0x2128cd-0x1)){const _0x424999=(_0x4e6675+0x1)%_0x2128cd;let _0x5ec3e7=getMidpoint(_0x35b365,_0x29aca0[_0x424999]);_0x5ec3e7=this[_0x37ad9e(0x7e6)](_0x5ec3e7);const _0x3458c=this['createDragger']({'position':_0x5ec3e7,'type':PointType[_0x37ad9e(0x696)],'tooltip':this[_0x37ad9e(_0x10dc60._0x2773a8)]['getLangText']('_增加点'),'onDragStart':(_0x1af1aa,_0x5555cc)=>{const _0x52993d=_0x37ad9e;_0x29aca0[_0x52993d(0xce0)](_0x1af1aa[_0x52993d(_0x30da94._0x2b2f2e)],0x0,_0x5555cc);},'onDrag':(_0x2d8fdd,_0xbce94e)=>{_0x29aca0[_0x2d8fdd['index']]=_0xbce94e;},'onDragEnd':(_0x1b2b3e,_0x45d345)=>{const _0x372bff=_0x37ad9e;this['_fireAddPoint'](_0x1b2b3e,_0x45d345),this[_0x372bff(_0x4dedd1._0x4921ce)]();}});_0x3458c[_0x37ad9e(0x1bc)]=_0x424999,this['draggers']['push'](_0x3458c);}}}}const nullColor$1=new Cesium__namespace[(_0x35a251(0xf29))](0x0,0x0,0x0,0.01);class PolygonEntity extends BasePolyEntity{constructor(_0x1e5efa={}){super(_0x1e5efa),this['_minPointNum']=_0x1e5efa['minPointNum']??0x3,this['_clampToGround_reload']=!![];}get[_0x35a251(0x5a1)](){const _0x25575a={_0x709d91:0x909},_0x1e4110=_0x35a251;var _0x4845cf;return(_0x4845cf=this['_entity'])===null||_0x4845cf===void 0x0?void 0x0:_0x4845cf[_0x1e4110(_0x25575a._0x709d91)];}get['EditClass'](){return EditPolygon;}get['center'](){const _0x4e5643=_0x35a251;return this[_0x4e5643(0xda2)];}get['distance'](){return getDistance(this['positionsShow'],!![]);}get['positionsShow'](){const _0x59c665={_0x170c60:0xb35},_0x5bdde2=_0x35a251;let _0x2e9a76=getCesiumValue(this['_positions']);return _0x2e9a76 instanceof Cesium__namespace['PolygonHierarchy']&&(_0x2e9a76=_0x2e9a76[_0x5bdde2(_0x59c665._0x170c60)]),this['_positions_show']??this['getShowPositions'](_0x2e9a76);}get['hierarchy'](){const _0x45e908={_0x2055dd:0x5c7},_0x458fe7=_0x35a251;var _0x5a10a3;return this['_hierarchy']||((_0x5a10a3=this['entityGraphic'])===null||_0x5a10a3===void 0x0?void 0x0:_0x5a10a3[_0x458fe7(_0x45e908._0x2055dd)]);}get['positions'](){return this['_positions'];}set[_0x35a251(0xb35)](_0x11cd55){const _0x4ac8d7={_0x502a04:0xa50,_0x3fd7ff:0xe97,_0x701c8f:0xe97,_0x11d7ff:0x682,_0x3727c3:0x8eb,_0x294903:0xdbd,_0x518dd6:0xedd,_0xd337bc:0x264,_0x584e1:0x58a},_0x1777bd={_0x32e5fe:0x6b3,_0x64a2f7:0x5d2},_0x16e46c=_0x35a251;var _0x16a2e5;if(!_0x11cd55)return;!((_0x16a2e5=this[_0x16e46c(_0x4ac8d7._0x502a04)])!==null&&_0x16a2e5!==void 0x0&&_0x16a2e5['enabled'])&&(this[_0x16e46c(_0x4ac8d7._0x3fd7ff)]=null,this['_positions_show']=null);_0x11cd55 instanceof Cesium__namespace['PolygonHierarchy']&&(this[_0x16e46c(_0x4ac8d7._0x701c8f)]=_0x11cd55,_0x11cd55=this[_0x16e46c(0xe97)]['positions']);if(Array[_0x16e46c(0x719)](_0x11cd55)){var _0x156908;if(_0x11cd55['length']>0x0&&Array['isArray'](_0x11cd55[0x0])&&_0x11cd55[0x0][_0x16e46c(0xe1e)]>0x0){const _0x302955=_0x11cd55[0x0][0x0];if(Array['isArray'](_0x302955)&&isNumber(_0x302955[0x0]))this['_hierarchy']=getPolygonHierarchy(_0x11cd55,this['style'][_0x16e46c(_0x4ac8d7._0x11d7ff)]||this['style']['setHeight']||this[_0x16e46c(0xfc8)]['addHeight']),_0x11cd55=this[_0x16e46c(0xe97)]['positions'];else _0x302955 instanceof Cesium__namespace[_0x16e46c(_0x4ac8d7._0x3727c3)]&&(this['_hierarchy']=getPolygonHierarchy2(_0x11cd55),_0x11cd55=this[_0x16e46c(0xe97)]['positions']);}const _0x337b9d=[],_0x19b10f=[];_0x11cd55[_0x16e46c(_0x4ac8d7._0x294903)]((_0x3adea9,_0x57870b)=>{const _0x226677=_0x16e46c,_0x2fc9fd=LngLatPoint['parse'](_0x3adea9);if(!_0x2fc9fd)return;let _0x38ec85=this['style']['setHeight'];if(Cesium__namespace['defined'](_0x38ec85)){if(isString(_0x38ec85))_0x38ec85=Number(template(_0x38ec85,this[_0x226677(_0x1777bd._0x32e5fe)],!![])),isNaN(_0x38ec85)&&(_0x38ec85=0x0);else Array['isArray'](_0x38ec85)&&(_0x38ec85=_0x38ec85[_0x57870b]||0x0);_0x2fc9fd[_0x226677(_0x1777bd._0x64a2f7)]=_0x38ec85;}const _0x1e4470=this['getAddHeight'](_0x57870b);_0x1e4470!==0x0&&(_0x2fc9fd['alt']=_0x2fc9fd[_0x226677(0x5d2)]+_0x1e4470),_0x337b9d['push'](_0x2fc9fd),_0x19b10f['push'](_0x2fc9fd['toCartesian']());}),this[_0x16e46c(0x86e)]=_0x337b9d,(_0x156908=this['editing'])!==null&&_0x156908!==void 0x0&&_0x156908['enabled']?this['_positions_draw']=_0x19b10f:this['_positions']=_0x19b10f;}else this['_positions']=_0x11cd55;this['_entity']&&this[_0x16e46c(_0x4ac8d7._0x518dd6)](),this[_0x16e46c(_0x4ac8d7._0xd337bc)](EventType['updatePosition'],{'positions':this[_0x16e46c(_0x4ac8d7._0x584e1)]});}['getEntityPositions'](){return getPositions(this['_entity']);}['getShowPositions'](_0x335f5f){return _0x335f5f;}[_0x35a251(0x700)](){const _0x51077d={_0x1fcd90:0x58a,_0x4aaf43:0x909,_0xa88f20:0xe97,_0x412b1c:0x5c7,_0xf34c04:0xb35,_0x216e85:0x5c7,_0x57e994:0x249,_0x51a50e:0x854},_0x32c2fa={_0x3b9675:0x8bb,_0x32bf0c:0xec},_0x377761=_0x35a251,_0x5a0a76={'polygon':PolygonStyleConver['toCesiumVal'](this['style'],{},!![])};if(this[_0x377761(_0x51077d._0x1fcd90)]instanceof Cesium__namespace[_0x377761(0x18a)]){const _0x3c4b99=this['_positions']['getValue'](this[_0x377761(0xd79)]['clock']['currentTime']);if(_0x3c4b99&&Array['isArray'](_0x3c4b99)){const _0x1549b8=new Cesium__namespace['PolygonHierarchy']();_0x5a0a76[_0x377761(_0x51077d._0x4aaf43)][_0x377761(0x5c7)]=new Cesium__namespace[(_0x377761(0x18a))](_0x347ac4=>{const _0x39a15e=_0x377761;var _0xd63a61;const _0x4b63dc=this[_0x39a15e(0x58a)]['getValue'](_0x347ac4);this['_positions_show']=this['getShowPositions'](_0x4b63dc),_0x1549b8['positions']=this['_positions_show'];if(this[_0x39a15e(_0x32c2fa._0x3b9675)]&&((_0xd63a61=this['_positions_show'])===null||_0xd63a61===void 0x0?void 0x0:_0xd63a61['length'])>0x0){var _0x2faaeb;((_0x2faaeb=this['style'][_0x39a15e(0xbbd)])===null||_0x2faaeb===void 0x0?void 0x0:_0x2faaeb[_0x39a15e(0xb3a)])??!![]?this[_0x39a15e(_0x32c2fa._0x32bf0c)]=this['_positions_show']['concat'](this['_positions_show'][0x0]):this[_0x39a15e(0xec)]=this['_positions_show'];}return _0x1549b8;},![]),this[_0x377761(_0x51077d._0xa88f20)]=_0x1549b8;}else _0x5a0a76['polygon']['hierarchy']=this[_0x377761(0x58a)];}else this['_hierarchy']?_0x5a0a76['polygon'][_0x377761(_0x51077d._0x412b1c)]=this['_hierarchy']:(!this['_positions_show']&&(this['_positions_show']=this['getShowPositions'](this[_0x377761(_0x51077d._0xf34c04)])),_0x5a0a76[_0x377761(_0x51077d._0x4aaf43)][_0x377761(_0x51077d._0x216e85)]=new Cesium__namespace['PolygonHierarchy'](this['_positions_show']));this[_0x377761(_0x51077d._0x57e994)]=this['_createEntity'](_0x5a0a76),this['_updateDiffHeight'](),this['_bindExType'](),this['_updateOutlineStyle'](this['_getOutlinePositions'](),this[_0x377761(0xfc8)]),this['_entity']['polygon']['hierarchy']instanceof Cesium__namespace[_0x377761(0x18a)]&&this['_updateOutlineToCallback'](),this['style'][_0x377761(_0x51077d._0x51a50e)]&&this['_addLabel']();}['_bindExType'](){const _0x10ad2b={_0x39eaa1:0xed5,_0x16fab3:0x6b3,_0x295ab4:0x682,_0x1e6274:0x682,_0x3f65e3:0xbdc,_0x3e1619:0x9db},_0x44f2f0=_0x35a251,_0x5bae04=this['options'][_0x44f2f0(_0x10ad2b._0x39eaa1)]||this['_layer']['options'][_0x44f2f0(0xed5)];if(_0x5bae04&&(_0x5bae04['enabled']??!![])){if(_0x5bae04[_0x44f2f0(0xe4b)]){let _0x570436;if(isNumber(_0x5bae04['bottomHeight']))_0x570436=_0x5bae04['bottomHeight'];else isString(_0x5bae04['bottomHeight'])&&(_0x570436=Number(this['attr'][_0x5bae04['bottomHeight']]||0x0));this['_entity']['polygon']['height']=_0x570436;}const _0x53f73b=Number(this[_0x44f2f0(_0x10ad2b._0x16fab3)][_0x5bae04['cloumn']]||0x1);let _0x42d12b;if(isNumber(_0x5bae04[_0x44f2f0(0x682)]))_0x42d12b=_0x5bae04[_0x44f2f0(_0x10ad2b._0x295ab4)];else isString(_0x5bae04[_0x44f2f0(0x682)])?_0x42d12b=this[_0x44f2f0(0x6b3)][_0x5bae04[_0x44f2f0(_0x10ad2b._0x1e6274)]]||_0x42d12b:_0x42d12b=3.5;const _0x39bd2f=getCesiumValue(this['_entity']['polygon']['height'])||0x0;this['_entity']['polygon']['extrudedHeight']=_0x39bd2f+_0x53f73b*_0x42d12b;}const _0x6453cf=this['options'][_0x44f2f0(0xaf2)]||this[_0x44f2f0(0x2d0)]['options']['dth'];_0x6453cf&&(this['_entity']['polygon']['classificationType']=Cesium__namespace[_0x44f2f0(_0x10ad2b._0x3f65e3)][_0x44f2f0(0x349)],!Cesium__namespace['defined'](this['style'][_0x44f2f0(_0x10ad2b._0x3e1619)])&&(this['_entity']['polygon']['material']=nullColor$1),!Cesium__namespace['defined'](this['style']['height'])&&(this['_entity']['polygon']['perPositionHeight']=![]),this[_0x44f2f0(0x249)]['polygon']['zIndex']=0x63);}['_updateDiffHeight'](){const _0x2212a7={_0x5b063d:0xfc8,_0x32c1e6:0x4f7,_0x3afa14:0x58a},_0x199e20=_0x35a251;if(!Cesium__namespace[_0x199e20(0xaa2)](this[_0x199e20(_0x2212a7._0x5b063d)][_0x199e20(_0x2212a7._0x32c1e6)])||this['entityGraphic']['extrudedHeight']instanceof Cesium__namespace['CallbackProperty'])return;if(Cesium__namespace['defined'](this['style']['diffHeight'])&&this['style']['diffHeight']!==0x0){let _0xcc9658=0x0;Cesium__namespace['defined'](this[_0x199e20(0xfc8)]['height'])?_0xcc9658=this['style']['height']:_0xcc9658=getMaxHeight(this['_positions_draw']||this[_0x199e20(_0x2212a7._0x3afa14)]),this['entityGraphic'][_0x199e20(0x552)]=_0xcc9658+this[_0x199e20(_0x2212a7._0x5b063d)]['diffHeight'];}else this['entityGraphic'][_0x199e20(0x552)]=undefined;}['_style2Json'](_0x1069c6,_0x1a3227){const _0xf93b52=_0x35a251;return PolygonStyleConver[_0xf93b52(0x99e)](_0x1069c6,_0x1a3227,!![]);}['_updateStyleHook'](_0x2d40d5,_0x2da832){const _0x1fa7e={_0x1a61b0:0x4f7},_0x249f0a=_0x35a251;PolygonStyleConver['toCesiumVal'](_0x2d40d5,this['entityGraphic'],!![]),(Cesium__namespace['defined'](_0x2da832[_0x249f0a(_0x1fa7e._0x1a61b0)])||Cesium__namespace['defined'](_0x2da832[_0x249f0a(0x682)]))&&this['_updateDiffHeight']();}['_updatePositionsHook'](){const _0x48e505={_0x96b785:0x819,_0x43e22c:0x9eb,_0x623b87:0x819},_0xf45ab8=_0x35a251;if(this['_positions']instanceof Cesium__namespace[_0xf45ab8(0x18a)]){var _0x20505f;this['entityGraphic']['hierarchy']=this['_positions'],(_0x20505f=this['editing'])!==null&&_0x20505f!==void 0x0&&_0x20505f['enabled']&&this['_hierarchy']&&(this['_positions_show']=this[_0xf45ab8(_0x48e505._0x96b785)](this[_0xf45ab8(0x937)]),this['_hierarchy']['positions']=this[_0xf45ab8(_0x48e505._0x43e22c)]);}else this['_hierarchy']?this['entityGraphic']['hierarchy']=this[_0xf45ab8(0xe97)]:(this['_positions_show']=this[_0xf45ab8(_0x48e505._0x623b87)](this['positions']),this[_0xf45ab8(0x5a1)]['hierarchy']=new Cesium__namespace['PolygonHierarchy'](this['_positions_show']));this['_updateOutlineStyle'](this[_0xf45ab8(0xbcb)](),this[_0xf45ab8(0xfc8)]),this['_updateLabelPosition'](),this['_updateDiffHeight'](),this['_updateEditDraggers']();}['_getOutlinePositions'](){return getAllPositions(this['_entity']);}['toGeoJSON'](_0x4bded4){return super['toGeoJSON'](_0x4bded4);}['_getGeoJsonGeometry'](_0xd17016){const _0x3cb6c9={_0x2c2072:0xdbd},_0x622c6d=_0x35a251;var _0x591469,_0x1e5e89;let _0x3d8625=this[_0x622c6d(0x797)](_0xd17016===null||_0xd17016===void 0x0?void 0x0:_0xd17016['noAlt']);_0xd17016!==null&&_0xd17016!==void 0x0&&_0xd17016['closure']&&_0x3d8625['length']>0x0&&_0x3d8625['push'](_0x3d8625[0x0]);if(((_0x591469=this['_hierarchy'])===null||_0x591469===void 0x0?void 0x0:(_0x1e5e89=_0x591469['holes'])===null||_0x1e5e89===void 0x0?void 0x0:_0x1e5e89['length'])>0x0){_0x3d8625=[_0x3d8625];const _0x4dac3c=getHolesPositions(this[_0x622c6d(0x249)]);_0x4dac3c[_0x622c6d(_0x3cb6c9._0x2c2072)](_0x190202=>{_0x3d8625['push'](LngLatArray['toArray'](_0x190202));});}return{'type':'Polygon','coordinates':[_0x3d8625]};}['setCallbackPositions'](_0x246741){const _0x516fe0=_0x35a251;return this['_setPositionsToCallback'](),_0x246741&&(_0x246741&&(_0x246741=LngLatArray['toCartesians'](_0x246741)),this['_positions_draw']=_0x246741,this[_0x516fe0(0xe97)]['positions']=_0x246741),this['_positions_draw'];}[_0x35a251(0x133)](){return this['_hierarchy'];}['_cancelPositionsCallback'](){const _0x2142a2={_0x167dd7:0x736,_0x1a962a:0xe97},_0x45109e=_0x35a251;super[_0x45109e(_0x2142a2._0x167dd7)](),this[_0x45109e(_0x2142a2._0x1a962a)]=null;}['_startDrawHook'](){const _0x2f495b={_0x896d0c:0xe4d,_0x28457b:0xfc8},_0x7ef013=_0x35a251;super[_0x7ef013(_0x2f495b._0x896d0c)](),this['_updateOutlineStyle']([new Cesium__namespace['CallbackProperty'](_0x436d6f=>{return this['outlinePositions'];},![])],this['style'],{'show':!![],'width':0x2,'color':this[_0x7ef013(_0x2f495b._0x28457b)]['color']});}[_0x35a251(0xac7)](){const _0x3cad73={_0x28469b:0x894,_0x4c5073:0x7f4,_0x449d0f:0x249,_0xc4bbd6:0xac7},_0x14da67=_0x35a251;if(this[_0x14da67(_0x3cad73._0x28469b)])return;this[_0x14da67(_0x3cad73._0x4c5073)]=getHolesPositions(this[_0x14da67(_0x3cad73._0x449d0f)]),super[_0x14da67(_0x3cad73._0xc4bbd6)]();}['updateAttrForDrawing'](_0x4db0b6){const _0x494079={_0x3e7a46:0xdbd,_0xd3f0f3:0xe97,_0xdb62ce:0xe1e,_0x184bf0:0x8c3},_0x53400b=_0x35a251;var _0x2fa775;if(!this['_hierarchy']){this['_hierarchy']=new Cesium__namespace['PolygonHierarchy']();if(this[_0x53400b(0x7f4)]){const _0x31c599=[];this['_draw_holes'][_0x53400b(_0x494079._0x3e7a46)](_0x5f1f3d=>{_0x31c599['push'](new Cesium__namespace['PolygonHierarchy'](_0x5f1f3d));}),this['_hierarchy']['holes']=_0x31c599;}}this['_positions_show']=this['getShowPositions'](this['_positions_draw']),this[_0x53400b(_0x494079._0xd3f0f3)][_0x53400b(0xb35)]=this['_positions_show'];if(((_0x2fa775=this[_0x53400b(0x9eb)])===null||_0x2fa775===void 0x0?void 0x0:_0x2fa775[_0x53400b(_0x494079._0xdb62ce)])>0x0){var _0x5c8cb3;((_0x5c8cb3=this['style']['outlineStyle'])===null||_0x5c8cb3===void 0x0?void 0x0:_0x5c8cb3['closure'])??!![]?this['outlinePositions']=this['_positions_show']['concat'](this['_positions_show'][0x0]):this['outlinePositions']=this['_positions_show'];}let _0x63118c;this['_positions_draw']['length']-0x1;_0x47682e--){removePrimitive(_0x8a571b[_0x47682e],_0x509c37,_0x654bff);}for(const _0x1ce56d in this){delete this[_0x1ce56d];}return Cesium__namespace['destroyObject'](this);},RectangularSensorVisualizer['prototype']['_onCollectionChanged']=function(_0x55409b,_0x1ac536,_0xf56d93,_0x1d0d6f){const _0x19b6ee={_0x234baa:0xe1e,_0x395a71:0xdb7},_0x5c964e=_0x35a251,_0x33841c=this['_entitiesToVisualize'];if(!_0x33841c)return;const _0x1949ee=this[_0x5c964e(0xeb9)],_0x2056e8=this['_primitives'];let _0x38c142,_0x2c4983;for(_0x38c142=_0x1ac536[_0x5c964e(_0x19b6ee._0x234baa)]-0x1;_0x38c142>-0x1;_0x38c142--){_0x2c4983=_0x1ac536[_0x38c142],defined$2(_0x2c4983['_rectangularSensorMars'])&&defined$2(_0x2c4983[_0x5c964e(_0x19b6ee._0x395a71)])&&_0x33841c['set'](_0x2c4983['id'],_0x2c4983);}for(_0x38c142=_0x1d0d6f[_0x5c964e(_0x19b6ee._0x234baa)]-0x1;_0x38c142>-0x1;_0x38c142--){_0x2c4983=_0x1d0d6f[_0x38c142],defined$2(_0x2c4983['_rectangularSensorMars'])&&defined$2(_0x2c4983['_position'])?_0x33841c[_0x5c964e(0xcd3)](_0x2c4983['id'],_0x2c4983):(removePrimitive(_0x2c4983,_0x1949ee,_0x2056e8),_0x33841c['remove'](_0x2c4983['id']));}for(_0x38c142=_0xf56d93['length']-0x1;_0x38c142>-0x1;_0x38c142--){_0x2c4983=_0xf56d93[_0x38c142],removePrimitive(_0x2c4983,_0x1949ee,_0x2056e8),_0x33841c['remove'](_0x2c4983['id']);}};const originalDefaultVisualizersCallback=Cesium__namespace[_0x35a251(0x868)]['defaultVisualizersCallback'];Cesium__namespace[_0x35a251(0x868)][_0x35a251(0x303)]=function(_0x521d37,_0x3ef57c,_0x4b1654){const _0x372409=_0x4b1654['entities'],_0x5a83fd=originalDefaultVisualizersCallback(_0x521d37,_0x3ef57c,_0x4b1654);return _0x5a83fd['concat']([new RectangularSensorVisualizer(_0x521d37,_0x372409)]);};class RectangularSensor extends BasePointEntity{get['entityGraphic'](){const _0x1e1740=_0x35a251;var _0x47bcef;return(_0x47bcef=this['_entity'])===null||_0x47bcef===void 0x0?void 0x0:_0x47bcef[_0x1e1740(0x663)];}get[_0x35a251(0x907)](){const _0xa759ef={_0x40300f:0xfc8},_0x102766=_0x35a251;return this[_0x102766(_0xa759ef._0x40300f)]['radius'];}set[_0x35a251(0x907)](_0x1516e6){const _0x3419e5={_0xb8ba11:0xfc8},_0x44f617=_0x35a251;this[_0x44f617(_0x3419e5._0xb8ba11)]['radius']=_0x1516e6,this[_0x44f617(0x249)]&&(this['entityGraphic']['radius']=_0x1516e6);}[_0x35a251(0x700)](){const _0x3a2baf={_0x2b561b:0x3e7},_0x489301=_0x35a251,_0x18f501={'position':this['position'],'orientation':this[_0x489301(_0x3a2baf._0x2b561b)](),'rectangularSensorMars':new RectangularSensorGraphics(RectangularSensorStyleConver['toCesiumVal'](this['style']))};this['_entity']=this['_createEntity'](_0x18f501),this['style']['label']&&this[_0x489301(0x86a)]();}['_updateStyleHook'](_0x5da3c5,_0x425938){const _0x288f1f={_0x2a7177:0x249,_0x570dcb:0x313,_0x4fac36:0x1ee},_0x205cb3=_0x35a251;if(this[_0x205cb3(_0x288f1f._0x2a7177)]&&this['isAdded']){const _0x10d8f6=this['_layer'][_0x205cb3(0xad5)];_0x10d8f6[_0x205cb3(_0x288f1f._0x570dcb)][_0x205cb3(_0x288f1f._0x4fac36)](this['_entity']),delete this['_entity'],this['_mountedHook'](),_0x10d8f6[_0x205cb3(_0x288f1f._0x570dcb)]['add'](this['_entity']);}}['_updateEntityOpacity'](_0x1eaafe,_0x31fe4a){const _0x20b214={_0x1ff793:0x9a2},_0x464452=_0x35a251,_0xc3e5ee=_0x1eaafe===null||_0x1eaafe===void 0x0?void 0x0:_0x1eaafe['material'];if(!_0xc3e5ee)return![];const _0x415dbc=getCesiumColor(_0xc3e5ee['color'],Cesium__namespace['Color'][_0x464452(_0x20b214._0x1ff793)]);return!Cesium__namespace['defined'](this[_0x464452(0xad)])&&(this['_material_color_alpha']=_0x415dbc['alpha']),_0xc3e5ee['color']=_0x415dbc['withAlpha'](this['_material_color_alpha']*_0x31fe4a),!![];}['_updateExOpacity'](_0x441e76){const _0x29e009={_0x1969f9:0x5a1,_0x329d54:0xaa2,_0x13056f:0xbbc,_0x349ceb:0xf29},_0x28ed17=_0x35a251,_0x10c69e=getCesiumColor(this[_0x28ed17(_0x29e009._0x1969f9)]['lineColor'],Cesium__namespace['Color']['WHITE']);!Cesium__namespace[_0x28ed17(_0x29e009._0x329d54)](this['_lineColor_alpha'])&&(this[_0x28ed17(_0x29e009._0x13056f)]=_0x10c69e['alpha']);this[_0x28ed17(0x5a1)]['lineColor']=_0x10c69e[_0x28ed17(0x373)](this['_lineColor_alpha']*_0x441e76);const _0x3552f9=getCesiumColor(this['entityGraphic']['scanPlaneColor'],Cesium__namespace[_0x28ed17(_0x29e009._0x349ceb)]['WHITE']);!Cesium__namespace[_0x28ed17(_0x29e009._0x329d54)](this['_scanPlaneColor_alpha'])&&(this['_scanPlaneColor_alpha']=_0x3552f9['alpha']),this['entityGraphic'][_0x28ed17(0x659)]=_0x3552f9['withAlpha'](this['_scanPlaneColor_alpha']*_0x441e76);}[_0x35a251(0x1e0)](_0x1f361c,_0x1a26e6){return RectangularSensorStyleConver['toJSON'](_0x1f361c,_0x1a26e6,!![]);}}register$4(_0x35a251(0x4ab),RectangularSensor,!![]);const DEF_STYLE$m={'distance':0.1,'perPositionHeight':!![],'showFrustum':![],'opacity':0x1,'flipx':![],'flipy':![]};class Video2D extends PolygonEntity{constructor(_0x32677d={}){const _0x5e0419={_0x1ef6db:0xfc8,_0xe7b2b4:0xb61,_0x5ae854:0x8d4},_0x24876c=_0x35a251;_0x32677d[_0x24876c(_0x5e0419._0x1ef6db)]={...DEF_STYLE$m,..._0x32677d['style']||{}},super(_0x32677d),_0x32677d['position']&&(this[_0x24876c(_0x5e0419._0xe7b2b4)]=_0x32677d['position']),this[_0x24876c(_0x5e0419._0x5ae854)]=!![];}get['czmObjectEx'](){const _0x84e0e8={_0x16661b:0x8bb},_0x41925a=_0x35a251;let _0x19b735=[];return this['_frustumPrimitive']&&_0x19b735['push'](this['_frustumPrimitive']),this['_entity_label']&&_0x19b735[_0x41925a(0x6de)](this[_0x41925a(0x3b2)]),this[_0x41925a(0x8bb)]&&(_0x19b735=_0x19b735['concat'](this[_0x41925a(_0x84e0e8._0x16661b)])),_0x19b735;}get['position'](){return getPositionValue(this['_position']);}set['position'](_0x44840c){const _0x39a0c0={_0xa16b3b:0xf44,_0xb48830:0xf44},_0x8542e2=_0x35a251;var _0x534f1e;this[_0x8542e2(_0x39a0c0._0xa16b3b)]=LngLatPoint['parse'](_0x44840c),this['_position']=(_0x534f1e=this[_0x8542e2(_0x39a0c0._0xb48830)])===null||_0x534f1e===void 0x0?void 0x0:_0x534f1e['toCartesian'](),this['_entity']&&(this['_updatePositionsHook'](),this['_updateDraw'](),this['_bindHierarchy']());}get['point'](){return this['_point'];}get[_0x35a251(0x242)](){const _0xd8912a=_0x35a251;return this['point'][_0xd8912a(0x769)]();}get['targetPosition'](){const _0x390327=_0x35a251;return this[_0x390327(0xe86)]['targetPosition'];}set['targetPosition'](_0x5dd30d){const _0x34d908={_0x7275cd:0xe86,_0x25efd5:0x8eb,_0x334936:0x79b,_0x13d7d2:0x41f},_0x421d20=_0x35a251;var _0x166c15;this[_0x421d20(_0x34d908._0x7275cd)]['targetPosition']=_0x5dd30d;if(!this['_map'])return;const _0x52e59e=this['position'];if(!_0x52e59e)return;const _0x16f7d7=LngLatPoint['toCartesian'](_0x5dd30d,(_0x166c15=this['_map'])===null||_0x166c15===void 0x0?void 0x0:_0x166c15['currentTime']);this['distance']=Cesium__namespace[_0x421d20(_0x34d908._0x25efd5)]['distance'](_0x52e59e,_0x16f7d7);const _0x3b381f=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace[_0x421d20(0x8eb)]['subtract'](_0x16f7d7,_0x52e59e,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x297c04=Cesium__namespace['Cartesian3']['normalize'](_0x52e59e,new Cesium__namespace[(_0x421d20(0x8eb))]()),_0x13eada=new Cesium__namespace['Camera'](this['_map'][_0x421d20(0xc60)]);_0x13eada['position']=_0x52e59e,_0x13eada[_0x421d20(_0x34d908._0x334936)]=_0x3b381f,_0x13eada['up']=_0x297c04,this[_0x421d20(0xfc8)][_0x421d20(_0x34d908._0x13d7d2)]=Cesium__namespace['Math']['toDegrees'](_0x13eada['heading']),this['style']['pitch']=Cesium__namespace['Math']['toDegrees'](_0x13eada['pitch']),this[_0x421d20(0x447)](),this[_0x421d20(0xda6)]();}get['heading'](){return this['style']['heading']??0x0;}set['heading'](_0x1da82d){const _0x28d7c0={_0x49b03a:0xfc8},_0x421582=_0x35a251;this[_0x421582(_0x28d7c0._0x49b03a)][_0x421582(0x41f)]=_0x1da82d,this[_0x421582(0x447)](),this['_bindHierarchy']();}get['pitch'](){const _0x148714={_0x2caed6:0xfc8},_0x3e59cc=_0x35a251;return this[_0x3e59cc(_0x148714._0x2caed6)]['pitch']??0x0;}set['pitch'](_0x2b1a02){const _0x1bb3b6={_0x51a168:0x527},_0x4c865f=_0x35a251;this[_0x4c865f(0xfc8)][_0x4c865f(_0x1bb3b6._0x51a168)]=_0x2b1a02,this['_updateDraw'](),this['_bindHierarchy']();}get['roll'](){const _0x3a7931={_0x1ee68c:0xfc8},_0x4b0a84=_0x35a251;return this[_0x4b0a84(_0x3a7931._0x1ee68c)]['roll']??0x0;}set['roll'](_0x46f7f9){const _0x305eae={_0x558ada:0xfc8},_0x3bef69=_0x35a251;this[_0x3bef69(_0x305eae._0x558ada)][_0x3bef69(0xba7)]=_0x46f7f9,this['_updateDraw'](),this['_bindHierarchy']();}get['angle'](){return this['style']['angle'];}set[_0x35a251(0x2c9)](_0x1a664a){this['style']['angle']=_0x1a664a,this['_updateDraw'](),this['_bindHierarchy']();}get[_0x35a251(0x79c)](){return this['style']['angle2']??this['style']['angle'];}set['angle2'](_0xf52f86){this['style']['angle2']=_0xf52f86,this['_updateDraw'](),this['_bindHierarchy']();}get['distance'](){const _0x55daff={_0x2a7102:0xfc8},_0x2c2707=_0x35a251;return this[_0x2c2707(_0x55daff._0x2a7102)]['distance'];}set['distance'](_0x1a42b5){const _0x417ed6=_0x35a251;this['style']['distance']=_0x1a42b5,this[_0x417ed6(0x447)](),this[_0x417ed6(0xda6)]();}get['opacity'](){return this['style']['opacity'];}set['opacity'](_0x3246eb){const _0x4abf2a={_0x23d67b:0x249},_0x338d5f=_0x35a251;this[_0x338d5f(0xfc8)]['opacity']=_0x3246eb,this['_entity']&&(this['_entity']['polygon']['material'][_0x338d5f(0x65f)]['_value']['alpha']=_0x3246eb,this[_0x338d5f(_0x4abf2a._0x23d67b)][_0x338d5f(0x909)][_0x338d5f(0x27f)]['transparent']=_0x3246eb!==0x1);}get['flipx'](){return this['style']['flipx'];}set[_0x35a251(0x424)](_0x794dcf){const _0x45163c={_0x1d57dc:0xfc8},_0x31f55=_0x35a251;this[_0x31f55(_0x45163c._0x1d57dc)][_0x31f55(0x424)]=_0x794dcf,this[_0x31f55(0x249)]&&(this['_entity']['polygon']['material']['flipx']=_0x794dcf);}get['showFrustum'](){const _0x5a3682=_0x35a251;return this['style'][_0x5a3682(0xb95)];}set[_0x35a251(0xb95)](_0x4b32b9){const _0x4459cc={_0x29dd4d:0xfc8},_0x757f3e=_0x35a251;this[_0x757f3e(_0x4459cc._0x29dd4d)]['showFrustum']=_0x4b32b9,this[_0x757f3e(0x69e)]['show']=_0x4b32b9;}get['play'](){return this['_videoPlay'];}set['play'](_0x247cbb){const _0x104578={_0x3e21f7:0x456,_0x316aba:0x3a6},_0x27228e=_0x35a251;this['_videoPlay']=_0x247cbb;if(!this['_videoContainer'])return;try{this['_videoPlay']?this[_0x27228e(_0x104578._0x3e21f7)]['play']():this['_videoContainer'][_0x27228e(_0x104578._0x316aba)]();}catch(_0x363d22){}}[_0x35a251(0x530)](){const _0x2aac46={_0x8aca44:0xd05,_0x472588:0x456,_0x23f917:0xfc8,_0x5f43e5:0xbc3,_0xdf6b1a:0x94f},_0x3643c0=_0x35a251;var _0x32e1b7;this['_hasRemoveElement']&&(_0x32e1b7=this['_videoContainer'])!==null&&_0x32e1b7!==void 0x0&&_0x32e1b7[_0x3643c0(0x803)]&&(this['_videoContainer']['parentNode']['removeChild'](this['_videoContainer']),delete this['_hasRemoveElement'],delete this[_0x3643c0(0x456)]);if(this['style'][_0x3643c0(_0x2aac46._0x8aca44)])this[_0x3643c0(_0x2aac46._0x472588)]=createVideo(this[_0x3643c0(_0x2aac46._0x23f917)]['url'],this['style']['fileType'],'',document['body']),this['_videoContainer'][_0x3643c0(0xfc8)]['display']='none',this[_0x3643c0(_0x2aac46._0x5f43e5)]=!![];else this['style'][_0x3643c0(0x94f)]&&(this[_0x3643c0(_0x2aac46._0x472588)]=this['style'][_0x3643c0(_0x2aac46._0xdf6b1a)]);this['_videoContainer']&&(this[_0x3643c0(0x249)]['polygon']['material']=new Image2MaterialProperty({'image':this[_0x3643c0(_0x2aac46._0x472588)],'color':Cesium__namespace['Color']['WHITE']['withAlpha'](this['style']['opacity']),'transparent':this['style']['opacity']!==0x1,'flipx':this['style']['flipx'],'flipy':this['style']['flipy']}));}['_mountedHook'](){const _0x2fa153={_0x21f287:0x530},_0x30c9ce=_0x35a251;super['_mountedHook'](),this[_0x30c9ce(0xe86)]['targetPosition']&&(this['targetPosition']=this[_0x30c9ce(0xe86)]['targetPosition']),this[_0x30c9ce(_0x2fa153._0x21f287)]();}[_0x35a251(0x6a1)](_0x45e4fd,_0x4e2e9b){super['_updateStyleHook'](_0x45e4fd,_0x4e2e9b),(_0x4e2e9b['url']||_0x4e2e9b['container'])&&this['updateVideoContainer']();}['_addedHook'](_0x4582c7){const _0x2d16c7={_0x595c5b:0xda6,_0x40f7bc:0xad5},_0x420bb3=_0x35a251;this['_updateDraw'](),this[_0x420bb3(_0x2d16c7._0x595c5b)](),this[_0x420bb3(_0x2d16c7._0x40f7bc)]['entities']['add'](this['_entity']);}['_removedHook'](){const _0x30fcc0={_0x5f30ff:0x456},_0x342e43=_0x35a251;var _0x486a6d;this['_frustumPrimitive']&&(this['_layer'][_0x342e43(0x293)]['remove'](this['_frustumPrimitive']),delete this['_frustumPrimitive']),this['dataSource']['entities']['remove'](this['_entity']),this[_0x342e43(0xbc3)]&&(_0x486a6d=this['_videoContainer'])!==null&&_0x486a6d!==void 0x0&&_0x486a6d['parentNode']&&(this['_videoContainer']['parentNode']['removeChild'](this['_videoContainer']),delete this['_hasRemoveElement'],delete this[_0x342e43(_0x30fcc0._0x5f30ff)]);}['_updateDraw'](){const _0x2544d3={_0x2d2ac3:0x7c0,_0x5194c4:0xc60,_0x1e69e7:0x2c9,_0x4d03f9:0xeed,_0x249a42:0x516,_0x497101:0xc46,_0x2a7835:0xd31,_0x25ef21:0xf3,_0x2e85c2:0x7c0,_0x1fe95c:0x7ba,_0x1cfdac:0xd31,_0xc6801d:0x8eb,_0x52ef7b:0x8eb},_0x4265db=_0x35a251;if(!this[_0x4265db(0xd79)])return;const _0x138e82=this['position'];if(!_0x138e82)return;const _0x417ef2=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace[_0x4265db(_0x2544d3._0x2d2ac3)]['toRadians'](this['heading']),Cesium__namespace['Math'][_0x4265db(0x7ba)](this['pitch']),Cesium__namespace[_0x4265db(_0x2544d3._0x2d2ac3)][_0x4265db(0x7ba)](this[_0x4265db(0xba7)])),_0x20fc20=new Cesium__namespace['Camera'](this['_map'][_0x4265db(_0x2544d3._0x5194c4)]);_0x20fc20[_0x4265db(0xb61)]=_0x138e82,_0x20fc20['frustum']['fov']=Cesium__namespace['Math']['toRadians'](this[_0x4265db(_0x2544d3._0x1e69e7)]*0x2),_0x20fc20['frustum']['aspectRatio']=this['angle']/this['angle2'],_0x20fc20['frustum'][_0x4265db(0x170)]=0.01,_0x20fc20['frustum']['far']=this['style'][_0x4265db(_0x2544d3._0x4d03f9)],_0x20fc20[_0x4265db(0xdc6)]({'destination':_0x138e82,'orientation':{'heading':_0x417ef2['heading'],'pitch':_0x417ef2['pitch'],'roll':_0x417ef2['roll']}}),this[_0x4265db(_0x2544d3._0x249a42)](_0x20fc20);const _0x1ab799=_0x20fc20['directionWC'],_0x31e831=_0x20fc20[_0x4265db(_0x2544d3._0x497101)],_0x19e9c7=_0x20fc20['rightWC'],_0xe28d1e=new Cesium__namespace[(_0x4265db(0xd31))](_0x138e82,_0x1ab799),_0x2349e6=Cesium__namespace[_0x4265db(_0x2544d3._0x2a7835)][_0x4265db(_0x2544d3._0x25ef21)](_0xe28d1e,this['style']['distance'],new Cesium__namespace['Cartesian3']()),_0x5b195a=Cesium__namespace[_0x4265db(_0x2544d3._0x2e85c2)][_0x4265db(_0x2544d3._0x1fe95c)](this['angle']),_0x3297cd=Math[_0x4265db(0x9b5)](_0x5b195a),_0x4df328=this['style']['distance']*_0x3297cd,_0x4cf34f=_0x4df328/_0x20fc20['frustum']['aspectRatio'],_0x17f5e7=Math['sqrt'](_0x4df328*_0x4df328+_0x4cf34f*_0x4cf34f),_0x894c54=new Cesium__namespace['Cartesian3'](),_0x4e2211=new Cesium__namespace['Ray'](_0x2349e6,_0x19e9c7),_0xda5d77=Cesium__namespace['Ray']['getPoint'](_0x4e2211,_0x4df328,new Cesium__namespace['Cartesian3']()),_0x5e2972=new Cesium__namespace['Ray'](_0xda5d77,_0x31e831);Cesium__namespace['Ray']['getPoint'](_0x5e2972,_0x4cf34f,_0x894c54);const _0x267f56=new Cesium__namespace['Cartesian3'](),_0x440fcc=Cesium__namespace['Cartesian3']['negate'](_0x31e831,new Cesium__namespace['Cartesian3']()),_0x1b416f=new Cesium__namespace[(_0x4265db(_0x2544d3._0x1cfdac))](_0xda5d77,_0x440fcc);Cesium__namespace['Ray']['getPoint'](_0x1b416f,_0x4cf34f,_0x267f56);const _0x2b86ec=new Cesium__namespace[(_0x4265db(_0x2544d3._0xc6801d))](),_0x4bc984=Cesium__namespace[_0x4265db(0x8eb)][_0x4265db(0xebd)](Cesium__namespace[_0x4265db(0x8eb)]['subtract'](_0x2349e6,_0x894c54,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x24716b=new Cesium__namespace[(_0x4265db(_0x2544d3._0x1cfdac))](_0x2349e6,_0x4bc984);Cesium__namespace['Ray']['getPoint'](_0x24716b,_0x17f5e7,_0x2b86ec);const _0x21fb3f=new Cesium__namespace['Cartesian3'](),_0x2ac762=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace[_0x4265db(_0x2544d3._0x52ef7b)][_0x4265db(0xc61)](_0x2349e6,_0x267f56,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x1a8e3a=new Cesium__namespace[(_0x4265db(0xd31))](_0x2349e6,_0x2ac762);Cesium__namespace[_0x4265db(_0x2544d3._0x1cfdac)]['getPoint'](_0x1a8e3a,_0x17f5e7,_0x21fb3f);const _0x1eb0cd=[_0x21fb3f,_0x894c54,_0x267f56,_0x2b86ec];this['_positions']=_0x1eb0cd;}[_0x35a251(0xda6)](){const _0x2eec16={_0x21da15:0xb39,_0xe721b1:0x249,_0x4e5c94:0x909,_0x1bc1a7:0x5c7},_0x319da8=_0x35a251;if(!this['_entity'])return;if(this['_position']instanceof Cesium__namespace[_0x319da8(0x18a)]||this['_position']instanceof Cesium__namespace['SampledPositionProperty']){const _0x17f845=new Cesium__namespace[(_0x319da8(_0x2eec16._0x21da15))]();this['_entity'][_0x319da8(0x909)]['hierarchy']=new Cesium__namespace['CallbackProperty'](_0x3def62=>{const _0x307145=_0x319da8;return this['_updateDraw'](),_0x17f845['positions']=this[_0x307145(0x58a)],_0x17f845;},![]);}else this[_0x319da8(_0x2eec16._0xe721b1)][_0x319da8(_0x2eec16._0x4e5c94)][_0x319da8(_0x2eec16._0x1bc1a7)]=new Cesium__namespace['PolygonHierarchy'](this['_positions']);}[_0x35a251(0x516)](_0x3b2b40){const _0x503075={_0x306cc7:0xc46,_0x42a35b:0x8eb,_0x550169:0x3f3,_0x4d325b:0xd9d,_0x53ae30:0x653,_0x98bdfd:0x21c},_0x4d2459=_0x35a251,_0x50c9dc=_0x3b2b40['directionWC'],_0x47a6ae=_0x3b2b40[_0x4d2459(_0x503075._0x306cc7)];let _0x4b9007=_0x3b2b40['rightWC'];_0x4b9007=Cesium__namespace[_0x4d2459(_0x503075._0x42a35b)]['negate'](_0x4b9007,new Cesium__namespace['Cartesian3']());const _0xb601d=new Cesium__namespace['Matrix3']();Cesium__namespace[_0x4d2459(0xd9d)][_0x4d2459(_0x503075._0x550169)](_0xb601d,0x0,_0x4b9007,_0xb601d),Cesium__namespace[_0x4d2459(_0x503075._0x4d325b)]['setColumn'](_0xb601d,0x1,_0x47a6ae,_0xb601d),Cesium__namespace[_0x4d2459(0xd9d)]['setColumn'](_0xb601d,0x2,_0x50c9dc,_0xb601d);const _0x51bded=Cesium__namespace[_0x4d2459(_0x503075._0x53ae30)][_0x4d2459(0xbf8)](_0xb601d,new Cesium__namespace['Quaternion']());this['_frustumPrimitive']&&this[_0x4d2459(0x2d0)]['primitiveCollection']['remove'](this['_frustumPrimitive']),this['_frustumPrimitive']=new Cesium__namespace[(_0x4d2459(_0x503075._0x98bdfd))]({'geometryInstances':new Cesium__namespace[(_0x4d2459(0x291))]({'id':this['id'],'geometry':new Cesium__namespace['FrustumOutlineGeometry']({'origin':_0x3b2b40['position'],'orientation':_0x51bded,'frustum':_0x3b2b40['frustum'],'_drawNearPlane':!![]}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](Cesium__namespace['Color']['AZURE'])}}),'appearance':new Cesium__namespace[(_0x4d2459(0x1a7))]({'translucent':![],'flat':!![]}),'asynchronous':![],'show':this[_0x4d2459(0xb95)]&&this['show']}),this['_layer']['primitiveCollection']['add'](this[_0x4d2459(0x69e)]);}['_style2JsonBase'](_0xfed38f,_0x28706d){const _0x13f131={_0x130404:0x94f,_0x42b49d:0x456},_0x1c9ba8=_0x35a251,_0xd3e20=getAttrVal(_0xfed38f,{'onlySimpleType':!![]});return this['style']['container']&&(_0xd3e20[_0x1c9ba8(_0x13f131._0x130404)]='document.getElementById('+this[_0x1c9ba8(_0x13f131._0x42b49d)]['id']+')'),_0xd3e20;}['_getGeoJsonGeometry'](_0x5ac6cc){const _0x1e657b={_0x1aa31e:0xe0c},_0x5b81b4=_0x35a251;return{'type':'Point','coordinates':this['getCoordinate'](_0x5ac6cc===null||_0x5ac6cc===void 0x0?void 0x0:_0x5ac6cc[_0x5b81b4(_0x1e657b._0x1aa31e)])};}['getCoordinate'](_0x343a4a){const _0x385a70={_0x3d3ed7:0x1ba},_0x21d03a=_0x35a251;return this['point']?this[_0x21d03a(_0x385a70._0x3d3ed7)]['toArray'](_0x343a4a):[];}['setView'](){const _0x4b8831={_0xcb133d:0x41f},_0x1ef234=_0x35a251;if(!this['_map'])return;this['_map'][_0x1ef234(0x7d)]['setView']({'destination':this['position'],'orientation':{'heading':Cesium__namespace['Math']['toRadians'](this[_0x1ef234(_0x4b8831._0xcb133d)]),'pitch':Cesium__namespace[_0x1ef234(0x7c0)]['toRadians'](this['pitch']),'roll':Cesium__namespace['Math']['toRadians'](this['roll'])}});}[_0x35a251(0x2ef)](_0x32ca8f){const _0x25a01b={_0x16b5b4:0x492,_0x719b09:0xcd2},_0x25ea41=_0x35a251;if(this['_enabledDraw'])return this;this['_enabledDraw']=!![];_0x32ca8f&&this['addTo'](_0x32ca8f);if(!this['_map'])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this['_map'][_0x25ea41(_0x25a01b._0x16b5b4)](!![]),this['enableControl'](![]),this['_startDrawHook'](),this['fire'](EventType[_0x25ea41(_0x25a01b._0x719b09)],{'drawtype':this['type'],'graphic':this},!![]);}['stopDraw'](){const _0x5dbe51={_0x29d2c7:0xf13,_0x520a63:0xe86},_0x868eec=_0x35a251;var _0x55e631,_0x483019,_0x1db643;if(!this[_0x868eec(0x5f2)])return this;this[_0x868eec(0x433)](),this['_map']['_setEditCursor'](![]),this['enableControl'](!![]),this[_0x868eec(0xd79)]['closeSmallTooltip'](),this[_0x868eec(0x5f2)]=![];if(!this['position']||!this['distance']){this['remove'](!![]);return;}this['fire'](EventType['drawCreated'],{'drawtype':this['type'],'graphic':this},!![]),(_0x55e631=this[_0x868eec(0xe86)])!==null&&_0x55e631!==void 0x0&&_0x55e631[_0x868eec(0xcf6)]&&this['options']['success'](this),(_0x483019=this['options'])!==null&&_0x483019!==void 0x0&&(_0x1db643=_0x483019[_0x868eec(_0x5dbe51._0x29d2c7)])!==null&&_0x1db643!==void 0x0&&_0x1db643[_0x868eec(0xc74)]&&this[_0x868eec(_0x5dbe51._0x520a63)][_0x868eec(_0x5dbe51._0x29d2c7)]['resolve'](this);}[_0x35a251(0xe4d)](){const _0x487cc9=_0x35a251;this['_map']['on'](EventType[_0x487cc9(0xfb4)],this['_onClickHandler'],this),this[_0x487cc9(0xd79)]['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this);}[_0x35a251(0x433)](){const _0x4b2d79={_0x3dfc5e:0xd79,_0x5c23cf:0x3b4},_0x2c0bd8=_0x35a251;this[_0x2c0bd8(_0x4b2d79._0x3dfc5e)]['off'](EventType['click'],this['_onClickHandler'],this),this['_map']['off'](EventType['mouseMove'],this[_0x2c0bd8(_0x4b2d79._0x5c23cf)],this);}['_onClickHandler'](_0x2ffbc0){const _0x5197b5={_0x3bb778:0x264,_0x238d81:0xb61,_0x288003:0x4cd,_0x546d1b:0xbb7},_0x914a22=_0x35a251,_0x3da51a=_0x2ffbc0['cartesian'];if(!_0x3da51a)return;this[_0x914a22(_0x5197b5._0x3bb778)](EventType['drawAddPoint'],{..._0x2ffbc0,'drawtype':this['type'],'graphic':this},!![]);if(!this['position']){this[_0x914a22(_0x5197b5._0x238d81)]=_0x3da51a;return;}this[_0x914a22(_0x5197b5._0x288003)]=_0x3da51a,this['stopDraw'](),this['fire'](EventType[_0x914a22(_0x5197b5._0x546d1b)],_0x2ffbc0);}['_onMouseMoveHandler'](_0x366244){const _0x581178={_0x354b3d:0xd79,_0x507141:0xd79},_0x420175=_0x35a251,_0x546710=_0x366244['cartesian'];if(!_0x546710)return;const _0x842a87=this[_0x420175(0xb61)];_0x842a87?(this['targetPosition']=_0x546710,this['fire'](EventType['drawMouseMove'],{..._0x366244,'drawtype':this['type'],'graphic':this},!![]),this['_map']['openSmallTooltip'](_0x366244['endPosition'],this[_0x420175(_0x581178._0x354b3d)]['getLangText']('_单击完成绘制'))):this['_map']['openSmallTooltip'](_0x366244['endPosition'],this[_0x420175(_0x581178._0x507141)]['getLangText']('_单击开始绘制'));}}register$4('video2D',Video2D,!![]);class PitEntity extends BasePolyEntity{constructor(_0x499b8c={}){const _0xacdac1={_0x2bf66f:0x4f7,_0x1a3385:0xfc8,_0x2ac9e1:0x453,_0x5f24e6:0xfc8,_0x4389d9:0x453},_0x389578=_0x35a251;super(_0x499b8c),this['style'][_0x389578(_0xacdac1._0x2bf66f)]=this['style']['diffHeight']??0xa,this[_0x389578(_0xacdac1._0x1a3385)][_0x389578(_0xacdac1._0x2ac9e1)]=this[_0x389578(_0xacdac1._0x5f24e6)][_0x389578(_0xacdac1._0x4389d9)]??0x32;}get['diffHeight'](){const _0xbf632f={_0x41735d:0x4f7},_0x2c233c=_0x35a251;return this['style'][_0x2c233c(_0xbf632f._0x41735d)];}set[_0x35a251(0x4f7)](_0x2990d2){const _0x5057bb={_0x5d8304:0x249,_0x342f5d:0x909},_0x39d6d1=_0x35a251;this['style']['diffHeight']=_0x2990d2;if(this[_0x39d6d1(_0x5057bb._0x5d8304)]){const _0x489c20=this['_minHeight']-this['style']['diffHeight'];this[_0x39d6d1(0x249)][_0x39d6d1(_0x5057bb._0x342f5d)]['height']=_0x489c20;const _0x2503af=Array(this['_positionsWall']['length'])[_0x39d6d1(0xd22)](_0x489c20);this['_entity'][_0x39d6d1(0x2b1)]['minimumHeights']=_0x2503af;}}['_mountedHook'](){const _0x9368a3={_0x5ece29:0xe86,_0x1c5fd5:0xb39,_0x32903f:0xba,_0x960a3b:0xfc8,_0x5f50c9:0xede,_0x49de81:0xe10},_0x415b46=_0x35a251,_0x178d29=this[_0x415b46(_0x9368a3._0x5ece29)]['data']||this['_getPitData']();this['data']=_0x178d29;const _0x1b99b9={'polygon':new Cesium__namespace['PolygonGraphics']({'hierarchy':new Cesium__namespace[(_0x415b46(_0x9368a3._0x1c5fd5))](this[_0x415b46(0xb35)]),'perPositionHeight':![],'height':_0x178d29['height'],'material':new Cesium__namespace['ImageMaterialProperty']({'image':this['style']['imageBottom'],'repeat':new Cesium__namespace['Cartesian2'](0x2,0x2),'transparent':![]}),'fill':!![],'outline':![]}),'wall':{'positions':_0x178d29['positionsWall'],'minimumHeights':_0x178d29[_0x415b46(_0x9368a3._0x32903f)],'maximumHeights':_0x178d29['maximumHeights'],'fill':!![],'material':new Cesium__namespace['ImageMaterialProperty']({'image':this[_0x415b46(_0x9368a3._0x960a3b)]['image'],'repeat':new Cesium__namespace['Cartesian2'](0x1,0x1)}),'outline':![]}};this['_entity']=this[_0x415b46(_0x9368a3._0x5f50c9)](_0x1b99b9),this[_0x415b46(_0x9368a3._0x49de81)]=_0x178d29['minHeight'],this['_positionsWall']=_0x178d29[_0x415b46(0x84b)],this['_wallHeights']=_0x178d29['maximumHeights'],this[_0x415b46(_0x9368a3._0x960a3b)]['label']&&this['_addLabel']();}['_getPitData'](){const _0x350876={_0x507646:0x60c,_0x35ed56:0x682,_0x54d697:0xe1e},_0x29ecdf=_0x35a251,_0x57ed07=this['positions'],_0x22ff54=interPolyline({'scene':this['_map'][_0x29ecdf(0xc60)],'positions':_0x57ed07['concat'](_0x57ed07[0x0]),'splitNum':this['style']['splitNum']}),_0x2e2749=[];let _0x316093=Number['MAX_VALUE'];for(let _0x8600aa=0x0,_0xb2e72a=_0x22ff54['length'];_0x8600aa<_0xb2e72a;_0x8600aa++){const _0x2baf91=Cesium__namespace['Cartographic']['fromCartesian'](_0x22ff54[_0x8600aa]);_0x316093=Math[_0x29ecdf(_0x350876._0x507646)](_0x316093,_0x2baf91[_0x29ecdf(_0x350876._0x35ed56)]),_0x2e2749['push'](_0x2baf91['height']);}const _0x4d0230=_0x316093-this['style'][_0x29ecdf(0x4f7)],_0x762f8f=Array(_0x22ff54[_0x29ecdf(_0x350876._0x54d697)])['fill'](_0x4d0230);return{'height':_0x4d0230,'minHeight':_0x316093,'positionsWall':_0x22ff54,'minimumHeights':_0x762f8f,'maximumHeights':_0x2e2749};}['setUpHeight'](_0x2bd5be){const _0x1533e2={_0x12c85c:0x488,_0x252cde:0x909,_0x1640eb:0xba,_0x190036:0x2b1},_0x3a9a6c=_0x35a251,_0x50222f=this['_minHeight']-this['style'][_0x3a9a6c(0x4f7)],_0x5c3dca=_0x50222f+_0x2bd5be,_0x855528=[],_0xeb68fc=[];for(let _0x48cf00=0x0,_0x5e8eb6=this[_0x3a9a6c(_0x1533e2._0x12c85c)]['length'];_0x48cf00<_0x5e8eb6;_0x48cf00++){const _0x2e8f11=this['_wallHeights'][_0x48cf00];_0xeb68fc[_0x3a9a6c(0x6de)](_0x2e8f11+_0x2bd5be),_0x855528['push'](_0x5c3dca);}this['_entity']&&(this['_entity'][_0x3a9a6c(_0x1533e2._0x252cde)][_0x3a9a6c(0x682)]=_0x50222f,this['_entity']['wall'][_0x3a9a6c(_0x1533e2._0x1640eb)]=_0x855528,this['_entity'][_0x3a9a6c(_0x1533e2._0x190036)]['maximumHeights']=_0xeb68fc);}}register$4('pitEntity',PitEntity);class AlgorithmUtil{constructor(){this['HALF_PI']=Math['PI']/0x2,this['ZERO_TOLERANCE']=0.0001;}['toRadians'](_0x49ba02){return _0x49ba02*Math['PI']/0xb4;}['getThirdPoint'](_0x4b0828,_0x5856e7,_0x51b064,_0x2d113e,_0x17862a){const _0x388985=this['getAzimuth'](_0x4b0828,_0x5856e7),_0xe1ab61=_0x17862a?_0x388985+_0x51b064:_0x388985-_0x51b064,_0x4e6b59=_0x2d113e*Math['cos'](_0xe1ab61),_0x1957f4=_0x2d113e*Math['sin'](_0xe1ab61);return[_0x5856e7[0x0]+_0x4e6b59,_0x5856e7[0x1]+_0x1957f4];}['getAzimuth'](_0x58ccb4,_0x580199){const _0x23b2e1=_0x35a251;let _0x37872c=0x0;const _0x2290b9=Math['asin'](Math['abs'](_0x580199[0x1]-_0x58ccb4[0x1])/this[_0x23b2e1(0x6cf)](_0x58ccb4,_0x580199));if(_0x580199[0x1]>=_0x58ccb4[0x1]&&_0x580199[0x0]>=_0x58ccb4[0x0])_0x37872c=_0x2290b9+Math['PI'];else{if(_0x580199[0x1]>=_0x58ccb4[0x1]&&_0x580199[0x0]<_0x58ccb4[0x0])_0x37872c=Math['PI']*0x2-_0x2290b9;else{if(_0x580199[0x1]<_0x58ccb4[0x1]&&_0x580199[0x0]<_0x58ccb4[0x0])_0x37872c=_0x2290b9;else _0x580199[0x1]<_0x58ccb4[0x1]&&_0x580199[0x0]>=_0x58ccb4[0x0]&&(_0x37872c=Math['PI']-_0x2290b9);}}return _0x37872c;}['MathDistance'](_0x4da559,_0x1b30d4){const _0x3faf06={_0x52d3b1:0x76b,_0x1ac30b:0xda4},_0x58d4b3=_0x35a251;return Math[_0x58d4b3(_0x3faf06._0x52d3b1)](Math['pow'](_0x4da559[0x0]-_0x1b30d4[0x0],0x2)+Math[_0x58d4b3(_0x3faf06._0x1ac30b)](_0x4da559[0x1]-_0x1b30d4[0x1],0x2));}[_0x35a251(0xdff)](_0x88e881,_0x2eabbd,_0x1e6ed9){if(!_0x1e6ed9)return![];return(_0x1e6ed9[0x1]-_0x88e881[0x1])*(_0x2eabbd[0x0]-_0x88e881[0x0])>(_0x2eabbd[0x1]-_0x88e881[0x1])*(_0x1e6ed9[0x0]-_0x88e881[0x0]);}['getBisectorNormals'](_0x470144,_0x397324,_0x2867f3,_0x2c00af){const _0x35993c=this['getNormal'](_0x397324,_0x2867f3,_0x2c00af);let _0x5a4601=null,_0x4847d9=null,_0x414cc2=null,_0x2a00dd=null,_0x38e7e6=null;const _0x12935e=Math['sqrt'](_0x35993c[0x0]*_0x35993c[0x0]+_0x35993c[0x1]*_0x35993c[0x1]),_0x36fce5=_0x35993c[0x0]/_0x12935e,_0x54f2bc=_0x35993c[0x1]/_0x12935e,_0x43e346=this['MathDistance'](_0x397324,_0x2867f3),_0x4d79d5=this['MathDistance'](_0x2867f3,_0x2c00af);return _0x12935e>this['ZERO_TOLERANCE']?this['isClockWise'](_0x397324,_0x2867f3,_0x2c00af)?(_0x414cc2=_0x470144*_0x43e346,_0x2a00dd=_0x2867f3[0x0]-_0x414cc2*_0x54f2bc,_0x38e7e6=_0x2867f3[0x1]+_0x414cc2*_0x36fce5,_0x5a4601=[_0x2a00dd,_0x38e7e6],_0x414cc2=_0x470144*_0x4d79d5,_0x2a00dd=_0x2867f3[0x0]+_0x414cc2*_0x54f2bc,_0x38e7e6=_0x2867f3[0x1]-_0x414cc2*_0x36fce5,_0x4847d9=[_0x2a00dd,_0x38e7e6]):(_0x414cc2=_0x470144*_0x43e346,_0x2a00dd=_0x2867f3[0x0]+_0x414cc2*_0x54f2bc,_0x38e7e6=_0x2867f3[0x1]-_0x414cc2*_0x36fce5,_0x5a4601=[_0x2a00dd,_0x38e7e6],_0x414cc2=_0x470144*_0x4d79d5,_0x2a00dd=_0x2867f3[0x0]-_0x414cc2*_0x54f2bc,_0x38e7e6=_0x2867f3[0x1]+_0x414cc2*_0x36fce5,_0x4847d9=[_0x2a00dd,_0x38e7e6]):(_0x2a00dd=_0x2867f3[0x0]+_0x470144*(_0x397324[0x0]-_0x2867f3[0x0]),_0x38e7e6=_0x2867f3[0x1]+_0x470144*(_0x397324[0x1]-_0x2867f3[0x1]),_0x5a4601=[_0x2a00dd,_0x38e7e6],_0x2a00dd=_0x2867f3[0x0]+_0x470144*(_0x2c00af[0x0]-_0x2867f3[0x0]),_0x38e7e6=_0x2867f3[0x1]+_0x470144*(_0x2c00af[0x1]-_0x2867f3[0x1]),_0x4847d9=[_0x2a00dd,_0x38e7e6]),[_0x5a4601,_0x4847d9];}['getCubicValue'](_0x4363e2,_0x43e51e,_0x556e42,_0x329067,_0xae86e4){_0x4363e2=Math['max'](Math['min'](_0x4363e2,0x1),0x0);const _0x20ceea=0x1-_0x4363e2,_0x467b4d=_0x4363e2*_0x4363e2,_0x16a2f5=_0x467b4d*_0x4363e2,_0xbc7d2a=_0x20ceea*_0x20ceea,_0x5cf53e=_0xbc7d2a*_0x20ceea,_0x48e598=_0x5cf53e*_0x43e51e[0x0]+0x3*_0xbc7d2a*_0x4363e2*_0x556e42[0x0]+0x3*_0x20ceea*_0x467b4d*_0x329067[0x0]+_0x16a2f5*_0xae86e4[0x0],_0x2b193c=_0x5cf53e*_0x43e51e[0x1]+0x3*_0xbc7d2a*_0x4363e2*_0x556e42[0x1]+0x3*_0x20ceea*_0x467b4d*_0x329067[0x1]+_0x16a2f5*_0xae86e4[0x1];return[_0x48e598,_0x2b193c];}['getNormal'](_0x36747a,_0x3b9183,_0x526e17){let _0x216143=_0x36747a[0x0]-_0x3b9183[0x0],_0x9dbc6e=_0x36747a[0x1]-_0x3b9183[0x1];const _0x1e204a=Math['sqrt'](_0x216143*_0x216143+_0x9dbc6e*_0x9dbc6e);_0x216143/=_0x1e204a,_0x9dbc6e/=_0x1e204a;let _0x31cdb7=_0x526e17[0x0]-_0x3b9183[0x0],_0x12bf81=_0x526e17[0x1]-_0x3b9183[0x1];const _0x5e1650=Math['sqrt'](_0x31cdb7*_0x31cdb7+_0x12bf81*_0x12bf81);_0x31cdb7/=_0x5e1650,_0x12bf81/=_0x5e1650;const _0x4fa37d=_0x216143+_0x31cdb7,_0x4c80cb=_0x9dbc6e+_0x12bf81;return[_0x4fa37d,_0x4c80cb];}[_0x35a251(0xbf0)](_0x359e92,_0x3b48a8,_0x4bbc70,_0x4c1e51){const _0xe316c9={_0x9b078b:0xdef},_0x3ab3c3=_0x35a251;let _0x1aeff5=null,_0x1afd24=null;const _0x487970=[];let _0x325e84=_0x4c1e51-_0x4bbc70;_0x325e84=_0x325e84<0x0?_0x325e84+Math['PI']*0x2:_0x325e84;for(let _0xc925f4=0x0;_0xc925f4<=0x64;_0xc925f4++){const _0x2237a3=_0x4bbc70+_0x325e84*_0xc925f4/0x64;_0x1aeff5=_0x359e92[0x0]+_0x3b48a8*Math['cos'](_0x2237a3),_0x1afd24=_0x359e92[0x1]+_0x3b48a8*Math[_0x3ab3c3(_0xe316c9._0x9b078b)](_0x2237a3),_0x487970[_0x3ab3c3(0x6de)]([_0x1aeff5,_0x1afd24]);}return _0x487970;}['getPointByAngleAndLen'](_0x3390cb,_0x1850a2,_0x5306b5){const _0x198079={_0x3dcca0:0xdef},_0x3a7c68=_0x35a251,_0x3fbb20=_0x3390cb[0x0]+_0x1850a2*Math['cos'](_0x5306b5),_0x2da621=_0x3390cb[0x1]+_0x1850a2*Math[_0x3a7c68(_0x198079._0x3dcca0)](_0x5306b5);return[_0x3fbb20,_0x2da621];}[_0x35a251(0xa7a)](_0x824807){const _0x4f6dad=_0x35a251;return Math[_0x4f6dad(0xda4)](this[_0x4f6dad(0x576)](_0x824807),0.99);}['wholeDistance'](_0x1ce55c){const _0x4639ce=_0x35a251;let _0x3b3371=0x0;const _0x3118e0=this;return _0x1ce55c&&Array['isArray'](_0x1ce55c)&&_0x1ce55c[_0x4639ce(0xe1e)]>0x0&&_0x1ce55c['forEach'](function(_0x44cd55,_0x3955ac){_0x3955ac<_0x1ce55c['length']-0x1&&(_0x3b3371+=_0x3118e0['MathDistance'](_0x44cd55,_0x1ce55c[_0x3955ac+0x1]));}),_0x3b3371;}[_0x35a251(0x6f0)](_0x23996a){const _0x263626={_0x5a84d6:0x973,_0x293169:0xe1e},_0x2e8abe=_0x35a251;if(!_0x23996a)return[];const _0x5638b7=_0x23996a[_0x2e8abe(0x34a)];if(_0x5638b7['length']<0x2)return[];const _0x307577=_0x23996a['tailLeft'],_0x313cf3=_0x23996a[_0x2e8abe(_0x263626._0x5a84d6)],_0x32c93e=_0x23996a['headTailFactor'],_0x43b70d=_0x23996a['neckWidthFactor'],_0x2ca42b=_0x23996a['neckHeightFactor'],_0x16fbb0=_0x23996a[_0x2e8abe(0xca2)],_0x29626f=_0x23996a['headHeightFactor'];let _0x1816af=this['getBaseLength'](_0x5638b7),_0x3c7481=_0x1816af*_0x29626f;const _0xa2afc7=_0x5638b7[_0x5638b7['length']-0x1];_0x1816af=this['MathDistance'](_0xa2afc7,_0x5638b7[_0x5638b7['length']-0x2]);const _0x37431a=this['MathDistance'](_0x307577,_0x313cf3);_0x3c7481>_0x37431a*_0x32c93e&&(_0x3c7481=_0x37431a*_0x32c93e);const _0x248f5b=_0x3c7481*_0x16fbb0,_0x35502f=_0x3c7481*_0x43b70d;_0x3c7481=_0x3c7481>_0x1816af?_0x1816af:_0x3c7481;const _0x76d5bb=_0x3c7481*_0x2ca42b,_0x5d42a3=this['getThirdPoint'](_0x5638b7[_0x5638b7[_0x2e8abe(_0x263626._0x293169)]-0x2],_0xa2afc7,0x0,_0x3c7481,!![]),_0x279364=this['getThirdPoint'](_0x5638b7[_0x5638b7['length']-0x2],_0xa2afc7,0x0,_0x76d5bb,!![]),_0x3f5478=this['getThirdPoint'](_0xa2afc7,_0x5d42a3,this[_0x2e8abe(0xc03)],_0x248f5b,![]),_0x4d2898=this['getThirdPoint'](_0xa2afc7,_0x5d42a3,this['HALF_PI'],_0x248f5b,!![]),_0x13843c=this['getThirdPoint'](_0xa2afc7,_0x279364,this['HALF_PI'],_0x35502f,![]),_0x4ab7a7=this['getThirdPoint'](_0xa2afc7,_0x279364,this['HALF_PI'],_0x35502f,!![]);return[_0x13843c,_0x3f5478,_0xa2afc7,_0x4d2898,_0x4ab7a7];}[_0x35a251(0xc8)](_0x36f087){const _0x5448df={_0x156ac7:0xa7a,_0x251fb3:0xe07},_0x1a468e=_0x35a251;if(!_0x36f087)return;const _0x3aaf25=_0x36f087['points'],_0x4bc900=_0x36f087['tailWidthFactor'],_0xc45729=_0x36f087[_0x1a468e(0x3d9)],_0x4940fa=this[_0x1a468e(_0x5448df._0x156ac7)](_0x3aaf25),_0x2d9732=_0x4940fa*_0x4bc900,_0x54759f=this[_0x1a468e(0xe07)](_0x3aaf25[0x1],_0x3aaf25[0x0],this['HALF_PI'],_0x2d9732,![]),_0x47a28c=this[_0x1a468e(_0x5448df._0x251fb3)](_0x3aaf25[0x1],_0x3aaf25[0x0],this['HALF_PI'],_0x2d9732,!![]),_0x2e5840=_0x2d9732*_0xc45729,_0x2e4624=this[_0x1a468e(0xe07)](_0x3aaf25[0x1],_0x3aaf25[0x0],0x0,_0x2e5840,!![]);return[_0x54759f,_0x2e4624,_0x47a28c];}[_0x35a251(0x80)](_0x597d64,_0x425a4d,_0x204059,_0x12d370){const _0x10a695={_0x4cf6e6:0x6cf,_0xcb6c46:0x93a},_0x28db4e=_0x35a251,_0x34ea3f=this['wholeDistance'](_0x597d64),_0xc8f8d1=this['getBaseLength'](_0x597d64),_0x450216=_0xc8f8d1*_0x12d370,_0x45c35a=this[_0x28db4e(_0x10a695._0x4cf6e6)](_0x425a4d,_0x204059),_0x182f4f=(_0x450216-_0x45c35a)/0x2;let _0x23b018=0x0;const _0x4d1c39=[],_0x3c6082=[];for(let _0x31f61a=0x1;_0x31f61a<_0x597d64['length']-0x1;_0x31f61a++){const _0x3a041b=this[_0x28db4e(0x66c)](_0x597d64[_0x31f61a-0x1],_0x597d64[_0x31f61a],_0x597d64[_0x31f61a+0x1])/0x2;_0x23b018+=this['MathDistance'](_0x597d64[_0x31f61a-0x1],_0x597d64[_0x31f61a]);const _0x2ce9da=(_0x450216/0x2-_0x23b018/_0x34ea3f*_0x182f4f)/Math[_0x28db4e(0xdef)](_0x3a041b),_0x11eb6e=this['getThirdPoint'](_0x597d64[_0x31f61a-0x1],_0x597d64[_0x31f61a],Math['PI']-_0x3a041b,_0x2ce9da,!![]),_0x3ba275=this[_0x28db4e(0xe07)](_0x597d64[_0x31f61a-0x1],_0x597d64[_0x31f61a],_0x3a041b,_0x2ce9da,![]);_0x4d1c39['push'](_0x11eb6e),_0x3c6082['push'](_0x3ba275);}return _0x4d1c39[_0x28db4e(_0x10a695._0xcb6c46)](_0x3c6082);}['getAngleOfThreePoints'](_0x304d35,_0x19f475,_0x41ff6f){const _0xe6804d=this['getAzimuth'](_0x19f475,_0x304d35)-this['getAzimuth'](_0x19f475,_0x41ff6f);return _0xe6804d<0x0?_0xe6804d+Math['PI']*0x2:_0xe6804d;}[_0x35a251(0x8fb)](_0x1c2210){const _0x4cf24c={_0x13422b:0x6de},_0x4f14d3=_0x35a251;if(_0x1c2210['length']<=0x2)return _0x1c2210;else{const _0x145268=0x2,_0x2332c7=[],_0x4554a3=_0x1c2210['length']-_0x145268-0x1;_0x2332c7['push'](_0x1c2210[0x0]);for(let _0x3357cd=0x0;_0x3357cd<=_0x4554a3;_0x3357cd++){for(let _0x28c673=0x0;_0x28c673<=0x1;_0x28c673+=0.05){let _0x2a5438=0x0,_0x206513=0x0;for(let _0x11ae53=0x0;_0x11ae53<=_0x145268;_0x11ae53++){const _0x2abacd=this['getQuadricBSplineFactor'](_0x11ae53,_0x28c673);_0x2a5438+=_0x2abacd*_0x1c2210[_0x3357cd+_0x11ae53][0x0],_0x206513+=_0x2abacd*_0x1c2210[_0x3357cd+_0x11ae53][0x1];}_0x2332c7[_0x4f14d3(_0x4cf24c._0x13422b)]([_0x2a5438,_0x206513]);}}return _0x2332c7['push'](_0x1c2210[_0x1c2210['length']-0x1]),_0x2332c7;}}[_0x35a251(0x38c)](_0x1c91f2,_0xce8e6d){let _0x204b14=0x0;if(_0x1c91f2===0x0)_0x204b14=Math['pow'](_0xce8e6d-0x1,0x2)/0x2;else{if(_0x1c91f2===0x1)_0x204b14=(-0x2*Math['pow'](_0xce8e6d,0x2)+0x2*_0xce8e6d+0x1)/0x2;else _0x1c91f2===0x2&&(_0x204b14=Math['pow'](_0xce8e6d,0x2)/0x2);}return _0x204b14;}['Mid'](_0x70c294,_0xba3525){return[(_0x70c294[0x0]+_0xba3525[0x0])/0x2,(_0x70c294[0x1]+_0xba3525[0x1])/0x2,(_0x70c294[0x2]||0x0+_0xba3525[0x2]||0x0)/0x2];}['getCircleCenterOfThreePoints'](_0x3950cb,_0x4de2af,_0x58e35c){const _0x317ac3=_0x3950cb[0x2]||0x0,_0x7c159c=[(_0x3950cb[0x0]+_0x4de2af[0x0])/0x2,(_0x3950cb[0x1]+_0x4de2af[0x1])/0x2,_0x317ac3],_0x1f7fc5=[_0x7c159c[0x0]-_0x3950cb[0x1]+_0x4de2af[0x1],_0x7c159c[0x1]+_0x3950cb[0x0]-_0x4de2af[0x0],_0x317ac3],_0x3bce64=[(_0x3950cb[0x0]+_0x58e35c[0x0])/0x2,(_0x3950cb[0x1]+_0x58e35c[0x1])/0x2,_0x317ac3],_0x374266=[_0x3bce64[0x0]-_0x3950cb[0x1]+_0x58e35c[0x1],_0x3bce64[0x1]+_0x3950cb[0x0]-_0x58e35c[0x0],_0x317ac3];return this['getIntersectPoint'](_0x7c159c,_0x1f7fc5,_0x3bce64,_0x374266);}[_0x35a251(0xb40)](_0x505915,_0x15bcfb,_0x2890d0,_0x198684){if(_0x505915[0x1]===_0x15bcfb[0x1]){const _0x20ce5a=(_0x198684[0x0]-_0x2890d0[0x0])/(_0x198684[0x1]-_0x2890d0[0x1]),_0x251635=_0x20ce5a*(_0x505915[0x1]-_0x2890d0[0x1])+_0x2890d0[0x0],_0x2236c0=_0x505915[0x1];return[_0x251635,_0x2236c0];}if(_0x2890d0[0x1]===_0x198684[0x1]){const _0xcb8fae=(_0x15bcfb[0x0]-_0x505915[0x0])/(_0x15bcfb[0x1]-_0x505915[0x1]),_0x48c18e=_0xcb8fae*(_0x2890d0[0x1]-_0x505915[0x1])+_0x505915[0x0],_0x740131=_0x2890d0[0x1];return[_0x48c18e,_0x740131];}const _0x10b274=(_0x15bcfb[0x0]-_0x505915[0x0])/(_0x15bcfb[0x1]-_0x505915[0x1]),_0x3d4030=(_0x198684[0x0]-_0x2890d0[0x0])/(_0x198684[0x1]-_0x2890d0[0x1]),_0x3f3488=(_0x10b274*_0x505915[0x1]-_0x505915[0x0]-_0x3d4030*_0x2890d0[0x1]+_0x2890d0[0x0])/(_0x10b274-_0x3d4030),_0x9d5ac9=_0x10b274*_0x3f3488-_0x10b274*_0x505915[0x1]+_0x505915[0x0];return[_0x9d5ac9,_0x3f3488,_0x505915[0x2]||0x0];}['getBezierPoints'](_0x5e573a){const _0x1877cf=_0x35a251;if(_0x5e573a['length']<=0x2)return _0x5e573a;else{const _0x1eeccd=[],_0x371724=_0x5e573a['length']-0x1;for(let _0x23d351=0x0;_0x23d351<=0x1;_0x23d351+=0.01){let _0x456cdc=0x0,_0x2daeac=0x0;for(let _0x5b1716=0x0;_0x5b1716<=_0x371724;_0x5b1716++){const _0x20d5f3=this[_0x1877cf(0x51a)](_0x371724,_0x5b1716),_0x2ef3ab=Math['pow'](_0x23d351,_0x5b1716),_0x2683f7=Math['pow'](0x1-_0x23d351,_0x371724-_0x5b1716);_0x456cdc+=_0x20d5f3*_0x2ef3ab*_0x2683f7*_0x5e573a[_0x5b1716][0x0],_0x2daeac+=_0x20d5f3*_0x2ef3ab*_0x2683f7*_0x5e573a[_0x5b1716][0x1];}_0x1eeccd['push']([_0x456cdc,_0x2daeac]);}return _0x1eeccd;}}['getFactorial'](_0x5a0c44){let _0x566e7f=0x1;switch(_0x5a0c44){case _0x5a0c44<=0x1:_0x566e7f=0x1;break;case _0x5a0c44===0x2:_0x566e7f=0x2;break;case _0x5a0c44===0x3:_0x566e7f=0x6;break;case _0x5a0c44===0x18:_0x566e7f=0x18;break;case _0x5a0c44===0x5:_0x566e7f=0x78;break;default:for(let _0x353dbc=0x1;_0x353dbc<=_0x5a0c44;_0x353dbc++){_0x566e7f*=_0x353dbc;}break;}return _0x566e7f;}[_0x35a251(0x51a)](_0x1a012,_0x2a47c0){const _0x1994c9={_0x3bb085:0x743},_0x2308fb=_0x35a251;return this['getFactorial'](_0x1a012)/(this[_0x2308fb(_0x1994c9._0x3bb085)](_0x2a47c0)*this['getFactorial'](_0x1a012-_0x2a47c0));}}const algorithmUtil=new AlgorithmUtil(),minAnalge=algorithmUtil['toRadians'](0x14),maxAnalge=algorithmUtil['toRadians'](0xa0);class ArrowParentUtil{constructor(){this['algorithmUtil']=algorithmUtil;}[_0x35a251(0x194)](_0x3ab528){let _0x239b7d=_0x3ab528[0x0][0x2]||0x0;for(let _0x16e182=0x0;_0x16e182<_0x3ab528['length'];_0x16e182++){_0x3ab528[0x2]>_0x239b7d&&(_0x239b7d=_0x3ab528[0x2]);}return _0x239b7d;}[_0x35a251(0x6f0)](_0xa61104,_0x26bdd0,_0x1f9b13){const _0x1384d4={_0xb9e1e0:0xe1e,_0x1532c5:0x6cf,_0x22c038:0xca2,_0x5bbdeb:0xe07,_0x3d90ab:0xe07},_0x299400=_0x35a251;if(!_0xa61104||_0xa61104[_0x299400(_0x1384d4._0xb9e1e0)]<0x2)return null;let _0x4acceb=this['algorithmUtil']['getBaseLength'](_0xa61104)*this[_0x299400(0x145)];const _0x79940=this[_0x299400(0xd2d)]['MathDistance'](_0x26bdd0,_0x1f9b13);_0x4acceb>_0x79940*this['headTailFactor']&&(_0x4acceb=_0x79940*this['headTailFactor']);const _0x16c0be=_0xa61104[_0xa61104['length']-0x1],_0x2d53d3=_0xa61104[_0xa61104['length']-0x2],_0x477cac=this['algorithmUtil'][_0x299400(_0x1384d4._0x1532c5)](_0x16c0be,_0x2d53d3);_0x4acceb=_0x4acceb>_0x477cac?_0x477cac:_0x4acceb;const _0x4ee1d6=_0x4acceb*this[_0x299400(_0x1384d4._0x22c038)],_0x38f948=_0x4acceb*this['neckWidthFactor'],_0x3f8dd9=_0x4acceb*this['neckHeightFactor'],_0xa8ccb=this['algorithmUtil'][_0x299400(_0x1384d4._0x5bbdeb)](_0x2d53d3,_0x16c0be,0x0,_0x4acceb,!![]),_0x4cbafc=this['algorithmUtil']['getThirdPoint'](_0x2d53d3,_0x16c0be,0x0,_0x3f8dd9,!![]),_0x259990=this['algorithmUtil'][_0x299400(_0x1384d4._0x5bbdeb)](_0x16c0be,_0xa8ccb,Math['PI']/0x2,_0x4ee1d6,![]),_0x2db130=this[_0x299400(0xd2d)][_0x299400(_0x1384d4._0x3d90ab)](_0x16c0be,_0xa8ccb,Math['PI']/0x2,_0x4ee1d6,!![]),_0x1c8d18=this['algorithmUtil']['getThirdPoint'](_0x16c0be,_0x4cbafc,Math['PI']/0x2,_0x38f948,![]),_0x496154=this['algorithmUtil']['getThirdPoint'](_0x16c0be,_0x4cbafc,Math['PI']/0x2,_0x38f948,!![]);return[_0x1c8d18,_0x259990,_0x16c0be,_0x2db130,_0x496154];}['getArrowBodyPoints'](_0x1340b5,_0x894fad,_0x473404,_0x36250b){const _0x7712e4={_0x3aaf88:0xd2d,_0x263025:0xe1e,_0x192e4e:0x6de},_0x7d8bfc=_0x35a251,_0x2ed664=this['algorithmUtil'][_0x7d8bfc(0x576)](_0x1340b5),_0x3c9907=this['algorithmUtil']['getBaseLength'](_0x1340b5),_0x57ef88=_0x3c9907*_0x36250b,_0x36f0ab=this[_0x7d8bfc(_0x7712e4._0x3aaf88)]['MathDistance'](_0x894fad,_0x473404),_0x54794f=(_0x57ef88-_0x36f0ab)/0x2;let _0x471b18=0x0;const _0x272217=[],_0x3327cf=[];for(let _0x18718c=0x1;_0x18718c<_0x1340b5[_0x7d8bfc(_0x7712e4._0x263025)]-0x1;_0x18718c++){let _0x45f926=this[_0x7d8bfc(0xd2d)]['getAngleOfThreePoints'](_0x1340b5[_0x18718c-0x1],_0x1340b5[_0x18718c],_0x1340b5[_0x18718c+0x1])/0x2;if(_0x45f926maxAnalge&&(_0x45f926=maxAnalge);_0x471b18+=this['algorithmUtil'][_0x7d8bfc(0x6cf)](_0x1340b5[_0x18718c-0x1],_0x1340b5[_0x18718c]);const _0x2fe2b1=(_0x57ef88/0x2-_0x471b18/_0x2ed664*_0x54794f)/Math['sin'](_0x45f926),_0x32b4fa=this['algorithmUtil']['getThirdPoint'](_0x1340b5[_0x18718c-0x1],_0x1340b5[_0x18718c],Math['PI']-_0x45f926,_0x2fe2b1,!![]),_0x3c086f=this['algorithmUtil']['getThirdPoint'](_0x1340b5[_0x18718c-0x1],_0x1340b5[_0x18718c],_0x45f926,_0x2fe2b1,![]);_0x272217[_0x7d8bfc(_0x7712e4._0x192e4e)](_0x32b4fa),_0x3327cf[_0x7d8bfc(0x6de)](_0x3c086f);}return _0x272217[_0x7d8bfc(0x93a)](_0x3327cf);}}class AttackArrowUtil extends ArrowParentUtil{['setOptions'](_0x5bd83e={}){const _0x17f529={_0xb6cc5:0xf4f,_0x4c498b:0x834},_0x58652c=_0x35a251;this['headHeightFactor']=_0x5bd83e['headHeightFactor']||0.18,this['headWidthFactor']=_0x5bd83e['headWidthFactor']||0.3,this['neckHeightFactor']=_0x5bd83e['neckHeightFactor']||0.85,this[_0x58652c(_0x17f529._0xb6cc5)]=_0x5bd83e['neckWidthFactor']||0.15,this[_0x58652c(_0x17f529._0x4c498b)]=_0x5bd83e[_0x58652c(_0x17f529._0x4c498b)]||0.8;}['startCompute'](_0x50f9d5,_0x6cd29a){const _0x556fad={_0x216f5c:0x6cf,_0x649cf5:0xd2d,_0x2c8a72:0x80,_0x178561:0x93a,_0x54b979:0x8fb,_0x1884ac:0x93a},_0x4ba8ec=_0x35a251;if(!_0x50f9d5||_0x50f9d5['length']===0x0)return _0x50f9d5;this['positions']=_0x50f9d5,this['setOptions'](_0x6cd29a);const _0x53d39a=cartesians2mercators(_0x50f9d5),_0x44a1e7=this['getMaxHeight'](_0x53d39a),_0x4db1e2=_0x53d39a[_0x53d39a[_0x4ba8ec(0xe1e)]-0x1],_0x619e4c=_0x53d39a[_0x53d39a['length']-0x2],_0x2c38b6=this[_0x4ba8ec(0xd2d)][_0x4ba8ec(_0x556fad._0x216f5c)](_0x4db1e2,_0x619e4c);_0x2c38b6<0x1&&_0x53d39a['length']>0x2&&_0x53d39a[_0x4ba8ec(0xce0)](_0x53d39a['length']-0x2,0x1);let _0x5ee376=_0x53d39a[0x0],_0x541155=_0x53d39a[0x1];this[_0x4ba8ec(_0x556fad._0x649cf5)]['isClockWise'](_0x53d39a[0x0],_0x53d39a[0x1],_0x53d39a[0x2])&&(_0x5ee376=_0x53d39a[0x1],_0x541155=_0x53d39a[0x0]);const _0x1c73ea=this['algorithmUtil']['Mid'](_0x5ee376,_0x541155),_0x3a6d31=[_0x1c73ea][_0x4ba8ec(0x93a)](_0x53d39a[_0x4ba8ec(0x97a)](0x2)),_0x504397=this[_0x4ba8ec(0x6f0)](_0x3a6d31,_0x5ee376,_0x541155);if(!_0x504397||_0x504397['length']<0x4)return _0x50f9d5;const _0x57dcc9=_0x504397[0x0],_0x3f038d=_0x504397[0x4],_0x18f2a6=this['algorithmUtil'][_0x4ba8ec(0x6cf)](_0x5ee376,_0x541155)/this['algorithmUtil']['getBaseLength'](_0x3a6d31),_0x445d93=this[_0x4ba8ec(_0x556fad._0x2c8a72)](_0x3a6d31,_0x57dcc9,_0x3f038d,_0x18f2a6),_0x36f6bc=_0x445d93['length'];let _0x3322a1=[_0x5ee376]['concat'](_0x445d93['slice'](0x0,_0x36f6bc/0x2));_0x3322a1['push'](_0x57dcc9);let _0x5e1376=[_0x541155][_0x4ba8ec(_0x556fad._0x178561)](_0x445d93['slice'](_0x36f6bc/0x2,_0x36f6bc));_0x5e1376[_0x4ba8ec(0x6de)](_0x3f038d),_0x3322a1=this['algorithmUtil'][_0x4ba8ec(_0x556fad._0x54b979)](_0x3322a1),_0x5e1376=this['algorithmUtil']['getQBSplinePoints'](_0x5e1376);const _0x64c29c=_0x3322a1[_0x4ba8ec(_0x556fad._0x1884ac)](_0x504397,_0x5e1376['reverse']()),_0xc2eda4=mercators2cartesians(_0x64c29c,_0x44a1e7);return _0xc2eda4;}}const attackArrowUtil$1=new AttackArrowUtil();class AttackArrow extends PolygonEntity{get['hasClosure'](){return![];}['getShowPositions'](_0x21074f){const _0x2d1415={_0x1f86d7:0x57b},_0x34f771=_0x35a251;if(!_0x21074f||_0x21074f['length']<0x2)return _0x21074f;return attackArrowUtil$1[_0x34f771(_0x2d1415._0x1f86d7)](_0x21074f,this['style']);}}register$4('attackArrow',AttackArrow);class AttackArrowPWUtil extends ArrowParentUtil{['setOptions'](_0xd4f09={}){const _0x36bbf6={_0x558636:0x145},_0x334d6a=_0x35a251;this[_0x334d6a(_0x36bbf6._0x558636)]=_0xd4f09['headHeightFactor']||0.18,this['headWidthFactor']=_0xd4f09['headWidthFactor']||0.3,this[_0x334d6a(0x874)]=_0xd4f09['neckHeightFactor']||0.85,this[_0x334d6a(0xf4f)]=_0xd4f09[_0x334d6a(0xf4f)]||0.15,this['tailWidthFactor']=_0xd4f09[_0x334d6a(0x917)]||0.1;}['startCompute'](_0x2a969b,_0x565deb){const _0x2fcfa3={_0x5f42b5:0x80,_0x5ef005:0x97a,_0x193441:0x6de},_0x41a317=_0x35a251;if(!_0x2a969b||_0x2a969b['length']===0x0)return _0x2a969b;this['positions']=_0x2a969b,this['setOptions'](_0x565deb);const _0x1d96da=cartesians2mercators(_0x2a969b),_0x965582=this['getMaxHeight'](_0x1d96da),_0x9740d2=this['getTailPoints'](_0x1d96da),_0x1919a5=this['getArrowHeadPoints'](_0x1d96da,_0x9740d2[0x0],_0x9740d2[0x1]);if(!_0x1919a5||_0x1919a5['length']<0x4)return _0x2a969b;const _0x3c36a7=_0x1919a5[0x0],_0x4c2c95=_0x1919a5[0x4],_0x1bd890=this[_0x41a317(_0x2fcfa3._0x5f42b5)](_0x1d96da,_0x3c36a7,_0x4c2c95,this[_0x41a317(0x917)]),_0x3cdc72=_0x1bd890[_0x41a317(0xe1e)];let _0x1624af=[_0x9740d2[0x0]]['concat'](_0x1bd890[_0x41a317(_0x2fcfa3._0x5ef005)](0x0,_0x3cdc72/0x2));_0x1624af['push'](_0x3c36a7);let _0x369591=[_0x9740d2[0x1]]['concat'](_0x1bd890['slice'](_0x3cdc72/0x2,_0x3cdc72));_0x369591[_0x41a317(_0x2fcfa3._0x193441)](_0x4c2c95),_0x1624af=this['algorithmUtil']['getQBSplinePoints'](_0x1624af),_0x369591=this['algorithmUtil']['getQBSplinePoints'](_0x369591);const _0x37fc7e=_0x1624af['concat'](_0x1919a5,_0x369591['reverse']()),_0x5d1868=mercators2cartesians(_0x37fc7e,_0x965582);return _0x5d1868;}[_0x35a251(0xc8)](_0x3f0084){const _0x50fdb0=this['algorithmUtil']['getBaseLength'](_0x3f0084),_0xb777a8=_0x50fdb0*this['tailWidthFactor'],_0x2d98b1=this['algorithmUtil']['getThirdPoint'](_0x3f0084[0x1],_0x3f0084[0x0],Math['PI']/0x2,_0xb777a8,![]),_0x5a5003=this['algorithmUtil']['getThirdPoint'](_0x3f0084[0x1],_0x3f0084[0x0],Math['PI']/0x2,_0xb777a8,!![]);return[_0x2d98b1,_0x5a5003];}}const attackArrowPWUtil=new AttackArrowPWUtil();class AttackArrowPW extends PolygonEntity{get['hasClosure'](){return![];}['getShowPositions'](_0x39ce52){if(!_0x39ce52||_0x39ce52['length']<0x2)return _0x39ce52;return attackArrowPWUtil['startCompute'](_0x39ce52,this['style']);}static['getOutlinePositions'](_0x3e7804,_0x5e2485){if(!_0x3e7804||_0x3e7804['length']<0x2)return _0x3e7804;return _0x3e7804=LngLatArray['toCartesians'](_0x3e7804),attackArrowPWUtil['startCompute'](_0x3e7804,_0x5e2485);}}register$4('attackArrowPW',AttackArrowPW);class AttackArrowYWUtil extends ArrowParentUtil{[_0x35a251(0x72b)](_0x3e7ae7={}){const _0x5d7652=_0x35a251;this['headHeightFactor']=_0x3e7ae7['headHeightFactor']||0.18,this['headWidthFactor']=_0x3e7ae7['headWidthFactor']||0.3,this['neckHeightFactor']=_0x3e7ae7['neckHeightFactor']||0.85,this['neckWidthFactor']=_0x3e7ae7['neckWidthFactor']||0.15,this[_0x5d7652(0x917)]=_0x3e7ae7['tailWidthFactor']||0.1,this['headTailFactor']=_0x3e7ae7['headTailFactor']||0.8,this['swallowTailFactor']=_0x3e7ae7['swallowTailFactor']||0x1;}['startCompute'](_0x3fb55a,_0x7ffbab){const _0x54cede={_0x283943:0xe1e,_0x22e54a:0x6f0,_0x9d42:0x80,_0x147acd:0x97a,_0x3b606f:0x93a,_0x2cc670:0x6de,_0x2cae9a:0xd2d},_0x2e5768=_0x35a251;if(!_0x3fb55a||_0x3fb55a[_0x2e5768(_0x54cede._0x283943)]===0x0)return _0x3fb55a;this['positions']=_0x3fb55a,this['setOptions'](_0x7ffbab);const _0x4bb14a=cartesians2mercators(_0x3fb55a),_0x39d968=this['getMaxHeight'](_0x4bb14a),_0x145c90=[_0x4bb14a[0x0],_0x4bb14a[0x1]];let _0x1bb5d5=_0x145c90[0x0],_0x2d81a8=_0x145c90[0x1];this['algorithmUtil']['isClockWise'](_0x4bb14a[0x0],_0x4bb14a[0x1],_0x4bb14a[0x2])&&(_0x1bb5d5=_0x4bb14a[0x1],_0x2d81a8=_0x4bb14a[0x0]);const _0x188675=this[_0x2e5768(0xd2d)][_0x2e5768(0xa85)](_0x1bb5d5,_0x2d81a8),_0x298505=[_0x188675]['concat'](_0x4bb14a['slice'](0x2)),_0x582ddc=this[_0x2e5768(_0x54cede._0x22e54a)](_0x298505,_0x1bb5d5,_0x2d81a8);if(!_0x582ddc||_0x582ddc['length']<0x4)return _0x3fb55a;const _0xeeb4fe=[_0x582ddc[0x0],_0x582ddc[0x4]],_0x56d10d=_0xeeb4fe[0x0],_0x19bbfe=_0xeeb4fe[0x1],_0x5d7536=this['algorithmUtil']['MathDistance'](_0x1bb5d5,_0x2d81a8),_0x318bdb=this['algorithmUtil'][_0x2e5768(0xa7a)](_0x298505),_0x20dc38=_0x318bdb*this['tailWidthFactor']*this['swallowTailFactor'],_0x227169=this['algorithmUtil']['getThirdPoint'](_0x298505[0x1],_0x298505[0x0],0x0,_0x20dc38,!![]),_0x55a989=_0x5d7536/_0x318bdb,_0x4a7157=this[_0x2e5768(_0x54cede._0x9d42)](_0x298505,_0x56d10d,_0x19bbfe,_0x55a989),_0x4a9f26=_0x4a7157['length'];let _0x4d2f70=[_0x1bb5d5]['concat'](_0x4a7157[_0x2e5768(_0x54cede._0x147acd)](0x0,_0x4a9f26/0x2));_0x4d2f70[_0x2e5768(0x6de)](_0x56d10d);let _0x326d88=[_0x2d81a8][_0x2e5768(_0x54cede._0x3b606f)](_0x4a7157[_0x2e5768(_0x54cede._0x147acd)](_0x4a9f26/0x2,_0x4a9f26));_0x326d88[_0x2e5768(_0x54cede._0x2cc670)](_0x19bbfe),_0x4d2f70=this[_0x2e5768(_0x54cede._0x2cae9a)]['getQBSplinePoints'](_0x4d2f70),_0x326d88=this['algorithmUtil']['getQBSplinePoints'](_0x326d88);const _0x178e29=_0x4d2f70['concat'](_0x582ddc,_0x326d88['reverse'](),[_0x227169,_0x4d2f70[0x0]]),_0x14133b=mercators2cartesians(_0x178e29,_0x39d968);return _0x14133b;}}const attackArrowUtil=new AttackArrowYWUtil();class AttackArrowYW extends PolygonEntity{get[_0x35a251(0x815)](){return![];}[_0x35a251(0x819)](_0x1fea52){const _0x591ff9={_0x1610b8:0xe1e},_0x343705=_0x35a251;if(!_0x1fea52||_0x1fea52[_0x343705(_0x591ff9._0x1610b8)]<0x3)return _0x1fea52;return attackArrowUtil['startCompute'](_0x1fea52,this['style']);}static['getOutlinePositions'](_0x31e8b0,_0x4ab197){const _0x491d6e={_0x3cb317:0xe1e},_0x3ecd31=_0x35a251;if(!_0x31e8b0||_0x31e8b0[_0x3ecd31(_0x491d6e._0x3cb317)]<0x3)return _0x31e8b0;return _0x31e8b0=LngLatArray['toCartesians'](_0x31e8b0),attackArrowUtil['startCompute'](_0x31e8b0,_0x4ab197);}}register$4(_0x35a251(0x225),AttackArrowYW);class CloseCurveUtil{constructor(){this['algorithmUtil']=algorithmUtil;}[_0x35a251(0x57b)](_0x27a3d9,_0x425b9d){const _0x28f085={_0x3ffdbd:0xe1e,_0x198af8:0x93a},_0x3f4c4c=_0x35a251;if(!_0x27a3d9||_0x27a3d9[_0x3f4c4c(_0x28f085._0x3ffdbd)]===0x0)return _0x27a3d9;this['positions']=_0x27a3d9;const _0x4b55ef=cartesians2mercators(_0x27a3d9),_0x366c7e=this['getMaxHeight'](_0x4b55ef);_0x4b55ef['push'](_0x4b55ef[0x0],_0x4b55ef[0x1]);let _0x21adab=[];const _0x3f0c82=[];for(let _0x3e06f4=0x0;_0x3e06f4<_0x4b55ef[_0x3f4c4c(0xe1e)]-0x2;_0x3e06f4++){const _0x545142=this['algorithmUtil'][_0x3f4c4c(0xb80)](0.3,_0x4b55ef[_0x3e06f4],_0x4b55ef[_0x3e06f4+0x1],_0x4b55ef[_0x3e06f4+0x2]);_0x21adab=_0x21adab['concat'](_0x545142);}const _0x309fb3=_0x21adab[_0x3f4c4c(0xe1e)];_0x21adab=[_0x21adab[_0x309fb3-0x1]][_0x3f4c4c(_0x28f085._0x198af8)](_0x21adab['slice'](0x0,_0x309fb3-0x1));for(let _0x464227=0x0;_0x464227<_0x4b55ef['length']-0x2;_0x464227++){const _0x1f498a=_0x4b55ef[_0x464227],_0x5bdebc=_0x4b55ef[_0x464227+0x1];_0x3f0c82['push'](_0x1f498a);for(let _0x4a0916=0x0;_0x4a0916<=0x64;_0x4a0916++){const _0x138809=this['algorithmUtil']['getCubicValue'](_0x4a0916/0x64,_0x1f498a,_0x21adab[_0x464227*0x2],_0x21adab[_0x464227*0x2+0x1],_0x5bdebc);_0x3f0c82['push'](_0x138809);}_0x3f0c82[_0x3f4c4c(0x6de)](_0x5bdebc);}const _0x328b90=mercators2cartesians(_0x3f0c82,_0x366c7e);return _0x328b90;}['getMaxHeight'](_0x2b49f1){let _0x3fdc54=_0x2b49f1[0x0][0x2]||0x0;for(let _0x35f524=0x0;_0x35f524<_0x2b49f1['length'];_0x35f524++){_0x2b49f1[0x2]>_0x3fdc54&&(_0x3fdc54=_0x2b49f1[0x2]);}return _0x3fdc54;}}const closeCurveUtil=new CloseCurveUtil();class CloseVurve extends PolygonEntity{['getShowPositions'](_0x3871ae){const _0x333e70={_0x3f6fad:0xfc8},_0x254d1e=_0x35a251;if(!_0x3871ae||_0x3871ae['length']<0x2)return _0x3871ae;return closeCurveUtil['startCompute'](_0x3871ae,this[_0x254d1e(_0x333e70._0x3f6fad)]);}static['getOutlinePositions'](_0x4ac073,_0x1400bd){const _0x391b6e=_0x35a251;if(!_0x4ac073||_0x4ac073[_0x391b6e(0xe1e)]<0x2)return _0x4ac073;return _0x4ac073=LngLatArray['toCartesians'](_0x4ac073),closeCurveUtil['startCompute'](_0x4ac073,_0x1400bd);}}register$4(_0x35a251(0xa45),CloseVurve);class DoubleArrowUtil{constructor(){this['algorithmUtil']=algorithmUtil;}[_0x35a251(0x72b)](_0x161fbb={}){this['headHeightFactor']=_0x161fbb['headHeightFactor']||0.25,this['headWidthFactor']=_0x161fbb['headWidthFactor']||0.3,this['neckHeightFactor']=_0x161fbb['neckHeightFactor']||0.85,this['neckWidthFactor']=_0x161fbb['neckWidthFactor']||0.15;}['startCompute'](_0x777d79,_0x306cdc){const _0x22eb2c={_0x50158b:0xb35,_0x29b5de:0xe1e,_0x13ea4d:0x97a},_0x44b5ae=_0x35a251;if(!_0x777d79||_0x777d79[_0x44b5ae(0xe1e)]<0x3)return _0x777d79;this[_0x44b5ae(_0x22eb2c._0x50158b)]=_0x777d79,this['setOptions'](_0x306cdc);const _0x539a3c=cartesians2mercators(_0x777d79),_0x22ffef=this[_0x44b5ae(0x194)](_0x539a3c),_0x41f7fe=[_0x539a3c[0x0],_0x539a3c[0x1],_0x539a3c[0x2]],_0x24c312=_0x41f7fe[0x0],_0x155a0c=_0x41f7fe[0x1],_0x2eb344=_0x41f7fe[0x2],_0x27ba03=this[_0x44b5ae(0xb35)][_0x44b5ae(_0x22eb2c._0x29b5de)];let _0x1da82b,_0x1f1d7e;if(_0x27ba03===0x3)_0x1da82b=this['getTempPoint4'](_0x24c312,_0x155a0c,_0x2eb344),_0x1f1d7e=this['algorithmUtil']['Mid'](_0x24c312,_0x155a0c);else{if(_0x27ba03===0x4)_0x1da82b=_0x539a3c[0x3],_0x1f1d7e=this['algorithmUtil']['Mid'](_0x24c312,_0x155a0c);else{const _0x3cc289=this['algorithmUtil'][_0x44b5ae(0x6cf)](_0x539a3c[0x3],_0x539a3c[0x4]),_0x5a6dc7=this['algorithmUtil']['MathDistance'](_0x539a3c[0x2],_0x539a3c[0x3]);_0x3cc289<_0x5a6dc7*0.1?(_0x1da82b=_0x539a3c[0x3],_0x1f1d7e=this[_0x44b5ae(0xd2d)]['Mid'](_0x24c312,_0x155a0c)):(_0x1da82b=_0x539a3c[0x3],_0x1f1d7e=_0x539a3c[0x4]);}}let _0x19d253,_0x56ed34;this['algorithmUtil']['isClockWise'](_0x24c312,_0x155a0c,_0x2eb344)?(_0x19d253=this['getArrowPoints'](_0x24c312,_0x1f1d7e,_0x1da82b,![]),_0x56ed34=this['getArrowPoints'](_0x1f1d7e,_0x155a0c,_0x2eb344,!![])):(_0x19d253=this[_0x44b5ae(0x2ee)](_0x155a0c,_0x1f1d7e,_0x2eb344,![]),_0x56ed34=this['getArrowPoints'](_0x1f1d7e,_0x24c312,_0x1da82b,!![]));const _0x193a1b=_0x19d253[_0x44b5ae(0xe1e)],_0xa2b408=(_0x193a1b-0x5)/0x2,_0x55cc77=_0x19d253['slice'](0x0,_0xa2b408),_0x10706a=_0x19d253[_0x44b5ae(_0x22eb2c._0x13ea4d)](_0xa2b408,_0xa2b408+0x5);let _0x4dc3f2=_0x19d253['slice'](_0xa2b408+0x5,_0x193a1b),_0x14a7d0=_0x56ed34['slice'](0x0,_0xa2b408);const _0x2ea217=_0x56ed34['slice'](_0xa2b408,_0xa2b408+0x5),_0x33de2e=_0x56ed34['slice'](_0xa2b408+0x5,_0x193a1b);_0x14a7d0=this['algorithmUtil']['getBezierPoints'](_0x14a7d0);const _0x551d5c=this['algorithmUtil']['getBezierPoints'](_0x33de2e['concat'](_0x55cc77['slice'](0x1)));_0x4dc3f2=this[_0x44b5ae(0xd2d)][_0x44b5ae(0x8df)](_0x4dc3f2);const _0x2a498a=_0x14a7d0['concat'](_0x2ea217,_0x551d5c,_0x10706a,_0x4dc3f2),_0x3ce127=mercators2cartesians(_0x2a498a,_0x22ffef);return _0x3ce127;}['getTempPoint4'](_0x4d7e65,_0x3aa5d0,_0x208af4){const _0x2a0e49={_0x2d57cf:0xdef,_0x430de7:0xe07,_0x284e13:0xeec},_0x33be56=_0x35a251,_0x5bb269=this['algorithmUtil'][_0x33be56(0xa85)](_0x4d7e65,_0x3aa5d0),_0x406896=this['algorithmUtil']['MathDistance'](_0x5bb269,_0x208af4),_0x32af90=this['algorithmUtil']['getAngleOfThreePoints'](_0x4d7e65,_0x5bb269,_0x208af4);let _0x4f7753,_0x5568d2,_0x5e1ca0,_0x2d3205;if(_0x32af90=Math['PI']/0x2&&_0x32af90=Math['PI']&&_0x32af900x3){const _0x22794c=[_0x371250[0x0],_0x371250[0x4]],_0x231360=_0x22794c[0x0],_0x24da5a=_0x22794c[0x1],_0x436ff2=this['algorithmUtil']['MathDistance'](_0x255ec0,_0x2e23a5)/this[_0x394bfd(0xd2d)]['getBaseLength'](_0x55f73f)/0x2,_0x5aa33f=this['getArrowBodyPoints'](_0x55f73f,_0x231360,_0x24da5a,_0x436ff2);if(_0x5aa33f){const _0x38628c=_0x5aa33f['length'];let _0x1f0199=_0x5aa33f['slice'](0x0,_0x38628c/0x2),_0x315b30=_0x5aa33f[_0x394bfd(0x97a)](_0x38628c/0x2,_0x38628c);return _0x1f0199[_0x394bfd(_0x5ebb11._0x5d63d1)](_0x231360),_0x315b30[_0x394bfd(0x6de)](_0x24da5a),_0x1f0199=_0x1f0199['reverse'](),_0x1f0199['push'](_0x2e23a5),_0x315b30=_0x315b30['reverse'](),_0x315b30['push'](_0x255ec0),_0x1f0199['reverse']()['concat'](_0x371250,_0x315b30);}}else console['log']('getArrowPoints:插值出错',_0x371250);}['getArrowHeadPoints'](_0x16d5fa){const _0x571212={_0x442db4:0xca2},_0x4539b2=_0x35a251;if(!_0x16d5fa||_0x16d5fa['length']<0x2)return[];const _0xd39bde=this['algorithmUtil']['getBaseLength'](_0x16d5fa),_0x3c02e7=_0xd39bde*this['headHeightFactor'],_0x4b70c9=_0x16d5fa[_0x16d5fa['length']-0x1],_0x429c92=_0x3c02e7*this[_0x4539b2(_0x571212._0x442db4)],_0x2ead6d=_0x3c02e7*this['neckWidthFactor'],_0xfefb42=_0x3c02e7*this['neckHeightFactor'],_0x5399d6=this['algorithmUtil']['getThirdPoint'](_0x16d5fa[_0x16d5fa['length']-0x2],_0x4b70c9,0x0,_0x3c02e7,!![]),_0x1eea73=this['algorithmUtil']['getThirdPoint'](_0x16d5fa[_0x16d5fa['length']-0x2],_0x4b70c9,0x0,_0xfefb42,!![]),_0x2699ab=this['algorithmUtil'][_0x4539b2(0xe07)](_0x4b70c9,_0x5399d6,Math['PI']/0x2,_0x429c92,![]),_0x3c259e=this['algorithmUtil']['getThirdPoint'](_0x4b70c9,_0x5399d6,Math['PI']/0x2,_0x429c92,!![]),_0x2375f6=this['algorithmUtil'][_0x4539b2(0xe07)](_0x4b70c9,_0x1eea73,Math['PI']/0x2,_0x2ead6d,![]),_0x51467d=this['algorithmUtil']['getThirdPoint'](_0x4b70c9,_0x1eea73,Math['PI']/0x2,_0x2ead6d,!![]);return[_0x2375f6,_0x2699ab,_0x4b70c9,_0x3c259e,_0x51467d];}[_0x35a251(0x80)](_0x143567,_0x113491,_0x130d83,_0x590197){const _0x176424={_0x48e229:0xd2d,_0x567ebd:0xdef,_0x1aebd1:0xe07,_0x44c7b1:0xd2d},_0x36dc05=_0x35a251,_0x15cf62=this[_0x36dc05(0xd2d)]['wholeDistance'](_0x143567),_0x42b392=this['algorithmUtil'][_0x36dc05(0xa7a)](_0x143567),_0x367255=_0x42b392*_0x590197,_0xc7e8f5=this[_0x36dc05(_0x176424._0x48e229)]['MathDistance'](_0x113491,_0x130d83),_0x2e28a5=(_0x367255-_0xc7e8f5)/0x2;let _0x712d8a=0x0;const _0x48097d=[],_0xbd135b=[];for(let _0x5c2642=0x1;_0x5c2642<_0x143567['length']-0x1;_0x5c2642++){const _0x194544=this[_0x36dc05(_0x176424._0x48e229)]['getAngleOfThreePoints'](_0x143567[_0x5c2642-0x1],_0x143567[_0x5c2642],_0x143567[_0x5c2642+0x1])/0x2;_0x712d8a+=this['algorithmUtil']['MathDistance'](_0x143567[_0x5c2642-0x1],_0x143567[_0x5c2642]);const _0x44a89b=(_0x367255/0x2-_0x712d8a/_0x15cf62*_0x2e28a5)/Math[_0x36dc05(_0x176424._0x567ebd)](_0x194544),_0x26071e=this['algorithmUtil'][_0x36dc05(_0x176424._0x1aebd1)](_0x143567[_0x5c2642-0x1],_0x143567[_0x5c2642],Math['PI']-_0x194544,_0x44a89b,!![]),_0x2512ea=this[_0x36dc05(_0x176424._0x44c7b1)]['getThirdPoint'](_0x143567[_0x5c2642-0x1],_0x143567[_0x5c2642],_0x194544,_0x44a89b,![]);_0x48097d['push'](_0x26071e),_0xbd135b['push'](_0x2512ea);}return _0x48097d['concat'](_0xbd135b);}['getMaxHeight'](_0x2e0efa){const _0x179854=_0x35a251;let _0x94ad0c=_0x2e0efa[0x0][0x2]||0x0;for(let _0x1c7d7f=0x0;_0x1c7d7f<_0x2e0efa[_0x179854(0xe1e)];_0x1c7d7f++){_0x2e0efa[0x2]>_0x94ad0c&&(_0x94ad0c=_0x2e0efa[0x2]);}return _0x94ad0c;}}const doubleArrowUtil=new DoubleArrowUtil();class DoubleArrow extends PolygonEntity{constructor(_0x1ad733={}){super(_0x1ad733),this['_minPointNum']=0x3,this['_maxPointNum']=0x5;}[_0x35a251(0x819)](_0x5c60db){const _0x385afc=_0x35a251;if(!_0x5c60db||_0x5c60db['length']_0x1fb4bb&&(_0x1fb4bb=_0x4bbe4d[0x2]);}return _0x1fb4bb;}}const fineArrowUtil=new FineArrowUtil();class FineArrow extends PolygonEntity{constructor(_0x28ec43={}){const _0xc7a95d=_0x35a251;super(_0x28ec43),this[_0xc7a95d(0x920)]=0x2,this['_maxPointNum']=0x2;}[_0x35a251(0x819)](_0x170a25){const _0x59d302={_0x107c63:0x57b},_0x4e294f=_0x35a251;if(!_0x170a25||_0x170a25['length']<0x2)return _0x170a25;return fineArrowUtil[_0x4e294f(_0x59d302._0x107c63)](_0x170a25,this['style']);}static['getOutlinePositions'](_0x1995d8,_0x21c7a5){const _0x2c4d0e={_0x2cace9:0x57b},_0x158259=_0x35a251;if(!_0x1995d8||_0x1995d8['length']<0x2)return _0x1995d8;return _0x1995d8=LngLatArray['toCartesians'](_0x1995d8),fineArrowUtil[_0x158259(_0x2c4d0e._0x2cace9)](_0x1995d8,_0x21c7a5);}}register$4(_0x35a251(0x574),FineArrow);class FineArrowYWUtil extends ArrowParentUtil{['setOptions'](_0x27b585={}){const _0x825f5c={_0x1089d0:0x874,_0x5ceaa9:0x3d9},_0x5d56a4=_0x35a251;this['headHeightFactor']=_0x27b585['headHeightFactor']||0.18,this['headWidthFactor']=_0x27b585['headWidthFactor']||0.3,this[_0x5d56a4(_0x825f5c._0x1089d0)]=_0x27b585[_0x5d56a4(0x874)]||0.85,this['neckWidthFactor']=_0x27b585['neckWidthFactor']||0.15,this['tailWidthFactor']=_0x27b585['tailWidthFactor']||0.1,this['swallowTailFactor']=_0x27b585[_0x5d56a4(_0x825f5c._0x5ceaa9)]||0x1;}['startCompute'](_0x315056,_0x7c717c){const _0x32fa7d={_0x3e24e4:0xc8,_0x4bf876:0xe1e,_0x4ffca1:0x93a,_0x38c503:0x97a,_0x294148:0xe3e},_0x4c089b=_0x35a251;if(!_0x315056||_0x315056[_0x4c089b(0xe1e)]===0x0)return _0x315056;this['positions']=_0x315056,this[_0x4c089b(0x72b)](_0x7c717c);const _0x2cdf56=cartesians2mercators(_0x315056),_0x56031f=this['getMaxHeight'](_0x2cdf56),_0xaa8352=this[_0x4c089b(_0x32fa7d._0x3e24e4)](_0x2cdf56),_0xf0621a=this['getArrowHeadPoints'](_0x2cdf56,_0xaa8352[0x0],_0xaa8352[0x2]);if(!_0xf0621a||_0xf0621a[_0x4c089b(_0x32fa7d._0x4bf876)]<0x4)return _0x315056;const _0x23106e=_0xf0621a[0x0],_0x79e4b0=_0xf0621a[0x4],_0x459dac=this['getArrowBodyPoints'](_0x2cdf56,_0x23106e,_0x79e4b0,this['tailWidthFactor']),_0x5e0df8=_0x459dac[_0x4c089b(0xe1e)];let _0x3cb628=[_0xaa8352[0x0]][_0x4c089b(_0x32fa7d._0x4ffca1)](_0x459dac['slice'](0x0,_0x5e0df8/0x2));_0x3cb628['push'](_0x23106e);let _0x35f533=[_0xaa8352[0x2]]['concat'](_0x459dac[_0x4c089b(_0x32fa7d._0x38c503)](_0x5e0df8/0x2,_0x5e0df8));_0x35f533['push'](_0x79e4b0),_0x3cb628=this[_0x4c089b(0xd2d)]['getQBSplinePoints'](_0x3cb628),_0x35f533=this['algorithmUtil'][_0x4c089b(0x8fb)](_0x35f533);const _0x3a1e10=_0x3cb628[_0x4c089b(_0x32fa7d._0x4ffca1)](_0xf0621a,_0x35f533[_0x4c089b(_0x32fa7d._0x294148)](),[_0xaa8352[0x1],_0x3cb628[0x0]]),_0x1200e0=mercators2cartesians(_0x3a1e10,_0x56031f);return _0x1200e0;}['getTailPoints'](_0x36c9f3){const _0x5db613={_0x140818:0xd2d},_0x25d9ee=_0x35a251,_0x21416c=this['algorithmUtil']['getBaseLength'](_0x36c9f3),_0x4ad071=_0x21416c*this[_0x25d9ee(0x917)],_0xc466e7=this['algorithmUtil'][_0x25d9ee(0xe07)](_0x36c9f3[0x1],_0x36c9f3[0x0],Math['PI']/0x2,_0x4ad071,![]),_0xb2748a=this[_0x25d9ee(_0x5db613._0x140818)][_0x25d9ee(0xe07)](_0x36c9f3[0x1],_0x36c9f3[0x0],Math['PI']/0x2,_0x4ad071,!![]),_0x57ea8b=_0x4ad071*this['swallowTailFactor'],_0x4b98d1=this[_0x25d9ee(_0x5db613._0x140818)]['getThirdPoint'](_0x36c9f3[0x1],_0x36c9f3[0x0],0x0,_0x57ea8b,!![]);return[_0xc466e7,_0x4b98d1,_0xb2748a];}}const fineArrowYWUtil=new FineArrowYWUtil();class FineArrowYW extends PolygonEntity{constructor(_0x5e3b1={}){const _0x168716={_0x4e3db7:0x920},_0x5856d5=_0x35a251;super(_0x5e3b1),this[_0x5856d5(_0x168716._0x4e3db7)]=0x2,this['_maxPointNum']=0x2;}['getShowPositions'](_0x238e27){const _0x2fefc7={_0x356132:0xfc8},_0x242c66=_0x35a251;if(!_0x238e27||_0x238e27['length']<0x2)return _0x238e27;return fineArrowYWUtil['startCompute'](_0x238e27,this[_0x242c66(_0x2fefc7._0x356132)]);}static['getOutlinePositions'](_0x1cf4f8,_0x1d0318){const _0x15416e=_0x35a251;if(!_0x1cf4f8||_0x1cf4f8['length']<0x2)return _0x1cf4f8;return _0x1cf4f8=LngLatArray['toCartesians'](_0x1cf4f8),fineArrowYWUtil[_0x15416e(0x57b)](_0x1cf4f8,_0x1d0318);}}register$4('fineArrowYW',FineArrowYW);class GatheringPlaceUtil{constructor(){const _0x122083=_0x35a251;this[_0x122083(0xd2d)]=algorithmUtil;}['startCompute'](_0x262e2f,_0x10d9c5){const _0x5e8183={_0x4494e4:0x6de,_0x33931e:0x93a,_0x30b038:0xe1e,_0xb71e19:0x97a,_0x4820e3:0x6de},_0x20e223=_0x35a251;if(!_0x262e2f||_0x262e2f['length']===0x0)return _0x262e2f;this[_0x20e223(0xb35)]=_0x262e2f;const _0x1a2188=cartesians2mercators(_0x262e2f),_0x1db15c=this[_0x20e223(0x194)](_0x1a2188),_0x44bb29=this['algorithmUtil']['Mid'](_0x1a2188[0x0],_0x1a2188[0x2]);_0x1a2188[_0x20e223(_0x5e8183._0x4494e4)](_0x44bb29,_0x1a2188[0x0],_0x1a2188[0x1]);let _0x2c8a69=[],_0x5661fe,_0x372cd4,_0x3a40d2;const _0x146247=[];for(let _0x7cecdf=0x0;_0x7cecdf<_0x1a2188['length']-0x2;_0x7cecdf++){_0x5661fe=_0x1a2188[_0x7cecdf],_0x372cd4=_0x1a2188[_0x7cecdf+0x1],_0x3a40d2=_0x1a2188[_0x7cecdf+0x2];const _0x234e71=this['algorithmUtil']['getBisectorNormals'](0.4,_0x5661fe,_0x372cd4,_0x3a40d2);_0x2c8a69=_0x2c8a69[_0x20e223(_0x5e8183._0x33931e)](_0x234e71);}const _0x45b7a3=_0x2c8a69[_0x20e223(_0x5e8183._0x30b038)];_0x2c8a69=[_0x2c8a69[_0x45b7a3-0x1]][_0x20e223(0x93a)](_0x2c8a69[_0x20e223(_0x5e8183._0xb71e19)](0x0,_0x45b7a3-0x1));for(let _0x59925f=0x0;_0x59925f<_0x1a2188['length']-0x2;_0x59925f++){_0x5661fe=_0x1a2188[_0x59925f],_0x372cd4=_0x1a2188[_0x59925f+0x1],_0x146247[_0x20e223(_0x5e8183._0x4494e4)](_0x5661fe);for(let _0x43d387=0x0;_0x43d387<=0x64;_0x43d387++){const _0x23cf77=this['algorithmUtil']['getCubicValue'](_0x43d387/0x64,_0x5661fe,_0x2c8a69[_0x59925f*0x2],_0x2c8a69[_0x59925f*0x2+0x1],_0x372cd4);_0x146247[_0x20e223(_0x5e8183._0x4820e3)](_0x23cf77);}_0x146247['push'](_0x372cd4);}const _0x4c51d2=mercators2cartesians(_0x146247,_0x1db15c);return _0x4c51d2;}['getMaxHeight'](_0x626e17){let _0x944d96=_0x626e17[0x0][0x2]||0x0;for(let _0x5ea8d2=0x0;_0x5ea8d2<_0x626e17['length'];_0x5ea8d2++){_0x626e17[0x2]>_0x944d96&&(_0x944d96=_0x626e17[0x2]);}return _0x944d96;}}const gatheringPlaceUtil=new GatheringPlaceUtil();class GatheringPlace extends PolygonEntity{constructor(_0x1174a8={}){super(_0x1174a8),this['_minPointNum']=0x3,this['_maxPointNum']=0x3;}[_0x35a251(0x819)](_0x968c8b){const _0x48d5e4={_0x3bdc67:0xe1e},_0x1ffc11=_0x35a251;if(!_0x968c8b||_0x968c8b[_0x1ffc11(_0x48d5e4._0x3bdc67)]_0x56d91e&&(_0x56d91e=_0x345cc3[0x2]);}return _0x56d91e;}}const luneUtil=new LuneUtil();class Lune extends PolygonEntity{constructor(_0x5d1a88={}){const _0x29805a={_0x477d1d:0x920},_0x532588=_0x35a251;super(_0x5d1a88),this[_0x532588(_0x29805a._0x477d1d)]=0x3,this['_maxPointNum']=0x3;}[_0x35a251(0x819)](_0x3ea1b2){const _0x8bc3bf={_0x16537c:0xe1e,_0x377766:0x920},_0x4a5e1a=_0x35a251;if(!_0x3ea1b2||_0x3ea1b2[_0x4a5e1a(_0x8bc3bf._0x16537c)]{const _0x1859f5=_0x45b9eb;_0x3b3152=this['updatePositionsHeightByAttr'](_0x3b3152),_0x418dba[_0x1859f5(_0x3ebd28._0x4ed3f8)]=_0x3b3152;const _0x591267=Cesium__namespace['Cartesian3']['subtract'](_0x3b3152,_0x1d497d,new Cesium__namespace['Cartesian3']());_0x1d497d=_0x3b3152,this['positions']['forEach']((_0x1e943e,_0xab75b0,_0x2cce8e)=>{const _0x13f1c2=_0x1859f5,_0x1d746d=Cesium__namespace['Cartesian3'][_0x13f1c2(0x4af)](_0x1e943e,_0x591267,new Cesium__namespace['Cartesian3']());this['positions'][_0xab75b0]=_0x1d746d;});for(let _0x1ff60a=0x0,_0x500f37=this['draggers'][_0x1859f5(_0x3ebd28._0x550b8b)];_0x1ff60a<_0x500f37;_0x1ff60a++){this['draggers'][_0x1ff60a]['position']=Cesium__namespace['Cartesian3']['add'](this['draggers'][_0x1ff60a]['position'],_0x591267,new Cesium__namespace['Cartesian3']());}}});_0x2b6959['index']=0x0,this['draggers']['push'](_0x2b6959);const _0x1c5f29=getPositionByDirectionAndLen(_0x1d497d,this[_0x45b9eb(_0x4d9ddd._0xcd98d1)][_0x45b9eb(0xcb5)],this['style']['radius']);_0x3562d1[0x1]=_0x1c5f29;const _0x26725d=this['createDragger']({'position':this[_0x45b9eb(_0x4d9ddd._0x37a80b)](_0x1c5f29),'onDrag':(_0xc3c3fb,_0x7b2cc9)=>{const _0x19863e=_0x45b9eb;_0x7b2cc9=this['updatePositionsHeightByAttr'](_0x7b2cc9),_0xc3c3fb['position']=_0x7b2cc9,this['positions'][_0xc3c3fb['index']]=_0x7b2cc9,this['style'][_0x19863e(0x907)]=Cesium__namespace['Cartesian3']['distance'](_0x3562d1[0x0],_0x7b2cc9),this['style'][_0x19863e(_0x4ee200._0x3149e6)]=formatNum$1(getAngle(_0x3562d1[0x0],_0x7b2cc9),0x2);},'onDragStart':(_0x267986,_0x45c05a)=>{const _0x19506d=_0x45b9eb;for(let _0x408a27=0x0,_0x327096=this['draggers']['length'];_0x408a27<_0x327096;_0x408a27++){this['draggers'][_0x408a27][_0x19506d(0x987)]=![];}},'onDragEnd':(_0x4db9be,_0x442750)=>{const _0x1270f8=_0x45b9eb;this[_0x1270f8(_0xadb48d._0x11b42b)]();}});_0x26725d[_0x45b9eb(_0x4d9ddd._0x474f9f)]=0x1,this['draggers'][_0x45b9eb(_0x4d9ddd._0x28bf84)](_0x26725d),this['entityGraphic']['extrudedHeight']&&this['_bindHeightDraggers']();}['_updateHeight'](_0x42460a){const _0x48e66a=_0x35a251;this['entityGraphic']['height']=_0x42460a,this['style']['height']=this['formatNum'](_0x42460a,0x2);const _0x38d039=this['positions'];for(let _0x273da6=0x0,_0x5d02b7=_0x38d039['length'];_0x273da6<_0x5d02b7;_0x273da6++){_0x38d039[_0x273da6]=setPositionsHeight(_0x38d039[_0x273da6],_0x42460a);}this[_0x48e66a(0x264)](EventType['editStyle']);}}class Regular extends PolygonEntity{constructor(_0x4e96f3={}){const _0x584924={_0xdb7847:0xb61},_0x3f6bba=_0x35a251;super(_0x4e96f3),this[_0x3f6bba(0x920)]=0x2,this['_maxPointNum']=0x2,this['style']['radius']=this['style']['radius']??0x3e8,this['style']['startAngle']=this['style']['startAngle']??0x0,_0x4e96f3['position']&&(this[_0x3f6bba(0xb35)]=[_0x4e96f3[_0x3f6bba(_0x584924._0xdb7847)]]);}get['EditClass'](){return EditRegular;}['updateAttrForDrawing'](_0xad325c){const _0x5834d6={_0x58ac6d:0x8eb},_0x380eda=_0x35a251;var _0x3a4791;if(!_0xad325c&&((_0x3a4791=this['_positions_draw'])===null||_0x3a4791===void 0x0?void 0x0:_0x3a4791['length'])>0x1){const _0x41ccdc=this['_positions_draw'][0x0];this['style']['radius']=Cesium__namespace[_0x380eda(_0x5834d6._0x58ac6d)][_0x380eda(0xeed)](_0x41ccdc,this['_positions_draw'][0x1]),this['style']['startAngle']=formatNum$1(getAngle(_0x41ccdc,this['_positions_draw'][0x1]),0x2);}super[_0x380eda(0x149)](_0xad325c);}['getShowPositions'](_0x458651){const _0x15459e=_0x35a251;if(!_0x458651||_0x458651[_0x15459e(0xe1e)]<0x1)return _0x458651;return Regular['getOutlinePositions'](_0x458651[0x0],this[_0x15459e(0xfc8)]);}static[_0x35a251(0x594)](_0xbb3dd3,_0x51f0e7){const _0x21bec3={_0xe807bf:0xcb5},_0x49cfa6=_0x35a251,_0x46db50=_0x51f0e7['border']||0x3,_0x2a7f29=_0x51f0e7[_0x49cfa6(0x907)]||0x3e8,_0x1fbebc=_0x51f0e7[_0x49cfa6(_0x21bec3._0xe807bf)]||0x0,_0x30d10e=0x168/_0x46db50,_0x374a0f=[];for(let _0x1d4be4=0x0;_0x1d4be4<=_0x46db50;_0x1d4be4++){const _0x1ea3ae=_0x1fbebc+_0x30d10e*_0x1d4be4;_0x374a0f['push'](getPositionByDirectionAndLen(_0xbb3dd3,_0x1ea3ae,_0x2a7f29));}return _0x374a0f;}}register$4(_0x35a251(0xa2b),Regular);class EditSector extends EditPolygon{['bindDraggers'](){const _0x36574a={_0x20ce9e:0xf01,_0x332c75:0xd79,_0x5512af:0x7b6,_0x1a09d7:0x7e6,_0x12ba68:0x1bc},_0x388bf5={_0x29cbb3:0xb61},_0x13287a={_0x110290:0xe87},_0x15c47c={_0x214cfd:0x1bc,_0x32ff36:0xeed,_0x38fde1:0xfc8,_0x20a2ee:0xfc8},_0x326acf={_0x544003:0x8eb},_0x24baee={_0x20ab3d:0x8eb},_0x310777=_0x35a251,_0x47bfc6=this['positions'];let _0x5bdf54=this[_0x310777(0x7e6)](_0x47bfc6[0x0]);const _0xba86a4=this[_0x310777(_0x36574a._0x20ce9e)]({'position':_0x5bdf54,'type':PointType['MoveAll'],'tooltip':this[_0x310777(_0x36574a._0x332c75)]['getLangText']('_整体平移'),'onDrag':(_0x44a6ea,_0x22f13d)=>{const _0x8439e9=_0x310777;_0x22f13d=this['updatePositionsHeightByAttr'](_0x22f13d),_0x44a6ea['position']=_0x22f13d;const _0x375881=Cesium__namespace['Cartesian3']['subtract'](_0x22f13d,_0x5bdf54,new Cesium__namespace[(_0x8439e9(_0x326acf._0x544003))]());_0x5bdf54=_0x22f13d,this['positions']['forEach']((_0x174ff1,_0x5a4d13,_0xf7855c)=>{const _0x222e47=_0x8439e9,_0x45496e=Cesium__namespace[_0x222e47(_0x24baee._0x20ab3d)][_0x222e47(0x4af)](_0x174ff1,_0x375881,new Cesium__namespace['Cartesian3']());this['positions'][_0x5a4d13]=_0x45496e;});for(let _0x25debd=0x0,_0x598aac=this['draggers']['length'];_0x25debd<_0x598aac;_0x25debd++){this['draggers'][_0x25debd][_0x8439e9(0xb61)]=Cesium__namespace['Cartesian3']['add'](this['draggers'][_0x25debd]['position'],_0x375881,new Cesium__namespace['Cartesian3']());}}});_0xba86a4['index']=0x0,this[_0x310777(0x1cf)]['push'](_0xba86a4);const _0x45bf0a=getPositionByDirectionAndLen(_0x5bdf54,this['style']['startAngle'],this['style']['radius']);_0x47bfc6[0x1]=_0x45bf0a;const _0x4c857d=this['createDragger']({'position':this[_0x310777(0x7e6)](_0x45bf0a),'onDrag':(_0x43abe4,_0x398e9e)=>{const _0xcbff2=_0x310777;_0x398e9e=this[_0xcbff2(0x7e6)](_0x398e9e),_0x43abe4[_0xcbff2(0xb61)]=_0x398e9e,this[_0xcbff2(0xb35)][_0x43abe4[_0xcbff2(_0x15c47c._0x214cfd)]]=_0x398e9e,this['style']['radius']=Cesium__namespace['Cartesian3'][_0xcbff2(_0x15c47c._0x32ff36)](_0x47bfc6[0x0],_0x398e9e),this[_0xcbff2(_0x15c47c._0x38fde1)]['startAngle']=formatNum$1(getAngle(_0x47bfc6[0x0],_0x398e9e),0x2),_0x47bfc6[0x2]=getPositionByDirectionAndLen(_0x47bfc6[0x0],this['style']['endAngle'],this[_0xcbff2(_0x15c47c._0x20a2ee)]['radius']);},'onDragStart':(_0x9d244,_0x364038)=>{const _0x5a59c8=_0x310777;for(let _0x3c721b=0x0,_0x3f6196=this['draggers']['length'];_0x3c721b<_0x3f6196;_0x3c721b++){this['draggers'][_0x3c721b][_0x5a59c8(0x987)]=![];}},'onDragEnd':(_0x529287,_0x37de6f)=>{const _0x33009a=_0x310777;this[_0x33009a(_0x13287a._0x110290)]();}});_0x4c857d['index']=0x1,this['draggers'][_0x310777(0x6de)](_0x4c857d);const _0x20482b=getPositionByDirectionAndLen(_0x5bdf54,this['style'][_0x310777(_0x36574a._0x5512af)],this['style']['radius']);_0x47bfc6[0x2]=_0x20482b;const _0x48a223=this['createDragger']({'position':this[_0x310777(_0x36574a._0x1a09d7)](_0x20482b),'onDrag':(_0x4fd51a,_0x5c0a7c)=>{const _0x222170=_0x310777;_0x5c0a7c=this['updatePositionsHeightByAttr'](_0x5c0a7c),_0x4fd51a[_0x222170(_0x388bf5._0x29cbb3)]=_0x5c0a7c,this['positions'][_0x4fd51a['index']]=_0x5c0a7c,this[_0x222170(0xfc8)][_0x222170(0x907)]=Cesium__namespace['Cartesian3'][_0x222170(0xeed)](_0x47bfc6[0x0],_0x5c0a7c),this['style']['endAngle']=getAngle(_0x47bfc6[0x0],_0x5c0a7c),_0x47bfc6[0x1]=getPositionByDirectionAndLen(_0x47bfc6[0x0],this['style']['startAngle'],this['style']['radius']);},'onDragStart':(_0x47a9d0,_0x33126c)=>{const _0x2d3a6d=_0x310777;for(let _0x2ea84f=0x0,_0x1051ca=this[_0x2d3a6d(0x1cf)]['length'];_0x2ea84f<_0x1051ca;_0x2ea84f++){this['draggers'][_0x2ea84f]['show']=![];}},'onDragEnd':(_0x11fa6f,_0x22f991)=>{this['updateDraggers']();}});_0x48a223[_0x310777(_0x36574a._0x12ba68)]=0x2,this['draggers']['push'](_0x48a223),this['entityGraphic']['extrudedHeight']&&this['_bindHeightDraggers']();}[_0x35a251(0x626)](_0x2ad1a7){const _0x1fda24=_0x35a251;this['entityGraphic']['height']=_0x2ad1a7,this['style']['height']=this[_0x1fda24(0x4ec)](_0x2ad1a7,0x2);const _0x44a57d=this['positions'];for(let _0x29d4dc=0x0,_0x56eb00=_0x44a57d['length'];_0x29d4dc<_0x56eb00;_0x29d4dc++){_0x44a57d[_0x29d4dc]=setPositionsHeight(_0x44a57d[_0x29d4dc],_0x2ad1a7);}this['fire'](EventType['editStyle']);}}class Sector extends PolygonEntity{constructor(_0x3f8c5a={}){const _0x2a275c={_0x16dc23:0x920,_0x43294a:0xfc8,_0x3e45e9:0x907},_0x4b4eab=_0x35a251;super(_0x3f8c5a),this[_0x4b4eab(_0x2a275c._0x16dc23)]=0x2,this[_0x4b4eab(0x657)]=0x3,this[_0x4b4eab(_0x2a275c._0x43294a)]['radius']=this[_0x4b4eab(0xfc8)][_0x4b4eab(_0x2a275c._0x3e45e9)]??0x3e8,this[_0x4b4eab(_0x2a275c._0x43294a)]['startAngle']=this[_0x4b4eab(0xfc8)]['startAngle']??0x0,this['style']['endAngle']=this['style']['endAngle']??0x0,_0x3f8c5a[_0x4b4eab(0xb61)]&&(this['positions']=[_0x3f8c5a['position']]);}get[_0x35a251(0xbae)](){return EditSector;}[_0x35a251(0x149)](_0x5099b7){const _0x497bc1=_0x35a251;var _0x4fb642;if(!_0x5099b7&&((_0x4fb642=this['_positions_draw'])===null||_0x4fb642===void 0x0?void 0x0:_0x4fb642['length'])>0x1){var _0x579c9a;const _0x1b5834=this['_positions_draw'][0x0];this[_0x497bc1(0xfc8)]['radius']=formatNum$1(Cesium__namespace['Cartesian3']['distance'](_0x1b5834,this['_positions_draw'][0x1]),0x2),this['style']['startAngle']=formatNum$1(getAngle(_0x1b5834,this[_0x497bc1(0x937)][0x1]),0x2),((_0x579c9a=this['_positions_draw'])===null||_0x579c9a===void 0x0?void 0x0:_0x579c9a['length'])>0x2?this['style']['endAngle']=formatNum$1(getAngle(_0x1b5834,this['_positions_draw'][0x2]),0x2):this['style']['endAngle']=this['style']['startAngle'];}super['updateAttrForDrawing'](_0x5099b7);}['getShowPositions'](_0xda855a){const _0xd6f004={_0x273daa:0xfc8},_0x5bfdb0=_0x35a251;if(!_0xda855a||_0xda855a[_0x5bfdb0(0xe1e)]<0x1)return _0xda855a;return Sector[_0x5bfdb0(0x594)](_0xda855a[0x0],this[_0x5bfdb0(_0xd6f004._0x273daa)]);}[_0x35a251(0x6a1)](_0x5f3fa4,_0x20599e){const _0x5e33b8={_0x17b57b:0x907,_0x50f740:0xedd},_0x13cceb=_0x35a251;super['_updateStyleHook'](_0x5f3fa4,_0x20599e),(Cesium__namespace['defined'](_0x20599e[_0x13cceb(_0x5e33b8._0x17b57b)])||Cesium__namespace['defined'](_0x20599e['startAngle'])||Cesium__namespace['defined'](_0x20599e['endAngle'])||Cesium__namespace['defined'](_0x20599e['noCenter']))&&this[_0x13cceb(_0x5e33b8._0x50f740)]();}static[_0x35a251(0x594)](_0x15958d,_0xce70c){const _0x1758b4={_0x152561:0xa48},_0x31288f=_0x35a251,_0x2b413f=_0xce70c['radius'],_0x8f76af=_0xce70c['startAngle'];let _0x1c1127=_0xce70c['endAngle'];_0x1c1127<=_0x8f76af&&(_0x1c1127+=0x168);const _0x49b55e=[];!_0xce70c[_0x31288f(_0x1758b4._0x152561)]&&_0x49b55e['push'](_0x15958d);for(let _0x2631b4=_0x8f76af;_0x2631b4<=_0x1c1127;_0x2631b4++){_0x49b55e['push'](getPositionByDirectionAndLen(_0x15958d,_0x2631b4,_0x2b413f));}return!_0xce70c['noCenter']&&_0x49b55e['push'](_0x15958d),_0x49b55e;}}register$4('sector',Sector);class StraightArrowUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['setOptions'](_0x114014={}){const _0xb85a0c={_0x1a3174:0xf4f,_0x1fac1b:0x9a8},_0x3b9617=_0x35a251;this['tailWidthFactor']=_0x114014['tailWidthFactor']||0.05,this[_0x3b9617(_0xb85a0c._0x1a3174)]=_0x114014['neckWidthFactor']||0.1,this['headWidthFactor']=_0x114014[_0x3b9617(0xca2)]||0.15,this[_0x3b9617(0x3a9)]=Math['PI']/0x4,this[_0x3b9617(_0xb85a0c._0x1fac1b)]=Math['PI']*0.17741;}[_0x35a251(0x57b)](_0x72947,_0x4094c8){const _0x5cc800={_0x50600f:0xa7a,_0x215881:0x917,_0x4cb2db:0x9a8},_0x28bcb3=_0x35a251;if(!_0x72947||_0x72947['length']===0x0)return _0x72947;this['positions']=_0x72947,this['setOptions'](_0x4094c8);const _0x176f96=cartesians2mercators(_0x72947),_0x1841e5=this['getMaxHeight'](_0x176f96),_0x231dde=[_0x176f96[0x0],_0x176f96[0x1]],_0x554913=_0x231dde[0x0],_0x27e4eb=_0x231dde[0x1],_0x3b893e=this['algorithmUtil'][_0x28bcb3(_0x5cc800._0x50600f)](_0x176f96),_0x5f5671=_0x3b893e*this[_0x28bcb3(_0x5cc800._0x215881)],_0x25c24e=_0x3b893e*this['neckWidthFactor'],_0x4a682b=_0x3b893e*this[_0x28bcb3(0xca2)],_0xce9e87=this['algorithmUtil']['getThirdPoint'](_0x27e4eb,_0x554913,Math['PI']/0x2,_0x5f5671,!![]),_0x2fa587=this['algorithmUtil'][_0x28bcb3(0xe07)](_0x27e4eb,_0x554913,Math['PI']/0x2,_0x5f5671,![]),_0x2f19b9=this['algorithmUtil'][_0x28bcb3(0xe07)](_0x554913,_0x27e4eb,this['headAngle'],_0x4a682b,![]),_0xe57280=this[_0x28bcb3(0xd2d)][_0x28bcb3(0xe07)](_0x554913,_0x27e4eb,this['headAngle'],_0x4a682b,!![]),_0x3824b0=this['algorithmUtil']['getThirdPoint'](_0x554913,_0x27e4eb,this[_0x28bcb3(_0x5cc800._0x4cb2db)],_0x25c24e,![]),_0x41d912=this['algorithmUtil'][_0x28bcb3(0xe07)](_0x554913,_0x27e4eb,this['neckAngle'],_0x25c24e,!![]),_0x35af3b=[_0xce9e87,_0x3824b0,_0x2f19b9,_0x27e4eb,_0xe57280,_0x41d912,_0x2fa587],_0x1474fe=mercators2cartesians(_0x35af3b,_0x1841e5);return _0x1474fe;}['getMaxHeight'](_0x14ad38){const _0x5e2860=_0x35a251;let _0x3de101=_0x14ad38[0x0][0x2]||0x0;for(let _0x51a45e=0x0;_0x51a45e<_0x14ad38[_0x5e2860(0xe1e)];_0x51a45e++){_0x14ad38[0x2]>_0x3de101&&(_0x3de101=_0x14ad38[0x2]);}return _0x3de101;}}const straightArrowUtil=new StraightArrowUtil();class StraightArrow extends PolygonEntity{constructor(_0x941a07={}){super(_0x941a07),this['_minPointNum']=0x2,this['_maxPointNum']=0x2;}[_0x35a251(0x819)](_0x5ad37f){const _0x21bf96=_0x35a251;if(!_0x5ad37f||_0x5ad37f[_0x21bf96(0xe1e)]<0x2)return _0x5ad37f;return straightArrowUtil['startCompute'](_0x5ad37f,this['style']);}static['getOutlinePositions'](_0x1406e2,_0x3b75e1){const _0x2ffacd={_0x6c62ac:0xe1e},_0x82ec8=_0x35a251;if(!_0x1406e2||_0x1406e2[_0x82ec8(_0x2ffacd._0x6c62ac)]<0x2)return _0x1406e2;return _0x1406e2=LngLatArray['toCartesians'](_0x1406e2),straightArrowUtil['startCompute'](_0x1406e2,_0x3b75e1);}}register$4('straightArrow',StraightArrow);const DEF_STYLE$l={'color':'#3388ff','pixelSize':0x8,'outlineColor':'#ffffff','outlineWidth':0x2,'visibleDepth':![]};class PointMeasure extends PointEntity{constructor(_0x4dfd7e={}){const _0x30aa1b=_0x35a251;_0x4dfd7e[_0x30aa1b(0xfc8)]={...DEF_STYLE$l,..._0x4dfd7e['style']||{}},super(_0x4dfd7e);}['_addedHook'](_0x2d92f9){const _0x3e7efa={_0x5c7a0d:0xf2d,_0x56c487:0x1fd,_0x1934b4:0x6ae},_0x46cfca={_0xead236:0xa34,_0x5dcb79:0xfa7,_0x52d5a8:0x4fd,_0x2bdd6d:0xb5c,_0x5cb60b:0xb9d,_0x49d697:0x215,_0x3d5479:0xf95},_0x1eb3ae=_0x35a251;super['_addedHook'](_0x2d92f9);const _0x41f7c9=this['_map'];this['bindPopup'](_0xae7038=>{const _0xadda9=_0x2767,_0xbf59fc=this['point'];_0xbf59fc['format']();const _0x2d43ed=degree2dms(_0xbf59fc[_0xadda9(0xfa7)])[_0xadda9(0xcec)],_0x5a09c8=degree2dms(_0xbf59fc['lat'])['str'];let _0x287756='';if(this['options'][_0xadda9(_0x46cfca._0xead236)]!==![]){const _0x4fdbc3=proj4Trans([_0xbf59fc[_0xadda9(_0x46cfca._0x5dcb79)],_0xbf59fc['lat']],_0xadda9(_0x46cfca._0x52d5a8),this['options']['crs']??CRS[_0xadda9(_0x46cfca._0x2bdd6d)]);_0x4fdbc3[0x0]!==_0xbf59fc['lng']&&_0x4fdbc3[0x1]!==_0xbf59fc[_0xadda9(_0x46cfca._0x5cb60b)]&&(_0x287756=''+_0x4fdbc3[0x0]['toFixed'](0x1)+_0xadda9(_0x46cfca._0x49d697)+_0x4fdbc3[0x1]['toFixed'](0x1)+_0xadda9(_0x46cfca._0x3d5479));}return''+_0x41f7c9['getLangText']('_位置信息')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'+_0xbf59fc['lng']+'  '+_0x2d43ed+'
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'+_0xbf59fc['lat']+_0xadda9(0xc34)+_0x5a09c8+_0xadda9(0x2c1)+_0x287756+_0xadda9(0x6b8)+_0x41f7c9['getLangText'](_0xadda9(0xe81))+''+_0xbf59fc['alt']+_0x41f7c9['getLangText']('_米')+'
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';},{'autoClose':this['style']['autoClose']??![],'closeOnClick':this['style'][_0x1eb3ae(_0x3e7efa._0x5c7a0d)]??![]}),this['on'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this[_0x1eb3ae(_0x3e7efa._0x56c487)](EventType['drawCreated'],this[_0x1eb3ae(0x375)],this),this['on'](EventType[_0x1eb3ae(_0x3e7efa._0x1934b4)],this[_0x1eb3ae(0xcae)],this),this['on'](EventType['editRemovePoint'],this['_editPointHandler'],this),this[_0x1eb3ae(0xb61)]&&this[_0x1eb3ae(0x83c)]();}[_0x35a251(0xedd)](){super['_updatePositionsHook'](),this['openPopup']();}[_0x35a251(0xa9a)](){const _0x321726={_0x42fb0d:0x6b2},_0x3f23ff=_0x35a251;this['off'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this['off'](EventType[_0x3f23ff(0xbb7)],this['_drawCreatedHandler'],this),this[_0x3f23ff(_0x321726._0x42fb0d)](EventType['editMovePoint'],this['_editPointHandler'],this),this['off'](EventType['editRemovePoint'],this[_0x3f23ff(0xcae)],this),super['_removedHook']();}[_0x35a251(0x864)](_0x3ad29e){this['openPopup']();}[_0x35a251(0x375)](_0x360693){const _0x5cfcf1=_0x35a251;this['openPopup'](),this['fire'](EventType[_0x5cfcf1(0xa2d)],{'mtype':this['type'],'graphic':this},!![]);}[_0x35a251(0xcae)](_0x3973f2){this['openPopup']();}}register$4('pointMeasure',PointMeasure,!![]);const DEF_STYLE$k={'materialType':'PolylineGlow','glowPower':0.1,'color':_0x35a251(0x533),'width':0x9,'clampToGround':![]};class DistanceMeasure extends PolylineEntity{constructor(_0x2d829b={}){const _0x4805cb={_0x415493:0xfc8},_0x174e2a=_0x35a251;_0x2d829b['hasMoveEdit']=![],_0x2d829b[_0x174e2a(0x788)]=_0x2d829b['showAddText']??!![],_0x2d829b[_0x174e2a(0x793)]=_0x2d829b[_0x174e2a(0x793)]??0x2,_0x2d829b[_0x174e2a(_0x4805cb._0x415493)]={...DEF_STYLE$k,..._0x2d829b['style']||{}},super(_0x2d829b),this['_measured']={};}get['measured'](){const _0x28e6ad=_0x35a251;return this[_0x28e6ad(0x742)];}['_addedHook'](_0x3e7dca){const _0x32f32e={_0xa6d0d9:0x854,_0x5e3d1e:0xc48,_0x4e9c06:0xbb7,_0x18c055:0xcae},_0x3176c8=_0x35a251;var _0x36ff99,_0x33f1cc;super['_addedHook'](_0x3e7dca),this['_arrPartMeasureLable']=[],this['_measureLable']=this['_createLabel'](this['options']['label']||((_0x36ff99=this['_layer'])===null||_0x36ff99===void 0x0?void 0x0:(_0x33f1cc=_0x36ff99['options'])===null||_0x33f1cc===void 0x0?void 0x0:_0x33f1cc[_0x3176c8(_0x32f32e._0xa6d0d9)])),this['_measureLable']['show']=![],this['on'](EventType['drawAddPoint'],this[_0x3176c8(0x67e)],this),this['on'](EventType[_0x3176c8(0xe2b)],this['_drawRemovePointHandler'],this),this['on'](EventType[_0x3176c8(_0x32f32e._0x5e3d1e)],this['_drawMouseMoveHandler'],this),this['once'](EventType[_0x3176c8(_0x32f32e._0x4e9c06)],this['_drawCreatedHandler'],this),this['on'](EventType['editMovePoint'],this[_0x3176c8(0xcae)],this),this['on'](EventType['editRemovePoint'],this['_editPointHandler'],this),this['options']['positions']&&(this['_measureLable']['show']=!![],this[_0x3176c8(_0x32f32e._0x18c055)]());}['_updatePositionsHook'](){const _0x2daf67=_0x35a251;super['_updatePositionsHook'](),this['_measureLable']['show']=!![],this[_0x2daf67(0xcae)]();}[_0x35a251(0xa9a)](){const _0x5c70dd={_0x5e3105:0x6b2,_0x328d96:0xcae,_0x462df9:0xa5f},_0x31e0c1=_0x35a251;this['off'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['off'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this['off'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this[_0x31e0c1(_0x5c70dd._0x5e3105)](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['off'](EventType['editMovePoint'],this[_0x31e0c1(_0x5c70dd._0x328d96)],this),this['off'](EventType['editRemovePoint'],this['_editPointHandler'],this);Cesium__namespace['defined'](this['_measureLable'])&&(this['_removeLabel'](this['_measureLable']),delete this['_measureLable']);if(Cesium__namespace['defined'](this['_arrPartMeasureLable'])&&this['_arrPartMeasureLable']['length']>0x0){const _0xa7835c=this['_arrPartMeasureLable'];if(_0xa7835c&&_0xa7835c['length']>0x0)for(let _0x3fa080=0x0,_0xb01709=_0xa7835c[_0x31e0c1(0xe1e)];_0x3fa080<_0xb01709;_0x3fa080++){this['_removeLabel'](_0xa7835c[_0x3fa080]);}delete this[_0x31e0c1(_0x5c70dd._0x462df9)];}super['_removedHook']();}['_toJSON_Ex'](_0x2db0b1){_0x2db0b1['measured']=getAttrVal(this['measured'],{'onlySimpleType':!![]});}[_0x35a251(0x1eb)](_0x5eec0d){const _0x30fa12={_0x282b7b:0xe86,_0xe7b025:0x3ee,_0x2b62d2:0x742,_0x225977:0xa0c,_0x2e6e6b:0xe1f,_0x36ecc7:0x372},_0x16291d=_0x35a251;_0x5eec0d&&(this[_0x16291d(_0x30fa12._0x282b7b)][_0x16291d(0xc81)]=_0x5eec0d);const _0x1e520a={'unit':this[_0x16291d(0xe86)]['unit'],'lang':this['_map'][_0x16291d(0x9e3)],'decimal':this['options']['decimal']};this['_measured']['distanceStr']=formatDistance(this['_measured']['distance'],_0x1e520a);if(this['_measured']['distance']!==this['_measured']['distanceLastFd']){this[_0x16291d(0xa0c)]['text']=this['_map']['getLangText'](_0x16291d(_0x30fa12._0xe7b025))+':'+this['_measured']['distanceStr'];if(this['options']['showAddText']){const _0x563966=formatDistance(this[_0x16291d(_0x30fa12._0x2b62d2)]['distanceLastFd'],_0x1e520a);this['_measured']['distanceLastFdStr']=_0x563966,this['_measureLable']['text']+=_0x16291d(0x56f)+_0x563966+')';}}else this[_0x16291d(_0x30fa12._0x225977)][_0x16291d(_0x30fa12._0x2e6e6b)]=this['_map']['getLangText']('_总长')+':'+this[_0x16291d(0x742)][_0x16291d(_0x30fa12._0x36ecc7)];if(_0x5eec0d)for(let _0x3c5505=0x1,_0x57a1dc=this[_0x16291d(0xa5f)]['length'];_0x3c5505<_0x57a1dc;_0x3c5505++){const _0x114813=this['_arrPartMeasureLable'][_0x3c5505];_0x114813['showText']&&_0x114813['showText']();}}['_drawAddPointHandler'](_0x92d9cf){const _0x36051e={_0x4d7412:0x263,_0xbc3493:0x854,_0x37037a:0xe1e,_0x1a8f58:0x6de,_0x4b54ba:0x6b3,_0x221053:0x697,_0x4b880b:0xeed,_0x460e67:0x372,_0x6687a3:0xe86,_0x36da0b:0x793},_0x5e4ba0={_0x415580:0xe86,_0x541d61:0xc81,_0x13f3c0:0xd79,_0x128c4a:0x793,_0x379740:0x6b3,_0x5e68b9:0x575},_0x4d08fe=_0x35a251;var _0x3329f3,_0x3216ad;const _0x18a126=this,_0x415621=this[_0x4d08fe(_0x36051e._0x4d7412)],_0x5d3b9a=this['_createLabel'](this['options'][_0x4d08fe(_0x36051e._0xbc3493)]||((_0x3329f3=this['_layer'])===null||_0x3329f3===void 0x0?void 0x0:(_0x3216ad=_0x3329f3['options'])===null||_0x3216ad===void 0x0?void 0x0:_0x3216ad['label']),_0x415621[_0x415621[_0x4d08fe(_0x36051e._0x37037a)]-0x1]);this['_arrPartMeasureLable'][_0x4d08fe(_0x36051e._0x1a8f58)](_0x5d3b9a);if(_0x415621[_0x4d08fe(0xe1e)]===0x1)_0x5d3b9a['text']=this['_map']['getLangText']('_起点');else{const _0x2a58a8=getSurfaceDistance(_0x415621),_0x3c5c19=getSurfaceDistance([_0x415621[_0x415621['length']-0x2],_0x415621[_0x415621['length']-0x1]]);_0x5d3b9a[_0x4d08fe(0x6b3)]={},_0x5d3b9a['attr'][_0x4d08fe(0x260)]=_0x2a58a8,_0x5d3b9a[_0x4d08fe(_0x36051e._0x4b54ba)][_0x4d08fe(0x575)]=_0x3c5c19,_0x5d3b9a[_0x4d08fe(_0x36051e._0x221053)]=function(){const _0x19a52f=_0x4d08fe,_0x21db67={'unit':_0x18a126[_0x19a52f(_0x5e4ba0._0x415580)][_0x19a52f(_0x5e4ba0._0x541d61)],'lang':_0x18a126[_0x19a52f(_0x5e4ba0._0x13f3c0)]['lang'],'decimal':_0x18a126['options'][_0x19a52f(_0x5e4ba0._0x128c4a)]},_0x18809f=formatDistance(this[_0x19a52f(0x6b3)]['value'],_0x21db67);if(this['attr'][_0x19a52f(0x260)]!==this[_0x19a52f(_0x5e4ba0._0x379740)][_0x19a52f(0x575)]){this['text']=_0x18809f;if(_0x18a126['options'][_0x19a52f(0x788)]){const _0x573e79=formatDistance(this['attr'][_0x19a52f(_0x5e4ba0._0x5e68b9)],_0x21db67);this['text']+='\x0a(+'+_0x573e79+')';}}else this['text']=_0x18809f;},_0x5d3b9a['showText'](),this['_measured'][_0x4d08fe(_0x36051e._0x4b880b)]=_0x2a58a8,this['_measured']['distanceLastFd']=_0x3c5c19,this['_measured'][_0x4d08fe(_0x36051e._0x460e67)]=formatDistance(this['_measured']['distance'],{'unit':this[_0x4d08fe(_0x36051e._0x6687a3)]['unit'],'lang':this['_map']['lang'],'decimal':this['options'][_0x4d08fe(_0x36051e._0x36da0b)]});}}['_drawRemovePointHandler'](_0x485936){const _0xb4ebcc=_0x35a251,_0x21eb38=this[_0xb4ebcc(0xa5f)]['pop']();this['_removeLabel'](_0x21eb38),this['_drawMouseMoveHandler'](_0x485936),this['_measureLable'][_0xb4ebcc(0xb61)]=_0x485936['cartesian'];}['_drawMouseMoveHandler'](_0x26aef3){const _0x5c58d1={_0x3e4c7b:0xe1e,_0x265c1e:0xe1e,_0x38b7ac:0xe1e},_0x446ce3=_0x35a251,_0x3ac716=this['positionsShow'];if(!_0x3ac716||_0x3ac716[_0x446ce3(_0x5c58d1._0x3e4c7b)]<0x2){this['_measureLable']['show']=![];return;}const _0x47affe=getSurfaceDistance(_0x3ac716);let _0x50d49a=getSurfaceDistance([_0x3ac716[_0x3ac716[_0x446ce3(_0x5c58d1._0x265c1e)]-0x2],_0x3ac716[_0x3ac716[_0x446ce3(0xe1e)]-0x1]]);_0x50d49a===0x0&&_0x3ac716['length']>0x2&&(_0x50d49a=getSurfaceDistance([_0x3ac716[_0x3ac716[_0x446ce3(_0x5c58d1._0x38b7ac)]-0x3],_0x3ac716[_0x3ac716['length']-0x2]])),this[_0x446ce3(0x742)]['distance']=_0x47affe,this['_measured']['distanceLastFd']=_0x50d49a,this['updateText'](),this['_measureLable'][_0x446ce3(0xb61)]=_0x3ac716[_0x3ac716['length']-0x1],this['fire'](EventType['change'],{'mtype':this['type'],'value':this['_measured']['distance'],'label':this['_measured']['distanceStr']},!![]);}['_drawCreatedHandler'](_0x509a53,_0x39ab2a=!![]){const _0x3d804b={_0x544225:0xe1e,_0xa8e666:0xb61,_0x5e44b7:0xeed},_0x54149c=_0x35a251,_0x37c874=this['positionsShow'],_0x352214=this['_arrPartMeasureLable']['length']-_0x37c874['length'];if(_0x352214>=0x0){for(let _0x100754=this['_arrPartMeasureLable'][_0x54149c(_0x3d804b._0x544225)]-0x1;_0x100754>=_0x37c874['length']-0x1;_0x100754--){this['_removeLabel'](this[_0x54149c(0xa5f)][_0x100754]);}this['_arrPartMeasureLable']['splice'](_0x37c874[_0x54149c(0xe1e)]-0x1,_0x352214+0x1);}this['updateText'](),this['_measureLable'][_0x54149c(_0x3d804b._0xa8e666)]=_0x37c874[_0x37c874['length']-0x1],this['_measureLable']['show']=!![],_0x39ab2a&&this['fire'](EventType['end'],{'mtype':this['type'],'value':this['_measured'][_0x54149c(_0x3d804b._0x5e44b7)],'label':this['_measured']['distanceStr']},!![]);}['_editPointHandler'](_0x580e8b,_0x341cd4=!![]){const _0x568ba6={_0x173d49:0x263,_0x87b7a1:0x32c,_0x27422b:0xe86,_0x17752f:0xe1e,_0x2fb566:0xe86,_0xd23eab:0xa5f,_0x4190d1:0x6b3,_0xaee01:0xc9b},_0x2a6c0b={_0xb5a5e9:0xe86,_0x3b7544:0x6b3},_0x5f0ff2=_0x35a251,_0x4fa26d=this,_0x1a55eb=this[_0x5f0ff2(_0x568ba6._0x173d49)];if(!_0x1a55eb||_0x1a55eb[_0x5f0ff2(0xe1e)]<0x2)return;let _0x326a4d=this['_arrPartMeasureLable'];if(_0x326a4d&&_0x326a4d['length']>0x0)for(let _0x450619=0x1,_0x317351=_0x326a4d['length'];_0x450619<_0x317351;_0x450619++){this[_0x5f0ff2(_0x568ba6._0x87b7a1)](_0x326a4d[_0x450619]);}else{var _0x118cf4,_0x53e795;const _0x1e9d89=this['_createLabel'](this[_0x5f0ff2(_0x568ba6._0x27422b)][_0x5f0ff2(0x854)]||((_0x118cf4=this['_layer'])===null||_0x118cf4===void 0x0?void 0x0:(_0x53e795=_0x118cf4['options'])===null||_0x53e795===void 0x0?void 0x0:_0x53e795['label']),_0x1a55eb[0x0]);_0x1e9d89['text']=this[_0x5f0ff2(0xd79)]['getLangText']('_起点'),_0x326a4d=[_0x1e9d89];}const _0xe109a7=_0x326a4d[0x0];_0xe109a7['position']=_0x1a55eb[0x0],this['_arrPartMeasureLable']=[_0xe109a7];let _0x22a6a6=0x0;for(let _0x472f78=0x1,_0x360190=_0x1a55eb[_0x5f0ff2(_0x568ba6._0x17752f)]-0x1;_0x472f78<_0x360190;_0x472f78++){var _0x58f8ea,_0x213302;const _0x46b2ec=getSurfaceDistance([_0x1a55eb[_0x472f78-0x1],_0x1a55eb[_0x472f78]]);_0x22a6a6+=_0x46b2ec;const _0x502b09=this['_createLabel'](this[_0x5f0ff2(_0x568ba6._0x2fb566)]['label']||((_0x58f8ea=this[_0x5f0ff2(0x2d0)])===null||_0x58f8ea===void 0x0?void 0x0:(_0x213302=_0x58f8ea['options'])===null||_0x213302===void 0x0?void 0x0:_0x213302[_0x5f0ff2(0x854)]),_0x1a55eb[_0x472f78]);this[_0x5f0ff2(_0x568ba6._0xd23eab)]['push'](_0x502b09),_0x502b09['attr']={},_0x502b09['attr'][_0x5f0ff2(0x260)]=_0x22a6a6,_0x502b09[_0x5f0ff2(_0x568ba6._0x4190d1)]['valueFD']=_0x46b2ec,_0x502b09['showText']=function(){const _0x2ad219=_0x5f0ff2,_0x1a9288={'unit':_0x4fa26d['options'][_0x2ad219(0xc81)],'lang':_0x4fa26d['_map']['lang'],'decimal':_0x4fa26d[_0x2ad219(_0x2a6c0b._0xb5a5e9)]['decimal']},_0x36ef43=formatDistance(this['attr']['value'],_0x1a9288);if(this['attr'][_0x2ad219(0x260)]!==this[_0x2ad219(_0x2a6c0b._0x3b7544)]['valueFD']){const _0x144f44=formatDistance(this['attr']['valueFD'],_0x1a9288);this['text']=_0x36ef43,_0x4fa26d['options']['showAddText']&&(this['text']+=_0x2ad219(0x56f)+_0x144f44+')');}else this['text']=_0x36ef43;},_0x502b09[_0x5f0ff2(0x697)]();}const _0x27a9ff=getSurfaceDistance([_0x1a55eb[_0x1a55eb['length']-0x2],_0x1a55eb[_0x1a55eb['length']-0x1]]);_0x22a6a6+=_0x27a9ff,this['_measured']['distance']=_0x22a6a6,this['_measured'][_0x5f0ff2(_0x568ba6._0xaee01)]=_0x27a9ff,this['updateText'](),this['_measureLable'][_0x5f0ff2(0xb61)]=_0x1a55eb[_0x1a55eb[_0x5f0ff2(0xe1e)]-0x1],this['_measureLable']['show']=!![],_0x341cd4&&this['fire'](EventType['change'],{'mtype':this[_0x5f0ff2(0x8ea)],'value':this['_measured']['distance'],'label':this['_measured']['distanceStr']},!![]);}}register$4(_0x35a251(0xf94),DistanceMeasure);class DistanceSurfaceMeasure extends DistanceMeasure{constructor(_0x42c256={}){const _0x8e1607={_0x314e63:0xf13,_0x435793:0x453},_0xaf1e23=_0x35a251;super(_0x42c256),_0x42c256['_promise']&&(this['_promise']=_0x42c256['_promise'],delete _0x42c256[_0xaf1e23(_0x8e1607._0x314e63)]),_0x42c256['style']['clampToGround']=!![],_0x42c256[_0xaf1e23(_0x8e1607._0x435793)]=_0x42c256['splitNum']??0xc8,this['disTerrainScale']=1.2;}[_0x35a251(0x375)](_0x34b4fe){const _0x271059={_0x564f73:0x375},_0x22b918=_0x35a251;super[_0x22b918(_0x271059._0x564f73)](_0x34b4fe,![]),this['updateLengthForTerrain'](_0x34b4fe);}['_editPointHandler'](_0x3fad5d){const _0x79874a=_0x35a251;super['_editPointHandler'](_0x3fad5d,![]),this[_0x79874a(0xa7d)](_0x3fad5d);}[_0x35a251(0xa7d)](_0x20f669){const _0x513c9e={_0x29147a:0x453,_0x37f64b:0xe86},_0x173d17={_0x411a58:0x9f2,_0x1ee209:0xf13},_0x39acf5={_0x1187b0:0xeed,_0x554535:0xc9b},_0x3aa1c9=_0x35a251,_0x86ac88=this[_0x3aa1c9(0x263)];this['fire'](EventType['start'],{'mtype':this['type'],'graphic':this},!![]),getClampDistance(_0x86ac88,{'scene':this['_map']['scene'],'splitNum':this['options'][_0x3aa1c9(_0x513c9e._0x29147a)],'has3dtiles':this['options']['has3dtiles'],'exact':this[_0x3aa1c9(_0x513c9e._0x37f64b)]['exact'],'disTerrainScale':this['disTerrainScale'],'endItem':_0x5b598a=>{const _0x56b673=_0x3aa1c9;if(!this['_map']||!this['_measureLable'])return;let _0x151753=_0x5b598a['index'];const _0x12803e=_0x5b598a['all_distance'],_0x11a550=_0x5b598a['distance'];_0x151753++;const _0x511b48=this['_arrPartMeasureLable'][_0x151753];if(_0x511b48)_0x511b48[_0x56b673(0x6b3)]['value']=_0x12803e,_0x511b48['attr']['valueFD']=_0x11a550,_0x511b48['showText']();else _0x151753===_0x86ac88['length']-0x1&&this['_measureLable']&&(this['_measured'][_0x56b673(_0x39acf5._0x1187b0)]=_0x12803e,this['_measured'][_0x56b673(_0x39acf5._0x554535)]=_0x11a550,this['updateText']());},'end':_0x4f40b3=>{const _0x51197a=_0x3aa1c9;var _0x2b6c33;if(!this['_map']||!this['_measureLable'])return;this['_measured']['distance']=_0x4f40b3;const _0x50b9e9={'mtype':this['type'],'graphic':this,'value':this['_measured']['distance'],'label':this[_0x51197a(0x742)]['distanceStr']};this[_0x51197a(0x264)](EventType[_0x51197a(_0x173d17._0x411a58)],_0x50b9e9,!![]),this['fire'](EventType['end'],_0x50b9e9,!![]),(_0x2b6c33=this['_promise'])!==null&&_0x2b6c33!==void 0x0&&_0x2b6c33['resolve']&&this[_0x51197a(_0x173d17._0x1ee209)]['resolve'](this);}});}}register$4('distanceSurfaceMeasure',DistanceSurfaceMeasure);class SectionMeasure extends DistanceMeasure{constructor(_0x2f46bd={}){const _0x5ef716=_0x35a251;super(_0x2f46bd),_0x2f46bd['_promise']&&(this[_0x5ef716(0xf13)]=_0x2f46bd['_promise'],delete _0x2f46bd['_promise']),_0x2f46bd['style'][_0x5ef716(0x979)]=!![],_0x2f46bd['splitNum']=_0x2f46bd['splitNum']??0xc8;}['_drawCreatedHandler'](_0x2bcf68){const _0x46d940={_0x38b332:0x375},_0xe35aac=_0x35a251;super[_0xe35aac(_0x46d940._0x38b332)](_0x2bcf68,![]),this['updateSectionForTerrain'](_0x2bcf68);}[_0x35a251(0xcae)](_0x2ad9f3){super['_editPointHandler'](_0x2ad9f3,![]),this['updateSectionForTerrain'](_0x2ad9f3);}[_0x35a251(0xb84)](_0x183c5f){const _0x11a6c0={_0x101b79:0x263},_0x4bf69e={_0x3b0743:0xa0c,_0x32ecc5:0x742,_0x2b7cb9:0x372},_0x1f461a={_0x197547:0x682,_0x454f40:0x120,_0x27cdc0:0x6de,_0x376bfb:0x9b1,_0x1db976:0x575},_0x39063e=_0x35a251,_0x594fbf=this[_0x39063e(_0x11a6c0._0x101b79)];if(!_0x594fbf||_0x594fbf['length']<0x2)return;this['fire'](EventType['start'],{'mtype':this['type'],'graphic':this},!![]);let _0xe9d087=0x0;const _0x5e3884=[],_0x1e6fe6=[],_0x4a03c2=[],_0x301c75=[];computeStepSurfaceLine({'map':this['_map'],'positions':_0x594fbf,'splitNum':this['options']['splitNum'],'has3dtiles':this['options'][_0x39063e(0x5ba)],'exact':this['options']['exact'],'endItem':(_0x27de23,_0x15e516,_0x41761e)=>{const _0x958b3c=_0x39063e;var _0x1bc2ec,_0x2621ce;if(!this[_0x958b3c(0xd79)]||!this['_measureLable'])return;const _0x30ae45=(_0x1bc2ec=Cesium__namespace['Cartographic']['fromCartesian'](_0x594fbf[_0x41761e]))===null||_0x1bc2ec===void 0x0?void 0x0:_0x1bc2ec[_0x958b3c(_0x1f461a._0x197547)],_0x637179=(_0x2621ce=Cesium__namespace[_0x958b3c(_0x1f461a._0x454f40)]['fromCartesian'](_0x594fbf[_0x41761e+0x1]))===null||_0x2621ce===void 0x0?void 0x0:_0x2621ce[_0x958b3c(0x682)],_0x288fb7=(_0x637179-_0x30ae45)/_0x27de23['length'];let _0x521421=0x0;for(let _0x56d0b6=0x0;_0x56d0b6<_0x27de23['length'];_0x56d0b6++){if(_0x56d0b6!==0x0){const _0x3401da=Cesium__namespace['Cartesian3']['distance'](_0x27de23[_0x56d0b6],_0x27de23[_0x56d0b6-0x1]);_0xe9d087+=_0x3401da,_0x521421+=_0x3401da;}_0x5e3884[_0x958b3c(_0x1f461a._0x27cdc0)](Number(_0xe9d087['toFixed'](0x1)));const _0x18a991=LngLatPoint[_0x958b3c(_0x1f461a._0x376bfb)](_0x27de23[_0x56d0b6]);_0x1e6fe6['push'](_0x18a991['alt']),_0x301c75['push'](_0x18a991);const _0x40406b=Number((_0x30ae45+_0x288fb7*_0x56d0b6)['toFixed'](0x1));_0x4a03c2['push'](_0x40406b);}_0x41761e++;const _0x38ac1b=this[_0x958b3c(0xa5f)][_0x41761e];if(_0x38ac1b)_0x38ac1b['attr']['value']=_0xe9d087,_0x38ac1b[_0x958b3c(0x6b3)][_0x958b3c(_0x1f461a._0x1db976)]=_0x521421,_0x38ac1b['showText']();else _0x41761e===_0x594fbf['length']-0x1&&this['_measureLable']&&(this['_measured']['distance']=_0xe9d087,this['_measured'][_0x958b3c(0xc9b)]=_0x521421,this['updateText']());},'end':()=>{const _0x63dc11=_0x39063e;var _0x42c9f0;if(!this['_map']||!this[_0x63dc11(_0x4bf69e._0x3b0743)])return;this['updateText'](),this['_measured'][_0x63dc11(0x9f3)]=_0x5e3884,this['_measured']['arrLX']=_0x4a03c2,this[_0x63dc11(_0x4bf69e._0x32ecc5)]['arrHB']=_0x1e6fe6,this['_measured']['arrPoint']=_0x301c75;const _0xce5993={'mtype':this['type'],'graphic':this,'value':_0xe9d087,'label':this[_0x63dc11(0x742)][_0x63dc11(_0x4bf69e._0x2b7cb9)],...this['_measured']};this['fire'](EventType['change'],_0xce5993,!![]),this['fire'](EventType['end'],_0xce5993,!![]),(_0x42c9f0=this['_promise'])!==null&&_0x42c9f0!==void 0x0&&_0x42c9f0['resolve']&&this['_promise']['resolve'](this);}});}}register$4('sectionMeasure',SectionMeasure);const DEF_STYLE$j={'materialType':_0x35a251(0x67a),'color':'#ebe967','width':0x9,'clampToGround':!![]};class AngleMeasure extends PolylineEntity{constructor(_0x6f660a={}){const _0xba99b8={_0x187a93:0xb36,_0x1be4ec:0x5bb,_0xf0ca29:0xfc8},_0x557585=_0x35a251;_0x6f660a[_0x557585(_0xba99b8._0x187a93)]=![],_0x6f660a['maxPointNum']=0x2,_0x6f660a[_0x557585(0x793)]=_0x6f660a['decimal']??0x2,_0x6f660a[_0x557585(_0xba99b8._0x1be4ec)]=_0x6f660a['angleDecimal']??0x1,_0x6f660a['style']={...DEF_STYLE$j,..._0x6f660a[_0x557585(_0xba99b8._0xf0ca29)]||{}},super(_0x6f660a),this['_measured']={};}get['measured'](){return this['_measured'];}[_0x35a251(0x97b)](_0x5567cd){const _0x38f65f={_0x48e8dc:0xa0c,_0x35ce4a:0xe2b,_0x1b2bd7:0x1fd,_0x1b8f0f:0xbb7,_0x262dcc:0x375},_0x1d9314=_0x35a251;var _0x49fb62,_0x4b19bd;super['_addedHook'](_0x5567cd),this['_measureLable']=this['_createLabel'](this['options']['label']||((_0x49fb62=this['_layer'])===null||_0x49fb62===void 0x0?void 0x0:(_0x4b19bd=_0x49fb62['options'])===null||_0x4b19bd===void 0x0?void 0x0:_0x4b19bd['label'])),this[_0x1d9314(_0x38f65f._0x48e8dc)][_0x1d9314(0x987)]=![],this['on'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['on'](EventType[_0x1d9314(_0x38f65f._0x35ce4a)],this[_0x1d9314(0x9c6)],this),this['on'](EventType[_0x1d9314(0xc48)],this['_drawMouseMoveHandler'],this),this[_0x1d9314(_0x38f65f._0x1b2bd7)](EventType[_0x1d9314(_0x38f65f._0x1b8f0f)],this[_0x1d9314(_0x38f65f._0x262dcc)],this),this['on'](EventType['editMovePoint'],this['_drawMouseMoveHandler'],this),this['on'](EventType['editRemovePoint'],this['_drawMouseMoveHandler'],this),this['on'](EventType['editMouseMove'],this['_drawMouseMoveHandler'],this),this['options']['positions']&&(this['_measureLable']['show']=!![],this['_drawMouseMoveHandler']());}[_0x35a251(0xedd)](){const _0x251dc9={_0x43b0ab:0x987},_0x1ff73f=_0x35a251;super['_updatePositionsHook'](),this[_0x1ff73f(0xa0c)][_0x1ff73f(_0x251dc9._0x43b0ab)]=!![],this['_drawMouseMoveHandler']();}[_0x35a251(0xa9a)](){const _0x2d58a7={_0x3769a7:0x6b2,_0x21bfa2:0x6b2,_0x130db4:0xbb7,_0x446361:0x375,_0x14e52e:0x864},_0x300d66=_0x35a251;this['off'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this[_0x300d66(_0x2d58a7._0x3769a7)](EventType['drawMouseMove'],this[_0x300d66(0x864)],this),this['off'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this[_0x300d66(_0x2d58a7._0x21bfa2)](EventType[_0x300d66(_0x2d58a7._0x130db4)],this[_0x300d66(_0x2d58a7._0x446361)],this),this[_0x300d66(0x6b2)](EventType['editMovePoint'],this[_0x300d66(0x864)],this),this['off'](EventType['editRemovePoint'],this['_drawMouseMoveHandler'],this),this[_0x300d66(0x6b2)](EventType['editMouseMove'],this[_0x300d66(_0x2d58a7._0x14e52e)],this),Cesium__namespace['defined'](this['_measureLable'])&&(this['_removeLabel'](this['_measureLable']),delete this[_0x300d66(0xa0c)]),super[_0x300d66(0xa9a)]();}[_0x35a251(0x4d5)](_0x4dd08b){_0x4dd08b['measured']=getAttrVal(this['measured'],{'onlySimpleType':!![]});}['updateText'](_0x565d97){const _0x3b9601={_0x3058da:0xeed,_0x8e0217:0xe86,_0x39d9fc:0x44e},_0x27f6fb=_0x35a251;_0x565d97&&(this['options']['unit']=_0x565d97),this['_measured']['angleStr']=this['_measured']['angle']['toFixed'](this['options'][_0x27f6fb(0x5bb)])+'°',this['_measured']['distanceStr']=formatDistance(this['_measured'][_0x27f6fb(_0x3b9601._0x3058da)],{'unit':this[_0x27f6fb(_0x3b9601._0x8e0217)]['unit'],'lang':this['_map']['lang'],'decimal':this['options']['decimal']}),this['_measureLable']['text']=this['_map'][_0x27f6fb(_0x3b9601._0x39d9fc)]('_角度')+':'+this['_measured']['angleStr']+'\x0a'+this[_0x27f6fb(0xd79)]['getLangText'](_0x27f6fb(0x584))+':'+this['_measured']['distanceStr'];}['_drawAddPointHandler'](_0x362819){const _0x36ad12={_0x5c09b2:0x864},_0xa7c2d7=_0x35a251;this[_0xa7c2d7(_0x36ad12._0x5c09b2)](_0x362819);}['_drawRemovePointHandler'](_0x5a8901){const _0x2ce072={_0x89578f:0xa0c},_0x52fc0a=_0x35a251;this[_0x52fc0a(_0x2ce072._0x89578f)]&&(this[_0x52fc0a(0xa0c)][_0x52fc0a(0x987)]=![]);}['_drawMouseMoveHandler'](_0x54592d){const _0x1ca80c={_0x3909f7:0xa0c,_0x219422:0x742},_0x45971c=_0x35a251,_0x53e9c3=this['positionsShow'];if(!_0x53e9c3||_0x53e9c3['length']<0x2){this[_0x45971c(_0x1ca80c._0x3909f7)]['show']=![];return;}this['_measured']['distance']=Cesium__namespace[_0x45971c(0x8eb)]['distance'](_0x53e9c3[0x0],_0x53e9c3[0x1]),this['_measured']['angle']=getAngle(_0x53e9c3[0x0],_0x53e9c3[0x1],!![]),this['updateText'](),this['_measureLable']['position']=_0x53e9c3[0x1],this[_0x45971c(_0x1ca80c._0x3909f7)][_0x45971c(0x987)]=!![],this[_0x45971c(0x264)](EventType['change'],{'mtype':this['type'],'value':this[_0x45971c(_0x1ca80c._0x219422)]['angle'],'label':this['_measured']['angleStr']},!![]);}['_drawCreatedHandler'](_0x32c530){const _0x1c7d09={_0x423d7e:0xceb},_0x14eca2=_0x35a251;this['fire'](EventType['end'],{'mtype':this['type'],'value':this[_0x14eca2(0x742)]['angle'],'label':this['_measured'][_0x14eca2(_0x1c7d09._0x423d7e)]},!![]);}}register$4('angleMeasure',AngleMeasure);const DEF_STYLE$i={'materialType':'PolylineGlow','glowPower':0.1,'color':'#ebe12c','width':0x9};class HeightMeasure extends PolylineEntity{constructor(_0xf9ad0f={}){const _0x6c5156={_0x3b8d43:0xfc8},_0xe6e265=_0x35a251;_0xf9ad0f['hasMoveEdit']=![],_0xf9ad0f['maxPointNum']=0x2,_0xf9ad0f['decimal']=_0xf9ad0f[_0xe6e265(0x793)]??0x2,_0xf9ad0f['style']={...DEF_STYLE$i,..._0xf9ad0f[_0xe6e265(_0x6c5156._0x3b8d43)]||{}},super(_0xf9ad0f),this['_measured']={};}get['measured'](){const _0x136073={_0x477e14:0x742},_0x2cad08=_0x35a251;return this[_0x2cad08(_0x136073._0x477e14)];}['_addedHook'](_0x5a680e){const _0x425545={_0x222f2f:0xd4d,_0x4599e7:0x1fd,_0x4332d5:0xa77},_0x39af27=_0x35a251;super['_addedHook'](_0x5a680e),this[_0x39af27(_0x425545._0x222f2f)](),this['on'](EventType[_0x39af27(0x4bd)],this['_drawAddPointHandler'],this),this['on'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this['on'](EventType[_0x39af27(0xc48)],this['_drawMouseMoveHandler'],this),this[_0x39af27(_0x425545._0x4599e7)](EventType[_0x39af27(0xbb7)],this['_drawCreatedHandler'],this),this['on'](EventType[_0x39af27(0x6ae)],this['_editPointHandler'],this),this['on'](EventType[_0x39af27(_0x425545._0x4332d5)],this[_0x39af27(0xcae)],this),this['on'](EventType['editMouseMove'],this['_editPointHandler'],this),this['options']['positions']&&(this['_measureLable']['show']=!![],this['_editPointHandler']());}['_updatePositionsHook'](){const _0x2fc0aa=_0x35a251;super['_updatePositionsHook'](),this[_0x2fc0aa(0xa0c)]['show']=!![],this['_editPointHandler']();}['_removedHook'](){const _0x1529ba={_0x367cfa:0x6b2,_0x1362b1:0xc48,_0x258407:0x864,_0x4bad8f:0x375,_0x463793:0xcae},_0x13ce5f=_0x35a251;this[_0x13ce5f(_0x1529ba._0x367cfa)](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['off'](EventType[_0x13ce5f(_0x1529ba._0x1362b1)],this[_0x13ce5f(_0x1529ba._0x258407)],this),this['off'](EventType['drawRemovePoint'],this[_0x13ce5f(0x9c6)],this),this['off'](EventType[_0x13ce5f(0xbb7)],this[_0x13ce5f(_0x1529ba._0x4bad8f)],this),this['off'](EventType['editMovePoint'],this['_editPointHandler'],this),this[_0x13ce5f(0x6b2)](EventType['editRemovePoint'],this[_0x13ce5f(_0x1529ba._0x463793)],this),this['off'](EventType['editMouseMove'],this['_editPointHandler'],this),this['_removeMeasureLabelAndEx'](),super['_removedHook']();}[_0x35a251(0x4d5)](_0x3a95f3){_0x3a95f3['measured']=getAttrVal(this['measured'],{'onlySimpleType':!![]});}['_initMeasureLable'](){const _0x15863d={_0x17b294:0xe86,_0x3796cc:0x854,_0x201e6b:0xa0c},_0x5c8828=_0x35a251;var _0x271a26,_0xb16c81;this['_measureLable']=this['_createLabel'](this[_0x5c8828(_0x15863d._0x17b294)]['label']||((_0x271a26=this['_layer'])===null||_0x271a26===void 0x0?void 0x0:(_0xb16c81=_0x271a26[_0x5c8828(0xe86)])===null||_0xb16c81===void 0x0?void 0x0:_0xb16c81[_0x5c8828(_0x15863d._0x3796cc)])),this[_0x5c8828(_0x15863d._0x201e6b)]['show']=![];}[_0x35a251(0x953)](){Cesium__namespace['defined'](this['_measureLable'])&&(this['_removeLabel'](this['_measureLable']),delete this['_measureLable']);}['updateText'](_0x2fcff6){const _0x7e4602={_0x1413de:0xd79},_0x274e3e=_0x35a251;_0x2fcff6&&(this['options'][_0x274e3e(0xc81)]=_0x2fcff6),this['_measured']['heightStr']=formatDistance(this['_measured']['height'],{'unit':this[_0x274e3e(0xe86)][_0x274e3e(0xc81)],'lang':this[_0x274e3e(_0x7e4602._0x1413de)]['lang'],'decimal':this['options'][_0x274e3e(0x793)]}),this[_0x274e3e(0xa0c)]['text']=this[_0x274e3e(0xd79)][_0x274e3e(0x44e)]('_高度差')+':'+this['_measured']['heightStr'];}['_drawAddPointHandler'](_0x5d64df){this['_drawMouseMoveHandler'](_0x5d64df);}['_drawRemovePointHandler'](_0x28f1a2){const _0x4b6789=_0x35a251;this['_measureLable']&&(this[_0x4b6789(0xa0c)][_0x4b6789(0x987)]=![]);}['_drawMouseMoveHandler'](_0x4a2674){const _0x6549a={_0x275a78:0x987,_0x426ff4:0x405,_0x3beb07:0x682},_0x52c0de=_0x35a251,_0x4a26e9=this['positionsShow'];if(!_0x4a26e9||_0x4a26e9['length']<0x2){this['_measureLable'][_0x52c0de(_0x6549a._0x275a78)]=![];return;}const _0x275481=Cesium__namespace['Cartographic'][_0x52c0de(0x9b1)](_0x4a26e9[0x0]),_0x429395=Cesium__namespace['Cartographic']['fromCartesian'](_0x4a26e9[0x1]);this['_measured']['height']=this['_map']['getRealAlt'](Math[_0x52c0de(_0x6549a._0x426ff4)](_0x429395['height']-_0x275481[_0x52c0de(_0x6549a._0x3beb07)])),this[_0x52c0de(0x1eb)](),this['_measureLable']['position']=Cesium__namespace['Cartesian3']['midpoint'](_0x4a26e9[0x0],_0x4a26e9[0x1],new Cesium__namespace['Cartesian3']()),this['_measureLable']['show']=!![],this['fire'](EventType['change'],{'mtype':this['type'],'value':this['_measured'][_0x52c0de(0x682)],'label':this['_measured'][_0x52c0de(0xd62)]},!![]);}[_0x35a251(0x375)](_0x238ba9){const _0x30c0ca={_0x1e60bb:0x742},_0x1e9734=_0x35a251;this[_0x1e9734(0x264)](EventType['end'],{'mtype':this['type'],'value':this['_measured'][_0x1e9734(0x682)],'label':this[_0x1e9734(_0x30c0ca._0x1e60bb)]['heightStr']},!![]);}['_editPointHandler'](_0x4752cd){this['_drawMouseMoveHandler'](_0x4752cd);}}register$4('heightMeasure',HeightMeasure);class HeightTriangleMeasure extends HeightMeasure{['_initMeasureLable'](){const _0x520305={_0x5799d9:0x8b7,_0x3e986e:0x248},_0x5df459=_0x35a251;var _0x5b80ff,_0x6c7cb4,_0x4085d5,_0x4ab3eb;super['_initMeasureLable'](),this['_measureDistanceLable']=this[_0x5df459(_0x520305._0x5799d9)](this[_0x5df459(0xe86)]['label']||((_0x5b80ff=this['_layer'])===null||_0x5b80ff===void 0x0?void 0x0:(_0x6c7cb4=_0x5b80ff['options'])===null||_0x6c7cb4===void 0x0?void 0x0:_0x6c7cb4['label'])),this[_0x5df459(0x7ae)]['pixelOffset']=new Cesium__namespace[(_0x5df459(_0x520305._0x3e986e))](0x0,0x0),this['_measureHorLable']=this['_createLabel'](this[_0x5df459(0xe86)]['label']||((_0x4085d5=this['_layer'])===null||_0x4085d5===void 0x0?void 0x0:(_0x4ab3eb=_0x4085d5[_0x5df459(0xe86)])===null||_0x4ab3eb===void 0x0?void 0x0:_0x4ab3eb['label'])),this['_measureHorLable'][_0x5df459(0x317)]=new Cesium__namespace['Cartesian2'](0x0,0x0);}['_removeMeasureLabelAndEx'](){const _0x1b2c34={_0x5ccada:0x84e},_0x1d2b63=_0x35a251;super['_removeMeasureLabelAndEx'](),this['_measureDistanceLable']!=null&&(this['_removeLabel'](this['_measureDistanceLable']),delete this['_measureDistanceLable']),this['_measureHorLable']!=null&&(this['_removeLabel'](this['_measureHorLable']),delete this[_0x1d2b63(_0x1b2c34._0x5ccada)]),this['_measureExLine']!=null&&(this['dataSource']['entities']['remove'](this['_measureExLine']),delete this['_measureExLine']);}['updateText'](_0x124721){const _0x3c8ad4={_0x85c357:0xd79,_0x1ad652:0xeed,_0x28da8b:0xe1f,_0x46e8ee:0xd7b,_0x40b650:0x742},_0x4674ae=_0x35a251;super['updateText'](_0x124721);const _0x3fe8d9={'unit':this['options']['unit'],'lang':this[_0x4674ae(_0x3c8ad4._0x85c357)][_0x4674ae(0x9e3)],'decimal':this['options']['decimal']};this['_measured'][_0x4674ae(0x372)]=formatDistance(this['_measured'][_0x4674ae(_0x3c8ad4._0x1ad652)],_0x3fe8d9),this['_measureDistanceLable'][_0x4674ae(_0x3c8ad4._0x28da8b)]=this['_map']['getLangText'](_0x4674ae(_0x3c8ad4._0x46e8ee))+':'+this[_0x4674ae(_0x3c8ad4._0x40b650)]['distanceStr'],this['_measured']['distanceHorStr']=formatDistance(this['_measured']['distanceHor'],_0x3fe8d9),this['_measureHorLable']['text']=this['_map']['getLangText']('_水平距离')+':'+this['_measured']['distanceHorStr'];}[_0x35a251(0x9c6)](_0x37b72e){const _0x321e92={_0x1e1a3c:0x6e0},_0x18ff78=_0x35a251;this['_measureLable']&&(this['_measureLable']['show']=![]),this['_measureHorLable']&&(this['_measureHorLable']['show']=![]),this['_measureDistanceLable']&&(this[_0x18ff78(0x7ae)]['show']=![]),this['_measureExLine']&&(this[_0x18ff78(_0x321e92._0x1e1a3c)]=null);}['_drawMouseMoveHandler'](_0x387f03){const _0x546937={_0x417c0a:0x9b1,_0x5e431c:0x8eb,_0x578707:0x175,_0x3bf190:0x742,_0x1bc4b5:0xa0c,_0x101e68:0x8eb,_0x33fefc:0x1eb,_0x1ef79e:0x5bc},_0xfb8264=_0x35a251,_0x2f70d4=this['positionsShow'];if(!_0x2f70d4||_0x2f70d4['length']<0x2){this[_0xfb8264(0xa0c)]['show']=![];return;}const _0x3ccd6c=Cesium__namespace['Cartographic']['fromCartesian'](_0x2f70d4[0x0]),_0x4bf763=_0x3ccd6c['height'],_0x549bc=Cesium__namespace['Cartographic'][_0xfb8264(_0x546937._0x417c0a)](_0x2f70d4[0x1]),_0x5f4a53=_0x549bc[_0xfb8264(0x682)];let _0x4fe160,_0x1ba746,_0x251cde;_0x4bf763>_0x5f4a53?(_0x1ba746=Cesium__namespace[_0xfb8264(_0x546937._0x5e431c)][_0xfb8264(_0x546937._0x578707)](_0x549bc[_0xfb8264(0xc26)],_0x549bc['latitude'],_0x4bf763),_0x251cde=_0x2f70d4[0x0],_0x4fe160=_0x2f70d4[0x1]):(_0x1ba746=Cesium__namespace['Cartesian3']['fromRadians'](_0x3ccd6c['longitude'],_0x3ccd6c['latitude'],_0x5f4a53),_0x251cde=_0x2f70d4[0x1],_0x4fe160=_0x2f70d4[0x0]),this[_0xfb8264(_0x546937._0x3bf190)]['height']=this['_map']['getRealAlt'](Math['abs'](_0x5f4a53-_0x4bf763)),this['_measureLable'][_0xfb8264(0xb61)]=Cesium__namespace[_0xfb8264(0x8eb)]['midpoint'](_0x1ba746,_0x4fe160,new Cesium__namespace['Cartesian3']()),this[_0xfb8264(_0x546937._0x1bc4b5)][_0xfb8264(0x987)]=!![],this['_measured']['distance']=Cesium__namespace[_0xfb8264(_0x546937._0x5e431c)]['distance'](_0x251cde,_0x4fe160),this['_measureDistanceLable']['position']=Cesium__namespace[_0xfb8264(0x8eb)]['midpoint'](_0x251cde,_0x4fe160,new Cesium__namespace['Cartesian3']()),this[_0xfb8264(0x7ae)]['show']=!![],this[_0xfb8264(_0x546937._0x3bf190)]['distanceHor']=Cesium__namespace['Cartesian3']['distance'](_0x1ba746,_0x251cde),this['_measureHorLable']['position']=Cesium__namespace[_0xfb8264(_0x546937._0x101e68)]['midpoint'](_0x1ba746,_0x251cde,new Cesium__namespace['Cartesian3']()),this['_measureHorLable']['show']=!![],this[_0xfb8264(_0x546937._0x33fefc)](),this[_0xfb8264(_0x546937._0x1ef79e)]([_0x4fe160,_0x1ba746,_0x251cde]),this['fire'](EventType['change'],{'mtype':this['type'],'value':this[_0xfb8264(0x742)]['height'],'label':this['_measured'][_0xfb8264(0xd62)]},!![]);}[_0x35a251(0x5bc)](_0x19bfa3){const _0x28cdd8={_0x28ff8b:0xad5,_0x5a5465:0x4af,_0x6f0337:0x468},_0x7e544d=_0x35a251;this['_measureExLine_positions']=_0x19bfa3;if(!this['_measureExLine']){const _0x255b67={'id':this['id']+'-ex','polyline':PolylineStyleConver['toCesiumVal'](this['options']['style'],{},!![])};_0x255b67['polyline']['positions']=new Cesium__namespace['CallbackProperty'](_0x14e669=>{const _0x3af4f9=_0x2767;return this[_0x3af4f9(0x6e0)];},![]),this['_measureExLine']=this['_createEntity'](_0x255b67),this[_0x7e544d(_0x28cdd8._0x28ff8b)]['entities'][_0x7e544d(_0x28cdd8._0x5a5465)](this['_measureExLine']),this['bindPickId'](this[_0x7e544d(_0x28cdd8._0x6f0337)]);}}['_editPointHandler'](_0x1f45bb){const _0x159ca0={_0x3dfadb:0x864},_0xc64574=_0x35a251;this[_0xc64574(_0x159ca0._0x3dfadb)](_0x1f45bb);}}register$4('heightTriangleMeasure',HeightTriangleMeasure);const DEF_STYLE$h={'color':'#00fff2','outline':!![],'outlineColor':'#fafa5a','outlineWidth':0x1,'opacity':0.4,'clampToGround':![]};class AreaMeasure extends PolygonEntity{constructor(_0x403dcf={}){const _0x2a0495={_0x54e2e1:0x238},_0x1412c3=_0x35a251;_0x403dcf['hasMoveEdit']=![],_0x403dcf['decimal']=_0x403dcf['decimal']??0x2,_0x403dcf['style']={...DEF_STYLE$h,..._0x403dcf['style']||{}},_0x403dcf['label']&&(_0x403dcf['label']={'horizontalOrigin':Cesium__namespace['HorizontalOrigin'][_0x1412c3(_0x2a0495._0x54e2e1)],..._0x403dcf['label']}),super(_0x403dcf),this['_measured']={};}get['measured'](){const _0x58afeb={_0x40d995:0x742},_0x3a36bd=_0x35a251;return this[_0x3a36bd(_0x58afeb._0x40d995)];}[_0x35a251(0x97b)](_0x2f59ea){const _0x221415=_0x35a251;var _0x7f601b,_0x5b5247;super['_addedHook'](_0x2f59ea),this[_0x221415(0xa0c)]=this['_createLabel'](this['options']['label']||((_0x7f601b=this['_layer'])===null||_0x7f601b===void 0x0?void 0x0:(_0x5b5247=_0x7f601b['options'])===null||_0x5b5247===void 0x0?void 0x0:_0x5b5247['label'])),this[_0x221415(0xa0c)][_0x221415(0x987)]=![],this['on'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['on'](EventType[_0x221415(0xe2b)],this[_0x221415(0x9c6)],this),this['on'](EventType['drawMouseMove'],this[_0x221415(0x864)],this),this[_0x221415(0x1fd)](EventType[_0x221415(0xbb7)],this[_0x221415(0x375)],this),this['on'](EventType['editMovePoint'],this['_editPointHandler'],this),this['on'](EventType['editRemovePoint'],this[_0x221415(0xcae)],this),this['options']['positions']&&(this['_measureLable']['show']=!![],this[_0x221415(0xcae)]());}[_0x35a251(0xedd)](){super['_updatePositionsHook'](),this['_measureLable']&&(this['_measureLable']['show']=!![],this['_editPointHandler']());}['_removedHook'](){const _0x1bd4b0={_0x783fae:0x67e},_0xfccf58=_0x35a251;this['off'](EventType[_0xfccf58(0x4bd)],this[_0xfccf58(_0x1bd4b0._0x783fae)],this),this['off'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this['off'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this['off'](EventType['drawCreated'],this['_drawCreatedHandler'],this),this[_0xfccf58(0x6b2)](EventType['editMovePoint'],this['_editPointHandler'],this),this['off'](EventType['editRemovePoint'],this[_0xfccf58(0xcae)],this),this['_removeMeasureLabelAndEx'](),super['_removedHook']();}['_toJSON_Ex'](_0x40f242){const _0x3e83a0=_0x35a251;_0x40f242[_0x3e83a0(0xec4)]=getAttrVal(this['measured'],{'onlySimpleType':!![],'noArray':!![]});}['_removeMeasureLabelAndEx'](){const _0x3b95eb={_0x196424:0xaa2,_0x5d51bf:0x32c},_0x143720=_0x35a251;Cesium__namespace[_0x143720(_0x3b95eb._0x196424)](this[_0x143720(0xa0c)])&&(this[_0x143720(_0x3b95eb._0x5d51bf)](this['_measureLable']),delete this['_measureLable']);}['updateText'](_0x379d40){const _0x308696={_0x34d19b:0xc81,_0x221436:0x742,_0x3364c2:0xe86,_0x3f088c:0xe86,_0x493221:0xd79,_0x11c726:0x44e},_0x4ef8a3=_0x35a251;_0x379d40&&(this['options'][_0x4ef8a3(_0x308696._0x34d19b)]=_0x379d40),this[_0x4ef8a3(0x742)][_0x4ef8a3(0xba8)]=formatArea(this[_0x4ef8a3(_0x308696._0x221436)]['area'],{'unit':this[_0x4ef8a3(_0x308696._0x3364c2)][_0x4ef8a3(0xc81)],'lang':this['_map']['lang'],'decimal':this[_0x4ef8a3(_0x308696._0x3f088c)]['decimal']}),this['_measureLable']['text']=this[_0x4ef8a3(_0x308696._0x493221)][_0x4ef8a3(_0x308696._0x11c726)]('_面积')+':'+this[_0x4ef8a3(0x742)]['areaStr'];}['startDraw'](_0xd6e1ac){const _0x1220be={_0x3410e3:0xe86,_0x519c17:0xb35,_0x2b2c5f:0x77c},_0x5e14e8=_0x35a251;var _0x37f274;super['startDraw'](_0xd6e1ac),this['_drawMouseMoveHandler'](),((_0x37f274=this[_0x5e14e8(_0x1220be._0x3410e3)][_0x5e14e8(_0x1220be._0x519c17)])===null||_0x37f274===void 0x0?void 0x0:_0x37f274['length'])>0x2&&this[_0x5e14e8(_0x1220be._0x2b2c5f)]();}['_drawAddPointHandler'](_0x2b9302){const _0x2fe807={_0x423793:0x864},_0x429280=_0x35a251;this[_0x429280(_0x2fe807._0x423793)](_0x2b9302);}['_drawRemovePointHandler'](_0x169281){const _0x399d4d={_0x2eea01:0xa0c,_0x52a986:0x987},_0x4f8bd3=_0x35a251,_0x1faa14=this['positionsShow'];(_0x1faa14===null||_0x1faa14===void 0x0?void 0x0:_0x1faa14['length'])<0x3&&(this[_0x4f8bd3(_0x399d4d._0x2eea01)][_0x4f8bd3(_0x399d4d._0x52a986)]=![]);}[_0x35a251(0x864)](_0xa71899){const _0xf0829c=_0x35a251,_0x50a3dc=this['positionsShow'];if(_0x50a3dc['length']<0x3){this['_measureLable']&&(this['_measureLable']['show']=![]);return;}this['_measured']['area']=getArea(_0x50a3dc),this['updateText']();const _0x1def1b=centerOfMass(_0x50a3dc);this['_measureLable']['position']=_0x1def1b,this[_0xf0829c(0xa0c)][_0xf0829c(0x987)]=!![],this['fire'](EventType['change'],{'mtype':this['type'],'value':this['_measured']['area'],'label':this[_0xf0829c(0x742)]['areaStr']},!![]);}['_drawCreatedHandler'](_0x4d0953){this['fire'](EventType['end'],{'mtype':this['type'],'value':this['_measured']['area'],'label':this['_measured']['areaStr']},!![]);}[_0x35a251(0xcae)](_0x4f330e){const _0x3f0196={_0x3f06b0:0x264},_0x14410d=_0x35a251,_0x277dea=this[_0x14410d(0x263)];if(!_0x277dea||_0x277dea[_0x14410d(0xe1e)]<0x3)return;this[_0x14410d(0x742)]['area']=getArea(_0x277dea),this['updateText'](),this['_measureLable']['position']=centerOfMass(_0x277dea),this[_0x14410d(_0x3f0196._0x3f06b0)](EventType['change'],{'mtype':this['type'],'value':this['_measured']['area'],'label':this[_0x14410d(0x742)]['areaStr']},!![]);}}register$4('areaMeasure',AreaMeasure);class AreaSurfaceMeasure extends AreaMeasure{constructor(_0x4c6c47={}){const _0x28e606=_0x35a251;super(_0x4c6c47),_0x4c6c47['_promise']&&(this[_0x28e606(0xf13)]=_0x4c6c47['_promise'],delete _0x4c6c47['_promise']),_0x4c6c47['style']['clampToGround']=!![];}['_drawCreatedHandler'](_0x5d4ede){const _0x3641bc={_0x4f7300:0xcd9},_0x584cda=_0x35a251;this[_0x584cda(_0x3641bc._0x4f7300)](_0x5d4ede);}['_editPointHandler'](_0x21b44d){const _0x247867={_0x48afa0:0xcd9},_0x36351c=_0x35a251;super['_editPointHandler'](_0x21b44d),this[_0x36351c(_0x247867._0x48afa0)](_0x21b44d);}['updateAreaForTerrain'](_0x6451e5){const _0x3906d7={_0x519f20:0xaa1,_0x3aa4c3:0xc60},_0x506c7d={_0xeb1df4:0xb61,_0x2ed54d:0xd79,_0x522ab7:0x571,_0x3e4b13:0xa0c,_0x1dfe3d:0x705,_0x71a7f4:0x1eb,_0x583395:0x8ea,_0x1d4c46:0x742,_0x58fb19:0xf13},_0x52e899=_0x35a251,_0x374965=this['positionsShow'];if(!_0x374965||_0x374965['length']<0x3)return;this['fire'](EventType[_0x52e899(_0x3906d7._0x519f20)],{'mtype':this['type'],'graphic':this},!![]),getClampArea(_0x374965,{'scene':this['_map'][_0x52e899(_0x3906d7._0x3aa4c3)],'splitNum':this['options']['splitNum'],'has3dtiles':this['options']['has3dtiles'],'exact':this['options']['exact']})['then'](_0x20f677=>{const _0x3c34da=_0x52e899;var _0x3fb8cd,_0x2cf8ad;if(!this['_map']||!this['_measureLable'])return;const _0x593aec=getPositionValue(this['_measureLable'][_0x3c34da(_0x506c7d._0xeb1df4)],(_0x3fb8cd=this[_0x3c34da(_0x506c7d._0x2ed54d)])===null||_0x3fb8cd===void 0x0?void 0x0:_0x3fb8cd['clock']['currentTime']);_0x593aec&&_0x20f677!==null&&_0x20f677!==void 0x0&&_0x20f677[_0x3c34da(_0x506c7d._0x522ab7)]&&(this[_0x3c34da(_0x506c7d._0x3e4b13)]['position']=setPositionsHeight(_0x593aec,_0x20f677['maxHeight']));this['_measured']['area']=_0x20f677[_0x3c34da(_0x506c7d._0x1dfe3d)],this[_0x3c34da(_0x506c7d._0x71a7f4)]();const _0x5380bc={..._0x20f677,'mtype':this[_0x3c34da(_0x506c7d._0x583395)],'value':this['_measured'][_0x3c34da(0x705)],'label':this[_0x3c34da(_0x506c7d._0x1d4c46)]['areaStr']};this[_0x3c34da(0x264)](EventType['change'],_0x5380bc,!![]),this[_0x3c34da(0x264)](EventType['end'],_0x5380bc,!![]),(_0x2cf8ad=this[_0x3c34da(_0x506c7d._0x58fb19)])!==null&&_0x2cf8ad!==void 0x0&&_0x2cf8ad['resolve']&&this[_0x3c34da(0xf13)]['resolve'](this);});}}register$4('areaSurfaceMeasure',AreaSurfaceMeasure);class VolumeMeasure extends AreaMeasure{constructor(_0x4ce68b={}){const _0x5d2651={_0x2ea2b4:0x854,_0x2ebe22:0xc24},_0x3f5828=_0x35a251;super(_0x4ce68b),_0x4ce68b['_promise']&&(this['_promise']=_0x4ce68b['_promise'],delete _0x4ce68b[_0x3f5828(0xf13)]),this['labelHeightStyle']={...this['options'][_0x3f5828(_0x5d2651._0x2ea2b4)]||{},'font_size':0xf,'background':![]},Cesium__namespace['defined'](_0x4ce68b['labelHeight'])&&(this['labelHeightStyle']={...this['labelHeightStyle'],..._0x4ce68b[_0x3f5828(0x33d)]}),this['polygonWallStyle']={'color':'#00ff00','opacity':0.3,'closeTop':![],'closeBottom':!![],'perPositionHeight':![],'height':new Cesium__namespace[(_0x3f5828(0x18a))](_0xab56fb=>{return this['minHeight'];},![]),'extrudedHeight':new Cesium__namespace['CallbackProperty'](_0x17dd49=>{return this['maxHeight'];},![])},Cesium__namespace['defined'](_0x4ce68b['polygonWall'])&&(this['polygonWallStyle']={...this['polygonWallStyle'],..._0x4ce68b['polygonWall']}),this[_0x3f5828(0xa23)]=_0x4ce68b['heightLabel']??!![],this['offsetLabel']=_0x4ce68b[_0x3f5828(_0x5d2651._0x2ebe22)]??![],this['showArea']=_0x4ce68b['showArea']??!![],this[_0x3f5828(0xdbf)]=_0x4ce68b['showFillVolume']??!![],this['showDigVolume']=_0x4ce68b[_0x3f5828(0xc40)]??!![],this['_hasFX']=![];}get['hasEdit'](){return![];}get[_0x35a251(0xb44)](){const _0x2167e7={_0x1653b7:0xd86},_0x1e49d0=_0x35a251;return this[_0x1e49d0(_0x2167e7._0x1653b7)]?this['interPolygonObj'][_0x1e49d0(0x571)]:this['maxHeight'];}get['height'](){return this['_jzmHeight'];}set[_0x35a251(0x682)](_0x7a2284){const _0x29d40a=_0x35a251;this[_0x29d40a(0x9b7)]=_0x7a2284;_0x7a2284>this['maxHeight']&&(this['maxHeight']=_0x7a2284);_0x7a22840x0){const _0xd999d9=this['_arrPartMeasureLable'];if(_0xd999d9&&_0xd999d9['length']>0x0)for(let _0x4cd78e=0x0,_0x4699ee=_0xd999d9['length'];_0x4cd78e<_0x4699ee;_0x4cd78e++){this['_removeLabel'](_0xd999d9[_0x4cd78e]);}delete this['_arrPartMeasureLable'];}Cesium__namespace['defined'](this['_wallEntity'])&&(this['dataSource']['entities'][_0x39458c(0x1ee)](this['_wallEntity']),delete this['_wallEntity']);}[_0x35a251(0x375)](_0x492ae1){const _0x2670d2=_0x35a251;this[_0x2670d2(0xa0c)]['text']=this['_map'][_0x2670d2(0x44e)]('_正在计算体积')+'…';const _0x93aaca=this['positionsShow'];setTimeout(()=>{this['calcVolume'](_0x93aaca);},0x64);}[_0x35a251(0xcae)](_0x53c272){const _0x55bdeb=_0x35a251;this[_0x55bdeb(0x375)](_0x53c272);}[_0x35a251(0x1eb)](_0x6c87e3){const _0x239ec1={_0x4f26be:0xc81,_0x11632d:0xdbf,_0x4156e9:0x742,_0x17ecc7:0xabe,_0x35b7a4:0x44e,_0xe3390d:0x742,_0x4cbc97:0xe86,_0x1385f2:0x742,_0x39a1b1:0x44d,_0x2dd82a:0xe1f},_0x4e78f7=_0x35a251;_0x6c87e3&&(this['options'][_0x4e78f7(_0x239ec1._0x4f26be)]=_0x6c87e3);const _0x46a755={'unit':this['options']['unit'],'lang':this['_map']['lang'],'decimal':this['options'][_0x4e78f7(0x793)]};let _0x1b9270='';this[_0x4e78f7(_0x239ec1._0x11632d)]&&this['_measured'][_0x4e78f7(0x689)]>0x0&&(this[_0x4e78f7(_0x239ec1._0x4156e9)][_0x4e78f7(_0x239ec1._0x17ecc7)]=formatVolume(this['_measured']['fillVolume'],_0x46a755),_0x1b9270+=(this['options']['fillVolumeName']||this['_map'][_0x4e78f7(_0x239ec1._0x35b7a4)]('_填方体积'))+':'+this['_measured']['fillVolumeStr']+'\x0a'),this[_0x4e78f7(0xc40)]&&this['_measured']['digVolume']>0x0&&(this[_0x4e78f7(_0x239ec1._0xe3390d)]['digVolumeStr']=formatVolume(this['_measured']['digVolume'],_0x46a755),_0x1b9270+=(this[_0x4e78f7(_0x239ec1._0x4cbc97)][_0x4e78f7(0xd41)]||this['_map']['getLangText']('_挖方体积'))+':'+this['_measured']['digVolumeStr']+'\x0a'),this['showArea']&&this['_measured']['totalArea']>0x0&&(this[_0x4e78f7(_0x239ec1._0x1385f2)][_0x4e78f7(_0x239ec1._0x39a1b1)]=formatArea(this['_measured']['totalArea'],_0x46a755),_0x1b9270+=(this['options']['areaName']||this['_map']['getLangText']('_横切面积'))+':'+this['_measured'][_0x4e78f7(0x44d)]),this['_measureLable'][_0x4e78f7(_0x239ec1._0x2dd82a)]=_0x1b9270;}[_0x35a251(0xe16)](_0x383867){const _0x1abf90={_0x4e365b:0xd79,_0x24813f:0xc60},_0x156006={_0x15b1de:0xd79,_0x10653f:0xc60,_0x4543f5:0xfc2},_0x105b88=_0x35a251;if(!this[_0x105b88(_0x1abf90._0x4e365b)]||!_0x383867||_0x383867['length']<0x3)return;this['fire'](EventType['start'],{'mtype':this['type'],'sourceTarget':this,'positions':_0x383867},!![]),this[_0x105b88(0x549)]=!![],interPolygon({'positions':_0x383867,'scene':this['_map'][_0x105b88(_0x1abf90._0x24813f)],'exact':!![],...this['options']})['then'](_0x388b93=>{const _0x4fa566=_0x105b88;if(!this[_0x4fa566(0xd79)]||!this[_0x4fa566(0x549)])return;if(_0x388b93['has3dtiles'])this['_map']['scene']['globe']['depthTestAgainstTerrain']=![];else!this[_0x4fa566(_0x156006._0x15b1de)]['scene'][_0x4fa566(0x22f)]['depthTestAgainstTerrain']&&(this['_map'][_0x4fa566(_0x156006._0x10653f)][_0x4fa566(0x22f)][_0x4fa566(0x895)]=!![],this[_0x4fa566(_0x156006._0x4543f5)]=!![]);this[_0x4fa566(0xe46)](_0x383867,_0x388b93);});}['showVolume'](_0x5ae546,_0x1ed1a2){const _0x577cb8={_0x5c8366:0x571,_0x4d9dc9:0x7c0,_0x28d348:0x181,_0x1d3319:0x1eb},_0x455abc=_0x35a251;var _0x52fcf8;this['_jzmHeight']=this['options']['height']??_0x1ed1a2['minHeight'];this['_jzmHeight']<_0x1ed1a2['minHeight']&&(_0x1ed1a2['minHeight']=this['_jzmHeight']);this[_0x455abc(0xd86)]=updateVolumeByMinHeight(_0x1ed1a2),this[_0x455abc(0xe10)]=this['options']['minHeight']??this['interPolygonObj']['minHeight'],this['_maxHeight']=this['options'][_0x455abc(_0x577cb8._0x5c8366)]??this['interPolygonObj'][_0x455abc(0x571)];const _0x2ec88f=Math['floor'](0.3*Cesium__namespace[_0x455abc(_0x577cb8._0x4d9dc9)][_0x455abc(_0x577cb8._0x28d348)](_0x1ed1a2['granularity'],this['_map']['scene']['globe'][_0x455abc(0x3f4)][_0x455abc(0xecc)]));this['_maxHeight']-this[_0x455abc(0xe10)]<_0x2ec88f&&(this['_maxHeight']=this['_minHeight']+_0x2ec88f);const _0x4da980=updateVolume(this['interPolygonObj'],this['height']);for(const _0x4651f2 in _0x4da980){this[_0x455abc(0x742)][_0x4651f2]=_0x4da980[_0x4651f2];}this[_0x455abc(_0x577cb8._0x1d3319)](),this['_measureLable']['position']=centerOfMass(_0x5ae546,this['interPolygonObj']['maxHeight']);this['heightLabel']&&this['showPointHeightLabel'](_0x5ae546,this[_0x455abc(0xd86)]['minHeight']);this['_entity']['_noMousePick']=!![],this[_0x455abc(0x5a1)]['perPositionHeight']=![],this['entityGraphic']['hierarchy']=new Cesium__namespace['PolygonHierarchy'](_0x5ae546),this['entityGraphic']['height']=new Cesium__namespace['CallbackProperty'](_0x1009ea=>{return this['height'];},![]);const _0xf645cd=PolygonStyleConver['toCesiumVal'](this['polygonWallStyle'],{},!![]);_0xf645cd['hierarchy']=new Cesium__namespace['PolygonHierarchy'](_0x5ae546);Cesium__namespace['defined'](this['_wallEntity'])&&this[_0x455abc(0xad5)]['entities']['remove'](this['_wallEntity']);this['_wallEntity']=this['dataSource']['entities']['add']({'polygon':_0xf645cd,'show':this['show']}),this['_wallEntity']['_noMousePick']=!![],this['bindPickId'](this['_wallEntity']);const _0x1e2ee5={..._0x4da980,'sourceTarget':this,'mtype':this['type'],'graphic':this};this[_0x455abc(0x264)](EventType['change'],_0x1e2ee5,!![]),this['fire'](EventType['end'],_0x1e2ee5,!![]),(_0x52fcf8=this['_promise'])!==null&&_0x52fcf8!==void 0x0&&_0x52fcf8['resolve']&&this['_promise']['resolve'](this);}['showPointHeightLabel'](_0x1bb092,_0xe32225){const _0x2230db={_0xb308f8:0xc26,_0x28e38a:0x697},_0x2015a8={_0x333807:0xd79,_0x5dccb3:0x44e,_0x236eeb:0x44e,_0x3e81a6:0xe1f},_0xb878ef=_0x35a251,_0xd28fb1=this;if(Cesium__namespace['defined'](this['_arrPartMeasureLable'])&&this['_arrPartMeasureLable']['length']>0x0){const _0x575c60=this['_arrPartMeasureLable'];if(_0x575c60&&_0x575c60['length']>0x0)for(let _0x1f2f75=0x0,_0x3ebbdb=_0x575c60[_0xb878ef(0xe1e)];_0x1f2f75<_0x3ebbdb;_0x1f2f75++){this['_removeLabel'](_0x575c60[_0x1f2f75]);}delete this[_0xb878ef(0xa5f)];}const _0x313d3a=[];for(let _0x45baa9=0x0;_0x45baa9<_0x1bb092['length'];_0x45baa9++){const _0x294856=Math['max'](getHeight(this['_map'][_0xb878ef(0xc60)],_0x1bb092[_0x45baa9]),_0xe32225),_0x142c8d=Cesium__namespace['Cartographic']['fromCartesian'](_0x1bb092[_0x45baa9]),_0x3b96a7=Cesium__namespace['Cartesian3']['fromRadians'](_0x142c8d[_0xb878ef(_0x2230db._0xb308f8)],_0x142c8d[_0xb878ef(0x580)],_0x294856),_0x5a2d1a=this['_createLabel'](this['labelHeightStyle'],_0x3b96a7);_0x5a2d1a['attr']={'value':_0x294856},_0x313d3a[_0xb878ef(0x6de)](_0x5a2d1a),_0x5a2d1a[_0xb878ef(_0x2230db._0x28e38a)]=function(){const _0x4b31fb=_0xb878ef,_0x34079b=this['attr']['value'];let _0x435e80=_0xd28fb1[_0x4b31fb(0xd79)]['getLangText'](_0x4b31fb(0xe81))+':'+_0x34079b['toFixed'](0x2)+_0xd28fb1['_map']['getLangText']('_米');if(_0xd28fb1[_0x4b31fb(0xc24)]){const _0x4adb9a=_0x34079b-_0xd28fb1['height'];_0x4adb9a>0x0?_0x435e80+='\x0a'+_0xd28fb1['_map']['getLangText']('_高度')+':'+_0x4adb9a[_0x4b31fb(0xf0a)](0x2)+_0xd28fb1[_0x4b31fb(_0x2015a8._0x333807)][_0x4b31fb(_0x2015a8._0x5dccb3)]('_米')+'('+_0xd28fb1['_map']['getLangText']('_面上')+')':_0x435e80+='\x0a'+_0xd28fb1['_map']['getLangText']('_高度')+':'+Math['abs'](_0x4adb9a)['toFixed'](0x2)+_0xd28fb1['_map']['getLangText']('_米')+'('+_0xd28fb1['_map'][_0x4b31fb(_0x2015a8._0x236eeb)]('_面下')+')';}return this[_0x4b31fb(_0x2015a8._0x3e81a6)]=_0x435e80,_0x435e80;},_0x5a2d1a['showText']();}this[_0xb878ef(0xa5f)]=_0x313d3a;}}register$4('volumeMeasure',VolumeMeasure);class VolumeDepthMeasure extends AreaMeasure{constructor(_0x1ebe15={}){const _0x3604a4={_0x46ef54:0xa04,_0x106abf:0xf29,_0x260c92:0xe5a,_0x393c4f:0xe86,_0x2f7f1f:0xe7f,_0x9f5fb2:0x18a,_0x1f8ff9:0x8cf},_0xdf928d={_0xe4110c:0x571},_0x56648a=_0x35a251;super(_0x1ebe15),_0x1ebe15['_promise']&&(this['_promise']=_0x1ebe15[_0x56648a(0xf13)],delete _0x1ebe15['_promise']),this['labelHeightStyle']={...this['options']['label']||{},'font_size':0xf,'background':![]},Cesium__namespace[_0x56648a(0xaa2)](_0x1ebe15['labelHeight'])&&(this[_0x56648a(_0x3604a4._0x46ef54)]={...this['labelHeightStyle'],..._0x1ebe15['labelHeight']}),this['_cutColor']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x56648a(0x6f9)](getCesiumColor(_0x1ebe15['cutColor'],Cesium__namespace[_0x56648a(_0x3604a4._0x106abf)]['RED']['withAlpha'](0.5))),this[_0x56648a(_0x3604a4._0x260c92)]=Cesium__namespace[_0x56648a(0x71a)][_0x56648a(0x6f9)](getCesiumColor(_0x1ebe15['fillColor'],Cesium__namespace[_0x56648a(0xf29)]['YELLOW'][_0x56648a(0x373)](0.5))),this['options']['offsetHeight']=this[_0x56648a(_0x3604a4._0x393c4f)]['offsetHeight']??0x0,this['polygonWallStyle']={'color':_0x56648a(_0x3604a4._0x2f7f1f),'opacity':0.3,'closeTop':![],'closeBottom':!![],'perPositionHeight':![],'height':new Cesium__namespace['CallbackProperty'](_0x1aa4cd=>{const _0x59d782=_0x56648a;return this[_0x59d782(0x543)];},![]),'extrudedHeight':new Cesium__namespace[(_0x56648a(_0x3604a4._0x9f5fb2))](_0x551128=>{const _0x5a6f2f=_0x56648a;return this[_0x5a6f2f(_0xdf928d._0xe4110c)];},![])},Cesium__namespace[_0x56648a(0xaa2)](_0x1ebe15[_0x56648a(_0x3604a4._0x1f8ff9)])&&(this[_0x56648a(0x122)]={...this['polygonWallStyle'],..._0x1ebe15['polygonWall']}),this['heightLabel']=_0x1ebe15['heightLabel']??!![],this['offsetLabel']=_0x1ebe15['offsetLabel']??![],this['showArea']=_0x1ebe15['showArea']??!![],this['showFillVolume']=_0x1ebe15['showFillVolume']??!![],this['showDigVolume']=_0x1ebe15['showDigVolume']??!![],this[_0x56648a(0xce1)]=_0x1ebe15['showBox']??!![],this['_showPoly']=_0x1ebe15['showPoly']??!![],this[_0x56648a(0x6bd)]=_0x1ebe15['showWall']??![],this['_hasFX']=![];}get['hasEdit'](){return![];}get['polygonMaxHeight'](){const _0xf001dd=_0x35a251;return this[_0xf001dd(0x742)]?this['_measured']['maxHeight']:this['maxHeight'];}get[_0x35a251(0x682)](){return this['_jzmHeight'];}set['height'](_0x161bb4){const _0x1f1a9e={_0x283e93:0x571,_0x31aca6:0x543,_0x1477ce:0x9f2},_0x49ebbe=_0x35a251;this['_jzmHeight']=_0x161bb4;_0x161bb4>this['maxHeight']&&(this[_0x49ebbe(_0x1f1a9e._0x283e93)]=_0x161bb4);_0x161bb40x0){const _0x3c6582=this[_0x2fcd49(0xa5f)];if(_0x3c6582&&_0x3c6582['length']>0x0)for(let _0x12d437=0x0,_0x20d818=_0x3c6582[_0x2fcd49(_0x256d16._0x43c1af)];_0x12d437<_0x20d818;_0x12d437++){this[_0x2fcd49(0x32c)](_0x3c6582[_0x12d437]);}delete this['_arrPartMeasureLable'];}Cesium__namespace[_0x2fcd49(0xaa2)](this['_wallEntity'])&&(this['dataSource'][_0x2fcd49(_0x256d16._0x1910f1)]['remove'](this['_wallEntity']),delete this['_wallEntity']);}['_drawCreatedHandler'](_0x1fa756){const _0x52146c={_0x39b8d0:0xe1f},_0x5a4140={_0x2c1a1c:0xe16},_0x33dfed=_0x35a251;this['_measureLable'][_0x33dfed(_0x52146c._0x39b8d0)]=this['_map']['getLangText'](_0x33dfed(0xdfa))+'…';const _0x506148=this['positionsShow'];(_0x506148===null||_0x506148===void 0x0?void 0x0:_0x506148['length'])>0x3&&setTimeout(()=>{const _0x25f652=_0x33dfed;this[_0x25f652(_0x5a4140._0x2c1a1c)](_0x506148);},0x64);}['_editPointHandler'](_0x20fb3c){const _0xd7fee0={_0x555876:0x375},_0x5b95d8=_0x35a251;this[_0x5b95d8(_0xd7fee0._0x555876)](_0x20fb3c);}['updateText'](_0x59a830){const _0x228586={_0x1d669d:0xc81,_0x11e5a0:0x742,_0x3abb94:0x742,_0x2bc64b:0xad3,_0x3a458d:0xa0c},_0x53b781=_0x35a251;_0x59a830&&(this['options']['unit']=_0x59a830);const _0x147f06={'unit':this['options'][_0x53b781(_0x228586._0x1d669d)],'lang':this[_0x53b781(0xd79)]['lang'],'decimal':this['options']['decimal']};let _0x9c38d0='';this[_0x53b781(0xdbf)]&&this[_0x53b781(0x742)]['fillVolume']>0x0&&(this['_measured']['fillVolumeStr']=formatVolume(this[_0x53b781(_0x228586._0x11e5a0)][_0x53b781(0x689)],_0x147f06),_0x9c38d0+=(this[_0x53b781(0xe86)]['fillVolumeName']||this['_map']['getLangText']('_填方体积'))+':'+this['_measured'][_0x53b781(0xabe)]+'\x0a'),this['showDigVolume']&&this['_measured'][_0x53b781(0x38f)]>0x0&&(this['_measured']['digVolumeStr']=formatVolume(this['_measured']['digVolume'],_0x147f06),_0x9c38d0+=(this['options']['digVolumeName']||this[_0x53b781(0xd79)]['getLangText']('_挖方体积'))+':'+this[_0x53b781(_0x228586._0x3abb94)][_0x53b781(0xb58)]+'\x0a'),this['showArea']&&this[_0x53b781(0x742)][_0x53b781(_0x228586._0x2bc64b)]>0x0&&(this[_0x53b781(0x742)]['totalAreaStr']=formatArea(this['_measured']['totalArea'],_0x147f06),_0x9c38d0+=(this['options']['areaName']||this['_map']['getLangText']('_横切面积'))+':'+this['_measured']['totalAreaStr']),this[_0x53b781(_0x228586._0x3a458d)]['text']=_0x9c38d0;}['calcVolume'](_0x4f43a6){const _0x4c823a={_0x5685d6:0x264,_0x2e0e2c:0x8bb,_0x4a2543:0xc60},_0x3af18c={_0x5bf5f3:0x543,_0x182822:0x9b7,_0x167553:0x742,_0x201174:0xe86,_0x1e0d98:0x571,_0x43a089:0x5a1,_0x58c056:0x5a1,_0x21121d:0x6bd,_0x1791d3:0x71e},_0x152043=_0x35a251;if(!this['_map'])return;this[_0x152043(_0x4c823a._0x5685d6)](EventType['start'],{'mtype':this['type'],'sourceTarget':this,'positions':_0x4f43a6},!![]),this['_hasFX']=!![],this[_0x152043(0xa0c)]['show']=![],this[_0x152043(0x249)]['show']=![];if(this[_0x152043(_0x4c823a._0x2e0e2c)])for(let _0x29db26=0x0,_0xdda259=this['_entity_outlines']['length'];_0x29db26<_0xdda259;_0x29db26++){const _0x45c7c4=this['_entity_outlines'][_0x29db26]['polyline'];_0x45c7c4['show']=![];}interPolygonByDepth({'scene':this['_map'][_0x152043(_0x4c823a._0x4a2543)],'positions':_0x4f43a6,'splitNum':this['options']['splitNum'],'cameraHeight':this['options']['cameraHeight']})['then'](_0x4b0f90=>{const _0x107ca9=_0x152043;var _0x5955cc;if(this['isDestroy'])return;this['_measured']=_0x4b0f90,this[_0x107ca9(0x9b7)]=this['options']['height']??_0x4b0f90['minHeight'];this['_jzmHeight']<_0x4b0f90[_0x107ca9(_0x3af18c._0x5bf5f3)]&&(_0x4b0f90['minHeight']=this[_0x107ca9(_0x3af18c._0x182822)]);this[_0x107ca9(_0x3af18c._0x167553)]=this['updateVolume'](_0x4b0f90),this['_minHeight']=this[_0x107ca9(0xe86)][_0x107ca9(_0x3af18c._0x5bf5f3)]??this['_measured']['minHeight'],this['_maxHeight']=this[_0x107ca9(_0x3af18c._0x201174)][_0x107ca9(_0x3af18c._0x1e0d98)]??this['_measured']['maxHeight'],this['updateText'](),this['_measureLable']['position']=centerOfMass(_0x4f43a6,this['_maxHeight']),this['_measureLable']['show']=!![];this['heightLabel']&&this['showPointHeightLabel'](_0x4f43a6,this['_minHeight']);if(this['_showPoly']){this[_0x107ca9(0x249)]['show']=!![];if(this[_0x107ca9(0x8bb)])for(let _0x3ec42f=0x0,_0x5727c4=this['_entity_outlines']['length'];_0x3ec42f<_0x5727c4;_0x3ec42f++){const _0x2e613c=this['_entity_outlines'][_0x3ec42f]['polyline'];_0x2e613c['show']=!![];}this['_entity']['_noMousePick']=!![],this[_0x107ca9(_0x3af18c._0x43a089)]['perPositionHeight']=![],this[_0x107ca9(_0x3af18c._0x58c056)]['hierarchy']=new Cesium__namespace['PolygonHierarchy'](_0x4f43a6),this['entityGraphic'][_0x107ca9(0x682)]=new Cesium__namespace[(_0x107ca9(0x18a))](_0x246b6a=>{return this['height'];},![]);}if(this[_0x107ca9(_0x3af18c._0x21121d)]){const _0x562f07=PolygonStyleConver['toCesiumVal'](this['polygonWallStyle'],{},!![]);_0x562f07[_0x107ca9(0x5c7)]=new Cesium__namespace['PolygonHierarchy'](_0x4f43a6),this[_0x107ca9(_0x3af18c._0x1791d3)]=this['dataSource']['entities']['add']({'polygon':_0x562f07}),this['_wallEntity']['_noMousePick']=!![],this['bindPickId'](this['_wallEntity']);}const _0x2ff441={...this['_measured'],'sourceTarget':this,'mtype':this['type'],'graphic':this};this['fire'](EventType['change'],_0x2ff441,!![]),this['fire'](EventType[_0x107ca9(0xa2d)],_0x2ff441,!![]),(_0x5955cc=this[_0x107ca9(0xf13)])!==null&&_0x5955cc!==void 0x0&&_0x5955cc['resolve']&&this['_promise']['resolve'](this);});}['updateVolume'](_0xf43897){const _0x46ac6e={_0x55d6b1:0xb35,_0x180611:0xb79,_0x22839c:0xe5a,_0x6b143:0x6a6,_0x543267:0xa3e,_0x31cc15:0x534},_0x38b902=_0x35a251;!_0xf43897&&(_0xf43897=this['_measured']);const _0x5be167=_0xf43897[_0x38b902(0x543)],_0x47943f=this[_0x38b902(0x682)],_0x503596=_0xf43897['box']['area'],_0x544da5=[],_0x186546=this['options']['offsetHeight'];let _0x1598c7=0x0,_0x3c80f4=0x0;for(let _0x48dc7c=0x0,_0x590511=_0xf43897['count'];_0x48dc7c<_0x590511;_0x48dc7c++){const _0x341873=_0xf43897[_0x38b902(_0x46ac6e._0x55d6b1)][_0x48dc7c];let _0x10a4dc=_0x341873['height'];_0x10a4dc<_0x5be167&&(_0x10a4dc=_0x5be167);if(_0x10a4dc>_0x47943f){_0x1598c7+=_0x503596*(_0x10a4dc-_0x47943f);if(this['showBox']){const _0x1c2cdf=_0x341873[_0x38b902(0x4f5)]();_0x544da5['push'](new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace[(_0x38b902(0x43c))]({'polygonHierarchy':new Cesium__namespace[(_0x38b902(0xb39))](_0x1c2cdf),'extrudedHeight':_0x10a4dc+_0x186546,'height':_0x47943f+_0x186546}),'attributes':{'color':this['_cutColor']}}));}}else{if(_0x10a4dc<_0x47943f){_0x3c80f4+=_0x503596*(_0x47943f-_0x10a4dc);if(this[_0x38b902(_0x46ac6e._0x180611)]){const _0x382946=_0x341873['getOutline']();_0x544da5['push'](new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace[(_0x38b902(0x43c))]({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x382946),'extrudedHeight':_0x47943f+_0x186546,'height':_0x10a4dc+_0x186546}),'attributes':{'color':this[_0x38b902(_0x46ac6e._0x22839c)]}}));}}}}return _0xf43897['digVolume']=_0x1598c7,_0xf43897['fillVolume']=_0x3c80f4,this[_0x38b902(0x6a6)]&&(this['_layer']['primitiveCollection']['remove'](this[_0x38b902(_0x46ac6e._0x6b143)]),delete this[_0x38b902(0x6a6)]),this['showBox']&&_0x544da5['length']>0x0&&(this[_0x38b902(_0x46ac6e._0x6b143)]=new Cesium__namespace['Primitive']({'geometryInstances':_0x544da5,'appearance':new Cesium__namespace['PerInstanceColorAppearance']({'flat':!![],'renderState':{'lineWidth':0x1}}),'asynchronous':!![]}),this['_layer']['primitiveCollection']['add'](this['_primitive_boxs']),this['_primitive_boxs'][_0x38b902(_0x46ac6e._0x543267)]=!![],this[_0x38b902(_0x46ac6e._0x31cc15)](this['_primitive_boxs'])),_0xf43897;}[_0x35a251(0xd18)](_0x172416,_0x2375c5){const _0x4b054e={_0x17343e:0x580,_0x47d06d:0x6b3,_0x40d3da:0x6de},_0x3359c9={_0x555c58:0x682,_0x455fda:0xd79,_0x5ae733:0x939,_0x56018e:0xd4e},_0x22467a=_0x35a251,_0x4565a6=this,_0x381684=[];for(let _0x3f9153=0x0;_0x3f9153<_0x172416[_0x22467a(0xe1e)];_0x3f9153++){const _0x4d87d6=Math['max'](getHeight(this['_map']['scene'],_0x172416[_0x3f9153]),_0x2375c5),_0x48fded=Cesium__namespace['Cartographic']['fromCartesian'](_0x172416[_0x3f9153]),_0x2e10c1=Cesium__namespace['Cartesian3'][_0x22467a(0x175)](_0x48fded['longitude'],_0x48fded[_0x22467a(_0x4b054e._0x17343e)],_0x4d87d6),_0x1675a3=this['_createLabel'](this[_0x22467a(0xa04)],_0x2e10c1);_0x1675a3[_0x22467a(_0x4b054e._0x47d06d)]={'value':_0x4d87d6},_0x381684[_0x22467a(_0x4b054e._0x40d3da)](_0x1675a3),_0x1675a3['showText']=function(){const _0x27a27f=_0x22467a,_0xcc417c=this[_0x27a27f(0x6b3)]['value'];let _0x2f65b3=_0x4565a6['_map']['getLangText']('_海拔')+':'+_0xcc417c[_0x27a27f(0xf0a)](0x2)+_0x4565a6['_map']['getLangText']('_米');if(_0x4565a6['offsetLabel']){const _0x538bad=_0xcc417c-_0x4565a6[_0x27a27f(_0x3359c9._0x555c58)];_0x538bad>0x0?_0x2f65b3+='\x0a'+_0x4565a6[_0x27a27f(_0x3359c9._0x455fda)]['getLangText']('_高度')+':'+_0x538bad['toFixed'](0x2)+_0x4565a6['_map']['getLangText']('_米')+'('+_0x4565a6['_map'][_0x27a27f(0x44e)]('_面上')+')':_0x2f65b3+='\x0a'+_0x4565a6['_map']['getLangText'](_0x27a27f(_0x3359c9._0x5ae733))+':'+Math['abs'](_0x538bad)['toFixed'](0x2)+_0x4565a6['_map']['getLangText']('_米')+'('+_0x4565a6['_map']['getLangText'](_0x27a27f(_0x3359c9._0x56018e))+')';}return this[_0x27a27f(0xe1f)]=_0x2f65b3,_0x2f65b3;},_0x1675a3[_0x22467a(0x697)]();}this['_arrPartMeasureLable']=_0x381684;}}register$4('volumeDepthMeasure',VolumeDepthMeasure);class BillboardPrimitive extends BasePointPrimitive{get['primitiveCollection'](){const _0x424c35={_0x2d81dc:0x2d0},_0x59b1b0=_0x35a251;var _0x3d2662;return(_0x3d2662=this[_0x59b1b0(_0x424c35._0x2d81dc)])===null||_0x3d2662===void 0x0?void 0x0:_0x3d2662['billboardCollection'];}get[_0x35a251(0xdb2)](){return this['style']['image'];}set['image'](_0x2e22f8){this['style']['image']=_0x2e22f8,this['_primitive']&&(this['_primitive']['image']=_0x2e22f8);}[_0x35a251(0xa40)](_0x5c5a79){const _0x389408={_0x36fa02:0x90a},_0x314b51=_0x35a251;if(this[_0x314b51(_0x389408._0x36fa02)])this[_0x314b51(0x90a)]['show']=_0x5c5a79;else _0x5c5a79&&super['_showHook'](_0x5c5a79);}[_0x35a251(0x97b)](_0x4f2c2b){const _0x11ec72={_0x1ff0cc:0xb61,_0x4f06d1:0xc04,_0x36dd8d:0x4af},_0x542a9e=_0x35a251;if(!this['show'])return;this['_forPositionProperty'](this['options'][_0x542a9e(_0x11ec72._0x1ff0cc)]);const _0x3485cb=BillboardStyleConver[_0x542a9e(_0x11ec72._0x4f06d1)](_0x4f2c2b,{'show':this['show'],'position':this['position']});this['_primitive']=this['primitiveCollection'][_0x542a9e(_0x11ec72._0x36dd8d)](_0x3485cb),this['style']['label']&&this['_addLabel']();}['_updateStyleHook'](_0x677ddd,_0x4f2ae1){BillboardStyleConver['toCesiumVal'](_0x677ddd,this['primitive']);}[_0x35a251(0x1e0)](_0x138dc7,_0x1fc23d){const _0x4c43d8={_0x215ac4:0x99e},_0x3da0a9=_0x35a251;return BillboardStyleConver[_0x3da0a9(_0x4c43d8._0x215ac4)](_0x138dc7,_0x1fc23d);}['_updatePositionsHook'](){const _0x51e1dc=_0x35a251;if(!this[_0x51e1dc(0x90a)]['_billboardCollection'])return;this[_0x51e1dc(0x90a)]['position']=this[_0x51e1dc(0xb61)],Cesium__namespace[_0x51e1dc(0xaa2)](this['style']['alignedAxis'])&&(this['_primitive']['alignedAxis']=getCesiumValue(this['style']['alignedAxis'],Cesium__namespace['Cartesian3']));}[_0x35a251(0x45c)](_0x6b07ea){const _0x19acf5={_0x4980c7:0x373},_0x20fdf2=_0x35a251;this['style']['globalAlpha']=_0x6b07ea,this['_primitive']&&(this['_primitive']['color']=Cesium__namespace[_0x20fdf2(0xf29)]['WHITE'][_0x20fdf2(_0x19acf5._0x4980c7)](_0x6b07ea)),this['_updateLabelOpacity'](_0x6b07ea);}['_getDrawEntityClass'](_0x1f7c8d,_0x44fdd4){return create$4('billboard',_0x1f7c8d);}}register$4('billboardP',BillboardPrimitive,!![]);class CloudPrimitive extends BasePointPrimitive{get[_0x35a251(0x293)](){var _0x35a418;return(_0x35a418=this['_layer'])===null||_0x35a418===void 0x0?void 0x0:_0x35a418['cloudCollection'];}get['maximumSize'](){const _0x5f2ee2=_0x35a251;return this['style'][_0x5f2ee2(0x132)];}set[_0x35a251(0x132)](_0x2ad643){const _0x3fc002={_0x4c1f85:0x132},_0x194cd9=_0x35a251;this[_0x194cd9(0xfc8)][_0x194cd9(0x132)]=_0x2ad643,this['_primitive']&&(this[_0x194cd9(0x90a)][_0x194cd9(_0x3fc002._0x4c1f85)]=_0x2ad643);}get['scale'](){const _0x266250={_0x5896a5:0xfc8},_0x4f716c=_0x35a251;return this[_0x4f716c(_0x266250._0x5896a5)]['scale'];}set[_0x35a251(0x1cb)](_0x1d78e3){const _0x3459a8=_0x35a251;this['style']['scale']=_0x1d78e3,this[_0x3459a8(0x90a)]&&(this['_primitive']['scale']=_0x1d78e3);}get['slice'](){const _0x5580a3={_0x4fe554:0xfc8,_0xdb73e3:0x97a},_0x30e4d4=_0x35a251;return this[_0x30e4d4(_0x5580a3._0x4fe554)][_0x30e4d4(_0x5580a3._0xdb73e3)];}set[_0x35a251(0x97a)](_0x5deaf2){this['style']['slice']=_0x5deaf2,this['_primitive']&&(this['_primitive']['slice']=_0x5deaf2);}get['brightness'](){const _0x2939e0={_0x36e7de:0xbc0},_0x4cd741=_0x35a251;return this['style'][_0x4cd741(_0x2939e0._0x36e7de)];}set['brightness'](_0x50a8a2){const _0xa4e4e2={_0x373ff0:0xbc0,_0x59986b:0x90a,_0x560dd7:0xbc0},_0x30895f=_0x35a251;this[_0x30895f(0xfc8)][_0x30895f(_0xa4e4e2._0x373ff0)]=_0x50a8a2,this[_0x30895f(_0xa4e4e2._0x59986b)]&&(this[_0x30895f(_0xa4e4e2._0x59986b)][_0x30895f(_0xa4e4e2._0x560dd7)]=_0x50a8a2);}get['hasOpacity'](){return![];}['_addedHook'](_0x462805){const _0x55fa87={_0x4afcea:0xe86,_0x409027:0x90a,_0x3878c0:0x293},_0x3dac9c=_0x35a251;if(!this['show'])return;this['_forPositionProperty'](this[_0x3dac9c(_0x55fa87._0x4afcea)]['position']);const _0xe6c8f7=CloudStyleConver['toCesiumVal'](_0x462805,{'show':this['show'],'position':this['position']});this[_0x3dac9c(_0x55fa87._0x409027)]=this[_0x3dac9c(_0x55fa87._0x3878c0)]['add'](_0xe6c8f7),this['style']['label']&&this[_0x3dac9c(0x86a)]();}['_showHook'](_0x47d589){this['_primitive']?this['_primitive']['show']=_0x47d589:super['_showHook'](_0x47d589);}['_updateStyleHook'](_0x81a807,_0xab10ef){const _0x1e7a1c=_0x35a251;CloudStyleConver[_0x1e7a1c(0xc04)](_0x81a807,this['primitive']);}['_style2Json'](_0x1eaf9f,_0x372c0a){return CloudStyleConver['toJSON'](_0x1eaf9f,_0x372c0a);}['_updatePositionsHook'](){const _0x504038={_0x5ce416:0xb61},_0x451d81=_0x35a251;this['_primitive'][_0x451d81(_0x504038._0x5ce416)]=this['position'];}['_getDrawEntityClass'](_0x1b2e57,_0x42cc08){return this['_getDrawPointEntityClass'](_0x1b2e57,_0x42cc08);}}register$4('cloud',CloudPrimitive,!![]);class LabelPrimitive extends BasePointPrimitive{get['primitiveCollection'](){const _0x15be9b={_0x5062fd:0x2d0,_0x47857a:0x9b2},_0xa6a480=_0x35a251;var _0x1d0418;return(_0x1d0418=this[_0xa6a480(_0x15be9b._0x5062fd)])===null||_0x1d0418===void 0x0?void 0x0:_0x1d0418[_0xa6a480(_0x15be9b._0x47857a)];}get[_0x35a251(0xe1f)](){const _0x2ba020={_0x595b26:0xfc8,_0x4bc352:0xe1f},_0x4b31ee=_0x35a251;return this[_0x4b31ee(_0x2ba020._0x595b26)][_0x4b31ee(_0x2ba020._0x4bc352)];}set[_0x35a251(0xe1f)](_0x36f22d){const _0x2f1d24=_0x35a251;this[_0x2f1d24(0xfc8)]['text']=_0x36f22d,this[_0x2f1d24(0x90a)]&&(this['_primitive']['text']=_0x36f22d);}[_0x35a251(0xa40)](_0x208bb0){const _0x5433b3=_0x35a251;if(this[_0x5433b3(0x90a)])this['_primitive']['show']=_0x208bb0;else _0x208bb0&&super['_showHook'](_0x208bb0);}['_addedHook'](_0xa0be00){const _0x182a9a={_0x2ed5fe:0x987},_0x5d0eb0=_0x35a251;if(!this[_0x5d0eb0(_0x182a9a._0x2ed5fe)])return;const _0x1840ba=LabelStyleConver['toCesiumVal'](this['style'],{'show':this[_0x5d0eb0(_0x182a9a._0x2ed5fe)],'position':this['position']},{},this['attr']);this['_primitive']=this[_0x5d0eb0(0x293)]['add'](_0x1840ba);}['_updateStyleHook'](_0x2a269b,_0x7b571e){const _0x315fb3={_0x29d1d1:0x6b3},_0x54b0a5=_0x35a251;LabelStyleConver[_0x54b0a5(0xc04)](_0x2a269b,this['primitive'],this[_0x54b0a5(_0x315fb3._0x29d1d1)]);}[_0x35a251(0x1e0)](_0x62b153,_0x43593d){const _0x2fd0a6=_0x35a251;return LabelStyleConver[_0x2fd0a6(0x99e)](_0x62b153,_0x43593d);}['_updatePositionsHook'](){const _0x115e74=_0x35a251;this[_0x115e74(0x90a)][_0x115e74(0xb61)]=this['position'];}['_getDrawEntityClass'](_0x3c5483,_0x3c9d1a){return create$4('label',_0x3c5483);}['setOpacity'](_0x55bd2d){const _0x503e2c={_0x1c11b2:0x987},_0x2ea67c=_0x35a251;this[_0x2ea67c(0xfc8)]['globalAlpha']=_0x55bd2d,this['_primitive']&&this[_0x2ea67c(_0x503e2c._0x1c11b2)]&&LabelStyleConver['setOpacity'](this['_primitive'],_0x55bd2d);}}register$4('labelP',LabelPrimitive,!![]);class ModelPrimitive extends BasePointPrimitive{constructor(_0x567921={}){const _0x1d4b43={_0x12f2d4:0x4ac},_0x3b6488=_0x35a251;super(_0x567921),this[_0x3b6488(_0x1d4b43._0x12f2d4)]=Cesium__namespace['defer']();}get[_0x35a251(0x402)](){const _0x488137={_0x3296a1:0xbf3},_0x381a6a=_0x35a251,_0x2bb317=[];return this[_0x381a6a(_0x488137._0x3296a1)]&&_0x2bb317['push'](this['_primitive_label']),this['_primitive_point']&&_0x2bb317[_0x381a6a(0x6de)](this['_primitive_point']),this['_primitive_billboard']&&_0x2bb317['push'](this['_primitive_billboard']),_0x2bb317;}get['scale'](){return this['style']['scale']??0x1;}set['scale'](_0x3bd084){const _0x5d8606={_0x8fa2cb:0x1cb},_0x4ac283=_0x35a251;this['style'][_0x4ac283(_0x5d8606._0x8fa2cb)]=_0x3bd084,this['_updateStyleHook'](this[_0x4ac283(0xfc8)],{'scale':_0x3bd084});}get['scaleX'](){const _0x4a051a={_0x4aecb0:0xfc8},_0x58ec55=_0x35a251;return this[_0x58ec55(_0x4a051a._0x4aecb0)]['scaleX']??0x1;}set[_0x35a251(0x3da)](_0x2af667){this['style']['scaleX']=_0x2af667,this['updateModelMatrix']();}get['scaleY'](){const _0x5948a5={_0x392593:0xfc8},_0x7d58bb=_0x35a251;return this[_0x7d58bb(_0x5948a5._0x392593)]['scaleY']??0x1;}set['scaleY'](_0x19d4fb){const _0x574d47=_0x35a251;this[_0x574d47(0xfc8)]['scaleY']=_0x19d4fb,this['updateModelMatrix']();}get['scaleZ'](){return this['style']['scaleZ']??0x1;}set[_0x35a251(0xaeb)](_0x3dc9a6){this['style']['scaleZ']=_0x3dc9a6,this['updateModelMatrix']();}get['readyPromise'](){return this['_readyPromise']['promise'];}['_showHook'](_0x18a696){const _0x57dbe7=_0x35a251;if(this['_primitive'])this['_primitive']['show']=_0x18a696;else _0x18a696&&super[_0x57dbe7(0xa40)](_0x18a696);}[_0x35a251(0x97b)](_0x304135){const _0x4b5605={_0x54490f:0xd79,_0x1d3a5f:0xfc8,_0x2d41e7:0xeba,_0x21fa82:0x4ff,_0x2111af:0xcc3},_0x3cff80={_0xde210d:0x90a},_0x310ded={_0x6ea88d:0x761,_0x154cc5:0x4ac},_0x11e164=_0x35a251;if(!this['show']||!this[_0x11e164(_0x4b5605._0x54490f)])return;this[_0x11e164(0xff)](this['options']['position']);const _0x5dbaad=ModelStyleConver[_0x11e164(0xc04)](this['style']);if(!_0x5dbaad['url'])return;Cesium__namespace['Model']['fromGltfAsync']({'modelMatrix':this['modelMatrix'],'scene':this['_map']['scene'],'marsOptions':{'occlusion':this[_0x11e164(_0x4b5605._0x1d3a5f)]['marsOcclusion']},..._0x5dbaad})['then'](_0x730b14=>{const _0xc7b0ca=_0x11e164;this['bindPickId'](_0x730b14),this['_primitive']=this['primitiveCollection']['add'](_0x730b14),this[_0xc7b0ca(_0x3cff80._0xde210d)]['readyEvent']['addEventListener'](()=>{const _0x16595a=_0xc7b0ca;var _0x5ea871;(this['style'][_0x16595a(_0x310ded._0x6ea88d)]??!![])&&(_0x5ea871=_0x730b14[_0x16595a(0xb12)])!==null&&_0x5ea871!==void 0x0&&_0x5ea871['addAll']&&_0x730b14[_0x16595a(0xb12)]['addAll']({'loop':Cesium__namespace['ModelAnimationLoop']['REPEAT'],...this['style']}),this['fire'](EventType['load'],{'drawtype':this['type'],'model':_0x730b14,'graphic':this},!![]),this[_0x16595a(_0x310ded._0x154cc5)]['resolve'](this);});});this['style']['label']&&this['_addLabel']();if(this['style']['distanceDisplayCondition']){if(this['style'][_0x11e164(_0x4b5605._0x2d41e7)]){var _0x51c088;const _0x2e8fff=PointStyleConver['toCesiumVal'](this['style'][_0x11e164(0xeba)],{'show':this['show'],'position':this['position']});_0x2e8fff['distanceDisplayCondition']=this[_0x11e164(_0x4b5605._0x21fa82)](this[_0x11e164(_0x4b5605._0x1d3a5f)]['distanceDisplayPoint']),this['_primitive_point']=(_0x51c088=this[_0x11e164(0x2d0)])===null||_0x51c088===void 0x0?void 0x0:_0x51c088['pointCollection']['add'](_0x2e8fff);}else{if(this[_0x11e164(0xfc8)]['distanceDisplayBillboard']){var _0x18a33d;const _0x19a933=BillboardStyleConver['toCesiumVal'](this['style'][_0x11e164(_0x4b5605._0x2111af)],{'show':this[_0x11e164(0x987)],'position':this[_0x11e164(0xb61)]});_0x19a933['distanceDisplayCondition']=this['_getTargetDistanceDisplayCondition'](this['style'][_0x11e164(0xcc3)]),this['_primitive_billboard']=(_0x18a33d=this['_layer'])===null||_0x18a33d===void 0x0?void 0x0:_0x18a33d['billboardCollection']['add'](_0x19a933);}}}}['_removedHook'](){const _0x284527=_0x35a251;super['_removedHook']();if(this['_primitive_point']){var _0x329a9c;(_0x329a9c=this['_layer'])===null||_0x329a9c===void 0x0?void 0x0:_0x329a9c['pointCollection']['remove'](this['_primitive_point']),delete this['_primitive_point'];}if(this[_0x284527(0x578)]){var _0x2a6672;(_0x2a6672=this[_0x284527(0x2d0)])===null||_0x2a6672===void 0x0?void 0x0:_0x2a6672[_0x284527(0xbb5)]['remove'](this[_0x284527(0x578)]),delete this['_primitive_billboard'];}}[_0x35a251(0x6a1)](_0x414c77,_0x1fa906){const _0x223cf5={_0x520484:0xaf9,_0x50e13d:0xc04,_0x84bd1b:0xaa2},_0x5d6213=_0x35a251;if(_0x1fa906[_0x5d6213(0xd05)]){this[_0x5d6213(_0x223cf5._0x520484)](_0x414c77);return;}ModelStyleConver[_0x5d6213(_0x223cf5._0x50e13d)](_0x414c77,this['primitive']),(Cesium__namespace[_0x5d6213(_0x223cf5._0x84bd1b)](_0x1fa906['heading'])||Cesium__namespace['defined'](_0x1fa906['pitch'])||Cesium__namespace['defined'](_0x1fa906['roll'])||Cesium__namespace['defined'](_0x1fa906[_0x5d6213(0x1cb)])||Cesium__namespace[_0x5d6213(0xaa2)](_0x1fa906['scaleX'])||Cesium__namespace['defined'](_0x1fa906['scaleY'])||Cesium__namespace['defined'](_0x1fa906['scaleZ']))&&(this[_0x5d6213(0x90a)]['modelMatrix']=this['modelMatrix']);}['_style2Json'](_0x2137b1,_0x14dc90){const _0x2ef5a2=_0x35a251;return ModelStyleConver[_0x2ef5a2(0x99e)](_0x2137b1,_0x14dc90);}[_0x35a251(0xedd)](){const _0x3f62cf={_0x56aed2:0x90a,_0xeed467:0xb61},_0x18a575=_0x35a251;this[_0x18a575(_0x3f62cf._0x56aed2)]['modelMatrix']=this['modelMatrix'],this['_primitive_point']&&(this[_0x18a575(0xdfe)]['position']=this['position']),this[_0x18a575(0x578)]&&(this['_primitive_billboard'][_0x18a575(_0x3f62cf._0xeed467)]=this['position']);}['_getTargetDistanceDisplayCondition'](_0x48fddb){const _0x88c8ba={_0x5e1843:0xf8a},_0x3681d6=_0x35a251;let _0x1860b2;if(this['style']['distanceDisplayCondition']instanceof Cesium__namespace[_0x3681d6(0x92e)])_0x1860b2=this['style']['distanceDisplayCondition'][_0x3681d6(_0x88c8ba._0x5e1843)];else this['style']['distanceDisplayCondition_far']&&(_0x1860b2=this[_0x3681d6(0xfc8)]['distanceDisplayCondition_far']);return new Cesium__namespace['DistanceDisplayCondition'](_0x48fddb[_0x3681d6(0x14b)]??_0x1860b2,_0x48fddb['distanceDisplayCondition_far']??Number['MAX_VALUE']);}['setOpacity'](_0x2e2464){const _0x485263={_0x3a02be:0xfc8,_0xdf259a:0x969},_0x447f5f=_0x35a251;this[_0x447f5f(_0x485263._0x3a02be)]['globalAlpha']=_0x2e2464,this['_primitive']&&ModelStyleConver[_0x447f5f(0x45c)](this['_primitive'],_0x2e2464),this[_0x447f5f(_0x485263._0xdf259a)](_0x2e2464);}['_getDrawEntityClass'](_0x35b7f2,_0x4a878b){return create$4('model',_0x35b7f2);}}register$4('modelP',ModelPrimitive,!![]);class CirclePrimitive extends BasePointPrimitive{get['distance'](){return Math['PI']*0x2*this['radius'];}get['area'](){const _0x434c59=this['radius'];return Math['PI']*_0x434c59*_0x434c59;}get['radius'](){const _0x2658d1=_0x35a251;return this['style'][_0x2658d1(0x907)];}set['radius'](_0x4db6f4){this['style']['radius']=_0x4db6f4,this['_updateStyleHook'](this['style'],{'radius':_0x4db6f4});}get['outlinePositions'](){const _0x27acb0=_0x35a251;return this[_0x27acb0(0x594)]();}['_conversionStyle'](_0x2ed201){return CircleStyleConver['toCesiumVal'](_0x2ed201);}['_style2Json'](_0x1960dd,_0x4e9584){const _0x472ba0=_0x35a251;return CircleStyleConver[_0x472ba0(0x99e)](_0x1960dd,_0x4e9584);}['_createGeometryInstance'](_0x3fe899,_0x289ab2){const _0x590a57={_0x153f7f:0xb61,_0x438efe:0x682},_0x30ea4b=_0x35a251;var _0x2fed69;_0x3fe899['center']=this[_0x30ea4b(_0x590a57._0x153f7f)],_0x3fe899[_0x30ea4b(_0x590a57._0x438efe)]=_0x3fe899['height']??((_0x2fed69=this['point'])===null||_0x2fed69===void 0x0?void 0x0:_0x2fed69[_0x30ea4b(0x5d2)])??0x0;Cesium__namespace['defined'](this['style']['diffHeight'])&&(_0x3fe899['extrudedHeight']=_0x3fe899['height']+this['style'][_0x30ea4b(0x4f7)]);const _0x5c3ae9=_0x289ab2?Cesium__namespace[_0x30ea4b(0x933)]:Cesium__namespace['CircleGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x5c3ae9(_0x3fe899),'attributes':this[_0x30ea4b(0xe86)][_0x30ea4b(0x523)]});}['_getPolylineOutlinePositions'](){return[this['getOutlinePositions'](![])];}['getOutlineCoordinates'](_0x2ce42a,_0x59df45,_0x1fc2ab){const _0x269c25=_0x35a251;return cartesians2lonlats(this[_0x269c25(0x594)](_0x2ce42a,_0x59df45),_0x1fc2ab);}[_0x35a251(0x594)](_0x55959e=!![],_0x23bf84){const _0x1d5e9a={_0x439d07:0x6de,_0xcc2c7d:0xf48},_0x58bb5e=_0x35a251,_0x3e7e79=getEllipseOuterPositions({'position':this['position'],'radius':this[_0x58bb5e(0x907)],'granularity':this['style']['granularity'],'count':_0x23bf84});if(_0x55959e&&_0x3e7e79){var _0x36dcc5;_0x3e7e79[_0x58bb5e(_0x1d5e9a._0x439d07)](_0x3e7e79[0x0]),(this['style'][_0x58bb5e(0xf5d)]>0x4||((_0x36dcc5=this['style']['outlineStyle'])===null||_0x36dcc5===void 0x0?void 0x0:_0x36dcc5[_0x58bb5e(_0x1d5e9a._0xcc2c7d)])>0x4)&&_0x3e7e79['push'](_0x3e7e79[0x1]);}return _0x3e7e79;}['flyTo'](_0x4e8191={}){const _0x511524={_0xf7930b:0x907},_0x168626=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);return _0x4e8191[_0x168626(0x907)]=this[_0x168626(_0x511524._0xf7930b)]*(_0x4e8191['scale']||1.8),this['_map']['flyToPoint'](this['position'],_0x4e8191);}['getRectangle'](_0x2b0b6b){const _0x5bd23b={_0x39137f:0x7ff},_0x3302ba=_0x35a251,_0x5e3fd1=this['getOutlinePositions'](![],0x1);if(!_0x5e3fd1||_0x5e3fd1['length']===0x0)return;const _0x505156=getRectangle(_0x5e3fd1,_0x2b0b6b===null||_0x2b0b6b===void 0x0?void 0x0:_0x2b0b6b[_0x3302ba(_0x5bd23b._0x39137f)]);return _0x505156;}['isInPoly'](_0x4d9fd6){const _0x7ee7a0={_0x34738b:0x8d0,_0x276b7e:0xeed},_0x4430d8=_0x35a251;_0x4d9fd6=LngLatPoint[_0x4430d8(_0x7ee7a0._0x34738b)](_0x4d9fd6)['toCartesian'](),_0x4d9fd6=setPositionsHeight(_0x4d9fd6,this['height']);const _0x4a4a5b=Cesium__namespace['Cartesian3'][_0x4430d8(_0x7ee7a0._0x276b7e)](this['position'],_0x4d9fd6);return _0x4a4a5b<=this['radius'];}['_getDrawEntityClass'](_0x465e05,_0x41a34e){return create$4('circle',_0x465e05);}}register$4('circleP',CirclePrimitive,!![]);class PlanePrimitive extends BasePointPrimitive{get[_0x35a251(0x8a0)](){const _0x4446cf={_0x5b2da6:0x8a0,_0x2c1b4b:0xd66,_0x35150e:0x6ea,_0x571e03:0xd04,_0x37e9dd:0xb7b},_0x577e5c=_0x35a251;var _0x9299a0,_0x327b5f,_0x153229;if(this['options'][_0x577e5c(0x8a0)])return this['options'][_0x577e5c(_0x4446cf._0x5b2da6)];const _0x17664a=super[_0x577e5c(_0x4446cf._0x5b2da6)];if(!this['position'])return Cesium__namespace['Matrix4']['IDENTITY'];const _0x687885=PlaneStyleConver['toCesiumVal'](this[_0x577e5c(0xfc8)]),_0x14768d=this['style'][_0x577e5c(0xb3b)]||((_0x9299a0=_0x687885['plane'])===null||_0x9299a0===void 0x0?void 0x0:_0x9299a0[_0x577e5c(_0x4446cf._0x2c1b4b)]),_0x1e1b75=new Cesium__namespace['Cartesian3'](((_0x327b5f=_0x687885[_0x577e5c(0x6ea)])===null||_0x327b5f===void 0x0?void 0x0:_0x327b5f['x'])??0x1,((_0x153229=_0x687885[_0x577e5c(_0x4446cf._0x35150e)])===null||_0x153229===void 0x0?void 0x0:_0x153229['y'])??0x1,0x1);if(_0x14768d===Cesium__namespace['Cartesian3']['UNIT_X']||_0x14768d==='x'){var _0xa218dd,_0x4c3263;const _0x26b080=Cesium__namespace[_0x577e5c(0x6a7)]['fromRotationTranslation'](Cesium__namespace['Matrix3'][_0x577e5c(_0x4446cf._0x571e03)](Cesium__namespace[_0x577e5c(0x7c0)]['toRadians'](0x5a)));Cesium__namespace[_0x577e5c(0x6a7)]['multiply'](_0x17664a,_0x26b080,_0x17664a),_0x1e1b75['x']=((_0xa218dd=_0x687885[_0x577e5c(_0x4446cf._0x35150e)])===null||_0xa218dd===void 0x0?void 0x0:_0xa218dd['y'])??0x1,_0x1e1b75['y']=((_0x4c3263=_0x687885['dimensions'])===null||_0x4c3263===void 0x0?void 0x0:_0x4c3263['x'])??0x1,_0x1e1b75['z']=0x1;}else{if(_0x14768d===Cesium__namespace['Cartesian3']['UNIT_Y']||_0x14768d==='y'){const _0x50f33d=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3'][_0x577e5c(0x2af)](Cesium__namespace['Math'][_0x577e5c(0x7ba)](0x5a)));Cesium__namespace['Matrix4']['multiply'](_0x17664a,_0x50f33d,_0x17664a);}}const _0x3f0a25=Cesium__namespace['Matrix4']['fromScale'](_0x1e1b75);return Cesium__namespace['Matrix4'][_0x577e5c(_0x4446cf._0x37e9dd)](_0x17664a,_0x3f0a25,_0x17664a),_0x17664a;}[_0x35a251(0xbb)](_0x25a0a7){return PlaneStyleConver['toCesiumVal'](_0x25a0a7);}['_style2Json'](_0x36893f,_0x40d3fa){const _0x299568=_0x35a251;return PlaneStyleConver[_0x299568(0x99e)](_0x36893f,_0x40d3fa);}['_createGeometryInstance'](_0x306739,_0x59b537){const _0x5525b3=_0x35a251,_0x52b442=_0x59b537?Cesium__namespace['PlaneOutlineGeometry']:Cesium__namespace['PlaneGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x52b442(_0x306739),'modelMatrix':this['modelMatrix'],'attributes':this[_0x5525b3(0xe86)][_0x5525b3(0x523)]});}['_getDrawEntityClass'](_0x447ab7,_0x3b1311){return create$4('plane',_0x447ab7);}}register$4('planeP',PlanePrimitive,!![]);class BoxPrimitive extends BasePointPrimitive{constructor(_0x58a154={}){const _0x4bd254=_0x35a251;super(_0x58a154),this['style'][_0x4bd254(0x5fe)]=this['style']['closed']??!![];}['_conversionStyle'](_0x3ab80c){const _0x49afd9={_0xbcf0d2:0xc04},_0xe98f85=_0x35a251;return BoxStyleConver[_0xe98f85(_0x49afd9._0xbcf0d2)](_0x3ab80c);}['_style2Json'](_0x345090,_0x3414d0){return BoxStyleConver['toJSON'](_0x345090,_0x3414d0);}['_createGeometryInstance'](_0x2c2ade,_0x47e683){const _0x5a74a8=_0x47e683?Cesium__namespace['BoxOutlineGeometry']:Cesium__namespace['BoxGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':_0x5a74a8['fromDimensions'](_0x2c2ade),'modelMatrix':this['modelMatrix'],'attributes':this['options']['attributes']});}['_getDrawEntityClass'](_0x4f4346,_0x4c8cd2){const _0x6b7f46=_0x35a251;return create$4(_0x6b7f46(0xe50),_0x4f4346);}}register$4('boxP',BoxPrimitive,!![]);class CylinderPrimitive extends BasePointPrimitive{constructor(_0x3de1eb={}){super(_0x3de1eb),this['style']['closed']=this['style']['closed']??!![];}['_conversionStyle'](_0x13d166){return CylinderStyleConver['toCesiumVal'](_0x13d166);}['_style2Json'](_0x4da881,_0x30b4c2){const _0x364412={_0x279bf6:0x99e},_0x284ee9=_0x35a251;return CylinderStyleConver[_0x284ee9(_0x364412._0x279bf6)](_0x4da881,_0x30b4c2);}['_createGeometryInstance'](_0xf2d4de,_0x323303){const _0x39102d={_0x3a72c5:0xa2f},_0x5182ff=_0x35a251,_0xa84d59=_0x323303?Cesium__namespace['CylinderOutlineGeometry']:Cesium__namespace[_0x5182ff(_0x39102d._0x3a72c5)];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0xa84d59(_0xf2d4de),'modelMatrix':_0xf2d4de['modelMatrix']||this['modelMatrix'],'attributes':this['options']['attributes']});}['_getDrawEntityClass'](_0x9b8c40,_0x54be4c){return create$4('cylinder',_0x9b8c40);}}register$4('cylinderP',CylinderPrimitive,!![]);class ConeTrackPrimitive extends CylinderPrimitive{constructor(_0x390f32={}){const _0x4e180b={_0x5ea114:0x4cd},_0x4de962=_0x35a251;super(_0x390f32),_0x390f32['targetPosition']&&(this[_0x4de962(_0x4e180b._0x5ea114)]=_0x390f32['targetPosition']);}get['hasEdit'](){return![];}get['targetPosition'](){return this['_targetPosition'];}set[_0x35a251(0x4cd)](_0x3939d2){const _0x3060d8={_0x5e7066:0xb46,_0x55e538:0x371},_0xd32763=_0x35a251;this[_0xd32763(_0x3060d8._0x5e7066)]=LngLatPoint['parse'](_0x3939d2),this[_0xd32763(0x739)]=this['_targetPoint']['toCartesian'](),this[_0xd32763(_0x3060d8._0x55e538)]&&this['_updatePositionsHook']();}get[_0x35a251(0xeea)](){return this['_targetPoint'];}get['angle'](){return this['style']['angle'];}set['angle'](_0x4d75e0){this['style']['angle']=_0x4d75e0;}['_createGeometryInstance'](_0xbb82c4,_0x4873e2){const _0x3208ac={_0x4f2e43:0x8eb,_0x56d131:0xae2,_0x39315e:0xba7,_0x3e07fd:0xe1e,_0x2d8be4:0x8a0,_0x29e3b9:0x2c9,_0x5af046:0xeec},_0x3e4088=_0x35a251,_0x34e655=this[_0x3e4088(0xb61)],_0x13b2bc=getPositionValue(this['targetPosition'],this['_map']['clock']['currentTime']);let _0x2ed24b,_0x2e3570;return _0x13b2bc?(_0xbb82c4[_0x3e4088(0xe1e)]=Cesium__namespace[_0x3e4088(_0x3208ac._0x4f2e43)]['distance'](_0x34e655,_0x13b2bc),_0x2e3570=Cesium__namespace['Cartesian3'][_0x3e4088(_0x3208ac._0x56d131)](_0x34e655,_0x13b2bc,new Cesium__namespace['Cartesian3']()),_0x2ed24b=getHeadingPitchRollForLine(_0x13b2bc,_0x34e655)):(_0xbb82c4['length']=this['style']['length'],_0x2ed24b=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math']['toRadians'](this[_0x3e4088(0x41f)]),Cesium__namespace['Math'][_0x3e4088(0x7ba)](this['pitch']),Cesium__namespace['Math'][_0x3e4088(0x7ba)](this[_0x3e4088(_0x3208ac._0x39315e)])),_0x2e3570=getPositionByHprAndLen(_0x34e655,_0x2ed24b,_0xbb82c4[_0x3e4088(_0x3208ac._0x3e07fd)]/0x2)),_0xbb82c4[_0x3e4088(_0x3208ac._0x2d8be4)]=Cesium__namespace[_0x3e4088(0x49c)]['headingPitchRollToFixedFrame'](_0x2e3570,_0x2ed24b),Cesium__namespace['defined'](this['style'][_0x3e4088(_0x3208ac._0x29e3b9)])&&(_0xbb82c4['bottomRadius']=_0xbb82c4['length']*Math[_0x3e4088(_0x3208ac._0x5af046)](Cesium__namespace['Math'][_0x3e4088(0x7ba)](0x5a-this[_0x3e4088(0x2c9)]))),super['_createGeometryInstance'](_0xbb82c4,_0x4873e2);}}register$4('coneTrackP',ConeTrackPrimitive,!![]);class EllipsoidPrimitive extends BasePointPrimitive{constructor(_0x12a8e6={}){const _0x3c5afe=_0x35a251;super(_0x12a8e6),this['style'][_0x3c5afe(0x5fe)]=this['style']['closed']??!![];}[_0x35a251(0xbb)](_0x195bab){const _0x1a08df=_0x35a251;return EllipsoidStyleConver[_0x1a08df(0xc04)](_0x195bab);}['_style2Json'](_0x1bc8d7,_0x35b65e){return EllipsoidStyleConver['toJSON'](_0x1bc8d7,_0x35b65e);}['_createGeometryInstance'](_0x59d4e9,_0x4f66f4){const _0x26e95e={_0x3a8d6a:0x8a0},_0x2ec37b=_0x35a251,_0x4c80b3=_0x4f66f4?Cesium__namespace['EllipsoidOutlineGeometry']:Cesium__namespace['EllipsoidGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x4c80b3(_0x59d4e9),'modelMatrix':this[_0x2ec37b(_0x26e95e._0x3a8d6a)],'attributes':this[_0x2ec37b(0xe86)]['attributes']});}['_getDrawEntityClass'](_0x1fb8eb,_0x10021c){const _0x123bd3=_0x35a251;return create$4(_0x123bd3(0x3f4),_0x1fb8eb);}}register$4(_0x35a251(0x518),EllipsoidPrimitive,!![]);class WallPrimitive extends BasePolyPrimitive{['_createGeometryInstance'](_0x391c56,_0x4eb2cc){const _0x427a94={_0x1cbe4b:0xfc8,_0x495fed:0x291},_0x1c4539=_0x35a251;var _0x52a7b7;let _0x3b180e=this['positions'];const _0x2aafe0=this['points'],_0x249a9b=_0x2aafe0['length'];let _0x568559=new Array(_0x249a9b),_0x144c1a=new Array(_0x249a9b);for(let _0x32b2dc=0x0;_0x32b2dc<_0x249a9b;_0x32b2dc++){const _0x1a4309=_0x2aafe0[_0x32b2dc]['alt'];_0x568559[_0x32b2dc]=_0x1a4309,_0x144c1a[_0x32b2dc]=_0x1a4309+Number(this[_0x1c4539(_0x427a94._0x1cbe4b)]['diffHeight']||0x64);}this['style']['closure']&&((_0x52a7b7=_0x3b180e)===null||_0x52a7b7===void 0x0?void 0x0:_0x52a7b7['length'])>0x0&&(_0x3b180e=_0x3b180e['concat'](_0x3b180e[0x0]),_0x568559=_0x568559['concat'](_0x568559[0x0]),_0x144c1a=_0x144c1a['concat'](_0x144c1a[0x0]));const _0x44918e=_0x4eb2cc?Cesium__namespace[_0x1c4539(0xbac)]:Cesium__namespace['WallGeometry'];return new Cesium__namespace[(_0x1c4539(_0x427a94._0x495fed))]({'id':this['id'],'geometry':new _0x44918e({..._0x391c56,'positions':_0x3b180e,'maximumHeights':_0x144c1a,'minimumHeights':_0x568559}),'attributes':this[_0x1c4539(0xe86)]['attributes']});}['_conversionStyle'](_0x4b43c9){return WallStyleConver['toCesiumVal'](_0x4b43c9);}['_style2Json'](_0xc34074,_0x11b01e){return WallStyleConver['toJSON'](_0xc34074,_0x11b01e);}['_getDrawEntityClass'](_0x18849b,_0x895556){return create$4('wall',_0x18849b);}}register$4('wallP',WallPrimitive);class CorridorPrimitive extends BasePolyPrimitive{['_createGeometryInstance'](_0x440f43,_0x1dc5a0){const _0x92788={_0x2a1730:0xb35,_0x25d3cb:0x3e3,_0x580e63:0xe86},_0x44e267=_0x35a251;this['_updateDiffHeight'](_0x440f43),_0x440f43[_0x44e267(_0x92788._0x2a1730)]=this[_0x44e267(0xb35)];const _0x175695=_0x1dc5a0?Cesium__namespace[_0x44e267(_0x92788._0x25d3cb)]:Cesium__namespace[_0x44e267(0xb56)];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x175695(_0x440f43),'attributes':this[_0x44e267(_0x92788._0x580e63)][_0x44e267(0x523)]});}['_conversionStyle'](_0x2598de){return CorridorStyleConver['toCesiumVal'](_0x2598de);}[_0x35a251(0x1e0)](_0x431164,_0x1e223c){return CorridorStyleConver['toJSON'](_0x431164,_0x1e223c);}[_0x35a251(0x4be)](_0x56462e,_0x556808){const _0x48e6d8={_0x30bac9:0x55c},_0x292c25=_0x35a251;return create$4(_0x292c25(_0x48e6d8._0x30bac9),_0x56462e);}}register$4('corridorP',CorridorPrimitive);class PolylineVolumePrimitive extends BasePolyPrimitive{constructor(_0x1f8951={}){super(_0x1f8951),this['style']['closed']=this['style']['closed']??!![];}['_createGeometryInstance'](_0x512883,_0x38da5d){const _0x2fa589=_0x35a251,_0x776043=_0x38da5d?Cesium__namespace['PolylineVolumeOutlineGeometry']:Cesium__namespace['PolylineVolumeGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x776043({..._0x512883,'polylinePositions':this['positions'],'shapePositions':_0x512883['shape']}),'attributes':this[_0x2fa589(0xe86)]['attributes']});}['_conversionStyle'](_0x9ec8a3){const _0x43561a={_0x362b61:0xc04},_0x597dbb=_0x35a251;return PolylineVolumeStyleConver[_0x597dbb(_0x43561a._0x362b61)](_0x9ec8a3);}['_style2Json'](_0x5d8e95,_0x201e06){return PolylineVolumeStyleConver['toJSON'](_0x5d8e95,_0x201e06);}['_getDrawEntityClass'](_0x47d94e,_0x481044){return create$4('polylineVolume',_0x47d94e);}}register$4(_0x35a251(0x2db),PolylineVolumePrimitive);class RectanglePrimitive extends BasePolyPrimitive{constructor(_0x37d4f1={}){super(_0x37d4f1),_0x37d4f1['rectangle']&&(this['rectangle']=_0x37d4f1['rectangle']);}get['rectangle'](){const _0xab7e0d={_0x387025:0xb35},_0xabb27e=_0x35a251;return!this['_rectangle']&&this['positions']&&(this['_rectangle']=Cesium__namespace['Rectangle']['fromCartesianArray'](this[_0xabb27e(_0xab7e0d._0x387025)])),this[_0xabb27e(0xc02)];}set['rectangle'](_0x262b3e){const _0x1ac6d7={_0x3514de:0xc02},_0x50d75a=_0x35a251;this[_0x50d75a(_0x1ac6d7._0x3514de)]=_0x262b3e;}get[_0x35a251(0xec)](){const _0x5846d7={_0x12d5a3:0xfc8},_0x501327=_0x35a251;let _0x4e006f;if(Cesium__namespace['defined'](this[_0x501327(_0x5846d7._0x12d5a3)]['rotationDegree']))_0x4e006f=Cesium__namespace['Math']['toRadians'](this[_0x501327(0xfc8)]['rotationDegree']);else Cesium__namespace['defined'](this['style']['rotation'])&&(_0x4e006f=this['style'][_0x501327(0xb7a)]);const _0x4befb5=getRectangleOuterPositions({'rectangle':this[_0x501327(0xab1)],'rotation':_0x4e006f,'height':this['style']['height']});return _0x4befb5;}get['distance'](){return getDistance(this['outlinePositions'],!![]);}get[_0x35a251(0x705)](){const _0x539fc1=_0x35a251;return getSurfaceArea(this[_0x539fc1(0xec)]);}get[_0x35a251(0x176)](){const _0x386657=_0x35a251,_0x287789=this[_0x386657(0xab1)];if(!this['rectangle'])return null;const _0x55de5b=Cesium__namespace['Cartographic']['toCartesian'](Cesium__namespace[_0x386657(0xd6)][_0x386657(0x176)](_0x287789));return _0x55de5b;}['_updatePositionsHook'](){const _0x11f26d={_0x409e68:0xedd},_0xe35eb=_0x35a251;return this['rectangle']=Cesium__namespace['Rectangle'][_0xe35eb(0x4c2)](this['positions']),super[_0xe35eb(_0x11f26d._0x409e68)]();}['_createGeometryInstance'](_0x5130ac,_0x5e8bc8){const _0x22adff={_0x29474a:0xe86},_0xa91849=_0x35a251;this['_updateDiffHeight'](_0x5130ac,!![]),_0x5130ac['rectangle']=this['rectangle'];const _0x1c0828=_0x5e8bc8?Cesium__namespace['RectangleOutlineGeometry']:Cesium__namespace['RectangleGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x1c0828(_0x5130ac),'attributes':this[_0xa91849(_0x22adff._0x29474a)]['attributes']});}[_0x35a251(0xbb)](_0x2637fa){return RectangleStyleConver['toCesiumVal'](_0x2637fa);}['_style2Json'](_0x376fa5,_0x5f0337){return RectangleStyleConver['toJSON'](_0x376fa5,_0x5f0337);}['_getGeoJsonGeometry'](_0x50f27a){const _0xbad726={_0x280da4:0xe0c},_0x57ff6d=_0x35a251;return{'type':'Polygon','coordinates':[this['getCoordinates'](_0x50f27a===null||_0x50f27a===void 0x0?void 0x0:_0x50f27a[_0x57ff6d(_0xbad726._0x280da4)])]};}[_0x35a251(0x9ff)](){return[this['outlinePositions']];}['getRectangle'](_0x558d12){const _0x50884d=this['rectangle'];return _0x558d12!==null&&_0x558d12!==void 0x0&&_0x558d12['isFormat']?formatRectangle(_0x50884d):_0x50884d;}['isInPoly'](_0x567555){const _0x440220=Cesium__namespace['Rectangle']['contains'](this['rectangle'],LngLatPoint['parse'](_0x567555)['toCartographic']());return _0x440220;}['_getDrawEntityClass'](_0x211f60,_0x112ca){return create$4('rectangle',_0x211f60);}[_0x35a251(0xf4c)](){const _0x4349da={_0x3fbeaa:0xedd},_0x508104=_0x35a251;super['_updateDrawEntityToThis'](),this[_0x508104(_0x4349da._0x3fbeaa)]();}}register$4(_0x35a251(0x95a),RectanglePrimitive);const nullColor=new Cesium__namespace['Color'](0x0,0x0,0x0,0.01);class PolygonPrimitive extends BasePolyPrimitive{get[_0x35a251(0x176)](){return this['centerOfMass'];}get['distance'](){const _0xe0cf27={_0x46d6b9:0x58a},_0x350701=_0x35a251;return getDistance(this[_0x350701(_0xe0cf27._0x46d6b9)],!![]);}get['positions'](){return this['_positions'];}set[_0x35a251(0xb35)](_0x58fa9a){const _0x28576b={_0x2da146:0x719,_0x22db00:0xe97,_0x17aef0:0xfc8},_0x55d220=_0x35a251;if(!_0x58fa9a)return;if(_0x58fa9a['length']>0x0&&Array['isArray'](_0x58fa9a[0x0])&&_0x58fa9a[0x0]['length']>0x0){const _0x1ad878=_0x58fa9a[0x0][0x0];if(Array[_0x55d220(_0x28576b._0x2da146)](_0x1ad878)&&isNumber(_0x1ad878[0x0]))this[_0x55d220(_0x28576b._0x22db00)]=getPolygonHierarchy(_0x58fa9a,this['style']['height']||this[_0x55d220(0xfc8)]['setHeight']||this[_0x55d220(_0x28576b._0x17aef0)]['addHeight']),_0x58fa9a=this['_hierarchy']['positions'];else _0x1ad878 instanceof Cesium__namespace[_0x55d220(0x8eb)]&&(this[_0x55d220(_0x28576b._0x22db00)]=getPolygonHierarchy2(_0x58fa9a),_0x58fa9a=this['_hierarchy']['positions']);}super['positions']=_0x58fa9a,this['_hierarchy']&&this['_positions']&&(this['_hierarchy']['positions']=this['_positions']);}['_createGeometryInstance'](_0x71a841,_0x28b043){const _0x74b81e={_0x48155a:0xe86,_0x17f5c7:0x523},_0x12989e=_0x35a251;this[_0x12989e(0x68d)](_0x71a841);this['_hierarchy']?_0x71a841[_0x12989e(0xa8e)]=this['_hierarchy']:_0x71a841[_0x12989e(0xa8e)]=new Cesium__namespace['PolygonHierarchy'](this['positions']);const _0x5789cf=_0x28b043?Cesium__namespace['PolygonOutlineGeometry']:Cesium__namespace['PolygonGeometry'];return new Cesium__namespace[(_0x12989e(0x291))]({'id':this['id'],'geometry':new _0x5789cf(_0x71a841),'attributes':this[_0x12989e(_0x74b81e._0x48155a)][_0x12989e(_0x74b81e._0x17f5c7)]});}['_conversionStyle'](_0x4395a9){let _0x290385=PolygonStyleConver['toCesiumVal'](_0x4395a9);return _0x290385=this['_bindExType'](_0x290385),_0x290385;}[_0x35a251(0x48d)](_0x1b3310){const _0x48826c={_0x55d2a4:0xed5,_0x3236c1:0x6b3,_0x3126f8:0x552,_0x254636:0xe86,_0x1d5ea2:0xac3},_0x5e5212=_0x35a251,_0x359d20=this['options'][_0x5e5212(0xed5)]||this[_0x5e5212(0x2d0)]['options'][_0x5e5212(_0x48826c._0x55d2a4)];if(_0x359d20&&(_0x359d20[_0x5e5212(0x2a6)]??!![])){if(_0x359d20['bottomHeight']){let _0x380bcd;if(isNumber(_0x359d20['bottomHeight']))_0x380bcd=_0x359d20['bottomHeight'];else isString(_0x359d20['bottomHeight'])&&(_0x380bcd=Number(this[_0x5e5212(_0x48826c._0x3236c1)][_0x359d20['bottomHeight']]||0x0));_0x1b3310[_0x5e5212(0x682)]=_0x380bcd;}const _0x1a1a50=Number(this['attr'][_0x359d20['cloumn']]||0x1);let _0xd40f9b;if(isNumber(_0x359d20[_0x5e5212(0x682)]))_0xd40f9b=_0x359d20['height'];else isString(_0x359d20['height'])?_0xd40f9b=this['attr'][_0x359d20['height']]||_0xd40f9b:_0xd40f9b=3.5;const _0x8e4d81=_0x1b3310[_0x5e5212(0x682)]||0x0;_0x1b3310[_0x5e5212(_0x48826c._0x3126f8)]=_0x8e4d81+_0x1a1a50*_0xd40f9b;}const _0xaba832=this[_0x5e5212(_0x48826c._0x254636)]['dth']||this['_layer'][_0x5e5212(0xe86)][_0x5e5212(0xaf2)];if(_0xaba832){const _0x249f87=this[_0x5e5212(_0x48826c._0x1d5ea2)](_0x1b3310,![]);!Cesium__namespace['defined'](_0x249f87)&&(_0x1b3310['color']=nullColor),_0x1b3310['classification']=!![],!Cesium__namespace['defined'](this[_0x5e5212(0xfc8)]['height'])&&(_0x1b3310[_0x5e5212(0x94d)]=![]),_0x1b3310['zIndex']=0x63;}return _0x1b3310;}[_0x35a251(0x30c)](_0x1ca184){const _0xb99e24={_0x27498c:0x6a7,_0x47f6b3:0x89e},_0x164458=_0x35a251,_0xcb3bd=0x615299;for(let _0x25d964=0x0,_0x552d63=this['primitiveCollection']['length'];_0x25d964<_0x552d63;_0x25d964++){const _0x41b5e3=this['primitiveCollection']['get'](_0x25d964),_0x5917cd=(_0xcb3bd+_0x1ca184)/(_0xcb3bd+this['style'][_0x164458(0x682)]),_0x246a85=Cesium__namespace[_0x164458(_0xb99e24._0x27498c)][_0x164458(_0xb99e24._0x47f6b3)](new Cesium__namespace['Cartesian3'](_0x5917cd,_0x5917cd,_0x5917cd));_0x41b5e3[_0x164458(0x8a0)]=_0x246a85;}}['_style2Json'](_0x3a9fe5,_0x36f7a1){const _0x1629af=_0x35a251;return PolygonStyleConver[_0x1629af(0x99e)](_0x3a9fe5,_0x36f7a1);}['_getGeoJsonGeometry'](_0x3aa1d3){const _0x4cdc1c={_0x2217dc:0x797},_0x430f85=_0x35a251;return{'type':'Polygon','coordinates':[this[_0x430f85(_0x4cdc1c._0x2217dc)](_0x3aa1d3===null||_0x3aa1d3===void 0x0?void 0x0:_0x3aa1d3['noAlt'])]};}['_getPolylineOutlinePositions'](){const _0x19a528=_0x35a251;return this[_0x19a528(0xe97)]?getHierarchyVal(this['_hierarchy']):[this['positions']];}['_getDrawEntityClass'](_0x5ea084,_0x3937ad){return create$4('polygon',_0x5ea084);}['_startEditingHook'](_0x34fd90){const _0x54da73={_0xd99162:0xe97,_0x17b3d0:0xe97},_0x2c5b77=_0x35a251;this[_0x2c5b77(_0x54da73._0xd99162)]&&(_0x34fd90['_hierarchy']=this[_0x2c5b77(_0x54da73._0x17b3d0)]);}}register$4(_0x35a251(0x4d8),PolygonPrimitive);class FrustumPrimitive extends BasePointPrimitive{constructor(_0x57e301={}){const _0x2990ff={_0x51bc6e:0xfc8,_0x4398a2:0x4cd},_0x48dfef=_0x35a251;super(_0x57e301),this['style']['closed']=this[_0x48dfef(_0x2990ff._0x51bc6e)]['closed']??!![],_0x57e301['targetPosition']&&(this[_0x48dfef(_0x2990ff._0x4398a2)]=_0x57e301['targetPosition']);}get['targetPosition'](){const _0x2014ee={_0x296934:0x739},_0x2afd44=_0x35a251;return this[_0x2afd44(_0x2014ee._0x296934)];}set['targetPosition'](_0x43e68a){const _0x45f0de={_0x512e46:0x47f},_0x3da34c=_0x35a251;this['_targetPoint']=LngLatPoint['parse'](_0x43e68a),this['_targetPosition']=this['_targetPoint']['toCartesian'](),this[_0x3da34c(_0x45f0de._0x512e46)]&&this['show']&&(this['_removedHook'](),this['_addedHook'](this['style']));}get['targetPoint'](){return this['_targetPoint'];}get['angle'](){return this['style']['angle'];}set['angle'](_0x461403){const _0x22f7aa=_0x35a251;this[_0x22f7aa(0xfc8)]['angle']=_0x461403;}get['angle2'](){const _0x203ce9=_0x35a251;return this['style'][_0x203ce9(0x79c)]??this[_0x203ce9(0xfc8)]['angle'];}set['angle2'](_0x142e7d){const _0x43c218={_0x3a2116:0xfc8},_0xc40605=_0x35a251;this[_0xc40605(_0x43c218._0x3a2116)]['angle2']=_0x142e7d;}get['groundPosition'](){return getRayEarthPosition(this['position'],this['_orientation']);}get['defaultVertexFormat'](){const _0x3aabeb={_0x1b1d2a:0x9f},_0x3c5f78=_0x35a251;return Cesium__namespace[_0x3c5f78(_0x3aabeb._0x1b1d2a)]['POSITION_ONLY'];}[_0x35a251(0x1a8)](){}[_0x35a251(0xbb)](_0x57acc6){return CylinderStyleConver['toCesiumVal'](_0x57acc6);}[_0x35a251(0x1e0)](_0x30bf25,_0x1893ca){const _0x65a51a={_0x281e25:0x99e},_0x31135c=_0x35a251;return CylinderStyleConver[_0x31135c(_0x65a51a._0x281e25)](_0x30bf25,_0x1893ca);}['_createGeometryInstance'](_0x571c08,_0x3d7cd8){const _0xaf25e={_0x55b7f8:0x523},_0x5eafb4=_0x35a251;this['_update']();const _0x6dd6d9=_0x3d7cd8?Cesium__namespace[_0x5eafb4(0x890)]:Cesium__namespace['FrustumGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x6dd6d9({..._0x571c08,'origin':this[_0x5eafb4(0xb61)],'orientation':this['_orientation'],'frustum':this[_0x5eafb4(0xfa8)]}),'attributes':this['options'][_0x5eafb4(_0xaf25e._0x55b7f8)]});}['_update'](_0xf3b1d0){const _0x5dbc0d={_0x416500:0x7d,_0x29a235:0x653,_0x4c0958:0xba7,_0x115dad:0x7c0,_0x10c90e:0x711,_0x5b5d7b:0xab5,_0x52ab96:0x7ba},_0x116e7c=_0x35a251,_0x504992=getPositionValue(this[_0x116e7c(0xb61)],_0xf3b1d0);if(!_0x504992){this['_cylinderPosition']=undefined;return;}if(this['options'][_0x116e7c(_0x5dbc0d._0x416500)]){const _0x52b9c3=this['options']['camera'],_0x2b4062=new Cesium__namespace['Cartesian3'](),_0x2a4f4d=new Cesium__namespace['Matrix3'](),_0x4a4454=new Cesium__namespace[(_0x116e7c(_0x5dbc0d._0x29a235))](),_0x45fef7=_0x52b9c3['directionWC'],_0x3954f3=_0x52b9c3['upWC'],_0x4b8360=Cesium__namespace['Cartesian3'][_0x116e7c(0x33f)](_0x52b9c3['rightWC'],_0x2b4062);Cesium__namespace['Matrix3'][_0x116e7c(0x3f3)](_0x2a4f4d,0x0,_0x4b8360,_0x2a4f4d),Cesium__namespace[_0x116e7c(0xd9d)]['setColumn'](_0x2a4f4d,0x1,_0x3954f3,_0x2a4f4d),Cesium__namespace['Matrix3']['setColumn'](_0x2a4f4d,0x2,_0x45fef7,_0x2a4f4d),this['_orientation']=Cesium__namespace['Quaternion']['fromRotationMatrix'](_0x2a4f4d,_0x4a4454),this[_0x116e7c(0xfa8)]=_0x52b9c3['frustum'],this['heading']=Cesium__namespace[_0x116e7c(0x7c0)][_0x116e7c(0x9c5)](_0x52b9c3['heading']),this['pitch']=Cesium__namespace['Math']['toDegrees'](_0x52b9c3[_0x116e7c(0x527)]),this['roll']=Cesium__namespace['Math']['toDegrees'](_0x52b9c3[_0x116e7c(_0x5dbc0d._0x4c0958)]);return;}const _0x35785c=getPositionValue(this['targetPosition'],_0xf3b1d0);if(_0x35785c){this['_frustumFar']=Cesium__namespace['Cartesian3']['distance'](_0x504992,_0x35785c);const _0x297ab0=getHeadingPitchRollForLine(_0x504992,_0x35785c);this[_0x116e7c(0x41f)]=Cesium__namespace['Math'][_0x116e7c(0x9c5)](_0x297ab0['heading']),this['pitch']=Cesium__namespace['Math']['toDegrees'](_0x297ab0['pitch']),this['roll']=Cesium__namespace[_0x116e7c(_0x5dbc0d._0x115dad)]['toDegrees'](_0x297ab0[_0x116e7c(_0x5dbc0d._0x4c0958)]),this['_orientation']=Cesium__namespace['Transforms'][_0x116e7c(_0x5dbc0d._0x10c90e)](_0x504992,_0x297ab0);}else{this[_0x116e7c(_0x5dbc0d._0x5b5d7b)]=-this['style'][_0x116e7c(0xe1e)];const _0x538a64=new Cesium__namespace[(_0x116e7c(0x513))](Cesium__namespace[_0x116e7c(_0x5dbc0d._0x115dad)][_0x116e7c(_0x5dbc0d._0x52ab96)](this[_0x116e7c(0x41f)]),Cesium__namespace[_0x116e7c(0x7c0)]['toRadians'](this['pitch']),Cesium__namespace['Math']['toRadians'](this['roll']));this['_orientation']=Cesium__namespace['Transforms'][_0x116e7c(0x711)](_0x504992,_0x538a64);}this['_frustum']=new Cesium__namespace['PerspectiveFrustum']({'fov':Cesium__namespace[_0x116e7c(0x7c0)]['toRadians'](this['angle']*0x2||0.01),'aspectRatio':this['angle2']/this['angle'],'near':0.01,'far':this['_frustumFar']});}[_0x35a251(0x590)](_0x55d1c0){const _0x3fa198={_0x380629:0x79c,_0x2c6562:0x513},_0x4ff230=_0x35a251,_0x5b460c=getPositionValue(this['position'],_0x55d1c0),_0x4218b3=Cesium__namespace['Math']['toRadians'](this['heading']),_0x34d727=Cesium__namespace['Math']['toRadians'](this['pitch']+this['angle2']),_0x3c5132=Cesium__namespace['Math'][_0x4ff230(0x7ba)](this['pitch']-this[_0x4ff230(_0x3fa198._0x380629)]),_0x5212d5=Cesium__namespace['Math']['toRadians'](this['roll']+this[_0x4ff230(0x2c9)]),_0x29c8e4=Cesium__namespace['Math']['toRadians'](this['roll']-this[_0x4ff230(0x2c9)]),_0x128dd5=getRayEarthPosition(_0x5b460c,new Cesium__namespace['HeadingPitchRoll'](_0x4218b3,_0x34d727,_0x5212d5),!![]),_0x3254dd=getRayEarthPosition(_0x5b460c,new Cesium__namespace[(_0x4ff230(0x513))](_0x4218b3,_0x34d727,_0x29c8e4),!![]),_0x3e3ac5=getRayEarthPosition(_0x5b460c,new Cesium__namespace['HeadingPitchRoll'](_0x4218b3,_0x3c5132,_0x29c8e4),!![]),_0x1552e4=getRayEarthPosition(_0x5b460c,new Cesium__namespace[(_0x4ff230(_0x3fa198._0x2c6562))](_0x4218b3,_0x3c5132,_0x5212d5),!![]);return[_0x128dd5,_0x3254dd,_0x3e3ac5,_0x1552e4];}['_getDrawEntityClass'](_0x1dd784,_0x1599f4){const _0x303e9f={_0x1c85cc:0xbbe},_0x2af355=_0x35a251;return this[_0x2af355(_0x303e9f._0x1c85cc)](_0x1dd784,_0x1599f4);}}register$4('frustum',FrustumPrimitive,!![]);var ConeGlowCircleOuterMaterial='uniform\x20vec4\x20u_color;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20/\x2090.);\x0a\x20\x20vec2\x20new_st\x20=\x20fract(st\x20-\x20vec2(time,\x20time));\x0a\x20\x20vec4\x20color\x20=\x20texture(image,\x20new_st);\x0a\x0a\x20\x20vec3\x20diffuse\x20=\x20color.rgb;\x0a\x20\x20float\x20alpha\x20=\x20color.a;\x0a\x20\x20diffuse\x20*=\x20u_color.rgb;\x0a\x20\x20alpha\x20*=\x20u_color.a;\x0a\x20\x20alpha\x20*=\x20u_color.a;\x0a\x20\x20material.diffuse\x20=\x20diffuse;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20pow(1.\x20-\x20st.t,\x20u_color.a)\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ConeGlowCylinderGaussMaterial='uniform\x20vec4\x20u_color;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20powerRatio\x20=\x201.\x20/\x20(fract(czm_frameNumber\x20/\x2030.0)\x20+\x201.);\x0a\x20\x20float\x20alpha\x20=\x20pow(1.\x20-\x20st.t,\x20powerRatio);\x0a\x20\x20vec4\x20color\x20=\x20vec4(u_color.rgb,\x20alpha\x20*\x20u_color.a);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ConeGlowGradientMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec4\x20tColor\x20=\x20u_color;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20center\x20=\x20st\x20-\x20vec2(0.5,\x200.5);\x0a\x20\x20float\x20length\x20=\x20length(center)\x20/\x200.5;\x0a\x20\x20float\x20time\x20=\x201.\x20-\x20abs(czm_frameNumber\x20/\x20360.\x20-\x200.5);\x0a\x0a\x20\x20float\x20param\x20=\x201.\x20-\x20step(length,\x200.6);//大于0.6模糊,rate\x20=\x200.6\x0a\x20\x20float\x20scale\x20=\x20param\x20*\x20length;//\x200.6<\x20length\x20返回0,反之返回1.\x0a\x20\x20float\x20alpha\x20=\x20param\x20*\x20(1.0\x20-\x20abs(scale\x20-\x200.8)\x20/\x200.2);//\x200.8\x20<\x20length\x20返回0,反之返回1.\x0a\x0a\x20\x20float\x20param1\x20=\x20step(length,\x200.7);//小于0.5模糊\x0a\x20\x20float\x20scale1\x20=\x20param1\x20*\x20length;//\x200.6<\x20length\x20返回0,反之返回1.\x0a\x20\x20alpha\x20+=\x20param1\x20*\x20(1.0\x20-\x20abs(scale1\x20-\x200.35)\x20/\x200.35);//\x200.8\x20<\x20length\x20返回0,反之返回1.\x0a\x0a\x20\x20material.diffuse\x20=\x20u_color.rgb\x20*\x20vec3(u_color.a);\x0a\x20\x20material.alpha\x20=\x20pow(alpha,\x204.0)\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ConeGlowRingScanMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20center\x20=\x20st\x20-\x20vec2(0.5,\x200.5);\x0a\x20\x20float\x20time\x20=\x20-czm_frameNumber\x20*\x203.1415926\x20/\x20180.;//扫描速度1度\x0a\x20\x20float\x20sin_t\x20=\x20sin(time);\x0a\x20\x20float\x20cos_t\x20=\x20cos(time);\x0a\x20\x20vec2\x20center_rotate\x20=\x20vec2(center.s\x20*\x20cos_t\x20-\x20center.t\x20*\x20sin_t\x20+\x200.5,\x20center.s\x20*\x20sin_t\x20+\x20center.t\x20*\x20cos_t\x20+\x200.5);\x0a\x20\x20vec4\x20color\x20=\x20texture(image,\x20center_rotate);\x0a\x20\x20vec3\x20tColor\x20=\x20color.rgb\x20*\x20u_color.rgb;\x0a\x20\x20tColor\x20*=\x20u_color.a;\x0a\x20\x20material.diffuse\x20=\x20tColor;\x0a\x20\x20float\x20length\x20=\x202.\x20-\x20length(center)\x20/\x200.5;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20pow(length,\x200.5)\x20*\x20globalAlpha;//color.r\x20=\x200\x20或1\x0a\x20\x20return\x20material;\x0a}\x0a';const DEF_STYLE$g={'height':0x3e8,'radius':0x64,'color':'#00ffff'},particleImage=new Image();particleImage['src']=_0x35a251(0xe0b),particleImage['onload']=function(){};class LightCone extends BasePointPrimitive{constructor(_0xce2b58={}){const _0x2858a5={_0x1bd608:0xfc8},_0x45b0aa=_0x35a251;_0xce2b58['style']={...DEF_STYLE$g,..._0xce2b58[_0x45b0aa(_0x2858a5._0x1bd608)]||{}},super(_0xce2b58),this['_primitive1']=null,this['_primitive2']=null,this['_primitive3']=null,this['_primitive4']=null;}get['czmObject'](){return this['_primitive1'];}get['czmObjectEx'](){return this['_primitive2']?[this['_primitive2'],this['_primitive3'],this['_primitive4']]:[];}get['color'](){const _0x2b3765={_0x49a792:0x65f},_0xde38f7=_0x35a251;return this[_0xde38f7(_0x2b3765._0x49a792)];}set['color'](_0x5ee74a){const _0x4a3318={_0x21b2c9:0x9db},_0x47cf6e=_0x35a251;this['style'][_0x47cf6e(_0x4a3318._0x21b2c9)]=_0x5ee74a;}['_addedHook'](_0xee09c7){const _0x29ae85={_0x3320b4:0xba6,_0x4b5ef1:0x427,_0x3f3be8:0xa27},_0x406bf0=_0x35a251;if(!this['show']||!this['position'])return;let _0x130e34=this['position'];if(Cesium__namespace['defined'](_0xee09c7[_0x406bf0(0xdaa)])){let _0x3f9150=this[_0x406bf0(0xfc8)]['setHeight'];Cesium__namespace[_0x406bf0(0xaa2)](_0x3f9150)&&(isString(_0x3f9150)&&(_0x3f9150=Number(template(_0x3f9150,this[_0x406bf0(0x6b3)],!![])),isNaN(_0x3f9150)&&(_0x3f9150=0x0)),_0x130e34=setPositionsHeight(_0x130e34,_0x3f9150));const _0x5074e0=this[_0x406bf0(_0x29ae85._0x3320b4)]();_0x5074e0!==0x0&&(_0x130e34=addPositionsHeight(_0x130e34,_0x5074e0));}const _0x7b0fbc=_0xee09c7['radius'];this[_0x406bf0(0xb6)]=_0x7b0fbc/0x64,this['topRadius']=this['topRadius']>0x1?0x1:this['topRadius'],this['inner_controlPoints']=getCirclePosition(_0x130e34,_0x7b0fbc*0.7),this[_0x406bf0(_0x29ae85._0x4b5ef1)]=getCirclePosition(_0x130e34,_0x7b0fbc),this['circular_clone_topPoints']=getCirclePosition(_0x130e34,this[_0x406bf0(0xb6)]),this['circlePoints_2']=getCirclePosition(_0x130e34,_0x7b0fbc*0x2),this['ringCanvas']=this['drawRingCanvas'](),this['gradientCircleCanvas']=this['cirdrawGradientCircleCanvas'](),this['image']=this['drawCanvas'](particleImage),this[_0x406bf0(0x65f)]=getColorByStyle(_0xee09c7),this[_0x406bf0(0x632)](_0xee09c7),this[_0x406bf0(_0x29ae85._0x3f3be8)](_0xee09c7),this['addCircle'](_0xee09c7),this[_0x406bf0(0x6d4)](_0xee09c7);}['_removedHook'](){const _0x29f019={_0x61e8b0:0x1b7,_0x2da3d3:0x293,_0x2b1ba3:0x1ee,_0x5ab876:0xcfa},_0x38366b=_0x35a251;this[_0x38366b(_0x29f019._0x61e8b0)]&&(this['primitiveCollection']['remove'](this['_primitive1']),delete this['_primitive1']),this['_primitive2']&&(this['primitiveCollection']['remove'](this['_primitive2']),delete this['_primitive2']),this[_0x38366b(0x12a)]&&(this[_0x38366b(_0x29f019._0x2da3d3)][_0x38366b(_0x29f019._0x2b1ba3)](this['_primitive3']),delete this['_primitive3']),this['_primitive4']&&(this['primitiveCollection']['remove'](this[_0x38366b(_0x29f019._0x5ab876)]),delete this['_primitive4']);}['addInner'](_0x3e6415){const _0xde7a9f={_0x224982:0xa6a,_0x2ed499:0x4af},_0x123a58=_0x35a251,_0x1cca2b=createCylinderInstance(this['inner_controlPoints'],this[_0x123a58(_0xde7a9f._0x224982)],{'height':_0x3e6415['height'],'color':this['color'],'distanceDisplayCondition':_0x3e6415['distanceDisplayCondition']}),_0x888260=new Cesium__namespace['EllipsoidSurfaceAppearance']({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this[_0x123a58(0x65f)],'globalAlpha':0x1},'source':ConeGlowCylinderGaussMaterial},'translucent':function(_0x458e7a){return _0x458e7a['uniforms']['u_color']['alpha']<0x1;}})});this['_primitive1']=new Cesium__namespace['Primitive']({'geometryInstances':_0x1cca2b,'appearance':_0x888260,'asynchronous':![],'show':this['show']}),this['primitiveCollection'][_0x123a58(_0xde7a9f._0x2ed499)](this['_primitive1']);}['addOuter'](_0x4c0920){const _0x4218b6=_0x35a251,_0x31df91=createCylinderInstance(this['outer_controlPoints'],this[_0x4218b6(0xa6a)],{'height':_0x4c0920['height'],'distanceDisplayCondition':_0x4c0920['distanceDisplayCondition'],'color':new Cesium__namespace['Color'](0.5,0.8,0x1,0x2)});this['_primitive2']=new Cesium__namespace['Primitive']({'geometryInstances':_0x31df91,'appearance':new Cesium__namespace[(_0x4218b6(0x408))]({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this['_color'],'image':this['image'],'globalAlpha':0x1},'source':ConeGlowCircleOuterMaterial},'translucent':!![]})}),'asynchronous':![],'show':this['show']}),this[_0x4218b6(0x293)]['add'](this[_0x4218b6(0x81)]);}['addCircle'](_0x112f85){const _0x95a8ee={_0x1e96a0:0x293},_0x1ed80c=_0x35a251,_0x290961=Cesium__namespace['Cartographic']['fromCartesian'](this['position']),_0x49a672=createCircleInstance(this['circlePoints_2'],{'perPositionHeight':_0x290961['height']>=0x1,'distanceDisplayCondition':_0x112f85['distanceDisplayCondition']});this['_primitive3']=new Cesium__namespace[(_0x1ed80c(0x21c))]({'geometryInstances':_0x49a672,'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this['_color'],'image':this['gradientCircleCanvas'],'globalAlpha':0x1},'source':ConeGlowGradientMaterial},'translucent':!![]})}),'asynchronous':![],'show':this['show']}),this[_0x1ed80c(_0x95a8ee._0x1e96a0)]['add'](this['_primitive3']);}['addRing'](_0x536e2b){const _0x318187={_0x171de5:0x408,_0xc17a1f:0x293},_0x3a1ed6=_0x35a251,_0x59a4f9=createCircleInstance(this['circlePoints_2'],{'perPositionHeight':this[_0x3a1ed6(0x1ba)]['alt']>=0x1,'distanceDisplayCondition':_0x536e2b[_0x3a1ed6(0x393)]});this['_primitive4']=new Cesium__namespace['Primitive']({'geometryInstances':_0x59a4f9,'appearance':new Cesium__namespace[(_0x3a1ed6(_0x318187._0x171de5))]({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this['_color'],'image':this['ringCanvas'],'globalAlpha':0x1},'source':ConeGlowRingScanMaterial},'translucent':!![]})}),'asynchronous':![],'show':this['show']}),this[_0x3a1ed6(_0x318187._0xc17a1f)]['add'](this['_primitive4']);}[_0x35a251(0x93d)](_0x3540f7){const _0x2816a6={_0x141fbd:0xe0b},_0x48c125=_0x35a251,_0x25f961=new Image();_0x25f961['src']=_0x48c125(_0x2816a6._0x141fbd),_0x25f961['onload']=function(){_0x3540f7&&_0x3540f7();};}[_0x35a251(0xdb9)](_0x11bd7d){const _0x40645f={_0x3efaf6:0xf48},_0x3f38ee=_0x35a251,_0x15a406=document['createElement']('canvas');_0x15a406[_0x3f38ee(_0x40645f._0x3efaf6)]=0x40,_0x15a406['height']=0x100;const _0x35ddbb=_0x15a406[_0x3f38ee(0x5bf)]('2d',{'willReadFrequently':!![]});return _0x35ddbb['clearRect'](0x0,0x0,0x40,0x100),_0x35ddbb['drawImage'](_0x11bd7d,0x0,0x0),_0x35ddbb['drawImage'](_0x11bd7d,0x21,0x0),_0x15a406;}['drawRingCanvas'](){const _0x5d8d56={_0x53202a:0x682,_0x43c268:0x4b0,_0x2dc47a:0x125},_0x2ba97e=_0x35a251,_0x24a0da=document['createElement'](_0x2ba97e(0xee1));_0x24a0da['width']=0x200,_0x24a0da[_0x2ba97e(_0x5d8d56._0x53202a)]=0x200;const _0x3343a8=_0x24a0da['getContext']('2d',{'willReadFrequently':!![]});return _0x3343a8[_0x2ba97e(_0x5d8d56._0x43c268)]='rgba(255,255,255,0)',_0x3343a8['strokeStyle']='rgba(255,\x20255,\x20255,255)',_0x3343a8['setLineDash']([0x32,0x32]),_0x3343a8['lineWidth']=0x1e,_0x3343a8[_0x2ba97e(_0x5d8d56._0x2dc47a)](),_0x3343a8[_0x2ba97e(0x526)](0x100,0x100,0x96,0x0,Math['PI']*0x2,!![]),_0x3343a8[_0x2ba97e(0x184)](),_0x3343a8[_0x2ba97e(0x5f0)](),_0x24a0da;}[_0x35a251(0x853)](){const _0x1e280f={_0x420dd2:0x5bf,_0x3e644e:0x413,_0x3579bb:0xf5f,_0x27cfb4:0x5f0},_0x143d90=_0x35a251,_0x4de8cf=document[_0x143d90(0xd0f)]('canvas');_0x4de8cf[_0x143d90(0xf48)]=0x200,_0x4de8cf[_0x143d90(0x682)]=0x200;const _0x1c2aad=_0x4de8cf[_0x143d90(_0x1e280f._0x420dd2)]('2d',{'willReadFrequently':!![]}),_0x3b7669=_0x1c2aad['createRadialGradient'](0x100,0x100,0x0,0x100,0x100,0x100);return _0x3b7669[_0x143d90(0xf5f)](0.1,_0x143d90(0x54f)),_0x3b7669[_0x143d90(0xf5f)](0.2,_0x143d90(_0x1e280f._0x3e644e)),_0x3b7669['addColorStop'](0.3,'rgba(255,\x20255,\x20255,\x200.9)'),_0x3b7669['addColorStop'](0.5,'rgba(255,\x20255,\x20255,\x200.0)'),_0x3b7669['addColorStop'](0.9,'rgba(255,\x20255,\x20255,\x200.2)'),_0x3b7669[_0x143d90(_0x1e280f._0x3579bb)](0x1,'rgba(255,\x20255,\x20255,\x201.0)'),_0x1c2aad[_0x143d90(0x7f1)](0x0,0x0,0x200,0x200),_0x1c2aad[_0x143d90(0x125)](),_0x1c2aad['arc'](0x100,0x100,0x100,0x0,Math['PI']*0x2,!![]),_0x1c2aad['fillStyle']=_0x3b7669,_0x1c2aad['fill'](),_0x1c2aad[_0x143d90(_0x1e280f._0x27cfb4)](),_0x4de8cf;}[_0x35a251(0x45c)](_0x35b1e2){const _0x107cca={_0x45ebb6:0x2cf,_0x5054ba:0xf8,_0xd06970:0x2cf,_0x3ea770:0xf8},_0x4565e2=_0x35a251;this['style']['globalAlpha']=_0x35b1e2,this['_primitive1']&&(this['_primitive1']['appearance']['material']['uniforms'][_0x4565e2(0x2cf)]=_0x35b1e2,this['_primitive2']['appearance']['material']['uniforms'][_0x4565e2(_0x107cca._0x45ebb6)]=_0x35b1e2,this['_primitive3'][_0x4565e2(_0x107cca._0x5054ba)]['material']['uniforms'][_0x4565e2(_0x107cca._0xd06970)]=_0x35b1e2,this['_primitive4'][_0x4565e2(_0x107cca._0x3ea770)][_0x4565e2(0x27f)]['uniforms']['globalAlpha']=_0x35b1e2);}['_getDrawEntityClass'](_0x14dca8,_0x4a18bc){const _0x466bcc=_0x35a251;return this[_0x466bcc(0xbbe)](_0x14dca8,_0x4a18bc);}}register$4('lightCone',LightCone,!![]);function createCircleInstance(_0x5e2130,_0x2cc4b8){const _0xaae28f={_0x298653:0x4fa,_0x45795c:0x393},_0x2f4d6d=_0x35a251,_0x21caa8=new Cesium__namespace[(_0x2f4d6d(_0xaae28f._0x298653))]({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x5e2130),'perPositionHeight':_0x2cc4b8[_0x2f4d6d(0x94d)]});return new Cesium__namespace['GeometryInstance']({'geometry':_0x21caa8,'attributes':{'distanceDisplayCondition':_0x2cc4b8[_0x2f4d6d(_0xaae28f._0x45795c)]||new Cesium__namespace[(_0x2f4d6d(0xa0))]()}});}function createCylinderInstance(_0x376581,_0x393d33,_0x29d49f){const _0x3cae3d=_0x35a251,_0x97132=_0x29d49f[_0x3cae3d(0x682)],_0x4de7c9=_0x29d49f['color'],_0x5db642=_0x376581['slice'](),_0x3546c2=_0x376581['length'],_0x115f2a=0x2*_0x3546c2,_0x102028=[],_0x1ebc25=0x1/(_0x3546c2-0x1),_0x2bffa8=[],_0x3b2584=[];for(let _0x765cad=0x0;_0x765cad<_0x3546c2;_0x765cad++){_0x3b2584['push'](addPositionsHeight(_0x393d33[_0x765cad],_0x97132)),_0x102028[_0x3cae3d(0x6de)](_0x765cad*_0x1ebc25),_0x102028['push'](0x0);const _0x26d345=_0x765cad+0x1,_0x5ee215=(_0x765cad+0x1)%_0x3546c2,_0x4e16a8=_0x115f2a-_0x26d345;_0x2bffa8['push'](...[_0x4e16a8-0x1,_0x4e16a8,_0x765cad]),_0x2bffa8['push'](...[_0x765cad,_0x5ee215,_0x4e16a8-0x1]);}for(let _0x454ff5=0x0;_0x454ff5<_0x3b2584[_0x3cae3d(0xe1e)];_0x454ff5++){_0x5db642['push'](_0x3b2584[_0x3546c2-_0x454ff5-0x1]),_0x102028['push'](0x1-_0x454ff5*_0x1ebc25),_0x102028[_0x3cae3d(0x6de)](0x1);}let _0x5a1a80=new Cesium__namespace['PolygonGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x5db642),'perPositionHeight':!![]});return _0x5a1a80=Cesium__namespace[_0x3cae3d(0x4fa)]['createGeometry'](_0x5a1a80),_0x5a1a80['indices']=_0x2bffa8,_0x5a1a80['attributes']['st']['values']=_0x102028,new Cesium__namespace['GeometryInstance']({'geometry':_0x5a1a80,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x4de7c9),'distanceDisplayCondition':_0x29d49f['distanceDisplayCondition']||new Cesium__namespace['DistanceDisplayConditionGeometryInstanceAttribute']()}});}function getCirclePosition(_0x1ca773,_0x5ad038,_0x49bd6d=0x78){const _0x26df23={_0x913459:0x7e2,_0x2e4d99:0x6de},_0x1d80ec=_0x35a251,_0x19f8ea=[],_0x522b5d=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x1ca773),_0x419445=0x2*Math['PI']/_0x49bd6d,_0x165361=0x2*Math['PI']*0x10e/0x168;for(let _0x2cbb5c=0x0;_0x2cbb5c<_0x49bd6d;_0x2cbb5c++){const _0x1cfe63=_0x165361-_0x419445*_0x2cbb5c,_0x4aa822=new Cesium__namespace['Cartesian3'](Math['sin'](_0x1cfe63)*_0x5ad038,Math['cos'](_0x1cfe63)*_0x5ad038,0x0);_0x19f8ea['push'](Cesium__namespace['Matrix4'][_0x1d80ec(_0x26df23._0x913459)](_0x522b5d,_0x4aa822,new Cesium__namespace['Cartesian3']()));}return _0x19f8ea[_0x1d80ec(_0x26df23._0x2e4d99)](_0x19f8ea[0x0]),_0x19f8ea;}var WaterFS=_0x35a251(0xd1c);class Water extends PolygonPrimitive{['_addedHook'](_0xf5e844){const _0x3302bb={_0x1c7a2c:0xb35,_0x2eb5f4:0x32f,_0x1cdada:0x293,_0x1aa791:0x2d5},_0x3739ad=_0x35a251;if(!this['show']||!this['positions']||this[_0x3739ad(_0x3302bb._0x1c7a2c)]['length']===0x0)return;const _0x3503fa=this[_0x3739ad(0xbb)](_0xf5e844);_0x3503fa['vertexFormat']=Cesium__namespace['EllipsoidSurfaceAppearance']['VERTEX_FORMAT'],_0xf5e844['opacity']=_0xf5e844['opacity']??0.8;const _0x473946=_0xf5e844['opacity']*(_0xf5e844['globalAlpha']??0x1),_0x4d8037={'geometryInstances':this['_createGeometryInstance'](_0x3503fa),'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'aboveGround':![],'material':new Cesium__namespace['Material']({'fabric':{'type':'Water','uniforms':{'specularMap':_0x3503fa[_0x3739ad(_0x3302bb._0x2eb5f4)]||Cesium__namespace[_0x3739ad(0x100)]['DefaultImageId'],'normalMap':_0x3503fa['normalMap']||Cesium__namespace['Material']['DefaultImageId'],'frequency':_0x3503fa['frequency']||0x1f40,'animationSpeed':_0x3503fa['animationSpeed']||0.03,'amplitude':_0x3503fa['amplitude']||0x5,'specularIntensity':_0xf5e844['specularIntensity']||0.8,'baseWaterColor':getCesiumColor(_0xf5e844['baseWaterColor']||'#123e59')['withAlpha'](_0xf5e844['opacity']),'blendColor':getCesiumColor(_0xf5e844['blendColor']||'#123e59')['withAlpha'](_0xf5e844[_0x3739ad(0xbf2)])}}}),'fragmentShaderSource':WaterFS,'translucent':_0x473946!==0x1}),'show':this[_0x3739ad(0x987)]};_0xf5e844['clampToGround']?(_0x4d8037['classificationType']=_0xf5e844['classificationType']??Cesium__namespace['ClassificationType']['TERRAIN'],this[_0x3739ad(0x90a)]=this['primitiveCollection']['add'](new Cesium__namespace['GroundPrimitive'](_0x4d8037))):this['_primitive']=this[_0x3739ad(_0x3302bb._0x1cdada)]['add'](new Cesium__namespace['Primitive'](_0x4d8037));this['_primitive_outline']&&(this['primitiveCollection']['remove'](this['_primitive_outline']),delete this['_primitive_outline']);if(_0xf5e844['outline']){const _0x45c4d0=this['_getOutlineStyle'](_0xf5e844);this['_primitive_outline']=this[_0x3739ad(_0x3302bb._0x1aa791)](_0x45c4d0);}_0xf5e844['label']&&this['_addLabel']();}['_getDrawEntityClass'](_0x3c6f2c,_0x54651a){const _0x3882ff=_0x35a251;return _0x3c6f2c[_0x3882ff(0xfc8)]['materialType']='Water',create$4('polygon',_0x3c6f2c);}}register$4('water',Water);var DiffuseWallGlowVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec2\x20v_st;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec3\x20v_positionEC;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_translateRelativeToEye(position3DHigh,\x20position3DLow);\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',DiffuseWallGlowFS=_0x35a251(0x36b);const DEF_STYLE$f={'diffHeight':0x3e8,'speed':0xa,'maxScale':0x1};class DiffuseWall extends BasePolyPrimitive{constructor(_0x3c9972={}){const _0x5da89e={_0x411611:0x6a7,_0x185d4e:0xf32,_0x40797f:0xca8},_0xfd1230=_0x35a251;_0x3c9972['style']={...DEF_STYLE$f,..._0x3c9972['style']||{}},super(_0x3c9972);if(_0x3c9972[_0xfd1230(0xb35)])this[_0xfd1230(0x176)]=this['centerOfMass'];else _0x3c9972['position']&&(this['position']=_0x3c9972['position'],this['_isCircle']=!![]);this['_mScale']=Cesium__namespace[_0xfd1230(_0x5da89e._0x411611)][_0xfd1230(_0x5da89e._0x185d4e)](0x1),this['_maxScale']=_0x3c9972['style'][_0xfd1230(_0x5da89e._0x40797f)]||0x1;}get['czmObject'](){return this['_primitive'];}get['center'](){const _0x17b404={_0x234125:0xb82},_0x18e271=_0x35a251;return this[_0x18e271(_0x17b404._0x234125)];}set['center'](_0x1469d8){this['_center']=_0x1469d8;}get['position'](){return this['_center'];}set['position'](_0x3b2a07){const _0xc93d85={_0x4f8d28:0x8d0},_0x3f8d19=_0x35a251;this['_center']=LngLatPoint[_0x3f8d19(_0xc93d85._0x4f8d28)](_0x3b2a07)['toCartesian'](),this['_updatePositionsByCircleCenter']();}get['radius'](){const _0xd00ce3=_0x35a251;return this['style'][_0xd00ce3(0x907)];}set['radius'](_0x107aa7){this['style']['radius']=_0x107aa7,this['_updatePositionsByCircleCenter']();}[_0x35a251(0x97b)](_0x24a373){const _0x220efe={_0x354f01:0xda2,_0x4fd906:0x614,_0x3a2361:0x768,_0x478ed1:0x4af},_0x713ac5=_0x35a251,_0x5b725d=this['positions'];if(!this[_0x713ac5(0x987)]||!_0x5b725d||_0x5b725d['length']===0x0)return;const _0x3330ba=addPositionsHeight(this['positions'],_0x24a373['diffHeight']);this['center']=this[_0x713ac5(_0x220efe._0x354f01)];const _0x10ca23=[],_0x4826af=[],_0x1ab87f=[],_0x46182f=[];for(let _0x11f9b9=0x0,_0x95e158=_0x5b725d['length'];_0x11f9b9<_0x95e158;_0x11f9b9++){const _0x41ae01=(_0x11f9b9+0x1)%_0x95e158;_0x10ca23['push'](...[_0x5b725d[_0x11f9b9]['x'],_0x5b725d[_0x11f9b9]['y'],_0x5b725d[_0x11f9b9]['z']]),_0x10ca23['push'](...[_0x5b725d[_0x41ae01]['x'],_0x5b725d[_0x41ae01]['y'],_0x5b725d[_0x41ae01]['z']]),_0x10ca23[_0x713ac5(0x6de)](...[_0x3330ba[_0x41ae01]['x'],_0x3330ba[_0x41ae01]['y'],_0x3330ba[_0x41ae01]['z']]),_0x10ca23['push'](...[_0x3330ba[_0x11f9b9]['x'],_0x3330ba[_0x11f9b9]['y'],_0x3330ba[_0x11f9b9]['z']]),_0x46182f['push'](...[0x0,0x0,0x1]),_0x46182f['push'](...[0x0,0x0,0x1]),_0x46182f[_0x713ac5(0x6de)](...[0x0,0x0,0x1]),_0x46182f['push'](...[0x0,0x0,0x1]),_0x4826af['push'](...[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]);const _0x32c01c=_0x11f9b9*0x4,_0x1db63b=_0x32c01c+0x1,_0x50c641=_0x32c01c+0x2,_0x13badd=_0x32c01c+0x3;_0x1ab87f['push'](...[_0x50c641,_0x13badd,_0x32c01c,_0x32c01c,_0x1db63b,_0x50c641]);}const _0xdb76ad=new Float64Array(_0x10ca23),_0x553cc5=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x713ac5(_0x220efe._0x4fd906)][_0x713ac5(0x68e)],'componentsPerAttribute':0x3,'values':_0xdb76ad}),'normal':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x713ac5(0x614)]['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array(_0x46182f)}),'st':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(_0x4826af)})},'indices':new Uint16Array(_0x1ab87f),'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0xdb76ad)})}),_0x3b9696=getColorByStyle(_0x24a373);this['_primitive']=new Cesium__namespace['Primitive']({'geometryInstances':_0x553cc5,'appearance':new Cesium__namespace[(_0x713ac5(_0x220efe._0x3a2361))]({'material':new Cesium__namespace['Material']({'translucent':!![],'fabric':{'uniforms':{'color':_0x3b9696,'globalAlpha':0x1},'source':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20vec4\x20color;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20xh_getMaterial(vec2\x20st){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20alpha\x20=\x20pow(1.\x20-\x20st.t,\x201.5);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20colorNew\x20=\x20vec4(color.rgb\x20*\x20color.a,\x20alpha*globalAlpha);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20colorNew;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}'}}),'vertexShaderSource':DiffuseWallGlowVS,'fragmentShaderSource':DiffuseWallGlowFS}),'asynchronous':![],'shadows':this['style'][_0x713ac5(0x529)],'show':this['show']}),this['primitiveCollection'][_0x713ac5(_0x220efe._0x478ed1)](this['_primitive']),this['bindUpdateEvent']();}['_removedHook'](){const _0x2ab237={_0x4178b6:0x90a},_0x3485b2=_0x35a251;this[_0x3485b2(_0x2ab237._0x4178b6)]&&(this[_0x3485b2(0x293)][_0x3485b2(0x1ee)](this['_primitive']),delete this['_primitive']);}['update'](_0x5848c5){const _0x1c0347={_0x551ca9:0x90a,_0x56d884:0xb1f},_0x2aee41=_0x35a251;if(this['_primitive']&&this['_show']){const _0x3f689a=_0x5848c5['frameNumber']/0x3e8*this['style']['speed'];let _0x32fbf4=_0x3f689a-Math[_0x2aee41(0x6ba)](_0x3f689a);_0x32fbf4=_0x32fbf4<0.01?0.01:_0x32fbf4,this['_mScale'][0x0]=this['_mScale'][0x5]=_0x32fbf4*this['_maxScale'],this['_mScale'][0xa]=1.1-_0x32fbf4,this[_0x2aee41(_0x1c0347._0x551ca9)]['modelMatrix']=scaleXYZ(this[_0x2aee41(0x176)],this[_0x2aee41(_0x1c0347._0x56d884)]);}}['_updatePositionsByCircleCenter'](){const _0x108b7a={_0x4722ab:0xb82,_0x828a7f:0x907},_0x39a89d=_0x35a251;this['positions']=getEllipseOuterPositions({'position':this[_0x39a89d(_0x108b7a._0x4722ab)],'radius':this['style'][_0x39a89d(_0x108b7a._0x828a7f)]??0x64,'count':this['style']['count']??0x32});}[_0x35a251(0x4be)](_0x51c0a1,_0x1a5ffb){const _0x3139eb={_0x2ac747:0x261},_0x1654bf=_0x35a251;return this[_0x1654bf(_0x3139eb._0x2ac747)]?create$4('circle',_0x51c0a1):(_0x51c0a1['style']['closure']=!![],create$4('wall',_0x51c0a1));}['_updateStyleByEdit'](_0x39edb0){const _0x20b4f3=_0x35a251;this['_isCircle']&&Cesium__namespace['defined'](_0x39edb0['radius'])&&(this['radius']=_0x39edb0['radius']),Cesium__namespace['defined'](_0x39edb0[_0x20b4f3(0x4f7)])&&(this['style']['diffHeight']=_0x39edb0[_0x20b4f3(0x4f7)]);}}register$4('diffuseWall',DiffuseWall);function scaleXYZ(_0x3d43ce,_0x514f92){const _0x1c1538={_0x14caa8:0x49c,_0x2e0e79:0x6a7},_0xb67a33=_0x35a251,_0x177b7e=Cesium__namespace[_0xb67a33(_0x1c1538._0x14caa8)]['eastNorthUpToFixedFrame'](_0x3d43ce),_0x2d7964=Cesium__namespace['Matrix4']['inverse'](_0x177b7e,new Cesium__namespace['Matrix4']()),_0x3ca421=Cesium__namespace['Matrix4']['multiply'](_0x514f92,_0x2d7964,new Cesium__namespace['Matrix4']());return Cesium__namespace[_0xb67a33(_0x1c1538._0x2e0e79)]['multiply'](_0x177b7e,_0x3ca421,new Cesium__namespace[(_0xb67a33(0x6a7))]());}var ScrollWallGlowVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec2\x20v_st;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec3\x20v_positionEC;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_translateRelativeToEye(position3DHigh,\x20position3DLow);\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',ScrollWallGlowFS='in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a}\x0a',ScrollWallGlowMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20cmi)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(cmi);\x0a\x20\x20vec2\x20st\x20=\x20cmi.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0)\x20*\x20direction;\x0a\x20\x20vec2\x20st1\x20=\x20vec2(st.s,\x20fract(st.t\x20-\x20t));\x0a\x20\x20vec4\x20color\x20=\x20vec4(0.,\x200.,\x200.,\x200.);\x0a\x20\x20float\x20tt\x20=\x200.5\x20-\x20abs(0.5\x20-\x20st1.t);\x0a\x20\x20float\x20ss\x20=\x20st1.s;\x0a\x20\x20float\x20alpha\x20=\x20tt\x20*\x202.;\x0a\x20\x20color\x20=\x20vec4(u_color.rgb\x20*\x20u_color.a,\x20alpha\x20*\x201.2);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ScrollWallGlowMaterial2=_0x35a251(0x664);const DEF_STYLE$e={'diffHeight':0x64,'speed':0xa,'style':0x1};class ScrollWall extends BasePolyPrimitive{constructor(_0x100c7d={}){const _0x2c57eb={_0x5008f2:0xfc8},_0x5c1edc=_0x35a251;_0x100c7d[_0x5c1edc(_0x2c57eb._0x5008f2)]={...DEF_STYLE$e,..._0x100c7d['style']||{}},super(_0x100c7d);}get[_0x35a251(0x371)](){const _0xf843b6={_0x35ca5d:0x90a},_0x369e5e=_0x35a251;return this[_0x369e5e(_0xf843b6._0x35ca5d)];}[_0x35a251(0x97b)](_0x4a8cc1){const _0x3d6cec={_0x4d0c44:0x4f7,_0xe14d93:0x768,_0xbde787:0x100,_0x41244c:0x529},_0x5b1325=_0x35a251,_0x103e04=this['positions'];if(!this['show']||!_0x103e04||_0x103e04['length']===0x0)return;const _0x44e3d7=addPositionsHeight(_0x103e04,_0x4a8cc1[_0x5b1325(_0x3d6cec._0x4d0c44)]),_0x1d6980=[],_0x1d3408=[],_0x349f04=[],_0x22e40e=[];for(let _0x4ae76b=0x0,_0x1ca68e=_0x103e04['length'];_0x4ae76b<_0x1ca68e;_0x4ae76b++){let _0x37fccc=_0x4ae76b+0x1;_0x37fccc===_0x1ca68e&&(_0x37fccc=0x0);_0x1d6980['push'](...[_0x103e04[_0x4ae76b]['x'],_0x103e04[_0x4ae76b]['y'],_0x103e04[_0x4ae76b]['z']]),_0x1d6980['push'](...[_0x103e04[_0x37fccc]['x'],_0x103e04[_0x37fccc]['y'],_0x103e04[_0x37fccc]['z']]),_0x1d6980[_0x5b1325(0x6de)](...[_0x44e3d7[_0x37fccc]['x'],_0x44e3d7[_0x37fccc]['y'],_0x44e3d7[_0x37fccc]['z']]),_0x1d6980['push'](...[_0x44e3d7[_0x4ae76b]['x'],_0x44e3d7[_0x4ae76b]['y'],_0x44e3d7[_0x4ae76b]['z']]),_0x22e40e['push'](...[0x0,0x0,0x1]),_0x22e40e[_0x5b1325(0x6de)](...[0x0,0x0,0x1]),_0x22e40e['push'](...[0x0,0x0,0x1]),_0x22e40e['push'](...[0x0,0x0,0x1]),_0x1d3408['push'](...[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]);const _0x36df66=_0x4ae76b*0x4,_0xa4bd91=_0x36df66+0x1,_0x44e1b7=_0x36df66+0x2,_0x4a409a=_0x36df66+0x3;_0x349f04['push'](...[_0x36df66,_0xa4bd91,_0x44e1b7,_0x44e1b7,_0x4a409a,_0x36df66]);}const _0x5b5273=new Float64Array(_0x1d6980),_0x2e7405=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x5b1325(0x68e)],'componentsPerAttribute':0x3,'values':_0x5b5273}),'normal':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x5b1325(0x614)][_0x5b1325(0xf4e)],'componentsPerAttribute':0x3,'values':new Float32Array(_0x22e40e)}),'st':new Cesium__namespace[(_0x5b1325(0xdeb))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(_0x1d3408)})},'indices':new Uint16Array(_0x349f04),'primitiveType':Cesium__namespace[_0x5b1325(0x6c4)]['TRIANGLES'],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x5b5273)})}),_0x65a1a0=getColorByStyle(_0x4a8cc1),_0x3bb3fd=!![];this['_primitive']=new Cesium__namespace['Primitive']({'geometryInstances':_0x2e7405,'appearance':new Cesium__namespace[(_0x5b1325(_0x3d6cec._0xe14d93))]({'material':new Cesium__namespace[(_0x5b1325(_0x3d6cec._0xbde787))]({'translucent':_0x3bb3fd,'fabric':{'uniforms':{'u_color':_0x65a1a0,'speed':_0x4a8cc1['speed'],'direction':_0x4a8cc1['reverse']?0x1:-0x1,'globalAlpha':0x1},'source':this['createShader']()}}),'vertexShaderSource':ScrollWallGlowVS,'fragmentShaderSource':ScrollWallGlowFS}),'asynchronous':![],'shadows':_0x4a8cc1[_0x5b1325(_0x3d6cec._0x41244c)],'show':this['show']}),this['primitiveCollection']['add'](this['_primitive']);}[_0x35a251(0xa9a)](){const _0x222b5d={_0x1ed793:0x90a,_0x5d1ce2:0x90a},_0x475255=_0x35a251;this[_0x475255(_0x222b5d._0x1ed793)]&&(this['primitiveCollection']['remove'](this['_primitive']),delete this[_0x475255(_0x222b5d._0x5d1ce2)]);}[_0x35a251(0x294)](){return this['style']['style']===0x1?ScrollWallGlowMaterial:ScrollWallGlowMaterial2;}['_getDrawEntityClass'](_0x5788aa,_0x4d5eb0){return _0x5788aa['style']['closure']=!![],create$4('wall',_0x5788aa);}}register$4('scrollWall',ScrollWall);const Cartesian3$1=Cesium__namespace['Cartesian3'],defined$1=Cesium__namespace['defined'],CesiumMath$1=Cesium__namespace['Math'],Matrix3=Cesium__namespace['Matrix3'],PolylineVolumeGeometryLibrary=Cesium__namespace[_0x35a251(0x5cf)],Quaternion=Cesium__namespace['Quaternion'],ThickWallGeometryLibrary={},scratch1=new Cartesian3$1(),scratch2=new Cartesian3$1(),scratch3=new Cartesian3$1(),scratch4=new Cartesian3$1(),scaleArray2=[new Cartesian3$1(),new Cartesian3$1()],cartesian1=new Cartesian3$1(),cartesian2=new Cartesian3$1(),cartesian3=new Cartesian3$1(),cartesian4=new Cartesian3$1(),cartesian5=new Cartesian3$1(),cartesian6=new Cartesian3$1(),cartesian7=new Cartesian3$1(),cartesian8=new Cartesian3$1(),cartesian9=new Cartesian3$1(),cartesian10$1=new Cartesian3$1(),quaterion=new Quaternion(),rotMatrix=new Matrix3();function cartesian3ToArray(_0x4f53b6){const _0x18285c={_0x28d16f:0x6de},_0x115600=[];return _0x4f53b6['forEach'](_0x2f8ff2=>{const _0x14102e=_0x2767;_0x115600[_0x14102e(0x6de)](_0x2f8ff2['x']),_0x115600['push'](_0x2f8ff2['y']),_0x115600[_0x14102e(_0x18285c._0x28d16f)](_0x2f8ff2['z']);}),_0x115600;}function computeRoundCorner(_0x3d072d,_0x27dec5,_0x1a253c,_0x3ebbb9){const _0x141332={_0x572fa8:0xf7f},_0x5c3390=_0x35a251,_0xfa945d=Cartesian3$1['angleBetween'](Cartesian3$1['subtract'](_0x27dec5,_0x3d072d,scratch1),Cartesian3$1['subtract'](_0x1a253c,_0x3d072d,scratch2)),_0x2a48d7=0x1,_0x2f9e29=_0x2a48d7*0x3,_0x3ed310=new Array(_0x2f9e29);_0x3ed310[_0x2f9e29-0x3]=_0x1a253c['x'],_0x3ed310[_0x2f9e29-0x2]=_0x1a253c['y'],_0x3ed310[_0x2f9e29-0x1]=_0x1a253c['z'];let _0xfb3965;_0x3ebbb9?_0xfb3965=Matrix3[_0x5c3390(0x79d)](Quaternion['fromAxisAngle'](Cartesian3$1[_0x5c3390(0x33f)](_0x3d072d,scratch1),_0xfa945d/_0x2a48d7,quaterion),rotMatrix):_0xfb3965=Matrix3[_0x5c3390(0x79d)](Quaternion['fromAxisAngle'](_0x3d072d,_0xfa945d/_0x2a48d7,quaterion),rotMatrix);let _0x27b579=0x0;_0x27dec5=Cartesian3$1['clone'](_0x27dec5,scratch1);for(let _0x50d83d=0x0;_0x50d83d<_0x2a48d7;_0x50d83d++){_0x27dec5=Matrix3[_0x5c3390(_0x141332._0x572fa8)](_0xfb3965,_0x27dec5,_0x27dec5),_0x3ed310[_0x27b579++]=_0x27dec5['x'],_0x3ed310[_0x27b579++]=_0x27dec5['y'],_0x3ed310[_0x27b579++]=_0x27dec5['z'];}return _0x3ed310;}function addShiftedPositions(_0x160a0d,_0x2e3b94,_0x1a7217,_0x50279c){const _0x27cdcc={_0x41dde2:0xe1e},_0x1b1450=_0x35a251,_0xd68e21=new Array(_0x160a0d['length']),_0x5acda4=new Array(_0x160a0d[_0x1b1450(_0x27cdcc._0x41dde2)]),_0x2bc302=Cartesian3$1[_0x1b1450(0xddc)](_0x2e3b94,_0x1a7217,scratch1),_0x5ced5f=Cartesian3$1[_0x1b1450(0x33f)](_0x2bc302,scratch2);let _0x3197b1=0x0,_0x53a3aa=_0x160a0d[_0x1b1450(0xe1e)]-0x1;for(let _0x17a274=0x0;_0x17a274<_0x160a0d['length'];_0x17a274+=0x3){const _0x34032d=Cartesian3$1[_0x1b1450(0x96e)](_0x160a0d,_0x17a274,scratch3),_0x5879c0=Cartesian3$1['add'](_0x34032d,_0x5ced5f,scratch4);_0xd68e21[_0x3197b1++]=_0x5879c0['x'],_0xd68e21[_0x3197b1++]=_0x5879c0['y'],_0xd68e21[_0x3197b1++]=_0x5879c0['z'];const _0x559905=Cartesian3$1['add'](_0x34032d,_0x2bc302,scratch4);_0x5acda4[_0x53a3aa--]=_0x559905['z'],_0x5acda4[_0x53a3aa--]=_0x559905['y'],_0x5acda4[_0x53a3aa--]=_0x559905['x'];}return _0x50279c['push'](_0xd68e21,_0x5acda4),_0x50279c;}ThickWallGeometryLibrary['addAttribute']=function(_0x7becc1,_0x13ef2c,_0x304d9a,_0x1b9a10){const _0x4a6322=_0x13ef2c['x'],_0x5008e3=_0x13ef2c['y'],_0x47d07a=_0x13ef2c['z'];defined$1(_0x304d9a)&&(_0x7becc1[_0x304d9a]=_0x4a6322,_0x7becc1[_0x304d9a+0x1]=_0x5008e3,_0x7becc1[_0x304d9a+0x2]=_0x47d07a),defined$1(_0x1b9a10)&&(_0x7becc1[_0x1b9a10]=_0x47d07a,_0x7becc1[_0x1b9a10-0x1]=_0x5008e3,_0x7becc1[_0x1b9a10-0x2]=_0x4a6322);};const scratchForwardProjection=new Cartesian3$1(),scratchBackwardProjection=new Cartesian3$1();ThickWallGeometryLibrary['computePositions']=function(_0x3ea5a5){const _0xc98dee={_0x394382:0xddc,_0x30ec32:0xebd,_0x541c1b:0x4e9,_0x9fe8c1:0xebd,_0x3dffbe:0x1bf,_0x595bb5:0x4af,_0x5c3ff7:0xd61,_0x11a743:0xd61,_0x2abf93:0x6de,_0x25937e:0x5b8},_0x29d53b=_0x35a251,_0x4d54c5=_0x3ea5a5['positions'],_0x2b01a8=_0x3ea5a5['ellipsoid'],_0x13875b=_0x3ea5a5['width']/0x2;let _0x4036ae=cartesian1,_0x278431=cartesian2,_0x5bf664=cartesian3,_0xd9eaf8=cartesian4,_0x3a0ba4=cartesian5,_0x49d172=cartesian6,_0x1b7d04=cartesian7,_0x1e83ca=cartesian8,_0x7bf8ed=cartesian9,_0x2c8479=cartesian10$1,_0x523d5b=[],_0x6863c0=_0x4d54c5[0x0],_0x1f8f6d=_0x4d54c5[0x1];_0x278431=Cartesian3$1[_0x29d53b(0xebd)](Cartesian3$1['subtract'](_0x1f8f6d,_0x6863c0,_0x278431),_0x278431),_0x4036ae=_0x2b01a8['geodeticSurfaceNormal'](_0x6863c0,_0x4036ae),_0xd9eaf8=Cartesian3$1['normalize'](Cartesian3$1['cross'](_0x4036ae,_0x278431,_0xd9eaf8),_0xd9eaf8),_0x1b7d04=Cartesian3$1['clone'](_0x6863c0,_0x1b7d04),_0x6863c0=_0x1f8f6d,_0x5bf664=Cartesian3$1['negate'](_0x278431,_0x5bf664);let _0x2e43b7;const _0x1aaf10=[];let _0x115350;const _0x3e07b6=_0x4d54c5['length'];for(_0x115350=0x1;_0x115350<_0x3e07b6-0x1;_0x115350++){_0x4036ae=_0x2b01a8['geodeticSurfaceNormal'](_0x6863c0,_0x4036ae),_0x1f8f6d=_0x4d54c5[_0x115350+0x1],_0x278431=Cartesian3$1['normalize'](Cartesian3$1['subtract'](_0x1f8f6d,_0x6863c0,_0x278431),_0x278431),_0x3a0ba4=Cartesian3$1['normalize'](Cartesian3$1['add'](_0x278431,_0x5bf664,_0x3a0ba4),_0x3a0ba4);const _0x2b0917=Cartesian3$1[_0x29d53b(_0xc98dee._0x394382)](_0x4036ae,Cartesian3$1[_0x29d53b(0x50a)](_0x278431,_0x4036ae),scratchForwardProjection);Cartesian3$1[_0x29d53b(0xc61)](_0x278431,_0x2b0917,_0x2b0917),Cartesian3$1[_0x29d53b(0xebd)](_0x2b0917,_0x2b0917);const _0x3f0401=Cartesian3$1['multiplyByScalar'](_0x4036ae,Cartesian3$1['dot'](_0x5bf664,_0x4036ae),scratchBackwardProjection);Cartesian3$1['subtract'](_0x5bf664,_0x3f0401,_0x3f0401),Cartesian3$1[_0x29d53b(_0xc98dee._0x30ec32)](_0x3f0401,_0x3f0401);const _0x4e86ed=!CesiumMath$1[_0x29d53b(0x55d)](Math['abs'](Cartesian3$1['dot'](_0x2b0917,_0x3f0401)),0x1,CesiumMath$1['EPSILON7']);if(_0x4e86ed){_0x3a0ba4=Cartesian3$1['cross'](_0x3a0ba4,_0x4036ae,_0x3a0ba4),_0x3a0ba4=Cartesian3$1[_0x29d53b(_0xc98dee._0x541c1b)](_0x4036ae,_0x3a0ba4,_0x3a0ba4),_0x3a0ba4=Cartesian3$1[_0x29d53b(_0xc98dee._0x9fe8c1)](_0x3a0ba4,_0x3a0ba4);const _0x1577de=_0x13875b/Math['max'](0.25,Cartesian3$1['magnitude'](Cartesian3$1['cross'](_0x3a0ba4,_0x5bf664,scratch1))),_0x22d2ef=PolylineVolumeGeometryLibrary[_0x29d53b(_0xc98dee._0x3dffbe)](_0x278431,_0x5bf664,_0x6863c0,_0x2b01a8);_0x3a0ba4=Cartesian3$1['multiplyByScalar'](_0x3a0ba4,_0x1577de,_0x3a0ba4),_0x22d2ef?(_0x1e83ca=Cartesian3$1['add'](_0x6863c0,_0x3a0ba4,_0x1e83ca),_0x2c8479=Cartesian3$1['add'](_0x1e83ca,Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b,_0x2c8479),_0x2c8479),_0x7bf8ed=Cartesian3$1[_0x29d53b(0x4af)](_0x1e83ca,Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b*0x2,_0x7bf8ed),_0x7bf8ed),scaleArray2[0x0]=Cartesian3$1['clone'](_0x1b7d04,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1['clone'](_0x2c8479,scaleArray2[0x1]),_0x2e43b7=cartesian3ToArray(scaleArray2),_0x523d5b=addShiftedPositions(_0x2e43b7,_0xd9eaf8,_0x13875b,_0x523d5b),_0x49d172=Cartesian3$1['clone'](_0x7bf8ed,_0x49d172),_0xd9eaf8=Cartesian3$1['normalize'](Cartesian3$1['cross'](_0x4036ae,_0x278431,_0xd9eaf8),_0xd9eaf8),_0x7bf8ed=Cartesian3$1['add'](_0x1e83ca,Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b*0x2,_0x7bf8ed),_0x7bf8ed),_0x1b7d04=Cartesian3$1[_0x29d53b(_0xc98dee._0x595bb5)](_0x1e83ca,Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b,_0x1b7d04),_0x1b7d04),_0x1aaf10['push']({'leftPositions':computeRoundCorner(_0x1e83ca,_0x49d172,_0x7bf8ed,_0x22d2ef)})):(_0x7bf8ed=Cartesian3$1['add'](_0x6863c0,_0x3a0ba4,_0x7bf8ed),_0x2c8479=Cartesian3$1['add'](_0x7bf8ed,Cartesian3$1[_0x29d53b(0x33f)](Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b,_0x2c8479),_0x2c8479),_0x2c8479),_0x1e83ca=Cartesian3$1['add'](_0x7bf8ed,Cartesian3$1['negate'](Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b*0x2,_0x1e83ca),_0x1e83ca),_0x1e83ca),scaleArray2[0x0]=Cartesian3$1[_0x29d53b(_0xc98dee._0x5c3ff7)](_0x1b7d04,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1['clone'](_0x2c8479,scaleArray2[0x1]),_0x2e43b7=cartesian3ToArray(scaleArray2),_0x523d5b=addShiftedPositions(_0x2e43b7,_0xd9eaf8,_0x13875b,_0x523d5b),_0x49d172=Cartesian3$1[_0x29d53b(_0xc98dee._0x11a743)](_0x1e83ca,_0x49d172),_0xd9eaf8=Cartesian3$1['normalize'](Cartesian3$1[_0x29d53b(_0xc98dee._0x541c1b)](_0x4036ae,_0x278431,_0xd9eaf8),_0xd9eaf8),_0x1e83ca=Cartesian3$1['add'](_0x7bf8ed,Cartesian3$1[_0x29d53b(0x33f)](Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b*0x2,_0x1e83ca),_0x1e83ca),_0x1e83ca),_0x1b7d04=Cartesian3$1['add'](_0x7bf8ed,Cartesian3$1['negate'](Cartesian3$1['multiplyByScalar'](_0xd9eaf8,_0x13875b,_0x1b7d04),_0x1b7d04),_0x1b7d04),_0x1aaf10[_0x29d53b(_0xc98dee._0x2abf93)]({'rightPositions':computeRoundCorner(_0x7bf8ed,_0x49d172,_0x1e83ca,_0x22d2ef)})),_0x5bf664=Cartesian3$1['negate'](_0x278431,_0x5bf664);}_0x6863c0=_0x1f8f6d;}return _0x4036ae=_0x2b01a8[_0x29d53b(_0xc98dee._0x25937e)](_0x6863c0,_0x4036ae),scaleArray2[0x0]=Cartesian3$1['clone'](_0x1b7d04,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1['clone'](_0x6863c0,scaleArray2[0x1]),_0x2e43b7=cartesian3ToArray(scaleArray2),_0x523d5b=addShiftedPositions(_0x2e43b7,_0xd9eaf8,_0x13875b,_0x523d5b),{'positions':_0x523d5b,'corners':_0x1aaf10};};const BoundingSphere=Cesium__namespace['BoundingSphere'],Cartesian3=Cesium__namespace['Cartesian3'],Cartographic=Cesium__namespace[_0x35a251(0x120)],Check=Cesium__namespace['Check'],ComponentDatatype=Cesium__namespace[_0x35a251(0x614)],defaultValue=Cesium__namespace['defaultValue'],defined=Cesium__namespace['defined'],Ellipsoid=Cesium__namespace['Ellipsoid'],Geometry=Cesium__namespace['Geometry'],GeometryAttribute=Cesium__namespace['GeometryAttribute'],GeometryAttributes=Cesium__namespace['GeometryAttributes'],IndexDatatype=Cesium__namespace['IndexDatatype'],CesiumMath=Cesium__namespace['Math'],PrimitiveType=Cesium__namespace[_0x35a251(0x6c4)],VertexFormat=Cesium__namespace['VertexFormat'],CornerType=Cesium__namespace['CornerType'],cartesian10=new Cartesian3(),cartesian20=new Cartesian3(),cartesian30=new Cartesian3();function combine(_0x18e851,_0x59df6c){const _0x31fcbb={_0x4c98ad:0x14f,_0x439cba:0x613,_0x3d4c8e:0xe1e,_0x5c1a79:0x96e,_0x56289c:0x96e,_0xc35883:0xe1e},_0xd9966=_0x35a251,_0x31ae0f=_0x18e851['positions'],_0x420813=_0x18e851[_0xd9966(_0x31fcbb._0x4c98ad)],_0x28473e=new GeometryAttributes();let _0x426cb7,_0x3936dd=0x0,_0x4f4114=0x0,_0x4273cd,_0x1d5e6b=0x0,_0x3b45a7;for(_0x4273cd=0x0;_0x4273cd<_0x31ae0f['length'];_0x4273cd+=0x2){_0x3b45a7=_0x31ae0f[_0x4273cd]['length']-0x3,_0x3936dd+=_0x3b45a7,_0x1d5e6b+=_0x3b45a7*0x2,_0x4f4114+=_0x31ae0f[_0x4273cd+0x1]['length']-0x3;}_0x3936dd+=0x3,_0x4f4114+=0x3;for(_0x4273cd=0x0;_0x4273cd<_0x420813[_0xd9966(0xe1e)];_0x4273cd++){_0x426cb7=_0x420813[_0x4273cd];const _0x4ca572=_0x420813[_0x4273cd]['leftPositions'];defined(_0x4ca572)?(_0x3b45a7=_0x4ca572[_0xd9966(0xe1e)],_0x3936dd+=_0x3b45a7,_0x1d5e6b+=_0x3b45a7):(_0x3b45a7=_0x420813[_0x4273cd][_0xd9966(_0x31fcbb._0x439cba)]['length'],_0x4f4114+=_0x3b45a7,_0x1d5e6b+=_0x3b45a7);}const _0x38a28c=_0x3936dd+_0x4f4114,_0x3a578a=new Float64Array(_0x38a28c);let _0x8b6710=0x0,_0x2f424b=_0x38a28c-0x1,_0x4c5799,_0x28ad08,_0x55da4c,_0x2423da;const _0x2fd994=IndexDatatype['createTypedArray'](_0x38a28c/0x3,_0x1d5e6b);let _0x5406c7=0x0,_0x14d655=0x0,_0x43950f=_0x31ae0f[_0x14d655++],_0x18e1c2=_0x31ae0f[_0x14d655++];_0x3a578a['set'](_0x43950f,_0x8b6710),_0x3a578a['set'](_0x18e1c2,_0x2f424b-_0x18e1c2['length']+0x1),_0x3b45a7=_0x18e1c2['length']-0x3;for(_0x4273cd=0x0;_0x4273cd<_0x3b45a7;_0x4273cd+=0x3){_0x28ad08=_0x8b6710/0x3,_0x2423da=_0x28ad08+0x1,_0x4c5799=(_0x2f424b-0x2)/0x3,_0x55da4c=_0x4c5799-0x1,_0x2fd994[_0x5406c7++]=_0x4c5799,_0x2fd994[_0x5406c7++]=_0x28ad08,_0x2fd994[_0x5406c7++]=_0x55da4c,_0x2fd994[_0x5406c7++]=_0x55da4c,_0x2fd994[_0x5406c7++]=_0x28ad08,_0x2fd994[_0x5406c7++]=_0x2423da,_0x8b6710+=0x3,_0x2f424b-=0x3;}for(_0x4273cd=0x0;_0x4273cd<_0x420813[_0xd9966(_0x31fcbb._0x3d4c8e)];_0x4273cd++){let _0x28e734;_0x426cb7=_0x420813[_0x4273cd];const _0x4ddd74=_0x426cb7[_0xd9966(0xc50)],_0x1f2450=_0x426cb7['rightPositions'];let _0x4353cd,_0x23d34c,_0x4c4ae6=cartesian30,_0x5bfd18=cartesian10,_0x509264=cartesian20;if(defined(_0x4ddd74)){_0x2f424b-=0x3,_0x4353cd=_0x2423da,_0x23d34c=_0x55da4c;for(_0x28e734=0x0;_0x28e734<_0x4ddd74[_0xd9966(0xe1e)]/0x3;_0x28e734++){_0x4c4ae6=Cartesian3[_0xd9966(_0x31fcbb._0x5c1a79)](_0x4ddd74,_0x28e734*0x3,_0x4c4ae6),_0x2fd994[_0x5406c7++]=_0x4353cd,_0x2fd994[_0x5406c7++]=_0x23d34c-_0x28e734-0x1,_0x2fd994[_0x5406c7++]=_0x23d34c-_0x28e734,ThickWallGeometryLibrary['addAttribute'](_0x3a578a,_0x4c4ae6,undefined,_0x2f424b),_0x5bfd18=Cartesian3[_0xd9966(0x96e)](_0x3a578a,(_0x23d34c-_0x28e734-0x1)*0x3,_0x5bfd18),_0x509264=Cartesian3['fromArray'](_0x3a578a,_0x4353cd*0x3,_0x509264),_0x2f424b-=0x3;}_0x4c4ae6=Cartesian3[_0xd9966(_0x31fcbb._0x56289c)](_0x3a578a,_0x4353cd*0x3,_0x4c4ae6),_0x5bfd18=Cartesian3['subtract'](Cartesian3['fromArray'](_0x3a578a,_0x23d34c*0x3,_0x5bfd18),_0x4c4ae6,_0x5bfd18),_0x509264=Cartesian3['subtract'](Cartesian3['fromArray'](_0x3a578a,(_0x23d34c-_0x28e734)*0x3,_0x509264),_0x4c4ae6,_0x509264),_0x8b6710+=0x3;}else{_0x8b6710+=0x3,_0x4353cd=_0x55da4c,_0x23d34c=_0x2423da;for(_0x28e734=0x0;_0x28e734<_0x1f2450['length']/0x3;_0x28e734++){_0x4c4ae6=Cartesian3['fromArray'](_0x1f2450,_0x28e734*0x3,_0x4c4ae6),_0x2fd994[_0x5406c7++]=_0x4353cd,_0x2fd994[_0x5406c7++]=_0x23d34c+_0x28e734,_0x2fd994[_0x5406c7++]=_0x23d34c+_0x28e734+0x1,ThickWallGeometryLibrary['addAttribute'](_0x3a578a,_0x4c4ae6,_0x8b6710),_0x5bfd18=Cartesian3['fromArray'](_0x3a578a,_0x4353cd*0x3,_0x5bfd18),_0x509264=Cartesian3['fromArray'](_0x3a578a,(_0x23d34c+_0x28e734)*0x3,_0x509264),_0x8b6710+=0x3;}_0x4c4ae6=Cartesian3['fromArray'](_0x3a578a,_0x4353cd*0x3,_0x4c4ae6),_0x5bfd18=Cartesian3['subtract'](Cartesian3['fromArray'](_0x3a578a,(_0x23d34c+_0x28e734)*0x3,_0x5bfd18),_0x4c4ae6,_0x5bfd18),_0x509264=Cartesian3[_0xd9966(0xc61)](Cartesian3['fromArray'](_0x3a578a,_0x23d34c*0x3,_0x509264),_0x4c4ae6,_0x509264),_0x2f424b-=0x3;}_0x43950f=_0x31ae0f[_0x14d655++],_0x18e1c2=_0x31ae0f[_0x14d655++],_0x43950f['splice'](0x0,0x3),_0x18e1c2['splice'](_0x18e1c2[_0xd9966(_0x31fcbb._0xc35883)]-0x3,0x3),_0x3a578a[_0xd9966(0xcd3)](_0x43950f,_0x8b6710),_0x3a578a['set'](_0x18e1c2,_0x2f424b-_0x18e1c2[_0xd9966(0xe1e)]+0x1),_0x3b45a7=_0x18e1c2[_0xd9966(0xe1e)]-0x3;for(_0x28e734=0x0;_0x28e734<_0x18e1c2['length'];_0x28e734+=0x3){_0x2423da=_0x8b6710/0x3,_0x28ad08=_0x2423da-0x1,_0x55da4c=(_0x2f424b-0x2)/0x3,_0x4c5799=_0x55da4c+0x1,_0x2fd994[_0x5406c7++]=_0x4c5799,_0x2fd994[_0x5406c7++]=_0x28ad08,_0x2fd994[_0x5406c7++]=_0x55da4c,_0x2fd994[_0x5406c7++]=_0x55da4c,_0x2fd994[_0x5406c7++]=_0x28ad08,_0x2fd994[_0x5406c7++]=_0x2423da,_0x8b6710+=0x3,_0x2f424b-=0x3;}_0x8b6710-=0x3,_0x2f424b+=0x3;}_0x28473e['position']=new GeometryAttribute({'componentDatatype':ComponentDatatype['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x3a578a});if(_0x59df6c['st']){const _0x2e7eef=new Float32Array(_0x38a28c/0x3*0x2);let _0x47c617=0x0;_0x3936dd/=0x3,_0x4f4114/=0x3;const _0x232734=0x1/(_0x3936dd-0x1),_0x812d68=0x1/(_0x4f4114-0x1);for(_0x4273cd=0x0;_0x4273cd<_0x4f4114;_0x4273cd++){_0x2e7eef[_0x47c617++]=_0x4273cd*_0x812d68,_0x2e7eef[_0x47c617++]=0x0;}for(_0x4273cd=_0x3936dd;_0x4273cd>0x0;_0x4273cd--){_0x2e7eef[_0x47c617++]=(_0x4273cd-0x1)*_0x232734,_0x2e7eef[_0x47c617++]=0x1;}_0x28473e['st']=new GeometryAttribute({'componentDatatype':ComponentDatatype['FLOAT'],'componentsPerAttribute':0x2,'values':_0x2e7eef});}return{'attributes':_0x28473e,'indices':_0x2fd994};}function ThickWallGeometry(_0x51ed0d){const _0x450f0d={_0x53f071:0xaa2,_0x4f2f3e:0x58a,_0x5d86d7:0x3f4,_0x4aac5f:0x95e,_0x58fc20:0xd61,_0x4f2cd0:0x4ea},_0x20c6a8=_0x35a251;_0x51ed0d=defaultValue(_0x51ed0d,defaultValue['EMPTY_OBJECT']);const _0x36cd1c=_0x51ed0d[_0x20c6a8(0xb35)],_0x9515b5=_0x51ed0d['width'];Check[_0x20c6a8(0xaa2)]('options.positions',_0x36cd1c),Check[_0x20c6a8(_0x450f0d._0x53f071)]('options.width',_0x9515b5),this[_0x20c6a8(_0x450f0d._0x4f2f3e)]=_0x36cd1c,this['_ellipsoid']=Ellipsoid['clone'](defaultValue(_0x51ed0d[_0x20c6a8(_0x450f0d._0x5d86d7)],Ellipsoid['WGS84'])),this[_0x20c6a8(_0x450f0d._0x4aac5f)]=VertexFormat[_0x20c6a8(_0x450f0d._0x58fc20)](defaultValue(_0x51ed0d[_0x20c6a8(0xdbe)],VertexFormat['POSITION_AND_ST'])),this['_width']=_0x9515b5,this['_granularity']=defaultValue(_0x51ed0d[_0x20c6a8(_0x450f0d._0x4f2cd0)],CesiumMath['RADIANS_PER_DEGREE']);}ThickWallGeometry['createGeometry']=function(_0x4ea23f){const _0xd49955={_0x4c62f3:0x457,_0x2a33b1:0x457,_0x33f665:0x95e,_0x19f92d:0xe1e,_0x3f653a:0xe1e,_0x31e504:0x8eb,_0x20431a:0x9a1,_0x848357:0x55d},_0x56b145={_0xe78f85:0x175,_0x588692:0x580},_0x13dab2=_0x35a251,_0x4ff96d=_0x4ea23f[_0x13dab2(0x58a)],_0x482ef7=_0x4ea23f['_width'],_0x34d9de=_0x4ea23f['_ellipsoid'],_0x207d8c=_0x4ff96d[_0x13dab2(_0xd49955._0x4c62f3)](_0x3d1460=>Cartographic['fromCartesian'](_0x3d1460)),_0x11234a=_0x4ff96d[_0x13dab2(_0xd49955._0x2a33b1)](_0x46aa12=>_0x34d9de['scaleToGeodeticSurface'](_0x46aa12)),_0x3ecd63=_0x4ea23f[_0x13dab2(_0xd49955._0x33f665)],_0x76d87d={'ellipsoid':_0x34d9de,'positions':_0x11234a,'width':_0x482ef7,'cornerType':CornerType['BEVELED'],'granularity':_0x4ea23f['_granularity'],'saveAttributes':![]},_0x32ffe1=ThickWallGeometryLibrary['computePositions'](_0x76d87d),_0x3d1a09=[];let _0x2d8d88=[];const _0x351058=_0x32ffe1['positions'],_0x42dfd9=_0x351058[_0x13dab2(_0xd49955._0x19f92d)]/0x2;for(let _0x574891=0x0;_0x574891<_0x42dfd9;_0x574891++){const _0x1b5740=_0x207d8c[_0x574891],_0x3b79b1=_0x207d8c[_0x574891+0x1],_0x50f233=_0x351058[_0x574891*0x2],_0x440c81=_0x351058[_0x574891*0x2+0x1],_0x2c136d=_0x50f233['length']/0x3,_0x3f2c21=_0x440c81[_0x13dab2(_0xd49955._0x3f653a)]/0x3;for(let _0x44734b=0x0;_0x44734b<_0x2c136d;_0x44734b++){const _0x4206d2=new Cesium__namespace['Cartesian3'](_0x50f233[_0x44734b*0x3],_0x50f233[_0x44734b*0x3+0x1],_0x50f233[_0x44734b*0x3+0x2]),_0x7f7333=Cartographic[_0x13dab2(0x9b1)](_0x4206d2);let _0x377570;_0x44734b===0x0?_0x377570=Cartesian3['fromRadians'](_0x7f7333['longitude'],_0x7f7333['latitude'],_0x1b5740['height']):_0x377570=Cartesian3['fromRadians'](_0x7f7333['longitude'],_0x7f7333['latitude'],_0x3b79b1[_0x13dab2(0x682)]),_0x3d1a09[_0x13dab2(0x6de)](_0x377570),_0x50f233[_0x44734b*0x3]=_0x377570['x'],_0x50f233[_0x44734b*0x3+0x1]=_0x377570['y'],_0x50f233[_0x44734b*0x3+0x2]=_0x377570['z'];}const _0x1dd633=[];for(let _0x34ceff=0x0;_0x34ceff<_0x3f2c21;_0x34ceff++){const _0x4fb00d=new Cesium__namespace[(_0x13dab2(_0xd49955._0x31e504))](_0x440c81[_0x34ceff*0x3],_0x440c81[_0x34ceff*0x3+0x1],_0x440c81[_0x34ceff*0x3+0x2]),_0x2f1961=Cartographic['fromCartesian'](_0x4fb00d);let _0x9e129f;_0x34ceff===0x0?_0x9e129f=Cartesian3[_0x13dab2(0x175)](_0x2f1961['longitude'],_0x2f1961['latitude'],_0x3b79b1[_0x13dab2(0x682)]):_0x9e129f=Cartesian3['fromRadians'](_0x2f1961['longitude'],_0x2f1961[_0x13dab2(0x580)],_0x1b5740['height']),_0x1dd633['push'](_0x9e129f),_0x440c81[_0x34ceff*0x3]=_0x9e129f['x'],_0x440c81[_0x34ceff*0x3+0x1]=_0x9e129f['y'],_0x440c81[_0x34ceff*0x3+0x2]=_0x9e129f['z'];}_0x2d8d88['push'](..._0x1dd633['reverse']());}_0x32ffe1['corners']['forEach']((_0x5b8aea,_0x2b796f)=>{const _0xea467f=_0x13dab2;let _0x4da639;defined(_0x5b8aea[_0xea467f(0x613)])?_0x4da639=_0x5b8aea[_0xea467f(0x613)]:_0x4da639=_0x5b8aea['leftPositions'];const _0x452990=new Cesium__namespace['Cartesian3'](_0x4da639[0x0],_0x4da639[0x1],_0x4da639[0x2]),_0x5849d9=Cartographic['fromCartesian'](_0x452990),_0x2f9468=_0x4ff96d[_0x2b796f+0x1],_0x445bf9=Cartographic['fromCartesian'](_0x2f9468),_0x3ff371=Cartesian3[_0xea467f(_0x56b145._0xe78f85)](_0x5849d9['longitude'],_0x5849d9[_0xea467f(_0x56b145._0x588692)],_0x445bf9['height']);_0x4da639[0x0]=_0x3ff371['x'],_0x4da639[0x1]=_0x3ff371['y'],_0x4da639[0x2]=_0x3ff371['z'];});const _0x189cc1=combine(_0x32ffe1,_0x3ecd63),_0x82689c=_0x189cc1['attributes'],_0x4c64f6=BoundingSphere['fromVertices'](_0x82689c['position'][_0x13dab2(0xea3)],undefined,0x3);return _0x2d8d88=Cesium__namespace[_0x13dab2(_0xd49955._0x20431a)](_0x2d8d88,Cartesian3[_0x13dab2(_0xd49955._0x848357)]),{'geometry':new Geometry({'attributes':_0x82689c,'indices':_0x189cc1['indices'],'primitiveType':PrimitiveType['TRIANGLES'],'boundingSphere':_0x4c64f6}),'rightPoints':_0x2d8d88,'leftPoints':_0x3d1a09};};const DEF_STYLE$d={'diffHeight':0x64,'bottomHeight':0x0,'width':0xa,'flat':!![]};class ThickWall extends BasePolyPrimitive{constructor(_0xa4e7fd={}){const _0x640e35=_0x35a251;_0xa4e7fd['style']={...DEF_STYLE$d,..._0xa4e7fd[_0x640e35(0xfc8)]||{}},super(_0xa4e7fd);}get[_0x35a251(0x371)](){const _0x29ce74={_0x48fe6e:0x90a},_0x2460ba=_0x35a251;return this[_0x2460ba(_0x29ce74._0x48fe6e)];}['_createGeometryInstance'](_0x386868,_0x3d888e){const _0x47460a={_0x4591ae:0x6de,_0x3193c5:0x75c,_0x183df4:0xb3a,_0x483002:0x291},_0x3ef4d2={_0x1be64c:0x120,_0x410cfa:0xc26},_0x3be682=_0x35a251,_0x29f6fb=[],_0x56eb19=[],_0x294976=[];this['positions'][_0x3be682(0xdbd)](_0x35b026=>{const _0x2fd4e5=_0x3be682,_0x106157=Cesium__namespace[_0x2fd4e5(_0x3ef4d2._0x1be64c)]['fromCartesian'](_0x35b026);_0x56eb19['push'](Cesium__namespace['Cartesian3']['fromRadians'](_0x106157['longitude'],_0x106157['latitude'],_0x106157['height']+_0x386868['diffHeight'])),_0x294976['push'](Cesium__namespace[_0x2fd4e5(0x8eb)]['fromRadians'](_0x106157[_0x2fd4e5(_0x3ef4d2._0x410cfa)],_0x106157['latitude'],_0x106157['height']-_0x386868['bottomHeight']));});_0x386868['closure']&&(_0x56eb19['push'](_0x56eb19[0x0]),_0x294976['push'](_0x294976[0x0]));const _0x2b9775=ThickWallGeometry['createGeometry'](new ThickWallGeometry({'positions':_0x56eb19,'width':_0x386868['width']})),_0x489da1=ThickWallGeometry['createGeometry'](new ThickWallGeometry({'positions':_0x294976,'width':_0x386868['width']})),_0x45863f=new Cesium__namespace['GeometryInstance']({'geometry':_0x2b9775['geometry']}),_0x16bd08=new Cesium__namespace['GeometryInstance']({'geometry':_0x489da1['geometry']});_0x29f6fb['push'](_0x45863f),_0x29f6fb[_0x3be682(_0x47460a._0x4591ae)](_0x16bd08);const _0x4579f7=[],_0x4c5d20=[];_0x489da1['leftPoints']['forEach'](_0x189b57=>{const _0x38e926=Cesium__namespace['Cartographic']['fromCartesian'](_0x189b57);_0x4579f7['push'](_0x38e926['height']);}),_0x489da1['rightPoints']['forEach'](_0x2906d0=>{const _0x54365c=_0x3be682,_0x52cdaf=Cesium__namespace['Cartographic']['fromCartesian'](_0x2906d0);_0x4c5d20[_0x54365c(0x6de)](_0x52cdaf['height']);});const _0x438844=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['WallGeometry']({'positions':_0x2b9775['leftPoints'],'minimumHeights':_0x4579f7,'vertexFormat':Cesium__namespace['MaterialAppearance'][_0x3be682(0x267)]['TEXTURED']['vertexFormat']})}),_0x5ef55d=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['WallGeometry']({'positions':_0x2b9775['rightPoints'],'minimumHeights':_0x4c5d20,'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport'][_0x3be682(_0x47460a._0x3193c5)]['vertexFormat']})});_0x29f6fb['push'](_0x438844),_0x29f6fb['push'](_0x5ef55d);if(!_0x386868[_0x3be682(_0x47460a._0x183df4)]){const _0x54b8d6=Cesium__namespace['Cartographic']['fromCartesian'](_0x489da1['leftPoints'][0x0])['height'],_0x5a4489=new Cesium__namespace[(_0x3be682(_0x47460a._0x483002))]({'geometry':new Cesium__namespace['WallGeometry']({'positions':[_0x2b9775['leftPoints'][0x0],_0x2b9775[_0x3be682(0xad9)][0x0]],'minimumHeights':[_0x54b8d6,_0x54b8d6],'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport']['TEXTURED']['vertexFormat']})}),_0x47ff94=Cesium__namespace['Cartographic']['fromCartesian'](_0x489da1[_0x3be682(0xe96)][_0x489da1['leftPoints']['length']-0x1])['height'],_0x172fc8=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['WallGeometry']({'positions':[_0x2b9775[_0x3be682(0xe96)][_0x2b9775['leftPoints'][_0x3be682(0xe1e)]-0x1],_0x2b9775['rightPoints'][_0x2b9775['rightPoints']['length']-0x1]],'minimumHeights':[_0x47ff94,_0x47ff94],'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport']['TEXTURED']['vertexFormat']})});_0x29f6fb['push'](_0x5a4489),_0x29f6fb[_0x3be682(_0x47460a._0x4591ae)](_0x172fc8);}return _0x29f6fb;}['_createAppearance'](_0x99c5dd,_0x32c289,_0x390694){return new Cesium__namespace['MaterialAppearance']({..._0x99c5dd});}['_conversionStyle'](_0x1d1ed7){return WallStyleConver['toCesiumVal'](_0x1d1ed7);}['_style2Json'](_0x402359,_0x3fc264){return WallStyleConver['toJSON'](_0x402359,_0x3fc264);}[_0x35a251(0x9d4)](_0x530086){const _0x2b80a1={_0x3749a5:0xaa2},_0x5c426f=_0x35a251;this['_isCircle']&&Cesium__namespace[_0x5c426f(_0x2b80a1._0x3749a5)](_0x530086['radius'])&&(this['radius']=_0x530086['radius']),Cesium__namespace['defined'](_0x530086['diffHeight'])&&(this['style'][_0x5c426f(0x4f7)]=_0x530086['diffHeight']);}[_0x35a251(0x4be)](_0x4eb278,_0x1b9ae3){return create$4('wall',_0x4eb278);}}register$4(_0x35a251(0xb66),ThickWall);var DynamicRiverFS='in\x20vec3\x20v_positionMC;\x0ain\x20vec3\x20v_positionEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(czm_normal3D\x20*\x20czm_geodeticSurfaceNormal(v_positionMC,\x20vec3(0.0),\x20vec3(1.0)));\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x0a\x20\x20materialInput.s\x20=\x20v_st.s;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x20\x20materialInput.str\x20=\x20vec3(v_st,\x200.0);\x0a\x0a\x20\x20\x20\x20//\x20Convert\x20tangent\x20space\x20material\x20normal\x20to\x20eye\x20space\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.tangentToEyeMatrix\x20=\x20czm_eastNorthUpToEyeCoordinates(v_positionMC,\x20materialInput.normalEC);\x0a\x0a\x20\x20\x20\x20//\x20Convert\x20view\x20vector\x20to\x20world\x20space\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20\x20\x20#endif\x0a}\x0a',DynamicRiverVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0a\x0aout\x20vec3\x20v_positionMC;\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x0a\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20model\x20coordinates\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',DynamicRiverMaterial=_0x35a251(0xa14);const DEF_STYLE$c={'opacity':0.5,'width':0xa,'height':0x0,'speed':0xa,'axisY':![],'move':!![],'direction':!![],'moveVar':new Cesium__namespace['Cartesian3'](0x32,0x1,0x64)};class DynamicRiver extends BasePolyPrimitive{constructor(_0x5c4132={}){_0x5c4132['style']={...DEF_STYLE$c,..._0x5c4132['style']||{}},super(_0x5c4132);}get['czmObject'](){return this['_primitive'];}get[_0x35a251(0xdb2)](){return this['style']['image'];}set[_0x35a251(0xdb2)](_0xad2949){this['style']['image']=_0xad2949,this['_material']['uniforms']['image']=_0xad2949;}get['width'](){return this['style']['width'];}set['width'](_0x5d922e){_0x5d922e=Number(_0x5d922e)||0x1,this['style']['width']=_0x5d922e,this['redraw'](this['style']);}get[_0x35a251(0x682)](){const _0x2f998b={_0xf30ef3:0x682},_0x1cb53e=_0x35a251;return this['style'][_0x1cb53e(_0x2f998b._0xf30ef3)];}set[_0x35a251(0x682)](_0x405fc5){const _0x13cb20={_0x4e62bc:0xaf9},_0x1493e3=_0x35a251;this['style'][_0x1493e3(0x682)]=_0x405fc5,this[_0x1493e3(_0x13cb20._0x4e62bc)](this['style']);}get[_0x35a251(0xbf2)](){return this['style']['opacity'];}set[_0x35a251(0xbf2)](_0x26d828){const _0x2e6bf1={_0x1d1931:0xfc8,_0xcd41e8:0xbf2},_0x2998b5=_0x35a251;this[_0x2998b5(_0x2e6bf1._0x1d1931)][_0x2998b5(_0x2e6bf1._0xcd41e8)]=Number(_0x26d828),this['_material']['uniforms']['opacity']=_0x26d828;}get['direction'](){const _0x3e6f0b={_0x2322aa:0x79b},_0x3478e0=_0x35a251;return this['style'][_0x3478e0(_0x3e6f0b._0x2322aa)];}set['direction'](_0x3a8ada){const _0x5791b0={_0x51b64d:0x79b},_0x4090c5=_0x35a251;_0x3a8ada=Boolean(_0x3a8ada),this[_0x4090c5(0xfc8)]['direction']=_0x3a8ada,this['_material']['uniforms'][_0x4090c5(_0x5791b0._0x51b64d)]=_0x3a8ada?-0x1:0x1;}get[_0x35a251(0x6a2)](){return this['style']['speed'];}set['speed'](_0xed977d){_0xed977d=Number(_0xed977d)||0x1,this['style']['speed']=_0xed977d,this['_material']['uniforms']['speed']=_0xed977d;}get[_0x35a251(0xba2)](){const _0x24bef1={_0x4e95c1:0xba2},_0x2e955e=_0x35a251;return this['style'][_0x2e955e(_0x24bef1._0x4e95c1)];}set['move'](_0xe7d25d){const _0x592ecf={_0xb2f7d6:0x8db,_0x2d9639:0xba2},_0xb0781c=_0x35a251;_0xe7d25d=Boolean(_0xe7d25d),this['style']['move']=_0xe7d25d,this[_0xb0781c(_0x592ecf._0xb2f7d6)]['uniforms'][_0xb0781c(_0x592ecf._0x2d9639)]=_0xe7d25d;}get['axisY'](){return this['style']['axisY'];}set['axisY'](_0x948e2d){const _0x2a7e9d={_0x33478c:0xc13},_0x23e33e=_0x35a251;_0x948e2d=Boolean(_0x948e2d),this['style']['axisY']=_0x948e2d,this[_0x23e33e(0x8db)]['uniforms'][_0x23e33e(_0x2a7e9d._0x33478c)]=_0x948e2d;}get[_0x35a251(0x3e8)](){return this['style']['moveVar'];}set[_0x35a251(0x3e8)](_0x50094f){const _0x3a767b=_0x35a251;this['style']['moveVar']=_0x50094f,this[_0x3a767b(0x8db)]['uniforms']['moveVar']=_0x50094f;}['_addedHook'](_0x4785da){const _0x41b80a={_0x14541f:0x987,_0x2b3c00:0xe1e},_0x3ad987=_0x35a251;if(!this[_0x3ad987(_0x41b80a._0x14541f)]||!this['positions']||this['positions'][_0x3ad987(_0x41b80a._0x2b3c00)]===0x0)return;this['_sideRes']=Lines2Plane(this['positions'],this['width'],this[_0x3ad987(0x682)]);if(!this['_sideRes'])return;this['_primitive']=this['createPrimitive'](),this['primitiveCollection'][_0x3ad987(0x4af)](this['_primitive']);}[_0x35a251(0xa9a)](){const _0x1a059b={_0x3c97a5:0xd79,_0x1feb03:0xa63},_0x345109=_0x35a251;this['dhEvent']&&(this[_0x345109(_0x1a059b._0x3c97a5)][_0x345109(0x6b2)](EventType[_0x345109(0xf05)],this['dhEvent'],this),delete this['dhEvent']),this['_primitive']&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']),this['_material']&&(this['_material'][_0x345109(_0x1a059b._0x1feb03)](),delete this['_material']);}['_updateStyleHook'](_0xadfcb0,_0x2b6dc9){const _0x55f03d={_0x162b55:0xc13},_0x21888b=_0x35a251;let _0x437b19=![];for(const _0x216470 in _0x2b6dc9){switch(_0x216470){case'image':case'opacity':case'moveVar':case'direction':case _0x21888b(0x6a2):case _0x21888b(_0x55f03d._0x162b55):case _0x21888b(0x2cf):this[_0x21888b(0x8db)][_0x21888b(0xa8b)][_0x216470]=_0x2b6dc9[_0x216470];break;default:_0x437b19=!![];break;}}_0x437b19&&this[_0x21888b(0xaf9)](_0xadfcb0);}['createPrimitive'](){const _0x57a87e={_0x5027d2:0xf4e,_0x41b43e:0x6c4,_0x14b33d:0xd67,_0x4a1330:0x3e8},_0x156fcd=_0x35a251,_0x6f99c8=this['_sideRes'],_0x117242=new Float64Array(_0x6f99c8['vertexs']),_0x4f5912=new Cesium__namespace['GeometryAttributes']();_0x4f5912['position']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x117242}),_0x4f5912['st']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x156fcd(_0x57a87e._0x5027d2)],'componentsPerAttribute':0x2,'values':_0x6f99c8['uvs']});const _0x5ed4da=new Cesium__namespace['Geometry']({'attributes':_0x4f5912,'indices':_0x6f99c8['indexs'],'primitiveType':Cesium__namespace[_0x156fcd(_0x57a87e._0x41b43e)]['TRIANGLES'],'boundingSphere':Cesium__namespace[_0x156fcd(0x2ed)][_0x156fcd(_0x57a87e._0x14b33d)](_0x117242)}),_0x5c8248=new Cesium__namespace[(_0x156fcd(0x291))]({'id':this['id'],'geometry':_0x5ed4da}),_0x2b6d1a=new Cesium__namespace['RenderState']();_0x2b6d1a['depthTest']['enabled']=!![],this[_0x156fcd(0x8db)]=createMaterial(MaterialType,{'image':this['image'],'opacity':this['opacity'],'moveVar':this[_0x156fcd(_0x57a87e._0x4a1330)],'direction':this['direction']?-0x1:0x1,'speed':this['speed'],'move':this['move'],'axisY':this['axisY'],'globalAlpha':0x1});const _0x19b76d=new Cesium__namespace[(_0x156fcd(0x21c))]({'geometryInstances':_0x5c8248,'appearance':new Cesium__namespace['Appearance']({'material':this['_material'],'renderState':_0x2b6d1a,'vertexShaderSource':DynamicRiverVS,'fragmentShaderSource':DynamicRiverFS})});return _0x19b76d;}['offsetHeight'](_0x531f2a,_0x31fe01){const _0x3554bf={_0x107ab8:0x72e},_0x145b5f=_0x35a251;if(!_0x531f2a||!_0x31fe01||!this['_primitive'])return;let _0x3e96fe=0x0;const _0x26a78f=0x14,_0x14a837=_0x531f2a/(_0x31fe01*_0x26a78f),_0x5cf88b=this['_sideRes']['self'],_0x563368=new Cesium__namespace['Cartesian3']();for(let _0x2c5ded=0x0,_0x4bb347=_0x5cf88b['length'];_0x2c5ded<_0x4bb347;_0x2c5ded++){const _0x38ffc7=Cesium__namespace['Cartesian3']['normalize'](_0x5cf88b[_0x2c5ded],new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3']['add'](_0x563368,_0x38ffc7,_0x563368);}Cesium__namespace['Cartesian3'][_0x145b5f(0xebd)](_0x563368,_0x563368);const _0x2f2254=Cesium__namespace[_0x145b5f(0xd61)](this['_primitive'][_0x145b5f(0x8a0)]);this['dhEvent']=function(){const _0x30ea57=_0x145b5f;if(!this[_0x30ea57(0x90a)]||!this['_map'])return;if(Math[_0x30ea57(0x405)](_0x3e96fe)<=Math['abs'](_0x531f2a)){const _0x287ec6=Cesium__namespace['Cartesian3'][_0x30ea57(0xddc)](_0x563368,_0x3e96fe,new Cesium__namespace['Cartesian3']());this['_primitive']['modelMatrix']=Cesium__namespace['Matrix4']['multiplyByTranslation'](_0x2f2254,_0x287ec6,new Cesium__namespace[(_0x30ea57(0x6a7))]());}else this['dhEvent']&&(this['_map']['off'](EventType['clockTick'],this[_0x30ea57(_0x3554bf._0x107ab8)],this),delete this['dhEvent']);_0x3e96fe+=_0x14a837;},this['_map']['on'](EventType['clockTick'],this[_0x145b5f(0x72e)],this);}['setOpacity'](_0x578796){const _0x5456c7={_0x4eb5c0:0xfc8},_0x7ec05a=_0x35a251;this[_0x7ec05a(_0x5456c7._0x4eb5c0)]['globalAlpha']=_0x578796,this['_material']&&(this['_material']['uniforms']['globalAlpha']=_0x578796);}['_getDrawEntityClass'](_0x406213,_0x391b46){const _0x3f898e={_0x195fc4:0xfc8},_0xa3757a=_0x35a251;return _0x406213[_0xa3757a(_0x3f898e._0x195fc4)][_0xa3757a(0xf48)]=0x5,create$4('polyline',_0x406213);}}register$4('dynamicRiver',DynamicRiver);const MaterialType='DynamicRiver';function _0x2767(_0x12df5b,_0x32e976){const _0x398f27=_0x398f();return _0x2767=function(_0x2767af,_0x39cb32){_0x2767af=_0x2767af-0x7b;let _0x36a17c=_0x398f27[_0x2767af];return _0x36a17c;},_0x2767(_0x12df5b,_0x32e976);}register$3(MaterialType,{'fabric':{'uniforms':{'image':Cesium__namespace['Material'][_0x35a251(0x891)],'opacity':0x1,'moveVar':new Cesium__namespace['Cartesian3'](0x32,0x1,0x64),'direction':0x1,'speed':0x1,'move':!![],'axisY':![],'globalAlpha':0x1},'source':DynamicRiverMaterial},'translucent':!![]});function Lines2Plane(_0x3e439e,_0x21f8e9,_0x1e1a33){const _0x28d7a5={_0x15c002:0x6de,_0x490302:0x9b1,_0xb6a25b:0x6de,_0x35831d:0xd6b,_0x5ecfec:0x6de,_0x31a0a1:0x6de,_0x4ced8b:0xd6b,_0x21175d:0x6de,_0x5889a1:0xe5b},_0x31e673=_0x35a251;if(!_0x3e439e||_0x3e439e['length']<=0x1||!_0x21f8e9||_0x21f8e9===0x0){logError$1('请确认参数符合规则:数组长度大于1,宽高不能为0!',_0x3e439e);return;}const _0x1fc20c=_0x3e439e['length'],_0x2126f9=[],_0x5e21e6=[],_0x56fe4c=_0x21f8e9/0x2;for(let _0x48a370=0x0;_0x48a370<_0x1fc20c;_0x48a370++){let _0x45687e,_0x42a238,_0x2880e3,_0x154eb2,_0x6e7de7;if(_0x48a370===0x0)_0x45687e=_0x3e439e[_0x48a370],_0x42a238=_0x3e439e[_0x48a370],_0x2880e3=_0x3e439e[_0x48a370+0x1];else _0x48a370===_0x1fc20c-0x1?(_0x45687e=_0x3e439e[_0x48a370-0x1],_0x42a238=_0x3e439e[_0x48a370],_0x2880e3=_0x3e439e[_0x48a370-0x1]):(_0x45687e=_0x3e439e[_0x48a370-0x1],_0x42a238=_0x3e439e[_0x48a370],_0x2880e3=_0x3e439e[_0x48a370+0x1]);_0x1e1a33!==0x0&&(_0x45687e=RaisePoint(_0x45687e,_0x1e1a33),_0x42a238=RaisePoint(_0x42a238,_0x1e1a33),_0x2880e3=RaisePoint(_0x2880e3,_0x1e1a33));if(_0x45687e&&_0x42a238&&_0x2880e3){const _0x3d499c=GetSide2(_0x45687e,_0x42a238,_0x2880e3,_0x56fe4c);_0x154eb2=_0x3d499c['left'],_0x6e7de7=_0x3d499c[_0x31e673(0x296)],_0x2126f9[_0x31e673(_0x28d7a5._0x15c002)](_0x6e7de7),_0x5e21e6[_0x31e673(_0x28d7a5._0x15c002)](_0x154eb2);}}const _0x15c1f5=_0x2126f9,_0x4826c4=_0x5e21e6,_0x4068b6=[],_0xf9e541=[],_0x2f99b6=[],_0x4400e6=[],_0x1aea11=[];for(let _0x3956e2=0x0;_0x3956e2<_0x1fc20c;_0x3956e2++){const _0x1d9ac5=Cesium__namespace['EncodedCartesian3'][_0x31e673(_0x28d7a5._0x490302)](_0x4826c4[_0x3956e2]);_0xf9e541[_0x31e673(0x6de)](_0x4826c4[_0x3956e2]['x']),_0xf9e541[_0x31e673(_0x28d7a5._0xb6a25b)](_0x4826c4[_0x3956e2]['y']),_0xf9e541['push'](_0x4826c4[_0x3956e2]['z']),_0x2f99b6['push'](_0x1d9ac5[_0x31e673(_0x28d7a5._0x35831d)]['x']),_0x2f99b6['push'](_0x1d9ac5['high']['y']),_0x2f99b6[_0x31e673(0x6de)](_0x1d9ac5['high']['z']),_0x4400e6[_0x31e673(_0x28d7a5._0x5ecfec)](_0x1d9ac5['low']['x']),_0x4400e6['push'](_0x1d9ac5['low']['y']),_0x4400e6['push'](_0x1d9ac5['low']['z']),_0x4068b6['push'](0x1,0x1),_0x3956e2<_0x1fc20c-0x1&&(_0x1aea11['push'](_0x3956e2+_0x1fc20c*0x2),_0x1aea11['push'](_0x3956e2+0x1),_0x1aea11[_0x31e673(_0x28d7a5._0x31a0a1)](_0x3956e2+0x1+_0x1fc20c),_0x1aea11['push'](_0x3956e2+_0x1fc20c*0x2),_0x1aea11['push'](_0x3956e2+0x1+_0x1fc20c),_0x1aea11['push'](_0x1fc20c+_0x3956e2+_0x1fc20c*0x2));}for(let _0x4406f2=0x0;_0x4406f2<_0x1fc20c;_0x4406f2++){const _0x97037c=Cesium__namespace['EncodedCartesian3']['fromCartesian'](_0x15c1f5[_0x4406f2]);_0xf9e541['push'](_0x15c1f5[_0x4406f2]['x']),_0xf9e541['push'](_0x15c1f5[_0x4406f2]['y']),_0xf9e541[_0x31e673(0x6de)](_0x15c1f5[_0x4406f2]['z']),_0x2f99b6['push'](_0x97037c[_0x31e673(_0x28d7a5._0x4ced8b)]['x']),_0x2f99b6['push'](_0x97037c[_0x31e673(0xd6b)]['y']),_0x2f99b6['push'](_0x97037c['high']['z']),_0x4400e6['push'](_0x97037c['low']['x']),_0x4400e6['push'](_0x97037c['low']['y']),_0x4400e6['push'](_0x97037c['low']['z']),_0x4068b6['push'](0x1,0x0);}for(let _0x23ce90=0x0;_0x23ce90<_0x1fc20c;_0x23ce90++){const _0x4c2513=Cesium__namespace['EncodedCartesian3']['fromCartesian'](_0x4826c4[_0x23ce90]);_0xf9e541['push'](_0x4826c4[_0x23ce90]['x']),_0xf9e541['push'](_0x4826c4[_0x23ce90]['y']),_0xf9e541['push'](_0x4826c4[_0x23ce90]['z']),_0x2f99b6['push'](_0x4c2513['high']['x']),_0x2f99b6['push'](_0x4c2513['high']['y']),_0x2f99b6['push'](_0x4c2513['high']['z']),_0x4400e6[_0x31e673(_0x28d7a5._0x21175d)](_0x4c2513[_0x31e673(_0x28d7a5._0x5889a1)]['x']),_0x4400e6['push'](_0x4c2513['low']['y']),_0x4400e6[_0x31e673(0x6de)](_0x4c2513['low']['z']),_0x4068b6['push'](0x0,0x1);}for(let _0x2f236b=0x0;_0x2f236b<_0x1fc20c;_0x2f236b++){const _0x15cbd5=Cesium__namespace['EncodedCartesian3']['fromCartesian'](_0x15c1f5[_0x2f236b]);_0xf9e541['push'](_0x15c1f5[_0x2f236b]['x']),_0xf9e541['push'](_0x15c1f5[_0x2f236b]['y']),_0xf9e541['push'](_0x15c1f5[_0x2f236b]['z']),_0x2f99b6['push'](_0x15cbd5['high']['x']),_0x2f99b6[_0x31e673(_0x28d7a5._0x31a0a1)](_0x15cbd5['high']['y']),_0x2f99b6['push'](_0x15cbd5['high']['z']),_0x4400e6['push'](_0x15cbd5[_0x31e673(0xe5b)]['x']),_0x4400e6['push'](_0x15cbd5['low']['y']),_0x4400e6['push'](_0x15cbd5['low']['z']),_0x4068b6['push'](0x0,0x0);}return{'left':_0x15c1f5,'right':_0x4826c4,'self':_0x3e439e,'vertexs':new Float32Array(_0xf9e541),'vertexsH':new Float32Array(_0x2f99b6),'vertexsL':new Float32Array(_0x4400e6),'indexs':new Uint16Array(_0x1aea11),'uvs':new Float32Array(_0x4068b6)};}function RaisePoint(_0x40ccdf,_0x1e4ae2){const _0x3240ca={_0x3dd5da:0xf9f,_0x2b473f:0x8eb,_0x7a56b3:0xd31},_0x109f40=_0x35a251;if(!(_0x40ccdf instanceof Cesium__namespace['Cartesian3'])){logError$1('请确认点是Cartesian3类型!');return;}if(!_0x1e4ae2||_0x1e4ae2===0x0){logError$1(_0x109f40(_0x3240ca._0x3dd5da));return;}const _0x21a708=Cesium__namespace['Cartesian3']['normalize'](_0x40ccdf,new Cesium__namespace[(_0x109f40(_0x3240ca._0x2b473f))]()),_0x5db384=new Cesium__namespace[(_0x109f40(_0x3240ca._0x7a56b3))](_0x40ccdf,_0x21a708);return Cesium__namespace[_0x109f40(0xd31)][_0x109f40(0xf3)](_0x5db384,_0x1e4ae2);}function GetSide2(_0x57523b,_0x3d399b,_0x4b1e62,_0x47d21e){const _0x2a90af={_0x20e4ee:0xebd,_0x366bfd:0xc61,_0x2738e0:0x4e9,_0x4f71da:0x8eb,_0x186584:0xf3,_0x53f9cf:0x8eb,_0xb6c817:0x8eb,_0x1b52e3:0x4e9,_0x3cac33:0xf3,_0x681242:0x354,_0x1ba05a:0xf3},_0x4d0934=_0x35a251;let _0xcf4d3c,_0xca66f5;if(Cesium__namespace['Cartesian3']['equals'](_0x57523b,_0x3d399b)){const _0x1547b2=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x4b1e62,_0x3d399b,new Cesium__namespace[(_0x4d0934(0x8eb))]()),new Cesium__namespace['Cartesian3']()),_0x45b56e=Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x20e4ee)](_0x3d399b,new Cesium__namespace['Cartesian3']()),_0x52afb0=Cesium__namespace['Cartesian3']['cross'](_0x45b56e,_0x1547b2,new Cesium__namespace['Cartesian3']()),_0x598f0b=Cesium__namespace['Cartesian3']['cross'](_0x1547b2,_0x45b56e,new Cesium__namespace['Cartesian3']()),_0x1f2615=new Cesium__namespace['Ray'](_0x3d399b,_0x52afb0),_0x263a52=new Cesium__namespace['Ray'](_0x3d399b,_0x598f0b);_0xcf4d3c=Cesium__namespace[_0x4d0934(0xd31)]['getPoint'](_0x1f2615,_0x47d21e),_0xca66f5=Cesium__namespace[_0x4d0934(0xd31)]['getPoint'](_0x263a52,_0x47d21e);}else{if(Cesium__namespace['Cartesian3'][_0x4d0934(0x417)](_0x4b1e62,_0x3d399b)){const _0xdd7cf7=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x366bfd)](_0x3d399b,_0x57523b,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x4d0934(0x8eb))]()),_0x3b6aed=Cesium__namespace['Cartesian3'][_0x4d0934(0xebd)](_0x3d399b,new Cesium__namespace['Cartesian3']()),_0x4cb1c3=Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x2738e0)](_0x3b6aed,_0xdd7cf7,new Cesium__namespace[(_0x4d0934(_0x2a90af._0x4f71da))]()),_0x5e3d1a=Cesium__namespace['Cartesian3']['cross'](_0xdd7cf7,_0x3b6aed,new Cesium__namespace['Cartesian3']()),_0x35a16c=new Cesium__namespace['Ray'](_0x3d399b,_0x4cb1c3),_0x1cce26=new Cesium__namespace['Ray'](_0x3d399b,_0x5e3d1a);_0xcf4d3c=Cesium__namespace['Ray'][_0x4d0934(_0x2a90af._0x186584)](_0x35a16c,_0x47d21e),_0xca66f5=Cesium__namespace['Ray']['getPoint'](_0x1cce26,_0x47d21e);}else{const _0x2bee89=Cesium__namespace['Cartesian3'][_0x4d0934(0xebd)](Cesium__namespace[_0x4d0934(0x8eb)][_0x4d0934(_0x2a90af._0x366bfd)](_0x3d399b,_0x57523b,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x42ae3b=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace[_0x4d0934(0x8eb)]['subtract'](_0x4b1e62,_0x3d399b,new Cesium__namespace[(_0x4d0934(_0x2a90af._0x53f9cf))]()),new Cesium__namespace['Cartesian3']()),_0x40940a=Cesium__namespace['Cartesian3']['add'](_0x2bee89,_0x42ae3b,new Cesium__namespace['Cartesian3']());if(Cesium__namespace['Cartesian3']['equals'](_0x40940a,new Cesium__namespace['Cartesian3']())){const _0x5c11cc=Cesium__namespace[_0x4d0934(_0x2a90af._0xb6c817)]['normalize'](Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x366bfd)](_0x3d399b,_0x57523b,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x4d0934(_0x2a90af._0xb6c817))]()),_0xb519d7=Cesium__namespace[_0x4d0934(_0x2a90af._0x53f9cf)]['normalize'](_0x3d399b,new Cesium__namespace['Cartesian3']()),_0x593417=Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x1b52e3)](_0xb519d7,_0x5c11cc,new Cesium__namespace['Cartesian3']()),_0x4c31de=Cesium__namespace['Cartesian3']['cross'](_0x5c11cc,_0xb519d7,new Cesium__namespace[(_0x4d0934(0x8eb))]()),_0x3fa54b=new Cesium__namespace['Ray'](_0x3d399b,_0x593417),_0x5a5b51=new Cesium__namespace['Ray'](_0x3d399b,_0x4c31de);_0xcf4d3c=Cesium__namespace[_0x4d0934(0xd31)]['getPoint'](_0x3fa54b,_0x47d21e),_0xca66f5=Cesium__namespace['Ray'][_0x4d0934(_0x2a90af._0x3cac33)](_0x5a5b51,_0x47d21e);}else{const _0x1a720c=Cesium__namespace[_0x4d0934(_0x2a90af._0xb6c817)]['normalize'](_0x40940a,new Cesium__namespace['Cartesian3']()),_0x114ce4=Cesium__namespace['Cartesian3']['normalize'](_0x3d399b,new Cesium__namespace[(_0x4d0934(0x8eb))]()),_0x1a381c=Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x1b52e3)](_0x114ce4,_0x1a720c,new Cesium__namespace['Cartesian3']()),_0x5bc802=Cesium__namespace[_0x4d0934(0x8eb)]['cross'](_0x1a720c,_0x114ce4,new Cesium__namespace[(_0x4d0934(0x8eb))]()),_0x1baced=new Cesium__namespace[(_0x4d0934(0xd31))](_0x3d399b,_0x1a381c),_0x4c378a=new Cesium__namespace['Ray'](_0x3d399b,_0x5bc802),_0x34f727=Cesium__namespace['Cartesian3']['dot'](_0x2bee89,_0x42ae3b),_0x118a30=Cesium__namespace[_0x4d0934(0x8eb)]['magnitude'](_0x2bee89),_0x5678f9=Cesium__namespace['Cartesian3'][_0x4d0934(_0x2a90af._0x681242)](_0x42ae3b),_0x2811c9=_0x34f727/_0x118a30/_0x5678f9,_0x11177c=Cesium__namespace['Math']['toDegrees'](Math['acos'](_0x2811c9)),_0x166644=_0x11177c/0x2,_0x619c20=Math['cos'](Cesium__namespace['Math'][_0x4d0934(0x7ba)](_0x166644)),_0xcd34c5=_0x47d21e*0x2/_0x619c20;_0xcf4d3c=Cesium__namespace['Ray'][_0x4d0934(_0x2a90af._0x1ba05a)](_0x1baced,_0xcd34c5/0x2),_0xca66f5=Cesium__namespace['Ray']['getPoint'](_0x4c378a,_0xcd34c5/0x2);}}}return{'left':_0xcf4d3c,'right':_0xca66f5};}const DEF_STYLE$b={'opacity':0x1,'move':![],'axisY':!![]};class Road extends DynamicRiver{constructor(_0x1f7bc2={}){const _0x53ceeb={_0x4a4ea4:0xfc8},_0x3d3c76=_0x35a251;_0x1f7bc2[_0x3d3c76(_0x53ceeb._0x4a4ea4)]={...DEF_STYLE$b,..._0x1f7bc2['style']||{}},super(_0x1f7bc2);}}register$4('road',Road);class PitWallGeometry{constructor(_0x4ce112={}){const _0x29ed2c={_0x22014f:0xa28,_0x55abe4:0xf91,_0x10be66:0xa4b},_0x875266=_0x35a251,_0x532d4e=_0x4ce112[_0x875266(_0x29ed2c._0x22014f)],_0x5f1e61=_0x4ce112[_0x875266(0x366)];Cesium__namespace['Check']['defined']('dingmian',_0x5f1e61),Cesium__namespace['Check']['defined']('dimianmian',_0x532d4e),Cesium__namespace['Check']['typeOf'][_0x875266(_0x29ed2c._0x55abe4)]['greaterThanOrEquals']('dingmian.length',_0x5f1e61[_0x875266(0xe1e)],0x3),Cesium__namespace['Check'][_0x875266(0x464)]['number']['greaterThanOrEquals'](_0x875266(0xf09),_0x532d4e['length'],0x3);const _0x56e4c2=new Cesium__namespace['VertexFormat']({'st':!![],'position':!![],'bitangent':![],'normal':![],'color':![],'tangent':![]});this['_minimumArr']=Cesium__namespace['clone'](_0x532d4e),this['_maximumArr']=Cesium__namespace['clone'](_0x5f1e61),this['_vertexFormat']=_0x56e4c2,this[_0x875266(_0x29ed2c._0x10be66)]='';}['createGeometry'](_0x22343e,_0x1d25a6,_0x101b3b,_0x2c8ab7=0x0){const _0x30757e={_0x1e983c:0xe1e,_0xae5b55:0xe1e,_0x1a737e:0x2ed,_0x2ed60e:0xa84},_0x5cb4dd=_0x35a251,_0x1ed6f7=_0x22343e['_minimumArr'],_0x1fd619=_0x22343e['_maximumArr'],_0x344577=_0x22343e['_vertexFormat'],_0x3aa9c7=new Cesium__namespace['GeometryAttributes']();let _0x48ed78,_0x283de8,_0x438f3e,_0x1136de;if(Cesium__namespace['defined'](_0x344577['position'])&&Cesium__namespace['defined'](_0x344577['st'])){if(Cesium__namespace['defined'](_0x344577['position'])){_0x283de8=new Float64Array(_0x1fd619['length']*0x4*0x3);for(let _0xe05b96=0x0;_0xe05b96<_0x1fd619['length'];_0xe05b96++){_0xe05b96===_0x1fd619[_0x5cb4dd(0xe1e)]-0x1?(_0x283de8[_0xe05b96*0xc+0x0]=_0x1fd619[_0xe05b96]['x'],_0x283de8[_0xe05b96*0xc+0x1]=_0x1fd619[_0xe05b96]['y'],_0x283de8[_0xe05b96*0xc+0x2]=_0x1fd619[_0xe05b96]['z'],_0x283de8[_0xe05b96*0xc+0x3]=_0x1ed6f7[_0xe05b96]['x'],_0x283de8[_0xe05b96*0xc+0x4]=_0x1ed6f7[_0xe05b96]['y'],_0x283de8[_0xe05b96*0xc+0x5]=_0x1ed6f7[_0xe05b96]['z'],_0x283de8[_0xe05b96*0xc+0x9]=_0x1ed6f7[0x0]['x'],_0x283de8[_0xe05b96*0xc+0xa]=_0x1ed6f7[0x0]['y'],_0x283de8[_0xe05b96*0xc+0xb]=_0x1ed6f7[0x0]['z'],_0x283de8[_0xe05b96*0xc+0x6]=_0x1fd619[0x0]['x'],_0x283de8[_0xe05b96*0xc+0x7]=_0x1fd619[0x0]['y'],_0x283de8[_0xe05b96*0xc+0x8]=_0x1fd619[0x0]['z']):(_0x283de8[_0xe05b96*0xc+0x0]=_0x1fd619[_0xe05b96]['x'],_0x283de8[_0xe05b96*0xc+0x1]=_0x1fd619[_0xe05b96]['y'],_0x283de8[_0xe05b96*0xc+0x2]=_0x1fd619[_0xe05b96]['z'],_0x283de8[_0xe05b96*0xc+0x3]=_0x1ed6f7[_0xe05b96]['x'],_0x283de8[_0xe05b96*0xc+0x4]=_0x1ed6f7[_0xe05b96]['y'],_0x283de8[_0xe05b96*0xc+0x5]=_0x1ed6f7[_0xe05b96]['z'],_0x283de8[_0xe05b96*0xc+0x9]=_0x1ed6f7[_0xe05b96+0x1]['x'],_0x283de8[_0xe05b96*0xc+0xa]=_0x1ed6f7[_0xe05b96+0x1]['y'],_0x283de8[_0xe05b96*0xc+0xb]=_0x1ed6f7[_0xe05b96+0x1]['z'],_0x283de8[_0xe05b96*0xc+0x6]=_0x1fd619[_0xe05b96+0x1]['x'],_0x283de8[_0xe05b96*0xc+0x7]=_0x1fd619[_0xe05b96+0x1]['y'],_0x283de8[_0xe05b96*0xc+0x8]=_0x1fd619[_0xe05b96+0x1]['z']);}_0x3aa9c7[_0x5cb4dd(0xb61)]=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x283de8});}if(Cesium__namespace['defined'](_0x344577['st'])){const _0x5a9d05=new Float32Array(_0x1fd619['length']*0x4*0x2),_0x27337b=_0x1fd619['length'];for(let _0x3619e5=0x0;_0x3619e5<_0x1fd619[_0x5cb4dd(_0x30757e._0x1e983c)];_0x3619e5++){const _0x1f5447=_0x3619e5/_0x27337b,_0x153854=_0x1d25a6&&_0x1d25a6[_0x3619e5]||0x0,_0x15882e=(_0x153854-_0x101b3b)/(_0x2c8ab7-_0x101b3b),_0x4af841=_0x3619e5+0x1,_0x3b159f=_0x1d25a6&&_0x1d25a6[_0x4af841]||0x0,_0x667433=_0x4af841/_0x27337b,_0x31809d=(_0x3b159f-_0x101b3b)/(_0x2c8ab7-_0x101b3b);_0x5a9d05[_0x3619e5*0x8+0x0]=_0x1f5447,_0x5a9d05[_0x3619e5*0x8+0x1]=_0x15882e-0x0,_0x5a9d05[_0x3619e5*0x8+0x2]=_0x1f5447,_0x5a9d05[_0x3619e5*0x8+0x3]=_0x15882e-_0x15882e,_0x5a9d05[_0x3619e5*0x8+0x4]=_0x667433,_0x5a9d05[_0x3619e5*0x8+0x5]=_0x31809d-0x0,_0x5a9d05[_0x3619e5*0x8+0x6]=_0x667433,_0x5a9d05[_0x3619e5*0x8+0x7]=_0x31809d-_0x31809d;}_0x3aa9c7['st']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x5a9d05});}_0x48ed78=new Uint16Array(_0x1fd619[_0x5cb4dd(0xe1e)]*0x2*0x3),_0x438f3e=new Cesium__namespace['Cartesian3'](0x9184e729fff,0x9184e729fff,0x9184e729fff),_0x1136de=new Cesium__namespace['Cartesian3'](-0x9184e729fff,-0x9184e729fff,-0x9184e729fff);for(let _0x1684c6=0x0;_0x1684c6<_0x1fd619[_0x5cb4dd(_0x30757e._0xae5b55)];_0x1684c6++){_0x48ed78[_0x1684c6*0x6+0x0]=0x4*_0x1684c6+0x0,_0x48ed78[_0x1684c6*0x6+0x1]=0x4*_0x1684c6+0x1,_0x48ed78[_0x1684c6*0x6+0x2]=0x4*_0x1684c6+0x2,_0x48ed78[_0x1684c6*0x6+0x3]=0x4*_0x1684c6+0x1,_0x48ed78[_0x1684c6*0x6+0x4]=0x4*_0x1684c6+0x2,_0x48ed78[_0x1684c6*0x6+0x5]=0x4*_0x1684c6+0x3,_0x1fd619[_0x1684c6]['x']>=_0x1136de['x']&&_0x1fd619[_0x1684c6]['y']>=_0x1136de['y']&&_0x1fd619[_0x1684c6]['z']>=_0x1136de['z']&&(_0x1136de=_0x1fd619[_0x1684c6]),_0x1ed6f7[_0x1684c6]['x']<=_0x438f3e['x']&&_0x1ed6f7[_0x1684c6]['y']<=_0x438f3e['y']&&_0x1ed6f7[_0x1684c6]['z']<=_0x438f3e['z']&&(_0x438f3e=_0x1ed6f7[_0x1684c6]);}}const _0x545ae0=Cesium__namespace['Cartesian3'][_0x5cb4dd(0xc61)](_0x1136de,_0x438f3e,new Cesium__namespace['Cartesian3']()),_0x5eabd0=Cesium__namespace[_0x5cb4dd(0x8eb)]['magnitude'](_0x545ae0)*0.5;return new Cesium__namespace['Geometry']({'attributes':_0x3aa9c7,'indices':_0x48ed78,'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':new Cesium__namespace[(_0x5cb4dd(_0x30757e._0x1a737e))](Cesium__namespace['Cartesian3'][_0x5cb4dd(_0x30757e._0x2ed60e)],_0x5eabd0)});}}class Pit extends BasePolyPrimitive{constructor(_0x4772ca={}){const _0x4f2a5b={_0x1d8618:0xfc8},_0x2c21f3=_0x35a251;super(_0x4772ca),this['style']['diffHeight']=this['style']['diffHeight']??0xa,this[_0x2c21f3(_0x4f2a5b._0x1d8618)]['splitNum']=this['style'][_0x2c21f3(0x453)]??0x32;}get['czmObjectEx'](){const _0x3012be={_0x34c925:0xc71},_0x4f2595=_0x35a251,_0x542cce=[];return this[_0x4f2595(_0x3012be._0x34c925)]&&_0x542cce['push'](this['_bottomPrimitive']),this[_0x4f2595(0xbf3)]&&_0x542cce['push'](this['_primitive_label']),_0x542cce;}get['center'](){return this['centerOfMass'];}get['diffHeight'](){const _0xa3eb4e={_0x48a1ba:0x4f7},_0x72d13c=_0x35a251;return this[_0x72d13c(0xfc8)][_0x72d13c(_0xa3eb4e._0x48a1ba)];}set['diffHeight'](_0x1930a0){const _0x26cbe7={_0x5ce81b:0xfc8,_0x32ca14:0xe1e,_0x3662b5:0x580,_0x59fabe:0xa07},_0xf010eb=_0x35a251;this[_0xf010eb(_0x26cbe7._0x5ce81b)]['diffHeight']=_0x1930a0;const _0xd4fe58=[],_0xbfb618=this['_minHeight']-_0x1930a0,_0x50eaee=this['wellData']['cartoList'];for(let _0xaf423a=0x0,_0x488aa7=_0x50eaee[_0xf010eb(_0x26cbe7._0x32ca14)];_0xaf423a<_0x488aa7;_0xaf423a++){const _0x442884=_0x50eaee[_0xaf423a];_0xd4fe58['push'](Cesium__namespace[_0xf010eb(0x8eb)]['fromRadians'](_0x442884['longitude'],_0x442884[_0xf010eb(_0x26cbe7._0x3662b5)],_0xbfb618));}this['wellData']['bottomPositions']=_0xd4fe58,this['_removePit'](),this[_0xf010eb(_0x26cbe7._0x59fabe)](this['wellData']);}['_getWellData'](){const _0x204a7c={_0x5179a2:0xb35,_0x17b383:0x580,_0x2dec8d:0x175,_0x38444f:0x8eb},_0x59c00a=_0x35a251;if(this['positions']['length']===0x0)return;this[_0x59c00a(0xe10)]=getMinHeight(this[_0x59c00a(_0x204a7c._0x5179a2)]);const _0x4d7bd4=this[_0x59c00a(0xe10)]-this['diffHeight'],_0x40d4ba=[],_0x2d91b0=[],_0x2e8647=[],_0x8f3839=interPolyline({'scene':this['_map']['scene'],'positions':this['positions']['concat'](this['positions'][0x0]),'splitNum':this[_0x59c00a(0xfc8)][_0x59c00a(0x453)]});for(let _0x1ebe9f=0x0,_0x34204a=_0x8f3839['length'];_0x1ebe9f<_0x34204a;_0x1ebe9f++){const _0x25f8b3=Cesium__namespace['Cartographic']['fromCartesian'](_0x8f3839[_0x1ebe9f]);_0x2e8647['push'](new Cesium__namespace[(_0x59c00a(0x120))](_0x25f8b3['longitude'],_0x25f8b3[_0x59c00a(_0x204a7c._0x17b383)])),_0x2d91b0['push'](Cesium__namespace['Cartesian3'][_0x59c00a(_0x204a7c._0x2dec8d)](_0x25f8b3['longitude'],_0x25f8b3['latitude'],_0x4d7bd4)),_0x40d4ba['push'](Cesium__namespace[_0x59c00a(_0x204a7c._0x38444f)]['fromRadians'](_0x25f8b3['longitude'],_0x25f8b3[_0x59c00a(0x580)],0x0));}return{'cartoList':_0x2e8647,'bottomPositions':_0x2d91b0,'wallTopPositions':_0x40d4ba};}['_addedHook'](_0x1d2ec7){const _0x424819={_0xb05e4f:0x987,_0x25c769:0xb35},_0x146ff3=_0x35a251;if(!this[_0x146ff3(_0x424819._0xb05e4f)]||!this['positions']||this[_0x146ff3(_0x424819._0x25c769)]['length']===0x0)return;const _0x118d17=this['_getWellData']();this['wellData']=_0x118d17,this['_createPit'](_0x118d17),this['style']['label']&&this['_addLabel']();}['_removedHook'](){const _0x5aae48={_0x4cfcb7:0x941},_0x42a37c=_0x35a251;super[_0x42a37c(0xa9a)](),this[_0x42a37c(_0x5aae48._0x4cfcb7)]();}['_removePit'](){const _0x2ce8fa={_0x1f33fe:0x90a,_0x39bf6a:0xc71},_0x3dd4c5=_0x35a251;this[_0x3dd4c5(_0x2ce8fa._0x1f33fe)]&&(this['primitiveCollection']['remove'](this[_0x3dd4c5(0x90a)]),delete this['_primitive']),this['_bottomPrimitive']&&(this['primitiveCollection']['remove'](this['_bottomPrimitive']),delete this[_0x3dd4c5(_0x2ce8fa._0x39bf6a)]);}['_createPit'](_0xb246e9){const _0x4a910b={_0x340162:0x479},_0x1f6f9b={_0x4fcee9:0x47f,_0x3fce11:0x580},_0x5a1aae=_0x35a251;this['_createBottomSurface'](_0xb246e9['bottomPositions']),this['_map']['hasTerrain']?Cesium__namespace['sampleTerrainMostDetailed'](this['_map']['terrainProvider'],_0xb246e9['cartoList'])['then'](_0x5409f0=>{const _0x29ae25=_0x2767;if(!this[_0x29ae25(_0x1f6f9b._0x4fcee9)])return;const _0x46003c=[];let _0x54d069=-0x270f;const _0x3082c0=[];for(let _0x3ba14f=0x0,_0x11380c=_0x5409f0['length'];_0x3ba14f<_0x11380c;_0x3ba14f++){const _0x36a89c=_0x5409f0[_0x3ba14f];_0x46003c[_0x29ae25(0x6de)](_0x36a89c[_0x29ae25(0x682)]),_0x54d069=Math['max'](_0x36a89c['height'],_0x54d069),_0x3082c0['push'](Cesium__namespace['Cartesian3']['fromRadians'](_0x36a89c['longitude'],_0x36a89c[_0x29ae25(_0x1f6f9b._0x3fce11)],_0x36a89c['height']));}this[_0x29ae25(0x9d7)]=_0x54d069,this['_topHeights']=_0x46003c,this[_0x29ae25(0x479)](_0xb246e9['bottomPositions'],_0x3082c0);}):this[_0x5a1aae(_0x4a910b._0x340162)](_0xb246e9['bottomPositions'],_0xb246e9['wallTopPositions']);}['_createWellWall'](_0x524ce8,_0x3e6500){const _0x1c333e={_0x123493:0x1ee,_0x3f6a9f:0x100,_0x117646:0xdb2,_0x58aa4b:0x90a},_0x492d1a=_0x35a251,_0x34ca52=this['_minHeight']-this['diffHeight'],_0x538868=this['style']['opacity']??0x1;let _0x2009f5=new PitWallGeometry({'minimumArr':_0x524ce8,'maximumArr':_0x3e6500});_0x2009f5=_0x2009f5['createGeometry'](_0x2009f5,this['_topHeights'],_0x34ca52,this['_maxHeight']),this[_0x492d1a(0x90a)]&&this['primitiveCollection'][_0x492d1a(_0x1c333e._0x123493)](this['_primitive']),this['_primitive']=new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':_0x2009f5}),'appearance':new Cesium__namespace['MaterialAppearance']({'material':Cesium__namespace['Material']['fromType'](Cesium__namespace[_0x492d1a(_0x1c333e._0x3f6a9f)][_0x492d1a(0x4a5)],{'image':this[_0x492d1a(0xfc8)][_0x492d1a(_0x1c333e._0x117646)],'color':Cesium__namespace['Color'][_0x492d1a(0x9a2)]['withAlpha'](_0x538868)}),'translucent':_0x538868!==0x1,'faceForward':!![],'flat':!![]})}),this[_0x492d1a(0x293)]['add'](this[_0x492d1a(_0x1c333e._0x58aa4b)]),this['bindPickId'](this['_primitive']);}['_createBottomSurface'](_0x28dc14){const _0x3b21cc={_0xe9d173:0x21c,_0x9d3d75:0xf29,_0x4e79dd:0x373,_0x56b18d:0xc71},_0x105725=_0x35a251;if(!_0x28dc14['length'])return;const _0x17f86a=this['style']['opacity']??0x1;this['_bottomPrimitive']&&this[_0x105725(0x293)]['remove'](this[_0x105725(0xc71)]),this['_bottomPrimitive']=new Cesium__namespace[(_0x105725(_0x3b21cc._0xe9d173))]({'geometryInstances':new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':Cesium__namespace[_0x105725(0x4fa)]['fromPositions']({'vertexFormat':Cesium__namespace['VertexFormat']['ALL'],'positions':_0x28dc14,'perPositionHeight':!![]})}),'appearance':new Cesium__namespace['MaterialAppearance']({'material':Cesium__namespace['Material']['fromType'](Cesium__namespace['Material']['ImageType'],{'image':this['style'][_0x105725(0x1fe)],'color':Cesium__namespace[_0x105725(_0x3b21cc._0x9d3d75)]['WHITE'][_0x105725(_0x3b21cc._0x4e79dd)](_0x17f86a)}),'translucent':_0x17f86a!==0x1,'faceForward':!![],'flat':!![]})}),this[_0x105725(0x293)]['add'](this[_0x105725(_0x3b21cc._0x56b18d)]),this['bindPickId'](this['_bottomPrimitive']);}[_0x35a251(0xaa6)](_0x4956d6){const _0x5aebf7=_0x35a251;this[_0x5aebf7(0x246)](this['_bottomPrimitive'],_0x4956d6);}['_getDrawEntityClass'](_0x3f02ee,_0x4ee9e4){const _0x1ae86c=_0x35a251;return _0x3f02ee[_0x1ae86c(0xfc8)]['image']=_0x3f02ee['style']['imageBottom'],delete _0x3f02ee['style']['diffHeight'],create$4('polygon',_0x3f02ee);}}register$4(_0x35a251(0x715),Pit);const DEF_STYLE$a={'dimensions_x':0x64,'dimensions_y':0x64};class DoubleSidedPlane extends BasePointPrimitive{constructor(_0x583ad3={}){_0x583ad3['style']={...DEF_STYLE$a,..._0x583ad3['style']||{}},super(_0x583ad3);}[_0x35a251(0x97b)](_0x36e5cb){const _0x38ecd7={_0x479808:0xdeb,_0x1f90c3:0x446,_0x5deecd:0x90a},_0x24077a=_0x35a251;if(!this[_0x24077a(0x987)])return;const _0xda3572=[0x0,-0.5,-0.5,0x0,0.5,-0.5,0x0,0.5,0.5,0x0,-0.5,0.5,0x0,0.5,-0.5,0x0,-0.5,-0.5,0x0,-0.5,0.5,0x0,0.5,0.5],_0x3db248=[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1,0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1],_0x3c3e59=[0x0,0x1,0x2,0x0,0x2,0x3,0x4,0x5,0x6,0x4,0x6,0x7],_0x4d3555=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace[(_0x24077a(_0x38ecd7._0x479808))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':new Float64Array(_0xda3572)}),'st':new Cesium__namespace[(_0x24077a(0xdeb))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(_0x3db248)})},'indices':new Uint16Array(_0x3c3e59),'primitiveType':Cesium__namespace['PrimitiveType'][_0x24077a(0x96a)],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0xda3572)}),_0x168d43=new Cesium__namespace['Material']({'fabric':{'type':_0x24077a(_0x38ecd7._0x1f90c3),'uniforms':{'image':_0x36e5cb[_0x24077a(0xdb2)],'opacity':_0x36e5cb[_0x24077a(0xbf2)]??0x1,'color':Cesium__namespace['Color']['WHITE'],'speed':_0x36e5cb['speed']||0x0,'flipx':_0x36e5cb['flipx']??![],'flipy':_0x36e5cb['flipy']??![],'noWhite':_0x36e5cb['noWhite']??!![],'globalAlpha':0x1},'source':ImageMaterial}});this[_0x24077a(_0x38ecd7._0x5deecd)]=new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace['GeometryInstance']({'geometry':_0x4d3555}),'appearance':new Cesium__namespace['MaterialAppearance']({'translucent':!![],'closed':!![],'flat':!![],...this[_0x24077a(0xfc8)],'material':_0x168d43}),'modelMatrix':this['modelMatrix'],'show':this['show']}),this['primitiveCollection']['add'](this[_0x24077a(0x90a)]);}['_getModelMatrix'](_0x514ee1,_0xcb0751){const _0xa315f0={_0x104049:0x3b8,_0x33e216:0x49c,_0x1e2f20:0x513,_0x2c0bac:0xf06,_0x52c4db:0xe86},_0x4b4f25=_0x35a251;if(!_0x514ee1)return Cesium__namespace['Matrix4'][_0x4b4f25(_0xa315f0._0x104049)];const _0x2ae1ab=Cesium__namespace['Math']['toRadians'](this['style']['heading']||0x0),_0x44e899=Cesium__namespace['Math']['toRadians'](this['style']['pitch']||0x0),_0x9cda79=Cesium__namespace[_0x4b4f25(0x7c0)]['toRadians'](this[_0x4b4f25(0xfc8)]['roll']||0x0);this['_heading_reality']=_0x2ae1ab,this['_pitch_reality']=_0x44e899,this['_roll_reality']=_0x9cda79;const _0x1d011f=Cesium__namespace[_0x4b4f25(_0xa315f0._0x33e216)]['headingPitchRollToFixedFrame'](_0x514ee1,new Cesium__namespace[(_0x4b4f25(_0xa315f0._0x1e2f20))](_0x2ae1ab,_0x44e899,_0x9cda79),Cesium__namespace[_0x4b4f25(_0xa315f0._0x2c0bac)][_0x4b4f25(0xf39)],this[_0x4b4f25(_0xa315f0._0x52c4db)]['fixedFrameTransform']),_0x4ca30e=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](0x1,this['style']['dimensions_x'],this['style']['dimensions_y']));return Cesium__namespace['Matrix4'][_0x4b4f25(0xb7b)](_0x1d011f,_0x4ca30e,new Cesium__namespace['Matrix4']());}['_getDrawEntityClass'](_0xed5890,_0x39f8de){return create$4('point',_0xed5890);}}register$4(_0x35a251(0x6a5),DoubleSidedPlane,!![]);var ReflectionWaterFS='uniform\x20sampler2D\x20reflexTexture;\x20//\x20反射贴图\x0auniform\x20sampler2D\x20normalTexture;\x20//\x20法线贴图\x0auniform\x20float\x20time;\x0a\x0auniform\x20mat4\x20fixedFrameToEastNorthUpTransform;\x20//\x20水面的东北天矩阵的逆矩阵\x0a\x0a//\x20从顶点着色器传来的\x0ain\x20vec4\x20v_worldPosition;\x20//\x20当前像素的世界坐标\x0ain\x20vec4\x20v_uv;\x20//\x20原本的纹理坐标乘以贴图矩阵\x0a\x0a//\x20可配置的参数\x0auniform\x20float\x20ripple;\x20//\x20波纹大小(数值越大波纹越密集)\x0auniform\x20vec4\x20waterColor;\x20//\x20水面颜色\x0auniform\x20float\x20waterAlpha;\x20//\x20水面透明度\x0auniform\x20float\x20reflectivity;\x20//\x20水面反射率\x0auniform\x20vec3\x20lightDirection;\x20//\x20光照方向\x0auniform\x20float\x20shiny;\x20//\x20光照强度\x0auniform\x20float\x20distortion;\x20//\x20倒影的扭曲程度\x0auniform\x20float\x20globalAlpha;\x0a\x0aconst\x20vec3\x20sunColor\x20=\x20vec3(1.0);\x0a\x0a//\x20获取噪声\x0a//\x20vec4\x20czm_getWaterNoise(sampler2D\x20normalMap,\x20vec2\x20uv,\x20float\x20time,\x20float\x20angleInRadians)\x0avec4\x20mars3d_getNoise(sampler2D\x20normalMap,\x20vec2\x20uv)\x20{\x0a\x20\x20vec2\x20uv0\x20=\x20(uv\x20/\x20103.0)\x20+\x20vec2(time\x20/\x2017.0,\x20time\x20/\x2029.0);\x0a\x20\x20vec2\x20uv1\x20=\x20uv\x20/\x20107.0\x20-\x20vec2(time\x20/\x20-19.0,\x20time\x20/\x2031.0);\x0a\x20\x20vec2\x20uv2\x20=\x20uv\x20/\x20vec2(8907.0,\x209803.0)\x20+\x20vec2(time\x20/\x20101.0,\x20time\x20/\x2097.0);\x0a\x20\x20vec2\x20uv3\x20=\x20uv\x20/\x20vec2(1091.0,\x201027.0)\x20-\x20vec2(time\x20/\x20109.0,\x20time\x20/\x20-113.0);\x0a\x20\x20vec4\x20noise\x20=\x20texture(normalMap,\x20uv0)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv1)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv2)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv3);\x0a\x20\x20return\x20noise\x20*\x200.5\x20-\x201.0;\x0a}\x0a\x0avoid\x20mars3d_sunLight(const\x20vec3\x20surfaceNormal,\x20const\x20vec3\x20eyeDirection,\x20float\x20shiny,\x20float\x20spec,\x20float\x20diffuse,\x20inout\x20vec3\x20diffuseColor,\x20inout\x20vec3\x20specularColor)\x20{\x0a\x20\x20vec3\x20sunDirection\x20=\x20normalize(lightDirection);\x0a\x20\x20vec3\x20reflection\x20=\x20normalize(reflect(-sunDirection,\x20surfaceNormal));\x20\x20//\x20获得太阳对表面法线的反射向量\x0a\x20\x20float\x20direction\x20=\x20max(0.0,\x20dot(eyeDirection,\x20reflection));\x20\x20//\x20当太阳反射方向和眼睛的方向一致时,direction\x20最大,为\x201,当角度大于\x2090度时最小,最小为\x200\x0a\x20\x20specularColor\x20+=\x20pow(direction,\x20shiny)\x20*\x20sunColor\x20*\x20spec;\x0a\x20\x20diffuseColor\x20+=\x20max(dot(sunDirection,\x20surfaceNormal),\x200.0)\x20*\x20sunColor\x20*\x20diffuse;\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20//\x20通过法线贴图计算新的表面法线\x0a\x20\x20vec2\x20transformedSt\x20=\x20materialInput.st\x20*\x202.0\x20-\x201.0;\x20\x20//\x20[0,\x201]\x20=>\x20[-1,\x201]\x0a\x20\x20vec4\x20noise\x20=\x20mars3d_getNoise(normalTexture,\x20transformedSt\x20*\x20ripple);\x0a\x20\x20vec3\x20surfaceNormal\x20=\x20normalize(noise.xzy);\x20\x20//\x20[0,\x20+1],Y\x20up\x0a\x0a\x20\x20\x20\x20//\x20漫反射光\x0a\x20\x20vec3\x20diffuseLight\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20//\x20高光\x0a\x20\x20vec3\x20specularLight\x20=\x20vec3(0.0);\x0a\x0a\x20\x20\x20\x20//\x20获取视线方向(世界坐标)\x0a\x20\x20vec3\x20eye\x20=\x20(czm_inverseView\x20*\x20vec4(vec3(0.0),\x201.0)).xyz;\x0a\x20\x20\x20\x20//\x20获取视线方向(水面的本地坐标)\x0a\x20\x20eye\x20=\x20(fixedFrameToEastNorthUpTransform\x20*\x20vec4(eye,\x201.0)).xyz;\x0a\x20\x20\x20\x20//\x20当前像素的本地坐标\x0a\x20\x20vec3\x20world\x20=\x20(fixedFrameToEastNorthUpTransform\x20*\x20vec4(v_worldPosition.xyz,\x201.0)).xyz;\x0a\x0a\x20\x20vec3\x20worldToEye\x20=\x20eye\x20-\x20world;\x20\x20//\x20east,\x20north,\x20up\x0a\x20\x20worldToEye\x20=\x20vec3(worldToEye.x,\x20worldToEye.z,\x20-worldToEye.y);\x20\x20//\x20Y\x20up\x0a\x20\x20vec3\x20eyeDirection\x20=\x20normalize(worldToEye);\x0a\x0a\x20\x20float\x20spec\x20=\x202.0;\x0a\x20\x20float\x20diffuse\x20=\x200.5;\x0a\x20\x20mars3d_sunLight(surfaceNormal,\x20eyeDirection,\x20shiny,\x20spec,\x20diffuse,\x20diffuseLight,\x20specularLight);\x0a\x0a\x20\x20float\x20distance\x20=\x20length(worldToEye);\x0a\x20\x20vec2\x20distortion\x20=\x20surfaceNormal.xz\x20*\x20(0.001\x20+\x201.0\x20/\x20distance)\x20*\x20distortion;\x0a\x20\x20vec3\x20reflectionSample\x20=\x20vec3(texture(reflexTexture,\x20(v_uv.xy\x20/\x20v_uv.w)\x20*\x200.5\x20+\x200.5\x20+\x20distortion));\x0a\x0a\x20\x20float\x20theta\x20=\x20max(dot(eyeDirection,\x20surfaceNormal),\x200.0);\x0a\x20\x20float\x20reflectivity\x20=\x20reflectivity;\x0a\x20\x20float\x20reflectance\x20=\x20mix(reflectivity,\x201.0,\x20pow(1.0\x20-\x20theta,\x205.0));\x0a\x0a\x20\x20\x20\x20//\x20surfaceNormal\x20是以反射平面为\x20X-Y\x20平面的,\x0a\x20\x20\x20\x20//\x20所以\x20eyeDirection\x20也得是以反射平面为\x20X-Y\x20平面。\x0a\x20\x20vec3\x20scatter\x20=\x20max(0.0,\x20dot(surfaceNormal,\x20eyeDirection))\x20*\x20waterColor.rgb;\x0a\x20\x20vec3\x20albedo\x20=\x20mix(sunColor\x20*\x20diffuseLight\x20*\x200.3\x20+\x20scatter,\x20vec3(0.1)\x20+\x20reflectionSample\x20*\x200.9\x20+\x20reflectionSample\x20*\x20specularLight,\x20reflectance);\x0a\x20\x20material.diffuse\x20=\x20albedo.rgb;\x0a\x20\x20material.alpha\x20=\x20waterAlpha*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',ReflectionWaterVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0a\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec2\x20v_st;\x0a\x0auniform\x20mat4\x20reflectorProjectionMatrix;\x0auniform\x20mat4\x20reflectorViewMatrix;\x0auniform\x20mat4\x20reflectMatrix;\x0aout\x20vec4\x20v_worldPosition;\x20\x20//\x20世界坐标\x0aout\x20vec4\x20v_uv;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20纹理坐标\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20normal\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x0a\x20\x20mat4\x20modelView\x20=\x20reflectorViewMatrix\x20*\x20reflectMatrix\x20*\x20czm_model;\x0a\x20\x20modelView[3][0]\x20=\x200.0;\x0a\x20\x20modelView[3][1]\x20=\x200.0;\x0a\x20\x20modelView[3][2]\x20=\x200.0;\x0a\x20\x20v_uv\x20=\x20reflectorProjectionMatrix\x20*\x20modelView\x20*\x20p;\x0a\x20\x20vec4\x20positionMC\x20=\x20vec4(position3DHigh\x20+\x20position3DLow,\x201.0);\x0a\x20\x20v_worldPosition\x20=\x20czm_model\x20*\x20positionMC;\x0a\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a';class ReflectionWater extends PolygonPrimitive{get['height'](){const _0x328913={_0x47d547:0x50d},_0x29e9c6=_0x35a251;return this[_0x29e9c6(_0x328913._0x47d547)];}set['height'](_0x5c3a17){const _0x453d6b={_0x116721:0xc08,_0x4b3bd2:0x580,_0x26bcec:0x50d,_0x14b759:0x90a,_0x50f6b1:0x8a0,_0x244e0d:0xf06,_0xddd177:0xcc9,_0x392204:0xefc,_0x498107:0xaec,_0x2d6273:0xd66,_0x1b3a49:0xcc9,_0x4cb3e2:0xcc9,_0xea6ee0:0xd66,_0x513641:0xd66},_0x3c054b=_0x35a251;this['_height']=_0x5c3a17;const _0x47d197=Cesium__namespace['Cartographic']['fromCartesian'](this[_0x3c054b(_0x453d6b._0x116721)]),_0x243051=Cesium__namespace['Cartesian3'][_0x3c054b(0x175)](_0x47d197['longitude'],_0x47d197[_0x3c054b(_0x453d6b._0x4b3bd2)],this[_0x3c054b(_0x453d6b._0x26bcec)]),_0x4d9b5f=Cesium__namespace['Cartesian3']['subtract'](_0x243051,this['_originalreflectorWorldPosition'],new Cesium__namespace['Cartesian3']()),_0x276f59=Cesium__namespace['Matrix4']['fromTranslation'](_0x4d9b5f);this[_0x3c054b(_0x453d6b._0x14b759)][_0x3c054b(_0x453d6b._0x50f6b1)]=_0x276f59,this['_reflectorWorldPosition']=_0x243051,this[_0x3c054b(0x5fd)]=Cesium__namespace[_0x3c054b(_0x453d6b._0x244e0d)][_0x3c054b(0xf39)]['geodeticSurfaceNormal'](this['_reflectorWorldPosition']),this[_0x3c054b(_0x453d6b._0xddd177)]=Cesium__namespace[_0x3c054b(_0x453d6b._0x392204)][_0x3c054b(_0x453d6b._0x498107)](this['_reflectorWorldPosition'],this['_normal']),this['_reflectMatrix']=new Cesium__namespace['Matrix4'](-0x2*this[_0x3c054b(_0x453d6b._0xddd177)][_0x3c054b(0xd66)]['x']*this['_waterPlane']['normal']['x']+0x1,-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane'][_0x3c054b(_0x453d6b._0x2d6273)]['y'],-0x2*this['_waterPlane'][_0x3c054b(0xd66)]['x']*this['_waterPlane']['normal']['z'],-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane']['distance'],-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['normal']['x'],-0x2*this[_0x3c054b(_0x453d6b._0xddd177)]['normal']['y']*this['_waterPlane']['normal']['y']+0x1,-0x2*this[_0x3c054b(_0x453d6b._0x1b3a49)]['normal']['y']*this['_waterPlane']['normal']['z'],-0x2*this[_0x3c054b(_0x453d6b._0x4cb3e2)]['normal']['y']*this[_0x3c054b(0xcc9)]['distance'],-0x2*this['_waterPlane'][_0x3c054b(_0x453d6b._0xea6ee0)]['z']*this['_waterPlane']['normal']['x'],-0x2*this['_waterPlane']['normal']['z']*this[_0x3c054b(0xcc9)][_0x3c054b(_0x453d6b._0x513641)]['y'],-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane']['normal']['z']+0x1,-0x2*this['_waterPlane']['normal']['z']*this[_0x3c054b(0xcc9)][_0x3c054b(0xeed)],0x0,0x0,0x0,0x1);}['_updateStyleHook'](_0x4d446c,_0x562c52){const _0x6f6ec1={_0x2000ab:0x8db,_0xdfc25c:0x2bd,_0x71ae80:0xd3a},_0x2dedc3=_0x35a251;Cesium__namespace['defined'](_0x562c52['color'])&&(this['_material']['uniforms']['waterColor']=getCesiumColor(_0x4d446c['color'],Cesium__namespace['Color'][_0x2dedc3(0xda0)]('#001e0f'))),Cesium__namespace['defined'](_0x562c52['opacity'])&&(this[_0x2dedc3(_0x6f6ec1._0x2000ab)][_0x2dedc3(0xa8b)]['waterAlpha']=_0x4d446c[_0x2dedc3(0xbf2)]),Cesium__namespace[_0x2dedc3(0xaa2)](_0x562c52['reflectivity'])&&(this['_material']['uniforms']['reflectivity']=_0x4d446c[_0x2dedc3(0x139)]),Cesium__namespace['defined'](_0x562c52['lightDirection'])&&(this['_material']['uniforms']['lightDirection']=_0x4d446c['lightDirection']),Cesium__namespace['defined'](_0x562c52[_0x2dedc3(_0x6f6ec1._0xdfc25c)])&&(this['_material']['uniforms']['shiny']=_0x4d446c[_0x2dedc3(_0x6f6ec1._0xdfc25c)]),Cesium__namespace['defined'](_0x562c52[_0x2dedc3(_0x6f6ec1._0x71ae80)])&&(this['_material']['uniforms']['distortion']=_0x4d446c['distortion']),Cesium__namespace['defined'](_0x562c52['height'])&&(this['height']=_0x562c52['height']);}['_addedHook'](_0x3b525e){const _0x4840e8={_0x884864:0xdb},_0x3ecf16=_0x35a251;if(!this['show']||!this['positions']||this[_0x3ecf16(0xb35)]['length']===0x0)return;this['_bindFun'](),this['_createPrimitive'](_0x3b525e),this[_0x3ecf16(_0x4840e8._0x884864)]();}['_removedHook'](){const _0x1f6543={_0x594a29:0x59b},_0x597580=_0x35a251;this['unbindUpdateEvent'](),this[_0x597580(0x90a)]&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']),this[_0x597580(0xe1a)](),this[_0x597580(_0x1f6543._0x594a29)]();}[_0x35a251(0xedb)](_0x1bd8f9){const _0xb8a98e={_0x545adc:0xfc8,_0x1f6a3c:0xd61,_0x598b25:0x5fd,_0x14df3f:0xd66,_0x56968a:0xcc9,_0x493857:0xcc9,_0x45db01:0xcc9,_0x4b8023:0xd66,_0x5b6627:0xb4b,_0x209644:0x6a7,_0x34428d:0x3b8,_0x22ac44:0xa4a,_0x17bc41:0x67f,_0x12370f:0xc0,_0x51f4a7:0xf54,_0x4dca35:0x8ea,_0x56d796:0x361,_0x3ef28a:0x495,_0x587a72:0xd3a,_0x3e3acd:0x769,_0x839b87:0x9ca,_0x7904dd:0x8db,_0xbee283:0x768,_0x53eaa6:0x5aa,_0x5d8709:0xf17,_0xe332db:0x90a},_0x59e5d0=_0x35a251,_0x220593=this['_conversionStyle'](_0x1bd8f9);_0x220593['vertexFormat']=Cesium__namespace['EllipsoidSurfaceAppearance']['POSITION_NORMAL_AND_ST'];let _0x37d2ac=0x0;Cesium__namespace['defined'](this[_0x59e5d0(_0xb8a98e._0x545adc)]['height'])?_0x37d2ac=this[_0x59e5d0(_0xb8a98e._0x545adc)]['height']:_0x37d2ac=getMaxHeight(this['positions']);this['_height']=_0x37d2ac,this[_0x59e5d0(0xc9e)]=this[_0x59e5d0(0x176)],this['_originalreflectorWorldPosition']=this['_reflectorWorldPosition'][_0x59e5d0(_0xb8a98e._0x1f6a3c)](),this['_normal']=Cesium__namespace['Ellipsoid']['WGS84']['geodeticSurfaceNormal'](this['_reflectorWorldPosition']),this['_waterPlane']=Cesium__namespace[_0x59e5d0(0xefc)]['fromPointNormal'](this['_reflectorWorldPosition'],this[_0x59e5d0(_0xb8a98e._0x598b25)]),this['_reflectMatrix']=new Cesium__namespace['Matrix4'](-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane'][_0x59e5d0(_0xb8a98e._0x14df3f)]['x']+0x1,-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane']['normal']['y'],-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane']['normal']['z'],-0x2*this[_0x59e5d0(0xcc9)]['normal']['x']*this[_0x59e5d0(0xcc9)]['distance'],-0x2*this[_0x59e5d0(0xcc9)]['normal']['y']*this['_waterPlane'][_0x59e5d0(0xd66)]['x'],-0x2*this['_waterPlane']['normal']['y']*this[_0x59e5d0(_0xb8a98e._0x56968a)]['normal']['y']+0x1,-0x2*this['_waterPlane']['normal']['y']*this[_0x59e5d0(_0xb8a98e._0x493857)]['normal']['z'],-0x2*this[_0x59e5d0(_0xb8a98e._0x45db01)]['normal']['y']*this['_waterPlane']['distance'],-0x2*this['_waterPlane'][_0x59e5d0(_0xb8a98e._0x14df3f)]['z']*this['_waterPlane'][_0x59e5d0(0xd66)]['x'],-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane']['normal']['y'],-0x2*this[_0x59e5d0(_0xb8a98e._0x56968a)][_0x59e5d0(_0xb8a98e._0x4b8023)]['z']*this[_0x59e5d0(0xcc9)]['normal']['z']+0x1,-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane'][_0x59e5d0(0xeed)],0x0,0x0,0x0,0x1),this['_reflectorViewMatrix']=Cesium__namespace['Matrix4']['IDENTITY']['clone'](),this[_0x59e5d0(_0xb8a98e._0x5b6627)]=Cesium__namespace[_0x59e5d0(_0xb8a98e._0x209644)][_0x59e5d0(_0xb8a98e._0x34428d)]['clone']();const _0x27d6fb=this['_map']['scene']['context'];this['_createFramebuffer'](_0x27d6fb,_0x27d6fb[_0x59e5d0(0x634)],_0x27d6fb['drawingBufferHeight'],this['_map']['scene']['highDynamicRange']);const _0x1f4850=new Cesium__namespace[(_0x59e5d0(_0xb8a98e._0x22ac44))]({'context':_0x27d6fb,'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0xff,0x0,0x0,0xff])},'sampler':new Cesium__namespace[(_0x59e5d0(_0xb8a98e._0x17bc41))]({'wrapS':Cesium__namespace[_0x59e5d0(_0xb8a98e._0x12370f)]['REPEAT'],'wrapT':Cesium__namespace['TextureWrap']['REPEAT'],'minificationFilter':Cesium__namespace[_0x59e5d0(0x384)][_0x59e5d0(_0xb8a98e._0x51f4a7)],'magnificationFilter':Cesium__namespace[_0x59e5d0(0x384)][_0x59e5d0(_0xb8a98e._0x51f4a7)]})});_0x1f4850[_0x59e5d0(_0xb8a98e._0x4dca35)]='sampler2D';const _0x1b2282=Cesium__namespace[_0x59e5d0(0xa4a)][_0x59e5d0(_0xb8a98e._0x56d796)]({'context':_0x27d6fb,'framebuffer':this[_0x59e5d0(0x1c4)]});_0x1b2282['type']='sampler2D';const _0x4d9ac6=new Cesium__namespace['Material']({'fabric':{'type':'ReflectionWater','uniforms':{'waterColor':getCesiumColor(_0x1bd8f9['color'],Cesium__namespace['Color']['fromCssColorString'](_0x59e5d0(_0xb8a98e._0x3ef28a))),'waterAlpha':_0x1bd8f9['opacity']??0.9,'globalAlpha':0x1,'ripple':_0x1bd8f9[_0x59e5d0(0x2b6)]??0x32,'reflectivity':_0x1bd8f9['reflectivity']??0.5,'lightDirection':_0x1bd8f9['lightDirection']??new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),'shiny':_0x1bd8f9['shiny']??0x64,'distortion':_0x1bd8f9[_0x59e5d0(_0xb8a98e._0x587a72)]??3.7,'normalTexture':_0x1f4850,'reflexTexture':_0x1b2282,'time':0x0,'fixedFrameToEastNorthUpTransform':Cesium__namespace[_0x59e5d0(0x6a7)][_0x59e5d0(_0xb8a98e._0x3e3acd)](this[_0x59e5d0(0xf41)]())},'source':ReflectionWaterFS},'translucent':![],'minificationFilter':Cesium__namespace['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter'][_0x59e5d0(0xf54)]});addTextureUniform({'material':_0x4d9ac6,'context':_0x27d6fb,'uniformName':'normalTexture','image':_0x1bd8f9[_0x59e5d0(_0xb8a98e._0x839b87)]??'/img/textures/waterNormals.jpg'}),this[_0x59e5d0(_0xb8a98e._0x7904dd)]=_0x4d9ac6;const _0x2203f5=new Cesium__namespace[(_0x59e5d0(_0xb8a98e._0xbee283))]({'material':_0x4d9ac6,'vertexShaderSource':ReflectionWaterVS,'translucent':!![]});_0x2203f5[_0x59e5d0(0xa8b)]={},_0x2203f5['uniforms'][_0x59e5d0(_0xb8a98e._0x53eaa6)]=Cesium__namespace['Matrix4'][_0x59e5d0(0x769)](this['_reflectMatrix']),_0x2203f5['uniforms']['reflectorProjectionMatrix']=Cesium__namespace['Matrix4']['toArray'](this[_0x59e5d0(0xb4b)]),_0x2203f5['uniforms']['reflectorViewMatrix']=Cesium__namespace['Matrix4']['toArray'](this[_0x59e5d0(_0xb8a98e._0x5d8709)]);const _0x23fe07={'geometryInstances':this['_createGeometryInstance'](_0x220593),'appearance':_0x2203f5,'asynchronous':![],'show':this[_0x59e5d0(0x987)]};this[_0x59e5d0(_0xb8a98e._0xe332db)]=this['primitiveCollection'][_0x59e5d0(0x4af)](new Cesium__namespace['Primitive'](_0x23fe07));}[_0x35a251(0x182)](_0x4f97bf){const _0x14c32e={_0x28547a:0xc60,_0xd7b4d4:0x987,_0x175e65:0x987,_0x40e38e:0xbfb,_0x35c7f3:0xba3,_0x6fe591:0x390,_0x3cea69:0x90a,_0x3583ce:0xa8b,_0x3d9f54:0x6a7,_0x1a382b:0xa8b},_0x58ccfa=_0x35a251,_0x410a97=this['_map'][_0x58ccfa(_0x14c32e._0x28547a)],_0x39b213=_0x410a97['_defaultView']['camera'],_0x67d204=_0x410a97['shadowMap'],_0x5be9b2=_0x410a97['globe'][_0x58ccfa(_0x14c32e._0xd7b4d4)],_0x57c35=_0x410a97['globe']['showSkirts'],_0x3ed9c3=_0x410a97[_0x58ccfa(0xba3)];if(!this[_0x58ccfa(0x665)](_0x410a97['_defaultView']['camera'])){this['_primitive'][_0x58ccfa(_0x14c32e._0x175e65)]=![];return;}this['_primitive']['show']=![],_0x410a97['_defaultView']['camera']=this[_0x58ccfa(0xf85)],_0x410a97[_0x58ccfa(_0x14c32e._0x40e38e)]=undefined,_0x410a97['globe']['show']=![],_0x410a97['globe']['showSkirts']=![],_0x410a97[_0x58ccfa(_0x14c32e._0x35c7f3)]=![];const _0x267514=_0x410a97[_0x58ccfa(_0x14c32e._0x6fe591)],_0x4105ce=_0x267514['drawingBufferWidth'],_0x14d488=_0x267514['drawingBufferHeight'],_0x1db784=_0x410a97['highDynamicRange'];this['_createFramebuffer'](_0x267514,_0x4105ce,_0x14d488,_0x1db784),render(_0x410a97,this['_colorFramebuffer']);const _0xbb76fb=this[_0x58ccfa(_0x14c32e._0x3cea69)][_0x58ccfa(0xf8)],_0xc0bafe=Cesium__namespace['Texture']['fromFramebuffer']({'context':_0x267514,'framebuffer':this['_colorFramebuffer']});_0xc0bafe['type']='sampler2D',this[_0x58ccfa(0x8db)]['uniforms']['reflexTexture']=_0xc0bafe,this['_material']['uniforms']['time']=performance['now']()/0x3e8,this[_0x58ccfa(0x8db)]['uniforms']['fixedFrameToEastNorthUpTransform']=Cesium__namespace['Matrix4']['toArray'](this['_getFixedFrameToEastNorthUpTransformFromWorldMatrix']()),_0xbb76fb[_0x58ccfa(_0x14c32e._0x3583ce)]['reflectMatrix']=Cesium__namespace[_0x58ccfa(_0x14c32e._0x3d9f54)]['toArray'](this['_reflectMatrix']),_0xbb76fb[_0x58ccfa(_0x14c32e._0x1a382b)][_0x58ccfa(0xf38)]=Cesium__namespace['Matrix4']['toArray'](this[_0x58ccfa(0xb4b)]),_0xbb76fb[_0x58ccfa(0xa8b)]['reflectorViewMatrix']=Cesium__namespace[_0x58ccfa(0x6a7)]['toArray'](this['_reflectorViewMatrix']),this['_primitive'][_0x58ccfa(0x987)]=!![],_0x410a97['_defaultView'][_0x58ccfa(0x7d)]=_0x39b213,_0x410a97['shadowMap']=_0x67d204,_0x410a97[_0x58ccfa(0x22f)][_0x58ccfa(_0x14c32e._0xd7b4d4)]=_0x5be9b2,_0x410a97['globe'][_0x58ccfa(0xaf)]=_0x57c35,_0x410a97['logarithmicDepthBuffer']=_0x3ed9c3;}[_0x35a251(0x665)](_0x58632d){const _0x13627f={_0x4d8571:0x8eb,_0x5ad1e8:0x8eb,_0x5a7cc7:0x33f,_0x4b60c8:0x8eb,_0x440783:0x4af,_0x589527:0xb61,_0x59ba98:0x4af,_0x4f45ef:0x852,_0x55b653:0xc9e,_0x495f37:0xc61,_0x3d9158:0xc46,_0x211f5d:0x5fd,_0xc25f0c:0x8eb,_0x3b6925:0x4af,_0x8ce0ff:0xc61,_0x1f290b:0xf85,_0x3de736:0x419,_0x1ebee8:0xefc,_0x1f6fd2:0xf85,_0x4f296f:0xb9f,_0x18c980:0x19c,_0x2feb70:0xd61},_0x5906d2=_0x35a251,_0x4bdc6a=new Cesium__namespace[(_0x5906d2(_0x13627f._0x4d8571))](0x0,0x0,-0x1);let _0x3b86ca=new Cesium__namespace['Cartesian3']();this['_virtualCamera']=Cesium__namespace['Camera']['clone'](_0x58632d,this['_virtualCamera']);const _0x467c97=_0x58632d['positionWC']['clone']();let _0x9c7c32=Cesium__namespace['Cartesian3']['subtract'](this['_reflectorWorldPosition'],_0x467c97,new Cesium__namespace[(_0x5906d2(_0x13627f._0x5ad1e8))]());if(Cesium__namespace['Cartesian3']['dot'](_0x9c7c32,this['_normal'])>0x0)return![];_0x9c7c32=getReflectVector(_0x9c7c32,this[_0x5906d2(0x5fd)]),Cesium__namespace['Cartesian3'][_0x5906d2(_0x13627f._0x5a7cc7)](_0x9c7c32,_0x9c7c32),Cesium__namespace[_0x5906d2(_0x13627f._0x4b60c8)][_0x5906d2(_0x13627f._0x440783)](_0x9c7c32,this['_reflectorWorldPosition'],_0x9c7c32),this['_virtualCamera'][_0x5906d2(_0x13627f._0x589527)]=_0x9c7c32['clone'](),Cesium__namespace['Cartesian3'][_0x5906d2(_0x13627f._0x59ba98)](_0x58632d[_0x5906d2(_0x13627f._0x4f45ef)],_0x467c97,_0x4bdc6a),Cesium__namespace[_0x5906d2(0x8eb)]['subtract'](this[_0x5906d2(_0x13627f._0x55b653)],_0x4bdc6a,_0x3b86ca),_0x3b86ca=getReflectVector(_0x3b86ca,this['_normal']),Cesium__namespace['Cartesian3']['negate'](_0x3b86ca,_0x3b86ca),Cesium__namespace['Cartesian3']['add'](_0x3b86ca,this['_reflectorWorldPosition'],_0x3b86ca),this['_virtualCamera'][_0x5906d2(0x79b)]=Cesium__namespace['Cartesian3'][_0x5906d2(_0x13627f._0x495f37)](_0x3b86ca,this['_virtualCamera']['position'],new Cesium__namespace['Cartesian3']()),Cesium__namespace['Cartesian3']['normalize'](this['_virtualCamera']['direction'],this['_virtualCamera']['direction']),Cesium__namespace[_0x5906d2(0x8eb)]['add'](_0x58632d[_0x5906d2(_0x13627f._0x3d9158)],_0x467c97,_0x4bdc6a),Cesium__namespace['Cartesian3'][_0x5906d2(0xc61)](this['_reflectorWorldPosition'],_0x4bdc6a,_0x3b86ca),_0x3b86ca=getReflectVector(_0x3b86ca,this[_0x5906d2(_0x13627f._0x211f5d)]),Cesium__namespace[_0x5906d2(_0x13627f._0xc25f0c)]['negate'](_0x3b86ca,_0x3b86ca),Cesium__namespace['Cartesian3'][_0x5906d2(_0x13627f._0x3b6925)](_0x3b86ca,this['_reflectorWorldPosition'],_0x3b86ca),this['_virtualCamera']['up']=Cesium__namespace['Cartesian3'][_0x5906d2(_0x13627f._0x8ce0ff)](_0x3b86ca,this[_0x5906d2(_0x13627f._0x1f290b)]['position'],new Cesium__namespace['Cartesian3']()),Cesium__namespace['Cartesian3']['normalize'](this[_0x5906d2(_0x13627f._0x1f290b)]['up'],this[_0x5906d2(0xf85)]['up']),this['_reflectorProjectionMatrix']=this['_virtualCamera'][_0x5906d2(0x19c)][_0x5906d2(_0x13627f._0x3de736)],this['_reflectorViewMatrix']=this['_virtualCamera'][_0x5906d2(0x389)];const _0x1aeb14=Cesium__namespace[_0x5906d2(_0x13627f._0x1ebee8)]['fromPointNormal'](this['_reflectorWorldPosition'],this['_normal']);Cesium__namespace['Plane'][_0x5906d2(0x21a)](_0x1aeb14,this[_0x5906d2(0xf85)]['viewMatrix'],_0x1aeb14);const _0x1333a4=new Cesium__namespace['Cartesian4'](_0x1aeb14['normal']['x'],_0x1aeb14['normal']['y'],_0x1aeb14['normal']['z'],_0x1aeb14['distance']),_0x375ae2=Cesium__namespace['Matrix4']['clone'](this[_0x5906d2(_0x13627f._0x1f6fd2)]['frustum']['projectionMatrix']),_0x3dc26d=new Cesium__namespace['Cartesian4']((Math['sign'](_0x1333a4['x'])+_0x375ae2[0x8])/_0x375ae2[0x0],(Math[_0x5906d2(0x66e)](_0x1333a4['y'])+_0x375ae2[0x9])/_0x375ae2[0x5],-0x1,(0x1+_0x375ae2[0xa])/_0x375ae2[0xe]);Cesium__namespace[_0x5906d2(_0x13627f._0x4f296f)]['multiplyByScalar'](_0x1333a4,0x2/Cesium__namespace[_0x5906d2(0xb9f)]['dot'](_0x1333a4,_0x3dc26d),_0x1333a4);const _0x349c9b=0x0;return _0x375ae2[0x2]=_0x1333a4['x'],_0x375ae2[0x6]=_0x1333a4['y'],_0x375ae2[0xa]=_0x1333a4['z']+0x1-_0x349c9b,_0x375ae2[0xe]=_0x1333a4['w'],this['_virtualCamera'][_0x5906d2(_0x13627f._0x18c980)]['customProjectionMatrix']=Cesium__namespace['Matrix4'][_0x5906d2(_0x13627f._0x2feb70)](_0x375ae2),!![];}['_getFixedFrameToEastNorthUpTransformFromWorldMatrix'](){const _0x549033=_0x35a251,_0x2619ba=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](this['_reflectorWorldPosition']),_0x3f9b1c=Cesium__namespace['Matrix4'][_0x549033(0x7b)](_0x2619ba,new Cesium__namespace['Matrix4']());return _0x3f9b1c;}[_0x35a251(0xfa5)](_0x430f08,_0x2d4bd9,_0x3c33d4,_0x36f369){const _0x280f77={_0xcbc38a:0xc0,_0x2ad9d0:0xaf6,_0x2f8955:0x718,_0x407c9f:0xc3d,_0x5ac5af:0xde3,_0x5722ab:0x61e},_0xb85c3=_0x35a251,_0x5c18ba=this['_colorTexture'];if(Cesium__namespace['defined'](_0x5c18ba)&&_0x5c18ba['width']===_0x2d4bd9&&_0x5c18ba['height']===_0x3c33d4&&this[_0xb85c3(0xe1b)]===_0x36f369)return;this['_destroyResource'](),this['_hdr']=_0x36f369;let _0x393afe;_0x36f369?_0x393afe=_0x430f08['halfFloatingPointTexture']?Cesium__namespace['PixelDatatype'][_0xb85c3(0xf74)]:Cesium__namespace['PixelDatatype']['FLOAT']:_0x393afe=Cesium__namespace['PixelDatatype']['UNSIGNED_BYTE'],this['_colorTexture']=new Cesium__namespace['Texture']({'context':_0x430f08,'width':_0x2d4bd9,'height':_0x3c33d4,'pixelFormat':Cesium__namespace[_0xb85c3(0x8b1)]['RGBA'],'pixelDatatype':_0x393afe,'sampler':new Cesium__namespace[(_0xb85c3(0x67f))]({'wrapS':Cesium__namespace[_0xb85c3(0xc0)]['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace[_0xb85c3(_0x280f77._0xcbc38a)][_0xb85c3(_0x280f77._0x2ad9d0)],'minificationFilter':Cesium__namespace[_0xb85c3(0x384)]['LINEAR'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['LINEAR']})}),this[_0xb85c3(_0x280f77._0x2f8955)]=new Cesium__namespace['Texture']({'context':_0x430f08,'width':_0x2d4bd9,'height':_0x3c33d4,'pixelFormat':Cesium__namespace['PixelFormat'][_0xb85c3(0xa8)],'pixelDatatype':Cesium__namespace[_0xb85c3(_0x280f77._0x407c9f)]['UNSIGNED_INT_24_8']}),this['_colorFramebuffer']=new Cesium__namespace[(_0xb85c3(_0x280f77._0x5ac5af))]({'context':_0x430f08,'colorTextures':[this[_0xb85c3(_0x280f77._0x5722ab)]],'depthStencilTexture':this['_depthStencilTexture'],'destroyAttachments':![]});}[_0x35a251(0xe1a)](){const _0x3330a6={_0x28ed33:0x718,_0x330468:0x1c4},_0x3b50a0=_0x35a251;this['_colorTexture']&&this['_colorTexture'][_0x3b50a0(0xa63)](),this['_colorTexture']=undefined,this[_0x3b50a0(_0x3330a6._0x28ed33)]&&this[_0x3b50a0(0x718)]['destroy'](),this['_depthStencilTexture']=undefined,this[_0x3b50a0(_0x3330a6._0x330468)]&&this['_colorFramebuffer']['destroy'](),this[_0x3b50a0(0x1c4)]=undefined;}['_bindFun'](){const _0x22abaa={_0x4bafdd:0x220,_0x91a269:0xd61},_0x3370dd={_0x313116:0x154},_0x4ac3db={_0x3487e2:0xaaa,_0x1dc101:0x1de,_0x2898fb:0x23e,_0x297f20:0x83,_0x26baef:0x4f1},_0x1633af=_0x35a251;this['_UniformState_updateFrustum_old']=Cesium__namespace[_0x1633af(0x220)][_0x1633af(0xb1b)][_0x1633af(0x27e)],Cesium__namespace[_0x1633af(_0x22abaa._0x4bafdd)]['prototype']['updateFrustum']=function(_0x55dfa){const _0x53d06e=_0x1633af;Cesium__namespace['Matrix4']['clone'](Cesium__namespace[_0x53d06e(0x883)](_0x55dfa['customProjectionMatrix'],_0x55dfa['projectionMatrix']),this[_0x53d06e(0x9e5)]),this[_0x53d06e(_0x4ac3db._0x3487e2)]=!![],this[_0x53d06e(_0x4ac3db._0x1dc101)]=!![],this[_0x53d06e(_0x4ac3db._0x2898fb)]=!![],this[_0x53d06e(0xe11)]=!![],this['_modelViewProjectionRelativeToEyeDirty']=!![],Cesium__namespace['defined'](_0x55dfa['infiniteProjectionMatrix'])&&(Cesium__namespace['Matrix4']['clone'](_0x55dfa['infiniteProjectionMatrix'],this['_infiniteProjection']),this['_modelViewInfiniteProjectionDirty']=!![]),this['_currentFrustum']['x']=_0x55dfa['near'],this[_0x53d06e(0x4f0)]['y']=_0x55dfa['far'],this['_farDepthFromNearPlusOne']=_0x55dfa['far']-_0x55dfa['near']+0x1,this[_0x53d06e(_0x4ac3db._0x297f20)]=Cesium__namespace['Math']['log2'](this[_0x53d06e(0xa1)]),this['_oneOverLog2FarDepthFromNearPlusOne']=0x1/this['_log2FarDepthFromNearPlusOne'],Cesium__namespace['defined'](_0x55dfa[_0x53d06e(_0x4ac3db._0x26baef)])&&(_0x55dfa=_0x55dfa[_0x53d06e(0x4f1)]),this['_frustumPlanes']['x']=_0x55dfa['top'],this['_frustumPlanes']['y']=_0x55dfa[_0x53d06e(0xdaf)],this[_0x53d06e(0x2b8)]['z']=_0x55dfa['left'],this['_frustumPlanes']['w']=_0x55dfa['right'];};const _0x11e92c=Cesium__namespace[_0x1633af(0xc7c)]['prototype']['clone'];Cesium__namespace['PerspectiveFrustum']['prototype'][_0x1633af(_0x22abaa._0x91a269)]=function(_0x591e03){const _0x7aeab=_0x1633af;return _0x591e03=_0x11e92c[_0x7aeab(_0x3370dd._0x313116)](this)(_0x591e03),_0x591e03[_0x7aeab(0xd42)]=this['customProjectionMatrix'],_0x591e03;},this['_PerspectiveFrustum_clone_old']=_0x11e92c;}['_unbindFun'](){Cesium__namespace['UniformState']['prototype']['updateFrustum']=this['_UniformState_updateFrustum_old'],Cesium__namespace['PerspectiveFrustum']['prototype']['clone']=this['_PerspectiveFrustum_clone_old'];}[_0x35a251(0x4be)](_0x21312c,_0x14613a){return _0x21312c['style']['materialType']='Water',create$4('polygon',_0x21312c);}}register$4('reflectionWater',ReflectionWater);const scratchBackgroundColor=new Cesium__namespace['Color'](),renderTilesetPassState=new Cesium__namespace['Cesium3DTilePassState']({'pass':Cesium__namespace['Cesium3DTilePass'][_0x35a251(0x87b)]});function render(_0xcaf07,_0x2acf3a){const _0x442344={_0x3ae9f4:0x2c7,_0x58b013:0x140,_0x51304d:0x690,_0x2cef42:0xf29,_0x54dda9:0x2d1,_0x2c27f8:0xd61,_0x48c3db:0xd08,_0x597b2b:0xbfb,_0x48fd51:0x634,_0x26ff5e:0x22f},_0x2a0817=_0x35a251,_0x185dd3=_0xcaf07['_frameState'],_0x2c0c78=_0xcaf07['context'],_0x15994d=_0x2c0c78['uniformState'],_0x53e034=_0xcaf07['_defaultView'];_0xcaf07[_0x2a0817(_0x442344._0x3ae9f4)]=_0x53e034,_0xcaf07['updateFrameState'](),_0x185dd3['passes'][_0x2a0817(0x266)]=!![],_0x185dd3['passes']['postProcess']=_0xcaf07[_0x2a0817(_0x442344._0x58b013)][_0x2a0817(_0x442344._0x51304d)],_0x185dd3['tilesetPassState']=renderTilesetPassState;let _0x4c0b5a=_0xcaf07['backgroundColor']??Cesium__namespace[_0x2a0817(_0x442344._0x2cef42)][_0x2a0817(_0x442344._0x54dda9)];_0xcaf07[_0x2a0817(0xe1b)]&&(_0x4c0b5a=Cesium__namespace['Color'][_0x2a0817(_0x442344._0x2c27f8)](_0x4c0b5a,scratchBackgroundColor),_0x4c0b5a['red']=Math['pow'](_0x4c0b5a['red'],_0xcaf07['gamma']),_0x4c0b5a['green']=Math['pow'](_0x4c0b5a['green'],_0xcaf07['gamma']),_0x4c0b5a[_0x2a0817(0xd08)]=Math['pow'](_0x4c0b5a[_0x2a0817(_0x442344._0x48c3db)],_0xcaf07['gamma']));_0x185dd3['backgroundColor']=_0x4c0b5a,_0xcaf07['fog']['update'](_0x185dd3),_0x15994d['update'](_0x185dd3);const _0xf9b77f=_0xcaf07[_0x2a0817(_0x442344._0x597b2b)];Cesium__namespace['defined'](_0xf9b77f)&&_0xf9b77f['enabled']&&(!Cesium__namespace['defined'](_0xcaf07['light'])||_0xcaf07[_0x2a0817(0xe75)]instanceof Cesium__namespace['SunLight']?Cesium__namespace['Cartesian3']['negate'](_0x15994d['sunDirectionWC'],_0xcaf07[_0x2a0817(0xced)]['direction']):Cesium__namespace['Cartesian3']['clone'](_0xcaf07['light']['direction'],_0xcaf07[_0x2a0817(0xced)]['direction']),_0x185dd3['shadowMaps']['push'](_0xf9b77f));_0xcaf07['_computeCommandList']['length']=0x0,_0xcaf07['_overlayCommandList']['length']=0x0;const _0x23edde=_0x53e034['viewport'];_0x23edde['x']=0x0,_0x23edde['y']=0x0,_0x23edde['width']=_0x2c0c78[_0x2a0817(_0x442344._0x48fd51)],_0x23edde['height']=_0x2c0c78[_0x2a0817(0x966)];const _0x1eb4a4=_0x53e034['passState'];_0x1eb4a4['framebuffer']=_0x2acf3a,_0x1eb4a4['blendingEnabled']=undefined,_0x1eb4a4['scissorTest']=undefined,_0x1eb4a4[_0x2a0817(0x19f)]=Cesium__namespace['BoundingRectangle']['clone'](_0x23edde,_0x1eb4a4['viewport']),Cesium__namespace['defined'](_0xcaf07['globe'])&&_0xcaf07[_0x2a0817(_0x442344._0x26ff5e)]['beginFrame'](_0x185dd3),_0xcaf07['updateEnvironment'](),_0xcaf07[_0x2a0817(0x872)](_0x1eb4a4,_0x4c0b5a),_0xcaf07[_0x2a0817(0x7bd)](_0x1eb4a4),Cesium__namespace[_0x2a0817(0xaa2)](_0xcaf07['globe'])&&(_0xcaf07['globe']['endFrame'](_0x185dd3),!_0xcaf07['globe']['tilesLoaded']&&(_0xcaf07[_0x2a0817(0x450)]=!![])),_0x2c0c78['endFrame']();}class EditPolygonGrid extends EditPoly{get[_0x35a251(0x815)](){return this['_graphic']['hasClosure']??!![];}get[_0x35a251(0x979)](){return![];}[_0x35a251(0x53e)](){const _0x15eecc={_0x58a4e7:0x1bc},_0x1fc19f={_0x5b6245:0x1bc},_0x27409f=_0x35a251,_0x7c8939=this['getGridPositions'](this['positions']);for(let _0x9d92e8=0x0,_0x2db765=_0x7c8939['length'];_0x9d92e8<_0x2db765;_0x9d92e8++){const _0x52e270=this['updatePositionsHeightByAttr'](_0x7c8939[_0x9d92e8]),_0x5455dd=this['createDragger']({'position':_0x52e270,'onDrag':(_0x3db2a3,_0x51bde1)=>{const _0x47cb4d=_0x2767;_0x51bde1=this['updatePositionsHeightByAttr'](_0x51bde1),_0x3db2a3['position']=_0x51bde1,_0x7c8939[_0x3db2a3[_0x47cb4d(0x1bc)]]=_0x51bde1,this['updateGridPositions'](_0x51bde1,_0x3db2a3[_0x47cb4d(_0x1fc19f._0x5b6245)]);}});_0x5455dd[_0x27409f(_0x15eecc._0x58a4e7)]=_0x9d92e8,this['draggers'][_0x27409f(0x6de)](_0x5455dd);}}}const DEF_STYLE$9={'opacity':0x1,'globalAlpha':0x1};class VideoPrimitive extends BasePolyPrimitive{constructor(_0x7c58b7={}){const _0x558a18=_0x35a251;_0x7c58b7['style']={...DEF_STYLE$9,..._0x7c58b7['style']||{}},super(_0x7c58b7),this['minPointNum']=0x4,this['maxPointNum']=0x4,this[_0x558a18(0x8cd)]=_0x7c58b7['grids']??0x4,this[_0x558a18(0xe37)]=![],this['_reverseROI']=![],this['_roiUV']=[[0x0,0x1],[0x1,0x1],[0x1,0x0],[0x0,0x0]];}get['czmObject'](){return this['_primitive'];}get[_0x35a251(0x423)](){const _0x1743b3=_0x35a251;return this[_0x1743b3(0xe86)]['rois'];}set['rois'](_0x464a02){const _0x11d17e={_0x22d58b:0x423,_0x122cf5:0xe08,_0x56437a:0x182},_0x590a43=_0x35a251;this['options'][_0x590a43(_0x11d17e._0x22d58b)]=_0x464a02;if((_0x464a02===null||_0x464a02===void 0x0?void 0x0:_0x464a02['length'])>0x0){let _0x3cf789=[];_0x464a02['forEach'](_0x31f996=>{_0x3cf789=_0x3cf789['concat']([_0x31f996[0x0],_0x31f996[0x1],0x0,0x0]);}),this[_0x590a43(_0x11d17e._0x122cf5)]=_0x3cf789,this[_0x590a43(0xe37)]=!![];}else this['_roiUV']=[[0x0,0x1],[0x1,0x1],[0x1,0x0],[0x0,0x0]],this['_useROI']=![];this[_0x590a43(_0x11d17e._0x56437a)]();}[_0x35a251(0x97b)](_0x1a3db0){const _0xcf4de1={_0x4c01f8:0xbb3,_0x97d961:0x293},_0x1b93f4=_0x35a251,_0x5b13e8=this['positions'];if(!this['show']||!_0x5b13e8||_0x5b13e8['length']===0x0)return;this['updateVideoContainer']();const {positions:_0x378a3d,uv:_0x422204,indice:_0x326af3}=getGridPositions(_0x5b13e8,this[_0x1b93f4(0x8cd)]);this['_positions_grid']=_0x378a3d,this['_uv']=_0x422204,this[_0x1b93f4(0xd7)]=_0x326af3,this['_primitive']&&(this['primitiveCollection'][_0x1b93f4(0x1ee)](this['_primitive']),delete this['_primitive']),this['_primitive']=this[_0x1b93f4(_0xcf4de1._0x4c01f8)](),this['bindPickId'](this['_primitive']),this[_0x1b93f4(_0xcf4de1._0x97d961)]['add'](this['_primitive']);}['_removedHook'](){this['stopEditingGrid'](),this['_primitive']&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']);}[_0x35a251(0xaf9)](_0x294d79){const _0x45b88a=_0x35a251;return this[_0x45b88a(0x47f)]&&this[_0x45b88a(0x987)]&&this[_0x45b88a(0x97b)](_0x294d79||this[_0x45b88a(0xfc8)]),this;}['update'](){const _0x2303c6={_0x16f8ea:0x4af,_0x35d6f2:0x90a},_0x129bc6=_0x35a251;this['_primitive']&&this['primitiveCollection'][_0x129bc6(0x1ee)](this['_primitive']),this['_primitive']=this['_createVideoPrimitive'](),this['primitiveCollection'][_0x129bc6(_0x2303c6._0x16f8ea)](this[_0x129bc6(_0x2303c6._0x35d6f2)]);}['_createVideoPrimitive'](){const _0x5dfe5c={_0x4af977:0x614,_0x42f5ae:0xd7,_0x609d1:0x71d,_0x21a470:0x14b,_0x2f65d8:0xfc8,_0x10dbb5:0xe08,_0x202011:0xe5,_0x1d3eae:0xc60,_0x5a8aad:0xdb8,_0x10e30a:0xbf2,_0x7853c:0x2b3,_0x534e83:0x2cf,_0x76746d:0x768,_0x4aaeef:0x534},_0x118632=_0x35a251,_0x55e9b2=this['_positions_grid']['length'],_0x3d92f5=new Float64Array(_0x55e9b2*0x3);for(let _0x20a550=0x0;_0x20a550<_0x55e9b2;++_0x20a550){_0x3d92f5[_0x20a550*0x3]=this['_positions_grid'][_0x20a550]['x'],_0x3d92f5[_0x20a550*0x3+0x1]=this['_positions_grid'][_0x20a550]['y'],_0x3d92f5[_0x20a550*0x3+0x2]=this[_0x118632(0x1b8)][_0x20a550]['z'];}const _0x3ad7ac=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x3d92f5}),'st':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x118632(_0x5dfe5c._0x4af977)]['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(this['_uv'])})},'indices':new Uint16Array(this[_0x118632(_0x5dfe5c._0x42f5ae)]),'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x3d92f5)}),_0x428b20=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':_0x3ad7ac,'attributes':{'show':new Cesium__namespace[(_0x118632(_0x5dfe5c._0x609d1))](this['show']),'distanceDisplayCondition':new Cesium__namespace['DistanceDisplayConditionGeometryInstanceAttribute'](Number(this['style'][_0x118632(_0x5dfe5c._0x21a470)]??0x0),Number(this[_0x118632(_0x5dfe5c._0x2f65d8)]['distanceDisplayCondition_far']??Number['MAX_VALUE']))}}),_0x1031ac=Cesium__namespace['Material']['fromType']('Image');_0x1031ac['uniforms'][_0x118632(0xdb2)]=this[_0x118632(0x456)];const _0x2f1e3a=new Float32Array(this[_0x118632(_0x5dfe5c._0x10dbb5)]),_0x17e08f=_0x2f1e3a['length']/0x4;_0x1031ac['uniforms'][_0x118632(_0x5dfe5c._0x202011)]=new Cesium__namespace['Texture']({'context':this['_map'][_0x118632(_0x5dfe5c._0x1d3eae)]['context'],'source':{'width':_0x17e08f,'height':0x1,'arrayBufferView':_0x2f1e3a},'pixelDatatype':Cesium__namespace['PixelDatatype']['FLOAT']}),_0x1031ac['_uniforms']['roiUV0']=()=>{return _0x1031ac['uniforms']['roiUV'];},_0x1031ac[_0x118632(0x2b3)][_0x118632(_0x5dfe5c._0x5a8aad)]=()=>{return this['_useROI'];},_0x1031ac['_uniforms']['reverseROI']=()=>{return this['_reverseROI'];},_0x1031ac['_uniforms'][_0x118632(_0x5dfe5c._0x10e30a)]=()=>{return this['style']['opacity'];},_0x1031ac[_0x118632(_0x5dfe5c._0x7853c)][_0x118632(_0x5dfe5c._0x534e83)]=()=>{return this['style']['globalAlpha']??0x1;},_0x1031ac['shaderSource']='\x0a\x20\x20\x20\x20\x20\x20const\x20int\x20WIDTH\x20=\x20'+_0x17e08f+_0x118632(0x331);const _0x231f4e={'geometryInstances':_0x428b20,'asynchronous':![],'appearance':new Cesium__namespace[(_0x118632(_0x5dfe5c._0x76746d))]({...this['style'],'material':_0x1031ac})},_0x2dae5d=new Cesium__namespace['Primitive'](_0x231f4e);return this[_0x118632(_0x5dfe5c._0x4aaeef)](_0x2dae5d),_0x2dae5d;}['updateVideoContainer'](){const _0x1bdb30={_0x494954:0x803,_0x1fbfbd:0xfa2,_0x32cafe:0xbc3,_0x124c66:0x94f},_0x2b41b2=_0x35a251;var _0x28f92e;this['_hasRemoveElement']&&(_0x28f92e=this['_videoContainer'])!==null&&_0x28f92e!==void 0x0&&_0x28f92e['parentNode']&&(this['_videoContainer'][_0x2b41b2(_0x1bdb30._0x494954)][_0x2b41b2(_0x1bdb30._0x1fbfbd)](this['_videoContainer']),delete this[_0x2b41b2(_0x1bdb30._0x32cafe)],delete this['_videoContainer']);if(this[_0x2b41b2(0xfc8)]['url'])this['_videoContainer']=createVideo(this['style']['url'],this['style']['fileType'],'',document[_0x2b41b2(0x8a6)]),this['_videoContainer']['style']['display']='none',this['_hasRemoveElement']=!![];else this['style']['container']&&(this['_videoContainer']=this['style'][_0x2b41b2(_0x1bdb30._0x124c66)]);}['_getDrawEntityClass'](_0x51df45,_0x20b464){const _0xca8480={_0x4933a3:0xfc8},_0xf087=_0x35a251;_0x51df45['minPointNum']=0x4,_0x51df45['maxPointNum']=0x4,_0x51df45[_0xf087(0xfc8)][_0xf087(0x472)]='Image',_0x51df45[_0xf087(_0xca8480._0x4933a3)]['materialOptions']={'url':this['_videoContainer']};const _0x5aad63=create$4('polygon',_0x51df45);return _0x5aad63;}['_startEditingHook'](_0x573dda){this['_hierarchy']&&(_0x573dda['_hierarchy']=this['_hierarchy']);}get['isEditingGrid'](){return this['_enabledEditGrid'];}['startEditingGrid'](){const _0x414435={_0x446f91:0xa0f,_0x41d2cd:0xd79,_0x578dbd:0xb0,_0x971f10:0x3df,_0x1c7e44:0x3df},_0x3f2985=_0x35a251;if(this['_enabledEditGrid'])return this;this[_0x3f2985(_0x414435._0x446f91)]=!![];if(!this['_map'])throw new Error('编辑时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this[_0x3f2985(0x338)](),this[_0x3f2985(_0x414435._0x41d2cd)]['mouseEvent']['noPickEntity']=this['_entity'],this['_map'][_0x3f2985(_0x414435._0x578dbd)]['enabledMoveTarget']=![],!this['editingGrid']&&(this['editingGrid']=new EditPolygonGrid(this),this[_0x3f2985(_0x414435._0x971f10)]['getGridPositions']=_0x24edd9=>{return this['_positions_grid'];},this['editingGrid']['updateGridPositions']=(_0x227a9f,_0x2f0e8d)=>{const _0x5f38bd=_0x3f2985;this['_positions_grid'][_0x2f0e8d]=_0x227a9f,this[_0x5f38bd(0x182)]();}),this[_0x3f2985(_0x414435._0x1c7e44)]['activate']&&this['editingGrid']['activate']();}['stopEditingGrid'](){const _0xfab077=_0x35a251;var _0x540bb9;if(!this[_0xfab077(0xa0f)]||!this['isAdded'])return this;(_0x540bb9=this['editingGrid'])!==null&&_0x540bb9!==void 0x0&&_0x540bb9[_0xfab077(0x636)]&&this['editingGrid']['disable'](),this[_0xfab077(0xd79)]&&(this['_map'][_0xfab077(0x604)](),this['_map']['mouseEvent']['noPickEntity']=null,this['_map']['mouseEvent']['enabledMoveTarget']=!![]),this['_enabledEditGrid']=![];}}register$4(_0x35a251(0x775),VideoPrimitive);function getGridPositions(_0x11d154,_0x3b526b){const _0x219719={_0x1794d1:0x8eb,_0x37f43d:0x8eb,_0x5525b5:0xddc,_0x9514d2:0xeed,_0x1f525e:0x6de,_0x39c1e2:0x6de},_0x3e358b=_0x35a251,_0x62fb8a=[],_0x1bcb23=[],_0x1fbf13=[],_0x57df91=_0x11d154[0x0],_0x4d64e0=_0x11d154[0x1],_0x36786f=_0x11d154[0x2],_0x138bb7=_0x11d154[0x3],_0x14b216=Cesium__namespace['Cartesian3']['distance'](_0x57df91,_0x138bb7),_0x54b05d=Cesium__namespace['Cartesian3']['distance'](_0x4d64e0,_0x36786f),_0x4c6282=_0x14b216/_0x3b526b,_0x4e9d84=_0x54b05d/_0x3b526b,_0x11b3c4=Cesium__namespace['Cartesian3'][_0x3e358b(0xebd)](Cesium__namespace['Cartesian3']['subtract'](_0x138bb7,_0x57df91,new Cesium__namespace[(_0x3e358b(0x8eb))]()),new Cesium__namespace[(_0x3e358b(_0x219719._0x1794d1))]()),_0x33c90c=Cesium__namespace[_0x3e358b(0x8eb)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x36786f,_0x4d64e0,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x374bf6=0x1/_0x3b526b;for(let _0x2aba2a=0x0;_0x2aba2a<=_0x3b526b;_0x2aba2a++){for(let _0x14871c=0x0;_0x14871c<=_0x3b526b;_0x14871c++){const _0x4c3d28=Cesium__namespace['Cartesian3']['add'](Cesium__namespace[_0x3e358b(0x8eb)]['multiplyByScalar'](_0x11b3c4,_0x2aba2a*_0x4c6282,new Cesium__namespace['Cartesian3']()),_0x57df91,new Cesium__namespace['Cartesian3']()),_0x4ed01d=Cesium__namespace[_0x3e358b(_0x219719._0x37f43d)]['add'](Cesium__namespace['Cartesian3'][_0x3e358b(_0x219719._0x5525b5)](_0x33c90c,_0x2aba2a*_0x4e9d84,new Cesium__namespace['Cartesian3']()),_0x4d64e0,new Cesium__namespace['Cartesian3']()),_0x230407=Cesium__namespace[_0x3e358b(0x8eb)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x4ed01d,_0x4c3d28,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x3d5635=Cesium__namespace['Cartesian3'][_0x3e358b(_0x219719._0x9514d2)](_0x4ed01d,_0x4c3d28),_0x4daa3f=_0x3d5635/_0x3b526b,_0x12ddad=Cesium__namespace['Cartesian3']['add'](Cesium__namespace[_0x3e358b(_0x219719._0x37f43d)]['multiplyByScalar'](_0x230407,_0x14871c*_0x4daa3f,new Cesium__namespace['Cartesian3']()),_0x4c3d28,new Cesium__namespace[(_0x3e358b(_0x219719._0x1794d1))]());_0x62fb8a['push'](_0x14871c*_0x374bf6),_0x62fb8a['push'](0x1-_0x2aba2a*_0x374bf6),_0x1bcb23['push'](_0x12ddad);}}for(let _0x3aa6ce=0x0;_0x3aa6ce<_0x3b526b;_0x3aa6ce++){for(let _0x21de5a=0x0;_0x21de5a<_0x3b526b;_0x21de5a++){const _0xc21f03=_0x3aa6ce*(_0x3b526b+0x1)+_0x21de5a,_0x8ca810=(_0x3aa6ce+0x1)*(_0x3b526b+0x1)+_0x21de5a;_0x1fbf13[_0x3e358b(_0x219719._0x1f525e)](_0xc21f03),_0x1fbf13['push'](_0xc21f03+0x1),_0x1fbf13[_0x3e358b(_0x219719._0x39c1e2)](_0x8ca810+0x1),_0x1fbf13['push'](_0x8ca810+0x1),_0x1fbf13['push'](_0x8ca810),_0x1fbf13['push'](_0xc21f03);}}return{'uv':_0x62fb8a,'indice':_0x1fbf13,'positions':_0x1bcb23};}class BaseCombine extends BasePrimitive{get['instances'](){const _0x339577={_0xef93a6:0xe86},_0x3b6bf3=_0x35a251;return this[_0x3b6bf3(_0x339577._0xef93a6)][_0x3b6bf3(0x3d7)]||[];}set['instances'](_0x58a4cb){const _0x3b7c98=_0x35a251;this[_0x3b7c98(0xe86)][_0x3b7c98(0x3d7)]=_0x58a4cb,this['_rectangle']=null,this['redraw']();}[_0x35a251(0xbba)](_0x2c8fd){const _0x59888e={_0x54cd82:0xe1e},_0x18a13d=_0x35a251,_0x31a68d=_0x2c8fd['split']('#');if(_0x31a68d[_0x18a13d(_0x59888e._0x54cd82)]!==0x2)return null;const _0x31c028=Number(_0x31a68d[0x1]);return this['instances'][_0x31c028];}['createPickId'](_0x2eedb9){return this['id']+'#'+_0x2eedb9;}['_createGeometryInstance'](_0x3f703f,_0x20ca29){const _0x1c831d={_0x4cb09e:0x3d7,_0x56a66f:0x6de},_0x4a9aa7=_0x35a251;if(this['options']['geometryInstances'])return this['options'][_0x4a9aa7(0x9aa)];const _0x20b131=[],_0x37b35f=this[_0x4a9aa7(_0x1c831d._0x4cb09e)];for(let _0x3ed748=0x0;_0x3ed748<_0x37b35f[_0x4a9aa7(0xe1e)];_0x3ed748++){const _0xb81d6f=_0x37b35f[_0x3ed748];_0xb81d6f['id']=this['createPickId'](_0x3ed748),_0x20b131[_0x4a9aa7(_0x1c831d._0x56a66f)](_0xb81d6f);}return _0x20b131;}[_0x35a251(0x878)](_0x5a784e){const _0x465632={_0x244442:0xe1e,_0x5e34ad:0x48e},_0x3ecfc2=_0x35a251;if(!this['_rectangle']){const _0x430372=this['options']['instances']||[];for(let _0x58b06b=0x0;_0x58b06b<_0x430372[_0x3ecfc2(_0x465632._0x244442)];_0x58b06b++){const _0x10b902=_0x430372[_0x58b06b];_0x10b902['position']&&(_0x10b902['position']=LngLatPoint['parse'](_0x10b902['position'])['toCartesian'](),this[_0x3ecfc2(_0x465632._0x5e34ad)]([_0x10b902['position']])),_0x10b902[_0x3ecfc2(0xb35)]&&(_0x10b902['positions']=LngLatArray[_0x3ecfc2(0xcf)](_0x10b902['positions']),this['_unionRectangle'](_0x10b902['positions']));}}return _0x5a784e!==null&&_0x5a784e!==void 0x0&&_0x5a784e['isFormat']?formatRectangle(this['_rectangle']):this['_rectangle'];}[_0x35a251(0x48e)](_0x330d04){const _0x2bd333=_0x35a251,_0x375326=Cesium__namespace['Rectangle'][_0x2bd333(0x4c2)](_0x330d04);if(!Cesium__namespace['defined'](_0x375326))return;Cesium__namespace['defined'](this['_rectangle'])?this[_0x2bd333(0xc02)]=Cesium__namespace['Rectangle']['union'](_0x375326,this['_rectangle']):this['_rectangle']=_0x375326;}['toJSON'](){const _0x40c875={_0x2a1d79:0xe1e},_0x110ad8=_0x35a251,_0xe66265={...getAttrVal(this['options'],{'onlySimpleType':!![]}),'type':this[_0x110ad8(0x8ea)]};this['options'][_0x110ad8(0xfc8)]&&(_0xe66265['style']=this['_style2JsonBase'](this['options']['style'],![]));const _0x43257a=[];for(let _0x29f45c=0x0;_0x29f45c0x0&&this['options']['instances'][0x0]['style']['width']?this['_pointSize']=_0x138e93*this[_0x1b6c59(_0x2f900d._0x536380)]['instances'][0x0][_0x1b6c59(_0x2f900d._0x55589e)]['width']:this['_pointSize']=_0x138e93*this['options'][_0x1b6c59(_0x2f900d._0x6eb9c7)]['width'],this[_0x1b6c59(_0x2f900d._0x4f65d8)]={},this['textureDef']=new Cesium__namespace['Texture']({'context':this[_0x1b6c59(0xd79)]['scene']['context'],'width':0x1f4,'height':0x1f4}),this['options']['instances']&&this['redraw'](),this[_0x1b6c59(0xd79)]['on'](EventType['morphComplete'],this['_onMorphComplete'],this),this['primitiveCollection']['add'](this);}['_removedHook'](){const _0x25eaa4={_0x50eabe:0x386},_0x2869cd=_0x35a251;this['_map'][_0x2869cd(0x6b2)](EventType[_0x2869cd(0xd69)],this['_onMorphComplete'],this),this[_0x2869cd(_0x25eaa4._0x50eabe)](),this['textureDef']['destroy'](),delete this[_0x2869cd(0xd9)],this['_noDestroy']=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![];}['clear'](){this['_removeCollectionBy2D'](),this['_removeCollectionBy3D']();}[_0x35a251(0xaf9)](){const _0x373eea=_0x35a251;if(!this['_map'])return;this['clear']();const _0x2333f2=this['instances'];if(_0x2333f2)for(let _0x1255ab=0x0,_0x57cb23=_0x2333f2['length'];_0x1255ab<_0x57cb23;_0x1255ab++){const _0x50a33e=_0x2333f2[_0x1255ab];_0x50a33e['position']=LngLatPoint['toCartesian'](_0x50a33e['position']);}this[_0x373eea(0xd79)]['scene']['mode']===Cesium__namespace['SceneMode']['SCENE3D']?this['_initCollectionBy3D']():this[_0x373eea(0xc7f)]();}['_onMorphComplete'](_0x4064fd){this['redraw']();}[_0x35a251(0x182)](_0x30f4af){const _0x4d8c49={_0x550f9c:0x7c4},_0x27a7a4=_0x35a251;if(!this[_0x27a7a4(0xd79)])return;if(!this[_0x27a7a4(0x987)]){this['_removeCollectionBy2D']();return;}_0x30f4af['mode']===Cesium__namespace['SceneMode']['SCENE3D']?_0x30f4af['passes']['render']?this[_0x27a7a4(0x7c4)]&&_0x30f4af['commandList']['push'](...this[_0x27a7a4(_0x4d8c49._0x550f9c)]):this['_pickCommands']&&_0x30f4af['commandList']['push'](...this['_pickCommands']):!this['billboardCollection']&&this['_initCollectionBy2D']();}['_initCollectionBy2D'](){const _0x253b17={_0x68e852:0x3d7,_0x6d1da6:0xfc8,_0x3f966b:0xbb5,_0x3cb300:0x7ba,_0x78d484:0x682,_0x26a8d7:0x534},_0x24e86e=_0x35a251,_0x1fdd8d=this[_0x24e86e(_0x253b17._0x68e852)];if(!_0x1fdd8d)return;this[_0x24e86e(0xb8e)]=[];for(let _0x147d7c=0x0,_0x3f70b0=_0x1fdd8d['length'];_0x147d7c<_0x3f70b0;_0x147d7c++){const _0x582101=_0x1fdd8d[_0x147d7c],_0x5ed2a1={...this['options']['style'],..._0x582101[_0x24e86e(_0x253b17._0x6d1da6)]},_0x2e79ec=this[_0x24e86e(_0x253b17._0x3f966b)]['add']({'id':this['createPickId'](_0x147d7c),'position':_0x582101['position'],'image':_0x5ed2a1['image'],'scale':0x1,'rotation':Cesium__namespace['Math'][_0x24e86e(_0x253b17._0x3cb300)](_0x5ed2a1['angle']||0x0),'width':_0x5ed2a1['width'],'height':_0x5ed2a1[_0x24e86e(_0x253b17._0x78d484)]||_0x5ed2a1['width']});this[_0x24e86e(_0x253b17._0x26a8d7)](_0x2e79ec),this['_billboard2DList']['push'](_0x2e79ec);}}['_removeCollectionBy2D'](){const _0x51a3a3={_0x59c28a:0xe1e},_0x39bf1a=_0x35a251;if(!this['billboardCollection']||!this['_billboard2DList'])return;for(let _0x300472=this['_billboard2DList'][_0x39bf1a(_0x51a3a3._0x59c28a)]-0x1;_0x300472>=0x0;_0x300472--){const _0x3393f7=this['_billboard2DList'][_0x300472];this['billboardCollection']['remove'](_0x3393f7);}this[_0x39bf1a(0xb8e)]=[];}[_0x35a251(0x159)](){const _0x1eb3e4={_0x4f41ac:0xe1e},_0x3e4b1f=_0x35a251,_0x401cec=this['instances'];if(!_0x401cec)return;const _0x5b87db={};for(let _0x27ac78=0x0,_0x354ead=_0x401cec[_0x3e4b1f(_0x1eb3e4._0x4f41ac)];_0x27ac78<_0x354ead;_0x27ac78++){var _0x3b4e39;const _0x58d2c2=_0x401cec[_0x27ac78];_0x58d2c2['index']=_0x27ac78;const _0x3cbb8e=(_0x3b4e39=_0x58d2c2['style'])===null||_0x3b4e39===void 0x0?void 0x0:_0x3b4e39['image'];if(!_0x3cbb8e)continue;!_0x5b87db[_0x3cbb8e]&&(_0x5b87db[_0x3cbb8e]=[]),_0x5b87db[_0x3cbb8e]['push'](_0x58d2c2);}const _0x20b84b=[];for(const _0x1ca806 in _0x5b87db){const _0x475308=_0x5b87db[_0x1ca806],_0x4f1a5c=_0x1ca806;this[_0x3e4b1f(0xf24)](_0x4f1a5c);for(const _0xaef936 of _0x475308){const _0x12ffaa=this['createDrawCommand'](_0x4f1a5c,_0xaef936);_0x20b84b['push'](_0x12ffaa);}}this['_drawCommands']=_0x20b84b;}['_removeCollectionBy3D'](){const _0x506ed9={_0x589368:0x7c4,_0x592862:0x275},_0x134776={_0x25e68b:0x57f,_0x3661ff:0xa63},_0x137387=_0x35a251;this['_drawCommands']&&this[_0x137387(0x7c4)]['length']>0x0&&(this[_0x137387(_0x506ed9._0x589368)][_0x137387(0xdbd)](function(_0x477fd2){const _0x486b6f=_0x137387;_0x477fd2['vertexArray']&&_0x477fd2[_0x486b6f(0xf7c)]['destroy'](),_0x477fd2['shaderProgram']&&_0x477fd2[_0x486b6f(_0x134776._0x25e68b)][_0x486b6f(_0x134776._0x3661ff)]();}),delete this['_drawCommands']);this['_pickCommands']&&this['_pickCommands']['length']>0x0&&(this[_0x137387(0xd2)][_0x137387(0xdbd)](function(_0x1be6f2){_0x1be6f2['vertexArray']&&_0x1be6f2['vertexArray']['destroy'](),_0x1be6f2['shaderProgram']&&_0x1be6f2['shaderProgram']['destroy']();}),delete this['_pickCommands']);for(const _0x392c2e in this[_0x137387(_0x506ed9._0x592862)]){this['textures'][_0x392c2e]&&this[_0x137387(0x275)][_0x392c2e][_0x137387(0xa63)]();}this[_0x137387(0x275)]={};}['prepareTexture'](_0x47f011){const _0xc497ba={_0x4455a2:0xb19},_0x4c9745=_0x35a251,_0x15b913=new Image();_0x15b913[_0x4c9745(_0xc497ba._0x4455a2)]=_0x32e977=>{const _0x2e416b=_0x4c9745,_0xf36148=new Cesium__namespace['Texture']({'context':this['_map']['scene']['context'],'source':_0x15b913});this[_0x2e416b(0x275)][_0x47f011]=_0xf36148;},_0x15b913['src']=_0x47f011;}[_0x35a251(0xa2)](_0x16e2cf){const _0xe7d186={_0x3e9e35:0xb61,_0x26635a:0xfc8,_0x35d628:0x6de,_0x1678fe:0x6de,_0x1d2fee:0x6de,_0x473f59:0x6de,_0x40d184:0x6de,_0x1237be:0x6a7,_0x4288ee:0xebd,_0x1bbe3d:0x85a},_0x4eae20=_0x35a251,_0x1cf70a=[],_0x37509f=[],_0x1a2437=[],_0xc4cb9e=[],_0x619140=[];for(let _0xe9cd1d=0x0,_0x482328=_0x16e2cf['length'];_0xe9cd1d<_0x482328;_0xe9cd1d++){const _0x42a27d=_0x16e2cf[_0xe9cd1d],_0x266642=_0x42a27d[_0x4eae20(_0xe7d186._0x3e9e35)],_0x47dd43={...this['options'][_0x4eae20(0xfc8)],..._0x42a27d[_0x4eae20(_0xe7d186._0x26635a)]};_0x1a2437['push'](_0xe9cd1d*0x4+0x0),_0x1a2437['push'](_0xe9cd1d*0x4+0x2),_0x1a2437['push'](_0xe9cd1d*0x4+0x1),_0x1a2437[_0x4eae20(_0xe7d186._0x35d628)](_0xe9cd1d*0x4+0x0),_0x1a2437[_0x4eae20(0x6de)](_0xe9cd1d*0x4+0x3),_0x1a2437['push'](_0xe9cd1d*0x4+0x2);const _0x4a010f=new Float32Array(0x6);_0x4a010f[0x0]=_0x266642['x'],_0x4a010f[0x1]=_0x266642['x']-_0x4a010f[0x0],_0x4a010f[0x2]=_0x266642['y'],_0x4a010f[0x3]=_0x266642['y']-_0x4a010f[0x2],_0x4a010f[0x4]=_0x266642['z'],_0x4a010f[0x5]=_0x266642['z']-_0x4a010f[0x4],_0x1cf70a['push'](_0x4a010f[0x0]),_0x1cf70a[_0x4eae20(_0xe7d186._0x35d628)](_0x4a010f[0x2]),_0x1cf70a['push'](_0x4a010f[0x4]),_0x37509f['push'](_0x4a010f[0x1]),_0x37509f['push'](_0x4a010f[0x3]),_0x37509f['push'](_0x4a010f[0x5]),_0x1cf70a['push'](_0x4a010f[0x0]),_0x1cf70a['push'](_0x4a010f[0x2]),_0x1cf70a['push'](_0x4a010f[0x4]),_0x37509f[_0x4eae20(0x6de)](_0x4a010f[0x1]),_0x37509f[_0x4eae20(0x6de)](_0x4a010f[0x3]),_0x37509f[_0x4eae20(_0xe7d186._0x1678fe)](_0x4a010f[0x5]),_0x1cf70a[_0x4eae20(_0xe7d186._0x1d2fee)](_0x4a010f[0x0]),_0x1cf70a[_0x4eae20(0x6de)](_0x4a010f[0x2]),_0x1cf70a[_0x4eae20(_0xe7d186._0x473f59)](_0x4a010f[0x4]),_0x37509f[_0x4eae20(_0xe7d186._0x1d2fee)](_0x4a010f[0x1]),_0x37509f[_0x4eae20(_0xe7d186._0x35d628)](_0x4a010f[0x3]),_0x37509f[_0x4eae20(0x6de)](_0x4a010f[0x5]),_0x1cf70a[_0x4eae20(_0xe7d186._0x35d628)](_0x4a010f[0x0]),_0x1cf70a['push'](_0x4a010f[0x2]),_0x1cf70a['push'](_0x4a010f[0x4]),_0x37509f['push'](_0x4a010f[0x1]),_0x37509f['push'](_0x4a010f[0x3]),_0x37509f['push'](_0x4a010f[0x5]),_0xc4cb9e[_0x4eae20(0x6de)](0x0,0x0),_0xc4cb9e['push'](0x0,0x1),_0xc4cb9e[_0x4eae20(_0xe7d186._0x40d184)](0x1,0x1),_0xc4cb9e[_0x4eae20(_0xe7d186._0x1d2fee)](0x1,0x0);const _0x1c4dc1=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x266642),_0x28325b=_0x47dd43['angle']||0x0,_0x2928f2=Cesium__namespace['Matrix3']['fromRotationZ'](Cesium__namespace['Math']['toRadians'](_0x28325b)),_0x53eab4=Cesium__namespace[_0x4eae20(_0xe7d186._0x1237be)]['fromRotationTranslation'](_0x2928f2),_0x5d6105=Cesium__namespace['Matrix4']['multiply'](_0x1c4dc1,_0x53eab4,new Cesium__namespace['Matrix4']()),_0x6a01eb=0x1,_0x3c111e=(_0x47dd43['height']||_0x47dd43['width'])/_0x47dd43['width'],_0x3a0240=new Cesium__namespace['Cartesian3'](-_0x6a01eb,-_0x3c111e,0x0);Cesium__namespace[_0x4eae20(0x6a7)]['multiplyByPointAsVector'](_0x5d6105,_0x3a0240,_0x3a0240),Cesium__namespace['Cartesian3']['normalize'](_0x3a0240,_0x3a0240),_0x619140[_0x4eae20(0x6de)](_0x3a0240['x'],_0x3a0240['y'],_0x3a0240['z']);const _0x4fc4d6=new Cesium__namespace[(_0x4eae20(0x8eb))](-_0x6a01eb,_0x3c111e,0x0);Cesium__namespace[_0x4eae20(0x6a7)]['multiplyByPointAsVector'](_0x5d6105,_0x4fc4d6,_0x4fc4d6),Cesium__namespace['Cartesian3'][_0x4eae20(_0xe7d186._0x4288ee)](_0x4fc4d6,_0x4fc4d6),_0x619140['push'](_0x4fc4d6['x'],_0x4fc4d6['y'],_0x4fc4d6['z']);const _0x1cd91f=new Cesium__namespace['Cartesian3'](_0x6a01eb,_0x3c111e,0x0);Cesium__namespace['Matrix4'][_0x4eae20(_0xe7d186._0x1bbe3d)](_0x5d6105,_0x1cd91f,_0x1cd91f),Cesium__namespace[_0x4eae20(0x8eb)]['normalize'](_0x1cd91f,_0x1cd91f),_0x619140['push'](_0x1cd91f['x'],_0x1cd91f['y'],_0x1cd91f['z']);const _0x2fbda9=new Cesium__namespace['Cartesian3'](_0x6a01eb,-_0x3c111e,0x0);Cesium__namespace['Matrix4']['multiplyByPointAsVector'](_0x5d6105,_0x2fbda9,_0x2fbda9),Cesium__namespace['Cartesian3']['normalize'](_0x2fbda9,_0x2fbda9),_0x619140[_0x4eae20(_0xe7d186._0x1678fe)](_0x2fbda9['x'],_0x2fbda9['y'],_0x2fbda9['z']);}return{'index':new Uint16Array(_0x1a2437),'vertex_H':{'values':new Float32Array(_0x1cf70a),'componentDatatype':'DOUBLE','componentsPerAttribute':0x3},'vertex_L':{'values':new Float32Array(_0x37509f),'componentDatatype':'DOUBLE','componentsPerAttribute':0x3},'uv':{'values':new Float32Array(_0xc4cb9e),'componentDatatype':'FLOAT','componentsPerAttribute':0x2},'color':{'values':new Float32Array(_0x619140),'componentDatatype':_0x4eae20(0xf4e),'componentsPerAttribute':0x3}};}[_0x35a251(0x297)](_0x1ff0f1,_0x49a02e){const _0x3f1a3e={_0x58a353:0xc60,_0x15baa6:0xd48,_0x1c5ee5:0xd48,_0x381f85:0x51e,_0x510522:0xae8,_0xd0856:0x90,_0xaac43:0xd67,_0x2cc711:0xd7d,_0x3792fc:0xea3,_0xbfd31b:0xeb5,_0x4001ff:0x96a,_0x25ff70:0xba4,_0x2ef5ff:0x818},_0xdf90ba={_0x2cf31c:0x7a4},_0x378652={_0x1cbe9c:0x275},_0x758a71={_0x4f0dfc:0x9f6},_0x4fffab={_0x29b8d0:0x19c},_0x2ed6a3=_0x35a251,_0x393d0f=this['_map'][_0x2ed6a3(_0x3f1a3e._0x58a353)][_0x2ed6a3(0x390)],_0x77c5de=this['options'][_0x2ed6a3(0x6e7)]??![],_0x5c73be=Cesium__namespace['RenderState'][_0x2ed6a3(_0x3f1a3e._0x15baa6)]({'depthTest':{'enabled':!![],'func':_0x77c5de?Cesium__namespace['WebGLConstants'][_0x2ed6a3(0x1f8)]:Cesium__namespace['WebGLConstants']['LESS']},'depthMask':_0x77c5de,'blending':Cesium__namespace['BlendingState']['ALPHA_BLEND']}),_0x4cc1ce={'position3DHigh':0x0,'position3DLow':0x1,'color':0x2,'st':0x3},_0x1d3b59=Cesium__namespace['ShaderProgram'][_0x2ed6a3(_0x3f1a3e._0x1c5ee5)]({'context':_0x393d0f,'vertexShaderSource':FlatBillboardVS,'fragmentShaderSource':FlatBillboardFS,'attributeLocations':_0x4cc1ce}),_0x550c33=this[_0x2ed6a3(0xa2)]([_0x49a02e]),_0x482978=Cesium__namespace['Buffer']['createIndexBuffer']({'context':_0x393d0f,'typedArray':_0x550c33['index'],'usage':Cesium__namespace['BufferUsage'][_0x2ed6a3(_0x3f1a3e._0x381f85)],'indexDatatype':Cesium__namespace['IndexDatatype']['UNSIGNED_SHORT']}),_0x859287=new Cesium__namespace['VertexArray']({'context':_0x393d0f,'attributes':[{'index':0x0,'vertexBuffer':Cesium__namespace['Buffer'][_0x2ed6a3(_0x3f1a3e._0x510522)]({'context':_0x393d0f,'typedArray':_0x550c33[_0x2ed6a3(0xd7d)]['values'],'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),'componentsPerAttribute':0x3},{'index':0x1,'vertexBuffer':Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x393d0f,'typedArray':_0x550c33[_0x2ed6a3(_0x3f1a3e._0xd0856)]['values'],'usage':Cesium__namespace[_0x2ed6a3(0x256)]['STATIC_DRAW']}),'componentsPerAttribute':0x3},{'index':0x2,'vertexBuffer':Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x393d0f,'typedArray':_0x550c33['color']['values'],'usage':Cesium__namespace[_0x2ed6a3(0x256)]['STATIC_DRAW']}),'componentsPerAttribute':0x3},{'index':0x3,'vertexBuffer':Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x393d0f,'typedArray':_0x550c33['uv']['values'],'usage':Cesium__namespace['BufferUsage'][_0x2ed6a3(0x51e)]}),'componentsPerAttribute':0x2}],'indexBuffer':_0x482978}),_0x3fd8d2=this['_map'][_0x2ed6a3(0xc60)]['camera'],_0x4204a2=_0x393d0f['drawingBufferWidth'],_0x1e80d3=_0x393d0f['drawingBufferHeight'],_0x369588=new Cesium__namespace[(_0x2ed6a3(0x248))](_0x4204a2,_0x1e80d3),_0x58b8b8=Cesium__namespace['BoundingSphere'][_0x2ed6a3(_0x3f1a3e._0xaac43)](_0x550c33[_0x2ed6a3(_0x3f1a3e._0x2cc711)][_0x2ed6a3(_0x3f1a3e._0x3792fc)]);_0x58b8b8['radius']=0x2710;const _0x16b7cd=new Cesium__namespace[(_0x2ed6a3(_0x3f1a3e._0xbfd31b))]({'primitiveType':Cesium__namespace['PrimitiveType'][_0x2ed6a3(_0x3f1a3e._0x4001ff)],'shaderProgram':_0x1d3b59,'vertexArray':_0x859287,'modelMatrix':Cesium__namespace['Matrix4']['IDENTITY'],'renderState':_0x5c73be,'boundingVolume':_0x58b8b8,'uniformMap':{'mars_orthographicMatrix':()=>{const _0x59917e=_0x2ed6a3;if(_0x3fd8d2[_0x59917e(0x19c)][_0x59917e(0x4f1)]){var _0x10c167;return(_0x10c167=_0x3fd8d2[_0x59917e(_0x4fffab._0x29b8d0)]['_offCenterFrustum'])===null||_0x10c167===void 0x0?void 0x0:_0x10c167['_perspectiveMatrix'];}else return _0x3fd8d2[_0x59917e(0x19c)]['_orthographicMatrix'];},'mars_viewMatrix':()=>{const _0x1b68e8=_0x2ed6a3;return _0x3fd8d2[_0x1b68e8(_0x758a71._0x4f0dfc)];},'mars_resolution':()=>{return _0x369588;},'mars_pointSize':()=>{const _0x3441db=_0x2ed6a3;return this[_0x3441db(0x30b)];},'mars_image':()=>{const _0x2974ab=_0x2ed6a3;return this[_0x2974ab(_0x378652._0x1cbe9c)][_0x1ff0f1]||this['textureDef'];},'mars_distanceDisplayCondition':()=>{const _0x251014=_0x2ed6a3;return this[_0x251014(_0xdf90ba._0x2cf31c)];},'mars_positionWC':()=>{return _0x3fd8d2['positionWC'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':_0x77c5de?Cesium__namespace[_0x2ed6a3(_0x3f1a3e._0x25ff70)][_0x2ed6a3(0x79e)]:Cesium__namespace['Pass']['OPAQUE'],'pickOnly':!![],'pickCommand':new Cesium__namespace['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x16b7cd),_0x16b7cd['pickId']=_0x393d0f[_0x2ed6a3(_0x3f1a3e._0x2ef5ff)]({'primitive':_0x16b7cd,'id':this['createPickId'](_0x49a02e['index'])});const _0x52c189=new Cesium__namespace[(_0x2ed6a3(0xeb5))]({'owner':_0x16b7cd,'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'pickOnly':!![]});_0x52c189['vertexArray']=_0x859287,_0x52c189[_0x2ed6a3(0x5b0)]=_0x5c73be;const _0x1c6f47=Cesium__namespace[_0x2ed6a3(0xdac)][_0x2ed6a3(0xd48)]({'context':_0x393d0f,'vertexShaderSource':FlatBillboardVS,'fragmentShaderSource':Cesium__namespace['ShaderSource']['createPickFragmentShaderSource'](FlatBillboardFS,'uniform'),'attributeLocations':_0x4cc1ce});return _0x52c189['shaderProgram']=_0x1c6f47,_0x52c189['uniformMap']=_0x16b7cd['uniformMap'],_0x52c189['uniformMap']['czm_pickColor']=()=>{const _0x3b67b7=_0x2ed6a3;return _0x16b7cd[_0x3b67b7(0x45a)]['color'];},_0x52c189['pass']=_0x77c5de?Cesium__namespace['Pass']['TRANSLUCENT']:Cesium__namespace['Pass']['OPAQUE'],_0x52c189['boundingVolume']=_0x58b8b8,_0x52c189['modelMatrix']=Cesium__namespace['Matrix4']['IDENTITY'],!this['_pickCommands']&&(this['_pickCommands']=[]),this[_0x2ed6a3(0xd2)]['push'](_0x52c189),_0x16b7cd;}['setOpacity'](_0x3a6463){const _0x1e0337=_0x35a251;this[_0x1e0337(0xb8)]=_0x3a6463;}}register$4('flatBillboard',FlatBillboard,!![]);class BasePolyCombine extends BaseCombine{get['style'](){const _0x9b6ccc={_0x36239e:0xfc8},_0x5d92e7=_0x35a251;var _0x471754,_0x194c0d;if(((_0x471754=this['options'][_0x5d92e7(0x3d7)])===null||_0x471754===void 0x0?void 0x0:_0x471754['length'])>0x0&&this['options'][_0x5d92e7(0x3d7)][0x0]['style'])return{...this['options']['style']||{},...this['options']['instances'][0x0]['style']};return(_0x194c0d=this['options'])===null||_0x194c0d===void 0x0?void 0x0:_0x194c0d[_0x5d92e7(_0x9b6ccc._0x36239e)];}set[_0x35a251(0xfc8)](_0x585d2d){this['setStyle'](_0x585d2d);}['_createGeometryInstance'](_0x2596ac,_0x247fd8){const _0x5188f5=_0x35a251;this['_rectangle']=null,this['translucent']=![];const _0x309539=this[_0x5188f5(0x3d7)],_0x25d647=[];for(let _0x40e7cb=0x0;_0x40e7cb<_0x309539['length'];_0x40e7cb++){const _0x1d0e02=_0x309539[_0x40e7cb];if(_0x1d0e02 instanceof Cesium__namespace['GeometryInstance'])_0x1d0e02['id']=this[_0x5188f5(0x818)](_0x40e7cb),_0x25d647['push'](_0x1d0e02);else{const _0x571506=this['_createGeometryInstanceItem'](_0x2596ac,_0x247fd8,_0x1d0e02);_0x571506&&(_0x571506['id']=this['createPickId'](_0x40e7cb),_0x25d647['push'](_0x571506));}}return _0x25d647;}[_0x35a251(0xf52)](_0x327a06,_0xf26da1,_0x18f839){}[_0x35a251(0x9ff)](_0x2863ee){const _0x32938f=_0x35a251;return _0x2863ee[_0x32938f(0xb35)]?[LngLatArray['toCartesians'](_0x2863ee['positions'])]:null;}['_createPolylineOutline'](_0x4a4864){const _0x560985={_0x389e87:0xe1e,_0x8a9acc:0x233,_0x12692:0xfc8,_0x2a7706:0xe0e,_0x542d5:0x99c,_0x4909c3:0x373,_0x4064cc:0x93a,_0x36fe01:0x6f9,_0x1f5679:0x9f5,_0x3101ef:0x4d1,_0x4ac80d:0x30a,_0xddb59f:0x4af,_0x10d633:0x21c},_0x5929c8=_0x35a251,_0x352d03=this[_0x5929c8(0x3d7)],_0x50432a=[];let _0x2fedbe;for(let _0x20832a=0x0;_0x20832a<_0x352d03[_0x5929c8(_0x560985._0x389e87)];_0x20832a++){const _0x325fd9=_0x352d03[_0x20832a];let _0x83225e;if(_0x325fd9['style']&&(Cesium__namespace['defined'](_0x325fd9['style']['outline'])||Cesium__namespace['defined'](_0x325fd9[_0x5929c8(0xfc8)]['outlineStyle'])||Cesium__namespace['defined'](_0x325fd9['style'][_0x5929c8(0x218)])||Cesium__namespace['defined'](_0x325fd9['style'][_0x5929c8(_0x560985._0x8a9acc)])||Cesium__namespace[_0x5929c8(0xaa2)](_0x325fd9[_0x5929c8(_0x560985._0x12692)]['outlineWidth']))){const _0x12d595=this['_getOutlineStyle'](_0x325fd9['style']);if(!_0x12d595['show'])continue;_0x83225e={..._0x4a4864,..._0x12d595};}else _0x83225e=_0x4a4864;_0x2fedbe=PolylineStyleConver[_0x5929c8(0xc04)](_0x83225e);!_0x2fedbe['material']&&(_0x2fedbe['vertexFormat']=Cesium__namespace[_0x5929c8(_0x560985._0x2a7706)]['VERTEX_FORMAT']);const _0x369076=_0x83225e[_0x5929c8(0x979)]?Cesium__namespace[_0x5929c8(_0x560985._0x542d5)]:Cesium__namespace['PolylineGeometry'],_0x7800bd=_0x2fedbe['color']??Cesium__namespace['Color'][_0x5929c8(0x123)][_0x5929c8(_0x560985._0x4909c3)](0.5),_0x3693bd=this[_0x5929c8(0x9ff)](_0x325fd9);if(!_0x3693bd)return;for(let _0x651ec6=0x0,_0x589eef=_0x3693bd['length'];_0x651ec6<_0x589eef;_0x651ec6++){let _0xb087a4=_0x3693bd[_0x651ec6];Cesium__namespace['defined'](_0x325fd9[_0x5929c8(0xfc8)]['height'])&&(_0xb087a4=setPositionsHeight(_0xb087a4,_0x325fd9[_0x5929c8(_0x560985._0x12692)][_0x5929c8(0x682)]));_0xb087a4['length']>0x0&&(_0xb087a4=_0xb087a4[_0x5929c8(_0x560985._0x4064cc)](_0xb087a4[0x0]));const _0x465464=new Cesium__namespace[(_0x5929c8(0x291))]({'geometry':new _0x369076({..._0x2fedbe,'positions':_0xb087a4}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x5929c8(_0x560985._0x36fe01)](_0x7800bd),'distanceDisplayCondition':_0x2fedbe['distanceDisplayCondition']}});_0x50432a[_0x5929c8(0x6de)](_0x465464);}}const _0x16f063={...this['options'],'geometryInstances':_0x50432a,'show':this[_0x5929c8(0x987)]};delete _0x16f063['style'],delete _0x16f063['attr'];this[_0x5929c8(_0x560985._0x1f5679)](_0x4a4864,_0x2fedbe)?_0x16f063['appearance']=new Cesium__namespace['PolylineColorAppearance']({..._0x2fedbe}):_0x16f063['appearance']=new Cesium__namespace[(_0x5929c8(_0x560985._0x3101ef))]({..._0x2fedbe});let _0x4e04f1;return _0x2fedbe[_0x5929c8(0x979)]?_0x4e04f1=this['primitiveCollection']['add'](new Cesium__namespace[(_0x5929c8(_0x560985._0x4ac80d))](_0x16f063)):_0x4e04f1=this['primitiveCollection'][_0x5929c8(_0x560985._0xddb59f)](new Cesium__namespace[(_0x5929c8(_0x560985._0x10d633))](_0x16f063)),this['bindPickId'](_0x4e04f1),_0x4e04f1;}['_highlight_mouseEventHandler'](_0x56c579){const _0x449e9b={_0xd8d478:0x3ca,_0x10bdd2:0xaf0},_0x2a8f75=_0x35a251;this['_map'][_0x2a8f75(_0x449e9b._0xd8d478)]();const _0x3a7242=_0x56c579['pickedObject'];_0x3a7242&&(this[_0x2a8f75(0x582)]=_0x3a7242,this['_map'][_0x2a8f75(_0x449e9b._0x10bdd2)](this,this['_highlightOptions'],_0x56c579));}['openHighlight'](_0x23e1ec,_0x137de6=!![],_0x348982){const _0x3ba43c={_0x5d0a7c:0xd79,_0x548c35:0x91b,_0x116f02:0xd75},_0x5d217d=_0x35a251;_0x137de6&&(this[_0x5d217d(0xd79)]['closeHighlight'](),this[_0x5d217d(_0x3ba43c._0x5d0a7c)][_0x5d217d(_0x3ba43c._0x548c35)]=this);_0x348982&&(this['_last_pickedObject']=_0x348982);const _0x241fcb=_0x23e1ec||this[_0x5d217d(0x3eb)];if(this['_last_pickedObject']&&_0x241fcb){const _0x27c66e=PolygonStyleConver['toCesiumVal']({...this['_last_pickedObject']['data']['style'],..._0x241fcb}),_0x17f2a2=this['_getColorByColorMaterial'](_0x27c66e,![]);if(_0x17f2a2){const _0x54c37e=this[_0x5d217d(_0x3ba43c._0x116f02)](this[_0x5d217d(0x582)]['id']);_0x54c37e['color']=Cesium__namespace['ColorGeometryInstanceAttribute']['toValue'](_0x17f2a2),this['fire'](EventType['highlightOpen'],{},!![]);}}}['closeHighlight'](){const _0xa0e7e0={_0x32ca25:0xc04,_0x63733a:0x71a,_0x5dfcab:0x77b,_0x5b6f55:0x91b},_0x453a08=_0x35a251;var _0xf8dd30;if(this['_last_pickedObject']&&this[_0x453a08(0x90a)]){const _0x269bdf=PolygonStyleConver[_0x453a08(_0xa0e7e0._0x32ca25)](this['_last_pickedObject'][_0x453a08(0xce2)]['style']),_0x1f702e=this['_getColorByColorMaterial'](_0x269bdf,![]);if(_0x1f702e){const _0x1bdc1f=this['getGeometryInstanceAttributes'](this['_last_pickedObject']['id']);_0x1bdc1f&&(_0x1bdc1f['color']=Cesium__namespace[_0x453a08(_0xa0e7e0._0x63733a)]['toValue'](_0x1f702e),this['fire'](EventType[_0x453a08(_0xa0e7e0._0x5dfcab)],{},!![]));}delete this[_0x453a08(0x582)];}((_0xf8dd30=this['_map'])===null||_0xf8dd30===void 0x0?void 0x0:_0xf8dd30[_0x453a08(_0xa0e7e0._0x5b6f55)])===this&&this[_0x453a08(0xd79)]['_clearLastHighlight']();}['setStyle'](_0x469b16){const _0x1c7a11={_0xc50b1f:0xe86,_0x30788c:0x3d7,_0x5c0f92:0x212},_0x597ef1=_0x35a251,_0x1a2ba4=this[_0x597ef1(_0x1c7a11._0xc50b1f)][_0x597ef1(_0x1c7a11._0x30788c)]||[];for(let _0x3f177a=0x0;_0x3f177a<_0x1a2ba4['length'];_0x3f177a++){const _0x218d28=_0x1a2ba4[_0x3f177a];_0x218d28['style']&&(_0x218d28['style']=merge(_0x218d28[_0x597ef1(0xfc8)],_0x469b16));}return super[_0x597ef1(_0x1c7a11._0x5c0f92)](_0x469b16);}}class BasePointCombine extends BasePolyCombine{[_0x35a251(0xc2e)](_0x32e788,_0x3d7067){const _0x4cb682={_0x2d6854:0x7ba},_0x25c185=_0x35a251;if(_0x32e788['modelMatrix'])return _0x32e788['modelMatrix'];const _0x13cd7d=LngLatPoint['toCartesian'](_0x32e788['position']),_0x2d68ae=Cesium__namespace['Math'][_0x25c185(_0x4cb682._0x2d6854)](_0x3d7067['heading']||0x0),_0x5d9820=Cesium__namespace['Math']['toRadians'](_0x3d7067['pitch']||0x0),_0x5b363=Cesium__namespace['Math']['toRadians'](_0x3d7067[_0x25c185(0xba7)]||0x0),_0x22e7cb=Cesium__namespace['Transforms']['headingPitchRollToFixedFrame'](_0x13cd7d,new Cesium__namespace['HeadingPitchRoll'](_0x2d68ae,_0x5d9820,_0x5b363));return _0x22e7cb;}}class PlaneCombine extends BasePointCombine{['_conversionStyle'](_0x26883d){return PlaneStyleConver['toCesiumVal'](_0x26883d);}[_0x35a251(0x1e0)](_0x27fb1b,_0x44f511){return PlaneStyleConver['toJSON'](_0x27fb1b,_0x44f511);}[_0x35a251(0xf52)](_0x122e1a,_0x2835e8,_0x17e5d4){const _0x45832a={_0x59be8c:0x1f4,_0x216fa7:0xac,_0x43f6bc:0x6f9},_0x4410f5=_0x35a251,_0x46a86f=PlaneStyleConver['toCesiumVal']({...this['options']['style'],..._0x17e5d4[_0x4410f5(0xfc8)]||{}});_0x46a86f['vertexFormat']=_0x46a86f[_0x4410f5(0xdbe)]||_0x122e1a['vertexFormat'];let _0x45ef97=this['_getColorByColorMaterial'](_0x46a86f);_0x2835e8&&_0x46a86f[_0x4410f5(0x218)]&&(_0x45ef97=_0x46a86f['outlineColor']);_0x45ef97[_0x4410f5(_0x45832a._0x59be8c)]!==0x1&&(this['translucent']=!![]);const _0x699b17=this['_getModelMatrix'](_0x17e5d4,_0x46a86f),_0x58d297=_0x2835e8?Cesium__namespace[_0x4410f5(_0x45832a._0x216fa7)]:Cesium__namespace['PlaneGeometry'],_0x18ee84=new Cesium__namespace['GeometryInstance']({'geometry':new _0x58d297(_0x46a86f),'modelMatrix':_0x699b17,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x4410f5(_0x45832a._0x43f6bc)](_0x45ef97),'distanceDisplayCondition':_0x46a86f['distanceDisplayCondition']}});return _0x18ee84;}['_getModelMatrix'](_0x1f9acc,_0xa804c){const _0x41a844={_0x2c2531:0x8a0,_0x37a90a:0x2af,_0x242ca9:0xb7b,_0x1a5208:0x7ba,_0x461197:0x6a7},_0x8c22cc=_0x35a251;var _0xd9d361,_0x25471b;if(_0x1f9acc[_0x8c22cc(_0x41a844._0x2c2531)])return _0x1f9acc['modelMatrix'];const _0x357654=super['_getModelMatrix'](_0x1f9acc,_0xa804c);if(_0xa804c[_0x8c22cc(0xb3b)]===Cesium__namespace['Cartesian3']['UNIT_X']){const _0x114b8f=Cesium__namespace['Matrix4'][_0x8c22cc(0xf43)](Cesium__namespace['Matrix3'][_0x8c22cc(_0x41a844._0x37a90a)](Cesium__namespace['Math'][_0x8c22cc(0x7ba)](0x5a)));Cesium__namespace['Matrix4'][_0x8c22cc(_0x41a844._0x242ca9)](_0x357654,_0x114b8f,_0x357654);}else{if(_0xa804c['plane_normal']===Cesium__namespace['Cartesian3']['UNIT_Y']){const _0x5d106=Cesium__namespace['Matrix4'][_0x8c22cc(0xf43)](Cesium__namespace['Matrix3']['fromRotationY'](Cesium__namespace['Math'][_0x8c22cc(_0x41a844._0x1a5208)](0x5a)));Cesium__namespace[_0x8c22cc(_0x41a844._0x461197)]['multiply'](_0x357654,_0x5d106,_0x357654);}}const _0x307689=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](((_0xd9d361=_0xa804c['dimensions'])===null||_0xd9d361===void 0x0?void 0x0:_0xd9d361['x'])??0x1,((_0x25471b=_0xa804c['dimensions'])===null||_0x25471b===void 0x0?void 0x0:_0x25471b['y'])??0x1,0x1));return Cesium__namespace['Matrix4']['multiply'](_0x357654,_0x307689,_0x357654),_0x357654;}}register$4('planeC',PlaneCombine,!![]);class BoxCombine extends BasePointCombine{['_conversionStyle'](_0x2f036f){const _0x6b0e03=_0x35a251;return _0x2f036f[_0x6b0e03(0x5fe)]=_0x2f036f['closed']??!![],BoxStyleConver['toCesiumVal'](_0x2f036f);}['_style2Json'](_0x1e1e62,_0x492bf5){return BoxStyleConver['toJSON'](_0x1e1e62,_0x492bf5);}['_createGeometryInstanceItem'](_0x59e563,_0x5782b2,_0x1d7f88){const _0x364bd5={_0x503e3d:0xdbe,_0x53e9c6:0x1f4,_0x346edb:0xc98,_0x1cc2fe:0x6d3},_0x1754b2=_0x35a251,_0x466937=BoxStyleConver['toCesiumVal']({...this['options']['style'],..._0x1d7f88['style']||{}});_0x466937['vertexFormat']=_0x466937[_0x1754b2(_0x364bd5._0x503e3d)]||_0x59e563[_0x1754b2(_0x364bd5._0x503e3d)];let _0x16580a=this[_0x1754b2(0xac3)](_0x466937);_0x5782b2&&_0x466937['outlineColor']&&(_0x16580a=_0x466937[_0x1754b2(0x218)]);_0x16580a[_0x1754b2(_0x364bd5._0x53e9c6)]!==0x1&&(this['translucent']=!![]);const _0x4e992f=this['_getModelMatrix'](_0x1d7f88,_0x466937),_0x3c806f=_0x5782b2?Cesium__namespace['BoxOutlineGeometry']:Cesium__namespace[_0x1754b2(_0x364bd5._0x346edb)],_0x540138=new Cesium__namespace[(_0x1754b2(0x291))]({'geometry':_0x3c806f[_0x1754b2(_0x364bd5._0x1cc2fe)](_0x466937),'modelMatrix':_0x4e992f,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x16580a),'distanceDisplayCondition':_0x466937['distanceDisplayCondition']}});return _0x540138;}}register$4('boxC',BoxCombine,!![]);class CircleCombine extends BasePointCombine{[_0x35a251(0xbb)](_0x57c774){return CircleStyleConver['toCesiumVal'](_0x57c774);}['_style2Json'](_0x51f9ef,_0x1a12a0){const _0x1d4ff3={_0xa67b22:0x99e},_0x4435b0=_0x35a251;return CircleStyleConver[_0x4435b0(_0x1d4ff3._0xa67b22)](_0x51f9ef,_0x1a12a0);}['_createGeometryInstanceItem'](_0x465948,_0x18cc9e,_0x5c96a4){const _0x493e2a={_0x405dbe:0xac3,_0x30669b:0x6f9},_0x50b76b=_0x35a251,_0x3711c8=CircleStyleConver['toCesiumVal']({...this['options']['style'],..._0x5c96a4['style']||{}});_0x3711c8[_0x50b76b(0xdbe)]=_0x3711c8['vertexFormat']||_0x465948['vertexFormat'];let _0x595055=this[_0x50b76b(_0x493e2a._0x405dbe)](_0x3711c8);_0x18cc9e&&_0x3711c8['outlineColor']&&(_0x595055=_0x3711c8['outlineColor']);_0x595055['alpha']!==0x1&&(this['translucent']=!![]);_0x5c96a4['position']=LngLatPoint['parse'](_0x5c96a4[_0x50b76b(0xb61)])['toCartesian'](),_0x3711c8['center']=_0x5c96a4['position'];const _0x703107=_0x18cc9e?Cesium__namespace['CircleOutlineGeometry']:Cesium__namespace['CircleGeometry'],_0x35489=new Cesium__namespace['GeometryInstance']({'geometry':new _0x703107(_0x3711c8),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x50b76b(_0x493e2a._0x30669b)](_0x595055),'distanceDisplayCondition':_0x3711c8['distanceDisplayCondition']}});return _0x35489;}[_0x35a251(0x9ff)](_0x41e50f){const _0x5e4aff=_0x35a251,_0x581d2b=getEllipseOuterPositions({'position':_0x41e50f['position'],'radius':_0x41e50f[_0x5e4aff(0xfc8)][_0x5e4aff(0x907)],'granularity':_0x41e50f['style'][_0x5e4aff(0x4ea)]});return[_0x581d2b];}}register$4('circleC',CircleCombine,!![]);class CylinderCombine extends BasePointCombine{['_conversionStyle'](_0x57630f){const _0x3774c1={_0x3e811b:0x5fe},_0x5f1dcc=_0x35a251;return _0x57630f[_0x5f1dcc(_0x3774c1._0x3e811b)]=_0x57630f['closed']??!![],CylinderStyleConver['toCesiumVal'](_0x57630f);}['_style2Json'](_0x38cc75,_0x596012){return CylinderStyleConver['toJSON'](_0x38cc75,_0x596012);}[_0x35a251(0xf52)](_0x4c23c7,_0x3e755b,_0x17f29d){const _0x319b9a={_0x49abca:0xc04,_0x491a9c:0xdbe,_0x104ac2:0xac3},_0x1a61de=_0x35a251,_0x4137f2=CylinderStyleConver[_0x1a61de(_0x319b9a._0x49abca)]({...this[_0x1a61de(0xe86)]['style'],..._0x17f29d[_0x1a61de(0xfc8)]||{}});_0x4137f2['vertexFormat']=_0x4137f2[_0x1a61de(_0x319b9a._0x491a9c)]||_0x4c23c7[_0x1a61de(0xdbe)];let _0x12b482=this[_0x1a61de(_0x319b9a._0x104ac2)](_0x4137f2);_0x3e755b&&_0x4137f2['outlineColor']&&(_0x12b482=_0x4137f2['outlineColor']);_0x12b482['alpha']!==0x1&&(this[_0x1a61de(0x6e7)]=!![]);const _0x5e683e=this[_0x1a61de(0xc2e)](_0x17f29d,_0x4137f2),_0x380519=_0x3e755b?Cesium__namespace['CylinderOutlineGeometry']:Cesium__namespace['CylinderGeometry'],_0x1a4c83=new Cesium__namespace['GeometryInstance']({'geometry':new _0x380519(_0x4137f2),'modelMatrix':_0x5e683e,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x12b482),'distanceDisplayCondition':_0x4137f2['distanceDisplayCondition']}});return _0x1a4c83;}}register$4(_0x35a251(0x5eb),CylinderCombine,!![]);class FrustumCombine extends BasePointCombine{['_conversionStyle'](_0x97d315){return _0x97d315['closed']=_0x97d315['closed']??!![],CylinderStyleConver['toCesiumVal'](_0x97d315);}[_0x35a251(0x1e0)](_0x3cd4b7,_0x290a9a){return CylinderStyleConver['toJSON'](_0x3cd4b7,_0x290a9a);}[_0x35a251(0xf52)](_0x4de564,_0x466622,_0x527971){const _0x415cdf={_0x5c5d0a:0xfc8,_0x4182d2:0xdbe,_0x3b136c:0x6e7,_0x378340:0xa43,_0x2a2958:0x41f,_0x398fa6:0x6f9},_0x4f6df4=_0x35a251,_0x966583=CylinderStyleConver[_0x4f6df4(0xc04)]({...this['options']['style'],..._0x527971[_0x4f6df4(_0x415cdf._0x5c5d0a)]||{}});_0x966583['vertexFormat']=_0x966583['vertexFormat']||_0x4de564[_0x4f6df4(_0x415cdf._0x4182d2)];let _0x9a9293=this['_getColorByColorMaterial'](_0x966583);_0x466622&&_0x966583[_0x4f6df4(0x218)]&&(_0x9a9293=_0x966583['outlineColor']);_0x9a9293['alpha']!==0x1&&(this[_0x4f6df4(_0x415cdf._0x3b136c)]=!![]);const _0x151c78=_0x527971[_0x4f6df4(0xb61)]=LngLatPoint['parse'](_0x527971['position'])['toCartesian']();let _0x5f2d18,_0x13b0d5;if(_0x527971['targetPositio']){const _0x11bd9d=LngLatPoint['parse'](_0x527971['targetPosition'])[_0x4f6df4(_0x415cdf._0x378340)]();_0x5f2d18=Cesium__namespace['Cartesian3'][_0x4f6df4(0xeed)](_0x151c78,_0x11bd9d);const _0x353d3b=getHeadingPitchRollForLine(_0x151c78,_0x11bd9d);_0x13b0d5=Cesium__namespace[_0x4f6df4(0x49c)]['headingPitchRollQuaternion'](_0x151c78,_0x353d3b);}else{_0x5f2d18=-_0x966583[_0x4f6df4(0xe1e)];const _0x4f4ad2=new Cesium__namespace[(_0x4f6df4(0x513))](Cesium__namespace['Math']['toRadians'](_0x966583[_0x4f6df4(_0x415cdf._0x2a2958)]||0x0),Cesium__namespace['Math']['toRadians'](_0x966583['pitch']||0x0),Cesium__namespace['Math']['toRadians'](_0x966583['roll']||0x0));_0x13b0d5=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x151c78,_0x4f4ad2);}const _0x574989=new Cesium__namespace['PerspectiveFrustum']({'fov':Cesium__namespace['Math'][_0x4f6df4(0x7ba)](_0x966583['angle']*0x2||0.01),'aspectRatio':_0x966583[_0x4f6df4(0x79c)]/_0x966583[_0x4f6df4(0x2c9)],'near':0.01,'far':_0x5f2d18}),_0x5a9ad0=_0x466622?Cesium__namespace['FrustumOutlineGeometry']:Cesium__namespace['FrustumGeometry'],_0x4ecb02=new Cesium__namespace['GeometryInstance']({'geometry':new _0x5a9ad0({..._0x966583,'origin':_0x151c78,'orientation':_0x13b0d5,'frustum':_0x574989}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x4f6df4(_0x415cdf._0x398fa6)](_0x9a9293),'distanceDisplayCondition':_0x966583['distanceDisplayCondition']}});return _0x4ecb02;}}register$4(_0x35a251(0xbf5),FrustumCombine,!![]);class EllipsoidCombine extends BasePointCombine{['_conversionStyle'](_0x498c1b){const _0x5d5602=_0x35a251;return _0x498c1b['closed']=_0x498c1b['closed']??!![],EllipsoidStyleConver[_0x5d5602(0xc04)](_0x498c1b);}['_style2Json'](_0x287e22,_0x25bb53){const _0xf7f6bb={_0x28241d:0x99e},_0x34fb4f=_0x35a251;return EllipsoidStyleConver[_0x34fb4f(_0xf7f6bb._0x28241d)](_0x287e22,_0x25bb53);}['_createGeometryInstanceItem'](_0x4d3817,_0x3ad37e,_0x32fee2){const _0xa7bd98={_0x387a59:0xc2e},_0x4d6e56=_0x35a251,_0x525ffc=EllipsoidStyleConver['toCesiumVal']({...this[_0x4d6e56(0xe86)]['style'],..._0x32fee2['style']||{}});_0x525ffc['vertexFormat']=_0x525ffc['vertexFormat']||_0x4d3817['vertexFormat'];let _0x1c69f7=this['_getColorByColorMaterial'](_0x525ffc);_0x3ad37e&&_0x525ffc['outlineColor']&&(_0x1c69f7=_0x525ffc[_0x4d6e56(0x218)]);_0x1c69f7['alpha']!==0x1&&(this['translucent']=!![]);const _0x4e3563=this[_0x4d6e56(_0xa7bd98._0x387a59)](_0x32fee2,_0x525ffc),_0xa14392=_0x3ad37e?Cesium__namespace['EllipsoidOutlineGeometry']:Cesium__namespace['EllipsoidGeometry'],_0x55ae53=new Cesium__namespace['GeometryInstance']({'geometry':new _0xa14392(_0x525ffc),'modelMatrix':_0x4e3563,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x1c69f7),'distanceDisplayCondition':_0x525ffc['distanceDisplayCondition']}});return _0x55ae53;}}register$4(_0x35a251(0x58b),EllipsoidCombine,!![]);class PolylineCombine extends BasePolyCombine{['_conversionStyle'](_0x4e4940){const _0x2dcd69=_0x35a251;return PolylineStyleConver[_0x2dcd69(0xc04)](_0x4e4940);}['_style2Json'](_0x5ec53b,_0xf4453f){return PolylineStyleConver['toJSON'](_0x5ec53b,_0xf4453f);}[_0x35a251(0xf52)](_0x4452b8,_0x1d0baf,_0x13e884){const _0x2d89ba={_0x3d5590:0xdbe,_0x133801:0xb35,_0x2a0219:0x108,_0x1af70e:0x291,_0x5d46cf:0x6f9},_0x56d87c=_0x35a251,_0x60d5a0=PolylineStyleConver['toCesiumVal']({...this['options']['style'],..._0x13e884['style']||{}});_0x4452b8[_0x56d87c(0x9f5)]&&(_0x60d5a0[_0x56d87c(_0x2d89ba._0x3d5590)]=Cesium__namespace[_0x56d87c(0xe0e)]['VERTEX_FORMAT']);const _0x52707b=this['_getColorByColorMaterial'](_0x60d5a0),_0x274769=_0x13e884[_0x56d87c(0xb35)]=LngLatArray[_0x56d87c(0xcf)](_0x13e884['positions']);_0x60d5a0[_0x56d87c(_0x2d89ba._0x133801)]=_0x274769;const _0x27604a=_0x60d5a0[_0x56d87c(0x979)]?Cesium__namespace['GroundPolylineGeometry']:Cesium__namespace[_0x56d87c(_0x2d89ba._0x2a0219)],_0x38ae1e=new Cesium__namespace[(_0x56d87c(_0x2d89ba._0x1af70e))]({'geometry':new _0x27604a(_0x60d5a0),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x56d87c(_0x2d89ba._0x5d46cf)](_0x52707b),'distanceDisplayCondition':_0x60d5a0['distanceDisplayCondition']}});return _0x38ae1e;}['_createAppearance'](_0x51efdc,_0x3e8f43){return _0x51efdc['_isColorMaterial']?new Cesium__namespace['PolylineColorAppearance']({..._0x51efdc}):new Cesium__namespace['PolylineMaterialAppearance']({..._0x51efdc});}}register$4('polylineCombine',PolylineCombine),register$4(_0x35a251(0xf71),PolylineCombine);class PolylineVolumeCombine extends BasePolyCombine{['_conversionStyle'](_0x4bd50a){return _0x4bd50a['closed']=_0x4bd50a['closed']??!![],PolylineVolumeStyleConver['toCesiumVal'](_0x4bd50a);}[_0x35a251(0x1e0)](_0x39734b,_0x448bec){return PolylineVolumeStyleConver['toJSON'](_0x39734b,_0x448bec);}['_createGeometryInstanceItem'](_0x217d1f,_0x53e2ad,_0x1b8079){const _0x32ddb2={_0x4fabf1:0xc04,_0x20479a:0xfc8,_0x5657f1:0x107},_0x208791=_0x35a251,_0x4fec55=PolylineVolumeStyleConver[_0x208791(_0x32ddb2._0x4fabf1)]({...this['options'][_0x208791(_0x32ddb2._0x20479a)],..._0x1b8079['style']||{}});_0x4fec55['vertexFormat']=_0x4fec55['vertexFormat']||_0x217d1f['vertexFormat'];let _0x22be2d=this['_getColorByColorMaterial'](_0x4fec55);_0x53e2ad&&_0x4fec55['outlineColor']&&(_0x22be2d=_0x4fec55['outlineColor']);_0x22be2d['alpha']!==0x1&&(this[_0x208791(0x6e7)]=!![]);const _0xc1c79b=_0x1b8079['positions']=LngLatArray[_0x208791(0xcf)](_0x1b8079['positions']),_0x2ea442=_0x53e2ad?Cesium__namespace[_0x208791(_0x32ddb2._0x5657f1)]:Cesium__namespace['PolylineVolumeGeometry'],_0x40ade9=new Cesium__namespace['GeometryInstance']({'geometry':new _0x2ea442({..._0x4fec55,'polylinePositions':_0xc1c79b,'shapePositions':_0x4fec55['shape']}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x22be2d),'distanceDisplayCondition':_0x4fec55['distanceDisplayCondition']}});return _0x40ade9;}}register$4('polylineVolumeC',PolylineVolumeCombine);class CorridorCombine extends BasePolyCombine{['_conversionStyle'](_0x49a449){return CorridorStyleConver['toCesiumVal'](_0x49a449);}['_style2Json'](_0x510c5e,_0x2a6867){return CorridorStyleConver['toJSON'](_0x510c5e,_0x2a6867);}[_0x35a251(0xf52)](_0xfd446d,_0x2d0c27,_0x7dc080){const _0x185cfa={_0x15bdd6:0xfc8,_0x13fff5:0xdbe,_0x132961:0xb35},_0x50913c=_0x35a251,_0x3b9379=CorridorStyleConver['toCesiumVal']({...this['options'][_0x50913c(_0x185cfa._0x15bdd6)],..._0x7dc080['style']||{}});_0x3b9379[_0x50913c(_0x185cfa._0x13fff5)]=_0x3b9379['vertexFormat']||_0xfd446d['vertexFormat'];let _0x516fdd=this['_getColorByColorMaterial'](_0x3b9379);_0x2d0c27&&_0x3b9379[_0x50913c(0x218)]&&(_0x516fdd=_0x3b9379['outlineColor']);_0x516fdd['alpha']!==0x1&&(this['translucent']=!![]);_0x7dc080['positions']=LngLatArray['toCartesians'](_0x7dc080['positions']),_0x3b9379[_0x50913c(_0x185cfa._0x132961)]=_0x7dc080['positions'];const _0x2ed1b7=_0x2d0c27?Cesium__namespace[_0x50913c(0x3e3)]:Cesium__namespace[_0x50913c(0xb56)],_0x5b45a9=new Cesium__namespace[(_0x50913c(0x291))]({'geometry':new _0x2ed1b7(_0x3b9379),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x516fdd),'distanceDisplayCondition':_0x3b9379['distanceDisplayCondition']}});return _0x5b45a9;}}register$4('corridorC',CorridorCombine);class WallCombine extends BasePolyCombine{['_conversionStyle'](_0x541c5d){return WallStyleConver['toCesiumVal'](_0x541c5d);}['_style2Json'](_0xa105be,_0x286e32){return WallStyleConver['toJSON'](_0xa105be,_0x286e32);}[_0x35a251(0xf52)](_0x274a68,_0x346bbe,_0x12b506){const _0x1f5cbf={_0x300c7f:0x6f9},_0x22d32d={_0x38bf45:0x6de},_0xc34d6c=_0x35a251;var _0x17f9a4;const _0x51217e=WallStyleConver[_0xc34d6c(0xc04)]({...this[_0xc34d6c(0xe86)][_0xc34d6c(0xfc8)],..._0x12b506[_0xc34d6c(0xfc8)]||{}});_0x51217e['vertexFormat']=_0x51217e[_0xc34d6c(0xdbe)]||_0x274a68['vertexFormat'];let _0x1a768c=this['_getColorByColorMaterial'](_0x51217e);_0x346bbe&&_0x51217e['outlineColor']&&(_0x1a768c=_0x51217e['outlineColor']);_0x1a768c[_0xc34d6c(0x1f4)]!==0x1&&(this['translucent']=!![]);const _0x1cea03=[];let _0x4d59c9=[];const _0x2337c9=_0x12b506['positions'];let _0x11765f=new Array(_0x2337c9),_0x43f1ee=new Array(_0x2337c9);_0x12b506['positions'][_0xc34d6c(0xdbd)](function(_0x521bbb,_0x381a34){const _0x2c394d=_0xc34d6c,_0x4bd29b=LngLatPoint['parse'](_0x521bbb);if(!_0x4bd29b||!_0x4bd29b['valid']())return;_0x1cea03[_0x2c394d(_0x22d32d._0x38bf45)](_0x4bd29b),_0x4d59c9[_0x2c394d(0x6de)](_0x4bd29b['toCartesian']());const _0x3c21e3=_0x1cea03[_0x381a34]['alt'];_0x11765f[_0x381a34]=_0x3c21e3,_0x43f1ee[_0x381a34]=_0x3c21e3+Number(_0x51217e['diffHeight']||0x64);});_0x51217e['closure']&&((_0x17f9a4=_0x4d59c9)===null||_0x17f9a4===void 0x0?void 0x0:_0x17f9a4[_0xc34d6c(0xe1e)])>0x0&&(_0x4d59c9=_0x4d59c9['concat'](_0x4d59c9[0x0]),_0x11765f=_0x11765f['concat'](_0x11765f[0x0]),_0x43f1ee=_0x43f1ee['concat'](_0x43f1ee[0x0]));const _0x25da32=_0x346bbe?Cesium__namespace[_0xc34d6c(0xbac)]:Cesium__namespace['WallGeometry'],_0x45eea7=new Cesium__namespace['GeometryInstance']({'geometry':new _0x25da32({..._0x51217e,'positions':_0x4d59c9,'maximumHeights':_0x43f1ee,'minimumHeights':_0x11765f}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0xc34d6c(_0x1f5cbf._0x300c7f)](_0x1a768c),'distanceDisplayCondition':_0x51217e['distanceDisplayCondition']}});return _0x45eea7;}}register$4('wallC',WallCombine);class PolygonCombine extends BasePolyCombine{[_0x35a251(0xbb)](_0x1aaf13){const _0x2f1135=_0x35a251;return PolygonStyleConver[_0x2f1135(0xc04)](_0x1aaf13);}['_style2Json'](_0x422ab9,_0x4a6a83){return PolygonStyleConver['toJSON'](_0x422ab9,_0x4a6a83);}[_0x35a251(0xf52)](_0x5b6a3d,_0x1ec32b,_0x332437){const _0x2ec4f0={_0x3f0528:0xdbe,_0x3592af:0xdbe,_0x813ec2:0x6e7,_0x2e4a8b:0x719,_0x19624f:0xe97},_0x24b033=_0x35a251,_0x473691=PolygonStyleConver['toCesiumVal']({...this['options']['style'],..._0x332437['style']||{}});_0x473691['vertexFormat']=_0x473691[_0x24b033(_0x2ec4f0._0x3f0528)]||_0x5b6a3d[_0x24b033(_0x2ec4f0._0x3592af)];let _0x54e480=this['_getColorByColorMaterial'](_0x473691);_0x1ec32b&&_0x473691['outlineColor']&&(_0x54e480=_0x473691['outlineColor']);_0x54e480['alpha']!==0x1&&(this[_0x24b033(_0x2ec4f0._0x813ec2)]=!![]);let _0x2854dc,_0x582c85;_0x332437['positions']['length']>0x0&&Array['isArray'](_0x332437[_0x24b033(0xb35)][0x0])&&_0x332437['positions'][0x0]['length']>0x0&&Array[_0x24b033(_0x2ec4f0._0x2e4a8b)](_0x332437['positions'][0x0][0x0])&&isNumber(_0x332437[_0x24b033(0xb35)][0x0][0x0][0x0])?(_0x2854dc=getPolygonHierarchy(_0x332437[_0x24b033(0xb35)]),_0x582c85=_0x2854dc['positions']):(_0x582c85=_0x332437['positions']=LngLatArray['toCartesians'](_0x332437['positions']),_0x2854dc=new Cesium__namespace['PolygonHierarchy'](_0x582c85));_0x332437[_0x24b033(_0x2ec4f0._0x19624f)]=_0x2854dc,_0x473691['polygonHierarchy']=_0x2854dc;const _0xa8fb8=_0x1ec32b?Cesium__namespace['PolygonOutlineGeometry']:Cesium__namespace['PolygonGeometry'],_0x17f427=new Cesium__namespace['GeometryInstance']({'geometry':new _0xa8fb8(_0x473691),'attributes':{'color':Cesium__namespace[_0x24b033(0x71a)]['fromColor'](_0x54e480),'distanceDisplayCondition':_0x473691['distanceDisplayCondition']}});return _0x17f427;}['_getPolylineOutlinePositions'](_0x3dbd77){if(_0x3dbd77['_hierarchy'])return getHierarchyVal(_0x3dbd77['_hierarchy']);else{if(_0x3dbd77['positions'])return getHierarchyVal(LngLatArray['toCartesians'](_0x3dbd77['positions']));}}['updateHeight'](_0x509fd3){const _0x506cf6={_0x47faf7:0xe1e},_0x4780b0=_0x35a251;var _0x45ef34;const _0x64ba5d=0x615299,_0x5afe13=((_0x45ef34=this['style'])===null||_0x45ef34===void 0x0?void 0x0:_0x45ef34['height'])||0x0;for(let _0x5637f9=0x0,_0x489e5a=this['primitiveCollection'][_0x4780b0(_0x506cf6._0x47faf7)];_0x5637f9<_0x489e5a;_0x5637f9++){const _0x15f851=this['primitiveCollection']['get'](_0x5637f9),_0x9f3702=(_0x64ba5d+_0x509fd3)/(_0x64ba5d+_0x5afe13),_0x56d445=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](_0x9f3702,_0x9f3702,_0x9f3702));_0x15f851['modelMatrix']=_0x56d445;}}['_getGeoJsonGeometry'](_0x7ad068,_0x1fd238){const _0xc816b6={_0x340cfe:0x769},_0x2a0101=_0x35a251;return{'type':'Polygon','coordinates':[LngLatArray[_0x2a0101(_0xc816b6._0x340cfe)](_0x7ad068['positions'],_0x1fd238===null||_0x1fd238===void 0x0?void 0x0:_0x1fd238['noAlt'])]};}}register$4(_0x35a251(0x652),PolygonCombine),register$4('polygonC',PolygonCombine);class WaterCombine extends PolygonCombine{['_addedHook'](_0x49d8f9){const _0x43992f={_0x4351be:0x408,_0xb76c19:0x82,_0x1fc0d5:0x324,_0xcdd022:0x979,_0x5cc556:0x4af,_0x25ac2d:0x4af,_0x5c0a6f:0x3e5},_0x3dd508=_0x35a251;if(!this['show'])return;const _0x160e1c=this['_conversionStyle'](_0x49d8f9);_0x49d8f9[_0x3dd508(0xbf2)]=_0x49d8f9['opacity']??0.8;const _0x2211ca={'geometryInstances':this['_createGeometryInstance'](_0x160e1c),'appearance':new Cesium__namespace[(_0x3dd508(_0x43992f._0x4351be))]({'aboveGround':![],'material':new Cesium__namespace['Material']({'fabric':{'type':'Water','uniforms':{'specularMap':_0x160e1c[_0x3dd508(0x32f)]||Cesium__namespace['Material']['DefaultImageId'],'normalMap':_0x160e1c['normalMap']||Cesium__namespace['Material']['DefaultImageId'],'frequency':_0x160e1c[_0x3dd508(_0x43992f._0xb76c19)]||0x1f40,'animationSpeed':_0x160e1c['animationSpeed']||0.03,'amplitude':_0x160e1c[_0x3dd508(0xe8f)]||0x5,'specularIntensity':_0x49d8f9['specularIntensity']||0.8,'baseWaterColor':getCesiumColor(_0x49d8f9[_0x3dd508(_0x43992f._0x1fc0d5)]||'#123e59')['withAlpha'](_0x49d8f9['opacity']),'blendColor':getCesiumColor(_0x49d8f9[_0x3dd508(0x734)]||'#123e59')['withAlpha'](_0x49d8f9[_0x3dd508(0xbf2)])}}}),'fragmentShaderSource':WaterFS,'translucent':_0x49d8f9[_0x3dd508(0xbf2)]!==0x1}),'show':this['show']};_0x49d8f9[_0x3dd508(_0x43992f._0xcdd022)]?(_0x2211ca['classificationType']=_0x49d8f9['classificationType']??Cesium__namespace['ClassificationType']['TERRAIN'],this['_primitive']=this[_0x3dd508(0x293)][_0x3dd508(_0x43992f._0x5cc556)](new Cesium__namespace[(_0x3dd508(0x748))](_0x2211ca))):this['_primitive']=this[_0x3dd508(0x293)][_0x3dd508(_0x43992f._0x25ac2d)](new Cesium__namespace['Primitive'](_0x2211ca));this['_primitive_outline']&&(this['primitiveCollection']['remove'](this['_primitive_outline']),delete this[_0x3dd508(_0x43992f._0x5c0a6f)]);if(_0x49d8f9['outline']){const _0x3e711f=this['_getOutlineStyle'](_0x49d8f9);this['_primitive_outline']=this['_createPolylineOutline'](_0x3e711f);}}}register$4('waterCombine',WaterCombine),register$4('waterC',WaterCombine);class RectangleCombine extends BasePolyCombine{[_0x35a251(0xbb)](_0x1edda6){return RectangleStyleConver['toCesiumVal'](_0x1edda6);}[_0x35a251(0x1e0)](_0x53e0cd,_0x3a920f){return RectangleStyleConver['toJSON'](_0x53e0cd,_0x3a920f);}['_createGeometryInstanceItem'](_0x422944,_0x445d5f,_0x2d0753){const _0x3d1016={_0x3889a4:0x218,_0x222020:0xb35,_0x33f87f:0x4c2,_0x21c0bc:0xc02,_0x5759ee:0x291},_0x13f73b=_0x35a251,_0x245ca4=RectangleStyleConver['toCesiumVal']({...this['options']['style'],..._0x2d0753['style']||{}});_0x245ca4['vertexFormat']=_0x245ca4['vertexFormat']||_0x422944['vertexFormat'];let _0x2019f1=this['_getColorByColorMaterial'](_0x245ca4);_0x445d5f&&_0x245ca4[_0x13f73b(_0x3d1016._0x3889a4)]&&(_0x2019f1=_0x245ca4['outlineColor']);_0x2019f1[_0x13f73b(0x1f4)]!==0x1&&(this['translucent']=!![]);const _0x19dd63=_0x2d0753['positions']=LngLatArray['toCartesians'](_0x2d0753[_0x13f73b(_0x3d1016._0x222020)]);_0x245ca4[_0x13f73b(0xab1)]=Cesium__namespace['Rectangle'][_0x13f73b(_0x3d1016._0x33f87f)](_0x19dd63);Cesium__namespace['defined'](_0x245ca4['rectangle'])&&(Cesium__namespace['defined'](this['_rectangle'])?this['_rectangle']=Cesium__namespace['Rectangle'][_0x13f73b(0xd8c)](_0x245ca4[_0x13f73b(0xab1)],this['_rectangle']):this[_0x13f73b(_0x3d1016._0x21c0bc)]=_0x245ca4['rectangle']);const _0x4cfcea=_0x445d5f?Cesium__namespace['RectangleOutlineGeometry']:Cesium__namespace['RectangleGeometry'],_0x49176e=new Cesium__namespace[(_0x13f73b(_0x3d1016._0x5759ee))]({'geometry':new _0x4cfcea(_0x245ca4),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x2019f1),'distanceDisplayCondition':_0x245ca4['distanceDisplayCondition']}});return _0x49176e;}}register$4('rectangleC',RectangleCombine);class EditDivGraphic extends EditBase{get['container'](){return this['_graphic']['_container'];}['activate'](){const _0x369f32={_0x54ac22:0xdc1,_0x4560f7:0x154,_0x562059:0xfc8,_0x5e099f:0x81c,_0x255520:0x44e,_0x1df2e3:0xd79},_0x234cd6=_0x35a251;if(this['_enabled'])return this;return this['_enabled']=!![],this['container']['addEventListener'](_0x234cd6(_0x369f32._0x54ac22),this[_0x234cd6(0x666)]['bind'](this)),this['container']['addEventListener']('mouseout',this['_onMouseOut']['bind'](this)),this['container']['addEventListener'](_0x234cd6(0xf4b),this['_onMarkerDragStart'][_0x234cd6(_0x369f32._0x4560f7)](this)),addClass(this['container'],this['_graphic'][_0x234cd6(_0x369f32._0x562059)]['editClassName']||_0x234cd6(_0x369f32._0x5e099f)),this[_0x234cd6(0x163)]['_draw_tooltip']=this[_0x234cd6(0xd79)]['getLangText']('_拖动对象后')+_0x234cd6(0x3f8)+this['_map'][_0x234cd6(_0x369f32._0x255520)]('_修改位置')+'
'+this[_0x234cd6(_0x369f32._0x1df2e3)]['getLangText']('_更多功能请右击'),this['_graphic']['onDragEnd']=(_0x3f8fb4,_0x308b8b,_0x16178e)=>{const _0x253d15=_0x234cd6;this['_graphic'][_0x253d15(0xb61)]=_0x308b8b,this['fire'](EventType['editMovePoint'],{'mouseEvent':_0x16178e,'cartesian':_0x308b8b});},this['_last_contextmenuConfig']=this['_graphic']['_contextmenuConfig'],this['_graphic']['bindContextMenu'](this['getDraggerContextMenu'](this['_graphic'])),this[_0x234cd6(0x264)](EventType['editStart']),this;}[_0x35a251(0x636)](){const _0x5976e0={_0x5bd884:0xf6b,_0x522a98:0x4d6,_0x279ec6:0x94f,_0x51c951:0x2ba},_0x48d77e=_0x35a251;if(!this[_0x48d77e(0x706)])return this;return this['_enabled']=![],this['stopMoveMatrix'](),delete this['_graphic']['onDragEnd'],delete this['_graphic']['_draw_tooltip'],this['_graphic'][_0x48d77e(0xe12)](),this['_last_contextmenuConfig']&&(this[_0x48d77e(0x163)]['_contextmenuConfig']=this[_0x48d77e(_0x5976e0._0x5bd884)],delete this['_last_contextmenuConfig']),this[_0x48d77e(0x94f)][_0x48d77e(_0x5976e0._0x522a98)]('mousemove',this['_onMouseMove']),this['container']['removeEventListener']('mouseout',this[_0x48d77e(0x201)]),this['container'][_0x48d77e(0x4d6)]('mousedown',this['_onMarkerDragStart']),this['unbindEvent'](),removeClass(this[_0x48d77e(_0x5976e0._0x279ec6)],this['_graphic']['style']['editClassName']||'mars3d-divGraphic-edit'),this['fire'](EventType[_0x48d77e(_0x5976e0._0x51c951)]),this;}['unbindEvent'](){const _0x55dc36={_0x56cf68:0x8b9,_0x30322c:0xe89,_0x2281c0:0xd79},_0x384e36=_0x35a251;this['_mouseMoveHandle']&&document['removeEventListener']('mousemove',this[_0x384e36(_0x55dc36._0x56cf68)],![]),this['_mouseUpHandle']&&document['removeEventListener']('mouseup',this[_0x384e36(_0x55dc36._0x30322c)],![]),this[_0x384e36(_0x55dc36._0x2281c0)][_0x384e36(0x105)](![]);}[_0x35a251(0x666)](_0x5775e4){const _0x3d7b3f=_0x35a251;if(this['_graphic']['_draw_tooltip']){const _0x19ab47=this['_graphic']['_getWindowPosition'](_0x5775e4);this[_0x3d7b3f(0xd79)][_0x3d7b3f(0x771)](_0x19ab47,this['_graphic']['_draw_tooltip']);}}['_onMouseOut'](_0x4674e0){const _0x5522c6=_0x35a251;this['_map'][_0x5522c6(0x604)]();}['_onMarkerDragStart'](_0x2da88c){const _0x171b02={_0x2343d3:0x105,_0x5ec049:0x2de,_0x4cbc21:0x8b9},_0xe80552=_0x35a251;if(!this['_enabled']||_0x2da88c['which']!==0x1)return;_0x2da88c['preventDefault'](),this[_0xe80552(0xd79)][_0xe80552(_0x171b02._0x2343d3)](!![]),this['fire'](EventType['editMouseDown'],{'mouseEvent':_0x2da88c}),this[_0xe80552(_0x171b02._0x5ec049)](),!this[_0xe80552(0x8b9)]&&(this[_0xe80552(_0x171b02._0x4cbc21)]=_0x250989=>{this['_onMarkerDrag'](_0x250989);},this['_mouseUpHandle']=_0x30652a=>{this['_onMarkerDragEnd'](_0x30652a);}),document['addEventListener'](_0xe80552(0xdc1),this['_mouseMoveHandle'],![]),document['addEventListener']('mouseup',this['_mouseUpHandle'],![]);}[_0x35a251(0x3f5)](_0x5a9807){const _0x992dd={_0x505b7c:0xddd,_0x42795e:0x771,_0x4c87ee:0xd79,_0x572a11:0x489},_0x16a1aa=_0x35a251;if(!this['_enabled'])return;_0x5a9807[_0x16a1aa(_0x992dd._0x505b7c)]();const _0x3053e6=this['_graphic']['_getWindowPosition'](_0x5a9807),_0x345705=getCurrentMousePosition(this['_map']['scene'],_0x3053e6);if(!_0x345705)return;this['_graphic']['position']=_0x345705,this['_map'][_0x16a1aa(_0x992dd._0x42795e)](_0x3053e6,this[_0x16a1aa(_0x992dd._0x4c87ee)]['getLangText']('_释放后完成修改')),this['fire'](EventType[_0x16a1aa(_0x992dd._0x572a11)],{'mouseEvent':_0x5a9807,'cartesian':_0x345705,'windowPosition':_0x3053e6});}['_onMarkerDragEnd'](_0x3569eb){const _0x11fc4f={_0x20e10a:0x706,_0x1ef032:0x2de,_0x5729a4:0xc1a,_0x6e72f:0x163,_0xbf0a9e:0xb61},_0x4ce3fd=_0x35a251;if(!this[_0x4ce3fd(_0x11fc4f._0x20e10a)])return;_0x3569eb['preventDefault'](),this[_0x4ce3fd(_0x11fc4f._0x1ef032)](),this['_map'][_0x4ce3fd(0x604)]();const _0x11ef8f=this['_graphic'][_0x4ce3fd(_0x11fc4f._0x5729a4)](_0x3569eb);this['fire'](EventType['editMovePoint'],{'mouseEvent':_0x3569eb,'cartesian':this[_0x4ce3fd(_0x11fc4f._0x6e72f)][_0x4ce3fd(_0x11fc4f._0xbf0a9e)],'windowPosition':_0x11ef8f});}['_updateMatrixMovePosition'](_0x32f533){const _0x47a8c6={_0x18ac22:0xb61,_0x56545f:0x1d5},_0xfad00e=_0x35a251;if(!this['_matrixMove']||!_0x32f533[_0xfad00e(_0x47a8c6._0x18ac22)])return;this[_0xfad00e(_0x47a8c6._0x56545f)]['position']=_0x32f533['position'];}}const isFirefox=window['navigator']['userAgent'][_0x35a251(0x29b)]()['indexOf']('firefox')>=0x0;class DivGraphic extends BaseGraphic{constructor(_0x373638={}){const _0x164df1={_0x2d14fd:0xe86,_0x22feb5:0xfc8,_0x16264c:0x393,_0x55aec3:0xb61},_0x1994b7=_0x35a251;super(_0x373638),this['_hasEdit']=this[_0x1994b7(_0x164df1._0x2d14fd)]['hasEdit']??this['style'][_0x1994b7(0xb70)]??!![],this['_depthTest']=this['options'][_0x1994b7(0x812)]??this['style'][_0x1994b7(0x812)]??!![],this['_hasCache']=this['options']['hasCache']??this['style']['hasCache']??!![],this['_hasZIndex']=this['options']['hasZIndex']??this[_0x1994b7(_0x164df1._0x22feb5)][_0x1994b7(0xe8e)]??![],this['_css_transform_origin']=this['style']['css_transform_origin']??'left\x20bottom\x200',this[_0x1994b7(_0x164df1._0x2d14fd)]['frameRate']=this[_0x1994b7(0xe86)]['frameRate']??0x1,this[_0x1994b7(0xe86)]['testPoint']=merge({'name':_0x1994b7(0x8b2),'color':'#ff0000','pixelSize':0x8,'distanceDisplayCondition':this[_0x1994b7(0xfc8)][_0x1994b7(_0x164df1._0x16264c)],'scaleByDistance':this[_0x1994b7(0xfc8)][_0x1994b7(0x5ea)],'clampToGround':this[_0x1994b7(_0x164df1._0x22feb5)]['clampToGround'],'heightReference':this['style']['heightReference']},this['options']['testPoint']),_0x373638[_0x1994b7(_0x164df1._0x55aec3)]&&(this['position']=_0x373638['position']);}get['position'](){return this['_position'];}set['position'](_0x31f23b){const _0xc6204a={_0x367ef6:0xdb7,_0x434c66:0xa43,_0x3621b8:0xd88},_0x13bccf=_0x35a251;var _0x41ee32;this[_0x13bccf(0xf44)]=LngLatPoint['parse'](_0x31f23b);if(this['_point']){let _0x22e0e4=this['style']['setHeight'];Cesium__namespace['defined'](_0x22e0e4)&&(isString(_0x22e0e4)&&(_0x22e0e4=Number(template(_0x22e0e4,this[_0x13bccf(0x6b3)],!![])),isNaN(_0x22e0e4)&&(_0x22e0e4=0x0)),this['_point']['alt']=_0x22e0e4);const _0x55a256=this['getAddHeight']();_0x55a256!==0x0&&(this[_0x13bccf(0xf44)]['alt']=this['_point'][_0x13bccf(0x5d2)]+_0x55a256);}this[_0x13bccf(_0xc6204a._0x367ef6)]=(_0x41ee32=this['_point'])===null||_0x41ee32===void 0x0?void 0x0:_0x41ee32[_0x13bccf(_0xc6204a._0x434c66)](),this[_0x13bccf(_0xc6204a._0x3621b8)]&&(this['debuggerPointEntity']['position']=this['_position']),this['_updateDivPosition'](),this['fire'](EventType['updatePosition'],{'position':this[_0x13bccf(0xdb7)]});}get['point'](){const _0x17b388=_0x35a251;return this[_0x17b388(0xf44)];}get['coordinate'](){return this['getCoordinate']();}get[_0x35a251(0x176)](){return this['_position'];}get['positionShow'](){return this['_position_show'];}get[_0x35a251(0xb0b)](){return this['debuggerPointEntity']!=null;}set['testPoint'](_0xb1c59e){const _0x99bee1={_0xcc970a:0xad5,_0x509829:0xe86,_0x590fdd:0xb61},_0x3b6301=_0x35a251;this[_0x3b6301(0xd88)]&&(this[_0x3b6301(0x2d0)]['dataSource']['entities']['remove'](this['debuggerPointEntity']),delete this['debuggerPointEntity']),_0xb1c59e&&(this['debuggerPointEntity']=this['_layer'][_0x3b6301(_0x99bee1._0xcc970a)]['entities']['add']({'name':this[_0x3b6301(_0x99bee1._0x509829)]['testPoint']['name'],'position':this[_0x3b6301(_0x99bee1._0x590fdd)],'point':PointStyleConver[_0x3b6301(0xc04)](this['options']['testPoint'])}));}get['pointerEvents'](){return this['options']['pointerEvents'];}set[_0x35a251(0x795)](_0x392bd9){const _0x1fbd56={_0x4a39d3:0xe86},_0x50a61a=_0x35a251;this[_0x50a61a(_0x1fbd56._0x4a39d3)][_0x50a61a(0x795)]=_0x392bd9,this[_0x50a61a(0x2b5)](_0x392bd9);}get['isEditing'](){return this['_enabledEdit'];}get[_0x35a251(0xbae)](){return EditDivGraphic;}get[_0x35a251(0x812)](){const _0x4e38f6={_0x2b7a4c:0xce3},_0x207fa6=_0x35a251;return this[_0x207fa6(_0x4e38f6._0x2b7a4c)];}set['depthTest'](_0x2f4fa4){this['_depthTest']=_0x2f4fa4,this['_camera_cache']=null;}get['clampToGround'](){const _0x36dc9f=_0x35a251;return this['style'][_0x36dc9f(0x979)];}set['clampToGround'](_0xde060b){const _0x2cb594={_0x5d996a:0xfc8,_0x30db5b:0x979},_0x38a3d8=_0x35a251;this[_0x38a3d8(_0x2cb594._0x5d996a)][_0x38a3d8(_0x2cb594._0x30db5b)]=_0xde060b,this['_calculateAsynSurfacePosition']();}get['parentContainer'](){const _0x424d3f={_0x53bd33:0x94f},_0x4a2453=_0x35a251;if(this['options']['parentContainer'])return this['options']['parentContainer'];return this['_layer'][_0x4a2453(_0x424d3f._0x53bd33)];}get[_0x35a251(0xe06)](){var _0x4271e3;return(_0x4271e3=this['parentContainer'])===null||_0x4271e3===void 0x0?void 0x0:_0x4271e3['id'];}get[_0x35a251(0x94f)](){return this['_container'];}get['containerId'](){return this['_container']['id'];}get['html'](){return this['_container']['innerHTML'];}set['html'](_0x38ea2b){const _0xf27d40={_0x430b48:0x6b3,_0x48b5e9:0xfc8,_0x5aa957:0x755,_0x3d78ca:0x1ea,_0x3d65e8:0xfc8,_0x16fe13:0xe1e,_0x514091:0xdde,_0x5980c6:0xe1e,_0x3e4aca:0xfc8,_0x2d0862:0xfc8,_0x1efee9:0x789},_0x389898=_0x35a251;this[_0x389898(0xfc8)][_0x389898(0xc3c)]=_0x38ea2b;if(!this[_0x389898(0x5f4)]||!_0x38ea2b)return;typeof _0x38ea2b===_0x389898(0x638)&&(_0x38ea2b=_0x38ea2b(this['eventTarget']));if(_0x38ea2b instanceof Promise){_0x38ea2b[_0x389898(0x86c)](_0x566bf9=>{const _0x5415b4=_0x389898;if(!this['options'])return;this[_0x5415b4(0xf69)]=null,this[_0x5415b4(0xc3c)]=_0x566bf9;});return;}if(isString(_0x38ea2b)){if(this[_0x389898(0x6b3)]instanceof Promise){this[_0x389898(_0xf27d40._0x430b48)]['then'](_0x18b09f=>{const _0x142cff=_0x389898;if(!this['options'])return;this['_camera_cache']=null,this[_0x142cff(0x6b3)]=_0x18b09f,this[_0x142cff(0xc3c)]=_0x38ea2b;});return;}this[_0x389898(_0xf27d40._0x48b5e9)]['template']&&(_0x38ea2b=this[_0x389898(0xfc8)][_0x389898(_0xf27d40._0x5aa957)]['replace'](_0x389898(_0xf27d40._0x3d78ca),_0x38ea2b)),this['_container'][_0x389898(0xf4a)]=template(_0x38ea2b,this['attr'],this[_0x389898(0xfc8)]['templateEmptyStr']??!![]),this['fire'](EventType['load']);}else(_0x38ea2b instanceof Element||_0x38ea2b instanceof HTMLDivElement)&&(empty(this['_container']),_0x38ea2b[_0x389898(_0xf27d40._0x48b5e9)]['display']!=='block'&&(_0x38ea2b['style']['display']='block'),this['_container'][_0x389898(0x87c)](_0x38ea2b),this['fire'](EventType['load']));if(this[_0x389898(_0xf27d40._0x3d65e8)][_0x389898(0x15a)]){var _0x3c7fb9;if(((_0x3c7fb9=this[_0x389898(0x5f4)]['children'])===null||_0x3c7fb9===void 0x0?void 0x0:_0x3c7fb9[_0x389898(_0xf27d40._0x16fe13)])>0x0)for(let _0x823388=0x0,_0xcecb35=this['_container'][_0x389898(_0xf27d40._0x514091)][_0x389898(_0xf27d40._0x5980c6)];_0x823388<_0xcecb35;_0x823388++){const _0x4b2fca=this[_0x389898(0x5f4)][_0x389898(_0xf27d40._0x514091)][_0x823388];addClass(_0x4b2fca,this[_0x389898(_0xf27d40._0x3e4aca)]['className']);}else addClass(this['_container'],this[_0x389898(_0xf27d40._0x2d0862)]['className']);}this[_0x389898(_0xf27d40._0x1efee9)]&&this['_appendHtmlHook'](),this['_camera_cache']=null;}get['divWidth'](){const _0x384a85={_0x469946:0x3ae},_0x314f75=_0x35a251;var _0x1f4656;return(_0x1f4656=this['_container'])===null||_0x1f4656===void 0x0?void 0x0:_0x1f4656[_0x314f75(_0x384a85._0x469946)];}get['divHeight'](){const _0x5ab29a={_0x5ea443:0x5f4},_0x51de8a=_0x35a251;var _0x3c79cd;return(_0x3c79cd=this[_0x51de8a(_0x5ab29a._0x5ea443)])===null||_0x3c79cd===void 0x0?void 0x0:_0x3c79cd['offsetHeight'];}get[_0x35a251(0x6d6)](){return this;}[_0x35a251(0xa40)](_0x4e4ea6){const _0x3804c9={_0x326ea8:0x5f4,_0x45d314:0x2c3,_0x40c8a9:0xd88,_0x55cb66:0x987},_0x2c890f=_0x35a251;if(!this['_container'])return;_0x4e4ea6?(this[_0x2c890f(0xf69)]=null,this[_0x2c890f(_0x3804c9._0x326ea8)][_0x2c890f(0xfc8)]['display']='block'):this[_0x2c890f(_0x3804c9._0x45d314)](),this['debuggerPointEntity']&&(this[_0x2c890f(_0x3804c9._0x40c8a9)][_0x2c890f(_0x3804c9._0x55cb66)]=_0x4e4ea6);}['_updatePointerEvents'](_0x2f33e7){const _0xbd9405=_0x35a251;this['_container']&&(_0x2f33e7?this['_container']['style'][_0xbd9405(0xc7a)]='all':this['_container']['style']['pointer-events']=_0xbd9405(0x274));}[_0x35a251(0x45c)](_0x86ca36){const _0x302cab={_0x33e43e:0x5f4,_0x3273fe:0xfc8,_0x279748:0xbf2},_0x6992ab=_0x35a251;this[_0x6992ab(0xfc8)]['globalAlpha']=_0x86ca36,this['_container']&&(this[_0x6992ab(_0x302cab._0x33e43e)][_0x6992ab(_0x302cab._0x3273fe)][_0x6992ab(_0x302cab._0x279748)]=_0x86ca36);}['hasBindEvent'](){const _0x1b0737={_0x206ed1:0x429,_0x2982e1:0x2d0},_0x541228=_0x35a251;var _0x588dd3,_0x2eb3a3,_0x50a634;if(this['listens'](EventType['click']))return!![];if(this['listens'](EventType[_0x541228(_0x1b0737._0x206ed1)]))return!![];if(this['listens'](EventType['mouseOut']))return!![];if(this['hasPopup'](![]))return!![];if(this['hasTooltip'](![]))return!![];if(Cesium__namespace['defined'](this[_0x541228(0xe86)]['pointerEvents']))return this['options']['pointerEvents'];if((_0x588dd3=this[_0x541228(_0x1b0737._0x2982e1)])!==null&&_0x588dd3!==void 0x0&&_0x588dd3['listens'](EventType['click']))return!![];if((_0x2eb3a3=this['_layer'])!==null&&_0x2eb3a3!==void 0x0&&_0x2eb3a3[_0x541228(0x78c)](EventType[_0x541228(_0x1b0737._0x206ed1)]))return!![];if((_0x50a634=this['_layer'])!==null&&_0x50a634!==void 0x0&&_0x50a634['listens'](EventType['mouseOut']))return!![];if(this['hasPopup'](!![]))return!![];if(this['hasTooltip'](!![]))return!![];return![];}['_onEventHook'](){this['_updatePointerEvents'](this['hasBindEvent']());}[_0x35a251(0x700)](){const _0x414fd3={_0x57d673:0xfc8,_0x770fc8:0xc3c},_0x545d8a=_0x35a251;DivGraphicStyleConver[_0x545d8a(0xc04)](this['style'],this),this[_0x545d8a(0x5f4)]=create$3('div','mars3d-divGraphic\x20',this['parentContainer']),this['_container']['id']=this['id'],this['_container']['style']['opacity']=this[_0x545d8a(_0x414fd3._0x57d673)][_0x545d8a(0x2cf)],this['style'][_0x545d8a(_0x414fd3._0x770fc8)]&&(this['html']=this['style']['html']),this[_0x545d8a(0x2b5)](this['hasBindEvent']());}['_addedHook'](_0x5bedae){const _0x1848f7={_0x233e25:0x5f4,_0x1a43b9:0x154,_0x59b846:0x5f4,_0x280d6e:0x77e,_0x2047a1:0xdc1},_0xc867ef=_0x35a251;this['_layer']['container']['appendChild'](this[_0xc867ef(_0x1848f7._0x233e25)]),this['hide'](),this['_container']['addEventListener']('click',this['_container_onClickHandler'][_0xc867ef(_0x1848f7._0x1a43b9)](this)),this[_0xc867ef(_0x1848f7._0x59b846)][_0xc867ef(_0x1848f7._0x280d6e)]('mousedown',this['_container_onMousedownHandler']['bind'](this)),this['_container'][_0xc867ef(0x77e)](_0xc867ef(_0x1848f7._0x2047a1),this[_0xc867ef(0xb5b)][_0xc867ef(_0x1848f7._0x1a43b9)](this)),this[_0xc867ef(0x5f4)]['addEventListener']('mouseout',this['_container_onMouseoutHandler']['bind'](this)),this['_calculateAsynSurfacePosition'](),this['bindUpdateEvent']();}['_removedHook'](){const _0x227f86={_0x42b73f:0x4d6,_0x1ef4ca:0x5f4,_0xc4fd38:0xdc1},_0xc8ea41=_0x35a251;this['stopDraw'](),this['_map']['off'](EventType[_0xc8ea41(0x622)],this['_onTerrainChangeHandler'],this),this['testPoint']=![],this['_container'][_0xc8ea41(_0x227f86._0x42b73f)]('click',this[_0xc8ea41(0x539)]),this['_container']['removeEventListener']('mousedown',this['_container_onMousedownHandler']),this[_0xc8ea41(_0x227f86._0x1ef4ca)]['removeEventListener'](_0xc8ea41(_0x227f86._0xc4fd38),this['_container_onMouseMoveHandler']),this['_container']['removeEventListener']('mouseout',this[_0xc8ea41(0xc7e)]),remove(this[_0xc8ea41(0x5f4)]);}['_calculateAsynSurfacePosition'](){const _0x93ea5c={_0x5f39e3:0xecf,_0x10649e:0x4b2,_0x193fcd:0xc60,_0x31b4e3:0x2c6,_0x2439a9:0x2c6},_0x4c043e=_0x35a251;this['_camera_cache']=null,this[_0x4c043e(_0x93ea5c._0x5f39e3)]=![];const _0x2b8ac3=this['position'];_0x2b8ac3 instanceof Cesium__namespace[_0x4c043e(0x8eb)]&&(this['style'][_0x4c043e(0x979)]||this['style'][_0x4c043e(_0x93ea5c._0x10649e)]===Cesium__namespace[_0x4c043e(0x8f1)]['CLAMP_TO_GROUND']||this['style'][_0x4c043e(0x4b2)]===Cesium__namespace[_0x4c043e(0x8f1)]['RELATIVE_TO_GROUND'])&&(getSurfaceHeight(this['_map'][_0x4c043e(_0x93ea5c._0x193fcd)],_0x2b8ac3,this['options'])['then'](_0x4acaaa=>{const _0x46a0b3=_0x4c043e;if(this[_0x46a0b3(0x358)])return;this['style'][_0x46a0b3(0x4b2)]===Cesium__namespace[_0x46a0b3(0x8f1)]['RELATIVE_TO_GROUND']&&(_0x4acaaa['point']['alt']+=_0x4acaaa['height_original']),this['position']=_0x4acaaa['point'],this['_hasAsynSurfacePosition']=!![];}),this[_0x4c043e(0xd79)]['on'](EventType['terrainChange'],this[_0x4c043e(_0x93ea5c._0x31b4e3)],this),this['_map']['on'](EventType['terrainChange'],this[_0x4c043e(_0x93ea5c._0x2439a9)],this));}[_0x35a251(0x2c6)](_0x31047e){this['_map']&&this['_calculateAsynSurfacePosition']();}[_0x35a251(0xccd)](_0x486064){const _0x1ced9b={_0x4b8f54:0xb61,_0x5a9016:0xf69},_0x566ff9=_0x35a251;return _0x486064[_0x566ff9(0xc3c)]&&(this['html']=_0x486064[_0x566ff9(0xc3c)]),DivGraphicStyleConver['toCesiumVal'](this['style'],this),(Cesium__namespace['defined'](_0x486064['setHeight'])||Cesium__namespace[_0x566ff9(0xaa2)](_0x486064['addHeight']))&&(this[_0x566ff9(_0x1ced9b._0x4b8f54)]=this['_point']),this[_0x566ff9(_0x1ced9b._0x5a9016)]=null,this[_0x566ff9(0xb14)](),this;}['updateDivPosition'](){const _0x585380={_0xcb6fe0:0xb14},_0x1da0ef=_0x35a251;return this[_0x1da0ef(0xf69)]=null,this[_0x1da0ef(_0x585380._0xcb6fe0)](),this;}['update'](_0x242923){const _0x172de4={_0x145c61:0x832,_0x298d9b:0xc3c},_0x4772b3=_0x35a251;if(!this['_map'])return;this['style'][_0x4772b3(_0x172de4._0x145c61)]&&this[_0x4772b3(0xfc8)][_0x4772b3(_0x172de4._0x298d9b)]&&(this['html']=this[_0x4772b3(0xfc8)][_0x4772b3(0xc3c)]),this[_0x4772b3(0xb14)](),this['fire'](EventType['postRender'],{'container':this['container']},![]),this[_0x4772b3(0x26c)]&&this['fireTarget'](EventType['postRender'],{'container':this['container']},![]);}[_0x35a251(0xb14)](){const _0xb39432={_0x351ca8:0xd79,_0x3e99f9:0xf69,_0x3bd4d4:0xfc8,_0xccce3a:0x8f1,_0x27a826:0x995,_0x56fa23:0xeed,_0xb850db:0x13f,_0x34c1ae:0x678,_0xf8a657:0x9d,_0x459ffe:0x13f,_0x188663:0xfc8,_0x22538c:0x678,_0x798d1d:0x172,_0x5075e0:0xf93,_0x3666e0:0xe20,_0xc55afb:0xfc8,_0x40fb21:0xf8a,_0x3091d2:0xbfa,_0x4d8cb1:0x9f2},_0x2a51bc=_0x35a251;var _0x28330e;if(!this['show']||!this['_map'])return![];const _0x5348ab=this['_map']['scene'],_0x469dfc=this['_map']['camera'];let _0x33ff1c=getPositionValue(this[_0x2a51bc(0xb61)],(_0x28330e=this['_map'])===null||_0x28330e===void 0x0?void 0x0:_0x28330e['clock']['currentTime']);if(!Cesium__namespace['defined'](_0x33ff1c))return this[_0x2a51bc(0x2c3)](),![];if(this['_hasCache']){const _0x5185e6={'x':_0x33ff1c['x'],'y':_0x33ff1c['y'],'z':_0x33ff1c['z'],'p1':this['_map']['container']['clientWidth'],'p2':this[_0x2a51bc(_0xb39432._0x351ca8)][_0x2a51bc(0x94f)]['clientHeight'],'p3':_0x469dfc['positionWC']['x'],'p4':_0x469dfc[_0x2a51bc(0x13f)]['y'],'p5':_0x469dfc['positionWC']['z'],'p6':_0x469dfc['heading'],'p7':_0x469dfc['pitch'],'p8':_0x469dfc['roll']};if(this['_camera_cache']&&_0x5185e6['x']===this[_0x2a51bc(_0xb39432._0x3e99f9)]['x']&&_0x5185e6['x']===this['_camera_cache']['x']&&_0x5185e6['y']===this['_camera_cache']['y']&&_0x5185e6['z']===this['_camera_cache']['z']&&_0x5185e6['p1']===this[_0x2a51bc(0xf69)]['p1']&&_0x5185e6['p2']===this['_camera_cache']['p2']&&_0x5185e6['p3']===this['_camera_cache']['p3']&&_0x5185e6['p4']===this['_camera_cache']['p4']&&_0x5185e6['p5']===this['_camera_cache']['p5']&&_0x5185e6['p6']===this[_0x2a51bc(_0xb39432._0x3e99f9)]['p6']&&_0x5185e6['p7']===this['_camera_cache']['p7']&&_0x5185e6['p8']===this['_camera_cache']['p8'])return!![];this['_camera_cache']=_0x5185e6;}if(!this['_hasAsynSurfacePosition']){if(this['style']['clampToGround']||this[_0x2a51bc(_0xb39432._0x3bd4d4)]['heightReference']===Cesium__namespace[_0x2a51bc(_0xb39432._0xccce3a)]['CLAMP_TO_GROUND'])_0x33ff1c=getSurfacePosition(this['_map']['scene'],_0x33ff1c,this['options']);else this[_0x2a51bc(0xfc8)]['heightReference']===Cesium__namespace['HeightReference'][_0x2a51bc(_0xb39432._0x27a826)]&&(_0x33ff1c=getSurfacePosition(this['_map']['scene'],_0x33ff1c,{...this[_0x2a51bc(0xe86)],'relativeHeight':!![]}));}this['_position_show']=_0x33ff1c;const _0x1f8dbe=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](_0x5348ab,_0x33ff1c),_0x5e01e0=this['distanceDisplayCondition'],_0x2acb1c=this['scaleByDistance'];let _0x305915=_0x469dfc[_0x2a51bc(0x78e)]['height'];(this['_hasZIndex']||_0x5e01e0||_0x2acb1c)&&(_0x5348ab['mode']===Cesium__namespace['SceneMode']['SCENE3D']&&(_0x305915=Cesium__namespace['Cartesian3'][_0x2a51bc(_0xb39432._0x56fa23)](_0x33ff1c,_0x469dfc[_0x2a51bc(_0xb39432._0xb850db)])));if(!_0x1f8dbe||_0x5e01e0&&(_0x5e01e0[_0x2a51bc(0x170)]>_0x305915||_0x5e01e0['far']<_0x305915))return this['_container'][_0x2a51bc(0xfc8)]['display']===_0x2a51bc(_0xb39432._0x34c1ae)&&this['hide'](),![];if(this['depthTest']&&_0x5348ab[_0x2a51bc(0xef7)]===Cesium__namespace['SceneMode']['SCENE3D']){const _0x5d1ca0=new Cesium__namespace[(_0x2a51bc(_0xb39432._0xf8a657))](_0x5348ab[_0x2a51bc(0x22f)]['ellipsoid'],_0x5348ab['camera'][_0x2a51bc(_0xb39432._0x459ffe)]),_0x149740=_0x5d1ca0['isPointVisible'](_0x33ff1c);if(!_0x149740)return this['_container'][_0x2a51bc(_0xb39432._0x188663)]['display']===_0x2a51bc(_0xb39432._0x22538c)&&this[_0x2a51bc(0x2c3)](),![];}this[_0x2a51bc(0x5f4)]['style']['display']!=='block'&&(this[_0x2a51bc(0xf69)]=null,this['_container']['style']['display']=_0x2a51bc(0x678));const _0x270feb=this['divHeight'],_0x51e015=this['divWidth'];let _0xb7655a,_0x3fd016;switch(this['horizontalOrigin']){case'CENTER':case Cesium__namespace[_0x2a51bc(0x172)]['CENTER']:_0xb7655a=_0x1f8dbe['x']-_0x51e015/0x2;break;case'RIGHT':case Cesium__namespace[_0x2a51bc(_0xb39432._0x798d1d)]['RIGHT']:_0xb7655a=_0x1f8dbe['x']-_0x51e015;break;case _0x2a51bc(0x1f0):case Cesium__namespace['HorizontalOrigin']['LEFT']:default:_0xb7655a=_0x1f8dbe['x'];break;}switch(this['verticalOrigin']){case'TOP':case Cesium__namespace[_0x2a51bc(_0xb39432._0x5075e0)]['TOP']:_0x3fd016=_0x1f8dbe['y'];break;case'CENTER':case Cesium__namespace[_0x2a51bc(0xf93)][_0x2a51bc(0x238)]:_0x3fd016=_0x1f8dbe['y']-_0x270feb/0x2;break;case _0x2a51bc(_0xb39432._0x3666e0):case Cesium__namespace['VerticalOrigin']['BOTTOM']:default:_0x3fd016=_0x1f8dbe['y']-_0x270feb;break;}this['style']['anchor']?(_0xb7655a+=this[_0x2a51bc(0xfc8)]['anchor'][0x0],_0x3fd016+=this[_0x2a51bc(_0xb39432._0xc55afb)]['anchor'][0x1]):(this['style']['offsetX']&&(_0xb7655a+=this['style']['offsetX']),this['style'][_0x2a51bc(0x83a)]&&(_0x3fd016+=this['style']['offsetY']));let _0x34ac48=0x1;if(_0x2acb1c){if(_0x305915<=_0x2acb1c['near'])_0x34ac48=_0x2acb1c['nearValue'];else _0x305915>_0x2acb1c[_0x2a51bc(0x170)]&&_0x305915<_0x2acb1c[_0x2a51bc(_0xb39432._0x40fb21)]?_0x34ac48=_0x2acb1c['nearValue']+(_0x2acb1c[_0x2a51bc(0xc3a)]-_0x2acb1c['nearValue'])*(_0x305915-_0x2acb1c[_0x2a51bc(0x170)])/(_0x2acb1c['far']-_0x2acb1c['near']):_0x34ac48=_0x2acb1c['farValue'];}const _0x20a35c='matrix('+_0x34ac48+',0,0,'+_0x34ac48+','+_0xb7655a+','+_0x3fd016+')',_0x25b1ff=this[_0x2a51bc(_0xb39432._0x3091d2)];let _0x5065c0=this['options'][_0x2a51bc(0x31f)]||'auto';this[_0x2a51bc(0x115)]&&(_0x5065c0=Math[_0x2a51bc(0xca6)](0x98967f-_0x305915),_0x5065c0<=0x0&&(_0x5065c0=0x98967f)),merge(this[_0x2a51bc(0x5f4)]['style'],{'transform':_0x20a35c,'transform-origin':_0x25b1ff,'-ms-transform':_0x20a35c,'-ms-transform-origin':_0x25b1ff,'-webkit-transform':_0x20a35c,'-webkit-transform-origin':_0x25b1ff,'-moz-transform':_0x20a35c,'-moz-transform-origin':_0x25b1ff,'-o-transform':_0x20a35c,'-o-transform-origin':_0x25b1ff,'z-index':_0x5065c0}),this['fire'](EventType[_0x2a51bc(_0xb39432._0x4d8cb1)],{'position':_0x33ff1c,'windowPosition':_0x1f8dbe,'distance':_0x305915,'x':_0xb7655a,'y':_0x3fd016,'height':_0x270feb,'width':_0x51e015,'scale':_0x34ac48},!![]);}['hide'](){const _0x1a0af5={_0x3c0e8a:0x274},_0x3cf498=_0x35a251;this['_container']['style']['display']=_0x3cf498(_0x1a0af5._0x3c0e8a),this['_camera_cache']=null;}['_getGeoJsonGeometry'](_0x46f9f2){const _0x54373e={_0x5ec3fc:0xf59},_0x35baca=_0x35a251;return{'type':_0x35baca(_0x54373e._0x5ec3fc),'coordinates':this['getCoordinate'](_0x46f9f2===null||_0x46f9f2===void 0x0?void 0x0:_0x46f9f2['noAlt'])};}['addDynamicPosition'](_0x38f3b9,_0x17403d){const _0x2a833b={_0x466986:0xf9d,_0x3bc75a:0xf3e,_0x1d1f0d:0x982,_0x50d9d1:0x249,_0x5bad32:0xe86,_0x552e15:0xb61,_0x4edbc1:0x579,_0xc7fd90:0x39c},_0x26cc8f=_0x35a251;var _0xc32df3,_0x605feb,_0x4fd410,_0x513d95;if(!this['property']){const _0x4c0b9d=new Cesium__namespace['SampledPositionProperty'](this['options']['referenceFrame'],this['options'][_0x26cc8f(_0x2a833b._0x466986)]);_0x4c0b9d['forwardExtrapolationType']=this['options']['forwardExtrapolationType']??Cesium__namespace['ExtrapolationType'][_0x26cc8f(_0x2a833b._0x3bc75a)],_0x4c0b9d[_0x26cc8f(_0x2a833b._0x1d1f0d)]=this['options']['backwardExtrapolationType']??Cesium__namespace['ExtrapolationType']['HOLD'],!this['options']['orientation']&&(this['options']['orientation']=new Cesium__namespace[(_0x26cc8f(0x800))](_0x4c0b9d),this[_0x26cc8f(_0x2a833b._0x50d9d1)]&&(this['_entity']['orientation']=this['getOrientation']())),this['property']=_0x4c0b9d,this['position']=_0x4c0b9d,this['_maxCacheCount']=this[_0x26cc8f(_0x2a833b._0x5bad32)]['maxCacheCount']??0x32;}else this['property']!==this['position']&&(this[_0x26cc8f(_0x2a833b._0x552e15)]=this['property']);this['_removeDynamicPosition']();const _0x17c17f=((_0xc32df3=this['_map'])===null||_0xc32df3===void 0x0?void 0x0:(_0x605feb=_0xc32df3['clock'])===null||_0x605feb===void 0x0?void 0x0:_0x605feb['currentTime'])||Cesium__namespace['JulianDate']['now']();if(!_0x17403d)_0x17403d=_0x17c17f;else{if(isNumber(_0x17403d))_0x17403d=Cesium__namespace['JulianDate']['addSeconds'](_0x17c17f,_0x17403d,new Cesium__namespace['JulianDate']());else{if(isString(_0x17403d))_0x17403d[_0x26cc8f(0xd74)]('Z')===-0x1?_0x17403d=Cesium__namespace[_0x26cc8f(_0x2a833b._0x4edbc1)]['fromDate'](new Date(_0x17403d)):_0x17403d=Cesium__namespace['JulianDate']['fromIso8601'](_0x17403d);else _0x17403d instanceof Date&&(_0x17403d=Cesium__namespace['JulianDate'][_0x26cc8f(0xa51)](_0x17403d));}}_0x38f3b9=LngLatPoint['parse'](_0x38f3b9);const _0x288d93=(_0x4fd410=this['_sampledPositionProperty'])===null||_0x4fd410===void 0x0?void 0x0:(_0x513d95=_0x4fd410['_property'])===null||_0x513d95===void 0x0?void 0x0:_0x513d95[_0x26cc8f(_0x2a833b._0xc7fd90)];if(this['options']['autoMiddleDynamicPosition']&&(_0x288d93===null||_0x288d93===void 0x0?void 0x0:_0x288d93[_0x26cc8f(0xe1e)])>0x0&&this['_position']){const _0x9ad7d8=_0x288d93[_0x288d93[_0x26cc8f(0xe1e)]-0x1];if(Cesium__namespace['JulianDate']['secondsDifference'](_0x17c17f,_0x9ad7d8)>0.3){let _0x1e707e=this['_position'];if(this[_0x26cc8f(0xea1)]){const _0x594c70=0.01;_0x1e707e=getOnLinePointByLen(this['_lastDynamicPosition'],this['_position'],_0x594c70,!![]);}_0x1e707e=setPositionsHeight(_0x1e707e,_0x38f3b9['alt']||0x0),this['_sampledPositionProperty']['addSample'](_0x17c17f,_0x1e707e);}}const _0x43c1a0=_0x38f3b9['toCartesian']();return this[_0x26cc8f(_0x2a833b._0x552e15)]['addSample'](_0x17403d,_0x43c1a0),this;}['_removeDynamicPosition'](){const _0x408884={_0x3a93f7:0x425},_0x8da76=_0x35a251;var _0x4e3565,_0x32402f;if(this['_maxCacheCount']<0x1)return;const _0x1a0451=(_0x4e3565=this['property'])===null||_0x4e3565===void 0x0?void 0x0:(_0x32402f=_0x4e3565['_property'])===null||_0x32402f===void 0x0?void 0x0:_0x32402f['_times'];if(!_0x1a0451||_0x1a0451[_0x8da76(0xe1e)]===0x0)return;const _0x5eb202=_0x1a0451[_0x8da76(0xe1e)]-this['_maxCacheCount']-0x1;_0x5eb202>0x0&&this['property']['removeSamples'](new Cesium__namespace[(_0x8da76(_0x408884._0x3a93f7))]({'start':_0x1a0451[0x0],'stop':_0x1a0451[_0x5eb202]}));}['getCoordinate'](_0x53b34b){return this['point']?this['point']['toArray'](_0x53b34b):[];}['openHighlight'](_0x212585,_0x44f94e=!![]){const _0x3bd88b={_0x35c78c:0x15a},_0x1d841b=_0x35a251;var _0x51ffe1;_0x44f94e&&(this[_0x1d841b(0xd79)]['closeHighlight'](),this['_map']['last_highlighGraphic']=this);const _0x17bdae=_0x212585||this['_highlightOptions']||((_0x51ffe1=this['_layer'])===null||_0x51ffe1===void 0x0?void 0x0:_0x51ffe1[_0x1d841b(0x3eb)]);if(_0x17bdae&&_0x17bdae['className']){for(let _0x279f0e=0x0,_0x63fe92=this['_container'][_0x1d841b(0xdde)]['length'];_0x279f0e<_0x63fe92;_0x279f0e++){const _0x115700=this['_container']['children'][_0x279f0e];addClass(_0x115700,_0x17bdae[_0x1d841b(_0x3bd88b._0x35c78c)]);}this['_highlightOptions']=_0x17bdae,this['fire'](EventType['highlightOpen'],{},!![]);}}['closeHighlight'](){const _0xaec51f={_0x13ac49:0xdde},_0x5598f3=_0x35a251;var _0x4662d6;if(!this['isAdded']||((_0x4662d6=this['_map'])===null||_0x4662d6===void 0x0?void 0x0:_0x4662d6['last_highlighGraphic'])!==this)return;this['_map']['_clearLastHighlight']();const _0x3cac7b=this['_highlightOptions'];if(_0x3cac7b&&_0x3cac7b['className']){for(let _0x23487c=0x0,_0x437ad8=this['_container']['children']['length'];_0x23487c<_0x437ad8;_0x23487c++){const _0x13b063=this['_container'][_0x5598f3(_0xaec51f._0x13ac49)][_0x23487c];removeClass(_0x13b063,_0x3cac7b['className']);}this['fire'](EventType['highlightClose'],{},!![]);}}['_getWindowPosition'](_0x93ed56){const _0x9465a9={_0x5ee8c7:0xd79,_0x4180b9:0x1ae,_0x3fe048:0x248,_0x52b15d:0xbcc},_0x5bdbdf=_0x35a251;if(isFirefox){const _0x428f31=this[_0x5bdbdf(_0x9465a9._0x5ee8c7)]['container'][_0x5bdbdf(_0x9465a9._0x4180b9)]();return new Cesium__namespace[(_0x5bdbdf(_0x9465a9._0x3fe048))](_0x93ed56['clientX']-_0x428f31['left'],_0x93ed56['clientY']-_0x428f31['top']);}return new Cesium__namespace['Cartesian2'](_0x93ed56['layerX'],_0x93ed56[_0x5bdbdf(_0x9465a9._0x52b15d)]);}['_getEventTarget'](_0x53837a){const _0x2bbd69={_0x5052fe:0xc60},_0xc212dd=_0x35a251;_0x53837a['stopPropagation']&&_0x53837a[_0xc212dd(0xbee)]();const _0x123c70=this[_0xc212dd(0xc1a)](_0x53837a),_0x14a679={'mouseEvent':_0x53837a,'cartesian':this['position'],'windowPosition':_0x123c70,'sourceTarget':this,'graphic':this,'layer':this['_layer']};return this[_0xc212dd(0x2d0)]&&(this['_layer']['_graphic_drawing']||this[_0xc212dd(0x2d0)]['_hasEdit']&&this['hasEdit'])&&(_0x14a679['cartesian']=getCurrentMousePosition(this[_0xc212dd(0xd79)][_0xc212dd(_0x2bbd69._0x5052fe)],_0x123c70)),_0x14a679;}['_container_onClickHandler'](_0x22e625){const _0x5105ca=_0x35a251;if(this['_enabledEdit'])return;const _0x497d93=this['_getEventTarget'](_0x22e625);_0x497d93[_0x5105ca(0xb61)]=_0x497d93['windowPosition'],this['fire'](EventType['click'],_0x497d93,!![]);}['_container_onMousedownHandler'](_0x324460){const _0x5b06ad={_0x33735e:0x264},_0x585bde=_0x35a251;if(_0x324460['button']!==0x2)return;const _0x1ef29f=this['_getEventTarget'](_0x324460);_0x1ef29f[_0x585bde(0xb61)]=_0x1ef29f['windowPosition'],this[_0x585bde(_0x5b06ad._0x33735e)](EventType['rightClick'],_0x1ef29f,!![]);}[_0x35a251(0xb5b)](_0x25570b){const _0x30c0e9={_0x3cd096:0xd79,_0x4afd6e:0xb0,_0x1d18d8:0x971,_0x3a8a74:0x264},_0x45a83f=_0x35a251;if(this[_0x45a83f(0xc4e)])return;this[_0x45a83f(_0x30c0e9._0x3cd096)][_0x45a83f(_0x30c0e9._0x4afd6e)][_0x45a83f(0x89d)]();const _0x5d77c6=this[_0x45a83f(0x671)](_0x25570b);_0x5d77c6['endPosition']=_0x5d77c6['windowPosition'],this[_0x45a83f(_0x30c0e9._0x3cd096)]['fire'](EventType[_0x45a83f(_0x30c0e9._0x1d18d8)],_0x5d77c6),this['_map'][_0x45a83f(_0x30c0e9._0x3a8a74)](EventType['mouseMoveTarget'],_0x5d77c6),!this[_0x45a83f(0xbd6)]&&this[_0x45a83f(0x264)](EventType['mouseOver'],_0x5d77c6,!![]),this['_hasMouseOver']=!![];}['_container_onMouseoutHandler'](_0x598c1e){const _0x155cd7=_0x35a251;if(this['_enabledEdit'])return;this['_hasMouseOver']=![];const _0x1623e9=this['_getEventTarget'](_0x598c1e);this[_0x155cd7(0x264)](EventType['mouseOut'],_0x1623e9,!![]);}['autoSurfaceHeight'](_0x5d0f73){const _0x27da17=_0x35a251;return getSurfaceHeight(this['_map'][_0x27da17(0xc60)],this['position'],_0x5d0f73??this['options'])['then'](_0xc30ece=>{_0xc30ece['position']&&(this['position']=_0xc30ece['position']);});}[_0x35a251(0x1e0)](_0x45a4b5,_0x2a5b91){return DivGraphicStyleConver['toJSON'](_0x45a4b5,_0x2a5b91,!![]);}['getRectangle'](_0x888b40){const _0x40be27=this['positionShow'];if(!_0x40be27)return;const _0x5828d6=getRectangle([_0x40be27],_0x888b40===null||_0x888b40===void 0x0?void 0x0:_0x888b40['isFormat']);return _0x5828d6;}[_0x35a251(0x2ef)](_0xdd8780){const _0x465059={_0x5888f8:0xd79,_0x1fb461:0xa4f},_0x4ca5db=_0x35a251;if(this[_0x4ca5db(0x5f2)])return this;this['_enabledDraw']=!![];_0xdd8780&&this['addTo'](_0xdd8780);if(!this['_map'])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this[_0x4ca5db(_0x465059._0x5888f8)]['_setEditCursor'](!![]),this[_0x4ca5db(_0x465059._0x1fb461)](![]),this['_startDrawHook'](),this['fire'](EventType[_0x4ca5db(0xcd2)],{'drawtype':this['type'],'graphic':this},!![]);}['stopDraw'](){const _0x3fc32e={_0x4b16df:0xf13},_0x4b6865=_0x35a251;var _0x46f489,_0x59ea5c,_0xdaa938;if(!this['_enabledDraw'])return this;this['_stopDrawHook'](),this['_map']['_setEditCursor'](![]),this['enableControl'](!![]),this['_map']['closeSmallTooltip'](),this[_0x4b6865(0x5f2)]=![],this['fire'](EventType['drawCreated'],{'drawtype':this['type'],'graphic':this},!![]),(_0x46f489=this[_0x4b6865(0xe86)])!==null&&_0x46f489!==void 0x0&&_0x46f489['success']&&this['options']['success'](this),(_0x59ea5c=this[_0x4b6865(0xe86)])!==null&&_0x59ea5c!==void 0x0&&(_0xdaa938=_0x59ea5c['_promise'])!==null&&_0xdaa938!==void 0x0&&_0xdaa938['resolve']&&this['options'][_0x4b6865(_0x3fc32e._0x4b16df)]['resolve'](this);}['_startDrawHook'](){const _0x5e51c1=_0x35a251;this[_0x5e51c1(0x2b5)](![]),this[_0x5e51c1(0xd79)]['on'](EventType[_0x5e51c1(0x971)],this['_onMouseMoveHandler_point'],this),this['_map']['on'](EventType[_0x5e51c1(0xfb4)],this['_onClickHandler_point'],this);}['_stopDrawHook'](){const _0x28ac81=_0x35a251;this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['off'](EventType[_0x28ac81(0xfb4)],this[_0x28ac81(0xe4c)],this),this['_updatePointerEvents'](this['hasBindEvent']());}['_onMouseMoveHandler_point'](_0x3204f0){const _0x12f640={_0x5459ef:0x771},_0x120ca0=_0x35a251,_0x4d0207=_0x3204f0[_0x120ca0(0x4bb)];_0x4d0207&&(this['position']=_0x4d0207),this[_0x120ca0(0xd79)][_0x120ca0(_0x12f640._0x5459ef)](_0x3204f0[_0x120ca0(0x37e)],this['_draw_tooltip']||this['_map']['getLangText']('_单击完成绘制')),this['fire'](EventType['drawMouseMove'],{..._0x3204f0,'drawtype':this['type'],'graphic':this},!![]);}['_onClickHandler_point'](_0x3c9c84){const _0x2e74d7={_0x3206d5:0x4bb},_0xf10683=_0x35a251,_0x43ec25=_0x3c9c84[_0xf10683(_0x2e74d7._0x3206d5)];_0x43ec25&&(this['position']=_0x43ec25),this['stopDraw']();}[_0x35a251(0xac7)](){}[_0x35a251(0x736)](){}['endDraw'](){const _0x99bece={_0x3d3b34:0xe1e},_0x2c22aa=_0x35a251;if(!this[_0x2c22aa(0x5f2)])return this;if(this['_positions_draw'][_0x2c22aa(_0x99bece._0x3d3b34)]\x0a\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+template(_0x1d411a['text'],_0xb6cd66,_0x1d411a['templateEmptyStr']??!![])+'\x0a\x20\x20\x20\x20\x20\x0a\x20\x20\x20';}const DEF_STYLE$6={'color':_0x35a251(0xe29),'horizontalOrigin':Cesium__namespace[_0x35a251(0x172)]['CENTER'],'verticalOrigin':Cesium__namespace['VerticalOrigin'][_0x35a251(0x238)]};class DivLightPoint extends DivGraphic{constructor(_0x22746a={}){const _0x466b12=_0x35a251;_0x22746a[_0x466b12(0xfc8)]={...DEF_STYLE$6,..._0x22746a['style']||{}},_0x22746a['style']['html']=getHtmlByStyle$1(_0x22746a['style'],_0x22746a['attr']),super(_0x22746a);}[_0x35a251(0xccd)](_0x236b87){const _0x1ea9fa=_0x35a251;return(Cesium__namespace['defined'](_0x236b87['color'])||Cesium__namespace['defined'](_0x236b87['size'])||Cesium__namespace['defined'](_0x236b87['label']))&&(this['html']=getHtmlByStyle$1(this['style'],this[_0x1ea9fa(0x6b3)])),super['_updateStyleBaseHook'](_0x236b87),this;}}register$4('divLightPoint',DivLightPoint,!![]);function getHtmlByStyle$1(_0x47c11f,_0x3e77dd){const _0x2cd01e={_0x2907be:0x9db,_0x2ac08d:0x67c},_0x234c14=_0x35a251;return'\x0a\x20\x20\x0a\x20\x20\x20\x20

\x0a\x20\x20\x20\x20'+(_0x47c11f['label']?''+template(_0x47c11f['label']['text'],_0x3e77dd,_0x47c11f['label'][_0x234c14(_0x2cd01e._0x2ac08d)]??!![])+'':'')+'\x0a\x20\x20';}const DEF_STYLE$5={'color':'white','font_family':'楷体','font_size':0xf,'lineHeight':0x64,'circleSize':0xa,'horizontalOrigin':Cesium__namespace[_0x35a251(0x172)]['CENTER'],'verticalOrigin':Cesium__namespace[_0x35a251(0xf93)]['BOTTOM']};class DivUpLabel extends DivGraphic{constructor(_0x43c574={}){const _0x508dd3=_0x35a251;_0x43c574['style']={...DEF_STYLE$5,..._0x43c574[_0x508dd3(0xfc8)]||{}},_0x43c574[_0x508dd3(0xfc8)]['html']=getHtmlByStyle(_0x43c574[_0x508dd3(0xfc8)],_0x43c574['attr']),super(_0x43c574);}['_updateStyleBaseHook'](_0x200b12){const _0x105519={_0x2668bb:0xaa2,_0x4172dc:0x6b3},_0x1ee1d4=_0x35a251;return(Cesium__namespace[_0x1ee1d4(0xaa2)](_0x200b12['color'])||Cesium__namespace['defined'](_0x200b12['circleSize'])||Cesium__namespace[_0x1ee1d4(_0x105519._0x2668bb)](_0x200b12['font_size'])||Cesium__namespace['defined'](_0x200b12['font_family'])||Cesium__namespace['defined'](_0x200b12['lineHeight'])||Cesium__namespace[_0x1ee1d4(_0x105519._0x2668bb)](_0x200b12[_0x1ee1d4(0xe1f)]))&&(this['html']=getHtmlByStyle(this['style'],this[_0x1ee1d4(_0x105519._0x4172dc)])),super[_0x1ee1d4(0xccd)](_0x200b12),this;}}register$4(_0x35a251(0x2cd),DivUpLabel,!![]);function getHtmlByStyle(_0x85cb54,_0x70fb43){const _0x559e29={_0x3f5336:0xe1f,_0x23e47d:0x36f},_0x182e44=_0x35a251,_0x1f2526=_0x85cb54['color'],_0x976fad=_0x85cb54['circleSize'];return'\x0a\x20\x20\x0a\x20\x20\x20\x20'+template(_0x85cb54[_0x182e44(_0x559e29._0x3f5336)],_0x70fb43,!![])+'\x0a\x20\x20\x20\x20\x0a\x20\x20\x20';}class Popup extends DivGraphic{constructor(_0x40e5de={}){const _0x12cf10={_0x2a9b21:0xf1c,_0x4d7ccb:0xf1c,_0x15ab3f:0xfc8,_0x495297:0x3dc,_0xaa16e6:0x172},_0xbc4544=_0x35a251;_0x40e5de['eventParent']=_0x40e5de['eventParent']??![],_0x40e5de['hasEdit']=_0x40e5de['hasEdit']??![],_0x40e5de[_0xbc4544(_0x12cf10._0x2a9b21)]=_0x40e5de[_0xbc4544(_0x12cf10._0x4d7ccb)]??!![],_0x40e5de['zIndex']=_0x40e5de['zIndex']??0x989680,_0x40e5de['style']=_0x40e5de['style']||{},_0x40e5de['style']['direction']=_0x40e5de['style'][_0xbc4544(0x79b)]??'top';const _0x565c36={};switch(_0x40e5de[_0xbc4544(_0x12cf10._0x15ab3f)]['direction']){case'top':_0x565c36[_0xbc4544(0x83a)]=-0x8,_0x565c36[_0xbc4544(_0x12cf10._0x495297)]=Cesium__namespace['HorizontalOrigin'][_0xbc4544(0x238)],_0x565c36['verticalOrigin']=Cesium__namespace['VerticalOrigin']['BOTTOM'];break;case'bottom':_0x565c36['offsetY']=0x8,_0x565c36[_0xbc4544(0x3dc)]=Cesium__namespace[_0xbc4544(_0x12cf10._0xaa16e6)][_0xbc4544(0x238)],_0x565c36['verticalOrigin']=Cesium__namespace[_0xbc4544(0xf93)]['TOP'];break;case'center':_0x565c36['horizontalOrigin']=Cesium__namespace[_0xbc4544(0x172)]['CENTER'],_0x565c36[_0xbc4544(0x544)]=Cesium__namespace['VerticalOrigin']['CENTER'];break;case'right':_0x565c36[_0xbc4544(0x929)]=0x8,_0x565c36['horizontalOrigin']=Cesium__namespace['HorizontalOrigin']['LEFT'],_0x565c36['verticalOrigin']=Cesium__namespace['VerticalOrigin']['CENTER'];break;case'left':_0x565c36['offsetX']=-0x8,_0x565c36['horizontalOrigin']=Cesium__namespace['HorizontalOrigin'][_0xbc4544(0x64e)],_0x565c36['verticalOrigin']=Cesium__namespace['VerticalOrigin']['CENTER'];break;}_0x40e5de['style']={..._0x565c36,..._0x40e5de['style']},super(_0x40e5de),this['_depthTest']=this['options']['depthTest']??this['style']['depthTest']??![],!Cesium__namespace['defined'](this['style']['template'])&&this['style']['template']!==![]&&(this['style']['template']=this['_getDefaultTemplate']()),this['once'](EventType[_0xbc4544(0x64a)],()=>{this['_fireTarget_open']();});}get[_0x35a251(0xe28)](){var _0x17652a;return(_0x17652a=this['options'])===null||_0x17652a===void 0x0?void 0x0:_0x17652a['target'];}get['eventTarget'](){const _0x22c713=_0x35a251;var _0x50a5d4,_0x237f74;if((_0x50a5d4=this[_0x22c713(0xe86)])!==null&&_0x50a5d4!==void 0x0&&_0x50a5d4['event'])return this['options']['event'];return(_0x237f74=this['options'])!==null&&_0x237f74!==void 0x0&&_0x237f74['target']?this[_0x22c713(0xe86)]['target']:this;}[_0x35a251(0x568)](){const _0x29b92d={_0x5e6a46:0x593,_0x2c1c8f:0xfc8},_0x53a55a=_0x35a251;let _0x8232f8;this['style']['closeButton']??!![]?_0x8232f8='×':_0x8232f8='';let _0x5a2551='';return this['style']['maxWidth']&&(_0x5a2551+='max-width:\x20'+this['style']['maxWidth']+_0x53a55a(0x144)),this['style']['minWidth']&&(_0x5a2551+=_0x53a55a(_0x29b92d._0x5e6a46)+this['style']['minWidth']+'px;'),this['style']['maxHeight']&&(_0x5a2551+='max-height:\x20'+this[_0x53a55a(_0x29b92d._0x2c1c8f)]['maxHeight']+'px;'),'\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+_0x8232f8+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{content}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20';}[_0x35a251(0x789)](){const _0x4b025b={_0x2cec6a:0xfb4},_0x3c2630={_0x35df95:0xe28,_0x29b8fe:0xe28},_0x9d498=_0x35a251,_0x5f07bc=this[_0x9d498(0x5f4)]['querySelector']('.closeButton');_0x5f07bc&&_0x5f07bc[_0x9d498(0x77e)](_0x9d498(_0x4b025b._0x2cec6a),_0x329fbd=>{const _0xa41145=_0x9d498;this['target']&&this[_0xa41145(_0x3c2630._0x35df95)]['closeHighlight']&&this[_0xa41145(_0x3c2630._0x29b8fe)]['closeHighlight'](),this['remove'](!![]);});}['fireTarget'](_0x42601e,_0xb8c34={},_0x567b9b=!![]){const _0x450cb4={_0x34a46b:0xe28,_0x12e5a7:0xe86,_0x311f6c:0xe86,_0x38a2e4:0x94f},_0x3571a0=_0x35a251,_0x4d84bb=this[_0x3571a0(_0x450cb4._0x34a46b)]||this[_0x3571a0(0xd79)];if(_0x4d84bb){if(this[_0x3571a0(_0x450cb4._0x12e5a7)]['event'])for(const _0xc62524 in this[_0x3571a0(_0x450cb4._0x311f6c)]['event']){if(_0xc62524===_0x3571a0(0xe86)||_0xc62524==='content')continue;_0xb8c34[_0xc62524]=this['options']['event'][_0xc62524];}_0xb8c34['sourceTarget']=_0x4d84bb,_0xb8c34['attr']=this['attr'],_0xb8c34[_0x3571a0(_0x450cb4._0x38a2e4)]=this['container'],this['_fireBindDataEx'](_0xb8c34),_0x4d84bb['fire'](_0x42601e,_0xb8c34,_0x567b9b);}}['_fireBindDataEx'](_0x4bea9a){_0x4bea9a['popup']=this;}['_addedHook'](_0x553b74){const _0x844d4f={_0x31177f:0x1fd},_0x5e7160={_0x1d55ce:0xc60,_0x15a5c7:0xd79,_0x2a887f:0x682,_0x31abe6:0xd79},_0x340804=_0x35a251;super['_addedHook'](_0x553b74),this[_0x340804(_0x844d4f._0x31177f)](EventType['change'],_0x3e1cca=>{const _0x179781=_0x340804;if(this['options']['autoCenter']&&this['_map']){if(_0x3e1cca['y']<0x0||_0x3e1cca['x']<0x0||_0x3e1cca['x']>this[_0x179781(0xd79)][_0x179781(_0x5e7160._0x1d55ce)]['canvas']['clientWidth']-_0x3e1cca['width']||_0x3e1cca['y']>this[_0x179781(_0x5e7160._0x15a5c7)][_0x179781(_0x5e7160._0x1d55ce)]['canvas']['clientHeight']-_0x3e1cca[_0x179781(_0x5e7160._0x2a887f)]){const _0x2f87d4=_0x3e1cca['width']/0x2+_0x3e1cca['x'],_0x1e7cb0=_0x3e1cca['height']/0x2+_0x3e1cca['y'],_0x32bd92=new Cesium__namespace['Cartesian2'](_0x2f87d4,_0x1e7cb0),_0x44a5ba=this['_map']['scene']['camera'][_0x179781(0xcbd)](_0x32bd92);let _0x228821=this['_map']['scene']['globe']['pick'](_0x44a5ba,this[_0x179781(_0x5e7160._0x31abe6)][_0x179781(_0x5e7160._0x1d55ce)]);!_0x228821&&(_0x228821=this['_map'][_0x179781(_0x5e7160._0x1d55ce)][_0x179781(0x7d)]['pickEllipsoid'](_0x32bd92)),this['_map']['flyToPoint'](_0x228821);}}}),this['target']&&this['target']['on'](EventType['updatePosition'],this['_graphic_updatePosition'],this);}['_removedHook'](){const _0x1ed893={_0x15a0a6:0xe28,_0x55cbb3:0xa9a},_0x2e9b98=_0x35a251;this['target']&&this[_0x2e9b98(_0x1ed893._0x15a0a6)]['off'](EventType['updatePosition'],this['_graphic_updatePosition'],this),this['_fireTarget_close'](),super[_0x2e9b98(_0x1ed893._0x55cbb3)]();}['_graphic_updatePosition'](_0x11d69f){const _0x18e37a={_0x9acf94:0x6b4},_0x173af3=_0x35a251;var _0x4142b4;(_0x4142b4=_0x11d69f['graphic'])!==null&&_0x4142b4!==void 0x0&&_0x4142b4['_getPopupPosition']&&(this['position']=_0x11d69f['graphic'][_0x173af3(_0x18e37a._0x9acf94)]());}[_0x35a251(0x93e)](){const _0x4908d8={_0x4b2c23:0x26c},_0x56b31f=_0x35a251;this[_0x56b31f(_0x4908d8._0x4b2c23)](EventType['popupOpen']);}['_fireTarget_close'](){const _0x2e90de=_0x35a251;this[_0x2e90de(0x26c)](EventType['popupClose']);}['_closeAllControl'](){}['_container_onClickHandler'](){}['_container_onMousedownHandler'](){}[_0x35a251(0xb5b)](){}[_0x35a251(0xc7e)](){}['hasBindEvent'](){return this['options']['pointerEvents']??!![];}}register$4('popup',Popup);class Tooltip extends Popup{['_getDefaultTemplate'](){const _0x2b08b3={_0x60b155:0x454},_0x2e604b=_0x35a251;return _0x2e604b(_0x2b08b3._0x60b155)+this['id']+_0x2e604b(0xdf3)+this['style']['direction']+'\x22>{content}';}[_0x35a251(0x78b)](_0x204a3c){const _0x19b3a9=_0x35a251;_0x204a3c[_0x19b3a9(0x631)]=this;}['_fireTarget_open'](){this['fireTarget'](EventType['tooltipOpen']);}['_fireTarget_close'](){const _0x145368={_0x310e4f:0x26c},_0x442829=_0x35a251;this[_0x442829(_0x145368._0x310e4f)](EventType['tooltipClose']);}}register$4('tooltip',Tooltip);const DEF_STYLE$4={'startColor':Cesium__namespace['Color'][_0x35a251(0x1d9)]['withAlpha'](0.3),'endColor':Cesium__namespace[_0x35a251(0xf29)]['WHITE'][_0x35a251(0x373)](0x0),'startScale':0x2,'endScale':0x4,'minimumParticleLife':0x3,'maximumParticleLife':0x6,'minimumSpeed':0x1,'maximumSpeed':0x2,'emissionRate':0x64};class ParticleSystem extends BasePointPrimitive{constructor(_0x5799f5={}){const _0x268f61={_0x320ee0:0x8eb,_0x3b9b94:0x237,_0x208039:0x8a1},_0x44ae3a=_0x35a251;_0x5799f5['style']={...DEF_STYLE$4,'emitter':new Cesium__namespace['CircleEmitter'](0x1),..._0x5799f5['style']||{}},super(_0x5799f5),this['emitterModelMatrix']=new Cesium__namespace['Matrix4'](),this['translation']=new Cesium__namespace[(_0x44ae3a(_0x268f61._0x320ee0))](),this['rotation']=new Cesium__namespace['Quaternion'](),this['hpr']=new Cesium__namespace['HeadingPitchRoll'](),this[_0x44ae3a(_0x268f61._0x3b9b94)]=new Cesium__namespace[(_0x44ae3a(_0x268f61._0x208039))]();}get['czmObject'](){const _0x2ff3a5={_0x457029:0x90a},_0x25c4f8=_0x35a251;return this[_0x25c4f8(_0x2ff3a5._0x457029)];}get['maxHeight'](){const _0x3096f4=_0x35a251;return this[_0x3096f4(0xfc8)]['maxHeight'];}set['maxHeight'](_0x3f6b20){this['style']['maxHeight']=_0x3f6b20;}get['gravity'](){const _0x3adaff=_0x35a251;return this[_0x3adaff(0xfc8)]['gravity']||0x0;}set[_0x35a251(0x103)](_0x758d47){this['style']['gravity']=_0x758d47;}get[_0x35a251(0xd58)](){return this['style']['transX']||0x0;}set['transX'](_0x555eef){this['style']['transX']=_0x555eef;}get['transY'](){return this['style']['transY']||0x0;}set['transY'](_0x15fe60){const _0x5dbd2a={_0x4849fd:0xfc8},_0x3064c0=_0x35a251;this[_0x3064c0(_0x5dbd2a._0x4849fd)]['transY']=_0x15fe60;}get['transZ'](){return this['style']['transZ']||0x0;}set['transZ'](_0x1eeece){this['style']['transZ']=_0x1eeece;}get['particleSize'](){const _0x48f039=_0x35a251;return this[_0x48f039(0xfc8)]['particleSize']||0x19;}set['particleSize'](_0x108475){const _0x25aa60={_0x86ad23:0xfc8,_0x551619:0x167,_0x3c5ac2:0x90a},_0x595dfd=_0x35a251;this[_0x595dfd(_0x25aa60._0x86ad23)][_0x595dfd(_0x25aa60._0x551619)]=_0x108475,this['_primitive']&&(this[_0x595dfd(_0x25aa60._0x3c5ac2)][_0x595dfd(0xbe8)]['x']=_0x108475,this['_primitive']['minimumImageSize']['y']=_0x108475,this['_primitive']['maximumImageSize']['x']=_0x108475,this['_primitive'][_0x595dfd(0xc27)]['y']=_0x108475);}get['hasOpacity'](){return![];}[_0x35a251(0x97b)](_0x555a9c){const _0x51c614={_0x566ee0:0x987,_0x3b9b9a:0x248,_0x47d7ec:0x167,_0x21e574:0xec3,_0x598472:0x987,_0x4ef212:0x90a,_0x35a46c:0x293,_0x3de234:0xb61,_0x33c54d:0x84d,_0x2a4c2f:0xf2f,_0x14a6c4:0xe86},_0x5b09d7={_0x5631b1:0xe53,_0x362851:0xe53},_0x4c8a02=_0x35a251;if(!this[_0x4c8a02(_0x51c614._0x566ee0)])return;const _0x48515f=this[_0x4c8a02(0xd79)]['clock']['currentTime'],_0x1a59fe={'imageSize':new Cesium__namespace[(_0x4c8a02(_0x51c614._0x3b9b9a))](this[_0x4c8a02(_0x51c614._0x47d7ec)],this[_0x4c8a02(_0x51c614._0x47d7ec)]),'modelMatrix':this['_computeModelMatrix'](_0x48515f),'emitterModelMatrix':this[_0x4c8a02(_0x51c614._0x21e574)](_0x48515f),...this['style'],'show':this[_0x4c8a02(_0x51c614._0x598472)]};this[_0x4c8a02(_0x51c614._0x4ef212)]=new Cesium__namespace['ParticleSystem'](_0x1a59fe),this[_0x4c8a02(_0x51c614._0x35a46c)]['add'](this['_primitive']);this['options']['position']&&((this['options']['position']instanceof Cesium__namespace['CallbackProperty']||this['options'][_0x4c8a02(_0x51c614._0x3de234)]instanceof Cesium__namespace['SampledPositionProperty'])&&(this['_orientation']=this['options'][_0x4c8a02(0x8fd)]||new Cesium__namespace['VelocityOrientationProperty'](this['options'][_0x4c8a02(0xb61)]),this['property']=this['options']['position']));this[_0x4c8a02(_0x51c614._0x33c54d)](),this[_0x4c8a02(_0x51c614._0x2a4c2f)]=isFunction(this[_0x4c8a02(_0x51c614._0x14a6c4)]['modelMatrix'])||this['property'],this['_hasUpdate_emitterModelMatrix']=isFunction(this['options']['emitterModelMatrix'])||this['heading']||this['pitch']||this['roll']||this['transX']||this['transY']||this['transZ'];const _0x133e8a=this[_0x4c8a02(0x90a)][_0x4c8a02(0x182)],_0x3e5a95=this;this['_primitive']['update']=function(_0x326adb){const _0xe4c1b2=_0x4c8a02;_0x3e5a95['_update'](_0x326adb);if(this['_previousTime']){const _0x2670c8=Cesium__namespace[_0xe4c1b2(0x579)][_0xe4c1b2(0xe3d)](_0x326adb['time'],this[_0xe4c1b2(0xe53)]);_0x2670c8>0xa&&(this[_0xe4c1b2(_0x5b09d7._0x5631b1)]=Cesium__namespace['JulianDate'][_0xe4c1b2(0xd61)](_0x326adb['time'],this[_0xe4c1b2(_0x5b09d7._0x362851)]));}_0x133e8a['bind'](this)(_0x326adb);};}['_removedHook'](){const _0x4220d8={_0x4a5004:0x90a},_0x51e95a=_0x35a251;if(!this[_0x51e95a(0xd79)])return;this['primitiveCollection']['remove'](this[_0x51e95a(_0x4220d8._0x4a5004)]);}['_update'](_0x1bb737){const _0x3f6e4d={_0x12d6b6:0x7cf,_0x491485:0x942,_0x261d7c:0x78e,_0x272380:0x90a},_0xb8cc16=_0x35a251;if(!this['show']||!this['_primitive']||!this['_map'])return;this['property']&&(this['_position']=getPositionValue(this[_0xb8cc16(0xb86)],_0x1bb737['time'])),this['_hasUpdate_modelMatrix']&&(this['_primitive'][_0xb8cc16(0x8a0)]=this['_computeModelMatrix'](_0x1bb737['time'])),this['_hasUpdate_emitterModelMatrix']&&(this['_primitive'][_0xb8cc16(_0x3f6e4d._0x12d6b6)]=this[_0xb8cc16(0xec3)](_0x1bb737['time'])),Cesium__namespace['defined'](this[_0xb8cc16(0x571)])&&_0x1bb737[_0xb8cc16(_0x3f6e4d._0x491485)]%0xa===0x0&&(this['_map']['camera'][_0xb8cc16(_0x3f6e4d._0x261d7c)]['height']{return this['color'];}},'pass':Cesium__namespace[_0x21385c(_0x516e7d._0x54a0bf)]['OPAQUE'],'owner':this,'cull':!![],'renderState':Cesium__namespace['RenderState'][_0x21385c(_0x516e7d._0x56c25e)]({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]}})});return this['bindPickId'](_0xf699e8),_0xf699e8;}['createVertices'](){const _0x38313f={_0x2c68cd:0x614,_0x30d7a4:0x79c,_0x4ec6b9:0xeec},_0x37438a=_0x35a251,_0x491666=this['style'][_0x37438a(0xeed)],_0x2fcc58=0x14,_0x4e4f1a=(_0x2fcc58+0x1)*(_0x2fcc58+0x1)+0x1,_0x492cff=Cesium__namespace['ComponentDatatype']['createTypedArray'](Cesium__namespace[_0x37438a(_0x38313f._0x2c68cd)]['FLOAT'],0x3*_0x4e4f1a);let _0x133258=0x3;const _0x3b91e8=Cesium__namespace[_0x37438a(0x7c0)]['toRadians'](this['angle']*0x2),_0x483c56=Cesium__namespace['Math']['toRadians'](this[_0x37438a(_0x38313f._0x30d7a4)]*0x2),_0x1883bb=Math[_0x37438a(0x9b5)](0.5*_0x483c56),_0x5748f1=_0x491666*_0x1883bb,_0x1de4b2=Math['PI']-0.5*_0x3b91e8;let _0x4e8f91=0x0,_0x585352=0x0;const _0x35da79=_0x3b91e8/_0x2fcc58;for(let _0x1a3c98=0x0;_0x1a3c98<_0x2fcc58+0x1;_0x1a3c98++){_0x4e8f91=_0x1de4b2+_0x1a3c98*_0x35da79;const _0x215211=_0x5748f1/(_0x491666/Math[_0x37438a(_0x38313f._0x4ec6b9)](_0x4e8f91)),_0x12a520=Math['atan'](_0x215211),_0x1be60c=-_0x12a520,_0x3812c6=0x2*_0x12a520/_0x2fcc58;for(let _0x56d988=0x0;_0x56d988<_0x2fcc58+0x1;_0x56d988++){_0x585352=_0x1be60c+_0x56d988*_0x3812c6,_0x492cff[_0x133258++]=_0x491666*Math['cos'](_0x585352)*Math['sin'](_0x4e8f91),_0x492cff[_0x133258++]=_0x491666*Math['sin'](_0x585352),_0x492cff[_0x133258++]=_0x491666*Math['cos'](_0x585352)*Math['cos'](_0x4e8f91);}}const _0x1f762a=0x2*(0x4+0x5*_0x2fcc58+0x2*_0x2fcc58*0x3),_0x5ac8f2=Cesium__namespace['ComponentDatatype']['createTypedArray'](Cesium__namespace['ComponentDatatype']['UNSIGNED_SHORT'],_0x1f762a);let _0x4b1c9d=0x0;_0x5ac8f2[_0x4b1c9d++]=0x0,_0x5ac8f2[_0x4b1c9d++]=0x1,_0x5ac8f2[_0x4b1c9d++]=0x0,_0x5ac8f2[_0x4b1c9d++]=_0x2fcc58+0x1,_0x5ac8f2[_0x4b1c9d++]=0x0,_0x5ac8f2[_0x4b1c9d++]=_0x2fcc58*(_0x2fcc58+0x1)+0x1,_0x5ac8f2[_0x4b1c9d++]=0x0,_0x5ac8f2[_0x4b1c9d++]=(_0x2fcc58+0x1)*(_0x2fcc58+0x1);for(let _0x3bddbf=0x0;_0x3bddbf<0x5;_0x3bddbf++){for(let _0x18cb0a=0x0;_0x18cb0a<_0x2fcc58;_0x18cb0a++){_0x5ac8f2[_0x4b1c9d++]=0x1+_0x18cb0a+0x5*(_0x2fcc58+0x1)*_0x3bddbf,_0x5ac8f2[_0x4b1c9d++]=0x1+(_0x18cb0a+0x1)+0x5*(_0x2fcc58+0x1)*_0x3bddbf;}}for(let _0x3fa92f=0x0;_0x3fa92f<0x5;_0x3fa92f++){for(let _0x5901f0=0x0;_0x5901f0<_0x2fcc58;_0x5901f0++){_0x5ac8f2[_0x4b1c9d++]=0x1+(_0x2fcc58+0x1)*_0x5901f0+0x5*_0x3fa92f,_0x5ac8f2[_0x4b1c9d++]=0x1+(_0x2fcc58+0x1)*(_0x5901f0+0x1)+0x5*_0x3fa92f;}}const _0x52e963=_0x2fcc58*_0x2fcc58*0x3*0x2+0x3*_0x2fcc58*0x4,_0x38588c=Cesium__namespace['ComponentDatatype']['createTypedArray'](Cesium__namespace['ComponentDatatype'][_0x37438a(0xc0c)],_0x52e963),_0x2f6f91=0x1;for(let _0x26886f=0x0;_0x26886f<_0x2fcc58;_0x26886f++){for(let _0x4303f3=0x0;_0x4303f3<_0x2fcc58;_0x4303f3++){_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+_0x4303f3*(_0x2fcc58+0x1),_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+0x1+_0x4303f3*(_0x2fcc58+0x1),_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+(_0x4303f3+0x1)*(_0x2fcc58+0x1),_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+0x1+_0x4303f3*(_0x2fcc58+0x1),_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+0x1+(_0x4303f3+0x1)*(_0x2fcc58+0x1),_0x38588c[_0x4b1c9d++]=_0x2f6f91+_0x26886f+(_0x4303f3+0x1)*(_0x2fcc58+0x1);}}for(let _0x5a4a44=0x0;_0x5a4a44<_0x2fcc58;_0x5a4a44++){_0x38588c[_0x4b1c9d++]=_0x5a4a44+0x1+_0x2f6f91,_0x38588c[_0x4b1c9d++]=_0x5a4a44+_0x2f6f91,_0x38588c[_0x4b1c9d++]=0x0,_0x38588c[_0x4b1c9d++]=0x0,_0x38588c[_0x4b1c9d++]=_0x5a4a44+_0x2fcc58*(_0x2fcc58+0x1)+_0x2f6f91,_0x38588c[_0x4b1c9d++]=_0x5a4a44+0x1+_0x2fcc58*(_0x2fcc58+0x1)+_0x2f6f91;}for(let _0x406cf0=0x0;_0x406cf0<_0x2fcc58;_0x406cf0++){_0x38588c[_0x4b1c9d++]=0x0,_0x38588c[_0x4b1c9d++]=_0x406cf0*(_0x2fcc58+0x1)+_0x2f6f91,_0x38588c[_0x4b1c9d++]=(_0x406cf0+0x1)*(_0x2fcc58+0x1)+_0x2f6f91,_0x38588c[_0x4b1c9d++]=_0x2fcc58+(_0x406cf0+0x1)*(_0x2fcc58+0x1)+_0x2f6f91,_0x38588c[_0x4b1c9d++]=_0x2fcc58+_0x406cf0*(_0x2fcc58+0x1)+_0x2f6f91,_0x38588c[_0x4b1c9d++]=0x0;}return{'vertices':_0x492cff,'indices':_0x5ac8f2};}}register$4('arcFrustum',ArcFrustum,!![]);var TetrahedronFS=_0x35a251(0x190),TetrahedronVS='in\x20vec3\x20position;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20v_positionEC\x20=\x20(czm_modelView\x20*\x20vec4(position,\x201.0)).xyz;\x20\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20normal\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjection\x20*\x20vec4(position,\x201.0);\x0a}\x0a';const DEF_STYLE$2={'width':0x14,'height':0x1e,'color':new Cesium__namespace[(_0x35a251(0xf29))](0.8,0.8,0x0,0.8),'animation':!![],'moveHeight':0x1e,'moveDuration':0x2,'rotationAngle':0x1};class Tetrahedron extends BasePointPrimitive{constructor(_0x497ded={}){const _0x551186=_0x35a251;_0x497ded['style']={...DEF_STYLE$2,..._0x497ded['style']||{}},super(_0x497ded),this[_0x551186(0xb8)]=0x1;}get[_0x35a251(0x371)](){return this;}get['color'](){return this['_color'];}set[_0x35a251(0x9db)](_0x4321de){this['_color']=getCesiumColor(_0x4321de);}get['modelMatrix'](){const _0x273e72={_0x2a4375:0x49c,_0x1b8544:0xfc8,_0x526c28:0x6a7},_0x50402b=_0x35a251;if(this['options']['modelMatrix'])return this['options']['modelMatrix'];if(!this['position'])return Cesium__namespace['Matrix4']['IDENTITY'];const _0x35c312=Cesium__namespace[_0x50402b(_0x273e72._0x2a4375)]['eastNorthUpToFixedFrame'](this['position']),_0x3babd3=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](this[_0x50402b(_0x273e72._0x1b8544)]['width'],this['style']['width'],this['style']['height'])),_0x3772dd=Cesium__namespace[_0x50402b(_0x273e72._0x526c28)]['multiply'](_0x35c312,_0x3babd3,new Cesium__namespace[(_0x50402b(0x6a7))]());return _0x3772dd;}['_addedHook'](_0xd52339){const _0x39a6a2={_0x343b41:0xb61,_0xf708b9:0x6a1},_0x20c03c=_0x35a251;if(!this['show']||!this[_0x20c03c(_0x39a6a2._0x343b41)])return;this[_0x20c03c(_0x39a6a2._0xf708b9)](_0xd52339,_0xd52339),this['primitiveCollection']['add'](this);}[_0x35a251(0xa9a)](){const _0x5d37e6=_0x35a251;this[_0x5d37e6(0x293)]&&this['primitiveCollection'][_0x5d37e6(0x341)](this)&&(this['_noDestroy']=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![]),delete this['_modelMatrix'];}['_updatePositionsHook'](){const _0x2426d1=_0x35a251;this[_0x2426d1(0x6c2)]=this[_0x2426d1(0x8a0)],this['_clearDrawCommand']();}['_updateStyleHook'](_0x19d8c9,_0x315859){const _0x1ebe5a={_0x571d43:0x682,_0x4ee902:0xf1e,_0x2e8be4:0xf64},_0xff3a51=_0x35a251;(_0x315859['width']||_0x315859[_0xff3a51(0x682)])&&this['_updatePositionsHook'](),this['color']=_0x19d8c9['color'],this['_rotationAngle']=Cesium__namespace[_0xff3a51(0x7c0)]['toRadians'](_0x19d8c9['rotationAngle']),this['_moveMaxHeight']=_0x19d8c9['moveHeight']/this[_0xff3a51(0xfc8)][_0xff3a51(_0x1ebe5a._0x571d43)],this[_0xff3a51(_0x1ebe5a._0x4ee902)]!==0x0&&(this[_0xff3a51(_0x1ebe5a._0x2e8be4)]=this['_moveMaxHeight']/(_0x19d8c9['moveDuration']*0x3c),this['_moveDistanceSum']=0x0);}['update'](_0x4330e8){const _0x3ece70={_0x764e4e:0xf1e,_0x231d34:0x6c2,_0x20af35:0xb5a,_0x2e2989:0x3b5},_0x3f4f3b=_0x35a251;if(!this['show'])return;if(this[_0x3f4f3b(0xfc8)]['animation']){if(this[_0x3f4f3b(_0x3ece70._0x764e4e)]!==0x0){this['_moveDistanceSum']+=this['_moveDistanceStep'];(this['_moveDistanceSum']>=this['_moveMaxHeight']||this['_moveDistanceSum']<=0x0)&&(this['_moveDistanceStep']=-this['_moveDistanceStep']);const _0x3cf8bd=new Cesium__namespace['Cartesian3'](0x0,0x0,this['_moveDistanceStep']);Cesium__namespace['Matrix4']['multiplyByTranslation'](this['_modelMatrix'],_0x3cf8bd,this[_0x3f4f3b(_0x3ece70._0x231d34)]);}if(this['_rotationAngle']!==0x0){const _0x3b2097=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromRotationZ'](this[_0x3f4f3b(_0x3ece70._0x20af35)]));Cesium__namespace['Matrix4']['multiply'](this['_modelMatrix'],_0x3b2097,this['_modelMatrix']);}}!Cesium__namespace['defined'](this['_drawCommand'])&&(this['_drawCommand']=this['createDrawCommand'](_0x4330e8['context'])),_0x4330e8[_0x3f4f3b(_0x3ece70._0x2e2989)][_0x3f4f3b(0x266)]?Cesium__namespace['defined'](this[_0x3f4f3b(0xcfc)])&&_0x4330e8[_0x3f4f3b(0xa1d)]['push'](this['_drawCommand']):Cesium__namespace['defined'](this['_pickCommand'])&&_0x4330e8['commandList'][_0x3f4f3b(0x6de)](this['_pickCommand']);}[_0x35a251(0xcf1)](){const _0x5398a4={_0x43b9be:0x344},_0x232aff=_0x35a251;Cesium__namespace['defined'](this[_0x232aff(0xcfc)])&&(this['_drawCommand'][_0x232aff(0xf7c)]&&this['_drawCommand']['vertexArray'][_0x232aff(0xa63)](),this['_drawCommand']['shaderProgram']&&this['_drawCommand']['shaderProgram']['destroy'](),delete this['_drawCommand']),Cesium__namespace['defined'](this['_pickCommand'])&&(this[_0x232aff(0x344)][_0x232aff(0xf7c)]&&this[_0x232aff(_0x5398a4._0x43b9be)][_0x232aff(0xf7c)]['destroy'](),this['_pickCommand']['shaderProgram']&&this[_0x232aff(_0x5398a4._0x43b9be)]['shaderProgram']['destroy'](),delete this[_0x232aff(0x344)]);}['createDrawCommand'](_0x2b07b2){const _0x271a65={_0x579296:0x5ef,_0x1e7706:0x5b0,_0x222bb6:0x7be,_0x5ab232:0xfc8,_0x4d501c:0xeb5,_0x3f9ab5:0x96a,_0x1ba45f:0x6c4,_0x4395f8:0x344},_0x1ea500=_0x35a251,_0x5eb39c=this[_0x1ea500(0xfc8)][_0x1ea500(0x6e7)]??![],_0x5512a5=this['style']['closed']??!![],_0x1b8bdf=Cesium__namespace['Appearance'][_0x1ea500(_0x271a65._0x579296)](_0x5eb39c,_0x5512a5,this['options'][_0x1ea500(_0x271a65._0x1e7706)]),_0x14d425=Cesium__namespace[_0x1ea500(_0x271a65._0x222bb6)]['fromCache'](_0x1b8bdf),_0x2e8853={'position':0x0,'textureCoordinates':0x1},_0x5f331d=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x2b07b2,'vertexShaderSource':TetrahedronVS,'fragmentShaderSource':TetrahedronFS,'attributeLocations':_0x2e8853}),_0x468601=this['createVertexArray'](_0x2b07b2),_0x3efa65=new Cesium__namespace['BoundingSphere'](this['position'],Math['max'](this['style'][_0x1ea500(0xf48)],this[_0x1ea500(_0x271a65._0x5ab232)]['height'])),_0x45a28c=new Cesium__namespace[(_0x1ea500(_0x271a65._0x4d501c))]({'primitiveType':Cesium__namespace['PrimitiveType'][_0x1ea500(_0x271a65._0x3f9ab5)],'shaderProgram':_0x5f331d,'vertexArray':_0x468601,'modelMatrix':this[_0x1ea500(0x6c2)],'renderState':_0x14d425,'boundingVolume':_0x3efa65,'uniformMap':{'color':()=>{return this['color'];},'globalAlpha':()=>{const _0x15ba26=_0x1ea500;return this[_0x15ba26(0xb8)];}},'castShadows':![],'receiveShadows':![],'pass':Cesium__namespace['Pass'][_0x1ea500(0x79e)],'owner':this,'pickOnly':!![],'pickCommand':new Cesium__namespace['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x45a28c),_0x45a28c[_0x1ea500(0x45a)]=_0x2b07b2['createPickId']({'primitive':_0x45a28c,'id':this['id']});const _0x426260=new Cesium__namespace['DrawCommand']({'owner':_0x45a28c,'primitiveType':Cesium__namespace[_0x1ea500(_0x271a65._0x1ba45f)][_0x1ea500(_0x271a65._0x3f9ab5)],'pickOnly':!![]});_0x426260[_0x1ea500(0xf7c)]=_0x468601,_0x426260['renderState']=_0x14d425;const _0x339925=Cesium__namespace['ShaderProgram'][_0x1ea500(0xd48)]({'context':_0x2b07b2,'vertexShaderSource':TetrahedronVS,'fragmentShaderSource':Cesium__namespace['ShaderSource']['createPickFragmentShaderSource'](TetrahedronFS,'uniform'),'attributeLocations':_0x2e8853});return _0x426260['shaderProgram']=_0x339925,_0x426260['uniformMap']=_0x45a28c['uniformMap'],_0x426260['uniformMap'][_0x1ea500(0x3ea)]=()=>{return _0x45a28c['pickId']['color'];},_0x426260['pass']=Cesium__namespace['Pass']['TRANSLUCENT'],_0x426260['boundingVolume']=_0x3efa65,_0x426260['modelMatrix']=this[_0x1ea500(0x6c2)],this[_0x1ea500(_0x271a65._0x4395f8)]=_0x426260,_0x45a28c;}['createVertexArray'](_0x2350d7){const _0x179e8d={_0xc78fec:0xa32,_0x333dcd:0x96a,_0x5667c2:0x916,_0x47532a:0x624,_0x1e1783:0x28e,_0xf98d34:0x51e},_0x263bdc=_0x35a251,_0x2a10ee={'position':0x0,'textureCoordinates':0x1},_0x149929=this[_0x263bdc(_0x179e8d._0xc78fec)](),_0x55ce9b=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':_0x149929[_0x263bdc(0xb35)]}),'textureCoordinates':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x149929['sts']})},'indices':_0x149929['indices'],'primitiveType':Cesium__namespace['PrimitiveType'][_0x263bdc(_0x179e8d._0x333dcd)],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x149929['positions'])}),_0x5a77cc=Cesium__namespace[_0x263bdc(_0x179e8d._0x5667c2)][_0x263bdc(_0x179e8d._0x47532a)](_0x55ce9b),_0x2541ce=Cesium__namespace[_0x263bdc(_0x179e8d._0x1e1783)]['fromGeometry']({'context':_0x2350d7,'geometry':_0x5a77cc,'attributeLocations':_0x2a10ee,'bufferUsage':Cesium__namespace[_0x263bdc(0x256)][_0x263bdc(_0x179e8d._0xf98d34)]});return _0x2541ce;}['cereatePositionsAndIndice'](){const _0x38e03b=new Float64Array(0x5*0x3);_0x38e03b[0x0]=0x0,_0x38e03b[0x1]=0x1,_0x38e03b[0x2]=0x0,_0x38e03b[0x3]=-0x1,_0x38e03b[0x4]=0x0,_0x38e03b[0x5]=0x0,_0x38e03b[0x6]=0x0,_0x38e03b[0x7]=-0x1,_0x38e03b[0x8]=0x0,_0x38e03b[0x9]=0x1,_0x38e03b[0xa]=0x0,_0x38e03b[0xb]=0x0,_0x38e03b[0xc]=0x0,_0x38e03b[0xd]=0x0,_0x38e03b[0xe]=-0x1;const _0x24c5d6=new Uint16Array(0x6*0x3);_0x24c5d6[0x0]=0x4,_0x24c5d6[0x1]=0x2,_0x24c5d6[0x2]=0x3,_0x24c5d6[0x3]=0x4,_0x24c5d6[0x4]=0x3,_0x24c5d6[0x5]=0x0,_0x24c5d6[0x6]=0x4,_0x24c5d6[0x7]=0x0,_0x24c5d6[0x8]=0x1,_0x24c5d6[0x9]=0x4,_0x24c5d6[0xa]=0x1,_0x24c5d6[0xb]=0x2,_0x24c5d6[0xc]=0x1,_0x24c5d6[0xd]=0x2,_0x24c5d6[0xe]=0x3,_0x24c5d6[0xf]=0x1,_0x24c5d6[0x10]=0x3,_0x24c5d6[0x11]=0x0;const _0x73f1b8=new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1,0.5,0.5]);return{'indices':_0x24c5d6,'positions':_0x38e03b,'sts':_0x73f1b8};}['setOpacity'](_0x5c2729){const _0x4104e1=_0x35a251;this[_0x4104e1(0xb8)]=_0x5c2729;}[_0x35a251(0x4be)](_0x356726,_0xd54ec7){return this['_getDrawPointEntityClass'](_0x356726,_0xd54ec7);}}register$4('tetrahedron',Tetrahedron,!![]);var ViewShedFS=_0x35a251(0xfc9);const DEF_STYLE$1={'angle':0x3c,'angle2':0x2d,'distance':0x3e8,'opacity':0.6,'addHeight':0x0,'showFrustum':![]};class ViewShed extends BasePointPrimitive{constructor(_0x2db0bf={},_0x4b2466=!![]){const _0x2f05f1={_0x130986:0xfc8,_0x292599:0x601},_0x3ccb39=_0x35a251;_0x4b2466&&(_0x2db0bf[_0x3ccb39(_0x2f05f1._0x130986)]={...DEF_STYLE$1,..._0x2db0bf['style']||{}}),super(_0x2db0bf),this['_visibleAreaColor']=getCesiumColor(this[_0x3ccb39(0xfc8)]['visibleAreaColor'],new Cesium__namespace[(_0x3ccb39(0xf29))](0x0,0x1,0x0)),this['_hiddenAreaColor']=getCesiumColor(this['style'][_0x3ccb39(0xf56)],new Cesium__namespace['Color'](0x1,0x0,0x0)),this['_hasTerrainShadows']=this['options']['terrain']??!![],this[_0x3ccb39(_0x2f05f1._0x292599)]=this['style']['maximumDistance']??0x1388;}get['czmObject'](){const _0x48a247=_0x35a251;return this[_0x48a247(0x226)];}get['angle'](){return this['style']['angle'];}set['angle'](_0x3fa3c7){const _0x1deb2f={_0x5cbcb6:0x447},_0x9f23f3=_0x35a251;this['style']['angle']=_0x3fa3c7,this[_0x9f23f3(_0x1deb2f._0x5cbcb6)]();}get[_0x35a251(0x79c)](){const _0x3a082d=_0x35a251;return this['style']['angle2']??this[_0x3a082d(0xfc8)][_0x3a082d(0x2c9)];}set['angle2'](_0x41e34f){const _0x2b51fa=_0x35a251;this[_0x2b51fa(0xfc8)]['angle2']=_0x41e34f,this['_updateDraw']();}get['visibleAreaColor'](){const _0x454c79={_0x5d3465:0x688},_0x2bdd71=_0x35a251;return this[_0x2bdd71(_0x454c79._0x5d3465)];}set[_0x35a251(0xa9f)](_0x479e3b){const _0x167f4b={_0x4fce23:0x688},_0x24334e=_0x35a251;this[_0x24334e(_0x167f4b._0x4fce23)]=getCesiumColor(_0x479e3b);}get[_0x35a251(0xf56)](){return this['_hiddenAreaColor'];}set['hiddenAreaColor'](_0x2eb83d){this['_hiddenAreaColor']=getCesiumColor(_0x2eb83d);}get[_0x35a251(0xbf2)](){const _0x4d0a72=_0x35a251;return this['style'][_0x4d0a72(0xbf2)];}set['opacity'](_0x507183){this['style']['opacity']=_0x507183;}get[_0x35a251(0xb95)](){const _0x58e94e={_0x5185d6:0xfc8},_0x157a7d=_0x35a251;return this[_0x157a7d(_0x58e94e._0x5185d6)][_0x157a7d(0xb95)];}set[_0x35a251(0xb95)](_0x1a041e){const _0x369256=_0x35a251;this['style'][_0x369256(0xb95)]=_0x1a041e,this[_0x369256(0x69e)]['show']=_0x1a041e;}get[_0x35a251(0xeed)](){return this['style']['distance'];}set['distance'](_0x2e5ace){const _0xd495a6={_0x4212bf:0xfc8,_0x31059e:0xeed},_0x1d894b=_0x35a251;this[_0x1d894b(_0xd495a6._0x4212bf)][_0x1d894b(_0xd495a6._0x31059e)]=_0x2e5ace,this['_updateDraw']();}get['shadowMap'](){const _0x2aa915={_0x29877a:0x70a},_0x2d0e18=_0x35a251;return this[_0x2d0e18(_0x2aa915._0x29877a)];}get['camera'](){const _0x70b18e=_0x35a251;var _0x24fa4c;return(_0x24fa4c=this['_shadowMap'])===null||_0x24fa4c===void 0x0?void 0x0:_0x24fa4c[_0x70b18e(0x561)];}get['targetPosition'](){const _0x3a02d2={_0x3895c8:0xe86},_0x542795=_0x35a251;return this[_0x542795(_0x3a02d2._0x3895c8)]['targetPosition'];}set['targetPosition'](_0x5be1ad){const _0x11301c={_0x52802d:0xd79,_0x6022d5:0x18b,_0x78d1f3:0xebd,_0x29a81f:0xb61,_0x557991:0x527,_0x23218a:0x7c0},_0x186f03=_0x35a251;var _0x35e7ea;this['options']['targetPosition']=_0x5be1ad;if(!this[_0x186f03(_0x11301c._0x52802d)])return;const _0x1f07c9=this['position'];if(!_0x1f07c9)return;const _0x309136=LngLatPoint['toCartesian'](_0x5be1ad,(_0x35e7ea=this['_map'])===null||_0x35e7ea===void 0x0?void 0x0:_0x35e7ea[_0x186f03(_0x11301c._0x6022d5)]);this['distance']=Cesium__namespace['Cartesian3']['distance'](_0x1f07c9,_0x309136);const _0x1cc4e4=Cesium__namespace[_0x186f03(0x8eb)][_0x186f03(_0x11301c._0x78d1f3)](Cesium__namespace[_0x186f03(0x8eb)]['subtract'](_0x309136,_0x1f07c9,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x1d5533=Cesium__namespace['Cartesian3'][_0x186f03(0xebd)](_0x1f07c9,new Cesium__namespace['Cartesian3']()),_0x25a386=new Cesium__namespace['Camera'](this['_map']['scene']);_0x25a386[_0x186f03(_0x11301c._0x29a81f)]=_0x1f07c9,_0x25a386['direction']=_0x1cc4e4,_0x25a386['up']=_0x1d5533,this['style']['heading']=Cesium__namespace['Math']['toDegrees'](_0x25a386['heading']),this['style'][_0x186f03(_0x11301c._0x557991)]=Cesium__namespace[_0x186f03(_0x11301c._0x23218a)][_0x186f03(0x9c5)](_0x25a386['pitch']),this[_0x186f03(0x447)]();}['_showHook'](){this['show']?this['_updateDraw']():this['_clearDraw']();}['_updatePositionsHook'](){this['_updateDraw']();}['_mountedHook'](){const _0x335a9b={_0x18e78d:0xe86,_0x592321:0xc60},_0x154b33=_0x35a251;this[_0x154b33(_0x335a9b._0x18e78d)]['targetPosition']&&(this['targetPosition']=this[_0x154b33(_0x335a9b._0x18e78d)][_0x154b33(0x4cd)]),this['_defaultColorTexture']=new Cesium__namespace['Texture']({'context':this[_0x154b33(0xd79)][_0x154b33(_0x335a9b._0x592321)]['context'],'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0x0,0x0,0x0,0x0])},'flipY':![]});}['_addedHook'](_0x4394af){const _0x4d674c=_0x35a251;this[_0x4d674c(0xdd2)]&&(this['_map']['viewer']['terrainShadows']=Cesium__namespace['ShadowMode']['ENABLED']),this['_updateDraw'](),this['primitiveCollection']['add'](this);}['_removedHook'](){const _0x59ae82={_0x4907d0:0xd79,_0x432890:0x293,_0x45c07f:0x341,_0xbcb1f0:0x1ee},_0x5d9295=_0x35a251;this['_hasTerrainShadows']&&(this[_0x5d9295(_0x59ae82._0x4907d0)][_0x5d9295(0xb5d)]=Cesium__namespace['ShadowMode']['DISABLED']),this['_clearDraw'](),this[_0x5d9295(_0x59ae82._0x432890)][_0x5d9295(_0x59ae82._0x45c07f)](this)&&(this['_noDestroy']=!![],this['primitiveCollection'][_0x5d9295(_0x59ae82._0xbcb1f0)](this),this[_0x5d9295(0x20b)]=![]);}[_0x35a251(0x1a8)](){const _0x58c908={_0x4d14a6:0x447},_0x439fd2=_0x35a251;this[_0x439fd2(_0x58c908._0x4d14a6)]();}[_0x35a251(0x447)](){const _0x461e40={_0x2cee9c:0xd79,_0x2ca420:0x41f,_0x458372:0xb61,_0xa7947f:0x19c,_0x14bd2b:0xc60},_0x1eb154=_0x35a251;this['_clearDraw']();if(!this[_0x1eb154(_0x461e40._0x2cee9c)]||!this[_0x1eb154(0x987)])return;const _0x58cbd1=this['position'];if(!_0x58cbd1)return;const _0x1044d8=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math'][_0x1eb154(0x7ba)](this[_0x1eb154(_0x461e40._0x2ca420)]),Cesium__namespace[_0x1eb154(0x7c0)]['toRadians'](this['pitch']),Cesium__namespace[_0x1eb154(0x7c0)]['toRadians'](this['roll'])),_0x185b91=new Cesium__namespace['Camera'](this[_0x1eb154(_0x461e40._0x2cee9c)][_0x1eb154(0xc60)]);_0x185b91[_0x1eb154(_0x461e40._0x458372)]=_0x58cbd1,_0x185b91[_0x1eb154(_0x461e40._0xa7947f)]['fov']=Cesium__namespace['Math']['toRadians'](this['angle']*0x2),_0x185b91[_0x1eb154(0x19c)]['aspectRatio']=this['angle']/this['angle2'],_0x185b91['frustum']['near']=0.01,_0x185b91['frustum']['far']=this['distance'],_0x185b91['setView']({'destination':_0x58cbd1,'orientation':{'heading':_0x1044d8['heading'],'pitch':_0x1044d8['pitch'],'roll':_0x1044d8['roll']}}),this['_createFrustumPrimitive'](_0x185b91),this[_0x1eb154(0x70a)]=new Cesium__namespace['ShadowMap']({'lightCamera':_0x185b91,'context':this['_map'][_0x1eb154(_0x461e40._0x14bd2b)][_0x1eb154(0x390)],'maximumDistance':this['_maximumDistance'],'isSpotLight':!![],'cascadesEnabled':![],'enabled':![],'depthBiasStep':this['options']['depthBiasStep']}),this['_createPostProcessStage']();}[_0x35a251(0xdc8)](){const _0x1116a2={_0x4c39ce:0x1ee,_0x101988:0x70a},_0x4fc3fb=_0x35a251;if(!this['_map'])return;this['_postProcessStage']&&(this['_map']['scene']['postProcessStages'][_0x4fc3fb(_0x1116a2._0x4c39ce)](this['_postProcessStage']),delete this['_postProcessStage']),this['_shadowMap']&&(this['_shadowMap'][_0x4fc3fb(0xa63)](),delete this[_0x4fc3fb(_0x1116a2._0x101988)]),this['_frustumPrimitive']&&(this[_0x4fc3fb(0x2d0)]['removeGraphic'](this[_0x4fc3fb(0x69e)],!![]),delete this['_frustumPrimitive']);}['update'](_0x2302ec){this['_shadowMap']&&_0x2302ec['shadowMaps']['push'](this['_shadowMap']);}['_createFrustumPrimitive'](_0x2cfe2d){const _0x2d9a56={_0x558e95:0xeed,_0x11aa2c:0x987},_0x37b800=_0x35a251;this['_frustumPrimitive']&&this['_layer']['removeGraphic'](this['_frustumPrimitive'],!![]);const _0x5ad478=this[_0x37b800(_0x2d9a56._0x558e95)]+0x1;this['_frustumPrimitive']=new ArcFrustum({'modelMatrix':_0x2cfe2d['inverseViewMatrix'],'style':{'angle':this['angle'],'angle2':this['angle2'],'distance':_0x5ad478},'show':this['showFrustum']&&this[_0x37b800(_0x2d9a56._0x11aa2c)],'private':!![]}),this['_layer']['addGraphic'](this['_frustumPrimitive']);}['_createPostProcessStage'](){const _0x1fa03e={_0x10e278:0x248,_0xe3e7d2:0xb9f},_0x564237={_0x2d6c17:0x70a,_0x27a0ec:0x3f7},_0x3a18e9={_0x32970a:0xb1,_0x48e5b4:0x111},_0x2a16ed=_0x35a251;this['_postProcessStage']&&(this['_map']['scene']['postProcessStages']['remove'](this['_postProcessStage']),delete this['_postProcessStage']);const _0x4db89b=new Cesium__namespace[(_0x2a16ed(_0x1fa03e._0x10e278))](),_0x83090d=new Cesium__namespace['Cartesian4'](),_0x17a879=new Cesium__namespace[(_0x2a16ed(_0x1fa03e._0xe3e7d2))](),_0xab4bed=this[_0x2a16ed(0x70a)]['_primitiveBias'];this['_postProcessStage']=new Cesium__namespace['PostProcessStage']({'fragmentShader':ViewShedFS,'uniforms':{'mars3d_opacity':()=>{return this['opacity'];},'mars3d_visibleAreaColor':()=>{return this['visibleAreaColor'];},'mars3d_hiddenAreaColor':()=>{const _0x519b40=_0x2a16ed;return this[_0x519b40(0xf56)];},'mars3d_distance':()=>{return this['distance'];},'mars3d_xAngle':()=>{return this['angle'];},'mars3d_yAngle':()=>{return this['angle2'];},'shadowMap_texture':()=>{return this['_shadowMap']['_shadowMapTexture']||this['_defaultColorTexture'];},'shadowMap_matrix':()=>{return this['_shadowMap']['_shadowMapMatrix'];},'shadowMap_lightPositionEC':()=>{return this['_shadowMap']['_lightPositionEC'];},'shadowMap_lightDirectionEC':()=>{const _0x9c44da=_0x2a16ed;return this[_0x9c44da(0x70a)]['_lightDirectionEC'];},'shadowMap_lightUp':()=>{const _0x38dc12=_0x2a16ed;return this[_0x38dc12(0x70a)]['_lightCamera']['up'];},'shadowMap_lightDir':()=>{return this['_shadowMap']['_lightCamera']['direction'];},'shadowMap_lightRight':()=>{const _0x3cf142=_0x2a16ed;return this['_shadowMap']['_lightCamera'][_0x3cf142(0x296)];},'shadowMap_texelSizeDepthBias':()=>{const _0xce6280=_0x2a16ed;return _0x4db89b['x']=0x1/this['_shadowMap'][_0xce6280(0x6d1)]['x'],_0x4db89b['y']=0x1/this['_shadowMap']['_textureSize']['y'],Cesium__namespace['Cartesian4'][_0xce6280(_0x3a18e9._0x32970a)](_0x4db89b['x'],_0x4db89b['y'],_0xab4bed['depthBias'],_0xab4bed[_0xce6280(_0x3a18e9._0x48e5b4)],_0x83090d);},'shadowMap_normalOffsetScale':()=>{const _0x5eceb8=_0x2a16ed;return Cesium__namespace['Cartesian4']['fromElements'](_0xab4bed['normalOffsetScale'],this[_0x5eceb8(_0x564237._0x2d6c17)]['_distance'],this['_shadowMap']['maximumDistance'],this[_0x5eceb8(_0x564237._0x2d6c17)][_0x5eceb8(_0x564237._0x27a0ec)],_0x17a879);}}}),this[_0x2a16ed(0xd79)]['scene']['postProcessStages']['add'](this['_postProcessStage']);}[_0x35a251(0xa9d)](_0x46c8c6,_0x4292b1){const _0x331cf6={_0x20d516:0x41f,_0x328da6:0x527,_0x16dce3:0x527,_0x36a73c:0xeed},_0x5a927d=_0x35a251;return _0x46c8c6[_0x5a927d(_0x331cf6._0x20d516)]=formatNum$1(this['heading'],0x1),_0x46c8c6[_0x5a927d(_0x331cf6._0x328da6)]=formatNum$1(this[_0x5a927d(_0x331cf6._0x16dce3)],0x1),_0x46c8c6[_0x5a927d(_0x331cf6._0x36a73c)]=formatNum$1(this[_0x5a927d(_0x331cf6._0x36a73c)],0x2),getAttrVal(_0x46c8c6,{'onlySimpleType':!![]});}['setView'](){const _0x1e974b={_0x122244:0x7d,_0xa9d77e:0x7d,_0x29b4d2:0x79b,_0x595ed4:0x7d},_0x5d0d78=_0x35a251;if(!this['_map'])return;const _0x56e9b6=this[_0x5d0d78(_0x1e974b._0x122244)];if(!_0x56e9b6)return;this['_map']['camera']['position']=Cesium__namespace['clone'](this[_0x5d0d78(0xb61)]),this['_map'][_0x5d0d78(_0x1e974b._0xa9d77e)][_0x5d0d78(_0x1e974b._0x29b4d2)]=Cesium__namespace[_0x5d0d78(0xd61)](_0x56e9b6['direction']),this['_map'][_0x5d0d78(0x7d)]['right']=Cesium__namespace[_0x5d0d78(0xd61)](_0x56e9b6['right']),this['_map'][_0x5d0d78(_0x1e974b._0x595ed4)]['up']=Cesium__namespace['clone'](_0x56e9b6['up']);}['setOpacity'](_0x4ba5d3){this['style']['opacity']=_0x4ba5d3;}[_0x35a251(0x2ef)](_0x2bf7e1){const _0x394df2={_0xf1c5c7:0x5f2,_0x50822b:0xd79,_0xcb7d4b:0x8ea},_0x2844d7=_0x35a251;if(this['_enabledDraw'])return this;this[_0x2844d7(_0x394df2._0xf1c5c7)]=!![];_0x2bf7e1&&this['addTo'](_0x2bf7e1);if(!this['_map'])throw new Error(_0x2844d7(0x6af));this[_0x2844d7(_0x394df2._0x50822b)]['_setEditCursor'](!![]),this[_0x2844d7(0xa4f)](![]),this['_startDrawHook'](),this['fire'](EventType['drawStart'],{'drawtype':this[_0x2844d7(_0x394df2._0xcb7d4b)],'graphic':this},!![]);}[_0x35a251(0x77c)](){const _0x10865b={_0x4aed60:0x492,_0x2996f9:0x604,_0x248099:0x264,_0x3c9527:0xf13},_0x4debfc=_0x35a251;var _0x102c7d,_0x199daa,_0x5eb756;if(!this['_enabledDraw'])return this;this['_stopDrawHook'](),this['_map'][_0x4debfc(_0x10865b._0x4aed60)](![]),this[_0x4debfc(0xa4f)](!![]),this['_map'][_0x4debfc(_0x10865b._0x2996f9)](),this['_enabledDraw']=![];if(!this['position']||!this['distance']){this[_0x4debfc(0x1ee)](!![]);return;}this[_0x4debfc(_0x10865b._0x248099)](EventType['drawCreated'],{'drawtype':this['type'],'graphic':this},!![]),(_0x102c7d=this[_0x4debfc(0xe86)])!==null&&_0x102c7d!==void 0x0&&_0x102c7d['success']&&this['options']['success'](this),(_0x199daa=this['options'])!==null&&_0x199daa!==void 0x0&&(_0x5eb756=_0x199daa['_promise'])!==null&&_0x5eb756!==void 0x0&&_0x5eb756['resolve']&&this['options'][_0x4debfc(_0x10865b._0x3c9527)]['resolve'](this);}[_0x35a251(0xe4d)](){const _0x38ff4c=_0x35a251;this[_0x38ff4c(0xd79)]['on'](EventType['click'],this['_onClickHandler'],this),this[_0x38ff4c(0xd79)]['on'](EventType[_0x38ff4c(0x971)],this[_0x38ff4c(0x3b4)],this);}['_stopDrawHook'](){const _0x5c8131={_0x1c282e:0x6b2,_0x2148d9:0x971},_0x46ed6a=_0x35a251;this['_map'][_0x46ed6a(_0x5c8131._0x1c282e)](EventType['click'],this['_onClickHandler'],this),this['_map']['off'](EventType[_0x46ed6a(_0x5c8131._0x2148d9)],this['_onMouseMoveHandler'],this);}['_onClickHandler'](_0x1fc30e){const _0x2bbb3d=_0x35a251;let _0x28e1db=_0x1fc30e['cartesian'];if(!_0x28e1db)return;this['fire'](EventType[_0x2bbb3d(0x4bd)],{..._0x1fc30e,'drawtype':this[_0x2bbb3d(0x8ea)],'graphic':this},!![]);if(!this['position']){this['position']=addPositionsHeight(_0x28e1db,this[_0x2bbb3d(0xfc8)]['addHeight']);return;}const _0x160a33=Cesium__namespace['Cartesian3'][_0x2bbb3d(0xeed)](this['position'],_0x28e1db);_0x160a33>this['_maximumDistance']&&(_0x28e1db=getOnLinePointByLen(this['position'],_0x28e1db,this[_0x2bbb3d(0x601)])),this['targetPosition']=_0x28e1db,this['stopDraw'](),this['fire'](EventType['drawCreated'],_0x1fc30e);}[_0x35a251(0x3b4)](_0x15287c){const _0x4a79ea={_0x2a5de8:0x4cd,_0x9b25b:0xd79,_0x3f4400:0xd79,_0xb1f2e1:0x37e},_0x56a806=_0x35a251;let _0x428f51=_0x15287c[_0x56a806(0x4bb)];if(!_0x428f51)return;const _0x41238b=this['position'];if(_0x41238b){const _0x3f0719=Cesium__namespace['Cartesian3']['distance'](_0x41238b,_0x428f51);_0x3f0719>this['_maximumDistance']&&(_0x428f51=getOnLinePointByLen(_0x41238b,_0x428f51,this['_maximumDistance'])),this[_0x56a806(_0x4a79ea._0x2a5de8)]=_0x428f51,this['fire'](EventType['drawMouseMove'],{..._0x15287c,'drawtype':this['type'],'graphic':this},!![]),this[_0x56a806(_0x4a79ea._0x9b25b)]['openSmallTooltip'](_0x15287c['endPosition'],this[_0x56a806(_0x4a79ea._0x3f4400)][_0x56a806(0x44e)]('_单击完成绘制'));}else this[_0x56a806(0xd79)][_0x56a806(0x771)](_0x15287c[_0x56a806(_0x4a79ea._0xb1f2e1)],this['_map']['getLangText'](_0x56a806(0x5fb)));}}register$4('viewShed',ViewShed,!![]);var ViewVideoFS='uniform\x20float\x20mars3d_opacity;\x0a\x0auniform\x20sampler2D\x20mars3d_videoTexture;\x0auniform\x20sampler2D\x20mars3d_maskTexture;\x0auniform\x20vec4\x20mars3d_hiddenAreaColor;\x0a\x0auniform\x20sampler2D\x20shadowMap_texture;\x0auniform\x20mat4\x20shadowMap_matrix;\x0auniform\x20vec4\x20shadowMap_lightPositionEC;\x0auniform\x20vec4\x20shadowMap_texelSizeDepthBias;\x0auniform\x20vec4\x20shadowMap_normalOffsetScale;\x0auniform\x20bool\x20mars3d_flipx;\x0auniform\x20bool\x20mars3d_flipy;\x0a\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0a\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0afloat\x20_czm_sampleShadowMap(sampler2D\x20shadowMap,\x20vec2\x20uv)\x20{\x0a\x20\x20return\x20texture(shadowMap,\x20uv).r;\x0a}\x0afloat\x20_czm_shadowDepthCompare(sampler2D\x20shadowMap,\x20vec2\x20uv,\x20float\x20depth)\x20{\x0a\x20\x20return\x20step(depth,\x20_czm_sampleShadowMap(shadowMap,\x20uv));\x0a}\x0afloat\x20_czm_shadowVisibility(sampler2D\x20shadowMap,\x20czm_shadowParameters\x20shadowParameters)\x20{\x0a\x20\x20float\x20depthBias\x20=\x20shadowParameters.depthBias;\x0a\x20\x20float\x20depth\x20=\x20shadowParameters.depth;\x0a\x20\x20float\x20nDotL\x20=\x20shadowParameters.nDotL;\x0a\x20\x20float\x20normalShadingSmooth\x20=\x20shadowParameters.normalShadingSmooth;\x0a\x20\x20float\x20darkness\x20=\x20shadowParameters.darkness;\x0a\x20\x20vec2\x20uv\x20=\x20shadowParameters.texCoords;\x0a\x20\x20depth\x20-=\x20depthBias;\x0a\x20\x20vec2\x20texelStepSize\x20=\x20shadowParameters.texelStepSize;\x0a\x20\x20float\x20radius\x20=\x201.0;\x0a\x20\x20float\x20dx0\x20=\x20-texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy0\x20=\x20-texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20dx1\x20=\x20texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy1\x20=\x20texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20visibility\x20=\x20(_czm_shadowDepthCompare(shadowMap,\x20uv,\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy1),\x20depth))\x20*\x20(1.0\x20/\x209.0);\x0a\x20\x20return\x20visibility;\x0a}\x0a\x0avec3\x20pointProjectOnPlane(in\x20vec3\x20planeNormal,\x20in\x20vec3\x20planeOrigin,\x20in\x20vec3\x20point)\x20{\x0a\x20\x20vec3\x20v01\x20=\x20point\x20-\x20planeOrigin;\x0a\x20\x20float\x20d\x20=\x20dot(planeNormal,\x20v01);\x0a\x20\x20return\x20(point\x20-\x20planeNormal\x20*\x20d);\x0a}\x0afloat\x20ptm(vec3\x20pt)\x20{\x0a\x20\x20return\x20sqrt(pt.x\x20*\x20pt.x\x20+\x20pt.y\x20*\x20pt.y\x20+\x20pt.z\x20*\x20pt.z);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20const\x20float\x20PI\x20=\x203.141592653589793;\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20czm_shadowParameters\x20shadowParameters;\x0a\x20\x20shadowParameters.texelStepSize\x20=\x20shadowMap_texelSizeDepthBias.xy;\x0a\x20\x20shadowParameters.depthBias\x20=\x20shadowMap_texelSizeDepthBias.z;\x0a\x20\x20shadowParameters.normalShadingSmooth\x20=\x20shadowMap_texelSizeDepthBias.w;\x0a\x20\x20shadowParameters.darkness\x20=\x20shadowMap_normalOffsetScale.w;\x0a\x20\x20shadowParameters.depthBias\x20*=\x20max(depth\x20*\x200.01,\x201.0);\x0a\x0a\x20\x20vec3\x20directionEC\x20=\x20normalize(positionEC.xyz\x20-\x20shadowMap_lightPositionEC.xyz);\x0a\x20\x20float\x20nDotL\x20=\x20clamp(dot(normalEC,\x20-directionEC),\x200.0,\x201.0);\x0a\x20\x20vec4\x20shadowPosition\x20=\x20shadowMap_matrix\x20*\x20positionEC;\x0a\x20\x20shadowPosition\x20/=\x20shadowPosition.w;\x0a\x20\x20if(any(lessThan(shadowPosition.xyz,\x20vec3(0.0)))\x20||\x20any(greaterThan(shadowPosition.xyz,\x20vec3(1.0))))\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20shadowParameters.texCoords\x20=\x20shadowPosition.xy;\x0a\x20\x20shadowParameters.depth\x20=\x20shadowPosition.z;\x0a\x20\x20shadowParameters.nDotL\x20=\x20nDotL;\x0a\x20\x20float\x20visibility\x20=\x20_czm_shadowVisibility(shadowMap_texture,\x20shadowParameters);\x0a\x0a\x20\x20//视频投射\x0a\x20\x20if(visibility\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20if(mars3d_flipx){\x0a\x20\x20\x20\x20\x20\x20shadowPosition.x\x20=\x20shadowPosition.x\x20+\x20(0.5\x20-\x20shadowPosition.x)\x20*\x202.0;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(mars3d_flipy){\x0a\x20\x20\x20\x20\x20\x20shadowPosition.y\x20=\x20shadowPosition.y\x20+\x20(0.5\x20-\x20shadowPosition.y)\x20*\x202.0;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20vec4\x20videoColor\x20=\x20texture(mars3d_videoTexture,\x20shadowPosition.xy);\x0a\x20\x20\x20\x20vec4\x20maskColor\x20=\x20texture(mars3d_maskTexture,\x20shadowPosition.xy);\x0a\x20\x20\x20\x20videoColor\x20*=\x20maskColor;\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(videoColor.xyz,\x201.0),\x20mars3d_opacity\x20*\x20videoColor.a);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20if(abs(shadowPosition.z\x20-\x200.0)\x20<\x200.01)\x20{\x0a\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(mix(color.rgb,\x20mars3d_hiddenAreaColor.rgb,\x20mars3d_hiddenAreaColor.a),\x20mars3d_hiddenAreaColor.a);\x0a\x20\x20}\x0a}\x0a';const DEF_STYLE={'angle':0x3c,'angle2':0x2d,'distance':0x3e8,'opacity':0x1,'showFrustum':![],'hiddenAreaColor':new Cesium__namespace['Color'](0x0,0x0,0x0,0.5),'flipx':![],'flipy':![]};class Video3D extends ViewShed{constructor(_0x4fa6c7={}){const _0x3b7b68={_0x18934c:0xe17},_0x352d95=_0x35a251;_0x4fa6c7['style']={...DEF_STYLE,..._0x4fa6c7['style']||{}},_0x4fa6c7[_0x352d95(_0x3b7b68._0x18934c)]=![],super(_0x4fa6c7,![]),this['_videoPlay']=!![];}get['container'](){const _0x5bd467=_0x35a251;return this[_0x5bd467(0x456)];}get['distance'](){const _0x17ce39={_0x14486d:0xeed},_0x20d593=_0x35a251;return this['style'][_0x20d593(_0x17ce39._0x14486d)];}set[_0x35a251(0xeed)](_0x41439e){const _0x29923f=_0x35a251;this[_0x29923f(0xfc8)]['distance']=_0x41439e,this['_updateDraw']();}get['flipx'](){return this['style']['flipx'];}set[_0x35a251(0x424)](_0x7c691d){this['style']['flipx']=_0x7c691d;}get['play'](){return this['_videoPlay'];}set['play'](_0x342e97){const _0x3976e0=_0x35a251;this['_videoPlay']=Boolean(_0x342e97);if(this['_videoContainer'])try{this['videoPlay']?this['_videoContainer']['play']():this[_0x3976e0(0x456)]['pause']();}catch(_0x70cd1a){}}['_mountedHook'](){const _0x5235f2={_0x3c96f3:0x700,_0x3fa737:0x52e,_0x152071:0xa35,_0x12af72:0x456,_0x304df3:0xfc8,_0x20cda6:0x922},_0x557c96={_0x2e2d1d:0x957},_0x3ca6fa={_0xa7aee:0xa35,_0x38e165:0x390},_0x4e6478=_0x35a251;super[_0x4e6478(_0x5235f2._0x3c96f3)]();const _0x3cdb27=this['style']['maskImage'];if(_0x3cdb27){const _0x5e1e70=new Image();_0x5e1e70['onload']=_0x3ebcfe=>{const _0x20f24d=_0x4e6478;this[_0x20f24d(_0x3ca6fa._0xa7aee)]=new Cesium__namespace['Texture']({'context':this['_map']['scene'][_0x20f24d(_0x3ca6fa._0x38e165)],'source':_0x5e1e70});},_0x5e1e70[_0x4e6478(0x5ee)]=_0x3ad0d6=>{const _0x184e53=_0x4e6478;logError$1(_0x184e53(_0x557c96._0x2e2d1d)+_0x3cdb27,_0x3ad0d6);},_0x5e1e70[_0x4e6478(_0x5235f2._0x3fa737)]=_0x3cdb27;}else this[_0x4e6478(_0x5235f2._0x152071)]=new Cesium__namespace['Texture']({'context':this['_map']['scene']['context'],'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0xff,0xff,0xff,0xff])},'flipY':![]});if(this['style']['container'])this[_0x4e6478(_0x5235f2._0x12af72)]=this[_0x4e6478(_0x5235f2._0x304df3)]['container'];else this['style']['url']&&(this['_videoContainer']=createVideo(this[_0x4e6478(0xfc8)]['url'],this[_0x4e6478(0xfc8)]['fileType'],'',document['body']),this['_videoContainer']['style'][_0x4e6478(_0x5235f2._0x20cda6)]='none',this['_hasRemoveElement']=!![]);this['_videoContainer']&&this['_map']['on'](EventType['clockTick'],this['_onClockTickHandler'],this);}[_0x35a251(0xa9a)](){const _0x14d589={_0x332d25:0x456,_0x1ce91e:0x803},_0x500d61=_0x35a251;var _0x1783ae;this['_map']['off'](EventType['clockTick'],this['_onClockTickHandler'],this),this['_hasRemoveElement']&&(_0x1783ae=this['_videoContainer'])!==null&&_0x1783ae!==void 0x0&&_0x1783ae['parentNode']&&(this[_0x500d61(_0x14d589._0x332d25)][_0x500d61(_0x14d589._0x1ce91e)]['removeChild'](this['_videoContainer']),delete this['_hasRemoveElement'],delete this['_videoContainer']),super['_removedHook']();}['_onClockTickHandler'](){const _0x587a79={_0x8f253b:0xa63},_0x42e4b4=_0x35a251;try{this['_videoPlay']&&this['_videoContainer']['paused']&&this['_videoContainer']['play']();}catch(_0x5cad6e){}if(!this['_videoContainer']||!this['_map'])return;this['_videoTexture']&&this['_videoTexture'][_0x42e4b4(_0x587a79._0x8f253b)](),this[_0x42e4b4(0xb2a)]=new Cesium__namespace['Texture']({'context':this['_map']['scene'][_0x42e4b4(0x390)],'source':this['_videoContainer'],'pixelFormat':Cesium__namespace['PixelFormat']['RGBA'],'pixelDatatype':Cesium__namespace['PixelDatatype']['UNSIGNED_BYTE']});}[_0x35a251(0xdc8)](){this['_frustumPrimitive']&&(this['primitiveCollection']['remove'](this['_frustumPrimitive']),delete this['_frustumPrimitive']),super['_clearDraw']();}['_createFrustumPrimitive'](_0x576dac){const _0x1bca0e={_0x5ea9fa:0x852,_0x4633ca:0xd9d,_0x17a572:0x293,_0x597ea4:0x1ee,_0x635e63:0x21c,_0x128521:0x6f9,_0x5f0b16:0x4af},_0x25116d=_0x35a251,_0x589a22=_0x576dac[_0x25116d(_0x1bca0e._0x5ea9fa)],_0x2bc342=_0x576dac['upWC'];let _0x1378c9=_0x576dac['rightWC'];_0x1378c9=Cesium__namespace['Cartesian3']['negate'](_0x1378c9,new Cesium__namespace['Cartesian3']());const _0x3d1dfe=new Cesium__namespace[(_0x25116d(_0x1bca0e._0x4633ca))]();Cesium__namespace['Matrix3']['setColumn'](_0x3d1dfe,0x0,_0x1378c9,_0x3d1dfe),Cesium__namespace[_0x25116d(0xd9d)]['setColumn'](_0x3d1dfe,0x1,_0x2bc342,_0x3d1dfe),Cesium__namespace['Matrix3']['setColumn'](_0x3d1dfe,0x2,_0x589a22,_0x3d1dfe);const _0xb3d5ef=Cesium__namespace['Quaternion']['fromRotationMatrix'](_0x3d1dfe,new Cesium__namespace['Quaternion']());this[_0x25116d(0x69e)]&&this[_0x25116d(_0x1bca0e._0x17a572)][_0x25116d(_0x1bca0e._0x597ea4)](this['_frustumPrimitive']),this['_frustumPrimitive']=new Cesium__namespace[(_0x25116d(_0x1bca0e._0x635e63))]({'geometryInstances':new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace['FrustumOutlineGeometry']({'origin':_0x576dac[_0x25116d(0xb61)],'orientation':_0xb3d5ef,'frustum':_0x576dac[_0x25116d(0x19c)],'_drawNearPlane':!![]}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x25116d(_0x1bca0e._0x128521)](Cesium__namespace[_0x25116d(0xf29)]['AZURE'])}}),'appearance':new Cesium__namespace['PerInstanceColorAppearance']({'translucent':![],'flat':!![]}),'asynchronous':![],'show':this['showFrustum']&&this['show']}),this['primitiveCollection'][_0x25116d(_0x1bca0e._0x5f0b16)](this['_frustumPrimitive']),this['bindPickId'](this['_frustumPrimitive']);}[_0x35a251(0x48c)](){const _0x11c3ef={_0x481d1d:0x226},_0x4e8326={_0x131db4:0xb54},_0x560b06={_0x480f1b:0xb1},_0x14ee1c={_0x488a65:0x70a,_0x4b30cf:0xb6b,_0x597d94:0x111},_0x17cc4c={_0x5565bc:0xf56},_0x247f62=_0x35a251;this['_postProcessStage']&&(this['_map']['scene'][_0x247f62(0x140)]['remove'](this[_0x247f62(_0x11c3ef._0x481d1d)]),delete this[_0x247f62(0x226)]);const _0x515176=new Cesium__namespace['Cartesian2'](),_0xdd2a4=new Cesium__namespace['Cartesian4'](),_0x1730c9=new Cesium__namespace['Cartesian4'](),_0x58a77c=this['_shadowMap']['_primitiveBias'];this['_postProcessStage']=new Cesium__namespace['PostProcessStage']({'fragmentShader':ViewVideoFS,'uniforms':{'mars3d_videoTexture':()=>{return this['_videoTexture']||this['_defaultColorTexture'];},'mars3d_maskTexture':()=>{const _0x1f9a36=_0x247f62;return this[_0x1f9a36(0xa35)];},'mars3d_opacity':()=>{return this['opacity'];},'mars3d_hiddenAreaColor':()=>{const _0x2dbea5=_0x247f62;return this[_0x2dbea5(_0x17cc4c._0x5565bc)];},'shadowMap_texture':()=>{return this['_shadowMap']['_shadowMapTexture']||this['_defaultColorTexture'];},'shadowMap_matrix':()=>{return this['_shadowMap']['_shadowMapMatrix'];},'shadowMap_lightPositionEC':()=>{return this['_shadowMap']['_lightPositionEC'];},'shadowMap_texelSizeDepthBias':()=>{const _0x2f487e=_0x247f62;return _0x515176['x']=0x1/this[_0x2f487e(_0x14ee1c._0x488a65)][_0x2f487e(0x6d1)]['x'],_0x515176['y']=0x1/this['_shadowMap']['_textureSize']['y'],Cesium__namespace[_0x2f487e(0xb9f)]['fromElements'](_0x515176['x'],_0x515176['y'],_0x58a77c[_0x2f487e(_0x14ee1c._0x4b30cf)],_0x58a77c[_0x2f487e(_0x14ee1c._0x597d94)],_0xdd2a4);},'shadowMap_normalOffsetScale':()=>{const _0x1041af=_0x247f62;return Cesium__namespace['Cartesian4'][_0x1041af(_0x560b06._0x480f1b)](_0x58a77c[_0x1041af(0xea)],this['_shadowMap']['_distance'],this['_shadowMap']['maximumDistance'],this['_shadowMap']['_darkness'],_0x1730c9);},'mars3d_flipx':()=>{return this['style']['flipx'];},'mars3d_flipy':()=>{const _0x49e362=_0x247f62;return this['style'][_0x49e362(_0x4e8326._0x131db4)];}}}),this['_map'][_0x247f62(0xc60)]['postProcessStages']['add'](this['_postProcessStage']);}}register$4(_0x35a251(0x7ed),Video3D,!![]);let globeLastRoam;class Route extends BasePointPrimitive{constructor(_0x35c39a={}){const _0x32578a={_0x4932ba:0xe86,_0x6d7258:0x5df,_0x3867f1:0xb61,_0x2b61f4:0xb86,_0x1988b0:0xe86,_0x1d0057:0xe26,_0x4c5321:0xf3e,_0x5c06c4:0x8fd},_0x55bf6e=_0x35a251;super(_0x35c39a),this[_0x55bf6e(0xe86)]['frameRate']=this[_0x55bf6e(_0x32578a._0x4932ba)]['frameRate']??0x1,this['_maxCacheCount']=this['options']['maxCacheCount']??0x64,this[_0x55bf6e(_0x32578a._0x6d7258)]=-0x1,this['_frameRateHeight']=this['options']['frameRateHeight']??0x1e,this[_0x55bf6e(0x65b)](this['options']['style']),this['_child']={},this['_position_result']=new Cesium__namespace['Cartesian3'](),this['property']=this['options'][_0x55bf6e(_0x32578a._0x3867f1)]||new Cesium__namespace['SampledPositionProperty'](this['options']['referenceFrame'],this['options']['numberOfDerivatives']),this[_0x55bf6e(_0x32578a._0x2b61f4)]['forwardExtrapolationType']=this[_0x55bf6e(_0x32578a._0x1988b0)][_0x55bf6e(_0x32578a._0x1d0057)]??Cesium__namespace['ExtrapolationType'][_0x55bf6e(_0x32578a._0x4c5321)],this['property']['backwardExtrapolationType']=this[_0x55bf6e(_0x32578a._0x1988b0)][_0x55bf6e(0x982)]??Cesium__namespace['ExtrapolationType']['HOLD'],this['_orientation']=this['options'][_0x55bf6e(_0x32578a._0x5c06c4)]||new Cesium__namespace[(_0x55bf6e(0x800))](this[_0x55bf6e(0xb86)]),this['_readyPromise']=Cesium__namespace['defer']();}get[_0x35a251(0x854)](){return this['_child']['label'];}set[_0x35a251(0x854)](_0x45aa62){const _0x543e8a=_0x35a251;this['options'][_0x543e8a(0x854)]=_0x45aa62,this['_initChildGraphic']('label',LabelPrimitive);}get['billboard'](){const _0x313d63=_0x35a251;return this['_child'][_0x313d63(0x9c2)];}set['billboard'](_0x3da062){const _0x4eb626={_0x5b8129:0xe86,_0x5c2590:0x9c2,_0x1c5f1a:0xf8b},_0x4bc757=_0x35a251;this[_0x4bc757(_0x4eb626._0x5b8129)][_0x4bc757(_0x4eb626._0x5c2590)]=_0x3da062,this[_0x4bc757(_0x4eb626._0x1c5f1a)]('billboard',BillboardPrimitive);}get['point'](){return this['_child']['point'];}set['point'](_0x31e86d){const _0x4966b5={_0x2a8205:0xf8b},_0x194cd2=_0x35a251;this[_0x194cd2(0xe86)]['point']=_0x31e86d,this[_0x194cd2(_0x4966b5._0x2a8205)](_0x194cd2(0x1ba),PointPrimitive);}get['model'](){return this['_child']['model'];}set['model'](_0x802296){const _0x4863c4=_0x35a251;this['options'][_0x4863c4(0x440)]=_0x802296,this['_initChildGraphic']('model',ModelPrimitive);}get['readyPromise'](){return this['_readyPromise']['promise'];}get[_0x35a251(0xd6d)](){return this['_child']['circle'];}set['circle'](_0x2e734d){this['options']['circle']=_0x2e734d,this['_initChildGraphic']('circle',CircleEntity);}get[_0x35a251(0x842)](){const _0x3c4717=_0x35a251;return this[_0x3c4717(0xa81)]['coneTrack'];}set[_0x35a251(0x842)](_0x1307e3){const _0x2a395f=_0x35a251;this[_0x2a395f(0xe86)][_0x2a395f(0x842)]=_0x1307e3,this['_initChildGraphic']('coneTrack',ConeTrack);}get['path'](){return this['_child']['path'];}set[_0x35a251(0xa06)](_0x1d0459){const _0x2302cd=_0x35a251;this['options'][_0x2302cd(0xa06)]=_0x1d0459,this['_initChildGraphic']('path',PathEntity);}get['polyline'](){return this['_child']['polyline'];}set[_0x35a251(0x282)](_0x4dd33e){const _0x3b9f5d={_0x1ed37a:0xe86,_0x11c53d:0x282},_0x28faf1=_0x35a251;this[_0x28faf1(_0x3b9f5d._0x1ed37a)][_0x28faf1(_0x3b9f5d._0x11c53d)]=_0x4dd33e,this['_initChildGraphic']('polyline',PolylineEntity);}get['wall'](){const _0x2a22cf={_0x20bcef:0xa81},_0x2ad50d=_0x35a251;return this[_0x2ad50d(_0x2a22cf._0x20bcef)]['wall'];}set['wall'](_0x1aa6f3){const _0x117a73=_0x35a251;this[_0x117a73(0xe86)]['wall']=_0x1aa6f3,this['_initChildGraphic']('wall',WallEntity);}get['modelMatrix'](){const _0x3c6fce=_0x35a251;return this['_modelMatrix']?this[_0x3c6fce(0x6c2)]:this['_getModelMatrix'](this['_position'],this['_orientation_show']);}get['groundPosition'](){return getRayEarthPosition(this['_position'],this['_orientation_show']);}get['alt'](){const _0x4d4b48={_0x5416db:0xb81,_0x4a12fd:0x120},_0xa4eaeb=_0x35a251;if(this[_0xa4eaeb(_0x4d4b48._0x5416db)])return this['_clampToTilesetHeight'];if(this['_position']){const _0x1cdf60=Cesium__namespace[_0xa4eaeb(_0x4d4b48._0x4a12fd)]['fromCartesian'](this[_0xa4eaeb(0xdb7)]);return _0x1cdf60['height'];}return 0x0;}get['startTime'](){const _0x9d0cd6={_0x3b5826:0xb86,_0xa5e1da:0x39c},_0x5d0af8=_0x35a251;var _0x2e025e,_0x38f175;const _0x25e8cb=(_0x2e025e=this[_0x5d0af8(_0x9d0cd6._0x3b5826)])===null||_0x2e025e===void 0x0?void 0x0:(_0x38f175=_0x2e025e['_property'])===null||_0x38f175===void 0x0?void 0x0:_0x38f175[_0x5d0af8(_0x9d0cd6._0xa5e1da)];return _0x25e8cb['length']>0x0?_0x25e8cb[0x0]:null;}get['stopTime'](){const _0x1009de={_0x1a21fe:0x39c},_0x4bce35=_0x35a251;var _0x35005a,_0x134eb2;const _0x1acae0=(_0x35005a=this['property'])===null||_0x35005a===void 0x0?void 0x0:(_0x134eb2=_0x35005a['_property'])===null||_0x134eb2===void 0x0?void 0x0:_0x134eb2[_0x4bce35(_0x1009de._0x1a21fe)];return _0x1acae0['length']>0x0?_0x1acae0[_0x1acae0['length']-0x1]:null;}get['currIndex'](){return this['_flyok_index'];}get['multiplier'](){const _0x40d2ee=_0x35a251;var _0x490738;return(_0x490738=this[_0x40d2ee(0xd79)])===null||_0x490738===void 0x0?void 0x0:_0x490738['clock']['multiplier'];}set['multiplier'](_0x115de9){this['_map']&&(this['_map']['clock']['multiplier']=_0x115de9);}get[_0x35a251(0xb01)](){var _0x163f7c;return!((_0x163f7c=this['_map'])!==null&&_0x163f7c!==void 0x0&&_0x163f7c['clock']['shouldAnimate']);}set['isPause'](_0x3b396e){const _0x54149d=_0x35a251;this[_0x54149d(0xd79)]&&(_0x3b396e?this['pause']():this['proceed']());}get['objectsToExclude'](){const _0x48d9c8={_0xa1ca41:0x5c3},_0x55fb53=_0x35a251;if(this['options']['objectsToExclude'])return this['options']['objectsToExclude'];if(this['_objectsToExcludee'])return this[_0x55fb53(_0x48d9c8._0xa1ca41)];const _0x30bd84=[];this['eachChildGraphic'](_0x4a5748=>{_0x4a5748['czmObject']&&_0x30bd84['push'](_0x4a5748['czmObject']);});if(_0x30bd84['length']>0x0)return _0x30bd84;return undefined;}set['objectsToExclude'](_0x126833){this['_objectsToExclude']=_0x126833;}get['style'](){const _0x1bb104={_0x445c37:0xe86,_0x5dff45:0x1ba},_0x2a818e=_0x35a251,_0x11cfab=getAttrVal(this[_0x2a818e(_0x1bb104._0x445c37)],{'onlySimpleType':!![]});return this['_splitOptionsToStyle'](_0x11cfab,'model'),this[_0x2a818e(0x4e8)](_0x11cfab,'label'),this['_splitOptionsToStyle'](_0x11cfab,'billboard'),this['_splitOptionsToStyle'](_0x11cfab,_0x2a818e(_0x1bb104._0x5dff45)),this['_splitOptionsToStyle'](_0x11cfab,'circle'),this['_splitOptionsToStyle'](_0x11cfab,'coneTrack'),this['_splitOptionsToStyle'](_0x11cfab,'polyline'),this['_splitOptionsToStyle'](_0x11cfab,'wall'),this['_splitOptionsToStyle'](_0x11cfab,'path'),delete _0x11cfab[_0x2a818e(0xf13)],delete _0x11cfab['style'],delete _0x11cfab['attr'],_0x11cfab;}set['style'](_0x55d6ad){const _0x5cd530={_0x1553e0:0x212},_0x337747=_0x35a251;this[_0x337747(_0x5cd530._0x1553e0)](_0x55d6ad);}['setStyle'](_0x2ef90f){const _0x519586={_0x4750af:0xe86},_0x16857c=_0x35a251;return _0x2ef90f={..._0x2ef90f},this['_zhStyle'](_0x2ef90f),this['_setOptionsHook'](this[_0x16857c(_0x519586._0x4750af)],_0x2ef90f),this;}['_initSampledPositionProperty'](){const _0x1dcb68={_0x4eeb6d:0x717},_0x222348=_0x35a251;this[_0x222348(_0x1dcb68._0x4eeb6d)]=this['property'],this['bindUpdateEvent']();}['_mountedHook'](){const _0x433134=_0x35a251;this['_initChildGraphic']('label',LabelPrimitive),this['_initChildGraphic'](_0x433134(0x9c2),BillboardPrimitive),this['_initChildGraphic'](_0x433134(0x1ba),PointPrimitive),this[_0x433134(0xf8b)]('model',ModelPrimitive),this[_0x433134(0xf8b)]('circle',CircleEntity),this['_initChildGraphic']('coneTrack',ConeTrack),this[_0x433134(0xf8b)]('path',PathEntity),this[_0x433134(0xf8b)](_0x433134(0x282),PolylineEntity),this[_0x433134(0xf8b)]('wall',WallEntity);}['_addedHook'](_0x2fd438){const _0x447243={_0x57bfdc:0x3e2,_0x505baf:0xe86},_0x2e63ba=_0x35a251;var _0x5049ec;if(!this['show'])return;this['_addChildGraphic']();(_0x5049ec=this['model'])!==null&&_0x5049ec!==void 0x0&&_0x5049ec['readyPromise']&&this['model'][_0x2e63ba(_0x447243._0x57bfdc)]['then'](()=>{const _0x479ec6=_0x2e63ba;this[_0x479ec6(0x4ac)]['resolve'](this);});this['options']['position']&&this['addDynamicPosition'](this[_0x2e63ba(_0x447243._0x505baf)]['position']);if(this['options']['positions'])for(let _0x4b6ce6=0x0;_0x4b6ce6{_0x53f909['show']=_0x53f909['_lastShow'],delete _0x53f909['_lastShow'];}):this[_0x336956(_0x22e6c0._0x4df96b)](_0x1e8cda=>{const _0x2648eb=_0x336956;_0x1e8cda['_lastShow']=_0x1e8cda[_0x2648eb(0x987)],_0x1e8cda[_0x2648eb(0x987)]=![];});}['_setOptionsHook'](_0x5bc4f6,_0x3c6347){const _0x14e190={_0x518982:0x9c2,_0x571bb:0x842,_0x3e73fc:0x2b1},_0x3ce858=_0x35a251;this['_zhStyle'](_0x3c6347['style']);for(const _0x3bc4a6 in _0x3c6347){switch(_0x3bc4a6){case'label':this[_0x3ce858(0xf8b)]('label',LabelPrimitive);break;case _0x3ce858(_0x14e190._0x518982):this['_initChildGraphic'](_0x3ce858(0x9c2),BillboardPrimitive);break;case'point':this['_initChildGraphic']('point',PointPrimitive);break;case'model':this[_0x3ce858(0xf8b)]('model',ModelPrimitive);break;case'circle':this['_initChildGraphic']('circle',CircleEntity);break;case _0x3ce858(_0x14e190._0x571bb):this['_initChildGraphic']('coneTrack',ConeTrack);break;case'path':this['_initChildGraphic']('path',PathEntity);break;case'polyline':this['_initChildGraphic'](_0x3ce858(0x282),PolylineEntity);break;case _0x3ce858(_0x14e190._0x3e73fc):this['_initChildGraphic']('wall',WallEntity);break;}}}[_0x35a251(0x4e8)](_0x3fc606,_0x5008a9){const _0x4d7901=_0x3fc606[_0x5008a9];if(_0x4d7901){delete _0x3fc606[_0x5008a9];for(const _0x27988a in _0x4d7901){_0x3fc606[_0x5008a9+'_'+_0x27988a]=_0x4d7901[_0x27988a];}}}['_mergeStyleToOptions'](_0x15eb39,_0x6e95e2){const _0x5b8a70=_0x6e95e2+'_';for(const _0x4ceaaf in _0x15eb39){const _0x3c20d2=_0x15eb39[_0x4ceaaf];_0x4ceaaf['startsWith'](_0x5b8a70)&&(!_0x15eb39[_0x6e95e2]&&(_0x15eb39[_0x6e95e2]={}),_0x15eb39[_0x6e95e2][_0x4ceaaf['substring'](_0x5b8a70['length'])]=_0x3c20d2,delete _0x15eb39[_0x4ceaaf]);}}[_0x35a251(0x65b)](_0x2a77f5){const _0x46ce9a={_0x14599f:0x9c2,_0x41070a:0xbec,_0x23fefa:0xbec},_0xf58e0a=_0x35a251;if(!_0x2a77f5||Object['keys'](_0x2a77f5)['length']===0x0)return;this['_mergeStyleToOptions'](_0x2a77f5,'model'),this['_mergeStyleToOptions'](_0x2a77f5,'label'),this['_mergeStyleToOptions'](_0x2a77f5,_0xf58e0a(_0x46ce9a._0x14599f)),this[_0xf58e0a(0xbec)](_0x2a77f5,'point'),this['_mergeStyleToOptions'](_0x2a77f5,'circle'),this[_0xf58e0a(_0x46ce9a._0x41070a)](_0x2a77f5,'coneTrack'),this[_0xf58e0a(_0x46ce9a._0x41070a)](_0x2a77f5,'polyline'),this[_0xf58e0a(_0x46ce9a._0x23fefa)](_0x2a77f5,'wall'),this['_mergeStyleToOptions'](_0x2a77f5,'path');for(const _0x4419b3 in _0x2a77f5){const _0x2f6b62=_0x2a77f5[_0x4419b3];switch(_0x4419b3){default:{isObject(_0x2f6b62)?this[_0xf58e0a(0xe86)][_0x4419b3]=merge(this['options'][_0x4419b3],_0x2f6b62):this['options'][_0x4419b3]=_0x2f6b62;break;}}}}[_0x35a251(0xf8b)](_0x1a0fec,_0x5c2131){const _0x2db58e={_0x3fda01:0x1ee,_0x1fa516:0x987,_0x157303:0x2d0,_0x244275:0xa81,_0x260260:0xfc8,_0x1acd6f:0xb61,_0xdaf45:0x842,_0xab3b14:0x95,_0x4fc04b:0x2b1,_0x1053f3:0x18a,_0x3048e8:0xcef},_0xbbaeb0={_0x562f45:0xf65},_0x460f0f={_0x241889:0xdb7},_0x52e29e=_0x35a251,_0x4d7917=this['options'][_0x1a0fec];let _0x2ee450=this['_child'][_0x1a0fec];if(!_0x4d7917){_0x2ee450&&(_0x2ee450[_0x52e29e(_0x2db58e._0x3fda01)](!![]),delete this[_0x52e29e(0xa81)][_0x1a0fec]);return;}if(_0x2ee450)_0x2ee450[_0x52e29e(0x212)](_0x4d7917),_0x2ee450[_0x52e29e(0x987)]=_0x4d7917[_0x52e29e(_0x2db58e._0x1fa516)]??!![];else{_0x2ee450=new _0x5c2131({'id':this['id']+'-'+_0x1a0fec,'style':clone(_0x4d7917,['show']),'private':!![],'eventParent':this,'show':_0x4d7917['show']??!![]}),_0x2ee450['removeEventParent'](this[_0x52e29e(_0x2db58e._0x157303)]),_0x2ee450['addEventParent'](this);this['isAdded']&&this[_0x52e29e(0x2d0)]['addGraphic'](_0x2ee450);_0x2ee450[_0x52e29e(0x371)]&&this['bindPickId'](_0x2ee450['czmObject']);_0x2ee450['czmObjectEx']&&_0x2ee450['czmObjectEx']['forEach'](_0x1ab870=>{this['bindPickId'](_0x1ab870);});this[_0x52e29e(_0x2db58e._0x244275)][_0x1a0fec]=_0x2ee450;switch(_0x1a0fec){case'billboard':{!_0x4d7917['alignedAxis']&&(this['_child']['billboard'][_0x52e29e(_0x2db58e._0x260260)]['alignedAxis']=new Cesium__namespace['VelocityVectorProperty'](this[_0x52e29e(0xb86)],!![]));break;}case'circle':{this['_child']['circle'][_0x52e29e(_0x2db58e._0x1acd6f)]=new Cesium__namespace['CallbackProperty'](_0x482103=>{return this['_position'];},![]);break;}case _0x52e29e(_0x2db58e._0xdaf45):{this['_child']['coneTrack']['position']=new Cesium__namespace['CallbackProperty'](_0xd66da6=>{const _0x20c0bc=_0x52e29e;return this[_0x20c0bc(_0x460f0f._0x241889)];},![]);break;}case'path':{this[_0x52e29e(_0x2db58e._0x244275)]['path'][_0x52e29e(0xb61)]=this[_0x52e29e(0xb86)];break;}case'polyline':{this[_0x52e29e(_0x2db58e._0xab3b14)]=[],this['_child'][_0x52e29e(0x282)]['positions']=new Cesium__namespace['CallbackProperty'](_0x80cb53=>{return this['_polyline_positions'];},![]);break;}case _0x52e29e(_0x2db58e._0x4fc04b):{this['_wall_positions']=[],this[_0x52e29e(0xa81)]['wall'][_0x52e29e(0xb35)]=new Cesium__namespace[(_0x52e29e(_0x2db58e._0x1053f3))](_0x3ece46=>{const _0x21296c=_0x52e29e;return this[_0x21296c(_0xbbaeb0._0x562f45)];},![]),this['_wall_minimumHeights']=[],this['_child']['wall']['style'][_0x52e29e(0xba)]=new Cesium__namespace['CallbackProperty'](_0x2d834b=>{const _0x5e9ac7=_0x52e29e;return this[_0x5e9ac7(0x286)];},![]),this[_0x52e29e(_0x2db58e._0x3048e8)]=[],this[_0x52e29e(0xa81)]['wall']['style']['maximumHeights']=new Cesium__namespace['CallbackProperty'](_0x141a7a=>{return this['_wall_maximumHeights'];},![]),this['_child']['wall']['_heights_cache']={};break;}}}}['_addChildGraphic'](){const _0x5be62f={_0x22795b:0xe35},_0x257140={_0x29390c:0x2d0,_0x749bf1:0x402},_0x17aa53=_0x35a251;this[_0x17aa53(_0x5be62f._0x22795b)](_0x247c43=>{const _0x25b136=_0x17aa53;this[_0x25b136(_0x257140._0x29390c)]['addGraphic'](_0x247c43),_0x247c43['czmObject']&&this['bindPickId'](_0x247c43['czmObject']),_0x247c43[_0x25b136(_0x257140._0x749bf1)]&&_0x247c43['czmObjectEx']['forEach'](_0x5e1974=>{this['bindPickId'](_0x5e1974);});});}['_removeChildGraphic'](){this['eachChildGraphic'](_0x5a90f4=>{const _0x167ffe=_0x2767;this[_0x167ffe(0x2d0)]['removeGraphic'](_0x5a90f4);});}['eachChildGraphic'](_0x227455,_0x188300){const _0x2aa247={_0xf91345:0xa81},_0x4c557a=_0x35a251;if(!this['_child'])return;return Object['keys'](this[_0x4c557a(_0x2aa247._0xf91345)])['forEach']((_0x2bd9be,_0x1bd585)=>{_0x227455&&_0x227455['call'](_0x188300||this,this['_child'][_0x2bd9be],_0x1bd585);}),this;}['update'](_0x182e79){const _0xecd87c={_0x25cc37:0x987,_0x15901f:0x4ae,_0x341524:0xdf1,_0x5e063a:0xd9b,_0x81595a:0xe86,_0xb76cee:0x543,_0x3a62f6:0x8eb,_0x23509d:0x8b},_0x3c9b3a=_0x35a251;if(!this[_0x3c9b3a(_0xecd87c._0x25cc37)])return;this[_0x3c9b3a(0xdb7)]=this[_0x3c9b3a(0x337)](_0x182e79['time'],this['_position_result']);if(!this['_position']){this['_last_hasNull']?this[_0x3c9b3a(0x8b)]():(this['_updatePosition'](),this[_0x3c9b3a(_0xecd87c._0x15901f)](),this['_last_hasNull']=!![]);return;}this['_last_hasNull']=![];this[_0x3c9b3a(0xb86)][_0x3c9b3a(0xc6b)]===Cesium__namespace['ReferenceFrame'][_0x3c9b3a(_0xecd87c._0x341524)]&&(this['_position_inertial']=this['_position']['clone'](),Cesium__namespace[_0x3c9b3a(0x398)][_0x3c9b3a(_0xecd87c._0x5e063a)](_0x182e79[_0x3c9b3a(0xe15)],this['_position'],this[_0x3c9b3a(0xb86)]['referenceFrame'],Cesium__namespace['ReferenceFrame'][_0x3c9b3a(0xfb1)],this['_position']));if(this['options'][_0x3c9b3a(0xdb0)]){this['_clampToTilesetFrame']++;if(!this['_clampToTilesetHeight']||this['_clampToTilesetFrame']%this['_frameRateHeight']===0x0){let _0x68b8a0=getHeight(this['_map']['scene'],this[_0x3c9b3a(0xdb7)],{'objectsToExclude':this['_layer']['objectsToExclude'],'has3dtiles':!![]});_0x68b8a0&&(Cesium__namespace['defined'](this[_0x3c9b3a(_0xecd87c._0x81595a)]['minHeight'])&&_0x68b8a0this[_0x3c9b3a(_0xecd87c._0x81595a)]['maxHeight']&&(_0x68b8a0=this['options']['maxHeight']),this['_clampToTilesetHeight']=_0x68b8a0);}if(this['_clampToTilesetHeight']){const _0x115aad=Cesium__namespace['Cartographic']['fromCartesian'](this['_position']);this['_position']=Cesium__namespace[_0x3c9b3a(_0xecd87c._0x3a62f6)]['fromRadians'](_0x115aad['longitude'],_0x115aad['latitude'],this['_clampToTilesetHeight']);}}this['_orientation_show']=this['_orientation']['getValue'](_0x182e79['time']),this[_0x3c9b3a(_0xecd87c._0x23509d)](),this['_updateCamera'](),this['_updateForEvent']();}['_updatePosition'](){const _0x5df40a={_0x4ab7bf:0x987,_0x3c141b:0xdb7,_0x47247f:0x440,_0x2e5c89:0x5ff,_0x2940b0:0x6de,_0x3994f7:0x95,_0x50d16a:0xb86,_0x3b2bb2:0x2b1,_0x4a387c:0x682,_0x4f5c16:0xd19,_0x2cc84c:0x286},_0x158cfe=_0x35a251;var _0x3c0a5e,_0x1ade60,_0x310dc4,_0x3dcde,_0x1031f5,_0xb2ab49,_0xdde211;(_0x3c0a5e=this[_0x158cfe(0xa81)]['label'])!==null&&_0x3c0a5e!==void 0x0&&_0x3c0a5e[_0x158cfe(0x987)]&&(this['_child']['label']['position']=this[_0x158cfe(0xdb7)]);(_0x1ade60=this['_child']['billboard'])!==null&&_0x1ade60!==void 0x0&&_0x1ade60['show']&&(this['_child']['billboard'][_0x158cfe(0xb61)]=this['_position']);(_0x310dc4=this['_child']['point'])!==null&&_0x310dc4!==void 0x0&&_0x310dc4[_0x158cfe(_0x5df40a._0x4ab7bf)]&&(this['_child'][_0x158cfe(0x1ba)][_0x158cfe(0xb61)]=this[_0x158cfe(_0x5df40a._0x3c141b)]);if((_0x3dcde=this['_child']['model'])!==null&&_0x3dcde!==void 0x0&&_0x3dcde['show']){var _0x5d71fa;this['_modelMatrix']=this['_child'][_0x158cfe(_0x5df40a._0x47247f)]['_getModelMatrix'](this[_0x158cfe(0xdb7)],this['_orientation_show']),this['_heading_reality']=this['_child']['model']['_heading_reality'],this['_pitch_reality']=this[_0x158cfe(0xa81)][_0x158cfe(0x440)][_0x158cfe(_0x5df40a._0x2e5c89)],this[_0x158cfe(0x35f)]=this['_child']['model']['_roll_reality'],(_0x5d71fa=this['_child']['model'])!==null&&_0x5d71fa!==void 0x0&&_0x5d71fa['_primitive']&&(this['_child']['model']['_primitive']['modelMatrix']=this[_0x158cfe(0x6c2)]),this[_0x158cfe(0xa81)]['model']['_position']=this['_position'];}let _0x3a7c6b=![];if((_0x1031f5=this['_child']['polyline'])!==null&&_0x1031f5!==void 0x0&&_0x1031f5['show']&&!((_0xb2ab49=this['options']['polyline'])!==null&&_0xb2ab49!==void 0x0&&_0xb2ab49['showAll'])){const _0x404ea9=this[_0x158cfe(0xb86)][_0x158cfe(0xb4f)]['_values']['slice'](0x0,this['_flyok_index']*0x3);if(this['_flyok_index']>0x0){let _0x336b49=Cesium__namespace['Cartesian3']['unpackArray'](_0x404ea9);this[_0x158cfe(0xdb7)]&&_0x336b49[_0x158cfe(_0x5df40a._0x2940b0)](this['_position']),this['options']['polyline'][_0x158cfe(0x32b)]&&(_0x336b49=sliceByMaxDistance(_0x336b49,this['options']['polyline']['maxDistance']),this['_maxCacheCount']>0x0&&(this['_maxCacheCount']=Math['max'](this['_maxCacheCount'],_0x336b49['length']*0x2))),this['_polyline_positions']=_0x336b49,_0x3a7c6b=!![];}else this[_0x158cfe(_0x5df40a._0x3994f7)]=[];}if((_0xdde211=this['_child'][_0x158cfe(0x2b1)])!==null&&_0xdde211!==void 0x0&&_0xdde211['show']){const _0x15ca03=this[_0x158cfe(_0x5df40a._0x50d16a)]['_property']['_values'][_0x158cfe(0x97a)](0x0,this[_0x158cfe(0x650)]*0x3);if(this['_flyok_index']>0x0){if(!_0x3a7c6b){let _0x110302=Cesium__namespace['Cartesian3']['unpackArray'](_0x15ca03);this['_position']&&_0x110302['push'](this['_position']),this[_0x158cfe(0xe86)]['wall']['maxDistance']&&(_0x110302=sliceByMaxDistance(_0x110302,this['options'][_0x158cfe(_0x5df40a._0x3b2bb2)]['maxDistance']),this['_maxCacheCount']>0x0&&(this['_maxCacheCount']=Math['max'](this['_maxCacheCount'],_0x110302['length']*0x2))),this[_0x158cfe(0x95)]=_0x110302;}const _0x11b466=[],_0x12b5e8=[],_0x3224f0=this['_polyline_positions'];for(let _0x516602=0x0;_0x516602<_0x3224f0['length'];_0x516602++){const _0x2f7b03=_0x3224f0[_0x516602],_0x48891e=Cesium__namespace['Cartographic']['fromCartesian'](_0x2f7b03);_0x12b5e8['push'](_0x48891e[_0x158cfe(_0x5df40a._0x4a387c)]);if(this['options'][_0x158cfe(0x2b1)]['surface']){var _0x1b6a93;_0x3224f0[_0x516602]['hbgd']=_0x3224f0[_0x516602][_0x158cfe(_0x5df40a._0x4f5c16)]??getHeight((_0x1b6a93=this['_map'])===null||_0x1b6a93===void 0x0?void 0x0:_0x1b6a93['scene'],_0x2f7b03,{'has3dtiles':![]}),_0x11b466[_0x158cfe(0x6de)](_0x3224f0[_0x516602]['hbgd']);}else _0x11b466['push'](0x0);}this['_wall_positions']=_0x3224f0,this['_wall_minimumHeights']=_0x11b466,this['_wall_maximumHeights']=_0x12b5e8;}else this['_wall_positions']=[],this[_0x158cfe(_0x5df40a._0x2cc84c)]=[],this['_wall_maximumHeights']=[];}}['_updateCamera'](){const _0xc5b9a1={_0x5d858c:0xd79,_0x325319:0x42d,_0x4304b8:0xd79,_0x497117:0x8d3,_0xcba946:0xd79,_0x1b8212:0xd79,_0x250679:0xe86,_0x39effd:0x7d,_0x26b79c:0xaf8,_0x41bbfa:0xec6},_0x38ad6b=_0x35a251;if(!this['options'][_0x38ad6b(0x7d)])return;switch(this['options'][_0x38ad6b(0x7d)]['type']){case'gs':{const _0x2b798e=this['trackedEntity'];this[_0x38ad6b(_0xc5b9a1._0x5d858c)][_0x38ad6b(_0xc5b9a1._0x325319)]['shouldAnimate']&&this[_0x38ad6b(0xd79)]['trackedEntity']!==_0x2b798e&&(this[_0x38ad6b(_0xc5b9a1._0x4304b8)]['trackedEntity']=_0x2b798e,_0x2b798e['_needFlyToPoint']=!![]);_0x2b798e['_needFlyToPoint']&&!this[_0x38ad6b(0xd79)][_0x38ad6b(_0xc5b9a1._0x497117)]['_needTrackedEntityUpdate']&&(_0x2b798e['_needFlyToPoint']=![],this['flyToPoint']({...this[_0x38ad6b(0xe86)][_0x38ad6b(0x7d)],'lock':!![],'duration':0x0}));break;}case'dy':{const _0x461271=this['trackedEntity'];this[_0x38ad6b(_0xc5b9a1._0xcba946)]['trackedEntity']!==_0x461271&&(this[_0x38ad6b(_0xc5b9a1._0x1b8212)]['trackedEntity']=_0x461271);let _0x56ffe7=this[_0x38ad6b(0xe86)][_0x38ad6b(0x7d)][_0x38ad6b(0xf68)]||0x0;const _0x4c7388=this[_0x38ad6b(_0xc5b9a1._0x250679)][_0x38ad6b(_0xc5b9a1._0x39effd)]['followedZ']||0x0;_0x56ffe7===0x0&&_0x4c7388===0x0&&(_0x56ffe7=0.1);let _0x55a8c7;this['options'][_0x38ad6b(0x7d)][_0x38ad6b(0x929)]&&(_0x55a8c7=_0x55a8c7||{},_0x55a8c7['x']=this['options']['camera']['offsetX']);this['options'][_0x38ad6b(_0xc5b9a1._0x39effd)]['offsetY']&&(_0x55a8c7=_0x55a8c7||{},_0x55a8c7['y']=this['options']['camera']['offsetY']);this['options']['camera'][_0x38ad6b(_0xc5b9a1._0x26b79c)]&&(_0x55a8c7=_0x55a8c7||{},_0x55a8c7['z']=this['options']['camera']['offsetZ']);this['_map']['scene']['camera']['lookAtTransform'](this[_0x38ad6b(0x3dd)](_0x55a8c7),new Cesium__namespace[(_0x38ad6b(0x8eb))](-_0x56ffe7,0x0,_0x4c7388));break;}case'sd':{const _0x394cdc=this['trackedEntity'];this[_0x38ad6b(0xd79)]['trackedEntity']!==_0x394cdc&&(this[_0x38ad6b(0xd79)]['trackedEntity']=_0x394cdc);this[_0x38ad6b(0xd79)]['scene']['camera']['lookAtTransform'](this[_0x38ad6b(0x3dd)](),new Cesium__namespace['Cartesian3'](-0x1,0x0,this['options']['camera']['followedZ']));break;}default:{this['_trackedEntity']&&this['_map']['trackedEntity']===this['_trackedEntity']&&(this[_0x38ad6b(_0xc5b9a1._0x1b8212)][_0x38ad6b(_0xc5b9a1._0x41bbfa)]=undefined);break;}}}['computeModelMatrix'](_0x348b85){const _0x2c2039={_0x421704:0x151,_0x23f508:0x60b,_0x4db6e1:0x79d,_0x2db6d9:0xcfb},_0x26008e=_0x35a251;!this[_0x26008e(0xcfb)]&&(this[_0x26008e(0xcfb)]=new Cesium__namespace['Matrix4'](),this[_0x26008e(_0x2c2039._0x421704)]=new Cesium__namespace[(_0x26008e(0xd9d))]());let _0x4e0d3e=this['_position'];if(!Cesium__namespace[_0x26008e(0xaa2)](_0x4e0d3e)||!this['_orientation_show'])return undefined;if(_0x348b85){const _0x50cef0=new Cesium__namespace['HeadingPitchRoll'](this[_0x26008e(0xab0)],this['_pitch'],this[_0x26008e(_0x2c2039._0x23f508)]);_0x4e0d3e=getPositionByHprAndOffset(_0x4e0d3e,new Cesium__namespace['Cartesian3'](_0x348b85['x']||0x0,_0x348b85['y']||0x0,_0x348b85['z']||0x0),_0x50cef0);}return this[_0x26008e(0xcfb)]=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3'][_0x26008e(_0x2c2039._0x4db6e1)](this['_orientation_show'],this['_matrix3Scratch']),_0x4e0d3e,this['_matrix4']),this[_0x26008e(_0x2c2039._0x2db6d9)];}['_updateForEvent'](){const _0x4c46c0={_0x27cef0:0x264,_0x50917e:0xaa2,_0x3d3998:0xb6d,_0x303779:0xc2f},_0x3bc292=_0x35a251,_0x3d9d17=this['_flyok_index']??0x0;this[_0x3bc292(_0x4c46c0._0x27cef0)](EventType['change'],{'index':_0x3d9d17,'counts':this['_counts'],'position':this['_position'],'orientation':this[_0x3bc292(0x88a)]});if(_0x3d9d17!==this['_last_fireIndex']){if(Cesium__namespace[_0x3bc292(_0x4c46c0._0x50917e)](this['_last_fireIndex'])&&this['_last_fireIndex']+0x1!==_0x3d9d17)while(++this[_0x3bc292(0xc2f)]<_0x3d9d17){this['fire'](EventType['endItem'],{'counts':this[_0x3bc292(_0x4c46c0._0x3d3998)],'index':this[_0x3bc292(_0x4c46c0._0x303779)]});}this['fire'](EventType['endItem'],{'counts':this['_counts'],'index':_0x3d9d17}),_0x3d9d17===this['_counts']&&this['fire'](EventType[_0x3bc292(0xa2d)]),this['_last_fireIndex']=_0x3d9d17;}}['getPropertyValue'](_0x44018d,_0xb05366){const _0x173ea9={_0x4da7fb:0xe3d,_0x20050e:0x650,_0x5cea18:0x900,_0x112eda:0xa44,_0x3bd5d2:0x129,_0x32c0ba:0x5d6,_0x36d3e6:0xf11},_0x4efc0a=_0x35a251;var _0x538e3c;const _0x2be6b2=(_0x538e3c=this['property'])===null||_0x538e3c===void 0x0?void 0x0:_0x538e3c['_property'],_0x485c1c=_0x2be6b2===null||_0x2be6b2===void 0x0?void 0x0:_0x2be6b2['_times'],_0x560587=_0x485c1c[_0x4efc0a(0xe1e)];if(_0x560587===0x0)return undefined;this['_counts']=_0x560587;let _0x3bc1e9;const _0xb24e1f=Cesium__namespace[_0x4efc0a(0x8eb)],_0x159983=_0x2be6b2['_values'];this[_0x4efc0a(0x650)]=Cesium__namespace['binarySearch'](_0x485c1c,_0x44018d,Cesium__namespace['JulianDate']['compare']);if(this['_flyok_index']<0x0){this['_flyok_index']=~this['_flyok_index'];if(this['_flyok_index']===0x0){const _0x30da36=_0x485c1c[this['_flyok_index']];_0x3bc1e9=_0x2be6b2[_0x4efc0a(0x332)];if(_0x2be6b2[_0x4efc0a(0xe3b)]===Cesium__namespace['ExtrapolationType']['NONE']||_0x3bc1e9!==0x0&&Cesium__namespace['JulianDate'][_0x4efc0a(_0x173ea9._0x4da7fb)](_0x30da36,_0x44018d)>_0x3bc1e9)return undefined;if(_0x2be6b2[_0x4efc0a(0xe3b)]===Cesium__namespace['ExtrapolationType']['HOLD'])return _0xb24e1f[_0x4efc0a(0xf36)](_0x159983,0x0,_0xb05366);}if(this['_flyok_index']>=_0x560587){this[_0x4efc0a(_0x173ea9._0x20050e)]=_0x560587-0x1;const _0x46fce6=_0x485c1c[this['_flyok_index']];_0x3bc1e9=_0x2be6b2['_forwardExtrapolationDuration'];if(_0x2be6b2['_forwardExtrapolationType']===Cesium__namespace['ExtrapolationType']['NONE']||_0x3bc1e9!==0x0&&Cesium__namespace['JulianDate']['secondsDifference'](_0x44018d,_0x46fce6)>_0x3bc1e9)return undefined;if(_0x2be6b2['_forwardExtrapolationType']===Cesium__namespace['ExtrapolationType']['HOLD'])return this['_flyok_index']=_0x560587-0x1,_0xb24e1f[_0x4efc0a(0xf36)](_0x159983,this['_flyok_index']*_0xb24e1f['packedLength'],_0xb05366);}const _0x526928=_0x2be6b2[_0x4efc0a(_0x173ea9._0x5cea18)],_0x5a8c9c=_0x2be6b2['_yTable'],_0xe625f7=_0x2be6b2['_interpolationAlgorithm'],_0x2cb199=_0x2be6b2[_0x4efc0a(0x9a5)],_0x4053b4=_0x2be6b2['_inputOrder'];if(_0x2be6b2['_updateTableLength']){_0x2be6b2[_0x4efc0a(_0x173ea9._0x112eda)]=![];const _0x5af729=Math['min'](_0xe625f7[_0x4efc0a(_0x173ea9._0x3bd5d2)](_0x2be6b2['_interpolationDegree'],_0x4053b4),_0x560587);_0x5af729!==_0x2be6b2['_numberOfPoints']&&(_0x2be6b2['_numberOfPoints']=_0x5af729,_0x526928['length']=_0x5af729,_0x5a8c9c['length']=_0x5af729*_0x2cb199);}const _0x287ae6=_0x2be6b2['_numberOfPoints']-0x1;if(_0x287ae6<0x1)return undefined;let _0x1c35c9=0x0,_0x4b0686=_0x560587-0x1;const _0xa63037=_0x4b0686-_0x1c35c9+0x1;if(_0xa63037>=_0x287ae6+0x1){let _0x5a3b40=this[_0x4efc0a(_0x173ea9._0x20050e)]-(_0x287ae6/0x2|0x0)-0x1;_0x5a3b40<_0x1c35c9&&(_0x5a3b40=_0x1c35c9);let _0xd9b371=_0x5a3b40+_0x287ae6;_0xd9b371>_0x4b0686&&(_0xd9b371=_0x4b0686,_0x5a3b40=_0xd9b371-_0x287ae6,_0x5a3b40<_0x1c35c9&&(_0x5a3b40=_0x1c35c9)),_0x1c35c9=_0x5a3b40,_0x4b0686=_0xd9b371;}const _0xf9522a=_0x4b0686-_0x1c35c9+0x1;for(let _0x4931b4=0x0;_0x4931b4<_0xf9522a;++_0x4931b4){_0x526928[_0x4931b4]=Cesium__namespace['JulianDate']['secondsDifference'](_0x485c1c[_0x1c35c9+_0x4931b4],_0x485c1c[_0x4b0686]);}if(!Cesium__namespace[_0x4efc0a(0xaa2)](_0xb24e1f[_0x4efc0a(_0x173ea9._0x32c0ba)])){let _0x8d950a=0x0;const _0x28e400=_0x2be6b2['_packedLength'];let _0x3e0844=_0x1c35c9*_0x28e400;const _0x43adb9=(_0x4b0686+0x1)*_0x28e400;while(_0x3e0844<_0x43adb9){_0x5a8c9c[_0x8d950a]=_0x159983[_0x3e0844],_0x3e0844++,_0x8d950a++;}}else _0xb24e1f['convertPackedArrayForInterpolation'](_0x159983,_0x1c35c9,_0x4b0686,_0x5a8c9c);const _0x2b0b30=Cesium__namespace['JulianDate'][_0x4efc0a(_0x173ea9._0x4da7fb)](_0x44018d,_0x485c1c[_0x4b0686]);let _0x86bd90;if(_0x4053b4===0x0||!Cesium__namespace['defined'](_0xe625f7['interpolate']))_0x86bd90=_0xe625f7['interpolateOrderZero'](_0x2b0b30,_0x526928,_0x5a8c9c,_0x2cb199,_0x2be6b2['_interpolationResult']);else{const _0x57cb14=Math['floor'](_0x2cb199/(_0x4053b4+0x1));_0x86bd90=_0xe625f7['interpolate'](_0x2b0b30,_0x526928,_0x5a8c9c,_0x57cb14,_0x4053b4,_0x4053b4,_0x2be6b2['_interpolationResult']);}if(!Cesium__namespace['defined'](_0xb24e1f[_0x4efc0a(_0x173ea9._0x36d3e6)]))return _0xb24e1f['unpack'](_0x86bd90,0x0,_0xb05366);return _0xb24e1f['unpackInterpolationResult'](_0x86bd90,_0x159983,_0x1c35c9,_0x4b0686,_0xb05366);}return _0xb24e1f['unpack'](_0x159983,this[_0x4efc0a(_0x173ea9._0x20050e)]*_0x2be6b2[_0x4efc0a(0x44b)],_0xb05366);}['clearPosition'](){const _0x226e7a={_0x54a9e6:0xe1e},_0x30c784=_0x35a251;var _0x4c8370,_0x2b1c6a;const _0x209a67=(_0x4c8370=this['property'])===null||_0x4c8370===void 0x0?void 0x0:(_0x2b1c6a=_0x4c8370['_property'])===null||_0x2b1c6a===void 0x0?void 0x0:_0x2b1c6a['_times'];if(!_0x209a67||_0x209a67[_0x30c784(_0x226e7a._0x54a9e6)]===0x0)return;this['property']['removeSamples'](new Cesium__namespace['TimeInterval']({'start':_0x209a67[0x0],'stop':_0x209a67[_0x209a67['length']-0x1]}));}['getRectangle'](_0x51d089){const _0x3dfdcc={_0x34fd55:0xb86},_0x2a6220=_0x35a251;var _0x22f3a5,_0x3c996d,_0x58bbe7,_0x56d6f5;const _0x3574f0=(_0x22f3a5=this[_0x2a6220(_0x3dfdcc._0x34fd55)])===null||_0x22f3a5===void 0x0?void 0x0:(_0x3c996d=_0x22f3a5['_property'])===null||_0x3c996d===void 0x0?void 0x0:_0x3c996d['_times'],_0x23a4fb=(_0x58bbe7=this['property'])===null||_0x58bbe7===void 0x0?void 0x0:(_0x56d6f5=_0x58bbe7['_property'])===null||_0x56d6f5===void 0x0?void 0x0:_0x56d6f5['_values'];if(!_0x3574f0||_0x3574f0['length']===0x0)return;const _0x36d6f0=[];for(let _0x2481ae=0x0,_0x501980=_0x3574f0['length'];_0x2481ae<_0x501980;_0x2481ae++){_0x36d6f0['push'](new Cesium__namespace['Cartesian3'](_0x23a4fb[_0x2481ae*0x3],_0x23a4fb[_0x2481ae*0x3+0x1],_0x23a4fb[_0x2481ae*0x3+0x2]));}const _0x36c600=getRectangle(_0x36d6f0,_0x51d089===null||_0x51d089===void 0x0?void 0x0:_0x51d089['isFormat']);return _0x36c600;}['getCoordinates'](_0xc71443){const _0x218031={_0x39f491:0x46b},_0x5ac2eb=_0x35a251;var _0x4ea180,_0x564992,_0x167532,_0x40c01e;const _0x343e9a=(_0x4ea180=this['property'])===null||_0x4ea180===void 0x0?void 0x0:(_0x564992=_0x4ea180['_property'])===null||_0x564992===void 0x0?void 0x0:_0x564992['_times'],_0x85504a=(_0x167532=this['property'])===null||_0x167532===void 0x0?void 0x0:(_0x40c01e=_0x167532['_property'])===null||_0x40c01e===void 0x0?void 0x0:_0x40c01e['_values'];if(!_0x343e9a||_0x343e9a['length']===0x0)return[];const _0x16f2e0=[];for(let _0x36fd46=0x0,_0xd6a979=_0x343e9a['length'];_0x36fd46<_0xd6a979;_0x36fd46++){const _0x640aa4=LngLatPoint['fromCartesian'](new Cesium__namespace['Cartesian3'](_0x85504a[_0x36fd46*0x3],_0x85504a[_0x36fd46*0x3+0x1],_0x85504a[_0x36fd46*0x3+0x2])),_0x325fd7=_0x640aa4['toArray'](_0xc71443);_0x325fd7['push'](Cesium__namespace[_0x5ac2eb(0x579)][_0x5ac2eb(0x7dc)](_0x343e9a[_0x36fd46])[_0x5ac2eb(_0x218031._0x39f491)]()),_0x16f2e0[_0x5ac2eb(0x6de)](_0x325fd7);}return _0x16f2e0;}[_0x35a251(0xe1c)](_0x443842={}){const _0x3b9d3a={_0x2cfe75:0x7c0,_0x21b48e:0xe1c},_0x22b073=_0x35a251;if(!this['_map'])return;const _0x4513cb=this['_position'];if(!_0x4513cb)return;let _0x43afd6;if(Cesium__namespace['defined'](_0x443842['heading'])){var _0x165ac7;_0x43afd6=_0x443842[_0x22b073(0x41f)]+Cesium__namespace[_0x22b073(_0x3b9d3a._0x2cfe75)][_0x22b073(0x9c5)](((_0x165ac7=this['hpr'])===null||_0x165ac7===void 0x0?void 0x0:_0x165ac7['heading'])||0x0);}this['_map'][_0x22b073(_0x3b9d3a._0x21b48e)](_0x4513cb,{..._0x443842,'heading':_0x43afd6});}static['clearLastCamera'](){const _0x2fe685={_0x2ee52e:0xe86},_0x17a138=_0x35a251;var _0x329980,_0x2cd92c,_0x2a1fcd;(_0x329980=globeLastRoam)!==null&&_0x329980!==void 0x0&&(_0x2cd92c=_0x329980['options'])!==null&&_0x2cd92c!==void 0x0&&(_0x2a1fcd=_0x2cd92c['camera'])!==null&&_0x2a1fcd!==void 0x0&&_0x2a1fcd['type']&&(globeLastRoam[_0x17a138(_0x2fe685._0x2ee52e)]['camera']['type']=''),globeLastRoam=null;}['setCameraOptions'](_0x102251){const _0x50c476={_0x3fe1e9:0xe86,_0x2435c2:0xe1c},_0x1b7c58=_0x35a251;var _0x4d638d;Route['clearLastCamera']();if(this['options']['camera'])this['options']['camera']=merge(this['options']['camera'],_0x102251);else _0x102251?this[_0x1b7c58(_0x50c476._0x3fe1e9)][_0x1b7c58(0x7d)]=_0x102251:this[_0x1b7c58(0xe86)][_0x1b7c58(0x7d)]={'type':''};((_0x4d638d=this['options']['camera'])===null||_0x4d638d===void 0x0?void 0x0:_0x4d638d['type'])!==''&&(globeLastRoam=this),_0x102251&&_0x102251['type']==='gs'&&_0x102251['radius']&&this[_0x1b7c58(_0x50c476._0x2435c2)]({..._0x102251,'duration':0x0});}[_0x35a251(0x63c)](){logWarn('Route\x20类不支持autoSurfaceHeight方法\x20!');}['pause'](){const _0x2c625c={_0x12ee7b:0x6e1,_0x1f4f30:0xec6},_0x1cdd4c=_0x35a251;this[_0x1cdd4c(0xd79)]&&(this['_map']['clock']['shouldAnimate']=![],this['_trackedEntity']&&this['_map']['trackedEntity']===this[_0x1cdd4c(_0x2c625c._0x12ee7b)]&&(this['_map'][_0x1cdd4c(_0x2c625c._0x1f4f30)]=undefined));}['proceed'](){const _0x1d29d6={_0x9ff650:0xd79},_0x2f2aed=_0x35a251;this[_0x2f2aed(0xd79)]&&(this[_0x2f2aed(_0x1d29d6._0x9ff650)]['clock'][_0x2f2aed(0x21b)]=!![]);}[_0x35a251(0x6b4)](){const _0x15f90a={_0x2d45f4:0x8ad},_0xdb961e=_0x35a251;return!this[_0xdb961e(_0x15f90a._0x2d45f4)]&&(this['_popupPosition']=new Cesium__namespace['CallbackProperty'](_0xe2c529=>{return this['_position'];},![])),this['_popupPosition'];}['destroy'](_0x1ac3c4){const _0x51c6b7={_0x1527b8:0xa63};this['eachChildGraphic'](_0xb23fe6=>{const _0x9ad363=_0x2767;_0xb23fe6[_0x9ad363(_0x51c6b7._0x1527b8)](_0x1ac3c4);}),super['destroy'](_0x1ac3c4);}}register$4('route',Route);class FixedRoute extends Route{constructor(_0x4796f4={}){const _0x3505b8={_0x4cad6d:0x3f6,_0x21d33f:0xe86},_0x36d851=_0x35a251;super(_0x4796f4),this[_0x36d851(0xe86)][_0x36d851(_0x3505b8._0x4cad6d)]=this[_0x36d851(0xe86)]['showStop']??!![],this[_0x36d851(0xe86)]['updateClock']=this[_0x36d851(_0x3505b8._0x21d33f)]['updateClock']??!![];}get['startTime'](){return this['_startTime'];}get['stopTime'](){return this['_stopTime'];}get['points'](){const _0x5de81e=_0x35a251;return this[_0x5de81e(0x86e)];}set['points'](_0x4fac6d){const _0x5a14d3=_0x35a251;this[_0x5a14d3(0xb35)]=_0x4fac6d;}get[_0x35a251(0xb35)](){const _0x24665d={_0x33bb2b:0xdb7},_0x5d76ed=_0x35a251;return this[_0x5d76ed(0x86e)]['map'](_0x5a8e7a=>{const _0x2b6c3c=_0x5d76ed;return _0x5a8e7a[_0x2b6c3c(_0x24665d._0x33bb2b)];});}set['positions'](_0x247874){const _0x38065c={_0x42ed12:0x586,_0x4035cb:0xa51,_0x13c571:0x586,_0x11f74a:0x586,_0x1b174f:0xa51,_0x9c0a41:0xe7d,_0x5861f8:0xd79,_0x1d854a:0x18b,_0x231678:0x6a2,_0xa5daae:0x7cd,_0x32449d:0xe0,_0x2b4822:0x7c0,_0x564f48:0x527,_0x44ada6:0xba7,_0x278a55:0xeed,_0x91d3bf:0xb86,_0x55886b:0x7c0,_0x38fd8c:0x857,_0x38a65a:0x711,_0x442f9e:0x536,_0xa95a:0xb3c,_0x30b6c4:0x9e4,_0x1b06eb:0x9e4,_0x953139:0x651,_0x40266c:0x536,_0x386c5b:0xdd3,_0x4d4195:0xd61,_0x310e82:0x3db,_0x3ea216:0xe86,_0x5739c3:0xc80,_0xbf373d:0x5c6,_0xc6009e:0x3f6,_0x36fda8:0xa81},_0x35ea3b={_0x4be81d:0xeed,_0x4b18fd:0xfa7,_0x426985:0x5d2},_0x4b7720=_0x35a251;if(!this['_map']||!_0x247874||!Array[_0x4b7720(0x719)](_0x247874)||_0x247874['length']===0x0)return;const _0x3e8263=LngLatArray['toPoints'](_0x247874);this['clearPosition']();let _0x42edfe;if(this['options'][_0x4b7720(_0x38065c._0x42ed12)]){if(isString(this['options']['startTime']))this['options']['startTime'][_0x4b7720(0xd74)]('Z')===-0x1?_0x42edfe=Cesium__namespace['JulianDate'][_0x4b7720(_0x38065c._0x4035cb)](new Date(this[_0x4b7720(0xe86)]['startTime'])):_0x42edfe=Cesium__namespace[_0x4b7720(0x579)]['fromIso8601'](this[_0x4b7720(0xe86)][_0x4b7720(_0x38065c._0x13c571)]);else this['options'][_0x4b7720(_0x38065c._0x11f74a)]instanceof Date?_0x42edfe=Cesium__namespace['JulianDate'][_0x4b7720(_0x38065c._0x1b174f)](this['options']['startTime']):_0x42edfe=this['options']['startTime'];}else{if(this[_0x4b7720(0xe86)]['timeField']){const _0x3749d6=_0x3e8263[0x0][this['options'][_0x4b7720(_0x38065c._0x9c0a41)]];_0x42edfe=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x3749d6));}else _0x42edfe=this[_0x4b7720(_0x38065c._0x5861f8)]['clock'][_0x4b7720(_0x38065c._0x1d854a)];}const _0x3d1c79=this['options'][_0x4b7720(_0x38065c._0x231678)],_0x434be4=_0x3d1c79&&Array[_0x4b7720(0x719)](_0x3d1c79),_0x205be6=0x64;function _0x1fb2a9(_0x172390,_0x2dded6){const _0x2cb3a5=_0x4b7720;if(_0x2dded6['speed'])return _0x2dded6[_0x2cb3a5(0x6a2)];if(_0x2dded6['_speed'])return _0x2dded6['_speed'];if(_0x434be4)return(_0x3d1c79[_0x172390]||_0x205be6)/3.6;return(_0x3d1c79||_0x205be6)/3.6;}const _0x5d9ecf=this['options']['offsetHeight']??0x0;let _0x1d902=0x0,_0x591344=0x0,_0x317b68,_0x5ac6fc;const _0x1254fe=[];let _0x26fac8=![];const _0x1fe30b=0.001;function _0x50fdf4(_0xa79b58,_0x12d9cb){const _0x48ae0e=_0x4b7720;for(let _0x1f3bf7=_0xa79b58-0x1;_0x1f3bf7>=0x0;_0x1f3bf7--){const _0x302f96=_0x3e8263[_0x1f3bf7],_0x2187b6=_0x302f96['_position']||Cesium__namespace['Cartesian3'][_0x48ae0e(0xa6d)](_0x302f96['lng'],_0x302f96['lat'],_0x302f96['alt']+_0x5d9ecf);_0x302f96[_0x48ae0e(0xdb7)]=_0x2187b6;const _0x47d861=Cesium__namespace['Cartesian3'][_0x48ae0e(_0x35ea3b._0x4be81d)](_0x12d9cb,_0x2187b6);if(_0x47d861!==0x0)return getOnLinePointByLen(_0x2187b6,_0x12d9cb,_0x1fe30b,!![]);}for(let _0x5bcecf=_0xa79b58-0x1,_0x1cd59c=_0x3e8263['length'];_0x5bcecf<_0x1cd59c;_0x5bcecf++){const _0x39b8b2=_0x3e8263[_0x5bcecf],_0x50ceae=_0x39b8b2[_0x48ae0e(0xdb7)]||Cesium__namespace[_0x48ae0e(0x8eb)]['fromDegrees'](_0x39b8b2[_0x48ae0e(_0x35ea3b._0x4b18fd)],_0x39b8b2['lat'],_0x39b8b2[_0x48ae0e(_0x35ea3b._0x426985)]+_0x5d9ecf);_0x39b8b2['_position']=_0x50ceae;const _0x23c4a1=Cesium__namespace['Cartesian3'][_0x48ae0e(0xeed)](_0x12d9cb,_0x50ceae);if(_0x23c4a1!==0x0)return getOnLinePointByLen(_0x12d9cb,_0x50ceae,_0x1fe30b,![]);}return null;}for(let _0x21051c=0x0,_0x3c957b=_0x3e8263['length'];_0x21051c<_0x3c957b;_0x21051c++){let _0x1146d6=_0x3e8263[_0x21051c],_0x27cbe8=_0x1146d6['_position']||Cesium__namespace['Cartesian3'][_0x4b7720(0xa6d)](_0x1146d6['lng'],_0x1146d6['lat'],_0x1146d6['alt']+_0x5d9ecf);if(_0x21051c===0x0){_0x5ac6fc=_0x42edfe['clone'](),this['property']['addSample'](_0x5ac6fc,_0x27cbe8),_0x1146d6[_0x4b7720(0xdb7)]=_0x27cbe8,_0x1146d6['_time']=_0x5ac6fc,_0x1146d6['_distance']=_0x591344,_0x1146d6['_second']=_0x1d902,_0x1146d6[_0x4b7720(_0x38065c._0xa5daae)]=0x0,_0x1146d6['_index']=_0x21051c,_0x1254fe['push'](_0x1146d6);if(Cesium__namespace['defined'](_0x1146d6['heading'])){this['_orientation']=new Cesium__namespace[(_0x4b7720(_0x38065c._0x32449d))](Cesium__namespace['Quaternion']),_0x26fac8=!![];const _0x30b26d=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace[_0x4b7720(_0x38065c._0x2b4822)]['toRadians'](_0x1146d6['heading']||0x0),Cesium__namespace[_0x4b7720(_0x38065c._0x2b4822)]['toRadians'](_0x1146d6[_0x4b7720(_0x38065c._0x564f48)]||0x0),Cesium__namespace['Math']['toRadians'](_0x1146d6[_0x4b7720(_0x38065c._0x44ada6)]||0x0));this['_orientation'][_0x4b7720(0x651)](_0x5ac6fc,Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x27cbe8,_0x30b26d));}}else{let _0x1f4589=Cesium__namespace[_0x4b7720(0x8eb)][_0x4b7720(_0x38065c._0x278a55)](_0x27cbe8,_0x317b68);if(_0x1f4589===0x0){_0x1f4589=_0x1fe30b,_0x27cbe8=_0x50fdf4(_0x21051c,_0x27cbe8);if(!_0x27cbe8)continue;}let _0x574d89,_0x36eaad;if(this['options']['timeField']){const _0x3232a2=new Date(_0x1146d6[this['options'][_0x4b7720(0xe7d)]]),_0x2cb565=Cesium__namespace['JulianDate']['fromDate'](_0x3232a2);_0x574d89=Cesium__namespace['JulianDate']['secondsDifference'](_0x2cb565,_0x5ac6fc)||0.01,_0x5ac6fc=_0x2cb565,_0x36eaad=_0x1f4589/_0x574d89,_0x1d902+=_0x574d89;}else _0x36eaad=_0x1fb2a9(_0x21051c-0x1,_0x1146d6),_0x574d89=_0x1f4589/_0x36eaad,_0x574d89<0.01&&(_0x574d89=0.01),_0x1d902+=_0x574d89,_0x5ac6fc=Cesium__namespace['JulianDate']['addSeconds'](_0x42edfe,_0x1d902,new Cesium__namespace['JulianDate']());_0x591344+=_0x1f4589,this[_0x4b7720(_0x38065c._0x91d3bf)]['addSample'](_0x5ac6fc,_0x27cbe8);if(_0x26fac8){const _0x59825b=new Cesium__namespace[(_0x4b7720(0x513))](Cesium__namespace['Math']['toRadians'](_0x1146d6['heading']||0x0),Cesium__namespace['Math']['toRadians'](_0x1146d6['pitch']||0x0),Cesium__namespace[_0x4b7720(_0x38065c._0x55886b)][_0x4b7720(0x7ba)](_0x1146d6['roll']||0x0));this[_0x4b7720(_0x38065c._0x38fd8c)][_0x4b7720(0x651)](_0x5ac6fc,Cesium__namespace['Transforms'][_0x4b7720(_0x38065c._0x38a65a)](_0x27cbe8,_0x59825b));}_0x1146d6['_position']=_0x27cbe8,_0x1146d6[_0x4b7720(_0x38065c._0x442f9e)]=_0x5ac6fc,_0x1146d6['_distance']=_0x591344,_0x1146d6['_second']=_0x1d902,_0x1146d6['_speed']=_0x36eaad,_0x1146d6[_0x4b7720(_0x38065c._0xa95a)]=_0x21051c,_0x1254fe['push'](_0x1146d6);if(this['options'][_0x4b7720(_0x38065c._0x30b6c4)]){const _0x5a4b0c=_0x50fdf4(_0x21051c,_0x27cbe8);if(!_0x5a4b0c)continue;let _0x3948c4;typeof this['options']['pauseTime']==='function'?_0x3948c4=this['options']['pauseTime'](_0x21051c,_0x5a4b0c):_0x3948c4=this['options'][_0x4b7720(_0x38065c._0x1b06eb)],_0x3948c4>0x0&&(_0x1d902+=_0x3948c4,_0x5ac6fc=Cesium__namespace['JulianDate']['addSeconds'](_0x42edfe,_0x1d902,new Cesium__namespace['JulianDate']()),this['property'][_0x4b7720(_0x38065c._0x953139)](_0x5ac6fc,_0x5a4b0c),_0x591344+=_0x1fe30b,_0x1146d6=clone(_0x1146d6),_0x1146d6['_position']=_0x5a4b0c,_0x1146d6[_0x4b7720(_0x38065c._0x40266c)]=_0x5ac6fc,_0x1146d6[_0x4b7720(_0x38065c._0x386c5b)]=_0x591344,_0x1146d6['_second']=_0x1d902,_0x1146d6['_speed']=0x0,_0x1146d6['_index']=_0x21051c,_0x1254fe['push'](_0x1146d6));}}_0x317b68=_0x27cbe8;}this['_points']=_0x1254fe,this['_startTime']=_0x42edfe,this['_stopTime']=_0x5ac6fc[_0x4b7720(_0x38065c._0x4d4195)](),this[_0x4b7720(_0x38065c._0x310e82)]=_0x1d902,this['distance_all']=_0x591344;this[_0x4b7720(_0x38065c._0x3ea216)][_0x4b7720(_0x38065c._0x5739c3)]&&this['property']['setInterpolationOptions']({'interpolationDegree':this['options'][_0x4b7720(0x7de)]??0x2,'interpolationAlgorithm':this['options'][_0x4b7720(0x221)]??Cesium__namespace[_0x4b7720(_0x38065c._0xbf373d)]});if(this['options'][_0x4b7720(_0x38065c._0xc6009e)]){var _0x1a2e1e,_0x751ad2;this[_0x4b7720(0x5ca)](),(_0x1a2e1e=this['options'])!==null&&_0x1a2e1e!==void 0x0&&(_0x751ad2=_0x1a2e1e['polyline'])!==null&&_0x751ad2!==void 0x0&&_0x751ad2['showAll']&&(this[_0x4b7720(_0x38065c._0x36fda8)]['polyline']['positions']=this['positions']);}this[_0x4b7720(0x264)](EventType['updatePosition'],{'position':this[_0x4b7720(0xb86)]});}get['isStart'](){return this['_isStart'];}get[_0x35a251(0xb92)](){return this['_timeinfo'];}['_addedHook'](_0x5b7196){const _0x2538e7={_0x2aec2e:0x3e2,_0x7d493a:0x86c,_0x8e4697:0xb35,_0x3eb264:0xbd4},_0x218fc4=_0x35a251;var _0x302831,_0x448767;if(!this['show'])return;this['_addChildGraphic'](),(_0x302831=this['model'])!==null&&_0x302831!==void 0x0&&_0x302831[_0x218fc4(0x3e2)]&&this['model'][_0x218fc4(_0x2538e7._0x2aec2e)][_0x218fc4(_0x2538e7._0x7d493a)](()=>{this['_readyPromise']['resolve'](this);}),this[_0x218fc4(_0x2538e7._0x8e4697)]=this['options']['positions'],this['_polyline_positions']=[],(_0x448767=this['_child']['path'])!==null&&_0x448767!==void 0x0&&_0x448767[_0x218fc4(_0x2538e7._0x3eb264)]&&(this['_child']['path']['entity'][_0x218fc4(0xf60)]=undefined);}['_setOptionsHook'](_0x2a0269,_0x76e1bb){const _0x3c63c5={_0x3eaf9f:0x586,_0x573651:0xb35},_0x5b3758=_0x35a251;for(const _0x2b5fd3 in _0x76e1bb){switch(_0x2b5fd3){case'speed':case _0x5b3758(_0x3c63c5._0x3eaf9f):this[_0x5b3758(_0x3c63c5._0x573651)]=this['options']['positions'];break;default:super[_0x5b3758(0xbfc)](_0x2a0269,_0x76e1bb);break;}}}['start'](){const _0x21a22f={_0x3808b6:0xb35,_0x491af9:0x86e,_0x58d3b7:0xa81,_0x291a72:0x987,_0x1d37c8:0xe86,_0x4122b4:0x21b,_0x71e80e:0xd79},_0x46794d=_0x35a251;var _0x46b501;if(!this['_map']||this['_isStart'])return;if(!Cesium__namespace['defined'](this['_points'])||this['_points']['length']===0x0){logError$1('没有坐标数据,漫游路线启动失败',this['_points']);return;}this['_isStart']=!![],this[_0x46794d(_0x21a22f._0x3808b6)]=this[_0x46794d(_0x21a22f._0x491af9)],(_0x46b501=this[_0x46794d(_0x21a22f._0x58d3b7)][_0x46794d(0x440)])!==null&&_0x46b501!==void 0x0&&_0x46b501[_0x46794d(_0x21a22f._0x291a72)]&&this[_0x46794d(_0x21a22f._0x1d37c8)]['updateClock']?(this['_map']['clock'][_0x46794d(_0x21a22f._0x4122b4)]=![],this[_0x46794d(_0x21a22f._0x71e80e)]['clock']['currentTime']=this['startTime']['clone'](),this['_child']['model']['readyPromise']['then'](()=>{this['_start']();})):this['_start']();}[_0x35a251(0x406)](){const _0x2df6cc={_0x473de7:0x42d,_0x4bad2f:0x18b,_0xb5f751:0x355,_0x481950:0x586,_0xb53a6f:0x42d,_0x45fc76:0xd79,_0x5bffe9:0xa06,_0x22a95a:0xe0a,_0x12c9d6:0x6e6,_0x436e31:0xdb},_0x1525cb=_0x35a251;var _0x571ffd;this['options']['updateClock']&&(this[_0x1525cb(0xd79)][_0x1525cb(_0x2df6cc._0x473de7)]['shouldAnimate']=!![],this['_map']['clock'][_0x1525cb(_0x2df6cc._0x4bad2f)]=this['startTime']['clone'](),!this[_0x1525cb(0xe86)]['clockLoop']&&this['options']['clockRange']&&(this[_0x1525cb(0x703)]=this['_map']['clock'][_0x1525cb(_0x2df6cc._0xb5f751)],this['_bak_startTime']=this['_map'][_0x1525cb(_0x2df6cc._0x473de7)][_0x1525cb(_0x2df6cc._0x481950)],this['_bak_stopTime']=this['_map']['clock']['stopTime'],this['_map'][_0x1525cb(0x42d)]['clockRange']=this[_0x1525cb(0xe86)][_0x1525cb(_0x2df6cc._0xb5f751)]??Cesium__namespace['ClockRange']['LOOP_STOP'],this['_map']['clock']['startTime']=this['startTime']['clone'](),this['_map'][_0x1525cb(_0x2df6cc._0xb53a6f)]['stopTime']=this['stopTime']['clone'](),this['_map']['controls']['timeline']&&this[_0x1525cb(_0x2df6cc._0x45fc76)]['controls']['timeline']['zoomTo'](this['startTime'],this['stopTime'])));if((_0x571ffd=this['_child'][_0x1525cb(_0x2df6cc._0x5bffe9)])!==null&&_0x571ffd!==void 0x0&&_0x571ffd['entity']){var _0x39f26c;let _0x278315=this['_stopTime'];((_0x39f26c=this[_0x1525cb(0xb86)])===null||_0x39f26c===void 0x0?void 0x0:_0x39f26c['forwardExtrapolationType'])===Cesium__namespace[_0x1525cb(_0x2df6cc._0x22a95a)]['HOLD']&&(_0x278315=Cesium__namespace['JulianDate'][_0x1525cb(_0x2df6cc._0x12c9d6)](_0x278315,0x16d,new Cesium__namespace[(_0x1525cb(0x579))]())),this['_child']['path']['entity'][_0x1525cb(0xf60)]=new Cesium__namespace[(_0x1525cb(0xd85))]([new Cesium__namespace['TimeInterval']({'start':this[_0x1525cb(0x773)],'stop':_0x278315})]);}this['fire'](EventType['start']),this[_0x1525cb(_0x2df6cc._0x436e31)]();}['stop'](){const _0x131c0f={_0x416d0f:0xbe2,_0x37066c:0xe86,_0x28a6fd:0x3f6,_0x54c251:0xdb7,_0x2f616d:0x95,_0x2909c0:0xdb7},_0xe0bdfe=_0x35a251;var _0x43ffac;if(!this['_isStart']||!this['_map'])return;this['_map']['trackedEntity']=undefined,this[_0xe0bdfe(_0x131c0f._0x416d0f)](),this[_0xe0bdfe(_0x131c0f._0x37066c)][_0xe0bdfe(_0x131c0f._0x28a6fd)]?this['backToFirst']():(this[_0xe0bdfe(_0x131c0f._0x54c251)]=undefined,this['_updatePosition']()),this[_0xe0bdfe(_0x131c0f._0x2f616d)]=[],(_0x43ffac=this['_child']['path'])!==null&&_0x43ffac!==void 0x0&&_0x43ffac['entity']&&(this['_child']['path']['entity']['availability']=undefined),this[_0xe0bdfe(0x222)]=![],this['fire'](EventType['end']),this[_0xe0bdfe(0x264)](EventType['updatePosition'],{'position':this[_0xe0bdfe(_0x131c0f._0x2909c0)]});}[_0x35a251(0x5ca)](){const _0x16c640={_0x3db7f9:0x650},_0x306277=_0x35a251;this[_0x306277(_0x16c640._0x3db7f9)]=0x0,this['_position']=this['_points'][0x0][_0x306277(0xdb7)],this['_orientation_show']=this['_orientation'][_0x306277(0x7ec)](this['startTime']),this['_updatePosition'](),this['_updateForEvent'](![]);}['_updatePositionEx'](){var _0x4babc8,_0x4da907;(_0x4babc8=this['options'])!==null&&_0x4babc8!==void 0x0&&(_0x4da907=_0x4babc8['polyline'])!==null&&_0x4da907!==void 0x0&&_0x4da907['showAll']&&(this['_child']['polyline']['positions']=this['positions']);}['_updateForEvent'](_0x42aaaa=!![]){const _0x35ab98={_0x199ba7:0x650,_0x5d9e2d:0x86e,_0x543d78:0x9b1,_0x30bbcd:0x7cd,_0x4aa0b2:0x9f2,_0x38fa5f:0xb6d,_0x4de26b:0xc2f,_0x235be1:0xe7d,_0x10e4b1:0x86e,_0x1d7f75:0xa51,_0x59c60b:0xa06,_0x42b8c3:0x80b},_0x16f715=_0x35a251;if(!this['_points'])return;const _0x2de332=this[_0x16f715(_0x35ab98._0x199ba7)],_0x4a9683=this['_points'][this[_0x16f715(_0x35ab98._0x5d9e2d)][_0x16f715(0xe1e)]-0x1],_0x31ee13=this[_0x16f715(_0x35ab98._0x5d9e2d)][Math['max'](_0x2de332-0x1,0x0)];if(!_0x31ee13)return;const _0xffc1d6=LngLatPoint[_0x16f715(_0x35ab98._0x543d78)](this['_position']);let _0x323844=_0x31ee13['_distance']+(this['_position']?Cesium__namespace[_0x16f715(0x8eb)]['distance'](this['_position'],_0x31ee13['_position']):0x0);_0x323844>_0x4a9683[_0x16f715(0xdd3)]&&(_0x323844=_0x4a9683['_distance']);let _0x5d0d8b=0x0;_0x2de332>0x0&&(_0x5d0d8b=Cesium__namespace['JulianDate']['secondsDifference'](this['_map']['clock'][_0x16f715(0x18b)],this['startTime']),_0x5d0d8b>_0x4a9683['_second']&&(_0x5d0d8b=_0x4a9683['_second']));this['_timeinfo']={'index':_0x2de332,'counts':this[_0x16f715(0xb6d)]??this['_points']['length'],'point':_0xffc1d6,'position':this['_position'],'orientation':this['_orientation_show'],'second':_0x5d0d8b,'second_all':_0x4a9683['_second'],'distance':_0x323844,'distance_all':_0x4a9683['_distance'],'speed':_0x31ee13[_0x16f715(_0x35ab98._0x30bbcd)]};if(!_0x42aaaa)return;this['fire'](EventType[_0x16f715(_0x35ab98._0x4aa0b2)],this['_timeinfo']);if(_0x2de332!==this[_0x16f715(0xc2f)]){if(Cesium__namespace['defined'](this['_last_fireIndex'])&&this['_last_fireIndex']+0x1!==_0x2de332)while(++this['_last_fireIndex']<_0x2de332){this['fire'](EventType['endItem'],{'counts':this[_0x16f715(_0x35ab98._0x38fa5f)],'index':this[_0x16f715(_0x35ab98._0x4de26b)],'point':this[_0x16f715(0x86e)][this[_0x16f715(0xc2f)]]});}this['fire'](EventType['endItem'],{'counts':this['_counts'],'index':_0x2de332,'point':this['_points'][_0x2de332]}),_0x2de332===this['_counts']&&this['fire'](EventType['end']),this['_last_fireIndex']=_0x2de332;}if(_0x5d0d8b>=_0x4a9683['_second']){var _0x48e23f;if(this[_0x16f715(0xe86)]['clockLoop']&&!this[_0x16f715(0xe86)][_0x16f715(0x355)]){var _0x3989a2;this['unbindUpdateEvent']();if(this['options']['startTime'])delete this['options']['startTime'];else{if(this['options'][_0x16f715(0xe7d)]){const _0x286b61=this[_0x16f715(_0x35ab98._0x5d9e2d)][0x0][this['options'][_0x16f715(_0x35ab98._0x235be1)]],_0xfcd55=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x286b61)),_0x287c55=Cesium__namespace[_0x16f715(0x579)]['secondsDifference'](this['_map']['clock']['currentTime'],_0xfcd55);for(let _0xcbb542=0x0;_0xcbb542{const _0x10408a={_0x30b5d4:0x954},_0x2e830b={_0x1e59f6:0x6de},_0x5086f7=_0x44a915,_0x1c8842=[];_0x2e34f[_0x5086f7(0xdbd)](_0x2d3825=>{const _0x3abf23=_0x5086f7;_0x1c8842[_0x3abf23(_0x2e830b._0x1e59f6)](_0x2d3825['_position']);}),computeStepSurfaceLine({'objectsToExclude':this['_layer'][_0x5086f7(0x59a)],..._0x2799ab,'exact':!![],'scene':this['_map']['scene'],'positions':_0x1c8842,'endItem':(_0x29e738,_0x44f807,_0x5348cb)=>{const _0xa3b130=_0x5086f7;var _0xca987b,_0xdea47;if(!this['_map'])return;const _0x2a39d8=_0x2e34f[_0x5348cb];if(_0x44f807)_0xc1ce60['push'](_0x2a39d8);else for(let _0x10c356=0x0;_0x10c356<_0x29e738[_0xa3b130(_0xd709ed._0x21f1bb)];_0x10c356++){const _0x303199=LngLatPoint['fromCartesian'](_0x29e738[_0x10c356]);_0x303199['_speed']=_0x2a39d8[_0xa3b130(0x7cd)],_0xc1ce60[_0xa3b130(_0xd709ed._0x5656a1)](_0x303199);}const _0x1a4816=((_0xca987b=_0x2e34f[_0x5348cb])===null||_0xca987b===void 0x0?void 0x0:_0xca987b['alt'])||0x0,_0x448d98=((_0xdea47=_0x2e34f[_0x5348cb+0x1])===null||_0xdea47===void 0x0?void 0x0:_0xdea47['alt'])||0x0,_0x270ab6=(_0x448d98-_0x1a4816)/_0x29e738['length'];for(let _0x1fc25c=0x0;_0x1fc25c<_0x29e738['length'];_0x1fc25c++){_0x1fc25c!==0x0&&(_0x16e8e9+=Cesium__namespace['Cartesian3']['distance'](_0x29e738[_0x1fc25c],_0x29e738[_0x1fc25c-0x1]));_0x535be9['push'](Number(_0x16e8e9['toFixed'](0x1)));const _0xdf2aa2=LngLatPoint['fromCartesian'](_0x29e738[_0x1fc25c]);_0x308b7f['push'](_0xdf2aa2);const _0x415273=_0x44f807?0x0:_0xdf2aa2['alt'];_0x3c31d7[_0xa3b130(0x6de)](_0x415273);const _0x6af0c5=Number((_0x1a4816+_0x270ab6*_0x1fc25c)['toFixed'](0x1));_0x3b2679['push'](_0x6af0c5);}},'end':()=>{const _0x26c810=_0x5086f7;if(!this[_0x26c810(0xd79)])return;this[_0x26c810(_0x10408a._0x30b5d4)]={'arrLength':_0x535be9,'arrFxgd':_0x3b2679,'arrHbgd':_0x3c31d7,'arrPoint':_0x308b7f},this['positions']=_0xc1ce60,_0x45cc8a(_0xc1ce60);}});});}[_0x35a251(0x979)](_0x1511a3){const _0x148354=_0x35a251;return this[_0x148354(0x63c)](_0x1511a3);}['getTerrainHeight'](_0x369181={}){const _0x58d1e2={_0x5792fe:0x86e},_0x3360c3={_0x29af38:0x59a,_0x414638:0xd79},_0x2eecc0={_0x50ba04:0x5e4},_0x4525e5=_0x35a251,_0x5c13cc=this[_0x4525e5(_0x58d1e2._0x5792fe)];return new Promise((_0x59f74b,_0xff9ec3)=>{const _0x4ca642={_0x4a8e6e:0xe1e,_0x27c66c:0xf0a},_0x332845=_0x4525e5;if(this[_0x332845(0x954)]){_0x59f74b(this[_0x332845(0x954)]);return;}this['_getTerrainHeight_ing']=!![];let _0x16a6c0=0x0;const _0x2e2bce=[],_0x1fdf26=[],_0xf4fdb8=[],_0x2044d1=[];computeStepSurfaceLine({'objectsToExclude':this['_layer'][_0x332845(_0x3360c3._0x29af38)],..._0x369181,'exact':!![],'scene':this[_0x332845(_0x3360c3._0x414638)]['scene'],'positions':_0x5c13cc,'endItem':(_0x142bba,_0x8f9420,_0x154d5b)=>{const _0x38d88a=_0x332845,_0x47c2aa=_0x5c13cc[_0x154d5b][_0x38d88a(0x5d2)],_0x5691bb=_0x5c13cc[_0x154d5b+0x1]['alt'],_0x561dff=(_0x5691bb-_0x47c2aa)/_0x142bba['length'];for(let _0x3d2f43=0x0;_0x3d2f43<_0x142bba[_0x38d88a(_0x4ca642._0x4a8e6e)];_0x3d2f43++){_0x3d2f43!==0x0&&(_0x16a6c0+=Cesium__namespace['Cartesian3']['distance'](_0x142bba[_0x3d2f43],_0x142bba[_0x3d2f43-0x1]));_0x2e2bce['push'](Number(_0x16a6c0['toFixed'](0x1)));const _0x3dbd31=LngLatPoint['fromCartesian'](_0x142bba[_0x3d2f43]);_0x2044d1['push'](_0x3dbd31);const _0x44b336=_0x8f9420?0x0:_0x3dbd31['alt'];_0x1fdf26['push'](_0x44b336);const _0x17fda4=Number((_0x47c2aa+_0x561dff*_0x3d2f43)[_0x38d88a(_0x4ca642._0x27c66c)](0x1));_0xf4fdb8[_0x38d88a(0x6de)](_0x17fda4);}},'end':()=>{const _0x4843a4=_0x332845;this[_0x4843a4(_0x2eecc0._0x50ba04)]=![],this['_terrainHeight']={'arrLength':_0x2e2bce,'arrFxgd':_0xf4fdb8,'arrHbgd':_0x1fdf26,'arrPoint':_0x2044d1},_0x59f74b(this['_terrainHeight']);}});});}}register$4('fixedRoute',FixedRoute);var index$6={'__proto__':null,'BaseGraphic':BaseGraphic,'BaseEntity':BaseEntity,'BasePointEntity':BasePointEntity,'BasePolyEntity':BasePolyEntity,'BasePrimitive':BasePrimitive,'BasePointPrimitive':BasePointPrimitive,'BasePolyPrimitive':BasePolyPrimitive,'PointEntity':PointEntity,'BillboardEntity':BillboardEntity,'FontBillboardEntity':FontBillboardEntity,'DivBillboardEntity':DivBillboardEntity,'LabelEntity':LabelEntity,'CanvasLabelEntity':CanvasLabelEntity,'ModelEntity':ModelEntity,'BoxEntity':BoxEntity,'PlaneEntity':PlaneEntity,'CircleEntity':CircleEntity,'CylinderEntity':CylinderEntity,'ConeTrack':ConeTrack,'EllipsoidEntity':EllipsoidEntity,'PolylineEntity':PolylineEntity,'CurveEntity':CurveEntity,'PolylineVolumeEntity':PolylineVolumeEntity,'PathEntity':PathEntity,'CorridorEntity':CorridorEntity,'WallEntity':WallEntity,'RectangleEntity':RectangleEntity,'PolygonEntity':PolygonEntity,'EllipseEntity':EllipseEntity,'RectangularSensor':RectangularSensor,'Video2D':Video2D,'PitEntity':PitEntity,'AttackArrow':AttackArrow,'AttackArrowPW':AttackArrowPW,'AttackArrowYW':AttackArrowYW,'CloseVurve':CloseVurve,'DoubleArrow':DoubleArrow,'FineArrow':FineArrow,'FineArrowYW':FineArrowYW,'GatheringPlace':GatheringPlace,'IsosTriangle':IsosTriangle,'Lune':Lune,'Regular':Regular,'Sector':Sector,'StraightArrow':StraightArrow,'PointMeasure':PointMeasure,'DistanceMeasure':DistanceMeasure,'DistanceSurfaceMeasure':DistanceSurfaceMeasure,'SectionMeasure':SectionMeasure,'AngleMeasure':AngleMeasure,'HeightMeasure':HeightMeasure,'HeightTriangleMeasure':HeightTriangleMeasure,'AreaMeasure':AreaMeasure,'AreaSurfaceMeasure':AreaSurfaceMeasure,'VolumeMeasure':VolumeMeasure,'VolumeDepthMeasure':VolumeDepthMeasure,'PointPrimitive':PointPrimitive,'BillboardPrimitive':BillboardPrimitive,'CloudPrimitive':CloudPrimitive,'LabelPrimitive':LabelPrimitive,'ModelPrimitive':ModelPrimitive,'CirclePrimitive':CirclePrimitive,'PlanePrimitive':PlanePrimitive,'BoxPrimitive':BoxPrimitive,'CylinderPrimitive':CylinderPrimitive,'ConeTrackPrimitive':ConeTrackPrimitive,'EllipsoidPrimitive':EllipsoidPrimitive,'PolylinePrimitive':PolylinePrimitive,'WallPrimitive':WallPrimitive,'CorridorPrimitive':CorridorPrimitive,'PolylineVolumePrimitive':PolylineVolumePrimitive,'RectanglePrimitive':RectanglePrimitive,'PolygonPrimitive':PolygonPrimitive,'FrustumPrimitive':FrustumPrimitive,'LightCone':LightCone,'Water':Water,'DiffuseWall':DiffuseWall,'ScrollWall':ScrollWall,'ThickWall':ThickWall,'DynamicRiver':DynamicRiver,'Road':Road,'Pit':Pit,'DoubleSidedPlane':DoubleSidedPlane,'ReflectionWater':ReflectionWater,'VideoPrimitive':VideoPrimitive,'BaseCombine':BaseCombine,'FlatBillboard':FlatBillboard,'PlaneCombine':PlaneCombine,'BoxCombine':BoxCombine,'CircleCombine':CircleCombine,'CylinderCombine':CylinderCombine,'FrustumCombine':FrustumCombine,'EllipsoidCombine':EllipsoidCombine,'PolylineCombine':PolylineCombine,'PolylineVolumeCombine':PolylineVolumeCombine,'CorridorCombine':CorridorCombine,'WallCombine':WallCombine,'PolygonCombine':PolygonCombine,'WaterCombine':WaterCombine,'RectangleCombine':RectangleCombine,'DivGraphic':DivGraphic,'DivBoderLabel':DivBoderLabel,'DivLightPoint':DivLightPoint,'DivUpLabel':DivUpLabel,'Popup':Popup,'Tooltip':Tooltip,'ParticleSystem':ParticleSystem,'ArcFrustum':ArcFrustum,'Tetrahedron':Tetrahedron,'ViewShed':ViewShed,'Video3D':Video3D,'Route':Route,'FixedRoute':FixedRoute};class XyzImageryProvider$1 extends Cesium__namespace[_0x35a251(0x6db)]{constructor(_0x6595f={}){const _0xc88680={_0x2f1410:0xe59},_0x2fab6c=_0x35a251;_0x6595f[_0x2fab6c(_0xc88680._0x2f1410)]=_0x6595f['customTags']||{},_0x6595f['customTags']['host']=function(_0x55e239,_0x47db84,_0x36c49a,_0x180259){return location['host'];},_0x6595f['customTags']['hostname']=function(_0x345f53,_0xdf81f1,_0x46f2fd,_0x51c815){const _0xd2bc35=_0x2fab6c;return location[_0xd2bc35(0xa6)];},_0x6595f['customTags'][_0x2fab6c(0x2c4)]=function(_0x4967db,_0x53f8c1,_0x1ea5e9,_0x410878){return _0x410878+0x1;},super(_0x6595f),this['options']=_0x6595f;}}class TdtImageryProvider extends Cesium__namespace[_0x35a251(0x460)]{constructor(_0x179bfe={}){const _0x3d7860={_0x3ec45f:0x5a3,_0x386d31:0xbe9,_0x67e0ff:0x7d2,_0x2897a3:0xeb8,_0x386064:0xa03,_0x409d3f:0x84,_0xb895ce:0xdc0,_0xd2ec85:0xf45,_0x3ffb08:0x84,_0x38b33d:0x8a9},_0x21569b=_0x35a251;let _0x5682ae,_0x25681f=0x12;switch(_0x179bfe['layer']){case _0x21569b(0x754):_0x5682ae='vec';break;case'vec_z':_0x5682ae='cva';break;case _0x21569b(0x776):_0x5682ae='eva';break;case _0x21569b(0xe77):_0x5682ae='img';break;case'img_z':_0x5682ae='cia';break;case _0x21569b(_0x3d7860._0x3ec45f):_0x5682ae=_0x21569b(_0x3d7860._0x386d31);break;case'ter_d':_0x5682ae='ter',_0x25681f=0xe;break;case _0x21569b(_0x3d7860._0x67e0ff):_0x5682ae='cta',_0x25681f=0xe;break;default:_0x5682ae=_0x21569b(_0x3d7860._0x2897a3);break;}(_0x179bfe[_0x21569b(0xa03)]==null||_0x179bfe['key']['length']===0x0)&&(_0x179bfe[_0x21569b(_0x3d7860._0x386064)]=tiandituArr);const _0x352dce=getArrayRandomOne(_0x179bfe[_0x21569b(_0x3d7860._0x386064)]);let _0x5b39b7;!_0x179bfe['crs']||_0x179bfe['crs']===CRS['EPSG3857']?(_0x5b39b7='https://t{s}.tianditu.gov.cn/'+_0x5682ae+'_w/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer='+_0x5682ae+_0x21569b(_0x3d7860._0x409d3f)+_0x352dce,(_0x179bfe[_0x21569b(0x741)]||_0x179bfe[_0x21569b(0xdc0)]||_0x179bfe['queryParameters'])&&(_0x5b39b7=getUrlResource({'url':_0x5b39b7['replace']('{s}','0'),'proxy':_0x179bfe['proxy'],'headers':_0x179bfe[_0x21569b(_0x3d7860._0xb895ce)],'queryParameters':_0x179bfe['queryParameters']})),_0x179bfe={'subdomains':['0','1','2','3','4','5','6','7'],'maximumLevel':_0x179bfe['maximumLevel']??_0x25681f,..._0x179bfe,'url':_0x5b39b7,'layer':_0x5682ae,'style':_0x21569b(0x171),'format':'tiles','tileMatrixSetID':'w','tileMatrixLabels':[...Array(0x14)['keys']()][_0x21569b(0x457)](_0x361f6f=>_0x361f6f[_0x21569b(0x591)]()),'tilingScheme':new Cesium__namespace['WebMercatorTilingScheme']()}):(_0x5b39b7='https://t{s}.tianditu.gov.cn/'+_0x5682ae+_0x21569b(_0x3d7860._0xd2ec85)+_0x5682ae+_0x21569b(_0x3d7860._0x3ffb08)+_0x352dce,_0x25681f=0x11,(_0x179bfe['proxy']||_0x179bfe[_0x21569b(_0x3d7860._0xb895ce)]||_0x179bfe['queryParameters'])&&(_0x5b39b7=getUrlResource({'url':_0x5b39b7[_0x21569b(0x20e)]('{s}','0'),'proxy':_0x179bfe['proxy'],'headers':_0x179bfe['headers'],'queryParameters':_0x179bfe['queryParameters']})),_0x179bfe={'subdomains':['0','1','2','3','4','5','6','7'],'maximumLevel':_0x179bfe[_0x21569b(_0x3d7860._0x38b33d)]??_0x25681f,..._0x179bfe,'url':_0x5b39b7,'layer':_0x5682ae,'style':'default','format':_0x21569b(0xa29),'tileMatrixSetID':'c','tileMatrixLabels':[...Array(0x14)['keys']()]['map'](_0x4fab27=>(_0x4fab27+0x1)['toString']()),'tilingScheme':new Cesium__namespace['GeographicTilingScheme']()}),super(_0x179bfe),this['options']=_0x179bfe;}}class GaodeImageryProvider extends XyzImageryProvider$1{constructor(_0x219755={}){const _0x1f7d62={_0x54712e:0x9a3,_0x4bae56:0x46b,_0x18c0e9:0x7d7,_0x4aa866:0xdc0},_0x40cd16=_0x35a251;let _0x1a98e8;switch(_0x219755['layer']){case'vec':_0x1a98e8='https://'+(_0x219755['bigfont']?'wprd':'webrd')+'0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}';break;case _0x40cd16(0xe77):_0x1a98e8='https://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}';break;case _0x40cd16(_0x1f7d62._0x54712e):_0x1a98e8='https://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8';break;case'time':{const _0x52986d=new Date()[_0x40cd16(_0x1f7d62._0x4bae56)]();_0x1a98e8=_0x40cd16(_0x1f7d62._0x18c0e9)+_0x52986d;break;}default:_0x1a98e8=_0x219755['url'];break;}(_0x219755['proxy']||_0x219755[_0x40cd16(_0x1f7d62._0x4aa866)]||_0x219755[_0x40cd16(0xa4e)])&&(_0x1a98e8=getUrlResource({'url':_0x1a98e8['replace']('{s}','1'),'proxy':_0x219755[_0x40cd16(0x741)],'headers':_0x219755['headers'],'queryParameters':_0x219755['queryParameters']})),super({'subdomains':['1','2','3','4'],'maximumLevel':0x12,..._0x219755,'url':_0x1a98e8});}}const EARTH_RADIUS=6370996.81,MC_BAND=[12890594.86,8362377.87,0x554fed,3481989.83,1678043.12,0x0],LL_BAND=[0x4b,0x3c,0x2d,0x1e,0xf,0x0],MC2LL=[[1.410526172116255e-8,0.00000898305509648872,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-0.03801003308653,17337981.2],[-7.435856389565537e-9,0.000008983055097726239,-0.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,0.00000898305509983578,0.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,0.32710905363475,6856817.37],[-1.981981304930552e-8,0.000008983055099779535,0.03278182852591,40.31678527705744,0.65659298677277,-4.44255534477492,0.85341911805263,0.12923347998204,-0.04625736007561,4482777.06],[3.09191371068437e-9,0.000008983055096812155,0.00006995724062,23.10934304144901,-0.00023663490511,-0.6321817810242,-0.00663494467273,0.03430082397953,-0.00466043876332,2555164.4],[2.890871144776878e-9,0.000008983055095805407,-3.068298e-8,7.47137025468032,-0.00000353937994,-0.02145144861037,-0.00001234426596,0.00010322952773,-0.00000323890364,826088.5]],LL2MC=[[-0.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[0.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[0.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[0.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-0.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-0.0003218135878613132,111320.7020701615,0.00369383431289,823725.6402795718,0.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,0.37238884252424,7.45]];class BaiduMercatorProjection{constructor(){this['isWgs84']=![];}['getDistanceByMC'](_0x466146,_0xed454a){const _0x3f0c7f={_0x52051a:0x97e,_0x143829:0xb9d},_0x330a2c=_0x35a251;if(!_0x466146||!_0xed454a)return 0x0;_0x466146=this[_0x330a2c(_0x3f0c7f._0x52051a)](_0x466146);if(!_0x466146)return 0x0;const _0x38d928=this['toRadians'](_0x466146['lng']),_0x4e8b90=this['toRadians'](_0x466146['lat']);_0xed454a=this[_0x330a2c(0x97e)](_0xed454a);if(!_0xed454a)return 0x0;const _0x5c185c=this['toRadians'](_0xed454a['lng']),_0x97faa=this['toRadians'](_0xed454a[_0x330a2c(_0x3f0c7f._0x143829)]);return this['getDistance'](_0x38d928,_0x5c185c,_0x4e8b90,_0x97faa);}[_0x35a251(0x2f4)](_0x249b7f,_0x109fe0){const _0x42c3d6={_0x1f9633:0xb9d,_0x2b056c:0x7ba},_0x141c8e=_0x35a251;if(!_0x249b7f||!_0x109fe0)return 0x0;_0x249b7f['lng']=this['getLoop'](_0x249b7f['lng'],-0xb4,0xb4),_0x249b7f['lat']=this['getRange'](_0x249b7f['lat'],-0x4a,0x4a),_0x109fe0['lng']=this['getLoop'](_0x109fe0['lng'],-0xb4,0xb4),_0x109fe0['lat']=this['getRange'](_0x109fe0['lat'],-0x4a,0x4a);const _0x2ea5bd=this['toRadians'](_0x249b7f[_0x141c8e(0xfa7)]),_0x5a958b=this['toRadians'](_0x249b7f[_0x141c8e(_0x42c3d6._0x1f9633)]),_0x48eed8=this[_0x141c8e(_0x42c3d6._0x2b056c)](_0x109fe0['lng']),_0x34d484=this[_0x141c8e(_0x42c3d6._0x2b056c)](_0x109fe0['lat']);return this['getDistance'](_0x2ea5bd,_0x48eed8,_0x5a958b,_0x34d484);}[_0x35a251(0x97e)](_0x2985ab){const _0x981fac={_0x4f7f57:0x405,_0x44d322:0xb9d,_0x79e5c9:0xe1e,_0x31219a:0xf0a},_0x515d6b=_0x35a251;if(!_0x2985ab)return{'lng':0x0,'lat':0x0};let _0x4ac439={};if(this['isWgs84']){_0x4ac439['lng']=_0x2985ab['lng']/20037508.34*0xb4;const _0x4cc3cd=_0x2985ab['lat']/20037508.34*0xb4;return _0x4ac439['lat']=0xb4/Math['PI']*(0x2*Math['atan'](Math['exp'](_0x4cc3cd*Math['PI']/0xb4))-Math['PI']/0x2),{'lng':_0x4ac439['lng']['toFixed'](0x6),'lat':_0x4ac439['lat'][_0x515d6b(0xf0a)](0x6)};}const _0x377708={'lng':Math[_0x515d6b(_0x981fac._0x4f7f57)](_0x2985ab['lng']),'lat':Math[_0x515d6b(0x405)](_0x2985ab[_0x515d6b(_0x981fac._0x44d322)])};let _0x3a10f4;for(let _0x930f01=0x0;_0x930f01=MC_BAND[_0x930f01]){_0x3a10f4=MC2LL[_0x930f01];break;}}return _0x4ac439=this['convertor'](_0x2985ab,_0x3a10f4),{'lng':_0x4ac439['lng'][_0x515d6b(_0x981fac._0x31219a)](0x6),'lat':_0x4ac439[_0x515d6b(0xb9d)]['toFixed'](0x6)};}[_0x35a251(0x4a9)](_0x2848d5){const _0x59413b={_0x452d7f:0xfa7,_0x3223c3:0x903,_0x559366:0xfa7,_0x18b887:0xb9d,_0x267a9e:0xb9d,_0xddcc6:0xe1e},_0x472413=_0x35a251;if(!_0x2848d5)return{'lng':0x0,'lat':0x0};if(_0x2848d5[_0x472413(_0x59413b._0x452d7f)]>0xb4||_0x2848d5[_0x472413(0xfa7)]<-0xb4||_0x2848d5['lat']>0x5a||_0x2848d5['lat']<-0x5a)return _0x2848d5;if(this['isWgs84']){const _0x1eb9b5={},_0x3d67cc=0x615299;_0x1eb9b5['lng']=_0x2848d5['lng']*Math['PI']/0xb4*_0x3d67cc;const _0x431a0f=_0x2848d5['lat']*Math['PI']/0xb4;return _0x1eb9b5[_0x472413(0xb9d)]=_0x3d67cc/0x2*Math['log']((0x1+Math['sin'](_0x431a0f))/(0x1-Math['sin'](_0x431a0f))),{'lng':parseFloat(_0x1eb9b5['lng']['toFixed'](0x2)),'lat':parseFloat(_0x1eb9b5['lat']['toFixed'](0x2))};}_0x2848d5['lng']=this[_0x472413(_0x59413b._0x3223c3)](_0x2848d5['lng'],-0xb4,0xb4),_0x2848d5['lat']=this['getRange'](_0x2848d5[_0x472413(0xb9d)],-0x4a,0x4a);const _0x2602c0={'lng':_0x2848d5[_0x472413(_0x59413b._0x559366)],'lat':_0x2848d5[_0x472413(_0x59413b._0x18b887)]};let _0x4c271c;for(let _0x5a87de=0x0;_0x5a87de=LL_BAND[_0x5a87de]){_0x4c271c=LL2MC[_0x5a87de];break;}}if(!_0x4c271c)for(let _0x24db23=0x0;_0x24db23_0x43a174){_0x3da06b-=_0x43a174-_0x319bb0;}while(_0x3da06b<_0x319bb0){_0x3da06b+=_0x43a174-_0x319bb0;}return _0x3da06b;}['lngLatToMercator'](_0x4a5a93){const _0x1d371d={_0xcf9a65:0x4a9},_0x4691e4=_0x35a251;return this[_0x4691e4(_0x1d371d._0xcf9a65)](_0x4a5a93);}['lngLatToPoint'](_0x4ce455){const _0x322bb5=this['convertLL2MC'](_0x4ce455);return{'x':_0x322bb5['lng'],'y':_0x322bb5['lat']};}[_0x35a251(0x777)](_0xfb3574){return this['convertMC2LL'](_0xfb3574);}['pointToLngLat'](_0x106e81){const _0x3ecb44={'lng':_0x106e81['x'],'lat':_0x106e81['y']};return this['convertMC2LL'](_0x3ecb44);}['pointToPixel'](_0x15de2a,_0x465d2d,_0x4e9e0b,_0x36c6bb){const _0xa5f587={_0xa05efb:0xca6,_0x28c86e:0xfa7},_0x588903=_0x35a251;if(!_0x15de2a)return{'x':0x0,'y':0x0};_0x15de2a=this[_0x588903(0xd99)](_0x15de2a);const _0x2311ce=this['getZoomUnits'](_0x465d2d),_0x53f39d=Math[_0x588903(_0xa5f587._0xa05efb)]((_0x15de2a[_0x588903(_0xa5f587._0x28c86e)]-_0x4e9e0b[_0x588903(0xfa7)])/_0x2311ce+_0x36c6bb['width']/0x2),_0x18ee61=Math[_0x588903(0xca6)]((_0x4e9e0b['lat']-_0x15de2a['lat'])/_0x2311ce+_0x36c6bb['height']/0x2);return{'x':_0x53f39d,'y':_0x18ee61};}['pixelToPoint'](_0x290e1e,_0x4d1aed,_0x3478db,_0x30583d){const _0x44b7a5={_0x46ed0a:0x777},_0x207e8d=_0x35a251;if(!_0x290e1e)return{'lng':0x0,'lat':0x0};const _0x8b3c61=this['getZoomUnits'](_0x4d1aed),_0x2ca3ec=_0x3478db['lng']+_0x8b3c61*(_0x290e1e['x']-_0x30583d['width']/0x2),_0x12d27a=_0x3478db['lat']-_0x8b3c61*(_0x290e1e['y']-_0x30583d['height']/0x2),_0x4773bb={'lng':_0x2ca3ec,'lat':_0x12d27a};return this[_0x207e8d(_0x44b7a5._0x46ed0a)](_0x4773bb);}['getZoomUnits'](_0x15547a){const _0x2b9eb9={_0x544e19:0xda4},_0x11e8fd=_0x35a251;return Math[_0x11e8fd(_0x2b9eb9._0x544e19)](0x2,0x12-_0x15547a);}}class BaiduMercatorTilingScheme extends Cesium__namespace['WebMercatorTilingScheme']{constructor(_0x32f0fd){const _0x3055bb={_0x21ea86:0xb9d,_0xff4827:0x7c0},_0x1c762f={_0xb8806:0x60c},_0x41e620=_0x35a251;super(_0x32f0fd);const _0x41bd05=_0x32f0fd['mapChinaCRS']||ChinaCRS[_0x41e620(0xf39)],_0xc8d582=ChinaCRS['BAIDU'],_0x1200cc=getTransFun(_0x41bd05,_0xc8d582),_0x358cdc=getTransFun(_0xc8d582,_0x41bd05),_0x232075=new BaiduMercatorProjection();this['_projection']['project']=function(_0xeaea1d,_0x57c5f){const _0x181874=_0x41e620;return _0x57c5f=[Cesium__namespace['Math']['toDegrees'](_0xeaea1d['longitude']),Cesium__namespace[_0x181874(0x7c0)]['toDegrees'](_0xeaea1d['latitude'])],_0x1200cc&&(_0x57c5f=_0x1200cc(_0x57c5f)),_0x57c5f[0x0]=Math['min'](_0x57c5f[0x0],0xb4),_0x57c5f[0x0]=Math['max'](_0x57c5f[0x0],-0xb4),_0x57c5f[0x1]=Math[_0x181874(_0x1c762f._0xb8806)](_0x57c5f[0x1],85.05112877980659),_0x57c5f[0x1]=Math['max'](_0x57c5f[0x1],-85.05112877980659),_0x57c5f=_0x232075[_0x181874(0xef5)]({'lng':_0x57c5f[0x0],'lat':_0x57c5f[0x1]}),new Cesium__namespace['Cartesian2'](_0x57c5f['x'],_0x57c5f['y']);},this['_projection']['unproject']=function(_0x2607ad,_0x4cf3f6){const _0x5397e2=_0x41e620;return _0x4cf3f6=_0x232075['mercatorToLngLat']({'lng':_0x2607ad['x'],'lat':_0x2607ad['y']}),_0x4cf3f6=[_0x4cf3f6['lng'],_0x4cf3f6[_0x5397e2(_0x3055bb._0x21ea86)]],_0x358cdc&&(_0x4cf3f6=_0x358cdc(_0x4cf3f6)),new Cesium__namespace[(_0x5397e2(0x120))](Cesium__namespace[_0x5397e2(_0x3055bb._0xff4827)]['toRadians'](_0x4cf3f6[0x0]),Cesium__namespace['Math']['toRadians'](_0x4cf3f6[0x1]));},this[_0x41e620(0xebe)]=_0x32f0fd[_0x41e620(0xebe)]||[];}['tileXYToNativeRectangle'](_0x353435,_0x17c1d4,_0x49f368,_0x8ed661){const _0x2568fb=_0x35a251,_0x2c6508=this[_0x2568fb(0xebe)][_0x49f368],_0x526f2b=_0x353435*_0x2c6508,_0x4e264d=(_0x353435+0x1)*_0x2c6508,_0x323d47=((_0x17c1d4=-_0x17c1d4)+0x1)*_0x2c6508,_0x3ed137=_0x17c1d4*_0x2c6508;if(!Cesium__namespace[_0x2568fb(0xaa2)](_0x8ed661))return new Cesium__namespace['Rectangle'](_0x526f2b,_0x3ed137,_0x4e264d,_0x323d47);return _0x8ed661['west']=_0x526f2b,_0x8ed661['south']=_0x3ed137,_0x8ed661['east']=_0x4e264d,_0x8ed661['north']=_0x323d47,_0x8ed661;}[_0x35a251(0x3fa)](_0x220655,_0x2ab088,_0xa58db6){const _0x156b3a={_0x4a66ce:0xaa2},_0x35b31c=_0x35a251,_0x4a2e9c=this['_rectangle'];if(!Cesium__namespace['Rectangle'][_0x35b31c(0x341)](_0x4a2e9c,_0x220655))return undefined;const _0x3fcf1e=this['_projection'],_0x1e5fe9=_0x3fcf1e[_0x35b31c(0xed3)](_0x220655);if(!Cesium__namespace['defined'](_0x1e5fe9))return undefined;const _0x598060=this['resolutions'][_0x2ab088],_0x580831=Math[_0x35b31c(0x6ba)](_0x1e5fe9['x']/_0x598060),_0x5f4c17=-Math['floor'](_0x1e5fe9['y']/_0x598060);if(!Cesium__namespace[_0x35b31c(_0x156b3a._0x4a66ce)](_0xa58db6))return new Cesium__namespace['Cartesian2'](_0x580831,_0x5f4c17);return _0xa58db6['x']=_0x580831,_0xa58db6['y']=_0x5f4c17,_0xa58db6;}}class BaiduImageryProvider{constructor(_0x224965={}){const _0x1909c1={_0x376bf1:0xeb6,_0xefd229:0x899,_0x51ae97:0xfc8,_0x2416dc:0xb5e,_0x138ffc:0xccb,_0xe19fe9:0xe59,_0x55a7d9:0x528,_0x1b5cb1:0x2e8,_0x55ffd1:0x134,_0x1576ac:0xab1},_0x5712d1=_0x35a251;let _0xd88903;switch(_0x224965['layer']){case'vec':_0xd88903='https://maponline{s}.bdimg.com/tile/?qt=vtile&x={x}&y={y}&z={z}&styles='+(_0x224965['bigfont']?'ph':'pl')+'&scaler=2&udt=&from=jsapi2_0';break;case'img_d':_0xd88903='https://maponline{s}.bdimg.com/starpic/{s}?u={mars3d_u}',_0x224965['customTags']=_0x224965['customTags']||{},_0x224965['customTags'][_0x5712d1(_0x1909c1._0x376bf1)]=(_0x5c4f3e,_0x4f54a3,_0x4597c2,_0x5ba252)=>{return'x='+_0x4f54a3+';y='+-_0x4597c2+';z='+_0x5ba252+';v=009;type=sate';},_0x224965['queryParameters']={..._0x224965['queryParameters']||{},'qt':'satepc','app':_0x5712d1(0xa62),'udt':_0x5712d1(_0x1909c1._0xefd229),'fm':'46','v':'009'};break;case'img_z':_0xd88903='http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles='+(_0x224965['bigfont']?'sh':'sl')+'&v=020';break;case'custom':_0x224965[_0x5712d1(_0x1909c1._0x51ae97)]=_0x224965['style']||'midnight',_0xd88903='http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid='+_0x224965['style'];break;case'time':_0xd88903='http://its.map.baidu.com:8002/traffic/TrafficTileService?x={x}&y={y}&level={z}&time='+new Date()['getTime']()+_0x5712d1(_0x1909c1._0x2416dc)+(_0x224965['label']||_0x5712d1(_0x1909c1._0x138ffc))+'&v=017';break;case'streetview':_0xd88903='https://gss{s}.bdstatic.com/5LUZemja_QUU8t7mm9GUKT-xh_/tile/?udt=20150114&qt=tile&styles=pl&x={x}&y={y}&z={z}';break;default:_0xd88903=_0x224965[_0x5712d1(0xd05)];break;}this['options']=_0x224965,this['_resource']=getUrlResource({..._0x224965,'url':_0xd88903}),this['_tags']=Cesium__namespace['combine'](tags,this['options'][_0x5712d1(_0x1909c1._0xe19fe9)]),this['_subdomains']=['0','1','2','3'],this[_0x5712d1(0xafe)]=0x100,this[_0x5712d1(_0x1909c1._0x55a7d9)]=0x100,this[_0x5712d1(_0x1909c1._0x1b5cb1)]=0x12;const _0x1fa0b8=[];for(let _0x44f6b7=0x0;_0x44f6b7<0x13;_0x44f6b7++){_0x1fa0b8[_0x44f6b7]=0x100*Math['pow'](0x2,0x12-_0x44f6b7);}this['_tilingScheme']=new BaiduMercatorTilingScheme({'resolutions':_0x1fa0b8,'rectangleSouthwestInMeters':new Cesium__namespace['Cartesian2'](-20037726.37,-12474104.17),'rectangleNortheastInMeters':new Cesium__namespace['Cartesian2'](20037726.37,12474104.17),'mapChinaCRS':_0x224965[_0x5712d1(_0x1909c1._0x55ffd1)]}),this['_rectangle']=this[_0x5712d1(0x7fd)][_0x5712d1(_0x1909c1._0x1576ac)],this['_readyPromise']=Cesium__namespace['defer'](),this[_0x5712d1(0xf79)]=new Cesium__namespace['Event'](),this['_ready']=!![],this['_readyPromise']['resolve'](!![]);}get['url'](){const _0x41f4f2={_0x18421a:0x98a},_0x44b832=_0x35a251;var _0x37945f;return(_0x37945f=this[_0x44b832(_0x41f4f2._0x18421a)])===null||_0x37945f===void 0x0?void 0x0:_0x37945f['url'];}get['tileWidth'](){return this['_tileWidth'];}get['tileHeight'](){return this['_tileHeight'];}get['maximumLevel'](){return this['_maximumLevel'];}get['minimumLevel'](){return 0x0;}get[_0x35a251(0x865)](){return this['_tilingScheme'];}get['rectangle'](){return this['_rectangle'];}get[_0x35a251(0xf6d)](){return this['_ready'];}get[_0x35a251(0x3e2)](){const _0x3dc94e=_0x35a251;return this[_0x3dc94e(0x4ac)]['promise'];}get['errorEvent'](){return this['_errorEvent'];}get['credit'](){return this['_credit'];}get['hasAlphaChannel'](){return!![];}[_0x35a251(0xe69)](_0x5cfda9,_0x3a7789,_0x33aeb1){return undefined;}[_0x35a251(0x4c9)](_0x113940,_0x1a3641,_0x59827f,_0x480c63){const _0xa8ed21={_0x2e44da:0xe18,_0x31145f:0x9ba},_0x485dc1=_0x35a251,_0x5f1f48=this[_0x485dc1(0x98a)],_0x59ccd0=_0x5f1f48['getUrlComponent'](!![]),_0x1d031c=this[_0x485dc1(_0xa8ed21._0x2e44da)],_0x2a4e58={},_0x95d4bb=_0x59ccd0['match'](templateRegex);return Cesium__namespace['defined'](_0x95d4bb)&&_0x95d4bb['forEach'](_0x52bcf4=>{const _0x12850a=_0x52bcf4['substring'](0x1,_0x52bcf4['length']-0x1);Cesium__namespace['defined'](_0x1d031c[_0x12850a])&&(_0x2a4e58[_0x12850a]=_0x1d031c[_0x12850a](this,_0x113940,_0x1a3641,_0x59827f));}),_0x5f1f48[_0x485dc1(_0xa8ed21._0x31145f)]({'request':_0x480c63,'templateValues':_0x2a4e58})['fetchImage']({'preferImageBitmap':!![],'flipY':!![]});}}const templateRegex=/{[^}]+}/g,tags={'x':xTag,'y':yTag,'reverseY':reverseYTag,'z':zTag,'s':sTag};function xTag(_0x327fb2,_0x255314,_0x54bdfe,_0x1cf459){return _0x255314;}function yTag(_0x2f9335,_0x33c0e4,_0x25179f,_0x181f81){return-_0x25179f;}function reverseYTag(_0x1c45af,_0x40e3f6,_0x3066a8,_0x4c8422){const _0x513116=_0x35a251,_0x191555=_0x1c45af[_0x513116(0x865)]['getNumberOfYTilesAtLevel'](_0x4c8422)-_0x3066a8-0x1;return _0x191555;}function zTag(_0x1fd0b8,_0x34e68d,_0xcc2e3c,_0x4f50c4){return _0x4f50c4;}function sTag(_0x2d9931,_0x327dff,_0x5c9f14,_0x3a73f8){const _0x529cf3={_0x2d4a36:0xca7},_0x3ab9de=_0x35a251,_0x378828=(_0x327dff+_0x5c9f14+_0x3a73f8)%_0x2d9931[_0x3ab9de(_0x529cf3._0x2d4a36)]['length'];return _0x2d9931['_subdomains'][_0x378828];}class TencentImageryProvider extends XyzImageryProvider$1{constructor(_0x560365={}){const _0x478342={_0x574354:0xeb8,_0x529fa9:0xe9b,_0x576a90:0x84c,_0x229f2b:0xfc8,_0x172da1:0xfc8,_0xde202d:0x236},_0xc74a90=_0x35a251;switch(_0x560365[_0xc74a90(0x87)]){case _0xc74a90(_0x478342._0x574354):_0x560365['url']='https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1&scene=0';break;case'img_d':_0x560365['url']=_0xc74a90(_0x478342._0x529fa9),_0x560365['customTags']={'sx':(_0x1edce5,_0x44f4b3,_0x450205,_0x2e9f25)=>{return _0x44f4b3>>0x4;},'sy':(_0x3aafbe,_0x45cbe2,_0x5b09a4,_0x30116f)=>{return(0x1<<_0x30116f)-_0x5b09a4>>0x4;}};break;case'img_z':_0x560365['url']='https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=2&scene=0';break;case _0xc74a90(_0x478342._0x576a90):_0x560365['style']=_0x560365[_0xc74a90(_0x478342._0x229f2b)]||'4',_0x560365['url']=_0xc74a90(0xc54)+_0x560365[_0xc74a90(_0x478342._0x172da1)]+'&scene=0';break;}_0x560365['subdomains']=_0x560365[_0xc74a90(_0x478342._0xde202d)]??['0','1','2'],super(_0x560365);}}class GoogleImageryProvider extends XyzImageryProvider$1{constructor(_0x268ab8={}){const _0x24d22c={_0x2cbbb9:0xe77,_0x137d7e:0xa88,_0x21c2b4:0xa4e},_0x46bfa5=_0x35a251;let _0x56db19;if(_0x268ab8['chinaCRS']===ChinaCRS['WGS84'])_0x56db19=_0x268ab8['url']||'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&gl=us&x={x}&y={y}&z={z}';else switch(_0x268ab8[_0x46bfa5(0x87)]){case'vec':_0x56db19=_0x46bfa5(0x7f8);break;case _0x46bfa5(_0x24d22c._0x2cbbb9):_0x56db19='https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&gl=CN&x={x}&y={y}&z={z}';break;case'img_z':_0x56db19=_0x46bfa5(_0x24d22c._0x137d7e);break;case'ter':_0x56db19='https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&gl=CN&x={x}&y={y}&z={z}';break;default:_0x56db19=_0x268ab8['url'];break;}(_0x268ab8['proxy']||_0x268ab8[_0x46bfa5(0xdc0)]||_0x268ab8['queryParameters'])&&(_0x56db19=getUrlResource({'url':_0x56db19[_0x46bfa5(0x20e)](_0x46bfa5(0xfc6),'1'),'proxy':_0x268ab8['proxy'],'headers':_0x268ab8[_0x46bfa5(0xdc0)],'queryParameters':_0x268ab8[_0x46bfa5(_0x24d22c._0x21c2b4)]})),super({'subdomains':['1','2','3'],'maximumLevel':0x14,..._0x268ab8,'url':_0x56db19});}}class OsmImageryProvider extends XyzImageryProvider$1{constructor(_0x14fe8f={}){let _0x4d4eeb='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';(_0x14fe8f['proxy']||_0x14fe8f['headers']||_0x14fe8f['queryParameters'])&&(_0x4d4eeb=getUrlResource({'url':_0x4d4eeb['replace']('{s}','a'),'proxy':_0x14fe8f['proxy'],'headers':_0x14fe8f['headers'],'queryParameters':_0x14fe8f['queryParameters']})),super({'subdomains':'abc','maximumLevel':0x12,..._0x14fe8f,'url':_0x4d4eeb});}}class EmptyImageryProvider extends Cesium__namespace['TileCoordinatesImageryProvider']{constructor(_0x227b2b={}){const _0x53a14c={_0x44eb57:0x507,_0x1bcf09:0x23a,_0x6ff8ae:0xd70,_0x28f178:0xd6},_0xc771f=_0x35a251;super(_0x227b2b),this['options']=_0x227b2b,this[_0xc771f(_0x53a14c._0x44eb57)]=_0x227b2b[_0xc771f(_0x53a14c._0x1bcf09)]??0x0,this['_maximumLevel']=_0x227b2b['maximumLevel'],this['_tilingScheme']=_0x227b2b['tilingScheme']??new Cesium__namespace[(_0xc771f(_0x53a14c._0x6ff8ae))]({'ellipsoid':_0x227b2b[_0xc771f(0x3f4)]}),_0x227b2b['rectangle']?this['_rectangle']=Cesium__namespace[_0xc771f(_0x53a14c._0x28f178)]['intersection'](_0x227b2b[_0xc771f(0xab1)],this['_tilingScheme']['rectangle']):this['_rectangle']=this['_tilingScheme'][_0xc771f(0xab1)],this['options']=_0x227b2b;}['requestImage'](_0x3f1906,_0x439479,_0x5bd8ea){const _0xe04bd6={_0x585c4b:0x507,_0xcbf605:0x5bf};return new Promise((_0x332922,_0x222292)=>{const _0x463e55=_0x2767,_0x329edd=document['createElement']('canvas');_0x329edd['width']=0x100,_0x329edd['height']=0x100;if(_0x5bd8eathis['_maximumLevel'])return _0x329edd;if(this['options']['debuggerTileInfo']){const _0x293c0d=_0x329edd[_0x463e55(_0xe04bd6._0xcbf605)]('2d',{'willReadFrequently':!![]});_0x293c0d['strokeStyle']='#ffff00',_0x293c0d['lineWidth']=0x2,_0x293c0d['strokeRect'](0x1,0x1,0xff,0xff);const _0x5833ab='L'+_0x5bd8ea+'X'+_0x3f1906+'Y'+_0x439479;_0x293c0d['font']='bold\x2025px\x20Arial',_0x293c0d['textAlign']='center',_0x293c0d['fillStyle']=_0x463e55(0xee5),_0x293c0d[_0x463e55(0x20a)](_0x5833ab,0x7f,0x7f),_0x293c0d[_0x463e55(0x4b0)]='#ffff00',_0x293c0d['fillText'](_0x5833ab,0x7c,0x7c);}_0x332922(_0x329edd);});}}var index$5={'__proto__':null,'XyzImageryProvider':XyzImageryProvider$1,'TdtImageryProvider':TdtImageryProvider,'GaodeImageryProvider':GaodeImageryProvider,'BaiduImageryProvider':BaiduImageryProvider,'TencentImageryProvider':TencentImageryProvider,'GoogleImageryProvider':GoogleImageryProvider,'OsmImageryProvider':OsmImageryProvider,'EmptyImageryProvider':EmptyImageryProvider};class GroupLayer extends BaseGraphicLayer{constructor(_0x4098dd={}){super(_0x4098dd),this['_arrLayer']=[];}get['layer'](){return this['_arrLayer'];}get['arrLayer'](){return this['_arrLayer'];}get['hasEmptyGroup'](){return this['length']===0x0;}get[_0x35a251(0x977)](){const _0x1efad5={_0x491789:0xe1e},_0x473c75=_0x35a251;return this[_0x473c75(_0x1efad5._0x491789)]>0x0;}get['length'](){const _0x507f9d={_0xe85932:0xe86,_0x124187:0xba0,_0x303add:0xe1e},_0x2308a9=_0x35a251;var _0xf5f84d,_0x4f36c0;if(((_0xf5f84d=this['options'])===null||_0xf5f84d===void 0x0?void 0x0:(_0x4f36c0=_0xf5f84d['layers'])===null||_0x4f36c0===void 0x0?void 0x0:_0x4f36c0['length'])>0x0)return this[_0x2308a9(_0x507f9d._0xe85932)][_0x2308a9(0x658)]['length'];else{var _0x17c057;return((_0x17c057=this[_0x2308a9(_0x507f9d._0x124187)])===null||_0x17c057===void 0x0?void 0x0:_0x17c057[_0x2308a9(_0x507f9d._0x303add)])||0x0;}}get[_0x35a251(0xddf)](){const _0x47fbd7={_0x2a6ea5:0xddf},_0x3e9fd1=_0x35a251;if(this['_arrLayer']['length']===0x0)return![];return this['_arrLayer'][0x0][_0x3e9fd1(_0x47fbd7._0x2a6ea5)];}get['hasZIndex'](){const _0x5d23d9={_0x320b5d:0xe1e},_0x41ed1e=_0x35a251;if(this['_arrLayer'][_0x41ed1e(_0x5d23d9._0x320b5d)]===0x0)return![];return this[_0x41ed1e(0xba0)][0x0]['hasZIndex'];}get['zIndex'](){const _0x53d631=_0x35a251;return this['options'][_0x53d631(0x31f)];}set[_0x35a251(0x31f)](_0x57cf87){this['options']['zIndex']=_0x57cf87,this['eachLayer'](_0x501a05=>{const _0x2f48f9=_0x2767;_0x501a05['hasZIndex']&&(_0x501a05[_0x2f48f9(0x31f)]=_0x57cf87);},this);}[_0x35a251(0xa40)](_0xed1e66){this['eachLayer'](_0x1f3daf=>{_0x1f3daf['show']=_0xed1e66;},this);}['_mountedHook'](){const _0x36c707={_0x41c690:0xe1e},_0x4b3296=_0x35a251;super[_0x4b3296(0x700)]();const _0x444b84=this[_0x4b3296(0xe86)]['layers'];if(_0x444b84&&_0x444b84[_0x4b3296(_0x36c707._0x41c690)]>0x0)for(let _0x1679ac=0x0;_0x1679ac<_0x444b84['length'];_0x1679ac++){const _0x37055d=_0x444b84[_0x1679ac];_0x37055d['eventParent']=this,_0x37055d['private']=this['isPrivate'];const _0x534e2c=create$2(_0x37055d,this['options']['templateValues']);_0x534e2c&&this['addLayer'](_0x534e2c);}}['_addedHook'](){const _0x2c68d0={_0x35449f:0x86c},_0x4350d5=_0x35a251,_0x5f9bf8=[];this['eachLayer'](_0x173b64=>{const _0xc64486=_0x2767;_0x173b64['eventParent']=this,this['_map']['addLayer'](_0x173b64),_0x5f9bf8['push'](_0x173b64[_0xc64486(0x3e2)]);},this),Promise['all'](_0x5f9bf8)[_0x4350d5(_0x2c68d0._0x35449f)](_0xe19711=>{this['_readyPromise']['resolve'](this);});}['_removedHook'](){this['removeMapChilds']();}['addChildsToMap'](){this['eachLayer'](_0x571cdd=>{this['_map']['addLayer'](_0x571cdd);},this);}['removeMapChilds'](){const _0x3a1536={_0x74aa99:0xd79};this['eachLayer'](_0x112197=>{const _0x4f3331=_0x2767;this[_0x4f3331(_0x3a1536._0x74aa99)][_0x4f3331(0xad7)](_0x112197);},this);}['addLayer'](_0x2fbb48){const _0xe39f58={_0x1723e4:0xd79},_0x30ac99=_0x35a251;return _0x2fbb48['parent']&&(_0x2fbb48['removeEventParent'](_0x2fbb48['parent']),_0x2fbb48['parent']=null),_0x2fbb48['pid']=this['id'],_0x2fbb48['parent']=this,_0x2fbb48['options']['eventParent']=this,this['_arrLayer'][_0x30ac99(0x6de)](_0x2fbb48),this['isAdded']&&!_0x2fbb48[_0x30ac99(0x47f)]?this['_map'][_0x30ac99(0x6f7)](_0x2fbb48):(_0x2fbb48['removeEventParent'](this[_0x30ac99(_0xe39f58._0x1723e4)]),_0x2fbb48['addEventParent'](this)),this;}[_0x35a251(0xad7)](_0x233a87){const _0x1befa6={_0x333089:0xba0},_0x273b1d=_0x35a251;return _0x233a87['parent']=null,_0x233a87['removeEventParent'](this),removeArrayItem(this[_0x273b1d(_0x1befa6._0x333089)],_0x233a87),this[_0x273b1d(0xd79)]&&_0x233a87[_0x273b1d(0x47f)]&&this['_map']['removeLayer'](_0x233a87),this;}['eachLayer'](_0x1726af,_0x9ea9ff){if(!this['_arrLayer'])return;return this['_arrLayer']['forEach'](_0x5e97eb=>{_0x1726af['call'](_0x9ea9ff,_0x5e97eb);}),this;}['getLayers'](){return this['_arrLayer'];}['getInMapChilds'](){const _0x307e62=_0x35a251,_0x38e689=this[_0x307e62(0xba0)]||[];return this['_map']['eachLayer'](_0x5f1d75=>{const _0x1cb49b=_0x307e62;if(_0x5f1d75['pid']!==this['id'])return;if(this[_0x1cb49b(0xba0)]['indexOf'](_0x5f1d75)!==-0x1)return;_0x38e689['push'](_0x5f1d75);},this),_0x38e689;}[_0x35a251(0x57e)](_0x2039b7){const _0x31f49b={_0x461f8f:0xba0},_0x3ddcba=_0x35a251,_0x453418=this[_0x3ddcba(_0x31f49b._0x461f8f)];if(!this['_arrLayer']||this['_arrLayer'][_0x3ddcba(0xe1e)]===0x0)return;for(let _0x2e5478=0x0,_0x25600f=_0x453418['length'];_0x2e5478<_0x25600f;_0x2e5478++){const _0x1a2fd2=_0x453418[_0x2e5478];if(_0x1a2fd2['id']===_0x2039b7)return _0x1a2fd2;}return undefined;}['getLayer'](_0x4e73d4){const _0x2f2ad8={_0x3a6ea9:0xba0},_0x1a8bc=_0x35a251;if(!this[_0x1a8bc(_0x2f2ad8._0x3a6ea9)]||this['_arrLayer'][_0x1a8bc(0xe1e)]===0x0)return undefined;for(let _0x3b5ca8=0x0;_0x3b5ca8{_0x47569d['push'](_0x34e4ad['toJSON']());},this),_0x47569d['length']>0x0&&(_0x26fafb['layers']=_0x47569d);}['getRectangle'](_0x1735e9){const _0x55e0d7={_0x3fec56:0xdbd},_0x322047=_0x35a251;let _0x1f4573;const _0x31b071=this[_0x322047(0x2f0)]();return _0x31b071[_0x322047(_0x55e0d7._0x3fec56)](_0xfeeaa2=>{const _0x7bac71=_0x322047;if(!_0xfeeaa2['getRectangle'])return;const _0x4ec647=_0xfeeaa2['getRectangle']();if(!Cesium__namespace['defined'](_0x4ec647))return;_0x1f4573?_0x1f4573=Cesium__namespace['Rectangle'][_0x7bac71(0xd8c)](_0x4ec647,_0x1f4573):_0x1f4573=_0x4ec647;},this),_0x1735e9?formatRectangle(_0x1f4573):_0x1f4573;}['setOpacity'](_0x57f224){const _0x5b2311={_0xeef280:0xe70},_0x383d84={_0x23b73d:0xbf2},_0x4034ad=_0x35a251;this[_0x4034ad(_0x5b2311._0xeef280)](_0x315b15=>{const _0xcb154f=_0x4034ad;_0x315b15[_0xcb154f(_0x383d84._0x23b73d)]=_0x57f224;},this);}['toTop'](){const _0x4f29d4={_0x5dd9b6:0xb7f};this['eachLayer'](_0x3688eb=>{const _0x2b25ad=_0x2767;_0x3688eb[_0x2b25ad(_0x4f29d4._0x5dd9b6)]();},this);}['toBottom'](){const _0x186553=_0x35a251,_0xe4f38e=this[_0x186553(0xba0)];for(let _0x1e1554=_0xe4f38e['length']-0x1;_0x1e1554>=0x0;_0x1e1554--){const _0x5db447=_0xe4f38e[_0x1e1554];_0x5db447['toBottom']();}}[_0x35a251(0xa63)](_0x3ee3ab){const _0x17e220=_0x35a251;this[_0x17e220(0xe70)](_0x41554b=>{_0x41554b!==null&&_0x41554b!==void 0x0&&_0x41554b['destroy']&&_0x41554b['destroy'](_0x3ee3ab);},this),super['destroy'](_0x3ee3ab);}}register$2('group',GroupLayer);class BaseTileLayer extends BaseLayer{constructor(_0x2c3155={}){super(_0x2c3155),this['_setRectangleByOptions'](_0x2c3155),this['isTile']=!![];}get['layer'](){return this['_imageryLayer'];}get['imageryProvider'](){var _0x5340be;return(_0x5340be=this['_imageryLayer'])===null||_0x5340be===void 0x0?void 0x0:_0x5340be['imageryProvider'];}get['crs'](){return this['options']['crs']||CRS['EPSG3857'];}get['alpha'](){return this['opacity'];}set[_0x35a251(0x1f4)](_0x29383d){this['opacity']=_0x29383d;}get['brightness'](){const _0x10477f=_0x35a251;var _0x1a0e6a;return this['options']['brightness']||((_0x1a0e6a=this['_imageryLayer'])===null||_0x1a0e6a===void 0x0?void 0x0:_0x1a0e6a[_0x10477f(0xbc0)]);}set['brightness'](_0x19be69){const _0x5763d9=_0x35a251;this[_0x5763d9(0xe86)]['brightness']=_0x19be69;if(this['_imageryLayer']==null)return;this['_imageryLayer']['brightness']=_0x19be69;}get['contrast'](){const _0x4bf368={_0x1feab4:0xd50},_0x5c3d55=_0x35a251;var _0x176fa5;return this['options'][_0x5c3d55(_0x4bf368._0x1feab4)]||((_0x176fa5=this['_imageryLayer'])===null||_0x176fa5===void 0x0?void 0x0:_0x176fa5['contrast']);}set['contrast'](_0x552592){this['options']['contrast']=_0x552592;if(this['_imageryLayer']==null)return;this['_imageryLayer']['contrast']=_0x552592;}get['hue'](){const _0x2f9f81=_0x35a251;var _0x5c699a;return this['options']['hue']||((_0x5c699a=this['_imageryLayer'])===null||_0x5c699a===void 0x0?void 0x0:_0x5c699a[_0x2f9f81(0x902)]);}set['hue'](_0x3e95ee){const _0x26011c={_0x55b4d6:0x902,_0xb6ba0f:0x70d},_0x25370a=_0x35a251;this['options'][_0x25370a(_0x26011c._0x55b4d6)]=_0x3e95ee;if(this[_0x25370a(_0x26011c._0xb6ba0f)]==null)return;this['_imageryLayer']['hue']=_0x3e95ee;}get['saturation'](){var _0x1f8c96;return this['options']['saturation']||((_0x1f8c96=this['_imageryLayer'])===null||_0x1f8c96===void 0x0?void 0x0:_0x1f8c96['saturation']);}set['saturation'](_0x2948b7){const _0x4d4dd0=_0x35a251;this[_0x4d4dd0(0xe86)]['saturation']=_0x2948b7;if(this['_imageryLayer']==null)return;this['_imageryLayer']['saturation']=_0x2948b7;}get['gamma'](){var _0x275f68;return this['options']['gamma']||((_0x275f68=this['_imageryLayer'])===null||_0x275f68===void 0x0?void 0x0:_0x275f68['gamma']);}set['gamma'](_0x2aeec4){const _0x418964={_0x4315df:0xe86},_0x11cd6c=_0x35a251;this[_0x11cd6c(_0x418964._0x4315df)]['gamma']=_0x2aeec4;if(this['_imageryLayer']==null)return;this['_imageryLayer']['gamma']=_0x2aeec4;}get['hasZIndex'](){return!![];}get['zIndex'](){return this['options']['zIndex'];}set['zIndex'](_0x2a51a5){const _0x686884={_0xbe0844:0xd79,_0x49ebc4:0xf66,_0x58f619:0xcfd,_0x66ca55:0x31f,_0x5f04ec:0xd79},_0x2f567c=_0x35a251;this['options']['zIndex']=_0x2a51a5;if(this['_imageryLayer']==null||_0x2a51a5==null)return;this[_0x2f567c(_0x686884._0xbe0844)]['imageryLayers']['raiseToTop'](this['_imageryLayer']);const _0x1b3399=this['_map'][_0x2f567c(_0x686884._0x49ebc4)]['_layers'];for(let _0x16bfc2=_0x1b3399['length']-0x1;_0x16bfc2>=0x0;_0x16bfc2--){const _0x54881c=_0x1b3399[_0x16bfc2];if(_0x54881c===this['_imageryLayer'])continue;const _0x2aec40=_0x54881c[_0x2f567c(_0x686884._0x58f619)];_0x2aec40&&_0x2aec40['zIndex']&&(_0x2a51a5<_0x2aec40[_0x2f567c(_0x686884._0x66ca55)]&&this[_0x2f567c(_0x686884._0x5f04ec)][_0x2f567c(0xf66)]['lower'](this['_imageryLayer']));}}get['rectangle'](){const _0x19c5cb={_0x31beac:0xc02,_0x1fe6de:0xab1,_0x519917:0xefa,_0x3ff6e8:0xab1},_0x3d9994=_0x35a251;var _0xc99e8b,_0x5504eb;if(this[_0x3d9994(_0x19c5cb._0x31beac)])return this['_rectangle'];else return(_0xc99e8b=this['_imageryLayer'])!==null&&_0xc99e8b!==void 0x0&&(_0x5504eb=_0xc99e8b[_0x3d9994(0xefa)])!==null&&_0x5504eb!==void 0x0&&_0x5504eb[_0x3d9994(_0x19c5cb._0x1fe6de)]?this['_imageryLayer'][_0x3d9994(_0x19c5cb._0x519917)][_0x3d9994(_0x19c5cb._0x3ff6e8)]:null;}set['rectangle'](_0xe5189e){const _0x43f38b={_0x4771d7:0x70d,_0x233856:0xefa,_0x4cc9d6:0xab1},_0x116d6e=_0x35a251;if(_0xe5189e){if(_0xe5189e instanceof Cesium__namespace['Rectangle']){var _0x2f5dd6,_0x2ff030;this['_rectangle']=_0xe5189e,this['options']['rectangle']=formatRectangle(this['_rectangle']),(_0x2f5dd6=this['_imageryLayer'])!==null&&_0x2f5dd6!==void 0x0&&(_0x2ff030=_0x2f5dd6['imageryProvider'])!==null&&_0x2ff030!==void 0x0&&_0x2ff030['rectangle']&&(this[_0x116d6e(_0x43f38b._0x4771d7)][_0x116d6e(_0x43f38b._0x233856)]['_rectangle']=this['_rectangle']);}}else this['_rectangle']=undefined,delete this[_0x116d6e(0xe86)][_0x116d6e(_0x43f38b._0x4cc9d6)],this['reload']();}[_0x35a251(0x118)](_0x5872d4){const _0x1e8fc6={_0x466ce7:0xaa2,_0x597f2b:0x15b,_0x161131:0xc02,_0x56f01b:0x7d6},_0xa95ca5=_0x35a251;if(Cesium__namespace['defined'](_0x5872d4['rectangle'])){if(Cesium__namespace['defined'](_0x5872d4['rectangle']['xmin'])&&Cesium__namespace[_0xa95ca5(_0x1e8fc6._0x466ce7)](_0x5872d4['rectangle'][_0xa95ca5(0x1db)])&&Cesium__namespace['defined'](_0x5872d4[_0xa95ca5(0xab1)][_0xa95ca5(_0x1e8fc6._0x597f2b)])&&Cesium__namespace['defined'](_0x5872d4[_0xa95ca5(0xab1)]['ymax']))this[_0xa95ca5(0xc02)]=Cesium__namespace['Rectangle']['fromDegrees'](_0x5872d4['rectangle']['xmin'],_0x5872d4['rectangle']['ymin'],_0x5872d4['rectangle']['xmax'],_0x5872d4['rectangle']['ymax']);else _0x5872d4['rectangle']instanceof Cesium__namespace['Rectangle']?this['_rectangle']=_0x5872d4['rectangle']:delete _0x5872d4['rectangle'];}else Cesium__namespace[_0xa95ca5(_0x1e8fc6._0x466ce7)](_0x5872d4['bbox'])&&_0x5872d4['bbox']['length']&&_0x5872d4['bbox'][_0xa95ca5(0xe1e)]===0x4?this[_0xa95ca5(_0x1e8fc6._0x161131)]=Cesium__namespace['Rectangle']['fromDegrees'](_0x5872d4['bbox'][0x0],_0x5872d4[_0xa95ca5(0x7d6)][0x1],_0x5872d4[_0xa95ca5(_0x1e8fc6._0x56f01b)][0x2],_0x5872d4['bbox'][0x3]):this[_0xa95ca5(0xc02)]=undefined;}['_setOptionsHook'](_0x3c7a9a,_0x4e53fb){const _0x2f0d77={_0xb961ed:0x70b},_0xec81a7=_0x35a251;this['_setRectangleByOptions'](_0x3c7a9a),this[_0xec81a7(_0x2f0d77._0xb961ed)]();}async['_createImageryProvider'](_0x3d7f22){return new Cesium__namespace['UrlTemplateImageryProvider'](_0x3d7f22);}['_addedHook'](){const _0x126dab={_0x2bf02c:0xd79,_0x53d603:0xaa2,_0x5b52fa:0x70d,_0x23c0b1:0xe86,_0x1ac137:0xe86,_0x5d551d:0xa34,_0x42cb37:0x716,_0x4581a4:0xf0d,_0x5a78ef:0x5ac,_0x2f7362:0xc74},_0x54f736={_0x284d28:0x823},_0x2bede2={_0x113218:0x264},_0x31beea=_0x35a251;var _0x22ffcd,_0x238c64,_0x87e954;this['options']['highlight']&&(this['options']['enablePickFeatures']=!![]);const _0x1fdd9d=this['_createImageryProvider']({...this['options'],'rectangle':this['rectangle'],'mapChinaCRS':this[_0x31beea(_0x126dab._0x2bf02c)]['chinaCRS']});if(!Cesium__namespace[_0x31beea(_0x126dab._0x53d603)](_0x1fdd9d))return;const _0x15003b=this['options'],_0x22d1bc={'show':this['show'],'alpha':this['opacity'],..._0x15003b,'rectangle':this['rectangle'],'marsOptions':{'onAddTile':_0x3b9e97=>{const _0x144d4e=this['_getTileEventParams'](_0x3b9e97);this['fire'](EventType['addTile'],_0x144d4e);},'onAddTileSuccess':_0x2bb0b8=>{const _0x4a1b70=_0x31beea,_0x570efb=this['_getTileEventParams'](_0x2bb0b8);this[_0x4a1b70(_0x2bede2._0x113218)](EventType['addTileSuccess'],_0x570efb);},'onAddTileError':_0x3e93b6=>{const _0x2bc87e=_0x31beea,_0x2c8b25=this[_0x2bc87e(0x823)](_0x3e93b6);this['fire'](EventType[_0x2bc87e(0xded)],_0x2c8b25);},'onRemoveTile':_0x3e99f7=>{const _0x1e2481=_0x31beea,_0x1133bb=this[_0x1e2481(_0x54f736._0x284d28)](_0x3e99f7);this['fire'](EventType['removeTile'],_0x1133bb);}}};this['_imageryLayer']=Cesium__namespace[_0x31beea(0x9cf)]['fromProviderAsync'](_0x1fdd9d,_0x22d1bc),this[_0x31beea(_0x126dab._0x5b52fa)][_0x31beea(0x6ed)]=this['id'],this[_0x31beea(_0x126dab._0x5b52fa)][_0x31beea(0xcfd)]=this[_0x31beea(_0x126dab._0x23c0b1)];this[_0x31beea(_0x126dab._0x1ac137)]['clampToTileset']&&this[_0x31beea(0xd79)]['imageryLayersForClamp']&&_0x22d1bc[_0x31beea(_0x126dab._0x5d551d)]!==CRS['EPSG3857']?this['_map']['imageryLayersForClamp'][_0x31beea(0x4af)](this['_imageryLayer']):this[_0x31beea(0xd79)]['imageryLayers']['add'](this[_0x31beea(0x70d)]);this['options']['zIndex']&&(this['zIndex']=this['options']['zIndex']);if(this['options'][_0x31beea(_0x126dab._0x42cb37)])this['options'][_0x31beea(_0x126dab._0x4581a4)]=!![],this['bindHighlight'](this['options'][_0x31beea(0x716)]);else(_0x22ffcd=this['options'][_0x31beea(0x357)])!==null&&_0x22ffcd!==void 0x0&&(_0x238c64=_0x22ffcd[_0x31beea(_0x126dab._0x5a78ef)])!==null&&_0x238c64!==void 0x0&&_0x238c64['highlight']&&this['bindHighlight'](this['options']['symbol']['styleOptions']['highlight']);(_0x87e954=this['options'])!==null&&_0x87e954!==void 0x0&&_0x87e954['flyTo']&&this['flyToByAnimationEnd'](),this['_readyPromise'][_0x31beea(_0x126dab._0x2f7362)](this),this['fire'](EventType['load'],{},!![]);}['_getTileEventParams'](_0x36ccfe){return{'x':_0x36ccfe['x'],'y':_0x36ccfe['y'],'level':_0x36ccfe['level'],'extent':formatRectangle(_0x36ccfe['rectangle'])};}['_removedHook'](){const _0x331585={_0x5df3d1:0x428,_0x4f06fa:0x1ee,_0x497b08:0x70d},_0x2926ab=_0x35a251;var _0x2fc0ad,_0x313e8a;this[_0x2926ab(_0x331585._0x5df3d1)](),(_0x2fc0ad=this['_imageryLayer'])!==null&&_0x2fc0ad!==void 0x0&&(_0x313e8a=_0x2fc0ad['imageryProvider'])!==null&&_0x313e8a!==void 0x0&&_0x313e8a[_0x2926ab(0xa63)]&&this[_0x2926ab(0x70d)][_0x2926ab(0xefa)]['destroy'](),this['_map']['imageryLayers'][_0x2926ab(_0x331585._0x4f06fa)](this['_imageryLayer'],!![]),this[_0x2926ab(_0x331585._0x497b08)]=null;}['reload'](){const _0xc7f422={_0x5166cf:0xe86,_0x4460d3:0x64a},_0x5a9acf=_0x35a251,_0x517c32=this['options']['flyTo']??![];this[_0x5a9acf(0x70d)]&&this['_removedHook'](),this['isAdded']&&(this[_0x5a9acf(_0xc7f422._0x5166cf)]['flyTo']=![],this[_0x5a9acf(0x1fd)](EventType[_0x5a9acf(_0xc7f422._0x4460d3)],()=>{const _0x140f82=_0x5a9acf;this['options'][_0x140f82(0x5b2)]=_0x517c32;}),this['_addedHook']());}['setOpacity'](_0x6d5b34){const _0x3542aa={_0x4d1864:0x70d},_0x7df0f3=_0x35a251;this[_0x7df0f3(0x70d)]&&(this[_0x7df0f3(_0x3542aa._0x4d1864)]['alpha']=_0x6d5b34);}['toTop'](){const _0xd5163c={_0x4ef26a:0xd79,_0x35bf01:0xf66},_0x1ae102=_0x35a251;if(this[_0x1ae102(_0xd5163c._0x4ef26a)])return this[_0x1ae102(0xd79)][_0x1ae102(_0xd5163c._0x35bf01)]['raiseToTop'](this[_0x1ae102(0x70d)]);}['toBottom'](){const _0x30a79b={_0x534d75:0xd79},_0x1a1898=_0x35a251;if(this[_0x1a1898(_0x30a79b._0x534d75)])return this['_map'][_0x1a1898(0xf66)]['lowerToBottom'](this[_0x1a1898(0x70d)]);}['flyTo'](_0xc574d7={}){const _0x5a4fcb={_0x76fd5d:0xd79,_0x13c854:0x1fa},_0xdf3fe7=_0x35a251;if(!this['_map']||!this['_imageryLayer'])return Promise['resolve'](![]);this[_0xdf3fe7(_0x5a4fcb._0x76fd5d)][_0xdf3fe7(0x978)]();this['options']['flyToOptions']&&(_0xc574d7={...this[_0xdf3fe7(0xe86)]['flyToOptions'],..._0xc574d7});if(this['options']['center'])return this['_map']['setCameraView'](this['options']['center'],_0xc574d7);else{if(this['options'][_0xdf3fe7(_0x5a4fcb._0x13c854)])return this['_map']['flyToExtent'](this['options'][_0xdf3fe7(0x1fa)],_0xc574d7);else{const _0x18a0fe=this['rectangle'];if(Cesium__namespace['defined'](_0x18a0fe)&&_0x18a0fe['equals']&&!_0x18a0fe['equals'](Cesium__namespace['Rectangle']['MAX_VALUE'])&&_0x18a0fe['west']>0x0&&_0x18a0fe['south']>0x0&&_0x18a0fe['east']>0x0&&_0x18a0fe['north']>0x0)return this['_map']['camera']['flyTo']({..._0xc574d7,'destination':_0x18a0fe});}}return Promise['resolve'](![]);}['bindHighlight'](_0x4f2b36){const _0x40d932={_0x1b11e1:0xfb4},_0x484bfa=_0x35a251;this[_0x484bfa(0x428)](),this[_0x484bfa(0x3eb)]=_0x4f2b36,this['on'](EventType[_0x484bfa(_0x40d932._0x1b11e1)],this['_highlight_mouseEventHandler'],this);}['unbindHighlight'](){const _0x52a33c={_0x282274:0x3eb,_0x305e8a:0x3ca},_0x3298d7=_0x35a251;this[_0x3298d7(_0x52a33c._0x282274)]&&(this[_0x3298d7(0x6b2)](EventType['click'],this['_highlight_mouseEventHandler'],this),this['_map'][_0x3298d7(_0x52a33c._0x305e8a)](),this['_highlightOptions']=null);}[_0x35a251(0x16e)](_0x179d71){const _0x1e9a91=_0x35a251;this['_map'][_0x1e9a91(0x3ca)]();const _0x223a6e=_0x179d71['graphics'];_0x223a6e&&(this['_last_graphicsOptions']=_0x223a6e,this['_map']['openHighlight'](this,this['_highlightOptions'],_0x179d71));}[_0x35a251(0xd47)](_0x426c2a){this['_map']['closeHighlight']();}[_0x35a251(0xaf0)](_0x148575,_0x42232a=!![]){const _0x13fb07={_0x3ad483:0x22d,_0x206436:0x6f7},_0x57977f=_0x35a251;_0x42232a&&(this['_map']['closeHighlight'](),this['_map']['last_highlighGraphic']=this);const _0x576259=_0x148575||this['_highlightOptions'];this[_0x57977f(_0x13fb07._0x3ad483)]&&_0x576259&&(!this['_graphicLayer']&&(this['_graphicLayer']=new GraphicLayer({'name':'高亮对象图层','private':!![]}),this['_map'][_0x57977f(_0x13fb07._0x206436)](this['_graphicLayer'])),this['_graphicLayer']['addGraphic'](this['_last_graphicsOptions']),this[_0x57977f(0x264)](EventType['highlightOpen'],{},!![]));}['closeHighlight'](){const _0x42c6e7={_0x58a05f:0x77b},_0x1622f1=_0x35a251;var _0x1002e3;if(!this['_graphicLayer']||((_0x1002e3=this['_map'])===null||_0x1002e3===void 0x0?void 0x0:_0x1002e3[_0x1622f1(0x91b)])!==this)return;this['_graphicLayer']['clear'](),this['_map']['_clearLastHighlight'](),this[_0x1622f1(0x264)](EventType[_0x1622f1(_0x42c6e7._0x58a05f)],{},!![]);}}class TerrainLayer extends BaseLayer{[_0x35a251(0xa40)](_0x2cb60b){_0x2cb60b?this['_addedHook']():this['_removedHook']();}[_0x35a251(0x700)](){const _0x474246=_0x35a251;this['_terrainProviderPromise']=createTerrainProvider(this[_0x474246(0x75f)]());}[_0x35a251(0x75f)](){const _0x6c03df={_0xad7465:0xe17},_0x49f9da=_0x35a251,_0xa50f8e={'templateValues':this[_0x49f9da(0xe86)][_0x49f9da(0xa0a)],...this['options'][_0x49f9da(_0x6c03df._0xad7465)]};return _0xa50f8e;}[_0x35a251(0x97b)](){const _0x1b752b=_0x35a251;this['show']&&this[_0x1b752b(0xc62)]();}['_removedHook'](){this['_map']['terrainProvider']=getNoTerrainProvider();}['_setOptionsHook'](_0x27218e,_0x179826){const _0x16bb00={_0x4c2c99:0x59c,_0x18ee4d:0xc62},_0x23bce9=_0x35a251;this[_0x23bce9(_0x16bb00._0x4c2c99)]=createTerrainProvider(this['_getTerrainOptions']()),this[_0x23bce9(_0x16bb00._0x18ee4d)]();}['_updateTerrainProvider'](){const _0x586724={_0x54f8b5:0xee},_0x3a6714={_0x3364b7:0x550,_0x171615:0x64a},_0x61ca00=_0x35a251,_0xbd2cbf=_0x1933fb=>{const _0x2feca2=_0x2767;this['_map']['off'](EventType['terrainLoadSuccess'],_0xbd2cbf),this['_map']['off'](EventType[_0x2feca2(_0x3a6714._0x3364b7)],_0x173773),this['_readyPromise']['resolve'](this),this['fire'](EventType[_0x2feca2(_0x3a6714._0x171615)],{'terrain':this['_map']['terrainProvider']});},_0x173773=_0xbe4229=>{const _0x5bf037=_0x2767;var _0x4d0155;this['_map']['off'](EventType['terrainLoadSuccess'],_0xbd2cbf),this['_map']['off'](EventType['terrainLoadError'],_0x173773),(_0x4d0155=this['_readyPromise'])!==null&&_0x4d0155!==void 0x0&&_0x4d0155['reject']&&this[_0x5bf037(0x4ac)]['reject'](_0xbe4229);};this[_0x61ca00(0xd79)][_0x61ca00(0x1fd)](EventType[_0x61ca00(_0x586724._0x54f8b5)],_0xbd2cbf),this['_map'][_0x61ca00(0x1fd)](EventType['terrainLoadError'],_0x173773),this[_0x61ca00(0x59c)]['then'](_0xbd2cbf),this['_map']['terrainProvider']=this['_terrainProviderPromise'];}}register$2(_0x35a251(0xe17),TerrainLayer);class ArcGisCacheLayer extends BaseTileLayer{async['_createImageryProvider'](_0x22dacb){return await createImageryProvider$j(_0x22dacb);}}async function createImageryProvider$j(_0x294b0d){const _0x126d36={_0x3bb43d:0x54d},_0x27ff33={_0x4f5dba:0x591,_0x86073:0x8d6,_0x1aec48:0x591},_0xf93329=_0x35a251;_0x294b0d[_0xf93329(0xd05)]=_0x294b0d[_0xf93329(0xd05)]['replace']('{x}','C{arc_x}')['replace']('{y}',_0xf93329(_0x126d36._0x3bb43d))[_0xf93329(0x20e)](_0xf93329(0xe74),'L{arc_z}');const _0x2976a8=_0x294b0d['upperCase'];return _0x294b0d['customTags']=_0x294b0d['customTags']||{},_0x294b0d['customTags']['arc_x']=function(_0x105cc3,_0x58752d,_0x41ffd5,_0x31090e){const _0x4e1fcd=_0xf93329;return _0x2976a8?padLeft0(_0x58752d['toString'](0x10),0x8)[_0x4e1fcd(0x8d6)]():padLeft0(_0x58752d[_0x4e1fcd(0x591)](0x10),0x8);},_0x294b0d['customTags']['arc_y']=function(_0xbb81f5,_0x1180d0,_0x55c909,_0xfeb611){return _0x2976a8?padLeft0(_0x55c909['toString'](0x10),0x8)['toUpperCase']():padLeft0(_0x55c909['toString'](0x10),0x8);},_0x294b0d['customTags'][_0xf93329(0xebb)]=function(_0x3ebf84,_0x5119e9,_0x92a282,_0x2c8c0e){const _0x145455=_0xf93329;return _0x2976a8?padLeft0(_0x2c8c0e[_0x145455(_0x27ff33._0x4f5dba)](),0x2)[_0x145455(_0x27ff33._0x86073)]():padLeft0(_0x2c8c0e[_0x145455(_0x27ff33._0x1aec48)](),0x2);},_0x294b0d['customTags']['arc_z4490']=function(_0x43825e,_0x25a085,_0x159a0d,_0x45a7b9){return _0x2976a8?padLeft0((_0x45a7b9+0x1)['toString'](),0x2)['toUpperCase']():padLeft0((_0x45a7b9+0x1)['toString'](),0x2);},_0x294b0d=converOptions(_0x294b0d),new XyzImageryProvider$1(_0x294b0d);}ArcGisCacheLayer['createImageryProvider']=createImageryProvider$j;const layerType$j=_0x35a251(0xaa5);register$2(layerType$j,ArcGisCacheLayer),registerImageryProvider(layerType$j,createImageryProvider$j);class ArcGisTileLayer extends BaseTileLayer{async['_createImageryProvider'](_0x3137c9){return await createImageryProvider$i(_0x3137c9);}}async function createImageryProvider$i(_0x591092){const _0x813dec={_0x40ada1:0xd05},_0x41a14d=_0x35a251;_0x591092=converOptions(_0x591092);if(isString(_0x591092[_0x41a14d(0xd05)]))_0x591092[_0x41a14d(_0x813dec._0x40ada1)]=_0x591092['url']+'/tile/{z}/{y}/{x}';else _0x591092['url']instanceof Cesium__namespace[_0x41a14d(0x58d)]&&(_0x591092['url']['url']=_0x591092['url']['url']+'/tile/{z}/{y}/{x}');return new XyzImageryProvider$1(_0x591092);}ArcGisTileLayer[_0x35a251(0x4d0)]=createImageryProvider$i;const layerType$i='arcgis_tile';register$2(layerType$i,ArcGisTileLayer),registerImageryProvider(layerType$i,createImageryProvider$i);class ArcGisImageryProvider{constructor(_0x7e81ad={}){const _0x17604a={_0x52362e:0xf0d,_0x26af95:0x8e8,_0x2801ed:0x4ac,_0x5b151e:0xc74},_0x29a86f=_0x35a251;this[_0x29a86f(0xe86)]=_0x7e81ad;const _0x304f32=Cesium__namespace['Resource']['createIfNeeded'](_0x7e81ad['url']);_0x304f32['appendForwardSlash'](),Cesium__namespace[_0x29a86f(0xaa2)](_0x7e81ad[_0x29a86f(0xe2f)])&&_0x304f32['setQueryParameters']({'token':_0x7e81ad['token']}),this['_resource']=_0x304f32,this['_tileDiscardPolicy']=_0x7e81ad['tileDiscardPolicy'],this['_tileWidth']=_0x7e81ad[_0x29a86f(0x459)]??0x100,this['_tileHeight']=_0x7e81ad['tileHeight']??0x100,this['_maximumLevel']=_0x7e81ad['maximumLevel'],this['_maxTileLevel']=_0x7e81ad['maxTileLevel'],this[_0x29a86f(0x255)]=_0x7e81ad['crs'],this[_0x29a86f(_0x17604a._0x52362e)]=_0x7e81ad['enablePickFeatures']??!![],this[_0x29a86f(_0x17604a._0x26af95)]=_0x7e81ad['usePreCachedTilesIfAvailable']??!![],this['_initTilingSchemeByCrs'](_0x7e81ad['crs']||CRS['EPSG4326']),this['_errorEvent']=new Cesium__namespace['Event'](),this['_ready']=![],this[_0x29a86f(_0x17604a._0x2801ed)]=Cesium__namespace['defer'](),this['_useTiles']?this['_requestMetadata']():(this['_ready']=!![],this['_readyPromise'][_0x29a86f(_0x17604a._0x5b151e)](!![]));}get['url'](){const _0x135645={_0x42c859:0x74d},_0x517501=_0x35a251;return this[_0x517501(0x98a)][_0x517501(_0x135645._0x42c859)];}get['token'](){const _0x3ebff4={_0x3b4689:0xa4e},_0x530ef0=_0x35a251;return this['_resource'][_0x530ef0(_0x3ebff4._0x3b4689)]['token'];}get[_0x35a251(0x741)](){const _0xd2205=_0x35a251;return this['_resource'][_0xd2205(0x741)];}get[_0x35a251(0x459)](){return this['_tileWidth'];}get['tileHeight'](){const _0x21d198={_0x1ed4c1:0x528},_0x17034a=_0x35a251;return this[_0x17034a(_0x21d198._0x1ed4c1)];}get['maximumLevel'](){return this['_maximumLevel'];}get['minimumLevel'](){return 0x0;}get['tilingScheme'](){const _0x3b6f4e=_0x35a251;return this[_0x3b6f4e(0x7fd)];}get[_0x35a251(0xab1)](){return this['_rectangle'];}get['tileDiscardPolicy'](){const _0x4a11e9=_0x35a251;return this[_0x4a11e9(0x4a7)];}get['errorEvent'](){const _0x18fa8b={_0x528974:0xf79},_0x51adbb=_0x35a251;return this[_0x51adbb(_0x18fa8b._0x528974)];}get['ready'](){return this['_ready'];}get['readyPromise'](){return this['_readyPromise']['promise'];}get[_0x35a251(0xc82)](){return this['_credit'];}get['usingPrecachedTiles'](){const _0x2afcb9=_0x35a251;return this[_0x2afcb9(0x8e8)];}get['hasAlphaChannel'](){return!![];}get[_0x35a251(0x658)](){return this['options']['layers'];}get['layerDefs'](){return this['options']['layerDefs'];}['_initTilingSchemeByCrs'](_0x582185){const _0x3668ed={_0x249d75:0xf57,_0x5ea297:0x7fd,_0x389926:0x352,_0x27b5b6:0xe86,_0x454aff:0x2cb,_0x376561:0xe86},_0xac9d43=_0x35a251;if(_0x582185===CRS[_0xac9d43(_0x3668ed._0x249d75)])return this[_0xac9d43(_0x3668ed._0x5ea297)]=this['options']['tilingScheme']||new Cesium__namespace[(_0xac9d43(_0x3668ed._0x389926))]({'ellipsoid':this[_0xac9d43(_0x3668ed._0x27b5b6)]['ellipsoid']}),this['_rectangle']=this[_0xac9d43(_0x3668ed._0x27b5b6)]['rectangle']??this['_tilingScheme']['rectangle'],!![];else return _0x582185===CRS[_0xac9d43(_0x3668ed._0x454aff)]||_0x582185===CRS['EPSG4490']?(this['_tilingScheme']=this[_0xac9d43(0xe86)]['tilingScheme']||new Cesium__namespace['GeographicTilingScheme']({'ellipsoid':this['options']['ellipsoid']}),this['_rectangle']=this[_0xac9d43(_0x3668ed._0x376561)]['rectangle']??this['_tilingScheme']['rectangle'],!![]):![];}['_requestMetadata'](){const _0x272b0f=_0x35a251,_0x22394e=this['_resource'][_0x272b0f(0x9ba)]({'queryParameters':{'f':'json'}});_0x22394e[_0x272b0f(0x8c0)]()['then'](_0x1b4010=>{this['_metadataSuccess'](_0x1b4010);})['catch'](_0xc4e11b=>{this['_metadataFailure'](_0xc4e11b);});}[_0x35a251(0x146)](_0x5df7b3){const _0x2af8aa={_0x207c60:0xbde,_0x4cad4e:0x528,_0x241ee4:0xa34,_0x33c1d4:0x9f7,_0x4efdab:0x248,_0xd24dc5:0x5e2,_0xc33196:0xd6,_0x4cd5b7:0xa6d,_0x292fbb:0x5e2,_0x198a75:0x8f0},_0x18cb23=_0x35a251;this[_0x18cb23(0xde8)]=_0x5df7b3;if(!Cesium__namespace[_0x18cb23(0xaa2)](_0x5df7b3['tileInfo'])){this['_useTiles']=![];if(!this['options']['crs']){var _0x20d78c;this['_crs']=getCRSByWkid((_0x20d78c=_0x5df7b3['spatialReference'])===null||_0x20d78c===void 0x0?void 0x0:_0x20d78c['wkid']),this[_0x18cb23(_0x2af8aa._0x207c60)](this['_crs']);}}else{this['_useTiles']=!![];const _0x22f93c=_0x5df7b3['tileInfo'];this['_tileWidth']=_0x22f93c['rows'],this[_0x18cb23(_0x2af8aa._0x4cad4e)]=_0x22f93c['cols'];!this['_maximumLevel']&&(this[_0x18cb23(0x2e8)]=_0x22f93c['lods'][_0x18cb23(0xe1e)]-0x1);if(!this[_0x18cb23(0xe86)][_0x18cb23(_0x2af8aa._0x241ee4)]){var _0x2ec94a;this['_crs']=getCRSByWkid((_0x2ec94a=_0x22f93c['spatialReference'])===null||_0x2ec94a===void 0x0?void 0x0:_0x2ec94a[_0x18cb23(0x13c)]),this['_useTiles']=this['_initTilingSchemeByCrs'](this['_crs']);}this['_useTiles']&&!Cesium__namespace['defined'](this['_tileDiscardPolicy'])&&(this['_tileDiscardPolicy']=new Cesium__namespace[(_0x18cb23(_0x2af8aa._0x33c1d4))]({'missingImageUrl':this['_buildImageResource'](0x0,0x0,this['_maximumLevel'])['url'],'pixelsToCheck':[new Cesium__namespace['Cartesian2'](0x0,0x0),new Cesium__namespace[(_0x18cb23(0x248))](0xc8,0x14),new Cesium__namespace['Cartesian2'](0x14,0xc8),new Cesium__namespace[(_0x18cb23(_0x2af8aa._0x4efdab))](0x50,0x6e),new Cesium__namespace[(_0x18cb23(0x248))](0xa0,0x82)],'disableCheckIfAllPixelsAreTransparent':!![]}));}let _0x24b9f7=_0x5df7b3['fullExtent']||_0x5df7b3[_0x18cb23(0x1fa)];if(!this['options']['rectangle']&&_0x24b9f7){var _0x55addc,_0x5929a3;let _0x929dfb=this['_crs'];(_0x55addc=_0x24b9f7)!==null&&_0x55addc!==void 0x0&&(_0x5929a3=_0x55addc['spatialReference'])!==null&&_0x5929a3!==void 0x0&&_0x5929a3['wkid']&&(_0x929dfb=getCRSByWkid(_0x24b9f7['spatialReference']['wkid']));if(_0x929dfb){if(_0x929dfb!==CRS['EPSG4326']&&_0x929dfb!==CRS[_0x18cb23(0xb88)]){const _0xe8e907=proj4Trans([_0x24b9f7[_0x18cb23(_0x2af8aa._0xd24dc5)],_0x24b9f7['ymin']],_0x929dfb),_0x10ece6=proj4Trans([_0x24b9f7['xmax'],_0x24b9f7[_0x18cb23(0xcea)]],_0x929dfb);_0x24b9f7={'xmin':_0xe8e907[0x0],'ymin':_0xe8e907[0x1],'xmax':_0x10ece6[0x0],'ymax':_0x10ece6[0x1]};}this['_extent']=_0x24b9f7,_0x24b9f7['xmin']>0x0&&_0x24b9f7[_0x18cb23(0x1db)]<0xb3&&_0x24b9f7['ymin']>0x0&&_0x24b9f7['ymax']<0x55&&(this[_0x18cb23(0xc02)]=Cesium__namespace[_0x18cb23(_0x2af8aa._0xc33196)][_0x18cb23(_0x2af8aa._0x4cd5b7)](_0x24b9f7[_0x18cb23(_0x2af8aa._0x292fbb)],_0x24b9f7['ymin'],_0x24b9f7['xmax'],_0x24b9f7[_0x18cb23(0xcea)]));}}this['_ready']=!![],this['_readyPromise']['resolve'](!![]);if(Cesium__namespace['TileProviderError'][_0x18cb23(0x75d)])Cesium__namespace[_0x18cb23(0x7cc)][_0x18cb23(0x75d)](this['_metadataError']);else Cesium__namespace[_0x18cb23(0x7cc)][_0x18cb23(0x8f0)]&&Cesium__namespace['TileProviderError'][_0x18cb23(_0x2af8aa._0x198a75)](this['_metadataError']);}['_metadataFailure'](_0x1922cc){const _0x4f30ab={_0x2f2072:0x491,_0x487fa2:0x98a,_0x5ef979:0x7cc,_0x5d32c4:0xda3,_0x9b56c5:0xf79},_0x198677=_0x35a251;var _0x56013a;const _0x54ae28=_0x198677(_0x4f30ab._0x2f2072)+this[_0x198677(_0x4f30ab._0x487fa2)]['url']+'.';if(Cesium__namespace['TileProviderError']['reportError'])this['_metadataError']=Cesium__namespace[_0x198677(_0x4f30ab._0x5ef979)][_0x198677(0x2e1)](this[_0x198677(0xda3)],this,this[_0x198677(0xf79)],_0x54ae28,undefined,undefined,undefined,this['_requestMetadata']);else Cesium__namespace[_0x198677(0x7cc)][_0x198677(0x9c3)]&&(this['_metadataError']=Cesium__namespace['TileProviderError']['handleError'](this[_0x198677(_0x4f30ab._0x5d32c4)],this,this[_0x198677(_0x4f30ab._0x9b56c5)],_0x54ae28,undefined,undefined,undefined,this['_requestMetadata']));(_0x56013a=this[_0x198677(0x4ac)])!==null&&_0x56013a!==void 0x0&&_0x56013a[_0x198677(0xe9d)]&&this['_readyPromise']['reject'](new Cesium__namespace[(_0x198677(0x811))](_0x54ae28));}['getTileCredits'](_0x55fae4,_0x3941d3,_0x4cd68b){return undefined;}[_0x35a251(0x4c9)](_0x4ad76e,_0x48ad4c,_0x1d91f2,_0x2ab852){const _0x5e8dac={_0x2196b2:0x1be},_0x2dda72=_0x35a251;return Cesium__namespace[_0x2dda72(_0x5e8dac._0x2196b2)][_0x2dda72(0x3ce)](this,this['_buildImageResource'](_0x4ad76e,_0x48ad4c,_0x1d91f2,_0x2ab852));}[_0x35a251(0xae9)](_0x2ac4ad,_0x280871,_0x5c7f3f,_0x2b5884){const _0x5e9cb1={_0x2f5f8f:0x8e8,_0x5e9379:0x255,_0x2cad11:0xc93,_0x1abd2a:0xdb2,_0x3f7791:0x40c,_0xfdf6d0:0x323,_0x10ba19:0x323},_0x404626=_0x35a251;let _0x377ada=this[_0x404626(_0x5e9cb1._0x2f5f8f)];_0x377ada&&Cesium__namespace['defined'](this['_maxTileLevel'])&&(_0x377ada=_0x5c7f3f{super['_addedHook']();}):super['_addedHook']();}async['_createImageryProvider'](_0x27d7f6){return await createImageryProvider$4(_0x27d7f6);}['getMetadata'](){const _0x24a073={_0x1fc427:0xde8,_0x3341fd:0xd05,_0x2b43a5:0xa0a,_0x8355e1:0xe86,_0xa29dd0:0xa0a};return new Promise((_0x5a0b14,_0x466521)=>{const _0x18b723=_0x2767;if(this['capabilities']){_0x5a0b14(this[_0x18b723(_0x24a073._0x1fc427)]);return;}const _0x160d28={'service':_0x18b723(0x223),'request':'GetCapabilities','version':'1.3.0'};let _0x571ee4=this['options'][_0x18b723(_0x24a073._0x3341fd)];this['options'][_0x18b723(_0x24a073._0x2b43a5)]&&(_0x571ee4=template(_0x571ee4,this[_0x18b723(_0x24a073._0x8355e1)][_0x18b723(_0x24a073._0xa29dd0)])),Cesium__namespace['Resource']['fetchXML']({...this[_0x18b723(_0x24a073._0x8355e1)],'url':_0x571ee4,'queryParameters':_0x160d28,'proxy':this['_proxy']})['then'](_0x403c28=>{if(this['isDestroy'])return;if(_0x403c28){this['capabilities']=_0x403c28;try{this['_initByMetaData'](_0x403c28);}catch(_0x3a6e7d){logInfo('WMS\x20解析GetCapabilities有误',_0x3a6e7d);}}_0x5a0b14(_0x403c28),this['fire'](EventType['loadConfig'],{'capabilities':_0x403c28});})[_0x18b723(0xeb7)](_0x9b2930=>{logInfo('WMS\x20getMetadata请求出错',_0x9b2930),_0x5a0b14(_0x9b2930);});});}['_initByMetaData'](_0x3a2af3){const _0x289852={_0x5b5d38:0xe6f,_0xd16dc6:0xe6f,_0x227cf6:0x4b9,_0x16f603:0xe86,_0x3b103b:0xa34,_0x492631:0xab1,_0x4019f3:0x2ad,_0x45dc01:0xd25,_0x31377f:0x15b},_0xb7590=_0x35a251;let _0x170d28=this['options']['layers'];_0x170d28['indexOf'](':')!==-0x1&&(_0x170d28=_0x170d28['split'](':')[0x1]);const _0x169a45=this[_0xb7590(0x59e)](_0x3a2af3,_0xb7590(_0x289852._0x5b5d38));if(!_0x169a45)return;const _0x1228d0=this['_readNode'](_0x169a45,_0xb7590(_0x289852._0xd16dc6));if(!_0x1228d0)return;for(let _0x648374=0x0,_0x2a9a4e=_0x1228d0['length'];_0x648374<_0x2a9a4e;_0x648374++){const _0x23b345=_0x1228d0[_0x648374],_0x4d609c=this[_0xb7590(_0x289852._0x227cf6)](_0x23b345,'Name'),_0x2cabb4=this['_readChildNodeVal'](_0x23b345,'Title');if(_0x4d609c===_0x170d28||_0x2cabb4===_0x170d28){const _0x101663=this['_readChildNodeVal'](_0x23b345,'CRS');!this[_0xb7590(_0x289852._0x16f603)]['crs']&&_0x101663&&(this['options'][_0xb7590(_0x289852._0x3b103b)]=_0x101663);const _0x18ad54=this['_readChildNode'](_0x23b345,'BoundingBox');if(!this[_0xb7590(0xe86)][_0xb7590(_0x289852._0x492631)]&&_0x18ad54){const _0x414a93=Math[_0xb7590(0xc9d)](Number(_0x18ad54['getAttribute'](_0xb7590(0x5e1))),-0xb4),_0x1988a2=Math[_0xb7590(0x60c)](Number(_0x18ad54['getAttribute'](_0xb7590(_0x289852._0x4019f3))),0xb4),_0x199e31=Math['max'](Number(_0x18ad54['getAttribute'](_0xb7590(0xd5d))),-0x55),_0x29a684=Math['min'](Number(_0x18ad54['getAttribute']('maxy')),0x55);if(isNaN(_0x414a93)||isNaN(_0x1988a2)||isNaN(_0x199e31)||isNaN(_0x29a684))break;const _0x4abfa2={'xmin':_0x414a93,'ymin':_0x199e31,'xmax':_0x1988a2,'ymax':_0x29a684};console['log'](_0xb7590(_0x289852._0x45dc01),_0x4abfa2),this['options']['extent']=_0x4abfa2,this['_rectangle']=Cesium__namespace['Rectangle'][_0xb7590(0xa6d)](_0x4abfa2['xmin'],_0x4abfa2[_0xb7590(_0x289852._0x31377f)],_0x4abfa2[_0xb7590(0x1db)],_0x4abfa2['ymax']);}break;}}}[_0x35a251(0xa69)](_0x5332c5,_0x24291a){const _0x5042c4=_0x35a251;if(!_0x5332c5)return null;let _0x2d3e36=_0x5332c5[_0x5042c4(0x88c)](_0x24291a);return(!_0x2d3e36||_0x2d3e36[_0x5042c4(0xe1e)]===0x0)&&(_0x2d3e36=_0x5332c5['getElementsByTagName']('wms:'+_0x24291a)),_0x2d3e36;}[_0x35a251(0x59e)](_0x31e156,_0x55648b){const _0x58aa3d=_0x35a251;if(!_0x31e156)return null;const _0x40f58b=this[_0x58aa3d(0xa69)](_0x31e156,_0x55648b);return _0x40f58b['length']>0x0?_0x40f58b[0x0]:null;}['_readChildNodeVal'](_0xfc7909,_0x1b610d){const _0x8fb3d5={_0x380e36:0xfa},_0x34e6a3=_0x35a251;var _0x28b8e0,_0x51a9a8;if(!_0xfc7909)return null;let _0x258f17=this['_readChildNode'](_0xfc7909,_0x1b610d);!_0x258f17&&(_0x258f17=this['_readChildNode'](_0xfc7909,'wms:'+_0x1b610d));if((_0x28b8e0=_0x258f17)!==null&&_0x28b8e0!==void 0x0&&_0x28b8e0['innerHTML'])return _0x258f17[_0x34e6a3(0xf4a)];else return(_0x51a9a8=_0x258f17)!==null&&_0x51a9a8!==void 0x0&&_0x51a9a8[_0x34e6a3(_0x8fb3d5._0x380e36)]?_0x258f17['getInnerHTML']():null;}['hasPopup'](){if(this['_popupConfig'])return!![];return![];}['bindPopup'](_0x456f34,_0x4517b7){const _0xa24920={_0x5d5e9b:0xdf7},_0x1b140a=_0x35a251;return this[_0x1b140a(_0xa24920._0x5d5e9b)]={'content':_0x456f34,'options':_0x4517b7,'layer':this},this['_bindControl'](),this;}[_0x35a251(0x17f)](){const _0x16ecac=_0x35a251;return this['closePopup'](),this[_0x16ecac(0xdf7)]=null,this;}[_0x35a251(0x90b)](){const _0x5d8f90=_0x35a251;return this[_0x5d8f90(0xd79)]&&this[_0x5d8f90(0x25e)]()&&this['_map']['popup']['close'](null,this),this;}}async function createImageryProvider$4(_0x42963e){return _0x42963e=converOptions(_0x42963e),new Cesium__namespace['WebMapServiceImageryProvider'](_0x42963e);}WmsLayer['createImageryProvider']=createImageryProvider$4;const layerType$4='wms';register$2(layerType$4,WmsLayer),registerImageryProvider(layerType$4,createImageryProvider$4);class WmtsLayer extends BaseTileLayer{['_addedHook'](){const _0x2a49cb=_0x35a251;this['options']['getCapabilities']??!![]?this[_0x2a49cb(0x735)]()['then'](()=>{super['_addedHook']();}):super['_addedHook']();}async['_createImageryProvider'](_0x422ef2){const _0x5e482f={_0x33f16f:0x838},_0x5a914b=_0x35a251,_0x53a487=await createImageryProvider$3(_0x422ef2);if(_0x422ef2[_0x5a914b(0x838)])_0x53a487['pickFeatures']=_0x422ef2[_0x5a914b(_0x5e482f._0x33f16f)];else _0x422ef2['pickFeaturesUrl']&&(_0x53a487['pickFeatures']=(_0x1085a4,_0x402262,_0x322c04,_0x5ef3ed,_0xfa5be9)=>{const _0x4f988f=_0x5a914b;return this[_0x4f988f(0x838)](_0x1085a4,_0x402262,_0x322c04,_0x5ef3ed,_0xfa5be9);});return _0x53a487;}['pickFeatures'](_0x2cd5c1,_0xf4cc19,_0xd1f798,_0x21605a,_0x4d715c){const _0x2e6546={_0x14fb38:0xe86,_0x3a73ca:0x580,_0x3526d7:0x223,_0x36f15e:0xe5d,_0x11beb1:0x6a3},_0x3f11f9={_0x3796b0:0x58f,_0x4cb4da:0x6de},_0x1962e1=_0x35a251;var _0x252c33;if(!this[_0x1962e1(_0x2e6546._0x14fb38)]['enablePickFeatures'])return undefined;const _0x56f34b=this['imageryProvider'],_0x55e30f=new Cesium__namespace['Cartesian3']();if(_0x56f34b['tilingScheme']['projection']instanceof Cesium__namespace['GeographicProjection'])_0x55e30f['x']=Cesium__namespace['Math']['toDegrees'](_0x21605a),_0x55e30f['y']=Cesium__namespace['Math']['toDegrees'](_0x4d715c);else{const _0x513dd9=new Cesium__namespace['Cartographic']();_0x513dd9[_0x1962e1(0xc26)]=_0x21605a,_0x513dd9[_0x1962e1(_0x2e6546._0x3a73ca)]=_0x4d715c,_0x56f34b['tilingScheme']['projection']['project'](_0x513dd9,_0x55e30f);}const _0x505219=new Cesium__namespace['Cartesian2'](),_0x261fe7=_0x56f34b['tilingScheme']['tileXYToNativeRectangle'](_0x2cd5c1,_0xf4cc19,_0xd1f798,new Cesium__namespace['Rectangle']());_0x505219['x']=_0x56f34b['tileWidth']*(_0x55e30f['x']-_0x261fe7['west'])/_0x261fe7['width']|0x0,_0x505219['y']=_0x56f34b[_0x1962e1(0x722)]*(_0x261fe7['north']-_0x55e30f['y'])/_0x261fe7['height']|0x0;const _0x558206={...this['options'][_0x1962e1(0x747)]||{},'service':_0x1962e1(_0x2e6546._0x3526d7),'version':'1.1.1','request':'GetFeatureInfo','layers':this['options']['layer'],'query_layers':this['options']['layer'],'info_format':'application/json','srs':this['options']['crs']??(((_0x252c33=this['options']['tilingScheme'])===null||_0x252c33===void 0x0?void 0x0:_0x252c33['projection'])instanceof Cesium__namespace[_0x1962e1(_0x2e6546._0x36f15e)]?_0x1962e1(0x367):'EPSG:4326'),'bbox':_0x261fe7['west']+','+_0x261fe7['south']+','+_0x261fe7['east']+','+_0x261fe7['north'],'width':_0x56f34b['tileWidth'],'height':_0x56f34b[_0x1962e1(0x722)],'x':_0x505219['x'],'y':_0x505219['y']};return fetchJson({...this['options'],'url':this['options']['pickFeaturesUrl'],'queryParameters':_0x558206,'proxy':this[_0x1962e1(_0x2e6546._0x11beb1)]})['then'](_0x1746f6=>{const _0x3e534a=_0x1962e1,_0x111efb=[],_0x5e16f6=_0x1746f6['features'];for(let _0x23e0b0=0x0;_0x23e0b0<_0x5e16f6[_0x3e534a(0xe1e)];++_0x23e0b0){const _0x241a74=_0x5e16f6[_0x23e0b0],_0x40bc91=new Cesium__namespace['ImageryLayerFeatureInfo']();_0x40bc91['data']=_0x241a74,_0x40bc91['properties']=_0x241a74['properties'],_0x40bc91['configureNameFromProperties'](_0x241a74['properties']),_0x40bc91['configureDescriptionFromProperties'](_0x241a74['properties']);if(Cesium__namespace['defined'](_0x241a74['geometry'])&&_0x241a74[_0x3e534a(_0x3f11f9._0x3796b0)]['type']==='Point'){const _0x445b0=_0x241a74[_0x3e534a(0x58f)][_0x3e534a(0x310)][0x0],_0x36e7b4=_0x241a74['geometry']['coordinates'][0x1];_0x40bc91['position']=Cesium__namespace[_0x3e534a(0x120)]['fromDegrees'](_0x445b0,_0x36e7b4);}_0x111efb[_0x3e534a(_0x3f11f9._0x4cb4da)](_0x40bc91);}return _0x111efb;});}['getMetadata'](){const _0x235d60={_0x27ffc8:0x866,_0x14a9c2:0xe86,_0x529a44:0xeb7};return new Promise((_0xf1d051,_0x4cae97)=>{const _0x155156=_0x2767;if(this['capabilities']){_0xf1d051(this['capabilities']);return;}const _0x5a34aa={'service':'WMTS','request':'GetCapabilities','version':_0x155156(_0x235d60._0x27ffc8)};Cesium__namespace[_0x155156(0x58d)]['fetchXML']({...this[_0x155156(_0x235d60._0x14a9c2)],'queryParameters':_0x5a34aa,'proxy':this['_proxy']})['then'](_0x183df2=>{const _0x1b33f4=_0x155156;if(this['isDestroy'])return;if(_0x183df2){this['capabilities']=_0x183df2;try{this['_initByMetaData'](_0x183df2);}catch(_0x3e723c){logInfo('解析GetCapabilities出错',_0x3e723c);}}_0xf1d051(_0x183df2),this['fire'](EventType[_0x1b33f4(0x70f)],{'capabilities':_0x183df2});})[_0x155156(_0x235d60._0x529a44)](_0x15140a=>{logInfo('WMTS\x20GetCapabilities请求出错',_0x15140a),_0xf1d051(_0x15140a);});});}['_initByMetaData'](_0x275049){const _0x394473={_0x36d719:0xc9d,_0x66c03b:0x15b,_0x59ce23:0xaa2,_0xc15eed:0x4b9,_0x373011:0x3be,_0x142c7c:0xe1e,_0x5cbd55:0x617,_0x2bb4e8:0x59e,_0x11b0f3:0x4b9},_0x1da290=_0x35a251,_0x3893ea=this['_readChildNode'](_0x275049,'Contents');if(!_0x3893ea)return;const _0x8eb350=this['_readNode'](_0x3893ea,'Layer');if(!_0x8eb350)return;for(let _0x5be068=0x0,_0x5e63a5=_0x8eb350['length'];_0x5be068<_0x5e63a5;_0x5be068++){const _0x4934a2=_0x8eb350[_0x5be068],_0x5d49cf=this['_readChildNodeVal'](_0x4934a2,'ows:Identifier');if(_0x5d49cf===this['options']['layer']){const _0x42ecf6=this['_readChildNode'](_0x4934a2,'ows:WGS84BoundingBox');if(!this['options'][_0x1da290(0xab1)]&&_0x42ecf6){let _0x37a918=this['_readChildNodeVal'](_0x42ecf6,'ows:LowerCorner'),_0x312548=this['_readChildNodeVal'](_0x42ecf6,'ows:UpperCorner');if(_0x37a918&&_0x312548){_0x37a918=_0x37a918['split']('\x20'),_0x312548=_0x312548['split']('\x20');const _0x178ab1=Math[_0x1da290(_0x394473._0x36d719)](Number(_0x37a918[0x0]),-0xb4),_0x369a49=Math[_0x1da290(0x60c)](Number(_0x312548[0x0]),0xb4),_0x48404a=Math[_0x1da290(0xc9d)](Number(_0x37a918[0x1]),-0x55),_0x2cc0ea=Math['min'](Number(_0x312548[0x1]),0x55),_0x515aec={'xmin':_0x178ab1,'ymin':_0x48404a,'xmax':_0x369a49,'ymax':_0x2cc0ea};this['options']['extent']=_0x515aec,this[_0x1da290(0xc02)]=Cesium__namespace['Rectangle']['fromDegrees'](_0x515aec['xmin'],_0x515aec[_0x1da290(_0x394473._0x66c03b)],_0x515aec['xmax'],_0x515aec['ymax']);}}!Cesium__namespace[_0x1da290(_0x394473._0x59ce23)](this['options']['style'])&&(this['options']['style']=this[_0x1da290(_0x394473._0xc15eed)](this['_readChildNode'](_0x4934a2,_0x1da290(_0x394473._0x373011)),_0x1da290(0x8da)));const _0x21ff57=_0x4934a2['getElementsByTagName']('TileMatrixSetLink');for(let _0x59f14e=0x0,_0x430752=_0x21ff57[_0x1da290(_0x394473._0x142c7c)];_0x59f14e<_0x430752;_0x59f14e++){const _0x41bf13=_0x21ff57[_0x59f14e],_0x5d8805=this[_0x1da290(0x4b9)](_0x41bf13,_0x1da290(_0x394473._0x5cbd55));!Cesium__namespace['defined'](this['options']['tileMatrixSetID'])&&(this[_0x1da290(0xe86)]['tileMatrixSetID']=_0x5d8805);if(_0x5d8805===this['options']['tileMatrixSetID']){if(!this['options'][_0x1da290(0x9b9)]){const _0x44db1f=this[_0x1da290(_0x394473._0x2bb4e8)](_0x41bf13,'TileMatrixSetLimits');if(_0x44db1f){const _0x213dc6=_0x44db1f[_0x1da290(0x88c)]('TileMatrixLimits'),_0x432223=[];for(let _0x3f4867=0x0,_0x2f905f=_0x213dc6['length'];_0x3f4867<_0x2f905f;_0x3f4867++){const _0x4e60fb=this[_0x1da290(_0x394473._0x11b0f3)](_0x213dc6[_0x3f4867],'TileMatrix');_0x432223['push'](_0x4e60fb);}this[_0x1da290(0xe86)]['tileMatrixLabels']=_0x432223;}}break;}}break;}}}['_readNode'](_0x4d441f,_0x4c4206){const _0x226cdf=_0x35a251;if(!_0x4d441f)return null;let _0x3c9d32=_0x4d441f[_0x226cdf(0x88c)](_0x4c4206);return(!_0x3c9d32||_0x3c9d32['length']===0x0)&&(_0x3c9d32=_0x4d441f['getElementsByTagName']('wmts:'+_0x4c4206)),_0x3c9d32;}['_readChildNode'](_0x499642,_0x3dc41e){const _0x5655a7={_0x4e1ce7:0xa69},_0xde814c=_0x35a251;if(!_0x499642)return null;const _0x491311=this[_0xde814c(_0x5655a7._0x4e1ce7)](_0x499642,_0x3dc41e);return _0x491311['length']>0x0?_0x491311[0x0]:null;}[_0x35a251(0x4b9)](_0x313015,_0x20fe81){const _0x1db408={_0x59d784:0x59e,_0x589d1b:0x59e},_0x55d6d5=_0x35a251;var _0xf5bc45,_0x3f3d2d;if(!_0x313015)return null;let _0x5de5eb=this[_0x55d6d5(_0x1db408._0x59d784)](_0x313015,_0x20fe81);!_0x5de5eb&&(_0x5de5eb=this[_0x55d6d5(_0x1db408._0x589d1b)](_0x313015,'wmts:'+_0x20fe81));if((_0xf5bc45=_0x5de5eb)!==null&&_0xf5bc45!==void 0x0&&_0xf5bc45['innerHTML'])return _0x5de5eb['innerHTML'];else return(_0x3f3d2d=_0x5de5eb)!==null&&_0x3f3d2d!==void 0x0&&_0x3f3d2d['getInnerHTML']?_0x5de5eb['getInnerHTML']():null;}}async function createImageryProvider$3(_0x23d4d7){const _0x11e8b6={_0x5b538f:0x9b9},_0x32c06c=_0x35a251;return _0x23d4d7=converOptions(_0x23d4d7),_0x23d4d7['crs']===CRS['EPSG4490']&&(_0x23d4d7[_0x32c06c(_0x11e8b6._0x5b538f)]=[...Array(0x14)['keys']()][_0x32c06c(0x457)](_0x4c8742=>(_0x4c8742+0x1)['toString']())),new Cesium__namespace['WebMapTileServiceImageryProvider'](_0x23d4d7);}WmtsLayer[_0x35a251(0x4d0)]=createImageryProvider$3;const layerType$3='wmts';register$2(layerType$3,WmtsLayer),registerImageryProvider(layerType$3,createImageryProvider$3);class XyzLayer extends BaseTileLayer{async[_0x35a251(0x958)](_0x45f8df){return await createImageryProvider$2(_0x45f8df);}}async function createImageryProvider$2(_0x1b5cd4){return _0x1b5cd4=converOptions(_0x1b5cd4),_0x1b5cd4['chinaCRS']===ChinaCRS['BAIDU']?new BaiduImageryProvider(_0x1b5cd4):new XyzImageryProvider$1(_0x1b5cd4);}XyzLayer[_0x35a251(0x4d0)]=createImageryProvider$2;const layerType$2=_0x35a251(0x802);register$2(layerType$2,XyzLayer),registerImageryProvider(layerType$2,createImageryProvider$2);class GridLayer extends BaseTileLayer{async['_createImageryProvider'](_0x44f449){return await createImageryProvider$1(_0x44f449);}}async function createImageryProvider$1(_0x42f13f){const _0x443655={_0x656315:0xda0,_0x3b7fe8:0x490,_0x37a895:0x2a5,_0x22132d:0xda0,_0x3c7c56:0xba5,_0x3fa2b5:0x3c9},_0xa14592=_0x35a251;return _0x42f13f['cells']=_0x42f13f['cells']??0x2,_0x42f13f['color']=Cesium__namespace['Color'][_0xa14592(_0x443655._0x656315)](_0x42f13f['color']??'rgba(255,255,255,1)'),_0x42f13f[_0xa14592(_0x443655._0x3b7fe8)]=_0x42f13f['glowWidth']??0x3,_0x42f13f[_0xa14592(_0x443655._0x37a895)]?_0x42f13f['glowColor']=Cesium__namespace['Color'][_0xa14592(_0x443655._0x22132d)](_0x42f13f['glowColor']):_0x42f13f[_0xa14592(_0x443655._0x37a895)]=_0x42f13f['color']['withAlpha'](0.3),_0x42f13f[_0xa14592(_0x443655._0x3c7c56)]=Cesium__namespace['Color']['fromCssColorString'](_0x42f13f['backgroundColor']??_0xa14592(0x53b)),_0x42f13f=converOptions(_0x42f13f),new Cesium__namespace[(_0xa14592(_0x443655._0x3fa2b5))](_0x42f13f);}GridLayer['createImageryProvider']=createImageryProvider$1;const layerType$1='grid';register$2(layerType$1,GridLayer),registerImageryProvider(layerType$1,createImageryProvider$1);class TileInfoLayer extends BaseTileLayer{async[_0x35a251(0x958)](_0x5b66fd){return await createImageryProvider(_0x5b66fd);}}async function createImageryProvider(_0x4818a9){return _0x4818a9['color']=Cesium__namespace['Color']['fromCssColorString'](_0x4818a9['color']||'rgba(255,0,0,1)'),_0x4818a9=converOptions(_0x4818a9),new Cesium__namespace['TileCoordinatesImageryProvider'](_0x4818a9);}TileInfoLayer['createImageryProvider']=createImageryProvider;const layerType='tileinfo';register$2(layerType,TileInfoLayer),registerImageryProvider(layerType,createImageryProvider);class EmptyTileLayer extends BaseTileLayer{constructor(_0x26ecc0={}){const _0x3e2ac9={_0x16494d:0x507},_0x38e9e6=_0x35a251;super(_0x26ecc0),this[_0x38e9e6(_0x3e2ac9._0x16494d)]=_0x26ecc0['minimumLevel']??0x0,this['_maximumLevel']=_0x26ecc0['maximumLevel'];}async['_createImageryProvider'](_0x3de782){return _0x3de782=converOptions(_0x3de782),_0x3de782['minimumTerrainLevel']=this['_minimumLevel'],_0x3de782['maximumTerrainLevel']=this['_maximumLevel'],new EmptyImageryProvider(_0x3de782);}['_setOptionsHook'](_0x5bc7e6,_0x24d93d){const _0x5e722f={_0x33996c:0x23a},_0x31e47f=_0x35a251;this['_minimumLevel']=this['options'][_0x31e47f(_0x5e722f._0x33996c)]??0x0,this[_0x31e47f(0x2e8)]=this[_0x31e47f(0xe86)]['maximumLevel'],this['options']['minimumTerrainLevel']=this['_minimumLevel'],this['options']['maximumTerrainLevel']=this['_maximumLevel'],super['_setOptionsHook'](_0x5bc7e6,_0x24d93d);}['isInRange'](_0x2dd7ef){const _0x21e2e6={_0x4fa40e:0xaa2},_0x3e5765=_0x35a251,_0x32dfe0=this['_map']['level'];return _0x2dd7ef=this['_maximumLevel']?![]:!![];}['isAllOutRange'](_0x260ee7){const _0x310040=this['_map']['level'];return _0x310040=this['_maximumLevel'];}}new Cesium__namespace['Color'](0x0,0x0,0x0,0.01);function config2Entity(_0x2d99ac,_0x17aef6,_0x4ec903){const _0x5c3d91=_0x35a251;for(let _0x6da212=_0x2d99ac['length']-0x1;_0x6da212>=0x0;_0x6da212--){const _0xc32292=_0x2d99ac[_0x6da212],_0x2165b0=_0x17aef6['symbol'];_0x2165b0&&(typeof _0x2165b0==='function'?_0x2165b0(_0xc32292,_0xc32292[_0x5c3d91(0x295)]):setConfigSymbol(_0xc32292,_0x17aef6,_0x4ec903));}return _0x2d99ac;}function getStyleBySymbolConfig(_0x330e37,_0x2acb9f,_0x1f80c5){const _0x14d004={_0x277371:0x5ac},_0x946b9=_0x35a251;let _0x30f4d2=_0x330e37[_0x946b9(_0x14d004._0x277371)];if(_0x330e37[_0x946b9(0x814)]&&_0x2acb9f){const _0x9f2b1b=_0x2acb9f[_0x330e37['styleField']],_0x163839=_0x330e37['styleFieldOptions'][_0x9f2b1b];_0x163839!=null&&(_0x30f4d2=clone(_0x30f4d2),_0x30f4d2={..._0x30f4d2,..._0x163839});}if(typeof _0x330e37['callback']==='function'){_0x30f4d2=clone(_0x30f4d2);const _0x8ea368=_0x330e37['callback'](_0x2acb9f,_0x1f80c5,_0x30f4d2);_0x8ea368&&(_0x30f4d2={..._0x30f4d2,..._0x8ea368});}return _0x30f4d2=_0x30f4d2||{},_0x30f4d2;}function setConfigSymbol(_0x294a80,_0x58e6c3,_0x23b3c6){const _0x3afc9e={_0x1b064c:0x55c,_0x2d16d0:0x282,_0x3bbcfc:0xb35,_0x4beafd:0xe1e,_0x28f342:0x854,_0x160247:0xb61,_0x5ac9b6:0x8f1,_0x305aad:0xf48,_0x6be626:0x6ed,_0x1c98ce:0x854,_0x42e533:0x4b2,_0x5bb4b4:0x979,_0x26e7e5:0x4b2,_0x4cd876:0x4b2,_0x4643e1:0x440,_0xa04995:0xc04,_0x39d3ae:0x143,_0x4e04ce:0x143,_0x343611:0xa82},_0x37ac9d={_0x124695:0x4af},_0x4d9d5f=_0x35a251;let _0x13e0b0=_0x294a80['_attr'];_0x13e0b0&&_0x13e0b0['type']&&_0x13e0b0['attr']&&(_0x13e0b0=_0x13e0b0['attr']);const _0x21a0b3=_0x294a80[_0x4d9d5f(0x5d9)],_0x58bcb8=getStyleBySymbolConfig(_0x58e6c3['symbol'],_0x13e0b0,_0x294a80);function _0x2c8d40(_0x4d2ff8,_0x85e19b,_0x588250){const _0x3ca827=_0x4d9d5f;if(_0x85e19b['text']==='')return null;Cesium__namespace['defined'](_0x85e19b['height'])&&(_0x4d2ff8=setPositionsHeight(_0x4d2ff8,_0x85e19b['height']));const _0x36816e=_0x21a0b3[_0x3ca827(_0x37ac9d._0x124695)]({'position':_0x4d2ff8,'label':_0x85e19b,'_attr':_0x588250});return _0x36816e;}_0x23b3c6=_0x23b3c6||_0x2c8d40;if(_0x294a80[_0x4d9d5f(0x282)]){PolylineStyleConver['toCesiumVal'](_0x58bcb8,_0x294a80['polyline'],!![]);if(_0x58bcb8['corridor']){const _0x3288d8={'color':_0x58bcb8['color'],'opacity':_0x58bcb8[_0x4d9d5f(0xbf2)],..._0x58bcb8['corridor']};isString(_0x58bcb8[_0x4d9d5f(0x55c)][_0x4d9d5f(0xf48)])&&(_0x3288d8['width']=template(_0x58bcb8[_0x4d9d5f(0x55c)]['width'],_0x13e0b0));if(_0x294a80['_corridorEx'])CorridorStyleConver['toCesiumVal'](_0x3288d8,_0x294a80['_corridorEx'][_0x4d9d5f(_0x3afc9e._0x1b064c)],!![]);else{const _0x1903e3=CorridorStyleConver['toCesiumVal'](_0x3288d8,{},!![]);_0x1903e3['positions']=getCesiumValue(_0x294a80[_0x4d9d5f(_0x3afc9e._0x2d16d0)][_0x4d9d5f(_0x3afc9e._0x3bbcfc)]);const _0x2250f3=_0x21a0b3[_0x4d9d5f(0x4af)]({'corridor':_0x1903e3,'_attr':_0x13e0b0});_0x2250f3['_mars3d_layerId']=_0x58e6c3['id'],_0x294a80[_0x4d9d5f(0x467)]=_0x2250f3;}}if(_0x58bcb8['label']&&_0x58bcb8['label']['text']){if(_0x294a80['_labelEx'])LabelStyleConver['toCesiumVal'](_0x58bcb8['label'],_0x294a80['_labelEx']['label'],_0x13e0b0);else{const _0x1fc4bc=getCesiumValue(_0x294a80['polyline'][_0x4d9d5f(0xb35)]);let _0x248bc8=_0x1fc4bc[Math['floor'](_0x1fc4bc[_0x4d9d5f(_0x3afc9e._0x4beafd)]/0x2)];if(_0x58bcb8['label']['position']){if(_0x58bcb8[_0x4d9d5f(0x854)]['position']==='center')_0x248bc8=centerOfMass(_0x1fc4bc,_0x58bcb8['label']['height']);else isNumber(_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x28f342)][_0x4d9d5f(_0x3afc9e._0x160247)])&&(_0x248bc8=_0x1fc4bc[_0x58bcb8[_0x4d9d5f(0x854)]['position']]);}const _0x5cc7d5=LabelStyleConver[_0x4d9d5f(0xc04)](_0x58bcb8['label'],{},_0x13e0b0);_0x5cc7d5[_0x4d9d5f(0x4b2)]=_0x5cc7d5['heightReference']??Cesium__namespace[_0x4d9d5f(_0x3afc9e._0x5ac9b6)]['CLAMP_TO_GROUND'];const _0x125be7=_0x23b3c6(_0x248bc8,_0x5cc7d5,_0x13e0b0);_0x125be7&&(_0x125be7['_mars3d_layerId']=_0x58e6c3['id']),_0x294a80[_0x4d9d5f(0xa82)]=_0x125be7;}}}if(_0x294a80['polygon']){var _0x57b4b2;PolygonStyleConver['toCesiumVal'](_0x58bcb8,_0x294a80['polygon'],!![]);if(_0x58bcb8[_0x4d9d5f(0xb83)]&&(_0x58bcb8[_0x4d9d5f(0xf5d)]>0x1||((_0x57b4b2=_0x58bcb8['outlineStyle'])===null||_0x57b4b2===void 0x0?void 0x0:_0x57b4b2[_0x4d9d5f(_0x3afc9e._0x305aad)])>0x1)){_0x294a80[_0x4d9d5f(0x909)]['outline']=![];const _0x3d9c5d={..._0x58bcb8,'outline':![],'color':_0x58bcb8['outlineColor'],'width':_0x58bcb8[_0x4d9d5f(0xf5d)],'opacity':_0x58bcb8['outlineOpacity'],..._0x58bcb8['outlineStyle']||{}};if(_0x294a80['_outlineEx'])for(let _0x5d91f2=0x0,_0x35b723=_0x294a80[_0x4d9d5f(0xe1)]['length'];_0x5d91f2<_0x35b723;_0x5d91f2++){PolylineStyleConver['toCesiumVal'](_0x3d9c5d,_0x294a80['_outlineEx'][_0x5d91f2]['polyline'],!![]);}else{const _0x33615d=getAllPositions(_0x294a80);_0x294a80['_outlineEx']=[];for(let _0x4eb937=0x0,_0x5e1c65=_0x33615d['length'];_0x4eb937<_0x5e1c65;_0x4eb937++){const _0x19136c=PolylineStyleConver['toCesiumVal'](_0x3d9c5d,{},!![]);_0x19136c['positions']=_0x33615d[_0x4eb937];const _0x2c150d=_0x21a0b3['add']({'polyline':_0x19136c,'_attr':_0x13e0b0});_0x2c150d[_0x4d9d5f(_0x3afc9e._0x6be626)]=_0x58e6c3['id'],_0x294a80['_outlineEx']['push'](_0x2c150d);}}}if(_0x58bcb8[_0x4d9d5f(0x854)]&&_0x58bcb8[_0x4d9d5f(0x854)]['text']){if(_0x294a80['_labelEx'])LabelStyleConver['toCesiumVal'](_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x28f342)],_0x294a80['_labelEx'][_0x4d9d5f(0x854)],_0x13e0b0);else{const _0x13b862=centerOfMass(getPositions(_0x294a80),_0x58bcb8['label'][_0x4d9d5f(0x682)]),_0x3a1636=LabelStyleConver['toCesiumVal'](_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x1c98ce)],{},_0x13e0b0);_0x3a1636['heightReference']=_0x3a1636['heightReference']??Cesium__namespace['HeightReference']['CLAMP_TO_GROUND'];const _0x52a729=_0x23b3c6(_0x13b862,_0x3a1636,_0x13e0b0);_0x52a729&&(_0x52a729['_mars3d_layerId']=_0x58e6c3['id']),_0x294a80[_0x4d9d5f(0xa82)]=_0x52a729;}}}_0x294a80['label']?(_0x58bcb8['label']=_0x58bcb8['label']||_0x58bcb8||{},!Cesium__namespace['defined'](_0x58bcb8['label']['clampToGround'])&&!Cesium__namespace['defined'](_0x58bcb8['label'][_0x4d9d5f(_0x3afc9e._0x42e533)])&&(_0x58bcb8['label'][_0x4d9d5f(0x4b2)]=_0x58bcb8[_0x4d9d5f(0x854)]['heightReference']??Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']),LabelStyleConver['toCesiumVal'](_0x58bcb8[_0x4d9d5f(0x854)],_0x294a80['label'],_0x13e0b0)):_0x58bcb8['label']&&typeof _0x58bcb8[_0x4d9d5f(0x854)]==='function'&&_0x58bcb8[_0x4d9d5f(0x854)](_0x294a80,_0x13e0b0,function(_0xdd64f3,_0x13f5cd){const _0x2e74a8=_0x4d9d5f,_0xc4f5c=LabelStyleConver[_0x2e74a8(0xc04)](_0x13f5cd,{},_0x13e0b0);_0xc4f5c['heightReference']=(_0xc4f5c['heightReference'],Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']);const _0x11fd3c=_0x23b3c6(_0xdd64f3,_0xc4f5c,_0x13e0b0);_0x11fd3c&&(_0x11fd3c['_mars3d_layerId']=_0x58e6c3['id']);});if(_0x294a80['billboard']){!Cesium__namespace['defined'](_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x5bb4b4)])&&!Cesium__namespace['defined'](_0x58bcb8['heightReference'])&&(_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x26e7e5)]=_0x58bcb8[_0x4d9d5f(_0x3afc9e._0x4cd876)]??Cesium__namespace[_0x4d9d5f(0x8f1)][_0x4d9d5f(0xc5e)]);_0x58bcb8['image']=template(_0x58bcb8[_0x4d9d5f(0xdb2)],_0x13e0b0),BillboardStyleConver['toCesiumVal'](_0x58bcb8,_0x294a80['billboard'],!![]);if(_0x58bcb8['model']){if(_0x294a80['_modelEx'])ModelStyleConver['toCesiumVal'](_0x58bcb8['model'],_0x294a80['_modelEx'][_0x4d9d5f(_0x3afc9e._0x4643e1)],!![]);else{const _0x5102d6=ModelStyleConver[_0x4d9d5f(_0x3afc9e._0xa04995)](_0x58bcb8[_0x4d9d5f(0x440)],!![]);_0x5102d6['heightReference']=(_0x5102d6[_0x4d9d5f(0x4b2)],Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']);const _0x182d9e=_0x21a0b3['add']({'position':_0x294a80[_0x4d9d5f(0xb61)],'model':_0x5102d6,'_attr':_0x13e0b0});_0x182d9e['_mars3d_layerId']=_0x58e6c3['id'],_0x294a80['_modelEx']=_0x182d9e;}}if(_0x58bcb8['point']){if(_0x294a80['_pointEx'])PointStyleConver[_0x4d9d5f(0xc04)](_0x58bcb8['point'],_0x294a80[_0x4d9d5f(_0x3afc9e._0x39d3ae)]['point'],!![]);else{const _0xa7cf97=PointStyleConver['toCesiumVal'](_0x58bcb8['point'],{},!![]);_0xa7cf97['heightReference']=_0xa7cf97['heightReference']??Cesium__namespace['HeightReference']['CLAMP_TO_GROUND'];const _0x585c16=_0x21a0b3[_0x4d9d5f(0x4af)]({'position':_0x294a80['position'],'point':_0xa7cf97,'_attr':_0x13e0b0});_0x585c16['_mars3d_layerId']=_0x58e6c3['id'],_0x294a80[_0x4d9d5f(_0x3afc9e._0x4e04ce)]=_0x585c16;}}if(_0x58bcb8['label']&&_0x58bcb8['label'][_0x4d9d5f(0xe1f)]&&!_0x294a80['label']){if(_0x294a80['_labelEx'])LabelStyleConver[_0x4d9d5f(0xc04)](_0x58bcb8['label'],_0x294a80[_0x4d9d5f(_0x3afc9e._0x343611)]['label'],_0x13e0b0);else{const _0x330805=_0x294a80[_0x4d9d5f(0xb61)],_0x3842b3=LabelStyleConver[_0x4d9d5f(0xc04)](_0x58bcb8['label'],{},_0x13e0b0);_0x3842b3['heightReference']=_0x3842b3['heightReference']??Cesium__namespace[_0x4d9d5f(0x8f1)]['CLAMP_TO_GROUND'];const _0x185250=_0x23b3c6(_0x330805,_0x3842b3,_0x13e0b0);_0x185250&&(_0x185250['_mars3d_layerId']=_0x58e6c3['id']),_0x294a80['_labelEx']=_0x185250;}}}_0x294a80[_0x4d9d5f(0x37c)]=_0x58bcb8;}class CzmGeoJsonLayer extends BaseGraphicLayer{constructor(_0x6178d9={}){super(_0x6178d9),this['_setOptionsHook'](_0x6178d9,_0x6178d9);}get['layer'](){return this['_dataSource'];}get[_0x35a251(0x313)](){const _0x1be734={_0x485941:0x1a3},_0x5ceb1d=_0x35a251;return this['_dataSource']?this[_0x5ceb1d(_0x1be734._0x485941)]['entities']:null;}get['labelCollection'](){const _0x3ef55a={_0x41a4e9:0xf96,_0x121005:0xd79,_0x43d900:0xcba},_0x3c0d5e=_0x35a251;return!this['_labelCollection']&&(this['_labelCollection']=new Cesium__namespace['LabelCollection']({'scene':this['_map']['scene']}),this[_0x3c0d5e(_0x3ef55a._0x41a4e9)]===State[_0x3c0d5e(0xef0)]&&this[_0x3c0d5e(_0x3ef55a._0x121005)]['scene']['primitives']['add'](this['_labelCollection'])),this[_0x3c0d5e(_0x3ef55a._0x43d900)];}get['hasZIndex'](){return!![];}get['zIndex'](){return this['options']['zIndex'];}set['zIndex'](_0x465776){const _0x2f99c2={_0x4efe8e:0x31f,_0x1a2dc5:0xe1e},_0x4777ae=_0x35a251;this[_0x4777ae(0xe86)][_0x4777ae(_0x2f99c2._0x4efe8e)]=_0x465776;if(this['_dataSource']==null||_0x465776==null)return;if(!this['_map']['dataSources']['contains'](this['_dataSource']))return;this['_dataSource']['zIndex']=_0x465776,this['_map']['dataSources']['raiseToTop'](this['_dataSource']);const _0x15a5b4=this['_map'][_0x4777ae(0x69b)];for(let _0x3ef7a7=_0x15a5b4[_0x4777ae(_0x2f99c2._0x1a2dc5)]-0x1;_0x3ef7a7>=0x0;_0x3ef7a7--){const _0xbcaaa0=_0x15a5b4['get'](_0x3ef7a7);if(_0xbcaaa0===this[_0x4777ae(0x1a3)])continue;Cesium__namespace[_0x4777ae(0xaa2)](_0xbcaaa0['zIndex'])&&_0x465776<_0xbcaaa0['zIndex']&&this['_map']['dataSources'][_0x4777ae(0x38e)](this['_dataSource']);}}get[_0x35a251(0x979)](){const _0x148130={_0x1aee76:0x357,_0x13553f:0xe86},_0x5c0669=_0x35a251;if(this['options'][_0x5c0669(0x979)])return!![];if(this[_0x5c0669(0xe86)]['symbol']&&this['options'][_0x5c0669(_0x148130._0x1aee76)]['styleOptions']&&this[_0x5c0669(_0x148130._0x13553f)]['symbol'][_0x5c0669(0x5ac)]['clampToGround'])return!![];return![];}['_setOptionsHook'](_0x27f470,_0x152fc0){const _0xd358fb={_0x57a5c3:0xbfc,_0x3aeedd:0xe86,_0x55c9f2:0x357,_0x3051e5:0xaa2,_0x118ac6:0x83e},_0x138b88=_0x35a251;var _0x425bee;super[_0x138b88(_0xd358fb._0x57a5c3)](_0x27f470,_0x152fc0);if((_0x425bee=this[_0x138b88(_0xd358fb._0x3aeedd)][_0x138b88(_0xd358fb._0x55c9f2)])!==null&&_0x425bee!==void 0x0&&_0x425bee[_0x138b88(0x5ac)]){const _0x79a3cb=this['options']['symbol']['styleOptions'];Cesium__namespace['defined'](_0x79a3cb['clampToGround'])&&(this['options']['clampToGround']=_0x79a3cb['clampToGround']);if(Cesium__namespace[_0x138b88(_0xd358fb._0x3051e5)](_0x79a3cb[_0x138b88(0x9db)])){const _0x59a3d5=Cesium__namespace['Color'][_0x138b88(0xda0)](_0x79a3cb['color']??'#FFFF00')['withAlpha'](Number(_0x79a3cb['opacity']??0.5));this[_0x138b88(_0xd358fb._0x3aeedd)]['fill']=_0x59a3d5;}if(Cesium__namespace[_0x138b88(0xaa2)](_0x79a3cb['outlineColor'])){const _0x3a530a=Cesium__namespace['Color']['fromCssColorString'](_0x79a3cb['outlineColor']??_0x79a3cb['color']??_0x138b88(_0xd358fb._0x118ac6))[_0x138b88(0x373)](_0x79a3cb['outlineOpacity']??(_0x79a3cb['opacity'],0x1));this['options']['stroke']=_0x3a530a;}Cesium__namespace['defined'](_0x79a3cb['outlineWidth'])&&(this['options']['strokeWidth']=_0x79a3cb['outlineWidth']);}}['_showHook'](_0x5614ab){const _0x139b0c={_0x54ad24:0xcba},_0x21d991=_0x35a251;super['_showHook'](_0x5614ab),this[_0x21d991(_0x139b0c._0x54ad24)]&&(this['_labelCollection']['show']=_0x5614ab);}['_mountedHook'](){super['_mountedHook'](),this['load']();}['_addedHook'](){const _0x31ddf={_0x28bce3:0x4af},_0x3375f7=_0x35a251;super['_addedHook'](),this['_dataSource']&&this['_map']['dataSources']['add'](this['_dataSource']),this['_labelCollection']&&this[_0x3375f7(0xd79)]['scene']['primitives'][_0x3375f7(_0x31ddf._0x28bce3)](this[_0x3375f7(0xcba)]);}['_removedHook'](){const _0x3338ba=_0x35a251;super[_0x3338ba(0xa9a)](),this['_labelCollection']&&(this['_map']['scene']['primitives']['remove'](this['_labelCollection']),this['_labelCollection']=null),this['_dataSource']&&this['_map'][_0x3338ba(0x69b)]['remove'](this[_0x3338ba(0x1a3)]);}['flyTo'](_0x110eef){const _0x18b131={_0x1416bd:0xd79,_0xb5bc02:0xd79},_0x5555fc=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);this['_map']['cancelFlyTo']();if(this['options']['center'])return this[_0x5555fc(_0x18b131._0x1416bd)]['setCameraView'](this['options']['center'],_0x110eef);else{if(this['options'][_0x5555fc(0x1fa)])return this[_0x5555fc(_0x18b131._0xb5bc02)]['flyToExtent'](this['options']['extent'],_0x110eef);else{if(this['_dataSource'])return this['_map'][_0x5555fc(0x8d3)]['flyTo'](this['_dataSource'],_0x110eef);}}return Promise['resolve'](![]);}[_0x35a251(0x64a)](_0x28e6f7){const _0xde3602={_0x3dd0aa:0xe86,_0x53dbdf:0xce2,_0x577346:0xd05,_0x131279:0xce2},_0xb31c23={_0x4976f7:0xe9d},_0x3393bc={_0x4a49c0:0x47f},_0x51d3b9=_0x35a251;_0x28e6f7&&((_0x28e6f7['clear']??!![])&&(delete this[_0x51d3b9(_0xde3602._0x3dd0aa)]['url'],delete this['options'][_0x51d3b9(_0xde3602._0x53dbdf)]),this['clear'](),this['options']={...this['options'],..._0x28e6f7});if(this['options'][_0x51d3b9(_0xde3602._0x577346)])fetchJson({...this['options'],'proxy':this['_proxy']})['then'](_0x22f1f7=>{const _0x1ab1f0=_0x51d3b9;if(!this['_map']||!this[_0x1ab1f0(_0x3393bc._0x4a49c0)])return;this['_load_data'](_0x22f1f7);})['catch'](_0x1c6737=>{const _0x1bfbd2=_0x51d3b9;var _0x3252b7;logError$1(_0x1bfbd2(0xf77),_0x1c6737),(_0x3252b7=this['_readyPromise'])!==null&&_0x3252b7!==void 0x0&&_0x3252b7[_0x1bfbd2(_0xb31c23._0x4976f7)]&&this[_0x1bfbd2(0x4ac)]['reject'](_0x1c6737);});else this['options'][_0x51d3b9(_0xde3602._0x131279)]?this['_load_data'](this['options']['data']):_0x28e6f7&&logWarn('CzmGeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。');return this;}['_load_data'](_0x3a157e){const _0x4c432b={_0x430728:0xd53},_0x5be25c=_0x35a251;this['options'][_0x5be25c(_0x4c432b._0x430728)]&&(_0x3a157e=this['options']['format'](_0x3a157e));const _0xb274af=Cesium__namespace['GeoJsonDataSource'][_0x5be25c(0x64a)](_0x3a157e,this['options']);_0xb274af['then'](_0x444f53=>{this['showResult'](_0x444f53);});}['showResult'](_0x222299){const _0xc4752b={_0x4e0610:0x4ac,_0x193515:0xe86,_0x585327:0x5b2,_0x20a518:0x264},_0x1251ea=_0x35a251;this['_dataSource']&&(this['_map']['dataSources'][_0x1251ea(0x1ee)](this[_0x1251ea(0x1a3)]),delete this['_dataSource']);if(!_0x222299||this['_state']===State[_0x1251ea(0xcce)])return;_0x222299['show']=this[_0x1251ea(0x987)],this['_map']['dataSources'][_0x1251ea(0x4af)](_0x222299),this[_0x1251ea(_0xc4752b._0x4e0610)][_0x1251ea(0xc74)](this),this['_dataSource']=_0x222299;this[_0x1251ea(_0xc4752b._0x193515)][_0x1251ea(0x31f)]&&(this['zIndex']=this['options']['zIndex']);const _0x5141aa=_0x222299['entities']['values'],_0x45fc02=this['bindEntities'](_0x5141aa);this[_0x1251ea(0xfb0)]!==0x1&&this['setOpacity'](this['_opacity']),this[_0x1251ea(0xe86)][_0x1251ea(_0xc4752b._0x585327)]&&this['flyToByAnimationEnd'](),this[_0x1251ea(_0xc4752b._0x20a518)](EventType['load'],{'dataSource':_0x222299,'entities':_0x5141aa,'list':_0x45fc02});}['bindEntities'](_0x537161){const _0x212b6c={_0x11f17f:0x6ed,_0x388369:0xe86},_0x2b922a=_0x35a251,_0x55cd76=[];for(let _0x1f09a8=0x0,_0x2bdd50=_0x537161['length'];_0x1f09a8<_0x2bdd50;_0x1f09a8++){const _0x4b7384=_0x537161[_0x1f09a8];_0x4b7384[_0x2b922a(_0x212b6c._0x11f17f)]=this['id'];const _0x2daa9e=this['getEntityAttr'](_0x4b7384);_0x4b7384['_attr']=_0x2daa9e||{},this['fire'](EventType['addGraphic'],{'czmObject':_0x4b7384,'attr':_0x2daa9e}),_0x55cd76[_0x2b922a(0x6de)]({..._0x2daa9e,'_entity':_0x4b7384});}return this[_0x2b922a(_0x212b6c._0x388369)]['id']=this['id'],config2Entity(_0x537161,this['options'],(_0x5c6547,_0x30a45b,_0x259462)=>{return this['lblAddFun'](_0x5c6547,_0x30a45b,_0x259462);}),_0x55cd76;}['updateStyle'](_0x2786ad){const _0x2106c1={_0x48bbeb:0x1a3,_0x33fe66:0x313},_0x50bc1d=_0x35a251;if(!this[_0x50bc1d(0x1a3)])return;_0x2786ad&&(this['options'][_0x50bc1d(0x357)]={...this['options']['symbol'],..._0x2786ad});const _0x166127=this[_0x50bc1d(_0x2106c1._0x48bbeb)][_0x50bc1d(_0x2106c1._0x33fe66)]['values'];return this[_0x50bc1d(0xe86)]['id']=this['id'],config2Entity(_0x166127,this['options'],(_0x1b6052,_0x3f7984,_0x2bf27c)=>{const _0x13e56e=_0x50bc1d;return this[_0x13e56e(0x42a)](_0x1b6052,_0x3f7984,_0x2bf27c);}),this;}['lblAddFun'](_0x76c3,_0x54edd0,_0x1acc93){const _0x1f8636={_0x533db1:0xaa2,_0x345397:0x9b2,_0x1e1d2b:0x8d3,_0x22f1f8:0xb61},_0x1526c7=_0x35a251;if(_0x54edd0['text']==='')return null;Cesium__namespace[_0x1526c7(_0x1f8636._0x533db1)](_0x54edd0['height'])&&(_0x76c3=setPositionsHeight(_0x76c3,_0x54edd0['height']));!this['labelCollection']&&(this[_0x1526c7(_0x1f8636._0x345397)]=new Cesium__namespace[(_0x1526c7(0x709))]({'scene':this[_0x1526c7(_0x1f8636._0x1e1d2b)]['scene']}),this[_0x1526c7(0x8d3)]['scene']['primitives']['add'](this[_0x1526c7(0x9b2)]));_0x54edd0[_0x1526c7(_0x1f8636._0x22f1f8)]=getPositionValue(_0x76c3);const _0x57f3cf=this['labelCollection']['add'](_0x54edd0);return _0x57f3cf['properties']=_0x1acc93,_0x57f3cf['_mars3d_layerId']=this['id'],_0x57f3cf;}[_0x35a251(0x45c)](_0x5d92bf){const _0x4efb4f={_0x905634:0xfb0,_0x3f6576:0x9db,_0x468780:0x813,_0x14e80f:0x909,_0x326880:0x282,_0xb02e8d:0x373,_0x1e20ca:0xfb0,_0x225253:0x854,_0x136918:0xd5},_0x498790=_0x35a251;this[_0x498790(_0x4efb4f._0x905634)]=_0x5d92bf;if(!this['_dataSource'])return;const _0x7be0ff=this['_dataSource']['entities']['values'];for(let _0x390efb=0x0,_0x197784=_0x7be0ff['length'];_0x390efb<_0x197784;_0x390efb++){const _0x11b839=_0x7be0ff[_0x390efb];_0x11b839[_0x498790(0x909)]&&_0x11b839[_0x498790(0x909)]['material']&&_0x11b839['polygon']['material'][_0x498790(_0x4efb4f._0x3f6576)]&&(this[_0x498790(_0x4efb4f._0x468780)](_0x11b839[_0x498790(0x909)]['material']['color'],this['_opacity']),_0x11b839[_0x498790(_0x4efb4f._0x14e80f)][_0x498790(0x218)]&&this['_updatEntityAlpha'](_0x11b839['polygon']['outlineColor'],this['_opacity']));_0x11b839[_0x498790(_0x4efb4f._0x326880)]&&_0x11b839[_0x498790(_0x4efb4f._0x326880)]['material']&&_0x11b839[_0x498790(0x282)]['material']['color']&&this['_updatEntityAlpha'](_0x11b839['polyline']['material'][_0x498790(0x9db)],this['_opacity']);_0x11b839['billboard']&&(_0x11b839[_0x498790(0x9c2)]['color']=Cesium__namespace['Color']['WHITE'][_0x498790(_0x4efb4f._0xb02e8d)](this[_0x498790(0xfb0)]));_0x11b839['model']&&(_0x11b839['model']['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](this[_0x498790(_0x4efb4f._0x1e20ca)]));if(_0x11b839['label']){let _0x5f35b3=this['_opacity'];_0x11b839['styleOpt']&&_0x11b839['styleOpt'][_0x498790(_0x4efb4f._0x225253)]&&_0x11b839['styleOpt']['label']['opacity']&&(_0x5f35b3=_0x11b839['styleOpt']['label'][_0x498790(0xbf2)]),_0x11b839[_0x498790(0x854)][_0x498790(_0x4efb4f._0x136918)]&&this['_updatEntityAlpha'](_0x11b839['label']['fillColor'],_0x5f35b3),_0x11b839['label']['outlineColor']&&this[_0x498790(0x813)](_0x11b839['label'][_0x498790(0x218)],_0x5f35b3),_0x11b839['label']['backgroundColor']&&this[_0x498790(0x813)](_0x11b839['label']['backgroundColor'],_0x5f35b3);}}}['_updatEntityAlpha'](_0xac0980,_0x52d2db){const _0x33b2d1={_0x230a2c:0x373},_0x26d847=_0x35a251;if(!_0xac0980)return;let _0x3f0c6c=getCesiumValue(_0xac0980,Cesium__namespace['Color'],this['_map']['clock']['currentTime']);if(!_0x3f0c6c||!_0x3f0c6c[_0x26d847(0x373)])return _0xac0980;_0x3f0c6c=_0x3f0c6c[_0x26d847(_0x33b2d1._0x230a2c)](_0x52d2db),_0xac0980['setValue'](_0x3f0c6c);}['getEntityAttr'](_0x44e7f3){const _0x1a0e51={_0x23bc01:0x7d9},_0x43a435=_0x35a251;return getAttrVal(_0x44e7f3[_0x43a435(_0x1a0e51._0x23bc01)]);}['clear'](){const _0x28c0c2={_0xcb73f0:0x1a3},_0x20b7f7=_0x35a251;return this['_labelCollection']&&this['_labelCollection']['removeAll'](),this[_0x20b7f7(_0x28c0c2._0xcb73f0)]&&this[_0x20b7f7(_0x28c0c2._0xcb73f0)]['entities']['removeAll'](),this[_0x20b7f7(0x400)](),this;}[_0x35a251(0x2e3)](_0x5c41d9,_0x322f50){const _0x543d2d={_0x1337a4:0x86c},_0x3ce4c3={_0x22cf37:0x1a3},_0x43105a=_0x35a251;return this['readyPromise'][_0x43105a(_0x543d2d._0x1337a4)](_0x1f8177=>{const _0x59a6f=_0x43105a,_0x5098ff=this[_0x59a6f(_0x3ce4c3._0x22cf37)]['process'](_0x5c41d9,_0x322f50);return _0x5098ff['then'](_0x474ddd=>{const _0x65616c=_0x474ddd['entities']['values'],_0x19ddb1=this['bindEntities'](_0x65616c);return{'entities':_0x65616c,'list':_0x19ddb1};});});}}register$2('czmGeojson',CzmGeoJsonLayer);class KmlLayer extends CzmGeoJsonLayer{['load'](_0xdce578={}){const _0x459594={_0x367de0:0xe86,_0xb7cef8:0xe86,_0x94e6ba:0xd79,_0xf07c58:0xc60,_0x651735:0xee1,_0x3ce331:0x979,_0x143b4b:0x86c},_0x5c8c2b={_0x520c25:0xf76},_0x575719=_0x35a251;this[_0x575719(0xe86)]={...this[_0x575719(0xe86)],..._0xdce578};let _0x39d77e;if(this['options']['url']){const _0x8919be=getUrlResource(this[_0x575719(_0x459594._0x367de0)]);_0x39d77e=Cesium__namespace['KmlDataSource'][_0x575719(0x64a)](_0x8919be,{'camera':this['_map']['scene'][_0x575719(0x7d)],'canvas':this[_0x575719(0xd79)]['scene']['canvas'],'clampToGround':this[_0x575719(_0x459594._0xb7cef8)][_0x575719(0x979)]});}else this['options'][_0x575719(0xce2)]&&(_0x39d77e=Cesium__namespace['KmlDataSource']['load'](this['options']['data'],{'camera':this[_0x575719(_0x459594._0x94e6ba)][_0x575719(_0x459594._0xf07c58)]['camera'],'canvas':this['_map'][_0x575719(0xc60)][_0x575719(_0x459594._0x651735)],'clampToGround':this['options'][_0x575719(_0x459594._0x3ce331)]}),logError$1('KmlLayer:请必须传入\x20url\x20或\x20data\x20参数'));_0x39d77e[_0x575719(_0x459594._0x143b4b)](_0x267556=>{const _0x53a7c0=_0x575719;this[_0x53a7c0(_0x5c8c2b._0x520c25)](_0x267556);});}['getEntityAttr'](_0x13a9f5){const _0x5638e0={_0x1e0701:0x500,_0x3f7fce:0xdae},_0x1936fb=_0x35a251;let _0x28a104={'name':_0x13a9f5['name'],'description':_0x13a9f5[_0x1936fb(_0x5638e0._0x1e0701)]};const _0x5a762d=_0x13a9f5['_kml'][_0x1936fb(_0x5638e0._0x3f7fce)];for(const _0x220445 in _0x5a762d){_0x28a104[_0x220445]=_0x5a762d[_0x220445][_0x1936fb(0x260)];}return _0x28a104=getAttrVal(_0x28a104),_0x28a104[_0x1936fb(0x500)]&&(_0x28a104['description']=_0x28a104[_0x1936fb(0x500)]['replace'](/]+>/g,'')),_0x28a104;}}register$2(_0x35a251(0xd03),KmlLayer);class CzmlLayer extends CzmGeoJsonLayer{['_showHook'](_0x33fec7){const _0x53a619=_0x35a251;super['_showHook'](_0x33fec7),(this['options']['updateClock']??!![])&&(_0x33fec7?this[_0x53a619(0x8a2)]():this['setNowTime']());}['setCzmlTime'](){const _0x27e0ef={_0x196f1c:0x42d,_0x2b6e39:0x586,_0x2ce0ab:0x18b},_0x447baf=_0x35a251;var _0x3fc641;(_0x3fc641=this['_dataSource'])!==null&&_0x3fc641!==void 0x0&&_0x3fc641['clock']&&(this['_map'][_0x447baf(_0x27e0ef._0x196f1c)]['clockRange']=this['_dataSource']['clock']['clockRange'],this['_map']['clock']['multiplier']=this['_dataSource'][_0x447baf(0x42d)][_0x447baf(0xbd9)],this['_map']['clock'][_0x447baf(_0x27e0ef._0x2b6e39)]=this[_0x447baf(0x1a3)]['clock']['startTime'],this['_map'][_0x447baf(_0x27e0ef._0x196f1c)]['stopTime']=this['_dataSource']['clock'][_0x447baf(0xcf0)],this['_map'][_0x447baf(_0x27e0ef._0x196f1c)][_0x447baf(_0x27e0ef._0x2ce0ab)]=this['_dataSource']['clock']['startTime']);}[_0x35a251(0xea8)](){const _0x27476e={_0x4cc2c1:0xa51,_0x36c8a3:0xd61,_0x3ac11a:0x18b},_0x26e20a=_0x35a251;this['_map']['clock'][_0x26e20a(0x355)]=Cesium__namespace['ClockRange']['UNBOUNDED'],this['_map']['clock']['multiplier']=0x1;const _0x246a50=Cesium__namespace[_0x26e20a(0x579)][_0x26e20a(_0x27476e._0x4cc2c1)](new Date());this['_map']['clock'][_0x26e20a(0x586)]=_0x246a50[_0x26e20a(_0x27476e._0x36c8a3)](),this[_0x26e20a(0xd79)]['clock']['stopTime']=Cesium__namespace[_0x26e20a(0x579)]['addDays'](_0x246a50,0x1,new Cesium__namespace['JulianDate']()),this['_map'][_0x26e20a(0x42d)][_0x26e20a(_0x27476e._0x3ac11a)]=_0x246a50['clone']();}[_0x35a251(0xa9a)](){const _0x3d4f29={_0x480046:0xc8d},_0xd5d51f=_0x35a251;super['_removedHook'](),(this['options'][_0xd5d51f(_0x3d4f29._0x480046)]??!![])&&this['setNowTime']();}[_0x35a251(0x64a)](_0x288fee={}){const _0x1e0155={_0x479024:0x7a3,_0x533b4f:0xe86},_0x117483=_0x35a251;this['options']={...this['options'],..._0x288fee};let _0x48ee34;if(this['options']['url']){const _0x21ae9b=getUrlResource(this['options']);_0x48ee34=Cesium__namespace[_0x117483(_0x1e0155._0x479024)]['load'](_0x21ae9b,this['options']);}else this['options']['data']?_0x48ee34=Cesium__namespace['CzmlDataSource']['load'](this['options']['data'],this[_0x117483(_0x1e0155._0x533b4f)]):logError$1('CzmlLayer:请必须传入\x20url\x20或\x20data\x20参数');_0x48ee34['then'](_0x57cbf4=>{this['showResult'](_0x57cbf4);});}['getEntityAttr'](_0x39beeb){if(_0x39beeb['properties'])return getAttrVal(_0x39beeb['properties']);if(_0x39beeb['description'])return{'description':getCesiumValue(_0x39beeb['description'])};}}register$2('czml',CzmlLayer);class GraphicGroupLayer extends GroupLayer{get['hasEdit'](){return this['_hasEdit'];}set['hasEdit'](_0x5111f7){const _0x597563={_0x4ee34c:0x7e7,_0x11e723:0x186},_0x46b645=_0x35a251;this[_0x46b645(0x96f)]=_0x5111f7,this['_selectedLayer']&&(_0x5111f7?this['_selectedLayer']['activateEdit']():this[_0x46b645(_0x597563._0x4ee34c)][_0x46b645(_0x597563._0x11e723)]());}get[_0x35a251(0xd40)](){return this['options']['isAutoEditing'];}set['isAutoEditing'](_0x3cd0c4){const _0x1b56d0=_0x35a251;this['options'][_0x1b56d0(0xd40)]=_0x3cd0c4,this['eachLayer'](_0x5178c8=>{_0x5178c8['isAutoEditing']=_0x3cd0c4;},this);}get['selectedLayer'](){return this['_selectedLayer'];}set['selectedLayer'](_0x2e837d){const _0x19512a={_0x411579:0x6b6,_0x306404:0x7e7},_0x5c14b9=_0x35a251;this['_selectedLayer']&&(delete this['_selectedLayer']['isActivate'],this['_selectedLayer'][_0x5c14b9(0x186)]()),!(_0x2e837d instanceof GraphicLayer)&&(_0x2e837d=this[_0x5c14b9(_0x19512a._0x411579)](_0x2e837d)),this['_selectedLayer']=_0x2e837d,this[_0x5c14b9(_0x19512a._0x306404)]&&(this['_selectedLayer']['isActivate']=!![],this['_hasEdit']&&this['_selectedLayer'][_0x5c14b9(0x633)]());}['isActivate'](_0x23d251){return _0x23d251['isActivate'];}['_mountedHook'](){const _0x2e8318={_0x1a8b9d:0xe86,_0x13ce23:0xc8c},_0x1edb5e=_0x35a251;super['_mountedHook'](),this[_0x1edb5e(_0x2e8318._0x1a8b9d)]['geojson']&&this['loadGeoJSON'](this[_0x1edb5e(0xe86)][_0x1edb5e(_0x2e8318._0x13ce23)]);}['_addedHook'](){const _0x2a6f25={_0x1f9a7d:0xef3},_0x35e3f3=_0x35a251;super[_0x35e3f3(0x97b)](),this[_0x35e3f3(_0x2a6f25._0x1f9a7d)]();}['_getOrCreateLayer'](_0x50e423){const _0x1001b3={_0x17d956:0x504,_0x1b9236:0x987},_0x590e86=_0x35a251;if(!_0x50e423)return this['selectedLayer'];if(isObject(_0x50e423)){const _0x284cb6=this[_0x590e86(0x6b6)](_0x50e423[_0x590e86(_0x1001b3._0x17d956)]);if(_0x284cb6)return Cesium__namespace['defined'](_0x50e423['id'])&&(_0x284cb6['id']=_0x50e423['id']),Cesium__namespace['defined'](_0x50e423['show'])&&(_0x284cb6[_0x590e86(_0x1001b3._0x1b9236)]=_0x50e423['show']),_0x284cb6;}else{const _0x410d3a=this['getLayer'](_0x50e423);if(_0x410d3a)return _0x410d3a;}return this['createLayer'](_0x50e423);}['createLayer'](_0x4cc29e){const _0x180316={_0x41e464:0xaa2,_0x1f1a64:0x997},_0x33f234=_0x35a251,_0x1611ed=clone(this['options'],['id','pid','geojson',_0x33f234(0xce2)]);_0x1611ed[_0x33f234(0x18d)]=this['id'];isObject(_0x4cc29e)?(_0x1611ed['name']=_0x4cc29e['name'],Cesium__namespace[_0x33f234(_0x180316._0x41e464)](_0x4cc29e['id'])&&(_0x1611ed['id']=_0x4cc29e['id']),Cesium__namespace['defined'](_0x4cc29e['show'])&&(_0x1611ed['show']=_0x4cc29e['show'])):_0x1611ed['name']=_0x4cc29e;const _0x21d0b9=new GraphicLayer(_0x1611ed);return this['_events']&&(_0x21d0b9['_events']={...this[_0x33f234(_0x180316._0x1f1a64)]}),this[_0x33f234(0xd79)]['addLayer'](_0x21d0b9),this[_0x33f234(0x6f7)](_0x21d0b9),_0x21d0b9;}[_0x35a251(0xf0c)](_0x936b65){const _0x2fa410=_0x35a251;let _0x377de0;return _0x936b65 instanceof GraphicLayer?_0x377de0=_0x936b65:_0x377de0=this['getLayer'](_0x936b65),_0x377de0?(this['selectedLayer']===_0x377de0&&(this[_0x2fa410(0x78f)]=null),removeArrayItem(this['_arrLayer'],_0x377de0),this['_map']['removeLayer'](_0x377de0,!![]),this['_processForRemoveLayer'](),!![]):![];}['deleteEmptyLayer'](){const _0xaf47b8={_0xf81ceb:0xba0},_0x40ad09=_0x35a251;for(let _0x28d9c3=this[_0x40ad09(_0xaf47b8._0xf81ceb)]['length']-0x1;_0x28d9c3>=0x0;_0x28d9c3--){const _0x3c3a1f=this['_arrLayer'][_0x28d9c3];_0x3c3a1f['length']===0x0&&(this['selectedLayer']===_0x3c3a1f&&(this[_0x40ad09(0x78f)]=null),this['_arrLayer']['splice'](_0x28d9c3,0x1),this['_map']['removeLayer'](_0x3c3a1f,!![]));}return this[_0x40ad09(0xef3)](),this;}['_processForRemoveLayer'](){const _0x36789a={_0x1293c7:0x610,_0xac1b47:0xba0},_0xa213f8=_0x35a251;this['_arrLayer']['length']===0x0&&this[_0xa213f8(0xe86)]['defaultLayer']&&(this['selectedLayer']=this[_0xa213f8(_0x36789a._0x1293c7)](this['options'][_0xa213f8(0xb4e)])),this['selectedLayer']==null&&this[_0xa213f8(_0x36789a._0xac1b47)]['length']>0x0&&(this['selectedLayer']=this[_0xa213f8(_0x36789a._0xac1b47)][0x0]);}[_0x35a251(0x951)](_0x3e3979,_0x5eb913){const _0x295983={_0x549449:0x1ee},_0x379d03=_0x35a251;!(_0x5eb913 instanceof GraphicLayer)&&(_0x5eb913=this['getLayer'](_0x5eb913)),_0x3e3979[_0x379d03(_0x295983._0x549449)](),_0x5eb913['addGraphic'](_0x3e3979);}['getGraphics'](){const _0x5733ae=_0x35a251,_0x55174a=[];return this[_0x5733ae(0xfca)](_0x506a93=>{if(_0x506a93['isPrivate'])return;_0x55174a['push'](_0x506a93);},this),_0x55174a;}['getGraphicById'](_0x346c98){const _0x4fabc1=_0x35a251;if(!_0x346c98)return undefined;for(let _0x26bd4f=this['_arrLayer']['length']-0x1;_0x26bd4f>=0x0;_0x26bd4f--){const _0x426aba=this[_0x4fabc1(0xba0)][_0x26bd4f],_0x77fe2a=_0x426aba['getGraphicById'](_0x346c98);if(_0x77fe2a)return _0x77fe2a;}return undefined;}[_0x35a251(0xfca)](_0x5d7b09,_0x2493ee){return this['eachLayer'](_0x2a98f0=>{const _0x3504eb=_0x2767;_0x2a98f0[_0x3504eb(0xfca)](_0x5d7b09,_0x2493ee);},this),this;}['clear'](_0x5dd9b2){this['eachLayer'](_0x2aac38=>{_0x2aac38['clear'](_0x5dd9b2);},this);}['toGeoJSON'](_0x280b66){const _0x16092b={_0x13ff18:0x5e0,_0x21913b:0x77c},_0x3ce73d={_0x1f8367:0x504,_0x197cc8:0xfca},_0x1011f0={_0xd2a50:0x504},_0x451d9c=_0x35a251;_0x280b66!==null&&_0x280b66!==void 0x0&&_0x280b66[_0x451d9c(_0x16092b._0x13ff18)]&&this[_0x451d9c(_0x16092b._0x21913b)]();const _0x52a04d=[],_0x5e437d=[];return this['eachLayer'](_0x4e613d=>{const _0x183407=_0x451d9c;_0x5e437d['push']({'id':_0x4e613d['id'],'name':_0x4e613d[_0x183407(_0x3ce73d._0x1f8367)],'show':_0x4e613d['show']}),_0x4e613d[_0x183407(_0x3ce73d._0x197cc8)](_0x4fba42=>{const _0x1721c0=_0x183407;if(_0x4fba42['isPrivate'])return;const _0x1e665d=_0x4fba42[_0x1721c0(0x694)](_0x280b66);_0x1e665d['properties']['_layer']=_0x4e613d[_0x1721c0(_0x1011f0._0xd2a50)],_0x52a04d['push'](_0x1e665d);},this);},this),{'type':'FeatureCollection','layer':{'id':this['id'],'name':this['name'],'layers':_0x5e437d,'selected':this['selectedLayer']['id']},'features':_0x52a04d};}[_0x35a251(0x336)](_0x52bbbb,_0x477c6e={}){const _0x332a8d={_0x196c2d:0x4c3,_0x46f444:0x87,_0xfc5ec1:0x658,_0x5a7ac3:0xe1e},_0x181d18=_0x35a251;try{isString(_0x52bbbb)&&(_0x52bbbb=JSON[_0x181d18(0x8d0)](_0x52bbbb));}catch(_0x4df728){alert(_0x4df728['name']+':\x20'+_0x4df728[_0x181d18(_0x332a8d._0x196c2d)]+'\x20\x0a请确认json文件格式正确!!!');return;}_0x477c6e['clear']&&this[_0x181d18(0x386)](!![]);let _0x4219f5;if(_0x477c6e['layer'])_0x4219f5=this['getLayer'](_0x477c6e[_0x181d18(0x87)]);else{var _0x46b062,_0x13e1bc;const _0x3cec9f={},_0x56a817=(_0x46b062=_0x52bbbb)===null||_0x46b062===void 0x0?void 0x0:(_0x13e1bc=_0x46b062[_0x181d18(_0x332a8d._0x46f444)])===null||_0x13e1bc===void 0x0?void 0x0:_0x13e1bc[_0x181d18(_0x332a8d._0xfc5ec1)];if(_0x56a817){var _0x454847,_0x42c254;for(let _0x4d8892=0x0;_0x4d8892<_0x56a817[_0x181d18(_0x332a8d._0x5a7ac3)];_0x4d8892++){const _0x594632=this['_getOrCreateLayer'](_0x56a817[_0x4d8892]);_0x3cec9f[_0x594632['id']]=_0x594632;}if((_0x454847=_0x52bbbb)!==null&&_0x454847!==void 0x0&&(_0x42c254=_0x454847['layer'])!==null&&_0x42c254!==void 0x0&&_0x42c254['selected']){var _0x23cc68,_0x29d5c0;const _0x36ea6e=_0x3cec9f[(_0x23cc68=_0x52bbbb)===null||_0x23cc68===void 0x0?void 0x0:(_0x29d5c0=_0x23cc68['layer'])===null||_0x29d5c0===void 0x0?void 0x0:_0x29d5c0[_0x181d18(0x6bc)]];_0x36ea6e&&(this[_0x181d18(0x78f)]=_0x36ea6e);}}}const _0x109f85=getGeoJsonFeatures(_0x52bbbb);let _0x2911f9=[];for(let _0x3c2970=0x0,_0x28263e=_0x109f85['length'];_0x3c2970<_0x28263e;_0x3c2970++){const _0x3ceb24=_0x109f85[_0x3c2970];let _0x3d4f61;if(_0x4219f5)_0x3d4f61=_0x4219f5;else{var _0x35d219;const _0x261254=_0x3ceb24===null||_0x3ceb24===void 0x0?void 0x0:(_0x35d219=_0x3ceb24['properties'])===null||_0x35d219===void 0x0?void 0x0:_0x35d219['_layer'];_0x3d4f61=_0x261254?this['getLayer'](_0x261254):null,!_0x3d4f61&&(_0x3d4f61=this['selectedLayer']);}const _0x566b66=_0x3d4f61[_0x181d18(0x336)](_0x3ceb24,{..._0x477c6e,'clear':![],'flyTo':![]});_0x2911f9=_0x2911f9[_0x181d18(0x93a)](_0x566b66);}return _0x477c6e[_0x181d18(0x5b2)]&&this['_map'][_0x181d18(0xdc4)](_0x2911f9),_0x2911f9;}[_0x35a251(0xbdb)](_0x9ca672){const _0xfd25c8={_0x569375:0xc8c,_0x188ed0:0x694},_0x5041c4=_0x35a251;_0x9ca672[_0x5041c4(_0xfd25c8._0x569375)]=this[_0x5041c4(_0xfd25c8._0x188ed0)]();}['getRectangle'](_0x41bdf1){const _0x4d2469={_0x4af44c:0xd8c};let _0x2574bc;return this['eachGraphic'](_0x12812f=>{const _0x459d4a=_0x2767;if(_0x12812f['isPrivate'])return;if(!_0x12812f['getRectangle'])return;const _0x480be9=_0x12812f['getRectangle']();if(!Cesium__namespace['defined'](_0x480be9))return;_0x2574bc?_0x2574bc=Cesium__namespace['Rectangle'][_0x459d4a(_0x4d2469._0x4af44c)](_0x480be9,_0x2574bc):_0x2574bc=_0x480be9;},this),_0x41bdf1?formatRectangle(_0x2574bc):_0x2574bc;}['startDraw'](_0x142c10){return this['_selectedLayer']['startDraw'](_0x142c10);}['stopDraw'](){const _0x413854={_0x5179d4:0x7e7},_0x13d868=_0x35a251;return this[_0x13d868(_0x413854._0x5179d4)]['stopDraw']();}['activateEdit'](){return this['_selectedLayer']['activateEdit']();}['disableEdit'](){return this['_selectedLayer']['disableEdit']();}}register$2(_0x35a251(0x9ab),GraphicGroupLayer);class GeoJsonLayer extends GraphicLayer{['_showHook'](_0x36e045){const _0x5bb5cd={_0x1554f4:0xd2a},_0x56ab4c=_0x35a251;super['_showHook'](_0x36e045),_0x36e045&&this[_0x56ab4c(_0x5bb5cd._0x1554f4)]&&(this['_hasLoad']=![],this['load']());}['_addedHook'](){const _0x1a111e=_0x35a251;super['_addedHook'](),this['show']?this['load']():this[_0x1a111e(0xd2a)]=!![];}[_0x35a251(0xa9a)](){const _0x3feb46={_0x7c6a5a:0x386},_0x342ed4=_0x35a251;super['_removedHook'](),this[_0x342ed4(_0x3feb46._0x7c6a5a)]();}['load'](_0x55bd0a){const _0x188190={_0x2c8f86:0xe86,_0x319ffe:0xce2},_0x3fe4a1={_0x1ba202:0xf77},_0x1fb472=_0x35a251;_0x55bd0a&&(Cesium__namespace['defaultValue'](_0x55bd0a[_0x1fb472(0x386)],!![])&&(delete this['options']['url'],delete this['options']['data']),this['clear'](),this['options']={...this[_0x1fb472(0xe86)],..._0x55bd0a});if(this[_0x1fb472(_0x188190._0x2c8f86)]['url'])sendAjax({...this['options'],'proxy':this['_proxy']})['then'](_0x46e277=>{if(!this['_map']||this['_state']!==State['ADDED'])return;this['_load_data'](_0x46e277);})['catch'](_0x3ac347=>{const _0x5c402d=_0x1fb472;var _0x4f792d;logError$1(_0x5c402d(_0x3fe4a1._0x1ba202),_0x3ac347),(_0x4f792d=this['_readyPromise'])!==null&&_0x4f792d!==void 0x0&&_0x4f792d['reject']&&this['_readyPromise']['reject'](_0x3ac347);});else this['options']['data']?this['_load_data'](this['options'][_0x1fb472(_0x188190._0x319ffe)]):_0x55bd0a&&logWarn('GeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。');}['_load_data'](_0x39c416){const _0x4e9c7c={_0x392da4:0xe86,_0x43f772:0xd53,_0x5be2c2:0x37b},_0x7b077=_0x35a251;this[_0x7b077(_0x4e9c7c._0x392da4)][_0x7b077(_0x4e9c7c._0x43f772)]&&(_0x39c416=this['options']['format'](_0x39c416));_0x39c416=this[_0x7b077(_0x4e9c7c._0x5be2c2)](_0x39c416);const _0x3c9c53=this['loadGeoJSON'](_0x39c416,{'clear':!![],'enabledEvent':![]}),_0x4adf13=[];_0x3c9c53[_0x7b077(0xdbd)](_0x4160cb=>{_0x4adf13['push']({..._0x4160cb['attr'],'graphic':_0x4160cb});}),this['fire'](EventType['load'],{'geojson':_0x39c416,'list':_0x4adf13,'graphics':_0x3c9c53}),this['options'][_0x7b077(0x5b2)]&&this['flyToByAnimationEnd'](),this['_readyPromise']['resolve'](this);}[_0x35a251(0x37b)](_0x203270){const _0x4013bc={_0x3cc94a:0x830,_0x3cf6c1:0xaa2,_0x2eddab:0x5e2,_0x4ded5e:0x58f,_0x5cc119:0xa0b,_0x5f3cdf:0xf30,_0x115a85:0xe1e,_0x1790d6:0x6de},_0x3d32a2=_0x35a251,_0x26f5c4=this[_0x3d32a2(0xe86)]['mask'];if(!_0x26f5c4)return _0x203270;if(!_0x203270[_0x3d32a2(0x830)]||_0x203270['features']['length']===0x0)return _0x203270;_0x203270=clone(_0x203270),_0x203270[_0x3d32a2(0x830)]['splice'](0x1,_0x203270[_0x3d32a2(_0x4013bc._0x3cc94a)]['length']-0x1),this['_extent']=getExtentByGeoJSON(_0x203270);let _0x25dd19={'xmin':0x49,'xmax':0x88,'ymin':0x3,'ymax':0x3b};isObject(_0x26f5c4)&&Cesium__namespace['defined'](_0x26f5c4[_0x3d32a2(0x5e2)])&&Cesium__namespace[_0x3d32a2(_0x4013bc._0x3cf6c1)](_0x26f5c4['xmax'])&&Cesium__namespace[_0x3d32a2(0xaa2)](_0x26f5c4['ymin'])&&Cesium__namespace[_0x3d32a2(_0x4013bc._0x3cf6c1)](_0x26f5c4['ymax'])&&(_0x25dd19=_0x26f5c4);const _0x3a2374=[[_0x25dd19[_0x3d32a2(_0x4013bc._0x2eddab)],_0x25dd19['ymax']],[_0x25dd19['xmin'],_0x25dd19['ymin']],[_0x25dd19['xmax'],_0x25dd19['ymin']],[_0x25dd19['xmax'],_0x25dd19['ymax']],[_0x25dd19[_0x3d32a2(0x5e2)],_0x25dd19['ymax']]],_0x4e284a=_0x203270['features'][0x0];if(_0x4e284a[_0x3d32a2(_0x4013bc._0x4ded5e)]['type']==='Polygon')_0x4e284a[_0x3d32a2(0x58f)]={'type':_0x3d32a2(_0x4013bc._0x5cc119),'coordinates':[_0x3a2374,_0x4e284a['geometry'][_0x3d32a2(0x310)][0x0]]};else{if(_0x4e284a['geometry']['type']===_0x3d32a2(_0x4013bc._0x5f3cdf)){const _0x27e144=[_0x3a2374];for(let _0x19443b=0x0,_0x4fd48b=_0x4e284a['geometry'][_0x3d32a2(0x310)][_0x3d32a2(_0x4013bc._0x115a85)];_0x19443b<_0x4fd48b;_0x19443b++){const _0x2b5ebe=_0x4e284a['geometry'][_0x3d32a2(0x310)][_0x19443b];_0x2b5ebe['length']>0x0&&_0x27e144[_0x3d32a2(_0x4013bc._0x1790d6)](_0x2b5ebe[0x0]);}_0x4e284a['geometry']={'type':'Polygon','coordinates':[_0x27e144]};}else{if(_0x4e284a['geometry']['type']==='GeometryCollection'){const _0x31c131=[_0x3a2374];for(let _0x5a3e85=0x0,_0x3b959c=_0x4e284a['geometry']['geometries']['length'];_0x5a3e85<_0x3b959c;_0x5a3e85++){const _0x215acd=_0x4e284a[_0x3d32a2(_0x4013bc._0x4ded5e)]['geometries'][_0x5a3e85]['coordinates'];_0x215acd['length']>0x0&&_0x31c131['push'](_0x215acd[0x0]);}_0x4e284a['geometry']={'type':'Polygon','coordinates':[_0x31c131]};}}}return _0x203270;}['_toJsonEx'](_0xd84069){}['_setOptionsHook'](_0x4bbb67,_0x2d2b18){const _0x358b11=_0x35a251;var _0x247ef1;super['_setOptionsHook'](_0x4bbb67,_0x2d2b18);if(!this[_0x358b11(0xd79)])return;_0x2d2b18['symbol']&&!((_0x247ef1=_0x2d2b18[_0x358b11(0x357)])!==null&&_0x247ef1!==void 0x0&&_0x247ef1[_0x358b11(0x8ea)])?this['eachGraphic'](_0xab58c2=>{const _0x1083d5=_0x358b11,_0x1831c2=getSymbolStyle(_0x4bbb67['symbol'],_0xab58c2[_0x1083d5(0x6b3)]);delete _0x1831c2['highlight'],_0xab58c2['style']=_0x1831c2;}):(this['clear'](),this['load']());}}register$2('geojson',GeoJsonLayer);class BusineDataLayer extends GraphicLayer{[_0x35a251(0xa40)](_0x2ef7a8){const _0x5be9b3={_0x23a143:0xa40},_0x118bb5=_0x35a251;super[_0x118bb5(_0x5be9b3._0x23a143)](_0x2ef7a8),_0x2ef7a8&&this['_hasLoad']&&(this['_hasLoad']=![],this['load']());}['_addedHook'](){const _0x4ccd3e={_0x50f006:0x97b},_0x2d4c75=_0x35a251;super[_0x2d4c75(_0x4ccd3e._0x50f006)](),this['show']?this[_0x2d4c75(0x64a)]():this['_hasLoad']=!![];}['_removedHook'](){const _0x1b8ef6=_0x35a251;super[_0x1b8ef6(0xa9a)](),this['clear']();}[_0x35a251(0x64a)](_0x206181){const _0x452ba5={_0x3e4e7b:0xeb7},_0x1018fd={_0x131427:0x47f},_0x20dea1=_0x35a251;_0x206181&&(Cesium__namespace['defaultValue'](_0x206181['clear'],!![])&&(delete this['options']['url'],delete this['options']['data']),this['clear'](),this[_0x20dea1(0xe86)]={...this['options'],..._0x206181});if(this['options']['url'])fetchJson({...this['options'],'proxy':this['_proxy']})['then'](_0x23836e=>{const _0x471ae7=_0x20dea1;if(!this['_map']||!this[_0x471ae7(_0x1018fd._0x131427)])return;this['_load_data'](_0x23836e);})[_0x20dea1(_0x452ba5._0x3e4e7b)](_0x57c306=>{var _0x51d1fc;logError$1('fetchJson出错了',_0x57c306),(_0x51d1fc=this['_readyPromise'])!==null&&_0x51d1fc!==void 0x0&&_0x51d1fc['reject']&&this['_readyPromise']['reject'](_0x57c306);});else this['options']['data']?this['_load_data'](this[_0x20dea1(0xe86)]['data']):_0x206181&&logWarn(_0x20dea1(0xa26));}[_0x35a251(0x486)](_0x77ee05){const _0x3d80a1={_0x164ca4:0xb0c,_0x2e9b56:0xdbd,_0x5d0102:0x8ea,_0x53d9f7:0x8ea,_0x5ab805:0x4d4,_0x28dc75:0xfa7,_0x69084a:0xb9d,_0x8de57c:0xb61,_0xf99ac9:0x5d2},_0x5c8e0f={_0x10d561:0x6de},_0x33af7a=_0x35a251;if(this['options']['dataColumn']){const _0x556918=this['options']['dataColumn'][_0x33af7a(_0x3d80a1._0x164ca4)]('.');_0x556918[_0x33af7a(_0x3d80a1._0x2e9b56)](_0x48121b=>{_0x77ee05=_0x77ee05[_0x48121b];});}this['options']['formatData']&&(_0x77ee05=this[_0x33af7a(0xe86)]['formatData'](_0x77ee05));const _0x233f37=[];for(let _0x3bc95d=0x0,_0xd1086c=_0x77ee05[_0x33af7a(0xe1e)];_0x3bc95d<_0xd1086c;_0x3bc95d++){const _0x55e374=_0x77ee05[_0x3bc95d];let _0x55435f={};_0x55e374['style']&&(_0x55435f={..._0x55e374['style']});const _0x3e85cc=this[_0x33af7a(0xe86)][_0x33af7a(0x357)];let _0x2a9fa7=_0x55e374[_0x33af7a(_0x3d80a1._0x5d0102)]&&hasType(_0x55e374[_0x33af7a(_0x3d80a1._0x53d9f7)])?_0x55e374['type']:'point';if(_0x3e85cc){if(isFunction(_0x3e85cc))_0x55435f=_0x3e85cc(_0x55e374,_0x55435f)||_0x55435f,_0x55435f[_0x33af7a(_0x3d80a1._0x53d9f7)]&&(_0x2a9fa7=_0x55435f['type']);else{_0x2a9fa7=_0x3e85cc[_0x33af7a(0x8ea)]||_0x2a9fa7;const _0x333357=getSymbolStyle(_0x3e85cc,_0x55e374||{});_0x3e85cc['merge']?_0x55435f={..._0x333357,..._0x55435f}:_0x55435f=_0x333357;}}if(!hasType(_0x2a9fa7)){logError$1(_0x33af7a(_0x3d80a1._0x5ab805),_0x55e374);continue;}const _0x185962={'type':_0x2a9fa7,'style':_0x55435f,'attr':_0x55e374};if(isPointType(_0x2a9fa7)){if(_0x55e374['position'])_0x185962[_0x33af7a(0xb61)]=_0x55e374['position'];else{if(this['options']['formatPosition'])_0x185962['position']=this['options']['formatPosition'](_0x55e374,_0x185962);else{if(this['options']['latColumn']||this['options']['lngColumn']){const _0x216920=_0x55e374[this['options']['latColumn']||'lat'],_0x54bba7=_0x55e374[this['options']['lngColumn']||_0x33af7a(_0x3d80a1._0x28dc75)],_0x43df54=_0x55e374[this['options'][_0x33af7a(0x9fd)]||'alt']||0x0;_0x185962['position']=[_0x54bba7,_0x216920,_0x43df54];}else _0x55e374[_0x33af7a(_0x3d80a1._0x69084a)]&&_0x55e374['lng']&&(_0x185962[_0x33af7a(_0x3d80a1._0x8de57c)]=[_0x55e374['lng'],_0x55e374[_0x33af7a(_0x3d80a1._0x69084a)],_0x55e374[_0x33af7a(_0x3d80a1._0xf99ac9)]||0x0]);}}if(!_0x185962['position']){logError$1('无法解析数据position坐标位置',_0x55e374);continue;}}else{if(_0x55e374['positions'])_0x185962['positions']=_0x55e374['positions'];else this[_0x33af7a(0xe86)][_0x33af7a(0x300)]&&(_0x185962[_0x33af7a(0xb35)]=this['options'][_0x33af7a(0x300)](_0x55e374,_0x185962));if(!_0x185962['positions']){logError$1('无法解析数据positions坐标位置',_0x55e374);continue;}}_0x233f37[_0x33af7a(0x6de)](_0x185962);}const _0x10d7a9=this['_addGraphicByArrOptions'](_0x233f37,{'enabledEvent':![]}),_0x12db07=[];_0x10d7a9['forEach'](_0x4a5913=>{const _0x1a64c8=_0x33af7a;_0x12db07[_0x1a64c8(_0x5c8e0f._0x10d561)]({..._0x4a5913['attr'],'graphic':_0x4a5913});}),this['fire'](EventType['load'],{'jsonData':_0x77ee05,'list':_0x12db07,'graphics':_0x10d7a9}),this['options']['flyTo']&&this['flyToByAnimationEnd'](),this['_readyPromise']['resolve'](this);}['_toJsonEx'](_0x3d6988){}['_setOptionsHook'](_0x52496d,_0x2df675){const _0x1621cd=_0x35a251;var _0x32a926;super['_setOptionsHook'](_0x52496d,_0x2df675);if(!this['_map'])return;_0x2df675['symbol']&&!((_0x32a926=_0x2df675['symbol'])!==null&&_0x32a926!==void 0x0&&_0x32a926[_0x1621cd(0x8ea)])?this[_0x1621cd(0xfca)](_0x246e49=>{const _0x45dead=_0x1621cd,_0x37c731=getSymbolStyle(_0x52496d['symbol'],_0x246e49['attr']);_0x246e49[_0x45dead(0xfc8)]=_0x37c731;}):(this[_0x1621cd(0x386)](),this[_0x1621cd(0x64a)]());}}register$2('busineData',BusineDataLayer);class EditTileset extends EditBase{get[_0x35a251(0x87)](){const _0x2fabb1=_0x35a251;return this[_0x2fabb1(0x163)];}get['style'](){return this['_graphic']['options'];}[_0x35a251(0x53e)](){const _0x3f0021={_0x14d0a8:0xf01,_0x48a6f2:0x163},_0x5ec79a=_0x35a251;this['_contextmenuConfig_bak']=this[_0x5ec79a(0x87)][_0x5ec79a(0x606)],this[_0x5ec79a(_0x3f0021._0x14d0a8)]({'dragger':this[_0x5ec79a(_0x3f0021._0x48a6f2)],'onDrag':(_0x4d3e1c,_0x46fd94)=>{this['_graphic']['position']=_0x46fd94;}});}['finish'](){const _0x208fef={_0x5b7101:0x163,_0x5f0ba0:0xb3d},_0x2156d3=_0x35a251;delete this[_0x2156d3(0x163)]['_draw_tooltip'],delete this[_0x2156d3(_0x208fef._0x5b7101)][_0x2156d3(_0x208fef._0x5f0ba0)],delete this['_graphic']['_noMousePick'],delete this['_graphic']['_pointType'],delete this['_graphic'][_0x2156d3(0xd46)],this['_graphic']['unbindContextMenu'](),this['_contextmenuConfig_bak']&&(this[_0x2156d3(0x87)]['_contextmenuConfig']=this['_contextmenuConfig_bak'],delete this['_contextmenuConfig_bak']);}[_0x35a251(0xe34)](_0x3545ee){const _0x56d9c4={_0x5907b5:0xc7},_0x1de431=_0x35a251,_0x175f19=this[_0x1de431(0xd79)]['mouseEvent'][_0x1de431(0xc57)](_0x3545ee['position'],_0x3545ee);if(_0x175f19[_0x1de431(0x87)]!==this['layer'])return;const _0x3eb55d=_0x175f19===null||_0x175f19===void 0x0?void 0x0:_0x175f19['layer'];if(!_0x3eb55d||!_0x3eb55d['_isDragger'])return;this['_map'][_0x1de431(0xc60)][_0x1de431(0xbbb)]['enableInputs']&&(this[_0x1de431(0xd79)]['scene'][_0x1de431(0xbbb)]['enableInputs']=![],this['_hasChangeEnableInputs']=!![]),this['_map']['_setEditCursor'](!![]),_0x3eb55d[_0x1de431(0x400)](),this['_draggerIng']=_0x3eb55d,this['fire'](EventType[_0x1de431(_0x56d9c4._0x5907b5)],{..._0x3545ee,..._0x175f19,'index':this['_draggerIng']['index']});}['_onMouseMoveDraggerHandler'](_0x1de27f){const _0x2923c9={_0x552171:0x674,_0x20739b:0xd46},_0x58c3a4=_0x35a251;this['_map']['openSmallTooltip'](_0x1de27f[_0x58c3a4(0x37e)],this['_map']['getLangText']('_释放后完成修改'));const _0x1a5d9b=getCurrentMouseTerrainPosition(this[_0x58c3a4(0xd79)][_0x58c3a4(0xc60)],_0x1de27f['endPosition']);_0x1a5d9b&&(this[_0x58c3a4(_0x2923c9._0x552171)]['onDrag']&&this['_draggerIng'][_0x58c3a4(_0x2923c9._0x20739b)](this['_draggerIng'],_0x1a5d9b)),this['fire'](EventType['editMouseMove'],{..._0x1de27f,'index':this['_draggerIng']['index'],'cartesian':_0x1a5d9b,'windowPosition':_0x1de27f[_0x58c3a4(0x37e)]});}['_onMouseMoveMapHandler'](_0x84c632){const _0x393a97={_0x552ec0:0x87,_0x31ebee:0x604,_0x5e5d22:0xb91},_0x18fd5d=_0x35a251,_0x17b62a=this['_map']['mouseEvent']['getPickTarget'](_0x84c632['endPosition'],_0x84c632),_0xd9d92f=_0x17b62a===null||_0x17b62a===void 0x0?void 0x0:_0x17b62a[_0x18fd5d(_0x393a97._0x552ec0)];if(_0xd9d92f==null){this['_map'][_0x18fd5d(_0x393a97._0x31ebee)]();return;}if(_0x17b62a['layer']!==this['layer']||!_0xd9d92f['_isDragger'])return;if(this['_map'][_0x18fd5d(_0x393a97._0x5e5d22)]['show']&&this['_map'][_0x18fd5d(0xb91)]['target']===_0xd9d92f)return;const _0x116abf=_0xd9d92f['_draw_tooltip'];if(!_0x116abf)return;this['_map'][_0x18fd5d(0x771)](_0x84c632[_0x18fd5d(0x37e)],_0x116abf);}[_0x35a251(0x29e)](_0x17f5cf){const _0x13d450={_0x1b8127:0x29e,_0x23c657:0x6de,_0x5db9f9:0xe8a},_0x6d3f87={_0x4bc21f:0x936},_0x4389e6=_0x35a251,_0x49fe60=super[_0x4389e6(_0x13d450._0x1b8127)](_0x17f5cf);return Cesium__namespace['defaultValue'](this['style']['hasEditRotate'],!![])&&(_0x49fe60['push']({'text':this['_map'][_0x4389e6(0x44e)]('_按轴旋转'),'icon':Icon[_0x4389e6(0xf0f)],'show':_0x590af6=>{return!this['_matrixRotate']||this['_matrixRotate']['_dragger_index']!==_0x17f5cf['index'];},'callback':_0x283070=>{const _0x4c8e53=_0x4389e6;var _0x3e43d4;const _0x1668b0=(_0x3e43d4=_0x283070['graphic'])!==null&&_0x3e43d4!==void 0x0&&_0x3e43d4['position']?_0x283070['graphic']:_0x283070['layer'];this[_0x4c8e53(_0x6d3f87._0x4bc21f)](_0x1668b0,_0x283070);}}),_0x49fe60[_0x4389e6(_0x13d450._0x23c657)]({'text':this['_map']['getLangText'](_0x4389e6(0xc16)),'icon':Icon[_0x4389e6(_0x13d450._0x5db9f9)],'show':_0x1d8355=>{return this['_matrixRotate']&&this['_matrixRotate']['_dragger_index']===_0x17f5cf['index'];},'callback':_0x487093=>{this['stopRotateMatrix']();}})),_0x49fe60;}['startRotateMatrix'](_0xdd1fbb,_0x1b0c68){const _0x2b3a24={_0x19bf06:0xab7,_0x28c5f5:0xab7},_0xc53467={_0x2c4997:0x41f},_0x46e859=_0x35a251;!_0xdd1fbb&&(_0xdd1fbb=this['layer']),this[_0x46e859(0x32d)](),this['stopRotateMatrix'](),this[_0x46e859(_0x2b3a24._0x19bf06)]=new MatrixRotate({'map':this['_map'],'position':_0xdd1fbb[_0x46e859(0xb61)],'roll':_0xdd1fbb['rotation_x'],'pitch':_0xdd1fbb[_0x46e859(0x924)],'heading':_0xdd1fbb[_0x46e859(0x278)]}),this['_map']['addThing'](this[_0x46e859(_0x2b3a24._0x28c5f5)]),this['_matrixRotate']['on'](EventType['change'],_0xb3d7e6=>{const _0x1d2f57=_0x46e859;_0xdd1fbb['rotation']={'x':formatNum$1(_0xb3d7e6['roll'],0x2),'y':formatNum$1(_0xb3d7e6[_0x1d2f57(0x527)],0x2),'z':formatNum$1(_0xb3d7e6[_0x1d2f57(_0xc53467._0x2c4997)],0x2)};}),_0xdd1fbb['off'](EventType['updatePosition'],this['_updateMatrixMovePosition'],this),_0xdd1fbb['off'](EventType['updatePosition'],this[_0x46e859(0x4aa)],this),_0xdd1fbb['on'](EventType['updatePosition'],this['_updateMatrixRotatePosition'],this);}}class TilesetEditBase extends BaseThing{constructor(_0xc79fe4={}){const _0xc5490a={_0x3cd385:0x68c},_0x28cae5=_0x35a251;super(_0xc79fe4),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this['_rangeNumber']=0x0,this['_maxRangeLength']=0x0,this[_0x28cae5(_0xc5490a._0x3cd385)]=[];}get['list'](){return this['_areaList'];}get['layer'](){return this['_layer'];}set[_0x35a251(0x87)](_0x332496){const _0x479b20={_0x3f4dbc:0x7e0,_0x362931:0x705};this['_layer']=_0x332496,_0x332496['readyPromise']['then'](_0x3d4e35=>{const _0x348399={_0x26796f:0xd16},_0x492ec5=_0x2767;this['_modelUpAxis']=_0x332496['upAxis'],this['_center']=_0x332496['center']['toCartographic'](),this['_initLayer'](_0x332496[_0x492ec5(_0x479b20._0x3f4dbc)]),this['options'][_0x492ec5(_0x479b20._0x362931)]&&this['options']['area']['forEach'](_0x45a8ca=>{const _0x4a9629=_0x492ec5;this[_0x4a9629(_0x348399._0x26796f)](_0x45a8ca['positions'],_0x45a8ca);});});}get[_0x35a251(0xf22)](){const _0x2f304a={_0xf0067b:0x87,_0x31e8ea:0xe86,_0x5aad15:0x738,_0xe11d2b:0xe86,_0x176614:0x738},_0x4f8681=_0x35a251;var _0x74140d,_0x125b24;const _0xc84e51=this[_0x4f8681(_0x2f304a._0xf0067b)];if(_0xc84e51!==null&&_0xc84e51!==void 0x0&&(_0x74140d=_0xc84e51[_0x4f8681(_0x2f304a._0x31e8ea)])!==null&&_0x74140d!==void 0x0&&_0x74140d['editHeight'])return _0xc84e51[_0x4f8681(0xe86)][_0x4f8681(0xf22)];if(this[_0x4f8681(0xe86)][_0x4f8681(0xf22)])return this['options']['editHeight'];if(_0xc84e51!==null&&_0xc84e51!==void 0x0&&(_0x125b24=_0xc84e51['options'])!==null&&_0x125b24!==void 0x0&&_0x125b24[_0x4f8681(_0x2f304a._0x5aad15)])return _0xc84e51['options']['flatHeight'];if(this[_0x4f8681(_0x2f304a._0xe11d2b)][_0x4f8681(_0x2f304a._0x176614)])return this[_0x4f8681(_0x2f304a._0x31e8ea)][_0x4f8681(_0x2f304a._0x176614)];return 0x0;}get['tileset'](){const _0xe4891c={_0x41787c:0x7e0},_0x5f1411=_0x35a251;return this[_0x5f1411(0xf99)][_0x5f1411(_0xe4891c._0x41787c)];}get['length'](){const _0x26ee61={_0x532d39:0xe1e},_0x484381=_0x35a251;if(this['_areaList']){var _0x443de7;return(_0x443de7=this[_0x484381(0x68c)])===null||_0x443de7===void 0x0?void 0x0:_0x443de7[_0x484381(_0x26ee61._0x532d39)];}else return 0x0;}['_addedHook'](){this['options']['layer']&&(this['layer']=this['options']['layer']);}['_removedHook'](){const _0x258ff6={_0x550ca9:0x386},_0x311687=_0x35a251;this[_0x311687(_0x258ff6._0x550ca9)](),this['cacheMarsOptions']&&this['cacheMarsOptions']();}['clear'](){const _0x265a4f={_0x3eed63:0xccf},_0x5619a2=_0x35a251;this[_0x5619a2(0x68c)]=[],this['_rangeNumber']=0x0,this['_maxRangeLength']=0x0,Cesium__namespace['defined'](this[_0x5619a2(_0x265a4f._0x3eed63)])&&(this[_0x5619a2(0xccf)]['destroy'](),this['_texture']=undefined);}['addArea'](_0x5a59ed,_0x3d3000={}){const _0x8c65e9={_0x447ba6:0xcf,_0x21b020:0x682},_0x575468=_0x35a251;if(!_0x5a59ed||_0x5a59ed['length']<0x3)return;_0x5a59ed=LngLatArray[_0x575468(_0x8c65e9._0x447ba6)](_0x5a59ed),this['_maxRangeLength']=Math[_0x575468(0xc9d)](this['_maxRangeLength'],_0x5a59ed['length']);const _0x40dcf1={'id':getGlobalId(),'show':!![],'height':_0x3d3000[_0x575468(_0x8c65e9._0x21b020)]||0x0,'positions':_0x5a59ed};return this['_areaList']['push'](_0x40dcf1),this['_hasUpdate']=!![],this['fire'](EventType['addItem'],{'area':_0x40dcf1}),_0x40dcf1;}['getAreaById'](_0x35693e){const _0x4a1203={_0x257b64:0x68c},_0x3f2896=_0x35a251;if(!isNumber(_0x35693e))return;for(let _0x8dd549=0x0;_0x8dd549{const _0xf77bfe=_0xfac6a5;if(!_0x3ec6ca['show'])return;_0xccc41f<_0x3ec6ca[_0xf77bfe(0xb35)]['length']&&(_0xccc41f=_0x3ec6ca['positions']['length']);}),this['_maxRangeLength']=_0xccc41f;const _0x892f2d=[];this['_areaList'][_0xfac6a5(_0x25053f._0x515955)]((_0x3bf5a2,_0x363e25)=>{const _0xe0eb33={_0x2c3959:0x6de},_0x32d7ca=_0xfac6a5;if(!_0x3bf5a2['show'])return;const _0x31c8fd=_0x3bf5a2[_0x32d7ca(0xb35)],_0x13004b=_0x31c8fd['length'],_0x23893b=Cesium__namespace['Cartesian3']['fromRadians'](this['_center']['longitude'],this[_0x32d7ca(0xb82)]['latitude'],this['_center'][_0x32d7ca(_0x20a2cc._0x482c8d)]+_0x3bf5a2[_0x32d7ca(0x682)]+this['editHeight']),_0x38e4a1=Cesium__namespace[_0x32d7ca(0x8eb)]['normalize'](_0x23893b,new Cesium__namespace['Cartesian3']());_0x892f2d[_0x32d7ca(_0x20a2cc._0x43db2e)](_0x13004b),_0x892f2d['push'](_0x13004b),_0x892f2d['push'](_0x13004b),_0x892f2d[_0x32d7ca(0x6de)](_0x13004b),_0x892f2d['push'](_0x38e4a1['x']),_0x892f2d['push'](_0x38e4a1['y']),_0x892f2d[_0x32d7ca(_0x20a2cc._0x50cf8b)](_0x38e4a1['z']),_0x892f2d['push'](_0x23893b['x']/_0x38e4a1['x']),_0x31c8fd['forEach'](_0x1b86ea=>{const _0x4a1b36=_0x32d7ca,_0x3baf91=_0x1b86ea,_0x3581fe=Cesium__namespace['Cartesian3']['normalize'](_0x3baf91,new Cesium__namespace['Cartesian3']());_0x892f2d['push'](_0x3581fe['x']),_0x892f2d['push'](_0x3581fe['y']),_0x892f2d['push'](_0x3581fe['z']),_0x892f2d[_0x4a1b36(_0xe0eb33._0x2c3959)](_0x3baf91['x']/_0x3581fe['x']);});if(_0x13004b<_0xccc41f)for(let _0x5a37ae=0x0;_0x5a37ae<_0xccc41f-_0x13004b;_0x5a37ae++){_0x892f2d['push'](0x0),_0x892f2d['push'](0x0),_0x892f2d['push'](0x0),_0x892f2d['push'](0x0);}}),this['_texture']=new Cesium__namespace['Texture']({'context':this['_map']['scene']['_context'],'pixelFormat':Cesium__namespace[_0xfac6a5(_0x25053f._0x53e816)]['RGBA'],'pixelDatatype':Cesium__namespace[_0xfac6a5(0xc3d)]['FLOAT'],'sampler':new Cesium__namespace['Sampler']({'wrapS':Cesium__namespace[_0xfac6a5(0xc0)]['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace[_0xfac6a5(_0x25053f._0x1cdb07)][_0xfac6a5(0xaf6)],'minificationFilter':Cesium__namespace['TextureMinificationFilter']['NEAREST'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['NEAREST']}),'flipY':![],'source':{'width':_0xccc41f+0x2,'height':this['_rangeNumber'],'arrayBufferView':new Float32Array(_0x892f2d)}});}['_getCustomShader'](_0xa5d98c=![]){return null;}[_0x35a251(0x99e)](){const _0x461cd7=_0x35a251,_0x226ea5=clone(this[_0x461cd7(0xe86)],['layer','eventParent']);return _0x226ea5['area']=[],this['_areaList']['forEach'](_0x41cf55=>{const _0x42fba0=_0x461cd7;_0x226ea5['area']['push']({'positions':LngLatArray['toArray'](_0x41cf55[_0x42fba0(0xb35)])});}),_0x226ea5;}}class TilesetClip extends TilesetEditBase{constructor(_0x1ee8a6={}){super(_0x1ee8a6),this['_customShadersKey']='clip';}['_getCustomShader'](_0x28ee4a=![]){const _0x3190eb={_0x331160:0x99b},_0x4b331f=_0x35a251,_0x341dce=new Cesium__namespace['CustomShader']({'fragmentShaderText':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20u_mars3d_clip_texture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_upAxis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_rangeNumber;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_maxRangeLength;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20restorePoint_mars3d_clip(vec4\x20point)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20outpoint\x20=\x20point.xyz\x20*\x20point.w;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20czm_inverseModel\x20*\x20vec4(outpoint,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20getRegions_mars3d_clip(int\x20x,\x20int\x20y)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20(float(x)\x20+\x200.5)\x20/\x20float(u_mars3d_clip_maxRangeLength\x20+\x202);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20(float(y)\x20+\x200.5)\x20/\x20float(u_mars3d_clip_rangeNumber);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20point\x20=\x20texture(u_mars3d_clip_texture,\x20vec2(u,\x20v));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20point;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20bool\x20inRectangle_mars3d_clip(vec3\x20textPoint)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20h\x20=\x200;\x20h\x20<\x20100000;\x20h++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(h\x20>=\x20u_mars3d_clip_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_clip(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_clip_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_clip_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20fsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(inRectangle_mars3d_clip(positionMC)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20'});return _0x341dce[_0x4b331f(0x99b)]['u_mars3d_clip_texture']=()=>{const _0x3d54f1=_0x4b331f;return Cesium__namespace['defined'](this['_texture'])?this['_texture']:this['_map']['scene']['_context'][_0x3d54f1(0x641)];},_0x341dce['uniformMap']['u_mars3d_clip_upAxis']=()=>{const _0x44f6eb=_0x4b331f;return this[_0x44f6eb(0xda7)];},_0x341dce['uniformMap']['u_mars3d_clip_rangeNumber']=()=>{return this['_rangeNumber'];},_0x341dce[_0x4b331f(_0x3190eb._0x331160)]['u_mars3d_clip_maxRangeLength']=()=>{return this['_maxRangeLength'];},_0x341dce;}}class TilesetFlat extends TilesetEditBase{constructor(_0x551b2d={}){super(_0x551b2d),this['_customShadersKey']='flat';}['_getCustomShader'](_0x2bbf13=![]){const _0x5165ac={_0x7ddb09:0x2a8},_0x6a0a65={_0x3442c3:0x85b},_0x43238e=_0x35a251,_0x1a86ab=new Cesium__namespace[(_0x43238e(0x416))]({'vertexShaderText':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20u_mars3d_flat_texture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_upAxis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_rangeNumber;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_maxRangeLength;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20restorePoint_mars3d_flat(vec4\x20point)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20outpoint\x20=\x20point.xyz\x20*\x20point.w;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20czm_inverseModel\x20*\x20vec4(outpoint,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20getRegions_mars3d_flat(int\x20x,\x20int\x20y)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20(float(x)\x20+\x200.5)\x20/\x20float(u_mars3d_flat_maxRangeLength\x20+\x202);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20(float(y)\x20+\x200.5)\x20/\x20float(u_mars3d_flat_rangeNumber);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20point\x20=\x20texture(u_mars3d_flat_texture,\x20vec2(u,\x20v));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20point;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20inRectangle_mars3d_flat(vec3\x20textPoint)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20h\x20=\x200;\x20h\x20<\x20100000;\x20h++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(h\x20>=\x20u_mars3d_flat_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_flat(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flat_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flat_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20h;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x2099999;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20vertexMain(VertexInput\x20vsInput,\x20inout\x20czm_modelVertexOutput\x20vsOutput)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20vsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20rectangleIndex\x20=\x20inRectangle_mars3d_flat(positionMC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(rectangleIndex\x20!=\x2099999){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20modelDatumPoint\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(1,\x20rectangleIndex));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flat_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(modelDatumPoint.x\x20+\x20positionMC.x\x20*\x200.0005,\x20positionMC.y,\x20positionMC.z);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flat_upAxis\x20==\x201){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(positionMC.x,\x20modelDatumPoint.y\x20+\x20positionMC.y\x20*\x200.0005,\x20positionMC.z);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(positionMC.x,\x20positionMC.y,\x20modelDatumPoint.z\x20+\x20positionMC.z\x20*\x200.0005);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}'});return _0x1a86ab[_0x43238e(0x99b)][_0x43238e(0x5cb)]=()=>{const _0x55ac5f=_0x43238e;return Cesium__namespace['defined'](this['_texture'])?this['_texture']:this['_map'][_0x55ac5f(0xc60)][_0x55ac5f(0x5b7)]['defaultTexture'];},_0x1a86ab['uniformMap'][_0x43238e(_0x5165ac._0x7ddb09)]=()=>{return this['_modelUpAxis'];},_0x1a86ab['uniformMap']['u_mars3d_flat_rangeNumber']=()=>{return this['_rangeNumber'];},_0x1a86ab['uniformMap'][_0x43238e(0x382)]=()=>{const _0x4462fd=_0x43238e;return this[_0x4462fd(_0x6a0a65._0x3442c3)];},_0x1a86ab;}['updateHeight'](_0x3c24b0,_0x32f160){const _0x4cfbd3={_0x2e8fb0:0x682,_0x162abb:0xade},_0x1ee3b9=_0x35a251;if(Cesium__namespace[_0x1ee3b9(0xaa2)](_0x32f160)){const _0x51b49c=this[_0x1ee3b9(0x1fb)](_0x32f160);_0x51b49c&&(_0x51b49c[_0x1ee3b9(_0x4cfbd3._0x2e8fb0)]=_0x3c24b0,this[_0x1ee3b9(_0x4cfbd3._0x162abb)]=!![]);}else{for(let _0x5b74c6=0x0;_0x5b74c6this['options']['maxHeight']){this['height']=this['options'][_0x30f684(_0x127706._0x411f3e)],this[_0x30f684(0xf9b)]();return;}if(this['height']=\x20u_mars3d_flood_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_flood(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flood_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flood_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20fsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_isStart\x20&&\x20(u_mars3d_flood_floodAll\x20||\x20inRectangle_mars3d_flood(positionMC))){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20height\x20=\x20positionMC.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flood_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flood_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(height<=u_mars3d_flood_currentheight\x20&&\x20(!u_mars3d_flood_limitMin\x20||\x20u_mars3d_flood_min_height<=height))\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20u_mars3d_flood_color.rgb,\x20u_mars3d_flood_color.a);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20'});return _0x452864[_0x1144b2(0x99b)][_0x1144b2(_0xd6e9ee._0x3262ec)]=()=>{const _0x26ba97=_0x1144b2;return Cesium__namespace['defined'](this['_texture'])?this['_texture']:this['_map']['scene'][_0x26ba97(_0x22f96e._0x3c5785)][_0x26ba97(0x641)];},_0x452864['uniformMap']['u_mars3d_flood_upAxis']=()=>{return this['_modelUpAxis'];},_0x452864['uniformMap'][_0x1144b2(_0xd6e9ee._0x1bcdba)]=()=>{return this['_rangeNumber'];},_0x452864[_0x1144b2(0x99b)]['u_mars3d_flood_maxRangeLength']=()=>{const _0x4628f6=_0x1144b2;return this[_0x4628f6(_0x7ad08b._0x755eeb)];},_0x452864[_0x1144b2(_0xd6e9ee._0x444660)]['u_mars3d_isStart']=()=>{const _0x40716c=_0x1144b2;return Cesium__namespace[_0x40716c(0xaa2)](this['_currentHeight']);},_0x452864[_0x1144b2(_0xd6e9ee._0x31d683)]['u_mars3d_flood_floodAll']=()=>{return this['floodAll'];},_0x452864['uniformMap']['u_mars3d_flood_color']=()=>{const _0x5821b4=_0x1144b2;return this[_0x5821b4(_0x196bcd._0x59b430)];},_0x452864['uniformMap']['u_mars3d_flood_currentheight']=()=>{return this['_currentHeight'];},_0x452864['uniformMap']['u_mars3d_flood_min_height']=()=>{return this['_minHeight'];},_0x452864[_0x1144b2(0x99b)]['u_mars3d_flood_limitMin']=()=>{return this['_limitMin'];},this['uniformMap']=_0x452864['uniformMap'],_0x452864;}}class TilesetPlanClip extends BaseThing{get['clipTarget'](){return this['_tileset'];}set['clipTarget'](_0x58b277){const _0x553017={_0x59b4ac:0xb35,_0x104205:0xe86,_0x531df5:0xe86,_0x5edff5:0xeed},_0x4a942c=_0x35a251;this['_tileset']=_0x58b277,this['_inverseMatrix']=null,Cesium__namespace['defined'](this['options'][_0x4a942c(_0x553017._0x59b4ac)])&&(this['positions']=this['options']['positions']),Cesium__namespace['defined'](this['options']['type'])&&(this[_0x4a942c(0x8ea)]=this['options']['type']),Cesium__namespace['defined'](this[_0x4a942c(_0x553017._0x104205)]['distance'])&&(this['distance']=this[_0x4a942c(_0x553017._0x531df5)][_0x4a942c(_0x553017._0x5edff5)]);}get['layer'](){const _0x45f870=_0x35a251;return this[_0x45f870(0x2d0)];}set['layer'](_0x1b4f25){const _0x101c7a={_0x3d079c:0x2d0},_0x493434=_0x35a251;this[_0x493434(_0x101c7a._0x3d079c)]=_0x1b4f25,_0x1b4f25['loadOk']?this[_0x493434(0x928)]=_0x1b4f25['tileset']:_0x1b4f25['on'](EventType['load'],_0x1b84bd=>{this['clipTarget']=_0x1b4f25['tileset'];});}get['planes'](){const _0x5f07ee=_0x35a251;return this[_0x5f07ee(0x85d)];}get[_0x35a251(0xc72)](){const _0x110ef5={_0xf38068:0x6a7},_0x5c7459=_0x35a251;if(!this['_inverseMatrix']){let _0x150e5f;const _0x702dbc=this['_tileset']['root']['transform'];_0x702dbc&&_0x702dbc['equals'](Cesium__namespace[_0x5c7459(_0x110ef5._0xf38068)]['IDENTITY'])||!_0x702dbc?_0x150e5f=Cesium__namespace['Transforms'][_0x5c7459(0x67b)](this['_tileset'][_0x5c7459(0xdb5)]['center']):_0x150e5f=Cesium__namespace['Matrix4'][_0x5c7459(0x96e)](this['_tileset']['root']['transform']),this['_inverseMatrix']=Cesium__namespace[_0x5c7459(0x6a7)]['inverseTransformation'](_0x150e5f,new Cesium__namespace['Matrix4']());}return this['_inverseMatrix'];}get[_0x35a251(0x176)](){const _0x42e9c8={_0xfbfcae:0x2d0,_0x5bbd17:0x5f1},_0x57d92f=_0x35a251;if(this[_0x57d92f(_0x42e9c8._0xfbfcae)])return this['_layer']['position'];return this[_0x57d92f(_0x42e9c8._0x5bbd17)][_0x57d92f(0xdb5)][_0x57d92f(0x176)];}get['distance'](){return this['_distance'];}set[_0x35a251(0xeed)](_0x3489b8){const _0x497ea2={_0x2adde8:0x85d},_0x4eb14b=_0x35a251;this['_distance']=_0x3489b8;if(this['clippingPlanes']&&this[_0x4eb14b(_0x497ea2._0x2adde8)]['length']>0x0){const _0x324181=this[_0x4eb14b(_0x497ea2._0x2adde8)]['get'](this['clippingPlanes']['length']-0x1);_0x324181['distance']=_0x3489b8;}}get['angle1'](){const _0x146e66=_0x35a251;return this[_0x146e66(0x556)]||0x0;}set[_0x35a251(0x2be)](_0x1f4fca){const _0xd48eee={_0x16ba7c:0x85d,_0x3f5620:0xe1e},_0x256fb7=_0x35a251;this['_normal_angle1']=_0x1f4fca;if(this[_0x256fb7(_0xd48eee._0x16ba7c)]&&this['clippingPlanes'][_0x256fb7(_0xd48eee._0x3f5620)]>0x0){const _0x3cf19e=this['clippingPlanes']['get'](this['clippingPlanes']['length']-0x1);this['_updateNormal'](_0x3cf19e,_0x1f4fca,this['angle2']);}}get['angle2'](){return this['_normal_angle2']||0x0;}set['angle2'](_0x2d69ed){const _0x3e1250={_0x89bb95:0x558,_0x4a3d4b:0x85d},_0x4f6b09=_0x35a251;this[_0x4f6b09(_0x3e1250._0x89bb95)]=_0x2d69ed;if(this[_0x4f6b09(0x85d)]&&this['clippingPlanes']['length']>0x0){const _0x5d0369=this[_0x4f6b09(_0x3e1250._0x4a3d4b)]['get'](this['clippingPlanes']['length']-0x1);this['_updateNormal'](_0x5d0369,this['angle1'],_0x2d69ed);}}get['normalZ'](){const _0x948b39=_0x35a251;return this[_0x948b39(0x60e)]||0x0;}set['normalZ'](_0x379b91){const _0x3f60b5={_0x2ccd6c:0x85d},_0x57adb6=_0x35a251;this['_normalZ']=_0x379b91;if(this['clippingPlanes']&&this[_0x57adb6(_0x3f60b5._0x2ccd6c)]['length']>0x0){const _0x1d6a5b=this['clippingPlanes']['get'](this[_0x57adb6(0x85d)]['length']-0x1);_0x1d6a5b['normal']['z']=_0x379b91;}}get[_0x35a251(0x8ea)](){const _0x13c4e5=_0x35a251;return this[_0x13c4e5(0x859)];}set[_0x35a251(0x8ea)](_0x5366b8){const _0x4e3fa5={_0x1ccf8d:0x56d,_0x49d8b1:0x56d},_0x5b879a=_0x35a251;this['_type']=_0x5366b8;let _0x37f0fa;switch(_0x5366b8){case ClipType['Z']:_0x37f0fa=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),0x1)];break;case ClipType['ZR']:_0x37f0fa=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x5b879a(0x8eb))](0x0,0x0,-0x1),0x1)];break;case ClipType['X']:_0x37f0fa=[new Cesium__namespace[(_0x5b879a(_0x4e3fa5._0x1ccf8d))](new Cesium__namespace[(_0x5b879a(0x8eb))](0x1,0x0,0x0),0x1)];break;case ClipType['XR']:_0x37f0fa=[new Cesium__namespace[(_0x5b879a(_0x4e3fa5._0x49d8b1))](new Cesium__namespace['Cartesian3'](-0x1,0x0,0x0),0x1)];break;case ClipType['Y']:_0x37f0fa=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x1,0x0),0x1)];break;case ClipType['YR']:_0x37f0fa=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x5b879a(0x8eb))](0x0,-0x1,0x0),0x1)];break;}this['setPlanes'](_0x37f0fa);}get[_0x35a251(0xb35)](){return this['_positions'];}set['positions'](_0x3fffcc){const _0x9efaf6={_0x4489de:0x58a},_0x169f40=_0x35a251;this[_0x169f40(_0x9efaf6._0x4489de)]=LngLatArray['toCartesians'](_0x3fffcc),this['_setPositions'](this['_positions']);}get['clipOutSide'](){const _0x30656f={_0x190366:0xe86},_0x3b347c=_0x35a251;return this[_0x3b347c(_0x30656f._0x190366)]['clipOutSide'];}set['clipOutSide'](_0x300386){const _0x5ac133={_0x3ea6ad:0xe86},_0x26573b=_0x35a251;this[_0x26573b(_0x5ac133._0x3ea6ad)]['clipOutSide']=_0x300386,this[_0x26573b(0xd79)]&&this['_positions']&&this['_setPositions'](this['_positions']);}['_mountedHook'](){const _0x511791={_0x339ff8:0xcde,_0x35db30:0xb13,_0x145464:0xe86,_0xe137b3:0xd79,_0x3c2666:0x87},_0xb7cfae={_0x33e437:0xb13},_0x4b405d=_0x35a251;this['options'][_0x4b405d(_0x511791._0x339ff8)]&&(this[_0x4b405d(_0x511791._0x35db30)]=new GraphicLayer({...this[_0x4b405d(_0x511791._0x145464)],'private':!![]}),this['options']['editPlane']&&this['_graphicLayer']['bindContextMenu']([{'text':this[_0x4b405d(_0x511791._0xe137b3)]['getLangText']('_删除'),'icon':Icon['Delete'],'callback':_0x21cd37=>{const _0x394a3c=_0x4b405d,_0x4e1bf7=_0x21cd37['graphic'];if(!_0x4e1bf7)return;this[_0x394a3c(_0xb7cfae._0x33e437)]['removeGraphic'](_0x4e1bf7),this['fire'](EventType['remove'],_0x21cd37);}}]));if(this['options'][_0x4b405d(_0x511791._0x3c2666)])this['layer']=this['options'][_0x4b405d(_0x511791._0x3c2666)];else this['options']['tileset']&&(this['clipTarget']=this['options']['tileset']);}[_0x35a251(0x307)](_0x59897c){const _0x1934ca={_0xbe173d:0x9db,_0x34d770:0x27f,_0x4a026b:0xdd8},_0x115034=_0x35a251;this['_last_planeGraphics']&&(this['_last_planeGraphics']['hasEdit']=![],this['_last_planeGraphics']['material'][_0x115034(_0x1934ca._0xbe173d)]=this[_0x115034(0x1a1)][_0x115034(_0x1934ca._0x34d770)]['color_bak'],delete this[_0x115034(0x1a1)]),this[_0x115034(_0x1934ca._0x4a026b)](_0x59897c);}['_graphicLayer_click'](_0x10526c){const _0x2b7b51={_0x1f2728:0x387,_0x9cdf4:0x27f,_0x2dcb03:0x9db,_0x24b360:0x475,_0x143770:0xb70,_0x53bfdc:0xbee},_0x119bdb=_0x35a251;var _0x4ff2a5,_0x5234e9;const _0x5b633b=(_0x4ff2a5=_0x10526c['graphic'])===null||_0x4ff2a5===void 0x0?void 0x0:(_0x5234e9=_0x4ff2a5['entity'])===null||_0x5234e9===void 0x0?void 0x0:_0x5234e9[_0x119bdb(_0x2b7b51._0x1f2728)];Cesium__namespace['defined'](_0x5b633b)&&(this['_map_click'](),_0x5b633b['hasEdit']=!_0x5b633b['hasEdit'],_0x5b633b['material']['color_bak']=_0x5b633b[_0x119bdb(_0x2b7b51._0x9cdf4)][_0x119bdb(_0x2b7b51._0x2dcb03)],_0x5b633b['material']['color']=_0x10526c['graphic']['style'][_0x119bdb(_0x2b7b51._0x24b360)],_0x5b633b[_0x119bdb(_0x2b7b51._0x143770)]&&(this['_last_planeGraphics']=_0x5b633b),_0x10526c[_0x119bdb(_0x2b7b51._0x53bfdc)]());}[_0x35a251(0xce)](_0x3fe469){const _0x3005e9={_0x5e3ae6:0xaa2,_0x542423:0x7ec},_0x5b3cdc=_0x35a251;var _0x168bd2,_0x170771;const _0x523517=(_0x168bd2=_0x3fe469[_0x5b3cdc(0xf8c)])===null||_0x168bd2===void 0x0?void 0x0:(_0x170771=_0x168bd2['entity'])===null||_0x170771===void 0x0?void 0x0:_0x170771['plane'];Cesium__namespace[_0x5b3cdc(_0x3005e9._0x5e3ae6)](_0x523517)&&_0x523517['hasEdit']&&(this['_selectedPlane']=_0x523517['plane'][_0x5b3cdc(_0x3005e9._0x542423)](),this['_map']['scene']['screenSpaceCameraController'][_0x5b3cdc(0x856)]&&(this['_map']['scene']['screenSpaceCameraController']['enableInputs']=![],this['_hasChangeEnableInputs']=!![]));}['_graphicLayer_leftUp'](_0x3394b5){const _0x1815aa={_0x54de31:0x856},_0x42db67=_0x35a251;Cesium__namespace['defined'](this['_selectedPlane'])&&(delete this['_selectedPlane'],this['_hasChangeEnableInputs']&&(this['_map']['scene'][_0x42db67(0xbbb)][_0x42db67(_0x1815aa._0x54de31)]=!![],delete this[_0x42db67(0xddb)]));}['_map_mouseMove'](_0x190254){const _0x57e5bd=_0x35a251;if(Cesium__namespace['defined'](this['_selectedPlane'])){const _0x471f22=_0x190254['startPosition']['x']-_0x190254[_0x57e5bd(0x37e)]['x'],_0x13c443=_0x190254['startPosition']['y']-_0x190254[_0x57e5bd(0x37e)]['y'],_0x2b4766=(_0x471f22+_0x13c443)/0x2;this['_selectedPlane'][_0x57e5bd(0xeed)]=(this['_selectedPlane']['distance']||0x0)+_0x2b4766,this[_0x57e5bd(0xd79)]['openSmallTooltip'](_0x190254['endPosition'],this['_map']['getLangText']('_释放后完成修改'));}else this['_map']['closeSmallTooltip']();}[_0x35a251(0x97b)](){const _0x4c6c9c={_0x1e93e6:0xb13,_0x3d70c9:0xce,_0xeb5723:0xd79,_0x9705d3:0xe86,_0x2c3bc3:0xeed},_0xbc29d0=_0x35a251;this[_0xbc29d0(_0x4c6c9c._0x1e93e6)]&&(this[_0xbc29d0(0xd79)]['addLayer'](this['_graphicLayer']),this['options'][_0xbc29d0(0xab2)]&&(this['_map']['on'](EventType[_0xbc29d0(0xfb4)],this['_map_click'],this),this['_graphicLayer']['on'](EventType['click'],this['_graphicLayer_click'],this),this['_graphicLayer']['on'](EventType[_0xbc29d0(0x71f)],this[_0xbc29d0(_0x4c6c9c._0x3d70c9)],this),this['_graphicLayer']['on'](EventType['leftUp'],this[_0xbc29d0(0xdd8)],this),this[_0xbc29d0(_0x4c6c9c._0xeb5723)]['on'](EventType['mouseMove'],this['_map_mouseMove'],this))),this['clipTarget']&&(Cesium__namespace[_0xbc29d0(0xaa2)](this['options']['positions'])&&(this['positions']=this[_0xbc29d0(0xe86)]['positions']),Cesium__namespace[_0xbc29d0(0xaa2)](this[_0xbc29d0(_0x4c6c9c._0x9705d3)]['type'])&&(this['type']=this['options'][_0xbc29d0(0x8ea)]),Cesium__namespace['defined'](this['options']['distance'])&&(this[_0xbc29d0(_0x4c6c9c._0x2c3bc3)]=this['options']['distance']));}['_removedHook'](){const _0x95f45={_0x59cbd3:0x273},_0x3f35e1=_0x35a251;this[_0x3f35e1(0x386)](),this['_graphicLayer']&&(this[_0x3f35e1(0xe86)]['editPlane']&&(this['_map']['off'](EventType['click'],this[_0x3f35e1(0x307)],this),this['_graphicLayer']['off'](EventType['click'],this['_graphicLayer_click'],this),this['_graphicLayer']['off'](EventType['leftDown'],this['_graphicLayer_leftDown'],this),this[_0x3f35e1(0xb13)]['off'](EventType['leftUp'],this[_0x3f35e1(0xdd8)],this),this['_map']['off'](EventType['mouseMove'],this[_0x3f35e1(_0x95f45._0x59cbd3)],this)),this['_map']['removeLayer'](this['_graphicLayer']));}[_0x35a251(0x897)](_0x3acd67){const _0x3deb2d={_0x1206a9:0xaa2,_0x491cc7:0x6de,_0x3583bd:0x23d},_0x12c058=_0x35a251;if(_0x3acd67['length']<0x2)return;const _0x325974=[];if(_0x3acd67['length']===0x2){const _0x26d3dc=this['_createPlaneByLine'](_0x3acd67[0x0],_0x3acd67[0x1]);_0x26d3dc&&_0x325974['push'](_0x26d3dc);}else{let _0x43e72c;const _0x3c225b=formatNum$1(getAngle(_0x3acd67[0x0],_0x3acd67[0x1]),0x2);if(_0x3c225b>-0.02&&_0x3c225b<0.02)_0x43e72c=![];else{const _0x4608eb=formatNum$1(getAngle(_0x3acd67[0x0],_0x3acd67[0x2]),0x2);_0x43e72c=_0x3c225b<_0x4608eb;}this['clipOutSide']&&(_0x43e72c=!_0x43e72c);let _0xb283b4;for(let _0x4858be=0x0,_0x18c2c5=_0x3acd67['length'];_0x4858be<_0x18c2c5;++_0x4858be){const _0x1e82b2=(_0x4858be+0x1)%_0x18c2c5;_0x43e72c?_0xb283b4=this['_createPlaneByLine'](_0x3acd67[_0x1e82b2],_0x3acd67[_0x4858be]):_0xb283b4=this['_createPlaneByLine'](_0x3acd67[_0x4858be],_0x3acd67[_0x1e82b2]),_0xb283b4&&((Cesium__namespace['defined'](this['_normal_angle1'])||Cesium__namespace[_0x12c058(0xaa2)](this['_normal_angle2']))&&this['_updateNormal'](_0xb283b4,this['angle1'],this[_0x12c058(0x79c)]),_0x325974['push'](_0xb283b4));}Cesium__namespace[_0x12c058(_0x3deb2d._0x1206a9)](this['options']['height'])&&(_0xb283b4=new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,-0x1),this['options']['height']),_0x325974[_0x12c058(_0x3deb2d._0x491cc7)](_0xb283b4));}this[_0x12c058(_0x3deb2d._0x3583bd)](_0x325974);}[_0x35a251(0xa93)](_0x1dc98c,_0x56f139){const _0x7fe878={_0x1777fe:0x8eb,_0x4c4bd2:0xebd},_0x14ae75=_0x35a251;if(Cesium__namespace['Cartesian3']['distance'](_0x1dc98c,_0x56f139)<0.1)return null;const _0x1a82dc=this[_0x14ae75(0xc72)],_0x123081=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x1a82dc,_0x1dc98c,new Cesium__namespace[(_0x14ae75(0x8eb))]()),_0xc457b6=Cesium__namespace[_0x14ae75(0x6a7)]['multiplyByPoint'](_0x1a82dc,_0x56f139,new Cesium__namespace['Cartesian3']()),_0x54cfff=new Cesium__namespace['Cartesian3'](0x0,0x0,0xa),_0x447248=Cesium__namespace[_0x14ae75(_0x7fe878._0x1777fe)]['subtract'](_0xc457b6,_0x123081,new Cesium__namespace['Cartesian3']());let _0x414d14=Cesium__namespace['Cartesian3']['cross'](_0x447248,_0x54cfff,new Cesium__namespace['Cartesian3']());_0x414d14=Cesium__namespace['Cartesian3'][_0x14ae75(_0x7fe878._0x4c4bd2)](_0x414d14,_0x414d14);const _0x5b3ee4=Cesium__namespace['Plane']['fromPointNormal'](_0x123081,_0x414d14);return Cesium__namespace['ClippingPlane']['fromPlane'](_0x5b3ee4);}['setPlanes'](_0x21ea69){const _0x3ba55a={_0x13b597:0x9a2,_0x5dcac5:0x85d,_0x1b4975:0x85d,_0x475b34:0xb13,_0x4d7912:0x5f1,_0x3cda73:0x176},_0x51ad8e=_0x35a251;if(!_0x21ea69)return;const _0x12e37e=new Cesium__namespace['ClippingPlaneCollection']({'planes':_0x21ea69,'edgeWidth':this['options'][_0x51ad8e(0xe30)]??0x0,'edgeColor':this[_0x51ad8e(0xe86)]['edgeColor']??Cesium__namespace['Color'][_0x51ad8e(_0x3ba55a._0x13b597)],'unionClippingRegions':this['clipOutSide']??![]});this[_0x51ad8e(_0x3ba55a._0x5dcac5)]=_0x12e37e;this['clipTarget']&&(this['clipTarget'][_0x51ad8e(_0x3ba55a._0x1b4975)]=_0x12e37e);if(this['options']['showPlane']){this[_0x51ad8e(_0x3ba55a._0x475b34)]['clear']();const _0x35bd8d=this[_0x51ad8e(_0x3ba55a._0x4d7912)]['boundingSphere']['radius'];for(let _0x2fb23c=0x0;_0x2fb23c<_0x12e37e[_0x51ad8e(0xe1e)];++_0x2fb23c){var _0x3e7acc;const _0x1275b0=_0x12e37e['get'](_0x2fb23c),_0x3d05b0=new PlaneEntity({'position':this[_0x51ad8e(_0x3ba55a._0x3cda73)],'style':{'heading':0x168-(((_0x3e7acc=this['_layer'])===null||_0x3e7acc===void 0x0?void 0x0:_0x3e7acc['rotation_z'])??0x0),'dimensions':new Cesium__namespace['Cartesian2'](_0x35bd8d,_0x35bd8d),'color':Cesium__namespace['Color']['WHITE'][_0x51ad8e(0x373)](0.2),'editColor':Cesium__namespace['Color']['WHITE']['withAlpha'](0.5),'outline':!![],'outlineColor':Cesium__namespace['Color']['WHITE'],...this[_0x51ad8e(0xe86)]['planeStyle']||{},'plane':new Cesium__namespace['CallbackProperty'](createPlaneUpdateFunction(_0x1275b0),![])}});this['_graphicLayer']['addGraphic'](_0x3d05b0);}}}[_0x35a251(0x386)](){const _0x47bbb7={_0x1443ce:0x386,_0x126bbe:0x558,_0x2cf999:0x85d},_0x11ad31=_0x35a251;this['_graphicLayer']&&this[_0x11ad31(0xb13)][_0x11ad31(_0x47bbb7._0x1443ce)]();delete this[_0x11ad31(0x60e)],delete this[_0x11ad31(0x556)],delete this[_0x11ad31(_0x47bbb7._0x126bbe)],delete this[_0x11ad31(0x58a)],this[_0x11ad31(0xe86)]['clipOutSide']=![];this['clippingPlanes']&&delete this['clippingPlanes'];if(this['clipTarget']){var _0x4c1dac;(_0x4c1dac=this['clipTarget']['clippingPlanes'])!==null&&_0x4c1dac!==void 0x0&&_0x4c1dac[_0x11ad31(0x2a6)]&&(this['clipTarget']['clippingPlanes'][_0x11ad31(0x2a6)]=![]),this[_0x11ad31(0x928)][_0x11ad31(_0x47bbb7._0x2cf999)]=undefined;}}[_0x35a251(0x54a)](_0xb54918){const _0x244dd8={_0x3c8d25:0xe1e},_0x59ee4f=_0x35a251;if(this['clippingPlanes']==null)return;for(let _0x44ee3=0x0;_0x44ee30x0||(_0xbe64e2=this['options'][_0x3b4c91(0x59f)])!==null&&_0xbe64e2!==void 0x0&&_0xbe64e2['enabled'])&&this[_0x3b4c91(0x562)](),(((_0x1ddee0=this['options']['flood'])===null||_0x1ddee0===void 0x0?void 0x0:(_0xb142e2=_0x1ddee0['area'])===null||_0xb142e2===void 0x0?void 0x0:_0xb142e2['length'])>0x0||(_0x435597=this['options']['flood'])!==null&&_0x435597!==void 0x0&&_0x435597[_0x3b4c91(_0x8ac7d2._0x3524fb)])&&this[_0x3b4c91(0x9dd)](),(((_0x365f68=this[_0x3b4c91(_0x8ac7d2._0x1e1c5e)][_0x3b4c91(_0x8ac7d2._0x57cbcd)])===null||_0x365f68===void 0x0?void 0x0:(_0x36aa5f=_0x365f68[_0x3b4c91(_0x8ac7d2._0x22ff70)])===null||_0x36aa5f===void 0x0?void 0x0:_0x36aa5f['length'])>0x0||(_0x3daec8=this['options']['clip'])!==null&&_0x3daec8!==void 0x0&&_0x3daec8['enabled'])&&this['_initTilesetClip'](),(((_0x3ec4aa=this[_0x3b4c91(0xe86)]['planClip'])===null||_0x3ec4aa===void 0x0?void 0x0:(_0x4d3f17=_0x3ec4aa['positions'])===null||_0x4d3f17===void 0x0?void 0x0:_0x4d3f17['length'])>0x0||(_0x4ee771=this[_0x3b4c91(0xe86)]['planClip'])!==null&&_0x4ee771!==void 0x0&&_0x4ee771[_0x3b4c91(0x2a6)])&&this[_0x3b4c91(_0x8ac7d2._0x5a97ef)](),this[_0x3b4c91(_0x8ac7d2._0x422b37)]()['then'](_0x4f9c60=>{const _0x549f0b=_0x3b4c91;this['fire'](EventType['loadBefore'],{'tileset':_0x4f9c60}),this['_initModel'](_0x4f9c60),this[_0x549f0b(0xb71)]=!![],this['_readyPromise'][_0x549f0b(_0x48d28c._0x1d13b9)](this),this['fire'](EventType['load'],{'tileset':_0x4f9c60});});}['_removedHook'](){const _0x3d83b5={_0x109a7b:0xd79,_0x34caf8:0x786,_0x4a60ba:0x828,_0x2187bc:0x192,_0x31842c:0x1af,_0x175c73:0x535,_0x39ba76:0x5f1,_0x2d2d4d:0x3fd,_0xbbb591:0x5f1,_0x4f10e3:0x5f1},_0x27e940=_0x35a251;this['_tilesetClip']&&(this[_0x27e940(_0x3d83b5._0x109a7b)]['removeThing'](this['_tilesetClip'],!![]),delete this[_0x27e940(_0x3d83b5._0x34caf8)]),this['_tilesetFlat']&&(this['_map']['removeThing'](this[_0x27e940(0xc65)],!![]),delete this[_0x27e940(0xc65)]),this[_0x27e940(0x192)]&&(this['_map'][_0x27e940(_0x3d83b5._0x4a60ba)](this[_0x27e940(_0x3d83b5._0x2187bc)],!![]),delete this[_0x27e940(0x192)]),this['_tilesetPlanClip']&&(this['_map']['removeThing'](this['_tilesetPlanClip'],!![]),delete this['_tilesetPlanClip']),Cesium__namespace['defined'](this['_map'][_0x27e940(_0x3d83b5._0x31842c)])&&(delete this['_map'][_0x27e940(_0x3d83b5._0x175c73)][this['id']],this[_0x27e940(_0x3d83b5._0x39ba76)][_0x27e940(_0x3d83b5._0x2d2d4d)][_0x27e940(0x4d6)](this[_0x27e940(0x62d)],this)),super['_removedHook'](),Cesium__namespace['defined'](this[_0x27e940(0xe86)][_0x27e940(0xe56)])&&this['_map']['off'](EventType['cameraChanged'],this['updateVisibleDistance'],this),this[_0x27e940(_0x3d83b5._0xbbb591)]&&(this['_map']['scene']['primitives']['remove'](this['_tileset']),delete this[_0x27e940(_0x3d83b5._0x4f10e3)]);}['reload'](){const _0x432bc0=_0x35a251;this['_readyPromise']=Cesium__namespace[_0x432bc0(0xf75)](),this['_removedHook'](),this['_addedHook']();}[_0x35a251(0xb4)](_0x330f63){const _0x104731={_0x474184:0x176,_0x4306a7:0xfa7,_0x4cf19f:0x5d2},_0x43de56=_0x35a251;_0x330f63&&((Array['isArray'](_0x330f63)||isString(_0x330f63))&&(_0x330f63=LngLatPoint['parse'](_0x330f63)),!this['_center']&&(this['_center']=new LngLatPoint()),_0x330f63['lat']&&(this[_0x43de56(_0x104731._0x474184)]['lat']=_0x330f63[_0x43de56(0xb9d)]),_0x330f63[_0x43de56(0xfa7)]&&(this['center']['lng']=_0x330f63[_0x43de56(_0x104731._0x4306a7)]),Cesium__namespace[_0x43de56(0xaa2)](_0x330f63['alt_offset'])&&(this[_0x43de56(_0x104731._0x474184)][_0x43de56(_0x104731._0x4cf19f)]=this['_orginCenterPoint']['alt']+_0x330f63['alt_offset']),Cesium__namespace['defined'](_0x330f63['alt'])&&(this['center']['alt']=_0x330f63['alt']));}['_setOptionsHook'](_0x3f9a91,_0x337694){const _0x130b60={_0x59cc35:0xc07,_0x5ea099:0xb61,_0x4e125f:0xf31},_0x33453b=_0x35a251;if(!this['_tileset'])return;let _0x541c37;for(const _0x292afa in _0x337694){const _0x3bf3e1=_0x3f9a91[_0x292afa];switch(_0x292afa){case'highlight':{var _0x5972b7,_0x2573c5;(_0x5972b7=this['_last_picked'])!==null&&_0x5972b7!==void 0x0&&_0x5972b7['event']&&!((_0x2573c5=_0x337694['highlight'])!==null&&_0x2573c5!==void 0x0&&_0x2573c5['type'])?this['_highlight_mouseEventHandler'](this['_last_picked']['event']):super['_setOptionsHook'](_0x3f9a91,_0x337694);return;}case'classificationType':case'chinaCRS':case'flat':case'flood':case'clip':case'planClip':{this['reload']();return;}case'position':case'rotation':case'scale':case _0x33453b(_0x130b60._0x59cc35):_0x541c37=!![];break;case _0x33453b(0xbf2):case _0x33453b(0xa1e):case _0x33453b(0xfc8):case _0x33453b(0x983):case'customShader':this[_0x292afa]=_0x3bf3e1;break;default:{try{this['tileset'][_0x292afa]=_0x3bf3e1;}catch(_0x41d920){this['reload']();}break;}}}_0x541c37&&(this['_mergePostion'](this['options'][_0x33453b(_0x130b60._0x5ea099)]),this[_0x33453b(_0x130b60._0x4e125f)]());}['_initModel'](_0x21499c){const _0x1ed70e={_0x57676b:0x5f1,_0x326c0f:0x504,_0x51c9f7:0x5f1,_0x100313:0x5f1,_0x432d1d:0x6a7,_0x31218b:0x7b,_0x261ea3:0x21a,_0x58b3a8:0x67b,_0x3e8ae2:0xcf4,_0x5cb5cc:0xd9d,_0x106147:0x8eb,_0x22de43:0x8eb,_0x52fe6f:0x8eb,_0x4290d4:0x7c0,_0x5dde52:0x74b,_0x1fc9ab:0x253,_0x2c6b00:0xfc8,_0x555230:0xfb0,_0x446189:0x176,_0x16926b:0xb4,_0x2ffada:0x979,_0x5d5e6a:0xe86},_0xc64c3a=_0x35a251;var _0x30f8e0,_0x2fd686;this[_0xc64c3a(0x5f1)]=_0x21499c,this[_0xc64c3a(_0x1ed70e._0x57676b)][_0xc64c3a(_0x1ed70e._0x326c0f)]=this['name'],this[_0xc64c3a(_0x1ed70e._0x51c9f7)]['show']=this['show'],this[_0xc64c3a(_0x1ed70e._0x100313)]['_mars3d_layerId']=this['id'],this['_map']['scene'][_0xc64c3a(0x4e1)]['add'](this[_0xc64c3a(0x5f1)]),this[_0xc64c3a(0x5f1)]['initialTilesLoaded']['addEventListener'](_0x4417eb=>{const _0x99f9aa=_0xc64c3a;this['fire'](EventType[_0x99f9aa(0x654)],_0x4417eb);}),this['_tileset']['allTilesLoaded']['addEventListener'](_0x2ac5bf=>{const _0x207fb5=_0xc64c3a;this[_0x207fb5(0x264)](EventType['allTilesLoaded'],_0x2ac5bf);});Cesium__namespace['defined'](this['_map'][_0xc64c3a(0x1af)])&&(this['_map']['_tilesets']=this['_map']['_tilesets']||{},this['_map']['_tilesets'][this['id']]=this['_tileset'],this['_tileset']['tileLoad']['addEventListener'](this['_tileset_tileLoadHandler'],this));this['_orginCenterPosition']=Cesium__namespace[_0xc64c3a(0xd61)](this['_tileset'][_0xc64c3a(0xdb5)]['center']);const _0x10dfd1=(_0x30f8e0=this['_tileset']['root'])===null||_0x30f8e0===void 0x0?void 0x0:_0x30f8e0['transform'];this['transform']=this[_0xc64c3a(0xe86)][_0xc64c3a(0x21a)]??Boolean(_0x10dfd1&&!_0x10dfd1['equals'](Cesium__namespace['Matrix4']['IDENTITY']));if(this['transform']){this['orginMatrix']=Cesium__namespace[_0xc64c3a(_0x1ed70e._0x432d1d)][_0xc64c3a(_0x1ed70e._0x31218b)](Cesium__namespace['Matrix4']['fromArray'](this[_0xc64c3a(0x5f1)]['_root'][_0xc64c3a(_0x1ed70e._0x261ea3)]),new Cesium__namespace['Matrix4']());const _0x28c8a9=Cesium__namespace['Matrix4']['fromArray'](this['_tileset']['_root']['transform']),_0x300ab6=Cesium__namespace['Matrix4']['getTranslation'](_0x28c8a9,new Cesium__namespace['Cartesian3']());if(Cesium__namespace['defined'](_0x300ab6)&&Cesium__namespace['Cartographic']['fromCartesian'](_0x300ab6)){this['_orginCenterPosition']=_0x300ab6;const _0x2b9662=Cesium__namespace[_0xc64c3a(0x6a7)]['getMatrix3'](_0x28c8a9,new Cesium__namespace['Matrix3']()),_0x217a46=Cesium__namespace['Matrix4']['getMatrix3'](Cesium__namespace['Transforms'][_0xc64c3a(_0x1ed70e._0x58b3a8)](_0x300ab6),new Cesium__namespace['Matrix3']()),_0x1abb04=Cesium__namespace['Matrix3'][_0xc64c3a(_0x1ed70e._0x3e8ae2)](_0x217a46,0x0,new Cesium__namespace['Cartesian3']()),_0x71af3b=Cesium__namespace['Matrix3']['getColumn'](_0x217a46,0x1,new Cesium__namespace['Cartesian3']()),_0xcb4b10=Cesium__namespace['Matrix3']['getColumn'](_0x217a46,0x2,new Cesium__namespace['Cartesian3']());let _0x2a1d31=Cesium__namespace[_0xc64c3a(_0x1ed70e._0x5cb5cc)]['getColumn'](_0x2b9662,0x0,new Cesium__namespace[(_0xc64c3a(_0x1ed70e._0x106147))]());_0x2a1d31=Cesium__namespace['Cartesian3']['cross'](_0x2a1d31,_0xcb4b10,_0x2a1d31),_0x2a1d31=Cesium__namespace['Cartesian3']['cross'](_0xcb4b10,_0x2a1d31,_0x2a1d31),_0x2a1d31=Cesium__namespace[_0xc64c3a(_0x1ed70e._0x22de43)]['normalize'](_0x2a1d31,_0x2a1d31);let _0x4370b4=Cesium__namespace['Cartesian3'][_0xc64c3a(0x5ec)](_0x1abb04,_0x2a1d31);const _0x6e9869=Cesium__namespace[_0xc64c3a(_0x1ed70e._0x52fe6f)]['angleBetween'](_0x71af3b,_0x2a1d31);_0x6e9869>Math['PI']*0.5&&(_0x4370b4=0x2*Math['PI']-_0x4370b4),this['orginRotation']={'x':0x0,'y':0x0,'z':Number(Cesium__namespace[_0xc64c3a(_0x1ed70e._0x4290d4)]['toDegrees'](_0x4370b4)['toFixed'](0x1))};}else this['transform']=![];}this[_0xc64c3a(_0x1ed70e._0x5dde52)]=LngLatPoint['fromCartesian'](this['_orginCenterPosition']),logInfo((this['name']||'TilesetLayer')+'\x20模型中心位置:'+this['_orginCenterPoint']['toString']());if((_0x2fd686=Cesium__namespace[_0xc64c3a(_0x1ed70e._0x1fc9ab)])!==null&&_0x2fd686!==void 0x0&&_0x2fd686['getCache']){const _0x3b3f3d=Cesium__namespace['Mars3DEx']['getCache'](this['id']);_0x3b3f3d!==null&&_0x3b3f3d!==void 0x0&&_0x3b3f3d['marsJzwStyle']&&_0x3b3f3d['marsJzwStyle']['setUniform']('u_mars3d_jzw_upz',this['upAxis']===Cesium__namespace['Axis']['Z']);}Cesium__namespace['defined'](this['options']['style'])&&(this[_0xc64c3a(_0x1ed70e._0x2c6b00)]=this['options']['style']);this['_opacity']!==0x1&&this[_0xc64c3a(0x45c)](this[_0xc64c3a(_0x1ed70e._0x555230)]);this['_center']=this['_orginCenterPoint']['clone'](),this[_0xc64c3a(0xb4)](this['options'][_0xc64c3a(0xb61)]);if(this['options']['chinaCRS']){const _0x44c435=this['transformCenter'](this[_0xc64c3a(_0x1ed70e._0x446189)]);this[_0xc64c3a(_0x1ed70e._0x16926b)](_0x44c435);}this['_hasUpdateMater']()&&this[_0xc64c3a(0xf31)](),Cesium__namespace['defined'](this['options']['distanceDisplayCondition_far'])&&this[_0xc64c3a(0x203)](),this['options'][_0xc64c3a(_0x1ed70e._0x2ffada)]&&this['clampToGround'](),this[_0xc64c3a(_0x1ed70e._0x5d5e6a)]['flyTo']&&this['flyToByAnimationEnd']();}['clampToGround'](_0x3a3087=0x1){const _0x36c94f={_0x1febf3:0x234,_0x15cd61:0x5d2},_0x42685={_0x3c7202:0x682},_0x19b93d=_0x35a251;this['_map']&&this['_map'][_0x19b93d(_0x36c94f._0x1febf3)]?getSurfaceTerrainHeight(this['_map']['scene'],this['_orginCenterPosition'])['then'](_0x5a5eae=>{const _0x4f996c=_0x19b93d;Cesium__namespace['defined'](_0x5a5eae['height'])&&(this['alt']=_0x5a5eae[_0x4f996c(_0x42685._0x3c7202)]-this['_orginCenterPoint']['alt']+_0x3a3087);}):this[_0x19b93d(_0x36c94f._0x15cd61)]=-this['_orginCenterPoint']['alt']+_0x3a3087;}['_hasUpdateMater'](){const _0x3797a2={_0x16680b:0xe86},_0x2b202f=_0x35a251;if(!this['center'][_0x2b202f(0x417)](this['_orginCenterPoint']))return!![];if(this['options'][_0x2b202f(0xb7a)])return!![];if(this[_0x2b202f(0xe86)]['scale']>0x0&&this[_0x2b202f(_0x3797a2._0x16680b)][_0x2b202f(0x1cb)]!==0x1)return!![];if(Cesium__namespace['defined'](this['options']['axis']))return!![];return![];}['updateMatrix'](){const _0x448fde={_0x15ab7b:0x5f1,_0x41b37b:0xe86,_0x6817b0:0xd04,_0x534e92:0x2d4,_0x57bf3a:0xaa2,_0x2e02dc:0x465,_0x57bd97:0xc0d,_0x1994a2:0x2a7,_0x51107b:0xc07},_0x1052b3=_0x35a251;if(!this[_0x1052b3(_0x448fde._0x15ab7b)])return undefined;if(this['options']['updateMatrix']){const _0x2531dc=this['options']['updateMatrix'](this['position'],this);return this['_tileset']['modelMatrix']=_0x2531dc,_0x2531dc;}if(!this['transform'])return this['updateMatrix2']();let _0x23358b=Cesium__namespace['Transforms'][_0x1052b3(0x67b)](this['position']);if(this[_0x1052b3(_0x448fde._0x41b37b)]['rotation']){const _0xd24729=Cesium__namespace['Matrix3']['fromRotationX'](Cesium__namespace[_0x1052b3(0x7c0)]['toRadians'](this['rotation_x'])),_0x422f35=Cesium__namespace[_0x1052b3(0xd9d)][_0x1052b3(_0x448fde._0x6817b0)](Cesium__namespace['Math']['toRadians'](this['rotation_y'])),_0x55d4f6=Cesium__namespace['Matrix3']['fromRotationZ'](Cesium__namespace[_0x1052b3(0x7c0)]['toRadians'](0x168-this['rotation_z'])),_0x57c79f=Cesium__namespace['Matrix4'][_0x1052b3(0xf43)](_0xd24729),_0x1de6cc=Cesium__namespace[_0x1052b3(0x6a7)]['fromRotationTranslation'](_0x422f35),_0x3504a1=Cesium__namespace['Matrix4']['fromRotationTranslation'](_0x55d4f6);Cesium__namespace['Matrix4']['multiply'](_0x23358b,_0x57c79f,_0x23358b),Cesium__namespace['Matrix4']['multiply'](_0x23358b,_0x1de6cc,_0x23358b),Cesium__namespace[_0x1052b3(0x6a7)]['multiply'](_0x23358b,_0x3504a1,_0x23358b);}this['options']['scale']>0x0&&this['options']['scale']!==0x1&&Cesium__namespace['Matrix4'][_0x1052b3(_0x448fde._0x534e92)](_0x23358b,this['options']['scale'],_0x23358b);if(Cesium__namespace[_0x1052b3(_0x448fde._0x57bf3a)](this['options']['axis'])){let _0x5d3d46;if(isString(this['options']['axis']))switch(this['options']['axis'][_0x1052b3(0x8d6)]()){case _0x1052b3(_0x448fde._0x2e02dc):_0x5d3d46=Cesium__namespace[_0x1052b3(_0x448fde._0x57bd97)][_0x1052b3(_0x448fde._0x2e02dc)];break;case'Z_UP_TO_Y_UP':_0x5d3d46=Cesium__namespace[_0x1052b3(0xc0d)]['Z_UP_TO_Y_UP'];break;case'X_UP_TO_Z_UP':_0x5d3d46=Cesium__namespace[_0x1052b3(_0x448fde._0x57bd97)]['X_UP_TO_Z_UP'];break;case _0x1052b3(_0x448fde._0x1994a2):_0x5d3d46=Cesium__namespace[_0x1052b3(_0x448fde._0x57bd97)]['Z_UP_TO_X_UP'];break;case'X_UP_TO_Y_UP':_0x5d3d46=Cesium__namespace['Axis']['X_UP_TO_Y_UP'];break;case'Y_UP_TO_X_UP':_0x5d3d46=Cesium__namespace[_0x1052b3(0xc0d)]['Y_UP_TO_X_UP'];break;}else this[_0x1052b3(_0x448fde._0x41b37b)][_0x1052b3(_0x448fde._0x51107b)]instanceof Cesium__namespace['Axis']&&(_0x5d3d46=this['options']['axis']);_0x5d3d46&&(_0x23358b=Cesium__namespace[_0x1052b3(0x6a7)]['multiplyTransformation'](_0x23358b,_0x5d3d46,_0x23358b));}return this[_0x1052b3(0x5f1)]['_root']['transform']=_0x23358b,this['fire'](EventType['updatePosition'],{'position':this['position']}),_0x23358b;}[_0x35a251(0xac8)](){const _0x5142f4={_0x34b0db:0xd57,_0x5e428b:0x5f1,_0x3cb1c0:0xdb5,_0x518702:0x8eb},_0x474f61=_0x35a251;if(!this['_tileset']||!this['_tileset'][_0x474f61(_0x5142f4._0x34b0db)])return;const _0xd64d6e=Cesium__namespace['Cartographic'][_0x474f61(0x9b1)](this[_0x474f61(_0x5142f4._0x5e428b)][_0x474f61(_0x5142f4._0x3cb1c0)]['center']),_0xe5aa6c=Cesium__namespace[_0x474f61(_0x5142f4._0x518702)]['fromRadians'](_0xd64d6e['longitude'],_0xd64d6e['latitude'],0x0),_0x3cc456=this['position'],_0x4cf224=Cesium__namespace['Cartesian3']['subtract'](_0x3cc456,_0xe5aa6c,new Cesium__namespace['Cartesian3']()),_0x484ec8=Cesium__namespace['Matrix4']['fromTranslation'](_0x4cf224);return this['_tileset']['modelMatrix']=_0x484ec8,this['fire'](EventType['updatePosition'],{'position':this['position']}),_0x484ec8;}[_0x35a251(0x10c)](_0xe5728a){const _0x26b0aa={_0x2b52f6:0x8eb},_0x303975=_0x35a251;if(this['orginMatrix']){const _0x475553=Cesium__namespace['Matrix4']['multiply'](this['_tileset']['_root']['transform'],this['orginMatrix'],new Cesium__namespace['Matrix4']());return Cesium__namespace['Matrix4']['multiplyByPoint'](_0x475553,_0xe5728a,new Cesium__namespace[(_0x303975(_0x26b0aa._0x2b52f6))]());}return _0xe5728a;}[_0x35a251(0x45c)](_0x156fb4){const _0x3864c3={_0x567876:0xe86,_0x1b5af4:0x5f1,_0x15bb3d:0xf0},_0x1bdfff=_0x35a251;this[_0x1bdfff(_0x3864c3._0x567876)][_0x1bdfff(0x608)]?this['options']['onSetOpacity'](_0x156fb4):this[_0x1bdfff(0x5f1)]&&(this[_0x1bdfff(_0x3864c3._0x1b5af4)]['style']=new Cesium__namespace['Cesium3DTileStyle']({'color':_0x1bdfff(_0x3864c3._0x15bb3d)+_0x156fb4+')'}));}[_0x35a251(0x5b2)](_0x3c3507={}){const _0x45dbeb={_0x549a80:0xe86,_0x51e23f:0xe86,_0x505b3b:0x176},_0x5ef233={_0x39802a:0xd79,_0x2234cf:0xe1c,_0x52d132:0x5f1,_0xfff132:0xdb5},_0x417acf=_0x35a251;if(!this['_map'])return Promise['resolve'](![]);this[_0x417acf(0xd79)]['cancelFlyTo']();this['options']['flyToOptions']&&(_0x3c3507={...this[_0x417acf(_0x45dbeb._0x549a80)]['flyToOptions'],..._0x3c3507});if(this[_0x417acf(_0x45dbeb._0x51e23f)]['center'])return this['_map']['setCameraView'](this['options']['center'],_0x3c3507);else{if(this[_0x417acf(0xe86)]['extent'])return this['_map'][_0x417acf(0x497)](this[_0x417acf(0xe86)]['extent'],_0x3c3507);else return this[_0x417acf(0xb71)]&&this['_tileset'][_0x417acf(0xd57)]?this['_map'][_0x417acf(0xe1c)](this['_tileset']['boundingSphere'][_0x417acf(_0x45dbeb._0x505b3b)],{'radius':this['_tileset'][_0x417acf(0xdb5)]['radius']*0x2,'maxPitch':-0x2d,..._0x3c3507}):this['readyPromise']['then'](_0x413e83=>{const _0xdb2540=_0x417acf;return this[_0xdb2540(_0x5ef233._0x39802a)][_0xdb2540(_0x5ef233._0x2234cf)](this[_0xdb2540(_0x5ef233._0x52d132)][_0xdb2540(_0x5ef233._0xfff132)]['center'],{'radius':this['_tileset']['boundingSphere']['radius']*0x2,'maxPitch':-0x2d,..._0x3c3507});});}}['_toJsonEx'](_0x41a3ad){const _0x36bfe3={_0x4a0e1c:0xb61,_0x44bfcb:0x769,_0x22b669:0x786,_0x3a3da5:0xc65},_0x4c1dfb=_0x35a251;if(!this['_tileset']||!this['loadOk'])return;_0x41a3ad[_0x4c1dfb(_0x36bfe3._0x4a0e1c)]=this['center'][_0x4c1dfb(_0x36bfe3._0x44bfcb)](),this['_tilesetPlanClip']&&(_0x41a3ad[_0x4c1dfb(0xc70)]=this['_tilesetPlanClip']['toJSON']()),this['_tilesetClip']&&(_0x41a3ad['clip']=this[_0x4c1dfb(_0x36bfe3._0x22b669)][_0x4c1dfb(0x99e)]()),this[_0x4c1dfb(_0x36bfe3._0x3a3da5)]&&(_0x41a3ad['flat']=this['_tilesetFlat']['toJSON']()),this['_tilesetFlood']&&(_0x41a3ad['flood']=this[_0x4c1dfb(0x192)][_0x4c1dfb(0x99e)]());}[_0x35a251(0xc76)](_0x131e7b,_0x5ab47c){const _0xa8865={_0x58327f:0xc3},_0x10e31b={_0x1e1b40:0x363},_0x427395=_0x35a251;return this[_0x427395(_0xa8865._0x58327f)]=_0x131e7b,this['_properties']={},_0x5ab47c['forEach'](_0x4a5a2c=>{const _0x323551=_0x427395,_0x34ba4a=_0x4a5a2c[_0x131e7b];this[_0x323551(_0x10e31b._0x1e1b40)][_0x34ba4a]=_0x4a5a2c;}),this['_bindVisibleEvent'](),this;}[_0x35a251(0x833)](_0x5a4115,_0x18670c){const _0x4e401d={_0x160eef:0x8b8},_0x2ca063=_0x35a251;if(!_0x5a4115||!_0x18670c){delete this['_properties'];this['_isBindTileVisible']&&(this[_0x2ca063(0x5f1)]['tileVisible'][_0x2ca063(0x4d6)](this['_updateTile'],this),this[_0x2ca063(_0x4e401d._0x160eef)]=![]);return;}return _0x18670c['forEach'](_0xdbefa=>{const _0x111bf9=_0xdbefa[_0x5a4115];delete this['_properties'][_0x111bf9];}),this;}['_bindVisibleEvent'](){const _0x1bceba={_0x5074e5:0x86c},_0x5d806a={_0x4d8e95:0x77e,_0x27b2f0:0x8b8},_0x3a2a9f=_0x35a251;!this['_isBindTileVisible']&&this['readyPromise'][_0x3a2a9f(_0x1bceba._0x5074e5)](()=>{const _0x8b27f1=_0x3a2a9f;this['_tileset']['tileVisible'][_0x8b27f1(_0x5d806a._0x4d8e95)](this['_updateTile'],this),this[_0x8b27f1(_0x5d806a._0x27b2f0)]=!![];});}[_0x35a251(0x3a7)](_0x405e78){const _0x3ae4b6={_0x56e35f:0x4d9},_0x187c07=_0x35a251,_0x1b7fd5=_0x405e78['content'];for(let _0x280f47=0x0;_0x280f47<_0x1b7fd5['featuresLength'];_0x280f47++){const _0x1c1176=_0x1b7fd5[_0x187c07(_0x3ae4b6._0x56e35f)](_0x280f47);if(this['_properties']){const _0x30710b=_0x1c1176['getProperty'](this['_idField']);_0x30710b&&this['_setFeatureProperties'](_0x1c1176,this['_properties'][_0x30710b]);}}this['fire'](EventType['update']);}['_setFeatureProperties'](_0x1f849b,_0x9217a3){const _0x2adb4e=_0x35a251;if(!_0x1f849b||!_0x9217a3)return;for(const _0x40011b in _0x9217a3){const _0x2a18b9=_0x9217a3[_0x40011b];if(_0x1f849b['hasProperty'](_0x40011b)&&_0x1f849b[_0x2adb4e(0x607)](_0x40011b)===_0x2a18b9)continue;_0x1f849b['setProperty'](_0x40011b,_0x2a18b9);}}[_0x35a251(0x62d)](){const _0x306b2a={_0x2c20fe:0xd79},_0x5c48ee=_0x35a251;let _0x2ce165=0x0;const _0x5afe95=this[_0x5c48ee(_0x306b2a._0x2c20fe)]['_tilesets'];for(const _0x57be38 in _0x5afe95){_0x2ce165+=_0x5afe95[_0x57be38]['totalMemoryUsageInBytes']/0x400/0x400;}if(_0x2ce165>this['_map']['tilesetMaxTotalMemory'])for(const _0x5609f7 in _0x5afe95){_0x5afe95[_0x5609f7]['trimLoadedTiles']();}}['transformCenter'](_0x2bed99){const _0x260dff=_0x35a251;if(!_0x2bed99)return![];const _0x4a5fbd=this[_0x260dff(0xd79)]['chinaCRS'],_0x40d89c=this['options']['chinaCRS'],_0x325c2d=getTransFun(_0x40d89c,_0x4a5fbd);if(!_0x325c2d)return![];const _0x5b4da7=_0x325c2d([_0x2bed99['lng'],_0x2bed99['lat']]);return{'lng':_0x5b4da7[0x0],'lat':_0x5b4da7[0x1],'alt':_0x2bed99['alt']};}[_0x35a251(0x203)](){this['_map']['on'](EventType['cameraChanged'],this['updateVisibleDistance'],this);}['updateVisibleDistance'](){const _0x31c54f={_0x4c92f5:0xd79},_0x8ec3bc=_0x35a251;if(!this['_show']||!this['_tileset']||!this['loadOk'])return;if(this[_0x8ec3bc(_0x31c54f._0x4c92f5)]['scene']['mode']!==Cesium__namespace[_0x8ec3bc(0x637)]['SCENE3D'])return;const _0x2eeb8a=Cesium__namespace['Cartesian3']['distance'](this['position'],this[_0x8ec3bc(0xd79)][_0x8ec3bc(0x7d)]['positionWC']);this['_tileset'][_0x8ec3bc(0x987)]=_0x2eeb8a{const _0x3c087a=_0x2767;this[_0x3c087a(_0x1eeb49._0x4a55a1)](EventType['loadBefore'],{'provider':_0x6c74da}),this['_initModel'](_0x6c74da),this[_0x3c087a(_0x1eeb49._0x229d3a)]=!![],this['_readyPromise'][_0x3c087a(0xc74)](this),this['fire'](EventType['load'],{'provider':_0x6c74da,'layers':_0x6c74da['_layers']});});}['_removedHook'](){const _0xf498ed={_0x396998:0xa9a,_0x3a9cf5:0xee2,_0x3b65db:0x4e1},_0x2ed204=_0x35a251;super[_0x2ed204(_0xf498ed._0x396998)](),this[_0x2ed204(_0xf498ed._0x3a9cf5)]&&(this['_map']['scene'][_0x2ed204(_0xf498ed._0x3b65db)]['remove'](this['_i3sProvider']),delete this['_i3sProvider']);}['reload'](){const _0x1b5665={_0x535128:0xa9a},_0x4adedd=_0x35a251;this[_0x4adedd(_0x1b5665._0x535128)](),this['_addedHook']();}['_initModel'](_0xa9cba0){const _0x44d647={_0x1d5d72:0x987,_0x11b028:0xee2},_0x33c401=_0x35a251;this['_i3sProvider']=_0xa9cba0,this[_0x33c401(0xee2)]['_mars3d_layerId']=this['id'],this[_0x33c401(0xee2)][_0x33c401(_0x44d647._0x1d5d72)]=this['show'],this['_map']['scene']['primitives']['add'](this[_0x33c401(_0x44d647._0x11b028)]),this['_extent']=this[_0x33c401(0xee2)][_0x33c401(0x1fa)],this['_orginCenterPoint']=LngLatPoint['fromCartographic'](Cesium__namespace['Rectangle']['center'](this['_extent'])),this[_0x33c401(0xd80)]=this['_orginCenterPoint']['toCartesian'](),logInfo((this['name']||'I3SLayer')+'\x20模型中心位置:'+this['_orginCenterPoint']['toString']()),this['_center']=this['_orginCenterPoint'][_0x33c401(0xd61)](),this['options']['flyTo']&&this['flyToByAnimationEnd']();}['flyTo'](_0x5843bc={}){const _0xa3c33c={_0x125f88:0xd79,_0x4890ac:0xe86,_0x564951:0x176},_0x34a51e=_0x35a251;if(!this[_0x34a51e(_0xa3c33c._0x125f88)])return Promise['resolve'](![]);this['_map'][_0x34a51e(0x978)]();this[_0x34a51e(_0xa3c33c._0x4890ac)]['flyToOptions']&&(_0x5843bc={...this['options']['flyToOptions'],..._0x5843bc});if(this['options']['center'])return this['_map']['setCameraView'](this['options'][_0x34a51e(_0xa3c33c._0x564951)],_0x5843bc);else{if(this['options']['extent'])return this['_map'][_0x34a51e(0x497)](this['options']['extent'],_0x5843bc);else{if(this[_0x34a51e(0xb82)])return this['_map'][_0x34a51e(0xe1c)](this[_0x34a51e(0xb82)],{'maxPitch':-0x2d,..._0x5843bc});}}}[_0x35a251(0xab6)](){const _0x3b2c56={_0x25d12e:0xc43,_0x3a910f:0x25b},_0x4f4804=_0x35a251;var _0x2b4fc7;if(!((_0x2b4fc7=Cesium__namespace['Mars3DEx'])!==null&&_0x2b4fc7!==void 0x0&&_0x2b4fc7['getCacheOrAdd']))return;this['_marsOptions']['customShaders']=this['id'];const _0x2ee7b0=Cesium__namespace['Mars3DEx']['getCacheOrAdd'](this['id']);this['marsJzwStyle']?_0x2ee7b0['marsJzwStyle']=new Cesium__namespace['CustomShader']({'lightingModel':Cesium__namespace['LightingModel'][_0x4f4804(_0x3b2c56._0x25d12e)],'uniforms':{'u_mars3d_jzw_upz':{'type':Cesium__namespace[_0x4f4804(0xba1)][_0x4f4804(0xe6a)],'value':![]}},'fragmentShaderText':isString(this['marsJzwStyle'])?this['marsJzwStyle']:_0x4f4804(_0x3b2c56._0x3a910f)}):delete _0x2ee7b0[_0x4f4804(0x983)];}}register$2(_0x35a251(0x569),I3SLayer);const mins=[Cesium__namespace['Math']['toRadians'](0.05),Cesium__namespace[_0x35a251(0x7c0)]['toRadians'](0.1),Cesium__namespace['Math'][_0x35a251(0x7ba)](0.2),Cesium__namespace['Math']['toRadians'](0.5),Cesium__namespace['Math']['toRadians'](0x1),Cesium__namespace['Math']['toRadians'](0x2),Cesium__namespace['Math'][_0x35a251(0x7ba)](0x5),Cesium__namespace['Math'][_0x35a251(0x7ba)](0xa)];function gridPrecision(_0x901122){if(_0x901122<0.01)return 0x2;if(_0x901122<0.1)return 0x1;if(_0x901122<0x1)return 0x0;return 0x0;}function GraticuleProvider(_0x478614){const _0x5244d0={_0x1d1e01:0x7fd,_0x39aa04:0x865,_0x3869b3:0x5d4,_0x441633:0x600,_0x356784:0x4e1,_0x352f28:0xb23},_0x414769=_0x35a251;this['options']=_0x478614,this[_0x414769(_0x5244d0._0x1d1e01)]=_0x478614[_0x414769(_0x5244d0._0x39aa04)]||new Cesium__namespace[(_0x414769(0xd70))](),this['_tileWidth']=_0x478614['tileWidth']||0x100,this['_tileHeight']=_0x478614['tileHeight']||0x100,this[_0x414769(0xf03)]=!![],this['_sexagesimal']=_0x478614['sexagesimal']||![],this['_numLines']=_0x478614['numLines']||0x32,this[_0x414769(_0x5244d0._0x3869b3)]=_0x478614[_0x414769(0xc60)],this['_ellipsoid']=this['_scene']['globe']['ellipsoid'],this['_labels']=new Cesium__namespace[(_0x414769(0x709))](),this['_scene']['primitives']['add'](this[_0x414769(_0x5244d0._0x441633)]),this['_polylines']=new Cesium__namespace['PolylineCollection'](),this['_scene'][_0x414769(_0x5244d0._0x356784)]['add'](this[_0x414769(_0x5244d0._0x352f28)]);const _0x4e63f2=document['createElement']('canvas');_0x4e63f2['width']=0x100,_0x4e63f2[_0x414769(0x682)]=0x100,this['_canvas']=_0x4e63f2;const _0x59a509=this;this[_0x414769(0x5d4)]['camera']['moveEnd']['addEventListener'](function(){const _0x77f086=_0x414769;if(!_0x59a509['_show'])return;_0x59a509[_0x77f086(0xb23)]['removeAll'](),_0x59a509['_labels']['removeAll'](),_0x59a509['_currentExtent']=null,_0x59a509['_drawGrid'](_0x59a509['_getExtentView']());}),this[_0x414769(_0x5244d0._0x3869b3)][_0x414769(0xf66)]['addImageryProvider'](this);}Object['defineProperties'](GraticuleProvider['prototype'],{'url':{'get':function(){return undefined;}},'proxy':{'get':function(){return undefined;}},'tileWidth':{'get':function(){const _0x29e3c1={_0x14cb35:0xafe},_0x263315=_0x35a251;return this[_0x263315(_0x29e3c1._0x14cb35)];}},'tileHeight':{'get':function(){return this['_tileHeight'];}},'maximumLevel':{'get':function(){return 0x12;}},'minimumLevel':{'get':function(){return 0x0;}},'tilingScheme':{'get':function(){return this['_tilingScheme'];}},'rectangle':{'get':function(){const _0x1b1ee7={_0x5ac661:0xab1},_0x1af561=_0x35a251;return this['_tilingScheme'][_0x1af561(_0x1b1ee7._0x5ac661)];}},'tileDiscardPolicy':{'get':function(){return undefined;}},'errorEvent':{'get':function(){return this['_errorEvent'];}},'ready':{'get':function(){return this['_ready'];}},'credit':{'get':function(){return this['_credit'];}},'hasAlphaChannel':{'get':function(){return!![];}}}),GraticuleProvider['prototype']['makeLabel']=function(_0x5e47ea,_0x413d08,_0x137be4,_0x4d0c85,_0x5883b0){const _0x5b9702={_0x232f56:0xc04,_0x18133f:0xa1f,_0x29849f:0xf29,_0x3e1971:0x311,_0xe558ad:0x120},_0x578f5c=_0x35a251,_0xf5de9f=LabelStyleConver[_0x578f5c(_0x5b9702._0x232f56)](this['options'][_0x578f5c(_0x5b9702._0x18133f)]||{},{'style':Cesium__namespace['LabelStyle']['FILL_AND_OUTLINE'],'fillColor':Cesium__namespace[_0x578f5c(_0x5b9702._0x29849f)][_0x578f5c(_0x5b9702._0x3e1971)],'outlineColor':Cesium__namespace['Color']['BLACK'],'outlineWidth':0x2,'pixelOffset':new Cesium__namespace['Cartesian2'](0x5,_0x4d0c85?0x5:-0x5),'eyeOffset':Cesium__namespace['Cartesian3'][_0x578f5c(0xa84)],'horizontalOrigin':Cesium__namespace[_0x578f5c(0x172)]['LEFT'],'verticalOrigin':_0x4d0c85?Cesium__namespace[_0x578f5c(0xf93)]['BOTTOM']:Cesium__namespace['VerticalOrigin']['TOP'],'scale':0x1});_0xf5de9f[_0x578f5c(0xb61)]=this['_ellipsoid']['cartographicToCartesian'](new Cesium__namespace[(_0x578f5c(_0x5b9702._0xe558ad))](_0x5e47ea,_0x413d08,0xa)),_0xf5de9f['text']=_0x137be4,this['_labels'][_0x578f5c(0x4af)](_0xf5de9f);},GraticuleProvider[_0x35a251(0xb1b)]['_drawGrid']=function(_0x38f935){const _0x5b3900={_0x21e49a:0x62e,_0x14c89e:0xb23,_0x5563a9:0x6ba,_0x1de996:0xa47,_0x3bacec:0xc04,_0x30556a:0x6ba,_0x308cf8:0x120,_0x3cd104:0x6de},_0x5b49b3=_0x35a251;if(this['_currentExtent']&&this[_0x5b49b3(_0x5b3900._0x21e49a)][_0x5b49b3(0x417)](_0x38f935))return;this['_currentExtent']=_0x38f935,this[_0x5b49b3(_0x5b3900._0x14c89e)]['removeAll'](),this['_labels'][_0x5b49b3(0xb05)]();let _0x41b1b0=0x0,_0xacd32e=0x0,_0x43f2c;for(_0x43f2c=0x0;_0x43f2c{const _0x25ffd7=_0x2767;this['_show']&&this['_drawGrid'](this[_0x25ffd7(_0x6f4555._0x75ca62)]()),_0x40bb68(this['_canvas']);});},GraticuleProvider['prototype']['setVisible']=function(_0x2d6a51){const _0x58d392={_0x3f10e9:0xbb9},_0x501281=_0x35a251;this['_show']=_0x2d6a51,!_0x2d6a51?(this['_polylines']['removeAll'](),this['_labels'][_0x501281(0xb05)]()):(this['_currentExtent']=null,this[_0x501281(_0x58d392._0x3f10e9)](this['_getExtentView']()));},GraticuleProvider[_0x35a251(0xb1b)]['isVisible']=function(){return this['_show'];},GraticuleProvider[_0x35a251(0xb1b)]['_decToSex']=function(_0x21c3b4){const _0x36af13={_0x353b88:0x6ba,_0x20a84a:0xf0a,_0x39c4bd:0x485,_0x124483:0x306},_0x231fac=_0x35a251;let _0x59190a=Math[_0x231fac(_0x36af13._0x353b88)](_0x21c3b4),_0x2dcdc4=((Math['abs'](_0x21c3b4)-_0x59190a)*0x3c)[_0x231fac(_0x36af13._0x20a84a)](0x2);return _0x2dcdc4==='60.00'&&(_0x59190a+=0x1,_0x2dcdc4=_0x231fac(_0x36af13._0x39c4bd)),[_0x59190a,':',_0x2dcdc4][_0x231fac(_0x36af13._0x124483)]('');},GraticuleProvider[_0x35a251(0xb1b)]['_getExtentView']=function(){const _0x2a31d6={_0x33a98f:0x5d4,_0x2c132d:0x248,_0x4c1066:0x682},_0x1cacb4=_0x35a251,_0x4e2d45=this['_scene']['camera'],_0x584903=this[_0x1cacb4(_0x2a31d6._0x33a98f)][_0x1cacb4(0xee1)],_0x49304f=[_0x4e2d45['pickEllipsoid'](new Cesium__namespace[(_0x1cacb4(_0x2a31d6._0x2c132d))](0x0,0x0),this['_ellipsoid']),_0x4e2d45['pickEllipsoid'](new Cesium__namespace[(_0x1cacb4(0x248))](_0x584903['width'],0x0),this['_ellipsoid']),_0x4e2d45['pickEllipsoid'](new Cesium__namespace['Cartesian2'](0x0,_0x584903[_0x1cacb4(0x682)]),this['_ellipsoid']),_0x4e2d45['pickEllipsoid'](new Cesium__namespace['Cartesian2'](_0x584903['width'],_0x584903[_0x1cacb4(_0x2a31d6._0x4c1066)]),this['_ellipsoid'])];for(let _0x327d75=0x0;_0x327d75<0x4;_0x327d75++){if(_0x49304f[_0x327d75]===undefined)return Cesium__namespace['Rectangle']['MAX_VALUE'];}return Cesium__namespace['Rectangle'][_0x1cacb4(0xd23)](this[_0x1cacb4(0xed0)]['cartesianArrayToCartographicArray'](_0x49304f));};class GraticuleLayer extends BaseLayer{get['layer'](){return this['_graticuleProvider'];}[_0x35a251(0xa40)](_0x28e603){this['_graticuleProvider']&&this['_graticuleProvider']['setVisible'](_0x28e603);}[_0x35a251(0x700)](){const _0x1c3c41={_0x2f7b7a:0xd79},_0x4d9f6a=_0x35a251;this['_graticuleProvider']=new GraticuleProvider({'scene':this[_0x4d9f6a(_0x1c3c41._0x2f7b7a)]['scene'],'numLines':0xa,...this[_0x4d9f6a(0xe86)]});}['_addedHook'](){const _0x5d8ced={_0xb8d2eb:0xc6},_0x16c529=_0x35a251;this[_0x16c529(_0x5d8ced._0xb8d2eb)]['setVisible'](this['show']);}['_removedHook'](){const _0x4469e2={_0x51e8cc:0x623},_0x3c1539=_0x35a251;this[_0x3c1539(0xc6)][_0x3c1539(_0x4469e2._0x51e8cc)](![]);}}register$2('graticule',GraticuleLayer);class LodGraphicLayer extends GraphicLayer{constructor(_0x2edd64={}){const _0x477589=_0x35a251;super(_0x2edd64),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this['options']['IdField']=this['options']['IdField']||'id',this[_0x477589(0xe86)]['debuggerTileInfo']&&this[_0x477589(0x2f5)](function(_0x527925){const _0x24fe59=_0x477589;var _0x35d2ae;const _0x36cf67=(_0x527925===null||_0x527925===void 0x0?void 0x0:(_0x35d2ae=_0x527925[_0x24fe59(0xf8c)])===null||_0x35d2ae===void 0x0?void 0x0:_0x35d2ae['gridList'])||[];return _0x36cf67['join'](_0x24fe59(0x3f8));}),this[_0x477589(0xe8)]={},this['_cacheGraphic']={};}get['isLoading'](){const _0x1a8cc0=_0x35a251;for(const _0x1df501 in this['_cacheGrid']){const _0x148f3d=this[_0x1a8cc0(0xe8)][_0x1df501];if(!_0x148f3d||!_0x148f3d[_0x1a8cc0(0x5c9)])continue;if(_0x148f3d['isLoading'])return!![];}return![];}['_showHook'](_0x158c5e){const _0x451dab={_0x5882b8:0xcc7},_0x17b463=_0x35a251;super[_0x17b463(0xa40)](_0x158c5e),this['_tileLayer']&&(this[_0x17b463(_0x451dab._0x5882b8)][_0x17b463(0x987)]=_0x158c5e);}[_0x35a251(0x700)](){const _0x3af4b9=_0x35a251;super['_mountedHook']();const _0x525d75={...this['options'],'private':!![]};delete _0x525d75['id'],delete _0x525d75['name'],delete _0x525d75[_0x3af4b9(0xd05)],delete _0x525d75['type'],this['_tileLayer']=new EmptyTileLayer(_0x525d75),this['_tileLayer']['readyPromise']['then'](()=>{this['_readyPromise']['resolve'](this);});}['_addedHook'](){const _0x54b9dd={_0x196a83:0xc1f,_0x2f9e9e:0xcc7,_0xce631b:0x647,_0x11d40c:0xd79,_0x5d40ed:0x86c},_0x1b9719=_0x35a251;super[_0x1b9719(0x97b)](),this['_tileLayer']['on'](EventType['addTile'],this[_0x1b9719(_0x54b9dd._0x196a83)],this),this[_0x1b9719(_0x54b9dd._0x2f9e9e)]['on'](EventType['removeTile'],this[_0x1b9719(_0x54b9dd._0xce631b)],this);const _0x54e2aa=this[_0x1b9719(_0x54b9dd._0x11d40c)];Promise[_0x1b9719(0x57d)]([new Promise((_0x11f277,_0x45e4db)=>{const _0x34d34e=_0x1b9719;function _0x3ddb7f(_0x2365d4){_0x2365d4===0x0&&(_0x54e2aa['off'](EventType['tileLoadProgress'],_0x3ddb7f),_0x11f277(!![]));}_0x54e2aa['on'](EventType[_0x34d34e(0xeff)],_0x3ddb7f);}),this['_map']['terrainProvider']['readyPromise']])[_0x1b9719(_0x54b9dd._0x5d40ed)](_0x59e859=>{const _0x96cf65=_0x1b9719;this['_map']['addLayer'](this[_0x96cf65(0xcc7)]);});}['_removedHook'](){const _0x1ad779={_0x36b2a4:0xe01,_0x24ab35:0xcc7},_0x2ffb59=_0x35a251;super['_removedHook'](),this['_tileLayer']['off'](EventType[_0x2ffb59(_0x1ad779._0x36b2a4)],this['_tileLayer_addTileHandler'],this),this[_0x2ffb59(_0x1ad779._0x24ab35)][_0x2ffb59(0x6b2)](EventType['removeTile'],this[_0x2ffb59(0x647)],this),this['_map'][_0x2ffb59(0xad7)](this['_tileLayer']),this['clear']();}['getGridKey'](_0x39397b){return _0x39397b['level']+'_x'+_0x39397b['x']+'_y'+_0x39397b['y'];}['checkHasBreak'](_0x9ab91e){if(!this['show']||!this['_cacheGrid'][_0x9ab91e])return!![];return![];}['_tileLayer_addTileHandler'](_0x302045){const _0xa21462={_0x20124e:0x86c},_0x24cfaa={_0x4bfd6d:0x987},_0x4261d6=_0x35a251;if(!this['_tileLayer']['isInRange'](_0x302045['level']))return;const _0x4b52d8=this['getGridKey'](_0x302045);_0x302045['key']=_0x4b52d8,this['_cacheGrid'][_0x4b52d8]={'grid':_0x302045,'isLoading':!![]},this[_0x4261d6(0xc58)](_0x302045)[_0x4261d6(_0xa21462._0x20124e)](_0x25b184=>{const _0x2a90d3=_0x4261d6;this[_0x2a90d3(_0x24cfaa._0x4bfd6d)]&&this['_showData'](_0x25b184);});}['_getItemDataId'](_0x15054c){const _0x50aa03={_0x325529:0x7d9},_0x4c7db0=_0x35a251;if(_0x15054c['id'])return _0x15054c['id'];_0x15054c[_0x4c7db0(0x8ea)]===_0x4c7db0(0x98f)&&(_0x15054c=_0x15054c[_0x4c7db0(_0x50aa03._0x325529)]);if(_0x15054c[this['options']['IdField']])return _0x15054c[this['options']['IdField']];return null;}['_showData'](_0x48fab4){const _0x54277c={_0x592c43:0x3cc,_0x180244:0x80c,_0x5c98c9:0xe8},_0x495d54=_0x35a251,_0x3eba6e=_0x48fab4['list'],_0x13112e=_0x48fab4['key'];if(this[_0x495d54(0x5a5)][_0x13112e])return;const _0x3fc04d=[],_0x33d20a=[];for(let _0x2406cf=0x0,_0x2adf8b=_0x3eba6e['length'];_0x2406cf<_0x2adf8b;_0x2406cf++){const _0x2a47ae=_0x3eba6e[_0x2406cf],_0x442682=this[_0x495d54(0xa72)](_0x2a47ae);!_0x442682&&logWarn('LodGraphicLayer:\x20数据的ID识别失败',_0x2a47ae);const _0x3a1206=this['_cacheGraphic'][_0x442682];if(_0x3a1206)_0x3a1206[_0x495d54(_0x54277c._0x592c43)][_0x495d54(0x6de)](_0x13112e),this[_0x495d54(_0x54277c._0x180244)](_0x3a1206,_0x2a47ae);else{const _0x22c031=this['createGraphic'](_0x48fab4,_0x2a47ae);if(!_0x22c031)continue;_0x22c031['gridList']=[_0x13112e],this['_cacheGraphic'][_0x442682]=_0x22c031,_0x33d20a[_0x495d54(0x6de)](_0x22c031);}_0x3fc04d['push'](_0x442682);}this[_0x495d54(_0x54277c._0x5c98c9)][_0x13112e]=this['_cacheGrid'][_0x13112e]||{},this[_0x495d54(0xe8)][_0x13112e][_0x495d54(0x5e5)]=_0x3fc04d,this[_0x495d54(_0x54277c._0x5c98c9)][_0x13112e]['isLoading']=![],this['fire'](EventType[_0x495d54(0x182)],{'graphics':_0x33d20a});}[_0x35a251(0x647)](_0xb4a75d){const _0x3d78c4={_0x3cfb3c:0x5e5,_0x215217:0x3cc,_0x28ca62:0x3cc,_0x3e6a0d:0xe1e},_0x491767=_0x35a251;if(this['_tileLayer']['isAllOutRange'](_0xb4a75d['level'])){this['clear']();return;}const _0x1aaf59=this[_0x491767(0xda5)](_0xb4a75d),_0x1727f1=this['_cacheGrid'][_0x1aaf59];if(_0x1727f1){if(_0x1727f1[_0x491767(_0x3d78c4._0x3cfb3c)])for(let _0x55dceb=0x0;_0x55dceb<_0x1727f1['ids']['length'];_0x55dceb++){const _0x3b7b35=_0x1727f1['ids'][_0x55dceb],_0x38b2fa=this['_cacheGraphic'][_0x3b7b35];if(!_0x38b2fa)continue;removeArrayItem(_0x38b2fa[_0x491767(_0x3d78c4._0x215217)],_0x1aaf59),_0x38b2fa[_0x491767(_0x3d78c4._0x28ca62)][_0x491767(_0x3d78c4._0x3e6a0d)]===0x0&&(this['removeGraphic'](_0x38b2fa),delete this['_cacheGraphic'][_0x3b7b35]);}delete this['_cacheGrid'][_0x1aaf59];}}['queryGridData'](_0x3f3a40){const _0x31d700=_0x35a251;if(this[_0x31d700(0xe86)]['queryGridData'])return this[_0x31d700(0xe86)]['queryGridData'](_0x3f3a40);}['createGraphic'](_0xf22cd3,_0x3b4581){const _0x4044b8=_0x35a251;if(this['options'][_0x4044b8(0x7bc)])return this['options']['createGraphic'](_0xf22cd3,_0x3b4581);return null;}[_0x35a251(0x80c)](_0x585869,_0x408485){this['options']['updateGraphic']&&this['options']['updateGraphic'](_0x585869,_0x408485);}[_0x35a251(0x386)](_0x450f89){const _0x28e17e=_0x35a251;super[_0x28e17e(0x386)](_0x450f89),this['_cacheGraphic']={},this['_cacheGrid']={};}[_0x35a251(0x70b)](){const _0x416999=_0x35a251;this['clear'](!![]),this[_0x416999(0xcc7)]&&this['_tileLayer']['reload']();}[_0x35a251(0xbfc)](_0x1f87ff,_0x41cbb4){super['_setOptionsHook'](_0x1f87ff,_0x41cbb4),this['clear'](!![]);if(this['_tileLayer']){const _0x331448={..._0x41cbb4,'private':!![]};delete _0x331448['id'],delete _0x331448['name'],delete _0x331448['url'],delete _0x331448['type'],this['_tileLayer']['setOptions'](_0x331448);}}['_toJsonEx'](_0x5058c8){}}register$2('lodGraphic',LodGraphicLayer);class GeodePoiLayer extends LodGraphicLayer{constructor(_0x42ca6b={}){const _0x328910={_0x413e6f:0x504,_0xa4cad1:0x981,_0x80fb5b:0x288},_0x350055=_0x35a251;super(_0x42ca6b),this['_key_index']=0x0,this['_keys']=this['options'][_0x350055(0xa03)]||gaodeArr,this['bindPopup'](function(_0x3746f3){const _0x3662d7=_0x350055;var _0x136c87;const _0x16815c=_0x3746f3===null||_0x3746f3===void 0x0?void 0x0:(_0x136c87=_0x3746f3['graphic'])===null||_0x136c87===void 0x0?void 0x0:_0x136c87['attr'];if(!_0x16815c)return;const _0x36c966='
名称:'+_0x16815c[_0x3662d7(_0x328910._0x413e6f)]+'
'+_0x3662d7(_0x328910._0xa4cad1)+_0x16815c['address']+''+_0x3662d7(_0x328910._0x80fb5b)+_0x16815c['pname']+_0x16815c['cityname']+_0x16815c['adname']+_0x3662d7(0xf95)+'
类别:'+_0x16815c[_0x3662d7(0x8ea)]+'
';return _0x36c966;},{'anchor':[0x0,-0xa]});}get[_0x35a251(0xa03)](){const _0x53cc79={_0x3dfb39:0xe1e},_0x514f35=_0x35a251,_0x5c9f1e=this[_0x514f35(0x887)]++%this['_keys'][_0x514f35(_0x53cc79._0x3dfb39)];return this['_keys'][_0x5c9f1e];}['queryGridData'](_0x54c45d){const _0xd58362={_0x519ded:0x5e2,_0xb76755:0xd7e,_0xce9a65:0xbe0,_0x1121a9:0xfab},_0x4daaa5=_0x35a251,_0x31787c=wgs2gcj([_0x54c45d[_0x4daaa5(0x1fa)][_0x4daaa5(_0xd58362._0x519ded)],_0x54c45d['extent'][_0x4daaa5(0xcea)]]),_0x1024ac=wgs2gcj([_0x54c45d['extent']['xmax'],_0x54c45d['extent']['ymin']]),_0x1f29f2=_0x31787c[0x0]+','+_0x31787c[0x1]+'|'+_0x1024ac[0x0]+','+_0x1024ac[0x1],_0x196478=this['options']['filter']||{};return _0x196478[_0x4daaa5(_0xd58362._0xb76755)]='json',_0x196478[_0x4daaa5(0xa03)]=this['key'],_0x196478['polygon']=_0x1f29f2,!_0x196478[_0x4daaa5(_0xd58362._0xce9a65)]&&(_0x196478['offset']=0x19),!_0x196478[_0x4daaa5(_0xd58362._0x1121a9)]&&(_0x196478['types']='120000|130000|190000'),new Promise((_0x2da821,_0x5b4e13)=>{const _0x56d7a2=_0x4daaa5;fetchJson({'url':'https://restapi.amap.com/v3/place/polygon',...this['options'],'queryParameters':_0x196478,'proxy':this[_0x56d7a2(0x6a3)]})['then'](_0x2d9ec9=>{const _0x3bcc29=_0x56d7a2;if(_0x2d9ec9['infocode']!=='10000'){logError$1('POI\x20请求失败',_0x2d9ec9),_0x54c45d[_0x3bcc29(0xb69)]=[],_0x2da821(_0x54c45d);return;}_0x54c45d[_0x3bcc29(0xb69)]=_0x2d9ec9[_0x3bcc29(0xdbc)],_0x2da821(_0x54c45d);});});}['createGraphic'](_0xde40f2,_0x1c3adb){const _0x22af7d={_0x41d4b5:0x682},_0x379fb4=_0x35a251;var _0x34863e;let _0x531736=_0x1c3adb['location']['split'](',');_0x531736=gcj2wgs(_0x531736);const _0x591606=getSymbolStyle(this['options']['symbol'],_0x1c3adb);_0x591606[_0x379fb4(0x979)]=_0x591606['clampToGround']??!![];let _0x25c0cd;return(_0x34863e=this['options']['clustering'])!==null&&_0x34863e!==void 0x0&&_0x34863e['enabled']?_0x591606['image']?_0x25c0cd=new BillboardEntity({'position':[_0x531736[0x0],_0x531736[0x1],this[_0x379fb4(0xe86)]['height']||0x0],'style':_0x591606,'attr':_0x1c3adb}):_0x25c0cd=new PointEntity({'position':[_0x531736[0x0],_0x531736[0x1],this[_0x379fb4(0xe86)][_0x379fb4(_0x22af7d._0x41d4b5)]||0x0],'style':_0x591606,'attr':_0x1c3adb}):_0x591606['image']?_0x25c0cd=new BillboardPrimitive({'position':[_0x531736[0x0],_0x531736[0x1],this['options']['height']||0x0],'style':_0x591606,'attr':_0x1c3adb}):_0x25c0cd=new PointPrimitive({'position':[_0x531736[0x0],_0x531736[0x1],this['options']['height']||0x0],'style':_0x591606,'attr':_0x1c3adb}),this['addGraphic'](_0x25c0cd),_0x25c0cd;}}register$2('gaodePOI',GeodePoiLayer);class WfsLayer extends LodGraphicLayer{[_0x35a251(0x700)](){const _0x1f1366={_0x9ad7a3:0x202,_0x1637bd:0xe86},_0xeb18cd=_0x35a251;this['options']['geometryName']=this['options'][_0xeb18cd(_0x1f1366._0x9ad7a3)]||_0xeb18cd(0x7fa),super['_mountedHook'](),Cesium__namespace['defaultValue'](this[_0xeb18cd(_0x1f1366._0x1637bd)]['getCapabilities'],!![])&&this['getMetadata'](),this['fire'](EventType['load']);}['getMetadata'](){const _0x411792={_0x39fabb:0x174,_0x3b1d7c:0x58d},_0x4e8b29={_0x435ca7:0x358,_0xcafb01:0x1ab},_0x3a59c3=_0x35a251,_0x30285b={'service':_0x3a59c3(_0x411792._0x39fabb),'request':_0x3a59c3(0x74e),'version':'1.0.0'};let _0x168b05=this[_0x3a59c3(0xe86)][_0x3a59c3(0xd05)];this['options']['templateValues']&&(_0x168b05=template(_0x168b05,this['options']['templateValues'])),Cesium__namespace[_0x3a59c3(_0x411792._0x3b1d7c)][_0x3a59c3(0x9e7)]({...this['options'],'url':_0x168b05,'queryParameters':_0x30285b,'proxy':this[_0x3a59c3(0x6a3)]})['then'](_0x920690=>{const _0x3658bd=_0x3a59c3;if(!_0x920690||this[_0x3658bd(_0x4e8b29._0x435ca7)])return;this[_0x3658bd(0xde8)]=_0x920690;try{this[_0x3658bd(_0x4e8b29._0xcafb01)](_0x920690);}catch(_0x233a8c){logInfo('解析GetCapabilities出错',_0x233a8c);}this['fire'](EventType['loadConfig'],{'capabilities':_0x920690});})['catch'](_0x14e199=>{const _0x51be94=_0x3a59c3;logInfo(_0x51be94(0x99a),_0x14e199);});}[_0x35a251(0x1ab)](_0x2014b8){const _0x3da9b1={_0x5e430f:0x59e,_0x3076c7:0x87,_0x1451a3:0xc86,_0x2bcfac:0xc86,_0x21d415:0x2cb,_0x255130:0xa6d,_0x34c8d2:0xcea,_0xc79ff3:0xab1,_0x24973c:0x5b2},_0x571f70=_0x35a251,_0x271577=this[_0x571f70(_0x3da9b1._0x5e430f)](_0x2014b8,'FeatureTypeList');if(!_0x271577)return;const _0x5b0c58=this[_0x571f70(0xa69)](_0x271577,'FeatureType');if(!_0x5b0c58)return;for(let _0x54a28e=0x0,_0x2edd5f=_0x5b0c58['length'];_0x54a28e<_0x2edd5f;_0x54a28e++){const _0x2ce241=_0x5b0c58[_0x54a28e],_0x356f6c=this['_readChildNodeVal'](_0x2ce241,'Name');if(_0x356f6c===this['options'][_0x571f70(_0x3da9b1._0x3076c7)]){const _0x4322c9=this['_readChildNodeVal'](_0x2ce241,'SRS');!this['options'][_0x571f70(0xa34)]&&_0x4322c9&&(this['options']['crs']=_0x4322c9);const _0x2d5a48=this['_readChildNode'](_0x2ce241,'LatLongBoundingBox');if(!this[_0x571f70(0xe86)]['rectangle']&&_0x2d5a48){const _0x43fa71=Number(_0x2d5a48['getAttribute']('minx')),_0x48ec27=Number(_0x2d5a48['getAttribute'](_0x571f70(0xd5d))),_0x57e78f=Number(_0x2d5a48[_0x571f70(_0x3da9b1._0x1451a3)]('maxx')),_0x19a1e0=Number(_0x2d5a48[_0x571f70(_0x3da9b1._0x2bcfac)]('maxy'));let _0x3f8764={'xmin':_0x43fa71,'ymin':_0x48ec27,'xmax':_0x57e78f,'ymax':_0x19a1e0};if(this[_0x571f70(0xe86)]['crs']!==CRS[_0x571f70(_0x3da9b1._0x21d415)]&&this['options']['crs']!==CRS['EPSG4490']){const _0x2f82a0=proj4Trans([_0x3f8764['xmin'],_0x3f8764['ymin']],this['options']['crs']),_0x45bad2=proj4Trans([_0x3f8764['xmax'],_0x3f8764['ymax']],this['options'][_0x571f70(0xa34)]);_0x3f8764={'xmin':_0x2f82a0[0x0],'ymin':_0x2f82a0[0x1],'xmax':_0x45bad2[0x0],'ymax':_0x45bad2[0x1]};}this['options'][_0x571f70(0x1fa)]=_0x3f8764,this['_rectangle']=Cesium__namespace['Rectangle'][_0x571f70(_0x3da9b1._0x255130)](_0x3f8764[_0x571f70(0x5e2)],_0x3f8764['ymin'],_0x3f8764['xmax'],_0x3f8764[_0x571f70(_0x3da9b1._0x34c8d2)]),this['_tileLayer']&&(this['_tileLayer'][_0x571f70(_0x3da9b1._0xc79ff3)]=this['_rectangle']),this[_0x571f70(0xe86)][_0x571f70(_0x3da9b1._0x24973c)]&&this['flyToByAnimationEnd']();}break;}}}[_0x35a251(0xa69)](_0x39c0f3,_0x55fc3c){const _0x143496={_0xe4dc08:0xe65},_0x1c8662=_0x35a251;if(!_0x39c0f3)return null;let _0x439511=_0x39c0f3[_0x1c8662(0x88c)](_0x55fc3c);return(!_0x439511||_0x439511[_0x1c8662(0xe1e)]===0x0)&&(_0x439511=_0x39c0f3[_0x1c8662(0x88c)](_0x1c8662(_0x143496._0xe4dc08)+_0x55fc3c)),_0x439511;}['_readChildNode'](_0x4c1ccc,_0x1b4f3c){if(!_0x4c1ccc)return null;const _0x45adac=this['_readNode'](_0x4c1ccc,_0x1b4f3c);return _0x45adac['length']>0x0?_0x45adac[0x0]:null;}['_readChildNodeVal'](_0xcbc7f5,_0x3c5ba9){const _0x4b13df={_0x484853:0x59e,_0x4b5e68:0xf4a,_0x5ef140:0xfa},_0x22c5f8=_0x35a251;var _0x242e48,_0xd0bd6;if(!_0xcbc7f5)return null;let _0x33ba2b=this[_0x22c5f8(_0x4b13df._0x484853)](_0xcbc7f5,_0x3c5ba9);!_0x33ba2b&&(_0x33ba2b=this['_readChildNode'](_0xcbc7f5,'wfs:'+_0x3c5ba9));if((_0x242e48=_0x33ba2b)!==null&&_0x242e48!==void 0x0&&_0x242e48[_0x22c5f8(0xf4a)])return _0x33ba2b[_0x22c5f8(_0x4b13df._0x4b5e68)];else return(_0xd0bd6=_0x33ba2b)!==null&&_0xd0bd6!==void 0x0&&_0xd0bd6['getInnerHTML']?_0x33ba2b[_0x22c5f8(_0x4b13df._0x5ef140)]():null;}['queryGridData'](_0x3a747c){const _0x3bf51e={_0xdc9885:0x1fa,_0x15d9f8:0x1fa,_0x54000a:0x1db,_0x207a02:0xe86,_0x2c91fe:0xe86,_0x359e94:0xe86,_0x77f4c5:0xe86},_0xae5bda=_0x35a251;let _0x44d6c8;if(this['options']['crs']!==CRS[_0xae5bda(0x2cb)]&&this[_0xae5bda(0xe86)]['crs']!==CRS['EPSG4490']){const _0x7b2f9d=proj4Trans([_0x3a747c['extent']['xmin'],_0x3a747c['extent']['ymin']],_0xae5bda(0x4fd),this[_0xae5bda(0xe86)]['crs']),_0x5bf287=proj4Trans([_0x3a747c[_0xae5bda(0x1fa)]['xmax'],_0x3a747c[_0xae5bda(_0x3bf51e._0xdc9885)]['ymax']],'EPSG:4326',this['options']['crs']);_0x44d6c8=_0x7b2f9d[0x0]+','+_0x7b2f9d[0x1]+','+_0x5bf287[0x0]+','+_0x5bf287[0x1];}else _0x44d6c8=_0x3a747c['extent']['xmin']+','+_0x3a747c[_0xae5bda(0x1fa)]['ymin']+','+_0x3a747c[_0xae5bda(_0x3bf51e._0x15d9f8)][_0xae5bda(_0x3bf51e._0x54000a)]+','+_0x3a747c['extent']['ymax'];const _0x446caf={'service':'WFS','request':'GetFeature','typeName':this['options']['layer']||this['options']['typeName'],'version':_0xae5bda(0x866),'outputFormat':'application/json','srsName':this[_0xae5bda(_0x3bf51e._0x207a02)]['crs']||_0xae5bda(0x4fd),'bbox':_0x44d6c8};if(Cesium__namespace[_0xae5bda(0xaa2)](this[_0xae5bda(_0x3bf51e._0x2c91fe)][_0xae5bda(0xf6a)]))for(const _0x547e13 in this['options']['parameters']){_0x547e13['toLowerCase']()==='cql_filter'?(delete _0x446caf['bbox'],_0x446caf[_0x547e13]=this[_0xae5bda(0xe86)]['parameters'][_0x547e13]+'\x20and\x20BBOX('+this[_0xae5bda(_0x3bf51e._0x359e94)][_0xae5bda(0x202)]+',\x20'+_0x44d6c8+')'):_0x446caf[_0x547e13]=this[_0xae5bda(_0x3bf51e._0x77f4c5)]['parameters'][_0x547e13];}let _0x2295b0=this[_0xae5bda(0xe86)]['url'];return this['options']['templateValues']&&(_0x2295b0=template(_0x2295b0,this['options']['templateValues'])),new Promise((_0x52b944,_0x3d9229)=>{const _0x566f28={_0xb2dd35:0x8ea,_0x5d7ec4:0x98f,_0xf627c4:0xf47};fetchJson({...this['options'],'url':_0x2295b0,'queryParameters':_0x446caf,'proxy':this['_proxy']})['then'](_0x581b69=>{const _0x32cee4=_0x2767;_0x3a747c['list']=[];if(!this['_show']||!this['_cacheGrid'][_0x3a747c['key']]){_0x52b944(_0x3a747c);return;}if(_0x581b69===undefined||_0x581b69==null){_0x52b944(_0x3a747c);return;}_0x581b69[_0x32cee4(_0x566f28._0xb2dd35)]===_0x32cee4(_0x566f28._0x5d7ec4)&&(_0x581b69={'type':_0x32cee4(_0x566f28._0xf627c4),'features':[_0x581b69]}),_0x3a747c['list']=_0x581b69['features'],_0x52b944(_0x3a747c);})['catch'](_0x3a8935=>{logError$1('wfs请求GetFeature出错',_0x3a8935);});});}['createGraphic'](_0x441f69,_0x483a23){const _0x2fd987=_0x35a251,_0x14b72d=this['loadGeoJSON'](_0x483a23,{'clear':![],'flyTo':![]});return(_0x14b72d===null||_0x14b72d===void 0x0?void 0x0:_0x14b72d[_0x2fd987(0xe1e)])>0x0?_0x14b72d[0x0]:null;}}register$2(_0x35a251(0xb03),WfsLayer);class ArcGisWfsLayer extends LodGraphicLayer{['_mountedHook'](){super['_mountedHook'](),this['getMetadata']();}['getMetadata'](){const _0x228e93={_0x376386:0x658,_0x2ba4be:0xe1e,_0x301404:0x6a3,_0x1676bd:0xeb7},_0x373e48={_0x3bf10d:0xe4},_0x1ea64f=_0x35a251;let _0x33649a=this['options']['url'];this['options'][_0x1ea64f(_0x228e93._0x376386)]&&this['options']['layers'][_0x1ea64f(_0x228e93._0x2ba4be)]>0x0&&(_0x33649a+='/'+this['options']['layers'][0x0]);const _0x58465e={'f':'json'};this['options']['token']&&(_0x58465e['token']=this[_0x1ea64f(0xe86)][_0x1ea64f(0xe2f)]),sendAjax({...this['options'],'url':_0x33649a,'queryParameters':_0x58465e,'proxy':this[_0x1ea64f(_0x228e93._0x301404)]})[_0x1ea64f(0x86c)](_0x2e10de=>{if(!_0x2e10de||this['isDestroy'])return;this['_initByMetaData'](_0x2e10de),this['fire'](EventType['loadConfig'],_0x2e10de);})[_0x1ea64f(_0x228e93._0x1676bd)](_0x2fe52f=>{const _0x35d3db=_0x1ea64f;logInfo(_0x35d3db(_0x373e48._0x3bf10d),_0x2fe52f);});}['_initByMetaData'](_0x5617ba){const _0x2c3029={_0x8cd50f:0xe86,_0x365315:0xc02,_0x2bfd48:0xd6,_0x19a195:0xcc7},_0x4a5371=_0x35a251;this['metaData']=_0x5617ba;let _0x50b4a5=_0x5617ba[_0x4a5371(0xdec)]||_0x5617ba['extent'];if(!this[_0x4a5371(_0x2c3029._0x8cd50f)]['rectangle']&&_0x50b4a5){var _0x4c6a6b,_0x2cde28;const _0x484ad9=((_0x4c6a6b=_0x50b4a5)===null||_0x4c6a6b===void 0x0?void 0x0:(_0x2cde28=_0x4c6a6b['spatialReference'])===null||_0x2cde28===void 0x0?void 0x0:_0x2cde28['wkid'])||this[_0x4a5371(0xe86)]['wkid'];_0x484ad9&&(!this['options'][_0x4a5371(0x13c)]&&(this[_0x4a5371(0xe86)]['wkid']=_0x484ad9));if(this['options'][_0x4a5371(0x13c)]){const _0x5c9525='EPSG:'+this['options'][_0x4a5371(0x13c)];if(_0x5c9525!==CRS[_0x4a5371(0x2cb)]&&_0x5c9525!==CRS['EPSG4490']){const _0x701785=proj4Trans([_0x50b4a5[_0x4a5371(0x5e2)],_0x50b4a5['ymin']],_0x5c9525),_0x5ca31f=proj4Trans([_0x50b4a5['xmax'],_0x50b4a5['ymax']],_0x5c9525);_0x50b4a5={'xmin':_0x701785[0x0],'ymin':_0x701785[0x1],'xmax':_0x5ca31f[0x0],'ymax':_0x5ca31f[0x1]};}this['options']['extent']=_0x50b4a5,this[_0x4a5371(_0x2c3029._0x365315)]=Cesium__namespace[_0x4a5371(_0x2c3029._0x2bfd48)]['fromDegrees'](_0x50b4a5['xmin'],_0x50b4a5['ymin'],_0x50b4a5['xmax'],_0x50b4a5[_0x4a5371(0xcea)]),this[_0x4a5371(_0x2c3029._0x19a195)]&&(this['_tileLayer'][_0x4a5371(0xab1)]=this[_0x4a5371(_0x2c3029._0x365315)]),this['options']['flyTo']&&this['flyToByAnimationEnd']();}}}['queryGridData'](_0x3569cd){const _0x3c956a={_0xc132da:0xe86,_0x14bca:0x658,_0x449a61:0x1e6,_0x4c108a:0xe86},_0x2cf662=_0x35a251;let _0x2bb81d=this['options']['url'];this['options']['layers']&&this[_0x2cf662(_0x3c956a._0xc132da)]['layers']['length']>0x0&&(_0x2bb81d+='/'+this['options'][_0x2cf662(_0x3c956a._0x14bca)][0x0]);const _0x19c345={'f':this['options']['f']||'json','inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':this['options']['where']||'1=1','geometry':JSON[_0x2cf662(_0x3c956a._0x449a61)]({'xmin':_0x3569cd['extent']['xmin'],'ymin':_0x3569cd['extent']['ymin'],'xmax':_0x3569cd['extent'][_0x2cf662(0x1db)],'ymax':_0x3569cd['extent']['ymax'],'spatialReference':{'wkid':0x10e6}}),'geometryType':_0x2cf662(0xcd),'spatialRel':'esriSpatialRelIntersects'};return this[_0x2cf662(_0x3c956a._0x4c108a)]['token']&&(_0x19c345['token']=this['options']['token']),new Promise((_0x59eaef,_0x83ccf9)=>{sendAjax({...this['options'],'url':_0x2bb81d+'/query','queryParameters':_0x19c345,'proxy':this['_proxy']})['then'](_0xfa3654=>{const _0x25392a=_0x2767;_0x3569cd['list']=[];if(!this['show']||!this['_cacheGrid'][_0x3569cd['key']]){_0x59eaef(_0x3569cd);return;}if(_0xfa3654===undefined||_0xfa3654==null){_0x59eaef(_0x3569cd);return;}let _0x19260e=arcgisToGeoJSON$1(_0xfa3654);_0x19260e['type']==='Feature'&&(_0x19260e={'type':_0x25392a(0xf47),'features':[_0x19260e]}),_0x3569cd[_0x25392a(0xb69)]=_0x19260e[_0x25392a(0x830)],_0x59eaef(_0x3569cd);})['catch'](_0x2351ff=>{logError$1('wfs请求出错',_0x2351ff);});});}['_getItemDataId'](_0xc0f3e6){const _0x2b7523={_0x9a165b:0x7d9,_0x5d83f6:0xe1e,_0x24dc19:0x7d3},_0x330215=_0x35a251;var _0x1c3170,_0x4b630e;if(_0xc0f3e6['id'])return _0xc0f3e6['id'];_0xc0f3e6['type']==='Feature'&&(_0xc0f3e6=_0xc0f3e6[_0x330215(_0x2b7523._0x9a165b)]);if(_0xc0f3e6[this['options']['IdField']])return _0xc0f3e6[this[_0x330215(0xe86)]['IdField']];if(_0xc0f3e6['OBJECTID'])return _0xc0f3e6['OBJECTID'];if(_0xc0f3e6['objectid'])return _0xc0f3e6['objectid'];if(((_0x1c3170=this['metaData'])===null||_0x1c3170===void 0x0?void 0x0:(_0x4b630e=_0x1c3170['fields'])===null||_0x4b630e===void 0x0?void 0x0:_0x4b630e[_0x330215(_0x2b7523._0x5d83f6)])>0x0){const _0x1b354d=this[_0x330215(0x56e)][_0x330215(_0x2b7523._0x24dc19)][0x0][_0x330215(0x504)];if(_0xc0f3e6[_0x1b354d])return _0xc0f3e6[_0x1b354d];}return null;}['createGraphic'](_0x5758c3,_0x144427){const _0x29de34={_0x531de6:0xe86,_0x505c01:0x336},_0x3f307a=_0x35a251;if(this[_0x3f307a(_0x29de34._0x531de6)]['createGraphic'])return this['options']['createGraphic'](_0x5758c3,_0x144427);const _0x38e2e7=this[_0x3f307a(_0x29de34._0x505c01)](_0x144427,{'clear':![],'flyTo':![]});return(_0x38e2e7===null||_0x38e2e7===void 0x0?void 0x0:_0x38e2e7['length'])>0x0?_0x38e2e7[0x0]:null;}[_0x35a251(0xe42)](_0xe92c1){this['options']['where']=_0xe92c1,this['reload']();}}register$2(_0x35a251(0x312),ArcGisWfsLayer);class ArcGisWfsSingleLayer extends GeoJsonLayer{['load'](_0x312b96={}){const _0x11e609={_0x22a6fd:0xe86},_0x166de1={_0x4eb22a:0x264},_0x4457ef=_0x35a251;this[_0x4457ef(_0x11e609._0x22a6fd)]={...this['options'],..._0x312b96};let _0x24fb46=this['options']['url'];this['options']['layers']&&this['options']['layers']['length']>0x0&&(_0x24fb46+='/'+this[_0x4457ef(0xe86)]['layers'][0x0]);const _0x2b3983={'f':'json','inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':this['options']['where']||'1=1'};this[_0x4457ef(0xe86)]['token']&&(_0x2b3983[_0x4457ef(0xe2f)]=this['options']['token']),fetchJson({...this['options'],'url':_0x24fb46+_0x4457ef(0x6d7),'queryParameters':_0x2b3983,'proxy':this['_proxy']})['then'](_0xb41fc5=>{const _0x5ec51e=_0x4457ef;if(!_0xb41fc5){this[_0x5ec51e(_0x166de1._0x4eb22a)](EventType[_0x5ec51e(0x64a)]);return;}const _0x74f9ae=arcgisToGeoJSON$1(_0xb41fc5);this[_0x5ec51e(0x486)](_0x74f9ae);})['catch'](_0x52e550=>{logError$1('wfs请求出错',_0x52e550);});}['setWhere'](_0xb9b45c){this['load']({'where':_0xb9b45c});}}register$2('arcgis_wfs_single',ArcGisWfsSingleLayer);var index$4={'__proto__':null,'BaseLayer':BaseLayer,'GroupLayer':GroupLayer,'BaseTileLayer':BaseTileLayer,'BaseGraphicLayer':BaseGraphicLayer,'TerrainLayer':TerrainLayer,'ArcGisCacheLayer':ArcGisCacheLayer,'ArcGisTileLayer':ArcGisTileLayer,'ArcGisLayer':ArcGisLayer,'BaiduLayer':BaiduLayer,'BingLayer':BingLayer,'GaodeLayer':GaodeLayer,'GeeLayer':GeeLayer,'GoogleLayer':GoogleLayer,'ImageLayer':ImageLayer,'IonLayer':IonLayer,'MapboxLayer':MapboxLayer,'OsmLayer':OsmLayer,'TdtLayer':TdtLayer,'TencentLayer':TencentLayer,'TmsLayer':TmsLayer,'WmsLayer':WmsLayer,'WmtsLayer':WmtsLayer,'XyzLayer':XyzLayer,'GridLayer':GridLayer,'TileInfoLayer':TileInfoLayer,'EmptyTileLayer':EmptyTileLayer,'CzmGeoJsonLayer':CzmGeoJsonLayer,'KmlLayer':KmlLayer,'CzmlLayer':CzmlLayer,'GraphicLayer':GraphicLayer,'GraphicGroupLayer':GraphicGroupLayer,'GeoJsonLayer':GeoJsonLayer,'BusineDataLayer':BusineDataLayer,'TilesetLayer':TilesetLayer,'OsmBuildingsLayer':OsmBuildingsLayer,'I3SLayer':I3SLayer,'GraticuleLayer':GraticuleLayer,'LodGraphicLayer':LodGraphicLayer,'GeodePoiLayer':GeodePoiLayer,'WfsLayer':WfsLayer,'ArcGisWfsLayer':ArcGisWfsLayer,'ArcGisWfsSingleLayer':ArcGisWfsSingleLayer,'register':register$2,'create':create$2,'createTerrainProvider':createTerrainProvider,'createImageryProvider':createImageryProvider$k};class Underground extends BaseThing{get['translucency'](){const _0x57f54a=_0x35a251;return this[_0x57f54a(0xd79)][_0x57f54a(0xc60)]['globe']['translucency'];}get['alpha'](){const _0x96f070=_0x35a251;return this[_0x96f070(0xcaa)];}set[_0x35a251(0x1f4)](_0x1d29f2){const _0x2dfcd6={_0x1ce2d2:0xcaa},_0x44a017=_0x35a251;this[_0x44a017(_0x2dfcd6._0x1ce2d2)]=_0x1d29f2;if(!this['_map'])return;this['translucency'][_0x44a017(0x2ae)]=this['_alpha'];}get['color'](){const _0x5906f8={_0x63df1c:0xc60,_0x106b83:0x8bd},_0x526ca0=_0x35a251;return this['_map'][_0x526ca0(_0x5906f8._0x63df1c)]['globe'][_0x526ca0(_0x5906f8._0x106b83)];}set['color'](_0x5a1b37){const _0x5dcd29=_0x35a251;this[_0x5dcd29(0xd79)]['scene']['globe']['undergroundColor']=_0x5a1b37;}get['colorAlphaByDistance'](){return this['_map']['scene']['globe']['undergroundColorAlphaByDistance'];}set['colorAlphaByDistance'](_0x58520f){this['_map']['scene']['globe']['undergroundColorAlphaByDistance']=_0x58520f;}['_enabledHook'](_0x323e26){const _0x4c09dc=_0x35a251;if(!this['_map'])return;this['_map']['scene'][_0x4c09dc(0x22f)][_0x4c09dc(0x895)]=_0x323e26?!![]:this['depthTestOld'],this['_map'][_0x4c09dc(0xc60)][_0x4c09dc(0xbbb)][_0x4c09dc(0x90d)]=!_0x323e26,this['translucency']['enabled']=_0x323e26;}['_mountedHook'](){const _0x1742cc={_0x17134e:0x9db,_0x50be6e:0xf29},_0x3feb5d=_0x35a251;this['translucency'][_0x3feb5d(0x2ae)]=0x1,this['translucency']['backFaceAlpha']=0x0,this['alpha']=this['options']['alpha']??0.5,this[_0x3feb5d(_0x1742cc._0x17134e)]=this['options']['color']??Cesium__namespace[_0x3feb5d(_0x1742cc._0x50be6e)][_0x3feb5d(0x2d1)];}['_addedHook'](){const _0x3cde2f={_0x289186:0x3ab,_0x4a607b:0xd79,_0x22f2e6:0x22f},_0x1810e3=_0x35a251;this[_0x1810e3(_0x3cde2f._0x289186)]=Cesium__namespace['clone'](this[_0x1810e3(_0x3cde2f._0x4a607b)][_0x1810e3(0xc60)][_0x1810e3(_0x3cde2f._0x22f2e6)]['depthTestAgainstTerrain']),this[_0x1810e3(0xefe)](this['enabled']);}['_removedHook'](){const _0x10d812={_0x3aa7a1:0xd79},_0x5dbb05=_0x35a251;this[_0x5dbb05(_0x10d812._0x3aa7a1)]['scene']['globe']['depthTestAgainstTerrain']=this['depthTestOld'],this['_enabledHook'](![]);}}class Sightline extends BaseThing{constructor(_0x540b27={}){const _0x298de0={_0x422c76:0x879},_0xb0e40d=_0x35a251;super(_0x540b27),this[_0xb0e40d(_0x298de0._0x422c76)]=_0x540b27['visibleColor']??new Cesium__namespace['Color'](0x0,0x1,0x0,0.5),this['_hiddenColor']=_0x540b27['hiddenColor']??new Cesium__namespace['Color'](0x1,0x0,0x0,0.5),this['_depthFailColor']=_0x540b27['depthFailColor'],this['lines']=[];}get[_0x35a251(0x96c)](){return this['_visibleColor'];}set['visibleColor'](_0x511326){this['_visibleColor']=_0x511326;}get['hiddenColor'](){return this['_hiddenColor'];}set[_0x35a251(0xbb2)](_0xad6777){const _0x3d6b2e=_0x35a251;this[_0x3d6b2e(0x611)]=_0xad6777;}get['depthFailColor'](){const _0x3e5fee=_0x35a251;return this[_0x3e5fee(0x27a)];}set['depthFailColor'](_0x25bd20){this['_depthFailColor']=_0x25bd20;}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){}[_0x35a251(0x4af)](_0x3216d7,_0x89e6e5,_0x294da0={}){const _0x226dc1={_0x123e2a:0xc60,_0x4c8b35:0x22f,_0x5fcad7:0x8eb,_0x563732:0x8eb,_0x4f7e5c:0xaa2,_0x455b61:0x8e4},_0x477141=_0x35a251;_0x294da0['offsetHeight']&&(_0x3216d7=addPositionsHeight(_0x3216d7,_0x294da0['offsetHeight']));this[_0x477141(0x264)](EventType['start']);!this['_map'][_0x477141(_0x226dc1._0x123e2a)][_0x477141(_0x226dc1._0x4c8b35)]['depthTestAgainstTerrain']&&(this['_map']['scene']['globe'][_0x477141(0x895)]=!![],this['old_depthTestAgainstTerrain']=this['_map']['scene'][_0x477141(_0x226dc1._0x4c8b35)]['depthTestAgainstTerrain']);this[_0x477141(0xd79)]['scene']['requestRender']();const _0x215ff5=Cesium__namespace[_0x477141(0x8eb)]['normalize'](Cesium__namespace[_0x477141(_0x226dc1._0x5fcad7)]['subtract'](_0x89e6e5,_0x3216d7,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x477141(_0x226dc1._0x563732))]()),_0x6cecb9=new Cesium__namespace[(_0x477141(0xd31))](_0x3216d7,_0x215ff5),_0x25a5b3=this['_map']['scene']['drillPickFromRay'](_0x6cecb9,0x2,this['lines']);if(Cesium__namespace['defined'](_0x25a5b3)&&_0x25a5b3['length']>0x0&&Cesium__namespace[_0x477141(0xaa2)](_0x25a5b3[0x0])&&Cesium__namespace[_0x477141(_0x226dc1._0x4f7e5c)](_0x25a5b3[0x0]['position'])){const _0x408987=_0x25a5b3[0x0]['position'],_0x31caea=Cesium__namespace['Cartesian3']['distance'](_0x3216d7,_0x89e6e5),_0x17718b=Cesium__namespace['Cartesian3'][_0x477141(0xeed)](_0x3216d7,_0x408987);if(_0x17718b<_0x31caea){const _0x115b5a=this[_0x477141(_0x226dc1._0x455b61)](_0x3216d7,_0x89e6e5,_0x408987),_0x5139c2={'block':!![],'position':_0x408987,'entity':_0x115b5a};return this['fire'](EventType['end'],_0x5139c2),_0x5139c2;}}const _0x175988=this['_showPolyline'](_0x3216d7,_0x89e6e5),_0x1dab44={'block':![],'entity':_0x175988};return Cesium__namespace['defined'](this['old_depthTestAgainstTerrain'])&&(this['_map']['scene']['globe']['depthTestAgainstTerrain']=this['old_depthTestAgainstTerrain'],delete this['old_depthTestAgainstTerrain']),this['fire'](EventType['end'],_0x1dab44),_0x1dab44;}[_0x35a251(0xc10)](_0x4c75aa,_0x464009,_0x44abc4={}){const _0x4b56c5={_0x31b313:0x264},_0x6538b0={_0x48ccae:0x9b1},_0x3457fd=_0x35a251;_0x44abc4['offsetHeight']&&(_0x4c75aa=addPositionsHeight(_0x4c75aa,_0x44abc4['offsetHeight']));const _0x4469dc=interLine([_0x4c75aa,_0x464009],{'splitNum':_0x44abc4['splitNum']||0x32,'minDistance':_0x44abc4['minDistance']});return this[_0x3457fd(_0x4b56c5._0x31b313)](EventType['start']),new Promise((_0x52f02d,_0x50b1d7)=>{computeSurfacePoints({'map':this['_map'],'positions':_0x4469dc})['then'](_0x29fc19=>{const _0x1aa2b0=_0x2767;if(!_0x29fc19['noHeight'])for(let _0x44211e=0x0;_0x44211e<_0x4469dc['length'];_0x44211e++){const _0x3f68a2=_0x4469dc[_0x44211e],_0x4d18fb=Cesium__namespace['Cartographic'][_0x1aa2b0(_0x6538b0._0x48ccae)](_0x3f68a2)['height'],_0x5f0de6=Cesium__namespace['Cartographic']['fromCartesian'](_0x29fc19['positions'][_0x44211e])['height'];if(_0x4d18fb<=_0x5f0de6){const _0x4eb529=this['_showPolyline'](_0x4c75aa,_0x464009,_0x3f68a2),_0x2c58a9={'block':!![],'position':_0x3f68a2,'entity':_0x4eb529};this['fire'](EventType['end'],_0x2c58a9),_0x52f02d(_0x2c58a9);return;}}const _0x2d580b=this['_showPolyline'](_0x4c75aa,_0x464009),_0x5ad08e={'block':![],'entity':_0x2d580b};this['fire'](EventType['end'],_0x5ad08e),_0x52f02d(_0x5ad08e);});});}['_showPolyline'](_0x45d0bc,_0x1cf80a,_0x134927){const _0x15c8b1={_0x1f3189:0xd79,_0x3ab1a7:0x27a,_0x5d2b52:0x6de},_0x42ce77=_0x35a251;if(_0x134927){const _0x3ccc50=this[_0x42ce77(_0x15c8b1._0x1f3189)]['entities']['add'](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x45d0bc,_0x134927],'width':0x2,'material':this['_visibleColor'],'depthFailMaterial':this[_0x42ce77(_0x15c8b1._0x3ab1a7)]}}));this['lines']['push'](_0x3ccc50);const _0x4bb4eb=this['_map']['entities']['add'](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x134927,_0x1cf80a],'width':0x2,'material':this['_hiddenColor'],'depthFailMaterial':this['_depthFailColor']}}));return this['lines']['push'](_0x4bb4eb),[_0x3ccc50,_0x4bb4eb];}else{const _0x202511=this['_map']['entities']['add'](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x45d0bc,_0x1cf80a],'width':0x2,'material':this['_visibleColor'],'depthFailMaterial':this['_depthFailColor']}}));return this['lines'][_0x42ce77(_0x15c8b1._0x5d2b52)](_0x202511),[_0x202511];}}[_0x35a251(0x386)](){const _0x37f3fc={_0x2a55a4:0x860,_0x4097a8:0xe1e},_0x1dd798=_0x35a251;for(let _0x349d1a=0x0,_0x15f8e6=this[_0x1dd798(_0x37f3fc._0x2a55a4)][_0x1dd798(_0x37f3fc._0x4097a8)];_0x349d1a<_0x15f8e6;_0x349d1a++){this['_map']['entities']['remove'](this['lines'][_0x349d1a]);}this['lines']=[];}}var fragmentShaderSource$1='#extension\x20GL_OES_standard_derivatives\x20:\x20enable\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0auniform\x20float\x20lineWidth;\x0auniform\x20float\x20height;\x0auniform\x20bvec3\x20strokeType;\x0auniform\x20vec3\x20tjxColor;\x0auniform\x20vec3\x20bjColor;\x0auniform\x20vec3\x20cameraPos;\x0auniform\x20float\x20mbDis;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0abool\x20isTJX(vec2\x20uv,\x20float\x20lw)\x20{\x0a\x20\x20vec2\x20pixelSize\x20=\x20lw\x20/\x20czm_viewport.zw;\x0a\x20\x20float\x20dx0\x20=\x20-pixelSize.x;\x0a\x20\x20float\x20dy0\x20=\x20-pixelSize.y;\x0a\x20\x20float\x20dx1\x20=\x20pixelSize.x;\x0a\x20\x20float\x20dy1\x20=\x20pixelSize.y;\x0a\x0a\x20\x20vec2\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x20dy0);\x0a\x20\x20vec4\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20float\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(0.0,\x20dy0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x20dy0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x200.0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x200.0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(0.0,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20return\x20false;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20if(height\x20>\x2014102.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20dx\x20=\x20dFdx(positionEC.xyz);\x0a\x20\x20vec3\x20dy\x20=\x20dFdy(positionEC.xyz);\x0a\x20\x20vec3\x20normal\x20=\x20normalize(cross(dx,\x20dy));\x0a\x0a\x20\x20if(strokeType.y\x20||\x20strokeType.z)\x20{\x0a\x20\x20\x20\x20vec4\x20wp\x20=\x20czm_inverseView\x20*\x20positionEC;\x0a\x20\x20\x20\x20if(distance(wp.xyz,\x20cameraPos)\x20>\x20mbDis)\x20{\x0a\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20float\x20dotNum\x20=\x20abs(dot(normal,\x20normalize(positionEC.xyz)));\x0a\x20\x20\x20\x20\x20\x20if(dotNum\x20<\x200.05)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(bjColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20if(strokeType.x\x20||\x20strokeType.z)\x20{\x0a\x20\x20\x20\x20bool\x20tjx\x20=\x20isTJX(v_textureCoordinates,\x20lineWidth);\x0a\x20\x20\x20\x20if(tjx)\x20{\x0a\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(tjxColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20out_FragColor\x20=\x20color;\x0a}\x0a';class Skyline extends BaseThing{constructor(_0x3f95b3={}){const _0x2bd6dc=_0x35a251;super(_0x3f95b3),this[_0x2bd6dc(0x9db)]=_0x3f95b3['color']??new Cesium__namespace[(_0x2bd6dc(0xf29))](0x1,0x0,0x0),this['width']=_0x3f95b3['width']??0x2,this[_0x2bd6dc(0x2b2)]=_0x3f95b3['strokeType']??new Cesium__namespace['Cartesian3'](!![],![],![]),this[_0x2bd6dc(0xcf7)]=_0x3f95b3['bjColor']??new Cesium__namespace[(_0x2bd6dc(0xf29))](0x0,0x0,0x1),this['distance']=_0x3f95b3['distance']??0x1f4;}['_enabledHook'](_0x5636fd){_0x5636fd?!this['postProcessStage']&&this['_addedHook']():this['postProcessStage']&&this['_removedHook']();}[_0x35a251(0x97b)](){const _0x246b78={_0x217e74:0xd79},_0x53b642=_0x35a251,_0xfa11d9=this[_0x53b642(_0x246b78._0x217e74)]['camera'];this[_0x53b642(0xb9b)]=new Cesium__namespace['PostProcessStage']({'fragmentShader':fragmentShaderSource$1,'uniforms':{'height':()=>{return _0xfa11d9['positionCartographic']['height'];},'lineWidth':()=>{return this['width'];},'strokeType':()=>{return this['strokeType'];},'tjxColor':()=>{const _0x2de3e8=_0x53b642;return this[_0x2de3e8(0x9db)];},'bjColor':()=>{const _0x2883a5=_0x53b642;return this[_0x2883a5(0xcf7)];},'cameraPos':()=>{return _0xfa11d9['position'];},'mbDis':()=>{return this['distance'];}}}),this['_map']['scene']['postProcessStages']['add'](this['postProcessStage']);}['_removedHook'](){const _0x2b6336=_0x35a251;this[_0x2b6336(0xb9b)]&&(this['_map']['scene']['postProcessStages']['remove'](this['postProcessStage']),this['postProcessStage']['destroy'](),delete this['postProcessStage']);}}class SkylineBody extends BaseThing{constructor(_0x12262a={}){const _0x50fb14={_0x38fd47:0xf48,_0x52872b:0x2b2,_0x428c84:0x8eb,_0x253044:0xf29},_0x59dc64=_0x35a251;super(_0x12262a),this['color']=_0x12262a[_0x59dc64(0x9db)]??new Cesium__namespace['Color'](0x1,0x0,0x0),this[_0x59dc64(_0x50fb14._0x38fd47)]=_0x12262a['width']??0x2,this[_0x59dc64(0x2b2)]=_0x12262a[_0x59dc64(_0x50fb14._0x52872b)]??new Cesium__namespace[(_0x59dc64(_0x50fb14._0x428c84))](!![],![],![]),this[_0x59dc64(0xcf7)]=_0x12262a['bjColor']??new Cesium__namespace[(_0x59dc64(_0x50fb14._0x253044))](0x0,0x0,0x1),this[_0x59dc64(0xeed)]=_0x12262a[_0x59dc64(0xeed)]??0x1f4;}['_enabledHook'](_0x35fafe){const _0x28ce9e={_0x510fd8:0x97b},_0x11a0fa=_0x35a251;_0x35fafe?!this['postProcessStage']&&this[_0x11a0fa(_0x28ce9e._0x510fd8)]():this['postProcessStage']&&this[_0x11a0fa(0xa9a)]();}['_mountedHook'](){const _0x1aea97={_0x308104:0x3e1},_0x17e574=_0x35a251;this[_0x17e574(_0x1aea97._0x308104)]=new GraphicLayer({'name':'天际线分析','private':!![]});}['_addedHook'](){const _0x32d084={_0x546676:0x3e1},_0x59c3f6=_0x35a251;this['_map']['addLayer'](this['graphicLayer']);const _0xe44b94=this['_map'][_0x59c3f6(0xc60)],_0x3f2218=0x200,_0x3abea3=new Cesium__namespace['Picking'](_0xe44b94),_0x47c593=getRayIntersectingPositions(_0xe44b94,_0x3abea3,_0x3f2218),_0x38645d=_0xe44b94['camera'][_0x59c3f6(0xb61)],_0xb8e3af=[_0x38645d];for(let _0x7ecab9=_0x3f2218-0x1;_0x7ecab9>=0x0;_0x7ecab9--){for(let _0x1755e4=_0x3f2218-0x1;_0x1755e4>=0x0;_0x1755e4--){const _0x5cee6d=_0x47c593[_0x7ecab9][_0x1755e4];if(_0x5cee6d){_0xb8e3af['push'](_0x5cee6d);break;}}}_0xb8e3af['push'](_0x38645d);const _0x510a9e=new PolygonPrimitive({'positions':_0xb8e3af,'style':{'color':'#007be6','opacity':0.5,'outline':![],'extrudedHeight':0x0,...this[_0x59c3f6(0xe86)][_0x59c3f6(0xfc8)]||{},'perPositionHeight':!![]}});this[_0x59c3f6(_0x32d084._0x546676)][_0x59c3f6(0x8b5)](_0x510a9e),this['_graphic']=_0x510a9e;}['_removedHook'](){this['_map']['removeLayer'](this['graphicLayer']);}[_0x35a251(0xa63)](_0x363841){const _0x4a7794=_0x35a251;this['graphicLayer']&&this[_0x4a7794(0x3e1)][_0x4a7794(0xa63)](_0x363841),super['destroy'](_0x363841);}}const fragmentShaderSource='\x0a\x20\x20\x20\x20precision\x20highp\x20float;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20u_positionTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20shadowMap_texture;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20vec4\x20getPositionEC(vec2\x20uv)\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20vec4\x20positionEC\x20=\x20\x20texture(u_positionTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20return\x20vec4(positionEC.xyz,\x201.0);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20void\x20main()\x20{\x0a\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20float\x20maxDepth\x20=\x20shadowMap_cascadeSplits[1].w;\x0a\x20\x20\x20\x20\x20\x20vec4\x20positionEC\x20=\x20getPositionEC(uv);\x0a\x20\x20\x20\x20\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20\x20\x20\x20\x20float\x20depth\x20=\x20-positionEC.z;\x0a\x0a\x20\x20\x20\x20\x20\x20if\x20(depth\x20>\x20maxDepth){\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20weights\x20=\x20czm_cascadeWeights(depth);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20shadowPosition\x20=\x20czm_cascadeMatrix(weights)\x20*\x20positionEC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20deptha\x20=\x20czm_unpackDepth(texture(shadowMap_texture,\x20shadowPosition.xy));\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(step(shadowPosition.z,deptha),\x200.0,\x201.0,\x202.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=\x20vec4(uv,\x201.0,\x202.0);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20',vertexShaderSource=_0x35a251(0x725),texturePositions=new Float32Array([-0x1,-0x1,0x1,-0x1,0x1,0x1,-0x1,0x1]),textureUVs=new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]),textureIndices=new Uint16Array([0x0,0x1,0x2,0x0,0x2,0x3]);function createTextureVA(_0x1fb203){const _0x48abd0={_0x12f9a7:0x51e,_0x4e7de0:0x51e,_0x2208d4:0x1e5},_0x4a8587=_0x35a251,_0x29f764=Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x1fb203,'typedArray':texturePositions,'usage':Cesium__namespace[_0x4a8587(0x256)][_0x4a8587(_0x48abd0._0x12f9a7)]}),_0x4f9982=Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x1fb203,'typedArray':textureUVs,'usage':Cesium__namespace['BufferUsage'][_0x4a8587(_0x48abd0._0x4e7de0)]}),_0x5474ff=Cesium__namespace['Buffer'][_0x4a8587(_0x48abd0._0x2208d4)]({'context':_0x1fb203,'typedArray':textureIndices,'usage':Cesium__namespace['BufferUsage'][_0x4a8587(0x51e)],'indexDatatype':Cesium__namespace[_0x4a8587(0xd44)]['UNSIGNED_SHORT']}),_0x5c769d=[{'index':0x0,'vertexBuffer':_0x29f764,'componentsPerAttribute':0x2,'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT']},{'index':0x1,'vertexBuffer':_0x4f9982,'componentsPerAttribute':0x2,'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT']}];return new Cesium__namespace['VertexArray']({'context':_0x1fb203,'attributes':_0x5c769d,'indexBuffer':_0x5474ff});}function createFramebuffer(_0x25108b,_0x5d22dc){const _0x1a98b4={_0x147005:0xde3},_0x2323cd=_0x35a251;return new Cesium__namespace[(_0x2323cd(_0x1a98b4._0x147005))]({'context':_0x25108b,'colorTextures':[_0x5d22dc],'destroyAttachments':![]});}function computeTextureResolution(_0x2b1cc0){const _0x4f3401=_0x35a251,_0x1600bc=Cesium__namespace['ContextLimits']['maximumTextureSize'],_0x582bb9=Math['min'](_0x2b1cc0,_0x1600bc),_0x5555e0=Math[_0x4f3401(0xf82)](_0x2b1cc0/_0x582bb9);return{'x':_0x582bb9,'y':_0x5555e0};}function completionBuffer(_0x346bd1,_0x47b2ba){const _0x4981cb=_0x35a251,_0x1daf3d=_0x47b2ba['x']*_0x47b2ba['y'],_0x1c894e=_0x346bd1['length']/0x4;for(let _0xcb49d3=_0x1c894e;_0xcb49d3<_0x1daf3d;_0xcb49d3++){_0x346bd1[_0x4981cb(0x6de)](0x0),_0x346bd1['push'](0x0),_0x346bd1['push'](0x0),_0x346bd1['push'](0x0);}}class ShadowRateDrawCommand{constructor(_0x4a2997,_0x10bf76){const _0x203c47={_0x239559:0xf4e,_0x35a466:0xbdf},_0x152cfd={_0x1b7c88:0x390},_0x920573={_0x294a04:0xeb0},_0x277eb5={_0x1fe811:0x285},_0x1f988d=_0x35a251;this['_event']=new Cesium__namespace['Event'](),this[_0x1f988d(0x5d4)]=_0x4a2997,this['_positions']=_0x10bf76,this['_stat']=![];const _0x1f3718=_0x10bf76['length'];this['_requiredResolution']=computeTextureResolution(_0x1f3718);const _0x445f77=new Cesium__namespace['Texture']({'context':_0x4a2997['context'],'source':{'arrayBufferView':new Float32Array(this[_0x1f988d(0x805)]['x']*this[_0x1f988d(0x805)]['y']*0x4),'width':this[_0x1f988d(0x805)]['x'],'height':this['_requiredResolution']['y']},'pixelDatatype':Cesium__namespace['PixelDatatype'][_0x1f988d(_0x203c47._0x239559)],'pixelFormat':Cesium__namespace['PixelFormat']['RGBA'],'flipY':![]}),_0x55c022=createTextureVA(_0x4a2997['context']),_0x3a6f80=Cesium__namespace['ShaderProgram'][_0x1f988d(0xd48)]({'context':_0x4a2997['context'],'vertexShaderSource':vertexShaderSource,'fragmentShaderSource':fragmentShaderSource,'attributeLocations':{'position':0x0,'textureCoordinates':0x1}});this[_0x1f988d(_0x203c47._0x35a466)]=new Cesium__namespace['ComputeCommand']({'vertexArray':_0x55c022,'shaderProgram':_0x3a6f80,'outputTexture':_0x445f77,'uniformMap':{'shadowMap_cascadeSplits':()=>{const _0x2f952a=_0x1f988d;return _0x4a2997['shadowMap'][_0x2f952a(_0x277eb5._0x1fe811)];},'shadowMap_cascadeMatrices':()=>{const _0x4629d1=_0x1f988d;return _0x4a2997['shadowMap'][_0x4629d1(_0x920573._0x294a04)];},'shadowMap_texture':()=>{return _0x4a2997['shadowMap']['_shadowMapTexture'];},'u_positionTexture':()=>{return this['_positionTexture'];}},'persists':!![],'owner':this,'postExecute':_0x4f2697=>{const _0x1ba730=_0x1f988d,_0x1fc89f=createFramebuffer(_0x4a2997[_0x1ba730(0x390)],_0x4f2697),_0x2cee38=_0x4a2997[_0x1ba730(_0x152cfd._0x1b7c88)]['readPixels']({'framebuffer':_0x1fc89f,'width':this['_requiredResolution']['x'],'height':this['_requiredResolution']['y']});this['_event'][_0x1ba730(0x8f3)](_0x2cee38['slice'](0x0,_0x1f3718*0x4));}});}get['event'](){return this['_event'];}['start'](){const _0x519665={_0x37f32f:0x5d4,_0x5d0a76:0x18c,_0x52afbd:0xc3d,_0x25d731:0xf4e},_0xff41fa={_0x2bb792:0x6de},_0x5b4164=_0x35a251,_0x1add3a=this[_0x5b4164(_0x519665._0x37f32f)][_0x5b4164(0x7d)]['viewMatrix'],_0x493733=this['_positions']['map'](_0x4f709b=>Cesium__namespace['Matrix4'][_0x5b4164(0x7e2)](_0x1add3a,_0x4f709b,new Cesium__namespace['Cartesian3']())),_0x482fd7=[];_0x493733['forEach'](_0x2c267a=>{const _0x310d67=_0x5b4164;_0x482fd7[_0x310d67(_0xff41fa._0x2bb792)](_0x2c267a['x']),_0x482fd7['push'](_0x2c267a['y']),_0x482fd7['push'](_0x2c267a['z']),_0x482fd7[_0x310d67(_0xff41fa._0x2bb792)](0x0);}),this[_0x5b4164(_0x519665._0x5d0a76)]&&this['_positionTexture']['destroy'](),completionBuffer(_0x482fd7,this['_requiredResolution']),this['_positionTexture']=new Cesium__namespace['Texture']({'context':this['_scene']['context'],'source':{'width':this['_requiredResolution']['x'],'height':this['_requiredResolution']['y'],'arrayBufferView':new Float32Array(_0x482fd7)},'pixelDatatype':Cesium__namespace[_0x5b4164(_0x519665._0x52afbd)][_0x5b4164(_0x519665._0x25d731)],'flipY':![]}),this['_stat']=!![];}[_0x35a251(0x182)](_0x3adcea){const _0x4d3303=_0x35a251;if(!this['drawCommand'])return;this['_stat']&&(_0x3adcea['commandList']['push'](this['drawCommand']),this[_0x4d3303(0xe6c)]=![]);}[_0x35a251(0xa63)](){const _0x9244e8=_0x35a251;this[_0x9244e8(0x18c)]&&this['_positionTexture']['destroy'](),Cesium__namespace['destroyObject'](this);}}class Shadows extends BaseThing{get[_0x35a251(0xbfb)](){return this['_map']['scene']['shadowMap'];}get['time'](){const _0x2b8b26={_0x28bc47:0x18b},_0x44efcc=_0x35a251,_0x50acbc=this['_map']['clock'][_0x44efcc(_0x2b8b26._0x28bc47)];return Cesium__namespace['JulianDate']['toDate'](_0x50acbc);}set[_0x35a251(0xe15)](_0x287970){const _0x46da8e=_0x35a251;this['_map'][_0x46da8e(0x42d)]['currentTime']=Cesium__namespace['JulianDate']['fromDate'](_0x287970),this['stop']();}get['isStart'](){const _0x59274a={_0x127fa4:0x21b},_0x1dca27=_0x35a251;return this['_map'][_0x1dca27(0x42d)][_0x1dca27(_0x59274a._0x127fa4)];}get['multiplier'](){const _0x1ce6c9={_0x794724:0x42d,_0x26f99b:0xbd9},_0x2ef7fc=_0x35a251;var _0x17f898;return(_0x17f898=this['_map'])===null||_0x17f898===void 0x0?void 0x0:_0x17f898[_0x2ef7fc(_0x1ce6c9._0x794724)][_0x2ef7fc(_0x1ce6c9._0x26f99b)];}set[_0x35a251(0xbd9)](_0x1df485){const _0x3a3a23={_0x12e179:0xe86},_0x1a2af3=_0x35a251;this[_0x1a2af3(_0x3a3a23._0x12e179)]['multiplier']=_0x1df485,this[_0x1a2af3(0xd79)]&&(this['_map']['clock']['multiplier']=_0x1df485);}[_0x35a251(0xefe)](_0xb56662){const _0x34d5c4={_0x2000f7:0xd79,_0x4ad258:0x8d3,_0x1f3544:0x9c7,_0x21c5ff:0x9c7,_0x292f77:0xef4},_0x3c7313=_0x35a251;if(!this[_0x3c7313(_0x34d5c4._0x2000f7)])return;this['_map']['viewer']['shadows']=_0xb56662,(this['options']['terrain']??!![])&&(this['_map'][_0x3c7313(_0x34d5c4._0x4ad258)]['terrainShadows']=_0xb56662?Cesium__namespace[_0x3c7313(_0x34d5c4._0x1f3544)]['ENABLED']:Cesium__namespace[_0x3c7313(_0x34d5c4._0x21c5ff)]['DISABLED']),(this[_0x3c7313(0xe86)]['lighting']??!![])&&(this['_map']['scene']['globe'][_0x3c7313(_0x34d5c4._0x292f77)]=_0xb56662);}['_mountedHook'](){}[_0x35a251(0x97b)](){const _0x45421b={_0x309b4d:0xb8c,_0x2882c7:0xd79,_0x32db8f:0x355,_0x10f5a1:0xd79,_0x3cf07c:0x21b,_0x5402f7:0xd79,_0x4259d4:0x11d},_0x1df4d3=_0x35a251;this['_last_startTime']=this['_map'][_0x1df4d3(0x42d)]['startTime'],this['_last_stopTime']=this['_map']['clock']['stopTime'],this[_0x1df4d3(0x161)]=this['_map']['clock'][_0x1df4d3(0x21b)],this[_0x1df4d3(_0x45421b._0x309b4d)]=this[_0x1df4d3(_0x45421b._0x2882c7)]['clock'][_0x1df4d3(_0x45421b._0x32db8f)],this[_0x1df4d3(0xd6a)]=this['_map']['clock'][_0x1df4d3(0xbd9)],this['_last_shadows']=this[_0x1df4d3(_0x45421b._0x10f5a1)]['viewer']['shadows'],this['_enabledHook'](this['enabled']),this['_map']['clock'][_0x1df4d3(_0x45421b._0x3cf07c)]=![],this[_0x1df4d3(_0x45421b._0x10f5a1)]['clock'][_0x1df4d3(_0x45421b._0x32db8f)]=this['options'][_0x1df4d3(_0x45421b._0x32db8f)]??Cesium__namespace['ClockRange']['CLAMPED'],this['_map']['clock']['multiplier']=this['options']['multiplier']??0x640,this['options']['time']&&(this[_0x1df4d3(0xe15)]=this['options'][_0x1df4d3(0xe15)]),this[_0x1df4d3(_0x45421b._0x5402f7)]['on'](EventType['clockTick'],this[_0x1df4d3(_0x45421b._0x4259d4)],this);}['_removedHook'](){const _0x5b9528={_0x1d6104:0x529},_0x56d411=_0x35a251;this['_map']['off'](EventType['clockTick'],this['_onClockTickHanlder'],this),this['clear'](),this['_enabledHook'](![]),this['_map'][_0x56d411(0x8d3)][_0x56d411(_0x5b9528._0x1d6104)]=this['_last_shadows'],this['_map'][_0x56d411(0x42d)]['clockRange']=this[_0x56d411(0xb8c)],this[_0x56d411(0xd79)][_0x56d411(0x42d)]['multiplier']=this['_last_multiplier'],this['_map']['clock']['shouldAnimate']=this['_last_shouldAnimate'];}['_onClockTickHanlder'](){const _0x2dd659={_0x2255e0:0xaaf},_0x23ff68=_0x35a251;if(!this['_map']['clock'][_0x23ff68(0x21b)])return;this['_drawCommand']&&(this['_drawCommand']['start'](),this[_0x23ff68(_0x2dd659._0x2255e0)]+=0x1),this['fire'](EventType[_0x23ff68(0x9f2)]);}[_0x35a251(0xaa1)](_0x1fcd06,_0x40c654,_0x3fc2e2){const _0x413589={_0x412b0c:0xa51,_0x3f7856:0xd79,_0x310ecc:0x579},_0x51ede2=_0x35a251;if(!this['_map'])return;if(!_0x1fcd06||!_0x40c654||_0x1fcd06>=_0x40c654)return;this['_map']['clock']['startTime']=Cesium__namespace['JulianDate'][_0x51ede2(_0x413589._0x412b0c)](_0x1fcd06),this[_0x51ede2(_0x413589._0x3f7856)]['clock']['currentTime']=Cesium__namespace[_0x51ede2(_0x413589._0x310ecc)]['fromDate'](_0x3fc2e2||_0x1fcd06),this['_map']['clock'][_0x51ede2(0xcf0)]=Cesium__namespace['JulianDate'][_0x51ede2(0xa51)](_0x40c654),this[_0x51ede2(_0x413589._0x3f7856)]['clock']['shouldAnimate']=!![];}['pause'](){const _0x31530c={_0x1c82e9:0xd79},_0x5a961c=_0x35a251;this[_0x5a961c(_0x31530c._0x1c82e9)]&&(this['_map'][_0x5a961c(0x42d)]['shouldAnimate']=![]);}['proceed'](){const _0x5391ff=_0x35a251;this['_map']&&(this['_map'][_0x5391ff(0x42d)]['shouldAnimate']=!![]);}['stop'](){const _0x3c1187={_0x455a05:0x21b},_0x431d17=_0x35a251;this[_0x431d17(0xd79)]&&(this['_map']['clock'][_0x431d17(_0x3c1187._0x455a05)]=![]);}[_0x35a251(0x386)](){const _0x247290={_0x154c7c:0xf9b,_0x43de1f:0xd79,_0xbeb16:0x1f3},_0x9bb37d=_0x35a251;this[_0x9bb37d(_0x247290._0x154c7c)](),this['currentTime']=new Date(),this[_0x9bb37d(_0x247290._0x43de1f)]['clock']['startTime']=this[_0x9bb37d(_0x247290._0xbeb16)],this['_map']['clock']['stopTime']=this['_last_stopTime'],this['_map']['off'](EventType['clockStop'],this[_0x9bb37d(0xf6f)],this),this['_clearDraw']();}[_0x35a251(0x9c)](_0x3a984a){const _0x340f2d={_0x30709d:0xd79,_0x4b6711:0xe1e,_0x4a8a63:0xa3,_0x1544ac:0x75a,_0x26e9dc:0xbf9,_0xd89a25:0xaa2,_0x24dae7:0xcfc,_0x287671:0x4af,_0x494d6c:0xd79},_0x2527f7={_0x1d6894:0x8eb,_0x46b04c:0xfa7};return new Promise((_0xe16211,_0x22495b)=>{const _0x194729={_0x365aec:0xfa7,_0x22d135:0xb9d},_0x30b578=_0x2767;if(!this[_0x30b578(_0x340f2d._0x30709d)]||!_0x3a984a[_0x30b578(0xb35)]||_0x3a984a['positions'][_0x30b578(_0x340f2d._0x4b6711)]===0x0)return _0xe16211();if(!_0x3a984a['startDate']||!_0x3a984a['endDate']||_0x3a984a[_0x30b578(_0x340f2d._0x4a8a63)]>=_0x3a984a[_0x30b578(_0x340f2d._0x1544ac)])return _0xe16211();this['_promise_resolve']=_0xe16211;const _0x37d099=getGridPointsByPoly(_0x3a984a[_0x30b578(0xb35)],_0x3a984a[_0x30b578(_0x340f2d._0x26e9dc)],_0x3a984a['minHeight']),_0x4210f2=[];if(Cesium__namespace['defined'](_0x3a984a['minHeight'])&&Cesium__namespace[_0x30b578(_0x340f2d._0xd89a25)](_0x3a984a['maxHeight'])&&_0x3a984a['minHeight']!==_0x3a984a['maxHeight'])for(let _0x32adca=_0x3a984a['minHeight'];_0x32adca<_0x3a984a['maxHeight'];_0x32adca+=_0x3a984a['step']){_0x37d099[_0x30b578(0xdbd)](_0x34aa64=>{const _0x453da0=_0x30b578,_0xd65bfe=Cesium__namespace[_0x453da0(_0x2527f7._0x1d6894)]['fromDegrees'](_0x34aa64[_0x453da0(_0x2527f7._0x46b04c)],_0x34aa64['lat'],_0x32adca);_0xd65bfe['lng']=_0x34aa64['lng'],_0xd65bfe['lat']=_0x34aa64['lat'],_0xd65bfe['alt']=_0x32adca,_0xd65bfe['total']=0x0,_0x4210f2['push'](_0xd65bfe);});}else _0x37d099['forEach'](_0x1032ef=>{const _0x1fa19c=_0x30b578,_0x321357=Cesium__namespace['Cartesian3']['fromDegrees'](_0x1032ef['lng'],_0x1032ef['lat'],_0x1032ef['alt']);_0x321357['lng']=_0x1032ef[_0x1fa19c(_0x194729._0x365aec)],_0x321357['lat']=_0x1032ef[_0x1fa19c(_0x194729._0x22d135)],_0x321357['alt']=_0x1032ef['alt'],_0x321357['total']=0x0,_0x4210f2['push'](_0x321357);});this[_0x30b578(0x1b4)]=_0x4210f2,this['_clearDraw'](),this[_0x30b578(_0x340f2d._0x24dae7)]=new ShadowRateDrawCommand(this['_map']['scene'],this[_0x30b578(0x1b4)]),this['_map']['scene']['primitives'][_0x30b578(_0x340f2d._0x287671)](this[_0x30b578(_0x340f2d._0x24dae7)]),this['_drawCommand']['event']['addEventListener'](_0x3fcab2=>{const _0x40f622=_0x3fcab2['length'];let _0x14f188=0x0;for(let _0x46ef39=0x0;_0x46ef39<_0x40f622;_0x46ef39+=0x4){this['_rate_positions'][_0x14f188]['total']+=_0x3fcab2[_0x46ef39],_0x14f188+=0x1;}}),this[_0x30b578(_0x340f2d._0x494d6c)]['on'](EventType['clockStop'],this['_map_clockStopTickHandler'],this),this['start'](_0x3a984a[_0x30b578(0xa3)],_0x3a984a['endDate']),this['fire'](EventType['start']);});}['_clearDraw'](){const _0x5f4322={_0x1fe220:0xc60,_0x4f2e31:0xcfc},_0x1c4894=_0x35a251;this['_rate_total']=0x0;if(this['_rate_positions'])for(let _0x47a452=0x0,_0x367605=this['_rate_positions'][_0x1c4894(0xe1e)];_0x47a452<_0x367605;_0x47a452++){this['_rate_positions'][_0x47a452]['total']=0x0;}this['_drawCommand']&&(this['_map'][_0x1c4894(_0x5f4322._0x1fe220)]['primitives']['remove'](this[_0x1c4894(0xcfc)]),this[_0x1c4894(_0x5f4322._0x4f2e31)]['destroy'](),delete this['_drawCommand']);}['_map_clockStopTickHandler'](_0x2de522){const _0x240000={_0x5a8121:0x20f,_0x4caedc:0xc60,_0x33767b:0x1b4},_0x197829=_0x35a251;this['_map']['off'](EventType[_0x197829(_0x240000._0x5a8121)],this['_map_clockStopTickHandler'],this);this['_drawCommand']&&(this[_0x197829(0xd79)][_0x197829(_0x240000._0x4caedc)][_0x197829(0x4e1)][_0x197829(0x1ee)](this['_drawCommand']),this['_drawCommand']['destroy'](),delete this['_drawCommand']);for(let _0x27bb79=0x0,_0x137d40=this['_rate_positions']['length'];_0x27bb79<_0x137d40;_0x27bb79++){this['_rate_positions'][_0x27bb79]['rate']=0x1-this[_0x197829(_0x240000._0x33767b)][_0x27bb79][_0x197829(0x4c7)]/this['_rate_total'];}const _0x2d5c53={'total':this['_rate_total'],'positions':this[_0x197829(_0x240000._0x33767b)]};this['_promise_resolve']&&(this['_promise_resolve'](_0x2d5c53),delete this[_0x197829(0xb27)]),this['fire'](EventType['stop'],_0x2d5c53);}}class Measure extends BaseThing{get[_0x35a251(0x3e1)](){return this['_graphicLayer'];}get[_0x35a251(0xe45)](){return this['_graphicLayer']['graphics'];}get['hasMeasure'](){return this['_graphicLayer']['length']>0x0;}['_enabledHook'](_0x56b4fa){}[_0x35a251(0x700)](){const _0x58b644=_0x35a251;this['_graphicLayer']=new GraphicLayer({'hasEdit':!![],'eventParent':this,'isContinued':this['options']['isContinued'],'isAutoEditing':!this['options']['isContinued'],...this['options'],'private':!![]}),this['_graphicLayer']['hasEdit']&&this['_graphicLayer'][_0x58b644(0xb33)]([{'text':this['_map']['getLangText']('_删除测量'),'icon':Icon['Delete'],'show':_0x1170e2=>{const _0x39223e=_0x1170e2['graphic'];return _0x39223e!==null&&_0x39223e!==void 0x0&&_0x39223e['inProgress']&&!_0x39223e['editing']?![]:!![];},'callback':_0x2fba9c=>{const _0x20140d=_0x58b644,_0x3ecca1=_0x2fba9c['graphic'];if(!_0x3ecca1)return;const _0x10d2b7=_0x3ecca1[_0x20140d(0x605)];this['_graphicLayer']['removeGraphic'](_0x3ecca1),_0x10d2b7&&this[_0x20140d(0xb13)]['removeGraphic'](_0x10d2b7),this['fire'](EventType['remove'],{'mtype':this['_measureType'],'graphic':_0x3ecca1});}}]);}['_addedHook'](){const _0x5e8bdc={_0x30e0e9:0xd79},_0x1c92e2=_0x35a251;this[_0x1c92e2(_0x5e8bdc._0x30e0e9)][_0x1c92e2(0x6f7)](this['_graphicLayer']);}['_removedHook'](){const _0x5d9e4d={_0x398102:0xad7,_0x4c7bdc:0xb13},_0x58258f=_0x35a251;this[_0x58258f(0xd79)][_0x58258f(_0x5d9e4d._0x398102)](this[_0x58258f(_0x5d9e4d._0x4c7bdc)]);}[_0x35a251(0xeed)](_0x3b8fe0={}){return this['stopDraw'](),_0x3b8fe0['type']='distanceMeasure',this['_graphicLayer']['startDraw'](_0x3b8fe0);}['distanceSurface'](_0x48bf7c={}){const _0x2d95e4={_0x43e63a:0x2ef},_0x54f485=_0x35a251;return this['stopDraw'](),_0x48bf7c['type']=_0x54f485(0x9c0),this['_graphicLayer'][_0x54f485(_0x2d95e4._0x43e63a)](_0x48bf7c);}['section'](_0x58a9b8={}){const _0xd92393=_0x35a251;return this['stopDraw'](),_0x58a9b8['type']='sectionMeasure',this[_0xd92393(0xb13)][_0xd92393(0x2ef)](_0x58a9b8);}['area'](_0x21edec={}){const _0x15736c=_0x35a251;return this[_0x15736c(0x77c)](),_0x21edec['type']=_0x15736c(0xaf5),this['_graphicLayer']['startDraw'](_0x21edec);}['areaSurface'](_0x38bb16={}){const _0x237706={_0x1af771:0x92f},_0x231b19=_0x35a251;return this['stopDraw'](),_0x38bb16['type']=_0x231b19(_0x237706._0x1af771),this['_graphicLayer']['startDraw'](_0x38bb16);}['volume'](_0x2e2aa8={}){const _0x227a57={_0x17bde:0x50c},_0x3617b2=_0x35a251;return this['stopDraw'](),_0x2e2aa8['type']=_0x2e2aa8[_0x3617b2(_0x227a57._0x17bde)]?_0x3617b2(0x7d4):'volumeMeasure',this['_graphicLayer']['startDraw'](_0x2e2aa8);}['height'](_0xb2fc22={}){const _0x4bdd34={_0x2ee241:0xb13},_0x506470=_0x35a251;return this[_0x506470(0x77c)](),_0xb2fc22['type']='heightMeasure',this[_0x506470(_0x4bdd34._0x2ee241)]['startDraw'](_0xb2fc22);}['heightTriangle'](_0x28a399={}){const _0x47c4d5={_0x18595b:0x763},_0x6e97e1=_0x35a251;return this['stopDraw'](),_0x28a399['type']=_0x6e97e1(_0x47c4d5._0x18595b),this['_graphicLayer']['startDraw'](_0x28a399);}['angle'](_0x5b0b95={}){const _0x3caa77=_0x35a251;return this[_0x3caa77(0x77c)](),_0x5b0b95['type']='angleMeasure',this['_graphicLayer']['startDraw'](_0x5b0b95);}['point'](_0x3c77b4={}){const _0x200a40={_0x2b40b9:0xb13},_0x28bbf9=_0x35a251;return this[_0x28bbf9(0x77c)](),_0x3c77b4[_0x28bbf9(0x8ea)]='pointMeasure',this[_0x28bbf9(_0x200a40._0x2b40b9)]['startDraw'](_0x3c77b4);}['stopDraw'](){return this['_graphicLayer']['stopDraw']();}['clearDrawing'](){return this['_graphicLayer']['clearDrawing']();}['endDraw'](){const _0x50e71f=_0x35a251;return this[_0x50e71f(0xb13)][_0x50e71f(0x11e)]();}['clear'](){return this['_graphicLayer']['clear']();}['updateUnit'](_0x16bc28){const _0x1a0c85={_0x45a748:0xe86},_0x1fdc16=_0x35a251;this['_graphicLayer'][_0x1fdc16(0xfca)](_0x497094=>{const _0x48b621=_0x1fdc16;_0x497094[_0x48b621(_0x1a0c85._0x45a748)]['unit']=_0x16bc28,_0x497094['showText']&&_0x497094[_0x48b621(0x697)](_0x16bc28);});}['destroy'](_0xcc20a0){const _0x4c2c48={_0x36a88e:0xa63},_0xe6dc45=_0x35a251;this['_graphicLayer'][_0xe6dc45(_0x4c2c48._0x36a88e)](_0xcc20a0),super['destroy'](_0xcc20a0);}}class FloodByGraphic extends BaseThing{get['positions'](){return this['options']['positions'];}set['positions'](_0xe3c714){const _0x467c56={_0xa946d4:0x895,_0x114c2f:0xd79,_0x4db1cd:0x22f,_0x369412:0x7cb},_0x4edfcf={_0x2795dc:0x4a0,_0x2f8f1e:0x5d1,_0xa11587:0x6de},_0x31694f=_0x35a251;this['options']['positions']=_0xe3c714;if(_0xe3c714){const _0x1e84b6=[],_0x4bbabe=[];_0xe3c714['forEach'](_0x569d1d=>{const _0x505a88=_0x2767,_0x4ef3f8=LngLatPoint[_0x505a88(0x8d0)](_0x569d1d);if(!_0x4ef3f8||!_0x4ef3f8[_0x505a88(_0x4edfcf._0x2795dc)]())return;_0x4ef3f8[_0x505a88(_0x4edfcf._0x2f8f1e)]=_0x4ef3f8['alt'],_0x4bbabe[_0x505a88(_0x4edfcf._0xa11587)](_0x4ef3f8),_0x1e84b6['push'](_0x4ef3f8['toCartesian'](!![]));}),this[_0x31694f(0xde)]=_0x4bbabe,this[_0x31694f(0x7cb)]=_0x1e84b6;if(this[_0x31694f(0xd79)]){const _0x5e6644=this['options']['has3dtiles']??Cesium__namespace['defined'](this['_map']['pick3DTileset'](_0x1e84b6));!_0x5e6644&&(!Cesium__namespace[_0x31694f(0xaa2)](this['_last_depthTestAgainstTerrain'])&&(this['_last_depthTestAgainstTerrain']=this['_map'][_0x31694f(0xc60)]['globe'][_0x31694f(_0x467c56._0xa946d4)]),this[_0x31694f(_0x467c56._0x114c2f)]['scene'][_0x31694f(_0x467c56._0x4db1cd)]['depthTestAgainstTerrain']=!![]);}}else this[_0x31694f(_0x467c56._0x369412)]=null;}get['height'](){return this['_extrudedHeight']??this['options']['minHeight'];}set['height'](_0x4438ad){const _0x5ef353={_0x24930f:0xdbd},_0xcb46f9={_0x15f766:0x8d0,_0x5792e8:0xa43},_0xcd274d=_0x35a251;this['_extrudedHeight']=_0x4438ad;if(this['options']['perPositionHeight']){!this['_poinst']&&this['options']['positions']&&(this[_0xcd274d(0xb35)]=this['options']['positions']);if(this['_poinst']){const _0x1c205d=[];this['_poinst'][_0xcd274d(_0x5ef353._0x24930f)](_0x519b43=>{const _0x2df7bb=_0xcd274d,_0xfca1ef=LngLatPoint[_0x2df7bb(_0xcb46f9._0x15f766)](_0x519b43);if(!_0xfca1ef||!_0xfca1ef['valid']())return;_0xfca1ef['alt']=_0xfca1ef['_alt_bak']+_0x4438ad,_0x1c205d['push'](_0xfca1ef[_0x2df7bb(_0xcb46f9._0x5792e8)](!![]));}),this['_hierarchyPositions']=_0x1c205d;}}this['fire'](EventType['change'],{'height':this['_extrudedHeight']});}get[_0x35a251(0x6a2)](){return this['options']['speed'];}set['speed'](_0xc53ab3){this['options']['speed']=_0xc53ab3;}['_mountedHook'](){const _0x1ffe6a={_0x5edd54:0xb39,_0x44b5de:0xac1,_0x1bee5b:0xdf4,_0x121871:0xaa2},_0x310f06=_0x35a251;this['graphicLayer']=new GraphicLayer({'name':'淹没分析','private':!![]}),this['_extrudedHeight']=0x0;const _0x1aabbd=new Cesium__namespace[(_0x310f06(_0x1ffe6a._0x5edd54))](),_0x433d53={'color':_0x310f06(_0x1ffe6a._0x44b5de),'opacity':0.5,'outline':![],...this['options']['style']||{},'perPositionHeight':!![]};!this['options']['perPositionHeight']&&(_0x433d53[_0x310f06(0x682)]=this[_0x310f06(_0x1ffe6a._0x1bee5b)],_0x433d53['extrudedHeight']=new Cesium__namespace['CallbackProperty'](_0x1c3ef5=>{return this['_extrudedHeight'];},![]));const _0x10eab5=new PolygonEntity({'positions':new Cesium__namespace['CallbackProperty'](_0x5e5c4b=>{const _0x11f69d=_0x310f06;if(!this[_0x11f69d(0x7cb)])return null;return _0x1aabbd['positions']=this['_hierarchyPositions'],_0x1aabbd;},![]),'style':_0x433d53});this['graphic']=_0x10eab5,Cesium__namespace['defined'](this['options']['minHeight'])&&Cesium__namespace[_0x310f06(0xaa2)](this['options']['maxHeight'])&&Cesium__namespace[_0x310f06(_0x1ffe6a._0x121871)](this['options']['positions'])&&this['setOptions']();}['_addedHook'](){const _0x2baf27={_0x200ab1:0x6f7,_0x260f06:0xf8c},_0x6123b5=_0x35a251;this['_map'][_0x6123b5(_0x2baf27._0x200ab1)](this[_0x6123b5(0x3e1)]),this['graphicLayer']['addGraphic'](this[_0x6123b5(_0x2baf27._0x260f06)]);}['_removedHook'](){this['_map']['removeLayer'](this['graphicLayer']),this['clear']();}['setOptions'](_0x208051){const _0x219098={_0x5040c5:0xaa2},_0x57d91e=_0x35a251;_0x208051&&(this['options']={...this['options'],..._0x208051});this['stop']();let _0x499e01=this['options']['minHeight'],_0x1ef503=this['options']['maxHeight'];if(!Cesium__namespace[_0x57d91e(_0x219098._0x5040c5)](_0x499e01)){logError$1('minHeight\x20请传入有效数值!',_0x499e01);return;}if(!Cesium__namespace['defined'](_0x1ef503)){logError$1('maxHeight\x20请传入有效数值!',_0x1ef503);return;}if(_0x499e01>_0x1ef503){const _0x89e7f6=_0x499e01;_0x499e01=_0x1ef503,_0x1ef503=_0x89e7f6;}return this['_extrudedHeight']=_0x499e01,this[_0x57d91e(0x9d7)]=_0x1ef503,this['positions']=this['options']['positions'],this;}['start'](){const _0x31007b={_0x12bfaa:0xf9b,_0xe4a552:0xaa1},_0x598327={_0x566cdf:0x9d7},_0x83488d=_0x35a251;if(!this[_0x83488d(0x7cb)]){logError$1('请传入淹没区域才能开始分析');return;}this[_0x83488d(_0x31007b._0x12bfaa)](),this['isStart']=!![],this['fire'](EventType[_0x83488d(_0x31007b._0xe4a552)]),this['_timeTik']=setInterval(()=>{const _0x387048=_0x83488d;if(this['_extrudedHeight']>=this['_maxHeight']){this['stop']();return;}const _0xfd8a9b=this['_extrudedHeight']+this['speed'];_0xfd8a9b>this[_0x387048(_0x598327._0x566cdf)]?this['height']=this['_maxHeight']:this['height']=_0xfd8a9b;},0x64);}[_0x35a251(0xf9b)](){const _0x8526a0={_0x57ea89:0x5dd},_0x4fbb3a=_0x35a251;if(!this[_0x4fbb3a(0x5dd)])return;this['_timeTik']&&(clearInterval(this['_timeTik']),delete this['_timeTik']),this[_0x4fbb3a(_0x8526a0._0x57ea89)]=![],this[_0x4fbb3a(0x264)](EventType['end']);}['restart'](){const _0x4cd362=_0x35a251;this[_0x4cd362(0x72b)](),this['start']();}[_0x35a251(0x386)](){const _0x26c901={_0x1bfd24:0x430},_0x28e998=_0x35a251;this['positions']=null,this['_last_depthTestAgainstTerrain']!=null&&(this['_map'][_0x28e998(0xc60)]['globe']['depthTestAgainstTerrain']=this[_0x28e998(_0x26c901._0x1bfd24)],delete this[_0x28e998(0x430)]),this['stop']();}['destroy'](_0x258231){const _0x2e70d6=_0x35a251;this['graphicLayer']&&this['graphicLayer'][_0x2e70d6(0xa63)](_0x258231),super[_0x2e70d6(0xa63)](_0x258231);}}class Slope extends BaseThing{constructor(_0x3e9bd2={}){const _0xddc987={_0x305ca0:0x9db,_0x2c95e4:0xce5,_0x3323db:0x1cb},_0x4a1787=_0x35a251;super(_0x3e9bd2),this['options'][_0x4a1787(0xce5)]=this['options']['arrow']||{},this['options']['arrow']['show']=this['options'][_0x4a1787(0xce5)]['show']??!![],this['options']['arrow']['color']=this['options']['arrow'][_0x4a1787(_0xddc987._0x305ca0)]??Cesium__namespace['Color']['YELLOW'],this['options'][_0x4a1787(_0xddc987._0x2c95e4)]['width']=this['options'][_0x4a1787(0xce5)]['width']??0xf,this[_0x4a1787(0xe86)]['arrow']['scale']=this[_0x4a1787(0xe86)]['arrow'][_0x4a1787(_0xddc987._0x3323db)]??0.3;}[_0x35a251(0x700)](){const _0x55f415={_0x2915fa:0xeaa};this['graphicLayer']=new GraphicLayer({'name':'坡度坡向','tooltip':function(_0x1c9345){const _0x4bd4f5=_0x2767;var _0x35be64;const _0x365576=(_0x35be64=_0x1c9345['graphic'])===null||_0x35be64===void 0x0?void 0x0:_0x35be64['attr'];if(!_0x365576)return;return'坡度:\x20'+_0x365576['slopeStr1']+_0x4bd4f5(_0x55f415._0x2915fa)+_0x365576['slopeStr2']+')坡向:\x20'+_0x365576['direction']+'°';},...this['options'],'private':!![]});}['_addedHook'](){const _0x21e54b={_0xe0732d:0xd79,_0x673bda:0x6f7,_0x5c4594:0xe1e},_0xd8c68e=_0x35a251;this[_0xd8c68e(_0x21e54b._0xe0732d)][_0xd8c68e(_0x21e54b._0x673bda)](this['graphicLayer']),this['options']['positions']&&this['options']['positions'][_0xd8c68e(_0x21e54b._0x5c4594)]>0x0&&this['add'](this['options']['positions'],this['options']);}['_removedHook'](){this['_map']['removeLayer'](this['graphicLayer']),this['clear']();}['add'](_0x5a6485,_0x559082={}){const _0xea4942={_0x19be76:0x4fe,_0x184f74:0x453,_0x338d75:0xe1e,_0x5724c3:0xc60,_0x44b9b8:0xce5,_0x25edfc:0xe1e},_0x5670de={_0xccc5c5:0xce5,_0x3e4206:0x3f4,_0x4faa74:0xe86,_0x15b289:0x207,_0x3ca187:0x571,_0x572f7c:0xe1e,_0x2b9909:0xb1c,_0x259a7c:0x329},_0x47d38b=_0x35a251;if(!_0x5a6485||_0x5a6485['length']<0x1)return;_0x5a6485=LngLatArray['toCartesians'](_0x5a6485),this['_eventResult']={'positions':_0x5a6485},this[_0x47d38b(_0xea4942._0x19be76)]=0x0,this[_0x47d38b(0x501)]=[],this[_0x47d38b(0xf07)]=[];const _0x387493=_0x559082[_0x47d38b(_0xea4942._0x184f74)]??0x8;if(_0x5a6485[_0x47d38b(_0xea4942._0x338d75)]>0x2&&_0x387493>0x1)interPolygon({'scene':this['_map'][_0x47d38b(_0xea4942._0x5724c3)],'positions':_0x5a6485,'has3dtiles':![],'onlyPoint':!![],'splitNum':_0x387493})[_0x47d38b(0x86c)](_0x3a25a2=>{const _0x159bc3=_0x47d38b;this[_0x159bc3(0xe86)][_0x159bc3(_0x5670de._0xccc5c5)]['length']?this['_arrowLength']=this['options']['arrow']['length']:this['_arrowLength']=Cesium__namespace['Math']['chordLength'](_0x3a25a2[_0x159bc3(0x4ea)],this['_map'][_0x159bc3(0xc60)]['globe'][_0x159bc3(_0x5670de._0x3e4206)]['maximumRadius'])*this[_0x159bc3(_0x5670de._0x4faa74)]['arrow']['scale'];this[_0x159bc3(_0x5670de._0x15b289)]['maxHeight']=_0x3a25a2[_0x159bc3(_0x5670de._0x3ca187)],this['_eventResult']['minHeight']=_0x3a25a2['minHeight'],_0x5a6485=[];for(let _0x1ad55b=0x0;_0x1ad55b<_0x3a25a2['list'][_0x159bc3(_0x5670de._0x572f7c)];_0x1ad55b++){_0x5a6485['push'](_0x3a25a2[_0x159bc3(0xb69)][_0x1ad55b][_0x159bc3(_0x5670de._0x2b9909)]);}this['_stateAll']=_0x5a6485['length'];for(let _0x405539=0x0;_0x405539{const _0x61d0=_0x2fb529;if(this[_0x61d0(0xc1d)]===0x0)return;_0x2dbcee[_0x61d0(0xe9f)]&&logWarn('未获取到高度值,贴地高度计算存在误差');const _0x458334=_0x4b98d5[_0x61d0(0x2ca)](_0x2dbcee['positions']),_0x444d42=_0x458334['pop']();let _0x52016a=0x0,_0x2fb12f=_0x458334[0x0][_0x61d0(0x682)],_0x186f05=0x0,_0x3cb0dc=_0x458334[0x0][_0x61d0(_0x2a1b58._0x2c5036)];for(let _0x3665b4=0x1;_0x3665b4<_0x458334[_0x61d0(_0x2a1b58._0x153824)]-0x1;_0x3665b4++){const _0x239b5d=_0x458334[_0x3665b4];_0x239b5d[_0x61d0(_0x2a1b58._0x2c5036)]>_0x2fb12f&&(_0x2fb12f=_0x239b5d['height'],_0x52016a=_0x3665b4),_0x239b5d[_0x61d0(_0x2a1b58._0x2c5036)]<_0x3cb0dc&&(_0x3cb0dc=_0x239b5d[_0x61d0(_0x2a1b58._0x2c5036)],_0x186f05=_0x3665b4);}const _0x23eacc=_0x458334[_0x52016a],_0x332d65=_0x458334[_0x186f05],_0x63875b=this[_0x61d0(_0x2a1b58._0x4719fa)](_0x444d42,_0x23eacc),_0x597a63=this[_0x61d0(_0x2a1b58._0x4719fa)](_0x444d42,_0x332d65);_0x63875b>_0x597a63?this[_0x61d0(0xd2f)](_0x44d676,_0x444d42,_0x23eacc,_0x63875b):this['_fxOnePointOk'](_0x44d676,_0x444d42,_0x332d65,_0x597a63);});}['_fxOnePointOk'](_0x1987d5,_0x2adc12,_0xef7634,_0x4c22fa){const _0x54b653={_0x1b8e0e:0x682,_0x4ad7c9:0x269,_0x3def03:0x264,_0x2b42d3:0xe86,_0x1b1f92:0x501,_0x45e5dc:0xe86,_0x19dfbd:0x8b5,_0x5d9d53:0xa2d},_0x505a62=_0x35a251,_0x3acaa2=Cesium__namespace['Cartographic']['toCartesian'](_0x2adc12);let _0x4d30ff=Cesium__namespace['Cartographic']['toCartesian'](_0xef7634);_0x4d30ff=getOnLinePointByLen(_0x3acaa2,_0x4d30ff,this['_arrowLength']);let _0x17d89f;_0x2adc12[_0x505a62(_0x54b653._0x1b8e0e)]>_0xef7634['height']?_0x17d89f=[_0x3acaa2,_0x4d30ff]:_0x17d89f=[_0x4d30ff,_0x3acaa2];const _0x26eec8=getAngle(_0x17d89f[0x0],_0x17d89f[0x1],!![]);let _0x5e86d3=Math[_0x505a62(_0x54b653._0x4ad7c9)](_0x4c22fa)*0xb4/Math['PI'];_0x5e86d3=Number(_0x5e86d3['toFixed'](0x2));const _0x1526cf=_0x5e86d3+'°',_0x5bd026=(_0x4c22fa*0x64)[_0x505a62(0xf0a)](0x2)+'%',_0x577c46={'position':_0x1987d5,'slope':_0x5e86d3,'slopeStr1':_0x1526cf,'slopeStr2':_0x5bd026,'direction':_0x26eec8};!this['_arrData']&&(this['_arrData']=[]);this[_0x505a62(0xf07)]['push'](_0x577c46),this[_0x505a62(_0x54b653._0x3def03)](EventType['endItem'],{'data':_0x577c46,'index':this['_stateOkIndex']});this[_0x505a62(_0x54b653._0x2b42d3)]['arrow'][_0x505a62(0x987)]&&this['_arrowInstances']['push']({'positions':_0x17d89f,'attr':_0x577c46});this['_stateOkIndex']++;if(this['_stateOkIndex']>=this['_stateAll']){if(this['options']['arrow']['show']&&this['_arrowInstances']['length']>0x0){const _0xa4633c=new PolylineCombine({'instances':this[_0x505a62(_0x54b653._0x1b1f92)],'style':{'materialType':PolylineArrow,...this[_0x505a62(_0x54b653._0x45e5dc)]['arrow']}});this['graphicLayer'][_0x505a62(_0x54b653._0x19dfbd)](_0xa4633c);}this[_0x505a62(0x264)](EventType[_0x505a62(_0x54b653._0x5d9d53)],{...this['_eventResult']||{},'data':this['_arrData']});}}['getSlope'](_0x1d400d,_0x184fe6){const _0x2a470b={_0x356894:0xeed,_0x443408:0x120},_0x448e31=_0x35a251;if(!_0x1d400d||!_0x184fe6)return;const _0x53d1fa=Math['abs'](_0x1d400d['height']-_0x184fe6['height']),_0x468df7=Cesium__namespace['Cartesian3'][_0x448e31(_0x2a470b._0x356894)](Cesium__namespace[_0x448e31(_0x2a470b._0x443408)]['toCartesian'](_0x1d400d),Cesium__namespace['Cartesian3'][_0x448e31(0x175)](_0x184fe6['longitude'],_0x184fe6['latitude'],_0x1d400d[_0x448e31(0x682)])),_0x41f56d=_0x53d1fa/_0x468df7;return _0x41f56d;}['clear'](){const _0x4cee3c=_0x35a251;this['graphicLayer']['clear'](),this[_0x4cee3c(0x501)]=[],this['_arrData']=[],this['_stateAll']=0x0,this['_stateOkIndex']=0x0;}static['getSlope'](_0x132b3e){const _0x2bacf2={_0x11393c:0x6a4};return new Promise((_0x2371ff,_0x1a7530)=>{const _0x453caf=_0x2767,_0x5ae5c7=new Slope({'positions':_0x132b3e['positions'],'splitNum':0x1,'radius':_0x132b3e['radius'],'count':_0x132b3e['count'],'has3dtiles':_0x132b3e['has3dtiles'],'point':{'show':![]},'arrow':{'show':![]}});_0x5ae5c7[_0x453caf(0xdc3)](_0x132b3e['map']),_0x132b3e[_0x453caf(_0x2bacf2._0x11393c)]&&_0x5ae5c7['on'](EventType['endItem'],_0x132b3e['endItem']),_0x5ae5c7['on'](EventType['end'],_0x4b85d0=>{const _0x2eb7d4=_0x453caf;_0x5ae5c7[_0x2eb7d4(0xa63)](),_0x132b3e[_0x2eb7d4(0xa9b)]&&_0x132b3e['callback'](_0x4b85d0),_0x2371ff(_0x4b85d0);});});}}class TerrainPlanClip extends BaseThing{get['positions'](){const _0x5445b1=_0x35a251;return this[_0x5445b1(0x58a)];}set['positions'](_0x40669c){const _0x274556={_0x2ac117:0xf86},_0x494d5d=_0x35a251;this['clear'](),this['_positions']=_0x40669c,this[_0x494d5d(_0x274556._0x2ac117)](_0x40669c);}get['diffHeight'](){return this['options']['diffHeight'];}set['diffHeight'](_0x259b6e){const _0x51f5d4={_0x49611c:0x4f7,_0xc0142a:0xb13,_0x410a3b:0xb13,_0x15cfd9:0xfca},_0x26718b=_0x35a251;this['options'][_0x26718b(_0x51f5d4._0x49611c)]=_0x259b6e,this[_0x26718b(_0x51f5d4._0xc0142a)]&&this[_0x26718b(_0x51f5d4._0x410a3b)][_0x26718b(_0x51f5d4._0x15cfd9)](_0x6e7a53=>{_0x6e7a53['diffHeight']=_0x259b6e;});}get['clipOutSide'](){return this['options']['clipOutSide'];}set[_0x35a251(0xa20)](_0x1aecdc){const _0x35c69c={_0x50b397:0xf86},_0x1aa303=_0x35a251;this['options']['clipOutSide']=_0x1aecdc,this['_map']&&this['_positions']&&this[_0x1aa303(_0x35c69c._0x50b397)](this['_positions']);}[_0x35a251(0xefe)](_0x3bf918){const _0x36f88c={_0x533485:0x2a6,_0x1a179b:0xb13},_0x5a4b09=_0x35a251;this[_0x5a4b09(0xd79)]['scene']['globe']['clippingPlanes']&&(this['_map']['scene'][_0x5a4b09(0x22f)][_0x5a4b09(0x85d)][_0x5a4b09(_0x36f88c._0x533485)]=_0x3bf918),this[_0x5a4b09(_0x36f88c._0x1a179b)]&&(this['_graphicLayer']['show']=_0x3bf918);}[_0x35a251(0x700)](){}[_0x35a251(0x97b)](){const _0x4dd9bd={_0x2f4ffe:0xe86,_0x408ae9:0xe1e,_0x52fa9c:0xf86},_0x40626b=_0x35a251;this['_graphicLayer']=new GraphicLayer({...this[_0x40626b(_0x4dd9bd._0x2f4ffe)],'private':!![]}),this[_0x40626b(0xd79)][_0x40626b(0x6f7)](this['_graphicLayer']),this['options']['positions']&&this[_0x40626b(_0x4dd9bd._0x2f4ffe)]['positions'][_0x40626b(_0x4dd9bd._0x408ae9)]>0x0&&this[_0x40626b(_0x4dd9bd._0x52fa9c)](this['options']['positions']);}['_removedHook'](){const _0x533aa3=_0x35a251;this['clear'](),this[_0x533aa3(0xb13)]&&(this['_map'][_0x533aa3(0xad7)](this['_graphicLayer']),delete this['_graphicLayer']);}['setPositions'](_0xc6eff6){const _0x3eceac={_0x197aa1:0x386,_0x2d04f4:0x702,_0x34ef6b:0x58a,_0x49f9a4:0xe1e,_0x52caec:0x8eb,_0x155a24:0xd79},_0x29ca38=_0x35a251;this[_0x29ca38(_0x3eceac._0x197aa1)]();if(!_0xc6eff6||_0xc6eff6['length']<0x3){logError$1(_0x29ca38(_0x3eceac._0x2d04f4),_0xc6eff6);return;}_0xc6eff6=LngLatArray['toCartesians'](_0xc6eff6),this[_0x29ca38(_0x3eceac._0x34ef6b)]=_0xc6eff6;const _0xb70d08=[],_0x5e9522=_0xc6eff6[_0x29ca38(_0x3eceac._0x49f9a4)];let _0x57d5c6;const _0x95feba=formatNum$1(getAngle(_0xc6eff6[0x0],_0xc6eff6[0x1]),0x2);if(_0x95feba>-0.02&&_0x95feba<0.02)_0x57d5c6=![];else{const _0x486b97=formatNum$1(getAngle(_0xc6eff6[0x0],_0xc6eff6[0x2]),0x2);_0x57d5c6=_0x95feba<_0x486b97;}this['clipOutSide']&&(_0x57d5c6=!_0x57d5c6);for(let _0xc1e9d8=0x0;_0xc1e9d8<_0x5e9522;++_0xc1e9d8){const _0x34bf80=(_0xc1e9d8+0x1)%_0x5e9522,_0x52276d=Cesium__namespace['Cartesian3']['midpoint'](_0xc6eff6[_0xc1e9d8],_0xc6eff6[_0x34bf80],new Cesium__namespace['Cartesian3']()),_0x164054=Cesium__namespace['Cartesian3']['normalize'](_0x52276d,new Cesium__namespace[(_0x29ca38(0x8eb))]());let _0xabc709;_0x57d5c6?_0xabc709=Cesium__namespace['Cartesian3']['subtract'](_0xc6eff6[_0xc1e9d8],_0x52276d,new Cesium__namespace['Cartesian3']()):_0xabc709=Cesium__namespace[_0x29ca38(0x8eb)]['subtract'](_0xc6eff6[_0x34bf80],_0x52276d,new Cesium__namespace[(_0x29ca38(_0x3eceac._0x52caec))]());_0xabc709=Cesium__namespace['Cartesian3']['normalize'](_0xabc709,_0xabc709);let _0x130fa9=Cesium__namespace['Cartesian3']['cross'](_0xabc709,_0x164054,new Cesium__namespace[(_0x29ca38(0x8eb))]());_0x130fa9=Cesium__namespace['Cartesian3'][_0x29ca38(0xebd)](_0x130fa9,_0x130fa9);const _0x42373a=new Cesium__namespace['Plane'](_0x130fa9,0x0),_0x599b33=Cesium__namespace[_0x29ca38(0xefc)]['getPointDistance'](_0x42373a,_0x52276d);_0xb70d08['push'](new Cesium__namespace['ClippingPlane'](_0x130fa9,_0x599b33));}this[_0x29ca38(_0x3eceac._0x155a24)][_0x29ca38(0xc60)]['globe']['clippingPlanes']=new Cesium__namespace['ClippingPlaneCollection']({'planes':_0xb70d08,'edgeWidth':this['options']['edgeWidth']??0x1,'edgeColor':this['options']['edgeColor']??Cesium__namespace['Color']['WHITE'],'unionClippingRegions':this['clipOutSide'],'enabled':!![]});if(this['options']['image']){const _0xcfe354=new Pit({'style':this[_0x29ca38(0xe86)],'positions':_0xc6eff6});this['_graphicLayer']['addGraphic'](_0xcfe354);}}['clear'](){const _0x198681={_0x1d2939:0x58a,_0x5dbd68:0xb13,_0x182da0:0xb13,_0x170689:0x85d,_0x36f6a3:0x22f},_0x3c60c8=_0x35a251;var _0x31f067,_0x26d54d;if(!this['_map'])return;this[_0x3c60c8(_0x198681._0x1d2939)]=null,this[_0x3c60c8(_0x198681._0x5dbd68)]&&this[_0x3c60c8(_0x198681._0x182da0)]['clear'](),(_0x31f067=this['_map']['scene']['globe'])!==null&&_0x31f067!==void 0x0&&(_0x26d54d=_0x31f067['clippingPlanes'])!==null&&_0x26d54d!==void 0x0&&_0x26d54d['enabled']&&(this['_map']['scene'][_0x3c60c8(0x22f)][_0x3c60c8(_0x198681._0x170689)]['enabled']=![]),this['_map']['scene'][_0x3c60c8(_0x198681._0x36f6a3)]['clippingPlanes']=undefined;}}var TerrainEditVS='in\x20vec3\x20position;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20pos\x20=\x20vec4(position.xyz,\x201.0);\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20pos;\x0a}\x0a',TerrainEditFS='\x0a#ifdef\x20GL_FRAGMENT_PRECISION_HIGH\x0aprecision\x20highp\x20float;\x0a#else\x0aprecision\x20mediump\x20float;\x0a#endif\x0a\x0avoid\x20main()\x20{\x0a\x20\x20out_FragColor\x20=\x20vec4(1.0,\x200.0,\x200.0,\x201.0);\x0a}\x0a';class TerrainOldEditBase extends BaseThing{constructor(_0x1fc9dc={}){const _0x195c8b={_0x4abfe1:0xd5a},_0x3d2f36=_0x35a251;super(_0x1fc9dc),!isMars3DCesium&&logError$1(_0x3d2f36(0x5c2),this),this['heightVal']=_0x1fc9dc['heightVal']??new Cesium__namespace['Cartesian4'](0x0,0x0,0x0,0x1f4),this['_maxCanvasSize']=_0x1fc9dc[_0x3d2f36(_0x195c8b._0x4abfe1)]??0x1000,this['_areaList']=[];}get['analysisOptions'](){const _0x57417a={_0x59db11:0x2df},_0x2e74cd=_0x35a251;var _0x5ff178,_0x3f82fb,_0x3f2bb8,_0x19818e,_0x2e8ce2,_0x3f0d10;return(_0x5ff178=this['_map'])===null||_0x5ff178===void 0x0?void 0x0:(_0x3f82fb=_0x5ff178['scene'])===null||_0x3f82fb===void 0x0?void 0x0:(_0x3f2bb8=_0x3f82fb['globe'])===null||_0x3f2bb8===void 0x0?void 0x0:(_0x19818e=_0x3f2bb8['_surface'])===null||_0x19818e===void 0x0?void 0x0:(_0x2e8ce2=_0x19818e[_0x2e74cd(_0x57417a._0x59db11)])===null||_0x2e8ce2===void 0x0?void 0x0:(_0x3f0d10=_0x2e8ce2['marsOptions'])===null||_0x3f0d10===void 0x0?void 0x0:_0x3f0d10['flood'];}get['list'](){const _0x4e69d0=_0x35a251;return this[_0x4e69d0(0x68c)];}get[_0x35a251(0xbd3)](){const _0x26bc81=_0x35a251;var _0x4bcc15;return((_0x4bcc15=this['analysisOptions'])===null||_0x4bcc15===void 0x0?void 0x0:_0x4bcc15[_0x26bc81(0xbd3)])??!![];}set['showElseArea'](_0x1893d9){this['analysisOptions']['showElseArea']=_0x1893d9;}get[_0x35a251(0xb35)](){const _0x4fe3a7=_0x35a251;return this[_0x4fe3a7(0xe1e)]>0x0?this[_0x4fe3a7(0x68c)][0x0]['positions']:null;}set['positions'](_0x2ad4b5){this['clear'](),this['addArea'](_0x2ad4b5);}get['length'](){const _0x2490e0=_0x35a251;if(this[_0x2490e0(0x68c)]){var _0x203eed;return(_0x203eed=this['_areaList'])===null||_0x203eed===void 0x0?void 0x0:_0x203eed[_0x2490e0(0xe1e)];}else return 0x0;}[_0x35a251(0xefe)](_0x5bb9a1){this['analysisOptions']['enabled']=_0x5bb9a1;}['_addedHook'](){const _0x1da5d7={_0x4a3fc5:0xbd3,_0x310d48:0xd16},_0x4ce91f=_0x35a251;this['analysisOptions']['showElseArea']=this[_0x4ce91f(0xe86)][_0x4ce91f(_0x1da5d7._0x4a3fc5)]??!![],this['options']['positions']&&this[_0x4ce91f(_0x1da5d7._0x310d48)](this['options']['positions']),this[_0x4ce91f(0xe86)]['dynamicView']&&(this['_scopeIds_last']=[],this['_map']['on'](EventType['preUpdate'],this['_map_preUpdateHandler'],this));}['_removedHook'](){const _0x284758={_0x54ee38:0xe86,_0x2f0bf4:0x14c,_0x5d7c55:0xd79,_0x14367b:0xb7e},_0x17b4bb=_0x35a251;this[_0x17b4bb(_0x284758._0x54ee38)][_0x17b4bb(_0x284758._0x2f0bf4)]&&(this[_0x17b4bb(_0x284758._0x5d7c55)]['off'](EventType['preUpdate'],this['_map_preUpdateHandler'],this),this[_0x17b4bb(_0x284758._0x14367b)]=[]),this['clear'](),this['analysisOptions']['enabled']=![],this['analysisOptions']['inverMatrix']=Cesium__namespace['Matrix4']['IDENTITY'],this['analysisOptions']['polygonTexture']=undefined;}['clear'](){const _0x56295b=_0x35a251;this[_0x56295b(0x68c)]=[],this['_clearDraw']();}[_0x35a251(0xdc8)](){const _0x3a3a20={_0x410a83:0x6f8,_0x466681:0x3b8,_0x4152aa:0xb1a,_0x43df88:0x8fe},_0x9580b=_0x35a251;this[_0x9580b(_0x3a3a20._0x410a83)]['inverMatrix']=Cesium__namespace['Matrix4'][_0x9580b(_0x3a3a20._0x466681)],this['analysisOptions']['polygonTexture']=undefined,this[_0x9580b(_0x3a3a20._0x4152aa)]&&(this['_polygonTexture']['destroy'](),delete this['_polygonTexture']),this[_0x9580b(_0x3a3a20._0x43df88)]&&(this[_0x9580b(_0x3a3a20._0x43df88)]['destroy'](),delete this['_framebuffer']);}['getAreaById'](_0x11d122){if(!isNumber(_0x11d122))return _0x11d122;for(let _0x49dd5d=0x0;_0x49dd5d{const _0x55b63c=_0x13fda2;if(!_0xec50d2['show']||!_0xec50d2['scope']||!_0xec50d2['positions'])return;const _0x3859c4=Cesium__namespace['BoundingSphere']['fromPoints'](_0xec50d2[_0x55b63c(_0x5ed3c8._0x478ba0)]);Cesium__namespace['Cartesian3']['add'](_0xbe708d,_0x3859c4['center'],_0xbe708d),_0x4905c1['push'](_0xec50d2);});const _0x5ca7e0=this['_map']['scene'][_0x13fda2(_0xd54d34._0x285b51)];if(_0x4905c1[_0x13fda2(_0xd54d34._0x2e48ad)]===0x0)return;const _0x453e4e=Cesium__namespace['Cartesian3'][_0x13fda2(0xddc)](_0xbe708d,0x1/_0x4905c1['length'],new Cesium__namespace[(_0x13fda2(_0xd54d34._0x301b10))]()),_0x50ae01=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x453e4e);this['_inverMatrix']=Cesium__namespace['Matrix4']['inverse'](_0x50ae01,new Cesium__namespace['Matrix4']());let _0xd53325=0x5f5e0ff,_0x110a8f=0x5f5e0ff,_0x5f4980=-0x5f5e0ff,_0x2f867b=-0x5f5e0ff;_0x4905c1[_0x13fda2(_0xd54d34._0x5e9187)](_0x7c4343=>{const _0x1428a3=_0x13fda2;let _0x23e358=new Cesium__namespace['PolygonGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x7c4343['positions'])});_0x23e358=Cesium__namespace['PolygonGeometry']['createGeometry'](_0x23e358);const _0x391d9f=_0x23e358[_0x1428a3(0x9b)],_0x2457d6=_0x23e358[_0x1428a3(0x523)][_0x1428a3(0xb61)]['values'],_0xe506a5=_0x2457d6['length'],_0x21edcd=[],_0xde82a=[];for(let _0x29920a=0x0;_0x29920a<_0xe506a5;_0x29920a+=0x3){const _0x3d168a=new Cesium__namespace['Cartesian3'](_0x2457d6[_0x29920a],_0x2457d6[_0x29920a+0x1],_0x2457d6[_0x29920a+0x2]),_0x40ab60=Cesium__namespace['Matrix4'][_0x1428a3(_0x2ccc3b._0x2c8fb8)](this['_inverMatrix'],_0x3d168a,new Cesium__namespace[(_0x1428a3(_0x2ccc3b._0x962ffe))]());_0x40ab60['z']=0x0,_0x21edcd['push'](_0x40ab60),_0xde82a[_0x1428a3(0x6de)](_0x40ab60['x']),_0xde82a['push'](_0x40ab60['y']),_0xde82a[_0x1428a3(_0x2ccc3b._0x529653)](_0x40ab60['z']),_0xd53325>=_0x40ab60['x']&&(_0xd53325=_0x40ab60['x']),_0x110a8f>=_0x40ab60['y']&&(_0x110a8f=_0x40ab60['y']),_0x5f4980<=_0x40ab60['x']&&(_0x5f4980=_0x40ab60['x']),_0x2f867b<=_0x40ab60['y']&&(_0x2f867b=_0x40ab60['y']);}_0x7c4343[_0x1428a3(_0x2ccc3b._0x473248)]=_0x21edcd;const _0xfd8d25=new Float64Array(_0xde82a),_0xbbc089=Cesium__namespace[_0x1428a3(_0x2ccc3b._0x4dde75)]['fromVertices'](_0xfd8d25),_0x5aff29=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x1428a3(0x68e)],'componentsPerAttribute':0x3,'values':_0xfd8d25})},'indices':_0x391d9f,'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':_0xbbc089}),_0x5d9c87=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x5ca7e0,'vertexShaderSource':TerrainEditVS,'fragmentShaderSource':TerrainEditFS,'attributeLocations':{'position':0x0}}),_0x56c7f7=Cesium__namespace['VertexArray']['fromGeometry']({'context':_0x5ca7e0,'geometry':_0x5aff29,'attributeLocations':_0x5d9c87['_attributeLocations'],'bufferUsage':Cesium__namespace[_0x1428a3(_0x2ccc3b._0x19ec23)]['STATIC_DRAW'],'interleave':!![]}),_0x360c21=new Cesium__namespace['RenderState']();_0x360c21['depthRange'][_0x1428a3(0x170)]=-0xf4240,_0x360c21[_0x1428a3(0x436)]['far']=0xf4240,_0x7c4343['drawAreaCommand']=new Cesium__namespace['DrawCommand']({'boundingVolume':_0xbbc089,'primitiveType':Cesium__namespace['PrimitiveType'][_0x1428a3(_0x2ccc3b._0x56594a)],'vertexArray':_0x56c7f7,'shaderProgram':_0x5d9c87,'renderState':_0x360c21,'pass':Cesium__namespace[_0x1428a3(_0x2ccc3b._0x357043)]['TRANSLUCENT']});});const _0x2e2b6d=(_0x2f867b-_0x110a8f)/(_0x5f4980-_0xd53325),_0x1a772f=[_0xd53325,_0x110a8f,_0x5f4980,_0x2f867b],_0x252073=0x1d4c0,_0x345d16={'viewMatrix':Cesium__namespace[_0x13fda2(_0xd54d34._0x3c2d8a)]['IDENTITY'],'inverseViewMatrix':Cesium__namespace['Matrix4']['IDENTITY'],'frustum':new Cesium__namespace['OrthographicOffCenterFrustum'](),'positionCartographic':{'height':0x0,'latitude':0x0,'longitude':0x0},'positionWC':new Cesium__namespace['Cartesian3'](0x0,0x0,_0x252073/0x2),'directionWC':new Cesium__namespace['Cartesian3'](0x0,0x0,-0x1),'upWC':new Cesium__namespace['Cartesian3'](0x0,0x1,0x0),'rightWC':new Cesium__namespace['Cartesian3'](0x1,0x0,0x0),'viewProjectionMatrix':Cesium__namespace['Matrix4'][_0x13fda2(_0xd54d34._0x331d43)]};_0x345d16[_0x13fda2(_0xd54d34._0x366207)]['left']=_0x1a772f[0x0],_0x345d16['frustum']['top']=_0x1a772f[0x3],_0x345d16[_0x13fda2(0x19c)]['right']=_0x1a772f[0x2],_0x345d16['frustum'][_0x13fda2(_0xd54d34._0x1b1b56)]=_0x1a772f[0x1],_0x345d16['frustum']['near']=0.1,_0x345d16['frustum']['far']=-_0x252073,this['_tailorRect']=new Cesium__namespace['Cartesian4'](_0x1a772f[0x0],_0x1a772f[0x1],_0x1a772f[0x2]-_0x1a772f[0x0],_0x1a772f[0x3]-_0x1a772f[0x1]);let _0xd07429,_0x7f969d;_0x2e2b6d>0x1?(_0xd07429=this[_0x13fda2(0x21e)]/_0x2e2b6d,_0x7f969d=this['_maxCanvasSize']):(_0xd07429=this['_maxCanvasSize'],_0x7f969d=_0xd07429*_0x2e2b6d);const _0x4c1045=new Cesium__namespace['Texture']({'context':_0x5ca7e0,'width':_0xd07429,'height':_0x7f969d,'pixelFormat':Cesium__namespace[_0x13fda2(_0xd54d34._0x1a6551)]['RGBA'],'pixelDatatype':Cesium__namespace[_0x13fda2(0xc3d)]['HALF_FLOAT'],'flipY':![]});this['_polygonTexture']=_0x4c1045,this[_0x13fda2(0x6f8)]['polygonTexture']=this['_polygonTexture'],this['_framebuffer']=new Cesium__namespace['Framebuffer']({'context':_0x5ca7e0,'colorTextures':[_0x4c1045],'destroyAttachments':![]});const _0x20cff0=new Cesium__namespace['ClearCommand']({'color':new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),'framebuffer':this[_0x13fda2(0x8fe)]}),_0x4918a6=new Cesium__namespace['PassState'](_0x5ca7e0);_0x4918a6['viewport']=new Cesium__namespace[(_0x13fda2(_0xd54d34._0x116e3d))](0x0,0x0,_0xd07429,_0x7f969d);const _0x3d7242=_0x5ca7e0['uniformState'];_0x3d7242[_0x13fda2(_0xd54d34._0x39c004)](_0x345d16),_0x20cff0['execute'](_0x5ca7e0),_0x4905c1[_0x13fda2(0xdbd)](_0x3c70dc=>{const _0x4a1402=_0x13fda2,_0x44e5a2=_0x3c70dc[_0x4a1402(_0x3838f5._0x165b41)];_0x44e5a2&&(_0x3d7242['updatePass'](_0x44e5a2['pass']),_0x44e5a2['framebuffer']=this['_framebuffer'],_0x44e5a2[_0x4a1402(_0x3838f5._0x2ee4ca)](_0x5ca7e0,_0x4918a6));}),this[_0x13fda2(_0xd54d34._0x2d416f)]();}['_beginAnalysis'](){const _0x1e5263={_0x1d8272:0x6f8},_0x26a994=_0x35a251;this[_0x26a994(_0x1e5263._0x1d8272)]['inverMatrix']=this['_inverMatrix'],this['analysisOptions'][_0x26a994(0x7bf)]=this['_polygonTexture'],this[_0x26a994(_0x1e5263._0x1d8272)]['enabled']=!![],this['analysisOptions']['floodRect']=this['_tailorRect'],this['analysisOptions']['globe']=![];}[_0x35a251(0x88d)](){const _0x2cacb5={_0x3fcca6:0xb7e},_0x2392c9=_0x35a251;if(!this[_0x2392c9(0xd79)]||!this['_areaList']||this['_areaList'][_0x2392c9(0xe1e)]===0x0&&this[_0x2392c9(0xb7e)]['length']===0x0)return;const _0x4e9231=[];this['_areaList']['forEach'](_0x29f0b1=>{const _0x4a5877=_0x2392c9;if(!_0x29f0b1['show'])return;_0x29f0b1[_0x4a5877(0x251)]=this['_isInSceneCamera'](_0x29f0b1['positions']),_0x29f0b1['scope']&&_0x4e9231['push'](_0x29f0b1['id']);});let _0x277af0=_0x4e9231['length']!==this[_0x2392c9(_0x2cacb5._0x3fcca6)]['length'];if(!_0x277af0)for(let _0x950294=0x0;_0x950294<_0x4e9231['length'];_0x950294++){if(this['_scopeIds_last'][_0x950294]!==_0x4e9231[_0x950294]){_0x277af0=!![];break;}}_0x277af0&&(this['_update'](),this['_scopeIds_last']=Cesium__namespace[_0x2392c9(0xd61)](_0x4e9231));}['_isInSceneCamera'](_0x5b1249){const _0x2d431d={_0xc023c8:0x7d,_0x17be8f:0xcaf,_0x876f9e:0x390,_0x381542:0xeed},_0x4eac10=_0x35a251;if(!_0x5b1249||_0x5b1249['length']===0x0)return![];const _0x5acb09=this['_map']['scene'],_0x7ada90=this[_0x4eac10(0xd79)]['getCenter'](),_0x34bb61=_0x5acb09[_0x4eac10(_0x2d431d._0xc023c8)][_0x4eac10(0x13f)];for(let _0x29a5da=0x0;_0x29a5da<_0x5b1249['length'];_0x29a5da++){const _0x498efb=_0x5b1249[_0x29a5da],_0x308f6d=Cesium__namespace[_0x4eac10(_0x2d431d._0x17be8f)]['wgs84ToWindowCoordinates'](_0x5acb09,_0x498efb,new Cesium__namespace['Cartesian2']());if(_0x308f6d&&_0x308f6d['x']>=0x0&&_0x308f6d['x']<=_0x5acb09['context']['drawingBufferWidth']&&_0x308f6d['y']>=0x0&&_0x308f6d['y']<=_0x5acb09[_0x4eac10(_0x2d431d._0x876f9e)]['drawingBufferHeight'])return!![];if(_0x34bb61&&_0x34bb61['x']>=0x0&&Cesium__namespace['Cartesian3']['distance'](_0x498efb,_0x34bb61)<0x30d40)return!![];if(_0x7ada90&&_0x7ada90['x']>=0x0&&Cesium__namespace['Cartesian3'][_0x4eac10(_0x2d431d._0x381542)](_0x498efb,_0x7ada90)<0x30d40)return!![];}return![];}}var GlobeFlodByMaterial='uniform\x20vec4\x20u_mars_flood_val;//(基础淹没高度,当前淹没高度,最大淹没高度,默认高度差(最大淹没高度\x20-\x20基础淹没高度))\x0auniform\x20vec4\x20u_mars_flood_color;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.alpha\x20=\x20(materialInput.height\x20<\x20u_mars_flood_val.y)\x20?\x20u_mars_flood_color.a\x20:\x200.0;\x0a\x20\x20material.diffuse\x20=\x20u_mars_flood_color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a';const FloodByMaterialType='FlodByMaterial';class FloodByMaterial extends TerrainOldEditBase{constructor(_0x8f1599={}){super(_0x8f1599),this['color']=this['options']['color']??new Cesium__namespace['Color'](0.15,0.7,0.95,0.5);}get['height'](){return this['heightVal']['y']??this['_minHeight'];}set['height'](_0x446ef0){const _0x351d48=_0x35a251;this['heightVal']['y']=_0x446ef0,this[_0x351d48(0x6f8)]['heightVal']['y']=_0x446ef0;}get[_0x35a251(0x6a2)](){return this['options']['speed']||0x1;}set['speed'](_0x4ccbb9){const _0x3caeff={_0x534780:0x6a2},_0xbf98ec=_0x35a251;this['options'][_0xbf98ec(_0x3caeff._0x534780)]=Number(_0x4ccbb9);}get[_0x35a251(0x9db)](){return this['_color'];}set[_0x35a251(0x9db)](_0x35f714){this['_color']=getCesiumColor(_0x35f714),this['analysisOptions']&&(this['analysisOptions']['color']=this['_color']);}['addArea'](_0x3af196,_0x21c892){return _0x3af196=setPositionsHeight(_0x3af196,0x0),super['addArea'](_0x3af196,_0x21c892);}['setOptions'](_0x1985e6){const _0x22769c={_0x4c3d93:0xf9b,_0x5ee8f9:0xaa2,_0x1a3839:0x9d7,_0xc7fdaa:0x9db},_0x4fe9f2=_0x35a251;_0x1985e6&&(this['options']={...this[_0x4fe9f2(0xe86)],..._0x1985e6});this[_0x4fe9f2(_0x22769c._0x4c3d93)]();let _0x37ed2f=this['options']['minHeight'],_0x10081d=this['options']['maxHeight'];if(!Cesium__namespace[_0x4fe9f2(_0x22769c._0x5ee8f9)](_0x37ed2f)){logError$1('minHeight\x20请传入有效数值!',_0x37ed2f);return;}if(!Cesium__namespace['defined'](_0x10081d)){logError$1('maxHeight\x20请传入有效数值!',_0x10081d);return;}if(_0x37ed2f>_0x10081d){const _0x49cb17=_0x37ed2f;_0x37ed2f=_0x10081d,_0x10081d=_0x49cb17;}return this['_minHeight']=_0x37ed2f,this['_maxHeight']=_0x10081d,this[_0x4fe9f2(0xe5e)]=new Cesium__namespace['Cartesian4'](this[_0x4fe9f2(0xe10)],this[_0x4fe9f2(0xe10)],this['_maxHeight'],this[_0x4fe9f2(_0x22769c._0x1a3839)]-this['_minHeight']),this['analysisOptions']['heightVal']['x']=this[_0x4fe9f2(0xe5e)]['x'],this['analysisOptions']['heightVal']['y']=this['heightVal']['y'],this['analysisOptions']['color']=this[_0x4fe9f2(_0x22769c._0xc7fdaa)],this['analysisOptions']['globe']=![],this['analysisOptions'][_0x4fe9f2(0xbd3)]=this[_0x4fe9f2(0xe86)]['showElseArea']??!![],this[_0x4fe9f2(0xd79)][_0x4fe9f2(0xc60)]['globe']['material']=Cesium__namespace[_0x4fe9f2(0x100)]['fromType'](FloodByMaterialType),this;}['_enabledHook'](_0x5cd4e0){const _0x44f5ff={_0x1800f1:0xefe,_0x3cbae0:0xd79,_0x12a9a7:0xd79},_0x4e20ec=_0x35a251;var _0x39d232;super[_0x4e20ec(_0x44f5ff._0x1800f1)](_0x5cd4e0);if(_0x5cd4e0)this[_0x4e20ec(_0x44f5ff._0x3cbae0)]['scene']['globe']['material']=Cesium__namespace['Material'][_0x4e20ec(0xe0f)](FloodByMaterialType);else((_0x39d232=this[_0x4e20ec(_0x44f5ff._0x12a9a7)][_0x4e20ec(0xc60)]['globe']['material'])===null||_0x39d232===void 0x0?void 0x0:_0x39d232['type'])===FloodByMaterialType&&(this['_map']['scene']['globe']['material']=null);}['start'](){const _0x3ec60d=_0x35a251;this['stop'](),this[_0x3ec60d(0x5dd)]=!![],this['fire'](EventType['start']),this['_map']['on'](EventType[_0x3ec60d(0xf05)],this[_0x3ec60d(0x5f3)],this);}['_onClockTickHandler'](_0x116eb4){const _0x5cbc60={_0x2c33b8:0xe5e,_0x2860f4:0xe5e},_0x26fc0e=_0x35a251;this[_0x26fc0e(_0x5cbc60._0x2c33b8)]['y']+=this['speed']/0x32;if(this['heightVal']['y']>this['heightVal']['z']){this[_0x26fc0e(_0x5cbc60._0x2c33b8)]['y']=this['heightVal']['z'],this['stop']();return;}if(this['heightVal']['y']{_0x446112['diffHeight']=_0x4c6c2f;});}['_enabledHook'](_0x4a21ed){const _0x300aae={_0x23f8a5:0xb13},_0x16d871=_0x35a251;this['analysisOptions']['enabled']=_0x4a21ed,this[_0x16d871(0xb13)]&&(this[_0x16d871(_0x300aae._0x23f8a5)]['show']=_0x4a21ed);}['_addedHook'](){const _0x5314a0={_0x5c1065:0x895},_0x42d2bd=_0x35a251;!this['_map']['scene']['globe'][_0x42d2bd(_0x5314a0._0x5c1065)]&&(this[_0x42d2bd(0xd79)]['scene']['globe']['depthTestAgainstTerrain']=!![],this['_hasChangeDepthTestAgainstTerrain']=!![]),this['analysisOptions']['enabled']=!![],this['_graphicLayer']=new GraphicLayer({...this['options'],'private':!![]}),this['_map'][_0x42d2bd(0x6f7)](this['_graphicLayer']),super['_addedHook']();}['_removedHook'](){const _0x356a0a={_0xc77774:0x2a6,_0x462dc1:0xb13},_0x5af8fc=_0x35a251;this['clear'](),this['analysisOptions'][_0x5af8fc(_0x356a0a._0xc77774)]=![],this[_0x5af8fc(0x6f8)]['inverMatrix']=Cesium__namespace['Matrix4']['IDENTITY'],this['analysisOptions']['polygonTexture']=undefined,this[_0x5af8fc(0xd79)]['removeLayer'](this[_0x5af8fc(_0x356a0a._0x462dc1)],!![]),delete this[_0x5af8fc(_0x356a0a._0x462dc1)],this['_hasChangeDepthTestAgainstTerrain']&&(this[_0x5af8fc(0xd79)]['scene']['globe']['depthTestAgainstTerrain']=![],this[_0x5af8fc(0xd8f)]=![]);}[_0x35a251(0x386)](){const _0x44ec77={_0x540290:0xe8b,_0x231c60:0x386},_0x5f160=_0x35a251;this['_map']['scene']['globe']['_surface']['tileProvider'][_0x5f160(_0x44ec77._0x540290)]['resetClipValue'](),super[_0x5f160(_0x44ec77._0x231c60)](),this['_graphicLayer']['clear']();}['_addAreaHook'](_0x328126,_0x1964c8){const _0x34d1eb=_0x35a251;this[_0x34d1eb(0xe86)][_0x34d1eb(0xdb2)]&&(_0x328126['pitPrimitive']=new Pit({'style':{...this[_0x34d1eb(0xe86)],..._0x1964c8},'positions':_0x328126['positions_original']}),this['_graphicLayer']['addGraphic'](_0x328126['pitPrimitive']));}[_0x35a251(0x9b6)](_0x2226fa){const _0x225f25=_0x35a251;_0x2226fa!==null&&_0x2226fa!==void 0x0&&_0x2226fa[_0x225f25(0x213)]&&(this['_graphicLayer']['removeGraphic'](_0x2226fa['pitPrimitive'],!![]),delete _0x2226fa['pitPrimitive']);}['_beginAnalysis'](){const _0x2abb41={_0x49eb93:0xb99},_0x6b11c4=_0x35a251;this['analysisOptions']['enabled']=!![],this['analysisOptions']['inverMatrix']=this[_0x6b11c4(_0x2abb41._0x49eb93)],this['analysisOptions']['polygonTexture']=this['_polygonTexture'],this[_0x6b11c4(0x6f8)]['tailorRect']=this['_tailorRect'];}}class ContourLine extends TerrainOldEditBase{constructor(_0x2d0351={}){const _0x350687={_0x3c7324:0xf33,_0x18f73e:0x7e4,_0x55b58b:0x180,_0x3d054b:0xa5d,_0x2a8d49:0xf1d,_0x5b86b4:0x5a7,_0xa1ad07:0xd82,_0x34951a:0x7b4},_0x5b42ff=_0x35a251;super(_0x2d0351),this['_contourShow']=_0x2d0351['contourShow']??!![],this['_contourSpacing']=_0x2d0351['spacing']??0x64,this[_0x5b42ff(_0x350687._0x3c7324)]=_0x2d0351[_0x5b42ff(0xf48)]??1.5,this[_0x5b42ff(_0x350687._0x18f73e)]=getCesiumColor(_0x2d0351['color'],Cesium__namespace['Color'][_0x5b42ff(0x47a)]),this['_shadingType']=_0x2d0351['shadingType']??'none',this['_shadingAlpha']=_0x2d0351[_0x5b42ff(_0x350687._0x55b58b)]??0.6,this['colorScheme']=_0x2d0351[_0x5b42ff(_0x350687._0x3d054b)]||{'elevation':{'step':[0x0,0.045,0.1,0.15,0.37,0.54,0x1],'color':['#000000','#2747E0','#D33B7D',_0x5b42ff(_0x350687._0x2a8d49),'#FF9742','#FF9742','#ffd700']},'slope':{'step':[0x0,0.29,0.5,Math['sqrt'](0x2)/0x2,0.87,0.91,0x1],'color':[_0x5b42ff(_0x350687._0x5b86b4),_0x5b42ff(0xd82),'#D33B7D','#D33038','#FF9742',_0x5b42ff(0x7b4),'#ffd700']},'aspect':{'step':[0x0,0.2,0.4,0.6,0.8,0.9,0x1],'color':['#000000',_0x5b42ff(_0x350687._0xa1ad07),'#D33B7D',_0x5b42ff(_0x350687._0x2a8d49),'#FF9742',_0x5b42ff(_0x350687._0x34951a),'#ffd700']}},this['minHeight']=_0x2d0351['minHeight']??-0x19e,this['maxHeight']=_0x2d0351['maxHeight']??0x2249;}get['contourShow'](){const _0x2d80b3={_0x6344f1:0xec1},_0x1cad8b=_0x35a251;return this[_0x1cad8b(_0x2d80b3._0x6344f1)];}set['contourShow'](_0x203860){this['_contourShow']=_0x203860,this['updateMaterial']();}get['shadingType'](){return this['_shadingType'];}set[_0x35a251(0x810)](_0x362800){const _0x1e9ef1={_0x54ad95:0x766},_0x175145=_0x35a251;this['_shadingType']=_0x362800,this[_0x175145(_0x1e9ef1._0x54ad95)]();}get['shadingAlpha'](){return this['_shadingAlpha'];}set['shadingAlpha'](_0x14b5aa){const _0x5c84e1={_0x1c2b8c:0x766},_0x1e5e62=_0x35a251;this['_shadingAlpha']=_0x14b5aa,this[_0x1e5e62(_0x5c84e1._0x1c2b8c)]();}get[_0x35a251(0xf48)](){const _0x1d08c3=_0x35a251;return this[_0x1d08c3(0xf33)];}set['width'](_0x1e798b){const _0x582709={_0x1976d4:0xf33},_0x4c8655=_0x35a251;this[_0x4c8655(_0x582709._0x1976d4)]=_0x1e798b,this['contourUniforms']&&(this['contourUniforms']['width']=_0x1e798b);}get['spacing'](){return this['_contourSpacing'];}set[_0x35a251(0x6b9)](_0x40118e){const _0x45d9c3=_0x35a251;this['_contourSpacing']=_0x40118e,this[_0x45d9c3(0xc69)]&&(this['contourUniforms']['spacing']=_0x40118e);}get['color'](){const _0x3b28a0=_0x35a251;return this[_0x3b28a0(0x7e4)];}set['color'](_0x56c85c){const _0xbe0732={_0x3e08a7:0x9db},_0x51cccf=_0x35a251;this['_contourColor']=getCesiumColor(_0x56c85c),this['contourUniforms']&&(this['contourUniforms'][_0x51cccf(_0xbe0732._0x3e08a7)]=_0x56c85c);}['_enabledHook'](_0x2c60c7){super['_enabledHook'](_0x2c60c7),this['updateMaterial']();}['clear'](){const _0x174ee3={_0x3d9d8b:0x22f,_0x2b6452:0x519,_0x3df834:0x2df,_0x47eaa3:0xd79,_0x218ba2:0xef4,_0xbe6a86:0x42d,_0x2aed37:0x18b},_0xcd6ba2=_0x35a251;super['clear'](),this[_0xcd6ba2(0x519)]&&(this['_map']['scene'][_0xcd6ba2(_0x174ee3._0x3d9d8b)]['material']=this['_last_material'],delete this[_0xcd6ba2(_0x174ee3._0x2b6452)]),this['contourUniforms']=null,this['_map']['scene']['globe']['_surface'][_0xcd6ba2(_0x174ee3._0x3df834)]['marsOptions']['resetFloodValue'](),this[_0xcd6ba2(0x998)]&&(this[_0xcd6ba2(_0x174ee3._0x47eaa3)]['scene']['globe'][_0xcd6ba2(_0x174ee3._0x218ba2)]=![],this['_map'][_0xcd6ba2(_0x174ee3._0xbe6a86)][_0xcd6ba2(_0x174ee3._0x2aed37)]=Cesium__namespace['JulianDate']['now'](),delete this['_hasResetEnableLighting']);}[_0x35a251(0xe3f)](){const _0x65dac6={_0x4260ac:0x543,_0x5dc355:0x766},_0x1b5a39=_0x35a251;this['heightVal']=new Cesium__namespace['Cartesian4'](this['minHeight'],this['minHeight'],this[_0x1b5a39(0x571)],this['maxHeight']-this[_0x1b5a39(_0x65dac6._0x4260ac)]),this[_0x1b5a39(_0x65dac6._0x5dc355)]();}['updateMaterial'](){const _0x3130f5={_0x137e96:0x6b5,_0x36bf0f:0xae5,_0x38d912:0xa8b,_0x21314a:0xe24,_0x689a7c:0xa8b,_0x59c8c2:0x100,_0x2741f9:0x9f8,_0x5ca797:0x100,_0x3011c9:0xa8b,_0x18b847:0xe0f,_0x39a1a8:0x4a4,_0x2905f1:0xd79,_0x3ff2dd:0xd79,_0x1a8bbf:0x579,_0x58b74e:0x23b,_0x442c09:0xd79},_0x54b42e=_0x35a251;let _0x8eda9e,_0x186c04,_0x255a48;const _0xe69c86=this[_0x54b42e(0x494)];if(this['contourShow']){if(_0xe69c86==='elevation')_0x8eda9e=this['getElevationContourMaterial'](),_0x255a48=_0x8eda9e[_0x54b42e(_0x3130f5._0x137e96)]['elevationRampMaterial']['uniforms'],_0x255a48['minimumHeight']=this[_0x54b42e(0x543)],_0x255a48['maximumHeight']=this['maxHeight'],_0x186c04=_0x8eda9e['materials'][_0x54b42e(_0x3130f5._0x36bf0f)]['uniforms'];else{if(_0xe69c86==='slope')_0x8eda9e=this['getSlopeContourMaterial'](),_0x255a48=_0x8eda9e[_0x54b42e(0x6b5)]['slopeRampMaterial'][_0x54b42e(0xa8b)],_0x186c04=_0x8eda9e['materials']['contourMaterial'][_0x54b42e(_0x3130f5._0x38d912)];else _0xe69c86==='aspect'?(_0x8eda9e=this['getAspectContourMaterial'](),_0x255a48=_0x8eda9e['materials'][_0x54b42e(_0x3130f5._0x21314a)][_0x54b42e(_0x3130f5._0x689a7c)],_0x186c04=_0x8eda9e['materials']['contourMaterial'][_0x54b42e(0xa8b)]):(_0x8eda9e=Cesium__namespace[_0x54b42e(_0x3130f5._0x59c8c2)][_0x54b42e(0xe0f)]('ElevationContour'),_0x186c04=_0x8eda9e[_0x54b42e(_0x3130f5._0x38d912)]);}_0x186c04['width']=this['_contourWidth'],_0x186c04['spacing']=this['_contourSpacing'],_0x186c04[_0x54b42e(0x9db)]=this['_contourColor'];}else{if(_0xe69c86===_0x54b42e(_0x3130f5._0x2741f9))_0x8eda9e=Cesium__namespace[_0x54b42e(_0x3130f5._0x5ca797)]['fromType']('ElevationRamp'),_0x255a48=_0x8eda9e[_0x54b42e(_0x3130f5._0x3011c9)],_0x255a48['minimumHeight']=this['minHeight'],_0x255a48['maximumHeight']=this['maxHeight'];else{if(_0xe69c86==='slope')_0x8eda9e=Cesium__namespace['Material'][_0x54b42e(_0x3130f5._0x18b847)]('SlopeRamp'),_0x255a48=_0x8eda9e['uniforms'];else _0xe69c86===_0x54b42e(0x51d)&&(_0x8eda9e=Cesium__namespace['Material']['fromType'](_0x54b42e(_0x3130f5._0x39a1a8)),_0x255a48=_0x8eda9e['uniforms']);}}_0xe69c86!==_0x54b42e(0x274)&&(_0x255a48['image']=this['getColorRamp'](_0xe69c86));if(_0xe69c86===_0x54b42e(0x80d)||_0xe69c86==='aspect'){if(!this['_map']['scene']['globe']['enableLighting']){this['_map']['scene'][_0x54b42e(0x22f)]['enableLighting']=!![];const _0x2b3903=new Date();_0x2b3903['setHours'](0xa),this[_0x54b42e(_0x3130f5._0x2905f1)]['clock']['currentTime']=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x2b3903)),this[_0x54b42e(0x998)]=!![];}}else this[_0x54b42e(0x998)]&&(this[_0x54b42e(_0x3130f5._0x3ff2dd)]['scene']['globe']['enableLighting']=![],this[_0x54b42e(0xd79)]['clock']['currentTime']=Cesium__namespace[_0x54b42e(_0x3130f5._0x1a8bbf)][_0x54b42e(_0x3130f5._0x58b74e)](),delete this['_hasResetEnableLighting']);this['contourUniforms']=_0x186c04,(!this[_0x54b42e(0x519)]||this[_0x54b42e(_0x3130f5._0x442c09)]['scene']['globe']['material'])&&(this['_last_material']=this['_map']['scene']['globe']['material']),this['_map'][_0x54b42e(0xc60)]['globe']['material']=_0x8eda9e;}['getColorRamp'](_0x3355f4){const _0x4890e2={_0x308f09:0xf48,_0x366f6b:0xe1e,_0x210183:0xbf9},_0x398b7e=_0x35a251;var _0x407cee;const _0x424e9d=document['createElement']('canvas');_0x424e9d[_0x398b7e(_0x4890e2._0x308f09)]=0x64,_0x424e9d['height']=0x1;const _0xf42e08=_0x424e9d['getContext']('2d',{'willReadFrequently':!![]});_0xf42e08['globalAlpha']=this['shadingAlpha'];const _0x4cf80b=_0xf42e08[_0x398b7e(0x1f7)](0x0,0x0,0x64,0x0),_0x4e82c7=this['colorScheme'][_0x3355f4];if((_0x4e82c7===null||_0x4e82c7===void 0x0?void 0x0:(_0x407cee=_0x4e82c7[_0x398b7e(0xbf9)])===null||_0x407cee===void 0x0?void 0x0:_0x407cee[_0x398b7e(_0x4890e2._0x366f6b)])>0x0)for(let _0x294624=0x0,_0x49dc9c=_0x4e82c7[_0x398b7e(_0x4890e2._0x210183)]['length'];_0x294624<_0x49dc9c;_0x294624++){_0x4cf80b['addColorStop'](_0x4e82c7['step'][_0x294624],_0x4e82c7[_0x398b7e(0x9db)][_0x294624]);}return _0xf42e08['fillStyle']=_0x4cf80b,_0xf42e08['fillRect'](0x0,0x0,0x64,0x1),_0x424e9d;}['getElevationContourMaterial'](){return new Cesium__namespace['Material']({'fabric':{'type':'ElevationColorContour','materials':{'contourMaterial':{'type':'ElevationContour'},'elevationRampMaterial':{'type':'ElevationRamp'}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20elevationRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':'max(contourMaterial.alpha,\x20elevationRampMaterial.alpha)'}},'translucent':![]});}['getSlopeContourMaterial'](){const _0x3db7ce={_0x203a39:0xce8,_0x314053:0xa36},_0x49674e=_0x35a251;return new Cesium__namespace['Material']({'fabric':{'type':'SlopeColorContour','materials':{'contourMaterial':{'type':_0x49674e(_0x3db7ce._0x203a39)},'slopeRampMaterial':{'type':_0x49674e(_0x3db7ce._0x314053)}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20slopeRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':_0x49674e(0x3ac)}},'translucent':![]});}['getAspectContourMaterial'](){return new Cesium__namespace['Material']({'fabric':{'type':'AspectColorContour','materials':{'contourMaterial':{'type':'ElevationContour'},'aspectRampMaterial':{'type':'AspectRamp'}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20aspectRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':'max(contourMaterial.alpha,\x20aspectRampMaterial.alpha)'}},'translucent':![]});}}class TerrainEditBase extends BaseThing{constructor(_0x30eaac={}){const _0x127e01={_0x3be326:0x5c2},_0x1ded27=_0x35a251;super(_0x30eaac),!isMars3DCesium&&logError$1(_0x1ded27(_0x127e01._0x3be326),this),this['_areaList']=[];}get['list'](){return this['_areaList'];}get['length'](){const _0x1922ff={_0x39b90b:0xe1e},_0x5a6947=_0x35a251;if(this['_areaList']){var _0x488c56;return(_0x488c56=this['_areaList'])===null||_0x488c56===void 0x0?void 0x0:_0x488c56[_0x5a6947(_0x1922ff._0x39b90b)];}else return 0x0;}['_enabledHook'](_0x1b531a){const _0x38218c={_0x5f0bad:0x6f8},_0x5b6bab=_0x35a251;this[_0x5b6bab(_0x38218c._0x5f0bad)]['enabled']=_0x1b531a;}['_addedHook'](){this['options']['area']&&this['options']['area']['forEach'](_0x15cd29=>{const _0xf9d430=_0x2767;this[_0xf9d430(0xd16)](_0x15cd29['positions'],_0x15cd29);});}['_removedHook'](){this['analysisOptions']['enabled']=![];}[_0x35a251(0x386)](){this['_areaList']=[];}['getAreaById'](_0x4e0b94){const _0x1c8d88={_0x1e27ac:0xe1e},_0x418f2d=_0x35a251;if(!isNumber(_0x4e0b94))return _0x4e0b94;for(let _0x27fa60=0x0;_0x27fa600x0){const _0x3a64d6=this['_map']['scene'][_0x2d6b40(0x22f)][_0x2d6b40(_0x4693ce._0x4d4fd9)],_0xdaa9f1=[],_0x135b4a=[],_0x880092=[];this['_areaList']['forEach'](_0x7ca02=>{const _0xf450b5=_0x2d6b40;if(!_0x7ca02[_0xf450b5(_0x4dd7a5._0x41afa7)]||!_0x7ca02[_0xf450b5(_0x4dd7a5._0xafec8e)])return;const _0x180c36=_0x3a64d6['cartesianArrayToCartographicArray'](_0x7ca02['positions']);let _0x490527=_0x180c36[0x0]['height'];_0x180c36['forEach'](_0x36845f=>{const _0x52160a=_0xf450b5;_0x490527=Math['min'](_0x490527,_0x36845f[_0x52160a(_0x287f4a._0x49732b)]);}),_0xdaa9f1['push'](_0x490527-(_0x7ca02[_0xf450b5(0x682)]||0x0)),_0x135b4a['push'](_0x180c36),_0x880092['push'](Cesium__namespace['Rectangle']['fromCartographicArray'](_0x180c36));}),_0x570a51[_0x2d6b40(0x76e)]=_0xdaa9f1,_0x570a51['rectangles']=_0x880092,_0x570a51['areas']=_0x135b4a;}else _0x570a51[_0x2d6b40(0x76e)]=undefined,_0x570a51[_0x2d6b40(0xd37)]=undefined,_0x570a51['areas']=undefined;_0x570a51['hasUpdate']=!![];}}class TerrainUplift extends TerrainEditBase{get['analysisOptions'](){const _0x2ace38={_0x46e0b6:0xd79,_0x54537c:0xf40},_0x5db28b=_0x35a251;var _0xcc8327,_0x10d9c0,_0x4ae59e,_0xebaf5a,_0x2aa0bc,_0x139008;return(_0xcc8327=this[_0x5db28b(_0x2ace38._0x46e0b6)])===null||_0xcc8327===void 0x0?void 0x0:(_0x10d9c0=_0xcc8327['scene'])===null||_0x10d9c0===void 0x0?void 0x0:(_0x4ae59e=_0x10d9c0['globe'])===null||_0x4ae59e===void 0x0?void 0x0:(_0xebaf5a=_0x4ae59e[_0x5db28b(_0x2ace38._0x54537c)])===null||_0xebaf5a===void 0x0?void 0x0:(_0x2aa0bc=_0xebaf5a['tileProvider'])===null||_0x2aa0bc===void 0x0?void 0x0:(_0x139008=_0x2aa0bc['marsOptions'])===null||_0x139008===void 0x0?void 0x0:_0x139008[_0x5db28b(0x557)];}get['showUp'](){const _0x238c61=_0x35a251;var _0x40f410;return(_0x40f410=this['analysisOptions'])===null||_0x40f410===void 0x0?void 0x0:_0x40f410[_0x238c61(0x5d5)];}set[_0x35a251(0x5d5)](_0x465091){const _0x24336e=_0x35a251;this[_0x24336e(0x6f8)]['showUp']=_0x465091;}get['upHeight'](){const _0x3ba3a2={_0x48eb67:0x409},_0x42d5b0=_0x35a251;return this['options'][_0x42d5b0(_0x3ba3a2._0x48eb67)]??0x0;}set[_0x35a251(0x409)](_0x4e3b9d){const _0x93a5be={_0x4708f3:0xe86,_0x47c7b9:0x682},_0x1c60ef=_0x35a251;this[_0x1c60ef(_0x93a5be._0x4708f3)]['upHeight']=_0x4e3b9d;if(this['_areaList']['length']>0x0){this['analysisOptions'][_0x1c60ef(_0x93a5be._0x47c7b9)]=_0x4e3b9d,this['analysisOptions'][_0x1c60ef(0x1ac)]=!![];for(let _0x58d351=0x0;_0x58d351{_0x5df882['positionsNew']=_0x21e4ac['positions'],this['_addPitGraphic'](_0x5df882,_0x468925);});}[_0x35a251(0xe55)](_0x4aa2f6,_0x410804){const _0x525cb3={_0x14e46d:0xd22,_0x59138c:0x543,_0x4c69f4:0xb13,_0x24d70a:0x8b5,_0x54ff97:0xb35},_0x2a1a8a=_0x35a251,_0x105b4c=_0x4aa2f6['positionsNew'],_0xeec6a9=[];let _0xece896=Number['MAX_VALUE'];for(let _0x53efa9=0x0,_0x41b5d6=_0x105b4c['length'];_0x53efa9<_0x41b5d6;_0x53efa9++){const _0x4c09ae=Cesium__namespace['Cartographic']['fromCartesian'](_0x105b4c[_0x53efa9]);_0xece896=Math['min'](_0xece896,_0x4c09ae['height']),_0xeec6a9['push'](_0x4c09ae['height']);}const _0x1a26ff=_0xece896-_0x410804['diffHeight'],_0x595a92=Array(_0x105b4c['length'])[_0x2a1a8a(_0x525cb3._0x14e46d)](_0x1a26ff);_0x4aa2f6[_0x2a1a8a(_0x525cb3._0x59138c)]=_0xece896,_0x4aa2f6['diffHeight']=_0x410804['diffHeight'],_0x4aa2f6[_0x2a1a8a(0x4bc)]=new PitEntity({'style':_0x410804,'data':{'height':_0x1a26ff,'minHeight':_0xece896,'positionsWall':_0x105b4c,'minimumHeights':_0x595a92,'maximumHeights':_0xeec6a9},'positions':_0x4aa2f6['positions']}),this[_0x2a1a8a(_0x525cb3._0x4c69f4)][_0x2a1a8a(_0x525cb3._0x24d70a)](_0x4aa2f6['downGraphic']);const _0x350b13=this['upHeight'];this['showUp']&&_0x350b13!==0x0&&(_0x4aa2f6['upGraphic']=new PitEntity({'style':_0x410804,'data':{'height':_0x1a26ff,'minHeight':_0xece896,'positionsWall':_0x105b4c,'minimumHeights':_0x595a92,'maximumHeights':_0xeec6a9},'positions':_0x4aa2f6[_0x2a1a8a(_0x525cb3._0x54ff97)]}),this['_graphicLayer'][_0x2a1a8a(_0x525cb3._0x24d70a)](_0x4aa2f6['upGraphic']),_0x4aa2f6['upGraphic']['setUpHeight'](_0x350b13));}['_removeAreaHook'](_0x5dc1ea){const _0x41ed1c={_0x4dfd39:0xbb1},_0x4208b2=_0x35a251;_0x5dc1ea!==null&&_0x5dc1ea!==void 0x0&&_0x5dc1ea['downGraphic']&&(this['_graphicLayer']['removeGraphic'](_0x5dc1ea['downGraphic'],!![]),delete _0x5dc1ea[_0x4208b2(0x4bc)]),_0x5dc1ea!==null&&_0x5dc1ea!==void 0x0&&_0x5dc1ea['upGraphic']&&(this['_graphicLayer']['removeGraphic'](_0x5dc1ea['upGraphic'],!![]),delete _0x5dc1ea[_0x4208b2(_0x41ed1c._0x4dfd39)]);}[_0x35a251(0x1dd)](){const _0x1648f0={_0x1058fb:0x409,_0x4965a4:0x682,_0x13efdb:0xdfb},_0x43bcdd={_0x3fad4e:0xb35},_0xa92d03=_0x35a251,_0x226ef9=this['analysisOptions'];if(this['_areaList']['length']>0x0){const _0x55f0ac=this['_map'][_0xa92d03(0xc60)]['globe'][_0xa92d03(0x3f4)],_0x3cbd70=[],_0x2f4446=[];this['_areaList']['forEach'](_0x2db598=>{const _0x3c579b=_0xa92d03;if(!_0x2db598['show']||!_0x2db598['positions'])return;const _0x6afc26=_0x55f0ac['cartesianArrayToCartographicArray'](_0x2db598[_0x3c579b(_0x43bcdd._0x3fad4e)]);_0x3cbd70['push'](_0x6afc26),_0x2f4446['push'](Cesium__namespace['Rectangle']['fromCartographicArray'](_0x6afc26));}),_0x226ef9['height']=this[_0xa92d03(_0x1648f0._0x1058fb)],_0x226ef9['rectangles']=_0x2f4446,_0x226ef9['areas']=_0x3cbd70;}else _0x226ef9[_0xa92d03(_0x1648f0._0x4965a4)]=undefined,_0x226ef9['rectangles']=undefined,_0x226ef9[_0xa92d03(_0x1648f0._0x13efdb)]=undefined;_0x226ef9['hasUpdate']=!![];}}class LimitHeight extends BaseThing{get[_0x35a251(0x87)](){return this['_layer'];}get['positions'](){return this['options']['positions'];}set['positions'](_0x387397){const _0x2e1dd9={_0x48779c:0xe86},_0x2ec422=_0x35a251;this[_0x2ec422(_0x2e1dd9._0x48779c)]['positions']=_0x387397,this[_0x2ec422(0xe91)]();}get['height'](){const _0x3c6ced=_0x35a251;return this[_0x3c6ced(0xe86)]['height']||0x0;}set[_0x35a251(0x682)](_0x405dea){const _0x171b72=_0x35a251;this['options']['height']=_0x405dea,this[_0x171b72(0xe91)]();}get[_0x35a251(0xe4b)](){return this['options']['bottomHeight']||0x0;}set['bottomHeight'](_0x309a4a){this['options']['bottomHeight']=_0x309a4a,this['_createGraphic']();}[_0x35a251(0x700)](){this['_layer']=new GraphicLayer({'private':!![]});}['_addedHook'](){const _0x420a06={_0x10e62b:0x2d0},_0x4aed12=_0x35a251;this['_map']['addLayer'](this[_0x4aed12(_0x420a06._0x10e62b)]),this[_0x4aed12(0xe86)]['positions']&&(this[_0x4aed12(0xb35)]=this['options']['positions']);}[_0x35a251(0xa9a)](){const _0x436733={_0x393b31:0x163},_0x13189b=_0x35a251;this['_graphic']&&(this['_layer']['removeGraphic'](this[_0x13189b(_0x436733._0x393b31)]),delete this[_0x13189b(0x163)]),this['_map']['removeLayer'](this[_0x13189b(0x2d0)]);}['_createGraphic'](){const _0x3d3186={_0x1cd41f:0x163,_0x1907e7:0xb35,_0x37553d:0x682,_0x289e78:0x807,_0x324c99:0x8b5},_0x83ddd9=_0x35a251;this['_graphic']&&(this['_layer']['removeGraphic'](this[_0x83ddd9(_0x3d3186._0x1cd41f)]),delete this[_0x83ddd9(0x163)]);if(!this['options']['positions'])return;const _0x11ea50=LngLatArray['toCartesians'](this['options'][_0x83ddd9(_0x3d3186._0x1907e7)]);this[_0x83ddd9(0x163)]=new PolygonPrimitive({'positions':_0x11ea50,'style':{...this['options'],'height':this['bottomHeight']+this[_0x83ddd9(_0x3d3186._0x37553d)],'diffHeight':0x2710,'perPositionHeight':![],'classification':!![],'classificationType':Cesium__namespace['ClassificationType'][_0x83ddd9(_0x3d3186._0x289e78)]},'asynchronous':![]}),this['_layer'][_0x83ddd9(_0x3d3186._0x324c99)](this[_0x83ddd9(_0x3d3186._0x1cd41f)]);}['clear'](){this['options']['positions']=null,this['_graphic']&&(this['_layer']['removeGraphic'](this['_graphic']),delete this['_graphic']);}}class ModelPlanClip extends TilesetPlanClip{get['clipTarget'](){const _0x36a310={_0x572321:0xea5},_0x28ba1f=_0x35a251;return this[_0x28ba1f(_0x36a310._0x572321)];}set['clipTarget'](_0x1d6846){const _0x215f97=_0x35a251;this['_model']=_0x1d6846,this['_inverseMatrix']=null,this['clippingPlanes']&&(this['_model']['clippingPlanes']=this[_0x215f97(0x85d)]);}get['graphic'](){return this['_graphic'];}set['graphic'](_0x14ddea){const _0x437dd={_0x1fc301:0x49c,_0x2cabdd:0xb61,_0x3f2981:0x6c2},_0x32b7bf={_0x57af57:0x6f2,_0x1f8a5a:0x6c2},_0x570519=_0x35a251;if(_0x14ddea['readyPromise']){_0x14ddea['readyPromise']['then'](_0x233ccf=>{const _0x1d4f05=_0x2767;this['_model']=_0x14ddea[_0x1d4f05(_0x32b7bf._0x57af57)],this[_0x1d4f05(_0x32b7bf._0x1f8a5a)]=_0x14ddea['modelMatrix'];});return;}this['_graphic']=_0x14ddea;if(_0x14ddea['entity'])this['_model']=_0x14ddea[_0x570519(0xbd4)]['model'],this[_0x570519(0x6c2)]=Cesium__namespace[_0x570519(_0x437dd._0x1fc301)]['eastNorthUpToFixedFrame'](getPositionValue(_0x14ddea[_0x570519(_0x437dd._0x2cabdd)]));else{if(_0x14ddea instanceof Cesium__namespace['Entity'])this[_0x570519(0xea5)]=_0x14ddea['model'],this[_0x570519(0x6c2)]=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](getPositionValue(_0x14ddea['position']));else{if(_0x14ddea['primitive'])this['_model']=_0x14ddea['primitive'],this['_modelMatrix']=_0x14ddea['modelMatrix'];else _0x14ddea instanceof Cesium__namespace[_0x570519(0x117)]&&(this['_model']=_0x14ddea,this[_0x570519(_0x437dd._0x3f2981)]=_0x14ddea['modelMatrix']);}}}get['inverseMatrix'](){const _0x2d7cb9={_0x4bbeee:0x6a7,_0xf1cd94:0x8b6,_0xe2c24b:0x6c2},_0x4cb42d=_0x35a251;return!this['_inverseMatrix']&&this['_modelMatrix']&&(this['_inverseMatrix']=Cesium__namespace[_0x4cb42d(_0x2d7cb9._0x4bbeee)][_0x4cb42d(_0x2d7cb9._0xf1cd94)](this[_0x4cb42d(_0x2d7cb9._0xe2c24b)],new Cesium__namespace['Matrix4']())),this[_0x4cb42d(0x2eb)];}['_mountedHook'](){const _0x254fe8=_0x35a251;this[_0x254fe8(0xe86)]['graphic']&&(this[_0x254fe8(0xf8c)]=this['options']['graphic']);}}ModelPlanClip['Type']=ClipType;class TilesetBoxClip extends BaseThing{get['clipTarget'](){return this['_tileset'];}set['clipTarget'](_0x3507b5){const _0x3e9e40={_0x310acd:0xb61},_0x57f6c5=_0x35a251;this['_tileset']=_0x3507b5,this['_inverseMatrix']=null,Cesium__namespace['defined'](this['options']['position'])&&(this[_0x57f6c5(_0x3e9e40._0x310acd)]=this['options'][_0x57f6c5(0xb61)]);}get['layer'](){return this['_layer'];}set['layer'](_0x378c27){const _0x128de9={_0x5bf7db:0xb71,_0x1fb7dc:0x928,_0x383479:0x7e0},_0x18f32e=_0x35a251;this['_layer']=_0x378c27,_0x378c27[_0x18f32e(_0x128de9._0x5bf7db)]?this[_0x18f32e(_0x128de9._0x1fb7dc)]=_0x378c27[_0x18f32e(_0x128de9._0x383479)]:_0x378c27['on'](EventType['load'],_0x4c7a33=>{this['clipTarget']=_0x378c27['tileset'];});}get['planes'](){return this['clippingPlanes'];}get['inverseMatrix'](){const _0x9211e8={_0x73aea:0x6a7},_0x2e3556=_0x35a251;if(!this['_inverseMatrix']){let _0x5a51cf;const _0xce7e6f=this[_0x2e3556(0x5f1)]['root']['transform'];_0xce7e6f&&_0xce7e6f[_0x2e3556(0x417)](Cesium__namespace[_0x2e3556(_0x9211e8._0x73aea)][_0x2e3556(0x3b8)])||!_0xce7e6f?_0x5a51cf=Cesium__namespace[_0x2e3556(0x49c)]['eastNorthUpToFixedFrame'](this[_0x2e3556(0x5f1)]['boundingSphere'][_0x2e3556(0x176)]):_0x5a51cf=Cesium__namespace['Matrix4']['fromArray'](this['_tileset']['root']['transform']),this['_inverseMatrix']=Cesium__namespace['Matrix4']['inverseTransformation'](_0x5a51cf,new Cesium__namespace[(_0x2e3556(0x6a7))]());}return this['_inverseMatrix'];}get['center'](){const _0x1cc094={_0x5f2f7b:0xb61,_0x2a20df:0x5f1,_0xf0709b:0x176},_0x2d40dc=_0x35a251;if(this['_layer'])return this['_layer'][_0x2d40dc(_0x1cc094._0x5f2f7b)];return this[_0x2d40dc(_0x1cc094._0x2a20df)]['boundingSphere'][_0x2d40dc(_0x1cc094._0xf0709b)];}get['position'](){return this['_position'];}set[_0x35a251(0xb61)](_0xb502f6){this['_position']=LngLatPoint['toCartesian'](_0xb502f6),this['redraw']();}get[_0x35a251(0x6ea)](){return this['options']['dimensions'];}set['dimensions'](_0xb17949){this['options']['dimensions']=_0xb17949,this['redraw']();}get[_0x35a251(0xb79)](){return this['options']['showBox'];}set['showBox'](_0x1c2a90){const _0x37fbca={_0x3de6bb:0xb79,_0x19aa73:0xb79,_0x2a9570:0xb13,_0x3c31a5:0x987},_0x5d0fe2=_0x35a251;this['options'][_0x5d0fe2(_0x37fbca._0x3de6bb)]=_0x1c2a90,this['options'][_0x5d0fe2(_0x37fbca._0x19aa73)]?(!this['_graphicLayer']&&(this['_graphicLayer']=new GraphicLayer({...this['options'],'private':!![]})),this[_0x5d0fe2(_0x37fbca._0x2a9570)]['show']=!![]):this['_graphicLayer']&&(this['_graphicLayer'][_0x5d0fe2(_0x37fbca._0x3c31a5)]=![]),this['redraw']();}['_mountedHook'](){const _0x395387={_0x3a36b1:0xe86},_0xd3346d=_0x35a251;this['options']['showBox']&&(this['_graphicLayer']=new GraphicLayer({...this[_0xd3346d(_0x395387._0x3a36b1)],'private':!![]}));if(this['options'][_0xd3346d(0x87)])this[_0xd3346d(0x87)]=this['options']['layer'];else this[_0xd3346d(0xe86)]['tileset']&&(this['clipTarget']=this['options']['tileset']);}[_0x35a251(0x97b)](){const _0x23b4f9={_0x1cdc24:0xb13,_0x574a0a:0xb61,_0x270690:0xe86},_0x433301=_0x35a251;this['_graphicLayer']&&this['_map'][_0x433301(0x6f7)](this[_0x433301(_0x23b4f9._0x1cdc24)]),this['clipTarget']&&(Cesium__namespace['defined'](this[_0x433301(0xe86)][_0x433301(_0x23b4f9._0x574a0a)])&&(this[_0x433301(_0x23b4f9._0x574a0a)]=this[_0x433301(_0x23b4f9._0x270690)]['position']));}[_0x35a251(0xa9a)](){const _0x13bb3c={_0x3c77e0:0xb13},_0x4b481d=_0x35a251;this['clear'](),this[_0x4b481d(_0x13bb3c._0x3c77e0)]&&this[_0x4b481d(0xd79)]['removeLayer'](this['_graphicLayer']);}['redraw'](){const _0x390c74={_0x25ea5d:0x6ea,_0x19ea80:0x56d,_0x4b8cfa:0x8eb,_0x151701:0x566,_0x2562a4:0xe86,_0x5d39f0:0x6ea},_0x55897b=_0x35a251;if(!this['position']||!this['dimensions'])return;const _0x175192=this[_0x55897b(_0x390c74._0x25ea5d)]['x']/0x2,_0x35c324=this['dimensions']['y']/0x2,_0x432506=this['dimensions']['z']/0x2,_0x261b0f=this[_0x55897b(0xc72)],_0x532312=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x261b0f,this[_0x55897b(0x176)],new Cesium__namespace['Cartesian3']()),_0xf5b3be=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x261b0f,this['position'],new Cesium__namespace[(_0x55897b(0x8eb))]()),_0xf0ae9f=_0x532312['x']-_0xf5b3be['x'],_0x175dfb=_0x532312['y']-_0xf5b3be['y'],_0x3ef21d=_0x532312['z']-_0xf5b3be['z'],_0x58aee3=[new Cesium__namespace[(_0x55897b(_0x390c74._0x19ea80))](new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),-_0x432506+_0x3ef21d),new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x55897b(0x8eb))](0x0,0x0,-0x1),-_0x432506-_0x3ef21d),new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x1,0x0,0x0),-_0x175192+_0xf0ae9f),new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x55897b(_0x390c74._0x4b8cfa))](-0x1,0x0,0x0),-_0x175192-_0xf0ae9f),new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x55897b(0x8eb))](0x0,0x1,0x0),-_0x35c324+_0x175dfb),new Cesium__namespace[(_0x55897b(0x56d))](new Cesium__namespace['Cartesian3'](0x0,-0x1,0x0),-_0x35c324-_0x175dfb)],_0x46b2bb=new Cesium__namespace[(_0x55897b(_0x390c74._0x151701))]({'planes':_0x58aee3,'edgeWidth':this['options']['edgeWidth']??0x0,'edgeColor':this['options']['edgeColor']??Cesium__namespace['Color']['WHITE'],'unionClippingRegions':this[_0x55897b(_0x390c74._0x2562a4)]['clipOutSide']??![]});this['clippingPlanes']=_0x46b2bb;this['clipTarget']&&(this['clipTarget']['clippingPlanes']=_0x46b2bb);if(this['options']['showBox']){this['_graphicLayer']['clear']();const _0x1e452f=new BoxEntity({'position':this['position'],'style':{'dimensions':this['options'][_0x55897b(_0x390c74._0x5d39f0)],'color':Cesium__namespace['Color']['WHITE']['withAlpha'](0.2),...this['options']['boxStyle']||{}}});this['_graphicLayer']['addGraphic'](_0x1e452f);}}[_0x35a251(0x386)](){const _0x30b3e7={_0x3fbe5b:0x386,_0x112f7a:0x2a6,_0x66d514:0x928},_0x23974a=_0x35a251;var _0x39bece,_0x373bc5;this['_graphicLayer']&&this['_graphicLayer'][_0x23974a(_0x30b3e7._0x3fbe5b)](),this['clippingPlanes']&&delete this['clippingPlanes'],(_0x39bece=this['clipTarget'])!==null&&_0x39bece!==void 0x0&&(_0x373bc5=_0x39bece[_0x23974a(0x85d)])!==null&&_0x373bc5!==void 0x0&&_0x373bc5[_0x23974a(_0x30b3e7._0x112f7a)]&&(this[_0x23974a(_0x30b3e7._0x66d514)]['clippingPlanes'][_0x23974a(0x2a6)]=![]),this['clipTarget']['clippingPlanes']=undefined;}}const scratchCurrentDirection=new Cesium__namespace['Cartesian3'](),scratchDeltaPosition=new Cesium__namespace[(_0x35a251(0x8eb))](),scratchNextPosition=new Cesium__namespace[(_0x35a251(0x8eb))](),scratchTerrainConsideredNextPosition=new Cesium__namespace['Cartesian3'](),scratchNextCartographic=new Cesium__namespace['Cartographic'](),RoamType={'DIRECTION_NONE':0x0,'DIRECTION_FORWARD':0x1,'DIRECTION_BACKWARD':0x2,'DIRECTION_LEFT':0x3,'DIRECTION_RIGHT':0x4};class FirstPersonRoam extends BaseThing{constructor(_0x4a2e15={}){const _0x507b7a={_0x246e3d:0xe86},_0x14148a=_0x35a251;super(_0x4a2e15),this['speed']=this['options']['speed']??1.5,this['rotateSpeed']=this['options']['rotateSpeed']??-0x5,this['height']=this['options'][_0x14148a(0x682)]??0xa,this['maxPitch']=this[_0x14148a(_0x507b7a._0x246e3d)]['maxPitch']??0x58;}['_enabledHook'](_0xf71bcb){const _0x4db42c={_0x3f4d97:0x636},_0x40a13e=_0x35a251;_0xf71bcb?this[_0x40a13e(0x2f7)]():this[_0x40a13e(_0x4db42c._0x3f4d97)]();}['_mountedHook'](){}[_0x35a251(0x97b)](){const _0x48643b={_0x36abdd:0xd79,_0xce2b21:0x904,_0xace440:0x6e8,_0x52d17c:0x714,_0x3f0689:0x3ff},_0x366d38=_0x35a251;this['enabled']&&this['activate'](),this[_0x366d38(_0x48643b._0x36abdd)]['on'](EventType['leftDown'],this['_onLeftDownHandler'],this),this['_map']['on'](EventType[_0x366d38(_0x48643b._0xce2b21)],this['_onLeftUpHandler'],this),this['_map']['on'](EventType[_0x366d38(0x971)],this['_onMouseMoveHandler'],this),this[_0x366d38(_0x48643b._0x36abdd)]['on'](EventType[_0x366d38(0x43e)],this['_onDbClickHandler'],this),this['_map']['on'](EventType[_0x366d38(_0x48643b._0xace440)],this[_0x366d38(0x7c1)],this),this['_map']['on'](EventType['keyup'],this[_0x366d38(_0x48643b._0x52d17c)],this),this[_0x366d38(_0x48643b._0x36abdd)]['on'](EventType['clockTick'],this[_0x366d38(_0x48643b._0x3f0689)],this);}['_removedHook'](){const _0x3d8b79={_0x1b92e5:0x636,_0x7200df:0xe34,_0x4cf9be:0xd79,_0x388561:0x7b3,_0x3364c4:0xf05},_0xffb746=_0x35a251;this[_0xffb746(_0x3d8b79._0x1b92e5)](),this[_0xffb746(0xd79)][_0xffb746(0x6b2)](EventType[_0xffb746(0x71f)],this[_0xffb746(_0x3d8b79._0x7200df)],this),this[_0xffb746(_0x3d8b79._0x4cf9be)]['off'](EventType['leftUp'],this['_onLeftUpHandler'],this),this['_map']['off'](EventType['mouseMove'],this[_0xffb746(0x3b4)],this),this[_0xffb746(_0x3d8b79._0x4cf9be)]['off'](EventType[_0xffb746(0x43e)],this[_0xffb746(_0x3d8b79._0x388561)],this),this['_map']['off'](EventType['keydown'],this['_onKeyDown'],this),this['_map']['off'](EventType['keyup'],this[_0xffb746(0x714)],this),this[_0xffb746(0xd79)][_0xffb746(0x6b2)](EventType[_0xffb746(_0x3d8b79._0x3364c4)],this['_onClockTick'],this);}['_onLeftDownHandler'](_0x1e5b32){const _0x281708={_0x3ad41f:0x8eb},_0x12b470=_0x35a251;if(!this['enabled'])return;this['_looking']=!![],this['_startMousePosition']=Cesium__namespace[_0x12b470(_0x281708._0x3ad41f)]['clone'](_0x1e5b32['position']),this['_mousePosition']=this['_startMousePosition'];}['_onDbClickHandler'](_0x3e7605){const _0x135005={_0x25626b:0x5e6},_0x2dcb5d=_0x35a251;if(!this['enabled'])return;this[_0x2dcb5d(0xe64)]=!![],this[_0x2dcb5d(_0x135005._0x25626b)]=Cesium__namespace['Cartesian3'][_0x2dcb5d(0xd61)](_0x3e7605['position']),this[_0x2dcb5d(0x680)]=this['_startMousePosition'];}['_onLeftUpHandler'](_0x5176a1){this['_looking']=![];}['_onMouseMoveHandler'](_0x35285f){this['_mousePosition']=_0x35285f['endPosition'];}[_0x35a251(0x7c1)](_0x13d10a){const _0x332979={_0x582c21:0xa41,_0x22bde0:0x66d,_0x294b2e:0x4a8,_0x4a1e68:0x40d},_0x55c4a7=_0x35a251;if(!this['enabled'])return;const _0x1a1ef3=_0x13d10a[_0x55c4a7(_0x332979._0x582c21)];this['_direction']=RoamType['DIRECTION_NONE'];switch(_0x1a1ef3){case'W'['charCodeAt'](0x0):this['_direction']=RoamType[_0x55c4a7(_0x332979._0x22bde0)];break;case'S'[_0x55c4a7(_0x332979._0x294b2e)](0x0):this[_0x55c4a7(_0x332979._0x4a1e68)]=RoamType['DIRECTION_BACKWARD'];break;case'D'[_0x55c4a7(0x4a8)](0x0):this['_direction']=RoamType['DIRECTION_RIGHT'];break;case'A'['charCodeAt'](0x0):this['_direction']=RoamType[_0x55c4a7(0xd64)];break;}}['_onKeyUp'](){const _0x219671={_0x415e45:0x980},_0x2c74ad=_0x35a251;if(!this[_0x2c74ad(0x2a6)])return;this['_direction']=RoamType[_0x2c74ad(_0x219671._0x415e45)];}['_onClockTick'](_0x598ade){const _0x184e86={_0x373292:0x565,_0x46b465:0x882,_0x1e6876:0x7d,_0x54b796:0x40d,_0x382c12:0x8eb,_0x3d0677:0xddc,_0xd67339:0x40d,_0x357642:0x8eb,_0x29b399:0xb61,_0x49cb85:0x682,_0x5ab61f:0x527,_0x6ee226:0xd79,_0x58cc3a:0x6a7},_0xb237a0=_0x35a251;if(!this['enabled'])return;const _0x421685=_0x598ade[_0xb237a0(_0x184e86._0x373292)];this['_looking']&&this[_0xb237a0(_0x184e86._0x46b465)](_0x421685);if(this[_0xb237a0(0x40d)]===RoamType['DIRECTION_NONE'])return;const _0x211b9c=this['speed']*_0x421685;if(this['_direction']===RoamType['DIRECTION_FORWARD'])Cesium__namespace['Cartesian3']['multiplyByScalar'](this['_map'][_0xb237a0(_0x184e86._0x1e6876)]['direction'],0x1,scratchCurrentDirection);else{if(this[_0xb237a0(_0x184e86._0x54b796)]===RoamType['DIRECTION_BACKWARD'])Cesium__namespace[_0xb237a0(_0x184e86._0x382c12)][_0xb237a0(_0x184e86._0x3d0677)](this['_map']['camera']['direction'],-0x1,scratchCurrentDirection);else{if(this[_0xb237a0(_0x184e86._0xd67339)]===RoamType['DIRECTION_LEFT'])Cesium__namespace['Cartesian3']['multiplyByScalar'](this['_map']['camera']['right'],-0x1,scratchCurrentDirection);else this['_direction']===RoamType['DIRECTION_RIGHT']&&Cesium__namespace[_0xb237a0(_0x184e86._0x357642)]['multiplyByScalar'](this[_0xb237a0(0xd79)]['camera']['right'],0x1,scratchCurrentDirection);}}Cesium__namespace['Cartesian3']['multiplyByScalar'](scratchCurrentDirection,_0x211b9c,scratchDeltaPosition);const _0x21e899=this['_map']['camera'][_0xb237a0(_0x184e86._0x29b399)];Cesium__namespace[_0xb237a0(0x8eb)]['add'](_0x21e899,scratchDeltaPosition,scratchNextPosition);const _0x34eff2=this['_map']['scene']['globe'],_0x559e5f=_0x34eff2[_0xb237a0(0x3f4)];_0x559e5f['cartesianToCartographic'](scratchNextPosition,scratchNextCartographic);const _0x268800=_0x34eff2['getHeight'](scratchNextCartographic);if(_0x268800===undefined)return;scratchNextCartographic['height']=_0x268800+this[_0xb237a0(_0x184e86._0x49cb85)],_0x559e5f['cartographicToCartesian'](scratchNextCartographic,scratchTerrainConsideredNextPosition),this[_0xb237a0(0xd79)]['camera']['setView']({'destination':scratchTerrainConsideredNextPosition,'orientation':new Cesium__namespace['HeadingPitchRoll'](this['_map']['camera'][_0xb237a0(0x41f)],this['_map']['camera'][_0xb237a0(_0x184e86._0x5ab61f)],this[_0xb237a0(_0x184e86._0x6ee226)]['camera']['roll']),'endTransform':Cesium__namespace[_0xb237a0(_0x184e86._0x58cc3a)]['IDENTITY']});}['_changeHeadingPitch'](_0x58f578){const _0x1be4e5={_0x469b75:0x7c0,_0x25b6ea:0xd79,_0x2823e6:0x645,_0x499506:0x7c0},_0x236983=_0x35a251,_0x3f0aac=this['_map']['canvas']['clientWidth'],_0x7a90c0=this[_0x236983(0xd79)]['canvas']['clientHeight'],_0x2de7a0=(this['_mousePosition']['x']-this['_startMousePosition']['x'])/_0x3f0aac,_0x5bd49e=-(this['_mousePosition']['y']-this['_startMousePosition']['y'])/_0x7a90c0,_0x59af08=Cesium__namespace[_0x236983(_0x1be4e5._0x469b75)]['toDegrees'](this[_0x236983(_0x1be4e5._0x25b6ea)]['camera']['heading']),_0x1e20e4=_0x2de7a0*this['rotateSpeed'],_0x39293b=_0x59af08+_0x1e20e4,_0x1c047f=Cesium__namespace['Math']['toDegrees'](this['_map']['camera']['pitch']),_0x426eb6=_0x5bd49e*this['rotateSpeed'];let _0x24bfa9=_0x1c047f+_0x426eb6;_0x24bfa9>this['maxPitch']*0x2&&_0x24bfa9<0x168-this[_0x236983(_0x1be4e5._0x2823e6)]?_0x24bfa9=0x168-this['maxPitch']:_0x24bfa9>this['maxPitch']&&_0x24bfa9<0x168-this['maxPitch']&&(_0x24bfa9=this['maxPitch']),this['_map'][_0x236983(0x7d)]['setView']({'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x39293b),'pitch':Cesium__namespace[_0x236983(_0x1be4e5._0x499506)]['toRadians'](_0x24bfa9),'roll':this['_map']['camera']['roll']}});}['_enableScreenSpaceCameraController'](_0x47fa6d){const _0x3a0860={_0x2e1d7e:0xc60,_0x1c0bc1:0xf3c,_0x3d5f20:0xc67,_0x3c1407:0x8b4},_0x161e81=_0x35a251,_0x38b2c6=this['_map'][_0x161e81(_0x3a0860._0x2e1d7e)];_0x38b2c6['screenSpaceCameraController'][_0x161e81(_0x3a0860._0x1c0bc1)]=_0x47fa6d,_0x38b2c6['screenSpaceCameraController'][_0x161e81(_0x3a0860._0x3d5f20)]=_0x47fa6d,_0x38b2c6['screenSpaceCameraController'][_0x161e81(_0x3a0860._0x3c1407)]=_0x47fa6d,_0x38b2c6['screenSpaceCameraController']['enableTilt']=_0x47fa6d,_0x38b2c6[_0x161e81(0xbbb)]['enableLook']=_0x47fa6d;}['activate'](){const _0x365051={_0x4c9230:0x7d},_0x27dcab=_0x35a251;this['_enabled']=!![],this['_enableScreenSpaceCameraController'](![]);const _0x22cd88=this['_map']['camera']['position'],_0x4a60a7=new Cesium__namespace['Cartographic'](),_0x2a51d7=this['_map']['scene'][_0x27dcab(0x22f)];_0x2a51d7['ellipsoid']['cartesianToCartographic'](_0x22cd88,_0x4a60a7);const _0x158070=_0x2a51d7['getHeight'](_0x4a60a7);if(_0x158070===undefined)return![];_0x4a60a7['height']=_0x158070+this[_0x27dcab(0x682)];const _0x8f20c9=new Cesium__namespace['Cartesian3']();_0x2a51d7['ellipsoid']['cartographicToCartesian'](_0x4a60a7,_0x8f20c9);const _0x3d5938=this['_map'][_0x27dcab(_0x365051._0x4c9230)][_0x27dcab(0x41f)];return this['_heading']=_0x3d5938,this['_map']['camera']['flyTo']({'destination':_0x8f20c9,'orientation':{'heading':_0x3d5938,'pitch':Cesium__namespace['Math']['toRadians'](0x0),'roll':0x0}}),!![];}['disable'](){const _0x5dcf1d=_0x35a251;this['_enabled']=![],this[_0x5dcf1d(0x92)](!![]);}['startAutoForward'](){const _0x293b00=_0x35a251;!this['enabled']&&this[_0x293b00(0x2f7)](),this['_direction']=RoamType['DIRECTION_FORWARD'];}['stopAutoForward'](){const _0x1b4a4c={_0x179d88:0x980},_0x14e697=_0x35a251;this['_direction']=RoamType[_0x14e697(_0x1b4a4c._0x179d88)];}}class RotatePoint extends BaseThing{constructor(_0x1df4ec={}){const _0x194808={_0x195e46:0xc92},_0x4141f5=_0x35a251;super(_0x1df4ec),this[_0x4141f5(0x40d)]=this['options']['direction']?0x1:-0x1,this['_angle']=0x168/(0x3c*(this[_0x4141f5(0xe86)]['time']||0x3c)),this[_0x4141f5(_0x194808._0x195e46)]=this[_0x4141f5(0xe86)]['autoStopAngle'];}get['isStart'](){const _0xe5982d={_0x34ce23:0x222},_0x3cd9dc=_0x35a251;return this[_0x3cd9dc(_0xe5982d._0x34ce23)];}['_enabledHook'](_0x115b2b){const _0x1a6e3c=_0x35a251;_0x115b2b?this[_0x1a6e3c(0xaa1)]():this['stop']();}[_0x35a251(0x700)](){}['_addedHook'](){const _0x59f23c=_0x35a251;this['_map']['on'](EventType['mouseDown'],this['_map_mouseDownHandler'],this),this[_0x59f23c(0xd79)]['on'](EventType['mouseUp'],this['_map_mouseUpHandler'],this),this['_mouseDown']=![];}['_map_mouseDownHandler'](_0x4b5492){const _0x43ba9e={_0x3aa73a:0xa7b},_0x18b7a1=_0x35a251;this[_0x18b7a1(_0x43ba9e._0x3aa73a)]=!![];}['_map_mouseUpHandler'](_0x27e89c){const _0x2a0020=_0x35a251;this['_mouseDown']=![];const _0x347411=this['_map'][_0x2a0020(0xf83)]();if(!_0x347411||_0x347411['alt']>0x7a120)return;this['_tikRender']=0x0,this['_center']=_0x347411['toCartesian'](),this['_startHeading']=this['_map']['camera']['heading'],this['_startPitch']=this['_map']['camera']['pitch'],this['_distance']=Cesium__namespace['Cartesian3']['distance'](this['_center'],this['_map']['camera']['positionWC']);}['_removedHook'](){const _0x566e21={_0x574951:0x6b2,_0x1de183:0x34d},_0x2ac370=_0x35a251;this['_map'][_0x2ac370(_0x566e21._0x574951)](EventType[_0x2ac370(0x774)],this['_map_mouseDownHandler'],this),this['_map']['off'](EventType[_0x2ac370(_0x566e21._0x1de183)],this['_map_mouseUpHandler'],this),this['stop']();}['start'](_0x531bdc){const _0x426659={_0x179684:0x13f,_0xc49714:0xd79,_0x3efff8:0x7d,_0x80bbb9:0xdd3},_0x424a79={_0x20996f:0xa5},_0x18ecfd=_0x35a251;var _0x3a4d2b;this['_isStart']&&this['stop']();this['_isStart']=!![];const _0x31be78=(_0x3a4d2b=this['_map'][_0x18ecfd(0xf83)]())===null||_0x3a4d2b===void 0x0?void 0x0:_0x3a4d2b[_0x18ecfd(0xa43)]();if(!_0x531bdc)this['_center']=_0x31be78;else _0x531bdc instanceof Cesium__namespace['Cartesian3']?this['_center']=_0x531bdc:this['_center']=LngLatPoint['parse'](_0x531bdc)['toCartesian']();this['_distance']=this['options'][_0x18ecfd(0xeed)]||Cesium__namespace['Cartesian3'][_0x18ecfd(0xeed)](this['_center'],this['_map']['camera'][_0x18ecfd(_0x426659._0x179684)]),this[_0x18ecfd(0x3d1)]=this[_0x18ecfd(_0x426659._0xc49714)][_0x18ecfd(_0x426659._0x3efff8)][_0x18ecfd(0x41f)],this['_startPitch']=this['_map'][_0x18ecfd(0x7d)][_0x18ecfd(0x527)];let _0x3f3c21=0x2;Cesium__namespace['Cartesian3']['distance'](_0x31be78,this['_center']){const _0x171e4a=_0x18ecfd;this['_isStart']=!![],this[_0x171e4a(_0x424a79._0x20996f)]=0x0,this['_map']['on'](EventType['preRender'],this['_onPreRenderHandler'],this);}});}[_0x35a251(0x6c8)](_0x403136){const _0x4e16c7={_0x100175:0xf9b,_0x441f07:0x40d,_0x1cc5d7:0x9f2},_0x5a9e88=_0x35a251;if(this[_0x5a9e88(0xa7b)])return;this['_tikRender']++;const _0x50899d=this['_tikRender']*this['_angle'];this['_autoStopAngle']&&_0x50899d>=this['_autoStopAngle']&&this[_0x5a9e88(_0x4e16c7._0x100175)]();const _0x3d1a13=Cesium__namespace['Math'][_0x5a9e88(0x7ba)](_0x50899d*this[_0x5a9e88(_0x4e16c7._0x441f07)])+this['_startHeading'];this['_map']['scene']['camera']['setView']({'destination':this['_center'],'orientation':{'heading':_0x3d1a13,'pitch':this['_startPitch']}}),this['_map']['scene']['camera']['moveBackward'](this['_distance']),this[_0x5a9e88(0x264)](EventType[_0x5a9e88(_0x4e16c7._0x1cc5d7)]);}['stop'](){const _0x54f544={_0x2e7dc7:0x222,_0x38175c:0x6b2,_0x56e67e:0xf9b},_0x3242b0=_0x35a251;if(!this['_isStart'])return;this[_0x3242b0(_0x54f544._0x2e7dc7)]=![],this['_map'][_0x3242b0(_0x54f544._0x38175c)](EventType['preRender'],this['_onPreRenderHandler'],this),this['fire'](EventType[_0x3242b0(_0x54f544._0x56e67e)]);}}const MAX_PITCH_IN_DEGREE=0x58;class StreetView extends BaseThing{constructor(_0x8f735b={}){const _0x9d7d78={_0x9a516d:0x55b},_0x5c3cab=_0x35a251;super(_0x8f735b),this['rotateSpeed']=_0x8f735b['rotateSpeed']??0x1e,this[_0x5c3cab(_0x9d7d78._0x9a516d)]=_0x8f735b['heightStep']??0.2,this['moveStep']=_0x8f735b['moveStep']??0.1;}['_enabledHook'](_0x4eea7e){const _0x19be89={_0x1314b3:0xbbb,_0x30e046:0x3f2,_0x13980b:0xc60,_0x1c883e:0x5c0,_0x585231:0xb93,_0x55c499:0x560,_0x1352c8:0x77d,_0x49142b:0x77d,_0x1e85ae:0x762,_0x517c86:0xd79},_0x4d4967=_0x35a251;this['_map']['mouseZoom']&&(this[_0x4d4967(0xd79)]['mouseZoom']['enabled']=!_0x4eea7e),_0x4eea7e?(this['_default_zoomEventTypes']=this['_map']['scene'][_0x4d4967(_0x19be89._0x1314b3)][_0x4d4967(_0x19be89._0x30e046)],this['_default_tiltEventTypes']=this['_map'][_0x4d4967(_0x19be89._0x13980b)]['screenSpaceCameraController'][_0x4d4967(_0x19be89._0x1c883e)],this[_0x4d4967(0xd79)]['scene']['screenSpaceCameraController']['zoomEventTypes']=[Cesium__namespace['CameraEventType'][_0x4d4967(_0x19be89._0x585231)],Cesium__namespace['CameraEventType'][_0x4d4967(_0x19be89._0x55c499)],{'eventType':Cesium__namespace[_0x4d4967(_0x19be89._0x1352c8)]['RIGHT_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier']['CTRL']}],this['_map']['scene']['screenSpaceCameraController']['tiltEventTypes']=[{'eventType':Cesium__namespace[_0x4d4967(_0x19be89._0x49142b)]['MIDDLE_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier']['CTRL']}]):(this['_default_zoomEventTypes']&&(this['_map']['scene']['screenSpaceCameraController']['zoomEventTypes']=this[_0x4d4967(_0x19be89._0x1e85ae)],delete this['_default_zoomEventTypes']),this['_default_tiltEventTypes']&&(this[_0x4d4967(_0x19be89._0x517c86)][_0x4d4967(0xc60)][_0x4d4967(0xbbb)]['tiltEventTypes']=this[_0x4d4967(0x6ce)],delete this['_default_tiltEventTypes']));}[_0x35a251(0x700)](){}[_0x35a251(0x97b)](){const _0xfcd02f={_0x34db24:0x7b3,_0x45626b:0xd79},_0x50c7a2=_0x35a251;this['_enabledHook'](this['enabled']),this['_map']['on'](EventType[_0x50c7a2(0xd9f)],this['_onRightDownHandler'],this),this[_0x50c7a2(0xd79)]['on'](EventType[_0x50c7a2(0x971)],this['_onMouseMove'],this),this['_map']['on'](EventType['rightUp'],this['_onRightUpHandler'],this),this['_map']['on'](EventType[_0x50c7a2(0x851)],this['_onMiddleDownHandler'],this),this['_map']['on'](EventType['middleUp'],this['_onMiddleUpHandler'],this),this[_0x50c7a2(0xd79)]['on'](EventType[_0x50c7a2(0xfb4)],this['_onClickHandler'],this),this['_map']['on'](EventType['dblClick'],this[_0x50c7a2(_0xfcd02f._0x34db24)],this),this[_0x50c7a2(_0xfcd02f._0x45626b)]['on'](EventType['rightClick'],this['_onRightClickHandler'],this);}['_removedHook'](){const _0x104f96={_0x439705:0xd79,_0x1c5be4:0x851,_0x47f970:0x6b2,_0x16dc96:0x82f,_0x39e9bf:0xd79,_0x365def:0x15f},_0x2ae934=_0x35a251;this['_enabledHook'](![]),this['_map'][_0x2ae934(0x6b2)](EventType['rightDown'],this['_onRightDownHandler'],this),this[_0x2ae934(0xd79)]['off'](EventType[_0x2ae934(0x971)],this['_onMouseMove'],this),this[_0x2ae934(0xd79)]['off'](EventType['rightUp'],this['_onRightUpHandler'],this),this[_0x2ae934(_0x104f96._0x439705)]['off'](EventType[_0x2ae934(_0x104f96._0x1c5be4)],this['_onMiddleDownHandler'],this),this['_map']['off'](EventType['middleUp'],this['_onMiddleUpHandler'],this),this[_0x2ae934(0xd79)][_0x2ae934(0x6b2)](EventType['click'],this['_onClickHandler'],this),this['_map'][_0x2ae934(_0x104f96._0x47f970)](EventType['dblClick'],this['_onDbClickHandler'],this),this['_map']['off'](EventType['rightClick'],this[_0x2ae934(_0x104f96._0x16dc96)],this),this['rotatePoint']&&(this[_0x2ae934(_0x104f96._0x39e9bf)]['removeThing'](this[_0x2ae934(_0x104f96._0x365def)],!![]),delete this['rotatePoint']);}['_onRightDownHandler'](_0x29bc67){const _0x4fad81={_0x37e006:0xd61,_0x383d5c:0x41f,_0x3b22c2:0x51c},_0x3d2314=_0x35a251;if(!this['enabled'])return;this['rotatePoint']&&this['rotatePoint']['stop'](),this['_isMouseLeftButtonPressed']=!![],this['_mousePosition']=this['_startMousePosition']=Cesium__namespace['Cartesian3'][_0x3d2314(_0x4fad81._0x37e006)](_0x29bc67['position']),this[_0x3d2314(0xe62)]=Cesium__namespace[_0x3d2314(0x7c0)]['toDegrees'](this[_0x3d2314(0xd79)]['camera'][_0x3d2314(_0x4fad81._0x383d5c)]),this[_0x3d2314(_0x4fad81._0x3b22c2)]=Cesium__namespace['Math']['toDegrees'](this['_map']['camera']['pitch']);}[_0x35a251(0x666)](_0x29380b){const _0x1c735a={_0x41a75b:0x680,_0x26879d:0xd79,_0x16d925:0x680,_0x397550:0x5e6,_0x301d72:0x55d,_0x2f47cb:0xd1d,_0x14cca3:0x621,_0x5ec874:0xee1,_0x3fe00d:0x55b},_0x7b796a=_0x35a251;if(!this['enabled'])return;this[_0x7b796a(_0x1c735a._0x41a75b)]=_0x29380b['endPosition'];if(this['_isMouseLeftButtonPressed']){const _0x16b6e0=this[_0x7b796a(_0x1c735a._0x26879d)]['canvas']['clientWidth'],_0x12b820=this['_map']['canvas'][_0x7b796a(0x4e7)],_0x458803=(this[_0x7b796a(_0x1c735a._0x16d925)]['x']-this[_0x7b796a(_0x1c735a._0x397550)]['x'])/_0x16b6e0,_0x1c4de1=-(this['_mousePosition']['y']-this['_startMousePosition']['y'])/_0x12b820;if(Cesium__namespace['Math'][_0x7b796a(_0x1c735a._0x301d72)](_0x458803,0x0,Cesium__namespace['Math']['EPSILON6'])&&Cesium__namespace['Math'][_0x7b796a(_0x1c735a._0x301d72)](_0x1c4de1,0x0,Cesium__namespace['Math'][_0x7b796a(_0x1c735a._0x2f47cb)]))return;const _0x2cd877=_0x458803*this['rotateSpeed'],_0x39917a=this[_0x7b796a(0xe62)]+_0x2cd877,_0x3b17d5=_0x1c4de1*this[_0x7b796a(_0x1c735a._0x14cca3)];let _0xcb1829=this['_pitchWhenLeftClicked']+_0x3b17d5;_0xcb1829>MAX_PITCH_IN_DEGREE*0x2&&_0xcb1829<0x168-MAX_PITCH_IN_DEGREE?_0xcb1829=0x168-MAX_PITCH_IN_DEGREE:_0xcb1829>MAX_PITCH_IN_DEGREE&&_0xcb1829<0x168-MAX_PITCH_IN_DEGREE&&(_0xcb1829=MAX_PITCH_IN_DEGREE),this[_0x7b796a(0xd79)]['camera'][_0x7b796a(0xdc6)]({'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x39917a),'pitch':Cesium__namespace['Math']['toRadians'](_0xcb1829),'roll':this['_map']['camera']['roll']}});}else{if(this['_isMouseUpdownPressed']){const _0x1f4d99=-(this[_0x7b796a(0x680)]['y']-this['_startMousePosition']['y'])/this['_map'][_0x7b796a(_0x1c735a._0x5ec874)]['clientHeight'],_0x24e116=this['_map']['camera']['positionCartographic'][_0x7b796a(0x682)]*this[_0x7b796a(_0x1c735a._0x3fe00d)];this['_map'][_0x7b796a(0x7d)]['moveDown'](_0x1f4d99*_0x24e116);}}}[_0x35a251(0x124)](_0x1ce4c2){this['_isMouseLeftButtonPressed']=![];}['_onMiddleDownHandler'](_0x40cc46){const _0x5ddd36={_0x57cfba:0x15f},_0x1220a8=_0x35a251;if(!this['enabled'])return;this[_0x1220a8(_0x5ddd36._0x57cfba)]&&this[_0x1220a8(0x15f)]['stop'](),this['_isMouseUpdownPressed']=!![],this['_startMousePosition']=Cesium__namespace['Cartesian3']['clone'](_0x40cc46['position']),this['_mousePosition']=this[_0x1220a8(0x5e6)];}['_onMiddleUpHandler'](_0x32c034){this['_isMouseUpdownPressed']=![];}['_onClickHandler'](_0x3a1827){const _0x438978=_0x35a251;if(!this[_0x438978(0x2a6)])return;this['rotatePoint']&&this[_0x438978(0x15f)]['stop']();}[_0x35a251(0x7b3)](_0x349edb){const _0x3fb770={_0x3be2f6:0xc60,_0x44fca9:0xeed,_0x4bf6eb:0x13f},_0x545529=_0x35a251;if(!this['enabled'])return;this['rotatePoint']&&this['rotatePoint'][_0x545529(0xf9b)]();const _0x2d79ee=getCurrentMousePosition(this['_map'][_0x545529(_0x3fb770._0x3be2f6)],_0x349edb['position']);if(_0x2d79ee){const _0xdd4237=Cesium__namespace[_0x545529(0x8eb)][_0x545529(_0x3fb770._0x44fca9)](_0x2d79ee,this['_map']['camera'][_0x545529(_0x3fb770._0x4bf6eb)])*this['moveStep'];this['_map'][_0x545529(0xe1c)](_0x2d79ee,{'radius':_0xdd4237,'maximumHeight':this['_map']['camera']['positionCartographic']['height'],'duration':this['options'][_0x545529(0xed4)]});}}['_onRightClickHandler'](_0x5f2f23){const _0x54e001={_0x266402:0x2a6,_0x27badd:0x18b,_0x23b31e:0x15f},_0x25b4da=_0x35a251;if(!this[_0x25b4da(_0x54e001._0x266402)])return;if(this['time']){const _0x2f4ea5=Cesium__namespace['JulianDate']['secondsDifference'](this['_map'][_0x25b4da(0x42d)][_0x25b4da(_0x54e001._0x27badd)],this['time']);_0x2f4ea5<0.5&&(this['_map']['closeContextMenu'](),!this[_0x25b4da(_0x54e001._0x23b31e)]&&(this['rotatePoint']=new RotatePoint(this['options'][_0x25b4da(0x15f)]),this[_0x25b4da(0xd79)]['addThing'](this['rotatePoint'])),this['rotatePoint']['start'](_0x5f2f23['cartesian']));}this['time']=this['_map']['clock'][_0x25b4da(0x18b)]['clone']();}}class CameraHistory extends BaseThing{constructor(_0x3e272d={}){super(_0x3e272d),this['step']=0x0,this['views']=[],this['maxCacheCount']=this['options']['maxCacheCount']??0x63;}get['debugExtent'](){const _0x33e5a9={_0x136cfa:0xe86},_0x15d75f=_0x35a251;return this[_0x15d75f(_0x33e5a9._0x136cfa)]['limit']&&this[_0x15d75f(0xe86)][_0x15d75f(0x287)]['debugExtent'];}set['debugExtent'](_0x5724a0){const _0x249d94={_0xa9a2a8:0xe86,_0x514145:0xd79,_0x36a154:0x313,_0x2676cb:0x7c0,_0x36d1b3:0xa4c},_0x3dd5a9=_0x35a251;if(!this['options'][_0x3dd5a9(0x287)])return;this[_0x3dd5a9(_0x249d94._0xa9a2a8)]['limit']['debugExtent']=_0x5724a0;if(!this['debugExtentEntity']){const _0x4b0f6f=this[_0x3dd5a9(0xe86)]['limit']['radius'],_0x3e425b=this['options']['limit']['position'];this['debugExtentEntity']=this[_0x3dd5a9(_0x249d94._0x514145)][_0x3dd5a9(_0x249d94._0x36a154)]['add']({'name':'限定的范围','position':_0x3e425b,'ellipsoid':{'radii':new Cesium__namespace['Cartesian3'](_0x4b0f6f,_0x4b0f6f,_0x4b0f6f),'maximumCone':Cesium__namespace[_0x3dd5a9(_0x249d94._0x2676cb)][_0x3dd5a9(_0x249d94._0x36d1b3)],'slicePartitions':0x2d,'stackPartitions':0x2d,'material':new Cesium__namespace[(_0x3dd5a9(0xf29))](0x0,0x1,0x1,0x0),'outline':!![],'outlineColor':new Cesium__namespace['Color'](0x0,0x1,0x1,0x1)}});}this[_0x3dd5a9(0x6e3)]['show']=_0x5724a0;}['_mountedHook'](){const _0x365242={_0x1b3ab5:0x976,_0xb1226c:0xe86,_0x483cdf:0x70e},_0x3891b=_0x35a251;this['options']['limit']&&this['options']['limit'][_0x3891b(_0x365242._0x1b3ab5)]&&(this['debugExtent']=this[_0x3891b(_0x365242._0xb1226c)]['limit']['debugExtent']),this[_0x3891b(_0x365242._0x483cdf)]();}['_addedHook'](){const _0x198a89=_0x35a251;this[_0x198a89(0xd79)]['on'](EventType['cameraMoveStart'],this[_0x198a89(0xb90)],this),this['_map']['on'](EventType[_0x198a89(0x801)],this['_cameraMoveEndHandler'],this);}[_0x35a251(0xa9a)](){const _0x17fcbc={_0x378cb1:0x6b2},_0x14f334=_0x35a251;this['_map']['off'](EventType['cameraMoveStart'],this[_0x14f334(0xb90)],this),this['_map'][_0x14f334(_0x17fcbc._0x378cb1)](EventType['cameraMoveEnd'],this['_cameraMoveEndHandler'],this),this[_0x14f334(0x2b4)]=[],this['debugExtentEntity']&&(this['_map']['entities']['remove'](this['debugExtentEntity']),delete this[_0x14f334(0x6e3)]);}['_cameraMoveStartHandler'](){const _0xb6fe0e={_0x4dc9fc:0x78a},_0xffea57=_0x35a251;this[_0xffea57(0xd79)]&&(this['isInPush']=!![],this['lastCameraView']=this['_map'][_0xffea57(_0xb6fe0e._0x4dc9fc)]());}['_cameraMoveEndHandler'](){const _0xbcc581=_0x35a251;this['_limitGlobe']();if(!this[_0xbcc581(0x8ef)])return;this['_addCameraView']();}['_limitGlobe'](){const _0xc406b2={_0x11faa8:0xe86,_0x11dd5b:0xb61,_0x57df53:0x8eb,_0xbbebb:0x287,_0xe2c8e9:0x88b},_0x201232={_0x382423:0x8ef},_0x2fdc91={_0x2f1dcd:0x8ef},_0x463774=_0x35a251;if(!this[_0x463774(_0xc406b2._0x11faa8)]['limit'])return;const _0x3b9252=this['options'][_0x463774(0x287)][_0x463774(_0xc406b2._0x11dd5b)],_0x2e3bb9=this['options']['limit'][_0x463774(0x907)],_0x291637=Cesium__namespace[_0x463774(_0xc406b2._0x57df53)]['distance'](_0x3b9252,this['_map']['camera'][_0x463774(_0xc406b2._0x11dd5b)]);if(this['options'][_0x463774(_0xc406b2._0xbbebb)]['debugExtent']);if(_0x291637<=_0x2e3bb9)return;this['isInPush']=![],this[_0x463774(_0xc406b2._0xe2c8e9)]?this['_map'][_0x463774(0x1e4)](this['lastCameraView'],{'duration':0.5,'complete':()=>{const _0x2bf87b=_0x463774;this['lastCameraView']=null,this[_0x2bf87b(_0x2fdc91._0x2f1dcd)]=!![];}}):this['_map'][_0x463774(0xe1c)](_0x3b9252,{'radius':_0x2e3bb9*0.6,'pitch':-0x3c,'duration':0.5,'complete':()=>{const _0x34cfbf=_0x463774;this['lastCameraView']=null,this[_0x34cfbf(_0x201232._0x382423)]=!![];}});}[_0x35a251(0xe78)](){const _0x26d88d={_0x331552:0x6de,_0x457507:0xe1e},_0x18d88d=_0x35a251,_0x1f88ce=this['_map'][_0x18d88d(0x78a)]();this['views'][_0x18d88d(_0x26d88d._0x331552)](_0x1f88ce),this['views']['length']>this[_0x18d88d(0xcb2)]&&this['views']['splice'](0x0,0x1),this['step']=this['views'][_0x18d88d(_0x26d88d._0x457507)]-0x1,this['fire'](EventType['change'],{'index':this['step'],'count':this['views']['length']});}[_0x35a251(0x19e)](){const _0x52431d={_0x1b5d22:0x2b4},_0x39e629={_0x5d38d0:0x9f2,_0x3d8004:0x2b4},_0x4bd383=_0x35a251;this['_map'][_0x4bd383(0x7d)]['moveStart']['removeEventListener'](this[_0x4bd383(0xb90)],this),this[_0x4bd383(0xd79)]['camera']['moveEnd']['removeEventListener'](this['_cameraMoveEndHandler'],this),this[_0x4bd383(0x8ef)]=![],this['_map']['setCameraView'](this[_0x4bd383(_0x52431d._0x1b5d22)][this['step']],{'complete':()=>{const _0x4c078f=_0x4bd383;this['_map']['camera']['moveStart']['addEventListener'](this['_cameraMoveStartHandler'],this),this['_map']['camera']['moveEnd']['addEventListener'](this['_cameraMoveEndHandler'],this),this['fire'](EventType[_0x4c078f(_0x39e629._0x5d38d0)],{'index':this['step'],'count':this[_0x4c078f(_0x39e629._0x3d8004)]['length']});}});}['goNext'](){const _0x35cd6e=_0x35a251;return this[_0x35cd6e(0xbf9)]>=this['views']['length']-0x1?![]:(this['step']++,this['_goHistoryView'](),!![]);}['goLast'](){const _0xe0aa1c={_0x2cf2d3:0xbf9},_0x32bd35=_0x35a251;return this[_0x32bd35(_0xe0aa1c._0x2cf2d3)]<=0x0?![]:(this['step']--,this['_goHistoryView'](),!![]);}['goNow'](){const _0x84807d={_0x61c34a:0xbf9,_0x3b7bf2:0xe1e},_0x433505=_0x35a251;return this['step']===this['views'][_0x433505(0xe1e)]-0x1?![]:(this[_0x433505(_0x84807d._0x61c34a)]=this[_0x433505(0x2b4)][_0x433505(_0x84807d._0x3b7bf2)]-0x1,this['_goHistoryView'](),!![]);}['goFirst'](){const _0x3b4f93=_0x35a251;return this['step']<=0x0?![]:(this[_0x3b4f93(0xbf9)]=0x0,this['_goHistoryView'](),!![]);}}class RotateOut extends BaseThing{constructor(_0x394fb5={}){const _0x15a2e3=_0x35a251;super(_0x394fb5),this['_angle']=0x168/(0x3c*this[_0x15a2e3(0xe86)]['time']||0x3c),this['_direction']=this['options'][_0x15a2e3(0x79b)]?-0x1:0x1,this[_0x15a2e3(0xc92)]=this['options'][_0x15a2e3(0x477)];}get[_0x35a251(0x5dd)](){return this['_isStart'];}['_enabledHook'](_0xc35317){_0xc35317?this['start']():this['stop']();}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){this['stop']();}[_0x35a251(0xaa1)](){const _0x44faa4={_0x50a450:0x7d},_0x10d3d6=_0x35a251;this[_0x10d3d6(0x222)]&&this['stop'](),this['_isStart']=!![],this['_tikRender']=0x0,this['_startHeading']=this['_map']['camera']['heading'],this['_startPitch']=this['_map'][_0x10d3d6(_0x44faa4._0x50a450)]['pitch'],this['_map']['on'](EventType['preRender'],this['_onPreRenderHandler'],this),this[_0x10d3d6(0x264)](EventType[_0x10d3d6(0xaa1)]);}['_onPreRenderHandler'](_0x45fa66){const _0x37b4b0={_0x1234d7:0x974,_0x568fcd:0x7c0},_0x1fe9e7=_0x35a251;this['_tikRender']++;const _0x55c78b=this[_0x1fe9e7(0xa5)]*this[_0x1fe9e7(_0x37b4b0._0x1234d7)];this[_0x1fe9e7(0xc92)]&&_0x55c78b>=this['_autoStopAngle']&&this['stop']();const _0x930c77=Cesium__namespace[_0x1fe9e7(_0x37b4b0._0x568fcd)]['toRadians'](_0x55c78b*this['_direction'])+this['_startHeading'];this['_map']['scene']['camera']['setView']({'orientation':{'heading':_0x930c77,'pitch':this['_startPitch']}}),this['fire'](EventType[_0x1fe9e7(0x9f2)]);}['stop'](){const _0x21cd38={_0x2b5308:0x222,_0x2c9521:0x6c8},_0x567d40=_0x35a251;if(!this['_isStart'])return;this[_0x567d40(_0x21cd38._0x2b5308)]=![],this['_map']['off'](EventType['preRender'],this[_0x567d40(_0x21cd38._0x2c9521)],this),this[_0x567d40(0x264)](EventType['stop']);}}const PointEditElementColors={'X_TRANSLATION_COLOR':Cesium__namespace['Color']['RED'][_0x35a251(0x373)](0.6),'Y_TRANSLATION_COLOR':Cesium__namespace['Color'][_0x35a251(0xcd7)]['withAlpha'](0.6),'Z_TRANSLATION_COLOR':Cesium__namespace[_0x35a251(0xf29)]['BLUE'][_0x35a251(0x373)](0.6),'XY_TRANSLATION_COLOR':Cesium__namespace['Color']['BLUE']['withAlpha'](0.6),'YZ_TRANSLATION_COLOR':Cesium__namespace['Color']['RED'][_0x35a251(0x373)](0.6),'XZ_TRANSLATION_COLOR':Cesium__namespace['Color'][_0x35a251(0xcd7)]['withAlpha'](0.6)},HighlightColor=Cesium__namespace['Color']['YELLOW'];class MatrixMove2 extends BaseThing{constructor(_0x52dd36={}){const _0x15eb01={_0x5092c1:0xaa9,_0x20f02c:0xe8d,_0x442a62:0xa74,_0x1978d8:0x12c,_0x45b40:0xb61},_0xbeeafd=_0x35a251;super(_0x52dd36),this[_0xbeeafd(_0x15eb01._0x5092c1)]={'X_TRANSLATION':this['id']+'_PointEdit_X_TRANSLATION','Y_TRANSLATION':this['id']+_0xbeeafd(_0x15eb01._0x20f02c),'Z_TRANSLATION':this['id']+'_PointEdit_Z_TRANSLATION','XY_TRANSLATION':this['id']+'_PointEdit_XY_TRANSLATION','YZ_TRANSLATION':this['id']+_0xbeeafd(_0x15eb01._0x442a62),'XZ_TRANSLATION':this['id']+'_PointEdit_XZ_TRANSLATION'},this['_hideFeatures']={'X_TRANSLATION':!![],'Y_TRANSLATION':!![],'Z_TRANSLATION':!![],'XY_TRANSLATION':!![],'XZ_TRANSLATION':!![],'YZ_TRANSLATION':!![]},this['_radius']=Cesium__namespace['defaultValue'](_0x52dd36[_0xbeeafd(0x907)],0x64),this['_editMatrix']=new Cesium__namespace['Matrix4'](),this[_0xbeeafd(0x567)]=![],this[_0xbeeafd(0x25f)]='',this[_0xbeeafd(_0x15eb01._0x1978d8)]='',this['_oldPickPrimitive']=undefined,_0x52dd36[_0xbeeafd(_0x15eb01._0x45b40)]&&(this['position']=_0x52dd36['position']);}get[_0x35a251(0xb61)](){const _0x48e643={_0x348ac5:0xdb7},_0x18669b=_0x35a251;return this[_0x18669b(_0x48e643._0x348ac5)];}set['position'](_0x8a1f44){const _0x215f9b={_0x2ca101:0x67b,_0x36b377:0xdb7,_0x5dee31:0xc12},_0x58f326=_0x35a251;this['_position']=LngLatPoint['toCartesian'](_0x8a1f44),this[_0x58f326(0xc12)]=Cesium__namespace[_0x58f326(0x6a7)]['multiplyByUniformScale'](Cesium__namespace[_0x58f326(0x49c)][_0x58f326(_0x215f9b._0x2ca101)](this[_0x58f326(_0x215f9b._0x36b377)]),this['_radius'],this[_0x58f326(_0x215f9b._0x5dee31)]),this[_0x58f326(0x86b)]();}get['radius'](){return this['_radius'];}set['radius'](_0x34b45e){const _0x5c68aa=_0x35a251;this['_radius']=_0x34b45e,this[_0x5c68aa(0xc12)]=Cesium__namespace['Matrix4']['multiplyByUniformScale'](Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](this['_position']),this[_0x5c68aa(0x704)],this['_editMatrix']),this['_createGraphics']();}get['isMoveing'](){const _0x37994f=_0x35a251;if(!this[_0x37994f(0xd79)])return![];return this['_hasChangeEnableInputs'];}['_enabledHook'](_0x19cf62){const _0x4b444b={_0x4e1ca5:0xb32},_0xb4288d=_0x35a251;this[_0xb4288d(_0x4b444b._0x4e1ca5)][_0xb4288d(0x987)]=_0x19cf62,_0x19cf62?this['_bindEvent']():this[_0xb4288d(0xabd)]();}[_0x35a251(0x700)](){const _0x2d0ede={_0x14ba9d:0x679,_0x32ac33:0xb32},_0x5804e9=_0x35a251;this['_drawLayer']=new Cesium__namespace[(_0x5804e9(_0x2d0ede._0x14ba9d))](),this[_0x5804e9(_0x2d0ede._0x32ac33)]['show']=this['show']??!![];}['_addedHook'](){const _0x2e5a79={_0x1e8944:0xfc0},_0x187084=_0x35a251;this['_map']['scene'][_0x187084(0x4e1)]['add'](this['_drawLayer']),this['_createGraphics'](),this[_0x187084(_0x2e5a79._0x1e8944)]();}['_removedHook'](){const _0xbfc6c8={_0x6e2c92:0xb05,_0x19d212:0x1ee},_0x1aa5ab=_0x35a251;this[_0x1aa5ab(0xabd)](),this['_drawLayer'][_0x1aa5ab(_0xbfc6c8._0x6e2c92)](),this['_map']['scene']['primitives'][_0x1aa5ab(_0xbfc6c8._0x19d212)](this['_drawLayer']);}[_0x35a251(0x86b)](){const _0x25ec4f={_0x5c0e21:0xb32,_0x35facc:0xdb7,_0x496b1d:0x10a,_0x5a9c67:0x4af,_0x4768a2:0x10a,_0x4603ba:0x4af,_0x1735b6:0x2a3,_0x457759:0xaa9,_0x11cc98:0xa2a,_0xfb95e9:0x61f,_0x55c048:0x4af},_0x435b9b=_0x35a251;if(!this[_0x435b9b(_0x25ec4f._0x5c0e21)])return;this['_drawLayer'][_0x435b9b(0xb05)]();if(!this[_0x435b9b(_0x25ec4f._0x35facc)])return;const _0x29b6ca=Cesium__namespace['Matrix4'][_0x435b9b(0xd61)](this['_editMatrix']);this['_hideFeatures'][_0x435b9b(_0x25ec4f._0x496b1d)]&&this['_drawLayer'][_0x435b9b(_0x25ec4f._0x5a9c67)](createPolylinePrimitive({'positions':[Cesium__namespace['Cartesian3'][_0x435b9b(0xa84)],Cesium__namespace[_0x435b9b(0x8eb)]['UNIT_X']],'modelMatrix':_0x29b6ca,'id':this['_pointEditElementIDs'][_0x435b9b(_0x25ec4f._0x4768a2)],'color':PointEditElementColors['X_TRANSLATION_COLOR']})),this[_0x435b9b(0xa2a)]['Y_TRANSLATION']&&this['_drawLayer'][_0x435b9b(_0x25ec4f._0x4603ba)](createPolylinePrimitive({'positions':[Cesium__namespace[_0x435b9b(0x8eb)]['ZERO'],Cesium__namespace['Cartesian3'][_0x435b9b(_0x25ec4f._0x1735b6)]],'modelMatrix':_0x29b6ca,'id':this[_0x435b9b(_0x25ec4f._0x457759)]['Y_TRANSLATION'],'color':PointEditElementColors[_0x435b9b(0x603)]})),this[_0x435b9b(_0x25ec4f._0x11cc98)]['Z_TRANSLATION']&&this['_drawLayer']['add'](createPolylinePrimitive({'positions':[Cesium__namespace[_0x435b9b(0x8eb)]['ZERO'],Cesium__namespace[_0x435b9b(0x8eb)][_0x435b9b(_0x25ec4f._0xfb95e9)]],'modelMatrix':_0x29b6ca,'id':this['_pointEditElementIDs']['Z_TRANSLATION'],'color':PointEditElementColors['Z_TRANSLATION_COLOR']})),this['_hideFeatures']['XY_TRANSLATION']&&this['_drawLayer']['add'](createPlanePrimitive({'positions':[0.1,0.1,0x0,0.1,0.3,0x0,0.3,0.3,0x0,0.3,0.1,0x0],'normals':[0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1],'modelMatrix':_0x29b6ca,'id':this['_pointEditElementIDs']['XY_TRANSLATION'],'color':PointEditElementColors['XY_TRANSLATION_COLOR']})),this['_hideFeatures']['YZ_TRANSLATION']&&this['_drawLayer'][_0x435b9b(_0x25ec4f._0x55c048)](createPlanePrimitive({'positions':[0x0,0.1,0.1,0x0,0.1,0.3,0x0,0.3,0.3,0x0,0.3,0.1],'normals':[0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0],'modelMatrix':_0x29b6ca,'id':this['_pointEditElementIDs']['YZ_TRANSLATION'],'color':PointEditElementColors['YZ_TRANSLATION_COLOR']})),this[_0x435b9b(0xa2a)]['XZ_TRANSLATION']&&this[_0x435b9b(0xb32)][_0x435b9b(0x4af)](createPlanePrimitive({'positions':[0.1,0x0,0.1,0.1,0x0,0.3,0.3,0x0,0.3,0.3,0x0,0.1],'normals':[0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0],'modelMatrix':_0x29b6ca,'id':this[_0x435b9b(0xaa9)]['XZ_TRANSLATION'],'color':PointEditElementColors['XZ_TRANSLATION_COLOR']}));}[_0x35a251(0xfc0)](){const _0x38508a={_0x29756c:0xf90,_0x1d7f19:0x4b3,_0x412d1a:0x80e},_0x14bb5f={_0x33f93b:0x988,_0x31b06b:0xaa9,_0x2c06a0:0x12c,_0x115b61:0x208,_0x3c7eb5:0x4e7,_0x224ca6:0xc12,_0x260c2b:0xb7b,_0x28a107:0xdb7,_0x318a9e:0x6a7,_0x3e01d3:0xf8},_0x1f242d={_0x576bdd:0xd79,_0x29e473:0x86b},_0x1dbd36={_0x4184c6:0xd79,_0x3251ef:0xc60},_0x581288=_0x35a251;this['_unbindEvent'](),this[_0x581288(0x4b3)]=new Cesium__namespace[(_0x581288(0x548))](this['_map'][_0x581288(0xee1)]),this['_handler']['setInputAction'](_0x43964b=>{const _0x53a030=_0x581288,_0x3a7dd7=drillPickTransformHelperComponent(this[_0x53a030(_0x1dbd36._0x4184c6)][_0x53a030(_0x1dbd36._0x3251ef)],_0x43964b['position'],this['_pointEditElementIDs']);_0x3a7dd7&&(this['_map']['scene']['screenSpaceCameraController']['enableInputs']=![],this['_isLeftDown']=!![],this['_pickedId']=_0x3a7dd7['id']);},Cesium__namespace['ScreenSpaceEventType'][_0x581288(_0x38508a._0x29756c)]),this[_0x581288(_0x38508a._0x1d7f19)][_0x581288(_0x38508a._0x412d1a)](()=>{const _0x12da4e=_0x581288;this[_0x12da4e(_0x1f242d._0x576bdd)]['scene']['screenSpaceCameraController']['enableInputs']=!![],this['_isLeftDown']=![],this['_pickedId']='',Cesium__namespace['defined'](this['_oldPickedId'])&&this['_oldPickedId']!==''&&(setPointEditElementColorsForId(this['_oldPickedId'],getPointEditElementColorsForId(this['_oldPickedId'],this['_pointEditElementIDs']),this[_0x12da4e(0xaa9)]),this['_oldPickedId']='',this[_0x12da4e(_0x1f242d._0x29e473)]());},Cesium__namespace['ScreenSpaceEventType'][_0x581288(0x351)]),this['_handler']['setInputAction'](_0x2f793c=>{const _0x2e5477=_0x581288;let _0x1e7ffa=![];if(Cesium__namespace['defined'](this[_0x2e5477(_0x14bb5f._0x33f93b)])){var _0x5c3863;const _0x12d5fa=(_0x5c3863=this['_oldPickPrimitive'])===null||_0x5c3863===void 0x0?void 0x0:_0x5c3863[_0x2e5477(0xcbc)];if(_0x12d5fa&&_0x12d5fa[0x0]){const _0x45332d=this['_oldPickPrimitive']['appearance']['material'][_0x2e5477(0xa8b)];_0x45332d[_0x2e5477(0x9db)]=getPointEditElementColorsForId(_0x12d5fa[0x0],this[_0x2e5477(_0x14bb5f._0x31b06b)]),this[_0x2e5477(0x988)]=undefined;}}if(this['_isLeftDown']){Cesium__namespace['defined'](this['_pickedId'])&&this['_pickedId']!==''&&(setPointEditElementColorsForId(this['_pickedId'],HighlightColor,this[_0x2e5477(_0x14bb5f._0x31b06b)]),this[_0x2e5477(_0x14bb5f._0x2c06a0)]=this['_pickedId'],_0x1e7ffa=!![]);const _0xddcaa4=this['_map']['scene'];let _0xa28765=_0xddcaa4['pickPosition'](_0x2f793c[_0x2e5477(_0x14bb5f._0x115b61)]),_0x45eeba=_0xddcaa4['pickPosition'](_0x2f793c['endPosition']);const _0x5099ab=new Cesium__namespace['Cartesian2']();!Cesium__namespace['defined'](_0xa28765)&&(_0x5099ab['x']=_0x2f793c['startPosition']['x'],_0x5099ab['y']=_0xddcaa4['canvas']['clientHeight']-_0x2f793c['startPosition']['y'],_0xa28765=getWorldPositionFromWindowPosition(_0xddcaa4,_0x5099ab));!Cesium__namespace['defined'](_0x45eeba)&&(_0x5099ab['x']=_0x2f793c['endPosition']['x'],_0x5099ab['y']=_0xddcaa4[_0x2e5477(0xee1)][_0x2e5477(_0x14bb5f._0x3c7eb5)]-_0x2f793c['endPosition']['y'],_0x45eeba=getWorldPositionFromWindowPosition(_0xddcaa4,_0x5099ab));if(Cesium__namespace['defined'](_0xa28765)&&Cesium__namespace['defined'](_0x45eeba)){const _0x3680a5=getChangeMatrixByMovingMouse(this,_0xa28765,_0x45eeba,this['_pointEditElementIDs']);Cesium__namespace[_0x2e5477(0xaa2)](_0x3680a5)&&(this[_0x2e5477(_0x14bb5f._0x224ca6)]=Cesium__namespace['Matrix4'][_0x2e5477(_0x14bb5f._0x260c2b)](this['_editMatrix'],_0x3680a5,new Cesium__namespace['Matrix4']()),this[_0x2e5477(_0x14bb5f._0x28a107)]=Cesium__namespace[_0x2e5477(_0x14bb5f._0x318a9e)]['getTranslation'](this['_editMatrix'],this['_position']),this['onChange']({'position':this['_position']}),_0x1e7ffa=!![]);}_0x1e7ffa&&this['_createGraphics']();}else{const _0x2eacf0=drillPickTransformHelperComponent(this[_0x2e5477(0xd79)]['scene'],_0x2f793c[_0x2e5477(0x37e)],this['_pointEditElementIDs']);if(_0x2eacf0){const _0x37986a=_0x2eacf0[_0x2e5477(0x6f2)][_0x2e5477(_0x14bb5f._0x3e01d3)]['material']['uniforms'];_0x37986a['color']=HighlightColor,this['_oldPickPrimitive']=_0x2eacf0['primitive'];}}},Cesium__namespace['ScreenSpaceEventType']['MOUSE_MOVE']);}[_0x35a251(0xabd)](){const _0x3a26d9={_0x234250:0xa63},_0x12240a=_0x35a251;this['_handler']&&(this['_handler'][_0x12240a(_0x3a26d9._0x234250)](),delete this['_handler']);}['onChange'](_0x277ebf){const _0x2aaf02={_0x3c8907:0xe86,_0x15f0bd:0xa6e},_0x2c2907=_0x35a251;this['options']['onChange']&&this[_0x2c2907(_0x2aaf02._0x3c8907)][_0x2c2907(_0x2aaf02._0x15f0bd)](_0x277ebf),this['fire'](EventType[_0x2c2907(0x9f2)],_0x277ebf,!![]);}}function createPolylinePrimitive(_0x93c014){const _0xbe6223={_0x410d1a:0xe0f},_0x557678=_0x35a251,{positions:_0x3ba5e8,modelMatrix:_0xc228ce,color:_0x1438bf,id:_0x13c586}=_0x93c014,_0x4990a6=new Cesium__namespace['PolylineMaterialAppearance']({'material':Cesium__namespace['Material'][_0x557678(_0xbe6223._0x410d1a)](Cesium__namespace[_0x557678(0x100)]['PolylineArrowType'],{'color':_0x1438bf})});return new Cesium__namespace[(_0x557678(0x21c))]({'geometryInstances':new Cesium__namespace[(_0x557678(0x291))]({'geometry':new Cesium__namespace[(_0x557678(0x108))]({'positions':_0x3ba5e8,'width':0xf,'vertexFormat':Cesium__namespace['PolylineMaterialAppearance']['VERTEX_FORMAT'],'arcType':Cesium__namespace['ArcType']['NONE']}),'modelMatrix':_0xc228ce,'id':_0x13c586}),'appearance':_0x4990a6,'depthFailAppearance':_0x4990a6,'asynchronous':![]});}function createPlanePrimitive(_0x3a37db){const _0x1c866b={_0x5cf934:0xdeb,_0x1d42ee:0x2ed},_0x2da25a=_0x35a251,{positions:_0x46b81a,modelMatrix:_0x3f8571,normals:_0x2170d8,color:_0x52a9fb,id:_0x1bd9d7}=_0x3a37db,_0x16d9e7=new Cesium__namespace['MaterialAppearance']({'closed':![],'flat':!![],'materialSupport':Cesium__namespace['MaterialAppearance']['MaterialSupport']['BASIC'],'material':Cesium__namespace['Material']['fromType'](Cesium__namespace['Material']['ColorType'],{'color':_0x52a9fb})});return new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace[(_0x2da25a(_0x1c866b._0x5cf934))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':new Float64Array(_0x46b81a)}),'normal':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array(_0x2170d8)})},'indices':new Uint16Array([0x0,0x1,0x2,0x0,0x2,0x3]),'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':Cesium__namespace[_0x2da25a(_0x1c866b._0x1d42ee)]['fromVertices'](_0x46b81a)}),'modelMatrix':_0x3f8571,'id':_0x1bd9d7}),'appearance':_0x16d9e7,'depthFailAppearance':_0x16d9e7,'asynchronous':![]});}function isTransformHelperComponent(_0x46eb3c,_0xd16c8b){for(const _0x30270e in _0xd16c8b){if(Object['hasOwnProperty']['call'](_0xd16c8b,_0x30270e)){const _0x4bac1a=_0xd16c8b[_0x30270e];if(_0x46eb3c===_0x4bac1a)return!![];}}return![];}function getWorldPositionFromWindowPosition(_0x1eddf8,_0x41b8de){const _0x3ab324=0.1,_0x581c76=Cesium__namespace['SceneTransforms']['transformWindowToDrawingBuffer'](_0x1eddf8,_0x41b8de,new Cesium__namespace['Cartesian2']());return Cesium__namespace['SceneTransforms']['drawingBufferToWgs84Coordinates'](_0x1eddf8,_0x581c76,_0x3ab324);}function getChangeMatrixByMovingMouse(_0x1e0934,_0xfbc4e1,_0x2db309,_0x58bc68){const _0x38f9e3={_0xaac96e:0xd61,_0x3c644b:0x6a7,_0x10eead:0x7d,_0x1ba8f0:0x8eb,_0x1adc1e:0xd61,_0x550281:0x380,_0x3e7d60:0x9a0,_0x5c1cd7:0x8eb,_0x55875b:0x8eb,_0x415acc:0xefc,_0x5ba40b:0x2a9,_0x103591:0x7e2,_0x1079b6:0x8eb,_0x3c5747:0x8c},_0x5f09d5=_0x35a251,_0x281453=_0x1e0934['_pickedId'],_0x3fe5ef=Cesium__namespace['Matrix4'][_0x5f09d5(_0x38f9e3._0xaac96e)](_0x1e0934[_0x5f09d5(0xc12)]),_0x239aac=Cesium__namespace['Matrix4']['inverse'](_0x3fe5ef,new Cesium__namespace[(_0x5f09d5(_0x38f9e3._0x3c644b))]()),_0xf7930a=_0x1e0934[_0x5f09d5(0xd79)][_0x5f09d5(_0x38f9e3._0x10eead)]['positionWC'],_0x55f506=Cesium__namespace[_0x5f09d5(0x6a7)]['multiplyByPoint'](_0x239aac,_0xf7930a,new Cesium__namespace[(_0x5f09d5(0x8eb))]());Cesium__namespace['Cartesian3'][_0x5f09d5(0xebd)](_0x55f506,_0x55f506);const _0x33e6dd=Cesium__namespace['Cartesian3']['subtract'](_0xfbc4e1,_0xf7930a,new Cesium__namespace['Cartesian3']()),_0x244d2f=Cesium__namespace[_0x5f09d5(_0x38f9e3._0x1ba8f0)]['subtract'](_0x2db309,_0xf7930a,new Cesium__namespace['Cartesian3']()),_0x3cc4eb=new Cesium__namespace['Ray'](_0xf7930a,_0x33e6dd),_0x28f3eb=new Cesium__namespace['Ray'](_0xf7930a,_0x244d2f),_0x377794=new Cesium__namespace[(_0x5f09d5(_0x38f9e3._0x1ba8f0))]();if(_0x281453===_0x58bc68[_0x5f09d5(0x720)])Cesium__namespace['Cartesian3'][_0x5f09d5(_0x38f9e3._0x1adc1e)](Cesium__namespace['Cartesian3']['UNIT_Z'],_0x377794);else{if(_0x281453===_0x58bc68[_0x5f09d5(_0x38f9e3._0x550281)])Cesium__namespace['Cartesian3']['clone'](Cesium__namespace['Cartesian3'][_0x5f09d5(_0x38f9e3._0x3e7d60)],_0x377794);else{if(_0x281453===_0x58bc68['XZ_TRANSLATION'])Cesium__namespace['Cartesian3']['clone'](Cesium__namespace[_0x5f09d5(_0x38f9e3._0x5c1cd7)][_0x5f09d5(0x2a3)],_0x377794);else{if(_0x281453===_0x58bc68['X_TRANSLATION']||_0x281453===_0x58bc68['Y_TRANSLATION']||_0x281453===_0x58bc68['Z_TRANSLATION']){let _0x1dbccc=Cesium__namespace['Cartesian3']['ZERO'];if(_0x281453===_0x58bc68['X_TRANSLATION'])_0x1dbccc=Cesium__namespace['Cartesian3']['UNIT_X'];else{if(_0x281453===_0x58bc68['Y_TRANSLATION'])_0x1dbccc=Cesium__namespace['Cartesian3']['UNIT_Y'];else _0x281453===_0x58bc68['Z_TRANSLATION']&&(_0x1dbccc=Cesium__namespace[_0x5f09d5(_0x38f9e3._0x5c1cd7)]['UNIT_Z']);}const _0x463f10=new Cesium__namespace[(_0x5f09d5(_0x38f9e3._0x55875b))]();Cesium__namespace['Cartesian3']['cross'](_0x55f506,_0x1dbccc,_0x463f10),Cesium__namespace[_0x5f09d5(_0x38f9e3._0x55875b)]['cross'](_0x1dbccc,_0x463f10,_0x377794),Cesium__namespace['Cartesian3']['normalize'](_0x377794,_0x377794);}}}}const _0x28c9df=new Cesium__namespace[(_0x5f09d5(_0x38f9e3._0x415acc))](_0x377794,0x0);Cesium__namespace[_0x5f09d5(0xefc)][_0x5f09d5(0x21a)](_0x28c9df,_0x3fe5ef,_0x28c9df);const _0xafe6d8=Cesium__namespace['IntersectionTests']['rayPlane'](_0x3cc4eb,_0x28c9df),_0x474338=Cesium__namespace['IntersectionTests'][_0x5f09d5(_0x38f9e3._0x5ba40b)](_0x28f3eb,_0x28c9df);if(!Cesium__namespace['defined'](_0xafe6d8)||!Cesium__namespace['defined'](_0x474338))return undefined;const _0x195834=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x239aac,_0xafe6d8,new Cesium__namespace['Cartesian3']()),_0x1be882=Cesium__namespace['Matrix4'][_0x5f09d5(_0x38f9e3._0x103591)](_0x239aac,_0x474338,new Cesium__namespace['Cartesian3']()),_0x4dc3db=new Cesium__namespace[(_0x5f09d5(0x8eb))]();Cesium__namespace[_0x5f09d5(_0x38f9e3._0x1079b6)][_0x5f09d5(0xc61)](_0x1be882,_0x195834,_0x4dc3db);if(_0x281453===_0x58bc68['X_TRANSLATION'])_0x4dc3db['y']=0x0,_0x4dc3db['z']=0x0;else{if(_0x281453===_0x58bc68[_0x5f09d5(_0x38f9e3._0x3c5747)])_0x4dc3db['x']=0x0,_0x4dc3db['z']=0x0;else{if(_0x281453===_0x58bc68['Z_TRANSLATION'])_0x4dc3db['x']=0x0,_0x4dc3db['y']=0x0;else{if(_0x281453===_0x58bc68['XY_TRANSLATION'])_0x4dc3db['z']=0x0;else{if(_0x281453===_0x58bc68[_0x5f09d5(0x380)])_0x4dc3db['x']=0x0;else _0x281453===_0x58bc68['XZ_TRANSLATION']&&(_0x4dc3db['y']=0x0);}}}}return Cesium__namespace['Matrix4']['fromTranslation'](_0x4dc3db,new Cesium__namespace[(_0x5f09d5(_0x38f9e3._0x3c644b))]());}function setPointEditElementColorsForId(_0x5f2362,_0x2d26d5,_0x3868a0){const _0x36a299={_0x3d818b:0xeab},_0x3f7165=_0x35a251;switch(_0x5f2362){case _0x3868a0[_0x3f7165(0x10a)]:PointEditElementColors['X_TRANSLATION_COLOR']=_0x2d26d5;break;case _0x3868a0['Y_TRANSLATION']:PointEditElementColors[_0x3f7165(0x603)]=_0x2d26d5;break;case _0x3868a0['Z_TRANSLATION']:PointEditElementColors['Z_TRANSLATION_COLOR']=_0x2d26d5;break;case _0x3868a0['XZ_TRANSLATION']:PointEditElementColors['XZ_TRANSLATION_COLOR']=_0x2d26d5;break;case _0x3868a0['XY_TRANSLATION']:PointEditElementColors[_0x3f7165(_0x36a299._0x3d818b)]=_0x2d26d5;break;case _0x3868a0['YZ_TRANSLATION']:PointEditElementColors['YZ_TRANSLATION_COLOR']=_0x2d26d5;break;}}function getPointEditElementColorsForId(_0x548926,_0xa56887){const _0x372244=_0x35a251;let _0x4ecb8d;switch(_0x548926){case _0xa56887['X_TRANSLATION']:case _0xa56887['YZ_TRANSLATION']:_0x4ecb8d=Cesium__namespace['Color']['RED']['withAlpha'](0.6);break;case _0xa56887['Y_TRANSLATION']:case _0xa56887['XZ_TRANSLATION']:_0x4ecb8d=Cesium__namespace['Color']['GREEN']['withAlpha'](0.6);break;case _0xa56887[_0x372244(0x6e9)]:case _0xa56887[_0x372244(0x720)]:_0x4ecb8d=Cesium__namespace['Color']['BLUE']['withAlpha'](0.6);break;}return _0x4ecb8d;}function drillPickTransformHelperComponent(_0x930bbb,_0x50a7e5,_0x425e94){const _0xe65b75=_0x930bbb['drillPick'](_0x50a7e5),_0x2fbe44=_0xe65b75['length'];let _0x447fbc;for(let _0x195f82=0x0;_0x195f82<_0x2fbe44;_0x195f82++){const _0x1ccbdc=_0xe65b75[_0x195f82];if(_0x1ccbdc&&_0x1ccbdc['id']&&isTransformHelperComponent(_0x1ccbdc['id'],_0x425e94)){_0x447fbc=_0x1ccbdc;break;}}return _0x447fbc;}var index$3={'__proto__':null,'Underground':Underground,'Sightline':Sightline,'Skyline':Skyline,'SkylineBody':SkylineBody,'Shadows':Shadows,'Measure':Measure,'FloodByGraphic':FloodByGraphic,'Slope':Slope,'TerrainPlanClip':TerrainPlanClip,'FloodByMaterial':FloodByMaterial,'TerrainClip':TerrainClip,'ContourLine':ContourLine,'TerrainFlat':TerrainFlat,'TerrainUplift':TerrainUplift,'LimitHeight':LimitHeight,'TilesetPlanClip':TilesetPlanClip,'ModelPlanClip':ModelPlanClip,'TilesetBoxClip':TilesetBoxClip,'TilesetClip':TilesetClip,'TilesetFlood':TilesetFlood,'TilesetFlat':TilesetFlat,'FirstPersonRoam':FirstPersonRoam,'StreetView':StreetView,'CameraHistory':CameraHistory,'RotatePoint':RotatePoint,'RotateOut':RotateOut,'MatrixMove':MatrixMove,'MatrixRotate':MatrixRotate,'MatrixMove2':MatrixMove2};class BaseEffect extends BaseThing{get['type'](){const _0x63224a={_0x4dfab8:0x859},_0x2b8d65=_0x35a251;return this[_0x2b8d65(_0x63224a._0x4dfab8)];}get['target'](){return this['_postProcessStage'];}get['uniforms'](){var _0x1981cd;return(_0x1981cd=this['_postProcessStage'])===null||_0x1981cd===void 0x0?void 0x0:_0x1981cd['uniforms'];}['addTo'](_0x18a647){return _0x18a647&&_0x18a647['addEffect']&&_0x18a647['addEffect'](this),this;}[_0x35a251(0x1ee)](_0x9b5ae2){const _0x5d5e33=_0x35a251;this[_0x5d5e33(0xd79)]&&this['_map']['removeEffect'](this,_0x9b5ae2);}['_enabledHook'](_0x205d0f){this['_postProcessStage']&&(this['_postProcessStage']['enabled']=_0x205d0f);}['_setOptionsHook'](_0x5f00c0,_0x2f8feb){for(const _0x198031 in _0x2f8feb){if(_0x198031==='enabled')continue;this[_0x198031]=_0x2f8feb[_0x198031];}}['_addedBaseHook'](){const _0x4b947b={_0x1e0407:0x226},_0x20b041=_0x35a251;!this['_postProcessStage']&&this['_mountedHook'](),this['_enabledHook'](this['enabled']),this[_0x20b041(_0x4b947b._0x1e0407)]&&this['_map']['scene']['postProcessStages']['add'](this['_postProcessStage']);}['_removedBaseHook'](){const _0x2145f9={_0x590a30:0x226,_0x39c3c2:0x1ee},_0x521225=_0x35a251;this[_0x521225(_0x2145f9._0x590a30)]&&(this['_map'][_0x521225(0xc60)][_0x521225(0x140)][_0x521225(_0x2145f9._0x39c3c2)](this['_postProcessStage']),this['_postProcessStage']['isDestroyed']()&&delete this[_0x521225(_0x2145f9._0x590a30)]);}[_0x35a251(0x264)](_0x41df4e,_0x27fdc7={},_0x38563b){const _0x3e9e1e=_0x35a251;return!_0x27fdc7['effect']&&(_0x27fdc7[_0x3e9e1e(0x49d)]=this),super[_0x3e9e1e(0x264)](_0x41df4e,_0x27fdc7,_0x38563b);}['_getPickIds'](_0x3f7571){const _0xac5abc={_0x2126fb:0x45a,_0x347364:0x6de},_0x557df7=_0x35a251;let _0x4e6294=[];return _0x3f7571[_0x557df7(0xdbd)](_0x135f22=>{const _0x51052d=_0x557df7;_0x135f22['czmObject']&&(_0x135f22=_0x135f22['czmObject']);if(_0x135f22['_pickIds'])_0x4e6294=_0x4e6294['concat'](this['_getPickIds'](_0x135f22[_0x51052d(0x588)]));else _0x135f22['pickId']?_0x4e6294=_0x4e6294['concat'](this['_getPickIds']([_0x135f22[_0x51052d(_0xac5abc._0x2126fb)]])):_0x4e6294[_0x51052d(_0xac5abc._0x347364)]({'pickId':_0x135f22});}),_0x4e6294;}}var FogFS='float\x20getDistance(sampler2D\x20depthTexture,\x20vec2\x20texCoords)\x20{\x0a\x20\x20float\x20depth\x20=\x20czm_unpackDepth(texture(depthTexture,\x20texCoords));\x0a\x20\x20if(depth\x20==\x200.0)\x20{\x0a\x20\x20\x20\x20return\x20czm_infinity;\x0a\x20\x20}\x0a\x20\x20vec4\x20eyeCoordinate\x20=\x20czm_windowToEyeCoordinates(gl_FragCoord.xy,\x20depth);\x0a\x20\x20return\x20-eyeCoordinate.z\x20/\x20eyeCoordinate.w;\x0a}\x0afloat\x20interpolateByDistance(vec4\x20nearFarScalar,\x20float\x20distance)\x20{\x0a\x20\x20float\x20startDistance\x20=\x20nearFarScalar.x;\x0a\x20\x20float\x20startValue\x20=\x20nearFarScalar.y;\x0a\x20\x20float\x20endDistance\x20=\x20nearFarScalar.z;\x0a\x20\x20float\x20endValue\x20=\x20nearFarScalar.w;\x0a\x20\x20float\x20t\x20=\x20clamp((distance\x20-\x20startDistance)\x20/\x20(endDistance\x20-\x20startDistance),\x200.0,\x201.0);\x0a\x20\x20return\x20mix(startValue,\x20endValue,\x20t);\x0a}\x0avec4\x20alphaBlend(vec4\x20sourceColor,\x20vec4\x20destinationColor)\x20{\x0a\x20\x20return\x20sourceColor\x20*\x20vec4(sourceColor.aaa,\x201.0)\x20+\x20destinationColor\x20*\x20(1.0\x20-\x20sourceColor.a);\x0a}\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0auniform\x20vec4\x20fogByDistance;\x0auniform\x20vec4\x20fogColor;\x0ain\x20vec2\x20v_textureCoordinates;\x0avoid\x20main(void)\x20{\x0a\x20\x20float\x20distance\x20=\x20getDistance(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20sceneColor\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20float\x20blendAmount\x20=\x20interpolateByDistance(fogByDistance,\x20distance);\x0a\x20\x20vec4\x20finalFogColor\x20=\x20vec4(fogColor.rgb,\x20fogColor.a\x20*\x20blendAmount);\x0a\x20\x20out_FragColor\x20=\x20alphaBlend(finalFogColor,\x20sceneColor);\x0a}\x0a';class FogEffect extends BaseEffect{constructor(_0x1d7703={}){const _0x4dc383={_0x37473f:0xb9f,_0xc16608:0xf29,_0x311eb0:0x9a2,_0x57ca98:0x571},_0x4d710f=_0x35a251;super(_0x1d7703),this['fogByDistance']=_0x1d7703[_0x4d710f(0x808)]??new Cesium__namespace[(_0x4d710f(_0x4dc383._0x37473f))](0xa,0x0,0x3e8,0.9),this['color']=getCesiumColor(_0x1d7703['color'],Cesium__namespace[_0x4d710f(_0x4dc383._0xc16608)][_0x4d710f(_0x4dc383._0x311eb0)]),this[_0x4d710f(0x571)]=_0x1d7703[_0x4d710f(_0x4dc383._0x57ca98)]??0x2328,this['_setOptionsHook'](_0x1d7703);}['_setOptionsHook'](_0x2655b2,_0x1940ed){const _0x52e71d=_0x35a251;Cesium__namespace[_0x52e71d(0xaa2)](_0x2655b2['fogByDistance_near'])&&(this['fogByDistance']['x']=_0x2655b2['fogByDistance_near']),Cesium__namespace[_0x52e71d(0xaa2)](_0x2655b2['fogByDistance_nearValue'])&&(this['fogByDistance']['y']=_0x2655b2['fogByDistance_nearValue']),Cesium__namespace['defined'](_0x2655b2[_0x52e71d(0x661)])&&(this['fogByDistance']['z']=_0x2655b2[_0x52e71d(0x661)]),Cesium__namespace['defined'](_0x2655b2['fogByDistance_farValue'])&&(this['fogByDistance']['w']=_0x2655b2['fogByDistance_farValue']),Cesium__namespace[_0x52e71d(0xaa2)](_0x1940ed===null||_0x1940ed===void 0x0?void 0x0:_0x1940ed['color'])&&(this['color']=getCesiumColor(_0x2655b2['color'],Cesium__namespace['Color']['WHITE'])),this[_0x52e71d(0x571)]=_0x2655b2['maxHeight']??0x2328;}['_mountedHook'](){const _0x26c184={_0x3e5f9f:0x226,_0x4e3c70:0x4ee},_0x391344=_0x35a251;this[_0x391344(_0x26c184._0x3e5f9f)]=new Cesium__namespace['PostProcessStage']({'name':this[_0x391344(_0x26c184._0x4e3c70)],'fragmentShader':FogFS,'uniforms':{'fogByDistance':()=>{return this['fogByDistance'];},'fogColor':()=>{return this['color'];}},'enabled':this[_0x391344(0x2a6)]});}['_addedHook'](){const _0x421892={_0xd5fb5e:0x7d},_0x514ea3=_0x35a251;this['_map']['scene'][_0x514ea3(_0x421892._0xd5fb5e)]['changed']['addEventListener'](this['camera_changedHandler'],this);}[_0x35a251(0xa9a)](){const _0x454867=_0x35a251;this['_map'][_0x454867(0xc60)]['camera']['changed']['removeEventListener'](this['camera_changedHandler'],this);}['camera_changedHandler'](_0x32db77){const _0x374d3a={_0x560671:0x682},_0x56dfa9=_0x35a251;this['_map'][_0x56dfa9(0x7d)]['positionCartographic'][_0x56dfa9(_0x374d3a._0x560671)]0x8)throw new Cesium__namespace['DeveloperError']('CesiumRenderPass:textureScale必须大于0小于等于8');function _0x35039c(_0x4ec9a2,_0x1608e8,_0x32fd31,_0x3df8e7){const _0x3b6a29=_0x33f715;let _0x279e70=_0x4ec9a2[_0x3b6a29(0x9ae)]['getDerivedShaderProgram'](_0x1608e8,_0x2a4069);if(!Cesium__namespace[_0x3b6a29(_0x5c373f._0x5430cf)](_0x279e70)){const _0x4e54e2=_0x1608e8[_0x3b6a29(0x85c)];let _0x38f822=_0x1608e8['fragmentShaderSource'],_0x526308=_0x1608e8['vertexShaderSource'];const _0x3fdc49=_0x1608e8['_vertexShaderText'];let _0x4aa96a=_0x38f822['sources'],_0x57e85b=_0x4aa96a['length'],_0x4df9a7=!!_0x680812&&_0x3bae55(),_0x502142=cmz_selected_glsl;const _0x2a282f=/texture\s?\(\s?model_pickTexture\s?,\s?selectedFeature.st\s?\)/['test'](_0x32fd31);_0x3df8e7==='varying'&&!_0x2a282f?_0x502142+='\x0ain\x20float\x20me_isSelected;\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20bool\x20isSelected=\x20me_isSelected>0.0000001;\x0a\x20\x20\x20\x20if(!isSelected){\x0a\x20\x20\x20\x20\x20\x20\x20\x20isSelected=\x20czm_selected('+_0x32fd31+_0x3b6a29(0xbfe):_0x502142+='\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20return\x20czm_selected('+_0x32fd31+_0x3b6a29(0x2d7);const _0x159418=cmz_selected_glsl+('\x0aout\x20float\x20me_isSelected;\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20return\x20czm_selected('+_0x32fd31+_0x3b6a29(_0x5c373f._0x1a0bbc));let _0x2187e8=![],_0x126cc3=![];if(/in\s?vec3\s?normal\s?;/[_0x3b6a29(_0x5c373f._0x29c02a)](_0x3fdc49)||/\n\s?vec3\s?normal\s?;/[_0x3b6a29(0x342)](_0x3fdc49))_0x2187e8=!![];else/out\s?vec3\s?v_normal\s?;/['test'](_0x3fdc49)&&(_0x126cc3=!![]);if(_0x529ba0){let _0x43a54c=![];for(let _0x30da6f=0x0;_0x30da6f<_0x57e85b;++_0x30da6f){if(/vec4\s?packDepthToRGBA\s?\(/[_0x3b6a29(_0x5c373f._0x1d71c5)](_0x4aa96a[_0x30da6f])){_0x43a54c=!![];break;}}const _0x4ddc4f=(_0x43a54c?'':packing_glsl)+(_0x4df9a7?_0x502142:'')+Cesium__namespace['ShaderSource'][_0x3b6a29(_0x5c373f._0x19da88)](_0x529ba0,_0x7db613)+'void\x20main()\x20\x0a'+'{\x20\x0a'+(_0x393ac8!=='replace'?'\x20\x20\x20\x20'+_0x3cb88f+'();\x20\x0a':'')+(_0x3b6a29(_0x5c373f._0x3f4c15)+_0x7db613+_0x3b6a29(_0x5c373f._0xb18240))+'}\x20\x0a',_0x3d8fff=new Array(_0x57e85b+0x1);for(let _0xc6cf77=0x0;_0xc6cf77<_0x57e85b;++_0xc6cf77){_0x3d8fff[_0xc6cf77]=Cesium__namespace[_0x3b6a29(_0x5c373f._0x480f6e)]['replaceMain'](_0x4aa96a[_0xc6cf77],_0x3cb88f);}_0x3d8fff[_0x57e85b]=_0x4ddc4f;if(_0x2187e8)_0x38f822['defines']['push'](_0x3b6a29(_0x5c373f._0x5cffe5));else _0x126cc3&&_0x38f822['defines']['push']('HAS_V_NORMAL_MARS3D');_0x38f822=new Cesium__namespace[(_0x3b6a29(_0x5c373f._0x5b384d))]({'sources':_0x3d8fff,'defines':_0x38f822[_0x3b6a29(0x508)]});}if(_0x2b87a1||_0x529ba0){_0x4aa96a=_0x526308[_0x3b6a29(0x8f9)],_0x57e85b=_0x4aa96a['length'];let _0x21ad6b=![];for(let _0x37225b=0x0;_0x37225b<_0x57e85b;++_0x37225b){if(/vec4\s?packDepthToRGBA\s?\(/['test'](_0x4aa96a[_0x37225b])){_0x21ad6b=!![];break;}}_0x4df9a7=_0x4df9a7&&_0x3df8e7==='varying'&&!_0x2a282f;if(_0x2187e8)_0x526308['defines']['push'](_0x3b6a29(_0x5c373f._0x31593e));else _0x126cc3&&_0x526308[_0x3b6a29(0x508)]['push']('HAS_V_NORMAL_MARS3D');const _0x3ba497=(_0x21ad6b?'':packing_glsl)+(_0x4df9a7?_0x159418:'')+Cesium__namespace[_0x3b6a29(0xb60)][_0x3b6a29(0x670)](_0x2b87a1||'void\x20main(){}',_0x7db613)+'void\x20main()\x20\x0a'+_0x3b6a29(_0x5c373f._0x4c7c97)+(_0x393ac8!==_0x3b6a29(_0x5c373f._0x4cdb4a)?_0x3b6a29(_0x5c373f._0x3f4c15)+_0x3cb88f+'();\x20\x0a':'')+(_0x4df9a7?_0x3b6a29(0x7db):'')+(_0x3b6a29(0x4ad)+_0x7db613+'();\x20\x0a')+'}\x20\x0a',_0x3e537a=new Array(_0x57e85b+0x1);for(let _0x1cdd81=0x0;_0x1cdd81<_0x57e85b;++_0x1cdd81){_0x3e537a[_0x1cdd81]=Cesium__namespace['ShaderSource'][_0x3b6a29(0x670)](_0x4aa96a[_0x1cdd81],_0x3cb88f);}_0x3e537a[_0x57e85b]=_0x3ba497,_0x526308=new Cesium__namespace['ShaderSource']({'sources':_0x3e537a,'defines':_0x526308['defines']});}_0x279e70=_0x4ec9a2[_0x3b6a29(_0x5c373f._0x4b8b2c)]['createDerivedShaderProgram'](_0x1608e8,_0x2a4069,{'vertexShaderSource':_0x526308,'fragmentShaderSource':_0x38f822,'attributeLocations':_0x4e54e2});}return _0x279e70;}function _0x3bf997(_0x11a9f4,_0x54ae97){const _0x1c9019=_0x33f715;_0x11a9f4['_renderPassCache']=_0x11a9f4['_renderPassCache']||{},_0x11a9f4[_0x1c9019(0xc7d)][_0x598921]=_0x11a9f4['_renderPassCache'][_0x598921]||{};const _0x4deb44=_0x11a9f4[_0x1c9019(0xc7d)][_0x598921];let _0x3b2991=_0x4deb44[_0x54ae97['id']];if(!Cesium__namespace['defined'](_0x3b2991)){const _0x458731=Cesium__namespace[_0x1c9019(_0x481284._0x494fc4)][_0x1c9019(_0x481284._0x8977c4)](_0x54ae97);typeof _0x102536===_0x1c9019(_0x481284._0x46e078)&&_0x102536[_0x1c9019(_0x481284._0x402a7c)](_0x283780,_0x458731),_0x3b2991=Cesium__namespace['RenderState']['fromCache'](_0x458731),_0x4deb44[_0x54ae97['id']]=_0x3b2991;}return _0x3b2991;}function _0x16b21b(_0x36946a,_0x56bbda,_0x1be1e0){const _0x39e301=_0x33f715,_0x5e95c6=_0x36946a,_0x338265=_0x56bbda[_0x39e301(0x44f)];let _0x29143d=_0x36946a['derivedCommands'];if(!Cesium__namespace['defined'](_0x29143d))return;_0x338265['useLogDepth']&&Cesium__namespace['defined'](_0x29143d['logDepth'])&&(_0x36946a=_0x29143d['logDepth']['command']);_0x29143d=_0x36946a['derivedCommands'];let _0x313bf5=_0x29143d[_0x39e301(_0x157825._0xad4fe9)];!Cesium__namespace['defined'](_0x29143d['renderPass'])&&(_0x313bf5=_0x29143d['renderPass']={});let _0x56f7ee,_0x2e506c;Cesium__namespace['defined'](_0x313bf5[_0x4e9ed5])&&(_0x56f7ee=_0x313bf5[_0x4e9ed5]['shaderProgram'],_0x2e506c=_0x313bf5[_0x4e9ed5][_0x39e301(0x5b0)]);_0x313bf5[_0x4e9ed5]=Cesium__namespace['DrawCommand'][_0x39e301(0xd52)](_0x36946a,_0x313bf5[_0x4e9ed5]);if(!Cesium__namespace['defined'](_0x56f7ee)||_0x313bf5['shaderProgramId']!==_0x36946a[_0x39e301(0x57f)]['id']){const _0x39a472=_0x36946a[_0x39e301(_0x157825._0x45b4a5)],_0x17cd81=_0x5e95c6['_pickIdQualifier']=new RegExp('uniform\x5cs?vec4\x5cs?'+_0x36946a['pickId'],'g')['test'](_0x39a472['_fragmentShaderText'])?_0x39e301(0x94):'varying';_0x313bf5[_0x4e9ed5][_0x39e301(_0x157825._0x456585)]=_0x35039c(_0x1be1e0,_0x39a472,_0x36946a['pickId'],_0x17cd81),_0x313bf5[_0x4e9ed5][_0x39e301(0x5b0)]=_0x3bf997(_0x56bbda,_0x36946a[_0x39e301(0x5b0)]),_0x313bf5['shaderProgramId']=_0x36946a['shaderProgram']['id'];}else _0x313bf5[_0x4e9ed5][_0x39e301(0x57f)]=_0x56f7ee,_0x313bf5[_0x4e9ed5][_0x39e301(_0x157825._0x76bf8d)]=_0x2e506c;const _0x3e1118=_0x313bf5[_0x4e9ed5]['uniformMap'];_0x3efe6c(_0x3e1118);}function _0x134cc8(_0x3fd4b3){return function(){const _0x56f16f=_0x2767,_0x1e37e2=_0x4bb343[_0x3fd4b3];if(typeof _0x1e37e2===_0x56f16f(0x638))return _0x1e37e2();return _0x1e37e2;};}function _0x4defe9(_0x4106b7,_0x48a641){return function(){const _0x416f3c=_0x2767,_0x195a14=_0x4106b7[_0x48a641]();if(Cesium__namespace['defined'](_0x195a14))return _0x195a14[_0x416f3c(0x6ea)];return undefined;};}function _0x3efe6c(_0x5f3b04){const _0x2bfbc3=_0x33f715;if(_0x5f3b04['__created'])return;_0x5f3b04['czm_selectedIdTexture']=function(){const _0x3df41c=_0x2767;return _0x680812[_0x3df41c(_0x3a4105._0x55ebd0)];},_0x5f3b04[_0x2bfbc3(_0x944ce1._0x5db8cd)]=function(){var _0x459910;return((_0x459910=_0x680812['_selectedIdTexture'])===null||_0x459910===void 0x0?void 0x0:_0x459910['width'])??0x0;},_0x5f3b04[_0x2bfbc3(_0x944ce1._0x2d1dce)]=function(){const _0x14f97d=_0x2bfbc3;var _0x5cfa63;return(_0x5cfa63=_0x680812['_selectedIdTexture'])!==null&&_0x5cfa63!==void 0x0&&_0x5cfa63[_0x14f97d(0xf48)]?0x1/_0x680812['_selectedIdTexture']['width']:-0x1;};if(!_0x4bb343)return;_0x5f3b04['__created']=!![];for(const _0x15fa0d in _0x4bb343){if(_0x4bb343['hasOwnProperty'](_0x15fa0d)){typeof _0x4bb343[_0x15fa0d]!=='function'?_0x5f3b04[_0x15fa0d]=_0x134cc8(_0x15fa0d):_0x5f3b04[_0x15fa0d]=_0x4bb343[_0x15fa0d];const _0x22007a=_0x5f3b04[_0x15fa0d]();(typeof _0x22007a==='string'||_0x22007a instanceof Cesium__namespace['Texture']||_0x22007a instanceof HTMLImageElement||_0x22007a instanceof HTMLCanvasElement||_0x22007a instanceof HTMLVideoElement)&&(_0x5f3b04[_0x15fa0d+_0x2bfbc3(0x64f)]=_0x4defe9(_0x5f3b04,_0x15fa0d));}}}function _0x3554e3(_0x17502d){const _0x25767e=_0x33f715,_0xffb393=_0x17502d['_view'],_0x2651ed=_0xffb393[_0x25767e(_0x52ba33._0x539698)],_0x5364d5=_0x2651ed[_0x25767e(0xe1e)];let _0x2bfb22,_0x444e5d,_0x12dbdf;for(let _0x12f86a=0x0;_0x12f86a<_0x5364d5;++_0x12f86a){const _0x180478=_0x5364d5-_0x12f86a-0x1,_0x362ab0=_0x2651ed[_0x180478];for(_0x444e5d=0x0;_0x444e5d<_0x362ab0['commands']['length'];_0x444e5d++){const _0x3485eb=_0x362ab0[_0x25767e(_0x52ba33._0x2fb4d2)][_0x444e5d];_0x12dbdf=_0x362ab0[_0x25767e(0x9b)][_0x444e5d];if(_0x680812&&_0x444e5d===Cesium__namespace['Pass']['GLOBE'])continue;for(_0x2bfb22=0x0;_0x2bfb22<_0x12dbdf;++_0x2bfb22){const _0x35239f=_0x3485eb[_0x2bfb22];_0x16b21b(_0x35239f,_0x17502d,_0x17502d['_context']);}}}}function _0x2647f7(){const _0x309bf8=_0x33f715;_0x47528f&&(_0x47528f[_0x309bf8(_0x2eefbd._0x327b57)](),_0x37dde2[_0x309bf8(0xa63)](),_0x37dde2=undefined,_0x47528f=undefined),_0xf19f33&&(_0xf19f33[_0x309bf8(_0x2eefbd._0x327b57)](),_0xf19f33=undefined);}function _0x323ae5(_0xc7adfa,_0x56119e,_0x4692f4,_0x26f978){const _0x2a91c8=_0x33f715,_0x4f3aa5=_0x56119e['width'],_0x29c78e=_0x56119e['height'];if(_0x47528f&&_0x47528f['width']===_0x4f3aa5&&_0x47528f['height']===_0x29c78e&&_0x4692f4===_0x3a4bce)return;_0x3a4bce=_0x4692f4,_0x2647f7(),_0x47528f=new Cesium__namespace['Texture']({'context':_0xc7adfa,'width':_0x4f3aa5,'height':_0x29c78e,'pixelFormat':_0x465aa3??Cesium__namespace['PixelFormat']['RGBA'],'pixelDatatype':_0x6b18de??Cesium__namespace['PixelDatatype']['FLOAT'],'sampler':_0x5d308f??Cesium__namespace[_0x2a91c8(0x67f)]['NEAREST']}),_0xf19f33=new Cesium__namespace['Texture']({'context':_0xc7adfa,'width':_0x4f3aa5,'height':_0x29c78e,'pixelFormat':Cesium__namespace['PixelFormat']['DEPTH_COMPONENT'],'pixelDatatype':Cesium__namespace['PixelDatatype']['UNSIGNED_SHORT'],'sampler':Cesium__namespace[_0x2a91c8(0x67f)]['NEAREST']}),_0x37dde2=new Cesium__namespace[(_0x2a91c8(_0x5d929b._0x1dc1c4))]({'colorTextures':[_0x47528f],'context':_0xc7adfa,'destroyAttachments':![],'depthTexture':_0xf19f33});}function _0x4213d8(_0x404ffd){const _0x538d37=_0x33f715;_0x54fd65=Cesium__namespace[_0x538d37(_0x38e8d3._0x111f83)]['clone'](_0x404ffd['viewport'],_0x54fd65);const _0x840a91=Object['assign']({},_0x404ffd['passState']);return _0x840a91['viewport']=_0x54fd65,_0x840a91;}function _0x271fab(_0x22f38c,_0x489777){const _0x20e92d=_0x33f715,_0x141ceb=_0x22f38c['_us']['_frameState'],_0x47b5ca=_0x141ceb['camera'],_0x3045cc=_0x47b5ca['_scene'],_0x42dd23=_0x3045cc['_view'];try{if(!_0x2b87a1&&!_0x529ba0){const _0x31da4b=_0x4213d8(_0x42dd23);typeof _0x23d0c5===_0x20e92d(0x638)&&_0x23d0c5['call'](_0x283780,_0x3045cc,_0x489777),_0x323ae5(_0x22f38c,_0x54fd65,_0x3045cc[_0x20e92d(_0x4505d3._0x3745de)],_0x42dd23['sceneFramebuffer']),executeDerivedCommandList(_0x22f38c,_0x37dde2,_0x31da4b);}else{const _0x29cf29=_0x4213d8(_0x42dd23);typeof _0x23d0c5==='function'&&_0x23d0c5[_0x20e92d(0xad6)](_0x283780,_0x3045cc,_0x489777),_0x323ae5(_0x22f38c,_0x54fd65,_0x3045cc['hdr'],_0x42dd23['sceneFramebuffer']),_0x3554e3(_0x3045cc),executeDerivedCommandList(_0x22f38c,_0x37dde2,_0x29cf29,'renderPass',_0x4e9ed5,_0x318ad1==='all'||!_0x680812||!_0x680812['_selectedIdTexture']?null:_0x525b4a);}}catch(_0x3d67a1){}}function _0x3bae55(){if(!_0x680812)return;const _0x51fa72=_0x680812['selected']||_0x680812['parentSelected'];if(_0x51fa72['length'])return _0x51fa72;}function _0x525b4a(_0x447ec4,_0x2a2b4b){const _0x138ee3=_0x33f715,_0x3a8f43=_0x680812&&(_0x680812['selected']||_0x680812['parentSelected']);if(!_0x680812||!_0x3a8f43||!_0x3a8f43['length'])return![];if(!_0x447ec4[_0x138ee3(_0xe1fd39._0x208219)]||_0x447ec4['_pickIdQualifier']!=='uniform')return!![];let _0x45a51d=!![];const _0x43f2a9=_0x447ec4[_0x138ee3(0xaef)],_0x512428=_0x318ad1===_0x138ee3(0x6bc);if(_0x43f2a9&&_0x43f2a9[_0x138ee3(_0xe1fd39._0xf1527e)]){for(let _0x45e79b=0x0;_0x45e79b<_0x3a8f43['length'];_0x45e79b++){const _0x2fe0f6=_0x3a8f43[_0x45e79b];if(_0x2fe0f6===_0x43f2a9)return _0x512428;}return!_0x512428;}const _0x12dce8=_0x447ec4[_0x138ee3(_0xe1fd39._0x7f0bf)];if(_0x12dce8[_0x447ec4[_0x138ee3(0x45a)]]){const _0x3c2a5c=_0x12dce8[_0x447ec4['pickId']]();_0x45a51d=!_0x512428;for(let _0x56b312=0x0;_0x56b312<_0x3a8f43[_0x138ee3(_0xe1fd39._0x123ead)];_0x56b312++){const _0x43daa0=_0x3a8f43[_0x56b312],_0x747431=_0x43daa0['pickId']?[_0x43daa0['pickId']]:_0x43daa0['pickIds']||_0x43daa0['_pickIds'];for(let _0x2c353e=0x0;_0x2c353e<_0x747431['length'];_0x2c353e++){const _0x2274bd=_0x747431[_0x2c353e];if(_0x2274bd['color']===_0x3c2a5c||Cesium__namespace['Color']['equals'](_0x2274bd[_0x138ee3(0x9db)],_0x3c2a5c))return _0x512428;}}}return _0x45a51d;}function _0x84b725(_0x3bd356){const _0x258117=_0x33f715;if(_0x37dde2){const _0x50a37a=_0x3bd356['_us']['_frameState'][_0x258117(_0x5bb130._0x27f6e1)]['_scene'][_0x258117(_0x5bb130._0x4483cf)];_0x4aca92[_0x258117(0x52f)]=_0x37dde2,_0x4aca92['execute'](_0x3bd356,_0x50a37a['passState']),_0x4aca92[_0x258117(_0x5bb130._0x1d280d)]=undefined;}}function _0x5d91b6(_0x135a51){const _0x1ccb02=_0x33f715;_0x680812&&_0x283780[_0x1ccb02(0x6fb)]&&(_0x680812[_0x1ccb02(_0x28faad._0x2eb2e8)]=_0x283780['prevStageUpdate'],_0x283780['prevStageUpdate']=null,_0x283780['prevStageExecute']=null);_0x680812=_0x135a51;if(!_0x680812)return;const _0x22f51e=_0x680812[_0x1ccb02(_0x28faad._0x2eb2e8)];_0x283780[_0x1ccb02(_0x28faad._0x3bc759)]=_0x22f51e,_0x680812['update']=function(_0x326333,_0x4daf8b){const _0x81b3f1=_0x1ccb02;_0x84b725(_0x326333),_0x22f51e[_0x81b3f1(_0x479534._0x5efa00)](_0x680812,_0x326333,_0x4daf8b);if(!_0x680812['enabled'])return;if(!_0x2b87a1&&!_0x529ba0)_0x271fab(_0x326333,_0x4daf8b);else{const _0x46b2bf=_0x680812['selected']||_0x680812['parentSelected'];_0x46b2bf&&_0x46b2bf['length']&&_0x271fab(_0x326333,_0x4daf8b);}};}this['update']=_0x271fab,this['clear']=_0x84b725,Object[_0x33f715(0x1bd)](this,{'texture':{'get'(){return _0x47528f;}},'depthTexture':{'get'(){return _0xf19f33;}},'stage':{'get'(){return _0x680812;},'set'(_0x40d37d){_0x680812!==_0x40d37d&&_0x5d91b6(_0x40d37d);}}});}let scratchPerspectiveFrustum,scratchPerspectiveOffCenterFrustum,scratchOrthographicFrustum,scratchOrthographicOffCenterFrustum;function executeDerivedCommand(_0x262ffc,_0x10eb9a,_0x2c1d31,_0x10ac2a,_0x89bb33,_0x243736){const _0x93bcb0=_0x35a251,_0x7e1ea4=Cesium__namespace['defined'],_0x108546=_0x10ac2a['_frameState'];let _0x47bd68=_0x262ffc['derivedCommands'];if(!_0x7e1ea4(_0x47bd68))return;_0x108546['useLogDepth']&&_0x7e1ea4(_0x47bd68['logDepth'])&&(_0x262ffc=_0x47bd68[_0x93bcb0(0x2e6)]['command']),_0x47bd68=_0x262ffc[_0x93bcb0(0x271)],_0x7e1ea4(_0x47bd68[_0x10eb9a])&&(_0x262ffc=_0x47bd68[_0x10eb9a][_0x2c1d31],_0x262ffc['execute'](_0x89bb33,_0x243736));}function executeDerivedCommandList(_0x1f2afb,_0x49089a,_0x8952f9,_0x507e8a,_0x3b3112,_0xe83434){const _0x2be7a8={_0x5932d1:0xd61,_0x10b06c:0x170,_0x906979:0x38a,_0x2a00bc:0xdd,_0x183c65:0xdd,_0x53d1df:0x9b},_0x1cf7f7=_0x35a251,{Pass:_0x212704,defined:_0x5c36d2,PerspectiveFrustum:_0x2a6d4e,PerspectiveOffCenterFrustum:_0x4f0646,OrthographicFrustum:_0x270d36,OrthographicOffCenterFrustum:_0x32d133}=Cesium__namespace;scratchPerspectiveFrustum=scratchPerspectiveFrustum||new _0x2a6d4e(),scratchPerspectiveOffCenterFrustum=scratchPerspectiveOffCenterFrustum||new _0x4f0646(),scratchOrthographicFrustum=scratchOrthographicFrustum||new _0x270d36(),scratchOrthographicOffCenterFrustum=scratchOrthographicOffCenterFrustum||new _0x32d133();const _0xdfa68e=_0x1f2afb['_us'],_0x2a15d7=_0xdfa68e['_frameState'],_0x493d51=_0x2a15d7['camera'],_0x6e1f68=_0x493d51['_scene'],_0x4e2670=_0x6e1f68['_view'],_0xd30f6c=_0x4e2670['frustumCommandsList'],_0x136e35=_0xd30f6c['length'],_0x17079a=_0x6e1f68['_globeTranslucencyState'],_0x51d45a=_0x17079a['translucent'],_0x73360a=_0x6e1f68['_view']['globeTranslucencyFramebuffer'];let _0x2edc33;if(_0x5c36d2(_0x493d51['frustum']['fov']))_0x2edc33=_0x493d51['frustum']['clone'](scratchPerspectiveFrustum);else{if(_0x5c36d2(_0x493d51['frustum']['infiniteProjectionMatrix']))_0x2edc33=_0x493d51['frustum']['clone'](scratchPerspectiveOffCenterFrustum);else _0x5c36d2(_0x493d51['frustum']['width'])?_0x2edc33=_0x493d51[_0x1cf7f7(0x19c)]['clone'](scratchOrthographicFrustum):_0x2edc33=_0x493d51['frustum'][_0x1cf7f7(_0x2be7a8._0x5932d1)](scratchOrthographicOffCenterFrustum);}function _0x271b17(_0x1dd67b,_0x5ed8c8,_0x3c657e,_0x38a1a8){const _0x5aedc1=_0xe83434?_0xe83434(_0x1dd67b,_0x5ed8c8):!![];if(_0x5aedc1)try{_0x507e8a&&_0x3b3112?executeDerivedCommand(_0x1dd67b,_0x507e8a,_0x3b3112,_0x5ed8c8,_0x3c657e,_0x38a1a8):_0x1dd67b['execute'](_0x3c657e,_0x38a1a8);}catch(_0x117588){}}let _0x2cb923,_0x7f0056,_0x11de4f;for(let _0x7333aa=0x0;_0x7333aa<_0x136e35;++_0x7333aa){const _0x572dfc=_0x136e35-_0x7333aa-0x1,_0x5245e3=_0xd30f6c[_0x572dfc],_0x156268=_0x8952f9['framebuffer'];_0x8952f9['framebuffer']=_0x49089a,_0x2edc33['near']=_0x572dfc!==0x0?_0x5245e3[_0x1cf7f7(_0x2be7a8._0x10b06c)]*_0x6e1f68['opaqueFrustumNearOffset']:_0x5245e3['near'],_0x2edc33['far']=_0x5245e3['far'],_0xdfa68e['updateFrustum'](_0x2edc33),_0xdfa68e['updatePass'](_0x212704['GLOBE']),_0x11de4f=_0x5245e3['commands'][_0x212704['GLOBE']],_0x7f0056=_0x5245e3['indices'][_0x212704['GLOBE']];if(_0x51d45a)_0x17079a['executeGlobeCommands'](_0x5245e3,_0x271b17,_0x73360a,_0x6e1f68,_0x8952f9);else for(_0x2cb923=0x0;_0x2cb923<_0x7f0056;++_0x2cb923){_0x271b17(_0x11de4f[_0x2cb923],_0x6e1f68,_0x1f2afb,_0x8952f9);}_0xdfa68e['updatePass'](_0x212704['CESIUM_3D_TILE']),_0x11de4f=_0x5245e3['commands'][_0x212704['CESIUM_3D_TILE']],_0x7f0056=_0x5245e3['indices'][_0x212704['CESIUM_3D_TILE']];for(_0x2cb923=0x0;_0x2cb923<_0x7f0056;++_0x2cb923){_0x271b17(_0x11de4f[_0x2cb923],_0x6e1f68,_0x1f2afb,_0x8952f9);}_0xdfa68e[_0x1cf7f7(_0x2be7a8._0x906979)](_0x212704[_0x1cf7f7(_0x2be7a8._0x2a00bc)]),_0x11de4f=_0x5245e3['commands'][_0x212704['OPAQUE']],_0x7f0056=_0x5245e3['indices'][_0x212704[_0x1cf7f7(_0x2be7a8._0x183c65)]];for(_0x2cb923=0x0;_0x2cb923<_0x7f0056;++_0x2cb923){_0x271b17(_0x11de4f[_0x2cb923],_0x6e1f68,_0x1f2afb,_0x8952f9);}_0xdfa68e['updatePass'](_0x212704['TRANSLUCENT']),_0x11de4f=_0x5245e3[_0x1cf7f7(0x726)][_0x212704['TRANSLUCENT']],_0x7f0056=_0x5245e3[_0x1cf7f7(_0x2be7a8._0x53d1df)][_0x212704['TRANSLUCENT']];for(_0x2cb923=0x0;_0x2cb923<_0x7f0056;++_0x2cb923){_0x271b17(_0x11de4f[_0x2cb923],_0x6e1f68,_0x1f2afb,_0x8952f9);}_0x8952f9['framebuffer']=_0x156268;}}class OutlineEffect extends BaseEffect{constructor(_0x40093e={}){super(_0x40093e),this['_setOptionsHook'](_0x40093e);}get['selected'](){var _0x1f9b4f;return(_0x1f9b4f=this['_postProcessStage'])===null||_0x1f9b4f===void 0x0?void 0x0:_0x1f9b4f['selected'];}set['selected'](_0x2273ac){const _0x69e575={_0x5e2a4a:0x2a6},_0x25961c=_0x35a251;let _0x19bea6=[];_0x2273ac&&(!Array['isArray'](_0x2273ac)?_0x19bea6=this['_getPickIds']([_0x2273ac]):_0x19bea6=this[_0x25961c(0x448)](_0x2273ac)),this[_0x25961c(0x226)]&&(this['_postProcessStage'][_0x25961c(0x6bc)]=_0x19bea6,this['_postProcessStage'][_0x25961c(_0x69e575._0x5e2a4a)]=this['enabled']&&this['selected']['length']>0x0);}get['color'](){return this['_color'];}set['color'](_0x18602b){const _0x4851c4=_0x35a251;this[_0x4851c4(0x65f)]=getCesiumColor(_0x18602b),this['_useSingleColor']=!this['_colorHidden']||this['_color']['equals'](this['_colorHidden']);}get['colorHidden'](){const _0x363a43={_0x4b4167:0xaa2},_0x3ae190=_0x35a251;return Cesium__namespace[_0x3ae190(_0x363a43._0x4b4167)](this['_colorHidden'])?this['_colorHidden']:this['_color'];}set['colorHidden'](_0x2424cb){const _0x4f8668={_0x4c2023:0x6f3},_0x45bfec=_0x35a251;this['_colorHidden']=getCesiumColor(_0x2424cb),this[_0x45bfec(0xca3)]=!this[_0x45bfec(_0x4f8668._0x4c2023)]||this['_color'][_0x45bfec(0x417)](this[_0x45bfec(0x6f3)]);}get['planeAngle'](){const _0x275da3={_0x5a8d8c:0xcdd},_0x3358e7=_0x35a251;return this[_0x3358e7(_0x275da3._0x5a8d8c)];}set['planeAngle'](_0x34609e){const _0x1df994={_0x3f9db4:0x7c0},_0x135040=_0x35a251;this['_planeAngle']=_0x34609e,this[_0x135040(0x7f7)]=Cesium__namespace[_0x135040(_0x1df994._0x3f9db4)]['toRadians'](_0x34609e);}['_enabledHook'](_0x2a7811){const _0x40c210={_0x425b96:0x226},_0x3a8f1a=_0x35a251;this[_0x3a8f1a(_0x40c210._0x425b96)]&&(this['_postProcessStage']['enabled']=_0x2a7811&&this['selected']['length']>0x0);}['_setOptionsHook'](_0x3ea7ef,_0x29cfb1){const _0x35c046={_0x5efd43:0xfb4,_0x1c1e18:0xf48,_0x7baf27:0x9db,_0x56f508:0x9a2,_0x3a14ca:0xa75,_0x5231a4:0xecd},_0x16ada3=_0x35a251;this['eventType']=_0x3ea7ef['eventType']??EventType[_0x16ada3(_0x35c046._0x5efd43)],this[_0x16ada3(_0x35c046._0x1c1e18)]=_0x3ea7ef['width']??0x6,this['color']=getCesiumColor(_0x3ea7ef[_0x16ada3(_0x35c046._0x7baf27)],Cesium__namespace['Color'][_0x16ada3(_0x35c046._0x56f508)]),this[_0x16ada3(_0x35c046._0x3a14ca)]=_0x3ea7ef[_0x16ada3(_0x35c046._0x3a14ca)],this['showPlane']=_0x3ea7ef['showPlane']??![],this['planeAngle']=_0x3ea7ef['planeAngle']??0xa,this['glow']=_0x3ea7ef[_0x16ada3(0xc0e)]??![],this[_0x16ada3(0x831)]=_0x3ea7ef['glowPower']??0x1,this['glowStrength']=_0x3ea7ef['glowStrength']??0x3,this[_0x16ada3(_0x35c046._0x5231a4)]=_0x3ea7ef['onlySelected']??![];}['_mountedHook'](){const _0x29b052={_0x164a1f:0xf54,_0x536bde:0x906,_0x575117:0x4de,_0xe2e17d:0x504,_0x5660ab:0x6bc,_0x1bfc6e:0x226},_0x5023db={_0x371e49:0x1bd},_0x5467ac={_0x4619a4:0xa75},_0x331a5f={_0x28a1ae:0xf48},_0x1ab3fb={_0x251bc2:0xca3},_0x2ac96f={_0x255ba6:0xf48},_0x3e1aa6=_0x35a251,_0x581759=this,_0x5719d0=this['name']||this['type']||'',_0x477dac=new CesiumRenderPass({'name':_0x5719d0+'Pass','vertexShader':_0x3e1aa6(0xde5),'fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20vec3\x20vOutlineNormal_mars3d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(!czm_selected())discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(length(vOutlineNormal_mars3d)>0.0)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor=vec4(\x20vOutlineNormal_mars3d\x20,out_FragColor.a);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','sampler':new Cesium__namespace['Sampler']({'minificationFilter':Cesium__namespace['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter'][_0x3e1aa6(_0x29b052._0x164a1f)]})}),_0x2fc4bc=new Cesium__namespace[(_0x3e1aa6(0x821))]({'name':_0x5719d0+'Mask','uniforms':{'outlineWidth'(){const _0x508de0=_0x3e1aa6;return _0x581759[_0x508de0(_0x2ac96f._0x255ba6)];},'devicePixelRatio':devicePixelRatio,'thresholdAngle':function(){return _0x581759['_planeAngleRadians'];},'useSingleColor':function(){const _0x140916=_0x3e1aa6;return _0x581759[_0x140916(_0x1ab3fb._0x251bc2)];},'showOutlineOnly':function(){const _0xccb9b0=_0x3e1aa6;return!_0x581759[_0xccb9b0(0xcde)];},'visibleEdgeColor':function(){return _0x581759['color'];},'hiddenEdgeColor':function(){return _0x581759['colorHidden'];},'maskTexture'(){return _0x477dac['texture'];},'maskDepthTexture'(){return _0x477dac['depthTexture'];}},'fragmentShader':_0x3e1aa6(_0x29b052._0x536bde)});_0x477dac['stage']=_0x2fc4bc;const _0x316dad=createBlurStage(_0x5719d0+_0x3e1aa6(_0x29b052._0x575117),0x4,0x1,0.75),_0x12116e=createBlurStage(_0x5719d0+'Blur2',0x4,0x4,0.5),_0xa48dff=new Cesium__namespace['PostProcessStageComposite']({'name':_0x5719d0+'BlurComposite','stages':[_0x2fc4bc,_0x316dad,_0x12116e],'inputPreviousStageTexture':!![]}),_0x173180=new Cesium__namespace['PostProcessStage']({'name':_0x5719d0+_0x3e1aa6(0xf9a),'uniforms':{'showGlow':function(){return _0x581759['glow'];},'edgeGlow':function(){return _0x581759['glowPower'];},'edgeStrength':function(){return _0x581759['glowStrength'];},'edgeOnly'(){return _0x581759['onlySelected'];},'maskTexture'(){return _0x477dac['texture'];},'lineTexture':_0x2fc4bc[_0x3e1aa6(_0x29b052._0xe2e17d)],'edgeTexture1':_0x316dad['name'],'edgeTexture2':_0xa48dff['name']},'fragmentShader':'\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20edgeTexture1;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20edgeTexture2;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20lineTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskTexture;\x0a\x20\x20\x20\x20uniform\x20bool\x20showGlow;\x0a\x20\x20\x20\x20uniform\x20float\x20edgeGlow;\x0a\x20\x20\x20\x20uniform\x20bool\x20edgeOnly;\x0a\x20\x20\x20\x20uniform\x20float\x20edgeStrength;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20void\x20main(){\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv\x20=v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeColor=texture(\x20lineTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20color=texture(\x20colorTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20opacity=1.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(edgeOnly){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20maskColor=texture(\x20maskTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20opacity=1.-maskColor.a;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20maskColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(showGlow){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeValue1\x20=\x20texture(edgeTexture1,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeValue2\x20=\x20texture(edgeTexture2,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20glowColor\x20=\x20edgeValue1\x20+\x20edgeValue2\x20*\x20edgeGlow;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20opacity\x20*\x20color\x20+\x20edgeColor\x20+\x20edgeStrength\x20*\x20(1.\x20-\x20edgeColor.r)\x20*\x20glowColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20opacity\x20*\x20color\x20+\x20edgeColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20'}),_0x3f20e0=new Cesium__namespace['PostProcessStageComposite']({'name':_0x5719d0+'Composite','stages':[_0xa48dff,_0x173180],'inputPreviousStageTexture':![]});function _0x41ea27(_0x530fdc){const _0x51a3fa={_0x5e47a4:0xc0e},_0x435178=_0x3e1aa6;Object[_0x435178(_0x5023db._0x371e49)](_0x530fdc,{'showGlow':{'get'(){const _0xf1174f=_0x435178;return _0x581759[_0xf1174f(_0x51a3fa._0x5e47a4)];},'set'(_0x10b722){const _0x2b5f5c=_0x435178;_0x581759[_0x2b5f5c(0xc0e)]=_0x10b722;}},'edgeGlow':{'get'(){return _0x581759['glowPower'];},'set'(_0x46437b){_0x581759['glowPower']=_0x46437b;}},'edgeStrength':{'get'(){return _0x581759['glowStrength'];},'set'(_0x179fe6){_0x581759['glowStrength']=_0x179fe6;}},'thresholdAngle':{'get'(){const _0x2b2f7a=_0x435178;return _0x581759[_0x2b2f7a(0x7f7)];},'set'(_0x56f564){_0x581759['_planeAngleRadians']=_0x56f564;}},'showOutlineOnly':{'get'(){return!_0x581759['showPlane'];},'set'(_0x5cf2fb){_0x581759['showPlane']=!_0x5cf2fb;}},'edgeOnly':{'get'(){return _0x581759['onlySelected'];},'set'(_0x1dbbeb){_0x581759['onlySelected']=_0x1dbbeb;}},'useSingleColor':{'get'(){return _0x581759['_useSingleColor'];}},'outlineWidth':{'get'(){const _0x3e1bfd=_0x435178;return _0x581759[_0x3e1bfd(_0x331a5f._0x28a1ae)];},'set'(_0x1229d3){const _0x1fe799=_0x435178;_0x581759[_0x1fe799(0xf48)]=_0x1229d3;}},'visibleEdgeColor':{'get'(){return _0x581759['color'];},'set'(_0x513e91){_0x581759['color']=_0x513e91;}},'hiddenEdgeColor':{'get'(){const _0x3e0e6a=_0x435178;return _0x581759[_0x3e0e6a(0xa75)];},'set'(_0x427acc){const _0x1d6dea=_0x435178;_0x581759[_0x1d6dea(_0x5467ac._0x4619a4)]=_0x427acc;}}});}_0x41ea27(_0x3f20e0),_0x3f20e0['_uniforms']=_0x3f20e0['_uniforms']||{},_0x41ea27(_0x3f20e0['_uniforms']),_0x3f20e0[_0x3e1aa6(_0x29b052._0x5660ab)]=[],_0x3f20e0['enabled']=![],this[_0x3e1aa6(_0x29b052._0x1bfc6e)]=_0x3f20e0;}['_addedHook'](){const _0x3b865c={_0x26a521:0x26f},_0x1832e5=_0x35a251;this['eventType']&&this['_map']['on'](this['eventType'],this[_0x1832e5(_0x3b865c._0x26a521)],this);}['_removedHook'](){const _0x29241f={_0x115079:0x26f},_0xc5e688=_0x35a251;this['eventType']&&this[_0xc5e688(0xd79)]['off'](this['eventType'],this[_0xc5e688(_0x29241f._0x115079)],this);}['_map_clickHandler'](_0xb16292){const _0x583a55=_0x35a251,_0x4f69b8=this['options']['objectsToExclude'];if(_0x4f69b8)for(let _0xdf48ad=0x0,_0x580b28=_0x4f69b8['length'];_0xdf48ad<_0x580b28;_0xdf48ad++){const _0x411e4f=_0x4f69b8[_0xdf48ad];if(_0xb16292['graphic']===_0x411e4f||_0xb16292['layer']===_0x411e4f)return;}const _0x4c3a43=this['_map']['mouseEvent'][_0x583a55(0x81d)](_0xb16292);this['selected']=_0x4c3a43;}}register('outline',OutlineEffect);function createBlurStage(_0x167c55,_0x2418e6,_0x4a1f11,_0x161707){const _0x93192d={_0x20f2ad:0x821,_0x54ee9a:0x7b1},_0x3d8414=_0x35a251,_0x57074e={'fragmentShader':'\x0a\x20\x20\x20\x20#define\x20MAX_RADIUS\x20'+_0x2418e6+'\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20vec2\x20colorTextureDimensions;\x0a\x20\x20\x20\x20uniform\x20vec2\x20direction;\x0a\x20\x20\x20\x20uniform\x20float\x20kernelRadius;\x0a\x0a\x20\x20\x20\x20float\x20gaussianPdf(in\x20float\x20x,\x20in\x20float\x20sigma)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x200.39894\x20*\x20exp(\x20-0.5\x20*\x20x\x20*\x20x/(\x20sigma\x20*\x20sigma))/sigma;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20void\x20main()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv=v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20invSize\x20=\x201.0\x20/\x20colorTextureDimensions;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20weightSum\x20=\x20gaussianPdf(0.0,\x20kernelRadius);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20diffuseSum\x20=\x20texture(\x20colorTexture,\x20vUv)\x20*\x20weightSum;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20delta\x20=\x20direction\x20*\x20invSize\x20*\x20kernelRadius/float(MAX_RADIUS);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uvOffset\x20=\x20delta;\x0a\x20\x20\x20\x20\x20\x20\x20\x20for(\x20int\x20i\x20=\x201;\x20i\x20<=\x20MAX_RADIUS;\x20i\x20++\x20)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20w\x20=\x20gaussianPdf(uvOffset.x,\x20kernelRadius);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20sample1\x20=\x20texture(\x20colorTexture,\x20vUv\x20+\x20uvOffset);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20sample2\x20=\x20texture(\x20colorTexture,\x20vUv\x20-\x20uvOffset);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20diffuseSum\x20+=\x20((sample1\x20+\x20sample2)\x20*\x20w);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20weightSum\x20+=\x20(2.0\x20*\x20w);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uvOffset\x20+=\x20delta;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20diffuseSum/weightSum;\x0a\x20\x20\x20\x20}'},_0x2a2e92=new Cesium__namespace[(_0x3d8414(0x821))]({'name':_0x167c55+'_x_direction','fragmentShader':_0x57074e['fragmentShader'],'textureScale':_0x161707,'forcePowerOfTwo':!![],'uniforms':{'kernelRadius':_0x4a1f11,'direction':new Cesium__namespace['Cartesian2'](0x1,0x0)},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0x468cdf=new Cesium__namespace[(_0x3d8414(_0x93192d._0x20f2ad))]({'name':_0x167c55+'_y_direction','fragmentShader':_0x57074e['fragmentShader'],'textureScale':_0x161707,'forcePowerOfTwo':!![],'uniforms':{'kernelRadius':_0x4a1f11,'direction':new Cesium__namespace[(_0x3d8414(0x248))](0x0,0x1)},'sampleMode':Cesium__namespace[_0x3d8414(_0x93192d._0x54ee9a)]['LINEAR']}),_0x4f91e7=new Cesium__namespace['PostProcessStageComposite']({'name':_0x167c55,'stages':[_0x2a2e92,_0x468cdf],'inputPreviousStageTexture':!![]});return _0x4f91e7;}class BloomTargetEffect extends BaseEffect{constructor(_0x358a57={}){const _0x2c53d8={_0x2b0ef3:0x9db},_0x2da801=_0x35a251;_0x358a57={'contrast':0x80,'brightness':-0.3,'blurSamples':0x20,'delta':0x1,'sigma':3.78,'stepSize':0x5,'ratio':0x2,'threshold':0x0,'smoothWidth':0.01,..._0x358a57},super(_0x358a57),this[_0x2da801(_0x2c53d8._0x2b0ef3)]=getCesiumColor(_0x358a57['color'],Cesium__namespace['Color']['WHITE']),this['eventType']=_0x358a57[_0x2da801(0x21d)]??EventType[_0x2da801(0xfb4)];}get['selected'](){const _0x53add7=_0x35a251;var _0x88a090;return(_0x88a090=this[_0x53add7(0x226)])===null||_0x88a090===void 0x0?void 0x0:_0x88a090['selected'];}set['selected'](_0x3bf9b0){const _0x2316f1={_0x55a26d:0x2a6},_0x3f7fbd=_0x35a251;let _0x322f71=[];_0x3bf9b0&&(!Array['isArray'](_0x3bf9b0)?_0x322f71=this['_getPickIds']([_0x3bf9b0]):_0x322f71=this['_getPickIds'](_0x3bf9b0)),this[_0x3f7fbd(0x226)]&&(this['_postProcessStage']['selected']=_0x322f71,this['_postProcessStage']['enabled']=this[_0x3f7fbd(_0x2316f1._0x55a26d)]&&this['selected']['length']>0x0);}['_enabledHook'](_0x3bd3ed){const _0x11c0b9={_0x3f0c78:0xe1e},_0x5c85bd=_0x35a251;this['_postProcessStage']&&(this[_0x5c85bd(0x226)][_0x5c85bd(0x2a6)]=_0x3bd3ed&&this[_0x5c85bd(0x6bc)][_0x5c85bd(_0x11c0b9._0x3f0c78)]>0x0);}['_mountedHook'](){const _0x4fb815={_0x4b0706:0x2d1,_0x38ff79:0x7b1,_0x278a08:0x7c,_0xee983:0xad8,_0x144b73:0x226,_0x33759a:0x340,_0x560735:0x6bc},_0x399c6e={_0xb1bccf:0xd50},_0x315a66={_0xb9be32:0x770},_0x469a5e={_0x3a779d:0xe86},_0x27dfb7=_0x35a251,_0x5ece97=new Cesium__namespace['PostProcessStage']({'name':this['name']+_0x27dfb7(0xd6b),'fragmentShader':_0x27dfb7(0xe82),'uniforms':{'marsColor':Cesium__namespace['Color'][_0x27dfb7(_0x4fb815._0x4b0706)],'marsOpacity':0x1,'smoothWidth':()=>{return this['options']['smoothWidth'];},'threshold':()=>{const _0x1d7d7e=_0x27dfb7;return this['options'][_0x1d7d7e(0xb2e)];}}}),_0x41d52e='\x0a\x20\x20\x20\x20#define\x20SAMPLES\x20'+this['options']['blurSamples']+_0x27dfb7(0x2e5),_0x6470af=new Cesium__namespace['PostProcessStage']({'name':this['name']+'blur_x','fragmentShader':_0x41d52e,'uniforms':{'delta':()=>{const _0x14753b=_0x27dfb7;return this[_0x14753b(_0x469a5e._0x3a779d)]['delta'];},'sigma':()=>{const _0x5c7dcc=_0x27dfb7;return this['options'][_0x5c7dcc(0xe49)];},'stepSize':()=>{const _0x3330d7=_0x27dfb7;return this['options'][_0x3330d7(_0x315a66._0xb9be32)];},'direction':0x0},'sampleMode':Cesium__namespace[_0x27dfb7(_0x4fb815._0x38ff79)][_0x27dfb7(0xf54)]}),_0x1bca82=new Cesium__namespace['PostProcessStage']({'name':this['name']+_0x27dfb7(_0x4fb815._0x278a08),'fragmentShader':_0x41d52e,'uniforms':{'delta':()=>{return this['options']['delta'];},'sigma':()=>{return this['options']['sigma'];},'stepSize':()=>{return this['options']['stepSize'];},'direction':0x1},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0x4f606c=new Cesium__namespace['PostProcessStageComposite']({'name':this['name']+'blur','stages':[_0x6470af,_0x1bca82]}),_0x71af15=new Cesium__namespace['PostProcessStageComposite']({'name':this[_0x27dfb7(0x504)]+_0x27dfb7(_0x4fb815._0xee983),'stages':[_0x5ece97,_0x4f606c],'inputPreviousStageTexture':!![]}),_0x27b09c=new Cesium__namespace[(_0x27dfb7(0x821))]({'name':this['name']+'contrast_bias','fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20contrast;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20brightness;\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(void)\x0a\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20sceneColor\x20=\x20texture(colorTexture,\x20v_textureCoordinates).xyz;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20czm_RGBToHSB(sceneColor);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor.z\x20+=\x20brightness;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20czm_HSBToRGB(sceneColor);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20factor\x20=\x20(259.0\x20*\x20(contrast\x20+\x20255.0))\x20/\x20(255.0\x20*\x20(259.0\x20-\x20contrast));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20factor\x20*\x20(sceneColor\x20-\x20vec3(0.5))\x20+\x20vec3(0.5);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(sceneColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','uniforms':{'contrast':()=>{const _0x170a37=_0x27dfb7;return this['options'][_0x170a37(_0x399c6e._0xb1bccf)];},'brightness':()=>{return this['options']['brightness'];}}}),_0x1b89b5=new Cesium__namespace['PostProcessStageComposite']({'name':this['name']+'contrast_bias_blur','stages':[_0x27b09c,_0x71af15]}),_0x2c1351=new Cesium__namespace['PostProcessStage']({'name':this['name']+'generate_composite','fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20bloomTexture;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20ratio;\x0a\x20\x20\x20\x20\x20\x20uniform\x20vec4\x20color;\x0a\x20\x20\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20void\x20main(void)\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20color1\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20bloom\x20=\x20texture(bloomTexture,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20\x20\x20\x20\x20bloom\x20*=\x20color\x20;\x0a\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(czm_selected())\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bloom\x20*=\x20ratio;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20bloom\x20+\x20color1;\x0a\x20\x20\x20\x20\x20\x20}','uniforms':{'bloomTexture':_0x1b89b5['name'],'ratio':()=>{const _0x1798eb=_0x27dfb7;return this[_0x1798eb(0xe86)]['ratio'];},'color':()=>{return this['color'];}}});this[_0x27dfb7(_0x4fb815._0x144b73)]=new Cesium__namespace[(_0x27dfb7(_0x4fb815._0x33759a))]({'name':this['name'],'stages':[_0x1b89b5,_0x2c1351],'inputPreviousStageTexture':![]}),this[_0x27dfb7(_0x4fb815._0x144b73)][_0x27dfb7(_0x4fb815._0x560735)]=[];}['_addedHook'](){const _0x21df36=_0x35a251;this[_0x21df36(0x21d)]&&this['_map']['on'](this['eventType'],this['_map_clickHandler'],this);}['_removedHook'](){const _0x4e755a=_0x35a251;this['eventType']&&this['_map']['off'](this[_0x4e755a(0x21d)],this['_map_clickHandler'],this);}[_0x35a251(0x26f)](_0x47f3c8){const _0x1517fc={_0x39c905:0x81d},_0x154506=_0x35a251,_0x8cb996=this['options']['objectsToExclude'];if(_0x8cb996)for(let _0x22e088=0x0,_0x561da8=_0x8cb996['length'];_0x22e088<_0x561da8;_0x22e088++){const _0x4320ef=_0x8cb996[_0x22e088];if(_0x47f3c8['graphic']===_0x4320ef||_0x47f3c8['layer']===_0x4320ef)return;}const _0x1d1fbe=this['_map']['mouseEvent'][_0x154506(_0x1517fc._0x39c905)](_0x47f3c8);this['selected']=_0x1d1fbe;}}register(_0x35a251(0x923),BloomTargetEffect);var index$2={'__proto__':null,'BaseEffect':BaseEffect,'FogEffect':FogEffect,'RainEffect':RainEffect,'SnowEffect':SnowEffect,'SnowCoverEffect':SnowCoverEffect,'InvertedEffect':InvertedEffect,'NightVisionEffect':NightVisionEffect,'BloomEffect':BloomEffect,'BrightnessEffect':BrightnessEffect,'BlackAndWhiteEffect':BlackAndWhiteEffect,'MosaicEffect':MosaicEffect,'DepthOfFieldEffect':DepthOfFieldEffect,'OutlineEffect':OutlineEffect,'BloomTargetEffect':BloomTargetEffect};class BaseControl extends BaseThing{constructor(_0x325df8={}){const _0x27554a={_0xb162bf:0x987},_0x4c2c1a=_0x35a251;super(_0x325df8),this['_show']=_0x325df8[_0x4c2c1a(_0x27554a._0xb162bf)]??!![];}get['show'](){const _0xe5853e=_0x35a251;return this[_0xe5853e(0x435)];}set['show'](_0x1df494){const _0x395a0f={_0x56402e:0x5f4,_0x5c028d:0x678,_0x3eb8a5:0xa40,_0x252b28:0xd79,_0x4049c6:0xe33},_0x32743c=_0x35a251;if(this[_0x32743c(0x435)]===_0x1df494)return;this['_show']=_0x1df494,this[_0x32743c(_0x395a0f._0x56402e)]&&(this['_container']['style'][_0x32743c(0x922)]=_0x1df494?_0x32743c(_0x395a0f._0x5c028d):'none'),this[_0x32743c(_0x395a0f._0x3eb8a5)]&&this[_0x32743c(_0x395a0f._0x3eb8a5)](_0x1df494),this[_0x32743c(_0x395a0f._0x252b28)]['fire'](EventType[_0x32743c(_0x395a0f._0x4049c6)],{'control':this});}get['type'](){return this['_type'];}get['container'](){const _0x2a7395=_0x35a251;return this[_0x2a7395(0x5f4)];}get['parentContainer'](){const _0x2f0385=_0x35a251;var _0x68adae;if(this['options']['parentContainer'])return this[_0x2f0385(0xe86)]['parentContainer'];return(_0x68adae=this['_map'])===null||_0x68adae===void 0x0?void 0x0:_0x68adae[_0x2f0385(0x94f)];}get[_0x35a251(0xe06)](){var _0x103a39;return(_0x103a39=this['parentContainer'])===null||_0x103a39===void 0x0?void 0x0:_0x103a39['id'];}[_0x35a251(0xefe)](_0x32fa3e){const _0x23af6f={_0x32127e:0x922,_0x10a8f2:0xa40},_0x329dab=_0x35a251;this['_container']&&(this['_container']['style'][_0x329dab(_0x23af6f._0x32127e)]=_0x32fa3e?'block':'none'),this['_showHook']&&this[_0x329dab(_0x23af6f._0x10a8f2)](_0x32fa3e);}['setOptions'](_0x4dda9a){const _0x17f402=_0x35a251;if(isBoolean(_0x4dda9a))return;return this[_0x17f402(0xe86)]=merge(this['options'],_0x4dda9a),this['reload'](),this;}['reload'](){const _0x1d256c={_0x246dd0:0x5f4},_0x498655=_0x35a251,_0xc3c208=this['_map'];_0xc3c208&&(this[_0x498655(0x127)](),delete this[_0x498655(_0x1d256c._0x246dd0)],this['_onAdd'](_0xc3c208));}['addTo'](_0x2ecf2c){return _0x2ecf2c&&_0x2ecf2c['addControl']&&_0x2ecf2c['addControl'](this),this;}['remove'](_0x3c75a0){this['_map']&&this['_map']['removeControl'](this,_0x3c75a0);}[_0x35a251(0x85f)](_0x289eae){const _0x3dc086={_0x3eb6d6:0xf96,_0x110fd4:0x803,_0x11d1be:0x5f4,_0x1d64f0:0xdd7,_0x724003:0xef0},_0x393d4e=_0x35a251;if(this['isAdded']||this[_0x393d4e(0xf96)]===State['ADD'])return;this[_0x393d4e(_0x3dc086._0x3eb6d6)]=State['ADD'],this['_map']=_0x289eae,this['_container']?!this['_container'][_0x393d4e(_0x3dc086._0x110fd4)]&&this['_addChildContainer'](this[_0x393d4e(0x5f4)]):(this['_mountedHook']&&this['_mountedHook'](),this[_0x393d4e(_0x3dc086._0x11d1be)]&&this[_0x393d4e(_0x3dc086._0x1d64f0)](this[_0x393d4e(0x5f4)])),this['_addedHook']&&this['_addedHook'](),this['_container']&&this['_container']['addEventListener']('click',this['_container_onClickHandler']['bind'](this)),this['_state']=State[_0x393d4e(_0x3dc086._0x724003)];}['_addChildContainer'](_0x138c1e){const _0x31c881={_0x1b7a33:0x434,_0x5972c5:0xe86,_0x5c69a2:0x8b0},_0x134c1b=_0x35a251;if(this['options'][_0x134c1b(_0x31c881._0x1b7a33)])this['parentContainer'][_0x134c1b(0x434)](_0x138c1e,this[_0x134c1b(0xe86)]['insertBefore']);else{if(Cesium__namespace['defined'](this[_0x134c1b(_0x31c881._0x5972c5)][_0x134c1b(_0x31c881._0x5c69a2)])){const _0x2df907=this['parentContainer']['childNodes'];_0x2df907[_0x134c1b(0xe1e)]0x0)for(let _0x4643cb=0x0;_0x4643cb<_0x57f8ad['length'];_0x4643cb++){_0x57f8ad[_0x4643cb][_0x5a68f3]=function(_0x2abd8d){const _0x41ae20=_0x1f2122,_0x429483=_0x2abd8d[_0x41ae20(_0x1ef373._0x5e1a36)]['getAttribute'](_0x6daf36);_0x8da973[_0x429483]&&_0x2abd8d['currentTarget']['setAttribute'](_0x6daf36,_0x8da973[_0x429483]);};}}}class Animation extends BaseCzmControl{constructor(_0x19676f={}){super(_0x19676f),this['_czmControlKey']='_animation',this['_czmContainerKey']='_container';}['_createCzmContainer'](){return create$3('div','cesium-viewer-animationContainer');}[_0x35a251(0x7af)](){const _0x224e17=_0x35a251;return new Cesium__namespace['Animation'](this['_container'],new Cesium__namespace['AnimationViewModel'](this[_0x224e17(0x8d3)]['clockViewModel']));}[_0x35a251(0x2da)](_0x422943){const _0x6b6b31=_0x35a251;let _0x46ecb6=_0x422943['getElementsByClassName'](_0x6b6b31(0xc4b));if(_0x46ecb6['length']>0x0){_0x46ecb6=_0x46ecb6[0x0];const _0x199d17={'Today':'今天','Today\x20(real-time)':'今天(实际时间)','Pause':'暂停','Play\x20Reverse':'后退播放','Play\x20Forward':'前进播放','Current\x20time\x20not\x20in\x20range':'当前时间不在范围内'};this['_updateDomByTagName'](_0x46ecb6,_0x199d17,'title');}}}register$1('animation',Animation);class BaseLayerPicker extends BaseCzmControl{constructor(_0x3bd9bc={}){const _0x55a185={_0x539915:0xe86},_0x1a0700=_0x35a251;super(_0x3bd9bc),this['_czmControlKey']=_0x1a0700(0x778),this['_czmContainerKey']='_element',this[_0x1a0700(_0x55a185._0x539915)]['insertIndex']=this['options']['insertIndex']??0x1;}get['parentContainer'](){const _0x15e8a7=_0x35a251;if(this['options']['parentContainer'])return this[_0x15e8a7(0xe86)]['parentContainer'];return this[_0x15e8a7(0xd79)]['toolbar'];}['_createCzmControl'](){const _0x14eee3={_0x1376fc:0xd79,_0x1d818b:0x31c,_0x5ef987:0xe2d,_0x5b40d1:0xa0a,_0xd6fb56:0x3b7,_0x5e753e:0xd79,_0x2eeeaf:0x9cd},_0x8730af=_0x35a251;var _0x28987a;const _0x2d28c5=this['_map']['options']['control']||{},_0x3a4249=this['options'],_0x2922ed={'map':this[_0x8730af(_0x14eee3._0x1376fc)],'globe':this['_map']['scene']['globe'],'imageryProviderViewModels':_0x3a4249['imageryProviderViewModels']||_0x2d28c5['imageryProviderViewModels'],'selectedImageryProviderViewModel':_0x3a4249[_0x8730af(_0x14eee3._0x1d818b)]||_0x2d28c5['selectedImageryProviderViewModel'],'terrainProviderViewModels':_0x3a4249['terrainProviderViewModels']||_0x2d28c5['terrainProviderViewModels'],'selectedTerrainProviderViewModel':_0x3a4249['selectedTerrainProviderViewModel']||_0x2d28c5[_0x8730af(0x60f)]};if(!_0x2922ed[_0x8730af(0xa9)]&&((_0x28987a=this['_map']['options'][_0x8730af(_0x14eee3._0x5ef987)])===null||_0x28987a===void 0x0?void 0x0:_0x28987a['length'])>0x0){const _0x5e6a4c=getImageryProviderViewModels(this['_map']['options'][_0x8730af(0xe2d)],this['_map']['options'][_0x8730af(_0x14eee3._0x5b40d1)]);_0x2922ed['imageryProviderViewModels']=_0x5e6a4c['imageryProviderViewModels'],_0x5e6a4c[_0x8730af(0x6fe)]!==-0x1&&(_0x2922ed[_0x8730af(0x31c)]=_0x5e6a4c['imageryProviderViewModels'][_0x5e6a4c[_0x8730af(0x6fe)]]);}if(!_0x2922ed['terrainProviderViewModels']){var _0x481a7f;_0x2922ed[_0x8730af(_0x14eee3._0xd6fb56)]=getTerrainProviderViewModels(this['_map']['_getTerrainOptions']()),_0x2922ed['selectedTerrainProviderViewModel']=_0x2922ed[_0x8730af(_0x14eee3._0xd6fb56)][(_0x481a7f=this[_0x8730af(_0x14eee3._0x5e753e)]['options']['terrain'])!==null&&_0x481a7f!==void 0x0&&_0x481a7f['show']?0x1:0x0];}return new Cesium__namespace[(_0x8730af(_0x14eee3._0x2eeeaf))](this['_map']['toolbar'],_0x2922ed);}['_toChineseLang'](_0x261f7b){const _0x3c4d45={_0x2c2d82:0xb64,_0x345f57:0x585,_0x2340f1:0xe1e},_0x442e05={_0x1aee32:0xc86},_0x3d9608=_0x35a251;let _0x4759fa=_0x261f7b['getElementsByClassName']('cesium-baseLayerPicker-dropDown');if(_0x4759fa[_0x3d9608(0xe1e)]>0x0){_0x4759fa=_0x4759fa[0x0];const _0x2e5269={'Imagery':'影像','Cesium\x20ion':'官方ION','Other':'其他','Terrain':_0x3d9608(0x2bc),'WGS84\x20Ellipsoid':'WGS84\x20椭球','Cesium\x20World\x20Terrain':'Cesium\x20世界地形图','WGS84\x20standard\x20ellipsoid,\x20also\x20known\x20as\x20EPSG:4326':'WGS84标准椭球,又称EPSG:4326','High-resolution\x20global\x20terrain\x20tileset\x20curated\x20from\x20several\x20datasources\x20and\x20hosted\x20by\x20Cesium\x20ion':_0x3d9608(0x24c)};this[_0x3d9608(0x585)](_0x4759fa,_0x2e5269,_0x3d9608(_0x3c4d45._0x2c2d82)),this[_0x3d9608(_0x3c4d45._0x345f57)](_0x4759fa,_0x2e5269,_0x3d9608(0xb1e)),this[_0x3d9608(0x585)](_0x4759fa,_0x2e5269,'cesium-baseLayerPicker-itemLabel'),this['_updateDomAttribute'](_0x4759fa,_0x2e5269,'cesium-baseLayerPicker-item','title');const _0x306f4c=_0x261f7b['getElementsByClassName']('cesium-baseLayerPicker-selected');_0x306f4c[_0x3d9608(_0x3c4d45._0x2340f1)]>0x0&&(_0x306f4c[0x0]['parentElement']['onmouseover']=function(_0x1a9abe){const _0xc0d467=_0x3d9608,_0x463e8a=_0x1a9abe[_0xc0d467(0x7df)][_0xc0d467(_0x442e05._0x1aee32)]('title'),_0x4f9087=_0x463e8a[_0xc0d467(0xb0c)]('\x0a');let _0x56234d='',_0x33fad5='';_0x2e5269[_0x4f9087[0x0]]?_0x56234d+=_0x2e5269[_0x4f9087[0x0]]:_0x56234d+=_0x4f9087[0x0],_0x2e5269[_0x4f9087[0x0]]?_0x33fad5+=_0x2e5269[_0x4f9087[0x1]]:_0x33fad5+=_0x4f9087[0x1],_0x1a9abe['currentTarget']['setAttribute']('title',_0x56234d+'\x0a'+_0x33fad5);});}}}register$1('baseLayerPicker',BaseLayerPicker);class FullscreenButton extends BaseCzmControl{constructor(_0x48704d={}){const _0x4a28e7=_0x35a251;super(_0x48704d),this['_czmControlKey']='_fullscreenButton',this[_0x4a28e7(0x403)]='_container';}get['parentContainer'](){const _0x40c088={_0x1ad525:0x16c},_0x50e691=_0x35a251;if(this['options'][_0x50e691(_0x40c088._0x1ad525)])return this['options']['parentContainer'];return this['_map']['toolbar'];}[_0x35a251(0x44c)](){const _0x218aa3={_0x4cd4c9:0xe09},_0xce0678=_0x35a251,_0x364137=create$3(_0xce0678(_0x218aa3._0x4cd4c9),'cesium-button\x20cesium-toolbar-button');return _0x364137['style'][_0xce0678(0x922)]='inline-block',_0x364137;}[_0x35a251(0x7af)](){const _0x5eb349={_0x1e1afa:0x5f4},_0x39b77a=_0x35a251;return new Cesium__namespace['FullscreenButton'](this[_0x39b77a(_0x5eb349._0x1e1afa)],this['options']['fullscreenElement']);}[_0x35a251(0x34e)](_0x21ddc8){const _0x4f9f23={_0xe86f68:0xfc8,_0x2d7049:0xfa2},_0x411eea=_0x35a251;var _0x22af82;removeClass(_0x21ddc8,'cesium-viewer-fullscreenContainer'),addClass(_0x21ddc8,'cesium-button\x20cesium-toolbar-button'),_0x21ddc8[_0x411eea(_0x4f9f23._0xe86f68)]['display']='inline-block',_0x21ddc8['parentNode'][_0x411eea(_0x4f9f23._0x2d7049)](_0x21ddc8);const _0x171b85=(_0x22af82=this['viewer'][_0x411eea(0x692)])===null||_0x22af82===void 0x0?void 0x0:_0x22af82['_wrapper'];_0x171b85?this['parentContainer']['insertBefore'](_0x21ddc8,_0x171b85):this['parentContainer']['appendChild'](_0x21ddc8);}['_toChineseLang'](_0x34e3d5){const _0x2d22d8={_0x163299:0x89c,_0x44dd35:0x6f4},_0x126545=_0x35a251,_0x286375={'Full\x20screen':'全屏','Exit\x20full\x20screen':_0x126545(_0x2d22d8._0x163299),'Full\x20screen\x20unavailable':_0x126545(_0x2d22d8._0x44dd35)};this['_updateDomAttributeByEvent'](_0x34e3d5,_0x286375,'cesium-fullscreenButton','title','onmouseover');}}register$1('fullscreenButton',FullscreenButton);class GaodePOIGeocoder{constructor(_0x574a76={}){const _0x129c7a={_0x58fea7:0xe86},_0x4cc63e=_0x35a251;this[_0x4cc63e(_0x129c7a._0x58fea7)]=_0x574a76,this[_0x4cc63e(0x334)]=_0x574a76['key']||gaodeArr;}[_0x35a251(0xb89)](){const _0x15709c=_0x35a251,_0x26bf94=this[_0x15709c(0x334)],_0x47fd37=Math[_0x15709c(0x6ba)](Math['random']()*_0x26bf94['length']+0x1)-0x1;return _0x26bf94[_0x47fd37];}[_0x35a251(0xcc1)](_0x4cf9ac){const _0x307d76={_0xb46b94:0x707},_0x217820=_0x35a251,_0x200d40=this['getArrayRandomOne'](),_0x417f1d=new Cesium__namespace['Resource']({'url':_0x217820(_0x307d76._0xb46b94),'queryParameters':{'count':0x14,'key':_0x200d40,'keywords':_0x4cf9ac,'types':'110000|120000|130000|140000|180000|190000|',...this['options']['parameters']||{}}}),_0x25699c=this;return _0x417f1d['fetchJson']()['then'](function(_0xcf758c){const _0x2e7c3c=_0x217820;if(_0xcf758c['infocode']!==_0x2e7c3c(0xfbd))return logError$1(_0x2e7c3c(0xd4c)+_0xcf758c['infocode']+'):'+_0xcf758c[_0x2e7c3c(0xb92)]),{};if(_0xcf758c['pois'][_0x2e7c3c(0xe1e)]===0x0)return logInfo('未查询到“'+_0x4cf9ac+_0x2e7c3c(0xec2)),{};let _0x2c7a73=0xbb8;return _0x25699c[_0x2e7c3c(0x457)]['camera']['positionCartographic']['height']<_0x2c7a73&&(_0x2c7a73=_0x25699c['map']['camera']['positionCartographic']['height']),_0xcf758c['pois'][_0x2e7c3c(0x457)](function(_0x298b38){const _0x2b0a3b=_0x2e7c3c;let _0x38fdea=_0x298b38['location']['split'](',');return _0x38fdea=gcj2wgs(_0x38fdea),{'displayName':_0x298b38['name'],'destination':Cesium__namespace['Cartesian3'][_0x2b0a3b(0xa6d)](_0x38fdea[0x0],_0x38fdea[0x1],_0x2c7a73)};});});}}class Geocoder extends BaseCzmControl{constructor(_0x2f8d7={}){const _0x5cb6f8={_0x40f042:0xd4b},_0x2a5c9d=_0x35a251;super(_0x2f8d7),this['_czmControlKey']=_0x2a5c9d(_0x5cb6f8._0x40f042),this['_czmContainerKey']='_form';}get['parentContainer'](){const _0x54aab8={_0x15a019:0x16c,_0x43ec69:0xe1d},_0x350565=_0x35a251;if(this['options']['parentContainer'])return this[_0x350565(0xe86)][_0x350565(_0x54aab8._0x15a019)];return this['_map'][_0x350565(_0x54aab8._0x43ec69)];}['_createCzmContainer'](){return create$3('div','cesium-viewer-geocoderContainer');}['_createCzmControl'](){let _0x2140f1=this['options']['service'];if(!_0x2140f1){const _0x42b5dd=new GaodePOIGeocoder(this['options']['geocoderConfig']);_0x42b5dd['map']=this,_0x2140f1=[_0x42b5dd];}return new Cesium__namespace['Geocoder']({'container':this['_container'],'geocoderServices':_0x2140f1,'scene':this['_map']['scene']});}['_toChineseLang'](_0x52169b){const _0x563841=_0x35a251,_0x395449={'Enter\x20an\x20address\x20or\x20landmark...':_0x563841(0x975),'Searching...':'查询中...'};this['_updateDomAttribute'](_0x52169b,_0x395449,'cesium-geocoder-input','placeholder');}}register$1('geocoder',Geocoder);class HomeButton extends BaseCzmControl{constructor(_0x421101={}){const _0x2883b3={_0x57a260:0x91c,_0x3ece83:0x403},_0xc554ec=_0x35a251;super(_0x421101),this[_0xc554ec(_0x2883b3._0x57a260)]='_homeButton',this[_0xc554ec(_0x2883b3._0x3ece83)]=_0xc554ec(0x649),this['options']['insertIndex']=this['options']['insertIndex']??0x0;}get['parentContainer'](){const _0x572a6c=_0x35a251;if(this['options']['parentContainer'])return this['options']['parentContainer'];return this[_0x572a6c(0xd79)]['toolbar'];}['_createCzmControl'](){const _0x46291b={_0x437c5a:0xc60},_0x12a53a=_0x35a251;return new Cesium__namespace[(_0x12a53a(0xa5c))](this['_map']['toolbar'],this['_map'][_0x12a53a(_0x46291b._0x437c5a)]);}['_toChineseLang'](_0x3ea456){this['_updateDomAttribute'](_0x3ea456,{'View\x20Home':'初始视图'},'cesium-home-button','title');}}register$1('homeButton',HomeButton);class NavigationHelpButton extends BaseCzmControl{constructor(_0x2f53d2={}){const _0x5ce0d9={_0x51d631:0xe2},_0x5cdeb7=_0x35a251;super(_0x2f53d2),this['_czmControlKey']=_0x5cdeb7(_0x5ce0d9._0x51d631),this['_czmContainerKey']='_wrapper';}get['parentContainer'](){if(this['options']['parentContainer'])return this['options']['parentContainer'];return this['_map']['toolbar'];}['_createCzmControl'](){const _0x4c052={_0x2cb4a6:0xfb3},_0x3cc26d=_0x35a251;let _0x20a86d=!![];try{if(Cesium__namespace[_0x3cc26d(0xaa2)](window[_0x3cc26d(_0x4c052._0x2cb4a6)])){const _0x38338e=window['localStorage']['getItem']('cesium-hasSeenNavHelp');Cesium__namespace['defined'](_0x38338e)&&Boolean(_0x38338e)?_0x20a86d=![]:window[_0x3cc26d(0xfb3)]['setItem']('cesium-hasSeenNavHelp','true');}}catch(_0x104943){}return new Cesium__namespace['NavigationHelpButton']({'container':this['_map']['toolbar'],'instructionsInitiallyVisible':Cesium__namespace[_0x3cc26d(0x883)](this['options']['navigationInstructionsInitiallyVisible'],_0x20a86d)});}[_0x35a251(0x2da)](_0x18acc8){const _0x58ba59={_0x357c51:0x732,_0x5bd82c:0xdfc,_0x9647be:0xc0f,_0x542981:0x952,_0x29a167:0xeca,_0x1491ec:0xfa1,_0x62450f:0xea9,_0x52e49b:0x585},_0x2e7223=_0x35a251;this['_updateDomAttribute'](_0x18acc8,{'Navigation\x20Instructions':'帮助'},'cesium-navigation-help-button',_0x2e7223(_0x58ba59._0x357c51));const _0x170e1c={'Mouse':'鼠标操作','Touch':'触摸手势','Pan\x20view':'平移视图','Left\x20click\x20+\x20drag':_0x2e7223(0x95b),'Zoom\x20view':'缩放视图','Right\x20click\x20+\x20drag,\x20or':'右键+拖拽,或者','Mouse\x20wheel\x20scroll':'中键滚动','Rotate\x20view':_0x2e7223(_0x58ba59._0x5bd82c),'Middle\x20click\x20+\x20drag,\x20or':'中键按下拖拽,或者','CTRL\x20+\x20Left/Right\x20click\x20+\x20drag':'按Ctrl键\x20同时\x20左/右键拖拽','One\x20finger\x20drag':_0x2e7223(0xf2a),'Two\x20finger\x20pinch':_0x2e7223(0xaf4),'Tilt\x20view':'倾斜视图','Two\x20finger\x20drag,\x20same\x20direction':'双指按相同方向拖动','Two\x20finger\x20drag,\x20opposite\x20direction':'双指按相反方向拖动'};let _0x2bbc1e=_0x18acc8[_0x2e7223(_0x58ba59._0x9647be)](_0x2e7223(_0x58ba59._0x542981));_0x2bbc1e['length']>0x0&&(_0x2bbc1e=_0x2bbc1e[0x0],_0x170e1c[_0x2bbc1e['textContent']]&&(_0x2bbc1e['innerHTML']=_0x2bbc1e['children'][0x0][_0x2e7223(_0x58ba59._0x29a167)]+_0x170e1c[_0x2bbc1e['textContent']]));let _0x64770c=_0x18acc8['getElementsByClassName'](_0x2e7223(_0x58ba59._0x1491ec));_0x64770c['length']>0x0&&(_0x64770c=_0x64770c[0x0],_0x170e1c[_0x64770c['textContent']]&&(_0x64770c['innerHTML']=_0x64770c['children'][0x0]['outerHTML']+_0x170e1c[_0x64770c['textContent']])),this['_updateDomInnerHtml'](_0x18acc8,_0x170e1c,_0x2e7223(_0x58ba59._0x62450f)),this[_0x2e7223(_0x58ba59._0x52e49b)](_0x18acc8,_0x170e1c,'cesium-navigation-help-details'),this['_updateDomInnerHtml'](_0x18acc8,_0x170e1c,'cesium-navigation-help-zoom'),this['_updateDomInnerHtml'](_0x18acc8,_0x170e1c,_0x2e7223(0xcc8)),this['_updateDomInnerHtml'](_0x18acc8,_0x170e1c,'cesium-navigation-help-tilt');}}register$1(_0x35a251(0x692),NavigationHelpButton);class ProjectionPicker extends BaseCzmControl{constructor(_0x3d7565={}){const _0x426ee2={_0x28db72:0x91c,_0xc0922e:0x54e},_0x56ec3e=_0x35a251;super(_0x3d7565),this[_0x56ec3e(_0x426ee2._0x28db72)]=_0x56ec3e(_0x426ee2._0xc0922e),this['_czmContainerKey']='_wrapper';}get['parentContainer'](){const _0x3f37dd={_0x14e8b5:0x16c},_0x18dcde=_0x35a251;if(this['options']['parentContainer'])return this['options'][_0x18dcde(_0x3f37dd._0x14e8b5)];return this['_map']['toolbar'];}[_0x35a251(0x7af)](){const _0x19f491={_0x127aa6:0xc60},_0x37da25=_0x35a251;return new Cesium__namespace['ProjectionPicker'](this['_map']['toolbar'],this['_map'][_0x37da25(_0x19f491._0x127aa6)]);}['_toChineseLang'](_0x3d7956){const _0x240ea4=_0x35a251,_0x2b5ac5={'Perspective\x20Projection':_0x240ea4(0x792),'Orthographic\x20Projection':'正射投影'};this['_updateDomAttribute'](_0x3d7956,_0x2b5ac5,'cesium-projectionPicker-buttonPerspective','title'),this['_updateDomAttribute'](_0x3d7956,_0x2b5ac5,'cesium-projectionPicker-dropDown-icon','title');}}register$1('projectionPicker',ProjectionPicker);class SceneModePicker extends BaseCzmControl{constructor(_0xaa45f3={}){const _0x4ac6f1={_0x44fdf0:0x210},_0x1d4aa0=_0x35a251;super(_0xaa45f3),this['_czmControlKey']='_sceneModePicker',this['_czmContainerKey']=_0x1d4aa0(_0x4ac6f1._0x44fdf0);}get['parentContainer'](){const _0x2a077b={_0x5e1752:0xe86,_0x483795:0xe1d},_0x3ea439=_0x35a251;if(this[_0x3ea439(_0x2a077b._0x5e1752)]['parentContainer'])return this[_0x3ea439(0xe86)][_0x3ea439(0x16c)];return this['_map'][_0x3ea439(_0x2a077b._0x483795)];}[_0x35a251(0x7af)](){return new Cesium__namespace['SceneModePicker'](this['_map']['toolbar'],this['_map']['scene']);}['_toChineseLang'](_0x54b61f){const _0x4e8b49=_0x35a251,_0x37aae9={'2D':'二维视图','3D':'三维视图','Columbus\x20View':'哥伦布2.5D视图'};this[_0x4e8b49(0xa10)](_0x54b61f,_0x37aae9,'cesium-sceneModePicker-button3D','title','onmouseover'),this['_updateDomAttribute'](_0x54b61f,_0x37aae9,'cesium-sceneModePicker-dropDown-icon','title');}}register$1(_0x35a251(0x10e),SceneModePicker);class Timeline extends BaseCzmControl{constructor(_0x30ef2b={}){super(_0x30ef2b),this['_czmControlKey']='_timeline',this['_czmContainerKey']='container';}['_createCzmContainer'](){const _0x548e1a={_0x34f419:0xe83,_0x247edf:0xf3b},_0xf0f202=_0x35a251,_0x3aba7a=create$3(_0xf0f202(0xe09),_0xf0f202(_0x548e1a._0x34f419));return _0x3aba7a[_0xf0f202(0xfc8)][_0xf0f202(0x296)]=_0xf0f202(_0x548e1a._0x247edf),_0x3aba7a;}[_0x35a251(0x7af)](){const _0x5ecd75=_0x35a251;return new Cesium__namespace['Timeline'](this['_container'],this['_map'][_0x5ecd75(0x42d)]);}['_addedHook'](){const _0x168a55={_0x441a9c:0x97b,_0x4ea977:0xa97,_0x23c849:0x639,_0x146ab8:0x77e},_0x3cf059={_0x382942:0x579},_0x3711dd=_0x35a251;super[_0x3711dd(_0x168a55._0x441a9c)]();const _0x407d1e=(this['options'][_0x3711dd(_0x168a55._0x4ea977)]??0x1)*0xa,_0x5a2004=this['_czmContrl']['zoomTo'];this[_0x3711dd(0x458)][_0x3711dd(_0x168a55._0x23c849)]=function(_0x2d43d7,_0x37d1be){const _0x714659=_0x3711dd,_0x5689dd=Cesium__namespace[_0x714659(_0x3cf059._0x382942)]['secondsDifference'](_0x37d1be,_0x2d43d7);if(_0x5689dd>_0x407d1e)return _0x5a2004['bind'](this)(_0x2d43d7,_0x37d1be);},this['_czmContrl'][_0x3711dd(_0x168a55._0x146ab8)]('settime',this[_0x3711dd(0xf34)],![]),this['_czmContrl']['zoomTo'](this['_map']['clock']['startTime'],this['_map'][_0x3711dd(0x42d)]['stopTime']);}[_0x35a251(0xf34)](_0x59f7b4){const _0x2cf765={_0x35e953:0x42d,_0x411daa:0x21b},_0x20970a=_0x35a251,_0x27e859=_0x59f7b4[_0x20970a(_0x2cf765._0x35e953)];_0x27e859['currentTime']=_0x59f7b4['timeJulian'],_0x27e859[_0x20970a(_0x2cf765._0x411daa)]=![];}[_0x35a251(0x639)](_0x47cd1c,_0x59c169){return this['_czmContrl']['zoomTo'](_0x47cd1c,_0x59c169);}['_removedHook'](){const _0x3d6a66={_0x38d071:0xf34},_0x331df7=_0x35a251;this['_czmContrl']['removeEventListener']('settime',this[_0x331df7(_0x3d6a66._0x38d071)],![]),super['_removedHook']();}['_rebindCzmContainer'](_0x16697d){const _0x56509a={_0x5a89f7:0xfc8,_0x3b9cf7:0x296},_0x55b020=_0x35a251;_0x16697d[_0x55b020(_0x56509a._0x5a89f7)][_0x55b020(_0x56509a._0x3b9cf7)]='0px';}}register$1('timeline',Timeline);class VRButton extends BaseCzmControl{constructor(_0x1e27d1={}){super(_0x1e27d1),this['_czmControlKey']='_vrButton',this['_czmContainerKey']='_container';}get['parentContainer'](){const _0x2d360a=_0x35a251;if(this['options']['parentContainer'])return this[_0x2d360a(0xe86)]['parentContainer'];return this['_map']['toolbar'];}['_createCzmContainer'](){return create$3('div','cesium-button\x20cesium-toolbar-button\x20mars3d-vrButton');}[_0x35a251(0x7af)](){const _0x48592b={_0x588839:0x470,_0x878725:0xdee},_0x5ff304=_0x35a251;return new Cesium__namespace[(_0x5ff304(_0x48592b._0x588839))](this['_container'],this['_map']['scene'],this['options'][_0x5ff304(_0x48592b._0x878725)]);}['_rebindCzmContainer'](_0x4acdaa){const _0x3cb75e={_0x49e6c:0x16c,_0x5c097d:0x87c},_0x1bb488=_0x35a251;var _0xe95a58;removeClass(_0x4acdaa,'cesium-viewer-vrContainer'),addClass(_0x4acdaa,'cesium-button\x20cesium-toolbar-button\x20mars3d-vrButton'),_0x4acdaa['parentNode']['removeChild'](_0x4acdaa);const _0x593f04=(_0xe95a58=this['viewer']['navigationHelpButton'])===null||_0xe95a58===void 0x0?void 0x0:_0xe95a58['_wrapper'];_0x593f04?this['parentContainer']['insertBefore'](_0x4acdaa,_0x593f04):this[_0x1bb488(_0x3cb75e._0x49e6c)][_0x1bb488(_0x3cb75e._0x5c097d)](_0x4acdaa);}['_toChineseLang'](_0x5dbd53){const _0x2f9ba7={_0x3cbc23:0xd65},_0xa9aaeb=_0x35a251,_0x4f8537={'Enter\x20VR\x20mode':'进入VR模式','Exit\x20VR\x20mode':'退出VR模式','VR\x20mode\x20is\x20unavailable':_0xa9aaeb(_0x2f9ba7._0x3cbc23)};this['_updateDomAttributeByEvent'](_0x5dbd53,_0x4f8537,'cesium-vrButton','title','onmouseover');}}register$1(_0x35a251(0xea4),VRButton);class LocationBar extends BaseControl{constructor(_0x17d02b={}){const _0x3fea8e=_0x35a251;super(_0x17d02b),this[_0x3fea8e(0xe86)]['cacheTime']=this[_0x3fea8e(0xe86)]['cacheTime']??0x32,this['locationData']={};}['_mountedHook'](){const _0x2ef714={_0x525883:0x755,_0x5b7b41:0xe86,_0x20d0dd:0x255,_0x502881:0xfa0,_0x40055a:0x662},_0xd0b652={_0x5eb58c:0xd79,_0x55d60a:0x94f,_0x1309aa:0xc06,_0x1b619a:0xbc7},_0x3c8a71=_0x35a251;Cesium__namespace[_0x3c8a71(0xaa2)](this['options']['template'])?Array[_0x3c8a71(0x719)](this[_0x3c8a71(0xe86)]['template'])?this['template']=this['options']['template'][this['_map']['lang']]:this[_0x3c8a71(_0x2ef714._0x525883)]=this[_0x3c8a71(_0x2ef714._0x5b7b41)]['template']:this['template']='
经度:{lng}
\x20
纬度:{lat}
海拔:{alt}米
\x20层级:{level}
方向:{heading}°
\x20
俯仰角:{pitch}°
视高:{cameraHeight}米';if(Cesium__namespace[_0x3c8a71(0xaa2)](this['options']['crs'])){if(isString(this[_0x3c8a71(0xe86)]['crs']))this[_0x3c8a71(_0x2ef714._0x20d0dd)]=this[_0x3c8a71(_0x2ef714._0x5b7b41)]['crs'];else this['options']['crs']&&(this[_0x3c8a71(0x255)]=CRS['CGCS2000_GK_Zone_3']);}else isString(this['template'])&&this['template'][_0x3c8a71(0xd74)]('{crsx}')!==-0x1&&(this['_crs']=CRS[_0x3c8a71(0xb5c)]);this['_container']=create$3('div','mars3d-locationbar\x20no-print'),this['_containerCon']=create$3('div','mars3d-locationbar-content',this['_container']);this['options']['style']?this['setStyle'](this['options'][_0x3c8a71(0xfc8)]):(this['_autoStyle']=!![],this['_updateControlHandler']());if(this['options'][_0x3c8a71(_0x2ef714._0x502881)]){this[_0x3c8a71(0xd79)]['scene']['debugShowFramesPerSecond']=!![];const _0x3eb46a=setInterval(()=>{const _0x114316=_0x3c8a71;if(!this['_map']||!this[_0x114316(_0xd0b652._0x5eb58c)][_0x114316(0xc60)]['_performanceDisplay'])return;clearInterval(_0x3eb46a),this['timeTik']=null;const _0x38195a=this[_0x114316(_0xd0b652._0x5eb58c)][_0x114316(_0xd0b652._0x55d60a)]['querySelector'](_0x114316(0xa55));if(_0x38195a){addClass(_0x38195a,_0x114316(_0xd0b652._0x1309aa)),removeClass(_0x38195a,_0x114316(_0xd0b652._0x1b619a));const _0x5f1fe6=_0x38195a['querySelector']('.cesium-performanceDisplay-throttled');remove(_0x5f1fe6),_0x38195a['parentNode']['removeChild'](_0x38195a),this['_container'][_0x114316(0x434)](_0x38195a,this[_0x114316(0x644)]);}},0x64);this[_0x3c8a71(_0x2ef714._0x40055a)]=_0x3eb46a;}else this['timeTik']&&(clearInterval(this[_0x3c8a71(0x662)]),this['timeTik']=null),this['_map']['scene']['debugShowFramesPerSecond']=![];}['_addedHook'](){const _0x4d6fc8={_0x493ec9:0xd79,_0x381c32:0xb34,_0x11782b:0xd79,_0x562de3:0x2ce,_0x593fc4:0x1b1},_0x2c8058=_0x35a251;this[_0x2c8058(_0x4d6fc8._0x493ec9)]['on'](EventType['mouseMove'],this[_0x2c8058(_0x4d6fc8._0x381c32)],this),this[_0x2c8058(_0x4d6fc8._0x11782b)]['on'](EventType[_0x2c8058(0x801)],this[_0x2c8058(_0x4d6fc8._0x562de3)],this),this['_map']['on'](EventType['addControl'],this['_updateControlHandler'],this),this['_map']['on'](EventType['updateControl'],this[_0x2c8058(_0x4d6fc8._0x593fc4)],this),this['_cameraHandler']();}['_removedHook'](){const _0x1afdcc={_0x58e182:0x6b2,_0x140d6f:0xd79,_0x14b783:0x525,_0xbb842d:0x662},_0x575fe8=_0x35a251;this['_map'][_0x575fe8(_0x1afdcc._0x58e182)](EventType['mouseMove'],this['_mouseMoveHandler'],this),this[_0x575fe8(_0x1afdcc._0x140d6f)]['off'](EventType['cameraMoveEnd'],this['_cameraHandler'],this),this[_0x575fe8(0xd79)]['off'](EventType[_0x575fe8(_0x1afdcc._0x14b783)],this['_updateControlHandler'],this),this['_map']['off'](EventType[_0x575fe8(0xe33)],this[_0x575fe8(0x1b1)],this),this[_0x575fe8(_0x1afdcc._0xbb842d)]&&(clearInterval(this['timeTik']),this['timeTik']=null),this['options']['fps']&&(this['_map']['scene']['debugShowFramesPerSecond']=![],this['_map']['scene']['_performanceDisplay']&&(this[_0x575fe8(_0x1afdcc._0x140d6f)]['scene']['_performanceDisplay']['destroy'](),this['_map'][_0x575fe8(0xc60)][_0x575fe8(0x289)]=undefined));}['_cameraHandler'](){const _0x381331={_0x13cb49:0xd79},_0x593560=_0x35a251;if(!this['enabled'])return;const _0x24ed4b=this[_0x593560(_0x381331._0x13cb49)][_0x593560(0xf83)]();_0x24ed4b&&this['_templateHtml'](_0x24ed4b);}[_0x35a251(0xb34)](_0x352ac0){const _0x46524b={_0x49ddad:0xf7d,_0x2b3fbe:0xd54},_0x80a04f=_0x35a251;this['moveTimer']&&(clearTimeout(this[_0x80a04f(0xf7d)]),delete this[_0x80a04f(_0x46524b._0x49ddad)]),this['moveTimer']=setTimeout(()=>{const _0x55bbae=_0x80a04f;delete this['moveTimer'];if(!this['enabled'])return;const _0x1f5f9b=_0x352ac0[_0x55bbae(0x4bb)];_0x1f5f9b&&this['_templateHtml'](LngLatPoint['fromCartesian'](_0x1f5f9b));},this[_0x80a04f(0xe86)][_0x80a04f(_0x46524b._0x2b3fbe)]);}['_templateHtml'](_0x2d6167){const _0x3b92a9={_0xe9a2fe:0xd79,_0x29485b:0x78e,_0x181959:0x41f,_0xb2661c:0x38d,_0x11d22f:0xf0a,_0x2cb83d:0xb9d,_0x43d997:0x255,_0x4f0ceb:0xe86,_0x2cd1ef:0xab8,_0x2a3e5c:0xe86,_0x25f154:0x9f2},_0x1e7cf9=_0x35a251;this['locationData']['cameraHeight']=this[_0x1e7cf9(_0x3b92a9._0xe9a2fe)][_0x1e7cf9(0x7d)][_0x1e7cf9(_0x3b92a9._0x29485b)]['height']['toFixed'](LngLatPoint[_0x1e7cf9(0x846)]),this['locationData'][_0x1e7cf9(_0x3b92a9._0x181959)]=Cesium__namespace['Math'][_0x1e7cf9(0x9c5)](this['_map'][_0x1e7cf9(0x7d)][_0x1e7cf9(0x41f)])[_0x1e7cf9(0xf0a)](0x0),this['locationData']['pitch']=Cesium__namespace['Math']['toDegrees'](this['_map']['camera']['pitch'])['toFixed'](0x0),this['locationData']['level']=this[_0x1e7cf9(0xd79)]['level'],this['locationData']['alt']=formatNum$1(this['_map']['getRealAlt'](_0x2d6167['alt']),LngLatPoint['FormatAltLength']);const _0x5ac783=this['options'][_0x1e7cf9(_0x3b92a9._0xb2661c)]??LngLatPoint['FormatLength'];this['locationData']['lng']=_0x2d6167['lng'][_0x1e7cf9(_0x3b92a9._0x11d22f)](_0x5ac783),this[_0x1e7cf9(0xab8)][_0x1e7cf9(_0x3b92a9._0x2cb83d)]=_0x2d6167['lat']['toFixed'](_0x5ac783);if(this[_0x1e7cf9(_0x3b92a9._0x43d997)]){const _0x1e8f30=this[_0x1e7cf9(_0x3b92a9._0x4f0ceb)][_0x1e7cf9(0x265)]??0x1,_0x3443aa=proj4Trans([_0x2d6167['lng'],_0x2d6167['lat']],'EPSG:4326',this['_crs']);_0x3443aa[0x0]===_0x2d6167['lng']?this['locationData']['crsx']='':this['locationData'][_0x1e7cf9(0x4e4)]=_0x3443aa[0x0]['toFixed'](_0x1e8f30),_0x3443aa[0x1]===_0x2d6167['lat']?this[_0x1e7cf9(_0x3b92a9._0x2cd1ef)][_0x1e7cf9(0xfb5)]='':this['locationData']['crsy']=_0x3443aa[0x1]['toFixed'](_0x1e8f30);}let _0x40157c;typeof this['template']==='function'?_0x40157c=this['template'](this['locationData']):(this[_0x1e7cf9(_0x3b92a9._0x2a3e5c)]['formatData']&&(this['locationData']=this['options'][_0x1e7cf9(0xcb1)](this[_0x1e7cf9(0xab8)])),_0x40157c=template(this['template'],this['locationData'])),this[_0x1e7cf9(0x644)]['innerHTML']=_0x40157c,this['fire'](EventType[_0x1e7cf9(_0x3b92a9._0x25f154)]);}[_0x35a251(0x1b1)](_0x475a98){const _0x1b43c4={_0x2ea710:0xd79,_0x1a5164:0xd6e},_0x11a075=_0x35a251;var _0x196c70,_0x37b4d8;if(this[_0x11a075(0x35b)]&&(!_0x475a98||((_0x196c70=_0x475a98[_0x11a075(0x9c8)])===null||_0x196c70===void 0x0?void 0x0:_0x196c70['type'])==='animation'||((_0x37b4d8=_0x475a98['control'])===null||_0x37b4d8===void 0x0?void 0x0:_0x37b4d8['type'])==='timeline')){var _0x3c4384,_0x53ec3c,_0x29bbcf;this['setStyle']({'left':(_0x3c4384=this['_map']['controls']['animation'])!==null&&_0x3c4384!==void 0x0&&_0x3c4384['show']||(_0x53ec3c=this[_0x11a075(_0x1b43c4._0x2ea710)]['controls'][_0x11a075(_0x1b43c4._0x1a5164)])!==null&&_0x53ec3c!==void 0x0&&_0x53ec3c['show']?'170px':'0','right':'0','bottom':(_0x29bbcf=this[_0x11a075(_0x1b43c4._0x2ea710)]['controls']['timeline'])!==null&&_0x29bbcf!==void 0x0&&_0x29bbcf['show']?'25px':'0'});}}}register$1(_0x35a251(0x6ef),LocationBar);class MouseDownView extends BaseControl{[_0x35a251(0x700)](){const _0x30af18={_0x4c0de4:0x81a},_0x1786b4=_0x35a251;this['_container']=create$3('div','mars3d-mousedownview'),this[_0x1786b4(0x5f4)]['id']=this['parentContainerId']+_0x1786b4(_0x30af18._0x4c0de4),create$3('div','mars3d-mousedownview-img',this['_container']);}['changeMouseModel'](){const _0x2bc4e1={_0x9c4ab:0x47f},_0x24de88=_0x35a251;this[_0x24de88(_0x2bc4e1._0x9c4ab)]&&(this['_removedHook'](),this[_0x24de88(0x97b)]());}[_0x35a251(0x97b)](){const _0xe3eb1f={_0x385794:0xd79,_0xed93be:0xd9f},_0x5160ff=_0x35a251;if(!isPCBroswer())return;this[_0x5160ff(_0xe3eb1f._0x385794)]['on'](EventType['wheel'],this['_mousWheelHandler'],this),this['_map']['_hasRightTilt']?(this['_map']['on'](EventType[_0x5160ff(_0xe3eb1f._0xed93be)],this['_mousMiddleDownHandler'],this),this['_map']['on'](EventType['rightUp'],this['_mousMiddleUpHandler'],this)):(this['_map']['on'](EventType['middleDown'],this['_mousMiddleDownHandler'],this),this['_map']['on'](EventType[_0x5160ff(0xb0f)],this[_0x5160ff(0x47e)],this)),this['_mousMiddleUpHandler']();}['_removedHook'](){const _0x45cc87={_0x10792e:0x6b2,_0x473427:0xd79,_0x4f91f0:0x6b2,_0x3c4afd:0xb0f,_0x1fc578:0x47e,_0x547a2a:0x6b2},_0xf9887b=_0x35a251;if(!isPCBroswer())return;this[_0xf9887b(0xd79)]['off'](EventType['wheel'],this['_mousWheelHandler'],this),this['_map'][_0xf9887b(0x42f)]?(this['_map']['off'](EventType['rightDown'],this['_mousMiddleDownHandler'],this),this['_map'][_0xf9887b(_0x45cc87._0x10792e)](EventType['rightUp'],this['_mousMiddleUpHandler'],this)):(this['_map']['off'](EventType['middleDown'],this['_mousMiddleDownHandler'],this),this[_0xf9887b(_0x45cc87._0x473427)][_0xf9887b(_0x45cc87._0x4f91f0)](EventType[_0xf9887b(_0x45cc87._0x3c4afd)],this[_0xf9887b(_0x45cc87._0x1fc578)],this)),this['_map'][_0xf9887b(_0x45cc87._0x547a2a)](EventType['mouseMove'],this['_mouseMoveHandler'],this),clearTimeout(this['timetik']);}['_mousWheelHandler'](_0x2d8f03){const _0x1cbdfd=_0x35a251;if(!this['enabled'])return;addClass(this[_0x1cbdfd(0x5f4)],'mars3d-mousedownview-show'),clearTimeout(this['timetik']),this['timetik']=setTimeout(()=>{const _0x2a498f=_0x1cbdfd;removeClass(this[_0x2a498f(0x5f4)],'mars3d-mousedownview-show');},0xc8);}['_mousMiddleDownHandler'](_0xc65638){const _0x527cfe={_0x37329d:0xf26,_0x887ab6:0x6b2,_0x5f1300:0x75b,_0x31ed16:0xfc8,_0x595963:0x5f4,_0xbd9bb9:0x7ce},_0x9b5427=_0x35a251;if(!this['enabled'])return;const _0x3ff787=getCurrentMousePosition(this['_map']['scene'],_0xc65638['position']);if(!_0x3ff787)return;if(this[_0x9b5427(0xd79)][_0x9b5427(0x7d)][_0x9b5427(0x78e)][_0x9b5427(0x682)]>this['_map']['scene']['screenSpaceCameraController'][_0x9b5427(_0x527cfe._0x37329d)])return;this['_map'][_0x9b5427(_0x527cfe._0x887ab6)](EventType['mouseMove'],this['_mouseMoveHandler'],this),clearTimeout(this[_0x9b5427(_0x527cfe._0x5f1300)]),this['_container']['style'][_0x9b5427(0x82e)]=_0xc65638['position']['y']+'px',this['_container'][_0x9b5427(_0x527cfe._0x31ed16)]['left']=_0xc65638['position']['x']+'px',addClass(this[_0x9b5427(_0x527cfe._0x595963)],_0x9b5427(_0x527cfe._0xbd9bb9));}['_mousMiddleUpHandler'](_0x2eccef){const _0x5e36e8={_0xb6bf1d:0x5f4},_0x2d19b6=_0x35a251;removeClass(this[_0x2d19b6(_0x5e36e8._0xb6bf1d)],'mars3d-mousedownview-show'),this[_0x2d19b6(0xd79)]['on'](EventType[_0x2d19b6(0x971)],this['_mouseMoveHandler'],this);}['_mouseMoveHandler'](_0x3cbdbe){const _0x55aee2={_0x26e721:0x5f4,_0x4934ac:0xfa3},_0x53694b=_0x35a251;this[_0x53694b(_0x55aee2._0x26e721)]['style']['top']=_0x3cbdbe['endPosition']['y']+'px',this['_container']['style'][_0x53694b(_0x55aee2._0x4934ac)]=_0x3cbdbe['endPosition']['x']+'px';}}register$1('mouseDownView',MouseDownView);const icon$7='\x0a\x0a\x20\x20\x0a\x20\x20\x0a\x20\x20\x0a',icon$6=_0x35a251(0x199);class Zoom extends BaseControl{get[_0x35a251(0x16c)](){const _0xb9d31d={_0x4db671:0xd79},_0x1912cb=_0x35a251;return this[_0x1912cb(_0xb9d31d._0x4db671)]?this['_map']['toolbar']:document['getElementsByClassName']('cesium-viewer-toolbar')[0x0];}['_showHook'](_0x47929b){const _0x3bb0d4=_0x35a251;this['_container2']&&(this['_container2']['style'][_0x3bb0d4(0x922)]=_0x47929b?'block':'none');}[_0x35a251(0x700)](){const _0x3814cb={_0x5463ce:0x845,_0x1ced81:0xe86,_0x118b3d:0xe09,_0x8673e:0xe86,_0xbc79af:0x77e},_0x15ac2f={_0x1f41cb:0xe86},_0x4f5779=_0x35a251;this['_container']=create$3('div',_0x4f5779(_0x3814cb._0x5463ce)),this['_container']['style']['display']='inline-block',this['_container']['setAttribute'](_0x4f5779(0x732),this['_map'][_0x4f5779(0x44e)]('_缩小')),this['_createIcon'](this[_0x4f5779(_0x3814cb._0x1ced81)]['zoomOutIcon']||icon$6,this['_container']),this['_container']['addEventListener']('click',_0x35d29a=>{const _0x4d736b=_0x4f5779;if(!this['enabled'])return;this['_map'][_0x4d736b(0x66f)](this[_0x4d736b(_0x15ac2f._0x1f41cb)]['relativeAmount']);}),this['_container2']=create$3(_0x4f5779(_0x3814cb._0x118b3d),_0x4f5779(0x845)),this['_container2']['style'][_0x4f5779(0x922)]='inline-block',this['_container2']['setAttribute'](_0x4f5779(0x732),this['_map'][_0x4f5779(0x44e)]('_放大')),this['_createIcon'](this[_0x4f5779(_0x3814cb._0x8673e)]['zoomInIcon']||icon$7,this['_container2']),this['_container2'][_0x4f5779(_0x3814cb._0xbc79af)](_0x4f5779(0xfb4),_0x5ae5e4=>{const _0x392135=_0x4f5779;if(!this[_0x392135(0x2a6)])return;this['_map']['zoomIn'](this[_0x392135(0xe86)]['relativeAmount']);});}[_0x35a251(0x97b)](){this['parentContainer']['insertBefore'](this['_container2'],this['_container']);}['_removedHook'](){const _0x9a44b3=_0x35a251;this['parentContainer']['removeChild'](this[_0x9a44b3(0x1c7)]);}}register$1('zoom',Zoom);class ToolButton extends BaseControl{constructor(_0x2adf92={}){super(_0x2adf92),this['_type']='toolButton'+getGlobalId();}get['parentContainer'](){const _0x40a470=_0x35a251;return this[_0x40a470(0xd79)]?this['_map']['toolbar']:document['getElementsByClassName']('cesium-viewer-toolbar')[0x0];}['_mountedHook'](){const _0x3eb660={_0x1fd29a:0x5f4,_0x32972b:0x845,_0x38605:0x5a0,_0x308b43:0x369},_0x4513dc={_0x231741:0xe86},_0x30c7e0={_0xddefe2:0xe86},_0x297b41=_0x35a251;this[_0x297b41(_0x3eb660._0x1fd29a)]=create$3('div',_0x297b41(_0x3eb660._0x32972b)),this['_container']['id']=this['id'],this['_container']['style']['display']='inline-block',this['_container'][_0x297b41(0x538)]('title',this['options']['title']||''),this['_createIcon'](this['options'][_0x297b41(_0x3eb660._0x38605)],this['_container']);let _0x114ad4;this['_container']['addEventListener']('mouseover',_0x1ca8ef=>{const _0x23232c=_0x297b41;if(!this['enabled'])return;if(_0x114ad4===this['id'])return;_0x114ad4=this['id'],this['options']['mouseOver']&&this[_0x23232c(_0x30c7e0._0xddefe2)]['mouseOver'](this['options']),this['fire'](EventType['mouseOver'],{...this['options']});}),this['_container']['addEventListener'](_0x297b41(_0x3eb660._0x308b43),_0x362abf=>{const _0x4db4d6=_0x297b41;_0x114ad4=null;if(!this['enabled'])return;this[_0x4db4d6(_0x4513dc._0x231741)]['mouseOut']&&this['options'][_0x4db4d6(0x6cc)](this['options']),this['fire'](EventType['mouseOut'],{...this['options']});});}[_0x35a251(0xb9e)](_0x426c06){const _0xcbbaa0=_0x35a251;this[_0xcbbaa0(0xe86)][_0xcbbaa0(0x5a0)]=_0x426c06,empty(this['_container']),this['_createIcon'](_0x426c06,this['_container']);}}register$1('toolButton',ToolButton);const icon$5=_0x35a251(0x73c),icon$4='\x0a\x0a\x20\x20\x20\x20拖拽调整俯仰角\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a',icon$3='\x0a\x0a\x20\x20\x20\x20导航球\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a';class Compass extends BaseControl{constructor(_0x4d2f16={}){super(_0x4d2f16),this['_orbitCursorAngle']=0x0,this['_orbitCursorOpacity']=0x0,this['_orbitLastTimestamp']=0x0,this['options']['rotation']=this['options']['rotation']??!![];}['_getCssText'](){const _0x2a5064={_0x27c983:0xe86,_0x3c7cac:0xe86,_0x91b23b:0xe86,_0x287d1c:0xaa2,_0x4005ed:0xfa3,_0x3564c2:0xe86,_0xbaa0e9:0xadc},_0x49a5f8=_0x35a251,_0x50cc8e={};if(Cesium__namespace['defined'](this[_0x49a5f8(_0x2a5064._0x27c983)]['top'])&&this['options']['top']!=='')_0x50cc8e[_0x49a5f8(0x82e)]=this['options']['top'];else{if(Cesium__namespace['defined'](this['options']['bottom'])&&this[_0x49a5f8(_0x2a5064._0x3c7cac)]['bottom']!==''){_0x50cc8e['bottom']=this[_0x49a5f8(_0x2a5064._0x91b23b)]['bottom'];if(_0x50cc8e['bottom']==='toolbar'){const _0x3e3c3d=this['_map']['toolbar'];if(_0x3e3c3d){const _0x54542a=_0x3e3c3d[_0x49a5f8(0x30d)]+0x28;_0x50cc8e['bottom']=_0x54542a+'px',this['domToolbar']=_0x3e3c3d;}}}}if(Cesium__namespace[_0x49a5f8(_0x2a5064._0x287d1c)](this['options'][_0x49a5f8(0xfa3)])&&this['options']['left']!=='')_0x50cc8e[_0x49a5f8(_0x2a5064._0x4005ed)]=this['options'][_0x49a5f8(0xfa3)];else Cesium__namespace['defined'](this[_0x49a5f8(0xe86)]['right'])&&this['options'][_0x49a5f8(0x296)]!==''&&(_0x50cc8e['right']=this[_0x49a5f8(_0x2a5064._0x3564c2)]['right']);let _0x4531c6='';for(const _0x17c514 in _0x50cc8e){_0x4531c6+=_0x17c514+':\x20'+_0x50cc8e[_0x17c514]+';';}return _0x4531c6||_0x49a5f8(_0x2a5064._0xbaa0e9);}[_0x35a251(0x700)](){const _0xbc888b={_0x36ed77:0x5f4,_0x5de372:0xe09,_0x469f22:0x87c,_0x47da04:0xf15,_0x3d6b38:0x919,_0x1c049f:0xe93,_0x2af031:0xa25},_0x4ba36e={_0x395b78:0x7d,_0x41111d:0xdc6},_0x548e0a=_0x35a251;this[_0x548e0a(_0xbc888b._0x36ed77)]=create$3(_0x548e0a(_0xbc888b._0x5de372),this['options']['className']||'mars3d-compass'),this['_container']['style']['cssText']=this['_getCssText'](),this['_container']['onmousedown']=_0x52c884=>{this['_handleMouseDown'](_0x52c884);},this['_container_outer']=parseDom(this['options']['outerSvg']||icon$5,!![],'mars3d-compass-outer'),this['_container'][_0x548e0a(_0xbc888b._0x469f22)](this['_container_outer']),this[_0x548e0a(_0xbc888b._0x47da04)]['ondblclick']=_0x4d006a=>{const _0x5e3c80=_0x548e0a;this['_map'][_0x5e3c80(_0x4ba36e._0x395b78)][_0x5e3c80(_0x4ba36e._0x41111d)]({'orientation':{'heading':0x0}});},this['_container_inner']=parseDom(this[_0x548e0a(0xe86)][_0x548e0a(_0xbc888b._0x3d6b38)]||icon$4,!![],_0x548e0a(_0xbc888b._0x1c049f)),this['_container']['appendChild'](this['_container_inner']),this['_container_inner'][_0x548e0a(0xe4e)]=_0x5b2916=>{this['_map']['flyHome']();},this['options']['rotation']&&(this[_0x548e0a(_0xbc888b._0x2af031)]=parseDom(this['options']['rotationArcSvg']||icon$3,!![],_0x548e0a(0x8ee)),this['_container']['appendChild'](this['_container_rotationArc']),this[_0x548e0a(0xa25)][_0x548e0a(0xfc8)]['visibility']='hidden');}['setOuterSvg'](_0x4a8dc9){this['_container_outer']['innerHTML']=_0x4a8dc9;}['setInnerSvg'](_0xf7e5fd){this['_container_inner']['innerHTML']=_0xf7e5fd;}[_0x35a251(0xc0a)](_0x4abfd7){const _0x66c601={_0x2f6bb2:0xf4a},_0x13ee19=_0x35a251;this['_container_rotationArc'][_0x13ee19(_0x66c601._0x2f6bb2)]=_0x4abfd7;}['_addedHook'](){const _0x368abc={_0x51364d:0xd79,_0x44c586:0x525,_0x4987cd:0xe33,_0x2be1d1:0x1b1},_0x4345a6=_0x35a251;this[_0x4345a6(_0x368abc._0x51364d)]['on'](EventType['postRender'],this[_0x4345a6(0x5c5)],this),this['_map']['on'](EventType[_0x4345a6(_0x368abc._0x44c586)],this[_0x4345a6(0x1b1)],this),this[_0x4345a6(0xd79)]['on'](EventType[_0x4345a6(_0x368abc._0x4987cd)],this[_0x4345a6(_0x368abc._0x2be1d1)],this);}['_removedHook'](){const _0x332a57={_0x282de6:0xd79,_0x349abf:0xd79,_0x31ac8c:0xe33},_0x4aa981=_0x35a251;this[_0x4aa981(_0x332a57._0x282de6)]['off'](EventType['postRender'],this['_postRenderHandler'],this),this['_map']['off'](EventType['addControl'],this['_updateControlHandler'],this),this[_0x4aa981(_0x332a57._0x349abf)]['off'](EventType['addControl'],this['_updateControlHandler'],this),this['_map']['off'](EventType[_0x4aa981(_0x332a57._0x31ac8c)],this['_updateControlHandler'],this);}[_0x35a251(0x1b1)](){const _0x3353c9=_0x35a251;if(this['domToolbar']){const _0x201971=this['domToolbar'][_0x3353c9(0x30d)]+0x28;this['_container']['style'][_0x3353c9(0xdaf)]=_0x201971+'px';}}[_0x35a251(0x5c5)](){const _0x49c191={_0x38e677:0xb3e},_0x66fe5a=_0x35a251,_0x297327=this['_map'][_0x66fe5a(0x7d)]['heading'];this['_container_outer']&&(this['_container_outer']['style']['cssText']='\x0a\x20\x20\x20\x20\x20\x20transform\x20:\x20rotate(-'+_0x297327+_0x66fe5a(_0x49c191._0x38e677)+_0x297327+'rad);\x0a\x20\x20\x20\x20\x20\x20');}['_handleMouseDown'](_0x55028d){const _0x40745e={_0x1e8f43:0xe86},_0x2b17f5=_0x35a251,_0x4aaffb=this['_map'][_0x2b17f5(0xc60)];if(_0x4aaffb['mode']===Cesium__namespace['SceneMode']['MORPHING'])return!![];this['_compassRectangle']=_0x55028d[_0x2b17f5(0x7df)][_0x2b17f5(0x1ae)]();const _0x47d3cb=this['_compassRectangle']['width']/0x2,_0x92936f=this['_getVector'](_0x55028d),_0x5bffc0=Cesium__namespace['Cartesian2']['magnitude'](_0x92936f)/_0x47d3cb;if(this[_0x2b17f5(_0x40745e._0x1e8f43)]['rotation']&&_0x5bffc0<0x32/0x91)this['_orbit'](_0x92936f);else{if(_0x5bffc0<0x1)this['_rotate'](_0x92936f);else return!![];}}['_getCameraFocus'](_0x3c1edd){const _0x2edd99={_0x121fab:0xd79,_0x3644cd:0x7ec},_0x506e04=_0x35a251;let _0x462694=new Cesium__namespace['Cartesian3']();const _0x43502e=this[_0x506e04(_0x2edd99._0x121fab)][_0x506e04(0xc60)],_0x549f9e=_0x43502e['camera'];if(_0x43502e['mode']===Cesium__namespace['SceneMode']['MORPHING'])return undefined;if(this['_map']['trackedEntity'])_0x462694=this['_map']['trackedEntity']['position'][_0x506e04(_0x2edd99._0x3644cd)](this[_0x506e04(0xd79)]['clock'][_0x506e04(0x18b)]);else{const _0x28969e=new Cesium__namespace[(_0x506e04(0xd31))]();_0x28969e['origin']=_0x549f9e['positionWC'],_0x28969e[_0x506e04(0x79b)]=_0x549f9e['directionWC'],_0x462694=_0x43502e['globe']['pick'](_0x28969e,_0x43502e);}if(!_0x462694)return undefined;if(_0x43502e[_0x506e04(0xef7)]===Cesium__namespace['SceneMode'][_0x506e04(0xc4c)]||_0x43502e['mode']===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']){_0x462694=_0x549f9e['worldToCameraCoordinatesPoint'](_0x462694);const _0x13a11a=new Cesium__namespace['Cartographic']();_0x3c1edd&&(_0x462694=_0x43502e['globe']['ellipsoid']['cartographicToCartesian'](_0x43502e[_0x506e04(0x5fc)][_0x506e04(0xa71)](_0x462694,_0x13a11a)));}else!_0x3c1edd&&(_0x462694=_0x549f9e['worldToCameraCoordinatesPoint'](_0x462694));return _0x462694;}['_orbit'](_0x250dea){const _0x2e862b={_0x5c654b:0xc60,_0x2c023c:0xef7,_0x148dfb:0x191,_0x5bc1c4:0xf3c,_0x37fe51:0xdc1,_0x165771:0x8b9,_0x2f5afa:0xd79,_0xebe024:0x49c,_0x166a5e:0xef2,_0x402930:0xabb,_0x49bb0b:0xf48},_0x4e136d=_0x35a251,_0x28a20b=this['_map'][_0x4e136d(_0x2e862b._0x5c654b)],_0x140b33=_0x28a20b['screenSpaceCameraController'],_0x3a6613=_0x28a20b[_0x4e136d(0x7d)];if(_0x28a20b['mode']===Cesium__namespace['SceneMode']['MORPHING']||!_0x140b33['enableInputs'])return;switch(_0x28a20b[_0x4e136d(_0x2e862b._0x2c023c)]){case Cesium__namespace['SceneMode']['SCENE2D']:if(!_0x140b33[_0x4e136d(0xc67)])return;break;case Cesium__namespace[_0x4e136d(0x637)][_0x4e136d(_0x2e862b._0x148dfb)]:if(_0x140b33['enableLook'])break;if(!_0x140b33[_0x4e136d(0xc67)]||!_0x140b33[_0x4e136d(0x83f)])return;break;case Cesium__namespace['SceneMode']['SCENE3D']:default:if(_0x140b33['enableLook'])break;if(!_0x140b33[_0x4e136d(0x83f)]||!_0x140b33[_0x4e136d(_0x2e862b._0x5bc1c4)])return;break;}this[_0x4e136d(0x8b9)]=_0x5346d6=>{const _0x37df29=_0x4e136d;this[_0x37df29(0x8d5)](_0x5346d6);},this[_0x4e136d(0xe89)]=()=>{this['_orbitMouseUpFunction']();},document['removeEventListener'](_0x4e136d(_0x2e862b._0x37fe51),this[_0x4e136d(_0x2e862b._0x165771)],![]),document['removeEventListener']('mouseup',this['_mouseUpHandle'],![]),this['_orbitLastTimestamp']=Cesium__namespace['getTimestamp']();if(this[_0x4e136d(_0x2e862b._0x2f5afa)]['trackedEntity'])this['_orbitFrame']=undefined,this['_orbitIsLook']=![];else{const _0xec5073=this['_getCameraFocus'](!![]);!_0xec5073?(this['_orbitFrame']=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x3a6613['positionWC'],_0x28a20b['globe']['ellipsoid']),this['_orbitIsLook']=!![]):(this[_0x4e136d(0xd84)]=Cesium__namespace[_0x4e136d(_0x2e862b._0xebe024)]['eastNorthUpToFixedFrame'](_0xec5073,_0x28a20b['globe']['ellipsoid']),this[_0x4e136d(0xf2b)]=![]);}this['_container_rotationArc'][_0x4e136d(0xfc8)]['visibility']=_0x4e136d(0x2d9),this[_0x4e136d(_0x2e862b._0x166a5e)]['className']+='\x20compass-inner-active',document[_0x4e136d(0x77e)](_0x4e136d(0xdc1),this[_0x4e136d(0x8b9)],![]),document['addEventListener']('mouseup',this['_mouseUpHandle'],![]),this['_map']['on'](EventType['clockTick'],this['_orbitTickFunction'],this),this['_updateAngleAndOpacity'](_0x250dea,this[_0x4e136d(_0x2e862b._0x402930)][_0x4e136d(_0x2e862b._0x49bb0b)]);}['_orbitTickFunction'](_0x189ea3){const _0x5731e4={_0x1f5f16:0x7c0,_0x2a2311:0xeec,_0x426ae6:0xd84,_0xef34b1:0x21a,_0x491564:0xba2},_0x331481=_0x35a251,_0x56aa4a=this['_map']['scene'],_0x5167fb=this[_0x331481(0xd79)]['camera'],_0x4e29c7=Cesium__namespace['getTimestamp'](),_0x27d4f2=_0x4e29c7-this['_orbitLastTimestamp'],_0x50b2cd=(this[_0x331481(0xb2c)]-0.5)*2.5/0x3e8,_0x5ca3c1=_0x27d4f2*_0x50b2cd,_0x3e8245=this[_0x331481(0xd15)]+Cesium__namespace[_0x331481(_0x5731e4._0x1f5f16)]['PI_OVER_TWO'],_0x22d3d2=Math[_0x331481(_0x5731e4._0x2a2311)](_0x3e8245)*_0x5ca3c1,_0x4c1e4a=Math['sin'](_0x3e8245)*_0x5ca3c1;let _0x85cc9b;this[_0x331481(_0x5731e4._0x426ae6)]&&(_0x85cc9b=Cesium__namespace['Matrix4']['clone'](_0x5167fb[_0x331481(_0x5731e4._0xef34b1)]),_0x5167fb['lookAtTransform'](this['_orbitFrame'])),_0x56aa4a['mode']===Cesium__namespace['SceneMode']['SCENE2D']?_0x5167fb[_0x331481(_0x5731e4._0x491564)](new Cesium__namespace['Cartesian3'](_0x22d3d2,_0x4c1e4a,0x0),Math['max'](_0x56aa4a['canvas']['clientWidth'],_0x56aa4a['canvas']['clientHeight'])/0x64*_0x5167fb['positionCartographic'][_0x331481(0x682)]*_0x5ca3c1):this[_0x331481(0xf2b)]?(_0x5167fb['look'](Cesium__namespace['Cartesian3'][_0x331481(0x61f)],-_0x22d3d2),_0x5167fb['look'](_0x5167fb[_0x331481(0x296)],-_0x4c1e4a)):(_0x5167fb['rotateLeft'](_0x22d3d2),_0x5167fb['rotateUp'](_0x4c1e4a)),this['_orbitFrame']&&_0x85cc9b&&_0x5167fb['lookAtTransform'](_0x85cc9b),this['_orbitLastTimestamp']=_0x4e29c7;}['_updateAngleAndOpacity'](_0x2b6025,_0x4c6843){const _0x3301ab=_0x35a251,_0x4eaa44=Math['atan2'](-_0x2b6025['y'],_0x2b6025['x']);this['_orbitCursorAngle']=Cesium__namespace['Math']['zeroToTwoPi'](_0x4eaa44-Cesium__namespace['Math']['PI_OVER_TWO']);const _0x1aa37b=Cesium__namespace['Cartesian2']['magnitude'](_0x2b6025),_0x2afd27=_0x4c6843/0x2,_0x1d777b=Math[_0x3301ab(0x60c)](_0x1aa37b/_0x2afd27,0x1);this['_orbitCursorOpacity']=0.5*_0x1d777b*_0x1d777b+0.5,this['_container_rotationArc']['style'][_0x3301ab(0x967)]='\x0a\x20\x20\x20\x20\x20\x20transform:\x20rotate(-'+this['_orbitCursorAngle']+'rad);\x0a\x20\x20\x20\x20\x20\x20opacity:\x20'+this['_orbitCursorOpacity'];}[_0x35a251(0x8d5)](_0x5173e1){this['_updateAngleAndOpacity'](this['_getVector'](_0x5173e1),this['_compassRectangle']['width']);}['_orbitMouseUpFunction'](){const _0x2a9c7e={_0x247982:0xdc1,_0x124d7c:0xd56,_0x44e06c:0x15a},_0x23ef07=_0x35a251;document['removeEventListener'](_0x23ef07(_0x2a9c7e._0x247982),this[_0x23ef07(0x8b9)],![]),document['removeEventListener']('mouseup',this[_0x23ef07(0xe89)],![]),this['_map']['off'](EventType['clockTick'],this[_0x23ef07(_0x2a9c7e._0x124d7c)],this),this['_mouseMoveHandle']=undefined,this['_mouseUpHandle']=undefined,this[_0x23ef07(0xa25)]['style']['visibility']='hidden',this['_container_inner'][_0x23ef07(_0x2a9c7e._0x44e06c)]=this['_container_inner']['className']['replace']('compass-inner-active','');}['_rotate'](_0x189fe5){const _0x3ba6ae={_0x42883c:0xc60,_0x3bd28e:0xe57,_0x20c38d:0xc4c,_0x8aae9a:0xf3c,_0x59f22b:0x60d,_0x1063d1:0xef7,_0x331ecd:0x67b,_0x4ca2ff:0x22f,_0xf6c802:0x3f4,_0x376e2e:0x2e0,_0x14b9eb:0x8b9},_0x8329c1={_0x4082a4:0xa4d},_0x2768ad=_0x35a251,_0x3522b6=this[_0x2768ad(0xd79)][_0x2768ad(_0x3ba6ae._0x42883c)],_0x3974a8=_0x3522b6[_0x2768ad(0x7d)],_0x35c256=_0x3522b6['screenSpaceCameraController'];if(_0x3522b6['mode']===Cesium__namespace['SceneMode'][_0x2768ad(_0x3ba6ae._0x3bd28e)]||_0x3522b6[_0x2768ad(0xef7)]===Cesium__namespace['SceneMode'][_0x2768ad(_0x3ba6ae._0x20c38d)]||!_0x35c256[_0x2768ad(0x856)])return;if(!_0x35c256['enableLook']&&(_0x3522b6[_0x2768ad(0xef7)]===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']||_0x3522b6['mode']===Cesium__namespace['SceneMode']['SCENE3D']&&!_0x35c256[_0x2768ad(_0x3ba6ae._0x8aae9a)]))return;this['_mouseMoveHandle']=_0x306af6=>{this['_rotateMouseMoveFunction'](_0x306af6);},this['_mouseUpHandle']=()=>{const _0x1a86cb=_0x2768ad;this[_0x1a86cb(_0x8329c1._0x4082a4)]();},document['removeEventListener']('mousemove',this[_0x2768ad(0x8b9)],![]),document[_0x2768ad(0x4d6)]('mouseup',this['_mouseUpHandle'],![]),this['_rotateInitialCursorAngle']=Math['atan2'](-_0x189fe5['y'],_0x189fe5['x']);if(this['_map']['trackedEntity'])this[_0x2768ad(_0x3ba6ae._0x59f22b)]=undefined;else{const _0x53ac5c=this['_getCameraFocus'](!![]);!_0x53ac5c||_0x3522b6[_0x2768ad(_0x3ba6ae._0x1063d1)]===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']&&!_0x35c256['enableLook']&&!_0x35c256['enableTranslate']?this['_rotateFrame']=Cesium__namespace['Transforms'][_0x2768ad(_0x3ba6ae._0x331ecd)](_0x3974a8['positionWC'],_0x3522b6[_0x2768ad(_0x3ba6ae._0x4ca2ff)]['ellipsoid']):this['_rotateFrame']=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x53ac5c,_0x3522b6['globe'][_0x2768ad(_0x3ba6ae._0xf6c802)]);}let _0x34955d;this['_rotateFrame']&&(_0x34955d=Cesium__namespace['Matrix4'][_0x2768ad(0xd61)](_0x3974a8[_0x2768ad(0x21a)]),_0x3974a8['lookAtTransform'](this['_rotateFrame'])),this[_0x2768ad(0xaad)]=-_0x3974a8['heading'],this['_rotateFrame']&&_0x34955d&&_0x3974a8[_0x2768ad(_0x3ba6ae._0x376e2e)](_0x34955d),document['addEventListener']('mousemove',this[_0x2768ad(_0x3ba6ae._0x14b9eb)],![]),document['addEventListener']('mouseup',this['_mouseUpHandle'],![]);}['_rotateMouseMoveFunction'](_0x55fdd7){const _0x47259b={_0x1509b8:0x656,_0xd27213:0x5f5,_0x1caef8:0x60d,_0x1f3210:0x2e0,_0x1e4fe4:0xd2b},_0x304d85=_0x35a251,_0xd6fa53=this['_map']['camera'],_0x2795a8=this[_0x304d85(_0x47259b._0x1509b8)](_0x55fdd7),_0x4878bd=Math[_0x304d85(_0x47259b._0xd27213)](-_0x2795a8['y'],_0x2795a8['x']),_0xc91299=_0x4878bd-this['_rotateInitialCursorAngle'],_0x368b97=Cesium__namespace['Math'][_0x304d85(0x4b4)](this['_rotateInitialCameraAngle']-_0xc91299);let _0x47b824;this[_0x304d85(_0x47259b._0x1caef8)]&&(_0x47b824=Cesium__namespace['Matrix4']['clone'](_0xd6fa53[_0x304d85(0x21a)]),_0xd6fa53[_0x304d85(_0x47259b._0x1f3210)](this[_0x304d85(0x60d)]));const _0x2d9ef2=-_0xd6fa53['heading'];_0xd6fa53[_0x304d85(_0x47259b._0x1e4fe4)](_0x368b97-_0x2d9ef2),this['_rotateFrame']&&_0x47b824&&_0xd6fa53[_0x304d85(_0x47259b._0x1f3210)](_0x47b824);}['_rotateMouseUpFunction'](){document['removeEventListener']('mousemove',this['_mouseMoveHandle'],![]),document['removeEventListener']('mouseup',this['_mouseUpHandle'],![]),this['_mouseMoveHandle']=undefined,this['_mouseUpHandle']=undefined;}['_getVector'](_0x5d11d7){const _0x49eddb={_0x4b6b97:0xabb,_0x4d98b3:0x248,_0x1467e2:0xfa3,_0xdfb1ff:0x82e,_0x2606b5:0xfa3,_0x5a2a52:0xc61},_0x5a793f=_0x35a251,_0x4d01e5=this[_0x5a793f(_0x49eddb._0x4b6b97)],_0x114b92=new Cesium__namespace[(_0x5a793f(_0x49eddb._0x4d98b3))]((_0x4d01e5['right']-_0x4d01e5[_0x5a793f(_0x49eddb._0x1467e2)])/0x2,(_0x4d01e5['bottom']-_0x4d01e5[_0x5a793f(_0x49eddb._0xdfb1ff)])/0x2),_0x20e5c7=new Cesium__namespace['Cartesian2'](_0x5d11d7['clientX']-_0x4d01e5[_0x5a793f(_0x49eddb._0x2606b5)],_0x5d11d7['clientY']-_0x4d01e5['top']),_0x476ec1=new Cesium__namespace['Cartesian2']();return Cesium__namespace['Cartesian2'][_0x5a793f(_0x49eddb._0x5a2a52)](_0x20e5c7,_0x114b92,_0x476ec1),_0x476ec1;}}register$1('compass',Compass);const geodesic=new Cesium__namespace[(_0x35a251(0xd43))](),BASE=[0x1,0x2,0x3,0x5],DIS=[...BASE,...BASE['map'](_0xe5040b=>_0xe5040b*0xa),...BASE['map'](_0x28714e=>_0x28714e*0x64),...BASE[_0x35a251(0x457)](_0x143ac2=>_0x143ac2*0x3e8),...BASE[_0x35a251(0x457)](_0x3a5520=>_0x3a5520*0x2710),...BASE[_0x35a251(0x457)](_0x2a0cb8=>_0x2a0cb8*0x186a0),...BASE['map'](_0x988871=>_0x988871*0xf4240)];class DistanceLegend extends BaseControl{get['distance'](){return this['_currDistance'];}[_0x35a251(0x700)](){const _0x509ef0={_0x370356:0x5f4,_0x22f015:0xf92,_0x8955a8:0x5f4},_0x22ee5d=_0x35a251;this[_0x22ee5d(0x5f4)]=create$3('div','mars3d-distance-legend'),this[_0x22ee5d(_0x509ef0._0x370356)][_0x22ee5d(0xfc8)]['cssText']=this['_getCssText'](),this[_0x22ee5d(_0x509ef0._0x22f015)]=create$3('div','legend-label',this['_container']),this['_scaleBarEl']=create$3('div','legend-scale-bar',this[_0x22ee5d(_0x509ef0._0x8955a8)]),this['_container']['style'][_0x22ee5d(0x2f8)]='hidden',this['_lastUpdate']=Cesium__namespace[_0x22ee5d(0x592)]();}[_0x35a251(0x627)](){const _0x2ac9bb={_0x84816e:0x82e,_0x426c37:0xe86,_0x38d2e1:0xaa2,_0x58f65e:0xe86,_0x1f5210:0xfa3,_0x273351:0xfa3,_0x302379:0xdce},_0x28c8ad=_0x35a251;var _0x323577;const _0x14a601={};if(Cesium__namespace[_0x28c8ad(0xaa2)](this['options'][_0x28c8ad(_0x2ac9bb._0x84816e)])&&this[_0x28c8ad(_0x2ac9bb._0x426c37)]['top']!=='')_0x14a601['top']=this[_0x28c8ad(0xe86)]['top'];else Cesium__namespace[_0x28c8ad(0xaa2)](this['options'][_0x28c8ad(0xdaf)])&&this['options']['bottom']!==''&&(_0x14a601['bottom']=this['options']['bottom']);if(Cesium__namespace[_0x28c8ad(_0x2ac9bb._0x38d2e1)](this[_0x28c8ad(_0x2ac9bb._0x58f65e)][_0x28c8ad(_0x2ac9bb._0x1f5210)])&&this['options'][_0x28c8ad(_0x2ac9bb._0x273351)]!=='')_0x14a601['left']=this['options']['left'];else Cesium__namespace['defined'](this['options']['right'])&&this['options'][_0x28c8ad(0x296)]!==''&&(_0x14a601['right']=this['options']['right']);let _0x3e1b12='';for(const _0x59f670 in _0x14a601){_0x3e1b12+=_0x59f670+':\x20'+_0x14a601[_0x59f670]+';';}return _0x3e1b12||_0x28c8ad(_0x2ac9bb._0x302379)+((_0x323577=this['_map']['controls'][_0x28c8ad(0x93)])!==null&&_0x323577!==void 0x0&&_0x323577['show']?'27':'2')+'px;';}['_addedHook'](){const _0x3ca992=_0x35a251;this[_0x3ca992(0xd79)]['on'](EventType['postRender'],this['_updateContent'],this);}['_removedHook'](){this['_map']['off'](EventType['postRender'],this['_updateContent'],this);}[_0x35a251(0xbe1)](_0x796016,_0x33fd1f){const _0x235636={_0x4d9123:0x1f1,_0x5323ba:0xee1,_0x3fc951:0x4e7,_0x15a6a2:0xcbd,_0x244159:0x22f,_0x15f7ef:0xe1e,_0x5477c3:0xcb3},_0x208438=_0x35a251,_0x295153=Cesium__namespace['getTimestamp']();if(_0x295153=0x0;--_0x2564f5){if(DIS[_0x2564f5]/_0x40f95b<_0x1e1522){_0x54befa=DIS[_0x2564f5];break;}}if(_0x54befa){this['_currDistance']!==_0x54befa&&(this['_currDistance']=_0x54befa,this['fire'](EventType['change'],{'distance':_0x54befa}));this[_0x208438(0x5f4)][_0x208438(0xfc8)]['visibility']='visible',this['_labelEl'][_0x208438(0xf4a)]=_0x54befa>=0x3e8?_0x54befa/0x3e8+'\x20km':_0x54befa+'\x20m';const _0x39bbe7=_0x54befa/_0x40f95b|0x0;this['_scaleBarEl']['style'][_0x208438(0x967)]='width:\x20'+_0x39bbe7+_0x208438(_0x235636._0x5477c3)+(0x7d-_0x39bbe7)/0x2+'px;';}}}register$1('distanceLegend',DistanceLegend);const icon$2='\x0a\x0a\x20\x20\x20\x20\x0a\x0a';class MapSplit extends BaseControl{get['type'](){return'mapSplit';}get[_0x35a251(0xfbb)](){return this['_leftLayer'];}set['leftLayer'](_0x5dd6d6){const _0x2283cd={_0x442ea9:0xdbd},_0x4541ed=_0x35a251;this['_leftLayer']&&(this['_leftLayer']['forEach'](_0x317ef9=>{const _0x4b521c=_0x2767;_0x317ef9['_hasRemoveByMapSplit']&&_0x317ef9[_0x4b521c(0x1ee)]();}),this['_leftLayer']=null),_0x5dd6d6&&(!Array['isArray'](_0x5dd6d6)&&(_0x5dd6d6=[_0x5dd6d6]),this['_leftLayer']=[],_0x5dd6d6[_0x4541ed(_0x2283cd._0x442ea9)](_0xe95f00=>{const _0x51f1a3=_0x4541ed;_0xe95f00=this['setLayerSplitDirection'](_0xe95f00,Cesium__namespace['SplitDirection'][_0x51f1a3(0x1f0)]),this['_leftLayer']['push'](_0xe95f00);}));}get['rightLayer'](){return this['_rightLayer'];}set['rightLayer'](_0x43b7c3){const _0x33119f={_0x4559ce:0xdb4,_0x6a6c34:0xdb4,_0x5a7b83:0x719},_0x59de78=_0x35a251;this[_0x59de78(_0x33119f._0x4559ce)]&&(this['_rightLayer']['forEach'](_0x3a9203=>{_0x3a9203['_hasRemoveByMapSplit']&&_0x3a9203['remove']();}),this[_0x59de78(_0x33119f._0x6a6c34)]=null),_0x43b7c3&&(!Array[_0x59de78(_0x33119f._0x5a7b83)](_0x43b7c3)&&(_0x43b7c3=[_0x43b7c3]),this['_rightLayer']=[],_0x43b7c3['forEach'](_0x3db5dd=>{const _0x267319=_0x59de78;_0x3db5dd=this[_0x267319(0x27b)](_0x3db5dd,Cesium__namespace['SplitDirection']['RIGHT']),this['_rightLayer']['push'](_0x3db5dd);}));}[_0x35a251(0x700)](){const _0x2e1963={_0x236b7b:0x3c6,_0x4d0bb8:0x880},_0x5a0df4=_0x35a251;this['_container']=create$3('div','mars3d-slider');const _0x3832d8=parseDom(icon$2,!![],'slider-splitter');this['_container'][_0x5a0df4(0x87c)](_0x3832d8);const _0xbae098=new Cesium__namespace[(_0x5a0df4(0x548))](_0x3832d8),_0x14bef0=this;_0xbae098['setInputAction'](()=>{const _0x43c0a3=_0x5a0df4;_0x14bef0[_0x43c0a3(0x153)]=!![];},Cesium__namespace['ScreenSpaceEventType']['LEFT_DOWN']),_0xbae098['setInputAction'](()=>{_0x14bef0['_moveActive']=!![];},Cesium__namespace['ScreenSpaceEventType']['PINCH_START']),_0xbae098[_0x5a0df4(0x80e)](_0x19600f=>{_0x14bef0['_moveHandler'](_0x19600f);},Cesium__namespace['ScreenSpaceEventType']['MOUSE_MOVE']),_0xbae098['setInputAction'](_0x25e9e5=>{_0x14bef0['_moveHandler'](_0x25e9e5);},Cesium__namespace['ScreenSpaceEventType'][_0x5a0df4(_0x2e1963._0x236b7b)]),_0xbae098[_0x5a0df4(0x80e)](()=>{_0x14bef0['_moveActive']=![];},Cesium__namespace['ScreenSpaceEventType'][_0x5a0df4(0x351)]),_0xbae098['setInputAction'](()=>{_0x14bef0['_moveActive']=![];},Cesium__namespace['ScreenSpaceEventType'][_0x5a0df4(_0x2e1963._0x4d0bb8)]);}[_0x35a251(0x97b)](){const _0x460aaf=_0x35a251;this['_map'][_0x460aaf(0xc60)]['splitPosition']=0.5,this['_container']['style']['left']='50%',this['_moveHandler'](),this[_0x460aaf(0xe86)]['leftLayer']&&(this['leftLayer']=this['options']['leftLayer']),this['options'][_0x460aaf(0x38b)]&&(this['rightLayer']=this['options']['rightLayer']);}['_removedHook'](){const _0x64d0fb={_0x4b50ab:0x38b},_0x3ec221=_0x35a251;this['_map'][_0x3ec221(0xc60)][_0x3ec221(0x6c5)]=0x0,this['leftLayer']=null,this[_0x3ec221(_0x64d0fb._0x4b50ab)]=null;}['_moveHandler'](_0x2a7f5d){const _0x1ce115={_0x55f528:0x5f4,_0x520df2:0xd79},_0x42a02c=_0x35a251;if(!this[_0x42a02c(0x153)]||!this['enabled'])return;const _0x4d8efe=_0x2a7f5d?_0x2a7f5d['endPosition']['x']:0x0,_0x4c54ba=(this['_container'][_0x42a02c(0x89)]+_0x4d8efe)/this['_container']['parentElement']['offsetWidth'];if(_0x4c54ba<0x0||_0x4c54ba>0x1)return;this[_0x42a02c(_0x1ce115._0x55f528)]['style']['left']=0x64*_0x4c54ba+'%',this[_0x42a02c(_0x1ce115._0x520df2)]['scene']['splitPosition']=_0x4c54ba,this[_0x42a02c(0x264)](EventType['mouseMove'],{'splitPosition':_0x4c54ba});}[_0x35a251(0x27b)](_0x15dcd6,_0x116445){const _0x3c40f3={_0x2617eb:0xf02,_0x1f68fd:0x86c},_0x1db345={_0x2ab299:0xcb8,_0x293aaf:0xc29},_0x1f4825=_0x35a251;return!_0x15dcd6['isAdded']&&this['_map']&&(_0x15dcd6['type']&&!_0x15dcd6[_0x1f4825(0x85f)]&&(_0x15dcd6=create$2(_0x15dcd6)),this['_map']['addLayer'](_0x15dcd6),_0x15dcd6[_0x1f4825(_0x3c40f3._0x2617eb)]=!![]),_0x15dcd6['readyPromise'][_0x1f4825(_0x3c40f3._0x1f68fd)](_0x543d7b=>{const _0x1523ee=_0x1f4825;if(_0x543d7b['hasChildLayer'])for(let _0x5dd16e=0x0;_0x5dd16e<_0x543d7b['arrLayer']['length'];_0x5dd16e++){const _0x2e0c45=_0x543d7b[_0x1523ee(_0x1db345._0x2ab299)][_0x5dd16e]['layer'];_0x2e0c45&&(_0x2e0c45[_0x1523ee(_0x1db345._0x293aaf)]=_0x116445);}else{const _0x31bb94=_0x543d7b['layer'];_0x31bb94&&(_0x31bb94['splitDirection']=_0x116445);}}),_0x15dcd6;}}register$1('mapSplit',MapSplit);class SceneEvent{constructor(_0x56e951){const _0x546c4b={_0x9706a9:0xd79,_0x2194ff:0xc60},_0x10d4ad=_0x35a251;this[_0x10d4ad(_0x546c4b._0x9706a9)]=_0x56e951,this['_camera']=_0x56e951[_0x10d4ad(0x7d)],this['_scene']=_0x56e951[_0x10d4ad(_0x546c4b._0x2194ff)],this['_globe']=_0x56e951['scene'][_0x10d4ad(0x22f)],this['_clock']=_0x56e951['clock'];}['_getEventByType'](_0x450d54){const _0x32a726={_0x31649b:0xd33,_0x2e167b:0x1e8,_0x3c9a78:0x506,_0x1b1998:0xeff,_0x7f7235:0x506},_0x2ff89b=_0x35a251;switch(_0x450d54){case EventType['cameraMoveStart']:return this['_camera']['moveStart'];case EventType['cameraMoveEnd']:return this['_camera']['moveEnd'];case EventType['cameraChanged']:return this['_camera']['changed'];case EventType['preUpdate']:return this['_scene']['preUpdate'];case EventType['postUpdate']:return this['_scene'][_0x2ff89b(0x200)];case EventType['preRender']:return this['_scene']['preRender'];case EventType['postRender']:return this['_scene']['postRender'];case EventType['renderError']:return this['_scene']['renderError'];case EventType[_0x2ff89b(_0x32a726._0x31649b)]:return this['_scene']['morphStart'];case EventType[_0x2ff89b(0xd69)]:return this['_scene']['morphComplete'];case EventType['clockTick']:return this[_0x2ff89b(0xac9)]['onTick'];case EventType['clockStop']:return this[_0x2ff89b(0xac9)][_0x2ff89b(_0x32a726._0x2e167b)];case EventType['terrainChange']:return this[_0x2ff89b(_0x32a726._0x3c9a78)]['terrainProviderChanged'];case EventType[_0x2ff89b(_0x32a726._0x1b1998)]:return this[_0x2ff89b(_0x32a726._0x7f7235)][_0x2ff89b(0x158)];default:return null;}}['hasType'](_0x194d6e){const _0x214329=this['_getEventByType'](_0x194d6e);return Boolean(_0x214329);}['on'](_0x5113f3,_0x294209,_0x3702cc){const _0x1f5546={_0x4e20d2:0xb0e},_0x3027a8=_0x35a251;if(!_0x294209)return;const _0x13776e=this[_0x3027a8(_0x1f5546._0x4e20d2)](_0x5113f3);if(!_0x13776e)return;return _0x13776e['addEventListener'](_0x294209,_0x3702cc||this);}['off'](_0x1aeed1,_0x30da43,_0x24b0fd){const _0x3ddb53=this['_getEventByType'](_0x1aeed1);if(!_0x3ddb53)return;return _0x3ddb53['removeEventListener'](_0x30da43,_0x24b0fd||this);}['listens'](_0x5a6055){const _0x358384={_0x5d78a7:0xc59},_0x3df0a1=_0x35a251,_0x1839ad=this['_getEventByType'](_0x5a6055);if(!_0x1839ad||_0x1839ad['numberOfListeners']===0x0)return![];for(let _0x36c1bf=0x0;_0x36c1bf<_0x1839ad['_scopes']['length'];_0x36c1bf++){const _0x4e8ce3=_0x1839ad[_0x3df0a1(_0x358384._0x5d78a7)][_0x36c1bf];if(_0x4e8ce3===this[_0x3df0a1(0xd79)])return!![];}return![];}}const DEF_OPTIONS={'enabledMoveTarget':!![],'moveDelay':0x1e,'pickWidth':0x4,'pickHeight':0x4,'pickLimit':0x9};class MouseEvent{constructor(_0x43a099,_0x88f3c8={}){const _0x36b499={_0x1a9feb:0x8e0},_0x5cd79f=_0x35a251;_0x88f3c8={...DEF_OPTIONS,..._0x88f3c8},this['_map']=_0x43a099,this['_viewer']=_0x43a099['viewer'],this['options']=_0x88f3c8,this['moveDelay']=_0x88f3c8['moveDelay'],this[_0x5cd79f(0xd30)]=_0x88f3c8[_0x5cd79f(_0x36b499._0x1a9feb)],this[_0x5cd79f(0x48a)]=undefined,this['_setInputAction']();}get[_0x35a251(0x8e0)](){return this['_enabledMoveTarget'];}set[_0x35a251(0x8e0)](_0x542669){this['_enabledMoveTarget']=_0x542669,this['clearMoveTargetDelay']();}get['noPickEntity'](){return this['_noPickEntity'];}set['noPickEntity'](_0x16abc1){const _0x27d4d2={_0x2d7100:0x840},_0x55b810=_0x35a251;this[_0x55b810(_0x27d4d2._0x2d7100)]=_0x16abc1;}['setOptions'](_0xde1658){const _0x18f37d={_0x589d3c:0xe86,_0x236c99:0xd30},_0x127fcf=_0x35a251;if(!_0xde1658||Object['keys'](_0xde1658)['length']===0x0)return this;return this[_0x127fcf(_0x18f37d._0x589d3c)]=merge(this[_0x127fcf(0xe86)],_0xde1658),this[_0x127fcf(0x385)]=this['options']['moveDelay'],this[_0x127fcf(_0x18f37d._0x236c99)]=this['options']['enabledMoveTarget'],this;}['clearMoveTargetDelay'](){const _0xc42828=_0x35a251;this[_0xc42828(0x93f)]&&(clearTimeout(this['_moveDelayTik']),this['_moveDelayTik']=null);}['_setInputAction'](){const _0x15e79b={_0x2f6f61:0x80e,_0x3f9107:0x30f,_0xf68e6b:0xc30,_0x2d6ad2:0x3fe,_0x17cf61:0xb93,_0x5c2194:0x80e,_0x3b2f8e:0xad1,_0x493afa:0x3fe,_0x59a756:0xe7b,_0x4dacb2:0xc45,_0x28dcf5:0x3fe,_0x5bc8d7:0xd79,_0x16695e:0x369},_0x4f54b9={_0x3e628b:0xc17},_0x1cb9af={_0x184b37:0x2a4},_0x2c145b={_0x4874c6:0x34d},_0x1bd29c={_0x1ac715:0xd79},_0x2f1a84={_0x26ee92:0x385,_0x1b6822:0x93f},_0x46904f={_0x501dd3:0xb34},_0x4894cd={_0x11e5f9:0x71f,_0x11a23c:0x774},_0x216eb3={_0x44dae3:0xc44},_0x59d08a={_0x76a030:0xdfd},_0xd5250a=_0x35a251;this['handler']=new Cesium__namespace['ScreenSpaceEventHandler'](this['_viewer']['canvas']),this['handler'][_0xd5250a(_0x15e79b._0x2f6f61)](_0x32a583=>{const _0xa1ca48=_0xd5250a;this[_0xa1ca48(_0x59d08a._0x76a030)](_0x32a583);},Cesium__namespace['ScreenSpaceEventType'][_0xd5250a(_0x15e79b._0x3f9107)]),this[_0xd5250a(0x3fe)]['setInputAction'](_0x1ac272=>{const _0x35bf6d=_0xd5250a;this[_0x35bf6d(_0x216eb3._0x44dae3)](_0x1ac272,EventType['dblClick']);},Cesium__namespace[_0xd5250a(0xc30)][_0xd5250a(0xb51)]),this['handler']['setInputAction'](_0x4596d0=>{const _0x1e5ce=_0xd5250a;this[_0x1e5ce(0xc44)](_0x4596d0,[EventType[_0x1e5ce(_0x4894cd._0x11e5f9)],EventType[_0x1e5ce(_0x4894cd._0x11a23c)]]);},Cesium__namespace[_0xd5250a(_0x15e79b._0xf68e6b)]['LEFT_DOWN']),this['handler']['setInputAction'](_0x1978ed=>{this['_globeMouseHandler'](_0x1978ed,[EventType['leftUp'],EventType['mouseUp']]);},Cesium__namespace['ScreenSpaceEventType'][_0xd5250a(0x351)]),this[_0xd5250a(_0x15e79b._0x2d6ad2)]['setInputAction'](_0x39b151=>{const _0x24dfd5=_0xd5250a,_0x5e7f44=_0x39b151['endPosition'],_0x22c5a8=getCurrentMousePosition(this['_viewer']['scene'],_0x5e7f44,this['noPickEntity']);_0x39b151['cartesian']=_0x22c5a8,this['enabledMoveTarget']&&(this['clearMoveTargetDelay'](),this[_0x24dfd5(_0x2f1a84._0x26ee92)]>0x0?this[_0x24dfd5(_0x2f1a84._0x1b6822)]=setTimeout(_0x17dac5=>{const _0xeb583=_0x24dfd5;this['_moveDelayTik']=null,this[_0xeb583(_0x46904f._0x501dd3)](_0x39b151);},this['moveDelay']):this['_mouseMoveHandler'](_0x39b151)),this['_map']['fire'](EventType['mouseMove'],{..._0x39b151,'cartesian':_0x22c5a8,'windowPosition':_0x5e7f44});},Cesium__namespace['ScreenSpaceEventType']['MOUSE_MOVE']),this['handler'][_0xd5250a(_0x15e79b._0x2f6f61)](_0x5da267=>{const _0x580e4c=_0xd5250a;this[_0x580e4c(_0x1bd29c._0x1ac715)][_0x580e4c(0x264)](EventType['wheel'],_0x5da267);},Cesium__namespace[_0xd5250a(0xc30)][_0xd5250a(_0x15e79b._0x17cf61)]),this['handler'][_0xd5250a(_0x15e79b._0x5c2194)](_0x6a4c2d=>{const _0x278585=_0xd5250a;this[_0x278585(0xc44)](_0x6a4c2d,EventType['rightClick']);},Cesium__namespace['ScreenSpaceEventType'][_0xd5250a(_0x15e79b._0x3b2f8e)]),this[_0xd5250a(_0x15e79b._0x493afa)]['setInputAction'](_0x482342=>{this['_globeMouseHandler'](_0x482342,[EventType['rightDown'],EventType['mouseDown']]);},Cesium__namespace[_0xd5250a(_0x15e79b._0xf68e6b)]['RIGHT_DOWN']),this['handler']['setInputAction'](_0x19e378=>{const _0x5528b7=_0xd5250a;this['_globeMouseHandler'](_0x19e378,[EventType[_0x5528b7(0x15e)],EventType['mouseUp']]);},Cesium__namespace[_0xd5250a(0xc30)][_0xd5250a(0x2f1)]),this['handler']['setInputAction'](_0x14f6be=>{this['_globeMouseHandler'](_0x14f6be,EventType['middleClick']);},Cesium__namespace['ScreenSpaceEventType'][_0xd5250a(_0x15e79b._0x59a756)]),this[_0xd5250a(0x3fe)]['setInputAction'](_0x7146ff=>{this['_globeMouseHandler'](_0x7146ff,[EventType['middleDown'],EventType['mouseDown']]);},Cesium__namespace['ScreenSpaceEventType'][_0xd5250a(_0x15e79b._0x4dacb2)]),this['handler']['setInputAction'](_0xdbee0f=>{const _0x2631d0=_0xd5250a;this['_globeMouseHandler'](_0xdbee0f,[EventType['middleUp'],EventType[_0x2631d0(_0x2c145b._0x4874c6)]]);},Cesium__namespace['ScreenSpaceEventType']['MIDDLE_UP']),this[_0xd5250a(_0x15e79b._0x493afa)][_0xd5250a(0x80e)](_0x6a85f1=>{const _0x359b26=_0xd5250a;this['_globeMouseHandler'](_0x6a85f1,EventType[_0x359b26(_0x1cb9af._0x184b37)]);},Cesium__namespace['ScreenSpaceEventType']['PINCH_START']),this[_0xd5250a(_0x15e79b._0x28dcf5)][_0xd5250a(0x80e)](_0x1ad4a1=>{const _0x4f155f=_0xd5250a;this['_globeMouseHandler'](_0x1ad4a1,EventType[_0x4f155f(_0x4f54b9._0x3e628b)]);},Cesium__namespace[_0xd5250a(_0x15e79b._0xf68e6b)]['PINCH_END']),this['handler']['setInputAction'](_0x3d2e76=>{this['_map']['fire'](EventType['pinchMove'],_0x3d2e76);},Cesium__namespace['ScreenSpaceEventType']['PINCH_MOVE']),this['_map'][_0xd5250a(0xee1)]['addEventListener']('keydown',this['_onKeyDown']['bind'](this)),this['_map']['canvas']['addEventListener']('keyup',this['_onKeyUp'][_0xd5250a(0x154)](this)),this[_0xd5250a(_0x15e79b._0x5bc8d7)]['canvas']['addEventListener'](_0xd5250a(0xece),this['_onMouseOver']['bind'](this)),this[_0xd5250a(0xd79)]['canvas'][_0xd5250a(0x77e)](_0xd5250a(_0x15e79b._0x16695e),this[_0xd5250a(0x201)]['bind'](this));}['_onMouseOver'](_0x40ce80){this['_map']['fire'](EventType['mouseOver'],{'mouseEvent':_0x40ce80});}['_onMouseOut'](_0x49af53){this['_map']['fire'](EventType['mouseOut'],{'mouseEvent':_0x49af53});}['_onKeyDown'](_0x1ac69b){const _0x47b2a4={_0x2dde35:0xa03},_0x373150=_0x35a251;this['_map']['fire'](EventType['keydown'],{'mouseEvent':_0x1ac69b,'ctrlKey':_0x1ac69b['ctrlKey'],'altKey':_0x1ac69b['altKey'],'metaKey':_0x1ac69b['metaKey'],'shiftKey':_0x1ac69b['shiftKey'],'code':_0x1ac69b[_0x373150(0x162)],'key':_0x1ac69b[_0x373150(_0x47b2a4._0x2dde35)],'keyCode':_0x1ac69b[_0x373150(0xa41)]});}[_0x35a251(0x714)](_0x100b03){const _0x4fae8f={_0x32a762:0xa41},_0x5b82cb=_0x35a251;this['_map']['fire'](EventType['keyup'],{'mouseEvent':_0x100b03,'ctrlKey':_0x100b03[_0x5b82cb(0x482)],'altKey':_0x100b03['altKey'],'metaKey':_0x100b03['metaKey'],'shiftKey':_0x100b03['shiftKey'],'code':_0x100b03['code'],'key':_0x100b03['key'],'keyCode':_0x100b03[_0x5b82cb(_0x4fae8f._0x32a762)]});}['getPickTarget'](_0x401528,_0xcc1ec6){const _0x2ccd9e={_0x5c4d20:0x219,_0x232943:0x87,_0xb7046:0xebf,_0x188ab1:0xc60,_0x48d754:0x5c4,_0x313b10:0xe86,_0x1e4d25:0x6de,_0x75908a:0x7f2,_0x1a811b:0xebf},_0x5a95fa=_0x35a251;if(_0xcc1ec6!==null&&_0xcc1ec6!==void 0x0&&_0xcc1ec6['graphic'])return _0xcc1ec6;let _0x909a15;try{_0x909a15=this['_viewer']['scene']['pick'](_0x401528,this['options']['pickWidth'],this['options']['pickHeight']);}catch(_0x6dc1f2){}if(this[_0x5a95fa(0x219)]&&_0x909a15&&this[_0x5a95fa(_0x2ccd9e._0x5c4d20)]['pickedObject']===_0x909a15){let _0x12f75d=_0xcc1ec6===null||_0xcc1ec6===void 0x0?void 0x0:_0xcc1ec6[_0x5a95fa(0x4bb)];if(!_0x12f75d){var _0x10ddb6,_0x449fe5;if(((_0x10ddb6=this['_lastPickedInfo'])===null||_0x10ddb6===void 0x0?void 0x0:(_0x449fe5=_0x10ddb6[_0x5a95fa(_0x2ccd9e._0x232943)])===null||_0x449fe5===void 0x0?void 0x0:_0x449fe5['type'])==='3dtiles'){const _0x32017c=this['_viewer']['scene'][_0x5a95fa(0x8de)];this['_viewer']['scene']['onlyPickModelPosition']=!![],_0x12f75d=getCurrentMousePosition(this[_0x5a95fa(0xebf)][_0x5a95fa(0xc60)],_0x401528,this[_0x5a95fa(0x5bd)]),this[_0x5a95fa(_0x2ccd9e._0xb7046)]['scene'][_0x5a95fa(0x8de)]=_0x32017c;}else _0x12f75d=getCurrentMousePosition(this['_viewer'][_0x5a95fa(_0x2ccd9e._0x188ab1)],_0x401528,this['noPickEntity']);}return{..._0xcc1ec6,...this['_lastPickedInfo'],'cartesian':_0x12f75d,'windowPosition':_0x401528};}let _0xed6225=this['_getTargetInfo'](_0x909a15,_0x401528);if(_0x909a15&&this['_allowDrillPick'](_0xed6225)){const _0x225889=this['_viewer']['scene']['drillPick'](_0x401528,this['options'][_0x5a95fa(_0x2ccd9e._0x48d754)],this[_0x5a95fa(_0x2ccd9e._0x313b10)][_0x5a95fa(0xca1)],this['options']['pickHeight']),_0x3fd982=[];if(_0x225889&&_0x225889['length']>0x0)for(let _0x4550e0=0x0,_0x4b3a81=_0x225889['length'];_0x4550e0<_0x4b3a81;_0x4550e0++){const _0x3b678b=_0x225889[_0x4550e0];if(_0x909a15===_0x3b678b){var _0x3050fa;_0x3fd982[_0x5a95fa(_0x2ccd9e._0x1e4d25)]((_0x3050fa=_0xed6225)===null||_0x3050fa===void 0x0?void 0x0:_0x3050fa['graphic']);continue;}const _0x539689=this[_0x5a95fa(0xe36)](_0x3b678b,_0x401528);_0x3fd982['push'](_0x539689===null||_0x539689===void 0x0?void 0x0:_0x539689['graphic']);if(this[_0x5a95fa(_0x2ccd9e._0x75908a)](_0x539689)&&_0x4550e0!==_0x4b3a81-0x1)continue;else{_0xed6225=_0x539689,_0xed6225[_0x5a95fa(0x881)]=_0x225889,_0xed6225['graphics']=_0x3fd982;break;}}}else this['_lastPickedInfo']=_0xed6225;let _0x4f9b2b=_0xcc1ec6===null||_0xcc1ec6===void 0x0?void 0x0:_0xcc1ec6[_0x5a95fa(0x4bb)];return!_0x4f9b2b&&(_0x4f9b2b=getCurrentMousePosition(this[_0x5a95fa(_0x2ccd9e._0x1a811b)]['scene'],_0x401528,this['noPickEntity'])),{..._0xcc1ec6,..._0xed6225,'cartesian':_0x4f9b2b,'windowPosition':_0x401528};}['_allowDrillPick'](_0x5f17c9){const _0x302676=_0x35a251;var _0x58c87c,_0x5f2811;let _0x5819b3=(_0x58c87c=_0x5f17c9[_0x302676(0xf8c)])===null||_0x58c87c===void 0x0?void 0x0:_0x58c87c['allowDrillPick'];if(_0x5819b3)return isFunction(_0x5819b3)?_0x5819b3(_0x5f17c9):!![];_0x5819b3=(_0x5f2811=_0x5f17c9[_0x302676(0x87)])===null||_0x5f2811===void 0x0?void 0x0:_0x5f2811['allowDrillPick'];if(_0x5819b3)return isFunction(_0x5819b3)?_0x5819b3(_0x5f17c9):!![];return![];}['_getTargetInfo'](_0x11e4ee,_0xfe153a){const _0x3c12d2={_0x4381f5:0x13a,_0xe1894b:0x6df,_0xc921d5:0x8dd,_0x752234:0xd79,_0x97bd51:0x57e,_0x2ca1e5:0xebf,_0x56c1c8:0xa80,_0xa3fae6:0x553,_0x23e066:0x6ed,_0x38711e:0x6ed,_0x179016:0x6b3},_0x24d5a8={_0x4ba008:0xf8c,_0x3e5245:0x78c,_0xdd480d:0x25e},_0x5c8de0={_0x4dc23b:0x41d},_0x489381=_0x35a251;var _0x3180e3,_0x2c500a;if(!Cesium__namespace['defined'](_0x11e4ee))return{};let _0x37e57b,_0x36805b,_0x46d9aa,_0x1d7184;if(Cesium__namespace['defined'](_0x11e4ee['id'])&&_0x11e4ee['id']instanceof Cesium__namespace[_0x489381(_0x3c12d2._0x4381f5)])_0x37e57b=_0x11e4ee['id'],_0x1d7184=_0x37e57b['id'];else{if(_0x11e4ee instanceof Cesium__namespace['Cesium3DTileFeature']){_0x37e57b=_0x11e4ee,_0x1d7184='3dtile_feature_'+_0x11e4ee['_batchId'];const _0x3752c4=_0x11e4ee['tileset'];_0x36805b=this['_map'][_0x489381(0x57e)](_0x3752c4['_mars3d_layerId']),_0x46d9aa={'attr':get3DTileFeatureAttr(_0x11e4ee),'feature':_0x11e4ee};}else{if(_0x11e4ee['content']&&_0x11e4ee['content']instanceof(Cesium__namespace[_0x489381(_0x3c12d2._0xe1894b)]||Cesium__namespace['PointCloud'])){var _0x92b069,_0x37e533;_0x37e57b=_0x11e4ee['content'],_0x1d7184='3dtile_pnts_'+((_0x92b069=_0x11e4ee[_0x489381(_0x3c12d2._0xc921d5)])===null||_0x92b069===void 0x0?void 0x0:(_0x37e533=_0x92b069['_pickId'])===null||_0x37e533===void 0x0?void 0x0:_0x37e533['key'])||0x0;const _0x16ce3e=_0x11e4ee['primitive'];_0x36805b=this[_0x489381(_0x3c12d2._0x752234)][_0x489381(_0x3c12d2._0x97bd51)](_0x16ce3e['_mars3d_layerId']);if(_0x11e4ee['batchTable']);}else{if((_0x3180e3=_0x11e4ee['content'])!==null&&_0x3180e3!==void 0x0&&(_0x2c500a=_0x3180e3['tile'])!==null&&_0x2c500a!==void 0x0&&_0x2c500a['i3sNode']){const _0x3b9e13=_0x11e4ee['content']['tile'][_0x489381(0x205)],_0x57ea14=this[_0x489381(_0x3c12d2._0x2ca1e5)]['scene']['pickPosition'](_0xfe153a);_0x57ea14&&(_0x46d9aa={'attr':_0x3b9e13[_0x489381(_0x3c12d2._0x56c1c8)]()[_0x489381(0x86c)](function(){const _0x44d364=_0x489381;return _0x3b9e13[_0x44d364(_0x5c8de0._0x4dc23b)](_0x57ea14);}),'feature':_0x3b9e13}),_0x37e57b=_0x3b9e13,_0x1d7184='i3s_'+_0x3b9e13['_nodeIndex']||0x0,_0x36805b=this['_map']['getLayerById'](_0x3b9e13[_0x489381(_0x3c12d2._0xa3fae6)][_0x489381(_0x3c12d2._0x23e066)]);}else Cesium__namespace[_0x489381(0xaa2)](_0x11e4ee['primitive'])?(_0x37e57b=_0x11e4ee['primitive'],_0x1d7184=_0x11e4ee['id']):logInfo('getPickTarget:拾取到了对象,请确认是否要做处理',_0x11e4ee);}}}if(_0x37e57b){_0x36805b=_0x36805b||this[_0x489381(_0x3c12d2._0x752234)]['getLayerById'](_0x37e57b[_0x489381(_0x3c12d2._0x38711e)]);if(_0x36805b&&_0x36805b['getGraphicById']){_0x46d9aa=_0x46d9aa||_0x36805b['getGraphicById'](_0x37e57b[_0x489381(0x308)]);if(_0x46d9aa){_0x1d7184=_0x46d9aa['id'];if(_0x46d9aa['getPickedObject']){const _0x56cb8f=_0x11e4ee['id']||_0x11e4ee['instanceId'];if(_0x56cb8f){var _0x1fb082;_0x1d7184=_0x56cb8f,_0x11e4ee['data']=_0x46d9aa['getPickedObject'](_0x56cb8f),_0x46d9aa[_0x489381(_0x3c12d2._0x179016)]=(_0x1fb082=_0x11e4ee['data'])===null||_0x1fb082===void 0x0?void 0x0:_0x1fb082['attr'];}}}else{var _0x23f921;(_0x23f921=_0x37e57b)!==null&&_0x23f921!==void 0x0&&_0x23f921[_0x489381(0xc37)]&&(_0x46d9aa=_0x37e57b[_0x489381(0xc37)]);}}}return{'id':_0x1d7184,'pickedObject':_0x11e4ee,'sourceTarget':_0x37e57b,'czmObject':_0x37e57b,'layer':_0x36805b,'graphic':_0x46d9aa,'hasClickEvent':function(){const _0x410504=_0x489381;if(this[_0x410504(_0x24d5a8._0x4ba008)]){if(isFunction(this['graphic'][_0x410504(0x78c)])&&this['graphic'][_0x410504(_0x24d5a8._0x3e5245)](EventType['click']))return!![];if(isFunction(this['graphic'][_0x410504(0x25e)])&&_0x46d9aa[_0x410504(_0x24d5a8._0xdd480d)]())return!![];}if(this['layer']){var _0x187f39;if(isFunction(this['layer']['listens'])&&this[_0x410504(0x87)]['listens'](EventType['click']))return!![];if(isFunction(this['layer']['hasPopup'])&&(_0x187f39=_0x36805b)!==null&&_0x187f39!==void 0x0&&_0x187f39['hasPopup']())return!![];}return![];}};}['getPicked'](_0x39a56f){const _0xfff556={_0x581ed5:0x6f2,_0x2c5d04:0x45a},_0x4f923a=_0x35a251;if(!_0x39a56f||!_0x39a56f[_0x4f923a(0x396)])return undefined;const _0xe62872=_0x39a56f['pickedObject'],_0x201dc1=_0x39a56f['czmObject'];if(_0x201dc1 instanceof Cesium__namespace['Entity']){const _0x471acf=_0xe62872['primitive']['_pickIds'];if((_0x471acf===null||_0x471acf===void 0x0?void 0x0:_0x471acf['length'])>0x0){const _0x7c8ae5=_0x471acf[_0x4f923a(0x9bd)](_0x24deea=>{const _0x43ca21=_0x4f923a;return _0x24deea[_0x43ca21(0x7ef)]===_0xe62872;});return _0x7c8ae5;}}else{if(_0x201dc1 instanceof Cesium__namespace['Cesium3DTileFeature']){if(_0xe62872['pickId'])return _0xe62872['pickId'];}else{if(_0xe62872['content']&&_0xe62872['content']instanceof(Cesium__namespace['PointCloud3DTileContent']||Cesium__namespace['PointCloud'])){var _0x3f2ac6;return(_0x3f2ac6=_0xe62872['content'])===null||_0x3f2ac6===void 0x0?void 0x0:_0x3f2ac6[_0x4f923a(0x22a)];}else{var _0x5a2d3d,_0x456709;if(_0xe62872[_0x4f923a(_0xfff556._0x581ed5)]['pickId'])return _0xe62872['primitive'][_0x4f923a(_0xfff556._0x2c5d04)];if(_0xe62872['primitive']['_pickIds'])return _0xe62872['primitive']['_pickIds'];if((_0x5a2d3d=_0xe62872[_0x4f923a(0x8dd)])!==null&&_0x5a2d3d!==void 0x0&&(_0x456709=_0x5a2d3d[_0x4f923a(0xea5)])!==null&&_0x456709!==void 0x0&&_0x456709['_pickIds']){var _0xa50be0,_0x9f07dc;return(_0xa50be0=_0xe62872[_0x4f923a(0x8dd)])===null||_0xa50be0===void 0x0?void 0x0:(_0x9f07dc=_0xa50be0['_model'])===null||_0x9f07dc===void 0x0?void 0x0:_0x9f07dc['_pickIds'];}}}}return undefined;}[_0x35a251(0x9dc)](_0x3970b7){const _0x306a6e=_0x35a251,_0x3a29a4=LngLatPoint[_0x306a6e(0xa43)](_0x3970b7),_0x1ce5fd=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](this['_viewer']['scene'],_0x3a29a4);return this['_pickImageryLayerFeatures'](_0x1ce5fd,{'cartesian':_0x3a29a4});}[_0x35a251(0xbeb)](_0x27741f,_0x3ed581){const _0x183dc8={_0x3c5d0e:0x9dc},_0x406c89={_0x24065a:0xc5a},_0x19b45a=_0x35a251,_0x121098=this['_viewer']['scene'],_0x578c33=_0x121098['camera']['getPickRay'](_0x27741f),_0x371414=_0x121098['imageryLayers'][_0x19b45a(_0x183dc8._0x3c5d0e)](_0x578c33,_0x121098);return _0x371414&&_0x371414[_0x19b45a(0x86c)]?_0x371414['then'](_0x55e743=>{const _0x51ab71=_0x19b45a;return this[_0x51ab71(_0x406c89._0x24065a)](_0x55e743,_0x27741f,_0x3ed581===null||_0x3ed581===void 0x0?void 0x0:_0x3ed581['cartesian']);}):Promise['resolve']();}['_clickTileGraphic'](_0x1a3011,_0x2e5adf,_0x823697){const _0x3dfd61={_0x47c37c:0xde9,_0x4a2780:0x6ed,_0x26eba3:0xe86,_0x4fee2a:0xce2,_0x5354bb:0xc1e,_0x41abc1:0xe1e,_0x24f28d:0xf8c,_0x26bb32:0xe1e,_0x34a4ca:0x58f,_0x3d9920:0xfb4},_0x440261=_0x35a251;var _0x4bcf65,_0x57bea7,_0xf3a124;if(!Cesium__namespace[_0x440261(0xaa2)](_0x1a3011)||_0x1a3011['length']===0x0)return;let _0x1785bd=_0x1a3011[0x0];const _0x172afa=_0x1785bd[_0x440261(_0x3dfd61._0x47c37c)],_0x4b400b=this['_map']['getLayerById'](_0x172afa[_0x440261(_0x3dfd61._0x4a2780)]);if(_0x4b400b&&(_0x4bcf65=_0x4b400b[_0x440261(_0x3dfd61._0x26eba3)])!==null&&_0x4bcf65!==void 0x0&&_0x4bcf65['featureIndex']){var _0x13f37d;const _0x397b7b=_0x4b400b['options']['featureIndex'];if(((_0x13f37d=_0x4b400b['options'])===null||_0x13f37d===void 0x0?void 0x0:_0x13f37d[_0x440261(0x11c)])==='end')_0x1785bd=_0x1a3011[_0x1a3011['length']-0x1];else{if(isNumber(_0x397b7b))_0x1785bd=_0x1a3011[_0x397b7b]||_0x1785bd;else isFunction(_0x397b7b)&&(_0x1785bd=_0x397b7b(_0x1a3011)||_0x1785bd);}}const _0x432fd9={'sourceTarget':_0x172afa,'layer':_0x4b400b,'features':_0x1a3011,'attr':_0x1785bd['properties']||((_0x57bea7=_0x1785bd[_0x440261(_0x3dfd61._0x4fee2a)])===null||_0x57bea7===void 0x0?void 0x0:_0x57bea7['properties']),'cartesian':_0x823697,'windowPosition':_0x2e5adf};if(_0x1785bd['data']&&_0x4b400b&&((_0xf3a124=_0x4b400b[_0x440261(0xe86)])!==null&&_0xf3a124!==void 0x0&&_0xf3a124['highlight']||_0x4b400b['listens'](EventType['click']))){if(_0x4b400b['options'][_0x440261(_0x3dfd61._0x5354bb)]){const _0x51b980=_0x4b400b[_0x440261(_0x3dfd61._0x26eba3)][_0x440261(0xc1e)](_0x1785bd,_0x432fd9);if(_0x51b980){var _0x3744a3;Array[_0x440261(0x719)](_0x51b980)?(_0x432fd9['graphic']=_0x51b980[_0x440261(_0x3dfd61._0x41abc1)]>0x0?_0x51b980[0x0]:null,_0x432fd9['graphics']=_0x51b980):(_0x432fd9['graphic']=_0x51b980,_0x432fd9['graphics']=[_0x51b980]),(_0x3744a3=_0x432fd9[_0x440261(0xf8c)])!==null&&_0x3744a3!==void 0x0&&_0x3744a3['attr']&&(_0x432fd9['attr']=_0x432fd9[_0x440261(_0x3dfd61._0x24f28d)]['attr']);}}else{const _0x20a968=_0x4b400b['options']['hasToGraphic']??0x1388;let _0x5a8b82=!![];if(isBoolean(_0x20a968))_0x5a8b82=_0x20a968;else{if(isNumber(_0x20a968)){var _0x5d70c2;const _0x5f456e=JSON['stringify'](((_0x5d70c2=_0x1785bd['data'])===null||_0x5d70c2===void 0x0?void 0x0:_0x5d70c2[_0x440261(0x58f)])||{})['length'];_0x5a8b82=_0x5f456e<_0x20a968;}else isFunction(_0x20a968)&&(_0x5a8b82=_0x20a968(_0x1785bd));}if(_0x5a8b82){var _0x53f6f9;const _0x4d89aa=_0x4b400b===null||_0x4b400b===void 0x0?void 0x0:(_0x53f6f9=_0x4b400b[_0x440261(0xe86)])===null||_0x53f6f9===void 0x0?void 0x0:_0x53f6f9['highlight'],_0x3467dc=geoJsonToGraphics(_0x1785bd['data'],{'type':_0x4d89aa===null||_0x4d89aa===void 0x0?void 0x0:_0x4d89aa['type'],'crs':_0x1785bd['crs']||(_0x4b400b===null||_0x4b400b===void 0x0?void 0x0:_0x4b400b['crs']),'style':_0x4d89aa});_0x432fd9[_0x440261(0xf8c)]=_0x3467dc[_0x440261(_0x3dfd61._0x26bb32)]>0x0?_0x3467dc[0x0]:null,_0x432fd9[_0x440261(0xe45)]=_0x3467dc;}else{var _0x35ffca;logInfo('_clickTileGraphic:\x20当前数据太大,避免卡顿未进行解析,如需展示矢量对象,请在图层配置加\x20hasToGraphic:true\x20参数\x20',_0x4b400b===null||_0x4b400b===void 0x0?void 0x0:_0x4b400b['options'],(_0x35ffca=_0x1785bd['data'])===null||_0x35ffca===void 0x0?void 0x0:_0x35ffca[_0x440261(_0x3dfd61._0x34a4ca)]);}}}return _0x4b400b&&_0x4b400b['fire'](EventType[_0x440261(_0x3dfd61._0x3d9920)],_0x432fd9,![]),this['_map']['fire'](EventType['clickTileGraphic'],_0x432fd9),_0x432fd9;}['_clickHandler'](_0x38304c){const _0x44caa1={_0x209fdf:0xb61,_0x538b03:0xd79,_0x4d710e:0xfb4},_0x4a7015=_0x35a251;if(!_0x38304c||!_0x38304c[_0x4a7015(_0x44caa1._0x209fdf)])return![];const _0x46149e=_0x38304c['position'],_0x1c9a8e=this['getPickTarget'](_0x46149e,_0x38304c);this['_map'][_0x4a7015(0x3ca)](_0x1c9a8e);if(_0x1c9a8e['sourceTarget']){var _0x42748f;this['fireTargetEvent'](EventType['click'],_0x1c9a8e),this[_0x4a7015(_0x44caa1._0x538b03)]['fire'](EventType['clickGraphic'],_0x1c9a8e),(_0x42748f=_0x1c9a8e['layer'])!==null&&_0x42748f!==void 0x0&&_0x42748f['allowDrillPick']&&this['_pickImageryLayerFeatures'](_0x46149e,_0x1c9a8e);}else this['_map']['fire'](EventType[_0x4a7015(_0x44caa1._0x4d710e)],_0x1c9a8e),this['_map']['fire'](EventType['clickMap'],_0x1c9a8e),this[_0x4a7015(0xbeb)](_0x46149e,_0x1c9a8e);}[_0x35a251(0xb34)](_0x81934e){const _0xfc9f2b={_0x37fb1f:0x503,_0x255f72:0x264},_0x589e26=_0x35a251;if(!_0x81934e||!_0x81934e['endPosition'])return![];const _0xb07d7f=_0x81934e['endPosition'],_0x3784f2=this[_0x589e26(0xc57)](_0xb07d7f,_0x81934e),_0x20df03=_0x3784f2['sourceTarget'];_0x20df03&&!_0x20df03['noMouseMove']?this[_0x589e26(_0xfc9f2b._0x37fb1f)](_0x3784f2):this['activateMouseOut'](),this[_0x589e26(0xd79)][_0x589e26(_0xfc9f2b._0x255f72)](EventType['mouseMoveTarget'],{'czmObject':_0x20df03,..._0x81934e,..._0x3784f2});}['activateMouseOver'](_0x1cc449){const _0x2804be={_0x25ab0d:0xee8,_0x31b56a:0xb29,_0x22a544:0xd38,_0x4d1e94:0x7f0},_0x572aab=_0x35a251;if(this[_0x572aab(0x1ad)]&&_0x1cc449['id']&&_0x1cc449['id']===this['_lastMouseOverItem']['id'])return;this['activateMouseOut']();if(_0x1cc449[_0x572aab(0xee8)]&&_0x1cc449[_0x572aab(_0x2804be._0x25ab0d)]()){var _0x594e7b,_0x1357a9;let _0x8371b9=_0x572aab(_0x2804be._0x31b56a);(_0x594e7b=_0x1cc449['graphic'])!==null&&_0x594e7b!==void 0x0&&(_0x1357a9=_0x594e7b['style'])!==null&&_0x1357a9!==void 0x0&&_0x1357a9[_0x572aab(_0x2804be._0x22a544)]&&(_0x8371b9=_0x1cc449[_0x572aab(0xf8c)]['style']['cursorCSS']),this['_map']['container']['style']['cursor']=_0x8371b9;}this[_0x572aab(_0x2804be._0x4d1e94)](EventType['mouseOver'],_0x1cc449),this['_lastMouseOverItem']=_0x1cc449;}['activateMouseOut'](){const _0x385d57={_0x471f10:0xd79},_0xd95772=_0x35a251;if(this['_lastMouseOverItem']==null)return;this[_0xd95772(_0x385d57._0x471f10)]['_setEditCursor'](![]),this[_0xd95772(0x7f0)](EventType['mouseOut'],this['_lastMouseOverItem']),this['_lastMouseOverItem']=null;}['_globeMouseHandler'](_0x578f5a,_0x201e4e){const _0x5cd45a={_0x2f2edb:0x1b2},_0x40eedb=_0x35a251;if(!_0x578f5a||!_0x578f5a[_0x40eedb(0xb61)])return![];const _0x222f06=_0x578f5a['position'],_0x460c34=this['getPickTarget'](_0x222f06,_0x578f5a);Array['isArray'](_0x201e4e)?_0x201e4e['forEach'](_0xe0411b=>{const _0x2e35e6=_0x40eedb;_0x460c34[_0x2e35e6(_0x5cd45a._0x2f2edb)]?this['fireTargetEvent'](_0xe0411b,_0x460c34):this['_map']['fire'](_0xe0411b,_0x460c34);}):_0x460c34['sourceTarget']?this[_0x40eedb(0x7f0)](_0x201e4e,_0x460c34):this['_map']['fire'](_0x201e4e,_0x460c34);}[_0x35a251(0x7f0)](_0x3bd84c,_0xf86963){const _0x4a7dd8={_0x69dd25:0x264},_0x2d87f5=_0x35a251;var _0x4c81f9,_0x4b5f7b,_0x5c2e63;const _0x272d28=_0xf86963['sourceTarget'][_0x3bd84c];_0x272d28&&typeof _0x272d28==='function'&&_0x272d28(_0xf86963);(_0x4c81f9=_0xf86963['czmObject'][_0x2d87f5(0x6d6)])===null||_0x4c81f9===void 0x0?void 0x0:_0x4c81f9['fire'](_0x3bd84c,_0xf86963);if((_0x4b5f7b=_0xf86963['graphic'])!==null&&_0x4b5f7b!==void 0x0&&_0x4b5f7b['fire'])_0xf86963['graphic']['fire'](_0x3bd84c,_0xf86963,!![]);else(_0x5c2e63=_0xf86963['layer'])!==null&&_0x5c2e63!==void 0x0&&_0x5c2e63[_0x2d87f5(_0x4a7dd8._0x69dd25)]?_0xf86963['layer']['fire'](_0x3bd84c,_0xf86963,!![]):this['_map'][_0x2d87f5(_0x4a7dd8._0x69dd25)](_0x3bd84c,_0xf86963);}['destroy'](){const _0x576f43={_0x4b90cd:0x6e8},_0x28e1ea=_0x35a251;!this['_graphicLayer']&&(this['_map']['removeLayer'](this['_graphicLayer'],!![]),delete this['_graphicLayer']),this['handler']['destroy'](),delete this['handler'],this[_0x28e1ea(0xd79)]['canvas']['removeEventListener'](_0x28e1ea(_0x576f43._0x4b90cd),this['_onKeyDown']),this['_map']['canvas']['removeEventListener']('keyup',this['_onKeyUp']);}}new Cesium__namespace['Cartographic']();const rayScratch=new Cesium__namespace['Ray'](),cartesian3Scratch=new Cesium__namespace[(_0x35a251(0x8eb))]();class ZoomNavigation{constructor(_0xffc0de){const _0xfe76e4=_0x35a251;this[_0xfe76e4(0x8d3)]=_0xffc0de;}['zoomIn'](_0x31bffc=0x2,_0xa73f48){return _0x31bffc=0x1/_0x31bffc,this['zoom'](_0x31bffc,_0xa73f48);}['zoomOut'](_0x315270=0x2,_0x33bb64){return this['zoom'](_0x315270,_0x33bb64);}['zoom'](_0x4fafb6,_0x57890a){const _0x347789={_0x52d1ba:0x7d,_0x202604:0x637,_0x522887:0x5d4,_0x1e95a0:0x8d3,_0xa71fb6:0x852,_0x5eda2a:0xaa2,_0x102e64:0x41f,_0x2d81f5:0x682,_0x36fe94:0x5b2},_0x223ac5=_0x35a251,_0x1fde91=this['viewer']['scene'],_0x4a5047=_0x1fde91['screenSpaceCameraController'];if(!_0x57890a&&(!_0x4a5047['enableInputs']||!_0x4a5047['enableZoom']))return![];const _0x2a26ca=_0x1fde91[_0x223ac5(_0x347789._0x52d1ba)];let _0x34047f;switch(_0x1fde91['mode']){case Cesium__namespace['SceneMode']['COLUMBUS_VIEW']:case Cesium__namespace['SceneMode']['MORPHING']:case Cesium__namespace[_0x223ac5(_0x347789._0x202604)]['SCENE2D']:{const _0xcb66fd=_0x2a26ca['positionCartographic']['height']*(0x1-_0x4fafb6);_0x2a26ca['zoomIn'](_0xcb66fd);const _0x3307f8=_0x4a5047[_0x223ac5(0x1c8)],_0x43fe86=_0x4a5047['maximumZoomDistance'],_0x3bc34c=_0x2a26ca['positionCartographic'][_0x223ac5(0x682)];if(_0x3bc34c<_0x3307f8)return _0x2a26ca['zoomOut'](_0xcb66fd),![];if(_0x3bc34c<_0x4a5047['_minimumCollisionTerrainHeight']){const _0x598083=_0x4a5047[_0x223ac5(_0x347789._0x522887)]['globeHeight'];if(Cesium__namespace['defined'](_0x598083)&&_0x3bc34c<=_0x598083+_0x3307f8)return _0x2a26ca['zoomOut'](_0xcb66fd),![];}if(_0x43fe86&&_0x3bc34c>_0x43fe86)return _0x2a26ca[_0x223ac5(0x66f)](_0xcb66fd),![];return!![];}default:{let _0x5108e1;Cesium__namespace['defined'](this[_0x223ac5(_0x347789._0x1e95a0)]['trackedEntity'])?_0x5108e1=new Cesium__namespace['Cartesian3']():(rayScratch['origin']=_0x2a26ca['positionWC'],rayScratch[_0x223ac5(0x79b)]=_0x2a26ca[_0x223ac5(_0x347789._0xa71fb6)],_0x5108e1=_0x1fde91[_0x223ac5(0x22f)]['pick'](rayScratch,_0x1fde91,new Cesium__namespace['Cartesian3']()),Cesium__namespace['defined'](_0x5108e1)&&(_0x5108e1=_0x2a26ca['worldToCameraCoordinatesPoint'](_0x5108e1,_0x5108e1)));if(!Cesium__namespace[_0x223ac5(_0x347789._0x5eda2a)](_0x5108e1)){const _0x3f7b0f=new Cesium__namespace['Ray'](_0x2a26ca[_0x223ac5(0xfa9)](_0x1fde91['globe']['ellipsoid'][_0x223ac5(0x1fc)](_0x2a26ca['positionCartographic'])),_0x2a26ca['directionWC']);_0x5108e1=Cesium__namespace['IntersectionTests']['grazingAltitudeLocation'](_0x3f7b0f,_0x1fde91['globe']['ellipsoid']);if(!Cesium__namespace[_0x223ac5(_0x347789._0x5eda2a)](_0x5108e1))return![];_0x34047f={'heading':_0x2a26ca[_0x223ac5(_0x347789._0x102e64)],'pitch':_0x2a26ca[_0x223ac5(0x527)],'roll':_0x2a26ca['roll']};}else _0x34047f={'direction':_0x2a26ca['direction'],'up':_0x2a26ca['up']};const _0x4e120e=Cesium__namespace['Cartesian3']['subtract'](_0x2a26ca['position'],_0x5108e1,cartesian3Scratch),_0x2d584c=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x4e120e,_0x4fafb6,_0x4e120e),_0xd423cf=Cesium__namespace['Cartesian3']['add'](_0x5108e1,_0x2d584c,_0x5108e1);if(!Cesium__namespace['defined'](_0xd423cf))return![];const _0x2b745a=_0x4a5047['minimumZoomDistance'],_0x3487c4=_0x4a5047['maximumZoomDistance'],_0x33bd32=Cesium__namespace['Cartographic']['fromCartesian'](_0xd423cf)[_0x223ac5(_0x347789._0x2d81f5)];if(_0x33bd32<_0x2b745a)return![];if(_0x33bd32<_0x4a5047['_minimumCollisionTerrainHeight']){const _0x267cf7=_0x4a5047['_scene']['globeHeight'];if(Cesium__namespace[_0x223ac5(0xaa2)](_0x267cf7)&&_0x33bd32<=_0x267cf7+_0x2b745a)return![];}if(_0x3487c4&&_0x33bd32>_0x3487c4)return![];return Cesium__namespace['defined'](this[_0x223ac5(0x8d3)]['trackedEntity'])||_0x1fde91['mode']===Cesium__namespace['SceneMode'][_0x223ac5(0x191)]?_0x2a26ca['position']=_0xd423cf:_0x2a26ca[_0x223ac5(_0x347789._0x36fe94)]({'destination':_0xd423cf,'orientation':_0x34047f,'duration':0.5,'convert':![]}),!![];}}}}class SceneOption{constructor(_0x3c9381){const _0x33e362={_0x132093:0xe86,_0x49ed02:0x56b},_0x281dea=_0x35a251;this['_map']=_0x3c9381,this['_viewer']=_0x3c9381['viewer'],this[_0x281dea(_0x33e362._0x132093)]={},this[_0x281dea(_0x33e362._0x49ed02)]();}['_init'](){const _0x337938={_0x35b35e:0xebf,_0x46d710:0x4f9,_0x508084:0x940},_0x13520f=_0x35a251;var _0x113203,_0x44fab9;this['_viewer']['cesiumWidget'][_0x13520f(0x7bb)]['style']['display']=_0x13520f(0x274),this['_viewer']['scene'][_0x13520f(0xbbb)][_0x13520f(0x2a0)]=0x2faf080,this[_0x13520f(_0x337938._0x35b35e)]['scene']['backgroundColor']=Cesium__namespace['Color'][_0x13520f(0x4c4)];this['_viewer']['sceneModePicker']&&(this['_viewer'][_0x13520f(0x10e)][_0x13520f(_0x337938._0x46d710)]['duration']=0x0);(_0x113203=this['_viewer'])===null||_0x113203===void 0x0?void 0x0:(_0x44fab9=_0x113203['homeButton'])===null||_0x44fab9===void 0x0?void 0x0:_0x44fab9[_0x13520f(_0x337938._0x46d710)][_0x13520f(0xa8f)][_0x13520f(_0x337938._0x508084)]['addEventListener'](_0x18844e=>{this['_map']['flyHome'](),_0x18844e['cancel']=!![];}),this[_0x13520f(_0x337938._0x35b35e)]['_cesiumWidget']['_supportsImageRenderingPixelated']=Cesium__namespace['FeatureDetection']['supportsImageRenderingPixelated'](),this['_viewer']['_cesiumWidget']['_forceResize']=!![];if(Cesium__namespace[_0x13520f(0x87d)][_0x13520f(0xa2c)]()){let _0x1e4505=window['devicePixelRatio'];while(_0x1e4505>=0x2){_0x1e4505/=0x2;}this['_viewer']['resolutionScale']=_0x1e4505;}}[_0x35a251(0x72b)](_0x2ddc8e,_0x1b725f){const _0x346fc0={_0x14922b:0xd28},_0x23a833=_0x35a251;return _0x2ddc8e=_0x2ddc8e||{},_0x1b725f=_0x1b725f||{},this['options']=_0x2ddc8e,this['_setViewerOption'](_0x1b725f)['_setCanvasOption'](_0x1b725f)['_setSceneOption'](_0x1b725f)['_setGlobeOption'](_0x1b725f)['_setCameraOption'](_0x1b725f)[_0x23a833(_0x346fc0._0x14922b)](_0x1b725f),this;}[_0x35a251(0xf16)](_0x282229){const _0x4681a8={_0x1f8ada:0x176,_0x128534:0xd79,_0x48dac9:0x529,_0x4ecdf6:0xe86,_0x1fefa2:0xebf,_0x4ead65:0xe23,_0x4ac183:0xb5d,_0x4742f6:0x9c7,_0x248c86:0xb5d},_0x12b3e5=_0x35a251;if(_0x282229[_0x12b3e5(_0x4681a8._0x1f8ada)])this[_0x12b3e5(_0x4681a8._0x128534)]['setCameraView'](this[_0x12b3e5(0xe86)]['center'],{'duration':0x0});else _0x282229['extent']&&this['_map']['flyToExtent'](this['options']['extent'],{'duration':0x0});return this[_0x12b3e5(0xebf)][_0x12b3e5(_0x4681a8._0x48dac9)]=this[_0x12b3e5(_0x4681a8._0x4ecdf6)][_0x12b3e5(_0x4681a8._0x48dac9)]??![],(this[_0x12b3e5(0xe86)]['removeDblClick']??!![])&&this[_0x12b3e5(_0x4681a8._0x1fefa2)]['screenSpaceEventHandler']['removeInputAction'](Cesium__namespace['ScreenSpaceEventType']['LEFT_DOUBLE_CLICK']),this['options'][_0x12b3e5(0xe23)]&&(this['_viewer']['resolutionScale']=this[_0x12b3e5(0xe86)][_0x12b3e5(_0x4681a8._0x4ead65)]),Cesium__namespace['defined'](this['options'][_0x12b3e5(0xb5d)])&&(isBoolean(this['options']['terrainShadows'])?this['_viewer']['terrainShadows']=this['options'][_0x12b3e5(_0x4681a8._0x4ac183)]?Cesium__namespace[_0x12b3e5(_0x4681a8._0x4742f6)][_0x12b3e5(0x7a6)]:Cesium__namespace['ShadowMode']['DISABLED']:this['_viewer'][_0x12b3e5(_0x4681a8._0x248c86)]=this[_0x12b3e5(_0x4681a8._0x4ecdf6)]['terrainShadows']),this;}['_setCanvasOption'](_0x38388a){const _0x51dd27={_0x2da175:0x73f},_0x52cfdd=_0x35a251,_0x126629=this['_viewer']['canvas'];return _0x126629['setAttribute'](_0x52cfdd(0xb26),this[_0x52cfdd(0xe86)][_0x52cfdd(_0x51dd27._0x2da175)]??0x0),_0x126629['onclick']=_0x52145c=>{_0x126629['focus']();},this;}['_setSceneOption'](_0x5969dc){const _0x2061ce={_0x51bce4:0x10d,_0x2c0d4b:0x2a6,_0x5709bd:0xae3,_0x2f654b:0xba5,_0x5f1123:0x9d8,_0x321b1e:0x637},_0xd006c5=_0x35a251,_0x5b6805=this['_viewer']['scene'],_0x835291=this[_0xd006c5(0xe86)];_0x5b6805[_0xd006c5(0x28d)]['show']=_0x835291['showSun']??!![],_0x5b6805['moon']['show']=_0x835291[_0xd006c5(0xe61)]??!![],_0x5b6805['skyBox']['show']=_0x835291['showSkyBox']??!![],_0x5b6805[_0xd006c5(_0x2061ce._0x51bce4)][_0xd006c5(0x987)]=Boolean(_0x835291['showSkyAtmosphere']??!![]),_0x5b6805['fog'][_0xd006c5(_0x2061ce._0x2c0d4b)]=_0x835291['fog']??!![],_0x5b6805['postProcessStages']['fxaa']['enabled']=_0x835291[_0xd006c5(0x496)]??!![],_0x5b6805[_0xd006c5(_0x2061ce._0x5709bd)]=_0x835291[_0xd006c5(0xae3)]??![];_0x835291['backgroundColor']&&(_0x5b6805[_0xd006c5(_0x2061ce._0x2f654b)]=Cesium__namespace[_0xd006c5(0xf29)]['fromCssColorString'](_0x835291['backgroundColor']));Cesium__namespace['defined'](_0x835291['orderIndependentTranslucency'])&&(_0x5b6805['_useOIT']=_0x835291[_0xd006c5(0xcd8)]);switch(_0x835291[_0xd006c5(_0x2061ce._0x5f1123)]){case Cesium__namespace['SceneMode']['SCENE2D']:_0x5b6805['morphTo2D'](0x0);break;case Cesium__namespace['SceneMode']['COLUMBUS_VIEW']:_0x5b6805['morphToColumbusView'](0x0);break;case Cesium__namespace[_0xd006c5(_0x2061ce._0x321b1e)]['SCENE3D']:_0x5b6805['morphTo3D'](0x0);break;}return this;}['_setGlobeOption'](_0x4ad2ee){const _0x3e6b23={_0x55442b:0xf29,_0x197f35:0x314,_0x38dc8e:0xef4},_0x39624a=_0x35a251,_0x4801e5=this['_viewer']['scene']['globe'],_0x494d0e=this['options']['globe']??{};return merge(_0x4801e5,{..._0x494d0e,'show':_0x494d0e['show']??!![],'depthTestAgainstTerrain':_0x494d0e['depthTestAgainstTerrain']??![],'baseColor':Cesium__namespace[_0x39624a(_0x3e6b23._0x55442b)]['fromCssColorString'](_0x494d0e['baseColor']||'#546a53'),'showGroundAtmosphere':_0x494d0e[_0x39624a(_0x3e6b23._0x197f35)]??!![],'enableLighting':_0x494d0e[_0x39624a(_0x3e6b23._0x38dc8e)]??![]}),this;}['_setCameraOption'](_0x4cada3){const _0x115454={_0x21acfd:0xc67,_0x3093be:0x8b4},_0x10e4f1=_0x35a251,_0x2b5b67=this['_viewer'][_0x10e4f1(0xc60)]['screenSpaceCameraController'],_0x5f5bc1=this['options']['cameraController']??{};return merge(_0x2b5b67,{..._0x5f5bc1,'_zoomFactor':_0x5f5bc1['zoomFactor']||0x3,'minimumZoomDistance':_0x5f5bc1['minimumZoomDistance']??0x1,'maximumZoomDistance':_0x5f5bc1['maximumZoomDistance']??0x2faf080,'minimumCollisionTerrainHeight':_0x5f5bc1['minimumCollisionTerrainHeight']??0x3a98,'enableRotate':_0x5f5bc1['enableRotate']??!![],'enableTranslate':_0x5f5bc1[_0x10e4f1(_0x115454._0x21acfd)]??!![],'enableTilt':_0x5f5bc1['enableTilt']??!![],'enableZoom':_0x5f5bc1[_0x10e4f1(_0x115454._0x3093be)]??!![],'enableCollisionDetection':_0x5f5bc1['enableCollisionDetection']??!![]}),_0x5f5bc1['constrainedAxis']===![]&&(this['_viewer']['camera']['constrainedAxis']=undefined),this;}[_0x35a251(0xd28)](_0x5b9174){const _0x3ccd77={_0x4b1a54:0x21b,_0x29a40f:0xcf0,_0x1968a1:0x579,_0x488ab8:0xbd9},_0x47b138=_0x35a251,_0x3e308a=this['_viewer'][_0x47b138(0x42d)],_0x145bee=this['options']['clock']??{};return _0x145bee[_0x47b138(_0x3ccd77._0x4b1a54)]=_0x145bee[_0x47b138(0x21b)]??this['options']['shouldAnimate']??!![],_0x3e308a['shouldAnimate']=_0x145bee['shouldAnimate'],_0x145bee['startTime']&&(_0x3e308a['startTime']=this['_getJulianDate'](_0x145bee['startTime']),_0x3e308a[_0x47b138(0x18b)]=_0x3e308a['startTime']),_0x145bee['stopTime']&&(_0x3e308a['stopTime']=this['_getJulianDate'](_0x145bee[_0x47b138(0xcf0)])),_0x145bee[_0x47b138(0x18b)]&&(_0x3e308a['currentTime']=this['_getJulianDate'](_0x145bee['currentTime']),!_0x145bee[_0x47b138(0x586)]&&(_0x3e308a['startTime']=_0x3e308a[_0x47b138(0x18b)]['clone']()),!_0x145bee[_0x47b138(_0x3ccd77._0x29a40f)]&&(_0x3e308a['stopTime']=Cesium__namespace['JulianDate'][_0x47b138(0x6e6)](_0x3e308a['currentTime'],0x1,new Cesium__namespace[(_0x47b138(_0x3ccd77._0x1968a1))]()))),_0x145bee[_0x47b138(0xbd9)]&&(_0x3e308a[_0x47b138(_0x3ccd77._0x488ab8)]=_0x145bee[_0x47b138(_0x3ccd77._0x488ab8)]),this;}['_getJulianDate'](_0x3490b9){const _0x4aea2a={_0x2f0a40:0xa51},_0x4d2936=_0x35a251;return isString(_0x3490b9)?_0x3490b9['indexOf']('Z')===-0x1?Cesium__namespace['JulianDate'][_0x4d2936(_0x4aea2a._0x2f0a40)](new Date(_0x3490b9)):Cesium__namespace[_0x4d2936(0x579)]['fromIso8601'](_0x3490b9):_0x3490b9;}}function initBeforeCreateDefaultValue(_0x1f70b1){const _0x1efaf3={_0x38d731:0x86,_0xdac520:0xc22},_0x22381c=_0x35a251;var _0x4e16c2,_0x4d12d0;Cesium__namespace['Ion']['defaultAccessToken']=(_0x1f70b1===null||_0x1f70b1===void 0x0?void 0x0:(_0x4e16c2=_0x1f70b1['scene'])===null||_0x4e16c2===void 0x0?void 0x0:_0x4e16c2['ionToken'])||ion,Cesium__namespace[_0x22381c(0x6ff)]['defaultTicks']=(_0x1f70b1===null||_0x1f70b1===void 0x0?void 0x0:(_0x4d12d0=_0x1f70b1[_0x22381c(0x9c8)])===null||_0x4d12d0===void 0x0?void 0x0:_0x4d12d0[_0x22381c(_0x1efaf3._0x38d731)])||[0.1,0.25,0.5,0x1,0x2,0x5,0xa,0xf,0x1e,0x3c,0x78,0x12c,0x258,0x384,0x708,0xe10],Cesium__namespace['Camera'][_0x22381c(_0x1efaf3._0xdac520)]=Cesium__namespace['Rectangle']['fromDegrees'](89.5,20.4,110.4,61.2),Cesium__namespace[_0x22381c(0x2d2)]['maximumRequests']=0x64,Cesium__namespace['RequestScheduler'][_0x22381c(0xd3e)]=0x14;}class PopupMgr extends BaseControl{constructor(_0x37cbf8={}){super(_0x37cbf8),this['_depthTest']=_0x37cbf8['depthTest']??!![];}get[_0x35a251(0x812)](){const _0x1dc310=_0x35a251;return this[_0x1dc310(0xce3)];}set['depthTest'](_0x19bab1){this['_depthTest']=_0x19bab1;}['_mountedHook'](){const _0x4cce9b={_0x3f9e3b:0x400},_0x1c6f7e=_0x35a251;this[_0x1c6f7e(0x2d0)]=new GraphicLayer({'private':!![]}),this['_layer'][_0x1c6f7e(_0x4cce9b._0x3f9e3b)]=function(){};}['_enabledHook'](_0x57b5f6){this['_layer']['show']=_0x57b5f6;}['_addedHook'](){const _0x3f9ff8={_0x2ca01f:0xd79,_0x1af45e:0x6f7,_0x5b8671:0x2d0,_0x25d4cf:0xfc0},_0x347a27=_0x35a251;this[_0x347a27(_0x3f9ff8._0x2ca01f)][_0x347a27(_0x3f9ff8._0x1af45e)](this[_0x347a27(_0x3f9ff8._0x5b8671)]),this[_0x347a27(_0x3f9ff8._0x25d4cf)]();}[_0x35a251(0xa9a)](){const _0x3f07db=_0x35a251;this[_0x3f07db(0xabd)](),this['_map']['removeLayer'](this['_layer']);}[_0x35a251(0xfc0)](){const _0xde7778={_0x29fa76:0x3ec},_0x308da7=_0x35a251;this['_map']['on'](EventType['click'],this['_mouseClickHandler'],this),this['_map']['on'](EventType['clickTileGraphic'],this[_0x308da7(_0xde7778._0x29fa76)],this);}['_unbindEvent'](){const _0x4b4b87=_0x35a251;this[_0x4b4b87(0xd79)]['off'](EventType['click'],this['_mouseClickHandler'],this),this['_map']['off'](EventType['clickTileGraphic'],this['_mouseClickHandler'],this);}[_0x35a251(0x3ec)](_0x8d062e){const _0x17ade4={_0x178505:0x896,_0xcb9b87:0xe1e},_0x3672b6=_0x35a251;var _0xaf7bf9,_0x5ca48b;if(!this['enabled'])return;if(this[_0x3672b6(_0x17ade4._0x178505)](_0x8d062e['czmObject'],_0x8d062e))return;if(this['_openByMouseEvent'](_0x8d062e['graphic'],_0x8d062e))return;if(this['_openByMouseEvent']((_0xaf7bf9=_0x8d062e[_0x3672b6(0xf8c)])===null||_0xaf7bf9===void 0x0?void 0x0:_0xaf7bf9['parent'],_0x8d062e))return;if(this[_0x3672b6(_0x17ade4._0x178505)](_0x8d062e['layer'],_0x8d062e))return;if(this['_openByMouseEvent']((_0x5ca48b=_0x8d062e[_0x3672b6(0x87)])===null||_0x5ca48b===void 0x0?void 0x0:_0x5ca48b['parent'],_0x8d062e))return;const _0x5b8b26=this['_layer']['getGraphics']();for(let _0x473d30=0x0,_0x48ab8d=_0x5b8b26[_0x3672b6(_0x17ade4._0xcb9b87)];_0x473d30<_0x48ab8d;_0x473d30++){const _0x4ebb27=_0x5b8b26[_0x473d30];_0x4ebb27['options']['closeOnClick']!==![]&&_0x4ebb27['remove'](!![]);}}[_0x35a251(0x39b)](_0x21e8aa){const _0x3a9039={_0x338ddc:0xdf7},_0x35ca1a=_0x35a251;return _0x21e8aa[_0x35ca1a(_0x3a9039._0x338ddc)]||_0x21e8aa['getPopupConfig']&&_0x21e8aa['getPopupConfig']();}['_openByMouseEvent'](_0x557242,_0x216bd8){const _0x5f479f=_0x35a251;if(!_0x557242)return![];let _0x5c5e39=this['_getConfig'](_0x557242);if(_0x5c5e39===![])return!![];if(!_0x5c5e39)return![];return _0x5c5e39={..._0x5c5e39,..._0x216bd8},this[_0x5f479f(0x8d8)](_0x216bd8['cartesian'],_0x5c5e39),!![];}['close'](_0x57fa07,_0x3e1f41){const _0x4d7443={_0x46c6b4:0x2d0,_0x494d8f:0x1ee,_0x1e6812:0xe86},_0x3fdd9c=_0x35a251;if(!this[_0x3fdd9c(_0x4d7443._0x46c6b4)])return;if(_0x57fa07){const _0x755c6f=this['_layer']['getGraphics']();for(let _0x176e2d=0x0,_0x3d1752=_0x755c6f[_0x3fdd9c(0xe1e)];_0x176e2d<_0x3d1752;_0x176e2d++){var _0x129edc,_0x5064ef;const _0x161c09=_0x755c6f[_0x176e2d];if(_0x161c09['options']['checkData']){var _0x924869;_0x161c09['options']['checkData']((_0x924869=_0x161c09['options'])===null||_0x924869===void 0x0?void 0x0:_0x924869['attr'],_0x57fa07)&&_0x161c09['remove'](!![]);}else _0x57fa07===((_0x129edc=_0x161c09['options'])===null||_0x129edc===void 0x0?void 0x0:(_0x5064ef=_0x129edc['event'])===null||_0x5064ef===void 0x0?void 0x0:_0x5064ef['graphic'])&&_0x161c09[_0x3fdd9c(_0x4d7443._0x494d8f)](!![]);}return;}if(_0x3e1f41){const _0x186ed9=this['_layer'][_0x3fdd9c(0xcca)]();for(let _0x402817=0x0,_0x59d9da=_0x186ed9['length'];_0x402817<_0x59d9da;_0x402817++){var _0x520ca3,_0x1f49a3;const _0x4e0c97=_0x186ed9[_0x402817];if(_0x4e0c97[_0x3fdd9c(_0x4d7443._0x1e6812)]['checkData']){var _0x2f0728;_0x4e0c97[_0x3fdd9c(_0x4d7443._0x1e6812)]['checkData']((_0x2f0728=_0x4e0c97[_0x3fdd9c(_0x4d7443._0x1e6812)])===null||_0x2f0728===void 0x0?void 0x0:_0x2f0728['attr'],_0x3e1f41)&&_0x4e0c97['remove'](!![]);}else _0x3e1f41===((_0x520ca3=_0x4e0c97['options'])===null||_0x520ca3===void 0x0?void 0x0:(_0x1f49a3=_0x520ca3['event'])===null||_0x1f49a3===void 0x0?void 0x0:_0x1f49a3['layer'])&&_0x4e0c97['remove'](!![]);}return;}const _0x127623=this['_layer']['getGraphics']();for(let _0x3c581a=0x0,_0x2bc933=_0x127623[_0x3fdd9c(0xe1e)];_0x3c581a<_0x2bc933;_0x3c581a++){var _0xfddbb0;const _0x5ad6dd=_0x127623[_0x3c581a];(((_0xfddbb0=_0x5ad6dd[_0x3fdd9c(0xe86)])===null||_0xfddbb0===void 0x0?void 0x0:_0xfddbb0['autoClose'])??!![])&&_0x5ad6dd['remove'](!![]);}}['closeAll'](){const _0x2bbc85=_0x35a251;this[_0x2bbc85(0x2d0)]&&this['_layer'][_0x2bbc85(0x386)]();}['open'](_0x5652fe,_0xa7d37e={}){const _0x59d99f={_0x542f58:0x5e9,_0x40ec26:0x371,_0x133495:0x9c2,_0x307f92:0xb61,_0x54fd48:0xf8c,_0x4a415:0x8f1,_0x47df13:0xe28},_0xbbe5f2=_0x35a251;var _0x2db75d;const _0x5d3f94=_0xa7d37e['options']||{};if((_0x5d3f94===null||_0x5d3f94===void 0x0?void 0x0:_0x5d3f94['autoClose'])??!![])this[_0xbbe5f2(0x5e9)]();else _0xa7d37e!==null&&_0xa7d37e!==void 0x0&&_0xa7d37e[_0xbbe5f2(0xf8c)]&&this[_0xbbe5f2(_0x59d99f._0x542f58)](_0xa7d37e['graphic']);let _0x454a48=_0xa7d37e['target'];_0xa7d37e['layer']&&_0xa7d37e['layer'][_0xbbe5f2(0x264)]&&(_0x454a48=_0xa7d37e['layer']);_0xa7d37e['graphic']&&_0xa7d37e['graphic']['fire']&&(_0x454a48=_0xa7d37e[_0xbbe5f2(0xf8c)]);let _0x573009=Cesium__namespace['HeightReference']['NONE'];if(_0xa7d37e['czmObject']){const _0x506cbe=_0xa7d37e[_0xbbe5f2(_0x59d99f._0x40ec26)];_0x573009=this['getHeightReference'](_0x506cbe,_0x573009);if(_0x506cbe[_0xbbe5f2(_0x59d99f._0x133495)]||_0x506cbe['point'])_0x5652fe=_0x506cbe[_0xbbe5f2(_0x59d99f._0x307f92)];else _0x506cbe['position']&&!(_0x506cbe[_0xbbe5f2(_0x59d99f._0x307f92)]instanceof Cesium__namespace['ConstantPositionProperty'])&&(_0x5652fe=_0x506cbe['position']);}if(_0xa7d37e[_0xbbe5f2(_0x59d99f._0x54fd48)]){if(_0xa7d37e['graphic']['isPoint']){var _0x76fc60,_0x3b425e;_0x573009=(_0x76fc60=_0xa7d37e['graphic']['style'])===null||_0x76fc60===void 0x0?void 0x0:_0x76fc60['heightReference'],(_0x3b425e=_0xa7d37e[_0xbbe5f2(_0x59d99f._0x54fd48)]['style'])!==null&&_0x3b425e!==void 0x0&&_0x3b425e['clampToGround']&&(_0x573009=Cesium__namespace[_0xbbe5f2(_0x59d99f._0x4a415)]['CLAMP_TO_GROUND']);}_0xa7d37e[_0xbbe5f2(_0x59d99f._0x47df13)]&&_0xa7d37e['graphic']['property']&&(_0x5652fe=_0xa7d37e['graphic']['_getPopupPosition']());}const _0x5021b3={..._0x5d3f94,'heightReference':_0x573009,'html':_0xa7d37e['content']},_0x4e5b48=this['_createDivGraphic']({'depthTest':this['depthTest'],..._0x5d3f94,'position':_0x5652fe,'style':_0x5021b3,'attr':(_0x2db75d=_0xa7d37e['graphic'])===null||_0x2db75d===void 0x0?void 0x0:_0x2db75d['attr'],'target':_0x454a48,'event':_0xa7d37e},_0x454a48);this['_layer'][_0xbbe5f2(0x8b5)](_0x4e5b48);}['getPopup'](_0x2a9b98){return this['_layer']['getGraphicById'](_0x2a9b98['_popupId']);}[_0x35a251(0xc79)](_0xefe2c2,_0x5e1ca6){const _0x11becd=new Popup(_0xefe2c2);return _0x5e1ca6&&(_0x5e1ca6['_popupId']=_0x11becd['id']),_0x11becd;}['getHeightReference'](_0x5ad06a,_0x464c89){const _0xb863b1=_0x35a251;if(!_0x5ad06a)return _0x464c89;if(Cesium__namespace['defined'](_0x5ad06a['_heightReference']))return _0x5ad06a[_0xb863b1(0x18f)];const _0x28018b=_0x5ad06a['billboard']||_0x5ad06a['point']||_0x5ad06a['model']||_0x5ad06a['label'];if(Cesium__namespace['defined'](_0x28018b===null||_0x28018b===void 0x0?void 0x0:_0x28018b['heightReference']))return _0x28018b[_0xb863b1(0x4b2)]['_value'];return _0x464c89;}}register$1('popup',PopupMgr);class TooltipMgr extends PopupMgr{constructor(_0x5cc6b1={}){super(_0x5cc6b1),this['options']['cacheTime']=this['options']['cacheTime']??0x14;}[_0x35a251(0xefe)](_0x4ff7e5){const _0x347375=_0x35a251;super['_enabledHook'](_0x4ff7e5),this['moveTimer']&&!_0x4ff7e5&&(clearTimeout(this[_0x347375(0xf7d)]),delete this['moveTimer']);}['_bindEvent'](){const _0x486f78={_0x4dfb6a:0x16f},_0x28f460=_0x35a251;this[_0x28f460(0xd79)]['on'](EventType['mouseMoveTarget'],this['_mouseMoveHandler'],this),this[_0x28f460(0xd79)]['on'](EventType[_0x28f460(0x774)],this[_0x28f460(_0x486f78._0x4dfb6a)],this),this['_map']['on'](EventType['mouseUp'],this['_mouseUpHandler'],this);}['_unbindEvent'](){const _0x1244fa={_0x44b7d8:0xd79,_0x237258:0x16f,_0x1d827a:0x6b2},_0x1da1d8=_0x35a251;this['_map'][_0x1da1d8(0x6b2)](EventType['mouseMoveTarget'],this['_mouseMoveHandler'],this),this[_0x1da1d8(_0x1244fa._0x44b7d8)]['off'](EventType['mouseDown'],this[_0x1da1d8(_0x1244fa._0x237258)],this),this[_0x1da1d8(0xd79)][_0x1da1d8(_0x1244fa._0x1d827a)](EventType['mouseUp'],this['_mouseUpHandler'],this);}['_mouseDownHandler'](_0x5cc7c0){if(!this['enabled'])return;this['_isMouseUpdownPressed']=!![],this['close']();}[_0x35a251(0xfc)](_0x122741){if(!this['enabled'])return;this['_isMouseUpdownPressed']=![];}['_mouseMoveHandler'](_0x372c41){const _0x25c59d={_0xb32b24:0x706},_0x51d2e4=_0x35a251;if(!this['enabled'])return;this['moveTimer']&&(clearTimeout(this['moveTimer']),delete this[_0x51d2e4(0xf7d)]);if(this['_isMouseUpdownPressed']||!this[_0x51d2e4(_0x25c59d._0xb32b24)]){this[_0x51d2e4(0x5e9)]();return;}this['moveTimer']=setTimeout(()=>{const _0x571fbf=_0x51d2e4;delete this['moveTimer'],this[_0x571fbf(0x3ec)](_0x372c41);},this['options']['cacheTime']);}[_0x35a251(0x39b)](_0x732729){const _0x3b9f55={_0x1c2093:0x5f8},_0x47d712=_0x35a251;return _0x732729[_0x47d712(0x8f2)]||_0x732729[_0x47d712(_0x3b9f55._0x1c2093)]&&_0x732729['getTooltipConfig']();}[_0x35a251(0xc79)](_0x3ea954,_0x51f533){const _0x2294a2=_0x35a251,_0x48a199=new Tooltip(_0x3ea954);return _0x51f533&&(_0x51f533[_0x2294a2(0x2a1)]=_0x48a199['id']),_0x48a199;}[_0x35a251(0x177)](_0xdede64){const _0x282e7a={_0x35507f:0x2d0},_0x56ae1a=_0x35a251;return this[_0x56ae1a(_0x282e7a._0x35507f)]['getGraphicById'](_0xdede64['_tooltipId']);}}register$1('tooltip',TooltipMgr);class SmallTooltip extends BaseControl{get[_0x35a251(0x79b)](){const _0x2ebf73={_0x48a0da:0xe86,_0x12d958:0x79b},_0x414853=_0x35a251;return this[_0x414853(_0x2ebf73._0x48a0da)][_0x414853(_0x2ebf73._0x12d958)];}set['direction'](_0x160915){const _0x50b864={_0x54c340:0xe86,_0x4289bf:0xbf4},_0x36f4c4=_0x35a251;this[_0x36f4c4(_0x50b864._0x54c340)]['direction']=_0x160915,_0x160915?(addClass(this['_containerArrow'],'mars3d-smallTooltip-leftArrow'),removeClass(this['_containerArrow'],_0x36f4c4(0xbf4))):(addClass(this['_containerArrow'],_0x36f4c4(_0x50b864._0x4289bf)),removeClass(this['_containerArrow'],'mars3d-smallTooltip-leftArrow'));}['_enabledHook'](_0x105fb8){this['show']=_0x105fb8;}[_0x35a251(0x700)](){const _0x23910b={_0x1a2b31:0x274,_0x3f418e:0xfb4},_0xb37102=_0x35a251;this['_container']=create$3('div','mars3d-smallTooltip'),this['_container']['style']['display']=_0xb37102(_0x23910b._0x1a2b31),this['_containerArrow']=create$3('div',_0xb37102(0xdc2),this['_container']),this['_containerContent']=create$3('div','mars3d-smallTooltip-inner',this['_container']),this['_container'][_0xb37102(0x77e)](_0xb37102(_0x23910b._0x3f418e),_0x18547c=>{this['close']();});}['close'](){const _0x2f18c6=_0x35a251;this['_container']&&(this[_0x2f18c6(0x5f4)]['style']['display']='none');}['open'](_0x2fb34e,_0x25e6a4){const _0x4fe4ce={_0x1378a5:0xd79,_0x1c81fb:0x5f4,_0x57bced:0x678,_0x2d2d39:0xfc8,_0x70f069:0xe86,_0x539344:0xfc8,_0x46f6e0:0xfa3,_0x296924:0x922},_0x31847a=_0x35a251;if(!this['enabled'])return;_0x25e6a4&&(this[_0x31847a(0xaf7)]['innerHTML']=_0x25e6a4),_0x2fb34e?(_0x2fb34e instanceof Cesium__namespace['Cartesian3']&&(_0x2fb34e=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](this[_0x31847a(_0x4fe4ce._0x1378a5)]['scene'],_0x2fb34e)),this[_0x31847a(_0x4fe4ce._0x1c81fb)]['style']['display']=_0x31847a(_0x4fe4ce._0x57bced),this['_container'][_0x31847a(_0x4fe4ce._0x2d2d39)]['top']=_0x2fb34e['y']-this['_container']['clientHeight']/0x2+'px',this[_0x31847a(_0x4fe4ce._0x70f069)]['direction']?this['_container'][_0x31847a(_0x4fe4ce._0x539344)]['left']=_0x2fb34e['x']-this[_0x31847a(0x5f4)]['clientWidth']-0x19+'px':this['_container']['style'][_0x31847a(_0x4fe4ce._0x46f6e0)]=_0x2fb34e['x']+0x19+'px'):this['_container']['style'][_0x31847a(_0x4fe4ce._0x296924)]='none';}}register$1('smallTooltip',SmallTooltip);class ContextMenu extends BaseControl{constructor(_0x345b8d={}){super(_0x345b8d),this['_menuIndex']=0x0,this['_menuObj']={};}get['target'](){return this['_target'];}['_enabledHook'](){const _0x555e48={_0x547bdb:0xb00},_0xc8c963=_0x35a251;this[_0xc8c963(_0x555e48._0x547bdb)]=null;}['_mountedHook'](){const _0x5dcddd={_0x5613b2:0x883,_0x4a7ec9:0xfc8,_0x28d92c:0x274,_0x78976a:0x96},_0x37fdb4=_0x35a251;Cesium__namespace[_0x37fdb4(_0x5dcddd._0x5613b2)](this['options']['preventDefault'],!![])&&(this['_map']['container']['oncontextmenu']=function(_0x421353){_0x421353['preventDefault']();}),this['_container']=create$3('div','mars3d-contextmenu'),this[_0x37fdb4(0x5f4)][_0x37fdb4(_0x5dcddd._0x4a7ec9)]['display']=_0x37fdb4(_0x5dcddd._0x28d92c),this[_0x37fdb4(_0x5dcddd._0x78976a)]=create$3('ul','mars3d-contextmenu-ul',this['_container']),this[_0x37fdb4(_0x5dcddd._0x78976a)]['id']=this[_0x37fdb4(0xe06)]+'-mars3d-contextmenu-ul';}[_0x35a251(0x97b)](){const _0x4f9fa4={_0x1f26a0:0xd79,_0x451a6c:0x851},_0x138efa=_0x35a251;this['_map']['on'](EventType[_0x138efa(0x71f)],this['_downHandler'],this),this[_0x138efa(_0x4f9fa4._0x1f26a0)]['on'](EventType[_0x138efa(_0x4f9fa4._0x451a6c)],this['_downHandler'],this),this['_map']['on'](EventType['wheel'],this['_downHandler'],this),this['_map']['on'](EventType['rightClick'],this['_rightClickHandler'],this);}['_removedHook'](){const _0x33f47e={_0x7f638:0xd79,_0x6ac46e:0x6b2},_0x1e3270=_0x35a251;this[_0x1e3270(_0x33f47e._0x7f638)][_0x1e3270(_0x33f47e._0x6ac46e)](EventType['leftDown'],this['_downHandler'],this),this['_map']['off'](EventType['middleDown'],this['_downHandler'],this),this['_map']['off'](EventType['wheel'],this['_downHandler'],this),this['_map']['off'](EventType['rightClick'],this[_0x1e3270(0xea7)],this),this['_target']=null,this['_eventResult']=null;}[_0x35a251(0x432)](_0x3e91f0){this['close']();}['_rightClickHandler'](_0x2f3b12){const _0x23b966={_0x43312e:0x6ca,_0x16904f:0x605,_0x4c93ce:0x605,_0x2c1803:0xd79},_0x44e765=_0x35a251;var _0xfcd140,_0x21567a;this[_0x44e765(0x5e9)]();if(!this['enabled'])return;if(this['_openByClick'](_0x2f3b12[_0x44e765(0x371)],_0x2f3b12))return;if(this[_0x44e765(_0x23b966._0x43312e)](_0x2f3b12['graphic'],_0x2f3b12))return;if(this['_openByClick']((_0xfcd140=_0x2f3b12['graphic'])===null||_0xfcd140===void 0x0?void 0x0:_0xfcd140[_0x44e765(_0x23b966._0x16904f)],_0x2f3b12))return;if(this['_openByClick'](_0x2f3b12[_0x44e765(0x87)],_0x2f3b12))return;if(this['_openByClick']((_0x21567a=_0x2f3b12['layer'])===null||_0x21567a===void 0x0?void 0x0:_0x21567a[_0x44e765(_0x23b966._0x4c93ce)],_0x2f3b12))return;this['_openByClick'](this[_0x44e765(_0x23b966._0x2c1803)],_0x2f3b12);}['_openByClick'](_0x4365be,_0x350dfc){const _0x2f8e94={_0x13c4a:0x606,_0x474fb1:0x26d},_0xdfe9c7=_0x35a251;if(!_0x4365be)return![];let _0x3debba=_0x4365be[_0xdfe9c7(_0x2f8e94._0x13c4a)]||_0x4365be['getContextMenu']&&_0x4365be[_0xdfe9c7(_0x2f8e94._0x474fb1)]();if(_0x3debba===![])return!![];if(!_0x3debba)return![];return _0x3debba={..._0x3debba,..._0x350dfc},this['open'](_0x350dfc['cartesian'],_0x3debba),!![];}['close'](_0x17c836,_0x5b187a){const _0x216f95={_0x161515:0x435,_0x3365f9:0x987,_0x45ea2a:0x264,_0x3e4c05:0xd79},_0x3bfda4=_0x35a251;var _0x5e735a,_0x513499,_0xf67fd4;if(this[_0x3bfda4(_0x216f95._0x161515)]===![])return;if(_0x17c836&&_0x17c836!==((_0x5e735a=this[_0x3bfda4(0x207)])===null||_0x5e735a===void 0x0?void 0x0:_0x5e735a[_0x3bfda4(0xf8c)]))return;if(_0x5b187a&&_0x5b187a!==((_0x513499=this['_eventResult'])===null||_0x513499===void 0x0?void 0x0:_0x513499['layer']))return;this[_0x3bfda4(_0x216f95._0x3365f9)]=![],(_0xf67fd4=this['target'])!==null&&_0xf67fd4!==void 0x0&&_0xf67fd4[_0x3bfda4(_0x216f95._0x45ea2a)]?this[_0x3bfda4(0xe28)]['fire'](EventType['contextMenuClose'],{},!![]):this[_0x3bfda4(_0x216f95._0x3e4c05)]['fire'](EventType[_0x3bfda4(0x29a)]);}[_0x35a251(0x8d8)](_0x29f6d7,_0x2091e6={}){const _0x2e7f52={_0x5aa276:0x5e9,_0x2fb905:0x87,_0x1cf5ba:0xf8c,_0x46972c:0x871,_0x301438:0x15d,_0x3d088b:0xe1e,_0x58d40b:0xb00,_0x4ba104:0x83a,_0x1096bf:0x3ae,_0x21f8c1:0x82e,_0x406286:0x96,_0x59c821:0xe6b,_0x5647bf:0xc86,_0x2edac9:0xfc8,_0x1e935c:0xee1},_0x474997={_0x3ece8f:0x5f4},_0x3a4be5={_0x5a32e4:0xa9b,_0x161cdb:0xc28,_0xd57051:0x264},_0x3986b5=_0x35a251;var _0x44d86a;const _0x572cc6=_0x2091e6['options']||{},_0x154d4e=_0x2091e6['content'];if(!_0x154d4e||_0x154d4e['length']===0x0){this[_0x3986b5(_0x2e7f52._0x5aa276)]();return;}const _0x1b9237=_0x2091e6['windowPosition']||Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](this['_map']['scene'],_0x29f6d7),_0x222431={..._0x2091e6,'windowPosition':_0x1b9237,'position':_0x29f6d7};_0x2091e6[_0x3986b5(_0x2e7f52._0x2fb905)]&&_0x2091e6[_0x3986b5(0x87)][_0x3986b5(0x264)]&&(_0x222431['target']=_0x2091e6['layer']);if(_0x2091e6['graphic']&&_0x2091e6['graphic']['fire']){_0x222431[_0x3986b5(0xe28)]=_0x2091e6[_0x3986b5(_0x2e7f52._0x1cf5ba)];const _0x3862d7=_0x2091e6['graphic']['parent'];_0x3862d7&&_0x3862d7['fire']&&(_0x222431[_0x3986b5(_0x2e7f52._0x46972c)]=_0x3862d7);}this['_eventResult']=_0x222431;let _0xfdce2d='';for(let _0x34047c=0x0,_0x51c5b5=_0x154d4e[_0x3986b5(0xe1e)];_0x34047c<_0x51c5b5;_0x34047c++){const _0x439405=_0x154d4e[_0x34047c],_0x50dedb=this[_0x3986b5(_0x2e7f52._0x301438)](_0x439405,_0x222431);_0x50dedb&&(_0xfdce2d+=_0x50dedb);}if(_0xfdce2d===''){this['close']();return;}this['_containerUl']['innerHTML']=_0xfdce2d;const _0x3d6b53=this[_0x3986b5(0x96)][_0x3986b5(0x82b)]('.contextmenu-item'),_0x1fcb9a=this;for(let _0x1a9fb7=0x0;_0x1a9fb7<_0x3d6b53[_0x3986b5(_0x2e7f52._0x3d088b)];_0x1a9fb7++){const _0x3a4c55=_0x3d6b53[_0x1a9fb7];_0x3a4c55['addEventListener']('click',function(_0x108cb1){const _0x2a42f5=_0x3986b5;var _0x5041ee;_0x108cb1[_0x2a42f5(0xbee)]&&_0x108cb1[_0x2a42f5(0xbee)]();const _0xace216=Number(this['getAttribute']('data-index')),_0x25258b=_0x1fcb9a['_menuObj'][_0xace216],_0x2a0c4f={..._0x222431,'data':_0x25258b},_0x3b060f=_0x25258b[_0x2a42f5(_0x3a4be5._0x5a32e4)];if(_0x3b060f){if(isFunction(_0x3b060f))_0x3b060f(_0x2a0c4f);else isString(_0x3b060f)&&(window['_contextmenuItemClickResult']=_0x2a0c4f,eval(_0x3b060f+_0x2a42f5(_0x3a4be5._0x161cdb)),delete window['_contextmenuItemClickResult']);}(_0x5041ee=_0x1fcb9a['target'])!==null&&_0x5041ee!==void 0x0&&_0x5041ee['fire']?_0x1fcb9a['target'][_0x2a42f5(0x264)](EventType['contextMenuClick'],_0x2a0c4f,!![]):_0x1fcb9a['_map'][_0x2a42f5(_0x3a4be5._0xd57051)](EventType[_0x2a42f5(0x5ae)],_0x2a0c4f);const _0x2db3d9=Number(this['getAttribute']('data-count')||0x0);_0x2db3d9===0x0&&_0x1fcb9a[_0x2a42f5(0x5e9)]();}),_0x3a4c55['addEventListener']('mouseover',function(_0x1b15df){const _0x1c93b9=_0x3986b5,_0x436af7=_0x1fcb9a[_0x1c93b9(_0x474997._0x3ece8f)]['querySelectorAll'](_0x1c93b9(0xe6b));for(let _0x19f4c5=0x0;_0x19f4c5<_0x436af7['length'];_0x19f4c5++){_0x436af7[_0x19f4c5]['style']['display']='none';}const _0x4a02d3=this['querySelector']('.mars3d-sub-menu');_0x4a02d3&&(_0x4a02d3['style']['display']='block'),removeClass(_0x1fcb9a['_containerUl']['querySelector']('.active'),_0x1c93b9(0x17a)),addClass(this,_0x1c93b9(0x17a));});}this['show']=!![],this[_0x3986b5(_0x2e7f52._0x58d40b)]=_0x222431[_0x3986b5(0xe28)];let _0x4a5213=_0x1b9237['y'],_0x37957e=_0x1b9237['x'];_0x572cc6['anchor']?(_0x37957e+=_0x572cc6['anchor'][0x0],_0x4a5213+=_0x572cc6['anchor'][0x1]):(_0x572cc6['offsetX']&&(_0x37957e+=_0x572cc6['offsetX']),_0x572cc6['offsetY']&&(_0x4a5213+=_0x572cc6[_0x3986b5(_0x2e7f52._0x4ba104)]));const _0x4f7d95=this['_container']['offsetHeight'],_0x4f89a5=this['_container'][_0x3986b5(_0x2e7f52._0x1096bf)];_0x4a5213+_0x4f7d95>this['_map']['scene']['canvas']['clientHeight']?(_0x4a5213-=_0x4f7d95-0xa,_0x4a5213<=0x0&&(_0x4a5213=0x0)):_0x4a5213+=0xa;let _0x4c1c4c=!![];_0x37957e+_0x4f89a5>this['_map']['scene']['canvas']['clientWidth']?(_0x37957e-=_0x4f89a5-0xa,_0x4c1c4c=![],_0x37957e<=0x0&&(_0x37957e=0x0)):_0x37957e+=0xa;this['_container'][_0x3986b5(0xfc8)]['left']=_0x37957e+'px',this[_0x3986b5(0x5f4)]['style'][_0x3986b5(_0x2e7f52._0x21f8c1)]=_0x4a5213+'px';const _0x5019ef=this[_0x3986b5(_0x2e7f52._0x406286)][_0x3986b5(0x82b)](_0x3986b5(_0x2e7f52._0x59c821));for(let _0x55fd7f=0x0;_0x55fd7f<_0x5019ef['length'];_0x55fd7f++){const _0x558967=_0x5019ef[_0x55fd7f],_0x42abaf=Number(_0x558967[_0x3986b5(_0x2e7f52._0x5647bf)]('data-count')||0x1)*0x22;let _0x4a7534=_0x4a5213+_0x558967[_0x3986b5(0x113)][_0x3986b5(0xb10)];_0x558967[_0x3986b5(_0x2e7f52._0x2edac9)]['top']='0',_0x558967['style']['bottom']='auto',_0x4a7534+_0x42abaf>this['_map']['scene'][_0x3986b5(_0x2e7f52._0x1e935c)][_0x3986b5(0x4e7)]&&(_0x4a7534-=_0x42abaf,_0x4a7534>0x0&&(_0x558967['style'][_0x3986b5(0x82e)]='auto',_0x558967['style']['bottom']='0')),_0x4c1c4c?_0x558967['style']['left']=_0x4f89a5+0xa+'px':_0x558967['style']['right']=_0x4f89a5+0xa+'px';}(_0x44d86a=_0x222431['target'])!==null&&_0x44d86a!==void 0x0&&_0x44d86a['fire']?_0x222431['target']['fire'](EventType['contextMenuOpen'],{},!![]):this['_map']['fire'](EventType[_0x3986b5(0xb2b)]);}[_0x35a251(0x15d)](_0x411474,_0x35d253){const _0x13eef7={_0x232db2:0xe51,_0x513b0e:0xe1e,_0x45f68d:0xdde,_0x19e653:0xce2,_0x254a49:0x15c,_0x5105ac:0x333},_0x3b3467=_0x35a251;if(_0x411474['hasOwnProperty']('show')){let _0xa65252=_0x411474[_0x3b3467(0x987)];try{_0x35d253['data']=_0x411474;if(isFunction(_0xa65252))_0xa65252=_0x411474[_0x3b3467(0x987)](_0x35d253);else isString(_0xa65252)&&(window[_0x3b3467(_0x13eef7._0x232db2)]=_0x35d253,_0xa65252=eval(_0xa65252+'(window._contextmenuItemClickShowResult)'),delete window['_contextmenuItemClickShowResult']);}catch(_0x46e195){logError$1('右键菜单操作出错',_0x46e195);}if(!_0xa65252)return;}let _0xd848f7;if(_0x411474['text']){let _0x31e7fb='',_0x3c5b2a='',_0x440742=0x0;if(_0x411474['children']){for(let _0x544a72=0x0,_0x1fc815=_0x411474['children'][_0x3b3467(_0x13eef7._0x513b0e)];_0x544a72<_0x1fc815;_0x544a72++){const _0x45cf19=_0x411474[_0x3b3467(_0x13eef7._0x45f68d)][_0x544a72];_0x35d253[_0x3b3467(_0x13eef7._0x19e653)]=_0x45cf19;const _0x452b2c=this['_getItemHtml'](_0x45cf19,_0x35d253);_0x452b2c&&(_0x31e7fb+=_0x452b2c,_0x440742++);}if(_0x440742===0x0)return;_0x31e7fb=''+_0x31e7fb+'',_0x3c5b2a='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';}this['_menuIndex']++,this['_menuObj'][this['_menuIndex']]=_0x411474;const _0x3a8ee5=this['_createIcon'](_0x411474[_0x3b3467(0x5a0)]||_0x411474['iconCls'],null,_0x3b3467(_0x13eef7._0x254a49));_0xd848f7='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3a8ee5+_0x411474['text']+_0x3c5b2a+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x31e7fb+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';}else _0xd848f7=_0x3b3467(_0x13eef7._0x5105ac);return _0xd848f7;}}register$1(_0x35a251(0x8e7),ContextMenu);class KeyboardRoam extends BaseControl{constructor(_0x187124={}){const _0x5824c7={_0x27acbe:0x72b},_0x4550eb=_0x35a251;super(_0x187124),this[_0x4550eb(_0x5824c7._0x27acbe)](_0x187124),this['flags']={'moveForward':![],'moveBackward':![],'moveUp':![],'moveDown':![],'moveLeft':![],'moveRight':![]};}get[_0x35a251(0xad0)](){return this['_moveStep'];}set[_0x35a251(0xad0)](_0x26b734){this['_moveStep']=_0x26b734;}get['dirStep'](){return this['_dirStep'];}set['dirStep'](_0x29eb8c){this['_dirStep']=_0x29eb8c;}get[_0x35a251(0xa94)](){const _0x956c1a={_0x3534fe:0x4c6},_0x188d23=_0x35a251;return this[_0x188d23(_0x956c1a._0x3534fe)];}set['rotateStep'](_0x31fd8d){const _0x47b5d6=_0x35a251;this[_0x47b5d6(0x4c6)]=_0x31fd8d;}get[_0x35a251(0x905)](){return this['_minPitch'];}set['minPitch'](_0x9c7771){this['_minPitch']=_0x9c7771;}get['maxPitch'](){const _0x46e7cb=_0x35a251;return this[_0x46e7cb(0xdb6)];}set['maxPitch'](_0x5f60a6){this['_maxPitch']=_0x5f60a6;}get[_0x35a251(0x543)](){return this['_minHeight'];}set['minHeight'](_0x31afc1){this['_minHeight']=_0x31afc1;}['setOptions'](_0x2f68ca){const _0x461cbd={_0x438a5b:0xe86,_0x18c7b6:0x645},_0x684592=_0x35a251;return this['options']={...this[_0x684592(0xe86)],..._0x2f68ca},this['_moveStep']=this[_0x684592(_0x461cbd._0x438a5b)]['moveStep']??0xa,this['_dirStep']=this[_0x684592(0xe86)]['dirStep']??0x19,this[_0x684592(0x4c6)]=this['options']['rotateStep']??0x1,this['_minPitch']=this['options']['minPitch']??0.1,this['_maxPitch']=this['options'][_0x684592(_0x461cbd._0x18c7b6)]??0.95,this['_minHeight']=this['options']['minHeight']??0x0,this;}['_addedHook'](){const _0x405a5a={_0x5ea2e6:0x7c1},_0x5a3c69=_0x35a251;this['_map']['on'](EventType['keydown'],this[_0x5a3c69(_0x405a5a._0x5ea2e6)],this),this['_map']['on'](EventType[_0x5a3c69(0x963)],this['_onKeyUp'],this),this['_map']['on'](EventType['clockTick'],this['_onClockTick'],this);}[_0x35a251(0xa9a)](){const _0x18c7f3={_0x53722d:0xd79,_0x2ea298:0x6b2},_0x1dee5c=_0x35a251;this[_0x1dee5c(0xd79)]['off'](EventType[_0x1dee5c(0x6e8)],this[_0x1dee5c(0x7c1)],this),this[_0x1dee5c(_0x18c7f3._0x53722d)][_0x1dee5c(_0x18c7f3._0x2ea298)](EventType['keyup'],this['_onKeyUp'],this),this['_map'][_0x1dee5c(0x6b2)](EventType[_0x1dee5c(0xf05)],this['_onClockTick'],this);}['_onKeyDown'](_0x1ca53e){if(!this['enabled'])return;const _0x43b284=this['_getFlagForKeyCode'](_0x1ca53e['keyCode']);typeof _0x43b284!=='undefined'&&(this['flags'][_0x43b284]=!![]);}[_0x35a251(0x714)](_0x5d2e29){const _0x425a60={_0xb7b058:0xa41},_0xb9fc0b=_0x35a251;if(!this['enabled'])return;const _0x410ab9=this['_getFlagForKeyCode'](_0x5d2e29[_0xb9fc0b(_0x425a60._0xb7b058)]);typeof _0x410ab9!=='undefined'&&(this[_0xb9fc0b(0x7f9)][_0x410ab9]=![]);}['_getFlagForKeyCode'](_0x50ea88){const _0x1a13c4={_0x5195d7:0x4a8,_0x534eb3:0xd71,_0x5c50fd:0xef,_0x2a19bd:0x4a8},_0x402134=_0x35a251;switch(_0x50ea88){case'W'[_0x402134(0x4a8)](0x0):return _0x402134(0xf04);case'S'['charCodeAt'](0x0):return'moveBackward';case'D'[_0x402134(0x4a8)](0x0):return'moveRight';case'A'[_0x402134(0x4a8)](0x0):return'moveLeft';case'Q'[_0x402134(_0x1a13c4._0x5195d7)](0x0):return'moveUp';case'E'['charCodeAt'](0x0):return'moveDown';case 0x26:this['rotateCamera'](MoveType['TOP_ROTATE']);break;case 0x25:this['rotateCamera'](MoveType['LEFT_ROTATE']);break;case 0x27:this['rotateCamera'](MoveType['RIGHT_ROTATE']);break;case 0x28:this[_0x402134(_0x1a13c4._0x534eb3)](MoveType['BOTTOM_ROTATE']);break;case'I'[_0x402134(_0x1a13c4._0x5195d7)](0x0):case 0x68:this[_0x402134(0xd2c)](MoveType[_0x402134(_0x1a13c4._0x5c50fd)]);break;case'K'['charCodeAt'](0x0):case 0x65:this[_0x402134(0xd2c)](MoveType['NARROW']);break;case'J'['charCodeAt'](0x0):case 0x64:this['moveCamera'](MoveType['LEFT_ROTATE']);break;case'L'['charCodeAt'](0x0):case 0x66:this['moveCamera'](MoveType['RIGHT_ROTATE']);break;case'U'[_0x402134(_0x1a13c4._0x2a19bd)](0x0):case 0x67:this['moveCamera'](MoveType['TOP_ROTATE']);break;case'O'['charCodeAt'](0x0):case 0x69:this[_0x402134(0xd2c)](MoveType['BOTTOM_ROTATE']);break;}return undefined;}['startMoveForward'](){const _0xc24daf={_0x4dea38:0x7f9},_0x83024a=_0x35a251;this[_0x83024a(_0xc24daf._0x4dea38)]['moveForward']=!![];}['stopMoveForward'](){const _0x52761b={_0x419f3b:0xf04},_0x9ca7e2=_0x35a251;this['flags'][_0x9ca7e2(_0x52761b._0x419f3b)]=![];}['startMoveBackward'](){const _0x29ebbc=_0x35a251;this['flags'][_0x29ebbc(0x65e)]=!![];}[_0x35a251(0xfac)](){const _0x218a74={_0x4889c2:0x65e},_0x4d8915=_0x35a251;this['flags'][_0x4d8915(_0x218a74._0x4889c2)]=![];}[_0x35a251(0xbc4)](){this['flags']['moveRight']=!![];}[_0x35a251(0xa76)](){const _0xf7ab4={_0x47962b:0x7f9},_0x4c85a6=_0x35a251;this[_0x4c85a6(_0xf7ab4._0x47962b)]['moveRight']=![];}['startMoveLeft'](){this['flags']['moveLeft']=!![];}['stopMoveLeft'](){const _0x23925d={_0x40771e:0x7f9,_0x2af59d:0xbad},_0x58ebe9=_0x35a251;this[_0x58ebe9(_0x23925d._0x40771e)][_0x58ebe9(_0x23925d._0x2af59d)]=![];}['moveForward'](_0x1f0c20){const _0x2ebc07={_0x45ae73:0xebd,_0x2bb16d:0x8eb,_0x110c38:0x8eb},_0x2665a4=_0x35a251,_0x2a53e6=this['_map']['camera'];let _0x515120=_0x2a53e6['direction'];const _0x4d0276=Cesium__namespace['Cartesian3'][_0x2665a4(_0x2ebc07._0x45ae73)](_0x2a53e6['position'],new Cesium__namespace['Cartesian3']()),_0x5dbfb4=Cesium__namespace['Cartesian3'][_0x2665a4(0x4e9)](_0x515120,_0x4d0276,new Cesium__namespace['Cartesian3']());_0x515120=Cesium__namespace['Cartesian3']['cross'](_0x4d0276,_0x5dbfb4,new Cesium__namespace[(_0x2665a4(_0x2ebc07._0x2bb16d))]()),_0x515120=Cesium__namespace[_0x2665a4(_0x2ebc07._0x110c38)]['normalize'](_0x515120,_0x515120),_0x515120=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x515120,_0x1f0c20,_0x515120),_0x2a53e6['position']=Cesium__namespace['Cartesian3']['add'](_0x2a53e6[_0x2665a4(0xb61)],_0x515120,_0x2a53e6['position']);}['_onClockTick'](_0x1964f1){const _0x567d0b={_0x35288e:0x7f9,_0x5acd2a:0x543,_0x2b7ffb:0x7f9,_0x12b57f:0xbad},_0x3ea90e=_0x35a251;if(!this['enabled'])return;const _0x318d1e=this[_0x3ea90e(0xd79)][_0x3ea90e(0x7d)],_0xa81637=this[_0x3ea90e(0xad0)];this['flags']['moveForward']&&this['moveForward'](_0xa81637),this[_0x3ea90e(_0x567d0b._0x35288e)]['moveBackward']&&this['moveForward'](-_0xa81637),this['flags']['moveUp']&&_0x318d1e['moveUp'](_0xa81637),this['flags']['moveDown']&&(_0x318d1e[_0x3ea90e(0x78e)][_0x3ea90e(0x682)]-_0xa81637>=this[_0x3ea90e(_0x567d0b._0x5acd2a)]&&_0x318d1e['moveDown'](_0xa81637)),this[_0x3ea90e(_0x567d0b._0x2b7ffb)][_0x3ea90e(_0x567d0b._0x12b57f)]&&_0x318d1e['moveLeft'](_0xa81637),this[_0x3ea90e(_0x567d0b._0x35288e)]['moveRight']&&_0x318d1e[_0x3ea90e(0x8c8)](_0xa81637);}['_resetCamera'](_0xb71b0f){const _0x25cff0={_0x1834fb:0x7d},_0x2332dc=_0x35a251;if(!_0xb71b0f)return;this['_map']['scene']['camera']['position']=_0xb71b0f['position'],this['_map']['scene'][_0x2332dc(_0x25cff0._0x1834fb)]['direction']=_0xb71b0f['direction'],this['_map']['scene']['camera'][_0x2332dc(0x296)]=_0xb71b0f[_0x2332dc(0x296)],this['_map']['scene']['camera']['up']=_0xb71b0f['up'];}[_0x35a251(0xa7c)](_0x2522ec,_0x532425,_0x571855){const _0x2e7a2f=_0x35a251,_0xfd4ca6=Cesium__namespace['Cartesian3']['dot'](_0x2522ec,Cesium__namespace['Cartesian3']['normalize'](_0x532425,new Cesium__namespace['Cartesian3']()));if(_0x571855==='up'&&_0xfd4ca6this['maxPitch'])return![];return!![];}['_computedNewPos'](_0xe5fbd8,_0x88561,_0x391765){const _0x1c4ff7={_0x51c885:0xd31,_0x9cd576:0x79b,_0xb04a9d:0x79b},_0x28676f=_0x35a251,_0x1f20a6=_0xe5fbd8['position'],_0x56998b=this[_0x28676f(0xd79)]['getCenter']();if(!_0x56998b)return;const _0x444dee=_0x56998b['toCartesian']();if(!_0x444dee)return;const _0x2e7092=Cesium__namespace['Cartesian3']['distance'](_0x444dee,_0x1f20a6);let _0x2baa64=_0x2e7092/0x64;_0x2baa64=_0x391765?_0x2baa64*this['rotateStep']:_0x2baa64;const _0xd95476={};let _0x25143b=new Cesium__namespace[(_0x28676f(_0x1c4ff7._0x51c885))](_0x1f20a6,_0x88561);_0xd95476['position']=Cesium__namespace['Ray']['getPoint'](_0x25143b,_0x2baa64),_0xd95476[_0x28676f(0x79b)]=_0xe5fbd8[_0x28676f(_0x1c4ff7._0x9cd576)],_0xd95476[_0x28676f(0x296)]=_0xe5fbd8['right'],_0xd95476['up']=_0xe5fbd8['up'];if(_0x391765){const _0x5d959d=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace[_0x28676f(0x8eb)]['subtract'](_0xd95476['position'],_0x444dee,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']());_0x25143b=new Cesium__namespace['Ray'](_0x444dee,_0x5d959d),_0xd95476[_0x28676f(0xb61)]=Cesium__namespace[_0x28676f(_0x1c4ff7._0x51c885)]['getPoint'](_0x25143b,_0x2e7092),_0xd95476[_0x28676f(_0x1c4ff7._0x9cd576)]=Cesium__namespace['Cartesian3']['negate'](_0x5d959d,new Cesium__namespace['Cartesian3']()),_0xd95476['up']=Cesium__namespace['Cartesian3'][_0x28676f(0xebd)](_0xd95476['position'],new Cesium__namespace['Cartesian3']()),_0xd95476['right']=Cesium__namespace['Cartesian3'][_0x28676f(0x4e9)](_0xd95476[_0x28676f(_0x1c4ff7._0xb04a9d)],_0xd95476['up'],new Cesium__namespace['Cartesian3']());}return _0xd95476;}['moveCamera'](_0x4241de){const _0x744427={_0x32c836:0x2ab,_0x47e852:0x33f,_0x43dc05:0xd61,_0x2bb9c6:0x8eb},_0x1fe93e=_0x35a251,_0x9f685b=this['_map']['scene']['camera'];let _0x130e33;switch(_0x4241de){case MoveType['NARROW']:_0x130e33=this['_computedNewPos'](_0x9f685b,Cesium__namespace['Cartesian3']['negate'](_0x9f685b['direction'],new Cesium__namespace['Cartesian3']()));break;case MoveType['LEFT_ROTATE']:_0x130e33=this[_0x1fe93e(_0x744427._0x32c836)](_0x9f685b,Cesium__namespace[_0x1fe93e(0x8eb)][_0x1fe93e(_0x744427._0x47e852)](_0x9f685b['right'],new Cesium__namespace['Cartesian3']()),!![]);break;case MoveType[_0x1fe93e(0x669)]:_0x130e33=this['_computedNewPos'](_0x9f685b,_0x9f685b['right'],!![]);break;case MoveType['TOP_ROTATE']:if(!this['_limitAngle'](Cesium__namespace['clone'](_0x9f685b['up']),Cesium__namespace['clone'](_0x9f685b['position']),'up'))return;_0x130e33=this['_computedNewPos'](_0x9f685b,Cesium__namespace['clone'](_0x9f685b['up']),!![]);break;case MoveType['BOTTOM_ROTATE']:if(!this['_limitAngle'](Cesium__namespace[_0x1fe93e(_0x744427._0x43dc05)](_0x9f685b['up']),Cesium__namespace[_0x1fe93e(0xd61)](_0x9f685b[_0x1fe93e(0xb61)]),'down'))return;_0x130e33=this['_computedNewPos'](_0x9f685b,Cesium__namespace[_0x1fe93e(_0x744427._0x2bb9c6)]['negate'](_0x9f685b['up'],new Cesium__namespace['Cartesian3']()),!![]);break;case MoveType['ENLARGE']:default:_0x130e33=this[_0x1fe93e(0x2ab)](_0x9f685b,_0x9f685b['direction']);break;}if(!_0x130e33)return;this[_0x1fe93e(0xb24)](_0x130e33);}['rotateCamera'](_0x4e81ba){const _0x3d0be0={_0x1fefe1:0xd79,_0x38e472:0xc60,_0x117bb3:0x667,_0xa9252:0xb98,_0x44e530:0x388,_0x2382f2:0x7d,_0x1ce09c:0x412,_0x1bd319:0x4e9},_0x2dda75=_0x35a251;let _0x5db1ae=[0x0,0x0];const _0x543d37=this['_map']['scene'][_0x2dda75(0xee1)]['clientWidth'],_0xe7ee70=this[_0x2dda75(_0x3d0be0._0x1fefe1)][_0x2dda75(_0x3d0be0._0x38e472)]['canvas']['clientHeight'],_0x5e451f=(_0x543d37+_0xe7ee70)/this[_0x2dda75(0xa1b)];switch(_0x4e81ba){case MoveType[_0x2dda75(_0x3d0be0._0x117bb3)]:_0x5db1ae=[-_0x5e451f*_0x543d37/_0xe7ee70,0x0];break;case MoveType['RIGHT_ROTATE']:_0x5db1ae=[_0x5e451f*_0x543d37/_0xe7ee70,0x0];break;case MoveType[_0x2dda75(_0x3d0be0._0xa9252)]:_0x5db1ae=[0x0,_0x5e451f];break;case MoveType[_0x2dda75(_0x3d0be0._0x44e530)]:_0x5db1ae=[0x0,-_0x5e451f];break;default:return;}const _0x5adfbc=_0x5db1ae[0x0]/_0x543d37,_0x31e486=_0x5db1ae[0x1]/_0xe7ee70,_0xf4806e=0.05,_0x242220=this['_map'][_0x2dda75(_0x3d0be0._0x2382f2)];_0x242220[_0x2dda75(_0x3d0be0._0x1ce09c)](_0x5adfbc*_0xf4806e),_0x242220['lookUp'](_0x31e486*_0xf4806e);const _0x3d8d67=_0x242220['direction'];let _0x4d9e97=Cesium__namespace[_0x2dda75(0x8eb)][_0x2dda75(0xebd)](_0x242220['position'],new Cesium__namespace['Cartesian3']());const _0x335b90=Cesium__namespace[_0x2dda75(0x8eb)]['cross'](_0x3d8d67,_0x4d9e97,new Cesium__namespace['Cartesian3']());_0x4d9e97=Cesium__namespace['Cartesian3'][_0x2dda75(_0x3d0be0._0x1bd319)](_0x335b90,_0x3d8d67,new Cesium__namespace['Cartesian3']()),_0x242220['up']=_0x4d9e97,_0x242220['right']=_0x335b90;}}register$1('keyboardRoam',KeyboardRoam),KeyboardRoam['MoveType']=MoveType;function getDefaultContextMenu(_0x3b79aa){const _0x2e34fd={_0x4fe803:0xb91,_0x13545f:0x44e,_0x3a5240:0x6c3,_0x48b22d:0xe85,_0x476849:0x364,_0x4f18e4:0xfd,_0x36e83e:0x2f2,_0x4242d0:0xf1,_0x1456d8:0x44e,_0x3a0c53:0xee7,_0x1442c5:0x93c,_0x416937:0xdb3,_0x453ed2:0x8a3,_0x3ab2ba:0xd8b,_0x5f2161:0x321,_0x38f4d4:0x7a9,_0x350bad:0x934,_0x44cedc:0x5db,_0x37cf39:0x44e,_0x1b2825:0x44e,_0x17c34b:0x2fb},_0x2b9ff4={_0x480b52:0x314},_0x5d7a72={_0x17c1d0:0x8d3,_0x4d3c2f:0xb5d,_0x4651fb:0x9c7,_0x5bd091:0xef4},_0x251924={_0x28cea4:0x7a6},_0x54969f={_0x2f9a29:0x529},_0x443326={_0x2a01f4:0xc60},_0x30cb60={_0xa90f51:0x449,_0x3c78b9:0x987,_0x49c77a:0x5b5,_0xba7b7d:0xc60},_0xa1b662={_0x336b08:0x895},_0x2ab4e3={_0x4af6dd:0xc60},_0x34ac82={_0x46a11b:0x4ef},_0x4b2632={_0x55fb04:0x499},_0x374722={_0x294f94:0x1c6},_0x23f196={_0x4d23f8:0x573},_0x4a899a={_0x2d47a1:0xa60,_0x3e5e38:0xa60},_0x5a11b1={_0x1e2518:0xa60},_0xc6bbc1={_0x624656:0xfaa,_0x5a6028:0xb4a},_0x1966c4={_0x274cbf:0x78e},_0x4a7c6d={_0x3c5a0f:0xb4a},_0x3dd81e={_0x3536e5:0x397},_0xdd3412={_0x2d5591:0x3b0},_0xe7f720={_0x37e286:0xfaa},_0x2abcf4={_0x351e1c:0x399},_0x170edc={_0x10f1f5:0x3e1},_0x1a9f31={_0x475fec:0x3e1},_0x31ffcc={_0x1538aa:0x310},_0x1742ad={_0x5d63ee:0x3e1},_0x1d29ab={_0x5193db:0x3a8},_0x3b14e0={_0xd2ae81:0x282},_0x40ae21={_0x97dfec:0x310},_0x257148={_0x5191c6:0x3e1},_0x2a617d={_0x542807:0x10b},_0x5e8ccb={_0x76d7f6:0xc2d},_0x1b4a50={_0x157071:0x10b,_0x21d927:0x60a,_0x2bc10c:0x2c9},_0x84e3bc={_0x4029c2:0x6ab},_0x1ded81={_0x28e602:0x10b},_0x4a4a29={_0x9df0b0:0x947},_0xd89118={_0x1b24c4:0xf40},_0x39144d={_0x3e392e:0x2df},_0x2688f3={_0x47b888:0xf70},_0x4ecd11={_0x8561c1:0x4bb},_0x2f586d={_0x2e66cb:0xec6},_0x2c0dc5={_0x506fba:0xf8c},_0x746f4={_0xa28c8a:0xbd4,_0x21552f:0x13a},_0xba47fc={_0x3e8e7e:0x4bb},_0x1c2e17={_0x528c17:0x4bb},_0xac97d4={_0x250ec0:0xeed,_0x563c20:0x4bb,_0x45fe8b:0x4bb},_0x5e95bf={_0x464b1e:0x4bb},_0x2c2a1d={_0x1747f3:0x4bb,_0x3e3cdc:0x5dd},_0x251567={_0x24092c:0x90d},_0x5e8b1b={_0x364e4d:0x78a,_0x564e03:0x44e},_0x5175a8={_0x2ae141:0x772,_0x6b3a16:0xb9d,_0x118a86:0x5d2,_0x2f5587:0x4bb},_0x52d020={_0x1da8a6:0x4bb},_0x1fc47d=_0x35a251,_0x57c0fb=_0x3b79aa[_0x1fc47d(_0x2e34fd._0x4fe803)];return[{'text':_0x3b79aa['getLangText']('_查看此处坐标'),'icon':Icon['Coordinates'],'show':function(_0x866efc){const _0x50d173=_0x1fc47d;return Cesium__namespace['defined'](_0x866efc[_0x50d173(_0x52d020._0x1da8a6)]);},'callback':function(_0x251d33){const _0x5d9ac3=_0x1fc47d,_0x5b2eb6=LngLatPoint[_0x5d9ac3(0x9b1)](_0x251d33['cartesian']),_0x588c84=proj4Trans([_0x5b2eb6['lng'],_0x5b2eb6['lat']],'EPSG:4326',CRS['CGCS2000_GK_Zone_3']),_0x24b6a3=_0x5d9ac3(0x6b0)+_0x3b79aa[_0x5d9ac3(0x44e)](_0x5d9ac3(0xd27))+':'+_0x5b2eb6['lng']+',\x20'+_0x3b79aa['getLangText'](_0x5d9ac3(_0x5175a8._0x2ae141))+':'+_0x5b2eb6[_0x5d9ac3(_0x5175a8._0x6b3a16)]+',\x20'+_0x3b79aa['getLangText']('_海拔')+':'+_0x5b2eb6[_0x5d9ac3(_0x5175a8._0x118a86)]+',\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3b79aa['getLangText']('_横坐标')+':'+_0x588c84[0x0]['toFixed'](0x1)+',\x20'+_0x3b79aa['getLangText']('_纵坐标')+':'+_0x588c84[0x1]['toFixed'](0x1)+'\x20(CGCS2000)\x0a\x20\x20\x20\x20\x20\x20\x20\x20';alert(_0x24b6a3,_0x3b79aa['getLangText']('_位置信息'));const _0x290d9b=formatNum$1(_0x251d33[_0x5d9ac3(_0x5175a8._0x2f5587)]['x'],0x1),_0x1473fc=formatNum$1(_0x251d33['cartesian']['y'],0x1),_0x22d2e3=formatNum$1(_0x251d33[_0x5d9ac3(0x4bb)]['z'],0x1);logInfo('经纬度:'+_0x5b2eb6['toString']()+'\x20,\x20笛卡尔:'+_0x290d9b+','+_0x1473fc+','+_0x22d2e3);}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x13545f)](_0x1fc47d(0xafd)),'icon':Icon['CameraInfo'],'callback':function(_0x1a8f48){const _0x1daf53=_0x1fc47d,_0xf31892=JSON['stringify'](_0x3b79aa[_0x1daf53(_0x5e8b1b._0x364e4d)]());logInfo(_0xf31892),alert(_0xf31892,_0x3b79aa[_0x1daf53(_0x5e8b1b._0x564e03)]('_当前视角信息'));}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x13545f)]('_视角切换'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x3a5240)],'children':[{'text':_0x3b79aa['getLangText']('_允许进入地下'),'icon':Icon['UndergroundYes'],'show':function(_0xff3146){const _0x376b6c=_0x1fc47d;return _0x3b79aa['scene']['screenSpaceCameraController'][_0x376b6c(_0x251567._0x24092c)];},'callback':function(_0xb9a89c){_0x3b79aa['scene']['screenSpaceCameraController']['enableCollisionDetection']=![];}},{'text':_0x3b79aa['getLangText']('_禁止进入地下'),'icon':Icon['UndergroundNo'],'show':function(_0xda7d48){const _0x14a096=_0x1fc47d;return!_0x3b79aa['scene']['screenSpaceCameraController'][_0x14a096(0x90d)];},'callback':function(_0x2013a2){_0x3b79aa['scene']['screenSpaceCameraController']['enableCollisionDetection']=!![];}},{'text':_0x3b79aa['getLangText']('_绕此处环绕飞行'),'icon':Icon['RotatePointStart'],'show':function(_0x294056){const _0x4db970=_0x1fc47d;var _0x390645;return _0x294056[_0x4db970(_0x2c2a1d._0x1747f3)]&&(!_0x57c0fb['rotatePoint']||!((_0x390645=_0x57c0fb['rotatePoint'])!==null&&_0x390645!==void 0x0&&_0x390645[_0x4db970(_0x2c2a1d._0x3e3cdc)]));},'callback':function(_0x248513){const _0x1448ff=_0x1fc47d;!_0x57c0fb['rotatePoint']&&(_0x57c0fb['rotatePoint']=new RotatePoint(),_0x3b79aa[_0x1448ff(0x60a)](_0x57c0fb['rotatePoint'])),_0x57c0fb['rotatePoint']['start'](_0x248513['cartesian']);}},{'text':_0x3b79aa[_0x1fc47d(0x44e)](_0x1fc47d(0xb8b)),'icon':Icon['RotatePointStop'],'show':function(_0x27e8f6){var _0x2a8211;return(_0x2a8211=_0x57c0fb['rotatePoint'])===null||_0x2a8211===void 0x0?void 0x0:_0x2a8211['isStart'];},'callback':function(_0xc6712c){_0x57c0fb['rotatePoint']&&_0x57c0fb['rotatePoint']['stop']();}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x48b22d)),'icon':Icon[_0x1fc47d(0x2ea)],'show':function(_0x10528e){const _0x487a10=_0x1fc47d;return Cesium__namespace['defined'](_0x10528e[_0x487a10(_0x5e95bf._0x464b1e)]);},'callback':function(_0x47cf6c){const _0x83af25=_0x1fc47d,_0xa4e18c=Cesium__namespace['Cartesian3'][_0x83af25(_0xac97d4._0x250ec0)](_0x47cf6c[_0x83af25(_0xac97d4._0x563c20)],_0x3b79aa['camera']['positionWC'])*0.1;_0x3b79aa['flyToPoint'](_0x47cf6c[_0x83af25(_0xac97d4._0x45fe8b)],{'radius':_0xa4e18c,'maximumHeight':_0x3b79aa[_0x83af25(0x7d)]['positionCartographic']['height']});}},{'text':_0x3b79aa['getLangText']('_第一视角站到此处'),'icon':Icon['FirstPerspective'],'show':function(_0x4fabc9){const _0x13bf4f=_0x1fc47d;return Cesium__namespace['defined'](_0x4fabc9[_0x13bf4f(_0x1c2e17._0x528c17)]);},'callback':function(_0x3f5dcd){const _0x15aca5=_0x1fc47d;_0x3b79aa['camera']['flyTo']({'destination':addPositionsHeight(_0x3f5dcd[_0x15aca5(_0xba47fc._0x3e8e7e)],0xa),'orientation':{'heading':_0x3b79aa['camera']['heading'],'pitch':0x0,'roll':0x0},'maximumHeight':_0x3b79aa['camera']['positionCartographic']['height']});}},{'text':_0x3b79aa['getLangText']('_开启键盘漫游'),'icon':Icon['KeyboardRoamYes'],'show':function(_0x2d4503){return!_0x3b79aa['keyboardRoam']['enabled'];},'callback':function(_0x4ea8f3){const _0x423e1e=_0x1fc47d;_0x3b79aa['keyboardRoam'][_0x423e1e(0x2a6)]=!![];}},{'text':_0x3b79aa['getLangText']('_关闭键盘漫游'),'icon':Icon['KeyboardRoamNo'],'show':function(_0x5cf01f){const _0x52e9ed=_0x1fc47d;return _0x3b79aa['keyboardRoam'][_0x52e9ed(0x2a6)];},'callback':function(_0x3f97a1){const _0x4cb8fc=_0x1fc47d;_0x3b79aa[_0x4cb8fc(0xa57)]['enabled']=![];}},{'text':_0x3b79aa[_0x1fc47d(0x44e)]('_跟踪锁定'),'icon':Icon['TrackedEntityYes'],'show':function(_0x4c8dc2){const _0x518034=_0x1fc47d,_0x5636b8=_0x4c8dc2['graphic'];if(!_0x5636b8)return![];if(_0x5636b8[_0x518034(_0x746f4._0xa28c8a)]instanceof Cesium__namespace['Entity'])return!![];else{if(_0x5636b8['trackedEntity']instanceof Cesium__namespace[_0x518034(_0x746f4._0x21552f)])return!![];}return![];},'callback':function(_0x57b140){const _0x947ab3=_0x1fc47d;_0x3b79aa[_0x947ab3(0xec6)]=_0x57b140[_0x947ab3(_0x2c0dc5._0x506fba)];}},{'text':_0x3b79aa['getLangText']('_取消锁定'),'icon':Icon['TrackedEntityNo'],'show':function(_0x807613){return _0x3b79aa['trackedEntity']!==undefined;},'callback':function(_0x36be34){const _0x32025a=_0x1fc47d;_0x3b79aa[_0x32025a(_0x2f586d._0x2e66cb)]=undefined;}}]},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x476849)),'icon':Icon[_0x1fc47d(0xcda)],'show':function(_0x1bb55f){const _0x2f79e6=_0x1fc47d,_0x5e5b3e=_0x3b79aa['pick3DTileset'](_0x1bb55f[_0x2f79e6(0x4bb)]);return Cesium__namespace[_0x2f79e6(0xaa2)](_0x5e5b3e);},'children':[{'text':_0x3b79aa['getLangText']('_显示三角网'),'icon':Icon['TilesetWireframeYes'],'show':function(_0x5eb158){const _0x1c7679=_0x3b79aa['pick3DTileset'](_0x5eb158['cartesian']);return!_0x1c7679['debugWireframe']&&_0x1c7679['_enableDebugWireframe'];},'callback':function(_0x49aed3){const _0x486dc2=_0x3b79aa['pick3DTileset'](_0x49aed3['cartesian']);_0x486dc2['debugWireframe']=!![];}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0x444)),'icon':Icon['TilesetWireframeNo'],'show':function(_0x2acbdc){const _0x4d71fe=_0x3b79aa['pick3DTileset'](_0x2acbdc['cartesian']);return _0x4d71fe['debugWireframe']&&_0x4d71fe['_enableDebugWireframe'];},'callback':function(_0x52333f){const _0x3a03e3=_0x3b79aa['pick3DTileset'](_0x52333f['cartesian']);_0x3a03e3['debugWireframe']=![];}},{'text':_0x3b79aa['getLangText']('_显示包围盒'),'icon':Icon['TilesetBoundingVolumeYes'],'show':function(_0x159033){const _0x54d4a7=_0x1fc47d,_0xa34f1b=_0x3b79aa['pick3DTileset'](_0x159033[_0x54d4a7(0x4bb)]);return!_0xa34f1b['debugShowBoundingVolume'];},'callback':function(_0x4eb86c){const _0x3ea243=_0x1fc47d,_0x10af99=_0x3b79aa['pick3DTileset'](_0x4eb86c[_0x3ea243(_0x4ecd11._0x8561c1)]);_0x10af99['debugShowBoundingVolume']=!![];}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0xc36)),'icon':Icon['TilesetBoundingVolumeNo'],'show':function(_0x4426be){const _0x182403=_0x1fc47d,_0x39df3a=_0x3b79aa[_0x182403(_0x2688f3._0x47b888)](_0x4426be['cartesian']);return _0x39df3a['debugShowBoundingVolume'];},'callback':function(_0x2e2be3){const _0x5d79ff=_0x1fc47d,_0x29a0dd=_0x3b79aa[_0x5d79ff(0xf70)](_0x2e2be3['cartesian']);_0x29a0dd['debugShowBoundingVolume']=![];}}]},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x4f18e4)),'icon':Icon['Terrain'],'show':function(_0x4107d6){return Cesium__namespace['defined'](_0x4107d6['cartesian']);},'children':[{'text':_0x3b79aa[_0x1fc47d(0x44e)]('_开启地形'),'icon':Icon['TerrainYes'],'show':function(_0x2496d0){return!_0x3b79aa['hasTerrain'];},'callback':function(_0x3800ce){const _0x1cf1a2=_0x1fc47d;_0x3b79aa[_0x1cf1a2(0x234)]=!![];}},{'text':_0x3b79aa['getLangText']('_关闭地形'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x36e83e)],'show':function(_0x5231f4){return _0x3b79aa['hasTerrain'];},'callback':function(_0x114d23){_0x3b79aa['hasTerrain']=![];}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x4242d0)),'icon':Icon['TerrainWireframeYes'],'show':function(_0x526fd8){const _0x5398d1=_0x1fc47d;return!_0x3b79aa['scene'][_0x5398d1(0x22f)]['_surface'][_0x5398d1(_0x39144d._0x3e392e)]['_debug'][_0x5398d1(0xb25)];},'callback':function(_0x29b951){const _0x1b16a9=_0x1fc47d;_0x3b79aa['scene']['globe'][_0x1b16a9(_0xd89118._0x1b24c4)][_0x1b16a9(0x2df)]['_debug']['wireframe']=!![];}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0x444)),'icon':Icon['TerrainWireframeNo'],'show':function(_0x17cd24){const _0x2feff8=_0x1fc47d;return _0x3b79aa['scene']['globe']['_surface'][_0x2feff8(0x2df)][_0x2feff8(_0x4a4a29._0x9df0b0)][_0x2feff8(0xb25)];},'callback':function(_0x28a730){const _0x4ba03e=_0x1fc47d;_0x3b79aa['scene']['globe']['_surface']['tileProvider']['_debug'][_0x4ba03e(0xb25)]=![];}}]},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x1456d8)]('_图上量算'),'icon':Icon['Measure'],'children':[{'text':_0x3b79aa['getLangText']('_距离'),'icon':Icon['MeasureDistance'],'callback':function(_0x184674){const _0x111f4a=_0x1fc47d;!_0x57c0fb['measure']&&(_0x57c0fb[_0x111f4a(_0x1ded81._0x28e602)]=new Measure(),_0x3b79aa['addThing'](_0x57c0fb[_0x111f4a(0x10b)])),_0x57c0fb['measure'][_0x111f4a(0xeed)]();}},{'text':_0x3b79aa['getLangText']('_面积'),'icon':Icon['MeasureArea'],'callback':function(_0x7aa43b){!_0x57c0fb['measure']&&(_0x57c0fb['measure']=new Measure(),_0x3b79aa['addThing'](_0x57c0fb['measure'])),_0x57c0fb['measure']['area']();}},{'text':_0x3b79aa['getLangText']('_高度差'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x3a0c53)],'callback':function(_0x3c10f5){const _0x23ff80=_0x1fc47d;!_0x57c0fb['measure']&&(_0x57c0fb[_0x23ff80(0x10b)]=new Measure(),_0x3b79aa[_0x23ff80(0x60a)](_0x57c0fb['measure'])),_0x57c0fb['measure'][_0x23ff80(_0x84e3bc._0x4029c2)]();}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0xb6c)),'icon':Icon['MeasureAngle'],'callback':function(_0x29464a){const _0x32415f=_0x1fc47d;!_0x57c0fb['measure']&&(_0x57c0fb[_0x32415f(_0x1b4a50._0x157071)]=new Measure(),_0x3b79aa[_0x32415f(_0x1b4a50._0x21d927)](_0x57c0fb['measure'])),_0x57c0fb['measure'][_0x32415f(_0x1b4a50._0x2bc10c)]();}},{'text':_0x3b79aa['getLangText']('_删除测量'),'icon':Icon['Delete'],'show':function(_0xeff061){const _0x79634f=_0x1fc47d;return _0x57c0fb['measure']&&_0x57c0fb['measure'][_0x79634f(_0x5e8ccb._0x76d7f6)];},'callback':function(_0x46b455){const _0x216216=_0x1fc47d;_0x57c0fb[_0x216216(_0x2a617d._0x542807)]&&_0x57c0fb['measure']['clear']();}}]},{'text':_0x3b79aa['getLangText']('_图上标记'),'icon':Icon[_0x1fc47d(0xc11)],'children':[{'text':_0x3b79aa['getLangText']('_标记点'),'icon':Icon['DrawPoint'],'callback':function(_0x59fa03){const _0x5eb86e=_0x1fc47d;_0x3b79aa[_0x5eb86e(_0x257148._0x5191c6)]['startDraw']({'type':'point','style':{'pixelSize':0xc,'color':'#3388ff'},'success':function(_0x55ea21){console['log'](JSON['stringify'](_0x55ea21['coordinates']));}});}},{'text':_0x3b79aa['getLangText']('_标记线'),'icon':Icon['DrawPolyline'],'callback':function(_0x2a0da4){const _0x4138b5=_0x1fc47d;_0x3b79aa['graphicLayer']['startDraw']({'type':_0x4138b5(_0x3b14e0._0xd2ae81),'style':{'color':'#55ff33','width':0x3},'success':function(_0x34ce0c){const _0x146abd=_0x4138b5;console['log'](JSON['stringify'](_0x34ce0c[_0x146abd(_0x40ae21._0x97dfec)]));}});}},{'text':_0x3b79aa['getLangText']('_标记面'),'icon':Icon['DrawPolygon'],'callback':function(_0x11df49){const _0x2f0de1=_0x1fc47d;_0x3b79aa[_0x2f0de1(_0x1742ad._0x5d63ee)]['startDraw']({'type':'polygon','style':{'color':'#29cf34','opacity':0.5,'outline':!![],'outlineWidth':0x2},'success':function(_0x5c1b0c){const _0x11c274=_0x2f0de1;console[_0x11c274(_0x1d29ab._0x5193db)](JSON[_0x11c274(0x1e6)](_0x5c1b0c['coordinates']));}});}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0x1d3)),'icon':Icon[_0x1fc47d(0xfb6)],'callback':function(_0x442b41){const _0x499dd5=_0x1fc47d;_0x3b79aa['graphicLayer']['startDraw']({'type':'circle','style':{'color':_0x499dd5(0x3bf),'opacity':0.6},'success':function(_0x152b3b){const _0x53a3bd=_0x499dd5;console['log'](JSON[_0x53a3bd(0x1e6)](_0x152b3b[_0x53a3bd(_0x31ffcc._0x1538aa)]));}});}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x13545f)]('_标记矩形'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x1442c5)],'callback':function(_0x51dcf){const _0x397aaa=_0x1fc47d;_0x3b79aa['graphicLayer']['startDraw']({'type':_0x397aaa(0xab1),'style':{'color':'#ffff00','opacity':0.6},'success':function(_0x372142){console['log'](JSON['stringify'](_0x372142['coordinates']));}});}},{'text':_0x3b79aa['getLangText']('_允许编辑'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x416937)],'show':function(_0x48e359){const _0x21020a=_0x1fc47d;return!_0x3b79aa[_0x21020a(_0x1a9f31._0x475fec)]['hasEdit'];},'callback':function(_0x35aa58){const _0x3ed663=_0x1fc47d;_0x3b79aa['graphicLayer'][_0x3ed663(0xb70)]=!![];}},{'text':_0x3b79aa['getLangText']('_禁止编辑'),'icon':Icon['DrawEditNo'],'show':function(_0x2ef7d6){const _0x244dbc=_0x1fc47d;return _0x3b79aa[_0x244dbc(_0x170edc._0x10f1f5)]['hasEdit'];},'callback':function(_0x3815f8){const _0x323560=_0x1fc47d;_0x3b79aa[_0x323560(0x3e1)]['hasEdit']=![];}},{'text':_0x3b79aa['getLangText']('_导出GeoJSON'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x453ed2)],'show':function(_0x7b5a4){const _0x4c48f1=_0x1fc47d;return _0x3b79aa[_0x4c48f1(0x3e1)]['length']>0x0;},'callback':function(_0x3afb02){downloadFile('图上标记.json',JSON['stringify'](_0x3b79aa['graphicLayer']['toGeoJSON']()));}},{'text':_0x3b79aa['getLangText']('_清除所有标记'),'icon':Icon['Delete'],'show':function(_0x15e6f3){const _0x1bc1d4=_0x1fc47d;return _0x3b79aa[_0x1bc1d4(0x3e1)]['length']>0x0;},'callback':function(_0x195a26){const _0x253cfe=_0x1fc47d;_0x3b79aa['graphicLayer'][_0x253cfe(0x386)]();}}]},{'text':_0x3b79aa['getLangText']('_特效效果'),'icon':Icon[_0x1fc47d(0x9a9)],'children':[{'text':_0x3b79aa['getLangText']('_开启下雨'),'icon':Icon[_0x1fc47d(0xd95)],'show':function(_0x481315){return!_0x57c0fb['rainEffect'];},'callback':function(_0x26462a){const _0x14725b=_0x1fc47d;!_0x57c0fb[_0x14725b(_0x2abcf4._0x351e1c)]&&(_0x57c0fb['rainEffect']=new RainEffect(),_0x3b79aa['addEffect'](_0x57c0fb['rainEffect']));}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x3ab2ba)),'icon':Icon['RainEffectNo'],'show':function(_0x28d9fb){return _0x57c0fb['rainEffect'];},'callback':function(_0x510281){const _0x6dc122=_0x1fc47d;_0x57c0fb['rainEffect']&&(_0x3b79aa[_0x6dc122(_0xe7f720._0x37e286)](_0x57c0fb[_0x6dc122(0x399)],!![]),delete _0x57c0fb['rainEffect']);}},{'text':_0x3b79aa['getLangText']('_开启下雪'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x5f2161)],'show':function(_0x45092f){const _0x7939fc=_0x1fc47d;return!_0x57c0fb[_0x7939fc(0x397)];},'callback':function(_0x2502af){const _0x57492e=_0x1fc47d;!_0x57c0fb['snowEffect']&&(_0x57c0fb['snowEffect']=new SnowEffect(),_0x3b79aa[_0x57492e(_0xdd3412._0x2d5591)](_0x57c0fb['snowEffect']));}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(_0x2e34fd._0x38f4d4)),'icon':Icon[_0x1fc47d(_0x2e34fd._0x350bad)],'show':function(_0x4625de){return _0x57c0fb['snowEffect'];},'callback':function(_0x423b1f){const _0x3a49c5=_0x1fc47d;_0x57c0fb[_0x3a49c5(0x397)]&&(_0x3b79aa[_0x3a49c5(0xfaa)](_0x57c0fb['snowEffect'],!![]),delete _0x57c0fb[_0x3a49c5(_0x3dd81e._0x3536e5)]);}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x1456d8)]('_开启雾天气'),'icon':Icon['FogEffectYes'],'show':function(_0x2dbb56){const _0x179b86=_0x1fc47d;return!_0x57c0fb[_0x179b86(_0x4a7c6d._0x3c5a0f)];},'callback':function(_0x3aae59){const _0x4d9905=_0x1fc47d;if(!_0x57c0fb['fogEffect']){const _0x1ffadb=_0x3b79aa['camera'][_0x4d9905(_0x1966c4._0x274cbf)][_0x4d9905(0x682)]*0x2;_0x57c0fb['fogEffect']=new FogEffect({'fogByDistance':new Cesium__namespace['Cartesian4'](0.1*_0x1ffadb,0.1,_0x1ffadb,0.8)}),_0x3b79aa['addEffect'](_0x57c0fb['fogEffect']);}}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x13545f)]('_关闭雾天气'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x44cedc)],'show':function(_0x4305e3){return _0x57c0fb['fogEffect'];},'callback':function(_0x297899){const _0x4fbc76=_0x1fc47d;_0x57c0fb['fogEffect']&&(_0x3b79aa[_0x4fbc76(_0xc6bbc1._0x624656)](_0x57c0fb[_0x4fbc76(0xb4a)],!![]),delete _0x57c0fb[_0x4fbc76(_0xc6bbc1._0x5a6028)]);}},{'text':_0x3b79aa['getLangText']('_开启泛光'),'icon':Icon[_0x1fc47d(0xf0f)],'show':function(_0x587d3a){const _0x4a3f05=_0x1fc47d;return!_0x57c0fb[_0x4a3f05(_0x5a11b1._0x1e2518)];},'callback':function(_0x3b5573){const _0x58f852=_0x1fc47d;!_0x57c0fb['bloomEffect']&&(_0x57c0fb[_0x58f852(_0x4a899a._0x2d47a1)]=new BloomEffect(),_0x3b79aa['addEffect'](_0x57c0fb[_0x58f852(_0x4a899a._0x3e5e38)]));}},{'text':_0x3b79aa['getLangText']('_关闭泛光'),'icon':Icon['BloomEffectNo'],'show':function(_0xec6b){return _0x57c0fb['bloomEffect'];},'callback':function(_0x18a438){_0x57c0fb['bloomEffect']&&(_0x3b79aa['removeEffect'](_0x57c0fb['bloomEffect'],!![]),delete _0x57c0fb['bloomEffect']);}},{'text':_0x3b79aa['getLangText']('_开启亮度'),'icon':Icon['BrightnessEffectYes'],'show':function(_0xc673bb){return!_0x57c0fb['brightnessEffect'];},'callback':function(_0x16417f){!_0x57c0fb['brightnessEffect']&&(_0x57c0fb['brightnessEffect']=new BrightnessEffect(),_0x3b79aa['addEffect'](_0x57c0fb['brightnessEffect']));}},{'text':_0x3b79aa[_0x1fc47d(0x44e)]('_关闭亮度'),'icon':Icon['BrightnessEffectNo'],'show':function(_0x5617e7){return _0x57c0fb['brightnessEffect'];},'callback':function(_0x37dd24){const _0x5e1f6f=_0x1fc47d;_0x57c0fb['brightnessEffect']&&(_0x3b79aa['removeEffect'](_0x57c0fb[_0x5e1f6f(0x573)],!![]),delete _0x57c0fb[_0x5e1f6f(_0x23f196._0x4d23f8)]);}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x37cf39)]('_开启夜视'),'icon':Icon['NightVisionEffectYes'],'show':function(_0x5b27c1){return!_0x57c0fb['nightVisionEffect'];},'callback':function(_0xfb83bf){!_0x57c0fb['nightVisionEffect']&&(_0x57c0fb['nightVisionEffect']=new NightVisionEffect(),_0x3b79aa['addEffect'](_0x57c0fb['nightVisionEffect']));}},{'text':_0x3b79aa['getLangText']('_关闭夜视'),'icon':Icon['NightVisionEffectNo'],'show':function(_0x2a3658){return _0x57c0fb['nightVisionEffect'];},'callback':function(_0x22affa){const _0x7ebed2=_0x1fc47d;_0x57c0fb['nightVisionEffect']&&(_0x3b79aa['removeEffect'](_0x57c0fb['nightVisionEffect'],!![]),delete _0x57c0fb[_0x7ebed2(_0x374722._0x294f94)]);}},{'text':_0x3b79aa[_0x1fc47d(_0x2e34fd._0x1b2825)](_0x1fc47d(0xfb7)),'icon':Icon[_0x1fc47d(0xa30)],'show':function(_0x1f0fdd){const _0x134649=_0x1fc47d;return!_0x57c0fb[_0x134649(_0x4b2632._0x55fb04)];},'callback':function(_0x4e37a9){const _0x3a80cd=_0x1fc47d;!_0x57c0fb['blackAndWhiteEffect']&&(_0x57c0fb['blackAndWhiteEffect']=new BlackAndWhiteEffect(),_0x3b79aa[_0x3a80cd(0x3b0)](_0x57c0fb['blackAndWhiteEffect']));}},{'text':_0x3b79aa['getLangText'](_0x1fc47d(0x51b)),'icon':Icon['BlackAndWhiteEffectNo'],'show':function(_0xe6211){return _0x57c0fb['blackAndWhiteEffect'];},'callback':function(_0x4c1e93){_0x57c0fb['blackAndWhiteEffect']&&(_0x3b79aa['removeEffect'](_0x57c0fb['blackAndWhiteEffect'],!![]),delete _0x57c0fb['blackAndWhiteEffect']);}},{'text':_0x3b79aa['getLangText']('_开启拾取高亮'),'icon':Icon['OutlineEffectYes'],'show':function(_0x2093df){const _0x2974d0=_0x1fc47d;return!_0x57c0fb[_0x2974d0(_0x34ac82._0x46a11b)];},'callback':function(_0x2a016b){const _0x4290d8=_0x1fc47d;!_0x57c0fb[_0x4290d8(0x4ef)]&&(_0x57c0fb['outlineEffect']=new OutlineEffect(),_0x3b79aa['addEffect'](_0x57c0fb['outlineEffect']));}},{'text':_0x3b79aa['getLangText']('_关闭拾取高亮'),'icon':Icon['OutlineEffectNo'],'show':function(_0x5655c8){return _0x57c0fb['outlineEffect'];},'callback':function(_0x3b38ec){_0x57c0fb['outlineEffect']&&(_0x3b79aa['removeEffect'](_0x57c0fb['outlineEffect'],!![]),delete _0x57c0fb['outlineEffect']);}}]},{'text':_0x3b79aa['getLangText']('_场景设置'),'icon':Icon['Scene'],'children':[{'text':_0x3b79aa['getLangText']('_开启深度监测'),'icon':Icon[_0x1fc47d(_0x2e34fd._0x17c34b)],'show':function(_0x782227){const _0x273290=_0x1fc47d;return!_0x3b79aa[_0x273290(_0x2ab4e3._0x4af6dd)]['globe']['depthTestAgainstTerrain'];},'callback':function(_0x38c8b8){const _0x40a762=_0x1fc47d;_0x3b79aa['scene'][_0x40a762(0x22f)][_0x40a762(_0xa1b662._0x336b08)]=!![];}},{'text':_0x3b79aa['getLangText']('_关闭深度监测'),'icon':Icon[_0x1fc47d(0x517)],'show':function(_0x2443e9){return _0x3b79aa['scene']['globe']['depthTestAgainstTerrain'];},'callback':function(_0x33285d){const _0x54e4d6=_0x1fc47d;_0x3b79aa['scene'][_0x54e4d6(0x22f)][_0x54e4d6(0x895)]=![];}},{'text':_0x3b79aa['getLangText']('_显示星空背景'),'icon':Icon[_0x1fc47d(0xdad)],'show':function(_0xfd24bb){const _0x5a21ec=_0x1fc47d;return!_0x3b79aa['scene'][_0x5a21ec(0x449)]['show'];},'callback':function(_0x59f1e0){const _0x187ca9=_0x1fc47d;_0x3b79aa['scene'][_0x187ca9(_0x30cb60._0xa90f51)][_0x187ca9(_0x30cb60._0x3c78b9)]=!![],_0x3b79aa['scene'][_0x187ca9(_0x30cb60._0x49c77a)]['show']=!![],_0x3b79aa[_0x187ca9(_0x30cb60._0xba7b7d)]['sun']['show']=!![];}},{'text':_0x3b79aa['getLangText']('_关闭星空背景'),'icon':Icon['SkyBoxNo'],'show':function(_0x16f24c){return _0x3b79aa['scene']['skyBox']['show'];},'callback':function(_0x256ba5){const _0x344451=_0x1fc47d;_0x3b79aa[_0x344451(_0x443326._0x2a01f4)]['skyBox']['show']=![],_0x3b79aa['scene'][_0x344451(0x5b5)]['show']=![],_0x3b79aa['scene']['sun']['show']=![];}},{'text':_0x3b79aa[_0x1fc47d(0x44e)]('_开启日照阴影'),'icon':Icon['ShadowYes'],'show':function(_0x19cd66){const _0x50db18=_0x1fc47d;return!_0x3b79aa[_0x50db18(0x8d3)][_0x50db18(_0x54969f._0x2f9a29)];},'callback':function(_0x3cc825){const _0x1ad553=_0x1fc47d;_0x3b79aa['viewer']['shadows']=!![],_0x3b79aa['viewer'][_0x1ad553(0xb5d)]=Cesium__namespace['ShadowMode'][_0x1ad553(_0x251924._0x28cea4)],_0x3b79aa['scene']['globe']['enableLighting']=!![];}},{'text':_0x3b79aa[_0x1fc47d(0x44e)](_0x1fc47d(0xf84)),'icon':Icon['ShadowNo'],'show':function(_0x36c0bc){return _0x3b79aa['viewer']['shadows'];},'callback':function(_0x1395f2){const _0x554958=_0x1fc47d;_0x3b79aa['viewer']['shadows']=![],_0x3b79aa[_0x554958(_0x5d7a72._0x17c1d0)][_0x554958(_0x5d7a72._0x4d3c2f)]=Cesium__namespace[_0x554958(_0x5d7a72._0x4651fb)]['RECEIVE_ONLY'],_0x3b79aa['scene']['globe'][_0x554958(_0x5d7a72._0x5bd091)]=![];}},{'text':_0x3b79aa['getLangText']('_开启大气渲染'),'icon':Icon['SkyAtmosphereYes'],'show':function(_0x30bacc){return!_0x3b79aa['scene']['skyAtmosphere']['show'];},'callback':function(_0x6badd1){const _0x251d21=_0x1fc47d;_0x3b79aa['scene']['skyAtmosphere']['show']=!![],_0x3b79aa['scene'][_0x251d21(0x22f)][_0x251d21(_0x2b9ff4._0x480b52)]=!![];}},{'text':_0x3b79aa['getLangText']('_关闭大气渲染'),'icon':Icon[_0x1fc47d(0x91f)],'show':function(_0x264b4b){const _0x2d85a4=_0x1fc47d;return _0x3b79aa['scene'][_0x2d85a4(0x10d)]['show'];},'callback':function(_0x19dcea){const _0x2902e4=_0x1fc47d;_0x3b79aa['scene']['skyAtmosphere']['show']=![],_0x3b79aa[_0x2902e4(0xc60)][_0x2902e4(0x22f)]['showGroundAtmosphere']=![];}},{'text':_0x3b79aa[_0x1fc47d(0x44e)]('_场景出图'),'icon':Icon['ExpImage'],'callback':function(_0x58cf38){_0x3b79aa['expImage']();}}]}];}function toChineseBeforeCreate(_0x4a24d1){const _0x2f7c33={_0x569e97:0x6ff},_0x5823c3={_0x5dc7ef:0x7dc,_0x5be2ec:0x3b9,_0x3ee8ad:0xa1c,_0x1fa07b:0xd77,_0x5df512:0xc0b},_0xaafdfc={_0x464195:0x7dc},_0x4fc363={_0x2ce631:0x35c},_0x19785e=_0x35a251;Cesium__namespace[_0x19785e(_0x2f7c33._0x569e97)][_0x19785e(0x224)]=function(_0x5f3a68,_0x7ea238){const _0x3d0d61=_0x19785e,_0x4ea697=Cesium__namespace['JulianDate']['toDate'](_0x5f3a68);return formatDate(_0x4ea697,_0x3d0d61(_0x4fc363._0x2ce631));},Cesium__namespace[_0x19785e(_0x2f7c33._0x569e97)]['defaultTimeFormatter']=function(_0x2ab4bc,_0x2cab1b){const _0xf85852=_0x19785e,_0x444b68=Cesium__namespace['JulianDate'][_0xf85852(_0xaafdfc._0x464195)](_0x2ab4bc);return formatDate(_0x444b68,'HH:mm:ss');},Cesium__namespace['Timeline']['prototype'][_0x19785e(0xec0)]=function(_0x183a48){const _0x2b9b85=_0x19785e,_0x3e6e12=Cesium__namespace['JulianDate'][_0x2b9b85(_0x5823c3._0x5dc7ef)](this[_0x2b9b85(_0x5823c3._0x5be2ec)]),_0x283dff=Cesium__namespace['JulianDate'][_0x2b9b85(_0x5823c3._0x5dc7ef)](this['_endJulian']),_0x6e6d5c=_0x283dff['getFullYear']()-_0x3e6e12['getFullYear'](),_0x9deee7=_0x283dff['getMonth']()-_0x3e6e12['getMonth'](),_0x192849=_0x283dff[_0x2b9b85(_0x5823c3._0x3ee8ad)]()-_0x3e6e12['getDate'](),_0x1b9616=_0x283dff['getHours']()-_0x3e6e12['getHours'](),_0x30d799=_0x283dff['getMinutes']()-_0x3e6e12['getMinutes'](),_0x5aeea0=_0x283dff[_0x2b9b85(0x52a)]()-_0x3e6e12[_0x2b9b85(0x52a)](),_0x2e7039=Cesium__namespace['JulianDate']['toDate'](_0x183a48);if(_0x6e6d5c===0x0){if(_0x9deee7===0x0&&_0x192849<0xa){if(_0x192849===0x0){if(_0x1b9616===0x0){if(_0x30d799===0x0&&_0x5aeea0<0xa){if(_0x5aeea0===0x0)return formatDate(_0x2e7039,'S');return formatDate(_0x2e7039,_0x2b9b85(_0x5823c3._0x1fa07b));}return formatDate(_0x2e7039,_0x2b9b85(_0x5823c3._0x5df512));}return formatDate(_0x2e7039,'HH:mm:ss');}return formatDate(_0x2e7039,'MM月dd日\x20HH:mm');}return formatDate(_0x2e7039,'MM月dd日');}return formatDate(_0x2e7039,'yyyy-MM-dd');};}function toChineseCreateEnd(_0x34f2a2,_0x2a466a){const _0x8df622={_0x14ff20:0xf81},_0x5c88cd=_0x2a466a['container'];_0x2a466a['scene']['renderError']['addEventListener'](function(_0x124851,_0x3e18b6){const _0xcc69fc=_0x2767,_0xed4283={'An\x20error\x20occurred\x20while\x20rendering.\x20\x20Rendering\x20has\x20stopped.':_0xcc69fc(_0x8df622._0x14ff20),'Error\x20constructing\x20CesiumWidget.':_0xcc69fc(0x92d)};_updateDomInnerHtml(_0x5c88cd,_0xed4283,'cesium-widget-errorPanel-header');});}function _updateDomInnerHtml(_0x2b053d,_0xbac7fe,_0x420761){const _0x2fb04f=_0x35a251,_0x239d7a=_0x2b053d[_0x2fb04f(0xc0f)](_0x420761);for(let _0x54051a=0x0;_0x54051a<_0x239d7a['length'];_0x54051a++){_0xbac7fe[_0x239d7a[_0x54051a]['innerHTML']]&&(_0x239d7a[_0x54051a]['innerHTML']=_0xbac7fe[_0x239d7a[_0x54051a]['innerHTML']]);}}const DefaultOptions={'animation':![],'timeline':![],'fullscreenButton':![],'vrButton':![],'geocoder':![],'sceneModePicker':![],'homeButton':![],'navigationHelpButton':![],'navigationInstructionsInitiallyVisible':![],'infoBox':![],'selectionIndicator':![],'shouldAnimate':!![],'showRenderLoopErrors':!![],'baseLayerPicker':![],'requestRenderMode':![]};class Map extends BaseClass{constructor(_0x1d2cd7,_0x41771b={}){const _0x4d5633={_0x183e13:0xe2f,_0x370bf5:0xd1f,_0x47f027:0xb50,_0x4ea384:0x377,_0x1c226e:0xd39,_0x206872:0x17d,_0x31cd73:0x99f,_0x12ea3f:0xc5b},_0x720e71=_0x35a251;super(_0x41771b),this['options']=_0x41771b,_0x41771b[_0x720e71(_0x4d5633._0x183e13)]&&updateAll(_0x41771b['token']),_0x41771b['lang']=_0x41771b['lang']??LangType['ZH'],(_0x41771b['lang']===LangType['ZH']||_0x41771b['lang']===LangType['ZHHK'])&&toChineseBeforeCreate(),initBeforeCreateDefaultValue(_0x41771b),_0x1d2cd7 instanceof Cesium__namespace[_0x720e71(0x8ec)]?this['_viewer']=_0x1d2cd7:this['_viewer']=this['_createViewer'](_0x1d2cd7,_0x41771b),this[_0x720e71(_0x4d5633._0x370bf5)]=![],this[_0x720e71(_0x4d5633._0x47f027)]=!![],this['_controlList']=new MarsArray(),this['_thingList']=new MarsArray(),this['_layerList']=new MarsArray(),this[_0x720e71(0x268)]=new MarsArray(),this['_optionsLayersList']=new MarsArray(),this[_0x720e71(0x9cc)]=new MarsArray(),this['_visibilitys']=new MarsArray(),this['_controls']={},this[_0x720e71(0xd20)]={},this[_0x720e71(_0x4d5633._0x4ea384)]=this['options']['chinaCRS']||ChinaCRS['WGS84'],(_0x41771b['lang']===LangType['ZH']||_0x41771b['lang']===LangType[_0x720e71(_0x4d5633._0x1c226e)])&&toChineseCreateEnd(_0x41771b,this['_viewer']),this['_sceneEvent']=new SceneEvent(this),this['_mouseEvent']=new MouseEvent(this,_0x41771b['mouse']),this[_0x720e71(_0x4d5633._0x206872)]=new SceneOption(this),this['_zoomNavigation']=new ZoomNavigation(this['_viewer']),this[_0x720e71(_0x4d5633._0x31cd73)](),this['_initControls'](),this[_0x720e71(_0x4d5633._0x12ea3f)](),this['_sceneOption']['setOptions'](this['options']['scene'],this['options']['scene']);}get[_0x35a251(0x8d3)](){return this['_viewer'];}get['container'](){const _0x33ef74=_0x35a251;return this['_viewer'][_0x33ef74(0x94f)];}get[_0x35a251(0xe1d)](){const _0x3067ce=_0x35a251;return this[_0x3067ce(0xebf)]['_toolbar'];}get['canvas'](){const _0x3e57eb={_0x44a23a:0xebf,_0x13bf9b:0xc60},_0x459341=_0x35a251;var _0x20b17f;return(_0x20b17f=this[_0x459341(_0x3e57eb._0x44a23a)])===null||_0x20b17f===void 0x0?void 0x0:_0x20b17f[_0x459341(_0x3e57eb._0x13bf9b)]['canvas'];}get['scene'](){const _0x9a9771=_0x35a251;var _0x47a154;return(_0x47a154=this[_0x9a9771(0xebf)])===null||_0x47a154===void 0x0?void 0x0:_0x47a154['scene'];}get[_0x35a251(0x7d)](){return this['_viewer']['camera'];}get[_0x35a251(0xf66)](){return this['_viewer']['imageryLayers'];}get['dataSources'](){return this['_viewer']['dataSources'];}get['entities'](){const _0x4b37a3=_0x35a251;return this['_viewer'][_0x4b37a3(0x313)];}get[_0x35a251(0x42d)](){return this['_viewer']['clock'];}get['currentTime'](){const _0x590173={_0x2930dd:0xebf},_0x26b95b=_0x35a251;return this[_0x26b95b(_0x590173._0x2930dd)]['clock']['currentTime'];}set['currentTime'](_0x2d24ce){const _0x3cf6f0={_0x1c390e:0x42d,_0x57cdbc:0x18b},_0x4577ce=_0x35a251;this[_0x4577ce(0xebf)][_0x4577ce(_0x3cf6f0._0x1c390e)][_0x4577ce(_0x3cf6f0._0x57cdbc)]=_0x2d24ce;}get[_0x35a251(0xd0d)](){return this['_viewer']['cesiumWidget'];}get['trackedEntity'](){const _0x2642da={_0x487d88:0xebf},_0x428e23=_0x35a251;return this[_0x428e23(_0x2642da._0x487d88)]['trackedEntity'];}set['trackedEntity'](_0x4425da){const _0x1b225e={_0x315bc4:0xebf,_0x3a166b:0xec6},_0x1e6ca1=_0x35a251;if(_0x4425da){if(_0x4425da instanceof Cesium__namespace['Entity'])this[_0x1e6ca1(_0x1b225e._0x315bc4)]['trackedEntity']=_0x4425da;else{if(_0x4425da['entity']instanceof Cesium__namespace['Entity'])this[_0x1e6ca1(_0x1b225e._0x315bc4)][_0x1e6ca1(_0x1b225e._0x3a166b)]=_0x4425da['entity'];else{if(_0x4425da['czmObject']instanceof Cesium__namespace[_0x1e6ca1(0x13a)])this[_0x1e6ca1(_0x1b225e._0x315bc4)][_0x1e6ca1(0xec6)]=_0x4425da[_0x1e6ca1(0x371)];else _0x4425da['trackedEntity']instanceof Cesium__namespace['Entity']&&(this['_viewer']['trackedEntity']=_0x4425da['trackedEntity']);}}}else this['_viewer']['trackedEntity']=undefined;}get['terrainProvider'](){const _0x22e130={_0x56662a:0xbcd},_0x2e0637=_0x35a251;return this['_viewer'][_0x2e0637(_0x22e130._0x56662a)];}set['terrainProvider'](_0x4de2b6){const _0x3ad924={_0x4eacf4:0xee},_0x25330e={_0x341890:0xbcd},_0x4dc233=_0x35a251;if(_0x4de2b6){if(_0x4de2b6[_0x4dc233(0x86c)]){_0x4de2b6[_0x4dc233(0x86c)](_0x32eef4=>{const _0x445858=_0x4dc233;this[_0x445858(_0x25330e._0x341890)]=_0x32eef4;});return;}_0x4de2b6['_marsOptions']=_0x4de2b6['_marsOptions']||{},_0x4de2b6['_marsOptions']['onLoadSuccess']=_0xab0234=>{const _0x55595b=_0x4dc233;this[_0x55595b(0xe6d)](_0xab0234);},_0x4de2b6['_marsOptions']['onLoadError']=_0x501943=>{this['_terrain_onLoadError'](_0x501943);};}this['_viewer']['terrainProvider']=_0x4de2b6,this[_0x4dc233(0xb28)]=_0x4de2b6,_0x4de2b6 instanceof Cesium__namespace['EllipsoidTerrainProvider']&&this['fire'](EventType[_0x4dc233(_0x3ad924._0x4eacf4)]);}get[_0x35a251(0x234)](){return Boolean(this['_viewer']['terrainProvider']['_layers']);}set[_0x35a251(0x234)](_0x356b14){const _0x32e24b=_0x35a251;_0x356b14?this['_defaultTerrainProvider']==null?this['terrainProvider']=createTerrainProvider(this['_getTerrainOptions']()):this['_viewer'][_0x32e24b(0xbcd)]=this['_defaultTerrainProvider']:(this[_0x32e24b(0xebf)]['terrainProvider']=getNoTerrainProvider(),this['fire'](EventType[_0x32e24b(0xee)]));}get['basemap'](){const _0x2b57fc={_0x4582da:0xea3,_0x302c61:0x76d},_0xbde6e1=_0x35a251,_0x5128da=this['_optionsBasemapsList'][_0xbde6e1(_0x2b57fc._0x4582da)];if(_0x5128da['length']===0x0){if(this['_viewer']['baseLayerPicker'])return this['_viewer']['baseLayerPicker']['viewModel'][_0xbde6e1(_0x2b57fc._0x302c61)];return undefined;}for(let _0x4434e4=0x0;_0x4434e4<_0x5128da[_0xbde6e1(0xe1e)];_0x4434e4++){const _0x3b2075=_0x5128da[_0x4434e4];if(_0x3b2075[_0xbde6e1(0x804)])continue;if(_0x3b2075[_0xbde6e1(0x47f)])return _0x3b2075;}return undefined;}set['basemap'](_0x30444d){const _0x516af1={_0x449c56:0xe1e,_0x596668:0x4f9,_0x2334e1:0xe1e,_0x90916f:0xa99,_0x27c605:0x47f},_0xa0dc6=_0x35a251;let _0x4305f3,_0x369c8e;_0x30444d&&isObject(_0x30444d)?(_0x4305f3=_0x30444d['id'],_0x369c8e=_0x30444d['name']):(_0x4305f3=_0x30444d,_0x369c8e=_0x30444d);const _0x1c0080=this['_optionsBasemapsList']['values'];if(_0x1c0080[_0xa0dc6(_0x516af1._0x449c56)]===0x0){if(this[_0xa0dc6(0xebf)]['baseLayerPicker']){const _0x3dfdc7=this['_viewer']['baseLayerPicker'][_0xa0dc6(_0x516af1._0x596668)];let _0x2f2831;if(_0x30444d){let _0x33a108,_0x56a0fd=-0x1;for(let _0x1daa0a=0x0;_0x1daa0a{const _0x164a15=_0xa0dc6;_0xc2145c['toBottom']&&_0xc2145c['toBottom'](),this['fire'](EventType[_0x164a15(0xa99)],{'layer':_0x39b1d6});})):_0xc2145c['isAdded']&&(delete _0xc2145c['options']['show'],this[_0xa0dc6(0xad7)](_0xc2145c));}}get[_0x35a251(0x8de)](){const _0x320e17=_0x35a251;var _0x2ddc94;return(_0x2ddc94=this[_0x320e17(0xebf)])===null||_0x2ddc94===void 0x0?void 0x0:_0x2ddc94['scene']['onlyPickModelPosition'];}set[_0x35a251(0x8de)](_0x2d45a3){const _0x27c1d5=_0x35a251;this['_viewer']['scene'][_0x27c1d5(0x8de)]=_0x2d45a3;}get[_0x35a251(0xbf)](){var _0x2e7d9a;return(_0x2e7d9a=this['_viewer'])===null||_0x2e7d9a===void 0x0?void 0x0:_0x2e7d9a['scene']['onlyPickTerrainPosition'];}set['onlyPickTerrainPosition'](_0x305e97){const _0x4e0850=_0x35a251;this[_0x4e0850(0xebf)]['scene']['onlyPickTerrainPosition']=_0x305e97;}get['tilesetMaxTotalMemory'](){return this['_tilesetMaxTotalMemory'];}set['tilesetMaxTotalMemory'](_0x253dfe){this['_tilesetMaxTotalMemory']=_0x253dfe;}get['mouseEvent'](){return this['_mouseEvent'];}get[_0x35a251(0x463)](){return this['_popupMgr'];}get['tooltip'](){const _0x49783f={_0x3e87c2:0x1f6},_0x4dc02b=_0x35a251;return this[_0x4dc02b(_0x49783f._0x3e87c2)];}get['smallTooltip'](){return this['_smallTooltip'];}get['contextmenu'](){const _0x2df1e4=_0x35a251;return this[_0x2df1e4(0xc4d)];}get['keyboardRoam'](){const _0x3fe91a={_0x1e0de9:0x193},_0x4da2b6=_0x35a251;return this[_0x4da2b6(_0x3fe91a._0x1e0de9)];}get[_0x35a251(0xc3f)](){const _0x387ccb=_0x35a251;return this[_0x387ccb(0x698)];}get[_0x35a251(0xd36)](){return this['_effects'];}get['graphicLayer'](){const _0x36ad50={_0x5a02bf:0xb13,_0x1860c2:0xb13},_0x1dd8cf=_0x35a251;return this['_graphicLayer']==null&&(this[_0x1dd8cf(_0x36ad50._0x5a02bf)]=new GraphicLayer({'name':_0x1dd8cf(0xa56),'private':!![]}),this['addLayer'](this[_0x1dd8cf(_0x36ad50._0x1860c2)])),this['_graphicLayer'];}get['level'](){const _0xca196f={_0x2836fb:0xb8a,_0x20adff:0x91a},_0x16954c=_0x35a251,_0x589108=Math['abs'](this[_0x16954c(0xebf)][_0x16954c(0x7d)][_0x16954c(0x78e)]['height']);if(_0x589108===this[_0x16954c(_0xca196f._0x2836fb)])return this['_level'];return this[_0x16954c(_0xca196f._0x20adff)]=heightToZoom(_0x589108),this['_prevCameraHeight']=_0x589108,this[_0x16954c(0x91a)];}get['fixedLight'](){return this['_fixedLight'];}set['fixedLight'](_0x4cbc85){const _0x3b9260={_0x32ce7a:0xc84},_0x1a05ce=_0x35a251;this[_0x1a05ce(_0x3b9260._0x32ce7a)]=_0x4cbc85;!this['_sunlight']&&(this['_sunlight']=this['scene']['light']);if(_0x4cbc85){const _0x2e9d5f=new Cesium__namespace[(_0x1a05ce(0x7a2))]({'direction':new Cesium__namespace[(_0x1a05ce(0x8eb))](0.35492591601301104,-0.8909182691839401,-0.2833588392420772)});this['scene']['light']=_0x2e9d5f;}else this['scene']['light']=this[_0x1a05ce(0x247)];}get[_0x35a251(0x9e3)](){return this['options']['lang']||LangType['ZH'];}set['lang'](_0x5c8073){this['options']['lang']=_0x5c8073;}get['zoomFactor'](){const _0x1a6eb2={_0x31dfd0:0xc60,_0xad2457:0x229},_0x5dbecd=_0x35a251;return this[_0x5dbecd(_0x1a6eb2._0x31dfd0)]['screenSpaceCameraController'][_0x5dbecd(_0x1a6eb2._0xad2457)];}set[_0x35a251(0xf88)](_0x38c931){const _0x173088={_0x486657:0xc60,_0x5de670:0x229},_0x542567=_0x35a251;this[_0x542567(_0x173088._0x486657)]['screenSpaceCameraController'][_0x542567(_0x173088._0x5de670)]=_0x38c931;}get['highlightEnabled'](){return this['_highlightEnabled'];}set[_0x35a251(0xe6)](_0x2e7f2e){this['_highlightEnabled']=_0x2e7f2e,!_0x2e7f2e&&this['closeHighlight']();}['_createViewer'](_0x592492,_0x228cb7){const _0x124f5a={_0x523a06:0x22f,_0x3f0ae1:0x4f6,_0x4a077c:0xb91,_0x22cdb5:0x3a4,_0x62aa7a:0x5fc,_0x255247:0xa67,_0x3ff185:0x691,_0x58a86d:0x46c,_0x41e595:0xd8d,_0x54facc:0x9e3,_0x89c1bb:0x457,_0x47ebba:0xe2d,_0x25d061:0xa9,_0x110e9d:0x3b7,_0x3f05ba:0x79f,_0x13e20d:0xcb,_0x45eade:0x187},_0x34a8fb=_0x35a251;if(!_0x592492)throw new Error('Map:id\x20不能为空');const _0x17c5a5={...DefaultOptions,..._0x228cb7['control']||{},..._0x228cb7[_0x34a8fb(0xc60)]||{},'baseLayerPicker':![],'timeline':![]};_0x17c5a5[_0x34a8fb(0x22f)]&&!(_0x17c5a5[_0x34a8fb(_0x124f5a._0x523a06)]instanceof Cesium__namespace['Globe'])&&delete _0x17c5a5['globe'];_0x17c5a5['cameraController']&&delete _0x17c5a5[_0x34a8fb(_0x124f5a._0x3f0ae1)];_0x17c5a5[_0x34a8fb(_0x124f5a._0x4a077c)]&&delete _0x17c5a5['contextmenu'];_0x17c5a5['location']&&delete _0x17c5a5[_0x34a8fb(_0x124f5a._0x22cdb5)];_0x17c5a5['mouseDownView']&&delete _0x17c5a5['mouseDownView'];_0x17c5a5['navigation']&&delete _0x17c5a5['navigation'];Cesium__namespace['defined'](_0x17c5a5[_0x34a8fb(_0x124f5a._0x62aa7a)])&&(_0x17c5a5['mapProjection']===CRS['EPSG3857']?_0x17c5a5['mapProjection']=new Cesium__namespace['WebMercatorProjection'](_0x17c5a5['ellipsoid']):_0x17c5a5['mapProjection']=new Cesium__namespace['GeographicProjection'](_0x17c5a5[_0x34a8fb(0x3f4)]));Cesium__namespace['defined'](_0x17c5a5['ellipsoid'])&&(_0x17c5a5['globe']=new Cesium__namespace[(_0x34a8fb(_0x124f5a._0x255247))](_0x17c5a5['ellipsoid']));if(Cesium__namespace[_0x34a8fb(0xaa2)](_0x17c5a5['skyBox'])&&isPlainObject(_0x17c5a5['skyBox']))switch(_0x17c5a5['skyBox']['type']){case _0x34a8fb(_0x124f5a._0x3ff185):case'GroundSkyBox':_0x17c5a5['skyBox']=new GroundSkyBox(_0x17c5a5['skyBox']);break;case _0x34a8fb(_0x124f5a._0x58a86d):case _0x34a8fb(0xc6d):_0x17c5a5['skyBox']=new MultipleSkyBox(_0x17c5a5[_0x34a8fb(0x449)]);break;default:_0x17c5a5['skyBox']=new Cesium__namespace[(_0x34a8fb(_0x124f5a._0x41e595))](_0x17c5a5['skyBox']);break;}_0x17c5a5['geocoder']==='gaode'&&_0x228cb7[_0x34a8fb(_0x124f5a._0x54facc)]===LangType['ZH']&&(_0x17c5a5['geocoder']=new GaodePOIGeocoder(_0x17c5a5['geocoderConfig']),_0x17c5a5['geocoder'][_0x34a8fb(_0x124f5a._0x89c1bb)]=this);let _0x12f4e2=![];if(_0x17c5a5['baseLayerPicker']){var _0x1926fb;if(!_0x17c5a5[_0x34a8fb(0xa9)]&&((_0x1926fb=_0x228cb7[_0x34a8fb(_0x124f5a._0x47ebba)])===null||_0x1926fb===void 0x0?void 0x0:_0x1926fb['length'])>0x0){const _0x425271=getImageryProviderViewModels(_0x228cb7['basemaps'],this['options']['templateValues']);_0x17c5a5[_0x34a8fb(_0x124f5a._0x25d061)]=_0x425271['imageryProviderViewModels'],_0x425271['selectedIndex']===-0x1?_0x12f4e2=!![]:_0x17c5a5['selectedImageryProviderViewModel']=_0x425271[_0x34a8fb(_0x124f5a._0x25d061)][_0x425271['selectedIndex']];}if(!_0x17c5a5[_0x34a8fb(_0x124f5a._0x110e9d)]){var _0x4f1df7;_0x17c5a5['terrainProviderViewModels']=getTerrainProviderViewModels(this['_getTerrainOptions']()),_0x17c5a5['selectedTerrainProviderViewModel']=_0x17c5a5['terrainProviderViewModels'][(_0x4f1df7=_0x228cb7['terrain'])!==null&&_0x4f1df7!==void 0x0&&_0x4f1df7['show']?0x1:0x0];}}else _0x17c5a5['imageryProvider']==null&&(_0x12f4e2=!![],_0x17c5a5['baseLayer']=Cesium__namespace['ImageryLayer']['fromProviderAsync'](Cesium__namespace[_0x34a8fb(_0x124f5a._0x3f05ba)][_0x34a8fb(_0x124f5a._0x13e20d)](Cesium__namespace['buildModuleUrl'](_0x34a8fb(_0x124f5a._0x45eade))))),_0x228cb7['terrain']&&_0x228cb7['terrain']['show']?this['terrainProvider']=createTerrainProvider(this[_0x34a8fb(0x75f)]()):_0x17c5a5['terrainProvider']=getNoTerrainProvider();const _0x2c0004=new Cesium__namespace['Viewer'](_0x592492,_0x17c5a5);if(_0x12f4e2){const _0x42f1c3=_0x2c0004['imageryLayers'],_0x1bb384=_0x42f1c3['length'];for(let _0x2e8b93=0x0;_0x2e8b93<_0x1bb384;_0x2e8b93++){const _0x2227c7=_0x42f1c3['get'](0x0);_0x42f1c3[_0x34a8fb(0x1ee)](_0x2227c7,!![]);}}return _0x2c0004;}['_terrain_onLoadSuccess'](_0x3101be){const _0x5d1a30={_0x2bc1ab:0xee},_0x480e55=_0x35a251;this['fire'](EventType[_0x480e55(_0x5d1a30._0x2bc1ab)],{'data':_0x3101be});}['_terrain_onLoadError'](_0x3b2023){this['hasTerrain']=![],this['fire'](EventType['terrainLoadError'],{'error':_0x3b2023});}['_getTerrainOptions'](){const _0x19ac84={_0x44c61f:0xe17,_0x28c85d:0xe86},_0x4b1407=_0x35a251;if(!this['options'][_0x4b1407(_0x19ac84._0x44c61f)])return this[_0x4b1407(_0x19ac84._0x28c85d)][_0x4b1407(0xe17)];const _0xae94c8={'templateValues':this[_0x4b1407(0xe86)][_0x4b1407(0xa0a)],'marsOptions':{'onLoadSuccess':_0x9cc5d7=>{this['_terrain_onLoadSuccess'](_0x9cc5d7);},'onLoadError':_0x9eac91=>{const _0x5c0baa=_0x4b1407;this[_0x5c0baa(0x781)](_0x9eac91);}},...this['options'][_0x4b1407(0xe17)]};return _0xae94c8;}['setOptions'](_0x388d2c){const _0xecabef={_0x2b449e:0x86c,_0x194dcc:0x9c8,_0x396859:0x2a6,_0x3eb719:0x72b,_0xb09a48:0x3b0,_0x3a6a14:0xf5},_0x1e8a38={_0x320c92:0x3d6,_0x1d20bf:0x3d6},_0x4a9fa7=_0x35a251;if(!_0x388d2c||Object['keys'](_0x388d2c)['length']===0x0)return this;this['options']=merge(this['options'],_0x388d2c);for(const _0x5f5bcf in _0x388d2c){const _0x12de3c=_0x388d2c[_0x5f5bcf];switch(_0x5f5bcf){case'scene':{this['_sceneOption']['setOptions'](this['options']['scene'],_0x12de3c);break;}case'mouse':{this['_mouseEvent']['setOptions'](this[_0x4a9fa7(0xe86)]['mouse']);break;}case'terrain':{createTerrainProvider(this['_getTerrainOptions']())[_0x4a9fa7(_0xecabef._0x2b449e)](_0x1301a7=>{const _0xe86378=_0x4a9fa7;this[_0xe86378(0xbcd)]=_0x1301a7,this[_0xe86378(0xc3f)][_0xe86378(_0x1e8a38._0x320c92)]&&this['controls'][_0xe86378(_0x1e8a38._0x1d20bf)][_0xe86378(0x70b)]();});break;}case'basemaps':{this['setBasemapsOptions'](_0x12de3c);break;}case _0x4a9fa7(0x658):{this['setLayersOptions'](_0x12de3c);break;}case'chinaCRS':{this['chinaCRS']=_0x12de3c||ChinaCRS['WGS84'];break;}case'lang':{(_0x12de3c===LangType['ZH']||_0x12de3c===LangType['ZHHK'])&&toChineseBeforeCreate(this['options']);break;}case'token':{updateAll(_0x12de3c);break;}case'control':{for(const _0x3a5b73 in _0x12de3c){const _0x3c9b39=this[_0x4a9fa7(0xe86)][_0x4a9fa7(_0xecabef._0x194dcc)][_0x3a5b73],_0xe1535c=this['_controls'][_0x3a5b73];if(_0xe1535c)!_0x3c9b39||(_0x3c9b39===null||_0x3c9b39===void 0x0?void 0x0:_0x3c9b39['enabled'])===![]?(_0xe1535c[_0x4a9fa7(0x987)]=![],_0xe1535c[_0x4a9fa7(_0xecabef._0x396859)]=![]):(_0xe1535c['show']=!![],_0xe1535c[_0x4a9fa7(_0xecabef._0x396859)]=!![],_0xe1535c[_0x4a9fa7(0x72b)]&&_0x3c9b39!==!![]&&_0xe1535c['setOptions'](_0x3c9b39));else{if(!_0x3c9b39||_0x3c9b39[_0x4a9fa7(0x2a6)]===![])continue;const _0x79a3b=create$1(_0x3a5b73,_0x3c9b39);_0x79a3b?this['addControl'](_0x79a3b):logWarn(_0x4a9fa7(0x5d8),_0x3a5b73,_0x3c9b39);}}break;}case'effect':{for(const _0x5a5b85 in _0x12de3c){const _0x1f9083=this[_0x4a9fa7(0xe86)]['effect'][_0x5a5b85],_0x27f2c8=this['_effects'][_0x5a5b85];if(_0x27f2c8)!_0x1f9083||(_0x1f9083===null||_0x1f9083===void 0x0?void 0x0:_0x1f9083['enabled'])===![]?_0x27f2c8['enabled']=![]:(_0x27f2c8['enabled']=!![],_0x27f2c8['setOptions']&&_0x27f2c8[_0x4a9fa7(_0xecabef._0x3eb719)](_0x1f9083));else{if(!_0x1f9083||_0x1f9083['enabled']===![])continue;const _0x57f990=create(_0x5a5b85,_0x1f9083);_0x57f990&&this[_0x4a9fa7(_0xecabef._0xb09a48)](_0x57f990);}}break;}default:{logWarn(_0x4a9fa7(_0xecabef._0x3a6a14),_0x12de3c);break;}}}return this;}['setSceneOptions'](_0x19d0f9){const _0xca7428={_0x2d7c07:0xc60},_0x4cbe50=_0x35a251;if(!_0x19d0f9||Object[_0x4cbe50(0x68f)](_0x19d0f9)['length']===0x0)return this;return this['options'][_0x4cbe50(_0xca7428._0x2d7c07)]=merge(this['options'][_0x4cbe50(_0xca7428._0x2d7c07)],_0x19d0f9),this['_sceneOption']['setOptions'](this[_0x4cbe50(0xe86)]['scene'],_0x19d0f9),this;}['getOptions'](){const _0x509d5e={_0x12311b:0xe86},_0x220433=_0x35a251;return clone(this[_0x220433(_0x509d5e._0x12311b)],['parent',_0x220433(0x6ec)]);}['getCurrentOptions'](){const _0x578d41={_0x480292:0x78a},_0x248556=_0x35a251,_0x20e890=this['getOptions']();_0x20e890['scene']['center']=this[_0x248556(_0x578d41._0x480292)](),_0x20e890['layers']=[];const _0xcfff87=this['getLayers']({'basemaps':![]});for(let _0x4a201e=_0xcfff87['length']-0x1;_0x4a201e>=0x0;_0x4a201e--){const _0x473368=_0xcfff87[_0x4a201e];if(_0x473368['isPrivate']||_0x473368['parent'])continue;_0x20e890['layers']['push'](_0x473368['toJSON']());}return _0x20e890;}['getDefaultContextMenu'](){return getDefaultContextMenu(this);}['getCenter'](){const _0x852a8e={_0x18fc97:0xc60},_0x5d473c=_0x35a251;return getCenter(this[_0x5d473c(_0x852a8e._0x18fc97)]);}['getCameraDistance'](){const _0x2690e8={_0x230d6e:0xf83,_0x505947:0x7d,_0x53bcc1:0x13f},_0xbb970f=_0x35a251,_0x2cb920=this[_0xbb970f(_0x2690e8._0x230d6e)]();if(_0x2cb920){const _0x1a09e7=Cesium__namespace['Cartesian3']['distance'](_0x2cb920['toCartesian'](),this['_viewer'][_0xbb970f(_0x2690e8._0x505947)][_0xbb970f(_0x2690e8._0x53bcc1)]);return _0x1a09e7;}else return 0x0;}['getExtent'](_0x416ee0){return getExtent(this,_0x416ee0);}['getRealAlt'](_0x35ce3e){const _0x2db62d={_0x2b48c9:0xe86,_0x2a3588:0xebf},_0x1efbbc=_0x35a251;var _0x3289a6,_0x27d0bd;if(!((_0x3289a6=this[_0x1efbbc(_0x2db62d._0x2b48c9)]['scene'])!==null&&_0x3289a6!==void 0x0&&(_0x27d0bd=_0x3289a6['globe'])!==null&&_0x27d0bd!==void 0x0&&_0x27d0bd[_0x1efbbc(0xbea)]))return _0x35ce3e;const _0x3e0172=this[_0x1efbbc(_0x2db62d._0x2a3588)]['scene']['globe']['terrainExaggeration']||this['_viewer']['scene']['terrainExaggeration'];if(_0x3e0172)return _0x35ce3e/_0x3e0172;return _0x35ce3e;}['expImage'](_0x3b81ee){return expImage(this['_viewer'],_0x3b81ee);}['setCursor'](_0x12ea9d=''){const _0x76c8d2={_0x2fa7ee:0x227},_0x1a6465=_0x35a251;this['_default_cursor']=_0x12ea9d,this['container']['style'][_0x1a6465(_0x76c8d2._0x2fa7ee)]=_0x12ea9d;}[_0x35a251(0x492)](_0x349c8b){const _0x3f8573={_0x2afc6b:0xfc8},_0x38d78c=_0x35a251;if(!this['container'])return;_0x349c8b?this[_0x38d78c(0x94f)][_0x38d78c(0xfc8)]['cursor']=_0x38d78c(0xa0d):this['container'][_0x38d78c(_0x3f8573._0x2afc6b)]['cursor']=this['_default_cursor']||'';}[_0x35a251(0xf70)](_0x23bf44){return pick3DTileset(this['scene'],_0x23bf44);}['pickTilesetLayer'](_0xdb71e2){const _0x166133={_0x362a90:0xc60},_0x368693=_0x35a251,_0x3499f1=pick3DTileset(this[_0x368693(_0x166133._0x362a90)],_0xdb71e2);return _0x3499f1?this['getLayerById'](_0x3499f1['_mars3d_layerId']):null;}['on'](_0x3dc52e,_0xf63f90,_0x315e38){const _0x5ead8b=this['_sceneEvent']['on'](_0x3dc52e,_0xf63f90,_0x315e38||this);return!_0x5ead8b&&super['on'](_0x3dc52e,_0xf63f90,_0x315e38),this;}[_0x35a251(0x6b2)](_0xb12f98,_0x2d15a9,_0x33ea6e){const _0x5e669a=this['_sceneEvent']['off'](_0xb12f98,_0x2d15a9,_0x33ea6e||this);return!_0x5e669a&&super['off'](_0xb12f98,_0x2d15a9,_0x33ea6e),this;}[_0x35a251(0x78c)](_0x4b1f48,_0x313ead){const _0x5293bb={_0x23a4e6:0xf62},_0x37ba7a=_0x35a251;return this[_0x37ba7a(_0x5293bb._0x23a4e6)]['hasType'](_0x4b1f48)?this['_sceneEvent'][_0x37ba7a(0x78c)](_0x4b1f48):super['listens'](_0x4b1f48,_0x313ead);}['_initLayers'](){const _0x325935={_0x161659:0x658,_0x5bc1b4:0xd49,_0x281622:0x6de,_0x23f60a:0xebf,_0x27d573:0xcd3,_0x4736cc:0x6de,_0x3d14e8:0xe86,_0x52b95d:0x18d,_0x2bdcb2:0xf0b},_0x183ae4={_0xf03199:0x64a},_0x3f0018={_0xccd10c:0xeff},_0x228a2d=_0x35a251;this['options']['basemaps']=this['options'][_0x228a2d(0xe2d)]||[],this['options']['layers']=this['options']['layers']||[],this['_layerIdx']=0x1,this['_arrLayerIdx']=[];const _0x59ff5b=this['options']['basemaps'],_0x3e159e=this['options'][_0x228a2d(_0x325935._0x161659)];for(let _0x11bd35=0x0;_0x11bd35<_0x59ff5b[_0x228a2d(0xe1e)];_0x11bd35++){const _0x293906=_0x59ff5b[_0x11bd35];_0x293906['id']&&(this['_arrLayerIdx']['indexOf'](_0x293906['id'])!==-0x1&&(delete _0x293906['id'],logWarn('addLayer:图层id存在冲突,已重新赋值id',_0x293906)),this[_0x228a2d(0xd49)]['push'](_0x293906['id']));}for(let _0x301e8d=0x0;_0x301e8d<_0x3e159e['length'];_0x301e8d++){const _0x199d9c=_0x3e159e[_0x301e8d];_0x199d9c['id']&&(this[_0x228a2d(_0x325935._0x5bc1b4)]['indexOf'](_0x199d9c['id'])!==-0x1&&(delete _0x199d9c['id'],logWarn(_0x228a2d(0xd12),_0x199d9c)),this['_arrLayerIdx'][_0x228a2d(_0x325935._0x281622)](_0x199d9c['id']));}const _0x3f99f7=[],_0x32915d=[];if(!this[_0x228a2d(_0x325935._0x23f60a)][_0x228a2d(0x3d6)])for(let _0x136c98=0x0;_0x136c98<_0x59ff5b['length'];_0x136c98++){const _0x516cae=_0x59ff5b[_0x136c98];!_0x516cae['name']&&(_0x516cae['name']='');!_0x516cae['id']&&(_0x516cae['id']=this['getNextLayerId']());const _0x3fd5ca=create$2(_0x516cae,this['options']['templateValues']);if(!_0x3fd5ca)continue;_0x3fd5ca[_0x228a2d(0xf18)]=!![];if(_0x516cae['show']){const _0x255388=this['addLayer'](_0x3fd5ca);_0x32915d['push'](_0x255388);}else delete _0x516cae[_0x228a2d(0x987)];this['_optionsBasemapsList'][_0x228a2d(_0x325935._0x27d573)](_0x516cae['id'],_0x3fd5ca),_0x3f99f7['push'](_0x516cae);if(_0x3fd5ca['hasChildLayer']&&_0x516cae['layers'])for(let _0x12d10d=0x0;_0x12d10d<_0x516cae['layers']['length'];_0x12d10d++){const _0x48d97e=_0x516cae['layers'][_0x12d10d];_0x48d97e['pid']=_0x516cae['id'],_0x48d97e[_0x228a2d(0x605)]=_0x3fd5ca,!_0x48d97e['id']&&(_0x48d97e['id']=this[_0x228a2d(0xf0b)]()),_0x3f99f7[_0x228a2d(_0x325935._0x4736cc)](_0x48d97e);}}for(let _0x1338bd=0x0;_0x1338bd<_0x3e159e['length'];_0x1338bd++){const _0x11f3c2=_0x3e159e[_0x1338bd];!_0x11f3c2['id']&&(_0x11f3c2['id']=this['getNextLayerId']());const _0x270ad3=create$2(_0x11f3c2,this[_0x228a2d(_0x325935._0x3d14e8)]['templateValues']);if(!_0x270ad3)continue;_0x270ad3['_hasMapInit']=!![];if(_0x11f3c2[_0x228a2d(0x987)]){const _0x20af58=this['addLayer'](_0x270ad3);_0x32915d['push'](_0x20af58);}else delete _0x11f3c2['show'];this['_optionsLayersList']['set'](_0x11f3c2['id'],_0x270ad3),_0x3f99f7['push'](_0x11f3c2);if(_0x270ad3['hasChildLayer']&&_0x11f3c2['layers'])for(let _0x17db36=0x0;_0x17db36<_0x11f3c2[_0x228a2d(_0x325935._0x161659)][_0x228a2d(0xe1e)];_0x17db36++){const _0xd0b3ca=_0x11f3c2[_0x228a2d(_0x325935._0x161659)][_0x17db36];_0xd0b3ca[_0x228a2d(_0x325935._0x52b95d)]=_0x11f3c2['id'],_0xd0b3ca['parent']=_0x270ad3,!_0xd0b3ca['id']&&(_0xd0b3ca['id']=this[_0x228a2d(_0x325935._0x2bdcb2)]()),_0x3f99f7[_0x228a2d(0x6de)](_0xd0b3ca);}}for(let _0x4d80a8=0x0;_0x4d80a8<_0x3f99f7[_0x228a2d(0xe1e)];_0x4d80a8++){const _0x79c9eb=_0x3f99f7[_0x4d80a8];let _0x3f812c=Number(_0x79c9eb['zIndex']);isNaN(_0x3f812c)&&(_0x3f812c=_0x4d80a8);_0x79c9eb['zIndex']=_0x3f812c;const _0x2270b6=this['_layerList']['get'](_0x79c9eb['id']);_0x2270b6&&(_0x2270b6['zIndex']=_0x3f812c);}_0x32915d['push'](new Promise((_0x4069b0,_0x5b288e)=>{const _0x532cb4=_0x228a2d;function _0x360563(_0x14c2d9){_0x14c2d9===0x0&&(this['off'](EventType['tileLoadProgress'],_0x360563),_0x4069b0(!![]));}this['on'](EventType[_0x532cb4(_0x3f0018._0xccd10c)],_0x360563);})),Promise['all'](_0x32915d)['then'](_0x43a282=>{const _0xc5ed15=_0x228a2d;this['fire'](EventType[_0xc5ed15(_0x183ae4._0xf03199)],{'list':_0x43a282});});}['setBasemapsOptions'](_0x1518e9,_0x304f5a=!![]){const _0x250f9e={_0x3011d4:0xe2d,_0xde25c1:0x268,_0x2c3e77:0xcd3,_0x10c76e:0x605,_0x39b976:0x3d6,_0x5e44ca:0xea3},_0x4a517f=_0x35a251;if(!_0x1518e9||_0x1518e9['length']===0x0)return;this[_0x4a517f(0xe86)][_0x4a517f(_0x250f9e._0x3011d4)]=_0x1518e9;if(_0x304f5a){this[_0x4a517f(_0x250f9e._0xde25c1)]['forEach'](_0x34e053=>{const _0x25ab78=_0x4a517f;_0x34e053[_0x25ab78(0xa63)]();}),this['_optionsBasemapsList']['removeAll']();for(let _0x48459f=0x0;_0x48459f<_0x1518e9['length'];_0x48459f++){const _0x1705da=_0x1518e9[_0x48459f];!_0x1705da['name']&&(_0x1705da['name']='');!_0x1705da['id']&&(_0x1705da['id']=this['getNextLayerId']());let _0x2de313=Number(_0x1705da[_0x4a517f(0x31f)]);isNaN(_0x2de313)&&(_0x2de313=_0x48459f);_0x1705da['zIndex']=_0x2de313;const _0x10c9ff=create$2(_0x1705da,this['options']['templateValues']);if(!_0x10c9ff)continue;_0x1705da['show']&&(this[_0x4a517f(0x6f7)](_0x10c9ff),_0x10c9ff['readyPromise']['then'](function(_0x3f8cbc){const _0x4f7d0b=_0x4a517f;_0x3f8cbc['toBottom']&&_0x3f8cbc[_0x4f7d0b(0xd60)]();}));this['_optionsBasemapsList'][_0x4a517f(_0x250f9e._0x2c3e77)](_0x1705da['id'],_0x10c9ff);if(_0x10c9ff[_0x4a517f(0x977)]&&_0x1705da[_0x4a517f(0x658)])for(let _0x2c387e=0x0;_0x2c387e<_0x1705da['layers']['length'];_0x2c387e++){const _0x254dbb=_0x1705da['layers'][_0x2c387e];_0x254dbb['pid']=_0x1705da['id'],_0x254dbb[_0x4a517f(_0x250f9e._0x10c76e)]=_0x10c9ff,!_0x254dbb['id']&&(_0x254dbb['id']=this['getNextLayerId']());}}}return this[_0x4a517f(0xc3f)]['baseLayerPicker']&&this['controls'][_0x4a517f(_0x250f9e._0x39b976)]['reload'](),this['_optionsBasemapsList'][_0x4a517f(_0x250f9e._0x5e44ca)];}['setLayersOptions'](_0x55b235){const _0x3d9048={_0x4778b8:0xa0a,_0x3de4c7:0xea3},_0x5e4083=_0x35a251;if(!_0x55b235||_0x55b235['length']===0x0)return;this['_optionsLayersList'][_0x5e4083(0xdbd)](_0x847b33=>{_0x847b33['destroy']();}),this['_optionsLayersList']['removeAll'](),this['options']['layers']=_0x55b235;for(let _0x18d319=0x0;_0x18d319<_0x55b235['length'];_0x18d319++){const _0x3cef69=_0x55b235[_0x18d319];!_0x3cef69['id']&&(_0x3cef69['id']=this['getNextLayerId']());const _0x48d285=create$2(_0x3cef69,this['options'][_0x5e4083(_0x3d9048._0x4778b8)]);if(!_0x48d285)continue;_0x3cef69['show']&&this['addLayer'](_0x48d285);this['_optionsLayersList']['set'](_0x3cef69['id'],_0x48d285);if(_0x48d285[_0x5e4083(0x977)]&&_0x3cef69[_0x5e4083(0x658)])for(let _0x158e66=0x0;_0x158e66<_0x3cef69['layers']['length'];_0x158e66++){const _0x1ce8e0=_0x3cef69['layers'][_0x158e66];_0x1ce8e0['pid']=_0x3cef69['id'],_0x1ce8e0['parent']=_0x48d285,!_0x1ce8e0['id']&&(_0x1ce8e0['id']=this['getNextLayerId']());}}return this['_optionsLayersList'][_0x5e4083(_0x3d9048._0x3de4c7)];}[_0x35a251(0xf0b)](){const _0x5648ed={_0x3a68a7:0xab3},_0x2c1bd9=_0x35a251;while(this['_arrLayerIdx']['indexOf'](this['_layerIdx'])!==-0x1){this[_0x2c1bd9(_0x5648ed._0x3a68a7)]++;}return this['_arrLayerIdx']['push'](this['_layerIdx']),this['_layerIdx'];}['addLayer'](_0x473cb2,_0x445758){const _0xd9b490={_0x221880:0xaa2,_0x10bb78:0x85f,_0x1fdea3:0x888,_0x17a199:0xf0b,_0x4ef0f8:0xd12,_0x16ad84:0xcd3};return new Promise((_0x1cc6a3,_0x1006c9)=>{const _0x1cbfcc=_0x2767;if(!_0x473cb2||!_0x473cb2['_onAdd']){_0x1cc6a3(![]);return;}Cesium__namespace[_0x1cbfcc(_0xd9b490._0x221880)](_0x445758)&&(_0x473cb2['show']=_0x445758);if(_0x473cb2['_state']===State['ADDED']){_0x1cc6a3(![]);return;}_0x473cb2[_0x1cbfcc(_0xd9b490._0x10bb78)](this);const _0x554367=this['_layerList'][_0x1cbfcc(_0xd9b490._0x1fdea3)](_0x473cb2['id']);_0x554367&&_0x554367!==_0x473cb2&&(_0x473cb2['id']=this[_0x1cbfcc(_0xd9b490._0x17a199)](),logWarn(_0x1cbfcc(_0xd9b490._0x4ef0f8),_0x473cb2)),this['_layerList'][_0x1cbfcc(_0xd9b490._0x16ad84)](_0x473cb2['id'],_0x473cb2),_0x473cb2[_0x1cbfcc(0x3e2)]['then'](function(_0x20ca02){_0x1cc6a3(!![]);});});}['removeLayer'](_0x1ee7b4,_0x4d1223){const _0x5649cb={_0x2bbef0:0x34c},_0x3ee209=_0x35a251;if(!_0x1ee7b4)return this;if(isString(_0x1ee7b4)||isNumber(_0x1ee7b4)){_0x1ee7b4=this['_layerList']['get'](_0x1ee7b4);if(!_0x1ee7b4)return this;}if(!_0x1ee7b4['isAdded'])return;return this[_0x3ee209(_0x5649cb._0x2bbef0)]['remove'](_0x1ee7b4['id']),_0x4d1223&&_0x1ee7b4[_0x3ee209(0x386)]&&_0x1ee7b4['clear'](),_0x1ee7b4['_onRemove'](),_0x4d1223&&(this['_optionsBasemapsList']['remove'](_0x1ee7b4['id']),this['_optionsLayersList']['remove'](_0x1ee7b4['id']),_0x1ee7b4[_0x3ee209(0xa63)]()),this;}[_0x35a251(0x816)](_0x347870){if(!_0x347870)return![];return isObject(_0x347870)&&(_0x347870=_0x347870['id']),this['_layerList']['contains'](_0x347870);}['eachLayer'](_0x3db9ec,_0x5c8e47){const _0x2a8060=_0x35a251;return this['_layerList'][_0x2a8060(0xdbd)](_0x3db9ec,_0x5c8e47||this),this;}['getLayer'](_0x2eaba9,_0x4fff44){return isObject(_0x2eaba9)&&(_0x2eaba9=_0x2eaba9['id']),this['getLayerByAttr'](_0x2eaba9,_0x4fff44);}['getLayerById'](_0x2d2256){const _0x182aca={_0x5144dc:0x268},_0x5d2d1d=_0x35a251;let _0x3e0183=this[_0x5d2d1d(0x34c)]['get'](_0x2d2256);if(_0x3e0183)return _0x3e0183;_0x3e0183=this['_optionsLayersList']['get'](_0x2d2256);if(_0x3e0183)return _0x3e0183;_0x3e0183=this[_0x5d2d1d(_0x182aca._0x5144dc)][_0x5d2d1d(0x888)](_0x2d2256);if(_0x3e0183)return _0x3e0183;const _0x2f3a2a=this['getLayers']({'basemaps':!![],'layers':!![]});for(let _0x59d4b0=0x0,_0x55eb2e=_0x2f3a2a['length'];_0x59d4b0<_0x55eb2e;_0x59d4b0++){const _0x5bb87c=_0x2f3a2a[_0x59d4b0];if(_0x5bb87c['id']===_0x2d2256)return _0x5bb87c;if(_0x5bb87c['hasChildLayer']&&_0x5bb87c['arrLayer'])for(let _0x8aef05=0x0;_0x8aef05<_0x5bb87c['arrLayer']['length'];_0x8aef05++){const _0x5d38b6=_0x5bb87c[_0x5d2d1d(0xcb8)][_0x8aef05];if(_0x5d38b6['id']===_0x2d2256)return _0x5d38b6;}}return undefined;}['getLayerByAttr'](_0x4e92be,_0x5602d7){const _0x236a61={_0x124ffe:0x268},_0x2591f2=_0x35a251;let _0x3cf9f5=this['_layerList'][_0x2591f2(0x9fb)](_0x4e92be,_0x5602d7);if(_0x3cf9f5)return _0x3cf9f5;_0x3cf9f5=this['_optionsLayersList']['getByAttr'](_0x4e92be,_0x5602d7);if(_0x3cf9f5)return _0x3cf9f5;_0x3cf9f5=this[_0x2591f2(_0x236a61._0x124ffe)]['getByAttr'](_0x4e92be,_0x5602d7);if(_0x3cf9f5)return _0x3cf9f5;return undefined;}['getLayersByAttr'](_0x277fef,_0x8465e9){const _0x190c3f={_0x182cae:0x341,_0xf1f85f:0x4f8},_0x11ad3f=_0x35a251,_0x3f5f3d=this['_layerList']['getListByAttr'](_0x277fef,_0x8465e9);let _0x44d885=this['_optionsLayersList']['getListByAttr'](_0x277fef,_0x8465e9);for(let _0x3e39fd=0x0,_0x4e602b=_0x44d885['length'];_0x3e39fd<_0x4e602b;_0x3e39fd++){const _0x4fbc8d=_0x44d885[_0x3e39fd];!this['_layerList'][_0x11ad3f(_0x190c3f._0x182cae)](_0x4fbc8d['id'])&&_0x3f5f3d[_0x11ad3f(0x6de)](_0x4fbc8d);}_0x44d885=this['_optionsBasemapsList'][_0x11ad3f(_0x190c3f._0xf1f85f)](_0x277fef,_0x8465e9);for(let _0x598acc=0x0,_0x55e0e1=_0x44d885[_0x11ad3f(0xe1e)];_0x598acc<_0x55e0e1;_0x598acc++){const _0x553805=_0x44d885[_0x598acc];!this[_0x11ad3f(0x34c)]['contains'](_0x553805['id'])&&_0x3f5f3d['push'](_0x553805);}return _0x3f5f3d;}['getLayers'](_0x3767c8={}){const _0x154e11={_0xd3f4d2:0xdbd},_0x529138={_0x3463ba:0x605,_0x350233:0x6de},_0x5f231d=_0x35a251;let _0x1913b9=[];return _0x3767c8[_0x5f231d(0xe2d)]&&(_0x1913b9=_0x1913b9['concat'](this[_0x5f231d(0x268)]['values'])),_0x3767c8['layers']&&(_0x1913b9=_0x1913b9['concat'](this['_optionsLayersList']['values'])),_0x3767c8['filter']&&(_0x3767c8['basemaps']=![],_0x3767c8['layers']=![]),this['_layerList'][_0x5f231d(_0x154e11._0xd3f4d2)](_0x44c920=>{const _0x17e6fc=_0x5f231d;if(_0x44c920['isPrivate'])return;if(_0x3767c8['childs']===![]&&_0x44c920[_0x17e6fc(_0x529138._0x3463ba)])return;if(Cesium__namespace[_0x17e6fc(0xaa2)](_0x3767c8['basemaps'])&&this['_optionsBasemapsList']['contains'](_0x44c920['id']))return;if(Cesium__namespace[_0x17e6fc(0xaa2)](_0x3767c8['layers'])&&this['_optionsLayersList']['contains'](_0x44c920['id']))return;_0x1913b9[_0x17e6fc(_0x529138._0x350233)](_0x44c920);}),_0x1913b9;}['getBasemaps'](_0xd7d7f8){const _0x2a3b25={_0x36a983:0xe73,_0x369ea0:0xdbd},_0x1d6837=_0x35a251;if(this[_0x1d6837(0xebf)]['baseLayerPicker'])return console['log'](_0x1d6837(_0x2a3b25._0x36a983)),[];if(_0xd7d7f8){const _0x32b742=[];return this['_optionsBasemapsList'][_0x1d6837(_0x2a3b25._0x369ea0)](_0x1b5574=>{const _0x6917b2=_0x1d6837;if(_0x1b5574[_0x6917b2(0x804)])return;_0x32b742[_0x6917b2(0x6de)](_0x1b5574);}),_0x32b742;}else return this['_optionsBasemapsList']['values'];}[_0x35a251(0xe7)](){const _0x178bb2={_0x4a5c52:0x93a,_0x42137a:0xdbd},_0x138a64={_0x48d26a:0x63e,_0x14c38b:0x4b7},_0x236aad=_0x35a251;let _0x431ee8=[];return _0x431ee8=_0x431ee8[_0x236aad(_0x178bb2._0x4a5c52)](this[_0x236aad(0x85e)](!![])),this['_optionsLayersList']['forEach'](_0xb69a2e=>{_0xb69a2e['isTile']&&!_0xb69a2e['isPrivate']&&_0x431ee8['push'](_0xb69a2e);}),this[_0x236aad(0x34c)][_0x236aad(_0x178bb2._0x42137a)](_0x3d0075=>{const _0x55c974=_0x236aad;if(!_0x3d0075[_0x55c974(_0x138a64._0x48d26a)]||_0x3d0075[_0x55c974(_0x138a64._0x14c38b)])return;if(this['_optionsBasemapsList']['contains'](_0x3d0075['id']))return;if(this['_optionsLayersList']['contains'](_0x3d0075['id']))return;_0x431ee8['push'](_0x3d0075);}),_0x431ee8;}['_initControls'](){const _0x4776af={_0x32d047:0xe86,_0x16c317:0x525,_0x323445:0x1f6,_0x5c8a40:0x631,_0xf5cdd6:0x230},_0x533a0d=_0x35a251;var _0x1208ff,_0x154d83,_0x377d34;const _0x494046=((_0x1208ff=this['options'])===null||_0x1208ff===void 0x0?void 0x0:_0x1208ff['control'])||{};add((_0x154d83=this['_viewer'])===null||_0x154d83===void 0x0?void 0x0:_0x154d83['scene'],this[_0x533a0d(_0x4776af._0x32d047)][_0x533a0d(0xd68)]),this['_popupMgr']=new PopupMgr(_0x494046['popup']),this['_popupMgr']['isPrivate']=!![],this[_0x533a0d(_0x4776af._0x16c317)](this['_popupMgr']),this[_0x533a0d(_0x4776af._0x323445)]=new TooltipMgr(_0x494046[_0x533a0d(_0x4776af._0x5c8a40)]),this['_tooltipMgr'][_0x533a0d(0x4b7)]=!![],this['addControl'](this['_tooltipMgr']),this['_contextmenuMgr']=new ContextMenu(_0x494046['contextmenu']),this['_contextmenuMgr']['isPrivate']=!![],this[_0x533a0d(_0x4776af._0x16c317)](this['_contextmenuMgr']);(((_0x377d34=_0x494046['contextmenu'])===null||_0x377d34===void 0x0?void 0x0:_0x377d34['hasDefault'])??!![])&&this['bindContextMenu'](this['getDefaultContextMenu']());this[_0x533a0d(_0x4776af._0xf5cdd6)]=new SmallTooltip(_0x494046['smallTooltip']),this['_smallTooltip']['isPrivate']=!![],this['addControl'](this[_0x533a0d(_0x4776af._0xf5cdd6)]),this[_0x533a0d(0x193)]=new KeyboardRoam({'enabled':![],..._0x494046['keyboardRoam']||{}}),this['_keyboardRoam']['isPrivate']=!![],this['addControl'](this[_0x533a0d(0x193)]);for(const _0x1fedd0 in _0x494046){const _0x4d09f2=_0x494046[_0x1fedd0];if(!_0x4d09f2||_0x4d09f2['enabled']===![])continue;const _0x2136b4=create$1(_0x1fedd0,_0x4d09f2);_0x2136b4&&this['addControl'](_0x2136b4);}}[_0x35a251(0x525)](_0x47bcb0,_0x15d89b){const _0x4d9400={_0x3db1ef:0x85f,_0x30865a:0x8ea,_0x34e80c:0xcd3,_0x49e099:0x264,_0x4684bd:0x525},_0xb6682a=_0x35a251;if(!_0x47bcb0||!_0x47bcb0[_0xb6682a(_0x4d9400._0x3db1ef)])return this;if(this['_controls'][_0x47bcb0[_0xb6682a(_0x4d9400._0x30865a)]])return logWarn('地图上已有'+_0x47bcb0['type']+'控件,请直接使用\x20map.controls.'+_0x47bcb0['type']+'\x20对象\x20',this),this;return Cesium__namespace['defined'](_0x15d89b)&&(_0x47bcb0[_0xb6682a(0x2a6)]=_0x15d89b),_0x47bcb0['_onAdd'](this),this['_controlList'][_0xb6682a(_0x4d9400._0x34e80c)](_0x47bcb0['id'],_0x47bcb0),this['_controls'][_0x47bcb0[_0xb6682a(_0x4d9400._0x30865a)]]=_0x47bcb0,this[_0xb6682a(_0x4d9400._0x49e099)](EventType[_0xb6682a(_0x4d9400._0x4684bd)],{'control':_0x47bcb0}),this;}['removeControl'](_0x1ec82c,_0x376212){const _0x43b777={_0x2fbb5b:0x127},_0x18d249=_0x35a251;if(!_0x1ec82c)return this;return this['_controlList']['remove'](_0x1ec82c['id']),delete this['_controls'][_0x1ec82c['type']],_0x1ec82c[_0x18d249(_0x43b777._0x2fbb5b)](),this['fire'](EventType['removeControl'],{'control':_0x1ec82c}),_0x376212&&_0x1ec82c['destroy'](),this;}['hasControl'](_0x177b0f){return this['_controlList']['contains']((_0x177b0f===null||_0x177b0f===void 0x0?void 0x0:_0x177b0f['id'])||_0x177b0f);}['eachControl'](_0x371186,_0x1e4ea4){return this['_controlList']['forEach'](_0x371186,_0x1e4ea4||this),this;}[_0x35a251(0x12e)](_0x28661f,_0x503311=_0x35a251(0x8ea)){const _0xd72591=_0x35a251;return this['_controlList'][_0xd72591(0x9fb)](_0x28661f,_0x503311);}['_initEffect'](){const _0x4ccd1f={_0x5785b0:0x49d,_0x14839b:0x2a6},_0x25049a=_0x35a251;var _0xb3efe;const _0x207361=(_0xb3efe=this['options'])===null||_0xb3efe===void 0x0?void 0x0:_0xb3efe[_0x25049a(_0x4ccd1f._0x5785b0)];if(_0x207361)for(const _0x53053f in _0x207361){const _0x5b0cbd=_0x207361[_0x53053f];if(!_0x5b0cbd||_0x5b0cbd[_0x25049a(_0x4ccd1f._0x14839b)]===![])continue;const _0x3bf369=create(_0x53053f,_0x5b0cbd);_0x3bf369&&this['addEffect'](_0x3bf369);}}[_0x35a251(0x3b0)](_0x18bb5a){const _0x4fe367={_0x1f4ec0:0x8ea,_0x389cf6:0x3b0},_0x298083=_0x35a251;if(!_0x18bb5a||!_0x18bb5a['_onAdd'])return this;if(this['_effects'][_0x18bb5a['type']]){logError$1('地图上已有'+_0x18bb5a['type']+'特效,请直接使用\x20map.effects.'+_0x18bb5a[_0x298083(_0x4fe367._0x1f4ec0)]+'\x20对象\x20',this);return;}this['addThing'](_0x18bb5a),this['_effects'][_0x18bb5a[_0x298083(0x8ea)]]=_0x18bb5a,this['fire'](EventType[_0x298083(_0x4fe367._0x389cf6)],{'effect':_0x18bb5a});}['removeEffect'](_0x18e710,_0x2815d5){delete this['_effects'][_0x18e710['type']],this['fire'](EventType['removeEffect'],{'effect':_0x18e710}),this['removeThing'](_0x18e710,_0x2815d5);}['getEffect'](_0x24d863,_0x10f3d4=_0x35a251(0x8ea)){return this['getThing'](_0x24d863,_0x10f3d4);}['addThing'](_0x19f71a){const _0x7a9241={_0x4e6e7b:0xcc4,_0x3d7937:0xcd3},_0x198a18=_0x35a251;if(!_0x19f71a||!_0x19f71a['_onAdd'])return this;return _0x19f71a[_0x198a18(0x85f)](this),this[_0x198a18(_0x7a9241._0x4e6e7b)][_0x198a18(_0x7a9241._0x3d7937)](_0x19f71a['id'],_0x19f71a),this;}['removeThing'](_0x5accb4,_0x288d1d){const _0x1b947c={_0x123151:0x1ee},_0x56cb09=_0x35a251;if(!_0x5accb4)return this;return this['_thingList'][_0x56cb09(_0x1b947c._0x123151)](_0x5accb4['id']),_0x288d1d&&_0x5accb4['clear']&&_0x5accb4['clear'](),_0x5accb4[_0x56cb09(0x127)](),_0x288d1d&&_0x5accb4[_0x56cb09(0xa63)](),this;}['hasThing'](_0x6a6e92){const _0x39e23a=_0x35a251;return this[_0x39e23a(0xcc4)]['contains']((_0x6a6e92===null||_0x6a6e92===void 0x0?void 0x0:_0x6a6e92['id'])||_0x6a6e92);}['eachThing'](_0x2e21c7,_0x56b415){return this['_thingList']['forEach'](_0x2e21c7,_0x56b415||this),this;}['getThing'](_0x23d875,_0x521c51){const _0x577836={_0x50dd3b:0x9fb},_0x27cb54=_0x35a251;return this['_thingList'][_0x27cb54(_0x577836._0x50dd3b)](_0x23d875,_0x521c51);}[_0x35a251(0x44e)](_0x53469c){const _0x4c0eed=_0x35a251;return getLangText(_0x53469c,this[_0x4c0eed(0x9e3)]);}['zoomIn'](_0xe4c939,_0x16a106){const _0x30eab7=_0x35a251,_0x5b8509=this['_zoomNavigation']['zoomIn'](_0xe4c939,_0x16a106);return _0x5b8509&&this[_0x30eab7(0x264)](EventType['zoom'],{'ztype':'zoomIn','relativeAmount':_0xe4c939,'mandatory':_0x16a106}),_0x5b8509;}['zoomOut'](_0xa5ce1d,_0x24e607){const _0x2180c5=_0x35a251,_0x3c4ac1=this[_0x2180c5(0xb06)]['zoomOut'](_0xa5ce1d,_0x24e607);return _0x3c4ac1&&this['fire'](EventType['zoom'],{'ztype':'zoomOut','relativeAmount':_0xa5ce1d,'mandatory':_0x24e607}),_0x3c4ac1;}['changeMouseModel'](_0x50f33c){const _0x5b5025={_0x51dda1:0x46e,_0x64ed59:0xc60,_0x3069dd:0xebf,_0x53989e:0x77d,_0x3c6666:0xc3e,_0x437d16:0x46e,_0x17555d:0xbbb,_0x3a2bc3:0x77d,_0x23809f:0xafc},_0x47cc3b=_0x35a251;this['_hasRightTilt']=_0x50f33c,_0x50f33c?(this['_viewer']['scene']['screenSpaceCameraController'][_0x47cc3b(0x5c0)]=[Cesium__namespace['CameraEventType'][_0x47cc3b(0xb77)],Cesium__namespace[_0x47cc3b(0x77d)]['PINCH'],{'eventType':Cesium__namespace['CameraEventType']['LEFT_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier'][_0x47cc3b(0xf12)]},{'eventType':Cesium__namespace['CameraEventType']['RIGHT_DRAG'],'modifier':Cesium__namespace[_0x47cc3b(_0x5b5025._0x51dda1)]['CTRL']}],this['_viewer'][_0x47cc3b(_0x5b5025._0x64ed59)]['screenSpaceCameraController'][_0x47cc3b(0x3f2)]=[Cesium__namespace[_0x47cc3b(0x77d)][_0x47cc3b(0x8cc)],Cesium__namespace['CameraEventType']['WHEEL'],Cesium__namespace['CameraEventType']['PINCH']]):(this[_0x47cc3b(_0x5b5025._0x3069dd)]['scene']['screenSpaceCameraController']['tiltEventTypes']=[Cesium__namespace[_0x47cc3b(_0x5b5025._0x53989e)]['MIDDLE_DRAG'],Cesium__namespace[_0x47cc3b(0x77d)]['PINCH'],{'eventType':Cesium__namespace['CameraEventType'][_0x47cc3b(_0x5b5025._0x3c6666)],'modifier':Cesium__namespace[_0x47cc3b(0x46e)][_0x47cc3b(0xf12)]},{'eventType':Cesium__namespace['CameraEventType']['RIGHT_DRAG'],'modifier':Cesium__namespace[_0x47cc3b(_0x5b5025._0x437d16)]['CTRL']}],this[_0x47cc3b(0xebf)]['scene'][_0x47cc3b(_0x5b5025._0x17555d)]['zoomEventTypes']=[Cesium__namespace[_0x47cc3b(_0x5b5025._0x53989e)]['RIGHT_DRAG'],Cesium__namespace[_0x47cc3b(_0x5b5025._0x3a2bc3)]['WHEEL'],Cesium__namespace[_0x47cc3b(0x77d)]['PINCH']]),this['controls']['mouseDownView']&&this['controls']['mouseDownView'][_0x47cc3b(_0x5b5025._0x23809f)]();}[_0x35a251(0x411)](){const _0x51eda8={_0x5b8e52:0xebf,_0x187cc2:0x6b2,_0x3bddac:0x471},_0x5ee042=_0x35a251;delete this['_pitch_max'],delete this['_pitch_min'],delete this['_pitch_minHeight'],this[_0x5ee042(_0x51eda8._0x5b8e52)]['scene']['screenSpaceCameraController']['inertiaSpin']=0.9,this['_viewer']['scene']['screenSpaceCameraController']['inertiaTranslate']=0.9,this['off'](EventType['mouseDown'],this['_setPitchRange_rightDownHandler'],this),this['off'](EventType[_0x5ee042(0x34d)],this['_setPitchRange_rightUpHandler'],this),this[_0x5ee042(_0x51eda8._0x187cc2)](EventType['mouseMove'],this['_setPitchRange_mouseMoveHandler'],this),this['off'](EventType[_0x5ee042(0xbbf)],this[_0x5ee042(_0x51eda8._0x3bddac)],this);}['setPitchRange'](_0x105a6e,_0x5bf9fa=-0x5a){const _0xe9b8f4={_0x12f908:0xc60,_0x11afe9:0xc9,_0x5ca9e4:0x34d,_0xd7920:0xa61},_0x37cb2e=_0x35a251;this['clearPitchRange'](),this['_viewer'][_0x37cb2e(_0xe9b8f4._0x12f908)]['screenSpaceCameraController']['inertiaSpin']=0x0,this['_viewer'][_0x37cb2e(0xc60)][_0x37cb2e(0xbbb)]['inertiaTranslate']=0x0,this[_0x37cb2e(_0xe9b8f4._0x11afe9)]=Cesium__namespace['Math']['toRadians'](_0x105a6e),this['_pitch_min']=Cesium__namespace['Math'][_0x37cb2e(0x7ba)](_0x5bf9fa),this['on'](EventType['mouseDown'],this['_setPitchRange_rightDownHandler'],this),this['on'](EventType[_0x37cb2e(_0xe9b8f4._0x5ca9e4)],this[_0x37cb2e(_0xe9b8f4._0xd7920)],this);}['_setPitchRange_rightDownHandler'](_0x139325){const _0x50efa5={_0x1595bd:0xebf,_0x56cba4:0x637,_0x3f2a20:0x971},_0x480a87=_0x35a251;if(this[_0x480a87(_0x50efa5._0x1595bd)]['scene']['mode']!==Cesium__namespace[_0x480a87(_0x50efa5._0x56cba4)]['SCENE3D'])return;if(this['_viewer']['camera']['positionCartographic'][_0x480a87(0x682)]>this['_viewer'][_0x480a87(0xc60)]['screenSpaceCameraController']['minimumCollisionTerrainHeight'])return;this['_pitch_minHeight']=this['_viewer']['camera']['positionCartographic']['height'],this['on'](EventType[_0x480a87(_0x50efa5._0x3f2a20)],this[_0x480a87(0x8c4)],this),this['on'](EventType['cameraChanged'],this['_setPitchRange_cameraChangedHandler'],this);}['_setPitchRange_rightUpHandler'](_0x666e77){const _0x41b10e=_0x35a251;this['_viewer'][_0x41b10e(0xc60)]['screenSpaceCameraController']['enableTilt']=!![],this['off'](EventType['mouseMove'],this['_setPitchRange_mouseMoveHandler'],this),this['off'](EventType['cameraChanged'],this['_setPitchRange_cameraChangedHandler'],this);}[_0x35a251(0x8c4)](_0x55d259){const _0x101aa2={_0x677c4b:0x7d,_0x558b97:0xe63,_0x536e6d:0x83f},_0x48ed5c=_0x35a251;let _0x5723bf=!![];const _0x729278=_0x55d259['endPosition']['y']<_0x55d259['startPosition']['y'];if(_0x729278&&this['_viewer'][_0x48ed5c(_0x101aa2._0x677c4b)][_0x48ed5c(0x527)]>this['_pitch_max'])_0x5723bf=![];else!_0x729278&&this['_viewer']['camera']['pitch']this[_0x4847de(0xebf)]['scene']['screenSpaceCameraController']['minimumCollisionTerrainHeight'])return;let _0x5bf26a=this[_0x4847de(0xebf)]['camera']['pitch'];if(_0x5bf26a>this[_0x4847de(0xc9)]||_0x5bf26athis[_0x4847de(0xc9)])_0x5bf26a=this['_pitch_max'];else _0x5bf26a{const _0xb620c1={_0x29ac15:0x8ab},_0xf0158d={_0xcadb90:0x767},_0x3028ab=_0x2767;if(!_0x5cb6c2||_0x5cb6c2['lng']===0x0&&_0x5cb6c2['lat']===0x0&&_0x5cb6c2['alt']===0x0){_0x34d7b2(![]);return;}isNumber(_0x536811)&&(_0x536811={'duration':_0x536811});let _0x3f8415=_0x536811[_0x3028ab(0x543)]??0x9c4;this[_0x3028ab(0xebf)]['camera'][_0x3028ab(0x78e)]['height']<_0x3f8415&&(_0x3f8415=this['_viewer'][_0x3028ab(0x7d)]['positionCartographic']['height']);Cesium__namespace[_0x3028ab(0xaa2)](_0x5cb6c2['alt'])&&(_0x3f8415=_0x5cb6c2['alt']);let _0x3da51e;if(Cesium__namespace['defined'](_0x5cb6c2['lng'])&&Cesium__namespace['defined'](_0x5cb6c2[_0x3028ab(0xb9d)]))_0x3da51e=Cesium__namespace['Cartesian3']['fromDegrees'](_0x5cb6c2['lng'],_0x5cb6c2[_0x3028ab(_0x4a97e0._0x32a620)],_0x3f8415);else Cesium__namespace['defined'](_0x5cb6c2['x'])&&Cesium__namespace[_0x3028ab(_0x4a97e0._0x4842ef)](_0x5cb6c2['y'])?(Cesium__namespace['defined'](_0x5cb6c2['z'])&&(_0x3f8415=_0x5cb6c2['z']),_0x3da51e=Cesium__namespace['Cartesian3'][_0x3028ab(_0x4a97e0._0x271288)](_0x5cb6c2['x'],_0x5cb6c2['y'],_0x3f8415)):_0x3da51e=this['_viewer'][_0x3028ab(0x7d)]['position'];const _0x1dfab8={..._0x536811,'destination':_0x3da51e,'orientation':{'heading':Cesium__namespace[_0x3028ab(0x7c0)]['toRadians'](_0x5cb6c2['heading']??0x0),'pitch':Cesium__namespace['Math']['toRadians'](_0x5cb6c2['pitch']??-0x5a),'roll':Cesium__namespace[_0x3028ab(0x7c0)]['toRadians'](_0x5cb6c2['roll']??0x0)},'complete':()=>{const _0x57ed3d=_0x3028ab;_0x536811[_0x57ed3d(_0xf0158d._0xcadb90)]&&_0x536811[_0x57ed3d(0x767)](),_0x34d7b2(!![]);},'cancel':()=>{const _0x2da26c=_0x3028ab;_0x536811['cancel']&&_0x536811[_0x2da26c(_0xb620c1._0x29ac15)](),_0x34d7b2(![]);}};_0x536811[_0x3028ab(0x262)]===0x0?(this[_0x3028ab(_0x4a97e0._0x1f59d1)]['camera']['setView'](_0x1dfab8),_0x536811['complete']&&_0x536811['complete'](),_0x34d7b2(!![])):this['_viewer'][_0x3028ab(_0x4a97e0._0x480c25)]['flyTo'](_0x1dfab8);});}[_0x35a251(0x3a2)](_0x371db8,_0x1bba48){const _0x4352e5={_0x177802:0x1e4},_0x464fa9=_0x35a251;return this[_0x464fa9(_0x4352e5._0x177802)](_0x371db8,_0x1bba48);}['flyHome'](_0x282cde){const _0x663389={_0x1924ef:0x1fa,_0x2b1153:0x497},_0x2b2bc0=_0x35a251;var _0x45ae71,_0x44a104,_0x2c4937,_0x422a44;if((_0x45ae71=this['options'])!==null&&_0x45ae71!==void 0x0&&(_0x44a104=_0x45ae71['scene'])!==null&&_0x44a104!==void 0x0&&_0x44a104['center'])this['setCameraView'](this[_0x2b2bc0(0xe86)][_0x2b2bc0(0xc60)]['center'],_0x282cde);else(_0x2c4937=this['options'])!==null&&_0x2c4937!==void 0x0&&(_0x422a44=_0x2c4937['scene'])!==null&&_0x422a44!==void 0x0&&_0x422a44[_0x2b2bc0(_0x663389._0x1924ef)]&&this[_0x2b2bc0(_0x663389._0x2b1153)](this['options']['scene']['extent'],_0x282cde);}['setCameraViewList'](_0xe31ad2,_0xf8a7c3={}){const _0x3c4f2d={_0x80859:0x598},_0x1858c8=_0x35a251;this['cancelFlyTo'](),this['_setCameraViewListArr']=_0xe31ad2,this['_setCameraViewListOptions']=_0xf8a7c3,this[_0x1858c8(_0x3c4f2d._0x80859)]=!![],this[_0x1858c8(0x63a)](0x0,_0xf8a7c3);}['pauseCameraViewList'](){this['cancelFlyTo']();}[_0x35a251(0x1e2)](){this['_setCameraViewListState']=!![],this['_setCameraViewListItem'](this['_setCameraViewListIndex'],this['_setCameraViewListOptions']);}['_setCameraViewListItem'](_0x19639a,_0x39f3e1){const _0x2d78cb={_0x5647df:0xe1e,_0xa2a05b:0x767,_0x463dfe:0x767,_0x491cc4:0x848,_0x314052:0x898},_0x1eadbd=_0x35a251,_0x37ce2e=this;if(!this['_setCameraViewListState']||_0x19639a<0x0||_0x19639a>=this['_setCameraViewListArr'][_0x1eadbd(_0x2d78cb._0x5647df)]){this['_setCameraViewListState']=![];_0x39f3e1!==null&&_0x39f3e1!==void 0x0&&_0x39f3e1[_0x1eadbd(_0x2d78cb._0xa2a05b)]&&_0x39f3e1[_0x1eadbd(_0x2d78cb._0x463dfe)]();return;}this['_setCameraViewListIndex']=_0x19639a;const _0x43d278=this[_0x1eadbd(_0x2d78cb._0x491cc4)][_0x19639a];_0x43d278['onStart']&&_0x43d278['onStart']();let _0x3566c6;this['setCameraView'](_0x43d278,{'easingFunction':Cesium__namespace[_0x1eadbd(_0x2d78cb._0x314052)]['LINEAR_NONE'],..._0x39f3e1,'duration':_0x43d278['duration'],'complete':function(){const _0x518153=_0x1eadbd;_0x43d278['onEnd']&&_0x43d278[_0x518153(0xd1e)]();const _0x49b07d=_0x43d278['stop']??0x1;_0x3566c6=setTimeout(()=>{_0x37ce2e['_setCameraViewListItem'](++_0x19639a,_0x39f3e1);},_0x49b07d*0x3e8);},'cancle':function(){this['_setCameraViewListState']=![],clearTimeout(_0x3566c6),_0x39f3e1!==null&&_0x39f3e1!==void 0x0&&_0x39f3e1['cancel']&&_0x39f3e1['cancel']();}});}['flyTo'](_0x35f3e9,_0x38905c){if(!_0x35f3e9)return;return this['_viewer']['flyTo'](_0x35f3e9,_0x38905c);}['flyToGraphic'](_0x25363d,_0x435c35={}){const _0x5e4bd1={_0x4d284c:0xc74,_0xa26be2:0x719,_0x33532b:0xe1e,_0x2c2c37:0x878},_0x293afe=_0x35a251;if(!_0x25363d||_0x25363d['length']===0x0)return Promise[_0x293afe(_0x5e4bd1._0x4d284c)](![]);if(_0x25363d['flyTo']){var _0x48293a;return _0x435c35['clampToGround']=(_0x48293a=_0x25363d['style'])===null||_0x48293a===void 0x0?void 0x0:_0x48293a[_0x293afe(0x979)],_0x25363d[_0x293afe(0x5b2)](_0x435c35);}if(!Array[_0x293afe(_0x5e4bd1._0xa26be2)](_0x25363d))return Promise['resolve'](![]);if(_0x25363d[_0x293afe(0xe1e)]===0x1)return _0x25363d[0x0]['flyTo'](_0x435c35);let _0x33abfa;for(let _0x551de0=0x0,_0x30afa0=_0x25363d[_0x293afe(_0x5e4bd1._0x33532b)];_0x551de0<_0x30afa0;_0x551de0++){const _0x10ea14=_0x25363d[_0x551de0];if(!_0x10ea14['getRectangle'])continue;const _0x177d1c=_0x10ea14[_0x293afe(_0x5e4bd1._0x2c2c37)]();if(!Cesium__namespace['defined'](_0x177d1c))continue;_0x33abfa?_0x33abfa=Cesium__namespace[_0x293afe(0xd6)][_0x293afe(0xd8c)](_0x177d1c,_0x33abfa):_0x33abfa=_0x177d1c;}return this['flyToExtent'](_0x33abfa,_0x435c35);}['flyToPositions'](_0x8888ad,_0x264b36={}){const _0x2e08c3={_0x137ea1:0x5e2,_0x22f118:0xcea},_0x1f29fe=_0x35a251;if(!_0x8888ad||_0x8888ad['length']===0x0)return Promise['resolve'](![]);if(_0x8888ad['length']===0x1)return this['flyToPoint'](_0x8888ad[0x0],_0x264b36);const _0x2ad731=getRectangle(_0x8888ad,!![]);if(!_0x2ad731)return Promise['resolve'](![]);return _0x2ad731[_0x1f29fe(_0x2e08c3._0x137ea1)]===_0x2ad731[_0x1f29fe(0x1db)]&&_0x2ad731['ymin']===_0x2ad731[_0x1f29fe(_0x2e08c3._0x22f118)]||_0x2ad731['xmax']-_0x2ad731['xmin']>0xc8?this[_0x1f29fe(0xe1c)]([_0x2ad731['xmin'],_0x2ad731['ymin'],_0x2ad731['height']],_0x264b36):(_0x2ad731[_0x1f29fe(0x682)]=getMaxHeight(_0x8888ad),_0x264b36['scale']=_0x264b36[_0x1f29fe(0x1cb)]||1.2,this[_0x1f29fe(0x497)](_0x2ad731,_0x264b36));}['flyToExtent'](_0x545592,_0x12103a={}){const _0x48b3d9={_0x5ccb6d:0xd6,_0x1ec43b:0xebf},_0x58a48c=_0x35a251;_0x545592 instanceof Cesium__namespace[_0x58a48c(_0x48b3d9._0x5ccb6d)]&&(_0x545592=formatRectangle(_0x545592));const _0x1d662e=_0x545592['xmin'],_0x495df3=_0x545592[_0x58a48c(0x1db)],_0x455232=_0x545592['ymin'],_0x478375=_0x545592['ymax'],_0x1df497=(_0x1d662e+_0x495df3)/0x2,_0x299b31=(_0x455232+_0x478375)/0x2;if(_0x1df497===0x0&&_0x299b31===0x0)return Promise['resolve'](![]);let _0x31cf3e=_0x545592['height']??_0x12103a['height']??0x0;if(_0x31cf3e===0x0){var _0x517db0;_0x31cf3e=getHeight((_0x517db0=this[_0x58a48c(_0x48b3d9._0x1ec43b)])===null||_0x517db0===void 0x0?void 0x0:_0x517db0['scene'],Cesium__namespace['Cartesian3']['fromDegrees'](_0x1df497,_0x299b31));}const _0x11a472=Cesium__namespace['Rectangle'][_0x58a48c(0xa6d)](_0x1d662e,_0x455232,_0x495df3,_0x478375),_0x5c38e4=Math['max'](_0x11a472['height'],_0x11a472['width']);if(_0x5c38e4>0x0){var _0x295156;_0x12103a['radius']=(_0x12103a['radius']??0x0)+Cesium__namespace['Math']['chordLength'](_0x5c38e4,(_0x295156=this[_0x58a48c(_0x48b3d9._0x1ec43b)])===null||_0x295156===void 0x0?void 0x0:_0x295156['scene']['globe'][_0x58a48c(0x3f4)]['maximumRadius']);}return this['flyToPoint'](new LngLatPoint(_0x1df497,_0x299b31,_0x31cf3e),_0x12103a);}['flyToPoint'](_0x42f7d1,_0x482e55={}){const _0x2ed58b={_0x1ef85e:0xaa2,_0x267a3c:0x7ba,_0x25539b:0x7d,_0x21d1a8:0x1c1,_0x49398b:0x3b8},_0x55be26={_0x34a73f:0x682,_0x46ad5e:0xe1c};return new Promise((_0x3bd8e3,_0x3a1580)=>{const _0x22884b=_0x2767;if(!_0x42f7d1){_0x3bd8e3(![]);return;}_0x42f7d1=LngLatPoint['parse'](_0x42f7d1);let _0x453997=_0x42f7d1['toCartesian']();if(_0x482e55['clampToGround']){if(this['hasTerrain']){getSurfaceHeight(this['_viewer']['scene'],_0x453997,{'has3dtiles':!![]})['then'](_0x36dc18=>{const _0x374f0c=_0x2767;_0x42f7d1['alt']=_0x36dc18[_0x374f0c(_0x55be26._0x34a73f)]*(this['_viewer']['scene']['globe'][_0x374f0c(0xd8a)]||0x1),delete _0x482e55['clampToGround'],this[_0x374f0c(_0x55be26._0x46ad5e)](_0x42f7d1,_0x482e55)['then'](_0x5e6473=>{_0x3bd8e3(_0x5e6473);});});return;}else _0x42f7d1['alt']=0x0,_0x453997=_0x42f7d1['toCartesian']();}let _0x33e290=_0x482e55['radius']||this[_0x22884b(0x58e)]()||0x64;Cesium__namespace['defined'](_0x482e55['scale'])&&_0x482e55['scale']>0x0&&(_0x33e290*=_0x482e55['scale']);Cesium__namespace[_0x22884b(0xaa2)](_0x482e55['minHeight'])&&_0x33e290<_0x482e55[_0x22884b(0x543)]&&(_0x33e290=_0x482e55['minHeight']);Cesium__namespace['defined'](_0x482e55['maxHeight'])&&_0x33e290>_0x482e55[_0x22884b(0x571)]&&(_0x33e290=_0x482e55['maxHeight']);let _0x32e20a;if(Cesium__namespace['defined'](_0x482e55['pitch']))_0x32e20a=Cesium__namespace['Math']['toRadians'](_0x482e55['pitch']);else{_0x32e20a=this['_viewer']['camera']['pitch'];const _0x2ecf59=Cesium__namespace['Math']['toDegrees'](_0x32e20a);Cesium__namespace[_0x22884b(_0x2ed58b._0x1ef85e)](_0x482e55[_0x22884b(0x905)])&&_0x2ecf59<_0x482e55[_0x22884b(0x905)]&&(_0x32e20a=Cesium__namespace['Math']['toRadians'](_0x482e55['minPitch'])),Cesium__namespace[_0x22884b(0xaa2)](_0x482e55['maxPitch'])&&_0x2ecf59>_0x482e55[_0x22884b(0x645)]&&(_0x32e20a=Cesium__namespace['Math']['toRadians'](_0x482e55[_0x22884b(0x645)]));}const _0x37e683=Cesium__namespace['defined'](_0x482e55['heading'])?Cesium__namespace['Math'][_0x22884b(_0x2ed58b._0x267a3c)](_0x482e55['heading']):this['_viewer']['camera'][_0x22884b(0x41f)],_0x2d6b68=new Cesium__namespace['HeadingPitchRange'](_0x37e683,_0x32e20a,_0x33e290),_0x9e71b5=new Cesium__namespace['BoundingSphere'](_0x453997,0x0);_0x482e55['duration']===0x0?(this['_viewer'][_0x22884b(_0x2ed58b._0x25539b)]['lookAt'](_0x453997,_0x2d6b68),!_0x482e55[_0x22884b(_0x2ed58b._0x21d1a8)]&&!this['_viewer']['trackedEntity']&&this['_viewer']['camera']['lookAtTransform'](Cesium__namespace['Matrix4'][_0x22884b(_0x2ed58b._0x49398b)]),_0x482e55['complete']&&_0x482e55['complete'](),_0x3bd8e3(!![])):this['_viewer']['camera'][_0x22884b(0x7fe)](_0x9e71b5,{..._0x482e55,'offset':_0x2d6b68,'complete':()=>{const _0x133848=_0x22884b;_0x482e55[_0x133848(0x767)]&&_0x482e55['complete'](),_0x3bd8e3(!![]);},'cancel':()=>{const _0x3c64bc=_0x22884b;_0x482e55[_0x3c64bc(0x8ab)]&&_0x482e55['cancel'](),_0x3bd8e3(![]);}});});}['isFlyAnimation'](){return this['_isFlyAnimation'];}['openFlyAnimation'](_0x22af54={}){const _0x1d516a={_0x515be9:0xd1f,_0xe040f1:0x5b2,_0x154ec1:0xa6d},_0x7e2790={_0x4339de:0x5d2},_0x7ecb74=this['_viewer'],_0x3d4be7=_0x22af54['center']||this['getCameraView']();return new Promise((_0x3ae1a3,_0x301f63)=>{const _0x4c8d3d={_0x7f45d:0xa9b,_0x1ce46d:0xa9b},_0x4994fa=_0x2767;this[_0x4994fa(_0x1d516a._0x515be9)]=!![];const _0x515799=this;function _0x35f6a6(_0x28a916){const _0x373985=_0x4994fa;_0x3ae1a3(_0x28a916),_0x22af54[_0x373985(_0x4c8d3d._0x7f45d)]&&_0x22af54[_0x373985(_0x4c8d3d._0x1ce46d)](_0x28a916),_0x515799['_isFlyAnimation']=![],_0x515799['openFlyAnimationEndFun']&&(_0x515799['openFlyAnimationEndFun'](),delete _0x515799['openFlyAnimationEndFun']);}_0x7ecb74[_0x4994fa(0x7d)]['setView']({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](-85.16,13.71,0x15ef3c0)}),_0x7ecb74['camera'][_0x4994fa(_0x1d516a._0xe040f1)]({'destination':Cesium__namespace['Cartesian3'][_0x4994fa(_0x1d516a._0x154ec1)](_0x3d4be7['lng'],_0x3d4be7['lat'],0x15ef3c0),'duration':_0x22af54['duration1']||0x2,'easingFunction':_0x22af54['easingFunction1']||Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':()=>{const _0x53563b={_0x423961:0x1e4},_0x33c918=_0x4994fa;let _0x22e17e=_0x3d4be7[_0x33c918(_0x7e2790._0x4339de)]??0x15f90;_0x22e17e<0x30d40&&_0x3d4be7['pitch']!==-0x5a?(_0x22e17e=_0x22e17e*1.2+0x1f40,_0x7ecb74['camera']['flyTo']({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](_0x3d4be7['lng'],_0x3d4be7['lat'],_0x22e17e),'duration':_0x22af54['duration2'],'easingFunction':_0x22af54[_0x33c918(0x94e)],'complete':()=>{const _0x3eb5c9=_0x33c918;this[_0x3eb5c9(_0x53563b._0x423961)](_0x3d4be7,{'duration':_0x22af54['duration3']||0x2,'easingFunction':_0x22af54['easingFunction3'],'complete':()=>{_0x35f6a6(!![]);},'cancel':()=>{_0x35f6a6(![]);}});},'cancel':()=>{_0x35f6a6(![]);}})):this['setCameraView'](_0x3d4be7,{'duration':_0x22af54['duration3']||0x2,'easingFunction':_0x22af54['easingFunction3'],'complete':()=>{_0x35f6a6(!![]);},'cancel':()=>{_0x35f6a6(![]);}});},'cancel':()=>{_0x35f6a6(![]);}});});}[_0x35a251(0x87a)](_0x44f991={}){const _0x190020={_0x4be8c1:0x5b2,_0x3221ef:0xfa7,_0x406f9e:0x7c0,_0x559a1e:0x41f,_0x7d5fe6:0x7ba},_0xb33113=_0x35a251,_0x254722=this[_0xb33113(0xebf)],_0x4f12b0=_0x44f991['center']||this['getCameraView']({'simplify':![]}),_0x4896de=(_0x44f991['duration']??0xa)/0x3;return new Promise((_0xca909e,_0x96d313)=>{const _0x3dc3c8={_0x280b12:0xfa7,_0x3b4ca2:0x5d2,_0x133096:0x7c0,_0x25e5f3:0x7ba},_0x3ac6b3=_0xb33113;_0x254722['camera'][_0x3ac6b3(_0x190020._0x4be8c1)]({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](_0x4f12b0[_0x3ac6b3(_0x190020._0x3221ef)]+0x78,_0x4f12b0['lat'],_0x4f12b0[_0x3ac6b3(0x5d2)]),'orientation':{'heading':Cesium__namespace[_0x3ac6b3(_0x190020._0x406f9e)][_0x3ac6b3(0x7ba)](_0x4f12b0[_0x3ac6b3(_0x190020._0x559a1e)]),'pitch':Cesium__namespace['Math'][_0x3ac6b3(_0x190020._0x7d5fe6)](_0x4f12b0['pitch']),'roll':Cesium__namespace['Math']['toRadians'](_0x4f12b0['roll']||0x0)},'duration':_0x4896de,'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':function(){const _0x4891b7={_0x2c779c:0x8eb,_0x494052:0x7c0,_0xb1920e:0x41f,_0x2697c1:0x7ba,_0xe90c92:0x527,_0x1a538a:0x898},_0x4d2e58=_0x3ac6b3;_0x254722['camera']['flyTo']({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](_0x4f12b0[_0x4d2e58(_0x3dc3c8._0x280b12)]+0xf0,_0x4f12b0['lat'],_0x4f12b0[_0x4d2e58(_0x3dc3c8._0x3b4ca2)]),'orientation':{'heading':Cesium__namespace[_0x4d2e58(_0x3dc3c8._0x133096)]['toRadians'](_0x4f12b0[_0x4d2e58(0x41f)]),'pitch':Cesium__namespace[_0x4d2e58(0x7c0)]['toRadians'](_0x4f12b0['pitch']),'roll':Cesium__namespace[_0x4d2e58(_0x3dc3c8._0x133096)][_0x4d2e58(_0x3dc3c8._0x25e5f3)](_0x4f12b0['roll']||0x0)},'duration':_0x4896de,'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':function(){const _0x246250=_0x4d2e58;_0x254722['camera'][_0x246250(0x5b2)]({'destination':Cesium__namespace[_0x246250(_0x4891b7._0x2c779c)][_0x246250(0xa6d)](_0x4f12b0['lng'],_0x4f12b0['lat'],_0x4f12b0['alt']),'orientation':{'heading':Cesium__namespace[_0x246250(_0x4891b7._0x494052)]['toRadians'](_0x4f12b0[_0x246250(_0x4891b7._0xb1920e)]),'pitch':Cesium__namespace['Math'][_0x246250(_0x4891b7._0x2697c1)](_0x4f12b0[_0x246250(_0x4891b7._0xe90c92)]),'roll':Cesium__namespace['Math']['toRadians'](_0x4f12b0['roll']||0x0)},'duration':_0x4896de,'easingFunction':Cesium__namespace[_0x246250(_0x4891b7._0x1a538a)]['LINEAR_NONE'],'complete':function(){_0xca909e(!![]);},'cancel':()=>{_0xca909e(![]);}});},'cancel':()=>{_0xca909e(![]);}});},'cancel':()=>{_0xca909e(![]);}});});}['closeHighlight'](_0xc5c8df){const _0x1dcc60={_0x13e8d4:0x3ca,_0x3a9a87:0x3ca},_0x224477=_0x35a251;if((_0xc5c8df===null||_0xc5c8df===void 0x0?void 0x0:_0xc5c8df['graphic'])===this['last_highlighGraphic'])return;this['last_highlighGraphic']&&this['last_highlighGraphic'][_0x224477(_0x1dcc60._0x13e8d4)]&&this['last_highlighGraphic'][_0x224477(_0x1dcc60._0x3a9a87)](),this['_clearLastHighlight']();}['_clearLastHighlight'](){this['last_highlighGraphic']&&(this['last_highlighGraphic']=null),this['outlineEffect']&&(this['outlineEffect']['selected']=[]);}['openHighlight'](_0x1dd548,_0x17ddd3,_0x4a1a08){const _0x417e40={_0x4fd87f:0x3ca,_0x2dbdf6:0x4ef,_0x44d0c0:0x4ef,_0x1cdc21:0xb0,_0x33d62f:0x81d,_0x1c15e2:0x396},_0x5de934=_0x35a251;if(!this['_highlightEnabled'])return;if(!_0x1dd548[_0x5de934(0xaf0)]){logInfo('该对象暂不支持highlight高亮',_0x1dd548);return;}this[_0x5de934(_0x417e40._0x4fd87f)](),_0x17ddd3[_0x5de934(_0x417e40._0x2dbdf6)]?(!this['outlineEffect']&&(this['outlineEffect']=new OutlineEffect({'eventType':![]}),this['addEffect'](this['outlineEffect'])),this['outlineEffect']['setOptions'](_0x17ddd3),this[_0x5de934(_0x417e40._0x44d0c0)][_0x5de934(0x6bc)]=this[_0x5de934(_0x417e40._0x1cdc21)][_0x5de934(_0x417e40._0x33d62f)](_0x4a1a08)):_0x1dd548['openHighlight'](_0x17ddd3,![],_0x4a1a08===null||_0x4a1a08===void 0x0?void 0x0:_0x4a1a08[_0x5de934(_0x417e40._0x1c15e2)]),this['last_highlighGraphic']=_0x1dd548,this['_viewer']['scene']['requestRender']();}['openPopup'](_0x1c4dbc,_0x342693,_0x43316c){const _0x45c3cc=_0x35a251;return this[_0x45c3cc(0x531)][_0x45c3cc(0x8d8)](_0x1c4dbc,{'content':_0x342693,'options':_0x43316c}),this;}[_0x35a251(0x90b)](){return this['_popupMgr']&&this['_popupMgr']['closeAll'](),this;}['openTooltip'](_0x3e7712,_0x1d0aeb,_0x3b9fc6={}){const _0x23c02e=_0x35a251;return this[_0x23c02e(0x1f6)][_0x23c02e(0x8d8)](_0x3e7712,{'content':_0x1d0aeb,'options':_0x3b9fc6,'target':this}),this;}['closeTooltip'](){const _0x59254e=_0x35a251;return this[_0x59254e(0x1f6)]&&this['_tooltipMgr']['close'](),this;}['getContextMenu'](){var _0x42b0c6;return(_0x42b0c6=this['_contextmenuConfig'])===null||_0x42b0c6===void 0x0?void 0x0:_0x42b0c6['content'];}['bindContextMenu'](_0x2bce4d,_0x5bb456){return this['_contextmenuConfig']={'content':_0x2bce4d,'options':_0x5bb456},this;}['unbindContextMenu'](){const _0x452d22={_0x53c4a7:0x606},_0x564ef2=_0x35a251;return this[_0x564ef2(_0x452d22._0x53c4a7)]=null,this;}[_0x35a251(0xaf1)](_0x5b2877){return this['_contextmenuMgr']['open'](_0x5b2877,this['_contextmenuConfig']),this;}['closeContextMenu'](){const _0x125e99={_0x466abb:0xc4d},_0x25eec6=_0x35a251;return this['_contextmenuMgr']&&this[_0x25eec6(_0x125e99._0x466abb)]['close'](),this;}['openSmallTooltip'](_0xebf622,_0x15454d){return this['_smallTooltip']['open'](_0xebf622,_0x15454d),this;}['closeSmallTooltip'](){if(!this['_smallTooltip'])return;return this['_smallTooltip']['close'](),this;}['clear'](_0x3451e2=!![]){const _0x3fe08c={_0x2b516b:0xb05,_0x17b9d3:0x824,_0x149121:0x698},_0x12164d={_0x2d7afe:0x4b7},_0x5edbad={_0x4d338b:0x828},_0x1054c5=_0x35a251;this['_thingList']['forEach'](_0x5e231c=>{const _0x462fbb=_0x2767;this[_0x462fbb(_0x5edbad._0x4d338b)](_0x5e231c,_0x3451e2);},this,!![]),this['_thingList']['removeAll'](),this[_0x1054c5(0x5a4)][_0x1054c5(0xdbd)](_0x3db09f=>{const _0x2c8c03=_0x1054c5;if(!_0x3db09f||_0x3db09f[_0x2c8c03(0x4b7)])return;this['removeControl'](_0x3db09f,_0x3451e2);},this,!![]),this['_controlList']['removeAll'](),this['_layerList']['forEach'](_0x471af3=>{const _0x1d90bc=_0x1054c5;if(!_0x471af3||_0x471af3[_0x1d90bc(_0x12164d._0x2d7afe)])return;this[_0x1d90bc(0xad7)](_0x471af3,_0x3451e2);},this,!![]),this['_layerList'][_0x1054c5(_0x3fe08c._0x2b516b)](),this['hasTerrain']=![],this['_lights']['removeAll'](),this[_0x1054c5(_0x3fe08c._0x17b9d3)]['removeAll'](),this[_0x1054c5(_0x3fe08c._0x149121)]={},this['_effects']={};}[_0x35a251(0xa63)](){const _0x593ecb={_0x17a115:0xa63,_0x4879eb:0x744},_0x45c472=_0x35a251;if(!this['_viewer'])return;try{this['_controlList'][_0x45c472(_0x593ecb._0x17a115)]();}catch(_0x15cac3){logWarn('_controlList.destroy\x20异常',_0x15cac3);}try{this['_thingList']['destroy']();}catch(_0x4ede45){logWarn(_0x45c472(_0x593ecb._0x4879eb),_0x4ede45);}try{this['_mouseEvent']['destroy']();}catch(_0x4e9a8c){logWarn('_mouseEvent.destroy\x20异常',_0x4e9a8c);}try{this['_layerList']['destroy']();}catch(_0x690884){logWarn('_layerList.destroy\x20异常',_0x690884);}try{this[_0x45c472(0xebf)][_0x45c472(0xa63)]();}catch(_0x59fb2e){logWarn('_viewer.destroy异常',_0x59fb2e);}for(const _0x35653d in this){delete this[_0x35653d];}}}class MapCompare extends BaseControl{get['mapEx'](){return this['_mapEx'];}['_mountedHook'](){const _0x2888db={_0x1d8a40:0x5f4},_0x173271=_0x35a251;this[_0x173271(_0x2888db._0x1d8a40)]=create$3(_0x173271(0xe09),this['options']['className']||_0x173271(0x17e));}['_addedHook'](){const _0x39dcb5={_0x584252:0xe2d,_0x103390:0xbc2,_0x50db3d:0x3d6,_0x30b8be:0x9c8,_0x1c119a:0x9d9},_0x58f694=_0x35a251;!this['options']['parentContainer']&&(this['_map']['container']['firstChild']['style']['width']='50%');let _0x103ca9={...this['options']};!_0x103ca9[_0x58f694(_0x39dcb5._0x584252)]&&!_0x103ca9[_0x58f694(0x658)]&&(_0x103ca9=merge(_0x103ca9,this['_map'][_0x58f694(_0x39dcb5._0x103390)]()),_0x103ca9['control']=_0x103ca9['control']||{},_0x103ca9[_0x58f694(0x9c8)][_0x58f694(_0x39dcb5._0x50db3d)]=!![],_0x103ca9[_0x58f694(_0x39dcb5._0x30b8be)][_0x58f694(0x10e)]=![]),this['_mapEx']=new Map(this[_0x58f694(0x5f4)],_0x103ca9),this['_map']['on'](EventType['morphComplete'],this[_0x58f694(0xbc6)],this),this['_map']['on'](EventType[_0x58f694(0x9fe)],this['_map_extentChangeHandler'],this),this['_map']['camera']['percentageChanged']=0.001,this['_mapEx']['on'](EventType[_0x58f694(0x9fe)],this['_mapEx_extentChangeHandler'],this),this['_mapEx']['camera'][_0x58f694(_0x39dcb5._0x1c119a)]=0.001,this[_0x58f694(0x11f)]();}[_0x35a251(0x404)](){const _0x10e4e6={_0x310ac1:0x6b2},_0xf952c3=_0x35a251;this['_map']['off'](EventType['morphComplete'],this['_morphCompleteHandler'],this),this[_0xf952c3(0xd79)]['off'](EventType['cameraChanged'],this['_map_extentChangeHandler'],this),this['_mapEx'][_0xf952c3(_0x10e4e6._0x310ac1)](EventType['cameraChanged'],this['_mapEx_extentChangeHandler'],this),this[_0xf952c3(0xc41)][_0xf952c3(0xa63)](),delete this['_mapEx'];}['_morphCompleteHandler'](_0x2ab976){const _0x41a3d5={_0x10c0de:0xc4c,_0x344952:0xc41},_0x510a86=_0x35a251;this['_map'][_0x510a86(0xc60)]['mode']===Cesium__namespace['SceneMode'][_0x510a86(_0x41a3d5._0x10c0de)]?this[_0x510a86(_0x41a3d5._0x344952)]['scene']['screenSpaceCameraController']['enableTilt']=![]:this['_mapEx'][_0x510a86(0xc60)]['screenSpaceCameraController'][_0x510a86(0x83f)]=!![];}['_map_extentChangeHandler'](_0x417301){const _0x1e3e45={_0x1bcfe1:0xd02},_0x23a2db=_0x35a251;clearTimeout(this[_0x23a2db(0x4b6)]),this['_mapEx'][_0x23a2db(0x6b2)](EventType[_0x23a2db(0x9fe)],this['_mapEx_extentChangeHandler'],this),this['_updateView'](this['_map'],this['_mapEx']),this['_map_timeTik']=setTimeout(()=>{const _0x1a000a=_0x23a2db;this['_mapEx']['on'](EventType['cameraChanged'],this[_0x1a000a(_0x1e3e45._0x1bcfe1)],this);},0xa);}[_0x35a251(0xd02)](_0x5105ad){const _0x648e7b={_0x253878:0xc41,_0x1c8295:0xd79},_0x2d5614=_0x35a251;clearTimeout(this['_mapEx_timeTik']),this['_map']['off'](EventType['cameraChanged'],this['_map_extentChangeHandler'],this),this[_0x2d5614(0xa0e)](this[_0x2d5614(_0x648e7b._0x253878)],this[_0x2d5614(_0x648e7b._0x1c8295)]),this['_mapEx_timeTik']=setTimeout(()=>{const _0x35602=_0x2d5614;this['_map']['on'](EventType['cameraChanged'],this[_0x35602(0x11f)],this);},0xa);}['_updateView'](_0x3e7cbd,_0x30221d){const _0x1a5356={_0x30b682:0x1e4},_0x3a1108=_0x35a251,_0x289fa5=_0x3e7cbd['getCameraView']({'simplify':![]});_0x30221d[_0x3a1108(_0x1a5356._0x30b682)](_0x289fa5,{'duration':0x0});}}register$1(_0x35a251(0xed9),MapCompare);class OverviewMap extends BaseControl{get['smallMap'](){const _0x19cdc0=_0x35a251;return this[_0x19cdc0(0x7eb)];}get[_0x35a251(0x176)](){return this['_center'];}['_mountedHook'](){const _0x3b5bac={_0x4aecd8:0x2e2,_0x545029:0xb67},_0x22379d=_0x35a251;this['options']['flyToOptions']=this['options'][_0x22379d(_0x3b5bac._0x4aecd8)]||{},this['_container']=create$3('div','mars3d-overviewMap'),this['setStyle'](this[_0x22379d(0xe86)]['style']||{'right':'10px','top':_0x22379d(_0x3b5bac._0x545029)});}['_addedHook'](){const _0x2153ee={_0x1919e8:0x873},_0x17e217=_0x35a251;this[_0x17e217(_0x2153ee._0x1919e8)](),this[_0x17e217(0xd79)]['camera']['percentageChanged']=0.01,this['_map']['on'](EventType['cameraChanged'],this['_map_cameraChanged'],this),this['_map_cameraChanged']();}['_removedHook'](){const _0x56e442={_0x30062e:0x9fe},_0x373dd8=_0x35a251;this[_0x373dd8(0xd79)]['off'](EventType[_0x373dd8(_0x56e442._0x30062e)],this['_map_cameraChanged'],this),this['_smallMap']['destroy'](),delete this[_0x373dd8(0x7eb)];}['_map_cameraChanged'](){const _0x4f5ce9={_0x239589:0x15b,_0x354ee0:0x1db,_0x3b69bd:0x120,_0x181b8d:0x2e2,_0x5622ad:0x9f2},_0x9fd9b6=_0x35a251,_0x55d410=this['_map']['getExtent']();this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x55d410['xmin'],_0x55d410[_0x9fd9b6(_0x4f5ce9._0x239589)],_0x55d410[_0x9fd9b6(_0x4f5ce9._0x354ee0)],_0x55d410['ymax']),this['_center']=Cesium__namespace[_0x9fd9b6(_0x4f5ce9._0x3b69bd)]['toCartesian'](Cesium__namespace['Rectangle']['center'](this['_rectangle'])),this['_smallMap']['flyToExtent'](_0x55d410,{'duration':0x0,'scale':0x2,...this['options'][_0x9fd9b6(_0x4f5ce9._0x181b8d)]}),this[_0x9fd9b6(0x264)](EventType[_0x9fd9b6(_0x4f5ce9._0x5622ad)]);}['initMinMap'](){const _0x16db58={_0x58b4d2:0xc96},_0xdd84f7={_0x48c0ca:0xc02},_0x48c96b=_0x35a251,_0x522a79=this[_0x48c96b(0xd79)]['getExtent'](),_0x170385={'scene':{'sceneMode':Cesium__namespace['SceneMode']['SCENE2D'],'cameraController':{'enableRotate':![],'enableTranslate':![],'enableTilt':![],'enableZoom':![]},...this['options']['scene'],'extent':_0x522a79},'control':{'contextmenu':{'hasDefault':![]},...this[_0x48c96b(0xe86)]['control']},'basemaps':[{...this['options']['basemap'],'show':!![]}],'layers':this['options']['layers']};this['_smallMap']=new Map(this['_container'],_0x170385),this['options'][_0x48c96b(0xab1)]&&(this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x522a79['xmin'],_0x522a79['ymin'],_0x522a79['xmax'],_0x522a79['ymax']),this[_0x48c96b(_0x16db58._0x58b4d2)]=new RectangleEntity({'rectangle':new Cesium__namespace[(_0x48c96b(0x18a))](_0x5b8a33=>{const _0x321d9a=_0x48c96b;return this[_0x321d9a(_0xdd84f7._0x48c0ca)];},![]),'style':{'color':'rgba(0,0,255,0.2)','outline':!![],'outlineWidth':0x1,'outlineColor':_0x48c96b(0x6f1),...this['options']['rectangle']}}),this['_smallMap']['graphicLayer'][_0x48c96b(0x8b5)](this['_extentGraphic']));}}register$1('overviewMap',OverviewMap);const icon$1='\x0a\x0a\x20\x20\x0a\x20\x20\x0a\x20\x20\x0a',icon=_0x35a251(0x8c9);class ClockAnimate extends BaseControl{['_mountedHook'](){const _0x4339b1={_0x42541c:0x5f4},_0x468652=_0x35a251;this[_0x468652(_0x4339b1._0x42541c)]=create$3('div',_0x468652(0x9ea)),this[_0x468652(0x5f4)]['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+icon$1+'\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x202017-08-25\x2000:00:00\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20';}['_addedHook'](){const _0x33271d={_0x2b2a10:0xbb0,_0x3c04d1:0xe22},_0x5554d2={_0x1ae0e6:0xd79,_0x3ebee9:0x42d},_0x40166b={_0x4dc5e3:0xacd,_0x5965c2:0xfb4},_0x12b241={_0x5ac07a:0x23b},_0x1c527d=_0x35a251,_0x3cecb3=this['_container']['querySelector'](_0x1c527d(_0x33271d._0x2b2a10));_0x3cecb3['addEventListener'](_0x1c527d(0xfb4),_0x4a3c91=>{const _0x50bf16=_0x1c527d;this['_map']['clock']['currentTime']=Cesium__namespace['JulianDate'][_0x50bf16(_0x12b241._0x5ac07a)](),this['updateStatus'](),this['fire'](EventType[_0x50bf16(0xfb4)],{'mouseEvent':_0x4a3c91,'targetType':'now','time':this[_0x50bf16(0xd79)]['clock']['currentTime']});});const _0x58c85c=this['_container']['querySelector']('#btn-clockAnimate-start');_0x58c85c['addEventListener']('click',_0x5c7bf8=>{const _0x1237ec=_0x1c527d;this['_map'][_0x1237ec(0x42d)]['shouldAnimate']=!this['_map'][_0x1237ec(0x42d)]['shouldAnimate'],this[_0x1237ec(_0x40166b._0x4dc5e3)](),this['fire'](EventType[_0x1237ec(_0x40166b._0x5965c2)],{'mouseEvent':_0x5c7bf8,'targetType':'state','state':this[_0x1237ec(0xd79)]['clock']['shouldAnimate']});}),this['_containerBtnStart']=_0x58c85c,this['_containerTime']=this['_container']['querySelector'](_0x1c527d(0xa6f)),this['_containerTime']['addEventListener'](_0x1c527d(0xfb4),_0x14b9f9=>{const _0x530b5b=_0x1c527d;this['fire'](EventType['click'],{'mouseEvent':_0x14b9f9,'targetType':_0x530b5b(0x854)});}),this['_containerSpeed']=this['_container'][_0x1c527d(_0x33271d._0x3c04d1)]('#txt-clockAnimate-speed'),this['_containerSpeed']['setAttribute']('value',this['_map'][_0x1c527d(0x42d)]['multiplier']),this['_containerSpeed'][_0x1c527d(0x77e)]('change',_0x16a66e=>{const _0x469b10=_0x1c527d,_0x46f66e=Number(this['_containerSpeed']['value']||0x1);!isNaN(_0x46f66e)&&(this[_0x469b10(_0x5554d2._0x1ae0e6)][_0x469b10(_0x5554d2._0x3ebee9)]['multiplier']=_0x46f66e,this['fire'](EventType['change'],{'mouseEvent':_0x16a66e,'speed':_0x46f66e}));}),setTimeout(()=>{this['_showHook'](!![]);},0x3e8),this['timeTik']=setInterval(()=>{this['clock_onTickHandler']();},0x1f4),this[_0x1c527d(0xf23)]();}['_showHook'](_0x56f7c3){const _0x63bf68=_0x35a251;var _0x101c5d;const _0x36f139=this['_map']['controls']['timeline'],_0x10ad98=_0x36f139===null||_0x36f139===void 0x0?void 0x0:_0x36f139['container'];_0x10ad98&&(_0x10ad98[_0x63bf68(0xfc8)][_0x63bf68(0xfa3)]=_0x56f7c3?this['_container']['offsetWidth']+0x1+'px':'0');if((_0x101c5d=this[_0x63bf68(0xd79)]['controls'])!==null&&_0x101c5d!==void 0x0&&_0x101c5d['distanceLegend']){const _0x1198b3=_0x56f7c3||_0x10ad98&&_0x10ad98['style']['display']!==_0x63bf68(0x274);this['_map']['controls'][_0x63bf68(0x7ab)][_0x63bf68(0x212)]({'bottom':_0x1198b3?'27px':'2px'});}}['_removedHook'](){this['timeTik']&&(clearInterval(this['timeTik']),this['timeTik']=null);}['clock_onTickHandler'](){const _0xaeb6e6={_0x32e967:0x42d,_0x2e93d8:0x579},_0x3d8365=_0x35a251;this['updateStatus']();const _0x1be29d=Number(this['_containerSpeed']['value']);this['_map'][_0x3d8365(_0xaeb6e6._0x32e967)]['multiplier']!==_0x1be29d&&this['_containerSpeed']['setAttribute']('value',this['_map'][_0x3d8365(0x42d)]['multiplier']);const _0x2532a6=Cesium__namespace[_0x3d8365(_0xaeb6e6._0x2e93d8)]['toDate'](this['_map']['clock']['currentTime']);this['_containerTime']['innerHTML']=formatDate(_0x2532a6,this[_0x3d8365(0xe86)]['format']||'yyyy-MM-dd\x20HH:mm:ss');}['updateStatus'](){const _0x5dd0b9={_0x1ef68e:0x921,_0x354a33:0x732,_0x174e0a:0x922,_0x5e974a:0x9fa,_0xb3b58f:0x466,_0xa3e440:0x922},_0x190412=_0x35a251;if(this['isAnimate']===this['_map']['clock'][_0x190412(0x21b)])return;this[_0x190412(_0x5dd0b9._0x1ef68e)]=this['_map']['clock']['shouldAnimate'];this['isAnimate']?(this['_containerBtnStart']['setAttribute'](_0x190412(_0x5dd0b9._0x354a33),'暂停'),this['_containerBtnStart']['innerHTML']=icon$1,this['_containerSpeed']['style'][_0x190412(_0x5dd0b9._0x174e0a)]=_0x190412(_0x5dd0b9._0x5e974a)):(this[_0x190412(_0x5dd0b9._0xb3b58f)]['setAttribute']('title','继续'),this[_0x190412(0x466)]['innerHTML']=icon,this['_containerSpeed']['style'][_0x190412(_0x5dd0b9._0xa3e440)]=_0x190412(0x274));const _0x14268c=this['_map']['controls']['timeline'],_0xd095d5=_0x14268c===null||_0x14268c===void 0x0?void 0x0:_0x14268c['container'];_0xd095d5&&(_0xd095d5[_0x190412(0xfc8)]['left']=this['_container']['offsetWidth']+0x1+'px');}}register$1(_0x35a251(0xd6e),ClockAnimate);var index$1={'__proto__':null,'BaseControl':BaseControl,'Animation':Animation,'BaseLayerPicker':BaseLayerPicker,'FullscreenButton':FullscreenButton,'Geocoder':Geocoder,'HomeButton':HomeButton,'NavigationHelpButton':NavigationHelpButton,'ProjectionPicker':ProjectionPicker,'SceneModePicker':SceneModePicker,'Timeline':Timeline,'VRButton':VRButton,'LocationBar':LocationBar,'MouseDownView':MouseDownView,'Zoom':Zoom,'ToolButton':ToolButton,'Compass':Compass,'DistanceLegend':DistanceLegend,'MapSplit':MapSplit,'MapCompare':MapCompare,'OverviewMap':OverviewMap,'ClockAnimate':ClockAnimate};class BaiduPOI{constructor(_0xa3c7b9={}){const _0x717d46=_0x35a251;this['_key_index']=0x0,this['_keys']=_0xa3c7b9['key']||baiduArr,this['_city']=_0xa3c7b9[_0x717d46(0x2c5)]||'全国';}get[_0x35a251(0x68f)](){return this['_keys'];}set['keys'](_0x5c0481){this['_keys']=_0x5c0481;}get[_0x35a251(0xa03)](){const _0x544ffd={_0x411d5d:0x887},_0x47f750=_0x35a251,_0x167947=this[_0x47f750(_0x544ffd._0x411d5d)]++%this[_0x47f750(0xe44)]['length'];return this[_0x47f750(0xe44)][_0x167947];}[_0x35a251(0x1ec)](_0x17a1bc){const _0x56ca05={_0x5a372c:0xe1e,_0x511ed7:0x93b},_0x5081e6=_0x35a251,_0x2051e8=[];for(let _0x1fd689=0x0;_0x1fd689<_0x17a1bc[_0x5081e6(_0x56ca05._0x5a372c)];_0x1fd689++){var _0x3154df,_0x123411;const _0x22d9d3=_0x17a1bc[_0x1fd689];let _0x5234be=[];_0x22d9d3['location']&&(_0x5234be=gcj2wgs([_0x22d9d3['location']['lng'],_0x22d9d3['location']['lat']])),_0x2051e8['push']({'id':_0x22d9d3[_0x5081e6(0x455)],'name':_0x22d9d3['name'],'lng':_0x5234be[0x0],'lat':_0x5234be[0x1],'type':((_0x3154df=_0x22d9d3['detail_info'])===null||_0x3154df===void 0x0?void 0x0:_0x3154df[_0x5081e6(0x135)])??_0x22d9d3['tag'],'xzqh':_0x22d9d3[_0x5081e6(_0x56ca05._0x511ed7)]+_0x22d9d3['city']+(_0x22d9d3['district']||_0x22d9d3['area']||''),'address':_0x22d9d3[_0x5081e6(0x56c)],'tel':_0x22d9d3[_0x5081e6(0xcc)]||'','detailUrl':(_0x123411=_0x22d9d3[_0x5081e6(0xb30)])===null||_0x123411===void 0x0?void 0x0:_0x123411['detail_url'],'info':_0x22d9d3,'x':_0x5234be[0x0],'y':_0x5234be[0x1],'detail_info':_0x22d9d3['detail_info']});}return _0x2051e8;}['_getKeywords'](_0x25b218){const _0x264200={_0x2a7c29:0x20e},_0x4ddf90=_0x35a251;if(isString(_0x25b218))return _0x25b218[_0x4ddf90(0x20e)](/ /gm,'$')[_0x4ddf90(_0x264200._0x2a7c29)](/,/gm,'$');else{if(Array[_0x4ddf90(0x719)](_0x25b218))return _0x25b218['join']('$');}return _0x25b218;}[_0x35a251(0x753)](_0x2487ec){const _0x2441ee={_0xaa65f4:0xa03,_0x43266b:0xb9d,_0x54c78b:0xa3c},_0x17de52={_0x5df799:0xb49},_0x2fe7b1={_0x460b40:0x5e8,_0x309ce5:0xcf6},_0x56c02b=_0x35a251;if(this['_getAddress_ing'])return Promise['resolve']();const _0x47a885={'ak':this[_0x56c02b(_0x2441ee._0xaa65f4)],'output':'json','language':'zh-CN','coordtype':'wgs84ll','ret_coordtype':'gcj02ll'},_0x4ec151=LngLatPoint['parse'](_0x2487ec[_0x56c02b(0x3a4)]);return _0x47a885['location']=_0x4ec151[_0x56c02b(_0x2441ee._0x43266b)]+','+_0x4ec151['lng'],this['_getAddress_ing']=!![],Cesium__namespace['Resource']['fetchJsonp']({'url':_0x56c02b(_0x2441ee._0x54c78b),...this['options'],'queryParameters':_0x47a885})[_0x56c02b(0x86c)](_0x581724=>{const _0x5e41d0=_0x56c02b;this['_getAddress_ing']=![];if(_0x581724[_0x5e41d0(_0x2fe7b1._0x460b40)]!==0x0){console['log']('未查询到相关结果!',_0x581724);return;}const _0xb3ed3=_0x581724['result'],_0x26b2c8={'address':_0xb3ed3['formatted_address'],'city':_0xb3ed3['cityCode'],'component':_0xb3ed3['addressComponent']};return _0x2487ec['success']&&_0x2487ec[_0x5e41d0(_0x2fe7b1._0x309ce5)](_0x26b2c8),_0x26b2c8;})['catch'](_0x45c33b=>{const _0x498279=_0x56c02b;this['_getAddress_ing']=![],logError$1('BaiduPOI\x20请求出错',_0x45c33b),_0x2487ec['error']&&_0x2487ec[_0x498279(_0x17de52._0x5df799)]('请求出错',_0x45c33b);});}['autoTip'](_0x3795c5){const _0x572d32={_0xa9913f:0xaa2,_0x537c5f:0x1c9,_0x280334:0xdf,_0x361c69:0x86c},_0x38f4cf=_0x35a251,_0x1d7249={'ak':this[_0x38f4cf(0xa03)],'output':_0x38f4cf(0x185),'ret_coordtype':'gcj02ll'};Cesium__namespace['defined'](this[_0x38f4cf(0xdca)])&&(_0x1d7249['region']=this[_0x38f4cf(0xdca)],_0x1d7249['city_limit']=!![]);Cesium__namespace['defined'](_0x3795c5[_0x38f4cf(0x2c5)])&&(_0x1d7249[_0x38f4cf(0x1c2)]=_0x3795c5['city'],_0x1d7249['city_limit']=!![]);Cesium__namespace[_0x38f4cf(_0x572d32._0xa9913f)](_0x3795c5[_0x38f4cf(0xe76)])&&(_0x1d7249['city_limit']=_0x3795c5['citylimit']);_0x3795c5['text']&&(_0x1d7249[_0x38f4cf(_0x572d32._0x537c5f)]=this[_0x38f4cf(_0x572d32._0x280334)](_0x3795c5[_0x38f4cf(0xe1f)]));if(_0x3795c5['location']){_0x1d7249[_0x38f4cf(0x8a4)]=0x1;const _0x57255e=LngLatPoint[_0x38f4cf(0x8d0)](_0x3795c5['location']);_0x1d7249['location']=_0x57255e[_0x38f4cf(0xb9d)]+','+_0x57255e['lng'];}return Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/suggestion',...this[_0x38f4cf(0xe86)],'queryParameters':_0x1d7249})[_0x38f4cf(_0x572d32._0x361c69)](_0x5e7569=>{const _0x1c4526=_0x38f4cf;if(_0x5e7569['status']!==0x0){console[_0x1c4526(0x3a8)]('未查询到相关结果!',_0x5e7569);return;}const _0xe951b3=this['_formatPOIData'](_0x5e7569['result']),_0x5df9a8={'allcount':_0x5e7569['total'],'count':_0xe951b3['length'],'list':_0xe951b3};return _0x3795c5['success']&&_0x3795c5['success'](_0x5df9a8),_0x5df9a8;})[_0x38f4cf(0xeb7)](_0x237d7c=>{const _0x1e427a=_0x38f4cf;logError$1('BaiduPOI\x20请求出错',_0x237d7c),_0x3795c5[_0x1e427a(0xb49)]&&_0x3795c5['error']('请求出错',_0x237d7c);});}['detail'](_0x482a2b){const _0x17fafd={_0xc4a3ad:0xe86},_0x4577b9={_0x16724b:0xb49},_0x330c6={_0x4e59fc:0x5e8,_0x43d00c:0xdbc,_0x14157a:0xcf6},_0x4903dc=_0x35a251,_0x564361={'ak':this['key'],'output':'json','ret_coordtype':'gcj02ll','uid':_0x482a2b['id']};return Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/detail','queryParameters':_0x564361,...this[_0x4903dc(_0x17fafd._0xc4a3ad)]})['then'](_0x294af9=>{const _0x267093=_0x4903dc;if(_0x294af9[_0x267093(_0x330c6._0x4e59fc)]!==0x0){console['log']('未查询到相关结果!',_0x294af9);return;}if(!_0x294af9[_0x267093(_0x330c6._0x43d00c)]||_0x294af9['pois']['length']===0x0){_0x482a2b[_0x267093(0xb49)]&&_0x482a2b['error']('未查询到相关结果!',_0x294af9);return;}const _0x1fb6f8=_0x294af9;return _0x482a2b[_0x267093(_0x330c6._0x14157a)]&&_0x482a2b['success'](_0x1fb6f8),_0x1fb6f8;})['catch'](_0x569d7a=>{const _0x14aab3=_0x4903dc;logError$1(_0x14aab3(0x356),_0x569d7a),_0x482a2b[_0x14aab3(0xb49)]&&_0x482a2b[_0x14aab3(_0x4577b9._0x16724b)]('请求出错',_0x569d7a);});}['query'](_0x254b31){const _0x19ca5d={_0x4a93b6:0x8ea,_0x4348b7:0x909,_0x100365:0xc74},_0x34be3a=_0x35a251,_0x5620aa=_0x254b31['graphic'];if(_0x5620aa){if(_0x5620aa[_0x34be3a(_0x19ca5d._0x4a93b6)]===_0x34be3a(0xab1))return _0x254b31['polygon']=_0x5620aa[_0x34be3a(0x4a1)],this['queryPolygon'](_0x254b31);else{if(_0x5620aa['type']===_0x34be3a(_0x19ca5d._0x4348b7))return _0x254b31['polygon']=_0x5620aa['coordinates'],this['queryPolygon'](_0x254b31);else return _0x5620aa['type']==='circle'?(_0x254b31['location']=_0x5620aa['point'],_0x254b31['radius']=_0x5620aa['radius'],this['queryCircle'](_0x254b31)):Promise[_0x34be3a(_0x19ca5d._0x100365)](![]);}}else return _0x254b31['polygon']?this['queryPolygon'](_0x254b31):this['queryText'](_0x254b31);}['queryText'](_0x226a38){const _0x32a857={_0x385bd0:0xfab,_0x24c77c:0x8d0,_0x3ef1a8:0xfa7,_0x1eb81c:0x3a4,_0x401d52:0x907,_0xd9af2f:0x907,_0x3fe2fc:0x414,_0x32ca55:0xca5},_0x51eb69={_0x33fa4a:0xb49},_0x43c8f1={_0x26c72e:0xb49,_0x5670dd:0x9ad,_0x46543b:0x3a4},_0x281b0a=_0x35a251,_0xf556d2={'ak':this[_0x281b0a(0xa03)],'output':_0x281b0a(0x185),'ret_coordtype':_0x281b0a(0x7d8),'scope':0x2,'page_num':_0x226a38['page']||0x0,'page_size':_0x226a38['count']||0x14,'tag':_0x226a38[_0x281b0a(_0x32a857._0x385bd0)]||''};Cesium__namespace['defined'](this[_0x281b0a(0xdca)])&&(_0xf556d2['region']=this['_city'],_0xf556d2['city_limit']=!![]);Cesium__namespace[_0x281b0a(0xaa2)](_0x226a38['city'])&&(_0xf556d2['region']=_0x226a38[_0x281b0a(0x2c5)],_0xf556d2['city_limit']=!![]);Cesium__namespace['defined'](_0x226a38[_0x281b0a(0xe76)])&&(_0xf556d2['city_limit']=_0x226a38['citylimit']);_0x226a38['text']&&(_0xf556d2['query']=this['_getKeywords'](_0x226a38['text']));if(_0x226a38['location']){_0xf556d2[_0x281b0a(0x8a4)]=0x1;const _0xff7a49=LngLatPoint[_0x281b0a(_0x32a857._0x24c77c)](_0x226a38['location']);_0xf556d2['location']=_0xff7a49['lat']+','+_0xff7a49[_0x281b0a(_0x32a857._0x3ef1a8)];}return Cesium__namespace['defined'](_0x226a38[_0x281b0a(0x907)])&&(_0x226a38[_0x281b0a(0x907)]>0x4c4b40?delete _0xf556d2[_0x281b0a(_0x32a857._0x1eb81c)]:_0xf556d2[_0x281b0a(_0x32a857._0x401d52)]=_0x226a38[_0x281b0a(_0x32a857._0xd9af2f)],Cesium__namespace['defined'](_0x226a38['radiuslimit'])&&(_0xf556d2['radius_limit']=_0x226a38[_0x281b0a(_0x32a857._0x3fe2fc)])),Cesium__namespace['Resource']['fetchJsonp']({'url':_0x281b0a(_0x32a857._0x32ca55),...this['options'],'queryParameters':_0xf556d2})['then'](_0x2f3f5a=>{const _0x3e556e=_0x281b0a;if(_0x2f3f5a['status']!==0x0){const _0xdb327f=_0x3e556e(0x9a)+_0x2f3f5a['status']+'):'+_0x2f3f5a['message'];_0x226a38['error']&&_0x226a38[_0x3e556e(_0x43c8f1._0x26c72e)](_0xdb327f);return;}if(!_0x2f3f5a[_0x3e556e(_0x43c8f1._0x5670dd)]||_0x2f3f5a['result_type']==='city_type'||_0x2f3f5a['results'][_0x3e556e(0xe1e)]===0x0){if(_0x226a38['_sendCount']){const _0x38adca={'allcount':0x0,'count':0x0,'list':[]};return _0x226a38['success']&&_0x226a38['success'](_0x38adca),_0x38adca;}else return delete _0x226a38['radius'],delete _0x226a38[_0x3e556e(_0x43c8f1._0x46543b)],_0x226a38['_sendCount']=0x1,this[_0x3e556e(0xc2)](_0x226a38);}const _0x1f8173=this['_formatPOIData'](_0x2f3f5a[_0x3e556e(0x9ad)]),_0x4859fc={'allcount':_0x2f3f5a['total'],'count':_0x1f8173[_0x3e556e(0xe1e)],'list':_0x1f8173};return _0x226a38[_0x3e556e(0xcf6)]&&_0x226a38['success'](_0x4859fc),_0x4859fc;})[_0x281b0a(0xeb7)](_0x267439=>{const _0x52420e=_0x281b0a;logError$1(_0x52420e(0x356),_0x267439),_0x226a38[_0x52420e(_0x51eb69._0x33fa4a)]&&_0x226a38[_0x52420e(0xb49)]('请求出错',_0x267439);});}['queryCircle'](_0x222c12){const _0x5ac397={_0x3c714e:0x185,_0x4228fd:0x7d8,_0x4aca3f:0x1e7,_0x231246:0x8a4,_0xd09944:0xca5},_0x5db867={_0x39f7c6:0x9ad,_0x1d8c29:0xe1e,_0x2114e3:0xb49,_0x47ac2f:0x287},_0x4ee511=_0x35a251,_0x15329d={'ak':this['key'],'output':_0x4ee511(_0x5ac397._0x3c714e),'ret_coordtype':_0x4ee511(_0x5ac397._0x4228fd),'scope':0x2,'radius':_0x222c12['radius']||0xbb8,'radius_limit':_0x222c12[_0x4ee511(0x287)],'page_num':_0x222c12[_0x4ee511(_0x5ac397._0x4aca3f)]||0x0,'page_size':_0x222c12['count']||0x14,'tag':_0x222c12['types']||''};if(_0x222c12['location']){_0x15329d[_0x4ee511(_0x5ac397._0x231246)]=0x1;const _0x3c4b50=LngLatPoint['parse'](_0x222c12['location']);_0x15329d['location']=_0x3c4b50[_0x4ee511(0xb9d)]+','+_0x3c4b50['lng'];}else logError$1('BaiduPOI:\x20请传入参location数');return _0x222c12['text']?_0x15329d['query']=this['_getKeywords'](_0x222c12['text']):_0x15329d[_0x4ee511(0x1c9)]='行政地标',Cesium__namespace['Resource']['fetchJsonp']({'url':_0x4ee511(_0x5ac397._0xd09944),...this['options'],'queryParameters':_0x15329d})['then'](_0x215e82=>{const _0x35ef88=_0x4ee511;if(_0x215e82[_0x35ef88(0x5e8)]!==0x0){const _0x22a952='POI\x20请求失败('+_0x215e82[_0x35ef88(0x5e8)]+'):'+_0x215e82[_0x35ef88(0x4c3)];_0x222c12['error']&&_0x222c12['error'](_0x22a952);return;}if(!_0x215e82[_0x35ef88(_0x5db867._0x39f7c6)]||_0x215e82['result_type']==='city_type'||_0x215e82[_0x35ef88(0x9ad)][_0x35ef88(_0x5db867._0x1d8c29)]===0x0){_0x222c12['error']&&_0x222c12[_0x35ef88(_0x5db867._0x2114e3)]('未查询到相关结果!',_0x215e82);return;}const _0x1a6b93=this['_formatPOIData'](_0x215e82['results']);let _0x2a3048;_0x222c12[_0x35ef88(_0x5db867._0x47ac2f)]?_0x2a3048=this['_filterPOIData_circle'](_0x1a6b93,_0x222c12['location'],_0x15329d['radius']):_0x2a3048=_0x1a6b93;const _0x2c372b={'allcount':_0x215e82[_0x35ef88(0x4c7)],'count':_0x2a3048['length'],'list':_0x2a3048};return _0x222c12['success']&&_0x222c12['success'](_0x2c372b),_0x2c372b;})['catch'](_0x284b81=>{logError$1('BaiduPOI\x20请求出错',_0x284b81),_0x222c12['error']&&_0x222c12['error']('请求出错',_0x284b81);});}['_filterPOIData_circle'](_0x162601,_0x3334e4,_0x21efe3){const _0x3e6ef8={_0x8aaa7a:0xa6d,_0x352839:0x5d2},_0x19ff4e=_0x35a251;if(!_0x162601||!_0x3334e4||!_0x21efe3)return _0x162601;const _0x132835=_0x3334e4['toCartesian'](),_0x3f519a=[];for(let _0x42213d=0x0;_0x42213d<_0x162601[_0x19ff4e(0xe1e)];_0x42213d++){const _0x1eaeac=_0x162601[_0x42213d],_0x37b341=Cesium__namespace['Cartesian3'][_0x19ff4e(_0x3e6ef8._0x8aaa7a)](_0x1eaeac['x'],_0x1eaeac['y'],_0x3334e4[_0x19ff4e(_0x3e6ef8._0x352839)]),_0x4b54fb=Cesium__namespace['Cartesian3']['distance'](_0x37b341,_0x132835);_0x4b54fb<_0x21efe3&&_0x3f519a['push'](_0x1eaeac);}return _0x3f519a;}['queryPolygon'](_0x19f9b0){const _0x4ddaae={_0x2c309c:0xe1e,_0x507f21:0x3a4,_0xe798b8:0x1db},_0x539f8a=_0x35a251,_0x1b3512={'ak':this['key'],'output':'json','ret_coordtype':_0x539f8a(0x7d8),'scope':0x2,'radius':_0x19f9b0['radius']||0xbb8,'radius_limit':_0x19f9b0['limit'],'page_num':_0x19f9b0[_0x539f8a(0x1e7)]||0x0,'page_size':_0x19f9b0['count']||0x14,'tag':_0x19f9b0['types']||''},_0x3ca459=_0x19f9b0['polygon'];let _0x94c453=_0x3ca459;if(_0x3ca459[_0x539f8a(_0x4ddaae._0x2c309c)]===0x2){const _0x53ceb6=_0x3ca459[0x0][0x0],_0x54e9a8=_0x3ca459[0x1][0x0],_0x13c4be=_0x3ca459[0x0][0x1],_0x15d39f=_0x3ca459[0x1][0x1],_0xe50758=(_0x53ceb6+_0x54e9a8)/0x2,_0x479058=(_0x13c4be+_0x15d39f)/0x2;_0x94c453=[[_0x53ceb6,_0x15d39f],[_0x53ceb6,_0x13c4be],[_0x54e9a8,_0x13c4be],[_0x54e9a8,_0x15d39f],[_0x53ceb6,_0x15d39f]],_0x1b3512['coord_type']=0x1,_0x1b3512[_0x539f8a(_0x4ddaae._0x507f21)]=_0x479058+','+_0xe50758,_0x1b3512['radius']=Math['max'](getDistance([[_0xe50758,_0x479058],_0x3ca459[0x0]]),getDistance([[_0xe50758,_0x479058],_0x3ca459[0x1]]));}else{const _0x223bc2=getExtentByGeoJSON({'type':'Feature','properties':{},'geometry':{'type':'LineString','coordinates':_0x3ca459}}),_0x4b2d40=(_0x223bc2['xmin']+_0x223bc2[_0x539f8a(_0x4ddaae._0xe798b8)])/0x2,_0xd4a9b9=(_0x223bc2['ymin']+_0x223bc2['ymax'])/0x2;_0x1b3512['coord_type']=0x1,_0x1b3512['location']=_0xd4a9b9+','+_0x4b2d40,_0x1b3512['radius']=Math['max'](getDistance([[_0x4b2d40,_0xd4a9b9],[_0x223bc2[_0x539f8a(0x5e2)],_0x223bc2['ymin']]]),getDistance([[_0x4b2d40,_0xd4a9b9],[_0x223bc2['xmax'],_0x223bc2[_0x539f8a(0xcea)]]]));}return _0x19f9b0['text']?_0x1b3512[_0x539f8a(0x1c9)]=this['_getKeywords'](_0x19f9b0['text']):_0x1b3512['query']=_0x539f8a(0x29c),Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/search','queryParameters':_0x1b3512,...this[_0x539f8a(0xe86)]})['then'](_0x2b307d=>{const _0x3de0c4=_0x539f8a;if(_0x2b307d['status']!==0x0){const _0x7059f5='POI\x20请求失败('+_0x2b307d[_0x3de0c4(0x5e8)]+'):'+_0x2b307d[_0x3de0c4(0x4c3)];_0x19f9b0['error']&&_0x19f9b0['error'](_0x7059f5);return;}if(!_0x2b307d['results']||_0x2b307d[_0x3de0c4(0x217)]===_0x3de0c4(0x179)||_0x2b307d['results'][_0x3de0c4(0xe1e)]===0x0){_0x19f9b0['error']&&_0x19f9b0['error']('未查询到相关结果!',_0x2b307d);return;}const _0x504c4b=this['_formatPOIData'](_0x2b307d['results']);let _0x503531;_0x19f9b0['limit']?_0x503531=this['_filterPOIData_polygon'](_0x504c4b,_0x94c453):_0x503531=_0x504c4b;const _0x1929f5={'allcount':_0x2b307d['total'],'count':_0x503531['length'],'list':_0x503531};return _0x19f9b0['success']&&_0x19f9b0['success'](_0x1929f5),_0x1929f5;})[_0x539f8a(0xeb7)](_0x3058fc=>{const _0x5000bc=_0x539f8a;logError$1('BaiduPOI\x20请求出错',_0x3058fc),_0x19f9b0['error']&&_0x19f9b0['error'](_0x5000bc(0xacc),_0x3058fc);});}['_filterPOIData_polygon'](_0x4e1a4c,_0x301abd){const _0x40b34a={_0x2d5475:0xe1e},_0x3a1370=_0x35a251;if(!_0x4e1a4c||!_0x301abd)return;_0x301abd=_0x301abd['concat']([_0x301abd[0x0]]);const _0x1034ff={'type':'Polygon','coordinates':[_0x301abd]},_0xe9ead4=[];for(let _0x8f362e=0x0;_0x8f362e<_0x4e1a4c[_0x3a1370(_0x40b34a._0x2d5475)];_0x8f362e++){const _0x9efd46=_0x4e1a4c[_0x8f362e],_0x38c7d7={'type':'Feature','geometry':{'type':'Point','coordinates':[_0x9efd46['x'],_0x9efd46['y']]}};booleanPointInPolygon(_0x38c7d7,_0x1034ff)&&_0xe9ead4['push'](_0x9efd46);}return _0xe9ead4;}}class GaodePOI{constructor(_0x330a68={}){const _0x314b1b={_0x3111f0:0xe44},_0x121761=_0x35a251;this['_key_index']=0x0,this[_0x121761(_0x314b1b._0x3111f0)]=_0x330a68[_0x121761(0xa03)]||gaodeArr;}get['keys'](){return this['_keys'];}set['keys'](_0x5bb8c3){this['_keys']=_0x5bb8c3;}get[_0x35a251(0xa03)](){const _0x25bd42=_0x35a251,_0x1eafd8=this['_key_index']++%this['_keys']['length'];return this[_0x25bd42(0xe44)][_0x1eafd8];}[_0x35a251(0x1ec)](_0x12163d){const _0x4356a5={_0x56fdc4:0x504},_0x136d6c=_0x35a251,_0x5ef5e3=[];for(let _0xcb084c=0x0;_0xcb084c<_0x12163d['length'];_0xcb084c++){const _0x2b6c20=_0x12163d[_0xcb084c];let _0x18b1ea=[];_0x2b6c20['location']&&_0x2b6c20['location']['length']>0x0&&(_0x18b1ea=gcj2wgs(_0x2b6c20['location']['split'](','))),_0x5ef5e3['push']({'id':_0x2b6c20['id'],'name':_0x2b6c20[_0x136d6c(_0x4356a5._0x56fdc4)],'lng':Number(_0x18b1ea[0x0]),'lat':Number(_0x18b1ea[0x1]),'type':_0x2b6c20['type'],'xzqh':_0x2b6c20['pname']+_0x2b6c20['cityname']+_0x2b6c20['adname'],'address':_0x2b6c20['address'],'tel':_0x2b6c20['tel']||'','info':_0x2b6c20,'x':Number(_0x18b1ea[0x0]),'y':Number(_0x18b1ea[0x1])});}return _0x5ef5e3;}['_getKeywords'](_0x459819){const _0x4a8bcc=_0x35a251;if(isString(_0x459819))return _0x459819['replace'](/ /gm,'|')[_0x4a8bcc(0x20e)](/,/gm,'|');else{if(Array['isArray'](_0x459819))return _0x459819['join']('|');}return _0x459819;}['getAddress'](_0x128e21){const _0x477dd3={_0x1eb97c:0x185,_0x16d27b:0x6f6,_0x41fe82:0x58d},_0x540757={_0x51a899:0x3c1},_0x1b8f74={_0x27a6f5:0x6f6,_0x2c76c9:0xfbd},_0x1aa31d=_0x35a251;if(this['_getAddress_ing'])return Promise[_0x1aa31d(0xc74)]();const _0x14f339={'key':this['key'],'output':_0x1aa31d(_0x477dd3._0x1eb97c)};_0x128e21['location']=LngLatPoint[_0x1aa31d(0x8d0)](_0x128e21[_0x1aa31d(0x3a4)]);const _0x54ace4=wgs2gcj([_0x128e21['location']['lng'],_0x128e21['location']['lat']]);return _0x14f339['location']=_0x54ace4[0x0]+','+_0x54ace4[0x1],this[_0x1aa31d(_0x477dd3._0x16d27b)]=!![],Cesium__namespace[_0x1aa31d(_0x477dd3._0x41fe82)]['fetchJsonp']({'url':'https://restapi.amap.com/v3/geocode/regeo',...this['options'],'queryParameters':_0x14f339})['then'](_0x258cac=>{const _0x16a4db=_0x1aa31d;var _0x221e17;this[_0x16a4db(_0x1b8f74._0x27a6f5)]=![];if(_0x258cac['infocode']!==_0x16a4db(_0x1b8f74._0x2c76c9)){console['log']('未查询到相关结果!',_0x258cac);return;}const _0x536b4b=_0x258cac['regeocode'],_0x3a7138={'address':_0x536b4b[_0x16a4db(0x986)],'city':(_0x221e17=_0x536b4b['addressComponent'])===null||_0x221e17===void 0x0?void 0x0:_0x221e17['adcode'],'component':_0x536b4b['addressComponent']};return _0x128e21['success']&&_0x128e21['success'](_0x3a7138),_0x3a7138;})['catch'](_0x138f78=>{const _0x3375ad=_0x1aa31d;this['_getAddress_ing']=![],logError$1(_0x3375ad(_0x540757._0x51a899),_0x138f78),_0x128e21['error']&&_0x128e21['error'](_0x3375ad(0xacc),_0x138f78);});}[_0x35a251(0x46d)](_0x6b54fb){const _0x6fbe5={_0x654e40:0xe76,_0x2d8d4a:0x3a4,_0x260e57:0xc6e,_0x55bfc9:0xeb7},_0x43b3cd={_0x2450e9:0x3c1,_0x3871b4:0xb49},_0x1f8edf={_0x3ebacd:0xb59,_0x38c703:0x74f},_0x3e6ca3=_0x35a251,_0x128978={'key':this['key'],'output':'json'};Cesium__namespace[_0x3e6ca3(0xaa2)](_0x6b54fb['city'])&&(_0x128978['city']=_0x6b54fb['city'],_0x128978[_0x3e6ca3(_0x6fbe5._0x654e40)]=!![]);Cesium__namespace['defined'](_0x6b54fb['citylimit'])&&(_0x128978['citylimit']=_0x6b54fb[_0x3e6ca3(_0x6fbe5._0x654e40)]);_0x6b54fb['text']&&(_0x128978['keywords']=this['_getKeywords'](_0x6b54fb['text']));if(_0x6b54fb['location']){_0x6b54fb[_0x3e6ca3(_0x6fbe5._0x2d8d4a)]=LngLatPoint['parse'](_0x6b54fb['location']);const _0x166e7e=wgs2gcj([_0x6b54fb[_0x3e6ca3(0x3a4)][_0x3e6ca3(0xfa7)],_0x6b54fb['location']['lat']]);_0x128978['location']=_0x166e7e[0x0]+','+_0x166e7e[0x1];}return fetchJson({'url':_0x3e6ca3(_0x6fbe5._0x260e57),'queryParameters':_0x128978,...this['options']})['then'](_0x868d06=>{const _0x483ed7=_0x3e6ca3;if(!_0x868d06[_0x483ed7(_0x1f8edf._0x3ebacd)]){console['log'](_0x483ed7(_0x1f8edf._0x38c703),_0x868d06);return;}const _0x59f20f=this['_formatPOIData'](_0x868d06['tips']),_0x46fc5b={'allcount':_0x868d06['count'],'count':_0x59f20f['length'],'list':_0x59f20f};return _0x6b54fb[_0x483ed7(0xcf6)]&&_0x6b54fb[_0x483ed7(0xcf6)](_0x46fc5b),_0x46fc5b;})[_0x3e6ca3(_0x6fbe5._0x55bfc9)](_0xafb9f9=>{const _0xd8132d=_0x3e6ca3;logError$1(_0xd8132d(_0x43b3cd._0x2450e9),_0xafb9f9),_0x6b54fb['error']&&_0x6b54fb[_0xd8132d(_0x43b3cd._0x3871b4)]('请求出错',_0xafb9f9);});}['detail'](_0x4903c0){const _0x3c1cdc={_0x59c517:0xacc},_0x247d78={_0xf9a819:0xdbc,_0x4f36a3:0xb49},_0x4d45f3={'key':this['key'],'id':_0x4903c0['id'],'output':'json'};return fetchJson({'url':'https://restapi.amap.com/v3/place/detail','queryParameters':_0x4d45f3,...this['options']})['then'](_0x279587=>{const _0x27038e=_0x2767;if(_0x279587['infocode']!==_0x27038e(0xfbd)){const _0x128d16='POI\x20请求失败('+_0x279587['infocode']+'):'+_0x279587['info'];_0x4903c0['error']&&_0x4903c0['error'](_0x128d16);return;}if(!_0x279587[_0x27038e(_0x247d78._0xf9a819)]||_0x279587['pois']['length']===0x0){_0x4903c0[_0x27038e(_0x247d78._0x4f36a3)]&&_0x4903c0['error']('未查询到相关结果!',_0x279587);return;}const _0x42868b=_0x279587['pois'][0x0];return _0x4903c0[_0x27038e(0xcf6)]&&_0x4903c0['success'](_0x42868b),_0x42868b;})['catch'](_0x3c0346=>{const _0x1138fa=_0x2767;logError$1('GaodePOI\x20请求出错',_0x3c0346),_0x4903c0['error']&&_0x4903c0['error'](_0x1138fa(_0x3c1cdc._0x59c517),_0x3c0346);});}['query'](_0x528af3){const _0x5bbc67={_0x544eac:0xab1,_0x377e6f:0x907,_0x3b6784:0xc74},_0x318fe6=_0x35a251,_0x3e980c=_0x528af3[_0x318fe6(0xf8c)];if(_0x3e980c){if(_0x3e980c['type']===_0x318fe6(_0x5bbc67._0x544eac))return _0x528af3[_0x318fe6(0x909)]=_0x3e980c['outlineCoordinates'],this['queryPolygon'](_0x528af3);else{if(_0x3e980c['type']==='polygon')return _0x528af3['polygon']=_0x3e980c['coordinates'],this['queryPolygon'](_0x528af3);else return _0x3e980c['type']==='circle'?(_0x528af3['location']=_0x3e980c['point'],_0x528af3[_0x318fe6(_0x5bbc67._0x377e6f)]=_0x3e980c['radius'],this['queryCircle'](_0x528af3)):Promise[_0x318fe6(_0x5bbc67._0x3b6784)]();}}else return _0x528af3['polygon']?this['queryPolygon'](_0x528af3):this['queryText'](_0x528af3);}['queryText'](_0x5bad42){const _0x54643d={_0x3531a3:0xdf,_0x490df1:0xe1f,_0x4a75ac:0x86c,_0x3b5e88:0xeb7},_0x49e049={_0x1151e8:0xb49},_0x21aeb0={_0x233682:0xb49,_0x66231c:0x74f,_0x53ec5a:0xe1e},_0x45ece6=_0x35a251,_0x3c50b4={'key':this[_0x45ece6(0xa03)],'output':'json','page':(_0x5bad42['page']||0x0)+0x1,'offset':_0x5bad42['count']||0x14,'types':_0x5bad42['types']||''};return Cesium__namespace['defined'](_0x5bad42['city'])&&(_0x3c50b4['city']=_0x5bad42[_0x45ece6(0x2c5)],_0x3c50b4['citylimit']=!![]),Cesium__namespace['defined'](_0x5bad42[_0x45ece6(0xe76)])&&(_0x3c50b4['citylimit']=_0x5bad42[_0x45ece6(0xe76)]),_0x5bad42['text']?_0x3c50b4['keywords']=this[_0x45ece6(_0x54643d._0x3531a3)](_0x5bad42[_0x45ece6(_0x54643d._0x490df1)]):!_0x3c50b4['types']&&(_0x3c50b4['types']='120000|130000|190000'),fetchJson({'url':'https://restapi.amap.com/v3/place/text','queryParameters':_0x3c50b4,...this[_0x45ece6(0xe86)]})[_0x45ece6(_0x54643d._0x4a75ac)](_0x2c78f9=>{const _0x1d19b0=_0x45ece6;if(_0x2c78f9[_0x1d19b0(0x5e3)]!=='10000'){const _0xf4580b=_0x1d19b0(0x9a)+_0x2c78f9['infocode']+'):'+_0x2c78f9['info'];_0x5bad42[_0x1d19b0(_0x21aeb0._0x233682)]&&_0x5bad42['error'](_0xf4580b);return;}if(!_0x2c78f9['pois']){_0x5bad42[_0x1d19b0(0xb49)]&&_0x5bad42[_0x1d19b0(_0x21aeb0._0x233682)](_0x1d19b0(_0x21aeb0._0x66231c),_0x2c78f9);return;}const _0x24eea7=this['_formatPOIData'](_0x2c78f9['pois']),_0x58d57a={'allcount':_0x2c78f9['count'],'count':_0x24eea7[_0x1d19b0(_0x21aeb0._0x53ec5a)],'list':_0x24eea7};return _0x5bad42['success']&&_0x5bad42['success'](_0x58d57a),_0x58d57a;})[_0x45ece6(_0x54643d._0x3b5e88)](_0x281652=>{const _0x3a02ca=_0x45ece6;logError$1('GaodePOI\x20请求出错',_0x281652),_0x5bad42[_0x3a02ca(_0x49e049._0x1151e8)]&&_0x5bad42['error']('请求出错',_0x281652);});}['queryCircle'](_0x106bf6){const _0x3e2831={_0x2b79f4:0x3a4,_0x12d29d:0xfa7},_0x2a30fa={_0x56a138:0x74f,_0x166b1c:0x121,_0x28c3ee:0x907,_0x489634:0xeee},_0x3b4dea=_0x35a251,_0x2fb6a9={'output':'json','key':this['key'],'radius':_0x106bf6['radius']||0xbb8,'page':(_0x106bf6['page']||0x0)+0x1,'offset':_0x106bf6['count']||0x14,'types':_0x106bf6['types']||''};if(_0x106bf6[_0x3b4dea(0x3a4)]){_0x106bf6['location']=LngLatPoint['parse'](_0x106bf6[_0x3b4dea(_0x3e2831._0x2b79f4)]);const _0x10bbec=wgs2gcj([_0x106bf6['location'][_0x3b4dea(_0x3e2831._0x12d29d)],_0x106bf6[_0x3b4dea(_0x3e2831._0x2b79f4)]['lat']]);_0x2fb6a9['location']=_0x10bbec[0x0]+','+_0x10bbec[0x1];}else logError$1(_0x3b4dea(0xd5c));return _0x106bf6[_0x3b4dea(0xe1f)]?_0x2fb6a9[_0x3b4dea(0x1cc)]=this['_getKeywords'](_0x106bf6[_0x3b4dea(0xe1f)]):!_0x2fb6a9['types']&&(_0x2fb6a9['types']='120000|130000|190000'),fetchJson({'url':'https://restapi.amap.com/v3/place/around','queryParameters':_0x2fb6a9,...this[_0x3b4dea(0xe86)]})['then'](_0x1932fc=>{const _0x1327ea=_0x3b4dea;if(_0x1932fc['infocode']!=='10000'){if(_0x106bf6['error']){const _0x5ee553='POI\x20请求失败('+_0x1932fc['infocode']+'):'+_0x1932fc['info'];_0x106bf6['error'](_0x5ee553);}return;}if(!_0x1932fc[_0x1327ea(0xdbc)]){_0x106bf6[_0x1327ea(0xb49)]&&_0x106bf6['error'](_0x1327ea(_0x2a30fa._0x56a138),_0x1932fc);return;}const _0x3207a6=this['_formatPOIData'](_0x1932fc['pois']);let _0x2aa6ee;_0x106bf6['limit']?_0x2aa6ee=this[_0x1327ea(_0x2a30fa._0x166b1c)](_0x3207a6,_0x106bf6['location'],_0x2fb6a9[_0x1327ea(_0x2a30fa._0x28c3ee)]):_0x2aa6ee=_0x3207a6;const _0x234ce5={'allcount':_0x1932fc[_0x1327ea(_0x2a30fa._0x489634)],'count':_0x2aa6ee['length'],'list':_0x2aa6ee};return _0x106bf6['success']&&_0x106bf6['success'](_0x234ce5),_0x234ce5;})['catch'](_0x572b1a=>{logError$1('GaodePOI\x20请求出错',_0x572b1a),_0x106bf6['error']&&_0x106bf6['error']('请求出错',_0x572b1a);});}['_filterPOIData_circle'](_0x1d474e,_0x290f51,_0x402c5d){const _0x514c38={_0xc4c9a8:0xeed},_0x17614d=_0x35a251;if(!_0x1d474e||!_0x290f51||!_0x402c5d)return _0x1d474e;const _0x2e4b4d=_0x290f51['toCartesian'](),_0x1279a8=[];for(let _0x26b2c5=0x0;_0x26b2c5<_0x1d474e['length'];_0x26b2c5++){const _0x34b0fc=_0x1d474e[_0x26b2c5],_0x436a84=Cesium__namespace['Cartesian3']['fromDegrees'](_0x34b0fc['x'],_0x34b0fc['y'],_0x290f51['alt']),_0x52fa6c=Cesium__namespace['Cartesian3'][_0x17614d(_0x514c38._0xc4c9a8)](_0x436a84,_0x2e4b4d);_0x52fa6c<_0x402c5d&&_0x1279a8['push'](_0x34b0fc);}return _0x1279a8;}['queryPolygon'](_0x23bb93){const _0xd8a3a6={_0x1b41fc:0xeee},_0x10043b={_0x528729:0xdbc,_0x2b6574:0xe1e},_0x23db29=_0x35a251,_0x310e71={'key':this['key'],'output':'json','page':(_0x23bb93['page']||0x0)+0x1,'offset':_0x23bb93[_0x23db29(_0xd8a3a6._0x1b41fc)]||0x14,'types':_0x23bb93['types']||''},_0x812e47=_0x23bb93['polygon'];let _0x4f9bf3=[];if(_0x812e47['length']===0x2){const _0x3083b6=wgs2gcj(_0x812e47[0x0]),_0x4acc46=wgs2gcj(_0x812e47[0x1]);_0x310e71[_0x23db29(0x909)]=_0x3083b6[0x0]+','+_0x3083b6[0x1]+'|'+_0x4acc46[0x0]+','+_0x4acc46[0x1],_0x4f9bf3=[_0x812e47[0x0],[_0x812e47[0x0][0x0],_0x812e47[0x1][0x1]],_0x812e47[0x1],[_0x812e47[0x1][0x0],_0x812e47[0x0][0x1]]];}else{_0x4f9bf3=_0x812e47;let _0x89b945='';const _0x716597=_0x812e47['concat']([_0x812e47[0x0]]);for(let _0x51159b=0x0;_0x51159b<_0x716597['length'];_0x51159b++){const _0x228d7c=wgs2gcj(_0x716597[_0x51159b]);_0x51159b===_0x716597['length']-0x1?_0x89b945+=_0x228d7c[0x0]+','+_0x228d7c[0x1]:_0x89b945+=_0x228d7c[0x0]+','+_0x228d7c[0x1]+'|';}_0x310e71['polygon']=_0x89b945;}return _0x23bb93['text']?_0x310e71['keywords']=this[_0x23db29(0xdf)](_0x23bb93['text']):!_0x310e71['types']&&(_0x310e71['types']=_0x23db29(0xde7)),fetchJson({'url':'https://restapi.amap.com/v3/place/polygon','queryParameters':_0x310e71,...this['options']})['then'](_0x47ce59=>{const _0x2cd070=_0x23db29;if(_0x47ce59['infocode']!=='10000'){if(_0x23bb93['error']){const _0x25386=_0x2cd070(0x9a)+_0x47ce59['infocode']+'):'+_0x47ce59[_0x2cd070(0xb92)];_0x23bb93['error'](_0x25386);}return;}if(!_0x47ce59[_0x2cd070(_0x10043b._0x528729)]){_0x23bb93['error']&&_0x23bb93['error']('未查询到相关结果!',_0x47ce59);return;}const _0x5d1cc2=this['_formatPOIData'](_0x47ce59['pois']);let _0xbaf066;_0x23bb93['limit']?_0xbaf066=this['_filterPOIData_polygon'](_0x5d1cc2,_0x4f9bf3):_0xbaf066=_0x5d1cc2;const _0x503443={'allcount':_0x47ce59['count'],'count':_0xbaf066[_0x2cd070(_0x10043b._0x2b6574)],'list':_0xbaf066};return _0x23bb93['success']&&_0x23bb93['success'](_0x503443),_0x503443;})['catch'](_0x337ba6=>{logError$1('GaodePOI\x20请求出错',_0x337ba6),_0x23bb93['error']&&_0x23bb93['error']('请求出错',_0x337ba6);});}['_filterPOIData_polygon'](_0x3a14ac,_0x4f79f3){const _0x1d6abc={_0x378b49:0x98f},_0x17f5b1=_0x35a251;if(!_0x3a14ac||!_0x4f79f3)return;_0x4f79f3=_0x4f79f3['concat']([_0x4f79f3[0x0]]);const _0x2ece57={'type':'Polygon','coordinates':[_0x4f79f3]},_0x4e1d94=[];for(let _0x36b2e7=0x0;_0x36b2e7<_0x3a14ac['length'];_0x36b2e7++){const _0x3513e9=_0x3a14ac[_0x36b2e7],_0x1aa4d0={'type':_0x17f5b1(_0x1d6abc._0x378b49),'geometry':{'type':'Point','coordinates':[_0x3513e9['x'],_0x3513e9['y']]}};booleanPointInPolygon(_0x1aa4d0,_0x2ece57)&&_0x4e1d94['push'](_0x3513e9);}return _0x4e1d94;}}class TdtPOI{constructor(_0x4a0159={}){const _0x5e330d=_0x35a251;this[_0x5e330d(0x887)]=0x0,this['_keys']=_0x4a0159['key']||tiandituArr;}get[_0x35a251(0x68f)](){const _0xd9450b=_0x35a251;return this[_0xd9450b(0xe44)];}set['keys'](_0x5c9ee8){this['_keys']=_0x5c9ee8;}get['key'](){const _0x1c4a6a=this['_key_index']++%this['_keys']['length'];return this['_keys'][_0x1c4a6a];}['_formatPOIData'](_0x4e2215){const _0x3dd318={_0x5b5e8a:0x6de,_0x47ca85:0x93b,_0x43952a:0x56c,_0x1fe051:0x4f3},_0x3049be=_0x35a251,_0x1e2986=[];for(let _0x48c1ab=0x0;_0x48c1ab<_0x4e2215['length'];_0x48c1ab++){const _0x118220=_0x4e2215[_0x48c1ab];let _0x2257a8=[];_0x118220['lonlat']&&_0x118220['lonlat'][_0x3049be(0xe1e)]>0x0&&(_0x2257a8=_0x118220['lonlat']['split'](',')),_0x1e2986[_0x3049be(_0x3dd318._0x5b5e8a)]({'id':_0x118220['hotPointID'],'name':_0x118220[_0x3049be(0x504)],'lng':Number(_0x2257a8[0x0]),'lat':Number(_0x2257a8[0x1]),'type':_0x118220[_0x3049be(0xeaf)],'xzqh':_0x118220[_0x3049be(_0x3dd318._0x47ca85)]+_0x118220['city']+_0x118220['county'],'address':_0x118220[_0x3049be(_0x3dd318._0x43952a)],'tel':_0x118220[_0x3049be(_0x3dd318._0x1fe051)]||'','info':_0x118220,'x':Number(_0x2257a8[0x0]),'y':Number(_0x2257a8[0x1])});}return _0x1e2986;}['_getKeywords'](_0x4a37fb){const _0x59ba08=_0x35a251;if(isString(_0x4a37fb))return _0x4a37fb['replace'](/ /gm,'|')['replace'](/,/gm,'|');else{if(Array['isArray'](_0x4a37fb))return _0x4a37fb[_0x59ba08(0x306)]('|');}return _0x4a37fb;}['getAddress'](_0x28db0f){const _0x2af0b1={_0x9056e4:0x1e6},_0x4e4915={_0x2cffc7:0xb49},_0xe43c22={_0xf1639f:0x5e8,_0x722e52:0x5e3,_0x511fb7:0x9ec,_0xdd10e3:0x986,_0x52f64a:0xcf6,_0x289588:0xcf6},_0x5c0d0f=_0x35a251;if(this['_getAddress_ing'])return Promise['resolve']();const _0x112e50={'ver':0x1};return _0x28db0f[_0x5c0d0f(0x3a4)]=LngLatPoint['parse'](_0x28db0f['location']),_0x112e50['lon']=_0x28db0f['location']['lng'],_0x112e50['lat']=_0x28db0f['location'][_0x5c0d0f(0xb9d)],this['_getAddress_ing']=!![],sendAjax({'url':'http://api.tianditu.gov.cn/geocoder',...this[_0x5c0d0f(0xe86)],'queryParameters':{'type':'geocode','tk':this[_0x5c0d0f(0xa03)],'postStr':JSON[_0x5c0d0f(_0x2af0b1._0x9056e4)](_0x112e50)}})[_0x5c0d0f(0x86c)](_0x5cd425=>{const _0x27476d=_0x5c0d0f;var _0x24da00,_0x39b15b;this['_getAddress_ing']=![];if(((_0x24da00=_0x5cd425[_0x27476d(_0xe43c22._0xf1639f)])===null||_0x24da00===void 0x0?void 0x0:_0x24da00[_0x27476d(_0xe43c22._0x722e52)])!==0x3e8){console[_0x27476d(0x3a8)]('未查询到相关结果!',_0x5cd425);return;}const _0x5d8209=_0x5cd425[_0x27476d(_0xe43c22._0x511fb7)],_0xab9f59={'address':_0x5d8209[_0x27476d(_0xe43c22._0xdd10e3)],'city':(((_0x39b15b=_0x5d8209['addressComponent'])===null||_0x39b15b===void 0x0?void 0x0:_0x39b15b['county_code'])||'')['replace']('156',''),'component':_0x5d8209[_0x27476d(0x790)]};return _0x28db0f[_0x27476d(_0xe43c22._0x52f64a)]&&_0x28db0f[_0x27476d(_0xe43c22._0x289588)](_0xab9f59),_0xab9f59;})[_0x5c0d0f(0xeb7)](_0x37bc0c=>{const _0x18ca18=_0x5c0d0f;this[_0x18ca18(0x6f6)]=![],logError$1('TdtPOI\x20请求出错',_0x37bc0c),_0x28db0f[_0x18ca18(_0x4e4915._0x2cffc7)]&&_0x28db0f['error']('请求出错',_0x37bc0c);});}['autoTip'](_0x439485){const _0x196dbe={_0x1026b0:0x1e6},_0x301a08={_0x9b4f95:0xf37},_0x505dfd={_0xf32db9:0x5e8,_0x334f80:0x3a8,_0x7db633:0xdbc,_0x128cc8:0xcf6},_0x17cc22=_0x35a251,_0x11efc2={'queryType':0x7,'show':0x1,'level':_0x439485['level']||0x12,'mapBound':_0x439485['mapBound']||'70,18,134,51','start':0x0,'offset':0xa};return Cesium__namespace['defined'](_0x439485['city'])&&(_0x11efc2['specify']=_0x17cc22(0x45b)+_0x439485['city']),Cesium__namespace['defined'](_0x439485[_0x17cc22(0xfab)])&&(_0x11efc2['dataTypes']=_0x439485['types']),_0x439485['text']&&(_0x11efc2['keyWord']=this['_getKeywords'](_0x439485['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':_0x17cc22(0x1c9),'tk':this['key'],'postStr':JSON[_0x17cc22(_0x196dbe._0x1026b0)](_0x11efc2)},...this['options']})['then'](_0x10c47a=>{const _0x1ed80d=_0x17cc22;var _0x38fcdd;if(((_0x38fcdd=_0x10c47a[_0x1ed80d(_0x505dfd._0xf32db9)])===null||_0x38fcdd===void 0x0?void 0x0:_0x38fcdd['infocode'])!==0x3e8){console[_0x1ed80d(_0x505dfd._0x334f80)]('未查询到相关结果!',_0x10c47a);_0x439485['error']&&_0x439485['error'](_0x10c47a['status'][_0x1ed80d(0xf42)],_0x10c47a);return;}if(!_0x10c47a[_0x1ed80d(_0x505dfd._0x7db633)]){_0x439485['error']&&_0x439485['error'](_0x1ed80d(0x74f),_0x10c47a);return;}const _0x20bfbb=this['_formatPOIData'](_0x10c47a['pois']),_0x33f65a={'allcount':_0x10c47a['count'],'count':_0x20bfbb['length'],'list':_0x20bfbb};return _0x439485['success']&&_0x439485[_0x1ed80d(_0x505dfd._0x128cc8)](_0x33f65a),_0x33f65a;})[_0x17cc22(0xeb7)](_0x231c48=>{const _0x1b70d4=_0x17cc22;logError$1(_0x1b70d4(_0x301a08._0x9b4f95),_0x231c48),_0x439485['error']&&_0x439485['error']('请求出错',_0x231c48);});}[_0x35a251(0x1c9)](_0x3c3245){const _0x1d641e={_0x34ee2a:0x4a1,_0x2d2a2f:0x8ea,_0x39f599:0x1ba},_0x28158b=_0x35a251,_0x908f12=_0x3c3245['graphic'];if(_0x908f12){if(_0x908f12['type']==='rectangle')return _0x3c3245['polygon']=_0x908f12[_0x28158b(_0x1d641e._0x34ee2a)],this['queryPolygon'](_0x3c3245);else{if(_0x908f12[_0x28158b(_0x1d641e._0x2d2a2f)]==='polygon')return _0x3c3245['polygon']=_0x908f12['coordinates'],this['queryPolygon'](_0x3c3245);else return _0x908f12['type']==='circle'?(_0x3c3245['location']=_0x908f12[_0x28158b(_0x1d641e._0x39f599)],_0x3c3245['radius']=_0x908f12['radius'],this[_0x28158b(0x794)](_0x3c3245)):Promise['resolve']();}}else return _0x3c3245[_0x28158b(0x909)]?this['queryPolygon'](_0x3c3245):this['queryText'](_0x3c3245);}[_0x35a251(0xc2)](_0x39b4a0){const _0x536ada={_0x7d666d:0x1e7,_0x5c7509:0xcbb},_0x4b5c9d={_0xc9f32f:0xacc},_0x5220a9={_0x4c4eb6:0x3a8,_0x6e492a:0xf42,_0x585301:0xb49,_0x5a3fc1:0x74f,_0x40df0f:0xdbc,_0x46b378:0xcf6},_0xfa66b5=_0x35a251,_0x7dfebd=_0x39b4a0['count']||0x14,_0x4b28c0={'queryType':0x7,'show':0x2,'level':_0x39b4a0['level']||0x12,'mapBound':_0x39b4a0[_0xfa66b5(0xd07)]||'70,18,134,51','start':(_0x39b4a0[_0xfa66b5(_0x536ada._0x7d666d)]||0x0)*_0x7dfebd,'offset':_0x7dfebd};return Cesium__namespace['defined'](_0x39b4a0['city'])&&(_0x4b28c0[_0xfa66b5(0x95d)]='156'+_0x39b4a0[_0xfa66b5(0x2c5)]),Cesium__namespace['defined'](_0x39b4a0['types'])&&(_0x4b28c0['dataTypes']=_0x39b4a0['types']),_0x39b4a0['text']&&(_0x4b28c0['keyWord']=this[_0xfa66b5(0xdf)](_0x39b4a0[_0xfa66b5(0xe1f)])),fetchJson({'url':_0xfa66b5(_0x536ada._0x5c7509),'queryParameters':{'type':'query','tk':this['key'],'postStr':JSON[_0xfa66b5(0x1e6)](_0x4b28c0)},...this['options']})['then'](_0x47939a=>{const _0x220273=_0xfa66b5;var _0x2c8054;if(((_0x2c8054=_0x47939a['status'])===null||_0x2c8054===void 0x0?void 0x0:_0x2c8054['infocode'])!==0x3e8){console[_0x220273(_0x5220a9._0x4c4eb6)]('未查询到相关结果!',_0x47939a);_0x39b4a0['error']&&_0x39b4a0['error'](_0x47939a['status'][_0x220273(_0x5220a9._0x6e492a)],_0x47939a);return;}if(!_0x47939a['pois']){_0x39b4a0[_0x220273(_0x5220a9._0x585301)]&&_0x39b4a0['error'](_0x220273(_0x5220a9._0x5a3fc1),_0x47939a);return;}const _0x51492d=this[_0x220273(0x1ec)](_0x47939a[_0x220273(_0x5220a9._0x40df0f)]),_0x3ac155={'allcount':_0x47939a[_0x220273(0xeee)],'count':_0x51492d['length'],'list':_0x51492d};return _0x39b4a0[_0x220273(_0x5220a9._0x46b378)]&&_0x39b4a0['success'](_0x3ac155),_0x3ac155;})['catch'](_0x362403=>{const _0x512c28=_0xfa66b5;logError$1('TdtPOI\x20请求出错',_0x362403),_0x39b4a0['error']&&_0x39b4a0['error'](_0x512c28(_0x4b5c9d._0xc9f32f),_0x362403);});}['queryCircle'](_0x51b36e){const _0x30119e={_0x290040:0x8d0,_0x4e729c:0x3a4,_0x101e56:0xa6c,_0x525eec:0xaa2,_0x2a7052:0xe86},_0x3e531d={_0x394c4b:0xf37,_0x889f8f:0xb49},_0x4a710e={_0x54318c:0x5e3,_0xc72ec8:0xdbc,_0x43e20b:0x74f,_0x15e986:0xeee},_0x20620f=_0x35a251,_0x268bb0=_0x51b36e[_0x20620f(0xeee)]||0x14,_0x11173a={'queryType':0x3,'show':0x2,'queryRadius':formatNum$1(_0x51b36e['radius']||0xbb8,0x0),'start':(_0x51b36e['page']||0x0)*_0x268bb0,'offset':_0x268bb0};return _0x51b36e['location']?(_0x51b36e['location']=LngLatPoint[_0x20620f(_0x30119e._0x290040)](_0x51b36e['location']),_0x11173a['pointLonlat']=_0x51b36e[_0x20620f(_0x30119e._0x4e729c)]['lng']+','+_0x51b36e['location']['lat']):logError$1(_0x20620f(_0x30119e._0x101e56)),Cesium__namespace[_0x20620f(_0x30119e._0x525eec)](_0x51b36e['types'])&&(_0x11173a['dataTypes']=_0x51b36e['types']),_0x51b36e['text']&&(_0x11173a['keyWord']=this['_getKeywords'](_0x51b36e['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':'query','tk':this['key'],'postStr':JSON['stringify'](_0x11173a)},...this[_0x20620f(_0x30119e._0x2a7052)]})['then'](_0x258030=>{const _0x252197=_0x20620f;var _0x2de5d5;if(((_0x2de5d5=_0x258030['status'])===null||_0x2de5d5===void 0x0?void 0x0:_0x2de5d5[_0x252197(_0x4a710e._0x54318c)])!==0x3e8){_0x51b36e[_0x252197(0xb49)]&&_0x51b36e['error'](_0x258030['status']['cndesc'],_0x258030);return;}if(!_0x258030[_0x252197(_0x4a710e._0xc72ec8)]){_0x51b36e[_0x252197(0xb49)]&&_0x51b36e[_0x252197(0xb49)](_0x252197(_0x4a710e._0x43e20b),_0x258030);return;}const _0x470600=this[_0x252197(0x1ec)](_0x258030['pois']);let _0x5f4c03;_0x51b36e['limit']?_0x5f4c03=this['_filterPOIData_circle'](_0x470600,_0x51b36e['location'],_0x11173a['radius']):_0x5f4c03=_0x470600;const _0x55f696={'allcount':_0x258030[_0x252197(_0x4a710e._0x15e986)],'count':_0x5f4c03[_0x252197(0xe1e)],'list':_0x5f4c03};return _0x51b36e[_0x252197(0xcf6)]&&_0x51b36e['success'](_0x55f696),_0x55f696;})[_0x20620f(0xeb7)](_0x54aed9=>{const _0xe1ae64=_0x20620f;logError$1(_0xe1ae64(_0x3e531d._0x394c4b),_0x54aed9),_0x51b36e['error']&&_0x51b36e[_0xe1ae64(_0x3e531d._0x889f8f)]('请求出错',_0x54aed9);});}['_filterPOIData_circle'](_0x3c26f1,_0x536d57,_0x5bdee5){const _0x1aa1d3={_0x432d64:0xeed},_0x1349fa=_0x35a251;if(!_0x3c26f1||!_0x536d57||!_0x5bdee5)return _0x3c26f1;const _0x4684f2=_0x536d57['toCartesian'](),_0x381b92=[];for(let _0xfaae7a=0x0;_0xfaae7a<_0x3c26f1['length'];_0xfaae7a++){const _0x48d9d4=_0x3c26f1[_0xfaae7a],_0x113bae=Cesium__namespace['Cartesian3'][_0x1349fa(0xa6d)](_0x48d9d4['x'],_0x48d9d4['y'],_0x536d57['alt']),_0xd84990=Cesium__namespace['Cartesian3'][_0x1349fa(_0x1aa1d3._0x432d64)](_0x113bae,_0x4684f2);_0xd84990<_0x5bdee5&&_0x381b92[_0x1349fa(0x6de)](_0x48d9d4);}return _0x381b92;}['queryPolygon'](_0x115a17){const _0x3e1d66={_0x23b094:0x909,_0x3a611b:0x1fa,_0x44310f:0xa7f,_0x121bf3:0xdf,_0xff0cd1:0xa03,_0x5c1cc1:0x86c},_0x5b81dd={_0x5387bb:0xb49,_0x7beeb3:0xdbc,_0x2cfb20:0xeee},_0x2c3d9e=_0x35a251,_0x537ed3=_0x115a17['count']||0x14,_0x1536d7={'queryType':0xa,'show':0x2,'start':(_0x115a17['page']||0x0)*_0x537ed3,'offset':_0x537ed3},_0x4f809e=LngLatArray['toArray'](_0x115a17[_0x2c3d9e(_0x3e1d66._0x23b094)]);if(_0x4f809e['length']===0x2)return _0x115a17[_0x2c3d9e(_0x3e1d66._0x3a611b)]=_0x115a17['polygon'],this['queryExtent'](_0x115a17);let _0x6d0537='';const _0x1fd55f=_0x4f809e['concat']([_0x4f809e[0x0]]);for(let _0x3485a2=0x0;_0x3485a2<_0x1fd55f[_0x2c3d9e(0xe1e)];_0x3485a2++){const _0x5ef15f=_0x1fd55f[_0x3485a2];_0x3485a2===_0x1fd55f['length']-0x1?_0x6d0537+=_0x5ef15f[0x0]+','+_0x5ef15f[0x1]:_0x6d0537+=_0x5ef15f[0x0]+','+_0x5ef15f[0x1]+',';}return _0x1536d7['polygon']=_0x6d0537,Cesium__namespace['defined'](_0x115a17['types'])&&(_0x1536d7[_0x2c3d9e(_0x3e1d66._0x44310f)]=_0x115a17['types']),_0x115a17['text']&&(_0x1536d7['keyWord']=this[_0x2c3d9e(_0x3e1d66._0x121bf3)](_0x115a17['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':_0x2c3d9e(0x1c9),'tk':this[_0x2c3d9e(_0x3e1d66._0xff0cd1)],'postStr':JSON['stringify'](_0x1536d7)},...this['options']})[_0x2c3d9e(_0x3e1d66._0x5c1cc1)](_0x458eca=>{const _0x28da39=_0x2c3d9e;var _0x5d9e7e;if(((_0x5d9e7e=_0x458eca['status'])===null||_0x5d9e7e===void 0x0?void 0x0:_0x5d9e7e['infocode'])!==0x3e8){_0x115a17[_0x28da39(_0x5b81dd._0x5387bb)]&&_0x115a17['error'](_0x458eca[_0x28da39(0x5e8)]['cndesc'],_0x458eca);return;}if(!_0x458eca['pois']){_0x115a17[_0x28da39(_0x5b81dd._0x5387bb)]&&_0x115a17['error'](_0x28da39(0x74f),_0x458eca);return;}const _0x2e5bbb=this['_formatPOIData'](_0x458eca[_0x28da39(_0x5b81dd._0x7beeb3)]);let _0x5833c4;_0x115a17['limit']?_0x5833c4=this['_filterPOIData_polygon'](_0x2e5bbb,_0x4f809e):_0x5833c4=_0x2e5bbb;const _0x566f0d={'allcount':_0x458eca[_0x28da39(_0x5b81dd._0x2cfb20)],'count':_0x5833c4['length'],'list':_0x5833c4};return _0x115a17['success']&&_0x115a17[_0x28da39(0xcf6)](_0x566f0d),_0x566f0d;})['catch'](_0x1c486a=>{logError$1('TdtPOI\x20请求出错',_0x1c486a),_0x115a17['error']&&_0x115a17['error']('请求出错',_0x1c486a);});}['_filterPOIData_polygon'](_0x5b9086,_0x16a1ab){const _0x5a6187={_0x1e29cb:0x6de},_0x579944=_0x35a251;if(!_0x5b9086||!_0x16a1ab)return;_0x16a1ab=_0x16a1ab['concat']([_0x16a1ab[0x0]]);const _0x5035df={'type':'Polygon','coordinates':[_0x16a1ab]},_0x650f44=[];for(let _0x47f5d2=0x0;_0x47f5d2<_0x5b9086['length'];_0x47f5d2++){const _0x30dde4=_0x5b9086[_0x47f5d2],_0x47eac4={'type':'Feature','geometry':{'type':'Point','coordinates':[_0x30dde4['x'],_0x30dde4['y']]}};booleanPointInPolygon(_0x47eac4,_0x5035df)&&_0x650f44[_0x579944(_0x5a6187._0x1e29cb)](_0x30dde4);}return _0x650f44;}['queryExtent'](_0x4f19c7){const _0x48a712={_0x3293db:0x1fa,_0x2e5792:0xfab,_0x4d472b:0xcbb,_0x3ee5fc:0x1e6},_0x1c7cd0={_0x44ed80:0xb49,_0x4eded1:0xcf6},_0x4a48d9=_0x35a251,_0x5d56f9=_0x4f19c7['count']||0x14,_0xb33fb5={'queryType':0x2,'show':0x2,'level':0x12,'start':(_0x4f19c7['page']||0x0)*_0x5d56f9,'offset':_0x5d56f9},_0x58e3eb=_0x4f19c7[_0x4a48d9(_0x48a712._0x3293db)][0x0],_0x7d301c=_0x4f19c7['extent'][0x1];return _0xb33fb5['mapBound']=_0x58e3eb[0x0]+','+_0x58e3eb[0x1]+','+_0x7d301c[0x0]+','+_0x7d301c[0x1],Cesium__namespace['defined'](_0x4f19c7[_0x4a48d9(_0x48a712._0x2e5792)])&&(_0xb33fb5['dataTypes']=_0x4f19c7[_0x4a48d9(_0x48a712._0x2e5792)]),_0x4f19c7['text']&&(_0xb33fb5[_0x4a48d9(0xd24)]=this['_getKeywords'](_0x4f19c7['text'])),fetchJson({'url':_0x4a48d9(_0x48a712._0x4d472b),'queryParameters':{'type':'query','tk':this['key'],'postStr':JSON[_0x4a48d9(_0x48a712._0x3ee5fc)](_0xb33fb5)},...this['options']})['then'](_0x3d82da=>{const _0x5051af=_0x4a48d9;var _0x36c7fa;if(((_0x36c7fa=_0x3d82da['status'])===null||_0x36c7fa===void 0x0?void 0x0:_0x36c7fa['infocode'])!==0x3e8){_0x4f19c7['error']&&_0x4f19c7['error'](_0x3d82da['status']['cndesc'],_0x3d82da);return;}if(!_0x3d82da['pois']){_0x4f19c7['error']&&_0x4f19c7[_0x5051af(_0x1c7cd0._0x44ed80)]('未查询到相关结果!',_0x3d82da);return;}const _0x413689=this[_0x5051af(0x1ec)](_0x3d82da['pois']),_0x12e1a1={'allcount':_0x3d82da['count'],'count':_0x413689['length'],'list':_0x413689};return _0x4f19c7['success']&&_0x4f19c7[_0x5051af(_0x1c7cd0._0x4eded1)](_0x12e1a1),_0x12e1a1;})['catch'](_0x1f8eec=>{logError$1('TdtPOI\x20请求出错',_0x1f8eec),_0x4f19c7['error']&&_0x4f19c7['error']('请求出错',_0x1f8eec);});}}const RouteType={'Walking':0x1,'Bicycling':0x2,'Driving':0x3};class GaodeRoute{constructor(_0x28f040={}){this['_key_index']=0x0,this['_keys']=_0x28f040['key']||gaodeArr;}get['keys'](){return this['_keys'];}set['keys'](_0x8d9768){const _0x16b8a1=_0x35a251;this[_0x16b8a1(0xe44)]=_0x8d9768;}get['key'](){const _0x51ddb4=_0x35a251,_0x3fd762=this['_key_index']++%this[_0x51ddb4(0xe44)]['length'];return this['_keys'][_0x3fd762];}[_0x35a251(0x640)](_0x574437,_0x3ffde9,_0x28819b){const _0x4a7c0f={_0xf07fe:0xb0c,_0x1b8a86:0xe1e,_0x45c397:0x6de,_0x243f5b:0xb0c,_0x44a0fd:0xb0c,_0x26caa7:0x6de,_0x22af62:0x6de},_0x591f65=_0x35a251;let _0x27e5b1,_0x1a86cd;const _0x3c7aab=[];_0x574437&&(_0x27e5b1=gcj2wgs(_0x574437['split'](',')));_0x3ffde9&&(_0x1a86cd=gcj2wgs(_0x3ffde9[_0x591f65(_0x4a7c0f._0xf07fe)](',')));if(_0x28819b&&_0x28819b[_0x591f65(_0x4a7c0f._0x1b8a86)]>0x0)for(let _0x20c13e=0x0;_0x20c13e<_0x28819b['length'];_0x20c13e++){const _0x50004e=[];_0x50004e[_0x591f65(_0x4a7c0f._0x45c397)](_0x27e5b1);const _0x5f3684=_0x28819b[_0x20c13e],_0x386724=_0x5f3684['steps'],_0x479116=[],_0x51d6f9=[];for(let _0x14379f=0x0;_0x14379f<_0x386724['length'];_0x14379f++){const _0x7d4c4={'instruction':_0x386724[_0x14379f]['instruction'],'distance':_0x386724[_0x14379f]['distance'],'duration':_0x386724[_0x14379f]['duration'],'points':[],'route':_0x386724[_0x14379f]['road']},_0x1121e6=_0x386724[_0x14379f]['polyline'],_0x290742=_0x1121e6[_0x591f65(_0x4a7c0f._0x243f5b)](';');for(let _0x29a578=0x0;_0x29a578<_0x290742[_0x591f65(_0x4a7c0f._0x1b8a86)];_0x29a578++){const _0x13e2e2=_0x290742[_0x29a578],_0x51d62b=gcj2wgs(_0x13e2e2[_0x591f65(_0x4a7c0f._0x44a0fd)](','));_0x50004e[_0x591f65(_0x4a7c0f._0x26caa7)](_0x51d62b),_0x7d4c4['points']['push'](_0x51d62b);}_0x51d6f9['push'](_0x7d4c4['route']),_0x479116['push'](_0x7d4c4);}_0x50004e[_0x591f65(_0x4a7c0f._0x22af62)](_0x1a86cd),_0x3c7aab['push']({'allDistance':_0x5f3684['distance'],'allDuration':_0x5f3684['duration'],'steps':_0x479116,'points':_0x50004e,'road':_0x51d6f9});}return{'origin':_0x27e5b1,'destination':_0x1a86cd,'paths':_0x3c7aab};}[_0x35a251(0x1c9)](_0x56767b){const _0x59be02={_0x2b67a2:0xbe6},_0x538b46=_0x35a251;switch(_0x56767b[_0x538b46(0x8ea)]){case RouteType['Bicycling']:return this['queryBicycling'](_0x56767b);case RouteType[_0x538b46(_0x59be02._0x2b67a2)]:return this['queryDriving'](_0x56767b);case RouteType['Walking']:default:return this['queryWalking'](_0x56767b);}}['queryArr'](_0x31fe3f){const _0x3aff65={_0x4033b4:0xb49};return new Promise((_0x27e348,_0x696813)=>{const _0x412e3e={_0x3df90a:0x4a6},_0x15dc58=this;let _0x32ef7b=-0x1;const _0x126fe1={};for(const _0x67ba74 in _0x31fe3f){if(_0x67ba74==='points'||_0x67ba74==='success'||_0x67ba74==='error')continue;_0x126fe1[_0x67ba74]=_0x31fe3f[_0x67ba74];}const _0x3adc04=_0x31fe3f['points'],_0x41812b=[];function _0x25f9e0(){const _0x449ebd=_0x2767;_0x32ef7b++,_0x126fe1['points']=_0x3adc04[_0x32ef7b],_0x126fe1['success']=function(_0x36c991){const _0x253813=_0x2767;_0x36c991&&_0x36c991[_0x253813(_0x412e3e._0x3df90a)]&&_0x36c991['paths']['length']>0x0?_0x41812b['push'](_0x36c991['paths'][0x0]):_0x41812b['push'](null),_0x32ef7b>=_0x3adc04['length']-0x1?(_0x31fe3f['success']&&_0x31fe3f['success'](_0x41812b),_0x27e348(_0x41812b)):_0x25f9e0();},_0x126fe1[_0x449ebd(_0x3aff65._0x4033b4)]=_0x126fe1[_0x449ebd(0xcf6)],_0x15dc58['query'](_0x126fe1);}_0x25f9e0();});}['getShortestPath'](_0x5a0683){let _0x324886=Number['MAX_VALUE'],_0x205681=null,_0x8e2cdf=-0x1;for(let _0x5bc40e=0x0;_0x5bc40e<_0x5a0683['length'];_0x5bc40e++){const _0x2eee5a=_0x5a0683[_0x5bc40e];_0x2eee5a&&(_0x2eee5a['allDistance']<=_0x324886&&(_0x205681=_0x2eee5a,_0x8e2cdf=_0x5bc40e,_0x324886=_0x2eee5a['allDistance']));}return{'lineData':_0x205681,'index':_0x8e2cdf};}['queryWalking'](_0x2fa1d3){const _0x46a784={_0x3a48cf:0x34a},_0x4bca30={_0x1e2ce6:0x91e},_0xb5f796={_0x331709:0x5e3,_0x2cfb18:0xb92,_0x46474c:0xb49,_0x30eb75:0x62a},_0x961446=_0x35a251,_0x2a86e6={'key':this['key'],'output':'json'},_0x46ea35=wgs2gcj(_0x2fa1d3[_0x961446(_0x46a784._0x3a48cf)][0x0]),_0x226282=wgs2gcj(_0x2fa1d3['points'][_0x2fa1d3['points'][_0x961446(0xe1e)]-0x1]);return _0x2a86e6['origin']=_0x46ea35[0x0]+','+_0x46ea35[0x1],_0x2a86e6['destination']=_0x226282[0x0]+','+_0x226282[0x1],fetchJson({'url':'https://restapi.amap.com/v3/direction/walking','queryParameters':_0x2a86e6,...this['options']})['then'](_0x33af08=>{const _0x41a47b=_0x961446;if(_0x33af08['infocode']!=='10000'){if(_0x2fa1d3['error']){const _0x225809='路径规划\x20请求失败('+_0x33af08[_0x41a47b(_0xb5f796._0x331709)]+'):'+_0x33af08[_0x41a47b(_0xb5f796._0x2cfb18)];_0x2fa1d3[_0x41a47b(_0xb5f796._0x46474c)](_0x225809);}return;}if(!_0x33af08[_0x41a47b(_0xb5f796._0x30eb75)]||!_0x33af08['route'][_0x41a47b(0x4a6)]){_0x2fa1d3[_0x41a47b(0xb49)]&&_0x2fa1d3['error']('未查询到相关结果!');return;}const _0x4219f0=this['_formatRouteData'](_0x2a86e6['origin'],_0x2a86e6['destination'],_0x33af08['route']['paths']);return _0x2fa1d3['success']&&_0x2fa1d3['success'](_0x4219f0),_0x4219f0;})[_0x961446(0xeb7)](_0x31eca5=>{const _0x59c78f=_0x961446;logError$1(_0x59c78f(_0x4bca30._0x1e2ce6),_0x31eca5),_0x2fa1d3['error']&&_0x2fa1d3['error']('请求出错',_0x31eca5);});}['queryBicycling'](_0x100efa){const _0x17ff90={_0x49046d:0x994,_0x249ec2:0x86c},_0x463a1a=_0x35a251,_0x294b26={'key':this['key'],'output':'json'},_0x1aa37f=wgs2gcj(_0x100efa['points'][0x0]),_0x5213dc=wgs2gcj(_0x100efa['points'][_0x100efa['points']['length']-0x1]);return _0x294b26[_0x463a1a(0x39a)]=_0x1aa37f[0x0]+','+_0x1aa37f[0x1],_0x294b26['destination']=_0x5213dc[0x0]+','+_0x5213dc[0x1],fetchJson({'url':_0x463a1a(_0x17ff90._0x49046d),'queryParameters':_0x294b26,...this['options']})[_0x463a1a(_0x17ff90._0x249ec2)](_0x9ed953=>{const _0x1603a2=_0x463a1a;if(_0x9ed953['infocode']!=='10000'){const _0x245b96='路径规划\x20请求失败('+_0x9ed953['infocode']+'):'+_0x9ed953['info'];_0x100efa['error']&&_0x100efa['error'](_0x245b96);return;}if(!_0x9ed953['route']||!_0x9ed953[_0x1603a2(0x62a)]['paths']){_0x100efa['error']&&_0x100efa['error'](_0x1603a2(0x74f));return;}const _0x165b48=this['_formatRouteData'](_0x294b26[_0x1603a2(0x39a)],_0x294b26['destination'],_0x9ed953['route']['paths']);return _0x100efa['success']&&_0x100efa['success'](_0x165b48),_0x165b48;})['catch'](_0xb4e0f8=>{const _0x4b5a31=_0x463a1a;logError$1('GaodeRoute\x20请求出错',_0xb4e0f8),_0x100efa['error']&&_0x100efa[_0x4b5a31(0xb49)]('请求出错',_0xb4e0f8);});}['queryDriving'](_0x2cce8b){const _0x5c9a57={_0x2dc943:0x695,_0x2a1169:0x34a,_0x510b5d:0xe1e,_0x4cce04:0x83d},_0x222a50={_0x451965:0xb49},_0xd9154f={_0x34b260:0xb49,_0x5f5b36:0x76c,_0x377dcb:0xcf6},_0x58b7d0=_0x35a251;var _0x180b77;const _0x342f08={'key':this['key'],'output':'json','extensions':_0x2cce8b[_0x58b7d0(_0x5c9a57._0x2dc943)]||'base','strategy':_0x2cce8b['strategy']||0x0},_0x3e0acb=wgs2gcj(_0x2cce8b['points'][0x0]),_0x4d0cb0=wgs2gcj(_0x2cce8b['points'][_0x2cce8b['points']['length']-0x1]);_0x342f08['origin']=_0x3e0acb[0x0]+','+_0x3e0acb[0x1],_0x342f08[_0x58b7d0(0x4a3)]=_0x4d0cb0[0x0]+','+_0x4d0cb0[0x1];if(_0x2cce8b['points']['length']>0x2){let _0x5a118b='';for(let _0x1cd778=0x1,_0x3a5ee1=_0x2cce8b[_0x58b7d0(_0x5c9a57._0x2a1169)][_0x58b7d0(_0x5c9a57._0x510b5d)]-0x1;_0x1cd778<_0x3a5ee1;_0x1cd778++){const _0x527fcf=wgs2gcj(_0x2cce8b['points'][_0x1cd778]);_0x5a118b+=_0x527fcf[0x0]+','+_0x527fcf[0x1]+';';}_0x342f08[_0x58b7d0(0xada)]=_0x5a118b;}if(((_0x180b77=_0x2cce8b['avoidpolygons'])===null||_0x180b77===void 0x0?void 0x0:_0x180b77['length'])>0x0){let _0x304a41='';for(let _0xe8d031=0x0,_0x517311=_0x2cce8b[_0x58b7d0(0x83d)]['length'];_0xe8d031<_0x517311;_0xe8d031++){_0xe8d031>0x0&&(_0x304a41+='|');const _0x2cfc14=_0x2cce8b[_0x58b7d0(_0x5c9a57._0x4cce04)][_0xe8d031];for(let _0x11ce06=0x0,_0x592e2a=_0x2cfc14['length'];_0x11ce06<_0x592e2a;_0x11ce06++){const _0x43c464=wgs2gcj(_0x2cfc14[_0x11ce06]);_0x304a41+=_0x43c464[0x0]+','+_0x43c464[0x1]+';';}}_0x342f08['avoidpolygons']=_0x304a41;}return fetchJson({'url':'https://restapi.amap.com/v3/direction/driving','queryParameters':_0x342f08,...this['options']})['then'](_0x3839c8=>{const _0x4fe9b3=_0x58b7d0;if(_0x3839c8['infocode']!=='10000'){if(_0x2cce8b[_0x4fe9b3(_0xd9154f._0x34b260)]){const _0x43a3d7=_0x4fe9b3(_0xd9154f._0x5f5b36)+_0x3839c8['infocode']+'):'+_0x3839c8['info'];_0x2cce8b[_0x4fe9b3(0xb49)](_0x43a3d7);}return;}if(!_0x3839c8['route']||!_0x3839c8['route']['paths']||_0x3839c8['route'][_0x4fe9b3(0x4a6)]['length']===0x0){_0x2cce8b['error']&&_0x2cce8b['error']('未查询到相关结果!');return;}const _0x3ddd7f=this['_formatRouteData'](_0x342f08['origin'],_0x342f08['destination'],_0x3839c8['route']['paths']);return _0x2cce8b[_0x4fe9b3(_0xd9154f._0x377dcb)]&&_0x2cce8b['success'](_0x3ddd7f),_0x3ddd7f;})['catch'](_0x4e936d=>{const _0x91f3a4=_0x58b7d0;logError$1('GaodeRoute\x20请求出错',_0x4e936d),_0x2cce8b['error']&&_0x2cce8b[_0x91f3a4(_0x222a50._0x451965)](_0x91f3a4(0xacc),_0x4e936d);});}}GaodeRoute['RouteType']=RouteType;const Def_Parameters={'service':_0x35a251(0x174),'request':_0x35a251(0x2fc),'version':'1.0.0','outputFormat':'application/json','maxFeatures':0x3e8};class QueryGeoServer extends BaseClass{get[_0x35a251(0x87)](){const _0x9f0f1e={_0x125337:0x7b0},_0x3775bc=_0x35a251;if(!this['_geoJsonLayer']){const _0x50fd8a={...this[_0x3775bc(0xe86)]};delete _0x50fd8a['url'],delete _0x50fd8a['data'],this['_geoJsonLayer']=new GeoJsonLayer(_0x50fd8a),this['_geoJsonLayer']['on'](EventType['load'],this['geoJsonLayer_onLoadHandler'],this),this[_0x3775bc(_0x9f0f1e._0x125337)]['on'](EventType['click'],this[_0x3775bc(0x22e)],this);}return this['_geoJsonLayer'];}['query'](_0x4d082d){const _0x52dfc8={_0x264917:0xef1,_0x466d5a:0xc00,_0x481b33:0x2e4,_0x53ef1a:0x15b,_0x2bc115:0xa34,_0x54527e:0x202,_0x2e80ff:0xcf6},_0xd1807c={_0x52a198:0x6d2,_0x248123:0xb49},_0x21440b=_0x35a251;let _0x26e313='';_0x4d082d['text']&&(Cesium__namespace['defaultValue'](_0x4d082d[_0x21440b(0xacb)],!![])?_0x26e313+='\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4d082d[_0x21440b(0xa3a)]+_0x21440b(_0x52dfc8._0x264917)+_0x4d082d['text']+'*
\x0a\x20\x20\x20\x20\x20\x20\x20\x20':_0x26e313+=_0x21440b(_0x52dfc8._0x466d5a)+_0x4d082d['column']+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4d082d['text']+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20');if(_0x4d082d['graphic']){const _0x5bc998=_0x4d082d['graphic'];let _0xe47642;if(_0x5bc998['type']==='rectangle')_0xe47642=_0x5bc998['outlineCoordinates'];else{if(_0x5bc998['type']==='polygon')_0xe47642=_0x5bc998['coordinates'];else{if(_0x5bc998[_0x21440b(0x8ea)]==='circle')_0xe47642=_0x5bc998[_0x21440b(_0x52dfc8._0x481b33)](!![],0x1e);else Cesium__namespace['defined'](_0x5bc998['xmax'])&&Cesium__namespace['defined'](_0x5bc998[_0x21440b(0x5e2)])&&Cesium__namespace['defined'](_0x5bc998['ymin'])&&Cesium__namespace[_0x21440b(0xaa2)](_0x5bc998['ymax'])&&(_0xe47642=[[_0x5bc998['xmin'],_0x5bc998['ymax']],[_0x5bc998['xmin'],_0x5bc998[_0x21440b(_0x52dfc8._0x53ef1a)]],[_0x5bc998['xmax'],_0x5bc998[_0x21440b(0x15b)]],[_0x5bc998['xmax'],_0x5bc998['ymax']]]);}}if(_0xe47642){_0xe47642[_0x21440b(0x6de)](_0xe47642[0x0]);let _0x3255bb='';for(let _0x2a9df3=0x0;_0x2a9df3<_0xe47642['length'];_0x2a9df3++){let _0x2a8cd6=_0xe47642[_0x2a9df3];this[_0x21440b(0xe86)]['crs']&&this['options']['crs']!==CRS['EPSG4326']&&this['options']['crs']!==CRS['EPSG4490']&&(_0x2a8cd6=proj4Trans(_0x2a8cd6,'EPSG:4326',this[_0x21440b(0xe86)][_0x21440b(_0x52dfc8._0x2bc115)])),_0x3255bb+=_0x2a8cd6[0x0]+','+_0x2a8cd6[0x1]+'\x20';}_0x26e313+='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4d082d[_0x21440b(_0x52dfc8._0x54527e)]||'the_geom')+_0x21440b(0x3cd)+_0x3255bb+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';}}_0x26e313+='';const _0xa46374={...Def_Parameters,..._0x4d082d,'typeName':this['options']['layer'],'filter':_0x26e313};return delete _0xa46374[_0x21440b(_0x52dfc8._0x2e80ff)],delete _0xa46374['error'],delete _0xa46374['graphic'],delete _0xa46374['text'],delete _0xa46374['column'],new Promise((_0x24b5b0,_0x2b8bd5)=>{const _0x285eca=_0x21440b;sendAjax({...this['options'],'queryParameters':_0xa46374})['then'](_0x1828b6=>{const _0x144e8c=_0x2767;_0x4d082d[_0x144e8c(0xf13)]={'resolve':_0x24b5b0,'reject':_0x2b8bd5},this['processFeatureCollection'](_0x1828b6,_0x4d082d);})[_0x285eca(0xeb7)](_0x4bf82e=>{const _0x391dc1=_0x285eca;logError$1(_0x391dc1(_0xd1807c._0x52a198),_0x4bf82e),_0x4d082d[_0x391dc1(_0xd1807c._0x248123)]&&_0x4d082d['error'](_0x391dc1(0xacc),_0x4bf82e);});});}['queryBySql'](_0x2b9a82){const _0x4288c5={_0x3b54a7:0xf8c,_0x4cafc6:0x202,_0x1a0b1f:0x878,_0x754315:0xcea,_0x234412:0x6de,_0x4092be:0xe1e,_0x7bd286:0x7ac,_0x3e2916:0xb49},_0x250476={_0x3f3787:0xb49},_0x4eff6b=_0x35a251;let _0x2dc657=_0x2b9a82['cql_filter']||'1=1';if(_0x2b9a82[_0x4eff6b(_0x4288c5._0x3b54a7)]){let _0x4034c8=_0x2b9a82['graphic'];const _0x494463=_0x2b9a82[_0x4eff6b(_0x4288c5._0x4cafc6)]||'the_geom';let _0x5f160d;if(_0x4034c8['type']==='rectangle'){_0x4034c8=_0x4034c8[_0x4eff6b(_0x4288c5._0x1a0b1f)]({'isFormat':!![]});const _0x1af8db=_0x4034c8[_0x4eff6b(0x5e2)]+','+_0x4034c8['ymin']+','+_0x4034c8['xmax']+','+_0x4034c8['ymax'];_0x2dc657+=_0x4eff6b(0xe00)+_0x494463+',\x20'+_0x1af8db+')';}else{if(_0x4034c8['type']==='polygon')_0x5f160d=_0x4034c8['coordinates'];else{if(_0x4034c8['type']==='circle')_0x5f160d=_0x4034c8['getOutlineCoordinates'](!![],0x1e);else{if(Cesium__namespace[_0x4eff6b(0xaa2)](_0x4034c8['xmax'])&&Cesium__namespace['defined'](_0x4034c8['xmin'])&&Cesium__namespace['defined'](_0x4034c8['ymin'])&&Cesium__namespace['defined'](_0x4034c8[_0x4eff6b(_0x4288c5._0x754315)])){const _0x1aad6f=_0x4034c8['xmin']+','+_0x4034c8['ymin']+','+_0x4034c8['xmax']+','+_0x4034c8['ymax'];_0x2dc657+=_0x4eff6b(0xe00)+_0x494463+',\x20'+_0x1aad6f+')';}}}}if(_0x5f160d){_0x5f160d[_0x4eff6b(_0x4288c5._0x234412)](_0x5f160d[0x0]);const _0x2c2375=[];for(let _0x5a98b1=0x0;_0x5a98b1<_0x5f160d[_0x4eff6b(_0x4288c5._0x4092be)];_0x5a98b1++){_0x2c2375[_0x4eff6b(_0x4288c5._0x234412)](_0x5f160d[_0x5a98b1][0x0]+'\x20'+_0x5f160d[_0x5a98b1][0x1]);}_0x2dc657+='\x20and\x20INTERSECTS\x20('+_0x494463+_0x4eff6b(_0x4288c5._0x7bd286)+_0x2c2375['join'](',')+')))';}}const _0xe28020={...Def_Parameters,..._0x2b9a82,'typeName':this['options']['layer'],'cql_filter':_0x2dc657};return delete _0xe28020['success'],delete _0xe28020[_0x4eff6b(_0x4288c5._0x3e2916)],delete _0xe28020['graphic'],new Promise((_0x369fa7,_0x346519)=>{const _0x3336b9=_0x4eff6b;sendAjax({...this['options'],'queryParameters':_0xe28020})['then'](_0xdc03a6=>{_0x2b9a82['_promise']={'resolve':_0x369fa7,'reject':_0x346519},this['processFeatureCollection'](_0xdc03a6,_0x2b9a82);})[_0x3336b9(0xeb7)](_0x4a6a7d=>{const _0x3083ba=_0x3336b9;logError$1('QueryGeoServer\x20请求出错',_0x4a6a7d),_0x2b9a82['error']&&_0x2b9a82[_0x3083ba(_0x250476._0x3f3787)]('请求出错',_0x4a6a7d);});});}['processFeatureCollection'](_0x3526bd,_0x46528e){const _0x4a826a={_0x2fb315:0x830,_0x4e6fca:0xcf6},_0x4b60b9=_0x35a251;_0x3526bd&&_0x3526bd['type']==='Feature'&&(_0x3526bd={'type':'FeatureCollection','features':[_0x3526bd]});if(!_0x3526bd||!_0x3526bd[_0x4b60b9(0x830)]||_0x3526bd['features']['length']===0x0){var _0xbce8f2;_0x46528e[_0x4b60b9(0xcf6)]&&_0x46528e['success']({'count':0x0}),(_0xbce8f2=_0x46528e['_promise'])!==null&&_0xbce8f2!==void 0x0&&_0xbce8f2['resolve']&&_0x46528e[_0x4b60b9(0xf13)]['resolve']({'count':0x0});}else{const _0x58be2d=[];for(let _0x1e9acc=0x0;_0x1e9acc<_0x3526bd[_0x4b60b9(0x830)]['length'];_0x1e9acc++){var _0x3aacd1,_0x57ea92;const _0x3e906f=_0x3526bd['features'][_0x1e9acc];(_0x3e906f===null||_0x3e906f===void 0x0?void 0x0:(_0x3aacd1=_0x3e906f['geometry'])===null||_0x3aacd1===void 0x0?void 0x0:(_0x57ea92=_0x3aacd1['coordinates'])===null||_0x57ea92===void 0x0?void 0x0:_0x57ea92['length'])>0x0&&_0x58be2d['push'](_0x3e906f);}_0x3526bd['features']=_0x58be2d;if(this['_geoJsonLayer'])this[_0x4b60b9(0xf4d)]=_0x3fea51=>{const _0xa5a0f5=_0x4b60b9;var _0x21fcc9;const _0x780172={'geojson':_0x3526bd,'count':_0x3526bd[_0xa5a0f5(_0x4a826a._0x2fb315)]['length'],'list':_0x3fea51};_0x46528e[_0xa5a0f5(_0x4a826a._0x4e6fca)]&&_0x46528e['success'](_0x780172),(_0x21fcc9=_0x46528e[_0xa5a0f5(0xf13)])!==null&&_0x21fcc9!==void 0x0&&_0x21fcc9['resolve']&&_0x46528e['_promise']['resolve'](_0x780172);},this['_geoJsonLayer']['load']({'data':_0x3526bd});else{var _0x3a725a;const _0x2f2d18={'geojson':_0x3526bd,'count':_0x3526bd['features']['length']};_0x46528e['success']&&_0x46528e['success'](_0x2f2d18),(_0x3a725a=_0x46528e['_promise'])!==null&&_0x3a725a!==void 0x0&&_0x3a725a[_0x4b60b9(0xc74)]&&_0x46528e['_promise']['resolve'](_0x2f2d18);}}}['geoJsonLayer_onLoadHandler'](_0x4984ed){const _0x1f23ba=_0x35a251;this['_last_success']&&(this['_last_success'](_0x4984ed['list']),this['_last_success']=null),this[_0x1f23ba(0x264)](EventType['load'],_0x4984ed);}['geoJsonLayer_onClickHandler'](_0x12064c){const _0x2c996d=_0x35a251;this[_0x2c996d(0x264)](EventType['click'],{..._0x12064c,'layer':this['_geoJsonLayer']});}['clear'](){const _0x2e474b={_0xbd5eb6:0x386},_0x5a59ff=_0x35a251;this[_0x5a59ff(0xf4d)]&&(this[_0x5a59ff(0xf4d)]=null),this['_geoJsonLayer']&&this['_geoJsonLayer'][_0x5a59ff(_0x2e474b._0xbd5eb6)]();}}class QueryArcServer extends BaseClass{constructor(_0x3788ac={}){const _0x5660a7={_0x24daeb:0xe14},_0x76f3c2=_0x35a251;super(_0x3788ac),this['options']=_0x3788ac,this[_0x76f3c2(_0x5660a7._0x24daeb)]=_0x3788ac[_0x76f3c2(0x862)]??0xa,this['_allCount']=0x0,this['_allPage']=0x0,this['_pageIndex']=0x1,this[_0x76f3c2(0x9be)]=[];}get[_0x35a251(0xd05)](){return this['options']['url'];}set[_0x35a251(0xd05)](_0x1258c0){this['options']['url']=_0x1258c0;}get['pageSize'](){return this['_pageSize'];}set['pageSize'](_0x2689f6){this['_pageSize']=_0x2689f6;}get['allCount'](){return this['_allCount'];}get['allPage'](){return this['_allPage'];}get['pageIndex'](){return this['_pageIndex'];}set['pageIndex'](_0x2338b0){const _0x4b0d62=_0x35a251;this[_0x4b0d62(0x836)]=_0x2338b0,this[_0x4b0d62(0x6cb)](_0x2338b0);}get['layer'](){const _0x20ca94={_0x3cb5be:0xce2,_0x5d3cc6:0xfb4},_0x54cc35=_0x35a251;if(!this['_geoJsonLayer']){const _0x1cd6b2={...this['options']};delete _0x1cd6b2['url'],delete _0x1cd6b2[_0x54cc35(_0x20ca94._0x3cb5be)],this['_geoJsonLayer']=new GeoJsonLayer(_0x1cd6b2),this['_geoJsonLayer']['on'](EventType['load'],this['geoJsonLayer_onLoadHandler'],this),this['_geoJsonLayer']['on'](EventType[_0x54cc35(_0x20ca94._0x5d3cc6)],this['geoJsonLayer_onClickHandler'],this);}return this['_geoJsonLayer'];}[_0x35a251(0x1b3)](){const _0x3c5f29={_0x2c97c0:0x6cb},_0x2d9875=_0x35a251;this[_0x2d9875(_0x3c5f29._0x2c97c0)](0x1);}['showPretPage'](){this['_pageIndex']=this['_pageIndex']-0x1,this['_pageIndex']<0x1&&(this['_pageIndex']=0x1),this['showPage'](this['_pageIndex']);}['showNextPage'](){const _0x2589ca=_0x35a251;this['_pageIndex']=this['_pageIndex']+0x1,this['_pageIndex']>this['allPage']&&(this[_0x2589ca(0x836)]=this['allPage']),this['showPage'](this['_pageIndex']);}[_0x35a251(0x6cb)](_0x480c43){this['_pageIndex']=_0x480c43,this['_queryPageByIds']();}['query'](_0xc09cb){const _0xb93e44={_0x4f2e7a:0xe86,_0x3c0847:0xe2f,_0x21a212:0xf10,_0x5e96f7:0xe1f,_0x1050ff:0xf8c,_0x4b9a5d:0xaa2,_0x13c244:0xaa2,_0x1e40cc:0x8ea,_0x5e6c99:0xa0b,_0x47d12e:0x58f,_0x217be2:0x58f},_0x270030={_0xd4400a:0x1e7,_0xbe1645:0xeb7,_0xcea6b0:0xd05},_0x17d345={_0x1168c6:0x89f},_0x476341=_0x35a251;this['_pageIndex']=0x1,this['arrIDS']=[];const _0x15928f={'f':'json','inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':_0xc09cb['where']||_0x476341(0xc88)};this[_0x476341(_0xb93e44._0x4f2e7a)]['token']&&(_0x15928f['token']=this['options'][_0x476341(_0xb93e44._0x3c0847)]);if(_0xc09cb[_0x476341(0xa3a)]){let _0x20f617='';_0xc09cb['like']??!![]?_0x20f617=_0xc09cb['column']+_0x476341(0x1d6)+_0xc09cb['text']+_0x476341(_0xb93e44._0x21a212):_0x20f617=_0xc09cb[_0x476341(0xa3a)]+'=\x27'+_0xc09cb[_0x476341(_0xb93e44._0x5e96f7)]+'\x27',_0x15928f['where']=_0x20f617;}if(_0xc09cb[_0x476341(_0xb93e44._0x1050ff)]){const _0x128ca7=_0xc09cb['graphic'];_0x15928f[_0x476341(0x9e)]='esriSpatialRelIntersects';if(_0x128ca7['type']==='rectangle'){const _0x5d6499=_0x128ca7[_0x476341(0x4a1)];_0x15928f['geometryType']='esriGeometryEnvelope',_0x15928f['geometry']=JSON['stringify']({'xmin':_0x5d6499[0x0][0x0],'ymin':_0x5d6499[0x0][0x1],'xmax':_0x5d6499[0x2][0x0],'ymax':_0x5d6499[0x2][0x1],'spatialReference':{'wkid':0x10e6}});}else{if(Cesium__namespace[_0x476341(_0xb93e44._0x4b9a5d)](_0x128ca7['xmax'])&&Cesium__namespace[_0x476341(0xaa2)](_0x128ca7['xmin'])&&Cesium__namespace[_0x476341(_0xb93e44._0x13c244)](_0x128ca7['ymin'])&&Cesium__namespace['defined'](_0x128ca7['ymax']))_0x15928f['geometryType']='esriGeometryEnvelope',_0x15928f['geometry']=JSON['stringify']({'xmin':_0x128ca7['xmin'],'ymin':_0x128ca7[_0x476341(0x15b)],'xmax':_0x128ca7[_0x476341(0x1db)],'ymax':_0x128ca7['ymax'],'spatialReference':{'wkid':0x10e6}});else{let _0x53fa1b;if(_0x128ca7['type']==='polygon')_0x53fa1b=_0x128ca7['toGeoJSON']();else _0x128ca7[_0x476341(_0xb93e44._0x1e40cc)]==='circle'?_0x53fa1b={'type':'Feature','geometry':{'type':_0x476341(_0xb93e44._0x5e6c99),'coordinates':[_0x128ca7['outlineCoordinates']]}}:_0x53fa1b=_0xc09cb[_0x476341(0xf8c)];_0x15928f[_0x476341(_0xb93e44._0x47d12e)]=JSON[_0x476341(0x1e6)](geojsonToArcGIS$1(_0x53fa1b['geometry'])),_0x15928f[_0x476341(0x415)]=geojsonTypeToArcGIS(_0x53fa1b[_0x476341(_0xb93e44._0x217be2)]['type']);}}}return new Promise((_0x2cae95,_0x31b506)=>{const _0x2358db=_0x476341;_0xc09cb['_promise']={'resolve':_0x2cae95,'reject':_0x31b506},_0xc09cb[_0x2358db(_0x270030._0xd4400a)]??!![]?(_0x15928f['returnIdsOnly']=!![],sendAjax({...this['options'],'url':this['url']+'/query','queryParameters':_0x15928f})[_0x2358db(0x86c)](_0x11febd=>{const _0x1f8687=_0x2358db,_0x1f115f=_0x11febd[_0x1f8687(0xe5c)];_0x1f115f&&(this['arrIDS']=_0x1f115f,this['_allCount']=_0x1f115f['length'],this['_allPage']=Math[_0x1f8687(0xf82)](this['_allCount']/this['_pageSize'])),delete _0x15928f['returnIdsOnly'],this['_queryPageByIds'](_0x15928f,_0xc09cb);})[_0x2358db(_0x270030._0xbe1645)](_0x197eaf=>{const _0x17de33=_0x2358db;logError$1('QueryArcServer\x20请求出错',_0x197eaf),_0xc09cb['error']&&_0xc09cb[_0x17de33(0xb49)](_0x197eaf,_0x197eaf[_0x17de33(0x4c3)]);})):sendAjax({...this['options'],'url':this[_0x2358db(_0x270030._0xcea6b0)]+'/query','queryParameters':_0x15928f})['then'](_0x3a8106=>{const _0x314ed7=_0x2358db,_0x22bd82=arcgisToGeoJSON$1(_0x3a8106);this[_0x314ed7(_0x17d345._0x1168c6)](_0x22bd82,_0xc09cb);})[_0x2358db(0xeb7)](_0x3d8f4a=>{logError$1('QueryArcServer\x20请求出错',_0x3d8f4a),_0xc09cb['error']&&_0xc09cb['error'](_0x3d8f4a,_0x3d8f4a['message']);});});}['_queryPageByIds'](_0x1f88cd,_0x211f21){const _0x439a73={_0xd8e4f3:0x9be,_0x2572cb:0xb4d,_0x13a644:0xf13,_0x10abd4:0xd05,_0x577161:0x6d7},_0x3bb139={_0x47c484:0xb49},_0x3269ff=_0x35a251;if(_0x1f88cd)this['lastParameters']=_0x1f88cd;else this['lastParameters']&&(_0x1f88cd=this[_0x3269ff(0xcd5)]);if(_0x211f21)this['lastQueryOpts']=_0x211f21;else this['lastParameters']&&(_0x211f21=this['lastQueryOpts']);if(!this['arrIDS']||this[_0x3269ff(_0x439a73._0xd8e4f3)][_0x3269ff(0xe1e)]===0x0||this[_0x3269ff(0x836)]<0x1||this['_pageIndex']>this['allPage']){var _0x48d906;const _0x38e365={'geojson':null,'count':0x0,'allCount':this[_0x3269ff(_0x439a73._0x2572cb)],'pageSize':this['pageSize'],'allPage':this['allPage'],'pageIndex':this[_0x3269ff(0xbd8)]};_0x211f21[_0x3269ff(0xcf6)]&&_0x211f21['success'](_0x38e365);(_0x48d906=_0x211f21[_0x3269ff(_0x439a73._0x13a644)])!==null&&_0x48d906!==void 0x0&&_0x48d906['resolve']&&_0x211f21[_0x3269ff(0xf13)][_0x3269ff(0xc74)](_0x38e365);return;}const _0x7159bc=(this['_pageIndex']-0x1)*this['_pageSize'],_0x3ca0e0=this[_0x3269ff(0x836)]*this['_pageSize'],_0x3ade84=this['arrIDS']['slice'](_0x7159bc,_0x3ca0e0);_0x1f88cd['objectIds']=_0x3ade84['join'](','),sendAjax({...this['options'],'url':this[_0x3269ff(_0x439a73._0x10abd4)]+_0x3269ff(_0x439a73._0x577161),'queryParameters':_0x1f88cd})['then'](_0x3b0a3c=>{const _0x11ebe7=arcgisToGeoJSON$1(_0x3b0a3c);this['processFeatureCollection'](_0x11ebe7,_0x211f21);})[_0x3269ff(0xeb7)](_0xe9f870=>{const _0x266321=_0x3269ff;logError$1('QueryArcServer\x20请求出错',_0xe9f870),_0x211f21[_0x266321(_0x3bb139._0x47c484)]&&_0x211f21['error'](_0xe9f870,_0xe9f870['message']);});}['processFeatureCollection'](_0xe16d82,_0x4a209b){const _0x38bb4c={_0x5baebb:0xf13,_0x2e6f6f:0xc74,_0x3455c7:0x35d,_0x26f7da:0x7b0},_0x4532ca=_0x35a251;if(!_0xe16d82||!_0xe16d82['features']||_0xe16d82['features']['length']===0x0){var _0x3a9afd;const _0x1af826={'geojson':null,'count':0x0,'allCount':this['allCount'],'pageSize':this[_0x4532ca(0x862)],'allPage':this['allPage'],'pageIndex':this['pageIndex']};_0x4a209b['success']&&_0x4a209b['success'](_0x1af826),(_0x3a9afd=_0x4a209b['_promise'])!==null&&_0x3a9afd!==void 0x0&&_0x3a9afd['resolve']&&_0x4a209b[_0x4532ca(_0x38bb4c._0x5baebb)][_0x4532ca(_0x38bb4c._0x2e6f6f)](_0x1af826);}else{const _0x3a39dd=[];for(let _0x38ae16=0x0;_0x38ae16<_0xe16d82[_0x4532ca(0x830)]['length'];_0x38ae16++){var _0x4203fb,_0x2d8574;const _0x181af6=_0xe16d82['features'][_0x38ae16];(_0x181af6===null||_0x181af6===void 0x0?void 0x0:(_0x4203fb=_0x181af6['geometry'])===null||_0x4203fb===void 0x0?void 0x0:(_0x2d8574=_0x4203fb['coordinates'])===null||_0x2d8574===void 0x0?void 0x0:_0x2d8574['length'])>0x0&&_0x3a39dd['push'](_0x181af6);}_0xe16d82['features']=_0x3a39dd;const _0xb15ad6={'geojson':_0xe16d82,'count':_0xe16d82['features']['length'],'allCount':this['allCount'],'pageSize':this[_0x4532ca(0x862)],'allPage':this[_0x4532ca(_0x38bb4c._0x3455c7)],'pageIndex':this['pageIndex']};if(this[_0x4532ca(_0x38bb4c._0x26f7da)])this[_0x4532ca(0xf4d)]=_0x162afc=>{var _0x1289da;_0xb15ad6['list']=_0x162afc,_0x4a209b['success']&&_0x4a209b['success'](_0xb15ad6),(_0x1289da=_0x4a209b['_promise'])!==null&&_0x1289da!==void 0x0&&_0x1289da['resolve']&&_0x4a209b['_promise']['resolve'](_0xb15ad6);},this['_geoJsonLayer'][_0x4532ca(0x64a)]({'data':_0xe16d82});else{var _0x30771c;_0x4a209b['success']&&_0x4a209b[_0x4532ca(0xcf6)](_0xb15ad6),(_0x30771c=_0x4a209b['_promise'])!==null&&_0x30771c!==void 0x0&&_0x30771c['resolve']&&_0x4a209b['_promise']['resolve'](_0xb15ad6);}}}['geoJsonLayer_onLoadHandler'](_0x2dc09d){const _0x5fbde8=_0x35a251;this[_0x5fbde8(0xf4d)]&&(this['_last_success'](_0x2dc09d['list']),this['_last_success']=null),this['fire'](EventType['load'],_0x2dc09d);}[_0x35a251(0x22e)](_0x847757){const _0x9aec7c={_0x3055f9:0x264},_0x40908d=_0x35a251;this[_0x40908d(_0x9aec7c._0x3055f9)](EventType['click'],{..._0x847757,'layer':this['_geoJsonLayer']});}['clear'](){this['_last_success']&&(this['_last_success']=null),this['_geoJsonLayer']&&this['_geoJsonLayer']['clear']();}}function geojsonTypeToArcGIS(_0x629628){const _0x4b8bc7={_0x491e38:0xa0b,_0x4682af:0x3bb},_0x11f073=_0x35a251;let _0x2217da;switch(_0x629628){case'MultiPoint':_0x2217da='esriGeometryMultipoint';break;case _0x11f073(0x616):_0x2217da='esriGeometryPolyline';break;case'MultiLineString':_0x2217da=_0x11f073(0x87e);break;case _0x11f073(_0x4b8bc7._0x491e38):_0x2217da='esriGeometryPolygon';break;case'MultiPolygon':_0x2217da=_0x11f073(0xd6f);break;case'Point':default:_0x2217da=_0x11f073(_0x4b8bc7._0x4682af);break;}return _0x2217da;}var index={'__proto__':null,'BaiduPOI':BaiduPOI,'GaodePOI':GaodePOI,'TdtPOI':TdtPOI,'GaodeRoute':GaodeRoute,'QueryGeoServer':QueryGeoServer,'QueryArcServer':QueryArcServer};const name='Mars3D三维可视化平台',website='http://mars3d.cn',author='合肥火星科技有限公司';exports[_0x35a251(0xcd6)]=Cesium__namespace,Object[_0x35a251(0xcb7)](exports,_0x35a251(0x58d),{'enumerable':!![],'get':function(){return Cesium['Resource'];}}),exports[_0x35a251(0x7b8)]=BaseClass,exports['BaseMaterialConver']=BaseMaterialConver,exports['BaseStyleConver']=BaseStyleConver,exports[_0x35a251(0x945)]=BaseThing,exports['BillboardStyleConver']=BillboardStyleConver,exports['BoxStyleConver']=BoxStyleConver,exports['CRS']=CRS,exports['ChinaCRS']=ChinaCRS,exports['CircleStyleConver']=CircleStyleConver,exports['ClipType']=ClipType,exports['CloudStyleConver']=CloudStyleConver,exports['ColorOptsConver']=ColorOptsConver,exports['ControlType']=ControlType,exports['ControlUtil']=ControlUtil,exports['CorridorStyleConver']=CorridorStyleConver,exports[_0x35a251(0x850)]=CylinderStyleConver,exports['DivGraphicStyleConver']=DivGraphicStyleConver,exports['DomUtil']=DomUtil,exports['DrawUtil']=DrawUtil,exports[_0x35a251(0x3a0)]=EffectType,exports['EffectUtil']=EffectUtil,exports[_0x35a251(0x493)]=EllipsoidStyleConver,exports[_0x35a251(0x4f4)]=EventType,exports['GraphicType']=GraphicType,exports['GraphicUtil']=GraphicUtil,exports[_0x35a251(0x451)]=GroundSkyBox,exports[_0x35a251(0x45d)]=GroupThing,exports['Icon']=Icon,exports['ImageOptsConver']=ImageOptsConver,exports['LabelStyleConver']=LabelStyleConver,exports['Lang']=Lang,exports[_0x35a251(0xc35)]=LangType,exports['LayerType']=LayerType,exports['LayerUtil']=LayerUtil,exports['LngLatArray']=LngLatArray,exports[_0x35a251(0x615)]=LngLatPoint,exports['LocalWorldTransform']=LocalWorldTransform,exports['Log']=Log,exports['Map']=Map,exports['MarsArray']=MarsArray,exports[_0x35a251(0x41e)]=MaterialType$1,exports['MaterialUtil']=MaterialUtil,exports[_0x35a251(0x35e)]=MeasureUtil,exports['ModelStyleConver']=ModelStyleConver,exports[_0x35a251(0x327)]=MoveType,exports[_0x35a251(0xc6d)]=MultipleSkyBox,exports[_0x35a251(0xf98)]=PathStyleConver,exports['PlaneStyleConver']=PlaneStyleConver,exports['PointStyleConver']=PointStyleConver,exports['PointTrans']=PointTrans,exports[_0x35a251(0x322)]=PointUtil,exports['PolyUtil']=PolyUtil,exports[_0x35a251(0xb18)]=PolygonStyleConver,exports['PolylineStyleConver']=PolylineStyleConver,exports[_0x35a251(0x589)]=PolylineVolumeStyleConver,exports[_0x35a251(0x52c)]=RectangleStyleConver,exports[_0x35a251(0x82a)]=RectangularSensorStyleConver,exports['State']=State,exports[_0x35a251(0xe58)]=Texture3,exports['Token']=Token,exports['Util']=Util,exports['WallStyleConver']=WallStyleConver,exports[_0x35a251(0x131)]=author,exports['control']=index$1,exports[_0x35a251(0x49d)]=index$2,exports['graphic']=index$6,exports[_0x35a251(0x87)]=index$4,exports[_0x35a251(0x27f)]=index$7,exports['name']=name,exports[_0x35a251(0xfba)]=proj4,exports['provider']=index$5,exports['query']=index,exports['thing']=index$3,exports['update']=update,exports['version']=version,exports['website']=website,Object[_0x35a251(0xcb7)](exports,'__esModule',{'value':!![]}); +'use strict';const _0x3d5d32=_0x4132;(function(_0x3c116e,_0x1c3c1b){const _0x42d86b={_0x4120d1:0x9ed,_0x74a901:0x6fe,_0x5b518f:0x448,_0x514f6e:0x692},_0x242224=_0x4132,_0x1b6721=_0x3c116e();while(!![]){try{const _0x319ee2=parseInt(_0x242224(0x2bf))/0x1*(parseInt(_0x242224(_0x42d86b._0x4120d1))/0x2)+-parseInt(_0x242224(0x335))/0x3+parseInt(_0x242224(_0x42d86b._0x74a901))/0x4+parseInt(_0x242224(_0x42d86b._0x5b518f))/0x5+-parseInt(_0x242224(_0x42d86b._0x514f6e))/0x6+-parseInt(_0x242224(0xe13))/0x7+parseInt(_0x242224(0x58c))/0x8;if(_0x319ee2===_0x1c3c1b)break;else _0x1b6721['push'](_0x1b6721['shift']());}catch(_0x45af0c){_0x1b6721['push'](_0x1b6721['shift']());}}}(_0x1bfe,0x4fa35));function _interopNamespace(_0x380077){const _0x561b68={_0x1df7e7:0xa85},_0xe7303d=_0x4132;if(_0x380077&&_0x380077[_0xe7303d(_0x561b68._0x1df7e7)])return _0x380077;var _0x3b35d8=Object['create'](null);return _0x380077&&Object['keys'](_0x380077)['forEach'](function(_0x2b96d3){const _0x3c5b96=_0xe7303d;if(_0x2b96d3!=='default'){var _0x33dd95=Object[_0x3c5b96(0x450)](_0x380077,_0x2b96d3);Object['defineProperty'](_0x3b35d8,_0x2b96d3,_0x33dd95['get']?_0x33dd95:{'enumerable':!![],'get':function(){return _0x380077[_0x2b96d3];}});}}),_0x3b35d8['default']=_0x380077,_0x3b35d8;}var Cesium__namespace=_interopNamespace(Cesium);if(!(Cesium__namespace!==null&&Cesium__namespace!==void 0x0&&Cesium__namespace[_0x3d5d32(0xa8e)]))throw new Error('请引入\x20Cesium\x20库');const getUrlComponent_old=Cesium__namespace[_0x3d5d32(0x413)]['prototype'][_0x3d5d32(0xb83)];Cesium__namespace[_0x3d5d32(0x413)][_0x3d5d32(0xf8c)]['getUrlComponent']=function(_0x775ce2,_0x4f2635){const _0x3201c8={_0x1b8db3:0x413},_0x376854=_0x3d5d32;let _0x1c18c8=getUrlComponent_old['bind'](this)(_0x775ce2,_0x4f2635);return Cesium__namespace['Resource']['ReplaceUrl']&&(_0x1c18c8=Cesium__namespace[_0x376854(_0x3201c8._0x1b8db3)]['ReplaceUrl'](_0x1c18c8)),this['_last_url']=_0x1c18c8,_0x1c18c8;};const getValueInReferenceFrame_old=Cesium__namespace['ConstantPositionProperty']['prototype']['getValueInReferenceFrame'];Cesium__namespace['ConstantPositionProperty'][_0x3d5d32(0xf8c)]['getValueInReferenceFrame']=function(_0x3066c2,_0x51ac85,_0x848412){const _0x2cf901={_0x3337f5:0x419},_0x3ff5db=_0x3d5d32;return!Cesium__namespace['defined'](_0x3066c2)&&(_0x3066c2=Cesium__namespace['JulianDate'][_0x3ff5db(_0x2cf901._0x3337f5)]()),getValueInReferenceFrame_old['bind'](this)(_0x3066c2,_0x51ac85,_0x848412);},Cesium__namespace['VelocityOrientationProperty'][_0x3d5d32(0xf8c)][_0x3d5d32(0xfbe)]=function(_0xeff41e,_0x46428a){const _0x8eacaa={_0x3b2bc1:0x1045,_0x6878cd:0xe95},_0x2ba331=_0x3d5d32;!this['_positionScratch']&&(this['_positionScratch']=new Cesium__namespace[(_0x2ba331(0xe95))](),this[_0x2ba331(_0x8eacaa._0x3b2bc1)]=new Cesium__namespace[(_0x2ba331(_0x8eacaa._0x6878cd))](),this['_rotationScratch']=new Cesium__namespace['Matrix3']());let _0x2fc168=this['_velocityVectorProperty']['_getValue'](_0xeff41e,this['_velocityScratch'],this['_positionScratch']);Cesium__namespace['defined'](_0x2fc168)?this['_last_velocity']=_0x2fc168[_0x2ba331(0x315)]():_0x2fc168=this['_last_velocity'];if(!Cesium__namespace['defined'](_0x2fc168))return undefined;return Cesium__namespace['Transforms']['rotationMatrixFromPositionVelocity'](this['_positionScratch'],_0x2fc168,this['_ellipsoid'],this['_rotationScratch']),Cesium__namespace['Quaternion']['fromRotationMatrix'](this['_rotationScratch'],_0x46428a);};const beginFrame_old=Cesium__namespace['Globe'][_0x3d5d32(0xf8c)][_0x3d5d32(0xcaa)];Cesium__namespace['Globe']['prototype']['beginFrame']=function(_0x34e367){const _0x344275={_0x27c2a7:0x1009,_0x4e13e3:0xe46,_0x4f2c8c:0x665},_0x4a38e7=_0x3d5d32;var _0x14bc94,_0xe89c67,_0xb1d121,_0x5b6e59;const _0x30b570=(_0x14bc94=this['_surface'][_0x4a38e7(_0x344275._0x27c2a7)])===null||_0x14bc94===void 0x0?void 0x0:(_0xe89c67=_0x14bc94['marsOptions'])===null||_0xe89c67===void 0x0?void 0x0:_0xe89c67['flat'];_0x30b570&&(_0x30b570[_0x4a38e7(_0x344275._0x4e13e3)]&&(_0x30b570['texture']&&_0x30b570['texture'][_0x4a38e7(0x689)](),_0x30b570['texture']=createFlattingAreaTextureOrLimitAreaTexture(_0x34e367['context'],_0x30b570['areas'],_0x30b570['heights']),_0x30b570['hasUpdate']=![]));const _0x365715=(_0xb1d121=this['_surface']['_tileProvider'])===null||_0xb1d121===void 0x0?void 0x0:(_0x5b6e59=_0xb1d121['marsOptions'])===null||_0x5b6e59===void 0x0?void 0x0:_0x5b6e59['uplift'];return _0x365715&&(_0x365715['hasUpdate']&&(_0x365715['texture']&&_0x365715[_0x4a38e7(_0x344275._0x4f2c8c)]['destroy'](),_0x365715['texture']=createFlattingAreaTextureOrLimitAreaTexture(_0x34e367[_0x4a38e7(0x92a)],_0x365715['areas'],undefined),_0x365715['hasUpdate']=![])),beginFrame_old['bind'](this)(_0x34e367);};function createFlattingAreaTextureOrLimitAreaTexture(_0x98c132,_0x2c2ad2,_0x90834c){const _0x18befe={_0x19adb9:0xb52},_0x1fb1a0={_0x528ec1:0xb75},_0x375386=_0x3d5d32,_0x597e1f=_0x2c2ad2===null||_0x2c2ad2===void 0x0?void 0x0:_0x2c2ad2['length'];if(!_0x597e1f||_0x597e1f===0x0)return undefined;let _0x594cd9=0x0;_0x2c2ad2['forEach'](_0x970bc0=>{_0x594cd9<_0x970bc0['length']&&(_0x594cd9=_0x970bc0['length']);});const _0x59c24b=[];return _0x2c2ad2['forEach']((_0x592086,_0x94f10f)=>{const _0x45830a={_0x1bf073:0xb84},_0x3c263a=_0x4132,_0x5e1fb4=_0x592086['length'];_0x592086['forEach'](_0x3dc10e=>{const _0x2e3015=_0x4132;_0x59c24b[_0x2e3015(0xb75)](_0x3dc10e['longitude']),_0x59c24b['push'](_0x3dc10e[_0x2e3015(0x406)]),_0x59c24b['push'](_0x5e1fb4),Cesium__namespace[_0x2e3015(_0x45830a._0x1bf073)](_0x90834c)?_0x59c24b['push'](_0x90834c[_0x94f10f]):_0x59c24b['push'](0x0);});if(_0x5e1fb4<_0x594cd9)for(let _0x5c20d0=0x0;_0x5c20d0<_0x594cd9-_0x5e1fb4;_0x5c20d0++){_0x59c24b['push'](0x0),_0x59c24b['push'](0x0),_0x59c24b[_0x3c263a(_0x1fb1a0._0x528ec1)](0x0),_0x59c24b['push'](0x0);}}),new Cesium__namespace[(_0x375386(0x979))]({'context':_0x98c132,'pixelFormat':Cesium__namespace[_0x375386(0x2bb)]['RGBA'],'pixelDatatype':Cesium__namespace[_0x375386(_0x18befe._0x19adb9)]['FLOAT'],'sampler':new Cesium__namespace['Sampler']({'wrapS':Cesium__namespace['TextureWrap']['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace[_0x375386(0xfd0)]['CLAMP_TO_EDGE'],'minificationFilter':Cesium__namespace['TextureMinificationFilter'][_0x375386(0x70c)],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['NEAREST']}),'flipY':![],'source':{'width':_0x594cd9,'height':_0x597e1f,'arrayBufferView':new Float32Array(_0x59c24b)}});}Object['defineProperties'](Cesium__namespace[_0x3d5d32(0x83b)][_0x3d5d32(0xf8c)],{'marsOptions':{'get':function(){return this['_marsOptions'];}}}),Cesium__namespace[_0x3d5d32(0x83b)][_0x3d5d32(0xf8c)]['_initByMars3D']=function(_0x59b185){const _0x8c4957={_0xe9d460:0xbff},_0x461da9={_0x482453:0xe8f},_0x58593a={_0x5601ff:0xbff},_0x2376c2={_0x4aaea6:0x1010,_0x12ae4e:0x61a},_0xf8b8a0={_0x5ac8c6:0x1010},_0x28cdeb={_0x44123c:0xbff},_0x3ce166={_0x2c943f:0xa63,_0x53ae72:0x786,_0x2656ad:0x786},_0x92bdca={_0x3161cc:0xbf2,_0x3a9e7b:0xafe},_0x403c59={_0xf2e825:0x83e},_0x5b150e={_0x2f0fbe:0x6a8},_0x3995a6=_0x3d5d32,_0x39a95d=this;this['_marsOptions']={'resetValue':function(){this['resetClipValue'](),this['resetFloodValue'](),this['resetFlatValue'](),this['resetUpliftValue']();},'flat':{},'resetFlatValue':function(){const _0x5b5ca0=_0x4132;this['flat']['enabled']=![],this[_0x5b5ca0(0x6a8)]['heights']=[],this['flat'][_0x5b5ca0(0xde5)]=undefined,this[_0x5b5ca0(_0x5b150e._0x2f0fbe)]['areas']=undefined,this['flat']['texture']=undefined,this['flat']['hasUpdate']=![];},'uplift':{},'resetUpliftValue':function(){const _0x570e4f=_0x4132;this['uplift']['enabled']=![],this['uplift']['showUp']=!![],this['uplift'][_0x570e4f(_0x403c59._0xf2e825)]=0x0,this['uplift'][_0x570e4f(0xde5)]=undefined,this['uplift']['areas']=undefined,this['uplift']['texture']=undefined,this['uplift']['hasUpdate']=![];},'clip':{},'resetClipValue':function(){const _0x1771d0=_0x4132;this['clip']['enabled']=![],this['clip']['clipOutSide']=![],this['clip']['polygonTexture']=undefined,this['clip'][_0x1771d0(_0x92bdca._0x3161cc)]=Cesium__namespace['Cartesian4']['ZERO'],this['clip'][_0x1771d0(_0x92bdca._0x3a9e7b)]=Cesium__namespace['Matrix4'][_0x1771d0(0x61a)];},'flood':{},'resetFloodValue':function(){const _0x4f8270=_0x4132;this['flood'][_0x4f8270(_0x3ce166._0x2c943f)]=![],this[_0x4f8270(_0x3ce166._0x53ae72)][_0x4f8270(0xaa8)]=!![],this[_0x4f8270(_0x3ce166._0x2656ad)]['showElseArea']=!![],this[_0x4f8270(_0x3ce166._0x53ae72)][_0x4f8270(0x8cc)]=undefined,this['flood'][_0x4f8270(0xafe)]=Cesium__namespace['Matrix4']['ZERO'],this['flood']['floodRect']=Cesium__namespace['Cartesian4']['ZERO'],this['flood'][_0x4f8270(0x1d0)]=new Cesium__namespace['Cartesian4'](0x0,0x0,0x0,0x1f4),this[_0x4f8270(0x786)][_0x4f8270(0xe8f)]=new Cesium__namespace['Color'](0.15,0.7,0.95,0.5);},'updateTileUniformMap':function(_0x56471e,_0x3285d0){const _0x5bce93={_0x44e8fb:0x786,_0x2af1a5:0x1d0},_0x55748f={_0x15fb61:0xbff},_0x10a10e={_0x2edbd5:0x8cc,_0x30b354:0xcb8};return{'u_mars_clip_enabled':function(){const _0xc2d14f=_0x4132;return _0x39a95d[_0xc2d14f(_0x28cdeb._0x44123c)]['clip']['enabled'];},'u_mars_clip_only':function(){return _0x39a95d['_marsOptions']['clip']['clipOutSide'];},'u_mars_clip_area':function(){const _0x4294e5=_0x4132;return _0x39a95d[_0x4294e5(0xbff)][_0x4294e5(_0xf8b8a0._0x5ac8c6)]['polygonTexture']||_0x56471e['context']['defaultTexture'];},'u_mars_clip_inverMatrix':function(){const _0x328b23=_0x4132;return _0x39a95d['_marsOptions'][_0x328b23(_0x2376c2._0x4aaea6)]['inverMatrix']||Cesium__namespace['Matrix4'][_0x328b23(_0x2376c2._0x12ae4e)];},'u_mars_clip_rect':function(){const _0x3384d5=_0x4132;return _0x39a95d[_0x3384d5(_0x58593a._0x5601ff)][_0x3384d5(0x1010)]['tailorRect']||Cesium__namespace['Cartesian4']['ZERO'];},'u_mars_flood_emabled':function(){return _0x39a95d['_marsOptions']['flood']['enabled'];},'u_mars_flood_globe':function(){const _0x3a8be9=_0x4132;return _0x39a95d['_marsOptions']['flood'][_0x3a8be9(0xaa8)];},'u_mars_flood_showElse':function(){const _0x3cc18e=_0x4132;return _0x39a95d[_0x3cc18e(0xbff)]['flood']['showElseArea'];},'u_mars_flood_area':function(){const _0x535885=_0x4132;return _0x39a95d['_marsOptions']['flood'][_0x535885(_0x10a10e._0x2edbd5)]||_0x56471e['context'][_0x535885(_0x10a10e._0x30b354)];},'u_mars_flood_inverMatrix':function(){return _0x39a95d['_marsOptions']['flood']['inverMatrix']||Cesium__namespace['Matrix4']['ZERO'];},'u_mars_flood_rect':function(){const _0x3eea12=_0x4132;return _0x39a95d[_0x3eea12(_0x55748f._0x15fb61)]['flood'][_0x3eea12(0x47d)]||Cesium__namespace['Cartesian4']['ZERO'];},'u_mars_flood_val':function(){const _0x392c4e=_0x4132;return _0x39a95d['_marsOptions'][_0x392c4e(_0x5bce93._0x44e8fb)][_0x392c4e(_0x5bce93._0x2af1a5)];},'u_mars_flood_color':function(){const _0xd745d8=_0x4132;return _0x39a95d['_marsOptions']['flood'][_0xd745d8(_0x461da9._0x482453)];}};}},this[_0x3995a6(_0x8c4957._0xe9d460)]['resetValue']();},Cesium__namespace[_0x3d5d32(0xfc2)]['prototype'][_0x3d5d32(0x9ee)]=function(_0x186415,_0x4f2184){const _0x48d09f={_0x1bb229:0xe17,_0x410a5f:0xe17,_0x569ad9:0x84f,_0x45379f:0xf15},_0x183382=_0x3d5d32;this[_0x183382(_0x48d09f._0x1bb229)]=_0x4f2184[_0x183382(_0x48d09f._0x410a5f)]??_0x186415['invertColor'],this['filterColor']=_0x4f2184['filterColor']??_0x186415['filterColor'],this['filterColor']&&typeof this[_0x183382(_0x48d09f._0x569ad9)]==='string'&&this['filterColor']['constructor']===String&&(this[_0x183382(0x84f)]=Cesium__namespace['Color'][_0x183382(_0x48d09f._0x45379f)](this[_0x183382(0x84f)]));},Cesium__namespace['ImageryLayerCollection'][_0x3d5d32(0xf8c)]['addImageryProvider']=function(_0x1b2ee0,_0x2fd555){const _0x470b0c=new Cesium__namespace['ImageryLayer'](_0x1b2ee0,_0x1b2ee0['options']);return this['add'](_0x470b0c,_0x2fd555),_0x470b0c;};const createShadowReceiveFragmentShader_old=Cesium__namespace['ShadowMapShader']['createShadowReceiveFragmentShader'];Cesium__namespace[_0x3d5d32(0xcd3)]['createShadowReceiveFragmentShader']=function(_0x6df451,_0x2855e8,_0x5ef2cc,_0x355143,_0x3ea396){const _0x563752={_0x20f974:0x21e,_0x48cb5d:0x53f,_0x58d96a:0xd52},_0x475301=_0x3d5d32,_0x1e9d1a=createShadowReceiveFragmentShader_old[_0x475301(_0x563752._0x20f974)](this)(_0x6df451,_0x2855e8,_0x5ef2cc,_0x355143,_0x3ea396);if(!isSun(_0x2855e8[_0x475301(_0x563752._0x48cb5d)]['position'])){const _0x45e394=_0x1e9d1a['sources'][_0x1e9d1a[_0x475301(_0x563752._0x58d96a)]['length']-0x1];_0x1e9d1a['sources'][_0x1e9d1a['sources']['length']-0x1]=_0x45e394['replace']('out_FragColor.rgb\x20*=\x20visibility;','out_FragColor.rgb\x20=\x20out_FragColor.rgb;');}return _0x1e9d1a;};function isSun(_0x9b3d43){const _0x1b78ee={_0x3f5c67:0x4ba},_0x2bf602=_0x3d5d32;if(Math['abs'](_0x9b3d43['x'])>0x71ff98)return!![];if(Math[_0x2bf602(_0x1b78ee._0x3f5c67)](_0x9b3d43['y'])>0x71ff98)return!![];if(Math['abs'](_0x9b3d43['z'])>0x71ff98)return!![];return![];}Object['defineProperties'](Cesium__namespace[_0x3d5d32(0xafa)]['prototype'],{'circle':{'set':function(_0x230215){this['ellipse']=_0x230215;},'get':function(){return this['ellipse'];}}}),Cesium__namespace['PerformanceDisplay']['prototype']['update']=function(_0x2ee1d2){const _0x25b844={_0x424da8:0x808,_0x4a9fef:0x735,_0x3356da:0x7c1},_0x2c84fe=_0x3d5d32,_0x2c4325=Cesium__namespace['getTimestamp'](),_0x5daa83=_0x2ee1d2??!![];this['_fpsFrameCount']++;const _0x4e6a28=_0x2c4325-this[_0x2c84fe(0xe9e)];if(_0x4e6a28>0x3e8){if(_0x5daa83){const _0x339033=this['_fpsFrameCount']*0x3e8/_0x4e6a28|0x0;this['_fpsText']['nodeValue']=_0x339033+'\x20FPS';}this[_0x2c84fe(0xe9e)]=_0x2c4325,this[_0x2c84fe(_0x25b844._0x424da8)]=0x0;}this[_0x2c84fe(_0x25b844._0x4a9fef)]++;const _0x4c13a7=_0x2c4325-this['_lastMsSampleTime'];if(_0x4c13a7>0xc8){if(_0x5daa83){const _0x1379be=(_0x4c13a7/this['_msFrameCount'])['toFixed'](0x2);this['_msText']['nodeValue']=_0x1379be+'\x20MS';}this[_0x2c84fe(_0x25b844._0x3356da)]=_0x2c4325,this['_msFrameCount']=0x0;}};const load_old=Cesium__namespace[_0x3d5d32(0x854)]['prototype']['load'];Cesium__namespace['I3SLayer'][_0x3d5d32(0xf8c)]['load']=function(){const _0x294e67={_0x262781:0xb0d},_0xfaf5a0=_0x3d5d32;var _0x36a681,_0x567db9;return((_0x36a681=this['_data'])===null||_0x36a681===void 0x0?void 0x0:(_0x567db9=_0x36a681[_0xfaf5a0(0xb0d)])===null||_0x567db9===void 0x0?void 0x0:_0x567db9['wkid'])===0x118a&&(this['_data'][_0xfaf5a0(_0x294e67._0x262781)]['wkid']=0x10e6),load_old[_0xfaf5a0(0x21e)](this)();},Object[_0x3d5d32(0xba4)](Cesium__namespace[_0x3d5d32(0x58e)]['prototype'],{'globalAlpha':{'set':function(_0x4408f5){const _0x49f038={_0x3fd0a5:0x6f9},_0x36b751=_0x3d5d32;this[_0x36b751(_0x49f038._0x3fd0a5)]=_0x4408f5;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$6=Cesium__namespace[_0x3d5d32(0x58e)]['prototype']['getValue'];Cesium__namespace['CheckerboardMaterialProperty']['prototype'][_0x3d5d32(0xfbe)]=function(_0x4284fd,_0xb1f797){const _0x1606cd={_0x224571:0xea7,_0x22823c:0xc5b,_0x444824:0x24b,_0x44b122:0x498,_0x26c1ca:0x457},_0x1a3020=_0x3d5d32;return _0xb1f797=getValue_old$6['bind'](this)(_0x4284fd,_0xb1f797),this[_0x1a3020(0xc96)]!==0x1&&(_0xb1f797[_0x1a3020(_0x1606cd._0x224571)]&&(_0xb1f797['lightColor']['alpha']*=this['globalAlpha']),_0xb1f797['darkColor']&&(_0xb1f797[_0x1a3020(_0x1606cd._0x22823c)][_0x1a3020(_0x1606cd._0x444824)]*=this['globalAlpha']),_0xb1f797[_0x1a3020(_0x1606cd._0x44b122)]&&(_0xb1f797['evenColor'][_0x1a3020(0x24b)]*=this[_0x1a3020(0xc96)]),_0xb1f797[_0x1a3020(_0x1606cd._0x26c1ca)]&&(_0xb1f797['oddColor']['alpha']*=this['globalAlpha'])),_0xb1f797;};let _hasInfo=!![],_hasError=!![];function hasInfo(_0x4301a0){_hasInfo=_0x4301a0;}function hasWarn(_0x4f247f){_hasInfo=_0x4f247f;}function hasError(_0x1818f5){_hasError=_0x1818f5;}function logInfo(..._0x4d62ea){if(!_hasInfo)return;console['log'](..._0x4d62ea);}function logWarn(..._0x1f4fe7){console['warn'](..._0x1f4fe7);}function logError$1(..._0x291340){if(!_hasError)return;console['error'](..._0x291340);}var Log={'__proto__':null,'hasInfo':hasInfo,'hasWarn':hasWarn,'hasError':hasError,'logInfo':logInfo,'logWarn':logWarn,'logError':logError$1};const GraphicType={},GraphicClass={};function hasType(_0x3c3e51){return GraphicClass[_0x3c3e51]?!![]:![];}function eachGraphicType(_0x559bb8){const _0x136ca1=_0x3d5d32;Object['keys'](GraphicClass)[_0x136ca1(0x1061)]((_0x35bc12,_0x1d8921)=>{_0x559bb8&&_0x559bb8['call'](this,_0x35bc12,_0x1d8921);});}function isPointType(_0x2d7e41){if(!_0x2d7e41)return![];return GraphicClass[_0x2d7e41]&&GraphicClass[_0x2d7e41]['isPoint']?!![]:![];}function isCombineType(_0x4c9631){if(!_0x4c9631)return![];return GraphicClass[_0x4c9631]&&GraphicClass[_0x4c9631]['isCombine']?!![]:![];}function register$4(_0x3fa7dc,_0x3cf155,_0x4fded9){const _0x37caaf={_0x18d6f2:0xef7,_0x4c4a41:0xf8c,_0x14d858:0xc5a},_0x2b1c2f=_0x3d5d32;GraphicClass[_0x3fa7dc]&&logError$1('register\x20Graphic:\x20'+_0x3fa7dc+_0x2b1c2f(_0x37caaf._0x18d6f2),_0x3cf155),GraphicType[_0x3fa7dc]=_0x3fa7dc,GraphicClass[_0x3fa7dc]=_0x3cf155,_0x3cf155['type']=_0x3fa7dc,_0x3cf155[_0x2b1c2f(_0x37caaf._0x4c4a41)][_0x2b1c2f(_0x37caaf._0x14d858)]=_0x3fa7dc,_0x4fded9&&(_0x3cf155[_0x2b1c2f(0xba6)]=!![],_0x3cf155[_0x2b1c2f(0xf8c)]['isPoint']=!![]);}function getClass$4(_0x5ca7c0){return GraphicClass[_0x5ca7c0]?GraphicClass[_0x5ca7c0]:(logWarn('getClass:未找到该类型对应的处理类',_0x5ca7c0),null);}function create$4(_0x211631,_0xd05660){const _0x525e25=getClass$4(_0x211631);if(!_0x525e25)return;const _0x173d87=new _0x525e25(_0xd05660);return _0x173d87;}function fromDraw(_0x142244,_0x2fa15e){const _0x3ab72c={_0x54b3f4:0xad8},_0x4b970e=_0x3d5d32;if(!_0x2fa15e['type']){logError$1(_0x4b970e(_0x3ab72c._0x54b3f4));return;}const _0x45abad=getClass$4(_0x2fa15e['type']);if(!_0x45abad||!_0x45abad['prototype']['startDraw']){logInfo('对象不支持标绘',_0x45abad);return;}const _0xfca1f5=new _0x45abad(_0x2fa15e);return _0xfca1f5['startDraw'](_0x142244),_0xfca1f5;}var GraphicUtil={'__proto__':null,'hasType':hasType,'eachGraphicType':eachGraphicType,'isPointType':isPointType,'isCombineType':isCombineType,'register':register$4,'getClass':getClass$4,'create':create$4,'fromDraw':fromDraw},edgeIntersectsEdge=function edgeIntersectsEdge(_0x58ddaa,_0x57c615,_0x2ce6f4,_0xc5dd42){var _0x2b748c=(_0xc5dd42[0x0]-_0x2ce6f4[0x0])*(_0x58ddaa[0x1]-_0x2ce6f4[0x1])-(_0xc5dd42[0x1]-_0x2ce6f4[0x1])*(_0x58ddaa[0x0]-_0x2ce6f4[0x0]),_0x3f8e67=(_0x57c615[0x0]-_0x58ddaa[0x0])*(_0x58ddaa[0x1]-_0x2ce6f4[0x1])-(_0x57c615[0x1]-_0x58ddaa[0x1])*(_0x58ddaa[0x0]-_0x2ce6f4[0x0]),_0x2a964b=(_0xc5dd42[0x1]-_0x2ce6f4[0x1])*(_0x57c615[0x0]-_0x58ddaa[0x0])-(_0xc5dd42[0x0]-_0x2ce6f4[0x0])*(_0x57c615[0x1]-_0x58ddaa[0x1]);if(_0x2a964b!==0x0){var _0x2a473b=_0x2b748c/_0x2a964b,_0x257ab2=_0x3f8e67/_0x2a964b;if(_0x2a473b>=0x0&&_0x2a473b<=0x1&&_0x257ab2>=0x0&&_0x257ab2<=0x1)return!![];}return![];},coordinatesContainPoint=function coordinatesContainPoint(_0x4322af,_0x30898e){const _0x4d1e34=_0x3d5d32;var _0x39cfd3=![];for(var _0x31246e=-0x1,_0x176b5e=_0x4322af[_0x4d1e34(0xc84)],_0x38ab87=_0x176b5e-0x1;++_0x31246e<_0x176b5e;_0x38ab87=_0x31246e){(_0x4322af[_0x31246e][0x1]<=_0x30898e[0x1]&&_0x30898e[0x1]<_0x4322af[_0x38ab87][0x1]||_0x4322af[_0x38ab87][0x1]<=_0x30898e[0x1]&&_0x30898e[0x1]<_0x4322af[_0x31246e][0x1])&&_0x30898e[0x0]<(_0x4322af[_0x38ab87][0x0]-_0x4322af[_0x31246e][0x0])*(_0x30898e[0x1]-_0x4322af[_0x31246e][0x1])/(_0x4322af[_0x38ab87][0x1]-_0x4322af[_0x31246e][0x1])+_0x4322af[_0x31246e][0x0]&&(_0x39cfd3=!_0x39cfd3);}return _0x39cfd3;},pointsEqual=function pointsEqual(_0xc925b1,_0xa833c3){for(var _0x1dd003=0x0;_0x1dd003<_0xc925b1['length'];_0x1dd003++){if(_0xc925b1[_0x1dd003]!==_0xa833c3[_0x1dd003])return![];}return!![];},arrayIntersectsArray=function arrayIntersectsArray(_0x273e58,_0x381065){const _0x1856ef=_0x3d5d32;for(var _0x288f90=0x0;_0x288f90<_0x273e58[_0x1856ef(0xc84)]-0x1;_0x288f90++){for(var _0x59316c=0x0;_0x59316c<_0x381065[_0x1856ef(0xc84)]-0x1;_0x59316c++){if(edgeIntersectsEdge(_0x273e58[_0x288f90],_0x273e58[_0x288f90+0x1],_0x381065[_0x59316c],_0x381065[_0x59316c+0x1]))return!![];}}return![];},closeRing=function closeRing(_0x38d11e){return!pointsEqual(_0x38d11e[0x0],_0x38d11e[_0x38d11e['length']-0x1])&&_0x38d11e['push'](_0x38d11e[0x0]),_0x38d11e;},ringIsClockwise=function ringIsClockwise(_0x3b6676){var _0x59872e=0x0,_0x9c5d80=0x0,_0xe8a858=_0x3b6676['length'],_0x38531b=_0x3b6676[_0x9c5d80],_0x1dbbb2;for(_0x9c5d80;_0x9c5d80<_0xe8a858-0x1;_0x9c5d80++){_0x1dbbb2=_0x3b6676[_0x9c5d80+0x1],_0x59872e+=(_0x1dbbb2[0x0]-_0x38531b[0x0])*(_0x1dbbb2[0x1]+_0x38531b[0x1]),_0x38531b=_0x1dbbb2;}return _0x59872e>=0x0;},shallowClone=function shallowClone(_0x289421){var _0x8d5250={};for(var _0x3081ce in _0x289421){_0x289421['hasOwnProperty'](_0x3081ce)&&(_0x8d5250[_0x3081ce]=_0x289421[_0x3081ce]);}return _0x8d5250;},coordinatesContainCoordinates=function coordinatesContainCoordinates(_0x480317,_0x423d49){var _0x3b1b9d=arrayIntersectsArray(_0x480317,_0x423d49),_0x35a7c0=coordinatesContainPoint(_0x480317,_0x423d49[0x0]);if(!_0x3b1b9d&&_0x35a7c0)return!![];return![];},convertRingsToGeoJSON=function convertRingsToGeoJSON(_0x436367){const _0x6bdf86={_0x13d15d:0x444,_0x2ad367:0xc84,_0x323f2b:0xb75,_0x4415b2:0xb75,_0x1959d9:0x996},_0x383e05=_0x3d5d32;var _0x173a0d=[],_0x3cd8a4=[],_0x1426ae,_0x128765,_0x31c656;for(var _0x2c66bd=0x0;_0x2c66bd<_0x436367[_0x383e05(0xc84)];_0x2c66bd++){var _0x18acc4=closeRing(_0x436367[_0x2c66bd][_0x383e05(_0x6bdf86._0x13d15d)](0x0));if(_0x18acc4[_0x383e05(_0x6bdf86._0x2ad367)]<0x4)continue;if(ringIsClockwise(_0x18acc4)){var _0x2412e6=[_0x18acc4['slice']()['reverse']()];_0x173a0d[_0x383e05(_0x6bdf86._0x323f2b)](_0x2412e6);}else _0x3cd8a4[_0x383e05(_0x6bdf86._0x4415b2)](_0x18acc4['slice']()[_0x383e05(_0x6bdf86._0x1959d9)]());}var _0x37a395=[];while(_0x3cd8a4['length']){_0x31c656=_0x3cd8a4['pop']();var _0x2bef61=![];for(_0x1426ae=_0x173a0d[_0x383e05(_0x6bdf86._0x2ad367)]-0x1;_0x1426ae>=0x0;_0x1426ae--){_0x128765=_0x173a0d[_0x1426ae][0x0];if(coordinatesContainCoordinates(_0x128765,_0x31c656)){_0x173a0d[_0x1426ae]['push'](_0x31c656),_0x2bef61=!![];break;}}!_0x2bef61&&_0x37a395['push'](_0x31c656);}while(_0x37a395['length']){_0x31c656=_0x37a395['pop']();var _0x5c6d65=![];for(_0x1426ae=_0x173a0d['length']-0x1;_0x1426ae>=0x0;_0x1426ae--){_0x128765=_0x173a0d[_0x1426ae][0x0];if(arrayIntersectsArray(_0x128765,_0x31c656)){_0x173a0d[_0x1426ae]['push'](_0x31c656),_0x5c6d65=!![];break;}}!_0x5c6d65&&_0x173a0d['push']([_0x31c656['reverse']()]);}return _0x173a0d['length']===0x1?{'type':'Polygon','coordinates':_0x173a0d[0x0]}:{'type':'MultiPolygon','coordinates':_0x173a0d};},getId=function getId(_0x6a6b87,_0x3d27dd){const _0x5cef2c={_0x472d86:0x2db,_0x5db529:0xee2},_0x3eccae=_0x3d5d32;var _0x329315=_0x3d27dd?[_0x3d27dd,'OBJECTID','FID']:['OBJECTID',_0x3eccae(_0x5cef2c._0x472d86)];for(var _0x15a36b=0x0;_0x15a36b<_0x329315['length'];_0x15a36b++){var _0x519e2a=_0x329315[_0x15a36b];if(_0x519e2a in _0x6a6b87&&(typeof _0x6a6b87[_0x519e2a]===_0x3eccae(_0x5cef2c._0x5db529)||typeof _0x6a6b87[_0x519e2a]==='number'))return _0x6a6b87[_0x519e2a];}throw Error('No\x20valid\x20id\x20attribute\x20found');},arcgisToGeoJSON$1=function arcgisToGeoJSON(_0x82e4d9,_0x3a3c68){const _0x53eabe={_0x5282cf:0x7ab,_0x3b61d9:0xca5,_0x30c6f1:0x444,_0x1811c8:0xfda,_0x25a859:0x7f5,_0x2f3aac:0x525,_0x4cdda9:0x1058,_0x2dd4c7:0x57e,_0x23b348:0x7f5,_0x3bf586:0x5a7,_0x2e0bc4:0x271,_0x14c880:0xf90,_0x3422d5:0x31e,_0x45613c:0xb0d},_0x538255=_0x3d5d32;var _0x38be28={};if(_0x82e4d9[_0x538255(_0x53eabe._0x5282cf)]){_0x38be28['type']='FeatureCollection',_0x38be28['features']=[];for(var _0x286199=0x0;_0x286199<_0x82e4d9[_0x538255(0x7ab)]['length'];_0x286199++){_0x38be28['features'][_0x538255(0xb75)](arcgisToGeoJSON(_0x82e4d9['features'][_0x286199],_0x3a3c68));}}typeof _0x82e4d9['x']===_0x538255(_0x53eabe._0x3b61d9)&&typeof _0x82e4d9['y']==='number'&&(_0x38be28['type']=_0x538255(0xb39),_0x38be28['coordinates']=[_0x82e4d9['x'],_0x82e4d9['y']],typeof _0x82e4d9['z']==='number'&&_0x38be28['coordinates'][_0x538255(0xb75)](_0x82e4d9['z']));_0x82e4d9['points']&&(_0x38be28['type']='MultiPoint',_0x38be28[_0x538255(0x2ae)]=_0x82e4d9['points']['slice'](0x0));_0x82e4d9['paths']&&(_0x82e4d9['paths']['length']===0x1?(_0x38be28['type']='LineString',_0x38be28[_0x538255(0x2ae)]=_0x82e4d9['paths'][0x0]['slice'](0x0)):(_0x38be28['type']='MultiLineString',_0x38be28['coordinates']=_0x82e4d9['paths'][_0x538255(_0x53eabe._0x30c6f1)](0x0)));_0x82e4d9[_0x538255(_0x53eabe._0x1811c8)]&&(_0x38be28=convertRingsToGeoJSON(_0x82e4d9['rings']['slice'](0x0)));typeof _0x82e4d9['xmin']==='number'&&typeof _0x82e4d9[_0x538255(0x470)]==='number'&&typeof _0x82e4d9['xmax']==='number'&&typeof _0x82e4d9['ymax']==='number'&&(_0x38be28[_0x538255(_0x53eabe._0x25a859)]='Polygon',_0x38be28['coordinates']=[[[_0x82e4d9['xmax'],_0x82e4d9['ymax']],[_0x82e4d9[_0x538255(_0x53eabe._0x2f3aac)],_0x82e4d9[_0x538255(_0x53eabe._0x4cdda9)]],[_0x82e4d9[_0x538255(0x525)],_0x82e4d9['ymin']],[_0x82e4d9[_0x538255(_0x53eabe._0x2dd4c7)],_0x82e4d9['ymin']],[_0x82e4d9[_0x538255(0x57e)],_0x82e4d9['ymax']]]]);if(_0x82e4d9[_0x538255(0x5a7)]||_0x82e4d9[_0x538255(0xf90)]){_0x38be28[_0x538255(_0x53eabe._0x23b348)]='Feature',_0x38be28['geometry']=_0x82e4d9[_0x538255(_0x53eabe._0x3bf586)]?arcgisToGeoJSON(_0x82e4d9[_0x538255(0x5a7)]):null,_0x38be28[_0x538255(_0x53eabe._0x2e0bc4)]=_0x82e4d9['attributes']?shallowClone(_0x82e4d9[_0x538255(0xf90)]):null;if(_0x82e4d9[_0x538255(_0x53eabe._0x14c880)])try{_0x38be28['id']=getId(_0x82e4d9[_0x538255(_0x53eabe._0x14c880)],_0x3a3c68);}catch(_0x89e970){}}return JSON[_0x538255(_0x53eabe._0x3422d5)](_0x38be28['geometry'])===JSON[_0x538255(0x31e)]({})&&(_0x38be28[_0x538255(0x5a7)]=null),_0x82e4d9[_0x538255(_0x53eabe._0x45613c)]&&_0x82e4d9['spatialReference']['wkid']&&_0x82e4d9['spatialReference']['wkid']!==0x10e6&&console['warn']('Object\x20converted\x20in\x20non-standard\x20crs\x20-\x20'+JSON['stringify'](_0x82e4d9['spatialReference'])),_0x38be28;},orientRings=function orientRings(_0x180374){const _0x1b34f5={_0x1892ee:0xc84},_0x53cdb8=_0x3d5d32;var _0x441134=[],_0x492891=_0x180374[_0x53cdb8(0x444)](0x0),_0x3a3bff=closeRing(_0x492891['shift']()['slice'](0x0));if(_0x3a3bff[_0x53cdb8(_0x1b34f5._0x1892ee)]>=0x4){!ringIsClockwise(_0x3a3bff)&&_0x3a3bff['reverse']();_0x441134[_0x53cdb8(0xb75)](_0x3a3bff);for(var _0x291fea=0x0;_0x291fea<_0x492891['length'];_0x291fea++){var _0x40e1c4=closeRing(_0x492891[_0x291fea]['slice'](0x0));_0x40e1c4['length']>=0x4&&(ringIsClockwise(_0x40e1c4)&&_0x40e1c4[_0x53cdb8(0x996)](),_0x441134['push'](_0x40e1c4));}}return _0x441134;},flattenMultiPolygonRings=function flattenMultiPolygonRings(_0x4d206b){const _0x4d0ab7={_0x54675d:0xb75},_0x529c1f=_0x3d5d32;var _0x391026=[];for(var _0x5705c6=0x0;_0x5705c6<_0x4d206b[_0x529c1f(0xc84)];_0x5705c6++){var _0x4cd7a5=orientRings(_0x4d206b[_0x5705c6]);for(var _0x7f3272=_0x4cd7a5['length']-0x1;_0x7f3272>=0x0;_0x7f3272--){var _0x46a4e9=_0x4cd7a5[_0x7f3272]['slice'](0x0);_0x391026[_0x529c1f(_0x4d0ab7._0x54675d)](_0x46a4e9);}}return _0x391026;},geojsonToArcGIS$1=function geojsonToArcGIS(_0x434e6f,_0x580324){const _0x3dede0={_0x35924b:0xb39,_0xada948:0x2ae,_0x330b3e:0xb0d,_0x55038e:0x444,_0x4456ba:0x444,_0x1031a0:0x5a7,_0x2bdfc2:0x5a7,_0x2d77f7:0x271,_0x208d26:0x7ab,_0x1a0a65:0x3d1},_0x596804=_0x3d5d32;_0x580324=_0x580324||'OBJECTID';var _0xf9e0d3={'wkid':0x10e6},_0x416b6b={},_0x121ef5;switch(_0x434e6f['type']){case _0x596804(_0x3dede0._0x35924b):_0x416b6b['x']=_0x434e6f[_0x596804(_0x3dede0._0xada948)][0x0],_0x416b6b['y']=_0x434e6f['coordinates'][0x1];_0x434e6f['coordinates'][0x2]!=null&&(_0x416b6b['z']=_0x434e6f['coordinates'][0x2]);_0x416b6b['spatialReference']=_0xf9e0d3;break;case _0x596804(0x737):_0x416b6b['points']=_0x434e6f['coordinates'][_0x596804(0x444)](0x0);_0x434e6f['coordinates'][0x0][0x2]!=null&&(_0x416b6b['hasZ']=!![]);_0x416b6b['spatialReference']=_0xf9e0d3;break;case'LineString':_0x416b6b['paths']=[_0x434e6f['coordinates']['slice'](0x0)];_0x434e6f['coordinates'][0x0][0x2]!=null&&(_0x416b6b['hasZ']=!![]);_0x416b6b[_0x596804(_0x3dede0._0x330b3e)]=_0xf9e0d3;break;case'MultiLineString':_0x416b6b['paths']=_0x434e6f[_0x596804(0x2ae)][_0x596804(_0x3dede0._0x55038e)](0x0);_0x434e6f[_0x596804(_0x3dede0._0xada948)][0x0][0x0][0x2]!=null&&(_0x416b6b['hasZ']=!![]);_0x416b6b[_0x596804(0xb0d)]=_0xf9e0d3;break;case'Polygon':_0x416b6b[_0x596804(0xfda)]=orientRings(_0x434e6f[_0x596804(0x2ae)]['slice'](0x0));_0x434e6f['coordinates'][0x0][0x0][0x2]!=null&&(_0x416b6b['hasZ']=!![]);_0x416b6b['spatialReference']=_0xf9e0d3;break;case'MultiPolygon':_0x416b6b['rings']=flattenMultiPolygonRings(_0x434e6f['coordinates'][_0x596804(_0x3dede0._0x4456ba)](0x0));_0x434e6f[_0x596804(0x2ae)][0x0][0x0][0x0][0x2]!=null&&(_0x416b6b['hasZ']=!![]);_0x416b6b['spatialReference']=_0xf9e0d3;break;case'Feature':_0x434e6f[_0x596804(_0x3dede0._0x1031a0)]&&(_0x416b6b[_0x596804(_0x3dede0._0x2bdfc2)]=geojsonToArcGIS(_0x434e6f['geometry'],_0x580324));_0x416b6b[_0x596804(0xf90)]=_0x434e6f['properties']?shallowClone(_0x434e6f[_0x596804(_0x3dede0._0x2d77f7)]):{};_0x434e6f['id']&&(_0x416b6b['attributes'][_0x580324]=_0x434e6f['id']);break;case'FeatureCollection':_0x416b6b=[];for(_0x121ef5=0x0;_0x121ef5<_0x434e6f[_0x596804(_0x3dede0._0x208d26)]['length'];_0x121ef5++){_0x416b6b['push'](geojsonToArcGIS(_0x434e6f[_0x596804(0x7ab)][_0x121ef5],_0x580324));}break;case'GeometryCollection':_0x416b6b=[];for(_0x121ef5=0x0;_0x121ef5<_0x434e6f['geometries']['length'];_0x121ef5++){_0x416b6b['push'](geojsonToArcGIS(_0x434e6f[_0x596804(_0x3dede0._0x1a0a65)][_0x121ef5],_0x580324));}break;}return _0x416b6b;};function globals(_0x5b7da5){const _0x2ef932={_0x52617b:0xcf7,_0x5cd610:0xdee,_0x295f69:0x99f,_0x179830:0x6f4},_0x4589e9=_0x3d5d32;_0x5b7da5('EPSG:4326','+title=WGS\x2084\x20(long/lat)\x20+proj=longlat\x20+ellps=WGS84\x20+datum=WGS84\x20+units=degrees'),_0x5b7da5('EPSG:4269',_0x4589e9(_0x2ef932._0x52617b)),_0x5b7da5('EPSG:3857','+title=WGS\x2084\x20/\x20Pseudo-Mercator\x20+proj=merc\x20+a=6378137\x20+b=6378137\x20+lat_ts=0.0\x20+lon_0=0.0\x20+x_0=0.0\x20+y_0=0\x20+k=1.0\x20+units=m\x20+nadgrids=@null\x20+no_defs'),_0x5b7da5[_0x4589e9(_0x2ef932._0x5cd610)]=_0x5b7da5['EPSG:4326'],_0x5b7da5['EPSG:3785']=_0x5b7da5[_0x4589e9(_0x2ef932._0x295f69)],_0x5b7da5[_0x4589e9(0xab6)]=_0x5b7da5[_0x4589e9(_0x2ef932._0x295f69)],_0x5b7da5[_0x4589e9(0x806)]=_0x5b7da5['EPSG:3857'],_0x5b7da5[_0x4589e9(_0x2ef932._0x179830)]=_0x5b7da5[_0x4589e9(_0x2ef932._0x295f69)];}var PJD_3PARAM=0x1,PJD_7PARAM=0x2,PJD_GRIDSHIFT=0x3,PJD_WGS84=0x4,PJD_NODATUM=0x5,SRS_WGS84_SEMIMAJOR=0x615299,SRS_WGS84_SEMIMINOR=6356752.314,SRS_WGS84_ESQUARED=0.0066943799901413165,SEC_TO_RAD=0.00000484813681109536,HALF_PI=Math['PI']/0x2,SIXTH=0.16666666666666666,RA4=0.04722222222222222,RA6=0.022156084656084655,EPSLN=1e-10,D2R$1=0.017453292519943295,R2D=57.29577951308232,FORTPI=Math['PI']/0x4,TWO_PI=Math['PI']*0x2,SPI=3.14159265359,exports$3={};exports$3['greenwich']=0x0,exports$3['lisbon']=-9.131906111111,exports$3['paris']=2.337229166667,exports$3['bogota']=-74.080916666667,exports$3[_0x3d5d32(0xc3a)]=-3.687938888889,exports$3[_0x3d5d32(0xec6)]=12.452333333333,exports$3['bern']=7.439583333333,exports$3['jakarta']=106.807719444444,exports$3['ferro']=-17.666666666667,exports$3[_0x3d5d32(0xdd6)]=4.367975,exports$3[_0x3d5d32(0x2f1)]=18.058277777778,exports$3[_0x3d5d32(0x5c8)]=23.7163375,exports$3['oslo']=10.722916666667;var units={'ft':{'to_meter':0.3048},'us-ft':{'to_meter':0x4b0/0xf61}},ignoredChar=/[\s_\-\/\(\)]/g;function match(_0x860990,_0x208614){const _0x359e71={_0x3171b6:0xabc,_0xf6e7af:0x386},_0x41f742=_0x3d5d32;if(_0x860990[_0x208614])return _0x860990[_0x208614];var _0x1dea30=Object[_0x41f742(_0x359e71._0x3171b6)](_0x860990),_0x1e13a7=_0x208614[_0x41f742(_0x359e71._0xf6e7af)]()[_0x41f742(0xbb6)](ignoredChar,''),_0x5a1a4b=-0x1,_0x4874a8,_0x95fbf2;while(++_0x5a1a4b<_0x1dea30['length']){_0x4874a8=_0x1dea30[_0x5a1a4b],_0x95fbf2=_0x4874a8['toLowerCase']()['replace'](ignoredChar,'');if(_0x95fbf2===_0x1e13a7)return _0x860990[_0x4874a8];}}function projStr(_0x5777a6){const _0x1e83a2={_0x2e559b:0x54b},_0x58c704={_0x2fce84:0x278},_0x3f99c2={_0x10a02e:0x7e1},_0x2936e0={_0xd123f4:0x974},_0x211ffb={_0x266ae7:0x4a2};var _0x2a1122={},_0x2f060e=_0x5777a6['split']('+')['map'](function(_0x22268a){return _0x22268a['trim']();})['filter'](function(_0x30bddc){return _0x30bddc;})['reduce'](function(_0x1ffdc5,_0x8a1f7){var _0x5a8e89=_0x8a1f7['split']('=');return _0x5a8e89['push'](!![]),_0x1ffdc5[_0x5a8e89[0x0]['toLowerCase']()]=_0x5a8e89[0x1],_0x1ffdc5;},{}),_0x48d849,_0x4efafa,_0x185803,_0x31a289={'proj':'projName','datum':'datumCode','rf':function(_0x2aaf5d){_0x2a1122['rf']=parseFloat(_0x2aaf5d);},'lat_0':function(_0x151125){_0x2a1122['lat0']=_0x151125*D2R$1;},'lat_1':function(_0x9544d6){const _0x556c47=_0x4132;_0x2a1122[_0x556c47(_0x211ffb._0x266ae7)]=_0x9544d6*D2R$1;},'lat_2':function(_0x469789){_0x2a1122['lat2']=_0x469789*D2R$1;},'lat_ts':function(_0x36a32b){_0x2a1122['lat_ts']=_0x36a32b*D2R$1;},'lon_0':function(_0x12dc87){_0x2a1122['long0']=_0x12dc87*D2R$1;},'lon_1':function(_0x3b86d0){_0x2a1122['long1']=_0x3b86d0*D2R$1;},'lon_2':function(_0x35774d){_0x2a1122['long2']=_0x35774d*D2R$1;},'alpha':function(_0x497f34){_0x2a1122['alpha']=parseFloat(_0x497f34)*D2R$1;},'gamma':function(_0x587874){const _0x268447=_0x4132;_0x2a1122[_0x268447(0x975)]=parseFloat(_0x587874);},'lonc':function(_0x1a7bfd){const _0x418dea=_0x4132;_0x2a1122[_0x418dea(_0x2936e0._0xd123f4)]=_0x1a7bfd*D2R$1;},'x_0':function(_0x47c0f1){_0x2a1122['x0']=parseFloat(_0x47c0f1);},'y_0':function(_0x2baa65){_0x2a1122['y0']=parseFloat(_0x2baa65);},'k_0':function(_0x30c7ff){_0x2a1122['k0']=parseFloat(_0x30c7ff);},'k':function(_0x112ed2){_0x2a1122['k0']=parseFloat(_0x112ed2);},'a':function(_0x533fee){_0x2a1122['a']=parseFloat(_0x533fee);},'b':function(_0x2e9683){_0x2a1122['b']=parseFloat(_0x2e9683);},'r_a':function(){_0x2a1122['R_A']=!![];},'zone':function(_0x46a2a6){const _0x2b1d70=_0x4132;_0x2a1122[_0x2b1d70(0x4be)]=parseInt(_0x46a2a6,0xa);},'south':function(){_0x2a1122['utmSouth']=!![];},'towgs84':function(_0x4dae6a){const _0x13add9=_0x4132;_0x2a1122['datum_params']=_0x4dae6a[_0x13add9(0xdaa)](',')[_0x13add9(_0x3f99c2._0x10a02e)](function(_0x587173){return parseFloat(_0x587173);});},'to_meter':function(_0x1e57d9){const _0x25189b=_0x4132;_0x2a1122[_0x25189b(0x278)]=parseFloat(_0x1e57d9);},'units':function(_0x2a3a3d){const _0x107b0f=_0x4132;_0x2a1122['units']=_0x2a3a3d;var _0x49ec33=match(units,_0x2a3a3d);_0x49ec33&&(_0x2a1122[_0x107b0f(_0x58c704._0x2fce84)]=_0x49ec33['to_meter']);},'from_greenwich':function(_0x5924f5){_0x2a1122['from_greenwich']=_0x5924f5*D2R$1;},'pm':function(_0x20de98){var _0x29c097=match(exports$3,_0x20de98);_0x2a1122['from_greenwich']=(_0x29c097?_0x29c097:parseFloat(_0x20de98))*D2R$1;},'nadgrids':function(_0x11bf02){const _0x2ef73a=_0x4132;_0x11bf02==='@null'?_0x2a1122[_0x2ef73a(0x317)]='none':_0x2a1122[_0x2ef73a(0x5a4)]=_0x11bf02;},'axis':function(_0x136e40){const _0x1a8149=_0x4132;var _0x2fb406='ewnsud';_0x136e40['length']===0x3&&_0x2fb406[_0x1a8149(_0x1e83a2._0x2e559b)](_0x136e40['substr'](0x0,0x1))!==-0x1&&_0x2fb406['indexOf'](_0x136e40['substr'](0x1,0x1))!==-0x1&&_0x2fb406[_0x1a8149(_0x1e83a2._0x2e559b)](_0x136e40['substr'](0x2,0x1))!==-0x1&&(_0x2a1122['axis']=_0x136e40);},'approx':function(){_0x2a1122['approx']=!![];}};for(_0x48d849 in _0x2f060e){_0x4efafa=_0x2f060e[_0x48d849],_0x48d849 in _0x31a289?(_0x185803=_0x31a289[_0x48d849],typeof _0x185803==='function'?_0x185803(_0x4efafa):_0x2a1122[_0x185803]=_0x4efafa):_0x2a1122[_0x48d849]=_0x4efafa;}return typeof _0x2a1122['datumCode']==='string'&&_0x2a1122['datumCode']!=='WGS84'&&(_0x2a1122['datumCode']=_0x2a1122['datumCode']['toLowerCase']()),_0x2a1122;}var NEUTRAL=0x1,KEYWORD=0x2,NUMBER=0x3,QUOTED=0x4,AFTERQUOTE=0x5,ENDED=-0x1,whitespace=/\s/,latin=/[A-Za-z]/,keyword=/[A-Za-z84_]/,endThings=/[,\]]/,digets=/[\d\.E\-\+]/;function Parser(_0x59a69a){const _0x53e04e={_0x467410:0xee2,_0x5ab621:0x702,_0x1fc588:0xb4e},_0x5107a9=_0x3d5d32;if(typeof _0x59a69a!==_0x5107a9(_0x53e04e._0x467410))throw new Error(_0x5107a9(_0x53e04e._0x5ab621));this['text']=_0x59a69a['trim'](),this['level']=0x0,this['place']=0x0,this[_0x5107a9(_0x53e04e._0x1fc588)]=null,this['stack']=[],this['currentObject']=null,this['state']=NEUTRAL;}Parser['prototype']['readCharicter']=function(){const _0x14181={_0x55a4e0:0x76b,_0x11953e:0x56d},_0xe03d4b=_0x3d5d32;var _0x1cb4b0=this['text'][this['place']++];if(this['state']!==QUOTED)while(whitespace[_0xe03d4b(0xdd1)](_0x1cb4b0)){if(this['place']>=this['text']['length'])return;_0x1cb4b0=this[_0xe03d4b(_0x14181._0x55a4e0)][this[_0xe03d4b(_0x14181._0x11953e)]++];}switch(this[_0xe03d4b(0xa02)]){case NEUTRAL:return this[_0xe03d4b(0x87b)](_0x1cb4b0);case KEYWORD:return this['keyword'](_0x1cb4b0);case QUOTED:return this['quoted'](_0x1cb4b0);case AFTERQUOTE:return this[_0xe03d4b(0x96b)](_0x1cb4b0);case NUMBER:return this[_0xe03d4b(0xca5)](_0x1cb4b0);case ENDED:return;}},Parser['prototype'][_0x3d5d32(0x96b)]=function(_0x21c98c){const _0x1e5bc6={_0x3f866a:0xdc5,_0x6d21d3:0x3bb},_0x2e4a60=_0x3d5d32;if(_0x21c98c==='\x22'){this[_0x2e4a60(_0x1e5bc6._0x3f866a)]+='\x22',this['state']=QUOTED;return;}if(endThings['test'](_0x21c98c)){this['word']=this[_0x2e4a60(0xdc5)][_0x2e4a60(_0x1e5bc6._0x6d21d3)](),this['afterItem'](_0x21c98c);return;}throw new Error('havn\x27t\x20handled\x20\x22'+_0x21c98c+_0x2e4a60(0x3e3)+this['place']);},Parser[_0x3d5d32(0xf8c)][_0x3d5d32(0x1032)]=function(_0x15ed62){const _0x55a61a={_0x3368a0:0x1069,_0x11c621:0xb75,_0x2b0d30:0xa02,_0x120b32:0x998},_0x340e7d=_0x3d5d32;if(_0x15ed62===','){this['word']!==null&&this[_0x340e7d(_0x55a61a._0x3368a0)][_0x340e7d(_0x55a61a._0x11c621)](this[_0x340e7d(0xdc5)]);this['word']=null,this[_0x340e7d(_0x55a61a._0x2b0d30)]=NEUTRAL;return;}if(_0x15ed62===']'){this[_0x340e7d(_0x55a61a._0x120b32)]--;this['word']!==null&&(this['currentObject']['push'](this[_0x340e7d(0xdc5)]),this['word']=null);this['state']=NEUTRAL,this[_0x340e7d(0x1069)]=this['stack']['pop']();!this['currentObject']&&(this['state']=ENDED);return;}},Parser['prototype']['number']=function(_0x2ef612){const _0x180291={_0x494d75:0xdc5},_0x6c4195=_0x3d5d32;if(digets['test'](_0x2ef612)){this[_0x6c4195(_0x180291._0x494d75)]+=_0x2ef612;return;}if(endThings['test'](_0x2ef612)){this['word']=parseFloat(this[_0x6c4195(_0x180291._0x494d75)]),this['afterItem'](_0x2ef612);return;}throw new Error('havn\x27t\x20handled\x20\x22'+_0x2ef612+'\x22\x20in\x20number\x20yet,\x20index\x20'+this[_0x6c4195(0x56d)]);},Parser['prototype']['quoted']=function(_0x17cb08){if(_0x17cb08==='\x22'){this['state']=AFTERQUOTE;return;}this['word']+=_0x17cb08;return;},Parser['prototype'][_0x3d5d32(0x1013)]=function(_0x26a7bd){const _0x2e83d4={_0x187325:0xb75,_0x239b1b:0x1069,_0x5f1cff:0xa02,_0x47cb9f:0xdd1,_0x4f48cb:0x1032,_0x1038a1:0x56d},_0x54d6f7=_0x3d5d32;if(keyword[_0x54d6f7(0xdd1)](_0x26a7bd)){this['word']+=_0x26a7bd;return;}if(_0x26a7bd==='['){var _0x2b1550=[];_0x2b1550['push'](this['word']),this['level']++;this['root']===null?this['root']=_0x2b1550:this[_0x54d6f7(0x1069)]['push'](_0x2b1550);this['stack'][_0x54d6f7(_0x2e83d4._0x187325)](this['currentObject']),this[_0x54d6f7(_0x2e83d4._0x239b1b)]=_0x2b1550,this[_0x54d6f7(_0x2e83d4._0x5f1cff)]=NEUTRAL;return;}if(endThings[_0x54d6f7(_0x2e83d4._0x47cb9f)](_0x26a7bd)){this[_0x54d6f7(_0x2e83d4._0x4f48cb)](_0x26a7bd);return;}throw new Error('havn\x27t\x20handled\x20\x22'+_0x26a7bd+'\x22\x20in\x20keyword\x20yet,\x20index\x20'+this[_0x54d6f7(_0x2e83d4._0x1038a1)]);},Parser['prototype']['neutral']=function(_0x829b5d){const _0x53a19b={_0xd2131d:0xdd1,_0x4e54c4:0xdd1},_0x5502c9=_0x3d5d32;if(latin[_0x5502c9(_0x53a19b._0xd2131d)](_0x829b5d)){this['word']=_0x829b5d,this['state']=KEYWORD;return;}if(_0x829b5d==='\x22'){this[_0x5502c9(0xdc5)]='',this[_0x5502c9(0xa02)]=QUOTED;return;}if(digets[_0x5502c9(_0x53a19b._0x4e54c4)](_0x829b5d)){this['word']=_0x829b5d,this['state']=NUMBER;return;}if(endThings['test'](_0x829b5d)){this['afterItem'](_0x829b5d);return;}throw new Error('havn\x27t\x20handled\x20\x22'+_0x829b5d+'\x22\x20in\x20neutral\x20yet,\x20index\x20'+this[_0x5502c9(0x56d)]);},Parser['prototype']['output']=function(){const _0x1c5176={_0x45da01:0xa02,_0x35deed:0x76b},_0xb4f705=_0x3d5d32;while(this[_0xb4f705(0x56d)]0x0?0x5a:-0x5a),_0x52435a['lat_ts']=_0x52435a['lat1']);}function wkt(_0x166ea5){const _0x4e0061=_0x3d5d32;var _0x2c40f3=parseString(_0x166ea5),_0x11f2f9=_0x2c40f3[_0x4e0061(0x941)](),_0x368acc=_0x2c40f3['shift']();_0x2c40f3['unshift'](['name',_0x368acc]),_0x2c40f3['unshift'](['type',_0x11f2f9]);var _0x270ccc={};return sExpr(_0x2c40f3,_0x270ccc),cleanWKT(_0x270ccc),_0x270ccc;}function defs(_0x2eda80){const _0x2cb3f3={_0x4c4624:0x62b},_0x4425b2=_0x3d5d32;var _0x594f7a=this;if(arguments['length']===0x2){var _0xd0ce5c=arguments[0x1];typeof _0xd0ce5c==='string'?_0xd0ce5c['charAt'](0x0)==='+'?defs[_0x2eda80]=projStr(arguments[0x1]):defs[_0x2eda80]=wkt(arguments[0x1]):defs[_0x2eda80]=_0xd0ce5c;}else{if(arguments['length']===0x1){if(Array[_0x4425b2(_0x2cb3f3._0x4c4624)](_0x2eda80))return _0x2eda80['map'](function(_0x21c0cb){Array['isArray'](_0x21c0cb)?defs['apply'](_0x594f7a,_0x21c0cb):defs(_0x21c0cb);});else{if(typeof _0x2eda80==='string'){if(_0x2eda80 in defs)return defs[_0x2eda80];}else{if('EPSG'in _0x2eda80)defs['EPSG:'+_0x2eda80['EPSG']]=_0x2eda80;else{if('ESRI'in _0x2eda80)defs['ESRI:'+_0x2eda80['ESRI']]=_0x2eda80;else'IAU2000'in _0x2eda80?defs['IAU2000:'+_0x2eda80['IAU2000']]=_0x2eda80:console['log'](_0x2eda80);}}}return;}}}globals(defs);function testObj(_0x48f15a){return typeof _0x48f15a==='string';}function testDef(_0xc1456c){return _0xc1456c in defs;}var codeWords=['PROJECTEDCRS',_0x3d5d32(0x6b2),'GEOGCS','GEOCCS','PROJCS','LOCAL_CS','GEODCRS',_0x3d5d32(0xfe6),'GEODETICDATUM','ENGCRS','ENGINEERINGCRS'];function testWKT(_0xf154d6){const _0x2dab0a=_0x3d5d32;return codeWords[_0x2dab0a(0x104d)](function(_0x4a056e){return _0xf154d6['indexOf'](_0x4a056e)>-0x1;});}var codes=['3857','900913','3785',_0x3d5d32(0x42e)];function checkMercator(_0x31ed20){var _0x2f4f69=match(_0x31ed20,'authority');if(!_0x2f4f69)return;var _0x2440d7=match(_0x2f4f69,'epsg');return _0x2440d7&&codes['indexOf'](_0x2440d7)>-0x1;}function checkProjStr(_0x167703){var _0x27bec7=match(_0x167703,'extension');if(!_0x27bec7)return;return match(_0x27bec7,'proj4');}function testProj(_0x26b0af){return _0x26b0af[0x0]==='+';}function parse(_0x4a72eb){if(testObj(_0x4a72eb)){if(testDef(_0x4a72eb))return defs[_0x4a72eb];if(testWKT(_0x4a72eb)){var _0x8f8c1b=wkt(_0x4a72eb);if(checkMercator(_0x8f8c1b))return defs['EPSG:3857'];var _0x198f76=checkProjStr(_0x8f8c1b);if(_0x198f76)return projStr(_0x198f76);return _0x8f8c1b;}if(testProj(_0x4a72eb))return projStr(_0x4a72eb);}else return _0x4a72eb;}function extend(_0x84eff0,_0x15edc4){_0x84eff0=_0x84eff0||{};var _0x371de7,_0x77eefc;if(!_0x15edc4)return _0x84eff0;for(_0x77eefc in _0x15edc4){_0x371de7=_0x15edc4[_0x77eefc],_0x371de7!==undefined&&(_0x84eff0[_0x77eefc]=_0x371de7);}return _0x84eff0;}function msfnz(_0x1b4c1d,_0x33a1ca,_0x103001){var _0x2417aa=_0x1b4c1d*_0x33a1ca;return _0x103001/Math['sqrt'](0x1-_0x2417aa*_0x2417aa);}function sign(_0x6f85b1){return _0x6f85b1<0x0?-0x1:0x1;}function adjust_lon(_0x1d92e){return Math['abs'](_0x1d92e)<=SPI?_0x1d92e:_0x1d92e-sign(_0x1d92e)*TWO_PI;}function tsfnz(_0x121e03,_0xa3d24c,_0x5956b0){const _0x3291b5=_0x3d5d32;var _0x1be02f=_0x121e03*_0x5956b0,_0x42218b=0.5*_0x121e03;return _0x1be02f=Math[_0x3291b5(0x1fb)]((0x1-_0x1be02f)/(0x1+_0x1be02f),_0x42218b),Math[_0x3291b5(0xdd3)](0.5*(HALF_PI-_0xa3d24c))/_0x1be02f;}function phi2z(_0xdd5214,_0x47438b){const _0x3e13f7=_0x3d5d32;var _0x402699=0.5*_0xdd5214,_0x193e93,_0x1ff9e2,_0x98f9d8=HALF_PI-0x2*Math['atan'](_0x47438b);for(var _0x446e49=0x0;_0x446e49<=0xf;_0x446e49++){_0x193e93=_0xdd5214*Math['sin'](_0x98f9d8),_0x1ff9e2=HALF_PI-0x2*Math[_0x3e13f7(0x106c)](_0x47438b*Math['pow']((0x1-_0x193e93)/(0x1+_0x193e93),_0x402699))-_0x98f9d8,_0x98f9d8+=_0x1ff9e2;if(Math['abs'](_0x1ff9e2)<=1e-10)return _0x98f9d8;}return-0x270f;}function init$v(){const _0x493530={_0x304763:0xfb1},_0x3bd29e=_0x3d5d32;var _0x1d2f9f=this['b']/this['a'];this['es']=0x1-_0x1d2f9f*_0x1d2f9f,!('x0'in this)&&(this['x0']=0x0),!('y0'in this)&&(this['y0']=0x0),this['e']=Math['sqrt'](this['es']),this[_0x3bd29e(0xfb1)]?this['sphere']?this['k0']=Math['cos'](this['lat_ts']):this['k0']=msfnz(this['e'],Math['sin'](this[_0x3bd29e(_0x493530._0x304763)]),Math['cos'](this[_0x3bd29e(0xfb1)])):!this['k0']&&(this['k']?this['k0']=this['k']:this['k0']=0x1);}function forward$u(_0x33af3d){const _0xc9f42d={_0x275d24:0x7cd,_0xac17db:0x7b1},_0x294204=_0x3d5d32;var _0x46d20e=_0x33af3d['x'],_0x383f42=_0x33af3d['y'];if(_0x383f42*R2D>0x5a&&_0x383f42*R2D<-0x5a&&_0x46d20e*R2D>0xb4&&_0x46d20e*R2D<-0xb4)return null;var _0x4f0391,_0x1e9ea2;if(Math['abs'](Math[_0x294204(0x4ba)](_0x383f42)-HALF_PI)<=EPSLN)return null;else{if(this['sphere'])_0x4f0391=this['x0']+this['a']*this['k0']*adjust_lon(_0x46d20e-this[_0x294204(_0xc9f42d._0x275d24)]),_0x1e9ea2=this['y0']+this['a']*this['k0']*Math['log'](Math['tan'](FORTPI+0.5*_0x383f42));else{var _0xacc2a8=Math['sin'](_0x383f42),_0x4d8d59=tsfnz(this['e'],_0x383f42,_0xacc2a8);_0x4f0391=this['x0']+this['a']*this['k0']*adjust_lon(_0x46d20e-this['long0']),_0x1e9ea2=this['y0']-this['a']*this['k0']*Math[_0x294204(_0xc9f42d._0xac17db)](_0x4d8d59);}return _0x33af3d['x']=_0x4f0391,_0x33af3d['y']=_0x1e9ea2,_0x33af3d;}}function inverse$u(_0x3bbc09){var _0x5048c2=_0x3bbc09['x']-this['x0'],_0x3ed3ed=_0x3bbc09['y']-this['y0'],_0x3d941e,_0x4011ae;if(this['sphere'])_0x4011ae=HALF_PI-0x2*Math['atan'](Math['exp'](-_0x3ed3ed/(this['a']*this['k0'])));else{var _0x34345c=Math['exp'](-_0x3ed3ed/(this['a']*this['k0']));_0x4011ae=phi2z(this['e'],_0x34345c);if(_0x4011ae===-0x270f)return null;}return _0x3d941e=adjust_lon(this['long0']+_0x5048c2/(this['a']*this['k0'])),_0x3bbc09['x']=_0x3d941e,_0x3bbc09['y']=_0x4011ae,_0x3bbc09;}var names$w=['Mercator','Popular\x20Visualisation\x20Pseudo\x20Mercator',_0x3d5d32(0x370),_0x3d5d32(0xc3b),_0x3d5d32(0x66b)],merc={'init':init$v,'forward':forward$u,'inverse':inverse$u,'names':names$w};function init$u(){}function identity(_0x2c440e){return _0x2c440e;}var names$v=[_0x3d5d32(0x620),'identity'],longlat={'init':init$u,'forward':identity,'inverse':identity,'names':names$v},projs=[merc,longlat],names$u={},projStore=[];function add$1(_0x395601,_0x15ae2a){const _0x12389f={_0x1e15ae:0x7b1},_0x2829ef=_0x3d5d32;var _0x4b02df=projStore['length'];if(!_0x395601['names'])return console[_0x2829ef(_0x12389f._0x1e15ae)](_0x15ae2a),!![];return projStore[_0x4b02df]=_0x395601,_0x395601['names'][_0x2829ef(0x1061)](function(_0xcd5c6e){const _0xeb798=_0x2829ef;names$u[_0xcd5c6e[_0xeb798(0x386)]()]=_0x4b02df;}),this;}function get$1(_0x4adc6b){if(!_0x4adc6b)return![];var _0x224561=_0x4adc6b['toLowerCase']();if(typeof names$u[_0x224561]!=='undefined'&&projStore[names$u[_0x224561]])return projStore[names$u[_0x224561]];}function start(){projs['forEach'](add$1);}var projections={'start':start,'add':add$1,'get':get$1},exports$2={};exports$2['MERIT']={'a':0x615299,'rf':298.257,'ellipseName':'MERIT\x201983'},exports$2['SGS85']={'a':0x615298,'rf':298.257,'ellipseName':'Soviet\x20Geodetic\x20System\x2085'},exports$2['GRS80']={'a':0x615299,'rf':298.257222101,'ellipseName':'GRS\x201980(IUGG,\x201980)'},exports$2[_0x3d5d32(0x963)]={'a':0x61529c,'rf':298.257,'ellipseName':'IAU\x201976'},exports$2['airy']={'a':6377563.396,'b':6356256.91,'ellipseName':'Airy\x201830'},exports$2['APL4']={'a':0x615299,'rf':298.25,'ellipseName':'Appl.\x20Physics.\x201965'},exports$2['NWL9D']={'a':0x6152a1,'rf':298.25,'ellipseName':_0x3d5d32(0xa52)},exports$2['mod_airy']={'a':6377340.189,'b':6356034.446,'ellipseName':_0x3d5d32(0x73e)},exports$2['andrae']={'a':6377104.43,'rf':0x12c,'ellipseName':_0x3d5d32(0x4ce)},exports$2['aust_SA']={'a':0x6152b0,'rf':298.25,'ellipseName':_0x3d5d32(0xebf)},exports$2[_0x3d5d32(0x8aa)]={'a':0x6152b0,'rf':298.247167427,'ellipseName':_0x3d5d32(0x610)},exports$2[_0x3d5d32(0xa3c)]={'a':6377397.155,'rf':299.1528128,'ellipseName':'Bessel\x201841'},exports$2['bess_nam']={'a':6377483.865,'rf':299.1528128,'ellipseName':'Bessel\x201841\x20(Namibia)'},exports$2['clrk66']={'a':6378206.4,'b':6356583.8,'ellipseName':'Clarke\x201866'},exports$2[_0x3d5d32(0x8c2)]={'a':6378249.145,'rf':293.4663,'ellipseName':'Clarke\x201880\x20mod.'},exports$2['clrk80ign']={'a':6378249.2,'b':0x60fe23,'rf':293.4660213,'ellipseName':'Clarke\x201880\x20(IGN)'},exports$2['clrk58']={'a':6378293.645208759,'rf':294.2606763692654,'ellipseName':_0x3d5d32(0xcfc)},exports$2['CPM']={'a':6375738.7,'rf':334.29,'ellipseName':'Comm.\x20des\x20Poids\x20et\x20Mesures\x201799'},exports$2['delmbr']={'a':0x614bec,'rf':311.5,'ellipseName':'Delambre\x201810\x20(Belgium)'},exports$2['engelis']={'a':6378136.05,'rf':298.2566,'ellipseName':_0x3d5d32(0xe88)},exports$2[_0x3d5d32(0x5ff)]={'a':6377276.345,'rf':300.8017,'ellipseName':_0x3d5d32(0xda6)},exports$2[_0x3d5d32(0x953)]={'a':6377304.063,'rf':300.8017,'ellipseName':'Everest\x201948'},exports$2['evrst56']={'a':6377301.243,'rf':300.8017,'ellipseName':'Everest\x201956'},exports$2['evrst69']={'a':6377295.664,'rf':300.8017,'ellipseName':_0x3d5d32(0xc27)},exports$2['evrstSS']={'a':6377298.556,'rf':300.8017,'ellipseName':'Everest\x20(Sabah\x20&\x20Sarawak)'},exports$2['fschr60']={'a':0x6152b6,'rf':298.3,'ellipseName':_0x3d5d32(0x9c5)},exports$2['fschr60m']={'a':0x6152ab,'rf':298.3,'ellipseName':'Fischer\x201960'},exports$2['fschr68']={'a':0x6152a6,'rf':298.3,'ellipseName':'Fischer\x201968'},exports$2['helmert']={'a':0x6152d8,'rf':298.3,'ellipseName':'Helmert\x201906'},exports$2[_0x3d5d32(0x75d)]={'a':0x61531e,'rf':0x129,'ellipseName':'Hough'},exports$2[_0x3d5d32(0x2f0)]={'a':0x615394,'rf':0x129,'ellipseName':_0x3d5d32(0x583)},exports$2[_0x3d5d32(0xcbd)]={'a':0x6152b3,'rf':298.24,'ellipseName':'Kaula\x201961'},exports$2['lerch']={'a':0x61529b,'rf':298.257,'ellipseName':_0x3d5d32(0x5c7)},exports$2[_0x3d5d32(0x674)]={'a':0x619d74,'rf':0xbf,'ellipseName':'Maupertius\x201738'},exports$2[_0x3d5d32(0x44a)]={'a':6378157.5,'b':6356772.2,'ellipseName':_0x3d5d32(0x261)},exports$2['plessis']={'a':0x614c4b,'rf':0x60fb97,'ellipseName':_0x3d5d32(0x381)},exports$2[_0x3d5d32(0xf60)]={'a':0x615305,'rf':298.3,'ellipseName':'Krassovsky,\x201942'},exports$2['SEasia']={'a':0x6152ab,'b':6356773.3205,'ellipseName':_0x3d5d32(0xc29)},exports$2['walbeck']={'a':0x614dc0,'b':6355834.8467,'ellipseName':'Walbeck'},exports$2[_0x3d5d32(0x713)]={'a':0x6152b5,'rf':298.3,'ellipseName':_0x3d5d32(0xa56)},exports$2['WGS66']={'a':0x6152a1,'rf':298.25,'ellipseName':_0x3d5d32(0x53d)},exports$2['WGS7']={'a':0x615297,'rf':298.26,'ellipseName':'WGS\x2072'};var WGS84=exports$2[_0x3d5d32(0xdee)]={'a':0x615299,'rf':298.257223563,'ellipseName':'WGS\x2084'};exports$2['sphere']={'a':0x6136b5,'b':0x6136b5,'ellipseName':'Normal\x20Sphere\x20(r=6370997)'};function eccentricity(_0x437e50,_0x4b0815,_0x3fc452,_0x5d8a38){var _0x200945=_0x437e50*_0x437e50,_0x55f9f1=_0x4b0815*_0x4b0815,_0x527ee0=(_0x200945-_0x55f9f1)/_0x200945,_0xe56c1d=0x0;_0x5d8a38?(_0x437e50*=0x1-_0x527ee0*(SIXTH+_0x527ee0*(RA4+_0x527ee0*RA6)),_0x200945=_0x437e50*_0x437e50,_0x527ee0=0x0):_0xe56c1d=Math['sqrt'](_0x527ee0);var _0x21a4ba=(_0x200945-_0x55f9f1)/_0x55f9f1;return{'es':_0x527ee0,'e':_0xe56c1d,'ep2':_0x21a4ba};}function sphere(_0x71793b,_0x511921,_0x13a27c,_0x1a7328,_0x3116a0){if(!_0x71793b){var _0x627c39=match(exports$2,_0x1a7328);!_0x627c39&&(_0x627c39=WGS84),_0x71793b=_0x627c39['a'],_0x511921=_0x627c39['b'],_0x13a27c=_0x627c39['rf'];}return _0x13a27c&&!_0x511921&&(_0x511921=(0x1-0x1/_0x13a27c)*_0x71793b),(_0x13a27c===0x0||Math['abs'](_0x71793b-_0x511921)0x3&&((_0x493834['datum_params'][0x3]!==0x0||_0x493834['datum_params'][0x4]!==0x0||_0x493834[_0x53f172(_0x4ae2bb._0x3ff45d)][0x5]!==0x0||_0x493834[_0x53f172(_0x4ae2bb._0x5834ad)][0x6]!==0x0)&&(_0x493834['datum_type']=PJD_7PARAM,_0x493834['datum_params'][0x3]*=SEC_TO_RAD,_0x493834['datum_params'][0x4]*=SEC_TO_RAD,_0x493834[_0x53f172(_0x4ae2bb._0x5834ad)][0x5]*=SEC_TO_RAD,_0x493834['datum_params'][0x6]=_0x493834[_0x53f172(_0x4ae2bb._0x5834ad)][0x6]/0xf4240+0x1))),_0x37cf34&&(_0x493834[_0x53f172(_0x4ae2bb._0x6b8d1a)]=PJD_GRIDSHIFT,_0x493834[_0x53f172(0xc9b)]=_0x37cf34),_0x493834['a']=_0x29befa,_0x493834['b']=_0x5b6f91,_0x493834['es']=_0xe39e9a,_0x493834[_0x53f172(0x6c0)]=_0x467c58,_0x493834;}var loadedNadgrids={};function nadgrid(_0x2baa6c,_0x1316fd){var _0x48748d=new DataView(_0x1316fd),_0x3b7bb2=detectLittleEndian(_0x48748d),_0x5e5705=readHeader(_0x48748d,_0x3b7bb2);_0x5e5705['nSubgrids']>0x1&&console['log']('Only\x20single\x20NTv2\x20subgrids\x20are\x20currently\x20supported,\x20subsequent\x20sub\x20grids\x20are\x20ignored');var _0xe8e3fb=readSubgrids(_0x48748d,_0x5e5705,_0x3b7bb2),_0x4036d4={'header':_0x5e5705,'subgrids':_0xe8e3fb};return loadedNadgrids[_0x2baa6c]=_0x4036d4,_0x4036d4;}function getNadgrids(_0x45c90f){if(_0x45c90f===undefined)return null;var _0x32fca=_0x45c90f['split'](',');return _0x32fca['map'](parseNadgridString);}function parseNadgridString(_0x34780b){const _0x3ee52d={_0x106db9:0x444},_0x807b39=_0x3d5d32;if(_0x34780b[_0x807b39(0xc84)]===0x0)return null;var _0x485726=_0x34780b[0x0]==='@';_0x485726&&(_0x34780b=_0x34780b[_0x807b39(_0x3ee52d._0x106db9)](0x1));if(_0x34780b==='null')return{'name':'null','mandatory':!_0x485726,'grid':null,'isNull':!![]};return{'name':_0x34780b,'mandatory':!_0x485726,'grid':loadedNadgrids[_0x34780b]||null,'isNull':![]};}function secondsToRadians(_0x14df85){return _0x14df85/0xe10*Math['PI']/0xb4;}function detectLittleEndian(_0x5289ca){const _0x4fdb44={_0x257e66:0x37c,_0x407594:0xb8d},_0x4a703a=_0x3d5d32;var _0x2a5bd3=_0x5289ca['getInt32'](0x8,![]);if(_0x2a5bd3===0xb)return![];return _0x2a5bd3=_0x5289ca['getInt32'](0x8,!![]),_0x2a5bd3!==0xb&&console[_0x4a703a(_0x4fdb44._0x257e66)](_0x4a703a(_0x4fdb44._0x407594)),!![];}function readHeader(_0x56377f,_0x40f4b9){const _0x5568b0=_0x3d5d32;return{'nFields':_0x56377f['getInt32'](0x8,_0x40f4b9),'nSubgridFields':_0x56377f['getInt32'](0x18,_0x40f4b9),'nSubgrids':_0x56377f[_0x5568b0(0x258)](0x28,_0x40f4b9),'shiftType':decodeString(_0x56377f,0x38,0x38+0x8)['trim'](),'fromSemiMajorAxis':_0x56377f[_0x5568b0(0xf52)](0x78,_0x40f4b9),'fromSemiMinorAxis':_0x56377f['getFloat64'](0x88,_0x40f4b9),'toSemiMajorAxis':_0x56377f['getFloat64'](0x98,_0x40f4b9),'toSemiMinorAxis':_0x56377f['getFloat64'](0xa8,_0x40f4b9)};}function decodeString(_0x4049c9,_0x54aa0b,_0x3b6d5d){const _0x3ac956={_0x10f24a:0xe2c},_0x17c601=_0x3d5d32;return String[_0x17c601(0x7c4)][_0x17c601(0xd78)](null,new Uint8Array(_0x4049c9[_0x17c601(_0x3ac956._0x10f24a)]['slice'](_0x54aa0b,_0x3b6d5d)));}function readSubgrids(_0x474920,_0x16c7cc,_0x2d86fc){const _0x4abddb={_0x5ccd9e:0x23d,_0x54d17f:0x677,_0x4ceeea:0x9e1},_0x3f730c=_0x3d5d32;var _0x1b9366=0xb0,_0xd3f241=[];for(var _0x1d2c90=0x0;_0x1d2c90<_0x16c7cc[_0x3f730c(_0x4abddb._0x5ccd9e)];_0x1d2c90++){var _0x1b8438=readGridHeader(_0x474920,_0x1b9366,_0x2d86fc),_0x2b3c50=readGridNodes(_0x474920,_0x1b9366,_0x1b8438,_0x2d86fc),_0x1325cb=Math['round'](0x1+(_0x1b8438['upperLongitude']-_0x1b8438['lowerLongitude'])/_0x1b8438['longitudeInterval']),_0x4296b5=Math['round'](0x1+(_0x1b8438[_0x3f730c(_0x4abddb._0x54d17f)]-_0x1b8438['lowerLatitude'])/_0x1b8438['latitudeInterval']);_0xd3f241['push']({'ll':[secondsToRadians(_0x1b8438['lowerLongitude']),secondsToRadians(_0x1b8438['lowerLatitude'])],'del':[secondsToRadians(_0x1b8438['longitudeInterval']),secondsToRadians(_0x1b8438[_0x3f730c(_0x4abddb._0x4ceeea)])],'lim':[_0x1325cb,_0x4296b5],'count':_0x1b8438['gridNodeCount'],'cvs':mapNodes(_0x2b3c50)});}return _0xd3f241;}function mapNodes(_0x4a7821){const _0x2ed925=_0x3d5d32;return _0x4a7821[_0x2ed925(0x7e1)](function(_0x51a183){const _0x131e91=_0x2ed925;return[secondsToRadians(_0x51a183[_0x131e91(0x2fd)]),secondsToRadians(_0x51a183['latitudeShift'])];});}function readGridHeader(_0xe10406,_0x28ff23,_0x1d348b){const _0x4f8f01={_0x3f64d0:0x3bb,_0x14bb5a:0xf52},_0x88c0d4=_0x3d5d32;return{'name':decodeString(_0xe10406,_0x28ff23+0x8,_0x28ff23+0x10)[_0x88c0d4(_0x4f8f01._0x3f64d0)](),'parent':decodeString(_0xe10406,_0x28ff23+0x18,_0x28ff23+0x18+0x8)['trim'](),'lowerLatitude':_0xe10406['getFloat64'](_0x28ff23+0x48,_0x1d348b),'upperLatitude':_0xe10406[_0x88c0d4(_0x4f8f01._0x14bb5a)](_0x28ff23+0x58,_0x1d348b),'lowerLongitude':_0xe10406[_0x88c0d4(0xf52)](_0x28ff23+0x68,_0x1d348b),'upperLongitude':_0xe10406[_0x88c0d4(0xf52)](_0x28ff23+0x78,_0x1d348b),'latitudeInterval':_0xe10406['getFloat64'](_0x28ff23+0x88,_0x1d348b),'longitudeInterval':_0xe10406[_0x88c0d4(_0x4f8f01._0x14bb5a)](_0x28ff23+0x98,_0x1d348b),'gridNodeCount':_0xe10406['getInt32'](_0x28ff23+0xa8,_0x1d348b)};}function readGridNodes(_0x363c7e,_0x13888d,_0x5b19a3,_0xe34ec9){const _0x32b3b4=_0x3d5d32;var _0xe2195e=_0x13888d+0xb0,_0x22d512=0x10,_0x373f3c=[];for(var _0x346472=0x0;_0x346472<_0x5b19a3['gridNodeCount'];_0x346472++){var _0x23bfb3={'latitudeShift':_0x363c7e['getFloat32'](_0xe2195e+_0x346472*_0x22d512,_0xe34ec9),'longitudeShift':_0x363c7e[_0x32b3b4(0x5e8)](_0xe2195e+_0x346472*_0x22d512+0x4,_0xe34ec9),'latitudeAccuracy':_0x363c7e['getFloat32'](_0xe2195e+_0x346472*_0x22d512+0x8,_0xe34ec9),'longitudeAccuracy':_0x363c7e['getFloat32'](_0xe2195e+_0x346472*_0x22d512+0xc,_0xe34ec9)};_0x373f3c['push'](_0x23bfb3);}return _0x373f3c;}function Projection(_0xe76aa3,_0x125528){const _0x154da6={_0x131d05:0x4a2,_0x2e96ae:0xaa0,_0x1c6b41:0x6c0},_0x206d69=_0x3d5d32;if(!(this instanceof Projection))return new Projection(_0xe76aa3);_0x125528=_0x125528||function(_0x296754){if(_0x296754)throw _0x296754;};var _0x29eccd=parse(_0xe76aa3);if(typeof _0x29eccd!=='object'){_0x125528(_0xe76aa3);return;}var _0x50213a=Projection[_0x206d69(0x1024)]['get'](_0x29eccd[_0x206d69(0x2ff)]);if(!_0x50213a){_0x125528(_0xe76aa3);return;}if(_0x29eccd['datumCode']&&_0x29eccd['datumCode']!=='none'){var _0x5c9ba2=match(exports$1,_0x29eccd['datumCode']);_0x5c9ba2&&(_0x29eccd['datum_params']=_0x29eccd['datum_params']||(_0x5c9ba2['towgs84']?_0x5c9ba2[_0x206d69(0xd33)]['split'](','):null),_0x29eccd[_0x206d69(0xce7)]=_0x5c9ba2['ellipse'],_0x29eccd[_0x206d69(0x201)]=_0x5c9ba2['datumName']?_0x5c9ba2[_0x206d69(0x201)]:_0x29eccd[_0x206d69(0x317)]);}_0x29eccd['k0']=_0x29eccd['k0']||0x1,_0x29eccd['axis']=_0x29eccd['axis']||'enu',_0x29eccd['ellps']=_0x29eccd[_0x206d69(0xce7)]||'wgs84',_0x29eccd['lat1']=_0x29eccd[_0x206d69(_0x154da6._0x131d05)]||_0x29eccd[_0x206d69(0xa41)];var _0xf24e76=sphere(_0x29eccd['a'],_0x29eccd['b'],_0x29eccd['rf'],_0x29eccd['ellps'],_0x29eccd['sphere']),_0x5775cf=eccentricity(_0xf24e76['a'],_0xf24e76['b'],_0xf24e76['rf'],_0x29eccd['R_A']),_0x15995a=getNadgrids(_0x29eccd['nadgrids']),_0xe4523e=_0x29eccd['datum']||datum(_0x29eccd['datumCode'],_0x29eccd['datum_params'],_0xf24e76['a'],_0xf24e76['b'],_0x5775cf['es'],_0x5775cf['ep2'],_0x15995a);extend(this,_0x29eccd),extend(this,_0x50213a),this['a']=_0xf24e76['a'],this['b']=_0xf24e76['b'],this['rf']=_0xf24e76['rf'],this[_0x206d69(_0x154da6._0x2e96ae)]=_0xf24e76['sphere'],this['es']=_0x5775cf['es'],this['e']=_0x5775cf['e'],this[_0x206d69(0x6c0)]=_0x5775cf[_0x206d69(_0x154da6._0x1c6b41)],this['datum']=_0xe4523e,this['init'](),_0x125528(null,this);}Projection['projections']=projections,Projection[_0x3d5d32(0x1024)][_0x3d5d32(0xf6d)]();function compareDatums(_0x4d84fe,_0x9fcb62){const _0x547540={_0x49ee5a:0x492},_0x4ac5db=_0x3d5d32;if(_0x4d84fe['datum_type']!==_0x9fcb62['datum_type'])return![];else{if(_0x4d84fe['a']!==_0x9fcb62['a']||Math['abs'](_0x4d84fe['es']-_0x9fcb62['es'])>5e-11)return![];else{if(_0x4d84fe['datum_type']===PJD_3PARAM)return _0x4d84fe['datum_params'][0x0]===_0x9fcb62['datum_params'][0x0]&&_0x4d84fe[_0x4ac5db(0x492)][0x1]===_0x9fcb62[_0x4ac5db(_0x547540._0x49ee5a)][0x1]&&_0x4d84fe['datum_params'][0x2]===_0x9fcb62['datum_params'][0x2];else return _0x4d84fe['datum_type']===PJD_7PARAM?_0x4d84fe['datum_params'][0x0]===_0x9fcb62['datum_params'][0x0]&&_0x4d84fe['datum_params'][0x1]===_0x9fcb62['datum_params'][0x1]&&_0x4d84fe['datum_params'][0x2]===_0x9fcb62['datum_params'][0x2]&&_0x4d84fe['datum_params'][0x3]===_0x9fcb62['datum_params'][0x3]&&_0x4d84fe['datum_params'][0x4]===_0x9fcb62['datum_params'][0x4]&&_0x4d84fe['datum_params'][0x5]===_0x9fcb62[_0x4ac5db(0x492)][0x5]&&_0x4d84fe['datum_params'][0x6]===_0x9fcb62['datum_params'][0x6]:!![];}}}function geodeticToGeocentric(_0x3a99ef,_0x37f393,_0x270270){const _0x47861d={_0x3ffbec:0x723},_0x2f6299=_0x3d5d32;var _0x28f885=_0x3a99ef['x'],_0x17f3dd=_0x3a99ef['y'],_0x2641a9=_0x3a99ef['z']?_0x3a99ef['z']:0x0,_0x435505,_0x4ddcd7,_0xd1c60b,_0x19b8cb;if(_0x17f3dd<-HALF_PI&&_0x17f3dd>-1.001*HALF_PI)_0x17f3dd=-HALF_PI;else{if(_0x17f3dd>HALF_PI&&_0x17f3dd<1.001*HALF_PI)_0x17f3dd=HALF_PI;else{if(_0x17f3dd<-HALF_PI)return{'x':-Infinity,'y':-Infinity,'z':_0x3a99ef['z']};else{if(_0x17f3dd>HALF_PI)return{'x':Infinity,'y':Infinity,'z':_0x3a99ef['z']};}}}return _0x28f885>Math['PI']&&(_0x28f885-=0x2*Math['PI']),_0x4ddcd7=Math['sin'](_0x17f3dd),_0x19b8cb=Math[_0x2f6299(0x256)](_0x17f3dd),_0xd1c60b=_0x4ddcd7*_0x4ddcd7,_0x435505=_0x270270/Math['sqrt'](0x1-_0x37f393*_0xd1c60b),{'x':(_0x435505+_0x2641a9)*_0x19b8cb*Math['cos'](_0x28f885),'y':(_0x435505+_0x2641a9)*_0x19b8cb*Math[_0x2f6299(_0x47861d._0x3ffbec)](_0x28f885),'z':(_0x435505*(0x1-_0x37f393)+_0x2641a9)*_0x4ddcd7};}function geocentricToGeodetic(_0x1e9d65,_0x11da92,_0x1b162b,_0x53a691){const _0x17e2a1={_0x5a5f91:0xae3,_0x2738dc:0xae3},_0x3012b4=_0x3d5d32;var _0x552ad2=1e-12,_0x314b07=_0x552ad2*_0x552ad2,_0x1c8a46=0x1e,_0x5dc6aa,_0x519cba,_0xfc7e61,_0x216e3e,_0x234fc1,_0x241c04,_0x12e4ce,_0x45a159,_0x50aca1,_0x2ee170,_0x18ec21,_0x10ab11,_0x3f1a74,_0x42bd1f=_0x1e9d65['x'],_0x1f5773=_0x1e9d65['y'],_0x306a76=_0x1e9d65['z']?_0x1e9d65['z']:0x0,_0x2e1f57,_0x1f3e7e,_0x3c1065;_0x5dc6aa=Math[_0x3012b4(_0x17e2a1._0x5a5f91)](_0x42bd1f*_0x42bd1f+_0x1f5773*_0x1f5773),_0x519cba=Math['sqrt'](_0x42bd1f*_0x42bd1f+_0x1f5773*_0x1f5773+_0x306a76*_0x306a76);if(_0x5dc6aa/_0x1b162b<_0x552ad2){_0x2e1f57=0x0;if(_0x519cba/_0x1b162b<_0x552ad2)return _0x1f3e7e=HALF_PI,_0x3c1065=-_0x53a691,{'x':_0x1e9d65['x'],'y':_0x1e9d65['y'],'z':_0x1e9d65['z']};}else _0x2e1f57=Math[_0x3012b4(0xec8)](_0x1f5773,_0x42bd1f);_0xfc7e61=_0x306a76/_0x519cba,_0x216e3e=_0x5dc6aa/_0x519cba,_0x234fc1=0x1/Math[_0x3012b4(_0x17e2a1._0x5a5f91)](0x1-_0x11da92*(0x2-_0x11da92)*_0x216e3e*_0x216e3e),_0x45a159=_0x216e3e*(0x1-_0x11da92)*_0x234fc1,_0x50aca1=_0xfc7e61*_0x234fc1,_0x3f1a74=0x0;do{_0x3f1a74++,_0x12e4ce=_0x1b162b/Math[_0x3012b4(_0x17e2a1._0x2738dc)](0x1-_0x11da92*_0x50aca1*_0x50aca1),_0x3c1065=_0x5dc6aa*_0x45a159+_0x306a76*_0x50aca1-_0x12e4ce*(0x1-_0x11da92*_0x50aca1*_0x50aca1),_0x241c04=_0x11da92*_0x12e4ce/(_0x12e4ce+_0x3c1065),_0x234fc1=0x1/Math['sqrt'](0x1-_0x241c04*(0x2-_0x241c04)*_0x216e3e*_0x216e3e),_0x2ee170=_0x216e3e*(0x1-_0x241c04)*_0x234fc1,_0x18ec21=_0xfc7e61*_0x234fc1,_0x10ab11=_0x18ec21*_0x45a159-_0x2ee170*_0x50aca1,_0x45a159=_0x2ee170,_0x50aca1=_0x18ec21;}while(_0x10ab11*_0x10ab11>_0x314b07&&_0x3f1a74<_0x1c8a46);return _0x1f3e7e=Math['atan'](_0x18ec21/Math['abs'](_0x2ee170)),{'x':_0x2e1f57,'y':_0x1f3e7e,'z':_0x3c1065};}function geocentricToWgs84(_0x49a927,_0x5c5f76,_0x5e065f){if(_0x5c5f76===PJD_3PARAM)return{'x':_0x49a927['x']+_0x5e065f[0x0],'y':_0x49a927['y']+_0x5e065f[0x1],'z':_0x49a927['z']+_0x5e065f[0x2]};else{if(_0x5c5f76===PJD_7PARAM){var _0x4f9d08=_0x5e065f[0x0],_0x48e236=_0x5e065f[0x1],_0x5017f9=_0x5e065f[0x2],_0x38bb65=_0x5e065f[0x3],_0x59ef81=_0x5e065f[0x4],_0x47b2f1=_0x5e065f[0x5],_0x22e74a=_0x5e065f[0x6];return{'x':_0x22e74a*(_0x49a927['x']-_0x47b2f1*_0x49a927['y']+_0x59ef81*_0x49a927['z'])+_0x4f9d08,'y':_0x22e74a*(_0x47b2f1*_0x49a927['x']+_0x49a927['y']-_0x38bb65*_0x49a927['z'])+_0x48e236,'z':_0x22e74a*(-_0x59ef81*_0x49a927['x']+_0x38bb65*_0x49a927['y']+_0x49a927['z'])+_0x5017f9};}}}function geocentricFromWgs84(_0x476893,_0x579bcf,_0xc733f){if(_0x579bcf===PJD_3PARAM)return{'x':_0x476893['x']-_0xc733f[0x0],'y':_0x476893['y']-_0xc733f[0x1],'z':_0x476893['z']-_0xc733f[0x2]};else{if(_0x579bcf===PJD_7PARAM){var _0x6dc233=_0xc733f[0x0],_0xb0542b=_0xc733f[0x1],_0x414ff1=_0xc733f[0x2],_0x24a00f=_0xc733f[0x3],_0x3d75de=_0xc733f[0x4],_0x5460c1=_0xc733f[0x5],_0x5d143b=_0xc733f[0x6],_0x5b5a66=(_0x476893['x']-_0x6dc233)/_0x5d143b,_0x4b7d55=(_0x476893['y']-_0xb0542b)/_0x5d143b,_0xbe2945=(_0x476893['z']-_0x414ff1)/_0x5d143b;return{'x':_0x5b5a66+_0x5460c1*_0x4b7d55-_0x3d75de*_0xbe2945,'y':-_0x5460c1*_0x5b5a66+_0x4b7d55+_0x24a00f*_0xbe2945,'z':_0x3d75de*_0x5b5a66-_0x24a00f*_0x4b7d55+_0xbe2945};}}}function checkParams(_0x478481){return _0x478481===PJD_3PARAM||_0x478481===PJD_7PARAM;}function datum_transform(_0x1a91fc,_0x41db60,_0x596ebc){const _0x39692f=_0x3d5d32;if(compareDatums(_0x1a91fc,_0x41db60))return _0x596ebc;if(_0x1a91fc['datum_type']===PJD_NODATUM||_0x41db60['datum_type']===PJD_NODATUM)return _0x596ebc;var _0xb9ec81=_0x1a91fc['a'],_0x46113b=_0x1a91fc['es'];if(_0x1a91fc['datum_type']===PJD_GRIDSHIFT){var _0xea9f24=applyGridShift(_0x1a91fc,![],_0x596ebc);if(_0xea9f24!==0x0)return undefined;_0xb9ec81=SRS_WGS84_SEMIMAJOR,_0x46113b=SRS_WGS84_ESQUARED;}var _0x38b740=_0x41db60['a'],_0x401ce1=_0x41db60['b'],_0xaf2c6a=_0x41db60['es'];_0x41db60['datum_type']===PJD_GRIDSHIFT&&(_0x38b740=SRS_WGS84_SEMIMAJOR,_0x401ce1=SRS_WGS84_SEMIMINOR,_0xaf2c6a=SRS_WGS84_ESQUARED);if(_0x46113b===_0xaf2c6a&&_0xb9ec81===_0x38b740&&!checkParams(_0x1a91fc['datum_type'])&&!checkParams(_0x41db60[_0x39692f(0xb7b)]))return _0x596ebc;_0x596ebc=geodeticToGeocentric(_0x596ebc,_0x46113b,_0xb9ec81);checkParams(_0x1a91fc['datum_type'])&&(_0x596ebc=geocentricToWgs84(_0x596ebc,_0x1a91fc['datum_type'],_0x1a91fc['datum_params']));checkParams(_0x41db60['datum_type'])&&(_0x596ebc=geocentricFromWgs84(_0x596ebc,_0x41db60['datum_type'],_0x41db60['datum_params']));_0x596ebc=geocentricToGeodetic(_0x596ebc,_0xaf2c6a,_0x38b740,_0x401ce1);if(_0x41db60['datum_type']===PJD_GRIDSHIFT){var _0x341aae=applyGridShift(_0x41db60,!![],_0x596ebc);if(_0x341aae!==0x0)return undefined;}return _0x596ebc;}function applyGridShift(_0x21afbb,_0x1b80e8,_0x170537){const _0x1a0225={_0x12daf4:0xc9b,_0x1c8daf:0xc9b,_0x32be0f:0xaed,_0x4a4ace:0xe1f},_0x40377b=_0x3d5d32;if(_0x21afbb[_0x40377b(_0x1a0225._0x12daf4)]===null||_0x21afbb[_0x40377b(_0x1a0225._0x1c8daf)]['length']===0x0)return console[_0x40377b(0x7b1)]('Grid\x20shift\x20grids\x20not\x20found'),-0x1;var _0xf4c74d={'x':-_0x170537['x'],'y':_0x170537['y']},_0xd5c9ac={'x':Number[_0x40377b(0xc82)],'y':Number['NaN']},_0x51d913=[];for(var _0x3684b5=0x0;_0x3684b5<_0x21afbb['grids']['length'];_0x3684b5++){var _0x22b6df=_0x21afbb['grids'][_0x3684b5];_0x51d913['push'](_0x22b6df[_0x40377b(_0x1a0225._0x32be0f)]);if(_0x22b6df[_0x40377b(_0x1a0225._0x4a4ace)]){_0xd5c9ac=_0xf4c74d;break;}if(_0x22b6df['grid']===null){if(_0x22b6df['mandatory'])return console['log']('Unable\x20to\x20find\x20mandatory\x20grid\x20\x27'+_0x22b6df[_0x40377b(_0x1a0225._0x32be0f)]+'\x27'),-0x1;continue;}var _0x250225=_0x22b6df['grid']['subgrids'][0x0],_0x110def=(Math['abs'](_0x250225['del'][0x1])+Math['abs'](_0x250225['del'][0x0]))/0x2710,_0x265bbc=_0x250225['ll'][0x0]-_0x110def,_0x28395c=_0x250225['ll'][0x1]-_0x110def,_0x54cff6=_0x250225['ll'][0x0]+(_0x250225['lim'][0x0]-0x1)*_0x250225[_0x40377b(0x7f2)][0x0]+_0x110def,_0x1c5557=_0x250225['ll'][0x1]+(_0x250225['lim'][0x1]-0x1)*_0x250225[_0x40377b(0x7f2)][0x1]+_0x110def;if(_0x28395c>_0xf4c74d['y']||_0x265bbc>_0xf4c74d['x']||_0x1c5557<_0xf4c74d['y']||_0x54cff6<_0xf4c74d['x'])continue;_0xd5c9ac=applySubgridShift(_0xf4c74d,_0x1b80e8,_0x250225);if(!isNaN(_0xd5c9ac['x']))break;}if(isNaN(_0xd5c9ac['x']))return console['log'](_0x40377b(0xbb1)+-_0xf4c74d['x']*R2D+'\x20'+_0xf4c74d['y']*R2D+'\x20tried:\x20\x27'+_0x51d913+'\x27'),-0x1;return _0x170537['x']=-_0xd5c9ac['x'],_0x170537['y']=_0xd5c9ac['y'],0x0;}function applySubgridShift(_0x39ad31,_0x5babbe,_0xb52483){const _0x3d8efc={_0x18a0f6:0xdce,_0x47bba5:0x4ba},_0x3d329a=_0x3d5d32;var _0x17057d={'x':Number['NaN'],'y':Number['NaN']};if(isNaN(_0x39ad31['x']))return _0x17057d;var _0xa237fb={'x':_0x39ad31['x'],'y':_0x39ad31['y']};_0xa237fb['x']-=_0xb52483['ll'][0x0],_0xa237fb['y']-=_0xb52483['ll'][0x1],_0xa237fb['x']=adjust_lon(_0xa237fb['x']-Math['PI'])+Math['PI'];var _0x2efe87=nadInterpolate(_0xa237fb,_0xb52483);if(_0x5babbe){if(isNaN(_0x2efe87['x']))return _0x17057d;_0x2efe87['x']=_0xa237fb['x']-_0x2efe87['x'],_0x2efe87['y']=_0xa237fb['y']-_0x2efe87['y'];var _0x5caa99=0x9,_0xd28337=1e-12,_0x909031,_0x2285af;do{_0x2285af=nadInterpolate(_0x2efe87,_0xb52483);if(isNaN(_0x2285af['x'])){console[_0x3d329a(0x7b1)](_0x3d329a(_0x3d8efc._0x18a0f6));break;}_0x909031={'x':_0xa237fb['x']-(_0x2285af['x']+_0x2efe87['x']),'y':_0xa237fb['y']-(_0x2285af['y']+_0x2efe87['y'])},_0x2efe87['x']+=_0x909031['x'],_0x2efe87['y']+=_0x909031['y'];}while(_0x5caa99--&&Math[_0x3d329a(_0x3d8efc._0x47bba5)](_0x909031['x'])>_0xd28337&&Math[_0x3d329a(0x4ba)](_0x909031['y'])>_0xd28337);if(_0x5caa99<0x0)return console['log']('Inverse\x20grid\x20shift\x20iterator\x20failed\x20to\x20converge.'),_0x17057d;_0x17057d['x']=adjust_lon(_0x2efe87['x']+_0xb52483['ll'][0x0]),_0x17057d['y']=_0x2efe87['y']+_0xb52483['ll'][0x1];}else!isNaN(_0x2efe87['x'])&&(_0x17057d['x']=_0x39ad31['x']+_0x2efe87['x'],_0x17057d['y']=_0x39ad31['y']+_0x2efe87['y']);return _0x17057d;}function nadInterpolate(_0x6e679d,_0x2994be){const _0x3da804={_0x2a5118:0xc82,_0x8ae8b2:0x2b6},_0x892baf=_0x3d5d32;var _0x4a7f51={'x':_0x6e679d['x']/_0x2994be['del'][0x0],'y':_0x6e679d['y']/_0x2994be['del'][0x1]},_0xabc7d2={'x':Math[_0x892baf(0x6fa)](_0x4a7f51['x']),'y':Math['floor'](_0x4a7f51['y'])},_0x5ab2de={'x':_0x4a7f51['x']-0x1*_0xabc7d2['x'],'y':_0x4a7f51['y']-0x1*_0xabc7d2['y']},_0x10bc8d={'x':Number[_0x892baf(0xc82)],'y':Number[_0x892baf(_0x3da804._0x2a5118)]},_0x399014;if(_0xabc7d2['x']<0x0||_0xabc7d2['x']>=_0x2994be['lim'][0x0])return _0x10bc8d;if(_0xabc7d2['y']<0x0||_0xabc7d2['y']>=_0x2994be['lim'][0x1])return _0x10bc8d;_0x399014=_0xabc7d2['y']*_0x2994be['lim'][0x0]+_0xabc7d2['x'];var _0x12d8a8={'x':_0x2994be[_0x892baf(_0x3da804._0x8ae8b2)][_0x399014][0x0],'y':_0x2994be['cvs'][_0x399014][0x1]};_0x399014++;var _0x1fa306={'x':_0x2994be[_0x892baf(0x2b6)][_0x399014][0x0],'y':_0x2994be['cvs'][_0x399014][0x1]};_0x399014+=_0x2994be['lim'][0x0];var _0x33addb={'x':_0x2994be[_0x892baf(_0x3da804._0x8ae8b2)][_0x399014][0x0],'y':_0x2994be[_0x892baf(_0x3da804._0x8ae8b2)][_0x399014][0x1]};_0x399014--;var _0x50d3f5={'x':_0x2994be['cvs'][_0x399014][0x0],'y':_0x2994be['cvs'][_0x399014][0x1]},_0xb2399b=_0x5ab2de['x']*_0x5ab2de['y'],_0xc002=_0x5ab2de['x']*(0x1-_0x5ab2de['y']),_0x57f34a=(0x1-_0x5ab2de['x'])*(0x1-_0x5ab2de['y']),_0x2e9058=(0x1-_0x5ab2de['x'])*_0x5ab2de['y'];return _0x10bc8d['x']=_0x57f34a*_0x12d8a8['x']+_0xc002*_0x1fa306['x']+_0x2e9058*_0x50d3f5['x']+_0xb2399b*_0x33addb['x'],_0x10bc8d['y']=_0x57f34a*_0x12d8a8['y']+_0xc002*_0x1fa306['y']+_0x2e9058*_0x50d3f5['y']+_0xb2399b*_0x33addb['y'],_0x10bc8d;}function adjust_axis(_0x1cacf9,_0x152c89,_0x597896){const _0x49ce44={_0x451850:0xa71,_0x524b71:0xa71},_0x49f130=_0x3d5d32;var _0x228636=_0x597896['x'],_0x101efd=_0x597896['y'],_0x20ab06=_0x597896['z']||0x0,_0x1022a8,_0x4a2581,_0x26b2db,_0x3177a9={};for(_0x26b2db=0x0;_0x26b2db<0x3;_0x26b2db++){if(_0x152c89&&_0x26b2db===0x2&&_0x597896['z']===undefined)continue;if(_0x26b2db===0x0)_0x1022a8=_0x228636,'ew'['indexOf'](_0x1cacf9[_0x49f130(_0x49ce44._0x451850)][_0x26b2db])!==-0x1?_0x4a2581='x':_0x4a2581='y';else _0x26b2db===0x1?(_0x1022a8=_0x101efd,'ns'['indexOf'](_0x1cacf9[_0x49f130(_0x49ce44._0x524b71)][_0x26b2db])!==-0x1?_0x4a2581='y':_0x4a2581='x'):(_0x1022a8=_0x20ab06,_0x4a2581='z');switch(_0x1cacf9['axis'][_0x26b2db]){case'e':_0x3177a9[_0x4a2581]=_0x1022a8;break;case'w':_0x3177a9[_0x4a2581]=-_0x1022a8;break;case'n':_0x3177a9[_0x4a2581]=_0x1022a8;break;case's':_0x3177a9[_0x4a2581]=-_0x1022a8;break;case'u':_0x597896[_0x4a2581]!==undefined&&(_0x3177a9['z']=_0x1022a8);break;case'd':_0x597896[_0x4a2581]!==undefined&&(_0x3177a9['z']=-_0x1022a8);break;default:return null;}}return _0x3177a9;}function common(_0x3c8fee){const _0x297140={_0x59988a:0xc84},_0x24e716=_0x3d5d32;var _0x5d0535={'x':_0x3c8fee[0x0],'y':_0x3c8fee[0x1]};return _0x3c8fee['length']>0x2&&(_0x5d0535['z']=_0x3c8fee[0x2]),_0x3c8fee[_0x24e716(_0x297140._0x59988a)]>0x3&&(_0x5d0535['m']=_0x3c8fee[0x3]),_0x5d0535;}function checkSanity(_0xffaee8){checkCoord(_0xffaee8['x']),checkCoord(_0xffaee8['y']);}function checkCoord(_0x18927a){const _0x2dac7f=_0x3d5d32;if(typeof Number['isFinite']==='function'){if(Number['isFinite'](_0x18927a))return;throw new TypeError('coordinates\x20must\x20be\x20finite\x20numbers');}if(typeof _0x18927a!==_0x2dac7f(0xca5)||_0x18927a!==_0x18927a||!isFinite(_0x18927a))throw new TypeError(_0x2dac7f(0x575));}function checkNotWGS(_0x878161,_0x4f8755){const _0x58cfaf={_0x29b09a:0xb7b,_0x408842:0x818,_0x48bfdc:0xb7b},_0xedc944=_0x3d5d32;return(_0x878161['datum']['datum_type']===PJD_3PARAM||_0x878161['datum']['datum_type']===PJD_7PARAM||_0x878161['datum']['datum_type']===PJD_GRIDSHIFT)&&_0x4f8755['datumCode']!=='WGS84'||(_0x4f8755['datum'][_0xedc944(_0x58cfaf._0x29b09a)]===PJD_3PARAM||_0x4f8755[_0xedc944(_0x58cfaf._0x408842)][_0xedc944(_0x58cfaf._0x48bfdc)]===PJD_7PARAM||_0x4f8755[_0xedc944(_0x58cfaf._0x408842)]['datum_type']===PJD_GRIDSHIFT)&&_0x878161['datumCode']!=='WGS84';}function transform(_0x5d65db,_0x185084,_0x32b15d,_0x5e321f){const _0x10c2b4={_0x23b443:0x62b,_0x241a17:0x818,_0x528fe1:0x757,_0x4fa381:0x278},_0x2e3451=_0x3d5d32;var _0x2331c7;Array[_0x2e3451(_0x10c2b4._0x23b443)](_0x32b15d)?_0x32b15d=common(_0x32b15d):_0x32b15d={'x':_0x32b15d['x'],'y':_0x32b15d['y'],'z':_0x32b15d['z'],'m':_0x32b15d['m']};var _0x12c1ce=_0x32b15d['z']!==undefined;checkSanity(_0x32b15d);_0x5d65db[_0x2e3451(_0x10c2b4._0x241a17)]&&_0x185084['datum']&&checkNotWGS(_0x5d65db,_0x185084)&&(_0x2331c7=new Projection('WGS84'),_0x32b15d=transform(_0x5d65db,_0x2331c7,_0x32b15d,_0x5e321f),_0x5d65db=_0x2331c7);_0x5e321f&&_0x5d65db['axis']!=='enu'&&(_0x32b15d=adjust_axis(_0x5d65db,![],_0x32b15d));if(_0x5d65db[_0x2e3451(0x2ff)]==='longlat')_0x32b15d={'x':_0x32b15d['x']*D2R$1,'y':_0x32b15d['y']*D2R$1,'z':_0x32b15d['z']||0x0};else{_0x5d65db[_0x2e3451(0x278)]&&(_0x32b15d={'x':_0x32b15d['x']*_0x5d65db['to_meter'],'y':_0x32b15d['y']*_0x5d65db['to_meter'],'z':_0x32b15d['z']||0x0});_0x32b15d=_0x5d65db['inverse'](_0x32b15d);if(!_0x32b15d)return;}_0x5d65db['from_greenwich']&&(_0x32b15d['x']+=_0x5d65db[_0x2e3451(0x757)]);_0x32b15d=datum_transform(_0x5d65db['datum'],_0x185084['datum'],_0x32b15d);if(!_0x32b15d)return;_0x185084[_0x2e3451(_0x10c2b4._0x528fe1)]&&(_0x32b15d={'x':_0x32b15d['x']-_0x185084['from_greenwich'],'y':_0x32b15d['y'],'z':_0x32b15d['z']||0x0});_0x185084['projName']==='longlat'?_0x32b15d={'x':_0x32b15d['x']*R2D,'y':_0x32b15d['y']*R2D,'z':_0x32b15d['z']||0x0}:(_0x32b15d=_0x185084['forward'](_0x32b15d),_0x185084[_0x2e3451(_0x10c2b4._0x4fa381)]&&(_0x32b15d={'x':_0x32b15d['x']/_0x185084['to_meter'],'y':_0x32b15d['y']/_0x185084['to_meter'],'z':_0x32b15d['z']||0x0}));if(_0x5e321f&&_0x185084['axis']!==_0x2e3451(0x532))return adjust_axis(_0x185084,!![],_0x32b15d);return!_0x12c1ce&&delete _0x32b15d['z'],_0x32b15d;}var wgs84=Projection('WGS84');function transformer(_0x3a1afc,_0x5805ac,_0x8011c5,_0x7fe96a){const _0x266b85={_0x129e7d:0xaed,_0x10bfbf:0xca5,_0x110dd7:0xc97,_0x4d67fc:0xc84},_0x1b60e5=_0x3d5d32;var _0x50c1ec,_0x4ac79f,_0x31769f;if(Array['isArray'](_0x8011c5))return _0x50c1ec=transform(_0x3a1afc,_0x5805ac,_0x8011c5,_0x7fe96a)||{'x':NaN,'y':NaN},_0x8011c5['length']>0x2?typeof _0x3a1afc[_0x1b60e5(_0x266b85._0x129e7d)]!=='undefined'&&_0x3a1afc['name']==='geocent'||typeof _0x5805ac['name']!=='undefined'&&_0x5805ac['name']==='geocent'?typeof _0x50c1ec['z']===_0x1b60e5(_0x266b85._0x10bfbf)?[_0x50c1ec['x'],_0x50c1ec['y'],_0x50c1ec['z']][_0x1b60e5(_0x266b85._0x110dd7)](_0x8011c5['splice'](0x3)):[_0x50c1ec['x'],_0x50c1ec['y'],_0x8011c5[0x2]]['concat'](_0x8011c5['splice'](0x3)):[_0x50c1ec['x'],_0x50c1ec['y']][_0x1b60e5(0xc97)](_0x8011c5[_0x1b60e5(0x1008)](0x2)):[_0x50c1ec['x'],_0x50c1ec['y']];else{_0x4ac79f=transform(_0x3a1afc,_0x5805ac,_0x8011c5,_0x7fe96a),_0x31769f=Object['keys'](_0x8011c5);if(_0x31769f[_0x1b60e5(_0x266b85._0x4d67fc)]===0x2)return _0x4ac79f;return _0x31769f['forEach'](function(_0x4b5b2b){const _0x13c5c7=_0x1b60e5;if(typeof _0x3a1afc['name']!=='undefined'&&_0x3a1afc['name']==='geocent'||typeof _0x5805ac['name']!=='undefined'&&_0x5805ac[_0x13c5c7(0xaed)]==='geocent'){if(_0x4b5b2b==='x'||_0x4b5b2b==='y'||_0x4b5b2b==='z')return;}else{if(_0x4b5b2b==='x'||_0x4b5b2b==='y')return;}_0x4ac79f[_0x4b5b2b]=_0x8011c5[_0x4b5b2b];}),_0x4ac79f;}}function checkProj(_0x249d23){if(_0x249d23 instanceof Projection)return _0x249d23;if(_0x249d23['oProj'])return _0x249d23['oProj'];return Projection(_0x249d23);}function proj4(_0x30403a,_0x19dc70,_0x280c24){const _0x2f1fcb={_0x1a082f:0x23c},_0x61892c=_0x3d5d32;_0x30403a=checkProj(_0x30403a);var _0x253675=![],_0x5e6edd;if(typeof _0x19dc70==='undefined')_0x19dc70=_0x30403a,_0x30403a=wgs84,_0x253675=!![];else(typeof _0x19dc70['x']!==_0x61892c(_0x2f1fcb._0x1a082f)||Array['isArray'](_0x19dc70))&&(_0x280c24=_0x19dc70,_0x19dc70=_0x30403a,_0x30403a=wgs84,_0x253675=!![]);return _0x19dc70=checkProj(_0x19dc70),_0x280c24?transformer(_0x30403a,_0x19dc70,_0x280c24):(_0x5e6edd={'forward':function(_0x55a719,_0x2d2567){return transformer(_0x30403a,_0x19dc70,_0x55a719,_0x2d2567);},'inverse':function(_0x5d8668,_0x3065b3){return transformer(_0x19dc70,_0x30403a,_0x5d8668,_0x3065b3);}},_0x253675&&(_0x5e6edd[_0x61892c(0xbed)]=_0x19dc70),_0x5e6edd);}var NUM_100K_SETS=0x6,SET_ORIGIN_COLUMN_LETTERS='AJSAJS',SET_ORIGIN_ROW_LETTERS=_0x3d5d32(0xcf6),A=0x41,I=0x49,O=0x4f,V=0x56,Z=0x5a,mgrs={'forward':forward$t,'inverse':inverse$t,'toPoint':toPoint};function forward$t(_0x1317b2,_0x5a35ae){return _0x5a35ae=_0x5a35ae||0x5,encode$1(LLtoUTM({'lat':_0x1317b2[0x1],'lon':_0x1317b2[0x0]}),_0x5a35ae);}function inverse$t(_0x271202){const _0x2d31e6={_0x39ad4e:0x5fa},_0x6ec385=_0x3d5d32;var _0x4463ff=UTMtoLL(decode(_0x271202['toUpperCase']()));if(_0x4463ff['lat']&&_0x4463ff[_0x6ec385(0x5fa)])return[_0x4463ff[_0x6ec385(_0x2d31e6._0x39ad4e)],_0x4463ff[_0x6ec385(0xd57)],_0x4463ff[_0x6ec385(0x5fa)],_0x4463ff['lat']];return[_0x4463ff['left'],_0x4463ff['bottom'],_0x4463ff[_0x6ec385(0x28b)],_0x4463ff['top']];}function toPoint(_0x2dd5ef){const _0x38ee68=_0x3d5d32;var _0x149053=UTMtoLL(decode(_0x2dd5ef[_0x38ee68(0x9cb)]()));if(_0x149053['lat']&&_0x149053['lon'])return[_0x149053['lon'],_0x149053['lat']];return[(_0x149053['left']+_0x149053['right'])/0x2,(_0x149053['top']+_0x149053['bottom'])/0x2];}function degToRad(_0x497292){return _0x497292*(Math['PI']/0xb4);}function radToDeg(_0x272a41){return 0xb4*(_0x272a41/Math['PI']);}function LLtoUTM(_0xac7b09){const _0x9756dc={_0x430432:0x723,_0x437b49:0xdd3},_0x439884=_0x3d5d32;var _0x3c1af7=_0xac7b09['lat'],_0x3895a7=_0xac7b09['lon'],_0x13a785=0x615299,_0x2d4ae8=0.00669438,_0x328b5c=0.9996,_0x9830f,_0x469ebb,_0x30fdd6,_0x9900d,_0x4e4e3d,_0x52b2b2,_0x12aba8,_0x4546aa=degToRad(_0x3c1af7),_0x287e32=degToRad(_0x3895a7),_0x2ea4a5,_0x2cf7fb;_0x2cf7fb=Math[_0x439884(0x6fa)]((_0x3895a7+0xb4)/0x6)+0x1;_0x3895a7===0xb4&&(_0x2cf7fb=0x3c);_0x3c1af7>=0x38&&_0x3c1af7<0x40&&_0x3895a7>=0x3&&_0x3895a7<0xc&&(_0x2cf7fb=0x20);if(_0x3c1af7>=0x48&&_0x3c1af7<0x54){if(_0x3895a7>=0x0&&_0x3895a7<0x9)_0x2cf7fb=0x1f;else{if(_0x3895a7>=0x9&&_0x3895a7<0x15)_0x2cf7fb=0x21;else{if(_0x3895a7>=0x15&&_0x3895a7<0x21)_0x2cf7fb=0x23;else _0x3895a7>=0x21&&_0x3895a7<0x2a&&(_0x2cf7fb=0x25);}}}_0x9830f=(_0x2cf7fb-0x1)*0x6-0xb4+0x3,_0x2ea4a5=degToRad(_0x9830f),_0x469ebb=_0x2d4ae8/(0x1-_0x2d4ae8),_0x30fdd6=_0x13a785/Math['sqrt'](0x1-_0x2d4ae8*Math[_0x439884(0x723)](_0x4546aa)*Math[_0x439884(_0x9756dc._0x430432)](_0x4546aa)),_0x9900d=Math['tan'](_0x4546aa)*Math[_0x439884(_0x9756dc._0x437b49)](_0x4546aa),_0x4e4e3d=_0x469ebb*Math['cos'](_0x4546aa)*Math['cos'](_0x4546aa),_0x52b2b2=Math['cos'](_0x4546aa)*(_0x287e32-_0x2ea4a5),_0x12aba8=_0x13a785*((0x1-_0x2d4ae8/0x4-0x3*_0x2d4ae8*_0x2d4ae8/0x40-0x5*_0x2d4ae8*_0x2d4ae8*_0x2d4ae8/0x100)*_0x4546aa-(0x3*_0x2d4ae8/0x8+0x3*_0x2d4ae8*_0x2d4ae8/0x20+0x2d*_0x2d4ae8*_0x2d4ae8*_0x2d4ae8/0x400)*Math['sin'](0x2*_0x4546aa)+(0xf*_0x2d4ae8*_0x2d4ae8/0x100+0x2d*_0x2d4ae8*_0x2d4ae8*_0x2d4ae8/0x400)*Math['sin'](0x4*_0x4546aa)-0x23*_0x2d4ae8*_0x2d4ae8*_0x2d4ae8/0xc00*Math['sin'](0x6*_0x4546aa));var _0x117e76=_0x328b5c*_0x30fdd6*(_0x52b2b2+(0x1-_0x9900d+_0x4e4e3d)*_0x52b2b2*_0x52b2b2*_0x52b2b2/0x6+(0x5-0x12*_0x9900d+_0x9900d*_0x9900d+0x48*_0x4e4e3d-0x3a*_0x469ebb)*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2/0x78)+0x7a120,_0x147ae4=_0x328b5c*(_0x12aba8+_0x30fdd6*Math[_0x439884(_0x9756dc._0x437b49)](_0x4546aa)*(_0x52b2b2*_0x52b2b2/0x2+(0x5-_0x9900d+0x9*_0x4e4e3d+0x4*_0x4e4e3d*_0x4e4e3d)*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2/0x18+(0x3d-0x3a*_0x9900d+_0x9900d*_0x9900d+0x258*_0x4e4e3d-0x14a*_0x469ebb)*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2*_0x52b2b2/0x2d0));return _0x3c1af7<0x0&&(_0x147ae4+=0x989680),{'northing':Math['round'](_0x147ae4),'easting':Math['round'](_0x117e76),'zoneNumber':_0x2cf7fb,'zoneLetter':getLetterDesignator(_0x3c1af7)};}function UTMtoLL(_0x2a19e8){const _0xc39256={_0x23c9e1:0xb1d,_0x4448a3:0x723,_0x2fed3c:0x256},_0x4f617c=_0x3d5d32;var _0x5692cc=_0x2a19e8[_0x4f617c(0x2d4)],_0x4cab99=_0x2a19e8[_0x4f617c(0x56c)],_0x54f444=_0x2a19e8['zoneLetter'],_0x6eb0ea=_0x2a19e8[_0x4f617c(_0xc39256._0x23c9e1)];if(_0x6eb0ea<0x0||_0x6eb0ea>0x3c)return null;var _0x476217=0.9996,_0x827481=0x615299,_0x2e7597=0.00669438,_0x3437ab,_0x38005e=(0x1-Math['sqrt'](0x1-_0x2e7597))/(0x1+Math['sqrt'](0x1-_0x2e7597)),_0x2d3248,_0x381865,_0x3f79f7,_0x23233c,_0x55ca82,_0x1f6795,_0x1c5041,_0x3db51b,_0x3c1eca,_0x117688=_0x4cab99-0x7a120,_0x1694ff=_0x5692cc;_0x54f444<'N'&&(_0x1694ff-=0x989680);_0x1c5041=(_0x6eb0ea-0x1)*0x6-0xb4+0x3,_0x3437ab=_0x2e7597/(0x1-_0x2e7597),_0x1f6795=_0x1694ff/_0x476217,_0x3db51b=_0x1f6795/(_0x827481*(0x1-_0x2e7597/0x4-0x3*_0x2e7597*_0x2e7597/0x40-0x5*_0x2e7597*_0x2e7597*_0x2e7597/0x100)),_0x3c1eca=_0x3db51b+(0x3*_0x38005e/0x2-0x1b*_0x38005e*_0x38005e*_0x38005e/0x20)*Math['sin'](0x2*_0x3db51b)+(0x15*_0x38005e*_0x38005e/0x10-0x37*_0x38005e*_0x38005e*_0x38005e*_0x38005e/0x20)*Math[_0x4f617c(0x723)](0x4*_0x3db51b)+0x97*_0x38005e*_0x38005e*_0x38005e/0x60*Math['sin'](0x6*_0x3db51b),_0x2d3248=_0x827481/Math['sqrt'](0x1-_0x2e7597*Math[_0x4f617c(_0xc39256._0x4448a3)](_0x3c1eca)*Math['sin'](_0x3c1eca)),_0x381865=Math['tan'](_0x3c1eca)*Math['tan'](_0x3c1eca),_0x3f79f7=_0x3437ab*Math[_0x4f617c(0x256)](_0x3c1eca)*Math['cos'](_0x3c1eca),_0x23233c=_0x827481*(0x1-_0x2e7597)/Math['pow'](0x1-_0x2e7597*Math['sin'](_0x3c1eca)*Math[_0x4f617c(_0xc39256._0x4448a3)](_0x3c1eca),1.5),_0x55ca82=_0x117688/(_0x2d3248*_0x476217);var _0xfef9ef=_0x3c1eca-_0x2d3248*Math['tan'](_0x3c1eca)/_0x23233c*(_0x55ca82*_0x55ca82/0x2-(0x5+0x3*_0x381865+0xa*_0x3f79f7-0x4*_0x3f79f7*_0x3f79f7-0x9*_0x3437ab)*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82/0x18+(0x3d+0x5a*_0x381865+0x12a*_0x3f79f7+0x2d*_0x381865*_0x381865-0xfc*_0x3437ab-0x3*_0x3f79f7*_0x3f79f7)*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82/0x2d0);_0xfef9ef=radToDeg(_0xfef9ef);var _0x55a890=(_0x55ca82-(0x1+0x2*_0x381865+_0x3f79f7)*_0x55ca82*_0x55ca82*_0x55ca82/0x6+(0x5-0x2*_0x3f79f7+0x1c*_0x381865-0x3*_0x3f79f7*_0x3f79f7+0x8*_0x3437ab+0x18*_0x381865*_0x381865)*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82*_0x55ca82/0x78)/Math[_0x4f617c(_0xc39256._0x2fed3c)](_0x3c1eca);_0x55a890=_0x1c5041+radToDeg(_0x55a890);var _0x4cf9dc;if(_0x2a19e8['accuracy']){var _0x742a1c=UTMtoLL({'northing':_0x2a19e8['northing']+_0x2a19e8['accuracy'],'easting':_0x2a19e8['easting']+_0x2a19e8['accuracy'],'zoneLetter':_0x2a19e8['zoneLetter'],'zoneNumber':_0x2a19e8['zoneNumber']});_0x4cf9dc={'top':_0x742a1c['lat'],'right':_0x742a1c[_0x4f617c(0x5fa)],'bottom':_0xfef9ef,'left':_0x55a890};}else _0x4cf9dc={'lat':_0xfef9ef,'lon':_0x55a890};return _0x4cf9dc;}function getLetterDesignator(_0x5c9f22){var _0x493191='Z';if(0x54>=_0x5c9f22&&_0x5c9f22>=0x48)_0x493191='X';else{if(0x48>_0x5c9f22&&_0x5c9f22>=0x40)_0x493191='W';else{if(0x40>_0x5c9f22&&_0x5c9f22>=0x38)_0x493191='V';else{if(0x38>_0x5c9f22&&_0x5c9f22>=0x30)_0x493191='U';else{if(0x30>_0x5c9f22&&_0x5c9f22>=0x28)_0x493191='T';else{if(0x28>_0x5c9f22&&_0x5c9f22>=0x20)_0x493191='S';else{if(0x20>_0x5c9f22&&_0x5c9f22>=0x18)_0x493191='R';else{if(0x18>_0x5c9f22&&_0x5c9f22>=0x10)_0x493191='Q';else{if(0x10>_0x5c9f22&&_0x5c9f22>=0x8)_0x493191='P';else{if(0x8>_0x5c9f22&&_0x5c9f22>=0x0)_0x493191='N';else{if(0x0>_0x5c9f22&&_0x5c9f22>=-0x8)_0x493191='M';else{if(-0x8>_0x5c9f22&&_0x5c9f22>=-0x10)_0x493191='L';else{if(-0x10>_0x5c9f22&&_0x5c9f22>=-0x18)_0x493191='K';else{if(-0x18>_0x5c9f22&&_0x5c9f22>=-0x20)_0x493191='J';else{if(-0x20>_0x5c9f22&&_0x5c9f22>=-0x28)_0x493191='H';else{if(-0x28>_0x5c9f22&&_0x5c9f22>=-0x30)_0x493191='G';else{if(-0x30>_0x5c9f22&&_0x5c9f22>=-0x38)_0x493191='F';else{if(-0x38>_0x5c9f22&&_0x5c9f22>=-0x40)_0x493191='E';else{if(-0x40>_0x5c9f22&&_0x5c9f22>=-0x48)_0x493191='D';else-0x48>_0x5c9f22&&_0x5c9f22>=-0x50&&(_0x493191='C');}}}}}}}}}}}}}}}}}}return _0x493191;}function encode$1(_0x120ee7,_0x394ad4){const _0x2144da={_0x54d299:0x56c,_0x24bae2:0x2c3},_0x301325=_0x3d5d32;var _0x59db95='00000'+_0x120ee7[_0x301325(_0x2144da._0x54d299)],_0x4410df=_0x301325(0x39c)+_0x120ee7['northing'];return _0x120ee7['zoneNumber']+_0x120ee7['zoneLetter']+get100kID(_0x120ee7['easting'],_0x120ee7[_0x301325(0x2d4)],_0x120ee7[_0x301325(0xb1d)])+_0x59db95['substr'](_0x59db95['length']-0x5,_0x394ad4)+_0x4410df[_0x301325(_0x2144da._0x24bae2)](_0x4410df['length']-0x5,_0x394ad4);}function get100kID(_0x3858bd,_0x96a431,_0x34f358){const _0x4f5ba8={_0x1b910e:0x6fa},_0x26ce8a=_0x3d5d32;var _0xfa2c0=get100kSetForZone(_0x34f358),_0x2a0621=Math[_0x26ce8a(0x6fa)](_0x3858bd/0x186a0),_0x10b4e7=Math[_0x26ce8a(_0x4f5ba8._0x1b910e)](_0x96a431/0x186a0)%0x14;return getLetter100kID(_0x2a0621,_0x10b4e7,_0xfa2c0);}function get100kSetForZone(_0x1595a7){var _0x7b3f57=_0x1595a7%NUM_100K_SETS;return _0x7b3f57===0x0&&(_0x7b3f57=NUM_100K_SETS),_0x7b3f57;}function getLetter100kID(_0x296299,_0x51ed39,_0x33deab){const _0x384dbb={_0x4fe4da:0xc99},_0x2af6d7=_0x3d5d32;var _0x73cc8c=_0x33deab-0x1,_0x88bb8d=SET_ORIGIN_COLUMN_LETTERS[_0x2af6d7(_0x384dbb._0x4fe4da)](_0x73cc8c),_0x2c9c60=SET_ORIGIN_ROW_LETTERS[_0x2af6d7(_0x384dbb._0x4fe4da)](_0x73cc8c),_0x493bac=_0x88bb8d+_0x296299-0x1,_0x1aa772=_0x2c9c60+_0x51ed39,_0x2a3baf=![];_0x493bac>Z&&(_0x493bac=_0x493bac-Z+A-0x1,_0x2a3baf=!![]);(_0x493bac===I||_0x88bb8dI||(_0x493bac>I||_0x88bb8dO||(_0x493bac>O||_0x88bb8dZ&&(_0x493bac=_0x493bac-Z+A-0x1);_0x1aa772>V?(_0x1aa772=_0x1aa772-V+A-0x1,_0x2a3baf=!![]):_0x2a3baf=![];(_0x1aa772===I||_0x2c9c60I||(_0x1aa772>I||_0x2c9c60O||(_0x1aa772>O||_0x2c9c60V&&(_0x1aa772=_0x1aa772-V+A-0x1);var _0x5e4d2b=String['fromCharCode'](_0x493bac)+String['fromCharCode'](_0x1aa772);return _0x5e4d2b;}function decode(_0x2a2910){const _0x1d5844={_0x49a51b:0x5a9},_0x2afb39=_0x3d5d32;if(_0x2a2910&&_0x2a2910[_0x2afb39(0xc84)]===0x0)throw _0x2afb39(0x104f);var _0x617e87=_0x2a2910['length'],_0x439aee=null,_0x15cd57='',_0x556578,_0x49aa1e=0x0;while(!/[A-Z]/['test'](_0x556578=_0x2a2910['charAt'](_0x49aa1e))){if(_0x49aa1e>=0x2)throw _0x2afb39(_0x1d5844._0x49a51b)+_0x2a2910;_0x15cd57+=_0x556578,_0x49aa1e++;}var _0x5d8434=parseInt(_0x15cd57,0xa);if(_0x49aa1e===0x0||_0x49aa1e+0x3>_0x617e87)throw'MGRSPoint\x20bad\x20conversion\x20from:\x20'+_0x2a2910;var _0x14b5a4=_0x2a2910['charAt'](_0x49aa1e++);if(_0x14b5a4<='A'||_0x14b5a4==='B'||_0x14b5a4==='Y'||_0x14b5a4>='Z'||_0x14b5a4==='I'||_0x14b5a4==='O')throw'MGRSPoint\x20zone\x20letter\x20'+_0x14b5a4+'\x20not\x20handled:\x20'+_0x2a2910;_0x439aee=_0x2a2910['substring'](_0x49aa1e,_0x49aa1e+=0x2);var _0x4558ec=get100kSetForZone(_0x5d8434),_0x1be8c0=getEastingFromChar(_0x439aee['charAt'](0x0),_0x4558ec),_0x3c0244=getNorthingFromChar(_0x439aee['charAt'](0x1),_0x4558ec);while(_0x3c02440x0&&(_0x4fe396=0x186a0/Math['pow'](0xa,_0x41ab05),_0x3c6bba=_0x2a2910['substring'](_0x49aa1e,_0x49aa1e+_0x41ab05),_0x182a08=parseFloat(_0x3c6bba)*_0x4fe396,_0x19442f=_0x2a2910['substring'](_0x49aa1e+_0x41ab05),_0x24f903=parseFloat(_0x19442f)*_0x4fe396),_0x521eea=_0x182a08+_0x1be8c0,_0x10efde=_0x24f903+_0x3c0244,{'easting':_0x521eea,'northing':_0x10efde,'zoneLetter':_0x14b5a4,'zoneNumber':_0x5d8434,'accuracy':_0x4fe396};}function getEastingFromChar(_0x25f121,_0x35845f){var _0xbf6fd7=SET_ORIGIN_COLUMN_LETTERS['charCodeAt'](_0x35845f-0x1),_0x4e552f=0x186a0,_0x4a04d4=![];while(_0xbf6fd7!==_0x25f121['charCodeAt'](0x0)){_0xbf6fd7++;_0xbf6fd7===I&&_0xbf6fd7++;_0xbf6fd7===O&&_0xbf6fd7++;if(_0xbf6fd7>Z){if(_0x4a04d4)throw'Bad\x20character:\x20'+_0x25f121;_0xbf6fd7=A,_0x4a04d4=!![];}_0x4e552f+=0x186a0;}return _0x4e552f;}function getNorthingFromChar(_0x4b2738,_0x2d77d7){const _0x18a315={_0x3a7ae2:0x549},_0x39a431=_0x3d5d32;if(_0x4b2738>'V')throw _0x39a431(_0x18a315._0x3a7ae2)+_0x4b2738;var _0x4b91c1=SET_ORIGIN_ROW_LETTERS['charCodeAt'](_0x2d77d7-0x1),_0x473831=0x0,_0x4797e0=![];while(_0x4b91c1!==_0x4b2738['charCodeAt'](0x0)){_0x4b91c1++;_0x4b91c1===I&&_0x4b91c1++;_0x4b91c1===O&&_0x4b91c1++;if(_0x4b91c1>V){if(_0x4797e0)throw'Bad\x20character:\x20'+_0x4b2738;_0x4b91c1=A,_0x4797e0=!![];}_0x473831+=0x186a0;}return _0x473831;}function getMinNorthing(_0x4b0c59){var _0x34c04b;switch(_0x4b0c59){case'C':_0x34c04b=0x10c8e0;break;case'D':_0x34c04b=0x1e8480;break;case'E':_0x34c04b=0x2ab980;break;case'F':_0x34c04b=0x387520;break;case'G':_0x34c04b=0x4630c0;break;case'H':_0x34c04b=0x53ec60;break;case'J':_0x34c04b=0x61a800;break;case'K':_0x34c04b=0x6f63a0;break;case'L':_0x34c04b=0x7d1f40;break;case'M':_0x34c04b=0x8adae0;break;case'N':_0x34c04b=0x0;break;case'P':_0x34c04b=0xc3500;break;case'Q':_0x34c04b=0x19f0a0;break;case'R':_0x34c04b=0x27ac40;break;case'S':_0x34c04b=0x3567e0;break;case'T':_0x34c04b=0x432380;break;case'U':_0x34c04b=0x50df20;break;case'V':_0x34c04b=0x5e9ac0;break;case'W':_0x34c04b=0x6acfc0;break;case'X':_0x34c04b=0x788b60;break;default:_0x34c04b=-0x1;}if(_0x34c04b>=0x0)return _0x34c04b;else throw'Invalid\x20zone\x20letter:\x20'+_0x4b0c59;}function Point(_0x1b8bff,_0x127ce5,_0x4b6f6f){const _0x496f49={_0x56fd16:0xf41},_0x469e61=_0x3d5d32;if(!(this instanceof Point))return new Point(_0x1b8bff,_0x127ce5,_0x4b6f6f);if(Array['isArray'](_0x1b8bff))this['x']=_0x1b8bff[0x0],this['y']=_0x1b8bff[0x1],this['z']=_0x1b8bff[0x2]||0x0;else{if(typeof _0x1b8bff==='object')this['x']=_0x1b8bff['x'],this['y']=_0x1b8bff['y'],this['z']=_0x1b8bff['z']||0x0;else{if(typeof _0x1b8bff==='string'&&typeof _0x127ce5==='undefined'){var _0x943926=_0x1b8bff['split'](',');this['x']=parseFloat(_0x943926[0x0],0xa),this['y']=parseFloat(_0x943926[0x1],0xa),this['z']=parseFloat(_0x943926[0x2],0xa)||0x0;}else this['x']=_0x1b8bff,this['y']=_0x127ce5,this['z']=_0x4b6f6f||0x0;}}console['warn'](_0x469e61(_0x496f49._0x56fd16));}Point['fromMGRS']=function(_0x11ac7e){return new Point(toPoint(_0x11ac7e));},Point['prototype']['toMGRS']=function(_0x2b2d77){return forward$t([this['x'],this['y']],_0x2b2d77);};var C00=0x1,C02=0.25,C04=0.046875,C06=0.01953125,C08=0.01068115234375,C22=0.75,C44=0.46875,C46=0.013020833333333334,C48=0.007120768229166667,C66=0.3645833333333333,C68=0.005696614583333333,C88=0.3076171875;function pj_enfn(_0x401eff){var _0x3749a0=[];_0x3749a0[0x0]=C00-_0x401eff*(C02+_0x401eff*(C04+_0x401eff*(C06+_0x401eff*C08))),_0x3749a0[0x1]=_0x401eff*(C22-_0x401eff*(C04+_0x401eff*(C06+_0x401eff*C08)));var _0x4f2d44=_0x401eff*_0x401eff;return _0x3749a0[0x2]=_0x4f2d44*(C44-_0x401eff*(C46+_0x401eff*C48)),_0x4f2d44*=_0x401eff,_0x3749a0[0x3]=_0x4f2d44*(C66-_0x401eff*C68),_0x3749a0[0x4]=_0x4f2d44*_0x401eff*C88,_0x3749a0;}function pj_mlfn(_0x3f30e5,_0x2221e3,_0x46bcb1,_0xd9b535){return _0x46bcb1*=_0x2221e3,_0x2221e3*=_0x2221e3,_0xd9b535[0x0]*_0x3f30e5-_0x46bcb1*(_0xd9b535[0x1]+_0x2221e3*(_0xd9b535[0x2]+_0x2221e3*(_0xd9b535[0x3]+_0x2221e3*_0xd9b535[0x4])));}var MAX_ITER$3=0x14;function pj_inv_mlfn(_0x54aa36,_0x2b3008,_0x34201a){const _0x3603c2={_0x52db6e:0x256},_0x398783=_0x3d5d32;var _0x23b58e=0x1/(0x1-_0x2b3008),_0x57df86=_0x54aa36;for(var _0x2b10e6=MAX_ITER$3;_0x2b10e6;--_0x2b10e6){var _0x426237=Math['sin'](_0x57df86),_0x2ba719=0x1-_0x2b3008*_0x426237*_0x426237;_0x2ba719=(pj_mlfn(_0x57df86,_0x426237,Math[_0x398783(_0x3603c2._0x52db6e)](_0x57df86),_0x34201a)-_0x54aa36)*(_0x2ba719*Math['sqrt'](_0x2ba719))*_0x23b58e,_0x57df86-=_0x2ba719;if(Math['abs'](_0x2ba719)=0x1){if(_0x3a7f5b-0x1>EPSLN)return 0x5d;else _0x28f3fb=0x0;}else _0x28f3fb=Math[_0x251ca0(0xe2f)](_0x28f3fb);_0x562df3<0x0&&(_0x28f3fb=-_0x28f3fb),_0x28f3fb=this['a']*this['k0']*(_0x28f3fb-this['lat0'])+this['y0'];}}else{var _0xe1616e=_0x272761*_0x454b1b,_0x59b490=Math['pow'](_0xe1616e,0x2),_0x1b5f8f=this['ep2']*Math['pow'](_0x272761,0x2),_0x3f0f33=Math[_0x251ca0(_0x29df6c._0xfd72d2)](_0x1b5f8f,0x2),_0x57042c=Math['abs'](_0x272761)>EPSLN?Math['tan'](_0x562df3):0x0,_0x2b15dd=Math['pow'](_0x57042c,0x2),_0x21bdd9=Math['pow'](_0x2b15dd,0x2);_0x6231fb=0x1-this['es']*Math[_0x251ca0(0x1fb)](_0x431fd5,0x2),_0xe1616e=_0xe1616e/Math['sqrt'](_0x6231fb);var _0x53d114=pj_mlfn(_0x562df3,_0x431fd5,_0x272761,this['en']);_0x1a1f4a=this['a']*(this['k0']*_0xe1616e*(0x1+_0x59b490/0x6*(0x1-_0x2b15dd+_0x1b5f8f+_0x59b490/0x14*(0x5-0x12*_0x2b15dd+_0x21bdd9+0xe*_0x1b5f8f-0x3a*_0x2b15dd*_0x1b5f8f+_0x59b490/0x2a*(0x3d+0xb3*_0x21bdd9-_0x21bdd9*_0x2b15dd-0x1df*_0x2b15dd)))))+this['x0'],_0x28f3fb=this['a']*(this['k0']*(_0x53d114-this['ml0']+_0x431fd5*_0x454b1b*_0xe1616e/0x2*(0x1+_0x59b490/0xc*(0x5-_0x2b15dd+0x9*_0x1b5f8f+0x4*_0x3f0f33+_0x59b490/0x1e*(0x3d+_0x21bdd9-0x3a*_0x2b15dd+0x10e*_0x1b5f8f-0x14a*_0x2b15dd*_0x1b5f8f+_0x59b490/0x38*(0x569+0x21f*_0x21bdd9-_0x21bdd9*_0x2b15dd-0xc27*_0x2b15dd))))))+this['y0'];}return _0x19e580['x']=_0x1a1f4a,_0x19e580['y']=_0x28f3fb,_0x19e580;}function inverse$s(_0x356419){const _0x1e1b98={_0x8b1a2d:0x1fb,_0x3510d9:0xec8,_0x802645:0x6c0,_0x541dde:0x1fb,_0x5214f1:0x7cd},_0x98975d=_0x3d5d32;var _0x5b5125,_0x21e041,_0x48b8d7,_0x96468a,_0x5b4fec=(_0x356419['x']-this['x0'])*(0x1/this['a']),_0x5c194b=(_0x356419['y']-this['y0'])*(0x1/this['a']);if(!this['es']){var _0x5b6b99=Math['exp'](_0x5b4fec/this['k0']),_0x334564=0.5*(_0x5b6b99-0x1/_0x5b6b99),_0x211934=this['lat0']+_0x5c194b/this['k0'],_0x1c4dec=Math['cos'](_0x211934);_0x5b5125=Math['sqrt']((0x1-Math[_0x98975d(_0x1e1b98._0x8b1a2d)](_0x1c4dec,0x2))/(0x1+Math['pow'](_0x334564,0x2))),_0x48b8d7=Math['asin'](_0x5b5125),_0x5c194b<0x0&&(_0x48b8d7=-_0x48b8d7),_0x334564===0x0&&_0x1c4dec===0x0?_0x96468a=0x0:_0x96468a=adjust_lon(Math[_0x98975d(_0x1e1b98._0x3510d9)](_0x334564,_0x1c4dec)+this['long0']);}else{_0x5b5125=this['ml0']+_0x5c194b/this['k0'],_0x21e041=pj_inv_mlfn(_0x5b5125,this['es'],this['en']);if(Math['abs'](_0x21e041)EPSLN?Math['tan'](_0x21e041):0x0,_0x513e11=this[_0x98975d(_0x1e1b98._0x802645)]*Math['pow'](_0x313f59,0x2),_0x47f980=Math[_0x98975d(_0x1e1b98._0x541dde)](_0x513e11,0x2),_0x409e70=Math['pow'](_0x64c2cd,0x2),_0x6a3444=Math[_0x98975d(_0x1e1b98._0x8b1a2d)](_0x409e70,0x2);_0x5b5125=0x1-this['es']*Math[_0x98975d(_0x1e1b98._0x541dde)](_0x294606,0x2);var _0x1f1afb=_0x5b4fec*Math[_0x98975d(0xae3)](_0x5b5125)/this['k0'],_0x474e84=Math['pow'](_0x1f1afb,0x2);_0x5b5125=_0x5b5125*_0x64c2cd,_0x48b8d7=_0x21e041-_0x5b5125*_0x474e84/(0x1-this['es'])*0.5*(0x1-_0x474e84/0xc*(0x5+0x3*_0x409e70-0x9*_0x513e11*_0x409e70+_0x513e11-0x4*_0x47f980-_0x474e84/0x1e*(0x3d+0x5a*_0x409e70-0xfc*_0x513e11*_0x409e70+0x2d*_0x6a3444+0x2e*_0x513e11-_0x474e84/0x38*(0x569+0xe31*_0x409e70+0xfff*_0x6a3444+0x626*_0x6a3444*_0x409e70)))),_0x96468a=adjust_lon(this[_0x98975d(_0x1e1b98._0x5214f1)]+_0x1f1afb*(0x1-_0x474e84/0x6*(0x1+0x2*_0x409e70+_0x513e11-_0x474e84/0x14*(0x5+0x1c*_0x409e70+0x18*_0x6a3444+0x8*_0x513e11*_0x409e70+0x6*_0x513e11-_0x474e84/0x2a*(0x3d+0x296*_0x409e70+0x528*_0x6a3444+0x2d0*_0x6a3444*_0x409e70))))/_0x313f59);}else _0x48b8d7=HALF_PI*sign(_0x5c194b),_0x96468a=0x0;}return _0x356419['x']=_0x96468a,_0x356419['y']=_0x48b8d7,_0x356419;}var names$t=['Fast_Transverse_Mercator','Fast\x20Transverse\x20Mercator'],tmerc={'init':init$t,'forward':forward$s,'inverse':inverse$s,'names':names$t};function sinh(_0x30347f){const _0x204fdf=_0x3d5d32;var _0x4847db=Math[_0x204fdf(0x102e)](_0x30347f);return _0x4847db=(_0x4847db-0x1/_0x4847db)/0x2,_0x4847db;}function hypot(_0x141f28,_0x259263){const _0x1a3c2={_0x8644c3:0xe8e},_0x52459f=_0x3d5d32;_0x141f28=Math['abs'](_0x141f28),_0x259263=Math['abs'](_0x259263);var _0x301dcb=Math[_0x52459f(_0x1a3c2._0x8644c3)](_0x141f28,_0x259263),_0x5dc13d=Math['min'](_0x141f28,_0x259263)/(_0x301dcb?_0x301dcb:0x1);return _0x301dcb*Math['sqrt'](0x1+Math['pow'](_0x5dc13d,0x2));}function log1py(_0x1cc095){const _0x268da6={_0x2d717b:0x7b1},_0x189e4c=_0x3d5d32;var _0x5f2d2b=0x1+_0x1cc095,_0x19080b=_0x5f2d2b-0x1;return _0x19080b===0x0?_0x1cc095:_0x1cc095*Math[_0x189e4c(_0x268da6._0x2d717b)](_0x5f2d2b)/_0x19080b;}function asinhy(_0x13ef05){var _0x3f0938=Math['abs'](_0x13ef05);return _0x3f0938=log1py(_0x3f0938*(0x1+_0x3f0938/(hypot(0x1,_0x3f0938)+0x1))),_0x13ef05<0x0?-_0x3f0938:_0x3f0938;}function gatg(_0x2da78c,_0x5914a2){const _0x53220d=_0x3d5d32;var _0x6da70a=0x2*Math[_0x53220d(0x256)](0x2*_0x5914a2),_0x29a4c9=_0x2da78c[_0x53220d(0xc84)]-0x1,_0x3e58ce=_0x2da78c[_0x29a4c9],_0x111e2a=0x0,_0x2b0690;while(--_0x29a4c9>=0x0){_0x2b0690=-_0x111e2a+_0x6da70a*_0x3e58ce+_0x2da78c[_0x29a4c9],_0x111e2a=_0x3e58ce,_0x3e58ce=_0x2b0690;}return _0x5914a2+_0x2b0690*Math['sin'](0x2*_0x5914a2);}function clens(_0x288480,_0x6998cc){var _0xb228cb=0x2*Math['cos'](_0x6998cc),_0x4639e1=_0x288480['length']-0x1,_0x360079=_0x288480[_0x4639e1],_0x455e9b=0x0,_0x470c65;while(--_0x4639e1>=0x0){_0x470c65=-_0x455e9b+_0xb228cb*_0x360079+_0x288480[_0x4639e1],_0x455e9b=_0x360079,_0x360079=_0x470c65;}return Math['sin'](_0x6998cc)*_0x470c65;}function cosh(_0x180ee3){var _0x1141b1=Math['exp'](_0x180ee3);return _0x1141b1=(_0x1141b1+0x1/_0x1141b1)/0x2,_0x1141b1;}function clens_cmplx(_0x17bff1,_0x4f834d,_0x2972fd){var _0x5d835f=Math['sin'](_0x4f834d),_0xf72c68=Math['cos'](_0x4f834d),_0x51633c=sinh(_0x2972fd),_0x56732d=cosh(_0x2972fd),_0x41bd64=0x2*_0xf72c68*_0x56732d,_0x2be66c=-0x2*_0x5d835f*_0x51633c,_0x7567e6=_0x17bff1['length']-0x1,_0x23f14d=_0x17bff1[_0x7567e6],_0xe315a3=0x0,_0x335adf=0x0,_0x130a41=0x0,_0x1e0dc4,_0x417dd9;while(--_0x7567e6>=0x0){_0x1e0dc4=_0x335adf,_0x417dd9=_0xe315a3,_0x335adf=_0x23f14d,_0xe315a3=_0x130a41,_0x23f14d=-_0x1e0dc4+_0x41bd64*_0x335adf-_0x2be66c*_0xe315a3+_0x17bff1[_0x7567e6],_0x130a41=-_0x417dd9+_0x2be66c*_0x335adf+_0x41bd64*_0xe315a3;}return _0x41bd64=_0x5d835f*_0x56732d,_0x2be66c=_0xf72c68*_0x51633c,[_0x41bd64*_0x23f14d-_0x2be66c*_0x130a41,_0x41bd64*_0x130a41+_0x2be66c*_0x23f14d];}function init$s(){const _0x280e5f={_0x523d58:0x82b,_0x539a6d:0x7cd,_0x4c16ea:0x7cd,_0x6e348f:0x61f,_0x56943c:0x7c3,_0x10cd5a:0xdb3,_0x58cd6d:0xa92,_0x538587:0xdb3},_0x587373=_0x3d5d32;if(!this['approx']&&(isNaN(this['es'])||this['es']<=0x0))throw new Error('Incorrect\x20elliptical\x20usage.\x20Try\x20using\x20the\x20+approx\x20option\x20in\x20the\x20proj\x20string,\x20or\x20PROJECTION[\x22Fast_Transverse_Mercator\x22]\x20in\x20the\x20WKT.');this['approx']&&(tmerc['init']['apply'](this),this['forward']=tmerc[_0x587373(_0x280e5f._0x523d58)],this['inverse']=tmerc['inverse']);this['x0']=this['x0']!==undefined?this['x0']:0x0,this['y0']=this['y0']!==undefined?this['y0']:0x0,this['long0']=this[_0x587373(_0x280e5f._0x539a6d)]!==undefined?this[_0x587373(_0x280e5f._0x4c16ea)]:0x0,this['lat0']=this['lat0']!==undefined?this['lat0']:0x0,this[_0x587373(0x7c3)]=[],this[_0x587373(_0x280e5f._0x6e348f)]=[],this[_0x587373(0xdb3)]=[],this[_0x587373(0xa92)]=[];var _0x4c0a04=this['es']/(0x1+Math['sqrt'](0x1-this['es'])),_0x2e5aa6=_0x4c0a04/(0x2-_0x4c0a04),_0x4324d9=_0x2e5aa6;this[_0x587373(_0x280e5f._0x56943c)][0x0]=_0x2e5aa6*(0x2+_0x2e5aa6*(-0x2/0x3+_0x2e5aa6*(-0x2+_0x2e5aa6*(0x74/0x2d+_0x2e5aa6*(0x1a/0x2d+_0x2e5aa6*(-0xb26/0x2a3)))))),this['cbg'][0x0]=_0x2e5aa6*(-0x2+_0x2e5aa6*(0x2/0x3+_0x2e5aa6*(0x4/0x3+_0x2e5aa6*(-0x52/0x2d+_0x2e5aa6*(0x20/0x2d+_0x2e5aa6*(0x1222/0x1275)))))),_0x4324d9=_0x4324d9*_0x2e5aa6,this['cgb'][0x1]=_0x4324d9*(0x7/0x3+_0x2e5aa6*(-0x8/0x5+_0x2e5aa6*(-0xe3/0x2d+_0x2e5aa6*(0xa90/0x13b+_0x2e5aa6*(0x913/0x3b1))))),this['cbg'][0x1]=_0x4324d9*(0x5/0x3+_0x2e5aa6*(-0x10/0xf+_0x2e5aa6*(-0xd/0x9+_0x2e5aa6*(0x388/0x13b+_0x2e5aa6*(-0x5f2/0x3b1))))),_0x4324d9=_0x4324d9*_0x2e5aa6,this[_0x587373(0x7c3)][0x2]=_0x4324d9*(0x38/0xf+_0x2e5aa6*(-0x88/0x23+_0x2e5aa6*(-0x4ee/0x69+_0x2e5aa6*(0x12056/0xb13)))),this['cbg'][0x2]=_0x4324d9*(-0x1a/0xf+_0x2e5aa6*(0x22/0x15+_0x2e5aa6*(0x8/0x5+_0x2e5aa6*(-0x318e/0xb13)))),_0x4324d9=_0x4324d9*_0x2e5aa6,this['cgb'][0x3]=_0x4324d9*(0x10b7/0x276+_0x2e5aa6*(-0x14c/0x23+_0x2e5aa6*(-0x618d4/0x375f))),this['cbg'][0x3]=_0x4324d9*(0x4d5/0x276+_0x2e5aa6*(-0xc/0x5+_0x2e5aa6*(-0x6100/0x375f))),_0x4324d9=_0x4324d9*_0x2e5aa6,this[_0x587373(_0x280e5f._0x56943c)][0x4]=_0x4324d9*(0x104e/0x13b+_0x2e5aa6*(-0x235c6/0x185d)),this['cbg'][0x4]=_0x4324d9*(-0x2de/0x13b+_0x2e5aa6*(0x1ac1e/0x79d1)),_0x4324d9=_0x4324d9*_0x2e5aa6,this['cgb'][0x5]=_0x4324d9*(0x92e4c/0x5703),this[_0x587373(_0x280e5f._0x6e348f)][0x5]=_0x4324d9*(0x6c7b1/0x26115),_0x4324d9=Math[_0x587373(0x1fb)](_0x2e5aa6,0x2),this['Qn']=this['k0']/(0x1+_0x2e5aa6)*(0x1+_0x4324d9*(0x1/0x4+_0x4324d9*(0x1/0x40+_0x4324d9/0x100))),this[_0x587373(_0x280e5f._0x10cd5a)][0x0]=_0x2e5aa6*(-0.5+_0x2e5aa6*(0x2/0x3+_0x2e5aa6*(-0x25/0x60+_0x2e5aa6*(0x1/0x168+_0x2e5aa6*(0x51/0x200+_0x2e5aa6*(-0x177c7/0x93a80)))))),this['gtu'][0x0]=_0x2e5aa6*(0.5+_0x2e5aa6*(-0x2/0x3+_0x2e5aa6*(0x5/0x10+_0x2e5aa6*(0x29/0xb4+_0x2e5aa6*(-0x7f/0x120+_0x2e5aa6*(0x1ed3/0x93a8)))))),this['utg'][0x1]=_0x4324d9*(-0x1/0x30+_0x2e5aa6*(-0x1/0xf+_0x2e5aa6*(0x1b5/0x5a0+_0x2e5aa6*(-0x2e/0x69+_0x2e5aa6*(0x1111f7/0x3b1000))))),this[_0x587373(_0x280e5f._0x58cd6d)][0x1]=_0x4324d9*(0xd/0x30+_0x2e5aa6*(-0x3/0x5+_0x2e5aa6*(0x22d/0x5a0+_0x2e5aa6*(0x119/0x276+_0x2e5aa6*(-0x1e43c9/0x1d8800))))),_0x4324d9=_0x4324d9*_0x2e5aa6,this['utg'][0x2]=_0x4324d9*(-0x11/0x1e0+_0x2e5aa6*(0x25/0x348+_0x2e5aa6*(0xd1/0x1180+_0x2e5aa6*(-0x15c1/0x16260)))),this['gtu'][0x2]=_0x4324d9*(0x3d/0xf0+_0x2e5aa6*(-0x67/0x8c+_0x2e5aa6*(0x3ad5/0x6900+_0x2e5aa6*(0x28eb3/0x2c4c0)))),_0x4324d9=_0x4324d9*_0x2e5aa6,this['utg'][0x3]=_0x4324d9*(-0x112d/0x27600+_0x2e5aa6*(0xb/0x1f8+_0x2e5aa6*(0xcab2b/0x6ebe00))),this['gtu'][0x3]=_0x4324d9*(0xc199/0x27600+_0x2e5aa6*(-0xb3/0xa8+_0x2e5aa6*(0x64bbbd/0x6ebe00))),_0x4324d9=_0x4324d9*_0x2e5aa6,this[_0x587373(_0x280e5f._0x538587)][0x4]=_0x4324d9*(-0x11e7/0x27600+_0x2e5aa6*(0x1a92f/0x3ce880)),this['gtu'][0x4]=_0x4324d9*(0x87a9/0x13b00+_0x2e5aa6*(-0x342b09/0x1e7440)),_0x4324d9=_0x4324d9*_0x2e5aa6,this['utg'][0x5]=_0x4324d9*(-0x13b12f5/0x26115000),this['gtu'][0x5]=_0x4324d9*(0xca8a53d/0x1308a800);var _0x301d1c=gatg(this[_0x587373(0x61f)],this[_0x587373(0xa41)]);this['Zb']=-this['Qn']*(_0x301d1c+clens(this['gtu'],0x2*_0x301d1c));}function forward$r(_0x450430){const _0x36e03e={_0x1ac08e:0x256,_0x1cd8c0:0x723},_0xfc7b26=_0x3d5d32;var _0xc95ab=adjust_lon(_0x450430['x']-this[_0xfc7b26(0x7cd)]),_0xd61efd=_0x450430['y'];_0xd61efd=gatg(this['cbg'],_0xd61efd);var _0xf9ad23=Math[_0xfc7b26(0x723)](_0xd61efd),_0x3c1dab=Math[_0xfc7b26(_0x36e03e._0x1ac08e)](_0xd61efd),_0x47b5e8=Math[_0xfc7b26(_0x36e03e._0x1cd8c0)](_0xc95ab),_0x4f998f=Math['cos'](_0xc95ab);_0xd61efd=Math[_0xfc7b26(0xec8)](_0xf9ad23,_0x4f998f*_0x3c1dab),_0xc95ab=Math['atan2'](_0x47b5e8*_0x3c1dab,hypot(_0xf9ad23,_0x3c1dab*_0x4f998f)),_0xc95ab=asinhy(Math['tan'](_0xc95ab));var _0x5311fe=clens_cmplx(this['gtu'],0x2*_0xd61efd,0x2*_0xc95ab);_0xd61efd=_0xd61efd+_0x5311fe[0x0],_0xc95ab=_0xc95ab+_0x5311fe[0x1];var _0x395cdf,_0x3242c2;return Math[_0xfc7b26(0x4ba)](_0xc95ab)<=2.623395162778?(_0x395cdf=this['a']*(this['Qn']*_0xc95ab)+this['x0'],_0x3242c2=this['a']*(this['Qn']*_0xd61efd+this['Zb'])+this['y0']):(_0x395cdf=Infinity,_0x3242c2=Infinity),_0x450430['x']=_0x395cdf,_0x450430['y']=_0x3242c2,_0x450430;}function inverse$r(_0x16aa79){const _0xdebca7=_0x3d5d32;var _0x2d1112=(_0x16aa79['x']-this['x0'])*(0x1/this['a']),_0x2f80c1=(_0x16aa79['y']-this['y0'])*(0x1/this['a']);_0x2f80c1=(_0x2f80c1-this['Zb'])/this['Qn'],_0x2d1112=_0x2d1112/this['Qn'];var _0x2f3e6a,_0x2b9091;if(Math['abs'](_0x2d1112)<=2.623395162778){var _0x5670bd=clens_cmplx(this['utg'],0x2*_0x2f80c1,0x2*_0x2d1112);_0x2f80c1=_0x2f80c1+_0x5670bd[0x0],_0x2d1112=_0x2d1112+_0x5670bd[0x1],_0x2d1112=Math['atan'](sinh(_0x2d1112));var _0x5ba67e=Math['sin'](_0x2f80c1),_0x56c62f=Math['cos'](_0x2f80c1),_0x4599a5=Math['sin'](_0x2d1112),_0x284a3a=Math['cos'](_0x2d1112);_0x2f80c1=Math[_0xdebca7(0xec8)](_0x5ba67e*_0x284a3a,hypot(_0x4599a5,_0x284a3a*_0x56c62f)),_0x2d1112=Math['atan2'](_0x4599a5,_0x284a3a*_0x56c62f),_0x2f3e6a=adjust_lon(_0x2d1112+this[_0xdebca7(0x7cd)]),_0x2b9091=gatg(this['cgb'],_0x2f80c1);}else _0x2f3e6a=Infinity,_0x2b9091=Infinity;return _0x16aa79['x']=_0x2f3e6a,_0x16aa79['y']=_0x2b9091,_0x16aa79;}var names$s=['Extended_Transverse_Mercator','Extended\x20Transverse\x20Mercator','etmerc',_0x3d5d32(0x2af),_0x3d5d32(0x108b),'tmerc'],etmerc={'init':init$s,'forward':forward$r,'inverse':inverse$r,'names':names$s};function adjust_zone(_0x3b7b7c,_0x2338ed){if(_0x3b7b7c===undefined){_0x3b7b7c=Math['floor']((adjust_lon(_0x2338ed)+Math['PI'])*0x1e/Math['PI'])+0x1;if(_0x3b7b7c<0x0)return 0x0;else{if(_0x3b7b7c>0x3c)return 0x3c;}}return _0x3b7b7c;}var dependsOn=_0x3d5d32(0xcdd);function init$r(){const _0x21348e={_0x20c57a:0x7cd,_0x3bb864:0x7cd},_0x3aaeb5=_0x3d5d32;var _0x3b3501=adjust_zone(this['zone'],this[_0x3aaeb5(_0x21348e._0x20c57a)]);if(_0x3b3501===undefined)throw new Error('unknown\x20utm\x20zone');this['lat0']=0x0,this[_0x3aaeb5(_0x21348e._0x3bb864)]=(0x6*Math[_0x3aaeb5(0x4ba)](_0x3b3501)-0xb7)*D2R$1,this['x0']=0x7a120,this['y0']=this['utmSouth']?0x989680:0x0,this['k0']=0.9996,etmerc['init']['apply'](this),this['forward']=etmerc[_0x3aaeb5(0x82b)],this['inverse']=etmerc['inverse'];}var names$r=[_0x3d5d32(0xb65),_0x3d5d32(0x638)],utm={'init':init$r,'names':names$r,'dependsOn':dependsOn};function _0x4132(_0xb8b916,_0x524e75){const _0x1bfe9b=_0x1bfe();return _0x4132=function(_0x41324d,_0x251dbb){_0x41324d=_0x41324d-0x1c9;let _0x3c8f93=_0x1bfe9b[_0x41324d];return _0x3c8f93;},_0x4132(_0xb8b916,_0x524e75);}function srat(_0x44dc7f,_0x5aa5af){return Math['pow']((0x1-_0x44dc7f)/(0x1+_0x44dc7f),_0x5aa5af);}var MAX_ITER$2=0x14;function init$q(){const _0x21a95f={_0x116ea3:0xb3e,_0x3b693f:0xdd3},_0x503cef=_0x3d5d32;var _0x4066eb=Math['sin'](this[_0x503cef(0xa41)]),_0x10d386=Math['cos'](this['lat0']);_0x10d386*=_0x10d386,this['rc']=Math['sqrt'](0x1-this['es'])/(0x1-this['es']*_0x4066eb*_0x4066eb),this['C']=Math[_0x503cef(0xae3)](0x1+this['es']*_0x10d386*_0x10d386/(0x1-this['es'])),this[_0x503cef(_0x21a95f._0x116ea3)]=Math['asin'](_0x4066eb/this['C']),this['ratexp']=0.5*this['C']*this['e'],this['K']=Math['tan'](0.5*this['phic0']+FORTPI)/(Math['pow'](Math[_0x503cef(_0x21a95f._0x3b693f)](0.5*this[_0x503cef(0xa41)]+FORTPI),this['C'])*srat(this['e']*_0x4066eb,this['ratexp']));}function forward$q(_0x447470){const _0xd91044=_0x3d5d32;var _0x2def9a=_0x447470['x'],_0x28c6b9=_0x447470['y'];return _0x447470['y']=0x2*Math['atan'](this['K']*Math['pow'](Math[_0xd91044(0xdd3)](0.5*_0x28c6b9+FORTPI),this['C'])*srat(this['e']*Math[_0xd91044(0x723)](_0x28c6b9),this['ratexp']))-HALF_PI,_0x447470['x']=this['C']*_0x2def9a,_0x447470;}function inverse$q(_0x5c4d7f){var _0x300383=1e-14,_0x88da60=_0x5c4d7f['x']/this['C'],_0x9f55b2=_0x5c4d7f['y'],_0x4ac09f=Math['pow'](Math['tan'](0.5*_0x9f55b2+FORTPI)/this['K'],0x1/this['C']);for(var _0xa1aacb=MAX_ITER$2;_0xa1aacb>0x0;--_0xa1aacb){_0x9f55b2=0x2*Math['atan'](_0x4ac09f*srat(this['e']*Math['sin'](_0x5c4d7f['y']),-0.5*this['e']))-HALF_PI;if(Math['abs'](_0x9f55b2-_0x5c4d7f['y'])<_0x300383)break;_0x5c4d7f['y']=_0x9f55b2;}if(!_0xa1aacb)return null;return _0x5c4d7f['x']=_0x88da60,_0x5c4d7f['y']=_0x9f55b2,_0x5c4d7f;}var names$q=['gauss'],gauss={'init':init$q,'forward':forward$q,'inverse':inverse$q,'names':names$q};function init$p(){const _0x328994={_0x39e4ca:0x723},_0x46b12=_0x3d5d32;gauss['init']['apply'](this);if(!this['rc'])return;this['sinc0']=Math[_0x46b12(_0x328994._0x39e4ca)](this[_0x46b12(0xb3e)]),this['cosc0']=Math['cos'](this['phic0']),this['R2']=0x2*this['rc'],!this['title']&&(this['title']='Oblique\x20Stereographic\x20Alternative');}function forward$p(_0x2614a1){const _0x355a0e={_0xf5c0a6:0x256},_0x59ff18=_0x3d5d32;var _0x363f18,_0x4fc535,_0xc267d9,_0x595fbd;return _0x2614a1['x']=adjust_lon(_0x2614a1['x']-this[_0x59ff18(0x7cd)]),gauss['forward']['apply'](this,[_0x2614a1]),_0x363f18=Math[_0x59ff18(0x723)](_0x2614a1['y']),_0x4fc535=Math['cos'](_0x2614a1['y']),_0xc267d9=Math[_0x59ff18(_0x355a0e._0xf5c0a6)](_0x2614a1['x']),_0x595fbd=this['k0']*this['R2']/(0x1+this['sinc0']*_0x363f18+this['cosc0']*_0x4fc535*_0xc267d9),_0x2614a1['x']=_0x595fbd*_0x4fc535*Math[_0x59ff18(0x723)](_0x2614a1['x']),_0x2614a1['y']=_0x595fbd*(this[_0x59ff18(0xc5e)]*_0x363f18-this['sinc0']*_0x4fc535*_0xc267d9),_0x2614a1['x']=this['a']*_0x2614a1['x']+this['x0'],_0x2614a1['y']=this['a']*_0x2614a1['y']+this['y0'],_0x2614a1;}function inverse$p(_0x1a8775){const _0x55f5e7={_0x143fad:0xec8,_0x2d8336:0x618},_0x486fe3=_0x3d5d32;var _0x329fdb,_0x13fbdf,_0xfe5acf,_0x5c2250,_0x2ff50e;_0x1a8775['x']=(_0x1a8775['x']-this['x0'])/this['a'],_0x1a8775['y']=(_0x1a8775['y']-this['y0'])/this['a'],_0x1a8775['x']/=this['k0'],_0x1a8775['y']/=this['k0'];if(_0x2ff50e=Math['sqrt'](_0x1a8775['x']*_0x1a8775['x']+_0x1a8775['y']*_0x1a8775['y'])){var _0x575e64=0x2*Math[_0x486fe3(_0x55f5e7._0x143fad)](_0x2ff50e,this['R2']);_0x329fdb=Math['sin'](_0x575e64),_0x13fbdf=Math['cos'](_0x575e64),_0x5c2250=Math[_0x486fe3(_0x55f5e7._0x2d8336)](_0x13fbdf*this['sinc0']+_0x1a8775['y']*_0x329fdb*this['cosc0']/_0x2ff50e),_0xfe5acf=Math['atan2'](_0x1a8775['x']*_0x329fdb,_0x2ff50e*this['cosc0']*_0x13fbdf-_0x1a8775['y']*this['sinc0']*_0x329fdb);}else _0x5c2250=this['phic0'],_0xfe5acf=0x0;return _0x1a8775['x']=_0xfe5acf,_0x1a8775['y']=_0x5c2250,gauss['inverse']['apply'](this,[_0x1a8775]),_0x1a8775['x']=adjust_lon(_0x1a8775['x']+this['long0']),_0x1a8775;}var names$p=['Stereographic_North_Pole','Oblique_Stereographic',_0x3d5d32(0x465),'sterea',_0x3d5d32(0xca3),'Double_Stereographic'],sterea={'init':init$p,'forward':forward$p,'inverse':inverse$p,'names':names$p};function ssfn_(_0x18a9c4,_0x19eb84,_0x11a531){const _0x1e3c56={_0x5dd0f0:0xdd3},_0x830b85=_0x3d5d32;return _0x19eb84*=_0x11a531,Math[_0x830b85(_0x1e3c56._0x5dd0f0)](0.5*(HALF_PI+_0x18a9c4))*Math['pow']((0x1-_0x19eb84)/(0x1+_0x19eb84),0.5*_0x11a531);}function init$o(){const _0x2cce6e={_0x51aae:0xaa0,_0x5910d2:0x4ba,_0x2a7c4e:0xa41,_0x3db5ae:0xca9,_0xd4088f:0xfb1,_0x3a1469:0x4ee},_0x48cbdb=_0x3d5d32;this['coslat0']=Math['cos'](this[_0x48cbdb(0xa41)]),this['sinlat0']=Math[_0x48cbdb(0x723)](this['lat0']),this[_0x48cbdb(_0x2cce6e._0x51aae)]?this['k0']===0x1&&!isNaN(this['lat_ts'])&&Math[_0x48cbdb(_0x2cce6e._0x5910d2)](this['coslat0'])<=EPSLN&&(this['k0']=0.5*(0x1+sign(this[_0x48cbdb(_0x2cce6e._0x2a7c4e)])*Math[_0x48cbdb(0x723)](this['lat_ts']))):(Math['abs'](this['coslat0'])<=EPSLN&&(this['lat0']>0x0?this['con']=0x1:this[_0x48cbdb(_0x2cce6e._0x3db5ae)]=-0x1),this['cons']=Math['sqrt'](Math['pow'](0x1+this['e'],0x1+this['e'])*Math['pow'](0x1-this['e'],0x1-this['e'])),this['k0']===0x1&&!isNaN(this['lat_ts'])&&Math['abs'](this[_0x48cbdb(0x67a)])<=EPSLN&&(this['k0']=0.5*this['cons']*msfnz(this['e'],Math['sin'](this['lat_ts']),Math['cos'](this['lat_ts']))/tsfnz(this['e'],this['con']*this[_0x48cbdb(_0x2cce6e._0xd4088f)],this[_0x48cbdb(0xca9)]*Math[_0x48cbdb(0x723)](this['lat_ts']))),this[_0x48cbdb(_0x2cce6e._0x3a1469)]=msfnz(this['e'],this['sinlat0'],this['coslat0']),this['X0']=0x2*Math['atan'](this['ssfn_'](this['lat0'],this['sinlat0'],this['e']))-HALF_PI,this[_0x48cbdb(0x2e4)]=Math['cos'](this['X0']),this[_0x48cbdb(0x616)]=Math['sin'](this['X0']));}function forward$o(_0x16649e){const _0x506dd3={_0x1ca45d:0x67a,_0x35c890:0x256,_0xdd3e2d:0x4ba,_0x536ae6:0x256},_0x50198e=_0x3d5d32;var _0x396a2b=_0x16649e['x'],_0x472ccd=_0x16649e['y'],_0x15feb2=Math['sin'](_0x472ccd),_0x14bdbe=Math['cos'](_0x472ccd),_0x3e84d6,_0xb273d0,_0x3cceaf,_0x5461b8,_0x1ca03f,_0x5e5358,_0x135ade=adjust_lon(_0x396a2b-this['long0']);if(Math['abs'](Math['abs'](_0x396a2b-this['long0'])-Math['PI'])<=EPSLN&&Math['abs'](_0x472ccd+this['lat0'])<=EPSLN)return _0x16649e['x']=NaN,_0x16649e['y']=NaN,_0x16649e;if(this['sphere'])return _0x3e84d6=0x2*this['k0']/(0x1+this['sinlat0']*_0x15feb2+this['coslat0']*_0x14bdbe*Math['cos'](_0x135ade)),_0x16649e['x']=this['a']*_0x3e84d6*_0x14bdbe*Math['sin'](_0x135ade)+this['x0'],_0x16649e['y']=this['a']*_0x3e84d6*(this[_0x50198e(_0x506dd3._0x1ca45d)]*_0x15feb2-this[_0x50198e(0xfed)]*_0x14bdbe*Math['cos'](_0x135ade))+this['y0'],_0x16649e;else{_0xb273d0=0x2*Math['atan'](this['ssfn_'](_0x472ccd,_0x15feb2,this['e']))-HALF_PI,_0x5461b8=Math['cos'](_0xb273d0),_0x3cceaf=Math['sin'](_0xb273d0);if(Math['abs'](this['coslat0'])<=EPSLN)return _0x1ca03f=tsfnz(this['e'],_0x472ccd*this['con'],this['con']*_0x15feb2),_0x5e5358=0x2*this['a']*this['k0']*_0x1ca03f/this['cons'],_0x16649e['x']=this['x0']+_0x5e5358*Math['sin'](_0x396a2b-this[_0x50198e(0x7cd)]),_0x16649e['y']=this['y0']-this[_0x50198e(0xca9)]*_0x5e5358*Math[_0x50198e(_0x506dd3._0x35c890)](_0x396a2b-this['long0']),_0x16649e;else Math[_0x50198e(_0x506dd3._0xdd3e2d)](this['sinlat0'])0x0?_0x3ac772=adjust_lon(this['long0']+Math['atan2'](_0x5de957['x'],-0x1*_0x5de957['y'])):_0x3ac772=adjust_lon(this['long0']+Math[_0x3dd204(0xec8)](_0x5de957['x'],_0x5de957['y'])):_0x3ac772=adjust_lon(this[_0x3dd204(0x7cd)]+Math[_0x3dd204(_0x325159._0x519201)](_0x5de957['x']*Math['sin'](_0x744f77),_0x3d770f*this['coslat0']*Math['cos'](_0x744f77)-_0x5de957['y']*this['sinlat0']*Math[_0x3dd204(_0x325159._0xb36643)](_0x744f77))),_0x5de957['x']=_0x3ac772,_0x5de957['y']=_0x2c98da,_0x5de957;}else{if(Math['abs'](this['coslat0'])<=EPSLN){if(_0x3d770f<=EPSLN)return _0x2c98da=this['lat0'],_0x3ac772=this[_0x3dd204(_0x325159._0x9b3bff)],_0x5de957['x']=_0x3ac772,_0x5de957['y']=_0x2c98da,_0x5de957;_0x5de957['x']*=this[_0x3dd204(0xca9)],_0x5de957['y']*=this['con'],_0x4735b2=_0x3d770f*this['cons']/(0x2*this['a']*this['k0']),_0x2c98da=this['con']*phi2z(this['e'],_0x4735b2),_0x3ac772=this[_0x3dd204(_0x325159._0x5b4e7b)]*adjust_lon(this[_0x3dd204(0xca9)]*this['long0']+Math['atan2'](_0x5de957['x'],-0x1*_0x5de957['y']));}else _0x31f22b=0x2*Math['atan'](_0x3d770f*this[_0x3dd204(0x2e4)]/(0x2*this['a']*this['k0']*this[_0x3dd204(0x4ee)])),_0x3ac772=this['long0'],_0x3d770f<=EPSLN?_0x5f2b54=this['X0']:(_0x5f2b54=Math['asin'](Math[_0x3dd204(0x256)](_0x31f22b)*this['sinX0']+_0x5de957['y']*Math['sin'](_0x31f22b)*this[_0x3dd204(0x2e4)]/_0x3d770f),_0x3ac772=adjust_lon(this['long0']+Math[_0x3dd204(0xec8)](_0x5de957['x']*Math['sin'](_0x31f22b),_0x3d770f*this['cosX0']*Math[_0x3dd204(0x256)](_0x31f22b)-_0x5de957['y']*this['sinX0']*Math['sin'](_0x31f22b)))),_0x2c98da=-0x1*phi2z(this['e'],Math[_0x3dd204(_0x325159._0x218c14)](0.5*(HALF_PI+_0x5f2b54)));}return _0x5de957['x']=_0x3ac772,_0x5de957['y']=_0x2c98da,_0x5de957;}var names$o=[_0x3d5d32(0x766),_0x3d5d32(0x5a0),_0x3d5d32(0x75b)],stere={'init':init$o,'forward':forward$o,'inverse':inverse$o,'names':names$o,'ssfn_':ssfn_};function init$n(){const _0x1e92a1={_0x15b9bc:0x1fb,_0x32035a:0x24b,_0x53be59:0xae3,_0x480bdd:0x24b},_0x2afec2=_0x3d5d32;var _0x3b6a7a=this['lat0'];this[_0x2afec2(0x1db)]=this['long0'];var _0x14d1d4=Math['sin'](_0x3b6a7a),_0x338f24=this['a'],_0x40bcc7=this['rf'],_0x42b820=0x1/_0x40bcc7,_0x3aacc4=0x2*_0x42b820-Math['pow'](_0x42b820,0x2),_0x393488=this['e']=Math[_0x2afec2(0xae3)](_0x3aacc4);this['R']=this['k0']*_0x338f24*Math['sqrt'](0x1-_0x3aacc4)/(0x1-_0x3aacc4*Math[_0x2afec2(_0x1e92a1._0x15b9bc)](_0x14d1d4,0x2)),this[_0x2afec2(_0x1e92a1._0x32035a)]=Math[_0x2afec2(_0x1e92a1._0x53be59)](0x1+_0x3aacc4/(0x1-_0x3aacc4)*Math[_0x2afec2(_0x1e92a1._0x15b9bc)](Math[_0x2afec2(0x256)](_0x3b6a7a),0x4)),this['b0']=Math['asin'](_0x14d1d4/this['alpha']);var _0x4307a7=Math['log'](Math['tan'](Math['PI']/0x4+this['b0']/0x2)),_0x3fed5e=Math['log'](Math['tan'](Math['PI']/0x4+_0x3b6a7a/0x2)),_0x5d49a0=Math['log']((0x1+_0x393488*_0x14d1d4)/(0x1-_0x393488*_0x14d1d4));this['K']=_0x4307a7-this[_0x2afec2(_0x1e92a1._0x480bdd)]*_0x3fed5e+this['alpha']*_0x393488/0x2*_0x5d49a0;}function forward$n(_0x584fcf){const _0x35fe08={_0x538c8d:0x7b1,_0x35b0b0:0xdd3,_0x1c3bab:0x24b,_0x4611fc:0x1db,_0x2fbeeb:0x256,_0x5147d0:0x618},_0x10fd92=_0x3d5d32;var _0x11acab=Math[_0x10fd92(_0x35fe08._0x538c8d)](Math[_0x10fd92(_0x35fe08._0x35b0b0)](Math['PI']/0x4-_0x584fcf['y']/0x2)),_0x237305=this['e']/0x2*Math['log']((0x1+this['e']*Math['sin'](_0x584fcf['y']))/(0x1-this['e']*Math['sin'](_0x584fcf['y']))),_0x1fbfd3=-this['alpha']*(_0x11acab+_0x237305)+this['K'],_0x5e18b1=0x2*(Math['atan'](Math['exp'](_0x1fbfd3))-Math['PI']/0x4),_0x4c9e2c=this[_0x10fd92(_0x35fe08._0x1c3bab)]*(_0x584fcf['x']-this[_0x10fd92(_0x35fe08._0x4611fc)]),_0x558244=Math['atan'](Math['sin'](_0x4c9e2c)/(Math['sin'](this['b0'])*Math['tan'](_0x5e18b1)+Math['cos'](this['b0'])*Math[_0x10fd92(_0x35fe08._0x2fbeeb)](_0x4c9e2c))),_0x3d65b0=Math[_0x10fd92(_0x35fe08._0x5147d0)](Math['cos'](this['b0'])*Math['sin'](_0x5e18b1)-Math['sin'](this['b0'])*Math['cos'](_0x5e18b1)*Math['cos'](_0x4c9e2c));return _0x584fcf['y']=this['R']/0x2*Math['log']((0x1+Math['sin'](_0x3d65b0))/(0x1-Math['sin'](_0x3d65b0)))+this['y0'],_0x584fcf['x']=this['R']*_0x558244+this['x0'],_0x584fcf;}function inverse$n(_0x5e0573){const _0x13ac56={_0x50d19d:0x723,_0x15b532:0xdd3,_0x405523:0x7b1},_0x2ad1a2=_0x3d5d32;var _0x174c08=_0x5e0573['x']-this['x0'],_0x3d638b=_0x5e0573['y']-this['y0'],_0x2eee5c=_0x174c08/this['R'],_0x16ee2f=0x2*(Math[_0x2ad1a2(0x106c)](Math['exp'](_0x3d638b/this['R']))-Math['PI']/0x4),_0x5ce73c=Math['asin'](Math['cos'](this['b0'])*Math['sin'](_0x16ee2f)+Math['sin'](this['b0'])*Math['cos'](_0x16ee2f)*Math['cos'](_0x2eee5c)),_0x1ffc0c=Math['atan'](Math['sin'](_0x2eee5c)/(Math['cos'](this['b0'])*Math[_0x2ad1a2(0x256)](_0x2eee5c)-Math[_0x2ad1a2(_0x13ac56._0x50d19d)](this['b0'])*Math['tan'](_0x16ee2f))),_0x221648=this['lambda0']+_0x1ffc0c/this['alpha'],_0xcd797b=0x0,_0x368802=_0x5ce73c,_0x416237=-0x3e8,_0xf95324=0x0;while(Math['abs'](_0x368802-_0x416237)>1e-7){if(++_0xf95324>0x14)return;_0xcd797b=0x1/this['alpha']*(Math['log'](Math[_0x2ad1a2(_0x13ac56._0x15b532)](Math['PI']/0x4+_0x5ce73c/0x2))-this['K'])+this['e']*Math[_0x2ad1a2(_0x13ac56._0x405523)](Math[_0x2ad1a2(_0x13ac56._0x15b532)](Math['PI']/0x4+Math['asin'](this['e']*Math['sin'](_0x368802))/0x2)),_0x416237=_0x368802,_0x368802=0x2*Math['atan'](Math['exp'](_0xcd797b))-Math['PI']/0x2;}return _0x5e0573['x']=_0x221648,_0x5e0573['y']=_0x368802,_0x5e0573;}var names$n=['somerc'],somerc={'init':init$n,'forward':forward$n,'inverse':inverse$n,'names':names$n},TOL=1e-7;function isTypeA(_0x2a7944){var _0x2a5e1e=['Hotine_Oblique_Mercator','Hotine_Oblique_Mercator_Azimuth_Natural_Origin'],_0x20ee35=typeof _0x2a7944['PROJECTION']==='object'?Object['keys'](_0x2a7944['PROJECTION'])[0x0]:_0x2a7944['PROJECTION'];return'no_uoff'in _0x2a7944||'no_off'in _0x2a7944||_0x2a5e1e['indexOf'](_0x20ee35)!==-0x1;}function init$m(){const _0x2f6a24={_0x10cc0d:0x4ba,_0x3a02ff:0xae3,_0x2ea993:0x4ba,_0x2db431:0x1fb,_0x2bd6bf:0xc58,_0x1dc195:0x256,_0x4c7ddf:0x5b9,_0x28e476:0x7b1},_0x5cd1db=_0x3d5d32;var _0x1c7292,_0x153d97,_0x312fc1,_0x160e42,_0x104d01,_0x39717b,_0x315ab1,_0x2159a9,_0x427892,_0x460c1f,_0x3c6580=0x0,_0xe425a5,_0x2c8f7a=0x0,_0x3ea84a=0x0,_0x6a1ac7=0x0,_0x330fff=0x0,_0x4ad035=0x0,_0x484675=0x0;this['no_off']=isTypeA(this),this[_0x5cd1db(0xa12)]='no_rot'in this;var _0x3411fc=![];'alpha'in this&&(_0x3411fc=!![]);var _0x34202d=![];_0x5cd1db(0x975)in this&&(_0x34202d=!![]);_0x3411fc&&(_0x484675=this['alpha']);_0x34202d&&(_0x3c6580=this['rectified_grid_angle']*D2R$1);if(_0x3411fc||_0x34202d)_0x2c8f7a=this['longc'];else{_0x3ea84a=this[_0x5cd1db(0xeb9)],_0x330fff=this[_0x5cd1db(0x4a2)],_0x6a1ac7=this['long2'],_0x4ad035=this['lat2'];if(Math[_0x5cd1db(_0x2f6a24._0x10cc0d)](_0x330fff-_0x4ad035)<=TOL||(_0x1c7292=Math['abs'](_0x330fff))<=TOL||Math['abs'](_0x1c7292-HALF_PI)<=TOL||Math['abs'](Math['abs'](this['lat0'])-HALF_PI)<=TOL||Math[_0x5cd1db(0x4ba)](Math['abs'](_0x4ad035)-HALF_PI)<=TOL)throw new Error();}var _0x104291=0x1-this['es'];_0x153d97=Math[_0x5cd1db(_0x2f6a24._0x3a02ff)](_0x104291);Math[_0x5cd1db(_0x2f6a24._0x2ea993)](this['lat0'])>EPSLN?(_0x2159a9=Math['sin'](this['lat0']),_0x312fc1=Math['cos'](this['lat0']),_0x1c7292=0x1-this['es']*_0x2159a9*_0x2159a9,this['B']=_0x312fc1*_0x312fc1,this['B']=Math[_0x5cd1db(0xae3)](0x1+this['es']*this['B']*this['B']/_0x104291),this['A']=this['B']*this['k0']*_0x153d97/_0x1c7292,_0x160e42=this['B']*_0x153d97/(_0x312fc1*Math['sqrt'](_0x1c7292)),_0x104d01=_0x160e42*_0x160e42-0x1,_0x104d01<=0x0?_0x104d01=0x0:(_0x104d01=Math['sqrt'](_0x104d01),this['lat0']<0x0&&(_0x104d01=-_0x104d01)),this['E']=_0x104d01+=_0x160e42,this['E']*=Math[_0x5cd1db(0x1fb)](tsfnz(this['e'],this['lat0'],_0x2159a9),this['B'])):(this['B']=0x1/_0x153d97,this['A']=this['k0'],this['E']=_0x160e42=_0x104d01=0x1);if(_0x3411fc||_0x34202d)_0x3411fc?(_0xe425a5=Math[_0x5cd1db(0x618)](Math['sin'](_0x484675)/_0x160e42),!_0x34202d&&(_0x3c6580=_0x484675)):(_0xe425a5=_0x3c6580,_0x484675=Math[_0x5cd1db(0x618)](_0x160e42*Math['sin'](_0xe425a5))),this['lam0']=_0x2c8f7a-Math['asin'](0.5*(_0x104d01-0x1/_0x104d01)*Math['tan'](_0xe425a5))/this['B'];else{_0x39717b=Math['pow'](tsfnz(this['e'],_0x330fff,Math['sin'](_0x330fff)),this['B']),_0x315ab1=Math[_0x5cd1db(_0x2f6a24._0x2db431)](tsfnz(this['e'],_0x4ad035,Math['sin'](_0x4ad035)),this['B']),_0x104d01=this['E']/_0x39717b,_0x427892=(_0x315ab1-_0x39717b)/(_0x315ab1+_0x39717b),_0x460c1f=this['E']*this['E'],_0x460c1f=(_0x460c1f-_0x315ab1*_0x39717b)/(_0x460c1f+_0x315ab1*_0x39717b),_0x1c7292=_0x3ea84a-_0x6a1ac7;if(_0x1c7292<-Math['pi'])_0x6a1ac7-=TWO_PI;else _0x1c7292>Math['pi']&&(_0x6a1ac7+=TWO_PI);this['lam0']=adjust_lon(0.5*(_0x3ea84a+_0x6a1ac7)-Math['atan'](_0x460c1f*Math['tan'](0.5*this['B']*(_0x3ea84a-_0x6a1ac7))/_0x427892)/this['B']),_0xe425a5=Math['atan'](0x2*Math['sin'](this['B']*adjust_lon(_0x3ea84a-this[_0x5cd1db(0xb6f)]))/(_0x104d01-0x1/_0x104d01)),_0x3c6580=_0x484675=Math['asin'](_0x160e42*Math['sin'](_0xe425a5));}this[_0x5cd1db(0x31c)]=Math[_0x5cd1db(0x723)](_0xe425a5),this[_0x5cd1db(_0x2f6a24._0x2bd6bf)]=Math[_0x5cd1db(_0x2f6a24._0x1dc195)](_0xe425a5),this['sinrot']=Math['sin'](_0x3c6580),this[_0x5cd1db(0xbb7)]=Math[_0x5cd1db(_0x2f6a24._0x1dc195)](_0x3c6580),this['rB']=0x1/this['B'],this['ArB']=this['A']*this['rB'],this['BrA']=0x1/this['ArB'],this['A']*this['B'],this['no_off']?this[_0x5cd1db(_0x2f6a24._0x4c7ddf)]=0x0:(this[_0x5cd1db(_0x2f6a24._0x4c7ddf)]=Math['abs'](this['ArB']*Math['atan'](Math['sqrt'](_0x160e42*_0x160e42-0x1)/Math[_0x5cd1db(_0x2f6a24._0x1dc195)](_0x484675))),this['lat0']<0x0&&(this['u_0']=-this['u_0'])),_0x104d01=0.5*_0xe425a5,this[_0x5cd1db(0xecb)]=this['ArB']*Math[_0x5cd1db(_0x2f6a24._0x28e476)](Math['tan'](FORTPI-_0x104d01)),this['v_pole_s']=this['ArB']*Math['log'](Math['tan'](FORTPI+_0x104d01));}function forward$m(_0x585f00){const _0x15a9cd={_0x41d3f6:0x7b1,_0x1261fd:0x475,_0x562585:0xbb7},_0x184b7b=_0x3d5d32;var _0x4cedfa={},_0x4a79b8,_0x4f596a,_0x52bdf0,_0x776dc8,_0x1fd163,_0x2e365d,_0x228945,_0x47271e;_0x585f00['x']=_0x585f00['x']-this['lam0'];if(Math['abs'](Math[_0x184b7b(0x4ba)](_0x585f00['y'])-HALF_PI)>EPSLN){_0x1fd163=this['E']/Math['pow'](tsfnz(this['e'],_0x585f00['y'],Math['sin'](_0x585f00['y'])),this['B']),_0x2e365d=0x1/_0x1fd163,_0x4a79b8=0.5*(_0x1fd163-_0x2e365d),_0x4f596a=0.5*(_0x1fd163+_0x2e365d),_0x776dc8=Math['sin'](this['B']*_0x585f00['x']),_0x52bdf0=(_0x4a79b8*this['singam']-_0x776dc8*this['cosgam'])/_0x4f596a;if(Math['abs'](Math['abs'](_0x52bdf0)-0x1)0x0?this['v_pole_n']:this[_0x184b7b(0x396)],_0x228945=this[_0x184b7b(_0x15a9cd._0x1261fd)]*_0x585f00['y'];return this[_0x184b7b(0xa12)]?(_0x4cedfa['x']=_0x228945,_0x4cedfa['y']=_0x47271e):(_0x228945-=this['u_0'],_0x4cedfa['x']=_0x47271e*this[_0x184b7b(_0x15a9cd._0x562585)]+_0x228945*this['sinrot'],_0x4cedfa['y']=_0x228945*this[_0x184b7b(_0x15a9cd._0x562585)]-_0x47271e*this['sinrot']),_0x4cedfa['x']=this['a']*_0x4cedfa['x']+this['x0'],_0x4cedfa['y']=this['a']*_0x4cedfa['y']+this['y0'],_0x4cedfa;}function inverse$m(_0x5a9650){const _0x4c7c56={_0x358a81:0xc58,_0x50ae0a:0x31c},_0x41bd9f=_0x3d5d32;var _0x1c7568,_0xac15d6,_0x242258,_0x5bc898,_0xd718e5,_0x26ae25,_0x147ac1,_0x5536a3={};_0x5a9650['x']=(_0x5a9650['x']-this['x0'])*(0x1/this['a']),_0x5a9650['y']=(_0x5a9650['y']-this['y0'])*(0x1/this['a']);this[_0x41bd9f(0xa12)]?(_0xac15d6=_0x5a9650['y'],_0x1c7568=_0x5a9650['x']):(_0xac15d6=_0x5a9650['x']*this['cosrot']-_0x5a9650['y']*this['sinrot'],_0x1c7568=_0x5a9650['y']*this['cosrot']+_0x5a9650['x']*this['sinrot']+this['u_0']);_0x242258=Math['exp'](-this['BrA']*_0xac15d6),_0x5bc898=0.5*(_0x242258-0x1/_0x242258),_0xd718e5=0.5*(_0x242258+0x1/_0x242258),_0x26ae25=Math['sin'](this['BrA']*_0x1c7568),_0x147ac1=(_0x26ae25*this[_0x41bd9f(0xc58)]+_0x5bc898*this['singam'])/_0xd718e5;if(Math['abs'](Math['abs'](_0x147ac1)-0x1)EPSLN?this['ns']=Math['log'](_0xcda850/_0x4abf00)/Math['log'](_0x410ead/_0x58159f):this['ns']=_0x4b05ae,isNaN(this['ns'])&&(this['ns']=_0x4b05ae),this['f0']=_0xcda850/(this['ns']*Math['pow'](_0x410ead,this['ns'])),this['rh']=this['a']*this['f0']*Math['pow'](_0x16608c,this['ns']),!this[_0x6ebc8b(_0x332c8d._0x52cdd9)]&&(this[_0x6ebc8b(0xd50)]='Lambert\x20Conformal\x20Conic');}function forward$l(_0x4aa1c6){const _0x50429c={_0x4c8cb6:0x7cd},_0x248b8d=_0x3d5d32;var _0x474e73=_0x4aa1c6['x'],_0x4df26b=_0x4aa1c6['y'];Math['abs'](0x2*Math['abs'](_0x4df26b)-Math['PI'])<=EPSLN&&(_0x4df26b=sign(_0x4df26b)*(HALF_PI-0x2*EPSLN));var _0x3fa4d5=Math['abs'](Math['abs'](_0x4df26b)-HALF_PI),_0x1d7504,_0x52fe33;if(_0x3fa4d5>EPSLN)_0x1d7504=tsfnz(this['e'],_0x4df26b,Math['sin'](_0x4df26b)),_0x52fe33=this['a']*this['f0']*Math['pow'](_0x1d7504,this['ns']);else{_0x3fa4d5=_0x4df26b*this['ns'];if(_0x3fa4d5<=0x0)return null;_0x52fe33=0x0;}var _0x106068=this['ns']*adjust_lon(_0x474e73-this[_0x248b8d(_0x50429c._0x4c8cb6)]);return _0x4aa1c6['x']=this['k0']*(_0x52fe33*Math['sin'](_0x106068))+this['x0'],_0x4aa1c6['y']=this['k0']*(this['rh']-_0x52fe33*Math['cos'](_0x106068))+this['y0'],_0x4aa1c6;}function inverse$l(_0x3e4c32){const _0x30c2e2=_0x3d5d32;var _0x3b1bca,_0x19fb69,_0x115479,_0x11cff9,_0x1ad238,_0x3897f8=(_0x3e4c32['x']-this['x0'])/this['k0'],_0x585ede=this['rh']-(_0x3e4c32['y']-this['y0'])/this['k0'];this['ns']>0x0?(_0x3b1bca=Math['sqrt'](_0x3897f8*_0x3897f8+_0x585ede*_0x585ede),_0x19fb69=0x1):(_0x3b1bca=-Math['sqrt'](_0x3897f8*_0x3897f8+_0x585ede*_0x585ede),_0x19fb69=-0x1);var _0xac15da=0x0;_0x3b1bca!==0x0&&(_0xac15da=Math[_0x30c2e2(0xec8)](_0x19fb69*_0x3897f8,_0x19fb69*_0x585ede));if(_0x3b1bca!==0x0||this['ns']>0x0){_0x19fb69=0x1/this['ns'],_0x115479=Math['pow'](_0x3b1bca/(this['a']*this['f0']),_0x19fb69),_0x11cff9=phi2z(this['e'],_0x115479);if(_0x11cff9===-0x270f)return null;}else _0x11cff9=-HALF_PI;return _0x1ad238=adjust_lon(_0xac15da/this['ns']+this['long0']),_0x3e4c32['x']=_0x1ad238,_0x3e4c32['y']=_0x11cff9,_0x3e4c32;}var names$l=['Lambert\x20Tangential\x20Conformal\x20Conic\x20Projection','Lambert_Conformal_Conic','Lambert_Conformal_Conic_1SP',_0x3d5d32(0x9a3),_0x3d5d32(0x103d),'Lambert\x20Conic\x20Conformal\x20(1SP)',_0x3d5d32(0xa8a)],lcc={'init':init$l,'forward':forward$l,'inverse':inverse$l,'names':names$l};function init$k(){const _0x367c01={_0x2a7361:0xa41,_0x43b49b:0x6ff,_0x26c692:0x723,_0x42c1bc:0x7dc,_0x2abd4a:0x723,_0x19fe9d:0xfee},_0x3315f0=_0x3d5d32;this['a']=6377397.155,this['es']=0.006674372230614,this['e']=Math[_0x3315f0(0xae3)](this['es']),!this['lat0']&&(this[_0x3315f0(0xa41)]=0.863937979737193),!this['long0']&&(this['long0']=0.7417649320975901-0.308341501185665),!this['k0']&&(this['k0']=0.9999),this['s45']=0.785398163397448,this[_0x3315f0(0xf4b)]=0x2*this['s45'],this[_0x3315f0(0x7dc)]=this[_0x3315f0(_0x367c01._0x2a7361)],this['e2']=this['es'],this['e']=Math['sqrt'](this['e2']),this['alfa']=Math['sqrt'](0x1+this['e2']*Math[_0x3315f0(0x1fb)](Math[_0x3315f0(0x256)](this['fi0']),0x4)/(0x1-this['e2'])),this['uq']=1.04216856380474,this['u0']=Math['asin'](Math['sin'](this['fi0'])/this[_0x3315f0(_0x367c01._0x43b49b)]),this['g']=Math['pow']((0x1+this['e']*Math['sin'](this['fi0']))/(0x1-this['e']*Math[_0x3315f0(_0x367c01._0x26c692)](this['fi0'])),this[_0x3315f0(_0x367c01._0x43b49b)]*this['e']/0x2),this['k']=Math['tan'](this['u0']/0x2+this['s45'])/Math['pow'](Math['tan'](this[_0x3315f0(_0x367c01._0x42c1bc)]/0x2+this['s45']),this['alfa'])*this['g'],this['k1']=this['k0'],this['n0']=this['a']*Math['sqrt'](0x1-this['e2'])/(0x1-this['e2']*Math['pow'](Math['sin'](this['fi0']),0x2)),this['s0']=1.37008346281555,this['n']=Math[_0x3315f0(_0x367c01._0x2abd4a)](this['s0']),this[_0x3315f0(_0x367c01._0x19fe9d)]=this['k1']*this['n0']/Math['tan'](this['s0']),this['ad']=this['s90']-this['uq'];}function forward$k(_0x2df182){const _0x53f553={_0xbb1b7c:0xdd3,_0x16055d:0xd0c,_0x23a47a:0x256,_0x3c6c1b:0x723,_0x566136:0x1fb,_0x404f5e:0xdd3},_0x2d9796=_0x3d5d32;var _0x3ca673,_0x55597c,_0x488f3c,_0x8f7299,_0x5b9002,_0x387922,_0x1f3c55,_0x3f16cc=_0x2df182['x'],_0x479e00=_0x2df182['y'],_0x3f7e33=adjust_lon(_0x3f16cc-this['long0']);return _0x3ca673=Math['pow']((0x1+this['e']*Math[_0x2d9796(0x723)](_0x479e00))/(0x1-this['e']*Math['sin'](_0x479e00)),this['alfa']*this['e']/0x2),_0x55597c=0x2*(Math['atan'](this['k']*Math['pow'](Math[_0x2d9796(_0x53f553._0xbb1b7c)](_0x479e00/0x2+this[_0x2d9796(_0x53f553._0x16055d)]),this['alfa'])/_0x3ca673)-this['s45']),_0x488f3c=-_0x3f7e33*this[_0x2d9796(0x6ff)],_0x8f7299=Math['asin'](Math[_0x2d9796(_0x53f553._0x23a47a)](this['ad'])*Math['sin'](_0x55597c)+Math[_0x2d9796(_0x53f553._0x3c6c1b)](this['ad'])*Math['cos'](_0x55597c)*Math['cos'](_0x488f3c)),_0x5b9002=Math['asin'](Math['cos'](_0x55597c)*Math[_0x2d9796(0x723)](_0x488f3c)/Math['cos'](_0x8f7299)),_0x387922=this['n']*_0x5b9002,_0x1f3c55=this['ro0']*Math[_0x2d9796(_0x53f553._0x566136)](Math[_0x2d9796(_0x53f553._0x404f5e)](this['s0']/0x2+this['s45']),this['n'])/Math['pow'](Math['tan'](_0x8f7299/0x2+this['s45']),this['n']),_0x2df182['y']=_0x1f3c55*Math[_0x2d9796(0x256)](_0x387922)/0x1,_0x2df182['x']=_0x1f3c55*Math['sin'](_0x387922)/0x1,!this['czech']&&(_0x2df182['y']*=-0x1,_0x2df182['x']*=-0x1),_0x2df182;}function inverse$k(_0x2db5e0){const _0x19d88f={_0x172536:0x723,_0x3e62de:0x618,_0x27b7e1:0x256,_0x13fa1c:0xd0c,_0x3fd492:0x4ba},_0x15d570=_0x3d5d32;var _0x467148,_0x2dde53,_0xf9983,_0x553e70,_0x2e3d72,_0x46c13d,_0xcfb5c1,_0x1dc2bf,_0x48b3b1=_0x2db5e0['x'];_0x2db5e0['x']=_0x2db5e0['y'],_0x2db5e0['y']=_0x48b3b1;!this['czech']&&(_0x2db5e0['y']*=-0x1,_0x2db5e0['x']*=-0x1);_0x46c13d=Math['sqrt'](_0x2db5e0['x']*_0x2db5e0['x']+_0x2db5e0['y']*_0x2db5e0['y']),_0x2e3d72=Math['atan2'](_0x2db5e0['y'],_0x2db5e0['x']),_0x553e70=_0x2e3d72/Math[_0x15d570(_0x19d88f._0x172536)](this['s0']),_0xf9983=0x2*(Math['atan'](Math['pow'](this['ro0']/_0x46c13d,0x1/this['n'])*Math['tan'](this['s0']/0x2+this['s45']))-this['s45']),_0x467148=Math[_0x15d570(_0x19d88f._0x3e62de)](Math['cos'](this['ad'])*Math['sin'](_0xf9983)-Math['sin'](this['ad'])*Math[_0x15d570(_0x19d88f._0x27b7e1)](_0xf9983)*Math[_0x15d570(0x256)](_0x553e70)),_0x2dde53=Math['asin'](Math[_0x15d570(0x256)](_0xf9983)*Math['sin'](_0x553e70)/Math['cos'](_0x467148)),_0x2db5e0['x']=this['long0']-_0x2dde53/this['alfa'],_0xcfb5c1=_0x467148,_0x1dc2bf=0x0;var _0x4ed791=0x0;do{_0x2db5e0['y']=0x2*(Math['atan'](Math['pow'](this['k'],-0x1/this['alfa'])*Math['pow'](Math['tan'](_0x467148/0x2+this[_0x15d570(_0x19d88f._0x13fa1c)]),0x1/this[_0x15d570(0x6ff)])*Math[_0x15d570(0x1fb)]((0x1+this['e']*Math['sin'](_0xcfb5c1))/(0x1-this['e']*Math['sin'](_0xcfb5c1)),this['e']/0x2))-this['s45']),Math[_0x15d570(_0x19d88f._0x3fd492)](_0xcfb5c1-_0x2db5e0['y'])<1e-10&&(_0x1dc2bf=0x1),_0xcfb5c1=_0x2db5e0['y'],_0x4ed791+=0x1;}while(_0x1dc2bf===0x0&&_0x4ed791<0xf);if(_0x4ed791>=0xf)return null;return _0x2db5e0;}var names$k=[_0x3d5d32(0xc68),'krovak'],krovak={'init':init$k,'forward':forward$k,'inverse':inverse$k,'names':names$k};function mlfn(_0x556d38,_0x11017e,_0x58b406,_0x13d6c9,_0x256375){return _0x556d38*_0x256375-_0x11017e*Math['sin'](0x2*_0x256375)+_0x58b406*Math['sin'](0x4*_0x256375)-_0x13d6c9*Math['sin'](0x6*_0x256375);}function e0fn(_0x193d29){return 0x1-0.25*_0x193d29*(0x1+_0x193d29/0x10*(0x3+1.25*_0x193d29));}function e1fn(_0x552467){return 0.375*_0x552467*(0x1+0.25*_0x552467*(0x1+0.46875*_0x552467));}function e2fn(_0x29a919){return 0.05859375*_0x29a919*_0x29a919*(0x1+0.75*_0x29a919);}function e3fn(_0x26804b){return _0x26804b*_0x26804b*_0x26804b*(0x23/0xc00);}function gN(_0x224453,_0x167f9e,_0x366501){var _0x677f55=_0x167f9e*_0x366501;return _0x224453/Math['sqrt'](0x1-_0x677f55*_0x677f55);}function adjust_lat(_0x473fd7){return Math['abs'](_0x473fd7)1e-7?(_0x372160=_0x227475*_0x35efb1,(0x1-_0x227475*_0x227475)*(_0x35efb1/(0x1-_0x372160*_0x372160)-0.5/_0x227475*Math[_0x4070a2(0x7b1)]((0x1-_0x372160)/(0x1+_0x372160)))):0x2*_0x35efb1;}var S_POLE=0x1,N_POLE=0x2,EQUIT=0x3,OBLIQ=0x4;function init$i(){const _0xeb8efe={_0x2f3713:0x6e1,_0xfd3584:0x339,_0x34fc2e:0x339},_0x1e68fb=_0x3d5d32;var _0x22dfef=Math['abs'](this['lat0']);if(Math['abs'](_0x22dfef-HALF_PI)0x0){var _0x808333;this['qp']=qsfnz(this['e'],0x1),this['mmf']=0.5/(0x1-this['es']),this['apa']=authset(this['es']);switch(this[_0x1e68fb(_0xeb8efe._0x2f3713)]){case this['N_POLE']:this['dd']=0x1;break;case this['S_POLE']:this['dd']=0x1;break;case this['EQUIT']:this['rq']=Math['sqrt'](0.5*this['qp']),this['dd']=0x1/this['rq'],this[_0x1e68fb(0xda9)]=0x1,this['ymf']=0.5*this['qp'];break;case this['OBLIQ']:this['rq']=Math['sqrt'](0.5*this['qp']),_0x808333=Math[_0x1e68fb(0x723)](this['lat0']),this[_0x1e68fb(_0xeb8efe._0xfd3584)]=qsfnz(this['e'],_0x808333)/this['qp'],this['cosb1']=Math['sqrt'](0x1-this[_0x1e68fb(_0xeb8efe._0xfd3584)]*this[_0x1e68fb(_0xeb8efe._0x34fc2e)]),this['dd']=Math['cos'](this[_0x1e68fb(0xa41)])/(Math['sqrt'](0x1-this['es']*_0x808333*_0x808333)*this['rq']*this['cosb1']),this['ymf']=(this['xmf']=this['rq'])/this['dd'],this['xmf']*=this['dd'];break;}}else this[_0x1e68fb(_0xeb8efe._0x2f3713)]===this['OBLIQ']&&(this['sinph0']=Math['sin'](this['lat0']),this[_0x1e68fb(0x3d0)]=Math['cos'](this['lat0']));}function forward$i(_0x1cf035){const _0x2bfb74={_0x6784ee:0x723,_0x55d099:0x6fc,_0x60bc55:0x6e1,_0x4c5694:0x9b9,_0x487684:0x723,_0x59c48b:0x6e1,_0x4af998:0xc4a,_0x38881c:0x4db,_0x10fecf:0xd3e},_0x473973=_0x3d5d32;var _0xa3f0b0,_0x1619e9,_0x5b30ed,_0x4326d9,_0xd86a55,_0x555961,_0x1209a8,_0x3ee993,_0x35b08d,_0x382ca5,_0x447809=_0x1cf035['x'],_0x126de=_0x1cf035['y'];_0x447809=adjust_lon(_0x447809-this['long0']);if(this['sphere']){_0xd86a55=Math[_0x473973(_0x2bfb74._0x6784ee)](_0x126de),_0x382ca5=Math['cos'](_0x126de),_0x5b30ed=Math['cos'](_0x447809);if(this['mode']===this[_0x473973(_0x2bfb74._0x55d099)]||this['mode']===this['EQUIT']){_0x1619e9=this[_0x473973(_0x2bfb74._0x60bc55)]===this['EQUIT']?0x1+_0x382ca5*_0x5b30ed:0x1+this[_0x473973(0x625)]*_0xd86a55+this[_0x473973(0x3d0)]*_0x382ca5*_0x5b30ed;if(_0x1619e9<=EPSLN)return null;_0x1619e9=Math['sqrt'](0x2/_0x1619e9),_0xa3f0b0=_0x1619e9*_0x382ca5*Math['sin'](_0x447809),_0x1619e9*=this['mode']===this['EQUIT']?_0xd86a55:this['cosph0']*_0xd86a55-this['sinph0']*_0x382ca5*_0x5b30ed;}else{if(this[_0x473973(0x6e1)]===this['N_POLE']||this['mode']===this['S_POLE']){this[_0x473973(_0x2bfb74._0x60bc55)]===this[_0x473973(_0x2bfb74._0x4c5694)]&&(_0x5b30ed=-_0x5b30ed);if(Math[_0x473973(0x4ba)](_0x126de+this['lat0'])=0x0?(_0xa3f0b0=(_0x35b08d=Math['sqrt'](_0x555961))*_0x4326d9,_0x1619e9=_0x5b30ed*(this[_0x473973(0x6e1)]===this['S_POLE']?_0x35b08d:-_0x35b08d)):_0xa3f0b0=_0x1619e9=0x0;break;}}return _0x1cf035['x']=this['a']*_0xa3f0b0+this['x0'],_0x1cf035['y']=this['a']*_0x1619e9+this['y0'],_0x1cf035;}function inverse$i(_0x12de13){const _0x1b3b10={_0x20befc:0x618,_0x28b6af:0x6e1,_0x5a09ba:0x618,_0x161b62:0x618,_0x56cfb4:0x723,_0x44e931:0x6e1,_0x37ca6f:0x339,_0x5e3bcb:0xc4a,_0x57f756:0xc4a},_0x53a457=_0x3d5d32;_0x12de13['x']-=this['x0'],_0x12de13['y']-=this['y0'];var _0x3d1c52=_0x12de13['x']/this['a'],_0x223cb6=_0x12de13['y']/this['a'],_0x556448,_0x441936,_0x172db6,_0x169ccf,_0x520c55,_0x536ec2,_0x5e0cb9;if(this[_0x53a457(0xaa0)]){var _0x29bc6e=0x0,_0x58644a,_0x3c7bca=0x0;_0x58644a=Math['sqrt'](_0x3d1c52*_0x3d1c52+_0x223cb6*_0x223cb6),_0x441936=_0x58644a*0.5;if(_0x441936>0x1)return null;_0x441936=0x2*Math[_0x53a457(_0x1b3b10._0x20befc)](_0x441936);(this[_0x53a457(0x6e1)]===this['OBLIQ']||this[_0x53a457(0x6e1)]===this['EQUIT'])&&(_0x3c7bca=Math['sin'](_0x441936),_0x29bc6e=Math[_0x53a457(0x256)](_0x441936));switch(this[_0x53a457(_0x1b3b10._0x28b6af)]){case this['EQUIT']:_0x441936=Math['abs'](_0x58644a)<=EPSLN?0x0:Math[_0x53a457(_0x1b3b10._0x5a09ba)](_0x223cb6*_0x3c7bca/_0x58644a),_0x3d1c52*=_0x3c7bca,_0x223cb6=_0x29bc6e*_0x58644a;break;case this['OBLIQ']:_0x441936=Math['abs'](_0x58644a)<=EPSLN?this['lat0']:Math[_0x53a457(_0x1b3b10._0x161b62)](_0x29bc6e*this[_0x53a457(0x625)]+_0x223cb6*_0x3c7bca*this['cosph0']/_0x58644a),_0x3d1c52*=_0x3c7bca*this['cosph0'],_0x223cb6=(_0x29bc6e-Math[_0x53a457(_0x1b3b10._0x56cfb4)](_0x441936)*this['sinph0'])*_0x58644a;break;case this['N_POLE']:_0x223cb6=-_0x223cb6,_0x441936=HALF_PI-_0x441936;break;case this['S_POLE']:_0x441936-=HALF_PI;break;}_0x556448=_0x223cb6===0x0&&(this[_0x53a457(_0x1b3b10._0x44e931)]===this['EQUIT']||this['mode']===this['OBLIQ'])?0x0:Math['atan2'](_0x3d1c52,_0x223cb6);}else{_0x5e0cb9=0x0;if(this['mode']===this['OBLIQ']||this['mode']===this['EQUIT']){_0x3d1c52/=this['dd'],_0x223cb6*=this['dd'],_0x536ec2=Math['sqrt'](_0x3d1c52*_0x3d1c52+_0x223cb6*_0x223cb6);if(_0x536ec20x1&&(_0x5ecc7a=_0x5ecc7a>0x1?0x1:-0x1),Math['asin'](_0x5ecc7a);}function init$h(){const _0x1133fe={_0x3fda9a:0x4a2,_0x463c75:0x28a,_0x285108:0xacc,_0x53e266:0x28a,_0xb6d411:0x28a,_0x83ed2d:0xb64},_0x302181=_0x3d5d32;if(Math['abs'](this[_0x302181(_0x1133fe._0x3fda9a)]+this['lat2'])EPSLN?this['ns0']=(this['ms1']*this[_0x302181(0x4ee)]-this[_0x302181(_0x1133fe._0x83ed2d)]*this[_0x302181(0xb64)])/(this[_0x302181(0x340)]-this[_0x302181(0xb20)]):this['ns0']=this['con'],this['c']=this[_0x302181(0x4ee)]*this['ms1']+this['ns0']*this['qs1'],this['rh']=this['a']*Math['sqrt'](this['c']-this['ns0']*this['qs0'])/this[_0x302181(0xb76)];}function forward$h(_0xbc105b){const _0x209d79={_0x120b9a:0x7cd},_0x452a96=_0x3d5d32;var _0x206f8e=_0xbc105b['x'],_0xb566c6=_0xbc105b['y'];this['sin_phi']=Math['sin'](_0xb566c6),this['cos_phi']=Math[_0x452a96(0x256)](_0xb566c6);var _0x56a88e=qsfnz(this['e3'],this['sin_phi']),_0x2bb456=this['a']*Math['sqrt'](this['c']-this['ns0']*_0x56a88e)/this['ns0'],_0x4ad5ac=this['ns0']*adjust_lon(_0x206f8e-this[_0x452a96(_0x209d79._0x120b9a)]),_0x410b39=_0x2bb456*Math[_0x452a96(0x723)](_0x4ad5ac)+this['x0'],_0x2b55f5=this['rh']-_0x2bb456*Math['cos'](_0x4ad5ac)+this['y0'];return _0xbc105b['x']=_0x410b39,_0xbc105b['y']=_0x2b55f5,_0xbc105b;}function inverse$h(_0x301f7d){const _0x42dd66={_0x327ba5:0xb76,_0x92de58:0xaa0,_0x12d6b1:0x618},_0x38ae5c=_0x3d5d32;var _0x4440d6,_0xd5af8e,_0x58b3a4,_0x3bf643,_0x1946c0,_0x28ca5c;return _0x301f7d['x']-=this['x0'],_0x301f7d['y']=this['rh']-_0x301f7d['y']+this['y0'],this[_0x38ae5c(_0x42dd66._0x327ba5)]>=0x0?(_0x4440d6=Math['sqrt'](_0x301f7d['x']*_0x301f7d['x']+_0x301f7d['y']*_0x301f7d['y']),_0x58b3a4=0x1):(_0x4440d6=-Math['sqrt'](_0x301f7d['x']*_0x301f7d['x']+_0x301f7d['y']*_0x301f7d['y']),_0x58b3a4=-0x1),_0x3bf643=0x0,_0x4440d6!==0x0&&(_0x3bf643=Math[_0x38ae5c(0xec8)](_0x58b3a4*_0x301f7d['x'],_0x58b3a4*_0x301f7d['y'])),_0x58b3a4=_0x4440d6*this['ns0']/this['a'],this[_0x38ae5c(_0x42dd66._0x92de58)]?_0x28ca5c=Math[_0x38ae5c(_0x42dd66._0x12d6b1)]((this['c']-_0x58b3a4*_0x58b3a4)/(0x2*this[_0x38ae5c(_0x42dd66._0x327ba5)])):(_0xd5af8e=(this['c']-_0x58b3a4*_0x58b3a4)/this['ns0'],_0x28ca5c=this['phi1z'](this['e3'],_0xd5af8e)),_0x1946c0=adjust_lon(_0x3bf643/this['ns0']+this['long0']),_0x301f7d['x']=_0x1946c0,_0x301f7d['y']=_0x28ca5c,_0x301f7d;}function phi1z(_0x31e26b,_0x6ab36b){const _0x253570={_0x3ac488:0x256},_0x1a9caa=_0x3d5d32;var _0x47abed,_0x6f5fbf,_0x102090,_0x4bc1b1,_0x1584ce,_0x118ae3=asinz(0.5*_0x6ab36b);if(_0x31e26b0x0||Math['abs'](_0x33f11c)<=EPSLN?(_0x355b79=this['x0']+this['a']*_0x35b86b*_0x50b39c*Math['sin'](_0x317675)/_0x33f11c,_0x21fe68=this['y0']+this['a']*_0x35b86b*(this[_0x565c27(_0x1fc5fc._0x478e05)]*_0x4ee639-this[_0x565c27(_0x1fc5fc._0x1b31cc)]*_0x50b39c*_0xdc96b5)/_0x33f11c):(_0x355b79=this['x0']+this[_0x565c27(_0x1fc5fc._0x4976b8)]*_0x50b39c*Math[_0x565c27(0x723)](_0x317675),_0x21fe68=this['y0']+this['infinity_dist']*(this['cos_p14']*_0x4ee639-this['sin_p14']*_0x50b39c*_0xdc96b5)),_0xfe8fc['x']=_0x355b79,_0xfe8fc['y']=_0x21fe68,_0xfe8fc;}function inverse$g(_0x127717){const _0x24779e={_0x221da1:0xb7e},_0x36427a=_0x3d5d32;var _0x364997,_0x43a61b,_0x1cefc2,_0x19a727,_0x5caa29,_0x3a3501;return _0x127717['x']=(_0x127717['x']-this['x0'])/this['a'],_0x127717['y']=(_0x127717['y']-this['y0'])/this['a'],_0x127717['x']/=this['k0'],_0x127717['y']/=this['k0'],(_0x364997=Math['sqrt'](_0x127717['x']*_0x127717['x']+_0x127717['y']*_0x127717['y']))?(_0x19a727=Math['atan2'](_0x364997,this['rc']),_0x43a61b=Math['sin'](_0x19a727),_0x1cefc2=Math[_0x36427a(0x256)](_0x19a727),_0x3a3501=asinz(_0x1cefc2*this['sin_p14']+_0x127717['y']*_0x43a61b*this['cos_p14']/_0x364997),_0x5caa29=Math[_0x36427a(0xec8)](_0x127717['x']*_0x43a61b,_0x364997*this[_0x36427a(_0x24779e._0x221da1)]*_0x1cefc2-_0x127717['y']*this['sin_p14']*_0x43a61b),_0x5caa29=adjust_lon(this['long0']+_0x5caa29)):(_0x3a3501=this['phic0'],_0x5caa29=0x0),_0x127717['x']=_0x5caa29,_0x127717['y']=_0x3a3501,_0x127717;}var names$g=[_0x3d5d32(0xc80)],gnom={'init':init$g,'forward':forward$g,'inverse':inverse$g,'names':names$g};function iqsfnz(_0x50b5ba,_0x282f9c){const _0xa83bd={_0x395313:0x4ba},_0x59fa77=_0x3d5d32;var _0x33b770=0x1-(0x1-_0x50b5ba*_0x50b5ba)/(0x2*_0x50b5ba)*Math['log']((0x1-_0x50b5ba)/(0x1+_0x50b5ba));if(Math[_0x59fa77(0x4ba)](Math[_0x59fa77(_0xa83bd._0x395313)](_0x282f9c)-_0x33b770)<0.000001)return _0x282f9c<0x0?-0x1*HALF_PI:HALF_PI;var _0x4c9aa2=Math['asin'](0.5*_0x282f9c),_0x186bb7,_0x4327b5,_0x3c49e1,_0x58a3a8;for(var _0x5d448a=0x0;_0x5d448a<0x1e;_0x5d448a++){_0x4327b5=Math['sin'](_0x4c9aa2),_0x3c49e1=Math[_0x59fa77(0x256)](_0x4c9aa2),_0x58a3a8=_0x50b5ba*_0x4327b5,_0x186bb7=Math['pow'](0x1-_0x58a3a8*_0x58a3a8,0x2)/(0x2*_0x3c49e1)*(_0x282f9c/(0x1-_0x50b5ba*_0x50b5ba)-_0x4327b5/(0x1-_0x58a3a8*_0x58a3a8)+0.5/_0x50b5ba*Math['log']((0x1-_0x58a3a8)/(0x1+_0x58a3a8))),_0x4c9aa2+=_0x186bb7;if(Math[_0x59fa77(0x4ba)](_0x186bb7)<=1e-10)return _0x4c9aa2;}return NaN;}function init$f(){const _0x4a066f=_0x3d5d32;!this[_0x4a066f(0xaa0)]&&(this['k0']=msfnz(this['e'],Math['sin'](this['lat_ts']),Math['cos'](this['lat_ts'])));}function forward$f(_0x1eb2d6){const _0x700885={_0x208141:0x256},_0x5b4d19=_0x3d5d32;var _0x274536=_0x1eb2d6['x'],_0x554031=_0x1eb2d6['y'],_0x39391c,_0x526ce2,_0x80ef11=adjust_lon(_0x274536-this['long0']);if(this['sphere'])_0x39391c=this['x0']+this['a']*_0x80ef11*Math['cos'](this['lat_ts']),_0x526ce2=this['y0']+this['a']*Math['sin'](_0x554031)/Math[_0x5b4d19(_0x700885._0x208141)](this['lat_ts']);else{var _0x35bbec=qsfnz(this['e'],Math[_0x5b4d19(0x723)](_0x554031));_0x39391c=this['x0']+this['a']*this['k0']*_0x80ef11,_0x526ce2=this['y0']+this['a']*_0x35bbec*0.5/this['k0'];}return _0x1eb2d6['x']=_0x39391c,_0x1eb2d6['y']=_0x526ce2,_0x1eb2d6;}function inverse$f(_0x7925b5){const _0x5f81fa={_0x285f76:0xaa0},_0x406302=_0x3d5d32;_0x7925b5['x']-=this['x0'],_0x7925b5['y']-=this['y0'];var _0x34b66d,_0x16b7c2;return this[_0x406302(_0x5f81fa._0x285f76)]?(_0x34b66d=adjust_lon(this['long0']+_0x7925b5['x']/this['a']/Math['cos'](this['lat_ts'])),_0x16b7c2=Math[_0x406302(0x618)](_0x7925b5['y']/this['a']*Math['cos'](this['lat_ts']))):(_0x16b7c2=iqsfnz(this['e'],0x2*_0x7925b5['y']*this['k0']/this['a']),_0x34b66d=adjust_lon(this['long0']+_0x7925b5['x']/(this['a']*this['k0']))),_0x7925b5['x']=_0x34b66d,_0x7925b5['y']=_0x16b7c2,_0x7925b5;}var names$f=['cea'],cea={'init':init$f,'forward':forward$f,'inverse':inverse$f,'names':names$f};function init$e(){const _0x53c2a6={_0x27a0a9:0xa41,_0x301209:0xfb1,_0x5dc349:0x256},_0x5ce554=_0x3d5d32;this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this['lat0']=this[_0x5ce554(_0x53c2a6._0x27a0a9)]||0x0,this[_0x5ce554(0x7cd)]=this['long0']||0x0,this['lat_ts']=this[_0x5ce554(_0x53c2a6._0x301209)]||0x0,this['title']=this['title']||'Equidistant\x20Cylindrical\x20(Plate\x20Carre)',this['rc']=Math[_0x5ce554(_0x53c2a6._0x5dc349)](this[_0x5ce554(0xfb1)]);}function forward$e(_0x154ebc){const _0xf7dfbe=_0x3d5d32;var _0x451c24=_0x154ebc['x'],_0x16e826=_0x154ebc['y'],_0x1fe239=adjust_lon(_0x451c24-this[_0xf7dfbe(0x7cd)]),_0x492438=adjust_lat(_0x16e826-this['lat0']);return _0x154ebc['x']=this['x0']+this['a']*_0x1fe239*this['rc'],_0x154ebc['y']=this['y0']+this['a']*_0x492438,_0x154ebc;}function inverse$e(_0x531251){var _0x21e1a8=_0x531251['x'],_0x4a5f7c=_0x531251['y'];return _0x531251['x']=adjust_lon(this['long0']+(_0x21e1a8-this['x0'])/(this['a']*this['rc'])),_0x531251['y']=adjust_lat(this['lat0']+(_0x4a5f7c-this['y0'])/this['a']),_0x531251;}var names$e=['Equirectangular',_0x3d5d32(0xdb5),'eqc'],eqc={'init':init$e,'forward':forward$e,'inverse':inverse$e,'names':names$e},MAX_ITER$1=0x14;function init$d(){this['temp']=this['b']/this['a'],this['es']=0x1-Math['pow'](this['temp'],0x2),this['e']=Math['sqrt'](this['es']),this['e0']=e0fn(this['es']),this['e1']=e1fn(this['es']),this['e2']=e2fn(this['es']),this['e3']=e3fn(this['es']),this['ml0']=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],this['lat0']);}function forward$d(_0x46fd1b){const _0xe04dca={_0x17d40b:0x723,_0x154dd3:0xaa0,_0x467b11:0x256,_0x4fa493:0xb4a,_0x3700f5:0x256},_0x2571c9=_0x3d5d32;var _0x177503=_0x46fd1b['x'],_0x36a9da=_0x46fd1b['y'],_0x381f8d,_0x2fb38d,_0x264f6c,_0x4af8a4=adjust_lon(_0x177503-this['long0']);_0x264f6c=_0x4af8a4*Math[_0x2571c9(_0xe04dca._0x17d40b)](_0x36a9da);if(this[_0x2571c9(_0xe04dca._0x154dd3)])Math['abs'](_0x36a9da)<=EPSLN?(_0x381f8d=this['a']*_0x4af8a4,_0x2fb38d=-0x1*this['a']*this['lat0']):(_0x381f8d=this['a']*Math['sin'](_0x264f6c)/Math['tan'](_0x36a9da),_0x2fb38d=this['a']*(adjust_lat(_0x36a9da-this[_0x2571c9(0xa41)])+(0x1-Math[_0x2571c9(_0xe04dca._0x467b11)](_0x264f6c))/Math['tan'](_0x36a9da)));else{if(Math['abs'](_0x36a9da)<=EPSLN)_0x381f8d=this['a']*_0x4af8a4,_0x2fb38d=-0x1*this['ml0'];else{var _0x4935e7=gN(this['a'],this['e'],Math[_0x2571c9(0x723)](_0x36a9da))/Math['tan'](_0x36a9da);_0x381f8d=_0x4935e7*Math[_0x2571c9(0x723)](_0x264f6c),_0x2fb38d=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0x36a9da)-this[_0x2571c9(_0xe04dca._0x4fa493)]+_0x4935e7*(0x1-Math[_0x2571c9(_0xe04dca._0x3700f5)](_0x264f6c));}}return _0x46fd1b['x']=_0x381f8d+this['x0'],_0x46fd1b['y']=_0x2fb38d+this['y0'],_0x46fd1b;}function inverse$d(_0x108e19){const _0x4b69b4={_0x524f0c:0x7cd,_0x2bb3b0:0xae3,_0x5effd0:0xdd3},_0x14ef04=_0x3d5d32;var _0xab0d1d,_0x11049f,_0x2b41a4,_0x501bb3,_0x45c1f6,_0x294b51,_0x5efc85,_0x41c383,_0x3fc88f;_0x2b41a4=_0x108e19['x']-this['x0'],_0x501bb3=_0x108e19['y']-this['y0'];if(this['sphere']){if(Math['abs'](_0x501bb3+this['a']*this['lat0'])<=EPSLN)_0xab0d1d=adjust_lon(_0x2b41a4/this['a']+this['long0']),_0x11049f=0x0;else{_0x294b51=this['lat0']+_0x501bb3/this['a'],_0x5efc85=_0x2b41a4*_0x2b41a4/this['a']/this['a']+_0x294b51*_0x294b51,_0x41c383=_0x294b51;var _0x1d3fce;for(_0x45c1f6=MAX_ITER$1;_0x45c1f6;--_0x45c1f6){_0x1d3fce=Math['tan'](_0x41c383),_0x3fc88f=-0x1*(_0x294b51*(_0x41c383*_0x1d3fce+0x1)-_0x41c383-0.5*(_0x41c383*_0x41c383+_0x5efc85)*_0x1d3fce)/((_0x41c383-_0x294b51)/_0x1d3fce-0x1),_0x41c383+=_0x3fc88f;if(Math['abs'](_0x3fc88f)<=EPSLN){_0x11049f=_0x41c383;break;}}_0xab0d1d=adjust_lon(this[_0x14ef04(_0x4b69b4._0x524f0c)]+Math['asin'](_0x2b41a4*Math['tan'](_0x41c383)/this['a'])/Math['sin'](_0x11049f));}}else{if(Math['abs'](_0x501bb3+this['ml0'])<=EPSLN)_0x11049f=0x0,_0xab0d1d=adjust_lon(this['long0']+_0x2b41a4/this['a']);else{_0x294b51=(this['ml0']+_0x501bb3)/this['a'],_0x5efc85=_0x2b41a4*_0x2b41a4/this['a']/this['a']+_0x294b51*_0x294b51,_0x41c383=_0x294b51;var _0x5b0336,_0x1aa278,_0x349bd4,_0x498019,_0x293c0b;for(_0x45c1f6=MAX_ITER$1;_0x45c1f6;--_0x45c1f6){_0x293c0b=this['e']*Math['sin'](_0x41c383),_0x5b0336=Math[_0x14ef04(_0x4b69b4._0x2bb3b0)](0x1-_0x293c0b*_0x293c0b)*Math[_0x14ef04(0xdd3)](_0x41c383),_0x1aa278=this['a']*mlfn(this['e0'],this['e1'],this['e2'],this['e3'],_0x41c383),_0x349bd4=this['e0']-0x2*this['e1']*Math['cos'](0x2*_0x41c383)+0x4*this['e2']*Math[_0x14ef04(0x256)](0x4*_0x41c383)-0x6*this['e3']*Math['cos'](0x6*_0x41c383),_0x498019=_0x1aa278/this['a'],_0x3fc88f=(_0x294b51*(_0x5b0336*_0x498019+0x1)-_0x498019-0.5*_0x5b0336*(_0x498019*_0x498019+_0x5efc85))/(this['es']*Math['sin'](0x2*_0x41c383)*(_0x498019*_0x498019+_0x5efc85-0x2*_0x294b51*_0x498019)/(0x4*_0x5b0336)+(_0x294b51-_0x498019)*(_0x5b0336*_0x349bd4-0x2/Math['sin'](0x2*_0x41c383))-_0x349bd4),_0x41c383-=_0x3fc88f;if(Math['abs'](_0x3fc88f)<=EPSLN){_0x11049f=_0x41c383;break;}}_0x5b0336=Math['sqrt'](0x1-this['es']*Math['pow'](Math['sin'](_0x11049f),0x2))*Math[_0x14ef04(_0x4b69b4._0x5effd0)](_0x11049f),_0xab0d1d=adjust_lon(this['long0']+Math['asin'](_0x2b41a4*_0x5b0336/this['a'])/Math['sin'](_0x11049f));}}return _0x108e19['x']=_0xab0d1d,_0x108e19['y']=_0x11049f,_0x108e19;}var names$d=['Polyconic',_0x3d5d32(0xb06)],poly={'init':init$d,'forward':forward$d,'inverse':inverse$d,'names':names$d};function init$c(){const _0x2bacd9={_0x3ba48e:0x1034,_0x336721:0xb08,_0x597e55:0x71a},_0xcf44d1=_0x3d5d32;this['A']=[],this['A'][0x1]=0.6399175073,this['A'][0x2]=-0.1358797613,this['A'][0x3]=0.063294409,this['A'][0x4]=-0.02526853,this['A'][0x5]=0.0117879,this['A'][0x6]=-0.0055161,this['A'][0x7]=0.0026906,this['A'][0x8]=-0.001333,this['A'][0x9]=0.00067,this['A'][0xa]=-0.00034,this[_0xcf44d1(0xa1c)]=[],this['B_im']=[],this['B_re'][0x1]=0.7557853228,this[_0xcf44d1(0x1034)][0x1]=0x0,this['B_re'][0x2]=0.249204646,this['B_im'][0x2]=0.003371507,this['B_re'][0x3]=-0.001541739,this['B_im'][0x3]=0.04105856,this['B_re'][0x4]=-0.10162907,this['B_im'][0x4]=0.01727609,this[_0xcf44d1(0xa1c)][0x5]=-0.26623489,this['B_im'][0x5]=-0.36249218,this['B_re'][0x6]=-0.6870983,this[_0xcf44d1(_0x2bacd9._0x3ba48e)][0x6]=-1.1651967,this[_0xcf44d1(0x71a)]=[],this['C_im']=[],this[_0xcf44d1(0x71a)][0x1]=1.3231270439,this['C_im'][0x1]=0x0,this['C_re'][0x2]=-0.577245789,this['C_im'][0x2]=-0.007809598,this[_0xcf44d1(0x71a)][0x3]=0.508307513,this[_0xcf44d1(_0x2bacd9._0x336721)][0x3]=-0.112208952,this['C_re'][0x4]=-0.15094762,this[_0xcf44d1(0xb08)][0x4]=0.18200602,this[_0xcf44d1(_0x2bacd9._0x597e55)][0x5]=1.01418179,this[_0xcf44d1(0xb08)][0x5]=1.64497696,this[_0xcf44d1(_0x2bacd9._0x597e55)][0x6]=1.9660549,this[_0xcf44d1(0xb08)][0x6]=2.5127645,this['D']=[],this['D'][0x1]=1.5627014243,this['D'][0x2]=0.5185406398,this['D'][0x3]=-0.03333098,this['D'][0x4]=-0.1052906,this['D'][0x5]=-0.0368594,this['D'][0x6]=0.007317,this['D'][0x7]=0.0122,this['D'][0x8]=0.00394,this['D'][0x9]=-0.0013;}function forward$c(_0x469341){const _0x401586={_0x3464fc:0xa1c},_0x47190d=_0x3d5d32;var _0x3e287c,_0x3ac6f9=_0x469341['x'],_0x17c6b0=_0x469341['y'],_0x1d4dd2=_0x17c6b0-this['lat0'],_0x2315ef=_0x3ac6f9-this[_0x47190d(0x7cd)],_0x4bf701=_0x1d4dd2/SEC_TO_RAD*0.00001,_0x27c484=_0x2315ef,_0x3bd84c=0x1,_0x3b66df=0x0;for(_0x3e287c=0x1;_0x3e287c<=0xa;_0x3e287c++){_0x3bd84c=_0x3bd84c*_0x4bf701,_0x3b66df=_0x3b66df+this['A'][_0x3e287c]*_0x3bd84c;}var _0x41e791=_0x3b66df,_0xdd51d9=_0x27c484,_0xc3b53e=0x1,_0x2414f8=0x0,_0x12f2a3,_0x3fb2d0,_0x350cbb=0x0,_0x4cb2cb=0x0;for(_0x3e287c=0x1;_0x3e287c<=0x6;_0x3e287c++){_0x12f2a3=_0xc3b53e*_0x41e791-_0x2414f8*_0xdd51d9,_0x3fb2d0=_0x2414f8*_0x41e791+_0xc3b53e*_0xdd51d9,_0xc3b53e=_0x12f2a3,_0x2414f8=_0x3fb2d0,_0x350cbb=_0x350cbb+this[_0x47190d(_0x401586._0x3464fc)][_0x3e287c]*_0xc3b53e-this['B_im'][_0x3e287c]*_0x2414f8,_0x4cb2cb=_0x4cb2cb+this['B_im'][_0x3e287c]*_0xc3b53e+this['B_re'][_0x3e287c]*_0x2414f8;}return _0x469341['x']=_0x4cb2cb*this['a']+this['x0'],_0x469341['y']=_0x350cbb*this['a']+this['y0'],_0x469341;}function inverse$c(_0x52edf0){const _0x35d246={_0x352e2c:0xb08,_0x4f00e1:0xa1c,_0x3ec557:0x1034,_0x444746:0x7cd},_0x289231=_0x3d5d32;var _0x4ddd17,_0x36882a=_0x52edf0['x'],_0x387f9e=_0x52edf0['y'],_0x2d3420=_0x36882a-this['x0'],_0x42404c=_0x387f9e-this['y0'],_0x2c71c2=_0x42404c/this['a'],_0x4f4b2c=_0x2d3420/this['a'],_0x4127e5=0x1,_0xb76a5b=0x0,_0x120cbc,_0x5a0da9,_0xc3dd18=0x0,_0x1e3a3e=0x0;for(_0x4ddd17=0x1;_0x4ddd17<=0x6;_0x4ddd17++){_0x120cbc=_0x4127e5*_0x2c71c2-_0xb76a5b*_0x4f4b2c,_0x5a0da9=_0xb76a5b*_0x2c71c2+_0x4127e5*_0x4f4b2c,_0x4127e5=_0x120cbc,_0xb76a5b=_0x5a0da9,_0xc3dd18=_0xc3dd18+this['C_re'][_0x4ddd17]*_0x4127e5-this[_0x289231(_0x35d246._0x352e2c)][_0x4ddd17]*_0xb76a5b,_0x1e3a3e=_0x1e3a3e+this['C_im'][_0x4ddd17]*_0x4127e5+this[_0x289231(0x71a)][_0x4ddd17]*_0xb76a5b;}for(var _0x31d1df=0x0;_0x31d1df0.999999999999&&(_0x50f731=0.999999999999);_0x111af3=Math[_0x11ca71(0x618)](_0x50f731);var _0x356aa0=adjust_lon(this['long0']+_0x5c18f8['x']/(0.900316316158*this['a']*Math[_0x11ca71(0x256)](_0x111af3)));_0x356aa0<-Math['PI']&&(_0x356aa0=-Math['PI']);_0x356aa0>Math['PI']&&(_0x356aa0=Math['PI']);_0x50f731=(0x2*_0x111af3+Math[_0x11ca71(_0xcdf4c1._0x12aa4d)](0x2*_0x111af3))/Math['PI'];Math['abs'](_0x50f731)>0x1&&(_0x50f731=0x1);var _0x5dd601=Math['asin'](_0x50f731);return _0x5c18f8['x']=_0x356aa0,_0x5c18f8['y']=_0x5dd601,_0x5c18f8;}var names$9=['Mollweide','moll'],moll={'init':init$9,'forward':forward$9,'inverse':inverse$9,'names':names$9};function init$8(){const _0x1d8edc={_0x4ea0b4:0x4a2,_0x24baaf:0x4ba,_0xf1717e:0x601,_0x41856e:0x723,_0x163fb8:0xf09,_0x59b938:0x559},_0x531142=_0x3d5d32;if(Math[_0x531142(0x4ba)](this[_0x531142(_0x1d8edc._0x4ea0b4)]+this['lat2'])=0x0?(_0x75a2c8=Math['sqrt'](_0x2d91fc['x']*_0x2d91fc['x']+_0x2d91fc['y']*_0x2d91fc['y']),_0x379c8e=0x1):(_0x75a2c8=-Math['sqrt'](_0x2d91fc['x']*_0x2d91fc['x']+_0x2d91fc['y']*_0x2d91fc['y']),_0x379c8e=-0x1);var _0x20fee4=0x0;_0x75a2c8!==0x0&&(_0x20fee4=Math[_0x461cdd(0xec8)](_0x379c8e*_0x2d91fc['x'],_0x379c8e*_0x2d91fc['y']));if(this[_0x461cdd(0xaa0)])return _0x1a735d=adjust_lon(this[_0x461cdd(_0x1ba85c._0x5ece24)]+_0x20fee4/this['ns']),_0x9de840=adjust_lat(this['g']-_0x75a2c8/this['a']),_0x2d91fc['x']=_0x1a735d,_0x2d91fc['y']=_0x9de840,_0x2d91fc;else{var _0x3c9062=this['g']-_0x75a2c8/this['a'];return _0x9de840=imlfn(_0x3c9062,this['e0'],this['e1'],this['e2'],this['e3']),_0x1a735d=adjust_lon(this['long0']+_0x20fee4/this['ns']),_0x2d91fc['x']=_0x1a735d,_0x2d91fc['y']=_0x9de840,_0x2d91fc;}}var names$8=['Equidistant_Conic','eqdc'],eqdc={'init':init$8,'forward':forward$8,'inverse':inverse$8,'names':names$8};function init$7(){this['R']=this['a'];}function forward$7(_0xdd6998){const _0x4eaeae={_0x1cac30:0x4ba,_0x38684:0xae3},_0x5b9add=_0x3d5d32;var _0x3021af=_0xdd6998['x'],_0x35fa30=_0xdd6998['y'],_0x1e553a=adjust_lon(_0x3021af-this['long0']),_0x2cfe4c,_0x3ae3c7;Math['abs'](_0x35fa30)<=EPSLN&&(_0x2cfe4c=this['x0']+this['R']*_0x1e553a,_0x3ae3c7=this['y0']);var _0x52dc5b=asinz(0x2*Math['abs'](_0x35fa30/Math['PI']));(Math['abs'](_0x1e553a)<=EPSLN||Math[_0x5b9add(_0x4eaeae._0x1cac30)](Math['abs'](_0x35fa30)-HALF_PI)<=EPSLN)&&(_0x2cfe4c=this['x0'],_0x35fa30>=0x0?_0x3ae3c7=this['y0']+Math['PI']*this['R']*Math[_0x5b9add(0xdd3)](0.5*_0x52dc5b):_0x3ae3c7=this['y0']+Math['PI']*this['R']*-Math['tan'](0.5*_0x52dc5b));var _0x43108a=0.5*Math['abs'](Math['PI']/_0x1e553a-_0x1e553a/Math['PI']),_0x1df88c=_0x43108a*_0x43108a,_0x30ec8a=Math['sin'](_0x52dc5b),_0xa2567c=Math['cos'](_0x52dc5b),_0x1f6db4=_0xa2567c/(_0x30ec8a+_0xa2567c-0x1),_0x5cbe62=_0x1f6db4*_0x1f6db4,_0x441fc1=_0x1f6db4*(0x2/_0x30ec8a-0x1),_0x18bfa8=_0x441fc1*_0x441fc1,_0x4c061a=Math['PI']*this['R']*(_0x43108a*(_0x1f6db4-_0x18bfa8)+Math['sqrt'](_0x1df88c*(_0x1f6db4-_0x18bfa8)*(_0x1f6db4-_0x18bfa8)-(_0x18bfa8+_0x1df88c)*(_0x5cbe62-_0x18bfa8)))/(_0x18bfa8+_0x1df88c);_0x1e553a<0x0&&(_0x4c061a=-_0x4c061a);_0x2cfe4c=this['x0']+_0x4c061a;var _0x134f81=_0x1df88c+_0x1f6db4;return _0x4c061a=Math['PI']*this['R']*(_0x441fc1*_0x134f81-_0x43108a*Math[_0x5b9add(_0x4eaeae._0x38684)]((_0x18bfa8+_0x1df88c)*(_0x1df88c+0x1)-_0x134f81*_0x134f81))/(_0x18bfa8+_0x1df88c),_0x35fa30>=0x0?_0x3ae3c7=this['y0']+_0x4c061a:_0x3ae3c7=this['y0']-_0x4c061a,_0xdd6998['x']=_0x2cfe4c,_0xdd6998['y']=_0x3ae3c7,_0xdd6998;}function inverse$7(_0x486620){const _0x52b2f6={_0x76750c:0xae3},_0x37c061=_0x3d5d32;var _0x18a0ca,_0x31aa80,_0x20e970,_0x1df922,_0x385f20,_0x39d528,_0x498672,_0x136b4c,_0x44cc14,_0x20c58d,_0x2293b0,_0x17df5f,_0x5a2bc1;return _0x486620['x']-=this['x0'],_0x486620['y']-=this['y0'],_0x2293b0=Math['PI']*this['R'],_0x20e970=_0x486620['x']/_0x2293b0,_0x1df922=_0x486620['y']/_0x2293b0,_0x385f20=_0x20e970*_0x20e970+_0x1df922*_0x1df922,_0x39d528=-Math['abs'](_0x1df922)*(0x1+_0x385f20),_0x498672=_0x39d528-0x2*_0x1df922*_0x1df922+_0x20e970*_0x20e970,_0x136b4c=-0x2*_0x39d528+0x1+0x2*_0x1df922*_0x1df922+_0x385f20*_0x385f20,_0x5a2bc1=_0x1df922*_0x1df922/_0x136b4c+(0x2*_0x498672*_0x498672*_0x498672/_0x136b4c/_0x136b4c/_0x136b4c-0x9*_0x39d528*_0x498672/_0x136b4c/_0x136b4c)/0x1b,_0x44cc14=(_0x39d528-_0x498672*_0x498672/0x3/_0x136b4c)/_0x136b4c,_0x20c58d=0x2*Math[_0x37c061(_0x52b2f6._0x76750c)](-_0x44cc14/0x3),_0x2293b0=0x3*_0x5a2bc1/_0x44cc14/_0x20c58d,Math['abs'](_0x2293b0)>0x1&&(_0x2293b0>=0x0?_0x2293b0=0x1:_0x2293b0=-0x1),_0x17df5f=Math['acos'](_0x2293b0)/0x3,_0x486620['y']>=0x0?_0x31aa80=(-_0x20c58d*Math['cos'](_0x17df5f+Math['PI']/0x3)-_0x498672/0x3/_0x136b4c)*Math['PI']:_0x31aa80=-(-_0x20c58d*Math['cos'](_0x17df5f+Math['PI']/0x3)-_0x498672/0x3/_0x136b4c)*Math['PI'],Math['abs'](_0x20e970)0x2*HALF_PI*this['a'])return;return _0x9f0480=_0x280bba/this['a'],_0x18e0a4=Math[_0x12bf55(_0x1d91ae._0x27b763)](_0x9f0480),_0xf92620=Math['cos'](_0x9f0480),_0x2a1418=this['long0'],Math[_0x12bf55(0x4ba)](_0x280bba)<=EPSLN?_0x56d7b6=this['lat0']:(_0x56d7b6=asinz(_0xf92620*this[_0x12bf55(0xf9f)]+_0x11edcd['y']*_0x18e0a4*this[_0x12bf55(0x869)]/_0x280bba),_0x2d3898=Math['abs'](this[_0x12bf55(0xa41)])-HALF_PI,Math['abs'](_0x2d3898)<=EPSLN?this[_0x12bf55(_0x1d91ae._0x2af6ad)]>=0x0?_0x2a1418=adjust_lon(this['long0']+Math['atan2'](_0x11edcd['x'],-_0x11edcd['y'])):_0x2a1418=adjust_lon(this['long0']-Math[_0x12bf55(_0x1d91ae._0x1cf6be)](-_0x11edcd['x'],_0x11edcd['y'])):_0x2a1418=adjust_lon(this['long0']+Math['atan2'](_0x11edcd['x']*_0x18e0a4,_0x280bba*this['cos_p12']*_0xf92620-_0x11edcd['y']*this['sin_p12']*_0x18e0a4))),_0x11edcd['x']=_0x2a1418,_0x11edcd['y']=_0x56d7b6,_0x11edcd;}else{_0x22b549=e0fn(this['es']),_0xff1084=e1fn(this['es']),_0xfa2f24=e2fn(this['es']),_0x3610e0=e3fn(this['es']);if(Math['abs'](this['sin_p12']-0x1)<=EPSLN)return _0x432c34=this['a']*mlfn(_0x22b549,_0xff1084,_0xfa2f24,_0x3610e0,HALF_PI),_0x280bba=Math[_0x12bf55(_0x1d91ae._0x40b671)](_0x11edcd['x']*_0x11edcd['x']+_0x11edcd['y']*_0x11edcd['y']),_0x4ce12b=_0x432c34-_0x280bba,_0x56d7b6=imlfn(_0x4ce12b/this['a'],_0x22b549,_0xff1084,_0xfa2f24,_0x3610e0),_0x2a1418=adjust_lon(this['long0']+Math[_0x12bf55(_0x1d91ae._0x3b3db1)](_0x11edcd['x'],-0x1*_0x11edcd['y'])),_0x11edcd['x']=_0x2a1418,_0x11edcd['y']=_0x56d7b6,_0x11edcd;else return Math['abs'](this['sin_p12']+0x1)<=EPSLN?(_0x432c34=this['a']*mlfn(_0x22b549,_0xff1084,_0xfa2f24,_0x3610e0,HALF_PI),_0x280bba=Math['sqrt'](_0x11edcd['x']*_0x11edcd['x']+_0x11edcd['y']*_0x11edcd['y']),_0x4ce12b=_0x280bba-_0x432c34,_0x56d7b6=imlfn(_0x4ce12b/this['a'],_0x22b549,_0xff1084,_0xfa2f24,_0x3610e0),_0x2a1418=adjust_lon(this['long0']+Math['atan2'](_0x11edcd['x'],_0x11edcd['y'])),_0x11edcd['x']=_0x2a1418,_0x11edcd['y']=_0x56d7b6,_0x11edcd):(_0x280bba=Math['sqrt'](_0x11edcd['x']*_0x11edcd['x']+_0x11edcd['y']*_0x11edcd['y']),_0x44f1b5=Math['atan2'](_0x11edcd['x'],_0x11edcd['y']),_0x52ed5d=gN(this['a'],this['e'],this['sin_p12']),_0x1cd7e5=Math['cos'](_0x44f1b5),_0x2490c0=this['e']*this['cos_p12']*_0x1cd7e5,_0x3c1df0=-_0x2490c0*_0x2490c0/(0x1-this['es']),_0xc08727=0x3*this['es']*(0x1-_0x3c1df0)*this[_0x12bf55(_0x1d91ae._0x38ae60)]*this['cos_p12']*_0x1cd7e5/(0x1-this['es']),_0x4cfaff=_0x280bba/_0x52ed5d,_0x2db7d9=_0x4cfaff-_0x3c1df0*(0x1+_0x3c1df0)*Math[_0x12bf55(_0x1d91ae._0x354794)](_0x4cfaff,0x3)/0x6-_0xc08727*(0x1+0x3*_0x3c1df0)*Math[_0x12bf55(0x1fb)](_0x4cfaff,0x4)/0x18,_0x278fb0=0x1-_0x3c1df0*_0x2db7d9*_0x2db7d9/0x2-_0x4cfaff*_0x2db7d9*_0x2db7d9*_0x2db7d9/0x6,_0x57f8e1=Math[_0x12bf55(_0x1d91ae._0x597ce5)](this[_0x12bf55(0xf9f)]*Math[_0x12bf55(_0x1d91ae._0x245d5f)](_0x2db7d9)+this['cos_p12']*Math[_0x12bf55(_0x1d91ae._0x218ad8)](_0x2db7d9)*_0x1cd7e5),_0x2a1418=adjust_lon(this['long0']+Math[_0x12bf55(0x618)](Math[_0x12bf55(0x723)](_0x44f1b5)*Math[_0x12bf55(_0x1d91ae._0x3c18fd)](_0x2db7d9)/Math['cos'](_0x57f8e1))),_0x2a9ced=Math['sin'](_0x57f8e1),_0x56d7b6=Math['atan2']((_0x2a9ced-this['es']*_0x278fb0*this['sin_p12'])*Math[_0x12bf55(0xdd3)](_0x57f8e1),_0x2a9ced*(0x1-this['es'])),_0x11edcd['x']=_0x2a1418,_0x11edcd['y']=_0x56d7b6,_0x11edcd);}}var names$6=[_0x3d5d32(0xfa0),'aeqd'],aeqd={'init':init$6,'forward':forward$6,'inverse':inverse$6,'names':names$6};function init$5(){this['sin_p14']=Math['sin'](this['lat0']),this['cos_p14']=Math['cos'](this['lat0']);}function forward$5(_0x247e08){const _0x477f3b={_0x2af8a7:0xb7e},_0x5d3aee=_0x3d5d32;var _0xab19ac,_0x3678c8,_0x15b77a,_0x529a67,_0x50035a,_0x190dca,_0xd33548,_0x4b933f,_0x381a48=_0x247e08['x'],_0x45bd9e=_0x247e08['y'];return _0x15b77a=adjust_lon(_0x381a48-this['long0']),_0xab19ac=Math['sin'](_0x45bd9e),_0x3678c8=Math['cos'](_0x45bd9e),_0x529a67=Math[_0x5d3aee(0x256)](_0x15b77a),_0x190dca=this['sin_p14']*_0xab19ac+this[_0x5d3aee(0xb7e)]*_0x3678c8*_0x529a67,_0x50035a=0x1,(_0x190dca>0x0||Math['abs'](_0x190dca)<=EPSLN)&&(_0xd33548=this['a']*_0x50035a*_0x3678c8*Math['sin'](_0x15b77a),_0x4b933f=this['y0']+this['a']*_0x50035a*(this[_0x5d3aee(_0x477f3b._0x2af8a7)]*_0xab19ac-this['sin_p14']*_0x3678c8*_0x529a67)),_0x247e08['x']=_0xd33548,_0x247e08['y']=_0x4b933f,_0x247e08;}function inverse$5(_0x2d71f4){const _0x3425ce={_0x69f08a:0x7cd,_0x55ebb9:0xb7e},_0x224932=_0x3d5d32;var _0x47817c,_0x5e0568,_0x2cb143,_0x3e52a4,_0x72942c,_0x4740d4,_0x345f13;_0x2d71f4['x']-=this['x0'],_0x2d71f4['y']-=this['y0'],_0x47817c=Math['sqrt'](_0x2d71f4['x']*_0x2d71f4['x']+_0x2d71f4['y']*_0x2d71f4['y']),_0x5e0568=asinz(_0x47817c/this['a']),_0x2cb143=Math[_0x224932(0x723)](_0x5e0568),_0x3e52a4=Math['cos'](_0x5e0568),_0x4740d4=this[_0x224932(_0x3425ce._0x69f08a)];if(Math[_0x224932(0x4ba)](_0x47817c)<=EPSLN)return _0x345f13=this[_0x224932(0xa41)],_0x2d71f4['x']=_0x4740d4,_0x2d71f4['y']=_0x345f13,_0x2d71f4;_0x345f13=asinz(_0x3e52a4*this['sin_p14']+_0x2d71f4['y']*_0x2cb143*this[_0x224932(_0x3425ce._0x55ebb9)]/_0x47817c),_0x72942c=Math['abs'](this['lat0'])-HALF_PI;if(Math['abs'](_0x72942c)<=EPSLN)return this['lat0']>=0x0?_0x4740d4=adjust_lon(this['long0']+Math['atan2'](_0x2d71f4['x'],-_0x2d71f4['y'])):_0x4740d4=adjust_lon(this['long0']-Math['atan2'](-_0x2d71f4['x'],_0x2d71f4['y'])),_0x2d71f4['x']=_0x4740d4,_0x2d71f4['y']=_0x345f13,_0x2d71f4;return _0x4740d4=adjust_lon(this[_0x224932(_0x3425ce._0x69f08a)]+Math['atan2'](_0x2d71f4['x']*_0x2cb143,_0x47817c*this['cos_p14']*_0x3e52a4-_0x2d71f4['y']*this['sin_p14']*_0x2cb143)),_0x2d71f4['x']=_0x4740d4,_0x2d71f4['y']=_0x345f13,_0x2d71f4;}var names$5=[_0x3d5d32(0xffc)],ortho={'init':init$5,'forward':forward$5,'inverse':inverse$5,'names':names$5},FACE_ENUM={'FRONT':0x1,'RIGHT':0x2,'BACK':0x3,'LEFT':0x4,'TOP':0x5,'BOTTOM':0x6},AREA_ENUM={'AREA_0':0x1,'AREA_1':0x2,'AREA_2':0x3,'AREA_3':0x4};function init$4(){const _0x378430={_0x1f64ad:0xa41,_0x27cdd3:0xfb1,_0x502847:0xd01,_0x5c7f26:0xac5,_0x319c52:0xd01,_0x1a0050:0xea1,_0x2a793b:0xe9d},_0x5d1e46=_0x3d5d32;this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this[_0x5d1e46(_0x378430._0x1f64ad)]=this['lat0']||0x0,this[_0x5d1e46(0x7cd)]=this['long0']||0x0,this['lat_ts']=this[_0x5d1e46(_0x378430._0x27cdd3)]||0x0,this['title']=this['title']||'Quadrilateralized\x20Spherical\x20Cube';if(this['lat0']>=HALF_PI-FORTPI/0x2)this[_0x5d1e46(_0x378430._0x502847)]=FACE_ENUM['TOP'];else{if(this['lat0']<=-(HALF_PI-FORTPI/0x2))this['face']=FACE_ENUM[_0x5d1e46(_0x378430._0x5c7f26)];else{if(Math['abs'](this['long0'])<=FORTPI)this['face']=FACE_ENUM[_0x5d1e46(0x353)];else Math['abs'](this['long0'])<=HALF_PI+FORTPI?this[_0x5d1e46(_0x378430._0x319c52)]=this['long0']>0x0?FACE_ENUM['RIGHT']:FACE_ENUM[_0x5d1e46(_0x378430._0x1a0050)]:this['face']=FACE_ENUM[_0x5d1e46(_0x378430._0x2a793b)];}}this['es']!==0x0&&(this[_0x5d1e46(0xcb3)]=0x1-(this['a']-this['b'])/this['a'],this['one_minus_f_squared']=this['one_minus_f']*this['one_minus_f']);}function forward$4(_0x421943){const _0x451045={_0x43123e:0xdd3,_0x8e4f60:0x1062,_0x71fb5a:0xfa9,_0x3b6ad2:0xd01,_0x5cc003:0x234,_0x2d97b1:0xea1,_0x2fa685:0xe2f,_0x442f7d:0xd01,_0x3cb61f:0x1062,_0x54197d:0x392,_0x439163:0x256,_0x4d428c:0x256,_0x2060ef:0x256},_0x530f36=_0x3d5d32;var _0x6dc269={'x':0x0,'y':0x0},_0x3aece3,_0x5597e7,_0xf90165,_0x3c001f,_0x20fb36,_0x1e509f,_0x5c2fc4={'value':0x0};_0x421943['x']-=this['long0'];this['es']!==0x0?_0x3aece3=Math[_0x530f36(0x106c)](this['one_minus_f_squared']*Math[_0x530f36(_0x451045._0x43123e)](_0x421943['y'])):_0x3aece3=_0x421943['y'];_0x5597e7=_0x421943['x'];if(this['face']===FACE_ENUM[_0x530f36(0x1f8)]){_0x3c001f=HALF_PI-_0x3aece3;if(_0x5597e7>=FORTPI&&_0x5597e7<=HALF_PI+FORTPI)_0x5c2fc4[_0x530f36(_0x451045._0x8e4f60)]=AREA_ENUM['AREA_0'],_0xf90165=_0x5597e7-HALF_PI;else{if(_0x5597e7>HALF_PI+FORTPI||_0x5597e7<=-(HALF_PI+FORTPI))_0x5c2fc4['value']=AREA_ENUM['AREA_1'],_0xf90165=_0x5597e7>0x0?_0x5597e7-SPI:_0x5597e7+SPI;else _0x5597e7>-(HALF_PI+FORTPI)&&_0x5597e7<=-FORTPI?(_0x5c2fc4['value']=AREA_ENUM[_0x530f36(_0x451045._0x71fb5a)],_0xf90165=_0x5597e7+HALF_PI):(_0x5c2fc4['value']=AREA_ENUM['AREA_3'],_0xf90165=_0x5597e7);}}else{if(this[_0x530f36(_0x451045._0x3b6ad2)]===FACE_ENUM[_0x530f36(0xac5)]){_0x3c001f=HALF_PI+_0x3aece3;if(_0x5597e7>=FORTPI&&_0x5597e7<=HALF_PI+FORTPI)_0x5c2fc4['value']=AREA_ENUM['AREA_0'],_0xf90165=-_0x5597e7+HALF_PI;else{if(_0x5597e7=-FORTPI)_0x5c2fc4['value']=AREA_ENUM[_0x530f36(0x591)],_0xf90165=-_0x5597e7;else _0x5597e7<-FORTPI&&_0x5597e7>=-(HALF_PI+FORTPI)?(_0x5c2fc4[_0x530f36(0x1062)]=AREA_ENUM['AREA_2'],_0xf90165=-_0x5597e7-HALF_PI):(_0x5c2fc4['value']=AREA_ENUM['AREA_3'],_0xf90165=_0x5597e7>0x0?-_0x5597e7+SPI:-_0x5597e7-SPI);}}else{var _0x20dee6,_0x49d35a,_0xcb02bb,_0x9f354b,_0x33aedc,_0x8746c9,_0x1a610a;if(this['face']===FACE_ENUM[_0x530f36(_0x451045._0x5cc003)])_0x5597e7=qsc_shift_lon_origin(_0x5597e7,+HALF_PI);else{if(this[_0x530f36(0xd01)]===FACE_ENUM['BACK'])_0x5597e7=qsc_shift_lon_origin(_0x5597e7,+SPI);else this['face']===FACE_ENUM[_0x530f36(_0x451045._0x2d97b1)]&&(_0x5597e7=qsc_shift_lon_origin(_0x5597e7,-HALF_PI));}_0x9f354b=Math['sin'](_0x3aece3),_0x33aedc=Math['cos'](_0x3aece3),_0x8746c9=Math['sin'](_0x5597e7),_0x1a610a=Math['cos'](_0x5597e7),_0x20dee6=_0x33aedc*_0x1a610a,_0x49d35a=_0x33aedc*_0x8746c9,_0xcb02bb=_0x9f354b;if(this['face']===FACE_ENUM[_0x530f36(0x353)])_0x3c001f=Math['acos'](_0x20dee6),_0xf90165=qsc_fwd_equat_face_theta(_0x3c001f,_0xcb02bb,_0x49d35a,_0x5c2fc4);else{if(this['face']===FACE_ENUM['RIGHT'])_0x3c001f=Math[_0x530f36(_0x451045._0x2fa685)](_0x49d35a),_0xf90165=qsc_fwd_equat_face_theta(_0x3c001f,_0xcb02bb,-_0x20dee6,_0x5c2fc4);else{if(this[_0x530f36(_0x451045._0x442f7d)]===FACE_ENUM['BACK'])_0x3c001f=Math['acos'](-_0x20dee6),_0xf90165=qsc_fwd_equat_face_theta(_0x3c001f,_0xcb02bb,-_0x49d35a,_0x5c2fc4);else this['face']===FACE_ENUM[_0x530f36(_0x451045._0x2d97b1)]?(_0x3c001f=Math['acos'](-_0x49d35a),_0xf90165=qsc_fwd_equat_face_theta(_0x3c001f,_0xcb02bb,_0x20dee6,_0x5c2fc4)):(_0x3c001f=_0xf90165=0x0,_0x5c2fc4[_0x530f36(_0x451045._0x3cb61f)]=AREA_ENUM[_0x530f36(_0x451045._0x54197d)]);}}}}_0x1e509f=Math['atan'](0xc/SPI*(_0xf90165+Math[_0x530f36(_0x451045._0x2fa685)](Math['sin'](_0xf90165)*Math[_0x530f36(_0x451045._0x439163)](FORTPI))-HALF_PI)),_0x20fb36=Math['sqrt']((0x1-Math['cos'](_0x3c001f))/(Math['cos'](_0x1e509f)*Math[_0x530f36(_0x451045._0x4d428c)](_0x1e509f))/(0x1-Math[_0x530f36(0x256)](Math['atan'](0x1/Math['cos'](_0xf90165)))));if(_0x5c2fc4['value']===AREA_ENUM['AREA_1'])_0x1e509f+=HALF_PI;else{if(_0x5c2fc4[_0x530f36(0x1062)]===AREA_ENUM['AREA_2'])_0x1e509f+=SPI;else _0x5c2fc4['value']===AREA_ENUM['AREA_3']&&(_0x1e509f+=1.5*SPI);}return _0x6dc269['x']=_0x20fb36*Math[_0x530f36(_0x451045._0x2060ef)](_0x1e509f),_0x6dc269['y']=_0x20fb36*Math['sin'](_0x1e509f),_0x6dc269['x']=_0x6dc269['x']*this['a']+this['x0'],_0x6dc269['y']=_0x6dc269['y']*this['a']+this['y0'],_0x421943['x']=_0x6dc269['x'],_0x421943['y']=_0x6dc269['y'],_0x421943;}function inverse$4(_0xa2f1b5){const _0x155631={_0x46fa51:0x392,_0x398369:0x1062,_0x26d0af:0x256,_0xa95b93:0x106c,_0x532ff6:0x1062,_0x132f57:0xac5,_0x351bf3:0x1062,_0x42006f:0xfa9,_0x35fd28:0xae3,_0x137460:0xe9d,_0x14a308:0x6e6,_0x3f411d:0x234,_0x2d4f56:0xe9d,_0x427f22:0xea1,_0x343b0d:0x5da,_0x26f86f:0xdd3,_0x1fe4ac:0xec7},_0x5de749=_0x3d5d32;var _0x4b9a1d={'lam':0x0,'phi':0x0},_0x3f094d,_0x249743,_0x241a5e,_0x8f98a4,_0xaba147,_0x4e274a,_0x3eb7bb,_0x2720d3,_0x23d2f9,_0x3bd0c4={'value':0x0};_0xa2f1b5['x']=(_0xa2f1b5['x']-this['x0'])/this['a'],_0xa2f1b5['y']=(_0xa2f1b5['y']-this['y0'])/this['a'],_0x249743=Math['atan'](Math['sqrt'](_0xa2f1b5['x']*_0xa2f1b5['x']+_0xa2f1b5['y']*_0xa2f1b5['y'])),_0x3f094d=Math['atan2'](_0xa2f1b5['y'],_0xa2f1b5['x']);if(_0xa2f1b5['x']>=0x0&&_0xa2f1b5['x']>=Math[_0x5de749(0x4ba)](_0xa2f1b5['y']))_0x3bd0c4['value']=AREA_ENUM[_0x5de749(_0x155631._0x46fa51)];else{if(_0xa2f1b5['y']>=0x0&&_0xa2f1b5['y']>=Math['abs'](_0xa2f1b5['x']))_0x3bd0c4[_0x5de749(_0x155631._0x398369)]=AREA_ENUM['AREA_1'],_0x3f094d-=HALF_PI;else _0xa2f1b5['x']<0x0&&-_0xa2f1b5['x']>=Math['abs'](_0xa2f1b5['y'])?(_0x3bd0c4['value']=AREA_ENUM['AREA_2'],_0x3f094d=_0x3f094d<0x0?_0x3f094d+SPI:_0x3f094d-SPI):(_0x3bd0c4['value']=AREA_ENUM['AREA_3'],_0x3f094d+=HALF_PI);}_0x23d2f9=SPI/0xc*Math['tan'](_0x3f094d),_0xaba147=Math['sin'](_0x23d2f9)/(Math[_0x5de749(_0x155631._0x26d0af)](_0x23d2f9)-0x1/Math['sqrt'](0x2)),_0x4e274a=Math['atan'](_0xaba147),_0x241a5e=Math['cos'](_0x3f094d),_0x8f98a4=Math[_0x5de749(0xdd3)](_0x249743),_0x3eb7bb=0x1-_0x241a5e*_0x241a5e*_0x8f98a4*_0x8f98a4*(0x1-Math['cos'](Math[_0x5de749(_0x155631._0xa95b93)](0x1/Math['cos'](_0x4e274a))));if(_0x3eb7bb<-0x1)_0x3eb7bb=-0x1;else _0x3eb7bb>+0x1&&(_0x3eb7bb=+0x1);if(this['face']===FACE_ENUM['TOP']){_0x2720d3=Math['acos'](_0x3eb7bb),_0x4b9a1d['phi']=HALF_PI-_0x2720d3;if(_0x3bd0c4['value']===AREA_ENUM[_0x5de749(0x392)])_0x4b9a1d[_0x5de749(0x5da)]=_0x4e274a+HALF_PI;else{if(_0x3bd0c4[_0x5de749(_0x155631._0x532ff6)]===AREA_ENUM['AREA_1'])_0x4b9a1d['lam']=_0x4e274a<0x0?_0x4e274a+SPI:_0x4e274a-SPI;else _0x3bd0c4['value']===AREA_ENUM['AREA_2']?_0x4b9a1d['lam']=_0x4e274a-HALF_PI:_0x4b9a1d['lam']=_0x4e274a;}}else{if(this['face']===FACE_ENUM[_0x5de749(_0x155631._0x132f57)]){_0x2720d3=Math[_0x5de749(0xe2f)](_0x3eb7bb),_0x4b9a1d[_0x5de749(0x6e6)]=_0x2720d3-HALF_PI;if(_0x3bd0c4['value']===AREA_ENUM['AREA_0'])_0x4b9a1d['lam']=-_0x4e274a+HALF_PI;else{if(_0x3bd0c4[_0x5de749(_0x155631._0x351bf3)]===AREA_ENUM['AREA_1'])_0x4b9a1d['lam']=-_0x4e274a;else _0x3bd0c4['value']===AREA_ENUM[_0x5de749(_0x155631._0x42006f)]?_0x4b9a1d['lam']=-_0x4e274a-HALF_PI:_0x4b9a1d['lam']=_0x4e274a<0x0?-_0x4e274a-SPI:-_0x4e274a+SPI;}}else{var _0x13a63c,_0x17344e,_0x5511a1;_0x13a63c=_0x3eb7bb,_0x23d2f9=_0x13a63c*_0x13a63c;_0x23d2f9>=0x1?_0x5511a1=0x0:_0x5511a1=Math[_0x5de749(_0x155631._0x35fd28)](0x1-_0x23d2f9)*Math[_0x5de749(0x723)](_0x4e274a);_0x23d2f9+=_0x5511a1*_0x5511a1;_0x23d2f9>=0x1?_0x17344e=0x0:_0x17344e=Math['sqrt'](0x1-_0x23d2f9);if(_0x3bd0c4['value']===AREA_ENUM['AREA_1'])_0x23d2f9=_0x17344e,_0x17344e=-_0x5511a1,_0x5511a1=_0x23d2f9;else{if(_0x3bd0c4['value']===AREA_ENUM[_0x5de749(0xfa9)])_0x17344e=-_0x17344e,_0x5511a1=-_0x5511a1;else _0x3bd0c4['value']===AREA_ENUM['AREA_3']&&(_0x23d2f9=_0x17344e,_0x17344e=_0x5511a1,_0x5511a1=-_0x23d2f9);}if(this['face']===FACE_ENUM['RIGHT'])_0x23d2f9=_0x13a63c,_0x13a63c=-_0x17344e,_0x17344e=_0x23d2f9;else{if(this['face']===FACE_ENUM[_0x5de749(_0x155631._0x137460)])_0x13a63c=-_0x13a63c,_0x17344e=-_0x17344e;else this['face']===FACE_ENUM['LEFT']&&(_0x23d2f9=_0x13a63c,_0x13a63c=_0x17344e,_0x17344e=-_0x23d2f9);}_0x4b9a1d[_0x5de749(_0x155631._0x14a308)]=Math['acos'](-_0x5511a1)-HALF_PI,_0x4b9a1d[_0x5de749(0x5da)]=Math['atan2'](_0x17344e,_0x13a63c);if(this['face']===FACE_ENUM[_0x5de749(_0x155631._0x3f411d)])_0x4b9a1d['lam']=qsc_shift_lon_origin(_0x4b9a1d['lam'],-HALF_PI);else{if(this['face']===FACE_ENUM[_0x5de749(_0x155631._0x2d4f56)])_0x4b9a1d['lam']=qsc_shift_lon_origin(_0x4b9a1d[_0x5de749(0x5da)],-SPI);else this['face']===FACE_ENUM[_0x5de749(_0x155631._0x427f22)]&&(_0x4b9a1d['lam']=qsc_shift_lon_origin(_0x4b9a1d[_0x5de749(_0x155631._0x343b0d)],+HALF_PI));}}}if(this['es']!==0x0){var _0x9442b0,_0xb9ce57,_0x1a1b0a;_0x9442b0=_0x4b9a1d['phi']<0x0?0x1:0x0,_0xb9ce57=Math[_0x5de749(_0x155631._0x26f86f)](_0x4b9a1d[_0x5de749(0x6e6)]),_0x1a1b0a=this['b']/Math['sqrt'](_0xb9ce57*_0xb9ce57+this[_0x5de749(_0x155631._0x1fe4ac)]),_0x4b9a1d['phi']=Math[_0x5de749(0x106c)](Math['sqrt'](this['a']*this['a']-_0x1a1b0a*_0x1a1b0a)/(this['one_minus_f']*_0x1a1b0a)),_0x9442b0&&(_0x4b9a1d['phi']=-_0x4b9a1d[_0x5de749(_0x155631._0x14a308)]);}return _0x4b9a1d[_0x5de749(_0x155631._0x343b0d)]+=this['long0'],_0xa2f1b5['x']=_0x4b9a1d['lam'],_0xa2f1b5['y']=_0x4b9a1d['phi'],_0xa2f1b5;}function qsc_fwd_equat_face_theta(_0x32508a,_0x22e41f,_0x31d9fc,_0x581e6b){var _0x23f92b;if(_0x32508aFORTPI&&_0x23f92b<=HALF_PI+FORTPI)_0x581e6b['value']=AREA_ENUM['AREA_1'],_0x23f92b-=HALF_PI;else _0x23f92b>HALF_PI+FORTPI||_0x23f92b<=-(HALF_PI+FORTPI)?(_0x581e6b['value']=AREA_ENUM['AREA_2'],_0x23f92b=_0x23f92b>=0x0?_0x23f92b-SPI:_0x23f92b+SPI):(_0x581e6b['value']=AREA_ENUM['AREA_3'],_0x23f92b+=HALF_PI);}}return _0x23f92b;}function qsc_shift_lon_origin(_0x4748f2,_0x3fa854){var _0x5632cf=_0x4748f2+_0x3fa854;if(_0x5632cf<-SPI)_0x5632cf+=TWO_PI;else _0x5632cf>+SPI&&(_0x5632cf-=TWO_PI);return _0x5632cf;}var names$4=[_0x3d5d32(0x573),'Quadrilateralized_Spherical_Cube','qsc'],qsc={'init':init$4,'forward':forward$4,'inverse':inverse$4,'names':names$4},COEFS_X=[[0x1,2.2199e-17,-0.0000715515,0.0000031103],[0.9986,-0.000482243,-0.000024897,-0.0000013309],[0.9954,-0.00083103,-0.0000448605,-9.86701e-7],[0.99,-0.00135364,-0.000059661,0.0000036777],[0.9822,-0.00167442,-0.00000449547,-0.00000572411],[0.973,-0.00214868,-0.0000903571,1.8736e-8],[0.96,-0.00305085,-0.0000900761,0.00000164917],[0.9427,-0.00382792,-0.0000653386,-0.0000026154],[0.9216,-0.00467746,-0.00010457,0.00000481243],[0.8962,-0.00536223,-0.0000323831,-0.00000543432],[0.8679,-0.00609363,-0.000113898,0.00000332484],[0.835,-0.00698325,-0.0000640253,9.34959e-7],[0.7986,-0.00755338,-0.0000500009,9.35324e-7],[0.7597,-0.00798324,-0.000035971,-0.00000227626],[0.7186,-0.00851367,-0.0000701149,-0.0000086303],[0.6732,-0.00986209,-0.000199569,0.0000191974],[0.6213,-0.010418,0.0000883923,0.00000624051],[0.5722,-0.00906601,0.000182,0.00000624051],[0.5322,-0.00677797,0.000275608,0.00000624051]],COEFS_Y=[[-5.20417e-18,0.0124,1.21431e-18,-8.45284e-11],[0.062,0.0124,-1.26793e-9,4.22642e-10],[0.124,0.0124,5.07171e-9,-1.60604e-9],[0.186,0.0123999,-1.90189e-8,6.00152e-9],[0.248,0.0124002,7.10039e-8,-2.24e-8],[0.31,0.0123992,-2.64997e-7,8.35986e-8],[0.372,0.0124029,9.88983e-7,-3.11994e-7],[0.434,0.0123893,-0.00000369093,-4.35621e-7],[0.4958,0.0123198,-0.0000102252,-3.45523e-7],[0.5571,0.0121916,-0.0000154081,-5.82288e-7],[0.6176,0.0119938,-0.0000241424,-5.25327e-7],[0.6769,0.011713,-0.0000320223,-5.16405e-7],[0.7346,0.0113541,-0.0000397684,-6.09052e-7],[0.7903,0.0109107,-0.0000489042,-0.00000104739],[0.8435,0.0103431,-0.000064615,-1.40374e-9],[0.8936,0.00969686,-0.000064636,-0.000008547],[0.9394,0.00840947,-0.000192841,-0.0000042106],[0.9761,0.00616527,-0.000256,-0.0000042106],[0x1,0.00328947,-0.000319159,-0.0000042106]],FXC=0.8487,FYC=1.3523,C1=R2D/0x5,RC1=0x1/C1,NODES=0x12,poly3_val=function(_0xf8ec14,_0x30be1b){return _0xf8ec14[0x0]+_0x30be1b*(_0xf8ec14[0x1]+_0x30be1b*(_0xf8ec14[0x2]+_0x30be1b*_0xf8ec14[0x3]));},poly3_der=function(_0x492ecd,_0x495789){return _0x492ecd[0x1]+_0x495789*(0x2*_0x492ecd[0x2]+_0x495789*0x3*_0x492ecd[0x3]);};function newton_rapshon(_0x2e88c2,_0x42b64e,_0x1bcdfe,_0x597692){var _0x2a2b3c=_0x42b64e;for(;_0x597692;--_0x597692){var _0x403339=_0x2e88c2(_0x2a2b3c);_0x2a2b3c-=_0x403339;if(Math['abs'](_0x403339)<_0x1bcdfe)break;}return _0x2a2b3c;}function init$3(){this['x0']=this['x0']||0x0,this['y0']=this['y0']||0x0,this['long0']=this['long0']||0x0,this['es']=0x0,this['title']=this['title']||'Robinson';}function forward$3(_0x44309a){var _0x27e1d1=adjust_lon(_0x44309a['x']-this['long0']),_0x546a0d=Math['abs'](_0x44309a['y']),_0xc5178b=Math['floor'](_0x546a0d*C1);if(_0xc5178b<0x0)_0xc5178b=0x0;else _0xc5178b>=NODES&&(_0xc5178b=NODES-0x1);_0x546a0d=R2D*(_0x546a0d-RC1*_0xc5178b);var _0x189a5e={'x':poly3_val(COEFS_X[_0xc5178b],_0x546a0d)*_0x27e1d1,'y':poly3_val(COEFS_Y[_0xc5178b],_0x546a0d)};return _0x44309a['y']<0x0&&(_0x189a5e['y']=-_0x189a5e['y']),_0x189a5e['x']=_0x189a5e['x']*this['a']*FXC+this['x0'],_0x189a5e['y']=_0x189a5e['y']*this['a']*FYC+this['y0'],_0x189a5e;}function inverse$3(_0x193c62){const _0x2857d7=_0x3d5d32;var _0x321f7d={'x':(_0x193c62['x']-this['x0'])/(this['a']*FXC),'y':Math['abs'](_0x193c62['y']-this['y0'])/(this['a']*FYC)};if(_0x321f7d['y']>=0x1)_0x321f7d['x']/=COEFS_X[NODES][0x0],_0x321f7d['y']=_0x193c62['y']<0x0?-HALF_PI:HALF_PI;else{var _0x2eaae3=Math[_0x2857d7(0x6fa)](_0x321f7d['y']*NODES);if(_0x2eaae3<0x0)_0x2eaae3=0x0;else _0x2eaae3>=NODES&&(_0x2eaae3=NODES-0x1);for(;;){if(COEFS_Y[_0x2eaae3][0x0]>_0x321f7d['y'])--_0x2eaae3;else{if(COEFS_Y[_0x2eaae3+0x1][0x0]<=_0x321f7d['y'])++_0x2eaae3;else break;}}var _0x6f576b=COEFS_Y[_0x2eaae3],_0x19253b=0x5*(_0x321f7d['y']-_0x6f576b[0x0])/(COEFS_Y[_0x2eaae3+0x1][0x0]-_0x6f576b[0x0]);_0x19253b=newton_rapshon(function(_0x1689b6){return(poly3_val(_0x6f576b,_0x1689b6)-_0x321f7d['y'])/poly3_der(_0x6f576b,_0x1689b6);},_0x19253b,EPSLN,0x64),_0x321f7d['x']/=poly3_val(COEFS_X[_0x2eaae3],_0x19253b),_0x321f7d['y']=(0x5*_0x2eaae3+_0x19253b)*D2R$1,_0x193c62['y']<0x0&&(_0x321f7d['y']=-_0x321f7d['y']);}return _0x321f7d['x']=adjust_lon(_0x321f7d['x']+this['long0']),_0x321f7d;}var names$3=['Robinson','robin'],robin={'init':init$3,'forward':forward$3,'inverse':inverse$3,'names':names$3};function init$2(){const _0x1121a8=_0x3d5d32;this[_0x1121a8(0xaed)]='geocent';}function forward$2(_0x37c13b){var _0x3b62cf=geodeticToGeocentric(_0x37c13b,this['es'],this['a']);return _0x3b62cf;}function inverse$2(_0x57f7b7){var _0x3ed5ae=geocentricToGeodetic(_0x57f7b7,this['es'],this['a'],this['b']);return _0x3ed5ae;}var names$2=['Geocentric','geocentric',_0x3d5d32(0xa34),_0x3d5d32(0xc21)],geocent={'init':init$2,'forward':forward$2,'inverse':inverse$2,'names':names$2},mode={'N_POLE':0x0,'S_POLE':0x1,'EQUIT':0x2,'OBLIQ':0x3},params={'h':{'def':0x186a0,'num':!![]},'azi':{'def':0x0,'num':!![],'degrees':!![]},'tilt':{'def':0x0,'num':!![],'degrees':!![]},'long0':{'def':0x0,'num':!![]},'lat0':{'def':0x0,'num':!![]}};function init$1(){const _0x2f8bf1={_0x3d7d2c:0x4ba,_0x2cde84:0xea2,_0xf89f33:0x6e1,_0x52f6ee:0x6fc,_0x45fdaf:0xa41,_0x36b213:0x3d0,_0x1c5245:0x8a6,_0x368b01:0x723},_0x488fde=_0x3d5d32;Object['keys'](params)['forEach'](function(_0x4d2689){if(typeof this[_0x4d2689]==='undefined')this[_0x4d2689]=params[_0x4d2689]['def'];else{if(params[_0x4d2689]['num']&&isNaN(this[_0x4d2689]))throw new Error('Invalid\x20parameter\x20value,\x20must\x20be\x20numeric\x20'+_0x4d2689+'\x20=\x20'+this[_0x4d2689]);else params[_0x4d2689]['num']&&(this[_0x4d2689]=parseFloat(this[_0x4d2689]));}params[_0x4d2689]['degrees']&&(this[_0x4d2689]=this[_0x4d2689]*D2R$1);}['bind'](this));if(Math['abs'](Math[_0x488fde(_0x2f8bf1._0x3d7d2c)](this['lat0'])-HALF_PI)0x2540be400)throw new Error('Invalid\x20height');this['p']=0x1+this[_0x488fde(_0x2f8bf1._0x1c5245)],this['rp']=0x1/this['p'],this['h1']=0x1/this[_0x488fde(0x8a6)],this['pfact']=(this['p']+0x1)*this['h1'],this['es']=0x0;var _0x56a487=this['tilt'],_0x1ecb2a=this['azi'];this['cg']=Math['cos'](_0x1ecb2a),this['sg']=Math[_0x488fde(_0x2f8bf1._0x368b01)](_0x1ecb2a),this['cw']=Math['cos'](_0x56a487),this['sw']=Math['sin'](_0x56a487);}function forward$1(_0x48f82c){const _0x48c693={_0x4cf68c:0x8a6,_0x148ea5:0x3d0,_0x52ca02:0x625},_0x2efe1e=_0x3d5d32;_0x48f82c['x']-=this['long0'];var _0x53acdf=Math['sin'](_0x48f82c['y']),_0x1933ba=Math[_0x2efe1e(0x256)](_0x48f82c['y']),_0x595014=Math[_0x2efe1e(0x256)](_0x48f82c['x']),_0x168958,_0x10b1d6;switch(this[_0x2efe1e(0x6e1)]){case mode['OBLIQ']:_0x10b1d6=this['sinph0']*_0x53acdf+this[_0x2efe1e(0x3d0)]*_0x1933ba*_0x595014;break;case mode['EQUIT']:_0x10b1d6=_0x1933ba*_0x595014;break;case mode['S_POLE']:_0x10b1d6=-_0x53acdf;break;case mode['N_POLE']:_0x10b1d6=_0x53acdf;break;}_0x10b1d6=this[_0x2efe1e(_0x48c693._0x4cf68c)]/(this['p']-_0x10b1d6),_0x168958=_0x10b1d6*_0x1933ba*Math['sin'](_0x48f82c['x']);switch(this['mode']){case mode['OBLIQ']:_0x10b1d6*=this[_0x2efe1e(_0x48c693._0x148ea5)]*_0x53acdf-this[_0x2efe1e(_0x48c693._0x52ca02)]*_0x1933ba*_0x595014;break;case mode['EQUIT']:_0x10b1d6*=_0x53acdf;break;case mode['N_POLE']:_0x10b1d6*=-(_0x1933ba*_0x595014);break;case mode['S_POLE']:_0x10b1d6*=_0x1933ba*_0x595014;break;}var _0x3762b3,_0x32f702;return _0x3762b3=_0x10b1d6*this['cg']+_0x168958*this['sg'],_0x32f702=0x1/(_0x3762b3*this['sw']*this['h1']+this['cw']),_0x168958=(_0x168958*this['cg']-_0x10b1d6*this['sg'])*this['cw']*_0x32f702,_0x10b1d6=_0x3762b3*_0x32f702,_0x48f82c['x']=_0x168958*this['a'],_0x48f82c['y']=_0x10b1d6*this['a'],_0x48f82c;}function inverse$1(_0x26fd5c){const _0x4fbcbd={_0x115acf:0x618,_0x3ca830:0x3d0,_0x508b0a:0x723,_0x3716e8:0x618},_0x585203=_0x3d5d32;_0x26fd5c['x']/=this['a'],_0x26fd5c['y']/=this['a'];var _0x524f1c={'x':_0x26fd5c['x'],'y':_0x26fd5c['y']},_0x4dcd9e,_0x3ccd5b,_0x1ce0e8;_0x1ce0e8=0x1/(this['pn1']-_0x26fd5c['y']*this['sw']),_0x4dcd9e=this['pn1']*_0x26fd5c['x']*_0x1ce0e8,_0x3ccd5b=this['pn1']*_0x26fd5c['y']*this['cw']*_0x1ce0e8,_0x26fd5c['x']=_0x4dcd9e*this['cg']+_0x3ccd5b*this['sg'],_0x26fd5c['y']=_0x3ccd5b*this['cg']-_0x4dcd9e*this['sg'];var _0x48a3a5=hypot(_0x26fd5c['x'],_0x26fd5c['y']);if(Math['abs'](_0x48a3a5)0x2540be400)throw new Error();this['radius_g']=0x1+this['radius_g_1'],this['C']=this[_0x7565d4(_0x5af4e0._0x244bc4)]*this[_0x7565d4(_0x5af4e0._0x5648b4)]-0x1;if(this['es']!==0x0){var _0x17716f=0x1-this['es'],_0x1962ed=0x1/_0x17716f;this['radius_p']=Math[_0x7565d4(_0x5af4e0._0x3a7b9e)](_0x17716f),this['radius_p2']=_0x17716f,this['radius_p_inv2']=_0x1962ed,this[_0x7565d4(_0x5af4e0._0x45e21a)]=_0x7565d4(_0x5af4e0._0x3528e8);}else this['radius_p']=0x1,this['radius_p2']=0x1,this['radius_p_inv2']=0x1,this['shape']=_0x7565d4(_0x5af4e0._0x1701ae);!this['title']&&(this['title']='Geostationary\x20Satellite\x20View');}function forward(_0x1e5946){const _0x34d38b={_0x166cf5:0x866,_0x465f3a:0x256,_0x4b463c:0xbfa},_0x5827b6=_0x3d5d32;var _0x3f1a9d=_0x1e5946['x'],_0x3c9f91=_0x1e5946['y'],_0x1fd003,_0x5dc6c9,_0x9fae7b,_0x560cd1;_0x3f1a9d=_0x3f1a9d-this[_0x5827b6(0x7cd)];if(this['shape']===_0x5827b6(0x892)){_0x3c9f91=Math['atan'](this['radius_p2']*Math['tan'](_0x3c9f91));var _0x1ba458=this['radius_p']/hypot(this['radius_p']*Math['cos'](_0x3c9f91),Math['sin'](_0x3c9f91));_0x5dc6c9=_0x1ba458*Math['cos'](_0x3f1a9d)*Math['cos'](_0x3c9f91),_0x9fae7b=_0x1ba458*Math['sin'](_0x3f1a9d)*Math[_0x5827b6(0x256)](_0x3c9f91),_0x560cd1=_0x1ba458*Math['sin'](_0x3c9f91);if((this[_0x5827b6(0x4c8)]-_0x5dc6c9)*_0x5dc6c9-_0x9fae7b*_0x9fae7b-_0x560cd1*_0x560cd1*this['radius_p_inv2']<0x0)return _0x1e5946['x']=Number['NaN'],_0x1e5946['y']=Number[_0x5827b6(0xc82)],_0x1e5946;_0x1fd003=this['radius_g']-_0x5dc6c9,this['flip_axis']?(_0x1e5946['x']=this['radius_g_1']*Math[_0x5827b6(0x106c)](_0x9fae7b/hypot(_0x560cd1,_0x1fd003)),_0x1e5946['y']=this['radius_g_1']*Math['atan'](_0x560cd1/_0x1fd003)):(_0x1e5946['x']=this['radius_g_1']*Math['atan'](_0x9fae7b/_0x1fd003),_0x1e5946['y']=this[_0x5827b6(0xbfa)]*Math['atan'](_0x560cd1/hypot(_0x9fae7b,_0x1fd003)));}else this[_0x5827b6(_0x34d38b._0x166cf5)]==='sphere'&&(_0x1fd003=Math[_0x5827b6(_0x34d38b._0x465f3a)](_0x3c9f91),_0x5dc6c9=Math['cos'](_0x3f1a9d)*_0x1fd003,_0x9fae7b=Math[_0x5827b6(0x723)](_0x3f1a9d)*_0x1fd003,_0x560cd1=Math[_0x5827b6(0x723)](_0x3c9f91),_0x1fd003=this['radius_g']-_0x5dc6c9,this['flip_axis']?(_0x1e5946['x']=this['radius_g_1']*Math['atan'](_0x9fae7b/hypot(_0x560cd1,_0x1fd003)),_0x1e5946['y']=this[_0x5827b6(_0x34d38b._0x4b463c)]*Math['atan'](_0x560cd1/_0x1fd003)):(_0x1e5946['x']=this['radius_g_1']*Math['atan'](_0x9fae7b/_0x1fd003),_0x1e5946['y']=this[_0x5827b6(_0x34d38b._0x4b463c)]*Math['atan'](_0x560cd1/hypot(_0x9fae7b,_0x1fd003))));return _0x1e5946['x']=_0x1e5946['x']*this['a'],_0x1e5946['y']=_0x1e5946['y']*this['a'],_0x1e5946;}function inverse(_0xaef078){const _0x5bc631={_0x1d7d38:0xdd3,_0x1717e6:0xc9d,_0x7322bb:0xbfa,_0x42b73:0x4c8,_0x55c941:0x256},_0x393f6d=_0x3d5d32;var _0x564f7e=-0x1,_0x50f7ad=0x0,_0x247212=0x0,_0x53f802,_0xdecbcd,_0x56e693,_0x52ac7d;_0xaef078['x']=_0xaef078['x']/this['a'],_0xaef078['y']=_0xaef078['y']/this['a'];if(this['shape']==='ellipse'){this['flip_axis']?(_0x247212=Math[_0x393f6d(_0x5bc631._0x1d7d38)](_0xaef078['y']/this['radius_g_1']),_0x50f7ad=Math[_0x393f6d(_0x5bc631._0x1d7d38)](_0xaef078['x']/this[_0x393f6d(0xbfa)])*hypot(0x1,_0x247212)):(_0x50f7ad=Math['tan'](_0xaef078['x']/this['radius_g_1']),_0x247212=Math['tan'](_0xaef078['y']/this['radius_g_1'])*hypot(0x1,_0x50f7ad));var _0x311d44=_0x247212/this[_0x393f6d(0x9fd)];_0x53f802=_0x50f7ad*_0x50f7ad+_0x311d44*_0x311d44+_0x564f7e*_0x564f7e,_0xdecbcd=0x2*this['radius_g']*_0x564f7e,_0x56e693=_0xdecbcd*_0xdecbcd-0x4*_0x53f802*this['C'];if(_0x56e693<0x0)return _0xaef078['x']=Number['NaN'],_0xaef078['y']=Number['NaN'],_0xaef078;_0x52ac7d=(-_0xdecbcd-Math['sqrt'](_0x56e693))/(0x2*_0x53f802),_0x564f7e=this['radius_g']+_0x52ac7d*_0x564f7e,_0x50f7ad*=_0x52ac7d,_0x247212*=_0x52ac7d,_0xaef078['x']=Math['atan2'](_0x50f7ad,_0x564f7e),_0xaef078['y']=Math['atan'](_0x247212*Math[_0x393f6d(0x256)](_0xaef078['x'])/_0x564f7e),_0xaef078['y']=Math['atan'](this[_0x393f6d(_0x5bc631._0x1717e6)]*Math['tan'](_0xaef078['y']));}else{if(this['shape']==='sphere'){this['flip_axis']?(_0x247212=Math[_0x393f6d(_0x5bc631._0x1d7d38)](_0xaef078['y']/this['radius_g_1']),_0x50f7ad=Math['tan'](_0xaef078['x']/this[_0x393f6d(_0x5bc631._0x7322bb)])*Math[_0x393f6d(0xae3)](0x1+_0x247212*_0x247212)):(_0x50f7ad=Math['tan'](_0xaef078['x']/this['radius_g_1']),_0x247212=Math['tan'](_0xaef078['y']/this['radius_g_1'])*Math[_0x393f6d(0xae3)](0x1+_0x50f7ad*_0x50f7ad));_0x53f802=_0x50f7ad*_0x50f7ad+_0x247212*_0x247212+_0x564f7e*_0x564f7e,_0xdecbcd=0x2*this['radius_g']*_0x564f7e,_0x56e693=_0xdecbcd*_0xdecbcd-0x4*_0x53f802*this['C'];if(_0x56e693<0x0)return _0xaef078['x']=Number['NaN'],_0xaef078['y']=Number['NaN'],_0xaef078;_0x52ac7d=(-_0xdecbcd-Math['sqrt'](_0x56e693))/(0x2*_0x53f802),_0x564f7e=this[_0x393f6d(_0x5bc631._0x42b73)]+_0x52ac7d*_0x564f7e,_0x50f7ad*=_0x52ac7d,_0x247212*=_0x52ac7d,_0xaef078['x']=Math['atan2'](_0x50f7ad,_0x564f7e),_0xaef078['y']=Math['atan'](_0x247212*Math[_0x393f6d(_0x5bc631._0x55c941)](_0xaef078['x'])/_0x564f7e);}}return _0xaef078['x']=_0xaef078['x']+this['long0'],_0xaef078;}var names=['Geostationary\x20Satellite\x20View',_0x3d5d32(0x100e),_0x3d5d32(0x8b3)],geos={'init':init,'forward':forward,'inverse':inverse,'names':names};function includedProjections(_0x1247b8){const _0x18f6a1={_0x4e1591:0x1024,_0x251054:0x1024,_0x5c0df2:0xff3,_0x15da11:0xff3,_0x111dab:0xff3,_0x26fe02:0xc9a,_0x20ff61:0x1024},_0xad84ae=_0x3d5d32;_0x1247b8['Proj']['projections']['add'](tmerc),_0x1247b8['Proj'][_0xad84ae(_0x18f6a1._0x4e1591)]['add'](etmerc),_0x1247b8['Proj'][_0xad84ae(0x1024)]['add'](utm),_0x1247b8['Proj']['projections']['add'](sterea),_0x1247b8[_0xad84ae(0xc9a)][_0xad84ae(0x1024)]['add'](stere),_0x1247b8[_0xad84ae(0xc9a)][_0xad84ae(_0x18f6a1._0x4e1591)]['add'](somerc),_0x1247b8['Proj'][_0xad84ae(_0x18f6a1._0x251054)][_0xad84ae(0xff3)](omerc),_0x1247b8['Proj'][_0xad84ae(0x1024)][_0xad84ae(_0x18f6a1._0x5c0df2)](lcc),_0x1247b8[_0xad84ae(0xc9a)]['projections']['add'](krovak),_0x1247b8['Proj']['projections']['add'](cass),_0x1247b8['Proj'][_0xad84ae(0x1024)][_0xad84ae(_0x18f6a1._0x15da11)](laea),_0x1247b8['Proj']['projections']['add'](aea),_0x1247b8['Proj']['projections']['add'](gnom),_0x1247b8['Proj']['projections']['add'](cea),_0x1247b8['Proj']['projections']['add'](eqc),_0x1247b8['Proj'][_0xad84ae(0x1024)][_0xad84ae(_0x18f6a1._0x111dab)](poly),_0x1247b8['Proj'][_0xad84ae(0x1024)]['add'](nzmg),_0x1247b8['Proj']['projections'][_0xad84ae(_0x18f6a1._0x5c0df2)](mill),_0x1247b8['Proj']['projections']['add'](sinu),_0x1247b8[_0xad84ae(_0x18f6a1._0x26fe02)][_0xad84ae(_0x18f6a1._0x251054)]['add'](moll),_0x1247b8['Proj']['projections']['add'](eqdc),_0x1247b8[_0xad84ae(0xc9a)][_0xad84ae(0x1024)]['add'](vandg),_0x1247b8['Proj'][_0xad84ae(0x1024)]['add'](aeqd),_0x1247b8['Proj']['projections']['add'](ortho),_0x1247b8['Proj']['projections']['add'](qsc),_0x1247b8['Proj'][_0xad84ae(_0x18f6a1._0x20ff61)][_0xad84ae(_0x18f6a1._0x15da11)](robin),_0x1247b8['Proj']['projections']['add'](geocent),_0x1247b8['Proj'][_0xad84ae(0x1024)]['add'](tpers),_0x1247b8[_0xad84ae(0xc9a)]['projections']['add'](geos);}proj4['defaultDatum']='WGS84',proj4['Proj']=Projection,proj4['WGS84']=new proj4['Proj'](_0x3d5d32(0xdee)),proj4['Point']=Point,proj4['toPoint']=common,proj4[_0x3d5d32(0x279)]=defs,proj4[_0x3d5d32(0xaf8)]=nadgrid,proj4['transform']=transform,proj4['mgrs']=mgrs,proj4['version']='__VERSION__',includedProjections(proj4);const CRS={'EPSG3857':'EPSG:3857','EPSG4326':'EPSG:4326','EPSG4490':'EPSG:4490','CGCS2000_GK_Zone_3':'CGCS2000_GK_Zone_3','CGCS2000_GK_Zone_6':'CGCS2000_GK_Zone_6','CGCS2000_GK_CM_3':'CGCS2000_GK_CM_3','CGCS2000_GK_CM_6':'CGCS2000_GK_CM_6'},PI$1=3.141592653589793;class LngLatPoint{constructor(_0x354121,_0x5283db,_0x3e66b5){const _0x1bc23={_0x194f08:0x799,_0x46f53b:0xaa2},_0x51bb12=_0x3d5d32;this[_0x51bb12(_0x1bc23._0x194f08)]=Number(_0x354121||0x0),this[_0x51bb12(_0x1bc23._0x46f53b)]=Number(_0x5283db||0x0),this['_alt']=Number(_0x3e66b5||0x0);}get[_0x3d5d32(0x5d8)](){const _0x4f5a04=_0x3d5d32;return this[_0x4f5a04(0x799)];}set[_0x3d5d32(0x5d8)](_0x38f7a1){const _0x46f38b={_0x551d70:0x799},_0x31214f=_0x3d5d32;this[_0x31214f(_0x46f38b._0x551d70)]=+_0x38f7a1,this['_position']=null;}get['lat'](){return this['_lat'];}set[_0x3d5d32(0xd57)](_0x26547b){this['_lat']=+_0x26547b,this['_position']=null;}get['alt'](){return this['_alt']||0x0;}set['alt'](_0x2be247){this['_alt']=+_0x2be247,this['_position']&&this['_position']instanceof Cesium__namespace['Cartesian3']&&(this['_position']=null);}['clone'](){const _0x3bbc4b=new LngLatPoint();return _0x3bbc4b['lng']=this['lng']||0x0,_0x3bbc4b['lat']=this['lat']||0x0,_0x3bbc4b['alt']=this['alt']||0x0,_0x3bbc4b;}['format'](){const _0x316c4c={_0x3dd508:0xd57},_0x13d07b=_0x3d5d32;return this['lng']=formatNum$2(this['lng'],LngLatPoint['FormatLength']),this[_0x13d07b(_0x316c4c._0x3dd508)]=formatNum$2(this['lat'],LngLatPoint['FormatLength']),this[_0x13d07b(0xd29)]=formatNum$2(this[_0x13d07b(0xd29)],LngLatPoint['FormatAltLength']),this;}['toArray'](_0x5d5782){const _0x40392d={_0x12d34b:0xd29},_0x33aa69=_0x3d5d32;return this['format'](),_0x5d5782?[this['lng'],this['lat']]:[this['lng'],this['lat'],this[_0x33aa69(_0x40392d._0x12d34b)]];}['toString'](){return this['format'](),this['lng']+','+this['lat']+','+this['alt'];}['toCartesian'](_0x189373=![]){const _0x1a252e={_0xc0a182:0x87d,_0x74b309:0xe69,_0xa83e46:0xd57},_0x22fd56=_0x3d5d32;return!_0x189373&&this[_0x22fd56(_0x1a252e._0xc0a182)]?this['_position']:Cesium__namespace['Cartesian3'][_0x22fd56(_0x1a252e._0x74b309)](this['lng'],this[_0x22fd56(_0x1a252e._0xa83e46)],this['alt']);}['toCartographic'](){const _0x574871=_0x3d5d32;return Cesium__namespace['Cartographic'][_0x574871(0xe69)](this['lng'],this['lat'],this[_0x574871(0xd29)]);}['toMercator'](){const _0x166391=_0x3d5d32;let _0x3434e9=Math['min'](this['lng'],0xb4);_0x3434e9=Math['max'](_0x3434e9,-0xb4);let _0x4c0be4=Math[_0x166391(0x90c)](this['lat'],85.05112877980659);_0x4c0be4=Math['max'](_0x4c0be4,-85.05112877980659);const _0x19c7a0=_0x3434e9*20037508.34/0xb4;let _0x4828fe=Math[_0x166391(0x7b1)](Math['tan']((0x5a+_0x4c0be4)*PI$1/0x168))/(PI$1/0xb4);return _0x4828fe=_0x4828fe*20037508.34/0xb4,[_0x19c7a0,_0x4828fe,this['alt']];}['equals'](_0x919dcd){const _0x48b898={_0x4cf440:0xaa2},_0x2e027f=_0x3d5d32;return this===_0x919dcd||_0x919dcd instanceof LngLatPoint&&this['_alt']===_0x919dcd['_alt']&&this['_lat']===_0x919dcd[_0x2e027f(_0x48b898._0x4cf440)]&&this['_lng']===_0x919dcd['_lng'];}['valid'](){const _0x14c206={_0x148b4f:0x799},_0x526ecc=_0x3d5d32;if(isNaN(this['_lat'])||isNaN(this['_lng']))return![];if(this['_lat']<-0x5a||this['_lat']>0x5a||this[_0x526ecc(_0x14c206._0x148b4f)]<-0xb4||this['_lng']>0xb4)return![];if(this['_lat']===0x0&&this['_lng']===0x0&&this['_alt']===0x0)return![];return!![];}static['parse'](_0x2ce711,_0x1dd9f1){const _0x311f52={_0x2504eb:0xd57,_0x35244a:0x87d,_0x2f1498:0xd14},_0x555dbc=_0x3d5d32;if(!_0x2ce711)return new LngLatPoint();if(_0x2ce711 instanceof LngLatPoint)return _0x2ce711;let _0x48f95c;if(typeof _0x2ce711==='string')_0x48f95c=LngLatPoint['fromString'](_0x2ce711);else{if(Array[_0x555dbc(0x62b)](_0x2ce711))_0x48f95c=LngLatPoint['fromArray'](_0x2ce711);else{if(_0x2ce711 instanceof LngLatPoint)_0x48f95c=_0x2ce711['clone']();else{if(Cesium__namespace[_0x555dbc(0xb84)](_0x2ce711[_0x555dbc(_0x311f52._0x2504eb)])&&Cesium__namespace['defined'](_0x2ce711['lng'])){_0x48f95c=new LngLatPoint(_0x2ce711['lng'],_0x2ce711[_0x555dbc(0xd57)],_0x2ce711['alt']);for(const _0x10cefb in _0x2ce711){_0x48f95c[_0x10cefb]=_0x2ce711[_0x10cefb];}}else{if(_0x2ce711 instanceof Cesium__namespace['Cartesian3']||_0x2ce711['_value']||_0x2ce711['getValue'])_0x48f95c=LngLatPoint['fromCartesian'](_0x2ce711,_0x1dd9f1),_0x48f95c[_0x555dbc(_0x311f52._0x35244a)]=_0x2ce711;else Cesium__namespace['defined'](_0x2ce711['x'])&&Cesium__namespace[_0x555dbc(0xb84)](_0x2ce711['y'])&&Cesium__namespace['defined'](_0x2ce711['z'])?(_0x2ce711=new Cesium__namespace['Cartesian3'](_0x2ce711['x'],_0x2ce711['y'],_0x2ce711['z']),_0x48f95c=LngLatPoint[_0x555dbc(_0x311f52._0x2f1498)](_0x2ce711,_0x1dd9f1),_0x48f95c[_0x555dbc(0x87d)]=_0x2ce711):(_0x48f95c=new LngLatPoint(),logError$1('坐标解析失败,请确认参数是否无误',_0x2ce711));}}}}return _0x48f95c;}static['fromArray'](_0x462ea8){const _0x8722f9={_0x351b89:0xd29},_0x3ff26c=_0x3d5d32,_0x4cdea6=new LngLatPoint();return Array['isArray'](_0x462ea8)&&(_0x4cdea6['lng']=_0x462ea8[0x0]||0x0,_0x4cdea6['lat']=_0x462ea8[0x1]||0x0,_0x4cdea6[_0x3ff26c(_0x8722f9._0x351b89)]=_0x462ea8[0x2]||0x0),_0x4cdea6;}static['fromString'](_0x448383){const _0x2a71ed=_0x3d5d32;let _0x5a9507=new LngLatPoint();if(_0x448383&&typeof _0x448383==='string'){const _0x1f80f7=_0x448383[_0x2a71ed(0xdaa)](',');_0x5a9507=this['fromArray'](_0x1f80f7);}return _0x5a9507;}static[_0x3d5d32(0xd14)](_0x281ab8,_0x1b0f9b){const _0x36f86e={_0xfb6339:0xd57},_0x30769e=_0x3d5d32,_0x222ef7=new LngLatPoint();let _0x49b3cd;if(_0x281ab8){if(_0x281ab8 instanceof Cesium__namespace['Cartesian3'])_0x49b3cd=_0x281ab8;else{if(_0x281ab8['_value']&&_0x281ab8['_value']instanceof Cesium__namespace['Cartesian3'])_0x49b3cd=_0x281ab8['_value'];else typeof _0x281ab8['getValue']==='function'&&(_0x49b3cd=_0x281ab8['getValue'](_0x1b0f9b||Cesium__namespace['JulianDate']['now']()));}}if(_0x49b3cd){const _0xf10854=Cesium__namespace['Cartographic']['fromCartesian'](_0x49b3cd);_0xf10854&&(_0x222ef7[_0x30769e(_0x36f86e._0xfb6339)]=Cesium__namespace['Math']['toDegrees'](_0xf10854['latitude']),_0x222ef7['lng']=Cesium__namespace['Math']['toDegrees'](_0xf10854[_0x30769e(0xbfd)]),_0x222ef7['alt']=_0xf10854['height'],_0x222ef7['format']());}return _0x222ef7['_position']=_0x281ab8,_0x222ef7;}static['fromCartographic'](_0x46ab70){const _0x318811={_0x566e19:0xa1f,_0x5d212f:0x406,_0x401ccb:0xbfd},_0x527165=_0x3d5d32,_0x52ada4=new LngLatPoint();return _0x52ada4[_0x527165(0xd57)]=Cesium__namespace['Math'][_0x527165(_0x318811._0x566e19)](_0x46ab70[_0x527165(_0x318811._0x5d212f)]),_0x52ada4['lng']=Cesium__namespace['Math']['toDegrees'](_0x46ab70[_0x527165(_0x318811._0x401ccb)]),_0x52ada4['alt']=_0x46ab70['height'],_0x52ada4;}static['fromMercator'](_0x18305c){const _0x5d5121={_0x27da7d:0x106c},_0x1ff505=_0x3d5d32,_0x4af6b2=Number(_0x18305c[0x0]),_0x2de955=Number(_0x18305c[0x1]),_0x4688f3=_0x4af6b2/20037508.34*0xb4;let _0x3492ac=_0x2de955/20037508.34*0xb4;_0x3492ac=0xb4/PI$1*(0x2*Math[_0x1ff505(_0x5d5121._0x27da7d)](Math[_0x1ff505(0x102e)](_0x3492ac*PI$1/0xb4))-PI$1/0x2);const _0x5c5e28=new LngLatPoint(_0x4688f3,_0x3492ac,_0x18305c[0x2]||0x0);return _0x5c5e28;}static['toCartesian'](_0x2e174e,_0x3b749c){const _0x2da003={_0x456cb6:0xe95},_0x17ce97=_0x3d5d32;if(!_0x2e174e||_0x2e174e instanceof Cesium__namespace[_0x17ce97(_0x2da003._0x456cb6)])return _0x2e174e;return LngLatPoint['parse'](_0x2e174e,_0x3b749c)[_0x17ce97(0xed4)](!![]);}static['toCartographic'](_0xf56d40,_0xd924fc){if(!_0xf56d40||_0xf56d40 instanceof Cesium__namespace['Cartographic'])return _0xf56d40;return LngLatPoint['parse'](_0xf56d40,_0xd924fc)['toCartographic']();}static['toArray'](_0x415c11,_0x14bb2a){const _0x9a73b1={_0x25f478:0x4d4},_0xd25403=_0x3d5d32,_0x126a35=LngLatPoint['parse'](_0x415c11);if(!_0x126a35||!_0x126a35['valid']())return[];return _0x126a35[_0xd25403(_0x9a73b1._0x25f478)](_0x14bb2a);}}LngLatPoint[_0x3d5d32(0xf6e)]=0x6,LngLatPoint['FormatAltLength']=0x1;function _0x1bfe(){const _0x4c13b5=['_second','billboardStyleConver','_measureExLine_positions','fullscreen','_numberOfPoints','LngLatPoint','_setEditCursor','Cesium3DTileFeature','distanceHorStr','+proj=tmerc\x20+lat_0=0\x20+lon_0=102\x20+k=1\x20+x_0=34500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_popupConfig','font_family','closeOnClick','_speed','ComputeCommand','_openByClick','Safari','Mark\x20points','rotateMatrix','pointToLngLat','onPointTrans','ipod','prototype','sidesWidthRatio','requestVertexNormals','updateGraphic','attributes','CircleScan','挖地坐标数据存在问题!','_onRightUpHandler','_measureLable','GoogleEarthEnterpriseMetadata','_stopEditingHook','_clampToGround_reload','image/jpeg','_pickImageryLayerFeatures','uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20cmi)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(cmi);\x0a\x20\x20vec2\x20st\x20=\x20cmi.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0)\x20*\x20direction;\x0a\x20\x20vec2\x20st1\x20=\x20vec2(fract(st.s\x20-\x20t),\x20st.t);\x0a\x20\x20vec4\x20color\x20=\x20vec4(0.,\x200.,\x200.,\x200.);\x0a\x20\x20float\x20alpha\x20=\x201.\x20-\x20st.t;\x0a\x20\x20float\x20value\x20=\x20fract(st1.s\x20/\x200.25);\x0a\x20\x20alpha\x20*=\x20sin(value\x20*\x203.1415926);\x0a\x20\x20color\x20=\x20vec4(u_color.rgb\x20*\x20u_color.a,\x20alpha\x20*\x201.2);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a','offset','_topHeights','graphics','disable','sin_p12','Azimuthal_Equidistant','normalOffsetScale','star','createGeometry','u_mars3d_clip_maxRangeLength','excludedKeys','未查询到相关结果!','updateDraggers','_rectangularSensorMars','AREA_2','VertexArray','_projection','Route\x20类不支持autoSurfaceHeight方法\x20!','fa\x20fa-reorder','TEXTURE_MAG_FILTER','','http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid=','lat_ts','clampTo3DTileset','_default_cursor','_unbindDocumentEvent','left','MultiPolygon','colorOptsConver','polylineCollection','onlyPoint','_moveMaxHeight','_measureExLine','setTime','_toOneJson_Poly','getValue','_getFlagForKeyCode','编辑时_map不能为空,请将对象添加到图层,并且图层已添加到Map','scene','ImageryLayer','_showDomeSurfaces','_rate_positions','clockStop','executeGlobeCommands','_onKeyDown','_bindHierarchy','_updateMatrixRotatePosition','onclick','_纬度','handler','fa\x20fa-dashboard','CesiumTerrainProvider','_primitive_billboard','TextureWrap','_muyao','_cacheGrid','mapChinaCRS','_hasEditHeading','Mark\x20rectangular','視角切換','status','cta','PROJECTION','rings','hierarchy','opacity','_fillColor','content','disableEdit','old_depthTestAgainstTerrain','things','_smallTooltip','uniforms','_attr','TRANSLUCENT','GEODETICCRS','_fillColor_alpha_bak','toMercator','homeButton','clustering','focalDistance','addScanPlane','sinlat0','ro0','_tilesetMatrix','result_type','_errorEvent','terrainChange','add','uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20time\x20=\x200.0;\x0amat2\x20m2\x20=\x20mat2(0.80,\x200.60,\x20-0.60,\x200.80);\x0a\x0amat2\x20mars3d_makem(in\x20float\x20theta)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(theta);\x0a\x20\x20float\x20s\x20=\x20sin(theta);\x0a\x20\x20return\x20mat2(c,\x20-s,\x20s,\x20c);\x0a}\x0a\x0afloat\x20noise(in\x20vec2\x20x)\x20{\x0a\x20\x20return\x20texture(specularMap,\x20x\x20*\x20.01).x;\x0a}\x0a\x0afloat\x20mars3d_fbm(in\x20vec2\x20p)\x20{\x0a\x20\x20float\x20z\x20=\x202.;\x0a\x20\x20float\x20rz\x20=\x200.;\x0a\x20\x20for(float\x20i\x20=\x201.;\x20i\x20<\x207.;\x20i++)\x20{\x0a\x20\x20\x20\x20rz\x20+=\x20abs((noise(p)\x20-\x200.5)\x20*\x202.)\x20/\x20z;\x0a\x20\x20\x20\x20z\x20=\x20z\x20*\x202.;\x0a\x20\x20\x20\x20p\x20=\x20p\x20*\x202.;\x0a\x20\x20\x20\x20p\x20*=\x20m2;\x0a\x20\x20}\x0a\x20\x20return\x20rz;\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20time\x20=\x20czm_frameNumber\x20/\x20200.0;\x0a\x20\x20vec2\x20p\x20=\x202.\x20*\x20vUv.xy\x20-\x20vec2(1.,\x201.);\x0a\x20\x20vec2\x20bp\x20=\x20p;\x0a\x0a\x20\x20#ifndef\x20CENTERED\x0a\x20\x20p\x20+=\x205.;\x0a\x20\x20p\x20*=\x2030.;\x0a\x20\x20#endif\x0a\x20\x20float\x20rb\x20=\x20mars3d_fbm(p\x20*\x20.5\x20+\x20time\x20*\x20.17)\x20*\x20.1;\x0a\x20\x20rb\x20=\x20sqrt(rb);\x0a\x20\x20#ifndef\x20CENTERED\x0a\x20\x20p\x20*=\x20mars3d_makem(rb\x20*\x20.2\x20+\x20atan(p.y,\x20p.x)\x20*\x201.);\x0a\x20\x20#else\x0a\x20\x20p\x20*=\x20mars3d_makem(rb\x20*\x20.2\x20+\x20atan(p.y,\x20p.x)\x20*\x202.);\x0a\x20\x20#endif\x0a\x0a\x20\x20\x20\x20//coloring\x0a\x20\x20float\x20rz\x20=\x20mars3d_fbm(p\x20*\x20.9\x20-\x20time\x20*\x20.7);\x0a\x20\x20rz\x20*=\x20dot(bp\x20*\x205.,\x20bp)\x20+\x20.5;\x0a\x20\x20rz\x20*=\x20sin(p.x\x20*\x20.5\x20+\x20time\x20*\x204.)\x20*\x201.5;\x0a\x20\x20vec3\x20col\x20=\x20vec3(.04,\x200.07,\x200.45)\x20/\x20(.1\x20-\x20rz);\x0a\x20\x20vec4\x20fragColor\x20=\x20vec4(sqrt(abs(col)),\x201.0);\x0a\x20\x20material.alpha\x20=\x20fragColor.a\x20*\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20fragColor.rgb\x20*\x20.5;\x0a\x0a\x20\x20\x20\x20//\x20cesium\x0a\x20\x20float\x20frequency\x20=\x202000.0;\x0a\x20\x20float\x20amplitude\x20=\x2010.0;\x0a\x20\x20float\x20fadeFactor\x20=\x201.0;\x0a\x20\x20vec4\x20mapColor\x20=\x20texture(normalMap,\x20materialInput.st);\x0a\x20\x20float\x20specularMapValue\x20=\x20texture(normalMap,\x20materialInput.st).r;\x0a\x20\x20specularMapValue\x20=\x201.0;\x0a\x0a\x20\x20float\x20fade\x20=\x20max(1.0,\x20(length(materialInput.positionToEyeEC)\x20/\x2010000000000.0)\x20*\x20frequency\x20*\x20fadeFactor);\x0a\x20\x20vec4\x20noise\x20=\x20czm_getWaterNoise(normalMap,\x20materialInput.st\x20*\x20frequency,\x20time,\x200.0);\x0a\x20\x20vec3\x20normalTangentSpace\x20=\x20noise.xyz\x20*\x20vec3(1.0,\x201.0,\x20(1.0\x20/\x20amplitude));\x0a\x20\x20normalTangentSpace.xy\x20/=\x20fade;\x0a\x20\x20normalTangentSpace\x20=\x20mix(vec3(0.0,\x200.0,\x2050.0),\x20normalTangentSpace,\x20specularMapValue);\x0a\x20\x20normalTangentSpace\x20=\x20normalize(normalTangentSpace);\x0a\x0a\x20\x20float\x20mars3dPerturbationRatio\x20=\x20clamp(dot(normalTangentSpace,\x20vec3(0.0,\x200.0,\x200.1)),\x200.0,\x201.0);\x0a\x20\x20material.diffuse\x20+=\x20(0.1\x20*\x20mars3dPerturbationRatio);\x0a\x20\x20material.normal\x20=\x20normalize(materialInput.tangentToEyeMatrix\x20*\x20normalTangentSpace);\x0a\x20\x20material.specular\x20=\x200.5;\x0a\x20\x20material.shininess\x20=\x2010.0;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a','#ffff00','cancelFlyTo','_depthTest','eventType','CustomShader','startMoveRight','xHalfAngle','ortho','contrast','load','行政地标','bloom','shadows','translucent','getAddHeight','_修改缩放比例','wellData','_popupMgr','fixedFrameTransform','splice','_tileProvider','mouseup','progress','_tileDiscardPolicy','crossorigin','Geostationary_Satellite','_noDestroy','clip','HAS_V_NORMAL_MARS3D','STATIC_DRAW','keyword','multiplyByVector','平移视图','contextMenu','PointCloud3DTileContent','morphStart','backwardExtrapolationType','round','getElementsByClassName','tile','_maxRangeLength','_createDivGraphic','visible','.png','https://restapi.amap.com/v3/place/polygon','_pitch_min','updateFrameState','projections','rgba(255,\x20255,\x20255,\x200.0)','pure','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_areaList','ArcType','getValueOrDefault','maximumDistance','getShortestPath','SampledProperty','exp','_map_mouseUpHandler','_tileLayer_addTileHandler','_contextmenuConfig_bak','afterItem','_timeline','B_im','MM月dd日','ORANGE','pick','_rotateFrame','_conventMarsOptions','_framebuffer','_横坐标','visibility','lcc','Math','_shadowMap','closePopup','hasEditRotate','getPropertyIds','positiveY','_getDefaultTemplate','_velocityScratch','修改高度','/query','_createPrimitive','_ready','_pitch_max','MaterialSupport','_reflectMatrix','some','polygon','MGRSPoint\x20coverting\x20from\x20nothing','drawAddPoint','getColorByStyle','updateMatrix','sampler2D','moveForward','popup','_toOneJson','getCoordinates','ymax','blackAndWhite','sun','hasEditHeading','addTo','createIndexBuffer','Ion','drawStart','terrainLoadSuccess','forEach','value','300','shadowMap','_cancelOutlinePositionsCallback','_graphic_editing','_updateControlHandler','textStyles','currentObject','complete','outer_controlPoints','atan','_grids','getThings','cursor','_pickIdQualifier','_matrix','begin','pointStyleConver','polylineVolumeC','customProjectionMatrix','width','polygonP','fromCartographic','chrome','PolylineGlowMaterialProperty','neckWidthFactor','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','_hasHeightEdit','UrlTemplateImageryProvider','_updateStyleByEdit','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=13500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','removeThing','_graphic_drawing','ENGINEERINGDATUM','_单击完成绘制','areaName','fa\x20fa-download','_getPickIds','moon','texParameteri','RectangleGeometry','Transverse\x20Mercator','getHours','_cylinderLength','cloudStyleConver','_minHeight','this.sources\x20is\x20required\x20and\x20must\x20have\x20positiveX,\x20negativeX,\x20positiveY,\x20negativeY,\x20positiveZ,\x20and\x20negativeZ\x20properties.','upHeight','zoomEventTypes','updateStyle','heightVal','_map','timetik','vscale','removeControl','showDomeLines','ter','format','_position_inertial','rightDown','startPosition','lambda0','maximumZoomDistance','EditAttr','fa\x20fa-pencil-square','_onRightClickHandler','frameRate','dynamicRiver','_last_material','outerHTML','srsCode','removeEventParent','The\x20location\x20information','HorizontalOrigin','translucency','lowerToBottom','当前浏览器不支持WebGL功能','origin','areaSurfaceMeasure','font_size','_container2','CloudCollection','getRange','fa\x20fa-yelp','closure','terrainLoadError','ondblclick','pop','_mousMiddleDownHandler','fetchImage','TOP','LodGraphicLayer:\x20数据的ID识别失败','fromArray','pow','command','_startTime','hasDrawDelPoint','validDrawPosition','CRS','datumName','maxCacheCount','LabelStyle','listens','_删除该点','_readyOk','onStop','_log2FarDepthFromNearPlusOne','PointPrimitiveCollection','onEachFeature','assign','_videoContainer','stRotation','_showThroughEllipsoid','cartographicToCartesian','填方體積','_last_preUpdateTime','_updateOutlineStyle','_crs','query','_matrixRotate','_poinst','bindPopup','Northing\x20at\x20false\x20origin','leftPositions','_planeAngle','_hasFX','tilingScheme','visibleDepth','bind','_getGeoJsonGeometry','Cartographic','cylinder','proxy','Z_TRANSLATION','clearMoveTargetDelay','parentNode','_addedHook','_promise','_开启键盘漫游','initialTilesLoaded','insertIndex','getOutlineColorByStyle','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out\x20vec3\x20vOutlineNormal_mars3d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20HAS_NORMAL_MARS3D\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d\x20=\x20normal;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20HAS_V_NORMAL_MARS3D\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d\x20=\x20v_normal;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#else\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vOutlineNormal_mars3d=vec3(0.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20','uniform\x20sampler2D\x20colorTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0aconst\x20int\x20KERNEL_WIDTH\x20=\x2016;\x0avoid\x20main(void)\x20{\x0a\x20\x20vec2\x20step\x20=\x201.0\x20/\x20czm_viewport.zw;\x0a\x20\x20vec2\x20integralPos\x20=\x20v_textureCoordinates\x20-\x20mod(v_textureCoordinates,\x208.0\x20*\x20step);\x0a\x20\x20vec3\x20averageValue\x20=\x20vec3(0.0);\x0a\x20\x20for(int\x20i\x20=\x200;\x20i\x20<\x20KERNEL_WIDTH;\x20i++)\x20{\x0a\x20\x20\x20\x20for(int\x20j\x20=\x200;\x20j\x20<\x20KERNEL_WIDTH;\x20j++)\x20{\x0a\x20\x20\x20\x20\x20\x20averageValue\x20+=\x20texture(colorTexture,\x20integralPos\x20+\x20step\x20*\x20vec2(i,\x20j)).rgb;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20averageValue\x20/=\x20float(KERNEL_WIDTH\x20*\x20KERNEL_WIDTH);\x0a\x20\x20out_FragColor\x20=\x20vec4(averageValue,\x201.0);\x0a}\x0a','_setInputAction','openContextMenu','_maxCacheCount','
','_unbindFun','CESIUM_3D_TILE','RIGHT','bindTexture','citylimit','DefaultImageId','MIDDLE_CLICK','cityCode','iconPadding','divLightPoint','undefined','nSubgrids','createDrawCommand','flyToOptions','_idField','_允许编辑','maximumHeight','eachThing','_performanceDisplay','_command','
经度:{lng}
\x20
纬度:{lat}
海拔:{alt}米
\x20层级:{level}
方向:{heading}°
\x20
俯仰角:{pitch}°
视高:{cameraHeight}米','angle','hostname','GRS80','getByAttr','alpha','cross','originY','glowPower','has3dtiles','_drawCommands','stepSize','Angle','_hasChangeDepthTestAgainstTerrain','Stop\x20rotation\x20on\x20axis','GroundSkyBox','cos','planeAngle','getInt32','_toOneCesiumVal','Ellipsoid','_bindDocumentEvent','km²','_city','UNIT_X','editAddPoint','_调整比例','New\x20International\x201967','MoveHeight','GeometryInstance','autoMiddleDynamicPosition','fill','_color_alpha_bak','_load_data','hasEditScale','sigma','_entity_label','_水平距离','angleStr','uniform\x5cs?vec4\x5cs?','_orbitFrame','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','showResult','properties','void\x20main()\x20\x0a','_initSampledPositionProperty','arrLayer','_getOutlinePositions','enabledMoveTarget','search','to_meter','defs','NARROW','enableInputs','_thingList','heightReference','frameState','PolylineGlow','positionToTileXY','uri','mod_airy','_scopes','lineOpacity','pause','修改长度(X方向)','jobScheduler','Alt','WebMercatorProjection','sin_po','right','wallStyleConver','_map_morphCompleteHandler','flyToByAnimationEnd','getTileLayers','fromMercator','tileLoadProgressEvent','isTile','rightPoints','defer','easingFunction3','cql_filter','_positions_circle_y','_initFromEntity','innerRadii_x','formatNum','红色\x20是\x20X轴
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20绿色\x20是\x20Y轴
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20蓝色\x20是\x20Z轴','Longitude\x20of\x20natural\x20origin','classification','toGeoJSON','radii','_last_success','_bindEvent','_showWall','_createImageryProvider','_更多功能请右击','EPSG:4532','_getKeywords','fromDimensions','_setRectangleByOptions','CheckerboardType','uniform\x20vec4\x20u_mars_flood_val;//(基础淹没高度,当前淹没高度,最大淹没高度,默认高度差(最大淹没高度\x20-\x20基础淹没高度))\x0auniform\x20vec4\x20u_mars_flood_color;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.alpha\x20=\x20(materialInput.height\x20<\x20u_mars_flood_val.y)\x20?\x20u_mars_flood_color.a\x20:\x200.0;\x0a\x20\x20material.diffuse\x20=\x20u_mars_flood_color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a','classificationType','Y_UP_TO_Z_UP','SPHEROID','coordinates','Transverse_Mercator','scope','lastIndexOf','isEntity','_onMouseMoveHandler_point','HeadingPitchRange','_showPolyline','cvs','LabelCollection','Drawing','queryBicycling','numberOfLevelZeroTilesY','PixelFormat','ZERO_TOLERANCE','rotateStep','volumeDepthMeasure','13157LIwlbr','_cubeMap','\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20vec3\x20vOutlineNormal_mars3d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(!czm_selected())discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(length(vOutlineNormal_mars3d)>0.0)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor=vec4(\x20vOutlineNormal_mars3d\x20,out_FragColor.a);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','_clearDrawCommand','substr','clipOutSide','neckHeightFactor','popupOptions','isAnimate','_updatEntityAlpha','_orbitIsLook','_getVector','float\x20getDistance(sampler2D\x20depthTexture,\x20vec2\x20texCoords)\x20{\x0a\x20\x20float\x20depth\x20=\x20czm_unpackDepth(texture(depthTexture,\x20texCoords));\x0a\x20\x20if(depth\x20==\x200.0)\x20{\x0a\x20\x20\x20\x20return\x20czm_infinity;\x0a\x20\x20}\x0a\x20\x20vec4\x20eyeCoordinate\x20=\x20czm_windowToEyeCoordinates(gl_FragCoord.xy,\x20depth);\x0a\x20\x20return\x20-eyeCoordinate.z\x20/\x20eyeCoordinate.w;\x0a}\x0afloat\x20interpolateByDistance(vec4\x20nearFarScalar,\x20float\x20distance)\x20{\x0a\x20\x20float\x20startDistance\x20=\x20nearFarScalar.x;\x0a\x20\x20float\x20startValue\x20=\x20nearFarScalar.y;\x0a\x20\x20float\x20endDistance\x20=\x20nearFarScalar.z;\x0a\x20\x20float\x20endValue\x20=\x20nearFarScalar.w;\x0a\x20\x20float\x20t\x20=\x20clamp((distance\x20-\x20startDistance)\x20/\x20(endDistance\x20-\x20startDistance),\x200.0,\x201.0);\x0a\x20\x20return\x20mix(startValue,\x20endValue,\x20t);\x0a}\x0avec4\x20alphaBlend(vec4\x20sourceColor,\x20vec4\x20destinationColor)\x20{\x0a\x20\x20return\x20sourceColor\x20*\x20vec4(sourceColor.aaa,\x201.0)\x20+\x20destinationColor\x20*\x20(1.0\x20-\x20sourceColor.a);\x0a}\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0auniform\x20vec4\x20fogByDistance;\x0auniform\x20vec4\x20fogColor;\x0ain\x20vec2\x20v_textureCoordinates;\x0avoid\x20main(void)\x20{\x0a\x20\x20float\x20distance\x20=\x20getDistance(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20sceneColor\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20float\x20blendAmount\x20=\x20interpolateByDistance(fogByDistance,\x20distance);\x0a\x20\x20vec4\x20finalFogColor\x20=\x20vec4(fogColor.rgb,\x20fogColor.a\x20*\x20blendAmount);\x0a\x20\x20out_FragColor\x20=\x20alphaBlend(finalFogColor,\x20sceneColor);\x0a}\x0a','_maxHeight','正在计算体积','noTitle','_getDrawPointEntityClass','tms','hasOwnProperty','convert','_万立方米','northing','HeightReference','#txt-clockAnimate-time','ScreenSpaceEventType','_fireTarget_open','_pageSize','decimal','FID','cameraMoveEnd','DrawCircle','heightMeasure','_material','tilesetMaxTotalMemory','highlightClose','_hasResetEnableLighting','_bindVisibleEvent','cosX0','getGraphicsByStyle','GeoJsonDataSource','_postProcessStage','_mouseClickHandler','Height\x20difference','snowEffect','target','#define\x20FACE_FORWARD\x0a','+proj=longlat\x20+ellps=GRS80\x20+no_defs','valueFD','BOTTOM_ROTATE','intl','stockholm','buildModuleUrl','defaultTimeFormatter','updateAllDistance','StripeMaterialProperty','tileDiscardPolicy','mouseMoveTarget','_updatePositionEx','mouseUp','edit','_map_mouseMove','_main','longitudeShift','”相关数据!','projName','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20position\x20=\x20czm_inverseModelView\x20*\x20vec4(fsInput.attributes.positionEC,1);\x20//\x20位置\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20注意shader中写浮点数是,一定要带小数点,否则会报错,比如0需要写成0.0,1要写成1.0\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_baseHeight\x20=\x200.0;\x20//\x20物体的基础高度,需要修改成一个合适的建筑基础高度\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_heightRange\x20=\x2080.0;\x20//\x20高亮的范围(_baseHeight\x20~\x20_baseHeight\x20+\x20_heightRange)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20_glowRange\x20=\x20100.0;\x20//\x20光环的移动范围(高度)\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20建筑基础色\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_height\x20=\x20(u_mars3d_jzw_upz\x20?\x20position.z\x20:\x20position.y)\x20-\x20_baseHeight;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_a11\x20=\x20fract(czm_frameNumber\x20/\x20120.0)\x20*\x203.14159265\x20*\x202.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_a12\x20=\x20mars_height\x20/\x20_heightRange\x20+\x20sin(mars_a11)\x20*\x200.1;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20vec3(0.0,\x200.0,\x201.0),\x200.5);\x20//\x20颜色\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20*=\x20vec3(mars_a12);//\x20渐变\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20动态光环\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20/\x20360.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20time\x20=\x20abs(time\x20-\x200.5)\x20*\x202.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_h\x20=\x20clamp(mars_height\x20/\x20_glowRange,\x200.0,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20mars_diff\x20=\x20step(0.005,\x20abs(mars_h\x20-\x20time));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20+=\x20material.diffuse\x20*\x20(1.0\x20-\x20mars_diff);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20','outlineOpacity','0,0,0','createGuid','_onCollectionChanged','_defaultColorTexture','_depthFailColor','TERRAIN','replaceMain','_addGraphic','_czmControlKey','_bindHeightDraggers','inverseViewMatrix','minimumImageSize','angleDecimal','elevationRampMaterial','_removeMeasureLabelAndEx','_destroyResource','fillVolume','gamma','mouseMove','clone','Close\x20snow','datumCode','挖方体积','fa\x20fa-building-o','cancel','pitPrimitive','singam','_noPickEntity','stringify','rotation','endFrame','GeometryAttributes','editColor','_fireBindDataEx','_minimumLevel','isAllOutRange','positionsShow','EPSG:4492','graphic','fragmentShader','label','allDistance','_frontFaceRS','_containerSpeed','pixelStorei','_graphicLayer','wfs请求GetFeature出错','interPolygonObj','PolyBlob','_onClockTickHanlder','getLayerById','816420oggCSM','_lastDynamicPosition','i3s_','关闭拾取高亮','sinb1','destroyCommands','_openByMouseEvent','_tilesetFlat','_updateDomAttribute','getAreaById','clickTileGraphic','qs2','GeographicProjection','updateDistanceDisplayCondition','selectedIndex','southeast','fillRect','divGraphicStyleConver','_computedNewPos','_positions_line_z','queryArr','_containerTime','FITTED_CS','viewShed','調整比例','FLOAT','addEventListener','ee24b622294b5bc659fb92fe81084776','_lateralSurfaceTranslucent','getPickRay','FRONT','_getTileEventParams','_hasLoad','mile','DeveloperError','removeGraphic','wfs','geoJsonLayer_onLoadHandler','EPSG:4512','_正在计算体积','156','toolbar','heightTriangleMeasure','_updateExOpacity','_readChildNodeVal','http://api.tianditu.gov.cn/v2/search','Framebuffer','_map_preRenderHandler','doubleSidedPlane','referenceFrame','_updatePositionsHook','removeArea','\x0a(+','imageOptsConver','rad);\x0a\x20\x20\x20\x20\x20\x20-webkit-transform\x20:\x20rotate(-','getShapeForCircle','Camera','_positionWC','_getCssText','Mercator_1SP','editHeight','getNumberOfYTilesAtLevel','getProperty','color_bak','C_y','','autoTip','standard_parallel_1','_getJsonPositions','_subdomains','zoomTo','Sampler','fa\x20fa-lock','_inputOrder','_graphic_updatePosition','_addAreaHook','_points','getIndex','_key_index','_cylinderPosition','drawRingCanvas','parentSelected','removeItem','scale','getValueOrUndefined','_primitive','stopMoveMatrix','EncodedCartesian3','postRender','totalAreaStr','_maximumLevel','viewMatrix','maximumHeights','_container','fillColor','shiny','_hasRemoveElement','_pointEditElementIDs','marsOptions','xmin','undergroundColorAlphaByDistance','_双击完成绘制','addEffect','temp','getTooltip','_createBottomSurface','getCache','右键菜单操作出错','10000','imageBasedLighting','_normal','rad);\x0a\x20\x20\x20\x20\x20\x20opacity:\x20','enu','vec_e','_positions_show','_primitive3','expImage','增加点','Do\x20not\x20go\x20underground','_tilingScheme','getGridKey','_keys','minimumHeights','WGS\x2066','_style2Json','_lightCamera','tileLoadProgress','city_type','_requestMetadata','SkyAtmosphereNo','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=25500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_modelMatrix','u_mars3d_flat_maxRangeLength','visibleColor','layer','MGRSPoint\x20given\x20invalid\x20Northing\x20','getItem','indexOf','lightDirection','SceneTransforms','unbindHighlight','GeographicTilingScheme','_hdr','_mapEx_extentChangeHandler','_clearDraw','attribute','_mouseDown','host','_getFixedFrameToEastNorthUpTransformFromWorldMatrix','tilesetPassState','ProviderViewModel','ml1','_sectorFrontCommand','_optionsBasemapsList','css_transform_origin','cartesianArrayToCartographicArray','setItem','loop','ALL','_packedLength','toRadians','high','_computedModelMatrix','-mars3d-mousedownview','_removedHook','_viewer.destroy异常','enableTranslate','_tileLayer','CircleEmitter','_bottomPrimitive','easting','place','highlight','mars3d-smallTooltip-rightArrow','_rectangle','_translucent','middleDown','Quadrilateralized\x20Spherical\x20Cube','styleOpt','coordinates\x20must\x20be\x20finite\x20numbers','outlineStyle','arcgis官方提供的高分辨率全球地形','polygonMaxHeight','&scene=0','getArcPoints','box','getBezierPoints','updateSectionForTerrain','xmax','_interpolationAlgorithm','DESTROY','terrainProvider','27px','International\x201909\x20(Hayford)','addEventParent','near','_last_graphicsOptions','_leftLayer','cameraChanged','hasProperty','_ellipsoid','flyToPositions','7955408ZkvhqD','updateLengthForTerrain','CheckerboardMaterialProperty','setCzmlTime','NearFarScalar','AREA_1','Z_TRANSLATION_COLOR','pointToPixel','group','_moveHandler','graphicLayer','destination','_positions_line_y','rotateAnimation','thickness','_last_planeGraphics','surface','允许进入地下','_createCzmControl','arcgis','Stereographic_South_Pole','green','_getColorByColorMaterial','rectangle','nadgrids','_isLeftDown','未处理参数','geometry','_oldPickPrimitive','MGRSPoint\x20bad\x20conversion\x20from:\x20','HALF_PI','setHours','ellipsoid','_fireAddPoint','scale_factor','createPrimitive','TRIANGLES','normalY','_getAddress_ing','getMetadata','二维视图','circlePoints_2','leftPoints','_setPitchRange_mouseMoveHandler','Unlocked','u_0','normal','Transforms','_showSectorSegmentLines','SurfacePoints:\x20请传入scene参数','supportsImageRenderingPixelated','地形服务','_updateDrawEntityToThis','_tileHeight','updateUnit','showFrustum','rotation_z','_updateImage','_跟踪锁定','Lerch\x201979','athens','createPickId','createLayer','roiUV','dimensions_x','_filterPOIData_polygon','_inverMatrix','pitch','contextMenuClick','wallTopPositions','enableZoom','leftLayer','Drag\x20that\x20point','getPicked','time','east','lng','depthTestAgainstTerrain','lam','disableThisFrame','visibleAreaColor','firefox','视角切换','angle2','mouseDown','MeasureAngle','_computedScanPlaneModelMatrix','heightLabel','fromCache','_style2JsonBase','scanPlaneRate','/tile/{z}/{y}/{x}','getFloat32','min-width:\x20','cesium-vrButton','限定的范围','exact','south','url','_sampler','computeOptions','_无法删除不能少于最小点数','baseLayerPicker','_updateView','primitiveCollection','material_bak','easingFunction2','_property','UNSIGNED_BYTE','index','lon','DrawEditYes','Feature','_clearLastHighlight','+proj=tmerc\x20+lat_0=0\x20+lon_0=126\x20+k=1\x20+x_0=42500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','evrst30','model','sinphi','options.positions','domToolbar','_showPoly','CameraEventType','ImageMaterialProperty','distance_all','polylineVolumeStyleConver','formatted_address','_orbit','{\x20\x0a','onCreateGraphic','u_mars3d_jzw_upz','lineStyle','canvas','GRS\x2067(IUGG\x201967)','hasEditContextMenu','Y_TRANSLATION_COLOR','_sectorLineVA','activateEdit','_setPitchRange_cameraChangedHandler','sinX0','computePosition','asin','_onKeyUp','ZERO','google','debugAxisLength','plane_normal','scaleByDistance_farValue','cbg','longlat','_onMouseMoveDraggerHandler','enableRotate','_sources2','_primitives','sinph0','ALPHA_BLEND','_scene','_viewProjectionDirty','flyToPoint','outlineColor','isArray','();\x20\x0a','wkid','inline','_wkid','Cesium3DTileStyle','set','morphToColumbusView','showSectorLines','rgba(255,\x20255,\x20255,\x201.0)','update','_limitGlobe','修改位置','utm','_pointSize','maximumArr','iconClass','move','symbol','0px','scaleByDistance_nearValue','crsy','_textureTarget','activeAnimations','FLAT_VERTEX_FORMAT','_processForRemoveLayer','hbgd','_defaultView','added','ContextLimits','outlineCoordinates','_toJSON_Ex','fromPositions','RELATIVE_TO_GROUND','moveEnd','uniform','ColorGeometryInstanceAttribute','_corridorEx','_useTiles','innerRadii_y','fa\x20fa-file-text-o','circle','editMovePoint','textarea','初始视图','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','onCustomCanvas','取消鎖定','Pass','地图上已有','_hasMouseOver','_roll_reality','wall','drawCanvas','_unbindMorphComplete','_updateMaxMinHeights','fromRotationMatrix','bgColor','texture','sectionMeasure','div','corridorC','maxHeight\x20请传入有效数值!','_wallEntity','merc','Lambert_Azimuthal_Equal_Area','cesium-navigation-button-right','flyToExtent','addInner','PointStyleConver','LineBloom','removeSamples','_forPositionProperty','mprts','_layerList.destroy\x20异常','_19','upperLatitude','+proj=tmerc\x20+lat_0=0\x20+lon_0=108\x20+k=1\x20+x_0=36500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_orbitLastTimestamp','coslat0','s_jtsk','geodetic_datum_of_1965','drawImage','baseWaterColor','editing','_pickIds','TEXTURED','addGraphic','the_geom','Primitive','selectedTerrainProviderViewModel','silhouetteSize','tileinfo','fa\x20fa-star-half-full','destroy','_pointEx','px;height:\x20','children','_islosdImg','_showHook','RIGHT_ROTATE','ENABLED','getMaterial','3685524maVLwf','textureDef','fixedFrameToHeadingPitchRoll','backgroundPadding','showDomeSurfaces','size','tdt','#9b08fd','rainEffect','_mousePosition','px;\x0a\x20\x20--text-color:\x20','groundPosition','_导出GeoJSON','_buildImageResource','EPSG:4542','getGridPositions','Property','drillPickFromRay','_onPreRenderHandler','RectangleGeometryLibrary','ConstantPositionProperty','inverseMatrix','flat','_resource','_高度差','startCompute','_distance','updateCallback','contextMenuOpen','cacheMarsOptions','lang','_container_onMouseMoveHandler','PROJCRS','fa\x20fa-ticket','An\x20error\x20occurred\x20while\x20accessing\x20','hasHeightEdit','BoundingRectangle','_createIcon','clockAnimate','domeSurfaceMaterial','_keyboardRoam','depthTest','_onClickHandler','_last_clickPositionX','_graphic_move_y','responseURL','ep2','eia','container','onDownloadProgress','_camera_cache','showSun','_height_original','開啓大氣渲染','plane','worldToModel','moveCamera','_getLablePosition','_graphic','private','msie','shaderProgram','bufferSteps','_composites','EPSG:4554','Close\x20night\x20vision','请确认点是Cartesian3类型!','http://api.tianditu.gov.cn/geocoder','getGraphicsByAttr','project','State','_colorFramebuffer','整體平移','fa\x20fa-unlock-alt','GeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。','modelStyleConver','_external','clockTick','circleStyleConver','mode','labelCollection','_enabledDraw','_graphic_rotate_z','columnNumber','phi','Z_UP_TO_X_UP','YELLOW','rightWC','smallTooltip','GraphicUtil','_scanePlaneXHalfAngle','TimeInterval','_labelCollection','getGraphicById','setProperties','TimeIntervalCollection','_bindToLayer','_mapEx','EPSG:102113','UniformState','block','coneTrack','_hasTerrainShadows','_globalAlpha','floor','availability','OBLIQ','imageryLayersForClamp','699244EAIhsL','alfa','clockRange','Crosscutting\x20area','not\x20a\x20string','Widgets/Images/TerrainProviders/Ellipsoid.png','startsWith','_drawCreatedHandler','depthFailColor','light','_cameraMoveStartHandler','lastQueryOpts','createControl:无该类型控件暂不能创建','YZ_TRANSLATION_COLOR','NEAREST','_position_draw','openHighlight','fromGeometry','#123e59','scaleByDistance_far','fromType','WGS60','startEditing','GroundPolylinePrimitive','PointCloud','yyyy-MM-dd\x20HH:mm:ss','centerOfLine','toFixed','C_re','keyWord','_camera','removeNearPoint','BlendingState','equals','_addedBaseHook','queryPolygon','_sources','sin','eastNorthUpToFixedFrame','_onMap_wheel','Assets/Textures/waterNormals.jpg','WebGL发生渲染错误,渲染已经停止,请刷新页面。','Geocoder','NeonLight','anchor','_positions_grid','onEnd','dingmian','none','[object\x20Object]','primitives','CzmlLayer:请必须传入\x20url\x20或\x20data\x20参数','depthTexture','debuggerPointEntity','osm','_msFrameCount','collectionChanged','MultiPoint','绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map','fadeFactor','distanceDisplayCondition_near','_canrefresh','touches','change','Modified\x20Airy','atob','Van_der_Grinten_I','semiMinorAxis','fov','openTooltip','measure','VanDerGrinten','areaStr','addAttribute','VERTEX_FORMAT','wallP','North_American_Datum_1927','&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk=','编辑方向','_isBindTileVisible','moveBackward','缩放视图','body','rotateLeft','\x20\x20\x20\x20','_rectangle_draw','_frustumPrimitive','_updatePrimitiveOpacity','Rectangle','from_greenwich','pickedObject','closeHighlight','pickHeight','Polar\x20Stereographic\x20(variant\x20B)','drawRemovePoint','hough','gaze','AnimationViewModel','showBox','types','queryText','padding:\x20','CzmlDataSource','getBasemaps','stere','vertex_H','enablePickFeatures','_offCenterFrustum','distanceDisplayBillboard','text','total','clear','eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZDJjMTcwNS04ZDVmLTQzNWQtYWUyZC0yMTJkMDkyMzkyMjMiLCJpZCI6MTQ4MiwiaWF0IjoxNjQ4NDQ2OTIwfQ.7e1QUkx_k-mZBxKz9tV8a5TFEorrlLlkfcVNNPzfTQY','_按轴平移','_fragmentShaderText','CylinderGeometry','area','hidden','category','timeTik','_prevCameraHeight','lineColor','z4490','_extent','_initTilesetPlanClip','error','_handler','TEXTURE_MIN_FILTER','inline-block','units','frustumCommandsList','dashPattern','gradations','appearance','blackAndWhiteEffect','_surface','flood','fetchJson出错了','boundingSphere','instances','telephone','SnowEffectNo','destroyPrimitives','getZoomUnits','wheel','hasTooltip','_toOneCesiumVal_Point','fa\x20fa-eyedropper','show',';\x22>','getOrientation','false_northing','img_d','_tikRender','tag','_lng','boxStyleConver','totalArea','getArrowBodyPoints','_cubeMap2','未查询到“','mars3d_u','_bindMorphComplete','_startMousePosition','getPickTarget','_initChildGraphic','_measured','clone:出错了','splitNum','WHITE','distanceHor','top:\x2010px;right:\x2010px;','moveDelay','features','editMouseMove','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_bindEditEvent','enableTilt','open','log','_mouseDownHandler','_updateStyleHook','_domeLineCommand','Close\x20Pick\x20highlighted','_last_clockRange','rightLayer','unproject','_updateEditDraggers','HeadingPitchRoll','Enable\x20night\x20vision','MM月dd日\x20HH:mm','_last_hasNull','lock','textContent','clampToGround','_lastMsSampleTime','WHEEL','cgb','fromCharCode','_lastPickedInfo','_isStart','polylineStyleConver','px;\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-type=\x22','getRectangle','onChange','maxHeight','minificationFilter','long0','strokeColor','stroke-opacity','_enabledEditGrid','fromRadians','_xHalfAngle','_pixelDatatype','vertexs','step','GeometryCollection','getLayers','FloodByMaterialType','limit','TilesetBoundingVolumeYes','UNIT_Z','fi0','moveVar','shaderCache','Hotine_Oblique_Mercator_Two_Point_Natural_Origin','fromHeadingPitchRoll','map','_onClickHandler_point','glowColor','noPickEntity','{content}','polygonWall','thicknes','mars3d-slider','TOP_ROTATE','eventTarget','getContextMenu','centerPoint','UNLIT','rectangleStyleConver','StripeOrientation','getShowPositions','_highlightEnabled','del','numberOfLevelZeroTilesX','navigation','type','MIDDLE_DOWN','tileset','scanPlaneMode','_highlight_mouseOutHandler','bottomHeight','fa\x20fa-trello','flyToGraphic','_currDistance','_createI3SDataProvider','关闭包围盒','labelHeightStyle','depthFail','updateVolume','_terrainProviderPromise','offsetHeight','Buffer','EPSG:900913','HOLD','_fpsFrameCount','_viewer','_attributeLocations','RIGHT_DRAG','setEndPoints','duration','localStorage','diffusePower','_editing_entity','gapColor','RainEffectYes','updatePositionsHeightByAttr','LEFT_DOWN','Rassadiran','Assets/Textures/NaturalEarthII','getBoundingClientRect','datum','minimumCollisionTerrainHeight','_container_rotationArc','_looking','TRANSPARENT','miny','updateOutlinesDistanceDisplayCondition','gaode','_divHeight','拖动该点后','_values','activateMouseOver','createPropertyDescriptor','+proj=tmerc\x20+lat_0=0\x20+lon_0=96\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_sceneEvent','_updateOutlineToCallback','Rotation\x20on\x20axis','yHalfAngle','changeMouseModel','forward','blur','GridMaterialProperty','cartographicArrayToCartesianArray','POI\x20请求失败(','updateTimer','extrudedHeight','pickId','PrimitiveCollection','toDate','upGraphic','icon','_container_onClickHandler','toCartographic','_tooltipMgr','distanceStr','GlobeSurfaceTileProvider','_updateHeight','toCesiumVal','height','LightingModel','Widgets/Images/TerrainProviders/CesiumWorldTerrain.png','_tileset','isAdded','_firingCount','setPositions','arc','loadGeoJSON','_videoTexture','X_TRANSLATION_COLOR','isPause','processFeatureCollection','#ffffff','ctrlKey','_zhStyle','_addChildContainer','filterColor','city_limit','_boundingSphere','updateText','EPSG:4326','I3SLayer','dimianmian','_objectsToExclude','_terrain_onLoadSuccess','noCenter','startDate','_unbindEvent','appendChild','speed','terrainExaggeration','pixelOffset','minimumLevel','图上量算','once','videoPlay','clampToTileset','route','u_mars3d_clip_texture','shape','_virtualCamera','geocode','cos_p12','polygonHierarchy','extent','cva','https://gss{s}.bdstatic.com/5LUZemja_QUU8t7mm9GUKT-xh_/tile/?udt=20150114&qt=tile&styles=pl&x={x}&y={y}&z={z}','_enabled','DrawPoint','_mouseUpHandle','__created','hasChildThing','_layer','_bindControl','_timeinfo','dynamicView','_hasRightTilt','upAxis','depthTestOld','RIGHT_UP','neutral','unbindPopup','_position','setLayersOptions','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=29500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','autoStop','Move\x20it\x20over\x20here','Color','geometryInstances','ZHHK','_isRotateStart','stop','stopRotateMatrix','Double\x20click\x20to\x20finish\x20drawing','BillboardStyleConver','gravity','pickFramebuffer','+proj=tmerc\x20+lat_0=0\x20+lon_0=90\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','preMultiplyAlpha','pointP','getThirdPoint','toCartesians','_cameraHandler','ellipse','loadBefore','sources3','querySelector','_scanPlaneColor','updateDivPosition','_credit','middle','_特效效果','_entity','percent','QueryArcServer\x20请求出错','readyEvent','enableLighting','_UniformState_updateFrustum_old','bezierSpline','multiplyByScale','addItem','southwest','template','pn1','789e558be762ff832392a0393fd8a4f1','low','_selectedLayer','GRS67','customShader','openSmallTooltipByMinPointNum','minimumTerrainLevel','getDraggerContextMenu','polygonStyleConver','upWC','属性类型已存在','_rotateAutoStopAngle','geos','constructor','spacing','greaterThanOrEquals','JulianDate','\x22>{content}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20','restart','CorridorStyleConver','combine','perPositionHeight','_平方米','_update','+proj=tmerc\x20+lat_0=0\x20+lon_0=132\x20+k=1\x20+x_0=44500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','editRemovePoint','preUpdate','clrk80','scaleByDistance','UndergroundYes','开启日照阴影','keydown','image2','Edit\x20Scale','enableLook','offsetWidth','data-count','polygonTexture','_counts','editingGrid','_minimumHeights','popupOpen','void\x20main(){}','camera_changedHandler','_mouseMoveHandle','_showSectorLines','tilesetLayer','editStop','SCENE2D','Hotine_Oblique_Mercator_Azimuth_Center','startDraw','heightStr','_globe','_orginCenterPosition','SkyAtmosphereYes','_orientation','uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20glow;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0);\x0a\x20\x20t\x20*=\x201.03;\x0a\x0a\x20\x20float\x20alpha\x20=\x20smoothstep(t\x20-\x200.03,\x20t,\x20st.s)\x20*\x20step(-t,\x20-st.s);\x0a\x20\x20alpha\x20+=\x200.1;\x0a\x0a\x20\x20vec4\x20fragColor;\x0a\x20\x20fragColor.rgb\x20=\x20(color.rgb)\x20/\x200.5;\x0a\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x20\x20material.diffuse\x20=\x20fragColor.rgb;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.emission\x20=\x20fragColor.rgb\x20*\x20glow;\x0a\x20\x20return\x20material;\x0a}\x0a','uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20startTime;\x0auniform\x20float\x20percent;\x0auniform\x20float\x20alpha;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(startTime\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20t\x20*=\x20(1.0\x20+\x20percent);\x0a\x20\x20float\x20alpha1\x20=\x20smoothstep(t\x20-\x20percent,\x20t,\x20st.s)\x20*\x20step(-t,\x20-st.s);\x0a\x20\x20alpha1\x20+=\x20alpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20alpha1\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a','image','polylineC','_cloudCollection','_last_contextmenuConfig','rightPositions','FrustumOutlineGeometry','Cesium3DTilePass','XZ_TRANSLATION','algorithmUtil','#ff0000','hasEdit','primitive','county_code','frustumC','clickMap','distanceDisplayCondition','_onRemove','Map:id\x20不能为空','_getOutlineStyle','_initTilingSchemeByCrs','ShaderSource','unbindEvent','event','cesium-viewer-animationContainer','\x22\x20\x20>','_万米','pixelRange','updateFrustum','cursorCSS','object','lastParameters','stopMoveBackward','addColorStop','_frustumFar','showUp','_debugAxis','semiMajorAxis','flags','_rotateHpr','_closeAllControl','_getPopupPosition','preRender','keyboardRoam','min','pointMeasure','_onLeftDownHandler','drillPick','_container_inner','loadCubeMap','_labels','unbindUpdateEvent','convertMC2LL','EMPTY_OBJECT','allPage','_positions_CallbackProperty','morphComplete','PINCH','_splitOptionsToStyle','leftDown','_position_show','basemap','SlopeRamp','_map_timeTik','_shadingAlpha','_geoJsonLayer','postProcessStage','_bindMoveAllDragger','_positions','ARCGIS','dataSources','toBottom','rotateCamera','_updateStyleBaseHook','context','_context','eachLayer','setPlanes','regular','pauseTime','editStyle','+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=17500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','onTimelineScrubfunction','Close\x20black\x20and\x20white','_removeDynamicPosition','UNSIGNED_SHORT','diffuseWall','_containerUl','_heights_cache','_mousWheelHandler','changeBasemap','','keyup','https://restapi.amap.com/v3/place/around','getAllPositions','draggers','WMS\x20getMetadata请求出错','shift','Polygon','normalMap','_updateDomAttributeByEvent','setOptions','currentTarget','getNextLayerId','renderState','layerY','_darkness','delta','getMinutes','_公顷','_updateForEvent','innerRadii','cesium-navigation-help-pan','_stopTime','roll','evrst48','Standard_Parallel_2','upload','MoveAll','VERT_DATUM','blendColor','開啓霧天氣','_properties','_enabledEdit','_popupPosition','src','_skyboxMatrix3','getCameraDistance','bottom','TerrainWireframeNo','contextmenuItemsOptions','IAU76','ENLARGE','ShowGeometryInstanceAttribute','+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=21500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_primitive_outline','nzgd49','tileMatrixSetID','CTRL','afterquote','_last_clickTime','uplift','polyline','LineString','_dragger_index','legend-scale-bar','capabilities','zoomOut','longc','rectified_grid_angle','×','in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0a\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec2\x20v_st;\x0a\x0auniform\x20mat4\x20reflectorProjectionMatrix;\x0auniform\x20mat4\x20reflectorViewMatrix;\x0auniform\x20mat4\x20reflectMatrix;\x0aout\x20vec4\x20v_worldPosition;\x20\x20//\x20世界坐标\x0aout\x20vec4\x20v_uv;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20纹理坐标\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20normal\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x0a\x20\x20mat4\x20modelView\x20=\x20reflectorViewMatrix\x20*\x20reflectMatrix\x20*\x20czm_model;\x0a\x20\x20modelView[3][0]\x20=\x200.0;\x0a\x20\x20modelView[3][1]\x20=\x200.0;\x0a\x20\x20modelView[3][2]\x20=\x200.0;\x0a\x20\x20v_uv\x20=\x20reflectorProjectionMatrix\x20*\x20modelView\x20*\x20p;\x0a\x20\x20vec4\x20positionMC\x20=\x20vec4(position3DHigh\x20+\x20position3DLow,\x201.0);\x0a\x20\x20v_worldPosition\x20=\x20czm_model\x20*\x20positionMC;\x0a\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a','img_z','Texture','_layerIdx','Quaternion','\x22\x20\x20class=\x22mars3d-tooltip\x20mars3d-tooltip-','bbox','getArrowPoints','angleBetween','crs','reload','_arrThing','showAddText','hasClickEvent','code','loadOk','_dimensions','RHUMB','fromRotationZ','_rotateStep','hasMoveEdit','uuid','trackedEntity','EditClass','_增加点','html2canvas','DIRECTION_FORWARD','maximumSizeX','关闭亮度','BLUE','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','reverse','_setPitchRange_rightDownHandler','level','control','debugShowFramesPerSecond','pickEllipsoid','location','https://restapi.amap.com/v3/geocode/regeo','targetPoint','EPSG:3857','contextMenuClose','info','_getPolylineOutlinePositions','Lambert_Conformal_Conic_2SP','_海拔','_last_depthTestAgainstTerrain','_onMouseMove','PostProcessStageComposite','_modelUpAxis','pois','identity','onDragStart','Close\x20terrain','createCommand','debugAxis','_tileLayer_removeTileHandler','COLUMN1ROW2','cndesc','_hierarchy','EllipsoidOutlineGeometry','_pageIndex','_view','_createFramebuffer','getAngleOfThreePoints','_onMouseMoveHandler','N_POLE','redraw','_mars_type','attackArrow','_normalZ','orginMatrix','sin_p14','ViewportQuad','classList','geocoder','changed','_containerBtnStart','Fischer\x20(Mercury\x20Datum)\x201960','fillVolumeName','sceneModePicker','Enable\x20sky\x20atmosphere','percentageChanged','RenderState','toUpperCase','fireTarget','ipad','addHeight','debugShowBoundingVolume','_czmContainerKey','请求出错','fromFramebuffer','PolygonHierarchy','_imageryLayer','setLayerSplitDirection','显示星空背景','VR模式不可用','查看当前视角','orginRotation','headers','_polylineCollection','Matrix3','flipy','success','控件,请直接使用\x20map.controls.','edgeColor','latitudeInterval','diffHeight','OBJECTID','setHeight','dimensions','trs','off','TilesetWireframeNo','interpolate','getTimestamp','noHeight','tile/','22JIIXQq','_initByMars3D','vrButton','_measureHorLable','rotationDegree','objectid','fromQuaternion','clock','跟踪鎖定','_cacheGraphic','granularity','_boundingSphereWC','headingPitchRollToFixedFrame','#2747E0','RadarWave','https://t{s}.tianditu.gov.cn/','radius_p','mars3d-mousedownview-show','_toCesiumValBefore','_last_startTime','strokeStyle','state','description','_getWellData','ImageOptsConver','CornerType','values','hasCache','entityGraphic','getPoint','_getWindowPosition','endDate','_clampToGround_last','_waterPlane','\x20\x0a请确认json文件格式正确!!!','_graphicList','EPSG:','no_rot','billboardCollection','numLines','cutVolume','debugExtentEntity','ShaderProgram','imageryLayers','For\x20more\x20functions,\x20right\x20click','queryParameters','WebMapTileServiceImageryProvider','B_re','_time','offsetLabel','toDegrees','allCount','rgba(0,0,255,0.2)','\x0a\x20\x20\x20\x20\x20.0)\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20imgC.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a','釋放後完成修改','longitude','uniform\x20vec4\x20u_color;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20powerRatio\x20=\x201.\x20/\x20(fract(czm_frameNumber\x20/\x2030.0)\x20+\x201.);\x0a\x20\x20float\x20alpha\x20=\x20pow(1.\x20-\x20st.t,\x20powerRatio);\x0a\x20\x20vec4\x20color\x20=\x20vec4(u_color.rgb,\x20alpha\x20*\x20u_color.a);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a','_marsOptions','finish','touchmove','local','in\x20vec3\x20position;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20pos\x20=\x20vec4(position.xyz,\x201.0);\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20pos;\x0a}\x0a','getAspectContourMaterial','getElementById','aspectRatio','SkyBox','loadConfig','IndexDatatype','_hasAsynSurfacePosition','toValue','rectangularSensorStyleConver','\x22\x20>','PolylinePipeline','VerticalOrigin','defaultView','getCircleCenterOfThreePoints','_tooltipConfig','EllipsoidStyleConver','skyBox','_depthTestAgainstTerrain_reset','getLayer','addLayer','worldToCameraCoordinatesPoint','getColumn','_positions_line_x','fromDate','saturation','取消锁定','_uniforms_blendColor_alpha','getDefaultContextMenu','按轴旋转','Geocent','getHeightReference','transZ','修改缩放比例','count','_getExtentView','Everest\x201969','_updatePositionsByCircleCenter','Southeast\x20Asia','computeModelMatrix','_initCollectionBy2D','play','closeTooltip','MaterialUtil\x20register:\x20','_clipOutSide','tianditu','UniformType','Ireland\x201965','_isFlyAnimation','_removeCollectionBy2D','ids','class','_map_cameraChanged','fetchXML','POSITIVE_INFINITY','madrid','Mercator_Auxiliary_Sphere','_updateDivPosition','ms\x20exceeded','pointCollection','_toolbar','X_TRANSLATION','ImageType','distanceDisplayCondition_far','showSkyBox','CGCS2000_GK_Zone_3','initMinMap','_hasEdit','PolyGradient','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_pointType','cosb1','createTypedArray','page','enabledEvent','VelocityOrientationProperty','infinity_dist','pass','czmObjectEx','repeat_y','setCameraView','_primitive_boxs','flowGlow','magnitude','+proj=tmerc\x20+lat_0=0\x20+lon_0=114\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','cosgam','Picking','_type','darkColor','_createGraphics','Potsdam\x20Rauenberg\x201950\x20DHDN','cosc0','_关闭键盘漫游','_formatPOIData','\x0a\x20\x20\x20\x20','closeSmallTooltip','false_easting','PostProcessStage','bindHighlight','_createGeometryInstance','setVisible','Krovak','C_x','results','Material','planes','CallbackProperty','_sexagesimal','bindPickId','intersectionWidth','corridor','inverse','CameraInfo','_heading_reality','farValue','surfaceDistance','objectsToExclude','_单击后激活编辑','_updateImage_delay','查看此處坐標','_onDbClickHandler','EPSILON6','region','EPSG4326','_enableDebugWireframe','gnom','endItem','NaN','px;','length','moveLeft','TileProviderError','_initByPosition','_handleMouseDown','LIGHTCYAN','_graphic_move_z','hasEmptyGroup','headWidthFactor','LEFT_ROTATE','PerInstanceColorAppearance','_tailorRect','u_mars3d_flood_currentheight','_colorHidden','_toJsonEx','_查看此处坐标','correspondingElement','_primitive4','globalAlpha','concat','水平距离','charCodeAt','Proj','grids','planeStyleConver','radius_p_inv2','stRotationDegree','multiplyByPoint','dirStep','addressComponent','pathStyleConver','Oblique\x20Stereographic\x20Alternative','shaderSource','number','_getCreateEntityAttr','paused','lightCone','con','beginFrame','RED','LOCAL_DATUM','showStop','showPointHeightLabel','nad83','emitterModelMatrix','fetchJsonp','_rangeNumber','one_minus_f','_sunlight','KeyboardEventModifier','绑定事件时传入了空值','allowDrillPick','defaultTexture','getRayEarthPositions','clampToTerrain','match','Ray','kaula','_debug','method','AssociativeArray','_sizeInBytes','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Additive','Geometry','#ffd700','_domeLineVA','normalX','_mScale','IdField','RADIANS_PER_DEGREE','getEntityPositions','screenSpaceCameraController','readyPromise','_outlineColor_alpha','Down','dth','west','drawShow','ShadowMapShader','_initByMetaData','Latitude\x20of\x20false\x20origin','_zoomFactor','showArea','interVal','passes','leftUp','getTime','ceil','etmerc','_popupId','+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs','_addGraphicByArrOptions','482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15','enableControl','parse','inProgress','_updateVirtualCamera','_width','ellps','resetUpliftValue','_显示星空背景','frameNumber','toCssColorString','setInputAction','imageSR','_arrLayerIdx','export','left\x20bottom\x200','rotateStop','WebMapServiceImageryProvider','content-length','CircleGeometry','_measureType','AFAFAF','+title=NAD83\x20(long/lat)\x20+proj=longlat\x20+a=6378137.0\x20+b=6356752.31414036\x20+ellps=GRS80\x20+datum=NAD83\x20+units=degrees','crsDecimal','高度差','testPoint','_updateDistanceDisplayConditionByEdit','Clarke\x201858','selectedLayer','Z_UP_TO_Y_UP','_x_direction','parent','face','binarySearch','silhouetteColor','COLUMN1ROW1','removeMapChilds','multiplyByPointAsVector','EPSG:4543','TileMatrix','ADDED','clipTarget','mars3d-overviewMap','s45','_rebindCzmContainer','WGS84标准椭球,即\x20EPSG:4326','proj4','moveStep','_tileWidth','_unbindEditEvent','endPosition','fromCartesian','關閉拾取高亮','TilesetBoundingVolumeNo','maxWidth','getAttribute','radii_z','_billboardCollection','getLangText','5e5949f7e96e8a136ef36a6594f18cdf','CGCS2000_GK_Zone_6','_globeMouseHandler','effect','showPlane','editPlane','_getItemDataId','getArrowHeadPoints','_clampToTilesetFrame','abc','_createLabel','pick3DTileset','noiseScale','alt','areaMeasure','bigfont','#000000','场景出图_','czmObject','unshift','_drawGrid','bindUpdateEvent','offsetX','towgs84','getDistance','_depthStencilTexture','Cartesian4','stopFlicker','straightArrow','stopTime','north','areaSurface','distanceLastFd','zoomIn','ymf','_removedBaseHook','_toChineseLang','endDraw','removeEventListener','registerImageryProvider:\x20','infocode','_maxTileLevel','_autoStopAngle','_eventParents','开启夜视','_lateralSurfaceMaterial','render','_距离','_setOptionsHook','commands','arrIDS','strokeRect','title','createImageryProvider','sources','_arrLayer','radii_x','zox','_setPositionsToCallback','lat','0x17)return undefined;_0x500fe8?_0x3ebb1e=_0x4711b7+0x117e:_0x3ebb1e=_0x4711b7+0x1189;}else{const _0x47d30b=parseInt((_0x317f98-1.5)/0x3)+0x1;if(_0x47d30b<0x19||_0x47d30b>0x2d)return undefined;_0x500fe8?_0x3ebb1e=_0x47d30b+0x1188:_0x3ebb1e=_0x47d30b+0x119d;}return'EPSG:'+_0x3ebb1e;}function getCGCS2000EPSGByX(_0x6ae2bb){const _0xaf6af5={_0x437156:0xa11},_0x402963=_0x3d5d32,_0x54e83a=parseInt(_0x6ae2bb['toString']()['slice'](0x0,0x2));if(_0x54e83a>=0xd&&_0x54e83a<=0x17)return _0x402963(0xa11)+(_0x54e83a+0x117e);else return _0x54e83a>=0x19&&_0x54e83a<=0x2d?_0x402963(_0xaf6af5._0x437156)+(_0x54e83a+0x1188):undefined;}function proj4Trans(_0x8cc0ca,_0x16e2f8,_0x2d6629='EPSG:4326'){const _0xf2046f=_0x3d5d32;if(!_0x16e2f8||!_0x2d6629||_0x16e2f8===_0x2d6629)return _0x8cc0ca;try{(_0x16e2f8===CRS['CGCS2000_GK_Zone_3']||_0x16e2f8===CRS[_0xf2046f(0xd1d)])&&(_0x16e2f8=getCGCS2000EPSGByX(_0x8cc0ca[0x0]));if(_0x2d6629===CRS['CGCS2000_GK_Zone_3'])_0x2d6629=getCGCS2000EPSGByLng(_0x8cc0ca[0x0],![],!![]);else{if(_0x2d6629===CRS['CGCS2000_GK_Zone_6'])_0x2d6629=getCGCS2000EPSGByLng(_0x8cc0ca[0x0],!![],!![]);else{if(_0x2d6629===CRS[_0xf2046f(0xeea)])_0x2d6629=getCGCS2000EPSGByLng(_0x8cc0ca[0x0],![],![]);else _0x2d6629===CRS['CGCS2000_GK_CM_6']&&(_0x2d6629=getCGCS2000EPSGByLng(_0x8cc0ca[0x0],!![],![]));}}if(!_0x16e2f8||!_0x2d6629||_0x16e2f8===_0x2d6629)return _0x8cc0ca;const _0x125d26=proj4(_0x16e2f8,_0x2d6629,_0x8cc0ca);if(Cesium__namespace['defined'](_0x125d26)&&_0x125d26[_0xf2046f(0xc84)]>0x1&&!isNaN(_0x125d26[0x0])&&_0x125d26[0x0]!==Infinity)return _0x125d26;}catch(_0x7d16f7){}return _0x8cc0ca;}function proj4TransArr(_0x539359,_0x4a901d,_0x528f27=_0x3d5d32(0x853)){const _0xc04d13={_0x416e6d:0xc84},_0x1078d3=_0x3d5d32;if(!_0x4a901d||_0x4a901d===_0x528f27)return _0x539359;const _0x1d4d8a=[];for(let _0x982c41=0x0,_0x3c11e1=_0x539359['length'];_0x982c41<_0x3c11e1;_0x982c41++){const _0x74f923=_0x539359[_0x982c41];if(Array['isArray'](_0x74f923[0x0])){const _0x79ba8d=proj4TransArr(_0x74f923,_0x4a901d,_0x528f27);_0x79ba8d&&_0x79ba8d[_0x1078d3(_0xc04d13._0x416e6d)]>0x0&&_0x1d4d8a['push'](_0x79ba8d);}else{const _0x4a707c=proj4Trans(_0x74f923,_0x4a901d,_0x528f27);_0x4a707c&&_0x1d4d8a[_0x1078d3(0xb75)](_0x4a707c);}}return _0x1d4d8a;}function cartesian2lonlat(_0x310be6,_0x1e06fa){const _0xdbe21d={_0x2137b6:0x4d4},_0x1ebfee=_0x3d5d32;return LngLatPoint[_0x1ebfee(_0xdbe21d._0x2137b6)](_0x310be6,_0x1e06fa);}function cartesians2lonlats(_0x14942d,_0x37b019){const _0x2149b8={_0x76964:0x4d4},_0x3d37a4=_0x3d5d32;return LngLatArray[_0x3d37a4(_0x2149b8._0x76964)](_0x14942d,_0x37b019);}function cartesian2mercator(_0x55a7a5){if(!_0x55a7a5)return null;const _0x83c6cd=LngLatPoint['fromCartesian'](_0x55a7a5);return _0x83c6cd['toMercator']();}function cartesians2mercators(_0xba5069){const _0x1dec67=[];for(let _0x48ae33=0x0,_0x4d164c=_0xba5069['length'];_0x48ae33<_0x4d164c;_0x48ae33++){const _0x378214=cartesian2mercator(_0xba5069[_0x48ae33]);_0x378214&&_0x1dec67['push'](_0x378214);}return _0x1dec67;}function lonlat2cartesian(_0x5dc47c,_0x7bb3e5=0x0){const _0x27fa78={_0x569f6c:0xc84},_0x52d3a6=_0x3d5d32;if(!_0x5dc47c||_0x5dc47c[_0x52d3a6(_0x27fa78._0x569f6c)]<0x2)return null;return Cesium__namespace[_0x52d3a6(0xe95)]['fromDegrees'](_0x5dc47c[0x0],_0x5dc47c[0x1],_0x5dc47c[0x2]||_0x7bb3e5);}function lonlats2cartesians(_0x3c98c3,_0x5953b8){const _0x5dc65d={_0x591a3a:0x62b},_0x28cf26=_0x3d5d32,_0x5bfa7f=[];for(let _0x244ed4=0x0,_0xe87d3c=_0x3c98c3['length'];_0x244ed4<_0xe87d3c;_0x244ed4++){const _0x5c9e8a=_0x3c98c3[_0x244ed4];if(Array[_0x28cf26(_0x5dc65d._0x591a3a)](_0x5c9e8a[0x0])){const _0x4970b3=lonlats2cartesians(_0x5c9e8a,_0x5953b8);_0x4970b3&&_0x4970b3['length']>0x0&&_0x5bfa7f[_0x28cf26(0xb75)](_0x4970b3);}else{const _0x26c904=lonlat2cartesian(_0x5c9e8a,_0x5953b8);_0x26c904&&_0x5bfa7f['push'](_0x26c904);}}return _0x5bfa7f;}function lonlat2mercator(_0x26a85d){const _0x7e4788=LngLatPoint['fromArray'](_0x26a85d);return _0x7e4788['toMercator']();}function lonlats2mercators(_0x2b21e7){const _0x5672e8=[];for(let _0x2a5e55=0x0,_0x2b7fe3=_0x2b21e7['length'];_0x2a5e55<_0x2b7fe3;_0x2a5e55++){const _0x3d02bc=lonlat2mercator(_0x2b21e7[_0x2a5e55]);_0x5672e8['push'](_0x3d02bc);}return _0x5672e8;}function mercator2cartesian(_0xc95c6,_0x2c6357){const _0x5951e8={_0x4ff00c:0x290},_0xac94b4=_0x3d5d32;if(isNaN(_0xc95c6[0x0])||isNaN(_0xc95c6[0x1]))return null;const _0x1a61ae=LngLatPoint[_0xac94b4(_0x5951e8._0x4ff00c)](_0xc95c6);return Cesium__namespace['defined'](_0x2c6357)&&(_0x1a61ae[_0xac94b4(0xd29)]=_0x2c6357),_0x1a61ae['toCartesian']();}function mercators2cartesians(_0x248cb3,_0x423ab9){const _0x66f667={_0xd30eb8:0xb75},_0xbc91c6=_0x3d5d32,_0x20363d=[];for(let _0x1b540c=0x0,_0x21c006=_0x248cb3['length'];_0x1b540c<_0x21c006;_0x1b540c++){const _0x408079=mercator2cartesian(_0x248cb3[_0x1b540c],_0x423ab9);_0x408079&&_0x20363d[_0xbc91c6(_0x66f667._0xd30eb8)](_0x408079);}return _0x20363d;}function mercator2lonlat(_0x277a62){const _0x8ec848=LngLatPoint['fromMercator'](_0x277a62);return _0x8ec848['toArray']();}function mercators2lonlats(_0x517d25){const _0x394e25=_0x3d5d32,_0x22071a=[];for(let _0x1ec8fc=0x0,_0x2328c5=_0x517d25['length'];_0x1ec8fc<_0x2328c5;_0x1ec8fc++){const _0x35179d=mercator2lonlat(_0x517d25[_0x1ec8fc]);_0x22071a[_0x394e25(0xb75)](_0x35179d);}return _0x22071a;}const x_PI=3.141592653589793*0xbb8/0xb4,PI=3.141592653589793,a=0x615305,ee=0.00669342162296594;function transformlat(_0x11c6f1,_0xefdb9c){const _0x2903f3=_0x3d5d32;let _0x3998e8=-0x64+0x2*_0x11c6f1+0x3*_0xefdb9c+0.2*_0xefdb9c*_0xefdb9c+0.1*_0x11c6f1*_0xefdb9c+0.2*Math['sqrt'](Math['abs'](_0x11c6f1));return _0x3998e8+=(0x14*Math['sin'](0x6*_0x11c6f1*PI)+0x14*Math['sin'](0x2*_0x11c6f1*PI))*0x2/0x3,_0x3998e8+=(0x14*Math['sin'](_0xefdb9c*PI)+0x28*Math['sin'](_0xefdb9c/0x3*PI))*0x2/0x3,_0x3998e8+=(0xa0*Math['sin'](_0xefdb9c/0xc*PI)+0x140*Math[_0x2903f3(0x723)](_0xefdb9c*PI/0x1e))*0x2/0x3,_0x3998e8;}function transformlng(_0x196034,_0x4ef175){const _0x34bc6f=_0x3d5d32;let _0x1d31dc=0x12c+_0x196034+0x2*_0x4ef175+0.1*_0x196034*_0x196034+0.1*_0x196034*_0x4ef175+0.1*Math[_0x34bc6f(0xae3)](Math['abs'](_0x196034));return _0x1d31dc+=(0x14*Math['sin'](0x6*_0x196034*PI)+0x14*Math['sin'](0x2*_0x196034*PI))*0x2/0x3,_0x1d31dc+=(0x14*Math['sin'](_0x196034*PI)+0x28*Math['sin'](_0x196034/0x3*PI))*0x2/0x3,_0x1d31dc+=(0x96*Math['sin'](_0x196034/0xc*PI)+0x12c*Math[_0x34bc6f(0x723)](_0x196034/0x1e*PI))*0x2/0x3,_0x1d31dc;}function out_of_china(_0xcd7eea,_0x427102){return _0xcd7eea<72.004||_0xcd7eea>137.8347||_0x427102<0.8293||_0x427102>55.8271||![];}function bd2gcj(_0x443190){const _0xea9c74={_0x2e6439:0x723},_0x7f6051=_0x3d5d32,_0x57233e=Number(_0x443190[0x0]),_0x391e0b=Number(_0x443190[0x1]),_0x3a66f7=3.141592653589793*0xbb8/0xb4,_0x5cc97f=_0x57233e-0.0065,_0x5ccea9=_0x391e0b-0.006,_0x2b8564=Math['sqrt'](_0x5cc97f*_0x5cc97f+_0x5ccea9*_0x5ccea9)-0.00002*Math['sin'](_0x5ccea9*_0x3a66f7),_0xb73a44=Math['atan2'](_0x5ccea9,_0x5cc97f)-0.000003*Math['cos'](_0x5cc97f*_0x3a66f7);let _0x3e4d94=_0x2b8564*Math['cos'](_0xb73a44),_0x5a0e1e=_0x2b8564*Math[_0x7f6051(_0xea9c74._0x2e6439)](_0xb73a44);return _0x3e4d94=Number(_0x3e4d94['toFixed'](0x6)),_0x5a0e1e=Number(_0x5a0e1e['toFixed'](0x6)),[_0x3e4d94,_0x5a0e1e];}function gcj2bd(_0x664553){const _0x4d2935=_0x3d5d32,_0x5c8fae=Number(_0x664553[0x0]),_0x3903ae=Number(_0x664553[0x1]),_0x4d0e2f=Math['sqrt'](_0x5c8fae*_0x5c8fae+_0x3903ae*_0x3903ae)+0.00002*Math['sin'](_0x3903ae*x_PI),_0x3c9043=Math['atan2'](_0x3903ae,_0x5c8fae)+0.000003*Math['cos'](_0x5c8fae*x_PI);let _0x12fc5b=_0x4d0e2f*Math[_0x4d2935(0x256)](_0x3c9043)+0.0065,_0x83ce78=_0x4d0e2f*Math['sin'](_0x3c9043)+0.006;return _0x12fc5b=Number(_0x12fc5b['toFixed'](0x6)),_0x83ce78=Number(_0x83ce78[_0x4d2935(0x719)](0x6)),[_0x12fc5b,_0x83ce78];}function wgs2gcj(_0x322046){const _0x40c8c0={_0x2cfdf5:0x256},_0x5b5fa4=_0x3d5d32,_0x48684d=Number(_0x322046[0x0]),_0x1691fc=Number(_0x322046[0x1]);if(out_of_china(_0x48684d,_0x1691fc))return[_0x48684d,_0x1691fc];else{let _0x3d5e8f=transformlat(_0x48684d-0x69,_0x1691fc-0x23),_0x33d0c6=transformlng(_0x48684d-0x69,_0x1691fc-0x23);const _0x3ebdbe=_0x1691fc/0xb4*PI;let _0x5b1271=Math[_0x5b5fa4(0x723)](_0x3ebdbe);_0x5b1271=0x1-ee*_0x5b1271*_0x5b1271;const _0x206ed0=Math[_0x5b5fa4(0xae3)](_0x5b1271);_0x3d5e8f=_0x3d5e8f*0xb4/(a*(0x1-ee)/(_0x5b1271*_0x206ed0)*PI),_0x33d0c6=_0x33d0c6*0xb4/(a/_0x206ed0*Math[_0x5b5fa4(_0x40c8c0._0x2cfdf5)](_0x3ebdbe)*PI);let _0x4a5884=_0x1691fc+_0x3d5e8f,_0x384c81=_0x48684d+_0x33d0c6;return _0x384c81=Number(_0x384c81['toFixed'](0x6)),_0x4a5884=Number(_0x4a5884[_0x5b5fa4(0x719)](0x6)),[_0x384c81,_0x4a5884];}}function gcj2wgs(_0x132987){const _0x293480={_0x2933bf:0x256},_0x18fe40=_0x3d5d32,_0x169715=Number(_0x132987[0x0]),_0x456ce4=Number(_0x132987[0x1]);if(out_of_china(_0x169715,_0x456ce4))return[_0x169715,_0x456ce4];else{let _0x1315e9=transformlat(_0x169715-0x69,_0x456ce4-0x23),_0x570810=transformlng(_0x169715-0x69,_0x456ce4-0x23);const _0x19e854=_0x456ce4/0xb4*PI;let _0x419e0a=Math['sin'](_0x19e854);_0x419e0a=0x1-ee*_0x419e0a*_0x419e0a;const _0x12cddc=Math[_0x18fe40(0xae3)](_0x419e0a);_0x1315e9=_0x1315e9*0xb4/(a*(0x1-ee)/(_0x419e0a*_0x12cddc)*PI),_0x570810=_0x570810*0xb4/(a/_0x12cddc*Math[_0x18fe40(_0x293480._0x2933bf)](_0x19e854)*PI);const _0x3d60dc=_0x456ce4+_0x1315e9,_0x25fef3=_0x169715+_0x570810;let _0x5f4dcb=_0x169715*0x2-_0x25fef3,_0x4f9926=_0x456ce4*0x2-_0x3d60dc;return _0x5f4dcb=Number(_0x5f4dcb[_0x18fe40(0x719)](0x6)),_0x4f9926=Number(_0x4f9926['toFixed'](0x6)),[_0x5f4dcb,_0x4f9926];}}function bd2wgs(_0x1a6a70){return gcj2wgs(bd2gcj(_0x1a6a70));}function wgs2bd(_0x22a64f){return gcj2bd(wgs2gcj(_0x22a64f));}var PointTrans={'__proto__':null,'degree2dms':degree2dms,'dms2degree':dms2degree,'getCGCS2000EPSGByLng':getCGCS2000EPSGByLng,'getCGCS2000EPSGByX':getCGCS2000EPSGByX,'proj4Trans':proj4Trans,'proj4TransArr':proj4TransArr,'cartesian2lonlat':cartesian2lonlat,'cartesians2lonlats':cartesians2lonlats,'cartesian2mercator':cartesian2mercator,'cartesians2mercators':cartesians2mercators,'lonlat2cartesian':lonlat2cartesian,'lonlats2cartesians':lonlats2cartesians,'lonlat2mercator':lonlat2mercator,'lonlats2mercators':lonlats2mercators,'mercator2cartesian':mercator2cartesian,'mercators2cartesians':mercators2cartesians,'mercator2lonlat':mercator2lonlat,'mercators2lonlats':mercators2lonlats,'bd2gcj':bd2gcj,'gcj2bd':gcj2bd,'wgs2gcj':wgs2gcj,'gcj2wgs':gcj2wgs,'bd2wgs':bd2wgs,'wgs2bd':wgs2bd};const Lang={'_放大':['放大','放大','Zoom\x20In'],'_缩小':['缩小','縮小',_0x3d5d32(0xbf3)],'_查看此处坐标':['查看此处坐标',_0x3d5d32(0xc7a),'Location\x20info'],'_位置信息':['位置信息',_0x3d5d32(0x4c5),_0x3d5d32(0x1e6)],'_经度':['经度','經度','Lon'],'_纬度':['纬度','緯度',_0x3d5d32(0xec3)],'_海拔':['高程','高程',_0x3d5d32(0x288)],'_横坐标':['横坐标','橫坐標','X'],'_纵坐标':['纵坐标','縱坐標','Y'],'_查看当前视角':[_0x3d5d32(0x9d8),_0x3d5d32(0x48e),'Camera\x20info'],'_当前视角信息':['当前视角信息','當前視角信息','Current\x20Camera\x20Information'],'_视角切换':[_0x3d5d32(0x5de),_0x3d5d32(0xfd6),_0x3d5d32(0x36d)],'_禁止进入地下':['禁止进入地下','禁止進入地下',_0x3d5d32(0x538)],'_允许进入地下':[_0x3d5d32(0x59d),'允許進入地下','Access\x20to\x20the\x20ground'],'_绕此处环绕飞行':['绕此处环绕飞行','繞此處環繞飛行','Fly\x20around\x20here'],'_关闭环绕飞行':['关闭环绕飞行','關閉環繞飛行','Close\x20off\x20circling'],'_移动到此处':[_0x3d5d32(0x4ae),'移動到此處',_0x3d5d32(0x881)],'_第一视角站到此处':['第一视角站到此处','第一視角站到此處','First\x20view\x20is\x20here'],'_开启键盘漫游':['开启键盘漫游','開啓鍵盤漫遊','Enable\x20keyboard\x20roaming'],'_关闭键盘漫游':['关闭键盘漫游','關閉鍵盤漫遊','Turn\x20off\x20keyboard\x20roaming'],'_跟踪锁定':['跟踪锁定',_0x3d5d32(0x9f5),'TrackedEntity'],'_取消锁定':[_0x3d5d32(0xc1d),_0x3d5d32(0x65a),_0x3d5d32(0x5b8)],'_三维模型':['三维模型',_0x3d5d32(0xb3b),'3DTiles'],'_显示三角网':['显示三角网','顯示三角網','Display\x20Wireframe'],'_关闭三角网':['关闭三角网','關閉三角網','Close\x20Wireframe'],'_显示包围盒':['显示包围盒','顯示包圍盒','Display\x20BoundingVolume'],'_关闭包围盒':[_0x3d5d32(0x7ff),'關閉包圍盒','Close\x20BoundingVolume'],'_地形服务':['地形服务','地形服務','Terrain'],'_开启地形':['开启地形','顯示地形','Open\x20terrain'],'_关闭地形':['关闭地形','關閉地形',_0x3d5d32(0x9ac)],'_图上标记':['图上标记','圖上標記',_0x3d5d32(0x2b8)],'_标记点':['标记点','標記點',_0x3d5d32(0xf87)],'_标记线':['标记线','標記線','Tag\x20line'],'_标记面':[_0x3d5d32(0xe1c),'標記面','Mark\x20surface'],'_标记圆':['标记圆','標記圓','Mark\x20round'],'_标记矩形':['标记矩形','標記矩形',_0x3d5d32(0xfd5)],'_允许编辑':['允许编辑','允許編輯','Allowed\x20to\x20edit'],'_禁止编辑':['禁止编辑','禁止編輯','Prohibit\x20to\x20edit'],'_导出GeoJSON':['导出GeoJSON','導出GeoJSON','Export\x20GeoJSON'],'_清除所有标记':['清除所有标记','清除所有標記','Clear'],'_特效效果':['特效效果','特效效果','Effects'],'_开启下雨':['开启下雨','開啓下雨','Enable\x20rain'],'_关闭下雨':['关闭下雨',_0x3d5d32(0x41f),_0x3d5d32(0xa60)],'_开启下雪':['开启下雪',_0x3d5d32(0x3b6),'Enable\x20snow'],'_关闭下雪':['关闭下雪','關閉下雪',_0x3d5d32(0x316)],'_开启雾天气':['开启雾天气',_0x3d5d32(0x959),'Enable\x20fog'],'_关闭雾天气':['关闭雾天气','關閉霧天氣','Close\x20fog'],'_开启泛光':['开启泛光','開啓泛光','Enable\x20bloom'],'_关闭泛光':['关闭泛光','關閉泛光','Close\x20bloom'],'_开启亮度':['开启亮度','開啓亮度',_0x3d5d32(0xedc)],'_关闭亮度':[_0x3d5d32(0x993),'關閉亮度','Close\x20brightness'],'_开启夜视':[_0x3d5d32(0xd48),'開啓夜視',_0x3d5d32(0x7bb)],'_关闭夜视':['关闭夜视','關閉夜視',_0x3d5d32(0x6d3)],'_开启黑白':['开启黑白','開啓黑白','Enable\x20black\x20and\x20white'],'_关闭黑白':['关闭黑白','關閉黑白',_0x3d5d32(0x933)],'_开启拾取高亮':['开启拾取高亮','開啓拾取高亮','Enable\x20Pick\x20highlighted'],'_关闭拾取高亮':[_0x3d5d32(0x338),_0x3d5d32(0xd15),_0x3d5d32(0x7b5)],'_场景设置':['场景设置','場景設置','Scene'],'_开启深度监测':['开启深度监测','開啓深度監測','Enable\x20depth\x20test\x20against\x20terrain'],'_关闭深度监测':[_0x3d5d32(0xaf6),'關閉深度監測','Close\x20depth\x20test\x20against\x20terrain'],'_显示星空背景':[_0x3d5d32(0x9d6),'顯示星空背景','Enable\x20skyBox'],'_关闭星空背景':['关闭星空背景','關閉星空背景','Close\x20skyBox'],'_开启日照阴影':[_0x3d5d32(0x8c5),'開啓日照陰影','Enable\x20shadow'],'_关闭日照阴影':[_0x3d5d32(0x3ae),'關閉日照陰影','Close\x20shadow'],'_开启大气渲染':['开启大气渲染',_0x3d5d32(0x6c7),_0x3d5d32(0x9c8)],'_关闭大气渲染':['关闭大气渲染','關閉大氣渲染','Close\x20sky\x20atmosphere'],'_场景出图':['场景出图','場景出圖','Export\x20image'],'_图上量算':[_0x3d5d32(0x860),'圖上量算',_0x3d5d32(0xeef)],'_删除测量':['删除测量','刪除測量',_0x3d5d32(0xa39)],'_角度':['角度','角度',_0x3d5d32(0x252)],'_距离':['距离','距離','Distance'],'_面积':['面积','面積','Area'],'_总长':['总长','總長','Total\x20distance'],'_起点':['起点','起點','Start'],'_高度差':[_0x3d5d32(0xcf9),'高度差',_0x3d5d32(0x2e9)],'_空间距离':['空间距离',_0x3d5d32(0xf45),'Space\x20distance'],'_水平距离':[_0x3d5d32(0xc98),'水平距離','Horizontal\x20distance'],'_正在计算体积':[_0x3d5d32(0x2cd),'正在計算體積','Calculating\x20volume'],'_填方体积':['填方体积',_0x3d5d32(0x210),_0x3d5d32(0xa5f)],'_挖方体积':[_0x3d5d32(0x318),'挖方體積','Excavation\x20volume'],'_横切面积':['横切面积','橫切面積',_0x3d5d32(0x701)],'_面上':['面上','面上','Up'],'_面下':['面下','面下',_0x3d5d32(0xccf)],'_米':['米','米','m'],'_公里':['公里','公裏','km'],'_万米':['万米','万米','myriametre'],'_海里':['海里','海裏','mile'],'_丈':['丈','丈',_0x3d5d32(0xdcc)],'_平方米':['平方米','平方米','m²'],'_平方公里':['平方公里','平方公裏',_0x3d5d32(0x25c)],'_亩':['亩','畝','mu'],'_公顷':['公顷','公頃','ha'],'_立方米':['方','方','m³'],'_万立方米':['万方','万方','wm³'],'_单击开始绘制':['单击开始绘制','單擊開始繪制','Click\x20to\x20start\x20drawing'],'_单击完成绘制':['单击完成绘制','單擊完成繪制','Click\x20to\x20finish\x20drawing'],'_双击完成绘制':['双击完成绘制','雙擊完成繪制',_0x3d5d32(0x888)],'_单击增加点':['单击增加点','單擊增加點','left\x20click\x20add\x20point'],'_右击删除点':['右击删除点','右擊刪除點','right\x20click\x20delete\x20point'],'_单击后激活编辑':[_0x3d5d32(0xb2f),'單擊後\x20激活編輯','Click\x20to\x20activate\x20editing'],'_右击菜单删除':['右击菜单删除','右擊菜單刪除','Right\x20click\x20menu\x20to\x20delete'],'_更多功能请右击':['更多功能请右击','更多功能請右擊',_0x3d5d32(0xa19)],'_停止编辑':['停止编辑','停止編輯','Stop\x20editing'],'_删除该点':['删除该点','刪除該點','Delete\x20that\x20point'],'_按轴平移':['按轴平移','按軸平移','Translation\x20by\x20axis'],'_停止按轴平移':['停止按轴平移','停止按軸平移',_0x3d5d32(0xbc0)],'_按轴旋转':[_0x3d5d32(0xc20),'按軸旋轉',_0x3d5d32(0x828)],'_停止按轴旋转':['停止按轴旋转','停止按軸旋轉',_0x3d5d32(0x254)],'_调整比例':['调整比例',_0x3d5d32(0x34d),_0x3d5d32(0x8c8)],'_停止调整比例':[_0x3d5d32(0xba3),'停止調整比例','Stop\x20edit\x20scale'],'_释放后完成修改':[_0x3d5d32(0xaf9),_0x3d5d32(0xbfc),'Complete\x20the\x20modification\x20after\x20release'],'_该对象不允许编辑':['该对象不允许编辑','該對象不允許編輯','This\x20object\x20does\x20not\x20allow\x20editing'],'_拖动该点后':[_0x3d5d32(0x821),'拖動該點後',_0x3d5d32(0x5d4)],'_拖动对象后':[_0x3d5d32(0x469),_0x3d5d32(0xa6d),'Drag\x20that\x20object'],'_修改位置':[_0x3d5d32(0x637),_0x3d5d32(0x637),'Modify\x20the\x20position'],'_整体平移':[_0x3d5d32(0xb00),_0x3d5d32(0x6da),_0x3d5d32(0xb0b)],'_增加点':[_0x3d5d32(0x537),'增加點','Add\x20point'],'_修改高度':['修改高度',_0x3d5d32(0x1046),_0x3d5d32(0x3de)],'_修改半径':['修改半径','修改半徑','Modify\x20the\x20radius'],'_修改长度':[_0x3d5d32(0x286),'修改長度(X方向)','Modify\x20the\x20length(X\x20direction\x20)'],'_修改宽度':['修改宽度(Y方向)','修改寬度(Y方向)','Change\x20the\x20width(Y\x20direction)'],'_修改方向':['修改方向','修改方向','Change\x20direction'],'_修改缩放比例':[_0x3d5d32(0xc24),'修改縮放比例','Modify\x20the\x20Scale'],'_无法删除不能少于最小点数':['无法删除,点数量不能少于','無法刪除,點數量不能少于','Cannot\x20delete,\x20the\x20number\x20of\x20dots\x20cannot\x20be\x20less\x20than'],'_删除':['删除','刪除',_0x3d5d32(0xa39)],'_加载模型中':['加载模型中…','加载模型中…','Load\x20Model…']};function xhrAdapter(_0x5c786c){const _0x59c874={_0x35d851:0x9da,_0x40efb8:0x5ee,_0x46be0c:0xed7,_0x5223c4:0x6c3,_0x486f13:0x6c3,_0x22f719:0x405},_0x343221={_0x3e3e97:0x23c},_0x5d1660={_0x2a1f2d:0x6bf};return _0x5c786c={'method':'get','timeout':0x0,'maxContentLength':-0x1,'maxBodyLength':-0x1,'params':_0x5c786c['queryParameters']||{},..._0x5c786c},new Promise(function _0x4d1d9b(_0x42f2e3,_0x1cd653){const _0x29bbce={_0x19c4d5:0xc3d},_0x4fc951=_0x4132;let _0x424668=_0x5c786c['data'];const _0x400a6c=_0x5c786c[_0x4fc951(_0x59c874._0x35d851)]||{},_0x51e6be=_0x5c786c['responseType'];isFormData(_0x424668)&&delete _0x400a6c['Content-Type'];let _0x421eee=new XMLHttpRequest();_0x421eee['open'](_0x5c786c['method']['toUpperCase'](),buildURL(_0x5c786c[_0x4fc951(_0x59c874._0x40efb8)],_0x5c786c['params'],_0x5c786c[_0x4fc951(0xe82)]),!![]),_0x421eee['timeout']=_0x5c786c['timeout'];function _0x56fd91(){if(!_0x421eee)return;const _0x7b6369='getAllResponseHeaders'in _0x421eee?parseHeaders(_0x421eee['getAllResponseHeaders']()):null,_0x376e2e=!_0x51e6be||_0x51e6be==='text'||_0x51e6be==='json'?_0x421eee['responseText']:_0x421eee['response'],_0x3d133a={'data':transformResponse(_0x421eee,_0x376e2e),'status':_0x421eee['status'],'statusText':_0x421eee['statusText'],'headers':_0x7b6369,'options':_0x5c786c,'request':_0x421eee};settle(function _0x567c39(_0x54803b){_0x42f2e3(_0x54803b);},function _0x32ea74(_0x593e07){_0x1cd653(_0x593e07);},_0x3d133a),_0x421eee=null;}'onloadend'in _0x421eee?_0x421eee['onloadend']=_0x56fd91:_0x421eee['onreadystatechange']=function _0x5ab5f0(){const _0x2eba34=_0x4fc951;if(!_0x421eee||_0x421eee['readyState']!==0x4)return;if(_0x421eee['status']===0x0&&!(_0x421eee[_0x2eba34(_0x5d1660._0x2a1f2d)]&&_0x421eee['responseURL']['indexOf']('file:')===0x0))return;setTimeout(_0x56fd91);},_0x421eee['onabort']=function _0x2ab296(){if(!_0x421eee)return;_0x1cd653(createError('Request\x20aborted',_0x5c786c,'ECONNABORTED',_0x421eee)),_0x421eee=null;},_0x421eee[_0x4fc951(0xf1a)]=function _0x27bbba(){_0x1cd653(createError('Network\x20Error',_0x5c786c,null,_0x421eee)),_0x421eee=null;},_0x421eee['ontimeout']=function _0x479f10(){const _0x35da42=_0x4fc951;let _0x913f84='timeout\x20of\x20'+_0x5c786c['timeout']+_0x35da42(_0x29bbce._0x19c4d5);_0x5c786c['timeoutErrorMessage']&&(_0x913f84=_0x5c786c['timeoutErrorMessage']),_0x1cd653(createError(_0x913f84,_0x5c786c,'ECONNABORTED',_0x421eee)),_0x421eee=null;},_0x4fc951(_0x59c874._0x46be0c)in _0x421eee&&forEach(_0x400a6c,function _0x5834e5(_0x312f9c,_0x4ec1d8){const _0x4d0a5d=_0x4fc951;typeof _0x424668===_0x4d0a5d(_0x343221._0x3e3e97)&&_0x4ec1d8['toLowerCase']()==='content-type'?delete _0x400a6c[_0x4ec1d8]:_0x421eee['setRequestHeader'](_0x4ec1d8,_0x312f9c);}),!isUndefined(_0x5c786c['withCredentials'])&&(_0x421eee['withCredentials']=!!_0x5c786c['withCredentials']),_0x51e6be&&_0x51e6be!=='json'&&(_0x421eee['responseType']=_0x5c786c['responseType']),typeof _0x5c786c[_0x4fc951(_0x59c874._0x5223c4)]==='function'&&_0x421eee['addEventListener']('progress',_0x5c786c[_0x4fc951(_0x59c874._0x486f13)]),typeof _0x5c786c['onUploadProgress']==='function'&&_0x421eee['upload']&&_0x421eee[_0x4fc951(0x955)]['addEventListener'](_0x4fc951(0x100b),_0x5c786c[_0x4fc951(_0x59c874._0x22f719)]),!_0x424668&&(_0x424668=null),_0x421eee['send'](_0x424668);});}function isString$1(_0x57ec55){return typeof _0x57ec55==='string';}function isDate(_0x1bae59){const _0x386f35={_0x4f80c5:0xa86},_0x1db8ab=_0x3d5d32;return toString[_0x1db8ab(_0x386f35._0x4f80c5)](_0x1bae59)==='[object\x20Date]';}function isObject$1(_0x283a56){return _0x283a56!==null&&typeof _0x283a56==='object';}function isFormData(_0x247358){const _0x124731=_0x3d5d32;return typeof FormData!==_0x124731(0x23c)&&_0x247358 instanceof FormData;}function isUndefined(_0x49d8c4){return typeof _0x49d8c4==='undefined';}function isURLSearchParams(_0x2ef983){return typeof URLSearchParams!=='undefined'&&_0x2ef983 instanceof URLSearchParams;}function forEach(_0x3e9314,_0x2be053){const _0x3b3083={_0x546d6d:0xf8c},_0x5a3070=_0x3d5d32;if(_0x3e9314===null||typeof _0x3e9314==='undefined')return;typeof _0x3e9314!=='object'&&(_0x3e9314=[_0x3e9314]);if(Array[_0x5a3070(0x62b)](_0x3e9314))for(let _0xc7067a=0x0,_0xfcb3f6=_0x3e9314['length'];_0xc7067a<_0xfcb3f6;_0xc7067a++){_0x2be053[_0x5a3070(0xa86)](null,_0x3e9314[_0xc7067a],_0xc7067a,_0x3e9314);}else for(const _0x2d0889 in _0x3e9314){Object[_0x5a3070(_0x3b3083._0x546d6d)]['hasOwnProperty']['call'](_0x3e9314,_0x2d0889)&&_0x2be053[_0x5a3070(0xa86)](null,_0x3e9314[_0x2d0889],_0x2d0889,_0x3e9314);}}function encode(_0x477d0f){const _0x33ae0a=_0x3d5d32;return encodeURIComponent(_0x477d0f)['replace'](/%3A/gi,':')['replace'](/%24/g,'$')['replace'](/%2C/gi,',')[_0x33ae0a(0xbb6)](/%20/g,'+')['replace'](/%5B/gi,'[')['replace'](/%5D/gi,']');}function trim$1(_0x3d45ab){const _0x50e58a=_0x3d5d32;return _0x3d45ab[_0x50e58a(0x3bb)]?_0x3d45ab[_0x50e58a(0x3bb)]():_0x3d45ab['replace'](/^\s+|\s+$/g,'');}function buildURL(_0x4f5850,_0x5433e2,_0x2645a5){const _0x33e942={_0x4d52d5:0x54b},_0x219170={_0x17e160:0x62b},_0x1b6958=_0x3d5d32;if(!_0x5433e2)return _0x4f5850;let _0x54a05d;if(_0x2645a5)_0x54a05d=_0x2645a5(_0x5433e2);else{if(isURLSearchParams(_0x5433e2))_0x54a05d=_0x5433e2['toString']();else{const _0x37ec95=[];forEach(_0x5433e2,function _0x5cdd13(_0x28df35,_0x12d198){const _0x7fcb1b=_0x4132;if(_0x28df35===null||typeof _0x28df35===_0x7fcb1b(0x23c))return;Array[_0x7fcb1b(_0x219170._0x17e160)](_0x28df35)?_0x12d198=_0x12d198+'[]':_0x28df35=[_0x28df35],forEach(_0x28df35,function _0x362dcb(_0x4d4f67){if(isDate(_0x4d4f67))_0x4d4f67=_0x4d4f67['toISOString']();else isObject$1(_0x4d4f67)&&(_0x4d4f67=JSON['stringify'](_0x4d4f67));_0x37ec95['push'](encode(_0x12d198)+'='+encode(_0x4d4f67));});}),_0x54a05d=_0x37ec95['join']('&');}}if(_0x54a05d){const _0x6be261=_0x4f5850['indexOf']('#');_0x6be261!==-0x1&&(_0x4f5850=_0x4f5850['slice'](0x0,_0x6be261)),_0x4f5850+=(_0x4f5850[_0x1b6958(_0x33e942._0x4d52d5)]('?')===-0x1?'?':'&')+_0x54a05d;}return _0x4f5850;}const ignoreDuplicateOf=['age','authorization',_0x3d5d32(0xcf3),'content-type','etag',_0x3d5d32(0xab9),'from','host','if-modified-since',_0x3d5d32(0xf19),'last-modified','location','max-forwards','proxy-authorization','referer','retry-after','user-agent'];function parseHeaders(_0x61830){const _0x33cab2={_0x5ada52:0x54b},_0x419037={};let _0x52b6a3,_0xc3c424,_0xc6f411;if(!_0x61830)return _0x419037;return forEach(_0x61830['split']('\x0a'),function _0x5254f4(_0x1ee78b){const _0x396d71=_0x4132;_0xc6f411=_0x1ee78b['indexOf'](':'),_0x52b6a3=trim$1(_0x1ee78b['substr'](0x0,_0xc6f411))['toLowerCase'](),_0xc3c424=trim$1(_0x1ee78b['substr'](_0xc6f411+0x1));if(_0x52b6a3){if(_0x419037[_0x52b6a3]&&ignoreDuplicateOf[_0x396d71(_0x33cab2._0x5ada52)](_0x52b6a3)>=0x0)return;_0x52b6a3==='set-cookie'?_0x419037[_0x52b6a3]=(_0x419037[_0x52b6a3]?_0x419037[_0x52b6a3]:[])[_0x396d71(0xc97)]([_0xc3c424]):_0x419037[_0x52b6a3]=_0x419037[_0x52b6a3]?_0x419037[_0x52b6a3]+',\x20'+_0xc3c424:_0xc3c424;}}),_0x419037;}function settle(_0x42a096,_0x1b4321,_0x193ea8){const _0x23e6f5={_0x119d25:0xf39},_0x47a8c9=_0x3d5d32;!_0x193ea8['status']||validateStatus(_0x193ea8['status'])?_0x42a096(_0x193ea8):_0x1b4321(createError(_0x47a8c9(_0x23e6f5._0x119d25)+_0x193ea8['status'],_0x193ea8['options'],null,_0x193ea8['request'],_0x193ea8));}function validateStatus(_0x4bff54){return _0x4bff54>=0xc8&&_0x4bff54<0x12c;}function createError(_0x4e68eb,_0x584bdb,_0x5b0af1,_0x518a18,_0x457237){const _0x2993a8=new Error(_0x4e68eb);return enhanceError(_0x2993a8,_0x584bdb,_0x5b0af1,_0x518a18,_0x457237);}function enhanceError(_0x2de54c,_0x37af6f,_0x3efef8,_0x2283be,_0x397ba2){const _0x418ff9={_0x16e625:0x3db},_0x38caff={_0x4e361d:0xaed,_0x40a5c1:0x6e5,_0xeddc99:0x433},_0x4b47b3=_0x3d5d32;return _0x2de54c['options']=_0x37af6f,_0x3efef8&&(_0x2de54c['code']=_0x3efef8),_0x2de54c['request']=_0x2283be,_0x2de54c['response']=_0x397ba2,_0x2de54c['isAxiosError']=!![],_0x2de54c[_0x4b47b3(_0x418ff9._0x16e625)]=function _0x4b03b5(){const _0xadeef6=_0x4b47b3;return{'message':this['message'],'name':this[_0xadeef6(_0x38caff._0x4e361d)],'description':this['description'],'number':this['number'],'fileName':this['fileName'],'lineNumber':this['lineNumber'],'columnNumber':this[_0xadeef6(_0x38caff._0x40a5c1)],'stack':this['stack'],'options':this[_0xadeef6(_0x38caff._0xeddc99)],'code':this['code'],'status':this['response']&&this['response'][_0xadeef6(0xfd7)]?this['response']['status']:null};},_0x2de54c;}function transformResponse(_0x2ea611,_0x3c978e){if(isString$1(_0x3c978e)&&_0x3c978e['length'])try{return JSON['parse'](_0x3c978e);}catch(_0x1e44cb){}return _0x3c978e;}const version='3.5.12',update='2023-06-19\x2010:10:00',image={'url':'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAUCAYAAAAJD/ojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2NUVFNjVDRUFBMDgxMUU5QUM4NDg4MzU3RThBMzcwQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2NUVFNjVDRkFBMDgxMUU5QUM4NDg4MzU3RThBMzcwQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY1RUU2NUNDQUEwODExRTlBQzg0ODgzNTdFOEEzNzBCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY1RUU2NUNEQUEwODExRTlBQzg0ODgzNTdFOEEzNzBCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+GxQkfQAADBVJREFUeNrsWHtwVNUd/u7u3d1sNtlNNmQTkiyjkfAIqCD4AOQhGUBAqtMahloFq6KOio9qfVu0VVtrpahtrQOlCsgUlYq0QuMDMojQVFrLo0UeaSIGSAJ57SbZ7Otuv9/ds3ETQeto/+jUM/Obe8+55/E73+9xvnO11h/6cMqiabAYCT4pug5PvAN7dD8u8t6Clm4LcOJdtg8G7HdMh8cbRA52gM1o7gZaeoASL7DtFaCzEZi2CGATgvxW14zHr8jBfdNyzGX2798Pp9OJQYMGIZFIqKU1hEIh1NbWoqioCF6v12xvbW3FkSNHkJOTY7ZbrVbE4/GTqi/fwuEw6uvr4XK5UFxcbM4rpaOjAxaLBdnZ2eb4aDRqridF5pZ+hmH06pJe0nVM1VPvsp682+12s27BFylUEl0EaPlSoPpDwHMjkDl3JvK9Vfhg8xw8MAG4n7LtVSCDgJhravh/LvoX6u1wiImA9z8Gyk4AMyaPRRS/gRjabvMhxw8YUb5n9sVVWTxpUn6IJpLyOUU8QSSRNl7exbNS3vV5RfqLh6bPIUXGp7wutc5/BWDLqTxMMoPFkgUtHqdyydgxYgTISgD5nuUbjDjWENyB6GC9bMIIjDzPA4+jA8cCwDEaIZeA211uevO5jJVRlHaEjc00a50786TBw8lxDWUgZUUkEmmQkEsvEtY2m40ZSx/AajmlhOBk8xlLt42KznZ+q2e4/oP9u6SNexnCtjjTRyNlAdsqY7HY8zTCmjQjfIsyi/IMZVfavOdSrqX8ibK+n6PeROGG8RPO39L7IZSIngpfaDF47Zr+uG7VBxsJbQsCx1qcnqFv2R6taYDmfxEhlJmd6bBoqBuB2rcnYficD5FTdBly9bHoxEUYMTMfRqQBDcdWwe54Bx3WjyePzsJNk7MEhHmU0wnkms7Oznq/32+ncj8Q0Cg1wWCwQTbtcDiuYP00ykrm6oaBAwciKyvrBQI0m8Aso2zguLy0fBSRdCjG4thZJSUlTxDEe8WTaaDJ7FvJ3CtPnbl3UyAQOMQc/X22nUODXs01J/CbGPq9fgBPpNzAbxkKYNEzk3XR7SGOG0BD7uUa1aznsd6sRxInPyAsVgu6u3oOOzTbUq/b81IGovfSYwPvWEZFGx3+C/g+vtdnxL/zSrPgXbhefMy0ThZR744dRqhxIZy1K9AVNRA4EyjMwT0Xy6FglV4C3CUE9ig39gIBiFFBQ3lSuLCwEAUFBYVse47f3ATjFQFJDi9uKkeFd4D1iAI1BXBUaRVQXp8jc1IMvj/PZy2bK8QTOX6Wx+ORqJgrBmd9R+ITV470gyWknq3q+Q3KSBUt4hyi2ww+z1JTVOt+z8nPOY0Ah4iVoWk7XXkYhrbGRVtD47VHXE+Vcdl5SJyEcnAJM1h6sA098fsRbn8XHU1cnvTB5iFkFtxZVo8x2gnsrInBV+TfPsjvv4QbHEPgxCOjKnjMIJJ0wHI2xU2F99KjD8kmMjMze09P1rtF5IRQwKbSQxeSvEX6aDSSmV44z1QV5lKGsP2OpqamlwjwXWQqRxhNQebnEkZIKpBT+b6Q4ytVrp7b1dW1js9fiS6c08lvU9nPzX0sZp+DvSnikiVtp2JoiMWSSTGrsyMRGDHqmT9f9trD7Zm+m3vtmJ7xbDC8bXWvavs3L2kpnlEDP6Onx80VMpN5O2jA59Mx7/w8+Lw6gnoc7uzs7QqAin379mH37t2YMmWKReiUgCUbo/JjBRgCsSk3Nzdx9OhRHD9+HPT6vQRhPPsJfyuiZKcZx1D1QqkwBTQJBRP6xZQxlWCO4LwCvp1rlK9atWr86NGjMyoqKvazvpE5e1L/A5GlkXp+QLlIjM22v1OvoWwfrFKFGED2ciVB3qZ0OahvLP/RZxzjcRM5hHI5zXmLYfct7hM0mpI4/vDN8Lp3f2Q8qMN9qO1N/Uq8EVmAxrgNDXE72sP5pG1BLJ0cwNhBPnR25iJ/QIIGjO1gajjETQ8nqGfSK/bQI0xmQ0AsAgrz4pWK626VjbrdbpNjEvAadhtN+ZeEIuXblKXKc6+i1FFkc9dnZGQ0pNiHyuW5wtZVlOSPGzeum8YTUO9gv4vlYEyHQQ5VxUgOKs5by2cXvX0Uc/dt5ObvcC/foQGb2X4p13uTz2Nc7x4dsyo/g+MQTY2UIav0VkRtD5tsIcWeLea5/fGFsc2rH8GjLVONLbcgUz8tVuZpKg+vPnB7aI3JUT70lOHHsRnY7rwUpcUF5sB4PGklghSh3MLXi3t6eo6Wl5dPJ4DCINDW1ja7paVl28iRI5eJE3FTWyQ8JXQlZ7J8l5s4l217+D5GTnCV9+JsG6JAJHHHDILwPo3yRzGYyq8iVsnJwkCGDRvWSS//Ketn0qBZfBYqIMPylMuNsJn8/PyEpBphOVKncTbw/ed0gKt5PjylWMs1CqVfUtbqaDsFh0gYybyp58xFWH+6r8fyW8zyxARjywNb4tPu0q3GzzotBbz12dARiY45lHCtiNH77cwM+fZ/4rHuPdgWWwZreK3slwDZe1ei11bxVlVF4OwE4sFUO29pt/PG9saCBQuWTJo0CZWVleZtT25c3ORMetWF9Ooa1hfTUxrY5mQk3ElAwjRWFds+4sa97JPNlBIUYMQwBKX/6ZFgexHX3i7eR4Ak3Bepb/PZ/yM+3+d8Or/PUCljHL10HJnPjvb29tvpuWv57XW2/41rXk/Pfpn7ekyMQ3NknQRfIymWvArYXCuQTjQsvA6HOm9EyL3bkR1HXPcu1Y1gccJqXZRJ9Jtixph98ZDeTdKcYVhMaiuEwdLdgea963DAPRaWaACyT3oNdu3aZYb97Nmzn6FyEwnY02yvy8vLWzp06NBlhw8fnvjkk0+eIHi4/PLLzXCl9/yF3nifcBfK+RxTwg2XSR8JDH4fyZDNo9cWEuxAY2NjtazBNNB/p8JYxOuGc/zddXV1Z9AQTczvEmqSwsIc2yGGlXNBjGeGSDxexbl3SDvbXqa4OMcK6i9pZj3rV6QuLvqnrrIJnmw6aZ7dfRY0x28JrksloCDlblhjvzZzs0UyhAVRTQ/bE/Fbu7q73w7b7K/7dPv512i+UZx1Z0JFgx46jlDpRBwovRaNLceh97SK8uahM336dPlPsIQK30AP2LV8+fK7hK5dd911pQTl1urq6k1sn02R/GaO40ZaCPSzBONCethAdaDZVYrQOM6hWIWTkdEjoS3jJKzZR0s7QeQM9ygvXVlVVWUylPnz5wu/H0aQ1nKNA3IG0FAxGrKa883j2lryYuuAon8FqRsh39387qIElAf3o2myvmYvgSVjJVXwm2rEIq8h2nkzNNcx2PU+/xc0NXGws2eDMwOnu3LtrwbCsTm8/+00jchIsEUjaM4/D905ZyAzyPODh5TwWQLs56XhJUXga5gqZtXW1sZ8Pp8cZLcpmnU3ARDeOpcKbxIPFp5JkVtck+K0RyjDlddIKPMeDwEtqMCfyDk2CSB8uvhd6JxT3cA8HGfyotLSUjMNiZMKOOybLVxcMRExboXadqdiOE6O3UiZwvrvWH+PxniW41q4v8vY9sYnAJspgQbN8DhhzXiRyJ2NSPQ4jPiNsBm/h+ikJT718ybRezHhfd6Ceq47y4gjVw7sJMDCCJiLc1zwDx0AI8T98nIjChLEc+QOSGXupGLLZR/yd0tYgvLGe9hvBxWeKwcX36vY12DfbMpY9oko7mtRz++Zfzs0bbQ6+GQSckXUs+9bbJer0UoFTL5KEa2U3bLYtGnTUmxhjTJejTiC6ErgT6Nx97P9kYaGhlViaF6CxrF+VNgC5TlGSJB67WbfhZz/DLFZ3xRhEGCnYx0ytKn0nbXoDixEPByENy8ZTVo6pKcszQS2mWD3MYXNpkPul5w/ve/rIv1///X7WbO+371f2t4T+aI/XhQzWP8fdN2oJF0voW4PyQvTRYrybRZJ/5HE9q18bP0kB5t5mxUbDe3KXo/W5pkI1l6F4lGrzVzce5VO4MuUlA5GUos+P2/+14rk5HS90x0j/R9xkhMk1LXNbv8FCcVwtNQOwcG3ViPG9Ge14evyZf8HZxZlIR6dg0B7E+wFF9A8bcmUpn2NzlcCcKTHAyP6VwSaNiDb1/W113615d8CDAB0JaU81/NTEwAAAABJRU5ErkJggg==','rectangle':[0xa,0x5,0x58,0x14]};new Function('czmver',_0x3d5d32(0xe34))(Cesium['VERSION']);let customImage;function setImage(_0x3c717e){customImage=_0x3c717e;}function addView(_0x38afcc){const _0x4d8617={_0x1ee74a:0xfd1},_0x208055=_0x3d5d32,_0x45c256=image||customImage;if(!_0x45c256||!_0x38afcc||!_0x38afcc['primitives'])return;const _0x5b0fea=_0x45c256['rectangle']||[0xa,0x5,0x58,0x14],_0x53e6f3=new Cesium__namespace[(_0x208055(0x9c0))]();return _0x53e6f3['rectangle']=new Cesium__namespace['BoundingRectangle'](_0x5b0fea[0x0],_0x5b0fea[0x1],_0x5b0fea[0x2],_0x5b0fea[0x3]),_0x53e6f3[_0x208055(0xd8f)]=new Cesium__namespace['Material']({'fabric':{'type':'Image','uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x1,0x1),'image':_0x45c256['url']}}}),_0x53e6f3[_0x208055(_0x4d8617._0x1ee74a)]=!![],_0x38afcc[_0x208055(0x730)][_0x208055(0xff3)](_0x53e6f3),_0x53e6f3;}function add(_0x4a2bbd,_0x17885d){const _0x592b97={_0x4c92c8:0x380},_0x217e38=_0x3d5d32;if(!_0x4a2bbd||!_0x4a2bbd[_0x217e38(0x730)])return;{addView(_0x4a2bbd),setInterval(function(){try{!checkHasImage(_0x4a2bbd)&&addView(_0x4a2bbd);}catch{}},0x927c0+Math[_0x217e38(_0x592b97._0x4c92c8)]()*0x927c0);}}function checkHasImage(_0x1f5f9c){const _0x3d0737={_0x1954f1:0x730},_0x1b8e78=_0x3d5d32;if(!(_0x1f5f9c!==null&&_0x1f5f9c!==void 0x0&&_0x1f5f9c[_0x1b8e78(0x730)])||_0x1f5f9c['primitives']['length']===0x0)return![];for(let _0x2cc9f9=0x0,_0xc3dd16=_0x1f5f9c['primitives']['length'];_0x2cc9f9<_0xc3dd16;++_0x2cc9f9){const _0x3ad92d=_0x1f5f9c[_0x1b8e78(_0x3d0737._0x1954f1)]['get'](_0x2cc9f9);if(_0x3ad92d['_muyao'])return!![];}return![];}function isNumber(_0x37f4bf){const _0x357853={_0x58272a:0xca5},_0x4eaa19=_0x3d5d32;return typeof _0x37f4bf===_0x4eaa19(_0x357853._0x58272a)&&_0x37f4bf['constructor']===Number;}function isString(_0xdc888c){return typeof _0xdc888c==='string'&&_0xdc888c['constructor']===String;}function isBoolean(_0x35b399){const _0x13ec05=_0x3d5d32;return typeof _0x35b399===_0x13ec05(0xd5f)&&_0x35b399['constructor']===Boolean;}function isObject(_0x4dbefc){const _0x3d0b12={_0x247cd5:0x4c9},_0x45e6ad=_0x3d5d32;return Object['prototype'][_0x45e6ad(_0x3d0b12._0x247cd5)]['call'](_0x4dbefc)===_0x45e6ad(0x72f);}const hasOwn={}['hasOwnProperty'];function isPlainObject(_0xb5a726){const _0x4a5afa={_0x2dfe18:0x8b4},_0xa454f2=_0x3d5d32;if(!isObject(_0xb5a726))return![];return _0xb5a726['constructor']&&!hasOwn['call'](_0xb5a726,_0xa454f2(_0x4a5afa._0x2dfe18))&&!hasOwn['call'](_0xb5a726['constructor']['prototype'],'isPrototypeOf')?![]:!![];}function isFunction(_0x4777bc){const _0x241922={_0x3b1cd9:0x3cc},_0xe31204=_0x3d5d32;return _0x4777bc&&typeof _0x4777bc===_0xe31204(_0x241922._0x3b1cd9);}function isSimpleType(_0x1207b7){if(_0x1207b7==null||_0x1207b7===undefined)return![];return isString(_0x1207b7)||isBoolean(_0x1207b7)||isNumber(_0x1207b7)||Array['isArray'](_0x1207b7)?!![]:![];}const isMars3DCesium=Boolean(Cesium__namespace['ExpandByMars']||Cesium__namespace['Mars3DEx']);function formatNum$1(_0x55c85c,_0x33eb33=0x0){const _0x1198c7=Math['pow'](0xa,_0x33eb33);return Math['round'](_0x55c85c*_0x1198c7)/_0x1198c7;}function padLeft0(_0x37e98c,_0x1e56c8){_0x37e98c=String(_0x37e98c);let _0x3295f3=_0x37e98c['length'];while(_0x3295f3<_0x1e56c8){_0x37e98c='0'+_0x37e98c,_0x3295f3++;}return _0x37e98c;}function splitWords(_0x129ce6){return trim(_0x129ce6)['split'](/\s+/);}function trim(_0x2c57a7){const _0x547092={_0x450ff8:0xbb6},_0x45e8de=_0x3d5d32;if(!_0x2c57a7)return;return _0x2c57a7['trim']?_0x2c57a7['trim']():_0x2c57a7[_0x45e8de(_0x547092._0x450ff8)](/^\s+|\s+$/g,'');}function getStrLength(_0x42329e){if(!_0x42329e)return;return _0x42329e['replace'](/[\u0391-\uFFE5]/g,'00')['length'];}const templateRe=/\{ *([a-zA-Z0-9_\u4e00-\u9fa5]+) *\}/g;function template(_0x5adadd,_0x18a39c,_0x1516ce){const _0x32d6e4={_0x2ce5f4:0xb84,_0x15c02c:0xfbe};if(_0x5adadd==null||!_0x18a39c||!templateRe['test'](_0x5adadd))return _0x5adadd;return _0x5adadd['replace'](templateRe,function(_0x54a28d,_0x3977a5,_0x33b24b,_0x52e898){const _0x1c2f7d=_0x4132;let _0x4d7caa=_0x18a39c[_0x3977a5];if(!Cesium__namespace['defined'](_0x4d7caa)){if(!_0x1516ce)return _0x54a28d;if(isString(_0x1516ce))return _0x1516ce;return'';}if(isFunction(_0x4d7caa)){_0x4d7caa=_0x4d7caa(_0x18a39c);if(!Cesium__namespace[_0x1c2f7d(_0x32d6e4._0x2ce5f4)](_0x4d7caa)){if(!_0x1516ce)return _0x54a28d;if(isString(_0x1516ce))return _0x1516ce;return'';}}else{if(_0x4d7caa[_0x1c2f7d(0xfbe)]&&isFunction(_0x4d7caa[_0x1c2f7d(_0x32d6e4._0x15c02c)])){_0x4d7caa=_0x4d7caa['getValue'](Cesium__namespace['JulianDate']['now']());if(!Cesium__namespace['defined'](_0x4d7caa)){if(!_0x1516ce)return _0x54a28d;if(isString(_0x1516ce))return _0x1516ce;return'';}}}return _0x4d7caa;});}let lastId=0x0;function getGlobalId(){return++lastId;}function stampGlobalId(_0x5bfec5){const _0x5e547d={_0x5a9997:0xe53},_0x351794=_0x3d5d32;if(_0x5bfec5&&isObject(_0x5bfec5))return _0x5bfec5['_mars3d_id']=_0x5bfec5['_mars3d_id']||++lastId,_0x5bfec5[_0x351794(_0x5e547d._0x5a9997)];return-0x1;}function createGuid(_0x204f2a='m-'){return _0x204f2a+Cesium__namespace['createGuid']();}let callbackIndex=0x0;function getTemplateHtml(_0x1b3564){const _0x3e6bfb={_0x4aaf01:0xe77,_0x914dd:0xfaf,_0x5d9be3:0x7f5,_0x309f04:0xc0d,_0x78c9ca:0x107c,_0x3b19dd:0xe6d,_0x5104aa:0xa86,_0x280a7d:0x7f5,_0x39a8d9:0x8f9,_0x403fc5:0x503,_0xac1534:0xd58,_0x54a569:0xb78,_0x12bcaa:0xd9a},_0x1607bf=_0x3d5d32;let _0x424573=_0x1b3564['attr'];if(!_0x424573)return![];const _0x512115=_0x1b3564['title'],_0x1e316b=_0x1b3564[_0x1607bf(0x2fa)],_0x5b1242=_0x1b3564['template'];_0x424573=getAttrVal(_0x424573);if(!_0x5b1242||_0x5b1242===_0x1607bf(_0x3e6bfb._0x4aaf01)){let _0x3dea22=0x0,_0x5e5074=_0x512115?''+_0x512115+'':'';_0x5e5074+='';for(const _0x1086d9 in _0x424573){try{let _0x5edd69=_0x424573[_0x1086d9];if(_0x1086d9==null||_0x5edd69==null)continue;if(_0x1086d9==='Shape'||_0x1086d9==='FID'||_0x1086d9==='OBJECTID'||_0x1086d9==='_definitionChanged'||_0x1086d9==='_propertyNames')continue;if(isFunction(_0x5edd69))continue;isObject(_0x5edd69)&&(_0x5edd69=JSON['stringify'](getAttrVal(_0x5edd69,{'onlySimpleType':!![]})));_0x5edd69=String['prototype']['trim']['call'](_0x5edd69||'');if(_0x5edd69===''||_0x5edd69==='Null'||_0x5edd69==='Unknown')continue;_0x5e5074+='
'+_0x5edd69+'
',_0x3dea22++;}catch(_0x1d904f){logError$1('getTemplateHtml:构造all时异常',_0x1d904f);}}_0x5e5074+='';if(_0x3dea22===0x0)return![];return _0x5e5074;}else{if(Array['isArray'](_0x5b1242)){let _0x987a56=0x0,_0x5cbe6a=_0x512115?''+_0x512115+_0x1607bf(_0x3e6bfb._0x914dd):'';_0x5cbe6a+='';for(let _0x23301c=0x0;_0x23301c<_0x5b1242['length'];_0x23301c++){const _0xbbc56c=_0x5b1242[_0x23301c];if(_0xbbc56c==null)continue;const _0xb166b5=_0xbbc56c['field'],_0x238cf5=_0xbbc56c['className']||'';if(_0xbbc56c[_0x1607bf(_0x3e6bfb._0x5d9be3)]==='details'||_0xbbc56c['type']==='button'){let _0x2c078f='';const _0x5ae383=_0xbbc56c['callback'];if(_0x5ae383){const _0x1451f0='_cache_getTemplateHtml_'+callbackIndex++;if(isFunction(_0x5ae383))window[_0x1451f0]=function(){_0x5ae383(_0x424573);};else isString(_0x5ae383)&&(window[_0x1451f0]=function(){eval(_0x5ae383+'('+JSON['stringify'](_0x424573)+')');});_0x2c078f='onclick=\x22'+_0x1451f0+'();\x22\x20\x20';}_0x5cbe6a+='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2a0550+'',_0x987a56++;continue;}}let _0x2d28c5=_0x424573[_0xb166b5];if(!_0x1e316b){if(_0xb166b5==null||_0x2d28c5==null)continue;if(isFunction(_0x2d28c5))continue;}_0x2d28c5=String['prototype']['trim'][_0x1607bf(_0x3e6bfb._0x5104aa)](_0x2d28c5||'');if(!_0x1e316b&&(_0xbbc56c['hideNull']??!![])){if(_0x2d28c5==null||_0x2d28c5===''||_0x2d28c5==='Null'||_0x2d28c5==='Unknown'||_0x2d28c5['length']===0x0)continue;}if(_0xbbc56c['format'])try{isFunction(_0xbbc56c[_0x1607bf(0x1d7)])?_0x2d28c5=_0xbbc56c['format'](_0x2d28c5):_0x2d28c5=eval(_0xbbc56c['format']+'('+_0x2d28c5+')');}catch(_0x4e834e){logWarn('getTemplateHtml:格式化出错',_0xbbc56c);}if(_0x1e316b)switch(_0xbbc56c[_0x1607bf(_0x3e6bfb._0x280a7d)]){case _0x1607bf(0x656):_0x2d28c5='';break;}_0xbbc56c[_0x1607bf(0xef9)]&&(_0x2d28c5+=_0xbbc56c['unit']),_0x5cbe6a+='
'+_0x2d28c5+'
',_0x987a56++;}_0x5cbe6a+=_0x1607bf(0xfaf);if(_0x987a56===0x0)return![];return _0x5cbe6a;}else{if(isObject(_0x5b1242))switch(_0x5b1242['type']){case'iframe':{const _0x39f0d8=template(_0x5b1242['url'],_0x424573,!![]),_0x49dd52=_0x1607bf(_0x3e6bfb._0xac1534)+_0x39f0d8+_0x1607bf(_0x3e6bfb._0x54a569)+(_0x5b1242['width']||'300')+_0x1607bf(_0x3e6bfb._0x12bcaa)+(_0x5b1242['height']||_0x1607bf(0x1063))+'px;overflow:hidden;margin:0;\x22\x20scrolling=\x22no\x22\x20frameborder=\x220\x22\x20>';return _0x49dd52;}case'javascript':{const _0x34e24e=_0x5b1242['callback'];return eval(_0x34e24e+'('+JSON['stringify'](_0x424573)+')');}}else{if(isString(_0x5b1242))return template(_0x5b1242,_0x424573,!![]);else{if(isFunction(_0x5b1242))return _0x5b1242(_0x5b1242,_0x424573);}}}}return![];}function getCesiumValue(_0x144de5,_0x10f30d,_0x23d75b){if(!_0x144de5)return _0x144de5;if(_0x10f30d){if(_0x144de5 instanceof _0x10f30d)return _0x144de5;else{if(_0x144de5['_value']&&_0x144de5['_value']instanceof _0x10f30d)return _0x144de5['_value'];}}if(isFunction(_0x144de5['getValue']))return _0x144de5['getValue'](_0x23d75b||Cesium__namespace['JulianDate']['now']());return _0x144de5;}function getCesiumColor(_0x23d4e5,_0x2f84b4,_0x2e6556){const _0x15ed20={_0x9a9e77:0x8b7},_0x5564fa=_0x3d5d32;if(_0x23d4e5){isFunction(_0x23d4e5['getValue'])&&(_0x23d4e5=_0x23d4e5['getValue'](_0x2e6556||Cesium__namespace[_0x5564fa(_0x15ed20._0x9a9e77)]['now']()));if(isString(_0x23d4e5))return Cesium__namespace['Color']['fromCssColorString'](_0x23d4e5);else return isFunction(_0x23d4e5)?getCesiumColor(_0x23d4e5(_0x2e6556),_0x2f84b4):_0x23d4e5;}else return _0x2f84b4;}function getColorByStyle(_0x16e5c7,_0x54c5d0=Cesium__namespace[_0x3d5d32(0x882)]['YELLOW']){const _0xf008b8={_0x5b5936:0xfdc,_0x315cff:0xb84},_0x329e3f=_0x3d5d32;let _0x1d7db1;if(_0x16e5c7['color']){if(isString(_0x16e5c7['color']))_0x1d7db1=Cesium__namespace['Color'][_0x329e3f(0xf15)](_0x16e5c7['color']);else isFunction(_0x16e5c7['color'])?_0x1d7db1=_0x16e5c7[_0x329e3f(0xe8f)](_0x16e5c7):_0x1d7db1=_0x16e5c7['color'];}else _0x16e5c7['randomColor']?_0x1d7db1=Cesium__namespace[_0x329e3f(0x882)]['fromRandom']({'minimumRed':_0x16e5c7['minimumRed']??0x0,'maximumRed':_0x16e5c7[_0x329e3f(0x49f)]??0.75,'minimumGreen':_0x16e5c7['minimumGreen']??0x0,'maximumGreen':_0x16e5c7['maximumGreen']??0.75,'minimumBlue':_0x16e5c7['minimumBlue']??0x0,'maximumBlue':_0x16e5c7['maximumBlue']??0.75}):_0x1d7db1=_0x54c5d0;if(!_0x1d7db1)return _0x1d7db1;if(Cesium__namespace['defined'](_0x16e5c7['opacity'])){if(_0x16e5c7['opacity']<0x0)_0x16e5c7['opacity']=0x0;else _0x16e5c7[_0x329e3f(_0xf008b8._0x5b5936)]>0x1&&(_0x16e5c7[_0x329e3f(0xfdc)]=0x1);_0x1d7db1=_0x1d7db1['withAlpha'](Number(_0x16e5c7['opacity']));}return Cesium__namespace[_0x329e3f(_0xf008b8._0x315cff)](_0x16e5c7['globalAlpha'])&&_0x16e5c7['globalAlpha']!==0x1&&(_0x1d7db1=_0x1d7db1['withAlpha'](_0x1d7db1['alpha']*_0x16e5c7['globalAlpha'])),_0x1d7db1;}function getAttrVal(_0x4937e3,_0x2764de={}){if(!_0x4937e3)return _0x4937e3;try{isFunction(_0x4937e3['getValue'])&&(_0x4937e3=_0x4937e3['getValue'](Cesium__namespace['JulianDate']['now']()));const _0x1ba0b8={};if(_0x4937e3['_propertyNames']&&_0x4937e3['_propertyNames']['length']>0x0)for(const _0x26473d of _0x4937e3['_propertyNames']){const _0x964c2b=getOneAttrValue(_0x26473d,_0x4937e3[_0x26473d],_0x2764de);if(_0x964c2b==null)continue;_0x1ba0b8[_0x26473d]=_0x964c2b;}else for(const _0x7b1993 in _0x4937e3){const _0x5096c7=getOneAttrValue(_0x7b1993,_0x4937e3[_0x7b1993],_0x2764de);if(_0x5096c7==null)continue;_0x1ba0b8[_0x7b1993]=_0x5096c7;}return _0x1ba0b8;}catch(_0x107eae){logError$1('getAttrVal:出错了',_0x107eae);}return _0x4937e3;}function get3DTileFeatureAttr(_0x1306e4){const _0x5d6438={_0x43e83e:0x1042},_0x4b6348=_0x3d5d32,_0x1af094={},_0x400711=_0x1306e4[_0x4b6348(0x1042)]?_0x1306e4[_0x4b6348(_0x5d6438._0x43e83e)]():_0x1306e4['getPropertyNames']();for(let _0x43f8e5=0x0;_0x43f8e5<_0x400711['length'];_0x43f8e5++){const _0x527ef9=_0x400711[_0x43f8e5];if(!_0x1306e4['hasProperty'](_0x527ef9))continue;const _0x2009a3=_0x1306e4['getProperty'](_0x527ef9);if(_0x2009a3==null)continue;_0x1af094[_0x527ef9]=_0x2009a3;}return _0x1af094;}function getOneAttrValue(_0x5e0f6e,_0x29c633,_0x3597b0){const _0x48b0df={_0x51febf:0xec0,_0x2650c4:0xa29,_0x37ea50:0x882},_0x1e3d5b=_0x3d5d32;if(_0x29c633==null||_0x29c633===''||_0x29c633==='Null'||_0x29c633===_0x1e3d5b(_0x48b0df._0x51febf))return null;_0x29c633['getValue']&&typeof _0x29c633[_0x1e3d5b(0xfbe)]===_0x1e3d5b(0x3cc)&&_0x5e0f6e!=='material'&&(_0x29c633=_0x29c633['getValue'](Cesium__namespace['JulianDate'][_0x1e3d5b(0x419)]()));if(isFunction(_0x29c633))return null;if(_0x3597b0[_0x1e3d5b(_0x48b0df._0x2650c4)]){if(_0x29c633 instanceof Cesium__namespace[_0x1e3d5b(_0x48b0df._0x37ea50)])return _0x29c633['toCssColorString']();if(_0x3597b0['noArray']&&Array['isArray'](_0x29c633))return null;if(isPlainObject(_0x29c633))return _0x29c633;if(!isSimpleType(_0x29c633))return null;}return _0x29c633;}function merge(_0x1ed373={},..._0x14d73d){const _0x34d836=_0x3d5d32;let _0x5de264,_0x5764ce,_0x336702,_0x16beeb;for(_0x5764ce=0x0,_0x336702=_0x14d73d[_0x34d836(0xc84)];_0x5764ce<_0x336702;_0x5764ce++){_0x16beeb=_0x14d73d[_0x5764ce];for(_0x5de264 in _0x16beeb){hasMergeObject(_0x1ed373[_0x5de264],_0x16beeb[_0x5de264])?_0x1ed373[_0x5de264]=merge(_0x1ed373[_0x5de264],_0x16beeb[_0x5de264]):_0x1ed373[_0x5de264]=_0x16beeb[_0x5de264];}}return _0x1ed373;}function hasMergeObject(_0x2778f9,_0x1757b){const _0x2acea3={_0x2c199c:0xb84,_0x3c65c2:0xb84},_0x29dc8d=_0x3d5d32;if(!Cesium__namespace[_0x29dc8d(_0x2acea3._0x2c199c)](_0x2778f9)||!Cesium__namespace[_0x29dc8d(_0x2acea3._0x3c65c2)](_0x1757b))return![];if(Array['isArray'](_0x2778f9)||Array['isArray'](_0x1757b))return![];if(isPlainObject(_0x2778f9)&&isPlainObject(_0x1757b))return!![];return![];}function clone(_0x309e03,_0x3de48d=[],_0x1eb5f6=0x5){const _0x418be3={_0x27c229:0xfbc,_0x3b3515:0x8fe,_0x4cbb91:0x7a5},_0x25ec63=_0x3d5d32;if(_0x309e03==null||typeof _0x309e03!==_0x25ec63(0x8fe))return _0x309e03;if(_0x309e03 instanceof Date){const _0xb79c59=new Date();return _0xb79c59[_0x25ec63(_0x418be3._0x27c229)](_0x309e03['getTime']()),_0xb79c59;}if(Array['isArray'](_0x309e03)&&_0x1eb5f6>=0x0){const _0x13deba=[];for(let _0xe7da21=0x0,_0x323145=_0x309e03['length'];_0xe7da21<_0x323145;++_0xe7da21){_0x13deba[_0xe7da21]=clone(_0x309e03[_0xe7da21],_0x3de48d,_0x1eb5f6-0x1);}return _0x13deba;}if(typeof _0x309e03===_0x25ec63(_0x418be3._0x3b3515)&&_0x1eb5f6>=0x0)try{if(_0x309e03['clone'])return _0x309e03['clone']();if(!isPlainObject(_0x309e03))return _0x309e03;const _0x3e221f={};for(const _0x12337b in _0x309e03){if(isFunction(_0x12337b))continue;if(_0x3de48d['indexOf'](_0x12337b)!==-0x1)continue;_0x309e03['hasOwnProperty'](_0x12337b)&&(_0x3e221f[_0x12337b]=clone(_0x309e03[_0x12337b],_0x3de48d,_0x1eb5f6-0x1));}return _0x3e221f;}catch(_0x1ba8ad){logError$1(_0x25ec63(_0x418be3._0x4cbb91),_0x1ba8ad);}return _0x309e03;}function getArrayRandomOne(_0xbd9374){const _0x24b8bb=Math['floor'](Math['random']()*_0xbd9374['length']+0x1)-0x1;return _0xbd9374[_0x24b8bb];}function removeArrayItem(_0x24aae5,_0x25059c){const _0x549418={_0x2548d2:0xc84},_0x134799=_0x3d5d32;for(let _0x2ec40d=0x0;_0x2ec40d<_0x24aae5[_0x134799(_0x549418._0x2548d2)];_0x2ec40d++){if(_0x24aae5[_0x2ec40d]===_0x25059c)return _0x24aae5['splice'](_0x2ec40d,0x1),!![];}return![];}function getSymbolStyle(_0x730c53,_0x3b9bd0){const _0x174a27={_0x5eb4c9:0xb3c,_0x263674:0x32a,_0x5a2ee4:0x463},_0x59e2d2=_0x3d5d32;if(!_0x730c53)return{};let _0x11411f=_0x730c53[_0x59e2d2(_0x174a27._0x5eb4c9)]?clone(_0x730c53['styleOptions']):{};if(_0x730c53['styleField']&&_0x730c53['styleFieldOptions']&&_0x3b9bd0){const _0x1aed75=_0x3b9bd0[_0x730c53['styleField']],_0x2081e5=_0x730c53['styleFieldOptions'][_0x1aed75];_0x2081e5!=null&&(_0x11411f=merge(_0x11411f,_0x2081e5));}if(_0x3b9bd0)for(const _0x42f46f in _0x11411f){_0x11411f[_0x42f46f]=template(_0x11411f[_0x42f46f],_0x3b9bd0);}_0x11411f['label']&&(_0x11411f['label']=clone(_0x11411f[_0x59e2d2(_0x174a27._0x263674)]));_0x11411f[_0x59e2d2(0x56e)]&&(_0x11411f['highlight']=clone(_0x11411f['highlight']));if(isFunction(_0x730c53[_0x59e2d2(_0x174a27._0x5a2ee4)])){const _0x1817fc=_0x730c53[_0x59e2d2(0x463)](_0x3b9bd0,_0x11411f);_0x1817fc!=null&&(_0x11411f=merge(_0x11411f,_0x1817fc));}return _0x11411f;}function geojsonToArcGIS(_0x23d567,_0x21326e){return geojsonToArcGIS$1(_0x23d567,_0x21326e);}function arcgisToGeoJSON(_0xe91bd5,_0x40145a){return arcgisToGeoJSON$1(_0xe91bd5,_0x40145a);}function getGeoJsonFeatures(_0x21f0d4){const _0x474778={_0x5ec258:0x54b,_0x2576dd:0x7f5,_0x23efb6:0x4d7,_0x4b7dd3:0x7ab},_0x48ff03=_0x3d5d32;if(_0x21f0d4['geometryType']&&_0x21f0d4['geometryType'][_0x48ff03(_0x474778._0x5ec258)]('esri')!==-0x1)_0x21f0d4=arcgisToGeoJSON(_0x21f0d4);else{if(_0x21f0d4[_0x48ff03(_0x474778._0x2576dd)]===_0x48ff03(0xf4f)){let _0x47d01e=[];for(const _0x7ea23f in _0x21f0d4[_0x48ff03(_0x474778._0x23efb6)]){if(_0x21f0d4[_0x48ff03(_0x474778._0x23efb6)]['hasOwnProperty'](_0x7ea23f)){_0x21f0d4=Cesium__namespace['topojson']['feature'](_0x21f0d4,_0x21f0d4['objects'][_0x7ea23f]);const _0x5bf68f=getGeoJsonFeatures(_0x21f0d4);_0x47d01e=_0x47d01e['concat'](_0x5bf68f);}}return _0x47d01e;}}let _0x49b5e4;if(Array['isArray'](_0x21f0d4['features']))_0x49b5e4=_0x21f0d4[_0x48ff03(_0x474778._0x4b7dd3)];else Array[_0x48ff03(0x62b)](_0x21f0d4)?_0x49b5e4=_0x21f0d4:_0x49b5e4=[_0x21f0d4];return _0x49b5e4;}function geoJsonToGraphics(_0x36a3a6,_0x5cf06a={}){const _0x56bfbf={_0x535862:0x980,_0x21ef70:0x271,_0x5d26c4:0xc84},_0x406ff8=_0x3d5d32;var _0x1c9757,_0x4788de;if(!_0x36a3a6)return[];const _0xf9dfea=getGeoJsonFeatures(_0x36a3a6);if(_0x36a3a6!==null&&_0x36a3a6!==void 0x0&&(_0x1c9757=_0x36a3a6['crs'])!==null&&_0x1c9757!==void 0x0&&(_0x4788de=_0x1c9757['properties'])!==null&&_0x4788de!==void 0x0&&_0x4788de['name']&&!_0x5cf06a[_0x406ff8(_0x56bfbf._0x535862)]){const _0x3e7cd6=_0x36a3a6[_0x406ff8(0x980)][_0x406ff8(_0x56bfbf._0x21ef70)][_0x406ff8(0xaed)];_0x3e7cd6['indexOf']('EPSG:')!==-0x1&&(_0x5cf06a['crs']=_0x3e7cd6);}let _0x4c637f=[];for(let _0x36dfe7=0x0,_0x1f052b=_0xf9dfea[_0x406ff8(_0x56bfbf._0x5d26c4)];_0x36dfe7<_0x1f052b;_0x36dfe7++){const _0x18bec0=_0xf9dfea[_0x36dfe7],_0x4e68ae=featureToGraphic(_0x18bec0,_0x5cf06a);_0x4e68ae&&_0x4e68ae[_0x406ff8(0xc84)]>0x0&&(_0x4c637f=_0x4c637f['concat'](_0x4e68ae));}return _0x4c637f;}function featureToGraphic(_0x57df58,_0x45611f={}){const _0x163b3e={_0x46c78e:0x5a7,_0x251fee:0x2ae,_0x2a46c7:0x7f5,_0x1a3644:0xe12,_0x3a6ba9:0x265,_0x1da689:0x96f,_0x19e1ab:0xb84,_0x5ce036:0xa54,_0x591ca6:0x301,_0x2a540b:0xb84,_0x178175:0xdde,_0x4ca673:0x63d,_0x1c650e:0x63d,_0x1463c5:0xc84,_0x55f378:0xbc3,_0x1cb5d8:0x980,_0xfdc4ae:0xa35,_0x17944b:0x88e,_0x38068a:0x96f,_0x2edfea:0xc84,_0x2e6491:0xc84,_0x451293:0xc84,_0x48746f:0x104e,_0x3c0a29:0x32a},_0x55916d={_0x1683ef:0xc84,_0x447612:0xb75},_0x35b7d0={_0x2a3c24:0xf8a},_0x2ba8cf=_0x3d5d32;var _0x20c318,_0x20ad97,_0x4e75dd;let _0x58306c=[];_0x57df58['type']===_0x2ba8cf(0x7d6)&&(_0x57df58={'geometry':_0x57df58});const _0x1beba2=_0x57df58[_0x2ba8cf(_0x163b3e._0x46c78e)],_0x2e4613=_0x1beba2===null||_0x1beba2===void 0x0?void 0x0:_0x1beba2[_0x2ba8cf(_0x163b3e._0x251fee)];if(!_0x2e4613&&!_0x1beba2)return _0x58306c;let _0x49be78;if(_0x45611f['type'])_0x49be78=_0x45611f['type'];else hasType((_0x20c318=_0x57df58)===null||_0x20c318===void 0x0?void 0x0:(_0x20ad97=_0x20c318['properties'])===null||_0x20ad97===void 0x0?void 0x0:_0x20ad97[_0x2ba8cf(0x7f5)])&&(_0x49be78=_0x57df58['properties']['type']);let _0x1f4f8c=clone((_0x4e75dd=_0x57df58)===null||_0x4e75dd===void 0x0?void 0x0:_0x4e75dd['properties'],['style'])||{};_0x1f4f8c&&_0x1f4f8c[_0x2ba8cf(_0x163b3e._0x2a46c7)]&&_0x1f4f8c[_0x2ba8cf(_0x163b3e._0x1a3644)]&&(_0x1f4f8c=_0x1f4f8c[_0x2ba8cf(0xe12)]);let _0x6d062a={};if(_0x57df58['properties']){_0x57df58['properties']['style']&&(_0x6d062a={..._0x57df58['properties']['style']});const _0x4de25d=_0x1f4f8c['marker-symbol'];if(Cesium__namespace['defined'](_0x4de25d)){_0x6d062a['image']=_0x4de25d;const _0x3057f1=_0x1f4f8c['marker-color'];Cesium__namespace[_0x2ba8cf(0xb84)](_0x3057f1)&&(_0x6d062a[_0x2ba8cf(0xe7a)]=!![],_0x6d062a[_0x2ba8cf(0x62a)]=_0x3057f1);}const _0x547cca=_0x1f4f8c[_0x2ba8cf(_0x163b3e._0x3a6ba9)];if(Cesium__namespace[_0x2ba8cf(0xb84)](_0x547cca)&&_0x1beba2[_0x2ba8cf(0x7f5)]!==_0x2ba8cf(_0x163b3e._0x1da689)&&_0x1beba2['type']!=='MultiLineString'){_0x6d062a['color']=_0x547cca;const _0x367d7a=_0x1f4f8c['fill-opacity'];Cesium__namespace[_0x2ba8cf(_0x163b3e._0x19e1ab)](_0x367d7a)&&_0x367d7a!==0x1&&(_0x6d062a['opacity']=_0x367d7a);const _0x4b21d0=_0x1f4f8c['stroke'];if(Cesium__namespace[_0x2ba8cf(0xb84)](_0x4b21d0)){_0x6d062a['outline']=!![],_0x6d062a[_0x2ba8cf(0x62a)]=_0x4b21d0;const _0x10a999=_0x1f4f8c['stroke-width'];Cesium__namespace['defined'](_0x10a999)&&(_0x6d062a[_0x2ba8cf(_0x163b3e._0x5ce036)]=_0x10a999);const _0x119afb=_0x1f4f8c[_0x2ba8cf(0x7cf)];Cesium__namespace['defined'](_0x119afb)&&_0x119afb!==0x1&&(_0x6d062a[_0x2ba8cf(_0x163b3e._0x591ca6)]=_0x119afb);}}else{const _0x4d022c=_0x1f4f8c['stroke'];if(Cesium__namespace['defined'](_0x4d022c)){_0x6d062a['color']=_0x4d022c;const _0x288470=_0x1f4f8c['stroke-width'];Cesium__namespace[_0x2ba8cf(_0x163b3e._0x2a540b)](_0x288470)&&(_0x6d062a['width']=_0x288470);const _0x28b291=_0x1f4f8c['stroke-opacity'];Cesium__namespace['defined'](_0x28b291)&&_0x28b291!==0x1&&(_0x6d062a[_0x2ba8cf(0xfdc)]=_0x28b291);}}}_0x45611f['style']&&(_0x45611f['style'][_0x2ba8cf(0xbc3)]?_0x6d062a={..._0x6d062a,..._0x45611f['style']}:_0x6d062a={..._0x45611f[_0x2ba8cf(_0x163b3e._0x178175)]});if(_0x45611f[_0x2ba8cf(_0x163b3e._0x4ca673)]){if(isFunction(_0x45611f['symbol']))_0x6d062a=_0x45611f['symbol'](_0x1f4f8c,_0x6d062a,_0x57df58)||_0x6d062a,_0x6d062a[_0x2ba8cf(0x7f5)]&&(_0x49be78=_0x6d062a['type']);else{_0x49be78=_0x45611f[_0x2ba8cf(_0x163b3e._0x1c650e)][_0x2ba8cf(_0x163b3e._0x2a46c7)]||_0x49be78;const _0x1ae34e=getSymbolStyle(_0x45611f['symbol'],_0x57df58['properties']||{});_0x1ae34e&&Object['keys'](_0x1ae34e)[_0x2ba8cf(_0x163b3e._0x1463c5)]!==0x0&&(_0x45611f['symbol'][_0x2ba8cf(_0x163b3e._0x55f378)]?_0x6d062a={..._0x1ae34e,..._0x6d062a}:_0x6d062a=_0x1ae34e);}}let _0x292e68=_0x45611f[_0x2ba8cf(_0x163b3e._0x1cb5d8)];_0x292e68==='EPSG:4326'&&(_0x292e68=null);function _0x17bb7c(_0x30895c){const _0x2d6933=_0x2ba8cf;return _0x292e68&&(_0x30895c=proj4Trans(_0x30895c,_0x292e68)),_0x45611f[_0x2d6933(_0x35b7d0._0x2a3c24)]?_0x45611f['onPointTrans'](_0x30895c):_0x30895c;}function _0x498073(_0x24533a){const _0x1fa9d1=_0x2ba8cf;if(!_0x45611f['onPointTrans']&&!_0x292e68)return _0x24533a;const _0x3af6a5=[];for(let _0x371701=0x0,_0x202076=_0x24533a['length'];_0x371701<_0x202076;_0x371701++){const _0x326150=_0x24533a[_0x371701];if(Array['isArray'](_0x326150[0x0])){const _0x365edb=_0x498073(_0x326150);_0x365edb&&_0x365edb[_0x1fa9d1(_0x55916d._0x1683ef)]>0x0&&_0x3af6a5[_0x1fa9d1(_0x55916d._0x447612)](_0x365edb);}else{const _0x5bbb4d=_0x17bb7c(_0x326150);_0x5bbb4d&&_0x3af6a5['push'](_0x5bbb4d);}}return _0x3af6a5;}function _0x206099(_0x1399fc,_0x4cb0d1){eachGraphicType(function(_0x2a7eb4){isObject(_0x4cb0d1[_0x2a7eb4])&&(_0x1399fc[_0x2a7eb4]=_0x4cb0d1[_0x2a7eb4],delete _0x4cb0d1[_0x2a7eb4]);});}let _0x4ea12c,_0x145860;switch(_0x1beba2[_0x2ba8cf(_0x163b3e._0x2a46c7)]){case _0x2ba8cf(0xb39):{(!_0x49be78||!isPointType(_0x49be78))&&(_0x49be78=_0x6d062a['image']?'billboardP':'pointP');const _0x26e7e0={'type':_0x49be78,'position':_0x17bb7c(_0x2e4613),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x26e7e0,_0x1f4f8c),_0x58306c[_0x2ba8cf(0xb75)](_0x26e7e0);break;}case'MultiPoint':{(!_0x49be78||!isPointType(_0x49be78))&&(_0x49be78=_0x6d062a['image']?_0x2ba8cf(_0x163b3e._0xfdc4ae):_0x2ba8cf(_0x163b3e._0x17944b));for(_0x4ea12c=0x0,_0x145860=_0x2e4613['length'];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x39e575={'type':_0x49be78,'position':_0x17bb7c(_0x2e4613[_0x4ea12c]),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x39e575,_0x1f4f8c),_0x58306c['push'](_0x39e575);}break;}case _0x2ba8cf(_0x163b3e._0x38068a):{!_0x49be78&&(_0x49be78='polylineP');const _0x513b54={'type':_0x49be78,'positions':_0x498073(_0x2e4613),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x513b54,_0x1f4f8c),_0x58306c['push'](_0x513b54);break;}case'MultiLineString':{!_0x49be78&&(_0x49be78='polylineP');let _0x2f69f7;const _0x32e44e=[];for(_0x4ea12c=0x0,_0x145860=_0x2e4613['length'];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x2f41ae={'type':_0x49be78,'positions':_0x498073(_0x2e4613[_0x4ea12c]),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x2f41ae,_0x1f4f8c),_0x58306c[_0x2ba8cf(0xb75)](_0x2f41ae),_0x32e44e['push'](_0x2f41ae),(!_0x2f69f7||_0x2f69f7['positions'][_0x2ba8cf(_0x163b3e._0x2edfea)]<_0x2f41ae[_0x2ba8cf(0xbb8)][_0x2ba8cf(_0x163b3e._0x2e6491)])&&(_0x2f69f7=_0x2f41ae);}if(_0x2f69f7){_0x2f69f7['isMultiMax']=!![];if(_0x6d062a[_0x2ba8cf(0x32a)]&&!_0x6d062a['label']['showAll'])for(_0x4ea12c=0x0,_0x145860=_0x32e44e[_0x2ba8cf(_0x163b3e._0x1463c5)];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x1b7b0e=_0x32e44e[_0x4ea12c];if(_0x2f69f7===_0x1b7b0e)continue;_0x1b7b0e['style']={..._0x1b7b0e[_0x2ba8cf(_0x163b3e._0x178175)]},delete _0x1b7b0e['style']['label'];}}break;}case'Polygon':{!_0x49be78&&(_0x49be78='polygon');if(_0x49be78['startsWith']('polygon')){const _0x110d88={'type':_0x49be78,'positions':_0x498073(_0x2e4613[_0x2ba8cf(_0x163b3e._0x451293)]===0x1?_0x2e4613[0x0]:_0x2e4613),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x110d88,_0x1f4f8c),_0x58306c['push'](_0x110d88);}else for(_0x4ea12c=0x0,_0x145860=_0x2e4613[_0x2ba8cf(0xc84)];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x1e899b=_0x2e4613[_0x4ea12c],_0x380707={'type':_0x49be78,'positions':_0x498073(_0x1e899b['length']===0x1?_0x1e899b[0x0]:_0x1e899b),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x380707,_0x1f4f8c),_0x58306c['push'](_0x380707);}break;}case'MultiPolygon':{!_0x49be78&&(_0x49be78=_0x2ba8cf(_0x163b3e._0x48746f));let _0x2706e2;const _0x5b1549=[];for(_0x4ea12c=0x0,_0x145860=_0x2e4613['length'];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x14a7ba=_0x2e4613[_0x4ea12c],_0x5436d8={'type':_0x49be78,'positions':_0x498073(_0x14a7ba['length']===0x1?_0x14a7ba[0x0]:_0x14a7ba),'style':_0x6d062a,'attr':_0x1f4f8c};_0x206099(_0x5436d8,_0x1f4f8c),_0x58306c['push'](_0x5436d8),_0x5b1549['push'](_0x5436d8),(!_0x2706e2||_0x2706e2['positions']['length']<_0x5436d8['positions']['length'])&&(_0x2706e2=_0x5436d8);}if(_0x2706e2){_0x2706e2['isMultiMax']=!![];if(_0x6d062a['label']&&!_0x6d062a[_0x2ba8cf(0x32a)]['showAll'])for(_0x4ea12c=0x0,_0x145860=_0x5b1549['length'];_0x4ea12c<_0x145860;_0x4ea12c++){const _0x2dd492=_0x5b1549[_0x4ea12c];if(_0x2706e2===_0x2dd492)continue;_0x2dd492['style']={..._0x2dd492['style']},delete _0x2dd492['style'][_0x2ba8cf(_0x163b3e._0x3c0a29)];}}break;}case'GeometryCollection':{for(let _0x226fec=0x0,_0x4e0bcf=_0x1beba2[_0x2ba8cf(0x3d1)]['length'];_0x226fec<_0x4e0bcf;_0x226fec++){const _0x12202c=featureToGraphic({'type':'Feature','geometry':_0x1beba2['geometries'][_0x226fec],'properties':_0x57df58['properties']},_0x45611f);_0x12202c&&_0x12202c['length']>0x0&&(_0x58306c=_0x58306c['concat'](_0x12202c));}break;}default:logError$1('Invalid\x20GeoJSON\x20object.',_0x57df58);}return _0x58306c;}function mergeSymbolToGraphic(_0x57bebd,_0x51888f){const _0x56590c={_0x3e92c9:0xc84,_0x179a6a:0xdde},_0x5279e3=_0x3d5d32;if(_0x51888f){if(isFunction(_0x51888f))_0x57bebd['style']=_0x51888f(_0x57bebd['attr'],_0x57bebd['style'],_0x57bebd);else{_0x51888f['type']&&(_0x57bebd['type']=_0x51888f['type']);const _0x9e61a8=getSymbolStyle(_0x51888f,_0x57bebd['attr']||{});_0x9e61a8&&Object['keys'](_0x9e61a8)[_0x5279e3(_0x56590c._0x3e92c9)]!==0x0&&(_0x51888f['merge']?_0x57bebd['style']={..._0x9e61a8,..._0x57bebd['style']}:_0x57bebd[_0x5279e3(_0x56590c._0x179a6a)]=_0x9e61a8);}}return _0x57bebd;}function heightToZoom(_0x4f9df5){const _0x260847=40487.57,_0x115175=0.00007096758,_0x8c7d8f=91610.74,_0x4623a4=-40467.74;return Math['round'](_0x4623a4+(_0x260847-_0x4623a4)/(0x1+Math['pow'](_0x4f9df5/_0x8c7d8f,_0x115175)));}function getUrlResource(_0xa84371){const _0xf0c869={_0x5b33c8:0x9da,_0x153a70:0x3c6},_0x54d6be=_0x3d5d32;if(!_0xa84371['url'])return _0xa84371;let _0x3036fd;if(_0xa84371['url']instanceof Cesium__namespace['Resource']){const _0x3cf484=_0xa84371[_0x54d6be(0x5ee)];return _0xa84371['headers']&&(_0x3cf484['headers']=_0xa84371[_0x54d6be(_0xf0c869._0x5b33c8)]),_0xa84371['proxy']&&(_0x3cf484['proxy']=new Cesium__namespace['DefaultProxy'](_0xa84371['proxy'])),_0xa84371['templateValues']&&_0x3cf484[_0x54d6be(0xe86)](_0xa84371['templateValues']),_0xa84371['queryParameters']&&_0x3cf484[_0x54d6be(0xb99)](_0xa84371[_0x54d6be(0xa1a)]),_0x3cf484;}else _0xa84371['templateValues']&&(_0xa84371['url']=template(_0xa84371['url'],_0xa84371[_0x54d6be(0x3c6)])),_0x3036fd=new Cesium__namespace[(_0x54d6be(0x413))]({'url':_0xa84371['url'],'queryParameters':_0xa84371['queryParameters'],'templateValues':_0xa84371[_0x54d6be(_0xf0c869._0x153a70)],'headers':_0xa84371['headers'],'proxy':_0xa84371['proxy']?new Cesium__namespace['DefaultProxy'](_0xa84371['proxy']):null});return _0x3036fd;}function getTextImage(_0x2480fa,_0x2397ba={}){const _0x2553e8={_0x5b83a7:0xb56,_0x4bf8d8:0x83e,_0xe59404:0x62a,_0x1ee6cc:0xceb,_0x23e30f:0xd4f},_0xd39f8f=_0x3d5d32;!_0x2397ba[_0xd39f8f(_0x2553e8._0x5b83a7)]&&(_0x2397ba['backgroundColor']=Cesium__namespace['Color']['TRANSPARENT']);const _0x519db4=Cesium__namespace['writeTextToCanvas'](_0x2480fa||'',_0x2397ba);if(_0x519db4){if(_0x2397ba['outline']){const _0x4fdbbe=_0x519db4['width'],_0x2d96f6=_0x519db4[_0xd39f8f(_0x2553e8._0x4bf8d8)],_0x44db39=_0x519db4['getContext']('2d',{'willReadFrequently':!![]});if(_0x2397ba['outlineColor'])_0x44db39['strokeStyle']=_0x2397ba[_0xd39f8f(_0x2553e8._0xe59404)][_0xd39f8f(_0x2553e8._0x1ee6cc)]();else _0x2397ba['fillColor']?_0x44db39['strokeStyle']=_0x2397ba['fillColor']['toCssColorString']():_0x44db39['strokeStyle']='#ffffff';const _0x59ebf1=_0x2397ba['outlineWidth']||0x4;_0x44db39[_0xd39f8f(0xb43)]=_0x59ebf1,_0x44db39[_0xd39f8f(_0x2553e8._0x23e30f)](_0x59ebf1/0x2,_0x59ebf1/0x2,_0x4fdbbe-_0x59ebf1,_0x2d96f6-_0x59ebf1);}return _0x519db4;}else return null;}const circleImage={};function getCircleImage(_0x2eb56c,_0xcad5e={}){const _0x34764={_0x1564fb:0x3dc,_0x16d088:0x60f,_0x49e95f:0xac4,_0xa3ba93:0xef8,_0x53fc8c:0xef8,_0x26a487:0x84b,_0x6511be:0xb85,_0x1d6a48:0x899,_0x281cd5:0xec5},_0x4649d0=_0x3d5d32,_0x408400=_0xcad5e['radius']??0x1a,_0x43d42f=_0x408400+(_0xcad5e['borderWidth']??0x5);let _0x331f51,_0x18ce60;if(_0xcad5e['color'])_0x331f51=_0xcad5e['color'],_0x18ce60=_0xcad5e['borderColor']||_0x331f51;else{const _0x5e67aa=_0xcad5e['opacity']??0.6,_0x272be6=_0xcad5e['borderOpacity']??_0x5e67aa*0.8;if(_0x2eb56c<0xa)_0x331f51='rgba(110,\x20204,\x2057,\x20'+_0x5e67aa+')',_0x18ce60='rgba(181,\x20226,\x20140,\x20'+_0x272be6+')';else _0x2eb56c<0x64?(_0x331f51='rgba(240,\x20194,\x2012,\x20\x20'+_0x5e67aa+')',_0x18ce60='rgba(241,\x20211,\x2087,\x20'+_0x272be6+')'):(_0x331f51=_0x4649d0(0x410)+_0x5e67aa+')',_0x18ce60='rgba(253,\x20156,\x20115,\x20'+_0x272be6+')');}const _0x19fc9b=_0x2eb56c+'_'+_0x43d42f+'_'+_0x408400+'_'+_0x331f51;if(!circleImage[_0x19fc9b]){const _0x7ef3f2=_0x43d42f*0x2,_0x5a0199=document[_0x4649d0(_0x34764._0x1564fb)](_0x4649d0(_0x34764._0x16d088));_0x5a0199['width']=_0x7ef3f2,_0x5a0199['height']=_0x7ef3f2;const _0x9385e8=_0x5a0199['getContext']('2d',{'willReadFrequently':!![]});_0x9385e8['fillStyle']=_0x4649d0(_0x34764._0x49e95f),_0x9385e8['globalAlpha']=0x0,_0x9385e8[_0x4649d0(0x345)](0x0,0x0,_0x7ef3f2,_0x7ef3f2),_0x408400!==_0x43d42f&&(_0x9385e8['globalAlpha']=0x1,_0x9385e8[_0x4649d0(0xe31)](),_0x9385e8['arc'](_0x43d42f,_0x43d42f,_0x43d42f,0x0,Math['PI']*0x2,!![]),_0x9385e8[_0x4649d0(_0x34764._0xa3ba93)](),_0x9385e8['fillStyle']=_0x18ce60,_0x9385e8['fill']()),_0x9385e8[_0x4649d0(0xc96)]=0x1,_0x9385e8['beginPath'](),_0x9385e8[_0x4649d0(0x845)](_0x43d42f,_0x43d42f,_0x408400,0x0,Math['PI']*0x2,!![]),_0x9385e8[_0x4649d0(_0x34764._0x53fc8c)](),_0x9385e8['fillStyle']=_0x331f51,_0x9385e8['fill'](),_0x9385e8['font']=_0xcad5e['font']||_0x408400*0.9+'px\x20bold\x20normal',_0x9385e8['fillStyle']=_0xcad5e['fontColor']||_0x4649d0(_0x34764._0x26a487),_0x9385e8['textAlign']='center',_0x9385e8[_0x4649d0(_0x34764._0x6511be)]=_0x4649d0(_0x34764._0x1d6a48),_0x9385e8[_0x4649d0(_0x34764._0x281cd5)](_0x2eb56c,_0x43d42f,_0x43d42f),circleImage[_0x19fc9b]=_0x5a0199['toDataURL']('image/png');}return circleImage[_0x19fc9b];}function download(_0x6095f1,_0x50ed1e){const _0x5ed64d={_0x305bfc:0x750,_0x1f9340:0xac2},_0x43c332=_0x3d5d32,_0x14e8c1=document['createElement']('a');_0x14e8c1['download']=_0x6095f1,_0x14e8c1['href']=URL['createObjectURL'](_0x50ed1e),document[_0x43c332(_0x5ed64d._0x305bfc)]['appendChild'](_0x14e8c1),_0x14e8c1[_0x43c332(0xb59)](),document[_0x43c332(0x750)][_0x43c332(_0x5ed64d._0x1f9340)](_0x14e8c1);}function base64Img2Blob(_0x586fa3){const _0x42ba32={_0x4ae7f1:0x73f},_0xff9a34=_0x3d5d32,_0x1ca50e=_0x586fa3['split'](';base64,'),_0x25553f=_0x1ca50e[0x0]['split'](':')[0x1],_0xa4c16f=window[_0xff9a34(_0x42ba32._0x4ae7f1)](_0x1ca50e[0x1]),_0x4f6d91=_0xa4c16f['length'],_0x264bfd=new Uint8Array(_0x4f6d91);for(let _0x51d93e=0x0;_0x51d93e<_0x4f6d91;++_0x51d93e){_0x264bfd[_0x51d93e]=_0xa4c16f['charCodeAt'](_0x51d93e);}return new Blob([_0x264bfd],{'type':_0x25553f});}function downloadBase64Image(_0x1cb507,_0x3e52d8){const _0x116901={_0x12e459:0x4f0},_0x3f2d52=_0x3d5d32,_0x105db1=base64Img2Blob(_0x3e52d8);!_0x1cb507[_0x3f2d52(_0x116901._0x12e459)]('.jpg')&&!_0x1cb507['endsWith']('.png')&&(_0x1cb507=_0x1cb507+_0x3f2d52(0x1020)),download(_0x1cb507,_0x105db1);}function downloadFile(_0x431c85,_0x359628){const _0x3ef269=new Blob([_0x359628]);download(_0x431c85,_0x3ef269);}function getExplorerInfo(){const _0x397825={_0x2c2d53:0x6ce,_0x267345:0x54b,_0x4eeaf2:0xf86},_0x4bd060=_0x3d5d32;let _0x63664;const _0x3ebde7=window['navigator']['userAgent']['toLowerCase']();if(_0x3ebde7['indexOf'](_0x4bd060(_0x397825._0x2c2d53))>=0x0)return _0x63664=Number(_0x3ebde7[_0x4bd060(0xcbb)](/msie ([\d]+)/)[0x1]),{'type':'IE','version':_0x63664};else{if(_0x3ebde7['indexOf'](_0x4bd060(0x5dd))>=0x0)return _0x63664=Number(_0x3ebde7['match'](/firefox\/([\d]+)/)[0x1]),{'type':'Firefox','version':_0x63664};else{if(_0x3ebde7[_0x4bd060(0x54b)](_0x4bd060(0x1079))>=0x0)return _0x63664=Number(_0x3ebde7[_0x4bd060(0xcbb)](/chrome\/([\d]+)/)[0x1]),{'type':'Chrome','version':_0x63664};else{if(_0x3ebde7['indexOf']('opera')>=0x0)return _0x63664=Number(_0x3ebde7['match'](/opera.([\d]+)/)[0x1]),{'type':'Opera','version':_0x63664};else{if(_0x3ebde7[_0x4bd060(_0x397825._0x267345)]('Safari')>=0x0)return _0x63664=Number(_0x3ebde7['match'](/version\/([\d]+)/)[0x1]),{'type':_0x4bd060(_0x397825._0x4eeaf2),'version':_0x63664};}}}}return{'type':_0x3ebde7,'version':-0x1};}function webglreport(){const _0x3115e1={_0x44dc97:0xf58},_0x39a23d=_0x3d5d32,_0x44b0c4=getExplorerInfo();if(_0x44b0c4['type']==='IE'&&_0x44b0c4['version']<0xb)return![];try{let _0x5f0075;const _0x1db1bf=document['createElement'](_0x39a23d(0x60f)),_0x5561dd=typeof WebGL2RenderingContext!==_0x39a23d(0x23c);_0x5561dd&&(_0x5f0075=_0x1db1bf[_0x39a23d(0xf58)]('webgl2')||_0x1db1bf[_0x39a23d(_0x3115e1._0x44dc97)]('experimental-webgl2')||undefined);_0x5f0075==null&&(_0x5f0075=_0x1db1bf['getContext']('webgl')||_0x1db1bf['getContext']('experimental-webgl')||undefined);if(_0x5f0075==null)return![];}catch(_0x3a9860){return![];}return!![];}function webglerror(){const _0x57745e={_0x2e94ff:0x548,_0x3ed2bd:0xad9},_0x3683dd=_0x3d5d32;var _0x17b2bf,_0x4e84c5;(_0x17b2bf=window)!==null&&_0x17b2bf!==void 0x0&&(_0x4e84c5=_0x17b2bf[_0x3683dd(_0x57745e._0x2e94ff)])!==null&&_0x4e84c5!==void 0x0&&_0x4e84c5[_0x3683dd(0x7b0)]?window['layer']['open']({'type':0x1,'title':_0x3683dd(0x1ea),'closeBtn':0x0,'shadeClose':![],'resize':![],'area':['530px','170px'],'content':'

系统检测到您使用的浏览器不支持WebGL功能!

\x20\x20

1、请您检查浏览器版本,安装使用最新版chrome、火狐或IE11以上浏览器!

\x20

2、WebGL支持取决于GPU支持,请保证客户端电脑已安装显卡驱动程序!

'}):alert(_0x3683dd(_0x57745e._0x3ed2bd));}function getRequest(){const _0x2e5a01={_0x236dee:0x2c3,_0x2b8b6b:0xdaa},_0x3adc0a=_0x3d5d32,_0x1bd1bc=location['search'],_0x64c995={};if(_0x1bd1bc[_0x3adc0a(0x54b)]('?')!==-0x1){const _0x13eca0=_0x1bd1bc[_0x3adc0a(_0x2e5a01._0x236dee)](0x1),_0x1d37fe=_0x13eca0[_0x3adc0a(_0x2e5a01._0x2b8b6b)]('&');for(let _0x58da96=0x0;_0x58da96<_0x1d37fe['length'];_0x58da96++){_0x64c995[_0x1d37fe[_0x58da96]['split']('=')[0x0]]=decodeURI(_0x1d37fe[_0x58da96][_0x3adc0a(0xdaa)]('=')[0x1]);}}return _0x64c995;}function getRequestByName(_0x5d35e9){const _0x54c60a={_0x5bd465:0xda0},_0x474834=_0x3d5d32,_0x175406=new RegExp(_0x474834(_0x54c60a._0x5bd465)+_0x5d35e9+'=([^&]*)(&|$)','i'),_0x2961b1=window['location'][_0x474834(0x277)]['substr'](0x1)['match'](_0x175406);if(_0x2961b1!=null)return decodeURI(_0x2961b1[0x2]);return null;}let _isPCBroswer;function isPCBroswer(){const _0x3e14b2={_0x2ca394:0xb84,_0x1bf6bc:0xaf3,_0xa19ab1:0xf8b,_0x1bce1c:0x54b},_0x1338f8=_0x3d5d32;if(!Cesium__namespace[_0x1338f8(_0x3e14b2._0x2ca394)](_isPCBroswer)){const _0x451309=navigator['userAgent']['toLowerCase'](),_0x10594a=['android',_0x1338f8(_0x3e14b2._0x1bf6bc),'iphone',_0x1338f8(0x9cd),_0x1338f8(_0x3e14b2._0xa19ab1),_0x1338f8(0xabf)];_isPCBroswer=!![];for(let _0x3c58ef=0x0;_0x3c58ef<_0x10594a['length'];_0x3c58ef++){if(_0x451309[_0x1338f8(_0x3e14b2._0x1bce1c)](_0x10594a[_0x3c58ef])>0x0){_isPCBroswer=![];break;}}}return _isPCBroswer;}function alert(_0x1e146b,_0x411150){const _0x5bcaa3=_0x3d5d32;if(window['globalAlert'])window['globalAlert'](_0x1e146b,_0x411150);else{if(window['layer'])window['layer']['alert'](_0x1e146b,{'title':_0x411150||'提示','skin':'layui-layer-lan\x20layer-mars-dialog','closeBtn':0x0,'anim':0x0});else window['toastr']?window['toastr'][_0x5bcaa3(0x9a1)](_0x1e146b,_0x411150):window['alert'](_0x1e146b);}}function msg(_0x5e3b78){const _0x3c51cb=_0x3d5d32;if(window['globalMsg'])window['globalMsg'](_0x5e3b78);else{if(window[_0x3c51cb(0x38b)])window[_0x3c51cb(0x38b)][_0x3c51cb(0x9a1)](_0x5e3b78);else window['layer']?window['layer']['msg'](_0x5e3b78):window[_0x3c51cb(0xdc0)](_0x5e3b78);}}function formatDate(_0x602cfc,_0x306efb='yyyy-MM-dd\x20HH:mm:ss'){const _0x535275={_0x355fc3:0xbb6,_0x36be07:0xc84},_0x3cef7c=_0x3d5d32,_0x233891={'M+':_0x602cfc['getMonth']()+0x1,'d+':_0x602cfc['getDate'](),'h+':_0x602cfc['getHours']()%0xc===0x0?0xc:_0x602cfc['getHours']()%0xc,'H+':_0x602cfc[_0x3cef7c(0x108c)](),'m+':_0x602cfc[_0x3cef7c(0x94c)](),'s+':_0x602cfc['getSeconds'](),'q+':Math['floor']((_0x602cfc['getMonth']()+0x3)/0x3),'S':_0x602cfc['getMilliseconds']()};/(y+)/['test'](_0x306efb)&&(_0x306efb=_0x306efb[_0x3cef7c(_0x535275._0x355fc3)](RegExp['$1'],(_0x602cfc['getFullYear']()+'')['substr'](0x4-RegExp['$1'][_0x3cef7c(_0x535275._0x36be07)])));for(const _0x208798 in _0x233891){new RegExp('('+_0x208798+')')['test'](_0x306efb)&&(_0x306efb=_0x306efb['replace'](RegExp['$1'],RegExp['$1']['length']===0x1?_0x233891[_0x208798]:('00'+_0x233891[_0x208798])['substr']((''+_0x233891[_0x208798])[_0x3cef7c(_0x535275._0x36be07)])));}return _0x306efb;}function formatTime(_0x2297f1){const _0x379b90=_0x3d5d32;_0x2297f1=Number(_0x2297f1)||0x0;if(_0x2297f1<0x3c)return _0x2297f1[_0x379b90(0x719)](0x0)+'秒';else{if(_0x2297f1>=0x3c&&_0x2297f1<0xe10){const _0x2e7bbb=Math['floor'](_0x2297f1%0x3c);return Math['floor'](_0x2297f1/0x3c)+'分钟'+(_0x2e7bbb!==0x0?_0x2e7bbb+'秒':'');}else return _0x2297f1=Math['floor'](_0x2297f1/0x3c),Math['floor'](_0x2297f1/0x3c)+'小时'+Math['floor'](_0x2297f1%0x3c)+'分钟';}}function fetchJson(_0x3ddabc){const _0x156221={_0xc1fcd:0xcbf,_0x31d7b5:0xe9b,_0x10dbcf:0xa1a,_0x329981:0x413},_0x5526a3=_0x3d5d32;return _0x3ddabc=replaceOnlineUrlDomain(_0x3ddabc),_0x3ddabc[_0x5526a3(_0x156221._0xc1fcd)]==='post'?(_0x3ddabc[_0x5526a3(_0x156221._0x31d7b5)]=_0x3ddabc[_0x5526a3(_0x156221._0x10dbcf)],delete _0x3ddabc[_0x5526a3(0xa1a)],Cesium__namespace[_0x5526a3(0x413)]['post'](_0x3ddabc)):Cesium__namespace[_0x5526a3(_0x156221._0x329981)]['fetchJson'](_0x3ddabc);}function sendAjax(_0x2ed476){const _0x2fb967={_0x552a3b:0xe9b,_0x145054:0x399},_0x3ed5a0=_0x3d5d32;return _0x2ed476=replaceOnlineUrlDomain(_0x2ed476),_0x2ed476['method']==='post'&&(_0x2ed476[_0x3ed5a0(_0x2fb967._0x552a3b)]=_0x2ed476['queryParameters'],delete _0x2ed476['queryParameters']),xhrAdapter(_0x2ed476)['then'](_0x12ba98=>{const _0x3767cc=_0x12ba98===null||_0x12ba98===void 0x0?void 0x0:_0x12ba98['data'];return _0x3767cc;})[_0x3ed5a0(_0x2fb967._0x145054)](_0x18046d=>{const _0x3a67e1=_0x3ed5a0;console[_0x3a67e1(0x7b1)](_0x18046d),logError$1('axios请求出错',_0x18046d);});}function getLangText(_0x3b9080,_0x3823fe=0x0){const _0x257f8c=Lang[_0x3b9080];if(!_0x257f8c)return'';const _0x835617=_0x257f8c[_0x3823fe]||'';return _0x835617;}function setLangText(_0x365e10,_0x13aced,_0xed12ec=0x0){let _0xc36881=Lang[_0x365e10];return!_0xc36881&&(_0xc36881=Lang[_0x365e10]={}),_0xc36881[_0xed12ec]=_0x13aced,!![];}function requestFullscreen(_0x58fdea){const _0x489218={_0xa70f57:0xf79},_0x429876=_0x3d5d32;return Cesium__namespace['Fullscreen']['requestFullscreen'](_0x58fdea),Cesium__namespace['Fullscreen'][_0x429876(_0x489218._0xa70f57)];}function exitFullscreen(){const _0x58e113=_0x3d5d32;return Cesium__namespace['Fullscreen']['exitFullscreen'](),Cesium__namespace['Fullscreen'][_0x58e113(0xf79)];}function replaceOnlineUrlDomain(_0x11b790){const _0x1ba4ec={_0x113ba9:0x5ee,_0x3a86be:0x5ee},_0x3f63e5=_0x3d5d32;var _0x4cbdca,_0x2c00ce,_0x333e96;if(!_0x11b790[_0x3f63e5(0x5ee)]||!isString(_0x11b790[_0x3f63e5(_0x1ba4ec._0x113ba9)]))return _0x11b790;if((_0x4cbdca=window)!==null&&_0x4cbdca!==void 0x0&&(_0x2c00ce=_0x4cbdca[_0x3f63e5(0x99c)])!==null&&_0x2c00ce!==void 0x0&&(_0x333e96=_0x2c00ce['hostname'])!==null&&_0x333e96!==void 0x0&&_0x333e96['indexOf']&&window['location']['hostname']['indexOf']('mars3d.cn')===-0x1)return _0x11b790;if(_0x11b790[_0x3f63e5(_0x1ba4ec._0x3a86be)]['indexOf']('data.mars3d.cn')===-0x1||_0x11b790['url']['indexOf']('/tile/')!==-0x1)return _0x11b790;return _0x11b790['url']=_0x11b790['url'][_0x3f63e5(0xbb6)]('data.mars3d.cn','data1.mars3d.cn'),_0x11b790;}var Util={'__proto__':null,'isNumber':isNumber,'isString':isString,'isBoolean':isBoolean,'isObject':isObject,'isPlainObject':isPlainObject,'isFunction':isFunction,'isSimpleType':isSimpleType,'isMars3DCesium':isMars3DCesium,'formatNum':formatNum$1,'padLeft0':padLeft0,'splitWords':splitWords,'trim':trim,'getStrLength':getStrLength,'template':template,get 'lastId'(){return lastId;},'getGlobalId':getGlobalId,'stampGlobalId':stampGlobalId,'createGuid':createGuid,'getTemplateHtml':getTemplateHtml,'getCesiumValue':getCesiumValue,'getCesiumColor':getCesiumColor,'getColorByStyle':getColorByStyle,'getAttrVal':getAttrVal,'get3DTileFeatureAttr':get3DTileFeatureAttr,'merge':merge,'clone':clone,'getArrayRandomOne':getArrayRandomOne,'removeArrayItem':removeArrayItem,'getSymbolStyle':getSymbolStyle,'geojsonToArcGIS':geojsonToArcGIS,'arcgisToGeoJSON':arcgisToGeoJSON,'getGeoJsonFeatures':getGeoJsonFeatures,'geoJsonToGraphics':geoJsonToGraphics,'featureToGraphic':featureToGraphic,'mergeSymbolToGraphic':mergeSymbolToGraphic,'heightToZoom':heightToZoom,'getUrlResource':getUrlResource,'getTextImage':getTextImage,'getCircleImage':getCircleImage,'downloadBase64Image':downloadBase64Image,'downloadFile':downloadFile,'getExplorerInfo':getExplorerInfo,'webglreport':webglreport,'webglerror':webglerror,'getRequest':getRequest,'getRequestByName':getRequestByName,'isPCBroswer':isPCBroswer,'alert':alert,'msg':msg,'formatDate':formatDate,'formatTime':formatTime,'fetchJson':fetchJson,'sendAjax':sendAjax,'getLangText':getLangText,'setLangText':setLangText,'requestFullscreen':requestFullscreen,'exitFullscreen':exitFullscreen,'replaceOnlineUrlDomain':replaceOnlineUrlDomain,'setImage':setImage};Object['defineProperties'](Cesium__namespace[_0x3d5d32(0xf14)]['prototype'],{'globalAlpha':{'set':function(_0x191466){const _0x3cc26f={_0x50421d:0xb84},_0x599ecd=_0x3d5d32;this['_globalAlpha']=_0x191466;const _0x180b96=getCesiumColor(this['color'],Cesium__namespace['Color']['WHITE']);!Cesium__namespace[_0x599ecd(_0x3cc26f._0x50421d)](this['_color_alpha'])&&(this['_color_alpha']=_0x180b96['alpha']),this[_0x599ecd(0xe8f)]=_0x180b96['withAlpha'](this['_color_alpha']*_0x191466);},'get':function(){const _0x533e35=_0x3d5d32;return this[_0x533e35(0x6f9)]??0x1;}}}),Object[_0x3d5d32(0xba4)](Cesium__namespace['GridMaterialProperty'][_0x3d5d32(0xf8c)],{'globalAlpha':{'set':function(_0x21efa2){this['_globalAlpha']=_0x21efa2;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$5=Cesium__namespace[_0x3d5d32(0x82d)]['prototype'][_0x3d5d32(0xfbe)];Cesium__namespace['GridMaterialProperty']['prototype']['getValue']=function(_0x3eac91,_0xbaf92c){return _0xbaf92c=getValue_old$5['bind'](this)(_0x3eac91,_0xbaf92c),this['globalAlpha']!==0x1&&(_0xbaf92c['color']&&(_0xbaf92c['color']['alpha']*=this['globalAlpha']),_0xbaf92c['cellAlpha']&&(_0xbaf92c['cellAlpha']*=this['globalAlpha'])),_0xbaf92c;},Object['defineProperties'](Cesium__namespace['ImageMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x5a3eb6){const _0x1f2b4d={_0xbc6b53:0xe57,_0x290a83:0xd7c},_0x2b2e82=_0x3d5d32;this['_globalAlpha']=_0x5a3eb6;const _0x234661=getCesiumColor(this[_0x2b2e82(0xe8f)],Cesium__namespace['Color'][_0x2b2e82(0x7a7)]);!Cesium__namespace['defined'](this['_color_alpha'])&&(this[_0x2b2e82(0xd7c)]=_0x234661['alpha']),this['color']=_0x234661[_0x2b2e82(_0x1f2b4d._0xbc6b53)](this[_0x2b2e82(_0x1f2b4d._0x290a83)]*_0x5a3eb6);},'get':function(){return this['_globalAlpha']??0x1;}}}),Object['defineProperties'](Cesium__namespace['PolylineArrowMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x5ec08e){const _0x8e312a={_0x23af37:0x6f9},_0x27b6e9=_0x3d5d32;this[_0x27b6e9(_0x8e312a._0x23af37)]=_0x5ec08e;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$4=Cesium__namespace['PolylineArrowMaterialProperty'][_0x3d5d32(0xf8c)]['getValue'];Cesium__namespace['PolylineArrowMaterialProperty']['prototype']['getValue']=function(_0x58901a,_0x1facb3){return _0x1facb3=getValue_old$4['bind'](this)(_0x58901a,_0x1facb3),_0x1facb3['color']&&this['globalAlpha']!==0x1&&(_0x1facb3['color']['alpha']*=this['globalAlpha']),_0x1facb3;},Object['defineProperties'](Cesium__namespace['PolylineDashMaterialProperty'][_0x3d5d32(0xf8c)],{'globalAlpha':{'set':function(_0x4bbe8b){const _0x1aa992=_0x3d5d32;this[_0x1aa992(0x6f9)]=_0x4bbe8b;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$3=Cesium__namespace['PolylineDashMaterialProperty']['prototype'][_0x3d5d32(0xfbe)];Cesium__namespace[_0x3d5d32(0x39e)]['prototype']['getValue']=function(_0x40f146,_0x206cb5){const _0x15ff58={_0x13a524:0x24b,_0x4dfdf2:0x811},_0x46ad98=_0x3d5d32;return _0x206cb5=getValue_old$3[_0x46ad98(0x21e)](this)(_0x40f146,_0x206cb5),this['globalAlpha']!==0x1&&(_0x206cb5['color']&&(_0x206cb5['color'][_0x46ad98(_0x15ff58._0x13a524)]*=this[_0x46ad98(0xc96)]),_0x206cb5[_0x46ad98(_0x15ff58._0x4dfdf2)]&&(_0x206cb5['gapColor']['alpha']*=this['globalAlpha'])),_0x206cb5;},Object['defineProperties'](Cesium__namespace['PolylineGlowMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x11d9aa){this['_globalAlpha']=_0x11d9aa;},'get':function(){const _0x1895e0={_0x376112:0x6f9},_0x286ba6=_0x3d5d32;return this[_0x286ba6(_0x1895e0._0x376112)]??0x1;}}});const getValue_old$2=Cesium__namespace['PolylineGlowMaterialProperty']['prototype']['getValue'];Cesium__namespace['PolylineGlowMaterialProperty'][_0x3d5d32(0xf8c)]['getValue']=function(_0x2ccc30,_0x557d67){const _0x251976={_0x3ba5c0:0xe8f,_0x1523c4:0x24b,_0x19763f:0xc96},_0x27b73b=_0x3d5d32;return _0x557d67=getValue_old$2['bind'](this)(_0x2ccc30,_0x557d67),_0x557d67['color']&&this['globalAlpha']!==0x1&&(_0x557d67[_0x27b73b(_0x251976._0x3ba5c0)][_0x27b73b(_0x251976._0x1523c4)]*=this[_0x27b73b(_0x251976._0x19763f)]),_0x557d67;},Object['defineProperties'](Cesium__namespace[_0x3d5d32(0x46f)]['prototype'],{'globalAlpha':{'set':function(_0x198765){this['_globalAlpha']=_0x198765;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old$1=Cesium__namespace[_0x3d5d32(0x46f)]['prototype'][_0x3d5d32(0xfbe)];Cesium__namespace['PolylineOutlineMaterialProperty']['prototype']['getValue']=function(_0x48905f,_0x571cf5){const _0x138bc0={_0x2eb818:0x62a,_0x43a155:0xc96},_0x557684=_0x3d5d32;return _0x571cf5=getValue_old$1['bind'](this)(_0x48905f,_0x571cf5),this['globalAlpha']!==0x1&&(_0x571cf5['color']&&(_0x571cf5[_0x557684(0xe8f)]['alpha']*=this['globalAlpha']),_0x571cf5[_0x557684(_0x138bc0._0x2eb818)]&&(_0x571cf5['outlineColor']['alpha']*=this[_0x557684(_0x138bc0._0x43a155)])),_0x571cf5;},Object['defineProperties'](Cesium__namespace['StripeMaterialProperty']['prototype'],{'globalAlpha':{'set':function(_0x2f1685){const _0x3a4e9d=_0x3d5d32;this[_0x3a4e9d(0x6f9)]=_0x2f1685;},'get':function(){return this['_globalAlpha']??0x1;}}});const getValue_old=Cesium__namespace[_0x3d5d32(0x2f5)]['prototype']['getValue'];Cesium__namespace[_0x3d5d32(0x2f5)]['prototype']['getValue']=function(_0x541540,_0x65a3da){const _0x21e463={_0x40ad44:0xc96,_0x2af731:0x498},_0x28647b=_0x3d5d32;return _0x65a3da=getValue_old['bind'](this)(_0x541540,_0x65a3da),this[_0x28647b(_0x21e463._0x40ad44)]!==0x1&&(_0x65a3da['evenColor']&&(_0x65a3da[_0x28647b(_0x21e463._0x2af731)][_0x28647b(0x24b)]*=this['globalAlpha']),_0x65a3da['oddColor']&&(_0x65a3da['oddColor']['alpha']*=this['globalAlpha'])),_0x65a3da;},proj4['defs']('EPSG:4490',_0x3d5d32(0x2ed)),proj4['defs']('EPSG:4491',_0x3d5d32(0x1080)),proj4[_0x3d5d32(0x279)](_0x3d5d32(0x327),_0x3d5d32(0x3b5)),proj4['defs']('EPSG:4493','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=15500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)](_0x3d5d32(0xee7),'+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=16500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4495',_0x3d5d32(0x931)),proj4['defs']('EPSG:4496','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=18500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0x4de),'+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=19500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4498','+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=20500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4499',_0x3d5d32(0x966)),proj4['defs']('EPSG:4500','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=22500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4501','+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=23500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4513',_0x3d5d32(0x544)),proj4['defs']('EPSG:4514','+proj=tmerc\x20+lat_0=0\x20+lon_0=78\x20+k=1\x20+x_0=26500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0xf4d),_0x3d5d32(0xe6e)),proj4['defs']('EPSG:4516','+proj=tmerc\x20+lat_0=0\x20+lon_0=84\x20+k=1\x20+x_0=28500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0xe7d),_0x3d5d32(0x87f)),proj4['defs']('EPSG:4518','+proj=tmerc\x20+lat_0=0\x20+lon_0=90\x20+k=1\x20+x_0=30500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4519','+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=31500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4520','+proj=tmerc\x20+lat_0=0\x20+lon_0=96\x20+k=1\x20+x_0=32500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4521','+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=33500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4522',_0x3d5d32(0xf7f)),proj4['defs']('EPSG:4523','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=35500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4524',_0x3d5d32(0x678)),proj4[_0x3d5d32(0x279)]('EPSG:4525','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=37500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4526','+proj=tmerc\x20+lat_0=0\x20+lon_0=114\x20+k=1\x20+x_0=38500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4527','+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=39500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4528','+proj=tmerc\x20+lat_0=0\x20+lon_0=120\x20+k=1\x20+x_0=40500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0xa76),'+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=41500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4530',_0x3d5d32(0x5fe)),proj4['defs']('EPSG:4531','+proj=tmerc\x20+lat_0=0\x20+lon_0=129\x20+k=1\x20+x_0=43500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)](_0x3d5d32(0x2a5),_0x3d5d32(0x8bf)),proj4['defs']('EPSG:4533','+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=45500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4502','+proj=tmerc\x20+lat_0=0\x20+lon_0=75\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4503','+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4504','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)](_0x3d5d32(0xf3d),'+proj=tmerc\x20+lat_0=0\x20+lon_0=93\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4506','+proj=tmerc\x20+lat_0=0\x20+lon_0=99\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4507','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4508','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)](_0x3d5d32(0xbc2),'+proj=tmerc\x20+lat_0=0\x20+lon_0=117\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4510','+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4511',_0x3d5d32(0x7ad)),proj4['defs'](_0x3d5d32(0x35b),'+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4534',_0x3d5d32(0x1027)),proj4['defs']('EPSG:4535',_0x3d5d32(0xec1)),proj4['defs'](_0x3d5d32(0xb60),'+proj=tmerc\x20+lat_0=0\x20+lon_0=81\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4537','+proj=tmerc\x20+lat_0=0\x20+lon_0=84\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4538','+proj=tmerc\x20+lat_0=0\x20+lon_0=87\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4539',_0x3d5d32(0x88c)),proj4['defs'](_0x3d5d32(0x4f9),_0x3d5d32(0xc48)),proj4['defs']('EPSG:4541',_0x3d5d32(0x825)),proj4[_0x3d5d32(0x279)](_0x3d5d32(0x6a0),_0x3d5d32(0xaca)),proj4[_0x3d5d32(0x279)](_0x3d5d32(0xd07),'+proj=tmerc\x20+lat_0=0\x20+lon_0=102\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4544','+proj=tmerc\x20+lat_0=0\x20+lon_0=105\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4545','+proj=tmerc\x20+lat_0=0\x20+lon_0=108\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4546','+proj=tmerc\x20+lat_0=0\x20+lon_0=111\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4547',_0x3d5d32(0xc57)),proj4['defs']('EPSG:4548',_0x3d5d32(0xcdf)),proj4['defs']('EPSG:4549','+proj=tmerc\x20+lat_0=0\x20+lon_0=120\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0x47e),'+proj=tmerc\x20+lat_0=0\x20+lon_0=123\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs']('EPSG:4551','+proj=tmerc\x20+lat_0=0\x20+lon_0=126\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4[_0x3d5d32(0x279)]('EPSG:4552',_0x3d5d32(0x7ad)),proj4['defs']('EPSG:4553','+proj=tmerc\x20+lat_0=0\x20+lon_0=132\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs'),proj4['defs'](_0x3d5d32(0x6d2),'+proj=tmerc\x20+lat_0=0\x20+lon_0=135\x20+k=1\x20+x_0=500000\x20+y_0=0\x20+ellps=GRS80\x20+units=m\x20+no_defs');class BaseClass{constructor(_0x28841a){const _0x1078cf={_0x4ff28f:0x408},_0x349301=_0x3d5d32;this[_0x349301(0x433)]=_0x28841a,this[_0x349301(_0x1078cf._0x4ff28f)]=(_0x28841a===null||_0x28841a===void 0x0?void 0x0:_0x28841a[_0x349301(0xc4d)])??!![];}get['enabledEvent'](){return this['_enabledEvent'];}set['enabledEvent'](_0x202730){this['_enabledEvent']=_0x202730;}['destroy'](_0x5e8ba6){if(!_0x5e8ba6)for(const _0x542386 in this){delete this[_0x542386];}}['on'](_0x3ee59c,_0x295d77,_0x387b63){const _0x60f478={_0x2e350d:0xc84,_0x698956:0xf05},_0x2dea5d=_0x3d5d32;if(!_0x3ee59c)return logError$1(_0x2dea5d(0xcb6),_0x295d77),this;if(Array['isArray'](_0x3ee59c))for(let _0x3f1435=0x0,_0x3ca574=_0x3ee59c[_0x2dea5d(_0x60f478._0x2e350d)];_0x3f1435<_0x3ca574;_0x3f1435++){this[_0x2dea5d(0x3e0)](_0x3ee59c[_0x3f1435],_0x295d77,_0x387b63);}else{if(isObject(_0x3ee59c))for(const _0x456f58 in _0x3ee59c){this['_on'](_0x456f58,_0x3ee59c[_0x456f58],_0x295d77);}else{_0x3ee59c=splitWords(_0x3ee59c);for(let _0x131e28=0x0,_0x5971a8=_0x3ee59c['length'];_0x131e28<_0x5971a8;_0x131e28++){this['_on'](_0x3ee59c[_0x131e28],_0x295d77,_0x387b63);}}}return this[_0x2dea5d(_0x60f478._0x698956)]&&this['_onEventHook'](_0x3ee59c),this;}[_0x3d5d32(0x9e7)](_0x380ee5,_0x345aac,_0x52786a){const _0x222379={_0x4bc954:0x62b},_0x247be8=_0x3d5d32;if(!_0x380ee5)delete this['_events'];else{if(Array[_0x247be8(_0x222379._0x4bc954)](_0x380ee5))for(let _0x4b6d67=0x0,_0x173591=_0x380ee5['length'];_0x4b6d67<_0x173591;_0x4b6d67++){this['_off'](_0x380ee5[_0x4b6d67],_0x345aac,_0x52786a);}else{if(isObject(_0x380ee5))for(const _0x294a5c in _0x380ee5){this['_off'](_0x294a5c,_0x380ee5[_0x294a5c],_0x345aac);}else{_0x380ee5=splitWords(_0x380ee5);for(let _0x53b699=0x0,_0x49cbf4=_0x380ee5['length'];_0x53b699<_0x49cbf4;_0x53b699++){this['_off'](_0x380ee5[_0x53b699],_0x345aac,_0x52786a);}}}}return this;}['_on'](_0x3c8f65,_0xfd37be,_0x5112af){const _0x21b9ca=_0x3d5d32;this['_events']=this['_events']||{};let _0x148779=this['_events'][_0x3c8f65];!_0x148779&&(_0x148779=[],this['_events'][_0x3c8f65]=_0x148779);_0x5112af===this&&(_0x5112af=undefined);const _0x143fc3={'fn':_0xfd37be,'ctx':_0x5112af},_0xa586dc=_0x148779;for(let _0x2c9d21=0x0,_0x593777=_0xa586dc[_0x21b9ca(0xc84)];_0x2c9d21<_0x593777;_0x2c9d21++){if(_0xa586dc[_0x2c9d21]['fn']===_0xfd37be&&_0xa586dc[_0x2c9d21]['ctx']===_0x5112af)return;}_0xa586dc['push'](_0x143fc3);}['_off'](_0x57235c,_0x29304a,_0x4fa487){const _0x29523f=_0x3d5d32;let _0x306504,_0x4863cb,_0x1507cb;if(!this['_events'])return;_0x306504=this['_events'][_0x57235c];if(!_0x306504)return;if(!_0x29304a){for(_0x4863cb=0x0,_0x1507cb=_0x306504['length'];_0x4863cb<_0x1507cb;_0x4863cb++){_0x306504[_0x4863cb]['fn']=falseFn;}delete this[_0x29523f(0x4e4)][_0x57235c];return;}_0x4fa487===this&&(_0x4fa487=undefined);if(_0x306504)for(_0x4863cb=0x0,_0x1507cb=_0x306504['length'];_0x4863cb<_0x1507cb;_0x4863cb++){const _0x394fb1=_0x306504[_0x4863cb];if(_0x394fb1['ctx']!==_0x4fa487)continue;if(_0x394fb1['fn']===_0x29304a){_0x394fb1['fn']=falseFn;this['_firingCount']&&(this['_events'][_0x57235c]=_0x306504=_0x306504['slice']());_0x306504['splice'](_0x4863cb,0x1);return;}}}['fire'](_0x56c26f,_0x16c06f,_0x79825){const _0x29a5fc={_0x2a438b:0x843},_0x355862=_0x3d5d32;if(!this['listens'](_0x56c26f,_0x79825)||!this['enabledEvent'])return this;const _0x4fd09a={'sourceTarget':this,..._0x16c06f,'type':_0x56c26f,'target':this,'stopPropagation':function(){this['_stopPropagation']=!![];}};if(this['_events']){const _0x3c28aa=this['_events'][_0x56c26f];if(_0x3c28aa){this['_firingCount']=this['_firingCount']+0x1||0x1;for(let _0x5b1500=0x0,_0x42acd0=_0x3c28aa['length'];_0x5b1500<_0x42acd0;_0x5b1500++){const _0x30357e=_0x3c28aa[_0x5b1500];_0x30357e['fn'][_0x355862(0xa86)](_0x30357e['ctx']||this,_0x4fd09a);}this[_0x355862(_0x29a5fc._0x2a438b)]--;}}return _0x79825&&!_0x4fd09a['_stopPropagation']&&this['_propagateEvent'](_0x4fd09a),this;}[_0x3d5d32(0x204)](_0x195115,_0x4b8f3c){const _0x4eb36f=this['_events']&&this['_events'][_0x195115];if(_0x4eb36f&&_0x4eb36f['length'])return!![];if(_0x4b8f3c)for(const _0x2b43d7 in this['_eventParents']){if(this['_eventParents'][_0x2b43d7]['listens'](_0x195115,_0x4b8f3c))return!![];}return![];}[_0x3d5d32(0x861)](_0x46a584,_0x2bb8b8,_0x189622){if(isObject(_0x46a584)){for(const _0x12a603 in _0x46a584){this['once'](_0x12a603,_0x46a584[_0x12a603],_0x2bb8b8);}return this;}const _0x2bcb21=bind(()=>{const _0x58bb07=_0x4132;this['off'](_0x46a584,_0x2bb8b8,_0x189622)[_0x58bb07(0x9e7)](_0x46a584,_0x2bcb21,_0x189622);},this);return this['on'](_0x46a584,_0x2bb8b8,_0x189622)['on'](_0x46a584,_0x2bcb21,_0x189622);}['addEventParent'](_0x267075){const _0x3219b0={_0x5e3313:0xd47},_0x80a14f=_0x3d5d32;return this[_0x80a14f(_0x3219b0._0x5e3313)]=this['_eventParents']||{},this['_eventParents'][stampGlobalId(_0x267075)]=_0x267075,this;}['removeEventParent'](_0x215f03){const _0x2de8c9={_0x185371:0xd47},_0x4050a3=_0x3d5d32;return this['_eventParents']&&delete this[_0x4050a3(_0x2de8c9._0x185371)][stampGlobalId(_0x215f03)],this;}['hasEventParent'](_0x2f9868){const _0x33aaa1={_0x365da5:0xd47},_0x15a3c=_0x3d5d32;return this[_0x15a3c(0xd47)]&&this[_0x15a3c(_0x33aaa1._0x365da5)][stampGlobalId(_0x2f9868)]?!![]:![];}['_propagateEvent'](_0x47c3b8){const _0x5d1709={_0x15b3c1:0x7f5},_0x4e53b5=_0x3d5d32;for(const _0x185add in this['_eventParents']){const _0x303a58=this['_eventParents'][_0x185add];this['_filterPropagateEvent'](_0x303a58,_0x47c3b8)&&_0x303a58[_0x4e53b5(0xefc)](_0x47c3b8[_0x4e53b5(_0x5d1709._0x15b3c1)],{'layer':_0x47c3b8['target'],'propagatedFrom':_0x47c3b8['target'],..._0x47c3b8},!![]);}}['_filterPropagateEvent'](_0x3e1dac,_0x2ea743){return!![];}}function falseFn(){return![];}function bind(_0x1ab17d,_0x582ff2){const _0x27a0d6={_0x1b78eb:0xa86},_0x34e7b9={_0x2e2a42:0xc84,_0x272013:0xc97},_0x2b8361=_0x3d5d32,_0x25bb6b=Array['prototype'][_0x2b8361(0x444)];if(_0x1ab17d[_0x2b8361(0x21e)])return _0x1ab17d['bind']['apply'](_0x1ab17d,_0x25bb6b[_0x2b8361(_0x27a0d6._0x1b78eb)](arguments,0x1));const _0x174171=_0x25bb6b['call'](arguments,0x2);return function(){const _0x38e377=_0x2b8361;return _0x1ab17d[_0x38e377(0xd78)](_0x582ff2,_0x174171[_0x38e377(_0x34e7b9._0x2e2a42)]?_0x174171[_0x38e377(_0x34e7b9._0x272013)](_0x25bb6b[_0x38e377(0xa86)](arguments)):arguments);};}const State={'INITIALIZED':'inited','ADD':'add','ADDED':_0x3d5d32(0x647),'REMOVED':'removed','DESTROY':'destroy'},EventType={'add':'add','remove':'remove','addItem':_0x3d5d32(0x8a3),'removeItem':'removeItem','addGraphic':'addGraphic','removeGraphic':_0x3d5d32(0x358),'addLayer':_0x3d5d32(0xc17),'removeLayer':_0x3d5d32(0xa9e),'changeBasemap':'changeBasemap','addControl':'addControl','removeControl':'removeControl','updateControl':'updateControl','addEffect':'addEffect','removeEffect':'removeEffect','update':'update','updatePosition':_0x3d5d32(0x3e8),'updateStyle':_0x3d5d32(0x1cf),'updateAttr':_0x3d5d32(0xef6),'show':_0x3d5d32(0x792),'hide':'hide','start':_0x3d5d32(0xf6d),'change':'change','endItem':_0x3d5d32(0xc81),'end':_0x3d5d32(0xb34),'stop':'stop','zoom':_0x3d5d32(0xaa9),'loadBefore':'loadBefore','load':'load','error':'error','loadConfig':'loadConfig','popupOpen':'popupOpen','popupClose':'popupClose','tooltipOpen':'tooltipOpen','tooltipClose':'tooltipClose','contextMenuOpen':'contextMenuOpen','contextMenuClose':_0x3d5d32(0x9a0),'contextMenuClick':_0x3d5d32(0x5d0),'highlightOpen':_0x3d5d32(0xbd4),'highlightClose':'highlightClose','click':'click','clickGraphic':'clickGraphic','clickTileGraphic':'clickTileGraphic','clickMap':'clickMap','dblClick':_0x3d5d32(0xd83),'leftDown':'leftDown','leftUp':'leftUp','mouseMove':'mouseMove','mouseMoveTarget':'mouseMoveTarget','wheel':'wheel','rightClick':'rightClick','rightDown':'rightDown','rightUp':'rightUp','middleClick':'middleClick','middleDown':_0x3d5d32(0x572),'middleUp':'middleUp','pinchStart':'pinchStart','pinchEnd':_0x3d5d32(0xe6c),'pinchMove':'pinchMove','mouseDown':'mouseDown','mouseUp':_0x3d5d32(0x2f9),'mouseOver':_0x3d5d32(0xef1),'mouseOut':_0x3d5d32(0xbbb),'keydown':_0x3d5d32(0x8c6),'keyup':'keyup','drawStart':'drawStart','drawMouseMove':'drawMouseMove','drawAddPoint':'drawAddPoint','drawRemovePoint':'drawRemovePoint','drawCreated':'drawCreated','editStart':'editStart','editMouseDown':'editMouseDown','editMouseMove':'editMouseMove','editMovePoint':_0x3d5d32(0x655),'editAddPoint':'editAddPoint','editRemovePoint':_0x3d5d32(0x8c0),'editStyle':_0x3d5d32(0x930),'editStop':_0x3d5d32(0x8d6),'move':'move','initialTilesLoaded':_0x3d5d32(0x229),'allTilesLoaded':'allTilesLoaded','addTile':'addTile','addTileSuccess':'addTileSuccess','addTileError':'addTileError','removeTile':'removeTile','cameraMoveStart':'cameraMoveStart','cameraMoveEnd':'cameraMoveEnd','cameraChanged':'cameraChanged','preUpdate':'preUpdate','postUpdate':'postUpdate','preRender':'preRender','postRender':_0x3d5d32(0x51a),'renderError':_0x3d5d32(0x4e1),'morphStart':_0x3d5d32(0x1018),'morphComplete':'morphComplete','clockTick':_0x3d5d32(0x6df),'clockStop':'clockStop','terrainChange':'terrainChange','terrainLoadError':'terrainLoadError','terrainLoadSuccess':'terrainLoadSuccess','tileLoadProgress':_0x3d5d32(0x540)};class BaseThing extends BaseClass{constructor(_0x17c588={}){const _0x30bf07={_0x11beeb:0x86e},_0x5dd8a4=_0x3d5d32;isBoolean(_0x17c588)&&(_0x17c588={'enabled':_0x17c588}),super(_0x17c588),this['_id']=_0x17c588['id']??createGuid(),this[_0x5dd8a4(_0x30bf07._0x11beeb)]=_0x17c588[_0x5dd8a4(0xa63)]??!![],this['_state']=State['INITIALIZED'],this['options']=_0x17c588;}get[_0x3d5d32(0xa02)](){return this['_state'];}get['isAdded'](){const _0x13c82f=_0x3d5d32;return this[_0x13c82f(0xf35)]===State['ADDED'];}get['id'](){const _0x52f4bf={_0x11e324:0xed3},_0x4a1b66=_0x3d5d32;return this[_0x4a1b66(_0x52f4bf._0x11e324)];}set['id'](_0x2daa66){this['options']['id']=_0x2daa66;}get[_0x3d5d32(0x98c)](){return this['_id'];}get['enabled'](){return this['_enabled'];}set[_0x3d5d32(0xa63)](_0x1f926b){const _0x12e743={_0x3e104e:0x86e},_0xda3bce=_0x3d5d32;if(this[_0xda3bce(_0x12e743._0x3e104e)]===_0x1f926b)return;this['_enabled']=_0x1f926b,this[_0xda3bce(0xacd)]&&this['_enabledHook'](_0x1f926b);}['addTo'](_0x205e99){return _0x205e99&&_0x205e99['addThing']&&_0x205e99['addThing'](this),this;}['remove'](_0x8dc3d){const _0x4dc58c={_0x16b3e1:0x1d1},_0x542a6c=_0x3d5d32;this[_0x542a6c(_0x4dc58c._0x16b3e1)]&&this['_map']['removeThing'](this,_0x8dc3d);}['_onAdd'](_0x3cd039){const _0x53601d={_0x2c505d:0xf35,_0x1ab5eb:0x4b7,_0xd79184:0x584},_0x4d1892=_0x3d5d32;var _0x57aa54;if(this['isAdded']||this[_0x4d1892(_0x53601d._0x2c505d)]===State['ADD'])return;this[_0x4d1892(_0x53601d._0x2c505d)]=State['ADD'],this['_map']=_0x3cd039;if(this['options'][_0x4d1892(_0x53601d._0x1ab5eb)])this['addEventParent'](this['options'][_0x4d1892(_0x53601d._0x1ab5eb)]);else{if(((_0x57aa54=this['options'])===null||_0x57aa54===void 0x0?void 0x0:_0x57aa54['eventParent'])===![]);else this[_0x4d1892(_0x53601d._0xd79184)](_0x3cd039);}this['_mountedHook']&&!this['_createOK']&&(this['_mountedHook'](),this['_createOK']=!![]),this[_0x4d1892(0x720)]&&this['_addedBaseHook'](),this['_addedHook']&&this['_addedHook'](),this['_state']=State['ADDED'],this['fire'](EventType['add']);}[_0x3d5d32(0x8f1)](){const _0x272f03={_0x5b72e4:0x1d1,_0x1120a6:0x1e5,_0x3a4040:0x433},_0x5925c8=_0x3d5d32;var _0x5d8f6b,_0x52106c;if(this['_state']!==State['ADDED'])return;if(!this[_0x5925c8(_0x272f03._0x5b72e4)])return;this['_removedBaseHook']&&this['_removedBaseHook'](),this[_0x5925c8(0x566)]&&this['_removedHook'](),this[_0x5925c8(0xf35)]=State['REMOVED'],this['fire'](EventType['remove']);if((_0x5d8f6b=this['options'])!==null&&_0x5d8f6b!==void 0x0&&_0x5d8f6b['eventParent'])this[_0x5925c8(_0x272f03._0x1120a6)](this[_0x5925c8(_0x272f03._0x3a4040)]['eventParent']);else{if(((_0x52106c=this['options'])===null||_0x52106c===void 0x0?void 0x0:_0x52106c['eventParent'])===![]);else this['removeEventParent'](this[_0x5925c8(0x1d1)]);}this['_map']=null;}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){}['setOptions'](_0x29cc81){const _0x5d5287={_0x5edb61:0x433},_0x49dfdd=_0x3d5d32;if(!_0x29cc81||Object['keys'](_0x29cc81)['length']===0x0)return this;return this[_0x49dfdd(_0x5d5287._0x5edb61)]=merge(this['options'],_0x29cc81),Cesium__namespace['defined'](_0x29cc81['enabled'])&&(this['enabled']=_0x29cc81[_0x49dfdd(0xa63)]),this[_0x49dfdd(0xd4c)]&&this['_setOptionsHook'](this['options'],_0x29cc81),this;}[_0x3d5d32(0x689)](_0x169bc3){const _0x506a53={_0x713fce:0x689},_0x23bb9e=_0x3d5d32;this['_state']!==State['REMOVED']&&(this['clear']&&this['clear'](),this['remove']()),super[_0x23bb9e(_0x506a53._0x713fce)](_0x169bc3);}}class GroupThing extends BaseThing{constructor(_0x52c347={}){super(_0x52c347),this['_arrThing']=[];}get['arrThing'](){return this['_arrThing'];}get[_0x3d5d32(0xc8b)](){const _0x291fce=_0x3d5d32;return this[_0x291fce(0xc84)]===0x0;}get[_0x3d5d32(0x872)](){return this['length']>0x0;}get['length'](){const _0xb68854=_0x3d5d32;var _0x26927a;return((_0x26927a=this['options']['things'])===null||_0x26927a===void 0x0?void 0x0:_0x26927a['length'])>0x0?this['options'][_0xb68854(0xfe1)]['length']:this['_arrThing']['length'];}['_enabledHook'](_0x1d348){this['eachThing'](_0xffb375=>{_0xffb375['enabled']=_0x1d348;},this);}[_0x3d5d32(0x226)](){this['addChildsToMap']();}['_removedHook'](){this['removeMapChilds']();}['addChildsToMap'](){const _0x36eb3f=_0x3d5d32;this[_0x36eb3f(0x243)](_0xb945e6=>{this['_map']['addThing'](_0xb945e6);},this);}['removeMapChilds'](){this['eachThing'](_0x4a22be=>{this['_map']['removeThing'](_0x4a22be);},this);}[_0x3d5d32(0xa2d)](_0x3639d9){const _0x4cc21e={_0x41cae7:0x1e5,_0x2e1f1f:0x433},_0x446690=_0x3d5d32;return _0x3639d9['parent']&&(_0x3639d9[_0x446690(_0x4cc21e._0x41cae7)](_0x3639d9['parent']),_0x3639d9['parent']=null),_0x3639d9['parent']=this,_0x3639d9[_0x446690(_0x4cc21e._0x2e1f1f)]['eventParent']=this,this['_arrThing'][_0x446690(0xb75)](_0x3639d9),this['isAdded']&&!_0x3639d9[_0x446690(0x842)]?this['_map'][_0x446690(0xa2d)](_0x3639d9):(_0x3639d9['removeEventParent'](this[_0x446690(0x1d1)]),_0x3639d9[_0x446690(0x584)](this)),this;}[_0x3d5d32(0x1081)](_0x367650){const _0x235a67={_0x520752:0xd00,_0x4cfbb8:0x1081},_0x1867ed=_0x3d5d32;return _0x367650[_0x1867ed(_0x235a67._0x520752)]=null,_0x367650[_0x1867ed(0x1e5)](this),removeArrayItem(this['_arrThing'],_0x367650),this['_map']&&_0x367650[_0x1867ed(0x842)]&&this['_map'][_0x1867ed(_0x235a67._0x4cfbb8)](_0x367650),this;}[_0x3d5d32(0x243)](_0x32ead5,_0x5a61c5){if(!this['_arrThing'])return;return this['_arrThing']['forEach'](_0x3a8417=>{const _0x43dc1f=_0x4132;_0x32ead5[_0x43dc1f(0xa86)](_0x5a61c5,_0x3a8417);}),this;}[_0x3d5d32(0x106e)](){const _0x52ca21=_0x3d5d32;return this[_0x52ca21(0x982)];}['getInMapChilds'](){const _0x21d033={_0x4171a8:0x982},_0x2b4cb2=_0x3d5d32,_0x4fe719=this['_arrThing']||[];return this['_map'][_0x2b4cb2(0x243)](_0x4b631f=>{const _0x3d3c58=_0x2b4cb2;if(_0x4b631f['pid']!==this['id'])return;if(this[_0x3d3c58(_0x21d033._0x4171a8)]['indexOf'](_0x4b631f)!==-0x1)return;_0x4fe719['push'](_0x4b631f);},this),_0x4fe719;}['getThingById'](_0x1f3f5b){const _0xbeb7e3={_0x19ce36:0x982},_0x2d5701=_0x3d5d32,_0x159a80=this[_0x2d5701(_0xbeb7e3._0x19ce36)];if(!this['_arrThing']||this[_0x2d5701(0x982)][_0x2d5701(0xc84)]===0x0)return;for(let _0x15e032=0x0,_0x48fc60=_0x159a80[_0x2d5701(0xc84)];_0x15e032<_0x48fc60;_0x15e032++){const _0x42a540=_0x159a80[_0x15e032];if(_0x42a540['id']===_0x1f3f5b)return _0x42a540;}return undefined;}['destroy'](_0x343b06){const _0x19e919=_0x3d5d32;this[_0x19e919(0x243)](_0x27182a=>{const _0x580837=_0x19e919;_0x27182a!==null&&_0x27182a!==void 0x0&&_0x27182a[_0x580837(0x689)]&&_0x27182a[_0x580837(0x689)](_0x343b06);},this),super[_0x19e919(0x689)](_0x343b06);}}var GroundSkyBoxFS='uniform\x20samplerCube\x20u_cubeMap;\x0ain\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap,\x20normalize(v_texCoord));\x0a\x20\x20out_FragColor\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a}\x0a',GroundSkyBoxVS='in\x20vec3\x20position;\x0auniform\x20mat3\x20u_rotateMatrix;\x0aout\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20p\x20=\x20czm_viewRotation\x20*\x20u_rotateMatrix\x20*\x20(czm_temeToPseudoFixed\x20*\x20(czm_entireFrustum.y\x20*\x20position));//【火星科技marsgis.cn】\x20Hao\x202019-9-18\x20\x20\x20天空盒\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20vec4(p,\x201.0);\x0a\x20\x20v_texCoord\x20=\x20position.xyz;\x0a}\x0a';class GroundSkyBox extends Cesium__namespace['SkyBox']{constructor(_0x53cf65){const _0x56d566={_0x3a4863:0x95e},_0x447798=_0x3d5d32;super(_0x53cf65),this[_0x447798(_0x56d566._0x3a4863)]=new Cesium__namespace['Matrix3']();}['update'](_0x2269e9,_0x104ee7){const _0x2e4dff={_0x25bd24:0xd4a,_0x12231f:0xb84,_0x16c2c2:0xb94,_0x24e040:0x911,_0x4e3112:0x44d,_0x1f456c:0x245,_0x155f13:0xf55,_0x444dbb:0xe56,_0x123ac7:0xfa3,_0x5c8cc7:0x2a7,_0x37ec5a:0x3a5,_0x1491d3:0x1012,_0x2c26af:0x5e4,_0x26d639:0x8f5},_0xcbbfc={_0x11ff0c:0x724},_0x5019d2={_0x361688:0x2c0},_0xd492fe=_0x3d5d32,_0xd54583=this;if(!this['show'])return undefined;if(_0x2269e9['mode']!==Cesium__namespace['SceneMode']['SCENE3D']&&_0x2269e9['mode']!==Cesium__namespace[_0xd492fe(0xb22)]['MORPHING'])return undefined;if(!_0x2269e9['passes'][_0xd492fe(_0x2e4dff._0x25bd24)])return undefined;const _0x12b807=_0x2269e9['context'];if(this[_0xd492fe(0x722)]!==this['sources']){this['_sources']=this['sources'];const _0x5a6fbd=this[_0xd492fe(0xd52)];if(!Cesium__namespace[_0xd492fe(0xb84)](_0x5a6fbd['positiveX'])||!Cesium__namespace['defined'](_0x5a6fbd['negativeX'])||!Cesium__namespace[_0xd492fe(0xb84)](_0x5a6fbd['positiveY'])||!Cesium__namespace['defined'](_0x5a6fbd['negativeY'])||!Cesium__namespace[_0xd492fe(_0x2e4dff._0x12231f)](_0x5a6fbd['positiveZ'])||!Cesium__namespace[_0xd492fe(_0x2e4dff._0x12231f)](_0x5a6fbd[_0xd492fe(0x494)]))throw new Cesium__namespace[(_0xd492fe(0x357))]('this.sources\x20is\x20required\x20and\x20must\x20have\x20positiveX,\x20negativeX,\x20positiveY,\x20negativeY,\x20positiveZ,\x20and\x20negativeZ\x20properties.');if(typeof _0x5a6fbd[_0xd492fe(_0x2e4dff._0x16c2c2)]!==typeof _0x5a6fbd['negativeX']||typeof _0x5a6fbd[_0xd492fe(0xb94)]!==typeof _0x5a6fbd['positiveY']||typeof _0x5a6fbd['positiveX']!==typeof _0x5a6fbd['negativeY']||typeof _0x5a6fbd['positiveX']!==typeof _0x5a6fbd['positiveZ']||typeof _0x5a6fbd['positiveX']!==typeof _0x5a6fbd['negativeZ'])throw new Cesium__namespace[(_0xd492fe(0x357))]('this.sources\x20properties\x20must\x20all\x20be\x20the\x20same\x20type.');typeof _0x5a6fbd['positiveX']==='string'?Cesium__namespace[_0xd492fe(_0x2e4dff._0x24e040)](_0x12b807,this[_0xd492fe(0x722)])[_0xd492fe(_0x2e4dff._0x4e3112)](function(_0x15cb03){const _0x9fcd39=_0xd492fe;_0xd54583['_cubeMap']=_0xd54583[_0x9fcd39(_0x5019d2._0x361688)]&&_0xd54583['_cubeMap']['destroy'](),_0xd54583['_cubeMap']=_0x15cb03;}):(this[_0xd492fe(0x2c0)]=this['_cubeMap']&&this['_cubeMap']['destroy'](),this['_cubeMap']=new Cesium__namespace['CubeMap']({'context':_0x12b807,'source':_0x5a6fbd}));}const _0x567aba=this[_0xd492fe(_0x2e4dff._0x1f456c)];if(!Cesium__namespace['defined'](_0x567aba[_0xd492fe(_0x2e4dff._0x155f13)])){_0x567aba[_0xd492fe(_0x2e4dff._0x444dbb)]={'u_cubeMap':()=>{return _0xd54583['_cubeMap'];},'u_rotateMatrix':()=>{const _0x1e536f=_0xd492fe;return _0x567aba['modelMatrix']=Cesium__namespace['Transforms'][_0x1e536f(_0xcbbfc._0x11ff0c)](_0x2269e9['camera']['_positionWC']),Cesium__namespace['Matrix4']['getMatrix3'](_0x567aba['modelMatrix'],this['_skyboxMatrix3']);}};const _0x53f518=Cesium__namespace[_0xd492fe(0xf00)][_0xd492fe(_0x2e4dff._0x123ac7)](Cesium__namespace['BoxGeometry'][_0xd492fe(_0x2e4dff._0x5c8cc7)]({'dimensions':new Cesium__namespace['Cartesian3'](0x2,0x2,0x2),'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']})),_0x5d64a6=this['_attributeLocations']=Cesium__namespace[_0xd492fe(_0x2e4dff._0x37ec5a)]['createAttributeLocations'](_0x53f518);_0x567aba['vertexArray']=Cesium__namespace[_0xd492fe(0xfaa)]['fromGeometry']({'context':_0x12b807,'geometry':_0x53f518,'attributeLocations':_0x5d64a6,'bufferUsage':Cesium__namespace['BufferUsage'][_0xd492fe(_0x2e4dff._0x1491d3)]}),_0x567aba[_0xd492fe(0x948)]=Cesium__namespace[_0xd492fe(0x9ca)][_0xd492fe(_0x2e4dff._0x2c26af)]({'blending':Cesium__namespace['BlendingState']['ALPHA_BLEND']});}if(!Cesium__namespace['defined'](_0x567aba['shaderProgram'])||this['_useHdr']!==_0x104ee7){const _0x418b14=new Cesium__namespace[(_0xd492fe(_0x2e4dff._0x26d639))]({'defines':[_0x104ee7?'HDR':''],'sources':[GroundSkyBoxFS]});_0x567aba['shaderProgram']=Cesium__namespace[_0xd492fe(0xa17)]['fromCache']({'context':_0x12b807,'vertexShaderSource':GroundSkyBoxVS,'fragmentShaderSource':_0x418b14,'attributeLocations':this['_attributeLocations']}),this['_useHdr']=_0x104ee7;}if(!Cesium__namespace['defined'](this[_0xd492fe(0x2c0)]))return undefined;return _0x567aba;}}var MultipleSkyBoxFS='uniform\x20samplerCube\x20u_cubeMap;\x0auniform\x20samplerCube\x20u_cubeMap2;\x0auniform\x20samplerCube\x20u_cubeMap3;\x0auniform\x20float\x20u_select;\x0ain\x20vec3\x20v_texCoord;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20fragColor;\x0a\x20\x20if(u_select\x20<=\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20vec4\x20color2\x20=\x20czm_textureCube(u_cubeMap2,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color2\x20=\x20vec4(czm_gammaCorrect(color2).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20fragColor\x20=\x20mix(color,\x20color2,\x20u_select);\x0a\x20\x20}\x0a\x20\x20if(u_select\x20>\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20czm_textureCube(u_cubeMap2,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color\x20=\x20vec4(czm_gammaCorrect(color).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20vec4\x20color2\x20=\x20czm_textureCube(u_cubeMap3,\x20normalize(v_texCoord));\x0a\x20\x20\x20\x20color2\x20=\x20vec4(czm_gammaCorrect(color2).rgb,\x20czm_morphTime);\x0a\x20\x20\x20\x20fragColor\x20=\x20mix(color,\x20color2,\x20u_select\x20-\x201.0);\x0a\x20\x20}\x0a\x20\x20out_FragColor\x20=\x20fragColor;\x0a}\x0a',MultipleSkyBoxVS='in\x20vec3\x20position;\x0aout\x20vec3\x20v_texCoord;\x0auniform\x20mat3\x20u_rotateMatrix;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20p\x20=\x20czm_viewRotation\x20*\x20u_rotateMatrix\x20*\x20(czm_temeToPseudoFixed\x20*\x20(czm_entireFrustum.y\x20*\x20position));\x0a\x20\x20gl_Position\x20=\x20czm_projection\x20*\x20vec4(p,\x201.0);\x0a\x20\x20v_texCoord\x20=\x20position.xyz;\x0a}\x0a';class MultipleSkyBox extends Cesium__namespace[_0x3d5d32(0xc07)]{constructor(_0x1a36b5){const _0x5c5a30={_0x414926:0x623},_0x43117f=_0x3d5d32;super(_0x1a36b5),this['sources2']=_0x1a36b5['sources2'],this[_0x43117f(0x894)]=_0x1a36b5['sources3'],this[_0x43117f(_0x5c5a30._0x414926)]=undefined,this['_sources3']=undefined,this[_0x43117f(0x79d)]=undefined,this['_cubeMap3']=undefined,this['_skyboxMatrix3']=new Cesium__namespace['Matrix3'](),this['select']=_0x1a36b5['select']||0x0;}[_0x3d5d32(0x635)](_0x5b9a6d,_0x12d665){const _0x4c6a5f={_0xb5f664:0x4a8,_0x3b1d50:0xd4a,_0x296d23:0x4a4,_0x4904b6:0x3c4,_0x1f84ea:0x1043,_0x5c0f1a:0xb86,_0x18915e:0x494,_0x190370:0x494,_0x47883b:0x44d,_0x401090:0x689,_0x3eb5ed:0x79d,_0x1e9fcc:0xd99,_0x29ced8:0xfa3,_0x2c2ab2:0x70f,_0x5555f3:0x2c0},_0x60be3={_0x45da76:0xd99},_0x113597={_0x4f231b:0x689},_0xb0071c=_0x3d5d32,_0x3e9809=this;if(!this['show'])return undefined;if(_0x5b9a6d['mode']!==Cesium__namespace['SceneMode'][_0xb0071c(_0x4c6a5f._0xb5f664)]&&_0x5b9a6d['mode']!==Cesium__namespace['SceneMode']['MORPHING'])return undefined;if(!_0x5b9a6d['passes'][_0xb0071c(_0x4c6a5f._0x3b1d50)])return undefined;const _0x179e74=_0x5b9a6d[_0xb0071c(0x92a)];if(this['_sources']!==this['sources']){this['_sources']=this['sources'];const _0x52cf26=this['sources'];this['_sources2']=this[_0xb0071c(_0x4c6a5f._0x296d23)];const _0x348b80=this['sources2'];this['_sources3']=this['sources3'];const _0xb1c7b6=this['sources3'];if(!Cesium__namespace['defined'](_0x52cf26['positiveX'])||!Cesium__namespace['defined'](_0x52cf26[_0xb0071c(_0x4c6a5f._0x4904b6)])||!Cesium__namespace['defined'](_0x52cf26[_0xb0071c(_0x4c6a5f._0x1f84ea)])||!Cesium__namespace['defined'](_0x52cf26[_0xb0071c(_0x4c6a5f._0x5c0f1a)])||!Cesium__namespace['defined'](_0x52cf26['positiveZ'])||!Cesium__namespace['defined'](_0x52cf26[_0xb0071c(_0x4c6a5f._0x18915e)]))throw new Cesium__namespace['DeveloperError'](_0xb0071c(0x1cc));if(typeof _0x52cf26['positiveX']!==typeof _0x52cf26['negativeX']||typeof _0x52cf26['positiveX']!==typeof _0x52cf26['positiveY']||typeof _0x52cf26['positiveX']!==typeof _0x52cf26[_0xb0071c(_0x4c6a5f._0x5c0f1a)]||typeof _0x52cf26['positiveX']!==typeof _0x52cf26['positiveZ']||typeof _0x52cf26['positiveX']!==typeof _0x52cf26[_0xb0071c(_0x4c6a5f._0x190370)])throw new Cesium__namespace[(_0xb0071c(0x357))]('this.sources\x20properties\x20must\x20all\x20be\x20the\x20same\x20type.');typeof _0x52cf26['positiveX']==='string'?(Cesium__namespace['loadCubeMap'](_0x179e74,this['_sources'])['then'](function(_0x480b8c){const _0x14cadd=_0xb0071c;_0x3e9809['_cubeMap']=_0x3e9809['_cubeMap']&&_0x3e9809['_cubeMap'][_0x14cadd(_0x113597._0x4f231b)](),_0x3e9809['_cubeMap']=_0x480b8c;}),Cesium__namespace['loadCubeMap'](_0x179e74,this[_0xb0071c(0x623)])[_0xb0071c(_0x4c6a5f._0x47883b)](function(_0x284c49){_0x3e9809['_cubeMap2']=_0x3e9809['_cubeMap2']&&_0x3e9809['_cubeMap2']['destroy'](),_0x3e9809['_cubeMap2']=_0x284c49;}),Cesium__namespace['loadCubeMap'](_0x179e74,this['_sources3'])[_0xb0071c(_0x4c6a5f._0x47883b)](function(_0x43844f){const _0x3e2cbf=_0xb0071c;_0x3e9809[_0x3e2cbf(_0x60be3._0x45da76)]=_0x3e9809['_cubeMap3']&&_0x3e9809[_0x3e2cbf(0xd99)]['destroy'](),_0x3e9809['_cubeMap3']=_0x43844f;})):(this[_0xb0071c(0x2c0)]=this['_cubeMap']&&this['_cubeMap'][_0xb0071c(_0x4c6a5f._0x401090)](),this['_cubeMap']=new Cesium__namespace['CubeMap']({'context':_0x179e74,'source':_0x52cf26}),this[_0xb0071c(_0x4c6a5f._0x3eb5ed)]=this['_cubeMap2']&&this['_cubeMap2']['destroy'](),this['_cubeMap2']=new Cesium__namespace['CubeMap']({'context':_0x179e74,'source':_0x348b80}),this[_0xb0071c(_0x4c6a5f._0x1e9fcc)]=this['_cubeMap3']&&this[_0xb0071c(0xd99)][_0xb0071c(0x689)](),this['_cubeMap3']=new Cesium__namespace['CubeMap']({'context':_0x179e74,'source':_0xb1c7b6}));}const _0x9e3b51=this['_command'];_0x9e3b51['modelMatrix']=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x5b9a6d['camera'][_0xb0071c(0x36e)]);if(!Cesium__namespace['defined'](_0x9e3b51[_0xb0071c(0xf55)])){_0x9e3b51['uniformMap']={'u_cubeMap':function(){return _0x3e9809['_cubeMap'];},'u_cubeMap2':function(){return _0x3e9809['_cubeMap2'];},'u_cubeMap3':function(){return _0x3e9809['_cubeMap3'];},'u_select':()=>{return this['select'];},'u_rotateMatrix':()=>{const _0x71c9e9=_0xb0071c;return _0x9e3b51['modelMatrix']=Cesium__namespace['Transforms'][_0x71c9e9(0x724)](_0x5b9a6d['camera']['_positionWC']),Cesium__namespace['Matrix4']['getMatrix3'](_0x9e3b51['modelMatrix'],this['_skyboxMatrix3']);}};const _0xbce4af=Cesium__namespace['BoxGeometry'][_0xb0071c(_0x4c6a5f._0x29ced8)](Cesium__namespace[_0xb0071c(0xf00)][_0xb0071c(0x2a7)]({'dimensions':new Cesium__namespace['Cartesian3'](0x2,0x2,0x2),'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']})),_0x484bc6=this['_attributeLocations']=Cesium__namespace[_0xb0071c(0x3a5)][_0xb0071c(0xba2)](_0xbce4af);_0x9e3b51['vertexArray']=Cesium__namespace['VertexArray'][_0xb0071c(_0x4c6a5f._0x2c2ab2)]({'context':_0x179e74,'geometry':_0xbce4af,'attributeLocations':_0x484bc6,'bufferUsage':Cesium__namespace['BufferUsage']['_DRAW']}),_0x9e3b51['renderState']=Cesium__namespace[_0xb0071c(0x9ca)]['fromCache']({'blending':Cesium__namespace[_0xb0071c(0x71e)]['ALPHA_BLEND']});}if(!Cesium__namespace[_0xb0071c(0xb84)](_0x9e3b51['shaderProgram'])||this['_useHdr']!==_0x12d665){const _0x513329=new Cesium__namespace[(_0xb0071c(0x8f5))]({'defines':[_0x12d665?'HDR':''],'sources':[MultipleSkyBoxFS]});_0x9e3b51['shaderProgram']=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x179e74,'vertexShaderSource':MultipleSkyBoxVS,'fragmentShaderSource':_0x513329,'attributeLocations':this['_attributeLocations']}),this['_useHdr']=_0x12d665;}if(!Cesium__namespace['defined'](this[_0xb0071c(_0x4c6a5f._0x5555f3)]))return undefined;if(!Cesium__namespace['defined'](this[_0xb0071c(0x79d)]))return undefined;if(!Cesium__namespace[_0xb0071c(0xb84)](this['_cubeMap3']))return undefined;return _0x9e3b51;}['isDestroyed'](){return![];}[_0x3d5d32(0x689)](){const _0xd4933b={_0x391aea:0x2c0,_0x3b4589:0x689,_0xf03a76:0xd99},_0x55558f=_0x3d5d32,_0xbcfc3d=this['_command'];return _0xbcfc3d['vertexArray']=_0xbcfc3d['vertexArray']&&_0xbcfc3d['vertexArray'][_0x55558f(0x689)](),_0xbcfc3d['shaderProgram']=_0xbcfc3d['shaderProgram']&&_0xbcfc3d['shaderProgram']['destroy'](),this['_cubeMap']=this[_0x55558f(_0xd4933b._0x391aea)]&&this[_0x55558f(_0xd4933b._0x391aea)][_0x55558f(_0xd4933b._0x3b4589)](),this[_0x55558f(0x79d)]=this['_cubeMap2']&&this['_cubeMap2'][_0x55558f(_0xd4933b._0x3b4589)](),this[_0x55558f(_0xd4933b._0xf03a76)]=this['_cubeMap3']&&this[_0x55558f(_0xd4933b._0xf03a76)]['destroy'](),this['destroyObject'](this);}}class LocalWorldTransform{constructor(_0x26e26f,_0x4495ec){const _0x4f9baa={_0x2687a7:0x1071},_0x31624b=_0x3d5d32;_0x4495ec=_0x4495ec||Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'],this[_0x31624b(_0x4f9baa._0x2687a7)]=_0x4495ec(_0x26e26f),this['_inverseMatrix']=Cesium__namespace[_0x31624b(0xf5d)]['inverseTransformation'](this[_0x31624b(0x1071)],new Cesium__namespace['Matrix4']());}['localToWorld'](_0x5cec18,_0x292381){const _0xf2ef99={_0x2cc7d8:0xe95,_0x2972b6:0xc9f},_0x16c0a8=_0x3d5d32;return!_0x292381&&(_0x292381=new Cesium__namespace[(_0x16c0a8(_0xf2ef99._0x2cc7d8))]()),Cesium__namespace['Matrix4'][_0x16c0a8(_0xf2ef99._0x2972b6)](this['_matrix'],_0x5cec18,_0x292381),_0x292381;}['worldToLocal'](_0x48930d,_0x27ab5d){return!_0x27ab5d&&(_0x27ab5d=new Cesium__namespace['Cartesian3']()),Cesium__namespace['Matrix4']['multiplyByPoint'](this['_inverseMatrix'],_0x48930d,_0x27ab5d),_0x27ab5d;}}class MarsArray{constructor(){const _0x22f5c9=_0x3d5d32;this['_array']=[],this[_0x22f5c9(0xe6a)]={};}get['length'](){return this['_array']['length'];}get['values'](){const _0xad4cc1=_0x3d5d32;return this[_0xad4cc1(0xef5)];}['contains'](_0x169d48){const _0x25c6f6=_0x3d5d32;if(!_0x169d48)return![];return Cesium__namespace[_0x25c6f6(0xb84)](this['_hash'][_0x169d48]);}['set'](_0xac3b53,_0x3bb581){const _0x1e8a50={_0x1016a5:0xe6a,_0x6ca606:0xb75},_0x5ae365=_0x3d5d32,_0x4427f7=this[_0x5ae365(_0x1e8a50._0x1016a5)][_0xac3b53];_0x3bb581!==_0x4427f7&&(this['remove'](_0xac3b53),this['_hash'][_0xac3b53]=_0x3bb581,this['_array'][_0x5ae365(_0x1e8a50._0x6ca606)](_0x3bb581));}['getLast'](){const _0x3d0e0e=_0x3d5d32;return this['_array']['length']>0x0?this[_0x3d0e0e(0xef5)][this['_array']['length']-0x1]:undefined;}['get'](_0x1206ea){return _0x1206ea?this['_hash'][_0x1206ea]:undefined;}['getByAttr'](_0x200c0a,_0xb6fbb0='id',_0x129757='options'){const _0x36c0f7=_0x3d5d32;if(_0xb6fbb0==='id'&&this[_0x36c0f7(0xe6a)][_0x200c0a])return this[_0x36c0f7(0xe6a)][_0x200c0a];for(let _0x475851=0x0,_0x5e07cc=this[_0x36c0f7(0xef5)]['length'];_0x475851<_0x5e07cc;_0x475851++){const _0x4bb10d=this['_array'][_0x475851];if(_0x4bb10d[_0xb6fbb0]==_0x200c0a||_0x4bb10d[_0x129757]&&_0x4bb10d[_0x129757][_0xb6fbb0]==_0x200c0a)return _0x4bb10d;}return undefined;}['getListByAttr'](_0x3f4a2b,_0x3dca19='id',_0x46ef19='options'){const _0x25d215=_0x3d5d32,_0x41ad73=[];for(let _0x588e29=0x0,_0x4d8b37=this['_array']['length'];_0x588e29<_0x4d8b37;_0x588e29++){const _0x351e99=this[_0x25d215(0xef5)][_0x588e29];(_0x351e99[_0x3dca19]==_0x3f4a2b||_0x351e99[_0x46ef19]&&_0x351e99[_0x46ef19][_0x3dca19]==_0x3f4a2b)&&_0x41ad73['push'](_0x351e99);}return _0x41ad73;}['remove'](_0x626ffd){const _0x53b565={_0x5a410e:0xe6a,_0x60ff2e:0x1008},_0x45bf1c=_0x3d5d32;if(!this[_0x45bf1c(_0x53b565._0x5a410e)])return;const _0x6cb349=this['_hash'][_0x626ffd],_0xa8533d=Cesium__namespace['defined'](_0x6cb349);if(_0xa8533d){const _0x19baef=this['_array'];_0x19baef[_0x45bf1c(_0x53b565._0x60ff2e)](_0x19baef['indexOf'](_0x6cb349),0x1),delete this[_0x45bf1c(0xe6a)][_0x626ffd];}return _0xa8533d;}['forEach'](_0x18ad11,_0x47d6b0,_0x1bade5){const _0x44a8ad={_0x5f1e37:0xc84,_0x400cb7:0xef5,_0x2c60b:0xef5,_0x593b53:0xa86},_0x16c88a=_0x3d5d32;if(_0x1bade5)for(let _0x217b8b=this['_array'][_0x16c88a(_0x44a8ad._0x5f1e37)]-0x1;_0x217b8b>=0x0;_0x217b8b--){const _0x26ea51=this[_0x16c88a(_0x44a8ad._0x400cb7)][_0x217b8b];_0x18ad11[_0x16c88a(0xa86)](_0x47d6b0||this,_0x26ea51,_0x217b8b);}else for(let _0x2d78fd=0x0,_0x2e4008=this['_array']['length'];_0x2d78fd<_0x2e4008;_0x2d78fd++){const _0x314881=this[_0x16c88a(_0x44a8ad._0x2c60b)][_0x2d78fd];_0x18ad11[_0x16c88a(_0x44a8ad._0x593b53)](_0x47d6b0||this,_0x314881,_0x2d78fd);}}['removeAll'](){const _0x3844e1=_0x3d5d32,_0x2ad22b=this['_array'];_0x2ad22b['length']>0x0&&(this[_0x3844e1(0xe6a)]={},_0x2ad22b['length']=0x0);}[_0x3d5d32(0x689)](){const _0x3a9c98={_0x478c39:0xef5},_0x5c997f=_0x3d5d32;if(this[_0x5c997f(0xef5)]['length']>0x0&&this['_array'][0x0]['destroy']){this['remove']=function(){};for(let _0x330473=this['_array'][_0x5c997f(0xc84)]-0x1;_0x330473>=0x0;_0x330473--){const _0x17f8b6=this[_0x5c997f(_0x3a9c98._0x478c39)][_0x330473];if(_0x17f8b6!==null&&_0x17f8b6!==void 0x0&&_0x17f8b6['destroy'])try{_0x17f8b6[_0x5c997f(0x689)]();}catch(_0x36bc65){logWarn('MarsArray\x20item.destroy\x20异常',_0x36bc65);}}}this[_0x5c997f(0xeeb)]();for(const _0x3a91f9 in this){delete this[_0x3a91f9];}}}class Texture3{constructor(_0x3b0151={}){const _0x3340ba={_0x1df403:0xd6d,_0x33bef5:0x4e6,_0x29e7f4:0xa83,_0x23e63c:0x43d,_0x1173e8:0xeca,_0x22d77a:0xdab,_0x6353b7:0x303,_0x1efb16:0xb25,_0x3a494a:0x987},_0x1fd9de=_0x3d5d32,_0x2c7003=_0x3b0151['context'],_0x2c15ac=_0x2c7003['_gl'],_0x399d8=_0x3b0151[_0x1fd9de(0xf18)];let _0x38cf92=_0x3b0151['width'],_0x448621=_0x3b0151[_0x1fd9de(0x83e)],_0x519a6a=_0x3b0151[_0x1fd9de(_0x3340ba._0x1df403)];Cesium__namespace['defined'](_0x399d8)&&(!Cesium__namespace[_0x1fd9de(0xb84)](_0x38cf92)&&(_0x38cf92=Cesium__namespace['defaultValue'](_0x399d8['videoWidth'],_0x399d8[_0x1fd9de(0x1076)])),!Cesium__namespace[_0x1fd9de(0xb84)](_0x448621)&&(_0x448621=Cesium__namespace['defaultValue'](_0x399d8['videoHeight'],_0x399d8['height'])),!Cesium__namespace['defined'](_0x519a6a)&&(_0x519a6a=Cesium__namespace['defaultValue'](_0x399d8[_0x1fd9de(0xa36)],_0x399d8['depth'])));if(!Cesium__namespace['defined'](_0x38cf92)||!Cesium__namespace['defined'](_0x448621)||!Cesium__namespace['defined'](_0x519a6a))throw new Cesium__namespace['DeveloperError'](_0x1fd9de(0x3e1));const _0x50ad8d=Cesium__namespace['defaultValue'](_0x3b0151['pixelFormat'],Cesium__namespace['PixelFormat'][_0x1fd9de(0xf42)]),_0x26239d=Cesium__namespace['defaultValue'](_0x3b0151['pixelDatatype'],Cesium__namespace['PixelDatatype']['FLOAT']),_0xc3f721=Cesium__namespace[_0x1fd9de(0x2bb)]['toInternalFormat'](_0x50ad8d,_0x26239d,_0x2c7003),_0x891c8f=![],_0x2f2596=![];let _0x4e7b0a=0x4;Cesium__namespace[_0x1fd9de(0xb84)](_0x399d8)&&Cesium__namespace[_0x1fd9de(0xb84)](_0x399d8['arrayBufferView'])&&(_0x4e7b0a=Cesium__namespace['PixelFormat']['alignmentInBytes'](_0x50ad8d,_0x26239d,_0x38cf92));const _0x1d2637=_0x2c15ac['TEXTURE_3D'],_0x41c954=_0x2c15ac['createTexture']();_0x2c15ac['activeTexture'](_0x2c15ac[_0x1fd9de(_0x3340ba._0x33bef5)]),_0x2c15ac['bindTexture'](_0x1d2637,_0x41c954),_0x2c15ac[_0x1fd9de(0x32e)](_0x2c15ac[_0x1fd9de(0xe43)],_0x4e7b0a),_0x2c15ac['pixelStorei'](_0x2c15ac['UNPACK_COLORSPACE_CONVERSION_WEBGL'],_0x2c15ac[_0x1fd9de(_0x3340ba._0x29e7f4)]),_0x2c15ac[_0x1fd9de(0x32e)](_0x2c15ac[_0x1fd9de(_0x3340ba._0x23e63c)],_0x2f2596);if(Cesium__namespace['defined'](_0x399d8)&&Cesium__namespace['defined'](_0x399d8[_0x1fd9de(_0x3340ba._0x1173e8)])){const _0x5a9cdc=_0x399d8['arrayBufferView'];_0x2c15ac['texImage3D'](_0x1d2637,0x0,_0xc3f721,_0x38cf92,_0x448621,_0x519a6a,0x0,_0x50ad8d,Cesium__namespace['PixelDatatype'][_0x1fd9de(_0x3340ba._0x22d77a)](_0x26239d,_0x2c7003),_0x5a9cdc);}_0x2c15ac[_0x1fd9de(0x235)](_0x1d2637,null);const _0x3ae692=texture3DSizeInBytes(_0x50ad8d,_0x26239d,_0x38cf92,_0x448621,_0x519a6a);this['_id']=Cesium__namespace[_0x1fd9de(_0x3340ba._0x6353b7)](),this[_0x1fd9de(0x92b)]=_0x2c7003,this['_textureFilterAnisotropic']=_0x2c7003['_textureFilterAnisotropic'],this['_texture']=_0x41c954,this[_0x1fd9de(0x641)]=_0x1d2637,this['_internalFormat']=_0xc3f721,this['_pixelFormat']=_0x50ad8d,this[_0x1fd9de(0x7d3)]=_0x26239d,this[_0x1fd9de(0xce6)]=_0x38cf92,this[_0x1fd9de(0xecf)]=_0x448621,this['_depth']=_0x519a6a,this['_hasMipmap']=![],this['_sizeInBytes']=_0x3ae692,this['_preMultiplyAlpha']=_0x891c8f,this[_0x1fd9de(_0x3340ba._0x1efb16)]=_0x2f2596,this['_initialized']=!![],this[_0x1fd9de(_0x3340ba._0x3a494a)]=new Cesium__namespace['Cartesian3'](_0x38cf92,_0x448621,_0x519a6a),this['_sampler']=undefined,this['sampler']=Cesium__namespace[_0x1fd9de(0x501)](_0x3b0151['sampler'],new Cesium__namespace['Sampler']());}get['id'](){return this['_id'];}get['sampler'](){const _0x33aeca=_0x3d5d32;return this[_0x33aeca(0x5ef)];}set[_0x3d5d32(0x46d)](_0x3ed9ee){const _0x24b056={_0x1b3e94:0x7cc,_0x2b174d:0x92b,_0x1c3f5b:0x4e6,_0x6e1ff:0x1089,_0x4c77a4:0x451,_0x8fdf15:0x5ef},_0x28c1dc=_0x3d5d32,_0x10c5a7=_0x3ed9ee[_0x28c1dc(_0x24b056._0x1b3e94)],_0x55f6ea=_0x3ed9ee['magnificationFilter'],_0x30ffcc=this[_0x28c1dc(_0x24b056._0x2b174d)],_0x1802d4=_0x30ffcc['_gl'],_0x39187e=this['_textureTarget'];_0x1802d4['activeTexture'](_0x1802d4[_0x28c1dc(_0x24b056._0x1c3f5b)]),_0x1802d4['bindTexture'](_0x39187e,this['_texture']),_0x1802d4['texParameteri'](_0x39187e,_0x1802d4[_0x28c1dc(0x77d)],_0x10c5a7),_0x1802d4[_0x28c1dc(0x1089)](_0x39187e,_0x1802d4[_0x28c1dc(0xfae)],_0x55f6ea),_0x1802d4[_0x28c1dc(_0x24b056._0x6e1ff)](_0x39187e,_0x1802d4['TEXTURE_WRAP_S'],_0x3ed9ee['wrapS']),_0x1802d4['texParameteri'](_0x39187e,_0x1802d4['TEXTURE_WRAP_T'],_0x3ed9ee[_0x28c1dc(_0x24b056._0x4c77a4)]),_0x1802d4[_0x28c1dc(0x1089)](_0x39187e,_0x1802d4['TEXTURE_WRAP_R'],_0x1802d4['CLAMP_TO_EDGE']),_0x1802d4['bindTexture'](_0x39187e,null),this[_0x28c1dc(_0x24b056._0x8fdf15)]=_0x3ed9ee;}get['pixelFormat'](){return this['_pixelFormat'];}get['pixelDatatype'](){const _0x3a834e=_0x3d5d32;return this[_0x3a834e(0x7d3)];}get['dimensions'](){return this['_dimensions'];}get['height'](){return this['_height'];}get['depth'](){return this['_depth'];}get[_0x3d5d32(0x88d)](){return this['_preMultiplyAlpha'];}get[_0x3d5d32(0x440)](){return this['_flipY'];}get['sizeInBytes'](){const _0x3da6b2={_0x54784f:0xcc1},_0x3e2c18=_0x3d5d32;return this[_0x3e2c18(_0x3da6b2._0x54784f)];}get['_target'](){const _0x4680dc={_0x50ff4d:0x641},_0x4f28e8=_0x3d5d32;return this[_0x4f28e8(_0x4680dc._0x50ff4d)];}['isDestroyed'](){return![];}['destroy'](){const _0x415392={_0x340c66:0xf5f},_0x1b006b=_0x3d5d32;return this['_context']['_gl'][_0x1b006b(_0x415392._0x340c66)](this['_texture']),Cesium__namespace['destroyObject'](this);}}function texture3DSizeInBytes(_0x7c9232,_0x4fca3f,_0x49d881,_0x4f6353,_0x2c5f1c){const _0x22ad7b=_0x3d5d32,_0x9b29d1=Cesium__namespace['PixelFormat']['componentsLength'](_0x7c9232),_0x121608=Cesium__namespace['PixelDatatype'][_0x22ad7b(0xd94)](_0x4fca3f);return _0x49d881*_0x4f6353*_0x2c5f1c*_0x9b29d1*_0x121608;}const ChinaCRS={'WGS84':'WGS84','GCJ02':'GCJ02','BAIDU':'BD09'};let ion=_0x3d5d32(0x76e);function updateIon(_0x5b6830){const _0x5c2ac5={_0x117ed6:0x105e,_0x3e0f5b:0xb77},_0x305b4c=_0x3d5d32;ion=_0x5b6830,Cesium__namespace[_0x305b4c(_0x5c2ac5._0x117ed6)][_0x305b4c(_0x5c2ac5._0x3e0f5b)]=_0x5b6830;}let mapbox='sk.eyJ1IjoibWFyc2dpcyIsImEiOiJjbDFhYXQ3a2EwaHF6M2NvdnhmdjR6ajZ2In0.-sahm9R0QuPP3pAihJHC4A';function updateMapbox(_0x374cae){mapbox=_0x374cae;}let bing='Am5SdKm6pNdkP1P5zuUOMZwleCHeA7GD5vuQgZ3xBUbEMBeQ5cQ1WN4B8xqqV1Vt';function updateBing(_0x1e295d){bing=_0x1e295d;}const tiandituArr=[_0x3d5d32(0x8a7),'bcc62222fc634ec736589c483de933e6','d083e4cf30bfc438ef93436c10c2c20a',_0x3d5d32(0xd1c)];let tianditu=getArrayRandomOne(tiandituArr);function updateTianditu(_0x45bc9d){const _0x5d1e89=_0x3d5d32;tiandituArr[_0x5d1e89(0x1008)](0x0,tiandituArr['length']),Array['isArray'](_0x45bc9d)?_0x45bc9d['forEach'](_0x57003a=>{tiandituArr['push'](_0x57003a);}):tiandituArr[_0x5d1e89(0xb75)](_0x45bc9d),tianditu=getArrayRandomOne(tiandituArr);}const gaodeArr=[_0x3d5d32(0xa4a),'fe80f2290b380cfed86c62e3edec169e','65892a265537810eba29eeae73649a71','25962df421fcad3cc2a8ceb55aafd04f','6e5d9f46b78cfb5b5ab3d407dad8fd14','044b5684de2b2009a15084eb8b88f822','ad5f8b9d03f38f8f312025c80cfff4e3',_0x3d5d32(0x350)];let gaode=getArrayRandomOne(gaodeArr);function updateGaode(_0x39ec53){const _0x522f2f={_0x12b072:0x1008,_0x4fb6fb:0xc84,_0x1f06b2:0xb75},_0x1ec131={_0x2ad488:0xb75},_0x636b45=_0x3d5d32;gaodeArr[_0x636b45(_0x522f2f._0x12b072)](0x0,gaodeArr[_0x636b45(_0x522f2f._0x4fb6fb)]),Array[_0x636b45(0x62b)](_0x39ec53)?_0x39ec53[_0x636b45(0x1061)](_0x4cd62e=>{const _0x467f84=_0x636b45;gaodeArr[_0x467f84(_0x1ec131._0x2ad488)](_0x4cd62e);}):gaodeArr[_0x636b45(_0x522f2f._0x1f06b2)](_0x39ec53),gaode=getArrayRandomOne(gaodeArr);}const baiduArr=['LvhIlDXT60I3NePicXWQT5K0eHFCR4hD','nLUUSRsSBRSVmtxfaGKPaN3mXf6jiivf','qWM3MBm5oWLI06sa3A3otnpaxGQr8jIw','R7KAL3f6AttldwwicmVXnYkN7EHCY729'];let baidu=getArrayRandomOne(baiduArr);function updateBaidu(_0x220199){const _0x5b0f5b={_0x383d16:0xb75},_0x3636d6={_0x13c38a:0xb75},_0x2bfa89=_0x3d5d32;baiduArr[_0x2bfa89(0x1008)](0x0,baiduArr['length']),Array['isArray'](_0x220199)?_0x220199['forEach'](_0x31b745=>{const _0x3bf5d2=_0x2bfa89;baiduArr[_0x3bf5d2(_0x3636d6._0x13c38a)](_0x31b745);}):baiduArr[_0x2bfa89(_0x5b0f5b._0x383d16)](_0x220199),baidu=getArrayRandomOne(baiduArr);}function updateAll(_0x41b046){const _0x1cbeae={_0x1ba27f:0xc30,_0x114145:0x81f,_0x5b91e0:0xa3a},_0x373602=_0x3d5d32;_0x41b046['tianditu']&&updateTianditu(_0x41b046[_0x373602(_0x1cbeae._0x1ba27f)]),_0x41b046[_0x373602(_0x1cbeae._0x114145)]&&updateGaode(_0x41b046['gaode']),_0x41b046['baidu']&&updateBaidu(_0x41b046['baidu']),_0x41b046['ion']&&updateIon(_0x41b046[_0x373602(_0x1cbeae._0x5b91e0)]),_0x41b046['mapbox']&&updateMapbox(_0x41b046['mapbox']),_0x41b046['bing']&&updateBing(_0x41b046['bing']);}var Token={'__proto__':null,get 'ion'(){return ion;},'updateIon':updateIon,get 'mapbox'(){return mapbox;},'updateMapbox':updateMapbox,get 'bing'(){return bing;},'updateBing':updateBing,'tiandituArr':tiandituArr,get 'tianditu'(){return tianditu;},'updateTianditu':updateTianditu,'gaodeArr':gaodeArr,get 'gaode'(){return gaode;},'updateGaode':updateGaode,'baiduArr':baiduArr,get 'baidu'(){return baidu;},'updateBaidu':updateBaidu,'updateAll':updateAll};const Color$2=Cesium__namespace['Material'][_0x3d5d32(0x4ad)],PolylineDash=Cesium__namespace[_0x3d5d32(0xc6b)]['PolylineDashType'],LineDotDash='LineDotDash',PolylineOutline=Cesium__namespace['Material']['PolylineOutlineType'],PolylineArrow=Cesium__namespace[_0x3d5d32(0xc6b)]['PolylineArrowType'],PolylineGlow=Cesium__namespace['Material']['PolylineGlowType'],LineFlow='LineFlow',LineFlowColor='LineFlowColor',ODLine=_0x3d5d32(0xdeb),LineFlicker='LineFlicker',LineTrail='LineTrail',LineBloom=_0x3d5d32(0x671),DigitalFlow=_0x3d5d32(0x3d8),LineThreeDash='LineThreeDash',WallScroll='WallScroll',Image$1=Cesium__namespace['Material']['ImageType'],Image2='Image2',Text='Text',Grid=Cesium__namespace[_0x3d5d32(0xc6b)]['GridType'],Checkerboard=Cesium__namespace['Material'][_0x3d5d32(0x2a9)],Stripe=Cesium__namespace['Material'][_0x3d5d32(0xe40)],PolyGradient=_0x3d5d32(0xc47),PolyAsphalt='PolyAsphalt',PolyBlob=_0x3d5d32(0x332),PolyFacet='PolyFacet',PolyGrass='PolyGrass',PolyWood='PolyWood',NeonLight=_0x3d5d32(0x729),Water$1=Cesium__namespace[_0x3d5d32(0xc6b)]['WaterType'],WaterLight='WaterLight',RectSlide=_0x3d5d32(0xae1),ScanLine='ScanLine',CircleScan=_0x3d5d32(0xf91),CircleWave='CircleWave',RadarLine='RadarLine',RadarWave=_0x3d5d32(0x9fb),CylinderWave='CylinderWave',EllipsoidElectric='EllipsoidElectric',EllipsoidWave='EllipsoidWave';var MaterialType$1={'__proto__':null,'Color':Color$2,'PolylineDash':PolylineDash,'LineDotDash':LineDotDash,'PolylineOutline':PolylineOutline,'PolylineArrow':PolylineArrow,'PolylineGlow':PolylineGlow,'LineFlow':LineFlow,'LineFlowColor':LineFlowColor,'ODLine':ODLine,'LineFlicker':LineFlicker,'LineTrail':LineTrail,'LineBloom':LineBloom,'DigitalFlow':DigitalFlow,'LineThreeDash':LineThreeDash,'WallScroll':WallScroll,'Image':Image$1,'Image2':Image2,'Text':Text,'Grid':Grid,'Checkerboard':Checkerboard,'Stripe':Stripe,'PolyGradient':PolyGradient,'PolyAsphalt':PolyAsphalt,'PolyBlob':PolyBlob,'PolyFacet':PolyFacet,'PolyGrass':PolyGrass,'PolyWood':PolyWood,'NeonLight':NeonLight,'Water':Water$1,'WaterLight':WaterLight,'RectSlide':RectSlide,'ScanLine':ScanLine,'CircleScan':CircleScan,'CircleWave':CircleWave,'RadarLine':RadarLine,'RadarWave':RadarWave,'CylinderWave':CylinderWave,'EllipsoidElectric':EllipsoidElectric,'EllipsoidWave':EllipsoidWave};const LayerType={},ControlType={},EffectType={},LangType={'ZH':0x0,'ZHHK':0x1,'EN':0x2},MoveType={'ENLARGE':0x0,'NARROW':0x1,'LEFT_ROTATE':0x2,'RIGHT_ROTATE':0x3,'TOP_ROTATE':0x4,'BOTTOM_ROTATE':0x5},ClipType={'Z':0x1,'ZR':0x2,'X':0x3,'XR':0x4,'Y':0x5,'YR':0x6},Icon={'Delete':'fa\x20fa-trash-o','Coordinates':'fa\x20fa-info-circle','CameraInfo':'fa\x20fa-camera-retro','Camera':'fa\x20fa-street-view','UndergroundNo':'fa\x20fa-ban','UndergroundYes':'fa\x20fa-sort-amount-desc','RotatePointStart':'fa\x20fa-retweet','RotatePointStop':'fa\x20fa-remove','FlyToPoint':'fa\x20fa-send-o','FirstPerspective':'fa\x20fa-male','KeyboardRoamYes':'fa\x20fa-keyboard-o','KeyboardRoamNo':_0x3d5d32(0x439),'TrackedEntityYes':_0x3d5d32(0x50a),'TrackedEntityNo':_0x3d5d32(0x6db),'Tileset':_0x3d5d32(0x319),'TilesetWireframeYes':'fa\x20fa-connectdevelop','TilesetWireframeNo':'fa\x20fa-connectdevelop','TilesetBoundingVolumeYes':'fa\x20fa-codepen','TilesetBoundingVolumeNo':'fa\x20fa-codepen','Terrain':'fa\x20fa-globe','TerrainYes':_0x3d5d32(0xa49),'TerrainNo':'fa\x20fa-medium','TerrainWireframeYes':_0x3d5d32(0x4a9),'TerrainWireframeNo':_0x3d5d32(0x4a9),'Measure':'fa\x20fa-share-alt','MeasureDistance':'fa\x20fa-minus','MeasureArea':'fa\x20fa-medium','MeasureHeight':'fa\x20fa-sort-amount-asc','MeasureAngle':'fa\x20fa-road','Draw':_0x3d5d32(0x791),'DrawPoint':'fa\x20fa-map-marker','DrawPolyline':_0x3d5d32(0xfad),'DrawPolygon':'fa\x20fa-medium','DrawCircle':'fa\x20fa-genderless','DrawRectangle':_0x3d5d32(0x3fb),'DrawEditYes':'fa\x20fa-pencil','DrawEditNo':_0x3d5d32(0x1de),'DrawDownJson':_0x3d5d32(0x653),'Effect':'fa\x20fa-rss','RainEffectYes':'fa\x20fa-tint','RainEffectNo':_0x3d5d32(0x3b8),'SnowEffectYes':_0x3d5d32(0x1f1),'SnowEffectNo':'fa\x20fa-yelp','FogEffectYes':'fa\x20fa-spinner','FogEffectNo':'fa\x20fa-spinner','BloomEffectYes':'fa\x20fa-bullseye','BloomEffectNo':'fa\x20fa-bullseye','BrightnessEffectYes':'fa\x20fa-trello','BrightnessEffectNo':_0x3d5d32(0x7fb),'NightVisionEffectYes':'fa\x20fa-dashboard','NightVisionEffectNo':_0x3d5d32(0xfcd),'BlackAndWhiteEffectYes':_0x3d5d32(0x688),'BlackAndWhiteEffectNo':'fa\x20fa-star-half-full','OutlineEffectYes':'fa\x20fa-ticket','OutlineEffectNo':_0x3d5d32(0x6b3),'Scene':'fa\x20fa-gear','DepthTestYes':'fa\x20fa-eye-slash','DepthTestNo':_0x3d5d32(0x3ea),'SkyBoxYes':'fa\x20fa-moon-o','SkyBoxNo':_0x3d5d32(0xb90),'ShadowYes':'fa\x20fa-sun-o','ShadowNo':'fa\x20fa-sun-o','SkyAtmosphereYes':_0x3d5d32(0xe14),'SkyAtmosphereNo':_0x3d5d32(0xe14),'ExpImage':_0x3d5d32(0x1086)};function create$3(_0x2627bf,_0x42038f,_0x5cd774){const _0x4a8432={_0xef0628:0x3dc,_0x4a030a:0xdc3,_0x42f15f:0x85b},_0xa51b1a=_0x3d5d32,_0x3356ac=document[_0xa51b1a(_0x4a8432._0xef0628)](_0x2627bf);return _0x3356ac[_0xa51b1a(_0x4a8432._0x4a030a)]=_0x42038f||'',_0x5cd774&&_0x5cd774[_0xa51b1a(_0x4a8432._0x42f15f)](_0x3356ac),_0x3356ac;}function createSvg(_0x1695eb,_0x10835c,_0x59e8cc,_0x2f4e8c){const _0x380161={_0x2bd742:0xc36,_0xb06989:0x1076,_0x2e5c0e:0x83e},_0xe363ed=_0x3d5d32,_0x3fc1b3=document['createElementNS']('http://www.w3.org/2000/svg','svg:svg');_0x3fc1b3['setAttribute'](_0xe363ed(_0x380161._0x2bd742),'svg-path'),_0x3fc1b3['setAttribute'](_0xe363ed(_0x380161._0xb06989),_0x1695eb),_0x3fc1b3['setAttribute'](_0xe363ed(_0x380161._0x2e5c0e),_0x10835c),_0x3fc1b3['setAttribute']('viewBox','0\x200\x20'+_0x1695eb+'\x20'+_0x10835c);const _0x4b6b0d=document['createElementNS']('http://www.w3.org/2000/svg','path');return _0x4b6b0d['setAttribute']('d',_0x59e8cc),_0x3fc1b3['appendChild'](_0x4b6b0d),_0x2f4e8c&&_0x2f4e8c['appendChild'](_0x3fc1b3),_0x3fc1b3;}function createVideo(_0x13db32,_0x5730c0,_0x261efe,_0x3ee77b){const _0x9dbe98={_0x556b5a:0x2b1,_0x1df1e2:0xc84},_0x56e38f=_0x3d5d32,_0x2c7f30=create$3('video',_0x261efe,_0x3ee77b);_0x2c7f30[_0x56e38f(0xd85)]('autoplay',!![]),_0x2c7f30['setAttribute']('loop',!![]),_0x2c7f30[_0x56e38f(0xd85)](_0x56e38f(0x100d),!![]);!_0x5730c0&&(_0x5730c0=_0x13db32['substring'](_0x13db32[_0x56e38f(_0x9dbe98._0x556b5a)]('.')+0x1,_0x13db32[_0x56e38f(_0x9dbe98._0x1df1e2)]));const _0x275c18=create$3('source','',_0x2c7f30);return _0x275c18['setAttribute']('src',_0x13db32),_0x275c18['setAttribute']('type','video/'+_0x5730c0),_0x2c7f30;}function get(_0x38617f){const _0x499a56=_0x3d5d32;return typeof _0x38617f==='string'?document[_0x499a56(0xc05)](_0x38617f):_0x38617f;}function parseDom(_0x47457f,_0x5a33f1,_0x327c74){const _0x21912a=_0x3d5d32,_0x1345f9=document['createElement']('div');return _0x327c74&&(_0x1345f9[_0x21912a(0xdc3)]=_0x327c74),_0x1345f9['innerHTML']=_0x47457f,_0x5a33f1?_0x1345f9:_0x1345f9['childNodes'];}function remove(_0x5b3bd2){const _0x3b3afd=_0x3d5d32;_0x5b3bd2=get(_0x5b3bd2);if(!_0x5b3bd2)return;const _0x340d04=_0x5b3bd2[_0x3b3afd(0x225)];_0x340d04&&_0x340d04['removeChild'](_0x5b3bd2);}function empty(_0x3158c7){while(_0x3158c7['firstChild']){_0x3158c7['removeChild'](_0x3158c7['firstChild']);}}function getStyle(_0x3ef8f6,_0x441c4){const _0x86ff7a={_0x5aad85:0xdde,_0x45041a:0xc10,_0x133da6:0xe2a,_0x3765e8:0x423},_0x564b21=_0x3d5d32;let _0x16e5fa=_0x3ef8f6[_0x564b21(_0x86ff7a._0x5aad85)][_0x441c4]||_0x3ef8f6['currentStyle']&&_0x3ef8f6[_0x564b21(0xeb8)][_0x441c4];if((!_0x16e5fa||_0x16e5fa==='auto')&&document[_0x564b21(_0x86ff7a._0x45041a)]){const _0x1fe267=document[_0x564b21(0xc10)][_0x564b21(_0x86ff7a._0x133da6)](_0x3ef8f6,null);_0x16e5fa=_0x1fe267?_0x1fe267[_0x441c4]:null;}return _0x16e5fa===_0x564b21(_0x86ff7a._0x3765e8)?null:_0x16e5fa;}function hasClass(_0x425f5b,_0x2b1073){const _0x311012={_0x507ad1:0x9c1,_0x23a958:0xc84},_0x1a1516=_0x3d5d32;if(!_0x425f5b)return![];if(_0x425f5b['classList']!==undefined)return _0x425f5b[_0x1a1516(_0x311012._0x507ad1)][_0x1a1516(0x3f1)](_0x2b1073);const _0x2aa154=getClass$3(_0x425f5b);return _0x2aa154[_0x1a1516(_0x311012._0x23a958)]>0x0&&new RegExp('(^|\x5cs)'+_0x2b1073+_0x1a1516(0x48f))['test'](_0x2aa154);}function addClass(_0x177291,_0x3856a1){const _0x5a8788={_0x32f616:0xc84},_0x4cabac=_0x3d5d32;if(!_0x177291)return;if(_0x177291['classList']!==undefined){const _0x4d91ef=splitWords(_0x3856a1);for(let _0x4cc7ec=0x0,_0x2f8cb8=_0x4d91ef[_0x4cabac(_0x5a8788._0x32f616)];_0x4cc7ec<_0x2f8cb8;_0x4cc7ec++){_0x177291['classList']['add'](_0x4d91ef[_0x4cc7ec]);}}else{if(!hasClass(_0x177291,_0x3856a1)){const _0x329780=getClass$3(_0x177291);setClass(_0x177291,(_0x329780?_0x329780+'\x20':'')+_0x3856a1);}}}function removeClass(_0x404383,_0x2caec9){const _0x32e05b={_0x477839:0xbb6},_0x20800c=_0x3d5d32;if(!_0x404383)return;_0x404383[_0x20800c(0x9c1)]!==undefined?_0x404383['classList']['remove'](_0x2caec9):setClass(_0x404383,trim(('\x20'+getClass$3(_0x404383)+'\x20')[_0x20800c(_0x32e05b._0x477839)]('\x20'+_0x2caec9+'\x20','\x20')));}function setClass(_0x13ff7b,_0x302545){!_0x13ff7b['className']||!_0x13ff7b['className']['baseVal']?_0x13ff7b['className']=_0x302545:_0x13ff7b['className']['baseVal']=_0x302545;}function getClass$3(_0x11ca1a){const _0x22d738={_0xb879fa:0xc94},_0xc4babb=_0x3d5d32;var _0x5956f9;return _0x11ca1a[_0xc4babb(_0x22d738._0xb879fa)]&&(_0x11ca1a=_0x11ca1a['correspondingElement']),(_0x5956f9=_0x11ca1a[_0xc4babb(0xdc3)])!==null&&_0x5956f9!==void 0x0&&_0x5956f9['baseVal']?_0x11ca1a['className']['baseVal']:_0x11ca1a['className'];}function copyCanvas(_0x57560f){const _0x4a5110={_0x2f4d6a:0x83e},_0x40c68a=_0x3d5d32,_0x51677a=_0x57560f['getContext']('2d',{'willReadFrequently':!![]})['getImageData'](0x0,0x0,_0x57560f['width'],_0x57560f['height']),_0x7a25a0=document[_0x40c68a(0x3dc)]('canvas');_0x7a25a0['width']=_0x57560f['width'],_0x7a25a0['height']=_0x57560f['height'];const _0x58409e=_0x7a25a0[_0x40c68a(0xf58)]('2d',{'willReadFrequently':!![]});return _0x58409e['clearRect'](0x0,0x0,_0x7a25a0['width'],_0x7a25a0[_0x40c68a(_0x4a5110._0x2f4d6a)]),_0x58409e['putImageData'](_0x51677a,0x0,0x0),_0x7a25a0;}var DomUtil={'__proto__':null,'create':create$3,'createSvg':createSvg,'createVideo':createVideo,'get':get,'parseDom':parseDom,'remove':remove,'empty':empty,'getStyle':getStyle,'hasClass':hasClass,'addClass':addClass,'removeClass':removeClass,'setClass':setClass,'getClass':getClass$3,'copyCanvas':copyCanvas};function getCenter(_0x42dfd7){const _0x2cc441={_0x382488:0xb0e},_0x463872=_0x3d5d32;try{const _0x1dbb54=_0x42dfd7['canvas'],_0x6f0f40=new Cesium__namespace[(_0x463872(_0x2cc441._0x382488))](_0x1dbb54[_0x463872(0xe0f)]/0x2,_0x1dbb54['clientHeight']/0x2),_0x1016e7=_0x42dfd7['camera'][_0x463872(0x352)](_0x6f0f40);let _0x559360=_0x42dfd7['globe'][_0x463872(0x1037)](_0x1016e7,_0x42dfd7);return!_0x559360&&(_0x559360=_0x42dfd7['camera']['pickEllipsoid'](_0x6f0f40)),_0x559360?LngLatPoint[_0x463872(0xd14)](_0x559360):undefined;}catch(_0x1534dd){return undefined;}}function getExtent(_0x272f2e,_0x3c1363={}){const _0x28cd4c={_0xb12300:0xa9f,_0x389ecd:0x103e,_0x18d83f:0xbfd,_0x28168c:0xa1f,_0x1f87cb:0xe8e,_0x2ecc50:0x83e,_0x15b588:0x406,_0x962015:0x99b,_0x5706b4:0x435,_0x584422:0x83e,_0x29a17b:0x1058,_0xb8ca00:0x525,_0x13568e:0x57e,_0x8ff722:0x1058,_0x5588c1:0x57e,_0x4312f2:0x470,_0x5172d7:0xf6e},_0x3b511b=_0x3d5d32,_0x33f808={'xmin':0x46,'xmax':0x8c,'ymin':0x0,'ymax':0x37,'height':0x0},_0x222b35=_0x272f2e['scene'],_0x539447=_0x222b35['globe']['ellipsoid'],_0x47c6b3=_0x222b35['canvas'],_0x1f14f5=_0x272f2e[_0x3b511b(0x435)]['pickEllipsoid'](new Cesium__namespace['Cartesian2'](0x0,0x0),_0x539447);if(_0x1f14f5){const _0x55abc5=_0x539447[_0x3b511b(_0x28cd4c._0xb12300)](_0x1f14f5);_0x33f808[_0x3b511b(0x525)]=Cesium__namespace[_0x3b511b(_0x28cd4c._0x389ecd)]['toDegrees'](_0x55abc5[_0x3b511b(_0x28cd4c._0x18d83f)]),_0x33f808['ymax']=Cesium__namespace[_0x3b511b(0x103e)][_0x3b511b(_0x28cd4c._0x28168c)](_0x55abc5[_0x3b511b(0x406)]),_0x33f808['height']=Math[_0x3b511b(_0x28cd4c._0x1f87cb)](_0x33f808[_0x3b511b(0x83e)],_0x55abc5[_0x3b511b(_0x28cd4c._0x2ecc50)]);}else{const _0x39c7a4=_0x47c6b3['width']/0x2,_0x10617b=_0x47c6b3['height']/0x2;let _0x21f5e4;for(let _0x43abde=0x0;_0x43abde<=_0x10617b;_0x43abde+=0xa){const _0x26128a=_0x43abde<=_0x39c7a4?_0x43abde:_0x39c7a4;_0x21f5e4=_0x272f2e['camera']['pickEllipsoid'](new Cesium__namespace['Cartesian2'](_0x26128a,_0x43abde),_0x539447);if(_0x21f5e4)break;}if(_0x21f5e4){const _0x4b03b4=_0x539447['cartesianToCartographic'](_0x21f5e4);_0x33f808['xmin']=Cesium__namespace['Math']['toDegrees'](_0x4b03b4[_0x3b511b(0xbfd)]),_0x33f808[_0x3b511b(0x1058)]=Cesium__namespace[_0x3b511b(0x103e)]['toDegrees'](_0x4b03b4[_0x3b511b(_0x28cd4c._0x15b588)]),_0x33f808['height']=Math[_0x3b511b(0xe8e)](_0x33f808['height'],_0x4b03b4['height']);}}const _0x3affb5=_0x272f2e['camera'][_0x3b511b(_0x28cd4c._0x962015)](new Cesium__namespace['Cartesian2'](_0x47c6b3[_0x3b511b(0x1076)],_0x47c6b3['height']),_0x539447);if(_0x3affb5){const _0x2b61c8=_0x539447['cartesianToCartographic'](_0x3affb5);_0x33f808['xmax']=Cesium__namespace['Math']['toDegrees'](_0x2b61c8['longitude']),_0x33f808['ymin']=Cesium__namespace['Math']['toDegrees'](_0x2b61c8[_0x3b511b(_0x28cd4c._0x15b588)]),_0x33f808['height']=Math['max'](_0x33f808[_0x3b511b(0x83e)],_0x2b61c8[_0x3b511b(0x83e)]);}else{const _0x35af48=_0x47c6b3[_0x3b511b(0x1076)]/0x2,_0x8baa6=_0x47c6b3['height']/0x2;let _0x494163;for(let _0x332be5=_0x47c6b3[_0x3b511b(0x83e)];_0x332be5>=_0x8baa6;_0x332be5-=0xa){const _0x1e1111=_0x332be5>=_0x35af48?_0x332be5:_0x35af48;_0x494163=_0x272f2e[_0x3b511b(_0x28cd4c._0x5706b4)]['pickEllipsoid'](new Cesium__namespace['Cartesian2'](_0x1e1111,_0x332be5),_0x539447);if(_0x494163)break;}if(_0x494163){const _0x4ece63=_0x539447['cartesianToCartographic'](_0x494163);_0x33f808['xmax']=Cesium__namespace['Math']['toDegrees'](_0x4ece63['longitude']),_0x33f808['ymin']=Cesium__namespace['Math']['toDegrees'](_0x4ece63['latitude']),_0x33f808['height']=Math['max'](_0x33f808[_0x3b511b(_0x28cd4c._0x584422)],_0x4ece63['height']);}}if(!_0x33f808)return;if(_0x33f808['xmax']<_0x33f808[_0x3b511b(0x525)]){const _0x147183=_0x33f808['xmax'];_0x33f808['xmax']=_0x33f808[_0x3b511b(0x525)],_0x33f808['xmin']=_0x147183;}if(_0x33f808['ymax']<_0x33f808[_0x3b511b(0x470)]){const _0x4910ee=_0x33f808['ymax'];_0x33f808[_0x3b511b(_0x28cd4c._0x29a17b)]=_0x33f808['ymin'],_0x33f808['ymin']=_0x4910ee;}if(Cesium__namespace['defined'](_0x3c1363['scale'])){const _0x79604=_0x3c1363['scale'],_0x424325=(_0x33f808['xmax']-_0x33f808[_0x3b511b(_0x28cd4c._0xb8ca00)])/0x2*_0x79604,_0xb31c7a=(_0x33f808['ymax']-_0x33f808['ymin'])/0x2*_0x79604;_0x33f808['xmin']-=_0x424325,_0x33f808[_0x3b511b(_0x28cd4c._0x13568e)]+=_0x424325,_0x33f808['ymin']-=_0xb31c7a,_0x33f808[_0x3b511b(_0x28cd4c._0x8ff722)]+=_0xb31c7a;}return _0x3c1363['formatNum']&&(_0x33f808['xmin']=formatNum$1(_0x33f808['xmin'],LngLatPoint['FormatLength']),_0x33f808['xmax']=formatNum$1(_0x33f808[_0x3b511b(_0x28cd4c._0x5588c1)],LngLatPoint['FormatLength']),_0x33f808['ymin']=formatNum$1(_0x33f808[_0x3b511b(_0x28cd4c._0x4312f2)],LngLatPoint[_0x3b511b(_0x28cd4c._0x5172d7)]),_0x33f808['ymax']=formatNum$1(_0x33f808['ymax'],LngLatPoint['FormatLength'])),_0x33f808;}function getCameraView(_0x4e05bd,_0x19085e){const _0x2b9002={_0x5f2a5d:0xa1f,_0x2ca899:0xd29,_0x3a582e:0x5cf,_0x5ce861:0xa1f},_0x15a58f=_0x3d5d32,_0x5affc3=_0x4e05bd['positionCartographic'],_0x494b13={};return _0x494b13[_0x15a58f(0xd57)]=formatNum$1(Cesium__namespace['Math'][_0x15a58f(_0x2b9002._0x5f2a5d)](_0x5affc3[_0x15a58f(0x406)]),LngLatPoint['FormatLength']),_0x494b13['lng']=formatNum$1(Cesium__namespace['Math'][_0x15a58f(0xa1f)](_0x5affc3['longitude']),LngLatPoint['FormatLength']),(_0x19085e===null||_0x19085e===void 0x0?void 0x0:_0x19085e['simplify'])??!![]?(_0x494b13[_0x15a58f(_0x2b9002._0x2ca899)]=formatNum$1(_0x5affc3['height'],0x1),_0x494b13['heading']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4e05bd['heading']||0x0)%0x168,0x1),_0x494b13['pitch']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4e05bd[_0x15a58f(_0x2b9002._0x3a582e)]||0x0)%0x168,0x1)):(_0x494b13['alt']=formatNum$1(_0x5affc3['height'],LngLatPoint['FormatAltLength']),_0x494b13[_0x15a58f(0xe39)]=formatNum$1(Cesium__namespace['Math'][_0x15a58f(_0x2b9002._0x5ce861)](_0x4e05bd['heading']||0x0)%0x168,0x2),_0x494b13['pitch']=formatNum$1(Cesium__namespace['Math'][_0x15a58f(_0x2b9002._0x5ce861)](_0x4e05bd['pitch']||0x0)%0x168,0x2),_0x494b13['roll']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4e05bd[_0x15a58f(0x952)]||0x0)%0x168,0x2)),_0x494b13;}function expImage(_0x3e97cd,_0x1ba8a7={}){const _0x465f0c={_0x428fd5:0x7f5,_0x18e4ec:0xd2d};return new Promise((_0x26578d,_0x427001)=>{const _0x2f459f={_0x2b74ca:0xb84,_0x58fba2:0x101a,_0x1b39fb:0x83e,_0x56530a:0xbba,_0x2186a6:0x83e,_0x30664e:0x7f5,_0x2ee0bf:0x463},_0xc5abda=_0x4132;_0x1ba8a7['download']=_0x1ba8a7[_0xc5abda(0xd9e)]??!![],_0x1ba8a7['type']=_0x1ba8a7['type']??'image/jpeg',_0x3e97cd['render']();const _0x2b69fb=_0x3e97cd['canvas']['toDataURL'](_0x1ba8a7[_0xc5abda(_0x465f0c._0x428fd5)],_0x1ba8a7['encoderOptions']),_0x549d78=_0x3e97cd['canvas'][_0xc5abda(0x83e)],_0x5ef8b1=_0x3e97cd[_0xc5abda(0x60f)][_0xc5abda(0x1076)];if(Cesium__namespace['defined'](_0x1ba8a7['width'])||Cesium__namespace['defined'](_0x1ba8a7['height'])){const _0x2da478=new Image();_0x2da478['onload']=function(){const _0x4bccad=_0xc5abda;let _0xe8fd42,_0x5c6ae7;if(Cesium__namespace[_0x4bccad(_0x2f459f._0x2b74ca)](_0x1ba8a7['width'])&&!Cesium__namespace['defined'](_0x1ba8a7['height']))_0xe8fd42=_0x1ba8a7['width'],_0x5c6ae7=Math[_0x4bccad(_0x2f459f._0x58fba2)](_0xe8fd42*_0x549d78/_0x5ef8b1);else{if(Cesium__namespace['defined'](_0x1ba8a7['height'])&&!Cesium__namespace['defined'](_0x1ba8a7['width']))_0x5c6ae7=_0x1ba8a7['height'],_0xe8fd42=Math['round'](_0x5c6ae7*_0x5ef8b1/_0x549d78);else{const _0x876bbb=_0x1ba8a7['width']/_0x5ef8b1,_0x8ef452=_0x1ba8a7[_0x4bccad(_0x2f459f._0x1b39fb)]/_0x549d78;_0x876bbb>_0x8ef452?(_0xe8fd42=_0x1ba8a7['width'],_0x5c6ae7=Math['round'](_0xe8fd42*_0x549d78/_0x5ef8b1)):(_0x5c6ae7=_0x1ba8a7['height'],_0xe8fd42=Math['round'](_0x5c6ae7*_0x5ef8b1/_0x549d78));}}const _0x4c6d1f=document['createElement']('canvas');_0x4c6d1f['width']=_0x1ba8a7['width']||_0xe8fd42,_0x4c6d1f['height']=_0x1ba8a7['height']||_0x5c6ae7;const _0x438ec5=_0x4c6d1f['getContext']('2d',{'willReadFrequently':!![]}),_0x195d0e=(_0x4c6d1f['width']-_0xe8fd42)/0x2,_0x4be0c7=(_0x4c6d1f['height']-_0x5c6ae7)/0x2;_0x438ec5[_0x4bccad(0x67d)](_0x2da478,_0x195d0e,_0x4be0c7,_0xe8fd42,_0x5c6ae7);const _0x130f6e=_0x4c6d1f['toDataURL'](_0x1ba8a7['type'],_0x1ba8a7['encoderOptions']);!_0x1ba8a7[_0x4bccad(_0x2f459f._0x56530a)]&&(_0x1ba8a7[_0x4bccad(_0x2f459f._0x56530a)]='场景出图_'+_0x4c6d1f['width']+'x'+_0x4c6d1f[_0x4bccad(_0x2f459f._0x2186a6)]);if(_0x1ba8a7['download']){let _0x3cb25a=_0x1ba8a7[_0x4bccad(_0x2f459f._0x56530a)];_0x1ba8a7[_0x4bccad(_0x2f459f._0x30664e)]===_0x4bccad(0xf98)&&(_0x3cb25a=_0x3cb25a+'.jpg'),downloadBase64Image(_0x3cb25a,_0x130f6e);}const _0x4afdaa={'image':_0x130f6e,'width':_0x4c6d1f['width'],'height':_0x4c6d1f['height']};_0x1ba8a7[_0x4bccad(_0x2f459f._0x2ee0bf)]&&_0x1ba8a7['callback'](_0x4afdaa),_0x26578d(_0x4afdaa);},_0x2da478[_0xc5abda(0x95d)]=_0x2b69fb;}else{!_0x1ba8a7['filename']&&(_0x1ba8a7['filename']=_0xc5abda(_0x465f0c._0x18e4ec)+_0x5ef8b1+'x'+_0x549d78);_0x1ba8a7[_0xc5abda(0xd9e)]&&downloadBase64Image(_0x1ba8a7['filename'],_0x2b69fb);const _0x125565={'image':_0x2b69fb,'width':_0x5ef8b1,'height':_0x549d78};_0x1ba8a7['callback']&&_0x1ba8a7['callback'](_0x125565),_0x26578d(_0x125565);}});}function pick3DTileset(_0x3e0584,_0x14f42d){const _0xfb973a=_0x3d5d32;if(!_0x14f42d)return null;_0x14f42d instanceof Cesium__namespace['Cartesian3']&&(_0x14f42d=[_0x14f42d]);for(let _0x4ccc33=0x0,_0x147c2f=_0x14f42d[_0xfb973a(0xc84)];_0x4ccc33<_0x147c2f;++_0x4ccc33){const _0x36240f=_0x14f42d[_0x4ccc33],_0xead22f=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](_0x3e0584,_0x36240f);if(!Cesium__namespace['defined'](_0xead22f))continue;const _0x1ae464=_0x3e0584['pick'](_0xead22f,0xa,0xa);if(Cesium__namespace[_0xfb973a(0xb84)](_0x1ae464)&&Cesium__namespace['defined'](_0x1ae464[_0xfb973a(0x8ec)])&&_0x1ae464[_0xfb973a(0x8ec)]instanceof Cesium__namespace['Cesium3DTileset'])return _0x1ae464['primitive'];}return null;}class SurfacePoint{constructor(_0x5cfa40){const _0x26748f={_0x24bdad:0x7e1,_0x38d58a:0x6c6},_0x1c6550=_0x3d5d32;this['options']=_0x5cfa40,this[_0x1c6550(0xfc1)]=_0x5cfa40[_0x1c6550(_0x26748f._0x24bdad)]?_0x5cfa40['map']['scene']:_0x5cfa40['scene'],!this['scene']&&logError$1('SurfacePoint:\x20请传入scene参数',this['options']),this[_0x1c6550(0xe7f)]=LngLatPoint['parse'](_0x5cfa40['position']),this['_point']&&(this[_0x1c6550(0x87d)]=this['_point']['toCartesian'](),this['_cartographic']=this['_point']['toCartographic'](),this[_0x1c6550(_0x26748f._0x38d58a)]=this['_point']['alt']);}[_0x3d5d32(0xf6d)](){const _0x138874={_0x1279cc:0xe7f,_0x28db13:0x433,_0x429732:0x87d,_0x59ae93:0xfc1};return new Promise((_0x587627,_0x3cbced)=>{const _0x22d645=_0x4132;this['_promise']={'resolve':_0x587627,'reject':_0x3cbced};if(!this[_0x22d645(_0x138874._0x1279cc)]){_0x587627({'height':0x0});return;}const _0x2679da=this[_0x22d645(_0x138874._0x28db13)]['has3dtiles']??Cesium__namespace['defined'](pick3DTileset(this[_0x22d645(0xfc1)],this[_0x22d645(_0x138874._0x429732)])),_0x10c69d=Boolean(this[_0x22d645(_0x138874._0x59ae93)]['terrainProvider']['_layers']);this[_0x22d645(0xd5a)]=_0x2679da,this['_hasTerrain']=_0x10c69d;if(!_0x10c69d&&!_0x2679da){this['end'](0x0);return;}_0x2679da?this['clampTo3DTileset']():this[_0x22d645(0xcba)]();});}['clampTo3DTileset'](){const _0x22befb={_0xbf2103:0xfc1,_0x8db308:0x433},_0x55dc2a={_0x2d1ffa:0xb84},_0x57e1fa=_0x3d5d32;this[_0x57e1fa(_0x22befb._0xbf2103)]['clampToHeightMostDetailed']([this['_position']['clone']()],this[_0x57e1fa(_0x22befb._0x8db308)]['objectsToExclude'],0.05)['then'](_0x4919c4=>{const _0x3a13a6=_0x57e1fa,_0x3f42a9=_0x4919c4[0x0];if(Cesium__namespace[_0x3a13a6(_0x55dc2a._0x2d1ffa)](_0x3f42a9)){const _0x54a2bd=Cesium__namespace['Cartographic'][_0x3a13a6(0xd14)](_0x3f42a9),_0x47d603=_0x54a2bd['height'];if(Cesium__namespace['defined'](_0x47d603)&&_0x47d603>-0x3e8){this['end'](_0x47d603);return;}}this['clampToTerrain']();});}[_0x3d5d32(0xcba)](){const _0x28d725={_0x4b222e:0x44d},_0x3acf56={_0x577a34:0xb84,_0x3b2771:0xfc1,_0x512a7b:0xaa8},_0x57b11d=_0x3d5d32;this[_0x57b11d(0x3e7)]?Cesium__namespace['sampleTerrainMostDetailed'](this['scene']['terrainProvider'],[this['_cartographic']])[_0x57b11d(_0x28d725._0x4b222e)](_0x174313=>{const _0x35b20d=_0x57b11d,_0x364ccc=_0x174313[0x0];let _0x4fbd2b;Cesium__namespace[_0x35b20d(_0x3acf56._0x577a34)](_0x364ccc)&&Cesium__namespace['defined'](_0x364ccc['height'])?_0x4fbd2b=_0x364ccc['height']:_0x4fbd2b=this[_0x35b20d(_0x3acf56._0x3b2771)][_0x35b20d(_0x3acf56._0x512a7b)]['getHeight'](this['_cartographic'])||0x0,this[_0x35b20d(0xb34)](_0x4fbd2b);}):this[_0x57b11d(0xb34)](0x0);}[_0x3d5d32(0xb34)](_0x5a7b99){const _0x366892={_0x2f67a2:0x433,_0x3a36ce:0x406},_0x2b44c9=_0x3d5d32;this[_0x2b44c9(_0x366892._0x2f67a2)]['callback']&&this['options']['callback'](_0x5a7b99),this['_point']['alt']=_0x5a7b99,this['_promise']['resolve']({'height':_0x5a7b99,'height_original':this[_0x2b44c9(0x6c6)],'point':this[_0x2b44c9(0xe7f)],'position':Cesium__namespace['Cartesian3']['fromRadians'](this[_0x2b44c9(0xad7)]['longitude'],this['_cartographic'][_0x2b44c9(_0x366892._0x3a36ce)],_0x5a7b99),'position_original':this[_0x2b44c9(0x87d)],'has3dtiles':this['_has3dtiles'],'hasTerrain':this['_hasTerrain']});}}function getTransFun(_0x16dfe6,_0x4d977b){if(!_0x16dfe6||!_0x4d977b)return![];_0x16dfe6=crsName2FunName(_0x16dfe6),_0x4d977b=crsName2FunName(_0x4d977b);if(_0x4d977b===_0x16dfe6)return![];const _0x3d3615=_0x16dfe6+'2'+_0x4d977b;if(!PointTrans[_0x3d3615])return![];return PointTrans[_0x3d3615];}function crsName2FunName(_0x371ffb){const _0x1bf7f4=_0x3d5d32;switch(_0x371ffb){case ChinaCRS[_0x1bf7f4(0xea3)]:return'gcj';case ChinaCRS['BAIDU']:return'bd';case ChinaCRS['WGS84']:default:return'wgs';}}function getPositionValue(_0x435aba,_0x50dc4f){const _0x2ef4b2={_0x2de789:0x43f,_0x131db2:0xfbe,_0x72cab0:0xfbe,_0x649580:0x8b7},_0x1fb64b=_0x3d5d32;if(!_0x435aba)return _0x435aba;let _0x21ee2e;if(_0x435aba instanceof Cesium__namespace['Cartesian3'])_0x21ee2e=_0x435aba;else{if(_0x435aba['_value']&&_0x435aba['_value']instanceof Cesium__namespace['Cartesian3'])_0x21ee2e=_0x435aba[_0x1fb64b(_0x2ef4b2._0x2de789)];else typeof _0x435aba[_0x1fb64b(_0x2ef4b2._0x131db2)]===_0x1fb64b(0x3cc)&&(_0x21ee2e=_0x435aba[_0x1fb64b(_0x2ef4b2._0x72cab0)](_0x50dc4f||Cesium__namespace[_0x1fb64b(_0x2ef4b2._0x649580)]['now']()));}return _0x21ee2e;}function getMaxHeight(_0x1fd373,_0x32322f=0x0){const _0x123d22=_0x3d5d32;if(_0x1fd373==null||_0x1fd373['length']===0x0)return _0x32322f;let _0x30749a=_0x32322f;for(let _0x1be372=0x0;_0x1be372<_0x1fd373['length'];_0x1be372++){const _0x410dc9=LngLatPoint['parse'](_0x1fd373[_0x1be372]);_0x1be372===0x0&&(_0x30749a=_0x410dc9[_0x123d22(0xd29)]),_0x410dc9['alt']>_0x30749a&&(_0x30749a=_0x410dc9[_0x123d22(0xd29)]);}return formatNum(_0x30749a,LngLatPoint['FormatAltLength']);}function formatNum(_0x125640,_0x2434f5=0x0){const _0x4dc8aa=_0x3d5d32,_0x13ffb5=Math[_0x4dc8aa(0x1fb)](0xa,_0x2434f5);return Math['round'](_0x125640*_0x13ffb5)/_0x13ffb5;}function getMinHeight(_0x186f75,_0x52642e=0x0){const _0x802571={_0x10d0c4:0x83e},_0x1d9613=_0x3d5d32;if(_0x186f75==null||_0x186f75['length']===0x0)return _0x52642e;let _0x27a1f7=_0x52642e;for(let _0x19c6b0=0x0;_0x19c6b0<_0x186f75['length'];_0x19c6b0++){const _0xcd149e=Cesium__namespace['Cartographic']['fromCartesian'](_0x186f75[_0x19c6b0]);_0x19c6b0===0x0&&(_0x27a1f7=_0xcd149e[_0x1d9613(_0x802571._0x10d0c4)]),_0xcd149e['height']<_0x27a1f7&&(_0x27a1f7=_0xcd149e['height']);}return formatNum(_0x27a1f7,LngLatPoint['FormatAltLength']);}function addPositionsHeight(_0x1c4ad9,_0x240408=0x0){const _0x42e89b={_0x50acf0:0x406,_0x52d175:0x220},_0x5ab1cb=_0x3d5d32;_0x240408=Number(_0x240408);if(isNaN(_0x240408)||_0x240408===0x0)return _0x1c4ad9;if(Array['isArray'](_0x1c4ad9)){const _0x1024d9=[];for(let _0x31ecc8=0x0,_0x4786bc=_0x1c4ad9['length'];_0x31ecc8<_0x4786bc;_0x31ecc8++){const _0x2d9da8=Cesium__namespace[_0x5ab1cb(0x220)]['fromCartesian'](_0x1c4ad9[_0x31ecc8]),_0x6eb0ce=Cesium__namespace['Cartesian3']['fromRadians'](_0x2d9da8['longitude'],_0x2d9da8[_0x5ab1cb(_0x42e89b._0x50acf0)],_0x2d9da8['height']+_0x240408);_0x1024d9['push'](_0x6eb0ce);}return _0x1024d9;}else{const _0x1071f1=Cesium__namespace[_0x5ab1cb(_0x42e89b._0x52d175)]['fromCartesian'](_0x1c4ad9);return Cesium__namespace['Cartesian3']['fromRadians'](_0x1071f1[_0x5ab1cb(0xbfd)],_0x1071f1['latitude'],_0x1071f1['height']+_0x240408);}}function setPositionsHeight(_0x558b5c,_0x32f156=0x0){const _0x5d7072={_0x4f6546:0x62b,_0x5af577:0x7d1},_0x5a2bee=_0x3d5d32;if(!_0x558b5c)return _0x558b5c;if(Array[_0x5a2bee(_0x5d7072._0x4f6546)](_0x558b5c)){const _0x4d33fc=[];for(let _0x449bd0=0x0,_0x376bed=_0x558b5c['length'];_0x449bd0<_0x376bed;_0x449bd0++){const _0x3e3f4f=Cesium__namespace['Cartographic']['fromCartesian'](_0x558b5c[_0x449bd0]),_0x48a834=Cesium__namespace['Cartesian3']['fromRadians'](_0x3e3f4f[_0x5a2bee(0xbfd)],_0x3e3f4f['latitude'],_0x32f156);_0x4d33fc['push'](_0x48a834);}return _0x4d33fc;}else{const _0x42aa66=Cesium__namespace['Cartographic']['fromCartesian'](_0x558b5c);return Cesium__namespace['Cartesian3'][_0x5a2bee(_0x5d7072._0x5af577)](_0x42aa66['longitude'],_0x42aa66[_0x5a2bee(0x406)],_0x32f156);}}function getHeight(_0x112f8d,_0x9fe57b,_0x58de8a={}){const _0x295633={_0xb33363:0xed4,_0x47a6dd:0xaa8,_0x1feb24:0xb84},_0x5e07ec=_0x3d5d32,_0x344c4c=LngLatPoint['parse'](_0x9fe57b);if(!_0x112f8d||!_0x344c4c)return 0x0;const _0x53de11=_0x344c4c[_0x5e07ec(_0x295633._0xb33363)](),_0x41ff99=_0x58de8a[_0x5e07ec(0x24f)]??Cesium__namespace['defined'](pick3DTileset(_0x112f8d,_0x53de11)),_0x52ef21=Boolean(_0x112f8d['terrainProvider']['_layers']);if(!_0x52ef21&&!_0x41ff99)return 0x0;const _0x3ea926=_0x344c4c[_0x5e07ec(0x838)]();if(_0x41ff99){const _0x15824f=_0x112f8d['sampleHeight'](_0x3ea926,_0x58de8a['objectsToExclude'],_0x58de8a['width']);if(Cesium__namespace['defined'](_0x15824f)&&_0x15824f>-0x3e8)return _0x15824f;}const _0x2dd925=_0x112f8d[_0x5e07ec(_0x295633._0x47a6dd)]['getHeight'](_0x3ea926);if(Cesium__namespace[_0x5e07ec(_0x295633._0x1feb24)](_0x2dd925)&&_0x2dd925>-0x3e8)return _0x2dd925;return 0x0;}function getSurfaceHeight(_0x33b5fc,_0x491eb1,_0x322ffa={}){const _0xd4f667={_0xef7d21:0xfc1},_0x1bdaf3=_0x3d5d32;return _0x322ffa[_0x1bdaf3(_0xd4f667._0xef7d21)]=_0x33b5fc,_0x322ffa[_0x1bdaf3(0xb69)]=_0x491eb1,new SurfacePoint(_0x322ffa)['start']();}function getSurfaceTerrainHeight(_0x3b792c,_0x49c7af){const _0x459c41={_0x37ed1b:0xf6d},_0x1a1b64=_0x3d5d32,_0xf18146={'scene':_0x3b792c,'position':_0x49c7af,'has3dtiles':![]};return new SurfacePoint(_0xf18146)[_0x1a1b64(_0x459c41._0x37ed1b)]();}function getSurfacePosition(_0x14272b,_0x5e6071,_0x16233f={}){const _0x52239c={_0x4209a5:0x220},_0x58c35e=_0x3d5d32;if(!_0x5e6071)return _0x5e6071;_0x14272b['scene']&&(_0x14272b=_0x14272b['scene']);let _0x1e2c7a=getHeight(_0x14272b,_0x5e6071,_0x16233f);if(_0x1e2c7a!==0x0||Cesium__namespace['defined'](_0x16233f['maxHeight'])&&_0x1e2c7a<=_0x16233f['maxHeight']){const _0x2bd0a7=Cesium__namespace[_0x58c35e(_0x52239c._0x4209a5)]['fromCartesian'](_0x5e6071);_0x16233f['relativeHeight']&&(_0x1e2c7a+=_0x2bd0a7['height']);const _0x57439e=Cesium__namespace['Cartesian3']['fromRadians'](_0x2bd0a7[_0x58c35e(0xbfd)],_0x2bd0a7['latitude'],_0x1e2c7a);return _0x57439e;}return _0x5e6071;}function hasPickedModel(_0x6f472f,_0x546f53){const _0x14aec3=_0x3d5d32;if(Cesium__namespace['defined'](_0x6f472f['id'])){const _0x47e365=_0x6f472f['id'];if(_0x47e365['_noMousePick'])return _0x47e365;if(_0x546f53&&_0x47e365===_0x546f53)return _0x47e365;}if(Cesium__namespace['defined'](_0x6f472f['primitive'])){const _0x2ace92=_0x6f472f['primitive'];if(_0x2ace92['_noMousePick'])return _0x2ace92;if(_0x546f53&&_0x2ace92===_0x546f53)return _0x2ace92;}if(Cesium__namespace[_0x14aec3(0xb84)](_0x6f472f['tileset'])){const _0x38c5bb=_0x6f472f['tileset'];if(_0x38c5bb['_noMousePick'])return _0x38c5bb;if(_0x546f53&&_0x38c5bb===_0x546f53)return _0x38c5bb;}return null;}function getCurrentMousePosition(_0xf2b17e,_0xc47e51,_0x530e9e){const _0x35adb2={_0x333355:0x4a5,_0x80f6f3:0xb69,_0x2532c2:0xe52,_0x1c62c5:0xb69,_0x3ad299:0x99b,_0x353b34:0xaa8,_0x3e38b9:0x5ac,_0x4c275e:0xaa8,_0x16892c:0x220},_0x36b834=_0x3d5d32;let _0xfde9f1,_0xb2aa7b;try{_0xb2aa7b=_0xf2b17e['pick'](_0xc47e51,0x5,0x5);}catch(_0x3b98cf){logWarn('getCurrentMousePosition:\x20scene.pick\x20拾取时异常',_0x3b98cf);}if(_0xf2b17e['pickPositionSupported']&&!_0xf2b17e['onlyPickTerrainPosition']&&Cesium__namespace['defined'](_0xb2aa7b)){const _0x14093e=hasPickedModel(_0xb2aa7b,_0x530e9e);if(_0x14093e){if((_0x14093e[_0x36b834(_0x35adb2._0x333355)]||_0x14093e['point']||_0x14093e['label'])&&!_0x14093e[_0x36b834(0x892)]&&!_0x14093e['model']&&!_0x14093e['ellipsoid'])return getPositionValue(_0x14093e[_0x36b834(_0x35adb2._0x80f6f3)]);if(_0x14093e['show']){_0x14093e['show']=![],_0xf2b17e[_0x36b834(_0x35adb2._0x2532c2)](),_0xfde9f1=getCurrentMousePosition(_0xf2b17e,_0xc47e51,_0x530e9e),_0x14093e['show']=!![];if(_0xfde9f1)return _0xfde9f1;}if(!_0xf2b17e['globe']['show'])return _0xf2b17e['pickPosition'](_0xc47e51);}else{if(Cesium__namespace['defined'](_0xb2aa7b['id'])){const _0x21aecc=_0xb2aa7b['id'];if((_0x21aecc['billboard']||_0x21aecc['point']||_0x21aecc['label'])&&!_0x21aecc[_0x36b834(0x600)])return getPositionValue(_0x21aecc[_0x36b834(_0x35adb2._0x1c62c5)]);}_0xfde9f1=_0xf2b17e['pickPosition'](_0xc47e51);if(Cesium__namespace['defined'](_0xfde9f1)){const _0x562aab=Cesium__namespace['Cartographic']['fromCartesian'](_0xfde9f1);if(_0x562aab['height']>=0x0)return _0xfde9f1;if(!Cesium__namespace['defined'](_0xb2aa7b['id'])&&_0x562aab['height']>=-0x1388)return _0xfde9f1;}}}if(Cesium__namespace['defined'](Cesium__namespace['S3MTilesLayer'])){_0xfde9f1=_0xf2b17e['pickPosition'](_0xc47e51);if(Cesium__namespace['defined'](_0xfde9f1))return _0xfde9f1;}if(!_0xf2b17e['onlyPickTerrainPosition']&&_0xf2b17e['onlyPickModelPosition'])return _0xfde9f1;if(_0xf2b17e[_0x36b834(0x6e1)]===Cesium__namespace['SceneMode']['SCENE3D']){const _0x463a5b=_0xf2b17e['camera']['getPickRay'](_0xc47e51);_0xfde9f1=_0xf2b17e['globe']['pick'](_0x463a5b,_0xf2b17e),!_0xfde9f1&&(_0xfde9f1=_0xf2b17e['camera'][_0x36b834(_0x35adb2._0x3ad299)](_0xc47e51,_0xf2b17e[_0x36b834(_0x35adb2._0x353b34)][_0x36b834(_0x35adb2._0x3e38b9)]));}else _0xfde9f1=_0xf2b17e[_0x36b834(0x435)]['pickEllipsoid'](_0xc47e51,_0xf2b17e[_0x36b834(_0x35adb2._0x4c275e)]['ellipsoid']);if(Cesium__namespace['defined'](_0xfde9f1)&&_0xf2b17e['camera']['positionCartographic']['height']<0x2710){const _0x3b1a4e=Cesium__namespace[_0x36b834(_0x35adb2._0x16892c)]['fromCartesian'](_0xfde9f1);if(_0x3b1a4e['height']<-0x1388)return null;}return _0xfde9f1;}function getCurrentMouseTerrainPosition(_0x6183fb,_0x57a824){const _0x5ec5a7={_0x1a5b30:0x352},_0x1c3241=_0x3d5d32;let _0x556191;if(_0x6183fb['mode']===Cesium__namespace['SceneMode'][_0x1c3241(0x4a8)]){const _0x1c30a8=_0x6183fb['camera'][_0x1c3241(_0x5ec5a7._0x1a5b30)](_0x57a824);_0x556191=_0x6183fb['globe'][_0x1c3241(0x1037)](_0x1c30a8,_0x6183fb),!_0x556191&&(_0x556191=_0x6183fb[_0x1c3241(0x435)]['pickEllipsoid'](_0x57a824,_0x6183fb[_0x1c3241(0xaa8)]['ellipsoid']));}else _0x556191=_0x6183fb['camera']['pickEllipsoid'](_0x57a824,_0x6183fb['globe'][_0x1c3241(0x5ac)]);return _0x556191;}function getMidpoint(_0x912745,_0x2cd9f6){const _0x39c12b={_0x61f7f:0x838,_0x36fc81:0x406},_0x2656da=_0x3d5d32;if(!_0x2cd9f6||!_0x912745)return undefined;const _0x1824e5=LngLatPoint[_0x2656da(_0x39c12b._0x61f7f)](_0x912745),_0x187959=LngLatPoint[_0x2656da(0x838)](_0x2cd9f6),_0x36821d=(_0x1824e5['height']+_0x187959['height'])/0x2,_0x56106b=new Cesium__namespace['EllipsoidGeodesic'](_0x1824e5,_0x187959)['interpolateUsingFraction'](0.5);return Cesium__namespace['Cartesian3']['fromRadians'](_0x56106b['longitude'],_0x56106b[_0x2656da(_0x39c12b._0x36fc81)],_0x36821d);}function isRepeatPoint(_0x1badc6,_0x1af320){const _0x3ac509={_0x5bc7b1:0x4ba},_0x40fae8=_0x3d5d32;if(!_0x1af320||!_0x1badc6)return![];return Math['abs'](_0x1badc6['x']-_0x1af320['x'])<0.1&&Math['abs'](_0x1badc6['y']-_0x1af320['y'])<0.1&&Math[_0x40fae8(_0x3ac509._0x5bc7b1)](_0x1badc6['z']-_0x1af320['z'])<0.1?!![]:![];}function getRotateCenterPoint(_0x4cc9c5,_0x4d0c78,_0x253b38){const _0x3daead={_0x45478b:0xf5d,_0x8486d6:0xbaf,_0x4cbc79:0xf5d,_0x3e2209:0xc9f,_0xf0dc60:0xe95},_0x266b13=_0x3d5d32,_0x5ce7bc=Cesium__namespace['Cartographic']['fromCartesian'](_0x4cc9c5);_0x5ce7bc['height']=0x0;const _0x3b926e=Cesium__namespace[_0x266b13(0x220)][_0x266b13(0xed4)](_0x5ce7bc);let _0x5593eb=Cesium__namespace['Cartesian3']['subtract'](_0x3b926e,_0x4cc9c5,new Cesium__namespace[(_0x266b13(0xe95))]());_0x5593eb=Cesium__namespace['Cartesian3']['normalize'](_0x5593eb,new Cesium__namespace[(_0x266b13(0xe95))]());const _0x5bda7b=Cesium__namespace[_0x266b13(0x97b)]['fromAxisAngle'](_0x5593eb,Cesium__namespace['Math']['toRadians'](_0x253b38)),_0x586643=Cesium__namespace['Matrix3']['fromQuaternion'](_0x5bda7b),_0x15e53c=Cesium__namespace[_0x266b13(_0x3daead._0x45478b)][_0x266b13(_0x3daead._0x8486d6)](_0x586643),_0x3a4bea=Cesium__namespace['Cartesian3'][_0x266b13(0xd97)](_0x4d0c78,_0x4cc9c5,new Cesium__namespace[(_0x266b13(0xe95))]()),_0x4ad0ed=Cesium__namespace[_0x266b13(_0x3daead._0x4cbc79)][_0x266b13(_0x3daead._0x3e2209)](_0x15e53c,_0x3a4bea,new Cesium__namespace['Cartesian3']()),_0x520643=Cesium__namespace[_0x266b13(_0x3daead._0xf0dc60)][_0x266b13(0xff3)](_0x4ad0ed,_0x4cc9c5,new Cesium__namespace['Cartesian3']());return _0x520643;}function getOnLinePointByLen(_0x33fd98,_0x324457,_0x2b662d,_0x55d4b8){const _0x531ba9={_0x12bf5e:0xd97},_0x3e3555=_0x3d5d32,_0x43e831=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x33fd98),_0x19608c=Cesium__namespace['Matrix4']['inverse'](_0x43e831,new Cesium__namespace[(_0x3e3555(0xf5d))]());_0x33fd98=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x19608c,_0x33fd98,new Cesium__namespace['Cartesian3']()),_0x324457=Cesium__namespace['Matrix4'][_0x3e3555(0xc9f)](_0x19608c,_0x324457,new Cesium__namespace['Cartesian3']());const _0x348ef5=Cesium__namespace['Cartesian3'][_0x3e3555(_0x531ba9._0x12bf5e)](_0x324457,_0x33fd98,new Cesium__namespace['Cartesian3']()),_0x2e9481=Cesium__namespace[_0x3e3555(0xe95)]['distance'](_0x33fd98,_0x324457);let _0x1ca433;_0x2e9481!==0x0?_0x1ca433=_0x2b662d/_0x2e9481:_0x1ca433=0.001;_0x55d4b8&&(_0x1ca433+=0x1);let _0x372e0a=Cesium__namespace[_0x3e3555(0xe95)]['multiplyByScalar'](_0x348ef5,_0x1ca433,new Cesium__namespace['Cartesian3']());return _0x372e0a=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x43e831,_0x372e0a,new Cesium__namespace['Cartesian3']()),_0x372e0a;}function getPositionByHprAndOffset(_0xf3092b,_0x23ca06,_0x5911e3,_0x186ff3,_0x456d73){const _0x507876={_0x2850fe:0xed0,_0x555f18:0x9dc},_0x1180dd=_0x3d5d32;_0xf3092b=LngLatPoint['toCartesian'](_0xf3092b);!_0x5911e3&&(_0x5911e3=new Cesium__namespace['HeadingPitchRoll']());const _0x480685=Cesium__namespace['Transforms'][_0x1180dd(_0x507876._0x2850fe)](_0xf3092b,_0x5911e3,_0x186ff3,_0x456d73),_0x4604a8=Cesium__namespace[_0x1180dd(0xf5d)]['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromQuaternion'](_0x480685,new Cesium__namespace[(_0x1180dd(_0x507876._0x555f18))]()),_0xf3092b,new Cesium__namespace['Matrix4']()),_0x1e7a9a=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x4604a8,_0x23ca06,new Cesium__namespace[(_0x1180dd(0xe95))]());return _0x1e7a9a;}function getPositionByDirectionAndLen(_0x1a8eac,_0x2bc953,_0x588e9b){const _0x5eada1={_0x9e0b16:0xed4,_0x2f2c45:0x562},_0x54349a=_0x3d5d32;_0x1a8eac=LngLatPoint[_0x54349a(_0x5eada1._0x9e0b16)](_0x1a8eac);const _0x305728=Cesium__namespace[_0x54349a(0x5bb)]['eastNorthUpToFixedFrame'](_0x1a8eac),_0x2681fc=Cesium__namespace['Matrix3'][_0x54349a(0x989)](Cesium__namespace['Math'][_0x54349a(_0x5eada1._0x2f2c45)](0x168-(_0x2bc953||0x0))),_0x859462=Cesium__namespace['Matrix4'][_0x54349a(0xbaf)](_0x2681fc);Cesium__namespace['Matrix4']['multiply'](_0x305728,_0x859462,_0x305728);const _0x5f03f6=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x305728,new Cesium__namespace['Cartesian3'](_0x588e9b,0x0,0x0),new Cesium__namespace['Cartesian3']());return _0x5f03f6;}function getPositionByHprAndLen(_0x634df0,_0x41ee4e,_0x2eb57e){const _0x479268={_0x26cf33:0xed0,_0x41d952:0xe95},_0x42625d=_0x3d5d32;_0x634df0=LngLatPoint['toCartesian'](_0x634df0);const _0x3b6248=Cesium__namespace['Transforms'][_0x42625d(_0x479268._0x26cf33)](_0x634df0,_0x41ee4e),_0x3f438b=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3'][_0x42625d(0x9f3)](_0x3b6248,new Cesium__namespace['Matrix3']()),_0x634df0,new Cesium__namespace[(_0x42625d(0xf5d))]()),_0x43d929=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x3f438b,new Cesium__namespace['Cartesian3'](0x0,0x0,-_0x2eb57e),new Cesium__namespace[(_0x42625d(_0x479268._0x41d952))]());return _0x43d929;}function getRayEarthPosition(_0x73b95,_0x2454b5,_0x138bc5,_0x2eca35){const _0x66a2e7=_0x3d5d32;if(!_0x73b95||!_0x2454b5)return;_0x2454b5 instanceof Cesium__namespace['HeadingPitchRoll']&&(_0x2454b5=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x73b95,_0x2454b5));const _0x2e0748=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace[_0x66a2e7(0x9dc)]['fromQuaternion'](_0x2454b5,new Cesium__namespace['Matrix3']()),_0x73b95,new Cesium__namespace['Matrix4']());return getRayEarthPositionByMatrix(_0x2e0748,_0x138bc5,_0x2eca35);}function getRayEarthPositionByMatrix(_0x59655d,_0x40df0b,_0x122fc7){const _0x1c68a8={_0x2639d7:0xe95},_0x62ff72=_0x3d5d32,_0x2ee2c5=new Cesium__namespace['Cartesian3'](),_0x52ad28=new Cesium__namespace[(_0x62ff72(0xcbc))]();Cesium__namespace['Matrix4']['multiplyByPoint'](_0x59655d,Cesium__namespace[_0x62ff72(_0x1c68a8._0x2639d7)]['ZERO'],_0x2ee2c5),_0x2ee2c5['clone'](_0x52ad28['origin']);const _0x176fb0=new Cesium__namespace['Cartesian3'](0x0,0x0,_0x40df0b?-0x64:0x64),_0x165809=extend2Earth(_0x176fb0,_0x59655d,_0x52ad28,_0x122fc7);return _0x165809;}function extend2Earth(_0x2706c2,_0x44ba85,_0x21d74f,_0x394d27){const _0x3ed29f={_0x2cd186:0x25a,_0x1c3d87:0xf69,_0x5da902:0xe36},_0x3158f2=_0x3d5d32;_0x394d27=_0x394d27||Cesium__namespace[_0x3158f2(_0x3ed29f._0x2cd186)]['WGS84'];const _0x3fbce0=new Cesium__namespace[(_0x3158f2(0xe95))]();Cesium__namespace['Matrix4']['multiplyByPoint'](_0x44ba85,_0x2706c2,_0x3fbce0),Cesium__namespace['Cartesian3']['subtract'](_0x3fbce0,_0x21d74f['origin'],_0x21d74f['direction']),Cesium__namespace['Cartesian3'][_0x3158f2(_0x3ed29f._0x1c3d87)](_0x21d74f[_0x3158f2(_0x3ed29f._0x5da902)],_0x21d74f['direction']);const _0x85864a=Cesium__namespace['IntersectionTests']['rayEllipsoid'](_0x21d74f,_0x394d27);let _0x43cea0=null;_0x85864a&&(_0x43cea0=Cesium__namespace['Ray'][_0x3158f2(0xa0a)](_0x21d74f,_0x85864a[_0x3158f2(0xf6d)]));if(_0x43cea0)try{const _0x179865=new Cesium__namespace[(_0x3158f2(0x220))]();Cesium__namespace['Cartographic']['fromCartesian'](_0x43cea0,null,_0x179865);}catch(_0x21b2a8){return null;}return _0x43cea0;}function getHeadingPitchRollByOrientation(_0x7b0761,_0x7b5b8e,_0x7f7503,_0x352d70){const _0x4e11e1={_0xb26d22:0xb84,_0x4df803:0x9dc},_0x38af8b=_0x3d5d32;if(!Cesium__namespace['defined'](_0x7b5b8e)||!Cesium__namespace[_0x38af8b(_0x4e11e1._0xb26d22)](_0x7b0761))return new Cesium__namespace['HeadingPitchRoll']();const _0xceebb3=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace[_0x38af8b(_0x4e11e1._0x4df803)]['fromQuaternion'](_0x7b5b8e,new Cesium__namespace['Matrix3']()),_0x7b0761,new Cesium__namespace['Matrix4']()),_0x376581=getHeadingPitchRollByMatrix(_0xceebb3,_0x7f7503,_0x352d70);return _0x376581;}function getHeadingPitchRollByMatrix(_0x55190e,_0x148161,_0x4852f7,_0x200c24){const _0xefd822={_0x33e78f:0x694},_0x2393e6=_0x3d5d32;return Cesium__namespace['Transforms'][_0x2393e6(_0xefd822._0x33e78f)](_0x55190e,_0x148161,_0x4852f7,_0x200c24);}function getHeadingPitchRollForLine(_0x3cec81,_0x514f91,_0x5a4981,_0x2986b0){const _0x315f11={_0x45296a:0x25a,_0xe52a27:0xe95,_0x3b7ab9:0xf5d,_0x30719c:0xbaf,_0x42cb5c:0xb18},_0x4ad312=_0x3d5d32;_0x3cec81=LngLatPoint['toCartesian'](_0x3cec81),_0x514f91=LngLatPoint['toCartesian'](_0x514f91),_0x5a4981=_0x5a4981||Cesium__namespace[_0x4ad312(_0x315f11._0x45296a)]['WGS84'];const _0xe62108=new Cesium__namespace[(_0x4ad312(_0x315f11._0xe52a27))](),_0x52d894=new Cesium__namespace['Matrix4'](),_0x819df7=new Cesium__namespace['Matrix3'](),_0x4d9d57=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x514f91,_0x3cec81,_0xe62108),_0xe62108);Cesium__namespace['Transforms']['rotationMatrixFromPositionVelocity'](_0x3cec81,_0x4d9d57,_0x5a4981,_0x819df7);const _0x32be0b=Cesium__namespace[_0x4ad312(_0x315f11._0x3b7ab9)][_0x4ad312(_0x315f11._0x30719c)](_0x819df7,_0x3cec81,_0x52d894);Cesium__namespace['Matrix4']['multiplyTransformation'](_0x32be0b,Cesium__namespace[_0x4ad312(_0x315f11._0x42cb5c)]['Z_UP_TO_X_UP'],_0x32be0b);const _0xf6ddb7=getHeadingPitchRollByMatrix(_0x32be0b,_0x5a4981,_0x2986b0);return _0xf6ddb7;}function getReflectVector(_0x31b2dd,_0x56d542){const _0x2378f6=_0x3d5d32,_0x4489a4=_0x56d542['clone'](),_0x23050c=_0x31b2dd['clone'](),_0x174a69=0x2*Cesium__namespace['Cartesian3']['dot'](_0x31b2dd,_0x56d542);return Cesium__namespace[_0x2378f6(0xe95)]['multiplyByScalar'](_0x56d542,_0x174a69,_0x4489a4),Cesium__namespace['Cartesian3']['subtract'](_0x31b2dd,_0x4489a4,_0x23050c);}var PointUtil={'__proto__':null,'getTransFun':getTransFun,'getPositionValue':getPositionValue,'getMaxHeight':getMaxHeight,'getMinHeight':getMinHeight,'addPositionsHeight':addPositionsHeight,'setPositionsHeight':setPositionsHeight,'getHeight':getHeight,'getSurfaceHeight':getSurfaceHeight,'getSurfaceTerrainHeight':getSurfaceTerrainHeight,'getSurfacePosition':getSurfacePosition,'getCurrentMousePosition':getCurrentMousePosition,'getCurrentMouseTerrainPosition':getCurrentMouseTerrainPosition,'getMidpoint':getMidpoint,'isRepeatPoint':isRepeatPoint,'getRotateCenterPoint':getRotateCenterPoint,'getOnLinePointByLen':getOnLinePointByLen,'getPositionByHprAndOffset':getPositionByHprAndOffset,'getPositionByDirectionAndLen':getPositionByDirectionAndLen,'getPositionByHprAndLen':getPositionByHprAndLen,'getRayEarthPosition':getRayEarthPosition,'getRayEarthPositionByMatrix':getRayEarthPositionByMatrix,'extend2Earth':extend2Earth,'getHeadingPitchRollByOrientation':getHeadingPitchRollByOrientation,'getHeadingPitchRollByMatrix':getHeadingPitchRollByMatrix,'getHeadingPitchRollForLine':getHeadingPitchRollForLine,'getReflectVector':getReflectVector};class SurfacePoints{constructor(_0x214e45){const _0x53b3cc={_0x14670b:0xfc1,_0x52a5d1:0xfc1,_0x248f37:0x5bd},_0x34cc72=_0x3d5d32;this['options']=_0x214e45,this['scene']=_0x214e45[_0x34cc72(0x7e1)]?_0x214e45[_0x34cc72(0x7e1)][_0x34cc72(0xfc1)]:_0x214e45[_0x34cc72(_0x53b3cc._0x14670b)],!this[_0x34cc72(_0x53b3cc._0x52a5d1)]&&logError$1(_0x34cc72(_0x53b3cc._0x248f37),this['options']),this['positions']=LngLatArray['toCartesians'](this['options']['positions']);}['start'](){const _0x28829d={_0x4a0cba:0xbb8,_0x165ac5:0x24f,_0x197450:0xfc1,_0x324942:0x433,_0x11b60a:0xc77,_0x57225b:0xb84,_0x5a46f8:0xaa8};return new Promise((_0x4299be,_0x346aef)=>{const _0x44ca97=_0x4132;this[_0x44ca97(0x227)]={'resolve':_0x4299be,'reject':_0x346aef};if(this[_0x44ca97(_0x28829d._0x4a0cba)]==null||this[_0x44ca97(0xbb8)]['length']===0x0){this['end'](this[_0x44ca97(0xbb8)]);return;}const _0xca427e=this['options'][_0x44ca97(_0x28829d._0x165ac5)]??Cesium__namespace['defined'](pick3DTileset(this['scene'],this['positions'])),_0x1b9005=Boolean(this[_0x44ca97(_0x28829d._0x197450)]['terrainProvider']['_layers']);this['_has3dtiles']=_0xca427e,this['_hasTerrain']=_0x1b9005;if(!_0x1b9005&&!_0xca427e){this['end'](this[_0x44ca97(0xbb8)]);return;}if(this['options']['exact'])_0xca427e?this[_0x44ca97(0xfb2)](this['positions']):this['clampToTerrain'](this['positions']);else{const _0x343811=[];for(let _0x1efca7=0x0,_0x372e98=this['positions']['length'];_0x1efca7<_0x372e98;++_0x1efca7){const _0x58ab17=Cesium__namespace[_0x44ca97(0x220)]['fromCartesian'](this['positions'][_0x1efca7]);let _0x3ac707;if(_0xca427e){const _0x172497=this['scene']['sampleHeight'](_0x58ab17,this[_0x44ca97(_0x28829d._0x324942)][_0x44ca97(_0x28829d._0x11b60a)],this['options']['width']);Cesium__namespace[_0x44ca97(_0x28829d._0x57225b)](_0x172497)&&_0x172497>-0x3e8&&(_0x3ac707=_0x172497);}if(!Cesium__namespace['defined'](_0x3ac707)){const _0x8adf6f=this['scene'][_0x44ca97(_0x28829d._0x5a46f8)][_0x44ca97(0x46c)](_0x58ab17);Cesium__namespace['defined'](_0x8adf6f)&&_0x8adf6f>-0x3e8&&(_0x3ac707=_0x8adf6f);}_0x343811[_0x44ca97(0xb75)](Cesium__namespace['Cartesian3']['fromRadians'](_0x58ab17['longitude'],_0x58ab17['latitude'],_0x3ac707??_0x58ab17['height']));}this[_0x44ca97(0xb34)](_0x343811);}});}[_0x3d5d32(0xfb2)](_0x1923f6){const _0xd98f81={_0x5e9fbf:0xf9b,_0x3dc1d8:0xb34},_0xe76d2e=_0x3d5d32,_0xafe5c9=[];for(let _0x1ecfc2=0x0,_0x1a0419=_0x1923f6['length'];_0x1ecfc2<_0x1a0419;++_0x1ecfc2){_0xafe5c9['push'](_0x1923f6[_0x1ecfc2]['clone']());}this[_0xe76d2e(0xfc1)]['clampToHeightMostDetailed'](_0xafe5c9,this['options']['objectsToExclude'])['then'](_0xc7c8f3=>{const _0x40b161=_0xe76d2e;_0xc7c8f3=this['removeNullData'](_0xc7c8f3),_0xc7c8f3['length']>0x0?(this['options']['offset']&&(_0xc7c8f3=addPositionsHeight(_0xc7c8f3,this['options'][_0x40b161(_0xd98f81._0x5e9fbf)])),this[_0x40b161(_0xd98f81._0x3dc1d8)](_0xc7c8f3)):this['clampToTerrain'](_0x1923f6);});}['clampToTerrain'](_0x3d4931){const _0x417491={_0x42e483:0xc84,_0x1867f8:0x83e},_0x47e447=_0x3d5d32;if(this['_hasTerrain']){const _0x34d67b=this['scene']['globe']['ellipsoid'],_0x31cd46=_0x34d67b['cartesianArrayToCartographicArray'](_0x3d4931),_0x41f854=Cesium__namespace['Cartographic']['fromCartesian'](_0x3d4931[0x0])['height'];Cesium__namespace[_0x47e447(0xe3b)](this[_0x47e447(0xfc1)]['terrainProvider'],_0x31cd46)['then'](_0x2df3bf=>{const _0x2d6524=_0x47e447;_0x2df3bf=this['removeNullData'](_0x2df3bf);let _0x128fed=![];const _0x29f453=this['options']['offset']??0x0;for(let _0x171909=0x0;_0x171909<_0x2df3bf[_0x2d6524(_0x417491._0x42e483)];++_0x171909){_0x2df3bf[_0x171909]['height']==null?(_0x128fed=!![],_0x2df3bf[_0x171909]['height']=_0x29f453+_0x41f854):_0x2df3bf[_0x171909][_0x2d6524(0x83e)]=_0x29f453+_0x2df3bf[_0x171909][_0x2d6524(_0x417491._0x1867f8)];}const _0x140c0b=_0x34d67b['cartographicArrayToCartesianArray'](_0x2df3bf);this['end'](_0x140c0b,_0x128fed);});}else this['end'](_0x3d4931);}['end'](_0x5f2edf,_0x4e1f82){const _0x313cbd={_0x1bb08b:0x463,_0xca257f:0xbb8,_0x47af98:0xd5a},_0xf43288=_0x3d5d32;this['options'][_0xf43288(_0x313cbd._0x1bb08b)]&&this['options'][_0xf43288(_0x313cbd._0x1bb08b)](_0x5f2edf,_0x4e1f82,this[_0xf43288(_0x313cbd._0xca257f)]),this[_0xf43288(0x227)]['resolve']({'positions':_0x5f2edf,'positions_original':this['positions'],'noHeight':_0x4e1f82,'has3dtiles':this[_0xf43288(_0x313cbd._0x47af98)],'hasTerrain':this['_hasTerrain']});}['removeNullData'](_0x4c6c22){const _0x537fbd=_0x3d5d32,_0x17baf5=[];for(let _0x5ab671=0x0;_0x5ab671<_0x4c6c22['length'];++_0x5ab671){_0x4c6c22[_0x5ab671]!=null&&_0x17baf5[_0x537fbd(0xb75)](_0x4c6c22[_0x5ab671]);}return _0x17baf5;}}function logError(_0x17bfb5,_0x29d5d1){const _0x3b422a={_0x2733a0:0x77b},_0x5710c7=_0x3d5d32;console[_0x5710c7(_0x3b422a._0x2733a0)]('turf.'+_0x17bfb5+'\x20不存在,该方法需引入\x20turf.js\x20库生效。',_0x29d5d1);}function area(_0x5ebcda){try{return turf['area'](_0x5ebcda);}catch(_0x13f113){logError('area',_0x13f113);}return 0x0;}function bbox(_0x1976c0){try{return turf['bbox'](_0x1976c0);}catch(_0x3a0aae){logError('bbox',_0x3a0aae);}return null;}function bezierSpline(_0x39770c,_0x5cdbcc){const _0x416115=_0x3d5d32;try{return turf['bezierSpline'](_0x39770c,_0x5cdbcc);}catch(_0x118a2f){logError(_0x416115(0x8a1),_0x118a2f);}return _0x39770c;}function booleanPointInPolygon(_0x320b6f,_0x26cbcb,_0x4eb199){const _0x18467c={_0x2464a4:0xda2},_0x5a3457=_0x3d5d32;try{return turf[_0x5a3457(_0x18467c._0x2464a4)](_0x320b6f,_0x26cbcb,_0x4eb199);}catch(_0x5d9b80){logError('booleanPointInPolygon',_0x5d9b80);}return![];}function buffer$1(_0x2d4e97,_0x5a6a97,_0x543c9e){const _0x13ace5=_0x3d5d32;try{return turf[_0x13ace5(0xe2c)](_0x2d4e97,_0x5a6a97,_0x543c9e);}catch(_0x2f8aa4){logError('buffer',_0x2f8aa4);}return _0x2d4e97;}function convex$1(_0x466b7e,_0x34d61e){try{return turf['convex'](_0x466b7e,_0x34d61e);}catch(_0x3c70d6){logError('convex',_0x3c70d6);}return _0x466b7e;}function pointGrid(_0xab8c4f,_0x522f1e,_0x42d0ce){const _0x25b060={_0x508095:0x4f4},_0x15fd8c=_0x3d5d32;try{return turf[_0x15fd8c(_0x25b060._0x508095)](_0xab8c4f,_0x522f1e,_0x42d0ce);}catch(_0x43a2c4){logError('pointGrid',_0x43a2c4);}return{'features':[]};}const pickTilesetPassState=new Cesium__namespace['Cesium3DTilePassState']({'pass':Cesium__namespace[_0x3d5d32(0x8e7)]['PICK']}),packedDepthScale=new Cesium__namespace[(_0x3d5d32(0xd36))](0x1,0x1/0xff,0x1/0xfe01,0x1/0xfd02ff),scratchRectangle=new Cesium__namespace['BoundingRectangle'](0x0,0x0,0x3,0x3),scratchColorZero=new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),scratchRight=new Cesium__namespace['Cartesian3'](),scratchUp=new Cesium__namespace['Cartesian3'](),scratchPackedDepthArray=[];function interPolygonByDepth$1(_0x2840f6){const _0x500f93={_0x1a3d6b:0x7a6,_0x3ad9aa:0x1eb,_0x994c7f:0x6b6,_0x219384:0x27e,_0x219d68:0x92a,_0x4b0f45:0x6fa,_0x29cbbb:0x435,_0x45cf39:0xa68,_0x20be33:0x7e1,_0x2f87b7:0xa59,_0x3258fe:0xc10,_0x389782:0x320},_0x22061f={_0x3ab237:0x220},_0x44e326={_0x472cbd:0xbfd},_0x433d50=_0x3d5d32,_0x4bf467=_0x2840f6['scene'],_0x20aa3a=LngLatArray['toCartesians'](_0x2840f6['positions']),_0x4e3afa=_0x4bf467['globe']['depthTestAgainstTerrain'];_0x4bf467[_0x433d50(0xaa8)]['depthTestAgainstTerrain']=!![];const _0x1ee3dd=_0x2840f6['cameraHeight']??_0x4bf467['camera']['positionCartographic']['height'],{ray:_0x1f8d8c,frustumWidth:_0x1d1f0c,frustumHeight:_0x1f055f,cameraUp:_0x47e5a3}=getCameraInforForPoints(_0x20aa3a,_0x1ee3dd),_0x5e5b4d=Number(_0x2840f6[_0x433d50(_0x500f93._0x1a3d6b)]??0x200),_0x17bdf4=_0x1d1f0c/_0x5e5b4d,_0x40f6b6=_0x1f055f/_0x5e5b4d,_0x515504=new Cesium__namespace['Picking'](_0x4bf467),_0x53f103=_0x515504['_pickOffscreenView'],_0x41357b=new Cesium__namespace['BoundingRectangle'](0x0,0x0,_0x5e5b4d,_0x5e5b4d);_0x53f103['viewport']=_0x41357b,_0x53f103[_0x433d50(0xdb8)]['viewport']=_0x41357b,_0x4bf467[_0x433d50(0xa59)]=_0x53f103,updateOffscreenCamera(_0x1f8d8c[_0x433d50(_0x500f93._0x3ad9aa)],_0x1f8d8c['direction'],_0x47e5a3,_0x1d1f0c,_0x1f055f,_0x53f103['camera']),Cesium__namespace[_0x433d50(_0x500f93._0x994c7f)][_0x433d50(0x315)](_0x53f103['viewport'],scratchRectangle);const _0x190b5e=_0x53f103['pickFramebuffer'][_0x433d50(0x1072)](scratchRectangle,_0x53f103['viewport']);_0x4bf467[_0x433d50(0x287)]['disableThisFrame'](),_0x4bf467['updateFrameState'](),_0x4bf467[_0x433d50(_0x500f93._0x219384)]['invertClassification']=![],_0x4bf467['frameState']['passes']['pick']=!![],_0x4bf467['frameState']['passes']['offscreen']=!![],_0x4bf467['frameState']['tilesetPassState']=pickTilesetPassState,_0x4bf467[_0x433d50(_0x500f93._0x219d68)]['uniformState']['update'](_0x4bf467['frameState']),_0x4bf467['updateEnvironment'](),_0x4bf467['updateAndExecuteCommands'](_0x190b5e,scratchColorZero),_0x4bf467['resolveFramebuffers'](_0x190b5e);const _0x10f4b0=[];if(_0x4bf467['context'][_0x433d50(0x732)]){const _0x49981d=_0x53f103[_0x433d50(0x780)]['length'],_0x4bedf7=new Cesium__namespace['Cartesian3']();for(let _0x187125=0x0;_0x187125<_0x49981d;++_0x187125){const _0x3800ce=_0x515504['getPickDepth'](_0x4bf467,_0x187125),_0x3f3ec5=getDepth(_0x4bf467['context'],0x0,0x0,_0x5e5b4d,_0x5e5b4d,_0x3800ce);for(let _0x2a5fc2=0x0;_0x2a5fc2<_0x3f3ec5[_0x433d50(0xc84)];_0x2a5fc2++){const _0x28923c=_0x3f3ec5[_0x2a5fc2];if(_0x28923c>0x0&&_0x28923c<0x1){const _0x289cbc=_0x53f103['frustumCommandsList'][_0x187125],_0x5482b8=_0x289cbc[_0x433d50(0x585)]*(_0x2a5fc2!==0x0?_0x4bf467[_0x433d50(0xdb0)]:0x1),{far:_0x144250}=_0x289cbc,_0x32084d=_0x5482b8+_0x28923c*(_0x144250-_0x5482b8),_0x48d6f3=Math[_0x433d50(_0x500f93._0x4b0f45)](_0x2a5fc2/_0x5e5b4d),_0x4e9f5d=_0x2a5fc2%_0x5e5b4d,_0x286cc3=(_0x48d6f3-_0x5e5b4d/0x2)*_0x1f055f/_0x5e5b4d,_0x1fdccc=(_0x4e9f5d-_0x5e5b4d/0x2)*_0x1d1f0c/_0x5e5b4d,_0x87edf5=new Cesium__namespace[(_0x433d50(0xe95))]();Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x47e5a3,_0x286cc3,_0x4bedf7),Cesium__namespace[_0x433d50(0xe95)]['add'](_0x4bedf7,_0x53f103['camera']['position'],_0x87edf5),Cesium__namespace['Cartesian3'][_0x433d50(0xadd)](_0x53f103[_0x433d50(_0x500f93._0x29cbbb)]['right'],_0x1fdccc,_0x4bedf7),Cesium__namespace['Cartesian3'][_0x433d50(0xff3)](_0x4bedf7,_0x87edf5,_0x87edf5);const _0x4d95f6=Cesium__namespace[_0x433d50(0xcbc)][_0x433d50(0x315)](_0x1f8d8c);_0x4d95f6['origin']=_0x87edf5;const _0x1c96ad=Cesium__namespace['Ray']['getPoint'](_0x4d95f6,_0x32084d);!_0x10f4b0[_0x2a5fc2]&&(_0x10f4b0[_0x2a5fc2]=_0x1c96ad);}}}}const _0x2bd9ce=[];let _0x283f99=Number['MAX_VALUE'],_0x549ed8=-Number[_0x433d50(_0x500f93._0x45cf39)];const _0x46fc68=_0x20aa3a[_0x433d50(_0x500f93._0x20be33)](_0x1ea7ee=>{const _0x58df36=_0x433d50,_0x434bd3=Cesium__namespace['Cartographic']['fromCartesian'](_0x1ea7ee);return[_0x434bd3[_0x58df36(_0x44e326._0x472cbd)],_0x434bd3['latitude']];});_0x10f4b0['forEach'](_0x24077a=>{const _0x24c68a=_0x433d50,_0x2a383a=Cesium__namespace[_0x24c68a(_0x22061f._0x3ab237)]['fromCartesian'](_0x24077a);if(_0x2a383a&&pointInPolygonNested([_0x2a383a['longitude'],_0x2a383a['latitude']],_0x46fc68)){const _0x3b5866=_0x2a383a[_0x24c68a(0x83e)];_0x549ed8<_0x3b5866&&(_0x549ed8=_0x3b5866),_0x283f99>_0x3b5866&&(_0x283f99=_0x3b5866),_0x24077a['height']=_0x3b5866,_0x24077a['getOutline']=function(){return getBoxOutLine(this,_0x17bdf4,_0x40f6b6,_0x47e5a3);},_0x2bd9ce['push'](_0x24077a);}}),_0x4bf467['globe']['depthTestAgainstTerrain']=_0x4e3afa,_0x4bf467[_0x433d50(_0x500f93._0x2f87b7)]=_0x4bf467[_0x433d50(_0x500f93._0x3258fe)],_0x4bf467['context'][_0x433d50(_0x500f93._0x389782)](),_0x515504['destroy']();const _0xc121=_0x17bdf4*_0x40f6b6;return{'positions':_0x2bd9ce,'count':_0x2bd9ce['length'],'minHeight':_0x283f99,'maxHeight':_0x549ed8,'box':{'width':_0x17bdf4,'height':_0x40f6b6,'area':_0xc121},'totalArea':_0xc121*_0x2bd9ce['length']};}function interPolylineByDepth$1(_0x1373f2){const _0xe80761={_0x4bcc6f:0xbb8,_0xfee22d:0xaa8,_0x3d7657:0xb30,_0x31030a:0x220,_0x312a22:0xe95,_0xad9d3f:0xbfd,_0x23bfe8:0x648,_0x52066c:0xa59,_0x4971d5:0x88b,_0x1785be:0xcd9,_0x144d6b:0xf3e,_0x10acf9:0xa82,_0x5d43a2:0x1eb},_0xa96dbb=_0x3d5d32,_0x150bbe=_0x1373f2['scene'],_0x719cce=LngLatArray['toCartesians'](_0x1373f2[_0xa96dbb(_0xe80761._0x4bcc6f)]),_0x2e47f7=_0x150bbe['globe']['depthTestAgainstTerrain'];_0x150bbe[_0xa96dbb(_0xe80761._0xfee22d)][_0xa96dbb(0x5d9)]=!![];const _0x1dfe86=Cesium__namespace['defined'](_0x150bbe['globe'])?_0x150bbe['globe']['ellipsoid']:_0x150bbe[_0xa96dbb(_0xe80761._0x3d7657)][_0xa96dbb(0x5ac)],_0xf22cce=_0x150bbe['context'],_0x794000=_0xf22cce['uniformState'],_0x359b28=_0x150bbe[_0xa96dbb(0x27e)],_0x25354f=_0x1373f2[_0xa96dbb(0x3aa)]??_0x150bbe[_0xa96dbb(0x435)]['positionCartographic']['height'],_0x3bca47=new Cesium__namespace[(_0xa96dbb(0xc59))](_0x150bbe),_0xd65db6=_0x3bca47['_pickOffscreenView'],_0x2cf747=0.1;let _0x4bb6a4=[];const _0x1a594a=[];for(let _0x58c838=0x0,_0x234de0=_0x719cce[_0xa96dbb(0xc84)]-0x1;_0x58c838<_0x234de0;_0x58c838++){const _0x48c115=_0x719cce[_0x58c838],_0x2b60f3=_0x719cce[_0x58c838+0x1],_0x52e9af=Cesium__namespace[_0xa96dbb(_0xe80761._0x31030a)][_0xa96dbb(0xd14)](_0x48c115),_0x4d8cee=Cesium__namespace['Cartographic'][_0xa96dbb(0xd14)](_0x2b60f3),_0x1d3592=Cesium__namespace[_0xa96dbb(_0xe80761._0x312a22)]['fromRadians'](_0x52e9af[_0xa96dbb(_0xe80761._0xad9d3f)],_0x52e9af['latitude']),_0x2bf696=Cesium__namespace['Cartesian3']['fromRadians'](_0x4d8cee['longitude'],_0x4d8cee['latitude']),_0x1e2e44=Cesium__namespace['Cartesian3']['distance'](_0x1d3592,_0x2bf696);let _0x4f5707=0x64;Cesium__namespace['defined'](_0x1373f2['splitNum'])&&(_0x4f5707=Number(_0x1373f2['splitNum']));Cesium__namespace['defined'](_0x1373f2['minDistance'])&&(_0x4f5707=Math['floor'](_0x1e2e44/_0x1373f2['minDistance']));_0x4f5707>Cesium__namespace['ContextLimits']['maximumTextureSize']&&(_0x4f5707=Cesium__namespace[_0xa96dbb(_0xe80761._0x23bfe8)][_0xa96dbb(0xed1)]);const _0x125bf6=new Cesium__namespace['Ray'](),_0x49841=Cesium__namespace['Cartesian3']['lerp'](_0x1d3592,_0x2bf696,0.5,new Cesium__namespace['Cartesian3']()),_0x4c14e3=Cesium__namespace['Cartographic']['fromCartesian'](_0x49841),_0x7c4a53=_0x1dfe86['geodeticSurfaceNormalCartographic'](_0x4c14e3,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3']['negate'](_0x7c4a53,_0x125bf6[_0xa96dbb(0xe36)]),_0x125bf6['origin']=Cesium__namespace['Cartesian3']['fromRadians'](_0x4c14e3['longitude'],_0x4c14e3['latitude'],_0x25354f);const _0x290296=Cesium__namespace['Cartesian3']['subtract'](_0x2bf696,_0x1d3592,scratchUp);Cesium__namespace['Cartesian3']['normalize'](_0x290296,_0x290296);const _0x310826=_0x1e2e44,_0xe78ec7=new Cesium__namespace['BoundingRectangle'](0x0,0x0,0x1,_0x4f5707);_0xd65db6['viewport']=_0xe78ec7,_0xd65db6['passState']['viewport']=_0xe78ec7,_0x150bbe[_0xa96dbb(_0xe80761._0x52066c)]=_0xd65db6,updateOffscreenCamera(_0x125bf6['origin'],_0x125bf6[_0xa96dbb(0xe36)],_0x290296,_0x2cf747,_0x310826,_0xd65db6['camera']),Cesium__namespace['BoundingRectangle']['clone'](_0xd65db6['viewport'],scratchRectangle);const _0x5301c9=_0xd65db6[_0xa96dbb(_0xe80761._0x4971d5)][_0xa96dbb(0x1072)](scratchRectangle,_0xd65db6['viewport']);_0x150bbe['jobScheduler'][_0xa96dbb(0x5db)](),_0x150bbe['updateFrameState'](),_0x359b28[_0xa96dbb(0xdac)]=![],_0x359b28[_0xa96dbb(_0xe80761._0x1785be)]['pick']=!![],_0x359b28['passes']['offscreen']=!![],_0x359b28['tilesetPassState']=pickTilesetPassState,_0x794000['update'](_0x359b28),_0x150bbe['updateEnvironment'](),_0x150bbe['updateAndExecuteCommands'](_0x5301c9,scratchColorZero),_0x150bbe[_0xa96dbb(_0xe80761._0x144d6b)](_0x5301c9);const _0x50c0f2=[];if(_0x150bbe['context']['depthTexture']){const _0x4bf06c=_0xd65db6['frustumCommandsList']['length'],_0x51d5d5=new Cesium__namespace['Cartesian3']();for(let _0x37e43f=0x0;_0x37e43f<_0x4bf06c;++_0x37e43f){const _0xfe81ef=_0x3bca47[_0xa96dbb(_0xe80761._0x10acf9)](_0x150bbe,_0x37e43f),_0x5dc3ac=getDepth(_0xf22cce,0x0,0x0,0x1,_0x4f5707,_0xfe81ef);for(let _0x515ea4=0x0,_0xf65a40=_0x5dc3ac['length'];_0x515ea4<_0xf65a40;_0x515ea4++){const _0x181ee5=_0x5dc3ac[_0x515ea4];if(_0x181ee5>0x0&&_0x181ee5<0x1){const _0x5bc7f9=_0xd65db6['frustumCommandsList'][_0x37e43f],_0x40c773=_0x5bc7f9[_0xa96dbb(0x585)]*(_0x515ea4!==0x0?_0x150bbe['opaqueFrustumNearOffset']:0x1),_0x15b8f5=_0x5bc7f9['far'],_0x114f8e=_0x40c773+_0x181ee5*(_0x15b8f5-_0x40c773);if(_0xf65a40>0x1){const _0x5cea5d=(_0x515ea4/(_0x5dc3ac[_0xa96dbb(0xc84)]-0x1)-0.5)*_0x310826;Cesium__namespace[_0xa96dbb(0xe95)]['multiplyByScalar'](_0x290296,_0x5cea5d,_0x51d5d5);}const _0x26389e=Cesium__namespace[_0xa96dbb(0xcbc)][_0xa96dbb(0x315)](_0x125bf6);Cesium__namespace['Cartesian3']['add'](_0x26389e[_0xa96dbb(_0xe80761._0x5d43a2)],_0x51d5d5,_0x26389e['origin']);const _0x5ac82c=Cesium__namespace['Ray'][_0xa96dbb(0xa0a)](_0x26389e,_0x114f8e);!_0x50c0f2[_0x515ea4]&&(_0x50c0f2[_0x515ea4]=_0x5ac82c);}}}}_0x150bbe['view']=_0x150bbe['defaultView'],_0xf22cce['endFrame']();const _0x45c2c1=[];for(let _0x5c1edc=0x0,_0x36c003=_0x50c0f2[_0xa96dbb(0xc84)];_0x5c1edc<_0x36c003;_0x5c1edc++){const _0x4adab5=_0x50c0f2[_0x5c1edc];Cesium__namespace[_0xa96dbb(0xb84)](_0x4adab5)&&_0x45c2c1['push'](_0x4adab5);}_0x4bb6a4=_0x4bb6a4['concat'](_0x45c2c1),_0x1a594a['push']({'distance':_0x1e2e44,'positions':_0x45c2c1});}return _0x150bbe['globe'][_0xa96dbb(0x5d9)]=_0x2e47f7,_0x3bca47['destroy'](),{'positions':_0x4bb6a4,'list':_0x1a594a};}function getDepth(_0x2807ee,_0xff3bb5,_0x569757,_0x39004c,_0x4b5e6f,_0xd73561){const _0x28a7f1={_0x141719:0xe4d},_0x426378=_0x3d5d32,_0x4610dd=_0x2807ee['readPixels']({'x':_0xff3bb5,'y':_0x569757,'width':_0x39004c,'height':_0x4b5e6f,'framebuffer':_0xd73561['framebuffer']}),_0x4df563=Cesium__namespace['Cartesian4']['unpackArray'](_0x4610dd,scratchPackedDepthArray),_0x4873f3=[];for(let _0x36bea9=0x0;_0x36bea9<_0x4df563['length'];++_0x36bea9){const _0x20ffb7=_0x4df563[_0x36bea9];Cesium__namespace['Cartesian4'][_0x426378(_0x28a7f1._0x141719)](_0x20ffb7,0xff,_0x20ffb7);const _0x30e0ae=Cesium__namespace[_0x426378(0xd36)]['dot'](_0x20ffb7,packedDepthScale);_0x4873f3['push'](_0x30e0ae);}return _0x4873f3;}function updateOffscreenCamera(_0x366c58,_0x79c421,_0x1614c2,_0xab6a32,_0x5f4379,_0x7a1155){const _0x4365e2={_0x38de28:0x389,_0x25851d:0x490},_0x40ab4e=_0x3d5d32,_0x409e98=Cesium__namespace['Cartesian3']['cross'](_0x79c421,_0x1614c2,scratchRight);return _0x7a1155['position']=_0x366c58,_0x7a1155['direction']=_0x79c421,_0x7a1155['up']=_0x1614c2,_0x7a1155['right']=_0x409e98,_0x7a1155['frustum']['width']=_0xab6a32,_0x7a1155[_0x40ab4e(_0x4365e2._0x38de28)][_0x40ab4e(0xc06)]=_0xab6a32/_0x5f4379,_0x7a1155['frustum']['computeCullingVolume'](_0x7a1155['positionWC'],_0x7a1155[_0x40ab4e(_0x4365e2._0x25851d)],_0x7a1155['upWC']);}function getCameraInforForPoints(_0x17e037,_0x37167f){const _0x1190f5={_0x30bee1:0x406,_0x1b7cb8:0x25a,_0x4ff2bb:0xdee,_0xb401e8:0xd97,_0x336919:0x8a4,_0x74e4c5:0x220,_0x5e55a6:0xbd7},_0x39735a=_0x3d5d32,_0x343652=Cesium__namespace[_0x39735a(0x756)]['fromCartesianArray'](_0x17e037),_0x5bb10d=Cesium__namespace['Rectangle']['center'](_0x343652),_0x5ae15b=Cesium__namespace['Cartesian3']['fromRadians'](_0x5bb10d['longitude'],_0x5bb10d[_0x39735a(_0x1190f5._0x30bee1)],_0x37167f),_0x2ba779=Cesium__namespace[_0x39735a(_0x1190f5._0x1b7cb8)][_0x39735a(_0x1190f5._0x4ff2bb)]['geodeticSurfaceNormal'](_0x5ae15b);Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x2ba779,-0x1,_0x2ba779);const _0x3e9a2e=Cesium__namespace['Cartesian3'][_0x39735a(0x7d1)](_0x5bb10d['longitude'],_0x5bb10d['latitude']+_0x343652['height']/0x2,_0x37167f),_0x2fc571=Cesium__namespace[_0x39735a(0xe95)][_0x39735a(_0x1190f5._0xb401e8)](_0x3e9a2e,_0x5ae15b,new Cesium__namespace['Cartesian3']()),_0x1c4a12=new Cesium__namespace['Ray'](_0x5ae15b,_0x2ba779),_0x1bca08=Cesium__namespace['Rectangle'][_0x39735a(_0x1190f5._0x336919)](_0x343652),_0x250e55=Cesium__namespace['Rectangle'][_0x39735a(0x344)](_0x343652),_0x221b90=Cesium__namespace['Rectangle']['northwest'](_0x343652),_0x292153=Cesium__namespace['Cartographic'][_0x39735a(0xed4)](_0x1bca08),_0x3d3071=Cesium__namespace['Cartographic']['toCartesian'](_0x250e55),_0x47eb3d=Cesium__namespace[_0x39735a(_0x1190f5._0x74e4c5)]['toCartesian'](_0x221b90),_0x41fd4c=Cesium__namespace['Cartesian3']['distance'](_0x292153,_0x3d3071),_0x16edcd=Cesium__namespace['Cartesian3'][_0x39735a(_0x1190f5._0x5e55a6)](_0x292153,_0x47eb3d);return{'ray':_0x1c4a12,'frustumWidth':_0x41fd4c,'frustumHeight':_0x16edcd,'cameraUp':_0x2fc571};}function pointInPolygonNested(_0x4dac6f,_0x59530c){const _0x58358a=_0x3d5d32,_0x4f39fe=_0x4dac6f[0x0],_0x581b22=_0x4dac6f[0x1];let _0x5ba58f=![];const _0xe82238=_0x59530c[_0x58358a(0xc84)];for(let _0x1eba23=0x0,_0x5d7a6a=_0xe82238-0x1;_0x1eba23<_0xe82238;_0x5d7a6a=_0x1eba23++){const _0x29f137=_0x59530c[_0x1eba23][0x0],_0x7ced58=_0x59530c[_0x1eba23][0x1],_0x50b4eb=_0x59530c[_0x5d7a6a][0x0],_0x3e7d77=_0x59530c[_0x5d7a6a][0x1],_0x17084c=_0x7ced58>_0x581b22!==_0x3e7d77>_0x581b22&&_0x4f39fe<(_0x50b4eb-_0x29f137)*(_0x581b22-_0x7ced58)/(_0x3e7d77-_0x7ced58)+_0x29f137;_0x17084c&&(_0x5ba58f=!_0x5ba58f);}return _0x5ba58f;}function getBoxOutLine(_0x31c46f,_0x2114e4,_0x1d1b0a,_0x1e6fb4){const _0x10927f={_0x4f1d43:0xe95,_0x29db48:0xff3,_0x1eb202:0xff3},_0x3a410c=_0x3d5d32,_0x1e445a=Cesium__namespace['Cartesian3']['normalize'](_0x31c46f,new Cesium__namespace['Cartesian3']()),_0x128dbe=Cesium__namespace['Cartesian3']['cross'](_0x1e6fb4,_0x1e445a,_0x1e445a);Cesium__namespace['Cartesian3'][_0x3a410c(0xadd)](_0x128dbe,_0x2114e4/0x2,_0x128dbe);const _0x41317d=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x1e6fb4,_0x1d1b0a/0x2,new Cesium__namespace['Cartesian3']()),_0xeda46b=Cesium__namespace[_0x3a410c(_0x10927f._0x4f1d43)]['add'](_0x31c46f,_0x41317d,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3']['add'](_0xeda46b,_0x128dbe,_0xeda46b);const _0x7d0145=Cesium__namespace['Cartesian3'][_0x3a410c(_0x10927f._0x29db48)](_0x31c46f,_0x41317d,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3']['subtract'](_0x7d0145,_0x128dbe,_0x7d0145);const _0x28e6d3=Cesium__namespace['Cartesian3']['subtract'](_0x31c46f,_0x41317d,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3'][_0x3a410c(_0x10927f._0x1eb202)](_0x28e6d3,_0x128dbe,_0x28e6d3);const _0x18b5fe=Cesium__namespace[_0x3a410c(0xe95)]['subtract'](_0x31c46f,_0x41317d,new Cesium__namespace['Cartesian3']());return Cesium__namespace['Cartesian3'][_0x3a410c(0xd97)](_0x18b5fe,_0x128dbe,_0x18b5fe),[_0xeda46b,_0x28e6d3,_0x18b5fe,_0x7d0145];}const scratchPerspectiveFrustum$1=new Cesium__namespace['PerspectiveFrustum'](),scratchPerspectiveOffCenterFrustum$1=new Cesium__namespace['PerspectiveOffCenterFrustum'](),scratchOrthographicFrustum$1=new Cesium__namespace['OrthographicFrustum'](),scratchOrthographicOffCenterFrustum$1=new Cesium__namespace['OrthographicOffCenterFrustum']();function getRayIntersectingPositions(_0x4470ce,_0x20edee,_0x3a7c3a){const _0x17c3ed={_0x4839d6:0xf4e,_0x440514:0xf3e,_0x2fe090:0x435,_0x3ffc07:0x435,_0x2f7498:0x315,_0x3f66db:0x389},_0x4c6954=_0x3d5d32,{context:_0x2990a8,frameState:_0x32525c}=_0x4470ce,{uniformState:_0x403ac0}=_0x2990a8,_0x259332=_0x4470ce['camera'],_0x3f87bc=_0x20edee['_pickOffscreenView'],_0x2445f5=new Cesium__namespace['BoundingRectangle'](0x0,0x0,_0x3a7c3a,_0x3a7c3a);_0x3f87bc['viewport']=_0x2445f5,_0x3f87bc['passState']['viewport']=_0x2445f5,_0x4470ce['view']=_0x3f87bc,_0x3f87bc['camera']=_0x259332,Cesium__namespace['BoundingRectangle']['clone'](_0x3f87bc['viewport'],scratchRectangle);const _0x152bce=_0x3f87bc['pickFramebuffer']['begin'](scratchRectangle,_0x3f87bc['viewport']);_0x4470ce['jobScheduler']['disableThisFrame'](),_0x4470ce['updateFrameState'](),_0x32525c['invertClassification']=![],_0x32525c['passes']['pick']=!![],_0x32525c['passes']['offscreen']=!![],_0x32525c[_0x4c6954(0x557)]=pickTilesetPassState,_0x403ac0['update'](_0x32525c),_0x4470ce['updateEnvironment'](),_0x4470ce[_0x4c6954(_0x17c3ed._0x4839d6)](_0x152bce,scratchColorZero),_0x4470ce[_0x4c6954(_0x17c3ed._0x440514)](_0x152bce);let _0x46ea05;if(Cesium__namespace['defined'](_0x3f87bc[_0x4c6954(_0x17c3ed._0x2fe090)]['frustum']['fov']))_0x46ea05=_0x3f87bc['camera']['frustum']['clone'](scratchPerspectiveFrustum$1);else{if(Cesium__namespace[_0x4c6954(0xb84)](_0x3f87bc[_0x4c6954(_0x17c3ed._0x3ffc07)]['frustum']['infiniteProjectionMatrix']))_0x46ea05=_0x3f87bc['camera']['frustum'][_0x4c6954(_0x17c3ed._0x2f7498)](scratchPerspectiveOffCenterFrustum$1);else Cesium__namespace['defined'](_0x3f87bc[_0x4c6954(0x435)][_0x4c6954(_0x17c3ed._0x3f66db)][_0x4c6954(0x1076)])?_0x46ea05=_0x3f87bc['camera']['frustum']['clone'](scratchOrthographicFrustum$1):_0x46ea05=_0x3f87bc['camera']['frustum']['clone'](scratchOrthographicOffCenterFrustum$1);}const _0x39965b=new Array(_0x3a7c3a);for(let _0x1ae0a0=0x0;_0x1ae0a0<_0x3a7c3a;_0x1ae0a0++){_0x39965b[_0x1ae0a0]=new Array(_0x3a7c3a);}if(_0x2990a8['depthTexture']){const _0x1ca478=_0x20edee['getPickDepth'](_0x4470ce,0x0),_0x406b65=getDepth(_0x2990a8,0x0,0x0,_0x3a7c3a,_0x3a7c3a,_0x1ca478);for(let _0x2acb90=0x0;_0x2acb90<_0x406b65['length'];_0x2acb90++){const _0x47c4e0=_0x406b65[_0x2acb90];if(_0x47c4e0>0x0&&_0x47c4e0<0x1){const _0x22df1f=_0x3f87bc['frustumCommandsList'][0x0];if(!_0x22df1f)continue;const _0x582b70=Math['floor'](_0x2acb90/_0x3a7c3a),_0x4ea214=_0x2acb90%_0x3a7c3a;_0x46ea05[_0x4c6954(0x585)]=_0x22df1f[_0x4c6954(0x585)]*_0x4470ce['opaqueFrustumNearOffset'],_0x46ea05['far']=_0x22df1f['far'],_0x403ac0['updateFrustum'](_0x46ea05);const _0x260f83=Cesium__namespace[_0x4c6954(0x54d)]['drawingBufferToWgs84Coordinates'](_0x4470ce,new Cesium__namespace['Cartesian2'](_0x4ea214,_0x582b70),_0x47c4e0,new Cesium__namespace['Cartesian3']());_0x39965b[_0x4ea214][_0x582b70]=_0x260f83;}}}return _0x4470ce['view']=_0x4470ce['defaultView'],_0x2990a8['endFrame'](),_0x39965b;}function centerOfMass(_0x517001,_0x3f4bda){const _0x38d00d={_0x4ace6d:0xc84,_0x51aaa3:0xeb1,_0x44b074:0xe72},_0x511710=_0x3d5d32;if(!_0x517001||_0x517001[_0x511710(_0x38d00d._0x4ace6d)]===0x0)return;const _0x1bc525=LngLatArray['toCartesians'](_0x517001);try{if(_0x1bc525['length']===0x1)return _0x1bc525[0x0];else{if(_0x1bc525['length']===0x2)return getMidpoint(_0x1bc525[0x0],_0x1bc525[0x1]);}_0x3f4bda==null&&(_0x3f4bda=getMaxHeight(_0x1bc525));const _0x37db20=Cesium__namespace[_0x511710(0x756)][_0x511710(_0x38d00d._0x51aaa3)](_0x1bc525),_0x251d3a=Cesium__namespace['Rectangle'][_0x511710(_0x38d00d._0x44b074)](_0x37db20),_0xa14279=Cesium__namespace['Cartesian3']['fromRadians'](_0x251d3a['longitude'],_0x251d3a[_0x511710(0x406)],_0x3f4bda);return _0xa14279;}catch(_0x449dc9){return _0x1bc525[Math['floor'](_0x1bc525[_0x511710(_0x38d00d._0x4ace6d)]/0x2)];}}function buffer(_0x2f7cac,_0x4d53c0=0x1,_0x4e381c=0x8){const _0x3369a5={_0x175f91:0x942,_0x4972f0:0x5a7,_0x72a2bd:0x2ae,_0x2ccaef:0xc84},_0x4065fa=_0x3d5d32;try{var _0x31cd92,_0x1381d0;if(((_0x31cd92=_0x2f7cac)===null||_0x31cd92===void 0x0?void 0x0:(_0x1381d0=_0x31cd92['geometry'])===null||_0x1381d0===void 0x0?void 0x0:_0x1381d0[_0x4065fa(0x7f5)])===_0x4065fa(_0x3369a5._0x175f91)){const _0x4f2416=_0x2f7cac[_0x4065fa(_0x3369a5._0x4972f0)][_0x4065fa(_0x3369a5._0x72a2bd)][0x0],_0x40ac7e=_0x4f2416[0x0],_0x85f513=_0x4f2416[_0x4f2416[_0x4065fa(_0x3369a5._0x2ccaef)]-0x1];(_0x40ac7e[0x0]!==_0x85f513[0x0]||_0x40ac7e[0x1]!==_0x85f513[0x1])&&_0x4f2416['push'](_0x40ac7e);}_0x2f7cac=buffer$1(_0x2f7cac,_0x4d53c0,{'units':'meters','steps':_0x4e381c});}catch(_0x367800){logError$1('PolyUtil\x20turf.buffer:缓冲分析异常\x20',_0x367800);}return _0x2f7cac;}function bufferPoints(_0x555621,_0x4a642d=0x1,_0x5760b1=0x8){const _0x11a56c={_0x1a0512:0x4d4},_0xb23853=_0x3d5d32;try{const _0x56f38d=LngLatArray[_0xb23853(_0x11a56c._0x1a0512)](_0x555621),_0x10b892=_0x56f38d[0x0],_0x4f20ea=_0x56f38d[_0x56f38d['length']-0x1];(_0x10b892[0x0]!==_0x4f20ea[0x0]||_0x10b892[0x1]!==_0x4f20ea[0x1])&&_0x56f38d['push'](_0x56f38d[0x0]);const _0x7b9282={'type':_0xb23853(0x5fc),'geometry':{'type':'Polygon','coordinates':[_0x56f38d]}},_0x466c0e=buffer$1(_0x7b9282,_0x4a642d,{'units':'meters','steps':_0x5760b1});return LngLatArray[_0xb23853(0x4fc)](_0x466c0e[_0xb23853(0x5a7)]['coordinates'][0x0]);}catch(_0x2007f8){logError$1('PolyUtil\x20buffer:缓冲分析异常',_0x2007f8);}return _0x555621;}function getGranularity(_0x3f1e5c,_0x55b353=0xa){const _0x154f04={_0x46aa60:0x890},_0x394a54=_0x3d5d32,_0x1bec1d=Cesium__namespace['Rectangle']['fromCartesianArray'](LngLatArray[_0x394a54(_0x154f04._0x46aa60)](_0x3f1e5c));let _0x4d98e7=Math['max'](_0x1bec1d['height'],_0x1bec1d['width']);return _0x4d98e7/=_0x55b353,_0x4d98e7;}function interPolygon(_0x34dbd3){const _0x459d1f=_0x3d5d32,_0x3fc262=_0x34dbd3['scene'],_0x1d110d=LngLatArray['toCartesians'](_0x34dbd3[_0x459d1f(0xbb8)],!![]),_0x29b61f=getGranularity(_0x1d110d,_0x34dbd3[_0x459d1f(0x7a6)]);return new Promise((_0x504bc6,_0x5af975)=>{const _0xbb7f2a={_0x3e55d6:0x643,_0x244455:0xea0,_0x476b2e:0xb69,_0x323458:0xe95,_0x2823ae:0xb69,_0x205569:0xb75,_0x44d57d:0x44d};setTimeout(()=>{const _0x1e7dcc={_0xb7e538:0x9eb,_0x3f8884:0x9eb,_0x31c213:0x9f7},_0x524cb9={_0x1f6918:0x463,_0x880334:0xbfd},_0x5c1ae1=_0x4132,_0x5b9a8d=[],_0x1fb0dc=new Cesium__namespace['PolygonGeometry']['fromPositions']({'positions':_0x1d110d,'vertexFormat':Cesium__namespace['PerInstanceColorAppearance'][_0x5c1ae1(_0xbb7f2a._0x3e55d6)],'granularity':_0x29b61f}),_0x3b0c88=new Cesium__namespace['PolygonGeometry'][(_0x5c1ae1(0xfa3))](_0x1fb0dc);let _0x3fe79c,_0x4db62e,_0x444c39,_0x47067c,_0xa5c7cd,_0x183001;for(let _0x4c9226=0x0;_0x4c9226<_0x3b0c88[_0x5c1ae1(0xea0)]['length'];_0x4c9226+=0x3){_0x3fe79c=_0x3b0c88['indices'][_0x4c9226],_0x4db62e=_0x3b0c88[_0x5c1ae1(_0xbb7f2a._0x244455)][_0x4c9226+0x1],_0x444c39=_0x3b0c88['indices'][_0x4c9226+0x2],_0x47067c=new Cesium__namespace[(_0x5c1ae1(0xe95))](_0x3b0c88['attributes']['position']['values'][_0x3fe79c*0x3],_0x3b0c88['attributes']['position']['values'][_0x3fe79c*0x3+0x1],_0x3b0c88['attributes'][_0x5c1ae1(_0xbb7f2a._0x476b2e)]['values'][_0x3fe79c*0x3+0x2]),_0x5b9a8d['push'](_0x47067c),_0xa5c7cd=new Cesium__namespace['Cartesian3'](_0x3b0c88['attributes']['position']['values'][_0x4db62e*0x3],_0x3b0c88['attributes'][_0x5c1ae1(0xb69)]['values'][_0x4db62e*0x3+0x1],_0x3b0c88['attributes']['position']['values'][_0x4db62e*0x3+0x2]),_0x5b9a8d['push'](_0xa5c7cd),_0x183001=new Cesium__namespace[(_0x5c1ae1(_0xbb7f2a._0x323458))](_0x3b0c88['attributes'][_0x5c1ae1(_0xbb7f2a._0x2823ae)]['values'][_0x444c39*0x3],_0x3b0c88['attributes'][_0x5c1ae1(_0xbb7f2a._0x2823ae)]['values'][_0x444c39*0x3+0x1],_0x3b0c88['attributes'][_0x5c1ae1(0xb69)]['values'][_0x444c39*0x3+0x2]),_0x5b9a8d[_0x5c1ae1(_0xbb7f2a._0x205569)](_0x183001);}let _0x2604a8=0x0,_0x1ac0a8=0x270f;const _0xb920e1=_0x34dbd3[_0x5c1ae1(0xfb9)]??![];function _0x26ccc2(_0x47bcb1,_0x117297){const _0x3eaad7=_0x5c1ae1;let _0x3439ee,_0x4d6c22,_0xba4c47,_0x356ed5;return _0x117297?(delete _0x34dbd3[_0x3eaad7(_0x524cb9._0x1f6918)],_0x3439ee=getHeight(_0x3fc262,_0x47bcb1,_0x34dbd3),_0x356ed5=Cesium__namespace['Cartographic'][_0x3eaad7(0xd14)](_0x47bcb1),_0x4d6c22=Cesium__namespace['Cartesian3']['fromRadians'](_0x356ed5[_0x3eaad7(_0x524cb9._0x880334)],_0x356ed5[_0x3eaad7(0x406)],0x0),_0xba4c47=Cesium__namespace[_0x3eaad7(0xe95)]['fromRadians'](_0x356ed5['longitude'],_0x356ed5['latitude'],_0x3439ee)):(_0x356ed5=Cesium__namespace['Cartographic']['fromCartesian'](_0x47bcb1),_0x3439ee=_0x356ed5['height'],_0x4d6c22=Cesium__namespace[_0x3eaad7(0xe95)]['fromRadians'](_0x356ed5[_0x3eaad7(0xbfd)],_0x356ed5['latitude'],0x0),_0xba4c47=_0x47bcb1),_0x2604a8<_0x3439ee&&(_0x2604a8=_0x3439ee),_0x1ac0a8>_0x3439ee&&(_0x1ac0a8=_0x3439ee),{'height':_0x3439ee,'point':_0x4d6c22,'pointDM':_0xba4c47};}function _0x4d500f(_0x5b4d35){const _0x57681a=_0x5c1ae1,_0x7ee076=[];let _0x2938df,_0x5a6a5c,_0x5d8654;for(let _0x9201a9=0x0;_0x9201a9<_0x5b4d35[_0x57681a(0xbb8)]['length'];_0x9201a9+=0x3){_0x2938df=_0x26ccc2(_0x5b4d35['positions'][_0x9201a9],_0x5b4d35['noHeight']),_0x5a6a5c=_0x26ccc2(_0x5b4d35['positions'][_0x9201a9+0x1],_0x5b4d35[_0x57681a(_0x1e7dcc._0xb7e538)]),_0x5d8654=_0x26ccc2(_0x5b4d35['positions'][_0x9201a9+0x2],_0x5b4d35[_0x57681a(_0x1e7dcc._0x3f8884)]),_0xb920e1?(addPointFoyArrOnly(_0x7ee076,_0x2938df),addPointFoyArrOnly(_0x7ee076,_0x5a6a5c),addPointFoyArrOnly(_0x7ee076,_0x5d8654)):_0x7ee076['push']({'point1':_0x2938df,'point2':_0x5a6a5c,'point3':_0x5d8654});}Cesium__namespace[_0x57681a(0xb84)](_0x34dbd3['minHeight'])&&(_0x1ac0a8=Math[_0x57681a(0xe8e)](_0x34dbd3['minHeight'],_0x1ac0a8),_0x2604a8=Math['max'](_0x2604a8,_0x1ac0a8)),_0x5b4d35[_0x57681a(_0x1e7dcc._0x31c213)]=_0x29b61f,_0x5b4d35['maxHeight']=_0x2604a8,_0x5b4d35[_0x57681a(0xa28)]=_0x1ac0a8,_0x5b4d35['list']=_0x7ee076,_0x34dbd3['callback']&&_0x34dbd3['callback'](_0x5b4d35),_0x504bc6(_0x5b4d35);}_0x34dbd3['exact']?computeSurfacePoints({'scene':_0x3fc262,'positions':_0x5b9a8d,'has3dtiles':_0x34dbd3['has3dtiles'],'exact':_0x34dbd3[_0x5c1ae1(0x5ec)]})[_0x5c1ae1(_0xbb7f2a._0x44d57d)](_0x4d500f):_0x4d500f({'positions':_0x5b9a8d,'noHeight':!![],'has3dtiles':_0x34dbd3['has3dtiles'],'hasTerrain':_0x34dbd3['hasTerrain']});},0x32);});}function addPointFoyArrOnly(_0x5b118b,_0x53393e){const _0x4a9c53=_0x3d5d32;let _0x4af24f=![];const _0x306949=_0x53393e['point'];for(let _0x5062e9=0x0;_0x5062e9<_0x5b118b[_0x4a9c53(0xc84)];_0x5062e9++){const _0x508322=_0x5b118b[_0x5062e9][_0x4a9c53(0xbbe)];if(_0x306949['x']===_0x508322['x']&&_0x306949['y']===_0x508322['y']&&_0x306949['z']===_0x508322['z']){_0x4af24f=!![];break;}}!_0x4af24f&&_0x5b118b['push'](_0x53393e);}function getHeightRange(_0x24a668,_0x16dff9,_0x1b1e3a){return interPolygon({'positions':_0x24a668,'scene':_0x16dff9,..._0x1b1e3a});}function getTriangleArea$1(_0x133f9c,_0x3c5fa0,_0x486236){const _0x53067e={_0x3c77a8:0xe95,_0x5f5583:0xbd7,_0x3f9aad:0xe95,_0x229c5e:0xae3},_0x297a29=_0x3d5d32,_0x58c7b7=Cesium__namespace[_0x297a29(0xe95)]['distance'](_0x133f9c,_0x3c5fa0),_0x52d717=Cesium__namespace[_0x297a29(_0x53067e._0x3c77a8)][_0x297a29(_0x53067e._0x5f5583)](_0x3c5fa0,_0x486236),_0xcfda=Cesium__namespace[_0x297a29(_0x53067e._0x3f9aad)]['distance'](_0x486236,_0x133f9c),_0x3f65ab=(_0x58c7b7+_0x52d717+_0xcfda)/0x2;return Math[_0x297a29(_0x53067e._0x229c5e)](_0x3f65ab*(_0x3f65ab-_0x58c7b7)*(_0x3f65ab-_0x52d717)*(_0x3f65ab-_0xcfda));}function computeVolume(_0xe4d2ec){const _0x296745={_0x3e97bc:0x44d},_0x5abe7d=_0x3d5d32;return interPolygon(_0xe4d2ec)[_0x5abe7d(_0x296745._0x3e97bc)](_0x2cc9c9=>{return updateVolumeByMinHeight(_0x2cc9c9);});}function updateVolumeByMinHeight(_0x41c020){const _0x5dc77c=_0x3d5d32,_0x36a5ba=_0x41c020[_0x5dc77c(0xa28)];let _0x583cca=0x0,_0x18d5bd=0x0;for(let _0x3d4426=0x0,_0x29694f=_0x41c020['list']['length'];_0x3d4426<_0x29694f;_0x3d4426++){const _0x3dad08=_0x41c020['list'][_0x3d4426],_0x40e8e1=_0x3dad08['point1'],_0x7a1e86=_0x3dad08['point2'],_0x5bbfea=_0x3dad08[_0x5dc77c(0xd64)],_0xbd76fe=getTriangleArea$1(_0x40e8e1['point'],_0x7a1e86[_0x5dc77c(0xbbe)],_0x5bbfea['point']);_0x3dad08['area']=_0xbd76fe,_0x583cca+=_0xbd76fe;let _0x158743=_0x40e8e1['height'],_0x5e9850=_0x7a1e86['height'],_0x571ad2=_0x5bbfea['height'];_0x158743<_0x36a5ba&&(_0x158743=_0x36a5ba);_0x5e9850<_0x36a5ba&&(_0x5e9850=_0x36a5ba);_0x571ad2<_0x36a5ba&&(_0x571ad2=_0x36a5ba);const _0x2548fd=_0xbd76fe*(_0x158743-_0x36a5ba+_0x5e9850-_0x36a5ba+_0x571ad2-_0x36a5ba)/0x3;_0x3dad08[_0x5dc77c(0xa15)]=_0x2548fd,_0x18d5bd=_0x18d5bd+_0x2548fd;}return _0x41c020['totalArea']=_0x583cca,_0x41c020['totalVolume']=_0x18d5bd,_0x41c020;}function updateVolume(_0x3a95c6,_0x1d831d){const _0x5ea64d={_0x1e9922:0x772},_0x250efd=_0x3d5d32;if(!_0x3a95c6)return;const _0x2f248e=_0x3a95c6['minHeight'],_0x454d6f=_0x3a95c6['totalVolume'];if(_0x1d831d<=_0x2f248e)return _0x3a95c6['fillVolume']=0x0,_0x3a95c6['digVolume']=_0x454d6f,_0x3a95c6;let _0x121802=0x0,_0x240fe=0x0;for(let _0x242f4f=0x0,_0x88aca9=_0x3a95c6['list'][_0x250efd(0xc84)];_0x242f4f<_0x88aca9;_0x242f4f++){const _0x17a0f4=_0x3a95c6['list'][_0x242f4f];_0x121802+=_0x17a0f4['area']*(_0x1d831d-_0x2f248e);const _0x117a9a=_0x17a0f4['point1'],_0x5949e4=_0x17a0f4[_0x250efd(0xb3a)],_0x223c1c=_0x17a0f4['point3'];let _0x144745=_0x117a9a['height'],_0x53bdea=_0x5949e4['height'],_0xde17e0=_0x223c1c['height'];_0x144745<_0x1d831d&&(_0x144745=_0x1d831d),_0x53bdea<_0x1d831d&&(_0x53bdea=_0x1d831d),_0xde17e0<_0x1d831d&&(_0xde17e0=_0x1d831d),_0x240fe+=_0x17a0f4[_0x250efd(_0x5ea64d._0x1e9922)]*(_0x144745-_0x1d831d+_0x53bdea-_0x1d831d+_0xde17e0-_0x1d831d)/0x3;}return _0x3a95c6[_0x250efd(0xbe3)]=_0x240fe,_0x3a95c6['fillVolume']=_0x121802-(_0x454d6f-_0x240fe),_0x3a95c6;}function getEllipseOuterPositions(_0x2603f8){const _0x49a496={_0x25de08:0xc25},_0x254210=_0x3d5d32;let _0x597c32=_0x2603f8['position'];if(!_0x597c32)return null;_0x597c32=LngLatPoint['toCartesian'](_0x597c32);const _0x5667ed=_0x2603f8['semiMajorAxis']??_0x2603f8['radius'],_0x5c2df4=_0x2603f8['semiMinorAxis']??_0x2603f8[_0x254210(0xd61)];if(!_0x5667ed||!_0x5c2df4)return[_0x597c32,_0x597c32,_0x597c32];const _0x14dee4=_0x2603f8['rotation']??0x0;let _0x3d95ac=_0x2603f8[_0x254210(0x9f7)]||Cesium__namespace[_0x254210(0x103e)]['RADIANS_PER_DEGREE'];_0x2603f8[_0x254210(0xc25)]&&(_0x3d95ac=Math['PI']/(0x10*_0x2603f8[_0x254210(_0x49a496._0x25de08)]));const _0x1ea6e6=Cesium__namespace['EllipseGeometryLibrary']['computeEllipsePositions']({'center':_0x597c32,'semiMajorAxis':_0x5667ed,'semiMinorAxis':_0x5c2df4,'rotation':_0x14dee4,'granularity':_0x3d95ac},!![],!![]),_0x50ae61=_0x1ea6e6['outerPositions'],_0x297070=[];for(let _0x2f6808=0x0,_0x197346=_0x50ae61['length'];_0x2f6808<_0x197346;_0x2f6808+=0x3){const _0x1e6d15=new Cesium__namespace['Cartesian3'](_0x50ae61[_0x2f6808],_0x50ae61[_0x2f6808+0x1],_0x50ae61[_0x2f6808+0x2]);_0x297070['push'](_0x1e6d15);}return _0x297070;}function formatRectangle(_0x148a43,_0x1933cc=LngLatPoint['FormatLength']){const _0x365f71={_0x604947:0xd3a},_0x5e4b21=_0x3d5d32;let _0x445b00=formatNum$1(Cesium__namespace[_0x5e4b21(0x103e)]['toDegrees'](_0x148a43['west']),_0x1933cc),_0x158895=formatNum$1(Cesium__namespace['Math'][_0x5e4b21(0xa1f)](_0x148a43['east']),_0x1933cc),_0x4cf4fd=formatNum$1(Cesium__namespace['Math'][_0x5e4b21(0xa1f)](_0x148a43[_0x5e4b21(_0x365f71._0x604947)]),_0x1933cc),_0x1253be=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x148a43['south']),_0x1933cc);if(_0x445b00>_0x158895){const _0x218f1c=_0x445b00;_0x445b00=_0x158895,_0x158895=_0x218f1c;}if(_0x1253be>_0x4cf4fd){const _0x2c254f=_0x1253be;_0x1253be=_0x4cf4fd,_0x4cf4fd=_0x2c254f;}return{'xmin':_0x445b00,'xmax':_0x158895,'ymin':_0x1253be,'ymax':_0x4cf4fd};}function getExtentByGeoJSON(_0x12d2ad){const _0x31e31e=bbox(_0x12d2ad);if(_0x31e31e&&_0x31e31e['length']===0x4)return{'xmin':_0x31e31e[0x0],'ymin':_0x31e31e[0x1],'xmax':_0x31e31e[0x2],'ymax':_0x31e31e[0x3]};return null;}function getRectangle(_0x3f9503,_0x363182){const _0x5a26f8={_0x248752:0xb84,_0x335ec6:0x756},_0x11c874=_0x3d5d32;if(!_0x3f9503)return null;for(let _0x3bfb0f=_0x3f9503['length']-0x1;_0x3bfb0f>=0x0;_0x3bfb0f--){!Cesium__namespace[_0x11c874(_0x5a26f8._0x248752)](_0x3f9503[_0x3bfb0f])&&_0x3f9503[_0x11c874(0x1008)](_0x3bfb0f,0x1);}_0x3f9503=LngLatArray['toCartesians'](_0x3f9503);const _0x5b518c=Cesium__namespace[_0x11c874(_0x5a26f8._0x335ec6)]['fromCartesianArray'](_0x3f9503);return _0x363182?formatRectangle(_0x5b518c):_0x5b518c;}function getPositionsRectVertex(_0x4c8c90,_0x203043=0x0){const _0x486a2=_0x3d5d32;_0x4c8c90=LngLatArray['toCartesians'](_0x4c8c90);const _0x1782b5=Cesium__namespace[_0x486a2(0x756)]['fromCartesianArray'](_0x4c8c90),_0x468d34=getMaxHeight(_0x4c8c90),_0x57ac6e=getRectangleOuterPositions({'rectangle':_0x1782b5,'rotation':_0x203043,'height':_0x468d34});return _0x57ac6e;}function getRectangleOuterPositions(_0x4957e7){const _0x20c721={_0x104bb4:0xe95,_0x523a59:0x103e,_0x483de3:0x756,_0x1046b6:0x220,_0x214396:0x6a5,_0x50ca0a:0x5f0,_0xae0456:0x5ac,_0x1e3fce:0x6a5,_0x50a0be:0x617},_0x2a4e0a=_0x3d5d32,_0xfe4393=_0x4957e7['rectangle'],_0x2300b8=_0x4957e7['rotation']??0x0,_0x4d850b=_0x4957e7['height']??0x0;if(_0x2300b8===0x0)return[Cesium__namespace['Cartesian3'][_0x2a4e0a(0x7d1)](_0xfe4393['west'],_0xfe4393['south'],_0x4d850b),Cesium__namespace[_0x2a4e0a(_0x20c721._0x104bb4)]['fromRadians'](_0xfe4393['east'],_0xfe4393[_0x2a4e0a(0x5ed)],_0x4d850b),Cesium__namespace['Cartesian3']['fromRadians'](_0xfe4393['east'],_0xfe4393['north'],_0x4d850b),Cesium__namespace['Cartesian3']['fromRadians'](_0xfe4393['west'],_0xfe4393['north'],_0x4d850b)];const _0x504241=_0x4957e7['granularity']??Cesium__namespace[_0x2a4e0a(_0x20c721._0x523a59)]['RADIANS_PER_DEGREE'],_0x45a587=new Cesium__namespace[(_0x2a4e0a(_0x20c721._0x483de3))](),_0x4cdecf=new Cesium__namespace[(_0x2a4e0a(_0x20c721._0x1046b6))](),_0x43674c=Cesium__namespace[_0x2a4e0a(_0x20c721._0x214396)][_0x2a4e0a(_0x20c721._0x50ca0a)](_0xfe4393,_0x504241,_0x2300b8,0x0,_0x45a587,_0x4cdecf),_0x5ca684=_0x43674c[_0x2a4e0a(0x83e)],_0x45e29b=_0x43674c[_0x2a4e0a(0x1076)],_0x5bf9a0=_0x4957e7[_0x2a4e0a(_0x20c721._0xae0456)]??Cesium__namespace['Ellipsoid']['WGS84'];let _0x112261=[new Cesium__namespace['Cartesian3'](),new Cesium__namespace['Cartesian3'](),new Cesium__namespace['Cartesian3'](),new Cesium__namespace['Cartesian3']()];return Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x43674c,_0x5bf9a0,![],0x0,0x0,_0x112261[0x0]),Cesium__namespace[_0x2a4e0a(_0x20c721._0x1e3fce)]['computePosition'](_0x43674c,_0x5bf9a0,![],0x0,_0x45e29b-0x1,_0x112261[0x1]),Cesium__namespace['RectangleGeometryLibrary']['computePosition'](_0x43674c,_0x5bf9a0,![],_0x5ca684-0x1,_0x45e29b-0x1,_0x112261[0x2]),Cesium__namespace['RectangleGeometryLibrary'][_0x2a4e0a(_0x20c721._0x50a0be)](_0x43674c,_0x5bf9a0,![],_0x5ca684-0x1,0x0,_0x112261[0x3]),_0x4d850b!==0x0&&(_0x112261=setPositionsHeight(_0x112261,_0x4d850b)),_0x112261;}function getRectPositionsByCenter(_0x2eeedf){const _0x44e5a1={_0x46811c:0xe95},_0x58b7e3=_0x3d5d32,_0x27f56b=LngLatPoint[_0x58b7e3(0xed4)](_0x2eeedf['center']),_0x30b316=_0x2eeedf[_0x58b7e3(0x1076)],_0x4ce359=_0x2eeedf['height'],_0x8e0cb1=_0x2eeedf[_0x58b7e3(0x31f)]??0x0,_0x2e8a07=_0x2eeedf['originX']??0.5,_0x12b18c=_0x2eeedf[_0x58b7e3(0x24d)]??0.5,_0x6b307b=new Cesium__namespace[(_0x58b7e3(0xf5d))](),_0x18a1f2=new Cesium__namespace['Quaternion'](),_0x536e69=new Cesium__namespace[(_0x58b7e3(0xf5d))](),_0x3823ff=[Cesium__namespace['Cartesian3']['fromElements'](-_0x2e8a07,-_0x12b18c,0x0),Cesium__namespace['Cartesian3']['fromElements'](0x1-_0x2e8a07,-_0x12b18c,0x0),Cesium__namespace['Cartesian3']['fromElements'](0x1-_0x2e8a07,0x1-_0x12b18c,0x0),Cesium__namespace['Cartesian3']['fromElements'](-_0x2e8a07,0x1-_0x12b18c,0x0)],_0x3bf43b=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x27f56b,Cesium__namespace['Ellipsoid'][_0x58b7e3(0xdee)],_0x6b307b),_0x5a9f03=Cesium__namespace[_0x58b7e3(0x97b)]['fromAxisAngle'](Cesium__namespace['Cartesian3']['UNIT_Z'],_0x8e0cb1,_0x18a1f2),_0x4d730d=Cesium__namespace[_0x58b7e3(0xf5d)]['fromTranslationQuaternionRotationScale'],_0x4840f7=_0x4d730d(Cesium__namespace[_0x58b7e3(_0x44e5a1._0x46811c)][_0x58b7e3(0x61a)],_0x5a9f03,Cesium__namespace['Cartesian3']['fromElements'](_0x30b316,_0x4ce359),_0x536e69),_0x1087ae=Cesium__namespace['Matrix4']['multiply'](_0x3bf43b,_0x4840f7,_0x4840f7),_0x1e1f6d=[];return _0x3823ff['forEach'](function(_0x1a9213,_0x5ba977){const _0x279db0=_0x58b7e3;typeof _0x1e1f6d[_0x5ba977]==='undefined'&&(_0x1e1f6d[_0x5ba977]=new Cesium__namespace['Cartesian3']()),Cesium__namespace['Matrix4'][_0x279db0(0xc9f)](_0x1087ae,_0x1a9213,_0x1e1f6d[_0x5ba977]);}),_0x1e1f6d;}function isInPoly(_0x32577c,_0x2602b1){const _0x43545a={_0x1b9c39:0x942},_0x393e4e=_0x3d5d32,_0x1449f2={'type':'Feature','geometry':{'type':'Point','coordinates':LngLatPoint['parse'](_0x32577c)['toArray']()}},_0x1c04ff={'type':_0x393e4e(_0x43545a._0x1b9c39),'coordinates':[LngLatArray['toArray'](_0x2602b1)]};return booleanPointInPolygon(_0x1449f2,_0x1c04ff);}function getBezierCurve(_0x3fd375,_0x5117c8){const _0x31ff03={_0x25a1ec:0x5fc},_0x16fbd5=_0x3d5d32;if(!_0x3fd375||_0x3fd375[_0x16fbd5(0xc84)]<0x3)return _0x3fd375;const _0x4cb7a8=LngLatArray['toArray'](_0x3fd375);_0x5117c8!==null&&_0x5117c8!==void 0x0&&_0x5117c8['closure']&&_0x4cb7a8['push'](_0x4cb7a8[0x0]);const _0x3693fc=_0x4cb7a8[_0x4cb7a8['length']-0x1][0x2],_0x338978=bezierSpline({'type':_0x16fbd5(_0x31ff03._0x25a1ec),'geometry':{'type':'LineString','coordinates':_0x4cb7a8}},{'resolution':(_0x5117c8===null||_0x5117c8===void 0x0?void 0x0:_0x5117c8['resolution'])??0x2710,'sharpness':(_0x5117c8===null||_0x5117c8===void 0x0?void 0x0:_0x5117c8['sharpness'])??0.85}),_0x206ba5=lonlats2cartesians(_0x338978['geometry']['coordinates'],_0x3693fc);return _0x5117c8!==null&&_0x5117c8!==void 0x0&&_0x5117c8['closure']&&_0x206ba5[_0x16fbd5(0xb75)](_0x206ba5[0x0]),_0x206ba5;}function interPolyline(_0x5cc140){const _0x3c6953={_0x5561f5:0xe95,_0x42c69e:0x463,_0x1f09a2:0xd14,_0x5069ca:0xb75},_0x4c398e=_0x3d5d32,_0x31fc1b=LngLatArray['toCartesians'](_0x5cc140[_0x4c398e(0xbb8)]),_0x42c357=_0x5cc140['scene'];let _0x5074fa=getGranularity(_0x31fc1b,_0x5cc140['splitNum']||(_0x5cc140['has3dtiles']?0xa:0x64));_0x5074fa<=0x0&&(_0x5074fa=null);const _0x9cba82=Cesium__namespace[_0x4c398e(0xc0e)]['generateArc']({'positions':_0x31fc1b,'height':_0x5cc140['height'],'minDistance':_0x5cc140['minDistance'],'granularity':_0x5074fa}),_0x7092bb=[];for(let _0x55680f=0x0;_0x55680f<_0x9cba82['length'];_0x55680f+=0x3){let _0x3ad307=Cesium__namespace[_0x4c398e(_0x3c6953._0x5561f5)]['unpack'](_0x9cba82,_0x55680f);if(_0x42c357&&(_0x5cc140['surfaceHeight']??!![])){delete _0x5cc140[_0x4c398e(_0x3c6953._0x42c69e)];const _0x319048=getHeight(_0x42c357,_0x3ad307,_0x5cc140),_0x2fd30f=Cesium__namespace['Cartographic'][_0x4c398e(_0x3c6953._0x1f09a2)](_0x3ad307);_0x3ad307=Cesium__namespace['Cartesian3']['fromRadians'](_0x2fd30f['longitude'],_0x2fd30f['latitude'],_0x319048);}_0x7092bb[_0x4c398e(_0x3c6953._0x5069ca)](_0x3ad307);}return _0x7092bb;}function interLine(_0x2845a5,_0x2861a9={}){const _0x1da46e={_0x4a7efd:0xbad,_0x287d21:0xbad,_0x41019c:0xc84,_0x2054c2:0x220,_0x496c95:0xe95},_0x2bcce5=_0x3d5d32;if(!_0x2845a5||_0x2845a5['length']<0x2)return _0x2845a5;_0x2845a5=LngLatArray['toCartesians'](_0x2845a5);let _0x25675c;_0x2861a9[_0x2bcce5(0x7a6)]&&!Cesium__namespace[_0x2bcce5(0xb84)](_0x2861a9['minDistance'])&&(_0x25675c=getGranularity(_0x2845a5,_0x2861a9['splitNum']),_0x25675c<=0x0&&(_0x25675c=null));if(_0x2861a9[_0x2bcce5(_0x1da46e._0x4a7efd)]==='auto'){let _0x2e2a31=Number['MAX_VALUE'];for(let _0x1aafc1=0x1,_0x30799d=_0x2845a5[_0x2bcce5(0xc84)];_0x1aafc1<_0x30799d;_0x1aafc1++){_0x2e2a31=Math['min'](_0x2e2a31,Cesium__namespace['Cartesian3']['distance'](_0x2845a5[_0x1aafc1-0x1],_0x2845a5[_0x1aafc1]));}_0x2861a9[_0x2bcce5(_0x1da46e._0x287d21)]=_0x2e2a31;}const _0x3d4036=[_0x2845a5[0x0]];for(let _0x36bb5c=0x1,_0x2e073a=_0x2845a5['length'];_0x36bb5c<_0x2e073a;_0x36bb5c++){const _0x40bf83=_0x2845a5[_0x36bb5c-0x1],_0x5a456a=_0x2845a5[_0x36bb5c],_0x3249ad=Cesium__namespace['PolylinePipeline']['generateArc']({'positions':[_0x40bf83,_0x5a456a],'minDistance':_0x2861a9['minDistance'],'granularity':_0x25675c}),_0x174ab7=Cesium__namespace['Cartographic']['fromCartesian'](_0x40bf83)['height'],_0x4fb90f=Cesium__namespace[_0x2bcce5(0x220)][_0x2bcce5(0xd14)](_0x5a456a)['height'],_0x2802e1=(_0x4fb90f-_0x174ab7)/_0x3249ad[_0x2bcce5(_0x1da46e._0x41019c)];for(let _0x3b1b46=0x3,_0x3b74f2=_0x3249ad['length'];_0x3b1b46<_0x3b74f2;_0x3b1b46+=0x3){let _0x45cee2=Cesium__namespace['Cartesian3']['unpack'](_0x3249ad,_0x3b1b46);const _0x3aa1c1=Cesium__namespace[_0x2bcce5(_0x1da46e._0x2054c2)]['fromCartesian'](_0x45cee2),_0x18c20d=Number((_0x174ab7+_0x2802e1*_0x3b1b46)['toFixed'](0x1));_0x45cee2=Cesium__namespace[_0x2bcce5(_0x1da46e._0x496c95)]['fromRadians'](_0x3aa1c1['longitude'],_0x3aa1c1['latitude'],_0x18c20d),_0x3d4036[_0x2bcce5(0xb75)](_0x45cee2);}}return _0x3d4036;}function computeSurfaceLine(_0x3dcc62){const _0x354eda={_0x1a8b42:0xb75},_0x4646f7=_0x3d5d32,_0x323d73=interPolyline({..._0x3dcc62,'surfaceHeight':![]}),_0xa007e3=[];for(let _0x1e3925=0x0,_0x36e33b=_0x323d73['length'];_0x1e3925<_0x36e33b;++_0x1e3925){_0xa007e3[_0x4646f7(_0x354eda._0x1a8b42)](_0x323d73[_0x1e3925][_0x4646f7(0x315)]());}return _0x3dcc62[_0x4646f7(0xbb8)]=_0xa007e3,new SurfacePoints(_0x3dcc62)['start']();}function computeSurfacePoints(_0x2a30d8){const _0x4fc25c=_0x3d5d32;return new SurfacePoints(_0x2a30d8)[_0x4fc25c(0xf6d)]();}function computeStepSurfaceLine(_0x68261a){const _0xa5f23f=_0x68261a['positions'],_0x42bde4=[],_0xf6d5d3={};for(const _0x3b76ac in _0x68261a){if(_0x3b76ac==='positions'||_0x3b76ac==='callback'||_0x3b76ac==='end'||_0x3b76ac==='endItem')continue;_0xf6d5d3[_0x3b76ac]=_0x68261a[_0x3b76ac];}return new Promise((_0x4ad3c0,_0xb187ab)=>{setTimeout(()=>{const _0x23b972={_0x54cedc:0x463,_0x557a44:0xbb8};let _0x455bfc=0x0;const _0x44e8c7=_0xa5f23f['length']-0x1;function _0x34392b(){const _0x54acb2={_0x2bba1f:0xc81,_0xc85bc9:0x9eb},_0x4d134c=_0x4132;if(_0x455bfc>=_0x44e8c7){_0x68261a['callback']&&_0x68261a[_0x4d134c(_0x23b972._0x54cedc)](_0x42bde4);_0x68261a[_0x4d134c(0xb34)]&&_0x68261a['end'](_0x42bde4);_0x4ad3c0(_0x42bde4);return;}_0xf6d5d3[_0x4d134c(_0x23b972._0x557a44)]=interPolyline({..._0x68261a,'positions':[_0xa5f23f[_0x455bfc],_0xa5f23f[_0x455bfc+0x1]],'surfaceHeight':![]}),new SurfacePoints(_0xf6d5d3)['start']()['then'](_0x32569d=>{const _0x4e9879=_0x4d134c;_0x68261a['endItem']&&_0x68261a[_0x4e9879(_0x54acb2._0x2bba1f)](_0x32569d['positions'],_0x32569d[_0x4e9879(_0x54acb2._0xc85bc9)],_0x455bfc),_0x42bde4['push'](_0x32569d['positions']),_0x455bfc++,_0x34392b();});}_0x34392b();},0x32);});}function getLinkedPointList(_0x3d63e8,_0x16a257,_0x5c151f,_0x16a265){const _0x410e56={_0x31f27c:0xd14,_0x2d2c6d:0x406,_0x3e7dde:0xe95,_0xf6ce10:0x723,_0x2e21ed:0xadd,_0x1e75a6:0xff3},_0x5afc82=_0x3d5d32,_0x5a6b96=[];_0x3d63e8=LngLatPoint['toCartesian'](_0x3d63e8),_0x16a257=LngLatPoint['toCartesian'](_0x16a257);const _0x19fff5=Cesium__namespace['Cartographic'][_0x5afc82(_0x410e56._0x31f27c)](_0x3d63e8),_0x31e656=Cesium__namespace['Cartographic']['fromCartesian'](_0x16a257),_0x32568d=_0x19fff5[_0x5afc82(0xbfd)]*0xb4/Math['PI'],_0x4187b5=_0x19fff5[_0x5afc82(_0x410e56._0x2d2c6d)]*0xb4/Math['PI'],_0x32a73e=_0x31e656['longitude']*0xb4/Math['PI'],_0x30bbd6=_0x31e656['latitude']*0xb4/Math['PI'],_0x497557=Math['sqrt']((_0x32568d-_0x32a73e)*(_0x32568d-_0x32a73e)+(_0x4187b5-_0x30bbd6)*(_0x4187b5-_0x30bbd6)),_0x1560f3=_0x497557*_0x5c151f,_0x2a2d4e=Cesium__namespace[_0x5afc82(0xe95)]['clone'](_0x3d63e8),_0x9a8472=Cesium__namespace['Cartesian3']['clone'](_0x16a257),_0x56ed9a=Cesium__namespace['Cartesian3'][_0x5afc82(0xbd7)](_0x2a2d4e,Cesium__namespace['Cartesian3']['ZERO']),_0x12adc0=Cesium__namespace['Cartesian3']['distance'](_0x9a8472,Cesium__namespace['Cartesian3'][_0x5afc82(0x61a)]);Cesium__namespace[_0x5afc82(_0x410e56._0x3e7dde)]['normalize'](_0x2a2d4e,_0x2a2d4e),Cesium__namespace['Cartesian3']['normalize'](_0x9a8472,_0x9a8472);if(Cesium__namespace['Cartesian3']['distance'](_0x2a2d4e,_0x9a8472)===0x0)return _0x5a6b96;const _0x3dabc2=Cesium__namespace['Cartesian3']['angleBetween'](_0x2a2d4e,_0x9a8472);_0x5a6b96['push'](_0x3d63e8);for(let _0x3c4cd0=0x1;_0x3c4cd0<_0x16a265-0x1;_0x3c4cd0++){const _0x36d424=_0x3c4cd0*0x1/(_0x16a265-0x1),_0x4b425e=0x1-_0x36d424,_0x383d87=Math['sin'](_0x4b425e*_0x3dabc2)/Math['sin'](_0x3dabc2),_0x3cafa2=Math[_0x5afc82(_0x410e56._0xf6ce10)](_0x36d424*_0x3dabc2)/Math['sin'](_0x3dabc2),_0x3559a1=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x2a2d4e,_0x383d87,new Cesium__namespace['Cartesian3']()),_0xeb7497=Cesium__namespace[_0x5afc82(_0x410e56._0x3e7dde)][_0x5afc82(_0x410e56._0x2e21ed)](_0x9a8472,_0x3cafa2,new Cesium__namespace['Cartesian3']());let _0x2b38ce=Cesium__namespace['Cartesian3'][_0x5afc82(_0x410e56._0x1e75a6)](_0x3559a1,_0xeb7497,new Cesium__namespace['Cartesian3']());const _0x44e08f=_0x36d424*Math['PI'],_0x58fb4c=_0x56ed9a*_0x4b425e+_0x12adc0*_0x36d424+Math[_0x5afc82(0x723)](_0x44e08f)*_0x1560f3;_0x2b38ce=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x2b38ce,_0x58fb4c,_0x2b38ce),_0x5a6b96['push'](_0x2b38ce);}return _0x5a6b96[_0x5afc82(0xb75)](_0x16a257),_0x5a6b96;}function getOffsetLine(_0x4d5790,_0x5028dc){const _0x4bab50={_0x1a65c3:0xc84,_0x18b841:0x24c},_0x494f14=_0x3d5d32;_0x4d5790=LngLatArray['toCartesians'](_0x4d5790);const _0x2a37d8=[];for(let _0x1677cb=0x1;_0x1677cb<_0x4d5790[_0x494f14(_0x4bab50._0x1a65c3)];_0x1677cb++){const _0x5d9df9=_0x4d5790[_0x1677cb-0x1],_0x2f2c57=_0x4d5790[_0x1677cb],_0x20dce8=Cesium__namespace['Cartesian3']['subtract'](_0x5d9df9,_0x2f2c57,new Cesium__namespace['Cartesian3']()),_0x45b0bd=Cesium__namespace['Cartesian3'][_0x494f14(_0x4bab50._0x18b841)](_0x5d9df9,_0x20dce8,new Cesium__namespace['Cartesian3']()),_0x1c6030=computedOffsetData(_0x5d9df9,_0x45b0bd,_0x5028dc*0x3e8),_0x541018=computedOffsetData(_0x2f2c57,_0x45b0bd,_0x5028dc*0x3e8);_0x1677cb===0x1&&_0x2a37d8['push'](_0x1c6030),_0x2a37d8['push'](_0x541018);}return _0x2a37d8;}function computedOffsetData(_0x1c144b,_0x4e97c9,_0x2972b0){const _0xe3d8ec={_0x49b8a4:0xe95},_0xb42806=_0x3d5d32,_0x516ee8=new Cesium__namespace['Ray'](_0x1c144b,_0x4e97c9);return Cesium__namespace['Ray'][_0xb42806(0xa0a)](_0x516ee8,_0x2972b0,new Cesium__namespace[(_0xb42806(_0xe3d8ec._0x49b8a4))]());}function sliceByMaxDistance(_0x1635e6,_0x42fbf6,_0x117ff7={}){const _0x515cac={_0x4d5847:0xc84,_0x41371b:0xe95,_0x165856:0xbbe,_0x2ef699:0xbbe},_0x520e79=_0x3d5d32;if(!_0x1635e6||_0x1635e6['length']<0x2)return _0x117ff7[_0x520e79(0xbbe)]?_0x1635e6[_0x520e79(_0x515cac._0x4d5847)]===0x1?_0x1635e6[0x0]:undefined:_0x1635e6;_0x1635e6=LngLatArray['toCartesians'](_0x1635e6);for(let _0x5882b2=_0x1635e6['length']-0x1;_0x5882b2>=0x1;_0x5882b2--){const _0x4f1525=_0x1635e6[_0x5882b2],_0x309099=_0x1635e6[_0x5882b2-0x1],_0x39bf24=Cesium__namespace[_0x520e79(_0x515cac._0x41371b)]['distance'](_0x4f1525,_0x309099);_0x42fbf6-=_0x39bf24;if(_0x42fbf6===0x0)return _0x117ff7[_0x520e79(_0x515cac._0x165856)]?_0x4f1525:_0x1635e6[_0x520e79(0x444)](_0x5882b2);else{if(_0x42fbf6<0x0){_0x42fbf6+=_0x39bf24;const _0xd45250=getOnLinePointByLen(_0x4f1525,_0x309099,_0x42fbf6);return _0x117ff7[_0x520e79(_0x515cac._0x2ef699)]?_0xd45250:[_0xd45250]['concat'](_0x1635e6['slice'](_0x5882b2));}}}return _0x117ff7[_0x520e79(0xbbe)]?_0x1635e6[_0x1635e6[_0x520e79(0xc84)]-0x1]:_0x1635e6;}function convex(_0x543f16){const _0x405a15={_0x43ea62:0xb75,_0x2f62b6:0x5a7,_0x235455:0xc84},_0x1f9d8f=_0x3d5d32;if(_0x543f16['length']>0x0){const _0x380f57=[];for(let _0x3b9aca=0x0;_0x3b9aca<_0x543f16[_0x1f9d8f(0xc84)];_0x3b9aca++){_0x380f57[_0x1f9d8f(_0x405a15._0x43ea62)]({'type':_0x1f9d8f(0x5fc),'geometry':{'type':'Point','coordinates':_0x543f16[_0x3b9aca]}});}const _0x4b62c5=convex$1({'type':'FeatureCollection','features':_0x380f57});if(_0x4b62c5){var _0xa3bcce;const _0x38d874=_0x4b62c5===null||_0x4b62c5===void 0x0?void 0x0:(_0xa3bcce=_0x4b62c5[_0x1f9d8f(_0x405a15._0x2f62b6)])===null||_0xa3bcce===void 0x0?void 0x0:_0xa3bcce[_0x1f9d8f(0x2ae)];_0x38d874&&_0x38d874[_0x1f9d8f(_0x405a15._0x235455)]>0x0&&(_0x543f16=_0x38d874[0x0]);}}return _0x543f16;}function getGridPoints(_0x3b4768,_0x4530b,_0x4e981d){const _0x59c96f=_0x3d5d32,_0x2708cb=Cesium__namespace[_0x59c96f(0xe95)]['distance'](Cesium__namespace['Cartesian3']['fromDegrees'](_0x3b4768[0x0],_0x3b4768[0x1]),Cesium__namespace['Cartesian3']['fromDegrees'](_0x3b4768[0x2],_0x3b4768[0x3]))/(Math['sqrt'](0x2)*0x3e8),_0x4f09a7=_0x2708cb/Math['sqrt'](_0x4530b),_0x57f263=pointGrid(_0x3b4768,_0x4f09a7,{'units':'kilometers'}),_0x4f7f9b=[];return _0x57f263['features']['forEach'](_0x4a6d81=>{const _0x5a6f83=_0x4a6d81['geometry']['coordinates'];_0x4f7f9b['push'](new LngLatPoint(_0x5a6f83[0x0],_0x5a6f83[0x1],_0x4e981d));}),{'points':_0x4f7f9b,'radius':Math['floor'](_0x4f09a7*0x3e8/0x2)};}function getGridPointsByPoly(_0x170bb4,_0x586966,_0x1c3e9f){const _0x5327b1={_0x38a2bc:0x83e},_0x2c6dd6={_0x3eaa55:0x90c,_0x21ee00:0xbfd,_0x38f27c:0xe8e},_0x453a51=_0x3d5d32;if(_0x170bb4['length']<0x3)return;const _0x3490d3=LngLatArray['toCartographics'](_0x170bb4),_0x35cc9a=Cesium__namespace[_0x453a51(0xb84)](_0x1c3e9f),_0x5cd97d=_0x3490d3[0x0];let _0xacc233=_0x5cd97d['longitude'],_0x3ac308=_0x5cd97d['longitude'],_0xa386a7=_0x5cd97d['latitude'],_0x4ba67f=_0x5cd97d['latitude'],_0x40db6c=_0x35cc9a?_0x1c3e9f:_0x5cd97d[_0x453a51(_0x5327b1._0x38a2bc)];const _0x45d11b=_0x3490d3['map'](_0x4af87c=>{const _0x435dce=_0x453a51;return _0xacc233=Math[_0x435dce(_0x2c6dd6._0x3eaa55)](_0xacc233,_0x4af87c[_0x435dce(_0x2c6dd6._0x21ee00)]),_0xa386a7=Math['max'](_0xa386a7,_0x4af87c[_0x435dce(0xbfd)]),_0x3ac308=Math['min'](_0x3ac308,_0x4af87c[_0x435dce(0x406)]),_0x4ba67f=Math[_0x435dce(_0x2c6dd6._0x38f27c)](_0x4ba67f,_0x4af87c['latitude']),!_0x35cc9a&&(_0x40db6c=Math['max'](_0x40db6c,_0x4af87c['height'])),_0x4af87c;}),_0x2d8d2c=[],_0xcba20a=_0xa386a7-_0xacc233,_0x78833b=_0x4ba67f-_0x3ac308,_0x5edb1a=_0x586966/distanceCoor([_0xacc233,_0x3ac308],[_0xa386a7,_0x3ac308]),_0x1bdc07=_0x586966/distanceCoor([_0xacc233,_0x3ac308],[_0xacc233,_0x4ba67f]),_0x4aa15a=_0x5edb1a*_0xcba20a,_0xe62963=_0x1bdc07*_0x78833b,_0x4e9a7c=Math['floor'](_0xcba20a/_0x4aa15a),_0x4629a4=Math['floor'](_0x78833b/_0xe62963),_0x30dd0c=(_0xcba20a-_0x4e9a7c*_0x4aa15a)/0x2,_0x35f83b=(_0x78833b-_0x4629a4*_0xe62963)/0x2;let _0x10929b=_0xacc233+_0x30dd0c;while(_0x10929b<=_0xa386a7){let _0x198c6c=_0x3ac308+_0x35f83b;while(_0x198c6c<=_0x4ba67f){if(isInside([_0x10929b,_0x198c6c],_0x45d11b)){const _0x337e3b=Cesium__namespace['Math']['toDegrees'](_0x10929b),_0x25d272=Cesium__namespace['Math']['toDegrees'](_0x198c6c);_0x2d8d2c['push'](new LngLatPoint(_0x337e3b,_0x25d272,_0x40db6c));}_0x198c6c+=_0xe62963;}_0x10929b+=_0x4aa15a;}return _0x2d8d2c;}function distanceCoor(_0x2d65c2,_0xfa5db9){const _0x125c30=_0x3d5d32,_0x52a2e2=_0xfa5db9[0x1]-_0x2d65c2[0x1],_0x207c92=_0xfa5db9[0x0]-_0x2d65c2[0x0],_0x5a15cd=_0x2d65c2[0x1],_0x50c11d=_0xfa5db9[0x1],_0x76b2c4=Math['pow'](Math[_0x125c30(0x723)](_0x52a2e2/0x2),0x2)+Math['pow'](Math[_0x125c30(0x723)](_0x207c92/0x2),0x2)*Math['cos'](_0x5a15cd)*Math['cos'](_0x50c11d);return 0x2*Math['atan2'](Math['sqrt'](_0x76b2c4),Math['sqrt'](0x1-_0x76b2c4))*6371008.8;}function isInside(_0x477f1c,_0x36db9a){const _0x40184c={_0x5eeca2:0xbfd,_0x5f3441:0x406},_0x136695=_0x3d5d32;let _0x3e8e79=![];const _0x2425d5=_0x36db9a['length'],_0x18c0e3=_0x477f1c[0x0],_0x1bb3f1=_0x477f1c[0x1];let _0x36a5f6=_0x36db9a[0x0];for(let _0x572c3d=0x0;_0x572c3d<_0x2425d5;_0x572c3d++){let _0x2632d5=_0x572c3d+0x1;_0x2632d5=_0x2632d5===_0x2425d5?0x0:_0x2632d5;const _0x2afa5d=_0x36db9a[_0x2632d5];if(_0x36a5f6['longitude']===_0x18c0e3&&_0x36a5f6['latitude']===_0x1bb3f1||_0x2afa5d[_0x136695(_0x40184c._0x5eeca2)]===_0x18c0e3&&_0x2afa5d['latitude']===_0x1bb3f1)return!![];else{if(_0x36a5f6[_0x136695(0x406)]<_0x1bb3f1&&_0x2afa5d['latitude']>=_0x1bb3f1||_0x36a5f6[_0x136695(_0x40184c._0x5f3441)]>=_0x1bb3f1&&_0x2afa5d['latitude']<_0x1bb3f1){const _0x5a75e4=_0x36a5f6['longitude']+(_0x1bb3f1-_0x36a5f6['latitude'])*(_0x2afa5d[_0x136695(0xbfd)]-_0x36a5f6['longitude'])/(_0x2afa5d[_0x136695(0x406)]-_0x36a5f6['latitude']);if(_0x5a75e4===_0x18c0e3)return!![];else _0x5a75e4>_0x18c0e3&&(_0x3e8e79=!_0x3e8e79);}}_0x36a5f6=_0x2afa5d;}return _0x3e8e79;}function getHeightRangeByDepth(_0x3f2541,_0x5c895f,_0x317fb8){return new Promise((_0x5c4124,_0x2a7721)=>{setTimeout(()=>{const _0x2579b3=interPolygonByDepth$1({..._0x317fb8,'positions':_0x3f2541,'scene':_0x5c895f});setTimeout(()=>{_0x5c4124(_0x2579b3);},0xa);},0xa);});}function interPolygonByDepth(_0x35ac8e){return new Promise((_0x11a312,_0x451ffd)=>{setTimeout(()=>{const _0x22a8b3=interPolygonByDepth$1(_0x35ac8e);setTimeout(()=>{_0x11a312(_0x22a8b3);},0xa);},0xa);});}function interPolylineByDepth(_0x42f369){return new Promise((_0x33ca97,_0x384626)=>{setTimeout(()=>{const _0xa3c59=interPolylineByDepth$1(_0x42f369);setTimeout(()=>{_0x33ca97(_0xa3c59);},0xa);},0xa);});}var PolyUtil={'__proto__':null,'centerOfMass':centerOfMass,'buffer':buffer,'bufferPoints':bufferPoints,'getGranularity':getGranularity,'interPolygon':interPolygon,'getHeightRange':getHeightRange,'computeVolume':computeVolume,'updateVolumeByMinHeight':updateVolumeByMinHeight,'updateVolume':updateVolume,'getEllipseOuterPositions':getEllipseOuterPositions,'formatRectangle':formatRectangle,'getExtentByGeoJSON':getExtentByGeoJSON,'getRectangle':getRectangle,'getPositionsRectVertex':getPositionsRectVertex,'getRectangleOuterPositions':getRectangleOuterPositions,'getRectPositionsByCenter':getRectPositionsByCenter,'isInPoly':isInPoly,'getBezierCurve':getBezierCurve,'interPolyline':interPolyline,'interLine':interLine,'computeSurfaceLine':computeSurfaceLine,'computeSurfacePoints':computeSurfacePoints,'computeStepSurfaceLine':computeStepSurfaceLine,'getLinkedPointList':getLinkedPointList,'getOffsetLine':getOffsetLine,'sliceByMaxDistance':sliceByMaxDistance,'convex':convex,'getGridPoints':getGridPoints,'getGridPointsByPoly':getGridPointsByPoly,'getHeightRangeByDepth':getHeightRangeByDepth,'interPolygonByDepth':interPolygonByDepth,'interPolylineByDepth':interPolylineByDepth};function getDistance(_0x54e656,_0x283960){const _0x2ef083=_0x3d5d32,_0x5dabbd=_0x54e656[_0x2ef083(0xc84)];if(!Cesium__namespace[_0x2ef083(0xb84)](_0x54e656)||_0x5dabbd<0x2)return 0x0;_0x54e656=LngLatArray['toCartesians'](_0x54e656);let _0x2ef1c8=0x0;for(let _0x1fade9=0x1;_0x1fade9<_0x5dabbd;_0x1fade9++){_0x2ef1c8+=Cesium__namespace['Cartesian3'][_0x2ef083(0xbd7)](_0x54e656[_0x1fade9-0x1],_0x54e656[_0x1fade9]);}return _0x283960&&(_0x2ef1c8+=Cesium__namespace[_0x2ef083(0xe95)][_0x2ef083(0xbd7)](_0x54e656[0x0],_0x54e656[_0x5dabbd-0x1])),_0x2ef1c8;}function getSurfaceDistance(_0x288ecc){const _0x3e0970={_0x50cc26:0xb84,_0xb9419c:0xc84,_0x1fd727:0x80c,_0x4c78e6:0xc76},_0x3e6937=_0x3d5d32;if(!Cesium__namespace[_0x3e6937(_0x3e0970._0x50cc26)](_0x288ecc)||_0x288ecc['length']<0x2)return 0x0;_0x288ecc=LngLatArray['toCartesians'](_0x288ecc);let _0x1ff533=0x0;for(let _0x578dfc=0x1,_0x473c43=_0x288ecc[_0x3e6937(_0x3e0970._0xb9419c)];_0x578dfc<_0x473c43;_0x578dfc++){const _0x56eec2=Cesium__namespace['Cartographic']['fromCartesian'](_0x288ecc[_0x578dfc-0x1]),_0xdb1df8=Cesium__namespace['Cartographic']['fromCartesian'](_0x288ecc[_0x578dfc]),_0x4be32f=new Cesium__namespace['EllipsoidGeodesic']();_0x4be32f[_0x3e6937(_0x3e0970._0x1fd727)](_0x56eec2,_0xdb1df8);let _0x115ab0=_0x4be32f[_0x3e6937(_0x3e0970._0x4c78e6)];_0x115ab0=Math[_0x3e6937(0xae3)](Math['pow'](_0x115ab0,0x2)+Math['pow'](_0xdb1df8['height']-_0x56eec2['height'],0x2)),_0x1ff533+=_0x115ab0;}return _0x1ff533;}function getClampDistance(_0x307620,_0x3606a8){let _0x5f24cf=0x0;const _0x823824=[];return new Promise((_0x2c263d,_0x3f9166)=>{const _0x8b2bba={_0x4e2299:0xfc1};setTimeout(()=>{const _0x13c5c2=_0x4132;computeStepSurfaceLine({'scene':_0x3606a8[_0x13c5c2(_0x8b2bba._0x4e2299)],'positions':_0x307620,'splitNum':_0x3606a8['splitNum'],'has3dtiles':_0x3606a8['has3dtiles'],'exact':_0x3606a8['exact']??!![],'endItem':function(_0x2d0494,_0x1dd097,_0x5192aa){let _0x214092=getSurfaceDistance(_0x2d0494);_0x1dd097&&_0x3606a8['disTerrainScale']&&(_0x214092=_0x214092*_0x3606a8['disTerrainScale']),_0x5f24cf+=_0x214092,_0x823824['push'](_0x214092),_0x3606a8['endItem']&&_0x3606a8['endItem']({'index':_0x5192aa,'positions':_0x2d0494,'distance':_0x214092,'arrDistance':_0x823824,'all_distance':_0x5f24cf});},'end':function(_0x5679a3){_0x3606a8['callback']&&_0x3606a8['callback'](_0x5f24cf),_0x3606a8['end']&&_0x3606a8['end'](_0x5f24cf),_0x2c263d({'distance':_0x5f24cf,'arrDistance':_0x823824,'arrPositions':_0x5679a3});}});},0x32);});}function getArea(_0x4607c3){const _0x321063={_0x12a523:0xfa3,_0x2f5fe8:0xc84,_0x7b7995:0xe95},_0x191c8d=_0x3d5d32;if(!_0x4607c3||!Array['isArray'](_0x4607c3)||_0x4607c3[_0x191c8d(0xc84)]<0x3)return 0x0;_0x4607c3=LngLatArray[_0x191c8d(0x890)](_0x4607c3);const _0xd99607=Cesium__namespace['CoplanarPolygonGeometry'][_0x191c8d(_0x321063._0x12a523)](Cesium__namespace['CoplanarPolygonGeometry'][_0x191c8d(0x64b)]({'positions':_0x4607c3,'vertexFormat':Cesium__namespace['VertexFormat']['POSITION_ONLY']}));let _0x9d75b2=0x0;if(!_0xd99607)return _0x9d75b2;const _0x5c5bb3=_0xd99607['attributes']['position'][_0x191c8d(0xa07)],_0xd9eebc=_0xd99607['indices'];for(let _0x4d7dda=0x0;_0x4d7dda<_0xd9eebc[_0x191c8d(_0x321063._0x2f5fe8)];_0x4d7dda+=0x3){const _0x562175=Cesium__namespace[_0x191c8d(_0x321063._0x7b7995)]['unpack'](_0x5c5bb3,_0xd9eebc[_0x4d7dda]*0x3,new Cesium__namespace['Cartesian3']()),_0x412d60=Cesium__namespace['Cartesian3']['unpack'](_0x5c5bb3,_0xd9eebc[_0x4d7dda+0x1]*0x3,new Cesium__namespace['Cartesian3']()),_0x4ca3bd=Cesium__namespace['Cartesian3']['unpack'](_0x5c5bb3,_0xd9eebc[_0x4d7dda+0x2]*0x3,new Cesium__namespace['Cartesian3']());_0x9d75b2+=getTriangleArea(_0x562175,_0x412d60,_0x4ca3bd);}return _0x9d75b2;}function getSurfaceArea(_0x47643b){const _0x59f7ed=_0x3d5d32;if(!_0x47643b||!Array['isArray'](_0x47643b)||_0x47643b['length']<0x3)return 0x0;const _0x2676d4=LngLatArray[_0x59f7ed(0x4d4)](_0x47643b);_0x2676d4['length']>0x0&&_0x2676d4[_0x59f7ed(0xb75)](_0x2676d4[0x0]);const _0x241679=area({'type':'Feature','geometry':{'type':'Polygon','coordinates':[_0x2676d4]}});return _0x241679;}function getTriangleArea(_0x58417d,_0xab8731,_0x4e7fa4){const _0x490823={_0x20807e:0xe95,_0x570c9e:0xe95},_0x182cfc=_0x3d5d32,_0x40c273=Cesium__namespace['Cartesian3']['subtract'](_0x58417d,_0xab8731,new Cesium__namespace['Cartesian3']()),_0x5b3fe1=Cesium__namespace['Cartesian3']['subtract'](_0x4e7fa4,_0xab8731,new Cesium__namespace[(_0x182cfc(_0x490823._0x20807e))]()),_0x358275=Cesium__namespace['Cartesian3']['cross'](_0x40c273,_0x5b3fe1,_0x40c273);return Cesium__namespace[_0x182cfc(_0x490823._0x570c9e)]['magnitude'](_0x358275)*0.5;}function getClampArea(_0x4c21e6,_0x3c7acc){return interPolygon({'positions':_0x4c21e6,'exact':!![],..._0x3c7acc})['then'](_0x213441=>{const _0xf077f6=_0x4132;let _0x30db12=0x0;for(let _0x481848=0x0,_0x10100e=_0x213441[_0xf077f6(0xedd)]['length'];_0x481848<_0x10100e;_0x481848++){const _0x2f534e=_0x213441['list'][_0x481848],_0x4f3d24=_0x2f534e['point1'],_0x381c27=_0x2f534e['point2'],_0x1c026f=_0x2f534e['point3'];_0x30db12+=getTriangleArea(_0x4f3d24['pointDM'],_0x381c27['pointDM'],_0x1c026f['pointDM']);}return _0x213441['area']=_0x30db12,_0x3c7acc['callback']&&_0x3c7acc['callback'](_0x30db12,_0x213441),_0x213441;});}function getAngle(_0x438a2a,_0x511431,_0x31c2f0){const _0x12821e={_0x1d9354:0x9dc,_0x89933f:0x9dc,_0xeb575f:0xe95,_0x328940:0x24c,_0x2707f3:0xf69,_0x234947:0x103e},_0x5bb50b=_0x3d5d32;let _0x240fc8=Cesium__namespace[_0x5bb50b(0x5bb)]['eastNorthUpToFixedFrame'](_0x511431);_0x240fc8=Cesium__namespace[_0x5bb50b(0xf5d)]['getMatrix3'](_0x240fc8,new Cesium__namespace['Matrix3']());const _0x3bb8f0=Cesium__namespace[_0x5bb50b(_0x12821e._0x1d9354)]['getColumn'](_0x240fc8,0x0,new Cesium__namespace[(_0x5bb50b(0xe95))]()),_0x2193f7=Cesium__namespace['Matrix3']['getColumn'](_0x240fc8,0x1,new Cesium__namespace['Cartesian3']()),_0x5c6424=Cesium__namespace[_0x5bb50b(_0x12821e._0x89933f)]['getColumn'](_0x240fc8,0x2,new Cesium__namespace['Cartesian3']());let _0x55151f=Cesium__namespace['Cartesian3']['subtract'](_0x438a2a,_0x511431,new Cesium__namespace[(_0x5bb50b(_0x12821e._0xeb575f))]());if(isNaN(_0x55151f['x'])||isNaN(_0x55151f['y'])||isNaN(_0x55151f['z'])||_0x55151f['equals'](Cesium__namespace[_0x5bb50b(_0x12821e._0xeb575f)][_0x5bb50b(0x61a)]))return 0x0;_0x55151f=Cesium__namespace['Cartesian3']['cross'](_0x55151f,_0x5c6424,_0x55151f),_0x55151f=Cesium__namespace['Cartesian3'][_0x5bb50b(_0x12821e._0x328940)](_0x5c6424,_0x55151f,_0x55151f),_0x55151f=Cesium__namespace['Cartesian3'][_0x5bb50b(_0x12821e._0x2707f3)](_0x55151f,_0x55151f);let _0x3c5465=Cesium__namespace['Cartesian3']['angleBetween'](_0x3bb8f0,_0x55151f);const _0x15721d=Cesium__namespace[_0x5bb50b(0xe95)]['angleBetween'](_0x2193f7,_0x55151f);_0x15721d>Math['PI']*0.5&&(_0x3c5465=0x2*Math['PI']-_0x3c5465);let _0x40c8f7=0x168-Cesium__namespace[_0x5bb50b(_0x12821e._0x234947)]['toDegrees'](_0x3c5465)-0xb4;_0x31c2f0&&(_0x40c8f7+=0x5a);if(_0x40c8f7<0x0)_0x40c8f7=_0x40c8f7+0x168;else _0x40c8f7>0x168&&(_0x40c8f7=_0x40c8f7-0x168);return _0x40c8f7;}function formatDistance(_0x11a727,_0x19752e={}){const _0x3228df={_0x298af0:0x719,_0x377a32:0x2da,_0x26ce2b:0x719},_0x5a8add=_0x3d5d32;if(_0x11a727==null)return'';_0x11a727=Number(_0x11a727);if(isNaN(_0x11a727)||_0x11a727===0x0)return'';isString(_0x19752e)&&(_0x19752e={'unit':_0x19752e});(_0x19752e['unit']==null||_0x19752e['unit']===_0x5a8add(0x423))&&(_0x11a727<0x3e8?_0x19752e['unit']='m':_0x19752e['unit']='km');_0x19752e[_0x5a8add(0x2da)]=_0x19752e['decimal']??0x2;let _0x207013='';switch(_0x19752e['unit']){case'km':_0x207013=(_0x11a727*0.001)['toFixed'](_0x19752e['decimal'])+getLangText('_公里',_0x19752e['lang']);break;case'wm':_0x207013=(_0x11a727*0.0001)[_0x5a8add(_0x3228df._0x298af0)](_0x19752e['decimal'])+getLangText(_0x5a8add(0x8fa),_0x19752e['lang']);break;case _0x5a8add(0x356):_0x207013=(_0x11a727*0.00054)['toFixed'](_0x19752e['decimal'])+getLangText('_海里',_0x19752e['lang']);break;case _0x5a8add(0xdcc):_0x207013=(_0x11a727*0.3)['toFixed'](_0x19752e[_0x5a8add(_0x3228df._0x377a32)])+getLangText('_丈',_0x19752e['lang']);break;case'm':default:_0x207013=_0x11a727[_0x5a8add(_0x3228df._0x26ce2b)](_0x19752e['decimal'])+getLangText('_米',_0x19752e['lang']);break;}return _0x207013;}function formatArea(_0x45d954,_0x372eb5={}){const _0x65d689={_0x238ada:0xef9,_0x1d20e1:0xef9,_0x518985:0x719,_0x29a280:0x6b0,_0x26c488:0x2da,_0x4f034d:0x94d,_0x33f092:0x8bd},_0x2b6cfa=_0x3d5d32;if(_0x45d954==null)return'';_0x45d954=Number(_0x45d954);if(isNaN(_0x45d954)||_0x45d954===0x0)return'';isString(_0x372eb5)&&(_0x372eb5={'unit':_0x372eb5});(_0x372eb5['unit']==null||_0x372eb5[_0x2b6cfa(_0x65d689._0x238ada)]==='auto')&&(_0x45d954<0xf4240?_0x372eb5['unit']='m':_0x372eb5['unit']='km');_0x372eb5['decimal']=_0x372eb5[_0x2b6cfa(0x2da)]??0x2;let _0x30434e='';switch(_0x372eb5[_0x2b6cfa(_0x65d689._0x1d20e1)]){case'km':_0x30434e=(_0x45d954/0xf4240)[_0x2b6cfa(_0x65d689._0x518985)](_0x372eb5[_0x2b6cfa(0x2da)])+getLangText('_平方公里',_0x372eb5[_0x2b6cfa(_0x65d689._0x29a280)]);break;case'mu':_0x30434e=(_0x45d954*0.0015)[_0x2b6cfa(0x719)](_0x372eb5[_0x2b6cfa(_0x65d689._0x26c488)])+getLangText('_亩',_0x372eb5['lang']);break;case'ha':_0x30434e=(_0x45d954*0.0001)[_0x2b6cfa(0x719)](_0x372eb5['decimal'])+getLangText(_0x2b6cfa(_0x65d689._0x4f034d),_0x372eb5['lang']);break;case'm':default:_0x30434e=_0x45d954['toFixed'](_0x372eb5['decimal'])+getLangText(_0x2b6cfa(_0x65d689._0x33f092),_0x372eb5['lang']);break;}return _0x30434e;}function formatVolume(_0x1a8360,_0x162ae5={}){const _0x2031d6={_0xd03abf:0xed8},_0x4b8479=_0x3d5d32;if(_0x1a8360==null)return'';_0x1a8360=Number(_0x1a8360);if(isNaN(_0x1a8360)||_0x1a8360===0x0)return'';_0x162ae5['decimal']=_0x162ae5['decimal']??0x2;if(_0x162ae5['lang']===LangType['EN'])return _0x1a8360['toFixed'](_0x162ae5['decimal'])+getLangText('_立方米',_0x162ae5['lang']);return _0x1a8360<0x2710?_0x1a8360['toFixed'](_0x162ae5[_0x4b8479(0x2da)])+getLangText(_0x4b8479(_0x2031d6._0xd03abf),_0x162ae5['lang']):(_0x1a8360/0x2710)['toFixed'](_0x162ae5['decimal'])+getLangText(_0x4b8479(0x2d3),_0x162ae5['lang']);}var MeasureUtil={'__proto__':null,'getDistance':getDistance,'getSurfaceDistance':getSurfaceDistance,'getClampDistance':getClampDistance,'getArea':getArea,'getSurfaceArea':getSurfaceArea,'getTriangleArea':getTriangleArea,'getClampArea':getClampArea,'getAngle':getAngle,'formatDistance':formatDistance,'formatArea':formatArea,'formatVolume':formatVolume};function register$3(_0x1e1f39,_0x43cd8b){const _0x1ae7fb={_0x5ade30:0xc2e},_0x1664c7=_0x3d5d32;Cesium__namespace['Material']['_materialCache'][_0x1664c7(0x691)](_0x1e1f39)&&logError$1(_0x1664c7(_0x1ae7fb._0x5ade30)+_0x1e1f39+'类型已存在',_0x43cd8b),MaterialTypes[_0x1e1f39]=_0x1e1f39,Cesium__namespace['Material'][_0x1e1f39+_0x1664c7(0xa3b)]=_0x1e1f39,_0x43cd8b['fabric']&&(_0x43cd8b['fabric']['type']=_0x1e1f39),Cesium__namespace['Material']['_materialCache'][_0x1664c7(0xb33)](_0x1e1f39,_0x43cd8b);}const OptsConverClass={};function registerOptsConver(_0x19613a,_0x132e94){OptsConverClass[_0x19613a]&&logError$1('MaterialUtil\x20registerOptsConver:\x20'+_0x19613a+'类型已存在',_0x132e94),OptsConverClass[_0x19613a]=_0x132e94;}const MaterialClass={},MaterialTypes={};function registerClass(_0x1633c1,_0x57cc60){MaterialTypes[_0x1633c1]&&logError$1('MaterialUtil\x20registerClass:\x20'+_0x1633c1+'类型已存在',_0x57cc60),MaterialClass[_0x1633c1]=_0x57cc60,MaterialTypes[_0x1633c1]=_0x1633c1;}const MaterialPropertyClass={};function registerPropertyClass(_0x42661f,_0x5be57b){const _0x3baf8a={_0x3f2f76:0x8b1},_0x2cb4c7=_0x3d5d32;MaterialPropertyClass[_0x42661f]&&logError$1('MaterialUtil\x20registerPropertyClass:\x20'+_0x42661f+_0x2cb4c7(_0x3baf8a._0x3f2f76),_0x5be57b),MaterialPropertyClass[_0x42661f]=_0x5be57b;}function createMaterialProperty(_0x26b3a0,_0x371a04){const _0x4d09a8={_0xa8e089:0xa7c},_0x5acac4=_0x3d5d32,_0x42095a=MaterialPropertyClass[_0x26b3a0];if(_0x42095a){const _0x7d55b1=OptsConverClass[_0x26b3a0]||OptsConverClass[_0x5acac4(_0x4d09a8._0xa8e089)];_0x7d55b1&&(_0x371a04['materialType']=_0x26b3a0,_0x371a04=_0x7d55b1['toCesiumVal'](_0x371a04,{},!![]));const _0x2a1b49=new _0x42095a(_0x371a04);return _0x2a1b49['_mars_type']=_0x26b3a0,_0x2a1b49['options']=_0x371a04,_0x2a1b49;}else logWarn('createMaterialProperty:未找到该类型的对应材质属性',_0x26b3a0);}function createMaterial(_0x2adfa2,_0x11785d){const _0x4767d2={_0x55a851:0xb2a},_0x1725b0=_0x3d5d32;if(!_0x2adfa2){logError$1('createMaterial:请指定mars3d.MaterialType类型');return;}const _0x54a417=OptsConverClass[_0x2adfa2]||OptsConverClass['default'];_0x54a417&&(_0x11785d[_0x1725b0(_0x4767d2._0x55a851)]=_0x2adfa2,_0x11785d=_0x54a417['toCesiumVal'](_0x11785d));let _0x22ff8a;const _0x3b08f4=MaterialClass[_0x2adfa2];return _0x3b08f4?_0x22ff8a=new _0x3b08f4(_0x11785d):_0x22ff8a=Cesium__namespace['Material'][_0x1725b0(0x712)](_0x2adfa2,_0x11785d),_0x22ff8a['options']=_0x11785d,_0x22ff8a['_mars_type']=_0x2adfa2,_0x22ff8a;}function hasMaterial(_0xa40e68,_0xd437ce){return _0xd437ce?Boolean(MaterialPropertyClass[_0xa40e68]):Boolean(MaterialTypes[_0xa40e68]);}function toJSON(_0x1c9994,_0x2a54c8={}){const _0x562647={_0x17257f:0x7f5,_0x52833d:0x3db},_0x7205c4=_0x3d5d32;var _0x3ff6fe;let _0x3fc92f;if(_0x1c9994['_mars_type'])_0x3fc92f=_0x1c9994['_mars_type'];else{if(_0x1c9994!==null&&_0x1c9994!==void 0x0&&(_0x3ff6fe=_0x1c9994['_template'])!==null&&_0x3ff6fe!==void 0x0&&_0x3ff6fe[_0x7205c4(_0x562647._0x17257f)])_0x3fc92f=_0x1c9994['_template']['type'];else _0x1c9994!==null&&_0x1c9994!==void 0x0&&_0x1c9994['getType']&&(_0x3fc92f=_0x1c9994['getType']());}if(!_0x3fc92f){if(_0x1c9994 instanceof Cesium__namespace['Color'])_0x3fc92f='Color';else{if(_0x1c9994 instanceof HTMLVideoElement)return;else logWarn('toJSON:未识别的材质类型',_0x1c9994);}}const _0x35386f=OptsConverClass[_0x3fc92f]||OptsConverClass[_0x7205c4(0xa7c)];return _0x35386f&&(_0x2a54c8['materialType']=_0x3fc92f,_0x2a54c8['materialOptions']=_0x35386f[_0x7205c4(_0x562647._0x52833d)](_0x1c9994)),_0x2a54c8;}function toJSONByType(_0x4afe62,_0x3c0ab1){const _0x282058=OptsConverClass[_0x4afe62]||OptsConverClass['default'];return _0x282058?_0x282058['toJSON'](_0x3c0ab1):_0x3c0ab1;}function addTextureUniform(_0x473826){const _0x22db6f={_0x6b3b6b:0x41b},_0xc28d74={_0x556241:0x83e},_0x56cb58=_0x3d5d32,{context:_0x3c9a11,material:_0x4cf4d1,uniformName:_0x166c72,image:_0x7f89e}=_0x473826,_0x13ff69=_0x473826['wrapS']||Cesium__namespace['TextureWrap'][_0x56cb58(0xb57)],_0x523bd4=_0x473826['wrapT']||Cesium__namespace['TextureWrap']['REPEAT'],_0x972010=_0x473826['minificationFilter']||Cesium__namespace['TextureMinificationFilter']['LINEAR'],_0x50ac14=_0x473826['magnificationFilter']||Cesium__namespace[_0x56cb58(_0x22db6f._0x6b3b6b)]['LINEAR'],_0x2df336=new Image();_0x2df336['src']=_0x7f89e,_0x2df336['addEventListener']('load',()=>{const _0x5700dd=_0x56cb58,_0xed2ab3=new Cesium__namespace[(_0x5700dd(0x979))]({'context':_0x3c9a11,'source':_0x2df336,'sampler':new Cesium__namespace['Sampler']({'wrapS':_0x13ff69,'wrapT':_0x523bd4,'minificationFilter':_0x972010,'magnificationFilter':_0x50ac14})});_0xed2ab3['type']='sampler2D',isPowerOfTwo(_0x2df336['width'])&&isPowerOfTwo(_0x2df336[_0x5700dd(_0xc28d74._0x556241)])&&_0xed2ab3['generateMipmap'](Cesium__namespace['MipmapHint']['NICEST']),_0x4cf4d1['uniforms'][_0x166c72]=_0xed2ab3;});}function isPowerOfTwo(_0x3b421b){return(_0x3b421b&_0x3b421b-0x1)===0x0&&_0x3b421b!==0x0;}var MaterialUtil={'__proto__':null,'register':register$3,'registerOptsConver':registerOptsConver,'registerClass':registerClass,'registerPropertyClass':registerPropertyClass,'createMaterialProperty':createMaterialProperty,'createMaterial':createMaterial,'hasMaterial':hasMaterial,'toJSON':toJSON,'toJSONByType':toJSONByType,'addTextureUniform':addTextureUniform};const PointType={'Control':0x1,'MoveAll':0x2,'AddMidPoint':0x3,'MoveHeight':0x4,'EditAttr':0x5,'EditRotation':0x6},PointColor={'Control':'rgba(28,25,125,0.99)','MoveAll':'rgba(140,0,58,0.99)','MoveHeight':'rgba(149,0,235,0.99)','EditAttr':_0x3d5d32(0xa7e),'AddMidPoint':'rgba(4,194,201,0.3)'};let defaultEditStyle={'pixelSize':0xc,'outline':!![],'outlineColor':'rgba(255,255,255,0.5)','outlineWidth':0x2,'scaleByDistance':new Cesium__namespace['NearFarScalar'](0x3e8,0x1,0xf4240,0.5),'disableDepthTestDistance':Number[_0x3d5d32(0xc39)]};function setPointStyle(_0x3ffc73){defaultEditStyle=merge(defaultEditStyle,_0x3ffc73);}function getEditPointStyle(_0x3b8b43){const _0x162cc4={_0x4b987c:0x956,_0x2c6900:0x262},_0x3f9cb5=_0x3d5d32,_0x4a44ac={...defaultEditStyle};switch(_0x3b8b43){case PointType['AddMidPoint']:_0x4a44ac[_0x3f9cb5(0xe8f)]=PointColor['AddMidPoint'],_0x4a44ac['outlineColor']='rgba(255,255,255,0.4)';break;case PointType[_0x3f9cb5(_0x162cc4._0x4b987c)]:_0x4a44ac['color']=PointColor['MoveAll'];break;case PointType[_0x3f9cb5(_0x162cc4._0x2c6900)]:_0x4a44ac['color']=PointColor['MoveHeight'];break;case PointType['EditAttr']:_0x4a44ac['color']=PointColor['EditAttr'];break;case PointType['Control']:default:_0x4a44ac['color']=PointColor['Control'];break;}return _0x4a44ac;}var DrawUtil={'__proto__':null,'PointType':PointType,'PointColor':PointColor,'setPointStyle':setPointStyle,'getEditPointStyle':getEditPointStyle};const TerrainType={'NONE':'none','XYZ':'xyz','ARCGIS':_0x3d5d32(0x59f),'ION':'ion','GEE':_0x3d5d32(0xeb5),'VR':'vr'};class GCJMercatorTilingScheme extends Cesium__namespace['WebMercatorTilingScheme']{constructor(_0x3a7acd){const _0x45cde1={_0x40723d:0x7b8},_0x796fd={_0x2d34ea:0xbfd,_0x1b1615:0x103e},_0x1b9102={_0x1fc190:0x562},_0xec5d61=_0x3d5d32;super(_0x3a7acd);const _0x9998c7=_0x3a7acd[_0xec5d61(0xfd3)],_0xb9d388=_0x3a7acd['chinaCRS'],_0x2c35d5=getTransFun(_0x9998c7,_0xb9d388),_0x4dfcc8=getTransFun(_0xb9d388,_0x9998c7);if(_0x2c35d5){const _0x5ccd8b=new Cesium__namespace['WebMercatorProjection']();this['_projection']['project']=function(_0x2d294f,_0x484e76){const _0x4711bb=_0xec5d61;return _0x484e76=_0x2c35d5([Cesium__namespace['Math']['toDegrees'](_0x2d294f['longitude']),Cesium__namespace['Math']['toDegrees'](_0x2d294f[_0x4711bb(0x406)])]),_0x484e76=_0x5ccd8b['project'](new Cesium__namespace['Cartographic'](Cesium__namespace['Math']['toRadians'](_0x484e76[0x0]),Cesium__namespace[_0x4711bb(0x103e)][_0x4711bb(_0x1b9102._0x1fc190)](_0x484e76[0x1]))),new Cesium__namespace['Cartesian2'](_0x484e76['x'],_0x484e76['y']);},this['_projection'][_0xec5d61(_0x45cde1._0x40723d)]=function(_0x384e28,_0x20edd9){const _0x2d2dc3=_0xec5d61,_0x395826=_0x5ccd8b[_0x2d2dc3(0x7b8)](_0x384e28);return _0x20edd9=_0x4dfcc8([Cesium__namespace['Math']['toDegrees'](_0x395826[_0x2d2dc3(_0x796fd._0x2d34ea)]),Cesium__namespace[_0x2d2dc3(_0x796fd._0x1b1615)]['toDegrees'](_0x395826['latitude'])]),new Cesium__namespace['Cartographic'](Cesium__namespace['Math']['toRadians'](_0x20edd9[0x0]),Cesium__namespace['Math']['toRadians'](_0x20edd9[0x1]));};}}}const LayerClass={};function register$2(_0xfb6014,_0x1f12b6){LayerClass[_0xfb6014]&&logError$1('register:\x20'+_0xfb6014+'类型已存在',_0x1f12b6),LayerType[_0xfb6014]=_0xfb6014,LayerClass[_0xfb6014]=_0x1f12b6,_0x1f12b6['type']=_0xfb6014,_0x1f12b6['prototype']['_type']=_0xfb6014;}function getClass$2(_0x1ce42b){return LayerClass[_0x1ce42b];}function create$2(_0x58784f,_0x16ad99){const _0x2639f4={_0x4d6815:0x7f5},_0x5b0acf=_0x3d5d32,_0x4412e2=getClass$2(_0x58784f[_0x5b0acf(_0x2639f4._0x4d6815)]);if(_0x4412e2){_0x16ad99&&(_0x58784f['templateValues']=_0x16ad99);const _0x3fa8f2=new _0x4412e2(_0x58784f);return _0x3fa8f2;}else logWarn('配置中的图层未处理',_0x58784f);}function converOptions(_0x131ef1){const _0x310ccc={_0x537157:0x21c,_0x2708ad:0x54f,_0x57cb64:0x7f3,_0x59a148:0xfd3,_0x3d9b3a:0x2ba,_0xd53642:0xe69,_0x7d9726:0x57e,_0x215f96:0x5a3,_0x3573f3:0x5ee,_0x132da0:0xb84,_0xcfd2ec:0x85f,_0x398745:0x8ad,_0x1c2ffd:0x5ee,_0x1985fd:0x3c6,_0x32e2be:0x9da},_0xd1b31e=_0x3d5d32,_0x2aafea={};for(const _0x27ae00 in _0x131ef1){let _0x1fa495=_0x131ef1[_0x27ae00];if(_0x1fa495==null)continue;switch(_0x27ae00){case _0xd1b31e(0x980):_0x1fa495=(_0x1fa495+'')['toUpperCase']();if(_0x1fa495===CRS['EPSG4326']||_0x1fa495==='4326'||_0x1fa495===_0xd1b31e(0xc7e))_0x2aafea['crs']=CRS['EPSG4326'],_0x2aafea[_0xd1b31e(_0x310ccc._0x537157)]=new Cesium__namespace[(_0xd1b31e(_0x310ccc._0x2708ad))]({'numberOfLevelZeroTilesX':_0x131ef1[_0xd1b31e(_0x310ccc._0x57cb64)]||0x2,'numberOfLevelZeroTilesY':_0x131ef1['numberOfLevelZeroTilesY']||0x1});else _0x1fa495===CRS['EPSG4490']||_0x1fa495==='4490'||_0x1fa495==='EPSG4490'?(_0x2aafea['crs']=CRS['EPSG4490'],_0x2aafea['tilingScheme']=new Cesium__namespace['GeographicTilingScheme']({'numberOfLevelZeroTilesX':_0x131ef1['numberOfLevelZeroTilesX']||0x2,'numberOfLevelZeroTilesY':_0x131ef1[_0xd1b31e(0x2ba)]||0x1})):(_0x2aafea['crs']=CRS['EPSG3857'],_0x2aafea['tilingScheme']=new Cesium__namespace['WebMercatorTilingScheme']({'numberOfLevelZeroTilesX':_0x131ef1[_0xd1b31e(0x7f3)]||0x1,'numberOfLevelZeroTilesY':_0x131ef1['numberOfLevelZeroTilesY']||0x1}));break;case _0xd1b31e(0xd96):{_0x131ef1['mapChinaCRS']!==_0x131ef1['chinaCRS']&&(_0x2aafea['tilingScheme']=new GCJMercatorTilingScheme({'mapChinaCRS':_0x131ef1[_0xd1b31e(_0x310ccc._0x59a148)]||ChinaCRS['WGS84'],'chinaCRS':_0x131ef1['chinaCRS'],'numberOfLevelZeroTilesX':_0x131ef1[_0xd1b31e(0x7f3)]||0x1,'numberOfLevelZeroTilesY':_0x131ef1[_0xd1b31e(_0x310ccc._0x3d9b3a)]||0x1}));break;}case _0xd1b31e(0x5a3):if(Cesium__namespace['defined'](_0x1fa495)&&Cesium__namespace['defined'](_0x1fa495['xmin'])&&Cesium__namespace['defined'](_0x1fa495['xmax'])&&Cesium__namespace[_0xd1b31e(0xb84)](_0x1fa495[_0xd1b31e(0x470)])&&Cesium__namespace['defined'](_0x1fa495['ymax']))_0x2aafea[_0xd1b31e(0x5a3)]=Cesium__namespace['Rectangle'][_0xd1b31e(_0x310ccc._0xd53642)](_0x1fa495['xmin'],_0x1fa495['ymin'],_0x1fa495[_0xd1b31e(_0x310ccc._0x7d9726)],_0x1fa495[_0xd1b31e(0x1058)]);else _0x1fa495 instanceof Cesium__namespace['Rectangle']&&(_0x2aafea[_0xd1b31e(_0x310ccc._0x215f96)]=_0x1fa495);break;case'bbox':_0x2aafea[_0xd1b31e(0x5a3)]=Cesium__namespace['Rectangle'][_0xd1b31e(0xe69)](_0x1fa495[0x0],_0x1fa495[0x1],_0x1fa495[0x2],_0x1fa495[0x3]);break;default:_0x2aafea[_0x27ae00]=_0x1fa495;break;}}return _0x2aafea[_0xd1b31e(0x980)]===CRS['EPSG4490']&&_0x2aafea['url']&&(_0x2aafea['url']=_0x2aafea['url']['replace'](/\{z\}/gm,'{z4490}'),_0x2aafea[_0xd1b31e(_0x310ccc._0x3573f3)]=_0x2aafea[_0xd1b31e(_0x310ccc._0x3573f3)][_0xd1b31e(0xbb6)](/\{arc_z\}/gm,'{arc_z4490}'),_0x2aafea['url']=_0x2aafea['url']['replace'](/\{arc_Z\}/gm,'{arc_Z4490}')),_0x131ef1['tms']&&(_0x2aafea['url']=_0x2aafea[_0xd1b31e(0x5ee)]['replace'](/\{y\}/gm,'{reverseY}')),Cesium__namespace[_0xd1b31e(_0x310ccc._0x132da0)](_0x131ef1['minimumTerrainLevel'])&&Cesium__namespace['defined'](_0x131ef1[_0xd1b31e(_0x310ccc._0xcfd2ec)])&&_0x131ef1['minimumTerrainLevel']<_0x131ef1['minimumLevel']&&(_0x2aafea['minimumTerrainLevel']=_0x131ef1['minimumLevel']),Cesium__namespace[_0xd1b31e(0xb84)](_0x131ef1['maximumTerrainLevel'])&&Cesium__namespace['defined'](_0x131ef1['maximumLevel'])&&_0x131ef1['maximumTerrainLevel']>_0x131ef1['maximumLevel']&&(_0x2aafea['maximumTerrainLevel']=_0x131ef1['maximumLevel']),!Cesium__namespace['defined'](_0x131ef1['minimumTerrainLevel'])&&Cesium__namespace['defined'](_0x131ef1['minimumLevel'])&&_0x131ef1['minimumLevel']>0x0&&(_0x2aafea[_0xd1b31e(_0x310ccc._0x398745)]=_0x131ef1['minimumLevel']),_0x2aafea[_0xd1b31e(_0x310ccc._0x1c2ffd)]&&(_0x131ef1[_0xd1b31e(0xa1a)]||_0x131ef1[_0xd1b31e(_0x310ccc._0x1985fd)]||_0x131ef1[_0xd1b31e(_0x310ccc._0x32e2be)]||_0x131ef1['proxy'])&&(_0x2aafea['url']=getUrlResource(_0x2aafea)),_0x2aafea;}const ImageryProviderFun={};function registerImageryProvider(_0x2ad025,_0xc19e0e){const _0x255fab={_0xaf28e4:0xef7},_0xc6169b=_0x3d5d32;ImageryProviderFun[_0x2ad025]&&logError$1(_0xc6169b(0xd43)+_0x2ad025+_0xc6169b(_0x255fab._0xaf28e4)),ImageryProviderFun[_0x2ad025]=_0xc19e0e;}function getProviderClass(_0x2f7464){return ImageryProviderFun[_0x2f7464];}async function createImageryProvider$k(_0x1622b4){const _0x305b08={_0x39a4d4:0xe17},_0x3d8adb=_0x3d5d32,_0x1be2b2=getProviderClass(_0x1622b4['type']);if(_0x1be2b2){const _0x2dfde8=await _0x1be2b2(_0x1622b4);return!_0x2dfde8['options']&&(_0x2dfde8['options']=_0x1622b4),Cesium__namespace['defined'](_0x1622b4[_0x3d8adb(_0x305b08._0x39a4d4)])&&(_0x2dfde8[_0x3d8adb(0xe17)]=_0x1622b4['invertColor']),Cesium__namespace['defined'](_0x1622b4['filterColor'])&&(_0x2dfde8['filterColor']=getCesiumColor(_0x1622b4['filterColor'])),_0x2dfde8;}else logWarn('createImageryProvider:存在未识别的图层',_0x1622b4);}function getImageryProviderViewModels(_0x3d0e85,_0x37e5a1){const _0x2dcd0a=[];let _0x502254=-0x1;for(let _0x203b9d=0x0;_0x203b9d<_0x3d0e85['length'];_0x203b9d++){const _0x5a1539=_0x3d0e85[_0x203b9d];if(_0x5a1539['type']==='group'&&_0x5a1539['layers']==null)continue;_0x37e5a1&&(_0x5a1539['templateValues']=_0x37e5a1),_0x5a1539['show']?_0x502254=_0x2dcd0a['length']:delete _0x5a1539['show'],_0x2dcd0a['push'](createProviderViewModel(_0x5a1539,_0x203b9d));}return{'imageryProviderViewModels':_0x2dcd0a,'selectedIndex':_0x502254};}function createProviderViewModel(_0x4efd2d,_0xdfbb83){const _0x47a0b1=_0x3d5d32;window['_temp_mars3d_createImageryProvider']=createImageryProvider$k;const _0xae3693='window._temp_mars3d_basemaps'+_0xdfbb83;return new Function(_0x47a0b1(0xc61)+_0xae3693+'\x20=\x20function\x20(item)\x20{\x0a\x20\x20\x20\x20\x20\x20item\x20=\x20item\x20||\x20'+JSON[_0x47a0b1(0x31e)](getAttrVal(_0x4efd2d,{'onlySimpleType':!![]}))+';\x0a\x20\x20\x20\x20\x20\x20if\x20(item.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20arrVec\x20=\x20[]\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(let\x20index\x20=\x200;\x20index\x20<\x20item.layers.length;\x20index++)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20item2\x20=\x20item.layers[index]\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(item.templateValues)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20item2.templateValues\x20=\x20item.templateValues\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20temp\x20=\x20window._temp_mars3d_createImageryProvider(item2)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(temp\x20==\x20null)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20continue\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20arrVec.push(temp)\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20arrVec\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20window._temp_mars3d_createImageryProvider(item)\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}')(),new Cesium__namespace['ProviderViewModel']({'name':_0x4efd2d['name']||'','tooltip':_0x4efd2d[_0x47a0b1(0xaed)]||'','iconUrl':_0x4efd2d['icon']||'','category':_0x4efd2d[_0x47a0b1(0x774)]||'','creationFunction':eval(_0xae3693),'marsOptions':{'layerId':_0x4efd2d['id']}});}const _ellipsoid=new Cesium__namespace['EllipsoidTerrainProvider']({'ellipsoid':Cesium__namespace['Ellipsoid']['WGS84']});function getNoTerrainProvider(){return _ellipsoid;}const TerrainProviderClass={};function registerTerrainProvider(_0x1424e4,_0x582d0d){TerrainProviderClass[_0x1424e4]&&logError$1('registerTerrainProvider:\x20'+_0x1424e4+'类型已存在'),TerrainProviderClass[_0x1424e4]=_0x582d0d;}function getTerrainProviderClass(_0x39fcfd){return TerrainProviderClass[_0x39fcfd];}async function createTerrainProvider(_0x4cee1c){const _0xe51f30={_0x19723e:0x5ac,_0x577662:0xa2b,_0x570b8b:0xac8},_0x5235d5=_0x3d5d32;_0x4cee1c=_0x4cee1c||{'type':TerrainType['ION']},_0x4cee1c['type']=_0x4cee1c['type']||TerrainType['XYZ'],_0x4cee1c[_0x5235d5(0xf8e)]=_0x4cee1c['requestVertexNormals']??!![];let _0x4b2620;switch(_0x4cee1c['type']){case TerrainType['XYZ']:case _0x5235d5(0xe4f):{replaceOnlineUrlDomain(_0x4cee1c);const _0x187722={..._0x4cee1c};delete _0x187722['url'],_0x4b2620=await Cesium__namespace[_0x5235d5(0xfce)]['fromUrl'](getUrlResource(_0x4cee1c),_0x187722);break;}case TerrainType['NONE']:case _0x5235d5(_0xe51f30._0x19723e):_0x4b2620=_ellipsoid;break;case TerrainType[_0x5235d5(_0xe51f30._0x577662)]:_0x4b2620=await Cesium__namespace[_0x5235d5(0xfce)]['fromIonAssetId'](_0x4cee1c['assetId']??0x1,{'requestWaterMask':_0x4cee1c['requestWaterMask'],'requestVertexNormals':_0x4cee1c['requestVertexNormals']});break;case TerrainType['GEE']:case _0x5235d5(0x61b):{const _0x169ebf=await Cesium__namespace[_0x5235d5(0xf95)]['fromUrl'](getUrlResource(_0x4cee1c),_0x4cee1c);_0x4b2620=await Cesium__namespace['GoogleEarthEnterpriseTerrainProvider']['fromMetadata'](_0x169ebf,_0x4cee1c);}break;case TerrainType[_0x5235d5(0x925)]:_0x4b2620=await Cesium__namespace[_0x5235d5(0xbce)]['fromUrl'](getUrlResource(_0x4cee1c),_0x4cee1c);break;case TerrainType['VR']:_0x4b2620=await Cesium__namespace['VRTheWorldTerrainProvider']['fromUrl'](getUrlResource(_0x4cee1c),_0x4cee1c);break;default:{const _0x2b25e0=getTerrainProviderClass(_0x4cee1c['type']);_0x2b25e0&&(_0x2b25e0['fromUrl']?_0x4b2620=await _0x2b25e0[_0x5235d5(_0xe51f30._0x570b8b)](getUrlResource(_0x4cee1c),_0x4cee1c):_0x4b2620=new _0x2b25e0(_0x4cee1c));}break;}return _0x4b2620;}function getTerrainProviderViewModels(_0x416ba0){const _0x206789={_0x8b885b:0x703,_0x47cb86:0x2f2,_0x32dae7:0x558},_0x252874={_0xd09d90:0x59f},_0x41163c={_0x34ee24:0xa3a},_0x4c8de3=_0x3d5d32;return _0x416ba0?[new Cesium__namespace[(_0x4c8de3(0x558))]({'name':_0x4c8de3(0xa80),'iconUrl':Cesium__namespace['buildModuleUrl'](_0x4c8de3(_0x206789._0x8b885b)),'tooltip':_0x4c8de3(0xd0e),'category':'','creationFunction':function(){return getNoTerrainProvider();}}),new Cesium__namespace[(_0x4c8de3(0x558))]({'name':_0x416ba0['name']||'有地形','iconUrl':Cesium__namespace['buildModuleUrl'](_0x4c8de3(0x840)),'tooltip':_0x416ba0['tooltip']||'提供的高精度的DEM地形服务','category':'','creationFunction':function(){return createTerrainProvider(_0x416ba0);}})]:[new Cesium__namespace['ProviderViewModel']({'name':_0x4c8de3(0xa80),'iconUrl':Cesium__namespace[_0x4c8de3(_0x206789._0x47cb86)]('Widgets/Images/TerrainProviders/Ellipsoid.png'),'tooltip':'WGS84标准椭球,即\x20EPSG:4326','category':'','creationFunction':function(){return getNoTerrainProvider();}}),new Cesium__namespace[(_0x4c8de3(_0x206789._0x32dae7))]({'name':'Mar3D\x20中国地形','iconUrl':Cesium__namespace['buildModuleUrl']('Widgets/Images/TerrainProviders/CesiumWorldTerrain.png'),'tooltip':'Mar3D提供的12.5米精度的中国地形','category':'','creationFunction':function(){return createTerrainProvider({'url':'//data.mars3d.cn/terrain'});}}),new Cesium__namespace[(_0x4c8de3(_0x206789._0x32dae7))]({'name':'Ion\x20全球地形','iconUrl':Cesium__namespace['buildModuleUrl']('Widgets/Images/TerrainProviders/CesiumWorldTerrain.png'),'tooltip':'Cesium官方Ion提供的高分辨率全球地形','category':'','creationFunction':function(){const _0x3ef561=_0x4c8de3;return createTerrainProvider({'type':_0x3ef561(_0x41163c._0x34ee24)});}}),new Cesium__namespace['ProviderViewModel']({'name':'ArcGIS\x20全球地形','iconUrl':Cesium__namespace['buildModuleUrl']('Widgets/Images/TerrainProviders/CesiumWorldTerrain.png'),'tooltip':_0x4c8de3(0x577),'category':'','creationFunction':function(){const _0x49da69=_0x4c8de3;return createTerrainProvider({'type':_0x49da69(_0x252874._0xd09d90),'url':'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer'});}})];}var LayerUtil={'__proto__':null,'register':register$2,'getClass':getClass$2,'create':create$2,'converOptions':converOptions,'registerImageryProvider':registerImageryProvider,'getProviderClass':getProviderClass,'createImageryProvider':createImageryProvider$k,'getImageryProviderViewModels':getImageryProviderViewModels,'getNoTerrainProvider':getNoTerrainProvider,'registerTerrainProvider':registerTerrainProvider,'getTerrainProviderClass':getTerrainProviderClass,'createTerrainProvider':createTerrainProvider,'getTerrainProviderViewModels':getTerrainProviderViewModels};const ControlClass={};function register$1(_0x43a41b,_0x333224){const _0x34f077={_0x36d249:0x7f5,_0x55415f:0xf8c},_0x248966=_0x3d5d32;ControlClass[_0x43a41b]&&logError$1(_0x248966(0xd80)+_0x43a41b+'类型已存在',_0x333224),ControlType[_0x43a41b]=_0x43a41b,ControlClass[_0x43a41b]=_0x333224,_0x333224[_0x248966(_0x34f077._0x36d249)]=_0x43a41b,_0x333224[_0x248966(_0x34f077._0x55415f)]['_type']=_0x43a41b;}function getClass$1(_0x29cc12){return ControlClass[_0x29cc12];}function create$1(_0x2e6186,_0x507e0e){const _0x31e757=getClass$1(_0x2e6186);if(_0x31e757){const _0x20b83d=new _0x31e757(_0x507e0e);return _0x20b83d;}}var ControlUtil={'__proto__':null,'register':register$1,'getClass':getClass$1,'create':create$1};const EffectClass={};function register(_0x345976,_0x4b4139){const _0x313266=_0x3d5d32;EffectClass[_0x345976]&&logError$1('register:\x20'+_0x345976+'类型已存在',_0x4b4139),EffectType[_0x345976]=_0x345976,EffectClass[_0x345976]=_0x4b4139,_0x4b4139[_0x313266(0x7f5)]=_0x345976,_0x4b4139['prototype']['_type']=_0x345976;}function getClass(_0x4d4343){return EffectClass[_0x4d4343];}function create(_0x49d095,_0x1069bf){const _0x544b6a=_0x3d5d32,_0x3b1c4f=getClass(_0x49d095);if(_0x3b1c4f){const _0x5918f9=new _0x3b1c4f(_0x1069bf);return _0x5918f9;}else logWarn(_0x544b6a(0xaa1),_0x49d095,_0x1069bf);}var EffectUtil={'__proto__':null,'register':register,'getClass':getClass,'create':create};class BaseOptsConver{constructor(_0x3787dd={}){this['options']=_0x3787dd;}get[_0x3d5d32(0xfa5)](){return null;}get['includeKeys'](){const _0x12091e=_0x3d5d32;return['color','outlineColor','backgroundColor',_0x12091e(0x7ce)];}['toCesiumVal'](_0x26c003,_0x2c40e4={}){const _0xdc6fca=_0x3d5d32;this['_toCesiumValBefore'](_0x26c003,_0x2c40e4);for(const _0x3107cf in _0x26c003){const _0x4aa9a7=_0x26c003[_0x3107cf];if(this['includeKeys']['indexOf'](_0x3107cf)===-0x1){if(!isSimpleType(_0x4aa9a7)){_0x2c40e4[_0x3107cf]=_0x4aa9a7;continue;}if(this['excludedKeys']&&this['excludedKeys']['indexOf'](_0x3107cf)!==-0x1)continue;}const _0x76378f=this[_0xdc6fca(0x259)](_0x3107cf,_0x4aa9a7,_0x26c003,_0x2c40e4);if(_0x76378f==null)continue;_0x2c40e4[_0x3107cf]=_0x76378f;}return this['_toCesiumValEnd'](_0x26c003,_0x2c40e4),_0x2c40e4;}['_toCesiumValBefore'](_0x4e1d9d,_0x593a65){}['_toCesiumValEnd'](_0xf5172f,_0x3e7fce){}['_toOneCesiumVal'](_0x641952,_0x273e64,_0x41b967,_0x56d29c){switch(_0x641952){default:_0x56d29c[_0x641952]=_0x273e64;break;}}['toJSON'](_0x3489c5,_0x2a9717={}){_0x3489c5=getAttrVal(_0x3489c5);this['_toJSONValBefore']&&this['_toJSONValBefore'](_0x2a9717,_0x3489c5);for(const _0x1cb7ce in _0x3489c5){const _0x2f1003=_0x3489c5[_0x1cb7ce];isSimpleType(_0x2f1003)?_0x2a9717[_0x1cb7ce]=_0x2f1003:this['_toOneJson'](_0x1cb7ce,_0x3489c5[_0x1cb7ce],_0x2a9717);}return this['_toJSONValEnd']&&this['_toJSONValEnd'](_0x2a9717,_0x3489c5),_0x2a9717;}['_toOneJson'](_0x5a7ac9,_0xf5986d,_0x1f4ed2){}static['getColorByStyle'](_0xe28d01){const _0x1311f1={_0x2e7189:0x40f},_0xafd4c8=_0x3d5d32;return!this[_0xafd4c8(_0x1311f1._0x2e7189)]&&(this['baseOptsConver']=new BaseOptsConver()),this['baseOptsConver']['getColorByStyle'](_0xe28d01);}['getColorByStyle'](_0x432915){return getColorByStyle(_0x432915,this['options']['color']);}['getOutlineColorByStyle'](_0x4b138b){const _0x2e4bd6={_0x34b610:0x433,_0x5d042c:0xfdc},_0x49ac72=_0x3d5d32;let _0x9ecebd;_0x4b138b['outlineColor']?isString(_0x4b138b['outlineColor'])?_0x9ecebd=Cesium__namespace['Color']['fromCssColorString'](_0x4b138b['outlineColor']):_0x9ecebd=_0x4b138b['outlineColor']:_0x9ecebd=this[_0x49ac72(_0x2e4bd6._0x34b610)]['outlineColor'];if(!_0x9ecebd)return _0x9ecebd;if(Cesium__namespace['defined'](_0x4b138b['outlineOpacity']))_0x9ecebd=_0x9ecebd['withAlpha'](Number(_0x4b138b['outlineOpacity']));else Cesium__namespace['defined'](_0x4b138b[_0x49ac72(_0x2e4bd6._0x5d042c)])&&(_0x9ecebd=_0x9ecebd['withAlpha'](Number(_0x4b138b['opacity'])));return Cesium__namespace['defined'](_0x4b138b['globalAlpha'])&&_0x4b138b['globalAlpha']!==0x1&&(_0x9ecebd=_0x9ecebd[_0x49ac72(0xe57)](_0x9ecebd['alpha']*_0x4b138b['globalAlpha'])),_0x9ecebd;}}class BaseMaterialConver extends BaseOptsConver{get[_0x3d5d32(0xfa5)](){const _0x45980a={_0x3c169d:0x4f3},_0x5dca26=_0x3d5d32,_0x2c53c6=['label'];return _0x2c53c6[_0x5dca26(0xc97)](this[_0x5dca26(_0x45980a._0x3c169d)]());}['_getExcludedStyle'](){return[];}static[_0x3d5d32(0x83d)](_0x23ae33,_0x569209){const _0x348a1b={_0x3cb516:0x4d2},_0x4e75b4=_0x3d5d32;return!this[_0x4e75b4(_0x348a1b._0x3cb516)]&&(this['baseMaterialConver']=new BaseMaterialConver()),this['baseMaterialConver']['toCesiumVal'](_0x23ae33,_0x569209);}[_0x3d5d32(0x259)](_0x32e222,_0x39ddd7,_0x426ea9,_0x40c48d){const _0x27d9f3={_0x1309f7:0xe8f,_0x328f65:0x1051,_0x48e1a6:0x67e,_0x5f4f75:0xe57,_0x1a210f:0x24b,_0x64559f:0xb2b,_0x24eb45:0xc52,_0x49b23e:0x42d,_0x109a32:0x7ef},_0x14ccdb=_0x3d5d32;switch(_0x32e222){case'color':case'randomColor':_0x40c48d[_0x14ccdb(_0x27d9f3._0x1309f7)]=this[_0x14ccdb(_0x27d9f3._0x328f65)](_0x426ea9);break;case'color2':case _0x14ccdb(0x664):case'outlineColor':case _0x14ccdb(0x498):case _0x14ccdb(0x457):case'lightColor':case'darkColor':case _0x14ccdb(_0x27d9f3._0x48e1a6):case _0x14ccdb(0x958):case'gapColor':case'strokeColor':case _0x14ccdb(0xd6e):case'asphaltColor':{let _0x335237=getCesiumColor(_0x39ddd7);Cesium__namespace['defined'](_0x426ea9['opacity'])&&_0x426ea9['opacity']!==0x1&&(_0x335237=_0x335237[_0x14ccdb(_0x27d9f3._0x5f4f75)](_0x426ea9['opacity']));Cesium__namespace['defined'](_0x426ea9[_0x14ccdb(0xc96)])&&_0x426ea9['globalAlpha']!==0x1&&(_0x335237=_0x335237[_0x14ccdb(0xe57)](_0x335237[_0x14ccdb(_0x27d9f3._0x1a210f)]*_0x426ea9['globalAlpha']));_0x40c48d[_0x32e222]=_0x335237;break;}case _0x14ccdb(0xb2b):case'repeat_y':{const _0x587156=_0x426ea9[_0x14ccdb(_0x27d9f3._0x64559f)]??0x1,_0x2ff43b=_0x426ea9[_0x14ccdb(_0x27d9f3._0x24eb45)]??0x1;_0x40c48d[_0x14ccdb(0xefd)]=new Cesium__namespace['Cartesian2'](_0x587156,_0x2ff43b);break;}case'repeat':{_0x426ea9['materialType']===Stripe||_0x426ea9['materialType']===CylinderWave?_0x40c48d[_0x32e222]=_0x39ddd7:_0x40c48d[_0x32e222]=new Cesium__namespace['Cartesian2'](_0x426ea9['repeat_x']||_0x39ddd7,_0x426ea9['repeat_y']||_0x39ddd7);break;}case'lineCount':case'lineThickness':case'lineOffset':case'noiseScale':{_0x40c48d[_0x32e222]=new Cesium__namespace['Cartesian2'](_0x39ddd7,_0x39ddd7);break;}case _0x14ccdb(_0x27d9f3._0x49b23e):{_0x39ddd7?_0x40c48d[_0x32e222]=Cesium__namespace['StripeOrientation']['VERTICAL']:_0x40c48d[_0x32e222]=Cesium__namespace[_0x14ccdb(_0x27d9f3._0x109a32)]['HORIZONTAL'];break;}default:_0x40c48d[_0x32e222]=_0x39ddd7;break;}}static['toJSON'](_0x43b33b,_0xd44def){return!this['baseMaterialConver']&&(this['baseMaterialConver']=new BaseMaterialConver()),this['baseMaterialConver']['toJSON'](_0x43b33b,_0xd44def);}['toJSON'](_0x10a546,_0x26e3b7={}){const _0x219a35={_0x261ffc:0x433,_0x481b8a:0x3db},_0x22c11d=_0x3d5d32;var _0x5ad2a3;if((_0x5ad2a3=_0x10a546)!==null&&_0x5ad2a3!==void 0x0&&_0x5ad2a3['options']){const _0xb1ba05=_0x10a546[_0x22c11d(_0x219a35._0x261ffc)];for(const _0x5786e7 in _0xb1ba05){Cesium__namespace['defined'](_0x10a546[_0x5786e7])&&(_0xb1ba05[_0x5786e7]=_0x10a546[_0x5786e7]);}_0x10a546=_0xb1ba05;}return super[_0x22c11d(_0x219a35._0x481b8a)](_0x10a546,_0x26e3b7);}[_0x3d5d32(0x1056)](_0x127b25,_0x26233d,_0x290afd){const _0x2a66c7={_0x3ec1d4:0x457,_0xaaee14:0xd28,_0x8766d1:0x7b1},_0x2a103a=_0x3d5d32;if(_0x26233d instanceof Cesium__namespace['Color']){_0x290afd[_0x127b25]=_0x26233d['toCssColorString']();return;}switch(_0x127b25){case'label':break;case'color':case'fillColor':case _0x2a103a(0x62a):case'evenColor':case _0x2a103a(_0x2a66c7._0x3ec1d4):case'baseWaterColor':case'blendColor':case'gapColor':case _0x2a103a(0x7ce):case'backgroundColor':case _0x2a103a(0x420):case'lightColor':{const _0x1f9f78=getCesiumColor(_0x26233d);_0x1f9f78&&(_0x290afd[_0x127b25]=_0x1f9f78['toCssColorString']());break;}case'repeat':{_0x26233d instanceof Cesium__namespace['Cartesian2']?_0x26233d['x']!==_0x26233d['y']?(_0x290afd[_0x127b25+'_x']=_0x26233d['x'],_0x290afd[_0x127b25+'_y']=_0x26233d['y']):_0x290afd[_0x127b25]=_0x26233d['x']:_0x290afd[_0x127b25]=_0x26233d;break;}case'lineCount':case'lineThickness':case'lineOffset':case _0x2a103a(_0x2a66c7._0xaaee14):{_0x290afd[_0x127b25+'_x']=_0x26233d['x'],_0x290afd[_0x127b25+'_y']=_0x26233d['y'];break;}default:console[_0x2a103a(_0x2a66c7._0x8766d1)]('未处理的属性',_0x127b25,_0x26233d);break;}}}registerOptsConver('default',BaseMaterialConver);class ColorOptsConver extends BaseMaterialConver{static[_0x3d5d32(0x83d)](_0x2d29d6,_0x156511,_0x49369b){const _0x6cab35=_0x3d5d32;if(_0x2d29d6 instanceof Cesium__namespace['Color'])return _0x2d29d6;return!this['colorOptsConver']&&(this[_0x6cab35(0xfb7)]=new ColorOptsConver()),this['colorOptsConver']['isProperty']=_0x49369b,this['colorOptsConver'][_0x6cab35(0x83d)](_0x2d29d6,_0x156511);}[_0x3d5d32(0x83d)](_0xd2bd34){const _0x1aff11={_0x4d8fd8:0x1051},_0x25897b=_0x3d5d32;return this['isProperty']?this[_0x25897b(0x1051)](_0xd2bd34):{'color':this[_0x25897b(_0x1aff11._0x4d8fd8)](_0xd2bd34)};}static[_0x3d5d32(0x3db)](_0x18fce8,_0xde12e7={},_0x2f006e=![]){const _0x5200d4={_0x5b5b0a:0xfb7,_0x4c8f60:0x3db},_0x217d8d=_0x3d5d32;return!this[_0x217d8d(_0x5200d4._0x5b5b0a)]&&(this[_0x217d8d(0xfb7)]=new ColorOptsConver()),this['colorOptsConver']['isProperty']=_0x2f006e,this['colorOptsConver'][_0x217d8d(_0x5200d4._0x4c8f60)](_0x18fce8,_0xde12e7);}['toJSON'](_0x2441de,_0x544c73={}){const _0x343dd3={_0x3539ca:0x882},_0x58567b=_0x3d5d32;var _0x53182b;(_0x53182b=_0x2441de)!==null&&_0x53182b!==void 0x0&&_0x53182b['color']&&(_0x2441de=_0x2441de[_0x58567b(0xe8f)]);let _0x46eab7=getCesiumValue(_0x2441de,Cesium__namespace[_0x58567b(_0x343dd3._0x3539ca)]);_0x46eab7['color']&&(_0x46eab7=_0x46eab7['color']);if(_0x46eab7){if(_0x46eab7 instanceof Cesium__namespace[_0x58567b(0x882)])_0x544c73['color']=_0x46eab7['toCssColorString']();else isString(_0x46eab7)&&(_0x544c73['color']=_0x46eab7);}return _0x544c73;}}registerOptsConver(Color$2,ColorOptsConver),registerOptsConver(PolylineArrow,ColorOptsConver);class ImageOptsConver extends BaseMaterialConver{get[_0x3d5d32(0xfa5)](){return['repeat_y'];}static[_0x3d5d32(0x83d)](_0x1824d2,_0x41407d){return!this['imageOptsConver']&&(this['imageOptsConver']=new ImageOptsConver()),this['imageOptsConver']['toCesiumVal'](_0x1824d2,_0x41407d);}['_toOneCesiumVal'](_0x38d3c6,_0x564412,_0x571b78,_0x106d90){const _0xaf77d2={_0x19fd31:0xc52,_0x2fa026:0xb0e},_0x56b515=_0x3d5d32;switch(_0x38d3c6){case'repeat_x':{const _0x4d7b55=_0x571b78['repeat_x']??0x1,_0x1533e1=_0x571b78[_0x56b515(_0xaf77d2._0x19fd31)]??0x1;_0x106d90['repeat']=new Cesium__namespace['Cartesian2'](_0x4d7b55,_0x1533e1);break;}case'repeat':{_0x106d90[_0x38d3c6]=new Cesium__namespace[(_0x56b515(_0xaf77d2._0x2fa026))](_0x571b78[_0x56b515(0xb2b)]||_0x564412,_0x571b78['repeat_y']||_0x564412);break;}case'color':break;case _0x56b515(0xfdc):if(Cesium__namespace['defined'](_0x571b78['globalAlpha'])&&_0x571b78['globalAlpha']!==0x1)_0x106d90['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x571b78['globalAlpha']*(_0x564412??0x1));else _0x571b78['transparent']??!![]?_0x106d90['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x564412??0x1):_0x106d90[_0x56b515(0xe8f)]=Cesium__namespace['Color'][_0x56b515(0x7a7)];break;default:_0x106d90[_0x38d3c6]=_0x564412;break;}}['_toCesiumValEnd'](_0x435520,_0x2efdef){const _0x6e05fe={_0x397e6e:0xaab},_0x2a906c=_0x3d5d32;_0x2efdef[_0x2a906c(_0x6e05fe._0x397e6e)]=_0x2efdef[_0x2a906c(_0x6e05fe._0x397e6e)]??!![];}static['toJSON'](_0x2864d9,_0x42eecd){const _0x4da195={_0x211bba:0x36a},_0x4ac887=_0x3d5d32;return!this['imageOptsConver']&&(this['imageOptsConver']=new ImageOptsConver()),this[_0x4ac887(_0x4da195._0x211bba)]['toJSON'](_0x2864d9,_0x42eecd);}['_toOneJson'](_0x6213d4,_0x3cea82,_0x3e5a04){const _0x3b08f3={_0x313a4e:0xefd,_0x57fff2:0x7b1},_0x5dc12c=_0x3d5d32;switch(_0x6213d4){case _0x5dc12c(_0x3b08f3._0x313a4e):{_0x3e5a04['repeat_x']=_0x3cea82['x'],_0x3e5a04['repeat_y']=_0x3cea82['y'];break;}case'color':{var _0x20ac04;_0x3e5a04['opacity']=((_0x20ac04=getCesiumColor(_0x3cea82))===null||_0x20ac04===void 0x0?void 0x0:_0x20ac04['alpha'])??0x1;break;}default:console[_0x5dc12c(_0x3b08f3._0x57fff2)]('未处理的属性',_0x6213d4,_0x3cea82);break;}}}registerOptsConver(Image$1,ImageOptsConver);class BaseStyleConver extends BaseOptsConver{get[_0x3d5d32(0xfa5)](){const _0x248b8c={_0x5d3e33:0xb1e,_0x4c7ee5:0xc97,_0x1b3e93:0x4f3},_0x317f41=_0x3d5d32,_0xa5e669=['type','label','outlineOpacity','outlineStyle',_0x317f41(_0x248b8c._0x5d3e33),'lineThickness',_0x317f41(0xdfe),'oddcolor',_0x317f41(0x85c),'axisY',_0x317f41(0x8c7),'color2','scaleByDistance_near','scaleByDistance_nearValue','scaleByDistance_far',_0x317f41(0x61e),'distanceDisplayCondition_far','distanceDisplayCondition_near'];return _0xa5e669[_0x317f41(_0x248b8c._0x4c7ee5)](this[_0x317f41(_0x248b8c._0x1b3e93)]());}['_getExcludedStyle'](){return[];}[_0x3d5d32(0x9ff)](_0x34a8b2,_0x4cc37d){const _0x8208ea={_0x395147:0xe8f,_0x5a63e9:0x8e1},_0x25305f=_0x3d5d32;if(!_0x34a8b2['material']&&!_0x34a8b2['materialType']){var _0x2aa5bb;if(_0x34a8b2[_0x25305f(_0x8208ea._0x395147)]||_0x34a8b2[_0x25305f(0x3e4)]||(_0x2aa5bb=_0x34a8b2['materialOptions'])!==null&&_0x2aa5bb!==void 0x0&&_0x2aa5bb['color'])_0x34a8b2['materialType']=Color$2;else _0x34a8b2[_0x25305f(_0x8208ea._0x5a63e9)]&&(_0x34a8b2['materialType']=Image$1);}}[_0x3d5d32(0x790)](_0x41ce7d,_0x325447,_0x11da9e,_0x4a266b){const _0x1b4cc6={_0x3a4101:0x7c0,_0x519cd2:0x21d,_0xb70db2:0xd7d,_0x419ac8:0x63f,_0x48bd65:0x501,_0x1eed46:0xc42},_0x59363a=_0x3d5d32;switch(_0x41ce7d){case _0x59363a(_0x1b4cc6._0x3a4101):_0x325447?_0x4a266b['heightReference']=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:_0x4a266b['heightReference']=Cesium__namespace['HeightReference']['NONE'];break;case _0x59363a(_0x1b4cc6._0x519cd2):_0x325447?_0x4a266b['disableDepthTestDistance']=0x0:_0x4a266b['disableDepthTestDistance']=Number['POSITIVE_INFINITY'];break;case'hasShadows':_0x325447?_0x4a266b['shadows']=Cesium__namespace['ShadowMode']['ENABLED']:_0x4a266b[_0x59363a(0x1001)]=Cesium__namespace[_0x59363a(0xddd)][_0x59363a(_0x1b4cc6._0xb70db2)];break;case'scaleByDistance':_0x325447?_0x4a266b['scaleByDistance']=new Cesium__namespace[(_0x59363a(0x590))](Number(Cesium__namespace['defaultValue'](_0x11da9e['scaleByDistance_near'],0x3e8)),Number(Cesium__namespace['defaultValue'](_0x11da9e[_0x59363a(_0x1b4cc6._0x419ac8)],0x1)),Number(Cesium__namespace['defaultValue'](_0x11da9e[_0x59363a(0x711)],0xf4240)),Number(Cesium__namespace['defaultValue'](_0x11da9e['scaleByDistance_farValue'],0.1))):_0x4a266b['scaleByDistance']=undefined;break;case'distanceDisplayCondition':_0x325447?_0x4a266b['distanceDisplayCondition']=new Cesium__namespace[(_0x59363a(0xe4a))](Number(Cesium__namespace[_0x59363a(_0x1b4cc6._0x48bd65)](_0x11da9e['distanceDisplayCondition_near'],0x0)),Number(Cesium__namespace[_0x59363a(0x501)](_0x11da9e[_0x59363a(_0x1b4cc6._0x1eed46)],Number['MAX_VALUE']))):_0x4a266b['distanceDisplayCondition']=undefined;break;default:_0x4a266b[_0x41ce7d]=_0x325447;break;}}['_toOneCesiumVal_Poly'](_0x288ee9,_0x384948,_0x513eaa,_0x38dec2){const _0x123eed={_0x14d89c:0xd8f,_0x4e8a6f:0x690,_0x1e6276:0x73a,_0x5eec2c:0x501},_0x2a6e93=_0x3d5d32;switch(_0x288ee9){case'materialType':{this[_0x2a6e93(0x2b2)]?_0x38dec2[_0x2a6e93(_0x123eed._0x14d89c)]=createMaterialProperty(_0x513eaa['materialType'],_0x513eaa[_0x2a6e93(0xe16)]||_0x513eaa):_0x38dec2['material']=createMaterial(_0x513eaa['materialType'],_0x513eaa['materialOptions']||_0x513eaa);break;}case'color':case'randomColor':{_0x38dec2[_0x2a6e93(0xe8f)]=this[_0x2a6e93(0x1051)](_0x513eaa);break;}case'outlineColor':{_0x38dec2['outlineColor']=this['getOutlineColorByStyle'](_0x513eaa);break;}case'hasShadows':_0x384948?_0x38dec2['shadows']=Cesium__namespace['ShadowMode'][_0x2a6e93(_0x123eed._0x4e8a6f)]:_0x38dec2['shadows']=Cesium__namespace['ShadowMode'][_0x2a6e93(0xd7d)];break;case'distanceDisplayCondition':_0x384948?this['isEntity']?_0x38dec2['distanceDisplayCondition']=new Cesium__namespace['DistanceDisplayCondition'](Number(Cesium__namespace['defaultValue'](_0x513eaa['distanceDisplayCondition_near'],0x0)),Number(Cesium__namespace['defaultValue'](_0x513eaa['distanceDisplayCondition_far'],Number['MAX_VALUE']))):_0x38dec2['distanceDisplayCondition']=new Cesium__namespace['DistanceDisplayConditionGeometryInstanceAttribute'](Number(Cesium__namespace['defaultValue'](_0x513eaa[_0x2a6e93(_0x123eed._0x1e6276)],0x0)),Number(Cesium__namespace[_0x2a6e93(_0x123eed._0x5eec2c)](_0x513eaa['distanceDisplayCondition_far'],Number['MAX_VALUE']))):_0x38dec2['distanceDisplayCondition']=undefined;break;default:_0x38dec2[_0x288ee9]instanceof Cesium__namespace['CallbackProperty']?logWarn('回调属性未覆盖更新',_0x288ee9,_0x384948):_0x38dec2[_0x288ee9]=_0x384948;break;}}['_toJSONValEnd'](_0x391332,_0xd36937){}[_0x3d5d32(0xfbd)](_0x59ed96,_0x4f1782,_0x5aa8c5){const _0xf0e32b={_0x4b779f:0xe16,_0x283d1c:0xc9e,_0x56b0dc:0x103e,_0xb34f36:0x1001},_0x10ad11=_0x3d5d32;switch(_0x59ed96){case'label':case'outlineStyle':case'highlight':{break;}case'material':{toJSON(_0x4f1782,_0x5aa8c5);break;}case _0x10ad11(_0xf0e32b._0x4b779f):{_0x5aa8c5[_0x59ed96]=toJSONByType(_0x5aa8c5['materialType'],_0x4f1782);break;}case'color':{const _0xd7e44=getCesiumColor(_0x4f1782);_0xd7e44&&(_0x5aa8c5[_0x59ed96]=_0xd7e44[_0x10ad11(0xceb)]());break;}case'outlineColor':{const _0x5c33f1=getCesiumColor(_0x4f1782);_0x5c33f1&&(_0x5aa8c5[_0x59ed96]=_0x5c33f1['toCssColorString']());break;}case'rotation':_0x5aa8c5[_0x10ad11(0x9f1)]=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x4f1782),0x2);break;case'stRotation':_0x5aa8c5[_0x10ad11(_0xf0e32b._0x283d1c)]=formatNum$1(Cesium__namespace[_0x10ad11(_0xf0e32b._0x56b0dc)]['toDegrees'](_0x4f1782),0x2);break;case _0x10ad11(_0xf0e32b._0xb34f36):{_0x4f1782===Cesium__namespace['ShadowMode']['ENABLED']?_0x5aa8c5['shadows']=!![]:_0x5aa8c5[_0x59ed96]=_0x4f1782;break;}case'distanceDisplayCondition':{_0x5aa8c5['distanceDisplayCondition_near']=_0x4f1782['near'],_0x5aa8c5['distanceDisplayCondition_far']=_0x4f1782['far'];break;}default:logWarn(_0x10ad11(0x401),_0x59ed96,_0x4f1782);break;}}['_toOneJson_Point'](_0x5f0215,_0x281283,_0x2e5963){const _0x1d3170={_0x15e10e:0xd8f,_0x497975:0xb2a,_0x1e9666:0xe8f,_0x58220b:0x2d5,_0x58da2a:0x7c0,_0x59bec1:0x31f,_0xf3a19e:0xc39},_0x3059de=_0x3d5d32;switch(_0x5f0215){case'label':case'outlineStyle':case'highlight':{break;}case _0x3059de(_0x1d3170._0x15e10e):{toJSON(_0x281283,_0x2e5963);break;}case _0x3059de(0xe16):{_0x2e5963[_0x5f0215]=toJSONByType(_0x2e5963[_0x3059de(_0x1d3170._0x497975)],_0x281283);break;}case _0x3059de(_0x1d3170._0x1e9666):case'fillColor':case'outlineColor':case'backgroundColor':case'strokeColor':{const _0x2846f5=getCesiumColor(_0x281283);_0x2846f5&&(_0x2e5963[_0x5f0215]=_0x2846f5['toCssColorString']());break;}case'heightReference':{_0x281283===Cesium__namespace[_0x3059de(_0x1d3170._0x58220b)]['CLAMP_TO_GROUND']&&(_0x2e5963[_0x3059de(_0x1d3170._0x58da2a)]=!![]);break;}case _0x3059de(_0x1d3170._0x59bec1):_0x2e5963[_0x3059de(0x9f1)]=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x281283),0x2);break;case'stRotation':_0x2e5963['stRotationDegree']=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x281283),0x2);break;case'disableDepthTestDistance':{_0x281283===Number[_0x3059de(_0x1d3170._0xf3a19e)]?_0x2e5963['visibleDepth']=![]:_0x2e5963[_0x3059de(0xf53)]=_0x281283;break;}case'scaleByDistance':{_0x2e5963['scaleByDistance']=!![],_0x2e5963['scaleByDistance_near']=_0x281283['near'],_0x2e5963[_0x3059de(0x63f)]=_0x281283['nearValue'],_0x2e5963['scaleByDistance_far']=_0x281283['far'],_0x2e5963['scaleByDistance_farValue']=_0x281283['farValue'];break;}case'distanceDisplayCondition':{_0x2e5963['distanceDisplayCondition']=!![],_0x2e5963[_0x3059de(0x73a)]=_0x281283['near'],_0x2e5963['distanceDisplayCondition_far']=_0x281283['far'];break;}default:logWarn(_0x3059de(0x401),_0x5f0215,_0x281283);break;}}}class BillboardStyleConver extends BaseStyleConver{['_getExcludedStyle'](){const _0x99f005={_0x48aff2:0xe7a},_0x4085b6=_0x3d5d32;return['outlineColor','backgroundColor','font_style','font_weight','font_size',_0x4085b6(0xf81),'backgroundOpacity',_0x4085b6(0x265),_0x4085b6(_0x99f005._0x48aff2)];}static['toCesiumVal'](_0x64d599,_0x2d2a0e,_0x22cffa){const _0x3602e8={_0x444095:0xf77,_0x2615ee:0x2b2},_0x850fdb=_0x3d5d32;return!this['billboardStyleConver']&&(this['billboardStyleConver']=new BillboardStyleConver()),this[_0x850fdb(_0x3602e8._0x444095)][_0x850fdb(_0x3602e8._0x2615ee)]=_0x22cffa,this['billboardStyleConver']['toCesiumVal'](_0x64d599,_0x2d2a0e);}[_0x3d5d32(0x9ff)](_0x3b48d9,_0x382a5b){const _0x10de93={_0x596dcb:0xf30},_0x165412=_0x3d5d32;_0x382a5b['horizontalOrigin']=_0x382a5b['horizontalOrigin']??Cesium__namespace['HorizontalOrigin']['CENTER'],_0x382a5b[_0x165412(_0x10de93._0x596dcb)]=_0x382a5b['verticalOrigin']??Cesium__namespace['HorizontalOrigin']['BOTTOM'];}['_toOneCesiumVal'](_0x247ae2,_0x3f43cb,_0x4088fa,_0x3d118b){const _0x33c0e7={_0x4b2d8b:0xe8f,_0xa8e3da:0x882,_0x51c4e6:0x4fe,_0x377a61:0x85e,_0x52f187:0xb84,_0x5eb8b3:0x85e},_0x5b1fdd=_0x3d5d32;switch(_0x247ae2){case'color':{_0x3d118b[_0x5b1fdd(_0x33c0e7._0x4b2d8b)]=this['getColorByStyle'](_0x4088fa);break;}case _0x5b1fdd(0xfdc):Cesium__namespace['defined'](_0x4088fa[_0x5b1fdd(0xc96)])&&_0x4088fa['globalAlpha']!==0x1?_0x3d118b['color']=Cesium__namespace[_0x5b1fdd(_0x33c0e7._0xa8e3da)]['WHITE']['withAlpha'](_0x4088fa[_0x5b1fdd(0xc96)]*(_0x3f43cb??0x1)):_0x3d118b['color']=Cesium__namespace['Color']['WHITE'][_0x5b1fdd(0xe57)](_0x3f43cb??0x1);break;case _0x5b1fdd(0x9f1):_0x3d118b[_0x5b1fdd(0x31f)]=Cesium__namespace[_0x5b1fdd(0x103e)]['toRadians'](_0x3f43cb);break;case'hasPixelOffset':!_0x3f43cb&&(_0x3d118b['pixelOffset']=new Cesium__namespace['Cartesian2'](0x0,0x0));break;case _0x5b1fdd(_0x33c0e7._0x51c4e6):case'pixelOffsetY':_0x3d118b[_0x5b1fdd(0x85e)]=new Cesium__namespace[(_0x5b1fdd(0xb0e))](_0x4088fa['pixelOffsetX']||0x0,_0x4088fa['pixelOffsetY']||0x0);break;case _0x5b1fdd(_0x33c0e7._0x377a61):Cesium__namespace['defined'](_0x3f43cb[0x0])&&Cesium__namespace[_0x5b1fdd(_0x33c0e7._0x52f187)](_0x3f43cb[0x1])?_0x3d118b[_0x5b1fdd(0x85e)]=new Cesium__namespace['Cartesian2'](_0x3f43cb[0x0],_0x3f43cb[0x1]):_0x3d118b[_0x5b1fdd(_0x33c0e7._0x5eb8b3)]=_0x3f43cb;break;default:this['_toOneCesiumVal_Point'](_0x247ae2,_0x3f43cb,_0x4088fa,_0x3d118b);break;}}static[_0x3d5d32(0x3db)](_0x5afa1a,_0x3c3eab,_0x231d97){const _0x52895b={_0x201f48:0xf77,_0x47c678:0xf77,_0x2f89ca:0x3db},_0x40d7ea=_0x3d5d32;return!this[_0x40d7ea(_0x52895b._0x201f48)]&&(this[_0x40d7ea(_0x52895b._0x47c678)]=new BillboardStyleConver()),this['billboardStyleConver']['isEntity']=_0x231d97,this[_0x40d7ea(0xf77)][_0x40d7ea(_0x52895b._0x2f89ca)](_0x5afa1a,_0x3c3eab);}[_0x3d5d32(0x1056)](_0x1faa16,_0x53be6f,_0x59dffd){const _0x2a52f2=_0x3d5d32;switch(_0x1faa16){case _0x2a52f2(0x85e):{_0x59dffd['pixelOffsetX']=_0x53be6f['x'],_0x59dffd['pixelOffsetY']=_0x53be6f['y'];break;}default:this['_toOneJson_Point'](_0x1faa16,_0x53be6f,_0x59dffd);break;}}}class CloudStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x552c14,_0x10975f){return!this['cloudStyleConver']&&(this['cloudStyleConver']=new CloudStyleConver()),this['cloudStyleConver']['toCesiumVal'](_0x552c14,_0x10975f);}['_toCesiumValBefore'](_0x366b15,_0x2bb697){}['_toOneCesiumVal'](_0x3703b5,_0x1c021c,_0x239c11,_0xa0fa7c){const _0x445074=_0x3d5d32;switch(_0x3703b5){case'scaleX':case'scaleY':_0xa0fa7c['scale']=new Cesium__namespace['Cartesian2'](_0x239c11['scaleX']||0x1,_0x239c11['scaleY']||0x1);break;case'maximumSizeX':case'maximumSizeY':case'maximumSizeZ':_0xa0fa7c['maximumSize']=new Cesium__namespace[(_0x445074(0xe95))](_0x239c11['maximumSizeX']||0x1,_0x239c11['maximumSizeY']||0x1,_0x239c11['maximumSizeZ']||0x1);break;default:this['_toOneCesiumVal_Point'](_0x3703b5,_0x1c021c,_0x239c11,_0xa0fa7c);break;}}static['toJSON'](_0xc9ce55,_0x4c98cc){const _0x38bf64={_0x31e40a:0x1ca},_0xc4ca70=_0x3d5d32;return!this['cloudStyleConver']&&(this[_0xc4ca70(_0x38bf64._0x31e40a)]=new CloudStyleConver()),this['cloudStyleConver']['toJSON'](_0xc9ce55,_0x4c98cc);}['_toOneJson'](_0x95bbc5,_0x1433b0,_0x560aea){const _0x2dce12={_0x4a2f2a:0xd8e,_0x511e6b:0x992},_0x586fb8=_0x3d5d32;switch(_0x95bbc5){case'scale':_0x560aea['scaleX']=formatNum$1(_0x1433b0['x'],0x2),_0x560aea[_0x586fb8(_0x2dce12._0x4a2f2a)]=formatNum$1(_0x1433b0['y'],0x2);break;case'maximumSize':_0x560aea[_0x586fb8(_0x2dce12._0x511e6b)]=formatNum$1(_0x1433b0['x'],0x2),_0x560aea['maximumSizeY']=formatNum$1(_0x1433b0['y'],0x2),_0x560aea['maximumSizeZ']=formatNum$1(_0x1433b0['z'],0x2);break;default:this['_toOneJson_Point'](_0x95bbc5,_0x1433b0,_0x560aea);break;}}}class BoxStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x49d688,_0x54d4db,_0x4f0171){const _0x5d8fcf={_0x5d4bce:0x79a},_0x23c800=_0x3d5d32;return!this['boxStyleConver']&&(this['boxStyleConver']=new BoxStyleConver()),this['boxStyleConver'][_0x23c800(0x2b2)]=_0x4f0171,this[_0x23c800(_0x5d8fcf._0x5d4bce)]['toCesiumVal'](_0x49d688,_0x54d4db);}['_getExcludedStyle'](){return['opacity','dimensions_y','dimensions_z'];}['_toOneCesiumVal'](_0x1e34b9,_0x2e884d,_0x582d44,_0x54156a){const _0x4963c9={_0x430117:0x22b,_0x1da956:0x5cc},_0x220f87=_0x3d5d32;switch(_0x1e34b9){case'outlineColor':{_0x54156a['outlineColor']=this[_0x220f87(_0x4963c9._0x430117)](_0x582d44);break;}case _0x220f87(_0x4963c9._0x1da956):{const _0x13840b=_0x582d44['dimensions_x']??0x64,_0x5f4176=_0x582d44['dimensions_y']??0x64,_0x2ebac9=_0x582d44['dimensions_z']??0x64;_0x54156a['dimensions']=new Cesium__namespace['Cartesian3'](_0x13840b,_0x5f4176,_0x2ebac9);break;}default:this['_toOneCesiumVal_Poly'](_0x1e34b9,_0x2e884d,_0x582d44,_0x54156a);break;}}static['toJSON'](_0x41c29d,_0x20562a,_0x6ca1b2){const _0x359e61={_0x5a2a91:0x79a,_0x28fe49:0x79a},_0x15f3e8=_0x3d5d32;return!this['boxStyleConver']&&(this['boxStyleConver']=new BoxStyleConver()),this[_0x15f3e8(_0x359e61._0x5a2a91)]['isEntity']=_0x6ca1b2,this[_0x15f3e8(_0x359e61._0x28fe49)]['toJSON'](_0x41c29d,_0x20562a);}['_toOneJson'](_0xf6d69c,_0x578ec5,_0x198f8d){const _0x160afd={_0x46b356:0x5cc,_0x2fbedb:0xb1f},_0x59b59c=_0x3d5d32;switch(_0xf6d69c){case'dimensions':{_0x198f8d[_0x59b59c(_0x160afd._0x46b356)]=_0x578ec5['x'],_0x198f8d[_0x59b59c(_0x160afd._0x2fbedb)]=_0x578ec5['y'],_0x198f8d['dimensions_z']=_0x578ec5['z'];break;}default:this['_toOneJson_Poly'](_0xf6d69c,_0x578ec5,_0x198f8d);break;}}}class CircleStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x19538f,_0x2b28f5,_0x402c6d){const _0x5a8f42={_0xb02170:0x83d},_0xc1f7b0=_0x3d5d32;return!this['circleStyleConver']&&(this['circleStyleConver']=new CircleStyleConver()),this['circleStyleConver']['isEntity']=_0x402c6d,this['circleStyleConver'][_0xc1f7b0(_0x5a8f42._0xb02170)](_0x19538f,_0x2b28f5);}['_toCesiumValBefore'](_0x10d81d,_0x40eb38){const _0x2557d5={_0x1870b8:0x9ff,_0x5b65dc:0x2d1,_0xa3c34e:0x83e,_0x2872fb:0x7c0},_0x355cb9=_0x3d5d32;super[_0x355cb9(_0x2557d5._0x1870b8)](_0x10d81d,_0x40eb38),_0x10d81d['clampToGround']&&(_0x10d81d['hasOwnProperty']('height')&&delete _0x10d81d[_0x355cb9(0x83e)],_0x10d81d[_0x355cb9(_0x2557d5._0x5b65dc)]('extrudedHeight')&&delete _0x10d81d['extrudedHeight'],_0x10d81d['hasOwnProperty']('diffHeight')&&delete _0x10d81d['diffHeight']),Cesium__namespace['defined'](_0x10d81d[_0x355cb9(_0x2557d5._0xa3c34e)])&&(_0x10d81d[_0x355cb9(_0x2557d5._0x2872fb)]=![]);}['_toOneCesiumVal'](_0x44b9d7,_0x517bc6,_0xa846b2,_0x15d55c){const _0x12da21={_0x38d453:0x20d,_0x5cb89d:0x9f1,_0x2b471f:0x31f,_0x2b0bb9:0x83e,_0x3087ca:0xd61,_0x4bf6fb:0x27d},_0xdbe20f=_0x3d5d32;switch(_0x44b9d7){case'rotation':_0x15d55c['rotation']=_0x517bc6;!_0xa846b2[_0xdbe20f(_0x12da21._0x38d453)]&&(_0x15d55c['stRotation']=_0x15d55c['rotation']);break;case _0xdbe20f(_0x12da21._0x5cb89d):_0x15d55c[_0xdbe20f(_0x12da21._0x2b471f)]=Cesium__namespace['Math']['toRadians'](_0x517bc6);!_0xa846b2['stRotation']&&(_0x15d55c[_0xdbe20f(0x20d)]=_0x15d55c[_0xdbe20f(_0x12da21._0x2b471f)]);break;case'stRotationDegree':_0x15d55c['stRotation']=Cesium__namespace['Math'][_0xdbe20f(0x562)](_0x517bc6);break;case'height':_0x15d55c['height']=_0x517bc6;_0xa846b2['diffHeight']&&(_0x15d55c['extrudedHeight']=Number(_0xa846b2[_0xdbe20f(0x9e2)])+Number(_0x517bc6));break;case'diffHeight':Cesium__namespace['defined'](_0xa846b2[_0xdbe20f(_0x12da21._0x2b0bb9)])&&(_0x15d55c[_0xdbe20f(0x831)]=_0xa846b2['height']+_0x517bc6);break;case _0xdbe20f(_0x12da21._0x3087ca):this['isEntity']?(_0x15d55c[_0xdbe20f(0x741)]=Number(_0x517bc6),_0x15d55c['semiMajorAxis']=Number(_0x517bc6)):_0x15d55c['radius']=Number(_0x517bc6);break;case _0xdbe20f(0x7c0):_0x517bc6?_0x15d55c[_0xdbe20f(_0x12da21._0x4bf6fb)]=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:_0x15d55c['heightReference']=Cesium__namespace[_0xdbe20f(0x2d5)]['NONE'];break;default:this['_toOneCesiumVal_Poly'](_0x44b9d7,_0x517bc6,_0xa846b2,_0x15d55c);break;}}static['toJSON'](_0x560b40,_0x1e81f3,_0x556972){const _0x2af9ed={_0x387968:0x6e0,_0x345c60:0x6e0},_0x2d964b=_0x3d5d32;return!this['circleStyleConver']&&(this['circleStyleConver']=new CircleStyleConver()),this[_0x2d964b(_0x2af9ed._0x387968)]['isEntity']=_0x556972,this[_0x2d964b(_0x2af9ed._0x345c60)]['toJSON'](_0x560b40,_0x1e81f3);}['_toOneJson'](_0x11f489,_0x19cbdb,_0x44d927){const _0xc5bae8={_0x1b8d7f:0x103e},_0x49c4bf=_0x3d5d32;switch(_0x11f489){case _0x49c4bf(0x31f):{_0x44d927['rotationDegree']=formatNum$1(Cesium__namespace[_0x49c4bf(_0xc5bae8._0x1b8d7f)]['toDegrees'](_0x19cbdb),0x1);break;}case'stRotation':{_0x44d927[_0x49c4bf(0xc9e)]=formatNum$1(Cesium__namespace['Math']['toDegrees'](_0x19cbdb),0x1);break;}default:this['_toOneJson_Poly'](_0x11f489,_0x19cbdb,_0x44d927);break;}}}class CorridorStyleConver extends BaseStyleConver{static['toCesiumVal'](_0xa27363,_0x725770,_0x459e57){const _0x19c8ce={_0x38d0c0:0xdc7},_0x50c7d8=_0x3d5d32;return!this['corridorStyleConver']&&(this[_0x50c7d8(_0x19c8ce._0x38d0c0)]=new CorridorStyleConver()),this[_0x50c7d8(_0x19c8ce._0x38d0c0)]['isEntity']=_0x459e57,this['corridorStyleConver']['toCesiumVal'](_0xa27363,_0x725770);}['_toCesiumValBefore'](_0x59d4dc,_0x2498f0){const _0x25d9f1={_0x1f707d:0x83e,_0x5abe23:0x9e2},_0x3d2108=_0x3d5d32;super['_toCesiumValBefore'](_0x59d4dc,_0x2498f0),_0x59d4dc['clampToGround']&&(_0x59d4dc['hasOwnProperty']('height')&&delete _0x59d4dc[_0x3d2108(_0x25d9f1._0x1f707d)],_0x59d4dc['hasOwnProperty']('extrudedHeight')&&delete _0x59d4dc['extrudedHeight'],_0x59d4dc['hasOwnProperty'](_0x3d2108(_0x25d9f1._0x5abe23))&&delete _0x59d4dc['diffHeight']);}['_toOneCesiumVal'](_0x3f2fb3,_0x5e3cb8,_0x9bab27,_0x33f442){const _0x13ca06={_0x13c6ee:0x62a,_0x21d9aa:0x83e},_0x181554=_0x3d5d32;switch(_0x3f2fb3){case _0x181554(_0x13ca06._0x13c6ee):{_0x33f442['outlineColor']=this['getOutlineColorByStyle'](_0x9bab27);break;}case'height':_0x33f442[_0x181554(0x83e)]=_0x5e3cb8;_0x9bab27['diffHeight']&&(_0x33f442['extrudedHeight']=Number(_0x9bab27['diffHeight'])+Number(_0x5e3cb8));break;case'diffHeight':Cesium__namespace['defined'](_0x9bab27[_0x181554(_0x13ca06._0x21d9aa)])&&(_0x33f442['extrudedHeight']=_0x9bab27['height']+_0x5e3cb8);break;default:this['_toOneCesiumVal_Poly'](_0x3f2fb3,_0x5e3cb8,_0x9bab27,_0x33f442);break;}}static[_0x3d5d32(0x3db)](_0x12a31c,_0x4310b3,_0x27cba9){const _0x679e5c={_0x45fa3c:0x2b2,_0x153d7b:0xdc7},_0x5b293b=_0x3d5d32;return!this[_0x5b293b(0xdc7)]&&(this[_0x5b293b(0xdc7)]=new CorridorStyleConver()),this['corridorStyleConver'][_0x5b293b(_0x679e5c._0x45fa3c)]=_0x27cba9,this[_0x5b293b(_0x679e5c._0x153d7b)]['toJSON'](_0x12a31c,_0x4310b3);}[_0x3d5d32(0x1056)](_0x3e9363,_0x3e9eb1,_0x669e93){this['_toOneJson_Poly'](_0x3e9363,_0x3e9eb1,_0x669e93);}}class CylinderStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x35ebe0,_0x4a9fb7,_0x3fccbd){return!this['cylinderStyleConver']&&(this['cylinderStyleConver']=new CylinderStyleConver()),this['cylinderStyleConver']['isEntity']=_0x3fccbd,this['cylinderStyleConver']['toCesiumVal'](_0x35ebe0,_0x4a9fb7);}[_0x3d5d32(0x9ff)](_0x5c72c0,_0x50fe2b){const _0xe22363={_0x2a6088:0x398},_0x5298e8=_0x3d5d32;super['_toCesiumValBefore'](_0x5c72c0,_0x50fe2b),!_0x5c72c0[_0x5298e8(_0xe22363._0x2a6088)]&&(_0x5c72c0['topRadius']=0x0);}['_toOneCesiumVal'](_0x1d9106,_0x250a9a,_0x267e87,_0x279ea8){const _0x540e73=_0x3d5d32;switch(_0x1d9106){case _0x540e73(0x9e2):if(_0x279ea8['length']instanceof Cesium__namespace['CallbackProperty']);else _0x279ea8[_0x540e73(0xc84)]=Number(_0x250a9a);break;default:this['_toOneCesiumVal_Poly'](_0x1d9106,_0x250a9a,_0x267e87,_0x279ea8);break;}}static['toJSON'](_0x4b4f40,_0x228065,_0x757674){return!this['cylinderStyleConver']&&(this['cylinderStyleConver']=new CylinderStyleConver()),this['cylinderStyleConver']['isEntity']=_0x757674,this['cylinderStyleConver']['toJSON'](_0x4b4f40,_0x228065);}['_toOneJson'](_0x3d6ba8,_0x5f1def,_0x45b32d){this['_toOneJson_Poly'](_0x3d6ba8,_0x5f1def,_0x45b32d);}}class DivGraphicStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x51a9ac,_0x24404a){return!this['divGraphicStyleConver']&&(this['divGraphicStyleConver']=new DivGraphicStyleConver()),this['divGraphicStyleConver']['toCesiumVal'](_0x51a9ac,_0x24404a);}['_toCesiumValBefore'](_0x36256d,_0x12b7d7){}['_toOneCesiumVal'](_0xc2295,_0x48ab9e,_0x329ef6,_0x59a218){this['_toOneCesiumVal_Point'](_0xc2295,_0x48ab9e,_0x329ef6,_0x59a218);}static[_0x3d5d32(0x3db)](_0x313476,_0x4fa36a){const _0x493870={_0x1f02a8:0x346},_0x297bc3=_0x3d5d32;return!this[_0x297bc3(_0x493870._0x1f02a8)]&&(this['divGraphicStyleConver']=new DivGraphicStyleConver()),this['divGraphicStyleConver']['toJSON'](_0x313476,_0x4fa36a);}['_toOneJson'](_0x5b6894,_0x578f7e,_0x4506fb){this['_toOneJson_Point'](_0x5b6894,_0x578f7e,_0x4506fb);}}class EllipsoidStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x7a4ef5,_0x21cf29,_0x4ddc49){const _0x36efb2=_0x3d5d32;return!this['ellipsoidStyleConver']&&(this[_0x36efb2(0xf03)]=new EllipsoidStyleConver()),this['ellipsoidStyleConver']['isEntity']=_0x4ddc49,this[_0x36efb2(0xf03)]['toCesiumVal'](_0x7a4ef5,_0x21cf29);}['_toCesiumValBefore'](_0x4d30c2,_0x3ab17d){const _0x3c6426={_0x206baf:0x9ff},_0x16d0fd=_0x3d5d32;super[_0x16d0fd(_0x3c6426._0x206baf)](_0x4d30c2,_0x3ab17d);}['_getExcludedStyle'](){const _0x1ffdb8={_0x38fe85:0x652},_0x324b9d=_0x3d5d32;return['radii_y','radii_z',_0x324b9d(_0x1ffdb8._0x38fe85),'innerRadii_z'];}[_0x3d5d32(0x259)](_0x32c4ce,_0x401813,_0x17731b,_0x34a6d){const _0x3ed51e={_0x1287ae:0x29f,_0xdb30e2:0xd54,_0x1e455c:0x94f,_0x38de1b:0x299},_0x3c8df7=_0x3d5d32;switch(_0x32c4ce){case _0x3c8df7(0x29f):_0x34a6d[_0x3c8df7(_0x3ed51e._0x1287ae)]=new Cesium__namespace['Cartesian3'](_0x401813,_0x401813,_0x401813);break;case _0x3c8df7(_0x3ed51e._0xdb30e2):_0x34a6d['radii']=new Cesium__namespace['Cartesian3'](_0x17731b['radii_x']??0x64,_0x17731b[_0x3c8df7(0xe93)]??0x64,_0x17731b[_0x3c8df7(0xd19)]??0x64);break;case _0x3c8df7(0x94f):_0x34a6d[_0x3c8df7(_0x3ed51e._0x1e455c)]=new Cesium__namespace['Cartesian3'](_0x401813,_0x401813,_0x401813);break;case _0x3c8df7(_0x3ed51e._0x38de1b):_0x17731b['innerRadii_x']>0x0&&_0x17731b['innerRadii_y']>0x0&&_0x17731b['innerRadii_z']>0x0?_0x34a6d[_0x3c8df7(0x94f)]=new Cesium__namespace['Cartesian3'](_0x17731b['innerRadii_x']??0x0,_0x17731b['innerRadii_y']??0x0,_0x17731b['innerRadii_z']??0x0):_0x34a6d['innerRadii']=new Cesium__namespace['Cartesian3'](0.001,0.001,0.001);break;case'minimumClockDegree':case'maximumClockDegree':case'minimumConeDegree':case'maximumConeDegree':_0x34a6d[_0x32c4ce['replace']('Degree','')]=Cesium__namespace[_0x3c8df7(0x103e)]['toRadians'](_0x401813||0x0);break;default:this['_toOneCesiumVal_Poly'](_0x32c4ce,_0x401813,_0x17731b,_0x34a6d);break;}}static['toJSON'](_0x546bf0,_0xee3e40,_0x525e01){const _0x4a8e90=_0x3d5d32;return!this[_0x4a8e90(0xf03)]&&(this['ellipsoidStyleConver']=new EllipsoidStyleConver()),this['ellipsoidStyleConver']['isEntity']=_0x525e01,this['ellipsoidStyleConver']['toJSON'](_0x546bf0,_0xee3e40);}['_toOneJson'](_0xbf30c,_0x19fddb,_0x4b8b23){const _0x5d1fb1={_0x50034d:0x103e},_0x4d2fba=_0x3d5d32;switch(_0xbf30c){case _0x4d2fba(0x29f):{_0x4b8b23['radii_x']=_0x19fddb['x'],_0x4b8b23['radii_y']=_0x19fddb['y'],_0x4b8b23['radii_z']=_0x19fddb['z'];break;}case'innerRadii':{_0x4b8b23['innerRadii_x']=_0x19fddb['x'],_0x4b8b23[_0x4d2fba(0x652)]=_0x19fddb['y'],_0x4b8b23['innerRadii_z']=_0x19fddb['z'];break;}case'minimumClock':case'maximumClock':case'minimumCone':case'maximumCone':_0x4b8b23[_0xbf30c+_0x4d2fba(0x3f6)]=formatNum$1(Cesium__namespace[_0x4d2fba(_0x5d1fb1._0x50034d)]['toDegrees'](_0x19fddb),0x2);break;default:this['_toOneJson_Poly'](_0xbf30c,_0x19fddb,_0x4b8b23);break;}}}class LabelStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x548d0e,_0x53e482,_0x174818){const _0x5189d3=_0x3d5d32;return!this['labelStyleConver']&&(this['labelStyleConver']=new LabelStyleConver()),this['labelStyleConver'][_0x5189d3(0xe12)]=_0x174818,_0x53e482=this[_0x5189d3(0x4fd)]['toCesiumVal'](_0x548d0e,_0x53e482),_0x53e482;}['_toCesiumValBefore'](_0x40ea7b,_0x2d9e12){const _0x312ec0={_0xd5675b:0xac5},_0x14129a=_0x3d5d32;_0x2d9e12['horizontalOrigin']=_0x2d9e12['horizontalOrigin']??Cesium__namespace['HorizontalOrigin']['CENTER'],_0x2d9e12['verticalOrigin']=_0x2d9e12['verticalOrigin']??Cesium__namespace['HorizontalOrigin'][_0x14129a(_0x312ec0._0xd5675b)];}['_toCesiumValEnd'](_0x16ba10,_0x152cdf){const _0x52534e=_0x3d5d32;!Cesium__namespace[_0x52534e(0xb84)](_0x16ba10['font'])&&(_0x152cdf['font']=(_0x16ba10['font_style']||'')+'\x20'+(_0x16ba10['font_weight']||'')+'\x20'+(_0x16ba10['font_size']||0x12)+'px\x20\x20'+(_0x16ba10[_0x52534e(0xf81)]||'微软雅黑')),!Cesium__namespace['defined'](_0x16ba10['style'])&&(_0x16ba10['fill']??!![])&&(_0x16ba10[_0x52534e(0xe7a)]?_0x152cdf['style']=Cesium__namespace[_0x52534e(0x203)]['FILL_AND_OUTLINE']:_0x152cdf[_0x52534e(0xdde)]=Cesium__namespace['LabelStyle'][_0x52534e(0xabd)]);}['_getExcludedStyle'](){const _0x23ccf2={_0x445478:0x1ed},_0x3ab546=_0x3d5d32;return[_0x3ab546(0xf20),'font_weight',_0x3ab546(_0x23ccf2._0x445478),'font_family','backgroundOpacity','fill'];}['_toOneCesiumVal'](_0x265673,_0x4922a2,_0x5cc2d4,_0x257245){const _0x3d2ea3={_0x10415f:0x62a,_0x242a34:0xb56,_0x5ba222:0x695,_0xf0db21:0xb0e,_0x219de7:0x85e},_0x3c96eb=_0x3d5d32;switch(_0x265673){case _0x3c96eb(0x76b):{this[_0x3c96eb(0xe12)]&&(_0x4922a2=template(_0x4922a2,this['attr'],_0x5cc2d4[_0x3c96eb(0x411)]??!![]));_0x257245['text']=String(_0x4922a2||'')['replace'](/
/gm,'\x0a');break;}case'color':{_0x257245['fillColor']=this['getColorByStyle'](_0x5cc2d4);break;}case _0x3c96eb(_0x3d2ea3._0x10415f):{_0x257245['outlineColor']=this['getOutlineColorByStyle'](_0x5cc2d4);break;}case'strokeColor':case'fillColor':{_0x257245[_0x265673]=getCesiumColor(_0x4922a2);break;}case'background':_0x257245[_0x3c96eb(_0x3d2ea3._0x242a34)]=_0x4922a2,_0x257245['showBackground']=_0x4922a2;break;case'backgroundColor':{let _0x4ab28c=getCesiumColor(_0x4922a2,Cesium__namespace['Color']['BLACK']);if(Cesium__namespace['defined'](_0x5cc2d4['backgroundOpacity']))_0x4ab28c=_0x4ab28c['withAlpha'](Number(_0x5cc2d4['backgroundOpacity']));else Cesium__namespace['defined'](_0x5cc2d4[_0x3c96eb(0xfdc)])&&(_0x4ab28c=_0x4ab28c['withAlpha'](Number(_0x5cc2d4[_0x3c96eb(0xfdc)])));_0x257245['backgroundColor']=_0x4ab28c;break;}case _0x3c96eb(_0x3d2ea3._0x5ba222):_0x257245['backgroundPadding']=new Cesium__namespace[(_0x3c96eb(0xb0e))](_0x4922a2*1.2,_0x4922a2),_0x257245['padding']=_0x4922a2;break;case'hasPixelOffset':!_0x4922a2&&(_0x257245['pixelOffset']=new Cesium__namespace['Cartesian2'](0x0,0x0));break;case'pixelOffsetX':case'pixelOffsetY':_0x257245[_0x3c96eb(0x85e)]=new Cesium__namespace[(_0x3c96eb(0xb0e))](_0x5cc2d4['pixelOffsetX']||0x0,_0x5cc2d4['pixelOffsetY']||0x0);break;case'pixelOffset':Cesium__namespace['defined'](_0x4922a2[0x0])&&Cesium__namespace['defined'](_0x4922a2[0x1])?_0x257245[_0x3c96eb(0x85e)]=new Cesium__namespace[(_0x3c96eb(_0x3d2ea3._0xf0db21))](_0x4922a2[0x0],_0x4922a2[0x1]):_0x257245[_0x3c96eb(_0x3d2ea3._0x219de7)]=_0x4922a2;break;default:this['_toOneCesiumVal_Point'](_0x265673,_0x4922a2,_0x5cc2d4,_0x257245);break;}}static['toJSON'](_0x4f0552,_0x4a8cd1){const _0x22c7ad={_0x527ba6:0x4fd},_0x42c0ca=_0x3d5d32;return!this[_0x42c0ca(0x4fd)]&&(this['labelStyleConver']=new LabelStyleConver()),this[_0x42c0ca(_0x22c7ad._0x527ba6)]['toJSON'](_0x4f0552,_0x4a8cd1);}[_0x3d5d32(0x1056)](_0x3de637,_0x45177c,_0x130664){const _0xd60490={_0x24a577:0xd5e,_0x164e76:0xf53,_0x4b2fa2:0xc39},_0x41f9b1=_0x3d5d32;switch(_0x3de637){case'pixelOffset':{_0x130664['pixelOffsetX']=_0x45177c['x'],_0x130664[_0x41f9b1(_0xd60490._0x24a577)]=_0x45177c['y'];break;}case _0x41f9b1(_0xd60490._0x164e76):{_0x45177c===Number[_0x41f9b1(_0xd60490._0x4b2fa2)]?_0x130664['visibleDepth']=![]:_0x130664['disableDepthTestDistance']=_0x45177c;break;}default:this['_toOneJson_Point'](_0x3de637,_0x45177c,_0x130664);break;}}static[_0x3d5d32(0xb2d)](_0x5503b7,_0x1e60a6){const _0x4907d0={_0x59fdab:0xfe7,_0x3c56ea:0x24b,_0x19117c:0x4d6},_0x45de37=_0x3d5d32,_0x1e707c=getCesiumValue(_0x5503b7['fillColor'],Cesium__namespace['Color']);_0x1e707c?(!Cesium__namespace['defined'](_0x5503b7[_0x45de37(0xfe7)])&&(_0x5503b7['_fillColor_alpha_bak']=_0x1e707c[_0x45de37(0x24b)]??0x1),_0x5503b7['fillColor']=_0x1e707c['withAlpha'](_0x1e60a6*_0x5503b7[_0x45de37(_0x4907d0._0x59fdab)])):_0x5503b7['fillColor']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x1e60a6);const _0x54f0c6=getCesiumValue(_0x5503b7[_0x45de37(0x62a)],Cesium__namespace['Color']);_0x54f0c6&&(!Cesium__namespace[_0x45de37(0xb84)](_0x5503b7['_outlineColor_alpha_bak'])&&(_0x5503b7['_outlineColor_alpha_bak']=_0x54f0c6[_0x45de37(_0x4907d0._0x3c56ea)]??0x1),_0x5503b7[_0x45de37(0x62a)]=_0x54f0c6[_0x45de37(0xe57)](_0x1e60a6*_0x5503b7['_outlineColor_alpha_bak']));const _0x58466e=getCesiumValue(_0x5503b7['backgroundColor'],Cesium__namespace['Color']);_0x58466e&&(!Cesium__namespace[_0x45de37(0xb84)](_0x5503b7['_backgroundColor_alpha_bak'])&&(_0x5503b7['_backgroundColor_alpha_bak']=_0x58466e[_0x45de37(_0x4907d0._0x3c56ea)]??0x1),_0x5503b7['backgroundColor']=_0x58466e['withAlpha'](_0x1e60a6*_0x5503b7[_0x45de37(_0x4907d0._0x19117c)]));}}class ModelStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0xfdd0ff,_0x3b5413,_0x421e92){const _0x2da936={_0x14991c:0x6dd},_0x12102c=_0x3d5d32;return!this['modelStyleConver']&&(this[_0x12102c(_0x2da936._0x14991c)]=new ModelStyleConver()),this['modelStyleConver']['isEntity']=_0x421e92,this['modelStyleConver']['toCesiumVal'](_0xfdd0ff,_0x3b5413);}[_0x3d5d32(0x9ff)](_0x15df8d,_0x1d0f0c){}[_0x3d5d32(0x4f3)](){return['silhouette','silhouetteColor','silhouetteAlpha','silhouetteSize','fill','opacity'];}['_toOneCesiumVal'](_0x4baa8c,_0x23d694,_0x2c63d5,_0x52fb90){const _0x350dec={_0x105acd:0x5ee},_0x1f09b7=_0x3d5d32;switch(_0x4baa8c){case _0x1f09b7(_0x350dec._0x105acd):case'modelUrl':case'uri':_0x23d694=replaceOnlineUrlDomain({'url':_0x23d694})['url'];this['isEntity']?_0x52fb90[_0x1f09b7(0x281)]=_0x23d694:_0x52fb90['url']=_0x23d694;break;case'scale':!isNaN(_0x23d694)&&(_0x52fb90[_0x4baa8c]=_0x23d694);break;default:this[_0x1f09b7(0x790)](_0x4baa8c,_0x23d694,_0x2c63d5,_0x52fb90);break;}}['_toCesiumValEnd'](_0x378b66,_0x54b802){const _0x120a24={_0x2c9b4d:0x882,_0x190ab6:0x882,_0x35abde:0x7a7,_0x21c2f2:0xb84},_0x159e09=_0x3d5d32;_0x54b802['show']=Boolean(_0x54b802['uri']||_0x54b802['url']);if(_0x378b66[_0x159e09(0x265)])_0x54b802['color']=getColorByStyle(_0x378b66,Cesium__namespace[_0x159e09(_0x120a24._0x2c9b4d)]['WHITE']);else Cesium__namespace[_0x159e09(0xb84)](_0x378b66[_0x159e09(0xfdc)])&&_0x378b66['opacity']!==0x1?_0x54b802['color']=Cesium__namespace[_0x159e09(_0x120a24._0x190ab6)]['WHITE'][_0x159e09(0xe57)](_0x378b66[_0x159e09(0xfdc)]):_0x54b802['color']=Cesium__namespace[_0x159e09(0x882)][_0x159e09(_0x120a24._0x35abde)];if(_0x378b66['silhouette']){let _0x3722b5=getCesiumColor(_0x378b66[_0x159e09(0xd03)],Cesium__namespace['Color']['WHITE']);Cesium__namespace[_0x159e09(_0x120a24._0x21c2f2)](_0x378b66['silhouetteAlpha'])&&(_0x3722b5=_0x3722b5[_0x159e09(0xe57)](Number(_0x378b66['silhouetteAlpha']))),Cesium__namespace['defined'](_0x378b66['globalAlpha'])&&_0x378b66['globalAlpha']!==0x1&&(_0x3722b5=_0x3722b5['withAlpha'](_0x3722b5['alpha']*_0x378b66['globalAlpha'])),_0x54b802[_0x159e09(0xd03)]=_0x3722b5,_0x54b802[_0x159e09(0x686)]=Number(_0x378b66['silhouetteSize']||0x1);}else _0x54b802[_0x159e09(0xd03)]=undefined,_0x54b802['silhouetteSize']=0x0;}static['toJSON'](_0x1b9cfa,_0x389157,_0x2d56f5){const _0x5b3e24=_0x3d5d32;return!this['modelStyleConver']&&(this[_0x5b3e24(0x6dd)]=new ModelStyleConver()),this[_0x5b3e24(0x6dd)]['isEntity']=_0x2d56f5,this['modelStyleConver']['toJSON'](_0x1b9cfa,_0x389157);}[_0x3d5d32(0x1056)](_0x193cd0,_0x23278c,_0x154963){const _0x24709a=_0x3d5d32;switch(_0x193cd0){case'uri':{_0x154963['url']=_0x23278c;break;}default:this[_0x24709a(0xa51)](_0x193cd0,_0x23278c,_0x154963);break;}}static['setOpacity'](_0x17352e,_0x44c37d){const _0x32bb59={_0x4a6892:0x24b,_0x4fef5f:0x7a7},_0x123216=_0x3d5d32,_0x1847d2=getCesiumValue(_0x17352e['color'],Cesium__namespace['Color']);!Cesium__namespace['defined'](_0x17352e['_color_alpha_bak'])&&(_0x17352e[_0x123216(0x266)]=(_0x1847d2===null||_0x1847d2===void 0x0?void 0x0:_0x1847d2[_0x123216(_0x32bb59._0x4a6892)])??0x1);_0x1847d2?_0x17352e['color']=_0x1847d2['withAlpha'](_0x44c37d*_0x17352e['_color_alpha_bak']):_0x17352e['color']=Cesium__namespace['Color'][_0x123216(_0x32bb59._0x4fef5f)]['withAlpha'](_0x44c37d);const _0x450ca3=getCesiumValue(_0x17352e['silhouetteColor'],Cesium__namespace['Color']);_0x450ca3&&(!Cesium__namespace['defined'](_0x17352e['_silhouetteColor_alpha_bak'])&&(_0x17352e['_silhouetteColor_alpha_bak']=_0x450ca3['alpha']??0x1),_0x17352e['silhouetteColor']=_0x450ca3['withAlpha'](_0x44c37d*_0x17352e['_silhouetteColor_alpha_bak']));}}class PathStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x1b5f12,_0x2d86d2,_0x53583b){const _0x9989c={_0xf3fce8:0xca2,_0x1215fc:0x83d},_0x579742=_0x3d5d32;return!this['pathStyleConver']&&(this[_0x579742(_0x9989c._0xf3fce8)]=new PathStyleConver()),this['pathStyleConver']['isEntity']=_0x53583b,this['pathStyleConver'][_0x579742(_0x9989c._0x1215fc)](_0x1b5f12,_0x2d86d2);}['_toOneCesiumVal'](_0x20f22c,_0x324b03,_0x2344e3,_0x487080){const _0x2e896c=_0x3d5d32;this[_0x2e896c(0x4ed)](_0x20f22c,_0x324b03,_0x2344e3,_0x487080);}static['toJSON'](_0x5808e4,_0x2553f9,_0x301782){const _0x3c3e4f=_0x3d5d32;return!this['pathStyleConver']&&(this[_0x3c3e4f(0xca2)]=new PathStyleConver()),this[_0x3c3e4f(0xca2)]['isEntity']=_0x301782,this['pathStyleConver']['toJSON'](_0x5808e4,_0x2553f9);}['_toOneJson'](_0x1f4713,_0x2a45e1,_0x3efe0){this['_toOneJson_Poly'](_0x1f4713,_0x2a45e1,_0x3efe0);}}class PlaneStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x5fbada,_0x83fed4,_0x191d1c){const _0x3edef9={_0x325021:0xc9c},_0x57d7cb=_0x3d5d32;return!this['planeStyleConver']&&(this['planeStyleConver']=new PlaneStyleConver()),this[_0x57d7cb(_0x3edef9._0x325021)][_0x57d7cb(0x2b2)]=_0x191d1c,this[_0x57d7cb(_0x3edef9._0x325021)][_0x57d7cb(0x83d)](_0x5fbada,_0x83fed4);}[_0x3d5d32(0x9ff)](_0x146a87,_0x32d4d2){super['_toCesiumValBefore'](_0x146a87,_0x32d4d2);}[_0x3d5d32(0x259)](_0x375797,_0xfda71d,_0x2d218b,_0x59ac14){const _0x1d52e6={_0x53e8cc:0xb1f,_0x2012fe:0xe95,_0x1dd559:0x6c8},_0x5bc7bf=_0x3d5d32;switch(_0x375797){case'dimensions_x':{const _0x2c91e2=_0x2d218b['dimensions_x']??0x64,_0x56b2cb=_0x2d218b[_0x5bc7bf(_0x1d52e6._0x53e8cc)]??0x64;_0x59ac14['dimensions']=new Cesium__namespace['Cartesian2'](_0x2c91e2,_0x56b2cb);break;}case _0x5bc7bf(0x61d):{let _0x8d7994;switch(_0xfda71d){case'x':_0x8d7994=Cesium__namespace['Cartesian3']['UNIT_X'];break;case'y':_0x8d7994=Cesium__namespace['Cartesian3'][_0x5bc7bf(0xa33)];break;case'z':_0x8d7994=Cesium__namespace[_0x5bc7bf(_0x1d52e6._0x2012fe)]['UNIT_Z'];break;default:_0x8d7994=_0xfda71d;break;}const _0x1d980b=_0x2d218b['plane_distance']??0x0;_0x59ac14[_0x5bc7bf(_0x1d52e6._0x1dd559)]=new Cesium__namespace['Plane'](_0x8d7994,_0x1d980b);break;}default:this['_toOneCesiumVal_Poly'](_0x375797,_0xfda71d,_0x2d218b,_0x59ac14);break;}}static[_0x3d5d32(0x3db)](_0x5a2ce9,_0x127402,_0x4715ad){const _0x12d211={_0x351aff:0xc9c},_0xa4486a=_0x3d5d32;return!this['planeStyleConver']&&(this[_0xa4486a(0xc9c)]=new PlaneStyleConver()),this['planeStyleConver']['isEntity']=_0x4715ad,this[_0xa4486a(_0x12d211._0x351aff)]['toJSON'](_0x5a2ce9,_0x127402);}static['toOneJson'](_0x21e2f2,_0x47e51f,_0x327629){const _0x14099d=_0x3d5d32;return!this['planeStyleConver']&&(this[_0x14099d(0xc9c)]=new PlaneStyleConver()),this['planeStyleConver']['_toOneJson'](_0x21e2f2,_0x47e51f,_0x327629);}['_toOneJson'](_0x1a9357,_0xa146a7,_0x341c77){const _0x456988={_0xa477fa:0x71f,_0x236fef:0x6c8,_0x38e48e:0x61d,_0x54bff6:0x71f,_0x3c4baf:0x7db,_0x5bda1e:0x61d,_0x10a871:0x61d},_0x3f3a33=_0x3d5d32;switch(_0x1a9357){case'dimensions':{_0x341c77['dimensions_x']=_0xa146a7['x'],_0x341c77[_0x3f3a33(0xb1f)]=_0xa146a7['y'];break;}case _0x3f3a33(0x61d):{if(_0xa146a7[_0x3f3a33(0x71f)](Cesium__namespace['Cartesian3']['UNIT_X']))_0x341c77['plane_normal']='x';else{if(_0xa146a7[_0x3f3a33(_0x456988._0xa477fa)](Cesium__namespace['Cartesian3']['UNIT_Y']))_0x341c77['plane_normal']='y';else _0xa146a7['equals'](Cesium__namespace['Cartesian3']['UNIT_Z'])?_0x341c77['plane_normal']='z':(logWarn('plane类型未识别',_0xa146a7),_0x341c77[_0x3f3a33(0x61d)]='z');}break;}case _0x3f3a33(_0x456988._0x236fef):{if(_0xa146a7['normal']['equals'](Cesium__namespace['Cartesian3'][_0x3f3a33(0x25e)]))_0x341c77[_0x3f3a33(_0x456988._0x38e48e)]='x';else{if(_0xa146a7['normal']['equals'](Cesium__namespace['Cartesian3']['UNIT_Y']))_0x341c77['plane_normal']='y';else _0xa146a7['normal'][_0x3f3a33(_0x456988._0x54bff6)](Cesium__namespace['Cartesian3'][_0x3f3a33(_0x456988._0x3c4baf)])?_0x341c77[_0x3f3a33(_0x456988._0x5bda1e)]='z':(logWarn('plane类型未识别',_0xa146a7),_0x341c77[_0x3f3a33(_0x456988._0x10a871)]='z');}_0x341c77['plane_distance']=_0xa146a7['distance'];break;}default:this['_toOneJson_Poly'](_0x1a9357,_0xa146a7,_0x341c77);break;}}}class PointStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x1777a0,_0xd75381,_0x1f268e){const _0x3a2c87={_0x499799:0x1073},_0x1464d4=_0x3d5d32;return!this[_0x1464d4(0x1073)]&&(this['pointStyleConver']=new PointStyleConver()),this[_0x1464d4(0x1073)]['isEntity']=_0x1f268e,this[_0x1464d4(_0x3a2c87._0x499799)]['toCesiumVal'](_0x1777a0,_0xd75381);}[_0x3d5d32(0x9ff)](_0x2542cc,_0x1283f8){_0x1283f8['pixelSize']=0x6;}[_0x3d5d32(0xb7d)](_0x11ffe7,_0x11b96d){const _0x393c92={_0x55ee6a:0xe7a},_0x17e9ef=_0x3d5d32;_0x11ffe7[_0x17e9ef(_0x393c92._0x55ee6a)]===![]&&(_0x11b96d['outlineWidth']=0x0);}['_toOneCesiumVal'](_0x17a9a3,_0x411ea3,_0x422a48,_0x8797dc){const _0xfe4167=_0x3d5d32;switch(_0x17a9a3){case'color':case'randomColor':{_0x8797dc['color']=this['getColorByStyle'](_0x422a48);break;}case'outlineColor':{_0x8797dc['outlineColor']=this[_0xfe4167(0x22b)](_0x422a48);break;}default:this[_0xfe4167(0x790)](_0x17a9a3,_0x411ea3,_0x422a48,_0x8797dc);break;}}static['toJSON'](_0xa1d5aa,_0x4729ef,_0x30cb28){const _0x46e52e={_0x30107b:0x1073,_0x215782:0x1073},_0x3e075c=_0x3d5d32;return!this['pointStyleConver']&&(this[_0x3e075c(_0x46e52e._0x30107b)]=new PointStyleConver()),this[_0x3e075c(_0x46e52e._0x215782)]['isEntity']=_0x30cb28,this['pointStyleConver']['toJSON'](_0xa1d5aa,_0x4729ef);}['_toOneJson'](_0x856839,_0x5a0e58,_0x3d55b1){this['_toOneJson_Point'](_0x856839,_0x5a0e58,_0x3d55b1);}}class PolygonStyleConver extends BaseStyleConver{static['toCesiumVal'](_0xede694,_0x1efd6a,_0x5240d8){const _0x578976=_0x3d5d32;return!this['polygonStyleConver']&&(this['polygonStyleConver']=new PolygonStyleConver()),this[_0x578976(0x8af)]['isEntity']=_0x5240d8,this['polygonStyleConver']['toCesiumVal'](_0xede694,_0x1efd6a);}['_toCesiumValBefore'](_0x27edec,_0xb77734){const _0x348ebe={_0x4eef29:0x2d1},_0x3de9d9=_0x3d5d32;super['_toCesiumValBefore'](_0x27edec,_0xb77734);if(_0x27edec['clampToGround'])_0xb77734[_0x3de9d9(0x44e)]=Cesium__namespace['ArcType']['GEODESIC'],_0x27edec[_0x3de9d9(0x2d1)]('height')&&delete _0x27edec[_0x3de9d9(0x83e)],_0x27edec[_0x3de9d9(_0x348ebe._0x4eef29)]('diffHeight')&&delete _0x27edec['diffHeight'],_0x27edec['hasOwnProperty']('extrudedHeight')&&delete _0x27edec['extrudedHeight'];else Cesium__namespace['defined'](_0x27edec['height'])?(_0x27edec['clampToGround']=![],_0xb77734['perPositionHeight']=![]):(_0x27edec[_0x3de9d9(0x7c0)]=![],_0xb77734['perPositionHeight']=!![]);}['_toOneCesiumVal'](_0x45d887,_0x49d8e7,_0x569444,_0x15d0d5){const _0x565da5=_0x3d5d32;switch(_0x45d887){case'outlineColor':{_0x15d0d5[_0x565da5(0x62a)]=this['getOutlineColorByStyle'](_0x569444);break;}case'height':{_0x15d0d5[_0x45d887]=_0x49d8e7,_0x15d0d5['perPositionHeight']=![];break;}case'diffHeight':{Cesium__namespace['defined'](_0x569444['height'])&&(_0x15d0d5['extrudedHeight']=_0x569444['height']+_0x49d8e7);break;}case'clampToGround':_0x15d0d5[_0x45d887]=_0x49d8e7,_0x15d0d5[_0x565da5(0x8bc)]=!_0x49d8e7&&!Cesium__namespace[_0x565da5(0xb84)](_0x569444['height']);break;case'stRotation':_0x15d0d5['stRotation']=_0x49d8e7;break;case _0x565da5(0xc9e):_0x15d0d5['stRotation']=Cesium__namespace['Math']['toRadians'](_0x49d8e7);break;default:this['_toOneCesiumVal_Poly'](_0x45d887,_0x49d8e7,_0x569444,_0x15d0d5);break;}}static['toJSON'](_0x2f09a8,_0x40c2ed,_0x63de03){const _0xa7e23d={_0x4e4229:0x8af,_0x4199eb:0x2b2},_0x546bcc=_0x3d5d32;return!this['polygonStyleConver']&&(this[_0x546bcc(_0xa7e23d._0x4e4229)]=new PolygonStyleConver()),this['polygonStyleConver'][_0x546bcc(_0xa7e23d._0x4199eb)]=_0x63de03,this['polygonStyleConver']['toJSON'](_0x2f09a8,_0x40c2ed);}[_0x3d5d32(0x1056)](_0x2a18bb,_0x54a533,_0x1c4225){const _0x5710eb={_0x2bab34:0xc9e},_0x4d047b=_0x3d5d32;switch(_0x2a18bb){case'stRotation':{_0x1c4225[_0x4d047b(_0x5710eb._0x2bab34)]=formatNum$1(Cesium__namespace['Math'][_0x4d047b(0xa1f)](_0x54a533),0x1);break;}default:this['_toOneJson_Poly'](_0x2a18bb,_0x54a533,_0x1c4225);break;}}}class PolylineStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x2f653f,_0x54656a,_0x45336a){const _0x50cc40={_0x4142d5:0x83d},_0x3adc21=_0x3d5d32;return!this['polylineStyleConver']&&(this['polylineStyleConver']=new PolylineStyleConver()),this['polylineStyleConver']['isEntity']=_0x45336a,this['polylineStyleConver'][_0x3adc21(_0x50cc40._0x4142d5)](_0x2f653f,_0x54656a);}[_0x3d5d32(0x9ff)](_0x1a973f,_0xa819a9){const _0x5b194d={_0x587b0c:0x44e,_0x2cdcc9:0xbcd},_0x2c93a1=_0x3d5d32;super[_0x2c93a1(0x9ff)](_0x1a973f,_0xa819a9),_0x1a973f['clampToGround']&&(_0xa819a9[_0x2c93a1(_0x5b194d._0x587b0c)]=Cesium__namespace['ArcType'][_0x2c93a1(_0x5b194d._0x2cdcc9)]),_0x1a973f['materialType']===Color$2&&_0x1a973f['outline']&&_0x1a973f['outlineColor']&&(_0x1a973f['materialType']=PolylineOutline);}['_toOneCesiumVal'](_0x114774,_0x2f02cd,_0x54320e,_0x42004f){const _0x4eaafc=_0x3d5d32;switch(_0x114774){case'depthFail':if(_0x2f02cd){let _0x2142aa=getCesiumColor(_0x54320e['depthFailColor']||_0x54320e['color'],Cesium__namespace['Color'][_0x4eaafc(0x6e8)]);Cesium__namespace[_0x4eaafc(0xb84)](_0x54320e['depthFailOpacity'])&&(_0x2142aa=_0x2142aa['withAlpha'](Number(_0x54320e['depthFailOpacity']))),this[_0x4eaafc(0x2b2)]?_0x42004f['depthFailMaterial']=_0x2142aa:_0x42004f['depthFailColor']=_0x2142aa,_0x54320e['opacity']===0x1&&(_0x54320e['opacity']=0.98);}else _0x42004f['depthFailMaterial']=undefined;_0x42004f[_0x114774]=_0x2f02cd;break;case'closure':!this[_0x4eaafc(0x2b2)]&&(_0x42004f['loop']=_0x2f02cd);_0x42004f[_0x4eaafc(0x1f2)]=_0x2f02cd;break;default:this['_toOneCesiumVal_Poly'](_0x114774,_0x2f02cd,_0x54320e,_0x42004f);break;}}static['toJSON'](_0x525522,_0x21e105,_0x198b4b){const _0x8e592a={_0xfddfc3:0x7c7},_0x1e7a5f=_0x3d5d32;return!this['polylineStyleConver']&&(this[_0x1e7a5f(_0x8e592a._0xfddfc3)]=new PolylineStyleConver()),this['polylineStyleConver']['isEntity']=_0x198b4b,this[_0x1e7a5f(_0x8e592a._0xfddfc3)]['toJSON'](_0x525522,_0x21e105);}['_toOneJson'](_0x2f3a9d,_0x48f6b5,_0x17c9b3){const _0x4c2e59=_0x3d5d32;switch(_0x2f3a9d){case _0x4c2e59(0x55f):_0x17c9b3['closure']=_0x48f6b5;break;default:this[_0x4c2e59(0xfbd)](_0x2f3a9d,_0x48f6b5,_0x17c9b3);break;}}}class PolylineVolumeStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x4786e8,_0x29d0d0,_0x3111f3){const _0x128f5f={_0x1f6f3e:0x608},_0x203a53=_0x3d5d32;return!this['polylineVolumeStyleConver']&&(this[_0x203a53(_0x128f5f._0x1f6f3e)]=new PolylineVolumeStyleConver()),this['polylineVolumeStyleConver']['isEntity']=_0x3111f3,this['polylineVolumeStyleConver']['toCesiumVal'](_0x4786e8,_0x29d0d0);}[_0x3d5d32(0xb7d)](_0x2e5e47,_0x26e96f){const _0x4fb4cf={_0x2d4d41:0x4cb,_0xc792d3:0x36c},_0x55db28=_0x3d5d32,_0x552b35=_0x2e5e47[_0x55db28(0x866)]||_0x2e5e47['shapePositions'];_0x2e5e47['radius']=_0x2e5e47['radius']||0xa;switch(_0x552b35){case _0x55db28(_0x4fb4cf._0x2d4d41):_0x26e96f['shape']=PolylineVolumeStyleConver['getShapeForPipeline'](_0x2e5e47);break;case'circle':_0x26e96f['shape']=PolylineVolumeStyleConver[_0x55db28(_0x4fb4cf._0xc792d3)](_0x2e5e47);break;case _0x55db28(0xfa2):_0x26e96f['shape']=PolylineVolumeStyleConver['getShapeForStar'](_0x2e5e47);break;default:_0x26e96f['shape']=_0x552b35;break;}}['_toOneCesiumVal'](_0x4d73a7,_0x1b9763,_0x26302e,_0x1494c2){const _0x4d8923={_0x350823:0x4ed},_0x2cc6ea=_0x3d5d32;this[_0x2cc6ea(_0x4d8923._0x350823)](_0x4d73a7,_0x1b9763,_0x26302e,_0x1494c2);}static[_0x3d5d32(0x3db)](_0x130f98,_0x1f151b,_0x5ce312){const _0x24391c={_0x58495b:0x608},_0x2ecbf0=_0x3d5d32;return!this['polylineVolumeStyleConver']&&(this[_0x2ecbf0(_0x24391c._0x58495b)]=new PolylineVolumeStyleConver()),this['polylineVolumeStyleConver']['isEntity']=_0x5ce312,this[_0x2ecbf0(_0x24391c._0x58495b)]['toJSON'](_0x130f98,_0x1f151b);}['_toOneJson'](_0x415a34,_0x3c8173,_0x27bf2a){const _0x7b4561={_0x2bf866:0xfbd},_0x4c5397=_0x3d5d32;this[_0x4c5397(_0x7b4561._0x2bf866)](_0x415a34,_0x3c8173,_0x27bf2a);}static['getShapeForPipeline'](_0x4a8f9b){const _0x5bc5d4={_0xc04dd:0x7e7,_0x3455bb:0xd72,_0x529ace:0x723},_0x5c0f0a=_0x3d5d32,_0x401e9e=_0x4a8f9b['radius']??0x1,_0x56d59e=_0x4a8f9b[_0x5c0f0a(_0x5bc5d4._0xc04dd)]??_0x401e9e/0x3,_0x7292c5=Math['ceil'](0x168/(_0x4a8f9b['slices']??0x3c)),_0x441242=_0x4a8f9b['startAngle']??0x0,_0x4a27c1=_0x4a8f9b[_0x5c0f0a(_0x5bc5d4._0x3455bb)]??_0x441242+0x168,_0x2507d3=_0x4a8f9b['vscale']??0x1,_0x4fc539=_0x4a8f9b['hscale']??0x1,_0x3dc16d=[];for(let _0x55e7c3=_0x441242;_0x55e7c3<=_0x4a27c1;_0x55e7c3+=_0x7292c5){const _0x16645a=Cesium__namespace['Math'][_0x5c0f0a(0x562)](_0x55e7c3);_0x3dc16d['push'](new Cesium__namespace['Cartesian2'](_0x401e9e*_0x4fc539*Math['cos'](_0x16645a),_0x401e9e*_0x2507d3*Math[_0x5c0f0a(_0x5bc5d4._0x529ace)](_0x16645a)));}for(let _0x3503bd=_0x4a27c1;_0x3503bd>=_0x441242;_0x3503bd-=_0x7292c5){const _0x187899=Cesium__namespace['Math']['toRadians'](_0x3503bd);_0x3dc16d['push'](new Cesium__namespace['Cartesian2']((_0x401e9e-_0x56d59e)*_0x4fc539*Math['cos'](_0x187899),(_0x401e9e-_0x56d59e)*_0x2507d3*Math['sin'](_0x187899)));}return _0x3dc16d;}static['getShapeForCircle'](_0x31e788){const _0x326844={_0x4a9d15:0xb37,_0x212584:0x723},_0x619387=_0x3d5d32,_0x140001=_0x31e788['radius']??0x1,_0x1cfe85=Math['ceil'](0x168/(_0x31e788['slices']??0x3c)),_0xd25fb=_0x31e788[_0x619387(_0x326844._0x4a9d15)]??0x0,_0x356468=_0x31e788['endAngle']??_0xd25fb+0x168,_0x5641cf=_0x31e788[_0x619387(0x1d3)]??0x1,_0x39cb4e=_0x31e788['hscale']??0x1,_0x1aede5=[];for(let _0x10fe1d=_0xd25fb;_0x10fe1d<=_0x356468;_0x10fe1d+=_0x1cfe85){const _0x380988=Cesium__namespace['Math']['toRadians'](_0x10fe1d);_0x1aede5[_0x619387(0xb75)](new Cesium__namespace['Cartesian2'](_0x140001*_0x39cb4e*Math[_0x619387(0x256)](_0x380988),_0x140001*_0x5641cf*Math[_0x619387(_0x326844._0x212584)](_0x380988)));}return _0x1aede5;}static['getShapeForStar'](_0x1808af){const _0x8b5e44={_0x54325a:0x7e7,_0x3f6758:0xb0e},_0xf4bfa3=_0x3d5d32,_0x4e0256=_0x1808af['radius']??0x1,_0x4c846f=_0x4e0256-(_0x1808af[_0xf4bfa3(_0x8b5e44._0x54325a)]??_0x4e0256/0x3),_0x11436b=_0x1808af['slices']??0x6,_0x4dc239=Cesium__namespace[_0xf4bfa3(0x103e)][_0xf4bfa3(0x562)](_0x1808af[_0xf4bfa3(0xb37)]??0x0),_0x200e4e=Math['PI']/_0x11436b,_0x41848f=0x2*_0x11436b,_0x5a5873=new Array(_0x41848f);for(let _0x38b85c=0x0;_0x38b85c<_0x41848f;_0x38b85c++){const _0x47f5ed=_0x38b85c%0x2===0x0?_0x4e0256:_0x4c846f,_0x43e44f=_0x4dc239+_0x38b85c*_0x200e4e;_0x5a5873[_0x38b85c]=new Cesium__namespace[(_0xf4bfa3(_0x8b5e44._0x3f6758))](Math[_0xf4bfa3(0x256)](_0x43e44f)*_0x47f5ed,Math['sin'](_0x43e44f)*_0x47f5ed);}return _0x5a5873;}}class RectangleStyleConver extends BaseStyleConver{static[_0x3d5d32(0x83d)](_0x32e61b,_0x345743,_0x330075){const _0x1e4b1a={_0x1ae993:0x83d},_0x1ecba4=_0x3d5d32;return!this[_0x1ecba4(0x7ee)]&&(this['rectangleStyleConver']=new RectangleStyleConver()),this['rectangleStyleConver'][_0x1ecba4(0x2b2)]=_0x330075,this[_0x1ecba4(0x7ee)][_0x1ecba4(_0x1e4b1a._0x1ae993)](_0x32e61b,_0x345743);}['_toCesiumValBefore'](_0x32ccac,_0x5f07f9){const _0x2f4743={_0xca868c:0x2d1},_0x3a230f=_0x3d5d32;super['_toCesiumValBefore'](_0x32ccac,_0x5f07f9),_0x32ccac['clampToGround']?(_0x32ccac['hasOwnProperty']('height')&&delete _0x32ccac['height'],_0x32ccac[_0x3a230f(_0x2f4743._0xca868c)]('diffHeight')&&delete _0x32ccac[_0x3a230f(0x9e2)],_0x32ccac['hasOwnProperty']('extrudedHeight')&&delete _0x32ccac['extrudedHeight']):(_0x32ccac['clampToGround']=![],_0x5f07f9['height']=0x0);}['_toOneCesiumVal'](_0x335f21,_0x3bd68d,_0x112c1e,_0x5de822){const _0x592c10={_0x33ef5e:0x83e,_0x389a2b:0x831,_0x14630c:0x103e,_0x22e1da:0x31f,_0x19cd39:0x20d,_0x485d31:0xc9e,_0x3f0a63:0x103e,_0x3c7a8e:0x27d,_0x3059ba:0xa83},_0x9cf2ac=_0x3d5d32;switch(_0x335f21){case'height':_0x5de822[_0x9cf2ac(_0x592c10._0x33ef5e)]=_0x3bd68d;_0x112c1e['diffHeight']&&(_0x5de822[_0x9cf2ac(_0x592c10._0x389a2b)]=Number(_0x112c1e['diffHeight'])+Number(_0x3bd68d));break;case'diffHeight':Cesium__namespace['defined'](_0x112c1e['height'])&&(_0x5de822[_0x9cf2ac(_0x592c10._0x389a2b)]=_0x112c1e['height']+_0x3bd68d);break;case'rotation':_0x5de822[_0x9cf2ac(0x31f)]=_0x3bd68d;!_0x112c1e['stRotation']&&(_0x5de822['stRotation']=_0x5de822['rotation']);break;case'rotationDegree':_0x5de822[_0x9cf2ac(0x31f)]=Cesium__namespace[_0x9cf2ac(_0x592c10._0x14630c)]['toRadians'](_0x3bd68d);!_0x112c1e[_0x9cf2ac(0x20d)]&&(_0x5de822['stRotation']=_0x5de822[_0x9cf2ac(_0x592c10._0x22e1da)]);break;case'stRotation':_0x5de822[_0x9cf2ac(_0x592c10._0x19cd39)]=_0x3bd68d;break;case _0x9cf2ac(_0x592c10._0x485d31):_0x5de822['stRotation']=Cesium__namespace[_0x9cf2ac(_0x592c10._0x3f0a63)]['toRadians'](_0x3bd68d);break;case _0x9cf2ac(0x7c0):_0x3bd68d?_0x5de822['heightReference']=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:_0x5de822[_0x9cf2ac(_0x592c10._0x3c7a8e)]=Cesium__namespace['HeightReference'][_0x9cf2ac(_0x592c10._0x3059ba)];break;default:this['_toOneCesiumVal_Poly'](_0x335f21,_0x3bd68d,_0x112c1e,_0x5de822);break;}}static['toJSON'](_0x1ce530,_0x3d9169,_0x4c3ddc){const _0x668c76={_0x51212e:0x7ee},_0x4fbc98=_0x3d5d32;return!this[_0x4fbc98(_0x668c76._0x51212e)]&&(this['rectangleStyleConver']=new RectangleStyleConver()),this['rectangleStyleConver']['isEntity']=_0x4c3ddc,this[_0x4fbc98(_0x668c76._0x51212e)]['toJSON'](_0x1ce530,_0x3d9169);}['_toOneJson'](_0x4d040a,_0x2c8116,_0x3630f5){this['_toOneJson_Poly'](_0x4d040a,_0x2c8116,_0x3630f5);}}class RectangularSensorStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x7f9b51,_0x7372dc){const _0x32bfc4={_0x1ecf94:0xc0c},_0x56b710=_0x3d5d32;return!this['rectangularSensorStyleConver']&&(this['rectangularSensorStyleConver']=new RectangularSensorStyleConver()),this[_0x56b710(_0x32bfc4._0x1ecf94)][_0x56b710(0x2b2)]=!![],this['rectangularSensorStyleConver']['toCesiumVal'](_0x7f9b51,_0x7372dc);}[_0x3d5d32(0x9ff)](_0x377070,_0x1ea0a0){super['_toCesiumValBefore'](_0x377070,_0x1ea0a0);}['_getExcludedStyle'](){const _0x5a84b9=_0x3d5d32;return[_0x5a84b9(0x284),'scanPlaneOpacity'];}['_toOneCesiumVal'](_0x14fe40,_0x2da12b,_0x28d6b1,_0x6c931a){const _0x238fd4={_0x3d8501:0xe57,_0x21b646:0xc96,_0x580b5e:0x882,_0x5a6d78:0xfdc,_0x24fd30:0xc96,_0x5da6f8:0xc96,_0x460bfb:0x103e,_0x27537c:0x562},_0x18c3bb=_0x3d5d32;switch(_0x14fe40){case'lineColor':{let _0x403d7e=Cesium__namespace['Color']['fromCssColorString'](_0x2da12b||_0x18c3bb(0x84b));if(Cesium__namespace['defined'](_0x28d6b1['lineOpacity']))_0x403d7e=_0x403d7e[_0x18c3bb(_0x238fd4._0x3d8501)](Number(_0x28d6b1[_0x18c3bb(0x284)]));else Cesium__namespace[_0x18c3bb(0xb84)](_0x28d6b1[_0x18c3bb(0xfdc)])&&(_0x403d7e=_0x403d7e[_0x18c3bb(0xe57)](Number(_0x28d6b1[_0x18c3bb(0xfdc)])));Cesium__namespace['defined'](_0x28d6b1['globalAlpha'])&&_0x28d6b1[_0x18c3bb(_0x238fd4._0x21b646)]!==0x1&&(_0x403d7e=_0x403d7e[_0x18c3bb(_0x238fd4._0x3d8501)](_0x403d7e['alpha']*_0x28d6b1['globalAlpha']));_0x6c931a['lineColor']=_0x403d7e;break;}case'scanPlaneColor':{let _0x4c07fb=Cesium__namespace[_0x18c3bb(_0x238fd4._0x580b5e)]['fromCssColorString'](_0x2da12b||'#ffffff');if(Cesium__namespace['defined'](_0x28d6b1[_0x18c3bb(0xe80)]))_0x4c07fb=_0x4c07fb['withAlpha'](Number(_0x28d6b1['scanPlaneOpacity']));else Cesium__namespace['defined'](_0x28d6b1[_0x18c3bb(0xfdc)])&&(_0x4c07fb=_0x4c07fb['withAlpha'](Number(_0x28d6b1[_0x18c3bb(_0x238fd4._0x5a6d78)])));Cesium__namespace['defined'](_0x28d6b1['globalAlpha'])&&_0x28d6b1[_0x18c3bb(_0x238fd4._0x24fd30)]!==0x1&&(_0x4c07fb=_0x4c07fb['withAlpha'](_0x4c07fb[_0x18c3bb(0x24b)]*_0x28d6b1[_0x18c3bb(_0x238fd4._0x5da6f8)]));_0x6c931a['scanPlaneColor']=_0x4c07fb;break;}case'xHalfAngleDegree':_0x6c931a['xHalfAngle']=Cesium__namespace['Math'][_0x18c3bb(0x562)](_0x2da12b);break;case'yHalfAngleDegree':_0x6c931a['yHalfAngle']=Cesium__namespace[_0x18c3bb(_0x238fd4._0x460bfb)][_0x18c3bb(_0x238fd4._0x27537c)](_0x2da12b);break;case _0x18c3bb(0x6bb):_0x6c931a['showThroughEllipsoid']=!_0x2da12b;break;default:this['_toOneCesiumVal_Poly'](_0x14fe40,_0x2da12b,_0x28d6b1,_0x6c931a);break;}}static['toJSON'](_0x15e3c6,_0x48e17e){return!this['rectangularSensorStyleConver']&&(this['rectangularSensorStyleConver']=new RectangularSensorStyleConver()),this['rectangularSensorStyleConver']['isEntity']=!![],this['rectangularSensorStyleConver']['toJSON'](_0x15e3c6,_0x48e17e);}['_toOneJson'](_0x426e5e,_0x5c06fb,_0x32d520){this['_toOneJson_Poly'](_0x426e5e,_0x5c06fb,_0x32d520);}}class WallStyleConver extends BaseStyleConver{static['toCesiumVal'](_0x156285,_0x3dc4ef,_0x554003){const _0x2ab227=_0x3d5d32;return!this[_0x2ab227(0x28c)]&&(this['wallStyleConver']=new WallStyleConver()),this['wallStyleConver']['isEntity']=_0x554003,this['wallStyleConver']['toCesiumVal'](_0x156285,_0x3dc4ef);}['_toOneCesiumVal'](_0xfc3706,_0x2eaadd,_0x1b80be,_0x54ccec){const _0x536702={_0x5b29da:0x4ed},_0x190e7a=_0x3d5d32;this[_0x190e7a(_0x536702._0x5b29da)](_0xfc3706,_0x2eaadd,_0x1b80be,_0x54ccec);}static[_0x3d5d32(0x3db)](_0x5e4978,_0x2aafc8,_0x39e24a){const _0xf5fdd2={_0x54378d:0x28c},_0x4b220b=_0x3d5d32;return!this[_0x4b220b(0x28c)]&&(this[_0x4b220b(0x28c)]=new WallStyleConver()),this['wallStyleConver']['isEntity']=_0x39e24a,this[_0x4b220b(_0xf5fdd2._0x54378d)]['toJSON'](_0x5e4978,_0x2aafc8);}[_0x3d5d32(0x1056)](_0x5c4727,_0xea30a9,_0x287ff6){const _0xae8c09=_0x3d5d32;this[_0xae8c09(0xfbd)](_0x5c4727,_0xea30a9,_0x287ff6);}}var czm_cellular=_0x3d5d32(0x4f7),czm_snoise='/**\x0a\x20*\x20@license\x0a\x20*\x20Description\x20:\x20Array\x20and\x20textureless\x20GLSL\x202D/3D/4D\x20simplex\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20noise\x20functions.\x0a\x20*\x20\x20\x20\x20\x20\x20Author\x20:\x20Ian\x20McEwan,\x20Ashima\x20Arts.\x0a\x20*\x20\x20Maintainer\x20:\x20ijm\x0a\x20*\x20\x20\x20\x20\x20Lastmod\x20:\x2020110822\x20(ijm)\x0a\x20*\x20\x20\x20\x20\x20License\x20:\x20Copyright\x20(C)\x202011\x20Ashima\x20Arts.\x20All\x20rights\x20reserved.\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Distributed\x20under\x20the\x20MIT\x20License.\x20See\x20LICENSE\x20file.\x0a\x20*\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20https://github.com/ashima/webgl-noise\x0a\x20*/\x0a\x0avec4\x20_czm_mod289(vec4\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec3\x20_czm_mod289(vec3\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec2\x20_czm_mod289(vec2\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0afloat\x20_czm_mod289(float\x20x)\x20{\x0a\x20\x20return\x20x\x20-\x20floor(x\x20*\x20(1.0\x20/\x20289.0))\x20*\x20289.0;\x0a}\x0a\x0avec4\x20_czm_permute(vec4\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0avec3\x20_czm_permute(vec3\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0afloat\x20_czm_permute(float\x20x)\x20{\x0a\x20\x20return\x20_czm_mod289(((x\x20*\x2034.0)\x20+\x201.0)\x20*\x20x);\x0a}\x0a\x0avec4\x20_czm_taylorInvSqrt(vec4\x20r)\x20{\x0a\x20\x20return\x201.79284291400159\x20-\x200.85373472095314\x20*\x20r;\x0a}\x0a\x0afloat\x20_czm_taylorInvSqrt(float\x20r)\x20{\x0a\x20\x20return\x201.79284291400159\x20-\x200.85373472095314\x20*\x20r;\x0a}\x0a\x0avec4\x20_czm_grad4(float\x20j,\x20vec4\x20ip)\x20{\x0a\x20\x20const\x20vec4\x20ones\x20=\x20vec4(1.0,\x201.0,\x201.0,\x20-1.0);\x0a\x20\x20vec4\x20p,\x20s;\x0a\x0a\x20\x20p.xyz\x20=\x20floor(fract(vec3(j)\x20*\x20ip.xyz)\x20*\x207.0)\x20*\x20ip.z\x20-\x201.0;\x0a\x20\x20p.w\x20=\x201.5\x20-\x20dot(abs(p.xyz),\x20ones.xyz);\x0a\x20\x20s\x20=\x20vec4(lessThan(p,\x20vec4(0.0)));\x0a\x20\x20p.xyz\x20=\x20p.xyz\x20+\x20(s.xyz\x20*\x202.0\x20-\x201.0)\x20*\x20s.www;\x0a\x0a\x20\x20return\x20p;\x0a}\x0a\x0a/**\x0a\x20*\x20DOC_TBA\x0a\x20*\x0a\x20*\x20Implemented\x20by\x20Ian\x20McEwan,\x20Ashima\x20Arts,\x20and\x20distributed\x20under\x20the\x20MIT\x20License.\x20\x20{@link\x20https://github.com/ashima/webgl-noise}\x0a\x20*\x0a\x20*\x20@name\x20czm_snoise\x0a\x20*\x20@glslFunction\x0a\x20*\x0a\x20*\x20@see\x20https://github.com/ashima/webgl-noise\x0a\x20*\x20@see\x20Stefan\x20Gustavson\x27s\x20paper\x20Simplex\x20noise\x20demystified\x0a\x20*/\x0afloat\x20czm_snoise(vec2\x20v)\x20{\x0a\x20\x20const\x20vec4\x20C\x20=\x20vec4(0.211324865405187,\x20\x20//\x20(3.0-sqrt(3.0))/6.0\x0a\x20\x200.366025403784439,\x20\x20//\x200.5*(sqrt(3.0)-1.0)\x0a\x20\x20-0.577350269189626,\x20\x20//\x20-1.0\x20+\x202.0\x20*\x20C.x\x0a\x20\x200.024390243902439);\x20//\x201.0\x20/\x2041.0\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec2\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20C.yy));\x0a\x20\x20vec2\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x20\x20vec2\x20i1;\x0a\x20\x20\x20\x20//i1.x\x20=\x20step(\x20x0.y,\x20x0.x\x20);\x20//\x20x0.x\x20>\x20x0.y\x20?\x201.0\x20:\x200.0\x0a\x20\x20\x20\x20//i1.y\x20=\x201.0\x20-\x20i1.x;\x0a\x20\x20i1\x20=\x20(x0.x\x20>\x20x0.y)\x20?\x20vec2(1.0,\x200.0)\x20:\x20vec2(0.0,\x201.0);\x0a\x20\x20\x20\x20//\x20x0\x20=\x20x0\x20-\x200.0\x20+\x200.0\x20*\x20C.xx\x20;\x0a\x20\x20\x20\x20//\x20x1\x20=\x20x0\x20-\x20i1\x20+\x201.0\x20*\x20C.xx\x20;\x0a\x20\x20\x20\x20//\x20x2\x20=\x20x0\x20-\x201.0\x20+\x202.0\x20*\x20C.xx\x20;\x0a\x20\x20vec4\x20x12\x20=\x20x0.xyxy\x20+\x20C.xxzz;\x0a\x20\x20x12.xy\x20-=\x20i1;\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x20//\x20Avoid\x20truncation\x20effects\x20in\x20permutation\x0a\x20\x20vec3\x20p\x20=\x20_czm_permute(_czm_permute(i.y\x20+\x20vec3(0.0,\x20i1.y,\x201.0))\x20+\x20i.x\x20+\x20vec3(0.0,\x20i1.x,\x201.0));\x0a\x0a\x20\x20vec3\x20m\x20=\x20max(0.5\x20-\x20vec3(dot(x0,\x20x0),\x20dot(x12.xy,\x20x12.xy),\x20dot(x12.zw,\x20x12.zw)),\x200.0);\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x2041\x20points\x20uniformly\x20over\x20a\x20line,\x20mapped\x20onto\x20a\x20diamond.\x0a\x20\x20\x20\x20//\x20The\x20ring\x20size\x2017*17\x20=\x20289\x20is\x20close\x20to\x20a\x20multiple\x20of\x2041\x20(41*7\x20=\x20287)\x0a\x20\x20vec3\x20x\x20=\x202.0\x20*\x20fract(p\x20*\x20C.www)\x20-\x201.0;\x0a\x20\x20vec3\x20h\x20=\x20abs(x)\x20-\x200.5;\x0a\x20\x20vec3\x20ox\x20=\x20floor(x\x20+\x200.5);\x0a\x20\x20vec3\x20a0\x20=\x20x\x20-\x20ox;\x0a\x0a\x20\x20\x20\x20//\x20Normalise\x20gradients\x20implicitly\x20by\x20scaling\x20m\x0a\x20\x20\x20\x20//\x20Approximation\x20of:\x20m\x20*=\x20inversesqrt(\x20a0*a0\x20+\x20h*h\x20);\x0a\x20\x20m\x20*=\x201.79284291400159\x20-\x200.85373472095314\x20*\x20(a0\x20*\x20a0\x20+\x20h\x20*\x20h);\x0a\x0a\x20\x20\x20\x20//\x20Compute\x20final\x20noise\x20value\x20at\x20P\x0a\x20\x20vec3\x20g;\x0a\x20\x20g.x\x20=\x20a0.x\x20*\x20x0.x\x20+\x20h.x\x20*\x20x0.y;\x0a\x20\x20g.yz\x20=\x20a0.yz\x20*\x20x12.xz\x20+\x20h.yz\x20*\x20x12.yw;\x0a\x20\x20return\x20130.0\x20*\x20dot(m,\x20g);\x0a}\x0a\x0afloat\x20czm_snoise(vec3\x20v)\x20{\x0a\x20\x20const\x20vec2\x20C\x20=\x20vec2(1.0\x20/\x206.0,\x201.0\x20/\x203.0);\x0a\x20\x20const\x20vec4\x20D\x20=\x20vec4(0.0,\x200.5,\x201.0,\x202.0);\x0a\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec3\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20C.yyy));\x0a\x20\x20vec3\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xxx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x20\x20vec3\x20g\x20=\x20step(x0.yzx,\x20x0.xyz);\x0a\x20\x20vec3\x20l\x20=\x201.0\x20-\x20g;\x0a\x20\x20vec3\x20i1\x20=\x20min(g.xyz,\x20l.zxy);\x0a\x20\x20vec3\x20i2\x20=\x20max(g.xyz,\x20l.zxy);\x0a\x0a\x20\x20vec3\x20x1\x20=\x20x0\x20-\x20i1\x20+\x20C.xxx;\x0a\x20\x20vec3\x20x2\x20=\x20x0\x20-\x20i2\x20+\x20C.yyy;\x20//\x202.0*C.x\x20=\x201/3\x20=\x20C.y\x0a\x20\x20vec3\x20x3\x20=\x20x0\x20-\x20D.yyy;\x20\x20\x20\x20\x20\x20//\x20-1.0+3.0*C.x\x20=\x20-0.5\x20=\x20-D.y\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x0a\x20\x20vec4\x20p\x20=\x20_czm_permute(_czm_permute(_czm_permute(i.z\x20+\x20vec4(0.0,\x20i1.z,\x20i2.z,\x201.0))\x20+\x20i.y\x20+\x20vec4(0.0,\x20i1.y,\x20i2.y,\x201.0))\x20+\x20i.x\x20+\x20vec4(0.0,\x20i1.x,\x20i2.x,\x201.0));\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x207x7\x20points\x20over\x20a\x20square,\x20mapped\x20onto\x20an\x20octahedron.\x0a\x20\x20\x20\x20//\x20The\x20ring\x20size\x2017*17\x20=\x20289\x20is\x20close\x20to\x20a\x20multiple\x20of\x2049\x20(49*6\x20=\x20294)\x0a\x20\x20float\x20n_\x20=\x200.142857142857;\x20//\x201.0/7.0\x0a\x20\x20vec3\x20ns\x20=\x20n_\x20*\x20D.wyz\x20-\x20D.xzx;\x0a\x0a\x20\x20vec4\x20j\x20=\x20p\x20-\x2049.0\x20*\x20floor(p\x20*\x20ns.z\x20*\x20ns.z);\x20\x20//\x20\x20mod(p,7*7)\x0a\x0a\x20\x20vec4\x20x_\x20=\x20floor(j\x20*\x20ns.z);\x0a\x20\x20vec4\x20y_\x20=\x20floor(j\x20-\x207.0\x20*\x20x_);\x20\x20\x20\x20//\x20mod(j,N)\x0a\x0a\x20\x20vec4\x20x\x20=\x20x_\x20*\x20ns.x\x20+\x20ns.yyyy;\x0a\x20\x20vec4\x20y\x20=\x20y_\x20*\x20ns.x\x20+\x20ns.yyyy;\x0a\x20\x20vec4\x20h\x20=\x201.0\x20-\x20abs(x)\x20-\x20abs(y);\x0a\x0a\x20\x20vec4\x20b0\x20=\x20vec4(x.xy,\x20y.xy);\x0a\x20\x20vec4\x20b1\x20=\x20vec4(x.zw,\x20y.zw);\x0a\x0a\x20\x20\x20\x20//vec4\x20s0\x20=\x20vec4(lessThan(b0,0.0))*2.0\x20-\x201.0;\x0a\x20\x20\x20\x20//vec4\x20s1\x20=\x20vec4(lessThan(b1,0.0))*2.0\x20-\x201.0;\x0a\x20\x20vec4\x20s0\x20=\x20floor(b0)\x20*\x202.0\x20+\x201.0;\x0a\x20\x20vec4\x20s1\x20=\x20floor(b1)\x20*\x202.0\x20+\x201.0;\x0a\x20\x20vec4\x20sh\x20=\x20-step(h,\x20vec4(0.0));\x0a\x0a\x20\x20vec4\x20a0\x20=\x20b0.xzyw\x20+\x20s0.xzyw\x20*\x20sh.xxyy;\x0a\x20\x20vec4\x20a1\x20=\x20b1.xzyw\x20+\x20s1.xzyw\x20*\x20sh.zzww;\x0a\x0a\x20\x20vec3\x20p0\x20=\x20vec3(a0.xy,\x20h.x);\x0a\x20\x20vec3\x20p1\x20=\x20vec3(a0.zw,\x20h.y);\x0a\x20\x20vec3\x20p2\x20=\x20vec3(a1.xy,\x20h.z);\x0a\x20\x20vec3\x20p3\x20=\x20vec3(a1.zw,\x20h.w);\x0a\x0a\x20\x20\x20\x20//Normalise\x20gradients\x0a\x20\x20vec4\x20norm\x20=\x20_czm_taylorInvSqrt(vec4(dot(p0,\x20p0),\x20dot(p1,\x20p1),\x20dot(p2,\x20p2),\x20dot(p3,\x20p3)));\x0a\x20\x20p0\x20*=\x20norm.x;\x0a\x20\x20p1\x20*=\x20norm.y;\x0a\x20\x20p2\x20*=\x20norm.z;\x0a\x20\x20p3\x20*=\x20norm.w;\x0a\x0a\x20\x20\x20\x20//\x20Mix\x20final\x20noise\x20value\x0a\x20\x20vec4\x20m\x20=\x20max(0.6\x20-\x20vec4(dot(x0,\x20x0),\x20dot(x1,\x20x1),\x20dot(x2,\x20x2),\x20dot(x3,\x20x3)),\x200.0);\x0a\x20\x20m\x20=\x20m\x20*\x20m;\x0a\x20\x20return\x2042.0\x20*\x20dot(m\x20*\x20m,\x20vec4(dot(p0,\x20x0),\x20dot(p1,\x20x1),\x20dot(p2,\x20x2),\x20dot(p3,\x20x3)));\x0a}\x0a\x0afloat\x20czm_snoise(vec4\x20v)\x20{\x0a\x20\x20const\x20vec4\x20C\x20=\x20vec4(0.138196601125011,\x20\x20//\x20(5\x20-\x20sqrt(5))/20\x20\x20G4\x0a\x20\x200.276393202250021,\x20\x20//\x202\x20*\x20G4\x0a\x20\x200.414589803375032,\x20\x20//\x203\x20*\x20G4\x0a\x20\x20-0.447213595499958);\x20//\x20-1\x20+\x204\x20*\x20G4\x0a\x0a\x20\x20\x20\x20//\x20(sqrt(5)\x20-\x201)/4\x20=\x20F4,\x20used\x20once\x20below\x0a\x20\x20\x20\x20#define\x20F4\x200.309016994374947451\x0a\x0a\x20\x20\x20\x20//\x20First\x20corner\x0a\x20\x20vec4\x20i\x20=\x20floor(v\x20+\x20dot(v,\x20vec4(F4)));\x0a\x20\x20vec4\x20x0\x20=\x20v\x20-\x20i\x20+\x20dot(i,\x20C.xxxx);\x0a\x0a\x20\x20\x20\x20//\x20Other\x20corners\x0a\x0a\x20\x20\x20\x20//\x20Rank\x20sorting\x20originally\x20contributed\x20by\x20Bill\x20Licea-Kane,\x20AMD\x20(formerly\x20ATI)\x0a\x20\x20vec4\x20i0;\x0a\x20\x20vec3\x20isX\x20=\x20step(x0.yzw,\x20x0.xxx);\x0a\x20\x20vec3\x20isYZ\x20=\x20step(x0.zww,\x20x0.yyz);\x0a\x20\x20\x20\x20//\x20\x20i0.x\x20=\x20dot(\x20isX,\x20vec3(\x201.0\x20)\x20);\x0a\x20\x20i0.x\x20=\x20isX.x\x20+\x20isX.y\x20+\x20isX.z;\x0a\x20\x20i0.yzw\x20=\x201.0\x20-\x20isX;\x0a\x20\x20\x20\x20//\x20\x20i0.y\x20+=\x20dot(\x20isYZ.xy,\x20vec2(\x201.0\x20)\x20);\x0a\x20\x20i0.y\x20+=\x20isYZ.x\x20+\x20isYZ.y;\x0a\x20\x20i0.zw\x20+=\x201.0\x20-\x20isYZ.xy;\x0a\x20\x20i0.z\x20+=\x20isYZ.z;\x0a\x20\x20i0.w\x20+=\x201.0\x20-\x20isYZ.z;\x0a\x0a\x20\x20\x20\x20//\x20i0\x20now\x20contains\x20the\x20unique\x20values\x200,1,2,3\x20in\x20each\x20channel\x0a\x20\x20vec4\x20i3\x20=\x20clamp(i0,\x200.0,\x201.0);\x0a\x20\x20vec4\x20i2\x20=\x20clamp(i0\x20-\x201.0,\x200.0,\x201.0);\x0a\x20\x20vec4\x20i1\x20=\x20clamp(i0\x20-\x202.0,\x200.0,\x201.0);\x0a\x0a\x20\x20\x20\x20//\x20\x20x0\x20=\x20x0\x20-\x200.0\x20+\x200.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x1\x20=\x20x0\x20-\x20i1\x20\x20+\x201.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x2\x20=\x20x0\x20-\x20i2\x20\x20+\x202.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x3\x20=\x20x0\x20-\x20i3\x20\x20+\x203.0\x20*\x20C.xxxx\x0a\x20\x20\x20\x20//\x20\x20x4\x20=\x20x0\x20-\x201.0\x20+\x204.0\x20*\x20C.xxxx\x0a\x20\x20vec4\x20x1\x20=\x20x0\x20-\x20i1\x20+\x20C.xxxx;\x0a\x20\x20vec4\x20x2\x20=\x20x0\x20-\x20i2\x20+\x20C.yyyy;\x0a\x20\x20vec4\x20x3\x20=\x20x0\x20-\x20i3\x20+\x20C.zzzz;\x0a\x20\x20vec4\x20x4\x20=\x20x0\x20+\x20C.wwww;\x0a\x0a\x20\x20\x20\x20//\x20Permutations\x0a\x20\x20i\x20=\x20_czm_mod289(i);\x0a\x20\x20float\x20j0\x20=\x20_czm_permute(_czm_permute(_czm_permute(_czm_permute(i.w)\x20+\x20i.z)\x20+\x20i.y)\x20+\x20i.x);\x0a\x20\x20vec4\x20j1\x20=\x20_czm_permute(_czm_permute(_czm_permute(_czm_permute(i.w\x20+\x20vec4(i1.w,\x20i2.w,\x20i3.w,\x201.0))\x20+\x20i.z\x20+\x20vec4(i1.z,\x20i2.z,\x20i3.z,\x201.0))\x20+\x20i.y\x20+\x20vec4(i1.y,\x20i2.y,\x20i3.y,\x201.0))\x20+\x20i.x\x20+\x20vec4(i1.x,\x20i2.x,\x20i3.x,\x201.0));\x0a\x0a\x20\x20\x20\x20//\x20Gradients:\x207x7x6\x20points\x20over\x20a\x20cube,\x20mapped\x20onto\x20a\x204-cross\x20polytope\x0a\x20\x20\x20\x20//\x207*7*6\x20=\x20294,\x20which\x20is\x20close\x20to\x20the\x20ring\x20size\x2017*17\x20=\x20289.\x0a\x20\x20vec4\x20ip\x20=\x20vec4(1.0\x20/\x20294.0,\x201.0\x20/\x2049.0,\x201.0\x20/\x207.0,\x200.0);\x0a\x0a\x20\x20vec4\x20p0\x20=\x20_czm_grad4(j0,\x20ip);\x0a\x20\x20vec4\x20p1\x20=\x20_czm_grad4(j1.x,\x20ip);\x0a\x20\x20vec4\x20p2\x20=\x20_czm_grad4(j1.y,\x20ip);\x0a\x20\x20vec4\x20p3\x20=\x20_czm_grad4(j1.z,\x20ip);\x0a\x20\x20vec4\x20p4\x20=\x20_czm_grad4(j1.w,\x20ip);\x0a\x0a\x20\x20\x20\x20//\x20Normalise\x20gradients\x0a\x20\x20vec4\x20norm\x20=\x20_czm_taylorInvSqrt(vec4(dot(p0,\x20p0),\x20dot(p1,\x20p1),\x20dot(p2,\x20p2),\x20dot(p3,\x20p3)));\x0a\x20\x20p0\x20*=\x20norm.x;\x0a\x20\x20p1\x20*=\x20norm.y;\x0a\x20\x20p2\x20*=\x20norm.z;\x0a\x20\x20p3\x20*=\x20norm.w;\x0a\x20\x20p4\x20*=\x20_czm_taylorInvSqrt(dot(p4,\x20p4));\x0a\x0a\x20\x20\x20\x20//\x20Mix\x20contributions\x20from\x20the\x20five\x20corners\x0a\x20\x20vec3\x20m0\x20=\x20max(0.6\x20-\x20vec3(dot(x0,\x20x0),\x20dot(x1,\x20x1),\x20dot(x2,\x20x2)),\x200.0);\x0a\x20\x20vec2\x20m1\x20=\x20max(0.6\x20-\x20vec2(dot(x3,\x20x3),\x20dot(x4,\x20x4)),\x200.0);\x0a\x20\x20m0\x20=\x20m0\x20*\x20m0;\x0a\x20\x20m1\x20=\x20m1\x20*\x20m1;\x0a\x20\x20return\x2049.0\x20*\x20(dot(m0\x20*\x20m0,\x20vec3(dot(p0,\x20x0),\x20dot(p1,\x20x1),\x20dot(p2,\x20x2)))\x20+\x20dot(m1\x20*\x20m1,\x20vec2(dot(p3,\x20x3),\x20dot(p4,\x20x4))));\x0a}\x0a',LineDotDashMaterial='uniform\x20vec4\x20color;\x0auniform\x20vec4\x20gapColor;\x0auniform\x20float\x20dashLength;\x0auniform\x20float\x20dashPattern;\x0ain\x20float\x20v_polylineAngle;\x0a\x0aconst\x20float\x20maskLength\x20=\x2016.0;\x0a\x0amat2\x20rotate(float\x20rad)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(rad);\x0a\x20\x20float\x20s\x20=\x20sin(rad);\x0a\x20\x20return\x20mat2(c,\x20s,\x20-s,\x20c);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20pos\x20=\x20rotate(v_polylineAngle)\x20*\x20gl_FragCoord.xy;\x0a\x0a\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x0a\x20\x20vec4\x20fragColor\x20=\x20(mod(maskTest,\x202.0)\x20<\x201.0)\x20?\x20gapColor\x20:\x20color;\x0a\x20\x20if(fragColor.a\x20<\x200.005)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition2\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x200.25\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex2\x20=\x20floor(dashPosition2\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest2\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex2));\x0a\x20\x20\x20\x20fragColor\x20=\x20(mod(maskTest2,\x202.0)\x20<\x201.0)\x20?\x20gapColor\x20:\x20color;\x0a\x20\x20\x20\x20if(fragColor.a\x20<\x200.005)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x20\x20material.emission\x20=\x20fragColor.rgb;\x0a\x20\x20material.alpha\x20=\x20fragColor.a;\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlowMaterial='uniform\x20float\x20globalAlpha;\x0auniform\x20bool\x20axisY;\x0auniform\x20bool\x20mixt;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20repeat\x20*\x20materialInput.st;\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(speed\x20!=\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20currTime;\x0a\x20\x20\x20\x20if(time\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20currTime\x20=\x20speed\x20*\x20czm_frameNumber\x20/\x201000.0;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20currTime\x20=\x20time;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract((axisY\x20?\x20st.t\x20:\x20st.s)\x20-\x20currTime),\x20st.t));\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20}\x0a\x0a\x20\x20if(color.a\x20==\x200.0)\x20{\x0a\x20\x20\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a\x20\x20if(color.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20if(mixt)\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20max(colorImage.rgb\x20*\x20color.rgb\x20*\x20material.alpha\x20*\x203.0,\x20colorImage.rgb\x20*\x20color.rgb);\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x203.0,\x20color.rgb);\x0a\x20\x20}\x0a\x0a\x20\x20if(hasImage2)\x20{\x0a\x20\x20\x20\x20vec4\x20colorBG\x20=\x20texture(image2,\x20materialInput.st);\x0a\x20\x20\x20\x20if(colorBG.a\x20>\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20color2.rgb;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlowColorMaterial=_0x3d5d32(0x8e0),ODLineMaterial='uniform\x20vec4\x20color;\x0auniform\x20vec4\x20bgColor;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20startTime;\x0auniform\x20float\x20bidirectional;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20t\x20=\x20fract(startTime\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20t\x20*=\x201.03;\x0a\x20\x20float\x20alpha0\x20=\x20smoothstep(t\x20-\x200.03,\x20t,\x20st.s)\x20*\x20step(st.s,\x20t);\x0a\x20\x20float\x20mt\x20=\x201.\x20-\x20t;\x0a\x20\x20float\x20alpha1\x20=\x20smoothstep(mt\x20+\x200.03,\x20mt,\x20st.s)\x20*\x20step(mt,\x20st.s);\x0a\x0a\x20\x20float\x20a0\x20=\x20step(abs(bidirectional\x20-\x200.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20a1\x20=\x20step(abs(bidirectional\x20-\x201.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20db\x20=\x20step(abs(bidirectional\x20-\x202.0)\x20-\x200.001,\x200.);\x0a\x20\x20float\x20alpha\x20=\x20alpha0\x20*\x20(a0\x20+\x20db)\x20+\x20alpha1\x20*\x20(a1\x20+\x20db);\x0a\x20\x20alpha\x20=\x20clamp(alpha,\x200.,\x201.);\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20alpha\x20+\x20bgColor.rgb\x20*\x20(1.\x20-\x20alpha);\x0a\x20\x20material.alpha\x20=\x20(color.a\x20*\x20alpha\x20+\x20bgColor.a\x20*\x20(1.\x20-\x20alpha))\x20*\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20//\x20if\x20(useImageAndRepeat.x\x20!=\x200.)\x20{\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20float\x20repeat\x20=\x20useImageAndRepeat.y;\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20vec4\x20marsImageColor\x20=\x20texture(image,\x20fract(vec2(fract((st.s-t)*repeat),\x20st.t)));\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20material.diffuse\x20=\x20marsImageColor.rgb;\x0a\x20\x20\x20\x20//\x20\x20\x20\x20\x20material.alpha\x20=\x20marsImageColor.a;\x0a\x20\x20\x20\x20//\x20}\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',LineFlickerMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20scalar\x20=\x20smoothstep(0.0,\x201.0,\x20time);\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20scalar;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20scalar\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',LineTrailMaterial='uniform\x20vec4\x20bgColor;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20vec3\x20fragColor\x20=\x20color.rgb;\x0a\x20\x20if(st.t\x20>\x200.45\x20&&\x20st.t\x20<\x200.55)\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec3(1.0);\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x201.5\x20*\x20smoothstep(.0,\x201.,\x20fract(st.s\x20-\x20time));\x0a\x20\x20material.diffuse\x20=\x20max(fragColor.rgb\x20*\x20material.alpha,\x20fragColor.rgb);\x0a\x0a\x20\x20if(material.alpha\x20<\x20bgColor.a)\x20{\x0a\x20\x20\x20\x20material.alpha\x20=\x20bgColor.a;\x0a\x20\x20\x20\x20material.diffuse\x20=\x20bgColor.rgb;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20material.alpha\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',LineBloomMaterial=_0x3d5d32(0x8df),DigitalFlowMaterial='uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20plot(float\x20st,\x20float\x20pct)\x20{\x0a\x20\x20return\x20smoothstep(pct,\x20pct,\x20st)\x20-\x20smoothstep(pct,\x20pct\x20+\x200.5,\x20st);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time2\x20=\x20czm_frameNumber\x20/\x20speed;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s),\x20fract(float(st.t\x20*\x20segment)\x20-\x20time2)));\x0a\x20\x20float\x20percent\x20=\x20distance(st.y,\x20.5)\x20/\x200.9;\x0a\x20\x20float\x20distance\x20=\x20length(vec2(st.x,\x20st.y));\x0a\x20\x20float\x20pf\x20=\x20plot(distance,\x20fract(czm_frameNumber\x20/\x20200.0)\x20*\x2010.);\x0a\x20\x20vec4\x20gradient\x20=\x20mix(vec4(1.0,\x201.0,\x201.0,\x201.0),\x20vec4(pf,\x20pf,\x20pf,\x201.0),\x200.8);\x0a\x20\x20float\x20alpha\x20=\x20(colorImage.a\x20*\x20(1.0\x20-\x20percent));\x0a\x20\x20vec3\x20diffuse\x20=\x20max(color.rgb\x20*\x20alpha\x20*\x20glow,\x20color.rgb);\x0a\x0a\x20\x20if(flowGlow\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20vec4\x20rgba\x20=\x20mix(vec4(diffuse,\x20alpha),\x20gradient,\x20pf);\x0a\x20\x20\x20\x20material.diffuse\x20=\x20rgba.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20rgba.a\x20*\x20globalAlpha;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20diffuse;\x0a\x20\x20\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',LineThreeDashMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20dashLength;\x0auniform\x20float\x20dashPattern;\x0a\x0auniform\x20vec4\x20sidesColor;\x0auniform\x20float\x20sidesDashLength;\x0auniform\x20float\x20globalAlpha;\x0a\x0ain\x20float\x20v_polylineAngle;\x0a\x0aconst\x20float\x20maskLength\x20=\x2016.0;\x0a\x0amat2\x20rotate(float\x20rad)\x20{\x0a\x20\x20float\x20c\x20=\x20cos(rad);\x0a\x20\x20float\x20s\x20=\x20sin(rad);\x0a\x20\x20return\x20mat2(c,\x20s,\x20-s,\x20c);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20pos\x20=\x20rotate(v_polylineAngle)\x20*\x20gl_FragCoord.xy;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x0a\x20\x20float\x20centerGlow\x20=\x20widthRatio\x20/\x20abs(st.t\x20-\x200.5)\x20-\x20(widthRatio\x20/\x200.5)\x20-\x201.0;\x0a\x20\x20if(centerGlow\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(dashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x20\x20\x20\x20if((mod(maskTest,\x202.0)\x20<\x201.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20material.emission\x20=\x20color.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20color.a;\x0a\x20\x20\x20\x20return\x20material;\x0a\x20\x20}\x0a\x0a\x20\x20float\x20sidesGlow\x20=\x20(1.0\x20-\x20sidesWidthRatio)\x20/\x20abs(st.t\x20-\x200.5)\x20-\x20((1.0\x20-\x20sidesWidthRatio)\x20/\x200.5)\x20-\x201.0;\x0a\x20\x20if(sidesGlow\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20float\x20dashPosition\x20=\x20fract(pos.x\x20/\x20(sidesDashLength\x20*\x20czm_pixelRatio));\x0a\x20\x20\x20\x20float\x20maskIndex\x20=\x20floor(dashPosition\x20*\x20maskLength);\x0a\x20\x20\x20\x20float\x20maskTest\x20=\x20floor(dashPattern\x20/\x20pow(2.0,\x20maskIndex));\x0a\x20\x20\x20\x20if((mod(maskTest,\x202.0)\x20<\x201.0))\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20material.emission\x20=\x20sidesColor.rgb;\x0a\x20\x20\x20\x20material.alpha\x20=\x20sidesColor.a*\x20globalAlpha;\x0a\x20\x20\x20\x20return\x20material;\x0a\x20\x20}\x0a\x0a\x20\x20discard;\x0a}\x0a',WallScrollMaterial='uniform\x20sampler2D\x20image;\x0auniform\x20float\x20speed;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20count;\x0auniform\x20bool\x20axisY;\x0auniform\x20bool\x20reverse;\x0auniform\x20bool\x20bloom;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(axisY)\x20{\x0a\x20\x20\x20\x20if(reverse)\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.s\x20-\x20time)));\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.s\x20+\x20time)));\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20if(reverse)\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.t\x20-\x20time)));\x0a\x20\x20\x20\x20else\x0a\x20\x20\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(float(count)\x20*\x20st.t\x20+\x20time)));\x0a\x20\x20}\x0a\x0a\x20\x20float\x20perDis\x20=\x201.0\x20/\x20count\x20/\x203.0;\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20smoothstep(.2,\x201.,\x20distance(st.t\x20*\x20perDis,\x201.\x20+\x20perDis))\x20*\x20globalAlpha;\x0a\x0a\x20\x20if(bloom)\x20{\x0a\x20\x20\x20\x20//泛光\x0a\x20\x20\x20\x20vec4\x20fragColor;\x0a\x20\x20\x20\x20fragColor.rgb\x20=\x20(colorImage.rgb\x20+\x20color.rgb)\x20/\x201.0;\x0a\x20\x20\x20\x20fragColor\x20=\x20czm_gammaCorrect(fragColor);\x0a\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20\x20\x20material.emission\x20=\x20fragColor.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x201.5,\x20color.rgb);\x0a\x20\x20\x20\x20material.emission\x20=\x20max(color.rgb\x20*\x20material.alpha\x20*\x201.5,\x20color.rgb);\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',ScanLineMaterial=_0x3d5d32(0x38c),CircleScanMaterial=_0x3d5d32(0xbfb),CircleWaveMaterial='uniform\x20float\x20globalAlpha;\x0auniform\x20vec4\x20color;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.diffuse\x20=\x201.5\x20*\x20color.rgb;\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20dis\x20=\x20distance(st,\x20vec2(0.5,\x200.5));\x0a\x20\x20float\x20currTime;\x0a\x20\x20if(time\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20currTime\x20=\x20speed\x20*\x20czm_frameNumber\x20/\x201000.0;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20currTime\x20=\x20time;\x0a\x20\x20}\x0a\x0a\x20\x20float\x20per\x20=\x20fract(currTime);\x0a\x20\x20if(count\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20if(dis\x20>\x20per\x20*\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20color.a\x20*\x20dis\x20/\x20per\x20/\x202.0\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20vec3\x20str\x20=\x20materialInput.str;\x0a\x20\x20\x20\x20if(abs(str.z)\x20>\x200.001)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(dis\x20>\x200.5)\x20{\x0a\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20float\x20perDis\x20=\x200.5\x20/\x20count;\x0a\x20\x20\x20\x20\x20\x20float\x20disNum;\x0a\x20\x20\x20\x20\x20\x20float\x20bl\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20for(float\x20i\x20=\x200.0;\x20i\x20<=\x2099.0;\x20i+=1.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(i\x20<=\x20count)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20disNum\x20=\x20perDis\x20*\x20i\x20-\x20dis\x20+\x20per\x20/\x20count;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(disNum\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(disNum\x20<\x20perDis)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bl\x20=\x201.0\x20-\x20disNum\x20/\x20perDis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if(disNum\x20-\x20perDis\x20<\x20perDis)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bl\x20=\x201.0\x20-\x20abs(1.0\x20-\x20disNum\x20/\x20perDis);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20pow(bl,\x20(1.0\x20+\x2010.0\x20*\x20(1.0\x20-\x20gradient)))\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',RadarLineMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st\x20*\x202.0\x20-\x201.0;\x0a\x20\x20float\x20t\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0;\x0a\x20\x20vec3\x20col\x20=\x20vec3(0.0);\x0a\x20\x20vec2\x20p\x20=\x20vec2(sin(t),\x20cos(t));\x0a\x20\x20float\x20d\x20=\x20length(st\x20-\x20dot(p,\x20st)\x20*\x20p);\x0a\x20\x20if(dot(st,\x20p)\x20<\x200.)\x20{\x0a\x20\x20\x20\x20d\x20=\x20length(st);\x0a\x20\x20}\x0a\x0a\x20\x20col\x20=\x20.006\x20/\x20d\x20*\x20color.rgb;\x0a\x0a\x20\x20if(distance(st,\x20vec2(0))\x20>\x200.99)\x20{\x0a\x20\x20\x20\x20col\x20=\x20color.rgb;\x0a\x20\x20}\x0a\x0a\x20\x20material.alpha\x20=\x20pow(length(col),\x202.0)\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20col\x20*\x203.0;\x0a\x20\x20return\x20material;\x0a}\x0a',RadarWaveMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0a#define\x20PI\x203.14159265359\x0a\x0afloat\x20rand(vec2\x20co)\x20{\x0a\x20\x20return\x20fract(sin(dot(co.xy,\x20vec2(12.9898,\x2078.233)))\x20*\x2043758.5453);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20pos\x20=\x20st\x20-\x20vec2(0.5);\x0a\x20\x20float\x20time\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0;\x0a\x20\x20float\x20r\x20=\x20length(pos);\x0a\x20\x20float\x20t\x20=\x20atan(pos.y,\x20pos.x)\x20-\x20time\x20*\x202.5;\x0a\x20\x20float\x20a\x20=\x20(atan(sin(t),\x20cos(t))\x20+\x20PI)\x20/\x20(2.0\x20*\x20PI);\x0a\x20\x20float\x20ta\x20=\x200.5;\x0a\x20\x20float\x20v\x20=\x20smoothstep(ta\x20-\x200.05,\x20ta\x20+\x200.05,\x20a)\x20*\x20smoothstep(ta\x20+\x200.05,\x20ta\x20-\x200.05,\x20a);\x0a\x20\x20vec3\x20flagColor\x20=\x20color.rgb\x20*\x20v;\x0a\x20\x20float\x20blink\x20=\x20pow(sin(time\x20*\x201.5)\x20*\x200.5\x20+\x200.5,\x200.8);\x0a\x20\x20flagColor\x20=\x20color.rgb\x20*\x20pow(a,\x208.0\x20*\x20(.2\x20+\x20blink))\x20*\x20(sin(r\x20*\x20500.0)\x20*\x20.5\x20+\x20.5);\x0a\x20\x20flagColor\x20=\x20flagColor\x20*\x20pow(r,\x200.4);\x0a\x20\x20material.alpha\x20=\x20length(flagColor)\x20*\x201.3\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20flagColor\x20*\x203.0;\x0a\x20\x20return\x20material;\x0a}\x0a',RectSlideMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0),\x20fract(st.t)));\x0a\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20if(pure)\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20diffusePower\x20*\x20color.rgb;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20}\x0a\x20\x20return\x20material;\x0a}\x0a',EllipsoidElectricMaterial='precision\x20highp\x20float;\x0aprecision\x20highp\x20int;\x0a\x0a#define\x20pi\x203.1415926535\x0a#define\x20PI2RAD\x200.01745329252\x0a#define\x20TWO_PI\x20(2.\x20*\x20PI)\x0a\x0auniform\x20vec4\x20marscolor;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0afloat\x20time;\x0afloat\x20rands(float\x20p)\x20{\x0a\x20\x20return\x20fract(sin(p)\x20*\x2010000.0);\x0a}\x0afloat\x20noise(vec2\x20p)\x20{\x0a\x20\x20float\x20t\x20=\x20time\x20/\x2020000.0;\x0a\x20\x20if(t\x20>\x201.0)\x0a\x20\x20\x20\x20t\x20-=\x20floor(t);\x0a\x20\x20return\x20rands(p.x\x20*\x2014.\x20+\x20p.y\x20*\x20sin(t)\x20*\x200.5);\x0a}\x0avec2\x20sw(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(floor(p.x),\x20floor(p.y));\x0a}\x0avec2\x20se(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(ceil(p.x),\x20floor(p.y));\x0a}\x0avec2\x20nw(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(floor(p.x),\x20ceil(p.y));\x0a}\x0avec2\x20ne(vec2\x20p)\x20{\x0a\x20\x20return\x20vec2(ceil(p.x),\x20ceil(p.y));\x0a}\x0afloat\x20smoothNoise(vec2\x20p)\x20{\x0a\x20\x20vec2\x20inter\x20=\x20smoothstep(0.0,\x201.0,\x20fract(p));\x0a\x20\x20float\x20s\x20=\x20mix(noise(sw(p)),\x20noise(se(p)),\x20inter.x);\x0a\x20\x20float\x20n\x20=\x20mix(noise(nw(p)),\x20noise(ne(p)),\x20inter.x);\x0a\x20\x20return\x20mix(s,\x20n,\x20inter.y);\x0a}\x0afloat\x20fbm(vec2\x20p)\x20{\x0a\x20\x20float\x20z\x20=\x202.0;\x0a\x20\x20float\x20rz\x20=\x200.0;\x0a\x20\x20vec2\x20bp\x20=\x20p;\x0a\x20\x20for(float\x20i\x20=\x201.0;\x20i\x20<\x206.0;\x20i++)\x20{\x0a\x20\x20\x20\x20rz\x20+=\x20abs((smoothNoise(p)\x20-\x200.5)\x20*\x202.0)\x20/\x20z;\x0a\x20\x20\x20\x20z\x20*=\x202.0;\x0a\x20\x20\x20\x20p\x20*=\x202.0;\x0a\x20\x20}\x0a\x20\x20return\x20rz;\x0a}\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20time\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x20100.0;\x0a\x0a\x20\x20vec2\x20uv\x20=\x20vUv;\x0a\x20\x20vec2\x20uv2\x20=\x20vUv;\x0a\x20\x20//\x20if\x20(uv.y\x20<\x200.5)\x20{\x0a\x20\x20//\x20\x20\x20\x20\x20discard;\x0a\x20\x20//\x20}\x0a\x20\x20uv\x20*=\x204.;\x0a\x20\x20float\x20rz\x20=\x20fbm(uv);\x0a\x20\x20uv\x20/=\x20exp(mod(time\x20*\x202.0,\x20pi));\x0a\x20\x20rz\x20*=\x20pow(15.,\x201.0);\x0a\x20\x20vec4\x20marscolor\x20=\x20mix(vec4(color.rgb,\x201.0)\x20/\x20rz,\x20vec4(color.rgb,\x200.1),\x200.5);\x0a\x20\x20if(uv2.x\x20<\x200.05)\x20{\x0a\x20\x20\x20\x20marscolor\x20=\x20mix(vec4(color.rgb,\x200.1),\x20marscolor,\x20uv2.x\x20/\x200.05);\x0a\x20\x20}\x0a\x20\x20if(uv2.x\x20>\x200.95)\x20{\x0a\x20\x20\x20\x20marscolor\x20=\x20mix(marscolor,\x20vec4(color.rgb,\x200.1),\x20(uv2.x\x20-\x200.95)\x20/\x200.05);\x0a\x20\x20}\x0a\x0a\x20\x20material.alpha\x20=\x20marscolor.a\x20*\x202.0\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20max(marscolor.rgb\x20+\x20marscolor.rgb\x20*\x20material.alpha,\x20marscolor.rgb);\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',EllipsoidWaveMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20speed;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20*\x20speed\x20/\x201000.0);\x0a\x20\x20float\x20alpha\x20=\x20abs(smoothstep(0.5,\x201.,\x20fract(-st.t\x20-\x20time)));\x0a\x20\x20alpha\x20+=\x20.1;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a',PolyGradientMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20diffusePower;\x0auniform\x20float\x20alphaPower;\x0auniform\x20float\x20globalAlpha;\x0auniform\x20vec2\x20center;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20alpha\x20=\x20distance(st,\x20center);\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20alpha\x20*\x20alphaPower\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb\x20*\x20diffusePower;\x0a\x20\x20return\x20material;\x0a}\x0a',AsphaltMaterial='uniform\x20vec4\x20color;\x0auniform\x20float\x20size;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20//Main\x20cellular\x20pattern\x0a\x20\x20vec4\x20color\x20=\x20color;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(st\x20/\x20size);\x0a\x20\x20color.rgb\x20-=\x20(F.x\x20/\x20F.y)\x20*\x200.1;\x0a\x0a\x20\x20//Extra\x20bumps\x20for\x20frequency\x0a\x20\x20float\x20noise\x20=\x20czm_snoise(st\x20/\x20size);\x0a\x20\x20noise\x20=\x20pow(noise,\x205.0)\x20*\x20frequency;\x0a\x20\x20color.rgb\x20+=\x20noise;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',BlobMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(materialInput.st\x20*\x20frequency);\x0a\x20\x20float\x20t\x20=\x201.0\x20-\x20F.x\x20*\x20F.x;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20t);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',FacetMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//\x20From\x20Stefan\x20Gustavson\x27s\x20Procedural\x20Textures\x20in\x20GLSL\x20in\x20OpenGL\x20Insights\x0a\x20\x20vec2\x20F\x20=\x20czm_cellular(materialInput.st\x20*\x20frequency);\x0a\x20\x20float\x20t\x20=\x200.1\x20+\x20(F.y\x20-\x20F.x);\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20t);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',PolyGrassMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20noise1\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x201.0))\x20*\x201.0;\x0a\x20\x20float\x20noise2\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x202.0))\x20*\x200.5;\x0a\x20\x20float\x20noise3\x20=\x20(czm_snoise(st\x20*\x20frequency\x20*\x204.0))\x20*\x200.25;\x0a\x20\x20float\x20noise\x20=\x20sin(noise1\x20+\x20noise2\x20+\x20noise3)\x20*\x200.1;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20noise);\x0a\x0a\x20\x20//Make\x20thatch\x20patterns\x0a\x20\x20float\x20verticalNoise\x20=\x20czm_snoise(vec2(st.x\x20*\x20100.0,\x20st.y\x20*\x2020.0))\x20*\x200.02;\x0a\x20\x20float\x20horizontalNoise\x20=\x20czm_snoise(vec2(st.x\x20*\x2020.0,\x20st.y\x20*\x20100.0))\x20*\x200.02;\x0a\x20\x20float\x20stripeNoise\x20=\x20min(verticalNoise,\x20horizontalNoise);\x0a\x0a\x20\x20color.rgb\x20+=\x20stripeNoise;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',PolyWoodMaterial='uniform\x20vec4\x20evenColor;\x0auniform\x20vec4\x20oddColor;\x0auniform\x20float\x20frequency;\x0auniform\x20vec2\x20noiseScale;\x0auniform\x20float\x20grainFrequency;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20//Based\x20on\x20wood\x20shader\x20from\x20OpenGL\x20Shading\x20Language\x20(3rd\x20edition)\x20pg.\x20455\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x0a\x20\x20vec2\x20noisevec;\x0a\x20\x20noisevec.x\x20=\x20czm_snoise(st\x20*\x20noiseScale.x);\x0a\x20\x20noisevec.y\x20=\x20czm_snoise(st\x20*\x20noiseScale.y);\x0a\x0a\x20\x20vec2\x20location\x20=\x20st\x20+\x20noisevec;\x0a\x20\x20float\x20dist\x20=\x20sqrt(location.x\x20*\x20location.x\x20+\x20location.y\x20*\x20location.y);\x0a\x20\x20dist\x20*=\x20frequency;\x0a\x0a\x20\x20float\x20r\x20=\x20fract(dist\x20+\x20noisevec[0]\x20+\x20noisevec[1])\x20*\x202.0;\x0a\x20\x20if(r\x20>\x201.0)\x0a\x20\x20\x20\x20r\x20=\x202.0\x20-\x20r;\x0a\x0a\x20\x20vec4\x20color\x20=\x20mix(evenColor,\x20oddColor,\x20r);\x0a\x0a\x20\x20//streaks\x0a\x20\x20r\x20=\x20abs(czm_snoise(vec2(st.x\x20*\x20grainFrequency,\x20st.y\x20*\x20grainFrequency\x20*\x200.02)))\x20*\x200.2;\x0a\x20\x20color.rgb\x20+=\x20evenColor.rgb\x20*\x20r;\x0a\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',ImageMaterial='uniform\x20sampler2D\x20image;\x0auniform\x20float\x20opacity;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20globalAlpha;\x0auniform\x20bool\x20flipx;\x0auniform\x20bool\x20flipy;\x0auniform\x20bool\x20noWhite;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20if(flipx){\x0a\x20\x20\x20\x20st.x\x20=\x20st.x\x20+\x20(0.5\x20-\x20st.x)\x20*\x202.0;\x0a\x20\x20}\x0a\x20\x20if(flipy){\x0a\x20\x20\x20\x20st.y\x20=\x20st.y\x20+\x20(0.5\x20-\x20st.y)\x20*\x202.0;\x0a\x20\x20}\x0a\x0a\x20\x20vec4\x20colorImage;\x0a\x20\x20if(speed\x20!=\x200.0)\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20vec2(fract(st.s\x20+\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0),\x20fract(st.t)));\x0a\x20\x20else\x0a\x20\x20\x20\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x0a\x20\x20if(noWhite\x20&&\x20colorImage.rgb\x20==\x20vec3(1.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20opacity\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb\x20*\x20color.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a',WaterLightMaterial=_0x3d5d32(0xff4),NeonLightMaterial='uniform\x20float\x20globalAlpha;\x0a\x0afloat\x20marsstepping(float\x20t)\x20{\x0a\x20\x20if(t\x20<\x200.)\x0a\x20\x20\x20\x20return\x20-1.\x20+\x20pow(1.\x20+\x20t,\x202.);\x0a\x20\x20else\x0a\x20\x20\x20\x20return\x201.\x20-\x20pow(1.\x20-\x20t,\x202.);\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20vUv\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20uv\x20=\x202.\x20*\x20vUv.xy\x20-\x20vec2(1.,\x201.);\x0a\x0a\x20\x20uv\x20*=\x202.0;\x0a\x20\x20vec4\x20fragColor\x20=\x20vec4(0.);\x0a\x20\x20uv\x20=\x20normalize(uv)\x20*\x20length(uv);\x0a\x0a\x20\x20float\x20time\x20=\x20czm_frameNumber\x20/\x20speed;\x0a\x20\x20for(float\x20i\x20=\x200.0;\x20i\x20<\x2012.0;\x20i+=1.0)\x20{\x0a\x20\x20\x20\x20float\x20t\x20=\x20time\x20+\x20i\x20*\x203.141592\x20/\x2012.\x20*\x20(5.\x20+\x201.\x20*\x20marsstepping(sin(time\x20*\x203.)));\x0a\x20\x20\x20\x20vec2\x20p\x20=\x20vec2(cos(t),\x20sin(t));\x0a\x20\x20\x20\x20p\x20*=\x20cos(time\x20+\x20i\x20*\x203.141592\x20*\x20cos(time\x20/\x208.));\x0a\x20\x20\x20\x20vec3\x20col\x20=\x20cos(vec3(0,\x201,\x20-1)\x20*\x203.141592\x20*\x202.\x20/\x203.\x20+\x203.141925\x20*\x20(time\x20/\x202.\x20+\x20i\x20/\x205.))\x20*\x200.5\x20+\x200.5;\x0a\x20\x20\x20\x20fragColor\x20+=\x20vec4(0.05\x20/\x20length(uv\x20-\x20p\x20*\x200.9)\x20*\x20col,\x201.0);\x0a\x20\x20}\x0a\x20\x20fragColor.xyz\x20=\x20pow(fragColor.xyz,\x20vec3(3.));\x0a\x20\x20fragColor.w\x20=\x201.0;\x0a\x0a\x20\x20vec4\x20baseColor\x20=\x20vec4(fragColor.rgb\x20+\x20color.rgb\x20*\x202.0,\x20fragColor.r\x20*\x200.2);\x0a\x20\x20material.alpha\x20=\x20baseColor.a\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20baseColor.rgb;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a';Cesium__namespace['ShaderSource']['_czmBuiltinsAndUniforms']['czm_cellular']=czm_cellular,Cesium__namespace['ShaderSource']['_czmBuiltinsAndUniforms']['czm_snoise']=czm_snoise,register$3(LineDotDash,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x1,0x1),'gapColor':new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),'dashLength':0x10,'dashPattern':0xff},'source':LineDotDashMaterial},'translucent':!![]}),register$3(LineFlow,{'fabric':{'uniforms':{'image':Cesium__namespace[_0x3d5d32(0xc6b)]['DefaultImageId'],'color':new Cesium__namespace['Color'](0x1,0x1,0x1,0x0),'repeat':new Cesium__namespace['Cartesian2'](0x1,0x1),'axisY':![],'mixt':![],'speed':0xa,'time':-0x1,'hasImage2':![],'image2':Cesium__namespace['Material'][_0x3d5d32(0x237)],'color2':new Cesium__namespace['Color'](0x1,0x1,0x1),'globalAlpha':0x1},'source':LineFlowMaterial},'translucent':!![]}),register$3(LineFlowColor,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x3d5d32(0x882))](0x1,0x0,0x0,0.7),'startTime':0x0,'speed':0x2,'percent':0.04,'alpha':0.1,'globalAlpha':0x1},'source':LineFlowColorMaterial},'translucent':!![]}),register$3(ODLine,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x0,0.7),'startTime':0x0,'speed':0x14,'bgColor':new Cesium__namespace['Color'](0x1,0x1,0x0,0.1),'bidirectional':0x0,'globalAlpha':0x1},'source':ODLineMaterial},'translucent':!![]}),register$3(LineFlicker,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0.7),'speed':0xa,'globalAlpha':0x1},'source':LineFlickerMaterial},'translucent':!![]}),register$3(LineTrail,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0.7),'bgColor':new Cesium__namespace[(_0x3d5d32(0x882))](0x0,0x0,0x0,0x0),'speed':0x5,'globalAlpha':0x1},'source':LineTrailMaterial},'translucent':!![]}),register$3(LineBloom,{'fabric':{'uniforms':{'color':Cesium__namespace['Color'][_0x3d5d32(0x1036)],'glow':0x1,'speed':0x5,'globalAlpha':0x1},'source':LineBloomMaterial},'translucent':!![]}),register$3(DigitalFlow,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x0,0x0,0.8),'image':Cesium__namespace['Material']['DefaultImageId'],'speed':0xa,'glow':0xa,'flowGlow':0x1,'segment':0x3,'globalAlpha':0x1},'source':DigitalFlowMaterial},'translucent':!![]}),register$3(LineThreeDash,{'fabric':{'uniforms':{'color':Cesium__namespace['Color'][_0x3d5d32(0xcab)],'dashLength':0x40,'widthRatio':0.1,'sidesColor':Cesium__namespace['Color'][_0x3d5d32(0x7a7)],'sidesDashLength':0x20,'sidesWidthRatio':0.1,'dashPattern':0xff,'globalAlpha':0x1},'source':LineThreeDashMaterial},'translucent':!![]}),register$3(WallScroll,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x0,0x0,0x1),'image':Cesium__namespace['Material']['DefaultImageId'],'count':0x1,'speed':0x5,'reverse':![],'axisY':![],'bloom':![],'globalAlpha':0x1},'source':WallScrollMaterial},'translucent':!![]}),register$3(ScanLine,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'speed':0xa,'globalAlpha':0x1},'source':ScanLineMaterial},'translucent':!![]}),register$3(CircleScan,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x0,0x0,0x1),'image':Cesium__namespace[_0x3d5d32(0xc6b)]['DefaultImageId'],'globalAlpha':0x1},'source':CircleScanMaterial},'translucent':!![]}),register$3(CircleWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'speed':0xa,'time':-0x1,'count':0x1,'gradient':0.1,'globalAlpha':0x1},'source':CircleWaveMaterial},'translucent':!![]}),register$3(RadarLine,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x3d5d32(0x882))](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':RadarLineMaterial},'translucent':!![]}),register$3(RadarWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':RadarWaveMaterial},'translucent':!![]}),register$3(RectSlide,{'fabric':{'uniforms':{'image':Cesium__namespace['Material'][_0x3d5d32(0x237)],'color':Cesium__namespace['Color'][_0x3d5d32(0x7a7)],'speed':0xa,'pure':![],'diffusePower':1.3,'globalAlpha':0x1},'source':RectSlideMaterial},'translucent':!![]}),register$3(EllipsoidElectric,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x3d5d32(0x882))](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':EllipsoidElectricMaterial},'translucent':!![]}),register$3(EllipsoidWave,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x3d5d32(0x882))](0x0,0x1,0x1,0.7),'speed':0x5,'globalAlpha':0x1},'source':EllipsoidWaveMaterial},'translucent':!![]}),register$3(PolyGradient,{'fabric':{'uniforms':{'color':new Cesium__namespace[(_0x3d5d32(0x882))](0x1,0x1,0x0,0.5),'diffusePower':1.6,'alphaPower':1.5,'center':new Cesium__namespace['Cartesian2'](0.5,0.5),'globalAlpha':0x1},'source':PolyGradientMaterial},'translucent':!![]}),register$3(PolyAsphalt,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0.15,0.15,0.15,0x1),'size':0.02,'frequency':0.2,'globalAlpha':0x1},'source':AsphaltMaterial},'translucent':function(_0x22138d){return _0x22138d['uniforms']['color']['alpha']<0x1;}}),register$3(PolyBlob,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace[(_0x3d5d32(0x882))](0x1,0x1,0x1,0.5),'oddColor':new Cesium__namespace['Color'](0x0,0x0,0x1,0.5),'frequency':0xa,'globalAlpha':0x1},'source':BlobMaterial},'translucent':function(_0x1fdc33){const _0x3b6621={_0x2e2e5a:0x498},_0x1b9bf8=_0x3d5d32,_0x4ec81d=_0x1fdc33['uniforms'];return _0x4ec81d[_0x1b9bf8(_0x3b6621._0x2e2e5a)]['alpha']<0x1||_0x4ec81d['oddColor']['alpha']<0x0;}}),register$3(PolyFacet,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.25,0.25,0.25,0.75),'oddColor':new Cesium__namespace['Color'](0.75,0.75,0.75,0.75),'frequency':0xa,'globalAlpha':0x1},'source':FacetMaterial},'translucent':function(_0x29b0ba){const _0x50ebb0=_0x29b0ba['uniforms'];return _0x50ebb0['evenColor']['alpha']<0x1||_0x50ebb0['oddColor']['alpha']<0x0;}}),register$3(PolyGrass,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.25,0.4,0.1,0x1),'oddColor':new Cesium__namespace[(_0x3d5d32(0x882))](0.1,0.1,0.1,0x1),'frequency':1.5,'globalAlpha':0x1},'source':PolyGrassMaterial},'translucent':function(_0x5b1cd0){const _0x1f1f80={_0x2d87ab:0x457},_0x39d9ff=_0x3d5d32,_0x400e15=_0x5b1cd0['uniforms'];return _0x400e15['evenColor']['alpha']<0x1||_0x400e15[_0x39d9ff(_0x1f1f80._0x2d87ab)]['alpha']<0x1;}}),register$3(PolyWood,{'fabric':{'uniforms':{'evenColor':new Cesium__namespace['Color'](0.6,0.3,0.1,0x1),'oddColor':new Cesium__namespace['Color'](0.4,0.2,0.07,0x1),'frequency':0x3,'noiseScale':new Cesium__namespace['Cartesian2'](0.7,0.5),'grainFrequency':0x1b,'globalAlpha':0x1},'source':PolyWoodMaterial},'translucent':function(_0x39f4ab){const _0x355e49=_0x39f4ab['uniforms'];return _0x355e49['evenColor']['alpha']<0x1||_0x355e49['oddColor']['alpha']<0x1;}}),register$3(Image2,{'fabric':{'uniforms':{'image':Cesium__namespace['Material'][_0x3d5d32(0x237)],'color':Cesium__namespace['Color']['WHITE'],'opacity':0x1,'speed':0x0,'flipx':![],'flipy':![],'noWhite':!![],'globalAlpha':0x1},'source':ImageMaterial},'translucent':!![]}),register$3(WaterLight,{'fabric':{'uniforms':{'alpha':0.3,'specularMap':Cesium__namespace['Material']['DefaultImageId'],'normalMap':Cesium__namespace['buildModuleUrl'](_0x3d5d32(0x726)),'globalAlpha':0x1},'source':WaterLightMaterial},'translucent':!![]}),register$3(NeonLight,{'fabric':{'uniforms':{'color':Cesium__namespace['Color']['WHITE'],'speed':0x1,'globalAlpha':0x1},'source':NeonLightMaterial},'translucent':!![]}),registerPropertyClass(Color$2,Cesium__namespace['ColorMaterialProperty']),registerPropertyClass(Image$1,Cesium__namespace['ImageMaterialProperty']),registerPropertyClass(PolylineArrow,Cesium__namespace['PolylineArrowMaterialProperty']),registerPropertyClass(PolylineOutline,Cesium__namespace['PolylineOutlineMaterialProperty']),registerPropertyClass(PolylineDash,Cesium__namespace['PolylineDashMaterialProperty']),registerPropertyClass(PolylineGlow,Cesium__namespace[_0x3d5d32(0x107a)]),registerPropertyClass(Grid,Cesium__namespace[_0x3d5d32(0x82d)]),registerPropertyClass(Checkerboard,Cesium__namespace['CheckerboardMaterialProperty']),registerPropertyClass(Stripe,Cesium__namespace['StripeMaterialProperty']);class TextMaterial extends Cesium__namespace['Material']{constructor(_0x478f04={}){super(conventOptions$1(_0x478f04));}}function conventOptions$1(_0x18f3b2){const _0x565409=_0x3d5d32,_0x1cc93a=_0x18f3b2['text'];_0x18f3b2['font_size']=_0x18f3b2[_0x565409(0x1ed)]||0x46;const _0x51799f=LabelStyleConver['toCesiumVal'](_0x18f3b2,{'fill':!![],'fillColor':new Cesium__namespace['Color'](0x1,0x1,0x0,0x1),'textBaseline':'middle','padding':0xa}),_0x551d17=getTextImage(_0x1cc93a,_0x51799f);let _0x4addd7;return _0x551d17&&(_0x4addd7=_0x551d17['toDataURL']('image/png')),{'fabric':{'uniforms':{'image':_0x4addd7,'opacity':0x1,'color':Cesium__namespace[_0x565409(0x882)]['WHITE'],'speed':_0x18f3b2['speed']||0x0,'flipx':![],'flipy':![],'noWhite':!![],'globalAlpha':0x1},'source':ImageMaterial},'translucent':!![]};}registerClass(Text,TextMaterial);var CylinderWaveMaterialGlsl='uniform\x20vec4\x20color;\x0auniform\x20float\x20repeat;\x0auniform\x20float\x20offset;\x0auniform\x20float\x20thickness;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20float\x20sp\x20=\x201.0\x20/\x20repeat;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20dis\x20=\x20distance(st,\x20vec2(0.5));\x0a\x20\x20float\x20m\x20=\x20mod(dis\x20+\x20offset,\x20sp);\x0a\x20\x20float\x20a\x20=\x20step(sp\x20*\x20(1.0\x20-\x20thickness),\x20m);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20a\x20*\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a';class CylinderWaveMaterial extends Cesium__namespace['Material']{constructor(_0x26c6ae={}){const _0x4e8b0c={_0x5902bc:0xf83},_0x200351=_0x3d5d32;super(conventOptions(_0x26c6ae)),this['_frameTime']=0x3e8/(_0x26c6ae['frameRate']||0x3c),this[_0x200351(_0x4e8b0c._0x5902bc)]=_0x26c6ae['speed']??0xa;const _0x36fbf4=this;let _0x121d41=Date['now']();(function _0x33318b(){const _0x2d4b72=_0x200351;_0x36fbf4['animateFrame']=window[_0x2d4b72(0xdf6)](_0x33318b);const _0x1360d3=Date['now'](),_0x37650d=_0x1360d3-_0x121d41;_0x37650d>_0x36fbf4['_frameTime']&&(_0x121d41=_0x1360d3-_0x37650d%_0x36fbf4['_frameTime'],_0x36fbf4[_0x2d4b72(0xb9c)]());}());}['updateOffset'](){const _0x3400ea={_0x3d0299:0xfe3},_0x676d1e=_0x3d5d32;let _0x2cdb6c=this[_0x676d1e(_0x3400ea._0x3d0299)]['offset'];_0x2cdb6c-=0.0001*this['_speed'],_0x2cdb6c>0x1&&(_0x2cdb6c=0x0),this['uniforms']['offset']=_0x2cdb6c;}['destroy'](_0x80f3cd){const _0x348dc0={_0x4140f4:0x3ed},_0x125fee=_0x3d5d32;return window[_0x125fee(_0x348dc0._0x4140f4)](this['animateFrame']),delete this[_0x125fee(0xe89)],super['destroy'](_0x80f3cd);}}function conventOptions(_0x586d3f){const _0x9870e2={_0x47c6c6:0xf9b},_0x39aa97=_0x3d5d32;return{'fabric':{'uniforms':{'color':getCesiumColor(_0x586d3f['color'],new Cesium__namespace['Color'](0x2,0x1,0x0,0.8)),'repeat':_0x586d3f['repeat']??0x1e,'thickness':_0x586d3f['thickness']??0.3,'offset':_0x586d3f[_0x39aa97(_0x9870e2._0x47c6c6)]??0x0,'globalAlpha':0x1},'source':CylinderWaveMaterialGlsl},'translucent':function(_0x5bd27f){return _0x5bd27f['uniforms']['color']['alpha']<0x1;}};}registerClass(CylinderWave,CylinderWaveMaterial);class BaseMaterialProperty{constructor(_0x40d091={}){const _0x326607={_0x4c1fc0:0x433},_0x50d1a6=_0x3d5d32;this[_0x50d1a6(_0x326607._0x4c1fc0)]=_0x40d091,this[_0x50d1a6(0xbef)]=new Cesium__namespace['Event']();}get['isConstant'](){return!![];}get['definitionChanged'](){return this['_definitionChanged'];}['getType'](_0xb43001){return null;}['getValue'](_0xf645d1,_0x32bd87={}){return _0x32bd87;}['equals'](_0xf5496b){return this===_0xf5496b;}}class CircleScanMaterialProperty extends BaseMaterialProperty{constructor(_0x30fe9e={}){const _0x38aa08={_0x3c8ae3:0x5ee,_0x57157e:0xe8f},_0x535d0f=_0x3d5d32;super(_0x30fe9e),this['image']=_0x30fe9e['image']??_0x30fe9e[_0x535d0f(_0x38aa08._0x3c8ae3)],this[_0x535d0f(_0x38aa08._0x57157e)]=_0x30fe9e['color'],this['globalAlpha']=_0x30fe9e['globalAlpha']??0x1;}['getType'](_0x4e678a){return CircleScan;}[_0x3d5d32(0xfbe)](_0x32c465,_0x5cf394){const _0x27e8ba={_0x7dce28:0x882},_0x3cd0b1=_0x3d5d32;return!Cesium__namespace['defined'](_0x5cf394)&&(_0x5cf394={}),_0x5cf394['color']=getCesiumColor(this['color'],new Cesium__namespace[(_0x3cd0b1(_0x27e8ba._0x7dce28))](0x1,0x0,0x0,0.5),_0x32c465),_0x5cf394['image']=this['image'],_0x5cf394[_0x3cd0b1(0xc96)]=this[_0x3cd0b1(0xc96)],_0x5cf394;}['equals'](_0x93f4b3){const _0x48de83={_0x23d8f0:0x71f},_0x1d4221=_0x3d5d32;return this===_0x93f4b3||_0x93f4b3 instanceof CircleScanMaterialProperty&&Cesium__namespace['Property'][_0x1d4221(_0x48de83._0x23d8f0)](this['color'],_0x93f4b3['color'])&&this['image']===_0x93f4b3['image'];}}registerPropertyClass(CircleScan,CircleScanMaterialProperty);class CircleWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x730389={}){const _0x5b9ed8={_0x4bc1fa:0xd69},_0x26247f=_0x3d5d32;super(_0x730389),this['color']=_0x730389['color'],this['speed']=_0x730389['speed']??0xa,this['duration']=_0x730389['duration'],this['count']=_0x730389['count']??0x1,this[_0x26247f(0xd69)]=_0x730389['gradient']??0.1,this['globalAlpha']=_0x730389['globalAlpha']??0x1,this[_0x26247f(0xc25)]<=0x0&&(this[_0x26247f(0xc25)]=0x1),this[_0x26247f(_0x5b9ed8._0x4bc1fa)]<0x0&&(this[_0x26247f(0xd69)]=0x0),this[_0x26247f(0xd69)]>0x1&&(this['gradient']=0x1);}[_0x3d5d32(0xbf9)](_0x3422f3){return CircleWave;}['getValue'](_0x54e2c9,_0x20caaf){const _0x423452={_0x43cbda:0xe8f,_0x228943:0xd69},_0x518b57=_0x3d5d32;return!Cesium__namespace['defined'](_0x20caaf)&&(_0x20caaf={}),_0x20caaf[_0x518b57(_0x423452._0x43cbda)]=getCesiumColor(this['color'],Cesium__namespace['Color']['YELLOW'],_0x54e2c9),_0x20caaf[_0x518b57(0xc25)]=this[_0x518b57(0xc25)],_0x20caaf['gradient']=this[_0x518b57(_0x423452._0x228943)],_0x20caaf['speed']=this[_0x518b57(0x85c)],_0x20caaf['globalAlpha']=this['globalAlpha'],this['duration']?(this['_time']===undefined&&(this[_0x518b57(0xa1d)]=new Date()['getTime']()),_0x20caaf['time']=(new Date()['getTime']()-this['_time'])/(this['duration']*0x3e8)):_0x20caaf['time']=-0x1,_0x20caaf;}[_0x3d5d32(0x71f)](_0x1a6248){const _0x10651b={_0xa154a3:0xc25},_0x870f8d=_0x3d5d32;return this===_0x1a6248||_0x1a6248 instanceof CircleWaveMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x1a6248['color'])&&this[_0x870f8d(_0x10651b._0xa154a3)]===_0x1a6248['count']&&this[_0x870f8d(0x85c)]===_0x1a6248['speed']&&this['gradient']===_0x1a6248['gradient'];}}registerPropertyClass(CircleWave,CircleWaveMaterialProperty),register$3(CylinderWave,{'fabric':{'uniforms':{'color':new Cesium__namespace['Color'](0x2,0x1,0x0,0.8),'repeat':0x1e,'thickness':0.3,'offset':0x0,'globalAlpha':0x1},'source':CylinderWaveMaterialGlsl},'translucent':!![]});class CylinderWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x503c71={}){const _0x469ef2={_0x5bba6a:0xe8f},_0x4c0a0e=_0x3d5d32;super(_0x503c71),this['color']=_0x503c71[_0x4c0a0e(_0x469ef2._0x5bba6a)],this['repeat']=_0x503c71['repeat']??0x1e,this[_0x4c0a0e(0x59a)]=_0x503c71['thickness']??0.3,this['speed']=_0x503c71['speed']??0xa,this[_0x4c0a0e(0xf9b)]=0x0,this[_0x4c0a0e(0xc96)]=_0x503c71['globalAlpha']??0x1;}['getType'](_0x10de21){return CylinderWave;}['getValue'](_0x14beac,_0x154ca1){const _0x31b12c={_0x5c45fe:0xc96},_0x5cfae7=_0x3d5d32;return!Cesium__namespace['defined'](_0x154ca1)&&(_0x154ca1={}),this['offset']-=0.0001*this['speed'],this['offset']>0x1&&(this[_0x5cfae7(0xf9b)]=0x0),_0x154ca1['color']=getCesiumColor(this['color'],new Cesium__namespace['Color'](0x2,0x1,0x0,0.8),_0x14beac),_0x154ca1['repeat']=this['repeat'],_0x154ca1['offset']=this['offset'],_0x154ca1['thickness']=this['thickness'],_0x154ca1[_0x5cfae7(_0x31b12c._0x5c45fe)]=this['globalAlpha'],_0x154ca1;}['equals'](_0x57cb1a){const _0x110172={_0x1f55b4:0xe8f},_0x3168ce=_0x3d5d32;return this===_0x57cb1a||_0x57cb1a instanceof CylinderWaveMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0x3168ce(_0x110172._0x1f55b4)],_0x57cb1a['color'])&&this[_0x3168ce(0xefd)]===_0x57cb1a['repeat']&&this[_0x3168ce(0x59a)]===_0x57cb1a['thickness'];}}registerPropertyClass(CylinderWave,CylinderWaveMaterialProperty);class DigitalFlowMaterialProperty extends BaseMaterialProperty{constructor(_0x1ffabf={}){const _0x5cfcde={_0x86f5ff:0xe8f,_0x268afe:0xdf8},_0x4f54a8=_0x3d5d32;super(_0x1ffabf),this[_0x4f54a8(_0x5cfcde._0x86f5ff)]=getCesiumColor(_0x1ffabf['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['speed']=_0x1ffabf['speed']??0x5,this[_0x4f54a8(_0x5cfcde._0x268afe)]=_0x1ffabf['glow']??0x1,this[_0x4f54a8(0xc55)]=_0x1ffabf['flowGlow']??0x1,this[_0x4f54a8(0x3f0)]=_0x1ffabf['segment']??0x3,this[_0x4f54a8(0xc96)]=_0x1ffabf['globalAlpha']??0x1;}['getType'](_0x17a4cf){return DigitalFlow;}['getValue'](_0x57f1eb,_0x459b3d){const _0x566b83={_0x303f10:0x85c},_0x51f4c8=_0x3d5d32;return!Cesium__namespace['defined'](_0x459b3d)&&(_0x459b3d={}),_0x459b3d[_0x51f4c8(0xe8f)]=this['color'],_0x459b3d['speed']=this[_0x51f4c8(_0x566b83._0x303f10)],_0x459b3d['glow']=this['glow'],_0x459b3d['flowGlow']=this[_0x51f4c8(0xc55)],_0x459b3d['segment']=this['segment'],_0x459b3d['globalAlpha']=this['globalAlpha'],_0x459b3d;}['equals'](_0x518082){const _0x38c61b={_0x4c7cbf:0xe8f},_0x44c02e=_0x3d5d32;return this===_0x518082||_0x518082 instanceof DigitalFlowMaterialProperty&&Cesium__namespace[_0x44c02e(0x6a2)]['equals'](this[_0x44c02e(_0x38c61b._0x4c7cbf)],_0x518082['color'])&&this[_0x44c02e(0xdf8)]===_0x518082['glow']&&this[_0x44c02e(0x85c)]===_0x518082['speed'];}}registerPropertyClass(DigitalFlow,DigitalFlowMaterialProperty);class EllipsoidElectricMaterialProperty extends BaseMaterialProperty{constructor(_0x3f3d97={}){const _0x5039b8={_0x5cdc8f:0xc96},_0x4e55a5=_0x3d5d32;super(_0x3f3d97),this['color']=getCesiumColor(_0x3f3d97[_0x4e55a5(0xe8f)],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['speed']=_0x3f3d97['speed']??0x5,this[_0x4e55a5(_0x5039b8._0x5cdc8f)]=_0x3f3d97['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x4fc1d3){return EllipsoidElectric;}['getValue'](_0x37ec1c,_0x5d7e49){const _0x20f183={_0x4bb17c:0xe8f},_0x442261=_0x3d5d32;return!Cesium__namespace['defined'](_0x5d7e49)&&(_0x5d7e49={}),_0x5d7e49[_0x442261(0xe8f)]=this[_0x442261(_0x20f183._0x4bb17c)],_0x5d7e49['speed']=this['speed'],_0x5d7e49['globalAlpha']=this[_0x442261(0xc96)],_0x5d7e49;}['equals'](_0x323b5f){const _0x343908={_0x164db0:0x71f,_0x59aa25:0x85c},_0x1d2d33=_0x3d5d32;return this===_0x323b5f||_0x323b5f instanceof EllipsoidElectricMaterialProperty&&Cesium__namespace['Property'][_0x1d2d33(_0x343908._0x164db0)](this[_0x1d2d33(0xe8f)],_0x323b5f['color'])&&this[_0x1d2d33(0x85c)]===_0x323b5f[_0x1d2d33(_0x343908._0x59aa25)];}}registerPropertyClass(EllipsoidElectric,EllipsoidElectricMaterialProperty);class EllipsoidWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x1c6e07={}){const _0x47597e={_0x58cf79:0xe8f,_0x1c7433:0x882,_0x40fe21:0xc96},_0x4f9eeb=_0x3d5d32;super(_0x1c6e07),this[_0x4f9eeb(_0x47597e._0x58cf79)]=getCesiumColor(_0x1c6e07['color'],new Cesium__namespace[(_0x4f9eeb(_0x47597e._0x1c7433))](0x0,0x0,0x0,0x0)),this['speed']=_0x1c6e07[_0x4f9eeb(0x85c)]??0x5,this[_0x4f9eeb(0xc96)]=_0x1c6e07[_0x4f9eeb(_0x47597e._0x40fe21)]??0x1;}['getType'](_0x251b2c){return EllipsoidWave;}['getValue'](_0x4b6eae,_0x3b3046){const _0x2fc120={_0x473f29:0xb84,_0x377ffc:0xe8f},_0x231767=_0x3d5d32;return!Cesium__namespace[_0x231767(_0x2fc120._0x473f29)](_0x3b3046)&&(_0x3b3046={}),_0x3b3046['color']=this[_0x231767(_0x2fc120._0x377ffc)],_0x3b3046['speed']=this[_0x231767(0x85c)],_0x3b3046['globalAlpha']=this['globalAlpha'],_0x3b3046;}['equals'](_0x777ab5){const _0x85bf76={_0x81d686:0x6a2},_0xf9181=_0x3d5d32;return this===_0x777ab5||_0x777ab5 instanceof EllipsoidWaveMaterialProperty&&Cesium__namespace[_0xf9181(_0x85bf76._0x81d686)]['equals'](this[_0xf9181(0xe8f)],_0x777ab5['color'])&&this['speed']===_0x777ab5['speed'];}}registerPropertyClass(EllipsoidWave,EllipsoidWaveMaterialProperty);class Image2MaterialProperty extends BaseMaterialProperty{constructor(_0xb5a10e={}){const _0x570091={_0x4dd018:0x8e1,_0x19909b:0xfdc,_0x58b3d6:0xac6},_0x5b874f=_0x3d5d32;super(_0xb5a10e),this['image']=_0xb5a10e[_0x5b874f(_0x570091._0x4dd018)],this['opacity']=_0xb5a10e[_0x5b874f(_0x570091._0x19909b)]??0x1,this['color']=_0xb5a10e['color']??Cesium__namespace['Color']['WHITE'],this['speed']=_0xb5a10e['speed']??0x0,this['flipx']=_0xb5a10e[_0x5b874f(_0x570091._0x58b3d6)]??![],this['flipy']=_0xb5a10e['flipy']??![],this[_0x5b874f(0xb35)]=_0xb5a10e['noWhite']??!![],this['globalAlpha']=_0xb5a10e['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x493943){return Image2;}[_0x3d5d32(0xfbe)](_0x5c2efe,_0x127a5e){const _0x16663b={_0x2f0e38:0xfdc,_0x1686b9:0x9dd},_0x351466=_0x3d5d32;return!Cesium__namespace['defined'](_0x127a5e)&&(_0x127a5e={}),_0x127a5e['image']=this['image'],_0x127a5e['color']=this['color'],_0x127a5e[_0x351466(_0x16663b._0x2f0e38)]=this['opacity'],_0x127a5e['speed']=this['speed'],_0x127a5e[_0x351466(0xac6)]=this['flipx'],_0x127a5e[_0x351466(_0x16663b._0x1686b9)]=this['flipy'],_0x127a5e['noWhite']=this[_0x351466(0xb35)],_0x127a5e['globalAlpha']=this['globalAlpha'],_0x127a5e;}['equals'](_0x1fce27){const _0x15944d={_0x1720e2:0x71f,_0x3b0661:0xfdc,_0x1249ed:0x8e1},_0x5e9d1b=_0x3d5d32;return this===_0x1fce27||_0x1fce27 instanceof Image2MaterialProperty&&Cesium__namespace['Property'][_0x5e9d1b(_0x15944d._0x1720e2)](this['color'],_0x1fce27[_0x5e9d1b(0xe8f)])&&this['opacity']===_0x1fce27[_0x5e9d1b(_0x15944d._0x3b0661)]&&this[_0x5e9d1b(_0x15944d._0x1249ed)]===_0x1fce27['image'];}}registerPropertyClass(Image2,Image2MaterialProperty);class LineBloomMaterialProperty extends BaseMaterialProperty{constructor(_0x2421cd={}){const _0x70b527={_0x1f487d:0xdf8,_0x1e7f85:0xc96},_0x29e678=_0x3d5d32;super(_0x2421cd),this[_0x29e678(0xe8f)]=getCesiumColor(_0x2421cd['color'],new Cesium__namespace[(_0x29e678(0x882))](0x0,0x0,0x0,0x0)),this['speed']=_0x2421cd['speed']??0x5,this[_0x29e678(_0x70b527._0x1f487d)]=_0x2421cd['glow']??0x1,this[_0x29e678(_0x70b527._0x1e7f85)]=_0x2421cd[_0x29e678(0xc96)]??0x1;}['getType'](_0x20a52f){return LineBloom;}['getValue'](_0x1faf29,_0x3faf05){const _0x4bdbfb={_0x59db7c:0xdf8},_0x292886=_0x3d5d32;return!Cesium__namespace['defined'](_0x3faf05)&&(_0x3faf05={}),_0x3faf05['color']=this[_0x292886(0xe8f)],_0x3faf05['speed']=this['speed'],_0x3faf05[_0x292886(_0x4bdbfb._0x59db7c)]=this['glow'],_0x3faf05['globalAlpha']=this[_0x292886(0xc96)],_0x3faf05;}['equals'](_0x2338ae){const _0x103498={_0x10a673:0xe8f},_0x591dbe=_0x3d5d32;return this===_0x2338ae||_0x2338ae instanceof LineBloomMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x2338ae[_0x591dbe(_0x103498._0x10a673)])&&this['glow']===_0x2338ae['glow']&&this['speed']===_0x2338ae['speed'];}}registerPropertyClass(LineBloom,LineBloomMaterialProperty);class LineFlickerMaterialProperty extends BaseMaterialProperty{constructor(_0x5a6358={}){super(_0x5a6358),this['color']=_0x5a6358['color'],this['speed']=_0x5a6358['speed']??0x2,this['globalAlpha']=_0x5a6358['globalAlpha']??0x1;}['getType'](_0xd40a09){return LineFlicker;}['getValue'](_0x544c02,_0x3c03e4){const _0x76ed17=_0x3d5d32;return!Cesium__namespace[_0x76ed17(0xb84)](_0x3c03e4)&&(_0x3c03e4={}),_0x3c03e4['color']=getCesiumColor(this['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0),_0x544c02),_0x3c03e4['speed']=this['speed'],_0x3c03e4['globalAlpha']=this['globalAlpha'],_0x3c03e4;}[_0x3d5d32(0x71f)](_0x4ef4d4){const _0x12c7bb={_0x3580a6:0x6a2},_0xd9b413=_0x3d5d32;return this===_0x4ef4d4||_0x4ef4d4 instanceof LineFlickerMaterialProperty&&Cesium__namespace[_0xd9b413(_0x12c7bb._0x3580a6)]['equals'](this['color'],_0x4ef4d4['color'])&&this['speed']===_0x4ef4d4[_0xd9b413(0x85c)];}}registerPropertyClass(LineFlicker,LineFlickerMaterialProperty);class LineFlowColorMaterialProperty extends BaseMaterialProperty{constructor(_0x28fb6e={}){const _0x2a93df={_0x232654:0xe8f,_0x172410:0x89c,_0x3a707d:0x24b,_0x1596e7:0xc96},_0x50a617=_0x3d5d32;super(_0x28fb6e),this['color']=_0x28fb6e[_0x50a617(_0x2a93df._0x232654)],this['speed']=_0x28fb6e['speed']??0x2,this[_0x50a617(_0x2a93df._0x172410)]=_0x28fb6e['percent']??0.04,this['alpha']=_0x28fb6e[_0x50a617(_0x2a93df._0x3a707d)]??0.1,this[_0x50a617(0xee6)]=_0x28fb6e['startTime']??0x0,this['globalAlpha']=_0x28fb6e[_0x50a617(_0x2a93df._0x1596e7)]??0x1;}['getType'](_0xf626d7){return LineFlowColor;}[_0x3d5d32(0xfbe)](_0x2cad5f,_0x3bed93){const _0x17b428={_0x3dbe43:0x882,_0x3b7634:0x85c},_0x59ac94=_0x3d5d32;return!Cesium__namespace['defined'](_0x3bed93)&&(_0x3bed93={}),_0x3bed93['color']=getCesiumColor(this['color'],new Cesium__namespace[(_0x59ac94(_0x17b428._0x3dbe43))](0x1,0x0,0x0,0x1),_0x2cad5f),_0x3bed93['speed']=this[_0x59ac94(_0x17b428._0x3b7634)],_0x3bed93['percent']=this['percent'],_0x3bed93['alpha']=this['alpha'],_0x3bed93[_0x59ac94(0xee6)]=this['startTime'],_0x3bed93['globalAlpha']=this['globalAlpha'],_0x3bed93;}['equals'](_0x2ad9d9){const _0x2964ef={_0x4e8c75:0xe8f,_0x24ad8c:0x89c},_0x390234=_0x3d5d32;return this===_0x2ad9d9||_0x2ad9d9 instanceof LineFlowColorMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x2ad9d9[_0x390234(_0x2964ef._0x4e8c75)])&&this['speed']===_0x2ad9d9['speed']&&this[_0x390234(_0x2964ef._0x24ad8c)]===_0x2ad9d9['percent']&&this['startTime']===_0x2ad9d9[_0x390234(0xee6)]&&this[_0x390234(0x24b)]===_0x2ad9d9['alpha'];}}registerPropertyClass(LineFlowColor,LineFlowColorMaterialProperty);class LineFlowMaterialProperty extends BaseMaterialProperty{constructor(_0x13b485={}){const _0x492488={_0x93a7f0:0x85c,_0x4554a5:0x85c,_0xe2108b:0xefd,_0x6a3e68:0x664},_0x4619dd=_0x3d5d32;super(_0x13b485),this['image']=_0x13b485['image']??_0x13b485['url'],this['color']=_0x13b485[_0x4619dd(0xe8f)]??new Cesium__namespace[(_0x4619dd(0x882))](0x1,0x1,0x1,0x0),this['axisY']=_0x13b485['axisY']??![],this['mixt']=_0x13b485['mixt']??![],this[_0x4619dd(_0x492488._0x93a7f0)]=_0x13b485[_0x4619dd(_0x492488._0x4554a5)]??0xa,this[_0x4619dd(0x80d)]=_0x13b485['duration'],this[_0x4619dd(_0x492488._0xe2108b)]=_0x13b485['repeat']??new Cesium__namespace[(_0x4619dd(0xb0e))](0x1,0x1),this[_0x4619dd(0x8c7)]=_0x13b485['image2']??_0x13b485['bgUrl'],this['color2']=_0x13b485['color2']??_0x13b485[_0x4619dd(_0x492488._0x6a3e68)]??new Cesium__namespace['Color'](0x1,0x1,0x1),this['hasImage2']=Cesium__namespace['defined'](this[_0x4619dd(0x8c7)]),this['globalAlpha']=_0x13b485['globalAlpha']??0x1;}['getType'](_0x3f9e52){return LineFlow;}['getValue'](_0x44c948,_0x447efe){const _0x243566={_0x4311d4:0xe8f,_0x33bbd1:0xdc8,_0x4034ea:0xa1d,_0x1f243b:0x882},_0x4d9221=_0x3d5d32;return!Cesium__namespace[_0x4d9221(0xb84)](_0x447efe)&&(_0x447efe={}),_0x447efe['image']=this['image'],_0x447efe['color']=getCesiumColor(this[_0x4d9221(_0x243566._0x4311d4)],new Cesium__namespace['Color'](0x1,0x1,0x1,0x0),_0x44c948),_0x447efe['repeat']=getCesiumValue(this['repeat'],Cesium__namespace['Cartesian2'],_0x44c948),_0x447efe['axisY']=this['axisY'],_0x447efe[_0x4d9221(_0x243566._0x33bbd1)]=this['mixt'],_0x447efe['speed']=getCesiumValue(this['speed'],Number,_0x44c948),this[_0x4d9221(0x80d)]?(this[_0x4d9221(_0x243566._0x4034ea)]===undefined&&(this['_time']=new Date()['getTime']()),_0x447efe['time']=(new Date()['getTime']()-this[_0x4d9221(0xa1d)])/(this[_0x4d9221(0x80d)]*0x3e8)):_0x447efe['time']=-0x1,_0x447efe['hasImage2']=this['hasImage2'],_0x447efe['image2']=this[_0x4d9221(0x8c7)],_0x447efe[_0x4d9221(0x4ac)]=getCesiumColor(this['color2'],new Cesium__namespace[(_0x4d9221(_0x243566._0x1f243b))](0x1,0x1,0x1),_0x44c948),_0x447efe['globalAlpha']=this['globalAlpha'],_0x447efe;}['equals'](_0x39c886){const _0x101833={_0x4e196f:0xaf1,_0x382196:0x8c7,_0x5863eb:0x71f},_0xf34267=_0x3d5d32;return this===_0x39c886||_0x39c886 instanceof LineFlowMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x39c886['color'])&&Cesium__namespace['Property']['equals'](this['repeat'],_0x39c886[_0xf34267(0xefd)])&&this['image']===_0x39c886['image']&&this[_0xf34267(_0x101833._0x4e196f)]===_0x39c886['axisY']&&this[_0xf34267(0x85c)]===_0x39c886['speed']&&this['hasImage2']===_0x39c886['hasImage2']&&this[_0xf34267(_0x101833._0x382196)]===_0x39c886[_0xf34267(0x8c7)]&&Cesium__namespace['Property'][_0xf34267(_0x101833._0x5863eb)](this[_0xf34267(0x4ac)],_0x39c886['color2']);}}registerPropertyClass(LineFlow,LineFlowMaterialProperty);class LineTrailMaterialProperty extends BaseMaterialProperty{constructor(_0x704d18={}){const _0x1f6236={_0xc3328c:0xe8f,_0x5c9701:0x85c},_0x5ac7b3=_0x3d5d32;super(_0x704d18),this[_0x5ac7b3(0xe8f)]=getCesiumColor(_0x704d18[_0x5ac7b3(_0x1f6236._0xc3328c)],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['bgColor']=getCesiumColor(_0x704d18['bgColor'],this['color'][_0x5ac7b3(0xe57)](0.1)),this['speed']=_0x704d18[_0x5ac7b3(_0x1f6236._0x5c9701)]??0x2,this[_0x5ac7b3(0xc96)]=_0x704d18['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x3bdfd8){return LineTrail;}['getValue'](_0x1bc3fb,_0x3a074d){const _0x175f58=_0x3d5d32;return!Cesium__namespace['defined'](_0x3a074d)&&(_0x3a074d={}),_0x3a074d[_0x175f58(0xe8f)]=this['color'],_0x3a074d['bgColor']=this['bgColor'],_0x3a074d['speed']=this['speed'],_0x3a074d[_0x175f58(0xc96)]=this['globalAlpha'],_0x3a074d;}['equals'](_0x5b04b7){const _0x5e17c7={_0x2bdbc6:0x71f,_0x408e30:0x6a2,_0xe4a2b0:0x85c},_0x4be747=_0x3d5d32;return this===_0x5b04b7||_0x5b04b7 instanceof LineTrailMaterialProperty&&Cesium__namespace['Property'][_0x4be747(_0x5e17c7._0x2bdbc6)](this[_0x4be747(0xe8f)],_0x5b04b7['color'])&&Cesium__namespace[_0x4be747(_0x5e17c7._0x408e30)]['equals'](this['bgColor'],_0x5b04b7['bgColor'])&&this['speed']===_0x5b04b7[_0x4be747(_0x5e17c7._0xe4a2b0)];}}registerPropertyClass(LineTrail,LineTrailMaterialProperty);class LineDotDashMaterialProperty extends BaseMaterialProperty{constructor(_0x34be25={}){const _0x3f1199={_0xefb604:0x882},_0x20ecd1=_0x3d5d32;super(_0x34be25),this['color']=getCesiumColor(_0x34be25['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this['gapColor']=getCesiumColor(_0x34be25['gapColor'],Cesium__namespace[_0x20ecd1(_0x3f1199._0xefb604)]['TRANSPARENT']),this['dashLength']=_0x34be25['dashLength']??0x10,this['dashPattern']=_0x34be25['dashPattern']??0xff,this['globalAlpha']=_0x34be25['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x909bfb){return LineDotDash;}['getValue'](_0x2568e2,_0x5efad7){const _0x43c1f1=_0x3d5d32;return!Cesium__namespace['defined'](_0x5efad7)&&(_0x5efad7={}),_0x5efad7['color']=this['color'],_0x5efad7['gapColor']=this['gapColor'],_0x5efad7['dashLength']=this['dashLength'],_0x5efad7[_0x43c1f1(0x781)]=this['dashPattern'],_0x5efad7[_0x43c1f1(0xc96)]=this[_0x43c1f1(0xc96)],_0x5efad7;}['equals'](_0x12aadd){const _0x24fd5c={_0x279238:0x6a2,_0x3d1144:0x781},_0x21ddc1=_0x3d5d32;return this===_0x12aadd||_0x12aadd instanceof LineDotDashMaterialProperty&&Cesium__namespace[_0x21ddc1(_0x24fd5c._0x279238)]['equals'](this['color'],_0x12aadd['color'])&&Cesium__namespace['Property']['equals'](this['gapColor'],_0x12aadd['gapColor'])&&this['dashLength']===_0x12aadd[_0x21ddc1(0xb42)]&&this[_0x21ddc1(_0x24fd5c._0x3d1144)]===_0x12aadd['dashPattern'];}}registerPropertyClass(LineDotDash,LineDotDashMaterialProperty);class NeonLightMaterialProperty extends BaseMaterialProperty{constructor(_0x361900={}){const _0x22655d={_0x15e191:0xe8f,_0x474637:0x699,_0xe8f6d5:0x85c},_0x3b92c5=_0x3d5d32;super(_0x361900),this[_0x3b92c5(_0x22655d._0x15e191)]=getCesiumColor(_0x361900[_0x3b92c5(0xe8f)],Cesium__namespace['Color']['fromCssColorString'](_0x3b92c5(_0x22655d._0x474637))),this['speed']=_0x361900[_0x3b92c5(_0x22655d._0xe8f6d5)]??0x2,this['globalAlpha']=_0x361900[_0x3b92c5(0xc96)]??0x1;}[_0x3d5d32(0xbf9)](_0x540537){return NeonLight;}['getValue'](_0x2ef754,_0x59756e){return!Cesium__namespace['defined'](_0x59756e)&&(_0x59756e={}),_0x59756e['color']=this['color'],_0x59756e['speed']=this['speed'],_0x59756e['globalAlpha']=this['globalAlpha'],_0x59756e;}[_0x3d5d32(0x71f)](_0x41ec9f){return this===_0x41ec9f||_0x41ec9f instanceof NeonLightMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x41ec9f['color'])&&this['speed']===_0x41ec9f['speed'];}}registerPropertyClass(NeonLight,NeonLightMaterialProperty);class LineThreeDashMaterialProperty extends BaseMaterialProperty{constructor(_0x5cb536={}){const _0xd665ba={_0xf07538:0x882,_0x38cf67:0x480,_0x20f8f8:0xf8d},_0x339214=_0x3d5d32;super(_0x5cb536),this['color']=getCesiumColor(_0x5cb536['color'],Cesium__namespace[_0x339214(_0xd665ba._0xf07538)]['RED']),this['dashLength']=_0x5cb536['dashLength']??0x10,this['widthRatio']=_0x5cb536['widthRatio']??0.1,this[_0x339214(_0xd665ba._0x38cf67)]=getCesiumColor(_0x5cb536['sidesColor'],Cesium__namespace['Color']['WHITE']),this['sidesDashLength']=_0x5cb536['sidesDashLength']??0x20,this[_0x339214(_0xd665ba._0x20f8f8)]=_0x5cb536['sidesWidthRatio']??0.1,this['dashPattern']=_0x5cb536['dashPattern']??0xff,this['globalAlpha']=_0x5cb536[_0x339214(0xc96)]??0x1;}['getType'](_0x30a327){return LineThreeDash;}[_0x3d5d32(0xfbe)](_0x272b77,_0x14cd33){const _0xf29c22={_0x59f6d6:0xb42,_0x37c8a9:0x480,_0xa4a9ea:0xb42},_0x43b349=_0x3d5d32;return!Cesium__namespace['defined'](_0x14cd33)&&(_0x14cd33={}),_0x14cd33['color']=getCesiumColor(this['color'],Cesium__namespace[_0x43b349(0x882)]['RED'],_0x272b77),_0x14cd33[_0x43b349(0xb42)]=this[_0x43b349(_0xf29c22._0x59f6d6)],_0x14cd33['widthRatio']=this['widthRatio'],_0x14cd33['sidesColor']=getCesiumColor(this[_0x43b349(_0xf29c22._0x37c8a9)],Cesium__namespace[_0x43b349(0x882)]['WHITE'],_0x272b77),_0x14cd33['sidesDashLength']=this['sidesDashLength'],_0x14cd33[_0x43b349(0xf8d)]=this[_0x43b349(0xf8d)],_0x14cd33[_0x43b349(_0xf29c22._0xa4a9ea)]=this['dashLength'],_0x14cd33[_0x43b349(0xc96)]=this['globalAlpha'],_0x14cd33;}[_0x3d5d32(0x71f)](_0x510dba){const _0x2ce1cb={_0x1ca9ab:0x6a2,_0x5d41e7:0x85c},_0x5f3f1e=_0x3d5d32;return this===_0x510dba||_0x510dba instanceof LineThreeDashMaterialProperty&&Cesium__namespace[_0x5f3f1e(_0x2ce1cb._0x1ca9ab)]['equals'](this['color'],_0x510dba[_0x5f3f1e(0xe8f)])&&this['speed']===_0x510dba[_0x5f3f1e(_0x2ce1cb._0x5d41e7)];}}registerPropertyClass(LineThreeDash,LineThreeDashMaterialProperty);class ODLineMaterialProperty extends BaseMaterialProperty{constructor(_0x352404={}){const _0x2505f3=_0x3d5d32;super(_0x352404),this['color']=getCesiumColor(_0x352404['color'],new Cesium__namespace['Color'](Math['random']()*0.5+0.5,Math[_0x2505f3(0x380)]()*0.8+0.2,0x0,0x1)),this['bgColor']=getCesiumColor(_0x352404['bgColor'],this['color']['withAlpha'](0.1)),this['speed']=_0x352404['speed']??0x14+0xa*Math[_0x2505f3(0x380)](),this['startTime']=_0x352404['startTime']??Math['random'](),this['bidirectional']=_0x352404['bidirectional']??0x0,this['globalAlpha']=_0x352404['globalAlpha']??0x1;}['getType'](_0x43b44b){return ODLine;}['getValue'](_0x45f12b,_0x34daa5){const _0x5d744d={_0xbbe3f9:0x85c,_0x42a206:0x664,_0x39a85f:0xc96},_0x1b53d9=_0x3d5d32;return!_0x34daa5&&(_0x34daa5={}),_0x34daa5['color']=this['color'],_0x34daa5[_0x1b53d9(_0x5d744d._0xbbe3f9)]=this['speed'],_0x34daa5['startTime']=this['startTime'],_0x34daa5[_0x1b53d9(_0x5d744d._0x42a206)]=this['bgColor'],_0x34daa5['bidirectional']=this['bidirectional'],_0x34daa5['globalAlpha']=this[_0x1b53d9(_0x5d744d._0x39a85f)],_0x34daa5;}['equals'](_0x2e06ba){const _0x223d79={_0x55e67a:0x85c,_0x1bf7e8:0xee6},_0x50e7da=_0x3d5d32;return this===_0x2e06ba||_0x2e06ba instanceof ODLineMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0x50e7da(0xe8f)],_0x2e06ba['color'])&&Cesium__namespace['Property']['equals'](this['bgColor'],_0x2e06ba['bgColor'])&&this[_0x50e7da(_0x223d79._0x55e67a)]===_0x2e06ba['speed']&&this[_0x50e7da(_0x223d79._0x1bf7e8)]===_0x2e06ba['startTime']&&this['bidirectional']===_0x2e06ba['bidirectional'];}}registerPropertyClass(ODLine,ODLineMaterialProperty);class PolyAsphaltMaterialProperty extends BaseMaterialProperty{constructor(_0x479a5f={}){const _0x1ca14f={_0x1eeccc:0xe8f},_0x187a7e=_0x3d5d32;super(_0x479a5f),this[_0x187a7e(_0x1ca14f._0x1eeccc)]=getCesiumColor(_0x479a5f['color'],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this[_0x187a7e(0x697)]=_0x479a5f['size']??0.02,this['frequency']=_0x479a5f[_0x187a7e(0x4bc)]??0.2,this['globalAlpha']=_0x479a5f['globalAlpha']??0x1;}['getType'](_0x2813f2){return PolyAsphalt;}['getValue'](_0x138273,_0x2d84e0){return!Cesium__namespace['defined'](_0x2d84e0)&&(_0x2d84e0={}),_0x2d84e0['color']=this['color'],_0x2d84e0['size']=this['size'],_0x2d84e0['frequency']=this['frequency'],_0x2d84e0['globalAlpha']=this['globalAlpha'],_0x2d84e0;}[_0x3d5d32(0x71f)](_0x39e570){const _0x177525={_0x4657a5:0x6a2},_0x4227da=_0x3d5d32;return this===_0x39e570||_0x39e570 instanceof PolyAsphaltMaterialProperty&&Cesium__namespace[_0x4227da(_0x177525._0x4657a5)]['equals'](this['color'],_0x39e570['color'])&&this['frequency']===_0x39e570['frequency']&&this['size']===_0x39e570[_0x4227da(0x697)];}}registerPropertyClass(PolyAsphalt,PolyAsphaltMaterialProperty);class PolyBlobMaterialProperty extends BaseMaterialProperty{constructor(_0x18ce98={}){const _0x1e50ee=_0x3d5d32;super(_0x18ce98),this[_0x1e50ee(0x498)]=getCesiumColor(_0x18ce98[_0x1e50ee(0x498)],new Cesium__namespace['Color'](0x1,0x1,0x1,0.5)),this['oddColor']=getCesiumColor(_0x18ce98['evenColor'],new Cesium__namespace[(_0x1e50ee(0x882))](0x0,0x0,0x1,0.5)),this['frequency']=_0x18ce98['frequency']??0xa,this[_0x1e50ee(0xc96)]=_0x18ce98['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x5036ed){return PolyBlob;}['getValue'](_0x1ac09c,_0x3fd58d){const _0x2721b1={_0xd2be1b:0x498},_0xa5e0d0=_0x3d5d32;return!Cesium__namespace['defined'](_0x3fd58d)&&(_0x3fd58d={}),_0x3fd58d[_0xa5e0d0(_0x2721b1._0xd2be1b)]=this['evenColor'],_0x3fd58d[_0xa5e0d0(_0x2721b1._0xd2be1b)]=this['oddColor'],_0x3fd58d['frequency']=this['frequency'],_0x3fd58d[_0xa5e0d0(0xc96)]=this['globalAlpha'],_0x3fd58d;}['equals'](_0x317629){const _0x6b7fec=_0x3d5d32;return this===_0x317629||_0x317629 instanceof PolyBlobMaterialProperty&&Cesium__namespace[_0x6b7fec(0x6a2)]['equals'](this['evenColor'],_0x317629['evenColor'])&&Cesium__namespace['Property'][_0x6b7fec(0x71f)](this['oddColor'],_0x317629['oddColor'])&&this['frequency']===_0x317629[_0x6b7fec(0x4bc)];}}registerPropertyClass(PolyBlob,PolyBlobMaterialProperty);class PolyFacetMaterialProperty extends PolyBlobMaterialProperty{[_0x3d5d32(0xbf9)](_0x8700dc){return PolyFacet;}}registerPropertyClass(PolyFacet,PolyFacetMaterialProperty);class PolyGradientMaterialProperty extends BaseMaterialProperty{constructor(_0x2e13b6={}){const _0xcb301a={_0x3d6ae4:0x80f},_0x59d68e=_0x3d5d32;super(_0x2e13b6),this['color']=getCesiumColor(_0x2e13b6['color'],new Cesium__namespace[(_0x59d68e(0x882))](0x1,0x1,0x0,0.5)),this['diffusePower']=_0x2e13b6[_0x59d68e(_0xcb301a._0x3d6ae4)]??1.6,this['alphaPower']=_0x2e13b6['alphaPower']??1.5,this[_0x59d68e(0xe72)]=_0x2e13b6['center']??new Cesium__namespace[(_0x59d68e(0xb0e))](0.5,0.5),this['globalAlpha']=_0x2e13b6[_0x59d68e(0xc96)]??0x1;}[_0x3d5d32(0xbf9)](_0x2e4ca1){return PolyGradient;}[_0x3d5d32(0xfbe)](_0x21b00b,_0x22c248){const _0x2aeb5f={_0x209702:0xb84,_0x1ca74e:0xe8f},_0x15cbd5=_0x3d5d32;return!Cesium__namespace[_0x15cbd5(_0x2aeb5f._0x209702)](_0x22c248)&&(_0x22c248={}),_0x22c248['color']=this[_0x15cbd5(_0x2aeb5f._0x1ca74e)],_0x22c248['diffusePower']=this['diffusePower'],_0x22c248['alphaPower']=this['alphaPower'],_0x22c248['center']=this['center'],_0x22c248['globalAlpha']=this[_0x15cbd5(0xc96)],_0x22c248;}['equals'](_0x2f3543){const _0x5e168d={_0x126d3d:0x80f},_0x4c6b4f=_0x3d5d32;return this===_0x2f3543||_0x2f3543 instanceof PolyGradientMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x2f3543['color'])&&this['diffusePower']===_0x2f3543[_0x4c6b4f(_0x5e168d._0x126d3d)];}}registerPropertyClass(PolyGradient,PolyGradientMaterialProperty);class PolyGrassMaterialProperty extends PolyBlobMaterialProperty{[_0x3d5d32(0xbf9)](_0x3ff098){return PolyGrass;}}registerPropertyClass(PolyGrass,PolyGrassMaterialProperty);class PolyWoodMaterialProperty extends BaseMaterialProperty{constructor(_0x5e8613={}){const _0x2958f8={_0x41d1a9:0x498,_0x5dc2d8:0x498},_0x2152e9=_0x3d5d32;super(_0x5e8613),this[_0x2152e9(_0x2958f8._0x41d1a9)]=getCesiumColor(_0x5e8613[_0x2152e9(_0x2958f8._0x5dc2d8)],new Cesium__namespace['Color'](0x1,0x1,0x1,0.5)),this['oddColor']=getCesiumColor(_0x5e8613['evenColor'],new Cesium__namespace['Color'](0x0,0x0,0x1,0.5)),this['frequency']=_0x5e8613['frequency']??0xa,this['noiseScale']=_0x5e8613[_0x2152e9(0xd28)]??new Cesium__namespace[(_0x2152e9(0xb0e))](0.7,0.5),this['grainFrequency']=_0x5e8613['grainFrequency']??0x1b,this['globalAlpha']=_0x5e8613['globalAlpha']??0x1;}['getType'](_0x306e2b){return PolyWood;}['getValue'](_0x118d26,_0x1c02a9){const _0x13de9f={_0x39bc38:0xb84,_0x4b5929:0xd28},_0x4e9f93=_0x3d5d32;return!Cesium__namespace[_0x4e9f93(_0x13de9f._0x39bc38)](_0x1c02a9)&&(_0x1c02a9={}),_0x1c02a9['evenColor']=this['evenColor'],_0x1c02a9['evenColor']=this['oddColor'],_0x1c02a9[_0x4e9f93(0x4bc)]=this[_0x4e9f93(0x4bc)],_0x1c02a9['noiseScale']=this[_0x4e9f93(_0x13de9f._0x4b5929)],_0x1c02a9['grainFrequency']=this['grainFrequency'],_0x1c02a9['globalAlpha']=this['globalAlpha'],_0x1c02a9;}[_0x3d5d32(0x71f)](_0x4f9e82){const _0xa9061f={_0x216827:0x71f,_0xf36a18:0x498,_0x55acf0:0x4bc},_0x339d7e=_0x3d5d32;return this===_0x4f9e82||_0x4f9e82 instanceof PolyWoodMaterialProperty&&Cesium__namespace['Property'][_0x339d7e(_0xa9061f._0x216827)](this[_0x339d7e(_0xa9061f._0xf36a18)],_0x4f9e82[_0x339d7e(0x498)])&&Cesium__namespace['Property']['equals'](this['oddColor'],_0x4f9e82['oddColor'])&&this[_0x339d7e(_0xa9061f._0x55acf0)]===_0x4f9e82['frequency'];}}registerPropertyClass(PolyWood,PolyWoodMaterialProperty);class RadarLineMaterialProperty extends BaseMaterialProperty{constructor(_0x9b6768={}){const _0x4151dd={_0x45d67b:0xe8f},_0x34de1d=_0x3d5d32;super(_0x9b6768),this[_0x34de1d(0xe8f)]=getCesiumColor(_0x9b6768[_0x34de1d(_0x4151dd._0x45d67b)],new Cesium__namespace[(_0x34de1d(0x882))](0x0,0x0,0x0,0x0)),this['speed']=_0x9b6768[_0x34de1d(0x85c)]??0x5,this['globalAlpha']=_0x9b6768[_0x34de1d(0xc96)]??0x1;}['getType'](_0xa062fc){return RadarLine;}['getValue'](_0x554916,_0xaf0603){const _0x4f82d1={_0x16f6e8:0xb84,_0x4c9fc9:0x85c},_0x1d9121=_0x3d5d32;return!Cesium__namespace[_0x1d9121(_0x4f82d1._0x16f6e8)](_0xaf0603)&&(_0xaf0603={}),_0xaf0603['color']=this['color'],_0xaf0603[_0x1d9121(_0x4f82d1._0x4c9fc9)]=this['speed'],_0xaf0603['globalAlpha']=this['globalAlpha'],_0xaf0603;}['equals'](_0x2e2960){const _0x3b8a31={_0x4e40cf:0xe8f},_0x37c670=_0x3d5d32;return this===_0x2e2960||_0x2e2960 instanceof RadarLineMaterialProperty&&Cesium__namespace[_0x37c670(0x6a2)]['equals'](this['color'],_0x2e2960[_0x37c670(_0x3b8a31._0x4e40cf)])&&this['speed']===_0x2e2960[_0x37c670(0x85c)];}}registerPropertyClass(RadarLine,RadarLineMaterialProperty);class RadarWaveMaterialProperty extends BaseMaterialProperty{constructor(_0x289625={}){const _0x25b1ef={_0x29dc06:0x85c,_0xf016dc:0xc96},_0x34f0d4=_0x3d5d32;super(_0x289625),this['color']=getCesiumColor(_0x289625[_0x34f0d4(0xe8f)],new Cesium__namespace['Color'](0x0,0x0,0x0,0x0)),this[_0x34f0d4(0x85c)]=_0x289625[_0x34f0d4(_0x25b1ef._0x29dc06)]??0x5,this[_0x34f0d4(_0x25b1ef._0xf016dc)]=_0x289625['globalAlpha']??0x1;}['getType'](_0x235433){return RadarWave;}['getValue'](_0x5a4ed3,_0x23de15){const _0x5b0920={_0x1b5f0b:0xb84},_0xf2afec=_0x3d5d32;return!Cesium__namespace[_0xf2afec(_0x5b0920._0x1b5f0b)](_0x23de15)&&(_0x23de15={}),_0x23de15[_0xf2afec(0xe8f)]=this[_0xf2afec(0xe8f)],_0x23de15['speed']=this['speed'],_0x23de15[_0xf2afec(0xc96)]=this['globalAlpha'],_0x23de15;}['equals'](_0x31d723){const _0x57d248={_0x550ef9:0xe8f,_0x6f0bfd:0x85c},_0x104ef9=_0x3d5d32;return this===_0x31d723||_0x31d723 instanceof RadarWaveMaterialProperty&&Cesium__namespace[_0x104ef9(0x6a2)]['equals'](this['color'],_0x31d723[_0x104ef9(_0x57d248._0x550ef9)])&&this['speed']===_0x31d723[_0x104ef9(_0x57d248._0x6f0bfd)];}}registerPropertyClass(RadarWave,RadarWaveMaterialProperty);class RectSlideMaterialProperty extends BaseMaterialProperty{constructor(_0x418413={}){const _0x3d6859=_0x3d5d32;super(_0x418413),this['image']=_0x418413['image'],this['color']=getCesiumColor(_0x418413['color'],new Cesium__namespace['Color'](0x1,0x1,0x1,0.9)),this['speed']=_0x418413['speed']??0x1,this['pure']=!!_0x418413['pure'],this['globalAlpha']=_0x418413[_0x3d6859(0xc96)]??0x1;}['getType'](_0xb6bad0){return RectSlide;}['getValue'](_0x44e372,_0x3f3190){const _0x4131e3={_0x1501c3:0x8e1,_0x5861cc:0x85c,_0x57f34c:0xc96},_0x2535e1=_0x3d5d32;return!Cesium__namespace['defined'](_0x3f3190)&&(_0x3f3190={}),_0x3f3190[_0x2535e1(_0x4131e3._0x1501c3)]=this['image'],_0x3f3190[_0x2535e1(0xe8f)]=this[_0x2535e1(0xe8f)],_0x3f3190[_0x2535e1(_0x4131e3._0x5861cc)]=this[_0x2535e1(_0x4131e3._0x5861cc)],_0x3f3190['pure']=this['pure'],_0x3f3190[_0x2535e1(0xc96)]=this[_0x2535e1(_0x4131e3._0x57f34c)],_0x3f3190;}[_0x3d5d32(0x71f)](_0x58c0c5){const _0x174c07={_0x5eefb6:0x1026},_0x443ca5=_0x3d5d32;return this===_0x58c0c5||_0x58c0c5 instanceof RectSlideMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0x443ca5(0xe8f)],_0x58c0c5['color'])&&this['image']===_0x58c0c5['image']&&this['pure']===_0x58c0c5[_0x443ca5(_0x174c07._0x5eefb6)]&&this['speed']===_0x58c0c5['speed'];}}registerPropertyClass(RectSlide,RectSlideMaterialProperty);class ScanLineMaterialProperty extends BaseMaterialProperty{constructor(_0x3c0b10={}){const _0x43392b={_0x59348a:0xe8f},_0x4e4957=_0x3d5d32;super(_0x3c0b10),this[_0x4e4957(_0x43392b._0x59348a)]=getCesiumColor(_0x3c0b10['color'],Cesium__namespace['Color'][_0x4e4957(0x6e8)]),this['speed']=_0x3c0b10[_0x4e4957(0x85c)]??0xa,this['globalAlpha']=_0x3c0b10['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0xc2325f){return ScanLine;}[_0x3d5d32(0xfbe)](_0x55b775,_0x3daf69){const _0x156aed={_0x586a34:0x85c,_0x4a219b:0x85c,_0x29f18f:0xc96},_0x33c439=_0x3d5d32;return!Cesium__namespace['defined'](_0x3daf69)&&(_0x3daf69={}),_0x3daf69[_0x33c439(0xe8f)]=this['color'],_0x3daf69[_0x33c439(_0x156aed._0x586a34)]=this[_0x33c439(_0x156aed._0x4a219b)],_0x3daf69['globalAlpha']=this[_0x33c439(_0x156aed._0x29f18f)],_0x3daf69;}['equals'](_0x6ebf76){const _0x122203={_0x31f106:0xe8f},_0x20b2b4=_0x3d5d32;return this===_0x6ebf76||_0x6ebf76 instanceof ScanLineMaterialProperty&&Cesium__namespace['Property']['equals'](this['color'],_0x6ebf76[_0x20b2b4(_0x122203._0x31f106)])&&this['speed']===_0x6ebf76['speed'];}}registerPropertyClass(ScanLine,ScanLineMaterialProperty);class TextMaterialProperty extends Image2MaterialProperty{constructor(_0x4f3e67={}){const _0x48fca0={_0x795f77:0xaab,_0x3b872f:0x83d,_0x513a69:0x882},_0xca59a6=_0x3d5d32;_0x4f3e67[_0xca59a6(0x1ed)]=_0x4f3e67['font_size']??0x46,super(_0x4f3e67),this['transparent']=_0x4f3e67[_0xca59a6(_0x48fca0._0x795f77)]??!![],this[_0xca59a6(0x4f2)]=LabelStyleConver[_0xca59a6(_0x48fca0._0x3b872f)](_0x4f3e67,{'fill':!![],'fillColor':new Cesium__namespace[(_0xca59a6(_0x48fca0._0x513a69))](0x1,0x1,0x0,0x1),'textBaseline':'middle','padding':0xa}),this[_0xca59a6(0x5c5)]();}get['text'](){const _0x5df6f6=_0x3d5d32;return this[_0x5df6f6(0x433)]['text'];}set['text'](_0x5c5260){const _0x5ba4d5=_0x3d5d32;this['options'][_0x5ba4d5(0x76b)]=_0x5c5260,this['_updateImage']();}get[_0x3d5d32(0x1068)](){return this['_textStyles'];}set['textStyles'](_0x50f5f8){const _0x457f7e={_0x408205:0x5c5},_0xe1ba6e=_0x3d5d32;this['_textStyles']=LabelStyleConver['toCesiumVal'](_0x50f5f8,this['_textStyles']),this[_0xe1ba6e(_0x457f7e._0x408205)]();}['_updateImage'](){const _0x52e185={_0x588385:0xf1d,_0x239154:0x659,_0x5ed44b:0x44d},_0x58e4ed=_0x3d5d32;this['_canvas']=getTextImage(this['options']['text'],this['_textStyles']);if(this[_0x58e4ed(_0x52e185._0x588385)]){var _0x11109b;this['image']=this['_canvas'];const _0x5a7c3a=(_0x11109b=this['options'])===null||_0x11109b===void 0x0?void 0x0:_0x11109b[_0x58e4ed(_0x52e185._0x239154)];_0x5a7c3a&&_0x5a7c3a(this['_canvas'],this)[_0x58e4ed(_0x52e185._0x5ed44b)](_0x3bfa22=>{this['image']=copyCanvas(_0x3bfa22);});}}}registerPropertyClass(Text,TextMaterialProperty);class WallScrollMaterialProperty extends BaseMaterialProperty{constructor(_0xce9ddb={}){const _0x3e9f6b={_0x6fd2d6:0x882,_0xc49a9:0xaf1},_0x2fc733=_0x3d5d32;super(_0xce9ddb),this['image']=_0xce9ddb['image'],this['color']=getCesiumColor(_0xce9ddb['color'],new Cesium__namespace[(_0x2fc733(_0x3e9f6b._0x6fd2d6))](0x0,0x0,0x0,0x1)),this[_0x2fc733(0x85c)]=_0xce9ddb['speed']??0xa,this['count']=_0xce9ddb['count']??0x1,this[_0x2fc733(0x996)]=_0xce9ddb['reverse']??![],this['axisY']=_0xce9ddb[_0x2fc733(_0x3e9f6b._0xc49a9)]??![],this['bloom']=_0xce9ddb['bloom']??![],this['globalAlpha']=_0xce9ddb['globalAlpha']??0x1;}[_0x3d5d32(0xbf9)](_0x3452d1){return WallScroll;}[_0x3d5d32(0xfbe)](_0x392b5b,_0x1ed86f){const _0x44dd42={_0x288257:0xaf1},_0x5dc8df=_0x3d5d32;return!Cesium__namespace['defined'](_0x1ed86f)&&(_0x1ed86f={}),_0x1ed86f['image']=this[_0x5dc8df(0x8e1)],_0x1ed86f['color']=this[_0x5dc8df(0xe8f)],_0x1ed86f[_0x5dc8df(0x85c)]=this[_0x5dc8df(0x85c)],_0x1ed86f['count']=this['count'],_0x1ed86f['reverse']=this['reverse'],_0x1ed86f[_0x5dc8df(_0x44dd42._0x288257)]=this['axisY'],_0x1ed86f['bloom']=this['bloom'],_0x1ed86f['globalAlpha']=this['globalAlpha'],_0x1ed86f;}['equals'](_0x5e68d7){const _0x4f53b7={_0x3c9fc6:0xe8f,_0x40a14e:0x8e1},_0x4aaf88=_0x3d5d32;return this===_0x5e68d7||_0x5e68d7 instanceof WallScrollMaterialProperty&&Cesium__namespace['Property']['equals'](this[_0x4aaf88(_0x4f53b7._0x3c9fc6)],_0x5e68d7['color'])&&this[_0x4aaf88(_0x4f53b7._0x40a14e)]===_0x5e68d7['image']&&this['count']===_0x5e68d7['count']&&this['reverse']===_0x5e68d7['reverse']&&this[_0x4aaf88(0x1000)]===_0x5e68d7['bloom']&&this['speed']===_0x5e68d7['speed'];}}registerPropertyClass(WallScroll,WallScrollMaterialProperty);class WaterLightMaterialProperty extends BaseMaterialProperty{constructor(_0x2b6e96={}){const _0x98bcbb=_0x3d5d32;super(_0x2b6e96),this[_0x98bcbb(0xf63)]=_0x2b6e96['specularMap'],this['normalMap']=_0x2b6e96['normalMap']||Cesium__namespace['Material']['DefaultImageId'],this[_0x98bcbb(0x24b)]=_0x2b6e96['alpha']??0.2,this['globalAlpha']=_0x2b6e96['globalAlpha']??0x1;}['getType'](_0x3603ea){return WaterLight;}[_0x3d5d32(0xfbe)](_0x36a8d1,_0x2c9f15){const _0x447131=_0x3d5d32;return!Cesium__namespace['defined'](_0x2c9f15)&&(_0x2c9f15={}),_0x2c9f15['specularMap']=this['specularMap'],_0x2c9f15['normalMap']=this['normalMap'],_0x2c9f15['alpha']=this[_0x447131(0x24b)],_0x2c9f15['globalAlpha']=this['globalAlpha'],_0x2c9f15;}['equals'](_0x509b9b){return this===_0x509b9b||_0x509b9b instanceof WaterLightMaterialProperty&&this['specularMap']===_0x509b9b['specularMap']&&this['normalMap']===_0x509b9b['normalMap']&&this['alpha']===_0x509b9b['alpha'];}}registerPropertyClass(WaterLight,WaterLightMaterialProperty);class WaterMaterialProperty extends BaseMaterialProperty{constructor(_0x2ce159={}){const _0x5ca752={_0x2010ff:0x882,_0x58ccb2:0x237,_0x3f62ed:0x4bc,_0x25eb14:0xe21},_0x17c4f1=_0x3d5d32;super(_0x2ce159),this['baseWaterColor']=getCesiumColor(_0x2ce159['baseWaterColor'],new Cesium__namespace['Color'](0.2,0.3,0.6,0x1)),this['blendColor']=getCesiumColor(_0x2ce159['blendColor'],new Cesium__namespace[(_0x17c4f1(_0x5ca752._0x2010ff))](0x0,0x1,0.699,0x1)),this['specularMap']=_0x2ce159[_0x17c4f1(0xf63)]||Cesium__namespace['Material'][_0x17c4f1(_0x5ca752._0x58ccb2)],this['normalMap']=_0x2ce159['normalMap']||Cesium__namespace['Material']['DefaultImageId'],this[_0x17c4f1(_0x5ca752._0x3f62ed)]=_0x2ce159[_0x17c4f1(_0x5ca752._0x3f62ed)]??0x3e8,this['animationSpeed']=_0x2ce159[_0x17c4f1(_0x5ca752._0x25eb14)]??0.01,this['amplitude']=_0x2ce159['amplitude']??0xa,this['specularIntensity']=_0x2ce159['specularIntensity']??0.5,this['fadeFactor']=_0x2ce159['fadeFactor']??0x1,this['globalAlpha']=_0x2ce159['globalAlpha']??0x1;}['getType'](_0x3dfd83){return Water$1;}['getValue'](_0x367c57,_0x195d57){const _0x360298={_0x75a0d0:0x958,_0x3a72ed:0xe21,_0x24a682:0xafd,_0x23ba96:0x24b,_0x47769f:0xc96},_0x17091f=_0x3d5d32;return!_0x195d57&&(_0x195d57={}),_0x195d57['baseWaterColor']=this[_0x17091f(0x67e)],_0x195d57['blendColor']=this[_0x17091f(_0x360298._0x75a0d0)],_0x195d57['specularMap']=this['specularMap'],_0x195d57[_0x17091f(0x943)]=this['normalMap'],_0x195d57['frequency']=this['frequency'],_0x195d57['animationSpeed']=this[_0x17091f(_0x360298._0x3a72ed)],_0x195d57[_0x17091f(_0x360298._0x24a682)]=this['amplitude'],_0x195d57['specularIntensity']=this[_0x17091f(0xe07)],_0x195d57['fadeFactor']=this['fadeFactor'],this['globalAlpha']!==0x1&&(_0x195d57['baseWaterColor'][_0x17091f(_0x360298._0x23ba96)]*=this[_0x17091f(_0x360298._0x47769f)],_0x195d57['blendColor']['alpha']*=this[_0x17091f(0xc96)]),_0x195d57;}['equals'](_0x4eb6cd){const _0x41eb0d={_0x47e754:0x71f,_0x5489d5:0xf63,_0x373871:0xf63,_0x3a244d:0x943,_0x16a762:0xe21,_0x4d1ade:0xe07,_0x1de6dc:0x739,_0x3371d0:0x739},_0x428898=_0x3d5d32;return this===_0x4eb6cd||_0x4eb6cd instanceof WaterMaterialProperty&&this['baseWaterColor']['equals'](_0x4eb6cd[_0x428898(0x67e)])&&this['blendColor'][_0x428898(_0x41eb0d._0x47e754)](_0x4eb6cd['blendColor'])&&this[_0x428898(_0x41eb0d._0x5489d5)]===_0x4eb6cd[_0x428898(_0x41eb0d._0x373871)]&&this[_0x428898(_0x41eb0d._0x3a244d)]===_0x4eb6cd['normalMap']&&this['frequency']===_0x4eb6cd['frequency']&&this['animationSpeed']===_0x4eb6cd[_0x428898(_0x41eb0d._0x16a762)]&&this['amplitude']===_0x4eb6cd['amplitude']&&this['specularIntensity']===_0x4eb6cd[_0x428898(_0x41eb0d._0x4d1ade)]&&this[_0x428898(_0x41eb0d._0x1de6dc)]===_0x4eb6cd[_0x428898(_0x41eb0d._0x3371d0)];}}registerPropertyClass(Water$1,WaterMaterialProperty);var index$7={'__proto__':null,'TextMaterial':TextMaterial,'CylinderWaveMaterial':CylinderWaveMaterial,'BaseMaterialProperty':BaseMaterialProperty,'CircleScanMaterialProperty':CircleScanMaterialProperty,'CircleWaveMaterialProperty':CircleWaveMaterialProperty,'CylinderWaveMaterialProperty':CylinderWaveMaterialProperty,'DigitalFlowMaterialProperty':DigitalFlowMaterialProperty,'EllipsoidElectricMaterialProperty':EllipsoidElectricMaterialProperty,'EllipsoidWaveMaterialProperty':EllipsoidWaveMaterialProperty,'Image2MaterialProperty':Image2MaterialProperty,'LineBloomMaterialProperty':LineBloomMaterialProperty,'LineFlickerMaterialProperty':LineFlickerMaterialProperty,'LineFlowColorMaterialProperty':LineFlowColorMaterialProperty,'LineFlowMaterialProperty':LineFlowMaterialProperty,'LineTrailMaterialProperty':LineTrailMaterialProperty,'LineDotDashMaterialProperty':LineDotDashMaterialProperty,'NeonLightMaterialProperty':NeonLightMaterialProperty,'LineThreeDashMaterialProperty':LineThreeDashMaterialProperty,'ODLineMaterialProperty':ODLineMaterialProperty,'PolyAsphaltMaterialProperty':PolyAsphaltMaterialProperty,'PolyBlobMaterialProperty':PolyBlobMaterialProperty,'PolyFacetMaterialProperty':PolyFacetMaterialProperty,'PolyGradientMaterialProperty':PolyGradientMaterialProperty,'PolyGrassMaterialProperty':PolyGrassMaterialProperty,'PolyWoodMaterialProperty':PolyWoodMaterialProperty,'RadarLineMaterialProperty':RadarLineMaterialProperty,'RadarWaveMaterialProperty':RadarWaveMaterialProperty,'RectSlideMaterialProperty':RectSlideMaterialProperty,'ScanLineMaterialProperty':ScanLineMaterialProperty,'TextMaterialProperty':TextMaterialProperty,'WallScrollMaterialProperty':WallScrollMaterialProperty,'WaterLightMaterialProperty':WaterLightMaterialProperty,'WaterMaterialProperty':WaterMaterialProperty};class BaseGraphic extends BaseClass{constructor(_0x2cdbe0={}){const _0x575cd5={_0xd141c6:0x962},_0x1d8549=_0x3d5d32;_0x2cdbe0['style']=_0x2cdbe0['style']||{},_0x2cdbe0['attr']=_0x2cdbe0['attr']||{},super(_0x2cdbe0),this['options']=_0x2cdbe0,this['_id']=_0x2cdbe0['id']??_0x2cdbe0['attr']['id']??createGuid(),this['_name']=_0x2cdbe0['name']||_0x2cdbe0['attr']['name']||'',this['_show']=_0x2cdbe0['show']??!![],this['_private']=_0x2cdbe0['private'],_0x2cdbe0['popup']&&this[_0x1d8549(0x217)](_0x2cdbe0['popup'],_0x2cdbe0['popupOptions']),_0x2cdbe0['tooltip']&&this['bindTooltip'](_0x2cdbe0['tooltip'],_0x2cdbe0['tooltipOptions']),_0x2cdbe0[_0x1d8549(0x4b4)]&&this['bindContextMenu'](_0x2cdbe0[_0x1d8549(0x4b4)],_0x2cdbe0[_0x1d8549(_0x575cd5._0xd141c6)]),this['_state']=State['INITIALIZED'];}get['type'](){return this['_type'];}get['id'](){return this['_id'];}set['id'](_0x4cbc85){this['_id']=_0x4cbc85;}get[_0x3d5d32(0x98c)](){return this['_id'];}get['state'](){const _0x8a000d={_0x475ac8:0xf35},_0x18d8c3=_0x3d5d32;return this[_0x18d8c3(_0x8a000d._0x475ac8)];}get[_0x3d5d32(0x842)](){const _0x351c6d={_0x1c5d04:0xd09},_0x4a48c3=_0x3d5d32;return this['_state']===State[_0x4a48c3(_0x351c6d._0x1c5d04)];}get['isDestroy'](){const _0x5214ca={_0x21c8cf:0xf35},_0x17b015=_0x3d5d32;return this[_0x17b015(_0x5214ca._0x21c8cf)]===State['DESTROY']||!this['options'];}get['isPrivate'](){if(this['_private'])return!![];return![];}get['czmObject'](){return null;}get['czmObjectEx'](){return null;}get['show'](){return this['_show'];}set[_0x3d5d32(0x792)](_0x31986d){const _0x386626=_0x3d5d32;if(this['_show']===_0x31986d)return;this[_0x386626(0x443)]=_0x31986d,this['czmObject']&&(this[_0x386626(0xd2e)]['show']=this['_show']),this['czmObjectEx']&&this['czmObjectEx']['forEach'](function(_0x2305df){_0x2305df['show']=_0x31986d;}),this['_showHook']&&this[_0x386626(0x68e)](_0x31986d),_0x31986d?this['fire'](EventType['show']):this['fire'](EventType['hide']);}get[_0x3d5d32(0xaed)](){return this['_name'];}set[_0x3d5d32(0xaed)](_0x37fda7){this['_name']=_0x37fda7;}get['attr'](){return this['options']['attr'];}set[_0x3d5d32(0xe12)](_0x1b7f33){const _0x2f5878=_0x3d5d32;this['options'][_0x2f5878(0xe12)]=_0x1b7f33,this['fire'](EventType['updateAttr'],{'attr':_0x1b7f33},!![]);}get['style'](){const _0x45dcf7={_0x1e6314:0x433},_0x1c3049=_0x3d5d32;var _0x383a13;return(_0x383a13=this[_0x1c3049(_0x45dcf7._0x1e6314)])===null||_0x383a13===void 0x0?void 0x0:_0x383a13['style'];}set['style'](_0x102601){this['setStyle'](_0x102601);}get[_0x3d5d32(0xcb7)](){return this['options']['allowDrillPick'];}set['allowDrillPick'](_0x14ca0b){this['options']['allowDrillPick']=_0x14ca0b;}get['hasEdit'](){return this['_hasEdit']&&Boolean(this['EditClass']||this['_getDrawEntityClass']);}set[_0x3d5d32(0x8eb)](_0x34c9b8){const _0x2f13be={_0x5b6dda:0xc46},_0x2348a8=_0x3d5d32;this[_0x2348a8(_0x2f13be._0x5b6dda)]=_0x34c9b8;}get['enabledEvent'](){const _0x533333={_0x458c8f:0xc4d},_0x333e49=_0x3d5d32;if(this['_layer'])return this['_layer'][_0x333e49(_0x533333._0x458c8f)]&&this['_enabledEvent'];return this['_enabledEvent'];}set['enabledEvent'](_0x42341b){this['_enabledEvent']=_0x42341b;}get[_0x3d5d32(0xe72)](){return null;}get[_0x3d5d32(0x7ec)](){return LngLatPoint['fromCartesian'](this['center']);}get['hasOpacity'](){return!![];}[_0x3d5d32(0x105c)](_0x2b9a15){const _0x75b2b2={_0x3d39a4:0x682},_0x493d6f=_0x3d5d32;return _0x2b9a15&&_0x2b9a15[_0x493d6f(0x682)]&&_0x2b9a15[_0x493d6f(_0x75b2b2._0x3d39a4)](this),this;}['remove'](_0x11994e){const _0x1625f5=_0x3d5d32;this['_layer']&&this['_layer'][_0x1625f5(0x358)](this,_0x11994e);}['bindPickId'](_0x49dc0f){var _0x5bd6d4;return _0x49dc0f['_mars3d_layerId']=(_0x5bd6d4=this['_layer'])===null||_0x5bd6d4===void 0x0?void 0x0:_0x5bd6d4['id'],_0x49dc0f['_mars3d_graphicId']=this['id'],this;}[_0x3d5d32(0xb5d)](_0x242831){const _0x279984={_0x47f143:0x1d1,_0x4f4518:0x433,_0x231bd6:0x873,_0x4b317f:0xd09},_0x29ff0b=_0x3d5d32;var _0x4cc6fb,_0x5806e4;if(this[_0x29ff0b(0x842)])return;this[_0x29ff0b(0xf35)]=State['ADD'],this['_layer']=_0x242831,this['_map']=_0x242831['_map'];!this[_0x29ff0b(_0x279984._0x47f143)]&&logWarn('BaseGraphic:为了避免异常问题,请将图层添加到Map上再进行添加矢量数据的操作!');if(this['options']['eventParent'])this['addEventParent'](this['options'][_0x29ff0b(0x4b7)]);else{if(((_0x4cc6fb=this[_0x29ff0b(_0x279984._0x4f4518)])===null||_0x4cc6fb===void 0x0?void 0x0:_0x4cc6fb['eventParent'])===![]);else this['addEventParent'](_0x242831);}!this['czmObject']&&this[_0x29ff0b(0xe4c)]&&this['_mountedHook']();this['_addedHook']&&this['_addedHook'](this[_0x29ff0b(0xdde)]);if(!((_0x5806e4=this[_0x29ff0b(_0x279984._0x231bd6)])!==null&&_0x5806e4!==void 0x0&&_0x5806e4['_highlightOptions'])){if(this[_0x29ff0b(0xdde)]['highlight'])this['bindHighlight'](this['style'][_0x29ff0b(0x56e)]);else this['options']['highlight']&&this[_0x29ff0b(0xc65)](this['options']['highlight']);}this['czmObject']&&this['bindPickId'](this[_0x29ff0b(0xd2e)]),this['czmObjectEx']&&this['czmObjectEx']['forEach'](_0x17b6f2=>{this['bindPickId'](_0x17b6f2);}),this['options']['flyTo']&&this['flyTo']({'duration':0x0}),this['_state']=State[_0x29ff0b(_0x279984._0x4b317f)],this['fire'](EventType['add']),!this[_0x29ff0b(0xe85)]&&this['enabledEvent']&&this['_layer']['fire'](EventType['addGraphic'],{'graphic':this},!![]);}['_onRemove'](){const _0x2f1f82={_0x381737:0x433,_0x19bbad:0x54e,_0xc9738a:0x635,_0x2e7b94:0xf06,_0x528b0e:0xefc,_0x288035:0x433,_0x3eb47f:0x1e5,_0x45ed53:0x433,_0x3e0767:0x873},_0x436efe=_0x3d5d32;var _0x19f623,_0x39bcf9;if(this['_state']!==State['ADDED'])return;if(!this['_layer']||!this[_0x436efe(_0x2f1f82._0x381737)])return;this['_closeAllControl'](),this[_0x436efe(_0x2f1f82._0x19bbad)]();this[_0x436efe(_0x2f1f82._0xc9738a)]&&this['unbindUpdateEvent']();this['_removedHook']&&this['_removedHook']();if(!this[_0x436efe(0x433)])return;this['_state']=State['REMOVED'],this[_0x436efe(0xefc)](EventType[_0x436efe(_0x2f1f82._0x2e7b94)]);!this['isPrivate']&&this['enabledEvent']&&this['_layer'][_0x436efe(_0x2f1f82._0x528b0e)](EventType['removeGraphic'],{'graphic':this},!![]);if((_0x19f623=this[_0x436efe(_0x2f1f82._0x288035)])!==null&&_0x19f623!==void 0x0&&_0x19f623['eventParent'])this[_0x436efe(_0x2f1f82._0x3eb47f)](this[_0x436efe(_0x2f1f82._0x45ed53)]['eventParent']);else{if(((_0x39bcf9=this['options'])===null||_0x39bcf9===void 0x0?void 0x0:_0x39bcf9['eventParent'])===![]);else this['removeEventParent'](this[_0x436efe(_0x2f1f82._0x3e0767)]);}this['_layer']=null,this['_map']=null;}['_mountedHook'](){}['_addedHook'](_0x5aa041){}[_0x3d5d32(0x566)](){}['enableControl'](_0x56f923){const _0xe31e36={_0x20724b:0x49a,_0x4f1ca0:0x1d1,_0x25c283:0xa63},_0x3b9358=_0x3d5d32;this['_map'][_0x3b9358(_0xe31e36._0x20724b)]['enabledMoveTarget']=_0x56f923,this['_map'][_0x3b9358(0x1055)]&&(this[_0x3b9358(_0xe31e36._0x4f1ca0)][_0x3b9358(0x1055)][_0x3b9358(_0xe31e36._0x25c283)]=_0x56f923),this['_map'][_0x3b9358(0xf26)]&&(this['_map']['tooltip']['enabled']=_0x56f923),this['_map']['contextmenu']&&(this['_map'][_0x3b9358(0x45c)]['enabled']=_0x56f923);}['setOptions'](_0x3e65b7){const _0x2287f4={_0xf868ab:0xb69,_0x1c1d5e:0x962,_0x286d29:0x433,_0x140ed3:0x962},_0x4463ae=_0x3d5d32;if(!_0x3e65b7||Object['keys'](_0x3e65b7)['length']===0x0)return this;for(const _0x33d450 in _0x3e65b7){const _0x5b4945=_0x3e65b7[_0x33d450];switch(_0x33d450){case'name':case'show':case _0x4463ae(_0x2287f4._0xf868ab):case'positions':case'targetPosition':this['options'][_0x33d450]=_0x5b4945,this[_0x33d450]=_0x5b4945;break;case'orientation':this['options'][_0x33d450]=_0x5b4945,this['czmObject'][_0x33d450]=_0x5b4945;break;case'attr':{this['options'][_0x4463ae(0xe12)]=merge(this['options']['attr'],_0x3e65b7['attr']),this['fire'](EventType['updateAttr'],{'attr':_0x3e65b7['attr']},!![]);break;}case'style':{this['options'][_0x4463ae(0xdde)]=merge(this['options']['style'],_0x3e65b7['style']),this[_0x4463ae(0x929)](_0x3e65b7['style']),this['fire'](EventType['updateStyle'],{'style':_0x3e65b7['style']},!![]);break;}default:{isObject(_0x5b4945)?this['options'][_0x33d450]=merge(this[_0x4463ae(0x433)][_0x33d450],_0x5b4945):this['options'][_0x33d450]=_0x5b4945;break;}}}return(_0x3e65b7['popup']||_0x3e65b7[_0x4463ae(0x2c6)])&&this['bindPopup'](this['options']['popup'],this['options']['popupOptions']),(_0x3e65b7['tooltip']||_0x3e65b7['tooltipOptions'])&&this['bindTooltip'](this['options']['tooltip'],this['options']['tooltipOptions']),(_0x3e65b7['contextmenuItems']||_0x3e65b7[_0x4463ae(_0x2287f4._0x1c1d5e)])&&this['bindContextMenu'](this[_0x4463ae(_0x2287f4._0x286d29)]['contextmenuItems'],this['options'][_0x4463ae(_0x2287f4._0x140ed3)]),this['_setOptionsHook']&&this['_setOptionsHook'](this['options'],_0x3e65b7),this;}[_0x3d5d32(0xa2a)](_0x537d90){const _0x469767={_0x3f5f02:0xe16,_0x487c06:0xdde,_0x53fd26:0xd5d,_0x3d598f:0x56e},_0x5c9408=_0x3d5d32;var _0x117890;return _0x537d90['material']&&delete this['options']['style']['material'],_0x537d90['materialType']&&this['options']['style'][_0x5c9408(_0x469767._0x3f5f02)]&&delete this['options'][_0x5c9408(_0x469767._0x487c06)]['materialOptions'],this['options']['style']=merge(this['options']['style'],_0x537d90),!((_0x117890=this['_layer'])!==null&&_0x117890!==void 0x0&&_0x117890[_0x5c9408(_0x469767._0x53fd26)])&&Cesium__namespace['defined'](_0x537d90['highlight'])&&(_0x537d90[_0x5c9408(_0x469767._0x3d598f)]?this['bindHighlight'](this['style']['highlight']):this['unbindHighlight']()),this['_updateStyleBaseHook'](_0x537d90),this['fire'](EventType[_0x5c9408(0x1cf)],{'style':_0x537d90},!![]),this;}['_updateStyleBaseHook'](_0x1e8de5){}['setOpacity'](_0x3327ed){const _0x5b1d6={_0x53e9ac:0x842},_0x56e802=_0x3d5d32;clearTimeout(this[_0x56e802(0x73b)]),this['_canrefresh']=setTimeout(()=>{const _0x3d31c3=_0x56e802;this[_0x3d31c3(_0x5b1d6._0x53e9ac)]&&this['setStyle']({'globalAlpha':_0x3327ed});},0x1f4);}['toGeoJSON'](_0x1b7674){const _0x349834={_0x4ee558:0xe12,_0x4bd635:0xdde,_0x51e3e6:0x21f,_0x3da6b9:0xb69,_0x22f9cd:0xb39,_0x4d1929:0xbcb,_0x2d1900:0x433,_0x306121:0x64a},_0x59145f=_0x3d5d32,_0x314099={'type':'Feature','properties':{'name':this['name'],...this[_0x59145f(_0x349834._0x4ee558)],'id':this['id'],'type':this['type'],'style':this['_style2JsonBase'](this[_0x59145f(_0x349834._0x4bd635)],!![])}};if(this[_0x59145f(_0x349834._0x51e3e6)])_0x314099[_0x59145f(0x5a7)]=this['_getGeoJsonGeometry'](_0x1b7674);else{if(this[_0x59145f(_0x349834._0x3da6b9)])_0x314099['geometry']={'type':_0x59145f(_0x349834._0x22f9cd),'coordinates':this['getCoordinate'](_0x1b7674===null||_0x1b7674===void 0x0?void 0x0:_0x1b7674['noAlt'])};else this['positions']&&(_0x314099['geometry']={'type':_0x59145f(0x96f),'coordinates':this['getCoordinates'](_0x1b7674===null||_0x1b7674===void 0x0?void 0x0:_0x1b7674[_0x59145f(_0x349834._0x4d1929)])});}return Cesium__namespace['defined'](this['options'][_0x59145f(0x445)])&&(_0x314099[_0x59145f(0x271)]['styleType']=this[_0x59145f(_0x349834._0x2d1900)]['styleType']),this[_0x59145f(_0x349834._0x306121)]&&this['_toJSON_Ex'](_0x314099['properties']),_0x314099;}['toJSON'](){const _0x37def8={_0x1c5529:0x433,_0x57dffe:0xaed,_0x247058:0xdde,_0x143f0f:0xbb8,_0x3bf42a:0xb1c,_0x3d7de9:0x445},_0x4197ed=_0x3d5d32,_0x20b41b={...getAttrVal(this[_0x4197ed(_0x37def8._0x1c5529)],{'onlySimpleType':!![]}),'id':this['id'],'name':this[_0x4197ed(_0x37def8._0x57dffe)],'type':this[_0x4197ed(0x7f5)],'attr':this[_0x4197ed(0xe12)],'style':this[_0x4197ed(0x5e5)](this[_0x4197ed(_0x37def8._0x247058)],![])};if(this['_getJsonPositions'])this[_0x4197ed(0x506)](_0x20b41b);else{if(this['coordinate'])_0x20b41b['position']=this['coordinate'];else this['coordinates']?_0x20b41b[_0x4197ed(_0x37def8._0x143f0f)]=this['coordinates']:logError$1(_0x4197ed(_0x37def8._0x3bf42a),this);}return Cesium__namespace['defined'](this['options']['styleType'])&&this['options']['styleType']!==this['type']&&(_0x20b41b['styleType']=this[_0x4197ed(0x433)][_0x4197ed(_0x37def8._0x3d7de9)]),this['_toJSON_Ex']&&this['_toJSON_Ex'](_0x20b41b),_0x20b41b;}[_0x3d5d32(0x5e5)](_0x4f1622,_0x4eeba4){const _0x54ca3b={_0x2919b1:0x576},_0x162bff=_0x3d5d32;let _0x666a0a;return this[_0x162bff(0x53e)]?(_0x666a0a=this['_style2Json'](_0x4f1622),_0x4f1622['highlight']&&(_0x666a0a[_0x162bff(0x56e)]=this['_style2Json'](_0x4f1622[_0x162bff(0x56e)]))):_0x666a0a=getAttrVal(_0x4f1622,{'onlySimpleType':!![]}),_0x4f1622['label']&&(_0x666a0a['label']=LabelStyleConver['toJSON'](_0x4f1622['label'])),_0x4f1622[_0x162bff(_0x54ca3b._0x2919b1)]&&(_0x666a0a['outlineStyle']=PolylineStyleConver['toJSON'](_0x4f1622['outlineStyle'])),_0x666a0a;}['bindUpdateEvent'](){const _0x224567={_0x46f5ac:0x1d1,_0x475525:0x364},_0x166f5f=_0x3d5d32;if(!this['update']||!this['_map'])return;this['unbindUpdateEvent'](),this[_0x166f5f(_0x224567._0x46f5ac)]['on'](EventType['preRender'],this[_0x166f5f(_0x224567._0x475525)],this),this['_map_preRenderHandler'](this[_0x166f5f(_0x224567._0x46f5ac)]['scene']);}[_0x3d5d32(0x913)](){const _0x456d13=_0x3d5d32;this['_map']&&this['_map'][_0x456d13(0x9e7)](EventType[_0x456d13(0x90a)],this['_map_preRenderHandler'],this);}['_map_preRenderHandler'](_0x4ba51a){const _0x3d53bf={_0x193bc1:0x211},_0x38695c=_0x3d5d32;var _0x10b5fe;if(!this[_0x38695c(0x1d1)])return;if((_0x10b5fe=this['options'])!==null&&_0x10b5fe!==void 0x0&&_0x10b5fe['frameRate']&&this[_0x38695c(_0x3d53bf._0x193bc1)]){const _0x10a357=_0x4ba51a['_frameState']['frameNumber']-this['_last_preUpdateTime'];if(_0x10a3570x0)return getRectangle(_0x1f2787,_0x435f51===null||_0x435f51===void 0x0?void 0x0:_0x435f51['isFormat']);if(this['position'])return getRectangle([this['position']],_0x435f51===null||_0x435f51===void 0x0?void 0x0:_0x435f51[_0x418319(_0xf6d3ee._0x2c0111)]);}['getMaxHeight'](){const _0x2399b3={_0xd34429:0x326},_0x59692d=_0x3d5d32,_0x2ee981=this[_0x59692d(_0x2399b3._0xd34429)]||this['positions'];if(_0x2ee981&&_0x2ee981['length']>0x0)return getMaxHeight(_0x2ee981);if(this['position'])return getRectangle(this['position']);return 0x0;}[_0x3d5d32(0xefc)](_0x125444,_0x5e4878={},_0x4617a2){return _0x5e4878['graphic']=this,super['fire'](_0x125444,_0x5e4878,_0x4617a2);}[_0x3d5d32(0xd67)](_0x2e31d2={}){const _0x16b784={_0x1a1020:0x1d1,_0x1f6302:0xb69},_0x5c262b=_0x3d5d32;if(!this[_0x5c262b(_0x16b784._0x1a1020)])return Promise['resolve'](![]);this['options']['flyToOptions']&&(_0x2e31d2={...this['options']['flyToOptions'],..._0x2e31d2});let _0x1d4e87;if(this['positionsShow'])_0x1d4e87=this['positionsShow'];else{if(this['positions'])_0x1d4e87=this[_0x5c262b(0xbb8)];else this['position']&&(_0x1d4e87=[this[_0x5c262b(_0x16b784._0x1f6302)]]);}return _0x2e31d2['clampToGround']=this['style'][_0x5c262b(0x7c0)],this[_0x5c262b(_0x16b784._0x1a1020)]['flyToPositions'](_0x1d4e87,_0x2e31d2);}[_0x3d5d32(0x1003)](_0x1d29b1=0x0){const _0x1c9b26=_0x3d5d32;let _0x5cbf4a=this['style'][_0x1c9b26(0x9ce)];if(Cesium__namespace['defined'](_0x5cbf4a)){if(isString(_0x5cbf4a))_0x5cbf4a=Number(template(_0x5cbf4a,this['attr'],!![])),isNaN(_0x5cbf4a)&&(_0x5cbf4a=0x0);else Array[_0x1c9b26(0x62b)](_0x5cbf4a)&&(_0x5cbf4a=_0x5cbf4a[_0x1d29b1]||0x0);return _0x5cbf4a;}return 0x0;}['bindHighlight'](_0x1b3e69){const _0x7e0f61=_0x3d5d32;this['unbindHighlight'](),this['_highlightOptions']=_0x1b3e69,this['_highlightOptions'][_0x7e0f61(0x7f5)]===EventType['click']?this['on'](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['on'](EventType['mouseOver'],this['_highlight_mouseEventHandler'],this),this['on'](EventType['mouseOut'],this['_highlight_mouseOutHandler'],this));}[_0x3d5d32(0x54e)](){const _0x23d452={_0x46ebdf:0x7f5,_0x4ac62f:0xb59,_0x18963e:0x1d1},_0x44c179=_0x3d5d32;this['_highlightOptions']&&(this['_highlightOptions'][_0x44c179(_0x23d452._0x46ebdf)]===EventType[_0x44c179(_0x23d452._0x4ac62f)]?this['off'](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['off'](EventType['mouseOver'],this['_highlight_mouseEventHandler'],this),this['off'](EventType['mouseOut'],this[_0x44c179(0x7f9)],this)),this[_0x44c179(_0x23d452._0x18963e)]['closeHighlight'](),this['_highlightOptions']=null);}['_highlight_mouseEventHandler'](_0x413edd){const _0x40025e=_0x3d5d32;if(!this['_map'])return;const _0x4dc630=_0x413edd===null||_0x413edd===void 0x0?void 0x0:_0x413edd[_0x40025e(0x328)];_0x4dc630?this['_map']['openHighlight'](_0x4dc630,this['_highlightOptions'],_0x413edd):this['_map']['closeHighlight']();}['_highlight_mouseOutHandler'](_0x701544){this['_map']['closeHighlight']();}['_closeAllControl'](){const _0x493de3={_0x1d17e0:0x1040,_0x3eaf5b:0xc2d},_0x54fe50=_0x3d5d32;this[_0x54fe50(_0x493de3._0x1d17e0)](),this[_0x54fe50(_0x493de3._0x3eaf5b)](),this['closeSmallTooltip'](),this[_0x54fe50(0x384)]();}['_getPopupPosition'](){const _0x3d9bdb={_0x37c47e:0xb69},_0x890b40=_0x3d5d32;return this[_0x890b40(_0x3d9bdb._0x37c47e)]||this['center'];}[_0x3d5d32(0xed2)](_0x46dc74){return Boolean(this['getPopupConfig'](_0x46dc74));}['getPopupConfig'](_0x403976=!![]){const _0x7887f5={_0x278580:0x873},_0x10ad62=_0x3d5d32;var _0x177a34;if(this['_popupConfig'])return{...this['_popupConfig']};if(_0x403976&&(_0x177a34=this['_layer'])!==null&&_0x177a34!==void 0x0&&_0x177a34['_popupConfig'])return{...this[_0x10ad62(_0x7887f5._0x278580)]['_popupConfig']};return null;}['bindPopup'](_0x34d052,_0x34f6ae={}){return this['_popupConfig']={'content':_0x34d052,'options':_0x34f6ae||this['options']['popupOptions'],'graphic':this,'layer':this['_layer']},this['_onEventHook']&&this['_onEventHook']('popup'),this;}['unbindPopup'](_0x136487){const _0x2efde9={_0x2ef8b1:0xf80,_0x58f9f8:0x1055},_0x169fe3=_0x3d5d32;return _0x136487?this[_0x169fe3(0xf80)]=![]:this[_0x169fe3(_0x2efde9._0x2ef8b1)]=null,this['_onEventHook']&&this['_onEventHook'](_0x169fe3(_0x2efde9._0x58f9f8)),this;}['openPopup'](_0x2e3c28,_0x18694c){const _0x16694f={_0x14f1ba:0x1d1},_0x35ce2d=_0x3d5d32,_0x1dec64=this['getPopupConfig']();return _0x1dec64&&this['_map']&&(_0x18694c&&(_0x1dec64['event']=_0x18694c),_0x1dec64[_0x35ce2d(0x328)]=this,_0x1dec64['layer']=this['_layer'],this[_0x35ce2d(_0x16694f._0x14f1ba)]['popup'][_0x35ce2d(0x7b0)](_0x2e3c28||this[_0x35ce2d(0x909)](),_0x1dec64)),this;}[_0x3d5d32(0x1040)](){const _0x5d1703={_0x5df910:0x1055},_0x3c9877=_0x3d5d32;return this['_map']&&this['_map'][_0x3c9877(_0x5d1703._0x5df910)]['close'](this),this;}['getPopup'](){if(this['_map'])return this['_map']['popup']['getPopup'](this);}['hasTooltip'](_0x13e1c7){return Boolean(this['getTooltipConfig'](_0x13e1c7));}['getTooltipConfig'](_0x216527=!![]){const _0x4e0982=_0x3d5d32;var _0x3619fc;if(this['_tooltipConfig'])return{...this['_tooltipConfig']};if(_0x216527&&(_0x3619fc=this['_layer'])!==null&&_0x3619fc!==void 0x0&&_0x3619fc['_tooltipConfig'])return{...this[_0x4e0982(0x873)]['_tooltipConfig']};return null;}[_0x3d5d32(0xefa)](_0x4a9fe,_0x5f0bf1){const _0x5e0f74={_0x53319e:0x388,_0x1e3e37:0xf05},_0x454843=_0x3d5d32;return this['_tooltipConfig']={'content':_0x4a9fe,'options':_0x5f0bf1||this['options'][_0x454843(_0x5e0f74._0x53319e)]},this[_0x454843(_0x5e0f74._0x1e3e37)]&&this['_onEventHook']('tooltip'),this;}[_0x3d5d32(0x47b)](_0x19f66f){const _0xf6979c=_0x3d5d32;return _0x19f66f?this[_0xf6979c(0xc12)]=![]:this[_0xf6979c(0xc12)]=null,this[_0xf6979c(0xf05)]&&this[_0xf6979c(0xf05)]('tooltip'),this;}[_0x3d5d32(0x743)](_0x3d20c0,_0x48ce38){const _0x3ba2f0={_0x32bd8f:0x1d1,_0x5e0df3:0x548},_0x166efe=_0x3d5d32,_0x4798dd=this['getTooltipConfig']();return _0x4798dd&&this[_0x166efe(_0x3ba2f0._0x32bd8f)]&&(_0x4798dd['graphic']=this,_0x4798dd[_0x166efe(_0x3ba2f0._0x5e0df3)]=this['_layer'],_0x48ce38&&(_0x4798dd['event']=_0x48ce38),this['_map']['tooltip']['open'](_0x3d20c0||this['_getPopupPosition'](),_0x4798dd)),this;}[_0x3d5d32(0xc2d)](){const _0x231358={_0x2ff6fd:0x1d1,_0x7f0010:0x447},_0x3f595d=_0x3d5d32;return this[_0x3f595d(_0x231358._0x2ff6fd)]&&this[_0x3f595d(0x1d1)]['tooltip'][_0x3f595d(_0x231358._0x7f0010)](this),this;}[_0x3d5d32(0x52a)](){const _0xec012={_0x1bb04b:0x1d1},_0x16c57d=_0x3d5d32;if(this[_0x16c57d(_0xec012._0x1bb04b)])return this[_0x16c57d(0x1d1)]['tooltip']['getTooltip'](this);}['hasContextMenu'](_0x1d9afe){const _0x52a425={_0x1eaa1e:0x7eb},_0x33a395=_0x3d5d32;return Boolean(this[_0x33a395(_0x52a425._0x1eaa1e)](_0x1d9afe));}[_0x3d5d32(0x7eb)](_0x1ddcc9=!![]){const _0x38b188={_0x2a130d:0xab5},_0x2ae797=_0x3d5d32;var _0x4cb0a4;if(this['_contextmenuConfig'])return this[_0x2ae797(_0x38b188._0x2a130d)];if(_0x1ddcc9&&(_0x4cb0a4=this['_layer'])!==null&&_0x4cb0a4!==void 0x0&&_0x4cb0a4['_contextmenuConfig'])return this['_layer'][_0x2ae797(_0x38b188._0x2a130d)];return null;}[_0x3d5d32(0xea4)](_0x52997c,_0x4d3262){const _0x20b6c8={_0x257744:0xf05},_0x55be30=_0x3d5d32;return this['_contextmenuConfig']={'content':_0x52997c,'options':_0x4d3262||this['options']['contextmenuOptions'],'graphic':this,'layer':this['_layer']},this[_0x55be30(_0x20b6c8._0x257744)]&&this[_0x55be30(0xf05)](_0x55be30(0x1016)),this;}[_0x3d5d32(0x40e)](_0x174e44){return _0x174e44?this['_contextmenuConfig']=![]:this['_contextmenuConfig']=null,this['_onEventHook']&&this['_onEventHook']('contextMenu'),this;}['openContextMenu'](_0x284c6b){const _0x3e5724={_0x402b0c:0x1d1},_0x301623=_0x3d5d32,_0x1e7712=this['getContextMenu']();return _0x1e7712&&this['_map']&&(_0x1e7712['graphic']=this,_0x1e7712[_0x301623(0x548)]=this['_layer'],this[_0x301623(_0x3e5724._0x402b0c)]['contextmenu']['open'](_0x284c6b||this['_getPopupPosition'](),_0x1e7712)),this;}['closeContextMenu'](){const _0x2d671e={_0x13d201:0xad4,_0x24dea3:0x447},_0x31fd74=_0x3d5d32;return this[_0x31fd74(_0x2d671e._0x13d201)]()&&this['_map']&&this['_map']['contextmenu'][_0x31fd74(_0x2d671e._0x24dea3)](this),this;}[_0x3d5d32(0xd86)](_0x1b3d5c,_0x253d28){const _0x4b121b=_0x3d5d32;return this[_0x4b121b(0x1d1)]&&this['_map']['openSmallTooltip'](_0x1b3d5c,_0x253d28),this;}['closeSmallTooltip'](){const _0x2fbef0={_0x57b250:0x1d1,_0x1a3d9f:0xc62},_0x4256aa=_0x3d5d32;return this[_0x4256aa(_0x2fbef0._0x57b250)]&&this['_map'][_0x4256aa(_0x2fbef0._0x1a3d9f)](),this;}['destroy'](_0x117b65){const _0x4c4906=_0x3d5d32;if(this[_0x4c4906(0xf35)]===State['DESTROY']||this['_noDestroy'])return;this['_state']!==State['REMOVED']&&(this['clear']&&this['clear'](),this['remove']()),super['destroy'](_0x117b65),this['_state']=State['DESTROY'];}}class FlickerEntity{constructor(_0x4bb701={}){const _0x1a8813=_0x3d5d32;this['color']=Cesium__namespace[_0x1a8813(0x882)][_0x1a8813(0x6e8)]['withAlpha'](0x0);}['startFlicker'](_0xd283f6,_0x5e976a={}){const _0x386acc={_0x4caa61:0x5d6,_0x27c4db:0xe8f,_0x11d207:0x882,_0x208fc2:0x4e2},_0x26aff2={_0x540908:0x5f5,_0x248285:0x5ac,_0x590a55:0xd8f,_0x237e66:0x65f,_0x1da9c9:0x65f,_0x49d415:0x65f,_0x2e756c:0xbbe,_0x3677cb:0xe8f,_0x16505a:0x32a,_0x522ec1:0xe8f},_0x236a8e=_0x3d5d32,_0x2e7ea6=this;return this['stopFlicker'](),this['entitys']=_0xd283f6,this[_0x236a8e(0x4e2)]=_0x5e976a['maxAlpha']??0.3,this[_0x236a8e(_0x386acc._0x4caa61)]=_0x5e976a['time'],this['color']=_0x5e976a[_0x236a8e(_0x386acc._0x27c4db)]??Cesium__namespace[_0x236a8e(_0x386acc._0x11d207)]['YELLOW'],this['color']=this['color']['withAlpha'](this[_0x236a8e(_0x386acc._0x208fc2)]),this['onEnd']=_0x5e976a['onEnd'],this['_startTime'](),loopArrayForFun(_0xd283f6,function(_0x3237b1){const _0x19e7b8=_0x236a8e;_0x3237b1['polygon']&&(_0x3237b1['polygon']['material_bak']=_0x3237b1['polygon'][_0x19e7b8(0xd8f)],_0x3237b1['polygon']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x4ea64a=>{return _0x2e7ea6['color'];},![]))),_0x3237b1['polyline']&&(_0x3237b1['polyline']['material_bak']=_0x3237b1['polyline']['material'],_0x3237b1['polyline']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x4f73f1=>{return _0x2e7ea6['color'];},![]))),_0x3237b1['ellipsoid']&&(_0x3237b1['ellipsoid'][_0x19e7b8(_0x26aff2._0x540908)]=_0x3237b1[_0x19e7b8(_0x26aff2._0x248285)][_0x19e7b8(_0x26aff2._0x590a55)],_0x3237b1['ellipsoid']['material']=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x2a5028=>{return _0x2e7ea6['color'];},![]))),_0x3237b1['ellipse']&&(_0x3237b1['ellipse']['material_bak']=_0x3237b1[_0x19e7b8(0x892)]['material'],_0x3237b1['ellipse'][_0x19e7b8(0xd8f)]=new Cesium__namespace['ColorMaterialProperty'](new Cesium__namespace['CallbackProperty'](_0x3534dc=>{const _0x3daaae=_0x19e7b8;return _0x2e7ea6[_0x3daaae(0xe8f)];},![]))),_0x3237b1['rectangle']&&(_0x3237b1['rectangle']['material_bak']=_0x3237b1['rectangle']['material'],_0x3237b1['rectangle']['material']=new Cesium__namespace[(_0x19e7b8(0xf14))](new Cesium__namespace['CallbackProperty'](_0x321828=>{const _0x1a0321=_0x19e7b8;return _0x2e7ea6[_0x1a0321(0xe8f)];},![]))),_0x3237b1[_0x19e7b8(_0x26aff2._0x237e66)]&&(_0x3237b1['wall']['material_bak']=_0x3237b1[_0x19e7b8(_0x26aff2._0x1da9c9)]['material'],_0x3237b1[_0x19e7b8(_0x26aff2._0x49d415)]['material']=new Cesium__namespace[(_0x19e7b8(0xf14))](new Cesium__namespace['CallbackProperty'](_0x4d76dc=>{const _0x27247c=_0x19e7b8;return _0x2e7ea6[_0x27247c(0xe8f)];},![]))),_0x3237b1['point']&&(_0x3237b1[_0x19e7b8(_0x26aff2._0x2e756c)]['color_bak']=_0x3237b1[_0x19e7b8(0xbbe)]['color'],_0x3237b1['point']['color']=_0x2e7ea6['color']),_0x3237b1['billboard']&&(_0x3237b1['billboard']['color_bak']=_0x3237b1['billboard'][_0x19e7b8(_0x26aff2._0x3677cb)],_0x3237b1['billboard'][_0x19e7b8(0xe8f)]=_0x2e7ea6[_0x19e7b8(0xe8f)]),_0x3237b1['model']&&(_0x3237b1['model']['color_bak']=_0x3237b1[_0x19e7b8(0x600)]['color'],_0x3237b1[_0x19e7b8(0x600)][_0x19e7b8(0xe8f)]=_0x2e7ea6['color']),_0x3237b1[_0x19e7b8(_0x26aff2._0x16505a)]&&(_0x3237b1[_0x19e7b8(0x32a)]['fillColor_bak']=_0x3237b1['label']['fillColor'],_0x3237b1['label']['fillColor']=_0x2e7ea6[_0x19e7b8(_0x26aff2._0x522ec1)]);}),this;}['stopFlicker'](){const _0x325313={_0x2cf3ea:0x72c},_0x5c5e6b={_0x34da0c:0x104e,_0x35f3d5:0xd8f,_0x28ac4a:0xd8f,_0x568a9e:0x5a3,_0x25c568:0xd8f,_0x3ce792:0xe8f,_0x1c4f3c:0x600,_0x114593:0x32a,_0x285504:0x520},_0x4977ed=_0x3d5d32;return this['_stopTime'](),this['entitys']&&(loopArrayForFun(this['entitys'],function(_0x367f78){const _0x1c4233=_0x4132;_0x367f78[_0x1c4233(_0x5c5e6b._0x34da0c)]&&(_0x367f78['polygon']['material_bak']&&(_0x367f78['polygon']['material']=_0x367f78['polygon'][_0x1c4233(0x5f5)])),_0x367f78['polyline']&&(_0x367f78['polyline'][_0x1c4233(0x5f5)]&&(_0x367f78['polyline'][_0x1c4233(_0x5c5e6b._0x35f3d5)]=_0x367f78[_0x1c4233(0x96e)]['material_bak'])),_0x367f78['ellipsoid']&&(_0x367f78['ellipsoid']['material_bak']&&(_0x367f78['ellipsoid'][_0x1c4233(_0x5c5e6b._0x28ac4a)]=_0x367f78['ellipsoid']['material_bak'])),_0x367f78['ellipse']&&(_0x367f78[_0x1c4233(0x892)]['material_bak']&&(_0x367f78['ellipse']['material']=_0x367f78[_0x1c4233(0x892)]['material_bak'])),_0x367f78['rectangle']&&(_0x367f78[_0x1c4233(_0x5c5e6b._0x568a9e)]['material_bak']&&(_0x367f78['rectangle']['material']=_0x367f78[_0x1c4233(0x5a3)]['material_bak'])),_0x367f78['wall']&&(_0x367f78[_0x1c4233(0x65f)]['material_bak']&&(_0x367f78['wall'][_0x1c4233(_0x5c5e6b._0x25c568)]=_0x367f78['wall']['material_bak'])),_0x367f78['point']&&(_0x367f78['point']['color_bak']&&(_0x367f78[_0x1c4233(0xbbe)][_0x1c4233(_0x5c5e6b._0x3ce792)]=_0x367f78['point'][_0x1c4233(0x374)])),_0x367f78[_0x1c4233(0x4a5)]&&(_0x367f78['billboard']['color_bak']?_0x367f78['billboard']['color']=_0x367f78[_0x1c4233(0x4a5)]['color_bak']:_0x367f78['billboard']['color']=undefined),_0x367f78['model']&&(_0x367f78['model']['color_bak']?_0x367f78['model']['color']=_0x367f78[_0x1c4233(0x600)][_0x1c4233(0x374)]:_0x367f78[_0x1c4233(_0x5c5e6b._0x1c4f3c)]['color']=undefined),_0x367f78[_0x1c4233(_0x5c5e6b._0x114593)]&&(_0x367f78['label']['fillColor_bak']&&(_0x367f78['label'][_0x1c4233(_0x5c5e6b._0x285504)]=_0x367f78['label']['fillColor_bak']));}),this[_0x4977ed(_0x325313._0x2cf3ea)]&&this['onEnd'](this['entitys']),delete this['entitys']),this;}['_updateClr'](){const _0x259ad5={_0x180a6a:0x4a5,_0x4d7980:0xe8f},_0x233ec6=this;this['entitys']&&loopArrayForFun(this['entitys'],function(_0x1d5c4c){const _0x474340=_0x4132;_0x1d5c4c[_0x474340(0xbbe)]&&(_0x1d5c4c[_0x474340(0xbbe)]['color']=_0x233ec6[_0x474340(0xe8f)]),_0x1d5c4c['billboard']&&(_0x1d5c4c[_0x474340(_0x259ad5._0x180a6a)]['color']=_0x233ec6[_0x474340(_0x259ad5._0x4d7980)]),_0x1d5c4c['model']&&(_0x1d5c4c['model']['color']=_0x233ec6[_0x474340(0xe8f)]),_0x1d5c4c['label']&&(_0x1d5c4c['label']['fillColor']=_0x233ec6['color']);});}['_startTime'](){const _0x3fa076=_0x3d5d32,_0x36454b=0x1e,_0x4102cf=this['maxAlpha']/_0x36454b;let _0x1bdeff=0x0;this['interVal']=setInterval(()=>{const _0x4825c6=_0x4132;_0x1bdeff+=_0x4102cf,_0x1bdeff>this['maxAlpha']&&(_0x1bdeff=0x0),this[_0x4825c6(0xe8f)]=this['color']['withAlpha'](_0x1bdeff),this['_updateClr']();},_0x36454b),this['time']&&(this['timeEndVal']=setTimeout(()=>{this['stopFlicker']();},this[_0x3fa076(0x5d6)]*0x3e8));}[_0x3d5d32(0x951)](){const _0x207444=_0x3d5d32;this['interVal']&&(clearInterval(this['interVal']),this[_0x207444(0xcd8)]=null),this[_0x207444(0xa25)]&&(clearTimeout(this['timeEndVal']),this['timeEndVal']=null);}}function loopArrayForFun(_0x497af2,_0x403dd5){const _0x34ca45={_0x5c88fc:0xc84},_0x53332b=_0x3d5d32;if(_0x497af2==null)return;if(Array['isArray'](_0x497af2)){const _0xbd7c6f=[];for(let _0x3c051a=0x0,_0x4ca763=_0x497af2[_0x53332b(_0x34ca45._0x5c88fc)];_0x3c051a<_0x4ca763;_0x3c051a++){_0xbd7c6f[_0x53332b(0xb75)](_0x403dd5(_0x497af2[_0x3c051a]));}return _0xbd7c6f;}else return _0x403dd5(_0x497af2);}class BaseEntity extends BaseGraphic{get['dataSource'](){var _0x22834d;return(_0x22834d=this['_layer'])===null||_0x22834d===void 0x0?void 0x0:_0x22834d['dataSource'];}get['czmObject'](){const _0x3a3c73={_0x576c6b:0x89b},_0x2d5c2d=_0x3d5d32;return this[_0x2d5c2d(_0x3a3c73._0x576c6b)];}get['czmObjectEx'](){let _0x3207b7=[];return this['_primitive_label']&&_0x3207b7['push'](this['_primitive_label']),this['_entity_outlines']&&(_0x3207b7=_0x3207b7['concat'](this['_entity_outlines'])),_0x3207b7;}get['entity'](){return this['_entity'];}get[_0x3d5d32(0xa09)](){var _0x27105d;return(_0x27105d=this['_entity'])===null||_0x27105d===void 0x0?void 0x0:_0x27105d['point'];}get['label'](){const _0x1e2939=_0x3d5d32;var _0x2d0cbf,_0x33f100;if(this['_primitive_label'])return this['_primitive_label'];if((_0x2d0cbf=this['_entity'])!==null&&_0x2d0cbf!==void 0x0&&_0x2d0cbf['label'])return this['_entity']['label'];if((_0x33f100=this['style'])!==null&&_0x33f100!==void 0x0&&_0x33f100['label']){var _0xcd6245;return(_0xcd6245=this[_0x1e2939(0xdde)])===null||_0xcd6245===void 0x0?void 0x0:_0xcd6245['label'];}return{};}get['isEditing'](){return this['_enabledEdit'];}[_0x3d5d32(0x981)](){const _0xf80cff={_0x541f18:0x8f1,_0x427793:0xb69},_0x1dd258=_0x3d5d32;this[_0x1dd258(0xc4d)]=![],this['_cancelPositionsCallback']();const _0x2fd042=this['_layer'];this[_0x1dd258(_0xf80cff._0x541f18)](),delete this['_entity'],this[_0x1dd258(0x433)]['positions']&&(this['positions']=this['options']['positions']),this['options'][_0x1dd258(0xb69)]&&(this[_0x1dd258(0xb69)]=this['options'][_0x1dd258(_0xf80cff._0x427793)]),this['_onAdd'](_0x2fd042),this[_0x1dd258(0xc4d)]=!![];}['_mountedHook'](){}['_addedHook'](_0x355c2a){const _0x4d976a={_0x5bba19:0x426},_0x5307ea=_0x3d5d32;this[_0x5307ea(_0x4d976a._0x5bba19)][_0x5307ea(0xea8)]['add'](this['czmObject']),this['czmObjectEx']['forEach'](_0xc11afe=>{_0xc11afe instanceof Cesium__namespace['Entity']&&this['dataSource']['entities']['add'](_0xc11afe);}),this[_0x5307ea(0xf97)]&&(this['_clampToGround_last']=this[_0x5307ea(0xdde)]['clampToGround']);}['_removedHook'](){const _0x153be6={_0x5dc87b:0xd2e,_0x54bd55:0x1061},_0x1f7090=_0x3d5d32;this['stopDraw'](),this['stopEditing'](),this['czmObject']&&this['dataSource']['entities']['remove'](this[_0x1f7090(_0x153be6._0x5dc87b)]),this['czmObjectEx']&&this[_0x1f7090(0xc51)][_0x1f7090(_0x153be6._0x54bd55)](_0x2e83d7=>{const _0xd53ce0=_0x1f7090;_0x2e83d7 instanceof Cesium__namespace['Entity']&&this[_0xd53ce0(0x426)]['entities']['remove'](_0x2e83d7);}),this[_0x1f7090(0xdaf)]&&(this['_layer'][_0x1f7090(0x6e2)]['remove'](this['_primitive_label']),delete this['_primitive_label']);}[_0x3d5d32(0x298)](_0x1f0aa6){const _0xed9291=_0x3d5d32;return _0x1f0aa6['entityCollection']&&_0x1f0aa6[_0xed9291(0xba5)]['remove'](_0x1f0aa6),_0x1f0aa6['_id']=this['id'],_0x1f0aa6;}['_updateEditDraggers'](){const _0x271491={_0x469161:0xa63},_0x1fc554=_0x3d5d32;var _0x1c18e7;(_0x1c18e7=this['editing'])!==null&&_0x1c18e7!==void 0x0&&_0x1c18e7[_0x1fc554(_0x271491._0x469161)]&&this['editing']['updateDraggers']();}[_0x3d5d32(0x929)](_0x3817b2){const _0x4bed72={_0x18873e:0xd2e,_0x102e4c:0xa0d,_0x55183a:0x981,_0x11e989:0xf22},_0x5a31f4=_0x3d5d32;var _0x18f499;if(!this[_0x5a31f4(_0x4bed72._0x18873e)]||!_0x3817b2)return;if(this['_clampToGround_reload']&&Cesium__namespace['defined'](_0x3817b2['clampToGround'])){if(_0x3817b2['clampToGround']!==this[_0x5a31f4(_0x4bed72._0x102e4c)]){this[_0x5a31f4(_0x4bed72._0x55183a)](),this[_0x5a31f4(_0x4bed72._0x102e4c)]=_0x3817b2[_0x5a31f4(0x7c0)];return;}}return(Cesium__namespace['defined'](_0x3817b2[_0x5a31f4(0x9e4)])||Cesium__namespace['defined'](_0x3817b2[_0x5a31f4(0x9ce)]))&&(this['_positions_draw']?(this[_0x5a31f4(0xbb8)]=this[_0x5a31f4(0xd76)],this[_0x5a31f4(_0x4bed72._0x11e989)](![])):this['positions']=this['positionsShow']),this[_0x5a31f4(0x7b3)](this['style'],_0x3817b2),this['_updateLabelStyleHook'](this['style'],_0x3817b2),this['_getOutlinePositions']&&this['_updateOutlineStyle'](this['_getOutlinePositions'](),this['style']),this['_updateExOpacity']&&Cesium__namespace['defined'](_0x3817b2['globalAlpha'])&&this[_0x5a31f4(0x360)](_0x3817b2['globalAlpha']),this[_0x5a31f4(0x3a0)]&&this[_0x5a31f4(0xcfb)](),(_0x18f499=this['editing'])!==null&&_0x18f499!==void 0x0&&_0x18f499['enabled']&&this['editing'][_0x5a31f4(0x7b3)](_0x3817b2),this;}[_0x3d5d32(0xcfb)](){const _0xcbc3cc={_0xed21bb:0x342,_0x47002c:0x96e,_0x3a7cb7:0x7c0},_0xdb254c=_0x3d5d32;let _0x379fe9;const _0x278e10=this['center'];_0x278e10?_0x379fe9=Cesium__namespace['Cartesian3']['distance'](_0x278e10,new Cesium__namespace['Cartesian3']()):_0x379fe9=(Cesium__namespace['Ellipsoid']['WGS84']['minimumRadius']+Cesium__namespace['Ellipsoid']['WGS84']['maximumRadius'])/0x2;this['_isCallbackPositions']?this[_0xdb254c(0x342)](_0x379fe9):this[_0xdb254c(_0xcbc3cc._0xed21bb)]();if(this['_entity_outlines'])for(let _0x5cf87e=0x0,_0x5e0bdd=this['_entity_outlines'][_0xdb254c(0xc84)];_0x5cf87e<_0x5e0bdd;_0x5cf87e++){const _0x5aa8b0=this['_entity_outlines'][_0x5cf87e][_0xdb254c(_0xcbc3cc._0x47002c)];this['style']['distanceDisplayCondition']?_0x5aa8b0['positions']instanceof Cesium__namespace['CallbackProperty']&&this['style'][_0xdb254c(_0xcbc3cc._0x3a7cb7)]?this[_0xdb254c(0x81e)](_0x5aa8b0,_0x379fe9):this['updateOutlinesDistanceDisplayCondition'](_0x5aa8b0):_0x5aa8b0[_0xdb254c(0x8f0)]=undefined;}}['updateDistanceDisplayCondition'](_0x5eff8f=0x0){const _0x57ccb5={_0x347df5:0xdde},_0x398719=_0x3d5d32;this[_0x398719(_0x57ccb5._0x347df5)]['distanceDisplayCondition']?this['entityGraphic']['distanceDisplayCondition']=new Cesium__namespace[(_0x398719(0xe4a))](Number((this['style']['distanceDisplayCondition_near']??0x0)+_0x5eff8f),Number((this[_0x398719(_0x57ccb5._0x347df5)]['distanceDisplayCondition_far']??Number['MAX_VALUE'])+_0x5eff8f)):this[_0x398719(0xa09)][_0x398719(0x8f0)]=undefined;}['updateOutlinesDistanceDisplayCondition'](_0x68ba0,_0x38e9dd=0x0){const _0x1dcb84=_0x3d5d32;_0x68ba0['distanceDisplayCondition']=new Cesium__namespace[(_0x1dcb84(0xe4a))](Number((this['style']['distanceDisplayCondition_near']??0x0)+_0x38e9dd),Number((this['style'][_0x1dcb84(0xc42)]??Number['MAX_VALUE'])+_0x38e9dd));}['_updateStyleHook'](_0x3dda32,_0x242950){}[_0x3d5d32(0x70e)](_0x51a58e,_0x8f99b9=!![]){const _0x4c023e={_0x21cfb1:0x1d1,_0x35069c:0xdde,_0x33f929:0xc84,_0x5089ab:0xbd4},_0xba3a39=_0x3d5d32;var _0x42848b;_0x8f99b9&&(this[_0xba3a39(0x1d1)]['closeHighlight'](),this[_0xba3a39(_0x4c023e._0x21cfb1)]['last_highlighGraphic']=this);const _0x757abc=_0x51a58e||this['_highlightOptions']||((_0x42848b=this['_layer'])===null||_0x42848b===void 0x0?void 0x0:_0x42848b['_highlightOptions']);if(_0x757abc){const _0x4d4bd5=[];for(const _0x3c5fd7 in _0x757abc){if(_0x3c5fd7==='type')continue;!Cesium__namespace[_0xba3a39(0xb84)](this[_0xba3a39(_0x4c023e._0x35069c)][_0x3c5fd7])&&_0x4d4bd5['push'](_0x3c5fd7);}_0x4d4bd5[_0xba3a39(_0x4c023e._0x33f929)]>0x0&&logWarn('openHighlight:原有style中不存在以下属性,关闭高亮时将无法恢复',_0x4d4bd5);const _0x221231=merge(clone(this['style']),_0x757abc);this['_updateStyleHook'](_0x221231,_0x757abc),this['_updateLabelStyleHook'](_0x221231,_0x757abc),this['fire'](EventType[_0xba3a39(_0x4c023e._0x5089ab)],{},!![]);}}[_0x3d5d32(0x759)](){const _0x264d54={_0x4a9c70:0x1d1,_0x2d1a4a:0x5fd},_0x5949b8=_0x3d5d32;var _0x22b0ba;if(!this[_0x5949b8(0x842)]||((_0x22b0ba=this[_0x5949b8(_0x264d54._0x4a9c70)])===null||_0x22b0ba===void 0x0?void 0x0:_0x22b0ba['last_highlighGraphic'])!==this)return;this[_0x5949b8(0x7b3)](this['style'],this['style']),this['_updateLabelStyleHook'](this[_0x5949b8(0xdde)],this[_0x5949b8(0xdde)]),this[_0x5949b8(0x1d1)][_0x5949b8(_0x264d54._0x2d1a4a)](),this[_0x5949b8(0xefc)](EventType[_0x5949b8(0x2e1)],{},!![]);}['_createEntity'](_0x27f201){const _0x1cf63b={_0x31fa46:0x433,_0x290a4f:0x792,_0x2d26f2:0x433,_0x3ecaa1:0xa03},_0x3a296e=_0x3d5d32;this['options']['onBeforeCreate']&&(_0x27f201=this[_0x3a296e(_0x1cf63b._0x31fa46)]['onBeforeCreate'](_0x27f201)||_0x27f201);this['_onBeforeCreate']&&(_0x27f201=this['_onBeforeCreate'](_0x27f201)||_0x27f201);const _0x15db56={'id':this['id'],'name':this['name']||this['id'],'properties':this['attr'],'show':this[_0x3a296e(_0x1cf63b._0x290a4f)],'parent':this['options']['parent']};this['options']['availability']&&(_0x15db56['availability']=this['options']['availability']);this['options']['description']&&(_0x15db56[_0x3a296e(0xa03)]=this[_0x3a296e(_0x1cf63b._0x2d26f2)][_0x3a296e(_0x1cf63b._0x3ecaa1)]);this['options']['viewFrom']&&(_0x15db56['viewFrom']=this['options']['viewFrom']);this['options']['parent']&&(_0x15db56['parent']=this['options']['parent']);const _0x1dfe55=new Cesium__namespace['Entity']({..._0x15db56,..._0x27f201});return _0x1dfe55;}['_updateLabelStyleHook'](_0x320047,_0x2004e1){const _0x24c00f={_0x398319:0x7c0,_0xae2dd7:0x83e,_0x195393:0xb84,_0x3fc250:0x32a,_0x28d1fe:0x9e4,_0x21154d:0x3d2,_0x353551:0x39d},_0xb64e4a=_0x3d5d32;if(_0x2004e1!==null&&_0x2004e1!==void 0x0&&_0x2004e1['label']){Cesium__namespace['defined'](_0x320047[_0xb64e4a(0x7c0)])&&!Cesium__namespace['defined'](_0x320047[_0xb64e4a(0x32a)][_0xb64e4a(0x7c0)])&&(_0x2004e1['label']['clampToGround']=_0x320047[_0xb64e4a(_0x24c00f._0x398319)]);if(this['_primitive_label']){var _0xb6f1ef,_0x4e7b2f,_0x39151d,_0x2e9fe9;LabelStyleConver['toCesiumVal'](_0x320047['label'],this['_primitive_label'],this['attr']),(Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0xb6f1ef=_0x2004e1[_0xb64e4a(0x32a)])===null||_0xb6f1ef===void 0x0?void 0x0:_0xb6f1ef['position'])||Cesium__namespace[_0xb64e4a(0xb84)](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0x4e7b2f=_0x2004e1['label'])===null||_0x4e7b2f===void 0x0?void 0x0:_0x4e7b2f[_0xb64e4a(_0x24c00f._0xae2dd7)])||Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0x39151d=_0x2004e1['label'])===null||_0x39151d===void 0x0?void 0x0:_0x39151d['addHeight'])||Cesium__namespace[_0xb64e4a(_0x24c00f._0x195393)](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0x2e9fe9=_0x2004e1[_0xb64e4a(_0x24c00f._0x3fc250)])===null||_0x2e9fe9===void 0x0?void 0x0:_0x2e9fe9['setHeight']))&&this['_updateLabelPosition']();}else{if(this['_entity']['label']){var _0x16e4c8,_0x13dea8,_0xa6cf6f;LabelStyleConver['toCesiumVal'](_0x320047['label'],this['_entity'][_0xb64e4a(_0x24c00f._0x3fc250)],this['attr']),(Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0x16e4c8=_0x2004e1['label'])===null||_0x16e4c8===void 0x0?void 0x0:_0x16e4c8[_0xb64e4a(0x83e)])||Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0x13dea8=_0x2004e1[_0xb64e4a(_0x24c00f._0x3fc250)])===null||_0x13dea8===void 0x0?void 0x0:_0x13dea8[_0xb64e4a(0x9ce)])||Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:(_0xa6cf6f=_0x2004e1['label'])===null||_0xa6cf6f===void 0x0?void 0x0:_0xa6cf6f[_0xb64e4a(_0x24c00f._0x28d1fe)]))&&this['_updateLabelPosition']();}else this[_0xb64e4a(_0x24c00f._0x21154d)]();}}else Cesium__namespace['defined'](_0x2004e1===null||_0x2004e1===void 0x0?void 0x0:_0x2004e1['globalAlpha'])&&this[_0xb64e4a(_0x24c00f._0x353551)](_0x2004e1['globalAlpha']);}['_addLabel'](){const _0x2d50bf={_0x1205d3:0x32a,_0x1169f3:0xe12,_0x37e625:0x6cb,_0xf7456b:0x6e2,_0x170759:0xdaf},_0x46ea69=_0x3d5d32,_0x42bdbf=this['style']['label'];if(!_0x42bdbf||!_0x42bdbf['text'])return;Cesium__namespace['defined'](this[_0x46ea69(0xdde)]['clampToGround'])&&!Cesium__namespace[_0x46ea69(0xb84)](_0x42bdbf['clampToGround'])&&!Cesium__namespace['defined'](_0x42bdbf['height'])&&(_0x42bdbf[_0x46ea69(0x7c0)]=this[_0x46ea69(0xdde)]['clampToGround']);const _0x4bed1a=LabelStyleConver['toCesiumVal'](this['style'][_0x46ea69(_0x2d50bf._0x1205d3)],{},this[_0x46ea69(_0x2d50bf._0x1169f3)]);return _0x4bed1a['show']=this['show'],_0x4bed1a['position']=this[_0x46ea69(_0x2d50bf._0x37e625)](),this[_0x46ea69(0xdaf)]&&this['_layer']['labelCollection']['remove'](this['_primitive_label']),this['_primitive_label']=this['_layer'][_0x46ea69(_0x2d50bf._0xf7456b)]['add'](_0x4bed1a),this['bindPickId'](this['_primitive_label']),this[_0x46ea69(_0x2d50bf._0x170759)];}[_0x3d5d32(0x429)](){const _0x675be8=_0x3d5d32;this[_0x675be8(0xdaf)]&&(this['_primitive_label']['position']=this['_getLablePosition']());}['_updateLabelOpacity'](_0xf3a42c){const _0x1eb8f8={_0xa03edc:0x32a,_0x52455f:0x89b,_0x30699e:0xdaf},_0x36458b=_0x3d5d32;var _0x3868f5;(_0x3868f5=this['_entity'])!==null&&_0x3868f5!==void 0x0&&_0x3868f5[_0x36458b(_0x1eb8f8._0xa03edc)]&&LabelStyleConver['setOpacity'](this[_0x36458b(_0x1eb8f8._0x52455f)]['label'],_0xf3a42c),this[_0x36458b(0xdaf)]&&this[_0x36458b(0xdaf)]['show']&&LabelStyleConver[_0x36458b(0xb2d)](this[_0x36458b(_0x1eb8f8._0x30699e)],_0xf3a42c);}['_getLablePosition'](){const _0xd9db8b={_0x32c048:0xb69,_0x1c3c47:0xed4,_0x37fe8d:0xb84,_0x217c97:0xdde,_0x195190:0x9ce,_0x49fbaf:0xe12},_0x1f8005=_0x3d5d32,_0x4e8987=this['style'][_0x1f8005(0x32a)];let _0x42b642;if(_0x4e8987['position']){if(_0x4e8987['position']==='center')_0x42b642=this['centerOfMass'];else{if(isString(_0x4e8987['position'])){const _0x47ff3b=template(_0x4e8987[_0x1f8005(_0xd9db8b._0x32c048)],this[_0x1f8005(0xe12)],!![]);_0x47ff3b&&(_0x42b642=LngLatPoint['parse'](_0x47ff3b)['toCartesian']());}else _0x42b642=LngLatPoint['parse'](_0x4e8987[_0x1f8005(0xb69)])[_0x1f8005(_0xd9db8b._0x1c3c47)]();}}!_0x42b642&&(_0x42b642=this['center']);if(!_0x42b642)return new Cesium__namespace['Cartesian3']();if(Cesium__namespace['defined'](_0x4e8987['height'])||Cesium__namespace[_0x1f8005(_0xd9db8b._0x37fe8d)](this[_0x1f8005(0xdde)]['height'])){const _0x11c4e5=_0x4e8987['height']??this['style']['height'];_0x42b642=setPositionsHeight(_0x42b642,_0x11c4e5);}Cesium__namespace['defined'](this[_0x1f8005(_0xd9db8b._0x217c97)]['diffHeight'])&&(_0x42b642=addPositionsHeight(_0x42b642,this['style']['diffHeight']));let _0x42fc6e=_0x4e8987['setHeight'];Cesium__namespace['defined'](_0x42fc6e)&&(isString(_0x42fc6e)&&(_0x42fc6e=Number(template(_0x42fc6e,this['attr'],!![])),isNaN(_0x42fc6e)&&(_0x42fc6e=0x0)),_0x42b642=setPositionsHeight(_0x42b642,_0x42fc6e));let _0x574488=_0x4e8987[_0x1f8005(_0xd9db8b._0x195190)];return Cesium__namespace['defined'](_0x574488)&&(isString(_0x574488)&&(_0x574488=Number(template(_0x574488,this[_0x1f8005(_0xd9db8b._0x49fbaf)],!![])),isNaN(_0x574488)&&(_0x574488=0x0)),_0x42b642=addPositionsHeight(_0x42b642,_0x574488)),_0x42b642;}['_createLabel'](_0x1accd0={},_0x1b6fe2){const _0x3592ec={_0x242101:0x873,_0x435680:0x84b,_0xed853e:0xc6f},_0x220b6a=_0x3d5d32;if(_0x1accd0['type']&&_0x1accd0['type']!=='label'){const _0x196d22=create$4(_0x1accd0['type'],{'position':_0x1b6fe2,'style':_0x1accd0,'hasEdit':![],'isPrivate':!![]});return Object['defineProperties'](_0x196d22,{'text':{'set':function(_0x4d010b){this['attr']['text']=_0x4d010b,this['style']['updateText'](_0x4d010b,this);},'get':function(){const _0x3b62b6=_0x4132;return this[_0x3b62b6(0xe12)]['text'];}}}),this[_0x220b6a(_0x3592ec._0x242101)]['addGraphic'](_0x196d22),_0x196d22;}else{const _0x1629ce=LabelStyleConver['toCesiumVal']({'color':_0x220b6a(_0x3592ec._0x435680),'font_size':0x14,'outline':!![],'outlineColor':_0x220b6a(0xd2c),'outlineWidth':0x3,'background':!![],'backgroundColor':'#000000','backgroundOpacity':0.5,'scaleByDistance':!![],'scaleByDistance_far':0xc3500,'scaleByDistance_farValue':0.5,'scaleByDistance_near':0x3e8,'scaleByDistance_nearValue':0x1,'pixelOffsetY':-0xf,'horizontalOrigin':Cesium__namespace['HorizontalOrigin']['LEFT'],'verticalOrigin':Cesium__namespace['VerticalOrigin']['BOTTOM'],'visibleDepth':![],..._0x1accd0});_0x1b6fe2&&(_0x1629ce['position']=_0x1b6fe2);const _0x6fc35a=this['_layer']['labelCollection']['add'](_0x1629ce);return this[_0x220b6a(_0x3592ec._0xed853e)](_0x6fc35a),_0x6fc35a['_noMousePick']=!![],_0x6fc35a['hasEdit']=![],_0x6fc35a;}}['_removeLabel'](_0x348aff){_0x348aff['isAdded']?this['_layer']['removeGraphic'](_0x348aff,!![]):this['_layer']['labelCollection']['remove'](_0x348aff);}['_getOutlineStyle'](_0x3d52ff,_0x4cafa9){const _0x37c9f2={_0x504c18:0x7c0},_0x44d1ee=_0x3d5d32,_0x449468={..._0x3d52ff};return delete _0x449468['material'],delete _0x449468[_0x44d1ee(0xb2a)],delete _0x449468['materialOptions'],delete _0x449468[_0x44d1ee(0xe7a)],delete _0x449468['outlineColor'],delete _0x449468['outlineOpacity'],delete _0x449468['outlineWidth'],delete _0x449468['outlineStyle'],{..._0x449468,'show':_0x3d52ff['outline']??![],'color':_0x3d52ff['outlineColor']??Cesium__namespace[_0x44d1ee(0x882)]['WHITE'],'opacity':_0x3d52ff['outlineOpacity'],'width':_0x3d52ff[_0x44d1ee(0xa54)]??0x1,'arcType':_0x3d52ff['arcType']??_0x3d52ff[_0x44d1ee(_0x37c9f2._0x504c18)]?Cesium__namespace[_0x44d1ee(0x1029)][_0x44d1ee(0xbcd)]:Cesium__namespace['ArcType']['NONE'],..._0x3d52ff['outlineStyle']||{},..._0x4cafa9||{}};}['_updateOutlineStyle'](_0x4dace3,_0xb150e3,_0x2ce660){const _0x243f3b={_0xcb2915:0x8f3,_0x390271:0xc84,_0xd906d3:0xa09,_0x6bce32:0x62b,_0x3484e5:0xb84,_0x4a2768:0xbb8,_0x316491:0xbb8,_0x4449a0:0xf37,_0x44fe3c:0xb75,_0x200cd6:0xf37,_0x5e6af2:0x792,_0x17c086:0xa54},_0x984154=_0x3d5d32;var _0x4c5924;if(!this[_0x984154(0xa09)])return;const _0x2f8d00=this[_0x984154(_0x243f3b._0xcb2915)](_0xb150e3,_0x2ce660);if(_0x2f8d00['show']&&(this[_0x984154(0xdde)]['diffHeight']??0x0)===0x0&&(_0x2f8d00['width']>0x1||_0xb150e3['clampToGround']||((_0x4c5924=this['_entity_outlines'])===null||_0x4c5924===void 0x0?void 0x0:_0x4c5924[_0x984154(_0x243f3b._0x390271)])>0x0)){this[_0x984154(_0x243f3b._0xd906d3)]['outline']=![];if(this['_entity_outlines'])for(let _0x1107e2=0x0,_0x356027=this[_0x984154(0xf37)]['length'];_0x1107e2<_0x356027;_0x1107e2++){const _0x5eb971=this[_0x984154(0xf37)][_0x1107e2]['polyline'];if(_0x4dace3&&_0x4dace3[_0x1107e2]){let _0x4d4ec2=_0x4dace3[_0x1107e2];if(_0x4d4ec2 instanceof Cesium__namespace['CallbackProperty'])_0x5eb971['positions']=_0x4d4ec2;else Array[_0x984154(_0x243f3b._0x6bce32)](_0x4d4ec2)&&_0x4d4ec2[_0x984154(0xc84)]>0x0&&(Cesium__namespace['defined'](_0x2f8d00['height'])&&(_0x4d4ec2=setPositionsHeight(_0x4d4ec2,_0x2f8d00['height'])),Cesium__namespace['defined'](_0x2f8d00['setHeight'])&&(_0x4d4ec2=setPositionsHeight(_0x4d4ec2,_0x2f8d00['setHeight'])),Cesium__namespace[_0x984154(_0x243f3b._0x3484e5)](_0x2f8d00['addHeight'])&&(_0x4d4ec2=addPositionsHeight(_0x4d4ec2,_0x2f8d00['addHeight'])),_0x2f8d00['closure']??!![]?_0x5eb971['positions']=_0x4d4ec2['concat'](_0x4d4ec2[0x0]):_0x5eb971['positions']=_0x4d4ec2);}PolylineStyleConver['toCesiumVal'](_0x2f8d00,_0x5eb971,!![]);}else{if(_0x4dace3){this['_entity_outlines']=[];for(let _0x383994=0x0,_0xc75cf6=_0x4dace3['length'];_0x383994<_0xc75cf6;_0x383994++){let _0x136ae0=_0x4dace3[_0x383994];const _0x565905=PolylineStyleConver['toCesiumVal'](_0x2f8d00,{},!![]);if(_0x136ae0 instanceof Cesium__namespace['CallbackProperty'])_0x565905['positions']=_0x136ae0;else Array['isArray'](_0x136ae0)&&_0x136ae0['length']>0x0&&(Cesium__namespace[_0x984154(0xb84)](_0x2f8d00[_0x984154(0x83e)])&&(_0x136ae0=setPositionsHeight(_0x136ae0,_0x2f8d00['height'])),Cesium__namespace['defined'](_0x2f8d00['setHeight'])&&(_0x136ae0=setPositionsHeight(_0x136ae0,_0x2f8d00['setHeight'])),Cesium__namespace[_0x984154(0xb84)](_0x2f8d00[_0x984154(0x9ce)])&&(_0x136ae0=addPositionsHeight(_0x136ae0,_0x2f8d00['addHeight'])),_0x2f8d00['closure']??!![]?_0x565905[_0x984154(_0x243f3b._0x4a2768)]=_0x136ae0['concat'](_0x136ae0[0x0]):_0x565905[_0x984154(_0x243f3b._0x316491)]=_0x136ae0);const _0x3c4632=this['_createEntity']({'id':this['id']+'-outline'+_0x383994,'polyline':_0x565905,'show':this[_0x984154(0x792)]});this['bindPickId'](_0x3c4632),this[_0x984154(_0x243f3b._0x4449a0)][_0x984154(_0x243f3b._0x44fe3c)](_0x3c4632),this[_0x984154(0x842)]&&this[_0x984154(0x426)]['entities']['add'](_0x3c4632);}}}return!![];}else{if(this['_entity_outlines'])for(let _0x214b36=0x0,_0x256031=this['_entity_outlines']['length'];_0x214b36<_0x256031;_0x214b36++){const _0x472b96=this[_0x984154(_0x243f3b._0x200cd6)][_0x214b36]['polyline'];_0x472b96[_0x984154(_0x243f3b._0x5e6af2)]=![];}return this['entityGraphic']['outline']=_0x2f8d00['show'],this[_0x984154(_0x243f3b._0xd906d3)][_0x984154(_0x243f3b._0x17c086)]=_0x2f8d00['width'],_0x2f8d00[_0x984154(_0x243f3b._0x5e6af2)]&&(this['entityGraphic']['outlineColor']=getCesiumColor(_0x2f8d00['color'],Cesium__namespace[_0x984154(0x882)]['WHITE'])),![];}}['_updateOutlineOpacity'](_0x1edd31){const _0x3ddc7c={_0x46e183:0xf37,_0x31f877:0xc84,_0x1d73c0:0x96e,_0x38e4bd:0xd8f,_0x23324a:0xc96,_0x30af44:0xa09,_0x565cac:0xa09,_0x5f2a2a:0xfbe,_0x42a18b:0xa09,_0xccbc85:0x62a},_0x306ea3=_0x3d5d32;var _0x315920;if(this['_entity_outlines']&&this['_entity_outlines']['length']>0x0)for(let _0x4bbc55=0x0,_0x2d66df=this[_0x306ea3(_0x3ddc7c._0x46e183)][_0x306ea3(_0x3ddc7c._0x31f877)];_0x4bbc55<_0x2d66df;_0x4bbc55++){var _0x186352;const _0x3ff638=this[_0x306ea3(0xf37)][_0x4bbc55][_0x306ea3(_0x3ddc7c._0x1d73c0)];Cesium__namespace['defined'](_0x3ff638===null||_0x3ff638===void 0x0?void 0x0:(_0x186352=_0x3ff638['material'])===null||_0x186352===void 0x0?void 0x0:_0x186352['globalAlpha'])?_0x3ff638[_0x306ea3(_0x3ddc7c._0x38e4bd)][_0x306ea3(_0x3ddc7c._0x23324a)]=_0x1edd31:this['_updateOutlineStyle'](null,this['style']);}if((_0x315920=this[_0x306ea3(_0x3ddc7c._0x30af44)])!==null&&_0x315920!==void 0x0&&_0x315920['outline']&&this[_0x306ea3(_0x3ddc7c._0x565cac)][_0x306ea3(0xe7a)][_0x306ea3(_0x3ddc7c._0x5f2a2a)]()){const _0x559aeb=getCesiumColor(this['entityGraphic']['outlineColor'],Cesium__namespace['Color'][_0x306ea3(0x7a7)]);!Cesium__namespace['defined'](this[_0x306ea3(_0x3ddc7c._0x42a18b)][_0x306ea3(0xcce)])&&(this['entityGraphic'][_0x306ea3(0xcce)]=_0x559aeb[_0x306ea3(0x24b)]),this['entityGraphic'][_0x306ea3(_0x3ddc7c._0xccbc85)]=_0x559aeb['withAlpha'](this['entityGraphic']['_outlineColor_alpha']*_0x1edd31);}}['_updateOutlineToCallback'](){const _0x847b53=_0x3d5d32;if(this['_entity_outlines'])for(let _0x112901=0x0,_0x4318c3=this['_entity_outlines']['length'];_0x112901<_0x4318c3;_0x112901++){const _0x4a3d10=this['_entity_outlines'][_0x112901];if(_0x4a3d10['polyline']['positions']instanceof Cesium__namespace['CallbackProperty'])continue;_0x4a3d10[_0x847b53(0x96e)]['positions']=new Cesium__namespace['CallbackProperty'](_0x596686=>{return this['outlinePositions'];},![]);}}[_0x3d5d32(0x1065)](){const _0x4b2985={_0x3d4faf:0xf37},_0x4431fe=_0x3d5d32;if(this[_0x4431fe(_0x4b2985._0x3d4faf)])for(let _0x336435=0x0,_0x5a22f2=this['_entity_outlines'][_0x4431fe(0xc84)];_0x336435<_0x5a22f2;_0x336435++){const _0x474952=this['_entity_outlines'][_0x336435];if(!(_0x474952['polyline'][_0x4431fe(0xbb8)]instanceof Cesium__namespace['CallbackProperty']))continue;_0x474952['polyline'][_0x4431fe(0xbb8)]=this['outlinePositions'];}}['setOpacity'](_0x789657){const _0x2891cd=_0x3d5d32;this['style'][_0x2891cd(0xc96)]=_0x789657;const _0x5b2e76=this['_updateEntityOpacity'](this['entityGraphic'],_0x789657);if(_0x5b2e76){this['_updateLabelOpacity'](_0x789657),this['_updateOutlineOpacity'](_0x789657),this['_updateExOpacity']&&this['_updateExOpacity'](_0x789657);return;}super[_0x2891cd(0xb2d)](_0x789657);}['_updateEntityOpacity'](_0x51f16b,_0x20d322){const _0x4f5d0e={_0x22759f:0x9bb,_0x210d91:0xb84,_0x36b51e:0xd7c,_0x43d0b7:0xe57},_0x35df53=_0x3d5d32,_0x140c8a=_0x51f16b===null||_0x51f16b===void 0x0?void 0x0:_0x51f16b['material'];if(!_0x140c8a)return![];if(Cesium__namespace['defined'](_0x140c8a===null||_0x140c8a===void 0x0?void 0x0:_0x140c8a[_0x35df53(0xc96)]))return _0x140c8a[_0x35df53(0xc96)]=_0x20d322,!![];if(_0x140c8a['_mars_type']==='Color'||_0x140c8a[_0x35df53(_0x4f5d0e._0x22759f)]==='Image'){const _0x33d34d=getCesiumColor(_0x140c8a['color'],Cesium__namespace['Color'][_0x35df53(0x7a7)]);return!Cesium__namespace[_0x35df53(_0x4f5d0e._0x210d91)](_0x140c8a[_0x35df53(_0x4f5d0e._0x36b51e)])&&(_0x140c8a['_color_alpha']=_0x33d34d['alpha']),_0x140c8a['color']=_0x33d34d[_0x35df53(_0x4f5d0e._0x43d0b7)](_0x140c8a['_color_alpha']*_0x20d322),!![];}return![];}['startFlicker'](_0x22f86c){const _0x308969={_0x40d063:0xd2e,_0x53eb0f:0x4d8},_0x31af4f=_0x3d5d32;!this['flickerEntity']&&(this['flickerEntity']=new FlickerEntity());const _0x53ee2f=this['czmObjectEx']['concat'](this[_0x31af4f(_0x308969._0x40d063)]);return this['flickerEntity'][_0x31af4f(_0x308969._0x53eb0f)](_0x53ee2f,_0x22f86c),this['flickerEntity'];}['stopFlicker'](){const _0x36af4c={_0x5ac4b9:0xdad,_0x665ab4:0xdad,_0x42c1a8:0xd37},_0x199f56=_0x3d5d32;return this[_0x199f56(_0x36af4c._0x5ac4b9)]?this[_0x199f56(_0x36af4c._0x665ab4)][_0x199f56(_0x36af4c._0x42c1a8)]():null;}['startDraw'](_0x4554ba){const _0x47d83f={_0x10f4d3:0x6e3,_0x3b4817:0x105c,_0x475f05:0xce2,_0x541904:0xd56,_0x29ebea:0xa57},_0x5258aa=_0x3d5d32;if(this[_0x5258aa(_0x47d83f._0x10f4d3)])return this;this['_enabledDraw']=!![];_0x4554ba&&this[_0x5258aa(_0x47d83f._0x3b4817)](_0x4554ba);if(!this['_map'])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this['_drawEndEventType']=_0x4554ba['options']['drawEndEventType']??EventType['dblClick'],this['_drawDelEventType']=_0x4554ba['options']['drawDelEventType']??EventType['rightClick'],this[_0x5258aa(0x1d1)]['mouseEvent']['noPickEntity']=this['_entity'],this['_map']['_setEditCursor'](!![]),this[_0x5258aa(_0x47d83f._0x475f05)](![]),this[_0x5258aa(_0x47d83f._0x541904)](),this[_0x5258aa(_0x47d83f._0x29ebea)](),this['fire'](EventType[_0x5258aa(0x105f)],{'drawtype':this['type'],'graphic':this},!![]);}['stopDraw'](){const _0xc9a6ba={_0x27c4ea:0x1d1,_0xeb811a:0xd76,_0x380b8d:0x70d,_0x3b4c4f:0xc84,_0x39480d:0xd76,_0x4a4684:0x433,_0x53a2e7:0xac9},_0x2618a8=_0x3d5d32;var _0xdccc1,_0x3d1b2c,_0x4fe98e,_0x10b209;if(!this[_0x2618a8(0x6e3)])return this;this[_0x2618a8(0xb05)](),this['_updateLabelPosition'](),this[_0x2618a8(_0xc9a6ba._0x27c4ea)][_0x2618a8(0xf7c)](![]),this['enableControl'](!![]),this[_0x2618a8(0x1d1)][_0x2618a8(0xc62)](),this['_map']['mouseEvent']['noPickEntity']=null,this['_enabledDraw']=![];if(this['lastPointTemporary']){var _0x173881;((_0x173881=this[_0x2618a8(_0xc9a6ba._0xeb811a)])===null||_0x173881===void 0x0?void 0x0:_0x173881['length'])>0x0&&this['_positions_draw']['pop'](),this[_0x2618a8(0x70d)]&&(this['_position_draw']=undefined);}this['lastPointTemporary']=![];if(!this[_0x2618a8(_0xc9a6ba._0x380b8d)]&&(!this[_0x2618a8(0xd76)]||((_0xdccc1=this['_positions_draw'])===null||_0xdccc1===void 0x0?void 0x0:_0xdccc1[_0x2618a8(_0xc9a6ba._0x3b4c4f)])===0x0))return this['remove'](!![]),undefined;if(this[_0x2618a8(_0xc9a6ba._0x39480d)]&&this['_positions_draw']['length']=this['_maxPointNum'])this['_map']['openSmallTooltip'](_0x1ac634,this['_map']['getLangText'](_0x3d078e(0x1084)));else{let _0x71c1e3;if(isPCBroswer()){let _0x46512c='';(this[_0x3d078e(_0x961052._0xc5806d)]['hasDrawDelPoint']??!![])&&(_0x46512c=',\x20'+this['_map'][_0x3d078e(_0x961052._0x361bb6)]('_右击删除点')),_0x71c1e3=this['_map']['getLangText']('_单击增加点')+_0x46512c+_0x3d078e(0x231)+this[_0x3d078e(0x1d1)][_0x3d078e(_0x961052._0x361bb6)](_0x3d078e(_0x961052._0x31d850));}else _0x71c1e3=this['_map']['getLangText']('_单击增加点');this['_map'][_0x3d078e(0xd86)](_0x1ac634,_0x71c1e3);}}}}['_onMouseMoveHandler'](_0x169dfa){const _0x21a321={_0x5d77bd:0x433,_0x577a47:0xd76},_0x1767a9=_0x3d5d32;this['_showDrawMouseMoveSmallTooltip'](_0x169dfa);const _0x34e9e0=_0x169dfa[_0x1767a9(0x4c1)];if(_0x34e9e0){if(this[_0x1767a9(_0x21a321._0x5d77bd)]['validDrawPosition']){const _0x3e3c99=this['options']['validDrawPosition'](_0x34e9e0,this);if(!_0x3e3c99)return;}this['lastPointTemporary']&&this[_0x1767a9(0xd76)]['pop'](),this['lastPointTemporary']=!![],this[_0x1767a9(_0x21a321._0x577a47)]['push'](_0x34e9e0),this['updateAttrForDrawing'](![]),this['fire'](EventType['drawMouseMove'],{..._0x169dfa,'drawtype':this['type'],'positions':this['_positions_draw']},!![]);}}[_0x3d5d32(0x6bc)](_0x1ddcf0){const _0x2885ed={_0x2d539c:0x96c,_0x2f86cd:0x6bd,_0x3292b0:0x1ff,_0x5ebac0:0x9ce,_0x132936:0xd76,_0x1a9644:0xb75,_0x460ad2:0x4fa,_0x589ac7:0xd76,_0x54bf2a:0x46e,_0x35e9ea:0xf57},_0x24e56b=_0x3d5d32,_0xd0e1e4=new Date()['getTime']()-(this[_0x24e56b(_0x2885ed._0x2d539c)]||0x0);if(this['_last_clickTime']&&_0xd0e1e4<0xc8)return;this['_last_clickTime']=new Date()[_0x24e56b(0xcdb)]();if(this['_last_clickPositionX']&&Math['abs'](this[_0x24e56b(_0x2885ed._0x2f86cd)]-_0x1ddcf0['windowPosition']['x'])<0xa&&Math[_0x24e56b(0x4ba)](this['_last_clickPositionY']-_0x1ddcf0['windowPosition']['y'])<0xa)return;this[_0x24e56b(0x6bd)]=_0x1ddcf0['windowPosition']['x'],this['_last_clickPositionY']=_0x1ddcf0['windowPosition']['y'];let _0x227a7b=_0x1ddcf0['cartesian'];!_0x227a7b&&this[_0x24e56b(0xdc9)]&&(_0x227a7b=this['_positions_draw'][this['_positions_draw']['length']-0x1]);if(_0x227a7b){var _0x49b7c3;if(this['options'][_0x24e56b(_0x2885ed._0x3292b0)]){const _0xdcf85e=this[_0x24e56b(0x433)]['validDrawPosition'](_0x227a7b,this);if(!_0xdcf85e)return;}this['lastPointTemporary']&&this['_positions_draw']['pop'](),this[_0x24e56b(0xdc9)]=![],this[_0x24e56b(0x71d)](),(_0x49b7c3=this['options'])!==null&&_0x49b7c3!==void 0x0&&_0x49b7c3['addHeight']&&(_0x227a7b=addPositionsHeight(_0x227a7b,this['options'][_0x24e56b(_0x2885ed._0x5ebac0)])),this[_0x24e56b(_0x2885ed._0x132936)][_0x24e56b(_0x2885ed._0x1a9644)](_0x227a7b),this['updateAttrForDrawing'](![]),!isPCBroswer()&&this[_0x24e56b(_0x2885ed._0x460ad2)](_0x1ddcf0),this['fire'](EventType[_0x24e56b(0x1050)],{..._0x1ddcf0,'drawtype':this['type'],'positions':this['_positions_draw']},!![]),this[_0x24e56b(_0x2885ed._0x589ac7)][_0x24e56b(0xc84)]>=this[_0x24e56b(_0x2885ed._0x54bf2a)]&&this[_0x24e56b(_0x2885ed._0x35e9ea)]();}}['_onRightClickHandler'](_0x34f38d){const _0x4bc12d={_0xeb66d5:0xd76,_0x507d38:0xefc,_0x415e6d:0xd76},_0x5945d8=_0x3d5d32;this['_positions_draw']['pop']();const _0x17f6ee=_0x34f38d['cartesian'];_0x17f6ee&&(this['lastPointTemporary']&&this[_0x5945d8(_0x4bc12d._0xeb66d5)]['pop'](),this['lastPointTemporary']=!![],this[_0x5945d8(_0x4bc12d._0x507d38)](EventType[_0x5945d8(0x75c)],{..._0x34f38d,'drawtype':this['type'],'positions':this[_0x5945d8(_0x4bc12d._0x415e6d)]},!![]),this[_0x5945d8(0xd76)]['push'](_0x17f6ee),this['updateAttrForDrawing'](![]));}['_onDbClickHandler'](_0x242a71){const _0x2bcc88={_0x480052:0x71d},_0x47550b=_0x3d5d32;_0x242a71[_0x47550b(0x7f5)]!==EventType['dblClick']&&(this['lastPointTemporary']=![]),this[_0x47550b(_0x2bcc88._0x480052)](),this[_0x47550b(0xd41)]();}['removeNearPoint'](){const _0x55ab93={_0xa46cb0:0xd76,_0x26169d:0xc84,_0x2537a1:0xd76},_0x7246d5=_0x3d5d32;if(this[_0x7246d5(_0x55ab93._0xa46cb0)][_0x7246d5(_0x55ab93._0x26169d)]<0x3)return;for(let _0x18ff7e=this[_0x7246d5(_0x55ab93._0xa46cb0)]['length']-0x1;_0x18ff7e>0x0;_0x18ff7e--){const _0x2b5c57=this[_0x7246d5(_0x55ab93._0x2537a1)][_0x18ff7e],_0x273db0=this['_positions_draw'][_0x18ff7e-0x1],_0x436c08=Cesium__namespace['Cartesian3']['distance'](_0x2b5c57,_0x273db0);if(_0x436c08<0.01)this['_positions_draw']['splice'](_0x18ff7e,0x1);else break;}}['endDraw'](){const _0x492687={_0x490c47:0x6e3,_0x16311c:0xc84,_0x4a7895:0xf57},_0x15b100=_0x3d5d32;if(!this[_0x15b100(_0x492687._0x490c47)])return![];if(this[_0x15b100(0xd76)]&&this['_positions_draw'][_0x15b100(_0x492687._0x16311c)]0x1&&(this[_0x33262a(0xdde)]['diffHeight']??0x0)===0x0||_0x17aca4['clampToGround']?this['_primitive_outline']=this['_createPolylineOutline'](_0x17aca4):(_0x61050d['outlineStyle']=_0x17aca4,this[_0x33262a(_0x34f356._0x34f929)]=this[_0x33262a(_0x34f356._0x5e99ce)](_0x61050d,!![]));}_0x445939[_0x33262a(_0x34f356._0x20adf7)]&&this['_addLabel']();}['_removedHook'](){const _0x225e07={_0x8cae61:0x100f,_0x4c8fa6:0xdaf},_0x2cbe34=_0x3d5d32;!this[_0x2cbe34(_0x225e07._0x8cae61)]&&(this[_0x2cbe34(0xf57)](),this['stopEditing']()),this['_primitive']&&(this['primitiveCollection'][_0x2cbe34(0xf06)](this['_primitive']),delete this['_primitive']),this['_primitive_outline']&&(this['primitiveCollection']['remove'](this[_0x2cbe34(0x967)]),delete this[_0x2cbe34(0x967)]),this[_0x2cbe34(0xdaf)]&&(this['_layer'][_0x2cbe34(0x6e2)]['remove'](this[_0x2cbe34(_0x225e07._0x4c8fa6)]),delete this['_primitive_label']);}['_showHook'](_0x1885df){const _0x45b775=_0x3d5d32;if(!this['isAdded'])return;_0x1885df?(this['_addedHook'](this['style']),this['czmObject']&&this[_0x45b775(0xc6f)](this['czmObject']),this['czmObjectEx']&&this[_0x45b775(0xc51)]['forEach'](_0x3e8a58=>{this['bindPickId'](_0x3e8a58);})):(this['_noDestroy']=!![],this['_removedHook'](),this[_0x45b775(0x100f)]=![]);}['_conversionStyle'](_0x5c013a){return _0x5c013a;}['_createPrimitive'](_0x575aa0,_0x44bcff){const _0x29617e={_0x1921e2:0xa72,_0x4ef63c:0x1001,_0x3cfc15:0x883,_0x100a36:0x883,_0x564ca1:0x792,_0x4833a8:0x883,_0x15557e:0x783,_0x5f443d:0xdde,_0x59cd57:0x2ab,_0x1745cc:0x715,_0x57edd7:0x5f4,_0x10b5fd:0x2ab,_0x41d67e:0x684},_0x45f4ff=_0x3d5d32;(!_0x575aa0['vertexFormat']&&_0x575aa0['_isColorMaterial']||_0x44bcff)&&(_0x575aa0[_0x45f4ff(_0x29617e._0x1921e2)]=this['defaultVertexFormat']||Cesium__namespace['PerInstanceColorAppearance']['VERTEX_FORMAT']);const _0x2b85b6={...this[_0x45f4ff(0x433)],'geometryInstances':this[_0x45f4ff(0xc66)](_0x575aa0,_0x44bcff),'show':this['show'],'shadows':_0x575aa0[_0x45f4ff(_0x29617e._0x4ef63c)]};delete _0x2b85b6[_0x45f4ff(0xdde)],delete _0x2b85b6['attr'],delete _0x2b85b6['modelMatrix'],_0x2b85b6[_0x45f4ff(_0x29617e._0x3cfc15)]['attributes']=_0x2b85b6[_0x45f4ff(_0x29617e._0x100a36)]['attributes']||{},_0x2b85b6['geometryInstances'][_0x45f4ff(0xf90)][_0x45f4ff(_0x29617e._0x564ca1)]=new Cesium__namespace['ShowGeometryInstanceAttribute'](this['show']);_0x575aa0['distanceDisplayCondition']&&(_0x2b85b6[_0x45f4ff(_0x29617e._0x4833a8)]['attributes']['distanceDisplayCondition']=_0x575aa0['distanceDisplayCondition']);!_0x2b85b6[_0x45f4ff(_0x29617e._0x15557e)]&&(_0x2b85b6['appearance']=this['_createAppearance'](_0x575aa0,_0x2b85b6,_0x44bcff));_0x575aa0['depthFail']&&!_0x2b85b6['depthFailAppearance']&&(_0x2b85b6['depthFailAppearance']=this['_createAppearance'](_0x575aa0,_0x2b85b6,_0x44bcff));let _0x21cd74;if(this[_0x45f4ff(_0x29617e._0x5f443d)]['clampToGround'])_0x2b85b6[_0x45f4ff(_0x29617e._0x59cd57)]=_0x575aa0['classificationType'],this['type']==='polylineP'||this['type']==='polylineC'?_0x21cd74=this[_0x45f4ff(0x5f4)]['add'](new Cesium__namespace[(_0x45f4ff(_0x29617e._0x1745cc))](_0x2b85b6)):_0x21cd74=this[_0x45f4ff(_0x29617e._0x57edd7)]['add'](new Cesium__namespace['GroundPrimitive'](_0x2b85b6));else _0x575aa0['classification']?(_0x2b85b6[_0x45f4ff(0x2ab)]=_0x575aa0[_0x45f4ff(_0x29617e._0x10b5fd)]||Cesium__namespace['ClassificationType']['CESIUM_3D_TILE'],_0x21cd74=this[_0x45f4ff(0x5f4)]['add'](new Cesium__namespace['ClassificationPrimitive'](_0x2b85b6))):_0x21cd74=this[_0x45f4ff(0x5f4)]['add'](new Cesium__namespace[(_0x45f4ff(_0x29617e._0x41d67e))](_0x2b85b6));return this['bindPickId'](_0x21cd74),_0x21cd74;}[_0x3d5d32(0x5a2)](_0x5ae8a2,_0x25d901=Cesium__namespace['Color']['WHITE']['withAlpha'](0.5)){const _0x5a06ed={_0x45c121:0x433,_0x1f8ac8:0xe8f},_0x464254=_0x3d5d32;var _0x4446e2,_0x7029b6,_0x5cf5a1,_0x57ca25;return((_0x4446e2=_0x5ae8a2['material'])===null||_0x4446e2===void 0x0?void 0x0:(_0x7029b6=_0x4446e2[_0x464254(0xfe3)])===null||_0x7029b6===void 0x0?void 0x0:_0x7029b6['color'])||((_0x5cf5a1=_0x5ae8a2[_0x464254(0xd8f)])===null||_0x5cf5a1===void 0x0?void 0x0:(_0x57ca25=_0x5cf5a1[_0x464254(_0x5a06ed._0x45c121)])===null||_0x57ca25===void 0x0?void 0x0:_0x57ca25['color'])||_0x5ae8a2[_0x464254(_0x5a06ed._0x1f8ac8)]||_0x25d901;}['_createAppearance'](_0x120fec,_0x3ed8f6,_0x3b9fbd){const _0x32d87c={_0x372508:0xaf7,_0x30ff97:0x882,_0x29e9a0:0x883,_0xc131b9:0xe8f,_0x44a444:0x64f},_0x4032c2=_0x3d5d32;if(_0x120fec['material']&&!_0x120fec[_0x4032c2(_0x32d87c._0x372508)]&&!_0x3b9fbd)return new Cesium__namespace['MaterialAppearance']({..._0x120fec});else{if(_0x3ed8f6['geometryInstances']instanceof Cesium__namespace['GeometryInstance']){let _0x5587d2;_0x3b9fbd&&_0x120fec['outlineStyle']?_0x5587d2=getColorByStyle(_0x120fec[_0x4032c2(0x576)],Cesium__namespace[_0x4032c2(_0x32d87c._0x30ff97)]['WHITE']):_0x5587d2=this['_getColorByColorMaterial'](_0x120fec),_0x120fec['translucent']=_0x5587d2[_0x4032c2(0x24b)]!==0x1,_0x3ed8f6[_0x4032c2(_0x32d87c._0x29e9a0)]['attributes']=_0x3ed8f6['geometryInstances']['attributes']||{},_0x3ed8f6['geometryInstances']['attributes'][_0x4032c2(_0x32d87c._0xc131b9)]=Cesium__namespace[_0x4032c2(_0x32d87c._0x44a444)]['fromColor'](_0x5587d2),_0x120fec['depthFail']&&(_0x3ed8f6['geometryInstances'][_0x4032c2(0xf90)]['depthFailColor']=Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x120fec['depthFailColor']||_0x5587d2));}return Cesium__namespace['defined'](this[_0x4032c2(0x1002)])&&(_0x120fec['translucent']=this['translucent']),new Cesium__namespace[(_0x4032c2(0xc8e))]({..._0x120fec});}}[_0x3d5d32(0xc66)](_0x4e687b,_0x31afc4){return this['options']['geometryInstances'];}['_updateDiffHeight'](_0x56b61f,_0x190fa7){const _0x390a68={_0x56d9ca:0xdde,_0x4502fa:0x83e,_0x2548bc:0xbb8},_0x4a7429=_0x3d5d32;if(this[_0x4a7429(_0x390a68._0x56d9ca)]['clampToGround'])return;if(_0x190fa7){let _0x811a5a=0x0;Cesium__namespace['defined'](this['style']['height'])?_0x811a5a=this[_0x4a7429(0xdde)]['height']:_0x811a5a=getMaxHeight(this['positions']),_0x56b61f['height']=_0x811a5a;}if(Cesium__namespace['defined'](this['style']['diffHeight'])&&!Cesium__namespace['defined'](_0x56b61f[_0x4a7429(0x831)])){let _0x247022=0x0;if(Cesium__namespace[_0x4a7429(0xb84)](_0x56b61f[_0x4a7429(0x83e)]))_0x247022=_0x56b61f[_0x4a7429(_0x390a68._0x4502fa)];else Cesium__namespace['defined'](this['style'][_0x4a7429(0x83e)])?_0x247022=this['style']['height']:_0x247022=getMaxHeight(this[_0x4a7429(_0x390a68._0x2548bc)]);_0x56b61f['extrudedHeight']=_0x247022+this['style']['diffHeight'];}}['_updateStyleBaseHook'](_0x4e20b1){const _0x3bf65a={_0x144af5:0xdde},_0x7ba2e7=_0x3d5d32;if(!_0x4e20b1)return;if(this[_0x7ba2e7(0x810)]&&this['type']['startsWith'](this['_editing_entity']['type']))this[_0x7ba2e7(0x810)]['setStyle'](_0x4e20b1);else this[_0x7ba2e7(0xd2e)]&&(this['_updateLabelStyleHook'](this[_0x7ba2e7(_0x3bf65a._0x144af5)],_0x4e20b1),this['_updateExOpacity']&&Cesium__namespace['defined'](_0x4e20b1['globalAlpha'])&&this['_updateExOpacity'](_0x4e20b1['globalAlpha']),(Cesium__namespace['defined'](_0x4e20b1['setHeight'])||Cesium__namespace[_0x7ba2e7(0xb84)](_0x4e20b1['addHeight']))&&(this['positions']=this['positionsShow']),this['_updateStyleHook'](this['style'],_0x4e20b1));}['_updateStyleHook'](_0x1f3c8d,_0x25fb2a){const _0x2567ad={_0x51b39c:0xb2a,_0x5acbcc:0xb2a,_0x377bd0:0xe8f,_0x502942:0x9ba},_0x59b7f9=_0x3d5d32;if(_0x1f3c8d[_0x59b7f9(_0x2567ad._0x51b39c)]===Color$2&&(Cesium__namespace['defined'](_0x25fb2a['color'])||Cesium__namespace['defined'](_0x25fb2a['opacity']))){const _0x288736=getColorByStyle(_0x1f3c8d);if(_0x288736){const _0x49db06=this['_updatePrimitiveForColorMaterial'](this['_primitive'],_0x288736,_0x1f3c8d);if(_0x49db06){if(Cesium__namespace[_0x59b7f9(0xb84)](_0x25fb2a['outline'])){if(this['_primitive_outline']){const _0x10517e=this['_getOutlineStyle'](_0x1f3c8d);if(!_0x10517e[_0x59b7f9(_0x2567ad._0x5acbcc)]){if(_0x10517e['show']){const _0x450466=this['_updatePrimitiveForColorMaterial'](this['_primitive_outline'],getCesiumColor(_0x10517e[_0x59b7f9(_0x2567ad._0x377bd0)]),_0x1f3c8d);if(_0x450466)return;}else{this['_primitive_outline']&&(this['primitiveCollection']['remove'](this['_primitive_outline']),delete this['_primitive_outline']);return;}}}}else return;}}}this[_0x59b7f9(_0x2567ad._0x502942)](_0x1f3c8d);}['_updatePrimitiveForColorMaterial'](_0x148694,_0x21065a,_0x3729a0){const _0x4cecfc={_0xdce702:0x783,_0x1fbe16:0x706},_0x190110=_0x3d5d32;var _0x228961,_0x23df6a;if(!_0x148694)return![];const _0x422c71=_0x148694===null||_0x148694===void 0x0?void 0x0:(_0x228961=_0x148694[_0x190110(0x783)])===null||_0x228961===void 0x0?void 0x0:(_0x23df6a=_0x228961['material'])===null||_0x23df6a===void 0x0?void 0x0:_0x23df6a[_0x190110(0xfe3)];if(Cesium__namespace['defined'](_0x422c71===null||_0x422c71===void 0x0?void 0x0:_0x422c71['color'])&&_0x148694['appearance']['material']['type']===Color$2)return _0x148694[_0x190110(_0x4cecfc._0xdce702)]['translucent']=_0x21065a['alpha']!==0x1,_0x422c71['color']=_0x21065a,!![];const _0x59d4ff=this['getGeometryInstanceAttributes'](this['id'],_0x148694);if(_0x59d4ff!==null&&_0x59d4ff!==void 0x0&&_0x59d4ff[_0x190110(0xe8f)])return _0x59d4ff['color']=Cesium__namespace['ColorGeometryInstanceAttribute']['toValue'](_0x21065a),_0x59d4ff[_0x190110(_0x4cecfc._0x1fbe16)]&&(_0x3729a0['depthFailColor']||_0x3729a0[_0x190110(0x801)])&&(_0x59d4ff['depthFailColor']=Cesium__namespace['ColorGeometryInstanceAttribute']['toValue'](getCesiumColor(_0x3729a0['depthFailColor'],_0x21065a))),!![];return![];}['setOpacity'](_0x370e4f){const _0x3cecd3={_0x506014:0xdde,_0xbd41b9:0xc96,_0x459d70:0x360},_0x464135=_0x3d5d32;this[_0x464135(_0x3cecd3._0x506014)][_0x464135(_0x3cecd3._0xbd41b9)]=_0x370e4f;const _0x181680=this['_updatePrimitiveOpacity'](this['_primitive'],_0x370e4f);if(_0x181680){this[_0x464135(0x755)](this['_primitive_outline'],_0x370e4f),this['_updateLabelOpacity'](_0x370e4f),this[_0x464135(_0x3cecd3._0x459d70)]&&this[_0x464135(_0x3cecd3._0x459d70)](_0x370e4f);return;}super['setOpacity'](_0x370e4f);}[_0x3d5d32(0x755)](_0x7c653,_0x3337ca){const _0x114f1f={_0x27535f:0x783,_0x2a9ae6:0xd8f,_0x387af6:0xe8f,_0x446ee3:0x24b,_0x3230f5:0xe3f,_0x50d633:0xe8f,_0x4d7ab6:0x4a1},_0x591513=_0x3d5d32;if(!_0x7c653)return![];try{var _0x2b5f74,_0x93aa6;const _0x369ff5=_0x7c653===null||_0x7c653===void 0x0?void 0x0:(_0x2b5f74=_0x7c653['appearance'])===null||_0x2b5f74===void 0x0?void 0x0:(_0x93aa6=_0x2b5f74['material'])===null||_0x93aa6===void 0x0?void 0x0:_0x93aa6['uniforms'];if(_0x369ff5){if(Cesium__namespace['defined'](_0x369ff5['globalAlpha']))return _0x7c653['appearance']['translucent']=_0x3337ca!==0x1,_0x369ff5['globalAlpha']=_0x3337ca,!![];if((_0x7c653[_0x591513(_0x114f1f._0x27535f)][_0x591513(_0x114f1f._0x2a9ae6)]['type']===Color$2||_0x7c653[_0x591513(0x783)]['material']['type']===Image$1)&&Cesium__namespace[_0x591513(0xb84)](_0x369ff5[_0x591513(0xe8f)]))return!Cesium__namespace['defined'](_0x7c653['_uniforms_color_alpha'])&&(_0x7c653['_uniforms_color_alpha']=_0x369ff5[_0x591513(0xe8f)]['alpha']),_0x369ff5['color']['alpha']=_0x7c653['_uniforms_color_alpha']*_0x3337ca,_0x7c653[_0x591513(0x783)]['translucent']=_0x369ff5[_0x591513(_0x114f1f._0x387af6)]['alpha']!==0x1,!![];if(_0x7c653[_0x591513(0x783)][_0x591513(0xd8f)][_0x591513(0x7f5)]===Water$1)return!Cesium__namespace['defined'](_0x7c653['_uniforms_baseWaterColor_alpha'])&&(_0x7c653['_uniforms_baseWaterColor_alpha']=_0x369ff5['baseWaterColor']['alpha'],_0x7c653[_0x591513(0xc1e)]=_0x369ff5['blendColor']['alpha']),this['globalAlpha']!==0x1&&(_0x369ff5[_0x591513(0x67e)][_0x591513(_0x114f1f._0x446ee3)]=_0x7c653['_uniforms_baseWaterColor_alpha']*_0x3337ca,_0x369ff5['blendColor']['alpha']=_0x7c653['_uniforms_blendColor_alpha']*_0x3337ca),!![];}const _0x15b86f=this[_0x591513(_0x114f1f._0x3230f5)](this['id'],_0x7c653);if(_0x15b86f!==null&&_0x15b86f!==void 0x0&&_0x15b86f[_0x591513(0xe8f)]){!Cesium__namespace['defined'](_0x7c653['_attributes_color_alpha'])&&(_0x7c653['_attributes_color_alpha']=_0x15b86f[_0x591513(_0x114f1f._0x387af6)][0x3]/0xff);const _0xaebd14=_0x7c653['_attributes_color_alpha']*_0x3337ca;return _0x15b86f['color']=new Uint8Array([_0x15b86f[_0x591513(_0x114f1f._0x50d633)][0x0],_0x15b86f['color'][0x1],_0x15b86f['color'][0x2],Cesium__namespace['Color']['floatToByte'](_0xaebd14)]),_0x7c653['appearance']['translucent']=_0xaebd14!==0x1,_0x15b86f['depthFailColor']&&(!Cesium__namespace['defined'](_0x7c653['_attributes_depthFailColor_alpha'])&&(_0x7c653['_attributes_depthFailColor_alpha']=_0x15b86f[_0x591513(0x706)][0x3]/0xff),_0x15b86f['depthFailColor']=new Uint8Array([_0x15b86f['depthFailColor'][0x0],_0x15b86f['depthFailColor'][0x1],_0x15b86f[_0x591513(0x706)][0x2],Cesium__namespace['Color'][_0x591513(_0x114f1f._0x4d7ab6)](_0x7c653['_attributes_depthFailColor_alpha']*_0x3337ca)])),!![];}}catch(_0x2b74df){}return![];}[_0x3d5d32(0xe3f)](_0x59c85e,_0xc4fe43){const _0x558622=_0x3d5d32;_0xc4fe43=_0xc4fe43||this['_primitive'];if(!_0xc4fe43||!_0xc4fe43['getGeometryInstanceAttributes'])return null;if(this['style'][_0x558622(0x7c0)]&&!_0xc4fe43['_primitive'])return null;return _0xc4fe43['getGeometryInstanceAttributes'](_0x59c85e);}[_0x3d5d32(0x39d)](_0x29bcde){this['_primitive_label']&&this['_primitive_label']['show']&&LabelStyleConver['setOpacity'](this['_primitive_label'],_0x29bcde);}[_0x3d5d32(0x9ba)](_0x13e89c){const _0x1bb64d={_0x5ddc27:0x842},_0x4f3f93=_0x3d5d32;return this[_0x4f3f93(_0x1bb64d._0x5ddc27)]&&this['show']&&(this['_noDestroy']=!![],this['_removedHook'](),this['_noDestroy']=![],this['_addedHook'](_0x13e89c||this[_0x4f3f93(0xdde)]),this['czmObject']&&this['bindPickId'](this['czmObject']),this['czmObjectEx']&&this['czmObjectEx']['forEach'](_0x196bbb=>{this['bindPickId'](_0x196bbb);})),this;}['_updatePositionsHook'](){const _0x14ea1f=_0x3d5d32;this[_0x14ea1f(0x9ba)]();}['_updateLabelStyleHook'](_0x4c5445,_0x5bdfb4){const _0x5158c0={_0x4c4398:0x32a,_0x43c762:0xdaf,_0x3c3848:0xb69,_0x229606:0xb84,_0x186529:0x9e4,_0x3252f8:0x3d2},_0x292b76=_0x3d5d32;if(_0x5bdfb4!==null&&_0x5bdfb4!==void 0x0&&_0x5bdfb4[_0x292b76(_0x5158c0._0x4c4398)]){if(this[_0x292b76(0xdaf)]){var _0x17f729,_0x4d0887,_0x1b1a21,_0x20402f;LabelStyleConver['toCesiumVal'](_0x4c5445[_0x292b76(0x32a)],this[_0x292b76(_0x5158c0._0x43c762)],this['attr']),(Cesium__namespace[_0x292b76(0xb84)](_0x5bdfb4===null||_0x5bdfb4===void 0x0?void 0x0:(_0x17f729=_0x5bdfb4['label'])===null||_0x17f729===void 0x0?void 0x0:_0x17f729[_0x292b76(_0x5158c0._0x3c3848)])||Cesium__namespace['defined'](_0x5bdfb4===null||_0x5bdfb4===void 0x0?void 0x0:(_0x4d0887=_0x5bdfb4['label'])===null||_0x4d0887===void 0x0?void 0x0:_0x4d0887['height'])||Cesium__namespace[_0x292b76(0xb84)](_0x5bdfb4===null||_0x5bdfb4===void 0x0?void 0x0:(_0x1b1a21=_0x5bdfb4[_0x292b76(0x32a)])===null||_0x1b1a21===void 0x0?void 0x0:_0x1b1a21['addHeight'])||Cesium__namespace[_0x292b76(_0x5158c0._0x229606)](_0x5bdfb4===null||_0x5bdfb4===void 0x0?void 0x0:(_0x20402f=_0x5bdfb4[_0x292b76(_0x5158c0._0x4c4398)])===null||_0x20402f===void 0x0?void 0x0:_0x20402f[_0x292b76(_0x5158c0._0x186529)]))&&this['_updateLabelPosition']();}else this[_0x292b76(_0x5158c0._0x3252f8)]();}else Cesium__namespace[_0x292b76(_0x5158c0._0x229606)](_0x5bdfb4===null||_0x5bdfb4===void 0x0?void 0x0:_0x5bdfb4['globalAlpha'])&&this['_updateLabelOpacity'](_0x5bdfb4['globalAlpha']);}['_addLabel'](){const _0x9f9e3c={_0x5785ed:0xb84,_0x5e84be:0x6cb,_0x26f97a:0xdaf,_0x62cda0:0xdaf},_0xd8495b=_0x3d5d32,_0x1fc367=this['style']['label'];if(!_0x1fc367||!_0x1fc367['text'])return;Cesium__namespace[_0xd8495b(_0x9f9e3c._0x5785ed)](this[_0xd8495b(0xdde)][_0xd8495b(0x7c0)])&&!Cesium__namespace['defined'](_0x1fc367[_0xd8495b(0x7c0)])&&!Cesium__namespace[_0xd8495b(_0x9f9e3c._0x5785ed)](_0x1fc367[_0xd8495b(0x83e)])&&(_0x1fc367['clampToGround']=this[_0xd8495b(0xdde)]['clampToGround']);const _0x398169=LabelStyleConver['toCesiumVal'](_0x1fc367,{},this['attr']);return _0x398169['show']=this['show'],_0x398169['position']=this[_0xd8495b(_0x9f9e3c._0x5e84be)](),this[_0xd8495b(_0x9f9e3c._0x26f97a)]&&this['_layer']['labelCollection']['remove'](this[_0xd8495b(_0x9f9e3c._0x62cda0)]),this['_primitive_label']=this['_layer']['labelCollection']['add'](_0x398169),this[_0xd8495b(0xc6f)](this['_primitive_label']),this['_primitive_label'];}[_0x3d5d32(0x429)](){const _0x306510=_0x3d5d32;this['_primitive_label']&&!this['_primitive_label']['isDestroyed']()&&(this[_0x306510(0xdaf)]['position']=this['_getLablePosition']());}['_getLablePosition'](){const _0x2f63fc={_0x5c51d8:0xb69,_0x1d6d89:0xed4,_0x293007:0x83e,_0x521e3b:0xb84,_0x194aad:0x83e,_0xd55a3b:0xdde,_0x54fd1d:0xe12,_0x48a00e:0x9ce},_0x3c850b=_0x3d5d32,_0x52310f=this[_0x3c850b(0xdde)]['label'];let _0x24541c;if(_0x52310f['position']){if(_0x52310f['position']==='center')_0x24541c=this['centerOfMass'];else{if(isString(_0x52310f[_0x3c850b(0xb69)])){const _0x1a3c5e=template(_0x52310f[_0x3c850b(0xb69)],this['attr'],!![]);_0x1a3c5e&&(_0x24541c=LngLatPoint['parse'](_0x1a3c5e)['toCartesian']());}else _0x24541c=LngLatPoint[_0x3c850b(0xce3)](_0x52310f[_0x3c850b(_0x2f63fc._0x5c51d8)])[_0x3c850b(_0x2f63fc._0x1d6d89)]();}}!_0x24541c&&(_0x24541c=this['center']);if(!_0x24541c)return new Cesium__namespace['Cartesian3']();if(Cesium__namespace['defined'](_0x52310f[_0x3c850b(_0x2f63fc._0x293007)])||Cesium__namespace[_0x3c850b(_0x2f63fc._0x521e3b)](this['style']['height'])){const _0x1e352e=_0x52310f[_0x3c850b(0x83e)]??this['style'][_0x3c850b(_0x2f63fc._0x194aad)];_0x24541c=setPositionsHeight(_0x24541c,_0x1e352e);}Cesium__namespace[_0x3c850b(_0x2f63fc._0x521e3b)](this[_0x3c850b(0xdde)]['diffHeight'])&&(_0x24541c=addPositionsHeight(_0x24541c,this[_0x3c850b(_0x2f63fc._0xd55a3b)]['diffHeight']));let _0x55e56c=_0x52310f['setHeight'];Cesium__namespace['defined'](_0x55e56c)&&(isString(_0x55e56c)&&(_0x55e56c=Number(template(_0x55e56c,this[_0x3c850b(_0x2f63fc._0x54fd1d)],!![])),isNaN(_0x55e56c)&&(_0x55e56c=0x0)),_0x24541c=setPositionsHeight(_0x24541c,_0x55e56c));let _0x11bae4=_0x52310f[_0x3c850b(_0x2f63fc._0x48a00e)];return Cesium__namespace[_0x3c850b(0xb84)](_0x11bae4)&&(isString(_0x11bae4)&&(_0x11bae4=Number(template(_0x11bae4,this['attr'],!![])),isNaN(_0x11bae4)&&(_0x11bae4=0x0)),_0x24541c=addPositionsHeight(_0x24541c,_0x11bae4)),_0x24541c;}['_getOutlineStyle'](_0x22df84,_0x2eea45){const _0x3946e7={_0x282b14:0x301,_0x2010ae:0xa54,_0x3c6780:0xe7a,_0x4789cc:0x7a7,_0x96b794:0x7c0,_0x3df288:0x1029},_0x5ba361=_0x3d5d32,_0x525ef8={..._0x22df84};return delete _0x525ef8['material'],delete _0x525ef8['materialType'],delete _0x525ef8['materialOptions'],delete _0x525ef8['outline'],delete _0x525ef8['outlineColor'],delete _0x525ef8[_0x5ba361(_0x3946e7._0x282b14)],delete _0x525ef8[_0x5ba361(_0x3946e7._0x2010ae)],delete _0x525ef8['outlineStyle'],{..._0x525ef8,'show':_0x22df84[_0x5ba361(_0x3946e7._0x3c6780)]??![],'color':_0x22df84['outlineColor']??Cesium__namespace[_0x5ba361(0x882)][_0x5ba361(_0x3946e7._0x4789cc)],'opacity':_0x22df84['outlineOpacity'],'width':_0x22df84[_0x5ba361(0xa54)]??0x1,'arcType':_0x22df84['arcType']??_0x22df84[_0x5ba361(_0x3946e7._0x96b794)]?Cesium__namespace['ArcType']['GEODESIC']:Cesium__namespace[_0x5ba361(_0x3946e7._0x3df288)]['NONE'],..._0x22df84['outlineStyle']||{},..._0x2eea45||{}};}[_0x3d5d32(0x9a2)](){return[this['positions']];}[_0x3d5d32(0xe0d)](_0x177eb4){const _0x1fcea3={_0x19aaa1:0x83e,_0x552bcc:0x748,_0xdd21c1:0x5a2,_0x8f4a2c:0x8f0,_0x3ffd37:0xd8f},_0x78f70d=_0x3d5d32,_0x408473=PolylineStyleConver['toCesiumVal'](_0x177eb4),_0x5ba5f4=_0x408473['clampToGround']?Cesium__namespace['GroundPolylineGeometry']:Cesium__namespace['PolylineGeometry'],_0x296bfc=[],_0x1b5f56=this['_getPolylineOutlinePositions']();for(let _0x434ed9=0x0,_0x3aa77d=_0x1b5f56['length'];_0x434ed9<_0x3aa77d;_0x434ed9++){let _0x60b28e=_0x1b5f56[_0x434ed9];if(!_0x60b28e||_0x60b28e['length']===0x0)continue;Cesium__namespace['defined'](_0x177eb4[_0x78f70d(_0x1fcea3._0x19aaa1)])&&(_0x60b28e=setPositionsHeight(_0x60b28e,_0x177eb4['height']));Cesium__namespace['defined'](_0x177eb4['setHeight'])&&(_0x60b28e=setPositionsHeight(_0x60b28e,_0x177eb4['setHeight']));Cesium__namespace['defined'](_0x177eb4[_0x78f70d(0x9ce)])&&(_0x60b28e=addPositionsHeight(_0x60b28e,_0x177eb4['addHeight']));_0x60b28e['length']>0x0&&(_0x60b28e=_0x60b28e['concat'](_0x60b28e[0x0]));const _0x3f4b6b={..._0x408473};_0x3f4b6b['positions']=_0x60b28e;(!_0x3f4b6b[_0x78f70d(0xd8f)]||_0x3f4b6b['material']['type']==='Color')&&(_0x3f4b6b['vertexFormat']=Cesium__namespace[_0x78f70d(0xa8b)][_0x78f70d(_0x1fcea3._0x552bcc)]);const _0x48dd55=this[_0x78f70d(_0x1fcea3._0xdd21c1)](_0x3f4b6b),_0x2096c0=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x5ba5f4(_0x3f4b6b),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x48dd55),'distanceDisplayCondition':_0x408473[_0x78f70d(_0x1fcea3._0x8f4a2c)],'show':new Cesium__namespace[(_0x78f70d(0x965))](this['show'])}});_0x296bfc['push'](_0x2096c0);}if(_0x296bfc[_0x78f70d(0xc84)]===0x0)return;const _0x132a0d={...this[_0x78f70d(0x433)],'geometryInstances':_0x296bfc,'show':this['show'],'shadows':_0x408473['shadows']};delete _0x132a0d[_0x78f70d(0xdde)],delete _0x132a0d[_0x78f70d(0xe12)];_0x408473[_0x78f70d(_0x1fcea3._0x3ffd37)]&&!_0x408473['classification']?_0x132a0d['appearance']=new Cesium__namespace['PolylineMaterialAppearance']({..._0x408473}):_0x132a0d['appearance']=new Cesium__namespace[(_0x78f70d(0xa8b))]({..._0x408473});let _0x394547;return this['style']['clampToGround']?(_0x132a0d['classificationType']=_0x408473[_0x78f70d(0x2ab)],_0x394547=this['primitiveCollection']['add'](new Cesium__namespace['GroundPolylinePrimitive'](_0x132a0d))):_0x394547=this['primitiveCollection']['add'](new Cesium__namespace['Primitive'](_0x132a0d)),this['bindPickId'](_0x394547),_0x394547;}['openHighlight'](_0x3455b7,_0x47a221=!![]){const _0xc9732={_0x19ae78:0x1d1},_0x24953c=_0x3d5d32;var _0xafa986;_0x47a221&&(this['_map']['closeHighlight'](),this[_0x24953c(_0xc9732._0x19ae78)]['last_highlighGraphic']=this);const _0x5e2e3d=_0x3455b7||this['_highlightOptions']||((_0xafa986=this['_layer'])===null||_0xafa986===void 0x0?void 0x0:_0xafa986['_highlightOptions']);if(_0x5e2e3d){const _0x8c970f=[];for(const _0x14a74c in _0x5e2e3d){if(_0x14a74c==='type')continue;!Cesium__namespace['defined'](this['style'][_0x14a74c])&&_0x8c970f['push'](_0x14a74c);}_0x8c970f['length']>0x0&&logWarn(_0x24953c(0xa91),_0x8c970f);const _0x523da3=merge(clone(this['style']),_0x5e2e3d);this['_updateStyleHook'](_0x523da3,_0x5e2e3d),this['_updateLabelStyleHook'](_0x523da3,_0x5e2e3d),this['fire'](EventType['highlightOpen'],{},!![]);}}['closeHighlight'](){const _0x260f3a={_0x17bbf0:0xdde,_0x30c842:0x1d1},_0x487f69=_0x3d5d32;var _0x4612c4;if(!this[_0x487f69(0x842)]||((_0x4612c4=this[_0x487f69(0x1d1)])===null||_0x4612c4===void 0x0?void 0x0:_0x4612c4['last_highlighGraphic'])!==this)return;this['_updateStyleHook'](this[_0x487f69(0xdde)],this['style']),this['_updateLabelStyleHook'](this[_0x487f69(_0x260f3a._0x17bbf0)],this['style']),this[_0x487f69(_0x260f3a._0x30c842)]['_clearLastHighlight'](),this['fire'](EventType[_0x487f69(0x2e1)],{},!![]);}['_replaceFragmentShaderSourceByStyle'](_0xb073bd){const _0x37e435={_0x2bf3db:0x6a8},_0x514073=_0x3d5d32;return this['style'][_0x514073(_0x37e435._0x2bf3db)]&&(_0xb073bd='#define\x20FLAT\x0a'+_0xb073bd),this['style']['faceForward']&&(_0xb073bd=_0x514073(0x2ec)+_0xb073bd),_0xb073bd;}['startDraw'](_0x5ca1dc){const _0x49b2c={_0x1d87c9:0x792,_0x3277b6:0x810,_0x36908b:0xac7,_0x62102b:0xefc},_0x570a51=_0x3d5d32;if(!this['_getDrawEntityClass']){logInfo('对象不支持标绘',this);return;}if(this['_enabledDraw'])return this;this['_enabledDraw']=!![],this[_0x570a51(_0x49b2c._0x1d87c9)]=![];_0x5ca1dc&&this[_0x570a51(0x105c)](_0x5ca1dc);if(!this[_0x570a51(0x1d1)])throw new Error(_0x570a51(0x738));this[_0x570a51(_0x49b2c._0x3277b6)]=this[_0x570a51(_0x49b2c._0x36908b)]({'minPointNum':this['options']['minPointNum'],'maxPointNum':this['options'][_0x570a51(0xa9c)],'style':this['_getDrawEntityStyle'](),'private':!![]},!![]),this['_editing_entity']['parent']=this,this['_editing_entity']['once'](EventType['drawCreated'],_0xb1c464=>{this['stopDraw']();}),this['_editing_entity']['on']([EventType['drawAddPoint'],EventType[_0x570a51(0x4a7)],EventType['drawRemovePoint']],_0x5ed34e=>{_0x5ed34e['graphic']=this,_0x5ed34e['drawtype']=this['type'],this['fire'](_0x5ed34e['type'],_0x5ed34e,!![]);}),this['_editing_entity']['startDraw'](this[_0x570a51(0x1d1)]['graphicLayer']),this[_0x570a51(_0x49b2c._0x62102b)](EventType['drawStart'],{'drawtype':this['type']},!![]);}['stopDraw'](){const _0xd6b82f={_0x46d5ea:0x810,_0x403777:0x5c0,_0x4c1638:0x7f5},_0x2ceabe=_0x3d5d32;var _0x2dfa27,_0x44ca0c,_0x5b289b;if(!this['_enabledDraw']||!this[_0x2ceabe(_0xd6b82f._0x46d5ea)])return this;this['_enabledDraw']=![];if(!this[_0x2ceabe(0x810)][_0x2ceabe(0xf57)]()){this['remove'](!![]);return;}this[_0x2ceabe(_0xd6b82f._0x403777)](),this['fire'](EventType['drawCreated'],{'drawtype':this[_0x2ceabe(_0xd6b82f._0x4c1638)],'positions':this[_0x2ceabe(0xbb8)]},!![]),(_0x2dfa27=this['options'])!==null&&_0x2dfa27!==void 0x0&&_0x2dfa27[_0x2ceabe(0x9de)]&&this['options']['success'](this),(_0x44ca0c=this['options'])!==null&&_0x44ca0c!==void 0x0&&(_0x5b289b=_0x44ca0c[_0x2ceabe(0x227)])!==null&&_0x5b289b!==void 0x0&&_0x5b289b['resolve']&&this['options']['_promise']['resolve'](this);}[_0x3d5d32(0xd41)](){if(!this['_enabledDraw']||!this['_editing_entity'])return![];if(!this['_editing_entity']['endDraw']())return![];return!![];}['_getDrawEntityStyle'](){const _0x101a22=this['_style2JsonBase'](this['style'],![]);return delete _0x101a22['highlight'],_0x101a22;}['_getDrawPointEntityClass'](_0x14ae39,_0x4dac07){const _0x2f9d77={_0x12709e:0xcd2,_0x57c17f:0xbbe},_0xbff7f1=_0x3d5d32;return _0x14ae39[_0xbff7f1(_0x2f9d77._0x12709e)]=!_0x4dac07,_0x14ae39['style']=getEditPointStyle(),create$4(_0xbff7f1(_0x2f9d77._0x57c17f),_0x14ae39);}[_0x3d5d32(0x5c0)](){const _0x583918={_0x8baca6:0xf06,_0x3ba2fd:0x7f5,_0x32ae01:0xb69},_0x15b922=_0x3d5d32,_0x328d96=this['_editing_entity']['toJSON']();this[_0x15b922(0x810)][_0x15b922(_0x583918._0x8baca6)](!![]),delete this['_editing_entity'];if(_0x328d96['style']&&this['type']['startsWith'](_0x328d96[_0x15b922(_0x583918._0x3ba2fd)]))this['options']['style']=merge(this['options']['style'],_0x328d96['style']),this['_updateStyleBaseHook'](this['options']['style']);else this['_updateStyleByEdit']&&this['_updateStyleByEdit'](_0x328d96['style'],_0x328d96);if(_0x328d96['position'])this['position']=_0x328d96[_0x15b922(_0x583918._0x32ae01)];else _0x328d96['positions']&&(this['positions']=_0x328d96[_0x15b922(0xbb8)]);this['show']=!![];}['startEditing'](){const _0x2cf930={_0x5bc057:0x810,_0x5d47ef:0x414,_0x1f541f:0x7f5},_0x4999df={_0x36007e:0x810,_0x311240:0x810,_0x16667e:0x924,_0x1219ba:0xd76},_0x3baff7={_0x389a30:0x107f,_0x4f4ec1:0xdde},_0x527145=_0x3d5d32;if(this[_0x527145(0x95b)])return this;this['_enabledEdit']=!![];if(!this['_map'])throw new Error('编辑时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this[_0x527145(_0x2cf930._0x5bc057)]=this['_getDrawEntityClass']({'hasMoveEdit':this['options'][_0x527145(0x98b)],'hasHeightEdit':this['options'][_0x527145(0x6b5)],'style':this['_getDrawEntityStyle'](),'position':this['position'],'positions':this['positions'],'private':!![]},![]);this['_startEditingHook']&&this[_0x527145(_0x2cf930._0x5d47ef)](this['_editing_entity']);this[_0x527145(0x810)]['parent']=this;const _0x416ab5=this['type']['startsWith'](this['_editing_entity'][_0x527145(_0x2cf930._0x1f541f)]);this['_editing_entity']['once'](EventType['editStop'],_0x2e9b02=>{this['stopEditing']();}),this['_editing_entity']['on'](EventType['editStyle'],_0x19b739=>{const _0xba3a46=_0x527145,_0x3526ae=this['_editing_entity']['toJSON']();if(_0x3526ae['style']&&_0x416ab5)this['options'][_0xba3a46(0xdde)]=merge(this['options']['style'],_0x3526ae['style']);else this[_0xba3a46(_0x3baff7._0x389a30)]&&this[_0xba3a46(0x107f)](_0x3526ae[_0xba3a46(_0x3baff7._0x4f4ec1)],_0x3526ae);}),this['_editing_entity']['on']([EventType[_0x527145(0x25f)],EventType['editMovePoint'],EventType['editRemovePoint']],_0x55439e=>{const _0x5f336c=_0x527145;if(this['_editing_entity']['_position_draw'])_0x416ab5?(this[_0x5f336c(0xe7f)]=LngLatPoint['parse'](this[_0x5f336c(_0x4999df._0x36007e)]['_position_draw']),this['_position']=this[_0x5f336c(_0x4999df._0x311240)]['_position_draw']):this['position']=this['_editing_entity']['_position_draw'];else this['_editing_entity']['_positions_draw']&&(_0x416ab5?(this['_points']=LngLatArray['toPoints'](this['_editing_entity']['_positions_draw']),this[_0x5f336c(_0x4999df._0x16667e)]=this[_0x5f336c(_0x4999df._0x311240)][_0x5f336c(_0x4999df._0x1219ba)]):this['positions']=this['_editing_entity'][_0x5f336c(_0x4999df._0x1219ba)]);}),this['_map']['graphicLayer']['addGraphic'](this['_editing_entity']),this['_editing_entity']['startEditing'](),_0x416ab5?this['show']=![]:this['_editing_entity'][_0x527145(0x7f5)]!=='point'&&(this['_editing_entity']['entityGraphic']['show']=![]);}[_0x3d5d32(0xda5)](){const _0x5ea863=_0x3d5d32;if(!this['_enabledEdit']||!this['_editing_entity'])return this;this['_enabledEdit']=![],this[_0x5ea863(0x5c0)]();}}class BasePointPrimitive extends BasePrimitive{constructor(_0x19786c={}){const _0x2ecbd5={_0x4b7492:0xc46,_0x36febd:0xb69,_0x1a81be:0xce3,_0x23c8d6:0x3d6,_0x1dc528:0x5bb,_0x24bb20:0x9dc,_0x2bb728:0xc19,_0x4f7763:0xe95,_0x55ee7a:0xc19,_0x48f0e7:0xe95,_0x11388e:0xdde},_0xbab6ca=_0x3d5d32;super(_0x19786c),this[_0xbab6ca(_0x2ecbd5._0x4b7492)]=this['options']['hasEdit']??!![];_0x19786c['positions']&&(this['positions']=_0x19786c['positions']);if(_0x19786c['position'])this[_0xbab6ca(_0x2ecbd5._0x36febd)]=_0x19786c[_0xbab6ca(0xb69)];else{if(_0x19786c['modelMatrix']){this['_position']=Cesium__namespace[_0xbab6ca(0xf5d)][_0xbab6ca(0xb7a)](_0x19786c[_0xbab6ca(0xd93)],new Cesium__namespace[(_0xbab6ca(0xe95))]()),this['_point']=LngLatPoint[_0xbab6ca(_0x2ecbd5._0x1a81be)](this['_position']);if(!Cesium__namespace['defined'](this['style']['heading'])){const _0x17f380=Cesium__namespace['Matrix4']['getMatrix3'](_0x19786c['modelMatrix'],new Cesium__namespace['Matrix3']()),_0x2192b1=Cesium__namespace['Matrix4'][_0xbab6ca(_0x2ecbd5._0x23c8d6)](Cesium__namespace[_0xbab6ca(_0x2ecbd5._0x1dc528)]['eastNorthUpToFixedFrame'](this['_position']),new Cesium__namespace['Matrix3']()),_0x12a74f=Cesium__namespace[_0xbab6ca(_0x2ecbd5._0x24bb20)][_0xbab6ca(_0x2ecbd5._0x2bb728)](_0x2192b1,0x0,new Cesium__namespace[(_0xbab6ca(_0x2ecbd5._0x4f7763))]()),_0x204205=Cesium__namespace['Matrix3']['getColumn'](_0x2192b1,0x1,new Cesium__namespace['Cartesian3']()),_0x3c3b8a=Cesium__namespace['Matrix3'][_0xbab6ca(_0x2ecbd5._0x55ee7a)](_0x2192b1,0x2,new Cesium__namespace['Cartesian3']());let _0x355cf8=Cesium__namespace['Matrix3']['getColumn'](_0x17f380,0x0,new Cesium__namespace['Cartesian3']());_0x355cf8=Cesium__namespace['Cartesian3']['cross'](_0x355cf8,_0x3c3b8a,_0x355cf8),_0x355cf8=Cesium__namespace[_0xbab6ca(_0x2ecbd5._0x48f0e7)][_0xbab6ca(0x24c)](_0x3c3b8a,_0x355cf8,_0x355cf8),_0x355cf8=Cesium__namespace['Cartesian3']['normalize'](_0x355cf8,_0x355cf8);let _0x54a7e3=Cesium__namespace['Cartesian3']['angleBetween'](_0x12a74f,_0x355cf8);const _0x3ffaea=Cesium__namespace['Cartesian3']['angleBetween'](_0x204205,_0x355cf8);_0x3ffaea>Math['PI']*0.5&&(_0x54a7e3=0x2*Math['PI']-_0x54a7e3),this[_0xbab6ca(_0x2ecbd5._0x11388e)]['heading']=Cesium__namespace['Math']['toDegrees'](_0x54a7e3);}}}}get[_0x3d5d32(0xb69)](){const _0x500188={_0x1fd7d9:0x87d,_0x12c405:0x9f4},_0x2df516=_0x3d5d32;if(this[_0x2df516(_0x500188._0x1fd7d9)])return this['_position'];if(this['property']){var _0x1a4278,_0x1ef51e;return this['property']['getValue']((_0x1a4278=this['_map'])===null||_0x1a4278===void 0x0?void 0x0:(_0x1ef51e=_0x1a4278[_0x2df516(_0x500188._0x12c405)])===null||_0x1ef51e===void 0x0?void 0x0:_0x1ef51e['currentTime']);}}set['position'](_0x1e2600){const _0x286165={_0x49e166:0x673,_0x290c59:0xd29,_0x113bbc:0xd29,_0x37850f:0x810,_0x1c3ad5:0x87d},_0x303149=_0x3d5d32;var _0x259b41;if(this[_0x303149(_0x286165._0x49e166)](_0x1e2600))return this[_0x303149(0x87d)];this['_point']=LngLatPoint['parse'](_0x1e2600);if(this[_0x303149(0xe7f)]){let _0x4c1a00=this['style']['setHeight'];Cesium__namespace['defined'](_0x4c1a00)&&(isString(_0x4c1a00)&&(_0x4c1a00=Number(template(_0x4c1a00,this['attr'],!![])),isNaN(_0x4c1a00)&&(_0x4c1a00=0x0)),this['_point']['alt']=_0x4c1a00);const _0x574f4d=this['getAddHeight']();_0x574f4d!==0x0&&(this[_0x303149(0xe7f)][_0x303149(_0x286165._0x290c59)]=this['_point'][_0x303149(_0x286165._0x113bbc)]+_0x574f4d);}this['_position']=(_0x259b41=this['_point'])===null||_0x259b41===void 0x0?void 0x0:_0x259b41['toCartesian'](),this[_0x303149(0x433)]['modelMatrix']&&delete this['options']['modelMatrix'],this[_0x303149(0xd2e)]&&this[_0x303149(0x367)](),this['_primitive_label']&&this['_updateLabelPosition'](),this[_0x303149(_0x286165._0x37850f)]&&(this['_editing_entity']['position']=this[_0x303149(_0x286165._0x1c3ad5)]),this['fire'](EventType[_0x303149(0x3e8)],{'position':this[_0x303149(_0x286165._0x1c3ad5)]});}get[_0x3d5d32(0x326)](){return this['positions'];}get['positionShow'](){return this['_position'];}get['point'](){return this['_point'];}get['coordinate'](){return this['getCoordinate']();}get[_0x3d5d32(0xe72)](){const _0x10c85b={_0x223640:0xb69},_0x48a957=_0x3d5d32;return this[_0x48a957(_0x10c85b._0x223640)];}get['centerPoint'](){const _0x1ef0ce=_0x3d5d32;return this[_0x1ef0ce(0xbbe)];}get[_0x3d5d32(0x83e)](){var _0xe4d233;return(_0xe4d233=this['point'])===null||_0xe4d233===void 0x0?void 0x0:_0xe4d233['alt'];}set['height'](_0x4960bb){const _0x3e7748={_0x521c19:0xbbe},_0x38d1eb=_0x3d5d32;this[_0x38d1eb(_0x3e7748._0x521c19)]['alt']=_0x4960bb,this['position']=this['point'];}get['positions'](){return this['position']?[this['position']]:null;}set['positions'](_0x30e026){_0x30e026&&_0x30e026['length']>0x0&&(this['position']=_0x30e026[0x0]);}get['points'](){return[this['point']];}get['coordinates'](){return[this['coordinate']];}get['orientation'](){const _0x23f591={_0x302b39:0x433},_0x2b58b1=_0x3d5d32;return this['_orientation']||this[_0x2b58b1(_0x23f591._0x302b39)]['orientation'];}set[_0x3d5d32(0x42d)](_0x27d8ef){const _0x27385b=_0x3d5d32;this[_0x27385b(0x8de)]=_0x27d8ef;}get['modelMatrix'](){const _0x586814={_0x4f70c4:0x8de},_0x3dca66=_0x3d5d32;return this[_0x3dca66(0x433)]['modelMatrix']?this['options']['modelMatrix']:this[_0x3dca66(0x4bf)](this['position'],this[_0x3dca66(_0x586814._0x4f70c4)]);}get['heading'](){const _0xfa64cb={_0xd1cf7:0xc74,_0x32904c:0xdde},_0x5d1135=_0x3d5d32;if(Cesium__namespace['defined'](this['_heading_reality']))return Cesium__namespace['Math']['toDegrees'](this[_0x5d1135(_0xfa64cb._0xd1cf7)]);return this[_0x5d1135(_0xfa64cb._0x32904c)]['heading']??0x0;}set[_0x3d5d32(0xe39)](_0x1bbc42){this['style']['heading']=_0x1bbc42,this['updateModelMatrix']();}get[_0x3d5d32(0x5cf)](){const _0x4c7373={_0x4afec3:0xb84,_0x41ccea:0xbc6,_0x2016b2:0x103e,_0x939ec1:0xdde},_0x266ad3=_0x3d5d32;if(Cesium__namespace[_0x266ad3(_0x4c7373._0x4afec3)](this[_0x266ad3(_0x4c7373._0x41ccea)]))return Cesium__namespace[_0x266ad3(_0x4c7373._0x2016b2)]['toDegrees'](this['_pitch_reality']);return this[_0x266ad3(_0x4c7373._0x939ec1)][_0x266ad3(0x5cf)]??0x0;}set['pitch'](_0x2e34ff){const _0x5454b7={_0x1995bc:0x5cf},_0x5ecae8=_0x3d5d32;this['style'][_0x5ecae8(_0x5454b7._0x1995bc)]=_0x2e34ff,this['updateModelMatrix']();}get['roll'](){const _0x5e754d={_0x3d8697:0x65e},_0x18551b=_0x3d5d32;if(Cesium__namespace['defined'](this[_0x18551b(_0x5e754d._0x3d8697)]))return Cesium__namespace['Math']['toDegrees'](this['_roll_reality']);return this['style']['roll']??0x0;}set['roll'](_0x42d65f){this['style']['roll']=_0x42d65f,this['updateModelMatrix']();}get['objectsToExclude'](){const _0x4f8003=_0x3d5d32;if(this[_0x4f8003(0x433)][_0x4f8003(0xc77)])return this['options']['objectsToExclude'];if(this['_objectsToExcludee'])return this['_objectsToExclude'];return undefined;}set[_0x3d5d32(0xc77)](_0x3af6dc){this['_objectsToExclude']=_0x3af6dc;}get['trackedEntity'](){const _0xf8e26e={_0x24973c:0x426},_0x3720a8=_0x3d5d32;return!this['_trackedEntity']&&(this[_0x3720a8(0xf5e)]=this[_0x3720a8(0x873)][_0x3720a8(_0xf8e26e._0x24973c)]['entities']['add']({'position':this['property']||new Cesium__namespace['CallbackProperty'](_0x239ae1=>{return this['_position'];},![]),'point':{'pixelSize':0x2,'color':Cesium__namespace['Color']['WHITE'][_0x3720a8(0xe57)](0.01)}})),this[_0x3720a8(0xf5e)];}get['debugAxis'](){return this['_debugAxis'];}set[_0x3d5d32(0x9ae)](_0x658039){const _0x554f1f={_0x1a6d79:0xe68,_0x123758:0xe8e,_0x41eb81:0x83e,_0xff1bd5:0xabe},_0x14afdc=_0x3d5d32;this['_debugAxis']=_0x658039;if(!this[_0x14afdc(_0x554f1f._0x1a6d79)]){const _0x1fae2d=Math[_0x14afdc(_0x554f1f._0x123758)](Cesium__namespace['Cartographic']['fromCartesian'](this['positionShow'])[_0x14afdc(_0x554f1f._0x41eb81)]*0.06,0x64);this['debugAxisPrimitive']=this['_layer']['primitiveCollection']['add'](new Cesium__namespace['DebugModelMatrixPrimitive']({'modelMatrix':this['modelMatrix'],'length':_0x1fae2d,'width':0x5})),this['debugAxisPrimitive']['_tooltipConfig']={'content':_0x14afdc(0x29b),'options':this['options']['tooltipOptions']},this[_0x14afdc(_0x554f1f._0xff1bd5)]&&(this[_0x14afdc(_0x554f1f._0x1a6d79)]['_timeTik']=setInterval(()=>{this['debugAxisPrimitive']['modelMatrix']=this['modelMatrix'];},0x12c)),this['bindPickId'](this['debugAxisPrimitive']);}this['debugAxisPrimitive']['show']=_0x658039;}get[_0x3d5d32(0x61c)](){const _0x4a3bc9=_0x3d5d32;return this[_0x4a3bc9(0xe68)]?this[_0x4a3bc9(0xe68)]['length']:0x0;}set['debugAxisLength'](_0x3090d8){const _0x3f8273=_0x3d5d32;!this['debugAxisPrimitive']&&(this[_0x3f8273(0x9ae)]=!![]),this['debugAxisPrimitive']['length']=_0x3090d8;}['_addedHook'](_0x3fa12d){const _0x13c0c2=_0x3d5d32;if(!this['show']||!this['position'])return;this['_forPositionProperty'](this[_0x13c0c2(0x433)]['position']),super['_addedHook'](_0x3fa12d);}[_0x3d5d32(0x566)](_0x4e772a){const _0x2f5e88={_0x37dbe4:0xf5e,_0x4289a5:0x98d},_0x370355=_0x3d5d32;this[_0x370355(_0x2f5e88._0x37dbe4)]&&(this['_map'][_0x370355(_0x2f5e88._0x4289a5)]===this['_trackedEntity']&&(this['_map']['trackedEntity']=undefined),this['_layer']['dataSource']['entities']['remove'](this[_0x370355(_0x2f5e88._0x37dbe4)]),delete this['_trackedEntity']),super['_removedHook'](_0x4e772a);}['updateModelMatrix'](){this['_primitive']&&(this['_primitive']['modelMatrix']=this['modelMatrix']);}['_getModelMatrix'](_0xfefe82,_0x5d85f9){const _0x527630={_0x247c25:0x562,_0x361e74:0x103e,_0x221bbf:0x5cf,_0x449d3d:0x952,_0x5a7c23:0xbf1,_0x5cdfbf:0xdde,_0x173058:0xfbe,_0x188c9f:0xb84,_0x1dd995:0xdde,_0x53e659:0xbc6,_0x3c17f2:0x9f9,_0x280b34:0x1007,_0x30e0cc:0xb84,_0x35dae4:0x3c5,_0x2b938d:0xd8e},_0x2c6032=_0x3d5d32;if(!_0xfefe82)return Cesium__namespace[_0x2c6032(0xf5d)]['IDENTITY'];let _0x3fcb48=Cesium__namespace['Math'][_0x2c6032(_0x527630._0x247c25)](this['style']['heading']||0x0),_0x398064=Cesium__namespace[_0x2c6032(_0x527630._0x361e74)]['toRadians'](this['style'][_0x2c6032(_0x527630._0x221bbf)]||0x0),_0xda087d=Cesium__namespace[_0x2c6032(0x103e)]['toRadians'](this['style'][_0x2c6032(_0x527630._0x449d3d)]||0x0);const _0x119dc6=this['style'][_0x2c6032(_0x527630._0x5a7c23)]||!Cesium__namespace['defined'](this['style']['heading'])||!Cesium__namespace[_0x2c6032(0xb84)](this['style']['pitch'])||!Cesium__namespace['defined'](this[_0x2c6032(_0x527630._0x5cdfbf)]['roll']);if(_0x5d85f9&&_0x119dc6){if(_0x5d85f9['getValue']){var _0x5919fc,_0x4f050f;_0x5d85f9=_0x5d85f9[_0x2c6032(_0x527630._0x173058)]((_0x5919fc=this['_map'])===null||_0x5919fc===void 0x0?void 0x0:(_0x4f050f=_0x5919fc['clock'])===null||_0x4f050f===void 0x0?void 0x0:_0x4f050f[_0x2c6032(0x4f8)]);}if(_0x5d85f9){const _0x3add23=getHeadingPitchRollByOrientation(_0xfefe82,_0x5d85f9);this['style']['mergeOrientation']?(_0x3fcb48+=_0x3add23['heading'],_0xda087d+=_0x3add23[_0x2c6032(0x952)],_0x398064+=_0x3add23['pitch']):(!Cesium__namespace[_0x2c6032(_0x527630._0x188c9f)](this[_0x2c6032(_0x527630._0x1dd995)]['heading'])&&(_0x3fcb48=_0x3add23['heading']),!Cesium__namespace['defined'](this['style']['roll'])&&(_0xda087d=_0x3add23['roll']),!Cesium__namespace[_0x2c6032(0xb84)](this['style']['pitch'])&&(_0x398064=_0x3add23['pitch']));}}this['_heading_reality']=_0x3fcb48,this[_0x2c6032(_0x527630._0x53e659)]=_0x398064,this['_roll_reality']=_0xda087d;const _0x1eac98=Cesium__namespace['Transforms'][_0x2c6032(_0x527630._0x3c17f2)](_0xfefe82,new Cesium__namespace['HeadingPitchRoll'](_0x3fcb48,_0x398064,_0xda087d),Cesium__namespace['Ellipsoid']['WGS84'],this['options'][_0x2c6032(_0x527630._0x280b34)]);if(Cesium__namespace[_0x2c6032(0xb84)](this['scaleX'])&&Cesium__namespace['defined'](this['scaleY'])&&Cesium__namespace[_0x2c6032(_0x527630._0x30e0cc)](this[_0x2c6032(_0x527630._0x35dae4)]))Cesium__namespace['Matrix4'][_0x2c6032(0x8a2)](_0x1eac98,new Cesium__namespace[(_0x2c6032(0xe95))](this['scaleX'],this[_0x2c6032(_0x527630._0x2b938d)],this[_0x2c6032(0x3c5)]),_0x1eac98);else Cesium__namespace['defined'](this['style']['scale'])&&Cesium__namespace[_0x2c6032(0xf5d)]['multiplyByScale'](_0x1eac98,new Cesium__namespace['Cartesian3'](this[_0x2c6032(0xdde)][_0x2c6032(0x515)],this['style']['scale'],this['style'][_0x2c6032(0x515)]),_0x1eac98);return _0x1eac98;}['_getGeoJsonGeometry'](_0x57b015){const _0x21cce4={_0x5abd92:0xbcb},_0x4fbdcf=_0x3d5d32;return{'type':'Point','coordinates':this['getCoordinate'](_0x57b015===null||_0x57b015===void 0x0?void 0x0:_0x57b015[_0x4fbdcf(_0x21cce4._0x5abd92)])};}[_0x3d5d32(0x673)](_0x507c52){const _0x17585a={_0x2725cd:0x1e0,_0xfd2a9e:0x433},_0x3325f0=_0x3d5d32;return _0x507c52 instanceof Cesium__namespace['CallbackProperty']||_0x507c52 instanceof Cesium__namespace['SampledPositionProperty']?(this['options'][_0x3325f0(_0x17585a._0x2725cd)]=this[_0x3325f0(_0x17585a._0xfd2a9e)]['frameRate']??0x14,this['_orientation']=this['options']['orientation']||new Cesium__namespace['VelocityOrientationProperty'](_0x507c52),this[_0x3325f0(0xabe)]=_0x507c52,this['bindUpdateEvent'](),!![]):![];}[_0x3d5d32(0x635)](_0x319f2c){const _0x29eefd={_0x27d5fa:0x5d6},_0xcf4ffb=_0x3d5d32;if(!this[_0xcf4ffb(0x792)])return;this[_0xcf4ffb(0xabe)]&&(this['_position']=this['property']['getValue'](_0x319f2c[_0xcf4ffb(_0x29eefd._0x27d5fa)]),this['czmObject']&&this[_0xcf4ffb(0x367)](),this['_primitive_label']&&this['_updateLabelPosition']());}['_getPopupPosition'](){return this['property']||this['position']||this['center'];}['addDynamicPosition'](_0x5790da,_0x3523a2){const _0x313010={_0x24d326:0x1d1,_0x2242e9:0xa53,_0x40e682:0x8b7,_0x7b8298:0x8b7,_0x1869e5:0xf72,_0xdc74a5:0x87d,_0x235505:0xf72},_0x6da4bf=_0x3d5d32;var _0x41a608,_0x371f36,_0x293226,_0x14a592;!this[_0x6da4bf(0xf72)]&&this[_0x6da4bf(0x273)]();this['_removeDynamicPosition']();const _0x1aa07c=((_0x41a608=this[_0x6da4bf(_0x313010._0x24d326)])===null||_0x41a608===void 0x0?void 0x0:(_0x371f36=_0x41a608['clock'])===null||_0x371f36===void 0x0?void 0x0:_0x371f36['currentTime'])||Cesium__namespace['JulianDate']['now']();if(!_0x3523a2)_0x3523a2=_0x1aa07c;else{if(isNumber(_0x3523a2))_0x3523a2=Cesium__namespace['JulianDate'][_0x6da4bf(_0x313010._0x2242e9)](_0x1aa07c,_0x3523a2,new Cesium__namespace[(_0x6da4bf(_0x313010._0x40e682))]());else{if(isString(_0x3523a2))_0x3523a2['indexOf']('Z')===-0x1?_0x3523a2=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x3523a2)):_0x3523a2=Cesium__namespace['JulianDate']['fromIso8601'](_0x3523a2);else _0x3523a2 instanceof Date&&(_0x3523a2=Cesium__namespace[_0x6da4bf(_0x313010._0x7b8298)]['fromDate'](_0x3523a2));}}_0x5790da=LngLatPoint['parse'](_0x5790da);const _0x198873=(_0x293226=this[_0x6da4bf(_0x313010._0x1869e5)])===null||_0x293226===void 0x0?void 0x0:(_0x14a592=_0x293226['_property'])===null||_0x14a592===void 0x0?void 0x0:_0x14a592['_times'];if(this['options']['autoMiddleDynamicPosition']&&(_0x198873===null||_0x198873===void 0x0?void 0x0:_0x198873[_0x6da4bf(0xc84)])>0x0&&this[_0x6da4bf(0x87d)]){const _0x13c0c4=_0x198873[_0x198873['length']-0x1];if(Cesium__namespace[_0x6da4bf(_0x313010._0x7b8298)]['secondsDifference'](_0x1aa07c,_0x13c0c4)>0.3){let _0x1070ae=this[_0x6da4bf(_0x313010._0xdc74a5)];if(this[_0x6da4bf(0x336)]){const _0x2b143b=0.01;_0x1070ae=getOnLinePointByLen(this['_lastDynamicPosition'],this[_0x6da4bf(0x87d)],_0x2b143b,!![]);}_0x1070ae=setPositionsHeight(_0x1070ae,_0x5790da['alt']||0x0),this[_0x6da4bf(_0x313010._0x235505)][_0x6da4bf(0xade)](_0x1aa07c,_0x1070ae);}}const _0xdca239=_0x5790da['toCartesian']();return this['_sampledPositionProperty']['addSample'](_0x3523a2,_0xdca239),this[_0x6da4bf(0x336)]=_0xdca239,this;}['_initSampledPositionProperty'](){const _0xb8958b={_0x5ae3e9:0x433,_0x1001e0:0x433},_0x3886e1=_0x3d5d32;this['_clampToTilesetFrame']=-0x1,this['_frameRateHeight']=this[_0x3886e1(_0xb8958b._0x5ae3e9)]['frameRateHeight']??0x1e,this['_maxCacheCount']=this[_0x3886e1(0x433)]['maxCacheCount']??0x32;let _0x9f9433;this['_sampledPositionProperty']?_0x9f9433=this['_sampledPositionProperty']:(_0x9f9433=new Cesium__namespace['SampledPositionProperty'](this[_0x3886e1(_0xb8958b._0x1001e0)]['referenceFrame'],this['options']['numberOfDerivatives']),_0x9f9433['forwardExtrapolationType']=this['options']['forwardExtrapolationType']??Cesium__namespace[_0x3886e1(0xaa6)][_0x3886e1(0xa83)],_0x9f9433[_0x3886e1(0x1019)]=this['options']['backwardExtrapolationType']??Cesium__namespace['ExtrapolationType']['NONE'],this['_sampledPositionProperty']=_0x9f9433),this['property']=new Cesium__namespace['CallbackProperty'](_0x35f78e=>{const _0x5d2331=_0x3886e1;if(!this['_map'])return undefined;let _0x3425f2=_0x9f9433['getValue'](_0x35f78e);if(_0x3425f2&&this['options']['clampToTileset']){this['_clampToTilesetFrame']++;if(!this['_clampToTilesetHeight']||this['_clampToTilesetFrame']%this['_frameRateHeight']===0x0){const _0x1438a5=getHeight(this['_map']['scene'],_0x3425f2,{'objectsToExclude':this['_layer']['objectsToExclude'],'has3dtiles':!![]});_0x1438a5&&(this['_clampToTilesetHeight']=_0x1438a5);}if(this['_clampToTilesetHeight']){const _0x57aefe=Cesium__namespace['Cartographic'][_0x5d2331(0xd14)](_0x3425f2);_0x3425f2=Cesium__namespace['Cartesian3']['fromRadians'](_0x57aefe[_0x5d2331(0xbfd)],_0x57aefe['latitude'],this['_clampToTilesetHeight']+this['getAddHeight']());}}return _0x3425f2;},![]),this['_orientation']=this['options'][_0x3886e1(0x42d)]||new Cesium__namespace['VelocityOrientationProperty'](_0x9f9433),this['bindUpdateEvent']();}['_removeDynamicPosition'](){const _0x25dff0={_0x2bc23c:0x230,_0x113ce6:0xc84},_0x2b402d=_0x3d5d32;var _0x2e35aa,_0x4b0953;if(this[_0x2b402d(_0x25dff0._0x2bc23c)]<0x1)return;const _0x2eba17=(_0x2e35aa=this['_sampledPositionProperty'])===null||_0x2e35aa===void 0x0?void 0x0:(_0x4b0953=_0x2e35aa[_0x2b402d(0x5f7)])===null||_0x4b0953===void 0x0?void 0x0:_0x4b0953['_times'];if(!_0x2eba17||_0x2eba17[_0x2b402d(0xc84)]===0x0)return;const _0x2bbb23=_0x2eba17[_0x2b402d(_0x25dff0._0x113ce6)]-this['_maxCacheCount']-0x1;_0x2bbb23>0x0&&this['_sampledPositionProperty'][_0x2b402d(0x672)](new Cesium__namespace[(_0x2b402d(0x6ed))]({'start':_0x2eba17[0x0],'stop':_0x2eba17[_0x2bbb23]}));}['autoSurfaceHeight'](_0xcd8dbe={}){const _0x3ffdc5={_0x48945:0xb69},_0x84e7f7=_0x3d5d32;return getSurfaceHeight(this['_map']['scene'],this[_0x84e7f7(_0x3ffdc5._0x48945)],_0xcd8dbe)['then'](_0x2e87a6=>{_0x2e87a6['position']&&(this['position']=_0x2e87a6['position']);});}['clampToGround'](_0x556073){return this['autoSurfaceHeight'](_0x556073);}['getCoordinate'](_0x2cb630){const _0x578dcc={_0x2f7c53:0xbbe},_0x36f4f3=_0x3d5d32;return this['point']?this[_0x36f4f3(_0x578dcc._0x2f7c53)]['toArray'](_0x2cb630):[];}}class PointPrimitive extends BasePointPrimitive{get['primitiveCollection'](){const _0x14a326=_0x3d5d32;var _0x19173b;return(_0x19173b=this[_0x14a326(0x873)])===null||_0x19173b===void 0x0?void 0x0:_0x19173b['pointCollection'];}[_0x3d5d32(0x68e)](_0x3f264e){const _0x3fbe75={_0x406fdb:0x517},_0x4d3271=_0x3d5d32;if(this[_0x4d3271(_0x3fbe75._0x406fdb)])this['_primitive']['show']=_0x3f264e;else _0x3f264e&&super['_showHook'](_0x3f264e);}['_addedHook'](_0x5272ff){const _0xdaba01={_0xd440d6:0x792,_0x276a04:0xdde,_0x2a898b:0xff3},_0x4dfc78=_0x3d5d32;if(!this[_0x4dfc78(_0xdaba01._0xd440d6)])return;this['_forPositionProperty'](this[_0x4dfc78(0x433)]['position']),this['_calculateAsynSurfacePosition']();this['_primitive']&&this['primitiveCollection']['remove'](this['_primitive']);const _0x5bded3=PointStyleConver[_0x4dfc78(0x83d)](this[_0x4dfc78(_0xdaba01._0x276a04)],{'show':this['show'],'position':this['position']});this['_primitive']=this[_0x4dfc78(0x5f4)][_0x4dfc78(_0xdaba01._0x2a898b)](_0x5bded3),this['style'][_0x4dfc78(0x32a)]&&this[_0x4dfc78(0x3d2)]();}[_0x3d5d32(0x7b3)](_0x13c692,_0x2a07a3){PointStyleConver['toCesiumVal'](_0x13c692,this['primitive']);}['_style2Json'](_0x281015,_0x5bdda1){const _0x16cc2e={_0x39650e:0x3db},_0x3257bc=_0x3d5d32;return PointStyleConver[_0x3257bc(_0x16cc2e._0x39650e)](_0x281015,_0x5bdda1);}['_updatePositionsHook'](){const _0x1f6d41={_0x342371:0xb69},_0x5a8425=_0x3d5d32;this['_primitive'][_0x5a8425(_0x1f6d41._0x342371)]=this['position'];}['_calculateAsynSurfacePosition'](){const _0x33d7a9={_0x283f23:0xc0a,_0x250ae1:0x27d,_0x3f7189:0x64c,_0x31ab3a:0x1d1},_0x1145df=_0x3d5d32;this[_0x1145df(_0x33d7a9._0x283f23)]=![];const _0x3dca21=this['position'];_0x3dca21 instanceof Cesium__namespace['Cartesian3']&&(this[_0x1145df(0xdde)]['clampToGround']||this[_0x1145df(0xdde)]['heightReference']===Cesium__namespace[_0x1145df(0x2d5)]['CLAMP_TO_GROUND']||this['style'][_0x1145df(_0x33d7a9._0x250ae1)]===Cesium__namespace['HeightReference'][_0x1145df(_0x33d7a9._0x3f7189)])&&getSurfaceHeight(this[_0x1145df(_0x33d7a9._0x31ab3a)]['scene'],_0x3dca21,this[_0x1145df(0xdde)])['then'](_0x41c61a=>{const _0x53517c=_0x1145df;if(this['isDestroy'])return;this['style']['heightReference']===Cesium__namespace['HeightReference']['RELATIVE_TO_GROUND']&&(_0x41c61a['point']['alt']+=_0x41c61a['height_original']),this['position']=_0x41c61a['point'],this[_0x53517c(0xc0a)]=!![];});}[_0x3d5d32(0xac7)](_0x3ece73,_0xad4e06){return create$4('point',_0x3ece73);}}register$4('pointP',PointPrimitive,!![]);class BasePolyPrimitive extends BasePrimitive{constructor(_0x4ebccd={}){const _0x3b6d04={_0x5d42ee:0x433,_0x2cf3d7:0xdde,_0x58b679:0xbb8},_0xac7f85=_0x3d5d32;super(_0x4ebccd),this['_hasEdit']=this[_0xac7f85(_0x3b6d04._0x5d42ee)][_0xac7f85(0x8eb)]??!![],_0x4ebccd['positions']&&(this[_0xac7f85(_0x3b6d04._0x2cf3d7)]['buffer']>0x0?this[_0xac7f85(_0x3b6d04._0x58b679)]=bufferPoints(_0x4ebccd['positions'],this['style']['buffer'],this['style'][_0xac7f85(0x6d0)]):this['positions']=_0x4ebccd['positions']);}get['center'](){return this['style']['closure']?this['centerOfMass']:this['centerOfLine'];}get['centerOfMass'](){return centerOfMass(this['positions']);}get[_0x3d5d32(0x718)](){const _0x236df4=_0x3d5d32,_0xffedb1=this[_0x236df4(0xbb8)];if(!_0xffedb1||_0xffedb1['length']===0x0)return null;else{if(_0xffedb1['length']===0x1)return _0xffedb1[0x0];}return _0xffedb1['length']<0xa?sliceByMaxDistance(_0xffedb1,this['distance']/0x2,{'point':!![]}):_0xffedb1[Math['floor'](_0xffedb1['length']/0x2)];}get['distance'](){return getDistance(this['positions']);}get[_0x3d5d32(0x772)](){return getSurfaceArea(this['positions']);}get['positions'](){const _0x5b6967={_0x11c723:0x924},_0x5ab7c2=_0x3d5d32;return this[_0x5ab7c2(_0x5b6967._0x11c723)];}set['positions'](_0x4d99c1){const _0x1f9cb6={_0xa1a503:0x3e8},_0x427e9b={_0x16815d:0x9e4,_0x1e4d59:0xe12},_0x2f3a0d=_0x3d5d32;if(!_0x4d99c1)return;const _0x6cdf6d=[],_0xe02ef5=[];_0x4d99c1[_0x2f3a0d(0x1061)]((_0x52baad,_0x15eb83)=>{const _0x3dfebc=_0x2f3a0d,_0x1ba140=LngLatPoint['parse'](_0x52baad);if(!_0x1ba140||!_0x1ba140['valid']())return;let _0x204106=this['style'][_0x3dfebc(_0x427e9b._0x16815d)];if(Cesium__namespace[_0x3dfebc(0xb84)](_0x204106)){if(isString(_0x204106))_0x204106=Number(template(_0x204106,this[_0x3dfebc(_0x427e9b._0x1e4d59)],!![])),isNaN(_0x204106)&&(_0x204106=0x0);else Array['isArray'](_0x204106)&&(_0x204106=_0x204106[_0x15eb83]||0x0);_0x1ba140[_0x3dfebc(0xd29)]=_0x204106;}const _0x2a327f=this['getAddHeight'](_0x15eb83);_0x2a327f!==0x0&&(_0x1ba140['alt']=_0x1ba140['alt']+_0x2a327f),_0x6cdf6d['push'](_0x1ba140),_0xe02ef5['push'](_0x1ba140[_0x3dfebc(0xed4)]());}),this[_0x2f3a0d(0x50e)]=_0x6cdf6d,this['_positions']=_0xe02ef5,this['_primitive']&&this['_updatePositionsHook'](),this['_primitive_label']&&this['_updateLabelPosition'](),this['_editing_entity']&&(this['_editing_entity']['positions']=_0xe02ef5),this[_0x2f3a0d(0xefc)](EventType[_0x2f3a0d(_0x1f9cb6._0xa1a503)],{'positions':this['_positions']});}get[_0x3d5d32(0x326)](){const _0x5eff03=_0x3d5d32;return this[_0x5eff03(0xbb8)];}get['points'](){const _0xcb10ce=_0x3d5d32;return!this['_points']&&(this['_points']=LngLatArray['toPoints'](this['_positions'])),this[_0xcb10ce(0x50e)];}get[_0x3d5d32(0x2ae)](){return this['getCoordinates']();}get['rectangle'](){const _0x315f65={_0x251ae9:0xeb1},_0x237c55=_0x3d5d32;return Cesium__namespace[_0x237c55(0x756)][_0x237c55(_0x315f65._0x251ae9)](this['positions']);}['_getGeoJsonGeometry'](_0x39dc8d){return{'type':'LineString','coordinates':this['getCoordinates'](_0x39dc8d===null||_0x39dc8d===void 0x0?void 0x0:_0x39dc8d['noAlt'])};}['getCoordinates'](_0x3768ef){const _0x4ca082={_0x4262aa:0x1061},_0x566c2a={_0x3a3f34:0xb75},_0x359702=_0x3d5d32,_0x3fcd56=[];return this[_0x359702(0xbf8)][_0x359702(_0x4ca082._0x4262aa)](_0xd06791=>{const _0x104c6c=_0x359702;_0x3fcd56[_0x104c6c(_0x566c2a._0x3a3f34)](_0xd06791['toArray'](_0x3768ef));}),_0x3fcd56;}['isInPoly'](_0x269b92){const _0x42980c={_0xdfa27d:0xbb8},_0x2ce79e=_0x3d5d32,_0x276c97=LngLatPoint['parse'](_0x269b92),_0x53c599=Cesium__namespace['Rectangle']['contains'](Cesium__namespace['Rectangle']['fromCartesianArray'](this[_0x2ce79e(_0x42980c._0xdfa27d)]),_0x276c97['toCartographic']());if(!_0x53c599)return![];return isInPoly(_0x276c97,this['coordinates']);}['autoSurfaceHeight'](_0x40dc79={}){const _0x290419={_0x558a00:0x9eb};return computeSurfacePoints({..._0x40dc79,'map':this['_map'],'positions':this['positions']})['then'](_0x29a45c=>{const _0x110207=_0x4132;return!_0x29a45c[_0x110207(_0x290419._0x558a00)]&&(this['positions']=_0x29a45c['positions']),_0x29a45c;});}['clampToGround'](_0x207337){return this['autoSurfaceHeight'](_0x207337);}}class PolylinePrimitive extends BasePolyPrimitive{['_conversionStyle'](_0x5d07a0){return PolylineStyleConver['toCesiumVal'](_0x5d07a0);}['_style2Json'](_0x5a79e8,_0x53e8c0){return PolylineStyleConver['toJSON'](_0x5a79e8,_0x53e8c0);}[_0x3d5d32(0xc66)](_0x5a8ead,_0x2335c8){const _0x3bb91e={_0x1de9ba:0x7c0,_0xd48392:0x263},_0x5eea23=_0x3d5d32;var _0x4d22dd;_0x5a8ead[_0x5eea23(0xbb8)]=this[_0x5eea23(0xbb8)]||[];_0x5a8ead['closure']&&((_0x4d22dd=_0x5a8ead['positions'])===null||_0x4d22dd===void 0x0?void 0x0:_0x4d22dd['length'])>0x0&&(_0x5a8ead[_0x5eea23(0xbb8)]=_0x5a8ead['positions']['concat'](_0x5a8ead[_0x5eea23(0xbb8)][0x0]));const _0x1e6777=_0x5a8ead[_0x5eea23(_0x3bb91e._0x1de9ba)]?Cesium__namespace['GroundPolylineGeometry']:Cesium__namespace['PolylineGeometry'];return new Cesium__namespace[(_0x5eea23(_0x3bb91e._0xd48392))]({'id':this['id'],'geometry':new _0x1e6777(_0x5a8ead),'attributes':this['options']['attributes']});}['_createAppearance'](_0x2d79d6,_0x2cd304){const _0x226d7e={_0x1c73fd:0x883,_0x2182e2:0xaf0},_0x3cb5bc=_0x3d5d32;if(_0x2d79d6['_isColorMaterial']){_0x2cd304[_0x3cb5bc(_0x226d7e._0x1c73fd)]['geometry']['vertexFormat']=Cesium__namespace['PolylineColorAppearance']['VERTEX_FORMAT'];if(!_0x2d79d6['colors']){const _0x3244e6=this['_getColorByColorMaterial'](_0x2d79d6);_0x2cd304['geometryInstances']['attributes']=_0x2cd304[_0x3cb5bc(_0x226d7e._0x1c73fd)]['attributes']||{},_0x2cd304[_0x3cb5bc(_0x226d7e._0x1c73fd)]['attributes']['color']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x3cb5bc(_0x226d7e._0x2182e2)](_0x3244e6),_0x2d79d6['depthFail']&&(_0x2cd304['geometryInstances']['attributes']['depthFailColor']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x3cb5bc(_0x226d7e._0x2182e2)](_0x2d79d6['depthFailColor']||_0x3244e6));}return new Cesium__namespace['PolylineColorAppearance']({..._0x2d79d6});}else return new Cesium__namespace['PolylineMaterialAppearance']({..._0x2d79d6});}['_updateStyleHook'](_0x5899c7,_0x11cab1){Cesium__namespace['defined'](_0x11cab1['color'])&&Object['keys'](_0x11cab1)===0x1?super['_updateStyleHook'](_0x5899c7,_0x11cab1):this['redraw'](_0x5899c7);}['_getDrawEntityClass'](_0x5ba634,_0x478282){const _0x367b21={_0x396ded:0x96e},_0x6dffed=_0x3d5d32;return create$4(_0x6dffed(_0x367b21._0x396ded),_0x5ba634);}}register$4('polylineP',PolylinePrimitive);class BaseLayer extends BaseClass{constructor(_0x436671={}){const _0xc06f28={_0x2efb86:0xa62,_0x6e4941:0x792,_0x2b5d96:0x6cd,_0x4a4032:0xbdb,_0x385f2f:0x24b,_0x688b8d:0x24b},_0x54cb47=_0x3d5d32;super(_0x436671),this['options']=_0x436671,_0x436671['id']=_0x436671['id']??createGuid(),_0x436671[_0x54cb47(_0xc06f28._0x2efb86)]=_0x436671['pid']??-0x1,this['_show']=_0x436671[_0x54cb47(_0xc06f28._0x6e4941)]??!![],this['_private']=_0x436671[_0x54cb47(_0xc06f28._0x2b5d96)],this[_0x54cb47(_0xc06f28._0x4a4032)]=_0x436671['opacity']??0x1,Cesium__namespace['defined'](_0x436671[_0x54cb47(_0xc06f28._0x385f2f)])&&(this['_opacity']=_0x436671[_0x54cb47(_0xc06f28._0x688b8d)]),this['options'][_0x54cb47(0x222)]&&(isString(this['options']['proxy'])?this[_0x54cb47(0xb2c)]=new Cesium__namespace['DefaultProxy'](this['options']['proxy']):this[_0x54cb47(0xb2c)]=this['options']['proxy']),replaceOnlineUrlDomain(this['options']),this['_bindControl'](),this['_readyPromise']=Cesium__namespace['defer'](),this['_state']=State['INITIALIZED'];}get['id'](){return this['options']['id'];}set['id'](_0x4e8e55){this['options']['id']=_0x4e8e55;}get['uuid'](){return this['options']['id'];}get['name'](){return this['options']['name'];}set['name'](_0x2b4b9c){const _0x75267=_0x3d5d32;this[_0x75267(0x433)]['name']=_0x2b4b9c;}get[_0x3d5d32(0xa62)](){return this['options']['pid'];}set[_0x3d5d32(0xa62)](_0x30e320){this['options']['pid']=_0x30e320;}get['type'](){return this['_type'];}get['state'](){const _0x591a8f=_0x3d5d32;return this[_0x591a8f(0xf35)];}get[_0x3d5d32(0x842)](){return this['_state']===State['ADDED'];}get[_0x3d5d32(0xf54)](){const _0x1244cb={_0x5e4ea1:0xf35,_0xfc16bb:0x580},_0x50df70=_0x3d5d32;return this[_0x50df70(_0x1244cb._0x5e4ea1)]===State[_0x50df70(_0x1244cb._0xfc16bb)];}get['isPrivate'](){if(this['_private'])return!![];return![];}get['readyPromise'](){const _0x381b31={_0x948487:0xaf2},_0x19ce8f=_0x3d5d32;return this[_0x19ce8f(_0x381b31._0x948487)]['promise'];}get['layer'](){return null;}get['show'](){return this['_show'];}set['show'](_0x5ef8d7){const _0x507f4c={_0xb06a9f:0x1061,_0x5587eb:0x792,_0x284437:0xa8d},_0x4e2604=_0x3d5d32;if(this['_show']===_0x5ef8d7||this['isDestroy'])return;this['options']['show']=_0x5ef8d7,this['_show']=_0x5ef8d7,this['layer']&&(Array['isArray'](this['layer'])?this['layer'][_0x4e2604(_0x507f4c._0xb06a9f)](function(_0xa5a2b){_0xa5a2b['show']=_0x5ef8d7;}):this['layer']['show']=_0x5ef8d7),this['isAdded']&&(this[_0x4e2604(0x68e)]&&this['_showHook'](_0x5ef8d7),_0x5ef8d7?this['fire'](EventType[_0x4e2604(_0x507f4c._0x5587eb)]):this['fire'](EventType[_0x4e2604(_0x507f4c._0x284437)]));}get['hasOpacity'](){if(this['options']['hasOpacity']===![])return![];return!!this['setOpacity'];}get['opacity'](){return this['_opacity'];}set['opacity'](_0x8eb769){const _0x2b3ebc={_0x1877b6:0xb2d},_0x14a4e0=_0x3d5d32;this[_0x14a4e0(0xbdb)]=_0x8eb769,this[_0x14a4e0(_0x2b3ebc._0x1877b6)]&&this[_0x14a4e0(_0x2b3ebc._0x1877b6)](_0x8eb769);}[_0x3d5d32(0x105c)](_0x5d97fb){const _0x573094=_0x3d5d32;return _0x5d97fb&&_0x5d97fb[_0x573094(0xc17)]&&_0x5d97fb[_0x573094(0xc17)](this),this;}['remove'](_0xfb715b){const _0x481823={_0x597c65:0xa9e},_0x32855c=_0x3d5d32;this['_map']&&this['_map'][_0x32855c(_0x481823._0x597c65)](this,_0xfb715b);}['_onAdd'](_0xe35783){const _0x1a2a35={_0x4e5aa2:0x37b,_0x5b3e05:0x584,_0x262862:0xe4c,_0x55808d:0xde1,_0x523d57:0xf35,_0x36e4b1:0xc17},_0x278fc3=_0x3d5d32;var _0x1f7a58;if(this[_0x278fc3(0x842)]||this['_state']===State['ADD'])return;this['_state']=State[_0x278fc3(_0x1a2a35._0x4e5aa2)],this['_map']=_0xe35783;if(this['options'][_0x278fc3(0x4b7)])this[_0x278fc3(_0x1a2a35._0x5b3e05)](this['options']['eventParent']);else{if(((_0x1f7a58=this['options'])===null||_0x1f7a58===void 0x0?void 0x0:_0x1f7a58['eventParent'])===![]);else this['addEventParent'](_0xe35783);}this['_mountedHook']&&!this['_createOK']&&(this[_0x278fc3(_0x1a2a35._0x262862)](),this[_0x278fc3(_0x1a2a35._0x55808d)]=!![]),this[_0x278fc3(0x226)]&&this['_addedHook'](),this[_0x278fc3(0x433)]['flyTo']&&this['flyToByAnimationEnd']({'duration':0x0}),this[_0x278fc3(_0x1a2a35._0x523d57)]=State['ADDED'],this['fire'](EventType['add']),this[_0x278fc3(0xefc)](EventType[_0x278fc3(_0x1a2a35._0x36e4b1)],{},!![]);}['_onRemove'](){const _0x3a8801={_0x32872a:0xf35,_0x12acb0:0x4b7},_0x2e1387=_0x3d5d32;var _0x307f27,_0x9d51be;if(this[_0x2e1387(_0x3a8801._0x32872a)]!==State['ADDED'])return;if(!this['_map'])return;this['_removedHook']&&this[_0x2e1387(0x566)](),this['_state']=State['REMOVED'],this['fire'](EventType['remove']),this['fire'](EventType['removeLayer'],{},!![]);if((_0x307f27=this['options'])!==null&&_0x307f27!==void 0x0&&_0x307f27['eventParent'])this['removeEventParent'](this['options']['eventParent']);else{if(((_0x9d51be=this[_0x2e1387(0x433)])===null||_0x9d51be===void 0x0?void 0x0:_0x9d51be[_0x2e1387(_0x3a8801._0x12acb0)])===![]);else this['removeEventParent'](this['_map']);}this['_map']=null;}['_mountedHook'](){}['_addedHook'](){}[_0x3d5d32(0x566)](){}['fire'](_0x1a4974,_0x1d90e4={},_0x153742){const _0x21092e=_0x3d5d32;return!_0x1d90e4['layer']&&(_0x1d90e4[_0x21092e(0x548)]=this),super['fire'](_0x1a4974,_0x1d90e4,_0x153742);}['flyToByAnimationEnd'](_0x4e72be){const _0x3b65e0={_0x2f52d3:0x792},_0x433f4e=_0x3d5d32;if(!this['_map']||!this[_0x433f4e(_0x3b65e0._0x2f52d3)])return this;return this['_map']['isFlyAnimation']()?this['_map']['openFlyAnimationEndFun']=()=>{this['flyTo'](_0x4e72be);}:this['flyTo'](_0x4e72be),this;}['flyTo'](_0x4a21f1){const _0x2ea4a0={_0x1e1135:0x44d},_0x51283c=_0x3d5d32,_0x431b30=this['_flyTo'](_0x4a21f1);return _0x431b30?_0x431b30:this['readyPromise'][_0x51283c(_0x2ea4a0._0x1e1135)](_0x162e2d=>{return this['_flyTo'](_0x4a21f1);});}['_flyTo'](_0x5df037={}){const _0x35517e={_0x3b20e4:0xac9,_0x18ce1d:0x1d1,_0x45ddcf:0x433,_0x523188:0x66e},_0x4bfdf1=_0x3d5d32;if(!this['_map'])return Promise[_0x4bfdf1(_0x35517e._0x3b20e4)](![]);this[_0x4bfdf1(0x433)]['flyToOptions']&&(_0x5df037={...this['options']['flyToOptions'],..._0x5df037});this[_0x4bfdf1(_0x35517e._0x18ce1d)]['cancelFlyTo']();if(this['options']['center'])return this['_map'][_0x4bfdf1(0xc53)](this[_0x4bfdf1(_0x35517e._0x45ddcf)][_0x4bfdf1(0xe72)],_0x5df037);const _0x3521bc=this['options'][_0x4bfdf1(0x86b)]||this['_extent']||this['getRectangle']&&this['getRectangle']();if(_0x3521bc)return this['_map'][_0x4bfdf1(_0x35517e._0x523188)](_0x3521bc,_0x5df037);}['setOptions'](_0x9b9399){const _0x58a703={_0x321aeb:0xabc,_0x26a881:0xb84,_0x4d78fa:0x874,_0x191294:0xd4c},_0x51b611=_0x3d5d32;if(!_0x9b9399||Object[_0x51b611(_0x58a703._0x321aeb)](_0x9b9399)['length']===0x0)return this;return this[_0x51b611(0x433)]=merge(this['options'],_0x9b9399),Cesium__namespace[_0x51b611(_0x58a703._0x26a881)](_0x9b9399['opacity'])&&(this['opacity']=_0x9b9399['opacity']),Cesium__namespace['defined'](_0x9b9399[_0x51b611(0xaed)])&&(this['name']=_0x9b9399['name']),Cesium__namespace[_0x51b611(_0x58a703._0x26a881)](_0x9b9399['show'])&&(this['show']=_0x9b9399['show']),this[_0x51b611(_0x58a703._0x4d78fa)](),this['_setOptionsHook']&&this[_0x51b611(_0x58a703._0x191294)](this['options'],_0x9b9399),this;}['toJSON'](){const _0x3ba80d=clone(this['options'],['parent','eventParent']);return _0x3ba80d['id']=this['id'],_0x3ba80d['type']=this['type'],_0x3ba80d['show']=this['show'],this['_toJsonEx'](_0x3ba80d),_0x3ba80d;}[_0x3d5d32(0xc92)](_0x5260ee){}['_bindControl'](){const _0x591916={_0x199b5f:0xb84,_0x337f27:0x4b4,_0x3f2c67:0x4b4,_0x448fde:0xaed,_0x1fd1e3:0x433,_0x29f793:0xf26,_0x3289c3:0xc12},_0x2c12c9=_0x3d5d32;Cesium__namespace[_0x2c12c9(_0x591916._0x199b5f)](this['options'][_0x2c12c9(_0x591916._0x337f27)])&&(this['options']['contextmenuItems']?this[_0x2c12c9(0xab5)]={'content':this['options'][_0x2c12c9(_0x591916._0x3f2c67)],'options':this['options']['contextmenuOptions'],'layer':this}:this[_0x2c12c9(0xab5)]=null);if(Cesium__namespace['defined'](this['options']['popup'])){if(this[_0x2c12c9(0x433)]['popup']){const _0x938d80=this['options']['popupOptions']||{};this['_popupConfig']={'options':_0x938d80,'content':bindLayerPopup(_0x938d80,this['options']['popup'],this[_0x2c12c9(_0x591916._0x448fde)]),'layer':this};}else this['_popupConfig']=null;}if(Cesium__namespace['defined'](this['options']['tooltip'])){if(this[_0x2c12c9(_0x591916._0x1fd1e3)][_0x2c12c9(_0x591916._0x29f793)]){const _0x90aa54=this['options']['tooltipOptions']||{};this[_0x2c12c9(_0x591916._0x3289c3)]={'options':_0x90aa54,'content':bindLayerPopup(_0x90aa54,this[_0x2c12c9(0x433)][_0x2c12c9(0xf26)],this[_0x2c12c9(0xaed)]),'layer':this};}else this['_tooltipConfig']=null;}}['_filterPropagateEvent'](_0x280c3a,_0x7faefb){const _0x91a5a2={_0x34c02a:0xffe},_0x4742b8=_0x3d5d32;if(_0x7faefb['type']===_0x4742b8(_0x91a5a2._0x34c02a))return![];return!![];}[_0x3d5d32(0x689)](_0x281274){if(this['_state']===State['DESTROY'])return;this['_state']!==State['REMOVED']&&(this['clear']&&this['clear'](),this['remove']()),super['destroy'](_0x281274),this['_state']=State['DESTROY'];}}function bindLayerPopup(_0x5500c6,_0x5b5c56,_0x28be27){const _0x1286b8={_0x550d16:0xdba},_0x4c0667={_0x831aa0:0x2ce,_0x53e00c:0xdba};return typeof _0x5b5c56==='function'?function(_0x70e812){return _0x5b5c56(_0x70e812);}:function(_0xc80d4){const _0x3c8b5a=_0x4132;let _0x3ef6d1=_getAttrForPopup(_0xc80d4);if(_0x3ef6d1 instanceof Promise)return _0x3ef6d1['then'](_0x166705=>{const _0x57554e=_0x4132;_0x3ef6d1={'layer_name':_0x28be27,..._0x166705};let _0x5061eb=_0x28be27;if(_0x5500c6[_0x57554e(_0x4c0667._0x831aa0)])_0x5061eb=null;else{if(_0x5500c6['title'])_0x5061eb=_0x5500c6['title'];else _0x5500c6['titleField']&&(_0x5061eb=_0x3ef6d1[_0x5500c6[_0x57554e(_0x4c0667._0x53e00c)]]);}return getTemplateHtml({'title':_0x5061eb,'template':_0x5b5c56,'attr':_0x3ef6d1});});else{_0x3ef6d1={'layer_name':_0x28be27,..._0x3ef6d1};let _0x49cf52=_0x28be27;if(_0x5500c6['noTitle'])_0x49cf52=null;else{if(_0x5500c6[_0x3c8b5a(0xd50)])_0x49cf52=_0x5500c6['title'];else _0x5500c6['titleField']&&(_0x49cf52=_0x3ef6d1[_0x5500c6[_0x3c8b5a(_0x1286b8._0x550d16)]]);}return getTemplateHtml({'title':_0x49cf52,'template':_0x5b5c56,'attr':_0x3ef6d1});}};}function _getAttrForPopup(_0x52d58c){const _0x49cc91={_0x4aea0a:0xfe4,_0x3c364d:0x553,_0x5146fa:0xe12},_0x189a24=_0x3d5d32;var _0x32028c;if(_0x52d58c!==null&&_0x52d58c!==void 0x0&&_0x52d58c['attr'])return _0x52d58c['attr'];if(_0x52d58c!==null&&_0x52d58c!==void 0x0&&(_0x32028c=_0x52d58c['graphic'])!==null&&_0x32028c!==void 0x0&&_0x32028c['attr'])return _0x52d58c[_0x189a24(0x328)][_0x189a24(0xe12)];if(!_0x52d58c['czmObject'])return{};let _0x4b6155=_0x52d58c['czmObject'][_0x189a24(_0x49cc91._0x4aea0a)]||_0x52d58c['czmObject']['properties']||_0x52d58c['czmObject'][_0x189a24(_0x49cc91._0x3c364d)];return _0x4b6155&&_0x4b6155['type']&&_0x4b6155[_0x189a24(_0x49cc91._0x5146fa)]&&(_0x4b6155=_0x4b6155['attr']),_0x4b6155??{};}class BaseGraphicLayer extends BaseLayer{constructor(_0x3fa74f={}){const _0x363bba={_0x261ac7:0x3c6},_0x936e46=_0x3d5d32;_0x3fa74f['url']&&_0x3fa74f[_0x936e46(_0x363bba._0x261ac7)]&&(_0x3fa74f['url']=template(_0x3fa74f['url'],_0x3fa74f['templateValues'])),super(_0x3fa74f);}['_showHook'](_0x4f5e63){const _0xd77ff2={_0x34367c:0x908},_0x102776=_0x3d5d32;!_0x4f5e63&&this[_0x102776(_0xd77ff2._0x34367c)]();}['_addedHook'](){const _0x21f608={_0x958477:0x433,_0x1a49f6:0xb3c},_0x18c505=_0x3d5d32;var _0x4427b3,_0x3ade7a;if(this[_0x18c505(0x433)][_0x18c505(0x56e)])this['bindHighlight'](this['options']['highlight']);else(_0x4427b3=this[_0x18c505(_0x21f608._0x958477)]['symbol'])!==null&&_0x4427b3!==void 0x0&&(_0x3ade7a=_0x4427b3[_0x18c505(_0x21f608._0x1a49f6)])!==null&&_0x3ade7a!==void 0x0&&_0x3ade7a['highlight']&&this['bindHighlight'](this['options']['symbol']['styleOptions']['highlight']);}['_removedHook'](){this['_closeAllControl'](),this['unbindHighlight']();}[_0x3d5d32(0xd4c)](_0x281226,_0x2b4243){const _0xa6c5fa={_0x62ddc3:0x56e},_0x3dcbf6=_0x3d5d32;var _0x3382f5,_0xeb1f4f;this['_highlightOptions']&&this['unbindHighlight']();if(_0x2b4243['highlight'])this['bindHighlight'](_0x281226['highlight']);else(_0x3382f5=_0x2b4243['symbol'])!==null&&_0x3382f5!==void 0x0&&(_0xeb1f4f=_0x3382f5['styleOptions'])!==null&&_0xeb1f4f!==void 0x0&&_0xeb1f4f['highlight']&&this['bindHighlight'](_0x281226[_0x3dcbf6(0x63d)]['styleOptions'][_0x3dcbf6(_0xa6c5fa._0x62ddc3)]);}[_0x3d5d32(0x908)](){const _0x26e2f5=_0x3d5d32;this['closePopup'](),this['closeTooltip'](),this[_0x26e2f5(0xc62)](),this['closeContextMenu']();}['bindHighlight'](_0x110e9a){const _0x17e298={_0xf5d5f2:0xbbb},_0x408e02=_0x3d5d32;this['unbindHighlight'](),this['_highlightOptions']=_0x110e9a,this['_highlightOptions']['type']===EventType['click']?this['on'](EventType['click'],this['_highlight_mouseEventHandler'],this):(this['on'](EventType['mouseOver'],this['_highlight_mouseEventHandler'],this),this['on'](EventType[_0x408e02(_0x17e298._0xf5d5f2)],this['_highlight_mouseOutHandler'],this));}['unbindHighlight'](){const _0x3001ce={_0x3e57f4:0xd5d,_0xcd64c5:0xd9d,_0x284bc7:0xbbb,_0x2e7a47:0xd5d},_0x114ace=_0x3d5d32;this[_0x114ace(_0x3001ce._0x3e57f4)]&&(this['off'](EventType['click'],this[_0x114ace(_0x3001ce._0xcd64c5)],this),this[_0x114ace(0x9e7)](EventType[_0x114ace(0xef1)],this['_highlight_mouseEventHandler'],this),this['off'](EventType[_0x114ace(_0x3001ce._0x284bc7)],this['_highlight_mouseOutHandler'],this),this[_0x114ace(0x1d1)]['closeHighlight'](),this[_0x114ace(_0x3001ce._0x2e7a47)]=null);}['_highlight_mouseEventHandler'](_0x53b9f6){const _0x3a5e8f={_0x34330d:0x70e,_0x30b3eb:0x1d1},_0x48db83=_0x3d5d32;if(!this[_0x48db83(0x1d1)])return;const _0x37a9d2=_0x53b9f6===null||_0x53b9f6===void 0x0?void 0x0:_0x53b9f6[_0x48db83(0x328)];_0x37a9d2?this['_map'][_0x48db83(_0x3a5e8f._0x34330d)](_0x37a9d2,this['_highlightOptions'],_0x53b9f6):this[_0x48db83(_0x3a5e8f._0x30b3eb)]['closeHighlight']();}[_0x3d5d32(0x7f9)](_0x3819ff){const _0x3399d5=_0x3d5d32;this['_map'][_0x3399d5(0x759)]();}[_0x3d5d32(0x70e)](_0x2211df,_0x1bc0e5){const _0x5da22d=_0x3d5d32;if(!this['_map']||!_0x2211df)return;this[_0x5da22d(0x1d1)]['openHighlight'](_0x2211df,this[_0x5da22d(0xd5d)],_0x1bc0e5);}['closeHighlight'](){this['_map']['closeHighlight']();}['hasPopup'](){const _0x2888e9=_0x3d5d32;if(this['_popupConfig'])return!![];if(this['_graphicList']){const _0x53fdf8=this[_0x2888e9(0xa10)]['values'];for(let _0x5343ef=0x0,_0x3077ad=_0x53fdf8['length'];_0x5343ef<_0x3077ad;_0x5343ef++){const _0x57d365=_0x53fdf8[_0x5343ef];if(_0x57d365['_popupConfig'])return!![];}}return![];}['bindPopup'](_0x18110a,_0x1acfaf){const _0x393390={_0x978928:0xf80,_0x4c6567:0x433},_0x5caece=_0x3d5d32;return this[_0x5caece(_0x393390._0x978928)]={'content':_0x18110a,'options':_0x1acfaf||this[_0x5caece(_0x393390._0x4c6567)][_0x5caece(0x2c6)],'layer':this},this;}['unbindPopup'](_0x394c1f){return this['closePopup'](),_0x394c1f?this['_popupConfig']=![]:this['_popupConfig']=null,this;}[_0x3d5d32(0x3b4)](_0x36af44){const _0x532412={_0x55ea1e:0x3b4,_0x4d2db3:0xf80},_0x41ec75=_0x3d5d32;if(_0x36af44['openPopup'])_0x36af44[_0x41ec75(_0x532412._0x55ea1e)]();else this['_popupConfig']&&_0x36af44&&this['_map']&&(this['_popupConfig']['graphic']=null,this['_map']['popup']['open'](_0x36af44,this[_0x41ec75(_0x532412._0x4d2db3)]));return this;}['closePopup'](){const _0x11d527={_0x5b2f87:0xed2},_0x4d73bf=_0x3d5d32;return this['_map']&&this[_0x4d73bf(_0x11d527._0x5b2f87)]()&&this[_0x4d73bf(0x1d1)]['popup'][_0x4d73bf(0x447)](null,this),this;}['hasTooltip'](){if(this['_tooltipConfig'])return!![];if(this['_graphicList']){const _0x304d99=this['_graphicList']['values'];for(let _0x5bc538=0x0,_0x2eb25e=_0x304d99['length'];_0x5bc538<_0x2eb25e;_0x5bc538++){const _0x48fafc=_0x304d99[_0x5bc538];if(_0x48fafc['_tooltipConfig'])return!![];}}return![];}['bindTooltip'](_0xdcf0a8,_0x21d240){const _0x3b7850=_0x3d5d32;return this['_tooltipConfig']={'content':_0xdcf0a8,'options':_0x21d240||this['options'][_0x3b7850(0x388)],'layer':this},this;}[_0x3d5d32(0x47b)](_0x550481){return _0x550481?this['_tooltipConfig']=![]:this['_tooltipConfig']=null,this['closeTooltip'](),this;}['openTooltip'](_0x4c4f31){const _0x1e78ad=_0x3d5d32;if(_0x4c4f31[_0x1e78ad(0x743)])_0x4c4f31['openTooltip']();else this['_tooltipConfig']&&_0x4c4f31&&this[_0x1e78ad(0x1d1)]&&(this['_tooltipConfig']['graphic']=null,this[_0x1e78ad(0x1d1)]['tooltip']['open'](_0x4c4f31,this['_tooltipConfig']));return this;}['closeTooltip'](){const _0x3bdc48={_0x14a023:0x447},_0x16b768=_0x3d5d32;return this['_map']&&this['hasTooltip']()&&this['_map']['tooltip'][_0x16b768(_0x3bdc48._0x14a023)](null,this),this;}[_0x3d5d32(0xad4)](){const _0x5207a5={_0x213544:0xa10},_0x28f204=_0x3d5d32;if(this['_contextmenuConfig'])return!![];if(this[_0x28f204(_0x5207a5._0x213544)]){const _0x2fa7e0=this['_graphicList'][_0x28f204(0xa07)];for(let _0x19d511=0x0,_0x157399=_0x2fa7e0['length'];_0x19d511<_0x157399;_0x19d511++){const _0x36e470=_0x2fa7e0[_0x19d511];if(_0x36e470['_contextmenuConfig'])return!![];}}return![];}[_0x3d5d32(0x7eb)](){return this['_contextmenuConfig'];}[_0x3d5d32(0xea4)](_0x1e6fe6,_0x339ca3){return this['_contextmenuConfig']={'content':_0x1e6fe6,'options':_0x339ca3||this['options']['contextmenuOptions'],'layer':this},this;}[_0x3d5d32(0x40e)](_0x4c98bf){return _0x4c98bf?this['_contextmenuConfig']=![]:this['_contextmenuConfig']=null,this['closeContextMenu'](),this;}['openContextMenu'](_0x5d1702){const _0x4194b3=_0x3d5d32;if(_0x5d1702['openContextMenu'])_0x5d1702[_0x4194b3(0x22f)]();else this[_0x4194b3(0xab5)]&&_0x5d1702&&this['_map']&&(this['_contextmenuConfig']['graphic']=null,this['_map']['contextmenu']['open'](_0x5d1702,this['_contextmenuConfig']));return this;}['closeContextMenu'](){const _0x4e1867=_0x3d5d32;return this['_map']&&this['hasContextMenu']()&&this['_map'][_0x4e1867(0x45c)][_0x4e1867(0x447)](null,this),this;}[_0x3d5d32(0xd86)](_0x54d433,_0x384f84){return this['_map']&&this['_map']['openSmallTooltip'](_0x54d433,_0x384f84),this;}['closeSmallTooltip'](){const _0x523a41={_0x445353:0xc62},_0x70b2ed=_0x3d5d32;return this['_map']&&this['_map'][_0x70b2ed(_0x523a41._0x445353)](),this;}}class GraphicLayer extends BaseGraphicLayer{constructor(_0x553ba3={}){const _0x5575ab={_0xbc22ef:0xd4c},_0x25802b=_0x3d5d32;super(_0x553ba3),this[_0x25802b(_0x5575ab._0xbc22ef)](_0x553ba3,_0x553ba3),this['_graphicList']=new MarsArray();}['_setOptionsHook'](_0x5cdac2,_0x2ac68a){const _0x26ee0d=_0x3d5d32;super['_setOptionsHook'](_0x5cdac2,_0x2ac68a),this['hasEdit']=_0x5cdac2['hasEdit']??![],this['isAutoEditing']=_0x5cdac2[_0x26ee0d(0x491)]??!![],this['isContinued']=_0x5cdac2[_0x26ee0d(0x416)]??![];}get['layer'](){const _0x21cf53={_0x5735ea:0x6ee,_0x363e88:0xd1a,_0x3f1e1e:0x8e3,_0x40ed17:0x42c,_0x802133:0x9db},_0x5028a1=_0x3d5d32,_0x4bc68b=[];return this['_dataSource']&&_0x4bc68b['push'](this[_0x5028a1(0xeab)]),this['_primitiveCollection']&&_0x4bc68b['push'](this['_primitiveCollection']),this[_0x5028a1(_0x21cf53._0x5735ea)]&&_0x4bc68b['push'](this[_0x5028a1(_0x21cf53._0x5735ea)]),this[_0x5028a1(_0x21cf53._0x363e88)]&&_0x4bc68b['push'](this['_billboardCollection']),this[_0x5028a1(_0x21cf53._0x3f1e1e)]&&_0x4bc68b['push'](this['_cloudCollection']),this[_0x5028a1(0x42c)]&&_0x4bc68b['push'](this[_0x5028a1(_0x21cf53._0x40ed17)]),this['_polylineCollection']&&_0x4bc68b['push'](this[_0x5028a1(_0x21cf53._0x802133)]),_0x4bc68b;}get['clustering'](){const _0x135f68={_0x6e042f:0x426,_0x5dd65f:0xa63},_0xb1189f=_0x3d5d32;var _0x1ebdfc,_0x288a2f;return(_0x1ebdfc=this[_0xb1189f(_0x135f68._0x6e042f)])===null||_0x1ebdfc===void 0x0?void 0x0:(_0x288a2f=_0x1ebdfc[_0xb1189f(0xfea)])===null||_0x288a2f===void 0x0?void 0x0:_0x288a2f[_0xb1189f(_0x135f68._0x5dd65f)];}set[_0x3d5d32(0xfea)](_0x5cdfac){const _0x3cce9b={_0x32222e:0x426},_0x3852b0=_0x3d5d32;var _0x4c8456;(_0x4c8456=this['dataSource'])!==null&&_0x4c8456!==void 0x0&&_0x4c8456['clustering']&&(this[_0x3852b0(_0x3cce9b._0x32222e)]['clustering']['enabled']=_0x5cdfac);}get[_0x3d5d32(0x426)](){const _0x5947e1={_0x13a0a6:0xeab,_0x393d4a:0x792,_0x5b19f6:0x1d1,_0x51737f:0x926},_0x3338f0=_0x3d5d32;return!this['_dataSource']&&(this['_dataSource']=new Cesium__namespace['CustomDataSource'](this['id']),this[_0x3338f0(_0x5947e1._0x13a0a6)]['show']=this[_0x3338f0(_0x5947e1._0x393d4a)],this[_0x3338f0(_0x5947e1._0x5b19f6)]&&(this['_map'][_0x3338f0(_0x5947e1._0x51737f)]['add'](this['_dataSource']),Cesium__namespace[_0x3338f0(0xb84)](this['options']['zIndex'])&&(this['zIndex']=this['options'][_0x3338f0(0x377)]))),this['_dataSource'];}get[_0x3d5d32(0x5f4)](){const _0xe01fc2={_0x234a11:0x433,_0x5db897:0xfc1,_0x36790d:0xb84},_0x3310c6=_0x3d5d32;return!this['_primitiveCollection']&&(this[_0x3310c6(0x4d5)]=new Cesium__namespace[(_0x3310c6(0x833))](this[_0x3310c6(_0xe01fc2._0x234a11)]),this['_primitiveCollection']['show']=this[_0x3310c6(0x792)],this['_map']&&(this['_map'][_0x3310c6(_0xe01fc2._0x5db897)]['primitives']['add'](this[_0x3310c6(0x4d5)]),Cesium__namespace[_0x3310c6(_0xe01fc2._0x36790d)](this['options']['zIndex'])&&(this['zIndex']=this['options']['zIndex']))),this['_primitiveCollection'];}get['labelCollection'](){const _0x557ad8={_0xea120b:0xfc1,_0x5680af:0x6ee,_0x181f75:0x730},_0x45fbe4=_0x3d5d32;return!this['_labelCollection']&&(this['_labelCollection']=new Cesium__namespace['LabelCollection']({...this['options'],'scene':this['_map'][_0x45fbe4(_0x557ad8._0xea120b)]}),this[_0x45fbe4(_0x557ad8._0x5680af)]['show']=this['show'],this['_map']&&this[_0x45fbe4(0x1d1)]['scene'][_0x45fbe4(_0x557ad8._0x181f75)][_0x45fbe4(0xff3)](this['_labelCollection'])),this['_labelCollection'];}get[_0x3d5d32(0xc3e)](){const _0x5edf0d={_0x5a7367:0x792,_0x20ebac:0x42c},_0x55ed8d=_0x3d5d32;return!this[_0x55ed8d(0x42c)]&&(this['_pointCollection']=new Cesium__namespace[(_0x55ed8d(0x209))](this['options']),this['_pointCollection']['show']=this[_0x55ed8d(_0x5edf0d._0x5a7367)],this['_map']&&this[_0x55ed8d(0x1d1)]['scene']['primitives'][_0x55ed8d(0xff3)](this['_pointCollection'])),this[_0x55ed8d(_0x5edf0d._0x20ebac)];}get['billboardCollection'](){const _0x30df71={_0x201072:0x433,_0x23cad8:0x792,_0x340a2b:0xfc1},_0x18cccc=_0x3d5d32;return!this['_billboardCollection']&&(this['_billboardCollection']=new Cesium__namespace['BillboardCollection']({...this[_0x18cccc(_0x30df71._0x201072)],'scene':this['_map'][_0x18cccc(0xfc1)]}),this[_0x18cccc(0xd1a)][_0x18cccc(0x792)]=this[_0x18cccc(_0x30df71._0x23cad8)],this['_map']&&this['_map'][_0x18cccc(_0x30df71._0x340a2b)]['primitives'][_0x18cccc(0xff3)](this[_0x18cccc(0xd1a)])),this['_billboardCollection'];}get['cloudCollection'](){const _0x2e6638={_0x327037:0x1d1,_0x3c1688:0x730},_0x77f72=_0x3d5d32;return!this['_cloudCollection']&&(this['_cloudCollection']=new Cesium__namespace[(_0x77f72(0x1ef))](this['options']['cloud']),this['_cloudCollection']['show']=this['show'],this[_0x77f72(_0x2e6638._0x327037)]&&this['_map'][_0x77f72(0xfc1)][_0x77f72(_0x2e6638._0x3c1688)]['add'](this['_cloudCollection'])),this['_cloudCollection'];}get[_0x3d5d32(0xfb8)](){const _0x18db68={_0x3f8ec2:0x9db},_0x51249c=_0x3d5d32;return!this['_polylineCollection']&&(this['_polylineCollection']=new Cesium__namespace['PolylineCollection'](this['options']),this[_0x51249c(0x9db)]['show']=this[_0x51249c(0x792)],this['_map']&&this['_map']['scene']['primitives'][_0x51249c(0xff3)](this['_polylineCollection'])),this[_0x51249c(_0x18db68._0x3f8ec2)];}get['container'](){const _0x26c56e={_0x3b5f43:0xde7,_0x35b32c:0xdde,_0x1a52a9:0xdde},_0xa332e0=_0x3d5d32;return!this[_0xa332e0(0x51f)]&&(this[_0xa332e0(0x51f)]=create$3('div',_0xa332e0(_0x26c56e._0x3b5f43)),this[_0xa332e0(0x792)]?this[_0xa332e0(0x51f)][_0xa332e0(_0x26c56e._0x35b32c)]['display']='block':this['_container'][_0xa332e0(_0x26c56e._0x1a52a9)]['display']='none',this['_map']&&this['_map']['container']['appendChild'](this['_container'])),this['_container'];}get[_0x3d5d32(0x4fb)](){return this['_pointerEvents'];}set['pointerEvents'](_0x46a136){const _0x5cf392={_0xd42076:0x6c2,_0x4c27b6:0xe77},_0x5e7b51=_0x3d5d32;this['_pointerEvents']=_0x46a136,_0x46a136?this[_0x5e7b51(_0x5cf392._0xd42076)]['style']['pointer-events']=_0x5e7b51(_0x5cf392._0x4c27b6):this['container']['style']['pointer-events']='none';}get[_0x3d5d32(0xc77)](){const _0x579b69={_0xf0b818:0xe74},_0x2a7a21={_0x2bcb99:0xc84,_0x16b96b:0xd2e},_0x883f0c=_0x3d5d32;if(this['_objectsToExclude'])return this['_objectsToExclude'];return!this['_objectsToExclude_auto']&&(this[_0x883f0c(_0x579b69._0xf0b818)]=[],this[_0x883f0c(0xa10)]['forEach'](_0x17b248=>{const _0x4893e6={_0x5179d8:0xe74},_0x5c9a04=_0x883f0c,_0x3fcc50=_0x17b248['objectsToExclude'];if(_0x3fcc50&&_0x3fcc50[_0x5c9a04(_0x2a7a21._0x2bcb99)]>0x0)_0x3fcc50['forEach'](_0x2ae9b0=>{const _0x3e71d7=_0x5c9a04;this['_objectsToExclude_auto']['indexOf'](_0x2ae9b0)===-0x1&&this[_0x3e71d7(_0x4893e6._0x5179d8)][_0x3e71d7(0xb75)](_0x2ae9b0);});else{if(_0x17b248[_0x5c9a04(_0x2a7a21._0x16b96b)]){const _0x460f87=_0x17b248['czmObject'];this[_0x5c9a04(0xe74)]['indexOf'](_0x460f87)===-0x1&&this['_objectsToExclude_auto']['push'](_0x460f87);}}},this)),this['_objectsToExclude_auto'];}set['objectsToExclude'](_0xfead7a){this['_objectsToExclude']=_0xfead7a;}get[_0x3d5d32(0x478)](){return!![];}get[_0x3d5d32(0x377)](){const _0x427ffe=_0x3d5d32;return this[_0x427ffe(0x433)]['zIndex'];}set['zIndex'](_0x4b08b8){this['options']['zIndex']=_0x4b08b8;if(_0x4b08b8==null)return;setTimeout(()=>{this['_setZIndex'](_0x4b08b8);},0x64);}['_setZIndex'](_0x1e1a91){const _0x4aa58b={_0x2a23d0:0xfc1,_0x3eea5d:0x730,_0x4785a7:0xc84,_0x1df727:0xeab,_0x26060e:0x377},_0x5a10dd=_0x3d5d32;if(!this['isAdded'])return;if(this['_primitiveCollection']){this['_primitiveCollection']['zIndex']=_0x1e1a91,this['_map']['scene']['primitives']['raiseToTop'](this['_primitiveCollection']);const _0x189e6=this[_0x5a10dd(0x1d1)][_0x5a10dd(_0x4aa58b._0x2a23d0)][_0x5a10dd(_0x4aa58b._0x3eea5d)];for(let _0x1934de=_0x189e6[_0x5a10dd(_0x4aa58b._0x4785a7)]-0x1;_0x1934de>=0x0;_0x1934de--){const _0x1abab1=_0x189e6['get'](_0x1934de);if(_0x1abab1===this['_primitiveCollection'])continue;Cesium__namespace['defined'](_0x1abab1['zIndex'])&&_0x1e1a91<_0x1abab1[_0x5a10dd(0x377)]&&this['_map']['scene']['primitives'][_0x5a10dd(0xdbc)](this['_primitiveCollection']);}}if(this['_dataSource']){this[_0x5a10dd(_0x4aa58b._0x1df727)]['zIndex']=_0x1e1a91,this['_map']['dataSources']['raiseToTop'](this['_dataSource']);const _0x15c036=this['_map']['dataSources'];for(let _0x32db76=_0x15c036[_0x5a10dd(_0x4aa58b._0x4785a7)]-0x1;_0x32db76>=0x0;_0x32db76--){const _0x2522ae=_0x15c036['get'](_0x32db76);if(_0x2522ae===this['_dataSource'])continue;Cesium__namespace['defined'](_0x2522ae[_0x5a10dd(_0x4aa58b._0x26060e)])&&_0x1e1a91<_0x2522ae['zIndex']&&this['_map']['dataSources'][_0x5a10dd(0xdbc)](this[_0x5a10dd(0xeab)]);}}}['toTop'](){const _0x3dc8f8={_0x11fe30:0x4d5,_0x37393d:0xfc1},_0x5f8088=_0x3d5d32;if(this['_map']){if(this[_0x5f8088(_0x3dc8f8._0x11fe30)])return this['_map'][_0x5f8088(_0x3dc8f8._0x37393d)]['primitives'][_0x5f8088(0xb07)](this[_0x5f8088(0x4d5)]);if(this['_dataSource'])return this['_map']['dataSources']['raiseToTop'](this['_dataSource']);}}[_0x3d5d32(0x927)](){const _0x39edca={_0xcf0c8:0x4d5,_0x423a80:0x926},_0x2d8b92=_0x3d5d32;if(this['_map']){if(this[_0x2d8b92(_0x39edca._0xcf0c8)])return this['_map']['scene']['primitives']['lowerToBottom'](this['_primitiveCollection']);if(this['_dataSource'])return this[_0x2d8b92(0x1d1)][_0x2d8b92(_0x39edca._0x423a80)][_0x2d8b92(0x1e9)](this['_dataSource']);}}get['length'](){return this['_graphicList']['length'];}get[_0x3d5d32(0xf9d)](){const _0xdf5e35=_0x3d5d32;return this[_0xdf5e35(0x3f3)]();}get[_0x3d5d32(0x8eb)](){const _0xa2bc6d={_0x3c5dca:0xc46},_0x5c8461=_0x3d5d32;return this[_0x5c8461(_0xa2bc6d._0x3c5dca)];}set['hasEdit'](_0x131d4e){const _0x4b8f53=_0x3d5d32;_0x131d4e?this[_0x4b8f53(0x614)]():this[_0x4b8f53(0xfdf)]();}get['isDrawing'](){const _0x2a4d38={_0x8b6046:0x1082},_0x350fc7=_0x3d5d32;return this[_0x350fc7(_0x2a4d38._0x8b6046)]!=null;}get['isEditing'](){return this['_graphic_editing']!=null;}get['allowDrillPick'](){return this['options']['allowDrillPick'];}set['allowDrillPick'](_0x151911){this['options']['allowDrillPick']=_0x151911;}['_onAdd'](_0x49fd97){const _0x36570b={_0x3b73af:0xeab,_0x354bba:0x4d5,_0x5b9bd0:0x1d1,_0x134326:0xff3,_0x4d0af9:0x6ee,_0x578f42:0x1d1,_0x2e248d:0x6ee,_0x5ed34a:0xff3,_0x514603:0x730,_0x1a12db:0x8e3,_0x4eddb8:0xfc1,_0x24876e:0x42c,_0x560cdc:0x51f,_0x452d6c:0x1d1,_0x19443a:0x6c2,_0x306701:0xc17},_0x570d61=_0x3d5d32;var _0x38b62c;if(this[_0x570d61(0x1d1)])return;this['_state']=State['ADD'],this['_map']=_0x49fd97;if(this['options']['eventParent'])this['addEventParent'](this['options']['eventParent']);else{if(((_0x38b62c=this['options'])===null||_0x38b62c===void 0x0?void 0x0:_0x38b62c['eventParent'])===![]);else this[_0x570d61(0x584)](_0x49fd97);}this[_0x570d61(_0x36570b._0x3b73af)]&&this['_map']['dataSources'][_0x570d61(0xff3)](this[_0x570d61(0xeab)]),this[_0x570d61(_0x36570b._0x354bba)]&&this[_0x570d61(_0x36570b._0x5b9bd0)]['scene']['primitives'][_0x570d61(_0x36570b._0x134326)](this['_primitiveCollection']),this[_0x570d61(_0x36570b._0x4d0af9)]&&this[_0x570d61(_0x36570b._0x578f42)]['scene']['primitives'][_0x570d61(0xff3)](this[_0x570d61(_0x36570b._0x2e248d)]),this['_billboardCollection']&&this[_0x570d61(_0x36570b._0x5b9bd0)]['scene']['primitives'][_0x570d61(_0x36570b._0x5ed34a)](this['_billboardCollection']),this['_cloudCollection']&&this['_map']['scene'][_0x570d61(_0x36570b._0x514603)]['add'](this[_0x570d61(_0x36570b._0x1a12db)]),this['_pointCollection']&&this[_0x570d61(0x1d1)][_0x570d61(_0x36570b._0x4eddb8)][_0x570d61(0x730)]['add'](this[_0x570d61(_0x36570b._0x24876e)]),this['_polylineCollection']&&this[_0x570d61(_0x36570b._0x578f42)][_0x570d61(0xfc1)]['primitives']['add'](this['_polylineCollection']),this[_0x570d61(_0x36570b._0x560cdc)]&&this[_0x570d61(_0x36570b._0x452d6c)][_0x570d61(_0x36570b._0x19443a)]['appendChild'](this['_container']),this[_0x570d61(0xe4c)]&&(!this['_createOK']&&(this['_createOK']=!![],this['_mountedHook']())),this['_addedHook']&&this['_addedHook'](),this['_graphicList']['forEach'](_0x2bca7a=>{_0x2bca7a!==null&&_0x2bca7a!==void 0x0&&_0x2bca7a['_onAdd']&&_0x2bca7a['_onAdd'](this);},this),Cesium__namespace['defined'](this['options'][_0x570d61(0x377)])&&(this[_0x570d61(0x377)]=this['options']['zIndex']),this['_state']=State['ADDED'],this['fire'](EventType[_0x570d61(_0x36570b._0x306701)],{'layer':this},!![]);}['_onRemove'](){const _0x20279e={_0xbadffc:0x1d1,_0x109d97:0xf06,_0x3df53f:0xd1a,_0x5c4b24:0xfc1,_0x27b0f6:0x9db,_0x54a8ea:0x1d1,_0x5f22da:0xfc1,_0x1e594f:0xac2,_0xd4c909:0x78c,_0x33ffd5:0x6ee,_0x33b99c:0x1e5},_0x5df90f=_0x3d5d32;var _0x59e54c,_0x324f94;if(this['_state']!==State['ADDED'])return;if(!this[_0x5df90f(_0x20279e._0xbadffc)])return;this['_graphicList'][_0x5df90f(0x1061)](_0x5f254c=>{(_0x5f254c===null||_0x5f254c===void 0x0?void 0x0:_0x5f254c['_onRemove'])&&_0x5f254c['_onRemove']();},this);this['_dataSource']&&this['_map']['dataSources']['remove'](this['_dataSource']);this['_primitiveCollection']&&this['_map']['scene']['primitives'][_0x5df90f(_0x20279e._0x109d97)](this['_primitiveCollection']);this['_labelCollection']&&this['_map']['scene']['primitives']['remove'](this[_0x5df90f(0x6ee)]);this[_0x5df90f(_0x20279e._0x3df53f)]&&this['_map']['scene']['primitives'][_0x5df90f(0xf06)](this['_billboardCollection']);this[_0x5df90f(0x8e3)]&&this['_map']['scene']['primitives']['remove'](this['_cloudCollection']);this['_pointCollection']&&this[_0x5df90f(_0x20279e._0xbadffc)][_0x5df90f(_0x20279e._0x5c4b24)]['primitives'][_0x5df90f(0xf06)](this[_0x5df90f(0x42c)]);this[_0x5df90f(_0x20279e._0x27b0f6)]&&this[_0x5df90f(_0x20279e._0x54a8ea)][_0x5df90f(_0x20279e._0x5f22da)]['primitives']['remove'](this['_polylineCollection']);this['_container']&&this['_container']['parentNode']&&this['_map']['container'][_0x5df90f(_0x20279e._0x1e594f)](this['_container']);this['_map']['scene']['primitives'][_0x5df90f(_0x20279e._0xd4c909)]&&(this['_primitiveCollection']=null,this[_0x5df90f(_0x20279e._0x33ffd5)]=null,this['_billboardCollection']=null,this['_cloudCollection']=null,this[_0x5df90f(0x42c)]=null,this[_0x5df90f(0x9db)]=null);this['_removedHook']&&this['_removedHook'](),this['_state']=State['REMOVED'],this['fire'](EventType['remove']),this['fire'](EventType['removeLayer'],{'layer':this},!![]);if((_0x59e54c=this['options'])!==null&&_0x59e54c!==void 0x0&&_0x59e54c['eventParent'])this[_0x5df90f(_0x20279e._0x33b99c)](this['options'][_0x5df90f(0x4b7)]);else{if(((_0x324f94=this['options'])===null||_0x324f94===void 0x0?void 0x0:_0x324f94['eventParent'])===![]);else this['removeEventParent'](this['_map']);}this[_0x5df90f(0x1d1)]=null;}['_showHook'](_0x300b02){const _0x10b2be={_0x1ae342:0xdde},_0x42fe5b=_0x3d5d32;super[_0x42fe5b(0x68e)](_0x300b02),_0x300b02?this[_0x42fe5b(0x51f)]&&(this['_container'][_0x42fe5b(_0x10b2be._0x1ae342)]['display']='block',this['_graphicList']['forEach'](_0x51519f=>{const _0x1fd6c5=_0x42fe5b;_0x51519f['updateDivPosition']&&_0x51519f[_0x1fd6c5(0x897)]();},this)):(this['_container']&&(this['_container']['style'][_0x42fe5b(0xd92)]='none'),this['stopDraw']());}['_mountedHook'](){const _0x37ee14={_0x5de344:0xffe,_0x586d4d:0xfea,_0x133646:0xe9b,_0x22434b:0x682,_0x287ca3:0xaf2,_0x2ae0d7:0x467},_0xcaeb4c=_0x3d5d32;super[_0xcaeb4c(0xe4c)](),this['on'](EventType['drawCreated'],_0x3af56b=>{this['stopDraw']();if(this['isContinued'])this['startDraw'](clone(_0x3af56b['graphic']['options']));else this['hasEdit']&&this['isAutoEditing']&&this['startEditing'](_0x3af56b['graphic']);},this),this['on'](EventType[_0xcaeb4c(_0x37ee14._0x5de344)],_0x34eef0=>{const _0x1fdcc9=_0xcaeb4c;this['hasEdit']&&this['isAutoEditing']&&this['_graphic_editing']===_0x34eef0[_0x1fdcc9(0x328)]&&this['startEditing'](_0x34eef0['graphic']);},this),this['on'](EventType['removeGraphic'],_0x185463=>{const _0xb738a3=_0xcaeb4c;this[_0xb738a3(0x1082)]===_0x185463['graphic']&&(this['_graphic_drawing']=null),this['_graphic_editing']===_0x185463['graphic']&&(this['_graphic_editing']=null);},this),this['on'](EventType['editStart'],_0x1d1854=>{this['_graphic_editing']=_0x1d1854['graphic'];},this),this['on'](EventType['editStop'],_0x98059d=>{this['_graphic_editing']=null;},this),this['options']['clustering']&&this['_bindClustering'](this['options'][_0xcaeb4c(_0x37ee14._0x586d4d)]),this['type']==='graphic'&&(this['options'][_0xcaeb4c(_0x37ee14._0x133646)]&&this[_0xcaeb4c(_0x37ee14._0x22434b)](this['options']['data']),this[_0xcaeb4c(_0x37ee14._0x287ca3)]['resolve'](this)),this['options'][_0xcaeb4c(_0x37ee14._0x2ae0d7)]&&this['loadGeoJSON'](this['options']['geojson']);}['_addedHook'](){const _0x581409={_0x3b0c52:0x433},_0x36b251=_0x3d5d32;super[_0x36b251(0x226)](),this['_hasEdit']&&this['_bindEditEvent'](),this[_0x36b251(_0x581409._0x3b0c52)]['flyTo']&&this['flyToByAnimationEnd']();}[_0x3d5d32(0x566)](){super['_removedHook'](),this['_hasEdit']&&(this['stopDraw'](),this['_unbindEditEvent']());}[_0x3d5d32(0x7c9)](_0x35626e){const _0x52f8dd={_0x2f9d07:0x1061},_0x6129b7={_0x17d166:0x756},_0x54f8bd=_0x3d5d32;let _0x55d214;return this['_graphicList'][_0x54f8bd(_0x52f8dd._0x2f9d07)](_0x5c0990=>{const _0x40ca28=_0x54f8bd;if(!_0x5c0990[_0x40ca28(0x7c9)])return;const _0x35cb4e=_0x5c0990[_0x40ca28(0x7c9)]();if(!Cesium__namespace[_0x40ca28(0xb84)](_0x35cb4e))return;_0x55d214?_0x55d214=Cesium__namespace[_0x40ca28(_0x6129b7._0x17d166)]['union'](_0x35cb4e,_0x55d214):_0x55d214=_0x35cb4e;},this),_0x35626e?formatRectangle(_0x55d214):_0x55d214;}['getMaxHeight'](){const _0x5ced41={_0x22691e:0xe5a};let _0x5a7297=0x0;return this['_graphicList']['forEach'](_0x52b22c=>{const _0x2c8985=_0x4132;if(!_0x52b22c['getMaxHeight'])return;_0x5a7297=Math['max'](_0x52b22c[_0x2c8985(_0x5ced41._0x22691e)](),_0x5a7297);},this),_0x5a7297;}['toGeoJSON'](_0xe4045f){const _0x34f1c9={_0x2936fe:0xda5,_0x1bedec:0xf5b,_0x4c886a:0xaed},_0x1ee73e={_0x9d960:0x29e,_0x234abf:0xc97},_0x2d23c9=_0x3d5d32;_0xe4045f!==null&&_0xe4045f!==void 0x0&&_0xe4045f[_0x2d23c9(0xbf5)]&&this[_0x2d23c9(_0x34f1c9._0x2936fe)]();let _0x561715=[];return this['_graphicList']['forEach'](_0x572fc6=>{const _0x1371fa=_0x2d23c9;if(_0x572fc6['isPrivate'])return;const _0x1cca2a=_0x572fc6[_0x1371fa(_0x1ee73e._0x9d960)](_0xe4045f);if(!_0x1cca2a)return;Array['isArray'](_0x1cca2a)?_0x561715=_0x561715[_0x1371fa(_0x1ee73e._0x234abf)](_0x1cca2a):_0x561715['push'](_0x1cca2a);},this),{'type':_0x2d23c9(_0x34f1c9._0x1bedec),'layer':{'id':this['id'],'name':this[_0x2d23c9(_0x34f1c9._0x4c886a)]},'features':_0x561715};}['_toJsonEx'](_0x108ce9){const _0x16d539={_0x2d09f0:0xa10},_0x1820c0={_0x3a6a76:0x62b},_0xa19723=_0x3d5d32;this[_0xa19723(0xda5)]();let _0x2b5c8d=[];this[_0xa19723(_0x16d539._0x2d09f0)]['forEach'](_0x167563=>{const _0x404e1a=_0xa19723;if(_0x167563[_0x404e1a(0xe85)]||!_0x167563['state'])return;const _0x4c112c=_0x167563['toJSON']();if(!_0x4c112c)return;Array[_0x404e1a(_0x1820c0._0x3a6a76)](_0x4c112c)?_0x2b5c8d=_0x2b5c8d['concat'](_0x4c112c):_0x2b5c8d['push'](_0x4c112c);},this),_0x108ce9['data']=_0x2b5c8d;}['loadGeoJSON'](_0x2ab64c,_0x5d4dc4={}){const _0x1c41a6={_0x579e2f:0x433},_0x183a8f=_0x3d5d32;var _0x12ac32;try{isString(_0x2ab64c)&&(_0x2ab64c=JSON['parse'](_0x2ab64c));}catch(_0x1ca281){logError$1('loadGeoJSON:请确认json文件格式正确!',_0x1ca281);return;}const _0x5cbaeb=(_0x12ac32=this['_map'])===null||_0x12ac32===void 0x0?void 0x0:_0x12ac32['chinaCRS'],_0x5e70db=this['options']['chinaCRS'],_0x104a13=getTransFun(_0x5e70db,_0x5cbaeb),_0x5401a0=geoJsonToGraphics(_0x2ab64c,{..._0x5d4dc4,'symbol':this[_0x183a8f(_0x1c41a6._0x579e2f)]['symbol'],'crs':this[_0x183a8f(0x433)]['crs'],'onPointTrans':_0x104a13});return this['_addGraphicByArrOptions'](_0x5401a0,_0x5d4dc4);}['_addGraphicByArrOptions'](_0x3d065a,_0x201bdb={}){const _0x40dca4={_0x178553:0x76d,_0x354ffb:0xc4d,_0x22b13f:0x20a,_0x1021e7:0x433,_0x4d0536:0x309},_0x4267ff=_0x3d5d32;_0x201bdb[_0x4267ff(_0x40dca4._0x178553)]&&this[_0x4267ff(_0x40dca4._0x178553)]();let _0x39a1e7=[];if(_0x3d065a['length']===0x0)return _0x39a1e7;let _0x5b6e28;_0x201bdb[_0x4267ff(_0x40dca4._0x354ffb)]===![]&&(this['enabledEvent']=![],_0x5b6e28=!![]);const _0x2cd5cb=_0x3d065a[0x0]['type'],_0x49246b=this['options']['graphicOptions']||{};if(isCombineType(_0x2cd5cb)){const _0x1067db={..._0x49246b,'type':_0x2cd5cb,'instances':_0x3d065a};_0x201bdb[_0x4267ff(_0x40dca4._0x22b13f)]&&_0x201bdb['onEachFeature'](_0x1067db);const _0x224a2f=this['_addGraphic'](_0x1067db,![]);_0x39a1e7['push'](_0x224a2f);}else for(let _0x5b000c=0x0,_0x1bf0a4=_0x3d065a['length'];_0x5b000c<_0x1bf0a4;_0x5b000c++){const _0x1710c4={..._0x49246b,..._0x3d065a[_0x5b000c]};_0x201bdb['onEachFeature']&&_0x201bdb['onEachFeature'](_0x1710c4);if(this['options']['onCreateGraphic']){const _0xa03966=this[_0x4267ff(_0x40dca4._0x1021e7)][_0x4267ff(0x60c)](_0x1710c4);_0xa03966&&(this[_0x4267ff(0x682)](_0xa03966),Array[_0x4267ff(0x62b)](_0xa03966)?_0x39a1e7=_0x39a1e7['concat'](_0xa03966):_0x39a1e7['push'](_0xa03966));}else{const _0x551a1f=this[_0x4267ff(_0x40dca4._0x4d0536)](_0x1710c4,![]);_0x39a1e7['push'](_0x551a1f);}}return _0x5b6e28&&(this['enabledEvent']=!![]),_0x201bdb[_0x4267ff(0xd67)]&&this['show']&&this['_map']['flyToGraphic'](_0x39a1e7),_0x39a1e7;}['_bindClustering'](_0x3d5d41={}){const _0x4e9b8e={_0x12e037:0xfea},_0x3ec14b={_0x42d9bc:0x32a,_0x236f40:0x4a5,_0x19e182:0x4a5,_0x59d792:0x4a5,_0xd12aeb:0xdde,_0x1c2325:0xdd0,_0xf2b6d8:0x44d},_0x239ee7={_0x1a47da:0xc84,_0x387745:0xb75},_0x4a66fe=_0x3d5d32;var _0x4a0cbf;const _0x46b326=(_0x4a0cbf=this['dataSource'])===null||_0x4a0cbf===void 0x0?void 0x0:_0x4a0cbf[_0x4a66fe(_0x4e9b8e._0x12e037)];if(!_0x46b326)return;_0x46b326['enabled']=_0x3d5d41['enabled']??![],_0x46b326['pixelRange']=_0x3d5d41[_0x4a66fe(0x8fb)]??0x14;let _0x433c84=setInterval(function(){const _0x88fa13=_0x4a66fe;_0x46b326['_cluster']&&_0x46b326[_0x88fa13(0xae4)]();},0x320);_0x46b326['clusterEvent'][_0x4a66fe(0x34f)]((_0x393234,_0x571359)=>{const _0x3f4834=_0x4a66fe;_0x433c84&&(clearInterval(_0x433c84),_0x433c84=null);_0x571359[_0x3f4834(_0x3ec14b._0x42d9bc)]['_mars3d_layerId']=this['id'],_0x571359['label']['show']=![],_0x571359['point']['_mars3d_layerId']=this['id'],_0x571359['billboard']['_mars3d_layerId']=this['id'],_0x571359[_0x3f4834(_0x3ec14b._0x236f40)]['show']=!![],_0x571359['billboard']['id']=_0x571359['label']['id'],_0x571359[_0x3f4834(_0x3ec14b._0x236f40)]['verticalOrigin']=Cesium__namespace[_0x3f4834(0xc0f)]['BOTTOM'],_0x571359[_0x3f4834(_0x3ec14b._0x19e182)]['heightReference']=_0x3d5d41['clampToGround']?Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:Cesium__namespace['HeightReference']['NONE'],_0x571359['billboard']['scale']=0.5;_0x3d5d41['style']&&(BillboardStyleConver['toCesiumVal'](_0x3d5d41['style'],_0x571359[_0x3f4834(0x4a5)]),_0x3d5d41['style']['setHeight']&&(_0x571359['billboard'][_0x3f4834(0xb69)]=setPositionsHeight(_0x571359[_0x3f4834(_0x3ec14b._0x19e182)][_0x3f4834(0xb69)],_0x3d5d41['style'][_0x3f4834(0x9e4)])),_0x3d5d41['style']['addHeight']&&(_0x571359[_0x3f4834(_0x3ec14b._0x59d792)]['position']=addPositionsHeight(_0x571359['billboard']['position'],_0x3d5d41[_0x3f4834(_0x3ec14b._0xd12aeb)]['addHeight'])));if(_0x3d5d41[_0x3f4834(_0x3ec14b._0x1c2325)]){const _0x5a81a6=_0x3d5d41['getImage'](_0x393234['length'],_0x3d5d41);_0x5a81a6[_0x3f4834(_0x3ec14b._0xf2b6d8)]?_0x5a81a6['then'](function(_0x206da4){_0x571359['billboard']['image']=_0x206da4;}):_0x571359['billboard']['image']=_0x5a81a6;}else _0x571359[_0x3f4834(0x4a5)]['image']=getCircleImage(_0x393234[_0x3f4834(0xc84)],_0x3d5d41);const _0x86f747=this,_0x2af6c3={'entities':_0x393234,'cluster':_0x571359,'getGraphics':function(){const _0x5f21e7=_0x3f4834,_0x2f2708=[],_0x477b7b=this['entities'];for(let _0x2ced80=0x0,_0x301eb2=_0x477b7b[_0x5f21e7(_0x239ee7._0x1a47da)];_0x2ced80<_0x301eb2;_0x2ced80++){const _0x21b127=_0x477b7b[_0x2ced80],_0x379466=_0x86f747['getGraphicById'](_0x21b127['_mars3d_graphicId']);_0x2f2708[_0x5f21e7(_0x239ee7._0x387745)](_0x379466);}return _0x2f2708;}};_0x571359['billboard']['_clusterData']=_0x2af6c3,this['fire'](_0x3f4834(0xfea),_0x2af6c3);});}['getClusterList'](){const _0x5651f1=_0x3d5d32;var _0x56e23e;const _0x3ea2e7=(_0x56e23e=this['dataSource'])===null||_0x56e23e===void 0x0?void 0x0:_0x56e23e['clustering'];if(!_0x3ea2e7)return;const _0x5ad910=_0x3ea2e7['_clusterBillboardCollection'],_0x14a79b=_0x3ea2e7['_previousClusters'],_0x4a349a=[];for(let _0x783a1a=0x0,_0x5b2d67=_0x5ad910['length'];_0x783a1a<_0x5b2d67;_0x783a1a++){const _0x7f8059=_0x5ad910[_0x5651f1(0x40a)](_0x783a1a);_0x4a349a['push']({..._0x14a79b[_0x783a1a],..._0x7f8059['_clusterData'],'billboard':_0x7f8059});}return _0x4a349a;}['setOpacity'](_0x3e8e77){this['_opacity']=_0x3e8e77,this['_graphicList']['forEach'](_0x45c210=>{_0x45c210['setOpacity']&&_0x45c210['setOpacity'](_0x3e8e77);},this);}[_0x3d5d32(0x682)](_0x4e83cb){const _0x1d3e6d={_0x3e60ac:0xde1},_0x2c1cb5=_0x3d5d32;!this['_createOK']&&this['_mountedHook']&&(this[_0x2c1cb5(_0x1d3e6d._0x3e60ac)]=!![],this['_mountedHook']());if(Array['isArray'](_0x4e83cb)){if(_0x4e83cb[_0x2c1cb5(0xc84)]===0x0)return;const _0x1a51e5=_0x4e83cb[0x0]['type'];if(isCombineType(_0x1a51e5)&&!_0x4e83cb[0x0]['instances']){const _0x574e92={'type':_0x1a51e5,'instances':_0x4e83cb};return this['_addGraphic'](_0x574e92);}else{const _0xa44600=[];for(let _0x2e3c29=0x0,_0x3029f0=_0x4e83cb['length'];_0x2e3c29<_0x3029f0;_0x2e3c29++){const _0x2e8d53=this['_addGraphic'](_0x4e83cb[_0x2e3c29]);_0x2e8d53&&_0xa44600[_0x2c1cb5(0xb75)](_0x2e8d53);}return _0xa44600;}}else return this['_addGraphic'](_0x4e83cb);}['_addGraphic'](_0x1889d6,_0xfcd9b8=!![]){const _0x1ee859=_0x3d5d32;var _0x1d29b3;return delete this['_objectsToExclude_auto'],this['_graphicList']['get']((_0x1d29b3=_0x1889d6)===null||_0x1d29b3===void 0x0?void 0x0:_0x1d29b3['id'])&&(_0x1889d6['id']=createGuid(),logWarn('addGraphic:数据id存在冲突,已重新赋值id',_0x1889d6)),!_0x1889d6['_onAdd']&&(_0x1889d6['type']||this['options']['symbol'])&&(_0xfcd9b8&&this['options']['symbol']&&(_0x1889d6=mergeSymbolToGraphic(_0x1889d6,this['options']['symbol'])),_0x1889d6=create$4(_0x1889d6['type'],_0x1889d6)),_0x1889d6&&(_0x1889d6[_0x1ee859(0xb5d)](this),this['_graphicList']['set'](_0x1889d6['id'],_0x1889d6)),_0x1889d6;}['removeGraphic'](_0x5b0a82,_0x50bed9){return this['_removeGraphic'](_0x5b0a82,_0x50bed9),this;}['_removeGraphic'](_0x5e1db5,_0x417d2a,_0x459cf1){const _0x37a2de={_0x3568b3:0xf06},_0x71dd6f=_0x3d5d32;if(!_0x5e1db5||!_0x5e1db5['_onRemove'])return this;delete this['_objectsToExclude_auto'],!_0x459cf1&&this[_0x71dd6f(0xa10)][_0x71dd6f(_0x37a2de._0x3568b3)](_0x5e1db5['id']),_0x5e1db5['_onRemove'](),_0x417d2a&&_0x5e1db5['destroy']();}[_0x3d5d32(0x6ef)](_0x2a09c8){const _0x13fb57={_0x4c6d14:0x40a},_0x58bbd6=_0x3d5d32;return this['_graphicList'][_0x58bbd6(_0x13fb57._0x4c6d14)](_0x2a09c8);}['getGraphicByAttr'](_0x15b783,_0x50f827){return this['_graphicList']['getByAttr'](_0x15b783,_0x50f827,'attr');}[_0x3d5d32(0x6d6)](_0x372660,_0x5534bc){const _0xe34836=_0x3d5d32;return this[_0xe34836(0xa10)]['getListByAttr'](_0x372660,_0x5534bc,_0xe34836(0xe12));}[_0x3d5d32(0x2e5)](_0x512b91,_0x59c399){const _0x484a8b=_0x3d5d32,_0x1b235b=[];return this[_0x484a8b(0xa10)]['forEach'](_0x21ae41=>{_0x21ae41['style'][_0x512b91]===_0x59c399&&_0x1b235b['push'](_0x21ae41);},this),_0x1b235b;}['eachGraphic'](_0x3f4b5a,_0x19bf2d){const _0x37f462={_0x1b11d9:0xa10},_0x4c818d=_0x3d5d32;return this[_0x4c818d(_0x37f462._0x1b11d9)]['forEach'](_0x3f4b5a,_0x19bf2d||this),this;}['getGraphics'](_0x45f975=![]){if(_0x45f975)return this['_graphicList']['values'];else{const _0x36f89f=[];return this['_graphicList']['forEach'](_0x4ef5df=>{!_0x4ef5df['isPrivate']&&_0x36f89f['push'](_0x4ef5df);},this),_0x36f89f;}}['clear'](_0x4e401c=!![]){const _0x5c1248={_0x290600:0xeab,_0x40e12c:0x4d5,_0x4318e6:0x6ee,_0x31ad3a:0x8e3,_0x21907e:0x42c,_0x1d49f2:0x42c},_0x26b533=_0x3d5d32;this['stopDraw']();this['_graphicList']&&(this['_graphicList']['forEach'](_0x2ee7ae=>{this['_removeGraphic'](_0x2ee7ae,_0x4e401c,!![]);},this),this['_graphicList']['removeAll']());this['_dataSource']&&this[_0x26b533(_0x5c1248._0x290600)]['entities']['removeAll']();if(this['_primitiveCollection'])try{this['_primitiveCollection']['removeAll']();}catch(_0x35262c){const _0x2cf306=this[_0x26b533(_0x5c1248._0x40e12c)]['_primitives'],_0x424275=_0x2cf306[_0x26b533(0xc84)];for(let _0x2f0fec=0x0;_0x2f0fec<_0x424275;++_0x2f0fec){var _0x4b745d,_0x3f2e66;(_0x4b745d=_0x2cf306[_0x2f0fec])!==null&&_0x4b745d!==void 0x0&&(_0x3f2e66=_0x4b745d['_external'])!==null&&_0x3f2e66!==void 0x0&&_0x3f2e66['_composites']&&(delete _0x2cf306[_0x2f0fec][_0x26b533(0x6de)][_0x26b533(0x6d1)][this['_guid']],this['_primitiveCollection']['destroyPrimitives']&&_0x2cf306[_0x2f0fec]['destroy']());}this['_primitiveCollection']['_primitives']=[];}this['_labelCollection']&&this[_0x26b533(_0x5c1248._0x4318e6)]['removeAll'](),this[_0x26b533(0xd1a)]&&this['_billboardCollection']['removeAll'](),this['_cloudCollection']&&this[_0x26b533(_0x5c1248._0x31ad3a)]['removeAll'](),this[_0x26b533(_0x5c1248._0x21907e)]&&this[_0x26b533(_0x5c1248._0x1d49f2)]['removeAll'](),this['_polylineCollection']&&this['_polylineCollection']['removeAll'](),this[_0x26b533(0x908)]();}['autoSurfaceHeight'](_0x216dd0={}){return new Promise((_0x492f79,_0x31775b)=>{const _0x53adfd={_0x9951c7:0x44d,_0x2448a2:0xc81},_0x30addc=this['getGraphics']();let _0x3844f2=-0x1;const _0x2c9758=_0x30addc['length'];function _0x2a136d(){const _0x4bcf8c=_0x4132;_0x3844f2++;if(_0x3844f2>=_0x2c9758){_0x216dd0['end']&&_0x216dd0['end']({'index':_0x3844f2,'count':_0x2c9758,'graphics':_0x30addc});_0x492f79(_0x30addc);return;}const _0x4d166f=_0x30addc[_0x3844f2];_0x4d166f['autoSurfaceHeight']?_0x4d166f['autoSurfaceHeight'](_0x216dd0)[_0x4bcf8c(_0x53adfd._0x9951c7)](()=>{_0x216dd0['endItem']&&_0x216dd0['endItem']({'graphic':_0x4d166f,'index':_0x3844f2,'count':_0x2c9758}),_0x2a136d();}):(_0x216dd0['endItem']&&_0x216dd0[_0x4bcf8c(_0x53adfd._0x2448a2)]({'graphic':_0x4d166f,'index':_0x3844f2,'count':_0x2c9758}),_0x2a136d());}_0x2a136d();});}[_0x3d5d32(0x7c0)](_0x5c8cd3){return this['autoSurfaceHeight'](_0x5c8cd3);}[_0x3d5d32(0x8d9)](_0x34f9a9){const _0x1fa652={_0x1db25e:0xf57};return new Promise((_0x4ca13c,_0xbf83d1)=>{const _0x939978=_0x4132;this[_0x939978(_0x1fa652._0x1db25e)]();if(!this['_map'])throw new Error('startDraw:需要\x20map.addLayer(当前图层)\x20后,才行使用本方法');_0x34f9a9['_promise']={'resolve':_0x4ca13c,'reject':_0xbf83d1};const _0x3296fb=fromDraw(this,_0x34f9a9);_0x3296fb!=null&&(this[_0x939978(0x1082)]=_0x3296fb);});}['endDraw'](){const _0x4e403e={_0x2268b7:0x1082,_0x1ea5e1:0xd41},_0x3a8b6b=_0x3d5d32;this[_0x3a8b6b(0xda5)]();if(this['_graphic_drawing']){const _0x1a673e=this[_0x3a8b6b(_0x4e403e._0x2268b7)][_0x3a8b6b(_0x4e403e._0x1ea5e1)]();return _0x1a673e&&(this[_0x3a8b6b(_0x4e403e._0x2268b7)]=null),_0x1a673e;}return![];}['stopDraw'](){const _0xc63636={_0x4259c7:0x1082},_0x426ae6=_0x3d5d32;return this['stopEditing'](),this[_0x426ae6(_0xc63636._0x4259c7)]?(this['_graphic_drawing'][_0x426ae6(0xf57)](),this['_graphic_drawing']=null,!![]):![];}['clearDrawing'](){const _0x41921c=_0x3d5d32;return this[_0x41921c(0x1082)]?(this['_graphic_drawing']['remove'](!![]),this['_graphic_drawing']=null,!![]):![];}['activateEdit'](){const _0x2fc003={_0x263c19:0xc46,_0x118699:0x7ae},_0x219e4e=_0x3d5d32;if(this[_0x219e4e(_0x2fc003._0x263c19)])return;return this['_hasEdit']=!![],this['_map']&&this[_0x219e4e(_0x2fc003._0x118699)](),this;}['disableEdit'](){const _0x3d6fad={_0x21da5b:0xc46},_0x452a84=_0x3d5d32;if(!this[_0x452a84(_0x3d6fad._0x21da5b)])return;return this['_hasEdit']=![],this['_unbindEditEvent'](),this['stopEditing'](),this;}['_bindEditEvent'](){const _0x2cd109={_0x268ee8:0x1d1},_0x3ae7f7=_0x3d5d32;this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this[_0x3ae7f7(_0x2cd109._0x268ee8)]['on'](EventType[_0x3ae7f7(0x2f7)],this['_onMouseMoveHandler'],this);}[_0x3d5d32(0xd12)](){const _0x5b5547={_0x462b93:0x1d1},_0x4e281b=_0x3d5d32;this['_map'][_0x4e281b(0x9e7)](EventType['click'],this['_onClickHandler'],this),this[_0x4e281b(_0x5b5547._0x462b93)]['off'](EventType['mouseMoveTarget'],this['_onMouseMoveHandler'],this);}['_onMouseMoveHandler'](_0x506732){const _0x1e89a2={_0x155b34:0xc46,_0x1b709f:0xfc1,_0x1762c8:0x27b,_0x829a19:0x6e3,_0x484ae5:0x231},_0x4dc376=_0x3d5d32;if(!this[_0x4dc376(_0x1e89a2._0x155b34)])return;if(!this['_map'][_0x4dc376(_0x1e89a2._0x1b709f)][_0x4dc376(0xccc)][_0x4dc376(_0x1e89a2._0x1762c8)])return;let _0x2c7cbb=_0x506732['graphic'];if(!_0x2c7cbb){const _0x1a9a98=this['_map']['mouseEvent']['getPickTarget'](_0x506732['endPosition'],_0x506732);_0x2c7cbb=_0x1a9a98===null||_0x1a9a98===void 0x0?void 0x0:_0x1a9a98['graphic'];}if(_0x2c7cbb==null||_0x2c7cbb['_layer']!==this){this[_0x4dc376(0x1d1)][_0x4dc376(0xc62)]();return;}if(_0x2c7cbb[_0x4dc376(_0x1e89a2._0x829a19)]||_0x2c7cbb['isPrivate']||!_0x2c7cbb['hasEdit'])return;if(this['_map']['contextmenu']['show']&&this['_map']['contextmenu']['target']===_0x2c7cbb)return;let _0x35067d;isPCBroswer()?_0x35067d=this['_map']['getLangText'](_0x4dc376(0xc78))+_0x4dc376(_0x1e89a2._0x484ae5)+this['_map']['getLangText']('_右击菜单删除'):_0x35067d=this['_map']['getLangText']('_单击后激活编辑'),this['_map']['openSmallTooltip'](_0x506732['windowPosition'],_0x35067d);}['_onClickHandler'](_0x4cfbf1){const _0xfa0f73={_0x244926:0xda5},_0x4847a2=_0x3d5d32;if(this['_graphic_drawing'])return;const _0x2a0736=_0x4cfbf1['graphic'];if(_0x2a0736&&(_0x2a0736['isPrivate']||!_0x2a0736['hasEdit']))return;this['hasEdit']&&_0x2a0736&&_0x4cfbf1['layer']===this?this['startEditing'](_0x2a0736,_0x4cfbf1):this[_0x4847a2(_0xfa0f73._0x244926)]();}['startEditing'](_0x4e7fb4,_0x5ce48b){const _0x4e963d={_0x3d1da4:0x714,_0x32ca75:0xb69,_0x6dbb04:0x3cb},_0x37b899=_0x3d5d32;if(!_0x4e7fb4||!_0x4e7fb4[_0x37b899(_0x4e963d._0x3d1da4)]||!_0x4e7fb4['isAdded']||!_0x4e7fb4['hasEdit'])return;if(this['_graphic_editing']===_0x4e7fb4||_0x4e7fb4[_0x37b899(0x6e3)])return;return this['stopEditing'](),_0x4e7fb4['startEditing'](),_0x5ce48b&&_0x4e7fb4['_draw_tooltip']&&this[_0x37b899(0x1d1)]['openSmallTooltip'](_0x5ce48b[_0x37b899(_0x4e963d._0x32ca75)],_0x4e7fb4[_0x37b899(_0x4e963d._0x6dbb04)]),this['_graphic_editing']=_0x4e7fb4,this;}[_0x3d5d32(0xda5)](){const _0x47cf90={_0x2083e3:0x1066},_0x60c932=_0x3d5d32;return this['_graphic_editing']&&(this[_0x60c932(_0x47cf90._0x2083e3)]['stopEditing'](),this['_graphic_editing']=null),this;}}register$2('graphic',GraphicLayer);class MatrixMove extends BaseThing{constructor(_0x4c1f76={}){const _0x359a23={_0x85b9b2:0xb69},_0x1d071c=_0x3d5d32;super(_0x4c1f76),this[_0x1d071c(0xf1f)]=new Cesium__namespace[(_0x1d071c(0xe95))](0x0,0x0,0x0),this['rotateMatrix']=new Cesium__namespace['Matrix3'](0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1),_0x4c1f76['position']&&(this[_0x1d071c(_0x359a23._0x85b9b2)]=_0x4c1f76['position']);}get['position'](){return this['_position'];}set['position'](_0xb4ed28){const _0x5dd956={_0xed0a10:0xc87},_0x383fce=_0x3d5d32;this['_position']=LngLatPoint['toCartesian'](_0xb4ed28),this[_0x383fce(_0x5dd956._0xed0a10)](),this['_updatePositionHook'](!![]);}get['isMoveing'](){const _0x3ec6d7={_0x4cdac5:0xa70},_0x41ef2c=_0x3d5d32;if(!this['_map'])return![];return this[_0x41ef2c(_0x3ec6d7._0x4cdac5)];}['_mountedHook'](){this['_graphicLayer']=new GraphicLayer({'private':!![]});}['_addedHook'](){const _0x3214a2={_0x23b41a:0xc5c},_0x3a197d=_0x3d5d32;this[_0x3a197d(0x1d1)]['addLayer'](this['_graphicLayer']),this['_updatePositionHook'](!![]),this[_0x3a197d(_0x3214a2._0x23b41a)](),this[_0x3a197d(0x2a1)]();}['_removedHook'](){const _0x359959={_0xf86808:0xeff,_0x45daeb:0x6be,_0x51cb0a:0x4b0},_0x5aa64f=_0x3d5d32;this[_0x5aa64f(_0x359959._0xf86808)]&&delete this['_graphic_move_x'],this[_0x5aa64f(0x6be)]&&delete this[_0x5aa64f(_0x359959._0x45daeb)],this['_graphic_move_z']&&delete this['_graphic_move_z'],this['_graphic_dragger_ing']&&delete this[_0x5aa64f(_0x359959._0x51cb0a)],this['_graphicLayer']['clear'](),this['_map']['removeLayer'](this['_graphicLayer']),this['_unbindEvent']();}[_0x3d5d32(0xc5c)](){const _0x3e5029={_0x2afade:0xeff,_0x15bf23:0xa83,_0x31fc9a:0x6be},_0xc9f033=_0x3d5d32;this['_graphicLayer']['clear'](),this[_0xc9f033(0xeff)]=new PolylinePrimitive({'positions':this[_0xc9f033(0xc1a)],'style':{'width':0xf,'arcType':Cesium__namespace['ArcType']['NONE'],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['RED'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace['Axis']['X']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this[_0xc9f033(_0x3e5029._0x2afade)]),this[_0xc9f033(0x6be)]=new PolylinePrimitive({'positions':this['_positions_line_y'],'style':{'width':0xf,'arcType':Cesium__namespace[_0xc9f033(0x1029)][_0xc9f033(_0x3e5029._0x15bf23)],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['GREEN'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace['Axis']['Y']},'asynchronous':![]}),this[_0xc9f033(0x32f)]['addGraphic'](this[_0xc9f033(_0x3e5029._0x31fc9a)]),this['_graphic_move_z']=new PolylinePrimitive({'positions':this['_positions_line_z'],'style':{'width':0xf,'arcType':Cesium__namespace['ArcType']['NONE'],'materialType':PolylineArrow,'color':Cesium__namespace['Color']['BLUE'],'depthFail':!![]},'attr':{'move':!![],'type':Cesium__namespace['Axis']['Z']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this['_graphic_move_z']),this['_graphic_dragger_ing']=new PolylinePrimitive({'positions':[],'style':{'width':0x3,'arcType':Cesium__namespace[_0xc9f033(0x1029)]['NONE'],'materialType':PolylineDash,'color':Cesium__namespace['Color']['YELLOW'],'depthFail':!![]},'asynchronous':![],'show':![]}),this['_graphicLayer'][_0xc9f033(0x682)](this['_graphic_dragger_ing']);}['_initByPosition'](){const _0x9b0883={_0x2fd76b:0x724,_0x47a969:0xb69,_0x169a3a:0xf5d,_0x50c8ce:0xd06,_0x35d224:0x7db,_0x52ca72:0xe95},_0x1d8a14=_0x3d5d32;this['modelToWorld']=Cesium__namespace[_0x1d8a14(0x5bb)][_0x1d8a14(_0x9b0883._0x2fd76b)](this[_0x1d8a14(_0x9b0883._0x47a969)]),this['worldToModel']=Cesium__namespace[_0x1d8a14(_0x9b0883._0x169a3a)]['inverse'](this['modelToWorld'],new Cesium__namespace['Matrix4']()),this['matrix']=this['modelToWorld']['clone'](),this['inverseMatrix']=Cesium__namespace['Matrix4']['inverse'](this['matrix'],new Cesium__namespace[(_0x1d8a14(_0x9b0883._0x169a3a))]()),this['normalX']=Cesium__namespace['Matrix4'][_0x1d8a14(_0x9b0883._0x50c8ce)](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_X'],new Cesium__namespace['Cartesian3']()),this['normalY']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_Y'],new Cesium__namespace['Cartesian3']()),this['normalZ']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this[_0x1d8a14(0xa79)],Cesium__namespace['Cartesian3'][_0x1d8a14(_0x9b0883._0x35d224)],new Cesium__namespace[(_0x1d8a14(_0x9b0883._0x52ca72))]()),this['_positions_line_x']=[],this['_positions_line_y']=[],this['_positions_line_z']=[];}[_0x3d5d32(0x502)](_0x5aedd7){const _0x280e69={_0x3c281b:0x435,_0x21db44:0x1d1,_0x3d6c22:0x1076,_0x4585b5:0xc1a,_0x26ce0f:0xa79,_0x2089c6:0xe95,_0x39df61:0x348,_0x28ef4a:0xc9f,_0x28aa2d:0xd61},_0x2ca35b=_0x3d5d32;if(!this['_map'])return;const _0xd1ef48=this['position']['clone']();if(_0x5aedd7){const _0xc18b35=new Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x2ca35b(0x1d1)][_0x2ca35b(_0x280e69._0x3c281b)]['viewMatrix'],_0xd1ef48,new Cesium__namespace['Cartesian3']()),_0x17108f=-_0xc18b35['z']*Math['tan'](this[_0x2ca35b(_0x280e69._0x21db44)]['camera']['frustum']['fov']/0x2)*0x2,_0x34d1ed=_0x17108f/this[_0x2ca35b(_0x280e69._0x21db44)]['canvas'][_0x2ca35b(_0x280e69._0x3d6c22)];this['radius']=0xc8*_0x34d1ed;}this[_0x2ca35b(_0x280e69._0x4585b5)]=[_0xd1ef48,Cesium__namespace['Matrix4']['multiplyByPoint'](this['matrix'],new Cesium__namespace['Cartesian3'](this['radius'],0x0,0x0),new Cesium__namespace['Cartesian3']())],this['_positions_line_y']=[_0xd1ef48,Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x2ca35b(_0x280e69._0x26ce0f)],new Cesium__namespace[(_0x2ca35b(_0x280e69._0x2089c6))](0x0,this['radius'],0x0),new Cesium__namespace[(_0x2ca35b(0xe95))]())],this[_0x2ca35b(_0x280e69._0x39df61)]=[_0xd1ef48,Cesium__namespace[_0x2ca35b(0xf5d)][_0x2ca35b(_0x280e69._0x28ef4a)](this['matrix'],new Cesium__namespace['Cartesian3'](0x0,0x0,this[_0x2ca35b(_0x280e69._0x28aa2d)]),new Cesium__namespace['Cartesian3']())],this['_graphic_move_x']&&(this[_0x2ca35b(0xeff)]['positions']=this['_positions_line_x']),this['_graphic_move_y']&&(this['_graphic_move_y']['positions']=this[_0x2ca35b(0x598)]),this['_graphic_move_z']&&(this['_graphic_move_z']['positions']=this['_positions_line_z']);}['_bindEvent'](){const _0x40dc63={_0x2f70a4:0x91b,_0x1ef3c5:0xcda},_0x2127e8=_0x3d5d32;this['_graphicLayer']['on'](EventType[_0x2127e8(_0x40dc63._0x2f70a4)],this['_onMap_leftDown'],this),this['_map']['on'](EventType[_0x2127e8(_0x40dc63._0x1ef3c5)],this[_0x2127e8(0x3e9)],this),this['_map']['on'](EventType[_0x2127e8(0xb67)],this['_onMap_middleClick'],this),this['_map']['on'](EventType[_0x2127e8(0x78e)],this['_onMap_wheel'],this);}[_0x3d5d32(0x85a)](){const _0x171e9b={_0x4ebc91:0x32f,_0x876543:0x1d1,_0x19f2c8:0x314,_0x2638bf:0x78e},_0x2a84b3=_0x3d5d32;this[_0x2a84b3(_0x171e9b._0x4ebc91)]['off'](EventType['leftDown'],this['_onMap_leftDown'],this),this['_map']['off'](EventType['leftUp'],this[_0x2a84b3(0x3e9)],this),this[_0x2a84b3(_0x171e9b._0x876543)]['off'](EventType[_0x2a84b3(_0x171e9b._0x19f2c8)],this[_0x2a84b3(0xb6d)],this),this['_map']['off'](EventType['middleClick'],this['_onMap_middleClick'],this),this['_map']['off'](EventType[_0x2a84b3(_0x171e9b._0x2638bf)],this[_0x2a84b3(0x725)],this);}['_onMap_leftDown'](_0x3899da){const _0x25a627={_0x6ce491:0x6cc,_0x5cad14:0x6e8,_0x163d31:0x4b0,_0x583cd7:0x6cc,_0x3e5f72:0xfc1,_0x1cdc99:0xccc,_0x3e7053:0x27b},_0x283ce3=_0x3d5d32;this[_0x283ce3(_0x25a627._0x6ce491)]=undefined;if(_0x3899da['layer']!==this['_graphicLayer'])return;const _0xc9b931=_0x3899da['graphic'];if(!_0xc9b931||!(_0xc9b931[_0x283ce3(0xe12)]['move']||_0xc9b931[_0x283ce3(0xe12)]['rotate']))return;this['_graphic']=_0xc9b931;!_0xc9b931[_0x283ce3(0xdde)]['color_bak']&&(_0xc9b931['style']['color_bak']=_0xc9b931[_0x283ce3(0xdde)]['color']);_0xc9b931['setStyle']({'color':Cesium__namespace['Color'][_0x283ce3(_0x25a627._0x5cad14)]}),this['_graphic_dragger_ing']['positions']=[this[_0x283ce3(0xb69)],this['position']],this[_0x283ce3(_0x25a627._0x163d31)]['show']=!![];const _0x37f9b0=this[_0x283ce3(_0x25a627._0x583cd7)]['attr']['type'];this['fire'](EventType[_0x283ce3(0xf6d)],{..._0x3899da,'editType':_0x37f9b0,'graphic':_0xc9b931}),this[_0x283ce3(0x1d1)][_0x283ce3(_0x25a627._0x3e5f72)]['screenSpaceCameraController']['enableInputs']&&(this['_map']['scene'][_0x283ce3(_0x25a627._0x1cdc99)][_0x283ce3(_0x25a627._0x3e7053)]=![],this['_hasChangeEnableInputs']=!![]),this['_map']['on'](EventType['mouseMove'],this['_onMap_mouseMove'],this);}['_onMap_mouseMove'](_0x1caf28){const _0x36485c={_0x3279ba:0xb18,_0x58d3bb:0xe7b,_0x3f2143:0x1d1,_0x40c205:0xc9f,_0xad9665:0x51d,_0x2dc53d:0xb69,_0x28f484:0xe95,_0x1fbc49:0x742,_0x29d5f3:0x1076,_0x395247:0xd14,_0x379ded:0xb69,_0x2576f5:0x220,_0x5957b4:0x83e,_0x37e5ea:0xbfd,_0x3b8995:0xa79,_0x5486d7:0xff3,_0x1151e3:0x724,_0x5384ec:0xe7b,_0x368f67:0x1014,_0x545efb:0xf88,_0x379a66:0xf5d,_0x4a5096:0xc72,_0x597e39:0x37e,_0x59669c:0xd06,_0x47c9bd:0x37e,_0x45b3ec:0xf88,_0xf78786:0x502},_0x561839=_0x3d5d32;if(!this['_graphic'])return;const _0x2531ee=_0x1caf28['startPosition'],_0x305b6f=_0x1caf28['endPosition'];let _0x2a5fb9;const _0x3a6437=this['_graphic']['attr']['type'];_0x3a6437===Cesium__namespace[_0x561839(_0x36485c._0x3279ba)]['X']&&(_0x2a5fb9=this['normalX']);_0x3a6437===Cesium__namespace[_0x561839(0xb18)]['Y']&&(_0x2a5fb9=this['normalY']);_0x3a6437===Cesium__namespace[_0x561839(0xb18)]['Z']&&(_0x2a5fb9=this[_0x561839(_0x36485c._0x58d3bb)]);const _0x2d00df=new Cesium__namespace['Cartesian3'](_0x305b6f['x']-_0x2531ee['x'],-(_0x305b6f['y']-_0x2531ee['y']),0x0),_0x58cd68=new Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this[_0x561839(_0x36485c._0x3f2143)][_0x561839(0x435)]['inverseViewMatrix'],_0x2d00df,new Cesium__namespace['Cartesian3']()),_0x3d0201=new Cesium__namespace['Matrix4'][(_0x561839(_0x36485c._0x40c205))](this['_map']['camera'][_0x561839(_0x36485c._0xad9665)],this[_0x561839(_0x36485c._0x2dc53d)],new Cesium__namespace[(_0x561839(_0x36485c._0x28f484))]()),_0x5a7af7=-_0x3d0201['z']*Math['tan'](this['_map']['camera'][_0x561839(0x389)][_0x561839(_0x36485c._0x1fbc49)]/0x2)*0x2,_0xf4c00d=_0x5a7af7/this['_map']['canvas'][_0x561839(_0x36485c._0x29d5f3)],_0x145811=Cesium__namespace[_0x561839(_0x36485c._0x28f484)]['dot'](_0x58cd68,_0x2a5fb9)*_0xf4c00d,_0x3bef30=Cesium__namespace[_0x561839(0x220)][_0x561839(_0x36485c._0x395247)](this[_0x561839(0xb69)]);let _0x4ecbd7=new Cesium__namespace[(_0x561839(0xe95))](this[_0x561839(0xb69)]['x']+_0x2a5fb9['x']*_0x145811,this['position']['y']+_0x2a5fb9['y']*_0x145811,this[_0x561839(_0x36485c._0x379ded)]['z']+_0x2a5fb9['z']*_0x145811);_0x3a6437!==Cesium__namespace['Axis']['Z']&&(_0x4ecbd7=Cesium__namespace[_0x561839(_0x36485c._0x2576f5)]['fromCartesian'](_0x4ecbd7),_0x4ecbd7['height']=_0x3bef30[_0x561839(_0x36485c._0x5957b4)],_0x3a6437===Cesium__namespace['Axis']['X']?_0x4ecbd7['latitude']=_0x3bef30['latitude']:_0x4ecbd7['longitude']=_0x3bef30[_0x561839(_0x36485c._0x37e5ea)],_0x4ecbd7=Cesium__namespace['Cartesian3']['fromRadians'](_0x4ecbd7[_0x561839(0xbfd)],_0x4ecbd7['latitude'],_0x4ecbd7['height']));const _0x577205=Cesium__namespace['Matrix4'][_0x561839(_0x36485c._0x40c205)](this['inverseMatrix'],_0x4ecbd7,new Cesium__namespace[(_0x561839(0xe95))]());Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this[_0x561839(_0x36485c._0x3b8995)],_0x577205,_0x577205),Cesium__namespace['Matrix4']['multiplyByVector'](this['worldToModel'],new Cesium__namespace['Cartesian4'](_0x577205['x'],_0x577205['y'],_0x577205['z'],0x0),_0x577205),Cesium__namespace['Cartesian3'][_0x561839(_0x36485c._0x5486d7)](this['translation'],_0x577205,this['translation']),this[_0x561839(_0x36485c._0x379ded)]=_0x4ecbd7,this['matrix']=Cesium__namespace['Transforms'][_0x561839(_0x36485c._0x1151e3)](this['position']),Cesium__namespace['Matrix4']['inverse'](this['matrix'],this['inverseMatrix']);const _0x1049d5=this['normalX'],_0x3bbae4=this['normalY'],_0x3b518f=this['normalZ'];this['normalX']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_X'],new Cesium__namespace['Cartesian3']()),this[_0x561839(0x5b1)]=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_Y'],new Cesium__namespace['Cartesian3']()),this['normalZ']=Cesium__namespace['Matrix4'][_0x561839(0xd06)](this[_0x561839(0xa79)],Cesium__namespace['Cartesian3']['UNIT_Z'],new Cesium__namespace['Cartesian3']());if(_0x3a6437===Cesium__namespace['Axis']['X']){let _0x48a7f2=Cesium__namespace['Cartesian3'][_0x561839(0x97f)](_0x3bbae4,this['normalY']),_0x521e4e=Cesium__namespace['Cartesian3']['angleBetween'](_0x3b518f,this[_0x561839(_0x36485c._0x5384ec)]);_0x145811<0x0&&(_0x521e4e=-_0x521e4e,_0x48a7f2=-_0x48a7f2);const _0x6e2b55=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],_0x3b518f,new Cesium__namespace['Cartesian3']());let _0x595e65=Cesium__namespace['Matrix3']['inverse'](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x24de25=Cesium__namespace['Matrix3'][_0x561839(_0x36485c._0x368f67)](_0x595e65,_0x6e2b55,new Cesium__namespace['Cartesian3']()),_0x2f3901=this['_axisRotation'](_0x24de25,_0x48a7f2);Cesium__namespace['Matrix3']['multiply'](this[_0x561839(_0x36485c._0x545efb)],_0x2f3901,this['rotateMatrix']);const _0x4096fd=Cesium__namespace[_0x561839(_0x36485c._0x379a66)]['multiplyByPointAsVector'](this['worldToModel'],_0x3bbae4,new Cesium__namespace['Cartesian3']());_0x595e65=Cesium__namespace['Matrix3'][_0x561839(_0x36485c._0x4a5096)](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x24de25=Cesium__namespace['Matrix3']['multiplyByVector'](_0x595e65,_0x4096fd,new Cesium__namespace['Cartesian3']()),_0x2f3901=this['_axisRotation'](_0x24de25,_0x521e4e),Cesium__namespace['Matrix3'][_0x561839(_0x36485c._0x597e39)](this['rotateMatrix'],_0x2f3901,this['rotateMatrix']);}if(_0x3a6437===Cesium__namespace[_0x561839(0xb18)]['Y']){let _0x31e08c=Cesium__namespace[_0x561839(0xe95)]['angleBetween'](_0x3b518f,this['normalZ']);_0x145811>0x0&&(_0x31e08c=-_0x31e08c);const _0x15ffb6=Cesium__namespace['Matrix4'][_0x561839(_0x36485c._0x59669c)](this[_0x561839(0x6c9)],_0x1049d5,new Cesium__namespace[(_0x561839(_0x36485c._0x28f484))]()),_0x464699=Cesium__namespace[_0x561839(0x9dc)]['inverse'](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x1aabce=Cesium__namespace['Matrix3']['multiplyByVector'](_0x464699,_0x15ffb6,new Cesium__namespace['Cartesian3']()),_0x225d77=this['_axisRotation'](_0x1aabce,_0x31e08c);Cesium__namespace['Matrix3'][_0x561839(_0x36485c._0x47c9bd)](this[_0x561839(_0x36485c._0x545efb)],_0x225d77,this[_0x561839(_0x36485c._0x45b3ec)]);}this['_graphic_dragger_ing']['positions']=[this['_graphic_dragger_ing']['positions'][0x0],_0x4ecbd7],this[_0x561839(_0x36485c._0xf78786)]();const _0x1677a4={..._0x1caf28,'editType':_0x3a6437,'position':_0x4ecbd7};this['onChange'](_0x1677a4);}['_onMap_leftUp'](_0x2f0fad){const _0x2dc060={_0x59eb1f:0x6cc,_0x14f989:0x6cc,_0x40b05f:0xccc,_0x40e02c:0xefc,_0x2542ca:0x886},_0x8b0722=_0x3d5d32;if(!this[_0x8b0722(_0x2dc060._0x59eb1f)])return;this[_0x8b0722(_0x2dc060._0x59eb1f)]['setStyle']({'color':this[_0x8b0722(_0x2dc060._0x14f989)][_0x8b0722(0xdde)]['color_bak']}),this['_graphic']=null,this[_0x8b0722(0x4b0)][_0x8b0722(0xbb8)]=[],this[_0x8b0722(0x4b0)]['show']=![],this['_hasChangeEnableInputs']&&(this['_map'][_0x8b0722(0xfc1)][_0x8b0722(_0x2dc060._0x40b05f)]['enableInputs']=!![],delete this['_hasChangeEnableInputs']),this[_0x8b0722(0x1d1)]['off'](EventType['mouseMove'],this['_onMap_mouseMove'],this),this[_0x8b0722(_0x2dc060._0x40e02c)](EventType[_0x8b0722(_0x2dc060._0x2542ca)],_0x2f0fad);}[_0x3d5d32(0xa77)](_0x308511,_0x3c1670,_0x25faf6){const _0x4e8b2e={_0xdd19e5:0xd04,_0x3ad196:0x9b0},_0x3dffaa=_0x3d5d32;let _0x3bee38=_0x308511['x'],_0xb1ecf=_0x308511['y'],_0x2c6b55=_0x308511['z'];const _0x1499f9=Math['sqrt'](_0x3bee38*_0x3bee38+_0xb1ecf*_0xb1ecf+_0x2c6b55*_0x2c6b55);_0x3bee38=_0x3bee38/_0x1499f9,_0xb1ecf=_0xb1ecf/_0x1499f9,_0x2c6b55=_0x2c6b55/_0x1499f9;const _0x17891c=_0x3bee38*_0x3bee38,_0x47cdcd=_0xb1ecf*_0xb1ecf,_0x1fcf73=_0x2c6b55*_0x2c6b55,_0x1f6eab=Math['cos'](_0x3c1670),_0x1d0f53=Math['sin'](_0x3c1670),_0x38f37c=0x1-_0x1f6eab;return _0x25faf6=_0x25faf6||new Cesium__namespace['Matrix3'](),_0x25faf6[Cesium__namespace['Matrix3'][_0x3dffaa(0x481)]]=_0x17891c+(0x1-_0x17891c)*_0x1f6eab,_0x25faf6[Cesium__namespace['Matrix3']['COLUMN0ROW1']]=_0x3bee38*_0xb1ecf*_0x38f37c+_0x2c6b55*_0x1d0f53,_0x25faf6[Cesium__namespace['Matrix3']['COLUMN0ROW2']]=_0x3bee38*_0x2c6b55*_0x38f37c-_0xb1ecf*_0x1d0f53,_0x25faf6[Cesium__namespace['Matrix3']['COLUMN1ROW0']]=_0x3bee38*_0xb1ecf*_0x38f37c-_0x2c6b55*_0x1d0f53,_0x25faf6[Cesium__namespace[_0x3dffaa(0x9dc)][_0x3dffaa(_0x4e8b2e._0xdd19e5)]]=_0x47cdcd+(0x1-_0x47cdcd)*_0x1f6eab,_0x25faf6[Cesium__namespace[_0x3dffaa(0x9dc)][_0x3dffaa(_0x4e8b2e._0x3ad196)]]=_0xb1ecf*_0x2c6b55*_0x38f37c+_0x3bee38*_0x1d0f53,_0x25faf6[Cesium__namespace['Matrix3']['COLUMN2ROW0']]=_0x3bee38*_0x2c6b55*_0x38f37c+_0xb1ecf*_0x1d0f53,_0x25faf6[Cesium__namespace[_0x3dffaa(0x9dc)]['COLUMN2ROW1']]=_0xb1ecf*_0x2c6b55*_0x38f37c-_0x3bee38*_0x1d0f53,_0x25faf6[Cesium__namespace['Matrix3']['COLUMN2ROW2']]=_0x1fcf73+(0x1-_0x1fcf73)*_0x1f6eab,_0x25faf6;}['_onMap_wheel'](){this['_updatePositionHook'](!![]);}['_onMap_middleClick'](_0x31a36d){const _0x23a5f7={_0x29fb01:0x724,_0x501f6b:0xf5d,_0x4009c5:0xc72},_0x18bfc5=_0x3d5d32,_0x3ac723=this['_map']['scene']['pickPosition'](_0x31a36d['position']);_0x3ac723&&(this['position']=_0x3ac723,this[_0x18bfc5(0xa79)]=Cesium__namespace['Transforms'][_0x18bfc5(_0x23a5f7._0x29fb01)](this['position']),Cesium__namespace[_0x18bfc5(_0x23a5f7._0x501f6b)][_0x18bfc5(_0x23a5f7._0x4009c5)](this['matrix'],this['inverseMatrix']),this['_updatePositionHook']());}['onChange'](_0x308cd2){const _0x28c220={_0x2b7475:0x7ca,_0x5df0a4:0x73d},_0x3a7f20=_0x3d5d32;this['options'][_0x3a7f20(_0x28c220._0x2b7475)]&&this['options']['onChange'](_0x308cd2),this['fire'](EventType[_0x3a7f20(_0x28c220._0x5df0a4)],_0x308cd2,!![]);}}class MatrixRotate extends MatrixMove{get[_0x3d5d32(0xe39)](){return this['options']['heading']??0x0;}set['heading'](_0x1903fc){const _0x28c8e9={_0x167aa5:0x433},_0x407d36=_0x3d5d32;this[_0x407d36(_0x28c8e9._0x167aa5)]['heading']=_0x1903fc;}get['pitch'](){return this['options']['pitch']??0x0;}set[_0x3d5d32(0x5cf)](_0x260d67){const _0x1d320f={_0xf871e8:0x433},_0x1bc2d4=_0x3d5d32;this[_0x1bc2d4(_0x1d320f._0xf871e8)][_0x1bc2d4(0x5cf)]=_0x260d67;}get['roll'](){const _0x3b7b26=_0x3d5d32;return this[_0x3b7b26(0x433)]['roll']??0x0;}set[_0x3d5d32(0x952)](_0x597076){const _0x1d8218=_0x3d5d32;this[_0x1d8218(0x433)]['roll']=_0x597076;}['_removedHook'](){const _0x2ee740={_0x320b2f:0x6e4},_0x51615f=_0x3d5d32;delete this[_0x51615f(_0x2ee740._0x320b2f)],delete this[_0x51615f(0xa44)],delete this['_graphic_rotate_y'],super[_0x51615f(0x566)]();}['_createGraphics'](){const _0x383eb8={_0x573297:0xcab,_0x36bf5e:0x682,_0x36559f:0xa44,_0x556ad0:0x48b,_0x4a5b41:0x994,_0x4947c0:0xe57,_0x205cd9:0x4b0,_0xe1b5e5:0x1029,_0x5ef42f:0x6e8},_0x2df04a=_0x3d5d32;this['_graphicLayer']['clear'](),this['_graphic_rotate_x']=new PolylinePrimitive({'positions':this['_positions_circle_x'],'style':{'width':0x8,'color':Cesium__namespace['Color'][_0x2df04a(_0x383eb8._0x573297)],'depthFail':!![],'depthFailColor':Cesium__namespace['Color'][_0x2df04a(0xcab)]['withAlpha'](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace['Axis']['X']},'asynchronous':![]}),this['_graphicLayer'][_0x2df04a(_0x383eb8._0x36bf5e)](this[_0x2df04a(_0x383eb8._0x36559f)]),this['_graphic_rotate_y']=new PolylinePrimitive({'positions':this['_positions_circle_y'],'style':{'width':0x8,'color':Cesium__namespace[_0x2df04a(0x882)][_0x2df04a(0x48b)],'depthFail':!![],'depthFailColor':Cesium__namespace['Color'][_0x2df04a(_0x383eb8._0x556ad0)]['withAlpha'](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace['Axis']['Y']},'asynchronous':![]}),this['_graphicLayer']['addGraphic'](this[_0x2df04a(0xf08)]),this[_0x2df04a(0x6e4)]=new PolylinePrimitive({'positions':this['_positions_circle_z'],'style':{'width':0x8,'color':Cesium__namespace['Color'][_0x2df04a(_0x383eb8._0x4a5b41)],'depthFail':!![],'depthFailColor':Cesium__namespace['Color']['BLUE'][_0x2df04a(_0x383eb8._0x4947c0)](0.5)},'attr':{'rotate':!![],'type':Cesium__namespace['Axis']['Z']},'asynchronous':![]}),this['_graphicLayer'][_0x2df04a(_0x383eb8._0x36bf5e)](this['_graphic_rotate_z']),this[_0x2df04a(_0x383eb8._0x205cd9)]=new PolylinePrimitive({'positions':[],'style':{'width':0x3,'arcType':Cesium__namespace[_0x2df04a(_0x383eb8._0xe1b5e5)]['NONE'],'materialType':PolylineDash,'color':Cesium__namespace['Color'][_0x2df04a(_0x383eb8._0x5ef42f)],'depthFail':!![]},'asynchronous':![],'show':![]}),this[_0x2df04a(0x32f)]['addGraphic'](this[_0x2df04a(0x4b0)]);}['_initByPosition'](){const _0x50e1b0={_0x3db3ba:0x4df,_0xf1a897:0xb69,_0xde113e:0x6c9,_0x11c324:0x5b1,_0xd3a2d7:0xf5d},_0x5d09c0=_0x3d5d32;this[_0x5d09c0(_0x50e1b0._0x3db3ba)]=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](this[_0x5d09c0(_0x50e1b0._0xf1a897)]),this[_0x5d09c0(_0x50e1b0._0xde113e)]=Cesium__namespace['Matrix4'][_0x5d09c0(0xc72)](this[_0x5d09c0(0x4df)],new Cesium__namespace['Matrix4']()),this['matrix']=this['modelToWorld']['clone'](),this['inverseMatrix']=Cesium__namespace['Matrix4'][_0x5d09c0(0xc72)](this['matrix'],new Cesium__namespace['Matrix4']()),this['normalX']=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_X'],new Cesium__namespace[(_0x5d09c0(0xe95))]()),this[_0x5d09c0(_0x50e1b0._0x11c324)]=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3'][_0x5d09c0(0xa33)],new Cesium__namespace[(_0x5d09c0(0xe95))]()),this['normalZ']=Cesium__namespace[_0x5d09c0(_0x50e1b0._0xd3a2d7)]['multiplyByPointAsVector'](this['matrix'],Cesium__namespace['Cartesian3']['UNIT_Z'],new Cesium__namespace['Cartesian3']()),this['_positions_circle_z']=[],this['_positions_circle_x']=[],this['_positions_circle_y']=[];}['_updatePositionHook'](_0x3da01a){const _0x280e48={_0x29b1ce:0x1d1,_0x4a6013:0xf5d,_0x3eee8a:0x297,_0x5c6e84:0x723,_0x29c3a9:0xe95,_0x3922a3:0xff3,_0x308c14:0x5b1,_0x4cf38a:0xadd,_0x93a31f:0xe95,_0xc7050b:0x5b1,_0x435e0d:0xe95,_0x320ad9:0xf08},_0x3f4aca=_0x3d5d32;if(!this[_0x3f4aca(_0x280e48._0x29b1ce)])return;const _0x312290=this[_0x3f4aca(0xb69)][_0x3f4aca(0x315)]();if(_0x3da01a){const _0x70fce1=new Cesium__namespace[(_0x3f4aca(_0x280e48._0x4a6013))]['multiplyByPoint'](this['_map']['camera'][_0x3f4aca(0x51d)],_0x312290,new Cesium__namespace['Cartesian3']()),_0xd962a6=-_0x70fce1['z']*Math['tan'](this['_map']['camera'][_0x3f4aca(0x389)][_0x3f4aca(0x742)]/0x2)*0x2,_0x143eeb=_0xd962a6/this['_map']['canvas']['width'];this['radius']=0xc8*_0x143eeb;}this['_positions_circle_z']=[],this['_positions_circle_x']=[],this[_0x3f4aca(_0x280e48._0x3eee8a)]=[];for(let _0x2455c6=0x0;_0x2455c6<=0x168;_0x2455c6++){const _0x148fec=this[_0x3f4aca(0xd61)]*Math['cos'](_0x2455c6/0xb4*Math['PI']),_0x4fd09f=this['radius']*Math[_0x3f4aca(_0x280e48._0x5c6e84)](_0x2455c6/0xb4*Math['PI']),_0x4b8e9e=new Cesium__namespace[(_0x3f4aca(_0x280e48._0x29c3a9))]();Cesium__namespace['Cartesian3']['add'](_0x312290,Cesium__namespace['Cartesian3']['multiplyByScalar'](this['normalX'],_0x148fec,new Cesium__namespace['Cartesian3']()),_0x4b8e9e),Cesium__namespace['Cartesian3'][_0x3f4aca(_0x280e48._0x3922a3)](_0x4b8e9e,Cesium__namespace[_0x3f4aca(_0x280e48._0x29c3a9)]['multiplyByScalar'](this[_0x3f4aca(_0x280e48._0x308c14)],_0x4fd09f,new Cesium__namespace['Cartesian3']()),_0x4b8e9e),this['_positions_circle_z']['push'](_0x4b8e9e);const _0x34dbb4=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['add'](_0x312290,Cesium__namespace[_0x3f4aca(0xe95)][_0x3f4aca(_0x280e48._0x4cf38a)](this['normalX'],_0x148fec,new Cesium__namespace[(_0x3f4aca(_0x280e48._0x93a31f))]()),_0x34dbb4),Cesium__namespace['Cartesian3']['add'](_0x34dbb4,Cesium__namespace['Cartesian3']['multiplyByScalar'](this['normalZ'],_0x4fd09f,new Cesium__namespace['Cartesian3']()),_0x34dbb4),this['_positions_circle_x'][_0x3f4aca(0xb75)](_0x34dbb4);const _0x330120=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['add'](_0x312290,Cesium__namespace['Cartesian3']['multiplyByScalar'](this[_0x3f4aca(_0x280e48._0xc7050b)],_0x148fec,new Cesium__namespace['Cartesian3']()),_0x330120),Cesium__namespace[_0x3f4aca(_0x280e48._0x435e0d)]['add'](_0x330120,Cesium__namespace['Cartesian3']['multiplyByScalar'](this['normalZ'],_0x4fd09f,new Cesium__namespace['Cartesian3']()),_0x330120),this['_positions_circle_y']['push'](_0x330120);}this['_graphic_rotate_z']&&(this['_graphic_rotate_z']['positions']=this['_positions_circle_z']),this['_graphic_rotate_x']&&(this['_graphic_rotate_x']['positions']=this['_positions_circle_x']),this[_0x3f4aca(_0x280e48._0x320ad9)]&&(this[_0x3f4aca(0xf08)]['positions']=this['_positions_circle_y']);}[_0x3d5d32(0xb6d)](_0x23ac80){const _0x4ff570={_0x54d456:0xf5d,_0x79c5e6:0xe95,_0x5257b0:0xe95,_0x27cdd0:0xb18,_0x42cc9f:0xf5d,_0x3b40b0:0xa79,_0x4367ae:0x435,_0xc0cf9f:0x60f,_0x76b548:0xe95,_0x6c9fd7:0x1d1,_0x2f1a17:0x83e,_0x45104d:0xc9f,_0x2e378d:0xe95,_0x9d1341:0xe7b,_0x21d3e6:0xcc7,_0x3b3bbc:0xe95,_0x5b61fa:0x103e,_0x41ee2e:0x9dc,_0xdd40d7:0x7ca},_0x46ce80=_0x3d5d32,_0x390a11=_0x23ac80[_0x46ce80(0x1da)],_0x2ed15d=_0x23ac80['endPosition'],_0x43df3f=new Cesium__namespace[(_0x46ce80(_0x4ff570._0x54d456))]['multiplyByPoint'](this['_map']['camera']['viewMatrix'],this[_0x46ce80(0xb69)],new Cesium__namespace[(_0x46ce80(_0x4ff570._0x79c5e6))]()),_0x5616b2=-_0x43df3f['z']*Math['tan'](this['_map']['camera']['frustum'][_0x46ce80(0x742)]/0x2)*0x2;let _0xbb55af=_0x5616b2/this['_map']['canvas']['width'];const _0x44c57a=new Cesium__namespace['Cartesian3'](0x1,0x1,0x1);let _0xa2d84d;const _0xb0a57=this['_graphic'][_0x46ce80(0xe12)]['type'];_0xb0a57===Cesium__namespace['Axis']['Z']&&(_0x44c57a['z']=0x0,_0xa2d84d=Cesium__namespace[_0x46ce80(0xe95)]['angleBetween'](Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['matrix'],new Cesium__namespace[(_0x46ce80(_0x4ff570._0x5257b0))](0x0,0x0,0x1),new Cesium__namespace['Cartesian3']()),this['_map']['camera']['direction']));_0xb0a57===Cesium__namespace[_0x46ce80(_0x4ff570._0x27cdd0)]['X']&&(_0x44c57a['y']=0x0,_0xa2d84d=Cesium__namespace['Cartesian3']['angleBetween'](Cesium__namespace[_0x46ce80(_0x4ff570._0x42cc9f)]['multiplyByPointAsVector'](this[_0x46ce80(_0x4ff570._0x3b40b0)],new Cesium__namespace['Cartesian3'](0x0,0x1,0x0),new Cesium__namespace['Cartesian3']()),this['_map']['camera'][_0x46ce80(0xe36)]));_0xb0a57===Cesium__namespace['Axis']['Y']&&(_0x44c57a['x']=0x0,_0xa2d84d=Cesium__namespace[_0x46ce80(0xe95)]['angleBetween'](Cesium__namespace['Matrix4'][_0x46ce80(0xd06)](this[_0x46ce80(0xa79)],new Cesium__namespace['Cartesian3'](0x1,0x0,0x0),new Cesium__namespace['Cartesian3']()),this['_map'][_0x46ce80(_0x4ff570._0x4367ae)]['direction']));Math['abs'](_0xa2d84d-Math['PI']/0x2)<0.1&&(_0xbb55af=0x1,_0x43df3f['z']=0x0);let _0x1f2984=new Cesium__namespace['Cartesian3']((_0x390a11['x']-this['_map']['canvas']['width']/0x2)*_0xbb55af,(-_0x390a11['y']+this[_0x46ce80(0x1d1)][_0x46ce80(_0x4ff570._0xc0cf9f)]['height']/0x2)*_0xbb55af,_0x43df3f['z']),_0x1ed448=new Cesium__namespace[(_0x46ce80(_0x4ff570._0x76b548))]((_0x2ed15d['x']-this[_0x46ce80(0x1d1)]['canvas']['width']/0x2)*_0xbb55af,(-_0x2ed15d['y']+this[_0x46ce80(_0x4ff570._0x6c9fd7)]['canvas'][_0x46ce80(_0x4ff570._0x2f1a17)]/0x2)*_0xbb55af,_0x43df3f['z']);Cesium__namespace[_0x46ce80(0xf5d)][_0x46ce80(_0x4ff570._0x45104d)](this['_map']['camera']['inverseViewMatrix'],_0x1f2984,_0x1f2984),Cesium__namespace['Matrix4'][_0x46ce80(0xc9f)](this['_map']['camera']['inverseViewMatrix'],_0x1ed448,_0x1ed448),Cesium__namespace['Matrix4']['multiplyByPoint'](this['inverseMatrix'],_0x1f2984,_0x1f2984),Cesium__namespace['Matrix4']['multiplyByPoint'](this['inverseMatrix'],_0x1ed448,_0x1ed448),_0x1f2984=new Cesium__namespace['Cartesian3'](_0x1f2984['x']*_0x44c57a['x'],_0x1f2984['y']*_0x44c57a['y'],_0x1f2984['z']*_0x44c57a['z']),_0x1ed448=new Cesium__namespace[(_0x46ce80(_0x4ff570._0x2e378d))](_0x1ed448['x']*_0x44c57a['x'],_0x1ed448['y']*_0x44c57a['y'],_0x1ed448['z']*_0x44c57a['z']),_0xa2d84d=Cesium__namespace['Cartesian3'][_0x46ce80(0x97f)](_0x1f2984,_0x1ed448);let _0x1d6778;if(_0xb0a57===Cesium__namespace['Axis']['Z']){const _0x3973c5=_0x1f2984['x']*_0x1ed448['y']-_0x1f2984['y']*_0x1ed448['x'];_0x1d6778=Cesium__namespace[_0x46ce80(_0x4ff570._0x54d456)][_0x46ce80(0xd06)](this['worldToModel'],this[_0x46ce80(_0x4ff570._0x9d1341)],new Cesium__namespace['Cartesian3']()),_0x3973c5>0x0&&(_0xa2d84d=-_0xa2d84d),this['heading']=(this['heading']+Cesium__namespace[_0x46ce80(0x103e)]['toDegrees'](_0xa2d84d))%0x168;}else{if(_0xb0a57===Cesium__namespace['Axis']['X']){const _0xcb8e79=_0x1f2984['x']*_0x1ed448['z']-_0x1f2984['z']*_0x1ed448['x'];_0x1d6778=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],this['normalY'],new Cesium__namespace['Cartesian3']()),_0xcb8e79>0x0&&(_0xa2d84d=-_0xa2d84d),this['pitch']=(this[_0x46ce80(0x5cf)]+Cesium__namespace['Math']['toDegrees'](_0xa2d84d))%0x168;}else{if(_0xb0a57===Cesium__namespace['Axis']['Y']){const _0x21bdf1=_0x1f2984['y']*_0x1ed448['z']-_0x1f2984['z']*_0x1ed448['y'];_0x1d6778=Cesium__namespace['Matrix4']['multiplyByPointAsVector'](this['worldToModel'],this[_0x46ce80(_0x4ff570._0x21d3e6)],new Cesium__namespace[(_0x46ce80(_0x4ff570._0x3b3bbc))]()),_0x21bdf1<0x0&&(_0xa2d84d=-_0xa2d84d),this['roll']=(this['roll']+Cesium__namespace[_0x46ce80(_0x4ff570._0x5b61fa)]['toDegrees'](_0xa2d84d))%0x168;}}}const _0x42c279=Cesium__namespace['Matrix3']['inverse'](this['rotateMatrix'],new Cesium__namespace['Matrix3']()),_0x2edf74=Cesium__namespace[_0x46ce80(_0x4ff570._0x41ee2e)]['multiplyByVector'](_0x42c279,_0x1d6778,new Cesium__namespace['Cartesian3']()),_0x5cce18=this['_axisRotation'](_0x2edf74,_0xa2d84d);Cesium__namespace['Matrix3']['multiply'](this['rotateMatrix'],_0x5cce18,this['rotateMatrix']);const _0x5a1211={..._0x23ac80,'editType':_0xb0a57,'position':this['position'],'heading':this['heading'],'pitch':this['pitch'],'roll':this[_0x46ce80(0x952)]};this[_0x46ce80(_0x4ff570._0xdd40d7)](_0x5a1211);}['_onMap_middleClick'](_0xf65b3){}}class EditBase{constructor(_0x236687){const _0x41c4d6=_0x3d5d32;this['_graphic']=_0x236687,this['_map']=_0x236687[_0x41c4d6(0x1d1)],this['draggers']=[];}get['enabled'](){return this['_enabled'];}get['map'](){return this['_map'];}get['layer'](){const _0x22b7f9={_0x3d9ab9:0x873},_0x36d26c=_0x3d5d32;return this['_graphic'][_0x36d26c(_0x22b7f9._0x3d9ab9)];}get['style'](){return this['_graphic']['style'];}get[_0x3d5d32(0x7c0)](){const _0x316ce3={_0x168de2:0xdde},_0x5b30d1=_0x3d5d32;var _0x1ff681,_0x48eb30;return(_0x1ff681=this['_graphic'])===null||_0x1ff681===void 0x0?void 0x0:(_0x48eb30=_0x1ff681[_0x5b30d1(_0x316ce3._0x168de2)])===null||_0x48eb30===void 0x0?void 0x0:_0x48eb30['clampToGround'];}get['type'](){const _0x496efe={_0x48ad45:0x6cc},_0xd6971=_0x3d5d32;return this[_0xd6971(_0x496efe._0x48ad45)]['type'];}get['entityGraphic'](){const _0x5a5c06={_0x3bb0ba:0x6cc,_0x2e7a36:0xa09},_0x1c8134=_0x3d5d32;return this[_0x1c8134(_0x5a5c06._0x3bb0ba)][_0x1c8134(_0x5a5c06._0x2e7a36)];}set['positions'](_0x2aab3d){this['_graphic']['_positions_draw']=_0x2aab3d;}get['positions'](){const _0x1ef9ac=_0x3d5d32;return this[_0x1ef9ac(0x6cc)]['_positions_draw']||this['_graphic'][_0x1ef9ac(0x924)]||[];}get['hasRotateMatrix'](){const _0x5c2e56=_0x3d5d32;return Boolean(this[_0x5c2e56(0x215)]);}get['hasMoveMatrix'](){const _0x3d4cf0={_0x24bae7:0xedb},_0x2e90e2=_0x3d5d32;return Boolean(this[_0x2e90e2(_0x3d4cf0._0x24bae7)]);}['fire'](_0x5642c6,_0x40e97d={},_0x3b882f=!![]){const _0x3d9d45={_0x5e53:0x6cc},_0x3b448c=_0x3d5d32;if(this[_0x3b448c(_0x3d9d45._0x5e53)]){const _0x559a48=this['_graphic']['parent'];_0x40e97d['editType']=this['type'],this['_graphic']['fire'](_0x5642c6,_0x40e97d,_0x3b882f),_0x559a48&&(_0x40e97d[_0x3b448c(0x497)]=_0x559a48['type'],_0x559a48['fire'](_0x5642c6,_0x40e97d,_0x3b882f));}}['formatNum'](_0x1d6ccd,_0x5dde96){return formatNum$1(_0x1d6ccd,_0x5dde96);}['activate'](){const _0x13007d={_0x103766:0x6cc,_0x419816:0xd56},_0x518a11=_0x3d5d32;if(this['_enabled'])return this;return this[_0x518a11(0x86e)]=!![],this['_graphic']['_setPositionsToCallback']&&this[_0x518a11(_0x13007d._0x103766)][_0x518a11(_0x13007d._0x419816)](),this[_0x518a11(0x483)](),this['bindDraggers'](),this['bindEvent'](),this['fire'](EventType['editStart']),this;}['disable'](){const _0x4f700d={_0x1709cb:0x86e,_0x4e29cb:0x518,_0x5759c1:0x873,_0x49ad8b:0xf27},_0x4725c9=_0x3d5d32;var _0x4a4187,_0x2c888b,_0x1aa0aa;if(!this[_0x4725c9(_0x4f700d._0x1709cb)])return this;return this['_enabled']=![],this[_0x4725c9(_0x4f700d._0x4e29cb)](),this[_0x4725c9(0x887)](),this['unbindEvent'](),this['destroyDraggers'](),this['finish'](),(_0x4a4187=this['_graphic'])!==null&&_0x4a4187!==void 0x0&&(_0x2c888b=_0x4a4187[_0x4725c9(_0x4f700d._0x5759c1)])!==null&&_0x2c888b!==void 0x0&&(_0x1aa0aa=_0x2c888b['options'])!==null&&_0x1aa0aa!==void 0x0&&_0x1aa0aa[_0x4725c9(_0x4f700d._0x49ad8b)]&&this['_graphic']['_cancelPositionsCallback'](),this['fire'](EventType[_0x4725c9(0x8d6)]),this;}['finish'](){}[_0x3d5d32(0xd75)](){const _0x2c56d5={_0x2cbc98:0x1d1},_0x33ad69=_0x3d5d32;this[_0x33ad69(_0x2c56d5._0x2cbc98)]['on'](EventType[_0x33ad69(0x91b)],this['_onLeftDownHandler'],this),this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['leftUp'],this['_onLeftUpHandler'],this);}['unbindEvent'](){const _0x5037d1={_0x23ee1b:0x314,_0x480568:0xccc,_0x347c62:0xf7c,_0x4beee6:0x6cc},_0x3210bb=_0x3d5d32;this[_0x3210bb(0x1d1)]['off'](EventType['leftDown'],this['_onLeftDownHandler'],this),this[_0x3210bb(0x1d1)]['off'](EventType[_0x3210bb(_0x5037d1._0x23ee1b)],this['_onMouseMoveHandler'],this),this['_map'][_0x3210bb(0x9e7)](EventType['leftUp'],this['_onLeftUpHandler'],this),this['_hasChangeEnableInputs']&&(this['_map']['scene'][_0x3210bb(_0x5037d1._0x480568)]['enableInputs']=!![],delete this['_hasChangeEnableInputs']),this['_map'][_0x3210bb(_0x5037d1._0x347c62)](![]),!this[_0x3210bb(_0x5037d1._0x4beee6)]['show']&&(this['_graphic']['show']=!![]);}['_onLeftDownHandler'](_0x5cebe2){const _0x4ae85a={_0x424802:0x1d1,_0x394287:0x1d1,_0xe569a6:0xfc1,_0x5d996f:0x433,_0x2c143b:0xe38},_0x12940d=_0x3d5d32,_0x345318=this[_0x12940d(_0x4ae85a._0x424802)]['mouseEvent']['getPickTarget'](_0x5cebe2[_0x12940d(0xb69)],_0x5cebe2);if(_0x345318[_0x12940d(0x548)]!==this['layer'])return;const _0x192e6e=_0x345318===null||_0x345318===void 0x0?void 0x0:_0x345318[_0x12940d(0x328)];if(!_0x192e6e||!_0x192e6e['_isDragger'])return;this['_map']['scene'][_0x12940d(0xccc)]['enableInputs']&&(this[_0x12940d(_0x4ae85a._0x394287)][_0x12940d(_0x4ae85a._0xe569a6)]['screenSpaceCameraController']['enableInputs']=![],this['_hasChangeEnableInputs']=!![]),this['_map']['_setEditCursor'](!![]),_0x192e6e['_closeAllControl'](),this['_draggerIng']=_0x192e6e,this['_draggerIng']['show']=_0x192e6e[_0x12940d(_0x4ae85a._0x5d996f)]['drawShow']??![],_0x192e6e[_0x12940d(0x9ab)]&&_0x192e6e[_0x12940d(0x9ab)](_0x192e6e,_0x345318[_0x12940d(0x4c1)]||_0x192e6e['position']),this['fire'](EventType['editMouseDown'],{..._0x5cebe2,..._0x345318,'index':this[_0x12940d(_0x4ae85a._0x2c143b)]['index']});}['_onMouseMoveHandler'](_0xd11504){const _0x268025={_0x2f4f18:0x621},_0x55181b=_0x3d5d32;this['_draggerIng']?this[_0x55181b(_0x268025._0x2f4f18)](_0xd11504):this['_onMouseMoveMapHandler'](_0xd11504);}['_onMouseMoveDraggerHandler'](_0x7200c7){const _0x20819e={_0x291991:0xe38,_0x837a6e:0x4f8,_0x48b8d6:0xfc1,_0x19c1f6:0xe95,_0xac3d3d:0xac3,_0x1d57e2:0xefc,_0x377027:0x930,_0x246217:0x1d1,_0x5548fb:0xd1b,_0x4c1d13:0xfc1,_0x1495ec:0x1ff,_0x452734:0xeda,_0x1d248e:0xe38,_0x1512f1:0xefc},_0x5202c4=_0x3d5d32;let _0x355925;switch(this[_0x5202c4(_0x20819e._0x291991)]['_pointType']){case PointType['MoveHeight']:{var _0x1b3999;const _0x381a97=_0x7200c7[_0x5202c4(0xd13)]['y']-_0x7200c7['startPosition']['y'],_0x3b10ff=getPositionValue(this['_draggerIng']['position'],(_0x1b3999=this['_map'])===null||_0x1b3999===void 0x0?void 0x0:_0x1b3999['clock'][_0x5202c4(_0x20819e._0x837a6e)]),_0x47da66=new Cesium__namespace['EllipsoidTangentPlane'](_0x3b10ff),_0x2ecf61=new Cesium__namespace[(_0x5202c4(0xbd8))](),_0x45c2be=new Cesium__namespace['Cartesian3']();_0x2ecf61['center']=_0x3b10ff,_0x2ecf61[_0x5202c4(0xd61)]=0x1;const _0x43a607=this['_map']['scene']['frameState']['camera']['getPixelSize'](_0x2ecf61,this['_map'][_0x5202c4(_0x20819e._0x48b8d6)]['frameState']['context']['drawingBufferWidth'],this['_map']['scene']['frameState']['context']['drawingBufferHeight'])*1.5;Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x47da66['zAxis'],-_0x381a97*_0x43a607,_0x45c2be),_0x355925=Cesium__namespace['Cartesian3'][_0x5202c4(0x315)](_0x3b10ff),Cesium__namespace[_0x5202c4(_0x20819e._0x19c1f6)]['add'](_0x3b10ff,_0x45c2be,_0x355925),this['_draggerIng']['position']=_0x355925;this['_draggerIng']['onDrag']&&this['_draggerIng'][_0x5202c4(0xeda)](this[_0x5202c4(0xe38)],_0x355925,_0x3b10ff);this[_0x5202c4(_0x20819e._0xac3d3d)](),this[_0x5202c4(_0x20819e._0x1d57e2)](EventType[_0x5202c4(_0x20819e._0x377027)],_0x7200c7);break;}default:{this[_0x5202c4(_0x20819e._0x246217)]['openSmallTooltip'](_0x7200c7['endPosition'],this['_map'][_0x5202c4(_0x20819e._0x5548fb)]('_释放后完成修改'));let _0x3f4bc2=this[_0x5202c4(0x6cc)]['_entity'];this['clampToGround']&&(_0x3f4bc2=null);_0x355925=getCurrentMousePosition(this['_map'][_0x5202c4(_0x20819e._0x4c1d13)],_0x7200c7['endPosition'],_0x3f4bc2);if(_0x355925){if(this['_graphic']['options']['validDrawPosition']){const _0x98bdd7=this['_graphic'][_0x5202c4(0x433)][_0x5202c4(_0x20819e._0x1495ec)](_0x355925,this['_graphic']);if(!_0x98bdd7)return;}this['_draggerIng']['position']=_0x355925,this['_draggerIng'][_0x5202c4(_0x20819e._0x452734)]&&this[_0x5202c4(_0x20819e._0x291991)]['onDrag'](this[_0x5202c4(_0x20819e._0x1d248e)],_0x355925),this['updateAttrForEditing']();}}break;}this[_0x5202c4(_0x20819e._0x1512f1)](EventType['editMouseMove'],{..._0x7200c7,'index':this['_draggerIng']['index'],'cartesian':_0x355925,'windowPosition':_0x7200c7[_0x5202c4(0xd13)]});}['_onMouseMoveMapHandler'](_0x5a0982){const _0x52305b={_0xf02d92:0x1d1,_0x2f2032:0xdb6},_0x1adb39=_0x3d5d32;var _0x51be9e,_0x20bd52;const _0x54c211=this[_0x1adb39(0x1d1)]['mouseEvent']['getPickTarget'](_0x5a0982['endPosition'],_0x5a0982),_0x119739=_0x54c211===null||_0x54c211===void 0x0?void 0x0:_0x54c211['graphic'];if(_0x119739==null){this[_0x1adb39(_0x52305b._0xf02d92)]['closeSmallTooltip']();return;}if(_0x54c211['layer']!==this['layer']||!_0x119739[_0x1adb39(0xae0)])return;if(this['_map']['contextmenu']['show']&&this['_map']['contextmenu'][_0x1adb39(0x2eb)]===_0x119739)return;let _0x42608b=_0x119739['_draw_tooltip'];if(!_0x42608b)return;PointType[_0x1adb39(_0x52305b._0x2f2032)]===_0x119739['_pointType']&&((_0x51be9e=this['_graphic'])===null||_0x51be9e===void 0x0?void 0x0:(_0x20bd52=_0x51be9e['_positions_draw'])===null||_0x20bd52===void 0x0?void 0x0:_0x20bd52['length'])>this[_0x1adb39(0x6cc)]['_minPointNum']&&(_0x42608b+='
'+this[_0x1adb39(0x1d1)]['getLangText']('_右击删除点')),this['_map']['openSmallTooltip'](_0x5a0982['endPosition'],_0x42608b);}['_onLeftUpHandler'](_0x54475e){const _0x21364e={_0x30e113:0xe38,_0x477e17:0xa70},_0x41e187=_0x3d5d32;var _0x20b595;if(!this['_draggerIng'])return;this['_draggerIng'][_0x41e187(0x792)]=!![];const _0x8655d6=getPositionValue(this['_draggerIng']['position'],(_0x20b595=this['_map'])===null||_0x20b595===void 0x0?void 0x0:_0x20b595[_0x41e187(0x9f4)]['currentTime']),_0x318efe=this['_draggerIng']['index'];this[_0x41e187(_0x21364e._0x30e113)]['onDragEnd']&&this['_draggerIng']['onDragEnd'](this['_draggerIng'],_0x8655d6),this['updateAttrForEditing'](),this['fire'](EventType['editMovePoint'],{..._0x54475e,'index':_0x318efe,'cartesian':_0x8655d6}),this['_draggerIng']=null,this['_map']['_setEditCursor'](![]),this['_hasChangeEnableInputs']&&(this['_map']['scene']['screenSpaceCameraController']['enableInputs']=!![],delete this[_0x41e187(_0x21364e._0x477e17)]);}['openSmallTooltipByMinPointNum'](_0x2fdeb0){const _0x1fadc3={_0x543776:0xd86},_0x39d32a=_0x3d5d32;this['_map'][_0x39d32a(_0x1fadc3._0x543776)](_0x2fdeb0,this['_map']['getLangText'](_0x39d32a(0x5f1))+'\x20'+this[_0x39d32a(0x6cc)]['_minPointNum']);}['createDragger'](_0x5e353a){const _0x4b0d90={_0x26ee92:0x6cc,_0x1f8d3c:0x548,_0x4961e5:0x682,_0x56d44b:0x3cb,_0x5768e1:0x1d1,_0x54499b:0xb44,_0x2fd68a:0xc49,_0x27f255:0x1d1,_0x54a516:0x2a4},_0x15680f=_0x3d5d32;let _0x5cfd2c;return _0x5e353a['dragger']?_0x5cfd2c=_0x5e353a['dragger']:(_0x5cfd2c=new PointPrimitive({'position':_0x5e353a['position']??Cesium__namespace['Cartesian3'][_0x15680f(0x61a)],'style':getEditPointStyle(_0x5e353a['type']),'hasEdit':![],'private':!![]}),_0x5cfd2c['parent']=this[_0x15680f(_0x4b0d90._0x26ee92)],this[_0x15680f(_0x4b0d90._0x1f8d3c)][_0x15680f(_0x4b0d90._0x4961e5)](_0x5cfd2c)),_0x5cfd2c[_0x15680f(_0x4b0d90._0x56d44b)]=this[_0x15680f(_0x4b0d90._0x5768e1)]['getLangText']('_拖动该点后')+'\x20'+(_0x5e353a['tooltip']||this['_map']['getLangText']('_修改位置')),_0x5cfd2c['_isDragger']=!![],_0x5cfd2c[_0x15680f(_0x4b0d90._0x54499b)]=!![],_0x5cfd2c[_0x15680f(0xc49)]=_0x5e353a['type']||PointType['Control'],_0x5cfd2c['onDragStart']=_0x5e353a['onDragStart'],_0x5cfd2c['onDrag']=_0x5e353a['onDrag'],_0x5cfd2c['onDragEnd']=_0x5e353a['onDragEnd'],(_0x5cfd2c[_0x15680f(0xc49)]===PointType['Control']||_0x5cfd2c[_0x15680f(_0x4b0d90._0x2fd68a)]===PointType[_0x15680f(0x956)])&&(this[_0x15680f(0x6cc)]['options'][_0x15680f(0x611)]??!![])&&(_0x5cfd2c[_0x15680f(_0x4b0d90._0x56d44b)]+=_0x15680f(0x231)+this[_0x15680f(_0x4b0d90._0x27f255)][_0x15680f(0xd1b)](_0x15680f(_0x4b0d90._0x54a516)),_0x5cfd2c['bindContextMenu'](this['getDraggerContextMenu'](_0x5cfd2c))),_0x5cfd2c;}[_0x3d5d32(0xbc8)](){}['destroyDraggers'](){const _0x5c6e7d={_0x5f39cf:0x548},_0x2c88df=_0x3d5d32;for(let _0xb36d1e=0x0,_0x1ec590=this['draggers']['length'];_0xb36d1e<_0x1ec590;_0xb36d1e++){this[_0x2c88df(_0x5c6e7d._0x5f39cf)]['removeGraphic'](this['draggers'][_0xb36d1e],!![]);}this['draggers']=[];}['updateDraggers'](){const _0x97c16c={_0x2432ed:0x483,_0x1a2901:0xbc8,_0x4e2387:0xc49,_0x598db0:0x956},_0x4c6ae9=_0x3d5d32;var _0x3cf58e;if(!this['_enabled'])return this;const _0x304cad=(_0x3cf58e=this['_matrixMove'])===null||_0x3cf58e===void 0x0?void 0x0:_0x3cf58e['_dragger_index'];this[_0x4c6ae9(_0x97c16c._0x2432ed)](),this[_0x4c6ae9(_0x97c16c._0x1a2901)]();if(Cesium__namespace['defined'](_0x304cad))for(let _0x1b5c9c=0x0,_0x1bd389=this[_0x4c6ae9(0x93f)]['length'];_0x1b5c9c<_0x1bd389;_0x1b5c9c++){const _0x27669d=this[_0x4c6ae9(0x93f)][_0x1b5c9c];if(_0x27669d['_pointType']!==PointType['Control']&&_0x27669d[_0x4c6ae9(_0x97c16c._0x4e2387)]!==PointType[_0x4c6ae9(_0x97c16c._0x598db0)])continue;if(_0x27669d[_0x4c6ae9(0x5f9)]===_0x304cad){this['startMoveMatrix'](_0x27669d);break;}}}['updateAttrForEditing'](){const _0x31374b={_0x5c9810:0xf22,_0x5e60a8:0xf22},_0x17c4c5=_0x3d5d32;this['_graphic'][_0x17c4c5(_0x31374b._0x5c9810)]&&this['_graphic'][_0x17c4c5(_0x31374b._0x5e60a8)](!![]),this['_graphic']['_updateLabelPosition']&&this[_0x17c4c5(0x6cc)]['_updateLabelPosition']();}[_0x3d5d32(0x8ae)](_0x378201){const _0x8d09b1={_0x196a72:0x5fb},_0x1f1dc2={_0x2eccd8:0x970},_0x1e02a3={_0x3f6e2f:0x5f9},_0x45bfb4={_0x3dde06:0x6cc,_0x13a154:0x8c0},_0x54c988={_0x326dbb:0x6cc,_0x47aee3:0xab2},_0x5edcdf=_0x3d5d32;return[{'text':this['_map']['getLangText']('_停止编辑'),'icon':Icon[_0x5edcdf(0xab7)],'show':_0x1628f5=>{var _0x180ace;return(_0x180ace=this['_graphic'])===null||_0x180ace===void 0x0?void 0x0:_0x180ace['isEditing'];},'callback':_0x351359=>{this['_graphic']['stopEditing']();}},{'text':this['_map']['getLangText'](_0x5edcdf(0x205)),'icon':Icon[_0x5edcdf(0xa39)],'show':_0xaca85e=>{const _0x44b7b2=_0x5edcdf;var _0x3d27f8;if(!((_0x3d27f8=this['_graphic'])!==null&&_0x3d27f8!==void 0x0&&_0x3d27f8['_positions_draw'])||_0x378201[_0x44b7b2(0xc49)]===PointType['MoveAll'])return![];if(this[_0x44b7b2(_0x54c988._0x326dbb)]['_positions_draw']['length']-0x1{const _0x246bc1=_0x5edcdf,_0x475034=_0x2e12df['graphic'];if(_0x475034){const _0x3f3736=_0x475034['index'];_0x3f3736>=0x0&&_0x3f3736{const _0xb5a6f7=_0x5edcdf;return!this[_0xb5a6f7(0xedb)]||this['_matrixMove'][_0xb5a6f7(0x970)]!==_0x378201[_0xb5a6f7(_0x1e02a3._0x3f6e2f)];},'callback':_0x27affa=>{var _0x5c1eb6;const _0xb34fd8=(_0x5c1eb6=_0x27affa['graphic'])!==null&&_0x5c1eb6!==void 0x0&&_0x5c1eb6['position']?_0x27affa['graphic']:_0x27affa['layer'];this['startMoveMatrix'](_0xb34fd8,_0x27affa);}},{'text':this['_map']['getLangText']('_停止按轴平移'),'icon':Icon['DrawEditNo'],'show':_0x420acd=>{const _0x2baa13=_0x5edcdf;return this['_matrixMove']&&this['_matrixMove'][_0x2baa13(_0x1f1dc2._0x2eccd8)]===_0x378201['index'];},'callback':_0x15c543=>{const _0xabf4cb=_0x5edcdf;this[_0xabf4cb(0x518)]();}}];}[_0x3d5d32(0x7b3)](_0x1856d2){const _0x567d4e={_0x54e884:0xb84,_0x21ff42:0x887},_0x2710fb=_0x3d5d32;Cesium__namespace[_0x2710fb(_0x567d4e._0x54e884)](_0x1856d2[_0x2710fb(0x7c0)])&&(this['stopMoveMatrix'](),this[_0x2710fb(_0x567d4e._0x21ff42)](),this['updateDraggers']());}[_0x3d5d32(0x5ad)](_0x20381c,_0x22e4f9){const _0x2251d4={_0x35d95b:0x5f9},_0x5b630b=_0x3d5d32;this['fire'](EventType['editAddPoint'],{'index':_0x20381c[_0x5b630b(_0x2251d4._0x35d95b)],'cartesian':_0x22e4f9});}['startMoveMatrix'](_0x4377ac,_0x1b71e6={}){const _0x33dff6={_0x2231d0:0xedb,_0x1fa7fa:0xea4,_0xcff737:0x7c0,_0xede8d9:0xc8a,_0x5aedf0:0x970,_0x454d28:0x886,_0x3338b3:0x3e8,_0x2d418e:0xfc9},_0x180142={_0x3a1ea2:0xedb,_0x5919a2:0x70d,_0x344035:0xeda},_0x1e099a={_0xf1233c:0x9ab,_0x51305b:0xb69},_0x2f095a=_0x3d5d32;this['stopMoveMatrix'](),this[_0x2f095a(0x887)]();!_0x4377ac&&(_0x4377ac=this['_graphic']);let _0x3d8c17=_0x4377ac['positionShow']||_0x4377ac[_0x2f095a(0xb69)];this['clampToGround']&&(_0x3d8c17=getSurfacePosition(this['_map']['scene'],_0x3d8c17)),this['_matrixMove']=new MatrixMove({'position':_0x3d8c17}),this['_map']['addThing'](this['_matrixMove']),this[_0x2f095a(_0x33dff6._0x2231d0)]['_graphicLayer'][_0x2f095a(_0x33dff6._0x1fa7fa)]([{'text':this['_map']['getLangText']('_停止按轴平移'),'icon':Icon['DrawEditNo'],'show':_0x26f75e=>{return this['_matrixMove'];},'callback':_0x15d248=>{this['stopMoveMatrix']();}}]),this[_0x2f095a(_0x33dff6._0xcff737)]&&this['_matrixMove'][_0x2f095a(_0x33dff6._0xede8d9)]&&(this[_0x2f095a(_0x33dff6._0x2231d0)]['_graphic_move_z']['show']=![]),this['_matrixMove'][_0x2f095a(_0x33dff6._0x5aedf0)]=_0x4377ac['index'],this['_matrixMove']['on'](EventType[_0x2f095a(0xf6d)],_0x4263e6=>{const _0x41791e=_0x2f095a;_0x4377ac[_0x41791e(_0x1e099a._0xf1233c)]&&_0x4377ac['onDragStart'](_0x4377ac,this['_matrixMove'][_0x41791e(_0x1e099a._0x51305b)]);}),this[_0x2f095a(_0x33dff6._0x2231d0)]['on'](EventType[_0x2f095a(_0x33dff6._0x454d28)],_0x542636=>{const _0x2c3d67=_0x2f095a;_0x4377ac['onDragEnd']?_0x4377ac['onDragEnd'](_0x4377ac,this['_matrixMove']['position'],_0x542636):_0x4377ac['position']=this['_matrixMove']['position'],_0x4377ac['fire'](EventType['updatePosition'],{'position':this[_0x2c3d67(0xedb)]['position']}),this['fire'](EventType[_0x2c3d67(0x655)],{..._0x1b71e6,..._0x542636,'index':_0x4377ac['index'],'cartesian':_0x3d8c17});}),this['_matrixMove']['on'](EventType['change'],_0x3e117b=>{const _0x5e2209=_0x2f095a;var _0x1baa5d;const _0xa4f359=this[_0x5e2209(_0x180142._0x3a1ea2)]['position'];if(_0x4377ac['isPrivate'])_0x4377ac['position']=_0xa4f359;else Cesium__namespace['defined']((_0x1baa5d=this['_graphic'])===null||_0x1baa5d===void 0x0?void 0x0:_0x1baa5d['_position_draw'])?this['_graphic'][_0x5e2209(_0x180142._0x5919a2)]=_0xa4f359:_0x4377ac['position']=_0xa4f359;if(_0x3e117b[_0x5e2209(0x497)]===Cesium__namespace['Axis']['Z']&&this['_updateHeight']){const _0x638b9a=Cesium__namespace['Cartographic'][_0x5e2209(0xd14)](_0xa4f359)['height'];this[_0x5e2209(0x83c)](_0x638b9a);}else _0x4377ac[_0x5e2209(_0x180142._0x344035)]&&_0x4377ac['onDrag'](_0x4377ac,_0xa4f359);this['updateAttrForEditing'](),this['fire'](EventType['editMouseMove'],{..._0x1b71e6,..._0x3e117b,'index':_0x4377ac['index'],'cartesian':_0xa4f359});}),_0x4377ac['off'](EventType[_0x2f095a(_0x33dff6._0x3338b3)],this[_0x2f095a(0xb54)],this),_0x4377ac['off'](EventType['updatePosition'],this[_0x2f095a(_0x33dff6._0x2d418e)],this),_0x4377ac['on'](EventType['updatePosition'],this['_updateMatrixMovePosition'],this);}['_updateMatrixMovePosition'](_0x398371){const _0x14a230={_0x4cd0f0:0xedb,_0x563554:0x970},_0x3c020d=_0x3d5d32;var _0x5a1335;if(!this[_0x3c020d(_0x14a230._0x4cd0f0)]||this['_matrixMove']['isMoveing']||!_0x398371['position']||this['_matrixMove'][_0x3c020d(_0x14a230._0x563554)]!==((_0x5a1335=_0x398371['graphic'])===null||_0x5a1335===void 0x0?void 0x0:_0x5a1335['index']))return;this['_matrixMove']['position']=_0x398371['position'];}['stopMoveMatrix'](){const _0x2614ee={_0x2b3322:0xedb},_0x3b6807=_0x3d5d32;this['_matrixMove']&&(this['_map']['removeThing'](this[_0x3b6807(_0x2614ee._0x2b3322)],!![]),delete this['_matrixMove']);}[_0x3d5d32(0xd5c)](_0x113d39){const _0x589b70={_0x42b85b:0xe39,_0x5a9974:0x1d1,_0xe9f81e:0x215,_0x49536c:0xdf9,_0x303e4f:0x73d,_0x4a5c30:0x9e7},_0xa597ac=_0x3d5d32;this['stopMoveMatrix'](),this[_0xa597ac(0x887)](),!_0x113d39&&(_0x113d39=this['_graphic']),this[_0xa597ac(0x215)]=new MatrixRotate({'position':_0x113d39['positionShow']||_0x113d39['position'],'heading':this['style'][_0xa597ac(_0x589b70._0x42b85b)]||0x0,'pitch':this['style']['pitch']||0x0,'roll':this['style'][_0xa597ac(0x952)]||0x0}),this[_0xa597ac(_0x589b70._0x5a9974)]['addThing'](this[_0xa597ac(_0x589b70._0xe9f81e)]),this['_matrixRotate']['_graphicLayer']['bindContextMenu']([{'text':this['_map']['getLangText']('_停止按轴旋转'),'icon':Icon[_0xa597ac(_0x589b70._0x49536c)],'show':_0x54477c=>{return this['_matrixRotate'];},'callback':_0x4c630e=>{this['stopRotateMatrix']();}}]),this[_0xa597ac(_0x589b70._0xe9f81e)]['on'](EventType[_0xa597ac(_0x589b70._0x303e4f)],_0x468bb7=>{const _0x57ed5a=_0xa597ac;this['style']['heading']=formatNum$1(_0x468bb7['heading'],0x2),this['style']['pitch']=formatNum$1(_0x468bb7['pitch'],0x2),this[_0x57ed5a(0xdde)]['roll']=formatNum$1(_0x468bb7[_0x57ed5a(0x952)],0x2),this['_graphic']['updateOrientation'](),this['fire'](EventType[_0x57ed5a(0x930)]);}),_0x113d39[_0xa597ac(_0x589b70._0x4a5c30)](EventType['updatePosition'],this['_updateMatrixMovePosition'],this),_0x113d39[_0xa597ac(0x9e7)](EventType['updatePosition'],this['_updateMatrixRotatePosition'],this),_0x113d39['on'](EventType['updatePosition'],this['_updateMatrixRotatePosition'],this);}['_updateMatrixRotatePosition'](_0x2c8d88){const _0x5554d5={_0x1f65a9:0xb69,_0x4f3387:0x215},_0xec2d66=_0x3d5d32;var _0x397841;if(!this['_matrixRotate']||this['_matrixRotate'][_0xec2d66(0x44f)]||!_0x2c8d88[_0xec2d66(_0x5554d5._0x1f65a9)]||this['_matrixRotate']['_dragger_index']!==((_0x397841=_0x2c8d88['graphic'])===null||_0x397841===void 0x0?void 0x0:_0x397841['index']))return;this[_0xec2d66(_0x5554d5._0x4f3387)][_0xec2d66(_0x5554d5._0x1f65a9)]=_0x2c8d88['position'];}['stopRotateMatrix'](){const _0xdd133b=_0x3d5d32;this['_matrixRotate']&&(this[_0xdd133b(0x1d1)][_0xdd133b(0x1081)](this[_0xdd133b(0x215)],!![]),delete this['_matrixRotate']);}[_0x3d5d32(0x689)](){this['disable']();for(const _0x3ff62d in this){delete this[_0x3ff62d];}}}class EditPoint extends EditBase{['bindDraggers'](){this['createDragger']({'dragger':this['_graphic'],'onDrag':(_0x457a87,_0x19f84c)=>{this['_graphic']['_position_draw']=_0x19f84c;}});}[_0x3d5d32(0xc00)](){const _0x87894a={_0x1bfa69:0x6cc,_0x406720:0xeda},_0x5b0de4=_0x3d5d32;delete this[_0x5b0de4(_0x87894a._0x1bfa69)]['_draw_tooltip'],delete this['_graphic']['_isDragger'],delete this['_graphic']['_noMousePick'],delete this['_graphic']['_pointType'],delete this['_graphic'][_0x5b0de4(_0x87894a._0x406720)],this['_graphic']['unbindContextMenu']();}}class BasePointEntity extends BaseEntity{constructor(_0x14baca={}){const _0x4cdfda={_0x5d1e96:0xc46,_0x505fd3:0xbb8,_0x541d27:0xb69},_0x5d5d65=_0x3d5d32;_0x14baca['drawShow']=_0x14baca[_0x5d5d65(0xcd2)]??!![],super(_0x14baca),this['_minPointNum']=_0x14baca[_0x5d5d65(0xada)]??0x1,this['_maxPointNum']=_0x14baca['maxPointNum']??0x1,this[_0x5d5d65(_0x4cdfda._0x5d1e96)]=this[_0x5d5d65(0x433)]['hasEdit']??!![],_0x14baca[_0x5d5d65(0xbb8)]&&(this['positions']=_0x14baca[_0x5d5d65(_0x4cdfda._0x505fd3)]),_0x14baca[_0x5d5d65(0xb69)]&&(this[_0x5d5d65(_0x4cdfda._0x541d27)]=_0x14baca[_0x5d5d65(0xb69)]);}get['EditClass'](){return EditPoint;}get[_0x3d5d32(0xb69)](){return this['_position'];}set['position'](_0x232019){const _0x5ac3ae={_0x4cc1f2:0xe7f,_0x37e034:0x1003,_0x51dfe8:0x67f,_0x368e49:0xa63},_0x508572=_0x3d5d32;var _0x5d8ae1,_0x4d9b93;this['_point']=LngLatPoint['parse'](_0x232019);if(this['_point']&&!(this[_0x508572(_0x5ac3ae._0x4cc1f2)][_0x508572(0xd57)]===0x0&&this[_0x508572(0xe7f)]['lng']===0x0)){let _0x122e31=this['style']['setHeight'];Cesium__namespace['defined'](_0x122e31)&&(isString(_0x122e31)&&(_0x122e31=Number(template(_0x122e31,this['attr'],!![])),isNaN(_0x122e31)&&(_0x122e31=0x0)),this['_point']['alt']=_0x122e31);const _0x27570a=this[_0x508572(_0x5ac3ae._0x37e034)]();_0x27570a!==0x0&&(this['_point']['alt']=this['_point']['alt']+_0x27570a);}const _0x3a8700=(_0x5d8ae1=this['_point'])===null||_0x5d8ae1===void 0x0?void 0x0:_0x5d8ae1['toCartesian']();if((_0x4d9b93=this[_0x508572(_0x5ac3ae._0x51dfe8)])!==null&&_0x4d9b93!==void 0x0&&_0x4d9b93[_0x508572(_0x5ac3ae._0x368e49)]&&_0x3a8700 instanceof Cesium__namespace['Cartesian3']){var _0x4259c6;this['_position_draw']=_0x3a8700,_0x3a8700&&((_0x4259c6=this[_0x508572(0xd76)])===null||_0x4259c6===void 0x0?void 0x0:_0x4259c6['length'])>0x0&&(this['_positions_draw'][0x0]=_0x3a8700);}else this['_isCallbackPositions']&&_0x3a8700 instanceof Cesium__namespace['Cartesian3']&&this['_cancelPositionsCallback'](),this['_position']=_0x3a8700;this['_entity']&&this[_0x508572(0x367)](),this[_0x508572(0xefc)](EventType['updatePosition'],{'position':this['_position']});}get['positionShow'](){var _0x1d4811;return getPositionValue(this['position'],(_0x1d4811=this['_map'])===null||_0x1d4811===void 0x0?void 0x0:_0x1d4811['clock']['currentTime']);}get['point'](){const _0x3bc5ec={_0x27be4c:0x87d},_0x458f7e=_0x3d5d32;return!(this[_0x458f7e(_0x3bc5ec._0x27be4c)]instanceof Cesium__namespace['Cartesian3'])&&(this['_point']=LngLatPoint[_0x458f7e(0xce3)](this['positionShow'])),this['_point'];}get['coordinate'](){return this['getCoordinate']();}get['center'](){const _0x26c98a={_0x1cac06:0x1d1,_0x2d0598:0x9f4,_0x3854a8:0x4f8},_0x48ad6a=_0x3d5d32;var _0x4993c6;return getPositionValue(this['positionShow'],(_0x4993c6=this[_0x48ad6a(_0x26c98a._0x1cac06)])===null||_0x4993c6===void 0x0?void 0x0:_0x4993c6[_0x48ad6a(_0x26c98a._0x2d0598)][_0x48ad6a(_0x26c98a._0x3854a8)]);}get[_0x3d5d32(0x7ec)](){const _0x6b4487={_0x192aa5:0xbbe},_0x308bea=_0x3d5d32;return this[_0x308bea(_0x6b4487._0x192aa5)];}get[_0x3d5d32(0xbb8)](){return this['position']?[this['position']]:[];}set['positions'](_0x28bdf3){const _0x1f3b22={_0x4bf929:0xc84},_0x2edbf7=_0x3d5d32;_0x28bdf3&&_0x28bdf3[_0x2edbf7(_0x1f3b22._0x4bf929)]>0x0&&(this['position']=_0x28bdf3[0x0]);}get['points'](){const _0x4fe4a0=_0x3d5d32;return this[_0x4fe4a0(0xbbe)]?[this['point']]:[];}get['coordinates'](){return this['coordinate']?[this['coordinate']]:[];}get['positionsShow'](){return this['positionShow']?[this['positionShow']]:[];}get[_0x3d5d32(0x42d)](){return this['getOrientation']();}set['orientation'](_0x429924){this['_orientation']=_0x429924,this['updateOrientation']();}get['heading'](){const _0x1e0bbf={_0x567bea:0xe39},_0x3107ad=_0x3d5d32;return this[_0x3107ad(0xdde)][_0x3107ad(_0x1e0bbf._0x567bea)]??0x0;}set['heading'](_0x3b05bf){const _0x30250f={_0x122369:0xdde},_0x1e2dd0=_0x3d5d32;this[_0x1e2dd0(_0x30250f._0x122369)]['heading']=_0x3b05bf,this['updateOrientation']();}get['pitch'](){return this['style']['pitch']??0x0;}set[_0x3d5d32(0x5cf)](_0xc8b3a3){const _0x28ba5f={_0x3f8348:0x5cf,_0x45d8e1:0xbe8},_0x10074b=_0x3d5d32;this['style'][_0x10074b(_0x28ba5f._0x3f8348)]=_0xc8b3a3,this[_0x10074b(_0x28ba5f._0x45d8e1)]();}get['roll'](){return this['style']['roll']??0x0;}set['roll'](_0x5de3e2){const _0x4f12b7={_0x4269d9:0x952},_0x1e4ca5=_0x3d5d32;this[_0x1e4ca5(0xdde)][_0x1e4ca5(_0x4f12b7._0x4269d9)]=_0x5de3e2,this['updateOrientation']();}get['height'](){const _0x1b9ce3=_0x3d5d32;var _0x48aa47;return(_0x48aa47=this[_0x1b9ce3(0xbbe)])===null||_0x48aa47===void 0x0?void 0x0:_0x48aa47[_0x1b9ce3(0xd29)];}set['height'](_0x42e81b){const _0xf5b6c4={_0x525d60:0xbbe},_0x56cb9a=_0x3d5d32;this['point']['alt']=_0x42e81b,this[_0x56cb9a(0xb69)]=this[_0x56cb9a(_0xf5b6c4._0x525d60)];}get['modelMatrix'](){const _0x3ef694={_0x17953e:0x89b,_0xc4c34b:0xf5d},_0x2f4eed=_0x3d5d32;if(this[_0x2f4eed(0x89b)]){var _0xa780a2,_0x33c331;return this[_0x2f4eed(_0x3ef694._0x17953e)]['computeModelMatrix']((_0xa780a2=this['_map'])===null||_0xa780a2===void 0x0?void 0x0:(_0x33c331=_0xa780a2[_0x2f4eed(0x9f4)])===null||_0x33c331===void 0x0?void 0x0:_0x33c331['currentTime'],new Cesium__namespace[(_0x2f4eed(_0x3ef694._0xc4c34b))]());}else return undefined;}get[_0x3d5d32(0x9ae)](){const _0x495c2f=_0x3d5d32;return this[_0x495c2f(0x904)];}set[_0x3d5d32(0x9ae)](_0x5188eb){const _0x4b246b={_0x400f94:0xe8e,_0x51560e:0xd14,_0x4d700b:0x29b,_0x3329ae:0x433,_0x3e119b:0xe68,_0x2403d5:0xe68},_0x5204f3={_0x2a47f9:0xd93},_0x1eae06=_0x3d5d32;this['_debugAxis']=_0x5188eb;if(!this['debugAxisPrimitive']){const _0x105f77=Math[_0x1eae06(_0x4b246b._0x400f94)](Cesium__namespace['Cartographic'][_0x1eae06(_0x4b246b._0x51560e)](this['positionShow'])['height']*0.06,0x64);this['debugAxisPrimitive']=this[_0x1eae06(0x873)]['primitiveCollection']['add'](new Cesium__namespace['DebugModelMatrixPrimitive']({'modelMatrix':this[_0x1eae06(0xd93)],'length':_0x105f77,'width':0x5})),this['debugAxisPrimitive']['_tooltipConfig']={'content':_0x1eae06(_0x4b246b._0x4d700b),'options':this[_0x1eae06(_0x4b246b._0x3329ae)]['tooltipOptions']},(this['position']instanceof Cesium__namespace['CallbackProperty']||this['position']instanceof Cesium__namespace['SampledPositionProperty'])&&(this[_0x1eae06(_0x4b246b._0x3e119b)]['_timeTik']=setInterval(()=>{const _0x29188a=_0x1eae06;this['debugAxisPrimitive'][_0x29188a(_0x5204f3._0x2a47f9)]=this[_0x29188a(0xd93)];},0x12c)),this[_0x1eae06(0xc6f)](this[_0x1eae06(0xe68)]);}this[_0x1eae06(_0x4b246b._0x2403d5)]['show']=_0x5188eb;}get['debugAxisLength'](){return this['debugAxisPrimitive']?this['debugAxisPrimitive']['length']:0x0;}set['debugAxisLength'](_0x14be1e){const _0x3e707f={_0x32258a:0xe68},_0x38ccdc=_0x3d5d32;!this['debugAxisPrimitive']&&(this[_0x38ccdc(0x9ae)]=!![]),this[_0x38ccdc(_0x3e707f._0x32258a)]['length']=_0x14be1e;}get['objectsToExclude'](){const _0x2de248={_0x124660:0x433},_0x4bdbfc=_0x3d5d32;if(this[_0x4bdbfc(_0x2de248._0x124660)]['objectsToExclude'])return this['options']['objectsToExclude'];if(this['_objectsToExcludee'])return this[_0x4bdbfc(0x856)];return undefined;}set['objectsToExclude'](_0x5f082b){const _0x39a5d1=_0x3d5d32;this[_0x39a5d1(0x856)]=_0x5f082b;}['_mountedHook'](){}[_0x3d5d32(0x566)](){const _0x9b8f89={_0x229715:0xe68,_0x4b164c:0x873},_0x4be7fe=_0x3d5d32;super[_0x4be7fe(0x566)](),this['debugAxisPrimitive']&&(clearInterval(this[_0x4be7fe(_0x9b8f89._0x229715)]['_timeTik']),this[_0x4be7fe(_0x9b8f89._0x4b164c)]['primitiveCollection']['remove'](this['debugAxisPrimitive']),delete this[_0x4be7fe(_0x9b8f89._0x229715)]);}[_0x3d5d32(0x367)](){const _0x4e8119={_0x3da252:0x89b,_0x20327c:0x87d,_0x437ced:0xe68,_0x4d5206:0x429},_0x2a0c10=_0x3d5d32;this[_0x2a0c10(_0x4e8119._0x3da252)]['position']=this[_0x2a0c10(_0x4e8119._0x20327c)],this['debugAxisPrimitive']&&(this[_0x2a0c10(_0x4e8119._0x437ced)]['modelMatrix']=this['modelMatrix']),this['_updateEditDraggers'](),this[_0x2a0c10(_0x4e8119._0x4d5206)]();}['updateOrientation'](){const _0x2e863d={_0xa7c2de:0xe68,_0x30e924:0x42d},_0x4317f5=_0x3d5d32;return this['_entity']['orientation']=this['getOrientation'](),this['debugAxisPrimitive']&&(this[_0x4317f5(_0x2e863d._0xa7c2de)]['modelMatrix']=this['modelMatrix']),this['_entity'][_0x4317f5(_0x2e863d._0x30e924)];}['getOrientation'](_0x1a1022){const _0x4ec628={_0x3e7937:0xe39,_0x4bb6ee:0xc4e,_0x5c0ffe:0x562,_0x50b8db:0x103e,_0x54e953:0x952},_0x11e58a={_0x4be7b3:0x952,_0x54d285:0xe39,_0x29c1a0:0xe39,_0x1173d1:0xaa8},_0xb89323=_0x3d5d32;_0x1a1022=_0x1a1022||this['style'];let _0x31747e=this['options']['orientation']||this[_0xb89323(0x8de)];if(_0x31747e){const _0x1db707=_0x1a1022['mergeOrientation']||!Cesium__namespace['defined'](_0x1a1022[_0xb89323(_0x4ec628._0x3e7937)])||!Cesium__namespace['defined'](_0x1a1022['pitch'])||!Cesium__namespace['defined'](_0x1a1022[_0xb89323(0x952)]);if(_0x31747e instanceof Cesium__namespace[_0xb89323(_0x4ec628._0x4bb6ee)]&&_0x1db707){const _0x240f94=_0x31747e,_0x53640e=Cesium__namespace['Math'][_0xb89323(0x562)](this['heading']),_0x5169c9=Cesium__namespace['Math'][_0xb89323(_0x4ec628._0x5c0ffe)](this['pitch']),_0x631524=Cesium__namespace['Math']['toRadians'](this['roll']);_0x31747e=new Cesium__namespace[(_0xb89323(0xc6d))](_0x36999b=>{const _0x4aab24=_0xb89323;var _0x2a71c7,_0x21930e;const _0x3ec73e=getPositionValue(this['position'],_0x36999b),_0x22fcc1=_0x240f94[_0x4aab24(0xfbe)](_0x36999b);if(!_0x3ec73e||!_0x22fcc1)return null;const _0x5b5834=getHeadingPitchRollByOrientation(_0x3ec73e,_0x22fcc1);return _0x1a1022['mergeOrientation']?(_0x5b5834[_0x4aab24(0xe39)]+=_0x53640e,_0x5b5834[_0x4aab24(_0x11e58a._0x4be7b3)]+=_0x631524,_0x5b5834['pitch']+=_0x5169c9):(Cesium__namespace['defined'](_0x1a1022[_0x4aab24(_0x11e58a._0x54d285)])&&(_0x5b5834[_0x4aab24(_0x11e58a._0x29c1a0)]=_0x53640e),Cesium__namespace[_0x4aab24(0xb84)](_0x1a1022[_0x4aab24(_0x11e58a._0x4be7b3)])&&(_0x5b5834['roll']=_0x631524),Cesium__namespace[_0x4aab24(0xb84)](_0x1a1022['pitch'])&&(_0x5b5834['pitch']=_0x5169c9)),Cesium__namespace[_0x4aab24(0x5bb)]['headingPitchRollQuaternion'](_0x3ec73e,_0x5b5834,(_0x2a71c7=this['_map'])===null||_0x2a71c7===void 0x0?void 0x0:(_0x21930e=_0x2a71c7['scene'])===null||_0x21930e===void 0x0?void 0x0:_0x21930e[_0x4aab24(_0x11e58a._0x1173d1)][_0x4aab24(0x5ac)]);},![]);}return _0x31747e;}const _0x580e5e=this[_0xb89323(0x4b5)];if(_0x580e5e==null)return;const _0x5ea276=Cesium__namespace[_0xb89323(_0x4ec628._0x50b8db)]['toRadians'](_0x1a1022['heading']??0x0),_0x30a574=Cesium__namespace['Math'][_0xb89323(0x562)](_0x1a1022['pitch']??0x0),_0x4d71f4=Cesium__namespace['Math'][_0xb89323(0x562)](_0x1a1022[_0xb89323(_0x4ec628._0x54e953)]??0x0),_0x4fb71b=new Cesium__namespace['HeadingPitchRoll'](_0x5ea276,_0x30a574,_0x4d71f4);return Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x580e5e,_0x4fb71b);}[_0x3d5d32(0x21f)](_0x2391a8){const _0x51141f={_0x6f376e:0xb39},_0x425133=_0x3d5d32;return{'type':_0x425133(_0x51141f._0x6f376e),'coordinates':this['getCoordinate'](_0x2391a8===null||_0x2391a8===void 0x0?void 0x0:_0x2391a8['noAlt'])};}['clearDynamicPosition'](){const _0xb16186={_0x58e994:0x8de},_0x594cd6=_0x3d5d32;return this[_0x594cd6(_0xb16186._0x58e994)]=undefined,this['property']=null,this['position']=undefined,this;}['_initSampledPositionProperty'](){const _0x548cdc={_0x3895f7:0xd24,_0x17c622:0xa67,_0x54e436:0xaa6,_0x59d46d:0x1019,_0x343d83:0x8de,_0x2eeceb:0x89b},_0x2cfa87={_0x41ed27:0xfbe,_0x3714fe:0x8b6,_0x489d3f:0xfc1,_0x192575:0x873},_0xf5c5c6=_0x3d5d32;this[_0xf5c5c6(_0x548cdc._0x3895f7)]=-0x1,this[_0xf5c5c6(0xb19)]=this['options']['frameRateHeight']??0x1e,this['_maxCacheCount']=this['options']['maxCacheCount']??0x32;const _0x28ddb4=new Cesium__namespace['SampledPositionProperty'](this['options'][_0xf5c5c6(0x366)],this['options']['numberOfDerivatives']);_0x28ddb4[_0xf5c5c6(_0x548cdc._0x17c622)]=this['options']['forwardExtrapolationType']??Cesium__namespace[_0xf5c5c6(_0x548cdc._0x54e436)][_0xf5c5c6(0x807)],_0x28ddb4[_0xf5c5c6(_0x548cdc._0x59d46d)]=this['options'][_0xf5c5c6(0x1019)]??Cesium__namespace['ExtrapolationType']['HOLD'],!this['_orientation']&&(this[_0xf5c5c6(_0x548cdc._0x343d83)]=new Cesium__namespace['VelocityOrientationProperty'](_0x28ddb4),this[_0xf5c5c6(0x89b)]&&(this[_0xf5c5c6(_0x548cdc._0x2eeceb)][_0xf5c5c6(0x42d)]=this['getOrientation']())),this['property']=_0x28ddb4,this[_0xf5c5c6(0xb69)]=new Cesium__namespace['CallbackProperty'](_0x1391f8=>{const _0x424b38=_0xf5c5c6;if(!this['_map'])return undefined;let _0x145b25=_0x28ddb4[_0x424b38(_0x2cfa87._0x41ed27)](_0x1391f8);if(!_0x145b25)return!this['_last_isFireStop']&&this[_0x424b38(0x951)]&&Cesium__namespace['JulianDate'][_0x424b38(_0x2cfa87._0x3714fe)](_0x1391f8,this['_stopTime'])&&(this['fire'](EventType['stop']),this['_last_isFireStop']=!![]),this[_0x424b38(0xb12)];if(_0x145b25&&this['options']['clampToTileset']){this[_0x424b38(0xd24)]++;if(!this['_clampToTilesetHeight']||this['_clampToTilesetFrame']%this['_frameRateHeight']===0x0){const _0x511518=getHeight(this['_map'][_0x424b38(_0x2cfa87._0x489d3f)],_0x145b25,{'objectsToExclude':this[_0x424b38(_0x2cfa87._0x192575)][_0x424b38(0xc77)],'has3dtiles':!![]});_0x511518&&(this['_clampToTilesetHeight']=_0x511518);}if(this['_clampToTilesetHeight']){const _0x56235e=Cesium__namespace['Cartographic']['fromCartesian'](_0x145b25);_0x145b25=Cesium__namespace[_0x424b38(0xe95)]['fromRadians'](_0x56235e['longitude'],_0x56235e['latitude'],this['_clampToTilesetHeight']+this['getAddHeight']());}}return this['_primitive_label']&&(this[_0x424b38(0xdaf)]['position']=_0x145b25),this['_last_position']=_0x145b25,this['_last_isFireStop']=![],_0x145b25;},![]);}['addDynamicPosition'](_0x3067ec,_0x1c36c2){const _0x451839={_0x49eb75:0x8b7,_0x14b6c5:0x264,_0x493706:0x87d,_0x40024b:0x336,_0x32d7cb:0xf72,_0x521860:0xed4,_0xcdd6d6:0xade},_0x9d116d=_0x3d5d32;var _0x4e3679,_0x4df0ef,_0x3a7fda,_0x5071c3;!this['property']&&this['_initSampledPositionProperty']();this['_removeDynamicPosition']();const _0x9077d9=((_0x4e3679=this['_map'])===null||_0x4e3679===void 0x0?void 0x0:(_0x4df0ef=_0x4e3679['clock'])===null||_0x4df0ef===void 0x0?void 0x0:_0x4df0ef['currentTime'])||Cesium__namespace['JulianDate']['now']();if(!_0x1c36c2)_0x1c36c2=_0x9077d9;else{if(isNumber(_0x1c36c2))_0x1c36c2=Cesium__namespace['JulianDate']['addSeconds'](_0x9077d9,_0x1c36c2,new Cesium__namespace['JulianDate']());else{if(isString(_0x1c36c2))_0x1c36c2['indexOf']('Z')===-0x1?_0x1c36c2=Cesium__namespace[_0x9d116d(_0x451839._0x49eb75)]['fromDate'](new Date(_0x1c36c2)):_0x1c36c2=Cesium__namespace[_0x9d116d(_0x451839._0x49eb75)]['fromIso8601'](_0x1c36c2);else _0x1c36c2 instanceof Date&&(_0x1c36c2=Cesium__namespace['JulianDate']['fromDate'](_0x1c36c2));}}_0x3067ec=LngLatPoint['parse'](_0x3067ec);const _0x4ba0d1=(_0x3a7fda=this['_sampledPositionProperty'])===null||_0x3a7fda===void 0x0?void 0x0:(_0x5071c3=_0x3a7fda['_property'])===null||_0x5071c3===void 0x0?void 0x0:_0x5071c3[_0x9d116d(0xb15)];if(this['options'][_0x9d116d(_0x451839._0x14b6c5)]&&(_0x4ba0d1===null||_0x4ba0d1===void 0x0?void 0x0:_0x4ba0d1['length'])>0x0&&this['_position']){const _0x4f747c=_0x4ba0d1[_0x4ba0d1['length']-0x1];if(Cesium__namespace['JulianDate']['secondsDifference'](_0x9077d9,_0x4f747c)>0.3){let _0x489f8f=this[_0x9d116d(_0x451839._0x493706)];if(this[_0x9d116d(0x336)]){const _0x6a6fb8=0.01;_0x489f8f=getOnLinePointByLen(this[_0x9d116d(_0x451839._0x40024b)],this['_position'],_0x6a6fb8,!![]);}_0x489f8f=setPositionsHeight(_0x489f8f,_0x3067ec['alt']||0x0),this[_0x9d116d(_0x451839._0x32d7cb)]['addSample'](_0x9077d9,_0x489f8f);}}const _0x4e0444=_0x3067ec[_0x9d116d(_0x451839._0x521860)]();return this['property'][_0x9d116d(_0x451839._0xcdd6d6)](_0x1c36c2,_0x4e0444),this['_lastDynamicPosition']=_0x4e0444,this['_stopTime']=_0x1c36c2,this;}[_0x3d5d32(0x934)](){const _0x427738=_0x3d5d32;var _0x39a49b,_0x37b993;if(this[_0x427738(0x230)]<0x1)return;const _0x71ea76=(_0x39a49b=this['property'])===null||_0x39a49b===void 0x0?void 0x0:(_0x37b993=_0x39a49b['_property'])===null||_0x37b993===void 0x0?void 0x0:_0x37b993['_times'];if(!_0x71ea76||(_0x71ea76===null||_0x71ea76===void 0x0?void 0x0:_0x71ea76['length'])===0x0)return;const _0xda0855=_0x71ea76['length']-this['_maxCacheCount']-0x1;_0xda0855>0x0&&this['property']['removeSamples'](new Cesium__namespace['TimeInterval']({'start':_0x71ea76[0x0],'stop':_0x71ea76[_0xda0855]}));}['_getPopupPosition'](){return this['property']||this['position']||this['center'];}[_0x3d5d32(0x42b)](_0x4e0ea4={}){const _0x142e2e={_0x11f399:0xb69},_0x98ae29=_0x3d5d32;return getSurfaceHeight(this['_map']['scene'],this['position'],{'objectsToExclude':this['_layer'][_0x98ae29(0xc77)],..._0x4e0ea4})['then'](_0x37505a=>{const _0x3344c5=_0x98ae29;_0x37505a['position']&&(this['position']=_0x37505a[_0x3344c5(_0x142e2e._0x11f399)]);});}['clampToGround'](_0x50c642){return this['autoSurfaceHeight'](_0x50c642);}['getCoordinate'](_0x4f9438){const _0x34351b={_0x3377f3:0xbbe,_0x259b88:0xbbe},_0xb57311=_0x3d5d32;return this[_0xb57311(_0x34351b._0x3377f3)]?this[_0xb57311(_0x34351b._0x259b88)]['toArray'](_0x4f9438):[];}['setCallbackPosition'](_0x526c73){const _0x467031=_0x3d5d32;return this[_0x467031(0xd56)](),_0x526c73&&(this['_position_draw']=LngLatPoint['toCartesian'](_0x526c73)),this[_0x467031(0x70d)];}[_0x3d5d32(0xd56)](){const _0x3a903f=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![],this['show']=this['options']['drawShow'],this['_position_draw']=this[_0x3a903f(0x4b5)],this['position']=new Cesium__namespace[(_0x3a903f(0xc6d))](_0x6f8667=>{return this['_position_draw'];},![]),this[_0x3a903f(0xf22)]&&this['updateAttrForDrawing'](!![]),this['_updateOutlineToCallback'](),this['_updateLabelPosition']();}[_0x3d5d32(0xa84)](){const _0x569c9e=_0x3d5d32;if(!this['_isCallbackPositions'])return;this['_isCallbackPositions']=![],this['_position']=this['_position_draw'],this['_point']=LngLatPoint['fromCartesian'](this['_position']),delete this['_position_draw'],this['_entity']['position']=this[_0x569c9e(0x87d)];}[_0x3d5d32(0xa57)](){this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['on'](EventType['click'],this['_onClickHandler_point'],this);}['_stopDrawHook'](){const _0x104876={_0x1c487e:0x1d1},_0x42ad05=_0x3d5d32;this[_0x42ad05(_0x104876._0x1c487e)]['off'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['off'](EventType['click'],this['_onClickHandler_point'],this),this['show']=!![];}[_0x3d5d32(0x2b3)](_0x4ea29a){const _0xb4544d={_0x5684f1:0xd86},_0x3b0612=_0x3d5d32,_0x1939d3=_0x4ea29a['cartesian'];_0x1939d3&&(this[_0x3b0612(0x70d)]=_0x1939d3,this['lastPointTemporary']=!![]),this['_map'][_0x3b0612(_0xb4544d._0x5684f1)](_0x4ea29a[_0x3b0612(0xd13)],this['_draw_tooltip']||this['_map']['getLangText']('_单击完成绘制')),this['fire'](EventType['drawMouseMove'],{..._0x4ea29a,'drawtype':this['type'],'graphic':this},!![]);}['_onClickHandler_point'](_0x3d351b){const _0x576637={_0x20cb3a:0x70d,_0x991ee6:0xf57},_0x5cc7d2=_0x3d5d32,_0xf0749d=_0x3d351b['cartesian'];_0xf0749d&&(this['_position_draw']=_0xf0749d),this[_0x5cc7d2(_0x576637._0x20cb3a)]&&(this[_0x5cc7d2(0xdc9)]=![],this[_0x5cc7d2(_0x576637._0x991ee6)]());}}class EditPoly extends EditBase{get['hasClosure'](){return this['style']['closure'];}get['hasMidPoint'](){const _0x287ecf={_0x5abd9f:0x6cc},_0x1ea6f6=_0x3d5d32;return this['positions']['length']{const _0x4595d4=_0x21e09a;var _0x58de77;_0x154169=this['updatePositionsHeightByAttr'](_0x154169),_0x41e026['position']=_0x154169,this[_0x4595d4(_0x3a20ba._0x14e794)][_0x41e026[_0x4595d4(0x5f9)]]=_0x154169;if(((_0x58de77=this['_heightDraggers'])===null||_0x58de77===void 0x0?void 0x0:_0x58de77['length'])>0x0)return;if(this[_0x4595d4(_0x3a20ba._0x196db)]){let _0x3acd1b,_0x25d1c4,_0x1c43c4;if(this['hasClosure']||!this['hasClosure']&&_0x41e026['index']!==0x0){_0x41e026['index']===0x0?(_0x3acd1b=_0x56556c*0x2-0x1,_0x25d1c4=_0x56556c-0x1):(_0x3acd1b=_0x41e026['index']*0x2-0x1,_0x25d1c4=_0x41e026['index']-0x1);const _0x39009e=_0x32c4fc[_0x25d1c4];_0x1c43c4=getMidpoint(_0x154169,_0x39009e),_0x1c43c4=this[_0x4595d4(_0x3a20ba._0x1a5b71)](_0x1c43c4),this['draggers'][_0x3acd1b]['position']=_0x1c43c4;}(this['hasClosure']||!this['hasClosure']&&_0x41e026['index']!==_0x56556c-0x1)&&(_0x41e026['index']===_0x56556c-0x1?(_0x3acd1b=_0x41e026[_0x4595d4(_0x3a20ba._0x40da61)]*0x2+0x1,_0x25d1c4=0x0):(_0x3acd1b=_0x41e026[_0x4595d4(0x5f9)]*0x2+0x1,_0x25d1c4=_0x41e026[_0x4595d4(_0x3a20ba._0x40da61)]+0x1),_0x1c43c4=getMidpoint(_0x154169,_0x32c4fc[_0x25d1c4]),_0x1c43c4=this[_0x4595d4(0x813)](_0x1c43c4),this['draggers'][_0x3acd1b]['position']=_0x1c43c4);}if(this['_draggerMove']){let _0x26861c=centerOfMass(_0x32c4fc);_0x26861c=this['updatePositionsHeightByAttr'](_0x26861c),this['_draggerMove']['position']=_0x26861c;}},'onDragStart':(_0x5d21a2,_0x3f9921)=>{const _0x234646=_0x21e09a;var _0xf5424b;if(((_0xf5424b=this['_heightDraggers'])===null||_0xf5424b===void 0x0?void 0x0:_0xf5424b['length'])>0x0)for(let _0x5e0184=0x0,_0xa2524=this[_0x234646(_0x2d3b5c._0x29b951)]['length'];_0x5e0184<_0xa2524;_0x5e0184++){this[_0x234646(0x93f)][_0x5e0184]['show']=![];}},'onDragEnd':(_0x272976,_0x2535af)=>{const _0x2aee0f=_0x21e09a;var _0x50e801;((_0x50e801=this['_heightDraggers'])===null||_0x50e801===void 0x0?void 0x0:_0x50e801[_0x2aee0f(0xc84)])>0x0&&this['updateDraggers']();}});_0x2f366d['index']=_0x237f2d,this[_0x21e09a(_0x1dd910._0x550a46)]['push'](_0x2f366d);if(this['hasMidPoint']&&(this['hasClosure']||!this[_0x21e09a(_0x1dd910._0x47e4e3)]&&_0x237f2d<_0x56556c-0x1)){const _0x887e3d=(_0x237f2d+0x1)%_0x56556c;let _0x4a4dd2=getMidpoint(_0x472ed0,_0x32c4fc[_0x887e3d]);_0x4a4dd2=this['updatePositionsHeightByAttr'](_0x4a4dd2);const _0x28c857=this[_0x21e09a(0xf10)]({'position':_0x4a4dd2,'type':PointType['AddMidPoint'],'tooltip':this['_map']['getLangText'](_0x21e09a(0x98f)),'onDragStart':(_0x5aaced,_0x12151c)=>{const _0x5e14e5=_0x21e09a;this[_0x5e14e5(_0x1c5695._0x59a106)]['splice'](_0x5aaced['index'],0x0,_0x12151c);},'onDrag':(_0x329e90,_0x1c16f7)=>{const _0x433aef=_0x21e09a;this[_0x433aef(0xbb8)][_0x329e90[_0x433aef(_0x2d9397._0x109e39)]]=_0x1c16f7;},'onDragEnd':(_0x3e819c,_0x339c78)=>{this['_fireAddPoint'](_0x3e819c,_0x339c78),this['updateDraggers']();}});_0x28c857[_0x21e09a(0x5f9)]=_0x887e3d,this['draggers']['push'](_0x28c857);}}this['_bindMoveAllDragger'](),this[_0x21e09a(0xa09)]['extrudedHeight']&&this[_0x21e09a(_0x1dd910._0x2c083a)]();}[_0x3d5d32(0x923)](){const _0x52fd40={_0x34bbde:0x422,_0x15ea59:0x93f},_0x1e59d6={_0xfab27:0xd97,_0x4b1558:0xc84,_0x5c61ac:0x6cc,_0x442a93:0x3f7},_0x223664={_0x566949:0xe95},_0x380141=_0x3d5d32;if(!this['_graphic'][_0x380141(_0x52fd40._0x34bbde)])return;let _0x4faff5=centerOfMass(this['positions']);_0x4faff5=this['updatePositionsHeightByAttr'](_0x4faff5);const _0x1215a1=this['createDragger']({'position':_0x4faff5,'type':PointType[_0x380141(0x956)],'tooltip':this['_map'][_0x380141(0xd1b)]('_整体平移'),'onDragStart':(_0x5b2282,_0x25e4aa)=>{_0x4faff5=_0x25e4aa;},'onDrag':(_0x460b5a,_0x2224ad)=>{const _0x43976c=_0x380141;var _0x465894;const _0x416252=Cesium__namespace['Cartesian3'][_0x43976c(_0x1e59d6._0xfab27)](_0x2224ad,_0x4faff5,new Cesium__namespace['Cartesian3']());_0x4faff5=_0x2224ad,this['positions']['forEach']((_0x348330,_0x52e680,_0x47e1a3)=>{const _0x23814c=Cesium__namespace['Cartesian3']['add'](_0x348330,_0x416252,new Cesium__namespace['Cartesian3']());this['positions'][_0x52e680]=_0x23814c;});if(((_0x465894=this['_graphic']['_draw_holes'])===null||_0x465894===void 0x0?void 0x0:_0x465894[_0x43976c(_0x1e59d6._0x4b1558)])>0x0)for(let _0x24716c=0x0,_0x875e1a=this['_graphic']['_draw_holes']['length'];_0x24716c<_0x875e1a;_0x24716c++){const _0x58279b=this[_0x43976c(_0x1e59d6._0x5c61ac)]['_draw_holes'][_0x24716c];_0x58279b['forEach']((_0x240cd7,_0x3c38db,_0x40d8b0)=>{const _0x2d53c1=_0x43976c,_0x3ff938=Cesium__namespace['Cartesian3']['add'](_0x240cd7,_0x416252,new Cesium__namespace[(_0x2d53c1(_0x223664._0x566949))]());_0x58279b[_0x3c38db]=_0x3ff938;});}for(let _0x4ff3f6=0x0,_0x33c644=this[_0x43976c(0x93f)]['length'];_0x4ff3f6<_0x33c644;_0x4ff3f6++){_0x1215a1!==this['draggers'][_0x4ff3f6]&&(this['draggers'][_0x4ff3f6]['position']=Cesium__namespace['Cartesian3']['add'](this['draggers'][_0x4ff3f6]['position'],_0x416252,new Cesium__namespace['Cartesian3']()));}this[_0x43976c(_0x1e59d6._0x442a93)](_0x2224ad);}});this['_draggerMove']=_0x1215a1,this[_0x380141(_0x52fd40._0x15ea59)]['push'](_0x1215a1);}['_updateMoveAllHook'](_0x3df74e){}[_0x3d5d32(0x30b)](_0x216015){const _0x3a85e3={_0x149386:0x831,_0x327c78:0x1d1},_0x175112={_0x3d9d5c:0x220,_0xc6cdcb:0xbb8},_0x55ab70=_0x3d5d32;if(!this[_0x55ab70(0x6cc)]['_hasHeightEdit'])return;this['_heightDraggers']=[],_0x216015=_0x216015||this['positions'];const _0x66a31=getCesiumValue(this['entityGraphic'][_0x55ab70(_0x3a85e3._0x149386)],Number,this['_map']['clock']['currentTime']);for(let _0x39edb0=0x0,_0x1f2e7f=_0x216015['length'];_0x39edb0<_0x1f2e7f;_0x39edb0++){const _0x240dc4=setPositionsHeight(_0x216015[_0x39edb0],_0x66a31),_0x1abec6=this['createDragger']({'position':_0x240dc4,'type':PointType['MoveHeight'],'tooltip':this[_0x55ab70(_0x3a85e3._0x327c78)]['getLangText'](_0x55ab70(0xafc)),'onDrag':(_0x405f46,_0x43094f)=>{const _0x33c792=_0x55ab70,_0x382367=Cesium__namespace[_0x33c792(_0x175112._0x3d9d5c)]['fromCartesian'](_0x43094f)[_0x33c792(0x83e)];this['entityGraphic']['extrudedHeight']=_0x382367;const _0x1ebfc2=getMaxHeight(this[_0x33c792(_0x175112._0xc6cdcb)]);this[_0x33c792(0xdde)]['diffHeight']=this[_0x33c792(0x29a)](_0x382367-_0x1ebfc2,0x2),this['updateHeightDraggers'](_0x382367),this['updateAttrForEditing'](),this['fire'](EventType['editStyle']);}});this['draggers']['push'](_0x1abec6),this[_0x55ab70(0xf5a)]['push'](_0x1abec6);}}['updateHeightDraggers'](_0x1ef248){const _0x3eb82c={_0x216f5b:0xb69},_0x2634cc=_0x3d5d32;for(let _0xb1f874=0x0;_0xb1f8740x0?this['positions']=bufferPoints(_0x36ae41['positions'],this['style'][_0x3f9cde(0xe2c)],this['style']['bufferSteps']):this['positions']=_0x36ae41['positions']);}get['hasMoveEdit'](){return this['_hasMoveEdit'];}get['hasHeightEdit'](){return this['_hasHeightEdit'];}get['EditClass'](){return EditPoly;}get['center'](){const _0x3d0634={_0x267b61:0x718},_0x9302fe=_0x3d5d32;return this['style'][_0x9302fe(0x1f2)]?this[_0x9302fe(0xe0b)]:this[_0x9302fe(_0x3d0634._0x267b61)];}get['centerOfMass'](){return centerOfMass(this['positionsShow']);}get['centerOfLine'](){const _0x2c2f4e={_0x30f51a:0x326,_0x2f38d1:0xc84},_0xdd3000=_0x3d5d32,_0x390478=this[_0xdd3000(_0x2c2f4e._0x30f51a)];if(!_0x390478||_0x390478['length']===0x0)return null;else{if(_0x390478['length']===0x1)return _0x390478[0x0];}return _0x390478[_0xdd3000(_0x2c2f4e._0x2f38d1)]<0xa?sliceByMaxDistance(_0x390478,this['distance']/0x2,{'point':!![]}):_0x390478[Math['floor'](_0x390478['length']/0x2)];}get[_0x3d5d32(0xbd7)](){const _0x189784={_0x296612:0x326},_0x37252e=_0x3d5d32;return getDistance(this[_0x37252e(_0x189784._0x296612)]);}get['area'](){const _0x361ae3={_0x19f973:0x326},_0x2fbe71=_0x3d5d32;return getSurfaceArea(this[_0x2fbe71(_0x361ae3._0x19f973)]);}get['positions'](){if(this['_getPositions'])return this['_getPositions']();return this['_positions'];}set[_0x3d5d32(0xbb8)](_0x34921c){const _0x49173c={_0xb86861:0x67f,_0x26fbd9:0x50e,_0x52173c:0x3e8},_0x3cafa4={_0x36e17e:0xb84,_0x48d6ed:0xd29},_0x341044=_0x3d5d32;if(!_0x34921c)return;if(Array['isArray'](_0x34921c)){var _0x414ba8;const _0x3ab892=[],_0x3dc25f=[];_0x34921c['forEach']((_0x2aca56,_0x169a2a)=>{const _0x55be7b=_0x4132,_0x4ede67=LngLatPoint['parse'](_0x2aca56);if(!_0x4ede67||!_0x4ede67['valid']())return;let _0x5d7c9a=this['style']['setHeight'];if(Cesium__namespace[_0x55be7b(_0x3cafa4._0x36e17e)](_0x5d7c9a)){if(isString(_0x5d7c9a))_0x5d7c9a=Number(template(_0x5d7c9a,this['attr'],!![])),isNaN(_0x5d7c9a)&&(_0x5d7c9a=0x0);else Array['isArray'](_0x5d7c9a)&&(_0x5d7c9a=_0x5d7c9a[_0x169a2a]||0x0);_0x4ede67['alt']=_0x5d7c9a;}const _0xfb1eb3=this['getAddHeight'](_0x169a2a);_0xfb1eb3!==0x0&&(_0x4ede67[_0x55be7b(_0x3cafa4._0x48d6ed)]=_0x4ede67['alt']+_0xfb1eb3),_0x3ab892['push'](_0x4ede67),_0x3dc25f['push'](_0x4ede67['toCartesian']());}),(_0x414ba8=this[_0x341044(_0x49173c._0xb86861)])!==null&&_0x414ba8!==void 0x0&&_0x414ba8['enabled']?this['_positions_draw']=_0x3dc25f:(this['_positions_draw']&&this['_cancelPositionsCallback'](),this['_positions']=_0x3dc25f),this[_0x341044(_0x49173c._0x26fbd9)]=_0x3ab892;}else this['_positions']=_0x34921c;this[_0x341044(0x89b)]&&this[_0x341044(0x367)](),this['fire'](EventType[_0x341044(_0x49173c._0x52173c)],{'positions':this['_positions']});}get[_0x3d5d32(0x326)](){const _0xbfa032={_0x10ed05:0x4ef},_0x22f013=_0x3d5d32;let _0x5c8a37=getCesiumValue(this[_0x22f013(0x924)]);return _0x5c8a37 instanceof Cesium__namespace['Rectangle']&&(_0x5c8a37=this[_0x22f013(_0xbfa032._0x10ed05)]),_0x5c8a37;}get[_0x3d5d32(0xbf8)](){const _0x244103={_0x21125c:0x1f2},_0x41ba61=_0x3d5d32;if(this['_positions']instanceof Cesium__namespace[_0x41ba61(0xc6d)]){let _0x655129;this['_positions_draw']?_0x655129=this['_positions_draw']:(_0x655129=this['positionsShow'],this['style'][_0x41ba61(_0x244103._0x21125c)]&&_0x655129[_0x41ba61(0x1f5)]());const _0x17b000=[];_0x655129['forEach'](function(_0x4eee53){const _0x50a30c=LngLatPoint['parse'](_0x4eee53);if(!_0x50a30c)return;_0x17b000['push'](_0x50a30c);}),this['_points']=_0x17b000;}return!this['_points']&&(this['_points']=LngLatArray['toPoints'](this[_0x41ba61(0x924)])),this['_points'];}get['coordinates'](){return this['getCoordinates']();}get['rectangle'](){const _0xa44b6=_0x3d5d32;return Cesium__namespace['Rectangle']['fromCartesianArray'](this[_0xa44b6(0xbb8)]);}[_0x3d5d32(0xccb)](){const _0x2ebb10=_0x3d5d32;return this['entityGraphic'][_0x2ebb10(0xbb8)];}[_0x3d5d32(0xe4c)](){}['_updatePositionsHook'](){const _0x32c891=_0x3d5d32;this[_0x32c891(0x429)](),this[_0x32c891(0x7b9)]();}['_getGeoJsonGeometry'](_0xde43f0){const _0x4f0110={_0x24f1ee:0x96f,_0x18202d:0x1057},_0x465a92=_0x3d5d32;return{'type':_0x465a92(_0x4f0110._0x24f1ee),'coordinates':this[_0x465a92(_0x4f0110._0x18202d)](_0xde43f0===null||_0xde43f0===void 0x0?void 0x0:_0xde43f0['noAlt'])};}['getCoordinates'](_0x3c13bb){const _0x1d2e26=[];return this['points']['forEach'](_0x127d2e=>{_0x1d2e26['push'](_0x127d2e['toArray'](_0x3c13bb));}),_0x1d2e26;}[_0x3d5d32(0xe23)](_0x4572f0){const _0x13d4cf={_0x482d7a:0x3f1},_0x2ac2f=_0x3d5d32,_0x2201ce=LngLatPoint['parse'](_0x4572f0),_0x54d4af=Cesium__namespace[_0x2ac2f(0x756)][_0x2ac2f(_0x13d4cf._0x482d7a)](Cesium__namespace['Rectangle']['fromCartesianArray'](this['positionsShow']),_0x2201ce['toCartographic']());if(!_0x54d4af)return![];return isInPoly(_0x2201ce,this['coordinates']);}['autoSurfaceHeight'](_0x56fd24={}){return computeSurfacePoints({..._0x56fd24,'map':this['_map'],'positions':this['positionsShow']})['then'](_0x5ed458=>{return!_0x5ed458['noHeight']&&(this['positions']=_0x5ed458['positions']),_0x5ed458;});}['clampToGround'](_0x14a5b0){return this['autoSurfaceHeight'](_0x14a5b0);}['setCallbackPositions'](_0xdd8eb){return this['_setPositionsToCallback'](),_0xdd8eb&&(this['_positions_draw']=LngLatArray['toCartesians'](_0xdd8eb)),this['_positions_draw'];}['_setPositionsToCallback'](){const _0xd70698={_0x3a6a86:0x924,_0x2482bd:0x326,_0x125d29:0xc6d,_0x413825:0x827},_0x306fe9=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];let _0xd61a14=getCesiumValue(this[_0x306fe9(_0xd70698._0x3a6a86)]);if(_0xd61a14 instanceof Cesium__namespace[_0x306fe9(0x9d3)])_0xd61a14=_0xd61a14['positions'];else _0xd61a14 instanceof Cesium__namespace['Rectangle']&&(_0xd61a14=this['outlinePositions']);this['_positions_draw']=_0xd61a14||this[_0x306fe9(_0xd70698._0x2482bd)]||[],this['positions']=new Cesium__namespace[(_0x306fe9(_0xd70698._0x125d29))](_0x9ef07b=>{return this['_positions_CallbackProperty']();},![]),this[_0x306fe9(_0xd70698._0x413825)](),this['updateAttrForDrawing']&&this['updateAttrForDrawing'](!![]),this['_updateLabelPosition']();}[_0x3d5d32(0x917)](){const _0x43fa24={_0x5c47fc:0xd76},_0x4743af=_0x3d5d32;return this[_0x4743af(_0x43fa24._0x5c47fc)];}[_0x3d5d32(0xa84)](){const _0x1503f0={_0x6e32bd:0xd76,_0x44209f:0x367,_0x2f9464:0x1065},_0x52febc=_0x3d5d32;if(!this['_isCallbackPositions'])return;this['_isCallbackPositions']=![],this['_positions']=this['_positions_draw'],this['_points']=LngLatArray['toPoints'](this['_positions_draw']),delete this[_0x52febc(_0x1503f0._0x6e32bd)],this[_0x52febc(_0x1503f0._0x44209f)](),this[_0x52febc(_0x1503f0._0x2f9464)]();}['_startDrawHook'](){const _0x5631cf={_0x2994a1:0x1d1,_0x167256:0x431,_0x19c8ad:0x39b},_0x49bedc=_0x3d5d32;this[_0x49bedc(0x1d1)]['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this[_0x49bedc(_0x5631cf._0x2994a1)]['on'](this[_0x49bedc(_0x5631cf._0x167256)],this['_onDbClickHandler'],this),(this['options']['hasDrawDelPoint']??!![])&&this[_0x49bedc(0x1d1)]['on'](this[_0x49bedc(_0x5631cf._0x19c8ad)],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x429378={_0x5a5ab8:0x9b8,_0x52bb1e:0x431,_0x3d8968:0x1fe},_0x4f8391=_0x3d5d32;this[_0x4f8391(0x1d1)]['off'](EventType['mouseMove'],this[_0x4f8391(_0x429378._0x5a5ab8)],this),this['_map'][_0x4f8391(0x9e7)](EventType['click'],this['_onClickHandler'],this),this['_map']['off'](this[_0x4f8391(_0x429378._0x52bb1e)],this['_onDbClickHandler'],this),(this['options'][_0x4f8391(_0x429378._0x3d8968)]??!![])&&this[_0x4f8391(0x1d1)][_0x4f8391(0x9e7)](this[_0x4f8391(0x39b)],this[_0x4f8391(0x1df)],this);}}class PointEntity extends BasePointEntity{get['entityGraphic'](){const _0x55977b={_0x390afc:0xbbe},_0xd3a60f=_0x3d5d32;var _0x367ada;return(_0x367ada=this['_entity'])===null||_0x367ada===void 0x0?void 0x0:_0x367ada[_0xd3a60f(_0x55977b._0x390afc)];}[_0x3d5d32(0xe4c)](){const _0x5588db={_0x5f287d:0x83d,_0x2dfe3e:0xdde,_0x3c0ada:0x654,_0x35e95e:0xb15,_0x2f032d:0xa67,_0x1fc56d:0xaa6,_0x35c8b3:0x807},_0x1f4828=_0x3d5d32,_0x2e9bc6={'position':this['position'],'point':PointStyleConver['toCesiumVal'](this['style'])};this[_0x1f4828(0xdde)]['label']&&(_0x2e9bc6[_0x1f4828(0x32a)]=LabelStyleConver[_0x1f4828(_0x5588db._0x5f287d)](this[_0x1f4828(_0x5588db._0x2dfe3e)][_0x1f4828(0x32a)],{},this['attr']));this['options']['billboard']&&(_0x2e9bc6['billboard']=BillboardStyleConver['toCesiumVal'](this['options']['billboard'],{},!![]));this['options'][_0x1f4828(_0x5588db._0x3c0ada)]&&(_0x2e9bc6['ellipse']=CircleStyleConver['toCesiumVal'](this['options']['circle'],{},!![]));this['options']['model']&&(_0x2e9bc6['orientation']=this['getOrientation'](this['options']['model']),_0x2e9bc6['model']=ModelStyleConver['toCesiumVal'](this['options']['model'],{},!![]));if(this['options']['path']){var _0x1141da,_0x44b390;const _0x26e028=PathStyleConver['toCesiumVal'](this['options']['path'],{},!![]);!_0x26e028['isAll']&&(_0x26e028[_0x1f4828(0xf07)]=0x0);_0x2e9bc6[_0x1f4828(0x4f5)]=_0x26e028;const _0x5293b3=(_0x1141da=this['position'])===null||_0x1141da===void 0x0?void 0x0:(_0x44b390=_0x1141da['_property'])===null||_0x44b390===void 0x0?void 0x0:_0x44b390[_0x1f4828(_0x5588db._0x35e95e)];if(_0x5293b3&&_0x5293b3[_0x1f4828(0xc84)]>0x0){var _0xacdfe7;const _0x4b16e0=_0x5293b3[0x0];let _0xf794fa=_0x5293b3[_0x5293b3['length']-0x1];((_0xacdfe7=this['position'])===null||_0xacdfe7===void 0x0?void 0x0:_0xacdfe7[_0x1f4828(_0x5588db._0x2f032d)])===Cesium__namespace[_0x1f4828(_0x5588db._0x1fc56d)][_0x1f4828(_0x5588db._0x35c8b3)]&&(_0xf794fa=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),_0x2e9bc6[_0x1f4828(0x6fb)]=new Cesium__namespace[(_0x1f4828(0x6f1))]([new Cesium__namespace['TimeInterval']({'start':_0x4b16e0,'stop':_0xf794fa})]);}}this['_entity']=this[_0x1f4828(0x45f)](_0x2e9bc6);}['_addLabel'](){const _0xb6ae70=_0x3d5d32;this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](this['style'][_0xb6ae70(0x32a)],this[_0xb6ae70(0x89b)][_0xb6ae70(0x32a)],this['attr']);}['_updateStyleHook'](_0xc0f9ff,_0x212019){const _0x1c6a0b={_0x3f3c58:0x83d,_0x11d779:0xa09},_0x131f43=_0x3d5d32;PointStyleConver[_0x131f43(_0x1c6a0b._0x3f3c58)](_0xc0f9ff,this[_0x131f43(_0x1c6a0b._0x11d779)]);}['_style2Json'](_0x35d2d2,_0x9e734){return PointStyleConver['toJSON'](_0x35d2d2,_0x9e734,!![]);}['_setOptionsHook'](_0x23df2f,_0x45a3f1){const _0x111a2b={_0x351fc6:0x4f5,_0x2d6b89:0x89b},_0x41ead1=_0x3d5d32;_0x45a3f1['model']&&ModelStyleConver['toCesiumVal'](_0x23df2f['model'],this['_entity']['model'],!![]),_0x45a3f1['billboard']&&BillboardStyleConver[_0x41ead1(0x83d)](_0x23df2f['billboard'],this['_entity']['billboard'],!![]),_0x45a3f1[_0x41ead1(_0x111a2b._0x351fc6)]&&PathStyleConver['toCesiumVal'](_0x23df2f['path'],this[_0x41ead1(_0x111a2b._0x2d6b89)]['path'],!![]),_0x45a3f1['circle']&&CircleStyleConver['toCesiumVal'](_0x23df2f['circle'],this['_entity']['ellipse'],!![]);}['_toJSON_Ex'](_0x2f8b5c){const _0x45534a={_0x5a725f:0x600,_0x238152:0x433,_0x5119a3:0x3db,_0x2cb6b4:0x654},_0x426e6b=_0x3d5d32;this['options'][_0x426e6b(_0x45534a._0x5a725f)]&&(_0x2f8b5c['model']={},ModelStyleConver['toJSON'](this[_0x426e6b(_0x45534a._0x238152)]['model'],_0x2f8b5c[_0x426e6b(0x600)],!![])),this['options']['billboard']&&(_0x2f8b5c['billboard']={},BillboardStyleConver[_0x426e6b(_0x45534a._0x5119a3)](this['options']['billboard'],_0x2f8b5c['billboard'],!![])),this['options']['path']&&(_0x2f8b5c['path']={},PathStyleConver['toJSON'](this['options']['path'],_0x2f8b5c['path'],!![])),this['options']['circle']&&(_0x2f8b5c[_0x426e6b(_0x45534a._0x2cb6b4)]={},CircleStyleConver['toJSON'](this['options']['circle'],_0x2f8b5c['circle'],!![]));}['_updateExOpacity'](_0xf1ff4a){const _0x313d22={_0x3a2501:0x882,_0x340787:0x83d,_0x232cdb:0x433,_0x5cbf8c:0x892},_0x17787f=_0x3d5d32;this['_entity']['model']&&(this[_0x17787f(0x89b)]['model'][_0x17787f(0xe8f)]=Cesium__namespace[_0x17787f(_0x313d22._0x3a2501)]['WHITE'][_0x17787f(0xe57)](_0xf1ff4a));this['_entity']['billboard']&&(this['_entity'][_0x17787f(0x4a5)]['color']=Cesium__namespace[_0x17787f(_0x313d22._0x3a2501)]['WHITE']['withAlpha'](_0xf1ff4a));if(this[_0x17787f(0x89b)]['path']){const _0x3b24af=this[_0x17787f(0xb91)](this['_entity']['path'],_0xf1ff4a);!_0x3b24af&&PathStyleConver[_0x17787f(_0x313d22._0x340787)]({...this['options']['path'],'globalAlpha':_0xf1ff4a},this['_entity']['path'],!![]);}if(this['_entity']['circle']){const _0x1e4cd7=this['_updateEntityOpacity'](this['_entity']['circle'],_0xf1ff4a);!_0x1e4cd7&&CircleStyleConver['toCesiumVal']({...this[_0x17787f(_0x313d22._0x232cdb)]['circle'],'globalAlpha':_0xf1ff4a},this['_entity'][_0x17787f(_0x313d22._0x5cbf8c)],!![]);}}['_updateDistanceDisplayConditionByEdit'](){}}register$4('point',PointEntity,!![]);class BillboardEntity extends BasePointEntity{get[_0x3d5d32(0xa09)](){const _0x3c2549={_0x5a0ea9:0x4a5},_0x131512=_0x3d5d32;var _0x522068;return(_0x522068=this['_entity'])===null||_0x522068===void 0x0?void 0x0:_0x522068[_0x131512(_0x3c2549._0x5a0ea9)];}get['image'](){const _0x5299af=_0x3d5d32;return this[_0x5299af(0xdde)]['image'];}set['image'](_0x7e6934){const _0x20103d={_0x4654b4:0x89b},_0x43e2fd=_0x3d5d32;this['style']['image']=_0x7e6934,this[_0x43e2fd(_0x20103d._0x4654b4)]&&(this[_0x43e2fd(0x89b)]['billboard'][_0x43e2fd(0x8e1)]=_0x7e6934);}['_mountedHook'](){const _0x2a3a1d={_0x277e46:0xb69,_0x373464:0xdde,_0x2166c9:0x32a,_0x2544da:0x32a,_0x24def8:0x83d,_0x732956:0x600,_0x130395:0x433,_0x2d0084:0x6f1},_0x403a52=_0x3d5d32,_0x185590={'position':this[_0x403a52(_0x2a3a1d._0x277e46)],'billboard':BillboardStyleConver['toCesiumVal'](this['style'])};this['style']['label']&&(Cesium__namespace['defined'](this[_0x403a52(_0x2a3a1d._0x373464)]['clampToGround'])&&!Cesium__namespace['defined'](this['style'][_0x403a52(0x32a)]['clampToGround'])&&(this['style'][_0x403a52(_0x2a3a1d._0x2166c9)]['clampToGround']=this[_0x403a52(_0x2a3a1d._0x373464)]['clampToGround']),_0x185590[_0x403a52(_0x2a3a1d._0x2544da)]=LabelStyleConver['toCesiumVal'](this['style']['label'],{},this['attr']));this['options']['point']&&(_0x185590[_0x403a52(0xbbe)]=PointStyleConver[_0x403a52(_0x2a3a1d._0x24def8)](this['options']['point'],{},!![]));this['options'][_0x403a52(0x654)]&&(_0x185590['ellipse']=CircleStyleConver[_0x403a52(0x83d)](this['options'][_0x403a52(0x654)],{},!![]));this['options'][_0x403a52(_0x2a3a1d._0x732956)]&&(_0x185590['orientation']=this['getOrientation'](this['options'][_0x403a52(0x600)]),_0x185590['model']=ModelStyleConver['toCesiumVal'](this['options']['model'],{},!![]));if(this['options']['path']){var _0x1118bb,_0x1ffe4f;const _0x20bcf5=PathStyleConver['toCesiumVal'](this[_0x403a52(_0x2a3a1d._0x130395)]['path'],{},!![]);!_0x20bcf5['isAll']&&(_0x20bcf5['leadTime']=0x0);_0x185590['path']=_0x20bcf5;const _0x231629=(_0x1118bb=this['position'])===null||_0x1118bb===void 0x0?void 0x0:(_0x1ffe4f=_0x1118bb['_property'])===null||_0x1ffe4f===void 0x0?void 0x0:_0x1ffe4f['_times'];if(_0x231629&&_0x231629['length']>0x0){var _0x54c262;const _0x3fa568=_0x231629[0x0];let _0x10dfa3=_0x231629[_0x231629['length']-0x1];((_0x54c262=this['position'])===null||_0x54c262===void 0x0?void 0x0:_0x54c262['forwardExtrapolationType'])===Cesium__namespace[_0x403a52(0xaa6)]['HOLD']&&(_0x10dfa3=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),_0x185590['availability']=new Cesium__namespace[(_0x403a52(_0x2a3a1d._0x2d0084))]([new Cesium__namespace['TimeInterval']({'start':_0x3fa568,'stop':_0x10dfa3})]);}}this[_0x403a52(0x89b)]=this[_0x403a52(0x45f)](_0x185590);}['_addLabel'](){const _0x5d00e2={_0x12b2a0:0x89b,_0x4dad9f:0x32a},_0x1c09f2=_0x3d5d32;this['_entity']['label']=this[_0x1c09f2(_0x5d00e2._0x12b2a0)]['label']||{},LabelStyleConver['toCesiumVal'](this['style'][_0x1c09f2(_0x5d00e2._0x4dad9f)],this['_entity'][_0x1c09f2(_0x5d00e2._0x4dad9f)],this['attr']);}['_style2Json'](_0x2e86c4,_0x33097e){return BillboardStyleConver['toJSON'](_0x2e86c4,_0x33097e,!![]);}['_updateStyleHook'](_0x23e704,_0x186ea8){const _0x9786f1={_0x4b396f:0xa09},_0x9995f5=_0x3d5d32;BillboardStyleConver[_0x9995f5(0x83d)](_0x23e704,this[_0x9995f5(_0x9786f1._0x4b396f)]);}['_setOptionsHook'](_0x53aaf1,_0x4e591c){const _0x3274fe={_0x395fa7:0x89b,_0x1ce3c7:0xbbe},_0x227217=_0x3d5d32;_0x4e591c['model']&&ModelStyleConver['toCesiumVal'](_0x53aaf1['model'],this['_entity'][_0x227217(0x600)],!![]),_0x4e591c['point']&&PointStyleConver['toCesiumVal'](_0x53aaf1['point'],this[_0x227217(_0x3274fe._0x395fa7)][_0x227217(_0x3274fe._0x1ce3c7)],!![]),_0x4e591c['path']&&PathStyleConver['toCesiumVal'](_0x53aaf1['path'],this[_0x227217(_0x3274fe._0x395fa7)][_0x227217(0x4f5)],!![]),_0x4e591c['circle']&&CircleStyleConver['toCesiumVal'](_0x53aaf1['circle'],this['_entity']['ellipse'],!![]);}[_0x3d5d32(0x360)](_0x13aace){const _0x505d72={_0x244462:0x83d,_0x3bf46d:0xbbe,_0x6aa3d6:0x89b},_0x2055f1=_0x3d5d32;this['_entity']['model']&&(this['_entity'][_0x2055f1(0x600)]['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x13aace));if(this['_entity']['point']){const _0x6b21af=this[_0x2055f1(0xb91)](this[_0x2055f1(0x89b)][_0x2055f1(0xbbe)],_0x13aace);!_0x6b21af&&PointStyleConver[_0x2055f1(_0x505d72._0x244462)]({...this['options'][_0x2055f1(0xbbe)],'globalAlpha':_0x13aace},this['_entity'][_0x2055f1(_0x505d72._0x3bf46d)],!![]);}if(this[_0x2055f1(_0x505d72._0x6aa3d6)]['path']){const _0x10a3a1=this['_updateEntityOpacity'](this[_0x2055f1(0x89b)][_0x2055f1(0x4f5)],_0x13aace);!_0x10a3a1&&PathStyleConver['toCesiumVal']({...this['options'][_0x2055f1(0x4f5)],'globalAlpha':_0x13aace},this['_entity']['path'],!![]);}if(this['_entity'][_0x2055f1(0x654)]){const _0x1de5e9=this[_0x2055f1(0xb91)](this['_entity']['circle'],_0x13aace);!_0x1de5e9&&CircleStyleConver['toCesiumVal']({...this['options']['circle'],'globalAlpha':_0x13aace},this['_entity']['ellipse'],!![]);}}[_0x3d5d32(0x64a)](_0x854692){const _0x26b1df={_0x4df608:0x3db,_0x5cd351:0xbbe,_0x135852:0x433,_0x2eb8d8:0x4f5,_0x15ce7b:0x3db,_0x5714eb:0x654},_0x5ef939=_0x3d5d32;this['options']['model']&&(_0x854692['model']={},ModelStyleConver[_0x5ef939(_0x26b1df._0x4df608)](this['options']['model'],_0x854692['model'],!![])),this[_0x5ef939(0x433)][_0x5ef939(_0x26b1df._0x5cd351)]&&(_0x854692[_0x5ef939(_0x26b1df._0x5cd351)]={},PointStyleConver['toJSON'](this['options']['point'],_0x854692['point'],!![])),this[_0x5ef939(_0x26b1df._0x135852)][_0x5ef939(_0x26b1df._0x2eb8d8)]&&(_0x854692['path']={},PathStyleConver[_0x5ef939(_0x26b1df._0x15ce7b)](this['options'][_0x5ef939(0x4f5)],_0x854692['path'],!![])),this['options'][_0x5ef939(_0x26b1df._0x5714eb)]&&(_0x854692[_0x5ef939(0x654)]={},CircleStyleConver[_0x5ef939(0x3db)](this['options'][_0x5ef939(_0x26b1df._0x5714eb)],_0x854692[_0x5ef939(0x654)],!![]));}[_0x3d5d32(0xcfb)](){}[_0x3d5d32(0xb2d)](_0x4dd0d0){const _0x253beb={_0x2415de:0x4a5},_0x3ab77e=_0x3d5d32;this['style']['globalAlpha']=_0x4dd0d0,this['_entity']&&(this[_0x3ab77e(0x89b)][_0x3ab77e(_0x253beb._0x2415de)]['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x4dd0d0)),this['_updateLabelOpacity'](_0x4dd0d0);}[_0x3d5d32(0x4e5)](_0x167384={}){const _0x5e5f21={_0x582fc1:0xb0e,_0x46b5a3:0x32a,_0x396378:0x85e,_0x1307b9:0xc6d},_0x53acf8=_0x3d5d32;if(!this['_entity'])return;let _0x34078f=-(_0x167384['maxHeight']||0x32);const _0x3a8ba4=_0x167384['step']||0x1,_0x49c5ab=_0x167384['autoStop'];let _0x5b3fb1=_0x34078f,_0xbf154f=-0x1;const _0xd48ec1=this;function _0x24b759(){if(_0x5b3fb1<=_0x34078f&&_0xbf154f!==0x1)_0xbf154f=0x1,_0x49c5ab&&(_0x34078f*=0.55,_0x3a8ba4*0x2>=-_0x34078f&&_0xd48ec1['stopBounce']());else _0x5b3fb1>=0x0&&_0xbf154f!==-0x1&&(_0xbf154f=-0x1);_0x5b3fb1+=_0x3a8ba4*_0xbf154f;}const _0x11e8bd=getCesiumValue(this['entityGraphic'][_0x53acf8(0x85e)],Cesium__namespace['Cartesian2'])||new Cesium__namespace[(_0x53acf8(_0x5e5f21._0x582fc1))](0x0,0x0),_0x5d89fa=_0x11e8bd['clone']();this['entityGraphic']['pixelOffset_original']=_0x11e8bd,this['entityGraphic']['pixelOffset']=new Cesium__namespace['CallbackProperty'](_0x27e7ab=>{return _0x24b759(),_0x5d89fa['y']=_0x11e8bd['y']+_0x5b3fb1,_0x5d89fa;});if(this['_entity'][_0x53acf8(_0x5e5f21._0x46b5a3)]){const _0x1ccc98=getCesiumValue(this['_entity'][_0x53acf8(_0x5e5f21._0x46b5a3)][_0x53acf8(0x85e)],Cesium__namespace[_0x53acf8(0xb0e)])||new Cesium__namespace['Cartesian2'](0x0,0x0),_0x5691a4=_0x1ccc98['clone']();this['_entity']['label']['pixelOffset_original']=_0x1ccc98,this['_entity']['label'][_0x53acf8(_0x5e5f21._0x396378)]=new Cesium__namespace[(_0x53acf8(_0x5e5f21._0x1307b9))](_0x39754b=>{return _0x5691a4['y']=_0x1ccc98['y']+_0x5b3fb1,_0x5691a4;});}}['stopBounce'](){const _0x5a2218=_0x3d5d32;this[_0x5a2218(0xa09)]['pixelOffset']=this['entityGraphic']['pixelOffset_original'],this['_entity']['label']&&(this['_entity']['label']['pixelOffset']=this['_entity'][_0x5a2218(0x32a)]['pixelOffset_original']);}}register$4('billboard',BillboardEntity,!![]);class DivBillboardEntity extends BillboardEntity{['_mountedHook'](){const _0x5d60e7={_0x45f4e9:0xc79},_0x4d2a88=_0x3d5d32;super['_mountedHook'](),this[_0x4d2a88(_0x5d60e7._0x45f4e9)]();}[_0x3d5d32(0x7b3)](_0x5d3d62,_0x523eeb){delete _0x5d3d62['image'],super['_updateStyleHook'](_0x5d3d62,_0x523eeb),_0x523eeb&&(_0x523eeb['html']||_0x523eeb['iconSize']||_0x523eeb['color'])&&this['_updateImage_delay']();}['_updateImage_delay'](){const _0x5edb4c={_0x2149cb:0x5c5},_0x448e66=_0x3d5d32;this['updateTimer']&&clearTimeout(this[_0x448e66(0x830)]),this['updateTimer']=setTimeout(()=>{const _0xa97687=_0x448e66;delete this['updateTimer'];if(!this['_entity'])return;this[_0xa97687(_0x5edb4c._0x2149cb)]();},0x12c);}['_updateImage'](){const _0x3a37c3={_0x11bdff:0xdde,_0x493af1:0x85b,_0x531c7f:0x399},_0x35bc4d={_0x707d85:0x8e1},_0x1fa1ba={_0x5cd005:0x750},_0x232685={_0x1c5a5d:0xefc},_0x4d528c=_0x3d5d32,_0x262d25=create$3('div','mars3d-hideDiv'),_0x191d95=this[_0x4d528c(_0x3a37c3._0x11bdff)]['html'];if(isString(_0x191d95))_0x262d25[_0x4d528c(0xae5)]=_0x191d95;else _0x191d95 instanceof Element&&_0x262d25[_0x4d528c(_0x3a37c3._0x493af1)](_0x191d95);document['body']['appendChild'](_0x262d25),this['_islosdImg']=!![];if(window['domtoimage'])window['domtoimage']['toPng'](_0x262d25)['then'](_0x2f9504=>{const _0x34a06c=_0x4d528c;this['entityGraphic']['image']=''+_0x2f9504,document['body']['removeChild'](_0x262d25),this['_islosdImg']=![],this[_0x34a06c(_0x232685._0x1c5a5d)]('image',{'image':_0x2f9504});})[_0x4d528c(_0x3a37c3._0x531c7f)](_0x5e9b3f=>{const _0x1cdd08=_0x4d528c;logError$1('未知原因,导出失败!',_0x5e9b3f),document[_0x1cdd08(_0x1fa1ba._0x5cd005)][_0x1cdd08(0xac2)](_0x262d25),this['_islosdImg']=![];});else window[_0x4d528c(0x990)]&&window['html2canvas'](_0x262d25,{'backgroundColor':null,'allowTaint':!![]})['then'](_0xe417a0=>{const _0x4ce133=_0x4d528c;this[_0x4ce133(0xa09)]['image']=_0xe417a0,document['body'][_0x4ce133(0xac2)](_0x262d25),this['_islosdImg']=![],this[_0x4ce133(0xefc)](_0x4ce133(_0x35bc4d._0x707d85),{'canvas':_0xe417a0});})['catch'](_0x1d507b=>{const _0xab5a7c=_0x4d528c;logError$1(_0xab5a7c(0xdd2),_0x1d507b),document['body']['removeChild'](_0x262d25),this['_islosdImg']=![];});}}register$4('divBillboard',DivBillboardEntity,!![]);class FontBillboardEntity extends DivBillboardEntity{['_updateImage'](){const _0x5efa8b={_0xd5ce32:0x8ea,_0x39fc69:0xc83,_0xe19d3a:0x3dc,_0x3a37e0:0xd85,_0x168a79:0xc36,_0x53fac0:0x990,_0x286c40:0x399},_0x1c3ef8={_0x1723bc:0xa09},_0x484d92={_0x171236:0xdd2,_0x46fef:0x750,_0x12bb30:0x68d},_0x2091a5={_0x2b0a79:0xac2,_0xab90d6:0xefc},_0x295ce1=_0x3d5d32,_0x6f2018=this[_0x295ce1(0xdde)]['iconSize']??0x32,_0x288c2c=this['style'][_0x295ce1(0x23a)]??0xa,_0x411814=this['style']['color']??_0x295ce1(_0x5efa8b._0xd5ce32),_0x3767c5=create$3(_0x295ce1(0x667),'mars3d-hideDiv');_0x3767c5['setAttribute']('style',_0x295ce1(0x763)+_0x288c2c+'px;text-align:center;max-width:'+_0x6f2018+'px;max-height:'+_0x6f2018+_0x295ce1(_0x5efa8b._0x39fc69));const _0x51e1e5=document[_0x295ce1(_0x5efa8b._0xe19d3a)]('i');_0x51e1e5[_0x295ce1(_0x5efa8b._0x3a37e0)](_0x295ce1(_0x5efa8b._0x168a79),this[_0x295ce1(0xdde)][_0x295ce1(0x63b)]),_0x51e1e5['setAttribute']('style','font-size:'+_0x6f2018+'px;color:'+_0x411814+';'),_0x3767c5['appendChild'](_0x51e1e5),document['body']['appendChild'](_0x3767c5),this['_islosdImg']=!![];if(window['domtoimage'])window['domtoimage']['toPng'](_0x3767c5)['then'](_0x3d6e2a=>{const _0x1217f6=_0x295ce1;this[_0x1217f6(0xa09)]['image']=''+_0x3d6e2a,document['body'][_0x1217f6(_0x2091a5._0x2b0a79)](_0x3767c5),this['_islosdImg']=![],this[_0x1217f6(_0x2091a5._0xab90d6)]('image',{'image':_0x3d6e2a});})['catch'](_0xde9bd8=>{const _0x4ab9d5=_0x295ce1;logError$1(_0x4ab9d5(_0x484d92._0x171236),_0xde9bd8),document[_0x4ab9d5(_0x484d92._0x46fef)]['removeChild'](_0x3767c5),this[_0x4ab9d5(_0x484d92._0x12bb30)]=![];});else window['html2canvas']&&window[_0x295ce1(_0x5efa8b._0x53fac0)](_0x3767c5,{'backgroundColor':null,'allowTaint':!![]})[_0x295ce1(0x44d)](_0x29c70b=>{const _0x33c697=_0x295ce1;this[_0x33c697(_0x1c3ef8._0x1723bc)]['image']=_0x29c70b,document['body']['removeChild'](_0x3767c5),this['_islosdImg']=![],this['fire']('image',{'canvas':_0x29c70b});})[_0x295ce1(_0x5efa8b._0x286c40)](_0x1811ee=>{logError$1('未知原因,导出失败!',_0x1811ee),document['body']['removeChild'](_0x3767c5),this['_islosdImg']=![];});}}register$4('fontBillboard',FontBillboardEntity,!![]);class LabelEntity extends BasePointEntity{get['entityGraphic'](){const _0x263d48={_0x36ea65:0x89b},_0x1b2972=_0x3d5d32;var _0x1159f3;return(_0x1159f3=this[_0x1b2972(_0x263d48._0x36ea65)])===null||_0x1159f3===void 0x0?void 0x0:_0x1159f3['label'];}get['label'](){const _0x4d1d0c=_0x3d5d32;return this['_entity']?this['_entity'][_0x4d1d0c(0x32a)]:this['style'];}get['text'](){return this['style']['text'];}set['text'](_0x554892){const _0x2fda9d=_0x3d5d32;this['style'][_0x2fda9d(0x76b)]=_0x554892,this['_entity']&&(this['entityGraphic']['text']=_0x554892);}['_mountedHook'](){const _0x332c85=_0x3d5d32,_0x18157a={'position':this['position'],'label':LabelStyleConver[_0x332c85(0x83d)](this['style'])};this[_0x332c85(0x89b)]=this['_createEntity'](_0x18157a),this[_0x332c85(0x7a0)]();}['_removedHook'](){const _0x49e22b={_0x4c4a21:0x566},_0x5c42fc=_0x3d5d32;super[_0x5c42fc(_0x49e22b._0x4c4a21)](),this[_0x5c42fc(0x661)]();}['_addLabel'](){}[_0x3d5d32(0x53e)](_0x37fc44,_0x5bc5aa){return LabelStyleConver['toJSON'](_0x37fc44,_0x5bc5aa,!![]);}[_0x3d5d32(0x7b3)](_0x2e97f0,_0x24b963){const _0x4ca24d=_0x3d5d32;LabelStyleConver[_0x4ca24d(0x83d)](_0x2e97f0,this['entityGraphic']),Cesium__namespace['defined'](_0x24b963['clampToGround'])&&(this['_bindMorphComplete'](),this['_map_morphCompleteHandler']());}['_updateDistanceDisplayConditionByEdit'](){}['_bindMorphComplete'](){const _0x4f31d6={_0x4fe501:0xdde,_0x145ed5:0x1d1},_0x17c412=_0x3d5d32;this['_unbindMorphComplete'](),this[_0x17c412(_0x4f31d6._0x4fe501)]['clampToGround']&&this[_0x17c412(_0x4f31d6._0x145ed5)]['on'](EventType['morphComplete'],this['_map_morphCompleteHandler'],this);}['_unbindMorphComplete'](){const _0x2c81dd={_0xc67224:0x28d},_0x250b20=_0x3d5d32;this['_map'][_0x250b20(0x9e7)](EventType['morphComplete'],this[_0x250b20(_0x2c81dd._0xc67224)],this);}['_map_morphCompleteHandler'](_0x45075e){const _0x5c6ec1=_0x3d5d32;this['_map']['scene'][_0x5c6ec1(0x6e1)]===Cesium__namespace['SceneMode'][_0x5c6ec1(0x8d7)]?this['entityGraphic']['heightReference']=Cesium__namespace['HeightReference']['NONE']:this['entityGraphic']['heightReference']=this['style'][_0x5c6ec1(0x7c0)]?Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']:Cesium__namespace['HeightReference']['NONE'];}['startBounce'](_0xd62a3={}){const _0x2f7b70={_0x50d46b:0x880},_0x441dc3=_0x3d5d32;if(!this[_0x441dc3(0x89b)])return;let _0x46834f=-(_0xd62a3['maxHeight']||0x32);const _0x384b9a=_0xd62a3['step']||0x1,_0x56cf67=_0xd62a3[_0x441dc3(_0x2f7b70._0x50d46b)];let _0x432b17=_0x46834f,_0x25163a=-0x1;const _0x2e38a5=this;function _0x13cd07(){if(_0x432b17<=_0x46834f&&_0x25163a!==0x1)_0x25163a=0x1,_0x56cf67&&(_0x46834f*=0.55,_0x384b9a*0x2>=-_0x46834f&&_0x2e38a5['stopBounce']());else _0x432b17>=0x0&&_0x25163a!==-0x1&&(_0x25163a=-0x1);_0x432b17+=_0x384b9a*_0x25163a;}const _0x4b1eaa=getCesiumValue(this['entityGraphic']['pixelOffset'],Cesium__namespace['Cartesian2'])||new Cesium__namespace[(_0x441dc3(0xb0e))](0x0,0x0),_0x5f97ca=_0x4b1eaa['clone']();this['entityGraphic']['pixelOffset_original']=_0x4b1eaa,this['entityGraphic'][_0x441dc3(0x85e)]=new Cesium__namespace['CallbackProperty'](_0x1c279e=>{return _0x13cd07(),_0x5f97ca['y']=_0x4b1eaa['y']+_0x432b17,_0x5f97ca;});}['stopBounce'](){const _0x23323e={_0x1d2f97:0x85e,_0x42883e:0xa32},_0x5c3ee7=_0x3d5d32;this['entityGraphic'][_0x5c3ee7(_0x23323e._0x1d2f97)]=this['entityGraphic'][_0x5c3ee7(_0x23323e._0x42883e)];}['setOpacity'](_0x55d907){const _0x2a19bd={_0x4508f1:0xdde},_0x43aa96=_0x3d5d32;this[_0x43aa96(_0x2a19bd._0x4508f1)][_0x43aa96(0xc96)]=_0x55d907,this['_entity']&&LabelStyleConver['setOpacity'](this['entityGraphic'],_0x55d907);}}register$4('label',LabelEntity,!![]);class CanvasLabelEntity extends BillboardEntity{['_mountedHook'](){const _0x39dece=_0x3d5d32;super[_0x39dece(0xe4c)](),this['_updateImage_delay'](this['style']);}['_onBeforeCreate'](_0x33b390){const _0x333cde={_0x1fdd1c:0x4a5,_0x8ccb4e:0x8e1},_0x48b9e1=_0x3d5d32;var _0x336b40,_0x2cae52;return Cesium__namespace['defined'](_0x33b390===null||_0x33b390===void 0x0?void 0x0:(_0x336b40=_0x33b390[_0x48b9e1(_0x333cde._0x1fdd1c)])===null||_0x336b40===void 0x0?void 0x0:_0x336b40[_0x48b9e1(_0x333cde._0x8ccb4e)])&&delete _0x33b390['billboard']['image'],Cesium__namespace['defined'](_0x33b390===null||_0x33b390===void 0x0?void 0x0:(_0x2cae52=_0x33b390['billboard'])===null||_0x2cae52===void 0x0?void 0x0:_0x2cae52['color'])&&delete _0x33b390['billboard']['color'],_0x33b390;}['_updateStyleHook'](_0x3b8ccf,_0x5e1f65){const _0x533bda={_0x1c9185:0xe8f},_0x47eb82=_0x3d5d32,_0x25318e={..._0x3b8ccf};delete _0x25318e['image'],delete _0x25318e[_0x47eb82(_0x533bda._0x1c9185)],super['_updateStyleHook'](_0x25318e,_0x5e1f65),this['_updateImage_delay'](_0x3b8ccf);}[_0x3d5d32(0xc79)](_0x494b12){const _0x702da7={_0x15c9c1:0x89b},_0x3b5835=_0x3d5d32;this['updateTimer']&&clearTimeout(this[_0x3b5835(0x830)]),this['updateTimer']=setTimeout(()=>{const _0x335134=_0x3b5835;delete this['updateTimer'];if(!this[_0x335134(_0x702da7._0x15c9c1)])return;this['_updateImage'](_0x494b12);},0x64);}['_updateImage'](_0x5848cb){const _0x4a987b={_0x241259:0x8e1},_0x3109cd=_0x3d5d32,_0x3c4b4c=LabelStyleConver['toCesiumVal'](_0x5848cb),_0x1220e2=getTextImage(_0x3c4b4c['text'],_0x3c4b4c);_0x1220e2&&(this['entityGraphic'][_0x3109cd(_0x4a987b._0x241259)]=_0x1220e2);}}register$4('canvasLabel',CanvasLabelEntity,!![]);class EditCircle extends EditPoly{['bindDraggers'](){const _0x469d4c={_0x157cca:0x1d1,_0x55627e:0x4f8,_0x382120:0xa09,_0x283992:0x31f,_0x7db164:0x813,_0x5c5daf:0x422,_0x405b02:0xb75,_0x52dfc1:0x831,_0x54f2cb:0x30b},_0x36a549={_0x3781db:0xc84},_0x44375e={_0x483d89:0xfa7},_0x11ebff={_0x273194:0x5f9,_0x1c979d:0x741,_0x4392d6:0x46e,_0x3738f6:0xefc},_0x2df435={_0x5671b4:0x792},_0x1e688a={_0x172d02:0xfa7},_0x574c65={_0x78650d:0xa09,_0x8b1132:0x46e},_0x157777={_0x1b2509:0xf5a},_0x112d36=_0x3d5d32,_0x5022db=this['positions'],_0x13cc36=this['updatePositionsHeightByAttr'](_0x5022db[0x0]),_0x2d5eb0=this[_0x112d36(_0x469d4c._0x157cca)][_0x112d36(0x9f4)][_0x112d36(_0x469d4c._0x55627e)],_0x58f613=getEllipseOuterPositions({'position':_0x13cc36,'semiMajorAxis':getCesiumValue(this[_0x112d36(_0x469d4c._0x382120)]['semiMajorAxis'],Number,_0x2d5eb0),'semiMinorAxis':getCesiumValue(this['entityGraphic'][_0x112d36(0x741)],Number,_0x2d5eb0),'rotation':getCesiumValue(this['entityGraphic'][_0x112d36(_0x469d4c._0x283992)],Number,_0x2d5eb0)??0x0,'count':0x1}),_0x5c8c27=this[_0x112d36(0x813)](_0x58f613[0x1]);_0x5022db[0x1]=_0x5c8c27;const _0x5b8eea=this['createDragger']({'position':_0x5c8c27,'type':PointType[_0x112d36(0x1dd)],'tooltip':this['_map']['getLangText']('_修改半径'),'onDragStart':(_0x1c55e6,_0x2afa32)=>{const _0x3dd72f=_0x112d36;if(!this[_0x3dd72f(_0x157777._0x1b2509)])return;for(let _0x10e7e6=0x0,_0x3ef09a=this['_heightDraggers']['length'];_0x10e7e6<_0x3ef09a;_0x10e7e6++){this['_heightDraggers'][_0x10e7e6]['show']=![];}},'onDrag':(_0x5be2d2,_0x3eaa47)=>{const _0x1bfef5=_0x112d36;if(this['entityGraphic']['height']!==undefined){const _0x5da0ac=getCesiumValue(this[_0x1bfef5(_0x574c65._0x78650d)]['height'],Number,_0x2d5eb0);_0x3eaa47=setPositionsHeight(_0x3eaa47,_0x5da0ac),_0x5be2d2[_0x1bfef5(0xb69)]=_0x3eaa47;}_0x5022db[_0x5be2d2['index']]=_0x3eaa47;const _0x2dbd09=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](_0x5022db[0x0],_0x3eaa47),0x2);this['entityGraphic']['semiMajorAxis']=_0x2dbd09,this['_graphic'][_0x1bfef5(_0x574c65._0x8b1132)]===0x3||!Cesium__namespace['defined'](this['style']['radius'])?this[_0x1bfef5(0xdde)][_0x1bfef5(0x905)]=_0x2dbd09:(this['entityGraphic']['semiMinorAxis']=_0x2dbd09,this['style']['radius']=_0x2dbd09),this['fire'](EventType['editStyle']);},'onDragEnd':(_0x4ae235,_0x21c2a9)=>{const _0x5347c4=_0x112d36;this[_0x5347c4(_0x1e688a._0x172d02)]();}});_0x5b8eea['index']=0x1,this['draggers']['push'](_0x5b8eea);let _0x428a06;if(this[_0x112d36(0x6cc)]['_maxPointNum']===0x3){const _0x525686=this[_0x112d36(_0x469d4c._0x7db164)](_0x58f613[0x0]);_0x5022db[0x2]=_0x525686,_0x428a06=this['createDragger']({'position':_0x525686,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改半径'),'onDragStart':(_0x297571,_0x5ba4bf)=>{const _0x4265a0=_0x112d36;if(!this['_heightDraggers'])return;for(let _0x323b40=0x0,_0x16b18e=this['_heightDraggers']['length'];_0x323b40<_0x16b18e;_0x323b40++){this[_0x4265a0(0xf5a)][_0x323b40][_0x4265a0(_0x2df435._0x5671b4)]=![];}},'onDrag':(_0x1ededf,_0xa43f5c)=>{const _0x4ca28b=_0x112d36;if(this[_0x4ca28b(0xa09)]['height']!==undefined){const _0x4b0abc=getCesiumValue(this['entityGraphic']['height'],Number,_0x2d5eb0);_0xa43f5c=setPositionsHeight(_0xa43f5c,_0x4b0abc),_0x1ededf['position']=_0xa43f5c;}_0x5022db[_0x1ededf[_0x4ca28b(_0x11ebff._0x273194)]]=_0xa43f5c;let _0x561602=this['formatNum'](Cesium__namespace['Cartesian3'][_0x4ca28b(0xbd7)](_0x5022db[0x0],_0xa43f5c),0x2);const _0xb0ede2=getCesiumValue(this['entityGraphic']['semiMajorAxis'],Number,_0x2d5eb0);_0x561602>_0xb0ede2&&(_0x561602=_0xb0ede2),this['entityGraphic'][_0x4ca28b(_0x11ebff._0x1c979d)]=_0x561602,this['_graphic'][_0x4ca28b(_0x11ebff._0x4392d6)]===0x3||!Cesium__namespace['defined'](this['style']['radius'])?this['style']['semiMinorAxis']=_0x561602:(this['entityGraphic']['semiMajorAxis']=_0x561602,this['style']['radius']=_0x561602),this[_0x4ca28b(_0x11ebff._0x3738f6)](EventType['editStyle']);},'onDragEnd':(_0x3da432,_0x225abf)=>{const _0x270d82=_0x112d36;this[_0x270d82(_0x44375e._0x483d89)]();}}),_0x428a06['index']=0x2,this['draggers']['push'](_0x428a06);}if(this[_0x112d36(0x6cc)][_0x112d36(_0x469d4c._0x5c5daf)]){const _0x438ff4=this['createDragger']({'position':_0x13cc36,'onDragStart':(_0x59df7e,_0x17102b)=>{const _0x4422f1=_0x112d36;for(let _0x5af2f2=0x0,_0x23a1e2=this['draggers'][_0x4422f1(_0x36a549._0x3781db)];_0x5af2f2<_0x23a1e2;_0x5af2f2++){this['draggers'][_0x5af2f2]['show']=![];}},'onDrag':(_0x299ab8,_0x1e9a55)=>{_0x5022db[0x0]=_0x1e9a55;},'onDragEnd':(_0x5aa3b4,_0x11a8c2)=>{this['updateDraggers']();}});_0x438ff4['index']=0x0,this['draggers'][_0x112d36(_0x469d4c._0x405b02)](_0x438ff4),_0x438ff4['majorDragger']=_0x5b8eea,_0x438ff4['minorDragger']=_0x428a06;}if(this['entityGraphic'][_0x112d36(_0x469d4c._0x52dfc1)]){const _0x2a9f29=this['_graphic']['_maxPointNum']===0x3?[_0x5022db[0x1],_0x5022db[0x2]]:[_0x5022db[0x1]];this[_0x112d36(_0x469d4c._0x54f2cb)](_0x2a9f29);}}[_0x3d5d32(0x813)](_0x232e31){const _0xe3dc17={_0x372c70:0xa09,_0x22d919:0x83e,_0x363a67:0x4f8},_0x17cd0e=_0x3d5d32;this['clampToGround']&&(_0x232e31=getSurfacePosition(this['_map']['scene'],_0x232e31));if(this[_0x17cd0e(_0xe3dc17._0x372c70)]['height']!==undefined){const _0x506346=getCesiumValue(this['entityGraphic'][_0x17cd0e(_0xe3dc17._0x22d919)],Number,this['_map']['clock'][_0x17cd0e(_0xe3dc17._0x363a67)]);_0x232e31=setPositionsHeight(_0x232e31,_0x506346);}return _0x232e31;}[_0x3d5d32(0x7b3)](_0x4f3568){const _0x722564=_0x3d5d32;super['_updateStyleHook'](_0x4f3568),(Cesium__namespace['defined'](_0x4f3568['radius'])||Cesium__namespace['defined'](_0x4f3568['semiMinorAxis'])||Cesium__namespace['defined'](_0x4f3568['semiMajorAxis'])||Cesium__namespace['defined'](_0x4f3568['height'])||Cesium__namespace['defined'](_0x4f3568['diffHeight']))&&this[_0x722564(0xfa7)]();}[_0x3d5d32(0x8ac)](_0x524a1d){}}class CircleEntity extends BasePointEntity{constructor(_0x28b481={}){const _0x47a11e={_0x4a19f9:0x98b},_0x5c264e=_0x3d5d32;super(_0x28b481),this['_minPointNum']=0x2,this['_maxPointNum']=0x2,this['_hasMoveEdit']=_0x28b481[_0x5c264e(_0x47a11e._0x4a19f9)]??!![],this['_clampToGround_reload']=!![],this['options']['drawShowRadius']=this['options'][_0x5c264e(0xd8b)]??!![];}get['entityGraphic'](){var _0x381581;return(_0x381581=this['_entity'])===null||_0x381581===void 0x0?void 0x0:_0x381581['ellipse'];}get[_0x3d5d32(0x98e)](){return EditCircle;}get['outlinePositions'](){const _0x378382=_0x3d5d32;return this[_0x378382(0x89b)]&&(this['_outlinePositions']=this['getOutlinePositions']()),this[_0x378382(0x3e5)];}set['outlinePositions'](_0x59effa){const _0x273f53=_0x3d5d32;this[_0x273f53(0x3e5)]=_0x59effa;}get['outlineCoordinates'](){return cartesians2lonlats(this['outlinePositions']);}get[_0x3d5d32(0xbd7)](){return Math['PI']*0x2*this['radius'];}get[_0x3d5d32(0x772)](){const _0xeb3f56=_0x3d5d32,_0x47c294=this[_0xeb3f56(0xd61)];return Math['PI']*_0x47c294*_0x47c294;}get['radius'](){const _0x5e3859={_0x30c91a:0xd61,_0x6ad433:0xa09,_0x42b988:0x8b7},_0xa8c161=_0x3d5d32;var _0x589fba;if(this['style']['radius'])return this['style'][_0xa8c161(_0x5e3859._0x30c91a)];return getCesiumValue((_0x589fba=this[_0xa8c161(_0x5e3859._0x6ad433)])===null||_0x589fba===void 0x0?void 0x0:_0x589fba['semiMajorAxis'],Number,Cesium__namespace[_0xa8c161(_0x5e3859._0x42b988)]['now']());}set['radius'](_0x29302e){const _0x321e8a={_0x4f739c:0xa09,_0x205797:0x212},_0x851283=_0x3d5d32;this['style']['radius']=_0x29302e,this[_0x851283(0xa09)]&&(this['entityGraphic']['semiMajorAxis']=_0x29302e,this[_0x851283(_0x321e8a._0x4f739c)][_0x851283(0x741)]=_0x29302e,this[_0x851283(_0x321e8a._0x205797)](this['_getOutlinePositions'](),this['style']));}get[_0x3d5d32(0x83e)](){const _0x5097d9=_0x3d5d32;var _0x3aafc6;if(this['style'][_0x5097d9(0x83e)])return this['style']['height'];return getCesiumValue((_0x3aafc6=this['entityGraphic'])===null||_0x3aafc6===void 0x0?void 0x0:_0x3aafc6['height'],Number)??0x0;}set['height'](_0xdf0592){const _0x5a1f06={_0x2dd9b0:0xa09},_0x4f363d=_0x3d5d32;this['style']['height']=_0xdf0592,this[_0x4f363d(_0x5a1f06._0x2dd9b0)]&&(this['entityGraphic']['height']=_0xdf0592);}['_mountedHook'](){const _0x2f3b9b={_0x572bf3:0x83d,_0x116286:0xb84,_0x48dd8d:0xdde,_0x316c0b:0x3d2,_0x427b5d:0x89b,_0x13ec68:0xdde},_0x3804ce=_0x3d5d32,_0x12ddb2={'position':this['position'],'ellipse':CircleStyleConver[_0x3804ce(_0x2f3b9b._0x572bf3)](this['style'],{},!![])},_0x47cf4a=this['style']['label'];_0x47cf4a&&(Cesium__namespace['defined'](this[_0x3804ce(0xdde)]['clampToGround'])&&!Cesium__namespace[_0x3804ce(_0x2f3b9b._0x116286)](_0x47cf4a['clampToGround'])&&(_0x47cf4a['clampToGround']=this[_0x3804ce(_0x2f3b9b._0x48dd8d)][_0x3804ce(0x7c0)]),Cesium__namespace['defined'](_0x47cf4a[_0x3804ce(0x9e4)])||Cesium__namespace[_0x3804ce(0xb84)](_0x47cf4a['addHeight'])?this[_0x3804ce(_0x2f3b9b._0x316c0b)]():_0x12ddb2['label']=LabelStyleConver['toCesiumVal'](this['style']['label'],{},this['attr'])),this[_0x3804ce(_0x2f3b9b._0x427b5d)]=this['_createEntity'](_0x12ddb2),this['_updateHeight'](),this['_updateOutlineStyle'](this['_getOutlinePositions'](),this[_0x3804ce(_0x2f3b9b._0x13ec68)]),(this['position']instanceof Cesium__namespace['CallbackProperty']||this[_0x3804ce(0xb69)]instanceof Cesium__namespace[_0x3804ce(0xbe9)])&&this['_updateOutlineToCallback']();}['_addLabel'](){const _0x2d10e4={_0x5e0ef9:0x32a,_0x24a4a4:0x3d2,_0x125a55:0x32a,_0x354a75:0x32a},_0x3122bb=_0x3d5d32,_0x4541e9=this[_0x3122bb(0xdde)][_0x3122bb(0x32a)];if(Cesium__namespace['defined'](_0x4541e9['setHeight'])||Cesium__namespace['defined'](_0x4541e9['addHeight'])){var _0x26ac61;(_0x26ac61=this[_0x3122bb(0x89b)])!==null&&_0x26ac61!==void 0x0&&_0x26ac61['label']&&(this['_entity'][_0x3122bb(_0x2d10e4._0x5e0ef9)][_0x3122bb(0x792)]=![]),super[_0x3122bb(_0x2d10e4._0x24a4a4)]();}else this['_entity'][_0x3122bb(_0x2d10e4._0x125a55)]=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](this['style'][_0x3122bb(_0x2d10e4._0x354a75)],this[_0x3122bb(0x89b)]['label'],this['attr']);}[_0x3d5d32(0x53e)](_0x21648b,_0x392cad){return CircleStyleConver['toJSON'](_0x21648b,_0x392cad,!![]);}['toGeoJSON'](_0x12b5c1){const _0x5e6be1={_0x33fa5b:0x29e},_0xcb5a7=_0x3d5d32;return super[_0xcb5a7(_0x5e6be1._0x33fa5b)](_0x12b5c1);}['_getGeoJsonGeometry'](_0x53a195){const _0x18ad17=_0x3d5d32;return _0x53a195!==null&&_0x53a195!==void 0x0&&_0x53a195[_0x18ad17(0xe7a)]?{'type':'Polygon','coordinates':[this['getOutlineCoordinates'](_0x53a195===null||_0x53a195===void 0x0?void 0x0:_0x53a195['closure'],_0x53a195===null||_0x53a195===void 0x0?void 0x0:_0x53a195['count'],_0x53a195===null||_0x53a195===void 0x0?void 0x0:_0x53a195['noAlt'])]}:{'type':'Point','coordinates':this['getCoordinate'](_0x53a195===null||_0x53a195===void 0x0?void 0x0:_0x53a195['noAlt'])};}['_updateStyleHook'](_0x1e22e1,_0x2288a7){const _0x1e285c={_0x42c36e:0xb84},_0x542743=_0x3d5d32;CircleStyleConver['toCesiumVal'](_0x1e22e1,this['entityGraphic'],!![]);(Cesium__namespace['defined'](_0x2288a7['diffHeight'])||Cesium__namespace['defined'](_0x2288a7['height']))&&this['_updateHeight']();if(_0x2288a7!==null&&_0x2288a7!==void 0x0&&_0x2288a7['label']){Cesium__namespace['defined'](_0x1e22e1[_0x542743(0x7c0)])&&!Cesium__namespace[_0x542743(_0x1e285c._0x42c36e)](_0x1e22e1['label'][_0x542743(0x7c0)])&&(_0x1e22e1['label']['clampToGround']=_0x1e22e1['clampToGround']);if(Cesium__namespace['defined'](_0x1e22e1['label']['setHeight'])||Cesium__namespace['defined'](_0x1e22e1['label']['addHeight'])){var _0x1bb7aa;(_0x1bb7aa=this['_entity'])!==null&&_0x1bb7aa!==void 0x0&&_0x1bb7aa['label']&&(this['_entity'][_0x542743(0x32a)]['show']=![]),this['_addLabel']();}else this['_entity']['label']=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](_0x1e22e1[_0x542743(0x32a)],this['_entity'][_0x542743(0x32a)],this['attr']);}}[_0x3d5d32(0x367)](){const _0x5bfa=_0x3d5d32;this['_entity']['position']=this['position'],this[_0x5bfa(0x83c)](),this['_updateOutlineStyle'](this[_0x5bfa(0x275)](),this['style']),this['_updateLabelPosition'](),this[_0x5bfa(0x7b9)]();}[_0x3d5d32(0x275)](){const _0x5f0de8={_0x43cb40:0x4ef},_0xf60dc9=_0x3d5d32;return[this[_0xf60dc9(_0x5f0de8._0x43cb40)]];}['_setPositionsToCallback'](){const _0x3ed687=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![],this['_positions_draw']=this['positions']||[],this[_0x3ed687(0xb69)]=new Cesium__namespace['CallbackProperty'](_0x16cbaa=>{const _0x62a27e=_0x3ed687;if(this['_positions_draw'][_0x62a27e(0xc84)]<0x1)return null;return this[_0x62a27e(0xd76)][0x0];},![]),this['_updateOutlineToCallback']();}['_cancelPositionsCallback'](){const _0x5db454={_0x9b2db4:0x3a0},_0x3d9e75=_0x3d5d32;if(!this['_isCallbackPositions'])return;this[_0x3d9e75(_0x5db454._0x9b2db4)]=![],this[_0x3d9e75(0x87d)]=this['_positions_draw'][0x0],this['_point']=LngLatPoint['fromCartesian'](this['_position']),this['_updatePositionsHook']();}['_updateHeight'](){const _0xb4454b={_0x59944d:0xb84,_0x5b0142:0xdde,_0x24b9d7:0xa09,_0x2063cd:0x831},_0x2ac339=_0x3d5d32;var _0x49fe1e;if(this['style']['clampToGround'])return;let _0x27c300=this[_0x2ac339(0x87d)];((_0x49fe1e=this['_positions_draw'])===null||_0x49fe1e===void 0x0?void 0x0:_0x49fe1e['length'])>0x0&&(_0x27c300=this['_positions_draw'][0x0]);if(!_0x27c300)return;const _0x3c1436=this['style']['height']??LngLatPoint['fromCartesian'](_0x27c300)['alt'];this['entityGraphic']['height']=_0x3c1436,Cesium__namespace[_0x2ac339(0xb84)](this['style']['diffHeight'])&&(Cesium__namespace[_0x2ac339(_0xb4454b._0x59944d)](this['style']['diffHeight'])&&this[_0x2ac339(_0xb4454b._0x5b0142)]['diffHeight']!==0x0?this['entityGraphic']['extrudedHeight']=_0x3c1436+this['style']['diffHeight']:this[_0x2ac339(_0xb4454b._0x24b9d7)][_0x2ac339(_0xb4454b._0x2063cd)]=undefined),this['fire'](EventType['editStyle']);}[_0x3d5d32(0xa57)](){const _0x5e921c=_0x3d5d32;this[_0x5e921c(0x1d1)]['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](this['_drawEndEventType'],this[_0x5e921c(0xc7b)],this),(this[_0x5e921c(0x433)]['hasDrawDelPoint']??!![])&&this['_map']['on'](this['_drawDelEventType'],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x43db7f={_0x3120b1:0x1d1,_0x2fce2b:0x314},_0x45f97d=_0x3d5d32;this[_0x45f97d(_0x43db7f._0x3120b1)]['off'](EventType[_0x45f97d(_0x43db7f._0x2fce2b)],this['_onMouseMoveHandler'],this),this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this['_map']['off'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this['options']['hasDrawDelPoint']??!![])&&this['_map'][_0x45f97d(0x9e7)](this['_drawDelEventType'],this['_onRightClickHandler'],this);}[_0x3d5d32(0x4fa)](_0x190948){const _0x345e47={_0x58215d:0xc84,_0x26a91c:0xd86,_0x487b73:0xd13,_0x1900dc:0xd1b,_0x39546b:0xd8b},_0x565885=_0x3d5d32;if(this['_positions_draw'][_0x565885(_0x345e47._0x58215d)]<=0x1){this['_map'][_0x565885(_0x345e47._0x26a91c)](_0x190948[_0x565885(_0x345e47._0x487b73)],this['_map'][_0x565885(_0x345e47._0x1900dc)]('_单击开始绘制'));return;}let _0x391423='';if(this['options'][_0x565885(_0x345e47._0x39546b)]&&this['_positions_draw']['length']>0x0&&_0x190948['cartesian']){const _0x1f7b9f=Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],_0x190948['cartesian']);_0x1f7b9f>0x0&&(_0x391423='半径:'+formatDistance(_0x1f7b9f)+'');}this['_map'][_0x565885(0xd86)](_0x190948['endPosition'],_0x391423+this['_map']['getLangText'](_0x565885(0x1084)));}[_0x3d5d32(0xf22)](_0x398737){const _0x12c59b={_0x589daa:0xc84,_0x915312:0xe95,_0x21078b:0x741},_0x400616=_0x3d5d32;if(this['_positions_draw']['length']<0x2)return;this['_updateHeight']();if(!_0x398737){const _0x22c3a1=formatNum$1(Cesium__namespace[_0x400616(0xe95)]['distance'](this['_positions_draw'][0x0],this['_positions_draw'][0x1]),0x2);if(_0x22c3a1<0x1)return;if(this['_maxPointNum']===0x3){let _0x27aa67=_0x22c3a1,_0x5d5ff3=_0x22c3a1;this['_positions_draw'][_0x400616(_0x12c59b._0x589daa)]===0x3&&(_0x5d5ff3=formatNum$1(Cesium__namespace[_0x400616(_0x12c59b._0x915312)][_0x400616(0xbd7)](this['_positions_draw'][0x0],this['_positions_draw'][0x2]),0x2));if(_0x27aa67>_0x5d5ff3){const _0x264fcd=_0x27aa67;_0x27aa67=_0x5d5ff3,_0x5d5ff3=_0x264fcd;}this[_0x400616(0xa09)][_0x400616(0x905)]=_0x5d5ff3,this[_0x400616(0xa09)][_0x400616(_0x12c59b._0x21078b)]=_0x27aa67,this['style']['semiMajorAxis']=_0x5d5ff3,this['style']['semiMinorAxis']=_0x27aa67;}else this['entityGraphic']['semiMajorAxis']=_0x22c3a1,this['entityGraphic']['semiMinorAxis']=_0x22c3a1,this['style']['radius']=_0x22c3a1;}this['_entity_outlines']&&(this['_outlinePositions']=this['getOutlinePositions'](),this['_updateOutlineToCallback']());}['_onRightClickHandler'](_0xb162f1){const _0xc07b4f={_0x1a571e:0xdde},_0x488ef4=_0x3d5d32;super['_onRightClickHandler'](_0xb162f1),this['entityGraphic']['semiMajorAxis']=0x0,this[_0x488ef4(0xa09)]['semiMinorAxis']=0x0,this[_0x488ef4(_0xc07b4f._0x1a571e)][_0x488ef4(0xd61)]=0x0;}['getOutlinePositions'](_0x183a7e=!![],_0x14942c){const _0x264e1a={_0x3a36dd:0x8b7,_0x48124a:0x905,_0x1e2542:0x741,_0x42372e:0x89b},_0x52d7b9=_0x3d5d32;var _0x4236d8,_0x5541b2,_0x27fef8,_0x458833;const _0xa8e35d=Cesium__namespace[_0x52d7b9(_0x264e1a._0x3a36dd)]['now'](),_0x4a8d4f=getEllipseOuterPositions({'position':getPositionValue(this['_entity']['position']),'semiMajorAxis':getCesiumValue((_0x4236d8=this[_0x52d7b9(0x89b)]['ellipse'])===null||_0x4236d8===void 0x0?void 0x0:_0x4236d8[_0x52d7b9(_0x264e1a._0x48124a)],Number,_0xa8e35d),'semiMinorAxis':getCesiumValue((_0x5541b2=this['_entity']['ellipse'])===null||_0x5541b2===void 0x0?void 0x0:_0x5541b2[_0x52d7b9(_0x264e1a._0x1e2542)],Number,_0xa8e35d),'rotation':getCesiumValue((_0x27fef8=this[_0x52d7b9(_0x264e1a._0x42372e)]['ellipse'])===null||_0x27fef8===void 0x0?void 0x0:_0x27fef8[_0x52d7b9(0x31f)],Number,_0xa8e35d)??0x0,'granularity':getCesiumValue((_0x458833=this[_0x52d7b9(0x89b)]['ellipse'])===null||_0x458833===void 0x0?void 0x0:_0x458833['granularity'],Number,_0xa8e35d),'count':_0x14942c});if(_0x183a7e&&_0x4a8d4f){var _0x4609df;_0x4a8d4f[_0x52d7b9(0xb75)](_0x4a8d4f[0x0]),(this['style']['outlineWidth']>0x4||((_0x4609df=this['style'][_0x52d7b9(0x576)])===null||_0x4609df===void 0x0?void 0x0:_0x4609df['width'])>0x4)&&_0x4a8d4f['push'](_0x4a8d4f[0x1]);}return _0x4a8d4f;}[_0x3d5d32(0x459)](_0x5791bf,_0x7f159b,_0x51ed59){const _0x2ff856=_0x3d5d32;return cartesians2lonlats(this[_0x2ff856(0xdd7)](_0x5791bf,_0x7f159b),_0x51ed59);}['_getOutlineStyle'](_0x578763,_0x3b46a4){const _0x22c99d=_0x3d5d32,_0x5deca1=super['_getOutlineStyle'](_0x578763,_0x3b46a4);return _0x5deca1['arcType']=Cesium__namespace[_0x22c99d(0x1029)]['RHUMB'],_0x5deca1;}['getRectangle'](_0x5c64c9){const _0xa64856={_0x475d65:0xc84},_0xefb969=_0x3d5d32,_0x509b27=this['getOutlinePositions'](![],0x1);if(!_0x509b27||_0x509b27[_0xefb969(_0xa64856._0x475d65)]===0x0)return;const _0x46187c=getRectangle(_0x509b27,_0x5c64c9===null||_0x5c64c9===void 0x0?void 0x0:_0x5c64c9['isFormat']);return _0x46187c;}[_0x3d5d32(0xe23)](_0x1a6403){const _0x5a80d6=_0x3d5d32;_0x1a6403=LngLatPoint['parse'](_0x1a6403)[_0x5a80d6(0xed4)](),_0x1a6403=setPositionsHeight(_0x1a6403,this['height']);const _0xa435f2=Cesium__namespace['Cartesian3'][_0x5a80d6(0xbd7)](this['positionShow'],_0x1a6403);return _0xa435f2<=this['radius'];}[_0x3d5d32(0xd67)](_0x5596f6={}){const _0x7d3fdb=_0x3d5d32;if(!this['_map'])return Promise['resolve'](![]);return _0x5596f6['radius']=this[_0x7d3fdb(0xd61)]*0x2*(_0x5596f6['scale']||1.8),this[_0x7d3fdb(0x1d1)]['flyToPoint'](this['point'],_0x5596f6);}}register$4('circle',CircleEntity,!![]);class EditModel extends EditBase{get['position'](){const _0x511a89={_0x5ee915:0x70d},_0x4a6503=_0x3d5d32;return this['_graphic'][_0x4a6503(_0x511a89._0x5ee915)];}set[_0x3d5d32(0xb69)](_0x57e4b2){this['_graphic']['_position_draw']=_0x57e4b2;}['updatePositionsHeightByAttr'](_0x403866){return this['clampToGround']&&(_0x403866=getSurfacePosition(this['_map']['scene'],_0x403866)),_0x403866;}[_0x3d5d32(0xbc8)](){const _0x9b3c6f={_0x27bd03:0xd1b,_0x4c98d8:0xeb3,_0x4af581:0x813,_0x43154d:0xb69,_0x245c27:0x83e,_0x524677:0xfd4,_0x1ab3ad:0xff5,_0x370e3a:0x1d1,_0x2b46de:0xb75},_0x3a6a29={_0x5496f9:0xbd7,_0x23e294:0xa09},_0x2ff9c1={_0x1b41fa:0xe28,_0x45b514:0x93f,_0x1d0f91:0x792},_0x292441={_0x668153:0xdde},_0x708d3b=_0x3d5d32;this['_graphic']['_draw_tooltip']=this['_map'][_0x708d3b(_0x9b3c6f._0x27bd03)]('_拖动该点后')+_0x708d3b(0x231)+this['_map'][_0x708d3b(0xd1b)](_0x708d3b(_0x9b3c6f._0x4c98d8)),this['createDragger']({'dragger':this['_graphic'],'onDragStart':(_0x15bfac,_0x4f9541)=>{const _0x4dd5fa=_0x708d3b;for(let _0x40e374=0x0,_0x47cf61=this['draggers']['length'];_0x40e374<_0x47cf61;_0x40e374++){this['draggers'][_0x40e374][_0x4dd5fa(0x792)]=![];}},'onDrag':(_0x41d855,_0x53f7b8)=>{this['position']=_0x53f7b8;},'onDragEnd':(_0x488e91,_0x506420)=>{this['updateDraggers']();}});const _0x430050=this[_0x708d3b(0xdde)][_0x708d3b(0xd61)],_0x15951e=this[_0x708d3b(_0x9b3c6f._0x4af581)](this[_0x708d3b(_0x9b3c6f._0x43154d)]),_0x5eb095=Cesium__namespace[_0x708d3b(0x220)]['fromCartesian'](_0x15951e)[_0x708d3b(_0x9b3c6f._0x245c27)];if(this[_0x708d3b(_0x9b3c6f._0x524677)]){this['entityAngle']=new CircleEntity({'name':'角度调整底部圆','position':new Cesium__namespace['CallbackProperty'](_0x528731=>{return _0x15951e;},![]),'style':{'fill':![],'outline':!![],'outlineColor':_0x708d3b(_0x9b3c6f._0x1ab3ad),'outlineOpacity':0.8,'radius':_0x430050,'height':_0x5eb095},'private':!![]}),this[_0x708d3b(0x548)]['addGraphic'](this['entityAngle']);const _0x374f75=getPositionByDirectionAndLen(_0x15951e,this['style']['heading'],_0x430050),_0x507637=this['createDragger']({'position':_0x374f75,'type':PointType[_0x708d3b(0x1dd)],'tooltip':this[_0x708d3b(_0x9b3c6f._0x370e3a)]['getLangText']('_修改方向'),'onDrag':(_0x2adb1f,_0x47e579)=>{const _0x61f5ea=_0x708d3b,_0x523014=getAngle(_0x15951e,_0x47e579);this[_0x61f5ea(0xdde)]['heading']=formatNum$1(_0x523014,0x2),_0x2adb1f['position']=getPositionByDirectionAndLen(_0x15951e,this[_0x61f5ea(_0x292441._0x668153)]['heading'],this['style'][_0x61f5ea(0xd61)]),this[_0x61f5ea(0x6cc)]['updateOrientation'](_0x15951e);}});this['draggers'][_0x708d3b(0xb75)](_0x507637);}if(this['_hasEditScale']){const _0x33a39e=addPositionsHeight(_0x15951e,_0x430050),_0x5665f5=this['createDragger']({'position':_0x33a39e,'type':PointType['MoveHeight'],'tooltip':this['_map']['getLangText'](_0x708d3b(0x1004)),'onDragStart':(_0x3afcc2,_0xb9c0f3)=>{const _0x1c2c37=_0x708d3b;this['entityAngle']&&(this[_0x1c2c37(_0x2ff9c1._0x1b41fa)]['show']=![]);for(let _0x440ac6=0x0,_0x51ddb6=this['draggers']['length'];_0x440ac6<_0x51ddb6;_0x440ac6++){this[_0x1c2c37(_0x2ff9c1._0x45b514)][_0x440ac6][_0x1c2c37(_0x2ff9c1._0x1d0f91)]=![];}},'onDrag':(_0x3d0c93,_0xaed192)=>{const _0x3703c5=_0x708d3b,_0x57b984=Cesium__namespace['Cartesian3'][_0x3703c5(_0x3a6a29._0x5496f9)](_0xaed192,_0x15951e),_0x46c06f=_0x3d0c93['radius']/(this[_0x3703c5(0xdde)]['scale']||0x1);let _0x38814c=formatNum$1(_0x57b984/_0x46c06f,0x3);if(isNaN(_0x38814c))return;_0x38814c<=0x0&&(_0x38814c=0.001),this[_0x3703c5(0xdde)]['scale']=_0x38814c,this[_0x3703c5(_0x3a6a29._0x23e294)][_0x3703c5(0x515)]=_0x38814c,_0x3d0c93['radius']=_0x57b984,this[_0x3703c5(0xdde)]['radius']=_0x57b984;},'onDragEnd':(_0x1d9a1e,_0x58dad9)=>{this['updateDraggers'](),this['fire'](EventType['editStyle']);}});_0x5665f5[_0x708d3b(0xd61)]=_0x430050,this['draggers'][_0x708d3b(_0x9b3c6f._0x2b46de)](_0x5665f5);}}['destroyDraggers'](){const _0x4820ee=_0x3d5d32;super['destroyDraggers'](),this[_0x4820ee(0xe28)]&&(this[_0x4820ee(0x548)]['removeGraphic'](this['entityAngle'],!![]),delete this['entityAngle']);}[_0x3d5d32(0x8ae)](_0x47b150){const _0x49cb79={_0x495d8b:0xdde,_0xa3435c:0x1041,_0x15ec78:0xfd4,_0x2af031:0x74c,_0x18a4c4:0x2dd,_0x2f8147:0x268,_0x55bf51:0x260},_0x412aaa={_0x1298ab:0xfd4},_0x1c3fb0={_0x501e95:0x5f9},_0x346f81=_0x3d5d32,_0x41f1a6=super['getDraggerContextMenu'](_0x47b150);return(this[_0x346f81(_0x49cb79._0x495d8b)][_0x346f81(_0x49cb79._0xa3435c)]??!![])&&(_0x41f1a6['push']({'text':this['_map']['getLangText']('_按轴旋转'),'icon':Icon['BloomEffectYes'],'show':_0x6f2cb3=>{const _0x4f5bc3=_0x346f81;return!this['_matrixRotate']||this['_matrixRotate']['_dragger_index']!==_0x47b150[_0x4f5bc3(_0x1c3fb0._0x501e95)];},'callback':_0x459219=>{const _0x4d5ce7=_0x346f81;this['entityAngle']&&(this['layer'][_0x4d5ce7(0x358)](this[_0x4d5ce7(0xe28)],!![]),delete this[_0x4d5ce7(0xe28)],this['_hasEditHeading']=![],this[_0x4d5ce7(0xfa7)]()),this['startRotateMatrix'](_0x459219['graphic'],_0x459219);}}),_0x41f1a6['push']({'text':this['_map']['getLangText']('_停止按轴旋转'),'icon':Icon[_0x346f81(0xdf9)],'show':_0x1fe390=>{return this['_matrixRotate']&&this['_matrixRotate']['_dragger_index']===_0x47b150['index'];},'callback':_0x5760de=>{this['stopRotateMatrix']();}})),!Cesium__namespace['defined'](this[_0x346f81(_0x49cb79._0x15ec78)])&&(this['_hasEditHeading']=this['_graphic'][_0x346f81(0x433)][_0x346f81(0x105b)]??![]),_0x41f1a6['push']({'text':_0x346f81(_0x49cb79._0x2af031),'icon':Icon[_0x346f81(_0x49cb79._0x18a4c4)],'show':_0x4eef0c=>{const _0x1b718a=_0x346f81;return!this[_0x1b718a(_0x412aaa._0x1298ab)];},'callback':_0x5c1d37=>{const _0x1c6134=_0x346f81;this['stopRotateMatrix'](),this[_0x1c6134(0xfd4)]=!![],this[_0x1c6134(0xfa7)]();}}),_0x41f1a6[_0x346f81(0xb75)]({'text':'停止编辑方向','icon':Icon['DrawCircle'],'show':_0x343b58=>{return this['_hasEditHeading'];},'callback':_0x404aae=>{this['_hasEditHeading']=![],this['updateDraggers']();}}),!Cesium__namespace['defined'](this['_hasEditScale'])&&(this['_hasEditScale']=this['_graphic']['options'][_0x346f81(_0x49cb79._0x2f8147)]??![]),_0x41f1a6['push']({'text':this['_map']['getLangText'](_0x346f81(_0x49cb79._0x55bf51)),'icon':Icon['UndergroundYes'],'show':_0x355ffd=>{return!this['_hasEditScale'];},'callback':_0x45ec55=>{this['_hasEditScale']=!![],this['updateDraggers']();}}),_0x41f1a6['push']({'text':this['_map'][_0x346f81(0xd1b)]('_停止调整比例'),'icon':Icon['UndergroundNo'],'show':_0xa8dc67=>{return this['_hasEditScale'];},'callback':_0x46bbab=>{this['_hasEditScale']=![],this['updateDraggers']();}}),_0x41f1a6;}['finish'](){const _0x3dace4={_0x266a4a:0xc49,_0x4f7b0b:0x40e},_0x58306b=_0x3d5d32;delete this['_graphic']['_draw_tooltip'],delete this['_graphic']['_isDragger'],delete this['_graphic'][_0x58306b(0xb44)],delete this['_graphic'][_0x58306b(_0x3dace4._0x266a4a)],delete this['_graphic']['onDrag'],this['_graphic'][_0x58306b(_0x3dace4._0x4f7b0b)]();}}class ModelEntity extends BasePointEntity{constructor(_0x57e46d={}){const _0x5e5b8d={_0x11f6bf:0x294},_0x4a45a9=_0x3d5d32;_0x57e46d[_0x4a45a9(0xcd2)]=_0x57e46d[_0x4a45a9(0xcd2)]??!![],super(_0x57e46d),this['style'][_0x4a45a9(0xd61)]=this['style'][_0x4a45a9(0xd61)]??0x32,this['_readyPromise']=Cesium__namespace[_0x4a45a9(_0x5e5b8d._0x11f6bf)]();}get[_0x3d5d32(0xa09)](){var _0x6a91df;return(_0x6a91df=this['_entity'])===null||_0x6a91df===void 0x0?void 0x0:_0x6a91df['model'];}get['EditClass'](){return EditModel;}get['scale'](){return this['style']['scale']??0x1;}set[_0x3d5d32(0x515)](_0x1e8060){const _0x1e7289=_0x3d5d32;this[_0x1e7289(0xdde)]['scale']=_0x1e8060,this['_updateStyleHook'](this['style'],{'scale':_0x1e8060});}get['readyPromise'](){const _0x4dd1b1=_0x3d5d32;return this['_readyPromise'][_0x4dd1b1(0xab8)];}['_mountedHook'](){const _0x2d685d={_0x3bfc94:0xdde,_0x5060c6:0x5ee,_0x49ec7d:0x32a,_0x203e3a:0x9ce,_0x2b5f6b:0xe12,_0x35cfb5:0x4a5,_0x413130:0x4a5,_0x5d6c85:0x83d,_0x4455c5:0x433,_0x3ea17e:0xa67,_0x1c7f44:0xaa6,_0x1aee85:0x8b7,_0x2ab778:0x6f1,_0x589a98:0xdde,_0x2fa467:0xbbe,_0x27e3ed:0x76a,_0x4829c9:0x4a5,_0x53134e:0x4a5,_0x308538:0x76a},_0x2f88e2={_0xcdd8de:0x788,_0x449959:0xd61},_0x48c354=_0x3d5d32,_0x19bada={'occlusion':this[_0x48c354(_0x2d685d._0x3bfc94)]['marsOcclusion']};isMars3DCesium&&(this['loadOk']=![],this['_draw_tooltip']=this['_map']['getLangText']('_加载模型中'),this[_0x48c354(0xefc)](EventType[_0x48c354(0x893)],{'url':this['options'][_0x48c354(_0x2d685d._0x5060c6)]}),_0x19bada[_0x48c354(0x463)]=(_0x308d40,_0x42b78b)=>{const _0x516e9c=_0x48c354;delete this['_draw_tooltip'],this['loadOk']=!![],this['_model']=_0x42b78b,_0x42b78b['boundingSphere']['radius']<(this['style']['maxRadius'],0x3e8)&&(this['style']['radius']=_0x42b78b[_0x516e9c(_0x2f88e2._0xcdd8de)][_0x516e9c(_0x2f88e2._0x449959)]),this['fire'](EventType['load'],{'drawtype':this[_0x516e9c(0x7f5)],'entity':_0x308d40,'model':_0x42b78b,'graphic':this},!![]),this['_readyPromise']['resolve'](this);});const _0x487f13={'position':this['position'],'orientation':this['getOrientation'](),'model':ModelStyleConver['toCesiumVal'](this['style'],{},!![])};!_0x487f13[_0x48c354(0x600)]['uri']&&this['options']['url']&&(_0x487f13['model'][_0x48c354(0x281)]=this['options']['url'],_0x487f13['model']['show']=!![]);const _0x1b0b70=this['style'][_0x48c354(_0x2d685d._0x49ec7d)];_0x1b0b70&&(Cesium__namespace[_0x48c354(0xb84)](this['style']['clampToGround'])&&!Cesium__namespace[_0x48c354(0xb84)](_0x1b0b70['clampToGround'])&&(_0x1b0b70['clampToGround']=this['style']['clampToGround']),Cesium__namespace['defined'](_0x1b0b70[_0x48c354(0x9e4)])||Cesium__namespace['defined'](_0x1b0b70[_0x48c354(_0x2d685d._0x203e3a)])?this[_0x48c354(0x3d2)]():_0x487f13[_0x48c354(_0x2d685d._0x49ec7d)]=LabelStyleConver['toCesiumVal'](this['style'][_0x48c354(0x32a)],{},this[_0x48c354(_0x2d685d._0x2b5f6b)]));this['options'][_0x48c354(_0x2d685d._0x35cfb5)]&&(_0x487f13[_0x48c354(0x4a5)]=BillboardStyleConver['toCesiumVal'](this[_0x48c354(0x433)][_0x48c354(_0x2d685d._0x413130)],{},!![]));this[_0x48c354(0x433)][_0x48c354(0xbbe)]&&(_0x487f13['point']=PointStyleConver[_0x48c354(_0x2d685d._0x5d6c85)](this['options']['point'],{},!![]));this['options'][_0x48c354(0x654)]&&(_0x487f13[_0x48c354(0x892)]=CircleStyleConver['toCesiumVal'](this[_0x48c354(0x433)]['circle'],{},!![]));if(this[_0x48c354(0x433)][_0x48c354(0x4f5)]){var _0x1caf22,_0x688164;const _0x24e33a=PathStyleConver['toCesiumVal'](this[_0x48c354(_0x2d685d._0x4455c5)]['path'],{},!![]);!_0x24e33a['isAll']&&(_0x24e33a['leadTime']=0x0);_0x487f13['path']=_0x24e33a;const _0x2199d7=(_0x1caf22=this['position'])===null||_0x1caf22===void 0x0?void 0x0:(_0x688164=_0x1caf22['_property'])===null||_0x688164===void 0x0?void 0x0:_0x688164['_times'];if(_0x2199d7&&_0x2199d7['length']>0x0){var _0x417263;const _0x118782=_0x2199d7[0x0];let _0x298c38=_0x2199d7[_0x2199d7['length']-0x1];((_0x417263=this['position'])===null||_0x417263===void 0x0?void 0x0:_0x417263[_0x48c354(_0x2d685d._0x3ea17e)])===Cesium__namespace[_0x48c354(_0x2d685d._0x1c7f44)]['HOLD']&&(_0x298c38=Cesium__namespace[_0x48c354(_0x2d685d._0x1aee85)]['fromDate'](new Date(0x834,0x1,0x1))),_0x487f13['availability']=new Cesium__namespace[(_0x48c354(_0x2d685d._0x2ab778))]([new Cesium__namespace['TimeInterval']({'start':_0x118782,'stop':_0x298c38})]);}}if(this[_0x48c354(0xdde)][_0x48c354(0x8f0)]){if(this[_0x48c354(_0x2d685d._0x589a98)][_0x48c354(0x382)])_0x487f13['point']=PointStyleConver['toCesiumVal'](this['style']['distanceDisplayPoint']),_0x487f13[_0x48c354(_0x2d685d._0x2fa467)]['distanceDisplayCondition']=this['_getTargetDistanceDisplayCondition'](this[_0x48c354(_0x2d685d._0x589a98)][_0x48c354(0x382)]);else this[_0x48c354(0xdde)][_0x48c354(_0x2d685d._0x27e3ed)]&&(_0x487f13[_0x48c354(_0x2d685d._0x4829c9)]=BillboardStyleConver['toCesiumVal'](this['style'][_0x48c354(0x76a)]),_0x487f13[_0x48c354(_0x2d685d._0x53134e)]['distanceDisplayCondition']=this['_getTargetDistanceDisplayCondition'](this['style'][_0x48c354(_0x2d685d._0x308538)]));}_0x487f13['model']['marsOptions']=_0x19bada,this[_0x48c354(0x89b)]=this['_createEntity'](_0x487f13);}['_removedHook'](){const _0x5a0b6f={_0x1d31ec:0xcf1},_0x1224b4=_0x3d5d32;this[_0x1224b4(_0x5a0b6f._0x1d31ec)](),super['_removedHook']();}['_style2Json'](_0xeefaf9,_0x427d2c){const _0x1c9846={_0x26191e:0x76a,_0x31a670:0x3db},_0x487fb4=_0x3d5d32,_0x3b568d=ModelStyleConver['toJSON'](_0xeefaf9,_0x427d2c,!![]);if(this['style'][_0x487fb4(0x382)])_0x3b568d['distanceDisplayPoint']=PointStyleConver['toJSON'](this['style']['distanceDisplayPoint'],{},!![]);else this['style']['distanceDisplayBillboard']&&(_0x3b568d[_0x487fb4(_0x1c9846._0x26191e)]=BillboardStyleConver[_0x487fb4(_0x1c9846._0x31a670)](this['style']['distanceDisplayBillboard'],{},!![]));return _0x3b568d;}['_updateStyleHook'](_0x2d5377,_0x134112){const _0x4f4bda={_0x3f77dc:0x206,_0x2e6c0c:0x5ee,_0xfc9124:0x794,_0xee67d1:0x32a,_0x2b44c7:0x7c0,_0x437f83:0x3d2},_0x4af1b0=_0x3d5d32;_0x134112!==null&&_0x134112!==void 0x0&&_0x134112['url']&&(this['loadOk']=![],this['entityGraphic'][_0x4af1b0(_0x4f4bda._0x3f77dc)]=![],this['fire'](EventType['loadBefore'],{'url':_0x134112===null||_0x134112===void 0x0?void 0x0:_0x134112[_0x4af1b0(_0x4f4bda._0x2e6c0c)]}));this['_entity'][_0x4af1b0(0x42d)]=this[_0x4af1b0(_0x4f4bda._0xfc9124)](),ModelStyleConver['toCesiumVal'](_0x2d5377,this[_0x4af1b0(0xa09)],!![]);if(_0x134112!==null&&_0x134112!==void 0x0&&_0x134112[_0x4af1b0(_0x4f4bda._0xee67d1)]){Cesium__namespace[_0x4af1b0(0xb84)](_0x2d5377[_0x4af1b0(_0x4f4bda._0x2b44c7)])&&!Cesium__namespace['defined'](_0x2d5377['label']['clampToGround'])&&(_0x2d5377['label']['clampToGround']=_0x2d5377['clampToGround']);if(Cesium__namespace['defined'](_0x2d5377[_0x4af1b0(_0x4f4bda._0xee67d1)]['setHeight'])||Cesium__namespace[_0x4af1b0(0xb84)](_0x2d5377['label']['addHeight'])){var _0x1dd606;(_0x1dd606=this['_entity'])!==null&&_0x1dd606!==void 0x0&&_0x1dd606[_0x4af1b0(_0x4f4bda._0xee67d1)]&&(this['_entity'][_0x4af1b0(0x32a)]['show']=![]),this[_0x4af1b0(_0x4f4bda._0x437f83)]();}else this['_entity']['label']=this[_0x4af1b0(0x89b)]['label']||{},LabelStyleConver['toCesiumVal'](_0x2d5377['label'],this[_0x4af1b0(0x89b)]['label'],this['attr']);}}['_updatePositionsHook'](){const _0x4a054c={_0x1f0c5e:0x367,_0xcab786:0x89b,_0x5cfefc:0xc84,_0x76d27c:0xc84,_0x3d240e:0x6ed},_0x150aaf=_0x3d5d32;super[_0x150aaf(_0x4a054c._0x1f0c5e)]();if(this[_0x150aaf(_0x4a054c._0xcab786)]['path']){var _0x50207f,_0x1cbb8b;const _0x6cd8f=(_0x50207f=this['position'])===null||_0x50207f===void 0x0?void 0x0:(_0x1cbb8b=_0x50207f[_0x150aaf(0x5f7)])===null||_0x1cbb8b===void 0x0?void 0x0:_0x1cbb8b['_times'];if(_0x6cd8f&&_0x6cd8f[_0x150aaf(_0x4a054c._0x5cfefc)]>0x0){var _0x15c0f1;const _0x5588f8=_0x6cd8f[0x0];let _0x315fde=_0x6cd8f[_0x6cd8f[_0x150aaf(_0x4a054c._0x76d27c)]-0x1];((_0x15c0f1=this['position'])===null||_0x15c0f1===void 0x0?void 0x0:_0x15c0f1['forwardExtrapolationType'])===Cesium__namespace[_0x150aaf(0xaa6)]['HOLD']&&(_0x315fde=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),this[_0x150aaf(_0x4a054c._0xcab786)]['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace[(_0x150aaf(_0x4a054c._0x3d240e))]({'start':_0x5588f8,'stop':_0x315fde})]);}}}['_setOptionsHook'](_0x216b46,_0x15e2c6){const _0x56ee23={_0xe1d07:0x4a5,_0x776398:0x89b,_0x2eba83:0x89b},_0x597bc7=_0x3d5d32;_0x15e2c6[_0x597bc7(_0x56ee23._0xe1d07)]&&BillboardStyleConver['toCesiumVal'](_0x216b46['billboard'],this['_entity']['billboard'],!![]),_0x15e2c6['point']&&PointStyleConver['toCesiumVal'](_0x216b46['point'],this[_0x597bc7(_0x56ee23._0x776398)]['point'],!![]),_0x15e2c6['path']&&(PathStyleConver['toCesiumVal'](_0x216b46['path'],this[_0x597bc7(_0x56ee23._0x2eba83)][_0x597bc7(0x4f5)],!![]),!_0x216b46['path']['isAll']&&(this[_0x597bc7(0x89b)]['path']['leadTime']=0x0)),_0x15e2c6['circle']&&CircleStyleConver['toCesiumVal'](_0x216b46['circle'],this['_entity']['ellipse'],!![]);}[_0x3d5d32(0x64a)](_0x10824b){const _0x1947ff={_0x236762:0x433,_0x992f25:0x4a5,_0x3791c1:0x433,_0x1b3fc8:0x433,_0x5dc8c1:0x654},_0x51e5c6=_0x3d5d32;this[_0x51e5c6(_0x1947ff._0x236762)]['billboard']&&(_0x10824b['billboard']={},BillboardStyleConver['toJSON'](this['options'][_0x51e5c6(_0x1947ff._0x992f25)],_0x10824b['billboard'],!![])),this[_0x51e5c6(_0x1947ff._0x3791c1)]['point']&&(_0x10824b['point']={},PointStyleConver['toJSON'](this[_0x51e5c6(_0x1947ff._0x3791c1)]['point'],_0x10824b[_0x51e5c6(0xbbe)],!![])),this['options']['path']&&(_0x10824b['path']={},PathStyleConver['toJSON'](this['options']['path'],_0x10824b['path'],!![])),this['options']['circle']&&(_0x10824b['circle']={},CircleStyleConver[_0x51e5c6(0x3db)](this[_0x51e5c6(_0x1947ff._0x1b3fc8)]['circle'],_0x10824b[_0x51e5c6(_0x1947ff._0x5dc8c1)],!![]));}[_0x3d5d32(0x3d2)](){const _0x2acae4={_0x31e83c:0xb84,_0x50aa7e:0x9e4,_0x1513e1:0x32a,_0x3cb065:0xe12},_0x2ce0d7=_0x3d5d32,_0x265948=this['style'][_0x2ce0d7(0x32a)];if(Cesium__namespace[_0x2ce0d7(_0x2acae4._0x31e83c)](_0x265948[_0x2ce0d7(_0x2acae4._0x50aa7e)])||Cesium__namespace['defined'](_0x265948['addHeight'])){var _0xd85026;(_0xd85026=this['_entity'])!==null&&_0xd85026!==void 0x0&&_0xd85026[_0x2ce0d7(0x32a)]&&(this['_entity'][_0x2ce0d7(_0x2acae4._0x1513e1)]['show']=![]),super['_addLabel']();}else this[_0x2ce0d7(0x89b)]['label']=this['_entity']['label']||{},LabelStyleConver['toCesiumVal'](this[_0x2ce0d7(0xdde)]['label'],this['_entity']['label'],this[_0x2ce0d7(_0x2acae4._0x3cb065)]);}[_0x3d5d32(0xf22)](_0x4a10fb){}['_updateDistanceDisplayConditionByEdit'](){}['_getTargetDistanceDisplayCondition'](_0x1540ad){const _0x5393ca={_0x4bcd3f:0x8f0,_0x1626f1:0xa68},_0x50125b=_0x3d5d32;let _0x35c810;if(this['style'][_0x50125b(_0x5393ca._0x4bcd3f)]instanceof Cesium__namespace['DistanceDisplayCondition'])_0x35c810=this['style']['distanceDisplayCondition'][_0x50125b(0x418)];else this['style']['distanceDisplayCondition_far']&&(_0x35c810=this['style'][_0x50125b(0xc42)]);return new Cesium__namespace['DistanceDisplayCondition']((_0x1540ad['distanceDisplayCondition_near'],_0x35c810),(_0x1540ad['distanceDisplayCondition_far'],Number[_0x50125b(_0x5393ca._0x1626f1)]));}['getHeadingPitchRoll'](){const _0xf77ffa=_0x3d5d32,_0x89b905=this['_map']['clock']['currentTime'],_0x5989ec=this['positionShow'],_0x500857=Cesium__namespace['Property'][_0xf77ffa(0x516)](this['_entity'][_0xf77ffa(0x42d)],_0x89b905,new Cesium__namespace['Quaternion']()),_0x3329f7=getHeadingPitchRollByOrientation(_0x5989ec,_0x500857);return _0x3329f7;}['rotateStart'](_0x42dc24={}){const _0x8354a9={_0x124479:0xe36,_0x3f07f2:0x8b2,_0x49f721:0x907,_0x532f5a:0xbae,_0x2277d9:0x797,_0x3c66c9:0xc6d},_0x4d2fd3={_0x4f2377:0x5bb,_0x12d758:0x907},_0x4075bf=_0x3d5d32;this['_isRotateStart']&&this['rotateStop'](),this['_rotateDirection']=_0x42dc24[_0x4075bf(_0x8354a9._0x124479)]?0x1:-0x1,this['_rotateAngle']=0x168/(0x3c*(_0x42dc24['time']||0x3c)),this[_0x4075bf(_0x8354a9._0x3f07f2)]=_0x42dc24['autoStopAngle'],this[_0x4075bf(_0x8354a9._0x49f721)]=this['getHeadingPitchRoll'](),this[_0x4075bf(_0x8354a9._0x532f5a)]=this['_rotateHpr']['heading'],this[_0x4075bf(_0x8354a9._0x2277d9)]=0x0,this[_0x4075bf(0x885)]=!![],this['entity']['orientation']=new Cesium__namespace[(_0x4075bf(_0x8354a9._0x3c66c9))](_0x5b5251=>{const _0x22ab62=_0x4075bf;var _0x40f7ed,_0x58300b;const _0x25f31d=getPositionValue(this['position'],_0x5b5251);return Cesium__namespace[_0x22ab62(_0x4d2fd3._0x4f2377)]['headingPitchRollQuaternion'](_0x25f31d,this[_0x22ab62(_0x4d2fd3._0x12d758)],(_0x40f7ed=this['_map'])===null||_0x40f7ed===void 0x0?void 0x0:(_0x58300b=_0x40f7ed['scene'])===null||_0x58300b===void 0x0?void 0x0:_0x58300b['globe']['ellipsoid']);},![]),this['_map']['on'](EventType[_0x4075bf(0x90a)],this['_rotate_onPreRenderHandler'],this);}['_rotate_onPreRenderHandler'](_0x15a965){const _0x3b6b93={_0x3facbe:0x1d1,_0x57cd15:0xcf1},_0x40bab4=_0x3d5d32;if(!this[_0x40bab4(_0x3b6b93._0x3facbe)])return;this['_tikRender']++;const _0x300fe4=this['_tikRender']*this['_rotateAngle'];if(this['_rotateAutoStopAngle']&&_0x300fe4>=this['_rotateAutoStopAngle']){this[_0x40bab4(_0x3b6b93._0x57cd15)]();return;}const _0x579570=Cesium__namespace['Math']['toRadians'](_0x300fe4*this['_rotateDirection'])+this['_startHeading'];this['_rotateHpr']['heading']=_0x579570;}['rotateStop'](){const _0xeb89f4={_0x430272:0x90a,_0x19192c:0xe11,_0x143cd5:0xe39,_0x2c7213:0xb5b,_0x26ade0:0x907,_0x285612:0xbae},_0x365d3e=_0x3d5d32;if(!this['_isRotateStart'])return;this['_isRotateStart']=![],this['_map']['off'](EventType[_0x365d3e(_0xeb89f4._0x430272)],this[_0x365d3e(_0xeb89f4._0x19192c)],this),this[_0x365d3e(_0xeb89f4._0x143cd5)]=Cesium__namespace['Math'][_0x365d3e(0xa1f)](this['_rotateHpr'][_0x365d3e(0xe39)]),delete this[_0x365d3e(_0xeb89f4._0x2c7213)],delete this['_rotateAngle'],delete this['_rotateAutoStopAngle'],delete this[_0x365d3e(_0xeb89f4._0x26ade0)],delete this[_0x365d3e(_0xeb89f4._0x285612)],delete this['_tikRender'];}['moveTo'](_0x245da4){const _0xeacb0a={_0x18aa16:0xaa6,_0x306c8b:0x807,_0x282590:0x9f4,_0x129daa:0x4f8,_0x269a4d:0xade,_0x3c799f:0xed4,_0x296929:0x89b,_0x450f42:0xb69,_0x39ef86:0x1d1};return new Promise((_0x3d1224,_0x1e5a16)=>{const _0x5b8f7d=_0x4132,_0x189692=new Cesium__namespace['SampledPositionProperty']();_0x189692['forwardExtrapolationType']=Cesium__namespace[_0x5b8f7d(_0xeacb0a._0x18aa16)][_0x5b8f7d(_0xeacb0a._0x306c8b)];const _0x5ce0c8=this['_map'][_0x5b8f7d(_0xeacb0a._0x282590)][_0x5b8f7d(_0xeacb0a._0x129daa)]['clone'](),_0x2e0fd2=this['positionShow'];_0x189692[_0x5b8f7d(_0xeacb0a._0x269a4d)](_0x5ce0c8,_0x2e0fd2);const _0x133b5f=LngLatPoint['parse'](_0x245da4['position'])[_0x5b8f7d(_0xeacb0a._0x3c799f)](),_0xb64e58=_0x245da4[_0x5b8f7d(0x5d6)]||0x5,_0x5aab6c=Cesium__namespace['JulianDate']['addSeconds'](_0x5ce0c8,_0xb64e58,new Cesium__namespace['JulianDate']());_0x189692[_0x5b8f7d(0xade)](_0x5aab6c,_0x133b5f),this[_0x5b8f7d(_0xeacb0a._0x296929)][_0x5b8f7d(_0xeacb0a._0x450f42)]=_0x189692;const _0x47d097=this[_0x5b8f7d(_0xeacb0a._0x39ef86)]['clock']['multiplier'];this[_0x5b8f7d(_0xeacb0a._0x39ef86)]['clock']['shouldAnimate']=!![],this['_map']['clock']['multiplier']=_0x245da4['speed']||0x1,setTimeout(()=>{if(!this['_map'])return;this['position']=_0x133b5f,this['_map']['clock']['multiplier']=_0x47d097,_0x245da4['onEnd']&&_0x245da4['onEnd'](),_0x3d1224(this);},_0xb64e58*0x3e8);});}[_0x3d5d32(0x909)](){const _0xb169a8={_0xb347dc:0x89b},_0x2111d1=_0x3d5d32;return this[_0x2111d1(_0xb169a8._0xb347dc)]['position'];}['flyTo'](_0x6c2d14={}){const _0x374848={_0x241216:0xbbe},_0x429bbc=_0x3d5d32;if(!this['_map'])return Promise[_0x429bbc(0xac9)](![]);return!Cesium__namespace['defined'](_0x6c2d14['radius'])&&(_0x6c2d14[_0x429bbc(0xd61)]=this[_0x429bbc(0xdde)][_0x429bbc(0xd61)]*0x2*(_0x6c2d14['scale']||1.8)),this['_map']['flyToPoint'](this[_0x429bbc(_0x374848._0x241216)],_0x6c2d14);}['setOpacity'](_0x1dc405){const _0x54db13=_0x3d5d32;this['style'][_0x54db13(0xc96)]=_0x1dc405,this['_entity']&&(ModelStyleConver[_0x54db13(0xb2d)](this['entityGraphic'],_0x1dc405),this['_updateLabelOpacity'](_0x1dc405));}}register$4('model',ModelEntity,!![]);class EditBox extends EditBase{get['position'](){return this['_graphic']['_position_draw'];}set['position'](_0x2105d5){const _0xfeaf71=_0x3d5d32;this['_graphic'][_0xfeaf71(0x70d)]=_0x2105d5;}['bindDraggers'](){const _0x5e7af7={_0x1d866c:0x1dd,_0x40fe58:0xb6c,_0x4b6aa7:0x93f},_0x249928={_0xf5bc60:0x29a},_0x314401={_0x81baea:0x220,_0x2724b8:0x930},_0x1e9e23={_0x4350d6:0xefc},_0x5727a8={_0x80f77d:0xb69,_0x4ee4b6:0xe95},_0xf729af=_0x3d5d32,_0x46f93=this['style'];let _0x42b7c0;const _0x1e14d8=this['position'];_0x42b7c0=this['createDragger']({'position':_0x1e14d8,'onDrag':(_0x405f07,_0x3b92d5)=>{const _0x5dcab1=_0x4132,_0x471df5=Cesium__namespace['Cartesian3'][_0x5dcab1(0xd97)](_0x3b92d5,this['position'],new Cesium__namespace['Cartesian3']());this[_0x5dcab1(_0x5727a8._0x80f77d)]=_0x3b92d5;for(let _0x3f9dd4=0x0,_0x1ef4b1=this['draggers']['length'];_0x3f9dd4<_0x1ef4b1;_0x3f9dd4++){if(this['draggers'][_0x3f9dd4]===_0x405f07)continue;this[_0x5dcab1(0x93f)][_0x3f9dd4]['position']=Cesium__namespace[_0x5dcab1(0xe95)]['add'](this['draggers'][_0x3f9dd4]['position'],_0x471df5,new Cesium__namespace[(_0x5dcab1(_0x5727a8._0x4ee4b6))]());}}}),this[_0xf729af(0x93f)][_0xf729af(0xb75)](_0x42b7c0);const _0x322a56=Cesium__namespace['Math'][_0xf729af(0x562)](this['_graphic'][_0xf729af(0xe39)]),_0x26bc79=Cesium__namespace['Math']['toRadians'](this['_graphic']['pitch']),_0x505078=Cesium__namespace['Math']['toRadians'](this['_graphic'][_0xf729af(0x952)]),_0x3b80c5=new Cesium__namespace['HeadingPitchRoll'](_0x322a56,_0x26bc79,_0x505078),_0x4ff703=getPositionByHprAndOffset(_0x1e14d8,new Cesium__namespace[(_0xf729af(0xe95))](_0x46f93['dimensions_x']/0x2,0x0,0x0),_0x3b80c5);_0x42b7c0=this['createDragger']({'position':_0x4ff703,'type':PointType[_0xf729af(_0x5e7af7._0x1d866c)],'tooltip':this['_map']['getLangText'](_0xf729af(_0x5e7af7._0x40fe58)),'onDrag':(_0x5c5a46,_0x54e293)=>{const _0x3a33e2=_0xf729af,_0x250051=Cesium__namespace[_0x3a33e2(0x220)]['fromCartesian'](this['position'])['height'];_0x54e293=setPositionsHeight(_0x54e293,_0x250051),_0x5c5a46['position']=_0x54e293;const _0x135e67=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](this['position'],_0x54e293),0x2);_0x46f93['dimensions_x']=_0x135e67*0x2,this['updateBox'](_0x46f93),this[_0x3a33e2(_0x1e9e23._0x4350d6)](EventType['editStyle']);},'onDragEnd':(_0x55f6c7,_0x22b87c)=>{this['updateDraggers']();}}),this['draggers']['push'](_0x42b7c0);const _0x396f37=getPositionByHprAndOffset(_0x1e14d8,new Cesium__namespace['Cartesian3'](0x0,_0x46f93['dimensions_y']/0x2,0x0),_0x3b80c5);_0x42b7c0=this['createDragger']({'position':_0x396f37,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改宽度'),'onDrag':(_0x5b5a01,_0x12c502)=>{const _0x789aa6=_0xf729af,_0x3a88ab=Cesium__namespace[_0x789aa6(_0x314401._0x81baea)]['fromCartesian'](_0x1e14d8)['height'];_0x12c502=setPositionsHeight(_0x12c502,_0x3a88ab),_0x5b5a01['position']=_0x12c502;const _0x536d1b=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](this[_0x789aa6(0xb69)],_0x12c502),0x2);_0x46f93['dimensions_y']=_0x536d1b*0x2,this['updateBox'](_0x46f93),this[_0x789aa6(0xefc)](EventType[_0x789aa6(_0x314401._0x2724b8)]);},'onDragEnd':(_0x1118ee,_0x3564da)=>{this['updateDraggers']();}}),this['draggers']['push'](_0x42b7c0);const _0x1c33a9=getPositionByHprAndOffset(_0x1e14d8,new Cesium__namespace['Cartesian3'](0x0,0x0,_0x46f93['dimensions_z']/0x2),_0x3b80c5);_0x42b7c0=this['createDragger']({'position':_0x1c33a9,'type':PointType[_0xf729af(0x262)],'tooltip':this['_map']['getLangText']('_修改高度'),'onDrag':(_0x155ac3,_0x5368fa)=>{const _0x1edd36=_0xf729af,_0x20e58d=this[_0x1edd36(_0x249928._0xf5bc60)](Cesium__namespace['Cartesian3']['distance'](this['position'],_0x5368fa),0x2);_0x46f93['dimensions_z']=_0x20e58d*0x2,this['updateBox'](_0x46f93),this['fire'](EventType['editStyle']);},'onDragEnd':(_0x221e3d,_0x520332)=>{this['updateDraggers']();}}),this[_0xf729af(_0x5e7af7._0x4b6aa7)]['push'](_0x42b7c0);}['updateBox'](_0x5a4148){const _0x2177bb={_0x159772:0xb1f,_0x5569e7:0xa09,_0x418cf4:0x9e5},_0x7ddb5f=_0x3d5d32,_0x23bbad=new Cesium__namespace['Cartesian3'](_0x5a4148['dimensions_x'],_0x5a4148[_0x7ddb5f(_0x2177bb._0x159772)],_0x5a4148['dimensions_z']);this[_0x7ddb5f(_0x2177bb._0x5569e7)][_0x7ddb5f(_0x2177bb._0x418cf4)]['setValue'](_0x23bbad);}['_updateStyleHook'](_0x4b490d){const _0x2a1989=_0x3d5d32;super['_updateStyleHook'](_0x4b490d),(Cesium__namespace['defined'](_0x4b490d['dimensions_x'])||Cesium__namespace[_0x2a1989(0xb84)](_0x4b490d['dimensions_y'])||Cesium__namespace['defined'](_0x4b490d['dimensions_z']))&&this['updateDraggers']();}}class BoxEntity extends BasePointEntity{get['entityGraphic'](){const _0x4080a3=_0x3d5d32;var _0x1c1149;return(_0x1c1149=this[_0x4080a3(0x89b)])===null||_0x1c1149===void 0x0?void 0x0:_0x1c1149['box'];}get[_0x3d5d32(0x98e)](){return EditBox;}['_mountedHook'](){const _0x2287e0=_0x3d5d32,_0x56235f={'position':this[_0x2287e0(0xb69)],'orientation':this['getOrientation'](),'box':BoxStyleConver['toCesiumVal'](this['style'],{},!![])};this[_0x2287e0(0x89b)]=this['_createEntity'](_0x56235f),this['style']['label']&&this['_addLabel']();}['_style2Json'](_0x3d3b7b,_0x52d13e){const _0xa67ef8=_0x3d5d32;return BoxStyleConver[_0xa67ef8(0x3db)](_0x3d3b7b,_0x52d13e,!![]);}['_updateStyleHook'](_0x37edc2,_0x11922b){const _0x31677a={_0x4734b9:0xe39,_0x1e14a6:0x794,_0x158328:0x83d},_0x16bbe1=_0x3d5d32;_0x11922b&&(Cesium__namespace['defined'](_0x11922b[_0x16bbe1(_0x31677a._0x4734b9)])||Cesium__namespace[_0x16bbe1(0xb84)](_0x11922b['pitch'])||Cesium__namespace['defined'](_0x11922b['roll']))&&(this[_0x16bbe1(0x89b)]['orientation']=this[_0x16bbe1(_0x31677a._0x1e14a6)]()),BoxStyleConver[_0x16bbe1(_0x31677a._0x158328)](_0x37edc2,this['entityGraphic'],!![]);}['_setPositionsToCallback'](){const _0x473211={_0x5eb04b:0xd56,_0x17b0c5:0xa09,_0x147f8b:0x1d1,_0x31cf26:0x4f8,_0x11a2f4:0x5cc,_0x563f5f:0xdde,_0x5d69dc:0xdde},_0x125093=_0x3d5d32;super[_0x125093(_0x473211._0x5eb04b)]();const _0x438f85=getCesiumValue(this[_0x125093(_0x473211._0x17b0c5)]['dimensions'],Number,this[_0x125093(_0x473211._0x147f8b)]['clock'][_0x125093(_0x473211._0x31cf26)]);this[_0x125093(0xdde)][_0x125093(_0x473211._0x11a2f4)]=this[_0x125093(_0x473211._0x563f5f)]['dimensions_x']??_0x438f85['x'],this[_0x125093(_0x473211._0x5d69dc)]['dimensions_y']=this[_0x125093(0xdde)]['dimensions_y']??_0x438f85['y'],this['style'][_0x125093(0xe91)]=this[_0x125093(0xdde)]['dimensions_z']??_0x438f85['z'],delete this['style']['dimensions'];}}register$4('box',BoxEntity,!![]);class EditPlane extends EditBase{get[_0x3d5d32(0xb69)](){return this['_graphic']['_position_draw'];}set['position'](_0x332b0d){const _0x164e66={_0x163543:0x6cc},_0xe914a=_0x3d5d32;this[_0xe914a(_0x164e66._0x163543)]['_position_draw']=_0x332b0d;}[_0x3d5d32(0xbc8)](){const _0x6dd5e1={_0x463ff6:0xdde,_0x4e205a:0x93f,_0x36cab9:0xb75,_0x1d2482:0x562,_0x5f30bb:0x103e,_0x2b6fee:0x7ba,_0x1cec30:0xe95,_0x2aeeb7:0x1d1,_0x572f91:0x61d,_0x163b72:0xede,_0x1171b3:0x262},_0x2042fe={_0x6fef1c:0xed6},_0x40217b={_0x41bb18:0xb69},_0x1f773a={_0x38e9de:0xb69,_0x3fa850:0xb69,_0x19c15c:0xb69},_0x5d5e39=_0x3d5d32,_0x88d979=this[_0x5d5e39(_0x6dd5e1._0x463ff6)];let _0x5c97f2;const _0xf7151b=this[_0x5d5e39(0xb69)];_0x5c97f2=this['createDragger']({'position':_0xf7151b,'onDrag':(_0x41345d,_0xe4f7b3)=>{const _0x39e526=_0x5d5e39,_0xd163a5=Cesium__namespace['Cartesian3']['subtract'](_0xe4f7b3,this[_0x39e526(_0x1f773a._0x38e9de)],new Cesium__namespace['Cartesian3']());this[_0x39e526(_0x1f773a._0x3fa850)]=_0xe4f7b3;for(let _0x3a2345=0x0,_0x5c765a=this['draggers']['length'];_0x3a2345<_0x5c765a;_0x3a2345++){if(this['draggers'][_0x3a2345]===_0x41345d)continue;this['draggers'][_0x3a2345]['position']=Cesium__namespace['Cartesian3'][_0x39e526(0xff3)](this['draggers'][_0x3a2345][_0x39e526(_0x1f773a._0x19c15c)],_0xd163a5,new Cesium__namespace['Cartesian3']());}}}),this[_0x5d5e39(_0x6dd5e1._0x4e205a)][_0x5d5e39(_0x6dd5e1._0x36cab9)](_0x5c97f2);const _0x26ed04=Cesium__namespace[_0x5d5e39(0x103e)][_0x5d5e39(_0x6dd5e1._0x1d2482)](this['_graphic'][_0x5d5e39(0xe39)]),_0x243939=Cesium__namespace['Math']['toRadians'](this['_graphic']['pitch']),_0x66d1c9=Cesium__namespace[_0x5d5e39(_0x6dd5e1._0x5f30bb)]['toRadians'](this[_0x5d5e39(0x6cc)][_0x5d5e39(0x952)]),_0x3e4078=new Cesium__namespace[(_0x5d5e39(_0x6dd5e1._0x2b6fee))](_0x26ed04,_0x243939,_0x66d1c9),_0x3e24cc=new Cesium__namespace[(_0x5d5e39(_0x6dd5e1._0x1cec30))]();switch(_0x88d979['plane_normal']){case'x':_0x3e24cc['y']=_0x88d979['dimensions_x']/0x2;break;default:_0x3e24cc['x']=_0x88d979[_0x5d5e39(0x5cc)]/0x2;break;}_0x5c97f2=this['createDragger']({'position':getPositionByHprAndOffset(_0xf7151b,_0x3e24cc,_0x3e4078),'type':PointType['EditAttr'],'tooltip':this[_0x5d5e39(_0x6dd5e1._0x2aeeb7)][_0x5d5e39(0xd1b)](_0x5d5e39(0xb6c)),'onDrag':(_0x1b1157,_0x2a1db0)=>{const _0x3517ef=_0x5d5e39,_0xccaf13=Cesium__namespace['Cartographic']['fromCartesian'](this['position'])[_0x3517ef(0x83e)];_0x2a1db0=setPositionsHeight(_0x2a1db0,_0xccaf13),_0x1b1157['position']=_0x2a1db0;const _0x3d3a69=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](this['position'],_0x2a1db0),0x2);_0x88d979['dimensions_x']=_0x3d3a69*0x2,this['updatePlane'](_0x88d979);},'onDragEnd':(_0x28e8f2,_0x2ed999)=>{this['updateDraggers']();}}),this[_0x5d5e39(0x93f)]['push'](_0x5c97f2);if(_0x88d979[_0x5d5e39(_0x6dd5e1._0x572f91)]==='z')_0x5c97f2=this['createDragger']({'position':getPositionByHprAndOffset(_0xf7151b,new Cesium__namespace['Cartesian3'](0x0,_0x88d979['dimensions_y']/0x2,0x0),_0x3e4078),'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText'](_0x5d5e39(_0x6dd5e1._0x163b72)),'onDrag':(_0x3c3b64,_0x717570)=>{const _0x46bf83=_0x5d5e39,_0x3e2125=Cesium__namespace[_0x46bf83(0x220)][_0x46bf83(0xd14)](this[_0x46bf83(_0x40217b._0x41bb18)])['height'];_0x717570=setPositionsHeight(_0x717570,_0x3e2125),_0x3c3b64['position']=_0x717570;const _0x2f311c=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](this['position'],_0x717570),0x2);_0x88d979['dimensions_y']=_0x2f311c*0x2,this['updatePlane'](_0x88d979);},'onDragEnd':(_0x4ee2d1,_0x2a0044)=>{this['updateDraggers']();}}),this[_0x5d5e39(_0x6dd5e1._0x4e205a)][_0x5d5e39(0xb75)](_0x5c97f2);else{const _0x3d2073={'x':0x0,'y':0x0,'z':0x0};switch(_0x88d979['plane_normal']){case'x':case'y':_0x3d2073['z']=_0x88d979['dimensions_y']/0x2;break;default:_0x3d2073['y']=_0x88d979['dimensions_y']/0x2;break;}_0x5c97f2=this['createDragger']({'position':getPositionByHprAndOffset(_0xf7151b,_0x3d2073,_0x3e4078),'type':PointType[_0x5d5e39(_0x6dd5e1._0x1171b3)],'tooltip':this['_map']['getLangText']('_修改宽度'),'onDrag':(_0x472fb0,_0x1ca6b6)=>{const _0x192908=_0x5d5e39,_0x17bffa=this['formatNum'](Cesium__namespace[_0x192908(0xe95)]['distance'](this['position'],_0x1ca6b6),0x2);_0x88d979['dimensions_y']=_0x17bffa*0x2,this[_0x192908(_0x2042fe._0x6fef1c)](_0x88d979);},'onDragEnd':(_0x25092e,_0x37c9f8)=>{this['updateDraggers']();}}),this['draggers']['push'](_0x5c97f2);}}['updatePlane'](_0x110027){const _0x4869e4={_0x590e1e:0xb1f},_0x227747=_0x3d5d32,_0x154793=new Cesium__namespace['Cartesian2'](_0x110027['dimensions_x'],_0x110027[_0x227747(_0x4869e4._0x590e1e)]);this['entityGraphic'][_0x227747(0x9e5)]['setValue'](_0x154793),this[_0x227747(0xefc)](EventType['editStyle']);}['_updateStyleHook'](_0x321471){const _0x404b92={_0x539245:0xb84,_0x3440cb:0x5cc},_0x39e481=_0x3d5d32;super['_updateStyleHook'](_0x321471),(Cesium__namespace[_0x39e481(_0x404b92._0x539245)](_0x321471[_0x39e481(_0x404b92._0x3440cb)])||Cesium__namespace[_0x39e481(0xb84)](_0x321471[_0x39e481(0xb1f)]))&&this['updateDraggers']();}}class PlaneEntity extends BasePointEntity{get['entityGraphic'](){var _0x2bfbef;return(_0x2bfbef=this['_entity'])===null||_0x2bfbef===void 0x0?void 0x0:_0x2bfbef['plane'];}get['EditClass'](){return EditPlane;}[_0x3d5d32(0xe4c)](){const _0x1bf88f={_0xf7f72a:0x89b,_0x18f40d:0xdde,_0x38b707:0x32a},_0x13c7c0=_0x3d5d32,_0x3e16f2={'position':this[_0x13c7c0(0xb69)],'orientation':this['getOrientation'](),'plane':PlaneStyleConver['toCesiumVal'](this['style'],{},!![])};this[_0x13c7c0(_0x1bf88f._0xf7f72a)]=this['_createEntity'](_0x3e16f2),this[_0x13c7c0(_0x1bf88f._0x18f40d)][_0x13c7c0(_0x1bf88f._0x38b707)]&&this['_addLabel']();}['_style2Json'](_0x286d44,_0x458529){return PlaneStyleConver['toJSON'](_0x286d44,_0x458529,!![]);}['_updateStyleHook'](_0x3c3c8f,_0x200602){const _0x166d13={_0x38e96c:0x794},_0x533deb=_0x3d5d32;_0x200602&&(Cesium__namespace['defined'](_0x200602['heading'])||Cesium__namespace['defined'](_0x200602['pitch'])||Cesium__namespace['defined'](_0x200602[_0x533deb(0x952)]))&&(this['_entity']['orientation']=this[_0x533deb(_0x166d13._0x38e96c)]()),PlaneStyleConver['toCesiumVal'](_0x3c3c8f,this['entityGraphic'],!![]);}[_0x3d5d32(0xd56)](){const _0x104a22={_0x216369:0x1d1,_0x46848d:0xa6c},_0x5727e9=_0x3d5d32;super[_0x5727e9(0xd56)]();const _0x5000e2=getCesiumValue(this['entityGraphic']['dimensions'],Cesium__namespace['Cartesian2'],this[_0x5727e9(_0x104a22._0x216369)]['clock']['currentTime']);_0x5000e2&&PlaneStyleConver['toOneJson']('dimensions',_0x5000e2,this['style']);const _0x8e85ed=getCesiumValue(this['entityGraphic']['plane'],Cesium__namespace[_0x5727e9(_0x104a22._0x46848d)],this['_map']['clock']['currentTime']);_0x8e85ed&&PlaneStyleConver['toOneJson'](_0x5727e9(0x6c8),_0x8e85ed,this['style']);}}register$4(_0x3d5d32(0x6c8),PlaneEntity,!![]);class EditCylinder extends EditPoly{['bindDraggers'](){const _0x50d8a2={_0x51b94d:0x31f,_0x27960:0xdc2,_0x497bfd:0xafc},_0xb03b91={_0x45eedd:0xfa7},_0x2e85bb=_0x3d5d32,_0x5ea9ca=this['positions'],_0x4b7f08=_0x5ea9ca[0x0];let _0x58135d=0x0;const _0x5872ea=this[_0x2e85bb(0xf10)]({'position':_0x4b7f08,'onDragStart':(_0x1c738f,_0x77ed59)=>{const _0x9f3873=_0x2e85bb;for(let _0x255ef7=0x0,_0x1af262=this['draggers'][_0x9f3873(0xc84)];_0x255ef7<_0x1af262;_0x255ef7++){this['draggers'][_0x255ef7]['show']=![];}},'onDrag':(_0xeb5da3,_0x22343f)=>{_0x5ea9ca[0x0]=_0x22343f;},'onDragEnd':(_0x18e386,_0xe5b0c8)=>{const _0x4f9ec9=_0x2e85bb;this[_0x4f9ec9(_0xb03b91._0x45eedd)]();}});_0x5872ea[_0x2e85bb(0x5f9)]=_0x58135d,this['draggers']['push'](_0x5872ea);const _0x14a4b8=getEllipseOuterPositions({'position':_0x4b7f08,'semiMajorAxis':this['style'][_0x2e85bb(0x464)],'semiMinorAxis':this['style']['bottomRadius'],'rotation':Cesium__namespace['Math'][_0x2e85bb(0x562)](Number(this['style'][_0x2e85bb(_0x50d8a2._0x51b94d)]||0x0))});_0x58135d=0x1;const _0x54b7ea=_0x14a4b8[0x0];_0x5ea9ca[_0x58135d]=_0x54b7ea;const _0x27218e=this['createDragger']({'position':_0x54b7ea,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText'](_0x2e85bb(_0x50d8a2._0x27960)),'onDrag':(_0x4420df,_0x15c39d)=>{const _0x376e65=_0x2e85bb;_0x5ea9ca[0x1]=_0x15c39d;const _0x4f48f4=this[_0x376e65(0x29a)](Cesium__namespace['Cartesian3']['distance'](_0x5ea9ca[0x0],_0x15c39d),0x2);this['style'][_0x376e65(0x464)]=_0x4f48f4,this['fire'](EventType['editStyle']);},'onDragEnd':(_0x20309f,_0x2ff983)=>{this['updateDraggers']();}});_0x27218e['index']=_0x58135d,this['draggers'][_0x2e85bb(0xb75)](_0x27218e),_0x58135d=0x2;const _0x49318c=addPositionsHeight(_0x4b7f08,this[_0x2e85bb(0xdde)]['length']);_0x5ea9ca[_0x58135d]=_0x49318c;const _0x32ab90=this['createDragger']({'position':_0x49318c,'type':PointType[_0x2e85bb(0x262)],'tooltip':this['_map'][_0x2e85bb(0xd1b)](_0x2e85bb(_0x50d8a2._0x497bfd)),'onDrag':(_0x308706,_0x51df59)=>{_0x5ea9ca[_0x308706['index']]=_0x51df59;const _0x273c50=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](_0x5ea9ca[0x0],_0x51df59),0x2);this['style']['length']=_0x273c50,this['fire'](EventType['editStyle']);},'onDragEnd':(_0x4020f3,_0x25cf03)=>{this['updateDraggers']();}});_0x32ab90['index']=_0x58135d,this['draggers']['push'](_0x32ab90);}['_updateStyleHook'](_0x429a8c){const _0x1fb7ab={_0x121d89:0xb84},_0x403c4b=_0x3d5d32;super['_updateStyleHook'](_0x429a8c),(Cesium__namespace[_0x403c4b(_0x1fb7ab._0x121d89)](_0x429a8c['topRadius'])||Cesium__namespace['defined'](_0x429a8c[_0x403c4b(0x464)])||Cesium__namespace['defined'](_0x429a8c['length'])||Cesium__namespace[_0x403c4b(_0x1fb7ab._0x121d89)](_0x429a8c['diffHeight']))&&this['updateDraggers']();}}class CylinderEntity extends BasePointEntity{constructor(_0xe1344e={}){super(_0xe1344e),this['_minPointNum']=0x2,this['_maxPointNum']=0x2;}get['entityGraphic'](){const _0x47b08c={_0x46136c:0x221},_0x3744d4=_0x3d5d32;var _0x2280bd;return(_0x2280bd=this['_entity'])===null||_0x2280bd===void 0x0?void 0x0:_0x2280bd[_0x3744d4(_0x47b08c._0x46136c)];}get['EditClass'](){return EditCylinder;}['_mountedHook'](){this['_entity']=this['_createEntity'](this['_getCreateEntityAttr']()),this['style']['label']&&this['_addLabel']();}[_0x3d5d32(0xca6)](){const _0x1ce8e3={'position':this['position'],'orientation':this['getOrientation'](),'cylinder':CylinderStyleConver['toCesiumVal'](this['style'],{},!![])};return _0x1ce8e3;}['_style2Json'](_0x545a47,_0x3b239c){return CylinderStyleConver['toJSON'](_0x545a47,_0x3b239c,!![]);}[_0x3d5d32(0x7b3)](_0x312168,_0xfc61fe){const _0x36beca={_0x3af123:0xb84,_0x4784e2:0x794,_0x18b1f4:0xd76},_0x31d83e=_0x3d5d32;CylinderStyleConver['toCesiumVal'](_0x312168,this['entityGraphic'],{},!![]);(Cesium__namespace[_0x31d83e(_0x36beca._0x3af123)](_0xfc61fe[_0x31d83e(0xe39)])||Cesium__namespace['defined'](_0xfc61fe['pitch'])||Cesium__namespace['defined'](_0xfc61fe['roll']))&&(this['_entity'][_0x31d83e(0x42d)]=this[_0x31d83e(_0x36beca._0x4784e2)]());if(Cesium__namespace['defined'](_0xfc61fe['length'])||Cesium__namespace['defined'](_0xfc61fe[_0x31d83e(0x9e2)])){var _0x10588b;((_0x10588b=this['_positions_draw'])===null||_0x10588b===void 0x0?void 0x0:_0x10588b['length'])>0x0&&(this[_0x31d83e(0x91c)]=addPositionsHeight(this[_0x31d83e(_0x36beca._0x18b1f4)][0x0],_0x312168[_0x31d83e(0xc84)]/0x2));}}['_updatePositionsHook'](){const _0x50a5af={_0x4a0c67:0x367},_0x18765f=_0x3d5d32;var _0x4366ca,_0x5e1912;(_0x4366ca=this[_0x18765f(0x67f)])!==null&&_0x4366ca!==void 0x0&&_0x4366ca['enabled']&&((_0x5e1912=this['_positions_draw'])===null||_0x5e1912===void 0x0?void 0x0:_0x5e1912['length'])>0x0&&(this[_0x18765f(0x91c)]=addPositionsHeight(this['_positions_draw'][0x0],this['style']['length']/0x2)),super[_0x18765f(_0x50a5af._0x4a0c67)]();}[_0x3d5d32(0xd56)](){const _0x23d665={_0x4de1a6:0x4f8,_0x2ae1e1:0xa09,_0x3aec68:0x464,_0x346b5c:0xc84,_0x50d78e:0xb69,_0x5f5642:0xd76,_0x3a92f7:0xdde,_0x2d0a52:0xc84,_0x5ce33e:0xc6d},_0x1da3ba=_0x3d5d32;if(this[_0x1da3ba(0x3a0)])return;this[_0x1da3ba(0x3a0)]=!![];const _0x33bc01=this['_map']['clock'][_0x1da3ba(_0x23d665._0x4de1a6)];this['style']['topRadius']=getCesiumValue(this[_0x1da3ba(_0x23d665._0x2ae1e1)]['topRadius'],Number,_0x33bc01),this['entityGraphic']['topRadius']=new Cesium__namespace['CallbackProperty'](_0x47f2fd=>{return this['style']['topRadius'];},![]),this['style'][_0x1da3ba(_0x23d665._0x3aec68)]=getCesiumValue(this['entityGraphic']['bottomRadius'],Number,_0x33bc01),this['entityGraphic']['bottomRadius']=new Cesium__namespace['CallbackProperty'](_0x4fbd2f=>{const _0x2fd89e=_0x1da3ba;return this[_0x2fd89e(0xdde)]['bottomRadius'];},![]),this['style'][_0x1da3ba(0xc84)]=getCesiumValue(this[_0x1da3ba(0xa09)]['length'],Number,_0x33bc01),this[_0x1da3ba(0xa09)][_0x1da3ba(_0x23d665._0x346b5c)]=new Cesium__namespace['CallbackProperty'](_0x5c188e=>{const _0x155dc1=_0x1da3ba;return this[_0x155dc1(0xdde)]['length'];},![]),this[_0x1da3ba(_0x23d665._0x50d78e)]?(this['_positions_draw']=this['positions'],this[_0x1da3ba(_0x23d665._0x5f5642)][0x0]=addPositionsHeight(this[_0x1da3ba(_0x23d665._0x50d78e)],-this[_0x1da3ba(_0x23d665._0x3a92f7)][_0x1da3ba(_0x23d665._0x2d0a52)]/0x2)):this['_positions_draw']=[],this['_position_show']=this['position'],this[_0x1da3ba(_0x23d665._0x50d78e)]=new Cesium__namespace[(_0x1da3ba(_0x23d665._0x5ce33e))](_0x3e2511=>{return this['_position_show'];},![]);}['_cancelPositionsCallback'](){const _0x39ed7d={_0x348192:0x3a0,_0x1cf3c8:0xdde,_0x1db863:0xe7f},_0x4871b3=_0x3d5d32;if(!this[_0x4871b3(_0x39ed7d._0x348192)])return;this['_isCallbackPositions']=![],this['entityGraphic'][_0x4871b3(0xc84)]=this[_0x4871b3(_0x39ed7d._0x1cf3c8)]['length'],this['entityGraphic']['topRadius']=this[_0x4871b3(_0x39ed7d._0x1cf3c8)][_0x4871b3(0x398)],this['entityGraphic']['bottomRadius']=this['style']['bottomRadius'],this[_0x4871b3(0x87d)]=this['_position_show'],this[_0x4871b3(_0x39ed7d._0x1db863)]=LngLatPoint['fromCartesian'](this['_position']),this['_updatePositionsHook']();}['_startDrawHook'](){const _0x27ed28={_0x23a70e:0x433},_0x2144fa=_0x3d5d32;this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](this['_drawEndEventType'],this['_onDbClickHandler'],this),(this[_0x2144fa(_0x27ed28._0x23a70e)]['hasDrawDelPoint']??!![])&&this[_0x2144fa(0x1d1)]['on'](this['_drawDelEventType'],this[_0x2144fa(0x1df)],this);}['_stopDrawHook'](){const _0x518e73={_0x43f81f:0x1d1},_0x4b5241=_0x3d5d32;this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this[_0x4b5241(0x1d1)]['off'](EventType['click'],this['_onClickHandler'],this),this[_0x4b5241(_0x518e73._0x43f81f)]['off'](this['_drawEndEventType'],this[_0x4b5241(0xc7b)],this),(this['options'][_0x4b5241(0x1fe)]??!![])&&this['_map']['off'](this['_drawDelEventType'],this[_0x4b5241(0x1df)],this);}['updateAttrForDrawing'](_0x1ea665){const _0x54fec2={_0x5a75f7:0xc84},_0x3ed333=_0x3d5d32;this['_position_show']=addPositionsHeight(this['_positions_draw'][0x0],this['style'][_0x3ed333(_0x54fec2._0x5a75f7)]/0x2);if(!_0x1ea665&&this['_positions_draw']['length']>0x1){const _0x2f1d17=formatNum$1(Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],this['_positions_draw'][0x1]),0x2);this[_0x3ed333(0xdde)]['bottomRadius']=_0x2f1d17,this['style']['length']=_0x2f1d17*0x2;}}[_0x3d5d32(0x1df)](_0x3676f2){const _0x429427=_0x3d5d32;super['_onRightClickHandler'](_0x3676f2),this['style'][_0x429427(0x464)]=0x0,this['style']['length']=0x0;}}register$4('cylinder',CylinderEntity,!![]);class ConeTrack extends CylinderEntity{constructor(_0x51cb62={}){const _0xfaaf4f={_0x49a1ff:0xba9},_0x26ca4a=_0x3d5d32;super(_0x51cb62),_0x51cb62['targetPosition']&&(this[_0x26ca4a(_0xfaaf4f._0x49a1ff)]=_0x51cb62['targetPosition']);}get['hasEdit'](){return![];}get['EditClass'](){return undefined;}get['targetPosition'](){return this['_targetPosition'];}set['targetPosition'](_0x3f3a57){const _0x518bd7=_0x3d5d32;this['_targetPoint']=LngLatPoint['parse'](_0x3f3a57),this['_targetPosition']=this['_targetPoint'][_0x518bd7(0xed4)]();}get['targetPoint'](){return this['_targetPoint'];}get['angle'](){return this['style']['angle'];}set['angle'](_0x5e3c22){const _0x2b6f5b=_0x3d5d32;this['style'][_0x2b6f5b(0x247)]=_0x5e3c22;}['_mountedHook'](){super['_mountedHook'](),this['_updateDistanceDisplayConditionByEdit']();}[_0x3d5d32(0xca6)](){const _0x4747f4={_0x43e723:0xc84,_0x437569:0xb84,_0x1eadc7:0x247},_0x34d588={_0x550576:0x8be},_0x478f36=_0x3d5d32,_0x5ca98c=super['_getCreateEntityAttr']();return _0x5ca98c['position']=new Cesium__namespace['CallbackProperty'](_0x340dd9=>{const _0x5109f2=_0x4132;return this[_0x5109f2(_0x34d588._0x550576)](_0x340dd9),this['_cylinderPosition'];},![]),_0x5ca98c['orientation']=new Cesium__namespace['CallbackProperty'](_0x204fb3=>{return this['_orientation'];},![]),_0x5ca98c[_0x478f36(0x221)][_0x478f36(_0x4747f4._0x43e723)]=new Cesium__namespace['CallbackProperty'](_0x67b254=>{return this['_cylinderLength'];},![]),!Cesium__namespace[_0x478f36(_0x4747f4._0x437569)](_0x5ca98c['cylinder']['topRadius'])&&(_0x5ca98c['cylinder']['topRadius']=0x0),Cesium__namespace['defined'](this[_0x478f36(0xdde)][_0x478f36(_0x4747f4._0x1eadc7)])&&(_0x5ca98c['cylinder']['bottomRadius']=new Cesium__namespace[(_0x478f36(0xc6d))](_0x866723=>{return this['_cylinderBottomRadius'];},![])),this['_isCallbackPositions']=!![],_0x5ca98c;}[_0x3d5d32(0x8be)](_0x12270f){const _0x46c685={_0x2a8575:0xb84,_0x5f0b01:0xbd7,_0x16ea26:0x5bb,_0x94d3a:0x1c9,_0x373421:0xd29,_0xc57353:0x1d1,_0x23875f:0x103e,_0x108be8:0x562,_0x556e1b:0x256,_0x36de47:0x247},_0x48c5c6=_0x3d5d32,_0x37cb57=getPositionValue(this['position'],_0x12270f);if(!_0x37cb57){this[_0x48c5c6(0x511)]=undefined;return;}if(Cesium__namespace[_0x48c5c6(_0x46c685._0x2a8575)](this['targetPosition'])){const _0x9403b8=getPositionValue(this['targetPosition'],_0x12270f);_0x9403b8&&(this['_cylinderLength']=Cesium__namespace['Cartesian3'][_0x48c5c6(_0x46c685._0x5f0b01)](_0x37cb57,_0x9403b8),this['_cylinderPosition']=Cesium__namespace['Cartesian3'][_0x48c5c6(0xe04)](_0x37cb57,_0x9403b8,new Cesium__namespace['Cartesian3']()),this['_orientation']=Cesium__namespace[_0x48c5c6(_0x46c685._0x16ea26)]['headingPitchRollQuaternion'](_0x9403b8,getHeadingPitchRollForLine(_0x9403b8,_0x37cb57)));}else{this[_0x48c5c6(_0x46c685._0x94d3a)]=this['style']['length'];if(!this['_cylinderLength']){const _0x320f03=LngLatPoint['parse'](_0x37cb57);this['_cylinderLength']=_0x320f03[_0x48c5c6(_0x46c685._0x373421)]-getHeight(this[_0x48c5c6(_0x46c685._0xc57353)]['scene'],_0x320f03,{'has3dtiles':![]});}const _0x76cdc2=new Cesium__namespace[(_0x48c5c6(0x7ba))](Cesium__namespace['Math']['toRadians'](this['heading']),Cesium__namespace[_0x48c5c6(_0x46c685._0x23875f)]['toRadians'](this['pitch']),Cesium__namespace[_0x48c5c6(0x103e)][_0x48c5c6(_0x46c685._0x108be8)](this['roll']));this['_orientation']=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x37cb57,_0x76cdc2),this['_cylinderPosition']=getPositionByHprAndLen(_0x37cb57,_0x76cdc2,this['_cylinderLength']/0x2);}Cesium__namespace['defined'](this[_0x48c5c6(0xdde)][_0x48c5c6(0x247)])&&(this['_cylinderBottomRadius']=this['_cylinderLength']*Math[_0x48c5c6(_0x46c685._0x556e1b)](Cesium__namespace['Math']['toRadians'](0x5a-this[_0x48c5c6(_0x46c685._0x36de47)])));}['_updatePositionsHook'](){}}register$4(_0x3d5d32(0x6f7),ConeTrack);class EditEllipsoid extends EditBase{['bindDraggers'](){const _0x2ec322={_0x30cc56:0xf10,_0x468946:0x93f,_0x5cd726:0xf10,_0x521ae4:0xd19,_0x592c38:0xd1b,_0x47248a:0xdc2,_0xadd805:0xb75,_0x1cd02d:0xdde,_0x2963d4:0xd54,_0x316f90:0xe44,_0x533ab8:0x93f},_0x4e996f={_0x17b21a:0xd54},_0x27f6df={_0xd58b2a:0x29a,_0x520c57:0xdde},_0x1c44c5={_0x21f5f1:0xfa7},_0x26f0a8=_0x3d5d32;let _0x2796a4;const _0x3d694e=this['positions'][0x0];_0x2796a4=this[_0x26f0a8(_0x2ec322._0x30cc56)]({'position':_0x3d694e,'onDragStart':(_0x49314d,_0x2a7d4b)=>{const _0x4b010b=_0x26f0a8;for(let _0x565a1a=0x0,_0xc3a2cc=this['draggers'][_0x4b010b(0xc84)];_0x565a1a<_0xc3a2cc;_0x565a1a++){this['draggers'][_0x565a1a]['show']=![];}},'onDrag':(_0x1587ab,_0x366b95)=>{this['positions'][0x0]=_0x366b95;},'onDragEnd':(_0x26c6d7,_0x305ad0)=>{const _0x90a147=_0x26f0a8;this[_0x90a147(_0x1c44c5._0x21f5f1)]();}}),_0x2796a4['index']=0x0,this[_0x26f0a8(_0x2ec322._0x468946)][_0x26f0a8(0xb75)](_0x2796a4);const _0x3d3035=this['_graphic'][_0x26f0a8(0x433)]['hasEditRadii']??!![];if(_0x3d3035){_0x2796a4=this[_0x26f0a8(_0x2ec322._0x5cd726)]({'position':addPositionsHeight(_0x3d694e,this['style'][_0x26f0a8(_0x2ec322._0x521ae4)]),'type':PointType['MoveHeight'],'tooltip':this['_map'][_0x26f0a8(_0x2ec322._0x592c38)](_0x26f0a8(_0x2ec322._0x47248a)),'onDrag':(_0x17f040,_0xdc7d00)=>{const _0x35cdda=_0x26f0a8,_0x27a7db=this['positions'][0x0],_0x1e303f=this[_0x35cdda(_0x27f6df._0xd58b2a)](Cesium__namespace['Cartesian3']['distance'](_0x27a7db,_0xdc7d00),0x2);this[_0x35cdda(_0x27f6df._0x520c57)]['radii_z']=_0x1e303f,this['_graphic'][_0x35cdda(0x3ff)](this[_0x35cdda(0xdde)]),this['fire'](EventType['editStyle']);}}),this[_0x26f0a8(_0x2ec322._0x468946)][_0x26f0a8(_0x2ec322._0xadd805)](_0x2796a4);const _0x19f475=getEllipseOuterPositions({'position':_0x3d694e,'semiMajorAxis':Number(this[_0x26f0a8(_0x2ec322._0x1cd02d)][_0x26f0a8(_0x2ec322._0x2963d4)]),'semiMinorAxis':Number(this['style'][_0x26f0a8(0xe93)]),'rotation':Cesium__namespace[_0x26f0a8(0x103e)]['toRadians'](Number(this[_0x26f0a8(_0x2ec322._0x1cd02d)][_0x26f0a8(0x31f)]||0x0))}),_0x57b0ac=_0x19f475[0x0],_0x12cc2e=this['createDragger']({'position':_0x57b0ac,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText']('_修改半径'),'onDrag':(_0x59b284,_0x3fd849)=>{const _0x4a58cf=_0x26f0a8,_0x5cbb3c=this['positions'][0x0],_0x1d4f34=Cesium__namespace[_0x4a58cf(0x220)]['fromCartesian'](_0x5cbb3c)[_0x4a58cf(0x83e)];_0x3fd849=setPositionsHeight(_0x3fd849,_0x1d4f34),_0x59b284[_0x4a58cf(0xb69)]=_0x3fd849;const _0x49ff4a=this[_0x4a58cf(0x29a)](Cesium__namespace['Cartesian3']['distance'](_0x5cbb3c,_0x3fd849),0x2);this['style']['radii_y']=_0x49ff4a,this['_graphic']['updateRadii'](this['style']),this['fire'](EventType['editStyle']);}});_0x2796a4['majorDragger']=_0x12cc2e,this['draggers']['push'](_0x12cc2e);const _0xc11e0c=_0x19f475[0x1],_0x57d1cd=this[_0x26f0a8(0xf10)]({'position':_0xc11e0c,'type':PointType['EditAttr'],'tooltip':this['_map']['getLangText'](_0x26f0a8(0xdc2)),'onDrag':(_0x5810c2,_0x574d55)=>{const _0x4aed4d=_0x26f0a8,_0x5728f0=this['positions'][0x0],_0x2b0670=Cesium__namespace['Cartographic'][_0x4aed4d(0xd14)](_0x5728f0)[_0x4aed4d(0x83e)];_0x574d55=setPositionsHeight(_0x574d55,_0x2b0670),_0x5810c2['position']=_0x574d55;const _0x27f799=this['formatNum'](Cesium__namespace['Cartesian3']['distance'](_0x5728f0,_0x574d55),0x2);this[_0x4aed4d(0xdde)][_0x4aed4d(_0x4e996f._0x17b21a)]=_0x27f799,this['_graphic']['updateRadii'](this['style']),this['fire'](EventType['editStyle']);}});_0x2796a4[_0x26f0a8(_0x2ec322._0x316f90)]=_0x57d1cd,this[_0x26f0a8(_0x2ec322._0x533ab8)]['push'](_0x57d1cd);}}['_updateStyleHook'](_0x32a8db){const _0x257827={_0x250ceb:0x7b3,_0xfc8f8c:0xb84,_0x1a34a2:0xd19},_0x3dc814=_0x3d5d32;super[_0x3dc814(_0x257827._0x250ceb)](_0x32a8db),(Cesium__namespace['defined'](_0x32a8db['radii_x'])||Cesium__namespace['defined'](_0x32a8db[_0x3dc814(0xe93)])||Cesium__namespace[_0x3dc814(_0x257827._0xfc8f8c)](_0x32a8db[_0x3dc814(_0x257827._0x1a34a2)]))&&this[_0x3dc814(0xfa7)]();}}class EllipsoidEntity extends BasePointEntity{constructor(_0x3e29b2={}){const _0x3a9c57={_0x3dd08c:0xab2},_0x4ca35c=_0x3d5d32;super(_0x3e29b2),this[_0x4ca35c(_0x3a9c57._0x3dd08c)]=0x2,this['_maxPointNum']=0x3;}get[_0x3d5d32(0xa09)](){var _0x95e785;return(_0x95e785=this['_entity'])===null||_0x95e785===void 0x0?void 0x0:_0x95e785['ellipsoid'];}get['EditClass'](){return EditEllipsoid;}get['czmObjectEx'](){const _0x1de75a=_0x3d5d32;let _0x29b3c5=[];return this['_primitive_label']&&_0x29b3c5['push'](this[_0x1de75a(0xdaf)]),this[_0x1de75a(0xd84)]&&(_0x29b3c5=_0x29b3c5['concat'](this[_0x1de75a(0xd84)])),_0x29b3c5;}['_mountedHook'](){const _0x144763={_0x316545:0x794,_0x52017d:0xb9b},_0x1668ac=_0x3d5d32,_0x309d09={'position':this['position'],'orientation':this[_0x1668ac(_0x144763._0x316545)](),'ellipsoid':EllipsoidStyleConver[_0x1668ac(0x83d)](this['style'],{},!![])};this['_entity']=this['_createEntity'](_0x309d09);this[_0x1668ac(0xdde)][_0x1668ac(0x32a)]&&this['_addLabel']();const _0x4101ed=this['options'][_0x1668ac(_0x144763._0x52017d)]||this['style']['scanPlane'];_0x4101ed&&(Array['isArray'](_0x4101ed)?_0x4101ed[_0x1668ac(0x1061)](_0x51bc5e=>{this['addScanPlane'](_0x51bc5e);}):this['addScanPlane'](_0x4101ed));}[_0x3d5d32(0x53e)](_0x12c76f,_0x31531e){const _0x3f2efb={_0x4ffa28:0xd84,_0x5ba62e:0x1061},_0x442ee4={_0x11b3e:0xb75},_0x4a4de7=_0x3d5d32;_0x31531e=EllipsoidStyleConver['toJSON'](_0x12c76f,_0x31531e,!![]);if(this[_0x4a4de7(_0x3f2efb._0x4ffa28)]&&this['_entity_scanPlane']['length']>0x0){const _0x52bd9e=[];this['_entity_scanPlane'][_0x4a4de7(_0x3f2efb._0x5ba62e)](_0x538b9d=>{const _0x5b13f9=_0x4a4de7;_0x52bd9e[_0x5b13f9(_0x442ee4._0x11b3e)](_0x538b9d['_planeOptions']);}),_0x31531e['scanPlane']=_0x52bd9e;}return _0x31531e;}['_updateStyleHook'](_0xc52272,_0x3d1e89){const _0x3f1dc5={_0xd83afa:0xa09,_0x51bba0:0xe39,_0x38980e:0x42d,_0x41c933:0x3ff},_0x402bea=_0x3d5d32;EllipsoidStyleConver['toCesiumVal'](_0xc52272,this[_0x402bea(_0x3f1dc5._0xd83afa)],!![]),(Cesium__namespace[_0x402bea(0xb84)](_0x3d1e89[_0x402bea(_0x3f1dc5._0x51bba0)])||Cesium__namespace['defined'](_0x3d1e89['pitch'])||Cesium__namespace[_0x402bea(0xb84)](_0x3d1e89['roll']))&&(this['_entity'][_0x402bea(_0x3f1dc5._0x38980e)]=this['getOrientation']()),(Cesium__namespace['defined'](_0x3d1e89['radii_x'])||Cesium__namespace['defined'](_0x3d1e89['radii_y'])||Cesium__namespace['defined'](_0x3d1e89[_0x402bea(0xd19)]))&&this[_0x402bea(_0x3f1dc5._0x41c933)](_0xc52272);}['_updatePositionsHook'](){const _0x5a807b=_0x3d5d32;super['_updatePositionsHook'](),this['_entity_scanPlane']&&this[_0x5a807b(0xd84)]['forEach'](_0x488d54=>{const _0x1071c0=_0x5a807b;_0x488d54['position']=this[_0x1071c0(0xb69)];});}[_0x3d5d32(0xd4c)](_0x3c5477,_0x44a6bc){const _0x30c516={_0xd159a1:0xb9b},_0x248081=_0x3d5d32;if(_0x44a6bc[_0x248081(_0x30c516._0xd159a1)]){this['removeAllScanPlan']();const _0x2178b7=_0x3c5477['scanPlane'];Array['isArray'](_0x2178b7)?_0x2178b7['forEach'](_0x2cd43d=>{this['addScanPlane'](_0x2cd43d);}):this[_0x248081(0xfec)](_0x2178b7);}}[_0x3d5d32(0x360)](_0x52fc5d){const _0x22a99f={_0x11e700:0x1061},_0x1e77bf={_0x5de09a:0xdde,_0x1de2db:0xc96,_0x170c27:0xdde},_0x3d30a0=_0x3d5d32;var _0x132220;((_0x132220=this['_entity_scanPlane'])===null||_0x132220===void 0x0?void 0x0:_0x132220[_0x3d30a0(0xc84)])>0x0&&this['_entity_scanPlane'][_0x3d30a0(_0x22a99f._0x11e700)](_0x23e820=>{const _0x350bd9=_0x3d30a0,_0x478624=this['_updateEntityOpacity'](_0x23e820['ellipsoid'],_0x52fc5d);!_0x478624&&(_0x23e820['_planeOptions'][_0x350bd9(_0x1e77bf._0x5de09a)][_0x350bd9(_0x1e77bf._0x1de2db)]=_0x52fc5d,EllipsoidStyleConver['toCesiumVal'](_0x23e820['_planeOptions'][_0x350bd9(_0x1e77bf._0x170c27)],_0x23e820['ellipsoid'],!![]));});}['updateRadii'](_0x18f5d8){const _0x60fb9b={_0x371c31:0xe95,_0x2dbeb4:0xd19,_0x53d31d:0xa09},_0x4a7cdb=_0x3d5d32,_0x301c63=new Cesium__namespace[(_0x4a7cdb(_0x60fb9b._0x371c31))](_0x18f5d8['radii_x'],_0x18f5d8['radii_y'],_0x18f5d8[_0x4a7cdb(_0x60fb9b._0x2dbeb4)]);this['entityGraphic']['radii']?this['entityGraphic']['radii']['setValue'](_0x301c63):this[_0x4a7cdb(_0x60fb9b._0x53d31d)]['radii']=_0x301c63;}['_setPositionsToCallback'](){const _0x1b1093={_0x50082a:0x1d1,_0x138de1:0x9f4,_0x305432:0xd19},_0x3b9501=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];const _0x3a8742=getCesiumValue(this['entityGraphic']['radii'],Cesium__namespace['Cartesian3'],this[_0x3b9501(_0x1b1093._0x50082a)][_0x3b9501(_0x1b1093._0x138de1)]['currentTime']);_0x3a8742&&(this[_0x3b9501(0xdde)]['radii_x']=this['style']['radii_x']??_0x3a8742['x'],this['style']['radii_y']=this['style']['radii_y']??_0x3a8742['y'],this['style']['radii_z']=this['style'][_0x3b9501(_0x1b1093._0x305432)]??_0x3a8742['z']),this[_0x3b9501(0xd76)]=this['positions']||[],this['position']=new Cesium__namespace[(_0x3b9501(0xc6d))](_0x355cd3=>{if(this['_positions_draw']['length']<0x1)return null;return this['_positions_draw'][0x0];},![]);}[_0x3d5d32(0xa84)](){const _0x10e499={_0x3958e3:0x3a0,_0x4f5fc8:0xe7f},_0x3bc33d=_0x3d5d32;if(!this[_0x3bc33d(_0x10e499._0x3958e3)])return;this[_0x3bc33d(0x3a0)]=![],this['_position']=this['_positions_draw'][0x0],this[_0x3bc33d(_0x10e499._0x4f5fc8)]=LngLatPoint['fromCartesian'](this['_position']),this['_updatePositionsHook']();}['_startDrawHook'](){const _0x33f948={_0x1b7c07:0x1d1,_0x1ce5ab:0xb59},_0x1ee806=_0x3d5d32;this['_map']['on'](EventType[_0x1ee806(0x314)],this[_0x1ee806(0x9b8)],this),this[_0x1ee806(_0x33f948._0x1b7c07)]['on'](EventType[_0x1ee806(_0x33f948._0x1ce5ab)],this['_onClickHandler'],this),this['_map']['on'](this[_0x1ee806(0x431)],this['_onDbClickHandler'],this),(this['options']['hasDrawDelPoint']??!![])&&this['_map']['on'](this[_0x1ee806(0x39b)],this['_onRightClickHandler'],this);}['_stopDrawHook'](){const _0x161fcb={_0x55ce8d:0x9e7,_0x3b96ab:0x1fe,_0x35c0ad:0x9e7},_0x5ceb74=_0x3d5d32;this['_map']['off'](EventType[_0x5ceb74(0x314)],this['_onMouseMoveHandler'],this),this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this['_map'][_0x5ceb74(_0x161fcb._0x55ce8d)](this[_0x5ceb74(0x431)],this['_onDbClickHandler'],this),(this[_0x5ceb74(0x433)][_0x5ceb74(_0x161fcb._0x3b96ab)]??!![])&&this[_0x5ceb74(0x1d1)][_0x5ceb74(_0x161fcb._0x35c0ad)](this['_drawDelEventType'],this['_onRightClickHandler'],this);}['updateAttrForDrawing'](_0x59f47f){const _0x881ba6={_0x59c4f1:0xc84,_0xea125b:0xbd7,_0x519aab:0xd19},_0x292607=_0x3d5d32;if(this['_positions_draw'][_0x292607(_0x881ba6._0x59c4f1)]<0x2)return;if(!_0x59f47f){const _0x1f5d8a=formatNum$1(Cesium__namespace['Cartesian3'][_0x292607(_0x881ba6._0xea125b)](this['_positions_draw'][0x0],this['_positions_draw'][0x1]),0x2);this['style']['radii_x']=_0x1f5d8a,this['style'][_0x292607(_0x881ba6._0x519aab)]=_0x1f5d8a;let _0x3b9ee5;this['_positions_draw']['length']===0x3?_0x3b9ee5=formatNum$1(Cesium__namespace['Cartesian3']['distance'](this['_positions_draw'][0x0],this['_positions_draw'][0x2]),0x2):_0x3b9ee5=_0x1f5d8a,this[_0x292607(0xdde)]['radii_y']=_0x3b9ee5,this[_0x292607(0x3ff)](this[_0x292607(0xdde)]);}}['_onRightClickHandler'](_0x4fb1bf){const _0x32347f={_0x3a732f:0xd54},_0x49593b=_0x3d5d32;super['_onRightClickHandler'](_0x4fb1bf),this['style'][_0x49593b(0xe93)]=0x0,this['_positions_draw']['length']===0x1&&(this[_0x49593b(0xdde)][_0x49593b(_0x32347f._0x3a732f)]=0x0,this['style'][_0x49593b(0xd19)]=0x0),this['updateRadii'](this['style']);}[_0x3d5d32(0xfec)](_0x29544f={}){const _0x2ff6cc={_0x558771:0xe8f,_0x95360e:0xdde,_0x26070d:0xfdc,_0x40f320:0x301,_0x1beca3:0x7d5,_0x266562:0x103e,_0x90c3f1:0xed0,_0x15bc35:0x90c},_0x1f0f28={_0x4198fc:0xed0,_0x154ade:0x4b5},_0x4befd8={_0x13e1a4:0x9f4},_0x8831ba={_0x1d42d1:0x5cf,_0x47cc40:0x5bb},_0x12de1f=_0x3d5d32;this['_entity_scanPlane']=this['_entity_scanPlane']||[],_0x29544f['style']=_0x29544f['style']||{};const _0x133359={'radii':this[_0x12de1f(0xa09)][_0x12de1f(0x29f)],'innerRadii':0.00001,'minimumClockDegree':-0.00001,'maximumClockDegree':0.00001,'minimumConeDegree':this[_0x12de1f(0xdde)]['minimumConeDegree']||0x0,'maximumConeDegree':this['style']['maximumConeDegree']||0x5a,'outline':![]};if(this[_0x12de1f(0xdde)]['color'])_0x133359[_0x12de1f(_0x2ff6cc._0x558771)]=this['style']['color'],this['style'][_0x12de1f(0xfdc)]&&(_0x133359['opacity']=this[_0x12de1f(_0x2ff6cc._0x95360e)]['opacity']);else this['style']['outlineColor']&&(_0x133359['color']=this['style']['outlineColor'],this['style']['outlineOpacity']&&(_0x133359[_0x12de1f(_0x2ff6cc._0x26070d)]=this['style'][_0x12de1f(_0x2ff6cc._0x40f320)]));let _0x27434c;const _0x1874c3=Cesium__namespace['Math']['toRadians'](_0x29544f[_0x12de1f(_0x2ff6cc._0x1beca3)]||0.5),_0x14091b=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math']['toRadians'](_0x29544f['style']['heading']||this['heading']),Cesium__namespace[_0x12de1f(_0x2ff6cc._0x266562)][_0x12de1f(0x562)](_0x29544f['style']['pitch']||this['pitch']),Cesium__namespace['Math']['toRadians'](_0x29544f['style'][_0x12de1f(0x952)]||this['roll']));let _0x568963=Cesium__namespace['Transforms'][_0x12de1f(_0x2ff6cc._0x90c3f1)](this['positionShow'],_0x14091b);switch(_0x29544f['type']){case'pitch':{const _0x2876af=Cesium__namespace[_0x12de1f(0x103e)]['toRadians'](_0x29544f[_0x12de1f(_0x2ff6cc._0x15bc35)]??0x0),_0x17d026=Cesium__namespace['Math']['toRadians'](_0x29544f[_0x12de1f(0xe8e)]??0xb4);_0x27434c=new Cesium__namespace['CallbackProperty'](_0x549648=>{const _0x36642a=_0x12de1f;if(!this['_map']['clock']['shouldAnimate'])return _0x568963;return _0x14091b[_0x36642a(_0x8831ba._0x1d42d1)]+=_0x1874c3,_0x14091b['pitch']>=_0x17d026&&(_0x14091b['pitch']=_0x2876af),_0x568963=Cesium__namespace[_0x36642a(_0x8831ba._0x47cc40)]['headingPitchRollQuaternion'](this['positionShow'],_0x14091b),_0x568963;},![]);}break;case'roll':{const _0x12de09=Cesium__namespace['Math'][_0x12de1f(0x562)](_0x29544f['min']??-0x5a),_0x18dbea=Cesium__namespace['Math']['toRadians'](_0x29544f['max']??0x5a);_0x27434c=new Cesium__namespace['CallbackProperty'](_0x796cfb=>{const _0x25cee8=_0x12de1f;if(!this['_map'][_0x25cee8(_0x4befd8._0x13e1a4)]['shouldAnimate'])return _0x568963;return _0x14091b['roll']+=_0x1874c3,_0x14091b['roll']>=_0x18dbea&&(_0x14091b[_0x25cee8(0x952)]=_0x12de09),_0x568963=Cesium__namespace['Transforms']['headingPitchRollQuaternion'](this['positionShow'],_0x14091b),_0x568963;},![]);}break;case _0x12de1f(0xe39):default:{const _0x1380c2=Cesium__namespace[_0x12de1f(_0x2ff6cc._0x266562)]['toRadians'](_0x29544f['min']??-0xb4),_0x2ff4fd=Cesium__namespace['Math']['toRadians'](_0x29544f['max']??0xb4);_0x27434c=new Cesium__namespace['CallbackProperty'](_0x21c0c2=>{const _0x5ca04a=_0x12de1f;if(!this[_0x5ca04a(0x1d1)]['clock']['shouldAnimate'])return _0x568963;return _0x14091b['heading']+=_0x1874c3,_0x14091b[_0x5ca04a(0xe39)]>=_0x2ff4fd&&(_0x14091b[_0x5ca04a(0xe39)]=_0x1380c2),_0x568963=Cesium__namespace['Transforms'][_0x5ca04a(_0x1f0f28._0x4198fc)](this[_0x5ca04a(_0x1f0f28._0x154ade)],_0x14091b),_0x568963;},![]);break;}}const _0x50f74e={'id':'scanPlane-'+createGuid(),'position':this[_0x12de1f(0xb69)],'orientation':_0x27434c,'ellipsoid':EllipsoidStyleConver[_0x12de1f(0x83d)]({..._0x133359,..._0x29544f['style']},{},!![])},_0x5c66ea=this['_createEntity'](_0x50f74e);return this['dataSource']&&this['isAdded']&&this['dataSource']['entities']['add'](_0x5c66ea),this['bindPickId'](_0x5c66ea),_0x5c66ea['_planeOptions']=_0x29544f,this['_entity_scanPlane']['push'](_0x5c66ea),_0x5c66ea;}['removeScanPlan'](_0x2ab4cb){const _0x49cc51=_0x3d5d32;this[_0x49cc51(0x426)]&&this['isAdded']&&this['dataSource']['entities']['remove'](_0x2ab4cb),removeArrayItem(this['_entity_scanPlane'],_0x2ab4cb);}['removeAllScanPlan'](){const _0x20cb45={_0xf06001:0xf06};this['dataSource']&&this['isAdded']&&this['_entity_scanPlane']['forEach'](_0x151079=>{const _0x1b9535=_0x4132;this['dataSource']['entities'][_0x1b9535(_0x20cb45._0xf06001)](_0x151079);}),this['_entity_scanPlane']=[];}}register$4('ellipsoid',EllipsoidEntity,!![]);class PolylineEntity extends BasePolyEntity{get['entityGraphic'](){var _0x6db5ad;return(_0x6db5ad=this['_entity'])===null||_0x6db5ad===void 0x0?void 0x0:_0x6db5ad['polyline'];}['_mountedHook'](){const _0x38700d={_0x19c552:0x534},_0x5ce5af=_0x3d5d32;this[_0x5ce5af(_0x38700d._0x19c552)]=this[_0x5ce5af(0x7f0)](this['positions']);const _0x493c48={'polyline':PolylineStyleConver['toCesiumVal'](this['style'],{},!![])};_0x493c48['polyline']['positions']=this['_positions_show'],this['_entity']=this['_createEntity'](_0x493c48),this['style']['label']&&this['_addLabel']();}[_0x3d5d32(0x7f0)](_0x2ed777){const _0x2082b5={_0x1e67c6:0xc97},_0x4e742b=_0x3d5d32;return this['style']['closure']&&(_0x2ed777===null||_0x2ed777===void 0x0?void 0x0:_0x2ed777['length'])>0x0?_0x2ed777[_0x4e742b(_0x2082b5._0x1e67c6)](_0x2ed777[0x0]):_0x2ed777;}[_0x3d5d32(0x53e)](_0x1d1b9e,_0x462821){return PolylineStyleConver['toJSON'](_0x1d1b9e,_0x462821,!![]);}[_0x3d5d32(0x7b3)](_0x3de854,_0x3e8c52){const _0x5219ec={_0x4e6b23:0x83d,_0x298dda:0xf22},_0xd5c040=_0x3d5d32;PolylineStyleConver[_0xd5c040(_0x5219ec._0x4e6b23)](_0x3de854,this['entityGraphic'],!![]),Cesium__namespace['defined'](_0x3e8c52===null||_0x3e8c52===void 0x0?void 0x0:_0x3e8c52['closure'])&&(!this['_isCallbackPositions']&&(this['_positions_show']=this['getShowPositions'](this[_0xd5c040(0x924)]),this['entityGraphic']['positions']=this['_positions_show']),this[_0xd5c040(_0x5219ec._0x298dda)]());}['_updatePositionsHook'](){const _0x3c9269={_0x86599a:0x924,_0x2ceef8:0x429},_0x57c108=_0x3d5d32;this[_0x57c108(_0x3c9269._0x86599a)]instanceof Cesium__namespace['CallbackProperty']?this['entityGraphic']['positions']=this['_positions']:(this['_positions_show']=this['getShowPositions'](this['_positions']),this['entityGraphic']['positions']=this['_positions_show']),this[_0x57c108(_0x3c9269._0x2ceef8)](),this['_updateEditDraggers']();}[_0x3d5d32(0x917)](){return this['_positions_show'];}['updateAttrForDrawing'](_0x255a4d){const _0x15786f={_0x5eb33a:0xd76},_0x1321a0=_0x3d5d32;Cesium__namespace['defined'](this['entityGraphic']['depthFailMaterial'])&&(this[_0x1321a0(0xa09)][_0x1321a0(0xbb8)]=this['_positions_CallbackProperty']()),this['_positions_show']=this['getShowPositions'](this[_0x1321a0(_0x15786f._0x5eb33a)]);}['_stopDrawHook'](){const _0x44c7d6={_0x3ff64c:0xd76},_0x4f41d9=_0x3d5d32;super['_stopDrawHook'](),Cesium__namespace['defined'](this[_0x4f41d9(0xa09)]['depthFailMaterial'])&&(this['positions']=this[_0x4f41d9(_0x44c7d6._0x3ff64c)]);}['_updateDistanceDisplayConditionByEdit'](){const _0x8259f1={_0x4dacf7:0x342},_0x229945=_0x3d5d32;if(this[_0x229945(0x3a0)]&&this[_0x229945(0xdde)]['clampToGround']){let _0x159a50;const _0x3493ec=this['center'];_0x3493ec?_0x159a50=Cesium__namespace['Cartesian3']['distance'](_0x3493ec,new Cesium__namespace['Cartesian3']()):_0x159a50=(Cesium__namespace['Ellipsoid']['WGS84']['minimumRadius']+Cesium__namespace['Ellipsoid']['WGS84']['maximumRadius'])/0x2,this[_0x229945(_0x8259f1._0x4dacf7)](_0x159a50);}else this['updateDistanceDisplayCondition']();}}register$4('polyline',PolylineEntity);class CurveEntity extends PolylineEntity{['getShowPositions'](_0x37d53a){if(!_0x37d53a||_0x37d53a['length']<0x2)return _0x37d53a;return getBezierCurve(_0x37d53a,this['style']);}}register$4('curve',CurveEntity);class EditPolylineVolume extends EditPoly{}class PolylineVolumeEntity extends BasePolyEntity{get['entityGraphic'](){var _0x3a9651;return(_0x3a9651=this['_entity'])===null||_0x3a9651===void 0x0?void 0x0:_0x3a9651['polylineVolume'];}get['EditClass'](){return EditPolylineVolume;}['_mountedHook'](){const _0x7de340={_0x3fc0d1:0x45f,_0x1b229e:0x3d2},_0x52311c=_0x3d5d32,_0x5d3d0a={'polylineVolume':PolylineVolumeStyleConver['toCesiumVal'](this['style'],{},!![])};_0x5d3d0a['polylineVolume']['positions']=this['positions'],this['_entity']=this[_0x52311c(_0x7de340._0x3fc0d1)](_0x5d3d0a),this['style']['label']&&this[_0x52311c(_0x7de340._0x1b229e)]();}['_style2Json'](_0xaf832f,_0x52c6ca){return PolylineVolumeStyleConver['toJSON'](_0xaf832f,_0x52c6ca,!![]);}[_0x3d5d32(0x7b3)](_0x5a7f2c,_0x5cc16a){PolylineVolumeStyleConver['toCesiumVal'](_0x5a7f2c,this['entityGraphic'],!![]);}[_0x3d5d32(0x367)](){const _0x45cdcd=_0x3d5d32;this['entityGraphic']['positions']=this[_0x45cdcd(0xbb8)],this['_updateLabelPosition'](),this[_0x45cdcd(0x7b9)]();}}register$4('polylineVolume',PolylineVolumeEntity);class PathEntity extends BasePointEntity{constructor(_0xd1f03d={}){const _0x18a736={_0x518302:0xc46},_0x118887=_0x3d5d32;super(_0xd1f03d),delete this['startEditing'],this[_0x118887(_0x18a736._0x518302)]=![];}get['entityGraphic'](){var _0x4deefe;return(_0x4deefe=this['_entity'])===null||_0x4deefe===void 0x0?void 0x0:_0x4deefe['path'];}get['orientationShow'](){const _0x3aa48a={_0x42a655:0x1d1},_0x1ef762=_0x3d5d32,_0x92e76=Cesium__namespace['Property']['getValueOrUndefined'](this[_0x1ef762(0x42d)],this[_0x1ef762(_0x3aa48a._0x42a655)]['clock']['currentTime'],new Cesium__namespace['Quaternion']());return _0x92e76;}get[_0x3d5d32(0xaea)](){return getHeadingPitchRollByOrientation(this['positionShow'],this['orientationShow']);}get[_0x3d5d32(0x5cf)](){return this['style']['pitch']??0x0;}set['pitch'](_0x36bfc6){this['style']['pitch']=_0x36bfc6,this['updateOrientation']();}get[_0x3d5d32(0x952)](){return this['style']['roll']??0x0;}set['roll'](_0x17e461){const _0x416804={_0xcf4a0:0xbe8},_0x1cd35c=_0x3d5d32;this['style'][_0x1cd35c(0x952)]=_0x17e461,this[_0x1cd35c(_0x416804._0xcf4a0)]();}get['positions'](){return this['_positions'];}set[_0x3d5d32(0xbb8)](_0x37a887){const _0x3f9da3={_0x3bb284:0xbe9},_0x249f8f=_0x3d5d32;if(!_0x37a887)return;const _0x2e6892=new Cesium__namespace[(_0x249f8f(_0x3f9da3._0x3bb284))]();_0x37a887['forEach']((_0x2685c8,_0x27ba87)=>{const _0xe81935=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x2685c8[0x3]));_0x2e6892['addSample'](_0xe81935,Cesium__namespace['Cartesian3']['fromDegrees'](_0x2685c8[0x0],_0x2685c8[0x1],_0x2685c8[0x2]));}),this['position']=_0x2e6892;}get[_0x3d5d32(0x2ae)](){return this['getCoordinates']();}[_0x3d5d32(0x367)](){const _0x408698={_0x3ce3c6:0xb69,_0x3af0e1:0x42d,_0x726e39:0x433,_0x228113:0x433,_0x3d7a36:0xb15,_0x96bce3:0xb15,_0x11cb68:0x6ed},_0x2855ec=_0x3d5d32;super['_updatePositionsHook']();if(!this['position']||this[_0x2855ec(_0x408698._0x3ce3c6)]instanceof Cesium__namespace['Cartesian3'])this['_entity'][_0x2855ec(_0x408698._0x3af0e1)]=undefined,this['_entity'][_0x2855ec(0x6fb)]=undefined;else{var _0x18f4aa,_0x3d8196,_0x5387db;this[_0x2855ec(_0x408698._0x726e39)]['_auto_orientation']&&(this[_0x2855ec(0x89b)]['orientation']=new Cesium__namespace['VelocityOrientationProperty'](this['position']));if(this[_0x2855ec(_0x408698._0x228113)]['_auto_availability']&&((_0x18f4aa=this[_0x2855ec(_0x408698._0x3ce3c6)])===null||_0x18f4aa===void 0x0?void 0x0:(_0x3d8196=_0x18f4aa['_property'])===null||_0x3d8196===void 0x0?void 0x0:(_0x5387db=_0x3d8196[_0x2855ec(_0x408698._0x3d7a36)])===null||_0x5387db===void 0x0?void 0x0:_0x5387db['length'])>0x0){var _0x4206a6;const _0x2d1c03=this['position']['_property'][_0x2855ec(_0x408698._0x96bce3)],_0x2afbf4=_0x2d1c03[0x0];let _0x4b44a2=_0x2d1c03[_0x2d1c03['length']-0x1];((_0x4206a6=this['position'])===null||_0x4206a6===void 0x0?void 0x0:_0x4206a6['forwardExtrapolationType'])===Cesium__namespace['ExtrapolationType'][_0x2855ec(0x807)]&&(_0x4b44a2=Cesium__namespace[_0x2855ec(0x8b7)]['fromDate'](new Date(0x834,0x1,0x1))),this[_0x2855ec(0x89b)]['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace[(_0x2855ec(_0x408698._0x11cb68))]({'start':_0x2afbf4,'stop':_0x4b44a2})]);}}}['_mountedHook'](){const _0x45a617={_0x4deeab:0xdde,_0x242b77:0x6fb,_0x2352fe:0xb69,_0x29b0b7:0x5f7,_0x553721:0xaa6,_0x567375:0x9f4,_0x1443e6:0x32a,_0x4e3c5e:0xaed,_0x48fe19:0x83d,_0x37f2c8:0xbbe,_0x36676a:0xb84,_0x36eb8b:0xe39,_0x313e5f:0x89b},_0x593275=_0x3d5d32;this['position']&&!this['options']['orientation']&&(this['options']['orientation']=new Cesium__namespace['VelocityOrientationProperty'](this['position']),this['_auto_orientation']=!![]);const _0x31693b={'position':this['position'],'orientation':this['options']['orientation'],'path':PathStyleConver['toCesiumVal'](this[_0x593275(_0x45a617._0x4deeab)]||this['options']['path'],{},!![])};if(!this['options'][_0x593275(_0x45a617._0x242b77)]){var _0x2d484e,_0x3d5aaa,_0xfa6274;if(((_0x2d484e=this[_0x593275(_0x45a617._0x2352fe)])===null||_0x2d484e===void 0x0?void 0x0:(_0x3d5aaa=_0x2d484e[_0x593275(_0x45a617._0x29b0b7)])===null||_0x3d5aaa===void 0x0?void 0x0:(_0xfa6274=_0x3d5aaa['_times'])===null||_0xfa6274===void 0x0?void 0x0:_0xfa6274['length'])>0x0){var _0x8c4ccd;const _0x11e70c=this['position'][_0x593275(0x5f7)]['_times'],_0x22d4dd=_0x11e70c[0x0];let _0x30a6d9=_0x11e70c[_0x11e70c['length']-0x1];((_0x8c4ccd=this['position'])===null||_0x8c4ccd===void 0x0?void 0x0:_0x8c4ccd['forwardExtrapolationType'])===Cesium__namespace[_0x593275(_0x45a617._0x553721)]['HOLD']&&(_0x30a6d9=Cesium__namespace['JulianDate']['fromDate'](new Date(0x834,0x1,0x1))),_0x31693b['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x22d4dd,'stop':_0x30a6d9})]),this['_auto_availability']=!![];}else{var _0x582f24;const _0x5234de=this['_map'][_0x593275(_0x45a617._0x567375)]['currentTime'];let _0x2e6691=Cesium__namespace['JulianDate']['addDays'](_0x5234de,0x1,new Cesium__namespace['JulianDate']());((_0x582f24=this['position'])===null||_0x582f24===void 0x0?void 0x0:_0x582f24['forwardExtrapolationType'])===Cesium__namespace['ExtrapolationType']['HOLD']&&(_0x2e6691=Cesium__namespace['JulianDate']['addDays'](_0x2e6691,0x16d,new Cesium__namespace['JulianDate']())),_0x31693b['availability']=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':_0x5234de,'stop':_0x2e6691})]);}}this['options']['label']&&(this['options'][_0x593275(_0x45a617._0x1443e6)]['text']=this['options'][_0x593275(0x32a)]['text']||this[_0x593275(_0x45a617._0x4e3c5e)],_0x31693b['label']=LabelStyleConver[_0x593275(_0x45a617._0x48fe19)](this['options'][_0x593275(_0x45a617._0x1443e6)]));this['options']['billboard']&&(_0x31693b['billboard']=BillboardStyleConver['toCesiumVal'](this[_0x593275(0x433)]['billboard']));this['options']['point']&&(_0x31693b[_0x593275(_0x45a617._0x37f2c8)]=PointStyleConver['toCesiumVal'](this['options']['point']));this['options']['circle']&&(_0x31693b['ellipse']=CircleStyleConver['toCesiumVal'](this['options']['circle'],{},!![]));if(this['options']['model']){_0x31693b['model']=ModelStyleConver['toCesiumVal'](this['options'][_0x593275(0x600)],{},!![]);const _0x40f903=this['options']['model'];(_0x40f903['mergeOrientation']||!Cesium__namespace[_0x593275(_0x45a617._0x36676a)](_0x40f903[_0x593275(_0x45a617._0x36eb8b)])||!Cesium__namespace['defined'](_0x40f903['pitch'])||!Cesium__namespace['defined'](_0x40f903['roll']))&&(_0x31693b['orientation']=new Cesium__namespace['CallbackProperty'](_0x2bb44f=>{return this['_getCustomQuaternion'](this['position'],this['options']['orientation']);},![]));}this[_0x593275(_0x45a617._0x313e5f)]=this['_createEntity'](_0x31693b);}[_0x3d5d32(0x4b9)](_0x4545ba,_0x4b82a8){const _0x26fe57={_0x42ac3c:0x1d1,_0xb150cf:0x5cf,_0xbd8f7e:0xe39,_0x2578bf:0x952,_0x2cdade:0x5ac},_0xa9051d=_0x3d5d32;var _0x323602,_0x969a5b;if(_0x4545ba['getValue']){var _0x5465a0,_0x1f8eb3;_0x4545ba=_0x4545ba['getValue']((_0x5465a0=this['_map'])===null||_0x5465a0===void 0x0?void 0x0:(_0x1f8eb3=_0x5465a0['clock'])===null||_0x1f8eb3===void 0x0?void 0x0:_0x1f8eb3['currentTime']);}if(_0x4b82a8['getValue']){var _0x1d151a,_0x5a2362;_0x4b82a8=_0x4b82a8['getValue']((_0x1d151a=this[_0xa9051d(_0x26fe57._0x42ac3c)])===null||_0x1d151a===void 0x0?void 0x0:(_0x5a2362=_0x1d151a['clock'])===null||_0x5a2362===void 0x0?void 0x0:_0x5a2362['currentTime']);}const _0x496853=this['options']['model'];let _0x547e70=Cesium__namespace['Math']['toRadians'](_0x496853['heading']||0x0),_0x2f503b=Cesium__namespace['Math']['toRadians'](_0x496853[_0xa9051d(_0x26fe57._0xb150cf)]||0x0),_0x36de43=Cesium__namespace['Math']['toRadians'](_0x496853['roll']||0x0);if(_0x4b82a8){const _0x318105=getHeadingPitchRollByOrientation(_0x4545ba,_0x4b82a8);_0x496853['mergeOrientation']?(_0x547e70+=_0x318105[_0xa9051d(_0x26fe57._0xbd8f7e)],_0x36de43+=_0x318105['roll'],_0x2f503b+=_0x318105['pitch']):(!Cesium__namespace[_0xa9051d(0xb84)](_0x496853[_0xa9051d(0xe39)])&&(_0x547e70=_0x318105['heading']),!Cesium__namespace['defined'](_0x496853['roll'])&&(_0x36de43=_0x318105[_0xa9051d(_0x26fe57._0x2578bf)]),!Cesium__namespace['defined'](_0x496853[_0xa9051d(0x5cf)])&&(_0x2f503b=_0x318105['pitch']));}return Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x4545ba,new Cesium__namespace[(_0xa9051d(0x7ba))](_0x547e70,_0x2f503b,_0x36de43),(_0x323602=this[_0xa9051d(_0x26fe57._0x42ac3c)])===null||_0x323602===void 0x0?void 0x0:(_0x969a5b=_0x323602['scene'])===null||_0x969a5b===void 0x0?void 0x0:_0x969a5b['globe'][_0xa9051d(_0x26fe57._0x2cdade)]);}['_initSampledPositionProperty'](){const _0x411ef4={_0x5a6ad7:0xbe9,_0x2f3cec:0x433,_0x1e31dc:0xaa6,_0x5185a4:0x6fb,_0x224218:0x6f1,_0x56ffb8:0x6ed},_0x43e7f7=_0x3d5d32;if(!this['options'])return;this['_maxCacheCount']=this['options'][_0x43e7f7(0x202)]??0x32;if(!this['position']){const _0x114458=new Cesium__namespace[(_0x43e7f7(_0x411ef4._0x5a6ad7))](this[_0x43e7f7(_0x411ef4._0x2f3cec)][_0x43e7f7(0x366)]);_0x114458['forwardExtrapolationType']=this[_0x43e7f7(0x433)]['forwardExtrapolationType']??Cesium__namespace[_0x43e7f7(_0x411ef4._0x1e31dc)]['HOLD'],_0x114458['backwardExtrapolationType']=this['options']['backwardExtrapolationType']??Cesium__namespace[_0x43e7f7(0xaa6)][_0x43e7f7(0x807)];!this['options']['orientation']&&(this['options']['orientation']=new Cesium__namespace['VelocityOrientationProperty'](_0x114458),this['_entity']&&(this['_entity']['orientation']=this['getOrientation']()));if(this['_entity']&&!this['_entity']['availability']&&this['_map']){var _0x5d4e8e;const _0x1a911f=this['_map']['clock']['currentTime'];let _0x312edb=Cesium__namespace['JulianDate']['addDays'](_0x1a911f,0x1,new Cesium__namespace['JulianDate']());((_0x5d4e8e=this[_0x43e7f7(0xb69)])===null||_0x5d4e8e===void 0x0?void 0x0:_0x5d4e8e['forwardExtrapolationType'])===Cesium__namespace['ExtrapolationType']['HOLD']&&(_0x312edb=Cesium__namespace[_0x43e7f7(0x8b7)]['addDays'](_0x312edb,0x16d,new Cesium__namespace['JulianDate']())),this[_0x43e7f7(0x89b)][_0x43e7f7(_0x411ef4._0x5185a4)]=new Cesium__namespace[(_0x43e7f7(_0x411ef4._0x224218))]([new Cesium__namespace[(_0x43e7f7(_0x411ef4._0x56ffb8))]({'start':_0x1a911f,'stop':_0x312edb})]);}this['position']=_0x114458;}this['property']=this['position'];}['_updateStyleHook'](_0x20d1f0,_0x929525){const _0x4c577c=_0x3d5d32;PathStyleConver[_0x4c577c(0x83d)](_0x20d1f0,this['entityGraphic'],{},!![]);}['_style2Json'](_0x2ae2df,_0x5a5ec4){return PathStyleConver['toJSON'](_0x2ae2df,_0x5a5ec4,!![]);}['_getGeoJsonGeometry'](_0x1c1587){return{'type':'LineString','coordinates':this['getCoordinates'](_0x1c1587===null||_0x1c1587===void 0x0?void 0x0:_0x1c1587['noAlt'])};}['_getJsonPositions'](_0x554c2a){_0x554c2a['positions']=this['getCoordinates']();}['_toJSON_Ex'](_0x489ff3){const _0x239a7b={_0x3829b3:0x32a,_0x50c9ad:0x32a,_0x19ff70:0x600,_0x463f3e:0x4a5,_0x15360e:0x3db,_0x15616a:0x433},_0x186af3=_0x3d5d32;this['options'][_0x186af3(_0x239a7b._0x3829b3)]&&(_0x489ff3['label']={},LabelStyleConver['toJSON'](this['options'][_0x186af3(_0x239a7b._0x50c9ad)],_0x489ff3['label'],!![])),this['options'][_0x186af3(_0x239a7b._0x19ff70)]&&(_0x489ff3[_0x186af3(_0x239a7b._0x19ff70)]={},ModelStyleConver['toJSON'](this['options']['model'],_0x489ff3['model'],!![])),this[_0x186af3(0x433)]['billboard']&&(_0x489ff3[_0x186af3(_0x239a7b._0x463f3e)]={},BillboardStyleConver[_0x186af3(_0x239a7b._0x15360e)](this[_0x186af3(_0x239a7b._0x15616a)]['billboard'],_0x489ff3[_0x186af3(0x4a5)],!![])),this['options']['point']&&(_0x489ff3['point']={},PointStyleConver['toJSON'](this['options']['point'],_0x489ff3[_0x186af3(0xbbe)],!![])),this['options']['circle']&&(_0x489ff3['circle']={},CircleStyleConver['toJSON'](this['options']['circle'],_0x489ff3['circle'],!![]));}['_setOptionsHook'](_0x521225,_0x256067){const _0x1a23bf={_0x469592:0x83d,_0xbf1b1c:0x83d,_0x820733:0x600,_0x6d1222:0x4a5,_0x58fa47:0x89b},_0x241d2b=_0x3d5d32;_0x256067['label']&&LabelStyleConver[_0x241d2b(_0x1a23bf._0x469592)](_0x521225['label'],this['_entity']['label'],this),_0x256067['model']&&ModelStyleConver[_0x241d2b(_0x1a23bf._0xbf1b1c)](_0x521225[_0x241d2b(_0x1a23bf._0x820733)],this['_entity']['model'],!![]),_0x256067['billboard']&&BillboardStyleConver[_0x241d2b(0x83d)](_0x521225['billboard'],this[_0x241d2b(0x89b)][_0x241d2b(_0x1a23bf._0x6d1222)],!![]),_0x256067['point']&&PointStyleConver[_0x241d2b(_0x1a23bf._0x469592)](_0x521225['point'],this[_0x241d2b(_0x1a23bf._0x58fa47)]['point'],!![]),_0x256067[_0x241d2b(0x654)]&&CircleStyleConver['toCesiumVal'](_0x521225['circle'],this['_entity'][_0x241d2b(0x892)],!![]);}[_0x3d5d32(0x360)](_0x3f03bf){const _0x4df39b={_0x1d81c5:0x89b,_0x395349:0xe57},_0x45884a=_0x3d5d32;this['_entity']['model']&&(this[_0x45884a(_0x4df39b._0x1d81c5)]['model']['color']=Cesium__namespace['Color']['WHITE']['withAlpha'](_0x3f03bf));this['_entity']['billboard']&&(this[_0x45884a(_0x4df39b._0x1d81c5)]['billboard']['color']=Cesium__namespace['Color']['WHITE'][_0x45884a(_0x4df39b._0x395349)](_0x3f03bf));if(this['_entity']['point']){const _0x53abbf=this['_updateEntityOpacity'](this['_entity']['point'],_0x3f03bf);!_0x53abbf&&PointStyleConver['toCesiumVal']({...this['options']['point'],'globalAlpha':_0x3f03bf},this[_0x45884a(0x89b)]['point'],!![]);}if(this['_entity']['circle']){const _0x5a5be8=this['_updateEntityOpacity'](this['_entity']['circle'],_0x3f03bf);!_0x5a5be8&&CircleStyleConver[_0x45884a(0x83d)]({...this['options']['circle'],'globalAlpha':_0x3f03bf},this['_entity']['ellipse'],!![]);}}[_0x3d5d32(0x50f)](_0x14ef8d){const _0x298033={_0x33d556:0xb69,_0x2b9119:0xd02},_0x41d7b6=_0x3d5d32;var _0x546b29,_0x10c522,_0x57f7f4,_0x59bded;const _0x3078ca=(_0x546b29=this[_0x41d7b6(_0x298033._0x33d556)])===null||_0x546b29===void 0x0?void 0x0:(_0x10c522=_0x546b29['_property'])===null||_0x10c522===void 0x0?void 0x0:_0x10c522['_times'],_0x12f840=_0x3078ca['length'];if(_0x12f840===0x0)return 0x0;const _0x1002df=_0x14ef8d||((_0x57f7f4=this['_map'])===null||_0x57f7f4===void 0x0?void 0x0:(_0x59bded=_0x57f7f4['clock'])===null||_0x59bded===void 0x0?void 0x0:_0x59bded['currentTime'])||Cesium__namespace[_0x41d7b6(0x8b7)]['now']();let _0x198c36=Cesium__namespace[_0x41d7b6(_0x298033._0x2b9119)](_0x3078ca,_0x1002df,Cesium__namespace[_0x41d7b6(0x8b7)]['compare']);return _0x198c36<0x0&&(_0x198c36=~_0x198c36),_0x198c36<0x0&&(_0x198c36=0x0),_0x198c36>=_0x12f840&&(_0x198c36=_0x12f840-0x1),_0x198c36;}['getRectangle'](_0x314a91){const _0x4b430e={_0x3a9866:0xb69},_0x154d16=_0x3d5d32;var _0x448e81,_0x2fe754,_0x43506c,_0x347d16;const _0x5dffc5=(_0x448e81=this[_0x154d16(_0x4b430e._0x3a9866)])===null||_0x448e81===void 0x0?void 0x0:(_0x2fe754=_0x448e81['_property'])===null||_0x2fe754===void 0x0?void 0x0:_0x2fe754['_times'],_0x2c35ea=(_0x43506c=this[_0x154d16(0xb69)])===null||_0x43506c===void 0x0?void 0x0:(_0x347d16=_0x43506c['_property'])===null||_0x347d16===void 0x0?void 0x0:_0x347d16['_values'];if(!_0x5dffc5||_0x5dffc5[_0x154d16(0xc84)]===0x0)return;const _0x2c6f67=[];for(let _0x1f205f=0x0,_0x589079=_0x5dffc5['length'];_0x1f205f<_0x589079;_0x1f205f++){_0x2c6f67['push'](new Cesium__namespace['Cartesian3'](_0x2c35ea[_0x1f205f*0x3],_0x2c35ea[_0x1f205f*0x3+0x1],_0x2c35ea[_0x1f205f*0x3+0x2]));}const _0x53cfc7=getRectangle(_0x2c6f67,_0x314a91===null||_0x314a91===void 0x0?void 0x0:_0x314a91['isFormat']);return _0x53cfc7;}['getCoordinates'](_0x25342e){const _0xeef8d0={_0x3dbae7:0xc84,_0x1076c7:0xb75},_0x3bc38a=_0x3d5d32;var _0x5ec3ba,_0x3b08cc,_0x5b17bc,_0x33fcb8;const _0x13aacb=(_0x5ec3ba=this['position'])===null||_0x5ec3ba===void 0x0?void 0x0:(_0x3b08cc=_0x5ec3ba['_property'])===null||_0x3b08cc===void 0x0?void 0x0:_0x3b08cc['_times'],_0x1b4f67=(_0x5b17bc=this['position'])===null||_0x5b17bc===void 0x0?void 0x0:(_0x33fcb8=_0x5b17bc['_property'])===null||_0x33fcb8===void 0x0?void 0x0:_0x33fcb8['_values'];if(!_0x13aacb||_0x13aacb['length']===0x0)return[];const _0x3fb169=[];for(let _0xe0edc=0x0,_0x3d6b02=_0x13aacb[_0x3bc38a(_0xeef8d0._0x3dbae7)];_0xe0edc<_0x3d6b02;_0xe0edc++){const _0x119094=LngLatPoint[_0x3bc38a(0xd14)](new Cesium__namespace[(_0x3bc38a(0xe95))](_0x1b4f67[_0xe0edc*0x3],_0x1b4f67[_0xe0edc*0x3+0x1],_0x1b4f67[_0xe0edc*0x3+0x2])),_0x47a149=_0x119094['toArray'](_0x25342e);_0x47a149[_0x3bc38a(_0xeef8d0._0x1076c7)](Cesium__namespace['JulianDate']['toDate'](_0x13aacb[_0xe0edc])['getTime']()),_0x3fb169[_0x3bc38a(_0xeef8d0._0x1076c7)](_0x47a149);}return _0x3fb169;}['flyToPoint'](_0x52e3c2={}){const _0x4a3b84={_0x5a6e57:0xe39},_0x4a9dab=_0x3d5d32;if(!this[_0x4a9dab(0x1d1)])return Promise['resolve'](![]);const _0x4d8a26=this[_0x4a9dab(0x4b5)];if(!_0x4d8a26)return Promise['resolve'](![]);let _0x13c533;if(Cesium__namespace[_0x4a9dab(0xb84)](_0x52e3c2['heading'])){var _0xb23457;_0x13c533=_0x52e3c2[_0x4a9dab(_0x4a3b84._0x5a6e57)]+Cesium__namespace['Math']['toDegrees'](((_0xb23457=this['hpr'])===null||_0xb23457===void 0x0?void 0x0:_0xb23457['heading'])||0x0);}return this['_map']['flyToPoint'](_0x4d8a26,{..._0x52e3c2,'heading':_0x13c533});}}register$4('path',PathEntity,!![]);class EditCorridor extends EditPoly{['updatePositionsHeightByAttr'](_0x5c5ac7){const _0xada88e={_0x364b49:0x83e},_0x285cc7=_0x3d5d32;if(this['entityGraphic']['height']!==undefined){const _0x58054f=getCesiumValue(this['entityGraphic'][_0x285cc7(_0xada88e._0x364b49)],Number,this['_map']['clock'][_0x285cc7(0x4f8)]);_0x5c5ac7=setPositionsHeight(_0x5c5ac7,_0x58054f);}return _0x5c5ac7;}[_0x3d5d32(0xf10)](_0xa2f294){const _0x36d8f8=_0x3d5d32;return this['clampToGround']&&(_0xa2f294[_0x36d8f8(0xb69)]=getSurfacePosition(this['_map']['scene'],_0xa2f294['position'])),super['createDragger'](_0xa2f294);}['_updateMoveAllHook'](_0x3e7f8d){const _0x42fd2c=_0x3d5d32;if(this['clampToGround'])return;const _0x5b6504=Cesium__namespace['Cartographic']['fromCartesian'](_0x3e7f8d)['height'];this['entityGraphic'][_0x42fd2c(0x83e)]=_0x5b6504,this['style'][_0x42fd2c(0x83e)]=this['formatNum'](_0x5b6504,0x2);}[_0x3d5d32(0x83c)](_0x20e68d){const _0x4c129f={_0x3f83b6:0xefc},_0x5ab63d=_0x3d5d32;this['entityGraphic']['height']=_0x20e68d,this['style'][_0x5ab63d(0x83e)]=this['formatNum'](_0x20e68d,0x2);const _0x275ff7=this[_0x5ab63d(0xbb8)];for(let _0x42f6ac=0x0,_0x234118=_0x275ff7['length'];_0x42f6ac<_0x234118;_0x42f6ac++){_0x275ff7[_0x42f6ac]=setPositionsHeight(_0x275ff7[_0x42f6ac],_0x20e68d);}for(let _0x12713d=0x0,_0x178f09=this['draggers']['length'];_0x12713d<_0x178f09;_0x12713d++){const _0x162304=this['draggers'][_0x12713d];_0x162304['position']=setPositionsHeight(_0x162304['position'],_0x20e68d);}this[_0x5ab63d(_0x4c129f._0x3f83b6)](EventType['editStyle']);}}class CorridorEntity extends BasePolyEntity{get['entityGraphic'](){const _0x246b1c=_0x3d5d32;var _0x747726;return(_0x747726=this[_0x246b1c(0x89b)])===null||_0x747726===void 0x0?void 0x0:_0x747726['corridor'];}get['EditClass'](){return EditCorridor;}['_mountedHook'](){const _0x42ddea={_0x1b6214:0xbb8,_0xddb03:0x32a},_0x354535=_0x3d5d32,_0x3462da={'corridor':CorridorStyleConver['toCesiumVal'](this['style'],{},!![])};_0x3462da['corridor'][_0x354535(_0x42ddea._0x1b6214)]=this['positions'],this[_0x354535(0x89b)]=this[_0x354535(0x45f)](_0x3462da),this['style'][_0x354535(_0x42ddea._0xddb03)]&&this['_addLabel']();}[_0x3d5d32(0x53e)](_0x230451,_0x5d2b56){return CorridorStyleConver['toJSON'](_0x230451,_0x5d2b56,!![]);}['_updateStyleHook'](_0x4e00b2,_0x39b6b0){const _0x2e086e={_0x4d645c:0xa09,_0xdbdf55:0x9e2,_0x2f6873:0xb84},_0x514129=_0x3d5d32;CorridorStyleConver['toCesiumVal'](_0x4e00b2,this[_0x514129(_0x2e086e._0x4d645c)],!![]),_0x39b6b0&&(Cesium__namespace['defined'](_0x39b6b0[_0x514129(_0x2e086e._0xdbdf55)])||Cesium__namespace[_0x514129(_0x2e086e._0x2f6873)](_0x39b6b0['height']))&&this['_updateHeight']();}['_updatePositionsHook'](){this['entityGraphic']['positions']=this['positions'],this['_updateLabelPosition'](),this['_updateEditDraggers']();}['_updateHeight'](_0x1a4eed=!![]){const _0x3da0fe={_0x1f8860:0x7c0,_0x49d184:0xb84,_0x53ecad:0xa09,_0x3a410e:0x9e2},_0x5b628c=_0x3d5d32;if(this['style'][_0x5b628c(_0x3da0fe._0x1f8860)])return;let _0x313a62=0x0;_0x1a4eed&&Cesium__namespace['defined'](this[_0x5b628c(0xdde)]['height'])?_0x313a62=this['style']['height']:_0x313a62=getMaxHeight(this['_positions_draw']||this['_positions']),this[_0x5b628c(0xa09)][_0x5b628c(0x83e)]=_0x313a62,this['style']['height']=_0x313a62,Cesium__namespace['defined'](this['style']['diffHeight'])&&(Cesium__namespace[_0x5b628c(_0x3da0fe._0x49d184)](this[_0x5b628c(0xdde)]['diffHeight'])&&this['style']['diffHeight']!==0x0?this[_0x5b628c(_0x3da0fe._0x53ecad)]['extrudedHeight']=_0x313a62+this['style'][_0x5b628c(_0x3da0fe._0x3a410e)]:this['entityGraphic']['extrudedHeight']=undefined);}[_0x3d5d32(0xf22)](_0x430d19){const _0x46bab1={_0x3716ec:0x7c0,_0x5a0ce3:0x9e2,_0x1f331e:0xa09},_0x502cfa=_0x3d5d32;if(!_0x430d19){if(!this['style'][_0x502cfa(_0x46bab1._0x3716ec)]){const _0x417f41=getMaxHeight(this['_positions_draw']);_0x417f41!==0x0&&(this[_0x502cfa(0xa09)]['height']=_0x417f41,this['style']['height']=_0x417f41,Cesium__namespace[_0x502cfa(0xb84)](this[_0x502cfa(0xdde)]['diffHeight'])&&(Cesium__namespace['defined'](this['style'][_0x502cfa(_0x46bab1._0x5a0ce3)])&&this['style'][_0x502cfa(0x9e2)]!==0x0?this['entityGraphic']['extrudedHeight']=_0x417f41+Number(this['style'][_0x502cfa(0x9e2)]):this[_0x502cfa(_0x46bab1._0x1f331e)]['extrudedHeight']=undefined));}}else this['_updateHeight']();}}register$4('corridor',CorridorEntity);class EditWall extends EditPoly{['bindDraggers'](){const _0x385c6c={_0x1ad3e9:0xd1b,_0x487b06:0x98f,_0x10fad2:0xb75},_0x14a29c={_0x123465:0xf5a,_0x5cc9a6:0x5f9,_0x359e1e:0x5f9,_0x49b605:0x93f,_0x557846:0xb69},_0x2ab06a=_0x3d5d32,_0x42a996=this['positions'],_0x180c19=this[_0x2ab06a(0xdde)],_0x220077=this['hasMidPoint'];for(let _0x2b7243=0x0,_0x346cc2=_0x42a996['length'];_0x2b7243<_0x346cc2;_0x2b7243++){const _0x439b4a=_0x42a996[_0x2b7243],_0x497bae=this['createDragger']({'position':_0x439b4a,'onDrag':(_0x5bc06e,_0x57f900)=>{const _0x34e30e=_0x2ab06a;_0x42a996[_0x5bc06e['index']]=_0x57f900;this[_0x34e30e(0xf5a)]&&this['_heightDraggers']['length']>0x0&&(this[_0x34e30e(_0x14a29c._0x123465)][_0x5bc06e['index']]['position']=addPositionsHeight(_0x57f900,_0x180c19['diffHeight']));_0x220077&&(_0x5bc06e[_0x34e30e(_0x14a29c._0x5cc9a6)]>0x0&&(this['draggers'][_0x5bc06e['index']*0x2-0x1]['position']=getMidpoint(_0x57f900,_0x42a996[_0x5bc06e['index']-0x1],new Cesium__namespace['Cartesian3']())),_0x5bc06e[_0x34e30e(_0x14a29c._0x359e1e)]<_0x42a996[_0x34e30e(0xc84)]-0x1&&(this[_0x34e30e(_0x14a29c._0x49b605)][_0x5bc06e[_0x34e30e(0x5f9)]*0x2+0x1]['position']=getMidpoint(_0x57f900,_0x42a996[_0x5bc06e['index']+0x1])));const _0x14fde7=centerOfMass(_0x42a996);this['_draggerMove'][_0x34e30e(_0x14a29c._0x557846)]=_0x14fde7;}});_0x497bae['index']=_0x2b7243,this['draggers']['push'](_0x497bae);if(this['hasMidPoint']&&(this['hasClosure']||!this['hasClosure']&&_0x2b7243<_0x346cc2-0x1)){const _0x3d7ea2=(_0x2b7243+0x1)%_0x346cc2,_0x7e685a=getMidpoint(_0x439b4a,_0x42a996[_0x3d7ea2]),_0x32fc6b=this['createDragger']({'position':_0x7e685a,'type':PointType['AddMidPoint'],'tooltip':this['_map'][_0x2ab06a(_0x385c6c._0x1ad3e9)](_0x2ab06a(_0x385c6c._0x487b06)),'onDragStart':(_0x20e093,_0x276624)=>{this['positions']['splice'](_0x20e093['index'],0x0,_0x276624),this['updateAttrForEditing']();},'onDrag':(_0x403251,_0x51d747)=>{const _0x44c030=_0x2ab06a;this['positions'][_0x403251[_0x44c030(0x5f9)]]=_0x51d747;},'onDragEnd':(_0x2dd3c1,_0x5718c8)=>{this['_fireAddPoint'](_0x2dd3c1,_0x5718c8),this['updateDraggers']();}});_0x32fc6b['index']=_0x3d7ea2,this['draggers'][_0x2ab06a(_0x385c6c._0x10fad2)](_0x32fc6b);}}this['_bindMoveAllDragger'](),this['_bindHeightDraggers']();}['_bindHeightDraggers'](){const _0x52db04={_0x39238c:0xf5a,_0x32acb0:0xdde,_0x5f3ec7:0x1d1,_0x493ee3:0xd1b,_0x32e28c:0x5f9,_0x37edca:0xb75},_0x40440c=_0x3d5d32;if(!this['_graphic'][_0x40440c(0x107d)])return;this[_0x40440c(_0x52db04._0x39238c)]=[];const _0x37ce10=this['positions'],_0x5d9684=Number(this[_0x40440c(_0x52db04._0x32acb0)]['diffHeight']);for(let _0x10d79e=0x0,_0x37f1f6=_0x37ce10['length'];_0x10d79e<_0x37f1f6;_0x10d79e++){const _0x4db600=addPositionsHeight(_0x37ce10[_0x10d79e],_0x5d9684),_0x19a53a=this['createDragger']({'position':_0x4db600,'type':PointType['MoveHeight'],'tooltip':this[_0x40440c(_0x52db04._0x5f3ec7)][_0x40440c(_0x52db04._0x493ee3)]('_修改高度'),'onDrag':(_0x320c70,_0x2fa53a)=>{const _0x5c01af=_0x40440c,_0x9f4d9=Cesium__namespace['Cartographic']['fromCartesian'](_0x2fa53a)[_0x5c01af(0x83e)];this['style']['diffHeight']=formatNum$1(_0x9f4d9-this['_graphic']['_minimumHeights'][_0x320c70['index']],0x2);for(let _0x441365=0x0;_0x441365<_0x37ce10['length'];_0x441365++){if(_0x441365===_0x320c70['index'])continue;this['_heightDraggers'][_0x441365]['position']=addPositionsHeight(_0x37ce10[_0x441365],this['style']['diffHeight']);}this['updateAttrForEditing'](),this[_0x5c01af(0xefc)](EventType['editStyle']);}});_0x19a53a[_0x40440c(_0x52db04._0x32e28c)]=_0x10d79e,this['draggers'][_0x40440c(_0x52db04._0x37edca)](_0x19a53a),this['_heightDraggers']['push'](_0x19a53a);}}}class WallEntity extends BasePolyEntity{get['entityGraphic'](){var _0xa701dc;return(_0xa701dc=this['_entity'])===null||_0xa701dc===void 0x0?void 0x0:_0xa701dc['wall'];}get['EditClass'](){return EditWall;}['_mountedHook'](){const _0xa145dd={_0x3b9b3b:0xc97,_0x4378af:0x65f,_0x48acf6:0x3d2},_0x5cae1e=_0x3d5d32;var _0xd429a1;this['style']['diffHeight']=this['style']['diffHeight']||0x64;const _0x229457={'wall':WallStyleConver[_0x5cae1e(0x83d)](this['style'],{},!![])};this['style']['closure']&&((_0xd429a1=this['positions'])===null||_0xd429a1===void 0x0?void 0x0:_0xd429a1['length'])>0x0?_0x229457[_0x5cae1e(0x65f)][_0x5cae1e(0xbb8)]=this['positions'][_0x5cae1e(_0xa145dd._0x3b9b3b)](this['positions'][0x0]):_0x229457[_0x5cae1e(_0xa145dd._0x4378af)][_0x5cae1e(0xbb8)]=this['positions'],(!this['style']['maximumHeights']||!this['style']['minimumHeights'])&&this['_updateMaxMinHeights'](_0x229457),this[_0x5cae1e(0x89b)]=this['_createEntity'](_0x229457),this['style']['label']&&this[_0x5cae1e(_0xa145dd._0x48acf6)]();}['_style2Json'](_0x58f733,_0x234dc5){const _0x7bba6f=_0x3d5d32;return WallStyleConver[_0x7bba6f(0x3db)](_0x58f733,_0x234dc5,!![]);}['_updateStyleHook'](_0x33dcab,_0x47a6f4){const _0x4a0417={_0x17e077:0xa09,_0x4a5830:0x367},_0x5a7032=_0x3d5d32;WallStyleConver['toCesiumVal'](_0x33dcab,this[_0x5a7032(_0x4a0417._0x17e077)],!![]),Cesium__namespace[_0x5a7032(0xb84)](_0x47a6f4['closure'])&&this[_0x5a7032(_0x4a0417._0x4a5830)](),Cesium__namespace['defined'](_0x47a6f4===null||_0x47a6f4===void 0x0?void 0x0:_0x47a6f4['diffHeight'])&&this['_updateMaxMinHeights'](this[_0x5a7032(0x89b)]);}['_updatePositionsHook'](){const _0xea1912={_0x148393:0xdde,_0x2be855:0xbb8},_0x28b9f0=_0x3d5d32;var _0x524594;this[_0x28b9f0(_0xea1912._0x148393)]['closure']&&((_0x524594=this['positions'])===null||_0x524594===void 0x0?void 0x0:_0x524594['length'])>0x0?this['entityGraphic']['positions']=this['positions']['concat'](this['positions'][0x0]):this['entityGraphic'][_0x28b9f0(_0xea1912._0x2be855)]=this['positions'],(!this[_0x28b9f0(_0xea1912._0x148393)]['maximumHeights']||!this[_0x28b9f0(_0xea1912._0x148393)]['minimumHeights'])&&this[_0x28b9f0(0x662)](this['_entity']),this[_0x28b9f0(0x429)](),this[_0x28b9f0(0x7b9)]();}['_updateMaxMinHeights'](_0x3ba7ea){const _0x42848a={_0x244691:0xc84,_0x5d5362:0xd29,_0x4c7501:0x8cf,_0x3c3626:0xc6d,_0x2a9f27:0x51e},_0x557f0d=_0x3d5d32,_0x17b873=this['points'];if(!_0x17b873||_0x17b873['length']===0x0)return;const _0xc72a1d=_0x17b873[_0x557f0d(_0x42848a._0x244691)],_0x5000f8=new Array(_0xc72a1d),_0x91ed25=new Array(_0xc72a1d);for(let _0x132d9e=0x0;_0x132d9e<_0xc72a1d;_0x132d9e++){const _0x19d044=_0x17b873[_0x132d9e][_0x557f0d(0xd29)];_0x5000f8[_0x132d9e]=_0x19d044,this['style']['fixedTop']?_0x91ed25[_0x132d9e]=_0x17b873[0x0][_0x557f0d(_0x42848a._0x5d5362)]+this['style'][_0x557f0d(0x9e2)]:_0x91ed25[_0x132d9e]=_0x19d044+this['style']['diffHeight'];}this['style']['closure']&&_0xc72a1d>0x0&&(_0x5000f8[_0x557f0d(0xb75)](_0x5000f8[0x0]),_0x91ed25['push'](_0x91ed25[0x0])),this[_0x557f0d(_0x42848a._0x4c7501)]=_0x5000f8,this[_0x557f0d(0x415)]=_0x91ed25,_0x3ba7ea&&(!(_0x3ba7ea[_0x557f0d(0x65f)]['minimumHeights']instanceof Cesium__namespace['CallbackProperty'])&&(_0x3ba7ea['wall'][_0x557f0d(0x53c)]=_0x5000f8),!(_0x3ba7ea['wall']['maximumHeights']instanceof Cesium__namespace[_0x557f0d(_0x42848a._0x3c3626)])&&(_0x3ba7ea['wall'][_0x557f0d(_0x42848a._0x2a9f27)]=_0x91ed25));}[_0x3d5d32(0xd56)](){const _0x60f5f9={_0x506992:0xc6d},_0x3d4d84=_0x3d5d32;if(this['_isCallbackPositions'])return;super[_0x3d4d84(0xd56)](),this[_0x3d4d84(0xa09)]['minimumHeights']=new Cesium__namespace['CallbackProperty'](_0x5345a1=>{return this['_minimumHeights'];},![]),this['entityGraphic']['maximumHeights']=new Cesium__namespace[(_0x3d4d84(_0x60f5f9._0x506992))](_0x5041e3=>{const _0x2179ec=_0x3d4d84;return this[_0x2179ec(0x415)];},![]);}['_positions_CallbackProperty'](){const _0xdbc211={_0xcadd48:0x1f2,_0x1aecb8:0xd76},_0x36cfd9=_0x3d5d32;var _0x1e6508;return this['style'][_0x36cfd9(_0xdbc211._0xcadd48)]&&((_0x1e6508=this['_positions_draw'])===null||_0x1e6508===void 0x0?void 0x0:_0x1e6508['length'])>0x0?this[_0x36cfd9(_0xdbc211._0x1aecb8)]['concat'](this[_0x36cfd9(0xd76)][0x0]):this['_positions_draw'];}[_0x3d5d32(0xa84)](){const _0x4b5fea={_0x1614d4:0x8cf},_0x12284a=_0x3d5d32;if(!this['_isCallbackPositions'])return;super['_cancelPositionsCallback'](),this['entityGraphic']['minimumHeights']=this[_0x12284a(_0x4b5fea._0x1614d4)],this['entityGraphic']['maximumHeights']=this['_maximumHeights'];}['updateAttrForDrawing'](_0x44b210){const _0x4d6acb={_0x18e769:0x662},_0x36e43c=_0x3d5d32;this[_0x36e43c(_0x4d6acb._0x18e769)](this[_0x36e43c(0x89b)]);}}register$4('wall',WallEntity);class EditRectangle extends EditPoly{['bindDraggers'](){const _0x4e87b9={_0x318dc4:0x5f9,_0x14806e:0xb75},_0x4a699d={_0x737205:0x9f4,_0x26d065:0x4f8,_0x464491:0xbb8,_0x4d5f07:0xb69},_0x1c4db8=_0x3d5d32,_0x326736=this[_0x1c4db8(0xbb8)];for(let _0x1a2b18=0x0,_0xc2bd0d=_0x326736[_0x1c4db8(0xc84)];_0x1a2b18<_0xc2bd0d;_0x1a2b18++){const _0x596456=this['updatePositionsHeightByAttr'](_0x326736[_0x1a2b18]),_0x154bcb=this['createDragger']({'position':_0x596456,'onDrag':(_0x4d0ab5,_0x48479d)=>{const _0x559b65=_0x1c4db8,_0x5872a6=this['_map'][_0x559b65(_0x4a699d._0x737205)][_0x559b65(_0x4a699d._0x26d065)],_0x402bd1=getCesiumValue(this['entityGraphic']['height'],Number,_0x5872a6);this['positions'][_0x4d0ab5['index']]=_0x48479d;if(this['entityGraphic']['height']!==undefined)for(let _0x12104c=0x0,_0x295a3d=this['draggers']['length'];_0x12104c<_0x295a3d;_0x12104c++){const _0xdc9cbf=this['draggers'][_0x12104c],_0x3169c7=setPositionsHeight(this[_0x559b65(_0x4a699d._0x464491)][_0xdc9cbf['index']],_0x402bd1);_0xdc9cbf[_0x559b65(0xb69)]=_0x3169c7,this['positions'][_0xdc9cbf['index']]=_0x3169c7;}if(this[_0x559b65(0xf5a)]&&this['_heightDraggers']['length']>0x0){const _0x2aec56=getCesiumValue(this['entityGraphic']['extrudedHeight'],Number,_0x5872a6);this['_heightDraggers'][_0x4d0ab5[_0x559b65(0x5f9)]][_0x559b65(_0x4a699d._0x4d5f07)]=setPositionsHeight(_0x48479d,_0x2aec56);}let _0x1cbdfc=centerOfMass(this['positions']);_0x1cbdfc=this['updatePositionsHeightByAttr'](_0x1cbdfc),this['_draggerMove']['position']=_0x1cbdfc;}});_0x154bcb[_0x1c4db8(_0x4e87b9._0x318dc4)]=_0x1a2b18,this['draggers'][_0x1c4db8(_0x4e87b9._0x14806e)](_0x154bcb);}this['_bindMoveAllDragger'](),this['entityGraphic']['extrudedHeight']&&this['_bindHeightDraggers']();}['updatePositionsHeightByAttr'](_0x17b7b7){this['clampToGround']&&(_0x17b7b7=getSurfacePosition(this['_map']['scene'],_0x17b7b7));if(this['entityGraphic']['height']!==undefined){const _0x13db42=getCesiumValue(this['entityGraphic']['height'],Number,this['_map']['clock']['currentTime']);_0x17b7b7=setPositionsHeight(_0x17b7b7,_0x13db42);}return _0x17b7b7;}['_updateHeight'](_0x257c98){const _0x5dfed5={_0x2b00e8:0xdde,_0x5a0e36:0x93f,_0xa8afe0:0xefc},_0x483a13=_0x3d5d32;this['entityGraphic']['height']=_0x257c98,this[_0x483a13(_0x5dfed5._0x2b00e8)]['height']=this['formatNum'](_0x257c98,0x2);const _0x12105f=this['positions'];for(let _0x18ade5=0x0,_0x2024fe=_0x12105f['length'];_0x18ade5<_0x2024fe;_0x18ade5++){_0x12105f[_0x18ade5]=setPositionsHeight(_0x12105f[_0x18ade5],_0x257c98);}for(let _0x2c43d5=0x0,_0x5b2b5c=this['draggers']['length'];_0x2c43d5<_0x5b2b5c;_0x2c43d5++){const _0x2d2557=this[_0x483a13(_0x5dfed5._0x5a0e36)][_0x2c43d5];_0x2d2557['position']=setPositionsHeight(_0x2d2557[_0x483a13(0xb69)],_0x257c98);}this[_0x483a13(_0x5dfed5._0xa8afe0)](EventType['editStyle']);}}class RectangleEntity extends BasePolyEntity{constructor(_0x5df981={}){const _0x63ec39={_0x183a5c:0x46e,_0x4331ea:0x433},_0x300b80=_0x3d5d32;super(_0x5df981),this['_minPointNum']=0x2,this[_0x300b80(_0x63ec39._0x183a5c)]=0x2,this['_clampToGround_reload']=!![];if(this['options']['rectangle'])this['_rectangle']=this['options']['rectangle'];else this['options']['coordinates']&&(this[_0x300b80(0x570)]=this[_0x300b80(_0x63ec39._0x4331ea)]['coordinates']);}get['entityGraphic'](){var _0x1eafdd;return(_0x1eafdd=this['_entity'])===null||_0x1eafdd===void 0x0?void 0x0:_0x1eafdd['rectangle'];}get['EditClass'](){return EditRectangle;}get['center'](){const _0x2c5c53=_0x3d5d32,_0x52e2ae=getCesiumValue(this['rectangle']);if(!_0x52e2ae)return null;const _0xb9478d=Cesium__namespace['Cartographic']['toCartesian'](Cesium__namespace[_0x2c5c53(0x756)][_0x2c5c53(0xe72)](_0x52e2ae));return _0xb9478d;}get[_0x3d5d32(0x4ef)](){const _0x27ce54={_0x2dd078:0x89b},_0x595040=_0x3d5d32;return this[_0x595040(_0x27ce54._0x2dd078)]&&(this['_outlinePositions']=getOutlinePositions(this['_entity'])),this['_outlinePositions'];}set['outlinePositions'](_0x39e517){const _0x14931a={_0x1b111c:0x3e5},_0x4dde59=_0x3d5d32;this[_0x4dde59(_0x14931a._0x1b111c)]=_0x39e517;}get[_0x3d5d32(0x649)](){const _0xde7436={_0x13a65d:0x4ef},_0x5a2e25=_0x3d5d32;return cartesians2lonlats(this[_0x5a2e25(_0xde7436._0x13a65d)]);}get[_0x3d5d32(0x5a3)](){const _0x421779={_0x590195:0xbb8},_0x377a25=_0x3d5d32;return!this[_0x377a25(0x570)]&&this['positions']&&(this['_rectangle']=Cesium__namespace['Rectangle']['fromCartesianArray'](this[_0x377a25(_0x421779._0x590195)])),this['_rectangle'];}set['rectangle'](_0x33cae3){const _0x59c0b5={_0x3a5896:0xa63,_0x1a3e78:0xc6d},_0x4b1408=_0x3d5d32;var _0x307fc1;(_0x307fc1=this['editing'])!==null&&_0x307fc1!==void 0x0&&_0x307fc1[_0x4b1408(_0x59c0b5._0x3a5896)]&&!(_0x33cae3 instanceof Cesium__namespace[_0x4b1408(_0x59c0b5._0x1a3e78)])?this[_0x4b1408(0x753)]=_0x33cae3:(this['_rectangle']=_0x33cae3,this['_entity']&&(this['entityGraphic']['coordinates']=_0x33cae3));}get[_0x3d5d32(0xbf8)](){const _0x2a0858={_0x57042a:0x1061},_0x2300e7={_0x96d250:0xb75},_0x23d13b=_0x3d5d32,_0x488852=[];let _0x2dd8ae;return this['_positions_draw']?_0x2dd8ae=this['_positions_draw']:_0x2dd8ae=this['_positions'],!_0x2dd8ae&&(_0x2dd8ae=getOutlinePositions(this['_entity'],![])),_0x2dd8ae[_0x23d13b(_0x2a0858._0x57042a)](function(_0xae9250){const _0x2671a3=_0x23d13b,_0x567a36=LngLatPoint[_0x2671a3(0xce3)](_0xae9250);if(!_0x567a36||!_0x567a36['valid']())return;_0x488852[_0x2671a3(_0x2300e7._0x96d250)](_0x567a36);}),this['_points']=_0x488852,this['_points'];}get['distance'](){const _0x2d52a6=_0x3d5d32;return getDistance(this[_0x2d52a6(0x4ef)],!![]);}get[_0x3d5d32(0x772)](){const _0xc2c4a6={_0x2423d4:0x4ef},_0x4cfffd=_0x3d5d32;return getSurfaceArea(this[_0x4cfffd(_0xc2c4a6._0x2423d4)]);}['getEntityPositions'](){const _0x5da979={_0x2a28db:0x7d1},_0x4858fc=_0x3d5d32;if(!this['_entity'][_0x4858fc(0x5a3)])return null;const _0xe0371d=getCesiumValue(this['_entity']['rectangle']['coordinates'],Cesium__namespace['Rectangle']),_0x53cd15=getCesiumValue(this['_entity'][_0x4858fc(0x5a3)]['height'],Number)||0x0,_0x1ea030=Cesium__namespace['Cartesian3'][_0x4858fc(_0x5da979._0x2a28db)](_0xe0371d['west'],_0xe0371d['south'],_0x53cd15),_0x36c2c4=Cesium__namespace['Cartesian3']['fromRadians'](_0xe0371d['east'],_0xe0371d['north'],_0x53cd15);return[_0x1ea030,_0x36c2c4];}[_0x3d5d32(0xe4c)](){const _0x1f644a={_0x40b6a7:0x2ae,_0x1a6b16:0x5a3,_0x4e4af3:0xc6d,_0x16df61:0xf37,_0x50787d:0x3d2},_0x526e6d=_0x3d5d32,_0x8fe7d9={'rectangle':RectangleStyleConver[_0x526e6d(0x83d)](this['style'],{},!![])};_0x8fe7d9['rectangle'][_0x526e6d(_0x1f644a._0x40b6a7)]=this[_0x526e6d(_0x1f644a._0x1a6b16)],this['_positions']instanceof Cesium__namespace[_0x526e6d(_0x1f644a._0x4e4af3)]&&(_0x8fe7d9['rectangle']['coordinates']=new Cesium__namespace[(_0x526e6d(0xc6d))](_0x212d14=>{const _0x3b7c25=_0x526e6d,_0x1c37d8=this['_positions']['getValue'](_0x212d14);return _0x1c37d8&&_0x1c37d8['length']>0x0?(this['_rectangle']=Cesium__namespace[_0x3b7c25(0x756)]['fromCartesianArray'](_0x1c37d8),this[_0x3b7c25(0x570)]):undefined;},![])),this['_entity']=this['_createEntity'](_0x8fe7d9),this['_updateHeight'](),this[_0x526e6d(0x212)](this['_getOutlinePositions'](),this['style']),this[_0x526e6d(_0x1f644a._0x16df61)]&&this['entityGraphic']['coordinates']instanceof Cesium__namespace['CallbackProperty']&&this['_updateOutlineToCallback'](),this['style']['label']&&this[_0x526e6d(_0x1f644a._0x50787d)]();}[_0x3d5d32(0x53e)](_0x425ce1,_0x503f74){const _0x5a99a1={_0x541eb7:0x3db},_0x2e3e79=_0x3d5d32;return RectangleStyleConver[_0x2e3e79(_0x5a99a1._0x541eb7)](_0x425ce1,_0x503f74,!![]);}['_updateStyleHook'](_0x121785,_0x57ea49){const _0x4e0859={_0x58df25:0xa09},_0x1c6e2f=_0x3d5d32;RectangleStyleConver['toCesiumVal'](_0x121785,this[_0x1c6e2f(_0x4e0859._0x58df25)],!![]),(Cesium__namespace['defined'](_0x57ea49['diffHeight'])||Cesium__namespace['defined'](_0x57ea49['height']))&&this['_updateHeight']();}['_updatePositionsHook'](){const _0x5499cf={_0x212afd:0xdde},_0xb6aae7=_0x3d5d32;this['positions']?this[_0xb6aae7(0x5a3)]=Cesium__namespace['Rectangle'][_0xb6aae7(0xeb1)](this[_0xb6aae7(0xbb8)]):this['_rectangle_draw']=Cesium__namespace['Rectangle'][_0xb6aae7(0xeb1)](this['_positions_draw']),this['outlinePositions']=getOutlinePositions(this['_entity']),this['_updateOutlineStyle'](this['_getOutlinePositions'](),this[_0xb6aae7(_0x5499cf._0x212afd)]),this['_updateLabelPosition'](),this['_updateHeight'](),this['_updateEditDraggers']();}['_getOutlineStyle'](_0x558cfe,_0x584d60){const _0x39d363={_0x57d2cc:0x1029},_0x28d165=_0x3d5d32,_0x5401df=super['_getOutlineStyle'](_0x558cfe,_0x584d60);return _0x5401df[_0x28d165(0x44e)]=Cesium__namespace[_0x28d165(_0x39d363._0x57d2cc)][_0x28d165(0x988)],_0x5401df;}['_getOutlinePositions'](){return[this['outlinePositions']];}['toGeoJSON'](_0x5c53bc){return super['toGeoJSON'](_0x5c53bc);}['_getGeoJsonGeometry'](_0x5471bb){const _0x2a8b44={_0x23be3e:0x96f},_0x147953=_0x3d5d32;return _0x5471bb!==null&&_0x5471bb!==void 0x0&&_0x5471bb['outline']?{'type':'Polygon','coordinates':[this['getOutlineCoordinates'](_0x5471bb===null||_0x5471bb===void 0x0?void 0x0:_0x5471bb['closure'],_0x5471bb===null||_0x5471bb===void 0x0?void 0x0:_0x5471bb['noAlt'])]}:{'type':_0x147953(_0x2a8b44._0x23be3e),'coordinates':this['getCoordinates'](_0x5471bb===null||_0x5471bb===void 0x0?void 0x0:_0x5471bb[_0x147953(0xbcb)])};}[_0x3d5d32(0xd56)](){const _0x25d338={_0x2d45c5:0xd76,_0x5a7837:0x753,_0xad0cc5:0x5a3,_0x34be6b:0xc6d},_0x1ab94a=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_isCallbackPositions']=!![];const _0x2a3652=this['positions'];_0x2a3652?(_0x2a3652 instanceof Cesium__namespace['CallbackProperty']?this['_positions_draw']=this['getEntityPositions']():this[_0x1ab94a(_0x25d338._0x2d45c5)]=this['positions'],this['_rectangle_draw']=Cesium__namespace['Rectangle']['fromCartesianArray'](this['_positions_draw'])):(this['_positions_draw']=[],this[_0x1ab94a(_0x25d338._0x5a7837)]=null),this[_0x1ab94a(_0x25d338._0xad0cc5)]=new Cesium__namespace[(_0x1ab94a(_0x25d338._0x34be6b))](_0x2f2562=>{return this['_rectangle_draw'];},![]),this['_updateOutlineToCallback']();}[_0x3d5d32(0xa84)](){const _0x209a9a={_0x5c948e:0x753,_0x359acf:0x753,_0x4355d7:0x1065},_0x14e0bd=_0x3d5d32;if(!this[_0x14e0bd(0x3a0)])return;this['_isCallbackPositions']=![],this['_positions']=this[_0x14e0bd(0xd76)],this[_0x14e0bd(0x570)]=this[_0x14e0bd(_0x209a9a._0x5c948e)],this[_0x14e0bd(0x89b)]&&(this['entityGraphic']['coordinates']=this[_0x14e0bd(0x753)]),delete this[_0x14e0bd(0xd76)],delete this[_0x14e0bd(_0x209a9a._0x359acf)],this[_0x14e0bd(_0x209a9a._0x4355d7)]();}['updateAttrForDrawing'](_0x2c23fd){const _0x5a5b44={_0xfa1504:0xf37},_0x3dd564=_0x3d5d32;this['_rectangle_draw']=Cesium__namespace['Rectangle'][_0x3dd564(0xeb1)](this['_positions_draw']),this[_0x3dd564(_0x5a5b44._0xfa1504)]&&(this['_updateOutlineToCallback'](),this['_outlinePositions']=getOutlinePositions(this['_entity'])),this['_updateHeight'](![]);}[_0x3d5d32(0x83c)](_0x4264d7=!![]){const _0xb1f1f={_0x2d63ae:0x7c0,_0x36893d:0xdde,_0x2e6488:0x83e,_0x5d75ee:0xb84},_0x57360b=_0x3d5d32;if(this['style'][_0x57360b(_0xb1f1f._0x2d63ae)])return;let _0x1ca709=0x0;_0x4264d7&&Cesium__namespace[_0x57360b(0xb84)](this['style']['height'])?_0x1ca709=this[_0x57360b(_0xb1f1f._0x36893d)][_0x57360b(_0xb1f1f._0x2e6488)]:_0x1ca709=getMaxHeight(this['_positions_draw']||this['_positions']),this['entityGraphic'][_0x57360b(_0xb1f1f._0x2e6488)]=_0x1ca709,this['style']['height']=_0x1ca709,Cesium__namespace[_0x57360b(_0xb1f1f._0x5d75ee)](this['style']['diffHeight'])&&(Cesium__namespace['defined'](this['style']['diffHeight'])&&this['style']['diffHeight']!==0x0?this['entityGraphic']['extrudedHeight']=_0x1ca709+this['style'][_0x57360b(0x9e2)]:this[_0x57360b(0xa09)]['extrudedHeight']=undefined),this['fire'](EventType['editStyle']);}['getOutlinePositions'](_0x439fae){const _0x444595={_0x2803be:0x89b},_0xbda641=_0x3d5d32;return getOutlinePositions(this[_0xbda641(_0x444595._0x2803be)],_0x439fae);}[_0x3d5d32(0x459)](_0x4b2cd2,_0x50ff02){return cartesians2lonlats(this['getOutlinePositions'](_0x4b2cd2),_0x50ff02);}['getRectangle'](_0x3023c0){const _0x48192b={_0x46581d:0x5a3},_0x31c75b=_0x3d5d32,_0x243bf3=this['_rectangle_draw']||this[_0x31c75b(_0x48192b._0x46581d)];return _0x3023c0!==null&&_0x3023c0!==void 0x0&&_0x3023c0['isFormat']?formatRectangle(_0x243bf3):_0x243bf3;}['isInPoly'](_0x2d3026){const _0x576b58={_0x2e7136:0x89b,_0x1cdc43:0x2ae},_0x7ebea0=_0x3d5d32;var _0x13e36e;const _0x1ab04b=getCesiumValue((_0x13e36e=this[_0x7ebea0(_0x576b58._0x2e7136)]['rectangle'])===null||_0x13e36e===void 0x0?void 0x0:_0x13e36e[_0x7ebea0(_0x576b58._0x1cdc43)],Cesium__namespace['Rectangle']),_0xcbcfcf=Cesium__namespace[_0x7ebea0(0x756)]['contains'](_0x1ab04b,LngLatPoint['parse'](_0x2d3026)['toCartographic']());return _0xcbcfcf;}['flyTo'](_0x58c539={}){const _0x30938c=_0x3d5d32;if(!this[_0x30938c(0x1d1)])return;return _0x58c539['clampToGround']=this['style'][_0x30938c(0x7c0)],this['_map']['flyToExtent'](getCesiumValue(this['rectangle'],Cesium__namespace['Rectangle']),_0x58c539),this;}}register$4('rectangle',RectangleEntity);function getOutlinePositions(_0xb07c48,_0x1040c7=!![]){const _0x437f1c={_0x5049b9:0x756},_0x4498c5=_0x3d5d32;if(!_0xb07c48||!_0xb07c48['rectangle'])return[];const _0x1c3d66=getCesiumValue(_0xb07c48['rectangle']['coordinates'],Cesium__namespace[_0x4498c5(_0x437f1c._0x5049b9)]);if(!_0x1c3d66)return[];const _0x1a65d1=getCesiumValue(_0xb07c48['rectangle']['rotation'],Number)||0x0,_0x3b0976=getCesiumValue(_0xb07c48['rectangle']['height'],Number)||0x0,_0x166c26=getRectangleOuterPositions({'rectangle':_0x1c3d66,'rotation':_0x1a65d1,'height':_0x3b0976});return _0x1040c7&&_0x166c26[_0x4498c5(0xb75)](_0x166c26[0x0]),_0x166c26;}function getAllPositions(_0x1fef59){const _0xec1f61=getCesiumValue(_0x1fef59['polygon']['hierarchy'],Cesium__namespace['PolygonHierarchy']),_0x6623bb=getHierarchyVal(_0xec1f61);return _0x6623bb;}function getPositions(_0x1790f8,_0x479f71){const _0x4f7cfb=_0x3d5d32;if(!_0x479f71&&_0x1790f8['_positions_draw']&&_0x1790f8['_positions_draw']['length']>0x0)return _0x1790f8['_positions_draw'];let _0x3ee998=getCesiumValue(_0x1790f8['polygon'][_0x4f7cfb(0xfdb)],Cesium__namespace[_0x4f7cfb(0x9d3)]);return _0x3ee998&&_0x3ee998 instanceof Cesium__namespace['PolygonHierarchy']&&(_0x3ee998=_0x3ee998[_0x4f7cfb(0xbb8)]),_0x3ee998;}function getHolesPositions(_0x5b1995){const _0x5677bd={_0x49ae7e:0x444},_0x18a453=_0x3d5d32,_0x1152a=getCesiumValue(_0x5b1995[_0x18a453(0x104e)]['hierarchy'],Cesium__namespace['PolygonHierarchy']),_0x2d0ff8=getHierarchyVal(_0x1152a);return _0x2d0ff8['length']>0x1?_0x2d0ff8[_0x18a453(_0x5677bd._0x49ae7e)](0x1):null;}function getHierarchyVal(_0x527957){const _0x6ece89=_0x3d5d32;if(!_0x527957)return[];if(_0x527957&&_0x527957 instanceof Cesium__namespace[_0x6ece89(0x9d3)]){let _0x11c9dc=[_0x527957['positions']];for(let _0x406b12=0x0,_0x2602b4=_0x527957['holes']['length'];_0x406b12<_0x2602b4;_0x406b12++){const _0x5e621f=_0x527957['holes'][_0x406b12];_0x11c9dc=_0x11c9dc['concat'](getHierarchyVal(_0x5e621f));}return _0x11c9dc;}else return[_0x527957];}function getPolygonHierarchy(_0x23319e,_0x5ac91f){const _0x35d469=_0x3d5d32;if(_0x23319e['length']===0x0)return new Cesium__namespace['PolygonHierarchy']();const _0x216033=[];if(_0x23319e['length']>0x1)for(let _0x3eeabe=0x1,_0x5b3819=_0x23319e['length'];_0x3eeabe<_0x5b3819;_0x3eeabe++){_0x216033['push'](new Cesium__namespace['PolygonHierarchy'](lonlats2cartesians(_0x23319e[_0x3eeabe],_0x5ac91f)));}const _0x5e57eb=_0x23319e[0x0],_0x3b27d5=new Cesium__namespace[(_0x35d469(0x9d3))](lonlats2cartesians(_0x5e57eb,_0x5ac91f),_0x216033);return _0x3b27d5;}function getPolygonHierarchy2(_0x190119){const _0x6f0370={_0x4c45ad:0xc84,_0x37f8bd:0xc84,_0x4a52b1:0x890},_0x4a7ee0=_0x3d5d32;if(_0x190119[_0x4a7ee0(_0x6f0370._0x4c45ad)]===0x0)return new Cesium__namespace['PolygonHierarchy']();const _0x1f431b=[];if(_0x190119[_0x4a7ee0(_0x6f0370._0x37f8bd)]>0x1)for(let _0x3f5853=0x1,_0x59d5e8=_0x190119['length'];_0x3f5853<_0x59d5e8;_0x3f5853++){_0x1f431b['push'](new Cesium__namespace['PolygonHierarchy'](LngLatArray[_0x4a7ee0(_0x6f0370._0x4a52b1)](_0x190119[_0x3f5853])));}const _0x3db6e4=_0x190119[0x0],_0x593896=new Cesium__namespace['PolygonHierarchy'](LngLatArray['toCartesians'](_0x3db6e4),_0x1f431b);return _0x593896;}class EditPolygon extends EditPoly{get[_0x3d5d32(0x487)](){return this['_graphic']['hasClosure']??!![];}get[_0x3d5d32(0x7c0)](){const _0x2ec166={_0x50f692:0x7c0},_0x25b860=_0x3d5d32;var _0x2d1225,_0x1ae702;return this['style'][_0x25b860(_0x2ec166._0x50f692)]??!getCesiumValue((_0x2d1225=this['_graphic'])===null||_0x2d1225===void 0x0?void 0x0:(_0x1ae702=_0x2d1225['entityGraphic'])===null||_0x1ae702===void 0x0?void 0x0:_0x1ae702['perPositionHeight'],Boolean);}['bindDraggers'](){const _0x4fa540={_0x44a933:0xc84},_0x4e102f=_0x3d5d32;var _0x4499bb;super[_0x4e102f(0xbc8)]();if(((_0x4499bb=this['_graphic']['_draw_holes'])===null||_0x4499bb===void 0x0?void 0x0:_0x4499bb['length'])>0x0)for(let _0x1f4b82=0x0,_0x40907a=this['_graphic']['_draw_holes'][_0x4e102f(_0x4fa540._0x44a933)];_0x1f4b82<_0x40907a;_0x1f4b82++){this['bindHolesDraggers'](this['_graphic']['_draw_holes'][_0x1f4b82],_0x1f4b82);}}['bindHolesDraggers'](_0x56edcc,_0x2edf22){const _0x269b26={_0x291270:0xf10,_0x267bf0:0x98f},_0x4468d9=_0x3d5d32;for(let _0x2492b4=0x0,_0x1c181a=_0x56edcc['length'];_0x2492b4<_0x1c181a;_0x2492b4++){const _0x33b803=this['updatePositionsHeightByAttr'](_0x56edcc[_0x2492b4]),_0x4f8bbc=this[_0x4468d9(_0x269b26._0x291270)]({'position':_0x33b803,'onDrag':(_0x19b012,_0x153782)=>{_0x153782=this['updatePositionsHeightByAttr'](_0x153782),_0x19b012['position']=_0x153782,_0x56edcc[_0x19b012['index']]=_0x153782;},'onDragEnd':(_0x14ccb7,_0x4da7e6)=>{this['updateDraggers']();}});_0x4f8bbc[_0x4468d9(0x5f9)]=_0x2492b4,this['draggers']['push'](_0x4f8bbc);if(this['hasMidPoint']&&(this['hasClosure']||!this[_0x4468d9(0x487)]&&_0x2492b4<_0x1c181a-0x1)){const _0x50a088=(_0x2492b4+0x1)%_0x1c181a;let _0x5a1443=getMidpoint(_0x33b803,_0x56edcc[_0x50a088]);_0x5a1443=this['updatePositionsHeightByAttr'](_0x5a1443);const _0x441cdc=this['createDragger']({'position':_0x5a1443,'type':PointType['AddMidPoint'],'tooltip':this['_map']['getLangText'](_0x4468d9(_0x269b26._0x267bf0)),'onDragStart':(_0x4aae9a,_0x42b6d8)=>{const _0x4edc50=_0x4468d9;_0x56edcc[_0x4edc50(0x1008)](_0x4aae9a['index'],0x0,_0x42b6d8);},'onDrag':(_0xa3c980,_0x2772f4)=>{_0x56edcc[_0xa3c980['index']]=_0x2772f4;},'onDragEnd':(_0x2a7ad8,_0x1cc932)=>{const _0x21b2a9=_0x4468d9;this[_0x21b2a9(0x5ad)](_0x2a7ad8,_0x1cc932),this[_0x21b2a9(0xfa7)]();}});_0x441cdc['index']=_0x50a088,this[_0x4468d9(0x93f)]['push'](_0x441cdc);}}}}const nullColor$1=new Cesium__namespace['Color'](0x0,0x0,0x0,0.01);class PolygonEntity extends BasePolyEntity{constructor(_0x546c6d={}){super(_0x546c6d),this['_minPointNum']=_0x546c6d['minPointNum']??0x3,this['_clampToGround_reload']=!![];}get['entityGraphic'](){const _0x180260=_0x3d5d32;var _0x2bc102;return(_0x2bc102=this[_0x180260(0x89b)])===null||_0x2bc102===void 0x0?void 0x0:_0x2bc102['polygon'];}get[_0x3d5d32(0x98e)](){return EditPolygon;}get[_0x3d5d32(0xe72)](){return this['centerOfMass'];}get[_0x3d5d32(0xbd7)](){return getDistance(this['positionsShow'],!![]);}get['positionsShow'](){const _0x173875={_0x4f5c89:0x924,_0x31e769:0x534},_0x55430e=_0x3d5d32;let _0x288f86=getCesiumValue(this[_0x55430e(_0x173875._0x4f5c89)]);return _0x288f86 instanceof Cesium__namespace['PolygonHierarchy']&&(_0x288f86=_0x288f86[_0x55430e(0xbb8)]),this[_0x55430e(_0x173875._0x31e769)]??this['getShowPositions'](_0x288f86);}get['hierarchy'](){const _0x896b3c={_0x4180c7:0xa09},_0x403060=_0x3d5d32;var _0x400b83;return this['_hierarchy']||((_0x400b83=this[_0x403060(_0x896b3c._0x4180c7)])===null||_0x400b83===void 0x0?void 0x0:_0x400b83['hierarchy']);}get['positions'](){return this['_positions'];}set['positions'](_0x650ff5){const _0x9df182={_0x29e503:0xe95,_0x13454e:0x924},_0x15a1d0={_0x5d0634:0xce3,_0x2b18f2:0x62b,_0x599ecc:0x1003},_0x57e0bb=_0x3d5d32;var _0x1e9635;if(!_0x650ff5)return;!((_0x1e9635=this['editing'])!==null&&_0x1e9635!==void 0x0&&_0x1e9635['enabled'])&&(this['_hierarchy']=null,this['_positions_show']=null);_0x650ff5 instanceof Cesium__namespace[_0x57e0bb(0x9d3)]&&(this['_hierarchy']=_0x650ff5,_0x650ff5=this[_0x57e0bb(0x9b2)]['positions']);if(Array[_0x57e0bb(0x62b)](_0x650ff5)){var _0x4e4ea1;if(_0x650ff5['length']>0x0&&Array['isArray'](_0x650ff5[0x0])&&_0x650ff5[0x0]['length']>0x0){const _0x130088=_0x650ff5[0x0][0x0];if(Array['isArray'](_0x130088)&&isNumber(_0x130088[0x0]))this['_hierarchy']=getPolygonHierarchy(_0x650ff5,this['style']['height']||this['style']['setHeight']||this['style']['addHeight']),_0x650ff5=this['_hierarchy']['positions'];else _0x130088 instanceof Cesium__namespace[_0x57e0bb(_0x9df182._0x29e503)]&&(this['_hierarchy']=getPolygonHierarchy2(_0x650ff5),_0x650ff5=this['_hierarchy']['positions']);}const _0x1f67ce=[],_0x43baba=[];_0x650ff5['forEach']((_0x497f9b,_0x107192)=>{const _0x492550=_0x57e0bb,_0x45b56f=LngLatPoint[_0x492550(_0x15a1d0._0x5d0634)](_0x497f9b);if(!_0x45b56f)return;let _0x3cb4d1=this['style']['setHeight'];if(Cesium__namespace['defined'](_0x3cb4d1)){if(isString(_0x3cb4d1))_0x3cb4d1=Number(template(_0x3cb4d1,this['attr'],!![])),isNaN(_0x3cb4d1)&&(_0x3cb4d1=0x0);else Array[_0x492550(_0x15a1d0._0x2b18f2)](_0x3cb4d1)&&(_0x3cb4d1=_0x3cb4d1[_0x107192]||0x0);_0x45b56f['alt']=_0x3cb4d1;}const _0x1ee4f3=this[_0x492550(_0x15a1d0._0x599ecc)](_0x107192);_0x1ee4f3!==0x0&&(_0x45b56f[_0x492550(0xd29)]=_0x45b56f['alt']+_0x1ee4f3),_0x1f67ce['push'](_0x45b56f),_0x43baba['push'](_0x45b56f['toCartesian']());}),this['_points']=_0x1f67ce,(_0x4e4ea1=this['editing'])!==null&&_0x4e4ea1!==void 0x0&&_0x4e4ea1['enabled']?this['_positions_draw']=_0x43baba:this['_positions']=_0x43baba;}else this['_positions']=_0x650ff5;this['_entity']&&this[_0x57e0bb(0x367)](),this['fire'](EventType['updatePosition'],{'positions':this[_0x57e0bb(_0x9df182._0x13454e)]});}['getEntityPositions'](){return getPositions(this['_entity']);}[_0x3d5d32(0x7f0)](_0x3a2951){return _0x3a2951;}['_mountedHook'](){const _0x1e7d8e={_0x4210ed:0xdde,_0x3659a2:0x104e,_0xdc669c:0xfdb,_0x189393:0x7f0,_0xf9ad1e:0xbeb,_0x38c76d:0x827,_0x4be29e:0x32a},_0x433098={_0x30371d:0x534,_0x220220:0x576},_0x534a8f=_0x3d5d32,_0x29b180={'polygon':PolygonStyleConver[_0x534a8f(0x83d)](this[_0x534a8f(_0x1e7d8e._0x4210ed)],{},!![])};if(this[_0x534a8f(0x924)]instanceof Cesium__namespace['CallbackProperty']){const _0x29f9d0=this['_positions']['getValue'](this['_map']['clock']['currentTime']);if(_0x29f9d0&&Array['isArray'](_0x29f9d0)){const _0x5d146c=new Cesium__namespace['PolygonHierarchy']();_0x29b180[_0x534a8f(_0x1e7d8e._0x3659a2)]['hierarchy']=new Cesium__namespace['CallbackProperty'](_0x56e007=>{const _0x4ae812=_0x534a8f;var _0x4b1544;const _0x5c31c3=this['_positions']['getValue'](_0x56e007);this[_0x4ae812(_0x433098._0x30371d)]=this['getShowPositions'](_0x5c31c3),_0x5d146c['positions']=this['_positions_show'];if(this['_entity_outlines']&&((_0x4b1544=this['_positions_show'])===null||_0x4b1544===void 0x0?void 0x0:_0x4b1544['length'])>0x0){var _0x201ba3;((_0x201ba3=this['style'][_0x4ae812(_0x433098._0x220220)])===null||_0x201ba3===void 0x0?void 0x0:_0x201ba3[_0x4ae812(0x1f2)])??!![]?this[_0x4ae812(0x4ef)]=this['_positions_show']['concat'](this['_positions_show'][0x0]):this['outlinePositions']=this[_0x4ae812(_0x433098._0x30371d)];}return _0x5d146c;},![]),this['_hierarchy']=_0x5d146c;}else _0x29b180['polygon']['hierarchy']=this['_positions'];}else this['_hierarchy']?_0x29b180['polygon'][_0x534a8f(_0x1e7d8e._0xdc669c)]=this[_0x534a8f(0x9b2)]:(!this['_positions_show']&&(this['_positions_show']=this[_0x534a8f(_0x1e7d8e._0x189393)](this['positions'])),_0x29b180['polygon'][_0x534a8f(0xfdb)]=new Cesium__namespace['PolygonHierarchy'](this['_positions_show']));this[_0x534a8f(0x89b)]=this['_createEntity'](_0x29b180),this[_0x534a8f(_0x1e7d8e._0xf9ad1e)](),this['_bindExType'](),this[_0x534a8f(0x212)](this['_getOutlinePositions'](),this['style']),this['_entity']['polygon'][_0x534a8f(0xfdb)]instanceof Cesium__namespace['CallbackProperty']&&this[_0x534a8f(_0x1e7d8e._0x38c76d)](),this['style'][_0x534a8f(_0x1e7d8e._0x4be29e)]&&this['_addLabel']();}['_bindExType'](){const _0x55ae55={_0x5f1b9e:0x433,_0x47c8e7:0x458,_0x417266:0xdde,_0x1fa3d0:0x104e},_0x2a029a=_0x3d5d32,_0x300076=this['options']['buildings']||this['_layer']['options']['buildings'];if(_0x300076&&(_0x300076['enabled']??!![])){if(_0x300076[_0x2a029a(0x7fa)]){let _0xa56715;if(isNumber(_0x300076['bottomHeight']))_0xa56715=_0x300076['bottomHeight'];else isString(_0x300076['bottomHeight'])&&(_0xa56715=Number(this['attr'][_0x300076['bottomHeight']]||0x0));this['_entity']['polygon']['height']=_0xa56715;}const _0x42209b=Number(this['attr'][_0x300076['cloumn']]||0x1);let _0x188e09;if(isNumber(_0x300076['height']))_0x188e09=_0x300076['height'];else isString(_0x300076['height'])?_0x188e09=this['attr'][_0x300076['height']]||_0x188e09:_0x188e09=3.5;const _0x4a94f0=getCesiumValue(this['_entity']['polygon']['height'])||0x0;this['_entity'][_0x2a029a(0x104e)]['extrudedHeight']=_0x4a94f0+_0x42209b*_0x188e09;}const _0x33e53f=this['options']['dth']||this['_layer'][_0x2a029a(_0x55ae55._0x5f1b9e)][_0x2a029a(0xcd0)];_0x33e53f&&(this['_entity']['polygon']['classificationType']=Cesium__namespace[_0x2a029a(_0x55ae55._0x47c8e7)]['BOTH'],!Cesium__namespace['defined'](this[_0x2a029a(_0x55ae55._0x417266)]['color'])&&(this['_entity'][_0x2a029a(_0x55ae55._0x1fa3d0)]['material']=nullColor$1),!Cesium__namespace['defined'](this[_0x2a029a(0xdde)]['height'])&&(this[_0x2a029a(0x89b)]['polygon'][_0x2a029a(0x8bc)]=![]),this[_0x2a029a(0x89b)]['polygon']['zIndex']=0x63);}['_updateDiffHeight'](){const _0x439214={_0x3cf20a:0xdde,_0x3ee4fc:0x9e2,_0x59c11b:0xb84,_0x3cf60e:0x83e,_0x3b593c:0xdde},_0x32dcb0=_0x3d5d32;if(!Cesium__namespace[_0x32dcb0(0xb84)](this[_0x32dcb0(_0x439214._0x3cf20a)][_0x32dcb0(_0x439214._0x3ee4fc)])||this[_0x32dcb0(0xa09)]['extrudedHeight']instanceof Cesium__namespace['CallbackProperty'])return;if(Cesium__namespace[_0x32dcb0(_0x439214._0x59c11b)](this[_0x32dcb0(0xdde)][_0x32dcb0(0x9e2)])&&this['style']['diffHeight']!==0x0){let _0x5ad7b8=0x0;Cesium__namespace['defined'](this['style'][_0x32dcb0(_0x439214._0x3cf60e)])?_0x5ad7b8=this['style']['height']:_0x5ad7b8=getMaxHeight(this[_0x32dcb0(0xd76)]||this['_positions']),this['entityGraphic']['extrudedHeight']=_0x5ad7b8+this[_0x32dcb0(_0x439214._0x3b593c)]['diffHeight'];}else this['entityGraphic']['extrudedHeight']=undefined;}['_style2Json'](_0x3a21ed,_0x211c3a){const _0x7d1338=_0x3d5d32;return PolygonStyleConver[_0x7d1338(0x3db)](_0x3a21ed,_0x211c3a,!![]);}['_updateStyleHook'](_0x282fc9,_0x974754){PolygonStyleConver['toCesiumVal'](_0x282fc9,this['entityGraphic'],!![]),(Cesium__namespace['defined'](_0x974754['diffHeight'])||Cesium__namespace['defined'](_0x974754['height']))&&this['_updateDiffHeight']();}['_updatePositionsHook'](){const _0x1b8e75={_0xd3475b:0x67f,_0x4afbbd:0x534,_0x3178f2:0x534,_0x733593:0xfdb,_0x44175a:0x9d3,_0x2626cf:0xdde},_0x48218b=_0x3d5d32;if(this['_positions']instanceof Cesium__namespace['CallbackProperty']){var _0x326746;this['entityGraphic']['hierarchy']=this['_positions'],(_0x326746=this[_0x48218b(_0x1b8e75._0xd3475b)])!==null&&_0x326746!==void 0x0&&_0x326746['enabled']&&this['_hierarchy']&&(this[_0x48218b(_0x1b8e75._0x4afbbd)]=this['getShowPositions'](this[_0x48218b(0xd76)]),this['_hierarchy']['positions']=this[_0x48218b(_0x1b8e75._0x3178f2)]);}else this['_hierarchy']?this['entityGraphic'][_0x48218b(_0x1b8e75._0x733593)]=this['_hierarchy']:(this['_positions_show']=this['getShowPositions'](this['positions']),this['entityGraphic']['hierarchy']=new Cesium__namespace[(_0x48218b(_0x1b8e75._0x44175a))](this[_0x48218b(0x534)]));this['_updateOutlineStyle'](this['_getOutlinePositions'](),this[_0x48218b(_0x1b8e75._0x2626cf)]),this['_updateLabelPosition'](),this['_updateDiffHeight'](),this['_updateEditDraggers']();}['_getOutlinePositions'](){return getAllPositions(this['_entity']);}['toGeoJSON'](_0x4a6091){return super['toGeoJSON'](_0x4a6091);}[_0x3d5d32(0x21f)](_0x4006eb){const _0x87338d=_0x3d5d32;var _0x43d5d7,_0x2dafe4;let _0x27f777=this['getCoordinates'](_0x4006eb===null||_0x4006eb===void 0x0?void 0x0:_0x4006eb['noAlt']);_0x4006eb!==null&&_0x4006eb!==void 0x0&&_0x4006eb[_0x87338d(0x1f2)]&&_0x27f777['length']>0x0&&_0x27f777[_0x87338d(0xb75)](_0x27f777[0x0]);if(((_0x43d5d7=this['_hierarchy'])===null||_0x43d5d7===void 0x0?void 0x0:(_0x2dafe4=_0x43d5d7[_0x87338d(0x427)])===null||_0x2dafe4===void 0x0?void 0x0:_0x2dafe4['length'])>0x0){_0x27f777=[_0x27f777];const _0x4318cf=getHolesPositions(this[_0x87338d(0x89b)]);_0x4318cf['forEach'](_0x4c0b82=>{const _0x1f26db=_0x87338d;_0x27f777['push'](LngLatArray[_0x1f26db(0x4d4)](_0x4c0b82));});}return{'type':'Polygon','coordinates':[_0x27f777]};}[_0x3d5d32(0x38f)](_0x5ea6b2){const _0x5e18e6=_0x3d5d32;return this['_setPositionsToCallback'](),_0x5ea6b2&&(_0x5ea6b2&&(_0x5ea6b2=LngLatArray[_0x5e18e6(0x890)](_0x5ea6b2)),this['_positions_draw']=_0x5ea6b2,this['_hierarchy']['positions']=_0x5ea6b2),this['_positions_draw'];}['_positions_CallbackProperty'](){return this['_hierarchy'];}[_0x3d5d32(0xa84)](){super['_cancelPositionsCallback'](),this['_hierarchy']=null;}['_startDrawHook'](){const _0x3ed591={_0x26eae1:0xc6d},_0x73800e={_0x387892:0x4ef},_0x507533=_0x3d5d32;super['_startDrawHook'](),this['_updateOutlineStyle']([new Cesium__namespace[(_0x507533(_0x3ed591._0x26eae1))](_0x59e15e=>{const _0x270967=_0x507533;return this[_0x270967(_0x73800e._0x387892)];},![])],this[_0x507533(0xdde)],{'show':!![],'width':0x2,'color':this[_0x507533(0xdde)]['color']});}['_setPositionsToCallback'](){const _0x354cdf={_0x13339a:0x89b},_0x4ab504=_0x3d5d32;if(this['_isCallbackPositions'])return;this['_draw_holes']=getHolesPositions(this[_0x4ab504(_0x354cdf._0x13339a)]),super['_setPositionsToCallback']();}['updateAttrForDrawing'](_0x50cbe9){const _0x1f1fdb={_0x3df9bc:0x9b2,_0x55af88:0x9d3,_0x17bc8d:0x534,_0x563cc8:0x576,_0x5d53c4:0xbeb},_0x191afa=_0x3d5d32;var _0x3cf850;if(!this[_0x191afa(_0x1f1fdb._0x3df9bc)]){this['_hierarchy']=new Cesium__namespace[(_0x191afa(_0x1f1fdb._0x55af88))]();if(this['_draw_holes']){const _0x385d35=[];this['_draw_holes']['forEach'](_0x5f4480=>{_0x385d35['push'](new Cesium__namespace['PolygonHierarchy'](_0x5f4480));}),this['_hierarchy']['holes']=_0x385d35;}}this['_positions_show']=this['getShowPositions'](this['_positions_draw']),this['_hierarchy']['positions']=this['_positions_show'];if(((_0x3cf850=this[_0x191afa(_0x1f1fdb._0x17bc8d)])===null||_0x3cf850===void 0x0?void 0x0:_0x3cf850['length'])>0x0){var _0x4abe38;((_0x4abe38=this['style'][_0x191afa(_0x1f1fdb._0x563cc8)])===null||_0x4abe38===void 0x0?void 0x0:_0x4abe38[_0x191afa(0x1f2)])??!![]?this['outlinePositions']=this['_positions_show']['concat'](this['_positions_show'][0x0]):this[_0x191afa(0x4ef)]=this['_positions_show'];}let _0x457b23;this['_positions_draw']['length']-0x1;_0x598e47--){removePrimitive(_0x27133b[_0x598e47],_0x48665f,_0x2256c7);}for(const _0x53a2ae in this){delete this[_0x53a2ae];}return Cesium__namespace['destroyObject'](this);},RectangularSensorVisualizer['prototype']['_onCollectionChanged']=function(_0x176861,_0x165f25,_0x43d4b6,_0x4a810b){const _0x17c529={_0x58b994:0x624,_0x10c273:0x631},_0xb0254=_0x3d5d32,_0x3d8658=this['_entitiesToVisualize'];if(!_0x3d8658)return;const _0x360f2f=this['_hash'],_0x339b5a=this[_0xb0254(_0x17c529._0x58b994)];let _0x119a2c,_0x1588c8;for(_0x119a2c=_0x165f25['length']-0x1;_0x119a2c>-0x1;_0x119a2c--){_0x1588c8=_0x165f25[_0x119a2c],defined$2(_0x1588c8['_rectangularSensorMars'])&&defined$2(_0x1588c8['_position'])&&_0x3d8658[_0xb0254(_0x17c529._0x10c273)](_0x1588c8['id'],_0x1588c8);}for(_0x119a2c=_0x4a810b[_0xb0254(0xc84)]-0x1;_0x119a2c>-0x1;_0x119a2c--){_0x1588c8=_0x4a810b[_0x119a2c],defined$2(_0x1588c8[_0xb0254(0xfa8)])&&defined$2(_0x1588c8['_position'])?_0x3d8658['set'](_0x1588c8['id'],_0x1588c8):(removePrimitive(_0x1588c8,_0x360f2f,_0x339b5a),_0x3d8658['remove'](_0x1588c8['id']));}for(_0x119a2c=_0x43d4b6['length']-0x1;_0x119a2c>-0x1;_0x119a2c--){_0x1588c8=_0x43d4b6[_0x119a2c],removePrimitive(_0x1588c8,_0x360f2f,_0x339b5a),_0x3d8658['remove'](_0x1588c8['id']);}};const originalDefaultVisualizersCallback=Cesium__namespace['DataSourceDisplay']['defaultVisualizersCallback'];Cesium__namespace['DataSourceDisplay']['defaultVisualizersCallback']=function(_0x4a42f5,_0x687bbf,_0x3a4e44){const _0x53ce38={_0x1d057b:0xea8},_0x2f81fa=_0x3d5d32,_0x1e3c4e=_0x3a4e44[_0x2f81fa(_0x53ce38._0x1d057b)],_0x215a2b=originalDefaultVisualizersCallback(_0x4a42f5,_0x687bbf,_0x3a4e44);return _0x215a2b['concat']([new RectangularSensorVisualizer(_0x4a42f5,_0x1e3c4e)]);};class RectangularSensor extends BasePointEntity{get['entityGraphic'](){const _0x189f2b={_0xa092d3:0x89b},_0x46c352=_0x3d5d32;var _0x3ecdb3;return(_0x3ecdb3=this[_0x46c352(_0x189f2b._0xa092d3)])===null||_0x3ecdb3===void 0x0?void 0x0:_0x3ecdb3['rectangularSensorMars'];}get['radius'](){const _0x28e3ce=_0x3d5d32;return this['style'][_0x28e3ce(0xd61)];}set['radius'](_0x203523){const _0x25c4e9={_0x7b7663:0x89b},_0x38c8ec=_0x3d5d32;this['style']['radius']=_0x203523,this[_0x38c8ec(_0x25c4e9._0x7b7663)]&&(this['entityGraphic']['radius']=_0x203523);}['_mountedHook'](){const _0x1632bd=_0x3d5d32,_0x390b56={'position':this[_0x1632bd(0xb69)],'orientation':this['getOrientation'](),'rectangularSensorMars':new RectangularSensorGraphics(RectangularSensorStyleConver['toCesiumVal'](this['style']))};this['_entity']=this['_createEntity'](_0x390b56),this['style']['label']&&this['_addLabel']();}['_updateStyleHook'](_0x4fc4c9,_0x139318){const _0x49f966={_0x2f0528:0xea8,_0x3244b4:0xe4c},_0xa88bb6=_0x3d5d32;if(this['_entity']&&this['isAdded']){const _0x7b43cf=this['_layer'][_0xa88bb6(0x426)];_0x7b43cf[_0xa88bb6(_0x49f966._0x2f0528)]['remove'](this['_entity']),delete this['_entity'],this[_0xa88bb6(_0x49f966._0x3244b4)](),_0x7b43cf[_0xa88bb6(_0x49f966._0x2f0528)][_0xa88bb6(0xff3)](this[_0xa88bb6(0x89b)]);}}[_0x3d5d32(0xb91)](_0xe02a21,_0x307d78){const _0x3f2ddc={_0x457ee5:0xb84,_0x5dbbca:0xb28,_0x369659:0x24b},_0x5879fa=_0x3d5d32,_0x162cd3=_0xe02a21===null||_0xe02a21===void 0x0?void 0x0:_0xe02a21['material'];if(!_0x162cd3)return![];const _0x52a1b6=getCesiumColor(_0x162cd3['color'],Cesium__namespace['Color']['WHITE']);return!Cesium__namespace[_0x5879fa(_0x3f2ddc._0x457ee5)](this['_material_color_alpha'])&&(this[_0x5879fa(_0x3f2ddc._0x5dbbca)]=_0x52a1b6[_0x5879fa(_0x3f2ddc._0x369659)]),_0x162cd3['color']=_0x52a1b6['withAlpha'](this['_material_color_alpha']*_0x307d78),!![];}['_updateExOpacity'](_0x4c2a8e){const _0x5531d8={_0x294ad5:0x7a7,_0x5ba557:0x777},_0x3390cc=_0x3d5d32,_0x11521e=getCesiumColor(this[_0x3390cc(0xa09)]['lineColor'],Cesium__namespace['Color'][_0x3390cc(_0x5531d8._0x294ad5)]);!Cesium__namespace[_0x3390cc(0xb84)](this['_lineColor_alpha'])&&(this['_lineColor_alpha']=_0x11521e[_0x3390cc(0x24b)]);this['entityGraphic'][_0x3390cc(_0x5531d8._0x5ba557)]=_0x11521e['withAlpha'](this['_lineColor_alpha']*_0x4c2a8e);const _0x5b0b4e=getCesiumColor(this['entityGraphic']['scanPlaneColor'],Cesium__namespace['Color']['WHITE']);!Cesium__namespace['defined'](this['_scanPlaneColor_alpha'])&&(this['_scanPlaneColor_alpha']=_0x5b0b4e['alpha']),this['entityGraphic'][_0x3390cc(0xf23)]=_0x5b0b4e['withAlpha'](this['_scanPlaneColor_alpha']*_0x4c2a8e);}[_0x3d5d32(0x53e)](_0x8c1707,_0x52968f){return RectangularSensorStyleConver['toJSON'](_0x8c1707,_0x52968f,!![]);}}register$4('rectangularSensor',RectangularSensor,!![]);const DEF_STYLE$m={'distance':0.1,'perPositionHeight':!![],'showFrustum':![],'opacity':0x1,'flipx':![],'flipy':![]};class Video2D extends PolygonEntity{constructor(_0x1507f3={}){const _0x1e3a2a={_0x2b114e:0xdde},_0x1291a7=_0x3d5d32;_0x1507f3[_0x1291a7(_0x1e3a2a._0x2b114e)]={...DEF_STYLE$m,..._0x1507f3['style']||{}},super(_0x1507f3),_0x1507f3['position']&&(this[_0x1291a7(0xb69)]=_0x1507f3['position']),this['_videoPlay']=!![];}get['czmObjectEx'](){const _0x94b2f={_0x35fc77:0x26a,_0x473d19:0xb75},_0x308b04=_0x3d5d32;let _0x1dfcab=[];return this['_frustumPrimitive']&&_0x1dfcab['push'](this['_frustumPrimitive']),this[_0x308b04(_0x94b2f._0x35fc77)]&&_0x1dfcab[_0x308b04(_0x94b2f._0x473d19)](this['_entity_label']),this[_0x308b04(0xf37)]&&(_0x1dfcab=_0x1dfcab['concat'](this['_entity_outlines'])),_0x1dfcab;}get['position'](){const _0x52ffab={_0xd17755:0x87d},_0x41b3c9=_0x3d5d32;return getPositionValue(this[_0x41b3c9(_0x52ffab._0xd17755)]);}set[_0x3d5d32(0xb69)](_0x3bf4b4){const _0x356681=_0x3d5d32;var _0x24e573;this[_0x356681(0xe7f)]=LngLatPoint['parse'](_0x3bf4b4),this['_position']=(_0x24e573=this['_point'])===null||_0x24e573===void 0x0?void 0x0:_0x24e573['toCartesian'](),this['_entity']&&(this['_updatePositionsHook'](),this['_updateDraw'](),this['_bindHierarchy']());}get[_0x3d5d32(0xbbe)](){const _0x1296cd={_0x2455b2:0xe7f},_0x20ec5a=_0x3d5d32;return this[_0x20ec5a(_0x1296cd._0x2455b2)];}get['coordinate'](){return this['point']['toArray']();}get['targetPosition'](){return this['options']['targetPosition'];}set['targetPosition'](_0x1bfad4){const _0x2cc06f={_0x58483b:0xe95,_0x2be9aa:0xbd7,_0x333905:0xe39,_0x442e77:0xdde},_0x3f2522=_0x3d5d32;var _0x4ec27b;this['options'][_0x3f2522(0xba9)]=_0x1bfad4;if(!this['_map'])return;const _0x9994fe=this['position'];if(!_0x9994fe)return;const _0x46f14e=LngLatPoint['toCartesian'](_0x1bfad4,(_0x4ec27b=this[_0x3f2522(0x1d1)])===null||_0x4ec27b===void 0x0?void 0x0:_0x4ec27b[_0x3f2522(0x4f8)]);this['distance']=Cesium__namespace[_0x3f2522(_0x2cc06f._0x58483b)][_0x3f2522(_0x2cc06f._0x2be9aa)](_0x9994fe,_0x46f14e);const _0x5b9608=Cesium__namespace[_0x3f2522(_0x2cc06f._0x58483b)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x46f14e,_0x9994fe,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x263785=Cesium__namespace['Cartesian3']['normalize'](_0x9994fe,new Cesium__namespace['Cartesian3']()),_0x3ad0a7=new Cesium__namespace['Camera'](this['_map']['scene']);_0x3ad0a7['position']=_0x9994fe,_0x3ad0a7['direction']=_0x5b9608,_0x3ad0a7['up']=_0x263785,this[_0x3f2522(0xdde)][_0x3f2522(_0x2cc06f._0x333905)]=Cesium__namespace['Math'][_0x3f2522(0xa1f)](_0x3ad0a7['heading']),this[_0x3f2522(_0x2cc06f._0x442e77)]['pitch']=Cesium__namespace['Math'][_0x3f2522(0xa1f)](_0x3ad0a7['pitch']),this['_updateDraw'](),this['_bindHierarchy']();}get['heading'](){return this['style']['heading']??0x0;}set[_0x3d5d32(0xe39)](_0x3e32fc){const _0x5683ff={_0x48213f:0xdde,_0x2ea413:0xfc8},_0x1b1578=_0x3d5d32;this[_0x1b1578(_0x5683ff._0x48213f)]['heading']=_0x3e32fc,this['_updateDraw'](),this[_0x1b1578(_0x5683ff._0x2ea413)]();}get['pitch'](){return this['style']['pitch']??0x0;}set['pitch'](_0x40942b){this['style']['pitch']=_0x40942b,this['_updateDraw'](),this['_bindHierarchy']();}get[_0x3d5d32(0x952)](){return this['style']['roll']??0x0;}set[_0x3d5d32(0x952)](_0xf44f03){const _0xee76b1={_0x4e47ff:0x952},_0x304a83=_0x3d5d32;this['style'][_0x304a83(_0xee76b1._0x4e47ff)]=_0xf44f03,this[_0x304a83(0xe47)](),this['_bindHierarchy']();}get['angle'](){return this['style']['angle'];}set[_0x3d5d32(0x247)](_0x11e1e1){this['style']['angle']=_0x11e1e1,this['_updateDraw'](),this['_bindHierarchy']();}get[_0x3d5d32(0x5df)](){const _0x29c000={_0x2367da:0x5df},_0x281db7=_0x3d5d32;return this['style'][_0x281db7(_0x29c000._0x2367da)]??this['style']['angle'];}set['angle2'](_0x1d2e2a){const _0x2fd2fd=_0x3d5d32;this['style']['angle2']=_0x1d2e2a,this['_updateDraw'](),this[_0x2fd2fd(0xfc8)]();}get[_0x3d5d32(0xbd7)](){const _0x42e01a=_0x3d5d32;return this[_0x42e01a(0xdde)][_0x42e01a(0xbd7)];}set[_0x3d5d32(0xbd7)](_0x7ee361){this['style']['distance']=_0x7ee361,this['_updateDraw'](),this['_bindHierarchy']();}get['opacity'](){const _0x372db1={_0x1aa884:0xdde},_0x537f2b=_0x3d5d32;return this[_0x537f2b(_0x372db1._0x1aa884)]['opacity'];}set['opacity'](_0x5c3b94){const _0x7e78e2={_0x512d2c:0x89b,_0x426dc9:0xd8f,_0x5b3c83:0xaab},_0x4057d7=_0x3d5d32;this['style']['opacity']=_0x5c3b94,this['_entity']&&(this[_0x4057d7(_0x7e78e2._0x512d2c)]['polygon'][_0x4057d7(_0x7e78e2._0x426dc9)]['_color'][_0x4057d7(0x43f)]['alpha']=_0x5c3b94,this['_entity'][_0x4057d7(0x104e)][_0x4057d7(0xd8f)][_0x4057d7(_0x7e78e2._0x5b3c83)]=_0x5c3b94!==0x1);}get[_0x3d5d32(0xac6)](){return this['style']['flipx'];}set['flipx'](_0x54258d){const _0x29a884={_0x16f2ef:0xac6,_0x909bc2:0x104e},_0x22b066=_0x3d5d32;this['style'][_0x22b066(_0x29a884._0x16f2ef)]=_0x54258d,this['_entity']&&(this[_0x22b066(0x89b)][_0x22b066(_0x29a884._0x909bc2)]['material'][_0x22b066(_0x29a884._0x16f2ef)]=_0x54258d);}get[_0x3d5d32(0x5c3)](){return this['style']['showFrustum'];}set['showFrustum'](_0x3474e8){const _0x4a8c38={_0x54d96a:0x754},_0x3027ee=_0x3d5d32;this['style']['showFrustum']=_0x3474e8,this[_0x3027ee(_0x4a8c38._0x54d96a)]['show']=_0x3474e8;}get['play'](){return this['_videoPlay'];}set['play'](_0x218335){const _0x148f16=_0x3d5d32;this['_videoPlay']=_0x218335;if(!this['_videoContainer'])return;try{this['_videoPlay']?this['_videoContainer'][_0x148f16(0xc2c)]():this['_videoContainer']['pause']();}catch(_0xbc2365){}}['updateVideoContainer'](){const _0xb0fe13={_0x7f79bb:0x5ee,_0x3e6515:0x20c,_0x25a850:0xdde,_0xcc831f:0x104e},_0x5c1940=_0x3d5d32;var _0x2e0eb2;this['_hasRemoveElement']&&(_0x2e0eb2=this['_videoContainer'])!==null&&_0x2e0eb2!==void 0x0&&_0x2e0eb2['parentNode']&&(this['_videoContainer']['parentNode']['removeChild'](this['_videoContainer']),delete this['_hasRemoveElement'],delete this[_0x5c1940(0x20c)]);if(this['style'][_0x5c1940(_0xb0fe13._0x7f79bb)])this[_0x5c1940(_0xb0fe13._0x3e6515)]=createVideo(this['style']['url'],this['style']['fileType'],'',document[_0x5c1940(0x750)]),this['_videoContainer']['style'][_0x5c1940(0xd92)]='none',this[_0x5c1940(0x522)]=!![];else this[_0x5c1940(_0xb0fe13._0x25a850)]['container']&&(this['_videoContainer']=this['style'][_0x5c1940(0x6c2)]);this['_videoContainer']&&(this['_entity'][_0x5c1940(_0xb0fe13._0xcc831f)]['material']=new Image2MaterialProperty({'image':this['_videoContainer'],'color':Cesium__namespace['Color'][_0x5c1940(0x7a7)]['withAlpha'](this[_0x5c1940(0xdde)]['opacity']),'transparent':this['style']['opacity']!==0x1,'flipx':this['style']['flipx'],'flipy':this[_0x5c1940(0xdde)]['flipy']}));}['_mountedHook'](){const _0x47dc11={_0x2e38df:0xe4c},_0x57bb76=_0x3d5d32;super[_0x57bb76(_0x47dc11._0x2e38df)](),this['options']['targetPosition']&&(this['targetPosition']=this['options']['targetPosition']),this['updateVideoContainer']();}[_0x3d5d32(0x7b3)](_0x4e4713,_0x244ab2){super['_updateStyleHook'](_0x4e4713,_0x244ab2),(_0x244ab2['url']||_0x244ab2['container'])&&this['updateVideoContainer']();}['_addedHook'](_0x2d1e24){const _0x3d3b8b={_0x18dc43:0xea8},_0x4ce10d=_0x3d5d32;this['_updateDraw'](),this['_bindHierarchy'](),this['dataSource'][_0x4ce10d(_0x3d3b8b._0x18dc43)]['add'](this['_entity']);}['_removedHook'](){const _0xae60={_0x4459be:0xea8,_0x265641:0x89b,_0x46b3a8:0x522},_0x5bc7c2=_0x3d5d32;var _0x38b3d6;this['_frustumPrimitive']&&(this['_layer']['primitiveCollection']['remove'](this[_0x5bc7c2(0x754)]),delete this['_frustumPrimitive']),this['dataSource'][_0x5bc7c2(_0xae60._0x4459be)]['remove'](this[_0x5bc7c2(_0xae60._0x265641)]),this[_0x5bc7c2(_0xae60._0x46b3a8)]&&(_0x38b3d6=this[_0x5bc7c2(0x20c)])!==null&&_0x38b3d6!==void 0x0&&_0x38b3d6[_0x5bc7c2(0x225)]&&(this[_0x5bc7c2(0x20c)]['parentNode']['removeChild'](this['_videoContainer']),delete this['_hasRemoveElement'],delete this['_videoContainer']);}[_0x3d5d32(0xe47)](){const _0x299c0a={_0x1ea81e:0xb69,_0x232c55:0x36d,_0x5037fc:0xfc1,_0x19a041:0xbd7,_0x253362:0x38d,_0x2e3894:0x103e,_0xe5680a:0xdde,_0x290f17:0x389,_0x30d4a8:0xe95,_0x2f7231:0xf69,_0xd9c2f4:0xe95},_0x5a3751=_0x3d5d32;if(!this['_map'])return;const _0x1b805a=this[_0x5a3751(_0x299c0a._0x1ea81e)];if(!_0x1b805a)return;const _0x48e77d=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math']['toRadians'](this['heading']),Cesium__namespace[_0x5a3751(0x103e)]['toRadians'](this['pitch']),Cesium__namespace['Math']['toRadians'](this['roll'])),_0x2142d6=new Cesium__namespace[(_0x5a3751(_0x299c0a._0x232c55))](this[_0x5a3751(0x1d1)][_0x5a3751(_0x299c0a._0x5037fc)]);_0x2142d6[_0x5a3751(_0x299c0a._0x1ea81e)]=_0x1b805a,_0x2142d6[_0x5a3751(0x389)]['fov']=Cesium__namespace[_0x5a3751(0x103e)]['toRadians'](this[_0x5a3751(0x247)]*0x2),_0x2142d6['frustum']['aspectRatio']=this['angle']/this['angle2'],_0x2142d6['frustum']['near']=0.01,_0x2142d6['frustum'][_0x5a3751(0x418)]=this['style'][_0x5a3751(_0x299c0a._0x19a041)],_0x2142d6[_0x5a3751(_0x299c0a._0x253362)]({'destination':_0x1b805a,'orientation':{'heading':_0x48e77d['heading'],'pitch':_0x48e77d['pitch'],'roll':_0x48e77d['roll']}}),this['_createFrustumPrimitive'](_0x2142d6);const _0xd1f71=_0x2142d6['directionWC'],_0x268637=_0x2142d6['upWC'],_0x30626f=_0x2142d6[_0x5a3751(0x6e9)],_0x1a4898=new Cesium__namespace['Ray'](_0x1b805a,_0xd1f71),_0x3e2787=Cesium__namespace['Ray'][_0x5a3751(0xa0a)](_0x1a4898,this['style']['distance'],new Cesium__namespace['Cartesian3']()),_0x2e87a0=Cesium__namespace[_0x5a3751(_0x299c0a._0x2e3894)]['toRadians'](this['angle']),_0x214ece=Math['tan'](_0x2e87a0),_0x1587f3=this[_0x5a3751(_0x299c0a._0xe5680a)]['distance']*_0x214ece,_0x5cf107=_0x1587f3/_0x2142d6[_0x5a3751(_0x299c0a._0x290f17)]['aspectRatio'],_0x4fc13f=Math['sqrt'](_0x1587f3*_0x1587f3+_0x5cf107*_0x5cf107),_0x1d83b0=new Cesium__namespace['Cartesian3'](),_0x514d01=new Cesium__namespace['Ray'](_0x3e2787,_0x30626f),_0x4657e7=Cesium__namespace[_0x5a3751(0xcbc)]['getPoint'](_0x514d01,_0x1587f3,new Cesium__namespace[(_0x5a3751(0xe95))]()),_0x57cfc1=new Cesium__namespace[(_0x5a3751(0xcbc))](_0x4657e7,_0x268637);Cesium__namespace['Ray']['getPoint'](_0x57cfc1,_0x5cf107,_0x1d83b0);const _0x2bea5e=new Cesium__namespace['Cartesian3'](),_0x1429a1=Cesium__namespace['Cartesian3']['negate'](_0x268637,new Cesium__namespace[(_0x5a3751(_0x299c0a._0x30d4a8))]()),_0x4e6f57=new Cesium__namespace['Ray'](_0x4657e7,_0x1429a1);Cesium__namespace['Ray']['getPoint'](_0x4e6f57,_0x5cf107,_0x2bea5e);const _0x481d73=new Cesium__namespace[(_0x5a3751(0xe95))](),_0x3bd472=Cesium__namespace['Cartesian3'][_0x5a3751(_0x299c0a._0x2f7231)](Cesium__namespace['Cartesian3']['subtract'](_0x3e2787,_0x1d83b0,new Cesium__namespace[(_0x5a3751(_0x299c0a._0xd9c2f4))]()),new Cesium__namespace['Cartesian3']()),_0x25be8d=new Cesium__namespace[(_0x5a3751(0xcbc))](_0x3e2787,_0x3bd472);Cesium__namespace['Ray']['getPoint'](_0x25be8d,_0x4fc13f,_0x481d73);const _0x2b63e5=new Cesium__namespace['Cartesian3'](),_0x496731=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x3e2787,_0x2bea5e,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x1ae885=new Cesium__namespace['Ray'](_0x3e2787,_0x496731);Cesium__namespace['Ray'][_0x5a3751(0xa0a)](_0x1ae885,_0x4fc13f,_0x2b63e5);const _0xf4cb46=[_0x2b63e5,_0x1d83b0,_0x2bea5e,_0x481d73];this['_positions']=_0xf4cb46;}['_bindHierarchy'](){const _0x54a4f8={_0x3bbf97:0x89b,_0x4dfa14:0xfdb},_0x4ad101={_0x1c9960:0x924},_0x567638=_0x3d5d32;if(!this[_0x567638(_0x54a4f8._0x3bbf97)])return;if(this['_position']instanceof Cesium__namespace['CallbackProperty']||this['_position']instanceof Cesium__namespace['SampledPositionProperty']){const _0x5bfb7c=new Cesium__namespace['PolygonHierarchy']();this[_0x567638(0x89b)]['polygon'][_0x567638(_0x54a4f8._0x4dfa14)]=new Cesium__namespace['CallbackProperty'](_0xbad3c9=>{const _0x5ee194=_0x567638;return this['_updateDraw'](),_0x5bfb7c['positions']=this[_0x5ee194(_0x4ad101._0x1c9960)],_0x5bfb7c;},![]);}else this['_entity']['polygon']['hierarchy']=new Cesium__namespace['PolygonHierarchy'](this['_positions']);}['_createFrustumPrimitive'](_0xa7169b){const _0x34eae5={_0x3bf547:0x6e9,_0x1fd1d7:0xe95,_0x2a0f32:0x9dc,_0x1a88a4:0x663,_0x14b491:0x5c3},_0x1620b7=_0x3d5d32,_0xb76719=_0xa7169b['directionWC'],_0x9ebdd1=_0xa7169b[_0x1620b7(0x8b0)];let _0x1639c8=_0xa7169b[_0x1620b7(_0x34eae5._0x3bf547)];_0x1639c8=Cesium__namespace[_0x1620b7(_0x34eae5._0x1fd1d7)]['negate'](_0x1639c8,new Cesium__namespace[(_0x1620b7(0xe95))]());const _0x360e94=new Cesium__namespace['Matrix3']();Cesium__namespace[_0x1620b7(_0x34eae5._0x2a0f32)]['setColumn'](_0x360e94,0x0,_0x1639c8,_0x360e94),Cesium__namespace[_0x1620b7(0x9dc)]['setColumn'](_0x360e94,0x1,_0x9ebdd1,_0x360e94),Cesium__namespace['Matrix3']['setColumn'](_0x360e94,0x2,_0xb76719,_0x360e94);const _0x501317=Cesium__namespace['Quaternion'][_0x1620b7(_0x34eae5._0x1a88a4)](_0x360e94,new Cesium__namespace['Quaternion']());this['_frustumPrimitive']&&this['_layer']['primitiveCollection']['remove'](this['_frustumPrimitive']),this['_frustumPrimitive']=new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace[(_0x1620b7(0x263))]({'id':this['id'],'geometry':new Cesium__namespace[(_0x1620b7(0x8e6))]({'origin':_0xa7169b[_0x1620b7(0xb69)],'orientation':_0x501317,'frustum':_0xa7169b['frustum'],'_drawNearPlane':!![]}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](Cesium__namespace[_0x1620b7(0x882)]['AZURE'])}}),'appearance':new Cesium__namespace[(_0x1620b7(0xc8e))]({'translucent':![],'flat':!![]}),'asynchronous':![],'show':this[_0x1620b7(_0x34eae5._0x14b491)]&&this['show']}),this['_layer']['primitiveCollection']['add'](this['_frustumPrimitive']);}['_style2JsonBase'](_0x59c729,_0x567581){const _0x50a558=_0x3d5d32,_0x10baef=getAttrVal(_0x59c729,{'onlySimpleType':!![]});return this[_0x50a558(0xdde)]['container']&&(_0x10baef['container']='document.getElementById('+this[_0x50a558(0x20c)]['id']+')'),_0x10baef;}['_getGeoJsonGeometry'](_0x5d98aa){const _0x2ebd91=_0x3d5d32;return{'type':'Point','coordinates':this['getCoordinate'](_0x5d98aa===null||_0x5d98aa===void 0x0?void 0x0:_0x5d98aa[_0x2ebd91(0xbcb)])};}['getCoordinate'](_0x379bab){const _0x2ca5e3={_0x4b8d1f:0xbbe,_0x95aec2:0x4d4},_0x36aeac=_0x3d5d32;return this[_0x36aeac(_0x2ca5e3._0x4b8d1f)]?this['point'][_0x36aeac(_0x2ca5e3._0x95aec2)](_0x379bab):[];}[_0x3d5d32(0x38d)](){const _0x59f7bb={_0xa44bae:0x1d1,_0x2e8845:0xe39},_0x794e54=_0x3d5d32;if(!this[_0x794e54(_0x59f7bb._0xa44bae)])return;this['_map']['camera']['setView']({'destination':this[_0x794e54(0xb69)],'orientation':{'heading':Cesium__namespace[_0x794e54(0x103e)][_0x794e54(0x562)](this[_0x794e54(_0x59f7bb._0x2e8845)]),'pitch':Cesium__namespace['Math']['toRadians'](this['pitch']),'roll':Cesium__namespace['Math']['toRadians'](this['roll'])}});}['startDraw'](_0x1f6f77){const _0x55226c={_0x22acfb:0xefc},_0x1ae8b1=_0x3d5d32;if(this['_enabledDraw'])return this;this['_enabledDraw']=!![];_0x1f6f77&&this['addTo'](_0x1f6f77);if(!this['_map'])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this['_map']['_setEditCursor'](!![]),this['enableControl'](![]),this['_startDrawHook'](),this[_0x1ae8b1(_0x55226c._0x22acfb)](EventType[_0x1ae8b1(0x105f)],{'drawtype':this[_0x1ae8b1(0x7f5)],'graphic':this},!![]);}[_0x3d5d32(0xf57)](){const _0x34eaac={_0x17a84f:0x6e3,_0x10234c:0x7f5,_0x285281:0x433},_0x4befca=_0x3d5d32;var _0x206121,_0x5e2bcd,_0x44b84f;if(!this['_enabledDraw'])return this;this['_stopDrawHook'](),this['_map']['_setEditCursor'](![]),this['enableControl'](!![]),this['_map'][_0x4befca(0xc62)](),this[_0x4befca(_0x34eaac._0x17a84f)]=![];if(!this['position']||!this['distance']){this['remove'](!![]);return;}this['fire'](EventType['drawCreated'],{'drawtype':this[_0x4befca(_0x34eaac._0x10234c)],'graphic':this},!![]),(_0x206121=this['options'])!==null&&_0x206121!==void 0x0&&_0x206121['success']&&this[_0x4befca(0x433)]['success'](this),(_0x5e2bcd=this[_0x4befca(_0x34eaac._0x285281)])!==null&&_0x5e2bcd!==void 0x0&&(_0x44b84f=_0x5e2bcd['_promise'])!==null&&_0x44b84f!==void 0x0&&_0x44b84f['resolve']&&this[_0x4befca(0x433)]['_promise']['resolve'](this);}['_startDrawHook'](){const _0x1c7cd2=_0x3d5d32;this[_0x1c7cd2(0x1d1)]['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this);}['_stopDrawHook'](){const _0x4d7249=_0x3d5d32;this['_map'][_0x4d7249(0x9e7)](EventType['click'],this['_onClickHandler'],this),this['_map'][_0x4d7249(0x9e7)](EventType['mouseMove'],this['_onMouseMoveHandler'],this);}['_onClickHandler'](_0x2bbf9f){const _0x12fef5={_0x47329a:0xb69},_0x3db42b=_0x3d5d32,_0x2ef144=_0x2bbf9f['cartesian'];if(!_0x2ef144)return;this['fire'](EventType['drawAddPoint'],{..._0x2bbf9f,'drawtype':this['type'],'graphic':this},!![]);if(!this[_0x3db42b(_0x12fef5._0x47329a)]){this['position']=_0x2ef144;return;}this['targetPosition']=_0x2ef144,this['stopDraw'](),this['fire'](EventType['drawCreated'],_0x2bbf9f);}['_onMouseMoveHandler'](_0x5cc6eb){const _0x4f7394={_0x441f90:0x4c1,_0x41c8ae:0x4a7,_0x4ff84e:0x1d1,_0x260da4:0x1d1,_0x2e05ea:0xd86},_0x3095c0=_0x3d5d32,_0x480d76=_0x5cc6eb[_0x3095c0(_0x4f7394._0x441f90)];if(!_0x480d76)return;const _0x31b80a=this['position'];_0x31b80a?(this['targetPosition']=_0x480d76,this['fire'](EventType[_0x3095c0(_0x4f7394._0x41c8ae)],{..._0x5cc6eb,'drawtype':this[_0x3095c0(0x7f5)],'graphic':this},!![]),this[_0x3095c0(0x1d1)]['openSmallTooltip'](_0x5cc6eb['endPosition'],this[_0x3095c0(_0x4f7394._0x4ff84e)]['getLangText']('_单击完成绘制'))):this[_0x3095c0(_0x4f7394._0x260da4)][_0x3095c0(_0x4f7394._0x2e05ea)](_0x5cc6eb[_0x3095c0(0xd13)],this['_map']['getLangText']('_单击开始绘制'));}}register$4('video2D',Video2D,!![]);class PitEntity extends BasePolyEntity{constructor(_0x276324={}){const _0x44962={_0x1b6bff:0x7a6},_0x2634b2=_0x3d5d32;super(_0x276324),this[_0x2634b2(0xdde)]['diffHeight']=this['style']['diffHeight']??0xa,this['style'][_0x2634b2(_0x44962._0x1b6bff)]=this['style']['splitNum']??0x32;}get[_0x3d5d32(0x9e2)](){const _0x2559f3={_0x2440f0:0xdde},_0x181cb0=_0x3d5d32;return this[_0x181cb0(_0x2559f3._0x2440f0)][_0x181cb0(0x9e2)];}set[_0x3d5d32(0x9e2)](_0xc13da8){const _0x1c7cb6={_0x3e2e95:0x9e2,_0x37df11:0x104e,_0x5e2e7a:0xbc5,_0x4c523d:0x89b},_0xc454c=_0x3d5d32;this['style'][_0xc454c(_0x1c7cb6._0x3e2e95)]=_0xc13da8;if(this['_entity']){const _0x55104e=this[_0xc454c(0x1cb)]-this['style']['diffHeight'];this['_entity'][_0xc454c(_0x1c7cb6._0x37df11)]['height']=_0x55104e;const _0x21769f=Array(this[_0xc454c(_0x1c7cb6._0x5e2e7a)][_0xc454c(0xc84)])['fill'](_0x55104e);this[_0xc454c(_0x1c7cb6._0x4c523d)]['wall']['minimumHeights']=_0x21769f;}}[_0x3d5d32(0xe4c)](){const _0x10b6a1={_0x308e3d:0x606,_0x4f5d7c:0xb0e,_0xb21349:0x1cb,_0x413fe7:0x51e},_0x151d7e=_0x3d5d32,_0x218939=this['options']['data']||this['_getPitData']();this['data']=_0x218939;const _0x3c7da2={'polygon':new Cesium__namespace[(_0x151d7e(0x45d))]({'hierarchy':new Cesium__namespace['PolygonHierarchy'](this['positions']),'perPositionHeight':![],'height':_0x218939['height'],'material':new Cesium__namespace[(_0x151d7e(_0x10b6a1._0x308e3d))]({'image':this['style']['imageBottom'],'repeat':new Cesium__namespace[(_0x151d7e(_0x10b6a1._0x4f5d7c))](0x2,0x2),'transparent':![]}),'fill':!![],'outline':![]}),'wall':{'positions':_0x218939['positionsWall'],'minimumHeights':_0x218939[_0x151d7e(0x53c)],'maximumHeights':_0x218939['maximumHeights'],'fill':!![],'material':new Cesium__namespace[(_0x151d7e(_0x10b6a1._0x308e3d))]({'image':this['style']['image'],'repeat':new Cesium__namespace[(_0x151d7e(0xb0e))](0x1,0x1)}),'outline':![]}};this['_entity']=this['_createEntity'](_0x3c7da2),this[_0x151d7e(_0x10b6a1._0xb21349)]=_0x218939[_0x151d7e(0xa28)],this['_positionsWall']=_0x218939['positionsWall'],this['_wallHeights']=_0x218939[_0x151d7e(_0x10b6a1._0x413fe7)],this[_0x151d7e(0xdde)]['label']&&this['_addLabel']();}['_getPitData'](){const _0x46c1e4={_0x4066f2:0xc84,_0x1c83b8:0xb75,_0x4793b9:0x9e2},_0x1effa2=_0x3d5d32,_0x456636=this['positions'],_0x1ae411=interPolyline({'scene':this['_map']['scene'],'positions':_0x456636['concat'](_0x456636[0x0]),'splitNum':this['style'][_0x1effa2(0x7a6)]}),_0x3e6222=[];let _0x4d9046=Number['MAX_VALUE'];for(let _0x398e85=0x0,_0x1c0106=_0x1ae411[_0x1effa2(_0x46c1e4._0x4066f2)];_0x398e85<_0x1c0106;_0x398e85++){const _0x5698be=Cesium__namespace['Cartographic']['fromCartesian'](_0x1ae411[_0x398e85]);_0x4d9046=Math['min'](_0x4d9046,_0x5698be['height']),_0x3e6222[_0x1effa2(_0x46c1e4._0x1c83b8)](_0x5698be['height']);}const _0x55377e=_0x4d9046-this['style'][_0x1effa2(_0x46c1e4._0x4793b9)],_0x1e333b=Array(_0x1ae411[_0x1effa2(0xc84)])['fill'](_0x55377e);return{'height':_0x55377e,'minHeight':_0x4d9046,'positionsWall':_0x1ae411,'minimumHeights':_0x1e333b,'maximumHeights':_0x3e6222};}['setUpHeight'](_0x21fef6){const _0x205f3f={_0x404c82:0x89b,_0x236354:0x65f},_0x29a9cc=_0x3d5d32,_0x4ff0db=this['_minHeight']-this['style']['diffHeight'],_0x1465a4=_0x4ff0db+_0x21fef6,_0x20c31a=[],_0x48726f=[];for(let _0x139bec=0x0,_0x2aeecd=this['_wallHeights']['length'];_0x139bec<_0x2aeecd;_0x139bec++){const _0x563385=this['_wallHeights'][_0x139bec];_0x48726f[_0x29a9cc(0xb75)](_0x563385+_0x21fef6),_0x20c31a['push'](_0x1465a4);}this['_entity']&&(this[_0x29a9cc(0x89b)]['polygon'][_0x29a9cc(0x83e)]=_0x4ff0db,this[_0x29a9cc(_0x205f3f._0x404c82)]['wall'][_0x29a9cc(0x53c)]=_0x20c31a,this['_entity'][_0x29a9cc(_0x205f3f._0x236354)]['maximumHeights']=_0x48726f);}}register$4('pitEntity',PitEntity);class AlgorithmUtil{constructor(){const _0x10c079={_0x25f2da:0x2bc},_0x792ee7=_0x3d5d32;this['HALF_PI']=Math['PI']/0x2,this[_0x792ee7(_0x10c079._0x25f2da)]=0.0001;}['toRadians'](_0x55b0e2){return _0x55b0e2*Math['PI']/0xb4;}['getThirdPoint'](_0x43204a,_0x35c620,_0x333ef3,_0x20b5dd,_0x4da0a5){const _0xa8436b={_0x28aff0:0x723},_0x393883=_0x3d5d32,_0x5419a4=this['getAzimuth'](_0x43204a,_0x35c620),_0x242d2f=_0x4da0a5?_0x5419a4+_0x333ef3:_0x5419a4-_0x333ef3,_0x2d640a=_0x20b5dd*Math['cos'](_0x242d2f),_0x49cafc=_0x20b5dd*Math[_0x393883(_0xa8436b._0x28aff0)](_0x242d2f);return[_0x35c620[0x0]+_0x2d640a,_0x35c620[0x1]+_0x49cafc];}[_0x3d5d32(0x403)](_0x5ce5e2,_0x5e7cde){const _0x3ef5d3=_0x3d5d32;let _0x1335f5=0x0;const _0x3a0024=Math['asin'](Math[_0x3ef5d3(0x4ba)](_0x5e7cde[0x1]-_0x5ce5e2[0x1])/this['MathDistance'](_0x5ce5e2,_0x5e7cde));if(_0x5e7cde[0x1]>=_0x5ce5e2[0x1]&&_0x5e7cde[0x0]>=_0x5ce5e2[0x0])_0x1335f5=_0x3a0024+Math['PI'];else{if(_0x5e7cde[0x1]>=_0x5ce5e2[0x1]&&_0x5e7cde[0x0]<_0x5ce5e2[0x0])_0x1335f5=Math['PI']*0x2-_0x3a0024;else{if(_0x5e7cde[0x1]<_0x5ce5e2[0x1]&&_0x5e7cde[0x0]<_0x5ce5e2[0x0])_0x1335f5=_0x3a0024;else _0x5e7cde[0x1]<_0x5ce5e2[0x1]&&_0x5e7cde[0x0]>=_0x5ce5e2[0x0]&&(_0x1335f5=Math['PI']-_0x3a0024);}}return _0x1335f5;}['MathDistance'](_0x35bd75,_0x3ed7eb){const _0xf67e40={_0x180d6b:0x1fb},_0x2e7266=_0x3d5d32;return Math['sqrt'](Math['pow'](_0x35bd75[0x0]-_0x3ed7eb[0x0],0x2)+Math[_0x2e7266(_0xf67e40._0x180d6b)](_0x35bd75[0x1]-_0x3ed7eb[0x1],0x2));}['isClockWise'](_0x36fe56,_0x418807,_0x1cf720){if(!_0x1cf720)return![];return(_0x1cf720[0x1]-_0x36fe56[0x1])*(_0x418807[0x0]-_0x36fe56[0x0])>(_0x418807[0x1]-_0x36fe56[0x1])*(_0x1cf720[0x0]-_0x36fe56[0x0]);}['getBisectorNormals'](_0x1a4ac6,_0x1a226c,_0x49e49d,_0x5139dd){const _0x1be264=this['getNormal'](_0x1a226c,_0x49e49d,_0x5139dd);let _0x4b6a44=null,_0x4bd14e=null,_0x3222ea=null,_0x5d8789=null,_0x1909d0=null;const _0x94666e=Math['sqrt'](_0x1be264[0x0]*_0x1be264[0x0]+_0x1be264[0x1]*_0x1be264[0x1]),_0x226381=_0x1be264[0x0]/_0x94666e,_0x5482ff=_0x1be264[0x1]/_0x94666e,_0x12f8ef=this['MathDistance'](_0x1a226c,_0x49e49d),_0x5b9c6c=this['MathDistance'](_0x49e49d,_0x5139dd);return _0x94666e>this['ZERO_TOLERANCE']?this['isClockWise'](_0x1a226c,_0x49e49d,_0x5139dd)?(_0x3222ea=_0x1a4ac6*_0x12f8ef,_0x5d8789=_0x49e49d[0x0]-_0x3222ea*_0x5482ff,_0x1909d0=_0x49e49d[0x1]+_0x3222ea*_0x226381,_0x4b6a44=[_0x5d8789,_0x1909d0],_0x3222ea=_0x1a4ac6*_0x5b9c6c,_0x5d8789=_0x49e49d[0x0]+_0x3222ea*_0x5482ff,_0x1909d0=_0x49e49d[0x1]-_0x3222ea*_0x226381,_0x4bd14e=[_0x5d8789,_0x1909d0]):(_0x3222ea=_0x1a4ac6*_0x12f8ef,_0x5d8789=_0x49e49d[0x0]+_0x3222ea*_0x5482ff,_0x1909d0=_0x49e49d[0x1]-_0x3222ea*_0x226381,_0x4b6a44=[_0x5d8789,_0x1909d0],_0x3222ea=_0x1a4ac6*_0x5b9c6c,_0x5d8789=_0x49e49d[0x0]-_0x3222ea*_0x5482ff,_0x1909d0=_0x49e49d[0x1]+_0x3222ea*_0x226381,_0x4bd14e=[_0x5d8789,_0x1909d0]):(_0x5d8789=_0x49e49d[0x0]+_0x1a4ac6*(_0x1a226c[0x0]-_0x49e49d[0x0]),_0x1909d0=_0x49e49d[0x1]+_0x1a4ac6*(_0x1a226c[0x1]-_0x49e49d[0x1]),_0x4b6a44=[_0x5d8789,_0x1909d0],_0x5d8789=_0x49e49d[0x0]+_0x1a4ac6*(_0x5139dd[0x0]-_0x49e49d[0x0]),_0x1909d0=_0x49e49d[0x1]+_0x1a4ac6*(_0x5139dd[0x1]-_0x49e49d[0x1]),_0x4bd14e=[_0x5d8789,_0x1909d0]),[_0x4b6a44,_0x4bd14e];}['getCubicValue'](_0x330dac,_0x4ae420,_0x319338,_0x5968bc,_0x5b2d25){const _0x13bc41={_0x7568a2:0xe8e},_0x1f355c=_0x3d5d32;_0x330dac=Math[_0x1f355c(_0x13bc41._0x7568a2)](Math['min'](_0x330dac,0x1),0x0);const _0x5c5d16=0x1-_0x330dac,_0x22e5ce=_0x330dac*_0x330dac,_0x103c1d=_0x22e5ce*_0x330dac,_0x54f465=_0x5c5d16*_0x5c5d16,_0x3bd01d=_0x54f465*_0x5c5d16,_0xf0c3d2=_0x3bd01d*_0x4ae420[0x0]+0x3*_0x54f465*_0x330dac*_0x319338[0x0]+0x3*_0x5c5d16*_0x22e5ce*_0x5968bc[0x0]+_0x103c1d*_0x5b2d25[0x0],_0x27a50b=_0x3bd01d*_0x4ae420[0x1]+0x3*_0x54f465*_0x330dac*_0x319338[0x1]+0x3*_0x5c5d16*_0x22e5ce*_0x5968bc[0x1]+_0x103c1d*_0x5b2d25[0x1];return[_0xf0c3d2,_0x27a50b];}['getNormal'](_0x185116,_0xe433d9,_0x3c9bf1){let _0x4d3ad2=_0x185116[0x0]-_0xe433d9[0x0],_0x426dd4=_0x185116[0x1]-_0xe433d9[0x1];const _0xe9a956=Math['sqrt'](_0x4d3ad2*_0x4d3ad2+_0x426dd4*_0x426dd4);_0x4d3ad2/=_0xe9a956,_0x426dd4/=_0xe9a956;let _0x1afbad=_0x3c9bf1[0x0]-_0xe433d9[0x0],_0x154189=_0x3c9bf1[0x1]-_0xe433d9[0x1];const _0x4a77a0=Math['sqrt'](_0x1afbad*_0x1afbad+_0x154189*_0x154189);_0x1afbad/=_0x4a77a0,_0x154189/=_0x4a77a0;const _0x45f4dc=_0x4d3ad2+_0x1afbad,_0xe93493=_0x426dd4+_0x154189;return[_0x45f4dc,_0xe93493];}[_0x3d5d32(0x57a)](_0x5ef97f,_0x33cc0e,_0x316a7c,_0x3c6b07){const _0xdb23c8={_0x56d381:0x256},_0x534191=_0x3d5d32;let _0x3d634b=null,_0x121d5e=null;const _0x2ea36f=[];let _0x5efa6a=_0x3c6b07-_0x316a7c;_0x5efa6a=_0x5efa6a<0x0?_0x5efa6a+Math['PI']*0x2:_0x5efa6a;for(let _0x23dbdb=0x0;_0x23dbdb<=0x64;_0x23dbdb++){const _0x460a61=_0x316a7c+_0x5efa6a*_0x23dbdb/0x64;_0x3d634b=_0x5ef97f[0x0]+_0x33cc0e*Math[_0x534191(_0xdb23c8._0x56d381)](_0x460a61),_0x121d5e=_0x5ef97f[0x1]+_0x33cc0e*Math['sin'](_0x460a61),_0x2ea36f['push']([_0x3d634b,_0x121d5e]);}return _0x2ea36f;}['getPointByAngleAndLen'](_0x126c8b,_0x382aa9,_0x2a134d){const _0x13502b=_0x3d5d32,_0x5f3df6=_0x126c8b[0x0]+_0x382aa9*Math[_0x13502b(0x256)](_0x2a134d),_0x320444=_0x126c8b[0x1]+_0x382aa9*Math['sin'](_0x2a134d);return[_0x5f3df6,_0x320444];}['getBaseLength'](_0x123065){const _0x568de5={_0x3f3c4d:0xe75},_0x434796=_0x3d5d32;return Math['pow'](this[_0x434796(_0x568de5._0x3f3c4d)](_0x123065),0.99);}['wholeDistance'](_0xcce0f6){let _0x396931=0x0;const _0x57c5fc=this;return _0xcce0f6&&Array['isArray'](_0xcce0f6)&&_0xcce0f6['length']>0x0&&_0xcce0f6['forEach'](function(_0x47af94,_0x4b4708){_0x4b4708<_0xcce0f6['length']-0x1&&(_0x396931+=_0x57c5fc['MathDistance'](_0x47af94,_0xcce0f6[_0x4b4708+0x1]));}),_0x396931;}['getArrowHeadPoints'](_0x3359c9){const _0x116fb5={_0x55b948:0xc84,_0x120cd4:0xc84},_0x174aa6=_0x3d5d32;if(!_0x3359c9)return[];const _0xbb21e4=_0x3359c9[_0x174aa6(0xbf8)];if(_0xbb21e4[_0x174aa6(_0x116fb5._0x55b948)]<0x2)return[];const _0x480c93=_0x3359c9['tailLeft'],_0x418c5d=_0x3359c9['tailRight'],_0x31c697=_0x3359c9['headTailFactor'],_0x481ff4=_0x3359c9['neckWidthFactor'],_0x19bf24=_0x3359c9['neckHeightFactor'],_0x7cd2a0=_0x3359c9['headWidthFactor'],_0x2ff3b6=_0x3359c9['headHeightFactor'];let _0x57de11=this['getBaseLength'](_0xbb21e4),_0xcafb0e=_0x57de11*_0x2ff3b6;const _0x14d2d4=_0xbb21e4[_0xbb21e4['length']-0x1];_0x57de11=this['MathDistance'](_0x14d2d4,_0xbb21e4[_0xbb21e4['length']-0x2]);const _0x709c12=this['MathDistance'](_0x480c93,_0x418c5d);_0xcafb0e>_0x709c12*_0x31c697&&(_0xcafb0e=_0x709c12*_0x31c697);const _0x30bf67=_0xcafb0e*_0x7cd2a0,_0x1f563c=_0xcafb0e*_0x481ff4;_0xcafb0e=_0xcafb0e>_0x57de11?_0x57de11:_0xcafb0e;const _0xc54d82=_0xcafb0e*_0x19bf24,_0x1dc6f1=this['getThirdPoint'](_0xbb21e4[_0xbb21e4[_0x174aa6(_0x116fb5._0x120cd4)]-0x2],_0x14d2d4,0x0,_0xcafb0e,!![]),_0x470e17=this['getThirdPoint'](_0xbb21e4[_0xbb21e4['length']-0x2],_0x14d2d4,0x0,_0xc54d82,!![]),_0x5cef21=this[_0x174aa6(0x88f)](_0x14d2d4,_0x1dc6f1,this['HALF_PI'],_0x30bf67,![]),_0x329797=this['getThirdPoint'](_0x14d2d4,_0x1dc6f1,this['HALF_PI'],_0x30bf67,!![]),_0x370b7c=this['getThirdPoint'](_0x14d2d4,_0x470e17,this['HALF_PI'],_0x1f563c,![]),_0x5cc5b9=this[_0x174aa6(0x88f)](_0x14d2d4,_0x470e17,this['HALF_PI'],_0x1f563c,!![]);return[_0x370b7c,_0x5cef21,_0x14d2d4,_0x329797,_0x5cc5b9];}['getTailPoints'](_0x432ce5){const _0x238413={_0x587653:0x5aa},_0x48ad50=_0x3d5d32;if(!_0x432ce5)return;const _0x180023=_0x432ce5['points'],_0x43c9d7=_0x432ce5['tailWidthFactor'],_0x35216b=_0x432ce5[_0x48ad50(0xd6b)],_0x43b8e0=this['getBaseLength'](_0x180023),_0x2fd518=_0x43b8e0*_0x43c9d7,_0x57e122=this['getThirdPoint'](_0x180023[0x1],_0x180023[0x0],this[_0x48ad50(_0x238413._0x587653)],_0x2fd518,![]),_0x2486d3=this['getThirdPoint'](_0x180023[0x1],_0x180023[0x0],this['HALF_PI'],_0x2fd518,!![]),_0x54818b=_0x2fd518*_0x35216b,_0x1f8d79=this['getThirdPoint'](_0x180023[0x1],_0x180023[0x0],0x0,_0x54818b,!![]);return[_0x57e122,_0x1f8d79,_0x2486d3];}['getArrowBodyPoints'](_0x242645,_0x400c19,_0x239df1,_0x256d49){const _0x5613d8={_0x1ed6ee:0xc84,_0x5f2954:0xc97},_0x2a2347=_0x3d5d32,_0x2910e0=this['wholeDistance'](_0x242645),_0x10f9e6=this['getBaseLength'](_0x242645),_0x332339=_0x10f9e6*_0x256d49,_0x1c2850=this['MathDistance'](_0x400c19,_0x239df1),_0x34305a=(_0x332339-_0x1c2850)/0x2;let _0x656fa5=0x0;const _0x227dad=[],_0x3a6bc5=[];for(let _0x2f3704=0x1;_0x2f3704<_0x242645[_0x2a2347(_0x5613d8._0x1ed6ee)]-0x1;_0x2f3704++){const _0x38df96=this['getAngleOfThreePoints'](_0x242645[_0x2f3704-0x1],_0x242645[_0x2f3704],_0x242645[_0x2f3704+0x1])/0x2;_0x656fa5+=this['MathDistance'](_0x242645[_0x2f3704-0x1],_0x242645[_0x2f3704]);const _0x50e939=(_0x332339/0x2-_0x656fa5/_0x2910e0*_0x34305a)/Math['sin'](_0x38df96),_0x11af24=this['getThirdPoint'](_0x242645[_0x2f3704-0x1],_0x242645[_0x2f3704],Math['PI']-_0x38df96,_0x50e939,!![]),_0x43160b=this['getThirdPoint'](_0x242645[_0x2f3704-0x1],_0x242645[_0x2f3704],_0x38df96,_0x50e939,![]);_0x227dad['push'](_0x11af24),_0x3a6bc5['push'](_0x43160b);}return _0x227dad[_0x2a2347(_0x5613d8._0x5f2954)](_0x3a6bc5);}[_0x3d5d32(0x9b7)](_0x21d949,_0x2195f7,_0x4882d6){const _0x1d6e87=_0x3d5d32,_0x33723e=this[_0x1d6e87(0x403)](_0x2195f7,_0x21d949)-this['getAzimuth'](_0x2195f7,_0x4882d6);return _0x33723e<0x0?_0x33723e+Math['PI']*0x2:_0x33723e;}['getQBSplinePoints'](_0x1122a4){const _0x3a7c00=_0x3d5d32;if(_0x1122a4['length']<=0x2)return _0x1122a4;else{const _0x461353=0x2,_0x125ed7=[],_0x17680a=_0x1122a4['length']-_0x461353-0x1;_0x125ed7['push'](_0x1122a4[0x0]);for(let _0x296ec7=0x0;_0x296ec7<=_0x17680a;_0x296ec7++){for(let _0x43c36e=0x0;_0x43c36e<=0x1;_0x43c36e+=0.05){let _0x2d1a17=0x0,_0x4ecb58=0x0;for(let _0x3be1b9=0x0;_0x3be1b9<=_0x461353;_0x3be1b9++){const _0x3f8c4b=this['getQuadricBSplineFactor'](_0x3be1b9,_0x43c36e);_0x2d1a17+=_0x3f8c4b*_0x1122a4[_0x296ec7+_0x3be1b9][0x0],_0x4ecb58+=_0x3f8c4b*_0x1122a4[_0x296ec7+_0x3be1b9][0x1];}_0x125ed7['push']([_0x2d1a17,_0x4ecb58]);}}return _0x125ed7['push'](_0x1122a4[_0x1122a4[_0x3a7c00(0xc84)]-0x1]),_0x125ed7;}}['getQuadricBSplineFactor'](_0x3a0e9c,_0x540907){const _0xd5a24c=_0x3d5d32;let _0x364ac9=0x0;if(_0x3a0e9c===0x0)_0x364ac9=Math['pow'](_0x540907-0x1,0x2)/0x2;else{if(_0x3a0e9c===0x1)_0x364ac9=(-0x2*Math[_0xd5a24c(0x1fb)](_0x540907,0x2)+0x2*_0x540907+0x1)/0x2;else _0x3a0e9c===0x2&&(_0x364ac9=Math['pow'](_0x540907,0x2)/0x2);}return _0x364ac9;}['Mid'](_0x408d63,_0x4e8c91){return[(_0x408d63[0x0]+_0x4e8c91[0x0])/0x2,(_0x408d63[0x1]+_0x4e8c91[0x1])/0x2,(_0x408d63[0x2]||0x0+_0x4e8c91[0x2]||0x0)/0x2];}[_0x3d5d32(0xc11)](_0x44fb38,_0x443f87,_0xfa7ec){const _0x12b836=_0x44fb38[0x2]||0x0,_0x12921e=[(_0x44fb38[0x0]+_0x443f87[0x0])/0x2,(_0x44fb38[0x1]+_0x443f87[0x1])/0x2,_0x12b836],_0x3190e0=[_0x12921e[0x0]-_0x44fb38[0x1]+_0x443f87[0x1],_0x12921e[0x1]+_0x44fb38[0x0]-_0x443f87[0x0],_0x12b836],_0x3052b2=[(_0x44fb38[0x0]+_0xfa7ec[0x0])/0x2,(_0x44fb38[0x1]+_0xfa7ec[0x1])/0x2,_0x12b836],_0x537ebd=[_0x3052b2[0x0]-_0x44fb38[0x1]+_0xfa7ec[0x1],_0x3052b2[0x1]+_0x44fb38[0x0]-_0xfa7ec[0x0],_0x12b836];return this['getIntersectPoint'](_0x12921e,_0x3190e0,_0x3052b2,_0x537ebd);}['getIntersectPoint'](_0x3f4e77,_0x5e0312,_0x2cca35,_0x4e1135){if(_0x3f4e77[0x1]===_0x5e0312[0x1]){const _0x5f1731=(_0x4e1135[0x0]-_0x2cca35[0x0])/(_0x4e1135[0x1]-_0x2cca35[0x1]),_0x4a4711=_0x5f1731*(_0x3f4e77[0x1]-_0x2cca35[0x1])+_0x2cca35[0x0],_0x494eea=_0x3f4e77[0x1];return[_0x4a4711,_0x494eea];}if(_0x2cca35[0x1]===_0x4e1135[0x1]){const _0x54e7f6=(_0x5e0312[0x0]-_0x3f4e77[0x0])/(_0x5e0312[0x1]-_0x3f4e77[0x1]),_0x49b5cd=_0x54e7f6*(_0x2cca35[0x1]-_0x3f4e77[0x1])+_0x3f4e77[0x0],_0x2d3c47=_0x2cca35[0x1];return[_0x49b5cd,_0x2d3c47];}const _0x196d0d=(_0x5e0312[0x0]-_0x3f4e77[0x0])/(_0x5e0312[0x1]-_0x3f4e77[0x1]),_0x519cf8=(_0x4e1135[0x0]-_0x2cca35[0x0])/(_0x4e1135[0x1]-_0x2cca35[0x1]),_0x433090=(_0x196d0d*_0x3f4e77[0x1]-_0x3f4e77[0x0]-_0x519cf8*_0x2cca35[0x1]+_0x2cca35[0x0])/(_0x196d0d-_0x519cf8),_0xe28ec9=_0x196d0d*_0x433090-_0x196d0d*_0x3f4e77[0x1]+_0x3f4e77[0x0];return[_0xe28ec9,_0x433090,_0x3f4e77[0x2]||0x0];}['getBezierPoints'](_0x1e9b56){const _0x18805a={_0x10b39b:0xc84,_0x5b6099:0x1fb},_0x380909=_0x3d5d32;if(_0x1e9b56[_0x380909(0xc84)]<=0x2)return _0x1e9b56;else{const _0x249f45=[],_0x234d21=_0x1e9b56[_0x380909(_0x18805a._0x10b39b)]-0x1;for(let _0x412cc5=0x0;_0x412cc5<=0x1;_0x412cc5+=0.01){let _0x16f875=0x0,_0x20980d=0x0;for(let _0x15d2cf=0x0;_0x15d2cf<=_0x234d21;_0x15d2cf++){const _0x47590a=this['getBinomialFactor'](_0x234d21,_0x15d2cf),_0x5befeb=Math[_0x380909(_0x18805a._0x5b6099)](_0x412cc5,_0x15d2cf),_0x5c7dc4=Math['pow'](0x1-_0x412cc5,_0x234d21-_0x15d2cf);_0x16f875+=_0x47590a*_0x5befeb*_0x5c7dc4*_0x1e9b56[_0x15d2cf][0x0],_0x20980d+=_0x47590a*_0x5befeb*_0x5c7dc4*_0x1e9b56[_0x15d2cf][0x1];}_0x249f45['push']([_0x16f875,_0x20980d]);}return _0x249f45;}}[_0x3d5d32(0xb82)](_0x1cafa1){let _0x35c585=0x1;switch(_0x1cafa1){case _0x1cafa1<=0x1:_0x35c585=0x1;break;case _0x1cafa1===0x2:_0x35c585=0x2;break;case _0x1cafa1===0x3:_0x35c585=0x6;break;case _0x1cafa1===0x18:_0x35c585=0x18;break;case _0x1cafa1===0x5:_0x35c585=0x78;break;default:for(let _0x341ca2=0x1;_0x341ca2<=_0x1cafa1;_0x341ca2++){_0x35c585*=_0x341ca2;}break;}return _0x35c585;}['getBinomialFactor'](_0x4d9ad3,_0xc7e76f){const _0x4f79fe={_0x164b2d:0xb82},_0x2d2ec7=_0x3d5d32;return this[_0x2d2ec7(_0x4f79fe._0x164b2d)](_0x4d9ad3)/(this['getFactorial'](_0xc7e76f)*this['getFactorial'](_0x4d9ad3-_0xc7e76f));}}const algorithmUtil=new AlgorithmUtil(),minAnalge=algorithmUtil[_0x3d5d32(0x562)](0x14),maxAnalge=algorithmUtil['toRadians'](0xa0);class ArrowParentUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['getMaxHeight'](_0x16a726){let _0x267e1b=_0x16a726[0x0][0x2]||0x0;for(let _0x15ffb1=0x0;_0x15ffb1<_0x16a726['length'];_0x15ffb1++){_0x16a726[0x2]>_0x267e1b&&(_0x267e1b=_0x16a726[0x2]);}return _0x267e1b;}['getArrowHeadPoints'](_0x3b45db,_0x51d4b9,_0x389695){const _0x107b53={_0x1c2f1c:0xc84,_0x558927:0x8e9,_0x2750b2:0xc8c,_0xd7ba70:0x88f,_0x2afc9b:0x8e9},_0x2e17ff=_0x3d5d32;if(!_0x3b45db||_0x3b45db[_0x2e17ff(_0x107b53._0x1c2f1c)]<0x2)return null;let _0x2619b9=this['algorithmUtil']['getBaseLength'](_0x3b45db)*this[_0x2e17ff(0x473)];const _0x3a4877=this[_0x2e17ff(_0x107b53._0x558927)]['MathDistance'](_0x51d4b9,_0x389695);_0x2619b9>_0x3a4877*this['headTailFactor']&&(_0x2619b9=_0x3a4877*this['headTailFactor']);const _0x33e039=_0x3b45db[_0x3b45db['length']-0x1],_0x5b478e=_0x3b45db[_0x3b45db['length']-0x2],_0x1f7814=this['algorithmUtil']['MathDistance'](_0x33e039,_0x5b478e);_0x2619b9=_0x2619b9>_0x1f7814?_0x1f7814:_0x2619b9;const _0x184d9d=_0x2619b9*this[_0x2e17ff(_0x107b53._0x2750b2)],_0x7b7572=_0x2619b9*this[_0x2e17ff(0x107b)],_0x2d0f33=_0x2619b9*this['neckHeightFactor'],_0x45ceff=this['algorithmUtil'][_0x2e17ff(0x88f)](_0x5b478e,_0x33e039,0x0,_0x2619b9,!![]),_0x49a4ae=this[_0x2e17ff(0x8e9)]['getThirdPoint'](_0x5b478e,_0x33e039,0x0,_0x2d0f33,!![]),_0xccf479=this['algorithmUtil'][_0x2e17ff(_0x107b53._0xd7ba70)](_0x33e039,_0x45ceff,Math['PI']/0x2,_0x184d9d,![]),_0x57288a=this[_0x2e17ff(0x8e9)][_0x2e17ff(_0x107b53._0xd7ba70)](_0x33e039,_0x45ceff,Math['PI']/0x2,_0x184d9d,!![]),_0x5e1188=this['algorithmUtil'][_0x2e17ff(0x88f)](_0x33e039,_0x49a4ae,Math['PI']/0x2,_0x7b7572,![]),_0x39ece2=this[_0x2e17ff(_0x107b53._0x2afc9b)]['getThirdPoint'](_0x33e039,_0x49a4ae,Math['PI']/0x2,_0x7b7572,!![]);return[_0x5e1188,_0xccf479,_0x33e039,_0x57288a,_0x39ece2];}['getArrowBodyPoints'](_0x1e0b7e,_0x53e505,_0x3f22b4,_0x57ca16){const _0xe8fc62={_0x5965a8:0x8e9,_0x27dcd3:0x8e9,_0x59b5bc:0xc97},_0x4df630=_0x3d5d32,_0x3aca4d=this[_0x4df630(_0xe8fc62._0x5965a8)]['wholeDistance'](_0x1e0b7e),_0x128ea8=this['algorithmUtil']['getBaseLength'](_0x1e0b7e),_0x43e440=_0x128ea8*_0x57ca16,_0x5adee8=this[_0x4df630(_0xe8fc62._0x5965a8)]['MathDistance'](_0x53e505,_0x3f22b4),_0x2bd8f3=(_0x43e440-_0x5adee8)/0x2;let _0x8c0a44=0x0;const _0x11b8e3=[],_0x532a9f=[];for(let _0x7e07a9=0x1;_0x7e07a9<_0x1e0b7e['length']-0x1;_0x7e07a9++){let _0x5cb6b9=this[_0x4df630(0x8e9)][_0x4df630(0x9b7)](_0x1e0b7e[_0x7e07a9-0x1],_0x1e0b7e[_0x7e07a9],_0x1e0b7e[_0x7e07a9+0x1])/0x2;if(_0x5cb6b9maxAnalge&&(_0x5cb6b9=maxAnalge);_0x8c0a44+=this['algorithmUtil'][_0x4df630(0xdec)](_0x1e0b7e[_0x7e07a9-0x1],_0x1e0b7e[_0x7e07a9]);const _0x4c9bce=(_0x43e440/0x2-_0x8c0a44/_0x3aca4d*_0x2bd8f3)/Math[_0x4df630(0x723)](_0x5cb6b9),_0x2c9ff0=this[_0x4df630(_0xe8fc62._0x27dcd3)]['getThirdPoint'](_0x1e0b7e[_0x7e07a9-0x1],_0x1e0b7e[_0x7e07a9],Math['PI']-_0x5cb6b9,_0x4c9bce,!![]),_0x517ffe=this['algorithmUtil']['getThirdPoint'](_0x1e0b7e[_0x7e07a9-0x1],_0x1e0b7e[_0x7e07a9],_0x5cb6b9,_0x4c9bce,![]);_0x11b8e3['push'](_0x2c9ff0),_0x532a9f[_0x4df630(0xb75)](_0x517ffe);}return _0x11b8e3[_0x4df630(_0xe8fc62._0x59b5bc)](_0x532a9f);}}class AttackArrowUtil extends ArrowParentUtil{['setOptions'](_0x2bb1b7={}){const _0x31dd31={_0x45d1c4:0xc8c},_0x355ef3=_0x3d5d32;this['headHeightFactor']=_0x2bb1b7['headHeightFactor']||0.18,this[_0x355ef3(_0x31dd31._0x45d1c4)]=_0x2bb1b7['headWidthFactor']||0.3,this['neckHeightFactor']=_0x2bb1b7[_0x355ef3(0x2c5)]||0.85,this['neckWidthFactor']=_0x2bb1b7['neckWidthFactor']||0.15,this['headTailFactor']=_0x2bb1b7[_0x355ef3(0xb97)]||0.8;}['startCompute'](_0x17498b,_0x1e77a0){const _0x341aec={_0x3a62d3:0x8e9,_0x13d007:0xdec,_0x1bf1b1:0x8e9},_0x3c4ae4=_0x3d5d32;if(!_0x17498b||_0x17498b['length']===0x0)return _0x17498b;this['positions']=_0x17498b,this[_0x3c4ae4(0x945)](_0x1e77a0);const _0x4ab6ee=cartesians2mercators(_0x17498b),_0x112fd7=this['getMaxHeight'](_0x4ab6ee),_0x1a3cbc=_0x4ab6ee[_0x4ab6ee['length']-0x1],_0x57c891=_0x4ab6ee[_0x4ab6ee[_0x3c4ae4(0xc84)]-0x2],_0x1e71e7=this[_0x3c4ae4(_0x341aec._0x3a62d3)][_0x3c4ae4(_0x341aec._0x13d007)](_0x1a3cbc,_0x57c891);_0x1e71e7<0x1&&_0x4ab6ee['length']>0x2&&_0x4ab6ee['splice'](_0x4ab6ee['length']-0x2,0x1);let _0x216f45=_0x4ab6ee[0x0],_0x2e3d95=_0x4ab6ee[0x1];this['algorithmUtil']['isClockWise'](_0x4ab6ee[0x0],_0x4ab6ee[0x1],_0x4ab6ee[0x2])&&(_0x216f45=_0x4ab6ee[0x1],_0x2e3d95=_0x4ab6ee[0x0]);const _0x15673a=this['algorithmUtil']['Mid'](_0x216f45,_0x2e3d95),_0x29f274=[_0x15673a]['concat'](_0x4ab6ee['slice'](0x2)),_0x52c48d=this[_0x3c4ae4(0xd23)](_0x29f274,_0x216f45,_0x2e3d95);if(!_0x52c48d||_0x52c48d['length']<0x4)return _0x17498b;const _0xeee70f=_0x52c48d[0x0],_0x33c087=_0x52c48d[0x4],_0x5f5391=this['algorithmUtil']['MathDistance'](_0x216f45,_0x2e3d95)/this['algorithmUtil']['getBaseLength'](_0x29f274),_0x1275c8=this['getArrowBodyPoints'](_0x29f274,_0xeee70f,_0x33c087,_0x5f5391),_0x3108cd=_0x1275c8['length'];let _0x5cb40b=[_0x216f45]['concat'](_0x1275c8['slice'](0x0,_0x3108cd/0x2));_0x5cb40b[_0x3c4ae4(0xb75)](_0xeee70f);let _0xfadb7b=[_0x2e3d95]['concat'](_0x1275c8['slice'](_0x3108cd/0x2,_0x3108cd));_0xfadb7b['push'](_0x33c087),_0x5cb40b=this[_0x3c4ae4(_0x341aec._0x1bf1b1)][_0x3c4ae4(0xf0d)](_0x5cb40b),_0xfadb7b=this['algorithmUtil'][_0x3c4ae4(0xf0d)](_0xfadb7b);const _0x1142d1=_0x5cb40b['concat'](_0x52c48d,_0xfadb7b['reverse']()),_0xfaf76=mercators2cartesians(_0x1142d1,_0x112fd7);return _0xfaf76;}}const attackArrowUtil$1=new AttackArrowUtil();class AttackArrow extends PolygonEntity{get['hasClosure'](){return![];}['getShowPositions'](_0x5781f3){const _0x40fa6e={_0x59e9a8:0xc84,_0x1d8c6b:0x6ab},_0x8306d5=_0x3d5d32;if(!_0x5781f3||_0x5781f3[_0x8306d5(_0x40fa6e._0x59e9a8)]<0x2)return _0x5781f3;return attackArrowUtil$1[_0x8306d5(_0x40fa6e._0x1d8c6b)](_0x5781f3,this['style']);}}register$4(_0x3d5d32(0x9bc),AttackArrow);class AttackArrowPWUtil extends ArrowParentUtil{['setOptions'](_0xab5a5a={}){const _0x6051a3={_0xe365e4:0xc8c,_0x22ac9c:0x107b,_0x38c9cc:0x379},_0x141abc=_0x3d5d32;this['headHeightFactor']=_0xab5a5a[_0x141abc(0x473)]||0.18,this[_0x141abc(_0x6051a3._0xe365e4)]=_0xab5a5a[_0x141abc(_0x6051a3._0xe365e4)]||0.3,this['neckHeightFactor']=_0xab5a5a['neckHeightFactor']||0.85,this[_0x141abc(0x107b)]=_0xab5a5a[_0x141abc(_0x6051a3._0x22ac9c)]||0.15,this[_0x141abc(_0x6051a3._0x38c9cc)]=_0xab5a5a[_0x141abc(0x379)]||0.1;}['startCompute'](_0x1e8938,_0x38bf33){const _0x2ae865={_0x7d4b8d:0x945,_0x3c94c7:0xf0d,_0x4fb6fa:0xf0d,_0x17b1ae:0x996},_0x5e5490=_0x3d5d32;if(!_0x1e8938||_0x1e8938['length']===0x0)return _0x1e8938;this['positions']=_0x1e8938,this[_0x5e5490(_0x2ae865._0x7d4b8d)](_0x38bf33);const _0xf93d4f=cartesians2mercators(_0x1e8938),_0x38a6f6=this['getMaxHeight'](_0xf93d4f),_0x28857b=this['getTailPoints'](_0xf93d4f),_0x578508=this['getArrowHeadPoints'](_0xf93d4f,_0x28857b[0x0],_0x28857b[0x1]);if(!_0x578508||_0x578508['length']<0x4)return _0x1e8938;const _0x5931ec=_0x578508[0x0],_0x34ad82=_0x578508[0x4],_0x2350cb=this['getArrowBodyPoints'](_0xf93d4f,_0x5931ec,_0x34ad82,this['tailWidthFactor']),_0x4f7fd7=_0x2350cb['length'];let _0xb51392=[_0x28857b[0x0]]['concat'](_0x2350cb[_0x5e5490(0x444)](0x0,_0x4f7fd7/0x2));_0xb51392['push'](_0x5931ec);let _0x345ee6=[_0x28857b[0x1]]['concat'](_0x2350cb[_0x5e5490(0x444)](_0x4f7fd7/0x2,_0x4f7fd7));_0x345ee6['push'](_0x34ad82),_0xb51392=this['algorithmUtil'][_0x5e5490(_0x2ae865._0x3c94c7)](_0xb51392),_0x345ee6=this['algorithmUtil'][_0x5e5490(_0x2ae865._0x4fb6fa)](_0x345ee6);const _0xf6b627=_0xb51392['concat'](_0x578508,_0x345ee6[_0x5e5490(_0x2ae865._0x17b1ae)]()),_0x5bce22=mercators2cartesians(_0xf6b627,_0x38a6f6);return _0x5bce22;}[_0x3d5d32(0xea5)](_0x29a081){const _0x29383d=_0x3d5d32,_0x554dd0=this['algorithmUtil']['getBaseLength'](_0x29a081),_0xc15acb=_0x554dd0*this['tailWidthFactor'],_0x2e0560=this['algorithmUtil']['getThirdPoint'](_0x29a081[0x1],_0x29a081[0x0],Math['PI']/0x2,_0xc15acb,![]),_0x5de4e3=this['algorithmUtil'][_0x29383d(0x88f)](_0x29a081[0x1],_0x29a081[0x0],Math['PI']/0x2,_0xc15acb,!![]);return[_0x2e0560,_0x5de4e3];}}const attackArrowPWUtil=new AttackArrowPWUtil();class AttackArrowPW extends PolygonEntity{get[_0x3d5d32(0x487)](){return![];}['getShowPositions'](_0x4a3809){const _0x213460={_0x32b4eb:0xdde},_0x3d1ec7=_0x3d5d32;if(!_0x4a3809||_0x4a3809['length']<0x2)return _0x4a3809;return attackArrowPWUtil['startCompute'](_0x4a3809,this[_0x3d1ec7(_0x213460._0x32b4eb)]);}static['getOutlinePositions'](_0x27ffd0,_0x2da1e7){const _0x5dcbb9=_0x3d5d32;if(!_0x27ffd0||_0x27ffd0['length']<0x2)return _0x27ffd0;return _0x27ffd0=LngLatArray[_0x5dcbb9(0x890)](_0x27ffd0),attackArrowPWUtil['startCompute'](_0x27ffd0,_0x2da1e7);}}register$4('attackArrowPW',AttackArrowPW);class AttackArrowYWUtil extends ArrowParentUtil{['setOptions'](_0x5a1cb0={}){const _0x290d9f={_0x24fb04:0x473,_0x578b0a:0x107b},_0x50b711=_0x3d5d32;this[_0x50b711(_0x290d9f._0x24fb04)]=_0x5a1cb0['headHeightFactor']||0.18,this['headWidthFactor']=_0x5a1cb0['headWidthFactor']||0.3,this['neckHeightFactor']=_0x5a1cb0['neckHeightFactor']||0.85,this['neckWidthFactor']=_0x5a1cb0[_0x50b711(_0x290d9f._0x578b0a)]||0.15,this[_0x50b711(0x379)]=_0x5a1cb0['tailWidthFactor']||0.1,this['headTailFactor']=_0x5a1cb0['headTailFactor']||0.8,this[_0x50b711(0xd6b)]=_0x5a1cb0['swallowTailFactor']||0x1;}['startCompute'](_0x4b374d,_0x331235){const _0x44580c={_0x44f135:0xc84,_0x2dba26:0xf0d},_0x45f717=_0x3d5d32;if(!_0x4b374d||_0x4b374d[_0x45f717(_0x44580c._0x44f135)]===0x0)return _0x4b374d;this['positions']=_0x4b374d,this['setOptions'](_0x331235);const _0x1d74b3=cartesians2mercators(_0x4b374d),_0x119e9b=this['getMaxHeight'](_0x1d74b3),_0x1b711c=[_0x1d74b3[0x0],_0x1d74b3[0x1]];let _0x1db0dd=_0x1b711c[0x0],_0x495cdf=_0x1b711c[0x1];this['algorithmUtil']['isClockWise'](_0x1d74b3[0x0],_0x1d74b3[0x1],_0x1d74b3[0x2])&&(_0x1db0dd=_0x1d74b3[0x1],_0x495cdf=_0x1d74b3[0x0]);const _0x1af423=this[_0x45f717(0x8e9)]['Mid'](_0x1db0dd,_0x495cdf),_0x488bc9=[_0x1af423]['concat'](_0x1d74b3['slice'](0x2)),_0x2200fb=this['getArrowHeadPoints'](_0x488bc9,_0x1db0dd,_0x495cdf);if(!_0x2200fb||_0x2200fb[_0x45f717(0xc84)]<0x4)return _0x4b374d;const _0x467e60=[_0x2200fb[0x0],_0x2200fb[0x4]],_0xaf93f6=_0x467e60[0x0],_0x2dab1f=_0x467e60[0x1],_0x40aebf=this['algorithmUtil']['MathDistance'](_0x1db0dd,_0x495cdf),_0x24894d=this['algorithmUtil']['getBaseLength'](_0x488bc9),_0x58d080=_0x24894d*this['tailWidthFactor']*this['swallowTailFactor'],_0x483325=this['algorithmUtil'][_0x45f717(0x88f)](_0x488bc9[0x1],_0x488bc9[0x0],0x0,_0x58d080,!![]),_0x3515f0=_0x40aebf/_0x24894d,_0x589279=this['getArrowBodyPoints'](_0x488bc9,_0xaf93f6,_0x2dab1f,_0x3515f0),_0x1c9e2d=_0x589279['length'];let _0xeb8b3f=[_0x1db0dd][_0x45f717(0xc97)](_0x589279['slice'](0x0,_0x1c9e2d/0x2));_0xeb8b3f['push'](_0xaf93f6);let _0x5993e2=[_0x495cdf][_0x45f717(0xc97)](_0x589279['slice'](_0x1c9e2d/0x2,_0x1c9e2d));_0x5993e2['push'](_0x2dab1f),_0xeb8b3f=this[_0x45f717(0x8e9)][_0x45f717(_0x44580c._0x2dba26)](_0xeb8b3f),_0x5993e2=this['algorithmUtil']['getQBSplinePoints'](_0x5993e2);const _0x33654a=_0xeb8b3f['concat'](_0x2200fb,_0x5993e2['reverse'](),[_0x483325,_0xeb8b3f[0x0]]),_0x100b7a=mercators2cartesians(_0x33654a,_0x119e9b);return _0x100b7a;}}const attackArrowUtil=new AttackArrowYWUtil();class AttackArrowYW extends PolygonEntity{get['hasClosure'](){return![];}['getShowPositions'](_0x3e119d){const _0x1527fa=_0x3d5d32;if(!_0x3e119d||_0x3e119d[_0x1527fa(0xc84)]<0x3)return _0x3e119d;return attackArrowUtil['startCompute'](_0x3e119d,this['style']);}static[_0x3d5d32(0xdd7)](_0x39cdf0,_0xaa03ef){const _0x5cc0ca=_0x3d5d32;if(!_0x39cdf0||_0x39cdf0['length']<0x3)return _0x39cdf0;return _0x39cdf0=LngLatArray[_0x5cc0ca(0x890)](_0x39cdf0),attackArrowUtil[_0x5cc0ca(0x6ab)](_0x39cdf0,_0xaa03ef);}}register$4('attackArrowYW',AttackArrowYW);class CloseCurveUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['startCompute'](_0x135a5b,_0x259871){const _0x144ab2={_0x2dcbec:0xc84,_0x27e61e:0xb75},_0x2e88e7=_0x3d5d32;if(!_0x135a5b||_0x135a5b['length']===0x0)return _0x135a5b;this['positions']=_0x135a5b;const _0x54bc5f=cartesians2mercators(_0x135a5b),_0x555643=this['getMaxHeight'](_0x54bc5f);_0x54bc5f['push'](_0x54bc5f[0x0],_0x54bc5f[0x1]);let _0x454df4=[];const _0x371467=[];for(let _0x6069b8=0x0;_0x6069b8<_0x54bc5f[_0x2e88e7(0xc84)]-0x2;_0x6069b8++){const _0x223cc8=this['algorithmUtil']['getBisectorNormals'](0.3,_0x54bc5f[_0x6069b8],_0x54bc5f[_0x6069b8+0x1],_0x54bc5f[_0x6069b8+0x2]);_0x454df4=_0x454df4['concat'](_0x223cc8);}const _0x31d681=_0x454df4[_0x2e88e7(_0x144ab2._0x2dcbec)];_0x454df4=[_0x454df4[_0x31d681-0x1]]['concat'](_0x454df4['slice'](0x0,_0x31d681-0x1));for(let _0x54cbad=0x0;_0x54cbad<_0x54bc5f[_0x2e88e7(_0x144ab2._0x2dcbec)]-0x2;_0x54cbad++){const _0xf71032=_0x54bc5f[_0x54cbad],_0x442804=_0x54bc5f[_0x54cbad+0x1];_0x371467[_0x2e88e7(_0x144ab2._0x27e61e)](_0xf71032);for(let _0x2fea2a=0x0;_0x2fea2a<=0x64;_0x2fea2a++){const _0x1efde3=this['algorithmUtil']['getCubicValue'](_0x2fea2a/0x64,_0xf71032,_0x454df4[_0x54cbad*0x2],_0x454df4[_0x54cbad*0x2+0x1],_0x442804);_0x371467[_0x2e88e7(_0x144ab2._0x27e61e)](_0x1efde3);}_0x371467['push'](_0x442804);}const _0x2b3bd4=mercators2cartesians(_0x371467,_0x555643);return _0x2b3bd4;}[_0x3d5d32(0xe5a)](_0x5ec2a8){const _0x23a896={_0x3a63dd:0xc84},_0x3c21a1=_0x3d5d32;let _0x3477ec=_0x5ec2a8[0x0][0x2]||0x0;for(let _0x3a12c4=0x0;_0x3a12c4<_0x5ec2a8[_0x3c21a1(_0x23a896._0x3a63dd)];_0x3a12c4++){_0x5ec2a8[0x2]>_0x3477ec&&(_0x3477ec=_0x5ec2a8[0x2]);}return _0x3477ec;}}const closeCurveUtil=new CloseCurveUtil();class CloseVurve extends PolygonEntity{['getShowPositions'](_0x566eb8){const _0x3431c8={_0x5541d4:0x6ab},_0x5bc828=_0x3d5d32;if(!_0x566eb8||_0x566eb8['length']<0x2)return _0x566eb8;return closeCurveUtil[_0x5bc828(_0x3431c8._0x5541d4)](_0x566eb8,this['style']);}static['getOutlinePositions'](_0x27edde,_0x5830c9){const _0x463fe6={_0x6524c8:0xc84,_0x41c528:0x890},_0x4bb48b=_0x3d5d32;if(!_0x27edde||_0x27edde[_0x4bb48b(_0x463fe6._0x6524c8)]<0x2)return _0x27edde;return _0x27edde=LngLatArray[_0x4bb48b(_0x463fe6._0x41c528)](_0x27edde),closeCurveUtil['startCompute'](_0x27edde,_0x5830c9);}}register$4('closeVurve',CloseVurve);class DoubleArrowUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['setOptions'](_0x3b381a={}){const _0x267a06={_0x24b8ca:0x473},_0x45f41c=_0x3d5d32;this[_0x45f41c(0x473)]=_0x3b381a[_0x45f41c(_0x267a06._0x24b8ca)]||0.25,this['headWidthFactor']=_0x3b381a['headWidthFactor']||0.3,this['neckHeightFactor']=_0x3b381a[_0x45f41c(0x2c5)]||0.85,this['neckWidthFactor']=_0x3b381a['neckWidthFactor']||0.15;}['startCompute'](_0x44ea12,_0x51fb55){const _0x56bb42={_0x526dfa:0x945,_0x1333e7:0xbb8,_0xc90237:0x8e9,_0x4bd30c:0x97e},_0x484386=_0x3d5d32;if(!_0x44ea12||_0x44ea12['length']<0x3)return _0x44ea12;this[_0x484386(0xbb8)]=_0x44ea12,this[_0x484386(_0x56bb42._0x526dfa)](_0x51fb55);const _0x1180df=cartesians2mercators(_0x44ea12),_0x4d4b82=this['getMaxHeight'](_0x1180df),_0x4bacba=[_0x1180df[0x0],_0x1180df[0x1],_0x1180df[0x2]],_0x2b7be5=_0x4bacba[0x0],_0x3f4051=_0x4bacba[0x1],_0x357e82=_0x4bacba[0x2],_0x3710c1=this[_0x484386(_0x56bb42._0x1333e7)]['length'];let _0x5809f5,_0x3b190b;if(_0x3710c1===0x3)_0x5809f5=this['getTempPoint4'](_0x2b7be5,_0x3f4051,_0x357e82),_0x3b190b=this['algorithmUtil']['Mid'](_0x2b7be5,_0x3f4051);else{if(_0x3710c1===0x4)_0x5809f5=_0x1180df[0x3],_0x3b190b=this['algorithmUtil'][_0x484386(0xbca)](_0x2b7be5,_0x3f4051);else{const _0x2a94ae=this[_0x484386(_0x56bb42._0xc90237)]['MathDistance'](_0x1180df[0x3],_0x1180df[0x4]),_0x48ba6c=this[_0x484386(0x8e9)]['MathDistance'](_0x1180df[0x2],_0x1180df[0x3]);_0x2a94ae<_0x48ba6c*0.1?(_0x5809f5=_0x1180df[0x3],_0x3b190b=this['algorithmUtil']['Mid'](_0x2b7be5,_0x3f4051)):(_0x5809f5=_0x1180df[0x3],_0x3b190b=_0x1180df[0x4]);}}let _0x1e2f51,_0x3ca66b;this['algorithmUtil']['isClockWise'](_0x2b7be5,_0x3f4051,_0x357e82)?(_0x1e2f51=this[_0x484386(0x97e)](_0x2b7be5,_0x3b190b,_0x5809f5,![]),_0x3ca66b=this[_0x484386(_0x56bb42._0x4bd30c)](_0x3b190b,_0x3f4051,_0x357e82,!![])):(_0x1e2f51=this[_0x484386(0x97e)](_0x3f4051,_0x3b190b,_0x357e82,![]),_0x3ca66b=this['getArrowPoints'](_0x3b190b,_0x2b7be5,_0x5809f5,!![]));const _0x5b7788=_0x1e2f51['length'],_0x12979f=(_0x5b7788-0x5)/0x2,_0x1fb87b=_0x1e2f51['slice'](0x0,_0x12979f),_0x5e5049=_0x1e2f51['slice'](_0x12979f,_0x12979f+0x5);let _0x2b1f72=_0x1e2f51['slice'](_0x12979f+0x5,_0x5b7788),_0x5c35c4=_0x3ca66b['slice'](0x0,_0x12979f);const _0x21e3ee=_0x3ca66b['slice'](_0x12979f,_0x12979f+0x5),_0xc725e5=_0x3ca66b['slice'](_0x12979f+0x5,_0x5b7788);_0x5c35c4=this['algorithmUtil'][_0x484386(0x57c)](_0x5c35c4);const _0x4d8315=this[_0x484386(0x8e9)][_0x484386(0x57c)](_0xc725e5['concat'](_0x1fb87b['slice'](0x1)));_0x2b1f72=this[_0x484386(_0x56bb42._0xc90237)]['getBezierPoints'](_0x2b1f72);const _0x435c60=_0x5c35c4[_0x484386(0xc97)](_0x21e3ee,_0x4d8315,_0x5e5049,_0x2b1f72),_0x3a1aa5=mercators2cartesians(_0x435c60,_0x4d4b82);return _0x3a1aa5;}[_0x3d5d32(0xab4)](_0x13bd6b,_0x230fb1,_0x3da1b0){const _0x5822ef={_0x2d7b85:0x8e9,_0x319dc5:0x723,_0x3aa12c:0x88f,_0x2d8b28:0x8e9},_0x3785fa=_0x3d5d32,_0x298c14=this['algorithmUtil']['Mid'](_0x13bd6b,_0x230fb1),_0x2e854d=this[_0x3785fa(_0x5822ef._0x2d7b85)]['MathDistance'](_0x298c14,_0x3da1b0),_0x4628ff=this['algorithmUtil'][_0x3785fa(0x9b7)](_0x13bd6b,_0x298c14,_0x3da1b0);let _0x33a72d,_0x3568ac,_0x23e470,_0x12415e;if(_0x4628ff=Math['PI']/0x2&&_0x4628ff=Math['PI']&&_0x4628ff0x3){const _0x321c33=[_0x580f8[0x0],_0x580f8[0x4]],_0x2cbe2c=_0x321c33[0x0],_0x3dea67=_0x321c33[0x1],_0x595baa=this['algorithmUtil']['MathDistance'](_0x30835e,_0x3a5509)/this['algorithmUtil'][_0x46ad8e(0x41a)](_0x2c8b2b)/0x2,_0x3475f1=this['getArrowBodyPoints'](_0x2c8b2b,_0x2cbe2c,_0x3dea67,_0x595baa);if(_0x3475f1){const _0xf85284=_0x3475f1[_0x46ad8e(0xc84)];let _0x1b44a3=_0x3475f1['slice'](0x0,_0xf85284/0x2),_0x2cad88=_0x3475f1['slice'](_0xf85284/0x2,_0xf85284);return _0x1b44a3['push'](_0x2cbe2c),_0x2cad88[_0x46ad8e(0xb75)](_0x3dea67),_0x1b44a3=_0x1b44a3['reverse'](),_0x1b44a3['push'](_0x3a5509),_0x2cad88=_0x2cad88[_0x46ad8e(0x996)](),_0x2cad88['push'](_0x30835e),_0x1b44a3['reverse']()['concat'](_0x580f8,_0x2cad88);}}else console[_0x46ad8e(0x7b1)]('getArrowPoints:插值出错',_0x580f8);}['getArrowHeadPoints'](_0x1d271c){const _0x2ee566={_0x18ce82:0xc84,_0x1a54f7:0x8e9,_0x2c915e:0x88f,_0x38c60e:0x8e9},_0x70faa0=_0x3d5d32;if(!_0x1d271c||_0x1d271c[_0x70faa0(_0x2ee566._0x18ce82)]<0x2)return[];const _0x37b732=this['algorithmUtil'][_0x70faa0(0x41a)](_0x1d271c),_0x4e6f47=_0x37b732*this['headHeightFactor'],_0x23c32a=_0x1d271c[_0x1d271c['length']-0x1],_0x56ee7d=_0x4e6f47*this['headWidthFactor'],_0x1624c4=_0x4e6f47*this['neckWidthFactor'],_0x45fa31=_0x4e6f47*this['neckHeightFactor'],_0x38e5df=this[_0x70faa0(_0x2ee566._0x1a54f7)]['getThirdPoint'](_0x1d271c[_0x1d271c['length']-0x2],_0x23c32a,0x0,_0x4e6f47,!![]),_0x7049bd=this['algorithmUtil']['getThirdPoint'](_0x1d271c[_0x1d271c[_0x70faa0(_0x2ee566._0x18ce82)]-0x2],_0x23c32a,0x0,_0x45fa31,!![]),_0x213de9=this['algorithmUtil'][_0x70faa0(_0x2ee566._0x2c915e)](_0x23c32a,_0x38e5df,Math['PI']/0x2,_0x56ee7d,![]),_0x59cca1=this[_0x70faa0(_0x2ee566._0x38c60e)]['getThirdPoint'](_0x23c32a,_0x38e5df,Math['PI']/0x2,_0x56ee7d,!![]),_0x45bc18=this['algorithmUtil']['getThirdPoint'](_0x23c32a,_0x7049bd,Math['PI']/0x2,_0x1624c4,![]),_0x5a077b=this['algorithmUtil']['getThirdPoint'](_0x23c32a,_0x7049bd,Math['PI']/0x2,_0x1624c4,!![]);return[_0x45bc18,_0x213de9,_0x23c32a,_0x59cca1,_0x5a077b];}['getArrowBodyPoints'](_0x51e629,_0xbbce43,_0x4e304e,_0x4b9abc){const _0x1089c1={_0x13b7c6:0xc84,_0xeefc3c:0x9b7,_0x2cf437:0x8e9,_0x1ebc07:0xdec,_0xf5c6b2:0xb75},_0x2c2e77=_0x3d5d32,_0x5694b5=this['algorithmUtil']['wholeDistance'](_0x51e629),_0x40d354=this[_0x2c2e77(0x8e9)][_0x2c2e77(0x41a)](_0x51e629),_0xc0dc57=_0x40d354*_0x4b9abc,_0x3cea49=this['algorithmUtil']['MathDistance'](_0xbbce43,_0x4e304e),_0x1d82a6=(_0xc0dc57-_0x3cea49)/0x2;let _0x36dbca=0x0;const _0x1ef022=[],_0xf097db=[];for(let _0x1dc569=0x1;_0x1dc569<_0x51e629[_0x2c2e77(_0x1089c1._0x13b7c6)]-0x1;_0x1dc569++){const _0x372207=this['algorithmUtil'][_0x2c2e77(_0x1089c1._0xeefc3c)](_0x51e629[_0x1dc569-0x1],_0x51e629[_0x1dc569],_0x51e629[_0x1dc569+0x1])/0x2;_0x36dbca+=this[_0x2c2e77(_0x1089c1._0x2cf437)][_0x2c2e77(_0x1089c1._0x1ebc07)](_0x51e629[_0x1dc569-0x1],_0x51e629[_0x1dc569]);const _0x42970e=(_0xc0dc57/0x2-_0x36dbca/_0x5694b5*_0x1d82a6)/Math['sin'](_0x372207),_0x2adb0a=this['algorithmUtil']['getThirdPoint'](_0x51e629[_0x1dc569-0x1],_0x51e629[_0x1dc569],Math['PI']-_0x372207,_0x42970e,!![]),_0xc5426=this['algorithmUtil']['getThirdPoint'](_0x51e629[_0x1dc569-0x1],_0x51e629[_0x1dc569],_0x372207,_0x42970e,![]);_0x1ef022[_0x2c2e77(0xb75)](_0x2adb0a),_0xf097db[_0x2c2e77(_0x1089c1._0xf5c6b2)](_0xc5426);}return _0x1ef022['concat'](_0xf097db);}[_0x3d5d32(0xe5a)](_0x49750b){let _0xe5da=_0x49750b[0x0][0x2]||0x0;for(let _0x114e83=0x0;_0x114e83<_0x49750b['length'];_0x114e83++){_0x49750b[0x2]>_0xe5da&&(_0xe5da=_0x49750b[0x2]);}return _0xe5da;}}const doubleArrowUtil=new DoubleArrowUtil();class DoubleArrow extends PolygonEntity{constructor(_0x5b5afe={}){super(_0x5b5afe),this['_minPointNum']=0x3,this['_maxPointNum']=0x5;}['getShowPositions'](_0xbfd0ea){const _0x10ff93={_0x36f6b5:0xc84,_0xfbcb6c:0xdde},_0x71926e=_0x3d5d32;if(!_0xbfd0ea||_0xbfd0ea[_0x71926e(_0x10ff93._0x36f6b5)]_0x136a3c&&(_0x136a3c=_0x19b943[0x2]);}return _0x136a3c;}}const fineArrowUtil=new FineArrowUtil();class FineArrow extends PolygonEntity{constructor(_0x4ed3e0={}){const _0x24c40a=_0x3d5d32;super(_0x4ed3e0),this['_minPointNum']=0x2,this[_0x24c40a(0x46e)]=0x2;}[_0x3d5d32(0x7f0)](_0x5cb9e1){const _0x239073=_0x3d5d32;if(!_0x5cb9e1||_0x5cb9e1[_0x239073(0xc84)]<0x2)return _0x5cb9e1;return fineArrowUtil['startCompute'](_0x5cb9e1,this['style']);}static['getOutlinePositions'](_0x4f66a1,_0x598301){if(!_0x4f66a1||_0x4f66a1['length']<0x2)return _0x4f66a1;return _0x4f66a1=LngLatArray['toCartesians'](_0x4f66a1),fineArrowUtil['startCompute'](_0x4f66a1,_0x598301);}}register$4('fineArrow',FineArrow);class FineArrowYWUtil extends ArrowParentUtil{['setOptions'](_0x12535e={}){const _0xf06315={_0x2ade87:0x473,_0x1bb65c:0x2c5,_0x4d55eb:0xd6b},_0x3ba0a3=_0x3d5d32;this['headHeightFactor']=_0x12535e[_0x3ba0a3(_0xf06315._0x2ade87)]||0.18,this['headWidthFactor']=_0x12535e['headWidthFactor']||0.3,this['neckHeightFactor']=_0x12535e[_0x3ba0a3(_0xf06315._0x1bb65c)]||0.85,this['neckWidthFactor']=_0x12535e['neckWidthFactor']||0.15,this['tailWidthFactor']=_0x12535e['tailWidthFactor']||0.1,this[_0x3ba0a3(_0xf06315._0x4d55eb)]=_0x12535e['swallowTailFactor']||0x1;}['startCompute'](_0xea7ff4,_0x2d348d){const _0xe2cba1={_0x2ada5b:0xd23,_0x14c0ac:0xc84,_0x1e98ee:0x79c,_0x312325:0xc97,_0x27e804:0xf0d,_0x443d6f:0xf0d},_0x1b9679=_0x3d5d32;if(!_0xea7ff4||_0xea7ff4[_0x1b9679(0xc84)]===0x0)return _0xea7ff4;this['positions']=_0xea7ff4,this['setOptions'](_0x2d348d);const _0xbd7e96=cartesians2mercators(_0xea7ff4),_0x11b81b=this['getMaxHeight'](_0xbd7e96),_0x14d927=this[_0x1b9679(0xea5)](_0xbd7e96),_0x1890ce=this[_0x1b9679(_0xe2cba1._0x2ada5b)](_0xbd7e96,_0x14d927[0x0],_0x14d927[0x2]);if(!_0x1890ce||_0x1890ce[_0x1b9679(_0xe2cba1._0x14c0ac)]<0x4)return _0xea7ff4;const _0x3be0b6=_0x1890ce[0x0],_0xe0e927=_0x1890ce[0x4],_0x47bd29=this[_0x1b9679(_0xe2cba1._0x1e98ee)](_0xbd7e96,_0x3be0b6,_0xe0e927,this['tailWidthFactor']),_0x3d9ecd=_0x47bd29['length'];let _0x34434f=[_0x14d927[0x0]]['concat'](_0x47bd29['slice'](0x0,_0x3d9ecd/0x2));_0x34434f['push'](_0x3be0b6);let _0x343cc5=[_0x14d927[0x2]][_0x1b9679(_0xe2cba1._0x312325)](_0x47bd29['slice'](_0x3d9ecd/0x2,_0x3d9ecd));_0x343cc5['push'](_0xe0e927),_0x34434f=this['algorithmUtil'][_0x1b9679(_0xe2cba1._0x27e804)](_0x34434f),_0x343cc5=this['algorithmUtil'][_0x1b9679(_0xe2cba1._0x443d6f)](_0x343cc5);const _0x443b54=_0x34434f['concat'](_0x1890ce,_0x343cc5['reverse'](),[_0x14d927[0x1],_0x34434f[0x0]]),_0x4ad318=mercators2cartesians(_0x443b54,_0x11b81b);return _0x4ad318;}['getTailPoints'](_0x306087){const _0x131126={_0x2941db:0x379},_0x365d16=_0x3d5d32,_0x5d819b=this[_0x365d16(0x8e9)][_0x365d16(0x41a)](_0x306087),_0x1ac995=_0x5d819b*this[_0x365d16(_0x131126._0x2941db)],_0x50e0d3=this[_0x365d16(0x8e9)]['getThirdPoint'](_0x306087[0x1],_0x306087[0x0],Math['PI']/0x2,_0x1ac995,![]),_0x3982fa=this[_0x365d16(0x8e9)]['getThirdPoint'](_0x306087[0x1],_0x306087[0x0],Math['PI']/0x2,_0x1ac995,!![]),_0x29a9f5=_0x1ac995*this['swallowTailFactor'],_0x10c13e=this['algorithmUtil'][_0x365d16(0x88f)](_0x306087[0x1],_0x306087[0x0],0x0,_0x29a9f5,!![]);return[_0x50e0d3,_0x10c13e,_0x3982fa];}}const fineArrowYWUtil=new FineArrowYWUtil();class FineArrowYW extends PolygonEntity{constructor(_0x584424={}){super(_0x584424),this['_minPointNum']=0x2,this['_maxPointNum']=0x2;}['getShowPositions'](_0x1a96ac){const _0x41d6ab=_0x3d5d32;if(!_0x1a96ac||_0x1a96ac['length']<0x2)return _0x1a96ac;return fineArrowYWUtil[_0x41d6ab(0x6ab)](_0x1a96ac,this['style']);}static[_0x3d5d32(0xdd7)](_0xdd429b,_0x96ac90){const _0x1005aa={_0xeaf508:0xc84},_0x5c4555=_0x3d5d32;if(!_0xdd429b||_0xdd429b[_0x5c4555(_0x1005aa._0xeaf508)]<0x2)return _0xdd429b;return _0xdd429b=LngLatArray['toCartesians'](_0xdd429b),fineArrowYWUtil['startCompute'](_0xdd429b,_0x96ac90);}}register$4('fineArrowYW',FineArrowYW);class GatheringPlaceUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['startCompute'](_0x4d3c0f,_0x3c5b0b){const _0x27633={_0x2746ca:0xc84,_0x41221b:0xb75,_0x235208:0xc97,_0x4fc988:0x8e9},_0x1f1b92=_0x3d5d32;if(!_0x4d3c0f||_0x4d3c0f[_0x1f1b92(_0x27633._0x2746ca)]===0x0)return _0x4d3c0f;this['positions']=_0x4d3c0f;const _0x1feb4a=cartesians2mercators(_0x4d3c0f),_0x5c1acc=this['getMaxHeight'](_0x1feb4a),_0x990152=this[_0x1f1b92(0x8e9)]['Mid'](_0x1feb4a[0x0],_0x1feb4a[0x2]);_0x1feb4a[_0x1f1b92(_0x27633._0x41221b)](_0x990152,_0x1feb4a[0x0],_0x1feb4a[0x1]);let _0x15785f=[],_0x7f1a16,_0x57ff25,_0x5d8df5;const _0x55dc4b=[];for(let _0x5d2f9b=0x0;_0x5d2f9b<_0x1feb4a['length']-0x2;_0x5d2f9b++){_0x7f1a16=_0x1feb4a[_0x5d2f9b],_0x57ff25=_0x1feb4a[_0x5d2f9b+0x1],_0x5d8df5=_0x1feb4a[_0x5d2f9b+0x2];const _0x3f59b9=this['algorithmUtil']['getBisectorNormals'](0.4,_0x7f1a16,_0x57ff25,_0x5d8df5);_0x15785f=_0x15785f[_0x1f1b92(_0x27633._0x235208)](_0x3f59b9);}const _0x2c41ed=_0x15785f[_0x1f1b92(_0x27633._0x2746ca)];_0x15785f=[_0x15785f[_0x2c41ed-0x1]]['concat'](_0x15785f['slice'](0x0,_0x2c41ed-0x1));for(let _0x1b4b65=0x0;_0x1b4b65<_0x1feb4a['length']-0x2;_0x1b4b65++){_0x7f1a16=_0x1feb4a[_0x1b4b65],_0x57ff25=_0x1feb4a[_0x1b4b65+0x1],_0x55dc4b['push'](_0x7f1a16);for(let _0x1be22f=0x0;_0x1be22f<=0x64;_0x1be22f++){const _0x173f5e=this[_0x1f1b92(_0x27633._0x4fc988)]['getCubicValue'](_0x1be22f/0x64,_0x7f1a16,_0x15785f[_0x1b4b65*0x2],_0x15785f[_0x1b4b65*0x2+0x1],_0x57ff25);_0x55dc4b[_0x1f1b92(0xb75)](_0x173f5e);}_0x55dc4b['push'](_0x57ff25);}const _0x2d1a4e=mercators2cartesians(_0x55dc4b,_0x5c1acc);return _0x2d1a4e;}[_0x3d5d32(0xe5a)](_0x3a40d1){let _0x54885b=_0x3a40d1[0x0][0x2]||0x0;for(let _0x3a5283=0x0;_0x3a5283<_0x3a40d1['length'];_0x3a5283++){_0x3a40d1[0x2]>_0x54885b&&(_0x54885b=_0x3a40d1[0x2]);}return _0x54885b;}}const gatheringPlaceUtil=new GatheringPlaceUtil();class GatheringPlace extends PolygonEntity{constructor(_0x2591e5={}){const _0x55776c={_0x1edb49:0xab2},_0x4021bc=_0x3d5d32;super(_0x2591e5),this[_0x4021bc(_0x55776c._0x1edb49)]=0x3,this['_maxPointNum']=0x3;}[_0x3d5d32(0x7f0)](_0x1a5246){if(!_0x1a5246||_0x1a5246['length']_0x56e387&&(_0x56e387=_0x2413e[0x2]);}return _0x56e387;}}const luneUtil=new LuneUtil();class Lune extends PolygonEntity{constructor(_0x25b017={}){const _0x1a76ae=_0x3d5d32;super(_0x25b017),this['_minPointNum']=0x3,this[_0x1a76ae(0x46e)]=0x3;}[_0x3d5d32(0x7f0)](_0x21a9fc){if(!_0x21a9fc||_0x21a9fc['length']{const _0x187681=_0xe10664;_0x22a933=this[_0x187681(0x813)](_0x22a933),_0x3cc97e['position']=_0x22a933;const _0x59dce4=Cesium__namespace['Cartesian3']['subtract'](_0x22a933,_0x489c05,new Cesium__namespace['Cartesian3']());_0x489c05=_0x22a933,this[_0x187681(0xbb8)]['forEach']((_0x5037bd,_0x4ba831,_0x2641bd)=>{const _0x136b9c=_0x187681,_0x222621=Cesium__namespace['Cartesian3'][_0x136b9c(0xff3)](_0x5037bd,_0x59dce4,new Cesium__namespace['Cartesian3']());this['positions'][_0x4ba831]=_0x222621;});for(let _0x5174d0=0x0,_0x5bd568=this['draggers']['length'];_0x5174d0<_0x5bd568;_0x5174d0++){this['draggers'][_0x5174d0]['position']=Cesium__namespace['Cartesian3']['add'](this['draggers'][_0x5174d0]['position'],_0x59dce4,new Cesium__namespace['Cartesian3']());}}});_0x2152a0[_0xe10664(_0x1ad54a._0x332ac3)]=0x0,this['draggers']['push'](_0x2152a0);const _0x210f23=getPositionByDirectionAndLen(_0x489c05,this[_0xe10664(_0x1ad54a._0x44d321)]['startAngle'],this[_0xe10664(0xdde)]['radius']);_0x56061e[0x1]=_0x210f23;const _0x4990b9=this[_0xe10664(_0x1ad54a._0x2b7141)]({'position':this[_0xe10664(_0x1ad54a._0x238c37)](_0x210f23),'onDrag':(_0x23a763,_0x33ca30)=>{const _0x421d59=_0xe10664;_0x33ca30=this['updatePositionsHeightByAttr'](_0x33ca30),_0x23a763[_0x421d59(_0x41a233._0x5d3ce1)]=_0x33ca30,this['positions'][_0x23a763[_0x421d59(0x5f9)]]=_0x33ca30,this['style']['radius']=Cesium__namespace['Cartesian3']['distance'](_0x56061e[0x0],_0x33ca30),this[_0x421d59(_0x41a233._0x161cac)][_0x421d59(_0x41a233._0x1faa0a)]=formatNum$1(getAngle(_0x56061e[0x0],_0x33ca30),0x2);},'onDragStart':(_0x257623,_0x2cfffe)=>{const _0x320838=_0xe10664;for(let _0x494d20=0x0,_0x5cb43f=this['draggers']['length'];_0x494d20<_0x5cb43f;_0x494d20++){this[_0x320838(0x93f)][_0x494d20]['show']=![];}},'onDragEnd':(_0x1b5f85,_0x5610f4)=>{this['updateDraggers']();}});_0x4990b9['index']=0x1,this[_0xe10664(0x93f)]['push'](_0x4990b9),this[_0xe10664(_0x1ad54a._0x16b973)][_0xe10664(0x831)]&&this['_bindHeightDraggers']();}['_updateHeight'](_0x543a28){const _0x8a333d={_0x46bf40:0x83e},_0x42279f=_0x3d5d32;this['entityGraphic'][_0x42279f(_0x8a333d._0x46bf40)]=_0x543a28,this['style']['height']=this['formatNum'](_0x543a28,0x2);const _0x3e1fe8=this['positions'];for(let _0x3f0ea3=0x0,_0x4bc68f=_0x3e1fe8['length'];_0x3f0ea3<_0x4bc68f;_0x3f0ea3++){_0x3e1fe8[_0x3f0ea3]=setPositionsHeight(_0x3e1fe8[_0x3f0ea3],_0x543a28);}this['fire'](EventType['editStyle']);}}class Regular extends PolygonEntity{constructor(_0x4bbbd9={}){const _0xf95f61={_0xdfb736:0xdde,_0x21c2dd:0xdde},_0x304242=_0x3d5d32;super(_0x4bbbd9),this['_minPointNum']=0x2,this['_maxPointNum']=0x2,this[_0x304242(_0xf95f61._0xdfb736)]['radius']=this['style']['radius']??0x3e8,this['style']['startAngle']=this[_0x304242(_0xf95f61._0x21c2dd)]['startAngle']??0x0,_0x4bbbd9['position']&&(this['positions']=[_0x4bbbd9['position']]);}get[_0x3d5d32(0x98e)](){return EditRegular;}['updateAttrForDrawing'](_0x448872){const _0x58b87c={_0xf402ca:0xd76,_0x262e5d:0xc84,_0x3b7b6b:0xdde,_0x499fc6:0xf22},_0x52c8d5=_0x3d5d32;var _0x3601fa;if(!_0x448872&&((_0x3601fa=this[_0x52c8d5(_0x58b87c._0xf402ca)])===null||_0x3601fa===void 0x0?void 0x0:_0x3601fa[_0x52c8d5(_0x58b87c._0x262e5d)])>0x1){const _0x292db6=this['_positions_draw'][0x0];this[_0x52c8d5(_0x58b87c._0x3b7b6b)]['radius']=Cesium__namespace['Cartesian3']['distance'](_0x292db6,this['_positions_draw'][0x1]),this[_0x52c8d5(0xdde)]['startAngle']=formatNum$1(getAngle(_0x292db6,this['_positions_draw'][0x1]),0x2);}super[_0x52c8d5(_0x58b87c._0x499fc6)](_0x448872);}['getShowPositions'](_0x5c358e){const _0x3108d3=_0x3d5d32;if(!_0x5c358e||_0x5c358e['length']<0x1)return _0x5c358e;return Regular['getOutlinePositions'](_0x5c358e[0x0],this[_0x3108d3(0xdde)]);}static['getOutlinePositions'](_0x3c0486,_0x280a07){const _0x44d72d=_0x3d5d32,_0x40e74e=_0x280a07['border']||0x3,_0x3f0632=_0x280a07['radius']||0x3e8,_0x1dbcf6=_0x280a07['startAngle']||0x0,_0x4c743a=0x168/_0x40e74e,_0x1d0389=[];for(let _0x45c7e6=0x0;_0x45c7e6<=_0x40e74e;_0x45c7e6++){const _0x5872cc=_0x1dbcf6+_0x4c743a*_0x45c7e6;_0x1d0389[_0x44d72d(0xb75)](getPositionByDirectionAndLen(_0x3c0486,_0x5872cc,_0x3f0632));}return _0x1d0389;}}register$4(_0x3d5d32(0x92e),Regular);class EditSector extends EditPolygon{['bindDraggers'](){const _0x52a091={_0x30e8a6:0xf10,_0x5263ef:0xa09},_0x49e0e4={_0x150072:0x93f},_0x2b1d16={_0x437360:0x813,_0x949079:0xb69,_0x1eaca7:0x5f9},_0x2cde2d={_0x57d16d:0xc84},_0x2469a4={_0x20e5ca:0x5f9,_0x38b897:0xdde},_0x4e4886={_0x5dcce4:0x1061},_0x2dff0a={_0x4fdea0:0xe95,_0x158ef5:0xff3},_0x554e65=_0x3d5d32,_0x57dd59=this['positions'];let _0x36e20d=this[_0x554e65(0x813)](_0x57dd59[0x0]);const _0x3e74ab=this['createDragger']({'position':_0x36e20d,'type':PointType['MoveAll'],'tooltip':this['_map']['getLangText']('_整体平移'),'onDrag':(_0x520d9b,_0x568069)=>{const _0x9b6144=_0x554e65;_0x568069=this['updatePositionsHeightByAttr'](_0x568069),_0x520d9b['position']=_0x568069;const _0x12c739=Cesium__namespace['Cartesian3']['subtract'](_0x568069,_0x36e20d,new Cesium__namespace[(_0x9b6144(0xe95))]());_0x36e20d=_0x568069,this['positions'][_0x9b6144(_0x4e4886._0x5dcce4)]((_0x4fe5f2,_0x1db482,_0xfefc13)=>{const _0x419c2d=_0x9b6144,_0x24d5f0=Cesium__namespace[_0x419c2d(_0x2dff0a._0x4fdea0)][_0x419c2d(_0x2dff0a._0x158ef5)](_0x4fe5f2,_0x12c739,new Cesium__namespace[(_0x419c2d(0xe95))]());this[_0x419c2d(0xbb8)][_0x1db482]=_0x24d5f0;});for(let _0x1487de=0x0,_0x2c5e08=this['draggers']['length'];_0x1487de<_0x2c5e08;_0x1487de++){this['draggers'][_0x1487de]['position']=Cesium__namespace[_0x9b6144(0xe95)]['add'](this['draggers'][_0x1487de]['position'],_0x12c739,new Cesium__namespace['Cartesian3']());}}});_0x3e74ab['index']=0x0,this['draggers']['push'](_0x3e74ab);const _0x97f250=getPositionByDirectionAndLen(_0x36e20d,this['style'][_0x554e65(0xb37)],this['style']['radius']);_0x57dd59[0x1]=_0x97f250;const _0xff57b7=this['createDragger']({'position':this['updatePositionsHeightByAttr'](_0x97f250),'onDrag':(_0x48deab,_0x5ce569)=>{const _0x53d12c=_0x554e65;_0x5ce569=this['updatePositionsHeightByAttr'](_0x5ce569),_0x48deab['position']=_0x5ce569,this['positions'][_0x48deab[_0x53d12c(_0x2469a4._0x20e5ca)]]=_0x5ce569,this['style'][_0x53d12c(0xd61)]=Cesium__namespace[_0x53d12c(0xe95)]['distance'](_0x57dd59[0x0],_0x5ce569),this['style'][_0x53d12c(0xb37)]=formatNum$1(getAngle(_0x57dd59[0x0],_0x5ce569),0x2),_0x57dd59[0x2]=getPositionByDirectionAndLen(_0x57dd59[0x0],this[_0x53d12c(_0x2469a4._0x38b897)]['endAngle'],this['style']['radius']);},'onDragStart':(_0xde4c6,_0x57d92a)=>{const _0x2cd3e2=_0x554e65;for(let _0x15409c=0x0,_0x1d6f08=this[_0x2cd3e2(0x93f)][_0x2cd3e2(_0x2cde2d._0x57d16d)];_0x15409c<_0x1d6f08;_0x15409c++){this['draggers'][_0x15409c][_0x2cd3e2(0x792)]=![];}},'onDragEnd':(_0x5d974b,_0x3fc976)=>{this['updateDraggers']();}});_0xff57b7['index']=0x1,this['draggers']['push'](_0xff57b7);const _0x4002e2=getPositionByDirectionAndLen(_0x36e20d,this['style']['endAngle'],this['style']['radius']);_0x57dd59[0x2]=_0x4002e2;const _0xd5fb52=this[_0x554e65(_0x52a091._0x30e8a6)]({'position':this[_0x554e65(0x813)](_0x4002e2),'onDrag':(_0x40aa2f,_0x631a38)=>{const _0x153c70=_0x554e65;_0x631a38=this[_0x153c70(_0x2b1d16._0x437360)](_0x631a38),_0x40aa2f[_0x153c70(_0x2b1d16._0x949079)]=_0x631a38,this['positions'][_0x40aa2f[_0x153c70(_0x2b1d16._0x1eaca7)]]=_0x631a38,this['style']['radius']=Cesium__namespace['Cartesian3']['distance'](_0x57dd59[0x0],_0x631a38),this['style']['endAngle']=getAngle(_0x57dd59[0x0],_0x631a38),_0x57dd59[0x1]=getPositionByDirectionAndLen(_0x57dd59[0x0],this['style']['startAngle'],this['style']['radius']);},'onDragStart':(_0x2efe3b,_0xca73d0)=>{const _0x9c000a=_0x554e65;for(let _0xd5a830=0x0,_0x2adb9c=this['draggers']['length'];_0xd5a830<_0x2adb9c;_0xd5a830++){this[_0x9c000a(_0x49e0e4._0x150072)][_0xd5a830][_0x9c000a(0x792)]=![];}},'onDragEnd':(_0x1b256a,_0x1cda1d)=>{const _0x16af42=_0x554e65;this[_0x16af42(0xfa7)]();}});_0xd5fb52[_0x554e65(0x5f9)]=0x2,this['draggers']['push'](_0xd5fb52),this[_0x554e65(_0x52a091._0x5263ef)]['extrudedHeight']&&this[_0x554e65(0x30b)]();}[_0x3d5d32(0x83c)](_0x5de0a0){const _0x46bbd3={_0x59cf9d:0xbb8,_0xe0a074:0xefc},_0x12d93a=_0x3d5d32;this['entityGraphic']['height']=_0x5de0a0,this['style']['height']=this['formatNum'](_0x5de0a0,0x2);const _0x4b85b2=this[_0x12d93a(_0x46bbd3._0x59cf9d)];for(let _0x5e9789=0x0,_0x35dd43=_0x4b85b2['length'];_0x5e9789<_0x35dd43;_0x5e9789++){_0x4b85b2[_0x5e9789]=setPositionsHeight(_0x4b85b2[_0x5e9789],_0x5de0a0);}this[_0x12d93a(_0x46bbd3._0xe0a074)](EventType['editStyle']);}}class Sector extends PolygonEntity{constructor(_0x34b5cc={}){const _0x16a048={_0x5c5966:0xdde,_0x3ad374:0xdde,_0xd70c9d:0xb69},_0x2e74a8=_0x3d5d32;super(_0x34b5cc),this['_minPointNum']=0x2,this['_maxPointNum']=0x3,this['style']['radius']=this['style'][_0x2e74a8(0xd61)]??0x3e8,this['style']['startAngle']=this[_0x2e74a8(_0x16a048._0x5c5966)]['startAngle']??0x0,this[_0x2e74a8(_0x16a048._0x3ad374)]['endAngle']=this['style']['endAngle']??0x0,_0x34b5cc[_0x2e74a8(_0x16a048._0xd70c9d)]&&(this['positions']=[_0x34b5cc['position']]);}get['EditClass'](){return EditSector;}['updateAttrForDrawing'](_0x396b55){const _0x4203c3={_0x51e1b1:0xd61,_0x473cc1:0xbd7,_0x17a4d1:0xb37,_0xa95499:0xd76},_0x24ffa0=_0x3d5d32;var _0x12f99f;if(!_0x396b55&&((_0x12f99f=this['_positions_draw'])===null||_0x12f99f===void 0x0?void 0x0:_0x12f99f['length'])>0x1){var _0x2eed7d;const _0x2dd1e1=this['_positions_draw'][0x0];this['style'][_0x24ffa0(_0x4203c3._0x51e1b1)]=formatNum$1(Cesium__namespace['Cartesian3'][_0x24ffa0(_0x4203c3._0x473cc1)](_0x2dd1e1,this['_positions_draw'][0x1]),0x2),this['style'][_0x24ffa0(_0x4203c3._0x17a4d1)]=formatNum$1(getAngle(_0x2dd1e1,this['_positions_draw'][0x1]),0x2),((_0x2eed7d=this['_positions_draw'])===null||_0x2eed7d===void 0x0?void 0x0:_0x2eed7d['length'])>0x2?this['style'][_0x24ffa0(0xd72)]=formatNum$1(getAngle(_0x2dd1e1,this[_0x24ffa0(_0x4203c3._0xa95499)][0x2]),0x2):this['style']['endAngle']=this['style']['startAngle'];}super['updateAttrForDrawing'](_0x396b55);}['getShowPositions'](_0x5bcc2a){const _0x31f88={_0x310d3c:0xdde},_0x5d05a2=_0x3d5d32;if(!_0x5bcc2a||_0x5bcc2a['length']<0x1)return _0x5bcc2a;return Sector['getOutlinePositions'](_0x5bcc2a[0x0],this[_0x5d05a2(_0x31f88._0x310d3c)]);}['_updateStyleHook'](_0x37c04e,_0x5093b5){const _0x3b6cac={_0xc72d28:0x7b3},_0x2ab93e=_0x3d5d32;super[_0x2ab93e(_0x3b6cac._0xc72d28)](_0x37c04e,_0x5093b5),(Cesium__namespace[_0x2ab93e(0xb84)](_0x5093b5['radius'])||Cesium__namespace['defined'](_0x5093b5[_0x2ab93e(0xb37)])||Cesium__namespace[_0x2ab93e(0xb84)](_0x5093b5['endAngle'])||Cesium__namespace['defined'](_0x5093b5['noCenter']))&&this['_updatePositionsHook']();}['autoSurfaceHeight'](_0x56b555={}){const _0x27780f={_0x1e4ebe:0xbb8},_0x49cdc1=_0x3d5d32;return getSurfaceHeight(this['_map'][_0x49cdc1(0xfc1)],this['positions'][0x0],{'objectsToExclude':this['_layer']['objectsToExclude'],..._0x56b555})['then'](_0x1b8c1a=>{const _0x589f1d=_0x49cdc1;_0x1b8c1a['position']&&(this[_0x589f1d(_0x27780f._0x1e4ebe)]=[_0x1b8c1a[_0x589f1d(0xb69)]]);});}static['getOutlinePositions'](_0x34b35c,_0x514729){const _0x10cf07={_0x638d77:0xb75},_0x1957cb=_0x3d5d32,_0x2f85f3=_0x514729['radius'],_0x33c21d=_0x514729[_0x1957cb(0xb37)];let _0x1d8a0e=_0x514729['endAngle'];_0x1d8a0e<=_0x33c21d&&(_0x1d8a0e+=0x168);const _0x131b5f=[];!_0x514729['noCenter']&&_0x131b5f[_0x1957cb(_0x10cf07._0x638d77)](_0x34b35c);for(let _0x135dbd=_0x33c21d;_0x135dbd<=_0x1d8a0e;_0x135dbd++){_0x131b5f['push'](getPositionByDirectionAndLen(_0x34b35c,_0x135dbd,_0x2f85f3));}return!_0x514729[_0x1957cb(0x858)]&&_0x131b5f['push'](_0x34b35c),_0x131b5f;}}register$4('sector',Sector);class StraightArrowUtil{constructor(){this['algorithmUtil']=algorithmUtil;}['setOptions'](_0x39d3f7={}){const _0x51a283={_0x3be2d2:0x379,_0x51f635:0x107b,_0x1be18c:0xe64},_0x2b5ae0=_0x3d5d32;this[_0x2b5ae0(_0x51a283._0x3be2d2)]=_0x39d3f7[_0x2b5ae0(0x379)]||0.05,this['neckWidthFactor']=_0x39d3f7[_0x2b5ae0(_0x51a283._0x51f635)]||0.1,this['headWidthFactor']=_0x39d3f7['headWidthFactor']||0.15,this['headAngle']=Math['PI']/0x4,this[_0x2b5ae0(_0x51a283._0x1be18c)]=Math['PI']*0.17741;}['startCompute'](_0xf5d0af,_0x29c04c){const _0x3696ab={_0xa33f0e:0xe5a,_0x70b6e:0x8e9,_0x45fb8e:0x88f},_0x5ebd5f=_0x3d5d32;if(!_0xf5d0af||_0xf5d0af[_0x5ebd5f(0xc84)]===0x0)return _0xf5d0af;this[_0x5ebd5f(0xbb8)]=_0xf5d0af,this[_0x5ebd5f(0x945)](_0x29c04c);const _0x461cbf=cartesians2mercators(_0xf5d0af),_0x54e0e4=this[_0x5ebd5f(_0x3696ab._0xa33f0e)](_0x461cbf),_0x3ec14d=[_0x461cbf[0x0],_0x461cbf[0x1]],_0x4b53b7=_0x3ec14d[0x0],_0x4264bf=_0x3ec14d[0x1],_0x46c539=this['algorithmUtil'][_0x5ebd5f(0x41a)](_0x461cbf),_0x4ed736=_0x46c539*this[_0x5ebd5f(0x379)],_0x2dadd7=_0x46c539*this['neckWidthFactor'],_0x24129f=_0x46c539*this['headWidthFactor'],_0x3c0adc=this['algorithmUtil']['getThirdPoint'](_0x4264bf,_0x4b53b7,Math['PI']/0x2,_0x4ed736,!![]),_0x560bca=this['algorithmUtil']['getThirdPoint'](_0x4264bf,_0x4b53b7,Math['PI']/0x2,_0x4ed736,![]),_0x203091=this[_0x5ebd5f(0x8e9)]['getThirdPoint'](_0x4b53b7,_0x4264bf,this['headAngle'],_0x24129f,![]),_0x2921c4=this[_0x5ebd5f(_0x3696ab._0x70b6e)]['getThirdPoint'](_0x4b53b7,_0x4264bf,this['headAngle'],_0x24129f,!![]),_0x183a2c=this[_0x5ebd5f(0x8e9)]['getThirdPoint'](_0x4b53b7,_0x4264bf,this['neckAngle'],_0x2dadd7,![]),_0x573d18=this['algorithmUtil'][_0x5ebd5f(_0x3696ab._0x45fb8e)](_0x4b53b7,_0x4264bf,this['neckAngle'],_0x2dadd7,!![]),_0x37eb63=[_0x3c0adc,_0x183a2c,_0x203091,_0x4264bf,_0x2921c4,_0x573d18,_0x560bca],_0x3fafcd=mercators2cartesians(_0x37eb63,_0x54e0e4);return _0x3fafcd;}['getMaxHeight'](_0x4b1301){let _0x3d140b=_0x4b1301[0x0][0x2]||0x0;for(let _0x4ac818=0x0;_0x4ac818<_0x4b1301['length'];_0x4ac818++){_0x4b1301[0x2]>_0x3d140b&&(_0x3d140b=_0x4b1301[0x2]);}return _0x3d140b;}}const straightArrowUtil=new StraightArrowUtil();class StraightArrow extends PolygonEntity{constructor(_0xbf5df9={}){const _0x187d9c=_0x3d5d32;super(_0xbf5df9),this['_minPointNum']=0x2,this[_0x187d9c(0x46e)]=0x2;}['getShowPositions'](_0x5f0a6e){if(!_0x5f0a6e||_0x5f0a6e['length']<0x2)return _0x5f0a6e;return straightArrowUtil['startCompute'](_0x5f0a6e,this['style']);}static['getOutlinePositions'](_0x90f658,_0x6d11f6){const _0x30c080={_0x5ddc18:0x890},_0x3e8e70=_0x3d5d32;if(!_0x90f658||_0x90f658[_0x3e8e70(0xc84)]<0x2)return _0x90f658;return _0x90f658=LngLatArray[_0x3e8e70(_0x30c080._0x5ddc18)](_0x90f658),straightArrowUtil['startCompute'](_0x90f658,_0x6d11f6);}}register$4(_0x3d5d32(0xd38),StraightArrow);const DEF_STYLE$l={'color':'#3388ff','pixelSize':0x8,'outlineColor':'#ffffff','outlineWidth':0x2,'visibleDepth':![]};class PointMeasure extends PointEntity{constructor(_0x5d7306={}){const _0xb4982c={_0xc1344c:0xdde},_0x3899f9=_0x3d5d32;_0x5d7306[_0x3899f9(_0xb4982c._0xc1344c)]={...DEF_STYLE$l,..._0x5d7306['style']||{}},super(_0x5d7306);}['_addedHook'](_0x20d927){const _0x1c5cdb={_0x188e62:0xdde,_0x2f48c8:0xe24,_0x48ba38:0x8c0},_0x23085e={_0x257179:0x980,_0x22a41f:0x433,_0x423906:0xd57,_0xd0038e:0x719,_0xa82787:0x658},_0x112d07=_0x3d5d32;super[_0x112d07(0x226)](_0x20d927);const _0x4cf141=this[_0x112d07(0x1d1)];this[_0x112d07(0x217)](_0x4e76f3=>{const _0x56b265=_0x112d07,_0x1255c6=this['point'];_0x1255c6['format']();const _0x22244c=degree2dms(_0x1255c6['lng'])['str'],_0x5a3116=degree2dms(_0x1255c6['lat'])['str'];let _0x2e69f1='';if(this[_0x56b265(0x433)][_0x56b265(_0x23085e._0x257179)]!==![]){const _0xb2b60b=proj4Trans([_0x1255c6['lng'],_0x1255c6['lat']],'EPSG:4326',this[_0x56b265(_0x23085e._0x22a41f)]['crs']??CRS['CGCS2000_GK_Zone_3']);_0xb2b60b[0x0]!==_0x1255c6['lng']&&_0xb2b60b[0x1]!==_0x1255c6[_0x56b265(_0x23085e._0x423906)]&&(_0x2e69f1=''+_0xb2b60b[0x0][_0x56b265(_0x23085e._0xd0038e)](0x1)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xb2b60b[0x1]['toFixed'](0x1)+_0x56b265(0xfaf));}return''+_0x4cf141['getLangText']('_位置信息')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'+_0x1255c6['lng']+'  '+_0x22244c+'
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'+_0x1255c6[_0x56b265(0xd57)]+'    '+_0x5a3116+_0x56b265(_0x23085e._0xa82787)+_0x2e69f1+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
';},{'autoClose':this['style']['autoClose']??![],'closeOnClick':this[_0x112d07(_0x1c5cdb._0x188e62)][_0x112d07(0xf82)]??![]}),this['on'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this['once'](EventType['drawCreated'],this[_0x112d07(0x705)],this),this['on'](EventType['editMovePoint'],this[_0x112d07(_0x1c5cdb._0x2f48c8)],this),this['on'](EventType[_0x112d07(_0x1c5cdb._0x48ba38)],this[_0x112d07(0xe24)],this),this['position']&&this['openPopup']();}['_updatePositionsHook'](){const _0x17a1fe=_0x3d5d32;super['_updatePositionsHook'](),this[_0x17a1fe(0x3b4)]();}['_removedHook'](){const _0x418539={_0x1ed4e2:0x4a7,_0x427fdf:0x9e7,_0x16ec10:0xe24},_0x46725f=_0x3d5d32;this[_0x46725f(0x9e7)](EventType[_0x46725f(_0x418539._0x1ed4e2)],this['_drawMouseMoveHandler'],this),this['off'](EventType['drawCreated'],this['_drawCreatedHandler'],this),this[_0x46725f(_0x418539._0x427fdf)](EventType['editMovePoint'],this['_editPointHandler'],this),this[_0x46725f(0x9e7)](EventType['editRemovePoint'],this[_0x46725f(_0x418539._0x16ec10)],this),super['_removedHook']();}['_drawMouseMoveHandler'](_0xa1a926){this['openPopup']();}['_drawCreatedHandler'](_0x5e4c21){const _0x8fddc3=_0x3d5d32;this['openPopup'](),this['fire'](EventType['end'],{'mtype':this[_0x8fddc3(0x7f5)],'graphic':this},!![]);}['_editPointHandler'](_0x41a8b9){this['openPopup']();}}register$4('pointMeasure',PointMeasure,!![]);const DEF_STYLE$k={'materialType':'PolylineGlow','glowPower':0.1,'color':_0x3d5d32(0x4b8),'width':0x9,'clampToGround':![]};class DistanceMeasure extends PolylineEntity{constructor(_0x436930={}){const _0x30ab3a={_0x2b4292:0x983,_0x826927:0x983,_0x6b6905:0x2da},_0x5aa461=_0x3d5d32;_0x436930['hasMoveEdit']=![],_0x436930[_0x5aa461(_0x30ab3a._0x2b4292)]=_0x436930[_0x5aa461(_0x30ab3a._0x826927)]??!![],_0x436930['decimal']=_0x436930[_0x5aa461(_0x30ab3a._0x6b6905)]??0x2,_0x436930[_0x5aa461(0xdde)]={...DEF_STYLE$k,..._0x436930['style']||{}},super(_0x436930),this['_measured']={};}get['measured'](){return this['_measured'];}['_addedHook'](_0x4dc5c9){const _0x374500={_0x23d568:0x433,_0x4cb5b9:0x32a,_0x4326e4:0x1050,_0x2a59a9:0x75c,_0x1fd1cb:0xa66,_0x19f8bc:0xbb8},_0x3beca3=_0x3d5d32;var _0x146111,_0x2921d1;super[_0x3beca3(0x226)](_0x4dc5c9),this['_arrPartMeasureLable']=[],this[_0x3beca3(0xf94)]=this['_createLabel'](this['options']['label']||((_0x146111=this['_layer'])===null||_0x146111===void 0x0?void 0x0:(_0x2921d1=_0x146111[_0x3beca3(_0x374500._0x23d568)])===null||_0x2921d1===void 0x0?void 0x0:_0x2921d1[_0x3beca3(_0x374500._0x4cb5b9)])),this['_measureLable']['show']=![],this['on'](EventType[_0x3beca3(_0x374500._0x4326e4)],this['_drawAddPointHandler'],this),this['on'](EventType[_0x3beca3(_0x374500._0x2a59a9)],this['_drawRemovePointHandler'],this),this['on'](EventType['drawMouseMove'],this[_0x3beca3(_0x374500._0x1fd1cb)],this),this['once'](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['on'](EventType['editMovePoint'],this['_editPointHandler'],this),this['on'](EventType['editRemovePoint'],this['_editPointHandler'],this),this['options'][_0x3beca3(_0x374500._0x19f8bc)]&&(this['_measureLable'][_0x3beca3(0x792)]=!![],this['_editPointHandler']());}[_0x3d5d32(0x367)](){const _0x4fb871={_0x45bea4:0x367,_0x561376:0xe24},_0x2e003a=_0x3d5d32;super[_0x2e003a(_0x4fb871._0x45bea4)](),this['_measureLable']['show']=!![],this[_0x2e003a(_0x4fb871._0x561376)]();}[_0x3d5d32(0x566)](){const _0x20477c={_0x59c7ab:0x4e3,_0x17fcb8:0x655,_0x29cc96:0xa69,_0xf3fec4:0xf94,_0x1f83a9:0xa69,_0x1ecdc6:0xdd9},_0x2b3034=_0x3d5d32;this['off'](EventType['drawAddPoint'],this[_0x2b3034(_0x20477c._0x59c7ab)],this),this['off'](EventType['drawMouseMove'],this[_0x2b3034(0xa66)],this),this['off'](EventType['drawRemovePoint'],this[_0x2b3034(0xba0)],this),this['off'](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['off'](EventType[_0x2b3034(_0x20477c._0x17fcb8)],this['_editPointHandler'],this),this['off'](EventType['editRemovePoint'],this['_editPointHandler'],this);Cesium__namespace['defined'](this[_0x2b3034(0xf94)])&&(this[_0x2b3034(_0x20477c._0x29cc96)](this[_0x2b3034(_0x20477c._0xf3fec4)]),delete this['_measureLable']);if(Cesium__namespace['defined'](this[_0x2b3034(0xdd9)])&&this['_arrPartMeasureLable']['length']>0x0){const _0x69256=this['_arrPartMeasureLable'];if(_0x69256&&_0x69256['length']>0x0)for(let _0x19db77=0x0,_0x112d1c=_0x69256['length'];_0x19db77<_0x112d1c;_0x19db77++){this[_0x2b3034(_0x20477c._0x1f83a9)](_0x69256[_0x19db77]);}delete this[_0x2b3034(_0x20477c._0x1ecdc6)];}super['_removedHook']();}['_toJSON_Ex'](_0xf6aba5){const _0x96813b={_0x19d78e:0xe06},_0x37a1b0=_0x3d5d32;_0xf6aba5[_0x37a1b0(_0x96813b._0x19d78e)]=getAttrVal(this[_0x37a1b0(0xe06)],{'onlySimpleType':!![]});}['updateText'](_0x4a8af9){const _0x259c29={_0x475039:0x6b0,_0x3ff4c7:0x2da,_0x59969c:0x83a,_0xfcef82:0xd3c,_0x2960f7:0x983,_0x10a7e7:0x76b,_0x1a9809:0xdd9},_0x33e683=_0x3d5d32;_0x4a8af9&&(this['options'][_0x33e683(0xef9)]=_0x4a8af9);const _0x7b5054={'unit':this['options']['unit'],'lang':this[_0x33e683(0x1d1)][_0x33e683(_0x259c29._0x475039)],'decimal':this['options'][_0x33e683(_0x259c29._0x3ff4c7)]};this[_0x33e683(0x7a4)][_0x33e683(_0x259c29._0x59969c)]=formatDistance(this['_measured']['distance'],_0x7b5054);if(this['_measured']['distance']!==this['_measured'][_0x33e683(_0x259c29._0xfcef82)]){this['_measureLable']['text']=this['_map']['getLangText']('_总长')+':'+this['_measured']['distanceStr'];if(this['options'][_0x33e683(_0x259c29._0x2960f7)]){const _0x3a2ec1=formatDistance(this[_0x33e683(0x7a4)]['distanceLastFd'],_0x7b5054);this['_measured']['distanceLastFdStr']=_0x3a2ec1,this['_measureLable'][_0x33e683(_0x259c29._0x10a7e7)]+='\x0a(+'+_0x3a2ec1+')';}}else this['_measureLable']['text']=this['_map']['getLangText']('_总长')+':'+this['_measured'][_0x33e683(0x83a)];if(_0x4a8af9)for(let _0x5326a8=0x1,_0x47867f=this[_0x33e683(_0x259c29._0x1a9809)]['length'];_0x5326a8<_0x47867f;_0x5326a8++){const _0x4f4455=this['_arrPartMeasureLable'][_0x5326a8];_0x4f4455[_0x33e683(0xe5d)]&&_0x4f4455['showText']();}}[_0x3d5d32(0x4e3)](_0x156a5a){const _0x59ac5e={_0x4b8142:0x326,_0x532ef1:0x873,_0x31ae9c:0x76b,_0x327f56:0xd1b,_0xd9c4bd:0xe12,_0x157321:0xe5d,_0x176efd:0xd3c},_0x435045={_0x155b14:0x433,_0x1a51e9:0x369},_0x46cf51=_0x3d5d32;var _0x57889c,_0x13425d;const _0xa3589=this,_0x4f01b2=this[_0x46cf51(_0x59ac5e._0x4b8142)],_0xb785bb=this['_createLabel'](this['options']['label']||((_0x57889c=this[_0x46cf51(_0x59ac5e._0x532ef1)])===null||_0x57889c===void 0x0?void 0x0:(_0x13425d=_0x57889c['options'])===null||_0x13425d===void 0x0?void 0x0:_0x13425d[_0x46cf51(0x32a)]),_0x4f01b2[_0x4f01b2['length']-0x1]);this['_arrPartMeasureLable']['push'](_0xb785bb);if(_0x4f01b2['length']===0x1)_0xb785bb[_0x46cf51(_0x59ac5e._0x31ae9c)]=this['_map'][_0x46cf51(_0x59ac5e._0x327f56)]('_起点');else{const _0x3130cf=getSurfaceDistance(_0x4f01b2),_0x4bde9f=getSurfaceDistance([_0x4f01b2[_0x4f01b2['length']-0x2],_0x4f01b2[_0x4f01b2[_0x46cf51(0xc84)]-0x1]]);_0xb785bb[_0x46cf51(_0x59ac5e._0xd9c4bd)]={},_0xb785bb['attr']['value']=_0x3130cf,_0xb785bb[_0x46cf51(0xe12)][_0x46cf51(0x2ee)]=_0x4bde9f,_0xb785bb[_0x46cf51(_0x59ac5e._0x157321)]=function(){const _0x31bcc1=_0x46cf51,_0x365a5e={'unit':_0xa3589[_0x31bcc1(_0x435045._0x155b14)]['unit'],'lang':_0xa3589['_map']['lang'],'decimal':_0xa3589['options']['decimal']},_0xfeefe5=formatDistance(this[_0x31bcc1(0xe12)]['value'],_0x365a5e);if(this['attr']['value']!==this['attr']['valueFD']){this['text']=_0xfeefe5;if(_0xa3589['options']['showAddText']){const _0x596f97=formatDistance(this[_0x31bcc1(0xe12)]['valueFD'],_0x365a5e);this['text']+=_0x31bcc1(_0x435045._0x1a51e9)+_0x596f97+')';}}else this['text']=_0xfeefe5;},_0xb785bb[_0x46cf51(_0x59ac5e._0x157321)](),this[_0x46cf51(0x7a4)]['distance']=_0x3130cf,this['_measured'][_0x46cf51(_0x59ac5e._0x176efd)]=_0x4bde9f,this['_measured']['distanceStr']=formatDistance(this['_measured']['distance'],{'unit':this[_0x46cf51(0x433)]['unit'],'lang':this['_map']['lang'],'decimal':this[_0x46cf51(0x433)][_0x46cf51(0x2da)]});}}['_drawRemovePointHandler'](_0x14359c){const _0x2700e1={_0x3c1f46:0x1f5},_0x453cff=_0x3d5d32,_0x39ebbb=this['_arrPartMeasureLable'][_0x453cff(_0x2700e1._0x3c1f46)]();this['_removeLabel'](_0x39ebbb),this['_drawMouseMoveHandler'](_0x14359c),this['_measureLable'][_0x453cff(0xb69)]=_0x14359c['cartesian'];}['_drawMouseMoveHandler'](_0x434e90){const _0x4c3ed2={_0x331d81:0xf94,_0x1c3a1d:0x73d},_0x36744c=_0x3d5d32,_0x164e0e=this[_0x36744c(0x326)];if(!_0x164e0e||_0x164e0e['length']<0x2){this[_0x36744c(_0x4c3ed2._0x331d81)][_0x36744c(0x792)]=![];return;}const _0x5a98dd=getSurfaceDistance(_0x164e0e);let _0x554a2f=getSurfaceDistance([_0x164e0e[_0x164e0e['length']-0x2],_0x164e0e[_0x164e0e['length']-0x1]]);_0x554a2f===0x0&&_0x164e0e['length']>0x2&&(_0x554a2f=getSurfaceDistance([_0x164e0e[_0x164e0e[_0x36744c(0xc84)]-0x3],_0x164e0e[_0x164e0e['length']-0x2]])),this['_measured'][_0x36744c(0xbd7)]=_0x5a98dd,this['_measured']['distanceLastFd']=_0x554a2f,this['updateText'](),this['_measureLable']['position']=_0x164e0e[_0x164e0e[_0x36744c(0xc84)]-0x1],this[_0x36744c(0xefc)](EventType[_0x36744c(_0x4c3ed2._0x1c3a1d)],{'mtype':this['type'],'value':this['_measured']['distance'],'label':this['_measured']['distanceStr']},!![]);}['_drawCreatedHandler'](_0x486fae,_0x247795=!![]){const _0x51ed5e={_0x2f35fb:0xa69,_0x365257:0xf94,_0x3584c1:0x7f5},_0x33fcec=_0x3d5d32,_0x1311c4=this['positionsShow'],_0x4737ce=this['_arrPartMeasureLable']['length']-_0x1311c4[_0x33fcec(0xc84)];if(_0x4737ce>=0x0){for(let _0x1bf32e=this['_arrPartMeasureLable']['length']-0x1;_0x1bf32e>=_0x1311c4['length']-0x1;_0x1bf32e--){this[_0x33fcec(_0x51ed5e._0x2f35fb)](this['_arrPartMeasureLable'][_0x1bf32e]);}this[_0x33fcec(0xdd9)]['splice'](_0x1311c4['length']-0x1,_0x4737ce+0x1);}this['updateText'](),this['_measureLable']['position']=_0x1311c4[_0x1311c4[_0x33fcec(0xc84)]-0x1],this[_0x33fcec(_0x51ed5e._0x365257)][_0x33fcec(0x792)]=!![],_0x247795&&this['fire'](EventType['end'],{'mtype':this[_0x33fcec(_0x51ed5e._0x3584c1)],'value':this['_measured'][_0x33fcec(0xbd7)],'label':this[_0x33fcec(0x7a4)]['distanceStr']},!![]);}['_editPointHandler'](_0x174619,_0x32e0fb=!![]){const _0x290c4c={_0x1f6262:0x326,_0x19cff:0xc84,_0x2fc9a4:0xa69,_0x335a24:0x873,_0x56b013:0xd1b,_0x34f754:0xb69,_0x1dc2d9:0xdd9,_0x22f568:0x433,_0xe5bdc7:0xe12,_0x1dce98:0xc84,_0x5ee8ea:0xf94,_0x205c7c:0xefc},_0x4b8fa1={_0x217ecb:0x1062,_0x18bd92:0xe12,_0x4c84e4:0x2ee},_0x20f8c2=_0x3d5d32,_0x33acb3=this,_0x49e783=this[_0x20f8c2(_0x290c4c._0x1f6262)];if(!_0x49e783||_0x49e783['length']<0x2)return;let _0x1921e8=this['_arrPartMeasureLable'];if(_0x1921e8&&_0x1921e8[_0x20f8c2(0xc84)]>0x0)for(let _0x137fe0=0x1,_0x153818=_0x1921e8[_0x20f8c2(_0x290c4c._0x19cff)];_0x137fe0<_0x153818;_0x137fe0++){this[_0x20f8c2(_0x290c4c._0x2fc9a4)](_0x1921e8[_0x137fe0]);}else{var _0x48d319,_0x33bdc8;const _0x446f79=this['_createLabel'](this['options'][_0x20f8c2(0x32a)]||((_0x48d319=this[_0x20f8c2(_0x290c4c._0x335a24)])===null||_0x48d319===void 0x0?void 0x0:(_0x33bdc8=_0x48d319['options'])===null||_0x33bdc8===void 0x0?void 0x0:_0x33bdc8['label']),_0x49e783[0x0]);_0x446f79['text']=this['_map'][_0x20f8c2(_0x290c4c._0x56b013)]('_起点'),_0x1921e8=[_0x446f79];}const _0x36c109=_0x1921e8[0x0];_0x36c109[_0x20f8c2(_0x290c4c._0x34f754)]=_0x49e783[0x0],this[_0x20f8c2(_0x290c4c._0x1dc2d9)]=[_0x36c109];let _0x42e6b9=0x0;for(let _0x3be8d6=0x1,_0xfd2b9d=_0x49e783['length']-0x1;_0x3be8d6<_0xfd2b9d;_0x3be8d6++){var _0x467a24,_0x53882e;const _0x417e94=getSurfaceDistance([_0x49e783[_0x3be8d6-0x1],_0x49e783[_0x3be8d6]]);_0x42e6b9+=_0x417e94;const _0x4ffd50=this['_createLabel'](this['options']['label']||((_0x467a24=this['_layer'])===null||_0x467a24===void 0x0?void 0x0:(_0x53882e=_0x467a24[_0x20f8c2(_0x290c4c._0x22f568)])===null||_0x53882e===void 0x0?void 0x0:_0x53882e[_0x20f8c2(0x32a)]),_0x49e783[_0x3be8d6]);this['_arrPartMeasureLable']['push'](_0x4ffd50),_0x4ffd50[_0x20f8c2(_0x290c4c._0xe5bdc7)]={},_0x4ffd50['attr']['value']=_0x42e6b9,_0x4ffd50['attr']['valueFD']=_0x417e94,_0x4ffd50['showText']=function(){const _0x4cbb0e=_0x20f8c2,_0x59eb02={'unit':_0x33acb3['options']['unit'],'lang':_0x33acb3['_map']['lang'],'decimal':_0x33acb3[_0x4cbb0e(0x433)]['decimal']},_0x539828=formatDistance(this['attr']['value'],_0x59eb02);if(this['attr'][_0x4cbb0e(_0x4b8fa1._0x217ecb)]!==this[_0x4cbb0e(_0x4b8fa1._0x18bd92)][_0x4cbb0e(_0x4b8fa1._0x4c84e4)]){const _0x14e3b1=formatDistance(this[_0x4cbb0e(0xe12)]['valueFD'],_0x59eb02);this['text']=_0x539828,_0x33acb3['options']['showAddText']&&(this['text']+='\x0a(+'+_0x14e3b1+')');}else this['text']=_0x539828;},_0x4ffd50['showText']();}const _0x11e96c=getSurfaceDistance([_0x49e783[_0x49e783[_0x20f8c2(_0x290c4c._0x1dce98)]-0x2],_0x49e783[_0x49e783['length']-0x1]]);_0x42e6b9+=_0x11e96c,this[_0x20f8c2(0x7a4)]['distance']=_0x42e6b9,this['_measured']['distanceLastFd']=_0x11e96c,this[_0x20f8c2(0x852)](),this[_0x20f8c2(_0x290c4c._0x5ee8ea)]['position']=_0x49e783[_0x49e783['length']-0x1],this['_measureLable']['show']=!![],_0x32e0fb&&this[_0x20f8c2(_0x290c4c._0x205c7c)](EventType['change'],{'mtype':this['type'],'value':this[_0x20f8c2(0x7a4)]['distance'],'label':this[_0x20f8c2(0x7a4)][_0x20f8c2(0x83a)]},!![]);}}register$4(_0x3d5d32(0x489),DistanceMeasure);class DistanceSurfaceMeasure extends DistanceMeasure{constructor(_0x3f695f={}){const _0x2dc025={_0x2bcad7:0xdde},_0x492950=_0x3d5d32;super(_0x3f695f),_0x3f695f['_promise']&&(this['_promise']=_0x3f695f[_0x492950(0x227)],delete _0x3f695f['_promise']),_0x3f695f[_0x492950(_0x2dc025._0x2bcad7)]['clampToGround']=!![],_0x3f695f['splitNum']=_0x3f695f['splitNum']??0xc8,this['disTerrainScale']=1.2;}['_drawCreatedHandler'](_0x178ae8){const _0x3c93ed=_0x3d5d32;super['_drawCreatedHandler'](_0x178ae8,![]),this[_0x3c93ed(0x58d)](_0x178ae8);}[_0x3d5d32(0xe24)](_0x4a84cd){super['_editPointHandler'](_0x4a84cd,![]),this['updateLengthForTerrain'](_0x4a84cd);}['updateLengthForTerrain'](_0x304f19){const _0x571c4b={_0xeabf62:0x7f5,_0x1fecb6:0x1d1,_0x5d51d1:0x433,_0x2f2e95:0xf4a},_0x278ccb={_0x2cd7e1:0x1d1,_0x5e4378:0xf94,_0x56e83b:0x7a4,_0x22bbd8:0xbd7,_0x3e6aeb:0x73d,_0x49cdd5:0x227},_0x1aa6c7={_0x1c0a9a:0x1d1,_0x1a1068:0x7a4,_0x3110e0:0x852},_0x4cc8db=_0x3d5d32,_0x7f6ce8=this['positionsShow'];if(!_0x7f6ce8||_0x7f6ce8['length']<0x2)return;this['fire'](EventType['start'],{'mtype':this[_0x4cc8db(_0x571c4b._0xeabf62)],'graphic':this},!![]),getClampDistance(_0x7f6ce8,{'scene':this[_0x4cc8db(_0x571c4b._0x1fecb6)]['scene'],'splitNum':this['options']['splitNum'],'has3dtiles':this[_0x4cc8db(0x433)]['has3dtiles'],'exact':this[_0x4cc8db(_0x571c4b._0x5d51d1)]['exact'],'disTerrainScale':this[_0x4cc8db(_0x571c4b._0x2f2e95)],'endItem':_0x38d7fb=>{const _0x24b4b2=_0x4cc8db;if(!this[_0x24b4b2(_0x1aa6c7._0x1c0a9a)]||!this['_measureLable'])return;let _0x4cb4d8=_0x38d7fb['index'];const _0x435106=_0x38d7fb['all_distance'],_0x3277f2=_0x38d7fb['distance'];_0x4cb4d8++;const _0x32184c=this[_0x24b4b2(0xdd9)][_0x4cb4d8];if(_0x32184c)_0x32184c['attr'][_0x24b4b2(0x1062)]=_0x435106,_0x32184c['attr'][_0x24b4b2(0x2ee)]=_0x3277f2,_0x32184c['showText']();else _0x4cb4d8===_0x7f6ce8['length']-0x1&&this['_measureLable']&&(this['_measured']['distance']=_0x435106,this[_0x24b4b2(_0x1aa6c7._0x1a1068)]['distanceLastFd']=_0x3277f2,this[_0x24b4b2(_0x1aa6c7._0x3110e0)]());},'end':_0x2c95e5=>{const _0x350390=_0x4cc8db;var _0x6f796a;if(!this[_0x350390(_0x278ccb._0x2cd7e1)]||!this[_0x350390(_0x278ccb._0x5e4378)])return;this['_measured'][_0x350390(0xbd7)]=_0x2c95e5;const _0x3bca70={'mtype':this['type'],'graphic':this,'value':this[_0x350390(_0x278ccb._0x56e83b)][_0x350390(_0x278ccb._0x22bbd8)],'label':this[_0x350390(0x7a4)]['distanceStr']};this['fire'](EventType[_0x350390(_0x278ccb._0x3e6aeb)],_0x3bca70,!![]),this[_0x350390(0xefc)](EventType['end'],_0x3bca70,!![]),(_0x6f796a=this['_promise'])!==null&&_0x6f796a!==void 0x0&&_0x6f796a['resolve']&&this[_0x350390(_0x278ccb._0x49cdd5)][_0x350390(0xac9)](this);}});}}register$4(_0x3d5d32(0xe35),DistanceSurfaceMeasure);class SectionMeasure extends DistanceMeasure{constructor(_0x3b62d6={}){const _0x35fcca=_0x3d5d32;super(_0x3b62d6),_0x3b62d6['_promise']&&(this['_promise']=_0x3b62d6[_0x35fcca(0x227)],delete _0x3b62d6['_promise']),_0x3b62d6[_0x35fcca(0xdde)]['clampToGround']=!![],_0x3b62d6['splitNum']=_0x3b62d6['splitNum']??0xc8;}[_0x3d5d32(0x705)](_0x1d6cd0){const _0x590d26={_0x18597f:0x57d},_0x55ae60=_0x3d5d32;super['_drawCreatedHandler'](_0x1d6cd0,![]),this[_0x55ae60(_0x590d26._0x18597f)](_0x1d6cd0);}['_editPointHandler'](_0x18b2b9){super['_editPointHandler'](_0x18b2b9,![]),this['updateSectionForTerrain'](_0x18b2b9);}['updateSectionForTerrain'](_0x43c0c9){const _0x26874c={_0x13c92d:0x7f5,_0x403b5b:0x433,_0x480dd1:0x433,_0x347f87:0x5ec},_0x5dd359={_0x3d1765:0x1d1,_0x2f170d:0x73d,_0x8d8436:0xefc},_0x2381b7={_0x437b5d:0xd14,_0x5d871b:0x83e,_0x2abd8f:0xb75,_0x44ea9e:0xc84},_0x242de3=_0x3d5d32,_0x3ba661=this['positionsShow'];if(!_0x3ba661||_0x3ba661['length']<0x2)return;this['fire'](EventType['start'],{'mtype':this[_0x242de3(_0x26874c._0x13c92d)],'graphic':this},!![]);let _0x29d7b0=0x0;const _0x21e07b=[],_0x41de85=[],_0x266483=[],_0x5148a4=[];computeStepSurfaceLine({'map':this[_0x242de3(0x1d1)],'positions':_0x3ba661,'splitNum':this[_0x242de3(_0x26874c._0x403b5b)]['splitNum'],'has3dtiles':this[_0x242de3(_0x26874c._0x480dd1)]['has3dtiles'],'exact':this[_0x242de3(_0x26874c._0x480dd1)][_0x242de3(_0x26874c._0x347f87)],'endItem':(_0x4b535d,_0x34e7d6,_0x16c3cf)=>{const _0x28d58b=_0x242de3;var _0x246d19,_0x29479b;if(!this['_map']||!this[_0x28d58b(0xf94)])return;const _0x3c7e1d=(_0x246d19=Cesium__namespace['Cartographic']['fromCartesian'](_0x3ba661[_0x16c3cf]))===null||_0x246d19===void 0x0?void 0x0:_0x246d19['height'],_0x3f57a3=(_0x29479b=Cesium__namespace['Cartographic'][_0x28d58b(_0x2381b7._0x437b5d)](_0x3ba661[_0x16c3cf+0x1]))===null||_0x29479b===void 0x0?void 0x0:_0x29479b[_0x28d58b(_0x2381b7._0x5d871b)],_0x2d7969=(_0x3f57a3-_0x3c7e1d)/_0x4b535d['length'];let _0x123a0f=0x0;for(let _0x56962b=0x0;_0x56962b<_0x4b535d['length'];_0x56962b++){if(_0x56962b!==0x0){const _0x442dc1=Cesium__namespace['Cartesian3']['distance'](_0x4b535d[_0x56962b],_0x4b535d[_0x56962b-0x1]);_0x29d7b0+=_0x442dc1,_0x123a0f+=_0x442dc1;}_0x21e07b['push'](Number(_0x29d7b0['toFixed'](0x1)));const _0x120713=LngLatPoint[_0x28d58b(0xd14)](_0x4b535d[_0x56962b]);_0x41de85['push'](_0x120713['alt']),_0x5148a4['push'](_0x120713);const _0x48c347=Number((_0x3c7e1d+_0x2d7969*_0x56962b)['toFixed'](0x1));_0x266483[_0x28d58b(_0x2381b7._0x2abd8f)](_0x48c347);}_0x16c3cf++;const _0x4dde3b=this['_arrPartMeasureLable'][_0x16c3cf];if(_0x4dde3b)_0x4dde3b['attr']['value']=_0x29d7b0,_0x4dde3b[_0x28d58b(0xe12)]['valueFD']=_0x123a0f,_0x4dde3b['showText']();else _0x16c3cf===_0x3ba661[_0x28d58b(_0x2381b7._0x44ea9e)]-0x1&&this['_measureLable']&&(this['_measured']['distance']=_0x29d7b0,this['_measured']['distanceLastFd']=_0x123a0f,this['updateText']());},'end':()=>{const _0x53d902=_0x242de3;var _0x29c0c8;if(!this[_0x53d902(_0x5dd359._0x3d1765)]||!this['_measureLable'])return;this['updateText'](),this[_0x53d902(0x7a4)]['arrLen']=_0x21e07b,this['_measured']['arrLX']=_0x266483,this['_measured']['arrHB']=_0x41de85,this['_measured']['arrPoint']=_0x5148a4;const _0xe14aa4={'mtype':this['type'],'graphic':this,'value':_0x29d7b0,'label':this['_measured'][_0x53d902(0x83a)],...this['_measured']};this['fire'](EventType[_0x53d902(_0x5dd359._0x2f170d)],_0xe14aa4,!![]),this[_0x53d902(_0x5dd359._0x8d8436)](EventType['end'],_0xe14aa4,!![]),(_0x29c0c8=this['_promise'])!==null&&_0x29c0c8!==void 0x0&&_0x29c0c8['resolve']&&this['_promise']['resolve'](this);}});}}register$4(_0x3d5d32(0x666),SectionMeasure);const DEF_STYLE$j={'materialType':'PolylineArrow','color':'#ebe967','width':0x9,'clampToGround':!![]};class AngleMeasure extends PolylineEntity{constructor(_0x1a602b={}){const _0x2c27db=_0x3d5d32;_0x1a602b['hasMoveEdit']=![],_0x1a602b[_0x2c27db(0xa9c)]=0x2,_0x1a602b['decimal']=_0x1a602b['decimal']??0x2,_0x1a602b['angleDecimal']=_0x1a602b[_0x2c27db(0x30e)]??0x1,_0x1a602b['style']={...DEF_STYLE$j,..._0x1a602b['style']||{}},super(_0x1a602b),this['_measured']={};}get[_0x3d5d32(0xe06)](){return this['_measured'];}['_addedHook'](_0x220c2b){const _0x264880={_0x3e27b1:0x792,_0x387fba:0xe30,_0x120bcc:0x655,_0x10f972:0x433},_0x5591b1=_0x3d5d32;var _0x2d7eaa,_0x4645e9;super['_addedHook'](_0x220c2b),this['_measureLable']=this['_createLabel'](this['options']['label']||((_0x2d7eaa=this['_layer'])===null||_0x2d7eaa===void 0x0?void 0x0:(_0x4645e9=_0x2d7eaa['options'])===null||_0x4645e9===void 0x0?void 0x0:_0x4645e9['label'])),this['_measureLable'][_0x5591b1(_0x264880._0x3e27b1)]=![],this['on'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['on'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this['on'](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this[_0x5591b1(0x861)](EventType[_0x5591b1(_0x264880._0x387fba)],this['_drawCreatedHandler'],this),this['on'](EventType[_0x5591b1(_0x264880._0x120bcc)],this['_drawMouseMoveHandler'],this),this['on'](EventType['editRemovePoint'],this['_drawMouseMoveHandler'],this),this['on'](EventType['editMouseMove'],this['_drawMouseMoveHandler'],this),this[_0x5591b1(_0x264880._0x10f972)]['positions']&&(this['_measureLable']['show']=!![],this[_0x5591b1(0xa66)]());}[_0x3d5d32(0x367)](){super['_updatePositionsHook'](),this['_measureLable']['show']=!![],this['_drawMouseMoveHandler']();}['_removedHook'](){const _0x28c89b={_0x4877e5:0x9e7,_0x15c842:0xa66,_0x303443:0x566},_0xd82e80=_0x3d5d32;this[_0xd82e80(_0x28c89b._0x4877e5)](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this[_0xd82e80(0x9e7)](EventType['drawMouseMove'],this[_0xd82e80(0xa66)],this),this['off'](EventType[_0xd82e80(0x75c)],this['_drawRemovePointHandler'],this),this[_0xd82e80(0x9e7)](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['off'](EventType['editMovePoint'],this['_drawMouseMoveHandler'],this),this['off'](EventType['editRemovePoint'],this['_drawMouseMoveHandler'],this),this['off'](EventType['editMouseMove'],this[_0xd82e80(_0x28c89b._0x15c842)],this),Cesium__namespace['defined'](this['_measureLable'])&&(this['_removeLabel'](this['_measureLable']),delete this['_measureLable']),super[_0xd82e80(_0x28c89b._0x303443)]();}['_toJSON_Ex'](_0x186d33){const _0xa17a74=_0x3d5d32;_0x186d33['measured']=getAttrVal(this[_0xa17a74(0xe06)],{'onlySimpleType':!![]});}[_0x3d5d32(0x852)](_0x1bcea4){const _0x42cf1c={_0x50e917:0x433,_0x51bc3c:0x247,_0x238701:0xbd7,_0x219970:0x1d1,_0x314c18:0x26c,_0xe6caad:0xd4b,_0x220197:0x83a},_0x48b91c=_0x3d5d32;_0x1bcea4&&(this[_0x48b91c(_0x42cf1c._0x50e917)]['unit']=_0x1bcea4),this['_measured']['angleStr']=this['_measured'][_0x48b91c(_0x42cf1c._0x51bc3c)]['toFixed'](this[_0x48b91c(_0x42cf1c._0x50e917)]['angleDecimal'])+'°',this[_0x48b91c(0x7a4)]['distanceStr']=formatDistance(this['_measured'][_0x48b91c(_0x42cf1c._0x238701)],{'unit':this['options']['unit'],'lang':this['_map']['lang'],'decimal':this['options']['decimal']}),this[_0x48b91c(0xf94)]['text']=this[_0x48b91c(_0x42cf1c._0x219970)]['getLangText']('_角度')+':'+this['_measured'][_0x48b91c(_0x42cf1c._0x314c18)]+'\x0a'+this['_map'][_0x48b91c(0xd1b)](_0x48b91c(_0x42cf1c._0xe6caad))+':'+this['_measured'][_0x48b91c(_0x42cf1c._0x220197)];}[_0x3d5d32(0x4e3)](_0x5bda27){this['_drawMouseMoveHandler'](_0x5bda27);}['_drawRemovePointHandler'](_0x1b620a){const _0x240c91=_0x3d5d32;this['_measureLable']&&(this['_measureLable'][_0x240c91(0x792)]=![]);}[_0x3d5d32(0xa66)](_0x45bbca){const _0x67d13e={_0x490203:0xf94,_0x59e5fe:0xe95,_0x4489ee:0xb69,_0x1f66e1:0xefc,_0x2bc482:0x73d,_0x1d4b5a:0x247},_0x41904a=_0x3d5d32,_0x1625ca=this['positionsShow'];if(!_0x1625ca||_0x1625ca['length']<0x2){this[_0x41904a(_0x67d13e._0x490203)][_0x41904a(0x792)]=![];return;}this['_measured']['distance']=Cesium__namespace[_0x41904a(_0x67d13e._0x59e5fe)]['distance'](_0x1625ca[0x0],_0x1625ca[0x1]),this[_0x41904a(0x7a4)][_0x41904a(0x247)]=getAngle(_0x1625ca[0x0],_0x1625ca[0x1],!![]),this['updateText'](),this['_measureLable'][_0x41904a(_0x67d13e._0x4489ee)]=_0x1625ca[0x1],this[_0x41904a(0xf94)]['show']=!![],this[_0x41904a(_0x67d13e._0x1f66e1)](EventType[_0x41904a(_0x67d13e._0x2bc482)],{'mtype':this['type'],'value':this['_measured'][_0x41904a(_0x67d13e._0x1d4b5a)],'label':this['_measured']['angleStr']},!![]);}['_drawCreatedHandler'](_0xdb3857){const _0x2e19b9={_0xc81c0b:0x7f5,_0x33ec1d:0x247},_0x1212ab=_0x3d5d32;this['fire'](EventType['end'],{'mtype':this[_0x1212ab(_0x2e19b9._0xc81c0b)],'value':this['_measured'][_0x1212ab(_0x2e19b9._0x33ec1d)],'label':this['_measured']['angleStr']},!![]);}}register$4('angleMeasure',AngleMeasure);const DEF_STYLE$i={'materialType':_0x3d5d32(0x27f),'glowPower':0.1,'color':'#ebe12c','width':0x9};class HeightMeasure extends PolylineEntity{constructor(_0x3acb40={}){const _0x50810d={_0x4114e9:0x2da,_0x55f13d:0xdde},_0xc01f98=_0x3d5d32;_0x3acb40['hasMoveEdit']=![],_0x3acb40['maxPointNum']=0x2,_0x3acb40['decimal']=_0x3acb40[_0xc01f98(_0x50810d._0x4114e9)]??0x2,_0x3acb40['style']={...DEF_STYLE$i,..._0x3acb40[_0xc01f98(_0x50810d._0x55f13d)]||{}},super(_0x3acb40),this[_0xc01f98(0x7a4)]={};}get['measured'](){return this['_measured'];}[_0x3d5d32(0x226)](_0x3170c6){const _0x329de9={_0x105d8c:0x4e3,_0x1acd02:0xba0,_0x3d759b:0x705,_0x1c8378:0x8c0,_0x23a3d7:0xe24,_0x192276:0xbb8},_0x4f93ce=_0x3d5d32;super['_addedHook'](_0x3170c6),this['_initMeasureLable'](),this['on'](EventType['drawAddPoint'],this[_0x4f93ce(_0x329de9._0x105d8c)],this),this['on'](EventType['drawRemovePoint'],this[_0x4f93ce(_0x329de9._0x1acd02)],this),this['on'](EventType[_0x4f93ce(0x4a7)],this['_drawMouseMoveHandler'],this),this['once'](EventType['drawCreated'],this[_0x4f93ce(_0x329de9._0x3d759b)],this),this['on'](EventType['editMovePoint'],this['_editPointHandler'],this),this['on'](EventType[_0x4f93ce(_0x329de9._0x1c8378)],this['_editPointHandler'],this),this['on'](EventType['editMouseMove'],this[_0x4f93ce(_0x329de9._0x23a3d7)],this),this['options'][_0x4f93ce(_0x329de9._0x192276)]&&(this['_measureLable']['show']=!![],this['_editPointHandler']());}['_updatePositionsHook'](){const _0x5c8d16={_0x5d5220:0x367},_0x4c69b6=_0x3d5d32;super[_0x4c69b6(_0x5c8d16._0x5d5220)](),this['_measureLable']['show']=!![],this[_0x4c69b6(0xe24)]();}[_0x3d5d32(0x566)](){const _0x5eb35d={_0x57b59c:0xba0,_0x5748ab:0x9e7,_0x317248:0xe30,_0x5b3bfc:0x655,_0x41b9ff:0x9e7,_0x452d8f:0xe24,_0x32f445:0x310},_0x389a70=_0x3d5d32;this['off'](EventType['drawAddPoint'],this['_drawAddPointHandler'],this),this['off'](EventType['drawMouseMove'],this[_0x389a70(0xa66)],this),this['off'](EventType['drawRemovePoint'],this[_0x389a70(_0x5eb35d._0x57b59c)],this),this[_0x389a70(_0x5eb35d._0x5748ab)](EventType[_0x389a70(_0x5eb35d._0x317248)],this['_drawCreatedHandler'],this),this['off'](EventType[_0x389a70(_0x5eb35d._0x5b3bfc)],this['_editPointHandler'],this),this[_0x389a70(0x9e7)](EventType[_0x389a70(0x8c0)],this['_editPointHandler'],this),this[_0x389a70(_0x5eb35d._0x41b9ff)](EventType['editMouseMove'],this[_0x389a70(_0x5eb35d._0x452d8f)],this),this[_0x389a70(_0x5eb35d._0x32f445)](),super['_removedHook']();}['_toJSON_Ex'](_0x58c1b6){_0x58c1b6['measured']=getAttrVal(this['measured'],{'onlySimpleType':!![]});}['_initMeasureLable'](){const _0x24bd6b={_0x228bfb:0xd26},_0xa2fe5a=_0x3d5d32;var _0x1ffd30,_0x4aabba;this['_measureLable']=this[_0xa2fe5a(_0x24bd6b._0x228bfb)](this['options']['label']||((_0x1ffd30=this['_layer'])===null||_0x1ffd30===void 0x0?void 0x0:(_0x4aabba=_0x1ffd30[_0xa2fe5a(0x433)])===null||_0x4aabba===void 0x0?void 0x0:_0x4aabba[_0xa2fe5a(0x32a)])),this['_measureLable']['show']=![];}['_removeMeasureLabelAndEx'](){const _0x5df5ef={_0x5d59f7:0xf94},_0x140aab=_0x3d5d32;Cesium__namespace['defined'](this['_measureLable'])&&(this['_removeLabel'](this[_0x140aab(0xf94)]),delete this[_0x140aab(_0x5df5ef._0x5d59f7)]);}[_0x3d5d32(0x852)](_0x50a0e9){const _0x16a41d={_0x42196e:0x8da,_0x3cf784:0x83e,_0x1a8eff:0x76b,_0x2500e5:0xd1b},_0x4278c2=_0x3d5d32;_0x50a0e9&&(this['options']['unit']=_0x50a0e9),this['_measured'][_0x4278c2(_0x16a41d._0x42196e)]=formatDistance(this['_measured'][_0x4278c2(_0x16a41d._0x3cf784)],{'unit':this['options']['unit'],'lang':this['_map']['lang'],'decimal':this[_0x4278c2(0x433)]['decimal']}),this['_measureLable'][_0x4278c2(_0x16a41d._0x1a8eff)]=this['_map'][_0x4278c2(_0x16a41d._0x2500e5)]('_高度差')+':'+this['_measured']['heightStr'];}['_drawAddPointHandler'](_0x4601b8){this['_drawMouseMoveHandler'](_0x4601b8);}[_0x3d5d32(0xba0)](_0x4eb6b5){const _0x2621f3={_0x3a537f:0xf94},_0x43ef7d=_0x3d5d32;this['_measureLable']&&(this[_0x43ef7d(_0x2621f3._0x3a537f)]['show']=![]);}['_drawMouseMoveHandler'](_0xde9372){const _0x4079ea={_0x3b4d3d:0x326,_0x1710dd:0x83e,_0xd99dac:0xe04,_0x1afa8b:0xf94,_0x2fe1b7:0x7f5,_0x513325:0x8da},_0x211464=_0x3d5d32,_0x1ea458=this[_0x211464(_0x4079ea._0x3b4d3d)];if(!_0x1ea458||_0x1ea458['length']<0x2){this['_measureLable']['show']=![];return;}const _0x52d0de=Cesium__namespace['Cartographic']['fromCartesian'](_0x1ea458[0x0]),_0x375874=Cesium__namespace[_0x211464(0x220)]['fromCartesian'](_0x1ea458[0x1]);this['_measured']['height']=this['_map']['getRealAlt'](Math['abs'](_0x375874[_0x211464(_0x4079ea._0x1710dd)]-_0x52d0de['height'])),this['updateText'](),this['_measureLable']['position']=Cesium__namespace['Cartesian3'][_0x211464(_0x4079ea._0xd99dac)](_0x1ea458[0x0],_0x1ea458[0x1],new Cesium__namespace['Cartesian3']()),this[_0x211464(_0x4079ea._0x1afa8b)][_0x211464(0x792)]=!![],this[_0x211464(0xefc)](EventType['change'],{'mtype':this[_0x211464(_0x4079ea._0x2fe1b7)],'value':this['_measured']['height'],'label':this['_measured'][_0x211464(_0x4079ea._0x513325)]},!![]);}['_drawCreatedHandler'](_0x170e1d){this['fire'](EventType['end'],{'mtype':this['type'],'value':this['_measured']['height'],'label':this['_measured']['heightStr']},!![]);}['_editPointHandler'](_0x2519ed){const _0x2b07de={_0x9b32ec:0xa66},_0x5f11ae=_0x3d5d32;this[_0x5f11ae(_0x2b07de._0x9b32ec)](_0x2519ed);}}register$4('heightMeasure',HeightMeasure);class HeightTriangleMeasure extends HeightMeasure{['_initMeasureLable'](){const _0xb298e1={_0x39a864:0x32a,_0x92b23c:0xf16,_0x54a5a3:0x433},_0x262d75=_0x3d5d32;var _0x22d2bf,_0xf8b8bd,_0x248ff3,_0x217036;super['_initMeasureLable'](),this['_measureDistanceLable']=this['_createLabel'](this['options'][_0x262d75(_0xb298e1._0x39a864)]||((_0x22d2bf=this['_layer'])===null||_0x22d2bf===void 0x0?void 0x0:(_0xf8b8bd=_0x22d2bf[_0x262d75(0x433)])===null||_0xf8b8bd===void 0x0?void 0x0:_0xf8b8bd['label'])),this[_0x262d75(_0xb298e1._0x92b23c)]['pixelOffset']=new Cesium__namespace['Cartesian2'](0x0,0x0),this['_measureHorLable']=this['_createLabel'](this[_0x262d75(_0xb298e1._0x54a5a3)]['label']||((_0x248ff3=this['_layer'])===null||_0x248ff3===void 0x0?void 0x0:(_0x217036=_0x248ff3['options'])===null||_0x217036===void 0x0?void 0x0:_0x217036['label'])),this['_measureHorLable']['pixelOffset']=new Cesium__namespace['Cartesian2'](0x0,0x0);}['_removeMeasureLabelAndEx'](){const _0x19e795={_0x109be1:0x310},_0x5d837b=_0x3d5d32;super[_0x5d837b(_0x19e795._0x109be1)](),this['_measureDistanceLable']!=null&&(this['_removeLabel'](this['_measureDistanceLable']),delete this['_measureDistanceLable']),this[_0x5d837b(0x9f0)]!=null&&(this['_removeLabel'](this[_0x5d837b(0x9f0)]),delete this['_measureHorLable']),this['_measureExLine']!=null&&(this['dataSource']['entities'][_0x5d837b(0xf06)](this['_measureExLine']),delete this[_0x5d837b(0xfbb)]);}['updateText'](_0x54c1e5){const _0x46e071={_0x43873c:0x433,_0x592747:0x6b0,_0x2738c1:0x7a4,_0xbad136:0x7a4,_0x3a21b7:0xf7e},_0x1f7b4f=_0x3d5d32;super[_0x1f7b4f(0x852)](_0x54c1e5);const _0x43c584={'unit':this[_0x1f7b4f(_0x46e071._0x43873c)]['unit'],'lang':this['_map'][_0x1f7b4f(_0x46e071._0x592747)],'decimal':this['options']['decimal']};this[_0x1f7b4f(_0x46e071._0x2738c1)]['distanceStr']=formatDistance(this[_0x1f7b4f(_0x46e071._0x2738c1)]['distance'],_0x43c584),this['_measureDistanceLable'][_0x1f7b4f(0x76b)]=this['_map']['getLangText']('_空间距离')+':'+this['_measured']['distanceStr'],this['_measured']['distanceHorStr']=formatDistance(this['_measured'][_0x1f7b4f(0x7a8)],_0x43c584),this['_measureHorLable'][_0x1f7b4f(0x76b)]=this['_map']['getLangText'](_0x1f7b4f(0x26b))+':'+this[_0x1f7b4f(_0x46e071._0xbad136)][_0x1f7b4f(_0x46e071._0x3a21b7)];}[_0x3d5d32(0xba0)](_0x42ac06){const _0x110356={_0x591581:0xf94,_0x3d84b0:0xf16,_0x2b5f31:0xf78},_0xe81237=_0x3d5d32;this[_0xe81237(0xf94)]&&(this[_0xe81237(_0x110356._0x591581)]['show']=![]),this['_measureHorLable']&&(this['_measureHorLable']['show']=![]),this[_0xe81237(_0x110356._0x3d84b0)]&&(this['_measureDistanceLable'][_0xe81237(0x792)]=![]),this['_measureExLine']&&(this[_0xe81237(_0x110356._0x2b5f31)]=null);}[_0x3d5d32(0xa66)](_0x459b87){const _0x48ebd3={_0x9fecb7:0xe95,_0x504567:0xb69,_0x37f6f3:0xbd7,_0x2d4521:0xe04,_0x1771d1:0x9f0,_0x485a1c:0x852,_0x6ed292:0x393,_0x1c8275:0x83e},_0x2decd1=_0x3d5d32,_0x317925=this[_0x2decd1(0x326)];if(!_0x317925||_0x317925['length']<0x2){this['_measureLable']['show']=![];return;}const _0x3edb65=Cesium__namespace[_0x2decd1(0x220)]['fromCartesian'](_0x317925[0x0]),_0x5113aa=_0x3edb65['height'],_0x2fa147=Cesium__namespace['Cartographic']['fromCartesian'](_0x317925[0x1]),_0x529a3c=_0x2fa147['height'];let _0x2ddeba,_0x6c0dc4,_0x103d4f;_0x5113aa>_0x529a3c?(_0x6c0dc4=Cesium__namespace['Cartesian3']['fromRadians'](_0x2fa147[_0x2decd1(0xbfd)],_0x2fa147['latitude'],_0x5113aa),_0x103d4f=_0x317925[0x0],_0x2ddeba=_0x317925[0x1]):(_0x6c0dc4=Cesium__namespace[_0x2decd1(_0x48ebd3._0x9fecb7)][_0x2decd1(0x7d1)](_0x3edb65['longitude'],_0x3edb65['latitude'],_0x529a3c),_0x103d4f=_0x317925[0x1],_0x2ddeba=_0x317925[0x0]),this['_measured']['height']=this[_0x2decd1(0x1d1)][_0x2decd1(0xae2)](Math['abs'](_0x529a3c-_0x5113aa)),this['_measureLable'][_0x2decd1(_0x48ebd3._0x504567)]=Cesium__namespace[_0x2decd1(_0x48ebd3._0x9fecb7)]['midpoint'](_0x6c0dc4,_0x2ddeba,new Cesium__namespace['Cartesian3']()),this['_measureLable']['show']=!![],this[_0x2decd1(0x7a4)][_0x2decd1(_0x48ebd3._0x37f6f3)]=Cesium__namespace['Cartesian3'][_0x2decd1(0xbd7)](_0x103d4f,_0x2ddeba),this['_measureDistanceLable'][_0x2decd1(0xb69)]=Cesium__namespace['Cartesian3'][_0x2decd1(_0x48ebd3._0x2d4521)](_0x103d4f,_0x2ddeba,new Cesium__namespace['Cartesian3']()),this['_measureDistanceLable']['show']=!![],this['_measured']['distanceHor']=Cesium__namespace['Cartesian3'][_0x2decd1(0xbd7)](_0x6c0dc4,_0x103d4f),this[_0x2decd1(_0x48ebd3._0x1771d1)]['position']=Cesium__namespace['Cartesian3']['midpoint'](_0x6c0dc4,_0x103d4f,new Cesium__namespace[(_0x2decd1(0xe95))]()),this['_measureHorLable']['show']=!![],this[_0x2decd1(_0x48ebd3._0x485a1c)](),this[_0x2decd1(_0x48ebd3._0x6ed292)]([_0x2ddeba,_0x6c0dc4,_0x103d4f]),this[_0x2decd1(0xefc)](EventType['change'],{'mtype':this['type'],'value':this['_measured'][_0x2decd1(_0x48ebd3._0x1c8275)],'label':this['_measured']['heightStr']},!![]);}[_0x3d5d32(0x393)](_0x2cab8e){const _0x467f02={_0x49edcd:0xdde,_0x506dda:0x45f},_0x2c78e9=_0x3d5d32;this['_measureExLine_positions']=_0x2cab8e;if(!this['_measureExLine']){const _0xb17856={'id':this['id']+'-ex','polyline':PolylineStyleConver['toCesiumVal'](this[_0x2c78e9(0x433)][_0x2c78e9(_0x467f02._0x49edcd)],{},!![])};_0xb17856['polyline'][_0x2c78e9(0xbb8)]=new Cesium__namespace['CallbackProperty'](_0x5b803b=>{return this['_measureExLine_positions'];},![]),this['_measureExLine']=this[_0x2c78e9(_0x467f02._0x506dda)](_0xb17856),this['dataSource']['entities']['add'](this['_measureExLine']),this[_0x2c78e9(0xc6f)](this['_measureExLine']);}}[_0x3d5d32(0xe24)](_0x365229){const _0xf691c3={_0x2799dc:0xa66},_0x28ce50=_0x3d5d32;this[_0x28ce50(_0xf691c3._0x2799dc)](_0x365229);}}register$4('heightTriangleMeasure',HeightTriangleMeasure);const DEF_STYLE$h={'color':'#00fff2','outline':!![],'outlineColor':'#fafa5a','outlineWidth':0x1,'opacity':0.4,'clampToGround':![]};class AreaMeasure extends PolygonEntity{constructor(_0x39e80c={}){const _0x1cd750={_0x5e4f12:0x32a,_0x19126b:0x32a,_0x5d026b:0x1e7},_0x47f068=_0x3d5d32;_0x39e80c['hasMoveEdit']=![],_0x39e80c['decimal']=_0x39e80c['decimal']??0x2,_0x39e80c['style']={...DEF_STYLE$h,..._0x39e80c['style']||{}},_0x39e80c[_0x47f068(_0x1cd750._0x5e4f12)]&&(_0x39e80c[_0x47f068(_0x1cd750._0x19126b)]={'horizontalOrigin':Cesium__namespace[_0x47f068(_0x1cd750._0x5d026b)]['CENTER'],..._0x39e80c[_0x47f068(_0x1cd750._0x19126b)]}),super(_0x39e80c),this['_measured']={};}get['measured'](){return this['_measured'];}['_addedHook'](_0x3b17ad){const _0x444650={_0xea819b:0xa66,_0x105312:0x792},_0x783829=_0x3d5d32;var _0x4281ab,_0x544b37;super[_0x783829(0x226)](_0x3b17ad),this['_measureLable']=this[_0x783829(0xd26)](this['options']['label']||((_0x4281ab=this['_layer'])===null||_0x4281ab===void 0x0?void 0x0:(_0x544b37=_0x4281ab[_0x783829(0x433)])===null||_0x544b37===void 0x0?void 0x0:_0x544b37['label'])),this['_measureLable']['show']=![],this['on'](EventType[_0x783829(0x1050)],this['_drawAddPointHandler'],this),this['on'](EventType['drawRemovePoint'],this['_drawRemovePointHandler'],this),this['on'](EventType[_0x783829(0x4a7)],this[_0x783829(_0x444650._0xea819b)],this),this['once'](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['on'](EventType['editMovePoint'],this['_editPointHandler'],this),this['on'](EventType[_0x783829(0x8c0)],this['_editPointHandler'],this),this['options']['positions']&&(this['_measureLable'][_0x783829(_0x444650._0x105312)]=!![],this[_0x783829(0xe24)]());}['_updatePositionsHook'](){const _0x18d3dc={_0x1f91ef:0xf94},_0x4918d6=_0x3d5d32;super[_0x4918d6(0x367)](),this[_0x4918d6(_0x18d3dc._0x1f91ef)]&&(this['_measureLable']['show']=!![],this['_editPointHandler']());}['_removedHook'](){const _0x221e02={_0x1da9a7:0x1050,_0x11aeab:0x9e7,_0x422778:0xe24},_0x11e701=_0x3d5d32;this['off'](EventType[_0x11e701(_0x221e02._0x1da9a7)],this[_0x11e701(0x4e3)],this),this[_0x11e701(0x9e7)](EventType['drawMouseMove'],this['_drawMouseMoveHandler'],this),this['off'](EventType['drawRemovePoint'],this[_0x11e701(0xba0)],this),this[_0x11e701(_0x221e02._0x11aeab)](EventType['drawCreated'],this['_drawCreatedHandler'],this),this['off'](EventType['editMovePoint'],this[_0x11e701(_0x221e02._0x422778)],this),this[_0x11e701(0x9e7)](EventType['editRemovePoint'],this['_editPointHandler'],this),this['_removeMeasureLabelAndEx'](),super['_removedHook']();}['_toJSON_Ex'](_0x160899){const _0x3ab539=_0x3d5d32;_0x160899[_0x3ab539(0xe06)]=getAttrVal(this['measured'],{'onlySimpleType':!![],'noArray':!![]});}['_removeMeasureLabelAndEx'](){const _0x1b7175={_0x414dd4:0xb84},_0x21d76a=_0x3d5d32;Cesium__namespace[_0x21d76a(_0x1b7175._0x414dd4)](this['_measureLable'])&&(this['_removeLabel'](this['_measureLable']),delete this['_measureLable']);}['updateText'](_0x23980f){const _0x66be3c=_0x3d5d32;_0x23980f&&(this['options']['unit']=_0x23980f),this['_measured']['areaStr']=formatArea(this[_0x66be3c(0x7a4)]['area'],{'unit':this['options']['unit'],'lang':this['_map']['lang'],'decimal':this['options']['decimal']}),this['_measureLable']['text']=this['_map']['getLangText']('_面积')+':'+this['_measured']['areaStr'];}['startDraw'](_0x4801a8){const _0xc22e58=_0x3d5d32;var _0x450f6a;super[_0xc22e58(0x8d9)](_0x4801a8),this[_0xc22e58(0xa66)](),((_0x450f6a=this[_0xc22e58(0x433)]['positions'])===null||_0x450f6a===void 0x0?void 0x0:_0x450f6a['length'])>0x2&&this['stopDraw']();}['_drawAddPointHandler'](_0x320a54){this['_drawMouseMoveHandler'](_0x320a54);}['_drawRemovePointHandler'](_0x44c3c9){const _0x5638ba={_0x2d71dd:0xf94},_0x2d80fc=_0x3d5d32,_0x34a4a3=this['positionsShow'];(_0x34a4a3===null||_0x34a4a3===void 0x0?void 0x0:_0x34a4a3['length'])<0x3&&(this[_0x2d80fc(_0x5638ba._0x2d71dd)]['show']=![]);}['_drawMouseMoveHandler'](_0x25a777){const _0x592cd4={_0x46cea9:0x7a4},_0x321641=_0x3d5d32,_0x53f0e4=this['positionsShow'];if(_0x53f0e4[_0x321641(0xc84)]<0x3){this['_measureLable']&&(this['_measureLable']['show']=![]);return;}this[_0x321641(0x7a4)]['area']=getArea(_0x53f0e4),this['updateText']();const _0x2f910c=centerOfMass(_0x53f0e4);this['_measureLable']['position']=_0x2f910c,this['_measureLable']['show']=!![],this['fire'](EventType['change'],{'mtype':this[_0x321641(0x7f5)],'value':this['_measured']['area'],'label':this[_0x321641(_0x592cd4._0x46cea9)]['areaStr']},!![]);}['_drawCreatedHandler'](_0x9b45f0){const _0x245820={_0x453997:0x7a4},_0x5cccd6=_0x3d5d32;this['fire'](EventType['end'],{'mtype':this[_0x5cccd6(0x7f5)],'value':this[_0x5cccd6(_0x245820._0x453997)]['area'],'label':this[_0x5cccd6(_0x245820._0x453997)][_0x5cccd6(0x746)]},!![]);}[_0x3d5d32(0xe24)](_0x4bddc8){const _0x2a8630={_0x294afe:0xc84,_0x4e0488:0x7f5},_0x12b4a6=_0x3d5d32,_0xa5c316=this['positionsShow'];if(!_0xa5c316||_0xa5c316[_0x12b4a6(_0x2a8630._0x294afe)]<0x3)return;this['_measured']['area']=getArea(_0xa5c316),this['updateText'](),this['_measureLable']['position']=centerOfMass(_0xa5c316),this['fire'](EventType['change'],{'mtype':this[_0x12b4a6(_0x2a8630._0x4e0488)],'value':this['_measured']['area'],'label':this['_measured']['areaStr']},!![]);}}register$4(_0x3d5d32(0xd2a),AreaMeasure);class AreaSurfaceMeasure extends AreaMeasure{constructor(_0x450689={}){const _0x35a777={_0x287132:0x227},_0x56588b=_0x3d5d32;super(_0x450689),_0x450689['_promise']&&(this[_0x56588b(_0x35a777._0x287132)]=_0x450689['_promise'],delete _0x450689['_promise']),_0x450689['style'][_0x56588b(0x7c0)]=!![];}[_0x3d5d32(0x705)](_0x5039b9){this['updateAreaForTerrain'](_0x5039b9);}[_0x3d5d32(0xe24)](_0x3f46c8){const _0x26f607={_0x45dfe9:0xf04},_0xf3d329=_0x3d5d32;super[_0xf3d329(0xe24)](_0x3f46c8),this[_0xf3d329(_0x26f607._0x45dfe9)](_0x3f46c8);}[_0x3d5d32(0xf04)](_0x2adbaf){const _0x6f4a8={_0x1b3ee8:0x1d1,_0x28dd84:0x44d},_0x2f2999={_0x1f93fc:0xf94,_0x522dab:0xf94,_0x512544:0x7cb},_0x4c78ca=_0x3d5d32,_0x313e82=this['positionsShow'];if(!_0x313e82||_0x313e82['length']<0x3)return;this['fire'](EventType[_0x4c78ca(0xf6d)],{'mtype':this['type'],'graphic':this},!![]),getClampArea(_0x313e82,{'scene':this[_0x4c78ca(_0x6f4a8._0x1b3ee8)]['scene'],'splitNum':this[_0x4c78ca(0x433)][_0x4c78ca(0x7a6)],'has3dtiles':this[_0x4c78ca(0x433)]['has3dtiles'],'exact':this[_0x4c78ca(0x433)]['exact']})[_0x4c78ca(_0x6f4a8._0x28dd84)](_0x5be967=>{const _0x49b256=_0x4c78ca;var _0x3f95f2,_0x3f9b2c;if(!this['_map']||!this['_measureLable'])return;const _0x57f478=getPositionValue(this[_0x49b256(_0x2f2999._0x1f93fc)]['position'],(_0x3f95f2=this['_map'])===null||_0x3f95f2===void 0x0?void 0x0:_0x3f95f2['clock']['currentTime']);_0x57f478&&_0x5be967!==null&&_0x5be967!==void 0x0&&_0x5be967['maxHeight']&&(this[_0x49b256(_0x2f2999._0x522dab)]['position']=setPositionsHeight(_0x57f478,_0x5be967[_0x49b256(_0x2f2999._0x512544)]));this[_0x49b256(0x7a4)]['area']=_0x5be967[_0x49b256(0x772)],this[_0x49b256(0x852)]();const _0x35ade7={..._0x5be967,'mtype':this['type'],'value':this[_0x49b256(0x7a4)]['area'],'label':this['_measured']['areaStr']};this['fire'](EventType['change'],_0x35ade7,!![]),this[_0x49b256(0xefc)](EventType['end'],_0x35ade7,!![]),(_0x3f9b2c=this['_promise'])!==null&&_0x3f9b2c!==void 0x0&&_0x3f9b2c['resolve']&&this[_0x49b256(0x227)]['resolve'](this);});}}register$4(_0x3d5d32(0x1ec),AreaSurfaceMeasure);class VolumeMeasure extends AreaMeasure{constructor(_0x4ed41d={}){const _0x180b11={_0x7da4b3:0x227,_0x3f5249:0x4f1,_0x4d440e:0xf24},_0x1fa1af=_0x3d5d32;super(_0x4ed41d),_0x4ed41d['_promise']&&(this[_0x1fa1af(_0x180b11._0x7da4b3)]=_0x4ed41d[_0x1fa1af(0x227)],delete _0x4ed41d['_promise']),this['labelHeightStyle']={...this['options']['label']||{},'font_size':0xf,'background':![]},Cesium__namespace['defined'](_0x4ed41d['labelHeight'])&&(this['labelHeightStyle']={...this['labelHeightStyle'],..._0x4ed41d['labelHeight']}),this['polygonWallStyle']={'color':_0x1fa1af(_0x180b11._0x3f5249),'opacity':0.3,'closeTop':![],'closeBottom':!![],'perPositionHeight':![],'height':new Cesium__namespace['CallbackProperty'](_0x1f6e33=>{return this['minHeight'];},![]),'extrudedHeight':new Cesium__namespace['CallbackProperty'](_0x140d01=>{return this['maxHeight'];},![])},Cesium__namespace['defined'](_0x4ed41d['polygonWall'])&&(this['polygonWallStyle']={...this['polygonWallStyle'],..._0x4ed41d['polygonWall']}),this[_0x1fa1af(0x5e3)]=_0x4ed41d['heightLabel']??!![],this['offsetLabel']=_0x4ed41d['offsetLabel']??![],this['showArea']=_0x4ed41d['showArea']??!![],this['showFillVolume']=_0x4ed41d['showFillVolume']??!![],this[_0x1fa1af(_0x180b11._0x4d440e)]=_0x4ed41d['showDigVolume']??!![],this['_hasFX']=![];}get[_0x3d5d32(0x8eb)](){return![];}get[_0x3d5d32(0x578)](){const _0x316d3e={_0x4b4303:0x7cb},_0xdd0da8=_0x3d5d32;return this['interPolygonObj']?this['interPolygonObj'][_0xdd0da8(_0x316d3e._0x4b4303)]:this['maxHeight'];}get[_0x3d5d32(0x83e)](){return this['_jzmHeight'];}set['height'](_0xbf2ff4){const _0x3a899d={_0x4269b8:0x7cb},_0x45eaf6=_0x3d5d32;this['_jzmHeight']=_0xbf2ff4;_0xbf2ff4>this['maxHeight']&&(this[_0x45eaf6(_0x3a899d._0x4269b8)]=_0xbf2ff4);_0xbf2ff40x0){const _0xa2daad=this['_arrPartMeasureLable'];if(_0xa2daad&&_0xa2daad['length']>0x0)for(let _0x51d16e=0x0,_0x26433a=_0xa2daad['length'];_0x51d16e<_0x26433a;_0x51d16e++){this['_removeLabel'](_0xa2daad[_0x51d16e]);}delete this['_arrPartMeasureLable'];}Cesium__namespace[_0x591da5(_0x5a78f0._0x749ada)](this['_wallEntity'])&&(this['dataSource']['entities'][_0x591da5(_0x5a78f0._0x484256)](this[_0x591da5(_0x5a78f0._0x2b0505)]),delete this['_wallEntity']);}['_drawCreatedHandler'](_0x1c23b5){const _0xc71b35={_0x380e09:0x35c},_0x26b5aa=_0x3d5d32;this[_0x26b5aa(0xf94)]['text']=this['_map']['getLangText'](_0x26b5aa(_0xc71b35._0x380e09))+'…';const _0x2787cf=this['positionsShow'];setTimeout(()=>{this['calcVolume'](_0x2787cf);},0x64);}[_0x3d5d32(0xe24)](_0x4ea50a){this['_drawCreatedHandler'](_0x4ea50a);}['updateText'](_0x2f3cd1){const _0x18b467={_0x49b8d1:0x433,_0x36b238:0x7a4,_0x4ae452:0xd77,_0x594dfc:0xd77,_0x3d5bf6:0x7a4,_0x36750d:0xbab,_0x51563c:0xcd7,_0x18eeba:0xf94},_0x52b06f=_0x3d5d32;_0x2f3cd1&&(this[_0x52b06f(0x433)]['unit']=_0x2f3cd1);const _0x5bf99c={'unit':this[_0x52b06f(0x433)]['unit'],'lang':this['_map']['lang'],'decimal':this[_0x52b06f(_0x18b467._0x49b8d1)]['decimal']};let _0x1dcd27='';this['showFillVolume']&&this[_0x52b06f(_0x18b467._0x36b238)]['fillVolume']>0x0&&(this['_measured'][_0x52b06f(_0x18b467._0x4ae452)]=formatVolume(this[_0x52b06f(0x7a4)]['fillVolume'],_0x5bf99c),_0x1dcd27+=(this['options'][_0x52b06f(0x9c6)]||this['_map'][_0x52b06f(0xd1b)](_0x52b06f(0xf3f)))+':'+this[_0x52b06f(_0x18b467._0x36b238)][_0x52b06f(_0x18b467._0x594dfc)]+'\x0a'),this['showDigVolume']&&this[_0x52b06f(0x7a4)]['digVolume']>0x0&&(this['_measured']['digVolumeStr']=formatVolume(this[_0x52b06f(_0x18b467._0x3d5bf6)]['digVolume'],_0x5bf99c),_0x1dcd27+=(this['options'][_0x52b06f(_0x18b467._0x36750d)]||this['_map']['getLangText']('_挖方体积'))+':'+this['_measured']['digVolumeStr']+'\x0a'),this[_0x52b06f(_0x18b467._0x51563c)]&&this[_0x52b06f(0x7a4)]['totalArea']>0x0&&(this['_measured']['totalAreaStr']=formatArea(this['_measured'][_0x52b06f(0x79b)],_0x5bf99c),_0x1dcd27+=(this['options'][_0x52b06f(0x1085)]||this['_map']['getLangText']('_横切面积'))+':'+this['_measured']['totalAreaStr']),this[_0x52b06f(_0x18b467._0x18eeba)][_0x52b06f(0x76b)]=_0x1dcd27;}['calcVolume'](_0xc20d31){const _0x12d9f6={_0x2c1ce2:0x1d1,_0x42242e:0xfc1,_0x38eb5e:0x5d9},_0x102bdf=_0x3d5d32;if(!this['_map']||!_0xc20d31||_0xc20d31['length']<0x3)return;this['fire'](EventType['start'],{'mtype':this['type'],'sourceTarget':this,'positions':_0xc20d31},!![]),this['_hasFX']=!![],interPolygon({'positions':_0xc20d31,'scene':this['_map']['scene'],'exact':!![],...this[_0x102bdf(0x433)]})['then'](_0x9ecb0=>{const _0x400eef=_0x102bdf;if(!this['_map']||!this['_hasFX'])return;if(_0x9ecb0[_0x400eef(0x24f)])this[_0x400eef(_0x12d9f6._0x2c1ce2)][_0x400eef(0xfc1)]['globe']['depthTestAgainstTerrain']=![];else!this[_0x400eef(_0x12d9f6._0x2c1ce2)][_0x400eef(_0x12d9f6._0x42242e)]['globe']['depthTestAgainstTerrain']&&(this['_map']['scene']['globe'][_0x400eef(_0x12d9f6._0x38eb5e)]=!![],this['_depthTestAgainstTerrain_reset']=!![]);this['showVolume'](_0xc20d31,_0x9ecb0);});}['showVolume'](_0x10208f,_0x42dcf4){const _0x31c48f={_0x3b824a:0xbd9,_0x469b56:0xa28,_0x5de7ba:0xfc1,_0x38af03:0xf68,_0xba745d:0x1cb,_0x37f27c:0x7a4,_0x6eb0ac:0x5e3,_0x34556c:0xcae,_0x5367a9:0x9d3,_0x16b1bc:0x66a,_0x4e5d9f:0xac9},_0x57c463=_0x3d5d32;var _0x1ec4b2;this[_0x57c463(_0x31c48f._0x3b824a)]=this[_0x57c463(0x433)]['height']??_0x42dcf4['minHeight'];this['_jzmHeight']<_0x42dcf4[_0x57c463(0xa28)]&&(_0x42dcf4['minHeight']=this['_jzmHeight']);this['interPolygonObj']=updateVolumeByMinHeight(_0x42dcf4),this['_minHeight']=this['options'][_0x57c463(_0x31c48f._0x469b56)]??this[_0x57c463(0x331)][_0x57c463(0xa28)],this['_maxHeight']=this['options']['maxHeight']??this['interPolygonObj']['maxHeight'];const _0x1e6b78=Math['floor'](0.3*Cesium__namespace['Math']['chordLength'](_0x42dcf4['granularity'],this['_map'][_0x57c463(_0x31c48f._0x5de7ba)]['globe']['ellipsoid'][_0x57c463(_0x31c48f._0x38af03)]));this['_maxHeight']-this['_minHeight']<_0x1e6b78&&(this['_maxHeight']=this[_0x57c463(_0x31c48f._0xba745d)]+_0x1e6b78);const _0x4f9965=updateVolume(this[_0x57c463(0x331)],this['height']);for(const _0x35096f in _0x4f9965){this[_0x57c463(_0x31c48f._0x37f27c)][_0x35096f]=_0x4f9965[_0x35096f];}this['updateText'](),this['_measureLable']['position']=centerOfMass(_0x10208f,this['interPolygonObj']['maxHeight']);this[_0x57c463(_0x31c48f._0x6eb0ac)]&&this[_0x57c463(_0x31c48f._0x34556c)](_0x10208f,this['interPolygonObj']['minHeight']);this['_entity']['_noMousePick']=!![],this['entityGraphic']['perPositionHeight']=![],this['entityGraphic'][_0x57c463(0xfdb)]=new Cesium__namespace[(_0x57c463(_0x31c48f._0x5367a9))](_0x10208f),this[_0x57c463(0xa09)]['height']=new Cesium__namespace[(_0x57c463(0xc6d))](_0x36bf8c=>{return this['height'];},![]);const _0x3468cf=PolygonStyleConver['toCesiumVal'](this['polygonWallStyle'],{},!![]);_0x3468cf[_0x57c463(0xfdb)]=new Cesium__namespace['PolygonHierarchy'](_0x10208f);Cesium__namespace['defined'](this['_wallEntity'])&&this['dataSource']['entities'][_0x57c463(0xf06)](this[_0x57c463(_0x31c48f._0x16b1bc)]);this['_wallEntity']=this['dataSource']['entities']['add']({'polygon':_0x3468cf,'show':this['show']}),this['_wallEntity']['_noMousePick']=!![],this['bindPickId'](this['_wallEntity']);const _0x2bf1f6={..._0x4f9965,'sourceTarget':this,'mtype':this['type'],'graphic':this};this['fire'](EventType['change'],_0x2bf1f6,!![]),this['fire'](EventType['end'],_0x2bf1f6,!![]),(_0x1ec4b2=this['_promise'])!==null&&_0x1ec4b2!==void 0x0&&_0x1ec4b2['resolve']&&this['_promise'][_0x57c463(_0x31c48f._0x4e5d9f)](this);}['showPointHeightLabel'](_0x4cf1ae,_0x52bcfb){const _0x29b94a={_0x4784b3:0xe12,_0x5511c3:0x9a4,_0x5960eb:0x719,_0x36d072:0x1d1,_0x58bde4:0x1d1,_0x53951b:0xd1b},_0x38d11a=_0x3d5d32,_0x2c736=this;if(Cesium__namespace['defined'](this['_arrPartMeasureLable'])&&this['_arrPartMeasureLable']['length']>0x0){const _0x335f50=this[_0x38d11a(0xdd9)];if(_0x335f50&&_0x335f50['length']>0x0)for(let _0xe5c2a2=0x0,_0x1116c6=_0x335f50['length'];_0xe5c2a2<_0x1116c6;_0xe5c2a2++){this['_removeLabel'](_0x335f50[_0xe5c2a2]);}delete this['_arrPartMeasureLable'];}const _0x400320=[];for(let _0x2b9bab=0x0;_0x2b9bab<_0x4cf1ae['length'];_0x2b9bab++){const _0xdb2c67=Math['max'](getHeight(this['_map']['scene'],_0x4cf1ae[_0x2b9bab]),_0x52bcfb),_0x24f085=Cesium__namespace['Cartographic']['fromCartesian'](_0x4cf1ae[_0x2b9bab]),_0x1d4cc0=Cesium__namespace[_0x38d11a(0xe95)][_0x38d11a(0x7d1)](_0x24f085[_0x38d11a(0xbfd)],_0x24f085['latitude'],_0xdb2c67),_0x575e86=this['_createLabel'](this['labelHeightStyle'],_0x1d4cc0);_0x575e86[_0x38d11a(0xe12)]={'value':_0xdb2c67},_0x400320[_0x38d11a(0xb75)](_0x575e86),_0x575e86['showText']=function(){const _0x1ac62e=_0x38d11a,_0xd6724=this[_0x1ac62e(_0x29b94a._0x4784b3)]['value'];let _0x164116=_0x2c736['_map']['getLangText'](_0x1ac62e(_0x29b94a._0x5511c3))+':'+_0xd6724[_0x1ac62e(_0x29b94a._0x5960eb)](0x2)+_0x2c736[_0x1ac62e(0x1d1)][_0x1ac62e(0xd1b)]('_米');if(_0x2c736[_0x1ac62e(0xa1e)]){const _0x578bcf=_0xd6724-_0x2c736[_0x1ac62e(0x83e)];_0x578bcf>0x0?_0x164116+='\x0a'+_0x2c736['_map'][_0x1ac62e(0xd1b)]('_高度')+':'+_0x578bcf['toFixed'](0x2)+_0x2c736[_0x1ac62e(_0x29b94a._0x36d072)]['getLangText']('_米')+'('+_0x2c736[_0x1ac62e(_0x29b94a._0x58bde4)]['getLangText']('_面上')+')':_0x164116+='\x0a'+_0x2c736['_map'][_0x1ac62e(_0x29b94a._0x53951b)]('_高度')+':'+Math['abs'](_0x578bcf)[_0x1ac62e(_0x29b94a._0x5960eb)](0x2)+_0x2c736['_map']['getLangText']('_米')+'('+_0x2c736['_map']['getLangText']('_面下')+')';}return this[_0x1ac62e(0x76b)]=_0x164116,_0x164116;},_0x575e86['showText']();}this['_arrPartMeasureLable']=_0x400320;}}register$4('volumeMeasure',VolumeMeasure);class VolumeDepthMeasure extends AreaMeasure{constructor(_0xab0eb5={}){const _0x5bb190={_0x3156f0:0xb84,_0x33d2c4:0x424,_0xcb56a8:0x433,_0x553a9b:0x4f1,_0x509096:0x21b},_0x33d990=_0x3d5d32;super(_0xab0eb5),_0xab0eb5[_0x33d990(0x227)]&&(this[_0x33d990(0x227)]=_0xab0eb5['_promise'],delete _0xab0eb5['_promise']),this['labelHeightStyle']={...this[_0x33d990(0x433)]['label']||{},'font_size':0xf,'background':![]},Cesium__namespace[_0x33d990(_0x5bb190._0x3156f0)](_0xab0eb5[_0x33d990(_0x5bb190._0x33d2c4)])&&(this['labelHeightStyle']={...this['labelHeightStyle'],..._0xab0eb5['labelHeight']}),this['_cutColor']=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x33d990(0xaf0)](getCesiumColor(_0xab0eb5['cutColor'],Cesium__namespace['Color']['RED']['withAlpha'](0.5))),this[_0x33d990(0xfdd)]=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x33d990(0xaf0)](getCesiumColor(_0xab0eb5['fillColor'],Cesium__namespace['Color']['YELLOW'][_0x33d990(0xe57)](0.5))),this['options']['offsetHeight']=this[_0x33d990(_0x5bb190._0xcb56a8)]['offsetHeight']??0x0,this['polygonWallStyle']={'color':_0x33d990(_0x5bb190._0x553a9b),'opacity':0.3,'closeTop':![],'closeBottom':!![],'perPositionHeight':![],'height':new Cesium__namespace['CallbackProperty'](_0x413cbf=>{return this['minHeight'];},![]),'extrudedHeight':new Cesium__namespace['CallbackProperty'](_0x3ea807=>{return this['maxHeight'];},![])},Cesium__namespace['defined'](_0xab0eb5['polygonWall'])&&(this[_0x33d990(0xdc4)]={...this['polygonWallStyle'],..._0xab0eb5[_0x33d990(0x7e6)]}),this['heightLabel']=_0xab0eb5['heightLabel']??!![],this['offsetLabel']=_0xab0eb5['offsetLabel']??![],this[_0x33d990(0xcd7)]=_0xab0eb5['showArea']??!![],this['showFillVolume']=_0xab0eb5['showFillVolume']??!![],this['showDigVolume']=_0xab0eb5['showDigVolume']??!![],this[_0x33d990(0x3eb)]=_0xab0eb5['showBox']??!![],this[_0x33d990(0x604)]=_0xab0eb5['showPoly']??!![],this['_showWall']=_0xab0eb5['showWall']??![],this[_0x33d990(_0x5bb190._0x509096)]=![];}get['hasEdit'](){return![];}get[_0x3d5d32(0x578)](){return this['_measured']?this['_measured']['maxHeight']:this['maxHeight'];}get[_0x3d5d32(0x83e)](){return this['_jzmHeight'];}set[_0x3d5d32(0x83e)](_0x59a814){const _0x2816f0={_0x56cfdc:0x802},_0xf7c887=_0x3d5d32;this['_jzmHeight']=_0x59a814;_0x59a814>this['maxHeight']&&(this['maxHeight']=_0x59a814);_0x59a8140x0){const _0x392511=this['_arrPartMeasureLable'];if(_0x392511&&_0x392511['length']>0x0)for(let _0x1620c8=0x0,_0x11dd86=_0x392511['length'];_0x1620c8<_0x11dd86;_0x1620c8++){this['_removeLabel'](_0x392511[_0x1620c8]);}delete this[_0x336e2b(_0xf401f7._0xf4e087)];}Cesium__namespace['defined'](this['_wallEntity'])&&(this['dataSource']['entities']['remove'](this['_wallEntity']),delete this['_wallEntity']);}['_drawCreatedHandler'](_0xccd6af){const _0x31f166={_0x3537bd:0x76b,_0x2722f:0xd1b},_0x60ab39=_0x3d5d32;this['_measureLable'][_0x60ab39(_0x31f166._0x3537bd)]=this['_map'][_0x60ab39(_0x31f166._0x2722f)](_0x60ab39(0x35c))+'…';const _0x55837f=this['positionsShow'];(_0x55837f===null||_0x55837f===void 0x0?void 0x0:_0x55837f['length'])>0x3&&setTimeout(()=>{this['calcVolume'](_0x55837f);},0x64);}['_editPointHandler'](_0x164ee5){this['_drawCreatedHandler'](_0x164ee5);}['updateText'](_0x1d6c78){const _0x2b457f={_0x1b8004:0x433,_0x4d66fc:0xef9,_0xda43b6:0x2da,_0x31c80c:0x312,_0x3dda8f:0xd77,_0x35d129:0xf24,_0x8d1594:0x7a4,_0xaecf5a:0xad2,_0x9cba72:0x1085,_0x2b6e99:0x1d1},_0x2cb000=_0x3d5d32;_0x1d6c78&&(this['options']['unit']=_0x1d6c78);const _0x3472a3={'unit':this[_0x2cb000(_0x2b457f._0x1b8004)][_0x2cb000(_0x2b457f._0x4d66fc)],'lang':this['_map']['lang'],'decimal':this[_0x2cb000(_0x2b457f._0x1b8004)][_0x2cb000(_0x2b457f._0xda43b6)]};let _0x1a76fd='';this['showFillVolume']&&this['_measured'][_0x2cb000(_0x2b457f._0x31c80c)]>0x0&&(this[_0x2cb000(0x7a4)]['fillVolumeStr']=formatVolume(this['_measured']['fillVolume'],_0x3472a3),_0x1a76fd+=(this['options'][_0x2cb000(0x9c6)]||this['_map']['getLangText']('_填方体积'))+':'+this['_measured'][_0x2cb000(_0x2b457f._0x3dda8f)]+'\x0a'),this[_0x2cb000(_0x2b457f._0x35d129)]&&this[_0x2cb000(0x7a4)]['digVolume']>0x0&&(this[_0x2cb000(_0x2b457f._0x8d1594)][_0x2cb000(0xad2)]=formatVolume(this['_measured']['digVolume'],_0x3472a3),_0x1a76fd+=(this['options']['digVolumeName']||this['_map']['getLangText']('_挖方体积'))+':'+this['_measured'][_0x2cb000(_0x2b457f._0xaecf5a)]+'\x0a'),this['showArea']&&this['_measured']['totalArea']>0x0&&(this['_measured']['totalAreaStr']=formatArea(this['_measured'][_0x2cb000(0x79b)],_0x3472a3),_0x1a76fd+=(this['options'][_0x2cb000(_0x2b457f._0x9cba72)]||this[_0x2cb000(_0x2b457f._0x2b6e99)]['getLangText']('_横切面积'))+':'+this['_measured'][_0x2cb000(0x51b)]),this[_0x2cb000(0xf94)]['text']=_0x1a76fd;}['calcVolume'](_0x426cf3){const _0x457447={_0x67171a:0xf94,_0x837618:0x792,_0x59a118:0x89b,_0x4ad9f1:0xf37,_0x19feda:0xc84,_0x4fe1b0:0x792},_0x387bce={_0xcd8343:0x83e,_0x61271c:0x7a4,_0x197b7a:0x1cb,_0x44574c:0x433,_0x2b95f3:0x2a2,_0x5d21d0:0x426,_0x586801:0xb44,_0x441c45:0x227},_0x5c10f1=_0x3d5d32;if(!this['_map'])return;this[_0x5c10f1(0xefc)](EventType['start'],{'mtype':this[_0x5c10f1(0x7f5)],'sourceTarget':this,'positions':_0x426cf3},!![]),this[_0x5c10f1(0x21b)]=!![],this[_0x5c10f1(_0x457447._0x67171a)][_0x5c10f1(_0x457447._0x837618)]=![],this[_0x5c10f1(_0x457447._0x59a118)]['show']=![];if(this[_0x5c10f1(_0x457447._0x4ad9f1)])for(let _0x33ce0f=0x0,_0x155443=this['_entity_outlines'][_0x5c10f1(_0x457447._0x19feda)];_0x33ce0f<_0x155443;_0x33ce0f++){const _0x431fad=this[_0x5c10f1(0xf37)][_0x33ce0f]['polyline'];_0x431fad[_0x5c10f1(_0x457447._0x4fe1b0)]=![];}interPolygonByDepth({'scene':this['_map']['scene'],'positions':_0x426cf3,'splitNum':this['options']['splitNum'],'cameraHeight':this['options']['cameraHeight']})[_0x5c10f1(0x44d)](_0x3338e7=>{const _0x2541a7=_0x5c10f1;var _0x5d7ac8;if(this['isDestroy'])return;this['_measured']=_0x3338e7,this['_jzmHeight']=this['options'][_0x2541a7(_0x387bce._0xcd8343)]??_0x3338e7['minHeight'];this['_jzmHeight']<_0x3338e7['minHeight']&&(_0x3338e7[_0x2541a7(0xa28)]=this[_0x2541a7(0xbd9)]);this[_0x2541a7(_0x387bce._0x61271c)]=this[_0x2541a7(0x802)](_0x3338e7),this[_0x2541a7(_0x387bce._0x197b7a)]=this[_0x2541a7(_0x387bce._0x44574c)]['minHeight']??this['_measured'][_0x2541a7(0xa28)],this[_0x2541a7(0x2cc)]=this[_0x2541a7(0x433)]['maxHeight']??this['_measured'][_0x2541a7(0x7cb)],this['updateText'](),this['_measureLable']['position']=centerOfMass(_0x426cf3,this['_maxHeight']),this['_measureLable'][_0x2541a7(0x792)]=!![];this['heightLabel']&&this['showPointHeightLabel'](_0x426cf3,this[_0x2541a7(0x1cb)]);if(this['_showPoly']){this['_entity'][_0x2541a7(0x792)]=!![];if(this[_0x2541a7(0xf37)])for(let _0x5d8dfa=0x0,_0x282dba=this['_entity_outlines']['length'];_0x5d8dfa<_0x282dba;_0x5d8dfa++){const _0x3a2e28=this['_entity_outlines'][_0x5d8dfa]['polyline'];_0x3a2e28['show']=!![];}this['_entity']['_noMousePick']=!![],this['entityGraphic'][_0x2541a7(0x8bc)]=![],this['entityGraphic'][_0x2541a7(0xfdb)]=new Cesium__namespace[(_0x2541a7(0x9d3))](_0x426cf3),this['entityGraphic']['height']=new Cesium__namespace['CallbackProperty'](_0x2da677=>{return this['height'];},![]);}if(this[_0x2541a7(_0x387bce._0x2b95f3)]){const _0x44a426=PolygonStyleConver['toCesiumVal'](this['polygonWallStyle'],{},!![]);_0x44a426['hierarchy']=new Cesium__namespace['PolygonHierarchy'](_0x426cf3),this['_wallEntity']=this[_0x2541a7(_0x387bce._0x5d21d0)]['entities']['add']({'polygon':_0x44a426}),this[_0x2541a7(0x66a)][_0x2541a7(_0x387bce._0x586801)]=!![],this['bindPickId'](this[_0x2541a7(0x66a)]);}const _0x56ac3b={...this['_measured'],'sourceTarget':this,'mtype':this['type'],'graphic':this};this[_0x2541a7(0xefc)](EventType['change'],_0x56ac3b,!![]),this[_0x2541a7(0xefc)](EventType['end'],_0x56ac3b,!![]),(_0x5d7ac8=this['_promise'])!==null&&_0x5d7ac8!==void 0x0&&_0x5d7ac8['resolve']&&this[_0x2541a7(_0x387bce._0x441c45)]['resolve'](this);});}['updateVolume'](_0x582c87){const _0x3693ee={_0x523fcc:0xfdd,_0x1edecb:0xc54,_0x55be6a:0xc84},_0xeb87d9=_0x3d5d32;!_0x582c87&&(_0x582c87=this['_measured']);const _0x5b4e10=_0x582c87['minHeight'],_0xc79c46=this['height'],_0x20980f=_0x582c87[_0xeb87d9(0x57b)]['area'],_0x10d574=[],_0xdbe1a6=this['options'][_0xeb87d9(0x804)];let _0x3acd15=0x0,_0x703c8=0x0;for(let _0x54f0dc=0x0,_0x3fba5e=_0x582c87[_0xeb87d9(0xc25)];_0x54f0dc<_0x3fba5e;_0x54f0dc++){const _0x4e24e7=_0x582c87['positions'][_0x54f0dc];let _0x34d8f5=_0x4e24e7['height'];_0x34d8f5<_0x5b4e10&&(_0x34d8f5=_0x5b4e10);if(_0x34d8f5>_0xc79c46){_0x3acd15+=_0x20980f*(_0x34d8f5-_0xc79c46);if(this['showBox']){const _0x32b669=_0x4e24e7['getOutline']();_0x10d574['push'](new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['PolygonOutlineGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x32b669),'extrudedHeight':_0x34d8f5+_0xdbe1a6,'height':_0xc79c46+_0xdbe1a6}),'attributes':{'color':this['_cutColor']}}));}}else{if(_0x34d8f5<_0xc79c46){_0x703c8+=_0x20980f*(_0xc79c46-_0x34d8f5);if(this['showBox']){const _0xfec96c=_0x4e24e7[_0xeb87d9(0xe8a)]();_0x10d574['push'](new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['PolygonOutlineGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0xfec96c),'extrudedHeight':_0xc79c46+_0xdbe1a6,'height':_0x34d8f5+_0xdbe1a6}),'attributes':{'color':this[_0xeb87d9(_0x3693ee._0x523fcc)]}}));}}}}return _0x582c87['digVolume']=_0x3acd15,_0x582c87['fillVolume']=_0x703c8,this[_0xeb87d9(0xc54)]&&(this[_0xeb87d9(0x873)][_0xeb87d9(0x5f4)][_0xeb87d9(0xf06)](this[_0xeb87d9(_0x3693ee._0x1edecb)]),delete this[_0xeb87d9(_0x3693ee._0x1edecb)]),this['showBox']&&_0x10d574[_0xeb87d9(_0x3693ee._0x55be6a)]>0x0&&(this[_0xeb87d9(0xc54)]=new Cesium__namespace['Primitive']({'geometryInstances':_0x10d574,'appearance':new Cesium__namespace['PerInstanceColorAppearance']({'flat':!![],'renderState':{'lineWidth':0x1}}),'asynchronous':!![]}),this['_layer']['primitiveCollection'][_0xeb87d9(0xff3)](this['_primitive_boxs']),this['_primitive_boxs'][_0xeb87d9(0xb44)]=!![],this['bindPickId'](this[_0xeb87d9(0xc54)])),_0x582c87;}['showPointHeightLabel'](_0x2c64b7,_0xf929b2){const _0x47195a={_0x3212a9:0xc84},_0x5efffe={_0x306c81:0x9a4,_0x26ef89:0x719,_0x425da6:0x1d1,_0x376821:0x76b},_0x3d364e=_0x3d5d32,_0x32ebe1=this,_0x28b9f2=[];for(let _0x5dd679=0x0;_0x5dd679<_0x2c64b7[_0x3d364e(_0x47195a._0x3212a9)];_0x5dd679++){const _0xcc819d=Math[_0x3d364e(0xe8e)](getHeight(this['_map']['scene'],_0x2c64b7[_0x5dd679]),_0xf929b2),_0x193dfc=Cesium__namespace[_0x3d364e(0x220)]['fromCartesian'](_0x2c64b7[_0x5dd679]),_0x1118ad=Cesium__namespace['Cartesian3']['fromRadians'](_0x193dfc['longitude'],_0x193dfc[_0x3d364e(0x406)],_0xcc819d),_0x5ac4d6=this[_0x3d364e(0xd26)](this[_0x3d364e(0x800)],_0x1118ad);_0x5ac4d6['attr']={'value':_0xcc819d},_0x28b9f2['push'](_0x5ac4d6),_0x5ac4d6['showText']=function(){const _0x17a0c4=_0x3d364e,_0x306b8b=this['attr']['value'];let _0x116532=_0x32ebe1['_map']['getLangText'](_0x17a0c4(_0x5efffe._0x306c81))+':'+_0x306b8b['toFixed'](0x2)+_0x32ebe1['_map']['getLangText']('_米');if(_0x32ebe1['offsetLabel']){const _0x5643cc=_0x306b8b-_0x32ebe1['height'];_0x5643cc>0x0?_0x116532+='\x0a'+_0x32ebe1['_map']['getLangText'](_0x17a0c4(0xd68))+':'+_0x5643cc[_0x17a0c4(_0x5efffe._0x26ef89)](0x2)+_0x32ebe1['_map']['getLangText']('_米')+'('+_0x32ebe1[_0x17a0c4(_0x5efffe._0x425da6)]['getLangText']('_面上')+')':_0x116532+='\x0a'+_0x32ebe1['_map']['getLangText']('_高度')+':'+Math['abs'](_0x5643cc)['toFixed'](0x2)+_0x32ebe1['_map'][_0x17a0c4(0xd1b)]('_米')+'('+_0x32ebe1['_map']['getLangText']('_面下')+')';}return this[_0x17a0c4(_0x5efffe._0x376821)]=_0x116532,_0x116532;},_0x5ac4d6['showText']();}this['_arrPartMeasureLable']=_0x28b9f2;}}register$4('volumeDepthMeasure',VolumeDepthMeasure);class BillboardPrimitive extends BasePointPrimitive{get['primitiveCollection'](){var _0x30db69;return(_0x30db69=this['_layer'])===null||_0x30db69===void 0x0?void 0x0:_0x30db69['billboardCollection'];}get['image'](){return this['style']['image'];}set['image'](_0x19db38){const _0x4e35ef=_0x3d5d32;this[_0x4e35ef(0xdde)]['image']=_0x19db38,this['_primitive']&&(this['_primitive']['image']=_0x19db38);}['_showHook'](_0x47d2ec){const _0x220144=_0x3d5d32;if(this[_0x220144(0x517)])this['_primitive']['show']=_0x47d2ec;else _0x47d2ec&&super['_showHook'](_0x47d2ec);}[_0x3d5d32(0x226)](_0xa741a){const _0x5d8be3=_0x3d5d32;if(!this['show'])return;this['_forPositionProperty'](this[_0x5d8be3(0x433)]['position']);const _0x2d092b=BillboardStyleConver['toCesiumVal'](_0xa741a,{'show':this['show'],'position':this['position']});this['_primitive']=this[_0x5d8be3(0x5f4)][_0x5d8be3(0xff3)](_0x2d092b),this['style'][_0x5d8be3(0x32a)]&&this['_addLabel']();}[_0x3d5d32(0x7b3)](_0x392008,_0x41babe){BillboardStyleConver['toCesiumVal'](_0x392008,this['primitive']);}[_0x3d5d32(0x53e)](_0x3b73a1,_0x1b0d30){return BillboardStyleConver['toJSON'](_0x3b73a1,_0x1b0d30);}['_updatePositionsHook'](){const _0x4d5a26={_0x2ece4f:0xb69,_0x38043c:0x4bb},_0x29f95c=_0x3d5d32;if(!this['_primitive']['_billboardCollection'])return;this['_primitive'][_0x29f95c(_0x4d5a26._0x2ece4f)]=this['position'],Cesium__namespace['defined'](this['style']['alignedAxis'])&&(this['_primitive'][_0x29f95c(_0x4d5a26._0x38043c)]=getCesiumValue(this['style']['alignedAxis'],Cesium__namespace['Cartesian3']));}['setOpacity'](_0x3b01ef){const _0x451f15={_0x369599:0x7a7},_0xcf34c4=_0x3d5d32;this[_0xcf34c4(0xdde)]['globalAlpha']=_0x3b01ef,this['_primitive']&&(this['_primitive']['color']=Cesium__namespace['Color'][_0xcf34c4(_0x451f15._0x369599)]['withAlpha'](_0x3b01ef)),this['_updateLabelOpacity'](_0x3b01ef);}[_0x3d5d32(0xac7)](_0x2e3d4f,_0x5c932a){const _0x32bf91=_0x3d5d32;return create$4(_0x32bf91(0x4a5),_0x2e3d4f);}}register$4(_0x3d5d32(0xa35),BillboardPrimitive,!![]);class CloudPrimitive extends BasePointPrimitive{get['primitiveCollection'](){var _0x229016;return(_0x229016=this['_layer'])===null||_0x229016===void 0x0?void 0x0:_0x229016['cloudCollection'];}get['maximumSize'](){return this['style']['maximumSize'];}set['maximumSize'](_0x514158){const _0x5f0355=_0x3d5d32;this[_0x5f0355(0xdde)]['maximumSize']=_0x514158,this['_primitive']&&(this['_primitive']['maximumSize']=_0x514158);}get['scale'](){const _0x292c0c=_0x3d5d32;return this[_0x292c0c(0xdde)]['scale'];}set['scale'](_0x19fd39){const _0x429cde=_0x3d5d32;this[_0x429cde(0xdde)]['scale']=_0x19fd39,this['_primitive']&&(this['_primitive']['scale']=_0x19fd39);}get['slice'](){return this['style']['slice'];}set[_0x3d5d32(0x444)](_0x3e0204){const _0x40d550={_0x13cdc5:0x444},_0x55fe29=_0x3d5d32;this['style']['slice']=_0x3e0204,this['_primitive']&&(this['_primitive'][_0x55fe29(_0x40d550._0x13cdc5)]=_0x3e0204);}get['brightness'](){const _0x28cb54={_0x415a2d:0xd6f},_0x52b1ac=_0x3d5d32;return this['style'][_0x52b1ac(_0x28cb54._0x415a2d)];}set['brightness'](_0x253909){const _0x29ae5d={_0x31cb82:0xdde},_0x57d7f0=_0x3d5d32;this[_0x57d7f0(_0x29ae5d._0x31cb82)]['brightness']=_0x253909,this['_primitive']&&(this[_0x57d7f0(0x517)]['brightness']=_0x253909);}get['hasOpacity'](){return![];}['_addedHook'](_0x5622b1){const _0x4bb840={_0x4e4d08:0x517},_0x571110=_0x3d5d32;if(!this[_0x571110(0x792)])return;this[_0x571110(0x673)](this['options']['position']);const _0x26f501=CloudStyleConver[_0x571110(0x83d)](_0x5622b1,{'show':this['show'],'position':this[_0x571110(0xb69)]});this[_0x571110(_0x4bb840._0x4e4d08)]=this['primitiveCollection']['add'](_0x26f501),this[_0x571110(0xdde)][_0x571110(0x32a)]&&this[_0x571110(0x3d2)]();}[_0x3d5d32(0x68e)](_0x2de6ad){const _0x1558b0={_0x41abbc:0x792},_0x1aab90=_0x3d5d32;this['_primitive']?this['_primitive'][_0x1aab90(_0x1558b0._0x41abbc)]=_0x2de6ad:super['_showHook'](_0x2de6ad);}['_updateStyleHook'](_0x30cbfa,_0x4212f7){const _0x2c2d7c={_0x34cfbd:0x83d},_0x2c60ef=_0x3d5d32;CloudStyleConver[_0x2c60ef(_0x2c2d7c._0x34cfbd)](_0x30cbfa,this['primitive']);}['_style2Json'](_0x2c5eb5,_0x2b3c52){return CloudStyleConver['toJSON'](_0x2c5eb5,_0x2b3c52);}['_updatePositionsHook'](){this['_primitive']['position']=this['position'];}[_0x3d5d32(0xac7)](_0x59d4c8,_0x3571cd){const _0x3af841=_0x3d5d32;return this[_0x3af841(0x2cf)](_0x59d4c8,_0x3571cd);}}register$4('cloud',CloudPrimitive,!![]);class LabelPrimitive extends BasePointPrimitive{get['primitiveCollection'](){const _0x4ca36f={_0x30ce6f:0x873,_0x40b39d:0x6e2},_0x4dad7d=_0x3d5d32;var _0x1d3f4e;return(_0x1d3f4e=this[_0x4dad7d(_0x4ca36f._0x30ce6f)])===null||_0x1d3f4e===void 0x0?void 0x0:_0x1d3f4e[_0x4dad7d(_0x4ca36f._0x40b39d)];}get[_0x3d5d32(0x76b)](){const _0xcaf74b=_0x3d5d32;return this['style'][_0xcaf74b(0x76b)];}set[_0x3d5d32(0x76b)](_0x7c8bba){const _0x545277=_0x3d5d32;this['style'][_0x545277(0x76b)]=_0x7c8bba,this['_primitive']&&(this['_primitive']['text']=_0x7c8bba);}['_showHook'](_0x1d0750){const _0x267b57=_0x3d5d32;if(this['_primitive'])this[_0x267b57(0x517)][_0x267b57(0x792)]=_0x1d0750;else _0x1d0750&&super[_0x267b57(0x68e)](_0x1d0750);}['_addedHook'](_0x5e9825){const _0x302e4a={_0x461703:0x517},_0x111574=_0x3d5d32;if(!this['show'])return;const _0xa9e3b0=LabelStyleConver['toCesiumVal'](this['style'],{'show':this['show'],'position':this[_0x111574(0xb69)]},{},this[_0x111574(0xe12)]);this[_0x111574(_0x302e4a._0x461703)]=this['primitiveCollection']['add'](_0xa9e3b0),this['_bindMorphComplete']();}['_removedHook'](){super['_removedHook'](),this['_unbindMorphComplete']();}['_bindMorphComplete'](){const _0x437b53={_0x56cfc7:0x7c0},_0x453bda=_0x3d5d32;this['_unbindMorphComplete'](),this[_0x453bda(0xdde)][_0x453bda(_0x437b53._0x56cfc7)]&&this['_map']['on'](EventType['morphComplete'],this['_map_morphCompleteHandler'],this);}[_0x3d5d32(0x661)](){const _0x38bb59=_0x3d5d32;this['_map']['off'](EventType[_0x38bb59(0x918)],this['_map_morphCompleteHandler'],this);}[_0x3d5d32(0x28d)](_0x16a836){const _0x5d5421={_0x3824a0:0x517,_0x367eca:0x27d,_0x486dfa:0x7c0,_0x29cc22:0x2d5},_0x5c4c26=_0x3d5d32;this['_map'][_0x5c4c26(0xfc1)]['mode']===Cesium__namespace['SceneMode']['SCENE2D']?this[_0x5c4c26(_0x5d5421._0x3824a0)]['heightReference']=Cesium__namespace['HeightReference']['NONE']:this['_primitive'][_0x5c4c26(_0x5d5421._0x367eca)]=this['style'][_0x5c4c26(_0x5d5421._0x486dfa)]?Cesium__namespace[_0x5c4c26(_0x5d5421._0x29cc22)][_0x5c4c26(0xe25)]:Cesium__namespace[_0x5c4c26(_0x5d5421._0x29cc22)]['NONE'];}[_0x3d5d32(0x7b3)](_0x683eee,_0x2612a2){const _0x15f6f0={_0x36a21c:0x83d,_0x14de7c:0x8ec,_0x138943:0xb84,_0x49639e:0x7c0},_0x46fc4d=_0x3d5d32;LabelStyleConver[_0x46fc4d(_0x15f6f0._0x36a21c)](_0x683eee,this[_0x46fc4d(_0x15f6f0._0x14de7c)],this['attr']),Cesium__namespace[_0x46fc4d(_0x15f6f0._0x138943)](_0x2612a2[_0x46fc4d(_0x15f6f0._0x49639e)])&&(this['_bindMorphComplete'](),this['_map_morphCompleteHandler']());}['_style2Json'](_0x423e0c,_0x338ceb){const _0x4546ef=_0x3d5d32;return LabelStyleConver[_0x4546ef(0x3db)](_0x423e0c,_0x338ceb);}['_updatePositionsHook'](){const _0x312bed=_0x3d5d32;this['_primitive'][_0x312bed(0xb69)]=this['position'];}['_getDrawEntityClass'](_0x72958f,_0x2f0f82){return create$4('label',_0x72958f);}['setOpacity'](_0xfc6068){const _0x41216f=_0x3d5d32;this['style']['globalAlpha']=_0xfc6068,this[_0x41216f(0x517)]&&this['show']&&LabelStyleConver['setOpacity'](this['_primitive'],_0xfc6068);}}register$4('labelP',LabelPrimitive,!![]);class ModelPrimitive extends BasePointPrimitive{constructor(_0x3a3659={}){super(_0x3a3659),this['_readyPromise']=Cesium__namespace['defer']();}get['czmObjectEx'](){const _0x4366c4={_0x24ff1b:0xfcf},_0x6314ae=_0x3d5d32,_0x1d96a5=[];return this['_primitive_label']&&_0x1d96a5['push'](this['_primitive_label']),this[_0x6314ae(0xebe)]&&_0x1d96a5['push'](this['_primitive_point']),this[_0x6314ae(_0x4366c4._0x24ff1b)]&&_0x1d96a5[_0x6314ae(0xb75)](this['_primitive_billboard']),_0x1d96a5;}get[_0x3d5d32(0x515)](){const _0x47fe44={_0x4f349f:0xdde},_0x26bbb1=_0x3d5d32;return this[_0x26bbb1(_0x47fe44._0x4f349f)]['scale']??0x1;}set['scale'](_0x1a83a6){const _0x3fb147={_0x362d4d:0x7b3},_0x15eefc=_0x3d5d32;this['style']['scale']=_0x1a83a6,this[_0x15eefc(_0x3fb147._0x362d4d)](this['style'],{'scale':_0x1a83a6});}get['scaleX'](){const _0x4eaf56=_0x3d5d32;return this[_0x4eaf56(0xdde)]['scaleX']??0x1;}set['scaleX'](_0xcdf4ec){this['style']['scaleX']=_0xcdf4ec,this['updateModelMatrix']();}get['scaleY'](){const _0x478343={_0x33211c:0xdde},_0x529788=_0x3d5d32;return this[_0x529788(_0x478343._0x33211c)]['scaleY']??0x1;}set['scaleY'](_0x49e94f){this['style']['scaleY']=_0x49e94f,this['updateModelMatrix']();}get['scaleZ'](){return this['style']['scaleZ']??0x1;}set[_0x3d5d32(0x3c5)](_0x3af7c3){const _0x2e07f0={_0x242b3e:0xdde},_0x25c134=_0x3d5d32;this[_0x25c134(_0x2e07f0._0x242b3e)]['scaleZ']=_0x3af7c3,this['updateModelMatrix']();}get['readyPromise'](){return this['_readyPromise']['promise'];}[_0x3d5d32(0x68e)](_0xf514b2){if(this['_primitive'])this['_primitive']['show']=_0xf514b2;else _0xf514b2&&super['_showHook'](_0xf514b2);}[_0x3d5d32(0x226)](_0x42d571){const _0x13d2db={_0x475681:0xb69,_0xdeac35:0xdde,_0x5e7af8:0xe1a,_0x3acd07:0xb69,_0x360bf1:0x382,_0xab22cc:0xdde,_0x57f276:0xb27,_0x31dd2a:0x873,_0x1223bd:0xa13},_0x592ab1={_0x88c19:0x517},_0x3cb9cb=_0x3d5d32;if(!this['show']||!this['_map'])return;this['_forPositionProperty'](this['options'][_0x3cb9cb(_0x13d2db._0x475681)]);const _0x2e7046=ModelStyleConver['toCesiumVal'](this[_0x3cb9cb(_0x13d2db._0xdeac35)]);if(!_0x2e7046['url'])return;Cesium__namespace[_0x3cb9cb(_0x13d2db._0x5e7af8)]['fromGltfAsync']({'modelMatrix':this['modelMatrix'],'scene':this['_map']['scene'],'marsOptions':{'occlusion':this['style']['marsOcclusion']},..._0x2e7046})['then'](_0x555c30=>{const _0x56df98={_0x3cfc1f:0x642,_0x20b0ab:0xac9},_0x87a562=_0x3cb9cb;this['bindPickId'](_0x555c30),this[_0x87a562(_0x592ab1._0x88c19)]=this['primitiveCollection']['add'](_0x555c30),this[_0x87a562(_0x592ab1._0x88c19)][_0x87a562(0x89e)]['addEventListener'](()=>{const _0x57a993=_0x87a562;var _0x278e78;(this['style']['runAnimations']??!![])&&(_0x278e78=_0x555c30['activeAnimations'])!==null&&_0x278e78!==void 0x0&&_0x278e78['addAll']&&_0x555c30[_0x57a993(_0x56df98._0x3cfc1f)]['addAll']({'loop':Cesium__namespace['ModelAnimationLoop'][_0x57a993(0xb57)],...this['style']}),this[_0x57a993(0xefc)](EventType['load'],{'drawtype':this['type'],'model':_0x555c30,'graphic':this},!![]),this['_readyPromise'][_0x57a993(_0x56df98._0x20b0ab)](this);});});this['style']['label']&&this['_addLabel']();if(this[_0x3cb9cb(0xdde)]['distanceDisplayCondition']){if(this['style']['distanceDisplayPoint']){var _0x4ada82;const _0x2c40aa=PointStyleConver['toCesiumVal'](this['style']['distanceDisplayPoint'],{'show':this['show'],'position':this[_0x3cb9cb(_0x13d2db._0x3acd07)]});_0x2c40aa['distanceDisplayCondition']=this['_getTargetDistanceDisplayCondition'](this['style'][_0x3cb9cb(_0x13d2db._0x360bf1)]),this['_primitive_point']=(_0x4ada82=this['_layer'])===null||_0x4ada82===void 0x0?void 0x0:_0x4ada82['pointCollection']['add'](_0x2c40aa);}else{if(this['style']['distanceDisplayBillboard']){var _0x562df5;const _0x237b18=BillboardStyleConver[_0x3cb9cb(0x83d)](this[_0x3cb9cb(_0x13d2db._0xab22cc)]['distanceDisplayBillboard'],{'show':this[_0x3cb9cb(0x792)],'position':this['position']});_0x237b18[_0x3cb9cb(0x8f0)]=this[_0x3cb9cb(_0x13d2db._0x57f276)](this['style'][_0x3cb9cb(0x76a)]),this['_primitive_billboard']=(_0x562df5=this[_0x3cb9cb(_0x13d2db._0x31dd2a)])===null||_0x562df5===void 0x0?void 0x0:_0x562df5[_0x3cb9cb(_0x13d2db._0x1223bd)]['add'](_0x237b18);}}}}['_removedHook'](){const _0x543492={_0x1118c9:0xebe,_0x772ec:0xfcf},_0x4ce09d=_0x3d5d32;super['_removedHook']();if(this[_0x4ce09d(_0x543492._0x1118c9)]){var _0x13c777;(_0x13c777=this['_layer'])===null||_0x13c777===void 0x0?void 0x0:_0x13c777[_0x4ce09d(0xc3e)][_0x4ce09d(0xf06)](this['_primitive_point']),delete this['_primitive_point'];}if(this[_0x4ce09d(_0x543492._0x772ec)]){var _0xa2dfd2;(_0xa2dfd2=this['_layer'])===null||_0xa2dfd2===void 0x0?void 0x0:_0xa2dfd2[_0x4ce09d(0xa13)]['remove'](this[_0x4ce09d(0xfcf)]),delete this['_primitive_billboard'];}}['_updateStyleHook'](_0x3b9d95,_0x3a8dbb){const _0x31d5aa={_0x5ca84e:0xe39,_0x1dbcca:0x5cf,_0x485b5c:0xb84,_0x5e0e13:0x515,_0x11dbc7:0xb84},_0x487e7e=_0x3d5d32;if(_0x3a8dbb['url']){this['redraw'](_0x3b9d95);return;}ModelStyleConver['toCesiumVal'](_0x3b9d95,this['primitive']),(Cesium__namespace['defined'](_0x3a8dbb[_0x487e7e(_0x31d5aa._0x5ca84e)])||Cesium__namespace['defined'](_0x3a8dbb[_0x487e7e(_0x31d5aa._0x1dbcca)])||Cesium__namespace[_0x487e7e(0xb84)](_0x3a8dbb['roll'])||Cesium__namespace[_0x487e7e(_0x31d5aa._0x485b5c)](_0x3a8dbb[_0x487e7e(_0x31d5aa._0x5e0e13)])||Cesium__namespace['defined'](_0x3a8dbb['scaleX'])||Cesium__namespace[_0x487e7e(0xb84)](_0x3a8dbb['scaleY'])||Cesium__namespace[_0x487e7e(_0x31d5aa._0x11dbc7)](_0x3a8dbb['scaleZ']))&&(this['_primitive']['modelMatrix']=this['modelMatrix']);}[_0x3d5d32(0x53e)](_0x506613,_0x4d2cb8){return ModelStyleConver['toJSON'](_0x506613,_0x4d2cb8);}['_updatePositionsHook'](){const _0x530e3f={_0x6f6878:0xb69},_0x1863b1=_0x3d5d32;this['_primitive']['modelMatrix']=this['modelMatrix'],this['_primitive_point']&&(this['_primitive_point']['position']=this['position']),this[_0x1863b1(0xfcf)]&&(this['_primitive_billboard'][_0x1863b1(_0x530e3f._0x6f6878)]=this['position']);}['_getTargetDistanceDisplayCondition'](_0x517cdb){const _0xab4016={_0x20b74f:0x73a},_0x45618e=_0x3d5d32;let _0x41ba39;if(this['style']['distanceDisplayCondition']instanceof Cesium__namespace[_0x45618e(0xe4a)])_0x41ba39=this['style'][_0x45618e(0x8f0)]['far'];else this[_0x45618e(0xdde)]['distanceDisplayCondition_far']&&(_0x41ba39=this[_0x45618e(0xdde)]['distanceDisplayCondition_far']);return new Cesium__namespace['DistanceDisplayCondition'](_0x517cdb[_0x45618e(_0xab4016._0x20b74f)]??_0x41ba39,_0x517cdb['distanceDisplayCondition_far']??Number['MAX_VALUE']);}['setOpacity'](_0x2d2f2a){const _0x4ae4f8=_0x3d5d32;this['style'][_0x4ae4f8(0xc96)]=_0x2d2f2a,this[_0x4ae4f8(0x517)]&&ModelStyleConver['setOpacity'](this['_primitive'],_0x2d2f2a),this['_updateLabelOpacity'](_0x2d2f2a);}[_0x3d5d32(0xac7)](_0x12d913,_0x1c3e48){const _0x49f1f0=_0x3d5d32;return create$4(_0x49f1f0(0x600),_0x12d913);}}register$4('modelP',ModelPrimitive,!![]);class CirclePrimitive extends BasePointPrimitive{get[_0x3d5d32(0xbd7)](){return Math['PI']*0x2*this['radius'];}get['area'](){const _0x356b89=this['radius'];return Math['PI']*_0x356b89*_0x356b89;}get['radius'](){return this['style']['radius'];}set[_0x3d5d32(0xd61)](_0x389bff){const _0x52e829=_0x3d5d32;this['style']['radius']=_0x389bff,this[_0x52e829(0x7b3)](this['style'],{'radius':_0x389bff});}get[_0x3d5d32(0x4ef)](){return this['getOutlinePositions']();}['_conversionStyle'](_0x4dbb73){const _0x27c5b8=_0x3d5d32;return CircleStyleConver[_0x27c5b8(0x83d)](_0x4dbb73);}[_0x3d5d32(0x53e)](_0x120c55,_0xe4c02f){return CircleStyleConver['toJSON'](_0x120c55,_0xe4c02f);}['_createGeometryInstance'](_0x2a66be,_0x12fee7){const _0x59e822={_0x127868:0xe72,_0x51a11f:0xf90},_0x529afc=_0x3d5d32;var _0x431609;_0x2a66be[_0x529afc(_0x59e822._0x127868)]=this['position'],_0x2a66be[_0x529afc(0x83e)]=_0x2a66be[_0x529afc(0x83e)]??((_0x431609=this['point'])===null||_0x431609===void 0x0?void 0x0:_0x431609['alt'])??0x0;Cesium__namespace['defined'](this['style']['diffHeight'])&&(_0x2a66be['extrudedHeight']=_0x2a66be['height']+this['style']['diffHeight']);const _0x589c55=_0x12fee7?Cesium__namespace['CircleOutlineGeometry']:Cesium__namespace[_0x529afc(0xcf4)];return new Cesium__namespace[(_0x529afc(0x263))]({'id':this['id'],'geometry':new _0x589c55(_0x2a66be),'attributes':this['options'][_0x529afc(_0x59e822._0x51a11f)]});}['_getPolylineOutlinePositions'](){return[this['getOutlinePositions'](![])];}[_0x3d5d32(0x459)](_0x410138,_0x50b322,_0x277be5){return cartesians2lonlats(this['getOutlinePositions'](_0x410138,_0x50b322),_0x277be5);}['getOutlinePositions'](_0x2cfb68=!![],_0x7b9615){const _0x494d65={_0x5ce278:0xdde,_0x2a1269:0xb75},_0x15d94e=_0x3d5d32,_0x329f54=getEllipseOuterPositions({'position':this['position'],'radius':this['radius'],'granularity':this['style']['granularity'],'count':_0x7b9615});if(_0x2cfb68&&_0x329f54){var _0x5c500d;_0x329f54['push'](_0x329f54[0x0]),(this['style'][_0x15d94e(0xa54)]>0x4||((_0x5c500d=this[_0x15d94e(_0x494d65._0x5ce278)]['outlineStyle'])===null||_0x5c500d===void 0x0?void 0x0:_0x5c500d['width'])>0x4)&&_0x329f54[_0x15d94e(_0x494d65._0x2a1269)](_0x329f54[0x1]);}return _0x329f54;}[_0x3d5d32(0xd67)](_0x38e368={}){const _0x57550c={_0x1f55f1:0xd61,_0x790bd4:0xd61,_0x38043d:0x1d1,_0x244227:0xb69},_0x55618f=_0x3d5d32;if(!this[_0x55618f(0x1d1)])return Promise['resolve'](![]);return _0x38e368[_0x55618f(_0x57550c._0x1f55f1)]=this[_0x55618f(_0x57550c._0x790bd4)]*(_0x38e368[_0x55618f(0x515)]||1.8),this[_0x55618f(_0x57550c._0x38043d)]['flyToPoint'](this[_0x55618f(_0x57550c._0x244227)],_0x38e368);}['getRectangle'](_0x29d486){const _0x129fdb={_0x491492:0xdd7},_0x9103f2=_0x3d5d32,_0x290bb6=this[_0x9103f2(_0x129fdb._0x491492)](![],0x1);if(!_0x290bb6||_0x290bb6['length']===0x0)return;const _0x4f20a9=getRectangle(_0x290bb6,_0x29d486===null||_0x29d486===void 0x0?void 0x0:_0x29d486['isFormat']);return _0x4f20a9;}[_0x3d5d32(0xe23)](_0x538786){const _0x1cfd3c={_0x2314ad:0xed4,_0x848eb3:0xbd7},_0x2b6b45=_0x3d5d32;_0x538786=LngLatPoint['parse'](_0x538786)[_0x2b6b45(_0x1cfd3c._0x2314ad)](),_0x538786=setPositionsHeight(_0x538786,this[_0x2b6b45(0x83e)]);const _0x12560f=Cesium__namespace['Cartesian3'][_0x2b6b45(_0x1cfd3c._0x848eb3)](this[_0x2b6b45(0xb69)],_0x538786);return _0x12560f<=this['radius'];}['_getDrawEntityClass'](_0x378e9a,_0x5f28d9){const _0x517ee7={_0x436386:0x654},_0x32e407=_0x3d5d32;return create$4(_0x32e407(_0x517ee7._0x436386),_0x378e9a);}}register$4('circleP',CirclePrimitive,!![]);class PlanePrimitive extends BasePointPrimitive{get[_0x3d5d32(0xd93)](){const _0x56420c={_0x3e8633:0x433,_0x2b1201:0x83d,_0x2817a0:0xf5d,_0x18395f:0xe95,_0x43e97b:0x9dc,_0x5afd03:0xf2a,_0x15a12c:0x37e},_0x1f7851=_0x3d5d32;var _0x5f009a,_0x38cb33,_0x50a2a8;if(this['options']['modelMatrix'])return this[_0x1f7851(_0x56420c._0x3e8633)]['modelMatrix'];const _0x187663=super['modelMatrix'];if(!this['position'])return Cesium__namespace['Matrix4']['IDENTITY'];const _0x487b76=PlaneStyleConver[_0x1f7851(_0x56420c._0x2b1201)](this['style']),_0x23e1f4=this['style'][_0x1f7851(0x61d)]||((_0x5f009a=_0x487b76[_0x1f7851(0x6c8)])===null||_0x5f009a===void 0x0?void 0x0:_0x5f009a['normal']),_0x59c028=new Cesium__namespace['Cartesian3'](((_0x38cb33=_0x487b76['dimensions'])===null||_0x38cb33===void 0x0?void 0x0:_0x38cb33['x'])??0x1,((_0x50a2a8=_0x487b76['dimensions'])===null||_0x50a2a8===void 0x0?void 0x0:_0x50a2a8['y'])??0x1,0x1);if(_0x23e1f4===Cesium__namespace[_0x1f7851(0xe95)]['UNIT_X']||_0x23e1f4==='x'){var _0x497025,_0x56ccbe;const _0x504037=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromRotationY'](Cesium__namespace['Math']['toRadians'](0x5a)));Cesium__namespace[_0x1f7851(_0x56420c._0x2817a0)]['multiply'](_0x187663,_0x504037,_0x187663),_0x59c028['x']=((_0x497025=_0x487b76['dimensions'])===null||_0x497025===void 0x0?void 0x0:_0x497025['y'])??0x1,_0x59c028['y']=((_0x56ccbe=_0x487b76['dimensions'])===null||_0x56ccbe===void 0x0?void 0x0:_0x56ccbe['x'])??0x1,_0x59c028['z']=0x1;}else{if(_0x23e1f4===Cesium__namespace[_0x1f7851(_0x56420c._0x18395f)]['UNIT_Y']||_0x23e1f4==='y'){const _0x1588ab=Cesium__namespace['Matrix4'][_0x1f7851(0xbaf)](Cesium__namespace[_0x1f7851(_0x56420c._0x43e97b)][_0x1f7851(_0x56420c._0x5afd03)](Cesium__namespace['Math']['toRadians'](0x5a)));Cesium__namespace['Matrix4']['multiply'](_0x187663,_0x1588ab,_0x187663);}}const _0x364724=Cesium__namespace[_0x1f7851(_0x56420c._0x2817a0)]['fromScale'](_0x59c028);return Cesium__namespace['Matrix4'][_0x1f7851(_0x56420c._0x15a12c)](_0x187663,_0x364724,_0x187663),_0x187663;}['_conversionStyle'](_0x518f37){const _0x19ae20={_0x37c53f:0x83d},_0x34d015=_0x3d5d32;return PlaneStyleConver[_0x34d015(_0x19ae20._0x37c53f)](_0x518f37);}[_0x3d5d32(0x53e)](_0x2f734f,_0x4a084e){return PlaneStyleConver['toJSON'](_0x2f734f,_0x4a084e);}[_0x3d5d32(0xc66)](_0x38c0c2,_0x429f30){const _0x2608d7={_0x2c289b:0x263},_0x238f17=_0x3d5d32,_0xbcfaed=_0x429f30?Cesium__namespace['PlaneOutlineGeometry']:Cesium__namespace['PlaneGeometry'];return new Cesium__namespace[(_0x238f17(_0x2608d7._0x2c289b))]({'id':this['id'],'geometry':new _0xbcfaed(_0x38c0c2),'modelMatrix':this['modelMatrix'],'attributes':this['options'][_0x238f17(0xf90)]});}['_getDrawEntityClass'](_0x24f937,_0x5d6951){return create$4('plane',_0x24f937);}}register$4('planeP',PlanePrimitive,!![]);class BoxPrimitive extends BasePointPrimitive{constructor(_0x3c5245={}){const _0x43e82c=_0x3d5d32;super(_0x3c5245),this['style']['closed']=this['style'][_0x43e82c(0xbe7)]??!![];}[_0x3d5d32(0x468)](_0x3157bd){const _0x1965c8=_0x3d5d32;return BoxStyleConver[_0x1965c8(0x83d)](_0x3157bd);}['_style2Json'](_0x2c1703,_0x3d906d){return BoxStyleConver['toJSON'](_0x2c1703,_0x3d906d);}['_createGeometryInstance'](_0x229586,_0x59118e){const _0x77f9f9={_0x5a3fb3:0x2a7},_0x1b6a29=_0x3d5d32,_0x33e8a1=_0x59118e?Cesium__namespace['BoxOutlineGeometry']:Cesium__namespace['BoxGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':_0x33e8a1[_0x1b6a29(_0x77f9f9._0x5a3fb3)](_0x229586),'modelMatrix':this['modelMatrix'],'attributes':this['options']['attributes']});}[_0x3d5d32(0xac7)](_0x515038,_0x2bc0ce){return create$4('box',_0x515038);}}register$4('boxP',BoxPrimitive,!![]);class CylinderPrimitive extends BasePointPrimitive{constructor(_0xb42e65={}){const _0x5a08ee={_0x168425:0xbe7},_0x1de03b=_0x3d5d32;super(_0xb42e65),this['style']['closed']=this['style'][_0x1de03b(_0x5a08ee._0x168425)]??!![];}['_conversionStyle'](_0x282c41){const _0x537837=_0x3d5d32;return CylinderStyleConver[_0x537837(0x83d)](_0x282c41);}['_style2Json'](_0x39c6ce,_0x40e31c){return CylinderStyleConver['toJSON'](_0x39c6ce,_0x40e31c);}['_createGeometryInstance'](_0xb7665a,_0x157fd3){const _0x56fe78={_0x506018:0xd93,_0x29abda:0xd93},_0x32ea22=_0x3d5d32,_0x574a3d=_0x157fd3?Cesium__namespace['CylinderOutlineGeometry']:Cesium__namespace['CylinderGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x574a3d(_0xb7665a),'modelMatrix':_0xb7665a[_0x32ea22(_0x56fe78._0x506018)]||this[_0x32ea22(_0x56fe78._0x29abda)],'attributes':this['options']['attributes']});}[_0x3d5d32(0xac7)](_0x1bcf8e,_0x335da7){return create$4('cylinder',_0x1bcf8e);}}register$4('cylinderP',CylinderPrimitive,!![]);class ConeTrackPrimitive extends CylinderPrimitive{constructor(_0x2cbfb3={}){super(_0x2cbfb3),_0x2cbfb3['targetPosition']&&(this['targetPosition']=_0x2cbfb3['targetPosition']);}get['hasEdit'](){return![];}get['targetPosition'](){return this['_targetPosition'];}set['targetPosition'](_0x4f2caa){const _0x5a42ae={_0xb8ec83:0x49e,_0x1ca544:0xce3,_0x177160:0xed4},_0x19b04e=_0x3d5d32;this[_0x19b04e(_0x5a42ae._0xb8ec83)]=LngLatPoint[_0x19b04e(_0x5a42ae._0x1ca544)](_0x4f2caa),this['_targetPosition']=this['_targetPoint'][_0x19b04e(_0x5a42ae._0x177160)](),this['czmObject']&&this[_0x19b04e(0x367)]();}get['targetPoint'](){return this['_targetPoint'];}get['angle'](){const _0x37d945={_0x5e65ae:0x247},_0x35b301=_0x3d5d32;return this[_0x35b301(0xdde)][_0x35b301(_0x37d945._0x5e65ae)];}set['angle'](_0x344cb3){this['style']['angle']=_0x344cb3;}['_createGeometryInstance'](_0x42799c,_0x55eaf1){const _0xb56446={_0x30a26b:0xba9,_0x5f30c6:0x9f4,_0x3df8a0:0xbd7,_0x511425:0xdde,_0x1c3109:0x103e,_0x1ee614:0x562},_0x445d52=_0x3d5d32,_0x48d79c=this['position'],_0x4da0c6=getPositionValue(this[_0x445d52(_0xb56446._0x30a26b)],this['_map'][_0x445d52(_0xb56446._0x5f30c6)]['currentTime']);let _0x2c1173,_0x5e07e1;return _0x4da0c6?(_0x42799c['length']=Cesium__namespace['Cartesian3'][_0x445d52(_0xb56446._0x3df8a0)](_0x48d79c,_0x4da0c6),_0x5e07e1=Cesium__namespace['Cartesian3']['midpoint'](_0x48d79c,_0x4da0c6,new Cesium__namespace['Cartesian3']()),_0x2c1173=getHeadingPitchRollForLine(_0x4da0c6,_0x48d79c)):(_0x42799c['length']=this[_0x445d52(_0xb56446._0x511425)]['length'],_0x2c1173=new Cesium__namespace[(_0x445d52(0x7ba))](Cesium__namespace[_0x445d52(_0xb56446._0x1c3109)]['toRadians'](this['heading']),Cesium__namespace['Math'][_0x445d52(0x562)](this[_0x445d52(0x5cf)]),Cesium__namespace['Math'][_0x445d52(0x562)](this['roll'])),_0x5e07e1=getPositionByHprAndLen(_0x48d79c,_0x2c1173,_0x42799c['length']/0x2)),_0x42799c['modelMatrix']=Cesium__namespace[_0x445d52(0x5bb)]['headingPitchRollToFixedFrame'](_0x5e07e1,_0x2c1173),Cesium__namespace[_0x445d52(0xb84)](this[_0x445d52(0xdde)][_0x445d52(0x247)])&&(_0x42799c['bottomRadius']=_0x42799c['length']*Math['cos'](Cesium__namespace['Math'][_0x445d52(_0xb56446._0x1ee614)](0x5a-this['angle']))),super['_createGeometryInstance'](_0x42799c,_0x55eaf1);}}register$4('coneTrackP',ConeTrackPrimitive,!![]);class EllipsoidPrimitive extends BasePointPrimitive{constructor(_0x526bf3={}){super(_0x526bf3),this['style']['closed']=this['style']['closed']??!![];}['_conversionStyle'](_0x458a96){return EllipsoidStyleConver['toCesiumVal'](_0x458a96);}['_style2Json'](_0x43bade,_0x371104){return EllipsoidStyleConver['toJSON'](_0x43bade,_0x371104);}['_createGeometryInstance'](_0x5ffaad,_0x36a28d){const _0x4f146a={_0x4f72e3:0x263},_0x40b0f6=_0x3d5d32,_0x64b7f5=_0x36a28d?Cesium__namespace[_0x40b0f6(0x9b3)]:Cesium__namespace['EllipsoidGeometry'];return new Cesium__namespace[(_0x40b0f6(_0x4f146a._0x4f72e3))]({'id':this['id'],'geometry':new _0x64b7f5(_0x5ffaad),'modelMatrix':this['modelMatrix'],'attributes':this[_0x40b0f6(0x433)]['attributes']});}[_0x3d5d32(0xac7)](_0x320736,_0x28e9f9){return create$4('ellipsoid',_0x320736);}}register$4('ellipsoidP',EllipsoidPrimitive,!![]);class WallPrimitive extends BasePolyPrimitive{['_createGeometryInstance'](_0x5517dc,_0x38bbe3){const _0x7a5dd2={_0x40d947:0xd29,_0xbf01dc:0x433},_0xe0d62b=_0x3d5d32;var _0x4f84d8;let _0x21cee6=this['positions'];const _0x2b9f9d=this[_0xe0d62b(0xbf8)],_0x4f225c=_0x2b9f9d['length'];let _0x117c96=new Array(_0x4f225c),_0x49e901=new Array(_0x4f225c);for(let _0x3edeae=0x0;_0x3edeae<_0x4f225c;_0x3edeae++){const _0x2a9da5=_0x2b9f9d[_0x3edeae][_0xe0d62b(_0x7a5dd2._0x40d947)];_0x117c96[_0x3edeae]=_0x2a9da5,_0x49e901[_0x3edeae]=_0x2a9da5+Number(this['style']['diffHeight']||0x64);}this['style']['closure']&&((_0x4f84d8=_0x21cee6)===null||_0x4f84d8===void 0x0?void 0x0:_0x4f84d8['length'])>0x0&&(_0x21cee6=_0x21cee6['concat'](_0x21cee6[0x0]),_0x117c96=_0x117c96['concat'](_0x117c96[0x0]),_0x49e901=_0x49e901['concat'](_0x49e901[0x0]));const _0x1110e9=_0x38bbe3?Cesium__namespace['WallOutlineGeometry']:Cesium__namespace['WallGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x1110e9({..._0x5517dc,'positions':_0x21cee6,'maximumHeights':_0x49e901,'minimumHeights':_0x117c96}),'attributes':this[_0xe0d62b(_0x7a5dd2._0xbf01dc)]['attributes']});}['_conversionStyle'](_0x2c6fbd){const _0x14d1c9=_0x3d5d32;return WallStyleConver[_0x14d1c9(0x83d)](_0x2c6fbd);}[_0x3d5d32(0x53e)](_0x437d5c,_0x5ca722){const _0x3b6d9e={_0x1a5b18:0x3db},_0x1165a2=_0x3d5d32;return WallStyleConver[_0x1165a2(_0x3b6d9e._0x1a5b18)](_0x437d5c,_0x5ca722);}['_getDrawEntityClass'](_0x190369,_0x1c540c){return create$4('wall',_0x190369);}}register$4(_0x3d5d32(0x749),WallPrimitive);class CorridorPrimitive extends BasePolyPrimitive{['_createGeometryInstance'](_0x35b1be,_0x4ffd5b){const _0x386646={_0x11d53c:0x433,_0x122f85:0xf90},_0x34b0b1=_0x3d5d32;this['_updateDiffHeight'](_0x35b1be),_0x35b1be['positions']=this['positions'];const _0x3553f8=_0x4ffd5b?Cesium__namespace['CorridorOutlineGeometry']:Cesium__namespace['CorridorGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x3553f8(_0x35b1be),'attributes':this[_0x34b0b1(_0x386646._0x11d53c)][_0x34b0b1(_0x386646._0x122f85)]});}['_conversionStyle'](_0x235436){return CorridorStyleConver['toCesiumVal'](_0x235436);}['_style2Json'](_0x2242b2,_0x4d1414){return CorridorStyleConver['toJSON'](_0x2242b2,_0x4d1414);}['_getDrawEntityClass'](_0x23fb40,_0x158902){return create$4('corridor',_0x23fb40);}}register$4(_0x3d5d32(0xda1),CorridorPrimitive);class PolylineVolumePrimitive extends BasePolyPrimitive{constructor(_0x580002={}){super(_0x580002),this['style']['closed']=this['style']['closed']??!![];}[_0x3d5d32(0xc66)](_0x27312d,_0xf08d8e){const _0x505ed4=_0xf08d8e?Cesium__namespace['PolylineVolumeOutlineGeometry']:Cesium__namespace['PolylineVolumeGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x505ed4({..._0x27312d,'polylinePositions':this['positions'],'shapePositions':_0x27312d['shape']}),'attributes':this['options']['attributes']});}['_conversionStyle'](_0x5596db){return PolylineVolumeStyleConver['toCesiumVal'](_0x5596db);}['_style2Json'](_0x5259d5,_0x2bc344){return PolylineVolumeStyleConver['toJSON'](_0x5259d5,_0x2bc344);}[_0x3d5d32(0xac7)](_0x22f5d3,_0xe14990){return create$4('polylineVolume',_0x22f5d3);}}register$4('polylineVolumeP',PolylineVolumePrimitive);class RectanglePrimitive extends BasePolyPrimitive{constructor(_0xadcb0d={}){const _0x21cff4={_0xd998d9:0x5a3},_0x47cc62=_0x3d5d32;super(_0xadcb0d),_0xadcb0d[_0x47cc62(0x5a3)]&&(this['rectangle']=_0xadcb0d[_0x47cc62(_0x21cff4._0xd998d9)]);}get['rectangle'](){const _0x5d590a={_0x33c5ae:0x756},_0x16057e=_0x3d5d32;return!this[_0x16057e(0x570)]&&this['positions']&&(this['_rectangle']=Cesium__namespace[_0x16057e(_0x5d590a._0x33c5ae)]['fromCartesianArray'](this['positions'])),this['_rectangle'];}set['rectangle'](_0x3e84ca){this['_rectangle']=_0x3e84ca;}get['outlinePositions'](){const _0x35d5a9={_0x2fb13f:0xdde,_0x457f6a:0x5a3,_0x4e10fe:0xdde},_0x5bbb43=_0x3d5d32;let _0x29d46a;if(Cesium__namespace['defined'](this['style']['rotationDegree']))_0x29d46a=Cesium__namespace[_0x5bbb43(0x103e)]['toRadians'](this['style'][_0x5bbb43(0x9f1)]);else Cesium__namespace[_0x5bbb43(0xb84)](this['style'][_0x5bbb43(0x31f)])&&(_0x29d46a=this[_0x5bbb43(_0x35d5a9._0x2fb13f)]['rotation']);const _0x3eb43b=getRectangleOuterPositions({'rectangle':this[_0x5bbb43(_0x35d5a9._0x457f6a)],'rotation':_0x29d46a,'height':this[_0x5bbb43(_0x35d5a9._0x4e10fe)]['height']});return _0x3eb43b;}get['distance'](){return getDistance(this['outlinePositions'],!![]);}get['area'](){return getSurfaceArea(this['outlinePositions']);}get[_0x3d5d32(0xe72)](){const _0x473a2c={_0x33a3b9:0x5a3},_0x1a2f44=_0x3d5d32,_0x187717=this[_0x1a2f44(_0x473a2c._0x33a3b9)];if(!this['rectangle'])return null;const _0x3d479c=Cesium__namespace[_0x1a2f44(0x220)]['toCartesian'](Cesium__namespace['Rectangle']['center'](_0x187717));return _0x3d479c;}['_updatePositionsHook'](){const _0x188ea1={_0x31eb6b:0x5a3,_0xb7256f:0xeb1},_0x4cd30f=_0x3d5d32;return this[_0x4cd30f(_0x188ea1._0x31eb6b)]=Cesium__namespace['Rectangle'][_0x4cd30f(_0x188ea1._0xb7256f)](this['positions']),super['_updatePositionsHook']();}[_0x3d5d32(0xc66)](_0x12c350,_0x23b2c7){const _0x40de2c={_0x51c290:0x5a3},_0x1341ff=_0x3d5d32;this['_updateDiffHeight'](_0x12c350,!![]),_0x12c350[_0x1341ff(_0x40de2c._0x51c290)]=this['rectangle'];const _0x4c8d81=_0x23b2c7?Cesium__namespace['RectangleOutlineGeometry']:Cesium__namespace['RectangleGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x4c8d81(_0x12c350),'attributes':this[_0x1341ff(0x433)][_0x1341ff(0xf90)]});}['_conversionStyle'](_0xb6194){return RectangleStyleConver['toCesiumVal'](_0xb6194);}['_style2Json'](_0xa7851e,_0x24bbef){return RectangleStyleConver['toJSON'](_0xa7851e,_0x24bbef);}[_0x3d5d32(0x21f)](_0x58dd9e){const _0x425caa=_0x3d5d32;return{'type':'Polygon','coordinates':[this['getCoordinates'](_0x58dd9e===null||_0x58dd9e===void 0x0?void 0x0:_0x58dd9e[_0x425caa(0xbcb)])]};}['_getPolylineOutlinePositions'](){return[this['outlinePositions']];}[_0x3d5d32(0x7c9)](_0x18d240){const _0x173fa7=this['rectangle'];return _0x18d240!==null&&_0x18d240!==void 0x0&&_0x18d240['isFormat']?formatRectangle(_0x173fa7):_0x173fa7;}[_0x3d5d32(0xe23)](_0x4f528c){const _0x2985a6=_0x3d5d32,_0x2f19b3=Cesium__namespace[_0x2985a6(0x756)]['contains'](this['rectangle'],LngLatPoint[_0x2985a6(0xce3)](_0x4f528c)['toCartographic']());return _0x2f19b3;}[_0x3d5d32(0xac7)](_0x7548a5,_0x9c2d24){return create$4('rectangle',_0x7548a5);}['_updateDrawEntityToThis'](){super['_updateDrawEntityToThis'](),this['_updatePositionsHook']();}}register$4('rectangleP',RectanglePrimitive);const nullColor=new Cesium__namespace[(_0x3d5d32(0x882))](0x0,0x0,0x0,0.01);class PolygonPrimitive extends BasePolyPrimitive{get['center'](){return this['centerOfMass'];}get['distance'](){return getDistance(this['_positions'],!![]);}get[_0x3d5d32(0xbb8)](){return this['_positions'];}set['positions'](_0x3b51a1){const _0x465a90={_0x226490:0x62b,_0x33481e:0xdde,_0x970577:0xe95,_0x49bf4e:0x9b2},_0x10e4d0=_0x3d5d32;if(!_0x3b51a1)return;if(_0x3b51a1[_0x10e4d0(0xc84)]>0x0&&Array[_0x10e4d0(_0x465a90._0x226490)](_0x3b51a1[0x0])&&_0x3b51a1[0x0]['length']>0x0){const _0x5d0e2a=_0x3b51a1[0x0][0x0];if(Array['isArray'](_0x5d0e2a)&&isNumber(_0x5d0e2a[0x0]))this['_hierarchy']=getPolygonHierarchy(_0x3b51a1,this['style']['height']||this['style']['setHeight']||this[_0x10e4d0(_0x465a90._0x33481e)][_0x10e4d0(0x9ce)]),_0x3b51a1=this['_hierarchy']['positions'];else _0x5d0e2a instanceof Cesium__namespace[_0x10e4d0(_0x465a90._0x970577)]&&(this['_hierarchy']=getPolygonHierarchy2(_0x3b51a1),_0x3b51a1=this[_0x10e4d0(_0x465a90._0x49bf4e)]['positions']);}super[_0x10e4d0(0xbb8)]=_0x3b51a1,this['_hierarchy']&&this['_positions']&&(this['_hierarchy']['positions']=this['_positions']);}['_createGeometryInstance'](_0x1f447b,_0x2e25ef){const _0x564efe={_0x22fa4a:0xbeb,_0x27d545:0x433},_0x59f525=_0x3d5d32;this[_0x59f525(_0x564efe._0x22fa4a)](_0x1f447b);this[_0x59f525(0x9b2)]?_0x1f447b['polygonHierarchy']=this['_hierarchy']:_0x1f447b[_0x59f525(0x86a)]=new Cesium__namespace['PolygonHierarchy'](this['positions']);const _0x2e5bde=_0x2e25ef?Cesium__namespace['PolygonOutlineGeometry']:Cesium__namespace['PolygonGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x2e5bde(_0x1f447b),'attributes':this[_0x59f525(_0x564efe._0x27d545)][_0x59f525(0xf90)]});}[_0x3d5d32(0x468)](_0x4d35b9){let _0x28ace4=PolygonStyleConver['toCesiumVal'](_0x4d35b9);return _0x28ace4=this['_bindExType'](_0x28ace4),_0x28ace4;}['_bindExType'](_0x33c3ec){const _0x151112={_0x308415:0x831,_0x3cda8e:0xb84,_0x242d7e:0x8bc},_0x44b40d=_0x3d5d32,_0x3946ee=this['options']['buildings']||this['_layer']['options']['buildings'];if(_0x3946ee&&(_0x3946ee['enabled']??!![])){if(_0x3946ee['bottomHeight']){let _0x59883f;if(isNumber(_0x3946ee['bottomHeight']))_0x59883f=_0x3946ee['bottomHeight'];else isString(_0x3946ee['bottomHeight'])&&(_0x59883f=Number(this['attr'][_0x3946ee['bottomHeight']]||0x0));_0x33c3ec[_0x44b40d(0x83e)]=_0x59883f;}const _0x398869=Number(this['attr'][_0x3946ee['cloumn']]||0x1);let _0x8fbb97;if(isNumber(_0x3946ee[_0x44b40d(0x83e)]))_0x8fbb97=_0x3946ee['height'];else isString(_0x3946ee['height'])?_0x8fbb97=this['attr'][_0x3946ee['height']]||_0x8fbb97:_0x8fbb97=3.5;const _0x344653=_0x33c3ec['height']||0x0;_0x33c3ec[_0x44b40d(_0x151112._0x308415)]=_0x344653+_0x398869*_0x8fbb97;}const _0x2e51b2=this['options']['dth']||this['_layer'][_0x44b40d(0x433)]['dth'];if(_0x2e51b2){const _0x182442=this['_getColorByColorMaterial'](_0x33c3ec,![]);!Cesium__namespace['defined'](_0x182442)&&(_0x33c3ec['color']=nullColor),_0x33c3ec[_0x44b40d(0x29d)]=!![],!Cesium__namespace[_0x44b40d(_0x151112._0x3cda8e)](this['style'][_0x44b40d(0x83e)])&&(_0x33c3ec[_0x44b40d(_0x151112._0x242d7e)]=![]),_0x33c3ec['zIndex']=0x63;}return _0x33c3ec;}['updateHeight'](_0x3ddc8a){const _0x742d2c={_0xdde755:0xc84,_0x115745:0x38e},_0x507f52=_0x3d5d32,_0xb32973=0x615299;for(let _0x385e10=0x0,_0x460edc=this['primitiveCollection'][_0x507f52(_0x742d2c._0xdde755)];_0x385e10<_0x460edc;_0x385e10++){const _0x832bfb=this['primitiveCollection'][_0x507f52(0x40a)](_0x385e10),_0x946124=(_0xb32973+_0x3ddc8a)/(_0xb32973+this['style']['height']),_0x3e7b74=Cesium__namespace['Matrix4'][_0x507f52(_0x742d2c._0x115745)](new Cesium__namespace[(_0x507f52(0xe95))](_0x946124,_0x946124,_0x946124));_0x832bfb['modelMatrix']=_0x3e7b74;}}['_style2Json'](_0x19aaf9,_0x77d9c6){return PolygonStyleConver['toJSON'](_0x19aaf9,_0x77d9c6);}['_getGeoJsonGeometry'](_0x357e9a){return{'type':'Polygon','coordinates':[this['getCoordinates'](_0x357e9a===null||_0x357e9a===void 0x0?void 0x0:_0x357e9a['noAlt'])]};}['_getPolylineOutlinePositions'](){const _0x27e16c={_0x263121:0x9b2},_0x2d30cf=_0x3d5d32;return this['_hierarchy']?getHierarchyVal(this[_0x2d30cf(_0x27e16c._0x263121)]):[this['positions']];}['_getDrawEntityClass'](_0xfe05e9,_0xffc7eb){return create$4('polygon',_0xfe05e9);}[_0x3d5d32(0x414)](_0xf4ac00){const _0x11d56e=_0x3d5d32;this['_hierarchy']&&(_0xf4ac00['_hierarchy']=this[_0x11d56e(0x9b2)]);}}register$4(_0x3d5d32(0x1077),PolygonPrimitive);class FrustumPrimitive extends BasePointPrimitive{constructor(_0x2949ae={}){const _0x245636={_0x5667b3:0xdde,_0x1d994d:0xbe7},_0x37a8e2=_0x3d5d32;super(_0x2949ae),this[_0x37a8e2(_0x245636._0x5667b3)][_0x37a8e2(_0x245636._0x1d994d)]=this['style'][_0x37a8e2(0xbe7)]??!![],_0x2949ae[_0x37a8e2(0xba9)]&&(this['targetPosition']=_0x2949ae['targetPosition']);}get[_0x3d5d32(0xba9)](){return this['_targetPosition'];}set['targetPosition'](_0x456dd9){const _0x1ca5f0={_0x456397:0xce3},_0x26e35c=_0x3d5d32;this[_0x26e35c(0x49e)]=LngLatPoint[_0x26e35c(_0x1ca5f0._0x456397)](_0x456dd9),this['_targetPosition']=this['_targetPoint']['toCartesian'](),this['isAdded']&&this['show']&&(this['_removedHook'](),this['_addedHook'](this[_0x26e35c(0xdde)]));}get[_0x3d5d32(0x99e)](){return this['_targetPoint'];}get['angle'](){const _0x27d261=_0x3d5d32;return this['style'][_0x27d261(0x247)];}set[_0x3d5d32(0x247)](_0x4a8edd){const _0x2a1ce0=_0x3d5d32;this['style'][_0x2a1ce0(0x247)]=_0x4a8edd;}get['angle2'](){const _0x383049={_0x1506db:0x247},_0x218ece=_0x3d5d32;return this[_0x218ece(0xdde)]['angle2']??this['style'][_0x218ece(_0x383049._0x1506db)];}set['angle2'](_0x368b58){const _0x16dc7d={_0x529d5d:0xdde,_0x77976:0x5df},_0x2bad07=_0x3d5d32;this[_0x2bad07(_0x16dc7d._0x529d5d)][_0x2bad07(_0x16dc7d._0x77976)]=_0x368b58;}get[_0x3d5d32(0x69d)](){return getRayEarthPosition(this['position'],this['_orientation']);}get['defaultVertexFormat'](){return Cesium__namespace['VertexFormat']['POSITION_ONLY'];}['updateModelMatrix'](){}['_conversionStyle'](_0x1815ba){return CylinderStyleConver['toCesiumVal'](_0x1815ba);}[_0x3d5d32(0x53e)](_0x5418b,_0x3cc4a2){return CylinderStyleConver['toJSON'](_0x5418b,_0x3cc4a2);}['_createGeometryInstance'](_0x341a94,_0x19d1c7){const _0x84718f=_0x3d5d32;this['_update']();const _0x5b8a7e=_0x19d1c7?Cesium__namespace['FrustumOutlineGeometry']:Cesium__namespace['FrustumGeometry'];return new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new _0x5b8a7e({..._0x341a94,'origin':this['position'],'orientation':this['_orientation'],'frustum':this['_frustum']}),'attributes':this[_0x84718f(0x433)]['attributes']});}['_update'](_0x7e8d4f){const _0x5e3623={_0x1d0e40:0x511,_0x1de05e:0x435,_0x266a72:0xe95,_0xa5d502:0x490,_0x2ce304:0x97b,_0x425365:0xa1f,_0x10599c:0xba9,_0x517528:0x103e,_0x33da5c:0x952,_0x4f3240:0xed0,_0x90d14f:0xdde,_0x285927:0xe39},_0x1d4d8d=_0x3d5d32,_0x3cfe44=getPositionValue(this['position'],_0x7e8d4f);if(!_0x3cfe44){this[_0x1d4d8d(_0x5e3623._0x1d0e40)]=undefined;return;}if(this['options']['camera']){const _0x5bdb68=this[_0x1d4d8d(0x433)][_0x1d4d8d(_0x5e3623._0x1de05e)],_0x2c7bf0=new Cesium__namespace[(_0x1d4d8d(_0x5e3623._0x266a72))](),_0x5f4999=new Cesium__namespace['Matrix3'](),_0x1a24e5=new Cesium__namespace['Quaternion'](),_0x1fe356=_0x5bdb68[_0x1d4d8d(_0x5e3623._0xa5d502)],_0x5bc18a=_0x5bdb68['upWC'],_0x1817ad=Cesium__namespace['Cartesian3']['negate'](_0x5bdb68['rightWC'],_0x2c7bf0);Cesium__namespace['Matrix3']['setColumn'](_0x5f4999,0x0,_0x1817ad,_0x5f4999),Cesium__namespace['Matrix3']['setColumn'](_0x5f4999,0x1,_0x5bc18a,_0x5f4999),Cesium__namespace['Matrix3']['setColumn'](_0x5f4999,0x2,_0x1fe356,_0x5f4999),this[_0x1d4d8d(0x8de)]=Cesium__namespace[_0x1d4d8d(_0x5e3623._0x2ce304)]['fromRotationMatrix'](_0x5f4999,_0x1a24e5),this['_frustum']=_0x5bdb68['frustum'],this['heading']=Cesium__namespace['Math']['toDegrees'](_0x5bdb68['heading']),this['pitch']=Cesium__namespace['Math'][_0x1d4d8d(_0x5e3623._0x425365)](_0x5bdb68['pitch']),this['roll']=Cesium__namespace['Math']['toDegrees'](_0x5bdb68['roll']);return;}const _0x642d2=getPositionValue(this[_0x1d4d8d(_0x5e3623._0x10599c)],_0x7e8d4f);if(_0x642d2){this['_frustumFar']=Cesium__namespace['Cartesian3']['distance'](_0x3cfe44,_0x642d2);const _0x5dedf2=getHeadingPitchRollForLine(_0x3cfe44,_0x642d2);this[_0x1d4d8d(0xe39)]=Cesium__namespace['Math'][_0x1d4d8d(0xa1f)](_0x5dedf2['heading']),this['pitch']=Cesium__namespace[_0x1d4d8d(_0x5e3623._0x517528)]['toDegrees'](_0x5dedf2['pitch']),this[_0x1d4d8d(_0x5e3623._0x33da5c)]=Cesium__namespace['Math'][_0x1d4d8d(0xa1f)](_0x5dedf2['roll']),this['_orientation']=Cesium__namespace[_0x1d4d8d(0x5bb)][_0x1d4d8d(_0x5e3623._0x4f3240)](_0x3cfe44,_0x5dedf2);}else{this[_0x1d4d8d(0x902)]=-this[_0x1d4d8d(_0x5e3623._0x90d14f)]['length'];const _0x5da069=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math'][_0x1d4d8d(0x562)](this[_0x1d4d8d(_0x5e3623._0x285927)]),Cesium__namespace[_0x1d4d8d(_0x5e3623._0x517528)]['toRadians'](this['pitch']),Cesium__namespace['Math']['toRadians'](this['roll']));this['_orientation']=Cesium__namespace['Transforms'][_0x1d4d8d(_0x5e3623._0x4f3240)](_0x3cfe44,_0x5da069);}this['_frustum']=new Cesium__namespace[(_0x1d4d8d(0x40b))]({'fov':Cesium__namespace[_0x1d4d8d(0x103e)]['toRadians'](this['angle']*0x2||0.01),'aspectRatio':this[_0x1d4d8d(0x5df)]/this['angle'],'near':0.01,'far':this['_frustumFar']});}[_0x3d5d32(0xcb9)](_0x5a66b8){const _0x4ebaf4={_0x15c48b:0x103e,_0x518f5c:0x5df,_0x23554c:0x7ba},_0xb53c7a=_0x3d5d32,_0x59df19=getPositionValue(this['position'],_0x5a66b8),_0x38dfe4=Cesium__namespace[_0xb53c7a(_0x4ebaf4._0x15c48b)]['toRadians'](this[_0xb53c7a(0xe39)]),_0x4805f6=Cesium__namespace['Math']['toRadians'](this['pitch']+this[_0xb53c7a(_0x4ebaf4._0x518f5c)]),_0x92cae4=Cesium__namespace['Math']['toRadians'](this['pitch']-this['angle2']),_0x5dfaf9=Cesium__namespace['Math'][_0xb53c7a(0x562)](this[_0xb53c7a(0x952)]+this['angle']),_0x1cfd63=Cesium__namespace['Math']['toRadians'](this[_0xb53c7a(0x952)]-this[_0xb53c7a(0x247)]),_0xceee39=getRayEarthPosition(_0x59df19,new Cesium__namespace['HeadingPitchRoll'](_0x38dfe4,_0x4805f6,_0x5dfaf9),!![]),_0x3cdb3c=getRayEarthPosition(_0x59df19,new Cesium__namespace['HeadingPitchRoll'](_0x38dfe4,_0x4805f6,_0x1cfd63),!![]),_0x3f25b3=getRayEarthPosition(_0x59df19,new Cesium__namespace[(_0xb53c7a(_0x4ebaf4._0x23554c))](_0x38dfe4,_0x92cae4,_0x1cfd63),!![]),_0x346743=getRayEarthPosition(_0x59df19,new Cesium__namespace['HeadingPitchRoll'](_0x38dfe4,_0x92cae4,_0x5dfaf9),!![]);return[_0xceee39,_0x3cdb3c,_0x3f25b3,_0x346743];}['_getDrawEntityClass'](_0x4a46ff,_0x4522f1){return this['_getDrawPointEntityClass'](_0x4a46ff,_0x4522f1);}}register$4(_0x3d5d32(0x389),FrustumPrimitive,!![]);var ConeGlowCircleOuterMaterial='uniform\x20vec4\x20u_color;\x0auniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20float\x20time\x20=\x20fract(czm_frameNumber\x20/\x2090.);\x0a\x20\x20vec2\x20new_st\x20=\x20fract(st\x20-\x20vec2(time,\x20time));\x0a\x20\x20vec4\x20color\x20=\x20texture(image,\x20new_st);\x0a\x0a\x20\x20vec3\x20diffuse\x20=\x20color.rgb;\x0a\x20\x20float\x20alpha\x20=\x20color.a;\x0a\x20\x20diffuse\x20*=\x20u_color.rgb;\x0a\x20\x20alpha\x20*=\x20u_color.a;\x0a\x20\x20alpha\x20*=\x20u_color.a;\x0a\x20\x20material.diffuse\x20=\x20diffuse;\x0a\x20\x20material.alpha\x20=\x20alpha\x20*\x20pow(1.\x20-\x20st.t,\x20u_color.a)\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ConeGlowCylinderGaussMaterial=_0x3d5d32(0xbfe),ConeGlowGradientMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec4\x20tColor\x20=\x20u_color;\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20center\x20=\x20st\x20-\x20vec2(0.5,\x200.5);\x0a\x20\x20float\x20length\x20=\x20length(center)\x20/\x200.5;\x0a\x20\x20float\x20time\x20=\x201.\x20-\x20abs(czm_frameNumber\x20/\x20360.\x20-\x200.5);\x0a\x0a\x20\x20float\x20param\x20=\x201.\x20-\x20step(length,\x200.6);//大于0.6模糊,rate\x20=\x200.6\x0a\x20\x20float\x20scale\x20=\x20param\x20*\x20length;//\x200.6<\x20length\x20返回0,反之返回1.\x0a\x20\x20float\x20alpha\x20=\x20param\x20*\x20(1.0\x20-\x20abs(scale\x20-\x200.8)\x20/\x200.2);//\x200.8\x20<\x20length\x20返回0,反之返回1.\x0a\x0a\x20\x20float\x20param1\x20=\x20step(length,\x200.7);//小于0.5模糊\x0a\x20\x20float\x20scale1\x20=\x20param1\x20*\x20length;//\x200.6<\x20length\x20返回0,反之返回1.\x0a\x20\x20alpha\x20+=\x20param1\x20*\x20(1.0\x20-\x20abs(scale1\x20-\x200.35)\x20/\x200.35);//\x200.8\x20<\x20length\x20返回0,反之返回1.\x0a\x0a\x20\x20material.diffuse\x20=\x20u_color.rgb\x20*\x20vec3(u_color.a);\x0a\x20\x20material.alpha\x20=\x20pow(alpha,\x204.0)\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ConeGlowRingScanMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec2\x20center\x20=\x20st\x20-\x20vec2(0.5,\x200.5);\x0a\x20\x20float\x20time\x20=\x20-czm_frameNumber\x20*\x203.1415926\x20/\x20180.;//扫描速度1度\x0a\x20\x20float\x20sin_t\x20=\x20sin(time);\x0a\x20\x20float\x20cos_t\x20=\x20cos(time);\x0a\x20\x20vec2\x20center_rotate\x20=\x20vec2(center.s\x20*\x20cos_t\x20-\x20center.t\x20*\x20sin_t\x20+\x200.5,\x20center.s\x20*\x20sin_t\x20+\x20center.t\x20*\x20cos_t\x20+\x200.5);\x0a\x20\x20vec4\x20color\x20=\x20texture(image,\x20center_rotate);\x0a\x20\x20vec3\x20tColor\x20=\x20color.rgb\x20*\x20u_color.rgb;\x0a\x20\x20tColor\x20*=\x20u_color.a;\x0a\x20\x20material.diffuse\x20=\x20tColor;\x0a\x20\x20float\x20length\x20=\x202.\x20-\x20length(center)\x20/\x200.5;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20pow(length,\x200.5)\x20*\x20globalAlpha;//color.r\x20=\x200\x20或1\x0a\x20\x20return\x20material;\x0a}\x0a';const DEF_STYLE$g={'height':0x3e8,'radius':0x64,'color':'#00ffff'},particleImage=new Image();particleImage['src']='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjExQTg0NDEyMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjExQTg0NDEzMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTFBODQ0MTAwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTFBODQ0MTEwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz41vRwAAAAE90lEQVR42uydyW4UMRCG3T2dgYSAEGs4sp44cCJBcGUJbwCvALwWPAI8ABwAiUVwgLBdkEikJEiAGMhkZqhfU1aa1sy0g+yaJPyWSupOpPjz0uVyucrJer2eG2fJ3ZgLAQhAgC0PgN8XIlkqgGLE75oih0WmRVZEvop0rHog18rnRe6IzInsthyCXFt+TuSKyGmRXZZDgK5eFrkv8l7kiUhrxN/JSo3pigSvcNmI1bCh3b5LK2+NqHyvyEF9x3z5HgqRRViOAXhW5JrCoNdei/y20gMYxhmRSyIXRY6JTMT4DENLW+SdyD19x/NajDmwmYIW79Hnn+MA4GJEAAIQgABJbMJB+n5Sl9zWZvR9DABUfkJkVt8fi3zUldAEoKl24Y2S1fPZEmBdZFHkkb4vxTLRQ5djbyUf0ncYrD/UADUB8MZno2Q19yx7gIqIAAQgAAEIQIAtYZT+85LvRnjQCoPKR3rQUgN4Y3ZeK30g8qps0qeeAzDn4TWD9+ySG+BBS90DaGnVg9a2tgnR4il9/jkOACoiAhCAAASIZpAAFl6yulO0JACo/IDrn6CedP1zxOciv6wAYNnAP3RVBeWtJQCWzG8iL/X9g4vkqNzMctzUXtintt2KM/aS+bmQaY90rb8CF6tSKiICEIAABCAAAQiwbfcFIWVCbUcc9bZDLKiYAKj4uOv7Bb+ILLj+8W7PCgC7Jhzv44Qdh9yrru8V61jPgd645gD2io+15RiC5ZA5ENNPmGmDmtrta9YAVEQE2FlrQUM/J6efU8cSAD87ojodBaccS6kgiiErGiq/qe93XT+3oGU5BJnbyKrIUs6BQZoQUEcrQ7CYagiGqeKiMgnXLXsg5uJUm/RQJKy8fGS7PMw6SgVQPrJFGZr0kCfUL/7IFjIzrLGpemBQ0kPbehL6I9vMjUh6oEVEAAIQgAAEIAABdpyj0qcK71YrqGUJANNrv+sHOcAiRpDDM1cTY1BEHk7kqyP/2Ac5vLEEQEG8aDnIoTb5ObZRWg5ywG5o1dX4ClNYxT7IISgJPsXGpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=',particleImage['onload']=function(){};class LightCone extends BasePointPrimitive{constructor(_0x1b093c={}){const _0x1f25cb={_0x5662e7:0xdef},_0x172898=_0x3d5d32;_0x1b093c['style']={...DEF_STYLE$g,..._0x1b093c['style']||{}},super(_0x1b093c),this[_0x172898(_0x1f25cb._0x5662e7)]=null,this[_0x172898(0x4cd)]=null,this[_0x172898(0x535)]=null,this['_primitive4']=null;}get['czmObject'](){return this['_primitive1'];}get[_0x3d5d32(0xc51)](){const _0x3bb177=_0x3d5d32;return this['_primitive2']?[this['_primitive2'],this['_primitive3'],this[_0x3bb177(0xc95)]]:[];}get[_0x3d5d32(0xe8f)](){return this['_color'];}set['color'](_0x36da2c){this['style']['color']=_0x36da2c;}['_addedHook'](_0x16b44f){const _0x26bb1b={_0x10d9b4:0x9e4,_0x4d8ca6:0xb84},_0x1adfdf=_0x3d5d32;if(!this['show']||!this['position'])return;let _0x106734=this['position'];if(Cesium__namespace['defined'](_0x16b44f[_0x1adfdf(_0x26bb1b._0x10d9b4)])){let _0x7156b8=this['style']['setHeight'];Cesium__namespace[_0x1adfdf(_0x26bb1b._0x4d8ca6)](_0x7156b8)&&(isString(_0x7156b8)&&(_0x7156b8=Number(template(_0x7156b8,this['attr'],!![])),isNaN(_0x7156b8)&&(_0x7156b8=0x0)),_0x106734=setPositionsHeight(_0x106734,_0x7156b8));const _0x1d1fa8=this['getAddHeight']();_0x1d1fa8!==0x0&&(_0x106734=addPositionsHeight(_0x106734,_0x1d1fa8));}const _0x1ecc44=_0x16b44f[_0x1adfdf(0xd61)];this['topRadius']=_0x1ecc44/0x64,this[_0x1adfdf(0x398)]=this['topRadius']>0x1?0x1:this['topRadius'],this['inner_controlPoints']=getCirclePosition(_0x106734,_0x1ecc44*0.7),this['outer_controlPoints']=getCirclePosition(_0x106734,_0x1ecc44),this[_0x1adfdf(0x3ca)]=getCirclePosition(_0x106734,this['topRadius']),this['circlePoints_2']=getCirclePosition(_0x106734,_0x1ecc44*0x2),this['ringCanvas']=this[_0x1adfdf(0x512)](),this['gradientCircleCanvas']=this['cirdrawGradientCircleCanvas'](),this['image']=this['drawCanvas'](particleImage),this['_color']=getColorByStyle(_0x16b44f),this[_0x1adfdf(0x66f)](_0x16b44f),this[_0x1adfdf(0x3bf)](_0x16b44f),this['addCircle'](_0x16b44f),this['addRing'](_0x16b44f);}[_0x3d5d32(0x566)](){const _0x113605={_0x162af7:0x4cd,_0x14e072:0xf06,_0xe15c88:0x535,_0x5bef92:0xc95},_0x3fb8b6=_0x3d5d32;this['_primitive1']&&(this['primitiveCollection']['remove'](this[_0x3fb8b6(0xdef)]),delete this['_primitive1']),this['_primitive2']&&(this['primitiveCollection'][_0x3fb8b6(0xf06)](this[_0x3fb8b6(_0x113605._0x162af7)]),delete this[_0x3fb8b6(_0x113605._0x162af7)]),this['_primitive3']&&(this[_0x3fb8b6(0x5f4)][_0x3fb8b6(_0x113605._0x14e072)](this['_primitive3']),delete this[_0x3fb8b6(_0x113605._0xe15c88)]),this[_0x3fb8b6(_0x113605._0x5bef92)]&&(this[_0x3fb8b6(0x5f4)]['remove'](this['_primitive4']),delete this['_primitive4']);}['addInner'](_0x2a97ea){const _0x34acbf={_0x2f56f4:0x83e,_0x20a338:0xbe1,_0x3d13c3:0xc6b},_0x48d6ec=_0x3d5d32,_0x799168=createCylinderInstance(this['inner_controlPoints'],this[_0x48d6ec(0x3ca)],{'height':_0x2a97ea[_0x48d6ec(_0x34acbf._0x2f56f4)],'color':this['color'],'distanceDisplayCondition':_0x2a97ea['distanceDisplayCondition']}),_0x3573de=new Cesium__namespace[(_0x48d6ec(_0x34acbf._0x20a338))]({'material':new Cesium__namespace[(_0x48d6ec(_0x34acbf._0x3d13c3))]({'fabric':{'uniforms':{'u_color':this['_color'],'globalAlpha':0x1},'source':ConeGlowCylinderGaussMaterial},'translucent':function(_0x163dd1){return _0x163dd1['uniforms']['u_color']['alpha']<0x1;}})});this['_primitive1']=new Cesium__namespace[(_0x48d6ec(0x684))]({'geometryInstances':_0x799168,'appearance':_0x3573de,'asynchronous':![],'show':this['show']}),this[_0x48d6ec(0x5f4)]['add'](this[_0x48d6ec(0xdef)]);}[_0x3d5d32(0x3bf)](_0x4a14da){const _0x1d8120={_0x2b76d5:0x106b,_0x497e03:0xd91,_0x1bfdd1:0x8e1,_0x1e1d57:0x792},_0x1bb496=_0x3d5d32,_0x54bb6b=createCylinderInstance(this[_0x1bb496(_0x1d8120._0x2b76d5)],this['circular_clone_topPoints'],{'height':_0x4a14da['height'],'distanceDisplayCondition':_0x4a14da['distanceDisplayCondition'],'color':new Cesium__namespace['Color'](0.5,0.8,0x1,0x2)});this['_primitive2']=new Cesium__namespace['Primitive']({'geometryInstances':_0x54bb6b,'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this[_0x1bb496(_0x1d8120._0x497e03)],'image':this[_0x1bb496(_0x1d8120._0x1bfdd1)],'globalAlpha':0x1},'source':ConeGlowCircleOuterMaterial},'translucent':!![]})}),'asynchronous':![],'show':this[_0x1bb496(_0x1d8120._0x1e1d57)]}),this['primitiveCollection']['add'](this['_primitive2']);}['addCircle'](_0x1b1b19){const _0x5b072c={_0x3731e2:0x535},_0x5efc00=_0x3d5d32,_0x15c83d=Cesium__namespace[_0x5efc00(0x220)]['fromCartesian'](this['position']),_0x340d69=createCircleInstance(this['circlePoints_2'],{'perPositionHeight':_0x15c83d['height']>=0x1,'distanceDisplayCondition':_0x1b1b19['distanceDisplayCondition']});this[_0x5efc00(_0x5b072c._0x3731e2)]=new Cesium__namespace['Primitive']({'geometryInstances':_0x340d69,'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this['_color'],'image':this['gradientCircleCanvas'],'globalAlpha':0x1},'source':ConeGlowGradientMaterial},'translucent':!![]})}),'asynchronous':![],'show':this['show']}),this['primitiveCollection'][_0x5efc00(0xff3)](this['_primitive3']);}['addRing'](_0x5a3b0e){const _0x278605={_0x5545f1:0x5b5},_0x23f6bb=_0x3d5d32,_0x490668=createCircleInstance(this[_0x23f6bb(_0x278605._0x5545f1)],{'perPositionHeight':this['point'][_0x23f6bb(0xd29)]>=0x1,'distanceDisplayCondition':_0x5a3b0e[_0x23f6bb(0x8f0)]});this['_primitive4']=new Cesium__namespace['Primitive']({'geometryInstances':_0x490668,'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'material':new Cesium__namespace['Material']({'fabric':{'uniforms':{'u_color':this['_color'],'image':this['ringCanvas'],'globalAlpha':0x1},'source':ConeGlowRingScanMaterial},'translucent':!![]})}),'asynchronous':![],'show':this['show']}),this['primitiveCollection']['add'](this['_primitive4']);}['getParticleImage'](_0x3491c7){const _0x508724={_0x4b94c7:0x3b1},_0x31b644=_0x3d5d32,_0x23a89c=new Image();_0x23a89c[_0x31b644(0x95d)]='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAEACAYAAADSoXR2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjExQTg0NDEyMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjExQTg0NDEzMDEzQjExRUFBNDhBRjhGMUMzOUUyNTU0Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTFBODQ0MTAwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTFBODQ0MTEwMTNCMTFFQUE0OEFGOEYxQzM5RTI1NTQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz41vRwAAAAE90lEQVR42uydyW4UMRCG3T2dgYSAEGs4sp44cCJBcGUJbwCvALwWPAI8ABwAiUVwgLBdkEikJEiAGMhkZqhfU1aa1sy0g+yaJPyWSupOpPjz0uVyucrJer2eG2fJ3ZgLAQhAgC0PgN8XIlkqgGLE75oih0WmRVZEvop0rHog18rnRe6IzInsthyCXFt+TuSKyGmRXZZDgK5eFrkv8l7kiUhrxN/JSo3pigSvcNmI1bCh3b5LK2+NqHyvyEF9x3z5HgqRRViOAXhW5JrCoNdei/y20gMYxhmRSyIXRY6JTMT4DENLW+SdyD19x/NajDmwmYIW79Hnn+MA4GJEAAIQgABJbMJB+n5Sl9zWZvR9DABUfkJkVt8fi3zUldAEoKl24Y2S1fPZEmBdZFHkkb4vxTLRQ5djbyUf0ncYrD/UADUB8MZno2Q19yx7gIqIAAQgAAEIQIAtYZT+85LvRnjQCoPKR3rQUgN4Y3ZeK30g8qps0qeeAzDn4TWD9+ySG+BBS90DaGnVg9a2tgnR4il9/jkOACoiAhCAAASIZpAAFl6yulO0JACo/IDrn6CedP1zxOciv6wAYNnAP3RVBeWtJQCWzG8iL/X9g4vkqNzMctzUXtintt2KM/aS+bmQaY90rb8CF6tSKiICEIAABCAAAQiwbfcFIWVCbUcc9bZDLKiYAKj4uOv7Bb+ILLj+8W7PCgC7Jhzv44Qdh9yrru8V61jPgd645gD2io+15RiC5ZA5ENNPmGmDmtrta9YAVEQE2FlrQUM/J6efU8cSAD87ojodBaccS6kgiiErGiq/qe93XT+3oGU5BJnbyKrIUs6BQZoQUEcrQ7CYagiGqeKiMgnXLXsg5uJUm/RQJKy8fGS7PMw6SgVQPrJFGZr0kCfUL/7IFjIzrLGpemBQ0kPbehL6I9vMjUh6oEVEAAIQgAAEIAABdpyj0qcK71YrqGUJANNrv+sHOcAiRpDDM1cTY1BEHk7kqyP/2Ac5vLEEQEG8aDnIoTb5ObZRWg5ywG5o1dX4ClNYxT7IISgJPsXGpLut9MCWU0S5bqkmdAa3LQEwcZDAfkZ3tthQfkwNkVeeD6kiuaUabcp6DpS9YyalrAdQ8bT1EFQVUabarND9fNuyB2gREYAABCAAAQhAAAIQoM770UgBXARCIr/koDogVlzgrWuxemBKd0m4JnBed0+5ZQ9gn3BK5LK+P4y5ewoB8DFiKO91COLFfwVuTCZV1hSoYw1APZCsFIkbN1Haaa87wwiKQe6eT27AEX6esPVVd8/kOOdAz/oz9FE0p+uGIKUeqE5C8xgSKiICEIAABCAAAQhAAAIQgAAEIAABCECA6AA+sbkREyDUUYlKD6ggZwzRkr8tewBhusisv+0in5qE/hFchoZTE0TL4p8sTbtIpyahQ4Ag5fKpSVBmfdDECvQTZjoM0U9N6KgkwH9xY7PXpPiCmq5yuaLVldHIO7jgNi5XfOEhCqNh9udHV/RnC5YAUDTftdV4/ivvwEoRVS9XXPWa1FIT5ird8jpSB+BDN3rO8AaGMnGy0I0QRYTvdk6NkOsucuhGCMAgI8Q0isaHbmAevNMhiD4P6iZhstANGiQE2PEGCRo2NcgAsQDwKnxWFdlT17/duWU1BJmuHz6A5bwbEsCScgh+qAHit3Jr1oooOPExdRBLbeJjSpuwuy30AAH+CDAAPH5ltESNYl4AAAAASUVORK5CYII=',_0x23a89c[_0x31b644(_0x508724._0x4b94c7)]=function(){_0x3491c7&&_0x3491c7();};}[_0x3d5d32(0x660)](_0x4016a3){const _0x39a5f0=document['createElement']('canvas');_0x39a5f0['width']=0x40,_0x39a5f0['height']=0x100;const _0x24ec10=_0x39a5f0['getContext']('2d',{'willReadFrequently':!![]});return _0x24ec10['clearRect'](0x0,0x0,0x40,0x100),_0x24ec10['drawImage'](_0x4016a3,0x0,0x0),_0x24ec10['drawImage'](_0x4016a3,0x21,0x0),_0x39a5f0;}[_0x3d5d32(0x512)](){const _0xbd7920={_0x26a578:0x1076,_0x223d7e:0xf62,_0x56a94c:0xa01,_0x29ef89:0xb43},_0x109009=_0x3d5d32,_0xd1c7fd=document['createElement']('canvas');_0xd1c7fd[_0x109009(_0xbd7920._0x26a578)]=0x200,_0xd1c7fd['height']=0x200;const _0x5104e9=_0xd1c7fd[_0x109009(0xf58)]('2d',{'willReadFrequently':!![]});return _0x5104e9[_0x109009(_0xbd7920._0x223d7e)]='rgba(255,255,255,0)',_0x5104e9[_0x109009(_0xbd7920._0x56a94c)]='rgba(255,\x20255,\x20255,255)',_0x5104e9['setLineDash']([0x32,0x32]),_0x5104e9[_0x109009(_0xbd7920._0x29ef89)]=0x1e,_0x5104e9[_0x109009(0xe31)](),_0x5104e9['arc'](0x100,0x100,0x96,0x0,Math['PI']*0x2,!![]),_0x5104e9['stroke'](),_0x5104e9['restore'](),_0xd1c7fd;}['cirdrawGradientCircleCanvas'](){const _0x148de0={_0x25db8a:0x3dc,_0x3ab71a:0x901,_0x486548:0x634,_0x5f2e9f:0x1025},_0x2eac83=_0x3d5d32,_0x3e6c24=document[_0x2eac83(_0x148de0._0x25db8a)]('canvas');_0x3e6c24['width']=0x200,_0x3e6c24['height']=0x200;const _0x21fb3e=_0x3e6c24['getContext']('2d',{'willReadFrequently':!![]}),_0x10a70a=_0x21fb3e['createRadialGradient'](0x100,0x100,0x0,0x100,0x100,0x100);return _0x10a70a[_0x2eac83(_0x148de0._0x3ab71a)](0.1,_0x2eac83(_0x148de0._0x486548)),_0x10a70a['addColorStop'](0.2,_0x2eac83(_0x148de0._0x5f2e9f)),_0x10a70a[_0x2eac83(0x901)](0.3,'rgba(255,\x20255,\x20255,\x200.9)'),_0x10a70a['addColorStop'](0.5,'rgba(255,\x20255,\x20255,\x200.0)'),_0x10a70a['addColorStop'](0.9,'rgba(255,\x20255,\x20255,\x200.2)'),_0x10a70a['addColorStop'](0x1,'rgba(255,\x20255,\x20255,\x201.0)'),_0x21fb3e['clearRect'](0x0,0x0,0x200,0x200),_0x21fb3e['beginPath'](),_0x21fb3e['arc'](0x100,0x100,0x100,0x0,Math['PI']*0x2,!![]),_0x21fb3e['fillStyle']=_0x10a70a,_0x21fb3e['fill'](),_0x21fb3e['restore'](),_0x3e6c24;}['setOpacity'](_0x33e707){const _0x31cf34={_0x2491c1:0xd8f,_0x4e714e:0xfe3,_0x283e50:0x783},_0x198e5f=_0x3d5d32;this['style']['globalAlpha']=_0x33e707,this['_primitive1']&&(this['_primitive1']['appearance'][_0x198e5f(_0x31cf34._0x2491c1)][_0x198e5f(_0x31cf34._0x4e714e)]['globalAlpha']=_0x33e707,this['_primitive2']['appearance'][_0x198e5f(_0x31cf34._0x2491c1)]['uniforms'][_0x198e5f(0xc96)]=_0x33e707,this['_primitive3'][_0x198e5f(_0x31cf34._0x283e50)][_0x198e5f(_0x31cf34._0x2491c1)][_0x198e5f(0xfe3)]['globalAlpha']=_0x33e707,this[_0x198e5f(0xc95)]['appearance']['material']['uniforms']['globalAlpha']=_0x33e707);}['_getDrawEntityClass'](_0x598e60,_0x1cdf93){return this['_getDrawPointEntityClass'](_0x598e60,_0x1cdf93);}}register$4(_0x3d5d32(0xca8),LightCone,!![]);function createCircleInstance(_0x3c2e03,_0x5b4f90){const _0x2e24ac=new Cesium__namespace['PolygonGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0x3c2e03),'perPositionHeight':_0x5b4f90['perPositionHeight']});return new Cesium__namespace['GeometryInstance']({'geometry':_0x2e24ac,'attributes':{'distanceDisplayCondition':_0x5b4f90['distanceDisplayCondition']||new Cesium__namespace['DistanceDisplayConditionGeometryInstanceAttribute']()}});}function createCylinderInstance(_0x3bec79,_0x29ed28,_0x1f4d93){const _0x3f6f5e=_0x3d5d32,_0x47d73f=_0x1f4d93[_0x3f6f5e(0x83e)],_0x4f2f74=_0x1f4d93['color'],_0xc7eab=_0x3bec79['slice'](),_0x51ea77=_0x3bec79[_0x3f6f5e(0xc84)],_0x5f03f7=0x2*_0x51ea77,_0x28bb98=[],_0x49cd50=0x1/(_0x51ea77-0x1),_0x5d8a28=[],_0x394bc5=[];for(let _0x13fe44=0x0;_0x13fe44<_0x51ea77;_0x13fe44++){_0x394bc5['push'](addPositionsHeight(_0x29ed28[_0x13fe44],_0x47d73f)),_0x28bb98['push'](_0x13fe44*_0x49cd50),_0x28bb98['push'](0x0);const _0x35c0cb=_0x13fe44+0x1,_0x1aee12=(_0x13fe44+0x1)%_0x51ea77,_0x56680f=_0x5f03f7-_0x35c0cb;_0x5d8a28[_0x3f6f5e(0xb75)](...[_0x56680f-0x1,_0x56680f,_0x13fe44]),_0x5d8a28[_0x3f6f5e(0xb75)](...[_0x13fe44,_0x1aee12,_0x56680f-0x1]);}for(let _0x489e3f=0x0;_0x489e3f<_0x394bc5['length'];_0x489e3f++){_0xc7eab['push'](_0x394bc5[_0x51ea77-_0x489e3f-0x1]),_0x28bb98['push'](0x1-_0x489e3f*_0x49cd50),_0x28bb98['push'](0x1);}let _0x17a1a4=new Cesium__namespace['PolygonGeometry']({'polygonHierarchy':new Cesium__namespace['PolygonHierarchy'](_0xc7eab),'perPositionHeight':!![]});return _0x17a1a4=Cesium__namespace['PolygonGeometry']['createGeometry'](_0x17a1a4),_0x17a1a4['indices']=_0x5d8a28,_0x17a1a4[_0x3f6f5e(0xf90)]['st']['values']=_0x28bb98,new Cesium__namespace['GeometryInstance']({'geometry':_0x17a1a4,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x4f2f74),'distanceDisplayCondition':_0x1f4d93['distanceDisplayCondition']||new Cesium__namespace[(_0x3f6f5e(0xa61))]()}});}function getCirclePosition(_0x222641,_0x5ddb95,_0x1a1b9f=0x78){const _0x451866=_0x3d5d32,_0x4de554=[],_0x765770=Cesium__namespace[_0x451866(0x5bb)]['eastNorthUpToFixedFrame'](_0x222641),_0x1b694c=0x2*Math['PI']/_0x1a1b9f,_0x161c14=0x2*Math['PI']*0x10e/0x168;for(let _0x323616=0x0;_0x323616<_0x1a1b9f;_0x323616++){const _0x524aa0=_0x161c14-_0x1b694c*_0x323616,_0x57d3fd=new Cesium__namespace['Cartesian3'](Math['sin'](_0x524aa0)*_0x5ddb95,Math['cos'](_0x524aa0)*_0x5ddb95,0x0);_0x4de554['push'](Cesium__namespace[_0x451866(0xf5d)]['multiplyByPoint'](_0x765770,_0x57d3fd,new Cesium__namespace[(_0x451866(0xe95))]()));}return _0x4de554['push'](_0x4de554[0x0]),_0x4de554;}var WaterFS='in\x20vec3\x20v_positionMC;\x0ain\x20vec3\x20v_positionEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(czm_normal3D\x20*\x20czm_geodeticSurfaceNormal(v_positionMC,\x20vec3(0.0),\x20vec3(1.0)));\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x20\x20materialInput.s\x20=\x20v_st.s;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x20\x20materialInput.str\x20=\x20vec3(v_st,\x200.0);\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.tangentToEyeMatrix\x20=\x20czm_eastNorthUpToEyeCoordinates(v_positionMC,\x20materialInput.normalEC);\x0a\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20\x20\x20#endif\x0a}\x0a';class Water extends PolygonPrimitive{['_addedHook'](_0x4d24c1){const _0x5d5653={_0x4403ef:0xc6b,_0x267efc:0x458,_0xdd7f29:0xec9,_0x40810a:0x517,_0x87b7b2:0x967,_0x746a51:0xe7a},_0x539edd=_0x3d5d32;if(!this['show']||!this[_0x539edd(0xbb8)]||this['positions']['length']===0x0)return;const _0x4e8720=this['_conversionStyle'](_0x4d24c1);_0x4e8720['vertexFormat']=Cesium__namespace['EllipsoidSurfaceAppearance']['VERTEX_FORMAT'],_0x4d24c1['opacity']=_0x4d24c1['opacity']??0.8;const _0x31c9cf=_0x4d24c1['opacity']*(_0x4d24c1['globalAlpha']??0x1),_0xd948b7={'geometryInstances':this['_createGeometryInstance'](_0x4e8720),'appearance':new Cesium__namespace['EllipsoidSurfaceAppearance']({'aboveGround':![],'material':new Cesium__namespace[(_0x539edd(_0x5d5653._0x4403ef))]({'fabric':{'type':_0x539edd(0xa5e),'uniforms':{'specularMap':_0x4e8720['specularMap']||Cesium__namespace['Material'][_0x539edd(0x237)],'normalMap':_0x4e8720['normalMap']||Cesium__namespace['Material']['DefaultImageId'],'frequency':_0x4e8720['frequency']||0x1f40,'animationSpeed':_0x4e8720['animationSpeed']||0.03,'amplitude':_0x4e8720['amplitude']||0x5,'specularIntensity':_0x4d24c1['specularIntensity']||0.8,'baseWaterColor':getCesiumColor(_0x4d24c1['baseWaterColor']||'#123e59')['withAlpha'](_0x4d24c1['opacity']),'blendColor':getCesiumColor(_0x4d24c1[_0x539edd(0x958)]||'#123e59')['withAlpha'](_0x4d24c1['opacity'])}}}),'fragmentShaderSource':WaterFS,'translucent':_0x31c9cf!==0x1}),'show':this['show']};_0x4d24c1['clampToGround']?(_0xd948b7['classificationType']=_0x4d24c1[_0x539edd(0x2ab)]??Cesium__namespace[_0x539edd(_0x5d5653._0x267efc)]['TERRAIN'],this['_primitive']=this[_0x539edd(0x5f4)][_0x539edd(0xff3)](new Cesium__namespace[(_0x539edd(_0x5d5653._0xdd7f29))](_0xd948b7))):this[_0x539edd(_0x5d5653._0x40810a)]=this['primitiveCollection']['add'](new Cesium__namespace['Primitive'](_0xd948b7));this[_0x539edd(_0x5d5653._0x87b7b2)]&&(this['primitiveCollection']['remove'](this['_primitive_outline']),delete this['_primitive_outline']);if(_0x4d24c1[_0x539edd(_0x5d5653._0x746a51)]){const _0x4488d8=this['_getOutlineStyle'](_0x4d24c1);this['_primitive_outline']=this[_0x539edd(0xe0d)](_0x4488d8);}_0x4d24c1[_0x539edd(0x32a)]&&this['_addLabel']();}[_0x3d5d32(0xac7)](_0x428a9c,_0x5217f6){const _0x2980bb={_0x554f66:0xb2a,_0x47071c:0xa5e},_0x3436fd=_0x3d5d32;return _0x428a9c[_0x3436fd(0xdde)][_0x3436fd(_0x2980bb._0x554f66)]=_0x3436fd(_0x2980bb._0x47071c),create$4('polygon',_0x428a9c);}}register$4('water',Water);var DiffuseWallGlowVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec2\x20v_st;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec3\x20v_positionEC;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_translateRelativeToEye(position3DHigh,\x20position3DLow);\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',DiffuseWallGlowFS='in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20out_FragColor\x20=\x20xh_getMaterial(v_st);\x0a}\x0a';const DEF_STYLE$f={'diffHeight':0x3e8,'speed':0xa,'maxScale':0x1};class DiffuseWall extends BasePolyPrimitive{constructor(_0x1df0a3={}){const _0x158bd5={_0x325bda:0xa6e},_0x1afd0f=_0x3d5d32;_0x1df0a3['style']={...DEF_STYLE$f,..._0x1df0a3['style']||{}},super(_0x1df0a3);if(_0x1df0a3[_0x1afd0f(0xbb8)])this['center']=this['centerOfMass'];else _0x1df0a3['position']&&(this[_0x1afd0f(0xb69)]=_0x1df0a3[_0x1afd0f(0xb69)],this[_0x1afd0f(_0x158bd5._0x325bda)]=!![]);this['_mScale']=Cesium__namespace['Matrix4']['fromUniformScale'](0x1),this['_maxScale']=_0x1df0a3['style']['maxScale']||0x1;}get['czmObject'](){const _0x3094a7={_0x167f53:0x517},_0x313b2f=_0x3d5d32;return this[_0x313b2f(_0x3094a7._0x167f53)];}get[_0x3d5d32(0xe72)](){return this['_center'];}set['center'](_0x4f8c23){const _0x11541f={_0x103ee9:0xe5e},_0x3e6f90=_0x3d5d32;this[_0x3e6f90(_0x11541f._0x103ee9)]=_0x4f8c23;}get['position'](){const _0x370fba={_0x48a914:0xe5e},_0x8b8b74=_0x3d5d32;return this[_0x8b8b74(_0x370fba._0x48a914)];}set['position'](_0x37c1f9){const _0x1f11c3=_0x3d5d32;this['_center']=LngLatPoint['parse'](_0x37c1f9)[_0x1f11c3(0xed4)](),this['_updatePositionsByCircleCenter']();}get['radius'](){const _0x137f93={_0x344fd8:0xdde},_0x19b5e0=_0x3d5d32;return this[_0x19b5e0(_0x137f93._0x344fd8)]['radius'];}set[_0x3d5d32(0xd61)](_0x4656c5){const _0x2da136={_0x3d81ca:0xc28},_0x196a49=_0x3d5d32;this['style']['radius']=_0x4656c5,this[_0x196a49(_0x2da136._0x3d81ca)]();}['_addedHook'](_0x3f0bf0){const _0x56aee0={_0x57411b:0x792,_0x13ef64:0xe72,_0x3ef30b:0xb75,_0x19ed72:0xf0e,_0x5be380:0x5b0,_0x4b4ae9:0xe27,_0x528594:0xdde,_0x11e830:0xff3},_0x59b0e1=_0x3d5d32,_0x3da31f=this[_0x59b0e1(0xbb8)];if(!this[_0x59b0e1(_0x56aee0._0x57411b)]||!_0x3da31f||_0x3da31f['length']===0x0)return;const _0x18a7a5=addPositionsHeight(this[_0x59b0e1(0xbb8)],_0x3f0bf0['diffHeight']);this[_0x59b0e1(_0x56aee0._0x13ef64)]=this[_0x59b0e1(0xe0b)];const _0x24de69=[],_0x10f589=[],_0x790d2=[],_0x11c7f5=[];for(let _0x2f22f6=0x0,_0x4f235f=_0x3da31f[_0x59b0e1(0xc84)];_0x2f22f6<_0x4f235f;_0x2f22f6++){const _0x4161f4=(_0x2f22f6+0x1)%_0x4f235f;_0x24de69['push'](...[_0x3da31f[_0x2f22f6]['x'],_0x3da31f[_0x2f22f6]['y'],_0x3da31f[_0x2f22f6]['z']]),_0x24de69['push'](...[_0x3da31f[_0x4161f4]['x'],_0x3da31f[_0x4161f4]['y'],_0x3da31f[_0x4161f4]['z']]),_0x24de69['push'](...[_0x18a7a5[_0x4161f4]['x'],_0x18a7a5[_0x4161f4]['y'],_0x18a7a5[_0x4161f4]['z']]),_0x24de69['push'](...[_0x18a7a5[_0x2f22f6]['x'],_0x18a7a5[_0x2f22f6]['y'],_0x18a7a5[_0x2f22f6]['z']]),_0x11c7f5['push'](...[0x0,0x0,0x1]),_0x11c7f5['push'](...[0x0,0x0,0x1]),_0x11c7f5['push'](...[0x0,0x0,0x1]),_0x11c7f5[_0x59b0e1(_0x56aee0._0x3ef30b)](...[0x0,0x0,0x1]),_0x10f589['push'](...[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]);const _0x49bb39=_0x2f22f6*0x4,_0x5e4ed5=_0x49bb39+0x1,_0x5f009d=_0x49bb39+0x2,_0x3653f8=_0x49bb39+0x3;_0x790d2['push'](...[_0x5f009d,_0x3653f8,_0x49bb39,_0x49bb39,_0x5e4ed5,_0x5f009d]);}const _0x211872=new Float64Array(_0x24de69),_0x5e6f90=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace[(_0x59b0e1(_0x56aee0._0x19ed72))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x211872}),'normal':new Cesium__namespace[(_0x59b0e1(_0x56aee0._0x19ed72))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array(_0x11c7f5)}),'st':new Cesium__namespace[(_0x59b0e1(0xf0e))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(_0x10f589)})},'indices':new Uint16Array(_0x790d2),'primitiveType':Cesium__namespace['PrimitiveType'][_0x59b0e1(_0x56aee0._0x5be380)],'boundingSphere':Cesium__namespace[_0x59b0e1(0xbd8)][_0x59b0e1(_0x56aee0._0x4b4ae9)](_0x211872)})}),_0x58ac4a=getColorByStyle(_0x3f0bf0);this['_primitive']=new Cesium__namespace['Primitive']({'geometryInstances':_0x5e6f90,'appearance':new Cesium__namespace['MaterialAppearance']({'material':new Cesium__namespace['Material']({'translucent':!![],'fabric':{'uniforms':{'color':_0x58ac4a,'globalAlpha':0x1},'source':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20vec4\x20color;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20xh_getMaterial(vec2\x20st){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20alpha\x20=\x20pow(1.\x20-\x20st.t,\x201.5);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20colorNew\x20=\x20vec4(color.rgb\x20*\x20color.a,\x20alpha*globalAlpha);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20colorNew;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}'}}),'vertexShaderSource':DiffuseWallGlowVS,'fragmentShaderSource':DiffuseWallGlowFS}),'asynchronous':![],'shadows':this[_0x59b0e1(_0x56aee0._0x528594)]['shadows'],'show':this['show']}),this['primitiveCollection'][_0x59b0e1(_0x56aee0._0x11e830)](this['_primitive']),this['bindUpdateEvent']();}[_0x3d5d32(0x566)](){const _0x5290b0={_0x23b99a:0x517},_0x1a01a1=_0x3d5d32;this[_0x1a01a1(_0x5290b0._0x23b99a)]&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']);}[_0x3d5d32(0x635)](_0x1346c0){const _0x3ebc03={_0x2ecc1c:0x517,_0x363bc1:0x517,_0x425292:0xd93,_0x424bd6:0xcc8},_0x18fac9=_0x3d5d32;if(this[_0x18fac9(_0x3ebc03._0x2ecc1c)]&&this['_show']){const _0x2f8ea3=_0x1346c0[_0x18fac9(0xcea)]/0x3e8*this[_0x18fac9(0xdde)][_0x18fac9(0x85c)];let _0x46651a=_0x2f8ea3-Math[_0x18fac9(0x6fa)](_0x2f8ea3);_0x46651a=_0x46651a<0.01?0.01:_0x46651a,this['_mScale'][0x0]=this['_mScale'][0x5]=_0x46651a*this['_maxScale'],this['_mScale'][0xa]=1.1-_0x46651a,this[_0x18fac9(_0x3ebc03._0x363bc1)][_0x18fac9(_0x3ebc03._0x425292)]=scaleXYZ(this['center'],this[_0x18fac9(_0x3ebc03._0x424bd6)]);}}[_0x3d5d32(0xc28)](){const _0x581684={_0x51c3ba:0xdde},_0x1ddad2=_0x3d5d32;this['positions']=getEllipseOuterPositions({'position':this['_center'],'radius':this[_0x1ddad2(_0x581684._0x51c3ba)]['radius']??0x64,'count':this[_0x1ddad2(_0x581684._0x51c3ba)]['count']??0x32});}[_0x3d5d32(0xac7)](_0x406da4,_0x58fc3b){const _0x1fe440=_0x3d5d32;return this['_isCircle']?create$4('circle',_0x406da4):(_0x406da4['style']['closure']=!![],create$4(_0x1fe440(0x65f),_0x406da4));}['_updateStyleByEdit'](_0x38b726){const _0x253d09={_0x277a39:0xd61,_0x2a2da4:0xb84,_0x3c9c60:0x9e2,_0x2dd5a7:0x9e2},_0x2070e8=_0x3d5d32;this['_isCircle']&&Cesium__namespace['defined'](_0x38b726['radius'])&&(this['radius']=_0x38b726[_0x2070e8(_0x253d09._0x277a39)]),Cesium__namespace[_0x2070e8(_0x253d09._0x2a2da4)](_0x38b726['diffHeight'])&&(this['style'][_0x2070e8(_0x253d09._0x3c9c60)]=_0x38b726[_0x2070e8(_0x253d09._0x2dd5a7)]);}}register$4(_0x3d5d32(0x936),DiffuseWall);function scaleXYZ(_0x4e0a6e,_0x46aa34){const _0x5aa42f={_0x138b37:0x5bb},_0x2b9709=_0x3d5d32,_0x2796c1=Cesium__namespace[_0x2b9709(_0x5aa42f._0x138b37)][_0x2b9709(0x724)](_0x4e0a6e),_0x12cba1=Cesium__namespace['Matrix4']['inverse'](_0x2796c1,new Cesium__namespace[(_0x2b9709(0xf5d))]()),_0x29417f=Cesium__namespace[_0x2b9709(0xf5d)][_0x2b9709(0x37e)](_0x46aa34,_0x12cba1,new Cesium__namespace[(_0x2b9709(0xf5d))]());return Cesium__namespace[_0x2b9709(0xf5d)]['multiply'](_0x2796c1,_0x29417f,new Cesium__namespace['Matrix4']());}var ScrollWallGlowVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec2\x20v_st;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec3\x20v_positionEC;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_translateRelativeToEye(position3DHigh,\x20position3DLow);\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',ScrollWallGlowFS='in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a}\x0a',ScrollWallGlowMaterial='uniform\x20float\x20globalAlpha;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20cmi)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(cmi);\x0a\x20\x20vec2\x20st\x20=\x20cmi.st;\x0a\x20\x20float\x20t\x20=\x20fract(speed\x20*\x20czm_frameNumber\x20/\x201000.0)\x20*\x20direction;\x0a\x20\x20vec2\x20st1\x20=\x20vec2(st.s,\x20fract(st.t\x20-\x20t));\x0a\x20\x20vec4\x20color\x20=\x20vec4(0.,\x200.,\x200.,\x200.);\x0a\x20\x20float\x20tt\x20=\x200.5\x20-\x20abs(0.5\x20-\x20st1.t);\x0a\x20\x20float\x20ss\x20=\x20st1.s;\x0a\x20\x20float\x20alpha\x20=\x20tt\x20*\x202.;\x0a\x20\x20color\x20=\x20vec4(u_color.rgb\x20*\x20u_color.a,\x20alpha\x20*\x201.2);\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x20\x20material.alpha\x20=\x20color.a\x20*\x20globalAlpha;\x0a\x20\x20return\x20material;\x0a}\x0a',ScrollWallGlowMaterial2=_0x3d5d32(0xf9a);const DEF_STYLE$e={'diffHeight':0x64,'speed':0xa,'style':0x1};class ScrollWall extends BasePolyPrimitive{constructor(_0x58bd16={}){_0x58bd16['style']={...DEF_STYLE$e,..._0x58bd16['style']||{}},super(_0x58bd16);}get[_0x3d5d32(0xd2e)](){const _0x505efd={_0xee6823:0x517},_0x58853c=_0x3d5d32;return this[_0x58853c(_0x505efd._0xee6823)];}[_0x3d5d32(0x226)](_0x59a540){const _0x454c3b={_0x99188f:0xb75,_0x187b15:0xb75,_0x10e1f6:0xf0e,_0x3bdcfa:0x436,_0x47f4e8:0x34e,_0x41e37c:0xb1a},_0x483a7d=_0x3d5d32,_0x543eb7=this['positions'];if(!this[_0x483a7d(0x792)]||!_0x543eb7||_0x543eb7['length']===0x0)return;const _0x383a73=addPositionsHeight(_0x543eb7,_0x59a540['diffHeight']),_0x28b1cf=[],_0x3ab9cf=[],_0xaf57ca=[],_0x477621=[];for(let _0xd72a5=0x0,_0x16e7d2=_0x543eb7['length'];_0xd72a5<_0x16e7d2;_0xd72a5++){let _0x97d069=_0xd72a5+0x1;_0x97d069===_0x16e7d2&&(_0x97d069=0x0);_0x28b1cf[_0x483a7d(0xb75)](...[_0x543eb7[_0xd72a5]['x'],_0x543eb7[_0xd72a5]['y'],_0x543eb7[_0xd72a5]['z']]),_0x28b1cf['push'](...[_0x543eb7[_0x97d069]['x'],_0x543eb7[_0x97d069]['y'],_0x543eb7[_0x97d069]['z']]),_0x28b1cf['push'](...[_0x383a73[_0x97d069]['x'],_0x383a73[_0x97d069]['y'],_0x383a73[_0x97d069]['z']]),_0x28b1cf[_0x483a7d(0xb75)](...[_0x383a73[_0xd72a5]['x'],_0x383a73[_0xd72a5]['y'],_0x383a73[_0xd72a5]['z']]),_0x477621[_0x483a7d(_0x454c3b._0x99188f)](...[0x0,0x0,0x1]),_0x477621['push'](...[0x0,0x0,0x1]),_0x477621[_0x483a7d(_0x454c3b._0x187b15)](...[0x0,0x0,0x1]),_0x477621[_0x483a7d(0xb75)](...[0x0,0x0,0x1]),_0x3ab9cf['push'](...[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]);const _0x207b0d=_0xd72a5*0x4,_0x2e9aee=_0x207b0d+0x1,_0x41525c=_0x207b0d+0x2,_0x5808a8=_0x207b0d+0x3;_0xaf57ca['push'](...[_0x207b0d,_0x2e9aee,_0x41525c,_0x41525c,_0x5808a8,_0x207b0d]);}const _0x5e0929=new Float64Array(_0x28b1cf),_0x48f214=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace[(_0x483a7d(0xcc4))]({'attributes':{'position':new Cesium__namespace[(_0x483a7d(_0x454c3b._0x10e1f6))]({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x483a7d(_0x454c3b._0x3bdcfa)],'componentsPerAttribute':0x3,'values':_0x5e0929}),'normal':new Cesium__namespace[(_0x483a7d(0xf0e))]({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x483a7d(_0x454c3b._0x47f4e8)],'componentsPerAttribute':0x3,'values':new Float32Array(_0x477621)}),'st':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x483a7d(0x34e)],'componentsPerAttribute':0x2,'values':new Float32Array(_0x3ab9cf)})},'indices':new Uint16Array(_0xaf57ca),'primitiveType':Cesium__namespace[_0x483a7d(_0x454c3b._0x41e37c)][_0x483a7d(0x5b0)],'boundingSphere':Cesium__namespace['BoundingSphere'][_0x483a7d(0xe27)](_0x5e0929)})}),_0x3b0efa=getColorByStyle(_0x59a540),_0x4feae2=!![];this[_0x483a7d(0x517)]=new Cesium__namespace['Primitive']({'geometryInstances':_0x48f214,'appearance':new Cesium__namespace['MaterialAppearance']({'material':new Cesium__namespace['Material']({'translucent':_0x4feae2,'fabric':{'uniforms':{'u_color':_0x3b0efa,'speed':_0x59a540[_0x483a7d(0x85c)],'direction':_0x59a540['reverse']?0x1:-0x1,'globalAlpha':0x1},'source':this['createShader']()}}),'vertexShaderSource':ScrollWallGlowVS,'fragmentShaderSource':ScrollWallGlowFS}),'asynchronous':![],'shadows':_0x59a540['shadows'],'show':this['show']}),this['primitiveCollection']['add'](this[_0x483a7d(0x517)]);}[_0x3d5d32(0x566)](){const _0x491330={_0x4bfb46:0x5f4,_0x1d730d:0xf06},_0x2138bb=_0x3d5d32;this['_primitive']&&(this[_0x2138bb(_0x491330._0x4bfb46)][_0x2138bb(_0x491330._0x1d730d)](this['_primitive']),delete this['_primitive']);}[_0x3d5d32(0xd8a)](){return this['style']['style']===0x1?ScrollWallGlowMaterial:ScrollWallGlowMaterial2;}[_0x3d5d32(0xac7)](_0xfc203d,_0x316e67){const _0x1cc2ff={_0x2c49de:0xdde},_0x175c98=_0x3d5d32;return _0xfc203d[_0x175c98(_0x1cc2ff._0x2c49de)]['closure']=!![],create$4('wall',_0xfc203d);}}register$4('scrollWall',ScrollWall);const Cartesian3$1=Cesium__namespace['Cartesian3'],defined$1=Cesium__namespace['defined'],CesiumMath$1=Cesium__namespace['Math'],Matrix3=Cesium__namespace['Matrix3'],PolylineVolumeGeometryLibrary=Cesium__namespace['PolylineVolumeGeometryLibrary'],Quaternion=Cesium__namespace['Quaternion'],ThickWallGeometryLibrary={},scratch1=new Cartesian3$1(),scratch2=new Cartesian3$1(),scratch3=new Cartesian3$1(),scratch4=new Cartesian3$1(),scaleArray2=[new Cartesian3$1(),new Cartesian3$1()],cartesian1=new Cartesian3$1(),cartesian2=new Cartesian3$1(),cartesian3=new Cartesian3$1(),cartesian4=new Cartesian3$1(),cartesian5=new Cartesian3$1(),cartesian6=new Cartesian3$1(),cartesian7=new Cartesian3$1(),cartesian8=new Cartesian3$1(),cartesian9=new Cartesian3$1(),cartesian10$1=new Cartesian3$1(),quaterion=new Quaternion(),rotMatrix=new Matrix3();function cartesian3ToArray(_0x3ce06c){const _0x53a619={_0x34f942:0xb75},_0x6546c4=[];return _0x3ce06c['forEach'](_0x4671f9=>{const _0x41cf45=_0x4132;_0x6546c4['push'](_0x4671f9['x']),_0x6546c4['push'](_0x4671f9['y']),_0x6546c4[_0x41cf45(_0x53a619._0x34f942)](_0x4671f9['z']);}),_0x6546c4;}function computeRoundCorner(_0x345858,_0x230ad6,_0x2d9d92,_0x7bbfa9){const _0x3136f0={_0xde5cdb:0x97f,_0x411484:0xef2,_0x3fd580:0x315},_0x4487a7=_0x3d5d32,_0x443be0=Cartesian3$1[_0x4487a7(_0x3136f0._0xde5cdb)](Cartesian3$1['subtract'](_0x230ad6,_0x345858,scratch1),Cartesian3$1['subtract'](_0x2d9d92,_0x345858,scratch2)),_0x5bc656=0x1,_0x145700=_0x5bc656*0x3,_0x4e5d05=new Array(_0x145700);_0x4e5d05[_0x145700-0x3]=_0x2d9d92['x'],_0x4e5d05[_0x145700-0x2]=_0x2d9d92['y'],_0x4e5d05[_0x145700-0x1]=_0x2d9d92['z'];let _0x557ff4;_0x7bbfa9?_0x557ff4=Matrix3['fromQuaternion'](Quaternion['fromAxisAngle'](Cartesian3$1['negate'](_0x345858,scratch1),_0x443be0/_0x5bc656,quaterion),rotMatrix):_0x557ff4=Matrix3['fromQuaternion'](Quaternion[_0x4487a7(_0x3136f0._0x411484)](_0x345858,_0x443be0/_0x5bc656,quaterion),rotMatrix);let _0x3d9496=0x0;_0x230ad6=Cartesian3$1[_0x4487a7(_0x3136f0._0x3fd580)](_0x230ad6,scratch1);for(let _0x1518a1=0x0;_0x1518a1<_0x5bc656;_0x1518a1++){_0x230ad6=Matrix3['multiplyByVector'](_0x557ff4,_0x230ad6,_0x230ad6),_0x4e5d05[_0x3d9496++]=_0x230ad6['x'],_0x4e5d05[_0x3d9496++]=_0x230ad6['y'],_0x4e5d05[_0x3d9496++]=_0x230ad6['z'];}return _0x4e5d05;}function addShiftedPositions(_0x465f20,_0x3e10f3,_0x38b33e,_0x2ebf34){const _0x107130={_0x43abbd:0xadd,_0x303b92:0xae9},_0x200dc2=_0x3d5d32,_0x54c289=new Array(_0x465f20['length']),_0x385d32=new Array(_0x465f20['length']),_0x35c7bc=Cartesian3$1[_0x200dc2(_0x107130._0x43abbd)](_0x3e10f3,_0x38b33e,scratch1),_0x2ed1eb=Cartesian3$1[_0x200dc2(_0x107130._0x303b92)](_0x35c7bc,scratch2);let _0x1458d4=0x0,_0x775c81=_0x465f20[_0x200dc2(0xc84)]-0x1;for(let _0x2ea51d=0x0;_0x2ea51d<_0x465f20['length'];_0x2ea51d+=0x3){const _0x58e4fb=Cartesian3$1['fromArray'](_0x465f20,_0x2ea51d,scratch3),_0x3609be=Cartesian3$1['add'](_0x58e4fb,_0x2ed1eb,scratch4);_0x54c289[_0x1458d4++]=_0x3609be['x'],_0x54c289[_0x1458d4++]=_0x3609be['y'],_0x54c289[_0x1458d4++]=_0x3609be['z'];const _0x1f3dfc=Cartesian3$1[_0x200dc2(0xff3)](_0x58e4fb,_0x35c7bc,scratch4);_0x385d32[_0x775c81--]=_0x1f3dfc['z'],_0x385d32[_0x775c81--]=_0x1f3dfc['y'],_0x385d32[_0x775c81--]=_0x1f3dfc['x'];}return _0x2ebf34['push'](_0x54c289,_0x385d32),_0x2ebf34;}ThickWallGeometryLibrary['addAttribute']=function(_0x2143c3,_0x2af9a6,_0x473ce8,_0x59b61a){const _0xc2f6ac=_0x2af9a6['x'],_0x196538=_0x2af9a6['y'],_0x3df263=_0x2af9a6['z'];defined$1(_0x473ce8)&&(_0x2143c3[_0x473ce8]=_0xc2f6ac,_0x2143c3[_0x473ce8+0x1]=_0x196538,_0x2143c3[_0x473ce8+0x2]=_0x3df263),defined$1(_0x59b61a)&&(_0x2143c3[_0x59b61a]=_0x3df263,_0x2143c3[_0x59b61a-0x1]=_0x196538,_0x2143c3[_0x59b61a-0x2]=_0xc2f6ac);};const scratchForwardProjection=new Cartesian3$1(),scratchBackwardProjection=new Cartesian3$1();ThickWallGeometryLibrary['computePositions']=function(_0x4e307){const _0xd6db8b={_0x20e553:0x5ac,_0x28bcca:0xf69,_0x21f541:0xd97,_0x3dd16b:0xff3,_0x52e187:0x4b2,_0x5dbcf3:0xe8e,_0xe8efac:0xae9,_0x206546:0x24c,_0x3fa9f3:0xadd},_0x503e53=_0x3d5d32,_0x91ba7c=_0x4e307['positions'],_0x3b17=_0x4e307[_0x503e53(_0xd6db8b._0x20e553)],_0x49555b=_0x4e307['width']/0x2;let _0x224b10=cartesian1,_0x13962b=cartesian2,_0x3f3e87=cartesian3,_0x16570f=cartesian4,_0x5d4e13=cartesian5,_0x14e79a=cartesian6,_0x336204=cartesian7,_0x310995=cartesian8,_0x20ea0e=cartesian9,_0xc8f89d=cartesian10$1,_0x53e2f2=[],_0x52ae03=_0x91ba7c[0x0],_0x4fafe1=_0x91ba7c[0x1];_0x13962b=Cartesian3$1[_0x503e53(_0xd6db8b._0x28bcca)](Cartesian3$1[_0x503e53(_0xd6db8b._0x21f541)](_0x4fafe1,_0x52ae03,_0x13962b),_0x13962b),_0x224b10=_0x3b17['geodeticSurfaceNormal'](_0x52ae03,_0x224b10),_0x16570f=Cartesian3$1['normalize'](Cartesian3$1['cross'](_0x224b10,_0x13962b,_0x16570f),_0x16570f),_0x336204=Cartesian3$1['clone'](_0x52ae03,_0x336204),_0x52ae03=_0x4fafe1,_0x3f3e87=Cartesian3$1['negate'](_0x13962b,_0x3f3e87);let _0x442f4a;const _0x2957ef=[];let _0x4fbd6a;const _0xe33fd2=_0x91ba7c['length'];for(_0x4fbd6a=0x1;_0x4fbd6a<_0xe33fd2-0x1;_0x4fbd6a++){_0x224b10=_0x3b17['geodeticSurfaceNormal'](_0x52ae03,_0x224b10),_0x4fafe1=_0x91ba7c[_0x4fbd6a+0x1],_0x13962b=Cartesian3$1['normalize'](Cartesian3$1['subtract'](_0x4fafe1,_0x52ae03,_0x13962b),_0x13962b),_0x5d4e13=Cartesian3$1['normalize'](Cartesian3$1[_0x503e53(_0xd6db8b._0x3dd16b)](_0x13962b,_0x3f3e87,_0x5d4e13),_0x5d4e13);const _0x249098=Cartesian3$1[_0x503e53(0xadd)](_0x224b10,Cartesian3$1[_0x503e53(_0xd6db8b._0x52e187)](_0x13962b,_0x224b10),scratchForwardProjection);Cartesian3$1['subtract'](_0x13962b,_0x249098,_0x249098),Cartesian3$1['normalize'](_0x249098,_0x249098);const _0x10e875=Cartesian3$1['multiplyByScalar'](_0x224b10,Cartesian3$1['dot'](_0x3f3e87,_0x224b10),scratchBackwardProjection);Cartesian3$1[_0x503e53(0xd97)](_0x3f3e87,_0x10e875,_0x10e875),Cartesian3$1['normalize'](_0x10e875,_0x10e875);const _0x5197f0=!CesiumMath$1['equalsEpsilon'](Math['abs'](Cartesian3$1[_0x503e53(_0xd6db8b._0x52e187)](_0x249098,_0x10e875)),0x1,CesiumMath$1['EPSILON7']);if(_0x5197f0){_0x5d4e13=Cartesian3$1['cross'](_0x5d4e13,_0x224b10,_0x5d4e13),_0x5d4e13=Cartesian3$1['cross'](_0x224b10,_0x5d4e13,_0x5d4e13),_0x5d4e13=Cartesian3$1['normalize'](_0x5d4e13,_0x5d4e13);const _0x221e09=_0x49555b/Math[_0x503e53(_0xd6db8b._0x5dbcf3)](0.25,Cartesian3$1[_0x503e53(0xc56)](Cartesian3$1[_0x503e53(0x24c)](_0x5d4e13,_0x3f3e87,scratch1))),_0x57ae26=PolylineVolumeGeometryLibrary['angleIsGreaterThanPi'](_0x13962b,_0x3f3e87,_0x52ae03,_0x3b17);_0x5d4e13=Cartesian3$1['multiplyByScalar'](_0x5d4e13,_0x221e09,_0x5d4e13),_0x57ae26?(_0x310995=Cartesian3$1['add'](_0x52ae03,_0x5d4e13,_0x310995),_0xc8f89d=Cartesian3$1['add'](_0x310995,Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b,_0xc8f89d),_0xc8f89d),_0x20ea0e=Cartesian3$1['add'](_0x310995,Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b*0x2,_0x20ea0e),_0x20ea0e),scaleArray2[0x0]=Cartesian3$1['clone'](_0x336204,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1[_0x503e53(0x315)](_0xc8f89d,scaleArray2[0x1]),_0x442f4a=cartesian3ToArray(scaleArray2),_0x53e2f2=addShiftedPositions(_0x442f4a,_0x16570f,_0x49555b,_0x53e2f2),_0x14e79a=Cartesian3$1['clone'](_0x20ea0e,_0x14e79a),_0x16570f=Cartesian3$1[_0x503e53(0xf69)](Cartesian3$1['cross'](_0x224b10,_0x13962b,_0x16570f),_0x16570f),_0x20ea0e=Cartesian3$1[_0x503e53(_0xd6db8b._0x3dd16b)](_0x310995,Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b*0x2,_0x20ea0e),_0x20ea0e),_0x336204=Cartesian3$1['add'](_0x310995,Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b,_0x336204),_0x336204),_0x2957ef['push']({'leftPositions':computeRoundCorner(_0x310995,_0x14e79a,_0x20ea0e,_0x57ae26)})):(_0x20ea0e=Cartesian3$1['add'](_0x52ae03,_0x5d4e13,_0x20ea0e),_0xc8f89d=Cartesian3$1['add'](_0x20ea0e,Cartesian3$1['negate'](Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b,_0xc8f89d),_0xc8f89d),_0xc8f89d),_0x310995=Cartesian3$1['add'](_0x20ea0e,Cartesian3$1[_0x503e53(_0xd6db8b._0xe8efac)](Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b*0x2,_0x310995),_0x310995),_0x310995),scaleArray2[0x0]=Cartesian3$1['clone'](_0x336204,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1['clone'](_0xc8f89d,scaleArray2[0x1]),_0x442f4a=cartesian3ToArray(scaleArray2),_0x53e2f2=addShiftedPositions(_0x442f4a,_0x16570f,_0x49555b,_0x53e2f2),_0x14e79a=Cartesian3$1['clone'](_0x310995,_0x14e79a),_0x16570f=Cartesian3$1['normalize'](Cartesian3$1[_0x503e53(_0xd6db8b._0x206546)](_0x224b10,_0x13962b,_0x16570f),_0x16570f),_0x310995=Cartesian3$1[_0x503e53(0xff3)](_0x20ea0e,Cartesian3$1['negate'](Cartesian3$1[_0x503e53(_0xd6db8b._0x3fa9f3)](_0x16570f,_0x49555b*0x2,_0x310995),_0x310995),_0x310995),_0x336204=Cartesian3$1[_0x503e53(0xff3)](_0x20ea0e,Cartesian3$1['negate'](Cartesian3$1['multiplyByScalar'](_0x16570f,_0x49555b,_0x336204),_0x336204),_0x336204),_0x2957ef['push']({'rightPositions':computeRoundCorner(_0x20ea0e,_0x14e79a,_0x310995,_0x57ae26)})),_0x3f3e87=Cartesian3$1['negate'](_0x13962b,_0x3f3e87);}_0x52ae03=_0x4fafe1;}return _0x224b10=_0x3b17['geodeticSurfaceNormal'](_0x52ae03,_0x224b10),scaleArray2[0x0]=Cartesian3$1['clone'](_0x336204,scaleArray2[0x0]),scaleArray2[0x1]=Cartesian3$1['clone'](_0x52ae03,scaleArray2[0x1]),_0x442f4a=cartesian3ToArray(scaleArray2),_0x53e2f2=addShiftedPositions(_0x442f4a,_0x16570f,_0x49555b,_0x53e2f2),{'positions':_0x53e2f2,'corners':_0x2957ef};};const BoundingSphere=Cesium__namespace['BoundingSphere'],Cartesian3=Cesium__namespace[_0x3d5d32(0xe95)],Cartographic=Cesium__namespace['Cartographic'],Check=Cesium__namespace['Check'],ComponentDatatype=Cesium__namespace['ComponentDatatype'],defaultValue=Cesium__namespace[_0x3d5d32(0x501)],defined=Cesium__namespace['defined'],Ellipsoid=Cesium__namespace['Ellipsoid'],Geometry=Cesium__namespace[_0x3d5d32(0xcc4)],GeometryAttribute=Cesium__namespace['GeometryAttribute'],GeometryAttributes=Cesium__namespace[_0x3d5d32(0x321)],IndexDatatype=Cesium__namespace['IndexDatatype'],CesiumMath=Cesium__namespace['Math'],PrimitiveType=Cesium__namespace['PrimitiveType'],VertexFormat=Cesium__namespace['VertexFormat'],CornerType=Cesium__namespace[_0x3d5d32(0xa06)],cartesian10=new Cartesian3(),cartesian20=new Cartesian3(),cartesian30=new Cartesian3();function combine(_0xe765e7,_0x2b3db4){const _0x5dd05a={_0x21a09b:0xc84,_0x53a182:0x631,_0x5ee599:0x1fa,_0x1216d0:0xd97,_0x36bd54:0x436},_0x1448c1=_0x3d5d32,_0x427257=_0xe765e7['positions'],_0x1edb6f=_0xe765e7['corners'],_0x5510f8=new GeometryAttributes();let _0x5f0f2b,_0x1ab87e=0x0,_0x18ac1d=0x0,_0x44ea3c,_0x1af62a=0x0,_0x1fd92b;for(_0x44ea3c=0x0;_0x44ea3c<_0x427257['length'];_0x44ea3c+=0x2){_0x1fd92b=_0x427257[_0x44ea3c][_0x1448c1(0xc84)]-0x3,_0x1ab87e+=_0x1fd92b,_0x1af62a+=_0x1fd92b*0x2,_0x18ac1d+=_0x427257[_0x44ea3c+0x1]['length']-0x3;}_0x1ab87e+=0x3,_0x18ac1d+=0x3;for(_0x44ea3c=0x0;_0x44ea3c<_0x1edb6f['length'];_0x44ea3c++){_0x5f0f2b=_0x1edb6f[_0x44ea3c];const _0x358d90=_0x1edb6f[_0x44ea3c]['leftPositions'];defined(_0x358d90)?(_0x1fd92b=_0x358d90[_0x1448c1(_0x5dd05a._0x21a09b)],_0x1ab87e+=_0x1fd92b,_0x1af62a+=_0x1fd92b):(_0x1fd92b=_0x1edb6f[_0x44ea3c]['rightPositions'][_0x1448c1(_0x5dd05a._0x21a09b)],_0x18ac1d+=_0x1fd92b,_0x1af62a+=_0x1fd92b);}const _0x52dc4d=_0x1ab87e+_0x18ac1d,_0x253a95=new Float64Array(_0x52dc4d);let _0x55e3cb=0x0,_0x225236=_0x52dc4d-0x1,_0x3ef4bc,_0x118a32,_0x5b79c8,_0x38df0b;const _0x2cc632=IndexDatatype['createTypedArray'](_0x52dc4d/0x3,_0x1af62a);let _0x50d983=0x0,_0x196ea3=0x0,_0x347e1d=_0x427257[_0x196ea3++],_0x1fd9ac=_0x427257[_0x196ea3++];_0x253a95[_0x1448c1(_0x5dd05a._0x53a182)](_0x347e1d,_0x55e3cb),_0x253a95['set'](_0x1fd9ac,_0x225236-_0x1fd9ac['length']+0x1),_0x1fd92b=_0x1fd9ac[_0x1448c1(_0x5dd05a._0x21a09b)]-0x3;for(_0x44ea3c=0x0;_0x44ea3c<_0x1fd92b;_0x44ea3c+=0x3){_0x118a32=_0x55e3cb/0x3,_0x38df0b=_0x118a32+0x1,_0x3ef4bc=(_0x225236-0x2)/0x3,_0x5b79c8=_0x3ef4bc-0x1,_0x2cc632[_0x50d983++]=_0x3ef4bc,_0x2cc632[_0x50d983++]=_0x118a32,_0x2cc632[_0x50d983++]=_0x5b79c8,_0x2cc632[_0x50d983++]=_0x5b79c8,_0x2cc632[_0x50d983++]=_0x118a32,_0x2cc632[_0x50d983++]=_0x38df0b,_0x55e3cb+=0x3,_0x225236-=0x3;}for(_0x44ea3c=0x0;_0x44ea3c<_0x1edb6f['length'];_0x44ea3c++){let _0x16e166;_0x5f0f2b=_0x1edb6f[_0x44ea3c];const _0x43c603=_0x5f0f2b[_0x1448c1(0x219)],_0x112bcb=_0x5f0f2b['rightPositions'];let _0x1a8409,_0x169f4a,_0x3f243c=cartesian30,_0x4f1bf0=cartesian10,_0x2442f9=cartesian20;if(defined(_0x43c603)){_0x225236-=0x3,_0x1a8409=_0x38df0b,_0x169f4a=_0x5b79c8;for(_0x16e166=0x0;_0x16e166<_0x43c603['length']/0x3;_0x16e166++){_0x3f243c=Cartesian3['fromArray'](_0x43c603,_0x16e166*0x3,_0x3f243c),_0x2cc632[_0x50d983++]=_0x1a8409,_0x2cc632[_0x50d983++]=_0x169f4a-_0x16e166-0x1,_0x2cc632[_0x50d983++]=_0x169f4a-_0x16e166,ThickWallGeometryLibrary[_0x1448c1(0x747)](_0x253a95,_0x3f243c,undefined,_0x225236),_0x4f1bf0=Cartesian3['fromArray'](_0x253a95,(_0x169f4a-_0x16e166-0x1)*0x3,_0x4f1bf0),_0x2442f9=Cartesian3['fromArray'](_0x253a95,_0x1a8409*0x3,_0x2442f9),_0x225236-=0x3;}_0x3f243c=Cartesian3['fromArray'](_0x253a95,_0x1a8409*0x3,_0x3f243c),_0x4f1bf0=Cartesian3['subtract'](Cartesian3[_0x1448c1(_0x5dd05a._0x5ee599)](_0x253a95,_0x169f4a*0x3,_0x4f1bf0),_0x3f243c,_0x4f1bf0),_0x2442f9=Cartesian3['subtract'](Cartesian3['fromArray'](_0x253a95,(_0x169f4a-_0x16e166)*0x3,_0x2442f9),_0x3f243c,_0x2442f9),_0x55e3cb+=0x3;}else{_0x55e3cb+=0x3,_0x1a8409=_0x5b79c8,_0x169f4a=_0x38df0b;for(_0x16e166=0x0;_0x16e166<_0x112bcb[_0x1448c1(0xc84)]/0x3;_0x16e166++){_0x3f243c=Cartesian3[_0x1448c1(0x1fa)](_0x112bcb,_0x16e166*0x3,_0x3f243c),_0x2cc632[_0x50d983++]=_0x1a8409,_0x2cc632[_0x50d983++]=_0x169f4a+_0x16e166,_0x2cc632[_0x50d983++]=_0x169f4a+_0x16e166+0x1,ThickWallGeometryLibrary['addAttribute'](_0x253a95,_0x3f243c,_0x55e3cb),_0x4f1bf0=Cartesian3[_0x1448c1(0x1fa)](_0x253a95,_0x1a8409*0x3,_0x4f1bf0),_0x2442f9=Cartesian3['fromArray'](_0x253a95,(_0x169f4a+_0x16e166)*0x3,_0x2442f9),_0x55e3cb+=0x3;}_0x3f243c=Cartesian3[_0x1448c1(0x1fa)](_0x253a95,_0x1a8409*0x3,_0x3f243c),_0x4f1bf0=Cartesian3[_0x1448c1(_0x5dd05a._0x1216d0)](Cartesian3['fromArray'](_0x253a95,(_0x169f4a+_0x16e166)*0x3,_0x4f1bf0),_0x3f243c,_0x4f1bf0),_0x2442f9=Cartesian3[_0x1448c1(_0x5dd05a._0x1216d0)](Cartesian3['fromArray'](_0x253a95,_0x169f4a*0x3,_0x2442f9),_0x3f243c,_0x2442f9),_0x225236-=0x3;}_0x347e1d=_0x427257[_0x196ea3++],_0x1fd9ac=_0x427257[_0x196ea3++],_0x347e1d['splice'](0x0,0x3),_0x1fd9ac['splice'](_0x1fd9ac['length']-0x3,0x3),_0x253a95['set'](_0x347e1d,_0x55e3cb),_0x253a95[_0x1448c1(_0x5dd05a._0x53a182)](_0x1fd9ac,_0x225236-_0x1fd9ac['length']+0x1),_0x1fd92b=_0x1fd9ac['length']-0x3;for(_0x16e166=0x0;_0x16e166<_0x1fd9ac['length'];_0x16e166+=0x3){_0x38df0b=_0x55e3cb/0x3,_0x118a32=_0x38df0b-0x1,_0x5b79c8=(_0x225236-0x2)/0x3,_0x3ef4bc=_0x5b79c8+0x1,_0x2cc632[_0x50d983++]=_0x3ef4bc,_0x2cc632[_0x50d983++]=_0x118a32,_0x2cc632[_0x50d983++]=_0x5b79c8,_0x2cc632[_0x50d983++]=_0x5b79c8,_0x2cc632[_0x50d983++]=_0x118a32,_0x2cc632[_0x50d983++]=_0x38df0b,_0x55e3cb+=0x3,_0x225236-=0x3;}_0x55e3cb-=0x3,_0x225236+=0x3;}_0x5510f8[_0x1448c1(0xb69)]=new GeometryAttribute({'componentDatatype':ComponentDatatype[_0x1448c1(_0x5dd05a._0x36bd54)],'componentsPerAttribute':0x3,'values':_0x253a95});if(_0x2b3db4['st']){const _0x461b94=new Float32Array(_0x52dc4d/0x3*0x2);let _0x358e63=0x0;_0x1ab87e/=0x3,_0x18ac1d/=0x3;const _0x6e4fc9=0x1/(_0x1ab87e-0x1),_0x4676fd=0x1/(_0x18ac1d-0x1);for(_0x44ea3c=0x0;_0x44ea3c<_0x18ac1d;_0x44ea3c++){_0x461b94[_0x358e63++]=_0x44ea3c*_0x4676fd,_0x461b94[_0x358e63++]=0x0;}for(_0x44ea3c=_0x1ab87e;_0x44ea3c>0x0;_0x44ea3c--){_0x461b94[_0x358e63++]=(_0x44ea3c-0x1)*_0x6e4fc9,_0x461b94[_0x358e63++]=0x1;}_0x5510f8['st']=new GeometryAttribute({'componentDatatype':ComponentDatatype['FLOAT'],'componentsPerAttribute':0x2,'values':_0x461b94});}return{'attributes':_0x5510f8,'indices':_0x2cc632};}function ThickWallGeometry(_0xd0728a){const _0x55d052={_0x32f211:0xa72,_0x47c848:0xcca},_0x4a3549=_0x3d5d32;_0xd0728a=defaultValue(_0xd0728a,defaultValue['EMPTY_OBJECT']);const _0xc83492=_0xd0728a['positions'],_0x47c31e=_0xd0728a['width'];Check['defined'](_0x4a3549(0x602),_0xc83492),Check['defined']('options.width',_0x47c31e),this['_positions']=_0xc83492,this[_0x4a3549(0x58a)]=Ellipsoid['clone'](defaultValue(_0xd0728a['ellipsoid'],Ellipsoid['WGS84'])),this['_vertexFormat']=VertexFormat['clone'](defaultValue(_0xd0728a[_0x4a3549(_0x55d052._0x32f211)],VertexFormat['POSITION_AND_ST'])),this['_width']=_0x47c31e,this['_granularity']=defaultValue(_0xd0728a[_0x4a3549(0x9f7)],CesiumMath[_0x4a3549(_0x55d052._0x47c848)]);}ThickWallGeometry['createGeometry']=function(_0x49a3c5){const _0x4000f2={_0x25c1dc:0x7e1,_0x41c58c:0x3a7,_0x226615:0xe95,_0x359b42:0xbfd,_0x280104:0x406,_0x58355e:0x7d1},_0x2f9ee8={_0x444485:0x8e5,_0x21aaf9:0x7d1},_0xcbea8c=_0x3d5d32,_0x429d64=_0x49a3c5['_positions'],_0x5f0cf8=_0x49a3c5['_width'],_0x267e86=_0x49a3c5['_ellipsoid'],_0x418bab=_0x429d64['map'](_0x59f4ad=>Cartographic['fromCartesian'](_0x59f4ad)),_0x5e13c2=_0x429d64[_0xcbea8c(_0x4000f2._0x25c1dc)](_0x4b6de3=>_0x267e86['scaleToGeodeticSurface'](_0x4b6de3)),_0x307f0b=_0x49a3c5['_vertexFormat'],_0xb9553={'ellipsoid':_0x267e86,'positions':_0x5e13c2,'width':_0x5f0cf8,'cornerType':CornerType['BEVELED'],'granularity':_0x49a3c5[_0xcbea8c(_0x4000f2._0x41c58c)],'saveAttributes':![]},_0x195d30=ThickWallGeometryLibrary['computePositions'](_0xb9553),_0x4405f8=[];let _0x37239e=[];const _0x2d0172=_0x195d30['positions'],_0xe135d5=_0x2d0172['length']/0x2;for(let _0x364e44=0x0;_0x364e44<_0xe135d5;_0x364e44++){const _0x371c77=_0x418bab[_0x364e44],_0x12c712=_0x418bab[_0x364e44+0x1],_0x2cfdab=_0x2d0172[_0x364e44*0x2],_0x30f58c=_0x2d0172[_0x364e44*0x2+0x1],_0x2b713c=_0x2cfdab['length']/0x3,_0x713fa8=_0x30f58c['length']/0x3;for(let _0x20ca7e=0x0;_0x20ca7e<_0x2b713c;_0x20ca7e++){const _0x1a1366=new Cesium__namespace[(_0xcbea8c(_0x4000f2._0x226615))](_0x2cfdab[_0x20ca7e*0x3],_0x2cfdab[_0x20ca7e*0x3+0x1],_0x2cfdab[_0x20ca7e*0x3+0x2]),_0x1ac58f=Cartographic['fromCartesian'](_0x1a1366);let _0x3e66b4;_0x20ca7e===0x0?_0x3e66b4=Cartesian3['fromRadians'](_0x1ac58f[_0xcbea8c(_0x4000f2._0x359b42)],_0x1ac58f['latitude'],_0x371c77['height']):_0x3e66b4=Cartesian3['fromRadians'](_0x1ac58f[_0xcbea8c(0xbfd)],_0x1ac58f[_0xcbea8c(_0x4000f2._0x280104)],_0x12c712['height']),_0x4405f8['push'](_0x3e66b4),_0x2cfdab[_0x20ca7e*0x3]=_0x3e66b4['x'],_0x2cfdab[_0x20ca7e*0x3+0x1]=_0x3e66b4['y'],_0x2cfdab[_0x20ca7e*0x3+0x2]=_0x3e66b4['z'];}const _0xfcf22c=[];for(let _0x45df88=0x0;_0x45df88<_0x713fa8;_0x45df88++){const _0x2f32b2=new Cesium__namespace['Cartesian3'](_0x30f58c[_0x45df88*0x3],_0x30f58c[_0x45df88*0x3+0x1],_0x30f58c[_0x45df88*0x3+0x2]),_0x3cc45d=Cartographic[_0xcbea8c(0xd14)](_0x2f32b2);let _0x58023a;_0x45df88===0x0?_0x58023a=Cartesian3[_0xcbea8c(_0x4000f2._0x58355e)](_0x3cc45d['longitude'],_0x3cc45d[_0xcbea8c(0x406)],_0x12c712['height']):_0x58023a=Cartesian3['fromRadians'](_0x3cc45d['longitude'],_0x3cc45d['latitude'],_0x371c77[_0xcbea8c(0x83e)]),_0xfcf22c['push'](_0x58023a),_0x30f58c[_0x45df88*0x3]=_0x58023a['x'],_0x30f58c[_0x45df88*0x3+0x1]=_0x58023a['y'],_0x30f58c[_0x45df88*0x3+0x2]=_0x58023a['z'];}_0x37239e[_0xcbea8c(0xb75)](..._0xfcf22c['reverse']());}_0x195d30['corners']['forEach']((_0x2405d2,_0x59c117)=>{const _0x4d56e1=_0xcbea8c;let _0x204294;defined(_0x2405d2[_0x4d56e1(_0x2f9ee8._0x444485)])?_0x204294=_0x2405d2[_0x4d56e1(0x8e5)]:_0x204294=_0x2405d2['leftPositions'];const _0x2027da=new Cesium__namespace['Cartesian3'](_0x204294[0x0],_0x204294[0x1],_0x204294[0x2]),_0xc94b69=Cartographic['fromCartesian'](_0x2027da),_0x355ad5=_0x429d64[_0x59c117+0x1],_0x1b72e2=Cartographic['fromCartesian'](_0x355ad5),_0x3e665a=Cartesian3[_0x4d56e1(_0x2f9ee8._0x21aaf9)](_0xc94b69['longitude'],_0xc94b69[_0x4d56e1(0x406)],_0x1b72e2['height']);_0x204294[0x0]=_0x3e665a['x'],_0x204294[0x1]=_0x3e665a['y'],_0x204294[0x2]=_0x3e665a['z'];});const _0x5c056c=combine(_0x195d30,_0x307f0b),_0x5c3f28=_0x5c056c['attributes'],_0x183e9d=BoundingSphere['fromVertices'](_0x5c3f28['position']['values'],undefined,0x3);return _0x37239e=Cesium__namespace['arrayRemoveDuplicates'](_0x37239e,Cartesian3['equalsEpsilon']),{'geometry':new Geometry({'attributes':_0x5c3f28,'indices':_0x5c056c[_0xcbea8c(0xea0)],'primitiveType':PrimitiveType['TRIANGLES'],'boundingSphere':_0x183e9d}),'rightPoints':_0x37239e,'leftPoints':_0x4405f8};};const DEF_STYLE$d={'diffHeight':0x64,'bottomHeight':0x0,'width':0xa,'flat':!![]};class ThickWall extends BasePolyPrimitive{constructor(_0x24cb4a={}){_0x24cb4a['style']={...DEF_STYLE$d,..._0x24cb4a['style']||{}},super(_0x24cb4a);}get['czmObject'](){return this['_primitive'];}['_createGeometryInstance'](_0x51a34f,_0x256f85){const _0x5f1282={_0x12f308:0x1076,_0x4d2672:0x5a7,_0x5b91c6:0x104b,_0x243f75:0xa72,_0x11e3c9:0x5b6,_0x489045:0x293,_0x59209f:0xeaf,_0x808e85:0xa72},_0x243be6={_0x20a085:0xe95,_0x58e1a4:0xbfd},_0x1fbf48=_0x3d5d32,_0x15a787=[],_0x302a73=[],_0x41d3f0=[];this['positions']['forEach'](_0x141af7=>{const _0x491b2d=_0x4132,_0x548366=Cesium__namespace['Cartographic']['fromCartesian'](_0x141af7);_0x302a73[_0x491b2d(0xb75)](Cesium__namespace['Cartesian3']['fromRadians'](_0x548366['longitude'],_0x548366['latitude'],_0x548366['height']+_0x51a34f['diffHeight'])),_0x41d3f0['push'](Cesium__namespace[_0x491b2d(_0x243be6._0x20a085)]['fromRadians'](_0x548366[_0x491b2d(_0x243be6._0x58e1a4)],_0x548366['latitude'],_0x548366['height']-_0x51a34f[_0x491b2d(0x7fa)]));});_0x51a34f['closure']&&(_0x302a73['push'](_0x302a73[0x0]),_0x41d3f0['push'](_0x41d3f0[0x0]));const _0x3628f9=ThickWallGeometry['createGeometry'](new ThickWallGeometry({'positions':_0x302a73,'width':_0x51a34f['width']})),_0x183e6a=ThickWallGeometry['createGeometry'](new ThickWallGeometry({'positions':_0x41d3f0,'width':_0x51a34f[_0x1fbf48(_0x5f1282._0x12f308)]})),_0x55f084=new Cesium__namespace['GeometryInstance']({'geometry':_0x3628f9[_0x1fbf48(_0x5f1282._0x4d2672)]}),_0x4231ea=new Cesium__namespace['GeometryInstance']({'geometry':_0x183e6a['geometry']});_0x15a787['push'](_0x55f084),_0x15a787[_0x1fbf48(0xb75)](_0x4231ea);const _0x6b109b=[],_0x3791f4=[];_0x183e6a['leftPoints']['forEach'](_0x1493d6=>{const _0x486345=_0x1fbf48,_0x15dcdd=Cesium__namespace['Cartographic']['fromCartesian'](_0x1493d6);_0x6b109b['push'](_0x15dcdd[_0x486345(0x83e)]);}),_0x183e6a['rightPoints']['forEach'](_0x4045f3=>{const _0x5e0e40=Cesium__namespace['Cartographic']['fromCartesian'](_0x4045f3);_0x3791f4['push'](_0x5e0e40['height']);});const _0x554a10=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace[(_0x1fbf48(0xeaf))]({'positions':_0x3628f9['leftPoints'],'minimumHeights':_0x6b109b,'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport']['TEXTURED']['vertexFormat']})}),_0x1359c7=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['WallGeometry']({'positions':_0x3628f9['rightPoints'],'minimumHeights':_0x3791f4,'vertexFormat':Cesium__namespace['MaterialAppearance'][_0x1fbf48(_0x5f1282._0x5b91c6)]['TEXTURED'][_0x1fbf48(_0x5f1282._0x243f75)]})});_0x15a787['push'](_0x554a10),_0x15a787['push'](_0x1359c7);if(!_0x51a34f['closure']){const _0x1139a2=Cesium__namespace['Cartographic']['fromCartesian'](_0x183e6a['leftPoints'][0x0])['height'],_0x3a9139=new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace['WallGeometry']({'positions':[_0x3628f9[_0x1fbf48(_0x5f1282._0x11e3c9)][0x0],_0x3628f9[_0x1fbf48(_0x5f1282._0x489045)][0x0]],'minimumHeights':[_0x1139a2,_0x1139a2],'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport']['TEXTURED']['vertexFormat']})}),_0x2bde4d=Cesium__namespace['Cartographic']['fromCartesian'](_0x183e6a['leftPoints'][_0x183e6a['leftPoints']['length']-0x1])['height'],_0x1318ee=new Cesium__namespace[(_0x1fbf48(0x263))]({'geometry':new Cesium__namespace[(_0x1fbf48(_0x5f1282._0x59209f))]({'positions':[_0x3628f9['leftPoints'][_0x3628f9['leftPoints']['length']-0x1],_0x3628f9[_0x1fbf48(0x293)][_0x3628f9[_0x1fbf48(_0x5f1282._0x489045)]['length']-0x1]],'minimumHeights':[_0x2bde4d,_0x2bde4d],'vertexFormat':Cesium__namespace['MaterialAppearance']['MaterialSupport'][_0x1fbf48(0x681)][_0x1fbf48(_0x5f1282._0x808e85)]})});_0x15a787['push'](_0x3a9139),_0x15a787['push'](_0x1318ee);}return _0x15a787;}['_createAppearance'](_0x18c0b5,_0x22dad8,_0x1ad325){return new Cesium__namespace['MaterialAppearance']({..._0x18c0b5});}['_conversionStyle'](_0x1673e8){return WallStyleConver['toCesiumVal'](_0x1673e8);}[_0x3d5d32(0x53e)](_0x2ce228,_0x5d9974){return WallStyleConver['toJSON'](_0x2ce228,_0x5d9974);}[_0x3d5d32(0x107f)](_0x2bc20e){const _0x1305b2={_0x281c7e:0x9e2},_0x28065f=_0x3d5d32;this['_isCircle']&&Cesium__namespace['defined'](_0x2bc20e['radius'])&&(this[_0x28065f(0xd61)]=_0x2bc20e[_0x28065f(0xd61)]),Cesium__namespace[_0x28065f(0xb84)](_0x2bc20e['diffHeight'])&&(this['style'][_0x28065f(_0x1305b2._0x281c7e)]=_0x2bc20e[_0x28065f(_0x1305b2._0x281c7e)]);}['_getDrawEntityClass'](_0x65b997,_0x22a375){return create$4('wall',_0x65b997);}}register$4('thickWall',ThickWall);var DynamicRiverFS='in\x20vec3\x20v_positionMC;\x0ain\x20vec3\x20v_positionEC;\x0ain\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(czm_normal3D\x20*\x20czm_geodeticSurfaceNormal(v_positionMC,\x20vec3(0.0),\x20vec3(1.0)));\x0a\x20\x20\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20\x20\x20#endif\x0a\x0a\x20\x20materialInput.s\x20=\x20v_st.s;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x20\x20materialInput.str\x20=\x20vec3(v_st,\x200.0);\x0a\x0a\x20\x20\x20\x20//\x20Convert\x20tangent\x20space\x20material\x20normal\x20to\x20eye\x20space\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.tangentToEyeMatrix\x20=\x20czm_eastNorthUpToEyeCoordinates(v_positionMC,\x20materialInput.normalEC);\x0a\x0a\x20\x20\x20\x20//\x20Convert\x20view\x20vector\x20to\x20world\x20space\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20\x20\x20#endif\x0a}\x0a',DynamicRiverVS='in\x20vec3\x20position3DHigh;\x0ain\x20vec3\x20position3DLow;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0a\x0aout\x20vec3\x20v_positionMC;\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x0a\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20model\x20coordinates\x0a\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a}\x0a',DynamicRiverMaterial='uniform\x20float\x20globalAlpha;\x0auniform\x20float\x20opacity;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20if(move)\x20{\x0a\x20\x20\x20\x20float\x20r\x20=\x20sqrt((st.x\x20-\x200.8)\x20*\x20(st.x\x20-\x200.8)\x20+\x20(st.y\x20-\x200.8)\x20*\x20(st.y\x20-\x200.8));\x0a\x20\x20\x20\x20float\x20r2\x20=\x20sqrt((st.x\x20-\x200.2)\x20*\x20(st.x\x20-\x200.2)\x20+\x20(st.y\x20-\x200.2)\x20*\x20(st.y\x20-\x200.2));\x0a\x20\x20\x20\x20float\x20z\x20=\x20cos(moveVar.x\x20*\x20r\x20+\x20czm_frameNumber\x20/\x20100.0\x20*\x20moveVar.y)\x20/\x20moveVar.z;\x0a\x20\x20\x20\x20float\x20z2\x20=\x20cos(moveVar.x\x20*\x20r2\x20+\x20czm_frameNumber\x20/\x20100.0\x20*\x20moveVar.y)\x20/\x20moveVar.z;\x0a\x20\x20\x20\x20st\x20+=\x20sqrt(z\x20*\x20z\x20+\x20z2\x20*\x20z2);\x0a\x20\x20\x20\x20st.s\x20+=\x20direction\x20*\x20czm_frameNumber\x20/\x201000.0\x20*\x20speed;\x0a\x20\x20\x20\x20st.s\x20=\x20mod(st.s,\x201.0);\x0a\x20\x20}\x0a\x20\x20if(axisY)\x20{\x0a\x20\x20\x20\x20st\x20=\x20vec2(st.t,\x20st.s);\x0a\x20\x20}\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20material.alpha\x20=\x20opacity\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20return\x20material;\x0a}\x0a';const DEF_STYLE$c={'opacity':0.5,'width':0xa,'height':0x0,'speed':0xa,'axisY':![],'move':!![],'direction':!![],'moveVar':new Cesium__namespace['Cartesian3'](0x32,0x1,0x64)};class DynamicRiver extends BasePolyPrimitive{constructor(_0x14d027={}){_0x14d027['style']={...DEF_STYLE$c,..._0x14d027['style']||{}},super(_0x14d027);}get['czmObject'](){return this['_primitive'];}get['image'](){const _0x2cb0e3=_0x3d5d32;return this['style'][_0x2cb0e3(0x8e1)];}set[_0x3d5d32(0x8e1)](_0x10cda0){const _0x3c2d60={_0x35f537:0x2df,_0x294061:0x8e1},_0xa54ba9=_0x3d5d32;this['style'][_0xa54ba9(0x8e1)]=_0x10cda0,this[_0xa54ba9(_0x3c2d60._0x35f537)]['uniforms'][_0xa54ba9(_0x3c2d60._0x294061)]=_0x10cda0;}get['width'](){return this['style']['width'];}set[_0x3d5d32(0x1076)](_0x4ac1e2){_0x4ac1e2=Number(_0x4ac1e2)||0x1,this['style']['width']=_0x4ac1e2,this['redraw'](this['style']);}get['height'](){const _0x6a9d5e={_0x285a8a:0x83e},_0x377bbd=_0x3d5d32;return this['style'][_0x377bbd(_0x6a9d5e._0x285a8a)];}set['height'](_0x282e59){const _0x25d68b={_0xd7dd47:0xdde},_0x8cfa61=_0x3d5d32;this[_0x8cfa61(_0x25d68b._0xd7dd47)]['height']=_0x282e59,this['redraw'](this['style']);}get['opacity'](){return this['style']['opacity'];}set['opacity'](_0x3e3b59){const _0xe379b9={_0x64c5ee:0xfdc},_0x2d257a=_0x3d5d32;this['style'][_0x2d257a(0xfdc)]=Number(_0x3e3b59),this['_material']['uniforms'][_0x2d257a(_0xe379b9._0x64c5ee)]=_0x3e3b59;}get['direction'](){return this['style']['direction'];}set['direction'](_0x3dd87f){const _0x58d3da=_0x3d5d32;_0x3dd87f=Boolean(_0x3dd87f),this['style']['direction']=_0x3dd87f,this[_0x58d3da(0x2df)]['uniforms']['direction']=_0x3dd87f?-0x1:0x1;}get['speed'](){const _0x445927={_0x2c2892:0xdde},_0xe56591=_0x3d5d32;return this[_0xe56591(_0x445927._0x2c2892)]['speed'];}set['speed'](_0xfe31a7){_0xfe31a7=Number(_0xfe31a7)||0x1,this['style']['speed']=_0xfe31a7,this['_material']['uniforms']['speed']=_0xfe31a7;}get['move'](){const _0x325787={_0x290b17:0x63c},_0x13ff3b=_0x3d5d32;return this['style'][_0x13ff3b(_0x325787._0x290b17)];}set['move'](_0x39f513){_0x39f513=Boolean(_0x39f513),this['style']['move']=_0x39f513,this['_material']['uniforms']['move']=_0x39f513;}get['axisY'](){const _0x111238={_0x1eeff5:0xaf1},_0x4ac94b=_0x3d5d32;return this['style'][_0x4ac94b(_0x111238._0x1eeff5)];}set['axisY'](_0x3d8f2f){const _0x3d8153=_0x3d5d32;_0x3d8f2f=Boolean(_0x3d8f2f),this['style'][_0x3d8153(0xaf1)]=_0x3d8f2f,this['_material']['uniforms']['axisY']=_0x3d8f2f;}get[_0x3d5d32(0x7dd)](){const _0x4dd17d=_0x3d5d32;return this[_0x4dd17d(0xdde)][_0x4dd17d(0x7dd)];}set[_0x3d5d32(0x7dd)](_0x2565b9){const _0x143a88={_0x505f4d:0xfe3},_0x2e70de=_0x3d5d32;this['style']['moveVar']=_0x2565b9,this['_material'][_0x2e70de(_0x143a88._0x505f4d)]['moveVar']=_0x2565b9;}['_addedHook'](_0x369614){const _0x53817d={_0x2b2bfa:0x792,_0x43b984:0x5af,_0x1a1c4c:0xff3},_0x551b0f=_0x3d5d32;if(!this[_0x551b0f(_0x53817d._0x2b2bfa)]||!this[_0x551b0f(0xbb8)]||this['positions']['length']===0x0)return;this[_0x551b0f(0xdd4)]=Lines2Plane(this['positions'],this['width'],this[_0x551b0f(0x83e)]);if(!this['_sideRes'])return;this['_primitive']=this[_0x551b0f(_0x53817d._0x43b984)](),this['primitiveCollection'][_0x551b0f(_0x53817d._0x1a1c4c)](this['_primitive']);}[_0x3d5d32(0x566)](){const _0x42e440={_0x284fa9:0xebb,_0x18a160:0xf06},_0x8c7c84=_0x3d5d32;this['dhEvent']&&(this['_map']['off'](EventType['clockTick'],this[_0x8c7c84(_0x42e440._0x284fa9)],this),delete this[_0x8c7c84(0xebb)]),this['_primitive']&&(this['primitiveCollection'][_0x8c7c84(_0x42e440._0x18a160)](this['_primitive']),delete this['_primitive']),this['_material']&&(this[_0x8c7c84(0x2df)]['destroy'](),delete this['_material']);}[_0x3d5d32(0x7b3)](_0x44076f,_0x10acbc){const _0x5dc77f={_0x2ec513:0xaf1},_0x5d978a=_0x3d5d32;let _0x4a950b=![];for(const _0x383b70 in _0x10acbc){switch(_0x383b70){case'image':case'opacity':case _0x5d978a(0x7dd):case'direction':case'speed':case _0x5d978a(_0x5dc77f._0x2ec513):case'globalAlpha':this['_material'][_0x5d978a(0xfe3)][_0x383b70]=_0x10acbc[_0x383b70];break;default:_0x4a950b=!![];break;}}_0x4a950b&&this['redraw'](_0x44076f);}['createPrimitive'](){const _0x1cb605={_0x2be74d:0xdd4,_0x478200:0x3ac,_0x198a96:0x2df},_0x19a638=_0x3d5d32,_0x444b7f=this[_0x19a638(_0x1cb605._0x2be74d)],_0x21c2e5=new Float64Array(_0x444b7f[_0x19a638(0x7d4)]),_0x3e4118=new Cesium__namespace['GeometryAttributes']();_0x3e4118['position']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x19a638(_0x1cb605._0x478200)]['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x21c2e5}),_0x3e4118['st']=new Cesium__namespace[(_0x19a638(0xf0e))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x444b7f['uvs']});const _0x7ef831=new Cesium__namespace['Geometry']({'attributes':_0x3e4118,'indices':_0x444b7f['indexs'],'primitiveType':Cesium__namespace['PrimitiveType'][_0x19a638(0x5b0)],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x21c2e5)}),_0x24b2b9=new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':_0x7ef831}),_0x586866=new Cesium__namespace['RenderState']();_0x586866[_0x19a638(0x6bb)]['enabled']=!![],this[_0x19a638(_0x1cb605._0x198a96)]=createMaterial(MaterialType,{'image':this['image'],'opacity':this['opacity'],'moveVar':this['moveVar'],'direction':this['direction']?-0x1:0x1,'speed':this['speed'],'move':this['move'],'axisY':this[_0x19a638(0xaf1)],'globalAlpha':0x1});const _0x55b8a1=new Cesium__namespace['Primitive']({'geometryInstances':_0x24b2b9,'appearance':new Cesium__namespace['Appearance']({'material':this[_0x19a638(0x2df)],'renderState':_0x586866,'vertexShaderSource':DynamicRiverVS,'fragmentShaderSource':DynamicRiverFS})});return _0x55b8a1;}['offsetHeight'](_0x2572a0,_0xbf4878){const _0x901973={_0x1000ad:0xe95,_0x1e6d9f:0x6df},_0x1e95d2={_0x3f7e84:0x4ba,_0x2ac79c:0x517,_0x2e63ab:0xd93},_0x5b29b8=_0x3d5d32;if(!_0x2572a0||!_0xbf4878||!this['_primitive'])return;let _0x15a04b=0x0;const _0x713e01=0x14,_0x55cec9=_0x2572a0/(_0xbf4878*_0x713e01),_0x325a80=this['_sideRes']['self'],_0x290410=new Cesium__namespace[(_0x5b29b8(_0x901973._0x1000ad))]();for(let _0x5dbdbd=0x0,_0x4ca1bf=_0x325a80['length'];_0x5dbdbd<_0x4ca1bf;_0x5dbdbd++){const _0x2fa638=Cesium__namespace[_0x5b29b8(0xe95)][_0x5b29b8(0xf69)](_0x325a80[_0x5dbdbd],new Cesium__namespace[(_0x5b29b8(0xe95))]());Cesium__namespace[_0x5b29b8(0xe95)]['add'](_0x290410,_0x2fa638,_0x290410);}Cesium__namespace['Cartesian3']['normalize'](_0x290410,_0x290410);const _0x242ac9=Cesium__namespace[_0x5b29b8(0x315)](this['_primitive']['modelMatrix']);this['dhEvent']=function(){const _0x39d739=_0x5b29b8;if(!this['_primitive']||!this['_map'])return;if(Math['abs'](_0x15a04b)<=Math[_0x39d739(_0x1e95d2._0x3f7e84)](_0x2572a0)){const _0x67546b=Cesium__namespace[_0x39d739(0xe95)]['multiplyByScalar'](_0x290410,_0x15a04b,new Cesium__namespace[(_0x39d739(0xe95))]());this[_0x39d739(_0x1e95d2._0x2ac79c)][_0x39d739(_0x1e95d2._0x2e63ab)]=Cesium__namespace['Matrix4']['multiplyByTranslation'](_0x242ac9,_0x67546b,new Cesium__namespace['Matrix4']());}else this['dhEvent']&&(this[_0x39d739(0x1d1)][_0x39d739(0x9e7)](EventType['clockTick'],this['dhEvent'],this),delete this['dhEvent']);_0x15a04b+=_0x55cec9;},this[_0x5b29b8(0x1d1)]['on'](EventType[_0x5b29b8(_0x901973._0x1e6d9f)],this['dhEvent'],this);}[_0x3d5d32(0xb2d)](_0xd7c914){const _0x21d6ea={_0x493be0:0xc96},_0x54659a=_0x3d5d32;this['style'][_0x54659a(_0x21d6ea._0x493be0)]=_0xd7c914,this[_0x54659a(0x2df)]&&(this[_0x54659a(0x2df)]['uniforms']['globalAlpha']=_0xd7c914);}['_getDrawEntityClass'](_0x3d3c61,_0x32e9d2){const _0x49e157=_0x3d5d32;return _0x3d3c61['style']['width']=0x5,create$4(_0x49e157(0x96e),_0x3d3c61);}}register$4(_0x3d5d32(0x1e1),DynamicRiver);const MaterialType='DynamicRiver';register$3(MaterialType,{'fabric':{'uniforms':{'image':Cesium__namespace[_0x3d5d32(0xc6b)][_0x3d5d32(0x237)],'opacity':0x1,'moveVar':new Cesium__namespace['Cartesian3'](0x32,0x1,0x64),'direction':0x1,'speed':0x1,'move':!![],'axisY':![],'globalAlpha':0x1},'source':DynamicRiverMaterial},'translucent':!![]});function Lines2Plane(_0x304a7c,_0x1de92c,_0x11ef4e){const _0x5c3b31={_0x1d6b58:0xc84,_0x1d7f2c:0xfb5,_0x21e584:0xb75,_0x1466fd:0xd14,_0x1cc550:0xb75,_0x4141df:0xb75,_0x190fb0:0xb75,_0xb09186:0x563,_0x1eb475:0xb75,_0x24fc26:0x8a8,_0x5e2f10:0x8a8,_0x56cc01:0x8a8,_0x175738:0x8a8,_0x225c97:0x8a8},_0x2ad3da=_0x3d5d32;if(!_0x304a7c||_0x304a7c[_0x2ad3da(_0x5c3b31._0x1d6b58)]<=0x1||!_0x1de92c||_0x1de92c===0x0){logError$1('请确认参数符合规则:数组长度大于1,宽高不能为0!',_0x304a7c);return;}const _0x3d5e27=_0x304a7c['length'],_0x2c4e77=[],_0x545150=[],_0x5b525f=_0x1de92c/0x2;for(let _0x59dfcd=0x0;_0x59dfcd<_0x3d5e27;_0x59dfcd++){let _0x57b9d2,_0x44b1b6,_0x9d47e,_0x101d6c,_0x46ff98;if(_0x59dfcd===0x0)_0x57b9d2=_0x304a7c[_0x59dfcd],_0x44b1b6=_0x304a7c[_0x59dfcd],_0x9d47e=_0x304a7c[_0x59dfcd+0x1];else _0x59dfcd===_0x3d5e27-0x1?(_0x57b9d2=_0x304a7c[_0x59dfcd-0x1],_0x44b1b6=_0x304a7c[_0x59dfcd],_0x9d47e=_0x304a7c[_0x59dfcd-0x1]):(_0x57b9d2=_0x304a7c[_0x59dfcd-0x1],_0x44b1b6=_0x304a7c[_0x59dfcd],_0x9d47e=_0x304a7c[_0x59dfcd+0x1]);_0x11ef4e!==0x0&&(_0x57b9d2=RaisePoint(_0x57b9d2,_0x11ef4e),_0x44b1b6=RaisePoint(_0x44b1b6,_0x11ef4e),_0x9d47e=RaisePoint(_0x9d47e,_0x11ef4e));if(_0x57b9d2&&_0x44b1b6&&_0x9d47e){const _0x18a913=GetSide2(_0x57b9d2,_0x44b1b6,_0x9d47e,_0x5b525f);_0x101d6c=_0x18a913[_0x2ad3da(_0x5c3b31._0x1d7f2c)],_0x46ff98=_0x18a913['right'],_0x2c4e77[_0x2ad3da(_0x5c3b31._0x21e584)](_0x46ff98),_0x545150['push'](_0x101d6c);}}const _0x1c10ea=_0x2c4e77,_0x529b9f=_0x545150,_0x54f568=[],_0x1765da=[],_0x72dae0=[],_0x49bc84=[],_0xd36f57=[];for(let _0x5a1a07=0x0;_0x5a1a07<_0x3d5e27;_0x5a1a07++){const _0x188317=Cesium__namespace[_0x2ad3da(0x519)][_0x2ad3da(_0x5c3b31._0x1466fd)](_0x529b9f[_0x5a1a07]);_0x1765da['push'](_0x529b9f[_0x5a1a07]['x']),_0x1765da['push'](_0x529b9f[_0x5a1a07]['y']),_0x1765da['push'](_0x529b9f[_0x5a1a07]['z']),_0x72dae0[_0x2ad3da(_0x5c3b31._0x1cc550)](_0x188317['high']['x']),_0x72dae0['push'](_0x188317['high']['y']),_0x72dae0['push'](_0x188317['high']['z']),_0x49bc84['push'](_0x188317['low']['x']),_0x49bc84['push'](_0x188317['low']['y']),_0x49bc84['push'](_0x188317['low']['z']),_0x54f568['push'](0x1,0x1),_0x5a1a07<_0x3d5e27-0x1&&(_0xd36f57['push'](_0x5a1a07+_0x3d5e27*0x2),_0xd36f57['push'](_0x5a1a07+0x1),_0xd36f57[_0x2ad3da(0xb75)](_0x5a1a07+0x1+_0x3d5e27),_0xd36f57[_0x2ad3da(_0x5c3b31._0x1cc550)](_0x5a1a07+_0x3d5e27*0x2),_0xd36f57['push'](_0x5a1a07+0x1+_0x3d5e27),_0xd36f57['push'](_0x3d5e27+_0x5a1a07+_0x3d5e27*0x2));}for(let _0x1b7fd3=0x0;_0x1b7fd3<_0x3d5e27;_0x1b7fd3++){const _0x2e9567=Cesium__namespace[_0x2ad3da(0x519)]['fromCartesian'](_0x1c10ea[_0x1b7fd3]);_0x1765da[_0x2ad3da(0xb75)](_0x1c10ea[_0x1b7fd3]['x']),_0x1765da[_0x2ad3da(_0x5c3b31._0x4141df)](_0x1c10ea[_0x1b7fd3]['y']),_0x1765da[_0x2ad3da(_0x5c3b31._0x4141df)](_0x1c10ea[_0x1b7fd3]['z']),_0x72dae0[_0x2ad3da(_0x5c3b31._0x1cc550)](_0x2e9567['high']['x']),_0x72dae0[_0x2ad3da(_0x5c3b31._0x190fb0)](_0x2e9567['high']['y']),_0x72dae0['push'](_0x2e9567[_0x2ad3da(_0x5c3b31._0xb09186)]['z']),_0x49bc84['push'](_0x2e9567[_0x2ad3da(0x8a8)]['x']),_0x49bc84[_0x2ad3da(_0x5c3b31._0x1eb475)](_0x2e9567[_0x2ad3da(_0x5c3b31._0x24fc26)]['y']),_0x49bc84['push'](_0x2e9567['low']['z']),_0x54f568['push'](0x1,0x0);}for(let _0x43e42a=0x0;_0x43e42a<_0x3d5e27;_0x43e42a++){const _0x32b307=Cesium__namespace['EncodedCartesian3']['fromCartesian'](_0x529b9f[_0x43e42a]);_0x1765da['push'](_0x529b9f[_0x43e42a]['x']),_0x1765da['push'](_0x529b9f[_0x43e42a]['y']),_0x1765da['push'](_0x529b9f[_0x43e42a]['z']),_0x72dae0['push'](_0x32b307['high']['x']),_0x72dae0['push'](_0x32b307['high']['y']),_0x72dae0['push'](_0x32b307['high']['z']),_0x49bc84['push'](_0x32b307[_0x2ad3da(_0x5c3b31._0x5e2f10)]['x']),_0x49bc84['push'](_0x32b307['low']['y']),_0x49bc84['push'](_0x32b307[_0x2ad3da(_0x5c3b31._0x56cc01)]['z']),_0x54f568['push'](0x0,0x1);}for(let _0x43b313=0x0;_0x43b313<_0x3d5e27;_0x43b313++){const _0x15c46e=Cesium__namespace['EncodedCartesian3']['fromCartesian'](_0x1c10ea[_0x43b313]);_0x1765da['push'](_0x1c10ea[_0x43b313]['x']),_0x1765da[_0x2ad3da(0xb75)](_0x1c10ea[_0x43b313]['y']),_0x1765da[_0x2ad3da(_0x5c3b31._0x190fb0)](_0x1c10ea[_0x43b313]['z']),_0x72dae0['push'](_0x15c46e['high']['x']),_0x72dae0['push'](_0x15c46e['high']['y']),_0x72dae0['push'](_0x15c46e['high']['z']),_0x49bc84['push'](_0x15c46e['low']['x']),_0x49bc84['push'](_0x15c46e[_0x2ad3da(_0x5c3b31._0x175738)]['y']),_0x49bc84['push'](_0x15c46e[_0x2ad3da(_0x5c3b31._0x225c97)]['z']),_0x54f568['push'](0x0,0x0);}return{'left':_0x1c10ea,'right':_0x529b9f,'self':_0x304a7c,'vertexs':new Float32Array(_0x1765da),'vertexsH':new Float32Array(_0x72dae0),'vertexsL':new Float32Array(_0x49bc84),'indexs':new Uint16Array(_0xd36f57),'uvs':new Float32Array(_0x54f568)};}function RaisePoint(_0x9de20c,_0x499266){const _0x284eb4={_0x373875:0xa0a},_0x49caaa=_0x3d5d32;if(!(_0x9de20c instanceof Cesium__namespace['Cartesian3'])){logError$1(_0x49caaa(0x6d4));return;}if(!_0x499266||_0x499266===0x0){logError$1('请确认高度是非零数值!');return;}const _0x344a22=Cesium__namespace['Cartesian3']['normalize'](_0x9de20c,new Cesium__namespace['Cartesian3']()),_0x1bc4ca=new Cesium__namespace['Ray'](_0x9de20c,_0x344a22);return Cesium__namespace[_0x49caaa(0xcbc)][_0x49caaa(_0x284eb4._0x373875)](_0x1bc4ca,_0x499266);}function GetSide2(_0xa4d0e8,_0x11ac29,_0x1ad848,_0x4d6e1b){const _0x5df135={_0x463e04:0xf69,_0x33f5a9:0xe95,_0x449371:0xcbc,_0x1340d0:0x71f,_0x305dda:0xd97,_0x2227ba:0xa0a,_0x10100c:0xe95,_0x5aa0eb:0xd97,_0x43ac94:0xe95,_0x3e5829:0xcbc,_0x23c940:0xc56,_0x54244e:0x103e,_0x1b6a8d:0xa1f},_0x43d0e0=_0x3d5d32;let _0x49da01,_0x3be0bb;if(Cesium__namespace['Cartesian3'][_0x43d0e0(0x71f)](_0xa4d0e8,_0x11ac29)){const _0x4c5461=Cesium__namespace['Cartesian3'][_0x43d0e0(_0x5df135._0x463e04)](Cesium__namespace['Cartesian3']['subtract'](_0x1ad848,_0x11ac29,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x1411cd=Cesium__namespace[_0x43d0e0(0xe95)]['normalize'](_0x11ac29,new Cesium__namespace['Cartesian3']()),_0x5c6204=Cesium__namespace['Cartesian3']['cross'](_0x1411cd,_0x4c5461,new Cesium__namespace[(_0x43d0e0(_0x5df135._0x33f5a9))]()),_0x5ce88d=Cesium__namespace[_0x43d0e0(_0x5df135._0x33f5a9)]['cross'](_0x4c5461,_0x1411cd,new Cesium__namespace['Cartesian3']()),_0x4393b0=new Cesium__namespace['Ray'](_0x11ac29,_0x5c6204),_0x2debe5=new Cesium__namespace['Ray'](_0x11ac29,_0x5ce88d);_0x49da01=Cesium__namespace[_0x43d0e0(_0x5df135._0x449371)]['getPoint'](_0x4393b0,_0x4d6e1b),_0x3be0bb=Cesium__namespace['Ray']['getPoint'](_0x2debe5,_0x4d6e1b);}else{if(Cesium__namespace[_0x43d0e0(_0x5df135._0x33f5a9)][_0x43d0e0(_0x5df135._0x1340d0)](_0x1ad848,_0x11ac29)){const _0xa84b5c=Cesium__namespace[_0x43d0e0(0xe95)]['normalize'](Cesium__namespace['Cartesian3'][_0x43d0e0(_0x5df135._0x305dda)](_0x11ac29,_0xa4d0e8,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x43d0e0(0xe95))]()),_0x5b5ff9=Cesium__namespace['Cartesian3']['normalize'](_0x11ac29,new Cesium__namespace['Cartesian3']()),_0x3a830e=Cesium__namespace[_0x43d0e0(_0x5df135._0x33f5a9)][_0x43d0e0(0x24c)](_0x5b5ff9,_0xa84b5c,new Cesium__namespace['Cartesian3']()),_0x375e13=Cesium__namespace['Cartesian3']['cross'](_0xa84b5c,_0x5b5ff9,new Cesium__namespace['Cartesian3']()),_0x315159=new Cesium__namespace['Ray'](_0x11ac29,_0x3a830e),_0x1d009d=new Cesium__namespace[(_0x43d0e0(_0x5df135._0x449371))](_0x11ac29,_0x375e13);_0x49da01=Cesium__namespace[_0x43d0e0(_0x5df135._0x449371)][_0x43d0e0(_0x5df135._0x2227ba)](_0x315159,_0x4d6e1b),_0x3be0bb=Cesium__namespace['Ray']['getPoint'](_0x1d009d,_0x4d6e1b);}else{const _0x35b873=Cesium__namespace[_0x43d0e0(_0x5df135._0x33f5a9)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x11ac29,_0xa4d0e8,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x65a26d=Cesium__namespace[_0x43d0e0(_0x5df135._0x10100c)][_0x43d0e0(0xf69)](Cesium__namespace['Cartesian3'][_0x43d0e0(_0x5df135._0x5aa0eb)](_0x1ad848,_0x11ac29,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x355afa=Cesium__namespace[_0x43d0e0(_0x5df135._0x43ac94)]['add'](_0x35b873,_0x65a26d,new Cesium__namespace['Cartesian3']());if(Cesium__namespace['Cartesian3']['equals'](_0x355afa,new Cesium__namespace[(_0x43d0e0(_0x5df135._0x10100c))]())){const _0x145029=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x11ac29,_0xa4d0e8,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0xbb5813=Cesium__namespace[_0x43d0e0(_0x5df135._0x43ac94)]['normalize'](_0x11ac29,new Cesium__namespace['Cartesian3']()),_0x56a65a=Cesium__namespace['Cartesian3']['cross'](_0xbb5813,_0x145029,new Cesium__namespace['Cartesian3']()),_0x178c1e=Cesium__namespace['Cartesian3']['cross'](_0x145029,_0xbb5813,new Cesium__namespace[(_0x43d0e0(0xe95))]()),_0x26375f=new Cesium__namespace['Ray'](_0x11ac29,_0x56a65a),_0x564479=new Cesium__namespace[(_0x43d0e0(0xcbc))](_0x11ac29,_0x178c1e);_0x49da01=Cesium__namespace['Ray'][_0x43d0e0(0xa0a)](_0x26375f,_0x4d6e1b),_0x3be0bb=Cesium__namespace[_0x43d0e0(_0x5df135._0x3e5829)]['getPoint'](_0x564479,_0x4d6e1b);}else{const _0x1380cd=Cesium__namespace['Cartesian3']['normalize'](_0x355afa,new Cesium__namespace['Cartesian3']()),_0x4ed33e=Cesium__namespace['Cartesian3']['normalize'](_0x11ac29,new Cesium__namespace['Cartesian3']()),_0x3f1838=Cesium__namespace['Cartesian3'][_0x43d0e0(0x24c)](_0x4ed33e,_0x1380cd,new Cesium__namespace['Cartesian3']()),_0x19f491=Cesium__namespace['Cartesian3']['cross'](_0x1380cd,_0x4ed33e,new Cesium__namespace[(_0x43d0e0(0xe95))]()),_0x2acf06=new Cesium__namespace[(_0x43d0e0(_0x5df135._0x449371))](_0x11ac29,_0x3f1838),_0x70f405=new Cesium__namespace['Ray'](_0x11ac29,_0x19f491),_0x4e1baf=Cesium__namespace[_0x43d0e0(0xe95)]['dot'](_0x35b873,_0x65a26d),_0x260e6b=Cesium__namespace[_0x43d0e0(_0x5df135._0x10100c)][_0x43d0e0(_0x5df135._0x23c940)](_0x35b873),_0xebfadc=Cesium__namespace['Cartesian3']['magnitude'](_0x65a26d),_0x5f1043=_0x4e1baf/_0x260e6b/_0xebfadc,_0x483500=Cesium__namespace[_0x43d0e0(_0x5df135._0x54244e)][_0x43d0e0(_0x5df135._0x1b6a8d)](Math[_0x43d0e0(0xe2f)](_0x5f1043)),_0x1dc87b=_0x483500/0x2,_0x446c1f=Math['cos'](Cesium__namespace['Math']['toRadians'](_0x1dc87b)),_0x54e965=_0x4d6e1b*0x2/_0x446c1f;_0x49da01=Cesium__namespace[_0x43d0e0(0xcbc)][_0x43d0e0(0xa0a)](_0x2acf06,_0x54e965/0x2),_0x3be0bb=Cesium__namespace['Ray']['getPoint'](_0x70f405,_0x54e965/0x2);}}}return{'left':_0x49da01,'right':_0x3be0bb};}const DEF_STYLE$b={'opacity':0x1,'move':![],'axisY':!![]};class Road extends DynamicRiver{constructor(_0x4b441f={}){const _0x326de4=_0x3d5d32;_0x4b441f['style']={...DEF_STYLE$b,..._0x4b441f[_0x326de4(0xdde)]||{}},super(_0x4b441f);}}register$4(_0x3d5d32(0xe4b),Road);class PitWallGeometry{constructor(_0xa4b3bc={}){const _0x123d3c={_0x130f89:0x4cf,_0x3c1518:0xd87},_0x30b610=_0x3d5d32,_0x193c5f=_0xa4b3bc['minimumArr'],_0x17d9ee=_0xa4b3bc[_0x30b610(0x63a)];Cesium__namespace['Check']['defined'](_0x30b610(0x72d),_0x17d9ee),Cesium__namespace['Check']['defined'](_0x30b610(0x855),_0x193c5f),Cesium__namespace['Check']['typeOf']['number']['greaterThanOrEquals']('dingmian.length',_0x17d9ee[_0x30b610(0xc84)],0x3),Cesium__namespace['Check'][_0x30b610(_0x123d3c._0x130f89)][_0x30b610(0xca5)]['greaterThanOrEquals']('dimian.length',_0x193c5f['length'],0x3);const _0x2949f9=new Cesium__namespace[(_0x30b610(_0x123d3c._0x3c1518))]({'st':!![],'position':!![],'bitangent':![],'normal':![],'color':![],'tangent':![]});this['_minimumArr']=Cesium__namespace['clone'](_0x193c5f),this['_maximumArr']=Cesium__namespace['clone'](_0x17d9ee),this['_vertexFormat']=_0x2949f9,this['_workerName']='';}['createGeometry'](_0x4f9a4b,_0x158ddd,_0x4eb12b,_0x257aa0=0x0){const _0x67bb91={_0x24e6c6:0xc84,_0x4ed2ec:0xe95},_0x515b8e=_0x3d5d32,_0x3e01de=_0x4f9a4b['_minimumArr'],_0xe998a6=_0x4f9a4b['_maximumArr'],_0x5ab0ae=_0x4f9a4b['_vertexFormat'],_0x1e2951=new Cesium__namespace[(_0x515b8e(0x321))]();let _0x20a5db,_0x5134f0,_0x322fa3,_0x496004;if(Cesium__namespace['defined'](_0x5ab0ae['position'])&&Cesium__namespace['defined'](_0x5ab0ae['st'])){if(Cesium__namespace['defined'](_0x5ab0ae['position'])){_0x5134f0=new Float64Array(_0xe998a6['length']*0x4*0x3);for(let _0x4aeffc=0x0;_0x4aeffc<_0xe998a6['length'];_0x4aeffc++){_0x4aeffc===_0xe998a6[_0x515b8e(_0x67bb91._0x24e6c6)]-0x1?(_0x5134f0[_0x4aeffc*0xc+0x0]=_0xe998a6[_0x4aeffc]['x'],_0x5134f0[_0x4aeffc*0xc+0x1]=_0xe998a6[_0x4aeffc]['y'],_0x5134f0[_0x4aeffc*0xc+0x2]=_0xe998a6[_0x4aeffc]['z'],_0x5134f0[_0x4aeffc*0xc+0x3]=_0x3e01de[_0x4aeffc]['x'],_0x5134f0[_0x4aeffc*0xc+0x4]=_0x3e01de[_0x4aeffc]['y'],_0x5134f0[_0x4aeffc*0xc+0x5]=_0x3e01de[_0x4aeffc]['z'],_0x5134f0[_0x4aeffc*0xc+0x9]=_0x3e01de[0x0]['x'],_0x5134f0[_0x4aeffc*0xc+0xa]=_0x3e01de[0x0]['y'],_0x5134f0[_0x4aeffc*0xc+0xb]=_0x3e01de[0x0]['z'],_0x5134f0[_0x4aeffc*0xc+0x6]=_0xe998a6[0x0]['x'],_0x5134f0[_0x4aeffc*0xc+0x7]=_0xe998a6[0x0]['y'],_0x5134f0[_0x4aeffc*0xc+0x8]=_0xe998a6[0x0]['z']):(_0x5134f0[_0x4aeffc*0xc+0x0]=_0xe998a6[_0x4aeffc]['x'],_0x5134f0[_0x4aeffc*0xc+0x1]=_0xe998a6[_0x4aeffc]['y'],_0x5134f0[_0x4aeffc*0xc+0x2]=_0xe998a6[_0x4aeffc]['z'],_0x5134f0[_0x4aeffc*0xc+0x3]=_0x3e01de[_0x4aeffc]['x'],_0x5134f0[_0x4aeffc*0xc+0x4]=_0x3e01de[_0x4aeffc]['y'],_0x5134f0[_0x4aeffc*0xc+0x5]=_0x3e01de[_0x4aeffc]['z'],_0x5134f0[_0x4aeffc*0xc+0x9]=_0x3e01de[_0x4aeffc+0x1]['x'],_0x5134f0[_0x4aeffc*0xc+0xa]=_0x3e01de[_0x4aeffc+0x1]['y'],_0x5134f0[_0x4aeffc*0xc+0xb]=_0x3e01de[_0x4aeffc+0x1]['z'],_0x5134f0[_0x4aeffc*0xc+0x6]=_0xe998a6[_0x4aeffc+0x1]['x'],_0x5134f0[_0x4aeffc*0xc+0x7]=_0xe998a6[_0x4aeffc+0x1]['y'],_0x5134f0[_0x4aeffc*0xc+0x8]=_0xe998a6[_0x4aeffc+0x1]['z']);}_0x1e2951['position']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x515b8e(0x3ac)]['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x5134f0});}if(Cesium__namespace[_0x515b8e(0xb84)](_0x5ab0ae['st'])){const _0x206968=new Float32Array(_0xe998a6['length']*0x4*0x2),_0x4c2983=_0xe998a6['length'];for(let _0x355e7b=0x0;_0x355e7b<_0xe998a6['length'];_0x355e7b++){const _0x4321f2=_0x355e7b/_0x4c2983,_0x49a233=_0x158ddd&&_0x158ddd[_0x355e7b]||0x0,_0x35c77e=(_0x49a233-_0x4eb12b)/(_0x257aa0-_0x4eb12b),_0x5be6d2=_0x355e7b+0x1,_0x1b17db=_0x158ddd&&_0x158ddd[_0x5be6d2]||0x0,_0x37a937=_0x5be6d2/_0x4c2983,_0x4db04e=(_0x1b17db-_0x4eb12b)/(_0x257aa0-_0x4eb12b);_0x206968[_0x355e7b*0x8+0x0]=_0x4321f2,_0x206968[_0x355e7b*0x8+0x1]=_0x35c77e-0x0,_0x206968[_0x355e7b*0x8+0x2]=_0x4321f2,_0x206968[_0x355e7b*0x8+0x3]=_0x35c77e-_0x35c77e,_0x206968[_0x355e7b*0x8+0x4]=_0x37a937,_0x206968[_0x355e7b*0x8+0x5]=_0x4db04e-0x0,_0x206968[_0x355e7b*0x8+0x6]=_0x37a937,_0x206968[_0x355e7b*0x8+0x7]=_0x4db04e-_0x4db04e;}_0x1e2951['st']=new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x206968});}_0x20a5db=new Uint16Array(_0xe998a6['length']*0x2*0x3),_0x322fa3=new Cesium__namespace[(_0x515b8e(_0x67bb91._0x4ed2ec))](0x9184e729fff,0x9184e729fff,0x9184e729fff),_0x496004=new Cesium__namespace['Cartesian3'](-0x9184e729fff,-0x9184e729fff,-0x9184e729fff);for(let _0x19e042=0x0;_0x19e042<_0xe998a6[_0x515b8e(0xc84)];_0x19e042++){_0x20a5db[_0x19e042*0x6+0x0]=0x4*_0x19e042+0x0,_0x20a5db[_0x19e042*0x6+0x1]=0x4*_0x19e042+0x1,_0x20a5db[_0x19e042*0x6+0x2]=0x4*_0x19e042+0x2,_0x20a5db[_0x19e042*0x6+0x3]=0x4*_0x19e042+0x1,_0x20a5db[_0x19e042*0x6+0x4]=0x4*_0x19e042+0x2,_0x20a5db[_0x19e042*0x6+0x5]=0x4*_0x19e042+0x3,_0xe998a6[_0x19e042]['x']>=_0x496004['x']&&_0xe998a6[_0x19e042]['y']>=_0x496004['y']&&_0xe998a6[_0x19e042]['z']>=_0x496004['z']&&(_0x496004=_0xe998a6[_0x19e042]),_0x3e01de[_0x19e042]['x']<=_0x322fa3['x']&&_0x3e01de[_0x19e042]['y']<=_0x322fa3['y']&&_0x3e01de[_0x19e042]['z']<=_0x322fa3['z']&&(_0x322fa3=_0x3e01de[_0x19e042]);}}const _0x425512=Cesium__namespace['Cartesian3'][_0x515b8e(0xd97)](_0x496004,_0x322fa3,new Cesium__namespace['Cartesian3']()),_0xc6f9fb=Cesium__namespace['Cartesian3']['magnitude'](_0x425512)*0.5;return new Cesium__namespace['Geometry']({'attributes':_0x1e2951,'indices':_0x20a5db,'primitiveType':Cesium__namespace['PrimitiveType'][_0x515b8e(0x5b0)],'boundingSphere':new Cesium__namespace['BoundingSphere'](Cesium__namespace[_0x515b8e(0xe95)][_0x515b8e(0x61a)],_0xc6f9fb)});}}class Pit extends BasePolyPrimitive{constructor(_0x3f6a89={}){const _0x49f6f8={_0x16a5ad:0x9e2,_0x539aa9:0xdde,_0x23ddd3:0x7a6},_0x1800f9=_0x3d5d32;super(_0x3f6a89),this['style'][_0x1800f9(_0x49f6f8._0x16a5ad)]=this[_0x1800f9(_0x49f6f8._0x539aa9)]['diffHeight']??0xa,this['style']['splitNum']=this['style'][_0x1800f9(_0x49f6f8._0x23ddd3)]??0x32;}get['czmObjectEx'](){const _0x33b435={_0x24983a:0xb75},_0x48a813=_0x3d5d32,_0x501472=[];return this['_bottomPrimitive']&&_0x501472[_0x48a813(_0x33b435._0x24983a)](this['_bottomPrimitive']),this['_primitive_label']&&_0x501472['push'](this[_0x48a813(0xdaf)]),_0x501472;}get['center'](){return this['centerOfMass'];}get[_0x3d5d32(0x9e2)](){return this['style']['diffHeight'];}set['diffHeight'](_0xf6e2c8){const _0x75e01b={_0x20fdaf:0xdde,_0x73ab45:0x9e2,_0x593035:0xe3a,_0x5c8cfd:0x1005,_0x461eec:0x4e9},_0x2bd35a=_0x3d5d32;this[_0x2bd35a(_0x75e01b._0x20fdaf)][_0x2bd35a(_0x75e01b._0x73ab45)]=_0xf6e2c8;const _0x42048c=[],_0x5c2cc3=this['_minHeight']-_0xf6e2c8,_0x56f7ba=this['wellData'][_0x2bd35a(_0x75e01b._0x593035)];for(let _0x4b18e8=0x0,_0x27ac22=_0x56f7ba['length'];_0x4b18e8<_0x27ac22;_0x4b18e8++){const _0x144457=_0x56f7ba[_0x4b18e8];_0x42048c['push'](Cesium__namespace[_0x2bd35a(0xe95)]['fromRadians'](_0x144457['longitude'],_0x144457['latitude'],_0x5c2cc3));}this[_0x2bd35a(_0x75e01b._0x5c8cfd)]['bottomPositions']=_0x42048c,this['_removePit'](),this[_0x2bd35a(_0x75e01b._0x461eec)](this['wellData']);}[_0x3d5d32(0xa04)](){const _0x556b6d={_0x5d5321:0xbb8,_0x3ef2d9:0xdde,_0x299c29:0xd14,_0x182f9b:0x7d1},_0x5a5fcb=_0x3d5d32;if(this[_0x5a5fcb(_0x556b6d._0x5d5321)]['length']===0x0)return;this['_minHeight']=getMinHeight(this['positions']);const _0x4df2d8=this['_minHeight']-this['diffHeight'],_0x13f74b=[],_0x156ba7=[],_0x303e7d=[],_0x4c3d5c=interPolyline({'scene':this['_map']['scene'],'positions':this[_0x5a5fcb(0xbb8)]['concat'](this['positions'][0x0]),'splitNum':this[_0x5a5fcb(_0x556b6d._0x3ef2d9)][_0x5a5fcb(0x7a6)]});for(let _0x18a11a=0x0,_0x406519=_0x4c3d5c['length'];_0x18a11a<_0x406519;_0x18a11a++){const _0x5794b8=Cesium__namespace['Cartographic'][_0x5a5fcb(_0x556b6d._0x299c29)](_0x4c3d5c[_0x18a11a]);_0x303e7d['push'](new Cesium__namespace[(_0x5a5fcb(0x220))](_0x5794b8['longitude'],_0x5794b8['latitude'])),_0x156ba7['push'](Cesium__namespace['Cartesian3'][_0x5a5fcb(_0x556b6d._0x182f9b)](_0x5794b8['longitude'],_0x5794b8['latitude'],_0x4df2d8)),_0x13f74b['push'](Cesium__namespace['Cartesian3'][_0x5a5fcb(0x7d1)](_0x5794b8['longitude'],_0x5794b8['latitude'],0x0));}return{'cartoList':_0x303e7d,'bottomPositions':_0x156ba7,'wallTopPositions':_0x13f74b};}['_addedHook'](_0x12309c){const _0x2a45eb={_0x1fe50a:0xbb8,_0x4ae63d:0x4e9},_0x1cc015=_0x3d5d32;if(!this['show']||!this[_0x1cc015(_0x2a45eb._0x1fe50a)]||this['positions']['length']===0x0)return;const _0x326e7f=this['_getWellData']();this[_0x1cc015(0x1005)]=_0x326e7f,this[_0x1cc015(_0x2a45eb._0x4ae63d)](_0x326e7f),this[_0x1cc015(0xdde)]['label']&&this['_addLabel']();}['_removedHook'](){const _0x815d9c=_0x3d5d32;super['_removedHook'](),this[_0x815d9c(0xa81)]();}['_removePit'](){this['_primitive']&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']),this['_bottomPrimitive']&&(this['primitiveCollection']['remove'](this['_bottomPrimitive']),delete this['_bottomPrimitive']);}[_0x3d5d32(0x4e9)](_0x31e97c){const _0x2c9280={_0x511dbb:0x1d1,_0x366ba0:0x5d1},_0x2465cc={_0x456275:0xe95,_0x10bba6:0xbfd},_0x596217=_0x3d5d32;this[_0x596217(0x52b)](_0x31e97c[_0x596217(0x3c3)]),this[_0x596217(_0x2c9280._0x511dbb)][_0x596217(0xf0b)]?Cesium__namespace['sampleTerrainMostDetailed'](this[_0x596217(0x1d1)]['terrainProvider'],_0x31e97c['cartoList'])['then'](_0x3259a4=>{const _0x37c852=_0x596217;if(!this[_0x37c852(0x842)])return;const _0x11f2ca=[];let _0xeaf11=-0x270f;const _0x47b004=[];for(let _0x2d5583=0x0,_0x1e52a7=_0x3259a4['length'];_0x2d5583<_0x1e52a7;_0x2d5583++){const _0x5ae9ef=_0x3259a4[_0x2d5583];_0x11f2ca['push'](_0x5ae9ef[_0x37c852(0x83e)]),_0xeaf11=Math['max'](_0x5ae9ef['height'],_0xeaf11),_0x47b004['push'](Cesium__namespace[_0x37c852(_0x2465cc._0x456275)]['fromRadians'](_0x5ae9ef[_0x37c852(_0x2465cc._0x10bba6)],_0x5ae9ef['latitude'],_0x5ae9ef['height']));}this['_maxHeight']=_0xeaf11,this['_topHeights']=_0x11f2ca,this['_createWellWall'](_0x31e97c['bottomPositions'],_0x47b004);}):this['_createWellWall'](_0x31e97c[_0x596217(0x3c3)],_0x31e97c[_0x596217(_0x2c9280._0x366ba0)]);}['_createWellWall'](_0x4ba7fb,_0x249e1f){const _0x207296={_0x1d049f:0xdde,_0x561ea7:0xfa3,_0x356362:0xf9c,_0x3c33fc:0x517,_0x3323f3:0x684,_0x53c71e:0x263,_0x30ddab:0x712},_0x152dd5=_0x3d5d32,_0x34c3d9=this['_minHeight']-this['diffHeight'],_0x54669f=this[_0x152dd5(_0x207296._0x1d049f)][_0x152dd5(0xfdc)]??0x1;let _0x14fc6f=new PitWallGeometry({'minimumArr':_0x4ba7fb,'maximumArr':_0x249e1f});_0x14fc6f=_0x14fc6f[_0x152dd5(_0x207296._0x561ea7)](_0x14fc6f,this[_0x152dd5(_0x207296._0x356362)],_0x34c3d9,this[_0x152dd5(0x2cc)]),this[_0x152dd5(_0x207296._0x3c33fc)]&&this['primitiveCollection'][_0x152dd5(0xf06)](this[_0x152dd5(_0x207296._0x3c33fc)]),this['_primitive']=new Cesium__namespace[(_0x152dd5(_0x207296._0x3323f3))]({'geometryInstances':new Cesium__namespace[(_0x152dd5(_0x207296._0x53c71e))]({'id':this['id'],'geometry':_0x14fc6f}),'appearance':new Cesium__namespace['MaterialAppearance']({'material':Cesium__namespace['Material'][_0x152dd5(_0x207296._0x30ddab)](Cesium__namespace[_0x152dd5(0xc6b)]['ImageType'],{'image':this['style']['image'],'color':Cesium__namespace['Color']['WHITE']['withAlpha'](_0x54669f)}),'translucent':_0x54669f!==0x1,'faceForward':!![],'flat':!![]})}),this['primitiveCollection']['add'](this['_primitive']),this['bindPickId'](this['_primitive']);}['_createBottomSurface'](_0x14035e){const _0x1739e6={_0x1e0bc9:0xc84,_0x20502d:0x56b,_0x1a0343:0xd87,_0x34cd1f:0xc41,_0x12aec7:0x7a7,_0x29517a:0xe57,_0xbfc00b:0x5f4,_0x20fe7e:0xc6f},_0x99f83f=_0x3d5d32;if(!_0x14035e[_0x99f83f(_0x1739e6._0x1e0bc9)])return;const _0x34899e=this[_0x99f83f(0xdde)]['opacity']??0x1;this['_bottomPrimitive']&&this['primitiveCollection']['remove'](this[_0x99f83f(_0x1739e6._0x20502d)]),this['_bottomPrimitive']=new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':Cesium__namespace['PolygonGeometry'][_0x99f83f(0x64b)]({'vertexFormat':Cesium__namespace[_0x99f83f(_0x1739e6._0x1a0343)][_0x99f83f(0x560)],'positions':_0x14035e,'perPositionHeight':!![]})}),'appearance':new Cesium__namespace[(_0x99f83f(0xe55))]({'material':Cesium__namespace['Material'][_0x99f83f(0x712)](Cesium__namespace[_0x99f83f(0xc6b)][_0x99f83f(_0x1739e6._0x34cd1f)],{'image':this['style']['imageBottom'],'color':Cesium__namespace['Color'][_0x99f83f(_0x1739e6._0x12aec7)][_0x99f83f(_0x1739e6._0x29517a)](_0x34899e)}),'translucent':_0x34899e!==0x1,'faceForward':!![],'flat':!![]})}),this[_0x99f83f(_0x1739e6._0xbfc00b)]['add'](this['_bottomPrimitive']),this[_0x99f83f(_0x1739e6._0x20fe7e)](this['_bottomPrimitive']);}['_updateExOpacity'](_0x48b4db){this['_updatePrimitiveOpacity'](this['_bottomPrimitive'],_0x48b4db);}['_getDrawEntityClass'](_0x43b1d6,_0xb09e17){const _0x30df83={_0xcb05f0:0x8e1},_0x52832e=_0x3d5d32;return _0x43b1d6['style'][_0x52832e(_0x30df83._0xcb05f0)]=_0x43b1d6['style']['imageBottom'],delete _0x43b1d6['style']['diffHeight'],create$4('polygon',_0x43b1d6);}}register$4('pit',Pit);const DEF_STYLE$a={'dimensions_x':0x64,'dimensions_y':0x64};class DoubleSidedPlane extends BasePointPrimitive{constructor(_0x2d21d1={}){const _0x770f11={_0x26e8cb:0xdde},_0x8378b8=_0x3d5d32;_0x2d21d1['style']={...DEF_STYLE$a,..._0x2d21d1[_0x8378b8(_0x770f11._0x26e8cb)]||{}},super(_0x2d21d1);}['_addedHook'](_0x393fb1){const _0x5974a8={_0x396229:0xc6b,_0x5994dc:0x9dd,_0xd84463:0xb35,_0x2ea1c:0x263},_0x487fcd=_0x3d5d32;if(!this['show'])return;const _0x479b55=[0x0,-0.5,-0.5,0x0,0.5,-0.5,0x0,0.5,0.5,0x0,-0.5,0.5,0x0,0.5,-0.5,0x0,-0.5,-0.5,0x0,-0.5,0.5,0x0,0.5,0.5],_0x2314a6=[0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1,0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1],_0x2cc1ca=[0x0,0x1,0x2,0x0,0x2,0x3,0x4,0x5,0x6,0x4,0x6,0x7],_0x4b52a8=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':new Float64Array(_0x479b55)}),'st':new Cesium__namespace[(_0x487fcd(0xf0e))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(_0x2314a6)})},'indices':new Uint16Array(_0x2cc1ca),'primitiveType':Cesium__namespace['PrimitiveType'][_0x487fcd(0x5b0)],'boundingSphere':Cesium__namespace[_0x487fcd(0xbd8)]['fromVertices'](_0x479b55)}),_0x422059=new Cesium__namespace[(_0x487fcd(_0x5974a8._0x396229))]({'fabric':{'type':'Image','uniforms':{'image':_0x393fb1['image'],'opacity':_0x393fb1['opacity']??0x1,'color':Cesium__namespace['Color']['WHITE'],'speed':_0x393fb1['speed']||0x0,'flipx':_0x393fb1[_0x487fcd(0xac6)]??![],'flipy':_0x393fb1[_0x487fcd(_0x5974a8._0x5994dc)]??![],'noWhite':_0x393fb1[_0x487fcd(_0x5974a8._0xd84463)]??!![],'globalAlpha':0x1},'source':ImageMaterial}});this['_primitive']=new Cesium__namespace[(_0x487fcd(0x684))]({'geometryInstances':new Cesium__namespace[(_0x487fcd(_0x5974a8._0x2ea1c))]({'geometry':_0x4b52a8}),'appearance':new Cesium__namespace['MaterialAppearance']({'translucent':!![],'closed':!![],'flat':!![],...this[_0x487fcd(0xdde)],'material':_0x422059}),'modelMatrix':this['modelMatrix'],'show':this['show']}),this[_0x487fcd(0x5f4)][_0x487fcd(0xff3)](this['_primitive']);}['_getModelMatrix'](_0x294ec0,_0xda784f){const _0x17532b={_0x23fb9d:0x562,_0x10f347:0xdee,_0x1d6a85:0x1007},_0x2683f7=_0x3d5d32;if(!_0x294ec0)return Cesium__namespace['Matrix4']['IDENTITY'];const _0x50287a=Cesium__namespace[_0x2683f7(0x103e)]['toRadians'](this['style']['heading']||0x0),_0x556ce9=Cesium__namespace['Math']['toRadians'](this['style']['pitch']||0x0),_0x59c865=Cesium__namespace['Math'][_0x2683f7(_0x17532b._0x23fb9d)](this['style']['roll']||0x0);this[_0x2683f7(0xc74)]=_0x50287a,this['_pitch_reality']=_0x556ce9,this['_roll_reality']=_0x59c865;const _0x27636b=Cesium__namespace['Transforms'][_0x2683f7(0x9f9)](_0x294ec0,new Cesium__namespace[(_0x2683f7(0x7ba))](_0x50287a,_0x556ce9,_0x59c865),Cesium__namespace['Ellipsoid'][_0x2683f7(_0x17532b._0x10f347)],this['options'][_0x2683f7(_0x17532b._0x1d6a85)]),_0x4f3fcf=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](0x1,this['style']['dimensions_x'],this['style'][_0x2683f7(0xb1f)]));return Cesium__namespace['Matrix4']['multiply'](_0x27636b,_0x4f3fcf,new Cesium__namespace[(_0x2683f7(0xf5d))]());}[_0x3d5d32(0xac7)](_0x187879,_0x5783ef){const _0x3609db=_0x3d5d32;return create$4(_0x3609db(0xbbe),_0x187879);}}register$4(_0x3d5d32(0x365),DoubleSidedPlane,!![]);var ReflectionWaterFS='uniform\x20sampler2D\x20reflexTexture;\x20//\x20反射贴图\x0auniform\x20sampler2D\x20normalTexture;\x20//\x20法线贴图\x0auniform\x20float\x20time;\x0a\x0auniform\x20mat4\x20fixedFrameToEastNorthUpTransform;\x20//\x20水面的东北天矩阵的逆矩阵\x0a\x0a//\x20从顶点着色器传来的\x0ain\x20vec4\x20v_worldPosition;\x20//\x20当前像素的世界坐标\x0ain\x20vec4\x20v_uv;\x20//\x20原本的纹理坐标乘以贴图矩阵\x0a\x0a//\x20可配置的参数\x0auniform\x20float\x20ripple;\x20//\x20波纹大小(数值越大波纹越密集)\x0auniform\x20vec4\x20waterColor;\x20//\x20水面颜色\x0auniform\x20float\x20waterAlpha;\x20//\x20水面透明度\x0auniform\x20float\x20reflectivity;\x20//\x20水面反射率\x0auniform\x20vec3\x20lightDirection;\x20//\x20光照方向\x0auniform\x20float\x20shiny;\x20//\x20光照强度\x0auniform\x20float\x20distortion;\x20//\x20倒影的扭曲程度\x0auniform\x20float\x20globalAlpha;\x0a\x0aconst\x20vec3\x20sunColor\x20=\x20vec3(1.0);\x0a\x0a//\x20获取噪声\x0a//\x20vec4\x20czm_getWaterNoise(sampler2D\x20normalMap,\x20vec2\x20uv,\x20float\x20time,\x20float\x20angleInRadians)\x0avec4\x20mars3d_getNoise(sampler2D\x20normalMap,\x20vec2\x20uv)\x20{\x0a\x20\x20vec2\x20uv0\x20=\x20(uv\x20/\x20103.0)\x20+\x20vec2(time\x20/\x2017.0,\x20time\x20/\x2029.0);\x0a\x20\x20vec2\x20uv1\x20=\x20uv\x20/\x20107.0\x20-\x20vec2(time\x20/\x20-19.0,\x20time\x20/\x2031.0);\x0a\x20\x20vec2\x20uv2\x20=\x20uv\x20/\x20vec2(8907.0,\x209803.0)\x20+\x20vec2(time\x20/\x20101.0,\x20time\x20/\x2097.0);\x0a\x20\x20vec2\x20uv3\x20=\x20uv\x20/\x20vec2(1091.0,\x201027.0)\x20-\x20vec2(time\x20/\x20109.0,\x20time\x20/\x20-113.0);\x0a\x20\x20vec4\x20noise\x20=\x20texture(normalMap,\x20uv0)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv1)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv2)\x20+\x0a\x20\x20\x20\x20texture(normalMap,\x20uv3);\x0a\x20\x20return\x20noise\x20*\x200.5\x20-\x201.0;\x0a}\x0a\x0avoid\x20mars3d_sunLight(const\x20vec3\x20surfaceNormal,\x20const\x20vec3\x20eyeDirection,\x20float\x20shiny,\x20float\x20spec,\x20float\x20diffuse,\x20inout\x20vec3\x20diffuseColor,\x20inout\x20vec3\x20specularColor)\x20{\x0a\x20\x20vec3\x20sunDirection\x20=\x20normalize(lightDirection);\x0a\x20\x20vec3\x20reflection\x20=\x20normalize(reflect(-sunDirection,\x20surfaceNormal));\x20\x20//\x20获得太阳对表面法线的反射向量\x0a\x20\x20float\x20direction\x20=\x20max(0.0,\x20dot(eyeDirection,\x20reflection));\x20\x20//\x20当太阳反射方向和眼睛的方向一致时,direction\x20最大,为\x201,当角度大于\x2090度时最小,最小为\x200\x0a\x20\x20specularColor\x20+=\x20pow(direction,\x20shiny)\x20*\x20sunColor\x20*\x20spec;\x0a\x20\x20diffuseColor\x20+=\x20max(dot(sunDirection,\x20surfaceNormal),\x200.0)\x20*\x20sunColor\x20*\x20diffuse;\x0a}\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20\x20\x20//\x20通过法线贴图计算新的表面法线\x0a\x20\x20vec2\x20transformedSt\x20=\x20materialInput.st\x20*\x202.0\x20-\x201.0;\x20\x20//\x20[0,\x201]\x20=>\x20[-1,\x201]\x0a\x20\x20vec4\x20noise\x20=\x20mars3d_getNoise(normalTexture,\x20transformedSt\x20*\x20ripple);\x0a\x20\x20vec3\x20surfaceNormal\x20=\x20normalize(noise.xzy);\x20\x20//\x20[0,\x20+1],Y\x20up\x0a\x0a\x20\x20\x20\x20//\x20漫反射光\x0a\x20\x20vec3\x20diffuseLight\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20//\x20高光\x0a\x20\x20vec3\x20specularLight\x20=\x20vec3(0.0);\x0a\x0a\x20\x20\x20\x20//\x20获取视线方向(世界坐标)\x0a\x20\x20vec3\x20eye\x20=\x20(czm_inverseView\x20*\x20vec4(vec3(0.0),\x201.0)).xyz;\x0a\x20\x20\x20\x20//\x20获取视线方向(水面的本地坐标)\x0a\x20\x20eye\x20=\x20(fixedFrameToEastNorthUpTransform\x20*\x20vec4(eye,\x201.0)).xyz;\x0a\x20\x20\x20\x20//\x20当前像素的本地坐标\x0a\x20\x20vec3\x20world\x20=\x20(fixedFrameToEastNorthUpTransform\x20*\x20vec4(v_worldPosition.xyz,\x201.0)).xyz;\x0a\x0a\x20\x20vec3\x20worldToEye\x20=\x20eye\x20-\x20world;\x20\x20//\x20east,\x20north,\x20up\x0a\x20\x20worldToEye\x20=\x20vec3(worldToEye.x,\x20worldToEye.z,\x20-worldToEye.y);\x20\x20//\x20Y\x20up\x0a\x20\x20vec3\x20eyeDirection\x20=\x20normalize(worldToEye);\x0a\x0a\x20\x20float\x20spec\x20=\x202.0;\x0a\x20\x20float\x20diffuse\x20=\x200.5;\x0a\x20\x20mars3d_sunLight(surfaceNormal,\x20eyeDirection,\x20shiny,\x20spec,\x20diffuse,\x20diffuseLight,\x20specularLight);\x0a\x0a\x20\x20float\x20distance\x20=\x20length(worldToEye);\x0a\x20\x20vec2\x20distortion\x20=\x20surfaceNormal.xz\x20*\x20(0.001\x20+\x201.0\x20/\x20distance)\x20*\x20distortion;\x0a\x20\x20vec3\x20reflectionSample\x20=\x20vec3(texture(reflexTexture,\x20(v_uv.xy\x20/\x20v_uv.w)\x20*\x200.5\x20+\x200.5\x20+\x20distortion));\x0a\x0a\x20\x20float\x20theta\x20=\x20max(dot(eyeDirection,\x20surfaceNormal),\x200.0);\x0a\x20\x20float\x20reflectivity\x20=\x20reflectivity;\x0a\x20\x20float\x20reflectance\x20=\x20mix(reflectivity,\x201.0,\x20pow(1.0\x20-\x20theta,\x205.0));\x0a\x0a\x20\x20\x20\x20//\x20surfaceNormal\x20是以反射平面为\x20X-Y\x20平面的,\x0a\x20\x20\x20\x20//\x20所以\x20eyeDirection\x20也得是以反射平面为\x20X-Y\x20平面。\x0a\x20\x20vec3\x20scatter\x20=\x20max(0.0,\x20dot(surfaceNormal,\x20eyeDirection))\x20*\x20waterColor.rgb;\x0a\x20\x20vec3\x20albedo\x20=\x20mix(sunColor\x20*\x20diffuseLight\x20*\x200.3\x20+\x20scatter,\x20vec3(0.1)\x20+\x20reflectionSample\x20*\x200.9\x20+\x20reflectionSample\x20*\x20specularLight,\x20reflectance);\x0a\x20\x20material.diffuse\x20=\x20albedo.rgb;\x0a\x20\x20material.alpha\x20=\x20waterAlpha*\x20globalAlpha;\x0a\x0a\x20\x20return\x20material;\x0a}\x0a',ReflectionWaterVS=_0x3d5d32(0x977);class ReflectionWater extends PolygonPrimitive{get['height'](){const _0x1407c0={_0x203699:0xecf},_0x14a3a9=_0x3d5d32;return this[_0x14a3a9(_0x1407c0._0x203699)];}set['height'](_0x2df177){const _0x31fb4c={_0x103a57:0xecf,_0x2cc004:0xd14,_0x4552f0:0x25a,_0x40fd27:0xa6c,_0x5053c3:0xb48,_0xd325c:0xa0e,_0x55d6a3:0x5ba,_0x10b7f5:0xa0e},_0x44cc25=_0x3d5d32;this[_0x44cc25(_0x31fb4c._0x103a57)]=_0x2df177;const _0x1f41ec=Cesium__namespace['Cartographic'][_0x44cc25(_0x31fb4c._0x2cc004)](this['_originalreflectorWorldPosition']),_0x54af32=Cesium__namespace['Cartesian3']['fromRadians'](_0x1f41ec['longitude'],_0x1f41ec['latitude'],this['_height']),_0x6a5383=Cesium__namespace['Cartesian3']['subtract'](_0x54af32,this['_originalreflectorWorldPosition'],new Cesium__namespace['Cartesian3']()),_0xaad3e1=Cesium__namespace['Matrix4']['fromTranslation'](_0x6a5383);this['_primitive']['modelMatrix']=_0xaad3e1,this[_0x44cc25(0xb48)]=_0x54af32,this['_normal']=Cesium__namespace[_0x44cc25(_0x31fb4c._0x4552f0)]['WGS84']['geodeticSurfaceNormal'](this['_reflectorWorldPosition']),this['_waterPlane']=Cesium__namespace[_0x44cc25(_0x31fb4c._0x40fd27)]['fromPointNormal'](this[_0x44cc25(_0x31fb4c._0x5053c3)],this[_0x44cc25(0x530)]),this['_reflectMatrix']=new Cesium__namespace[(_0x44cc25(0xf5d))](-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane']['normal']['x']+0x1,-0x2*this['_waterPlane']['normal']['x']*this[_0x44cc25(_0x31fb4c._0xd325c)][_0x44cc25(_0x31fb4c._0x55d6a3)]['y'],-0x2*this['_waterPlane']['normal']['x']*this[_0x44cc25(_0x31fb4c._0xd325c)]['normal']['z'],-0x2*this[_0x44cc25(_0x31fb4c._0x10b7f5)]['normal']['x']*this['_waterPlane']['distance'],-0x2*this['_waterPlane']['normal']['y']*this[_0x44cc25(0xa0e)]['normal']['x'],-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['normal']['y']+0x1,-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['normal']['z'],-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['distance'],-0x2*this['_waterPlane']['normal']['z']*this[_0x44cc25(0xa0e)]['normal']['x'],-0x2*this['_waterPlane']['normal']['z']*this[_0x44cc25(0xa0e)]['normal']['y'],-0x2*this['_waterPlane'][_0x44cc25(0x5ba)]['z']*this['_waterPlane']['normal']['z']+0x1,-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane'][_0x44cc25(0xbd7)],0x0,0x0,0x0,0x1);}[_0x3d5d32(0x7b3)](_0x25d16a,_0xec1661){const _0x19e778={_0x3556ef:0xb84,_0x36bcf3:0x54c,_0x4f7ee0:0x521},_0x155083=_0x3d5d32;Cesium__namespace[_0x155083(_0x19e778._0x3556ef)](_0xec1661['color'])&&(this['_material'][_0x155083(0xfe3)]['waterColor']=getCesiumColor(_0x25d16a[_0x155083(0xe8f)],Cesium__namespace[_0x155083(0x882)]['fromCssColorString']('#001e0f'))),Cesium__namespace['defined'](_0xec1661['opacity'])&&(this['_material']['uniforms']['waterAlpha']=_0x25d16a[_0x155083(0xfdc)]),Cesium__namespace['defined'](_0xec1661['reflectivity'])&&(this['_material']['uniforms']['reflectivity']=_0x25d16a['reflectivity']),Cesium__namespace['defined'](_0xec1661[_0x155083(_0x19e778._0x36bcf3)])&&(this['_material']['uniforms'][_0x155083(0x54c)]=_0x25d16a['lightDirection']),Cesium__namespace['defined'](_0xec1661['shiny'])&&(this['_material']['uniforms'][_0x155083(_0x19e778._0x4f7ee0)]=_0x25d16a['shiny']),Cesium__namespace[_0x155083(_0x19e778._0x3556ef)](_0xec1661[_0x155083(0xb1b)])&&(this['_material']['uniforms'][_0x155083(0xb1b)]=_0x25d16a['distortion']),Cesium__namespace['defined'](_0xec1661['height'])&&(this['height']=_0xec1661['height']);}['_addedHook'](_0x34a2cb){const _0x495c3f={_0x180846:0xbb8,_0x28321c:0xd31},_0x29aeb6=_0x3d5d32;if(!this['show']||!this['positions']||this[_0x29aeb6(_0x495c3f._0x180846)]['length']===0x0)return;this['_bindFun'](),this['_createPrimitive'](_0x34a2cb),this[_0x29aeb6(_0x495c3f._0x28321c)]();}['_removedHook'](){const _0x3ebd9a={_0x3d7cf6:0x5f4},_0x27178b=_0x3d5d32;this['unbindUpdateEvent'](),this['_primitive']&&(this[_0x27178b(_0x3ebd9a._0x3d7cf6)]['remove'](this['_primitive']),delete this['_primitive']),this[_0x27178b(0x311)](),this[_0x27178b(0x232)]();}['_createPrimitive'](_0x5748ed){const _0x228557={_0x45065c:0x468,_0x1916c6:0xbe1,_0x4509e4:0xdde,_0x4130fa:0x83e,_0x176ea8:0xe72,_0x2c5e6d:0xb16,_0x1a617c:0xb48,_0x1b5c02:0xa0e,_0x3c7bd4:0x5ba,_0x15cf19:0xa0e,_0x4ea3c5:0x5ba,_0x3b28b3:0xa0e,_0x22d8b0:0xfc1,_0x4754aa:0xb57,_0x10341b:0xecd,_0x54e428:0xa94,_0x278b9c:0x1053,_0x4215f0:0xc6b,_0x1a2778:0x882,_0x9d01d:0xe95,_0x23e92e:0xa94,_0x5aee61:0x943,_0x312032:0x2df,_0xd5377a:0xfe3,_0x3191d7:0x104c,_0x54bc38:0xa7a},_0x4a5bb2=_0x3d5d32,_0x4f9d9b=this[_0x4a5bb2(_0x228557._0x45065c)](_0x5748ed);_0x4f9d9b['vertexFormat']=Cesium__namespace[_0x4a5bb2(_0x228557._0x1916c6)]['POSITION_NORMAL_AND_ST'];let _0x4bd9ed=0x0;Cesium__namespace['defined'](this['style']['height'])?_0x4bd9ed=this[_0x4a5bb2(_0x228557._0x4509e4)][_0x4a5bb2(_0x228557._0x4130fa)]:_0x4bd9ed=getMaxHeight(this['positions']);this['_height']=_0x4bd9ed,this['_reflectorWorldPosition']=this[_0x4a5bb2(_0x228557._0x176ea8)],this[_0x4a5bb2(_0x228557._0x2c5e6d)]=this[_0x4a5bb2(0xb48)]['clone'](),this[_0x4a5bb2(0x530)]=Cesium__namespace['Ellipsoid']['WGS84'][_0x4a5bb2(0x4d1)](this[_0x4a5bb2(_0x228557._0x1a617c)]),this[_0x4a5bb2(_0x228557._0x1b5c02)]=Cesium__namespace['Plane']['fromPointNormal'](this['_reflectorWorldPosition'],this['_normal']),this['_reflectMatrix']=new Cesium__namespace['Matrix4'](-0x2*this['_waterPlane'][_0x4a5bb2(_0x228557._0x3c7bd4)]['x']*this[_0x4a5bb2(_0x228557._0x15cf19)]['normal']['x']+0x1,-0x2*this['_waterPlane'][_0x4a5bb2(_0x228557._0x3c7bd4)]['x']*this['_waterPlane'][_0x4a5bb2(_0x228557._0x3c7bd4)]['y'],-0x2*this['_waterPlane']['normal']['x']*this[_0x4a5bb2(_0x228557._0x1b5c02)]['normal']['z'],-0x2*this['_waterPlane']['normal']['x']*this['_waterPlane']['distance'],-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['normal']['x'],-0x2*this[_0x4a5bb2(_0x228557._0x1b5c02)]['normal']['y']*this['_waterPlane'][_0x4a5bb2(_0x228557._0x4ea3c5)]['y']+0x1,-0x2*this[_0x4a5bb2(_0x228557._0x3b28b3)]['normal']['y']*this[_0x4a5bb2(0xa0e)]['normal']['z'],-0x2*this['_waterPlane']['normal']['y']*this['_waterPlane']['distance'],-0x2*this['_waterPlane'][_0x4a5bb2(_0x228557._0x3c7bd4)]['z']*this['_waterPlane']['normal']['x'],-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane'][_0x4a5bb2(0x5ba)]['y'],-0x2*this['_waterPlane']['normal']['z']*this['_waterPlane']['normal']['z']+0x1,-0x2*this['_waterPlane'][_0x4a5bb2(_0x228557._0x3c7bd4)]['z']*this['_waterPlane']['distance'],0x0,0x0,0x0,0x1),this['_reflectorViewMatrix']=Cesium__namespace['Matrix4']['IDENTITY']['clone'](),this['_reflectorProjectionMatrix']=Cesium__namespace['Matrix4']['IDENTITY']['clone']();const _0x57d160=this['_map'][_0x4a5bb2(_0x228557._0x22d8b0)]['context'];this['_createFramebuffer'](_0x57d160,_0x57d160['drawingBufferWidth'],_0x57d160[_0x4a5bb2(0x466)],this[_0x4a5bb2(0x1d1)][_0x4a5bb2(0xfc1)]['highDynamicRange']);const _0x5ab060=new Cesium__namespace['Texture']({'context':_0x57d160,'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0xff,0x0,0x0,0xff])},'sampler':new Cesium__namespace['Sampler']({'wrapS':Cesium__namespace['TextureWrap'][_0x4a5bb2(_0x228557._0x4754aa)],'wrapT':Cesium__namespace['TextureWrap']['REPEAT'],'minificationFilter':Cesium__namespace[_0x4a5bb2(_0x228557._0x10341b)][_0x4a5bb2(_0x228557._0x54e428)],'magnificationFilter':Cesium__namespace['TextureMinificationFilter']['LINEAR']})});_0x5ab060['type']=_0x4a5bb2(_0x228557._0x278b9c);const _0x8731d6=Cesium__namespace[_0x4a5bb2(0x979)][_0x4a5bb2(0x9d2)]({'context':_0x57d160,'framebuffer':this['_colorFramebuffer']});_0x8731d6['type']='sampler2D';const _0x37a636=new Cesium__namespace[(_0x4a5bb2(_0x228557._0x4215f0))]({'fabric':{'type':'ReflectionWater','uniforms':{'waterColor':getCesiumColor(_0x5748ed['color'],Cesium__namespace[_0x4a5bb2(_0x228557._0x1a2778)]['fromCssColorString']('#001e0f')),'waterAlpha':_0x5748ed['opacity']??0.9,'globalAlpha':0x1,'ripple':_0x5748ed['ripple']??0x32,'reflectivity':_0x5748ed['reflectivity']??0.5,'lightDirection':_0x5748ed['lightDirection']??new Cesium__namespace[(_0x4a5bb2(_0x228557._0x9d01d))](0x0,0x0,0x1),'shiny':_0x5748ed['shiny']??0x64,'distortion':_0x5748ed[_0x4a5bb2(0xb1b)]??3.7,'normalTexture':_0x5ab060,'reflexTexture':_0x8731d6,'time':0x0,'fixedFrameToEastNorthUpTransform':Cesium__namespace['Matrix4'][_0x4a5bb2(0x4d4)](this['_getFixedFrameToEastNorthUpTransformFromWorldMatrix']())},'source':ReflectionWaterFS},'translucent':![],'minificationFilter':Cesium__namespace[_0x4a5bb2(_0x228557._0x10341b)][_0x4a5bb2(_0x228557._0x23e92e)],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter'][_0x4a5bb2(0xa94)]});addTextureUniform({'material':_0x37a636,'context':_0x57d160,'uniformName':'normalTexture','image':_0x5748ed[_0x4a5bb2(_0x228557._0x5aee61)]??'/img/textures/waterNormals.jpg'}),this[_0x4a5bb2(_0x228557._0x312032)]=_0x37a636;const _0x1e4cd1=new Cesium__namespace['MaterialAppearance']({'material':_0x37a636,'vertexShaderSource':ReflectionWaterVS,'translucent':!![]});_0x1e4cd1[_0x4a5bb2(0xfe3)]={},_0x1e4cd1[_0x4a5bb2(_0x228557._0xd5377a)]['reflectMatrix']=Cesium__namespace['Matrix4'][_0x4a5bb2(0x4d4)](this[_0x4a5bb2(_0x228557._0x3191d7)]),_0x1e4cd1['uniforms']['reflectorProjectionMatrix']=Cesium__namespace['Matrix4']['toArray'](this['_reflectorProjectionMatrix']),_0x1e4cd1['uniforms']['reflectorViewMatrix']=Cesium__namespace['Matrix4'][_0x4a5bb2(0x4d4)](this[_0x4a5bb2(_0x228557._0x54bc38)]);const _0x39ded7={'geometryInstances':this['_createGeometryInstance'](_0x4f9d9b),'appearance':_0x1e4cd1,'asynchronous':![],'show':this['show']};this['_primitive']=this['primitiveCollection']['add'](new Cesium__namespace['Primitive'](_0x39ded7));}['update'](_0x11c5e2){const _0x33c0bd={_0x1bb992:0x792,_0x45574a:0x435,_0x1e5271:0x867,_0x3e9124:0x1064,_0x4c9497:0xaa8,_0x1b95e8:0x6d9,_0x1e3119:0x5d6,_0xc9d723:0x556,_0x202da7:0xfe3,_0x2109c8:0x4d4},_0x5a344c=_0x3d5d32,_0x3793a1=this['_map'][_0x5a344c(0xfc1)],_0x42d25a=_0x3793a1['_defaultView']['camera'],_0x403f87=_0x3793a1['shadowMap'],_0xc79811=_0x3793a1['globe'][_0x5a344c(_0x33c0bd._0x1bb992)],_0x5e888c=_0x3793a1['globe']['showSkirts'],_0x596e33=_0x3793a1['logarithmicDepthBuffer'];if(!this['_updateVirtualCamera'](_0x3793a1['_defaultView']['camera'])){this['_primitive']['show']=![];return;}this['_primitive']['show']=![],_0x3793a1['_defaultView'][_0x5a344c(_0x33c0bd._0x45574a)]=this[_0x5a344c(_0x33c0bd._0x1e5271)],_0x3793a1[_0x5a344c(_0x33c0bd._0x3e9124)]=undefined,_0x3793a1['globe']['show']=![],_0x3793a1[_0x5a344c(_0x33c0bd._0x4c9497)]['showSkirts']=![],_0x3793a1['logarithmicDepthBuffer']=![];const _0x1101e4=_0x3793a1['context'],_0x451a71=_0x1101e4['drawingBufferWidth'],_0x573139=_0x1101e4['drawingBufferHeight'],_0x127f18=_0x3793a1['highDynamicRange'];this['_createFramebuffer'](_0x1101e4,_0x451a71,_0x573139,_0x127f18),render(_0x3793a1,this['_colorFramebuffer']);const _0x940d4e=this['_primitive']['appearance'],_0x12b3fc=Cesium__namespace['Texture']['fromFramebuffer']({'context':_0x1101e4,'framebuffer':this[_0x5a344c(_0x33c0bd._0x1b95e8)]});_0x12b3fc['type']=_0x5a344c(0x1053),this[_0x5a344c(0x2df)]['uniforms']['reflexTexture']=_0x12b3fc,this['_material']['uniforms'][_0x5a344c(_0x33c0bd._0x1e3119)]=performance['now']()/0x3e8,this['_material']['uniforms']['fixedFrameToEastNorthUpTransform']=Cesium__namespace['Matrix4'][_0x5a344c(0x4d4)](this[_0x5a344c(_0x33c0bd._0xc9d723)]()),_0x940d4e['uniforms']['reflectMatrix']=Cesium__namespace['Matrix4'][_0x5a344c(0x4d4)](this['_reflectMatrix']),_0x940d4e[_0x5a344c(_0x33c0bd._0x202da7)]['reflectorProjectionMatrix']=Cesium__namespace['Matrix4'][_0x5a344c(0x4d4)](this['_reflectorProjectionMatrix']),_0x940d4e['uniforms']['reflectorViewMatrix']=Cesium__namespace['Matrix4'][_0x5a344c(_0x33c0bd._0x2109c8)](this[_0x5a344c(0xa7a)]),this[_0x5a344c(0x517)][_0x5a344c(0x792)]=!![],_0x3793a1[_0x5a344c(0x646)]['camera']=_0x42d25a,_0x3793a1['shadowMap']=_0x403f87,_0x3793a1['globe'][_0x5a344c(0x792)]=_0xc79811,_0x3793a1['globe']['showSkirts']=_0x5e888c,_0x3793a1['logarithmicDepthBuffer']=_0x596e33;}[_0x3d5d32(0xce5)](_0x4f3948){const _0x315ca4={_0x28afae:0xe95,_0x490232:0x36d,_0x29f151:0x530,_0x19fd6d:0xff3,_0x3ba3df:0xb48,_0x106dd3:0x490,_0xc615c5:0xf69,_0x2ebeff:0xe36,_0x150486:0xae9,_0x262af5:0x5ba,_0x4b2789:0xd36,_0x72e849:0xadd,_0x2406ed:0x1075,_0x4df009:0xf5d},_0x11c048=_0x3d5d32,_0x57d67c=new Cesium__namespace[(_0x11c048(_0x315ca4._0x28afae))](0x0,0x0,-0x1);let _0x7eb1fa=new Cesium__namespace['Cartesian3']();this['_virtualCamera']=Cesium__namespace[_0x11c048(_0x315ca4._0x490232)][_0x11c048(0x315)](_0x4f3948,this[_0x11c048(0x867)]);const _0x30faca=_0x4f3948['positionWC']['clone']();let _0x595c04=Cesium__namespace['Cartesian3']['subtract'](this['_reflectorWorldPosition'],_0x30faca,new Cesium__namespace['Cartesian3']());if(Cesium__namespace[_0x11c048(_0x315ca4._0x28afae)]['dot'](_0x595c04,this[_0x11c048(_0x315ca4._0x29f151)])>0x0)return![];_0x595c04=getReflectVector(_0x595c04,this['_normal']),Cesium__namespace['Cartesian3']['negate'](_0x595c04,_0x595c04),Cesium__namespace['Cartesian3'][_0x11c048(_0x315ca4._0x19fd6d)](_0x595c04,this[_0x11c048(_0x315ca4._0x3ba3df)],_0x595c04),this['_virtualCamera']['position']=_0x595c04['clone'](),Cesium__namespace['Cartesian3']['add'](_0x4f3948[_0x11c048(_0x315ca4._0x106dd3)],_0x30faca,_0x57d67c),Cesium__namespace['Cartesian3'][_0x11c048(0xd97)](this['_reflectorWorldPosition'],_0x57d67c,_0x7eb1fa),_0x7eb1fa=getReflectVector(_0x7eb1fa,this['_normal']),Cesium__namespace['Cartesian3']['negate'](_0x7eb1fa,_0x7eb1fa),Cesium__namespace['Cartesian3'][_0x11c048(0xff3)](_0x7eb1fa,this['_reflectorWorldPosition'],_0x7eb1fa),this[_0x11c048(0x867)][_0x11c048(0xe36)]=Cesium__namespace['Cartesian3']['subtract'](_0x7eb1fa,this['_virtualCamera']['position'],new Cesium__namespace['Cartesian3']()),Cesium__namespace['Cartesian3'][_0x11c048(_0x315ca4._0xc615c5)](this['_virtualCamera'][_0x11c048(_0x315ca4._0x2ebeff)],this[_0x11c048(0x867)]['direction']),Cesium__namespace['Cartesian3']['add'](_0x4f3948['upWC'],_0x30faca,_0x57d67c),Cesium__namespace[_0x11c048(_0x315ca4._0x28afae)]['subtract'](this['_reflectorWorldPosition'],_0x57d67c,_0x7eb1fa),_0x7eb1fa=getReflectVector(_0x7eb1fa,this['_normal']),Cesium__namespace['Cartesian3'][_0x11c048(_0x315ca4._0x150486)](_0x7eb1fa,_0x7eb1fa),Cesium__namespace['Cartesian3']['add'](_0x7eb1fa,this[_0x11c048(0xb48)],_0x7eb1fa),this['_virtualCamera']['up']=Cesium__namespace[_0x11c048(0xe95)][_0x11c048(0xd97)](_0x7eb1fa,this['_virtualCamera']['position'],new Cesium__namespace[(_0x11c048(0xe95))]()),Cesium__namespace['Cartesian3']['normalize'](this['_virtualCamera']['up'],this['_virtualCamera']['up']),this['_reflectorProjectionMatrix']=this['_virtualCamera']['frustum']['projectionMatrix'],this[_0x11c048(0xa7a)]=this['_virtualCamera'][_0x11c048(0x51d)];const _0x1aab69=Cesium__namespace['Plane']['fromPointNormal'](this[_0x11c048(0xb48)],this['_normal']);Cesium__namespace['Plane']['transform'](_0x1aab69,this[_0x11c048(0x867)]['viewMatrix'],_0x1aab69);const _0x2488a4=new Cesium__namespace['Cartesian4'](_0x1aab69[_0x11c048(_0x315ca4._0x262af5)]['x'],_0x1aab69['normal']['y'],_0x1aab69[_0x11c048(0x5ba)]['z'],_0x1aab69['distance']),_0x4451be=Cesium__namespace['Matrix4']['clone'](this['_virtualCamera']['frustum']['projectionMatrix']),_0x16323c=new Cesium__namespace[(_0x11c048(_0x315ca4._0x4b2789))]((Math['sign'](_0x2488a4['x'])+_0x4451be[0x8])/_0x4451be[0x0],(Math['sign'](_0x2488a4['y'])+_0x4451be[0x9])/_0x4451be[0x5],-0x1,(0x1+_0x4451be[0xa])/_0x4451be[0xe]);Cesium__namespace[_0x11c048(_0x315ca4._0x4b2789)][_0x11c048(_0x315ca4._0x72e849)](_0x2488a4,0x2/Cesium__namespace['Cartesian4']['dot'](_0x2488a4,_0x16323c),_0x2488a4);const _0x1cd6be=0x0;return _0x4451be[0x2]=_0x2488a4['x'],_0x4451be[0x6]=_0x2488a4['y'],_0x4451be[0xa]=_0x2488a4['z']+0x1-_0x1cd6be,_0x4451be[0xe]=_0x2488a4['w'],this[_0x11c048(0x867)]['frustum'][_0x11c048(_0x315ca4._0x2406ed)]=Cesium__namespace[_0x11c048(_0x315ca4._0x4df009)]['clone'](_0x4451be),!![];}[_0x3d5d32(0x556)](){const _0x5f4724={_0x2ccc82:0x5bb,_0x5cc40b:0xb48},_0x183d66=_0x3d5d32,_0xa1c5d9=Cesium__namespace[_0x183d66(_0x5f4724._0x2ccc82)]['eastNorthUpToFixedFrame'](this[_0x183d66(_0x5f4724._0x5cc40b)]),_0x57c57a=Cesium__namespace['Matrix4']['inverse'](_0xa1c5d9,new Cesium__namespace['Matrix4']());return _0x57c57a;}[_0x3d5d32(0x9b6)](_0xf200ac,_0x5c96a7,_0x338422,_0x309f76){const _0x55ec00={_0x3111b3:0x83e,_0x479e19:0xb52,_0x29b837:0x2bb,_0x336963:0xfd0,_0x3d98db:0x6d9},_0x3e2227=_0x3d5d32,_0x55ff33=this['_colorTexture'];if(Cesium__namespace['defined'](_0x55ff33)&&_0x55ff33[_0x3e2227(0x1076)]===_0x5c96a7&&_0x55ff33[_0x3e2227(_0x55ec00._0x3111b3)]===_0x338422&&this['_hdr']===_0x309f76)return;this['_destroyResource'](),this[_0x3e2227(0x550)]=_0x309f76;let _0x31cf8f;_0x309f76?_0x31cf8f=_0xf200ac['halfFloatingPointTexture']?Cesium__namespace[_0x3e2227(_0x55ec00._0x479e19)]['HALF_FLOAT']:Cesium__namespace['PixelDatatype']['FLOAT']:_0x31cf8f=Cesium__namespace['PixelDatatype'][_0x3e2227(0x5f8)],this['_colorTexture']=new Cesium__namespace['Texture']({'context':_0xf200ac,'width':_0x5c96a7,'height':_0x338422,'pixelFormat':Cesium__namespace[_0x3e2227(_0x55ec00._0x29b837)]['RGBA'],'pixelDatatype':_0x31cf8f,'sampler':new Cesium__namespace['Sampler']({'wrapS':Cesium__namespace[_0x3e2227(_0x55ec00._0x336963)]['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace['TextureWrap']['CLAMP_TO_EDGE'],'minificationFilter':Cesium__namespace['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['LINEAR']})}),this['_depthStencilTexture']=new Cesium__namespace['Texture']({'context':_0xf200ac,'width':_0x5c96a7,'height':_0x338422,'pixelFormat':Cesium__namespace['PixelFormat']['DEPTH_STENCIL'],'pixelDatatype':Cesium__namespace['PixelDatatype']['UNSIGNED_INT_24_8']}),this[_0x3e2227(_0x55ec00._0x3d98db)]=new Cesium__namespace['Framebuffer']({'context':_0xf200ac,'colorTextures':[this['_colorTexture']],'depthStencilTexture':this['_depthStencilTexture'],'destroyAttachments':![]});}['_destroyResource'](){const _0x9206a2={_0x16620e:0xd35},_0x4d2878=_0x3d5d32;this['_colorTexture']&&this['_colorTexture'][_0x4d2878(0x689)](),this['_colorTexture']=undefined,this[_0x4d2878(_0x9206a2._0x16620e)]&&this[_0x4d2878(0xd35)]['destroy'](),this['_depthStencilTexture']=undefined,this['_colorFramebuffer']&&this['_colorFramebuffer'][_0x4d2878(0x689)](),this['_colorFramebuffer']=undefined;}['_bindFun'](){const _0x506308={_0x4a2756:0x8fc,_0x2ba777:0xf8c,_0xa1e323:0x40b},_0x5bad0a={_0x147422:0xf5d,_0x571765:0x628,_0x472677:0x585,_0x5aff75:0x208,_0xef053e:0xb10,_0x11122a:0xb84},_0x1fe8dc=_0x3d5d32;this['_UniformState_updateFrustum_old']=Cesium__namespace['UniformState']['prototype'][_0x1fe8dc(_0x506308._0x4a2756)],Cesium__namespace[_0x1fe8dc(0x6f5)][_0x1fe8dc(_0x506308._0x2ba777)]['updateFrustum']=function(_0x2bc355){const _0x2aa932=_0x1fe8dc;Cesium__namespace[_0x2aa932(_0x5bad0a._0x147422)]['clone'](Cesium__namespace['defaultValue'](_0x2bc355[_0x2aa932(0x1075)],_0x2bc355['projectionMatrix']),this['_projection']),this['_inverseProjectionDirty']=!![],this[_0x2aa932(_0x5bad0a._0x571765)]=!![],this['_inverseViewProjectionDirty']=!![],this['_modelViewProjectionDirty']=!![],this['_modelViewProjectionRelativeToEyeDirty']=!![],Cesium__namespace[_0x2aa932(0xb84)](_0x2bc355['infiniteProjectionMatrix'])&&(Cesium__namespace[_0x2aa932(0xf5d)]['clone'](_0x2bc355['infiniteProjectionMatrix'],this['_infiniteProjection']),this['_modelViewInfiniteProjectionDirty']=!![]),this['_currentFrustum']['x']=_0x2bc355[_0x2aa932(_0x5bad0a._0x472677)],this['_currentFrustum']['y']=_0x2bc355['far'],this['_farDepthFromNearPlusOne']=_0x2bc355['far']-_0x2bc355['near']+0x1,this[_0x2aa932(_0x5bad0a._0x5aff75)]=Cesium__namespace[_0x2aa932(0x103e)][_0x2aa932(_0x5bad0a._0xef053e)](this['_farDepthFromNearPlusOne']),this[_0x2aa932(0x383)]=0x1/this['_log2FarDepthFromNearPlusOne'],Cesium__namespace[_0x2aa932(_0x5bad0a._0x11122a)](_0x2bc355[_0x2aa932(0x769)])&&(_0x2bc355=_0x2bc355['_offCenterFrustum']),this['_frustumPlanes']['x']=_0x2bc355['top'],this['_frustumPlanes']['y']=_0x2bc355['bottom'],this['_frustumPlanes']['z']=_0x2bc355['left'],this['_frustumPlanes']['w']=_0x2bc355['right'];};const _0x1b7ce5=Cesium__namespace['PerspectiveFrustum'][_0x1fe8dc(_0x506308._0x2ba777)][_0x1fe8dc(0x315)];Cesium__namespace[_0x1fe8dc(_0x506308._0xa1e323)]['prototype']['clone']=function(_0x57edfd){return _0x57edfd=_0x1b7ce5['bind'](this)(_0x57edfd),_0x57edfd['customProjectionMatrix']=this['customProjectionMatrix'],_0x57edfd;},this['_PerspectiveFrustum_clone_old']=_0x1b7ce5;}['_unbindFun'](){const _0x4b5303=_0x3d5d32;Cesium__namespace['UniformState']['prototype']['updateFrustum']=this[_0x4b5303(0x8a0)],Cesium__namespace['PerspectiveFrustum']['prototype']['clone']=this['_PerspectiveFrustum_clone_old'];}['_getDrawEntityClass'](_0x11f546,_0x1ab6aa){const _0x22c3eb={_0x4defd5:0xa5e},_0x8100b3=_0x3d5d32;return _0x11f546['style']['materialType']=_0x8100b3(_0x22c3eb._0x4defd5),create$4(_0x8100b3(0x104e),_0x11f546);}}register$4('reflectionWater',ReflectionWater);const scratchBackgroundColor=new Cesium__namespace[(_0x3d5d32(0x882))](),renderTilesetPassState=new Cesium__namespace['Cesium3DTilePassState']({'pass':Cesium__namespace['Cesium3DTilePass']['RENDER']});function render(_0x30efad,_0x20f8bd){const _0x551227={_0x2fb817:0x4b6,_0x109c58:0x1023,_0x15f186:0x550,_0xd60c8f:0x882,_0xaacf14:0xe84,_0xb24f4d:0x3f4,_0x2334f0:0xe36,_0x4799ec:0x4ab,_0x54d280:0xdb8,_0xcd1f0a:0xbe4,_0x5e461f:0xf67,_0x224e4f:0x6b6,_0x1d15d2:0xb84,_0x173658:0x3d4},_0x176315=_0x3d5d32,_0x4c4301=_0x30efad[_0x176315(_0x551227._0x2fb817)],_0x2b6cc8=_0x30efad['context'],_0x5c9f58=_0x2b6cc8['uniformState'],_0x44e1fe=_0x30efad['_defaultView'];_0x30efad['_view']=_0x44e1fe,_0x30efad[_0x176315(_0x551227._0x109c58)](),_0x4c4301['passes']['render']=!![],_0x4c4301['passes']['postProcess']=_0x30efad['postProcessStages']['hasSelected'],_0x4c4301['tilesetPassState']=renderTilesetPassState;let _0x4278bc=_0x30efad['backgroundColor']??Cesium__namespace['Color']['BLACK'];_0x30efad[_0x176315(_0x551227._0x15f186)]&&(_0x4278bc=Cesium__namespace[_0x176315(_0x551227._0xd60c8f)]['clone'](_0x4278bc,scratchBackgroundColor),_0x4278bc[_0x176315(_0x551227._0xaacf14)]=Math[_0x176315(0x1fb)](_0x4278bc['red'],_0x30efad[_0x176315(0x313)]),_0x4278bc['green']=Math['pow'](_0x4278bc[_0x176315(0x5a1)],_0x30efad['gamma']),_0x4278bc['blue']=Math[_0x176315(0x1fb)](_0x4278bc['blue'],_0x30efad['gamma']));_0x4c4301['backgroundColor']=_0x4278bc,_0x30efad['fog'][_0x176315(0x635)](_0x4c4301),_0x5c9f58['update'](_0x4c4301);const _0x1e5651=_0x30efad[_0x176315(0x1064)];Cesium__namespace['defined'](_0x1e5651)&&_0x1e5651['enabled']&&(!Cesium__namespace['defined'](_0x30efad['light'])||_0x30efad['light']instanceof Cesium__namespace[_0x176315(_0x551227._0xb24f4d)]?Cesium__namespace['Cartesian3'][_0x176315(0xae9)](_0x5c9f58['sunDirectionWC'],_0x30efad[_0x176315(0x4ab)]['direction']):Cesium__namespace['Cartesian3']['clone'](_0x30efad['light'][_0x176315(_0x551227._0x2334f0)],_0x30efad[_0x176315(_0x551227._0x4799ec)]['direction']),_0x4c4301['shadowMaps']['push'](_0x1e5651));_0x30efad['_computeCommandList']['length']=0x0,_0x30efad['_overlayCommandList']['length']=0x0;const _0x339729=_0x44e1fe['viewport'];_0x339729['x']=0x0,_0x339729['y']=0x0,_0x339729['width']=_0x2b6cc8['drawingBufferWidth'],_0x339729['height']=_0x2b6cc8['drawingBufferHeight'];const _0x297fa3=_0x44e1fe[_0x176315(_0x551227._0x54d280)];_0x297fa3[_0x176315(_0x551227._0xcd1f0a)]=_0x20f8bd,_0x297fa3['blendingEnabled']=undefined,_0x297fa3['scissorTest']=undefined,_0x297fa3[_0x176315(_0x551227._0x5e461f)]=Cesium__namespace[_0x176315(_0x551227._0x224e4f)]['clone'](_0x339729,_0x297fa3[_0x176315(0xf67)]),Cesium__namespace['defined'](_0x30efad['globe'])&&_0x30efad['globe']['beginFrame'](_0x4c4301),_0x30efad['updateEnvironment'](),_0x30efad['updateAndExecuteCommands'](_0x297fa3,_0x4278bc),_0x30efad['resolveFramebuffers'](_0x297fa3),Cesium__namespace[_0x176315(_0x551227._0x1d15d2)](_0x30efad['globe'])&&(_0x30efad['globe']['endFrame'](_0x4c4301),!_0x30efad['globe']['tilesLoaded']&&(_0x30efad[_0x176315(_0x551227._0x173658)]=!![])),_0x2b6cc8['endFrame']();}class EditPolygonGrid extends EditPoly{get['hasClosure'](){const _0x5a9714={_0x26d5f6:0x487},_0x4757e6=_0x3d5d32;return this['_graphic'][_0x4757e6(_0x5a9714._0x26d5f6)]??!![];}get['clampToGround'](){return![];}[_0x3d5d32(0xbc8)](){const _0x44f6bc={_0x248400:0xc84,_0x1c420e:0xf10},_0x1c5aa8={_0x565ee1:0x44c},_0x5cab5b=_0x3d5d32,_0x303067=this[_0x5cab5b(0x6a1)](this['positions']);for(let _0x3e5c26=0x0,_0x19dcf2=_0x303067[_0x5cab5b(_0x44f6bc._0x248400)];_0x3e5c26<_0x19dcf2;_0x3e5c26++){const _0x588ec8=this['updatePositionsHeightByAttr'](_0x303067[_0x3e5c26]),_0x1fed8d=this[_0x5cab5b(_0x44f6bc._0x1c420e)]({'position':_0x588ec8,'onDrag':(_0xaee906,_0xef3d5f)=>{const _0x4eb55b=_0x5cab5b;_0xef3d5f=this['updatePositionsHeightByAttr'](_0xef3d5f),_0xaee906[_0x4eb55b(0xb69)]=_0xef3d5f,_0x303067[_0xaee906[_0x4eb55b(0x5f9)]]=_0xef3d5f,this[_0x4eb55b(_0x1c5aa8._0x565ee1)](_0xef3d5f,_0xaee906['index']);}});_0x1fed8d[_0x5cab5b(0x5f9)]=_0x3e5c26,this['draggers']['push'](_0x1fed8d);}}}const DEF_STYLE$9={'opacity':0x1,'globalAlpha':0x1};class VideoPrimitive extends BasePolyPrimitive{constructor(_0x5eac07={}){const _0x2a52b6={_0x2efaac:0xdde},_0x1eb280=_0x3d5d32;_0x5eac07[_0x1eb280(_0x2a52b6._0x2efaac)]={...DEF_STYLE$9,..._0x5eac07['style']||{}},super(_0x5eac07),this['minPointNum']=0x4,this['maxPointNum']=0x4,this['_grids']=_0x5eac07['grids']??0x4,this['_useROI']=![],this['_reverseROI']=![],this['_roiUV']=[[0x0,0x1],[0x1,0x1],[0x1,0x0],[0x0,0x0]];}get['czmObject'](){const _0x5a73ef=_0x3d5d32;return this[_0x5a73ef(0x517)];}get[_0x3d5d32(0x48c)](){const _0x376829={_0x31ddd1:0x48c},_0x5891e3=_0x3d5d32;return this['options'][_0x5891e3(_0x376829._0x31ddd1)];}set['rois'](_0xf51c64){const _0x2c70e2=_0x3d5d32;this['options'][_0x2c70e2(0x48c)]=_0xf51c64;if((_0xf51c64===null||_0xf51c64===void 0x0?void 0x0:_0xf51c64[_0x2c70e2(0xc84)])>0x0){let _0x1c5930=[];_0xf51c64[_0x2c70e2(0x1061)](_0x541b25=>{const _0x23d9c5=_0x2c70e2;_0x1c5930=_0x1c5930[_0x23d9c5(0xc97)]([_0x541b25[0x0],_0x541b25[0x1],0x0,0x0]);}),this[_0x2c70e2(0x4dd)]=_0x1c5930,this['_useROI']=!![];}else this['_roiUV']=[[0x0,0x1],[0x1,0x1],[0x1,0x0],[0x0,0x0]],this['_useROI']=![];this[_0x2c70e2(0x635)]();}['_addedHook'](_0x6fb2c6){const _0x205cb4={_0x4272c8:0xc84,_0x566f62:0x106d,_0x352ff5:0x517,_0x50e065:0xdf2},_0x311f9b=_0x3d5d32,_0x41df8e=this[_0x311f9b(0xbb8)];if(!this[_0x311f9b(0x792)]||!_0x41df8e||_0x41df8e[_0x311f9b(_0x205cb4._0x4272c8)]===0x0)return;this['updateVideoContainer']();const {positions:_0x2cd30e,uv:_0x24d0e0,indice:_0x161592}=getGridPositions(_0x41df8e,this[_0x311f9b(_0x205cb4._0x566f62)]);this['_positions_grid']=_0x2cd30e,this['_uv']=_0x24d0e0,this['_indice']=_0x161592,this['_primitive']&&(this['primitiveCollection']['remove'](this[_0x311f9b(0x517)]),delete this['_primitive']),this[_0x311f9b(_0x205cb4._0x352ff5)]=this[_0x311f9b(_0x205cb4._0x50e065)](),this['bindPickId'](this['_primitive']),this[_0x311f9b(0x5f4)][_0x311f9b(0xff3)](this['_primitive']);}['_removedHook'](){this['stopEditingGrid'](),this['_primitive']&&(this['primitiveCollection']['remove'](this['_primitive']),delete this['_primitive']);}[_0x3d5d32(0x9ba)](_0x23d671){const _0x19cde9={_0x5ca254:0x226},_0x2f369b=_0x3d5d32;return this['isAdded']&&this['show']&&this[_0x2f369b(_0x19cde9._0x5ca254)](_0x23d671||this['style']),this;}['update'](){const _0x1882c9=_0x3d5d32;this['_primitive']&&this[_0x1882c9(0x5f4)][_0x1882c9(0xf06)](this['_primitive']),this[_0x1882c9(0x517)]=this['_createVideoPrimitive'](),this['primitiveCollection']['add'](this['_primitive']);}[_0x3d5d32(0xdf2)](){const _0x131a56={_0x4c119a:0x72b,_0x4f45a8:0xf0e,_0x55afd0:0xa61,_0x45db9d:0xc6b,_0x2650d7:0xfe3,_0x37d033:0x4dd,_0x49d077:0x5cb,_0x2140ac:0xd9c,_0x594d1c:0xfdc,_0x19857c:0xdde},_0x2245c4=_0x3d5d32,_0x5d9342=this['_positions_grid'][_0x2245c4(0xc84)],_0x459c2d=new Float64Array(_0x5d9342*0x3);for(let _0x57a8fd=0x0;_0x57a8fd<_0x5d9342;++_0x57a8fd){_0x459c2d[_0x57a8fd*0x3]=this['_positions_grid'][_0x57a8fd]['x'],_0x459c2d[_0x57a8fd*0x3+0x1]=this['_positions_grid'][_0x57a8fd]['y'],_0x459c2d[_0x57a8fd*0x3+0x2]=this[_0x2245c4(_0x131a56._0x4c119a)][_0x57a8fd]['z'];}const _0x5ba4d1=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace[(_0x2245c4(_0x131a56._0x4f45a8))]({'componentDatatype':Cesium__namespace[_0x2245c4(0x3ac)]['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x459c2d}),'st':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array(this['_uv'])})},'indices':new Uint16Array(this['_indice']),'primitiveType':Cesium__namespace[_0x2245c4(0xb1a)]['TRIANGLES'],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x459c2d)}),_0x7cc9d7=new Cesium__namespace[(_0x2245c4(0x263))]({'id':this['id'],'geometry':_0x5ba4d1,'attributes':{'show':new Cesium__namespace['ShowGeometryInstanceAttribute'](this['show']),'distanceDisplayCondition':new Cesium__namespace[(_0x2245c4(_0x131a56._0x55afd0))](Number(this[_0x2245c4(0xdde)]['distanceDisplayCondition_near']??0x0),Number(this['style'][_0x2245c4(0xc42)]??Number['MAX_VALUE']))}}),_0x534656=Cesium__namespace[_0x2245c4(_0x131a56._0x45db9d)]['fromType']('Image');_0x534656[_0x2245c4(_0x131a56._0x2650d7)]['image']=this['_videoContainer'];const _0x3fb5f4=new Float32Array(this[_0x2245c4(_0x131a56._0x37d033)]),_0x570cee=_0x3fb5f4['length']/0x4;_0x534656[_0x2245c4(_0x131a56._0x2650d7)][_0x2245c4(_0x131a56._0x49d077)]=new Cesium__namespace['Texture']({'context':this['_map'][_0x2245c4(0xfc1)]['context'],'source':{'width':_0x570cee,'height':0x1,'arrayBufferView':_0x3fb5f4},'pixelDatatype':Cesium__namespace['PixelDatatype']['FLOAT']}),_0x534656['_uniforms']['roiUV0']=()=>{return _0x534656['uniforms']['roiUV'];},_0x534656[_0x2245c4(_0x131a56._0x2140ac)]['useROI']=()=>{return this['_useROI'];},_0x534656['_uniforms']['reverseROI']=()=>{return this['_reverseROI'];},_0x534656['_uniforms'][_0x2245c4(_0x131a56._0x594d1c)]=()=>{return this['style']['opacity'];},_0x534656['_uniforms']['globalAlpha']=()=>{return this['style']['globalAlpha']??0x1;},_0x534656['shaderSource']='\x0a\x20\x20\x20\x20\x20\x20const\x20int\x20WIDTH\x20=\x20'+_0x570cee+';\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20image_0;\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20roiUV0;\x0a\x20\x20\x20\x20\x20\x20uniform\x20bool\x20useROI;\x0a\x20\x20\x20\x20\x20\x20uniform\x20bool\x20reverseROI;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20opacity;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20globalAlpha;\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20获取指定的由UV坐标定义的poi边界点\x0a\x20\x20\x20\x20\x20\x20vec2\x20getROIuv(sampler2D\x20roi,\x20int\x20index){\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20poiuv\x20=\x20texture(roi,\x20vec2((float(index)\x20+\x200.5)\x20/\x20float(WIDTH),\x200)).xy;\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20poiuv;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20判断UV坐标在不在范围内\x0a\x20\x20\x20\x20\x20\x20bool\x20isInside(vec2\x20uv,\x20sampler2D\x20roi){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bool\x20ifInside\x20=\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20uv.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20uv.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20sP\x20=\x20getROIuv(roi,\x200);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for\x20(int\x20i\x20=\x200;\x20i\x20<\x20100000;\x20i++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(i\x20>=\x20WIDTH)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20i\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20nextIndex\x20==\x20WIDTH\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20eP\x20=\x20getROIuv(roi,\x20nextIndex);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((sP.x\x20==\x20u\x20&&\x20sP.y\x20==\x20v)\x20||\x20(eP.x\x20==\x20u\x20&&\x20eP.y\x20==\x20v)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if((sP.y\x20<\x20v\x20&&\x20eP.y\x20>=\x20v)\x20||\x20(sP.y\x20>=\x20v\x20&&\x20eP.y\x20<\x20v))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20x\x20=\x20sP.x\x20+\x20(v\x20-\x20sP.y)\x20*\x20(eP.x\x20-\x20sP.x)\x20/\x20(eP.y\x20-\x20sP.y);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(x\x20==\x20u){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if(x\x20>\x20u)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ifInside\x20=\x20!ifInside;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sP\x20=\x20eP;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20ifInside;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20czm_material\x20getMaterial(czm_materialInput\x20materialInput){\x0a\x20\x20\x20\x20\x20\x20\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20imageColor\x20=\x20texture(image_0,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20imageColor.rgb;\x0a\x20\x20\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20imageColor.a\x20*\x20opacity\x20*\x20globalAlpha;\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20material;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(useROI){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bool\x20inside\x20=\x20isInside(uv,\x20roiUV0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(inside\x20!=\x20reverseROI)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20getMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20getMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20';const _0x3655ba={'geometryInstances':_0x7cc9d7,'asynchronous':![],'appearance':new Cesium__namespace['MaterialAppearance']({...this[_0x2245c4(_0x131a56._0x19857c)],'material':_0x534656})},_0x503869=new Cesium__namespace['Primitive'](_0x3655ba);return this['bindPickId'](_0x503869),_0x503869;}['updateVideoContainer'](){const _0xff3857={_0x79a30:0x20c,_0x1590e8:0xdde,_0x38d9f6:0xdde,_0x38ccf7:0x72e,_0x43eb6c:0x522},_0xefdcf5=_0x3d5d32;var _0x22a447;this['_hasRemoveElement']&&(_0x22a447=this[_0xefdcf5(_0xff3857._0x79a30)])!==null&&_0x22a447!==void 0x0&&_0x22a447[_0xefdcf5(0x225)]&&(this[_0xefdcf5(0x20c)]['parentNode'][_0xefdcf5(0xac2)](this[_0xefdcf5(0x20c)]),delete this['_hasRemoveElement'],delete this[_0xefdcf5(0x20c)]);if(this[_0xefdcf5(_0xff3857._0x1590e8)]['url'])this['_videoContainer']=createVideo(this[_0xefdcf5(_0xff3857._0x38d9f6)]['url'],this[_0xefdcf5(0xdde)]['fileType'],'',document['body']),this['_videoContainer']['style'][_0xefdcf5(0xd92)]=_0xefdcf5(_0xff3857._0x38ccf7),this[_0xefdcf5(_0xff3857._0x43eb6c)]=!![];else this['style']['container']&&(this['_videoContainer']=this[_0xefdcf5(0xdde)]['container']);}['_getDrawEntityClass'](_0x4dbc86,_0xbe4074){const _0x19127a={_0x337e2e:0xe16},_0x3e0fc8=_0x3d5d32;_0x4dbc86['minPointNum']=0x4,_0x4dbc86[_0x3e0fc8(0xa9c)]=0x4,_0x4dbc86['style']['materialType']='Image',_0x4dbc86[_0x3e0fc8(0xdde)][_0x3e0fc8(_0x19127a._0x337e2e)]={'url':this[_0x3e0fc8(0x20c)]};const _0x17905f=create$4('polygon',_0x4dbc86);return _0x17905f;}[_0x3d5d32(0x414)](_0x1a813a){const _0x1f6734={_0x33aabb:0x9b2},_0x50c364=_0x3d5d32;this['_hierarchy']&&(_0x1a813a[_0x50c364(_0x1f6734._0x33aabb)]=this['_hierarchy']);}get['isEditingGrid'](){return this['_enabledEditGrid'];}[_0x3d5d32(0xe96)](){const _0x1ee54b={_0x3da33a:0x7d0,_0x30ed54:0x49a,_0x3d69d5:0x1d1,_0x44c2fc:0x276},_0x398491=_0x3d5d32;if(this[_0x398491(_0x1ee54b._0x3da33a)])return this;this['_enabledEditGrid']=!![];if(!this['_map'])throw new Error(_0x398491(0xfc0));this['stopEditing'](),this['_map'][_0x398491(_0x1ee54b._0x30ed54)]['noPickEntity']=this['_entity'],this[_0x398491(_0x1ee54b._0x3d69d5)]['mouseEvent'][_0x398491(_0x1ee54b._0x44c2fc)]=![],!this[_0x398491(0x8ce)]&&(this[_0x398491(0x8ce)]=new EditPolygonGrid(this),this['editingGrid']['getGridPositions']=_0x452387=>{const _0x5797e1=_0x398491;return this[_0x5797e1(0x72b)];},this[_0x398491(0x8ce)]['updateGridPositions']=(_0x46cadf,_0x4b5439)=>{this['_positions_grid'][_0x4b5439]=_0x46cadf,this['update']();}),this[_0x398491(0x8ce)]['activate']&&this['editingGrid']['activate']();}['stopEditingGrid'](){const _0x58651e={_0xdd4493:0x8ce,_0x31abab:0x1d1,_0x4451a1:0xc62,_0x4b334b:0x49a},_0x1fe912=_0x3d5d32;var _0x4d5356;if(!this['_enabledEditGrid']||!this['isAdded'])return this;(_0x4d5356=this[_0x1fe912(_0x58651e._0xdd4493)])!==null&&_0x4d5356!==void 0x0&&_0x4d5356['disable']&&this['editingGrid'][_0x1fe912(0xf9e)](),this['_map']&&(this[_0x1fe912(_0x58651e._0x31abab)][_0x1fe912(_0x58651e._0x4451a1)](),this['_map']['mouseEvent']['noPickEntity']=null,this['_map'][_0x1fe912(_0x58651e._0x4b334b)]['enabledMoveTarget']=!![]),this['_enabledEditGrid']=![];}}register$4('videoPrimitive',VideoPrimitive);function getGridPositions(_0x43936d,_0x1ca677){const _0x141c0e={_0xb6b9d3:0xd97,_0x3b60cf:0xff3,_0x435386:0xe95,_0x521c9e:0xd97,_0x149b5d:0xe95,_0x3b3772:0xff3},_0x33a64d=_0x3d5d32,_0x2a9294=[],_0x4f53fa=[],_0x4ad086=[],_0x3e4069=_0x43936d[0x0],_0x38c053=_0x43936d[0x1],_0x100cb0=_0x43936d[0x2],_0x1f0c05=_0x43936d[0x3],_0x271700=Cesium__namespace['Cartesian3']['distance'](_0x3e4069,_0x1f0c05),_0x60d0e6=Cesium__namespace['Cartesian3']['distance'](_0x38c053,_0x100cb0),_0x40cc69=_0x271700/_0x1ca677,_0x4becf4=_0x60d0e6/_0x1ca677,_0x5d106c=Cesium__namespace[_0x33a64d(0xe95)]['normalize'](Cesium__namespace['Cartesian3']['subtract'](_0x1f0c05,_0x3e4069,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x5030db=Cesium__namespace['Cartesian3'][_0x33a64d(0xf69)](Cesium__namespace['Cartesian3'][_0x33a64d(_0x141c0e._0xb6b9d3)](_0x100cb0,_0x38c053,new Cesium__namespace['Cartesian3']()),new Cesium__namespace['Cartesian3']()),_0x113f66=0x1/_0x1ca677;for(let _0x3a4493=0x0;_0x3a4493<=_0x1ca677;_0x3a4493++){for(let _0x509176=0x0;_0x509176<=_0x1ca677;_0x509176++){const _0xfb5bb3=Cesium__namespace['Cartesian3'][_0x33a64d(_0x141c0e._0x3b60cf)](Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x5d106c,_0x3a4493*_0x40cc69,new Cesium__namespace['Cartesian3']()),_0x3e4069,new Cesium__namespace['Cartesian3']()),_0x1524c2=Cesium__namespace['Cartesian3']['add'](Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x5030db,_0x3a4493*_0x4becf4,new Cesium__namespace[(_0x33a64d(_0x141c0e._0x435386))]()),_0x38c053,new Cesium__namespace[(_0x33a64d(0xe95))]()),_0x3d9fe1=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3'][_0x33a64d(_0x141c0e._0x521c9e)](_0x1524c2,_0xfb5bb3,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x33a64d(_0x141c0e._0x149b5d))]()),_0x2359d0=Cesium__namespace['Cartesian3']['distance'](_0x1524c2,_0xfb5bb3),_0x24ecdb=_0x2359d0/_0x1ca677,_0x52630c=Cesium__namespace[_0x33a64d(0xe95)][_0x33a64d(_0x141c0e._0x3b3772)](Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x3d9fe1,_0x509176*_0x24ecdb,new Cesium__namespace['Cartesian3']()),_0xfb5bb3,new Cesium__namespace['Cartesian3']());_0x2a9294['push'](_0x509176*_0x113f66),_0x2a9294['push'](0x1-_0x3a4493*_0x113f66),_0x4f53fa['push'](_0x52630c);}}for(let _0x2a7aa2=0x0;_0x2a7aa2<_0x1ca677;_0x2a7aa2++){for(let _0x5a9d08=0x0;_0x5a9d08<_0x1ca677;_0x5a9d08++){const _0x3a950f=_0x2a7aa2*(_0x1ca677+0x1)+_0x5a9d08,_0x83a42b=(_0x2a7aa2+0x1)*(_0x1ca677+0x1)+_0x5a9d08;_0x4ad086['push'](_0x3a950f),_0x4ad086['push'](_0x3a950f+0x1),_0x4ad086['push'](_0x83a42b+0x1),_0x4ad086['push'](_0x83a42b+0x1),_0x4ad086['push'](_0x83a42b),_0x4ad086['push'](_0x3a950f);}}return{'uv':_0x2a9294,'indice':_0x4ad086,'positions':_0x4f53fa};}class BaseCombine extends BasePrimitive{get['instances'](){const _0x3aaa28=_0x3d5d32;return this['options'][_0x3aaa28(0x789)]||[];}set['instances'](_0x282966){const _0x31ae51={_0x23be8c:0x789},_0x2b05ac=_0x3d5d32;this['options'][_0x2b05ac(_0x31ae51._0x23be8c)]=_0x282966,this['_rectangle']=null,this[_0x2b05ac(0x9ba)]();}['getPickedObject'](_0x5041ec){const _0x41d616=_0x5041ec['split']('#');if(_0x41d616['length']!==0x2)return null;const _0x524f97=Number(_0x41d616[0x1]);return this['instances'][_0x524f97];}['createPickId'](_0x429c35){return this['id']+'#'+_0x429c35;}[_0x3d5d32(0xc66)](_0x16389c,_0x399d18){const _0x168a04=_0x3d5d32;if(this['options']['geometryInstances'])return this['options']['geometryInstances'];const _0x553ace=[],_0x5efba1=this['instances'];for(let _0x5ecf7f=0x0;_0x5ecf7f<_0x5efba1[_0x168a04(0xc84)];_0x5ecf7f++){const _0x5abfdc=_0x5efba1[_0x5ecf7f];_0x5abfdc['id']=this['createPickId'](_0x5ecf7f),_0x553ace['push'](_0x5abfdc);}return _0x553ace;}['getRectangle'](_0x237411){const _0x2b44f5={_0x12f018:0xbb8,_0x37df58:0x570},_0x38d84b=_0x3d5d32;if(!this['_rectangle']){const _0x463aeb=this[_0x38d84b(0x433)][_0x38d84b(0x789)]||[];for(let _0x17f81b=0x0;_0x17f81b<_0x463aeb['length'];_0x17f81b++){const _0x34723f=_0x463aeb[_0x17f81b];_0x34723f['position']&&(_0x34723f['position']=LngLatPoint['parse'](_0x34723f['position'])['toCartesian'](),this['_unionRectangle']([_0x34723f['position']])),_0x34723f[_0x38d84b(_0x2b44f5._0x12f018)]&&(_0x34723f['positions']=LngLatArray['toCartesians'](_0x34723f['positions']),this['_unionRectangle'](_0x34723f['positions']));}}return _0x237411!==null&&_0x237411!==void 0x0&&_0x237411['isFormat']?formatRectangle(this['_rectangle']):this[_0x38d84b(_0x2b44f5._0x37df58)];}[_0x3d5d32(0xf2c)](_0x4c299f){const _0x2bffc5={_0x10ff9f:0xeb1,_0x72d510:0xb84,_0x39e143:0xb84,_0x43856c:0xded},_0x29e166=_0x3d5d32,_0x238185=Cesium__namespace['Rectangle'][_0x29e166(_0x2bffc5._0x10ff9f)](_0x4c299f);if(!Cesium__namespace[_0x29e166(_0x2bffc5._0x72d510)](_0x238185))return;Cesium__namespace[_0x29e166(_0x2bffc5._0x39e143)](this['_rectangle'])?this['_rectangle']=Cesium__namespace[_0x29e166(0x756)][_0x29e166(_0x2bffc5._0x43856c)](_0x238185,this[_0x29e166(0x570)]):this['_rectangle']=_0x238185;}['toJSON'](){const _0x3e5cbf={_0x210365:0x433,_0x14f63f:0xdde,_0x376ec8:0xdde,_0x4ad4a0:0xbb8,_0x20f80e:0xb75},_0x46d8fa=_0x3d5d32,_0x2f19f0={...getAttrVal(this['options'],{'onlySimpleType':!![]}),'type':this['type']};this[_0x46d8fa(_0x3e5cbf._0x210365)]['style']&&(_0x2f19f0[_0x46d8fa(_0x3e5cbf._0x14f63f)]=this['_style2JsonBase'](this['options'][_0x46d8fa(_0x3e5cbf._0x376ec8)],![]));const _0x3e336f=[];for(let _0x2e47a6=0x0;_0x2e47a60x0&&this[_0x44658c(0x433)]['instances'][0x0]['style'][_0x44658c(_0x6f3c27._0xf98e63)]?this[_0x44658c(_0x6f3c27._0x4c07d5)]=_0x4a41ae*this['options']['instances'][0x0][_0x44658c(0xdde)]['width']:this[_0x44658c(_0x6f3c27._0x4c07d5)]=_0x4a41ae*this['options']['style'][_0x44658c(0x1076)],this['textures']={},this['textureDef']=new Cesium__namespace[(_0x44658c(0x979))]({'context':this[_0x44658c(0x1d1)][_0x44658c(0xfc1)]['context'],'width':0x1f4,'height':0x1f4}),this['options'][_0x44658c(_0x6f3c27._0x3244e8)]&&this['redraw'](),this['_map']['on'](EventType['morphComplete'],this[_0x44658c(_0x6f3c27._0x55a393)],this),this[_0x44658c(0x5f4)][_0x44658c(0xff3)](this);}['_removedHook'](){const _0x3df627={_0x4f88c7:0x689,_0x1dde9b:0x100f,_0x529aa3:0x5f4},_0x5d982d=_0x3d5d32;this['_map']['off'](EventType['morphComplete'],this['_onMorphComplete'],this),this['clear'](),this['textureDef'][_0x5d982d(_0x3df627._0x4f88c7)](),delete this[_0x5d982d(0x693)],this[_0x5d982d(_0x3df627._0x1dde9b)]=!![],this[_0x5d982d(_0x3df627._0x529aa3)]['remove'](this),this['_noDestroy']=![];}[_0x3d5d32(0x76d)](){this['_removeCollectionBy2D'](),this['_removeCollectionBy3D']();}['redraw'](){const _0x3c847f={_0x9c5af1:0xed4,_0x16e106:0xb69,_0x1b373c:0x1d1,_0x87a45b:0xfc1},_0x344cc1=_0x3d5d32;if(!this['_map'])return;this['clear']();const _0x51ee51=this['instances'];if(_0x51ee51)for(let _0x1e0fdd=0x0,_0x4dadd2=_0x51ee51['length'];_0x1e0fdd<_0x4dadd2;_0x1e0fdd++){const _0x3578c6=_0x51ee51[_0x1e0fdd];_0x3578c6['position']=LngLatPoint[_0x344cc1(_0x3c847f._0x9c5af1)](_0x3578c6[_0x344cc1(_0x3c847f._0x16e106)]);}this[_0x344cc1(_0x3c847f._0x1b373c)][_0x344cc1(_0x3c847f._0x87a45b)]['mode']===Cesium__namespace[_0x344cc1(0xb22)]['SCENE3D']?this['_initCollectionBy3D']():this['_initCollectionBy2D']();}[_0x3d5d32(0xbf0)](_0x201881){const _0x39cbc2=_0x3d5d32;this[_0x39cbc2(0x9ba)]();}[_0x3d5d32(0x635)](_0x161b6c){const _0x18b052={_0x1ce3e2:0xc34,_0x38bc2a:0x462,_0x30317c:0xa13},_0x143076=_0x3d5d32;if(!this[_0x143076(0x1d1)])return;if(!this['show']){this[_0x143076(_0x18b052._0x1ce3e2)]();return;}_0x161b6c['mode']===Cesium__namespace['SceneMode']['SCENE3D']?_0x161b6c['passes']['render']?this['_drawCommands']&&_0x161b6c['commandList']['push'](...this['_drawCommands']):this[_0x143076(_0x18b052._0x38bc2a)]&&_0x161b6c['commandList']['push'](...this[_0x143076(_0x18b052._0x38bc2a)]):!this[_0x143076(_0x18b052._0x30317c)]&&this['_initCollectionBy2D']();}[_0x3d5d32(0xc2b)](){const _0x3d8302=_0x3d5d32,_0x337f0d=this['instances'];if(!_0x337f0d)return;this['_billboard2DList']=[];for(let _0x2c8ad3=0x0,_0x2849ed=_0x337f0d['length'];_0x2c8ad3<_0x2849ed;_0x2c8ad3++){const _0x13b87f=_0x337f0d[_0x2c8ad3],_0x178e39={...this['options']['style'],..._0x13b87f['style']},_0x4f46f5=this['billboardCollection']['add']({'id':this['createPickId'](_0x2c8ad3),'position':_0x13b87f[_0x3d8302(0xb69)],'image':_0x178e39[_0x3d8302(0x8e1)],'scale':0x1,'rotation':Cesium__namespace['Math'][_0x3d8302(0x562)](_0x178e39['angle']||0x0),'width':_0x178e39['width'],'height':_0x178e39['height']||_0x178e39['width']});this['bindPickId'](_0x4f46f5),this[_0x3d8302(0xf31)][_0x3d8302(0xb75)](_0x4f46f5);}}['_removeCollectionBy2D'](){const _0x81bfaa=_0x3d5d32;if(!this['billboardCollection']||!this[_0x81bfaa(0xf31)])return;for(let _0x2eed40=this['_billboard2DList']['length']-0x1;_0x2eed40>=0x0;_0x2eed40--){const _0x37cb99=this[_0x81bfaa(0xf31)][_0x2eed40];this['billboardCollection']['remove'](_0x37cb99);}this['_billboard2DList']=[];}['_initCollectionBy3D'](){const _0x329201={_0xcef23:0xdde},_0x3a69ef=_0x3d5d32,_0x3aa6bc=this['instances'];if(!_0x3aa6bc)return;const _0x260bc4={};for(let _0x22878e=0x0,_0x17de0e=_0x3aa6bc['length'];_0x22878e<_0x17de0e;_0x22878e++){var _0x3b7001;const _0x1e695e=_0x3aa6bc[_0x22878e];_0x1e695e['index']=_0x22878e;const _0x383a09=(_0x3b7001=_0x1e695e[_0x3a69ef(_0x329201._0xcef23)])===null||_0x3b7001===void 0x0?void 0x0:_0x3b7001['image'];if(!_0x383a09)continue;!_0x260bc4[_0x383a09]&&(_0x260bc4[_0x383a09]=[]),_0x260bc4[_0x383a09]['push'](_0x1e695e);}const _0x32490a=[];for(const _0x4d33de in _0x260bc4){const _0x5f27ca=_0x260bc4[_0x4d33de],_0x3aedfa=_0x4d33de;this[_0x3a69ef(0xdbd)](_0x3aedfa);for(const _0x924a60 of _0x5f27ca){const _0x36b523=this[_0x3a69ef(0x23e)](_0x3aedfa,_0x924a60);_0x32490a['push'](_0x36b523);}}this['_drawCommands']=_0x32490a;}['_removeCollectionBy3D'](){const _0x5a11f3={_0x4235be:0x250},_0x3d82d1=_0x3d5d32;this[_0x3d82d1(0x250)]&&this['_drawCommands']['length']>0x0&&(this[_0x3d82d1(0x250)][_0x3d82d1(0x1061)](function(_0x37f36d){_0x37f36d['vertexArray']&&_0x37f36d['vertexArray']['destroy'](),_0x37f36d['shaderProgram']&&_0x37f36d['shaderProgram']['destroy']();}),delete this[_0x3d82d1(_0x5a11f3._0x4235be)]);this['_pickCommands']&&this['_pickCommands']['length']>0x0&&(this['_pickCommands']['forEach'](function(_0x3df228){_0x3df228['vertexArray']&&_0x3df228['vertexArray']['destroy'](),_0x3df228['shaderProgram']&&_0x3df228['shaderProgram']['destroy']();}),delete this['_pickCommands']);for(const _0x327cbc in this['textures']){this['textures'][_0x327cbc]&&this[_0x3d82d1(0xe22)][_0x327cbc]['destroy']();}this['textures']={};}['prepareTexture'](_0x1a603e){const _0xd8901={_0x4eed42:0xe22},_0x55e76f=_0x3d5d32,_0x520292=new Image();_0x520292[_0x55e76f(0x3b1)]=_0x4eed3c=>{const _0x10fe18=_0x55e76f,_0xec6608=new Cesium__namespace['Texture']({'context':this['_map']['scene']['context'],'source':_0x520292});this[_0x10fe18(_0xd8901._0x4eed42)][_0x1a603e]=_0xec6608;},_0x520292['src']=_0x1a603e;}['prepareVAO'](_0x344fcb){const _0x24f2aa={_0x3aaafe:0xdde,_0x150357:0xb75,_0x4ee785:0xb75,_0x54c561:0x247,_0x6f7b96:0x9dc,_0x33e5a7:0xd06,_0x477325:0x34e,_0x4f7924:0x34e},_0x3b22d2=_0x3d5d32,_0x2e57ab=[],_0x159b0e=[],_0x737451=[],_0x475234=[],_0x4e17a0=[];for(let _0x28e28d=0x0,_0x24022f=_0x344fcb['length'];_0x28e28d<_0x24022f;_0x28e28d++){const _0xc1b2ef=_0x344fcb[_0x28e28d],_0x44b39e=_0xc1b2ef['position'],_0x4f76a5={...this['options'][_0x3b22d2(_0x24f2aa._0x3aaafe)],..._0xc1b2ef['style']};_0x737451['push'](_0x28e28d*0x4+0x0),_0x737451['push'](_0x28e28d*0x4+0x2),_0x737451[_0x3b22d2(_0x24f2aa._0x150357)](_0x28e28d*0x4+0x1),_0x737451['push'](_0x28e28d*0x4+0x0),_0x737451['push'](_0x28e28d*0x4+0x3),_0x737451['push'](_0x28e28d*0x4+0x2);const _0x4995d7=new Float32Array(0x6);_0x4995d7[0x0]=_0x44b39e['x'],_0x4995d7[0x1]=_0x44b39e['x']-_0x4995d7[0x0],_0x4995d7[0x2]=_0x44b39e['y'],_0x4995d7[0x3]=_0x44b39e['y']-_0x4995d7[0x2],_0x4995d7[0x4]=_0x44b39e['z'],_0x4995d7[0x5]=_0x44b39e['z']-_0x4995d7[0x4],_0x2e57ab['push'](_0x4995d7[0x0]),_0x2e57ab['push'](_0x4995d7[0x2]),_0x2e57ab[_0x3b22d2(_0x24f2aa._0x4ee785)](_0x4995d7[0x4]),_0x159b0e['push'](_0x4995d7[0x1]),_0x159b0e['push'](_0x4995d7[0x3]),_0x159b0e[_0x3b22d2(0xb75)](_0x4995d7[0x5]),_0x2e57ab['push'](_0x4995d7[0x0]),_0x2e57ab['push'](_0x4995d7[0x2]),_0x2e57ab[_0x3b22d2(0xb75)](_0x4995d7[0x4]),_0x159b0e['push'](_0x4995d7[0x1]),_0x159b0e['push'](_0x4995d7[0x3]),_0x159b0e[_0x3b22d2(_0x24f2aa._0x150357)](_0x4995d7[0x5]),_0x2e57ab['push'](_0x4995d7[0x0]),_0x2e57ab[_0x3b22d2(_0x24f2aa._0x4ee785)](_0x4995d7[0x2]),_0x2e57ab[_0x3b22d2(0xb75)](_0x4995d7[0x4]),_0x159b0e['push'](_0x4995d7[0x1]),_0x159b0e['push'](_0x4995d7[0x3]),_0x159b0e['push'](_0x4995d7[0x5]),_0x2e57ab['push'](_0x4995d7[0x0]),_0x2e57ab['push'](_0x4995d7[0x2]),_0x2e57ab['push'](_0x4995d7[0x4]),_0x159b0e[_0x3b22d2(0xb75)](_0x4995d7[0x1]),_0x159b0e['push'](_0x4995d7[0x3]),_0x159b0e[_0x3b22d2(0xb75)](_0x4995d7[0x5]),_0x475234[_0x3b22d2(0xb75)](0x0,0x0),_0x475234['push'](0x0,0x1),_0x475234['push'](0x1,0x1),_0x475234['push'](0x1,0x0);const _0x113062=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x44b39e),_0x3c7474=_0x4f76a5[_0x3b22d2(_0x24f2aa._0x54c561)]||0x0,_0xc64f08=Cesium__namespace[_0x3b22d2(_0x24f2aa._0x6f7b96)]['fromRotationZ'](Cesium__namespace['Math'][_0x3b22d2(0x562)](_0x3c7474)),_0x2c3cf8=Cesium__namespace['Matrix4']['fromRotationTranslation'](_0xc64f08),_0x1fc246=Cesium__namespace[_0x3b22d2(0xf5d)]['multiply'](_0x113062,_0x2c3cf8,new Cesium__namespace['Matrix4']()),_0x205634=0x1,_0x48cb32=(_0x4f76a5['height']||_0x4f76a5['width'])/_0x4f76a5['width'],_0x303dc4=new Cesium__namespace['Cartesian3'](-_0x205634,-_0x48cb32,0x0);Cesium__namespace['Matrix4'][_0x3b22d2(_0x24f2aa._0x33e5a7)](_0x1fc246,_0x303dc4,_0x303dc4),Cesium__namespace['Cartesian3']['normalize'](_0x303dc4,_0x303dc4),_0x4e17a0[_0x3b22d2(_0x24f2aa._0x4ee785)](_0x303dc4['x'],_0x303dc4['y'],_0x303dc4['z']);const _0x1fe650=new Cesium__namespace['Cartesian3'](-_0x205634,_0x48cb32,0x0);Cesium__namespace['Matrix4'][_0x3b22d2(0xd06)](_0x1fc246,_0x1fe650,_0x1fe650),Cesium__namespace['Cartesian3']['normalize'](_0x1fe650,_0x1fe650),_0x4e17a0['push'](_0x1fe650['x'],_0x1fe650['y'],_0x1fe650['z']);const _0x3eb23d=new Cesium__namespace[(_0x3b22d2(0xe95))](_0x205634,_0x48cb32,0x0);Cesium__namespace['Matrix4'][_0x3b22d2(0xd06)](_0x1fc246,_0x3eb23d,_0x3eb23d),Cesium__namespace['Cartesian3']['normalize'](_0x3eb23d,_0x3eb23d),_0x4e17a0['push'](_0x3eb23d['x'],_0x3eb23d['y'],_0x3eb23d['z']);const _0x4cf999=new Cesium__namespace['Cartesian3'](_0x205634,-_0x48cb32,0x0);Cesium__namespace[_0x3b22d2(0xf5d)]['multiplyByPointAsVector'](_0x1fc246,_0x4cf999,_0x4cf999),Cesium__namespace['Cartesian3']['normalize'](_0x4cf999,_0x4cf999),_0x4e17a0['push'](_0x4cf999['x'],_0x4cf999['y'],_0x4cf999['z']);}return{'index':new Uint16Array(_0x737451),'vertex_H':{'values':new Float32Array(_0x2e57ab),'componentDatatype':'DOUBLE','componentsPerAttribute':0x3},'vertex_L':{'values':new Float32Array(_0x159b0e),'componentDatatype':'DOUBLE','componentsPerAttribute':0x3},'uv':{'values':new Float32Array(_0x475234),'componentDatatype':_0x3b22d2(_0x24f2aa._0x477325),'componentsPerAttribute':0x2},'color':{'values':new Float32Array(_0x4e17a0),'componentDatatype':_0x3b22d2(_0x24f2aa._0x4f7924),'componentsPerAttribute':0x3}};}['createDrawCommand'](_0x177339,_0x3f829b){const _0x151985={_0x2307d5:0xa07,_0x31f9df:0x805,_0x2fc432:0xf5d,_0x38d4ae:0xc6f,_0x3e06f4:0x5f9,_0x4a87bf:0xb8c,_0x2e9506:0x5b0,_0x242aae:0x65b},_0x3ad59d={_0x58aadd:0x769,_0x35f216:0x389},_0x38fb0f=_0x3d5d32,_0x2ebc20=this['_map'][_0x38fb0f(0xfc1)]['context'],_0x179eed=this['options']['translucent']??![],_0x16d2bc=Cesium__namespace[_0x38fb0f(0x9ca)]['fromCache']({'depthTest':{'enabled':!![],'func':_0x179eed?Cesium__namespace['WebGLConstants']['LEQUAL']:Cesium__namespace['WebGLConstants']['LESS']},'depthMask':_0x179eed,'blending':Cesium__namespace['BlendingState'][_0x38fb0f(0x626)]}),_0x298959={'position3DHigh':0x0,'position3DLow':0x1,'color':0x2,'st':0x3},_0x325aac=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x2ebc20,'vertexShaderSource':FlatBillboardVS,'fragmentShaderSource':FlatBillboardFS,'attributeLocations':_0x298959}),_0x2b7a7a=this['prepareVAO']([_0x3f829b]),_0x27ffd1=Cesium__namespace['Buffer']['createIndexBuffer']({'context':_0x2ebc20,'typedArray':_0x2b7a7a['index'],'usage':Cesium__namespace['BufferUsage'][_0x38fb0f(0x1012)],'indexDatatype':Cesium__namespace['IndexDatatype'][_0x38fb0f(0x935)]}),_0x2d2378=new Cesium__namespace['VertexArray']({'context':_0x2ebc20,'attributes':[{'index':0x0,'vertexBuffer':Cesium__namespace[_0x38fb0f(0x805)]['createVertexBuffer']({'context':_0x2ebc20,'typedArray':_0x2b7a7a['vertex_H'][_0x38fb0f(_0x151985._0x2307d5)],'usage':Cesium__namespace['BufferUsage'][_0x38fb0f(0x1012)]}),'componentsPerAttribute':0x3},{'index':0x1,'vertexBuffer':Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x2ebc20,'typedArray':_0x2b7a7a['vertex_L'][_0x38fb0f(0xa07)],'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),'componentsPerAttribute':0x3},{'index':0x2,'vertexBuffer':Cesium__namespace[_0x38fb0f(_0x151985._0x31f9df)]['createVertexBuffer']({'context':_0x2ebc20,'typedArray':_0x2b7a7a['color']['values'],'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),'componentsPerAttribute':0x3},{'index':0x3,'vertexBuffer':Cesium__namespace['Buffer']['createVertexBuffer']({'context':_0x2ebc20,'typedArray':_0x2b7a7a['uv']['values'],'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),'componentsPerAttribute':0x2}],'indexBuffer':_0x27ffd1}),_0x3c49b1=this['_map'][_0x38fb0f(0xfc1)]['camera'],_0x38bb84=_0x2ebc20['drawingBufferWidth'],_0x212cea=_0x2ebc20['drawingBufferHeight'],_0x3bb918=new Cesium__namespace[(_0x38fb0f(0xb0e))](_0x38bb84,_0x212cea),_0x370374=Cesium__namespace['BoundingSphere']['fromVertices'](_0x2b7a7a[_0x38fb0f(0x767)]['values']);_0x370374['radius']=0x2710;const _0x293c5b=new Cesium__namespace['DrawCommand']({'primitiveType':Cesium__namespace[_0x38fb0f(0xb1a)]['TRIANGLES'],'shaderProgram':_0x325aac,'vertexArray':_0x2d2378,'modelMatrix':Cesium__namespace[_0x38fb0f(_0x151985._0x2fc432)]['IDENTITY'],'renderState':_0x16d2bc,'boundingVolume':_0x370374,'uniformMap':{'mars_orthographicMatrix':()=>{const _0x3b4dbb=_0x38fb0f;if(_0x3c49b1['frustum']['_offCenterFrustum']){var _0x5de50c;return(_0x5de50c=_0x3c49b1[_0x3b4dbb(0x389)][_0x3b4dbb(_0x3ad59d._0x58aadd)])===null||_0x5de50c===void 0x0?void 0x0:_0x5de50c['_perspectiveMatrix'];}else return _0x3c49b1[_0x3b4dbb(_0x3ad59d._0x35f216)]['_orthographicMatrix'];},'mars_viewMatrix':()=>{const _0x3b5d1a=_0x38fb0f;return _0x3c49b1[_0x3b5d1a(0xb88)];},'mars_resolution':()=>{return _0x3bb918;},'mars_pointSize':()=>{const _0x5d4fa4=_0x38fb0f;return this[_0x5d4fa4(0x639)];},'mars_image':()=>{return this['textures'][_0x177339]||this['textureDef'];},'mars_distanceDisplayCondition':()=>{return this['_distanceDisplayConditionCartesian2'];},'mars_positionWC':()=>{return _0x3c49b1['positionWC'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':_0x179eed?Cesium__namespace['Pass']['TRANSLUCENT']:Cesium__namespace['Pass'][_0x38fb0f(0x47f)],'pickOnly':!![],'pickCommand':new Cesium__namespace['DrawCommand']({'owner':this,'pickOnly':!![]})});this[_0x38fb0f(_0x151985._0x38d4ae)](_0x293c5b),_0x293c5b['pickId']=_0x2ebc20['createPickId']({'primitive':_0x293c5b,'id':this[_0x38fb0f(0x5c9)](_0x3f829b[_0x38fb0f(_0x151985._0x3e06f4)])});const _0x44f6d8=new Cesium__namespace[(_0x38fb0f(_0x151985._0x4a87bf))]({'owner':_0x293c5b,'primitiveType':Cesium__namespace[_0x38fb0f(0xb1a)][_0x38fb0f(_0x151985._0x2e9506)],'pickOnly':!![]});_0x44f6d8['vertexArray']=_0x2d2378,_0x44f6d8['renderState']=_0x16d2bc;const _0xea6e4=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x2ebc20,'vertexShaderSource':FlatBillboardVS,'fragmentShaderSource':Cesium__namespace['ShaderSource']['createPickFragmentShaderSource'](FlatBillboardFS,'uniform'),'attributeLocations':_0x298959});return _0x44f6d8['shaderProgram']=_0xea6e4,_0x44f6d8['uniformMap']=_0x293c5b['uniformMap'],_0x44f6d8['uniformMap']['czm_pickColor']=()=>{return _0x293c5b['pickId']['color'];},_0x44f6d8[_0x38fb0f(0xc50)]=_0x179eed?Cesium__namespace['Pass']['TRANSLUCENT']:Cesium__namespace[_0x38fb0f(_0x151985._0x242aae)][_0x38fb0f(0x47f)],_0x44f6d8['boundingVolume']=_0x370374,_0x44f6d8['modelMatrix']=Cesium__namespace['Matrix4']['IDENTITY'],!this['_pickCommands']&&(this['_pickCommands']=[]),this['_pickCommands']['push'](_0x44f6d8),_0x293c5b;}['setOpacity'](_0x40e161){const _0x287a47=_0x3d5d32;this[_0x287a47(0x6f9)]=_0x40e161;}}register$4('flatBillboard',FlatBillboard,!![]);class BasePolyCombine extends BaseCombine{get[_0x3d5d32(0xdde)](){const _0x5bab74={_0x50575b:0x433},_0xe2ca84=_0x3d5d32;var _0x264d65,_0x59bd06;if(((_0x264d65=this['options']['instances'])===null||_0x264d65===void 0x0?void 0x0:_0x264d65['length'])>0x0&&this['options']['instances'][0x0]['style'])return{...this['options']['style']||{},...this['options'][_0xe2ca84(0x789)][0x0][_0xe2ca84(0xdde)]};return(_0x59bd06=this[_0xe2ca84(_0x5bab74._0x50575b)])===null||_0x59bd06===void 0x0?void 0x0:_0x59bd06[_0xe2ca84(0xdde)];}set['style'](_0x57c1d8){this['setStyle'](_0x57c1d8);}[_0x3d5d32(0xc66)](_0x330fba,_0x2dcc00){const _0x21f0ce={_0x56dced:0x570,_0xe365b8:0x5c9,_0x4f9f5b:0xbb3},_0x5412b4=_0x3d5d32;this[_0x5412b4(_0x21f0ce._0x56dced)]=null,this['translucent']=![];const _0xc08aa5=this['instances'],_0x48bb45=[];for(let _0x5e8f19=0x0;_0x5e8f19<_0xc08aa5['length'];_0x5e8f19++){const _0x4af9c3=_0xc08aa5[_0x5e8f19];if(_0x4af9c3 instanceof Cesium__namespace['GeometryInstance'])_0x4af9c3['id']=this[_0x5412b4(_0x21f0ce._0xe365b8)](_0x5e8f19),_0x48bb45['push'](_0x4af9c3);else{const _0x11ab6f=this[_0x5412b4(_0x21f0ce._0x4f9f5b)](_0x330fba,_0x2dcc00,_0x4af9c3);_0x11ab6f&&(_0x11ab6f['id']=this['createPickId'](_0x5e8f19),_0x48bb45['push'](_0x11ab6f));}}return _0x48bb45;}['_createGeometryInstanceItem'](_0x1361ad,_0x1c2a83,_0x554117){}['_getPolylineOutlinePositions'](_0x26f351){return _0x26f351['positions']?[LngLatArray['toCartesians'](_0x26f351['positions'])]:null;}['_createPolylineOutline'](_0x26e368){const _0x41a562={_0x14230b:0xdde,_0x3f3508:0xdde,_0x5b417c:0xdde,_0x132bf9:0xdbb,_0x4b842f:0x882,_0x3ba54d:0xe57,_0x3c78c9:0xb84,_0x2a4a12:0x83e,_0x5b6e1e:0xaf7,_0x15a507:0x783},_0x22969b=_0x3d5d32,_0x3b9024=this['instances'],_0x3cc32c=[];let _0xb48c31;for(let _0x27fc99=0x0;_0x27fc99<_0x3b9024['length'];_0x27fc99++){const _0x1b491e=_0x3b9024[_0x27fc99];let _0x2b5912;if(_0x1b491e['style']&&(Cesium__namespace['defined'](_0x1b491e[_0x22969b(_0x41a562._0x14230b)][_0x22969b(0xe7a)])||Cesium__namespace['defined'](_0x1b491e['style']['outlineStyle'])||Cesium__namespace[_0x22969b(0xb84)](_0x1b491e['style']['outlineColor'])||Cesium__namespace[_0x22969b(0xb84)](_0x1b491e['style'][_0x22969b(0x301)])||Cesium__namespace['defined'](_0x1b491e[_0x22969b(_0x41a562._0x3f3508)]['outlineWidth']))){const _0x85923f=this['_getOutlineStyle'](_0x1b491e[_0x22969b(_0x41a562._0x5b417c)]);if(!_0x85923f['show'])continue;_0x2b5912={..._0x26e368,..._0x85923f};}else _0x2b5912=_0x26e368;_0xb48c31=PolylineStyleConver[_0x22969b(0x83d)](_0x2b5912);!_0xb48c31['material']&&(_0xb48c31['vertexFormat']=Cesium__namespace['PolylineColorAppearance'][_0x22969b(0x748)]);const _0x548b16=_0x2b5912[_0x22969b(0x7c0)]?Cesium__namespace[_0x22969b(_0x41a562._0x132bf9)]:Cesium__namespace['PolylineGeometry'],_0x225603=_0xb48c31['color']??Cesium__namespace[_0x22969b(_0x41a562._0x4b842f)][_0x22969b(0x6e8)][_0x22969b(_0x41a562._0x3ba54d)](0.5),_0xe29fb6=this['_getPolylineOutlinePositions'](_0x1b491e);if(!_0xe29fb6)return;for(let _0x415fb3=0x0,_0xe84646=_0xe29fb6['length'];_0x415fb3<_0xe84646;_0x415fb3++){let _0x5d86fd=_0xe29fb6[_0x415fb3];Cesium__namespace[_0x22969b(_0x41a562._0x3c78c9)](_0x1b491e[_0x22969b(_0x41a562._0x3f3508)][_0x22969b(_0x41a562._0x2a4a12)])&&(_0x5d86fd=setPositionsHeight(_0x5d86fd,_0x1b491e['style']['height']));_0x5d86fd['length']>0x0&&(_0x5d86fd=_0x5d86fd['concat'](_0x5d86fd[0x0]));const _0x1bfbeb=new Cesium__namespace['GeometryInstance']({'geometry':new _0x548b16({..._0xb48c31,'positions':_0x5d86fd}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x225603),'distanceDisplayCondition':_0xb48c31['distanceDisplayCondition']}});_0x3cc32c['push'](_0x1bfbeb);}}const _0x45f9e9={...this['options'],'geometryInstances':_0x3cc32c,'show':this['show']};delete _0x45f9e9[_0x22969b(0xdde)],delete _0x45f9e9['attr'];this[_0x22969b(_0x41a562._0x5b6e1e)](_0x26e368,_0xb48c31)?_0x45f9e9[_0x22969b(_0x41a562._0x15a507)]=new Cesium__namespace['PolylineColorAppearance']({..._0xb48c31}):_0x45f9e9['appearance']=new Cesium__namespace['PolylineMaterialAppearance']({..._0xb48c31});let _0xc0185c;return _0xb48c31[_0x22969b(0x7c0)]?_0xc0185c=this['primitiveCollection']['add'](new Cesium__namespace['GroundPolylinePrimitive'](_0x45f9e9)):_0xc0185c=this['primitiveCollection'][_0x22969b(0xff3)](new Cesium__namespace[(_0x22969b(0x684))](_0x45f9e9)),this['bindPickId'](_0xc0185c),_0xc0185c;}['_highlight_mouseEventHandler'](_0x2bdcce){const _0x38c7e1={_0x5aa661:0xd5d},_0x1c8c50=_0x3d5d32;this['_map']['closeHighlight']();const _0x2d70b4=_0x2bdcce['pickedObject'];_0x2d70b4&&(this[_0x1c8c50(0x3c2)]=_0x2d70b4,this[_0x1c8c50(0x1d1)]['openHighlight'](this,this[_0x1c8c50(_0x38c7e1._0x5aa661)],_0x2bdcce));}[_0x3d5d32(0x70e)](_0x4ca875,_0x56287a=!![],_0x5679f8){const _0x2b4f98={_0x54c5a7:0x759,_0xad69a5:0xe8f,_0x147d5b:0xc0b},_0x5a94c9=_0x3d5d32;_0x56287a&&(this['_map'][_0x5a94c9(_0x2b4f98._0x54c5a7)](),this['_map'][_0x5a94c9(0xe05)]=this);_0x5679f8&&(this['_last_pickedObject']=_0x5679f8);const _0x123513=_0x4ca875||this['_highlightOptions'];if(this['_last_pickedObject']&&_0x123513){const _0x544b7e=PolygonStyleConver['toCesiumVal']({...this['_last_pickedObject'][_0x5a94c9(0xe9b)][_0x5a94c9(0xdde)],..._0x123513}),_0x3c4dc7=this['_getColorByColorMaterial'](_0x544b7e,![]);if(_0x3c4dc7){const _0x3e1a4b=this['getGeometryInstanceAttributes'](this['_last_pickedObject']['id']);_0x3e1a4b[_0x5a94c9(_0x2b4f98._0xad69a5)]=Cesium__namespace['ColorGeometryInstanceAttribute'][_0x5a94c9(_0x2b4f98._0x147d5b)](_0x3c4dc7),this['fire'](EventType['highlightOpen'],{},!![]);}}}['closeHighlight'](){const _0x3afab4={_0x54d1e6:0xc0b},_0xbc38dc=_0x3d5d32;var _0x1c38c1;if(this['_last_pickedObject']&&this['_primitive']){const _0x20aec9=PolygonStyleConver[_0xbc38dc(0x83d)](this[_0xbc38dc(0x3c2)]['data'][_0xbc38dc(0xdde)]),_0x21c67e=this['_getColorByColorMaterial'](_0x20aec9,![]);if(_0x21c67e){const _0x3e5909=this['getGeometryInstanceAttributes'](this['_last_pickedObject']['id']);_0x3e5909&&(_0x3e5909[_0xbc38dc(0xe8f)]=Cesium__namespace['ColorGeometryInstanceAttribute'][_0xbc38dc(_0x3afab4._0x54d1e6)](_0x21c67e),this[_0xbc38dc(0xefc)](EventType['highlightClose'],{},!![]));}delete this['_last_pickedObject'];}((_0x1c38c1=this[_0xbc38dc(0x1d1)])===null||_0x1c38c1===void 0x0?void 0x0:_0x1c38c1[_0xbc38dc(0xe05)])===this&&this['_map']['_clearLastHighlight']();}[_0x3d5d32(0xa2a)](_0x4cd875){const _0x5a95bd={_0x49f7d2:0xdde,_0x157ddc:0xdde},_0x85cc8c=_0x3d5d32,_0x45de68=this['options'][_0x85cc8c(0x789)]||[];for(let _0x20321e=0x0;_0x20321e<_0x45de68[_0x85cc8c(0xc84)];_0x20321e++){const _0x35bd3a=_0x45de68[_0x20321e];_0x35bd3a[_0x85cc8c(_0x5a95bd._0x49f7d2)]&&(_0x35bd3a[_0x85cc8c(_0x5a95bd._0x157ddc)]=merge(_0x35bd3a['style'],_0x4cd875));}return super[_0x85cc8c(0xa2a)](_0x4cd875);}}class BasePointCombine extends BasePolyCombine{['_getModelMatrix'](_0x5bc05e,_0x54f96e){const _0x2d36c0=_0x3d5d32;if(_0x5bc05e['modelMatrix'])return _0x5bc05e['modelMatrix'];const _0x508571=LngLatPoint['toCartesian'](_0x5bc05e['position']),_0x1e1577=Cesium__namespace['Math'][_0x2d36c0(0x562)](_0x54f96e[_0x2d36c0(0xe39)]||0x0),_0x4945a8=Cesium__namespace['Math']['toRadians'](_0x54f96e['pitch']||0x0),_0x28d8e7=Cesium__namespace['Math']['toRadians'](_0x54f96e['roll']||0x0),_0x2ff20f=Cesium__namespace['Transforms'][_0x2d36c0(0x9f9)](_0x508571,new Cesium__namespace['HeadingPitchRoll'](_0x1e1577,_0x4945a8,_0x28d8e7));return _0x2ff20f;}}class PlaneCombine extends BasePointCombine{['_conversionStyle'](_0x2fa88a){return PlaneStyleConver['toCesiumVal'](_0x2fa88a);}['_style2Json'](_0x4e7796,_0x411080){return PlaneStyleConver['toJSON'](_0x4e7796,_0x411080);}['_createGeometryInstanceItem'](_0x322f68,_0x1ad343,_0x139156){const _0x271cde={_0x1ac833:0x8f0},_0x121d48=_0x3d5d32,_0x5d2312=PlaneStyleConver['toCesiumVal']({...this[_0x121d48(0x433)]['style'],..._0x139156['style']||{}});_0x5d2312['vertexFormat']=_0x5d2312['vertexFormat']||_0x322f68['vertexFormat'];let _0x581ff1=this['_getColorByColorMaterial'](_0x5d2312);_0x1ad343&&_0x5d2312['outlineColor']&&(_0x581ff1=_0x5d2312['outlineColor']);_0x581ff1[_0x121d48(0x24b)]!==0x1&&(this['translucent']=!![]);const _0x8e6491=this['_getModelMatrix'](_0x139156,_0x5d2312),_0xe8f82c=_0x1ad343?Cesium__namespace['PlaneOutlineGeometry']:Cesium__namespace['PlaneGeometry'],_0x23eac0=new Cesium__namespace['GeometryInstance']({'geometry':new _0xe8f82c(_0x5d2312),'modelMatrix':_0x8e6491,'attributes':{'color':Cesium__namespace[_0x121d48(0x64f)]['fromColor'](_0x581ff1),'distanceDisplayCondition':_0x5d2312[_0x121d48(_0x271cde._0x1ac833)]}});return _0x23eac0;}['_getModelMatrix'](_0x2bf43b,_0xb5d11b){const _0x4c86a1={_0x309d6a:0xf5d,_0x51f916:0x9dc,_0x1ea4e9:0xf5d,_0x3e72d8:0x38e,_0x143d1d:0x37e},_0x2da4d1=_0x3d5d32;var _0xa1e4b1,_0x275cae;if(_0x2bf43b['modelMatrix'])return _0x2bf43b['modelMatrix'];const _0x196c0d=super[_0x2da4d1(0x4bf)](_0x2bf43b,_0xb5d11b);if(_0xb5d11b['plane_normal']===Cesium__namespace['Cartesian3']['UNIT_X']){const _0x428f98=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromRotationX'](Cesium__namespace['Math'][_0x2da4d1(0x562)](0x5a)));Cesium__namespace['Matrix4'][_0x2da4d1(0x37e)](_0x196c0d,_0x428f98,_0x196c0d);}else{if(_0xb5d11b[_0x2da4d1(0x61d)]===Cesium__namespace['Cartesian3']['UNIT_Y']){const _0x1ae399=Cesium__namespace[_0x2da4d1(_0x4c86a1._0x309d6a)]['fromRotationTranslation'](Cesium__namespace[_0x2da4d1(_0x4c86a1._0x51f916)]['fromRotationY'](Cesium__namespace['Math']['toRadians'](0x5a)));Cesium__namespace['Matrix4']['multiply'](_0x196c0d,_0x1ae399,_0x196c0d);}}const _0x1f8b6f=Cesium__namespace[_0x2da4d1(_0x4c86a1._0x1ea4e9)][_0x2da4d1(_0x4c86a1._0x3e72d8)](new Cesium__namespace['Cartesian3'](((_0xa1e4b1=_0xb5d11b['dimensions'])===null||_0xa1e4b1===void 0x0?void 0x0:_0xa1e4b1['x'])??0x1,((_0x275cae=_0xb5d11b[_0x2da4d1(0x9e5)])===null||_0x275cae===void 0x0?void 0x0:_0x275cae['y'])??0x1,0x1));return Cesium__namespace['Matrix4'][_0x2da4d1(_0x4c86a1._0x143d1d)](_0x196c0d,_0x1f8b6f,_0x196c0d),_0x196c0d;}}register$4('planeC',PlaneCombine,!![]);class BoxCombine extends BasePointCombine{['_conversionStyle'](_0x111bdc){return _0x111bdc['closed']=_0x111bdc['closed']??!![],BoxStyleConver['toCesiumVal'](_0x111bdc);}['_style2Json'](_0x3415a8,_0x35fc2b){return BoxStyleConver['toJSON'](_0x3415a8,_0x35fc2b);}[_0x3d5d32(0xbb3)](_0x84714,_0x394432,_0xe9a39a){const _0x44d5bf={_0x42fa38:0xdde,_0x3e2bdb:0xa72,_0x495034:0xf00},_0x5514e0=_0x3d5d32,_0xfed272=BoxStyleConver[_0x5514e0(0x83d)]({...this['options'][_0x5514e0(_0x44d5bf._0x42fa38)],..._0xe9a39a[_0x5514e0(0xdde)]||{}});_0xfed272[_0x5514e0(_0x44d5bf._0x3e2bdb)]=_0xfed272['vertexFormat']||_0x84714['vertexFormat'];let _0x210b79=this['_getColorByColorMaterial'](_0xfed272);_0x394432&&_0xfed272['outlineColor']&&(_0x210b79=_0xfed272['outlineColor']);_0x210b79['alpha']!==0x1&&(this['translucent']=!![]);const _0x51b9e9=this['_getModelMatrix'](_0xe9a39a,_0xfed272),_0x10a7b7=_0x394432?Cesium__namespace[_0x5514e0(0x400)]:Cesium__namespace[_0x5514e0(_0x44d5bf._0x495034)],_0x5f3d9c=new Cesium__namespace[(_0x5514e0(0x263))]({'geometry':_0x10a7b7['fromDimensions'](_0xfed272),'modelMatrix':_0x51b9e9,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x210b79),'distanceDisplayCondition':_0xfed272['distanceDisplayCondition']}});return _0x5f3d9c;}}register$4('boxC',BoxCombine,!![]);class CircleCombine extends BasePointCombine{['_conversionStyle'](_0x53484d){return CircleStyleConver['toCesiumVal'](_0x53484d);}['_style2Json'](_0x3283a7,_0x317ef7){const _0x1a2482=_0x3d5d32;return CircleStyleConver[_0x1a2482(0x3db)](_0x3283a7,_0x317ef7);}[_0x3d5d32(0xbb3)](_0x2ad69c,_0x3a1124,_0x47d0b5){const _0x592966={_0x31fbc4:0xa72,_0x40da9a:0xcf4},_0x22ad59=_0x3d5d32,_0x43524a=CircleStyleConver['toCesiumVal']({...this[_0x22ad59(0x433)][_0x22ad59(0xdde)],..._0x47d0b5[_0x22ad59(0xdde)]||{}});_0x43524a[_0x22ad59(_0x592966._0x31fbc4)]=_0x43524a['vertexFormat']||_0x2ad69c[_0x22ad59(0xa72)];let _0xb780c6=this['_getColorByColorMaterial'](_0x43524a);_0x3a1124&&_0x43524a['outlineColor']&&(_0xb780c6=_0x43524a['outlineColor']);_0xb780c6['alpha']!==0x1&&(this['translucent']=!![]);_0x47d0b5['position']=LngLatPoint['parse'](_0x47d0b5['position'])['toCartesian'](),_0x43524a['center']=_0x47d0b5['position'];const _0x3af484=_0x3a1124?Cesium__namespace['CircleOutlineGeometry']:Cesium__namespace[_0x22ad59(_0x592966._0x40da9a)],_0x1aa6de=new Cesium__namespace[(_0x22ad59(0x263))]({'geometry':new _0x3af484(_0x43524a),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0xb780c6),'distanceDisplayCondition':_0x43524a['distanceDisplayCondition']}});return _0x1aa6de;}['_getPolylineOutlinePositions'](_0x2fd1f8){const _0x527768={_0x41a8f7:0xdde},_0xf1eec=_0x3d5d32,_0x79bd69=getEllipseOuterPositions({'position':_0x2fd1f8['position'],'radius':_0x2fd1f8[_0xf1eec(_0x527768._0x41a8f7)][_0xf1eec(0xd61)],'granularity':_0x2fd1f8['style']['granularity']});return[_0x79bd69];}}register$4('circleC',CircleCombine,!![]);class CylinderCombine extends BasePointCombine{['_conversionStyle'](_0x972ca){return _0x972ca['closed']=_0x972ca['closed']??!![],CylinderStyleConver['toCesiumVal'](_0x972ca);}[_0x3d5d32(0x53e)](_0x436eff,_0x130672){return CylinderStyleConver['toJSON'](_0x436eff,_0x130672);}[_0x3d5d32(0xbb3)](_0x4ddd43,_0x24930e,_0x3098fa){const _0x4be6ad={_0x2aafe3:0x433,_0x3c51aa:0xdde,_0x3d0fb3:0xa72,_0x18a626:0xa72,_0x563fde:0x5a2},_0x24cbbb=_0x3d5d32,_0x466326=CylinderStyleConver[_0x24cbbb(0x83d)]({...this[_0x24cbbb(_0x4be6ad._0x2aafe3)][_0x24cbbb(_0x4be6ad._0x3c51aa)],..._0x3098fa['style']||{}});_0x466326[_0x24cbbb(_0x4be6ad._0x3d0fb3)]=_0x466326['vertexFormat']||_0x4ddd43[_0x24cbbb(_0x4be6ad._0x18a626)];let _0x50b262=this[_0x24cbbb(_0x4be6ad._0x563fde)](_0x466326);_0x24930e&&_0x466326['outlineColor']&&(_0x50b262=_0x466326['outlineColor']);_0x50b262['alpha']!==0x1&&(this['translucent']=!![]);const _0x49a1e1=this['_getModelMatrix'](_0x3098fa,_0x466326),_0x30d74c=_0x24930e?Cesium__namespace['CylinderOutlineGeometry']:Cesium__namespace[_0x24cbbb(0x771)],_0x5d73e6=new Cesium__namespace['GeometryInstance']({'geometry':new _0x30d74c(_0x466326),'modelMatrix':_0x49a1e1,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x50b262),'distanceDisplayCondition':_0x466326['distanceDisplayCondition']}});return _0x5d73e6;}}register$4('cylinderC',CylinderCombine,!![]);class FrustumCombine extends BasePointCombine{['_conversionStyle'](_0x5e067f){const _0x1234e5=_0x3d5d32;return _0x5e067f[_0x1234e5(0xbe7)]=_0x5e067f[_0x1234e5(0xbe7)]??!![],CylinderStyleConver['toCesiumVal'](_0x5e067f);}['_style2Json'](_0x3f5b4c,_0x48b45d){return CylinderStyleConver['toJSON'](_0x3f5b4c,_0x48b45d);}['_createGeometryInstanceItem'](_0x48a89e,_0x36f72e,_0x1b6482){const _0x222b4d={_0x41f46b:0x5bb,_0x5b98f2:0x103e,_0x27f27f:0x247,_0x15fe18:0x263,_0x458407:0x64f},_0x22f413=_0x3d5d32,_0x502ea2=CylinderStyleConver['toCesiumVal']({...this['options']['style'],..._0x1b6482['style']||{}});_0x502ea2[_0x22f413(0xa72)]=_0x502ea2[_0x22f413(0xa72)]||_0x48a89e['vertexFormat'];let _0xe49de=this[_0x22f413(0x5a2)](_0x502ea2);_0x36f72e&&_0x502ea2['outlineColor']&&(_0xe49de=_0x502ea2[_0x22f413(0x62a)]);_0xe49de['alpha']!==0x1&&(this['translucent']=!![]);const _0x3ce008=_0x1b6482['position']=LngLatPoint['parse'](_0x1b6482['position'])['toCartesian']();let _0x1b9356,_0x5899ab;if(_0x1b6482['targetPositio']){const _0xc3ca6b=LngLatPoint['parse'](_0x1b6482['targetPosition'])['toCartesian']();_0x1b9356=Cesium__namespace['Cartesian3']['distance'](_0x3ce008,_0xc3ca6b);const _0x64c0b9=getHeadingPitchRollForLine(_0x3ce008,_0xc3ca6b);_0x5899ab=Cesium__namespace[_0x22f413(_0x222b4d._0x41f46b)]['headingPitchRollQuaternion'](_0x3ce008,_0x64c0b9);}else{_0x1b9356=-_0x502ea2['length'];const _0x262192=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace[_0x22f413(_0x222b4d._0x5b98f2)]['toRadians'](_0x502ea2['heading']||0x0),Cesium__namespace['Math']['toRadians'](_0x502ea2[_0x22f413(0x5cf)]||0x0),Cesium__namespace['Math']['toRadians'](_0x502ea2['roll']||0x0));_0x5899ab=Cesium__namespace['Transforms'][_0x22f413(0xed0)](_0x3ce008,_0x262192);}const _0x294f90=new Cesium__namespace['PerspectiveFrustum']({'fov':Cesium__namespace['Math']['toRadians'](_0x502ea2[_0x22f413(0x247)]*0x2||0.01),'aspectRatio':_0x502ea2[_0x22f413(0x5df)]/_0x502ea2[_0x22f413(_0x222b4d._0x27f27f)],'near':0.01,'far':_0x1b9356}),_0x2185a7=_0x36f72e?Cesium__namespace['FrustumOutlineGeometry']:Cesium__namespace['FrustumGeometry'],_0x260fb3=new Cesium__namespace[(_0x22f413(_0x222b4d._0x15fe18))]({'geometry':new _0x2185a7({..._0x502ea2,'origin':_0x3ce008,'orientation':_0x5899ab,'frustum':_0x294f90}),'attributes':{'color':Cesium__namespace[_0x22f413(_0x222b4d._0x458407)][_0x22f413(0xaf0)](_0xe49de),'distanceDisplayCondition':_0x502ea2['distanceDisplayCondition']}});return _0x260fb3;}}register$4(_0x3d5d32(0x8ee),FrustumCombine,!![]);class EllipsoidCombine extends BasePointCombine{['_conversionStyle'](_0x361923){return _0x361923['closed']=_0x361923['closed']??!![],EllipsoidStyleConver['toCesiumVal'](_0x361923);}['_style2Json'](_0x974cda,_0x437dc8){const _0x56b35c={_0x316f94:0x3db},_0x266fa0=_0x3d5d32;return EllipsoidStyleConver[_0x266fa0(_0x56b35c._0x316f94)](_0x974cda,_0x437dc8);}['_createGeometryInstanceItem'](_0x45eb25,_0x47b922,_0x3b5201){const _0x324265={_0xbae9c5:0xdde,_0xf07070:0x62a},_0x22a736=_0x3d5d32,_0x82c324=EllipsoidStyleConver['toCesiumVal']({...this['options']['style'],..._0x3b5201[_0x22a736(_0x324265._0xbae9c5)]||{}});_0x82c324['vertexFormat']=_0x82c324['vertexFormat']||_0x45eb25[_0x22a736(0xa72)];let _0x1638b0=this['_getColorByColorMaterial'](_0x82c324);_0x47b922&&_0x82c324[_0x22a736(_0x324265._0xf07070)]&&(_0x1638b0=_0x82c324['outlineColor']);_0x1638b0[_0x22a736(0x24b)]!==0x1&&(this[_0x22a736(0x1002)]=!![]);const _0x5302d2=this['_getModelMatrix'](_0x3b5201,_0x82c324),_0x39e288=_0x47b922?Cesium__namespace['EllipsoidOutlineGeometry']:Cesium__namespace['EllipsoidGeometry'],_0x1147e7=new Cesium__namespace['GeometryInstance']({'geometry':new _0x39e288(_0x82c324),'modelMatrix':_0x5302d2,'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x1638b0),'distanceDisplayCondition':_0x82c324['distanceDisplayCondition']}});return _0x1147e7;}}register$4(_0x3d5d32(0xd7f),EllipsoidCombine,!![]);class PolylineCombine extends BasePolyCombine{['_conversionStyle'](_0x2bc916){return PolylineStyleConver['toCesiumVal'](_0x2bc916);}['_style2Json'](_0x102682,_0x5c21a4){return PolylineStyleConver['toJSON'](_0x102682,_0x5c21a4);}['_createGeometryInstanceItem'](_0x24c97c,_0x2975cc,_0x4423e8){const _0x2f99a0={_0x2fb075:0x890},_0x8b34dd=_0x3d5d32,_0x3f80e1=PolylineStyleConver['toCesiumVal']({...this['options'][_0x8b34dd(0xdde)],..._0x4423e8['style']||{}});_0x24c97c['_isColorMaterial']&&(_0x3f80e1[_0x8b34dd(0xa72)]=Cesium__namespace['PolylineColorAppearance']['VERTEX_FORMAT']);const _0x599403=this[_0x8b34dd(0x5a2)](_0x3f80e1),_0x27bf20=_0x4423e8['positions']=LngLatArray[_0x8b34dd(_0x2f99a0._0x2fb075)](_0x4423e8['positions']);_0x3f80e1['positions']=_0x27bf20;const _0x3eaf77=_0x3f80e1['clampToGround']?Cesium__namespace['GroundPolylineGeometry']:Cesium__namespace['PolylineGeometry'],_0x1ea1f6=new Cesium__namespace['GeometryInstance']({'geometry':new _0x3eaf77(_0x3f80e1),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x599403),'distanceDisplayCondition':_0x3f80e1[_0x8b34dd(0x8f0)]}});return _0x1ea1f6;}['_createAppearance'](_0x3fb122,_0x237ad8){const _0x524e21={_0x4e2e09:0x421},_0x239bba=_0x3d5d32;return _0x3fb122['_isColorMaterial']?new Cesium__namespace['PolylineColorAppearance']({..._0x3fb122}):new Cesium__namespace[(_0x239bba(_0x524e21._0x4e2e09))]({..._0x3fb122});}}register$4(_0x3d5d32(0xf0f),PolylineCombine),register$4(_0x3d5d32(0x8e2),PolylineCombine);class PolylineVolumeCombine extends BasePolyCombine{['_conversionStyle'](_0x2f58f3){const _0x2bc294={_0x3eb210:0xbe7},_0x4d0345=_0x3d5d32;return _0x2f58f3[_0x4d0345(_0x2bc294._0x3eb210)]=_0x2f58f3[_0x4d0345(0xbe7)]??!![],PolylineVolumeStyleConver[_0x4d0345(0x83d)](_0x2f58f3);}['_style2Json'](_0x19e4a5,_0x5516c4){return PolylineVolumeStyleConver['toJSON'](_0x19e4a5,_0x5516c4);}['_createGeometryInstanceItem'](_0x53eefb,_0x8ee879,_0x2d4c24){const _0x20a6a9={_0x5dfe8f:0xa72,_0x536dae:0x62a,_0x4d1b92:0xd63},_0x452d27=_0x3d5d32,_0x1c55cb=PolylineVolumeStyleConver['toCesiumVal']({...this['options'][_0x452d27(0xdde)],..._0x2d4c24['style']||{}});_0x1c55cb['vertexFormat']=_0x1c55cb[_0x452d27(0xa72)]||_0x53eefb[_0x452d27(_0x20a6a9._0x5dfe8f)];let _0x5a1a3e=this['_getColorByColorMaterial'](_0x1c55cb);_0x8ee879&&_0x1c55cb[_0x452d27(_0x20a6a9._0x536dae)]&&(_0x5a1a3e=_0x1c55cb['outlineColor']);_0x5a1a3e['alpha']!==0x1&&(this['translucent']=!![]);const _0x4b643d=_0x2d4c24['positions']=LngLatArray['toCartesians'](_0x2d4c24['positions']),_0xc5b087=_0x8ee879?Cesium__namespace[_0x452d27(_0x20a6a9._0x4d1b92)]:Cesium__namespace['PolylineVolumeGeometry'],_0x7b0153=new Cesium__namespace['GeometryInstance']({'geometry':new _0xc5b087({..._0x1c55cb,'polylinePositions':_0x4b643d,'shapePositions':_0x1c55cb[_0x452d27(0x866)]}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x452d27(0xaf0)](_0x5a1a3e),'distanceDisplayCondition':_0x1c55cb['distanceDisplayCondition']}});return _0x7b0153;}}register$4(_0x3d5d32(0x1074),PolylineVolumeCombine);class CorridorCombine extends BasePolyCombine{[_0x3d5d32(0x468)](_0xfc3242){const _0x13cf71={_0x393610:0x83d},_0x10644e=_0x3d5d32;return CorridorStyleConver[_0x10644e(_0x13cf71._0x393610)](_0xfc3242);}[_0x3d5d32(0x53e)](_0x5bef5b,_0x40a5cd){return CorridorStyleConver['toJSON'](_0x5bef5b,_0x40a5cd);}['_createGeometryInstanceItem'](_0x3caa41,_0x5ad4cb,_0x692113){const _0x88092f={_0x30b877:0x433,_0xade6af:0xdde,_0x50b784:0x5a2,_0x177196:0x1002,_0x52f98f:0x64f,_0x52ad8f:0xaf0},_0x185dd1=_0x3d5d32,_0x1ca942=CorridorStyleConver[_0x185dd1(0x83d)]({...this[_0x185dd1(_0x88092f._0x30b877)][_0x185dd1(0xdde)],..._0x692113[_0x185dd1(_0x88092f._0xade6af)]||{}});_0x1ca942['vertexFormat']=_0x1ca942['vertexFormat']||_0x3caa41['vertexFormat'];let _0x45e71d=this[_0x185dd1(_0x88092f._0x50b784)](_0x1ca942);_0x5ad4cb&&_0x1ca942['outlineColor']&&(_0x45e71d=_0x1ca942['outlineColor']);_0x45e71d[_0x185dd1(0x24b)]!==0x1&&(this[_0x185dd1(_0x88092f._0x177196)]=!![]);_0x692113['positions']=LngLatArray['toCartesians'](_0x692113['positions']),_0x1ca942['positions']=_0x692113['positions'];const _0x44c1b5=_0x5ad4cb?Cesium__namespace['CorridorOutlineGeometry']:Cesium__namespace[_0x185dd1(0x43e)],_0x2a87db=new Cesium__namespace['GeometryInstance']({'geometry':new _0x44c1b5(_0x1ca942),'attributes':{'color':Cesium__namespace[_0x185dd1(_0x88092f._0x52f98f)][_0x185dd1(_0x88092f._0x52ad8f)](_0x45e71d),'distanceDisplayCondition':_0x1ca942['distanceDisplayCondition']}});return _0x2a87db;}}register$4(_0x3d5d32(0x668),CorridorCombine);class WallCombine extends BasePolyCombine{['_conversionStyle'](_0x1ad3db){return WallStyleConver['toCesiumVal'](_0x1ad3db);}['_style2Json'](_0xb98ccc,_0x513c1e){return WallStyleConver['toJSON'](_0xb98ccc,_0x513c1e);}['_createGeometryInstanceItem'](_0x3421e6,_0x2c5066,_0x207a6b){const _0x13a5d7={_0x1dc302:0xdde,_0x5f1281:0x1002},_0x2cc625={_0x3c2157:0x9e2},_0x4d11df=_0x3d5d32;var _0xc80952;const _0x31aa06=WallStyleConver[_0x4d11df(0x83d)]({...this['options'][_0x4d11df(_0x13a5d7._0x1dc302)],..._0x207a6b['style']||{}});_0x31aa06[_0x4d11df(0xa72)]=_0x31aa06['vertexFormat']||_0x3421e6['vertexFormat'];let _0x5979aa=this['_getColorByColorMaterial'](_0x31aa06);_0x2c5066&&_0x31aa06['outlineColor']&&(_0x5979aa=_0x31aa06[_0x4d11df(0x62a)]);_0x5979aa['alpha']!==0x1&&(this[_0x4d11df(_0x13a5d7._0x5f1281)]=!![]);const _0x22632b=[];let _0x3c1a5f=[];const _0x265254=_0x207a6b[_0x4d11df(0xbb8)];let _0x45830b=new Array(_0x265254),_0x40ecf1=new Array(_0x265254);_0x207a6b['positions']['forEach'](function(_0x53579e,_0x27a02f){const _0x562e85=_0x4d11df,_0x42817d=LngLatPoint['parse'](_0x53579e);if(!_0x42817d||!_0x42817d[_0x562e85(0xf12)]())return;_0x22632b[_0x562e85(0xb75)](_0x42817d),_0x3c1a5f['push'](_0x42817d['toCartesian']());const _0x4658a8=_0x22632b[_0x27a02f]['alt'];_0x45830b[_0x27a02f]=_0x4658a8,_0x40ecf1[_0x27a02f]=_0x4658a8+Number(_0x31aa06[_0x562e85(_0x2cc625._0x3c2157)]||0x64);});_0x31aa06[_0x4d11df(0x1f2)]&&((_0xc80952=_0x3c1a5f)===null||_0xc80952===void 0x0?void 0x0:_0xc80952['length'])>0x0&&(_0x3c1a5f=_0x3c1a5f['concat'](_0x3c1a5f[0x0]),_0x45830b=_0x45830b['concat'](_0x45830b[0x0]),_0x40ecf1=_0x40ecf1['concat'](_0x40ecf1[0x0]));const _0x52ffe5=_0x2c5066?Cesium__namespace['WallOutlineGeometry']:Cesium__namespace['WallGeometry'],_0x5e42b6=new Cesium__namespace['GeometryInstance']({'geometry':new _0x52ffe5({..._0x31aa06,'positions':_0x3c1a5f,'maximumHeights':_0x40ecf1,'minimumHeights':_0x45830b}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute']['fromColor'](_0x5979aa),'distanceDisplayCondition':_0x31aa06[_0x4d11df(0x8f0)]}});return _0x5e42b6;}}register$4('wallC',WallCombine);class PolygonCombine extends BasePolyCombine{['_conversionStyle'](_0x425905){const _0xb0f0b={_0x2011bf:0x83d},_0x5d3c6b=_0x3d5d32;return PolygonStyleConver[_0x5d3c6b(_0xb0f0b._0x2011bf)](_0x425905);}[_0x3d5d32(0x53e)](_0x2a10cd,_0x8e55b4){const _0x2c22f2=_0x3d5d32;return PolygonStyleConver[_0x2c22f2(0x3db)](_0x2a10cd,_0x8e55b4);}['_createGeometryInstanceItem'](_0x58ec29,_0x44678c,_0x11f6c1){const _0x25230a=_0x3d5d32,_0x3b3553=PolygonStyleConver['toCesiumVal']({...this[_0x25230a(0x433)]['style'],..._0x11f6c1['style']||{}});_0x3b3553['vertexFormat']=_0x3b3553['vertexFormat']||_0x58ec29['vertexFormat'];let _0x42ebe3=this['_getColorByColorMaterial'](_0x3b3553);_0x44678c&&_0x3b3553[_0x25230a(0x62a)]&&(_0x42ebe3=_0x3b3553['outlineColor']);_0x42ebe3['alpha']!==0x1&&(this['translucent']=!![]);let _0x3eb272,_0x255ced;_0x11f6c1['positions']['length']>0x0&&Array['isArray'](_0x11f6c1['positions'][0x0])&&_0x11f6c1['positions'][0x0]['length']>0x0&&Array['isArray'](_0x11f6c1['positions'][0x0][0x0])&&isNumber(_0x11f6c1[_0x25230a(0xbb8)][0x0][0x0][0x0])?(_0x3eb272=getPolygonHierarchy(_0x11f6c1['positions']),_0x255ced=_0x3eb272['positions']):(_0x255ced=_0x11f6c1[_0x25230a(0xbb8)]=LngLatArray['toCartesians'](_0x11f6c1['positions']),_0x3eb272=new Cesium__namespace['PolygonHierarchy'](_0x255ced));_0x11f6c1['_hierarchy']=_0x3eb272,_0x3b3553[_0x25230a(0x86a)]=_0x3eb272;const _0x19cb3c=_0x44678c?Cesium__namespace['PolygonOutlineGeometry']:Cesium__namespace['PolygonGeometry'],_0x10c5ec=new Cesium__namespace[(_0x25230a(0x263))]({'geometry':new _0x19cb3c(_0x3b3553),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x25230a(0xaf0)](_0x42ebe3),'distanceDisplayCondition':_0x3b3553['distanceDisplayCondition']}});return _0x10c5ec;}['_getPolylineOutlinePositions'](_0x4243b1){const _0x2c0a30=_0x3d5d32;if(_0x4243b1['_hierarchy'])return getHierarchyVal(_0x4243b1['_hierarchy']);else{if(_0x4243b1['positions'])return getHierarchyVal(LngLatArray['toCartesians'](_0x4243b1[_0x2c0a30(0xbb8)]));}}['updateHeight'](_0x2f79ed){const _0x17f825={_0x27d0ea:0xc84,_0x5d0692:0xd93},_0x1195d2=_0x3d5d32;var _0x505e0f;const _0x1a6a45=0x615299,_0x5a76d2=((_0x505e0f=this[_0x1195d2(0xdde)])===null||_0x505e0f===void 0x0?void 0x0:_0x505e0f[_0x1195d2(0x83e)])||0x0;for(let _0x4b3a18=0x0,_0x79a20e=this['primitiveCollection'][_0x1195d2(_0x17f825._0x27d0ea)];_0x4b3a18<_0x79a20e;_0x4b3a18++){const _0x394ead=this['primitiveCollection']['get'](_0x4b3a18),_0x401972=(_0x1a6a45+_0x2f79ed)/(_0x1a6a45+_0x5a76d2),_0x3408a7=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace[(_0x1195d2(0xe95))](_0x401972,_0x401972,_0x401972));_0x394ead[_0x1195d2(_0x17f825._0x5d0692)]=_0x3408a7;}}[_0x3d5d32(0x21f)](_0x287962,_0x107c2c){const _0x551785=_0x3d5d32;return{'type':'Polygon','coordinates':[LngLatArray['toArray'](_0x287962[_0x551785(0xbb8)],_0x107c2c===null||_0x107c2c===void 0x0?void 0x0:_0x107c2c['noAlt'])]};}}register$4('polygonCombine',PolygonCombine),register$4('polygonC',PolygonCombine);class WaterCombine extends PolygonCombine{[_0x3d5d32(0x226)](_0x458950){const _0x2f188f={_0x21d4f3:0xa5e,_0x29de99:0xe07,_0x44f27a:0xe57,_0x23c10f:0x7c0,_0x2f5a15:0x5f4,_0x2d1447:0xff3,_0x2ca48f:0x967,_0x9aa9ce:0x5f4,_0x46bd21:0xf06,_0x488968:0x8f3},_0x18832b=_0x3d5d32;if(!this['show'])return;const _0x5be7af=this['_conversionStyle'](_0x458950);_0x458950['opacity']=_0x458950['opacity']??0.8;const _0xd5e406={'geometryInstances':this['_createGeometryInstance'](_0x5be7af),'appearance':new Cesium__namespace[(_0x18832b(0xbe1))]({'aboveGround':![],'material':new Cesium__namespace['Material']({'fabric':{'type':_0x18832b(_0x2f188f._0x21d4f3),'uniforms':{'specularMap':_0x5be7af['specularMap']||Cesium__namespace['Material']['DefaultImageId'],'normalMap':_0x5be7af['normalMap']||Cesium__namespace['Material']['DefaultImageId'],'frequency':_0x5be7af['frequency']||0x1f40,'animationSpeed':_0x5be7af['animationSpeed']||0.03,'amplitude':_0x5be7af['amplitude']||0x5,'specularIntensity':_0x458950[_0x18832b(_0x2f188f._0x29de99)]||0.8,'baseWaterColor':getCesiumColor(_0x458950['baseWaterColor']||'#123e59')['withAlpha'](_0x458950['opacity']),'blendColor':getCesiumColor(_0x458950['blendColor']||_0x18832b(0x710))[_0x18832b(_0x2f188f._0x44f27a)](_0x458950['opacity'])}}}),'fragmentShaderSource':WaterFS,'translucent':_0x458950['opacity']!==0x1}),'show':this['show']};_0x458950[_0x18832b(_0x2f188f._0x23c10f)]?(_0xd5e406['classificationType']=_0x458950['classificationType']??Cesium__namespace['ClassificationType'][_0x18832b(0x307)],this['_primitive']=this[_0x18832b(_0x2f188f._0x2f5a15)][_0x18832b(_0x2f188f._0x2d1447)](new Cesium__namespace['GroundPrimitive'](_0xd5e406))):this['_primitive']=this['primitiveCollection']['add'](new Cesium__namespace['Primitive'](_0xd5e406));this[_0x18832b(_0x2f188f._0x2ca48f)]&&(this[_0x18832b(_0x2f188f._0x9aa9ce)][_0x18832b(_0x2f188f._0x46bd21)](this['_primitive_outline']),delete this['_primitive_outline']);if(_0x458950['outline']){const _0x16eb05=this[_0x18832b(_0x2f188f._0x488968)](_0x458950);this['_primitive_outline']=this['_createPolylineOutline'](_0x16eb05);}}}register$4('waterCombine',WaterCombine),register$4('waterC',WaterCombine);class RectangleCombine extends BasePolyCombine{['_conversionStyle'](_0x40a454){return RectangleStyleConver['toCesiumVal'](_0x40a454);}[_0x3d5d32(0x53e)](_0x20f46d,_0x245ec8){return RectangleStyleConver['toJSON'](_0x20f46d,_0x245ec8);}['_createGeometryInstanceItem'](_0x3d4e55,_0x2c61dd,_0x53d81f){const _0x260c42={_0x268cf6:0x83d,_0x15f273:0x62a,_0xda9e9b:0x890,_0x12736a:0xbb8,_0x5cd910:0xded,_0x4c1ce4:0x570},_0x15423e=_0x3d5d32,_0x415756=RectangleStyleConver[_0x15423e(_0x260c42._0x268cf6)]({...this['options']['style'],..._0x53d81f[_0x15423e(0xdde)]||{}});_0x415756['vertexFormat']=_0x415756['vertexFormat']||_0x3d4e55['vertexFormat'];let _0x3271b1=this['_getColorByColorMaterial'](_0x415756);_0x2c61dd&&_0x415756[_0x15423e(_0x260c42._0x15f273)]&&(_0x3271b1=_0x415756['outlineColor']);_0x3271b1['alpha']!==0x1&&(this['translucent']=!![]);const _0x5d1be8=_0x53d81f['positions']=LngLatArray[_0x15423e(_0x260c42._0xda9e9b)](_0x53d81f[_0x15423e(_0x260c42._0x12736a)]);_0x415756[_0x15423e(0x5a3)]=Cesium__namespace[_0x15423e(0x756)]['fromCartesianArray'](_0x5d1be8);Cesium__namespace['defined'](_0x415756['rectangle'])&&(Cesium__namespace[_0x15423e(0xb84)](this[_0x15423e(0x570)])?this['_rectangle']=Cesium__namespace['Rectangle'][_0x15423e(_0x260c42._0x5cd910)](_0x415756[_0x15423e(0x5a3)],this['_rectangle']):this[_0x15423e(_0x260c42._0x4c1ce4)]=_0x415756['rectangle']);const _0x4e2ceb=_0x2c61dd?Cesium__namespace['RectangleOutlineGeometry']:Cesium__namespace[_0x15423e(0x108a)],_0x239fdd=new Cesium__namespace['GeometryInstance']({'geometry':new _0x4e2ceb(_0x415756),'attributes':{'color':Cesium__namespace[_0x15423e(0x64f)]['fromColor'](_0x3271b1),'distanceDisplayCondition':_0x415756['distanceDisplayCondition']}});return _0x239fdd;}}register$4('rectangleC',RectangleCombine);class EditDivGraphic extends EditBase{get['container'](){const _0x552537={_0x19ca3e:0x6cc},_0x309a52=_0x3d5d32;return this[_0x309a52(_0x552537._0x19ca3e)][_0x309a52(0x51f)];}['activate'](){const _0x1ad3e7={_0x5b80ff:0x86e,_0x5981b3:0x34f,_0x5a9ce6:0xd6a,_0x17af36:0x21e,_0x5f4975:0x1d1,_0x40c54a:0xd1b},_0x426985=_0x3d5d32;if(this['_enabled'])return this;return this[_0x426985(_0x1ad3e7._0x5b80ff)]=!![],this['container'][_0x426985(_0x1ad3e7._0x5981b3)]('mousemove',this[_0x426985(0x9a6)]['bind'](this)),this['container']['addEventListener']('mouseout',this['_onMouseOut']['bind'](this)),this['container']['addEventListener']('mousedown',this[_0x426985(_0x1ad3e7._0x5a9ce6)][_0x426985(_0x1ad3e7._0x17af36)](this)),addClass(this['container'],this['_graphic'][_0x426985(0xdde)]['editClassName']||'mars3d-divGraphic-edit'),this['_graphic'][_0x426985(0x3cb)]=this[_0x426985(_0x1ad3e7._0x5f4975)]['getLangText']('_拖动对象后')+'
'+this['_map'][_0x426985(_0x1ad3e7._0x40c54a)]('_修改位置')+'
'+this['_map']['getLangText'](_0x426985(0x2a4)),this['_graphic']['onDragEnd']=(_0x417cc3,_0x583d85,_0x137171)=>{this['_graphic']['position']=_0x583d85,this['fire'](EventType['editMovePoint'],{'mouseEvent':_0x137171,'cartesian':_0x583d85});},this['_last_contextmenuConfig']=this['_graphic']['_contextmenuConfig'],this['_graphic']['bindContextMenu'](this['getDraggerContextMenu'](this['_graphic'])),this['fire'](EventType['editStart']),this;}['disable'](){const _0x4ecd15={_0x328021:0x6cc,_0x77bb64:0x8e4,_0xe15f1d:0xee1,_0x1deab8:0x9a6,_0x12c2df:0xd6a,_0x232219:0xf33},_0x3f56a9=_0x3d5d32;if(!this['_enabled'])return this;return this['_enabled']=![],this[_0x3f56a9(0x518)](),delete this[_0x3f56a9(_0x4ecd15._0x328021)]['onDragEnd'],delete this['_graphic']['_draw_tooltip'],this['_graphic']['unbindContextMenu'](),this['_last_contextmenuConfig']&&(this['_graphic']['_contextmenuConfig']=this['_last_contextmenuConfig'],delete this[_0x3f56a9(_0x4ecd15._0x77bb64)]),this[_0x3f56a9(0x6c2)]['removeEventListener'](_0x3f56a9(_0x4ecd15._0xe15f1d),this[_0x3f56a9(_0x4ecd15._0x1deab8)]),this[_0x3f56a9(0x6c2)]['removeEventListener']('mouseout',this[_0x3f56a9(0xdcb)]),this[_0x3f56a9(0x6c2)][_0x3f56a9(0xd42)]('mousedown',this[_0x3f56a9(_0x4ecd15._0x12c2df)]),this['unbindEvent'](),removeClass(this['container'],this['_graphic']['style']['editClassName']||_0x3f56a9(_0x4ecd15._0x232219)),this['fire'](EventType['editStop']),this;}[_0x3d5d32(0x8f6)](){const _0x1569a5=_0x3d5d32;this['_mouseMoveHandle']&&document[_0x1569a5(0xd42)](_0x1569a5(0xee1),this['_mouseMoveHandle'],![]),this[_0x1569a5(0x870)]&&document[_0x1569a5(0xd42)]('mouseup',this[_0x1569a5(0x870)],![]),this['_map']['setCursor'](![]);}['_onMouseMove'](_0x7ddea7){const _0x4dc920={_0x4f2612:0x3cb,_0x227ec1:0x6cc,_0x2819b2:0xd86},_0x64a715=_0x3d5d32;if(this['_graphic'][_0x64a715(_0x4dc920._0x4f2612)]){const _0x594321=this[_0x64a715(_0x4dc920._0x227ec1)][_0x64a715(0xa0b)](_0x7ddea7);this[_0x64a715(0x1d1)][_0x64a715(_0x4dc920._0x2819b2)](_0x594321,this['_graphic']['_draw_tooltip']);}}['_onMouseOut'](_0x2e9a5b){this['_map']['closeSmallTooltip']();}['_onMarkerDragStart'](_0x55f18c){const _0x310cf7={_0xf2ed80:0x8d3,_0x4aa706:0x34f},_0x5968a3=_0x3d5d32;if(!this['_enabled']||_0x55f18c['which']!==0x1)return;_0x55f18c['preventDefault'](),this[_0x5968a3(0x1d1)]['setCursor'](!![]),this['fire'](EventType[_0x5968a3(0xe26)],{'mouseEvent':_0x55f18c}),this['unbindEvent'](),!this['_mouseMoveHandle']&&(this[_0x5968a3(_0x310cf7._0xf2ed80)]=_0x314d53=>{this['_onMarkerDrag'](_0x314d53);},this['_mouseUpHandle']=_0x591107=>{this['_onMarkerDragEnd'](_0x591107);}),document[_0x5968a3(_0x310cf7._0x4aa706)]('mousemove',this['_mouseMoveHandle'],![]),document['addEventListener']('mouseup',this['_mouseUpHandle'],![]);}[_0x3d5d32(0xaff)](_0x1c768e){const _0x2143cd={_0x442831:0x6cc,_0x51a2cd:0xb69},_0x268820=_0x3d5d32;if(!this['_enabled'])return;_0x1c768e['preventDefault']();const _0x1d9015=this[_0x268820(_0x2143cd._0x442831)]['_getWindowPosition'](_0x1c768e),_0x47e17d=getCurrentMousePosition(this['_map']['scene'],_0x1d9015);if(!_0x47e17d)return;this['_graphic'][_0x268820(_0x2143cd._0x51a2cd)]=_0x47e17d,this['_map']['openSmallTooltip'](_0x1d9015,this['_map'][_0x268820(0xd1b)]('_释放后完成修改')),this['fire'](EventType['editMouseMove'],{'mouseEvent':_0x1c768e,'cartesian':_0x47e17d,'windowPosition':_0x1d9015});}['_onMarkerDragEnd'](_0x23382b){const _0x178bcc={_0x277b9b:0x86e,_0x382c22:0x6cc},_0x4d6168=_0x3d5d32;if(!this[_0x4d6168(_0x178bcc._0x277b9b)])return;_0x23382b[_0x4d6168(0xaa3)](),this['unbindEvent'](),this['_map'][_0x4d6168(0xc62)]();const _0x484f39=this[_0x4d6168(_0x178bcc._0x382c22)]['_getWindowPosition'](_0x23382b);this[_0x4d6168(0xefc)](EventType['editMovePoint'],{'mouseEvent':_0x23382b,'cartesian':this['_graphic']['position'],'windowPosition':_0x484f39});}[_0x3d5d32(0xb54)](_0x3e27e0){const _0x1b0c12={_0x45afe9:0xb69,_0x3b7aba:0xedb},_0x49034d=_0x3d5d32;if(!this[_0x49034d(0xedb)]||!_0x3e27e0[_0x49034d(_0x1b0c12._0x45afe9)])return;this[_0x49034d(_0x1b0c12._0x3b7aba)]['position']=_0x3e27e0['position'];}}const isFirefox=window['navigator']['userAgent'][_0x3d5d32(0x386)]()[_0x3d5d32(0x54b)]('firefox')>=0x0;class DivGraphic extends BaseGraphic{constructor(_0x5d371f={}){const _0x22057e={_0x4536f5:0x8eb,_0x3f67bb:0xdde,_0x2209a4:0x55c,_0x1571fb:0x433,_0x2bd1b6:0xcfa},_0x3d3138=_0x3d5d32;super(_0x5d371f),this['_hasEdit']=this['options'][_0x3d3138(_0x22057e._0x4536f5)]??this['style'][_0x3d3138(_0x22057e._0x4536f5)]??!![],this['_depthTest']=this['options']['depthTest']??this[_0x3d3138(0xdde)]['depthTest']??!![],this['_hasCache']=this['options']['hasCache']??this['style'][_0x3d3138(0xa08)]??!![],this['_hasZIndex']=this['options']['hasZIndex']??this[_0x3d3138(_0x22057e._0x3f67bb)]['hasZIndex']??![],this['_css_transform_origin']=this['style'][_0x3d3138(_0x22057e._0x2209a4)]??_0x3d3138(0xcf0),this[_0x3d3138(_0x22057e._0x1571fb)]['frameRate']=this['options']['frameRate']??0x1,this[_0x3d3138(0x433)]['testPoint']=merge({'name':'用于与DIV点进行对比测试位置的点','color':'#ff0000','pixelSize':0x8,'distanceDisplayCondition':this['style']['distanceDisplayCondition'],'scaleByDistance':this['style']['scaleByDistance'],'clampToGround':this['style']['clampToGround'],'heightReference':this['style']['heightReference']},this['options'][_0x3d3138(_0x22057e._0x2bd1b6)]),_0x5d371f[_0x3d3138(0xb69)]&&(this['position']=_0x5d371f['position']);}get['position'](){const _0x294e3c=_0x3d5d32;return this[_0x294e3c(0x87d)];}set[_0x3d5d32(0xb69)](_0x42953e){const _0x41462f={_0x3cb572:0xb84,_0x356981:0x1003,_0x191df1:0xe7f,_0x51a3cf:0x87d,_0x2d6964:0xc3c,_0xdab35e:0xefc,_0xbb7455:0x3e8,_0x3b5d5d:0x87d},_0xf0991f=_0x3d5d32;var _0x23a76d;this['_point']=LngLatPoint['parse'](_0x42953e);if(this[_0xf0991f(0xe7f)]){let _0x3f47b3=this['style'][_0xf0991f(0x9e4)];Cesium__namespace[_0xf0991f(_0x41462f._0x3cb572)](_0x3f47b3)&&(isString(_0x3f47b3)&&(_0x3f47b3=Number(template(_0x3f47b3,this['attr'],!![])),isNaN(_0x3f47b3)&&(_0x3f47b3=0x0)),this['_point']['alt']=_0x3f47b3);const _0x37afeb=this[_0xf0991f(_0x41462f._0x356981)]();_0x37afeb!==0x0&&(this[_0xf0991f(0xe7f)]['alt']=this[_0xf0991f(_0x41462f._0x191df1)]['alt']+_0x37afeb);}this[_0xf0991f(_0x41462f._0x51a3cf)]=(_0x23a76d=this['_point'])===null||_0x23a76d===void 0x0?void 0x0:_0x23a76d['toCartesian'](),this['debuggerPointEntity']&&(this['debuggerPointEntity']['position']=this['_position']),this[_0xf0991f(_0x41462f._0x2d6964)](),this[_0xf0991f(_0x41462f._0xdab35e)](EventType[_0xf0991f(_0x41462f._0xbb7455)],{'position':this[_0xf0991f(_0x41462f._0x3b5d5d)]});}get[_0x3d5d32(0xbbe)](){const _0x59d568={_0x2cc422:0xe7f},_0x9482af=_0x3d5d32;return this[_0x9482af(_0x59d568._0x2cc422)];}get['coordinate'](){return this['getCoordinate']();}get['center'](){const _0x5d4d4d=_0x3d5d32;return this[_0x5d4d4d(0x87d)];}get[_0x3d5d32(0x4b5)](){return this['_position_show'];}get['testPoint'](){return this['debuggerPointEntity']!=null;}set['testPoint'](_0x5d0106){const _0x47896b={_0x43e973:0xcfa},_0x4adc49=_0x3d5d32;this['debuggerPointEntity']&&(this['_layer']['dataSource']['entities']['remove'](this['debuggerPointEntity']),delete this['debuggerPointEntity']),_0x5d0106&&(this[_0x4adc49(0x733)]=this['_layer']['dataSource']['entities']['add']({'name':this['options']['testPoint'][_0x4adc49(0xaed)],'position':this['position'],'point':PointStyleConver['toCesiumVal'](this['options'][_0x4adc49(_0x47896b._0x43e973)])}));}get[_0x3d5d32(0x4fb)](){const _0x3a8ea6={_0x2e65a4:0x4fb},_0x87b650=_0x3d5d32;return this['options'][_0x87b650(_0x3a8ea6._0x2e65a4)];}set[_0x3d5d32(0x4fb)](_0x149c16){const _0x1c8e1b=_0x3d5d32;this['options'][_0x1c8e1b(0x4fb)]=_0x149c16,this['_updatePointerEvents'](_0x149c16);}get[_0x3d5d32(0x3a1)](){return this['_enabledEdit'];}get['EditClass'](){return EditDivGraphic;}get[_0x3d5d32(0x6bb)](){return this['_depthTest'];}set['depthTest'](_0x194790){const _0x17198f={_0x3c0528:0xff7},_0x3e46b2=_0x3d5d32;this[_0x3e46b2(_0x17198f._0x3c0528)]=_0x194790,this[_0x3e46b2(0x6c4)]=null;}get[_0x3d5d32(0x7c0)](){const _0x10a6e0=_0x3d5d32;return this[_0x10a6e0(0xdde)]['clampToGround'];}set[_0x3d5d32(0x7c0)](_0x16bded){const _0x2b82f1=_0x3d5d32;this['style'][_0x2b82f1(0x7c0)]=_0x16bded,this['_calculateAsynSurfacePosition']();}get['parentContainer'](){if(this['options']['parentContainer'])return this['options']['parentContainer'];return this['_layer']['container'];}get['parentContainerId'](){var _0x454d60;return(_0x454d60=this['parentContainer'])===null||_0x454d60===void 0x0?void 0x0:_0x454d60['id'];}get['container'](){return this['_container'];}get['containerId'](){return this['_container']['id'];}get['html'](){const _0xb77871={_0x3aa89d:0xae5},_0x3c731d=_0x3d5d32;return this['_container'][_0x3c731d(_0xb77871._0x3aa89d)];}set[_0x3d5d32(0xe6d)](_0x350777){const _0x5bebd9={_0x227586:0xdde,_0x5ac67b:0x7e5,_0x4a1d32:0x411,_0x1d3845:0x85b,_0x4550b6:0xefc,_0x1c2b8d:0xdc3},_0x120dd9={_0x5a640e:0xe6d},_0x4aaed3=_0x3d5d32;this['style']['html']=_0x350777;if(!this['_container']||!_0x350777)return;typeof _0x350777==='function'&&(_0x350777=_0x350777(this['eventTarget']));if(_0x350777 instanceof Promise){_0x350777[_0x4aaed3(0x44d)](_0x863e65=>{const _0x1e9c10=_0x4aaed3;if(!this[_0x1e9c10(0x433)])return;this['_camera_cache']=null,this[_0x1e9c10(_0x120dd9._0x5a640e)]=_0x863e65;});return;}if(isString(_0x350777)){if(this[_0x4aaed3(0xe12)]instanceof Promise){this['attr']['then'](_0xa3493d=>{if(!this['options'])return;this['_camera_cache']=null,this['attr']=_0xa3493d,this['html']=_0x350777;});return;}this['style'][_0x4aaed3(0x8a5)]&&(_0x350777=this[_0x4aaed3(_0x5bebd9._0x227586)][_0x4aaed3(0x8a5)]['replace'](_0x4aaed3(_0x5bebd9._0x5ac67b),_0x350777)),this['_container']['innerHTML']=template(_0x350777,this['attr'],this['style'][_0x4aaed3(_0x5bebd9._0x4a1d32)]??!![]),this['fire'](EventType['load']);}else(_0x350777 instanceof Element||_0x350777 instanceof HTMLDivElement)&&(empty(this['_container']),_0x350777['style']['display']!=='block'&&(_0x350777['style']['display']='block'),this[_0x4aaed3(0x51f)][_0x4aaed3(_0x5bebd9._0x1d3845)](_0x350777),this[_0x4aaed3(_0x5bebd9._0x4550b6)](EventType['load']));if(this['style']['className']){var _0x2907d;if(((_0x2907d=this[_0x4aaed3(0x51f)][_0x4aaed3(0x68c)])===null||_0x2907d===void 0x0?void 0x0:_0x2907d['length'])>0x0)for(let _0x1a665e=0x0,_0xa3f1b3=this['_container']['children'][_0x4aaed3(0xc84)];_0x1a665e<_0xa3f1b3;_0x1a665e++){const _0x3230b1=this['_container']['children'][_0x1a665e];addClass(_0x3230b1,this['style'][_0x4aaed3(_0x5bebd9._0x1c2b8d)]);}else addClass(this['_container'],this['style']['className']);}this['_appendHtmlHook']&&this['_appendHtmlHook'](),this[_0x4aaed3(0x6c4)]=null;}get['divWidth'](){const _0xcd2f96={_0x3ec3d0:0x51f},_0xd1130f=_0x3d5d32;var _0x275ecc;return(_0x275ecc=this[_0xd1130f(_0xcd2f96._0x3ec3d0)])===null||_0x275ecc===void 0x0?void 0x0:_0x275ecc['offsetWidth'];}get['divHeight'](){const _0x3e85fc={_0x2dec9f:0x804},_0x5b6a4f=_0x3d5d32;var _0x23ad74;return(_0x23ad74=this['_container'])===null||_0x23ad74===void 0x0?void 0x0:_0x23ad74[_0x5b6a4f(_0x3e85fc._0x2dec9f)];}get[_0x3d5d32(0x7ea)](){return this;}['_showHook'](_0x5b9009){const _0x3822bb={_0x15097f:0x51f,_0x475e1d:0xa8d},_0x22b917=_0x3d5d32;if(!this['_container'])return;_0x5b9009?(this['_camera_cache']=null,this[_0x22b917(_0x3822bb._0x15097f)]['style']['display']='block'):this[_0x22b917(_0x3822bb._0x475e1d)](),this['debuggerPointEntity']&&(this['debuggerPointEntity']['show']=_0x5b9009);}['_updatePointerEvents'](_0x16f0a2){const _0x5d9b05={_0x584d01:0x51f,_0x414a9a:0x51f,_0x3ec4f6:0xdde},_0x4c7e52=_0x3d5d32;this[_0x4c7e52(_0x5d9b05._0x584d01)]&&(_0x16f0a2?this[_0x4c7e52(_0x5d9b05._0x414a9a)][_0x4c7e52(_0x5d9b05._0x3ec4f6)]['pointer-events']=_0x4c7e52(0xe77):this['_container']['style']['pointer-events']='none');}[_0x3d5d32(0xb2d)](_0x3b633){const _0x5d9986={_0x53479d:0x51f,_0x5cd615:0xfdc},_0x1a5884=_0x3d5d32;this[_0x1a5884(0xdde)]['globalAlpha']=_0x3b633,this['_container']&&(this[_0x1a5884(_0x5d9986._0x53479d)]['style'][_0x1a5884(_0x5d9986._0x5cd615)]=_0x3b633);}['hasBindEvent'](){const _0x1c361c={_0xaebe7:0x204,_0x13701d:0x78f},_0x30330d=_0x3d5d32;var _0x5be916,_0x535534,_0x2f7aaf;if(this['listens'](EventType['click']))return!![];if(this[_0x30330d(_0x1c361c._0xaebe7)](EventType['mouseOver']))return!![];if(this['listens'](EventType['mouseOut']))return!![];if(this[_0x30330d(0xed2)](![]))return!![];if(this['hasTooltip'](![]))return!![];if(Cesium__namespace['defined'](this['options']['pointerEvents']))return this['options']['pointerEvents'];if((_0x5be916=this['_layer'])!==null&&_0x5be916!==void 0x0&&_0x5be916['listens'](EventType['click']))return!![];if((_0x535534=this['_layer'])!==null&&_0x535534!==void 0x0&&_0x535534['listens'](EventType[_0x30330d(0xef1)]))return!![];if((_0x2f7aaf=this['_layer'])!==null&&_0x2f7aaf!==void 0x0&&_0x2f7aaf[_0x30330d(0x204)](EventType['mouseOut']))return!![];if(this['hasPopup'](!![]))return!![];if(this[_0x30330d(_0x1c361c._0x13701d)](!![]))return!![];return![];}['_onEventHook'](){const _0x320fba={_0x46de6e:0xf3c},_0x5498ff=_0x3d5d32;this['_updatePointerEvents'](this[_0x5498ff(_0x320fba._0x46de6e)]());}['_mountedHook'](){const _0x27da72={_0x5ed849:0xe6d},_0x3a3604=_0x3d5d32;DivGraphicStyleConver['toCesiumVal'](this['style'],this),this[_0x3a3604(0x51f)]=create$3('div','mars3d-divGraphic\x20',this['parentContainer']),this['_container']['id']=this['id'],this['_container'][_0x3a3604(0xdde)]['opacity']=this['style']['globalAlpha'],this[_0x3a3604(0xdde)][_0x3a3604(0xe6d)]&&(this[_0x3a3604(0xe6d)]=this['style'][_0x3a3604(_0x27da72._0x5ed849)]),this['_updatePointerEvents'](this['hasBindEvent']());}['_addedHook'](_0x5e5145){const _0x48a60a={_0x4163f0:0x85b,_0x5a3801:0x837,_0x4d9ffa:0x34f,_0x42a8f2:0x21e},_0x5a554c=_0x3d5d32;this['_layer']['container'][_0x5a554c(_0x48a60a._0x4163f0)](this['_container']),this['hide'](),this['_container']['addEventListener']('click',this[_0x5a554c(_0x48a60a._0x5a3801)][_0x5a554c(0x21e)](this)),this['_container']['addEventListener'](_0x5a554c(0xf59),this['_container_onMousedownHandler']['bind'](this)),this['_container']['addEventListener']('mousemove',this[_0x5a554c(0x6b1)]['bind'](this)),this[_0x5a554c(0x51f)][_0x5a554c(_0x48a60a._0x4d9ffa)]('mouseout',this['_container_onMouseoutHandler'][_0x5a554c(_0x48a60a._0x42a8f2)](this)),this['_calculateAsynSurfacePosition'](),this['bindUpdateEvent']();}['_removedHook'](){const _0x36b3c6={_0x54e199:0x1d1,_0xb0e10c:0xd42,_0x401214:0x51f},_0x4ad012=_0x3d5d32;this['stopDraw'](),this[_0x4ad012(_0x36b3c6._0x54e199)]['off'](EventType['terrainChange'],this['_onTerrainChangeHandler'],this),this['testPoint']=![],this['_container'][_0x4ad012(_0x36b3c6._0xb0e10c)]('click',this['_container_onClickHandler']),this['_container']['removeEventListener']('mousedown',this[_0x4ad012(0x3f5)]),this['_container']['removeEventListener'](_0x4ad012(0xee1),this['_container_onMouseMoveHandler']),this['_container']['removeEventListener']('mouseout',this['_container_onMouseoutHandler']),remove(this[_0x4ad012(_0x36b3c6._0x401214)]);}['_calculateAsynSurfacePosition'](){const _0x5e10a5={_0x50ced8:0xc0a,_0x2c2439:0x27d,_0x2d5591:0x2d5,_0x22f781:0x44d,_0x2a3e79:0xf6a,_0x1d17c1:0x1d1},_0x42a15e=_0x3d5d32;this[_0x42a15e(0x6c4)]=null,this[_0x42a15e(_0x5e10a5._0x50ced8)]=![];const _0xbec225=this[_0x42a15e(0xb69)];_0xbec225 instanceof Cesium__namespace['Cartesian3']&&(this['style']['clampToGround']||this['style'][_0x42a15e(_0x5e10a5._0x2c2439)]===Cesium__namespace[_0x42a15e(_0x5e10a5._0x2d5591)]['CLAMP_TO_GROUND']||this['style']['heightReference']===Cesium__namespace['HeightReference']['RELATIVE_TO_GROUND'])&&(getSurfaceHeight(this[_0x42a15e(0x1d1)][_0x42a15e(0xfc1)],_0xbec225,this['options'])[_0x42a15e(_0x5e10a5._0x22f781)](_0x217082=>{const _0x44ce5a=_0x42a15e;if(this[_0x44ce5a(0xf54)])return;this[_0x44ce5a(0xdde)]['heightReference']===Cesium__namespace['HeightReference']['RELATIVE_TO_GROUND']&&(_0x217082['point'][_0x44ce5a(0xd29)]+=_0x217082['height_original']),this['position']=_0x217082['point'],this['_hasAsynSurfacePosition']=!![];}),this['_map'][_0x42a15e(0x9e7)](EventType[_0x42a15e(0xff2)],this[_0x42a15e(_0x5e10a5._0x2a3e79)],this),this[_0x42a15e(_0x5e10a5._0x1d17c1)]['on'](EventType[_0x42a15e(0xff2)],this['_onTerrainChangeHandler'],this));}['_onTerrainChangeHandler'](_0x21248a){this['_map']&&this['_calculateAsynSurfacePosition']();}['_updateStyleBaseHook'](_0x182e40){const _0x282271={_0x45468e:0xe6d,_0xb8a7ea:0xdde},_0x3e4e6e=_0x3d5d32;return _0x182e40['html']&&(this['html']=_0x182e40[_0x3e4e6e(_0x282271._0x45468e)]),DivGraphicStyleConver['toCesiumVal'](this[_0x3e4e6e(_0x282271._0xb8a7ea)],this),(Cesium__namespace[_0x3e4e6e(0xb84)](_0x182e40['setHeight'])||Cesium__namespace['defined'](_0x182e40['addHeight']))&&(this['position']=this['_point']),this['_camera_cache']=null,this[_0x3e4e6e(0xc3c)](),this;}[_0x3d5d32(0x897)](){return this['_camera_cache']=null,this['_updateDivPosition'](),this;}['update'](_0x453d0f){const _0x400afa={_0x2131b1:0xf51,_0x8a359:0xdde,_0x3eb0a5:0x6c2,_0x43a293:0x9cc},_0x265618=_0x3d5d32;if(!this['_map'])return;this['style'][_0x265618(_0x400afa._0x2131b1)]&&this['style']['html']&&(this['html']=this[_0x265618(_0x400afa._0x8a359)]['html']),this['_updateDivPosition'](),this[_0x265618(0xefc)](EventType['postRender'],{'container':this[_0x265618(_0x400afa._0x3eb0a5)]},![]),this[_0x265618(_0x400afa._0x43a293)]&&this['fireTarget'](EventType[_0x265618(0x51a)],{'container':this['container']},![]);}[_0x3d5d32(0xc3c)](){const _0x29c92d={_0x12561c:0xe0f,_0x885edf:0xd82,_0xb499d8:0xf74,_0x3ea0e7:0x6c4,_0x3b208c:0xfc1,_0x40450a:0x64c,_0x4ba79c:0x54d,_0x5ceb7e:0x8c3,_0x450bb6:0x6bb,_0x5e6bca:0xdde,_0x3ee36:0x6f6,_0x646fb0:0xa8d,_0x29338e:0x51f,_0x5d3792:0x6f6,_0x3790ae:0xaec,_0x36462f:0xd73,_0x7245e9:0x234,_0x1dddac:0x1e7,_0x2500d5:0xdde,_0x19a73e:0xbd3,_0x54b7bf:0x585,_0x1770f9:0x418,_0x43a63e:0x101a},_0x41558f=_0x3d5d32;var _0x705dc8;if(!this['show']||!this[_0x41558f(0x1d1)])return![];const _0x1d09d0=this['_map']['scene'],_0x194eae=this['_map']['camera'];let _0x85eb86=getPositionValue(this['position'],(_0x705dc8=this['_map'])===null||_0x705dc8===void 0x0?void 0x0:_0x705dc8['clock']['currentTime']);if(!Cesium__namespace[_0x41558f(0xb84)](_0x85eb86))return this['hide'](),![];if(this['_hasCache']){const _0x14d85f={'x':_0x85eb86['x'],'y':_0x85eb86['y'],'z':_0x85eb86['z'],'p1':this['_map']['container'][_0x41558f(_0x29c92d._0x12561c)],'p2':this[_0x41558f(0x1d1)]['container'][_0x41558f(_0x29c92d._0x885edf)],'p3':_0x194eae['positionWC']['x'],'p4':_0x194eae['positionWC']['y'],'p5':_0x194eae[_0x41558f(_0x29c92d._0xb499d8)]['z'],'p6':_0x194eae['heading'],'p7':_0x194eae['pitch'],'p8':_0x194eae['roll']};if(this[_0x41558f(0x6c4)]&&_0x14d85f['x']===this['_camera_cache']['x']&&_0x14d85f['x']===this['_camera_cache']['x']&&_0x14d85f['y']===this[_0x41558f(0x6c4)]['y']&&_0x14d85f['z']===this['_camera_cache']['z']&&_0x14d85f['p1']===this['_camera_cache']['p1']&&_0x14d85f['p2']===this['_camera_cache']['p2']&&_0x14d85f['p3']===this['_camera_cache']['p3']&&_0x14d85f['p4']===this['_camera_cache']['p4']&&_0x14d85f['p5']===this[_0x41558f(_0x29c92d._0x3ea0e7)]['p5']&&_0x14d85f['p6']===this['_camera_cache']['p6']&&_0x14d85f['p7']===this[_0x41558f(0x6c4)]['p7']&&_0x14d85f['p8']===this['_camera_cache']['p8'])return!![];this['_camera_cache']=_0x14d85f;}if(!this['_hasAsynSurfacePosition']){if(this['style']['clampToGround']||this['style']['heightReference']===Cesium__namespace['HeightReference'][_0x41558f(0xe25)])_0x85eb86=getSurfacePosition(this['_map'][_0x41558f(_0x29c92d._0x3b208c)],_0x85eb86,this['options']);else this['style']['heightReference']===Cesium__namespace[_0x41558f(0x2d5)][_0x41558f(_0x29c92d._0x40450a)]&&(_0x85eb86=getSurfacePosition(this['_map']['scene'],_0x85eb86,{...this['options'],'relativeHeight':!![]}));}this['_position_show']=_0x85eb86;const _0x55b18c=Cesium__namespace[_0x41558f(_0x29c92d._0x4ba79c)]['wgs84ToWindowCoordinates'](_0x1d09d0,_0x85eb86),_0x41f7d6=this['distanceDisplayCondition'],_0x272561=this[_0x41558f(_0x29c92d._0x5ceb7e)];let _0x32c139=_0x194eae['positionCartographic'][_0x41558f(0x83e)];(this['_hasZIndex']||_0x41f7d6||_0x272561)&&(_0x1d09d0['mode']===Cesium__namespace['SceneMode']['SCENE3D']&&(_0x32c139=Cesium__namespace['Cartesian3'][_0x41558f(0xbd7)](_0x85eb86,_0x194eae[_0x41558f(0xf74)])));if(!_0x55b18c||_0x41f7d6&&(_0x41f7d6['near']>_0x32c139||_0x41f7d6['far']<_0x32c139))return this['_container']['style'][_0x41558f(0xd92)]==='block'&&this['hide'](),![];if(this[_0x41558f(_0x29c92d._0x450bb6)]&&_0x1d09d0['mode']===Cesium__namespace['SceneMode']['SCENE3D']){const _0x3a4571=new Cesium__namespace['EllipsoidalOccluder'](_0x1d09d0['globe']['ellipsoid'],_0x1d09d0[_0x41558f(0x435)]['positionWC']),_0x438cc4=_0x3a4571['isPointVisible'](_0x85eb86);if(!_0x438cc4)return this['_container'][_0x41558f(_0x29c92d._0x5e6bca)][_0x41558f(0xd92)]===_0x41558f(_0x29c92d._0x3ee36)&&this[_0x41558f(_0x29c92d._0x646fb0)](),![];}this[_0x41558f(_0x29c92d._0x29338e)]['style'][_0x41558f(0xd92)]!==_0x41558f(_0x29c92d._0x5d3792)&&(this['_camera_cache']=null,this['_container']['style']['display']='block');const _0x1ecd08=this[_0x41558f(_0x29c92d._0x3790ae)],_0x270ad5=this['divWidth'];let _0x2735b7,_0x2d1935;switch(this['horizontalOrigin']){case _0x41558f(_0x29c92d._0x36462f):case Cesium__namespace['HorizontalOrigin'][_0x41558f(0xd73)]:_0x2735b7=_0x55b18c['x']-_0x270ad5/0x2;break;case _0x41558f(_0x29c92d._0x7245e9):case Cesium__namespace['HorizontalOrigin']['RIGHT']:_0x2735b7=_0x55b18c['x']-_0x270ad5;break;case'LEFT':case Cesium__namespace[_0x41558f(_0x29c92d._0x1dddac)]['LEFT']:default:_0x2735b7=_0x55b18c['x'];break;}switch(this['verticalOrigin']){case _0x41558f(0x1f8):case Cesium__namespace['VerticalOrigin']['TOP']:_0x2d1935=_0x55b18c['y'];break;case _0x41558f(0xd73):case Cesium__namespace[_0x41558f(0xc0f)][_0x41558f(0xd73)]:_0x2d1935=_0x55b18c['y']-_0x1ecd08/0x2;break;case'BOTTOM':case Cesium__namespace['VerticalOrigin']['BOTTOM']:default:_0x2d1935=_0x55b18c['y']-_0x1ecd08;break;}this['style'][_0x41558f(0x72a)]?(_0x2735b7+=this['style']['anchor'][0x0],_0x2d1935+=this[_0x41558f(_0x29c92d._0x2500d5)]['anchor'][0x1]):(this['style'][_0x41558f(0xd32)]&&(_0x2735b7+=this['style']['offsetX']),this['style'][_0x41558f(_0x29c92d._0x19a73e)]&&(_0x2d1935+=this[_0x41558f(0xdde)]['offsetY']));let _0x58b06a=0x1;if(_0x272561){if(_0x32c139<=_0x272561[_0x41558f(_0x29c92d._0x54b7bf)])_0x58b06a=_0x272561['nearValue'];else _0x32c139>_0x272561[_0x41558f(0x585)]&&_0x32c139<_0x272561['far']?_0x58b06a=_0x272561['nearValue']+(_0x272561['farValue']-_0x272561[_0x41558f(0xb03)])*(_0x32c139-_0x272561['near'])/(_0x272561[_0x41558f(_0x29c92d._0x1770f9)]-_0x272561[_0x41558f(_0x29c92d._0x54b7bf)]):_0x58b06a=_0x272561[_0x41558f(0xc75)];}const _0xb6825='matrix('+_0x58b06a+',0,0,'+_0x58b06a+','+_0x2735b7+','+_0x2d1935+')',_0x2c603d=this['_css_transform_origin'];let _0xd34412=this['options'][_0x41558f(0x377)]||_0x41558f(0x423);this['_hasZIndex']&&(_0xd34412=Math[_0x41558f(_0x29c92d._0x43a63e)](0x98967f-_0x32c139),_0xd34412<=0x0&&(_0xd34412=0x98967f)),merge(this['_container']['style'],{'transform':_0xb6825,'transform-origin':_0x2c603d,'-ms-transform':_0xb6825,'-ms-transform-origin':_0x2c603d,'-webkit-transform':_0xb6825,'-webkit-transform-origin':_0x2c603d,'-moz-transform':_0xb6825,'-moz-transform-origin':_0x2c603d,'-o-transform':_0xb6825,'-o-transform-origin':_0x2c603d,'z-index':_0xd34412}),this['fire'](EventType['change'],{'position':_0x85eb86,'windowPosition':_0x55b18c,'distance':_0x32c139,'x':_0x2735b7,'y':_0x2d1935,'height':_0x1ecd08,'width':_0x270ad5,'scale':_0x58b06a},!![]);}[_0x3d5d32(0xa8d)](){const _0x55a42e=_0x3d5d32;this['_container'][_0x55a42e(0xdde)][_0x55a42e(0xd92)]='none',this['_camera_cache']=null;}['_getGeoJsonGeometry'](_0x4d9742){const _0x4deda2={_0xaf262:0xb13},_0x43f028=_0x3d5d32;return{'type':_0x43f028(0xb39),'coordinates':this[_0x43f028(_0x4deda2._0xaf262)](_0x4d9742===null||_0x4d9742===void 0x0?void 0x0:_0x4d9742['noAlt'])};}['addDynamicPosition'](_0x395ef2,_0x34bc65){const _0x2be01b={_0x33f428:0xbe9,_0x1191c5:0x366,_0x3e3a8e:0xaa6,_0x5609df:0xc4e,_0x4aa4a0:0xb69,_0x527d4d:0xc1b,_0x90c42:0xf72,_0xad50d0:0xc84,_0x4f01e8:0x8b7,_0x20ea91:0xade},_0x5e39b7=_0x3d5d32;var _0x343122,_0x5713e3,_0x31f206,_0x5c61a8;if(!this[_0x5e39b7(0xabe)]){const _0x51dc56=new Cesium__namespace[(_0x5e39b7(_0x2be01b._0x33f428))](this['options'][_0x5e39b7(_0x2be01b._0x1191c5)],this['options']['numberOfDerivatives']);_0x51dc56['forwardExtrapolationType']=this['options']['forwardExtrapolationType']??Cesium__namespace[_0x5e39b7(0xaa6)]['HOLD'],_0x51dc56['backwardExtrapolationType']=this['options']['backwardExtrapolationType']??Cesium__namespace[_0x5e39b7(_0x2be01b._0x3e3a8e)]['HOLD'],!this['options']['orientation']&&(this['options']['orientation']=new Cesium__namespace[(_0x5e39b7(_0x2be01b._0x5609df))](_0x51dc56),this['_entity']&&(this[_0x5e39b7(0x89b)]['orientation']=this[_0x5e39b7(0x794)]())),this['property']=_0x51dc56,this[_0x5e39b7(_0x2be01b._0x4aa4a0)]=_0x51dc56,this['_maxCacheCount']=this['options']['maxCacheCount']??0x32;}else this[_0x5e39b7(0xabe)]!==this['position']&&(this['position']=this['property']);this['_removeDynamicPosition']();const _0x50d58b=((_0x343122=this['_map'])===null||_0x343122===void 0x0?void 0x0:(_0x5713e3=_0x343122['clock'])===null||_0x5713e3===void 0x0?void 0x0:_0x5713e3[_0x5e39b7(0x4f8)])||Cesium__namespace['JulianDate']['now']();if(!_0x34bc65)_0x34bc65=_0x50d58b;else{if(isNumber(_0x34bc65))_0x34bc65=Cesium__namespace['JulianDate']['addSeconds'](_0x50d58b,_0x34bc65,new Cesium__namespace['JulianDate']());else{if(isString(_0x34bc65))_0x34bc65['indexOf']('Z')===-0x1?_0x34bc65=Cesium__namespace[_0x5e39b7(0x8b7)][_0x5e39b7(_0x2be01b._0x527d4d)](new Date(_0x34bc65)):_0x34bc65=Cesium__namespace['JulianDate']['fromIso8601'](_0x34bc65);else _0x34bc65 instanceof Date&&(_0x34bc65=Cesium__namespace['JulianDate']['fromDate'](_0x34bc65));}}_0x395ef2=LngLatPoint[_0x5e39b7(0xce3)](_0x395ef2);const _0x4e0b6a=(_0x31f206=this[_0x5e39b7(_0x2be01b._0x90c42)])===null||_0x31f206===void 0x0?void 0x0:(_0x5c61a8=_0x31f206['_property'])===null||_0x5c61a8===void 0x0?void 0x0:_0x5c61a8['_times'];if(this[_0x5e39b7(0x433)]['autoMiddleDynamicPosition']&&(_0x4e0b6a===null||_0x4e0b6a===void 0x0?void 0x0:_0x4e0b6a[_0x5e39b7(_0x2be01b._0xad50d0)])>0x0&&this['_position']){const _0x2ed0d7=_0x4e0b6a[_0x4e0b6a['length']-0x1];if(Cesium__namespace[_0x5e39b7(_0x2be01b._0x4f01e8)][_0x5e39b7(0xbd5)](_0x50d58b,_0x2ed0d7)>0.3){let _0x2879ed=this['_position'];if(this['_lastDynamicPosition']){const _0x2f9eea=0.01;_0x2879ed=getOnLinePointByLen(this['_lastDynamicPosition'],this['_position'],_0x2f9eea,!![]);}_0x2879ed=setPositionsHeight(_0x2879ed,_0x395ef2['alt']||0x0),this[_0x5e39b7(0xf72)][_0x5e39b7(_0x2be01b._0x20ea91)](_0x50d58b,_0x2879ed);}}const _0x69f8b8=_0x395ef2['toCartesian']();return this['position']['addSample'](_0x34bc65,_0x69f8b8),this;}[_0x3d5d32(0x934)](){const _0x18ac41={_0x25e203:0x5f7,_0x4c4f3b:0x230},_0x5af700=_0x3d5d32;var _0x4c6ea1,_0x22417a;if(this['_maxCacheCount']<0x1)return;const _0x18aec3=(_0x4c6ea1=this['property'])===null||_0x4c6ea1===void 0x0?void 0x0:(_0x22417a=_0x4c6ea1[_0x5af700(_0x18ac41._0x25e203)])===null||_0x22417a===void 0x0?void 0x0:_0x22417a[_0x5af700(0xb15)];if(!_0x18aec3||_0x18aec3['length']===0x0)return;const _0x6671c1=_0x18aec3['length']-this[_0x5af700(_0x18ac41._0x4c4f3b)]-0x1;_0x6671c1>0x0&&this[_0x5af700(0xabe)][_0x5af700(0x672)](new Cesium__namespace['TimeInterval']({'start':_0x18aec3[0x0],'stop':_0x18aec3[_0x6671c1]}));}['getCoordinate'](_0x4144fd){return this['point']?this['point']['toArray'](_0x4144fd):[];}['openHighlight'](_0x28f8d3,_0x11e648=!![]){const _0x3a4a69={_0x3aaae8:0x1d1,_0x3642a2:0x51f,_0x4fd155:0x68c},_0x309b47=_0x3d5d32;var _0x308a15;_0x11e648&&(this['_map']['closeHighlight'](),this[_0x309b47(_0x3a4a69._0x3aaae8)][_0x309b47(0xe05)]=this);const _0x3feb52=_0x28f8d3||this['_highlightOptions']||((_0x308a15=this['_layer'])===null||_0x308a15===void 0x0?void 0x0:_0x308a15['_highlightOptions']);if(_0x3feb52&&_0x3feb52['className']){for(let _0x3ed0fa=0x0,_0x5e3856=this[_0x309b47(0x51f)]['children']['length'];_0x3ed0fa<_0x5e3856;_0x3ed0fa++){const _0x249cc6=this[_0x309b47(_0x3a4a69._0x3642a2)][_0x309b47(_0x3a4a69._0x4fd155)][_0x3ed0fa];addClass(_0x249cc6,_0x3feb52['className']);}this['_highlightOptions']=_0x3feb52,this['fire'](EventType['highlightOpen'],{},!![]);}}['closeHighlight'](){const _0x2e5cf0={_0x188bec:0x51f},_0x220d61=_0x3d5d32;var _0x2de57d;if(!this['isAdded']||((_0x2de57d=this[_0x220d61(0x1d1)])===null||_0x2de57d===void 0x0?void 0x0:_0x2de57d['last_highlighGraphic'])!==this)return;this['_map']['_clearLastHighlight']();const _0x5ccd90=this['_highlightOptions'];if(_0x5ccd90&&_0x5ccd90['className']){for(let _0xa50493=0x0,_0x4c0105=this['_container']['children'][_0x220d61(0xc84)];_0xa50493<_0x4c0105;_0xa50493++){const _0x5f25e8=this[_0x220d61(_0x2e5cf0._0x188bec)]['children'][_0xa50493];removeClass(_0x5f25e8,_0x5ccd90['className']);}this['fire'](EventType['highlightClose'],{},!![]);}}['_getWindowPosition'](_0x5e6174){const _0x12f11a={_0x4bab3b:0x1d1,_0x266a44:0x949},_0xd4bd60=_0x3d5d32;if(isFirefox){const _0x390a13=this[_0xd4bd60(_0x12f11a._0x4bab3b)]['container']['getBoundingClientRect']();return new Cesium__namespace['Cartesian2'](_0x5e6174['clientX']-_0x390a13['left'],_0x5e6174['clientY']-_0x390a13['top']);}return new Cesium__namespace[(_0xd4bd60(0xb0e))](_0x5e6174['layerX'],_0x5e6174[_0xd4bd60(_0x12f11a._0x266a44)]);}['_getEventTarget'](_0x68d077){const _0x37a5ee={_0x19d252:0xaeb,_0x2e8f50:0xa0b},_0x22cdf4=_0x3d5d32;_0x68d077[_0x22cdf4(_0x37a5ee._0x19d252)]&&_0x68d077[_0x22cdf4(0xaeb)]();const _0x3a8bb9=this[_0x22cdf4(_0x37a5ee._0x2e8f50)](_0x68d077),_0x2cb489={'mouseEvent':_0x68d077,'cartesian':this[_0x22cdf4(0xb69)],'windowPosition':_0x3a8bb9,'sourceTarget':this,'graphic':this,'layer':this['_layer']};return this['_layer']&&(this['_layer']['_graphic_drawing']||this['_layer']['_hasEdit']&&this['hasEdit'])&&(_0x2cb489['cartesian']=getCurrentMousePosition(this['_map']['scene'],_0x3a8bb9)),_0x2cb489;}['_container_onClickHandler'](_0x25a6d1){const _0x5ba4da={_0x59f373:0x95b},_0x8fc0ed=_0x3d5d32;if(this[_0x8fc0ed(_0x5ba4da._0x59f373)])return;const _0x4e836d=this['_getEventTarget'](_0x25a6d1);_0x4e836d['position']=_0x4e836d['windowPosition'],this['fire'](EventType[_0x8fc0ed(0xb59)],_0x4e836d,!![]);}['_container_onMousedownHandler'](_0xfa0ef5){const _0x288d33={_0x53429c:0xa48},_0x2ec25a=_0x3d5d32;if(_0xfa0ef5['button']!==0x2)return;const _0x177195=this['_getEventTarget'](_0xfa0ef5);_0x177195['position']=_0x177195[_0x2ec25a(_0x288d33._0x53429c)],this['fire'](EventType['rightClick'],_0x177195,!![]);}['_container_onMouseMoveHandler'](_0x73214){const _0x2a8423={_0x29911e:0x224,_0x6fcc9c:0x65d},_0x2f578d=_0x3d5d32;if(this[_0x2f578d(0x95b)])return;this['_map']['mouseEvent'][_0x2f578d(_0x2a8423._0x29911e)]();const _0x4b4ebe=this['_getEventTarget'](_0x73214);_0x4b4ebe['endPosition']=_0x4b4ebe['windowPosition'],this['_map']['fire'](EventType['mouseMove'],_0x4b4ebe),this['_map'][_0x2f578d(0xefc)](EventType['mouseMoveTarget'],_0x4b4ebe),!this['_hasMouseOver']&&this['fire'](EventType['mouseOver'],_0x4b4ebe,!![]),this[_0x2f578d(_0x2a8423._0x6fcc9c)]=!![];}['_container_onMouseoutHandler'](_0x2e6c89){const _0x1c38cb={_0x6e72de:0x95b,_0x2ed8b6:0x65d},_0x4095f9=_0x3d5d32;if(this[_0x4095f9(_0x1c38cb._0x6e72de)])return;this[_0x4095f9(_0x1c38cb._0x2ed8b6)]=![];const _0x395069=this['_getEventTarget'](_0x2e6c89);this['fire'](EventType['mouseOut'],_0x395069,!![]);}['autoSurfaceHeight'](_0xb8dc99){const _0x3bdb46={_0x317451:0xb69};return getSurfaceHeight(this['_map']['scene'],this['position'],_0xb8dc99??this['options'])['then'](_0x32ed9b=>{const _0x53acb6=_0x4132;_0x32ed9b[_0x53acb6(_0x3bdb46._0x317451)]&&(this[_0x53acb6(_0x3bdb46._0x317451)]=_0x32ed9b[_0x53acb6(_0x3bdb46._0x317451)]);});}[_0x3d5d32(0x53e)](_0x15ccdb,_0xef5b5f){const _0x1b23b2={_0xbab58e:0x3db},_0x4b9c3e=_0x3d5d32;return DivGraphicStyleConver[_0x4b9c3e(_0x1b23b2._0xbab58e)](_0x15ccdb,_0xef5b5f,!![]);}['getRectangle'](_0x1cbe59){const _0x58c957=this['positionShow'];if(!_0x58c957)return;const _0x17e89d=getRectangle([_0x58c957],_0x1cbe59===null||_0x1cbe59===void 0x0?void 0x0:_0x1cbe59['isFormat']);return _0x17e89d;}['startDraw'](_0x218d59){const _0x396f55={_0x21692c:0x105c,_0x2e17e6:0x1d1,_0x403cb8:0xf7c,_0x2ccb08:0xa57,_0x346643:0x105f,_0x49ee6f:0x7f5},_0x4ad5b1=_0x3d5d32;if(this['_enabledDraw'])return this;this['_enabledDraw']=!![];_0x218d59&&this[_0x4ad5b1(_0x396f55._0x21692c)](_0x218d59);if(!this[_0x4ad5b1(_0x396f55._0x2e17e6)])throw new Error('绘制时_map不能为空,请将对象添加到图层,并且图层已添加到Map');this['_map'][_0x4ad5b1(_0x396f55._0x403cb8)](!![]),this['enableControl'](![]),this[_0x4ad5b1(_0x396f55._0x2ccb08)](),this[_0x4ad5b1(0xefc)](EventType[_0x4ad5b1(_0x396f55._0x346643)],{'drawtype':this[_0x4ad5b1(_0x396f55._0x49ee6f)],'graphic':this},!![]);}[_0x3d5d32(0xf57)](){const _0x30e26a={_0xd36c28:0x1d1,_0x3a6692:0xf7c,_0x27f73a:0x9de,_0x24d380:0xac9},_0x3c99a4=_0x3d5d32;var _0x1ba842,_0x5ab129,_0x55df92;if(!this['_enabledDraw'])return this;this['_stopDrawHook'](),this[_0x3c99a4(_0x30e26a._0xd36c28)][_0x3c99a4(_0x30e26a._0x3a6692)](![]),this['enableControl'](!![]),this['_map']['closeSmallTooltip'](),this['_enabledDraw']=![],this['fire'](EventType[_0x3c99a4(0xe30)],{'drawtype':this['type'],'graphic':this},!![]),(_0x1ba842=this['options'])!==null&&_0x1ba842!==void 0x0&&_0x1ba842['success']&&this['options'][_0x3c99a4(_0x30e26a._0x27f73a)](this),(_0x5ab129=this['options'])!==null&&_0x5ab129!==void 0x0&&(_0x55df92=_0x5ab129['_promise'])!==null&&_0x55df92!==void 0x0&&_0x55df92['resolve']&&this['options']['_promise'][_0x3c99a4(_0x30e26a._0x24d380)](this);}['_startDrawHook'](){const _0x50526d={_0x373f5:0x314},_0x2173f5=_0x3d5d32;this['_updatePointerEvents'](![]),this['_map']['on'](EventType[_0x2173f5(_0x50526d._0x373f5)],this['_onMouseMoveHandler_point'],this),this['_map']['on'](EventType['click'],this['_onClickHandler_point'],this);}['_stopDrawHook'](){const _0x27ddd1={_0x30e7d2:0xf3c},_0x3557c2=_0x3d5d32;this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler_point'],this),this['_map']['off'](EventType['click'],this[_0x3557c2(0x7e2)],this),this['_updatePointerEvents'](this[_0x3557c2(_0x27ddd1._0x30e7d2)]());}['_onMouseMoveHandler_point'](_0x271eb6){const _0x467b70={_0x35a8e0:0x4c1,_0x5662ad:0xd13},_0x1b85c6=_0x3d5d32,_0x1fedd5=_0x271eb6[_0x1b85c6(_0x467b70._0x35a8e0)];_0x1fedd5&&(this['position']=_0x1fedd5),this[_0x1b85c6(0x1d1)]['openSmallTooltip'](_0x271eb6[_0x1b85c6(_0x467b70._0x5662ad)],this['_draw_tooltip']||this['_map']['getLangText']('_单击完成绘制')),this['fire'](EventType['drawMouseMove'],{..._0x271eb6,'drawtype':this['type'],'graphic':this},!![]);}['_onClickHandler_point'](_0x3777bf){const _0x4d094b=_0x3777bf['cartesian'];_0x4d094b&&(this['position']=_0x4d094b),this['stopDraw']();}['_setPositionsToCallback'](){}['_cancelPositionsCallback'](){}['endDraw'](){const _0x2c547d={_0x53387b:0xd76},_0x1dc8b2=_0x3d5d32;if(!this[_0x1dc8b2(0x6e3)])return this;if(this[_0x1dc8b2(_0x2c547d._0x53387b)][_0x1dc8b2(0xc84)]\x0a\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x0a\x20\x20\x20';}const DEF_STYLE$6={'color':_0x3d5d32(0x4ec),'horizontalOrigin':Cesium__namespace[_0x3d5d32(0x1e7)][_0x3d5d32(0xd73)],'verticalOrigin':Cesium__namespace['VerticalOrigin']['CENTER']};class DivLightPoint extends DivGraphic{constructor(_0x489256={}){const _0x4fd8ba={_0x51ea24:0xdde},_0x2d19cd=_0x3d5d32;_0x489256['style']={...DEF_STYLE$6,..._0x489256[_0x2d19cd(_0x4fd8ba._0x51ea24)]||{}},_0x489256['style']['html']=getHtmlByStyle$1(_0x489256[_0x2d19cd(_0x4fd8ba._0x51ea24)],_0x489256['attr']),super(_0x489256);}[_0x3d5d32(0x929)](_0x324361){const _0xf6c8c1=_0x3d5d32;return(Cesium__namespace['defined'](_0x324361['color'])||Cesium__namespace['defined'](_0x324361['size'])||Cesium__namespace[_0xf6c8c1(0xb84)](_0x324361['label']))&&(this['html']=getHtmlByStyle$1(this['style'],this['attr'])),super['_updateStyleBaseHook'](_0x324361),this;}}register$4(_0x3d5d32(0x23b),DivLightPoint,!![]);function getHtmlByStyle$1(_0x421572,_0x2cc1f8){const _0x364254={_0x548209:0x68b,_0x31da2e:0x32a,_0x282b55:0x411},_0xdf4ab0=_0x3d5d32;return'\x0a\x20\x20\x0a\x20\x20\x20\x20

\x0a\x20\x20\x20\x20'+(_0x421572['label']?''+template(_0x421572[_0xdf4ab0(_0x364254._0x31da2e)]['text'],_0x2cc1f8,_0x421572['label'][_0xdf4ab0(_0x364254._0x282b55)]??!![])+'':'')+'\x0a\x20\x20';}const DEF_STYLE$5={'color':'white','font_family':'楷体','font_size':0xf,'lineHeight':0x64,'circleSize':0xa,'horizontalOrigin':Cesium__namespace['HorizontalOrigin']['CENTER'],'verticalOrigin':Cesium__namespace['VerticalOrigin']['BOTTOM']};class DivUpLabel extends DivGraphic{constructor(_0x5e4dbf={}){const _0x5b47ab={_0x4571b0:0xdde},_0x3295da=_0x3d5d32;_0x5e4dbf[_0x3295da(0xdde)]={...DEF_STYLE$5,..._0x5e4dbf['style']||{}},_0x5e4dbf[_0x3295da(_0x5b47ab._0x4571b0)][_0x3295da(0xe6d)]=getHtmlByStyle(_0x5e4dbf[_0x3295da(0xdde)],_0x5e4dbf['attr']),super(_0x5e4dbf);}[_0x3d5d32(0x929)](_0x382222){const _0x239dc2={_0x2289f8:0x438,_0xe7ed41:0xb84,_0x856df1:0x3d9,_0x5dd524:0x76b},_0x4fcf4a=_0x3d5d32;return(Cesium__namespace['defined'](_0x382222['color'])||Cesium__namespace['defined'](_0x382222[_0x4fcf4a(_0x239dc2._0x2289f8)])||Cesium__namespace[_0x4fcf4a(0xb84)](_0x382222['font_size'])||Cesium__namespace['defined'](_0x382222['font_family'])||Cesium__namespace[_0x4fcf4a(_0x239dc2._0xe7ed41)](_0x382222[_0x4fcf4a(_0x239dc2._0x856df1)])||Cesium__namespace['defined'](_0x382222[_0x4fcf4a(_0x239dc2._0x5dd524)]))&&(this['html']=getHtmlByStyle(this[_0x4fcf4a(0xdde)],this['attr'])),super['_updateStyleBaseHook'](_0x382222),this;}}register$4('divUpLabel',DivUpLabel,!![]);function getHtmlByStyle(_0x4a520d,_0x1747c1){const _0x4de10f={_0x32835a:0x1ed,_0x55cc4b:0x3d9,_0x3b59fa:0x4af},_0x3d44d8=_0x3d5d32,_0x434cd6=_0x4a520d['color'],_0x46feab=_0x4a520d['circleSize'];return'\x0a\x20\x20\x0a\x20\x20\x20\x20'+template(_0x4a520d['text'],_0x1747c1,!![])+_0x3d44d8(0xa22)+_0x4a520d[_0x3d44d8(_0x4de10f._0x55cc4b)]+'px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20background-color:\x20'+_0x434cd6+';\x22>\x0a\x20\x20\x20\x20\x0a\x20\x20\x20';}class Popup extends DivGraphic{constructor(_0x2acab2={}){const _0x4014bd={_0x2ba311:0x8eb,_0x4508f8:0xdde,_0x692bf:0xf30,_0x64fb1:0xc0f,_0x53907f:0x1e7,_0x22bead:0xd73,_0x37ad66:0x8a5},_0x17e7df=_0x3d5d32;_0x2acab2['eventParent']=_0x2acab2[_0x17e7df(0x4b7)]??![],_0x2acab2['hasEdit']=_0x2acab2[_0x17e7df(_0x4014bd._0x2ba311)]??![],_0x2acab2['animation']=_0x2acab2['animation']??!![],_0x2acab2[_0x17e7df(0x377)]=_0x2acab2['zIndex']??0x989680,_0x2acab2['style']=_0x2acab2['style']||{},_0x2acab2['style'][_0x17e7df(0xe36)]=_0x2acab2['style']['direction']??'top';const _0x3a3ffd={};switch(_0x2acab2[_0x17e7df(_0x4014bd._0x4508f8)]['direction']){case _0x17e7df(0x474):_0x3a3ffd[_0x17e7df(0xbd3)]=-0x8,_0x3a3ffd['horizontalOrigin']=Cesium__namespace['HorizontalOrigin']['CENTER'],_0x3a3ffd[_0x17e7df(_0x4014bd._0x692bf)]=Cesium__namespace['VerticalOrigin']['BOTTOM'];break;case'bottom':_0x3a3ffd['offsetY']=0x8,_0x3a3ffd['horizontalOrigin']=Cesium__namespace['HorizontalOrigin']['CENTER'],_0x3a3ffd[_0x17e7df(0xf30)]=Cesium__namespace[_0x17e7df(_0x4014bd._0x64fb1)][_0x17e7df(0x1f8)];break;case'center':_0x3a3ffd['horizontalOrigin']=Cesium__namespace[_0x17e7df(_0x4014bd._0x53907f)][_0x17e7df(0xd73)],_0x3a3ffd['verticalOrigin']=Cesium__namespace['VerticalOrigin']['CENTER'];break;case'right':_0x3a3ffd['offsetX']=0x8,_0x3a3ffd['horizontalOrigin']=Cesium__namespace['HorizontalOrigin']['LEFT'],_0x3a3ffd['verticalOrigin']=Cesium__namespace['VerticalOrigin'][_0x17e7df(_0x4014bd._0x22bead)];break;case'left':_0x3a3ffd['offsetX']=-0x8,_0x3a3ffd['horizontalOrigin']=Cesium__namespace['HorizontalOrigin']['RIGHT'],_0x3a3ffd['verticalOrigin']=Cesium__namespace['VerticalOrigin']['CENTER'];break;}_0x2acab2['style']={..._0x3a3ffd,..._0x2acab2[_0x17e7df(_0x4014bd._0x4508f8)]},super(_0x2acab2),this['_depthTest']=this['options']['depthTest']??this['style']['depthTest']??![],!Cesium__namespace['defined'](this['style'][_0x17e7df(_0x4014bd._0x37ad66)])&&this['style'][_0x17e7df(0x8a5)]!==![]&&(this['style'][_0x17e7df(0x8a5)]=this[_0x17e7df(0x1044)]()),this['once'](EventType['load'],()=>{this['_fireTarget_open']();});}get[_0x3d5d32(0x2eb)](){var _0x1565de;return(_0x1565de=this['options'])===null||_0x1565de===void 0x0?void 0x0:_0x1565de['target'];}get['eventTarget'](){const _0x5056ad={_0x4be377:0x2eb},_0xc66e8f=_0x3d5d32;var _0x298218,_0x16bbf4;if((_0x298218=this['options'])!==null&&_0x298218!==void 0x0&&_0x298218['event'])return this['options']['event'];return(_0x16bbf4=this['options'])!==null&&_0x16bbf4!==void 0x0&&_0x16bbf4[_0xc66e8f(0x2eb)]?this[_0xc66e8f(0x433)][_0xc66e8f(_0x5056ad._0x4be377)]:this;}['_getDefaultTemplate'](){const _0x586db8={_0x276707:0x976,_0x1383e8:0x5e9,_0x4cc3b4:0xdde,_0x1e1300:0xd7a},_0xf67606=_0x3d5d32;let _0x5aacab;this['style']['closeButton']??!![]?_0x5aacab=_0xf67606(_0x586db8._0x276707):_0x5aacab='';let _0x1200b1='';return this['style'][_0xf67606(0xd17)]&&(_0x1200b1+='max-width:\x20'+this['style']['maxWidth']+_0xf67606(0xc83)),this[_0xf67606(0xdde)]['minWidth']&&(_0x1200b1+=_0xf67606(_0x586db8._0x1383e8)+this['style']['minWidth']+'px;'),this['style']['maxHeight']&&(_0x1200b1+='max-height:\x20'+this[_0xf67606(_0x586db8._0x4cc3b4)]['maxHeight']+'px;'),_0xf67606(_0x586db8._0x1e1300)+(!this['style']['timeRender']&&this['options']['animation']?'mars3d-popup-animation':'')+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5aacab+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{const _0x51b598=_0x3cb7d8;this[_0x51b598(0x2eb)]&&this[_0x51b598(_0x1dd255._0x48615e)][_0x51b598(0x759)]&&this['target']['closeHighlight'](),this[_0x51b598(_0x1dd255._0x4cda16)](!![]);});}['fireTarget'](_0x368eb5,_0x5a9165={},_0x3b86eb=!![]){const _0x29d5c1={_0x5c8810:0x2eb,_0x330d86:0xfde,_0x480094:0xe12,_0x131616:0x6c2},_0xcf9e8e=_0x3d5d32,_0x29377b=this[_0xcf9e8e(_0x29d5c1._0x5c8810)]||this['_map'];if(_0x29377b){if(this['options']['event'])for(const _0x301b33 in this['options']['event']){if(_0x301b33==='options'||_0x301b33===_0xcf9e8e(_0x29d5c1._0x330d86))continue;_0x5a9165[_0x301b33]=this['options']['event'][_0x301b33];}_0x5a9165['sourceTarget']=_0x29377b,_0x5a9165[_0xcf9e8e(_0x29d5c1._0x480094)]=this[_0xcf9e8e(_0x29d5c1._0x480094)],_0x5a9165['container']=this[_0xcf9e8e(_0x29d5c1._0x131616)],this['_fireBindDataEx'](_0x5a9165),_0x29377b[_0xcf9e8e(0xefc)](_0x368eb5,_0x5a9165,_0x3b86eb);}}[_0x3d5d32(0x323)](_0x265a40){_0x265a40['popup']=this;}['_addedHook'](_0xcc09b0){const _0x264983={_0x10b162:0x2eb},_0x129d03={_0x320d3a:0x1d1,_0x92b9a0:0x1d1,_0x2ea579:0xaa8,_0x21c226:0x1d1,_0x6ed83c:0xfc1},_0x1d24d2=_0x3d5d32;super[_0x1d24d2(0x226)](_0xcc09b0),this['once'](EventType['change'],_0x2558c1=>{const _0x331d5b=_0x1d24d2;if(this['options']['autoCenter']&&this[_0x331d5b(_0x129d03._0x320d3a)]){if(_0x2558c1['y']<0x0||_0x2558c1['x']<0x0||_0x2558c1['x']>this['_map']['scene']['canvas']['clientWidth']-_0x2558c1['width']||_0x2558c1['y']>this['_map']['scene']['canvas']['clientHeight']-_0x2558c1[_0x331d5b(0x83e)]){const _0x5d263e=_0x2558c1[_0x331d5b(0x1076)]/0x2+_0x2558c1['x'],_0x2a5011=_0x2558c1[_0x331d5b(0x83e)]/0x2+_0x2558c1['y'],_0x27e01f=new Cesium__namespace[(_0x331d5b(0xb0e))](_0x5d263e,_0x2a5011),_0x14808e=this[_0x331d5b(_0x129d03._0x320d3a)][_0x331d5b(0xfc1)]['camera']['getPickRay'](_0x27e01f);let _0xd27247=this[_0x331d5b(_0x129d03._0x92b9a0)]['scene'][_0x331d5b(_0x129d03._0x2ea579)]['pick'](_0x14808e,this['_map']['scene']);!_0xd27247&&(_0xd27247=this[_0x331d5b(_0x129d03._0x21c226)][_0x331d5b(_0x129d03._0x6ed83c)][_0x331d5b(0x435)]['pickEllipsoid'](_0x27e01f)),this[_0x331d5b(0x1d1)]['flyToPoint'](_0xd27247);}}}),this[_0x1d24d2(_0x264983._0x10b162)]&&this['target']['on'](EventType['updatePosition'],this['_graphic_updatePosition'],this);}['_removedHook'](){const _0xbe3688=_0x3d5d32;this['target']&&this['target']['off'](EventType['updatePosition'],this[_0xbe3688(0x50c)],this),this['_fireTarget_close'](),super['_removedHook']();}['_graphic_updatePosition'](_0x5e7a74){const _0xb7381e={_0x3b580c:0x909,_0x1bb02e:0xb69},_0x2c0914=_0x3d5d32;var _0x337214;(_0x337214=_0x5e7a74['graphic'])!==null&&_0x337214!==void 0x0&&_0x337214[_0x2c0914(_0xb7381e._0x3b580c)]&&(this[_0x2c0914(_0xb7381e._0x1bb02e)]=_0x5e7a74[_0x2c0914(0x328)]['_getPopupPosition']());}['_fireTarget_open'](){const _0xf58b9f=_0x3d5d32;this['fireTarget'](EventType[_0xf58b9f(0x8d0)]);}['_fireTarget_close'](){const _0x1db8a9={_0x5e29a7:0x9cc},_0x15651a=_0x3d5d32;this[_0x15651a(_0x1db8a9._0x5e29a7)](EventType['popupClose']);}['_closeAllControl'](){}[_0x3d5d32(0x837)](){}[_0x3d5d32(0x3f5)](){}['_container_onMouseMoveHandler'](){}[_0x3d5d32(0xe50)](){}['hasBindEvent'](){const _0x115a64={_0x171892:0x433},_0x50bf4c=_0x3d5d32;return this[_0x50bf4c(_0x115a64._0x171892)]['pointerEvents']??!![];}}register$4('popup',Popup);class Tooltip extends Popup{[_0x3d5d32(0x1044)](){const _0x47f353={_0x4d8763:0xb36,_0x2a92b1:0xdde},_0xd4d248=_0x3d5d32;return _0xd4d248(_0x47f353._0x4d8763)+this['id']+_0xd4d248(0x97c)+this[_0xd4d248(_0x47f353._0x2a92b1)][_0xd4d248(0xe36)]+'\x22>{content}';}['_fireBindDataEx'](_0x5e0d50){_0x5e0d50['tooltip']=this;}[_0x3d5d32(0x2d8)](){const _0x2309f5={_0x5c4211:0x9cc},_0x3758ff=_0x3d5d32;this[_0x3758ff(_0x2309f5._0x5c4211)](EventType['tooltipOpen']);}[_0x3d5d32(0xb5c)](){this['fireTarget'](EventType['tooltipClose']);}}register$4(_0x3d5d32(0xf26),Tooltip);const DEF_STYLE$4={'startColor':Cesium__namespace['Color'][_0x3d5d32(0xc89)]['withAlpha'](0.3),'endColor':Cesium__namespace[_0x3d5d32(0x882)]['WHITE']['withAlpha'](0x0),'startScale':0x2,'endScale':0x4,'minimumParticleLife':0x3,'maximumParticleLife':0x6,'minimumSpeed':0x1,'maximumSpeed':0x2,'emissionRate':0x64};class ParticleSystem extends BasePointPrimitive{constructor(_0x11375f={}){const _0x16d982={_0x54b829:0x56a,_0x2847ab:0x97b},_0x3b86ca=_0x3d5d32;_0x11375f['style']={...DEF_STYLE$4,'emitter':new Cesium__namespace[(_0x3b86ca(_0x16d982._0x54b829))](0x1),..._0x11375f['style']||{}},super(_0x11375f),this['emitterModelMatrix']=new Cesium__namespace['Matrix4'](),this['translation']=new Cesium__namespace['Cartesian3'](),this['rotation']=new Cesium__namespace[(_0x3b86ca(_0x16d982._0x2847ab))](),this['hpr']=new Cesium__namespace['HeadingPitchRoll'](),this['trs']=new Cesium__namespace['TranslationRotationScale']();}get['czmObject'](){const _0x2f34a4={_0x16d543:0x517},_0x286053=_0x3d5d32;return this[_0x286053(_0x2f34a4._0x16d543)];}get[_0x3d5d32(0x7cb)](){const _0x47e98a={_0x261909:0xdde},_0x46784f=_0x3d5d32;return this[_0x46784f(_0x47e98a._0x261909)]['maxHeight'];}set['maxHeight'](_0x35fef1){this['style']['maxHeight']=_0x35fef1;}get['gravity'](){const _0x4f6ce5={_0x45aef7:0x88a},_0x3fef57=_0x3d5d32;return this['style'][_0x3fef57(_0x4f6ce5._0x45aef7)]||0x0;}set[_0x3d5d32(0x88a)](_0x3df08c){this['style']['gravity']=_0x3df08c;}get[_0x3d5d32(0xf25)](){return this['style']['transX']||0x0;}set['transX'](_0x5ef308){this['style']['transX']=_0x5ef308;}get['transY'](){const _0x2b939d={_0xfd2d39:0xdde},_0x1e9526=_0x3d5d32;return this[_0x1e9526(_0x2b939d._0xfd2d39)][_0x1e9526(0xefe)]||0x0;}set['transY'](_0xe395af){this['style']['transY']=_0xe395af;}get['transZ'](){const _0x557eb1=_0x3d5d32;return this[_0x557eb1(0xdde)][_0x557eb1(0xc23)]||0x0;}set[_0x3d5d32(0xc23)](_0x35e700){this['style']['transZ']=_0x35e700;}get[_0x3d5d32(0xb53)](){const _0xe8a042=_0x3d5d32;return this[_0xe8a042(0xdde)]['particleSize']||0x19;}set['particleSize'](_0x2f518d){const _0x38c2b5={_0x2ac69e:0x30d},_0xf9e6b8=_0x3d5d32;this['style']['particleSize']=_0x2f518d,this['_primitive']&&(this[_0xf9e6b8(0x517)][_0xf9e6b8(0x30d)]['x']=_0x2f518d,this['_primitive'][_0xf9e6b8(_0x38c2b5._0x2ac69e)]['y']=_0x2f518d,this['_primitive']['maximumImageSize']['x']=_0x2f518d,this['_primitive']['maximumImageSize']['y']=_0x2f518d);}get['hasOpacity'](){return![];}[_0x3d5d32(0x226)](_0x4ebfab){const _0x324497={_0x2ce724:0x433,_0x553676:0xabe,_0x4bb118:0x433,_0x1b6304:0x952},_0x24ed9f=_0x3d5d32;if(!this['show'])return;const _0x2e5877=this[_0x24ed9f(0x1d1)]['clock']['currentTime'],_0x1dcd6f={'imageSize':new Cesium__namespace['Cartesian2'](this[_0x24ed9f(0xb53)],this['particleSize']),'modelMatrix':this['_computeModelMatrix'](_0x2e5877),'emitterModelMatrix':this['_computeEmitterModelMatrix'](_0x2e5877),...this['style'],'show':this['show']};this['_primitive']=new Cesium__namespace['ParticleSystem'](_0x1dcd6f),this['primitiveCollection']['add'](this['_primitive']);this['options']['position']&&((this[_0x24ed9f(_0x324497._0x2ce724)][_0x24ed9f(0xb69)]instanceof Cesium__namespace['CallbackProperty']||this['options']['position']instanceof Cesium__namespace['SampledPositionProperty'])&&(this['_orientation']=this['options'][_0x24ed9f(0x42d)]||new Cesium__namespace[(_0x24ed9f(0xc4e))](this['options']['position']),this['property']=this['options'][_0x24ed9f(0xb69)]));this['_bindUpdateCallback'](),this['_hasUpdate_modelMatrix']=isFunction(this['options'][_0x24ed9f(0xd93)])||this[_0x24ed9f(_0x324497._0x553676)],this['_hasUpdate_emitterModelMatrix']=isFunction(this[_0x24ed9f(_0x324497._0x4bb118)]['emitterModelMatrix'])||this['heading']||this['pitch']||this[_0x24ed9f(_0x324497._0x1b6304)]||this['transX']||this['transY']||this[_0x24ed9f(0xc23)];const _0x307961=this['_primitive']['update'],_0x2ba657=this;this['_primitive']['update']=function(_0x4951e3){const _0x1f528c=_0x24ed9f;_0x2ba657['_update'](_0x4951e3);if(this['_previousTime']){const _0x501739=Cesium__namespace['JulianDate']['secondsDifference'](_0x4951e3['time'],this['_previousTime']);_0x501739>0xa&&(this['_previousTime']=Cesium__namespace[_0x1f528c(0x8b7)]['clone'](_0x4951e3[_0x1f528c(0x5d6)],this['_previousTime']));}_0x307961['bind'](this)(_0x4951e3);};}[_0x3d5d32(0x566)](){const _0x2453a2={_0xad31d4:0xf06},_0x32d96b=_0x3d5d32;if(!this['_map'])return;this['primitiveCollection'][_0x32d96b(_0x2453a2._0xad31d4)](this['_primitive']);}['_update'](_0x152b81){const _0x10832a={_0x32d805:0x5d6,_0x3b5dc6:0x517,_0xcb297a:0xd93,_0x2ecb41:0xb84,_0x4ab4aa:0x792,_0x10255e:0xefc},_0x460cfd=_0x3d5d32;if(!this['show']||!this['_primitive']||!this['_map'])return;this['property']&&(this['_position']=getPositionValue(this['property'],_0x152b81[_0x460cfd(_0x10832a._0x32d805)])),this['_hasUpdate_modelMatrix']&&(this[_0x460cfd(_0x10832a._0x3b5dc6)][_0x460cfd(_0x10832a._0xcb297a)]=this['_computeModelMatrix'](_0x152b81['time'])),this['_hasUpdate_emitterModelMatrix']&&(this['_primitive']['emitterModelMatrix']=this['_computeEmitterModelMatrix'](_0x152b81['time'])),Cesium__namespace[_0x460cfd(_0x10832a._0x2ecb41)](this['maxHeight'])&&_0x152b81['frameNumber']%0xa===0x0&&(this['_map']['camera']['positionCartographic']['height']{return this['color'];}},'pass':Cesium__namespace['Pass']['OPAQUE'],'owner':this,'cull':!![],'renderState':Cesium__namespace['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]}})});return this['bindPickId'](_0x1c6a81),_0x1c6a81;}['createVertices'](){const _0x97cae2={_0x2bd9db:0xdde,_0x3adb14:0x103e,_0x33d32c:0x106c,_0x324b82:0x256,_0x4ae3b9:0x3ac},_0x1fa44a=_0x3d5d32,_0x3a42da=this[_0x1fa44a(_0x97cae2._0x2bd9db)]['distance'],_0x4af3e6=0x14,_0x3334f5=(_0x4af3e6+0x1)*(_0x4af3e6+0x1)+0x1,_0x43a03b=Cesium__namespace['ComponentDatatype']['createTypedArray'](Cesium__namespace[_0x1fa44a(0x3ac)]['FLOAT'],0x3*_0x3334f5);let _0x316eab=0x3;const _0x632b60=Cesium__namespace[_0x1fa44a(_0x97cae2._0x3adb14)]['toRadians'](this['angle']*0x2),_0x19aabb=Cesium__namespace['Math']['toRadians'](this['angle2']*0x2),_0x920005=Math['tan'](0.5*_0x19aabb),_0x23544b=_0x3a42da*_0x920005,_0x4fc1b2=Math['PI']-0.5*_0x632b60;let _0x9443a0=0x0,_0x1acb3a=0x0;const _0x6b9269=_0x632b60/_0x4af3e6;for(let _0xfd31e7=0x0;_0xfd31e7<_0x4af3e6+0x1;_0xfd31e7++){_0x9443a0=_0x4fc1b2+_0xfd31e7*_0x6b9269;const _0x2fba5f=_0x23544b/(_0x3a42da/Math['cos'](_0x9443a0)),_0xf1ea07=Math[_0x1fa44a(_0x97cae2._0x33d32c)](_0x2fba5f),_0x3b8e61=-_0xf1ea07,_0x5aac22=0x2*_0xf1ea07/_0x4af3e6;for(let _0x1ef810=0x0;_0x1ef810<_0x4af3e6+0x1;_0x1ef810++){_0x1acb3a=_0x3b8e61+_0x1ef810*_0x5aac22,_0x43a03b[_0x316eab++]=_0x3a42da*Math[_0x1fa44a(_0x97cae2._0x324b82)](_0x1acb3a)*Math['sin'](_0x9443a0),_0x43a03b[_0x316eab++]=_0x3a42da*Math['sin'](_0x1acb3a),_0x43a03b[_0x316eab++]=_0x3a42da*Math[_0x1fa44a(0x256)](_0x1acb3a)*Math['cos'](_0x9443a0);}}const _0x1459f1=0x2*(0x4+0x5*_0x4af3e6+0x2*_0x4af3e6*0x3),_0x1a8fbc=Cesium__namespace[_0x1fa44a(_0x97cae2._0x4ae3b9)][_0x1fa44a(0xc4b)](Cesium__namespace['ComponentDatatype']['UNSIGNED_SHORT'],_0x1459f1);let _0x258529=0x0;_0x1a8fbc[_0x258529++]=0x0,_0x1a8fbc[_0x258529++]=0x1,_0x1a8fbc[_0x258529++]=0x0,_0x1a8fbc[_0x258529++]=_0x4af3e6+0x1,_0x1a8fbc[_0x258529++]=0x0,_0x1a8fbc[_0x258529++]=_0x4af3e6*(_0x4af3e6+0x1)+0x1,_0x1a8fbc[_0x258529++]=0x0,_0x1a8fbc[_0x258529++]=(_0x4af3e6+0x1)*(_0x4af3e6+0x1);for(let _0x46569a=0x0;_0x46569a<0x5;_0x46569a++){for(let _0x594e10=0x0;_0x594e10<_0x4af3e6;_0x594e10++){_0x1a8fbc[_0x258529++]=0x1+_0x594e10+0x5*(_0x4af3e6+0x1)*_0x46569a,_0x1a8fbc[_0x258529++]=0x1+(_0x594e10+0x1)+0x5*(_0x4af3e6+0x1)*_0x46569a;}}for(let _0x2ed208=0x0;_0x2ed208<0x5;_0x2ed208++){for(let _0x23e75f=0x0;_0x23e75f<_0x4af3e6;_0x23e75f++){_0x1a8fbc[_0x258529++]=0x1+(_0x4af3e6+0x1)*_0x23e75f+0x5*_0x2ed208,_0x1a8fbc[_0x258529++]=0x1+(_0x4af3e6+0x1)*(_0x23e75f+0x1)+0x5*_0x2ed208;}}const _0xaa8a3a=_0x4af3e6*_0x4af3e6*0x3*0x2+0x3*_0x4af3e6*0x4,_0x282f85=Cesium__namespace['ComponentDatatype']['createTypedArray'](Cesium__namespace[_0x1fa44a(0x3ac)][_0x1fa44a(0xa3e)],_0xaa8a3a),_0x68825f=0x1;for(let _0x18e41f=0x0;_0x18e41f<_0x4af3e6;_0x18e41f++){for(let _0x23ba5a=0x0;_0x23ba5a<_0x4af3e6;_0x23ba5a++){_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+_0x23ba5a*(_0x4af3e6+0x1),_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+0x1+_0x23ba5a*(_0x4af3e6+0x1),_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+(_0x23ba5a+0x1)*(_0x4af3e6+0x1),_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+0x1+_0x23ba5a*(_0x4af3e6+0x1),_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+0x1+(_0x23ba5a+0x1)*(_0x4af3e6+0x1),_0x282f85[_0x258529++]=_0x68825f+_0x18e41f+(_0x23ba5a+0x1)*(_0x4af3e6+0x1);}}for(let _0x76b66e=0x0;_0x76b66e<_0x4af3e6;_0x76b66e++){_0x282f85[_0x258529++]=_0x76b66e+0x1+_0x68825f,_0x282f85[_0x258529++]=_0x76b66e+_0x68825f,_0x282f85[_0x258529++]=0x0,_0x282f85[_0x258529++]=0x0,_0x282f85[_0x258529++]=_0x76b66e+_0x4af3e6*(_0x4af3e6+0x1)+_0x68825f,_0x282f85[_0x258529++]=_0x76b66e+0x1+_0x4af3e6*(_0x4af3e6+0x1)+_0x68825f;}for(let _0x4a6181=0x0;_0x4a6181<_0x4af3e6;_0x4a6181++){_0x282f85[_0x258529++]=0x0,_0x282f85[_0x258529++]=_0x4a6181*(_0x4af3e6+0x1)+_0x68825f,_0x282f85[_0x258529++]=(_0x4a6181+0x1)*(_0x4af3e6+0x1)+_0x68825f,_0x282f85[_0x258529++]=_0x4af3e6+(_0x4a6181+0x1)*(_0x4af3e6+0x1)+_0x68825f,_0x282f85[_0x258529++]=_0x4af3e6+_0x4a6181*(_0x4af3e6+0x1)+_0x68825f,_0x282f85[_0x258529++]=0x0;}return{'vertices':_0x43a03b,'indices':_0x1a8fbc};}}register$4('arcFrustum',ArcFrustum,!![]);var TetrahedronFS='in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0ain\x20vec2\x20v_st;\x0auniform\x20vec4\x20color;\x0auniform\x20float\x20globalAlpha;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.0,\x200.0,\x201.0),\x20-normalEC);\x0a\x20\x20#endif\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x20\x20materialInput.st\x20=\x20v_st;\x0a\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x0a\x20\x20material.alpha\x20=\x20(mix(0.1,\x201.0,\x20clamp((1.0\x20-\x20st.t)\x20*\x20color.a,\x200.0,\x201.0))\x20+\x20(1.0\x20-\x20sign(st.t\x20-\x20czm_frameNumber\x20*\x200.001))\x20*\x200.2\x20+\x200.4)\x20*\x20globalAlpha;\x0a\x20\x20material.diffuse\x20=\x20color.rgb;\x0a\x0a\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20#endif\x0a}\x0a',TetrahedronVS='in\x20vec3\x20position;\x0ain\x20vec3\x20normal;\x0ain\x20vec2\x20st;\x0ain\x20float\x20batchId;\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0aout\x20vec2\x20v_st;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20v_positionEC\x20=\x20(czm_modelView\x20*\x20vec4(position,\x201.0)).xyz;\x20\x20\x20\x20\x20\x20\x20//\x20position\x20in\x20eye\x20coordinates\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20normal\x20in\x20eye\x20coordinates\x0a\x20\x20v_st\x20=\x20st;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjection\x20*\x20vec4(position,\x201.0);\x0a}\x0a';const DEF_STYLE$2={'width':0x14,'height':0x1e,'color':new Cesium__namespace[(_0x3d5d32(0x882))](0.8,0.8,0x0,0.8),'animation':!![],'moveHeight':0x1e,'moveDuration':0x2,'rotationAngle':0x1};class Tetrahedron extends BasePointPrimitive{constructor(_0x52f18b={}){_0x52f18b['style']={...DEF_STYLE$2,..._0x52f18b['style']||{}},super(_0x52f18b),this['_globalAlpha']=0x1;}get[_0x3d5d32(0xd2e)](){return this;}get['color'](){const _0x117afb={_0x1f62bc:0xd91},_0x5b2c59=_0x3d5d32;return this[_0x5b2c59(_0x117afb._0x1f62bc)];}set['color'](_0x2c0700){const _0x3957b3=_0x3d5d32;this[_0x3957b3(0xd91)]=getCesiumColor(_0x2c0700);}get[_0x3d5d32(0xd93)](){const _0x4bfb34={_0x3fbaaf:0xd93,_0x563242:0xdde,_0x4a07be:0x37e},_0x2b1fde=_0x3d5d32;if(this['options'][_0x2b1fde(_0x4bfb34._0x3fbaaf)])return this['options']['modelMatrix'];if(!this[_0x2b1fde(0xb69)])return Cesium__namespace['Matrix4']['IDENTITY'];const _0x20d92c=Cesium__namespace[_0x2b1fde(0x5bb)]['eastNorthUpToFixedFrame'](this['position']),_0x2a28fd=Cesium__namespace['Matrix4']['fromScale'](new Cesium__namespace['Cartesian3'](this['style']['width'],this[_0x2b1fde(0xdde)]['width'],this[_0x2b1fde(_0x4bfb34._0x563242)]['height'])),_0x143561=Cesium__namespace['Matrix4'][_0x2b1fde(_0x4bfb34._0x4a07be)](_0x20d92c,_0x2a28fd,new Cesium__namespace['Matrix4']());return _0x143561;}[_0x3d5d32(0x226)](_0x35db96){const _0x32ec58=_0x3d5d32;if(!this['show']||!this[_0x32ec58(0xb69)])return;this[_0x32ec58(0x7b3)](_0x35db96,_0x35db96),this['primitiveCollection']['add'](this);}['_removedHook'](){const _0x3b3856={_0x381e3c:0x100f,_0x50a350:0xf06},_0x231851=_0x3d5d32;this[_0x231851(0x5f4)]&&this['primitiveCollection']['contains'](this)&&(this[_0x231851(_0x3b3856._0x381e3c)]=!![],this['primitiveCollection'][_0x231851(_0x3b3856._0x50a350)](this),this[_0x231851(0x100f)]=![]),delete this['_modelMatrix'];}['_updatePositionsHook'](){const _0x5962bc={_0x5e2696:0xd93,_0x53981e:0x2c2},_0x4e8ce1=_0x3d5d32;this['_modelMatrix']=this[_0x4e8ce1(_0x5962bc._0x5e2696)],this[_0x4e8ce1(_0x5962bc._0x53981e)]();}['_updateStyleHook'](_0x1ab2ce,_0x1f6913){const _0x1d8277={_0xea1cd1:0xa5d,_0x2200da:0xfba},_0x3537e1=_0x3d5d32;(_0x1f6913['width']||_0x1f6913['height'])&&this['_updatePositionsHook'](),this['color']=_0x1ab2ce['color'],this['_rotationAngle']=Cesium__namespace['Math'][_0x3537e1(0x562)](_0x1ab2ce[_0x3537e1(_0x1d8277._0xea1cd1)]),this[_0x3537e1(_0x1d8277._0x2200da)]=_0x1ab2ce['moveHeight']/this['style']['height'],this['_moveMaxHeight']!==0x0&&(this['_moveDistanceStep']=this['_moveMaxHeight']/(_0x1ab2ce['moveDuration']*0x3c),this['_moveDistanceSum']=0x0);}['update'](_0x5bd2f0){const _0xde4fdc={_0x1ee7d1:0xbaf,_0x2977a3:0x989,_0x4c1041:0x92a,_0x1d7e86:0x4d9},_0x2d5817=_0x3d5d32;if(!this[_0x2d5817(0x792)])return;if(this['style']['animation']){if(this['_moveMaxHeight']!==0x0){this['_moveDistanceSum']+=this['_moveDistanceStep'];(this[_0x2d5817(0x402)]>=this['_moveMaxHeight']||this['_moveDistanceSum']<=0x0)&&(this['_moveDistanceStep']=-this['_moveDistanceStep']);const _0x8e17d0=new Cesium__namespace['Cartesian3'](0x0,0x0,this['_moveDistanceStep']);Cesium__namespace['Matrix4']['multiplyByTranslation'](this['_modelMatrix'],_0x8e17d0,this[_0x2d5817(0x545)]);}if(this[_0x2d5817(0xf70)]!==0x0){const _0x416c8c=Cesium__namespace['Matrix4'][_0x2d5817(_0xde4fdc._0x1ee7d1)](Cesium__namespace['Matrix3'][_0x2d5817(_0xde4fdc._0x2977a3)](this['_rotationAngle']));Cesium__namespace['Matrix4']['multiply'](this['_modelMatrix'],_0x416c8c,this['_modelMatrix']);}}!Cesium__namespace['defined'](this['_drawCommand'])&&(this[_0x2d5817(0x456)]=this['createDrawCommand'](_0x5bd2f0[_0x2d5817(_0xde4fdc._0x4c1041)])),_0x5bd2f0['passes']['render']?Cesium__namespace['defined'](this['_drawCommand'])&&_0x5bd2f0['commandList']['push'](this['_drawCommand']):Cesium__namespace['defined'](this['_pickCommand'])&&_0x5bd2f0[_0x2d5817(_0xde4fdc._0x1d7e86)]['push'](this[_0x2d5817(0x43b)]);}['_clearDrawCommand'](){const _0x3f7335={_0x6c2313:0xb84,_0x427ad9:0x456,_0x34384d:0x689,_0x2ea9cd:0x6cf},_0x4ad600=_0x3d5d32;Cesium__namespace[_0x4ad600(_0x3f7335._0x6c2313)](this['_drawCommand'])&&(this[_0x4ad600(_0x3f7335._0x427ad9)]['vertexArray']&&this['_drawCommand']['vertexArray'][_0x4ad600(_0x3f7335._0x34384d)](),this['_drawCommand']['shaderProgram']&&this[_0x4ad600(0x456)][_0x4ad600(_0x3f7335._0x2ea9cd)]['destroy'](),delete this['_drawCommand']),Cesium__namespace['defined'](this['_pickCommand'])&&(this['_pickCommand']['vertexArray']&&this['_pickCommand']['vertexArray']['destroy'](),this[_0x4ad600(0x43b)][_0x4ad600(0x6cf)]&&this['_pickCommand'][_0x4ad600(_0x3f7335._0x2ea9cd)]['destroy'](),delete this[_0x4ad600(0x43b)]);}[_0x3d5d32(0x23e)](_0x4ffdb4){const _0x58d087={_0x58b366:0xdde,_0xcc9e14:0xbe7,_0x5393fa:0x433,_0x59873a:0xb1a,_0x238515:0x545,_0xa3d2dd:0xf55,_0x3d93c9:0x948,_0x2a99a7:0xe56,_0x3f2a62:0xc50},_0xd39288={_0x4941b0:0x832,_0x4d4efc:0xe8f},_0x3b494d=_0x3d5d32,_0x56d72b=this['style']['translucent']??![],_0xf899e4=this[_0x3b494d(_0x58d087._0x58b366)][_0x3b494d(_0x58d087._0xcc9e14)]??!![],_0x57c779=Cesium__namespace['Appearance']['getDefaultRenderState'](_0x56d72b,_0xf899e4,this[_0x3b494d(_0x58d087._0x5393fa)]['renderState']),_0x269292=Cesium__namespace['RenderState']['fromCache'](_0x57c779),_0x207117={'position':0x0,'textureCoordinates':0x1},_0x5635fe=Cesium__namespace['ShaderProgram'][_0x3b494d(0x5e4)]({'context':_0x4ffdb4,'vertexShaderSource':TetrahedronVS,'fragmentShaderSource':TetrahedronFS,'attributeLocations':_0x207117}),_0x2b6609=this['createVertexArray'](_0x4ffdb4),_0x5b16d5=new Cesium__namespace['BoundingSphere'](this['position'],Math['max'](this['style']['width'],this[_0x3b494d(0xdde)]['height'])),_0x24f29c=new Cesium__namespace['DrawCommand']({'primitiveType':Cesium__namespace[_0x3b494d(_0x58d087._0x59873a)]['TRIANGLES'],'shaderProgram':_0x5635fe,'vertexArray':_0x2b6609,'modelMatrix':this[_0x3b494d(_0x58d087._0x238515)],'renderState':_0x269292,'boundingVolume':_0x5b16d5,'uniformMap':{'color':()=>{return this['color'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium__namespace['Pass']['TRANSLUCENT'],'owner':this,'pickOnly':!![],'pickCommand':new Cesium__namespace['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x24f29c),_0x24f29c['pickId']=_0x4ffdb4['createPickId']({'primitive':_0x24f29c,'id':this['id']});const _0x1e9164=new Cesium__namespace['DrawCommand']({'owner':_0x24f29c,'primitiveType':Cesium__namespace[_0x3b494d(_0x58d087._0x59873a)]['TRIANGLES'],'pickOnly':!![]});_0x1e9164[_0x3b494d(_0x58d087._0xa3d2dd)]=_0x2b6609,_0x1e9164[_0x3b494d(_0x58d087._0x3d93c9)]=_0x269292;const _0x51a563=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x4ffdb4,'vertexShaderSource':TetrahedronVS,'fragmentShaderSource':Cesium__namespace['ShaderSource']['createPickFragmentShaderSource'](TetrahedronFS,'uniform'),'attributeLocations':_0x207117});return _0x1e9164['shaderProgram']=_0x51a563,_0x1e9164['uniformMap']=_0x24f29c['uniformMap'],_0x1e9164[_0x3b494d(_0x58d087._0x2a99a7)]['czm_pickColor']=()=>{const _0x11e196=_0x3b494d;return _0x24f29c[_0x11e196(_0xd39288._0x4941b0)][_0x11e196(_0xd39288._0x4d4efc)];},_0x1e9164[_0x3b494d(_0x58d087._0x3f2a62)]=Cesium__namespace['Pass']['TRANSLUCENT'],_0x1e9164['boundingVolume']=_0x5b16d5,_0x1e9164['modelMatrix']=this['_modelMatrix'],this['_pickCommand']=_0x1e9164,_0x24f29c;}['createVertexArray'](_0x18891d){const _0x983a29={_0x2f23ba:0xf0e,_0x53d885:0x34e,_0x4b4241:0x3a5},_0x415d12=_0x3d5d32,_0x22c38d={'position':0x0,'textureCoordinates':0x1},_0x48306a=this['cereatePositionsAndIndice'](),_0x50fef7=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace[(_0x415d12(_0x983a29._0x2f23ba))]({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':_0x48306a['positions']}),'textureCoordinates':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype'][_0x415d12(_0x983a29._0x53d885)],'componentsPerAttribute':0x2,'values':_0x48306a['sts']})},'indices':_0x48306a['indices'],'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':Cesium__namespace['BoundingSphere']['fromVertices'](_0x48306a['positions'])}),_0x13ae68=Cesium__namespace[_0x415d12(_0x983a29._0x4b4241)]['computeNormal'](_0x50fef7),_0x4be853=Cesium__namespace['VertexArray']['fromGeometry']({'context':_0x18891d,'geometry':_0x13ae68,'attributeLocations':_0x22c38d,'bufferUsage':Cesium__namespace['BufferUsage']['STATIC_DRAW']});return _0x4be853;}['cereatePositionsAndIndice'](){const _0x199bae=new Float64Array(0x5*0x3);_0x199bae[0x0]=0x0,_0x199bae[0x1]=0x1,_0x199bae[0x2]=0x0,_0x199bae[0x3]=-0x1,_0x199bae[0x4]=0x0,_0x199bae[0x5]=0x0,_0x199bae[0x6]=0x0,_0x199bae[0x7]=-0x1,_0x199bae[0x8]=0x0,_0x199bae[0x9]=0x1,_0x199bae[0xa]=0x0,_0x199bae[0xb]=0x0,_0x199bae[0xc]=0x0,_0x199bae[0xd]=0x0,_0x199bae[0xe]=-0x1;const _0x487726=new Uint16Array(0x6*0x3);_0x487726[0x0]=0x4,_0x487726[0x1]=0x2,_0x487726[0x2]=0x3,_0x487726[0x3]=0x4,_0x487726[0x4]=0x3,_0x487726[0x5]=0x0,_0x487726[0x6]=0x4,_0x487726[0x7]=0x0,_0x487726[0x8]=0x1,_0x487726[0x9]=0x4,_0x487726[0xa]=0x1,_0x487726[0xb]=0x2,_0x487726[0xc]=0x1,_0x487726[0xd]=0x2,_0x487726[0xe]=0x3,_0x487726[0xf]=0x1,_0x487726[0x10]=0x3,_0x487726[0x11]=0x0;const _0x57b124=new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1,0.5,0.5]);return{'indices':_0x487726,'positions':_0x199bae,'sts':_0x57b124};}['setOpacity'](_0x234eb8){const _0x187745={_0x3ff08d:0x6f9},_0x4cd994=_0x3d5d32;this[_0x4cd994(_0x187745._0x3ff08d)]=_0x234eb8;}['_getDrawEntityClass'](_0x3ef8f2,_0x2edde7){return this['_getDrawPointEntityClass'](_0x3ef8f2,_0x2edde7);}}register$4('tetrahedron',Tetrahedron,!![]);var ViewShedFS='uniform\x20float\x20mars3d_xAngle;\x0auniform\x20float\x20mars3d_yAngle;\x0auniform\x20float\x20mars3d_distance;\x0auniform\x20float\x20mars3d_opacity;\x0a\x0auniform\x20vec3\x20mars3d_visibleAreaColor;\x0auniform\x20vec3\x20mars3d_hiddenAreaColor;\x0a\x0auniform\x20sampler2D\x20shadowMap_texture;\x0auniform\x20mat4\x20shadowMap_matrix;\x0auniform\x20vec4\x20shadowMap_lightPositionEC;\x0auniform\x20vec4\x20shadowMap_lightDirectionEC;\x0auniform\x20vec3\x20shadowMap_lightUp;\x0auniform\x20vec3\x20shadowMap_lightDir;\x0auniform\x20vec3\x20shadowMap_lightRight;\x0auniform\x20vec4\x20shadowMap_texelSizeDepthBias;\x0auniform\x20vec4\x20shadowMap_normalOffsetScale;\x0a\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0a\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0afloat\x20_czm_sampleShadowMap(sampler2D\x20shadowMap,\x20vec2\x20uv)\x20{\x0a\x20\x20return\x20texture(shadowMap,\x20uv).r;\x0a}\x0afloat\x20_czm_shadowDepthCompare(sampler2D\x20shadowMap,\x20vec2\x20uv,\x20float\x20depth)\x20{\x0a\x20\x20return\x20step(depth,\x20_czm_sampleShadowMap(shadowMap,\x20uv));\x0a}\x0afloat\x20_czm_shadowVisibility(sampler2D\x20shadowMap,\x20czm_shadowParameters\x20shadowParameters)\x20{\x0a\x20\x20float\x20depthBias\x20=\x20shadowParameters.depthBias;\x0a\x20\x20float\x20depth\x20=\x20shadowParameters.depth;\x0a\x20\x20float\x20nDotL\x20=\x20shadowParameters.nDotL;\x0a\x20\x20float\x20normalShadingSmooth\x20=\x20shadowParameters.normalShadingSmooth;\x0a\x20\x20float\x20darkness\x20=\x20shadowParameters.darkness;\x0a\x20\x20vec2\x20uv\x20=\x20shadowParameters.texCoords;\x0a\x20\x20depth\x20-=\x20depthBias;\x0a\x20\x20vec2\x20texelStepSize\x20=\x20shadowParameters.texelStepSize;\x0a\x20\x20float\x20radius\x20=\x201.0;\x0a\x20\x20float\x20dx0\x20=\x20-texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy0\x20=\x20-texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20dx1\x20=\x20texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy1\x20=\x20texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20visibility\x20=\x20(_czm_shadowDepthCompare(shadowMap,\x20uv,\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy1),\x20depth))\x20*\x20(1.0\x20/\x209.0);\x0a\x20\x20return\x20visibility;\x0a}\x0a\x0avec3\x20pointProjectOnPlane(in\x20vec3\x20planeNormal,\x20in\x20vec3\x20planeOrigin,\x20in\x20vec3\x20point)\x20{\x0a\x20\x20vec3\x20v01\x20=\x20point\x20-\x20planeOrigin;\x0a\x20\x20float\x20d\x20=\x20dot(planeNormal,\x20v01);\x0a\x20\x20return\x20(point\x20-\x20planeNormal\x20*\x20d);\x0a}\x0afloat\x20ptm(vec3\x20pt)\x20{\x0a\x20\x20return\x20sqrt(pt.x\x20*\x20pt.x\x20+\x20pt.y\x20*\x20pt.y\x20+\x20pt.z\x20*\x20pt.z);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20const\x20float\x20PI\x20=\x203.141592653589793;\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20czm_shadowParameters\x20shadowParameters;\x0a\x20\x20shadowParameters.texelStepSize\x20=\x20shadowMap_texelSizeDepthBias.xy;\x0a\x20\x20shadowParameters.depthBias\x20=\x20shadowMap_texelSizeDepthBias.z;\x0a\x20\x20shadowParameters.normalShadingSmooth\x20=\x20shadowMap_texelSizeDepthBias.w;\x0a\x20\x20shadowParameters.darkness\x20=\x20shadowMap_normalOffsetScale.w;\x0a\x20\x20shadowParameters.depthBias\x20*=\x20max(depth\x20*\x200.01,\x201.0);\x0a\x0a\x20\x20vec3\x20directionEC\x20=\x20normalize(positionEC.xyz\x20-\x20shadowMap_lightPositionEC.xyz);\x0a\x20\x20float\x20nDotL\x20=\x20clamp(dot(normalEC,\x20-directionEC),\x200.0,\x201.0);\x0a\x20\x20vec4\x20shadowPosition\x20=\x20shadowMap_matrix\x20*\x20positionEC;\x0a\x20\x20shadowPosition\x20/=\x20shadowPosition.w;\x0a\x20\x20if(any(lessThan(shadowPosition.xyz,\x20vec3(0.0)))\x20||\x20any(greaterThan(shadowPosition.xyz,\x20vec3(1.0))))\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//坐标与视点位置距离,大于最大距离则舍弃阴影效果\x0a\x20\x20vec4\x20lw\x20=\x20czm_inverseView\x20*\x20vec4(shadowMap_lightPositionEC.xyz,\x201.0);\x0a\x20\x20vec4\x20vw\x20=\x20czm_inverseView\x20*\x20vec4(positionEC.xyz,\x201.0);\x0a\x20\x20if(distance(lw.xyz,\x20vw.xyz)\x20>\x20mars3d_distance)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//水平夹角限制\x0a\x20\x20vec3\x20ptOnSP\x20=\x20pointProjectOnPlane(shadowMap_lightUp,\x20lw.xyz,\x20vw.xyz);\x0a\x20\x20directionEC\x20=\x20ptOnSP\x20-\x20lw.xyz;\x0a\x20\x20float\x20directionECMO\x20=\x20ptm(directionEC.xyz);\x0a\x20\x20float\x20shadowMap_lightDirMO\x20=\x20ptm(shadowMap_lightDir.xyz);\x0a\x20\x20float\x20cosJJ\x20=\x20dot(directionEC,\x20shadowMap_lightDir)\x20/\x20(directionECMO\x20*\x20shadowMap_lightDirMO);\x0a\x20\x20float\x20degJJ\x20=\x20abs(acos(cosJJ)\x20*\x20(180.0\x20/\x20PI));\x0a\x20\x20if(degJJ\x20>\x20mars3d_xAngle)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20//垂直夹角限制\x0a\x20\x20vec3\x20ptOnCZ\x20=\x20pointProjectOnPlane(shadowMap_lightRight,\x20lw.xyz,\x20vw.xyz);\x0a\x20\x20vec3\x20dirOnCZ\x20=\x20ptOnCZ\x20-\x20lw.xyz;\x0a\x20\x20float\x20dirOnCZMO\x20=\x20ptm(dirOnCZ);\x0a\x20\x20float\x20cosJJCZ\x20=\x20dot(dirOnCZ,\x20shadowMap_lightDir)\x20/\x20(dirOnCZMO\x20*\x20shadowMap_lightDirMO);\x0a\x20\x20float\x20degJJCZ\x20=\x20abs(acos(cosJJCZ)\x20*\x20(180.0\x20/\x20PI));\x0a\x20\x20if(degJJCZ\x20>\x20mars3d_yAngle)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20shadowParameters.texCoords\x20=\x20shadowPosition.xy;\x0a\x20\x20shadowParameters.depth\x20=\x20shadowPosition.z;\x0a\x20\x20shadowParameters.nDotL\x20=\x20nDotL;\x0a\x20\x20float\x20visibility\x20=\x20_czm_shadowVisibility(shadowMap_texture,\x20shadowParameters);\x0a\x0a\x20\x20//可视域\x0a\x20\x20if(visibility\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(mars3d_visibleAreaColor,\x201.0),\x20mars3d_opacity);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(mars3d_hiddenAreaColor,\x201.0),\x20mars3d_opacity);\x0a\x20\x20}\x0a}\x0a';const DEF_STYLE$1={'angle':0x3c,'angle2':0x2d,'distance':0x3e8,'opacity':0.6,'addHeight':0x0,'showFrustum':![]};class ViewShed extends BasePointPrimitive{constructor(_0x45e7e8={},_0x132108=!![]){const _0x450264={_0x52bc67:0xdde,_0x322e1d:0x882,_0x1b3af8:0x102b},_0x1127d2=_0x3d5d32;_0x132108&&(_0x45e7e8[_0x1127d2(0xdde)]={...DEF_STYLE$1,..._0x45e7e8['style']||{}}),super(_0x45e7e8),this['_visibleAreaColor']=getCesiumColor(this['style']['visibleAreaColor'],new Cesium__namespace['Color'](0x0,0x1,0x0)),this['_hiddenAreaColor']=getCesiumColor(this[_0x1127d2(_0x450264._0x52bc67)][_0x1127d2(0xa87)],new Cesium__namespace[(_0x1127d2(_0x450264._0x322e1d))](0x1,0x0,0x0)),this['_hasTerrainShadows']=this['options']['terrain']??!![],this['_maximumDistance']=this['style'][_0x1127d2(_0x450264._0x1b3af8)]??0x1388;}get[_0x3d5d32(0xd2e)](){const _0x305a69=_0x3d5d32;return this[_0x305a69(0x2e7)];}get['angle'](){return this['style']['angle'];}set['angle'](_0x339d7a){const _0x178dd3=_0x3d5d32;this['style']['angle']=_0x339d7a,this[_0x178dd3(0xe47)]();}get['angle2'](){const _0xe1959f={_0x7f0585:0xdde,_0x3ecb1b:0x5df},_0x3aaf0f=_0x3d5d32;return this[_0x3aaf0f(_0xe1959f._0x7f0585)][_0x3aaf0f(_0xe1959f._0x3ecb1b)]??this['style']['angle'];}set['angle2'](_0x507825){const _0x25dbac={_0x28db23:0xdde},_0x2c512f=_0x3d5d32;this[_0x2c512f(_0x25dbac._0x28db23)][_0x2c512f(0x5df)]=_0x507825,this['_updateDraw']();}get['visibleAreaColor'](){return this['_visibleAreaColor'];}set['visibleAreaColor'](_0x1a0c93){this['_visibleAreaColor']=getCesiumColor(_0x1a0c93);}get['hiddenAreaColor'](){return this['_hiddenAreaColor'];}set['hiddenAreaColor'](_0x27c0ab){this['_hiddenAreaColor']=getCesiumColor(_0x27c0ab);}get['opacity'](){const _0x245dc5={_0x172022:0xdde},_0x3d414c=_0x3d5d32;return this[_0x3d414c(_0x245dc5._0x172022)]['opacity'];}set['opacity'](_0x1d5737){this['style']['opacity']=_0x1d5737;}get['showFrustum'](){const _0x512d34=_0x3d5d32;return this[_0x512d34(0xdde)]['showFrustum'];}set[_0x3d5d32(0x5c3)](_0x5ac09c){this['style']['showFrustum']=_0x5ac09c,this['_frustumPrimitive']['show']=_0x5ac09c;}get[_0x3d5d32(0xbd7)](){const _0x32dc8f={_0x3922e9:0xbd7},_0x5dd96b=_0x3d5d32;return this['style'][_0x5dd96b(_0x32dc8f._0x3922e9)];}set[_0x3d5d32(0xbd7)](_0x5923e2){const _0x294dc9=_0x3d5d32;this['style']['distance']=_0x5923e2,this[_0x294dc9(0xe47)]();}get['shadowMap'](){return this['_shadowMap'];}get['camera'](){var _0x44f84f;return(_0x44f84f=this['_shadowMap'])===null||_0x44f84f===void 0x0?void 0x0:_0x44f84f['_lightCamera'];}get[_0x3d5d32(0xba9)](){return this['options']['targetPosition'];}set['targetPosition'](_0x552aa8){const _0x4df4f6={_0xcb2279:0x433,_0x122ce4:0x1d1,_0x9a8b28:0xe95},_0x17bfe0=_0x3d5d32;var _0x34fbf4;this[_0x17bfe0(_0x4df4f6._0xcb2279)]['targetPosition']=_0x552aa8;if(!this[_0x17bfe0(_0x4df4f6._0x122ce4)])return;const _0x1427f9=this['position'];if(!_0x1427f9)return;const _0x36dab2=LngLatPoint['toCartesian'](_0x552aa8,(_0x34fbf4=this[_0x17bfe0(_0x4df4f6._0x122ce4)])===null||_0x34fbf4===void 0x0?void 0x0:_0x34fbf4['currentTime']);this['distance']=Cesium__namespace[_0x17bfe0(0xe95)][_0x17bfe0(0xbd7)](_0x1427f9,_0x36dab2);const _0x280b42=Cesium__namespace['Cartesian3'][_0x17bfe0(0xf69)](Cesium__namespace['Cartesian3']['subtract'](_0x36dab2,_0x1427f9,new Cesium__namespace[(_0x17bfe0(0xe95))]()),new Cesium__namespace[(_0x17bfe0(_0x4df4f6._0x9a8b28))]()),_0x93905a=Cesium__namespace['Cartesian3']['normalize'](_0x1427f9,new Cesium__namespace[(_0x17bfe0(0xe95))]()),_0x8ae70d=new Cesium__namespace[(_0x17bfe0(0x36d))](this['_map']['scene']);_0x8ae70d['position']=_0x1427f9,_0x8ae70d['direction']=_0x280b42,_0x8ae70d['up']=_0x93905a,this[_0x17bfe0(0xdde)]['heading']=Cesium__namespace['Math']['toDegrees'](_0x8ae70d['heading']),this['style']['pitch']=Cesium__namespace['Math']['toDegrees'](_0x8ae70d[_0x17bfe0(0x5cf)]),this['_updateDraw']();}[_0x3d5d32(0x68e)](){const _0x2fcdb3={_0x55978d:0xe47},_0x24e405=_0x3d5d32;this[_0x24e405(0x792)]?this[_0x24e405(_0x2fcdb3._0x55978d)]():this['_clearDraw']();}['_updatePositionsHook'](){this['_updateDraw']();}['_mountedHook'](){const _0x2c9b91={_0x27a139:0x433},_0x26e678=_0x3d5d32;this[_0x26e678(_0x2c9b91._0x27a139)]['targetPosition']&&(this['targetPosition']=this[_0x26e678(0x433)][_0x26e678(0xba9)]),this['_defaultColorTexture']=new Cesium__namespace[(_0x26e678(0x979))]({'context':this['_map']['scene']['context'],'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0x0,0x0,0x0,0x0])},'flipY':![]});}['_addedHook'](_0x3f551f){const _0x5bf352=_0x3d5d32;this['_hasTerrainShadows']&&(this['_map']['viewer']['terrainShadows']=Cesium__namespace['ShadowMode'][_0x5bf352(0x690)]),this['_updateDraw'](),this['primitiveCollection'][_0x5bf352(0xff3)](this);}[_0x3d5d32(0x566)](){const _0x3d774b={_0x51d7fd:0xd7d},_0x1ddd33=_0x3d5d32;this[_0x1ddd33(0x6f8)]&&(this['_map']['terrainShadows']=Cesium__namespace['ShadowMode'][_0x1ddd33(_0x3d774b._0x51d7fd)]),this['_clearDraw'](),this['primitiveCollection']['contains'](this)&&(this['_noDestroy']=!![],this[_0x1ddd33(0x5f4)]['remove'](this),this['_noDestroy']=![]);}['updateModelMatrix'](){this['_updateDraw']();}['_updateDraw'](){const _0x4eb589={_0x380c26:0x552,_0x3c271f:0x7ba,_0xb6b49:0x5cf,_0x5910ec:0x389,_0x265909:0xc06,_0x1fa2b8:0x585,_0x2620d7:0x433},_0x5c0ade=_0x3d5d32;this[_0x5c0ade(_0x4eb589._0x380c26)]();if(!this['_map']||!this['show'])return;const _0x6d4239=this['position'];if(!_0x6d4239)return;const _0x43d74e=new Cesium__namespace[(_0x5c0ade(_0x4eb589._0x3c271f))](Cesium__namespace['Math']['toRadians'](this['heading']),Cesium__namespace['Math']['toRadians'](this[_0x5c0ade(_0x4eb589._0xb6b49)]),Cesium__namespace['Math']['toRadians'](this['roll'])),_0x2e5026=new Cesium__namespace[(_0x5c0ade(0x36d))](this['_map']['scene']);_0x2e5026['position']=_0x6d4239,_0x2e5026[_0x5c0ade(_0x4eb589._0x5910ec)]['fov']=Cesium__namespace[_0x5c0ade(0x103e)]['toRadians'](this['angle']*0x2),_0x2e5026['frustum'][_0x5c0ade(_0x4eb589._0x265909)]=this['angle']/this['angle2'],_0x2e5026['frustum'][_0x5c0ade(_0x4eb589._0x1fa2b8)]=0.01,_0x2e5026['frustum']['far']=this['distance'],_0x2e5026['setView']({'destination':_0x6d4239,'orientation':{'heading':_0x43d74e[_0x5c0ade(0xe39)],'pitch':_0x43d74e['pitch'],'roll':_0x43d74e['roll']}}),this['_createFrustumPrimitive'](_0x2e5026),this['_shadowMap']=new Cesium__namespace['ShadowMap']({'lightCamera':_0x2e5026,'context':this['_map']['scene']['context'],'maximumDistance':this['_maximumDistance'],'isSpotLight':!![],'cascadesEnabled':![],'enabled':![],'depthBiasStep':this[_0x5c0ade(_0x4eb589._0x2620d7)]['depthBiasStep']}),this['_createPostProcessStage']();}['_clearDraw'](){const _0x462b09=_0x3d5d32;if(!this['_map'])return;this['_postProcessStage']&&(this['_map']['scene']['postProcessStages']['remove'](this['_postProcessStage']),delete this['_postProcessStage']),this['_shadowMap']&&(this['_shadowMap']['destroy'](),delete this[_0x462b09(0x103f)]),this['_frustumPrimitive']&&(this['_layer']['removeGraphic'](this[_0x462b09(0x754)],!![]),delete this['_frustumPrimitive']);}['update'](_0x25a24f){const _0xda01b9=_0x3d5d32;this[_0xda01b9(0x103f)]&&_0x25a24f['shadowMaps']['push'](this['_shadowMap']);}['_createFrustumPrimitive'](_0xf0720b){const _0x286404={_0x561b8d:0x754,_0x8b1716:0x5df},_0x4939d0=_0x3d5d32;this['_frustumPrimitive']&&this['_layer']['removeGraphic'](this[_0x4939d0(_0x286404._0x561b8d)],!![]);const _0x4470a4=this['distance']+0x1;this['_frustumPrimitive']=new ArcFrustum({'modelMatrix':_0xf0720b['inverseViewMatrix'],'style':{'angle':this[_0x4939d0(0x247)],'angle2':this[_0x4939d0(_0x286404._0x8b1716)],'distance':_0x4470a4},'show':this['showFrustum']&&this['show'],'private':!![]}),this[_0x4939d0(0x873)]['addGraphic'](this[_0x4939d0(0x754)]);}['_createPostProcessStage'](){const _0x465c9a={_0x4fd984:0xaa4,_0x380207:0xb0e},_0xb337d4={_0x4dccde:0x3b9,_0x40af11:0xf21},_0x53442e=_0x3d5d32;this[_0x53442e(0x2e7)]&&(this['_map']['scene'][_0x53442e(_0x465c9a._0x4fd984)]['remove'](this['_postProcessStage']),delete this[_0x53442e(0x2e7)]);const _0x35e343=new Cesium__namespace[(_0x53442e(_0x465c9a._0x380207))](),_0xa8b70=new Cesium__namespace['Cartesian4'](),_0x402b82=new Cesium__namespace['Cartesian4'](),_0x33a0be=this['_shadowMap']['_primitiveBias'];this['_postProcessStage']=new Cesium__namespace['PostProcessStage']({'fragmentShader':ViewShedFS,'uniforms':{'mars3d_opacity':()=>{return this['opacity'];},'mars3d_visibleAreaColor':()=>{const _0x4d97d4=_0x53442e;return this[_0x4d97d4(0x5dc)];},'mars3d_hiddenAreaColor':()=>{return this['hiddenAreaColor'];},'mars3d_distance':()=>{return this['distance'];},'mars3d_xAngle':()=>{return this['angle'];},'mars3d_yAngle':()=>{return this['angle2'];},'shadowMap_texture':()=>{return this['_shadowMap']['_shadowMapTexture']||this['_defaultColorTexture'];},'shadowMap_matrix':()=>{return this['_shadowMap']['_shadowMapMatrix'];},'shadowMap_lightPositionEC':()=>{return this['_shadowMap']['_lightPositionEC'];},'shadowMap_lightDirectionEC':()=>{const _0xc59af1=_0x53442e;return this[_0xc59af1(0x103f)]['_lightDirectionEC'];},'shadowMap_lightUp':()=>{return this['_shadowMap']['_lightCamera']['up'];},'shadowMap_lightDir':()=>{return this['_shadowMap']['_lightCamera']['direction'];},'shadowMap_lightRight':()=>{return this['_shadowMap']['_lightCamera']['right'];},'shadowMap_texelSizeDepthBias':()=>{const _0x25edeb=_0x53442e;return _0x35e343['x']=0x1/this['_shadowMap']['_textureSize']['x'],_0x35e343['y']=0x1/this[_0x25edeb(0x103f)][_0x25edeb(0x3c1)]['y'],Cesium__namespace['Cartesian4']['fromElements'](_0x35e343['x'],_0x35e343['y'],_0x33a0be[_0x25edeb(_0xb337d4._0x4dccde)],_0x33a0be[_0x25edeb(_0xb337d4._0x40af11)],_0xa8b70);},'shadowMap_normalOffsetScale':()=>{return Cesium__namespace['Cartesian4']['fromElements'](_0x33a0be['normalOffsetScale'],this['_shadowMap']['_distance'],this['_shadowMap']['maximumDistance'],this['_shadowMap']['_darkness'],_0x402b82);}}}),this['_map']['scene']['postProcessStages'][_0x53442e(0xff3)](this['_postProcessStage']);}['_style2JsonBase'](_0x3d6d37,_0x23ce7c){const _0x2a3d8b={_0x3a8b45:0x5cf},_0x547099=_0x3d5d32;return _0x3d6d37['heading']=formatNum$1(this['heading'],0x1),_0x3d6d37[_0x547099(_0x2a3d8b._0x3a8b45)]=formatNum$1(this['pitch'],0x1),_0x3d6d37['distance']=formatNum$1(this['distance'],0x2),getAttrVal(_0x3d6d37,{'onlySimpleType':!![]});}[_0x3d5d32(0x38d)](){const _0x57a9da={_0x103eef:0x315,_0x5d830e:0xe36},_0x5c8f1a=_0x3d5d32;if(!this['_map'])return;const _0x57399d=this['camera'];if(!_0x57399d)return;this['_map']['camera']['position']=Cesium__namespace[_0x5c8f1a(_0x57a9da._0x103eef)](this['position']),this[_0x5c8f1a(0x1d1)]['camera']['direction']=Cesium__namespace['clone'](_0x57399d[_0x5c8f1a(_0x57a9da._0x5d830e)]),this['_map']['camera'][_0x5c8f1a(0x28b)]=Cesium__namespace['clone'](_0x57399d['right']),this[_0x5c8f1a(0x1d1)]['camera']['up']=Cesium__namespace['clone'](_0x57399d['up']);}['setOpacity'](_0x49596e){this['style']['opacity']=_0x49596e;}['startDraw'](_0x4ca027){const _0x147326={_0x2b66c6:0x6e3},_0x482346=_0x3d5d32;if(this[_0x482346(0x6e3)])return this;this[_0x482346(_0x147326._0x2b66c6)]=!![];_0x4ca027&&this['addTo'](_0x4ca027);if(!this['_map'])throw new Error(_0x482346(0x738));this[_0x482346(0x1d1)]['_setEditCursor'](!![]),this['enableControl'](![]),this['_startDrawHook'](),this['fire'](EventType['drawStart'],{'drawtype':this['type'],'graphic':this},!![]);}[_0x3d5d32(0xf57)](){const _0x4a557e={_0x1fa4b0:0xf06,_0x129a44:0xefc},_0xccd0b0=_0x3d5d32;var _0x2c2d63,_0x34413a,_0x25a4d0;if(!this['_enabledDraw'])return this;this[_0xccd0b0(0xb05)](),this['_map']['_setEditCursor'](![]),this['enableControl'](!![]),this['_map']['closeSmallTooltip'](),this['_enabledDraw']=![];if(!this['position']||!this['distance']){this[_0xccd0b0(_0x4a557e._0x1fa4b0)](!![]);return;}this[_0xccd0b0(_0x4a557e._0x129a44)](EventType['drawCreated'],{'drawtype':this[_0xccd0b0(0x7f5)],'graphic':this},!![]),(_0x2c2d63=this['options'])!==null&&_0x2c2d63!==void 0x0&&_0x2c2d63['success']&&this['options']['success'](this),(_0x34413a=this['options'])!==null&&_0x34413a!==void 0x0&&(_0x25a4d0=_0x34413a['_promise'])!==null&&_0x25a4d0!==void 0x0&&_0x25a4d0[_0xccd0b0(0xac9)]&&this['options']['_promise']['resolve'](this);}[_0x3d5d32(0xa57)](){const _0x539d1d=_0x3d5d32;this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](EventType[_0x539d1d(0x314)],this[_0x539d1d(0x9b8)],this);}['_stopDrawHook'](){const _0x766bcd={_0x18bbd6:0x1d1},_0x43d41a=_0x3d5d32;this['_map']['off'](EventType['click'],this['_onClickHandler'],this),this[_0x43d41a(_0x766bcd._0x18bbd6)][_0x43d41a(0x9e7)](EventType['mouseMove'],this['_onMouseMoveHandler'],this);}['_onClickHandler'](_0x441424){const _0xa63417={_0x36a673:0xefc,_0x22295a:0xdde,_0x1d7bd6:0xe95,_0x3d9e8e:0xe30},_0x5810b7=_0x3d5d32;let _0xbd4588=_0x441424['cartesian'];if(!_0xbd4588)return;this[_0x5810b7(_0xa63417._0x36a673)](EventType['drawAddPoint'],{..._0x441424,'drawtype':this['type'],'graphic':this},!![]);if(!this['position']){this[_0x5810b7(0xb69)]=addPositionsHeight(_0xbd4588,this[_0x5810b7(_0xa63417._0x22295a)]['addHeight']);return;}const _0x525938=Cesium__namespace[_0x5810b7(_0xa63417._0x1d7bd6)]['distance'](this['position'],_0xbd4588);_0x525938>this['_maximumDistance']&&(_0xbd4588=getOnLinePointByLen(this['position'],_0xbd4588,this['_maximumDistance'])),this['targetPosition']=_0xbd4588,this['stopDraw'](),this['fire'](EventType[_0x5810b7(_0xa63417._0x3d9e8e)],_0x441424);}['_onMouseMoveHandler'](_0x2c7cd0){const _0x59a033={_0x50f24d:0xd86},_0x23ff4e=_0x3d5d32;let _0x1a153c=_0x2c7cd0['cartesian'];if(!_0x1a153c)return;const _0x17f473=this[_0x23ff4e(0xb69)];if(_0x17f473){const _0x30e10e=Cesium__namespace['Cartesian3']['distance'](_0x17f473,_0x1a153c);_0x30e10e>this[_0x23ff4e(0xb4d)]&&(_0x1a153c=getOnLinePointByLen(_0x17f473,_0x1a153c,this['_maximumDistance'])),this['targetPosition']=_0x1a153c,this['fire'](EventType[_0x23ff4e(0x4a7)],{..._0x2c7cd0,'drawtype':this['type'],'graphic':this},!![]),this['_map'][_0x23ff4e(_0x59a033._0x50f24d)](_0x2c7cd0['endPosition'],this['_map'][_0x23ff4e(0xd1b)]('_单击完成绘制'));}else this['_map']['openSmallTooltip'](_0x2c7cd0['endPosition'],this['_map']['getLangText']('_单击开始绘制'));}}register$4(_0x3d5d32(0x34c),ViewShed,!![]);var ViewVideoFS='uniform\x20float\x20mars3d_opacity;\x0a\x0auniform\x20sampler2D\x20mars3d_videoTexture;\x0auniform\x20sampler2D\x20mars3d_maskTexture;\x0auniform\x20vec4\x20mars3d_hiddenAreaColor;\x0a\x0auniform\x20sampler2D\x20shadowMap_texture;\x0auniform\x20mat4\x20shadowMap_matrix;\x0auniform\x20vec4\x20shadowMap_lightPositionEC;\x0auniform\x20vec4\x20shadowMap_texelSizeDepthBias;\x0auniform\x20vec4\x20shadowMap_normalOffsetScale;\x0auniform\x20bool\x20mars3d_flipx;\x0auniform\x20bool\x20mars3d_flipy;\x0a\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0a\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0afloat\x20_czm_sampleShadowMap(sampler2D\x20shadowMap,\x20vec2\x20uv)\x20{\x0a\x20\x20return\x20texture(shadowMap,\x20uv).r;\x0a}\x0afloat\x20_czm_shadowDepthCompare(sampler2D\x20shadowMap,\x20vec2\x20uv,\x20float\x20depth)\x20{\x0a\x20\x20return\x20step(depth,\x20_czm_sampleShadowMap(shadowMap,\x20uv));\x0a}\x0afloat\x20_czm_shadowVisibility(sampler2D\x20shadowMap,\x20czm_shadowParameters\x20shadowParameters)\x20{\x0a\x20\x20float\x20depthBias\x20=\x20shadowParameters.depthBias;\x0a\x20\x20float\x20depth\x20=\x20shadowParameters.depth;\x0a\x20\x20float\x20nDotL\x20=\x20shadowParameters.nDotL;\x0a\x20\x20float\x20normalShadingSmooth\x20=\x20shadowParameters.normalShadingSmooth;\x0a\x20\x20float\x20darkness\x20=\x20shadowParameters.darkness;\x0a\x20\x20vec2\x20uv\x20=\x20shadowParameters.texCoords;\x0a\x20\x20depth\x20-=\x20depthBias;\x0a\x20\x20vec2\x20texelStepSize\x20=\x20shadowParameters.texelStepSize;\x0a\x20\x20float\x20radius\x20=\x201.0;\x0a\x20\x20float\x20dx0\x20=\x20-texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy0\x20=\x20-texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20dx1\x20=\x20texelStepSize.x\x20*\x20radius;\x0a\x20\x20float\x20dy1\x20=\x20texelStepSize.y\x20*\x20radius;\x0a\x20\x20float\x20visibility\x20=\x20(_czm_shadowDepthCompare(shadowMap,\x20uv,\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x200.0),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(0.0,\x20dy1),\x20depth)\x20+\x0a\x20\x20\x20\x20_czm_shadowDepthCompare(shadowMap,\x20uv\x20+\x20vec2(dx1,\x20dy1),\x20depth))\x20*\x20(1.0\x20/\x209.0);\x0a\x20\x20return\x20visibility;\x0a}\x0a\x0avec3\x20pointProjectOnPlane(in\x20vec3\x20planeNormal,\x20in\x20vec3\x20planeOrigin,\x20in\x20vec3\x20point)\x20{\x0a\x20\x20vec3\x20v01\x20=\x20point\x20-\x20planeOrigin;\x0a\x20\x20float\x20d\x20=\x20dot(planeNormal,\x20v01);\x0a\x20\x20return\x20(point\x20-\x20planeNormal\x20*\x20d);\x0a}\x0afloat\x20ptm(vec3\x20pt)\x20{\x0a\x20\x20return\x20sqrt(pt.x\x20*\x20pt.x\x20+\x20pt.y\x20*\x20pt.y\x20+\x20pt.z\x20*\x20pt.z);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20const\x20float\x20PI\x20=\x203.141592653589793;\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20czm_shadowParameters\x20shadowParameters;\x0a\x20\x20shadowParameters.texelStepSize\x20=\x20shadowMap_texelSizeDepthBias.xy;\x0a\x20\x20shadowParameters.depthBias\x20=\x20shadowMap_texelSizeDepthBias.z;\x0a\x20\x20shadowParameters.normalShadingSmooth\x20=\x20shadowMap_texelSizeDepthBias.w;\x0a\x20\x20shadowParameters.darkness\x20=\x20shadowMap_normalOffsetScale.w;\x0a\x20\x20shadowParameters.depthBias\x20*=\x20max(depth\x20*\x200.01,\x201.0);\x0a\x0a\x20\x20vec3\x20directionEC\x20=\x20normalize(positionEC.xyz\x20-\x20shadowMap_lightPositionEC.xyz);\x0a\x20\x20float\x20nDotL\x20=\x20clamp(dot(normalEC,\x20-directionEC),\x200.0,\x201.0);\x0a\x20\x20vec4\x20shadowPosition\x20=\x20shadowMap_matrix\x20*\x20positionEC;\x0a\x20\x20shadowPosition\x20/=\x20shadowPosition.w;\x0a\x20\x20if(any(lessThan(shadowPosition.xyz,\x20vec3(0.0)))\x20||\x20any(greaterThan(shadowPosition.xyz,\x20vec3(1.0))))\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x0a\x20\x20shadowParameters.texCoords\x20=\x20shadowPosition.xy;\x0a\x20\x20shadowParameters.depth\x20=\x20shadowPosition.z;\x0a\x20\x20shadowParameters.nDotL\x20=\x20nDotL;\x0a\x20\x20float\x20visibility\x20=\x20_czm_shadowVisibility(shadowMap_texture,\x20shadowParameters);\x0a\x0a\x20\x20//视频投射\x0a\x20\x20if(visibility\x20==\x201.0)\x20{\x0a\x20\x20\x20\x20if(mars3d_flipx){\x0a\x20\x20\x20\x20\x20\x20shadowPosition.x\x20=\x20shadowPosition.x\x20+\x20(0.5\x20-\x20shadowPosition.x)\x20*\x202.0;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if(mars3d_flipy){\x0a\x20\x20\x20\x20\x20\x20shadowPosition.y\x20=\x20shadowPosition.y\x20+\x20(0.5\x20-\x20shadowPosition.y)\x20*\x202.0;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20vec4\x20videoColor\x20=\x20texture(mars3d_videoTexture,\x20shadowPosition.xy);\x0a\x20\x20\x20\x20vec4\x20maskColor\x20=\x20texture(mars3d_maskTexture,\x20shadowPosition.xy);\x0a\x20\x20\x20\x20videoColor\x20*=\x20maskColor;\x0a\x20\x20\x20\x20out_FragColor\x20=\x20mix(color,\x20vec4(videoColor.xyz,\x201.0),\x20mars3d_opacity\x20*\x20videoColor.a);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20if(abs(shadowPosition.z\x20-\x200.0)\x20<\x200.01)\x20{\x0a\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(mix(color.rgb,\x20mars3d_hiddenAreaColor.rgb,\x20mars3d_hiddenAreaColor.a),\x20mars3d_hiddenAreaColor.a);\x0a\x20\x20}\x0a}\x0a';const DEF_STYLE={'angle':0x3c,'angle2':0x2d,'distance':0x3e8,'opacity':0x1,'showFrustum':![],'hiddenAreaColor':new Cesium__namespace['Color'](0x0,0x0,0x0,0.5),'flipx':![],'flipy':![]};class Video3D extends ViewShed{constructor(_0x1c4046={}){const _0x1bc5de={_0x330756:0xdde},_0x3494f6=_0x3d5d32;_0x1c4046[_0x3494f6(0xdde)]={...DEF_STYLE,..._0x1c4046[_0x3494f6(_0x1bc5de._0x330756)]||{}},_0x1c4046['terrain']=![],super(_0x1c4046,![]),this['_videoPlay']=!![];}get['container'](){const _0x9240a7=_0x3d5d32;return this[_0x9240a7(0x20c)];}get['distance'](){const _0x56472e=_0x3d5d32;return this[_0x56472e(0xdde)]['distance'];}set['distance'](_0x580fe8){this['style']['distance']=_0x580fe8,this['_updateDraw']();}get['flipx'](){return this['style']['flipx'];}set[_0x3d5d32(0xac6)](_0x37525a){this['style']['flipx']=_0x37525a;}get['play'](){const _0x5e13de={_0x394afc:0x3c8},_0x1a45ba=_0x3d5d32;return this[_0x1a45ba(_0x5e13de._0x394afc)];}set[_0x3d5d32(0xc2c)](_0x962dd1){const _0x148d1b={_0x5808ee:0x862,_0x177ecf:0x20c},_0x2ecf37=_0x3d5d32;this['_videoPlay']=Boolean(_0x962dd1);if(this['_videoContainer'])try{this[_0x2ecf37(_0x148d1b._0x5808ee)]?this[_0x2ecf37(0x20c)]['play']():this[_0x2ecf37(_0x148d1b._0x177ecf)]['pause']();}catch(_0x5be9cc){}}['_mountedHook'](){const _0x47c511={_0x42a764:0x20c},_0x3bd28f={_0x526d14:0xaac},_0x334c9a=_0x3d5d32;super['_mountedHook']();const _0x468e15=this['style']['maskImage'];if(_0x468e15){const _0xb66747=new Image();_0xb66747[_0x334c9a(0x3b1)]=_0x3349d1=>{const _0xe8e868=_0x334c9a;this['_maskTexture']=new Cesium__namespace['Texture']({'context':this['_map']['scene'][_0xe8e868(0x92a)],'source':_0xb66747});},_0xb66747['onerror']=_0x290c50=>{const _0x714ac8=_0x334c9a;logError$1(_0x714ac8(_0x3bd28f._0x526d14)+_0x468e15,_0x290c50);},_0xb66747['src']=_0x468e15;}else this['_maskTexture']=new Cesium__namespace[(_0x334c9a(0x979))]({'context':this['_map']['scene']['context'],'source':{'width':0x1,'height':0x1,'arrayBufferView':new Uint8Array([0xff,0xff,0xff,0xff])},'flipY':![]});if(this['style']['container'])this[_0x334c9a(_0x47c511._0x42a764)]=this[_0x334c9a(0xdde)]['container'];else this['style'][_0x334c9a(0x5ee)]&&(this['_videoContainer']=createVideo(this[_0x334c9a(0xdde)]['url'],this['style']['fileType'],'',document[_0x334c9a(0x750)]),this['_videoContainer']['style'][_0x334c9a(0xd92)]='none',this['_hasRemoveElement']=!![]);this['_videoContainer']&&this[_0x334c9a(0x1d1)]['on'](EventType[_0x334c9a(0x6df)],this[_0x334c9a(0xb3d)],this);}['_removedHook'](){const _0x47493a={_0x225d9d:0x1d1,_0x42281f:0xac2,_0x187598:0x20c,_0x1c1349:0x566},_0x15c38d=_0x3d5d32;var _0x4a894a;this[_0x15c38d(_0x47493a._0x225d9d)]['off'](EventType['clockTick'],this['_onClockTickHandler'],this),this['_hasRemoveElement']&&(_0x4a894a=this['_videoContainer'])!==null&&_0x4a894a!==void 0x0&&_0x4a894a['parentNode']&&(this['_videoContainer']['parentNode'][_0x15c38d(_0x47493a._0x42281f)](this['_videoContainer']),delete this['_hasRemoveElement'],delete this[_0x15c38d(_0x47493a._0x187598)]),super[_0x15c38d(_0x47493a._0x1c1349)]();}['_onClockTickHandler'](){const _0x5e8b47={_0x359ecf:0xca7,_0x3252ed:0x847,_0x5e313b:0x979,_0x1ad0ed:0x5f8},_0x62fe17=_0x3d5d32;try{this['_videoPlay']&&this[_0x62fe17(0x20c)][_0x62fe17(_0x5e8b47._0x359ecf)]&&this['_videoContainer']['play']();}catch(_0x4bf014){}if(!this[_0x62fe17(0x20c)]||!this['_map'])return;this[_0x62fe17(_0x5e8b47._0x3252ed)]&&this['_videoTexture'][_0x62fe17(0x689)](),this[_0x62fe17(0x847)]=new Cesium__namespace[(_0x62fe17(_0x5e8b47._0x5e313b))]({'context':this['_map']['scene']['context'],'source':this[_0x62fe17(0x20c)],'pixelFormat':Cesium__namespace['PixelFormat']['RGBA'],'pixelDatatype':Cesium__namespace['PixelDatatype'][_0x62fe17(_0x5e8b47._0x1ad0ed)]});}['_clearDraw'](){const _0x1bc629={_0x2a30a8:0x754},_0x1e421e=_0x3d5d32;this['_frustumPrimitive']&&(this['primitiveCollection']['remove'](this[_0x1e421e(_0x1bc629._0x2a30a8)]),delete this[_0x1e421e(_0x1bc629._0x2a30a8)]),super['_clearDraw']();}['_createFrustumPrimitive'](_0x44b16a){const _0x9a8427={_0x5ec4a4:0x9dc,_0x3006b7:0x389,_0x26db0e:0xaf0},_0x21b6e8=_0x3d5d32,_0x4f7a0d=_0x44b16a['directionWC'],_0x27261e=_0x44b16a['upWC'];let _0x13665c=_0x44b16a['rightWC'];_0x13665c=Cesium__namespace['Cartesian3']['negate'](_0x13665c,new Cesium__namespace['Cartesian3']());const _0x2c7a73=new Cesium__namespace['Matrix3']();Cesium__namespace[_0x21b6e8(_0x9a8427._0x5ec4a4)]['setColumn'](_0x2c7a73,0x0,_0x13665c,_0x2c7a73),Cesium__namespace[_0x21b6e8(0x9dc)]['setColumn'](_0x2c7a73,0x1,_0x27261e,_0x2c7a73),Cesium__namespace['Matrix3']['setColumn'](_0x2c7a73,0x2,_0x4f7a0d,_0x2c7a73);const _0x2da823=Cesium__namespace['Quaternion']['fromRotationMatrix'](_0x2c7a73,new Cesium__namespace['Quaternion']());this['_frustumPrimitive']&&this['primitiveCollection'][_0x21b6e8(0xf06)](this['_frustumPrimitive']),this['_frustumPrimitive']=new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace['GeometryInstance']({'id':this['id'],'geometry':new Cesium__namespace['FrustumOutlineGeometry']({'origin':_0x44b16a['position'],'orientation':_0x2da823,'frustum':_0x44b16a[_0x21b6e8(_0x9a8427._0x3006b7)],'_drawNearPlane':!![]}),'attributes':{'color':Cesium__namespace['ColorGeometryInstanceAttribute'][_0x21b6e8(_0x9a8427._0x26db0e)](Cesium__namespace['Color'][_0x21b6e8(0xe29)])}}),'appearance':new Cesium__namespace['PerInstanceColorAppearance']({'translucent':![],'flat':!![]}),'asynchronous':![],'show':this['showFrustum']&&this['show']}),this['primitiveCollection']['add'](this['_frustumPrimitive']),this['bindPickId'](this['_frustumPrimitive']);}['_createPostProcessStage'](){const _0x514ec2={_0x181738:0xd36,_0x50a4e8:0x1d1,_0x4377f1:0xfc1},_0x55b4b7={_0x534e01:0xd36,_0x28ac10:0x94a},_0x197ba3={_0x2174d3:0x3b9},_0x198e92={_0x4025cb:0x305},_0x30bb1b={_0x9d118c:0xfdc},_0x3cd98b={_0x5f0bb1:0x847},_0x34c675=_0x3d5d32;this['_postProcessStage']&&(this['_map']['scene'][_0x34c675(0xaa4)]['remove'](this['_postProcessStage']),delete this['_postProcessStage']);const _0x56a6e1=new Cesium__namespace['Cartesian2'](),_0x2267f7=new Cesium__namespace[(_0x34c675(_0x514ec2._0x181738))](),_0x259119=new Cesium__namespace[(_0x34c675(0xd36))](),_0x5b5e39=this['_shadowMap']['_primitiveBias'];this['_postProcessStage']=new Cesium__namespace['PostProcessStage']({'fragmentShader':ViewVideoFS,'uniforms':{'mars3d_videoTexture':()=>{const _0x582181=_0x34c675;return this[_0x582181(_0x3cd98b._0x5f0bb1)]||this['_defaultColorTexture'];},'mars3d_maskTexture':()=>{return this['_maskTexture'];},'mars3d_opacity':()=>{const _0x5380c3=_0x34c675;return this[_0x5380c3(_0x30bb1b._0x9d118c)];},'mars3d_hiddenAreaColor':()=>{return this['hiddenAreaColor'];},'shadowMap_texture':()=>{const _0x11cec2=_0x34c675;return this['_shadowMap']['_shadowMapTexture']||this[_0x11cec2(_0x198e92._0x4025cb)];},'shadowMap_matrix':()=>{const _0x46aa1a=_0x34c675;return this[_0x46aa1a(0x103f)]['_shadowMapMatrix'];},'shadowMap_lightPositionEC':()=>{return this['_shadowMap']['_lightPositionEC'];},'shadowMap_texelSizeDepthBias':()=>{const _0x4d547b=_0x34c675;return _0x56a6e1['x']=0x1/this['_shadowMap'][_0x4d547b(0x3c1)]['x'],_0x56a6e1['y']=0x1/this['_shadowMap']['_textureSize']['y'],Cesium__namespace['Cartesian4']['fromElements'](_0x56a6e1['x'],_0x56a6e1['y'],_0x5b5e39[_0x4d547b(_0x197ba3._0x2174d3)],_0x5b5e39['normalShadingSmooth'],_0x2267f7);},'shadowMap_normalOffsetScale':()=>{const _0x171c45=_0x34c675;return Cesium__namespace[_0x171c45(_0x55b4b7._0x534e01)]['fromElements'](_0x5b5e39[_0x171c45(0xfa1)],this['_shadowMap']['_distance'],this['_shadowMap']['maximumDistance'],this['_shadowMap'][_0x171c45(_0x55b4b7._0x28ac10)],_0x259119);},'mars3d_flipx':()=>{return this['style']['flipx'];},'mars3d_flipy':()=>{const _0x364ec8=_0x34c675;return this['style'][_0x364ec8(0x9dd)];}}}),this[_0x34c675(_0x514ec2._0x50a4e8)][_0x34c675(_0x514ec2._0x4377f1)][_0x34c675(0xaa4)]['add'](this['_postProcessStage']);}}register$4('video3D',Video3D,!![]);let globeLastRoam;class Route extends BasePointPrimitive{constructor(_0x12a3c0={}){const _0x2f1231={_0x104a1b:0xee8,_0x4a6f52:0xabe,_0x242524:0x807,_0x372a49:0x433,_0x167761:0x1019},_0x445514=_0x3d5d32;super(_0x12a3c0),this['options']['frameRate']=this[_0x445514(0x433)]['frameRate']??0x1,this['_maxCacheCount']=this['options']['maxCacheCount']??0x64,this['_clampToTilesetFrame']=-0x1,this[_0x445514(0xb19)]=this['options'][_0x445514(_0x2f1231._0x104a1b)]??0x1e,this['_zhStyle'](this['options']['style']),this['_child']={},this['_position_result']=new Cesium__namespace['Cartesian3'](),this['property']=this['options']['position']||new Cesium__namespace['SampledPositionProperty'](this['options'][_0x445514(0x366)],this['options']['numberOfDerivatives']),this[_0x445514(_0x2f1231._0x4a6f52)]['forwardExtrapolationType']=this['options']['forwardExtrapolationType']??Cesium__namespace['ExtrapolationType'][_0x445514(_0x2f1231._0x242524)],this['property'][_0x445514(0x1019)]=this[_0x445514(_0x2f1231._0x372a49)][_0x445514(_0x2f1231._0x167761)]??Cesium__namespace[_0x445514(0xaa6)]['HOLD'],this['_orientation']=this['options']['orientation']||new Cesium__namespace['VelocityOrientationProperty'](this['property']),this['_readyPromise']=Cesium__namespace['defer']();}get[_0x3d5d32(0x32a)](){const _0x3ba78a=_0x3d5d32;return this[_0x3ba78a(0xa74)]['label'];}set['label'](_0x572d4c){const _0xd73119=_0x3d5d32;this['options']['label']=_0x572d4c,this[_0xd73119(0x7a3)](_0xd73119(0x32a),LabelPrimitive);}get[_0x3d5d32(0x4a5)](){return this['_child']['billboard'];}set['billboard'](_0x5c722d){this['options']['billboard']=_0x5c722d,this['_initChildGraphic']('billboard',BillboardPrimitive);}get[_0x3d5d32(0xbbe)](){return this['_child']['point'];}set['point'](_0x59ccd5){const _0x31262c=_0x3d5d32;this['options'][_0x31262c(0xbbe)]=_0x59ccd5,this[_0x31262c(0x7a3)](_0x31262c(0xbbe),PointPrimitive);}get['model'](){const _0x4a3dfe=_0x3d5d32;return this[_0x4a3dfe(0xa74)]['model'];}set['model'](_0x4dac38){const _0x1d7a4e=_0x3d5d32;this[_0x1d7a4e(0x433)]['model']=_0x4dac38,this['_initChildGraphic']('model',ModelPrimitive);}get[_0x3d5d32(0xccd)](){const _0x5d8d12=_0x3d5d32;return this['_readyPromise'][_0x5d8d12(0xab8)];}get['circle'](){const _0x5f4f35=_0x3d5d32;return this[_0x5f4f35(0xa74)][_0x5f4f35(0x654)];}set['circle'](_0x5a63f2){const _0x5105c0={_0x4d5998:0x7a3},_0x3fd131=_0x3d5d32;this[_0x3fd131(0x433)]['circle']=_0x5a63f2,this[_0x3fd131(_0x5105c0._0x4d5998)](_0x3fd131(0x654),CircleEntity);}get['coneTrack'](){return this['_child']['coneTrack'];}set['coneTrack'](_0x996473){const _0x15e0e5=_0x3d5d32;this[_0x15e0e5(0x433)]['coneTrack']=_0x996473,this['_initChildGraphic'](_0x15e0e5(0x6f7),ConeTrack);}get[_0x3d5d32(0x4f5)](){return this['_child']['path'];}set[_0x3d5d32(0x4f5)](_0x10357d){const _0x17b06e={_0x3d1c14:0x7a3},_0x16aed6=_0x3d5d32;this['options']['path']=_0x10357d,this[_0x16aed6(_0x17b06e._0x3d1c14)]('path',PathEntity);}get['polyline'](){const _0x474e87={_0x3f34af:0x96e},_0x316f2e=_0x3d5d32;return this['_child'][_0x316f2e(_0x474e87._0x3f34af)];}set['polyline'](_0x188b5a){this['options']['polyline']=_0x188b5a,this['_initChildGraphic']('polyline',PolylineEntity);}get['wall'](){return this['_child']['wall'];}set['wall'](_0x44e01b){const _0x2df79f=_0x3d5d32;this['options']['wall']=_0x44e01b,this[_0x2df79f(0x7a3)](_0x2df79f(0x65f),WallEntity);}get['modelMatrix'](){return this['_modelMatrix']?this['_modelMatrix']:this['_getModelMatrix'](this['_position'],this['_orientation_show']);}get[_0x3d5d32(0x69d)](){return getRayEarthPosition(this['_position'],this['_orientation_show']);}get[_0x3d5d32(0xd29)](){const _0x2f82bf={_0x2cdbf0:0x3cd},_0x50fc2b=_0x3d5d32;if(this['_clampToTilesetHeight'])return this[_0x50fc2b(_0x2f82bf._0x2cdbf0)];if(this['_position']){const _0x93cb4e=Cesium__namespace['Cartographic']['fromCartesian'](this['_position']);return _0x93cb4e['height'];}return 0x0;}get[_0x3d5d32(0xee6)](){var _0x49a7c0,_0x93121d;const _0x1f3766=(_0x49a7c0=this['property'])===null||_0x49a7c0===void 0x0?void 0x0:(_0x93121d=_0x49a7c0['_property'])===null||_0x93121d===void 0x0?void 0x0:_0x93121d['_times'];return _0x1f3766['length']>0x0?_0x1f3766[0x0]:null;}get['stopTime'](){const _0x405c58=_0x3d5d32;var _0x4c3144,_0x1abcf3;const _0x2fdfbd=(_0x4c3144=this[_0x405c58(0xabe)])===null||_0x4c3144===void 0x0?void 0x0:(_0x1abcf3=_0x4c3144['_property'])===null||_0x1abcf3===void 0x0?void 0x0:_0x1abcf3[_0x405c58(0xb15)];return _0x2fdfbd['length']>0x0?_0x2fdfbd[_0x2fdfbd[_0x405c58(0xc84)]-0x1]:null;}get['currIndex'](){const _0x465c6e=_0x3d5d32;return this[_0x465c6e(0xeb6)];}get['multiplier'](){const _0x587f2b={_0x32f909:0xe09},_0x491033=_0x3d5d32;var _0x4d92c4;return(_0x4d92c4=this['_map'])===null||_0x4d92c4===void 0x0?void 0x0:_0x4d92c4['clock'][_0x491033(_0x587f2b._0x32f909)];}set['multiplier'](_0x2dc5d9){const _0x4fc215={_0xf76d3:0x1d1},_0x59f3cd=_0x3d5d32;this['_map']&&(this[_0x59f3cd(_0x4fc215._0xf76d3)]['clock']['multiplier']=_0x2dc5d9);}get['isPause'](){const _0x5aa26d=_0x3d5d32;var _0x516962;return!((_0x516962=this['_map'])!==null&&_0x516962!==void 0x0&&_0x516962['clock'][_0x5aa26d(0x4e7)]);}set[_0x3d5d32(0x849)](_0x47c04d){const _0x2a3704={_0x1a9ff2:0x285},_0x54bab4=_0x3d5d32;this['_map']&&(_0x47c04d?this[_0x54bab4(_0x2a3704._0x1a9ff2)]():this['proceed']());}get['objectsToExclude'](){const _0x490304={_0x13e17a:0xc77,_0x5b16f2:0xc77,_0x30e28a:0xb6b},_0x543225=_0x3d5d32;if(this['options'][_0x543225(_0x490304._0x13e17a)])return this['options'][_0x543225(_0x490304._0x5b16f2)];if(this[_0x543225(_0x490304._0x30e28a)])return this['_objectsToExclude'];const _0x5e22e7=[];this['eachChildGraphic'](_0x2f9bb7=>{_0x2f9bb7['czmObject']&&_0x5e22e7['push'](_0x2f9bb7['czmObject']);});if(_0x5e22e7['length']>0x0)return _0x5e22e7;return undefined;}set[_0x3d5d32(0xc77)](_0x429cc6){this['_objectsToExclude']=_0x429cc6;}get['style'](){const _0xd67a40={_0x237cea:0x91a},_0xd7ac4=_0x3d5d32,_0x220653=getAttrVal(this['options'],{'onlySimpleType':!![]});return this['_splitOptionsToStyle'](_0x220653,'model'),this['_splitOptionsToStyle'](_0x220653,'label'),this['_splitOptionsToStyle'](_0x220653,'billboard'),this[_0xd7ac4(0x91a)](_0x220653,'point'),this['_splitOptionsToStyle'](_0x220653,'circle'),this[_0xd7ac4(_0xd67a40._0x237cea)](_0x220653,'coneTrack'),this[_0xd7ac4(0x91a)](_0x220653,'polyline'),this['_splitOptionsToStyle'](_0x220653,'wall'),this['_splitOptionsToStyle'](_0x220653,'path'),delete _0x220653[_0xd7ac4(0x227)],delete _0x220653[_0xd7ac4(0xdde)],delete _0x220653[_0xd7ac4(0xe12)],_0x220653;}set[_0x3d5d32(0xdde)](_0x29baee){this['setStyle'](_0x29baee);}['setStyle'](_0x3672f9){return _0x3672f9={..._0x3672f9},this['_zhStyle'](_0x3672f9),this['_setOptionsHook'](this['options'],_0x3672f9),this;}['_initSampledPositionProperty'](){const _0x31e6b0=_0x3d5d32;this[_0x31e6b0(0xf72)]=this['property'],this['bindUpdateEvent']();}['_mountedHook'](){const _0xaed4a2={_0x380266:0x32a,_0xb02bbc:0xbbe,_0x1f954f:0x7a3},_0x571d14=_0x3d5d32;this['_initChildGraphic'](_0x571d14(_0xaed4a2._0x380266),LabelPrimitive),this['_initChildGraphic']('billboard',BillboardPrimitive),this['_initChildGraphic'](_0x571d14(_0xaed4a2._0xb02bbc),PointPrimitive),this[_0x571d14(0x7a3)]('model',ModelPrimitive),this[_0x571d14(_0xaed4a2._0x1f954f)]('circle',CircleEntity),this['_initChildGraphic']('coneTrack',ConeTrack),this['_initChildGraphic']('path',PathEntity),this['_initChildGraphic']('polyline',PolylineEntity),this['_initChildGraphic']('wall',WallEntity);}['_addedHook'](_0xb20696){const _0x287fe4={_0x5291fa:0x433,_0x277cfd:0xbb8,_0x279f41:0xb01},_0x38ee36=_0x3d5d32;var _0x364f1b;if(!this['show'])return;this['_addChildGraphic']();(_0x364f1b=this['model'])!==null&&_0x364f1b!==void 0x0&&_0x364f1b['readyPromise']&&this['model'][_0x38ee36(0xccd)]['then'](()=>{const _0x20ebd4=_0x38ee36;this['_readyPromise'][_0x20ebd4(0xac9)](this);});this['options']['position']&&this['addDynamicPosition'](this['options']['position']);if(this[_0x38ee36(0x433)]['positions'])for(let _0x536f32=0x0;_0x536f32{const _0x3467eb=_0x4132;_0x4be708['show']=_0x4be708['_lastShow'],delete _0x4be708[_0x3467eb(_0x40e445._0x42cb87)];}):this[_0x44987d(0xf65)](_0x2b7e11=>{_0x2b7e11['_lastShow']=_0x2b7e11['show'],_0x2b7e11['show']=![];});}[_0x3d5d32(0xd4c)](_0x15ba34,_0x406ff2){const _0x41b927={_0x1c5c15:0x84d,_0x4c0b78:0x7a3,_0x335bfc:0x654},_0x59ea8b=_0x3d5d32;this[_0x59ea8b(_0x41b927._0x1c5c15)](_0x406ff2[_0x59ea8b(0xdde)]);for(const _0x283e0d in _0x406ff2){switch(_0x283e0d){case'label':this['_initChildGraphic'](_0x59ea8b(0x32a),LabelPrimitive);break;case'billboard':this['_initChildGraphic']('billboard',BillboardPrimitive);break;case'point':this['_initChildGraphic']('point',PointPrimitive);break;case'model':this[_0x59ea8b(_0x41b927._0x4c0b78)]('model',ModelPrimitive);break;case'circle':this['_initChildGraphic'](_0x59ea8b(_0x41b927._0x335bfc),CircleEntity);break;case _0x59ea8b(0x6f7):this['_initChildGraphic']('coneTrack',ConeTrack);break;case'path':this['_initChildGraphic']('path',PathEntity);break;case'polyline':this[_0x59ea8b(0x7a3)]('polyline',PolylineEntity);break;case'wall':this[_0x59ea8b(0x7a3)]('wall',WallEntity);break;}}}['_splitOptionsToStyle'](_0x26b897,_0x3db1cb){const _0x3f14d8=_0x26b897[_0x3db1cb];if(_0x3f14d8){delete _0x26b897[_0x3db1cb];for(const _0x584df2 in _0x3f14d8){_0x26b897[_0x3db1cb+'_'+_0x584df2]=_0x3f14d8[_0x584df2];}}}[_0x3d5d32(0xbec)](_0x17bb28,_0x4cf0ca){const _0x3cb5d8=_0x4cf0ca+'_';for(const _0x5c2051 in _0x17bb28){const _0xa0383e=_0x17bb28[_0x5c2051];_0x5c2051['startsWith'](_0x3cb5d8)&&(!_0x17bb28[_0x4cf0ca]&&(_0x17bb28[_0x4cf0ca]={}),_0x17bb28[_0x4cf0ca][_0x5c2051['substring'](_0x3cb5d8['length'])]=_0xa0383e,delete _0x17bb28[_0x5c2051]);}}['_zhStyle'](_0x41be89){const _0x540a92={_0x18bde1:0xbec,_0x440fe8:0x4f5},_0x2dc805=_0x3d5d32;if(!_0x41be89||Object[_0x2dc805(0xabc)](_0x41be89)[_0x2dc805(0xc84)]===0x0)return;this['_mergeStyleToOptions'](_0x41be89,'model'),this[_0x2dc805(0xbec)](_0x41be89,'label'),this['_mergeStyleToOptions'](_0x41be89,_0x2dc805(0x4a5)),this['_mergeStyleToOptions'](_0x41be89,'point'),this['_mergeStyleToOptions'](_0x41be89,'circle'),this['_mergeStyleToOptions'](_0x41be89,'coneTrack'),this[_0x2dc805(_0x540a92._0x18bde1)](_0x41be89,_0x2dc805(0x96e)),this['_mergeStyleToOptions'](_0x41be89,'wall'),this['_mergeStyleToOptions'](_0x41be89,_0x2dc805(_0x540a92._0x440fe8));for(const _0x49aa4d in _0x41be89){const _0x57299a=_0x41be89[_0x49aa4d];switch(_0x49aa4d){default:{isObject(_0x57299a)?this['options'][_0x49aa4d]=merge(this['options'][_0x49aa4d],_0x57299a):this['options'][_0x49aa4d]=_0x57299a;break;}}}}['_initChildGraphic'](_0x12bf00,_0x415f07){const _0x1f3ac4={_0x59a62d:0xf06,_0x4d203e:0xa74,_0x47b777:0x792,_0x4116b3:0xabe,_0x89b14e:0xc6d,_0x148f31:0x96e,_0x574ea5:0xbb8,_0xa65f1b:0x65f,_0x31a9fb:0xdde},_0x5ae3a2={_0x425903:0xef0},_0x393b42={_0x3091c9:0x87d},_0x530f1e={_0x48cb95:0x87d},_0x296676=_0x3d5d32,_0xbda9e8=this['options'][_0x12bf00];let _0xdf4b88=this['_child'][_0x12bf00];if(!_0xbda9e8){_0xdf4b88&&(_0xdf4b88[_0x296676(_0x1f3ac4._0x59a62d)](!![]),delete this[_0x296676(_0x1f3ac4._0x4d203e)][_0x12bf00]);return;}if(_0xdf4b88)_0xdf4b88['setStyle'](_0xbda9e8),_0xdf4b88['show']=_0xbda9e8[_0x296676(_0x1f3ac4._0x47b777)]??!![];else{_0xdf4b88=new _0x415f07({'id':this['id']+'-'+_0x12bf00,'style':clone(_0xbda9e8,['show']),'private':!![],'eventParent':this,'show':_0xbda9e8['show']??!![]}),_0xdf4b88['removeEventParent'](this['_layer']),_0xdf4b88['addEventParent'](this);this['isAdded']&&this['_layer']['addGraphic'](_0xdf4b88);_0xdf4b88['czmObject']&&this['bindPickId'](_0xdf4b88['czmObject']);_0xdf4b88[_0x296676(0xc51)]&&_0xdf4b88['czmObjectEx']['forEach'](_0x28ffa7=>{this['bindPickId'](_0x28ffa7);});this['_child'][_0x12bf00]=_0xdf4b88;switch(_0x12bf00){case'billboard':{!_0xbda9e8['alignedAxis']&&(this['_child']['billboard'][_0x296676(0xdde)]['alignedAxis']=new Cesium__namespace['VelocityVectorProperty'](this[_0x296676(_0x1f3ac4._0x4116b3)],!![]));break;}case'circle':{this[_0x296676(_0x1f3ac4._0x4d203e)]['circle'][_0x296676(0xb69)]=new Cesium__namespace['CallbackProperty'](_0x571ef3=>{const _0x38c417=_0x296676;return this[_0x38c417(_0x530f1e._0x48cb95)];},![]);break;}case'coneTrack':{this[_0x296676(0xa74)]['coneTrack']['position']=new Cesium__namespace[(_0x296676(_0x1f3ac4._0x89b14e))](_0x74eefe=>{const _0x3193e3=_0x296676;return this[_0x3193e3(_0x393b42._0x3091c9)];},![]);break;}case'path':{this['_child'][_0x296676(0x4f5)][_0x296676(0xb69)]=this['property'];break;}case'polyline':{this['_polyline_positions']=[],this['_child'][_0x296676(_0x1f3ac4._0x148f31)][_0x296676(_0x1f3ac4._0x574ea5)]=new Cesium__namespace['CallbackProperty'](_0x3fda71=>{const _0x2f4879=_0x296676;return this[_0x2f4879(_0x5ae3a2._0x425903)];},![]);break;}case _0x296676(_0x1f3ac4._0xa65f1b):{this['_wall_positions']=[],this['_child']['wall']['positions']=new Cesium__namespace[(_0x296676(0xc6d))](_0x96683b=>{return this['_wall_positions'];},![]),this['_wall_minimumHeights']=[],this['_child']['wall'][_0x296676(_0x1f3ac4._0x31a9fb)][_0x296676(0x53c)]=new Cesium__namespace[(_0x296676(0xc6d))](_0xa6d08a=>{return this['_wall_minimumHeights'];},![]),this['_wall_maximumHeights']=[],this['_child']['wall'][_0x296676(0xdde)]['maximumHeights']=new Cesium__namespace[(_0x296676(_0x1f3ac4._0x89b14e))](_0x4cc65b=>{return this['_wall_maximumHeights'];},![]),this['_child']['wall'][_0x296676(0x938)]={};break;}}}}['_addChildGraphic'](){const _0xd30a58={_0x4ec9ca:0x873,_0x309d9c:0x682,_0x58837d:0xd2e};this['eachChildGraphic'](_0x201f85=>{const _0x51158f=_0x4132;this[_0x51158f(_0xd30a58._0x4ec9ca)][_0x51158f(_0xd30a58._0x309d9c)](_0x201f85),_0x201f85[_0x51158f(_0xd30a58._0x58837d)]&&this['bindPickId'](_0x201f85['czmObject']),_0x201f85['czmObjectEx']&&_0x201f85['czmObjectEx']['forEach'](_0x151a89=>{const _0x4ea786=_0x51158f;this[_0x4ea786(0xc6f)](_0x151a89);});});}['_removeChildGraphic'](){this['eachChildGraphic'](_0x323964=>{const _0x4968cd=_0x4132;this['_layer'][_0x4968cd(0x358)](_0x323964);});}['eachChildGraphic'](_0x47dffa,_0x5a2086){const _0x33c1da={_0x4b8203:0x1061},_0xbde3e0=_0x3d5d32;if(!this[_0xbde3e0(0xa74)])return;return Object['keys'](this[_0xbde3e0(0xa74)])[_0xbde3e0(_0x33c1da._0x4b8203)]((_0x4d5619,_0x9cf3ed)=>{_0x47dffa&&_0x47dffa['call'](_0x5a2086||this,this['_child'][_0x4d5619],_0x9cf3ed);}),this;}['update'](_0x307a17){const _0x683253={_0xff9661:0xd7e,_0x1214db:0x94e,_0x220b17:0xabe,_0x5b5001:0x1d8,_0x2fab40:0x366,_0x3a6d85:0x87d,_0x429eac:0x873,_0x4fbfc6:0xb84,_0x3580c8:0x433,_0x1f305f:0x433,_0x5aa5cf:0x3cd,_0x3e8a34:0xe95,_0x40382c:0x7d1,_0x5b6214:0xd81,_0x89ee0f:0x8de},_0x3b894a=_0x3d5d32;if(!this['show'])return;this['_position']=this['getPropertyValue'](_0x307a17['time'],this[_0x3b894a(_0x683253._0xff9661)]);if(!this[_0x3b894a(0x87d)]){this[_0x3b894a(0x7bd)]?this['_updatePosition']():(this[_0x3b894a(0x3df)](),this[_0x3b894a(_0x683253._0x1214db)](),this['_last_hasNull']=!![]);return;}this[_0x3b894a(0x7bd)]=![];this[_0x3b894a(_0x683253._0x220b17)]['referenceFrame']===Cesium__namespace['ReferenceFrame']['INERTIAL']&&(this[_0x3b894a(_0x683253._0x5b5001)]=this['_position']['clone'](),Cesium__namespace['PositionProperty']['convertToReferenceFrame'](_0x307a17['time'],this[_0x3b894a(0x87d)],this[_0x3b894a(_0x683253._0x220b17)][_0x3b894a(_0x683253._0x2fab40)],Cesium__namespace['ReferenceFrame']['FIXED'],this[_0x3b894a(_0x683253._0x3a6d85)]));if(this['options']['clampToTileset']){this['_clampToTilesetFrame']++;if(!this['_clampToTilesetHeight']||this['_clampToTilesetFrame']%this['_frameRateHeight']===0x0){let _0x474f4c=getHeight(this['_map']['scene'],this['_position'],{'objectsToExclude':this[_0x3b894a(_0x683253._0x429eac)]['objectsToExclude'],'has3dtiles':!![]});_0x474f4c&&(Cesium__namespace[_0x3b894a(_0x683253._0x4fbfc6)](this[_0x3b894a(_0x683253._0x3580c8)]['minHeight'])&&_0x474f4cthis[_0x3b894a(_0x683253._0x1f305f)]['maxHeight']&&(_0x474f4c=this[_0x3b894a(0x433)]['maxHeight']),this[_0x3b894a(_0x683253._0x5aa5cf)]=_0x474f4c);}if(this['_clampToTilesetHeight']){const _0x27c5a1=Cesium__namespace['Cartographic'][_0x3b894a(0xd14)](this['_position']);this[_0x3b894a(0x87d)]=Cesium__namespace[_0x3b894a(_0x683253._0x3e8a34)][_0x3b894a(_0x683253._0x40382c)](_0x27c5a1[_0x3b894a(0xbfd)],_0x27c5a1['latitude'],this['_clampToTilesetHeight']);}}this[_0x3b894a(_0x683253._0x5b6214)]=this[_0x3b894a(_0x683253._0x89ee0f)]['getValue'](_0x307a17[_0x3b894a(0x5d6)]),this['_updatePosition'](),this['_updateCamera'](),this['_updateForEvent']();}['_updatePosition'](){const _0x3ca3df={_0x5c1f87:0x792,_0x5cc4c0:0x87d,_0xfe2ce9:0x600,_0x37da1f:0x4bf,_0x8e92d8:0xa74,_0x277980:0xbc6,_0x202764:0x65e,_0x1a8262:0x87d,_0x511d09:0x433,_0x12be27:0x96e,_0x54ecf2:0x822,_0x5158f2:0xeb6,_0x3aa66:0x87d,_0x5d90af:0x230,_0x1b6a5c:0xef0,_0x1004f1:0xb96,_0x2f6cfa:0x65f,_0x6f1f97:0x230,_0x398df0:0xc84,_0x235dff:0x1d1,_0x1f85e1:0xfc1,_0x469db6:0xb75,_0x38b0b1:0x645},_0x444fd6=_0x3d5d32;var _0x34ca96,_0x5caa53,_0x4798af,_0x19d725,_0x2fb15d,_0x26541a,_0xfc1c05;(_0x34ca96=this['_child']['label'])!==null&&_0x34ca96!==void 0x0&&_0x34ca96['show']&&(this['_child']['label']['position']=this['_position']);(_0x5caa53=this[_0x444fd6(0xa74)][_0x444fd6(0x4a5)])!==null&&_0x5caa53!==void 0x0&&_0x5caa53[_0x444fd6(_0x3ca3df._0x5c1f87)]&&(this['_child']['billboard']['position']=this[_0x444fd6(_0x3ca3df._0x5cc4c0)]);(_0x4798af=this['_child']['point'])!==null&&_0x4798af!==void 0x0&&_0x4798af[_0x444fd6(0x792)]&&(this['_child'][_0x444fd6(0xbbe)]['position']=this[_0x444fd6(0x87d)]);if((_0x19d725=this['_child'][_0x444fd6(_0x3ca3df._0xfe2ce9)])!==null&&_0x19d725!==void 0x0&&_0x19d725['show']){var _0x3d9252;this[_0x444fd6(0x545)]=this[_0x444fd6(0xa74)]['model'][_0x444fd6(_0x3ca3df._0x37da1f)](this['_position'],this['_orientation_show']),this['_heading_reality']=this['_child']['model']['_heading_reality'],this['_pitch_reality']=this[_0x444fd6(_0x3ca3df._0x8e92d8)]['model'][_0x444fd6(_0x3ca3df._0x277980)],this[_0x444fd6(_0x3ca3df._0x202764)]=this['_child'][_0x444fd6(_0x3ca3df._0xfe2ce9)]['_roll_reality'],(_0x3d9252=this['_child']['model'])!==null&&_0x3d9252!==void 0x0&&_0x3d9252['_primitive']&&(this['_child']['model'][_0x444fd6(0x517)]['modelMatrix']=this['_modelMatrix']),this['_child']['model'][_0x444fd6(_0x3ca3df._0x1a8262)]=this['_position'];}let _0x187049=![];if((_0x2fb15d=this['_child'][_0x444fd6(0x96e)])!==null&&_0x2fb15d!==void 0x0&&_0x2fb15d['show']&&!((_0x26541a=this[_0x444fd6(_0x3ca3df._0x511d09)][_0x444fd6(_0x3ca3df._0x12be27)])!==null&&_0x26541a!==void 0x0&&_0x26541a['showAll'])){const _0x446578=this['property'][_0x444fd6(0x5f7)][_0x444fd6(_0x3ca3df._0x54ecf2)]['slice'](0x0,this[_0x444fd6(_0x3ca3df._0x5158f2)]*0x3);if(this[_0x444fd6(0xeb6)]>0x0){let _0x3e202c=Cesium__namespace['Cartesian3']['unpackArray'](_0x446578);this[_0x444fd6(0x87d)]&&_0x3e202c['push'](this[_0x444fd6(_0x3ca3df._0x3aa66)]),this[_0x444fd6(_0x3ca3df._0x511d09)]['polyline']['maxDistance']&&(_0x3e202c=sliceByMaxDistance(_0x3e202c,this['options']['polyline']['maxDistance']),this[_0x444fd6(0x230)]>0x0&&(this['_maxCacheCount']=Math[_0x444fd6(0xe8e)](this[_0x444fd6(_0x3ca3df._0x5d90af)],_0x3e202c['length']*0x2))),this['_polyline_positions']=_0x3e202c,_0x187049=!![];}else this[_0x444fd6(_0x3ca3df._0x1b6a5c)]=[];}if((_0xfc1c05=this['_child'][_0x444fd6(0x65f)])!==null&&_0xfc1c05!==void 0x0&&_0xfc1c05['show']){const _0x13eb1b=this['property'][_0x444fd6(0x5f7)]['_values']['slice'](0x0,this['_flyok_index']*0x3);if(this[_0x444fd6(0xeb6)]>0x0){if(!_0x187049){let _0x18c66f=Cesium__namespace['Cartesian3'][_0x444fd6(_0x3ca3df._0x1004f1)](_0x13eb1b);this['_position']&&_0x18c66f['push'](this[_0x444fd6(0x87d)]),this['options'][_0x444fd6(_0x3ca3df._0x2f6cfa)]['maxDistance']&&(_0x18c66f=sliceByMaxDistance(_0x18c66f,this['options']['wall']['maxDistance']),this[_0x444fd6(_0x3ca3df._0x6f1f97)]>0x0&&(this['_maxCacheCount']=Math['max'](this[_0x444fd6(0x230)],_0x18c66f[_0x444fd6(_0x3ca3df._0x398df0)]*0x2))),this['_polyline_positions']=_0x18c66f;}const _0x5d015d=[],_0x1d7817=[],_0x2cc5b1=this[_0x444fd6(0xef0)];for(let _0x55dbd1=0x0;_0x55dbd1<_0x2cc5b1['length'];_0x55dbd1++){const _0x27b037=_0x2cc5b1[_0x55dbd1],_0x1cdc2f=Cesium__namespace['Cartographic']['fromCartesian'](_0x27b037);_0x1d7817[_0x444fd6(0xb75)](_0x1cdc2f[_0x444fd6(0x83e)]);if(this[_0x444fd6(0x433)]['wall'][_0x444fd6(0x59c)]){var _0x32f8ce;_0x2cc5b1[_0x55dbd1]['hbgd']=_0x2cc5b1[_0x55dbd1]['hbgd']??getHeight((_0x32f8ce=this[_0x444fd6(_0x3ca3df._0x235dff)])===null||_0x32f8ce===void 0x0?void 0x0:_0x32f8ce[_0x444fd6(_0x3ca3df._0x1f85e1)],_0x27b037,{'has3dtiles':![]}),_0x5d015d[_0x444fd6(_0x3ca3df._0x469db6)](_0x2cc5b1[_0x55dbd1][_0x444fd6(_0x3ca3df._0x38b0b1)]);}else _0x5d015d[_0x444fd6(_0x3ca3df._0x469db6)](0x0);}this['_wall_positions']=_0x2cc5b1,this['_wall_minimumHeights']=_0x5d015d,this['_wall_maximumHeights']=_0x1d7817;}else this['_wall_positions']=[],this['_wall_minimumHeights']=[],this['_wall_maximumHeights']=[];}}['_updateCamera'](){const _0xf00d4e={_0x525bc4:0x433,_0x5b69d3:0x629,_0x43a1d7:0x435,_0xcd068e:0xd32,_0x58a4ee:0x435,_0x2b2add:0x435,_0x1f9d70:0x98d,_0x19243e:0xf5e,_0x41367d:0x1d1},_0xfca685=_0x3d5d32;if(!this[_0xfca685(_0xf00d4e._0x525bc4)]['camera'])return;switch(this[_0xfca685(_0xf00d4e._0x525bc4)]['camera']['type']){case'gs':{const _0x3d37c8=this['trackedEntity'];this[_0xfca685(0x1d1)]['clock']['shouldAnimate']&&this['_map']['trackedEntity']!==_0x3d37c8&&(this[_0xfca685(0x1d1)]['trackedEntity']=_0x3d37c8,_0x3d37c8['_needFlyToPoint']=!![]);_0x3d37c8['_needFlyToPoint']&&!this['_map']['viewer']['_needTrackedEntityUpdate']&&(_0x3d37c8['_needFlyToPoint']=![],this[_0xfca685(_0xf00d4e._0x5b69d3)]({...this['options'][_0xfca685(0x435)],'lock':!![],'duration':0x0}));break;}case'dy':{const _0x8fdf08=this['trackedEntity'];this['_map']['trackedEntity']!==_0x8fdf08&&(this['_map'][_0xfca685(0x98d)]=_0x8fdf08);let _0x149e3c=this['options'][_0xfca685(_0xf00d4e._0x43a1d7)]['followedX']||0x0;const _0x3a951d=this[_0xfca685(_0xf00d4e._0x525bc4)][_0xfca685(0x435)]['followedZ']||0x0;_0x149e3c===0x0&&_0x3a951d===0x0&&(_0x149e3c=0.1);let _0x1695f5;this['options']['camera'][_0xfca685(_0xf00d4e._0xcd068e)]&&(_0x1695f5=_0x1695f5||{},_0x1695f5['x']=this['options'][_0xfca685(_0xf00d4e._0x58a4ee)]['offsetX']);this['options'][_0xfca685(_0xf00d4e._0x58a4ee)]['offsetY']&&(_0x1695f5=_0x1695f5||{},_0x1695f5['y']=this['options'][_0xfca685(_0xf00d4e._0x58a4ee)]['offsetY']);this['options']['camera']['offsetZ']&&(_0x1695f5=_0x1695f5||{},_0x1695f5['z']=this['options'][_0xfca685(_0xf00d4e._0x2b2add)]['offsetZ']);this['_map'][_0xfca685(0xfc1)]['camera']['lookAtTransform'](this['computeModelMatrix'](_0x1695f5),new Cesium__namespace['Cartesian3'](-_0x149e3c,0x0,_0x3a951d));break;}case'sd':{const _0x4f3942=this['trackedEntity'];this['_map'][_0xfca685(_0xf00d4e._0x1f9d70)]!==_0x4f3942&&(this['_map']['trackedEntity']=_0x4f3942);this[_0xfca685(0x1d1)]['scene'][_0xfca685(0x435)][_0xfca685(0xb63)](this[_0xfca685(0xc2a)](),new Cesium__namespace['Cartesian3'](-0x1,0x0,this['options']['camera']['followedZ']));break;}default:{this[_0xfca685(_0xf00d4e._0x19243e)]&&this[_0xfca685(_0xf00d4e._0x41367d)]['trackedEntity']===this['_trackedEntity']&&(this['_map']['trackedEntity']=undefined);break;}}}['computeModelMatrix'](_0x1da042){const _0x20387d={_0xf79d08:0xafb,_0x19d386:0xe95},_0x5ab8ff=_0x3d5d32;!this['_matrix4']&&(this[_0x5ab8ff(_0x20387d._0xf79d08)]=new Cesium__namespace['Matrix4'](),this['_matrix3Scratch']=new Cesium__namespace[(_0x5ab8ff(0x9dc))]());let _0x288ff0=this['_position'];if(!Cesium__namespace['defined'](_0x288ff0)||!this['_orientation_show'])return undefined;if(_0x1da042){const _0x30c767=new Cesium__namespace['HeadingPitchRoll'](this['_heading'],this['_pitch'],this['_roll']);_0x288ff0=getPositionByHprAndOffset(_0x288ff0,new Cesium__namespace[(_0x5ab8ff(_0x20387d._0x19d386))](_0x1da042['x']||0x0,_0x1da042['y']||0x0,_0x1da042['z']||0x0),_0x30c767);}return this['_matrix4']=Cesium__namespace['Matrix4']['fromRotationTranslation'](Cesium__namespace['Matrix3']['fromQuaternion'](this['_orientation_show'],this['_matrix3Scratch']),_0x288ff0,this[_0x5ab8ff(_0x20387d._0xf79d08)]),this['_matrix4'];}[_0x3d5d32(0x94e)](){const _0x3be914={_0x269aee:0x87d,_0x4965a2:0xc81,_0x13cbc6:0xb34},_0x41b6c6=_0x3d5d32,_0x5325e1=this['_flyok_index']??0x0;this['fire'](EventType['change'],{'index':_0x5325e1,'counts':this['_counts'],'position':this[_0x41b6c6(_0x3be914._0x269aee)],'orientation':this['_orientation_show']});if(_0x5325e1!==this['_last_fireIndex']){if(Cesium__namespace['defined'](this['_last_fireIndex'])&&this[_0x41b6c6(0x3d5)]+0x1!==_0x5325e1)while(++this['_last_fireIndex']<_0x5325e1){this['fire'](EventType['endItem'],{'counts':this['_counts'],'index':this[_0x41b6c6(0x3d5)]});}this['fire'](EventType[_0x41b6c6(_0x3be914._0x4965a2)],{'counts':this[_0x41b6c6(0x8cd)],'index':_0x5325e1}),_0x5325e1===this[_0x41b6c6(0x8cd)]&&this['fire'](EventType[_0x41b6c6(_0x3be914._0x13cbc6)]),this['_last_fireIndex']=_0x5325e1;}}['getPropertyValue'](_0xce09fa,_0x2e4caa){const _0x2b1440={_0x49c20c:0xb15,_0x392e:0x8b7,_0x35a07f:0xe97,_0x46140c:0xaa6,_0x53ad1b:0xbd5,_0x29243a:0x807,_0x2e5c19:0xe41,_0x44d385:0xeb6,_0x3efcd0:0xae7,_0x54d47e:0x57f,_0x91d3f0:0x50b,_0x3d1bb9:0xf7a},_0x3da4d6=_0x3d5d32;var _0x8278cd;const _0x2f3c2e=(_0x8278cd=this[_0x3da4d6(0xabe)])===null||_0x8278cd===void 0x0?void 0x0:_0x8278cd['_property'],_0x45f2f8=_0x2f3c2e===null||_0x2f3c2e===void 0x0?void 0x0:_0x2f3c2e[_0x3da4d6(_0x2b1440._0x49c20c)],_0x2dc709=_0x45f2f8[_0x3da4d6(0xc84)];if(_0x2dc709===0x0)return undefined;this['_counts']=_0x2dc709;let _0x4f9cf2;const _0xf0c331=Cesium__namespace[_0x3da4d6(0xe95)],_0x5f0be4=_0x2f3c2e['_values'];this['_flyok_index']=Cesium__namespace['binarySearch'](_0x45f2f8,_0xce09fa,Cesium__namespace[_0x3da4d6(_0x2b1440._0x392e)][_0x3da4d6(_0x2b1440._0x35a07f)]);if(this[_0x3da4d6(0xeb6)]<0x0){this['_flyok_index']=~this['_flyok_index'];if(this['_flyok_index']===0x0){const _0x46e0ad=_0x45f2f8[this['_flyok_index']];_0x4f9cf2=_0x2f3c2e['_backwardExtrapolationDuration'];if(_0x2f3c2e['_backwardExtrapolationType']===Cesium__namespace['ExtrapolationType']['NONE']||_0x4f9cf2!==0x0&&Cesium__namespace['JulianDate']['secondsDifference'](_0x46e0ad,_0xce09fa)>_0x4f9cf2)return undefined;if(_0x2f3c2e['_backwardExtrapolationType']===Cesium__namespace[_0x3da4d6(_0x2b1440._0x46140c)][_0x3da4d6(0x807)])return _0xf0c331['unpack'](_0x5f0be4,0x0,_0x2e4caa);}if(this[_0x3da4d6(0xeb6)]>=_0x2dc709){this['_flyok_index']=_0x2dc709-0x1;const _0x2179d5=_0x45f2f8[this['_flyok_index']];_0x4f9cf2=_0x2f3c2e['_forwardExtrapolationDuration'];if(_0x2f3c2e['_forwardExtrapolationType']===Cesium__namespace['ExtrapolationType']['NONE']||_0x4f9cf2!==0x0&&Cesium__namespace['JulianDate'][_0x3da4d6(_0x2b1440._0x53ad1b)](_0xce09fa,_0x2179d5)>_0x4f9cf2)return undefined;if(_0x2f3c2e['_forwardExtrapolationType']===Cesium__namespace['ExtrapolationType'][_0x3da4d6(_0x2b1440._0x29243a)])return this['_flyok_index']=_0x2dc709-0x1,_0xf0c331[_0x3da4d6(_0x2b1440._0x2e5c19)](_0x5f0be4,this[_0x3da4d6(_0x2b1440._0x44d385)]*_0xf0c331[_0x3da4d6(_0x2b1440._0x3efcd0)],_0x2e4caa);}const _0x3710ea=_0x2f3c2e['_xTable'],_0x49cdca=_0x2f3c2e['_yTable'],_0x33ea0a=_0x2f3c2e[_0x3da4d6(_0x2b1440._0x54d47e)],_0x2d3cca=_0x2f3c2e['_packedInterpolationLength'],_0x55bc6d=_0x2f3c2e[_0x3da4d6(_0x2b1440._0x91d3f0)];if(_0x2f3c2e['_updateTableLength']){_0x2f3c2e['_updateTableLength']=![];const _0x4f4985=Math['min'](_0x33ea0a['getRequiredDataPoints'](_0x2f3c2e['_interpolationDegree'],_0x55bc6d),_0x2dc709);_0x4f4985!==_0x2f3c2e[_0x3da4d6(_0x2b1440._0x3d1bb9)]&&(_0x2f3c2e['_numberOfPoints']=_0x4f4985,_0x3710ea['length']=_0x4f4985,_0x49cdca['length']=_0x4f4985*_0x2d3cca);}const _0x3f8a9e=_0x2f3c2e['_numberOfPoints']-0x1;if(_0x3f8a9e<0x1)return undefined;let _0x28560a=0x0,_0x1c7498=_0x2dc709-0x1;const _0x30e022=_0x1c7498-_0x28560a+0x1;if(_0x30e022>=_0x3f8a9e+0x1){let _0x49f8e9=this['_flyok_index']-(_0x3f8a9e/0x2|0x0)-0x1;_0x49f8e9<_0x28560a&&(_0x49f8e9=_0x28560a);let _0x4565c7=_0x49f8e9+_0x3f8a9e;_0x4565c7>_0x1c7498&&(_0x4565c7=_0x1c7498,_0x49f8e9=_0x4565c7-_0x3f8a9e,_0x49f8e9<_0x28560a&&(_0x49f8e9=_0x28560a)),_0x28560a=_0x49f8e9,_0x1c7498=_0x4565c7;}const _0x5aa5a0=_0x1c7498-_0x28560a+0x1;for(let _0x540be2=0x0;_0x540be2<_0x5aa5a0;++_0x540be2){_0x3710ea[_0x540be2]=Cesium__namespace['JulianDate']['secondsDifference'](_0x45f2f8[_0x28560a+_0x540be2],_0x45f2f8[_0x1c7498]);}if(!Cesium__namespace[_0x3da4d6(0xb84)](_0xf0c331['convertPackedArrayForInterpolation'])){let _0x4d45f7=0x0;const _0x9cb6c7=_0x2f3c2e[_0x3da4d6(0x561)];let _0x3dff05=_0x28560a*_0x9cb6c7;const _0x203476=(_0x1c7498+0x1)*_0x9cb6c7;while(_0x3dff05<_0x203476){_0x49cdca[_0x4d45f7]=_0x5f0be4[_0x3dff05],_0x3dff05++,_0x4d45f7++;}}else _0xf0c331['convertPackedArrayForInterpolation'](_0x5f0be4,_0x28560a,_0x1c7498,_0x49cdca);const _0x4570a1=Cesium__namespace[_0x3da4d6(0x8b7)]['secondsDifference'](_0xce09fa,_0x45f2f8[_0x1c7498]);let _0x401e02;if(_0x55bc6d===0x0||!Cesium__namespace['defined'](_0x33ea0a['interpolate']))_0x401e02=_0x33ea0a['interpolateOrderZero'](_0x4570a1,_0x3710ea,_0x49cdca,_0x2d3cca,_0x2f3c2e['_interpolationResult']);else{const _0x3b9e1c=Math['floor'](_0x2d3cca/(_0x55bc6d+0x1));_0x401e02=_0x33ea0a[_0x3da4d6(0x9e9)](_0x4570a1,_0x3710ea,_0x49cdca,_0x3b9e1c,_0x55bc6d,_0x55bc6d,_0x2f3c2e['_interpolationResult']);}if(!Cesium__namespace['defined'](_0xf0c331['unpackInterpolationResult']))return _0xf0c331['unpack'](_0x401e02,0x0,_0x2e4caa);return _0xf0c331['unpackInterpolationResult'](_0x401e02,_0x5f0be4,_0x28560a,_0x1c7498,_0x2e4caa);}return _0xf0c331[_0x3da4d6(0xe41)](_0x5f0be4,this['_flyok_index']*_0x2f3c2e['_packedLength'],_0x2e4caa);}[_0x3d5d32(0xa55)](){const _0x55a08a={_0x5937f1:0xabe,_0x5d4bc9:0x6ed},_0x21c0aa=_0x3d5d32;var _0x4290fa,_0x2cac28;const _0xff29cf=(_0x4290fa=this[_0x21c0aa(_0x55a08a._0x5937f1)])===null||_0x4290fa===void 0x0?void 0x0:(_0x2cac28=_0x4290fa[_0x21c0aa(0x5f7)])===null||_0x2cac28===void 0x0?void 0x0:_0x2cac28['_times'];if(!_0xff29cf||_0xff29cf['length']===0x0)return;this['property']['removeSamples'](new Cesium__namespace[(_0x21c0aa(_0x55a08a._0x5d4bc9))]({'start':_0xff29cf[0x0],'stop':_0xff29cf[_0xff29cf['length']-0x1]}));}['getRectangle'](_0x326ef1){const _0x5d506f={_0x5dec67:0xabe,_0x1b184d:0xb75,_0x462930:0x4ca},_0x4b5f69=_0x3d5d32;var _0xce2b8c,_0x333674,_0x58c86f,_0x1fe58a;const _0x201465=(_0xce2b8c=this[_0x4b5f69(_0x5d506f._0x5dec67)])===null||_0xce2b8c===void 0x0?void 0x0:(_0x333674=_0xce2b8c['_property'])===null||_0x333674===void 0x0?void 0x0:_0x333674['_times'],_0x53b66e=(_0x58c86f=this['property'])===null||_0x58c86f===void 0x0?void 0x0:(_0x1fe58a=_0x58c86f['_property'])===null||_0x1fe58a===void 0x0?void 0x0:_0x1fe58a['_values'];if(!_0x201465||_0x201465[_0x4b5f69(0xc84)]===0x0)return;const _0x271e9a=[];for(let _0x2e8002=0x0,_0xd0789c=_0x201465[_0x4b5f69(0xc84)];_0x2e8002<_0xd0789c;_0x2e8002++){_0x271e9a[_0x4b5f69(_0x5d506f._0x1b184d)](new Cesium__namespace['Cartesian3'](_0x53b66e[_0x2e8002*0x3],_0x53b66e[_0x2e8002*0x3+0x1],_0x53b66e[_0x2e8002*0x3+0x2]));}const _0x183669=getRectangle(_0x271e9a,_0x326ef1===null||_0x326ef1===void 0x0?void 0x0:_0x326ef1[_0x4b5f69(_0x5d506f._0x462930)]);return _0x183669;}['getCoordinates'](_0x287bc7){const _0x34b977={_0x6d2f4f:0xabe,_0x5e523a:0x5f7,_0x15061a:0xc84,_0x3650bb:0xc84,_0x1b4b9c:0xd14,_0x9d3886:0xe95,_0x54ccf8:0xcdb},_0x3c1c1a=_0x3d5d32;var _0x354266,_0x15340e,_0x573e04,_0x48c57d;const _0x110fa2=(_0x354266=this[_0x3c1c1a(_0x34b977._0x6d2f4f)])===null||_0x354266===void 0x0?void 0x0:(_0x15340e=_0x354266[_0x3c1c1a(0x5f7)])===null||_0x15340e===void 0x0?void 0x0:_0x15340e['_times'],_0x242cc0=(_0x573e04=this['property'])===null||_0x573e04===void 0x0?void 0x0:(_0x48c57d=_0x573e04[_0x3c1c1a(_0x34b977._0x5e523a)])===null||_0x48c57d===void 0x0?void 0x0:_0x48c57d['_values'];if(!_0x110fa2||_0x110fa2[_0x3c1c1a(_0x34b977._0x15061a)]===0x0)return[];const _0x2c8f08=[];for(let _0x3a53f9=0x0,_0x555ab5=_0x110fa2[_0x3c1c1a(_0x34b977._0x3650bb)];_0x3a53f9<_0x555ab5;_0x3a53f9++){const _0x4a3a06=LngLatPoint[_0x3c1c1a(_0x34b977._0x1b4b9c)](new Cesium__namespace[(_0x3c1c1a(_0x34b977._0x9d3886))](_0x242cc0[_0x3a53f9*0x3],_0x242cc0[_0x3a53f9*0x3+0x1],_0x242cc0[_0x3a53f9*0x3+0x2])),_0x5e85ab=_0x4a3a06[_0x3c1c1a(0x4d4)](_0x287bc7);_0x5e85ab['push'](Cesium__namespace['JulianDate']['toDate'](_0x110fa2[_0x3a53f9])[_0x3c1c1a(_0x34b977._0x54ccf8)]()),_0x2c8f08['push'](_0x5e85ab);}return _0x2c8f08;}['flyToPoint'](_0x3593c5={}){const _0x5a56b8={_0x113a21:0xe39,_0x146211:0xa1f,_0x3ca270:0xaea},_0x42ae89=_0x3d5d32;if(!this['_map'])return;const _0x2623f2=this['_position'];if(!_0x2623f2)return;let _0x3c567e;if(Cesium__namespace['defined'](_0x3593c5[_0x42ae89(_0x5a56b8._0x113a21)])){var _0x482f94;_0x3c567e=_0x3593c5['heading']+Cesium__namespace['Math'][_0x42ae89(_0x5a56b8._0x146211)](((_0x482f94=this[_0x42ae89(_0x5a56b8._0x3ca270)])===null||_0x482f94===void 0x0?void 0x0:_0x482f94[_0x42ae89(_0x5a56b8._0x113a21)])||0x0);}this['_map'][_0x42ae89(0x629)](_0x2623f2,{..._0x3593c5,'heading':_0x3c567e});}static['clearLastCamera'](){const _0x90dc64=_0x3d5d32;var _0x29ff29,_0x1fe49c,_0x50f87a;(_0x29ff29=globeLastRoam)!==null&&_0x29ff29!==void 0x0&&(_0x1fe49c=_0x29ff29['options'])!==null&&_0x1fe49c!==void 0x0&&(_0x50f87a=_0x1fe49c['camera'])!==null&&_0x50f87a!==void 0x0&&_0x50f87a['type']&&(globeLastRoam['options']['camera'][_0x90dc64(0x7f5)]=''),globeLastRoam=null;}[_0x3d5d32(0xb5e)](_0x3d69e2){const _0x47a44f={_0x37a2c0:0x433,_0x354403:0x435,_0x1bdd3a:0x7f5,_0x4ecbbf:0xd61},_0x55c382=_0x3d5d32;var _0x287e22;Route['clearLastCamera']();if(this[_0x55c382(_0x47a44f._0x37a2c0)]['camera'])this['options']['camera']=merge(this['options'][_0x55c382(_0x47a44f._0x354403)],_0x3d69e2);else _0x3d69e2?this['options']['camera']=_0x3d69e2:this['options']['camera']={'type':''};((_0x287e22=this['options']['camera'])===null||_0x287e22===void 0x0?void 0x0:_0x287e22['type'])!==''&&(globeLastRoam=this),_0x3d69e2&&_0x3d69e2[_0x55c382(_0x47a44f._0x1bdd3a)]==='gs'&&_0x3d69e2[_0x55c382(_0x47a44f._0x4ecbbf)]&&this['flyToPoint']({..._0x3d69e2,'duration':0x0});}['autoSurfaceHeight'](){const _0x183e67=_0x3d5d32;logWarn(_0x183e67(0xfac));}['pause'](){const _0x93717a={_0x30b63c:0x1d1},_0x145e25=_0x3d5d32;this[_0x145e25(0x1d1)]&&(this['_map']['clock']['shouldAnimate']=![],this[_0x145e25(0xf5e)]&&this['_map']['trackedEntity']===this['_trackedEntity']&&(this[_0x145e25(_0x93717a._0x30b63c)]['trackedEntity']=undefined));}['proceed'](){const _0x209729={_0x51bc31:0x4e7},_0x18347c=_0x3d5d32;this['_map']&&(this['_map']['clock'][_0x18347c(_0x209729._0x51bc31)]=!![]);}[_0x3d5d32(0x909)](){const _0x1f0a10={_0x24e4ec:0xc6d,_0x5404b7:0x95c},_0x172afa=_0x3d5d32;return!this[_0x172afa(0x95c)]&&(this['_popupPosition']=new Cesium__namespace[(_0x172afa(_0x1f0a10._0x24e4ec))](_0x461ee2=>{return this['_position'];},![])),this[_0x172afa(_0x1f0a10._0x5404b7)];}['destroy'](_0x1ebba3){const _0x2e771e=_0x3d5d32;this['eachChildGraphic'](_0x159cfa=>{_0x159cfa['destroy'](_0x1ebba3);}),super[_0x2e771e(0x689)](_0x1ebba3);}}register$4('route',Route);class FixedRoute extends Route{constructor(_0x4c0639={}){const _0x3ee4a6={_0x34e1bc:0xcad},_0x54af4a=_0x3d5d32;super(_0x4c0639),this['options'][_0x54af4a(_0x3ee4a6._0x34e1bc)]=this['options']['showStop']??!![],this['options']['updateClock']=this['options'][_0x54af4a(0xecc)]??!![];}get[_0x3d5d32(0xee6)](){const _0xb8ecef={_0x337991:0x1fd},_0xf0e9fe=_0x3d5d32;return this[_0xf0e9fe(_0xb8ecef._0x337991)];}get['stopTime'](){const _0x12f778=_0x3d5d32;return this[_0x12f778(0x951)];}get['points'](){const _0x12376c={_0x52111f:0x50e},_0x421476=_0x3d5d32;return this[_0x421476(_0x12376c._0x52111f)];}set['points'](_0x3203a6){const _0x5a2c04=_0x3d5d32;this[_0x5a2c04(0xbb8)]=_0x3203a6;}get['positions'](){return this['_points']['map'](_0x549c95=>{return _0x549c95['_position'];});}set['positions'](_0x33f43f){const _0x5ae90b={_0xeb5886:0x433,_0x24b0ca:0xee6,_0x923450:0xee6,_0x4d18dd:0x433,_0x5271a7:0xc1b,_0x31deb1:0x804,_0x2f8975:0xe95,_0x119071:0x87d,_0x1adc3e:0xae6,_0x87b797:0x102d,_0x4f10e3:0x562,_0x121c05:0x8de,_0x2bbace:0xe9f,_0x5abdfe:0xade,_0x4dd973:0x562,_0x4c879b:0xf76,_0x1d6ff0:0x433,_0xdbae44:0x8b7,_0x599956:0xa53,_0xcf655e:0xade,_0x22b425:0xf83,_0x61774:0x50e,_0x4e4677:0x607,_0x36c658:0x433,_0x5644b7:0x433,_0x4ecd6d:0xa74,_0x1be427:0x3e8},_0x2d0230={_0x58a556:0xe95,_0x127566:0x5d8,_0x1eca6f:0xd57,_0x173ace:0xe95},_0x291f84=_0x3d5d32;if(!this['_map']||!_0x33f43f||!Array['isArray'](_0x33f43f)||_0x33f43f['length']===0x0)return;const _0xdaaceb=LngLatArray[_0x291f84(0x4fc)](_0x33f43f);this['clearPosition']();let _0x2a0ceb;if(this[_0x291f84(_0x5ae90b._0xeb5886)][_0x291f84(_0x5ae90b._0x24b0ca)]){if(isString(this['options'][_0x291f84(_0x5ae90b._0x923450)]))this['options']['startTime']['indexOf']('Z')===-0x1?_0x2a0ceb=Cesium__namespace[_0x291f84(0x8b7)]['fromDate'](new Date(this[_0x291f84(_0x5ae90b._0x4d18dd)]['startTime'])):_0x2a0ceb=Cesium__namespace['JulianDate']['fromIso8601'](this['options'][_0x291f84(0xee6)]);else this['options']['startTime']instanceof Date?_0x2a0ceb=Cesium__namespace[_0x291f84(0x8b7)]['fromDate'](this[_0x291f84(_0x5ae90b._0x4d18dd)]['startTime']):_0x2a0ceb=this[_0x291f84(_0x5ae90b._0x4d18dd)]['startTime'];}else{if(this['options'][_0x291f84(0xe9f)]){const _0x18be98=_0xdaaceb[0x0][this['options']['timeField']];_0x2a0ceb=Cesium__namespace['JulianDate'][_0x291f84(_0x5ae90b._0x5271a7)](new Date(_0x18be98));}else _0x2a0ceb=this['_map']['clock']['currentTime'];}const _0x1dd11a=this['options']['speed'],_0x31a01b=_0x1dd11a&&Array['isArray'](_0x1dd11a),_0x282a29=0x64;function _0x48201f(_0x498660,_0x4e8f77){const _0x408786=_0x291f84;if(_0x4e8f77['speed'])return _0x4e8f77[_0x408786(0x85c)];if(_0x4e8f77['_speed'])return _0x4e8f77[_0x408786(0xf83)];if(_0x31a01b)return(_0x1dd11a[_0x498660]||_0x282a29)/3.6;return(_0x1dd11a||_0x282a29)/3.6;}const _0x50a316=this['options'][_0x291f84(_0x5ae90b._0x31deb1)]??0x0;let _0x31ac0a=0x0,_0x11501c=0x0,_0x58efc0,_0x24d2e0;const _0x1f0a49=[];let _0x356d70=![];const _0x523d61=0.001;function _0x2b17f6(_0x436d2e,_0x5177c6){const _0xac11f9=_0x291f84;for(let _0x5bfc35=_0x436d2e-0x1;_0x5bfc35>=0x0;_0x5bfc35--){const _0x2e888b=_0xdaaceb[_0x5bfc35],_0x2780d5=_0x2e888b['_position']||Cesium__namespace[_0xac11f9(_0x2d0230._0x58a556)]['fromDegrees'](_0x2e888b[_0xac11f9(_0x2d0230._0x127566)],_0x2e888b['lat'],_0x2e888b['alt']+_0x50a316);_0x2e888b['_position']=_0x2780d5;const _0x18dcbf=Cesium__namespace['Cartesian3']['distance'](_0x5177c6,_0x2780d5);if(_0x18dcbf!==0x0)return getOnLinePointByLen(_0x2780d5,_0x5177c6,_0x523d61,!![]);}for(let _0x5770ec=_0x436d2e-0x1,_0x4390fb=_0xdaaceb['length'];_0x5770ec<_0x4390fb;_0x5770ec++){const _0x15f0c2=_0xdaaceb[_0x5770ec],_0x227f3d=_0x15f0c2['_position']||Cesium__namespace['Cartesian3']['fromDegrees'](_0x15f0c2['lng'],_0x15f0c2[_0xac11f9(_0x2d0230._0x1eca6f)],_0x15f0c2['alt']+_0x50a316);_0x15f0c2['_position']=_0x227f3d;const _0x383398=Cesium__namespace[_0xac11f9(_0x2d0230._0x173ace)]['distance'](_0x5177c6,_0x227f3d);if(_0x383398!==0x0)return getOnLinePointByLen(_0x5177c6,_0x227f3d,_0x523d61,![]);}return null;}for(let _0xbaeee2=0x0,_0x41c43c=_0xdaaceb['length'];_0xbaeee2<_0x41c43c;_0xbaeee2++){let _0x197249=_0xdaaceb[_0xbaeee2],_0x767133=_0x197249['_position']||Cesium__namespace[_0x291f84(_0x5ae90b._0x2f8975)]['fromDegrees'](_0x197249['lng'],_0x197249['lat'],_0x197249['alt']+_0x50a316);if(_0xbaeee2===0x0){_0x24d2e0=_0x2a0ceb[_0x291f84(0x315)](),this['property']['addSample'](_0x24d2e0,_0x767133),_0x197249[_0x291f84(_0x5ae90b._0x119071)]=_0x767133,_0x197249['_time']=_0x24d2e0,_0x197249['_distance']=_0x11501c,_0x197249['_second']=_0x31ac0a,_0x197249[_0x291f84(0xf83)]=0x0,_0x197249[_0x291f84(_0x5ae90b._0x1adc3e)]=_0xbaeee2,_0x1f0a49['push'](_0x197249);if(Cesium__namespace['defined'](_0x197249[_0x291f84(0xe39)])){this[_0x291f84(0x8de)]=new Cesium__namespace[(_0x291f84(_0x5ae90b._0x87b797))](Cesium__namespace[_0x291f84(0x97b)]),_0x356d70=!![];const _0x188028=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math']['toRadians'](_0x197249['heading']||0x0),Cesium__namespace['Math'][_0x291f84(_0x5ae90b._0x4f10e3)](_0x197249['pitch']||0x0),Cesium__namespace['Math'][_0x291f84(0x562)](_0x197249['roll']||0x0));this[_0x291f84(_0x5ae90b._0x121c05)]['addSample'](_0x24d2e0,Cesium__namespace['Transforms'][_0x291f84(0xed0)](_0x767133,_0x188028));}}else{let _0x471e0d=Cesium__namespace[_0x291f84(_0x5ae90b._0x2f8975)]['distance'](_0x767133,_0x58efc0);if(_0x471e0d===0x0){_0x471e0d=_0x523d61,_0x767133=_0x2b17f6(_0xbaeee2,_0x767133);if(!_0x767133)continue;}let _0x235eab,_0x1bcbe2;if(this['options'][_0x291f84(_0x5ae90b._0x2bbace)]){const _0x159265=new Date(_0x197249[this['options'][_0x291f84(0xe9f)]]),_0x5d013d=Cesium__namespace['JulianDate']['fromDate'](_0x159265);_0x235eab=Cesium__namespace['JulianDate']['secondsDifference'](_0x5d013d,_0x24d2e0)||0.01,_0x24d2e0=_0x5d013d,_0x1bcbe2=_0x471e0d/_0x235eab,_0x31ac0a+=_0x235eab;}else _0x1bcbe2=_0x48201f(_0xbaeee2-0x1,_0x197249),_0x235eab=_0x471e0d/_0x1bcbe2,_0x235eab<0.01&&(_0x235eab=0.01),_0x31ac0a+=_0x235eab,_0x24d2e0=Cesium__namespace['JulianDate']['addSeconds'](_0x2a0ceb,_0x31ac0a,new Cesium__namespace['JulianDate']());_0x11501c+=_0x471e0d,this['property'][_0x291f84(_0x5ae90b._0x5abdfe)](_0x24d2e0,_0x767133);if(_0x356d70){const _0x50548c=new Cesium__namespace['HeadingPitchRoll'](Cesium__namespace['Math']['toRadians'](_0x197249['heading']||0x0),Cesium__namespace['Math'][_0x291f84(_0x5ae90b._0x4dd973)](_0x197249[_0x291f84(0x5cf)]||0x0),Cesium__namespace['Math'][_0x291f84(0x562)](_0x197249['roll']||0x0));this['_orientation']['addSample'](_0x24d2e0,Cesium__namespace['Transforms']['headingPitchRollQuaternion'](_0x767133,_0x50548c));}_0x197249['_position']=_0x767133,_0x197249['_time']=_0x24d2e0,_0x197249[_0x291f84(0x6ac)]=_0x11501c,_0x197249[_0x291f84(_0x5ae90b._0x4c879b)]=_0x31ac0a,_0x197249[_0x291f84(0xf83)]=_0x1bcbe2,_0x197249['_index']=_0xbaeee2,_0x1f0a49['push'](_0x197249);if(this['options']['pauseTime']){const _0x2700c9=_0x2b17f6(_0xbaeee2,_0x767133);if(!_0x2700c9)continue;let _0xf6fc26;typeof this[_0x291f84(0x433)]['pauseTime']==='function'?_0xf6fc26=this[_0x291f84(_0x5ae90b._0x1d6ff0)]['pauseTime'](_0xbaeee2,_0x2700c9):_0xf6fc26=this['options'][_0x291f84(0x92f)],_0xf6fc26>0x0&&(_0x31ac0a+=_0xf6fc26,_0x24d2e0=Cesium__namespace[_0x291f84(_0x5ae90b._0xdbae44)][_0x291f84(_0x5ae90b._0x599956)](_0x2a0ceb,_0x31ac0a,new Cesium__namespace['JulianDate']()),this['property'][_0x291f84(_0x5ae90b._0xcf655e)](_0x24d2e0,_0x2700c9),_0x11501c+=_0x523d61,_0x197249=clone(_0x197249),_0x197249['_position']=_0x2700c9,_0x197249['_time']=_0x24d2e0,_0x197249['_distance']=_0x11501c,_0x197249['_second']=_0x31ac0a,_0x197249[_0x291f84(_0x5ae90b._0x22b425)]=0x0,_0x197249['_index']=_0xbaeee2,_0x1f0a49[_0x291f84(0xb75)](_0x197249));}}_0x58efc0=_0x767133;}this[_0x291f84(_0x5ae90b._0x61774)]=_0x1f0a49,this['_startTime']=_0x2a0ceb,this['_stopTime']=_0x24d2e0['clone'](),this['second_all']=_0x31ac0a,this[_0x291f84(_0x5ae90b._0x4e4677)]=_0x11501c;this['options']['interpolation']&&this['property']['setInterpolationOptions']({'interpolationDegree':this[_0x291f84(_0x5ae90b._0x36c658)][_0x291f84(0x4c7)]??0x2,'interpolationAlgorithm':this[_0x291f84(_0x5ae90b._0x5644b7)]['interpolationAlgorithm']??Cesium__namespace['HermitePolynomialApproximation']});if(this['options']['showStop']){var _0x274e5f,_0x90fe6a;this['backToFirst'](),(_0x274e5f=this['options'])!==null&&_0x274e5f!==void 0x0&&(_0x90fe6a=_0x274e5f['polyline'])!==null&&_0x90fe6a!==void 0x0&&_0x90fe6a['showAll']&&(this[_0x291f84(_0x5ae90b._0x4ecd6d)]['polyline']['positions']=this[_0x291f84(0xbb8)]);}this['fire'](EventType[_0x291f84(_0x5ae90b._0x1be427)],{'position':this['property']});}get['isStart'](){return this['_isStart'];}get['info'](){return this['_timeinfo'];}['_addedHook'](_0xffc7ed){const _0x769238={_0x4f9668:0x4f5,_0x40342c:0x4f5},_0x58f2a9=_0x3d5d32;var _0x39696b,_0x34073f;if(!this['show'])return;this['_addChildGraphic'](),(_0x39696b=this['model'])!==null&&_0x39696b!==void 0x0&&_0x39696b[_0x58f2a9(0xccd)]&&this['model']['readyPromise'][_0x58f2a9(0x44d)](()=>{this['_readyPromise']['resolve'](this);}),this['positions']=this['options']['positions'],this['_polyline_positions']=[],(_0x34073f=this['_child'][_0x58f2a9(_0x769238._0x4f9668)])!==null&&_0x34073f!==void 0x0&&_0x34073f['entity']&&(this['_child'][_0x58f2a9(_0x769238._0x40342c)]['entity']['availability']=undefined);}['_setOptionsHook'](_0x59c003,_0x3acd16){const _0x14ead5={_0xa544a0:0xbb8},_0xff0d4c=_0x3d5d32;for(const _0x2ce24c in _0x3acd16){switch(_0x2ce24c){case'speed':case'startTime':this[_0xff0d4c(_0x14ead5._0xa544a0)]=this[_0xff0d4c(0x433)]['positions'];break;default:super[_0xff0d4c(0xd4c)](_0x59c003,_0x3acd16);break;}}}['start'](){const _0x4f1343={_0xa93de:0x1d1,_0x1fc729:0xbb8,_0x567293:0x600,_0x24599d:0x792,_0x2773c0:0x9f4,_0x3bf865:0x315},_0x3a1740=_0x3d5d32;var _0x2d45d5;if(!this[_0x3a1740(_0x4f1343._0xa93de)]||this['_isStart'])return;if(!Cesium__namespace['defined'](this['_points'])||this[_0x3a1740(0x50e)]['length']===0x0){logError$1('没有坐标数据,漫游路线启动失败',this[_0x3a1740(0x50e)]);return;}this[_0x3a1740(0x7c6)]=!![],this[_0x3a1740(_0x4f1343._0x1fc729)]=this['_points'],(_0x2d45d5=this['_child'][_0x3a1740(_0x4f1343._0x567293)])!==null&&_0x2d45d5!==void 0x0&&_0x2d45d5[_0x3a1740(_0x4f1343._0x24599d)]&&this['options']['updateClock']?(this['_map'][_0x3a1740(_0x4f1343._0x2773c0)]['shouldAnimate']=![],this[_0x3a1740(0x1d1)]['clock']['currentTime']=this['startTime'][_0x3a1740(_0x4f1343._0x3bf865)](),this['_child']['model']['readyPromise'][_0x3a1740(0x44d)](()=>{this['_start']();})):this['_start']();}['_start'](){const _0x190935={_0x47e88c:0x433,_0x50bfdc:0x9f4,_0x755434:0x433,_0x43e296:0x1d1,_0x50f469:0x700,_0x5b300e:0xb87,_0x7347a0:0xb04,_0x4bcce8:0xa74},_0x44ffd6=_0x3d5d32;var _0x567c72;this[_0x44ffd6(_0x190935._0x47e88c)]['updateClock']&&(this['_map'][_0x44ffd6(0x9f4)]['shouldAnimate']=!![],this['_map'][_0x44ffd6(_0x190935._0x50bfdc)]['currentTime']=this['startTime']['clone'](),!this[_0x44ffd6(_0x190935._0x755434)]['clockLoop']&&this[_0x44ffd6(_0x190935._0x755434)]['clockRange']&&(this[_0x44ffd6(0xf40)]=this['_map']['clock']['clockRange'],this['_bak_startTime']=this[_0x44ffd6(_0x190935._0x43e296)]['clock']['startTime'],this['_bak_stopTime']=this['_map']['clock'][_0x44ffd6(0xd39)],this['_map']['clock']['clockRange']=this['options'][_0x44ffd6(_0x190935._0x50f469)]??Cesium__namespace['ClockRange'][_0x44ffd6(_0x190935._0x5b300e)],this['_map']['clock']['startTime']=this['startTime']['clone'](),this[_0x44ffd6(_0x190935._0x43e296)]['clock']['stopTime']=this['stopTime'][_0x44ffd6(0x315)](),this['_map'][_0x44ffd6(_0x190935._0x7347a0)][_0x44ffd6(0x449)]&&this[_0x44ffd6(_0x190935._0x43e296)][_0x44ffd6(_0x190935._0x7347a0)]['timeline'][_0x44ffd6(0x508)](this[_0x44ffd6(0xee6)],this['stopTime'])));if((_0x567c72=this[_0x44ffd6(_0x190935._0x4bcce8)][_0x44ffd6(0x4f5)])!==null&&_0x567c72!==void 0x0&&_0x567c72['entity']){var _0x163a29;let _0x311890=this['_stopTime'];((_0x163a29=this[_0x44ffd6(0xabe)])===null||_0x163a29===void 0x0?void 0x0:_0x163a29[_0x44ffd6(0xa67)])===Cesium__namespace['ExtrapolationType'][_0x44ffd6(0x807)]&&(_0x311890=Cesium__namespace['JulianDate']['addDays'](_0x311890,0x16d,new Cesium__namespace['JulianDate']())),this['_child'][_0x44ffd6(0x4f5)][_0x44ffd6(0x4e0)][_0x44ffd6(0x6fb)]=new Cesium__namespace['TimeIntervalCollection']([new Cesium__namespace['TimeInterval']({'start':this['_startTime'],'stop':_0x311890})]);}this[_0x44ffd6(0xefc)](EventType[_0x44ffd6(0xf6d)]),this['bindUpdateEvent']();}['stop'](){const _0x15df97={_0xb76559:0x7c6,_0x4ed088:0x4f5,_0x3eaba3:0x4e0},_0x2df62f=_0x3d5d32;var _0x9d054a;if(!this[_0x2df62f(_0x15df97._0xb76559)]||!this['_map'])return;this['_map']['trackedEntity']=undefined,this['unbindUpdateEvent'](),this[_0x2df62f(0x433)]['showStop']?this[_0x2df62f(0xf28)]():(this['_position']=undefined,this['_updatePosition']()),this['_polyline_positions']=[],(_0x9d054a=this['_child'][_0x2df62f(_0x15df97._0x4ed088)])!==null&&_0x9d054a!==void 0x0&&_0x9d054a['entity']&&(this['_child']['path'][_0x2df62f(_0x15df97._0x3eaba3)][_0x2df62f(0x6fb)]=undefined),this['_isStart']=![],this[_0x2df62f(0xefc)](EventType[_0x2df62f(0xb34)]),this['fire'](EventType['updatePosition'],{'position':this['_position']});}[_0x3d5d32(0xf28)](){const _0x12899d=_0x3d5d32;this[_0x12899d(0xeb6)]=0x0,this['_position']=this['_points'][0x0]['_position'],this['_orientation_show']=this[_0x12899d(0x8de)][_0x12899d(0xfbe)](this[_0x12899d(0xee6)]),this['_updatePosition'](),this['_updateForEvent'](![]);}[_0x3d5d32(0x2f8)](){const _0x2f73ad={_0x47cfdc:0x433,_0xb55adc:0xa74},_0x2003d1=_0x3d5d32;var _0x3f48c9,_0x185ba7;(_0x3f48c9=this[_0x2003d1(_0x2f73ad._0x47cfdc)])!==null&&_0x3f48c9!==void 0x0&&(_0x185ba7=_0x3f48c9['polyline'])!==null&&_0x185ba7!==void 0x0&&_0x185ba7['showAll']&&(this[_0x2003d1(_0x2f73ad._0xb55adc)]['polyline'][_0x2003d1(0xbb8)]=this['positions']);}['_updateForEvent'](_0x409fdc=!![]){const _0xd6ca24={_0x885cf4:0xeb6,_0x3dd70c:0x50e,_0x409c55:0x87d,_0x3236d4:0xbd7,_0x40b5d1:0xf76,_0x3e8a67:0xf83,_0x1a84af:0xefc,_0x31e4b2:0x50e,_0x1d58df:0x433,_0xb773d1:0xee6,_0x2ce20a:0x834,_0x50fb7a:0xa53,_0x1c7bf8:0x4e0,_0x522de4:0x6f1,_0x5bb121:0x1fd,_0x4f5fec:0x433,_0x3ef01d:0xa67},_0x9bf905=_0x3d5d32;if(!this['_points'])return;const _0x5f3b4b=this[_0x9bf905(_0xd6ca24._0x885cf4)],_0x3c9eef=this['_points'][this[_0x9bf905(_0xd6ca24._0x3dd70c)]['length']-0x1],_0x570eaf=this[_0x9bf905(0x50e)][Math['max'](_0x5f3b4b-0x1,0x0)];if(!_0x570eaf)return;const _0x243594=LngLatPoint['fromCartesian'](this[_0x9bf905(_0xd6ca24._0x409c55)]);let _0x3096a4=_0x570eaf['_distance']+(this['_position']?Cesium__namespace['Cartesian3'][_0x9bf905(_0xd6ca24._0x3236d4)](this['_position'],_0x570eaf['_position']):0x0);_0x3096a4>_0x3c9eef['_distance']&&(_0x3096a4=_0x3c9eef['_distance']);let _0x2c7623=0x0;_0x5f3b4b>0x0&&(_0x2c7623=Cesium__namespace['JulianDate']['secondsDifference'](this['_map']['clock']['currentTime'],this['startTime']),_0x2c7623>_0x3c9eef[_0x9bf905(_0xd6ca24._0x40b5d1)]&&(_0x2c7623=_0x3c9eef[_0x9bf905(_0xd6ca24._0x40b5d1)]));this['_timeinfo']={'index':_0x5f3b4b,'counts':this['_counts']??this[_0x9bf905(0x50e)]['length'],'point':_0x243594,'position':this['_position'],'orientation':this['_orientation_show'],'second':_0x2c7623,'second_all':_0x3c9eef['_second'],'distance':_0x3096a4,'distance_all':_0x3c9eef['_distance'],'speed':_0x570eaf[_0x9bf905(_0xd6ca24._0x3e8a67)]};if(!_0x409fdc)return;this[_0x9bf905(_0xd6ca24._0x1a84af)](EventType['change'],this[_0x9bf905(0x875)]);if(_0x5f3b4b!==this['_last_fireIndex']){if(Cesium__namespace['defined'](this['_last_fireIndex'])&&this['_last_fireIndex']+0x1!==_0x5f3b4b)while(++this['_last_fireIndex']<_0x5f3b4b){this['fire'](EventType['endItem'],{'counts':this['_counts'],'index':this['_last_fireIndex'],'point':this[_0x9bf905(_0xd6ca24._0x31e4b2)][this['_last_fireIndex']]});}this[_0x9bf905(0xefc)](EventType['endItem'],{'counts':this['_counts'],'index':_0x5f3b4b,'point':this['_points'][_0x5f3b4b]}),_0x5f3b4b===this['_counts']&&this[_0x9bf905(_0xd6ca24._0x1a84af)](EventType['end']),this['_last_fireIndex']=_0x5f3b4b;}if(_0x2c7623>=_0x3c9eef['_second']){var _0x10c404;if(this[_0x9bf905(_0xd6ca24._0x1d58df)]['clockLoop']&&!this['options'][_0x9bf905(0x700)]){var _0x2aeb2e;this['unbindUpdateEvent']();if(this['options']['startTime'])delete this['options'][_0x9bf905(_0xd6ca24._0xb773d1)];else{if(this['options']['timeField']){const _0x29ba70=this[_0x9bf905(0x50e)][0x0][this['options']['timeField']],_0x4d5f79=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x29ba70)),_0x2693f8=Cesium__namespace['JulianDate']['secondsDifference'](this['_map']['clock']['currentTime'],_0x4d5f79);for(let _0x4f3612=0x0;_0x4f3612{const _0x21de26={_0x35955d:0xf83,_0x44d0a:0xd29},_0x1975b3=_0x4e9452,_0x2b59b3=[];_0x19f520['forEach'](_0x50b1f4=>{_0x2b59b3['push'](_0x50b1f4['_position']);}),computeStepSurfaceLine({'objectsToExclude':this[_0x1975b3(_0x1aa03d._0x97f198)]['objectsToExclude'],..._0x2360e8,'exact':!![],'scene':this[_0x1975b3(_0x1aa03d._0x1c3f0e)]['scene'],'positions':_0x2b59b3,'endItem':(_0x1a1354,_0x2cf463,_0x51dcd6)=>{const _0x2a6d75=_0x1975b3;var _0x56853f,_0x4f80b3;if(!this['_map'])return;const _0x51fbc9=_0x19f520[_0x51dcd6];if(_0x2cf463)_0x3225bc['push'](_0x51fbc9);else for(let _0xb7c9eb=0x0;_0xb7c9eb<_0x1a1354['length'];_0xb7c9eb++){const _0x5e0ac6=LngLatPoint['fromCartesian'](_0x1a1354[_0xb7c9eb]);_0x5e0ac6['_speed']=_0x51fbc9[_0x2a6d75(_0x21de26._0x35955d)],_0x3225bc['push'](_0x5e0ac6);}const _0x2b5ead=((_0x56853f=_0x19f520[_0x51dcd6])===null||_0x56853f===void 0x0?void 0x0:_0x56853f[_0x2a6d75(_0x21de26._0x44d0a)])||0x0,_0x3654a1=((_0x4f80b3=_0x19f520[_0x51dcd6+0x1])===null||_0x4f80b3===void 0x0?void 0x0:_0x4f80b3['alt'])||0x0,_0x309ba0=(_0x3654a1-_0x2b5ead)/_0x1a1354['length'];for(let _0x4b3e7b=0x0;_0x4b3e7b<_0x1a1354[_0x2a6d75(0xc84)];_0x4b3e7b++){_0x4b3e7b!==0x0&&(_0x15f431+=Cesium__namespace[_0x2a6d75(0xe95)]['distance'](_0x1a1354[_0x4b3e7b],_0x1a1354[_0x4b3e7b-0x1]));_0x8b8bb4['push'](Number(_0x15f431['toFixed'](0x1)));const _0x260186=LngLatPoint['fromCartesian'](_0x1a1354[_0x4b3e7b]);_0x89ead0['push'](_0x260186);const _0x46cc35=_0x2cf463?0x0:_0x260186[_0x2a6d75(0xd29)];_0xa6ab59['push'](_0x46cc35);const _0x8c9d4e=Number((_0x2b5ead+_0x309ba0*_0x4b3e7b)['toFixed'](0x1));_0x2b420d['push'](_0x8c9d4e);}},'end':()=>{if(!this['_map'])return;this['_terrainHeight']={'arrLength':_0x8b8bb4,'arrFxgd':_0x2b420d,'arrHbgd':_0xa6ab59,'arrPoint':_0x89ead0},this['positions']=_0x3225bc,_0x3682a3(_0x3225bc);}});});}['clampToGround'](_0x8056f2){return this['autoSurfaceHeight'](_0x8056f2);}['getTerrainHeight'](_0x50942d={}){const _0x17df72={_0x152b0a:0xfc1},_0x2733f0={_0x177693:0xb75,_0x3596c4:0x719},_0x2197b7=this['_points'];return new Promise((_0x4bcf20,_0x538971)=>{const _0x1c178d=_0x4132;if(this['_terrainHeight']){_0x4bcf20(this['_terrainHeight']);return;}this['_getTerrainHeight_ing']=!![];let _0x5555bf=0x0;const _0x2567b5=[],_0x337577=[],_0x4fd258=[],_0x10efff=[];computeStepSurfaceLine({'objectsToExclude':this[_0x1c178d(0x873)]['objectsToExclude'],..._0x50942d,'exact':!![],'scene':this['_map'][_0x1c178d(_0x17df72._0x152b0a)],'positions':_0x2197b7,'endItem':(_0xd4b37,_0x5500f5,_0x2ab470)=>{const _0x45dd80=_0x1c178d,_0x6fdbcc=_0x2197b7[_0x2ab470]['alt'],_0x6bb9b8=_0x2197b7[_0x2ab470+0x1]['alt'],_0xbf47=(_0x6bb9b8-_0x6fdbcc)/_0xd4b37['length'];for(let _0x31fe9b=0x0;_0x31fe9b<_0xd4b37['length'];_0x31fe9b++){_0x31fe9b!==0x0&&(_0x5555bf+=Cesium__namespace['Cartesian3']['distance'](_0xd4b37[_0x31fe9b],_0xd4b37[_0x31fe9b-0x1]));_0x2567b5[_0x45dd80(_0x2733f0._0x177693)](Number(_0x5555bf[_0x45dd80(_0x2733f0._0x3596c4)](0x1)));const _0x39962e=LngLatPoint['fromCartesian'](_0xd4b37[_0x31fe9b]);_0x10efff[_0x45dd80(0xb75)](_0x39962e);const _0x236300=_0x5500f5?0x0:_0x39962e['alt'];_0x337577['push'](_0x236300);const _0x16a451=Number((_0x6fdbcc+_0xbf47*_0x31fe9b)['toFixed'](0x1));_0x4fd258[_0x45dd80(0xb75)](_0x16a451);}},'end':()=>{this['_getTerrainHeight_ing']=![],this['_terrainHeight']={'arrLength':_0x2567b5,'arrFxgd':_0x4fd258,'arrHbgd':_0x337577,'arrPoint':_0x10efff},_0x4bcf20(this['_terrainHeight']);}});});}}register$4('fixedRoute',FixedRoute);var index$6={'__proto__':null,'BaseGraphic':BaseGraphic,'BaseEntity':BaseEntity,'BasePointEntity':BasePointEntity,'BasePolyEntity':BasePolyEntity,'BasePrimitive':BasePrimitive,'BasePointPrimitive':BasePointPrimitive,'BasePolyPrimitive':BasePolyPrimitive,'PointEntity':PointEntity,'BillboardEntity':BillboardEntity,'FontBillboardEntity':FontBillboardEntity,'DivBillboardEntity':DivBillboardEntity,'LabelEntity':LabelEntity,'CanvasLabelEntity':CanvasLabelEntity,'ModelEntity':ModelEntity,'BoxEntity':BoxEntity,'PlaneEntity':PlaneEntity,'CircleEntity':CircleEntity,'CylinderEntity':CylinderEntity,'ConeTrack':ConeTrack,'EllipsoidEntity':EllipsoidEntity,'PolylineEntity':PolylineEntity,'CurveEntity':CurveEntity,'PolylineVolumeEntity':PolylineVolumeEntity,'PathEntity':PathEntity,'CorridorEntity':CorridorEntity,'WallEntity':WallEntity,'RectangleEntity':RectangleEntity,'PolygonEntity':PolygonEntity,'EllipseEntity':EllipseEntity,'RectangularSensor':RectangularSensor,'Video2D':Video2D,'PitEntity':PitEntity,'AttackArrow':AttackArrow,'AttackArrowPW':AttackArrowPW,'AttackArrowYW':AttackArrowYW,'CloseVurve':CloseVurve,'DoubleArrow':DoubleArrow,'FineArrow':FineArrow,'FineArrowYW':FineArrowYW,'GatheringPlace':GatheringPlace,'IsosTriangle':IsosTriangle,'Lune':Lune,'Regular':Regular,'Sector':Sector,'StraightArrow':StraightArrow,'PointMeasure':PointMeasure,'DistanceMeasure':DistanceMeasure,'DistanceSurfaceMeasure':DistanceSurfaceMeasure,'SectionMeasure':SectionMeasure,'AngleMeasure':AngleMeasure,'HeightMeasure':HeightMeasure,'HeightTriangleMeasure':HeightTriangleMeasure,'AreaMeasure':AreaMeasure,'AreaSurfaceMeasure':AreaSurfaceMeasure,'VolumeMeasure':VolumeMeasure,'VolumeDepthMeasure':VolumeDepthMeasure,'PointPrimitive':PointPrimitive,'BillboardPrimitive':BillboardPrimitive,'CloudPrimitive':CloudPrimitive,'LabelPrimitive':LabelPrimitive,'ModelPrimitive':ModelPrimitive,'CirclePrimitive':CirclePrimitive,'PlanePrimitive':PlanePrimitive,'BoxPrimitive':BoxPrimitive,'CylinderPrimitive':CylinderPrimitive,'ConeTrackPrimitive':ConeTrackPrimitive,'EllipsoidPrimitive':EllipsoidPrimitive,'PolylinePrimitive':PolylinePrimitive,'WallPrimitive':WallPrimitive,'CorridorPrimitive':CorridorPrimitive,'PolylineVolumePrimitive':PolylineVolumePrimitive,'RectanglePrimitive':RectanglePrimitive,'PolygonPrimitive':PolygonPrimitive,'FrustumPrimitive':FrustumPrimitive,'LightCone':LightCone,'Water':Water,'DiffuseWall':DiffuseWall,'ScrollWall':ScrollWall,'ThickWall':ThickWall,'DynamicRiver':DynamicRiver,'Road':Road,'Pit':Pit,'DoubleSidedPlane':DoubleSidedPlane,'ReflectionWater':ReflectionWater,'VideoPrimitive':VideoPrimitive,'BaseCombine':BaseCombine,'FlatBillboard':FlatBillboard,'PlaneCombine':PlaneCombine,'BoxCombine':BoxCombine,'CircleCombine':CircleCombine,'CylinderCombine':CylinderCombine,'FrustumCombine':FrustumCombine,'EllipsoidCombine':EllipsoidCombine,'PolylineCombine':PolylineCombine,'PolylineVolumeCombine':PolylineVolumeCombine,'CorridorCombine':CorridorCombine,'WallCombine':WallCombine,'PolygonCombine':PolygonCombine,'WaterCombine':WaterCombine,'RectangleCombine':RectangleCombine,'DivGraphic':DivGraphic,'DivBoderLabel':DivBoderLabel,'DivLightPoint':DivLightPoint,'DivUpLabel':DivUpLabel,'Popup':Popup,'Tooltip':Tooltip,'ParticleSystem':ParticleSystem,'ArcFrustum':ArcFrustum,'Tetrahedron':Tetrahedron,'ViewShed':ViewShed,'Video3D':Video3D,'Route':Route,'FixedRoute':FixedRoute};class XyzImageryProvider$1 extends Cesium__namespace['UrlTemplateImageryProvider']{constructor(_0x153ae8={}){const _0xf85da2={_0x259ab1:0x778,_0x61d9d7:0x433},_0x2f75a4={_0x229c19:0x555},_0x756781=_0x3d5d32;_0x153ae8['customTags']=_0x153ae8['customTags']||{},_0x153ae8[_0x756781(0xa95)]['host']=function(_0x554714,_0x4e33f3,_0x5068b7,_0x22c9da){const _0x5e11df=_0x756781;return location[_0x5e11df(_0x2f75a4._0x229c19)];},_0x153ae8['customTags'][_0x756781(0x248)]=function(_0x53231b,_0xbe3787,_0x52e7af,_0x549c08){return location['hostname'];},_0x153ae8['customTags'][_0x756781(_0xf85da2._0x259ab1)]=function(_0x103397,_0x2aea57,_0x282f4e,_0x22f22a){return _0x22f22a+0x1;},super(_0x153ae8),this[_0x756781(_0xf85da2._0x61d9d7)]=_0x153ae8;}}class TdtImageryProvider extends Cesium__namespace[_0x3d5d32(0xa1b)]{constructor(_0x18d2d7={}){const _0x18c6e5={_0x190577:0x86c,_0x5bd44b:0x533,_0x4ad459:0x6c1,_0x184703:0xfd8,_0x226dad:0xdfc,_0x5693c2:0x980,_0x2db50d:0xe3e,_0x44eb4a:0x9fc,_0x4ba4e8:0x222,_0x5d9ab8:0x222,_0x3a28dd:0x9fc,_0x5d2c6e:0x9da,_0x328261:0xbb6,_0x2ca87e:0x3fc,_0x47e7fc:0x9da,_0x4d01b1:0xa7c,_0x3c89aa:0x54f,_0x5d2038:0x433},_0x5ee4ea=_0x3d5d32;let _0xcc41d1,_0x5eba12=0x12;switch(_0x18d2d7['layer']){case _0x5ee4ea(0xaba):_0xcc41d1='vec';break;case'vec_z':_0xcc41d1=_0x5ee4ea(_0x18c6e5._0x190577);break;case _0x5ee4ea(_0x18c6e5._0x5bd44b):_0xcc41d1='eva';break;case'img_d':_0xcc41d1='img';break;case _0x5ee4ea(0x978):_0xcc41d1='cia';break;case'img_e':_0xcc41d1=_0x5ee4ea(_0x18c6e5._0x4ad459);break;case'ter_d':_0xcc41d1=_0x5ee4ea(0x1d6),_0x5eba12=0xe;break;case'ter_z':_0xcc41d1=_0x5ee4ea(_0x18c6e5._0x184703),_0x5eba12=0xe;break;default:_0xcc41d1=_0x5ee4ea(0xbda);break;}(_0x18d2d7['key']==null||_0x18d2d7['key']['length']===0x0)&&(_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x226dad)]=tiandituArr);const _0x1051ca=getArrayRandomOne(_0x18d2d7['key']);let _0x2b4457;!_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x5693c2)]||_0x18d2d7['crs']===CRS[_0x5ee4ea(_0x18c6e5._0x2db50d)]?(_0x2b4457=_0x5ee4ea(_0x18c6e5._0x44eb4a)+_0xcc41d1+'_w/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer='+_0xcc41d1+_0x5ee4ea(0x74b)+_0x1051ca,(_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x4ba4e8)]||_0x18d2d7['headers']||_0x18d2d7[_0x5ee4ea(0xa1a)])&&(_0x2b4457=getUrlResource({'url':_0x2b4457['replace']('{s}','0'),'proxy':_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x5d9ab8)],'headers':_0x18d2d7['headers'],'queryParameters':_0x18d2d7[_0x5ee4ea(0xa1a)]})),_0x18d2d7={'subdomains':['0','1','2','3','4','5','6','7'],'maximumLevel':_0x18d2d7['maximumLevel']??_0x5eba12,..._0x18d2d7,'url':_0x2b4457,'layer':_0xcc41d1,'style':'default','format':'tiles','tileMatrixSetID':'w','tileMatrixLabels':[...Array(0x14)['keys']()]['map'](_0x220f2f=>_0x220f2f[_0x5ee4ea(0x4c9)]()),'tilingScheme':new Cesium__namespace['WebMercatorTilingScheme']()}):(_0x2b4457=_0x5ee4ea(_0x18c6e5._0x3a28dd)+_0xcc41d1+'_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer='+_0xcc41d1+'&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk='+_0x1051ca,_0x5eba12=0x11,(_0x18d2d7[_0x5ee4ea(0x222)]||_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x5d2c6e)]||_0x18d2d7[_0x5ee4ea(0xa1a)])&&(_0x2b4457=getUrlResource({'url':_0x2b4457[_0x5ee4ea(_0x18c6e5._0x328261)](_0x5ee4ea(_0x18c6e5._0x2ca87e),'0'),'proxy':_0x18d2d7['proxy'],'headers':_0x18d2d7[_0x5ee4ea(_0x18c6e5._0x47e7fc)],'queryParameters':_0x18d2d7['queryParameters']})),_0x18d2d7={'subdomains':['0','1','2','3','4','5','6','7'],'maximumLevel':_0x18d2d7['maximumLevel']??_0x5eba12,..._0x18d2d7,'url':_0x2b4457,'layer':_0xcc41d1,'style':_0x5ee4ea(_0x18c6e5._0x4d01b1),'format':'tiles','tileMatrixSetID':'c','tileMatrixLabels':[...Array(0x14)['keys']()]['map'](_0x1e3837=>(_0x1e3837+0x1)['toString']()),'tilingScheme':new Cesium__namespace[(_0x5ee4ea(_0x18c6e5._0x3c89aa))]()}),super(_0x18d2d7),this[_0x5ee4ea(_0x18c6e5._0x5d2038)]=_0x18d2d7;}}class GaodeImageryProvider extends XyzImageryProvider$1{constructor(_0x5be6e8={}){const _0x487850={_0x5a7da3:0x3ba,_0x27f821:0x3fc},_0x313e5d=_0x3d5d32;let _0x571b57;switch(_0x5be6e8['layer']){case'vec':_0x571b57='https://'+(_0x5be6e8[_0x313e5d(0xd2b)]?'wprd':'webrd')+'0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}';break;case'img_d':_0x571b57=_0x313e5d(_0x487850._0x5a7da3);break;case'img_z':_0x571b57='https://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8';break;case'time':{const _0x273a35=new Date()['getTime']();_0x571b57='https://tm.amap.com/trafficengine/mapabc/traffictile?v=1.0&t=1&x={x}&y={y}&z={z}&&t='+_0x273a35;break;}default:_0x571b57=_0x5be6e8['url'];break;}(_0x5be6e8[_0x313e5d(0x222)]||_0x5be6e8[_0x313e5d(0x9da)]||_0x5be6e8['queryParameters'])&&(_0x571b57=getUrlResource({'url':_0x571b57['replace'](_0x313e5d(_0x487850._0x27f821),'1'),'proxy':_0x5be6e8['proxy'],'headers':_0x5be6e8['headers'],'queryParameters':_0x5be6e8[_0x313e5d(0xa1a)]})),super({'subdomains':['1','2','3','4'],'maximumLevel':0x12,..._0x5be6e8,'url':_0x571b57});}}const EARTH_RADIUS=6370996.81,MC_BAND=[12890594.86,8362377.87,0x554fed,3481989.83,1678043.12,0x0],LL_BAND=[0x4b,0x3c,0x2d,0x1e,0xf,0x0],MC2LL=[[1.410526172116255e-8,0.00000898305509648872,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-0.03801003308653,17337981.2],[-7.435856389565537e-9,0.000008983055097726239,-0.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,0.00000898305509983578,0.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,0.32710905363475,6856817.37],[-1.981981304930552e-8,0.000008983055099779535,0.03278182852591,40.31678527705744,0.65659298677277,-4.44255534477492,0.85341911805263,0.12923347998204,-0.04625736007561,4482777.06],[3.09191371068437e-9,0.000008983055096812155,0.00006995724062,23.10934304144901,-0.00023663490511,-0.6321817810242,-0.00663494467273,0.03430082397953,-0.00466043876332,2555164.4],[2.890871144776878e-9,0.000008983055095805407,-3.068298e-8,7.47137025468032,-0.00000353937994,-0.02145144861037,-0.00001234426596,0.00010322952773,-0.00000323890364,826088.5]],LL2MC=[[-0.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[0.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[0.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[0.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-0.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-0.0003218135878613132,111320.7020701615,0.00369383431289,823725.6402795718,0.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,0.37238884252424,7.45]];class BaiduMercatorProjection{constructor(){this['isWgs84']=![];}[_0x3d5d32(0xadb)](_0x3acd48,_0x4e4c22){const _0x212afb={_0xfa86b2:0x562,_0x4f712c:0xd34},_0x24b471=_0x3d5d32;if(!_0x3acd48||!_0x4e4c22)return 0x0;_0x3acd48=this['convertMC2LL'](_0x3acd48);if(!_0x3acd48)return 0x0;const _0x194704=this[_0x24b471(0x562)](_0x3acd48['lng']),_0x37c46c=this[_0x24b471(_0x212afb._0xfa86b2)](_0x3acd48[_0x24b471(0xd57)]);_0x4e4c22=this[_0x24b471(0x914)](_0x4e4c22);if(!_0x4e4c22)return 0x0;const _0xeabbba=this[_0x24b471(0x562)](_0x4e4c22['lng']),_0x183398=this[_0x24b471(_0x212afb._0xfa86b2)](_0x4e4c22['lat']);return this[_0x24b471(_0x212afb._0x4f712c)](_0x194704,_0xeabbba,_0x37c46c,_0x183398);}['getDistanceByLL'](_0x15ac0c,_0x1a978e){const _0x5c4914={_0x21bd66:0xa2f,_0x478016:0xd57,_0x39e1fe:0x562},_0x48b429=_0x3d5d32;if(!_0x15ac0c||!_0x1a978e)return 0x0;_0x15ac0c['lng']=this[_0x48b429(_0x5c4914._0x21bd66)](_0x15ac0c['lng'],-0xb4,0xb4),_0x15ac0c[_0x48b429(0xd57)]=this['getRange'](_0x15ac0c['lat'],-0x4a,0x4a),_0x1a978e['lng']=this['getLoop'](_0x1a978e['lng'],-0xb4,0xb4),_0x1a978e['lat']=this[_0x48b429(0x1f0)](_0x1a978e[_0x48b429(_0x5c4914._0x478016)],-0x4a,0x4a);const _0x58d264=this[_0x48b429(_0x5c4914._0x39e1fe)](_0x15ac0c[_0x48b429(0x5d8)]),_0x3988a1=this['toRadians'](_0x15ac0c['lat']),_0x41edcb=this['toRadians'](_0x1a978e['lng']),_0xda95ae=this[_0x48b429(0x562)](_0x1a978e[_0x48b429(_0x5c4914._0x478016)]);return this['getDistance'](_0x58d264,_0x41edcb,_0x3988a1,_0xda95ae);}[_0x3d5d32(0x914)](_0x469450){const _0x3cf280={_0x3a777f:0x5d8,_0x4d74bc:0x719},_0xda4be7=_0x3d5d32;if(!_0x469450)return{'lng':0x0,'lat':0x0};let _0x540ea6={};if(this['isWgs84']){_0x540ea6[_0xda4be7(0x5d8)]=_0x469450['lng']/20037508.34*0xb4;const _0x583dbe=_0x469450['lat']/20037508.34*0xb4;return _0x540ea6['lat']=0xb4/Math['PI']*(0x2*Math[_0xda4be7(0x106c)](Math['exp'](_0x583dbe*Math['PI']/0xb4))-Math['PI']/0x2),{'lng':_0x540ea6[_0xda4be7(_0x3cf280._0x3a777f)]['toFixed'](0x6),'lat':_0x540ea6['lat'][_0xda4be7(0x719)](0x6)};}const _0x5cc438={'lng':Math['abs'](_0x469450['lng']),'lat':Math['abs'](_0x469450['lat'])};let _0x126a19;for(let _0x5bf013=0x0;_0x5bf013=MC_BAND[_0x5bf013]){_0x126a19=MC2LL[_0x5bf013];break;}}return _0x540ea6=this['convertor'](_0x469450,_0x126a19),{'lng':_0x540ea6[_0xda4be7(_0x3cf280._0x3a777f)]['toFixed'](0x6),'lat':_0x540ea6['lat'][_0xda4be7(_0x3cf280._0x4d74bc)](0x6)};}['convertLL2MC'](_0x1d39e8){const _0x52027a={_0x2fd008:0xd57,_0x2ffe9d:0x5d8,_0x2aba5e:0xd57},_0x2e92a2=_0x3d5d32;if(!_0x1d39e8)return{'lng':0x0,'lat':0x0};if(_0x1d39e8['lng']>0xb4||_0x1d39e8['lng']<-0xb4||_0x1d39e8[_0x2e92a2(_0x52027a._0x2fd008)]>0x5a||_0x1d39e8['lat']<-0x5a)return _0x1d39e8;if(this['isWgs84']){const _0x1ceb7c={},_0x1d0d0d=0x615299;_0x1ceb7c['lng']=_0x1d39e8['lng']*Math['PI']/0xb4*_0x1d0d0d;const _0x171a51=_0x1d39e8['lat']*Math['PI']/0xb4;return _0x1ceb7c['lat']=_0x1d0d0d/0x2*Math['log']((0x1+Math['sin'](_0x171a51))/(0x1-Math['sin'](_0x171a51))),{'lng':parseFloat(_0x1ceb7c['lng']['toFixed'](0x2)),'lat':parseFloat(_0x1ceb7c['lat']['toFixed'](0x2))};}_0x1d39e8['lng']=this[_0x2e92a2(0xa2f)](_0x1d39e8[_0x2e92a2(_0x52027a._0x2ffe9d)],-0xb4,0xb4),_0x1d39e8[_0x2e92a2(0xd57)]=this['getRange'](_0x1d39e8[_0x2e92a2(_0x52027a._0x2aba5e)],-0x4a,0x4a);const _0x4330f6={'lng':_0x1d39e8['lng'],'lat':_0x1d39e8['lat']};let _0x1474d9;for(let _0x523bf7=0x0;_0x523bf7=LL_BAND[_0x523bf7]){_0x1474d9=LL2MC[_0x523bf7];break;}}if(!_0x1474d9)for(let _0x5e5af2=0x0;_0x5e5af2_0x257663){_0x38cbf1-=_0x257663-_0x27816b;}while(_0x38cbf1<_0x27816b){_0x38cbf1+=_0x257663-_0x27816b;}return _0x38cbf1;}['lngLatToMercator'](_0x8789f4){const _0x447df4=_0x3d5d32;return this[_0x447df4(0xe87)](_0x8789f4);}['lngLatToPoint'](_0x47b39f){const _0xc61394={_0x251946:0x5d8},_0x106384=_0x3d5d32,_0x35bfa3=this['convertLL2MC'](_0x47b39f);return{'x':_0x35bfa3[_0x106384(_0xc61394._0x251946)],'y':_0x35bfa3['lat']};}['mercatorToLngLat'](_0x3079a6){const _0x3decda=_0x3d5d32;return this[_0x3decda(0x914)](_0x3079a6);}[_0x3d5d32(0xf89)](_0x16a7b3){const _0x944cd3={_0x16c81c:0x914},_0x2614a2=_0x3d5d32,_0xbae354={'lng':_0x16a7b3['x'],'lat':_0x16a7b3['y']};return this[_0x2614a2(_0x944cd3._0x16c81c)](_0xbae354);}[_0x3d5d32(0x593)](_0x1943a3,_0xe06ffc,_0xbe24f2,_0x28beb5){const _0x2e255d={_0x1580e9:0x5d8},_0x4e0a40=_0x3d5d32;if(!_0x1943a3)return{'x':0x0,'y':0x0};_0x1943a3=this['lngLatToMercator'](_0x1943a3);const _0x28d7bb=this[_0x4e0a40(0x78d)](_0xe06ffc),_0x42d857=Math['round']((_0x1943a3[_0x4e0a40(_0x2e255d._0x1580e9)]-_0xbe24f2[_0x4e0a40(_0x2e255d._0x1580e9)])/_0x28d7bb+_0x28beb5['width']/0x2),_0x55942e=Math['round']((_0xbe24f2['lat']-_0x1943a3['lat'])/_0x28d7bb+_0x28beb5[_0x4e0a40(0x83e)]/0x2);return{'x':_0x42d857,'y':_0x55942e};}[_0x3d5d32(0xee5)](_0x27ad5e,_0x1b59fb,_0x158b55,_0x309094){const _0x5ac034={_0x1eed15:0x83e,_0x542fe3:0x442},_0x298200=_0x3d5d32;if(!_0x27ad5e)return{'lng':0x0,'lat':0x0};const _0x2e2efb=this['getZoomUnits'](_0x1b59fb),_0x2bea4a=_0x158b55['lng']+_0x2e2efb*(_0x27ad5e['x']-_0x309094['width']/0x2),_0x24cdca=_0x158b55[_0x298200(0xd57)]-_0x2e2efb*(_0x27ad5e['y']-_0x309094[_0x298200(_0x5ac034._0x1eed15)]/0x2),_0x4d0fa3={'lng':_0x2bea4a,'lat':_0x24cdca};return this[_0x298200(_0x5ac034._0x542fe3)](_0x4d0fa3);}['getZoomUnits'](_0x10f3f5){const _0x435085={_0x528229:0x1fb},_0x1ec22a=_0x3d5d32;return Math[_0x1ec22a(_0x435085._0x528229)](0x2,0x12-_0x10f3f5);}}class BaiduMercatorTilingScheme extends Cesium__namespace['WebMercatorTilingScheme']{constructor(_0x3e6c49){const _0x52f603={_0x4b6fc5:0xfd3,_0x35d42a:0xdee,_0x1e3964:0xfab,_0x1a6e19:0x6d7,_0x14c9d3:0xdd8},_0x1a5b2c={_0x287214:0x103e},_0x1aa4bd={_0x286022:0x103e},_0x818394=_0x3d5d32;super(_0x3e6c49);const _0x1a943f=_0x3e6c49[_0x818394(_0x52f603._0x4b6fc5)]||ChinaCRS[_0x818394(_0x52f603._0x35d42a)],_0x2dfc0c=ChinaCRS['BAIDU'],_0x22bf15=getTransFun(_0x1a943f,_0x2dfc0c),_0x23a4d9=getTransFun(_0x2dfc0c,_0x1a943f),_0x3745c5=new BaiduMercatorProjection();this[_0x818394(_0x52f603._0x1e3964)][_0x818394(_0x52f603._0x1a6e19)]=function(_0x4970c0,_0x33b34c){const _0x182ffa=_0x818394;return _0x33b34c=[Cesium__namespace[_0x182ffa(_0x1aa4bd._0x286022)]['toDegrees'](_0x4970c0['longitude']),Cesium__namespace[_0x182ffa(_0x1aa4bd._0x286022)][_0x182ffa(0xa1f)](_0x4970c0['latitude'])],_0x22bf15&&(_0x33b34c=_0x22bf15(_0x33b34c)),_0x33b34c[0x0]=Math['min'](_0x33b34c[0x0],0xb4),_0x33b34c[0x0]=Math['max'](_0x33b34c[0x0],-0xb4),_0x33b34c[0x1]=Math[_0x182ffa(0x90c)](_0x33b34c[0x1],85.05112877980659),_0x33b34c[0x1]=Math[_0x182ffa(0xe8e)](_0x33b34c[0x1],-85.05112877980659),_0x33b34c=_0x3745c5['lngLatToPoint']({'lng':_0x33b34c[0x0],'lat':_0x33b34c[0x1]}),new Cesium__namespace['Cartesian2'](_0x33b34c['x'],_0x33b34c['y']);},this['_projection'][_0x818394(0x7b8)]=function(_0x1ce440,_0x43c616){const _0x40e720=_0x818394;return _0x43c616=_0x3745c5['mercatorToLngLat']({'lng':_0x1ce440['x'],'lat':_0x1ce440['y']}),_0x43c616=[_0x43c616['lng'],_0x43c616['lat']],_0x23a4d9&&(_0x43c616=_0x23a4d9(_0x43c616)),new Cesium__namespace['Cartographic'](Cesium__namespace['Math'][_0x40e720(0x562)](_0x43c616[0x0]),Cesium__namespace[_0x40e720(_0x1a5b2c._0x287214)]['toRadians'](_0x43c616[0x1]));},this[_0x818394(0xdd8)]=_0x3e6c49[_0x818394(_0x52f603._0x14c9d3)]||[];}['tileXYToNativeRectangle'](_0xf7bc4d,_0x48ba06,_0x29618,_0x4aef0d){const _0x415027={_0xe3d70e:0xb84},_0x28798d=_0x3d5d32,_0x5d7b56=this['resolutions'][_0x29618],_0x43c9e1=_0xf7bc4d*_0x5d7b56,_0x3ca3ab=(_0xf7bc4d+0x1)*_0x5d7b56,_0x4c75fa=((_0x48ba06=-_0x48ba06)+0x1)*_0x5d7b56,_0x5ac65a=_0x48ba06*_0x5d7b56;if(!Cesium__namespace[_0x28798d(_0x415027._0xe3d70e)](_0x4aef0d))return new Cesium__namespace['Rectangle'](_0x43c9e1,_0x5ac65a,_0x3ca3ab,_0x4c75fa);return _0x4aef0d['west']=_0x43c9e1,_0x4aef0d['south']=_0x5ac65a,_0x4aef0d['east']=_0x3ca3ab,_0x4aef0d['north']=_0x4c75fa,_0x4aef0d;}[_0x3d5d32(0x280)](_0x5e623f,_0x2a4149,_0x425b1e){const _0x12924b=_0x3d5d32,_0x16def7=this[_0x12924b(0x570)];if(!Cesium__namespace['Rectangle'][_0x12924b(0x3f1)](_0x16def7,_0x5e623f))return undefined;const _0x535018=this['_projection'],_0x3bbbc2=_0x535018['project'](_0x5e623f);if(!Cesium__namespace['defined'](_0x3bbbc2))return undefined;const _0x39c816=this['resolutions'][_0x2a4149],_0x2ec295=Math['floor'](_0x3bbbc2['x']/_0x39c816),_0x4af481=-Math['floor'](_0x3bbbc2['y']/_0x39c816);if(!Cesium__namespace['defined'](_0x425b1e))return new Cesium__namespace['Cartesian2'](_0x2ec295,_0x4af481);return _0x425b1e['x']=_0x2ec295,_0x425b1e['y']=_0x4af481,_0x425b1e;}}class BaiduImageryProvider{constructor(_0x43efce={}){const _0x2d3a97={_0x1c327c:0x796,_0x47cbbc:0xdf1,_0x1575f4:0xd2b,_0x2653db:0xfb0,_0x2343e2:0x5d6,_0x4dff8:0xb66,_0x4ee042:0xb0e},_0x552b61=_0x3d5d32;let _0x1b5b99;switch(_0x43efce['layer']){case'vec':_0x1b5b99='https://maponline{s}.bdimg.com/tile/?qt=vtile&x={x}&y={y}&z={z}&styles='+(_0x43efce['bigfont']?'ph':'pl')+'&scaler=2&udt=&from=jsapi2_0';break;case _0x552b61(_0x2d3a97._0x1c327c):_0x1b5b99='https://maponline{s}.bdimg.com/starpic/{s}?u={mars3d_u}',_0x43efce[_0x552b61(0xa95)]=_0x43efce['customTags']||{},_0x43efce['customTags'][_0x552b61(0x79f)]=(_0xee361f,_0x91e4f1,_0x1c2bdc,_0x58f8ec)=>{return'x='+_0x91e4f1+';y='+-_0x1c2bdc+';z='+_0x58f8ec+';v=009;type=sate';},_0x43efce['queryParameters']={..._0x43efce['queryParameters']||{},'qt':_0x552b61(_0x2d3a97._0x47cbbc),'app':'webearth2','udt':'20210830','fm':'46','v':_0x552b61(0xb9a)};break;case'img_z':_0x1b5b99='http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles='+(_0x43efce[_0x552b61(_0x2d3a97._0x1575f4)]?'sh':'sl')+'&v=020';break;case'custom':_0x43efce[_0x552b61(0xdde)]=_0x43efce['style']||'midnight',_0x1b5b99=_0x552b61(_0x2d3a97._0x2653db)+_0x43efce['style'];break;case _0x552b61(_0x2d3a97._0x2343e2):_0x1b5b99='http://its.map.baidu.com:8002/traffic/TrafficTileService?x={x}&y={y}&level={z}&time='+new Date()['getTime']()+'&label='+(_0x43efce['label']||'web2D')+'&v=017';break;case'streetview':_0x1b5b99=_0x552b61(0x86d);break;default:_0x1b5b99=_0x43efce['url'];break;}this[_0x552b61(0x433)]=_0x43efce,this['_resource']=getUrlResource({..._0x43efce,'url':_0x1b5b99}),this[_0x552b61(_0x2d3a97._0x4dff8)]=Cesium__namespace['combine'](tags,this[_0x552b61(0x433)]['customTags']),this[_0x552b61(0x507)]=['0','1','2','3'],this[_0x552b61(0xd11)]=0x100,this['_tileHeight']=0x100,this['_maximumLevel']=0x12;const _0x10fbed=[];for(let _0x49dd9e=0x0;_0x49dd9e<0x13;_0x49dd9e++){_0x10fbed[_0x49dd9e]=0x100*Math['pow'](0x2,0x12-_0x49dd9e);}this['_tilingScheme']=new BaiduMercatorTilingScheme({'resolutions':_0x10fbed,'rectangleSouthwestInMeters':new Cesium__namespace[(_0x552b61(_0x2d3a97._0x4ee042))](-20037726.37,-12474104.17),'rectangleNortheastInMeters':new Cesium__namespace['Cartesian2'](20037726.37,12474104.17),'mapChinaCRS':_0x43efce['mapChinaCRS']}),this[_0x552b61(0x570)]=this['_tilingScheme']['rectangle'],this['_readyPromise']=Cesium__namespace['defer'](),this['_errorEvent']=new Cesium__namespace['Event'](),this['_ready']=!![],this['_readyPromise']['resolve'](!![]);}get[_0x3d5d32(0x5ee)](){const _0x594b88=_0x3d5d32;var _0x3ae0ae;return(_0x3ae0ae=this['_resource'])===null||_0x3ae0ae===void 0x0?void 0x0:_0x3ae0ae[_0x594b88(0x5ee)];}get['tileWidth'](){return this['_tileWidth'];}get[_0x3d5d32(0x495)](){return this['_tileHeight'];}get[_0x3d5d32(0xbf4)](){const _0x1ec1df=_0x3d5d32;return this[_0x1ec1df(0x51c)];}get['minimumLevel'](){return 0x0;}get['tilingScheme'](){return this['_tilingScheme'];}get[_0x3d5d32(0x5a3)](){return this['_rectangle'];}get['ready'](){const _0x5e2008=_0x3d5d32;return this[_0x5e2008(0x1049)];}get['readyPromise'](){const _0x2923b2=_0x3d5d32;return this[_0x2923b2(0xaf2)][_0x2923b2(0xab8)];}get['errorEvent'](){return this['_errorEvent'];}get['credit'](){const _0x2af3fe=_0x3d5d32;return this[_0x2af3fe(0x898)];}get['hasAlphaChannel'](){return!![];}[_0x3d5d32(0xaad)](_0x3eff22,_0x5ab8df,_0x3ee464){return undefined;}['requestImage'](_0x181a05,_0xb71552,_0x196c7b,_0x219282){const _0x5bc91e={_0x3708fe:0xb84},_0x52c914={_0x42b8b7:0xb84},_0x5e3fdb=_0x3d5d32,_0x317347=this['_resource'],_0x41efb7=_0x317347[_0x5e3fdb(0xb83)](!![]),_0x2ce15f=this[_0x5e3fdb(0xb66)],_0x337276={},_0x3eb0d6=_0x41efb7['match'](templateRegex);return Cesium__namespace[_0x5e3fdb(_0x5bc91e._0x3708fe)](_0x3eb0d6)&&_0x3eb0d6['forEach'](_0x365207=>{const _0x12c451=_0x5e3fdb,_0x3e31da=_0x365207['substring'](0x1,_0x365207['length']-0x1);Cesium__namespace[_0x12c451(_0x52c914._0x42b8b7)](_0x2ce15f[_0x3e31da])&&(_0x337276[_0x3e31da]=_0x2ce15f[_0x3e31da](this,_0x181a05,_0xb71552,_0x196c7b));}),_0x317347['getDerivedResource']({'request':_0x219282,'templateValues':_0x337276})[_0x5e3fdb(0x1f7)]({'preferImageBitmap':!![],'flipY':!![]});}}const templateRegex=/{[^}]+}/g,tags={'x':xTag,'y':yTag,'reverseY':reverseYTag,'z':zTag,'s':sTag};function xTag(_0x1876a5,_0x1c7fb0,_0x5d1749,_0x3c7d08){return _0x1c7fb0;}function yTag(_0x43fc46,_0x5a7093,_0x5aa940,_0x18e292){return-_0x5aa940;}function reverseYTag(_0x3e24f4,_0x28ae5b,_0x187cea,_0xbc8f66){const _0x37cea0={_0x96b923:0x372},_0x163b92=_0x3d5d32,_0x4a6a67=_0x3e24f4['tilingScheme'][_0x163b92(_0x37cea0._0x96b923)](_0xbc8f66)-_0x187cea-0x1;return _0x4a6a67;}function zTag(_0xd914d6,_0x3f80fd,_0xbde0ce,_0x21112c){return _0x21112c;}function sTag(_0x259b79,_0x5259be,_0x3d6494,_0x11d5aa){const _0x7b7902={_0x3e644b:0x507},_0x2c252d=_0x3d5d32,_0x48f34e=(_0x5259be+_0x3d6494+_0x11d5aa)%_0x259b79[_0x2c252d(_0x7b7902._0x3e644b)]['length'];return _0x259b79['_subdomains'][_0x48f34e];}class TencentImageryProvider extends XyzImageryProvider$1{constructor(_0x4f09be={}){const _0x1c96ea={_0x55254a:0xdde},_0x3a462d=_0x3d5d32;switch(_0x4f09be['layer']){case'vec':_0x4f09be['url']='https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1&scene=0';break;case'img_d':_0x4f09be['url']='https://p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400',_0x4f09be['customTags']={'sx':(_0x2513e7,_0x5f52f1,_0x187b3c,_0x249919)=>{return _0x5f52f1>>0x4;},'sy':(_0x578525,_0x149403,_0x73d9d0,_0x14bb16)=>{return(0x1<<_0x14bb16)-_0x73d9d0>>0x4;}};break;case'img_z':_0x4f09be['url']='https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=2&scene=0';break;case'custom':_0x4f09be[_0x3a462d(0xdde)]=_0x4f09be[_0x3a462d(0xdde)]||'4',_0x4f09be['url']='https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid='+_0x4f09be[_0x3a462d(_0x1c96ea._0x55254a)]+_0x3a462d(0x579);break;}_0x4f09be['subdomains']=_0x4f09be['subdomains']??['0','1','2'],super(_0x4f09be);}}class GoogleImageryProvider extends XyzImageryProvider$1{constructor(_0x4bea23={}){const _0x4e62ff={_0x2e7d65:0x5ee,_0x4f8967:0x3fc,_0x16dee0:0x9da},_0x4f965b=_0x3d5d32;let _0xc8aaef;if(_0x4bea23['chinaCRS']===ChinaCRS['WGS84'])_0xc8aaef=_0x4bea23[_0x4f965b(_0x4e62ff._0x2e7d65)]||'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&gl=us&x={x}&y={y}&z={z}';else switch(_0x4bea23['layer']){case'vec':_0xc8aaef=_0x4f965b(0xd65);break;case'img_d':_0xc8aaef='https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&gl=CN&x={x}&y={y}&z={z}';break;case _0x4f965b(0x978):_0xc8aaef='https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&gl=CN&x={x}&y={y}&z={z}';break;case'ter':_0xc8aaef='https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&gl=CN&x={x}&y={y}&z={z}';break;default:_0xc8aaef=_0x4bea23['url'];break;}(_0x4bea23[_0x4f965b(0x222)]||_0x4bea23[_0x4f965b(0x9da)]||_0x4bea23[_0x4f965b(0xa1a)])&&(_0xc8aaef=getUrlResource({'url':_0xc8aaef['replace'](_0x4f965b(_0x4e62ff._0x4f8967),'1'),'proxy':_0x4bea23['proxy'],'headers':_0x4bea23[_0x4f965b(_0x4e62ff._0x16dee0)],'queryParameters':_0x4bea23[_0x4f965b(0xa1a)]})),super({'subdomains':['1','2','3'],'maximumLevel':0x14,..._0x4bea23,'url':_0xc8aaef});}}class OsmImageryProvider extends XyzImageryProvider$1{constructor(_0x3c2ef6={}){const _0x456e73={_0x5b5153:0x9da,_0x57bfb8:0x3fc},_0x19c915=_0x3d5d32;let _0x1bb6e8='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';(_0x3c2ef6['proxy']||_0x3c2ef6[_0x19c915(_0x456e73._0x5b5153)]||_0x3c2ef6['queryParameters'])&&(_0x1bb6e8=getUrlResource({'url':_0x1bb6e8['replace'](_0x19c915(_0x456e73._0x57bfb8),'a'),'proxy':_0x3c2ef6['proxy'],'headers':_0x3c2ef6['headers'],'queryParameters':_0x3c2ef6['queryParameters']})),super({'subdomains':_0x19c915(0xd25),'maximumLevel':0x12,..._0x3c2ef6,'url':_0x1bb6e8});}}class EmptyImageryProvider extends Cesium__namespace['TileCoordinatesImageryProvider']{constructor(_0x323002={}){const _0x4d9a66={_0x30cc9d:0x324,_0x4da085:0xbf4,_0x62d4f0:0x5a3},_0x4c56eb=_0x3d5d32;super(_0x323002),this['options']=_0x323002,this[_0x4c56eb(_0x4d9a66._0x30cc9d)]=_0x323002['minimumLevel']??0x0,this['_maximumLevel']=_0x323002[_0x4c56eb(_0x4d9a66._0x4da085)],this['_tilingScheme']=_0x323002[_0x4c56eb(0x21c)]??new Cesium__namespace[(_0x4c56eb(0x54f))]({'ellipsoid':_0x323002['ellipsoid']}),_0x323002[_0x4c56eb(_0x4d9a66._0x62d4f0)]?this['_rectangle']=Cesium__namespace['Rectangle']['intersection'](_0x323002['rectangle'],this['_tilingScheme'][_0x4c56eb(0x5a3)]):this['_rectangle']=this['_tilingScheme'][_0x4c56eb(0x5a3)],this[_0x4c56eb(0x433)]=_0x323002;}['requestImage'](_0x558408,_0xb33d89,_0x4670b0){const _0x3c20eb={_0x2afd78:0xf62};return new Promise((_0x3db7de,_0x18a579)=>{const _0x5a4212=_0x4132,_0x24de02=document[_0x5a4212(0x3dc)]('canvas');_0x24de02['width']=0x100,_0x24de02['height']=0x100;if(_0x4670b0this['_maximumLevel'])return _0x24de02;if(this['options']['debuggerTileInfo']){const _0x584eec=_0x24de02[_0x5a4212(0xf58)]('2d',{'willReadFrequently':!![]});_0x584eec['strokeStyle']=_0x5a4212(0xff5),_0x584eec['lineWidth']=0x2,_0x584eec['strokeRect'](0x1,0x1,0xff,0xff);const _0x445cdf='L'+_0x4670b0+'X'+_0x558408+'Y'+_0xb33d89;_0x584eec['font']='bold\x2025px\x20Arial',_0x584eec['textAlign']='center',_0x584eec['fillStyle']='black',_0x584eec[_0x5a4212(0xec5)](_0x445cdf,0x7f,0x7f),_0x584eec[_0x5a4212(_0x3c20eb._0x2afd78)]=_0x5a4212(0xff5),_0x584eec['fillText'](_0x445cdf,0x7c,0x7c);}_0x3db7de(_0x24de02);});}}var index$5={'__proto__':null,'XyzImageryProvider':XyzImageryProvider$1,'TdtImageryProvider':TdtImageryProvider,'GaodeImageryProvider':GaodeImageryProvider,'BaiduImageryProvider':BaiduImageryProvider,'TencentImageryProvider':TencentImageryProvider,'GoogleImageryProvider':GoogleImageryProvider,'OsmImageryProvider':OsmImageryProvider,'EmptyImageryProvider':EmptyImageryProvider};class GroupLayer extends BaseGraphicLayer{constructor(_0x278ad7={}){super(_0x278ad7),this['_arrLayer']=[];}get['layer'](){const _0x12d821=_0x3d5d32;return this[_0x12d821(0xd53)];}get['arrLayer'](){return this['_arrLayer'];}get['hasEmptyGroup'](){return this['length']===0x0;}get['hasChildLayer'](){const _0x5b7ffe=_0x3d5d32;return this[_0x5b7ffe(0xc84)]>0x0;}get['length'](){var _0x22500e,_0x5f06af;if(((_0x22500e=this['options'])===null||_0x22500e===void 0x0?void 0x0:(_0x5f06af=_0x22500e['layers'])===null||_0x5f06af===void 0x0?void 0x0:_0x5f06af['length'])>0x0)return this['options']['layers']['length'];else{var _0x57f951;return((_0x57f951=this['_arrLayer'])===null||_0x57f951===void 0x0?void 0x0:_0x57f951['length'])||0x0;}}get['hasOpacity'](){if(this['_arrLayer']['length']===0x0)return![];return this['_arrLayer'][0x0]['hasOpacity'];}get[_0x3d5d32(0x478)](){const _0x1792d6={_0x37ec6b:0xd53},_0x17812f=_0x3d5d32;if(this[_0x17812f(_0x1792d6._0x37ec6b)]['length']===0x0)return![];return this['_arrLayer'][0x0]['hasZIndex'];}get['zIndex'](){return this['options']['zIndex'];}set['zIndex'](_0x3db4f3){const _0x4eb512={_0x496595:0x92c},_0x2ff136={_0x293168:0x377},_0x4a7a89=_0x3d5d32;this['options']['zIndex']=_0x3db4f3,this[_0x4a7a89(_0x4eb512._0x496595)](_0x549431=>{const _0x499e49=_0x4a7a89;_0x549431[_0x499e49(0x478)]&&(_0x549431[_0x499e49(_0x2ff136._0x293168)]=_0x3db4f3);},this);}['_showHook'](_0x567e43){this['eachLayer'](_0x4cdbdc=>{_0x4cdbdc['show']=_0x567e43;},this);}[_0x3d5d32(0xe4c)](){const _0x1bc3cc={_0x416fa9:0x433,_0xf9b7ad:0xc17},_0x198f01=_0x3d5d32;super['_mountedHook']();const _0x229110=this['options']['layers'];if(_0x229110&&_0x229110['length']>0x0)for(let _0x492eda=0x0;_0x492eda<_0x229110['length'];_0x492eda++){const _0x14d07e=_0x229110[_0x492eda];_0x14d07e['eventParent']=this,_0x14d07e[_0x198f01(0x6cd)]=this['isPrivate'];const _0x8268d2=create$2(_0x14d07e,this[_0x198f01(_0x1bc3cc._0x416fa9)]['templateValues']);_0x8268d2&&this[_0x198f01(_0x1bc3cc._0xf9b7ad)](_0x8268d2);}}['_addedHook'](){const _0x39b99f={_0x3f201a:0x1d1,_0x443e46:0xb75},_0x427984=[];this['eachLayer'](_0x29cfae=>{const _0xe82517=_0x4132;_0x29cfae['eventParent']=this,this[_0xe82517(_0x39b99f._0x3f201a)]['addLayer'](_0x29cfae),_0x427984[_0xe82517(_0x39b99f._0x443e46)](_0x29cfae['readyPromise']);},this),Promise['all'](_0x427984)['then'](_0x59d046=>{const _0x4cf443=_0x4132;this[_0x4cf443(0xaf2)][_0x4cf443(0xac9)](this);});}['_removedHook'](){this['removeMapChilds']();}['addChildsToMap'](){const _0x58554c={_0x3e666e:0x92c},_0x1d9941={_0x53708e:0xc17},_0x3d0ff0=_0x3d5d32;this[_0x3d0ff0(_0x58554c._0x3e666e)](_0x16857d=>{const _0x5662e6=_0x3d0ff0;this[_0x5662e6(0x1d1)][_0x5662e6(_0x1d9941._0x53708e)](_0x16857d);},this);}[_0x3d5d32(0xd05)](){const _0xf669c9={_0x42247d:0x92c},_0x3356e0=_0x3d5d32;this[_0x3356e0(_0xf669c9._0x42247d)](_0x85d2e9=>{this['_map']['removeLayer'](_0x85d2e9);},this);}[_0x3d5d32(0xc17)](_0x5a4155){const _0x246631={_0x5be8b8:0x1e5,_0x2f169f:0x433,_0x4e1d1a:0x4b7},_0x58239d=_0x3d5d32;return _0x5a4155['parent']&&(_0x5a4155[_0x58239d(_0x246631._0x5be8b8)](_0x5a4155['parent']),_0x5a4155['parent']=null),_0x5a4155['pid']=this['id'],_0x5a4155['parent']=this,_0x5a4155[_0x58239d(_0x246631._0x2f169f)][_0x58239d(_0x246631._0x4e1d1a)]=this,this['_arrLayer'][_0x58239d(0xb75)](_0x5a4155),this[_0x58239d(0x842)]&&!_0x5a4155[_0x58239d(0x842)]?this[_0x58239d(0x1d1)]['addLayer'](_0x5a4155):(_0x5a4155['removeEventParent'](this[_0x58239d(0x1d1)]),_0x5a4155[_0x58239d(0x584)](this)),this;}['removeLayer'](_0x108b04){const _0x5f1e86={_0x3d8fb1:0x1e5,_0x3b3ac1:0xa9e},_0x530197=_0x3d5d32;return _0x108b04['parent']=null,_0x108b04[_0x530197(_0x5f1e86._0x3d8fb1)](this),removeArrayItem(this['_arrLayer'],_0x108b04),this['_map']&&_0x108b04['isAdded']&&this['_map'][_0x530197(_0x5f1e86._0x3b3ac1)](_0x108b04),this;}['eachLayer'](_0x597e36,_0x45687a){const _0x5a3752={_0x5bd50c:0x1061},_0x15f9fb=_0x3d5d32;if(!this['_arrLayer'])return;return this['_arrLayer'][_0x15f9fb(_0x5a3752._0x5bd50c)](_0x51cb5c=>{_0x597e36['call'](_0x45687a,_0x51cb5c);}),this;}['getLayers'](){return this['_arrLayer'];}['getInMapChilds'](){const _0x1026a2={_0x56075a:0xd53},_0x115f2a={_0xfd0688:0xd53},_0x4b28b7=_0x3d5d32,_0x5b93de=this[_0x4b28b7(_0x1026a2._0x56075a)]||[];return this['_map']['eachLayer'](_0x343fb2=>{const _0x2c5949=_0x4b28b7;if(_0x343fb2['pid']!==this['id'])return;if(this[_0x2c5949(_0x115f2a._0xfd0688)]['indexOf'](_0x343fb2)!==-0x1)return;_0x5b93de[_0x2c5949(0xb75)](_0x343fb2);},this),_0x5b93de;}['getLayerById'](_0x30ce6b){const _0x1dbb35={_0x4b96ab:0xd53},_0x5f06cb=_0x3d5d32,_0x34f3f1=this['_arrLayer'];if(!this[_0x5f06cb(_0x1dbb35._0x4b96ab)]||this['_arrLayer']['length']===0x0)return;for(let _0x54bb7e=0x0,_0x55f03a=_0x34f3f1[_0x5f06cb(0xc84)];_0x54bb7e<_0x55f03a;_0x54bb7e++){const _0x3468d2=_0x34f3f1[_0x54bb7e];if(_0x3468d2['id']===_0x30ce6b)return _0x3468d2;}return undefined;}['getLayer'](_0x739009){const _0x5d09af=_0x3d5d32;if(!this['_arrLayer']||this[_0x5d09af(0xd53)]['length']===0x0)return undefined;for(let _0x1c6a38=0x0;_0x1c6a38{_0x374ba2['push'](_0x4ef4e9['toJSON']());},this),_0x374ba2[_0x448340(0xc84)]>0x0&&(_0x487df9[_0x448340(0x378)]=_0x374ba2);}['getRectangle'](_0x46c166){let _0x278007;const _0x253d53=this['getInMapChilds']();return _0x253d53['forEach'](_0x58a683=>{if(!_0x58a683['getRectangle'])return;const _0x5d6d57=_0x58a683['getRectangle']();if(!Cesium__namespace['defined'](_0x5d6d57))return;_0x278007?_0x278007=Cesium__namespace['Rectangle']['union'](_0x5d6d57,_0x278007):_0x278007=_0x5d6d57;},this),_0x46c166?formatRectangle(_0x278007):_0x278007;}['setOpacity'](_0x3a82c4){this['eachLayer'](_0xa389ff=>{_0xa389ff['opacity']=_0x3a82c4;},this);}[_0x3d5d32(0xadc)](){this['eachLayer'](_0x29efef=>{_0x29efef['toTop']();},this);}['toBottom'](){const _0x395d4c={_0x50fd44:0xd53},_0x421482=_0x3d5d32,_0x272914=this[_0x421482(_0x395d4c._0x50fd44)];for(let _0x362bab=_0x272914[_0x421482(0xc84)]-0x1;_0x362bab>=0x0;_0x362bab--){const _0x54ce56=_0x272914[_0x362bab];_0x54ce56['toBottom']();}}[_0x3d5d32(0x689)](_0x50e21f){const _0x5e0b96={_0x42a0ac:0x689};this['eachLayer'](_0x3da2b6=>{const _0x3c0d89=_0x4132;_0x3da2b6!==null&&_0x3da2b6!==void 0x0&&_0x3da2b6[_0x3c0d89(_0x5e0b96._0x42a0ac)]&&_0x3da2b6['destroy'](_0x50e21f);},this),super['destroy'](_0x50e21f);}}register$2(_0x3d5d32(0x594),GroupLayer);class BaseTileLayer extends BaseLayer{constructor(_0x3554cc={}){const _0x599801={_0x2faaf:0x292},_0x26e93b=_0x3d5d32;super(_0x3554cc),this['_setRectangleByOptions'](_0x3554cc),this[_0x26e93b(_0x599801._0x2faaf)]=!![];}get['layer'](){const _0x18296e=_0x3d5d32;return this[_0x18296e(0x9d4)];}get['imageryProvider'](){var _0x16421d;return(_0x16421d=this['_imageryLayer'])===null||_0x16421d===void 0x0?void 0x0:_0x16421d['imageryProvider'];}get['crs'](){const _0xfb6bba=_0x3d5d32;return this[_0xfb6bba(0x433)]['crs']||CRS['EPSG3857'];}get[_0x3d5d32(0x24b)](){return this['opacity'];}set['alpha'](_0x371e3c){const _0x298709={_0xf06023:0xfdc},_0x4f59ed=_0x3d5d32;this[_0x4f59ed(_0x298709._0xf06023)]=_0x371e3c;}get[_0x3d5d32(0xd6f)](){var _0x2787fc;return this['options']['brightness']||((_0x2787fc=this['_imageryLayer'])===null||_0x2787fc===void 0x0?void 0x0:_0x2787fc['brightness']);}set['brightness'](_0x377ee0){this['options']['brightness']=_0x377ee0;if(this['_imageryLayer']==null)return;this['_imageryLayer']['brightness']=_0x377ee0;}get['contrast'](){const _0x1cf4c0=_0x3d5d32;var _0x23775b;return this[_0x1cf4c0(0x433)][_0x1cf4c0(0xffd)]||((_0x23775b=this['_imageryLayer'])===null||_0x23775b===void 0x0?void 0x0:_0x23775b['contrast']);}set['contrast'](_0x10d43e){const _0x32e97a=_0x3d5d32;this['options'][_0x32e97a(0xffd)]=_0x10d43e;if(this['_imageryLayer']==null)return;this['_imageryLayer']['contrast']=_0x10d43e;}get['hue'](){const _0x4732b5=_0x3d5d32;var _0x217a34;return this['options'][_0x4732b5(0xe48)]||((_0x217a34=this['_imageryLayer'])===null||_0x217a34===void 0x0?void 0x0:_0x217a34['hue']);}set['hue'](_0x9ae580){const _0x133223=_0x3d5d32;this['options']['hue']=_0x9ae580;if(this[_0x133223(0x9d4)]==null)return;this['_imageryLayer']['hue']=_0x9ae580;}get[_0x3d5d32(0xc1c)](){var _0x283d4d;return this['options']['saturation']||((_0x283d4d=this['_imageryLayer'])===null||_0x283d4d===void 0x0?void 0x0:_0x283d4d['saturation']);}set['saturation'](_0x12da34){const _0x304442={_0x205923:0xc1c},_0x42136f=_0x3d5d32;this[_0x42136f(0x433)]['saturation']=_0x12da34;if(this['_imageryLayer']==null)return;this[_0x42136f(0x9d4)][_0x42136f(_0x304442._0x205923)]=_0x12da34;}get[_0x3d5d32(0x313)](){var _0x5cb4f7;return this['options']['gamma']||((_0x5cb4f7=this['_imageryLayer'])===null||_0x5cb4f7===void 0x0?void 0x0:_0x5cb4f7['gamma']);}set[_0x3d5d32(0x313)](_0x203b9c){const _0x128515={_0x5572de:0x313},_0x56efe2=_0x3d5d32;this['options'][_0x56efe2(_0x128515._0x5572de)]=_0x203b9c;if(this['_imageryLayer']==null)return;this['_imageryLayer']['gamma']=_0x203b9c;}get['hasZIndex'](){return!![];}get[_0x3d5d32(0x377)](){const _0x261207={_0x3a0298:0x433},_0x4174e6=_0x3d5d32;return this[_0x4174e6(_0x261207._0x3a0298)]['zIndex'];}set['zIndex'](_0x4fed5e){const _0x560128={_0x362e9c:0x9d4,_0x13aeda:0x377,_0x128538:0x1d1},_0x20043f=_0x3d5d32;this['options']['zIndex']=_0x4fed5e;if(this[_0x20043f(_0x560128._0x362e9c)]==null||_0x4fed5e==null)return;this['_map']['imageryLayers']['raiseToTop'](this['_imageryLayer']);const _0x423fe0=this['_map']['imageryLayers']['_layers'];for(let _0x552c3b=_0x423fe0['length']-0x1;_0x552c3b>=0x0;_0x552c3b--){const _0xb73584=_0x423fe0[_0x552c3b];if(_0xb73584===this['_imageryLayer'])continue;const _0x3de43f=_0xb73584['_mars3d_config'];_0x3de43f&&_0x3de43f[_0x20043f(_0x560128._0x13aeda)]&&(_0x4fed5e<_0x3de43f[_0x20043f(0x377)]&&this[_0x20043f(_0x560128._0x128538)]['imageryLayers']['lower'](this['_imageryLayer']));}}get[_0x3d5d32(0x5a3)](){const _0x4a3fdb={_0x7b244a:0x9d4},_0x4cdaf1=_0x3d5d32;var _0x5c1602,_0x3f30bc;if(this['_rectangle'])return this['_rectangle'];else return(_0x5c1602=this['_imageryLayer'])!==null&&_0x5c1602!==void 0x0&&(_0x3f30bc=_0x5c1602['imageryProvider'])!==null&&_0x3f30bc!==void 0x0&&_0x3f30bc['rectangle']?this[_0x4cdaf1(_0x4a3fdb._0x7b244a)]['imageryProvider']['rectangle']:null;}set[_0x3d5d32(0x5a3)](_0x50ba3f){const _0x2e880e={_0x3663f0:0x5a3,_0x29c31f:0x570,_0x14dcf6:0x981},_0x353688=_0x3d5d32;if(_0x50ba3f){if(_0x50ba3f instanceof Cesium__namespace['Rectangle']){var _0x52783e,_0x6f3b22;this['_rectangle']=_0x50ba3f,this['options']['rectangle']=formatRectangle(this[_0x353688(0x570)]),(_0x52783e=this['_imageryLayer'])!==null&&_0x52783e!==void 0x0&&(_0x6f3b22=_0x52783e['imageryProvider'])!==null&&_0x6f3b22!==void 0x0&&_0x6f3b22[_0x353688(_0x2e880e._0x3663f0)]&&(this['_imageryLayer']['imageryProvider']['_rectangle']=this['_rectangle']);}}else this[_0x353688(_0x2e880e._0x29c31f)]=undefined,delete this['options']['rectangle'],this[_0x353688(_0x2e880e._0x14dcf6)]();}[_0x3d5d32(0x2a8)](_0x4eee15){const _0x54ec09={_0x4e0b25:0xe69,_0x22e25a:0x756,_0x441151:0xe69,_0x37862e:0x97d},_0xedbe5a=_0x3d5d32;if(Cesium__namespace['defined'](_0x4eee15[_0xedbe5a(0x5a3)])){if(Cesium__namespace['defined'](_0x4eee15['rectangle']['xmin'])&&Cesium__namespace['defined'](_0x4eee15['rectangle'][_0xedbe5a(0x57e)])&&Cesium__namespace['defined'](_0x4eee15['rectangle']['ymin'])&&Cesium__namespace['defined'](_0x4eee15['rectangle']['ymax']))this['_rectangle']=Cesium__namespace['Rectangle'][_0xedbe5a(_0x54ec09._0x4e0b25)](_0x4eee15['rectangle']['xmin'],_0x4eee15['rectangle']['ymin'],_0x4eee15['rectangle']['xmax'],_0x4eee15['rectangle'][_0xedbe5a(0x1058)]);else _0x4eee15['rectangle']instanceof Cesium__namespace['Rectangle']?this['_rectangle']=_0x4eee15['rectangle']:delete _0x4eee15[_0xedbe5a(0x5a3)];}else Cesium__namespace[_0xedbe5a(0xb84)](_0x4eee15['bbox'])&&_0x4eee15['bbox']['length']&&_0x4eee15['bbox']['length']===0x4?this['_rectangle']=Cesium__namespace[_0xedbe5a(_0x54ec09._0x22e25a)][_0xedbe5a(_0x54ec09._0x441151)](_0x4eee15[_0xedbe5a(0x97d)][0x0],_0x4eee15['bbox'][0x1],_0x4eee15[_0xedbe5a(_0x54ec09._0x37862e)][0x2],_0x4eee15[_0xedbe5a(0x97d)][0x3]):this['_rectangle']=undefined;}['_setOptionsHook'](_0x3e29e2,_0x2b06bb){this['_setRectangleByOptions'](_0x3e29e2),this['reload']();}async['_createImageryProvider'](_0x24c73c){return new Cesium__namespace['UrlTemplateImageryProvider'](_0x24c73c);}['_addedHook'](){const _0x4483fd={_0x23002b:0x2a3,_0x166e7b:0xd8d,_0x4b042f:0x433,_0x8b1c4e:0x863,_0x3be0d5:0x980,_0x398b98:0xa18,_0x55deef:0xc65,_0x430c10:0x28e,_0x28db9b:0xaf2,_0x285ea9:0xffe},_0x4a7971=_0x3d5d32;var _0x226d2d,_0x22d365,_0x388637;this[_0x4a7971(0x433)]['highlight']&&(this['options']['enablePickFeatures']=!![]);const _0x596508=this[_0x4a7971(_0x4483fd._0x23002b)]({...this['options'],'rectangle':this['rectangle'],'mapChinaCRS':this['_map'][_0x4a7971(0xd96)]});if(!Cesium__namespace['defined'](_0x596508))return;const _0xfb09d7=this['options'],_0x111823={'show':this['show'],'alpha':this[_0x4a7971(0xfdc)],..._0xfb09d7,'rectangle':this['rectangle'],'marsOptions':{'onAddTile':_0x2cab02=>{const _0x452853=this['_getTileEventParams'](_0x2cab02);this['fire'](EventType['addTile'],_0x452853);},'onAddTileSuccess':_0x143af5=>{const _0x1bdbb4=_0x4a7971,_0x4d31e1=this[_0x1bdbb4(0x354)](_0x143af5);this['fire'](EventType['addTileSuccess'],_0x4d31e1);},'onAddTileError':_0x528847=>{const _0x5dd539=this['_getTileEventParams'](_0x528847);this['fire'](EventType['addTileError'],_0x5dd539);},'onRemoveTile':_0x1e03bf=>{const _0x35ce25=this['_getTileEventParams'](_0x1e03bf);this['fire'](EventType['removeTile'],_0x35ce25);}}};this[_0x4a7971(0x9d4)]=Cesium__namespace['ImageryLayer'][_0x4a7971(_0x4483fd._0x166e7b)](_0x596508,_0x111823),this['_imageryLayer']['_mars3d_layerId']=this['id'],this['_imageryLayer']['_mars3d_config']=this[_0x4a7971(_0x4483fd._0x4b042f)];this[_0x4a7971(0x433)][_0x4a7971(_0x4483fd._0x8b1c4e)]&&this['_map']['imageryLayersForClamp']&&_0x111823[_0x4a7971(_0x4483fd._0x3be0d5)]!==CRS['EPSG3857']?this['_map'][_0x4a7971(0x6fd)][_0x4a7971(0xff3)](this['_imageryLayer']):this['_map'][_0x4a7971(_0x4483fd._0x398b98)]['add'](this[_0x4a7971(0x9d4)]);this['options']['zIndex']&&(this[_0x4a7971(0x377)]=this['options']['zIndex']);if(this['options'][_0x4a7971(0x56e)])this['options']['enablePickFeatures']=!![],this[_0x4a7971(0xc65)](this[_0x4a7971(0x433)]['highlight']);else(_0x226d2d=this['options']['symbol'])!==null&&_0x226d2d!==void 0x0&&(_0x22d365=_0x226d2d['styleOptions'])!==null&&_0x22d365!==void 0x0&&_0x22d365['highlight']&&this[_0x4a7971(_0x4483fd._0x55deef)](this['options'][_0x4a7971(0x63d)]['styleOptions']['highlight']);(_0x388637=this[_0x4a7971(0x433)])!==null&&_0x388637!==void 0x0&&_0x388637[_0x4a7971(0xd67)]&&this[_0x4a7971(_0x4483fd._0x430c10)](),this[_0x4a7971(_0x4483fd._0x28db9b)]['resolve'](this),this['fire'](EventType[_0x4a7971(_0x4483fd._0x285ea9)],{},!![]);}['_getTileEventParams'](_0x1ad00c){return{'x':_0x1ad00c['x'],'y':_0x1ad00c['y'],'level':_0x1ad00c['level'],'extent':formatRectangle(_0x1ad00c['rectangle'])};}[_0x3d5d32(0x566)](){const _0x262020={_0x14e819:0x689,_0xe5dc31:0xa18},_0x58c367=_0x3d5d32;var _0x583821,_0x4fe6e4;this['unbindHighlight'](),(_0x583821=this['_imageryLayer'])!==null&&_0x583821!==void 0x0&&(_0x4fe6e4=_0x583821['imageryProvider'])!==null&&_0x4fe6e4!==void 0x0&&_0x4fe6e4[_0x58c367(_0x262020._0x14e819)]&&this['_imageryLayer']['imageryProvider']['destroy'](),this['_map'][_0x58c367(_0x262020._0xe5dc31)][_0x58c367(0xf06)](this['_imageryLayer'],!![]),this['_imageryLayer']=null;}['reload'](){const _0x4fe4d2={_0xe3675d:0x9d4},_0x5832a5=_0x3d5d32,_0x384026=this['options']['flyTo']??![];this[_0x5832a5(_0x4fe4d2._0xe3675d)]&&this['_removedHook'](),this['isAdded']&&(this['options']['flyTo']=![],this['once'](EventType['load'],()=>{this['options']['flyTo']=_0x384026;}),this['_addedHook']());}[_0x3d5d32(0xb2d)](_0x3ec047){const _0x530559={_0x106087:0x9d4},_0x10679c=_0x3d5d32;this['_imageryLayer']&&(this[_0x10679c(_0x530559._0x106087)]['alpha']=_0x3ec047);}['toTop'](){if(this['_map'])return this['_map']['imageryLayers']['raiseToTop'](this['_imageryLayer']);}[_0x3d5d32(0x927)](){const _0x180a53={_0x4b1141:0x1d1,_0x2809ca:0x9d4},_0x126d25=_0x3d5d32;if(this['_map'])return this[_0x126d25(_0x180a53._0x4b1141)]['imageryLayers']['lowerToBottom'](this[_0x126d25(_0x180a53._0x2809ca)]);}[_0x3d5d32(0xd67)](_0x21471b={}){const _0x2c5478={_0x45a0b5:0x433,_0x36a04b:0xe72,_0x312046:0x5a3,_0x2e6081:0xcd1,_0x96219d:0xd3a},_0x4c0ee5=_0x3d5d32;if(!this['_map']||!this['_imageryLayer'])return Promise['resolve'](![]);this['_map']['cancelFlyTo']();this['options']['flyToOptions']&&(_0x21471b={...this['options']['flyToOptions'],..._0x21471b});if(this[_0x4c0ee5(_0x2c5478._0x45a0b5)][_0x4c0ee5(_0x2c5478._0x36a04b)])return this[_0x4c0ee5(0x1d1)]['setCameraView'](this[_0x4c0ee5(0x433)]['center'],_0x21471b);else{if(this['options'][_0x4c0ee5(0x86b)])return this['_map']['flyToExtent'](this[_0x4c0ee5(0x433)][_0x4c0ee5(0x86b)],_0x21471b);else{const _0x16c9df=this[_0x4c0ee5(_0x2c5478._0x312046)];if(Cesium__namespace['defined'](_0x16c9df)&&_0x16c9df['equals']&&!_0x16c9df['equals'](Cesium__namespace[_0x4c0ee5(0x756)]['MAX_VALUE'])&&_0x16c9df[_0x4c0ee5(_0x2c5478._0x2e6081)]>0x0&&_0x16c9df['south']>0x0&&_0x16c9df['east']>0x0&&_0x16c9df[_0x4c0ee5(_0x2c5478._0x96219d)]>0x0)return this['_map']['camera']['flyTo']({..._0x21471b,'destination':_0x16c9df});}}return Promise['resolve'](![]);}['bindHighlight'](_0x265892){const _0x4b1baa={_0x273a6c:0xb59},_0x29fdb1=_0x3d5d32;this['unbindHighlight'](),this['_highlightOptions']=_0x265892,this['on'](EventType[_0x29fdb1(_0x4b1baa._0x273a6c)],this['_highlight_mouseEventHandler'],this);}[_0x3d5d32(0x54e)](){this['_highlightOptions']&&(this['off'](EventType['click'],this['_highlight_mouseEventHandler'],this),this['_map']['closeHighlight'](),this['_highlightOptions']=null);}['_highlight_mouseEventHandler'](_0xc4c055){const _0xe17688={_0x4fb7f4:0x1d1,_0x15369f:0x759},_0x58228e=_0x3d5d32;this[_0x58228e(_0xe17688._0x4fb7f4)][_0x58228e(_0xe17688._0x15369f)]();const _0x5e9ada=_0xc4c055['graphics'];_0x5e9ada&&(this[_0x58228e(0x586)]=_0x5e9ada,this[_0x58228e(0x1d1)]['openHighlight'](this,this[_0x58228e(0xd5d)],_0xc4c055));}['_highlight_mouseOutHandler'](_0x4bb97c){const _0x1e263e={_0xf93bcc:0x759},_0x3f1a20=_0x3d5d32;this['_map'][_0x3f1a20(_0x1e263e._0xf93bcc)]();}['openHighlight'](_0x1f9a87,_0x2604d1=!![]){const _0x45cc62={_0x45fc13:0x759,_0x31b64f:0x1d1},_0x2eafca=_0x3d5d32;_0x2604d1&&(this['_map'][_0x2eafca(_0x45cc62._0x45fc13)](),this[_0x2eafca(0x1d1)]['last_highlighGraphic']=this);const _0x3b29ae=_0x1f9a87||this['_highlightOptions'];this['_last_graphicsOptions']&&_0x3b29ae&&(!this[_0x2eafca(0x32f)]&&(this['_graphicLayer']=new GraphicLayer({'name':'高亮对象图层','private':!![]}),this[_0x2eafca(_0x45cc62._0x31b64f)]['addLayer'](this['_graphicLayer'])),this['_graphicLayer']['addGraphic'](this['_last_graphicsOptions']),this['fire'](EventType['highlightOpen'],{},!![]));}['closeHighlight'](){const _0x2f1179={_0x194b9b:0x1d1},_0x2da96d=_0x3d5d32;var _0x32e11e;if(!this['_graphicLayer']||((_0x32e11e=this['_map'])===null||_0x32e11e===void 0x0?void 0x0:_0x32e11e[_0x2da96d(0xe05)])!==this)return;this['_graphicLayer'][_0x2da96d(0x76d)](),this[_0x2da96d(_0x2f1179._0x194b9b)]['_clearLastHighlight'](),this[_0x2da96d(0xefc)](EventType['highlightClose'],{},!![]);}}class TerrainLayer extends BaseLayer{['_showHook'](_0x1dffd0){const _0xcbc01e={_0x1160b5:0x226,_0x3facd1:0x566},_0x5352ad=_0x3d5d32;_0x1dffd0?this[_0x5352ad(_0xcbc01e._0x1160b5)]():this[_0x5352ad(_0xcbc01e._0x3facd1)]();}['_mountedHook'](){this['_terrainProviderPromise']=createTerrainProvider(this['_getTerrainOptions']());}[_0x3d5d32(0x38a)](){const _0x1e888f={_0x290a59:0x433},_0xd46f87=_0x3d5d32,_0x7a18c9={'templateValues':this[_0xd46f87(_0x1e888f._0x290a59)]['templateValues'],...this[_0xd46f87(0x433)][_0xd46f87(0xe4f)]};return _0x7a18c9;}['_addedHook'](){const _0x2ccd1d=_0x3d5d32;this[_0x2ccd1d(0x792)]&&this['_updateTerrainProvider']();}[_0x3d5d32(0x566)](){this['_map']['terrainProvider']=getNoTerrainProvider();}['_setOptionsHook'](_0x303c24,_0x35d204){const _0x958499={_0xb5bc84:0x803},_0x257025=_0x3d5d32;this[_0x257025(_0x958499._0xb5bc84)]=createTerrainProvider(this['_getTerrainOptions']()),this['_updateTerrainProvider']();}['_updateTerrainProvider'](){const _0x4e8ac9={_0x2efa13:0x47c},_0x4be50e={_0x5938fd:0x1f3,_0x3994dc:0xac9,_0x3d8b89:0x1d1},_0x484647=_0x3d5d32,_0x7015e0=_0x362b22=>{const _0x774106=_0x4132;this['_map']['off'](EventType['terrainLoadSuccess'],_0x7015e0),this['_map']['off'](EventType[_0x774106(_0x4be50e._0x5938fd)],_0x3a79b9),this['_readyPromise'][_0x774106(_0x4be50e._0x3994dc)](this),this['fire'](EventType[_0x774106(0xffe)],{'terrain':this[_0x774106(_0x4be50e._0x3d8b89)]['terrainProvider']});},_0x3a79b9=_0x263b2e=>{const _0x10f098=_0x4132;var _0x705c15;this['_map']['off'](EventType[_0x10f098(0x1060)],_0x7015e0),this['_map']['off'](EventType['terrainLoadError'],_0x3a79b9),(_0x705c15=this['_readyPromise'])!==null&&_0x705c15!==void 0x0&&_0x705c15[_0x10f098(_0x4e8ac9._0x2efa13)]&&this['_readyPromise'][_0x10f098(_0x4e8ac9._0x2efa13)](_0x263b2e);};this['_map']['once'](EventType['terrainLoadSuccess'],_0x7015e0),this[_0x484647(0x1d1)]['once'](EventType[_0x484647(0x1f3)],_0x3a79b9),this['_terrainProviderPromise']['then'](_0x7015e0),this['_map']['terrainProvider']=this['_terrainProviderPromise'];}}register$2('terrain',TerrainLayer);class ArcGisCacheLayer extends BaseTileLayer{async['_createImageryProvider'](_0x1158c9){return await createImageryProvider$j(_0x1158c9);}}async function createImageryProvider$j(_0x4c485a){const _0x1929d6={_0x107007:0x5ee,_0x2b0e5e:0xbb6,_0x24ba89:0xa95},_0xdf97de={_0x4b3f28:0x9cb},_0x10ccee=_0x3d5d32;_0x4c485a['url']=_0x4c485a[_0x10ccee(_0x1929d6._0x107007)][_0x10ccee(_0x1929d6._0x2b0e5e)]('{x}','C{arc_x}')['replace']('{y}','R{arc_y}')['replace']('{z}','L{arc_z}');const _0x670858=_0x4c485a['upperCase'];return _0x4c485a[_0x10ccee(_0x1929d6._0x24ba89)]=_0x4c485a['customTags']||{},_0x4c485a[_0x10ccee(_0x1929d6._0x24ba89)]['arc_x']=function(_0x3ba6be,_0x3a5b5c,_0x4ecaf6,_0x10d565){return _0x670858?padLeft0(_0x3a5b5c['toString'](0x10),0x8)['toUpperCase']():padLeft0(_0x3a5b5c['toString'](0x10),0x8);},_0x4c485a[_0x10ccee(0xa95)]['arc_y']=function(_0x3c7777,_0x2645e5,_0xcb9bda,_0xa54eab){return _0x670858?padLeft0(_0xcb9bda['toString'](0x10),0x8)['toUpperCase']():padLeft0(_0xcb9bda['toString'](0x10),0x8);},_0x4c485a['customTags']['arc_z']=function(_0x53b080,_0x542b79,_0x4f92c9,_0x486c1d){const _0x3c93e4=_0x10ccee;return _0x670858?padLeft0(_0x486c1d['toString'](),0x2)[_0x3c93e4(_0xdf97de._0x4b3f28)]():padLeft0(_0x486c1d['toString'](),0x2);},_0x4c485a['customTags']['arc_z4490']=function(_0x269ab7,_0x177753,_0x4b2717,_0x27f8ba){const _0x196067=_0x10ccee;return _0x670858?padLeft0((_0x27f8ba+0x1)[_0x196067(0x4c9)](),0x2)['toUpperCase']():padLeft0((_0x27f8ba+0x1)['toString'](),0x2);},_0x4c485a=converOptions(_0x4c485a),new XyzImageryProvider$1(_0x4c485a);}ArcGisCacheLayer['createImageryProvider']=createImageryProvider$j;const layerType$j='arcgis_cache';register$2(layerType$j,ArcGisCacheLayer),registerImageryProvider(layerType$j,createImageryProvider$j);class ArcGisTileLayer extends BaseTileLayer{async['_createImageryProvider'](_0x3d581b){return await createImageryProvider$i(_0x3d581b);}}async function createImageryProvider$i(_0x2f7e7b){const _0x2adae6={_0x20ecbf:0x5ee,_0x2022ed:0x5ee,_0x46aa88:0x5ee},_0x1d4aa2=_0x3d5d32;_0x2f7e7b=converOptions(_0x2f7e7b);if(isString(_0x2f7e7b['url']))_0x2f7e7b['url']=_0x2f7e7b['url']+'/tile/{z}/{y}/{x}';else _0x2f7e7b[_0x1d4aa2(_0x2adae6._0x20ecbf)]instanceof Cesium__namespace['Resource']&&(_0x2f7e7b[_0x1d4aa2(0x5ee)][_0x1d4aa2(_0x2adae6._0x2022ed)]=_0x2f7e7b[_0x1d4aa2(_0x2adae6._0x46aa88)]['url']+_0x1d4aa2(0x5e7));return new XyzImageryProvider$1(_0x2f7e7b);}ArcGisTileLayer['createImageryProvider']=createImageryProvider$i;const layerType$i='arcgis_tile';register$2(layerType$i,ArcGisTileLayer),registerImageryProvider(layerType$i,createImageryProvider$i);class ArcGisImageryProvider{constructor(_0x43bb89={}){const _0x5932cb={_0x510255:0xc7e,_0x4ab8e5:0xff1,_0x3c2849:0x651},_0x51a35b=_0x3d5d32;this['options']=_0x43bb89;const _0x51a319=Cesium__namespace['Resource']['createIfNeeded'](_0x43bb89['url']);_0x51a319['appendForwardSlash'](),Cesium__namespace[_0x51a35b(0xb84)](_0x43bb89['token'])&&_0x51a319['setQueryParameters']({'token':_0x43bb89[_0x51a35b(0xee0)]}),this['_resource']=_0x51a319,this['_tileDiscardPolicy']=_0x43bb89['tileDiscardPolicy'],this['_tileWidth']=_0x43bb89['tileWidth']??0x100,this['_tileHeight']=_0x43bb89[_0x51a35b(0x495)]??0x100,this['_maximumLevel']=_0x43bb89[_0x51a35b(0xbf4)],this[_0x51a35b(0xd45)]=_0x43bb89['maxTileLevel'],this['_crs']=_0x43bb89['crs'],this[_0x51a35b(0x768)]=_0x43bb89['enablePickFeatures']??!![],this[_0x51a35b(0x651)]=_0x43bb89['usePreCachedTilesIfAvailable']??!![],this['_initTilingSchemeByCrs'](_0x43bb89['crs']||CRS[_0x51a35b(_0x5932cb._0x510255)]),this[_0x51a35b(_0x5932cb._0x4ab8e5)]=new Cesium__namespace['Event'](),this['_ready']=![],this['_readyPromise']=Cesium__namespace['defer'](),this[_0x51a35b(_0x5932cb._0x3c2849)]?this['_requestMetadata']():(this['_ready']=!![],this[_0x51a35b(0xaf2)][_0x51a35b(0xac9)](!![]));}get['url'](){return this['_resource']['_url'];}get['token'](){const _0x3deedb={_0x48467d:0xa1a},_0x33c3b2=_0x3d5d32;return this['_resource'][_0x33c3b2(_0x3deedb._0x48467d)]['token'];}get['proxy'](){return this['_resource']['proxy'];}get['tileWidth'](){return this['_tileWidth'];}get['tileHeight'](){return this['_tileHeight'];}get['maximumLevel'](){return this['_maximumLevel'];}get['minimumLevel'](){return 0x0;}get['tilingScheme'](){return this['_tilingScheme'];}get['rectangle'](){const _0x38330b={_0x2b222f:0x570},_0x4d265c=_0x3d5d32;return this[_0x4d265c(_0x38330b._0x2b222f)];}get[_0x3d5d32(0x2f6)](){return this['_tileDiscardPolicy'];}get['errorEvent'](){const _0x26647e=_0x3d5d32;return this[_0x26647e(0xff1)];}get['ready'](){return this['_ready'];}get['readyPromise'](){const _0x80e0ab=_0x3d5d32;return this[_0x80e0ab(0xaf2)]['promise'];}get['credit'](){return this['_credit'];}get['usingPrecachedTiles'](){const _0x141781=_0x3d5d32;return this[_0x141781(0x651)];}get['hasAlphaChannel'](){return!![];}get['layers'](){return this['options']['layers'];}get['layerDefs'](){const _0x24441f={_0x385a24:0x433},_0x367c54=_0x3d5d32;return this[_0x367c54(_0x24441f._0x385a24)]['layerDefs'];}['_initTilingSchemeByCrs'](_0x5373db){const _0xb45228={_0x394924:0xe3e,_0x59c3c8:0x433,_0x439f14:0x5a3,_0x4c592b:0x5ac,_0xc17d11:0x433,_0xa5d145:0x539},_0x21aa4f=_0x3d5d32;if(_0x5373db===CRS[_0x21aa4f(_0xb45228._0x394924)])return this[_0x21aa4f(0x539)]=this['options'][_0x21aa4f(0x21c)]||new Cesium__namespace['WebMercatorTilingScheme']({'ellipsoid':this[_0x21aa4f(_0xb45228._0x59c3c8)]['ellipsoid']}),this['_rectangle']=this['options']['rectangle']??this['_tilingScheme'][_0x21aa4f(_0xb45228._0x439f14)],!![];else return _0x5373db===CRS[_0x21aa4f(0xc7e)]||_0x5373db===CRS['EPSG4490']?(this['_tilingScheme']=this['options']['tilingScheme']||new Cesium__namespace['GeographicTilingScheme']({'ellipsoid':this['options'][_0x21aa4f(_0xb45228._0x4c592b)]}),this['_rectangle']=this[_0x21aa4f(_0xb45228._0xc17d11)]['rectangle']??this[_0x21aa4f(_0xb45228._0xa5d145)]['rectangle'],!![]):![];}[_0x3d5d32(0x542)](){const _0x1da8b8=_0x3d5d32,_0x1dd5b3=this['_resource'][_0x1da8b8(0x40d)]({'queryParameters':{'f':'json'}});_0x1dd5b3['fetchJsonp']()[_0x1da8b8(0x44d)](_0x55e406=>{this['_metadataSuccess'](_0x55e406);})['catch'](_0x5f55cc=>{this['_metadataFailure'](_0x5f55cc);});}['_metadataSuccess'](_0x1e5666){const _0x1fbe7f={_0x4238c6:0x651,_0x31eda0:0x433,_0x1d674e:0x651,_0x4cef31:0x8f4,_0x42d5b5:0x100c,_0xdd6b74:0x3af,_0x4210ad:0xd9b,_0x13efdf:0x5a3,_0x5e7345:0x1058,_0x2fb0b2:0x470,_0xd1b02b:0xec2},_0x21204d=_0x3d5d32;this['capabilities']=_0x1e5666;if(!Cesium__namespace['defined'](_0x1e5666['tileInfo'])){this['_useTiles']=![];if(!this['options']['crs']){var _0x162ae8;this['_crs']=getCRSByWkid((_0x162ae8=_0x1e5666['spatialReference'])===null||_0x162ae8===void 0x0?void 0x0:_0x162ae8['wkid']),this['_initTilingSchemeByCrs'](this[_0x21204d(0x213)]);}}else{this[_0x21204d(_0x1fbe7f._0x4238c6)]=!![];const _0x2c2aad=_0x1e5666['tileInfo'];this['_tileWidth']=_0x2c2aad['rows'],this['_tileHeight']=_0x2c2aad['cols'];!this[_0x21204d(0x51c)]&&(this['_maximumLevel']=_0x2c2aad['lods']['length']-0x1);if(!this[_0x21204d(_0x1fbe7f._0x31eda0)]['crs']){var _0x29d70b;this['_crs']=getCRSByWkid((_0x29d70b=_0x2c2aad['spatialReference'])===null||_0x29d70b===void 0x0?void 0x0:_0x29d70b['wkid']),this[_0x21204d(_0x1fbe7f._0x1d674e)]=this[_0x21204d(_0x1fbe7f._0x4cef31)](this['_crs']);}this['_useTiles']&&!Cesium__namespace['defined'](this['_tileDiscardPolicy'])&&(this[_0x21204d(_0x1fbe7f._0x42d5b5)]=new Cesium__namespace[(_0x21204d(_0x1fbe7f._0xdd6b74))]({'missingImageUrl':this[_0x21204d(0x69f)](0x0,0x0,this['_maximumLevel'])['url'],'pixelsToCheck':[new Cesium__namespace['Cartesian2'](0x0,0x0),new Cesium__namespace['Cartesian2'](0xc8,0x14),new Cesium__namespace['Cartesian2'](0x14,0xc8),new Cesium__namespace[(_0x21204d(0xb0e))](0x50,0x6e),new Cesium__namespace['Cartesian2'](0xa0,0x82)],'disableCheckIfAllPixelsAreTransparent':!![]}));}let _0x35eb03=_0x1e5666[_0x21204d(_0x1fbe7f._0x4210ad)]||_0x1e5666['extent'];if(!this[_0x21204d(_0x1fbe7f._0x31eda0)][_0x21204d(_0x1fbe7f._0x13efdf)]&&_0x35eb03){var _0x4c3f55,_0x40742d;let _0x5a17f9=this['_crs'];(_0x4c3f55=_0x35eb03)!==null&&_0x4c3f55!==void 0x0&&(_0x40742d=_0x4c3f55['spatialReference'])!==null&&_0x40742d!==void 0x0&&_0x40742d['wkid']&&(_0x5a17f9=getCRSByWkid(_0x35eb03['spatialReference']['wkid']));if(_0x5a17f9){if(_0x5a17f9!==CRS['EPSG4326']&&_0x5a17f9!==CRS['EPSG4490']){const _0x130f52=proj4Trans([_0x35eb03['xmin'],_0x35eb03[_0x21204d(0x470)]],_0x5a17f9),_0x5f41e8=proj4Trans([_0x35eb03['xmax'],_0x35eb03['ymax']],_0x5a17f9);_0x35eb03={'xmin':_0x130f52[0x0],'ymin':_0x130f52[0x1],'xmax':_0x5f41e8[0x0],'ymax':_0x5f41e8[0x1]};}this['_extent']=_0x35eb03,_0x35eb03['xmin']>0x0&&_0x35eb03['xmax']<0xb3&&_0x35eb03['ymin']>0x0&&_0x35eb03[_0x21204d(_0x1fbe7f._0x5e7345)]<0x55&&(this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x35eb03['xmin'],_0x35eb03[_0x21204d(_0x1fbe7f._0x2fb0b2)],_0x35eb03['xmax'],_0x35eb03['ymax']));}}this['_ready']=!![],this['_readyPromise'][_0x21204d(0xac9)](!![]);if(Cesium__namespace[_0x21204d(0xc86)]['reportSuccess'])Cesium__namespace['TileProviderError']['reportSuccess'](this['_metadataError']);else Cesium__namespace[_0x21204d(0xc86)][_0x21204d(_0x1fbe7f._0xd1b02b)]&&Cesium__namespace['TileProviderError'][_0x21204d(0xec2)](this[_0x21204d(0xb98)]);}[_0x3d5d32(0xa4e)](_0x172ba0){const _0x355e91={_0x576b10:0xc86,_0x2cafd1:0xb98,_0x35d77d:0xff1,_0x390426:0x47c},_0x14903e=_0x3d5d32;var _0x4038f6;const _0x5ba64e=_0x14903e(0x6b4)+this[_0x14903e(0x6a9)]['url']+'.';if(Cesium__namespace['TileProviderError'][_0x14903e(0xa96)])this[_0x14903e(0xb98)]=Cesium__namespace[_0x14903e(_0x355e91._0x576b10)]['reportError'](this[_0x14903e(_0x355e91._0x2cafd1)],this,this[_0x14903e(_0x355e91._0x35d77d)],_0x5ba64e,undefined,undefined,undefined,this['_requestMetadata']);else Cesium__namespace['TileProviderError']['handleError']&&(this['_metadataError']=Cesium__namespace['TileProviderError']['handleError'](this[_0x14903e(0xb98)],this,this['_errorEvent'],_0x5ba64e,undefined,undefined,undefined,this['_requestMetadata']));(_0x4038f6=this['_readyPromise'])!==null&&_0x4038f6!==void 0x0&&_0x4038f6['reject']&&this['_readyPromise'][_0x14903e(_0x355e91._0x390426)](new Cesium__namespace['RuntimeError'](_0x5ba64e));}['getTileCredits'](_0x4fc26b,_0x1e8078,_0x13e37e){return undefined;}['requestImage'](_0x1f64eb,_0x36a32e,_0x4de7ff,_0x3e3f4b){const _0x5e1ba9={_0x143431:0x69f},_0x11a763=_0x3d5d32;return Cesium__namespace['ImageryProvider'][_0x11a763(0xeb7)](this,this[_0x11a763(_0x5e1ba9._0x143431)](_0x1f64eb,_0x36a32e,_0x4de7ff,_0x3e3f4b));}[_0x3d5d32(0x69f)](_0x42fe42,_0x7af7cf,_0x2dbf8f,_0x3f4f91){const _0x529152={_0x2065c9:0xd45,_0x4f86d8:0x40d,_0x30de77:0x9ec,_0x1174ff:0x8e1,_0x1e3e03:0x62f,_0x553f77:0x378},_0x4dbc1b=_0x3d5d32;let _0x3d8fbd=this['_useTiles'];_0x3d8fbd&&Cesium__namespace['defined'](this[_0x4dbc1b(_0x529152._0x2065c9)])&&(_0x3d8fbd=_0x2dbf8f{super['_addedHook']();}):super['_addedHook']();}async['_createImageryProvider'](_0x3cda80){return await createImageryProvider$4(_0x3cda80);}['getMetadata'](){const _0x58f233={_0x4440f7:0xe61,_0x4d4676:0x433,_0x56ca18:0x5ee,_0x4c1be0:0x44d},_0xd88f1b={_0x4f3cdd:0x940},_0x2c7445={_0x424938:0xcd4,_0x3795c4:0xefc};return new Promise((_0x15209c,_0x5905d1)=>{const _0x290968=_0x4132;if(this['capabilities']){_0x15209c(this['capabilities']);return;}const _0x7f7a1e={'service':'WMS','request':'GetCapabilities','version':_0x290968(_0x58f233._0x4440f7)};let _0x1f68fb=this[_0x290968(_0x58f233._0x4d4676)][_0x290968(_0x58f233._0x56ca18)];this['options']['templateValues']&&(_0x1f68fb=template(_0x1f68fb,this['options']['templateValues'])),Cesium__namespace['Resource']['fetchXML']({...this['options'],'url':_0x1f68fb,'queryParameters':_0x7f7a1e,'proxy':this[_0x290968(0xb2c)]})[_0x290968(_0x58f233._0x4c1be0)](_0x4273ad=>{const _0x90717a=_0x290968;if(this['isDestroy'])return;if(_0x4273ad){this[_0x90717a(0x972)]=_0x4273ad;try{this[_0x90717a(_0x2c7445._0x424938)](_0x4273ad);}catch(_0x22c933){logInfo('WMS\x20解析GetCapabilities有误',_0x22c933);}}_0x15209c(_0x4273ad),this[_0x90717a(_0x2c7445._0x3795c4)](EventType['loadConfig'],{'capabilities':_0x4273ad});})['catch'](_0x193634=>{const _0x543467=_0x290968;logInfo(_0x543467(_0xd88f1b._0x4f3cdd),_0x193634),_0x15209c(_0x193634);});});}['_initByMetaData'](_0x5e3cb4){const _0x183357={_0x60261c:0x980,_0x58aec9:0x5a3,_0x4d26dd:0x90c,_0x29d50d:0xe8e,_0x384d36:0xd18,_0x35f685:0x570,_0x2952c5:0x525},_0x55ac88=_0x3d5d32;let _0xd8917c=this['options']['layers'];_0xd8917c['indexOf'](':')!==-0x1&&(_0xd8917c=_0xd8917c['split'](':')[0x1]);const _0x2cc639=this['_readChildNode'](_0x5e3cb4,'Layer');if(!_0x2cc639)return;const _0x204f11=this['_readNode'](_0x2cc639,'Layer');if(!_0x204f11)return;for(let _0x3a8d54=0x0,_0x447895=_0x204f11['length'];_0x3a8d54<_0x447895;_0x3a8d54++){const _0x186911=_0x204f11[_0x3a8d54],_0x3c056c=this['_readChildNodeVal'](_0x186911,'Name'),_0x4550e0=this['_readChildNodeVal'](_0x186911,'Title');if(_0x3c056c===_0xd8917c||_0x4550e0===_0xd8917c){const _0x4007c9=this[_0x55ac88(0x361)](_0x186911,'CRS');!this[_0x55ac88(0x433)]['crs']&&_0x4007c9&&(this['options'][_0x55ac88(_0x183357._0x60261c)]=_0x4007c9);const _0x1d7266=this['_readChildNode'](_0x186911,'BoundingBox');if(!this['options'][_0x55ac88(_0x183357._0x58aec9)]&&_0x1d7266){const _0x461b4c=Math[_0x55ac88(0xe8e)](Number(_0x1d7266['getAttribute']('minx')),-0xb4),_0x53c9bf=Math[_0x55ac88(_0x183357._0x4d26dd)](Number(_0x1d7266['getAttribute']('maxx')),0xb4),_0xe6f8de=Math[_0x55ac88(_0x183357._0x29d50d)](Number(_0x1d7266[_0x55ac88(_0x183357._0x384d36)]('miny')),-0x55),_0x1f8322=Math['min'](Number(_0x1d7266['getAttribute']('maxy')),0x55);if(isNaN(_0x461b4c)||isNaN(_0x53c9bf)||isNaN(_0xe6f8de)||isNaN(_0x1f8322))break;const _0x4ef7e7={'xmin':_0x461b4c,'ymin':_0xe6f8de,'xmax':_0x53c9bf,'ymax':_0x1f8322};console['log']('wms\x20extent:',_0x4ef7e7),this['options'][_0x55ac88(0x86b)]=_0x4ef7e7,this[_0x55ac88(_0x183357._0x35f685)]=Cesium__namespace[_0x55ac88(0x756)]['fromDegrees'](_0x4ef7e7[_0x55ac88(_0x183357._0x2952c5)],_0x4ef7e7['ymin'],_0x4ef7e7['xmax'],_0x4ef7e7['ymax']);}break;}}}['_readNode'](_0x2eb5ae,_0x2d5057){const _0x4a8fd3={_0x1967c0:0xb5a,_0x2ab70c:0x3b0},_0x2b4fd9=_0x3d5d32;if(!_0x2eb5ae)return null;let _0x9ecf20=_0x2eb5ae[_0x2b4fd9(_0x4a8fd3._0x1967c0)](_0x2d5057);return(!_0x9ecf20||_0x9ecf20['length']===0x0)&&(_0x9ecf20=_0x2eb5ae['getElementsByTagName'](_0x2b4fd9(_0x4a8fd3._0x2ab70c)+_0x2d5057)),_0x9ecf20;}[_0x3d5d32(0xb61)](_0x5d6003,_0x10acc8){const _0x22b385={_0x479655:0xc84},_0x10d353=_0x3d5d32;if(!_0x5d6003)return null;const _0x3473f1=this['_readNode'](_0x5d6003,_0x10acc8);return _0x3473f1[_0x10d353(_0x22b385._0x479655)]>0x0?_0x3473f1[0x0]:null;}[_0x3d5d32(0x361)](_0x3e15c6,_0x1499ff){const _0x170760=_0x3d5d32;var _0x5cd85a,_0x3cbb4a;if(!_0x3e15c6)return null;let _0x236a98=this['_readChildNode'](_0x3e15c6,_0x1499ff);!_0x236a98&&(_0x236a98=this['_readChildNode'](_0x3e15c6,_0x170760(0x3b0)+_0x1499ff));if((_0x5cd85a=_0x236a98)!==null&&_0x5cd85a!==void 0x0&&_0x5cd85a['innerHTML'])return _0x236a98['innerHTML'];else return(_0x3cbb4a=_0x236a98)!==null&&_0x3cbb4a!==void 0x0&&_0x3cbb4a['getInnerHTML']?_0x236a98['getInnerHTML']():null;}[_0x3d5d32(0xed2)](){const _0x4731f7=_0x3d5d32;if(this[_0x4731f7(0xf80)])return!![];return![];}['bindPopup'](_0x325040,_0x4ad175){const _0x4f15d7={_0x17fc9b:0x874},_0x2c42e4=_0x3d5d32;return this[_0x2c42e4(0xf80)]={'content':_0x325040,'options':_0x4ad175,'layer':this},this[_0x2c42e4(_0x4f15d7._0x17fc9b)](),this;}[_0x3d5d32(0x87c)](){const _0x3e7eb0={_0xb66ae3:0x1040},_0x6efe5=_0x3d5d32;return this[_0x6efe5(_0x3e7eb0._0xb66ae3)](),this['_popupConfig']=null,this;}['closePopup'](){return this['_map']&&this['hasPopup']()&&this['_map']['popup']['close'](null,this),this;}}async function createImageryProvider$4(_0x58608d){const _0xbdf130=_0x3d5d32;return _0x58608d=converOptions(_0x58608d),new Cesium__namespace[(_0xbdf130(0xcf2))](_0x58608d);}WmsLayer['createImageryProvider']=createImageryProvider$4;const layerType$4='wms';register$2(layerType$4,WmsLayer),registerImageryProvider(layerType$4,createImageryProvider$4);class WmtsLayer extends BaseTileLayer{[_0x3d5d32(0x226)](){this['options']['getCapabilities']??!![]?this['getMetadata']()['then'](()=>{super['_addedHook']();}):super['_addedHook']();}async[_0x3d5d32(0x2a3)](_0x153545){const _0xa0be93=_0x3d5d32,_0x539df9=await createImageryProvider$3(_0x153545);if(_0x153545[_0xa0be93(0xdf5)])_0x539df9['pickFeatures']=_0x153545['pickFeatures'];else _0x153545['pickFeaturesUrl']&&(_0x539df9['pickFeatures']=(_0x52af42,_0x216a38,_0x35419b,_0x25b471,_0x4f10e7)=>{return this['pickFeatures'](_0x52af42,_0x216a38,_0x35419b,_0x25b471,_0x4f10e7);});return _0x539df9;}['pickFeatures'](_0x26d332,_0x4eda96,_0x29352a,_0x74b3b1,_0x1c96a2){const _0x10c2c6={_0x489ae4:0x103e,_0x235395:0xcd1,_0x19a087:0x484,_0x544d61:0x548,_0x3cfafb:0x433,_0x56011d:0xb2c},_0x36416d={_0x456fc0:0xe9b,_0x3d3906:0x5a7,_0x2486c0:0xb39,_0x49355c:0x5a7},_0x12433f=_0x3d5d32;var _0x1914fb;if(!this['options']['enablePickFeatures'])return undefined;const _0x5a9769=this['imageryProvider'],_0x1bfcff=new Cesium__namespace[(_0x12433f(0xe95))]();if(_0x5a9769['tilingScheme']['projection']instanceof Cesium__namespace['GeographicProjection'])_0x1bfcff['x']=Cesium__namespace[_0x12433f(_0x10c2c6._0x489ae4)][_0x12433f(0xa1f)](_0x74b3b1),_0x1bfcff['y']=Cesium__namespace['Math']['toDegrees'](_0x1c96a2);else{const _0x98d046=new Cesium__namespace['Cartographic']();_0x98d046['longitude']=_0x74b3b1,_0x98d046['latitude']=_0x1c96a2,_0x5a9769['tilingScheme']['projection']['project'](_0x98d046,_0x1bfcff);}const _0x2d3d38=new Cesium__namespace['Cartesian2'](),_0x57f9f2=_0x5a9769[_0x12433f(0x21c)]['tileXYToNativeRectangle'](_0x26d332,_0x4eda96,_0x29352a,new Cesium__namespace['Rectangle']());_0x2d3d38['x']=_0x5a9769['tileWidth']*(_0x1bfcff['x']-_0x57f9f2[_0x12433f(_0x10c2c6._0x235395)])/_0x57f9f2[_0x12433f(0x1076)]|0x0,_0x2d3d38['y']=_0x5a9769['tileHeight']*(_0x57f9f2['north']-_0x1bfcff['y'])/_0x57f9f2['height']|0x0;const _0x50e8c5={...this[_0x12433f(0x433)]['getFeatureInfoParameters']||{},'service':'WMS','version':_0x12433f(_0x10c2c6._0x19a087),'request':'GetFeatureInfo','layers':this['options']['layer'],'query_layers':this['options'][_0x12433f(_0x10c2c6._0x544d61)],'info_format':'application/json','srs':this['options']['crs']??(((_0x1914fb=this[_0x12433f(_0x10c2c6._0x3cfafb)]['tilingScheme'])===null||_0x1914fb===void 0x0?void 0x0:_0x1914fb['projection'])instanceof Cesium__namespace[_0x12433f(0x289)]?_0x12433f(0x99f):_0x12433f(0x853)),'bbox':_0x57f9f2['west']+','+_0x57f9f2['south']+','+_0x57f9f2[_0x12433f(0x5d7)]+','+_0x57f9f2['north'],'width':_0x5a9769['tileWidth'],'height':_0x5a9769['tileHeight'],'x':_0x2d3d38['x'],'y':_0x2d3d38['y']};return fetchJson({...this[_0x12433f(_0x10c2c6._0x3cfafb)],'url':this['options']['pickFeaturesUrl'],'queryParameters':_0x50e8c5,'proxy':this[_0x12433f(_0x10c2c6._0x56011d)]})['then'](_0x399446=>{const _0x1c7782=_0x12433f,_0xe85ff2=[],_0x542894=_0x399446[_0x1c7782(0x7ab)];for(let _0x311fe7=0x0;_0x311fe7<_0x542894['length'];++_0x311fe7){const _0x1559a9=_0x542894[_0x311fe7],_0x48c5fb=new Cesium__namespace[(_0x1c7782(0x488))]();_0x48c5fb[_0x1c7782(_0x36416d._0x456fc0)]=_0x1559a9,_0x48c5fb['properties']=_0x1559a9['properties'],_0x48c5fb['configureNameFromProperties'](_0x1559a9['properties']),_0x48c5fb['configureDescriptionFromProperties'](_0x1559a9[_0x1c7782(0x271)]);if(Cesium__namespace['defined'](_0x1559a9[_0x1c7782(_0x36416d._0x3d3906)])&&_0x1559a9['geometry']['type']===_0x1c7782(_0x36416d._0x2486c0)){const _0x51ee30=_0x1559a9['geometry']['coordinates'][0x0],_0x1a6624=_0x1559a9[_0x1c7782(_0x36416d._0x49355c)]['coordinates'][0x1];_0x48c5fb['position']=Cesium__namespace['Cartographic']['fromDegrees'](_0x51ee30,_0x1a6624);}_0xe85ff2['push'](_0x48c5fb);}return _0xe85ff2;});}['getMetadata'](){const _0x3c36ac={_0x58abfe:0x413,_0x4046fd:0x433};return new Promise((_0x5dbf9b,_0x3327e1)=>{const _0x48f00f={_0x275968:0xcd4,_0x4bb087:0xefc},_0x245047=_0x4132;if(this[_0x245047(0x972)]){_0x5dbf9b(this[_0x245047(0x972)]);return;}const _0x358b68={'service':'WMTS','request':'GetCapabilities','version':'1.0.0'};Cesium__namespace[_0x245047(_0x3c36ac._0x58abfe)]['fetchXML']({...this[_0x245047(_0x3c36ac._0x4046fd)],'queryParameters':_0x358b68,'proxy':this['_proxy']})['then'](_0x456230=>{const _0x29cc72=_0x245047;if(this['isDestroy'])return;if(_0x456230){this['capabilities']=_0x456230;try{this[_0x29cc72(_0x48f00f._0x275968)](_0x456230);}catch(_0x14c245){logInfo('解析GetCapabilities出错',_0x14c245);}}_0x5dbf9b(_0x456230),this[_0x29cc72(_0x48f00f._0x4bb087)](EventType['loadConfig'],{'capabilities':_0x456230});})['catch'](_0x52eda3=>{logInfo('WMTS\x20GetCapabilities请求出错',_0x52eda3),_0x5dbf9b(_0x52eda3);});});}['_initByMetaData'](_0x397ac8){const _0x2f5fc9={_0x3226a6:0x86b,_0x5bed1b:0x1058,_0x29397f:0xa38,_0x1962c0:0xb84,_0x1faac1:0xb5a,_0x708394:0xd08},_0x3de384=_0x3d5d32,_0x55bb48=this['_readChildNode'](_0x397ac8,'Contents');if(!_0x55bb48)return;const _0x1c5b17=this[_0x3de384(0xabb)](_0x55bb48,'Layer');if(!_0x1c5b17)return;for(let _0x3ce0fa=0x0,_0x36a386=_0x1c5b17['length'];_0x3ce0fa<_0x36a386;_0x3ce0fa++){const _0x3b35a4=_0x1c5b17[_0x3ce0fa],_0x526ea2=this['_readChildNodeVal'](_0x3b35a4,'ows:Identifier');if(_0x526ea2===this['options']['layer']){const _0x28a1b7=this['_readChildNode'](_0x3b35a4,'ows:WGS84BoundingBox');if(!this['options']['rectangle']&&_0x28a1b7){let _0x1fdf02=this[_0x3de384(0x361)](_0x28a1b7,'ows:LowerCorner'),_0x258dfb=this[_0x3de384(0x361)](_0x28a1b7,'ows:UpperCorner');if(_0x1fdf02&&_0x258dfb){_0x1fdf02=_0x1fdf02['split']('\x20'),_0x258dfb=_0x258dfb[_0x3de384(0xdaa)]('\x20');const _0x240acf=Math['max'](Number(_0x1fdf02[0x0]),-0xb4),_0x5b73ac=Math['min'](Number(_0x258dfb[0x0]),0xb4),_0x2a7992=Math[_0x3de384(0xe8e)](Number(_0x1fdf02[0x1]),-0x55),_0x15fa84=Math['min'](Number(_0x258dfb[0x1]),0x55),_0x1d39e5={'xmin':_0x240acf,'ymin':_0x2a7992,'xmax':_0x5b73ac,'ymax':_0x15fa84};this['options'][_0x3de384(_0x2f5fc9._0x3226a6)]=_0x1d39e5,this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x1d39e5['xmin'],_0x1d39e5[_0x3de384(0x470)],_0x1d39e5['xmax'],_0x1d39e5[_0x3de384(_0x2f5fc9._0x5bed1b)]);}}!Cesium__namespace['defined'](this['options']['style'])&&(this['options'][_0x3de384(0xdde)]=this['_readChildNodeVal'](this['_readChildNode'](_0x3b35a4,_0x3de384(_0x2f5fc9._0x29397f)),_0x3de384(0xa6f)));const _0x4ae068=_0x3b35a4['getElementsByTagName']('TileMatrixSetLink');for(let _0x11de47=0x0,_0x14e6c0=_0x4ae068['length'];_0x11de47<_0x14e6c0;_0x11de47++){const _0x71b4b5=_0x4ae068[_0x11de47],_0x18b198=this['_readChildNodeVal'](_0x71b4b5,'TileMatrixSet');!Cesium__namespace[_0x3de384(_0x2f5fc9._0x1962c0)](this['options'][_0x3de384(0x969)])&&(this['options']['tileMatrixSetID']=_0x18b198);if(_0x18b198===this['options']['tileMatrixSetID']){if(!this['options']['tileMatrixLabels']){const _0x9896a6=this[_0x3de384(0xb61)](_0x71b4b5,'TileMatrixSetLimits');if(_0x9896a6){const _0x16905c=_0x9896a6[_0x3de384(_0x2f5fc9._0x1faac1)]('TileMatrixLimits'),_0x169e19=[];for(let _0x5cc3a2=0x0,_0x4a1b10=_0x16905c['length'];_0x5cc3a2<_0x4a1b10;_0x5cc3a2++){const _0x58fdc1=this['_readChildNodeVal'](_0x16905c[_0x5cc3a2],_0x3de384(_0x2f5fc9._0x708394));_0x169e19['push'](_0x58fdc1);}this['options']['tileMatrixLabels']=_0x169e19;}}break;}}break;}}}['_readNode'](_0x1de257,_0x1bb46a){const _0x599e6c={_0x4e5803:0xb5a},_0xb63ae9=_0x3d5d32;if(!_0x1de257)return null;let _0x2febe5=_0x1de257['getElementsByTagName'](_0x1bb46a);return(!_0x2febe5||_0x2febe5['length']===0x0)&&(_0x2febe5=_0x1de257[_0xb63ae9(_0x599e6c._0x4e5803)]('wmts:'+_0x1bb46a)),_0x2febe5;}['_readChildNode'](_0x574ffe,_0x55e873){const _0x457545={_0x32891a:0xc84},_0x39bcc1=_0x3d5d32;if(!_0x574ffe)return null;const _0x3830eb=this['_readNode'](_0x574ffe,_0x55e873);return _0x3830eb[_0x39bcc1(_0x457545._0x32891a)]>0x0?_0x3830eb[0x0]:null;}['_readChildNodeVal'](_0x15d337,_0x3adf4d){const _0x460fe9={_0x5a8678:0xb61,_0x3ef9dd:0xb61,_0x3b6a1f:0xae5,_0x5bd422:0xae5},_0x13adb6=_0x3d5d32;var _0x2d8947,_0x499765;if(!_0x15d337)return null;let _0x194c6b=this[_0x13adb6(_0x460fe9._0x5a8678)](_0x15d337,_0x3adf4d);!_0x194c6b&&(_0x194c6b=this[_0x13adb6(_0x460fe9._0x3ef9dd)](_0x15d337,'wmts:'+_0x3adf4d));if((_0x2d8947=_0x194c6b)!==null&&_0x2d8947!==void 0x0&&_0x2d8947[_0x13adb6(_0x460fe9._0x3b6a1f)])return _0x194c6b[_0x13adb6(_0x460fe9._0x5bd422)];else return(_0x499765=_0x194c6b)!==null&&_0x499765!==void 0x0&&_0x499765['getInnerHTML']?_0x194c6b['getInnerHTML']():null;}}async function createImageryProvider$3(_0x36e7f8){return _0x36e7f8=converOptions(_0x36e7f8),_0x36e7f8['crs']===CRS['EPSG4490']&&(_0x36e7f8['tileMatrixLabels']=[...Array(0x14)['keys']()]['map'](_0x9679f9=>(_0x9679f9+0x1)['toString']())),new Cesium__namespace['WebMapTileServiceImageryProvider'](_0x36e7f8);}WmtsLayer['createImageryProvider']=createImageryProvider$3;const layerType$3='wmts';register$2(layerType$3,WmtsLayer),registerImageryProvider(layerType$3,createImageryProvider$3);class XyzLayer extends BaseTileLayer{async['_createImageryProvider'](_0x44932e){return await createImageryProvider$2(_0x44932e);}}async function createImageryProvider$2(_0x30ba59){const _0x3a2176=_0x3d5d32;return _0x30ba59=converOptions(_0x30ba59),_0x30ba59['chinaCRS']===ChinaCRS[_0x3a2176(0xf73)]?new BaiduImageryProvider(_0x30ba59):new XyzImageryProvider$1(_0x30ba59);}XyzLayer['createImageryProvider']=createImageryProvider$2;const layerType$2='xyz';register$2(layerType$2,XyzLayer),registerImageryProvider(layerType$2,createImageryProvider$2);class GridLayer extends BaseTileLayer{async[_0x3d5d32(0x2a3)](_0x99b4c0){return await createImageryProvider$1(_0x99b4c0);}}async function createImageryProvider$1(_0x510d95){const _0x385afc={_0x2be14a:0xe8f,_0x16a468:0x7e3,_0x56f9dc:0xe57},_0x30ae47=_0x3d5d32;return _0x510d95[_0x30ae47(0xe76)]=_0x510d95['cells']??0x2,_0x510d95[_0x30ae47(_0x385afc._0x2be14a)]=Cesium__namespace['Color']['fromCssColorString'](_0x510d95['color']??'rgba(255,255,255,1)'),_0x510d95['glowWidth']=_0x510d95['glowWidth']??0x3,_0x510d95['glowColor']?_0x510d95['glowColor']=Cesium__namespace['Color']['fromCssColorString'](_0x510d95[_0x30ae47(_0x385afc._0x16a468)]):_0x510d95[_0x30ae47(0x7e3)]=_0x510d95['color'][_0x30ae47(_0x385afc._0x56f9dc)](0.3),_0x510d95['backgroundColor']=Cesium__namespace['Color']['fromCssColorString'](_0x510d95[_0x30ae47(0xd6e)]??'rgba(0,0,0,0)'),_0x510d95=converOptions(_0x510d95),new Cesium__namespace['GridImageryProvider'](_0x510d95);}GridLayer[_0x3d5d32(0xd51)]=createImageryProvider$1;const layerType$1='grid';register$2(layerType$1,GridLayer),registerImageryProvider(layerType$1,createImageryProvider$1);class TileInfoLayer extends BaseTileLayer{async['_createImageryProvider'](_0x14d225){return await createImageryProvider(_0x14d225);}}async function createImageryProvider(_0x3ff225){const _0x27422d={_0x55fa72:0xe8f},_0x4408ad=_0x3d5d32;return _0x3ff225['color']=Cesium__namespace['Color']['fromCssColorString'](_0x3ff225[_0x4408ad(_0x27422d._0x55fa72)]||'rgba(255,0,0,1)'),_0x3ff225=converOptions(_0x3ff225),new Cesium__namespace['TileCoordinatesImageryProvider'](_0x3ff225);}TileInfoLayer['createImageryProvider']=createImageryProvider;const layerType=_0x3d5d32(0x687);register$2(layerType,TileInfoLayer),registerImageryProvider(layerType,createImageryProvider);class EmptyTileLayer extends BaseTileLayer{constructor(_0x5f5290={}){super(_0x5f5290),this['_minimumLevel']=_0x5f5290['minimumLevel']??0x0,this['_maximumLevel']=_0x5f5290['maximumLevel'];}async['_createImageryProvider'](_0x3672e8){const _0x33b856={_0x32cd3f:0x8ad,_0x551983:0x324},_0x4a0a0f=_0x3d5d32;return _0x3672e8=converOptions(_0x3672e8),_0x3672e8[_0x4a0a0f(_0x33b856._0x32cd3f)]=this[_0x4a0a0f(_0x33b856._0x551983)],_0x3672e8['maximumTerrainLevel']=this['_maximumLevel'],new EmptyImageryProvider(_0x3672e8);}['_setOptionsHook'](_0x2cdfa9,_0x197311){const _0x572b6a={_0x14d726:0x51c,_0x2eabc8:0x51c,_0x384ee4:0xd4c},_0xfd7271=_0x3d5d32;this['_minimumLevel']=this['options']['minimumLevel']??0x0,this[_0xfd7271(_0x572b6a._0x14d726)]=this['options'][_0xfd7271(0xbf4)],this['options']['minimumTerrainLevel']=this[_0xfd7271(0x324)],this['options']['maximumTerrainLevel']=this[_0xfd7271(_0x572b6a._0x2eabc8)],super[_0xfd7271(_0x572b6a._0x384ee4)](_0x2cdfa9,_0x197311);}['isInRange'](_0xc6f1a1){const _0x5cff43=this['_map']['level'];return _0xc6f1a1=this['_maximumLevel']?![]:!![];}['isAllOutRange'](_0x530775){const _0x10a4a8={_0x209d3e:0xb84,_0x46f3f0:0x51c},_0x199c1f=_0x3d5d32,_0x379183=this['_map']['level'];return _0x379183=this[_0x199c1f(_0x10a4a8._0x46f3f0)];}}new Cesium__namespace['Color'](0x0,0x0,0x0,0.01);function config2Entity(_0x442463,_0x370f35,_0x483b08){for(let _0x2c3c8e=_0x442463['length']-0x1;_0x2c3c8e>=0x0;_0x2c3c8e--){const _0x2dee97=_0x442463[_0x2c3c8e],_0x74b6d7=_0x370f35['symbol'];_0x74b6d7&&(typeof _0x74b6d7==='function'?_0x74b6d7(_0x2dee97,_0x2dee97['_attr']):setConfigSymbol(_0x2dee97,_0x370f35,_0x483b08));}return _0x442463;}function getStyleBySymbolConfig(_0x1eee3c,_0x211bed,_0x473b71){const _0x4fed94={_0x3b68af:0x3cc},_0x5ac4e2=_0x3d5d32;let _0x156afa=_0x1eee3c['styleOptions'];if(_0x1eee3c['styleField']&&_0x211bed){const _0x3cd27b=_0x211bed[_0x1eee3c['styleField']],_0x4a0e42=_0x1eee3c['styleFieldOptions'][_0x3cd27b];_0x4a0e42!=null&&(_0x156afa=clone(_0x156afa),_0x156afa={..._0x156afa,..._0x4a0e42});}if(typeof _0x1eee3c['callback']===_0x5ac4e2(_0x4fed94._0x3b68af)){_0x156afa=clone(_0x156afa);const _0x4fc7c5=_0x1eee3c['callback'](_0x211bed,_0x473b71,_0x156afa);_0x4fc7c5&&(_0x156afa={..._0x156afa,..._0x4fc7c5});}return _0x156afa=_0x156afa||{},_0x156afa;}function setConfigSymbol(_0x1743bc,_0x5610f1,_0x5428f3){const _0x2c95be={_0x16c3ea:0xfe4,_0x194d1b:0xba5,_0x574b5e:0x650,_0x168440:0x83d,_0xc4a65e:0x96e,_0xd45b6a:0x76b,_0x454b3d:0xec4,_0x178cc6:0x32a,_0x3f1338:0x32a,_0x4e17de:0x27d,_0x306e47:0xe25,_0x2443df:0x576,_0x87413b:0x485,_0x2f29d6:0x83d,_0x301a2d:0xec4,_0x5697a2:0x32a,_0x511462:0x600,_0x4fcaa5:0xff3,_0x560043:0xbbe,_0x44b049:0x68a,_0xfba862:0xec4,_0x185e6b:0xb69},_0x395c91={_0x2c56a2:0x83d,_0x4e33ea:0xe20},_0x535079=_0x3d5d32;let _0x44ed9f=_0x1743bc[_0x535079(_0x2c95be._0x16c3ea)];_0x44ed9f&&_0x44ed9f['type']&&_0x44ed9f[_0x535079(0xe12)]&&(_0x44ed9f=_0x44ed9f['attr']);const _0x13cfae=_0x1743bc[_0x535079(_0x2c95be._0x194d1b)],_0x5b1ced=getStyleBySymbolConfig(_0x5610f1['symbol'],_0x44ed9f,_0x1743bc);function _0xadc674(_0x3481ba,_0x30fea3,_0x467957){const _0x5596a5=_0x535079;if(_0x30fea3['text']==='')return null;Cesium__namespace['defined'](_0x30fea3[_0x5596a5(0x83e)])&&(_0x3481ba=setPositionsHeight(_0x3481ba,_0x30fea3['height']));const _0x26f3d6=_0x13cfae[_0x5596a5(0xff3)]({'position':_0x3481ba,'label':_0x30fea3,'_attr':_0x467957});return _0x26f3d6;}_0x5428f3=_0x5428f3||_0xadc674;if(_0x1743bc['polyline']){PolylineStyleConver['toCesiumVal'](_0x5b1ced,_0x1743bc['polyline'],!![]);if(_0x5b1ced['corridor']){const _0x42cc4f={'color':_0x5b1ced['color'],'opacity':_0x5b1ced['opacity'],..._0x5b1ced['corridor']};isString(_0x5b1ced['corridor']['width'])&&(_0x42cc4f['width']=template(_0x5b1ced['corridor']['width'],_0x44ed9f));if(_0x1743bc[_0x535079(_0x2c95be._0x574b5e)])CorridorStyleConver['toCesiumVal'](_0x42cc4f,_0x1743bc[_0x535079(0x650)][_0x535079(0xc71)],!![]);else{const _0x2524f9=CorridorStyleConver[_0x535079(_0x2c95be._0x168440)](_0x42cc4f,{},!![]);_0x2524f9['positions']=getCesiumValue(_0x1743bc[_0x535079(_0x2c95be._0xc4a65e)]['positions']);const _0x1856c2=_0x13cfae['add']({'corridor':_0x2524f9,'_attr':_0x44ed9f});_0x1856c2['_mars3d_layerId']=_0x5610f1['id'],_0x1743bc['_corridorEx']=_0x1856c2;}}if(_0x5b1ced['label']&&_0x5b1ced['label'][_0x535079(_0x2c95be._0xd45b6a)]){if(_0x1743bc['_labelEx'])LabelStyleConver[_0x535079(0x83d)](_0x5b1ced['label'],_0x1743bc[_0x535079(_0x2c95be._0x454b3d)]['label'],_0x44ed9f);else{const _0x234967=getCesiumValue(_0x1743bc['polyline']['positions']);let _0x55dc7c=_0x234967[Math['floor'](_0x234967['length']/0x2)];if(_0x5b1ced['label']['position']){if(_0x5b1ced[_0x535079(_0x2c95be._0x178cc6)]['position']===_0x535079(0xe72))_0x55dc7c=centerOfMass(_0x234967,_0x5b1ced['label']['height']);else isNumber(_0x5b1ced['label']['position'])&&(_0x55dc7c=_0x234967[_0x5b1ced['label']['position']]);}const _0x195da5=LabelStyleConver['toCesiumVal'](_0x5b1ced[_0x535079(_0x2c95be._0x3f1338)],{},_0x44ed9f);_0x195da5['heightReference']=_0x195da5[_0x535079(_0x2c95be._0x4e17de)]??Cesium__namespace['HeightReference'][_0x535079(_0x2c95be._0x306e47)];const _0x62d599=_0x5428f3(_0x55dc7c,_0x195da5,_0x44ed9f);_0x62d599&&(_0x62d599['_mars3d_layerId']=_0x5610f1['id']),_0x1743bc['_labelEx']=_0x62d599;}}}if(_0x1743bc['polygon']){var _0x403edc;PolygonStyleConver['toCesiumVal'](_0x5b1ced,_0x1743bc['polygon'],!![]);if(_0x5b1ced['outline']&&(_0x5b1ced['outlineWidth']>0x1||((_0x403edc=_0x5b1ced[_0x535079(0x576)])===null||_0x403edc===void 0x0?void 0x0:_0x403edc['width'])>0x1)){_0x1743bc['polygon']['outline']=![];const _0x5f58ea={..._0x5b1ced,'outline':![],'color':_0x5b1ced['outlineColor'],'width':_0x5b1ced['outlineWidth'],'opacity':_0x5b1ced['outlineOpacity'],..._0x5b1ced[_0x535079(_0x2c95be._0x2443df)]||{}};if(_0x1743bc['_outlineEx'])for(let _0x4386dd=0x0,_0x3d2d66=_0x1743bc[_0x535079(_0x2c95be._0x87413b)]['length'];_0x4386dd<_0x3d2d66;_0x4386dd++){PolylineStyleConver['toCesiumVal'](_0x5f58ea,_0x1743bc[_0x535079(_0x2c95be._0x87413b)][_0x4386dd]['polyline'],!![]);}else{const _0x8b9657=getAllPositions(_0x1743bc);_0x1743bc['_outlineEx']=[];for(let _0x79e885=0x0,_0x46f7c3=_0x8b9657[_0x535079(0xc84)];_0x79e885<_0x46f7c3;_0x79e885++){const _0x32a5bb=PolylineStyleConver[_0x535079(_0x2c95be._0x2f29d6)](_0x5f58ea,{},!![]);_0x32a5bb['positions']=_0x8b9657[_0x79e885];const _0x4ab43e=_0x13cfae['add']({'polyline':_0x32a5bb,'_attr':_0x44ed9f});_0x4ab43e['_mars3d_layerId']=_0x5610f1['id'],_0x1743bc['_outlineEx']['push'](_0x4ab43e);}}}if(_0x5b1ced['label']&&_0x5b1ced['label']['text']){if(_0x1743bc[_0x535079(_0x2c95be._0x301a2d)])LabelStyleConver['toCesiumVal'](_0x5b1ced['label'],_0x1743bc['_labelEx'][_0x535079(_0x2c95be._0x5697a2)],_0x44ed9f);else{const _0x2c6ef4=centerOfMass(getPositions(_0x1743bc),_0x5b1ced['label']['height']),_0x225f69=LabelStyleConver[_0x535079(_0x2c95be._0x168440)](_0x5b1ced['label'],{},_0x44ed9f);_0x225f69['heightReference']=_0x225f69['heightReference']??Cesium__namespace['HeightReference'][_0x535079(0xe25)];const _0x43aacc=_0x5428f3(_0x2c6ef4,_0x225f69,_0x44ed9f);_0x43aacc&&(_0x43aacc[_0x535079(0xe20)]=_0x5610f1['id']),_0x1743bc['_labelEx']=_0x43aacc;}}}_0x1743bc['label']?(_0x5b1ced['label']=_0x5b1ced['label']||_0x5b1ced||{},!Cesium__namespace['defined'](_0x5b1ced['label'][_0x535079(0x7c0)])&&!Cesium__namespace['defined'](_0x5b1ced[_0x535079(_0x2c95be._0x178cc6)]['heightReference'])&&(_0x5b1ced[_0x535079(_0x2c95be._0x178cc6)]['heightReference']=_0x5b1ced['label'][_0x535079(_0x2c95be._0x4e17de)]??Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']),LabelStyleConver[_0x535079(_0x2c95be._0x168440)](_0x5b1ced[_0x535079(_0x2c95be._0x3f1338)],_0x1743bc[_0x535079(0x32a)],_0x44ed9f)):_0x5b1ced[_0x535079(_0x2c95be._0x178cc6)]&&typeof _0x5b1ced[_0x535079(0x32a)]===_0x535079(0x3cc)&&_0x5b1ced['label'](_0x1743bc,_0x44ed9f,function(_0x4cc567,_0x434e47){const _0x1fbcc9=_0x535079,_0x386768=LabelStyleConver[_0x1fbcc9(_0x395c91._0x2c56a2)](_0x434e47,{},_0x44ed9f);_0x386768['heightReference']=(_0x386768['heightReference'],Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']);const _0x315431=_0x5428f3(_0x4cc567,_0x386768,_0x44ed9f);_0x315431&&(_0x315431[_0x1fbcc9(_0x395c91._0x4e33ea)]=_0x5610f1['id']);});if(_0x1743bc['billboard']){!Cesium__namespace['defined'](_0x5b1ced[_0x535079(0x7c0)])&&!Cesium__namespace['defined'](_0x5b1ced['heightReference'])&&(_0x5b1ced['heightReference']=_0x5b1ced['heightReference']??Cesium__namespace[_0x535079(0x2d5)]['CLAMP_TO_GROUND']);_0x5b1ced['image']=template(_0x5b1ced['image'],_0x44ed9f),BillboardStyleConver['toCesiumVal'](_0x5b1ced,_0x1743bc['billboard'],!![]);if(_0x5b1ced['model']){if(_0x1743bc['_modelEx'])ModelStyleConver['toCesiumVal'](_0x5b1ced[_0x535079(_0x2c95be._0x511462)],_0x1743bc['_modelEx']['model'],!![]);else{const _0x3bb4bb=ModelStyleConver['toCesiumVal'](_0x5b1ced['model'],!![]);_0x3bb4bb['heightReference']=(_0x3bb4bb['heightReference'],Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']);const _0x5be36d=_0x13cfae[_0x535079(_0x2c95be._0x4fcaa5)]({'position':_0x1743bc['position'],'model':_0x3bb4bb,'_attr':_0x44ed9f});_0x5be36d['_mars3d_layerId']=_0x5610f1['id'],_0x1743bc['_modelEx']=_0x5be36d;}}if(_0x5b1ced[_0x535079(_0x2c95be._0x560043)]){if(_0x1743bc['_pointEx'])PointStyleConver['toCesiumVal'](_0x5b1ced['point'],_0x1743bc[_0x535079(_0x2c95be._0x44b049)]['point'],!![]);else{const _0x47d428=PointStyleConver['toCesiumVal'](_0x5b1ced['point'],{},!![]);_0x47d428['heightReference']=_0x47d428['heightReference']??Cesium__namespace[_0x535079(0x2d5)]['CLAMP_TO_GROUND'];const _0x4eca7b=_0x13cfae['add']({'position':_0x1743bc['position'],'point':_0x47d428,'_attr':_0x44ed9f});_0x4eca7b['_mars3d_layerId']=_0x5610f1['id'],_0x1743bc['_pointEx']=_0x4eca7b;}}if(_0x5b1ced[_0x535079(0x32a)]&&_0x5b1ced['label'][_0x535079(_0x2c95be._0xd45b6a)]&&!_0x1743bc['label']){if(_0x1743bc['_labelEx'])LabelStyleConver['toCesiumVal'](_0x5b1ced['label'],_0x1743bc[_0x535079(_0x2c95be._0xfba862)]['label'],_0x44ed9f);else{const _0x4d2b50=_0x1743bc[_0x535079(_0x2c95be._0x185e6b)],_0x2eba54=LabelStyleConver[_0x535079(0x83d)](_0x5b1ced['label'],{},_0x44ed9f);_0x2eba54['heightReference']=_0x2eba54['heightReference']??Cesium__namespace['HeightReference']['CLAMP_TO_GROUND'];const _0x51829e=_0x5428f3(_0x4d2b50,_0x2eba54,_0x44ed9f);_0x51829e&&(_0x51829e['_mars3d_layerId']=_0x5610f1['id']),_0x1743bc['_labelEx']=_0x51829e;}}}_0x1743bc['styleOpt']=_0x5b1ced;}class CzmGeoJsonLayer extends BaseGraphicLayer{constructor(_0x412674={}){const _0x45ab2a=_0x3d5d32;super(_0x412674),this[_0x45ab2a(0xd4c)](_0x412674,_0x412674);}get[_0x3d5d32(0x548)](){return this['_dataSource'];}get['entities'](){return this['_dataSource']?this['_dataSource']['entities']:null;}get[_0x3d5d32(0x6e2)](){const _0x429a12=_0x3d5d32;return!this['_labelCollection']&&(this['_labelCollection']=new Cesium__namespace['LabelCollection']({'scene':this['_map']['scene']}),this['_state']===State['ADDED']&&this['_map'][_0x429a12(0xfc1)]['primitives']['add'](this['_labelCollection'])),this['_labelCollection'];}get['hasZIndex'](){return!![];}get[_0x3d5d32(0x377)](){return this['options']['zIndex'];}set['zIndex'](_0x337c46){const _0x3eef64={_0x2294c9:0xeab,_0x17f9b5:0x1d1,_0x3c6df9:0x40a},_0x2745d6=_0x3d5d32;this['options']['zIndex']=_0x337c46;if(this[_0x2745d6(_0x3eef64._0x2294c9)]==null||_0x337c46==null)return;if(!this[_0x2745d6(_0x3eef64._0x17f9b5)]['dataSources']['contains'](this['_dataSource']))return;this['_dataSource']['zIndex']=_0x337c46,this['_map']['dataSources']['raiseToTop'](this['_dataSource']);const _0x210110=this[_0x2745d6(0x1d1)][_0x2745d6(0x926)];for(let _0x448232=_0x210110['length']-0x1;_0x448232>=0x0;_0x448232--){const _0x5ba7e5=_0x210110[_0x2745d6(_0x3eef64._0x3c6df9)](_0x448232);if(_0x5ba7e5===this['_dataSource'])continue;Cesium__namespace['defined'](_0x5ba7e5['zIndex'])&&_0x337c46<_0x5ba7e5['zIndex']&&this[_0x2745d6(_0x3eef64._0x17f9b5)]['dataSources'][_0x2745d6(0xdbc)](this['_dataSource']);}}get['clampToGround'](){const _0x532139={_0x451670:0x63d},_0x5c04da=_0x3d5d32;if(this['options']['clampToGround'])return!![];if(this['options']['symbol']&&this['options'][_0x5c04da(_0x532139._0x451670)]['styleOptions']&&this['options']['symbol']['styleOptions'][_0x5c04da(0x7c0)])return!![];return![];}['_setOptionsHook'](_0x3424cc,_0x2adffe){const _0x49f30e={_0x58f574:0xb84,_0x630d16:0x433,_0x1427c4:0xe8b},_0x467973=_0x3d5d32;var _0x42f753;super['_setOptionsHook'](_0x3424cc,_0x2adffe);if((_0x42f753=this['options']['symbol'])!==null&&_0x42f753!==void 0x0&&_0x42f753['styleOptions']){const _0x5d96ed=this['options']['symbol']['styleOptions'];Cesium__namespace[_0x467973(_0x49f30e._0x58f574)](_0x5d96ed[_0x467973(0x7c0)])&&(this[_0x467973(_0x49f30e._0x630d16)]['clampToGround']=_0x5d96ed['clampToGround']);if(Cesium__namespace['defined'](_0x5d96ed['color'])){const _0x4257f8=Cesium__namespace['Color']['fromCssColorString'](_0x5d96ed['color']??'#FFFF00')['withAlpha'](Number(_0x5d96ed['opacity']??0.5));this['options']['fill']=_0x4257f8;}if(Cesium__namespace['defined'](_0x5d96ed['outlineColor'])){const _0x2af011=Cesium__namespace['Color']['fromCssColorString'](_0x5d96ed['outlineColor']??_0x5d96ed['color']??'#FFFFFF')['withAlpha'](_0x5d96ed['outlineOpacity']??(_0x5d96ed['opacity'],0x1));this['options']['stroke']=_0x2af011;}Cesium__namespace['defined'](_0x5d96ed['outlineWidth'])&&(this['options'][_0x467973(_0x49f30e._0x1427c4)]=_0x5d96ed['outlineWidth']);}}['_showHook'](_0x3f1275){const _0x22fe0b=_0x3d5d32;super['_showHook'](_0x3f1275),this['_labelCollection']&&(this['_labelCollection'][_0x22fe0b(0x792)]=_0x3f1275);}['_mountedHook'](){super['_mountedHook'](),this['load']();}['_addedHook'](){const _0x3e2864={_0x37a8ce:0x1d1,_0xe4dfc3:0x6ee},_0x1e5fc4=_0x3d5d32;super['_addedHook'](),this['_dataSource']&&this[_0x1e5fc4(_0x3e2864._0x37a8ce)]['dataSources'][_0x1e5fc4(0xff3)](this['_dataSource']),this[_0x1e5fc4(_0x3e2864._0xe4dfc3)]&&this[_0x1e5fc4(0x1d1)]['scene']['primitives']['add'](this['_labelCollection']);}['_removedHook'](){const _0x7e5312={_0x1e9d22:0x566,_0x2972f8:0xf06,_0x1d3296:0x6ee,_0x27190c:0xeab,_0x173ff6:0x926},_0x216ac2=_0x3d5d32;super[_0x216ac2(_0x7e5312._0x1e9d22)](),this['_labelCollection']&&(this['_map']['scene']['primitives'][_0x216ac2(_0x7e5312._0x2972f8)](this[_0x216ac2(_0x7e5312._0x1d3296)]),this['_labelCollection']=null),this[_0x216ac2(_0x7e5312._0x27190c)]&&this['_map'][_0x216ac2(_0x7e5312._0x173ff6)][_0x216ac2(0xf06)](this[_0x216ac2(0xeab)]);}[_0x3d5d32(0xd67)](_0x28a246){const _0x2cd27a={_0x3f3bf7:0x1d1,_0x1296da:0x433,_0x989ad0:0x86b},_0x37ae55=_0x3d5d32;if(!this[_0x37ae55(_0x2cd27a._0x3f3bf7)])return Promise['resolve'](![]);this['_map'][_0x37ae55(0xff6)]();if(this[_0x37ae55(_0x2cd27a._0x1296da)]['center'])return this[_0x37ae55(_0x2cd27a._0x3f3bf7)]['setCameraView'](this['options']['center'],_0x28a246);else{if(this['options']['extent'])return this[_0x37ae55(_0x2cd27a._0x3f3bf7)][_0x37ae55(0x66e)](this['options'][_0x37ae55(_0x2cd27a._0x989ad0)],_0x28a246);else{if(this['_dataSource'])return this['_map'][_0x37ae55(0x4c2)]['flyTo'](this['_dataSource'],_0x28a246);}}return Promise['resolve'](![]);}[_0x3d5d32(0xffe)](_0x5852a3){const _0x447546={_0x4bbb4e:0x433,_0x40dad5:0x399},_0x3aa981=_0x3d5d32;_0x5852a3&&((_0x5852a3['clear']??!![])&&(delete this['options']['url'],delete this['options'][_0x3aa981(0xe9b)]),this['clear'](),this['options']={...this['options'],..._0x5852a3});if(this[_0x3aa981(_0x447546._0x4bbb4e)]['url'])fetchJson({...this['options'],'proxy':this['_proxy']})['then'](_0x8f6ba5=>{const _0x2c86db=_0x3aa981;if(!this[_0x2c86db(0x1d1)]||!this['isAdded'])return;this['_load_data'](_0x8f6ba5);})[_0x3aa981(_0x447546._0x40dad5)](_0x599bc1=>{var _0x5ca6f7;logError$1('fetchJson出错了',_0x599bc1),(_0x5ca6f7=this['_readyPromise'])!==null&&_0x5ca6f7!==void 0x0&&_0x5ca6f7['reject']&&this['_readyPromise']['reject'](_0x599bc1);});else this['options'][_0x3aa981(0xe9b)]?this[_0x3aa981(0x267)](this['options']['data']):_0x5852a3&&logWarn('CzmGeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。');return this;}[_0x3d5d32(0x267)](_0x5a9596){const _0x2d395f={_0x53bb85:0x2e6},_0x2af3d1=_0x3d5d32;this['options']['format']&&(_0x5a9596=this[_0x2af3d1(0x433)][_0x2af3d1(0x1d7)](_0x5a9596));const _0x54a976=Cesium__namespace[_0x2af3d1(_0x2d395f._0x53bb85)]['load'](_0x5a9596,this['options']);_0x54a976['then'](_0x4bf7d8=>{this['showResult'](_0x4bf7d8);});}[_0x3d5d32(0x270)](_0x864f6){const _0x27f06a={_0x1b6d8d:0x926,_0x5b88de:0x433,_0x3b603:0x377},_0x3c5e8d=_0x3d5d32;this['_dataSource']&&(this['_map'][_0x3c5e8d(0x926)]['remove'](this['_dataSource']),delete this['_dataSource']);if(!_0x864f6||this['_state']===State['REMOVED'])return;_0x864f6['show']=this[_0x3c5e8d(0x792)],this['_map'][_0x3c5e8d(_0x27f06a._0x1b6d8d)]['add'](_0x864f6),this['_readyPromise']['resolve'](this),this['_dataSource']=_0x864f6;this[_0x3c5e8d(_0x27f06a._0x5b88de)][_0x3c5e8d(_0x27f06a._0x3b603)]&&(this['zIndex']=this['options']['zIndex']);const _0x2abccd=_0x864f6['entities']['values'],_0x2b885b=this[_0x3c5e8d(0xe49)](_0x2abccd);this['_opacity']!==0x1&&this['setOpacity'](this['_opacity']),this['options'][_0x3c5e8d(0xd67)]&&this[_0x3c5e8d(0x28e)](),this[_0x3c5e8d(0xefc)](EventType['load'],{'dataSource':_0x864f6,'entities':_0x2abccd,'list':_0x2b885b});}['bindEntities'](_0x20982b){const _0x5da7e5=_0x3d5d32,_0xca54fe=[];for(let _0xa4601=0x0,_0x4c786a=_0x20982b['length'];_0xa4601<_0x4c786a;_0xa4601++){const _0x532b7e=_0x20982b[_0xa4601];_0x532b7e[_0x5da7e5(0xe20)]=this['id'];const _0x1e515d=this['getEntityAttr'](_0x532b7e);_0x532b7e['_attr']=_0x1e515d||{},this[_0x5da7e5(0xefc)](EventType['addGraphic'],{'czmObject':_0x532b7e,'attr':_0x1e515d}),_0xca54fe['push']({..._0x1e515d,'_entity':_0x532b7e});}return this['options']['id']=this['id'],config2Entity(_0x20982b,this['options'],(_0x3dff93,_0x4faaae,_0x4f848d)=>{return this['lblAddFun'](_0x3dff93,_0x4faaae,_0x4f848d);}),_0xca54fe;}['updateStyle'](_0x1423d0){const _0x205466={_0x198b6f:0x433},_0x52918c=_0x3d5d32;if(!this[_0x52918c(0xeab)])return;_0x1423d0&&(this['options']['symbol']={...this[_0x52918c(_0x205466._0x198b6f)]['symbol'],..._0x1423d0});const _0x35254a=this['_dataSource']['entities']['values'];return this['options']['id']=this['id'],config2Entity(_0x35254a,this['options'],(_0x3ca19d,_0x4ec758,_0x34a364)=>{return this['lblAddFun'](_0x3ca19d,_0x4ec758,_0x34a364);}),this;}['lblAddFun'](_0xd77cc8,_0x23ca98,_0x5a84b4){const _0xa36fca={_0x4d30b2:0x6e2},_0x1e1680=_0x3d5d32;if(_0x23ca98['text']==='')return null;Cesium__namespace['defined'](_0x23ca98['height'])&&(_0xd77cc8=setPositionsHeight(_0xd77cc8,_0x23ca98['height']));!this['labelCollection']&&(this[_0x1e1680(0x6e2)]=new Cesium__namespace['LabelCollection']({'scene':this['viewer']['scene']}),this['viewer']['scene']['primitives']['add'](this[_0x1e1680(_0xa36fca._0x4d30b2)]));_0x23ca98['position']=getPositionValue(_0xd77cc8);const _0x4a2585=this['labelCollection']['add'](_0x23ca98);return _0x4a2585['properties']=_0x5a84b4,_0x4a2585[_0x1e1680(0xe20)]=this['id'],_0x4a2585;}['setOpacity'](_0x4df347){const _0x3022dd={_0x36ccf4:0xa07,_0x36b425:0x104e,_0x4cc3a7:0xe8f,_0x12c866:0xbdb,_0x3b2207:0x62a,_0x4cff40:0x2c8,_0x2745e0:0x882,_0x3c6f29:0xe57,_0x27d12c:0xbdb,_0x395acf:0x600,_0x3578a7:0x600,_0x2b0dbc:0x882,_0x4f6983:0x7a7,_0x1991b0:0xe57,_0x308919:0x574,_0x3596a3:0x32a,_0x305ed3:0x32a,_0x1269f5:0xd6e},_0x150ffc=_0x3d5d32;this['_opacity']=_0x4df347;if(!this[_0x150ffc(0xeab)])return;const _0x2d8504=this['_dataSource']['entities'][_0x150ffc(_0x3022dd._0x36ccf4)];for(let _0x134fcb=0x0,_0x79b8d9=_0x2d8504[_0x150ffc(0xc84)];_0x134fcb<_0x79b8d9;_0x134fcb++){const _0x3cdf27=_0x2d8504[_0x134fcb];_0x3cdf27[_0x150ffc(_0x3022dd._0x36b425)]&&_0x3cdf27['polygon']['material']&&_0x3cdf27['polygon']['material'][_0x150ffc(_0x3022dd._0x4cc3a7)]&&(this['_updatEntityAlpha'](_0x3cdf27['polygon']['material']['color'],this[_0x150ffc(_0x3022dd._0x12c866)]),_0x3cdf27['polygon'][_0x150ffc(_0x3022dd._0x3b2207)]&&this['_updatEntityAlpha'](_0x3cdf27['polygon']['outlineColor'],this['_opacity']));_0x3cdf27['polyline']&&_0x3cdf27['polyline'][_0x150ffc(0xd8f)]&&_0x3cdf27['polyline']['material'][_0x150ffc(_0x3022dd._0x4cc3a7)]&&this[_0x150ffc(_0x3022dd._0x4cff40)](_0x3cdf27['polyline']['material'][_0x150ffc(0xe8f)],this['_opacity']);_0x3cdf27['billboard']&&(_0x3cdf27['billboard']['color']=Cesium__namespace[_0x150ffc(_0x3022dd._0x2745e0)]['WHITE'][_0x150ffc(_0x3022dd._0x3c6f29)](this[_0x150ffc(_0x3022dd._0x27d12c)]));_0x3cdf27[_0x150ffc(_0x3022dd._0x395acf)]&&(_0x3cdf27[_0x150ffc(_0x3022dd._0x3578a7)][_0x150ffc(0xe8f)]=Cesium__namespace[_0x150ffc(_0x3022dd._0x2b0dbc)][_0x150ffc(_0x3022dd._0x4f6983)][_0x150ffc(_0x3022dd._0x1991b0)](this['_opacity']));if(_0x3cdf27['label']){let _0x19515f=this['_opacity'];_0x3cdf27['styleOpt']&&_0x3cdf27['styleOpt'][_0x150ffc(0x32a)]&&_0x3cdf27[_0x150ffc(_0x3022dd._0x308919)]['label']['opacity']&&(_0x19515f=_0x3cdf27[_0x150ffc(_0x3022dd._0x308919)][_0x150ffc(0x32a)]['opacity']),_0x3cdf27['label']['fillColor']&&this['_updatEntityAlpha'](_0x3cdf27[_0x150ffc(_0x3022dd._0x3596a3)]['fillColor'],_0x19515f),_0x3cdf27['label'][_0x150ffc(0x62a)]&&this['_updatEntityAlpha'](_0x3cdf27[_0x150ffc(_0x3022dd._0x305ed3)]['outlineColor'],_0x19515f),_0x3cdf27['label'][_0x150ffc(_0x3022dd._0x1269f5)]&&this['_updatEntityAlpha'](_0x3cdf27['label'][_0x150ffc(_0x3022dd._0x1269f5)],_0x19515f);}}}['_updatEntityAlpha'](_0xf67aab,_0x2f0563){const _0x58259a=_0x3d5d32;if(!_0xf67aab)return;let _0x23df5f=getCesiumValue(_0xf67aab,Cesium__namespace[_0x58259a(0x882)],this['_map']['clock']['currentTime']);if(!_0x23df5f||!_0x23df5f['withAlpha'])return _0xf67aab;_0x23df5f=_0x23df5f['withAlpha'](_0x2f0563),_0xf67aab['setValue'](_0x23df5f);}['getEntityAttr'](_0x4f415a){const _0x1ea9a8=_0x3d5d32;return getAttrVal(_0x4f415a[_0x1ea9a8(0x271)]);}['clear'](){const _0xd0c768={_0x287c16:0x6ee,_0x5dff7c:0xeeb,_0x507391:0x908},_0x5a507b=_0x3d5d32;return this[_0x5a507b(_0xd0c768._0x287c16)]&&this[_0x5a507b(_0xd0c768._0x287c16)][_0x5a507b(_0xd0c768._0x5dff7c)](),this['_dataSource']&&this['_dataSource']['entities'][_0x5a507b(0xeeb)](),this[_0x5a507b(_0xd0c768._0x507391)](),this;}['process'](_0x387b7d,_0x4c99ad){return this['readyPromise']['then'](_0x461912=>{const _0x532dc8={_0x5f7974:0xea8},_0x35be4c=_0x4132,_0x582f27=this[_0x35be4c(0xeab)]['process'](_0x387b7d,_0x4c99ad);return _0x582f27['then'](_0x1280ef=>{const _0x492233=_0x35be4c,_0x4b196a=_0x1280ef[_0x492233(_0x532dc8._0x5f7974)][_0x492233(0xa07)],_0x571a31=this['bindEntities'](_0x4b196a);return{'entities':_0x4b196a,'list':_0x571a31};});});}}register$2('czmGeojson',CzmGeoJsonLayer);class KmlLayer extends CzmGeoJsonLayer{[_0x3d5d32(0xffe)](_0x4e8bb7={}){const _0x2c185d={_0x19391c:0x433,_0x157bc1:0x7c0},_0x118b01=_0x3d5d32;this[_0x118b01(_0x2c185d._0x19391c)]={...this[_0x118b01(_0x2c185d._0x19391c)],..._0x4e8bb7};let _0x19451d;if(this['options'][_0x118b01(0x5ee)]){const _0xc12b07=getUrlResource(this['options']);_0x19451d=Cesium__namespace['KmlDataSource']['load'](_0xc12b07,{'camera':this[_0x118b01(0x1d1)][_0x118b01(0xfc1)]['camera'],'canvas':this[_0x118b01(0x1d1)]['scene'][_0x118b01(0x60f)],'clampToGround':this[_0x118b01(0x433)]['clampToGround']});}else this['options']['data']&&(_0x19451d=Cesium__namespace['KmlDataSource']['load'](this[_0x118b01(0x433)]['data'],{'camera':this[_0x118b01(0x1d1)][_0x118b01(0xfc1)][_0x118b01(0x435)],'canvas':this['_map']['scene']['canvas'],'clampToGround':this['options'][_0x118b01(_0x2c185d._0x157bc1)]}),logError$1('KmlLayer:请必须传入\x20url\x20或\x20data\x20参数'));_0x19451d['then'](_0x38ef51=>{this['showResult'](_0x38ef51);});}['getEntityAttr'](_0x157a47){let _0xbce4dd={'name':_0x157a47['name'],'description':_0x157a47['description']};const _0x251b7b=_0x157a47['_kml']['extendedData'];for(const _0x550c81 in _0x251b7b){_0xbce4dd[_0x550c81]=_0x251b7b[_0x550c81]['value'];}return _0xbce4dd=getAttrVal(_0xbce4dd),_0xbce4dd['description']&&(_0xbce4dd['description']=_0xbce4dd['description']['replace'](/]+>/g,'')),_0xbce4dd;}}register$2('kml',KmlLayer);class CzmlLayer extends CzmGeoJsonLayer{['_showHook'](_0x23a98c){const _0xf333d3=_0x3d5d32;super['_showHook'](_0x23a98c),(this['options']['updateClock']??!![])&&(_0x23a98c?this['setCzmlTime']():this[_0xf333d3(0xf6c)]());}[_0x3d5d32(0x58f)](){const _0x14060={_0x547a30:0xeab,_0x55fa85:0x9f4,_0xca5025:0xeab,_0x139f84:0x9f4,_0x25eaac:0xee6},_0x27a5c4=_0x3d5d32;var _0x263b1d;(_0x263b1d=this['_dataSource'])!==null&&_0x263b1d!==void 0x0&&_0x263b1d['clock']&&(this['_map']['clock']['clockRange']=this['_dataSource']['clock']['clockRange'],this[_0x27a5c4(0x1d1)]['clock']['multiplier']=this[_0x27a5c4(_0x14060._0x547a30)]['clock']['multiplier'],this[_0x27a5c4(0x1d1)]['clock'][_0x27a5c4(0xee6)]=this['_dataSource'][_0x27a5c4(_0x14060._0x55fa85)]['startTime'],this['_map']['clock']['stopTime']=this[_0x27a5c4(_0x14060._0xca5025)]['clock']['stopTime'],this['_map']['clock']['currentTime']=this['_dataSource'][_0x27a5c4(_0x14060._0x139f84)][_0x27a5c4(_0x14060._0x25eaac)]);}['setNowTime'](){const _0x579a55={_0x24909f:0x9f4,_0x547e4f:0x8b7,_0x3e81ed:0x4f8},_0x3ff0f1=_0x3d5d32;this[_0x3ff0f1(0x1d1)][_0x3ff0f1(_0x579a55._0x24909f)]['clockRange']=Cesium__namespace['ClockRange']['UNBOUNDED'],this['_map'][_0x3ff0f1(0x9f4)]['multiplier']=0x1;const _0x423181=Cesium__namespace['JulianDate'][_0x3ff0f1(0xc1b)](new Date());this['_map']['clock'][_0x3ff0f1(0xee6)]=_0x423181['clone'](),this[_0x3ff0f1(0x1d1)]['clock']['stopTime']=Cesium__namespace['JulianDate']['addDays'](_0x423181,0x1,new Cesium__namespace[(_0x3ff0f1(_0x579a55._0x547e4f))]()),this[_0x3ff0f1(0x1d1)]['clock'][_0x3ff0f1(_0x579a55._0x3e81ed)]=_0x423181['clone']();}['_removedHook'](){super['_removedHook'](),(this['options']['updateClock']??!![])&&this['setNowTime']();}[_0x3d5d32(0xffe)](_0x5154aa={}){const _0x1ba75b={_0x1e384e:0x433,_0x175c4e:0xe9b,_0x38e3b4:0xe9b,_0x3f1b96:0x731,_0x4b7a6d:0x44d},_0x404fc4={_0x31cc7c:0x270},_0x23dd4f=_0x3d5d32;this['options']={...this['options'],..._0x5154aa};let _0x21a662;if(this[_0x23dd4f(_0x1ba75b._0x1e384e)]['url']){const _0x55ed5e=getUrlResource(this['options']);_0x21a662=Cesium__namespace['CzmlDataSource']['load'](_0x55ed5e,this['options']);}else this['options'][_0x23dd4f(_0x1ba75b._0x175c4e)]?_0x21a662=Cesium__namespace[_0x23dd4f(0x764)]['load'](this['options'][_0x23dd4f(_0x1ba75b._0x38e3b4)],this[_0x23dd4f(0x433)]):logError$1(_0x23dd4f(_0x1ba75b._0x3f1b96));_0x21a662[_0x23dd4f(_0x1ba75b._0x4b7a6d)](_0x11d4db=>{const _0x3733e5=_0x23dd4f;this[_0x3733e5(_0x404fc4._0x31cc7c)](_0x11d4db);});}['getEntityAttr'](_0xbfec9){if(_0xbfec9['properties'])return getAttrVal(_0xbfec9['properties']);if(_0xbfec9['description'])return{'description':getCesiumValue(_0xbfec9['description'])};}}register$2('czml',CzmlLayer);class GraphicGroupLayer extends GroupLayer{get['hasEdit'](){const _0x3a36d7=_0x3d5d32;return this[_0x3a36d7(0xc46)];}set['hasEdit'](_0x48c98e){const _0x100da0={_0x1d6dce:0x8a9,_0x1d7569:0xfdf},_0x4f6cea=_0x3d5d32;this[_0x4f6cea(0xc46)]=_0x48c98e,this['_selectedLayer']&&(_0x48c98e?this[_0x4f6cea(_0x100da0._0x1d6dce)]['activateEdit']():this['_selectedLayer'][_0x4f6cea(_0x100da0._0x1d7569)]());}get[_0x3d5d32(0x491)](){const _0x204bc6={_0x3ff976:0x491},_0x4a8c3f=_0x3d5d32;return this['options'][_0x4a8c3f(_0x204bc6._0x3ff976)];}set[_0x3d5d32(0x491)](_0x28965c){this['options']['isAutoEditing']=_0x28965c,this['eachLayer'](_0x2f29e1=>{_0x2f29e1['isAutoEditing']=_0x28965c;},this);}get[_0x3d5d32(0xcfd)](){const _0xa3460c={_0x4955b4:0x8a9},_0xf48f2a=_0x3d5d32;return this[_0xf48f2a(_0xa3460c._0x4955b4)];}set['selectedLayer'](_0x445210){const _0x21f045={_0x50fdd6:0x8a9,_0x17cb3d:0xc16},_0x4da744=_0x3d5d32;this[_0x4da744(_0x21f045._0x50fdd6)]&&(delete this[_0x4da744(0x8a9)][_0x4da744(0xb4f)],this['_selectedLayer']['disableEdit']()),!(_0x445210 instanceof GraphicLayer)&&(_0x445210=this[_0x4da744(_0x21f045._0x17cb3d)](_0x445210)),this[_0x4da744(_0x21f045._0x50fdd6)]=_0x445210,this['_selectedLayer']&&(this[_0x4da744(0x8a9)][_0x4da744(0xb4f)]=!![],this['_hasEdit']&&this['_selectedLayer']['activateEdit']());}['isActivate'](_0x5b9a61){return _0x5b9a61['isActivate'];}[_0x3d5d32(0xe4c)](){const _0x5d0bb3=_0x3d5d32;super[_0x5d0bb3(0xe4c)](),this['options']['geojson']&&this['loadGeoJSON'](this['options']['geojson']);}['_addedHook'](){const _0x8570f4=_0x3d5d32;super[_0x8570f4(0x226)](),this[_0x8570f4(0x644)]();}['_getOrCreateLayer'](_0x36e608){const _0x811357={_0x39279c:0x792,_0x5d33ff:0xc16},_0x13bcca=_0x3d5d32;if(!_0x36e608)return this['selectedLayer'];if(isObject(_0x36e608)){const _0x303a41=this['getLayer'](_0x36e608['name']);if(_0x303a41)return Cesium__namespace['defined'](_0x36e608['id'])&&(_0x303a41['id']=_0x36e608['id']),Cesium__namespace['defined'](_0x36e608['show'])&&(_0x303a41['show']=_0x36e608[_0x13bcca(_0x811357._0x39279c)]),_0x303a41;}else{const _0x5349b6=this[_0x13bcca(_0x811357._0x5d33ff)](_0x36e608);if(_0x5349b6)return _0x5349b6;}return this['createLayer'](_0x36e608);}['createLayer'](_0x31798a){const _0x3cab7d={_0x3d1ee2:0xaed,_0x49efbd:0xb84},_0x598dc8=_0x3d5d32,_0x58ef75=clone(this['options'],['id','pid','geojson','data']);_0x58ef75['pid']=this['id'];isObject(_0x31798a)?(_0x58ef75[_0x598dc8(_0x3cab7d._0x3d1ee2)]=_0x31798a['name'],Cesium__namespace['defined'](_0x31798a['id'])&&(_0x58ef75['id']=_0x31798a['id']),Cesium__namespace[_0x598dc8(_0x3cab7d._0x49efbd)](_0x31798a[_0x598dc8(0x792)])&&(_0x58ef75['show']=_0x31798a['show'])):_0x58ef75['name']=_0x31798a;const _0x2ea197=new GraphicLayer(_0x58ef75);return this['_events']&&(_0x2ea197['_events']={...this['_events']}),this[_0x598dc8(0x1d1)]['addLayer'](_0x2ea197),this['addLayer'](_0x2ea197),_0x2ea197;}['deleteLayer'](_0x2fe4d2){const _0x45e6c3={_0x988d39:0x1d1},_0x1526ff=_0x3d5d32;let _0x48f3a1;return _0x2fe4d2 instanceof GraphicLayer?_0x48f3a1=_0x2fe4d2:_0x48f3a1=this['getLayer'](_0x2fe4d2),_0x48f3a1?(this['selectedLayer']===_0x48f3a1&&(this['selectedLayer']=null),removeArrayItem(this['_arrLayer'],_0x48f3a1),this[_0x1526ff(_0x45e6c3._0x988d39)][_0x1526ff(0xa9e)](_0x48f3a1,!![]),this['_processForRemoveLayer'](),!![]):![];}['deleteEmptyLayer'](){const _0x102b94={_0x2459f5:0xc84},_0x231a63=_0x3d5d32;for(let _0x17e332=this['_arrLayer']['length']-0x1;_0x17e332>=0x0;_0x17e332--){const _0xcae94d=this['_arrLayer'][_0x17e332];_0xcae94d[_0x231a63(_0x102b94._0x2459f5)]===0x0&&(this['selectedLayer']===_0xcae94d&&(this['selectedLayer']=null),this[_0x231a63(0xd53)]['splice'](_0x17e332,0x1),this[_0x231a63(0x1d1)]['removeLayer'](_0xcae94d,!![]));}return this['_processForRemoveLayer'](),this;}[_0x3d5d32(0x644)](){const _0x2c2dae={_0x4f220c:0x5ca},_0x5a460c=_0x3d5d32;this['_arrLayer']['length']===0x0&&this['options']['defaultLayer']&&(this['selectedLayer']=this[_0x5a460c(_0x2c2dae._0x4f220c)](this['options']['defaultLayer'])),this[_0x5a460c(0xcfd)]==null&&this['_arrLayer']['length']>0x0&&(this['selectedLayer']=this['_arrLayer'][0x0]);}['moveToLayer'](_0x2462b1,_0x24b375){const _0x4c121e=_0x3d5d32;!(_0x24b375 instanceof GraphicLayer)&&(_0x24b375=this['getLayer'](_0x24b375)),_0x2462b1['remove'](),_0x24b375[_0x4c121e(0x682)](_0x2462b1);}['getGraphics'](){const _0x1bdb31={_0x40094b:0xb72},_0x3cbf66={_0x3e3f5d:0xe85},_0x10ffff=_0x3d5d32,_0x5d95d5=[];return this[_0x10ffff(_0x1bdb31._0x40094b)](_0x55b058=>{const _0x54ccf4=_0x10ffff;if(_0x55b058[_0x54ccf4(_0x3cbf66._0x3e3f5d)])return;_0x5d95d5['push'](_0x55b058);},this),_0x5d95d5;}['getGraphicById'](_0xd520a3){const _0x2e7c16={_0x26c128:0xd53,_0x1d2055:0xd53},_0x2f68dc=_0x3d5d32;if(!_0xd520a3)return undefined;for(let _0x37f2e3=this[_0x2f68dc(_0x2e7c16._0x26c128)]['length']-0x1;_0x37f2e3>=0x0;_0x37f2e3--){const _0x34e18c=this[_0x2f68dc(_0x2e7c16._0x1d2055)][_0x37f2e3],_0x139b54=_0x34e18c['getGraphicById'](_0xd520a3);if(_0x139b54)return _0x139b54;}return undefined;}['eachGraphic'](_0x3178c3,_0x47a50e){return this['eachLayer'](_0x3aab0b=>{_0x3aab0b['eachGraphic'](_0x3178c3,_0x47a50e);},this),this;}['clear'](_0x3a5af5){this['eachLayer'](_0x21ddb4=>{_0x21ddb4['clear'](_0x3a5af5);},this);}['toGeoJSON'](_0x3d0b01){const _0x108584=_0x3d5d32;_0x3d0b01!==null&&_0x3d0b01!==void 0x0&&_0x3d0b01['stopEdit']&&this['stopDraw']();const _0x2a81ab=[],_0x7b3445=[];return this['eachLayer'](_0x41d64b=>{const _0x306858=_0x4132;_0x7b3445['push']({'id':_0x41d64b['id'],'name':_0x41d64b[_0x306858(0xaed)],'show':_0x41d64b['show']}),_0x41d64b['eachGraphic'](_0x110c9e=>{if(_0x110c9e['isPrivate'])return;const _0x5c4e66=_0x110c9e['toGeoJSON'](_0x3d0b01);_0x5c4e66['properties']['_layer']=_0x41d64b['name'],_0x2a81ab['push'](_0x5c4e66);},this);},this),{'type':'FeatureCollection','layer':{'id':this['id'],'name':this['name'],'layers':_0x7b3445,'selected':this[_0x108584(0xcfd)]['id']},'features':_0x2a81ab};}['loadGeoJSON'](_0x3755cb,_0x17be88={}){const _0x208348={_0x4d973b:0xcfd,_0x38374d:0xc16,_0xb08e67:0x846,_0x289503:0xd67},_0x487ebc=_0x3d5d32;try{isString(_0x3755cb)&&(_0x3755cb=JSON['parse'](_0x3755cb));}catch(_0x386f6b){alert(_0x386f6b['name']+':\x20'+_0x386f6b['message']+_0x487ebc(0xa0f));return;}_0x17be88['clear']&&this['clear'](!![]);let _0x43042d;if(_0x17be88['layer'])_0x43042d=this['getLayer'](_0x17be88['layer']);else{var _0x42c2bd,_0x3fec64;const _0x54b02d={},_0x41e2f9=(_0x42c2bd=_0x3755cb)===null||_0x42c2bd===void 0x0?void 0x0:(_0x3fec64=_0x42c2bd['layer'])===null||_0x3fec64===void 0x0?void 0x0:_0x3fec64['layers'];if(_0x41e2f9){var _0x1ed436,_0xc7eebd;for(let _0x54c9f4=0x0;_0x54c9f4<_0x41e2f9[_0x487ebc(0xc84)];_0x54c9f4++){const _0x1df2b6=this['_getOrCreateLayer'](_0x41e2f9[_0x54c9f4]);_0x54b02d[_0x1df2b6['id']]=_0x1df2b6;}if((_0x1ed436=_0x3755cb)!==null&&_0x1ed436!==void 0x0&&(_0xc7eebd=_0x1ed436['layer'])!==null&&_0xc7eebd!==void 0x0&&_0xc7eebd['selected']){var _0x376af1,_0x233590;const _0x76339d=_0x54b02d[(_0x376af1=_0x3755cb)===null||_0x376af1===void 0x0?void 0x0:(_0x233590=_0x376af1[_0x487ebc(0x548)])===null||_0x233590===void 0x0?void 0x0:_0x233590['selected']];_0x76339d&&(this[_0x487ebc(_0x208348._0x4d973b)]=_0x76339d);}}}const _0x35d356=getGeoJsonFeatures(_0x3755cb);let _0x1f8185=[];for(let _0x365c02=0x0,_0x33bee7=_0x35d356['length'];_0x365c02<_0x33bee7;_0x365c02++){const _0xe5b38=_0x35d356[_0x365c02];let _0x246f05;if(_0x43042d)_0x246f05=_0x43042d;else{var _0x58652d;const _0x4be351=_0xe5b38===null||_0xe5b38===void 0x0?void 0x0:(_0x58652d=_0xe5b38['properties'])===null||_0x58652d===void 0x0?void 0x0:_0x58652d['_layer'];_0x246f05=_0x4be351?this[_0x487ebc(_0x208348._0x38374d)](_0x4be351):null,!_0x246f05&&(_0x246f05=this['selectedLayer']);}const _0x4dfa70=_0x246f05[_0x487ebc(_0x208348._0xb08e67)](_0xe5b38,{..._0x17be88,'clear':![],'flyTo':![]});_0x1f8185=_0x1f8185['concat'](_0x4dfa70);}return _0x17be88[_0x487ebc(_0x208348._0x289503)]&&this[_0x487ebc(0x1d1)][_0x487ebc(0x7fc)](_0x1f8185),_0x1f8185;}['_toJsonEx'](_0x42672d){const _0xc9c9d3={_0x1c3df7:0x467},_0x5464cc=_0x3d5d32;_0x42672d[_0x5464cc(_0xc9c9d3._0x1c3df7)]=this['toGeoJSON']();}['getRectangle'](_0x39d501){const _0x4f3895={_0x5c7044:0xb84};let _0xc71273;return this['eachGraphic'](_0x4d2218=>{const _0x2358ae=_0x4132;if(_0x4d2218['isPrivate'])return;if(!_0x4d2218['getRectangle'])return;const _0x31cb79=_0x4d2218['getRectangle']();if(!Cesium__namespace[_0x2358ae(_0x4f3895._0x5c7044)](_0x31cb79))return;_0xc71273?_0xc71273=Cesium__namespace[_0x2358ae(0x756)]['union'](_0x31cb79,_0xc71273):_0xc71273=_0x31cb79;},this),_0x39d501?formatRectangle(_0xc71273):_0xc71273;}['startDraw'](_0x4941e4){const _0x371799={_0x59d894:0x8a9},_0x48ed5c=_0x3d5d32;return this[_0x48ed5c(_0x371799._0x59d894)][_0x48ed5c(0x8d9)](_0x4941e4);}['stopDraw'](){return this['_selectedLayer']['stopDraw']();}['activateEdit'](){return this['_selectedLayer']['activateEdit']();}['disableEdit'](){return this['_selectedLayer']['disableEdit']();}}register$2('graphicGroup',GraphicGroupLayer);class GeoJsonLayer extends GraphicLayer{['_showHook'](_0x57a0be){const _0x13ce76={_0x3e6d2e:0x355},_0x1508c0=_0x3d5d32;super['_showHook'](_0x57a0be),_0x57a0be&&this[_0x1508c0(0x355)]&&(this[_0x1508c0(_0x13ce76._0x3e6d2e)]=![],this['load']());}['_addedHook'](){super['_addedHook'](),this['show']?this['load']():this['_hasLoad']=!![];}['_removedHook'](){const _0x9a881d=_0x3d5d32;super[_0x9a881d(0x566)](),this['clear']();}['load'](_0xef58){const _0x540f59={_0x495f5e:0x501,_0x444a2d:0x76d,_0x38aa8f:0x433,_0x132c00:0xe9b},_0x5598dd={_0x34a324:0x1d1},_0x9760e2=_0x3d5d32;_0xef58&&(Cesium__namespace[_0x9760e2(_0x540f59._0x495f5e)](_0xef58['clear'],!![])&&(delete this['options']['url'],delete this['options']['data']),this[_0x9760e2(_0x540f59._0x444a2d)](),this[_0x9760e2(0x433)]={...this['options'],..._0xef58});if(this[_0x9760e2(_0x540f59._0x38aa8f)]['url'])sendAjax({...this['options'],'proxy':this['_proxy']})['then'](_0x49285f=>{const _0x33d81a=_0x9760e2;if(!this[_0x33d81a(_0x5598dd._0x34a324)]||this['_state']!==State['ADDED'])return;this['_load_data'](_0x49285f);})['catch'](_0x94083c=>{const _0x1600a7=_0x9760e2;var _0x1b8534;logError$1(_0x1600a7(0x787),_0x94083c),(_0x1b8534=this['_readyPromise'])!==null&&_0x1b8534!==void 0x0&&_0x1b8534[_0x1600a7(0x47c)]&&this[_0x1600a7(0xaf2)]['reject'](_0x94083c);});else this['options'][_0x9760e2(_0x540f59._0x132c00)]?this['_load_data'](this['options']['data']):_0xef58&&logWarn('GeoJsonLayer:没有传入\x20url\x20或\x20data\x20参数,请确认是否有误。');}[_0x3d5d32(0x267)](_0x1de002){const _0x3acc79=_0x3d5d32;this['options']['format']&&(_0x1de002=this['options']['format'](_0x1de002));_0x1de002=this['_formatForMask'](_0x1de002);const _0x2fb7a1=this['loadGeoJSON'](_0x1de002,{'clear':!![],'enabledEvent':![]}),_0x3af8b0=[];_0x2fb7a1['forEach'](_0x3e1bc1=>{_0x3af8b0['push']({..._0x3e1bc1['attr'],'graphic':_0x3e1bc1});}),this['fire'](EventType[_0x3acc79(0xffe)],{'geojson':_0x1de002,'list':_0x3af8b0,'graphics':_0x2fb7a1}),this['options']['flyTo']&&this['flyToByAnimationEnd'](),this['_readyPromise']['resolve'](this);}['_formatForMask'](_0x459153){const _0x65c28={_0x4e413:0x57e,_0x9dbc7e:0x525,_0xe9e1df:0x5a7,_0x45872a:0x2ae,_0x1792bc:0x7f5,_0x2396c4:0xb75,_0x369709:0xc84},_0x51e9c0=_0x3d5d32,_0x1847a7=this['options']['mask'];if(!_0x1847a7)return _0x459153;if(!_0x459153[_0x51e9c0(0x7ab)]||_0x459153['features']['length']===0x0)return _0x459153;_0x459153=clone(_0x459153),_0x459153['features']['splice'](0x1,_0x459153['features']['length']-0x1),this['_extent']=getExtentByGeoJSON(_0x459153);let _0x3f8073={'xmin':0x49,'xmax':0x88,'ymin':0x3,'ymax':0x3b};isObject(_0x1847a7)&&Cesium__namespace['defined'](_0x1847a7['xmin'])&&Cesium__namespace['defined'](_0x1847a7[_0x51e9c0(_0x65c28._0x4e413)])&&Cesium__namespace['defined'](_0x1847a7['ymin'])&&Cesium__namespace[_0x51e9c0(0xb84)](_0x1847a7[_0x51e9c0(0x1058)])&&(_0x3f8073=_0x1847a7);const _0x2d4273=[[_0x3f8073[_0x51e9c0(0x525)],_0x3f8073['ymax']],[_0x3f8073['xmin'],_0x3f8073['ymin']],[_0x3f8073[_0x51e9c0(0x57e)],_0x3f8073[_0x51e9c0(0x470)]],[_0x3f8073['xmax'],_0x3f8073[_0x51e9c0(0x1058)]],[_0x3f8073[_0x51e9c0(_0x65c28._0x9dbc7e)],_0x3f8073['ymax']]],_0x309b82=_0x459153['features'][0x0];if(_0x309b82[_0x51e9c0(_0x65c28._0xe9e1df)]['type']==='Polygon')_0x309b82['geometry']={'type':'Polygon','coordinates':[_0x2d4273,_0x309b82['geometry'][_0x51e9c0(_0x65c28._0x45872a)][0x0]]};else{if(_0x309b82['geometry'][_0x51e9c0(_0x65c28._0x1792bc)]==='MultiPolygon'){const _0x1c9193=[_0x2d4273];for(let _0xf28c=0x0,_0x3959f1=_0x309b82['geometry']['coordinates']['length'];_0xf28c<_0x3959f1;_0xf28c++){const _0x6a2e75=_0x309b82['geometry'][_0x51e9c0(0x2ae)][_0xf28c];_0x6a2e75['length']>0x0&&_0x1c9193[_0x51e9c0(_0x65c28._0x2396c4)](_0x6a2e75[0x0]);}_0x309b82['geometry']={'type':_0x51e9c0(0x942),'coordinates':[_0x1c9193]};}else{if(_0x309b82['geometry']['type']==='GeometryCollection'){const _0x148ed4=[_0x2d4273];for(let _0x2e75d5=0x0,_0xcc9159=_0x309b82['geometry']['geometries']['length'];_0x2e75d5<_0xcc9159;_0x2e75d5++){const _0x3b3f51=_0x309b82[_0x51e9c0(_0x65c28._0xe9e1df)]['geometries'][_0x2e75d5][_0x51e9c0(_0x65c28._0x45872a)];_0x3b3f51[_0x51e9c0(_0x65c28._0x369709)]>0x0&&_0x148ed4['push'](_0x3b3f51[0x0]);}_0x309b82[_0x51e9c0(_0x65c28._0xe9e1df)]={'type':'Polygon','coordinates':[_0x148ed4]};}}}return _0x459153;}['_toJsonEx'](_0x23176d){}['_setOptionsHook'](_0x29e844,_0x260175){const _0x2f1f47={_0x2cdea9:0xffe},_0x424c26=_0x3d5d32;var _0x16c065;super['_setOptionsHook'](_0x29e844,_0x260175);if(!this['_map'])return;_0x260175['symbol']&&!((_0x16c065=_0x260175['symbol'])!==null&&_0x16c065!==void 0x0&&_0x16c065['type'])?this['eachGraphic'](_0x1043b6=>{const _0xb6e04e=getSymbolStyle(_0x29e844['symbol'],_0x1043b6['attr']);delete _0xb6e04e['highlight'],_0x1043b6['style']=_0xb6e04e;}):(this['clear'](),this[_0x424c26(_0x2f1f47._0x2cdea9)]());}}register$2('geojson',GeoJsonLayer);class BusineDataLayer extends GraphicLayer{['_showHook'](_0x247b09){const _0x21781a={_0x4679db:0xffe},_0x2d3fdc=_0x3d5d32;super['_showHook'](_0x247b09),_0x247b09&&this['_hasLoad']&&(this['_hasLoad']=![],this[_0x2d3fdc(_0x21781a._0x4679db)]());}[_0x3d5d32(0x226)](){super['_addedHook'](),this['show']?this['load']():this['_hasLoad']=!![];}['_removedHook'](){const _0x196f7a=_0x3d5d32;super[_0x196f7a(0x566)](),this['clear']();}['load'](_0x2c699a){const _0x547d54={_0x3670a5:0x6dc},_0x528797={_0x3117df:0x787},_0x296d27={_0x41dbfe:0x267},_0x52400d=_0x3d5d32;_0x2c699a&&(Cesium__namespace[_0x52400d(0x501)](_0x2c699a['clear'],!![])&&(delete this[_0x52400d(0x433)]['url'],delete this['options']['data']),this['clear'](),this['options']={...this['options'],..._0x2c699a});if(this['options']['url'])fetchJson({...this['options'],'proxy':this[_0x52400d(0xb2c)]})['then'](_0x587c7f=>{const _0xd5e5b2=_0x52400d;if(!this[_0xd5e5b2(0x1d1)]||!this['isAdded'])return;this[_0xd5e5b2(_0x296d27._0x41dbfe)](_0x587c7f);})['catch'](_0x20efaf=>{const _0x19dc38=_0x52400d;var _0x5dc995;logError$1(_0x19dc38(_0x528797._0x3117df),_0x20efaf),(_0x5dc995=this['_readyPromise'])!==null&&_0x5dc995!==void 0x0&&_0x5dc995[_0x19dc38(0x47c)]&&this['_readyPromise']['reject'](_0x20efaf);});else this['options']['data']?this['_load_data'](this['options']['data']):_0x2c699a&&logWarn(_0x52400d(_0x547d54._0x3670a5));}[_0x3d5d32(0x267)](_0x26ce46){const _0x3ebb0f={_0x17ee7c:0x1061,_0x7f3dc0:0x472,_0x2c348a:0xdde,_0x39f08f:0x433,_0x2c97e9:0xb69,_0x189c8f:0x433,_0x5d8d21:0xce0,_0x3a6d3a:0xaf2},_0x3eb8ca=_0x3d5d32;if(this[_0x3eb8ca(0x433)]['dataColumn']){const _0x42ebad=this['options']['dataColumn'][_0x3eb8ca(0xdaa)]('.');_0x42ebad[_0x3eb8ca(_0x3ebb0f._0x17ee7c)](_0x4c3c9b=>{_0x26ce46=_0x26ce46[_0x4c3c9b];});}this['options'][_0x3eb8ca(_0x3ebb0f._0x7f3dc0)]&&(_0x26ce46=this['options']['formatData'](_0x26ce46));const _0x4c575f=[];for(let _0x149c08=0x0,_0x46552f=_0x26ce46['length'];_0x149c08<_0x46552f;_0x149c08++){const _0x29f5b1=_0x26ce46[_0x149c08];let _0x4499d9={};_0x29f5b1['style']&&(_0x4499d9={..._0x29f5b1[_0x3eb8ca(_0x3ebb0f._0x2c348a)]});const _0x18bfbc=this[_0x3eb8ca(_0x3ebb0f._0x39f08f)]['symbol'];let _0x1ac5a7=_0x29f5b1[_0x3eb8ca(0x7f5)]&&hasType(_0x29f5b1['type'])?_0x29f5b1['type']:_0x3eb8ca(0xbbe);if(_0x18bfbc){if(isFunction(_0x18bfbc))_0x4499d9=_0x18bfbc(_0x29f5b1,_0x4499d9)||_0x4499d9,_0x4499d9['type']&&(_0x1ac5a7=_0x4499d9['type']);else{_0x1ac5a7=_0x18bfbc['type']||_0x1ac5a7;const _0x240dc0=getSymbolStyle(_0x18bfbc,_0x29f5b1||{});_0x18bfbc['merge']?_0x4499d9={..._0x240dc0,..._0x4499d9}:_0x4499d9=_0x240dc0;}}if(!hasType(_0x1ac5a7)){logError$1('不存在graphicType无法解析数据对Graphic',_0x29f5b1);continue;}const _0x3157fd={'type':_0x1ac5a7,'style':_0x4499d9,'attr':_0x29f5b1};if(isPointType(_0x1ac5a7)){if(_0x29f5b1[_0x3eb8ca(0xb69)])_0x3157fd[_0x3eb8ca(_0x3ebb0f._0x2c97e9)]=_0x29f5b1['position'];else{if(this[_0x3eb8ca(_0x3ebb0f._0x189c8f)]['formatPosition'])_0x3157fd['position']=this['options']['formatPosition'](_0x29f5b1,_0x3157fd);else{if(this[_0x3eb8ca(0x433)]['latColumn']||this['options']['lngColumn']){const _0x556cf0=_0x29f5b1[this['options']['latColumn']||_0x3eb8ca(0xd57)],_0xf3d311=_0x29f5b1[this['options']['lngColumn']||'lng'],_0x5e68b6=_0x29f5b1[this['options']['altColumn']||'alt']||0x0;_0x3157fd['position']=[_0xf3d311,_0x556cf0,_0x5e68b6];}else _0x29f5b1['lat']&&_0x29f5b1['lng']&&(_0x3157fd['position']=[_0x29f5b1['lng'],_0x29f5b1['lat'],_0x29f5b1[_0x3eb8ca(0xd29)]||0x0]);}}if(!_0x3157fd['position']){logError$1('无法解析数据position坐标位置',_0x29f5b1);continue;}}else{if(_0x29f5b1['positions'])_0x3157fd['positions']=_0x29f5b1['positions'];else this['options']['formatPosition']&&(_0x3157fd['positions']=this['options']['formatPosition'](_0x29f5b1,_0x3157fd));if(!_0x3157fd[_0x3eb8ca(0xbb8)]){logError$1(_0x3eb8ca(0x3a6),_0x29f5b1);continue;}}_0x4c575f['push'](_0x3157fd);}const _0x30f009=this[_0x3eb8ca(_0x3ebb0f._0x5d8d21)](_0x4c575f,{'enabledEvent':![]}),_0x1173b5=[];_0x30f009['forEach'](_0x5a92c3=>{const _0x21b795=_0x3eb8ca;_0x1173b5[_0x21b795(0xb75)]({..._0x5a92c3['attr'],'graphic':_0x5a92c3});}),this['fire'](EventType['load'],{'jsonData':_0x26ce46,'list':_0x1173b5,'graphics':_0x30f009}),this['options']['flyTo']&&this['flyToByAnimationEnd'](),this[_0x3eb8ca(_0x3ebb0f._0x3a6d3a)][_0x3eb8ca(0xac9)](this);}['_toJsonEx'](_0x43d128){}[_0x3d5d32(0xd4c)](_0x36ea12,_0x30bc2d){const _0x1d2bd4={_0x25b553:0xd4c,_0x3c66cd:0x63d,_0x58dbce:0xffe},_0x563f09={_0x9384cb:0x63d},_0x477afb=_0x3d5d32;var _0x3dcb23;super[_0x477afb(_0x1d2bd4._0x25b553)](_0x36ea12,_0x30bc2d);if(!this['_map'])return;_0x30bc2d[_0x477afb(_0x1d2bd4._0x3c66cd)]&&!((_0x3dcb23=_0x30bc2d['symbol'])!==null&&_0x3dcb23!==void 0x0&&_0x3dcb23['type'])?this['eachGraphic'](_0x4ec3f6=>{const _0x1b8251=_0x477afb,_0x5af61e=getSymbolStyle(_0x36ea12[_0x1b8251(_0x563f09._0x9384cb)],_0x4ec3f6['attr']);_0x4ec3f6['style']=_0x5af61e;}):(this['clear'](),this[_0x477afb(_0x1d2bd4._0x58dbce)]());}}register$2('busineData',BusineDataLayer);class EditTileset extends EditBase{get['layer'](){return this['_graphic'];}get['style'](){return this['_graphic']['options'];}['bindDraggers'](){const _0x21521e={_0x4fefa1:0x1031,_0x41533e:0x548},_0x218d85=_0x3d5d32;this[_0x218d85(_0x21521e._0x4fefa1)]=this[_0x218d85(_0x21521e._0x41533e)]['_contextmenuConfig'],this['createDragger']({'dragger':this['_graphic'],'onDrag':(_0x73bad3,_0x2cf1c7)=>{this['_graphic']['position']=_0x2cf1c7;}});}['finish'](){const _0x409006=_0x3d5d32;delete this['_graphic']['_draw_tooltip'],delete this['_graphic']['_isDragger'],delete this['_graphic']['_noMousePick'],delete this['_graphic']['_pointType'],delete this['_graphic'][_0x409006(0xeda)],this['_graphic']['unbindContextMenu'](),this[_0x409006(0x1031)]&&(this['layer']['_contextmenuConfig']=this[_0x409006(0x1031)],delete this['_contextmenuConfig_bak']);}[_0x3d5d32(0x90e)](_0x5a8fa1){const _0x178405={_0x24082b:0x548,_0x370d41:0xccc,_0xb6bb6f:0x27b},_0x5744fb=_0x3d5d32,_0x5dd4d4=this['_map']['mouseEvent'][_0x5744fb(0x7a2)](_0x5a8fa1['position'],_0x5a8fa1);if(_0x5dd4d4[_0x5744fb(_0x178405._0x24082b)]!==this[_0x5744fb(0x548)])return;const _0x266fb6=_0x5dd4d4===null||_0x5dd4d4===void 0x0?void 0x0:_0x5dd4d4['layer'];if(!_0x266fb6||!_0x266fb6['_isDragger'])return;this['_map']['scene'][_0x5744fb(_0x178405._0x370d41)]['enableInputs']&&(this['_map']['scene'][_0x5744fb(_0x178405._0x370d41)][_0x5744fb(_0x178405._0xb6bb6f)]=![],this['_hasChangeEnableInputs']=!![]),this['_map']['_setEditCursor'](!![]),_0x266fb6['_closeAllControl'](),this['_draggerIng']=_0x266fb6,this[_0x5744fb(0xefc)](EventType['editMouseDown'],{..._0x5a8fa1,..._0x5dd4d4,'index':this[_0x5744fb(0xe38)]['index']});}['_onMouseMoveDraggerHandler'](_0x45aac5){const _0x19df72={_0x3d4498:0xefc,_0x7cea4d:0x7ac},_0x2babeb=_0x3d5d32;this['_map'][_0x2babeb(0xd86)](_0x45aac5['endPosition'],this[_0x2babeb(0x1d1)][_0x2babeb(0xd1b)]('_释放后完成修改'));const _0x480f72=getCurrentMouseTerrainPosition(this['_map']['scene'],_0x45aac5['endPosition']);_0x480f72&&(this['_draggerIng']['onDrag']&&this['_draggerIng']['onDrag'](this['_draggerIng'],_0x480f72)),this[_0x2babeb(_0x19df72._0x3d4498)](EventType[_0x2babeb(_0x19df72._0x7cea4d)],{..._0x45aac5,'index':this['_draggerIng'][_0x2babeb(0x5f9)],'cartesian':_0x480f72,'windowPosition':_0x45aac5['endPosition']});}['_onMouseMoveMapHandler'](_0x33faea){const _0x425de1={_0xadd029:0xc62},_0x59f84d=_0x3d5d32,_0x19077c=this['_map']['mouseEvent']['getPickTarget'](_0x33faea['endPosition'],_0x33faea),_0x4f52c6=_0x19077c===null||_0x19077c===void 0x0?void 0x0:_0x19077c['layer'];if(_0x4f52c6==null){this['_map'][_0x59f84d(_0x425de1._0xadd029)]();return;}if(_0x19077c[_0x59f84d(0x548)]!==this['layer']||!_0x4f52c6['_isDragger'])return;if(this[_0x59f84d(0x1d1)]['contextmenu']['show']&&this['_map']['contextmenu'][_0x59f84d(0x2eb)]===_0x4f52c6)return;const _0x4b7a94=_0x4f52c6['_draw_tooltip'];if(!_0x4b7a94)return;this[_0x59f84d(0x1d1)]['openSmallTooltip'](_0x33faea['endPosition'],_0x4b7a94);}['getDraggerContextMenu'](_0x406126){const _0x26e225={_0x45bef4:0x1d1},_0x2b37ce={_0x374944:0x970},_0x5ad633=_0x3d5d32,_0x463f73=super[_0x5ad633(0x8ae)](_0x406126);return Cesium__namespace['defaultValue'](this[_0x5ad633(0xdde)]['hasEditRotate'],!![])&&(_0x463f73['push']({'text':this[_0x5ad633(_0x26e225._0x45bef4)][_0x5ad633(0xd1b)]('_按轴旋转'),'icon':Icon['BloomEffectYes'],'show':_0x3b8c60=>{const _0x283d4b=_0x5ad633;return!this['_matrixRotate']||this['_matrixRotate'][_0x283d4b(_0x2b37ce._0x374944)]!==_0x406126[_0x283d4b(0x5f9)];},'callback':_0x455d50=>{var _0x41e805;const _0x55466e=(_0x41e805=_0x455d50['graphic'])!==null&&_0x41e805!==void 0x0&&_0x41e805['position']?_0x455d50['graphic']:_0x455d50['layer'];this['startRotateMatrix'](_0x55466e,_0x455d50);}}),_0x463f73['push']({'text':this['_map']['getLangText']('_停止按轴旋转'),'icon':Icon['BloomEffectNo'],'show':_0x27b2f6=>{const _0x125ef1=_0x5ad633;return this['_matrixRotate']&&this['_matrixRotate'][_0x125ef1(0x970)]===_0x406126['index'];},'callback':_0x253a55=>{this['stopRotateMatrix']();}})),_0x463f73;}['startRotateMatrix'](_0x1ab60d,_0x12136b){const _0x35bff2={_0x58408c:0x548,_0x55dec2:0x518,_0xd3bfc2:0x215,_0x636df7:0x3e8},_0x1b9c5d={_0x20465f:0xe39},_0x52be7b=_0x3d5d32;!_0x1ab60d&&(_0x1ab60d=this[_0x52be7b(_0x35bff2._0x58408c)]),this[_0x52be7b(_0x35bff2._0x55dec2)](),this[_0x52be7b(0x887)](),this[_0x52be7b(_0x35bff2._0xd3bfc2)]=new MatrixRotate({'map':this['_map'],'position':_0x1ab60d['position'],'roll':_0x1ab60d['rotation_x'],'pitch':_0x1ab60d[_0x52be7b(0xe37)],'heading':_0x1ab60d['rotation_z']}),this['_map']['addThing'](this['_matrixRotate']),this['_matrixRotate']['on'](EventType[_0x52be7b(0x73d)],_0x565f3d=>{const _0x3701f5=_0x52be7b;_0x1ab60d[_0x3701f5(0x31f)]={'x':formatNum$1(_0x565f3d['roll'],0x2),'y':formatNum$1(_0x565f3d['pitch'],0x2),'z':formatNum$1(_0x565f3d[_0x3701f5(_0x1b9c5d._0x20465f)],0x2)};}),_0x1ab60d[_0x52be7b(0x9e7)](EventType[_0x52be7b(_0x35bff2._0x636df7)],this['_updateMatrixMovePosition'],this),_0x1ab60d['off'](EventType['updatePosition'],this['_updateMatrixRotatePosition'],this),_0x1ab60d['on'](EventType[_0x52be7b(0x3e8)],this['_updateMatrixRotatePosition'],this);}}class TilesetEditBase extends BaseThing{constructor(_0x50ab23={}){const _0x49bcb5=_0x3d5d32;super(_0x50ab23),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this[_0x49bcb5(0xcb2)]=0x0,this['_maxRangeLength']=0x0,this['_areaList']=[];}get[_0x3d5d32(0xedd)](){return this['_areaList'];}get['layer'](){return this['_layer'];}set['layer'](_0x1e8ac0){const _0x2f118e={_0x58774b:0x44d},_0x38c3b7={_0x13b0bd:0xe72},_0x1e6e83=_0x3d5d32;this['_layer']=_0x1e8ac0,_0x1e8ac0['readyPromise'][_0x1e6e83(_0x2f118e._0x58774b)](_0x46e78c=>{const _0x171ea5=_0x1e6e83;this[_0x171ea5(0x9a8)]=_0x1e8ac0[_0x171ea5(0x878)],this[_0x171ea5(0xe5e)]=_0x1e8ac0[_0x171ea5(_0x38c3b7._0x13b0bd)]['toCartographic'](),this['_initLayer'](_0x1e8ac0['tileset']),this['options']['area']&&this['options']['area']['forEach'](_0x84de41=>{this['addArea'](_0x84de41['positions'],_0x84de41);});});}get['editHeight'](){const _0x3d2321={_0x17dcd9:0x548,_0x276cc5:0x371,_0x109e1c:0x433,_0x27546a:0x433},_0x4e56a1=_0x3d5d32;var _0x1382bf,_0x37ae9b;const _0x8405ba=this[_0x4e56a1(_0x3d2321._0x17dcd9)];if(_0x8405ba!==null&&_0x8405ba!==void 0x0&&(_0x1382bf=_0x8405ba['options'])!==null&&_0x1382bf!==void 0x0&&_0x1382bf['editHeight'])return _0x8405ba['options'][_0x4e56a1(_0x3d2321._0x276cc5)];if(this[_0x4e56a1(_0x3d2321._0x109e1c)]['editHeight'])return this['options']['editHeight'];if(_0x8405ba!==null&&_0x8405ba!==void 0x0&&(_0x37ae9b=_0x8405ba[_0x4e56a1(_0x3d2321._0x109e1c)])!==null&&_0x37ae9b!==void 0x0&&_0x37ae9b['flatHeight'])return _0x8405ba['options']['flatHeight'];if(this[_0x4e56a1(_0x3d2321._0x27546a)]['flatHeight'])return this['options']['flatHeight'];return 0x0;}get['tileset'](){const _0x3c7a47={_0xa9b7e8:0x8d5},_0x36166e=_0x3d5d32;return this[_0x36166e(_0x3c7a47._0xa9b7e8)]['tileset'];}get[_0x3d5d32(0xc84)](){if(this['_areaList']){var _0x45798e;return(_0x45798e=this['_areaList'])===null||_0x45798e===void 0x0?void 0x0:_0x45798e['length'];}else return 0x0;}[_0x3d5d32(0x226)](){const _0x40c926={_0x4e7235:0x433,_0x44fe28:0x548},_0x20a3ef=_0x3d5d32;this[_0x20a3ef(_0x40c926._0x4e7235)]['layer']&&(this[_0x20a3ef(_0x40c926._0x44fe28)]=this['options']['layer']);}['_removedHook'](){const _0x456199={_0x47295b:0x6af},_0x4824b7=_0x3d5d32;this['clear'](),this[_0x4824b7(_0x456199._0x47295b)]&&this['cacheMarsOptions']();}[_0x3d5d32(0x76d)](){const _0xf090fc={_0x2b7ad8:0x689,_0x459431:0x479},_0x4f15f3=_0x3d5d32;this['_areaList']=[],this['_rangeNumber']=0x0,this[_0x4f15f3(0x101d)]=0x0,Cesium__namespace['defined'](this['_texture'])&&(this['_texture'][_0x4f15f3(_0xf090fc._0x2b7ad8)](),this[_0x4f15f3(_0xf090fc._0x459431)]=undefined);}['addArea'](_0x5357fe,_0x2bb2ef={}){const _0x4d9eb5={_0x105499:0xf13},_0x4c928d=_0x3d5d32;if(!_0x5357fe||_0x5357fe['length']<0x3)return;_0x5357fe=LngLatArray[_0x4c928d(0x890)](_0x5357fe),this['_maxRangeLength']=Math[_0x4c928d(0xe8e)](this['_maxRangeLength'],_0x5357fe['length']);const _0x11b233={'id':getGlobalId(),'show':!![],'height':_0x2bb2ef['height']||0x0,'positions':_0x5357fe};return this[_0x4c928d(0x1028)]['push'](_0x11b233),this[_0x4c928d(_0x4d9eb5._0x105499)]=!![],this[_0x4c928d(0xefc)](EventType['addItem'],{'area':_0x11b233}),_0x11b233;}[_0x3d5d32(0x33e)](_0x3b30d1){const _0x854afc=_0x3d5d32;if(!isNumber(_0x3b30d1))return;for(let _0x3bb18d=0x0;_0x3bb18d{const _0x3d332b=_0xd0baf7;if(!_0x1e7c2d['show'])return;_0xcbc41d<_0x1e7c2d['positions']['length']&&(_0xcbc41d=_0x1e7c2d[_0x3d332b(_0x46c583._0x34a14d)][_0x3d332b(_0x46c583._0x15d9c9)]);}),this['_maxRangeLength']=_0xcbc41d;const _0x1159f7=[];this['_areaList'][_0xd0baf7(0x1061)]((_0x49092b,_0xde4637)=>{const _0x5c42c8=_0xd0baf7;if(!_0x49092b['show'])return;const _0x3e586e=_0x49092b[_0x5c42c8(0xbb8)],_0x54e3fb=_0x3e586e['length'],_0x2cdd3b=Cesium__namespace['Cartesian3']['fromRadians'](this[_0x5c42c8(0xe5e)][_0x5c42c8(_0x38de05._0x525a8e)],this[_0x5c42c8(_0x38de05._0x492612)][_0x5c42c8(0x406)],this['_center']['height']+_0x49092b['height']+this['editHeight']),_0x335593=Cesium__namespace['Cartesian3'][_0x5c42c8(0xf69)](_0x2cdd3b,new Cesium__namespace['Cartesian3']());_0x1159f7['push'](_0x54e3fb),_0x1159f7['push'](_0x54e3fb),_0x1159f7['push'](_0x54e3fb),_0x1159f7['push'](_0x54e3fb),_0x1159f7[_0x5c42c8(_0x38de05._0xc732b3)](_0x335593['x']),_0x1159f7[_0x5c42c8(_0x38de05._0xa6b06d)](_0x335593['y']),_0x1159f7['push'](_0x335593['z']),_0x1159f7[_0x5c42c8(_0x38de05._0x25e1f1)](_0x2cdd3b['x']/_0x335593['x']),_0x3e586e[_0x5c42c8(0x1061)](_0x85baf8=>{const _0x435c1c=_0x5c42c8,_0x275777=_0x85baf8,_0xa2e790=Cesium__namespace[_0x435c1c(_0x237680._0x51c179)][_0x435c1c(0xf69)](_0x275777,new Cesium__namespace['Cartesian3']());_0x1159f7[_0x435c1c(_0x237680._0xdc34d4)](_0xa2e790['x']),_0x1159f7['push'](_0xa2e790['y']),_0x1159f7[_0x435c1c(0xb75)](_0xa2e790['z']),_0x1159f7['push'](_0x275777['x']/_0xa2e790['x']);});if(_0x54e3fb<_0xcbc41d)for(let _0x2823f8=0x0;_0x2823f8<_0xcbc41d-_0x54e3fb;_0x2823f8++){_0x1159f7[_0x5c42c8(_0x38de05._0x555847)](0x0),_0x1159f7[_0x5c42c8(_0x38de05._0xc732b3)](0x0),_0x1159f7['push'](0x0),_0x1159f7[_0x5c42c8(_0x38de05._0x555847)](0x0);}}),this['_texture']=new Cesium__namespace[(_0xd0baf7(_0x11e635._0xba6506))]({'context':this['_map'][_0xd0baf7(0xfc1)][_0xd0baf7(_0x11e635._0x2e5a0f)],'pixelFormat':Cesium__namespace['PixelFormat'][_0xd0baf7(_0x11e635._0x227f1e)],'pixelDatatype':Cesium__namespace['PixelDatatype']['FLOAT'],'sampler':new Cesium__namespace[(_0xd0baf7(_0x11e635._0x454227))]({'wrapS':Cesium__namespace['TextureWrap']['CLAMP_TO_EDGE'],'wrapT':Cesium__namespace['TextureWrap'][_0xd0baf7(0xace)],'minificationFilter':Cesium__namespace['TextureMinificationFilter']['NEAREST'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['NEAREST']}),'flipY':![],'source':{'width':_0xcbc41d+0x2,'height':this['_rangeNumber'],'arrayBufferView':new Float32Array(_0x1159f7)}});}['_getCustomShader'](_0x59c8ec=![]){return null;}['toJSON'](){const _0x3cf159={_0x402a98:0x772},_0x172f2e=_0x3d5d32,_0x16ffd3=clone(this['options'],['layer','eventParent']);return _0x16ffd3[_0x172f2e(_0x3cf159._0x402a98)]=[],this[_0x172f2e(0x1028)]['forEach'](_0x109597=>{_0x16ffd3['area']['push']({'positions':LngLatArray['toArray'](_0x109597['positions'])});}),_0x16ffd3;}}class TilesetClip extends TilesetEditBase{constructor(_0x1fb609={}){const _0x2bfb59=_0x3d5d32;super(_0x1fb609),this['_customShadersKey']=_0x2bfb59(0x1010);}[_0x3d5d32(0xeac)](_0x4b4064=![]){const _0x57bb10={_0x491f5d:0xff9,_0x35b93f:0x865},_0x55615f={_0x19e926:0x479},_0x10d516=_0x3d5d32,_0x406f2d=new Cesium__namespace[(_0x10d516(_0x57bb10._0x491f5d))]({'fragmentShaderText':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20u_mars3d_clip_texture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_upAxis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_rangeNumber;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_clip_maxRangeLength;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20restorePoint_mars3d_clip(vec4\x20point)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20outpoint\x20=\x20point.xyz\x20*\x20point.w;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20czm_inverseModel\x20*\x20vec4(outpoint,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20getRegions_mars3d_clip(int\x20x,\x20int\x20y)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20(float(x)\x20+\x200.5)\x20/\x20float(u_mars3d_clip_maxRangeLength\x20+\x202);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20(float(y)\x20+\x200.5)\x20/\x20float(u_mars3d_clip_rangeNumber);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20point\x20=\x20texture(u_mars3d_clip_texture,\x20vec2(u,\x20v));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20point;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20bool\x20inRectangle_mars3d_clip(vec3\x20textPoint)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20h\x20=\x200;\x20h\x20<\x20100000;\x20h++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(h\x20>=\x20u_mars3d_clip_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_clip(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_clip(getRegions_mars3d_clip(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_clip_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_clip_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20fsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(inRectangle_mars3d_clip(positionMC)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20'}),_0xd454ed=this['_map']['scene']['_context']['defaultTexture'];return _0x406f2d['uniformMap'][_0x10d516(_0x57bb10._0x35b93f)]=()=>{const _0x4387fc=_0x10d516;return Cesium__namespace['defined'](this['_texture'])?this[_0x4387fc(_0x55615f._0x19e926)]:_0xd454ed;},_0x406f2d['uniformMap']['u_mars3d_clip_upAxis']=()=>{return this['_modelUpAxis'];},_0x406f2d['uniformMap']['u_mars3d_clip_rangeNumber']=()=>{return this['_rangeNumber'];},_0x406f2d['uniformMap'][_0x10d516(0xfa4)]=()=>{return this['_maxRangeLength'];},_0x406f2d;}}class TilesetFlat extends TilesetEditBase{constructor(_0x2f02ef={}){super(_0x2f02ef),this['_customShadersKey']='flat';}['_getCustomShader'](_0x37b673=![]){const _0x20d07f={_0x2a68cd:0xe56,_0xce20c1:0x546},_0xe98d81=_0x3d5d32,_0xafc0c6=new Cesium__namespace['CustomShader']({'vertexShaderText':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20u_mars3d_flat_texture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_upAxis;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_rangeNumber;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20int\x20u_mars3d_flat_maxRangeLength;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20restorePoint_mars3d_flat(vec4\x20point)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20outpoint\x20=\x20point.xyz\x20*\x20point.w;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20czm_inverseModel\x20*\x20vec4(outpoint,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20getRegions_mars3d_flat(int\x20x,\x20int\x20y)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20u\x20=\x20(float(x)\x20+\x200.5)\x20/\x20float(u_mars3d_flat_maxRangeLength\x20+\x202);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20v\x20=\x20(float(y)\x20+\x200.5)\x20/\x20float(u_mars3d_flat_rangeNumber);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20point\x20=\x20texture(u_mars3d_flat_texture,\x20vec2(u,\x20v));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20point;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20inRectangle_mars3d_flat(vec3\x20textPoint)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20h\x20=\x200;\x20h\x20<\x20100000;\x20h++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(h\x20>=\x20u_mars3d_flat_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_flat(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flat_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flat_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20h;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x2099999;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20void\x20vertexMain(VertexInput\x20vsInput,\x20inout\x20czm_modelVertexOutput\x20vsOutput)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20vsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20rectangleIndex\x20=\x20inRectangle_mars3d_flat(positionMC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(rectangleIndex\x20!=\x2099999){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20modelDatumPoint\x20=\x20restorePoint_mars3d_flat(getRegions_mars3d_flat(1,\x20rectangleIndex));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flat_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(modelDatumPoint.x\x20+\x20positionMC.x\x20*\x200.0005,\x20positionMC.y,\x20positionMC.z);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flat_upAxis\x20==\x201){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(positionMC.x,\x20modelDatumPoint.y\x20+\x20positionMC.y\x20*\x200.0005,\x20positionMC.z);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vsOutput.positionMC\x20=\x20vec3(positionMC.x,\x20positionMC.y,\x20modelDatumPoint.z\x20+\x20positionMC.z\x20*\x200.0005);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}'}),_0x294f34=this['_map'][_0xe98d81(0xfc1)]['_context']['defaultTexture'];return _0xafc0c6['uniformMap']['u_mars3d_flat_texture']=()=>{const _0x227454=_0xe98d81;return Cesium__namespace[_0x227454(0xb84)](this['_texture'])?this['_texture']:_0x294f34;},_0xafc0c6[_0xe98d81(_0x20d07f._0x2a68cd)]['u_mars3d_flat_upAxis']=()=>{return this['_modelUpAxis'];},_0xafc0c6[_0xe98d81(0xe56)]['u_mars3d_flat_rangeNumber']=()=>{return this['_rangeNumber'];},_0xafc0c6[_0xe98d81(0xe56)][_0xe98d81(_0x20d07f._0xce20c1)]=()=>{return this['_maxRangeLength'];},_0xafc0c6;}['updateHeight'](_0x486134,_0x335d5d){const _0x125c86={_0x5adfb9:0xf13},_0x52e635=_0x3d5d32;if(Cesium__namespace['defined'](_0x335d5d)){const _0x59d859=this[_0x52e635(0x33e)](_0x335d5d);_0x59d859&&(_0x59d859['height']=_0x486134,this['_hasUpdate']=!![]);}else{for(let _0x15690e=0x0;_0x15690ethis[_0x501991(0x433)][_0x501991(_0x42df57._0x5de319)]){this['height']=this['options']['maxHeight'],this[_0x501991(_0x42df57._0x18393e)]();return;}if(this[_0x501991(_0x42df57._0x515aeb)]=\x20u_mars3d_flood_rangeNumber)\x20break;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20first\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(2,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20currentLength\x20=\x20getRegions_mars3d_flood(0,\x20h).x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20counter\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20xinters\x20=\x200.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for(int\x20w\x20=\x200;\x20w\x20<\x20100000;\x20w++){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(float(w)\x20>=\x20currentLength)\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20int\x20nextIndex\x20=\x20w\x20+\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nextIndex\x20=\x20float(nextIndex)\x20==\x20currentLength\x20?\x200\x20:\x20nextIndex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p1\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(w\x20+\x202,\x20h));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20p2\x20=\x20restorePoint_mars3d_flood(getRegions_mars3d_flood(nextIndex\x20+\x202,\x20h));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20textPointy\x20=\x20textPoint.z;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flood_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flood_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1x\x20=\x20p1.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p1y\x20=\x20p1.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2x\x20=\x20p2.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p2y\x20=\x20p2.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointx\x20=\x20textPoint.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20textPointy\x20=\x20textPoint.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(textPointx\x20>\x20min(p1x,\x20p2x)\x20&&\x20textPointx\x20<=\x20max(p1x,\x20p2x)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(textPointy\x20<=\x20max(p1y,\x20p2y)){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1x\x20!=\x20p2x){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xinters\x20=\x20((textPointx\x20-\x20p1x)\x20*\x20(p2y\x20-\x20p1y))\x20/\x20(p2x\x20-\x20p1x)\x20+\x20p1y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(p1y\x20==\x20p2y\x20||\x20textPointy\x20<=\x20xinters){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20counter\x20+=\x201.0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if((mod(counter,\x202.0)\x20!=\x200.0))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20false;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20fragmentMain(FragmentInput\x20fsInput,\x20inout\x20czm_modelMaterial\x20material){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20positionMC\x20=\x20fsInput.attributes.positionMC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_isStart\x20&&\x20(u_mars3d_flood_floodAll\x20||\x20inRectangle_mars3d_flood(positionMC))){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20height\x20=\x20positionMC.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(u_mars3d_flood_upAxis\x20==\x200){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.x;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(u_mars3d_flood_upAxis\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.y;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x20=\x20positionMC.z;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(height<=u_mars3d_flood_currentheight\x20&&\x20(!u_mars3d_flood_limitMin\x20||\x20u_mars3d_flood_min_height<=height))\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20mix(material.diffuse,\x20u_mars3d_flood_color.rgb,\x20u_mars3d_flood_color.a);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20'}),_0x542e31=this['_map']['scene'][_0x431882(0x92b)]['defaultTexture'];return _0x337b3f['uniformMap']['u_mars3d_flood_texture']=()=>{const _0x4e376c=_0x431882;return Cesium__namespace['defined'](this[_0x4e376c(_0xdf8a84._0xfb65ab)])?this['_texture']:_0x542e31;},_0x337b3f['uniformMap']['u_mars3d_flood_upAxis']=()=>{return this['_modelUpAxis'];},_0x337b3f['uniformMap']['u_mars3d_flood_rangeNumber']=()=>{const _0x140abb=_0x431882;return this[_0x140abb(_0x9d7f61._0x523f6e)];},_0x337b3f['uniformMap']['u_mars3d_flood_maxRangeLength']=()=>{return this['_maxRangeLength'];},_0x337b3f['uniformMap']['u_mars3d_isStart']=()=>{return Cesium__namespace['defined'](this['_currentHeight']);},_0x337b3f[_0x431882(0xe56)]['u_mars3d_flood_floodAll']=()=>{return this['floodAll'];},_0x337b3f['uniformMap']['u_mars3d_flood_color']=()=>{return this['color'];},_0x337b3f['uniformMap'][_0x431882(_0x4777fe._0x23fb3b)]=()=>{return this['_currentHeight'];},_0x337b3f['uniformMap']['u_mars3d_flood_min_height']=()=>{return this['_minHeight'];},_0x337b3f['uniformMap']['u_mars3d_flood_limitMin']=()=>{return this['_limitMin'];},this[_0x431882(_0x4777fe._0x35eb90)]=_0x337b3f['uniformMap'],_0x337b3f;}}class TilesetPlanClip extends BaseThing{get['clipTarget'](){return this['_tileset'];}set[_0x3d5d32(0xd0a)](_0x4f1c05){const _0x330801={_0x20d9a8:0xbb8,_0x27e720:0x433,_0x1c9ff8:0xbd7},_0xb00df6=_0x3d5d32;this['_tileset']=_0x4f1c05,this['_inverseMatrix']=null,Cesium__namespace['defined'](this['options'][_0xb00df6(_0x330801._0x20d9a8)])&&(this['positions']=this[_0xb00df6(_0x330801._0x27e720)][_0xb00df6(_0x330801._0x20d9a8)]),Cesium__namespace['defined'](this['options']['type'])&&(this['type']=this[_0xb00df6(_0x330801._0x27e720)]['type']),Cesium__namespace['defined'](this['options']['distance'])&&(this[_0xb00df6(_0x330801._0x1c9ff8)]=this['options']['distance']);}get[_0x3d5d32(0x548)](){return this['_layer'];}set[_0x3d5d32(0x548)](_0x395273){const _0x30baae=_0x3d5d32;this['_layer']=_0x395273,_0x395273['loadOk']?this[_0x30baae(0xd0a)]=_0x395273[_0x30baae(0x7f7)]:_0x395273['on'](EventType['load'],_0x13c56b=>{this['clipTarget']=_0x395273['tileset'];});}get[_0x3d5d32(0xc6c)](){return this['clippingPlanes'];}get['inverseMatrix'](){const _0x30ce40={_0x139453:0xb4e,_0x488235:0x5bb,_0x520b2f:0x1fa,_0x55dc6c:0xf1b},_0x4aa02a=_0x3d5d32;if(!this['_inverseMatrix']){let _0x4c6fe8;const _0x1b4c58=this['_tileset'][_0x4aa02a(_0x30ce40._0x139453)]['transform'];_0x1b4c58&&_0x1b4c58[_0x4aa02a(0x71f)](Cesium__namespace['Matrix4']['IDENTITY'])||!_0x1b4c58?_0x4c6fe8=Cesium__namespace[_0x4aa02a(_0x30ce40._0x488235)]['eastNorthUpToFixedFrame'](this['_tileset']['boundingSphere']['center']):_0x4c6fe8=Cesium__namespace['Matrix4'][_0x4aa02a(_0x30ce40._0x520b2f)](this['_tileset']['root']['transform']),this['_inverseMatrix']=Cesium__namespace['Matrix4']['inverseTransformation'](_0x4c6fe8,new Cesium__namespace['Matrix4']());}return this[_0x4aa02a(_0x30ce40._0x55dc6c)];}get[_0x3d5d32(0xe72)](){const _0x1dda7f=_0x3d5d32;if(this[_0x1dda7f(0x873)])return this[_0x1dda7f(0x873)]['position'];return this[_0x1dda7f(0x841)]['boundingSphere']['center'];}get['distance'](){return this['_distance'];}set['distance'](_0x3a3f5a){const _0x3f027c={_0x1aebda:0xdea},_0x3e2cfc=_0x3d5d32;this['_distance']=_0x3a3f5a;if(this[_0x3e2cfc(_0x3f027c._0x1aebda)]&&this['clippingPlanes']['length']>0x0){const _0x294b42=this['clippingPlanes']['get'](this[_0x3e2cfc(0xdea)][_0x3e2cfc(0xc84)]-0x1);_0x294b42[_0x3e2cfc(0xbd7)]=_0x3a3f5a;}}get['angle1'](){return this['_normal_angle1']||0x0;}set['angle1'](_0x13b1a4){this['_normal_angle1']=_0x13b1a4;if(this['clippingPlanes']&&this['clippingPlanes']['length']>0x0){const _0x38f4a7=this['clippingPlanes']['get'](this['clippingPlanes']['length']-0x1);this['_updateNormal'](_0x38f4a7,_0x13b1a4,this['angle2']);}}get[_0x3d5d32(0x5df)](){return this['_normal_angle2']||0x0;}set['angle2'](_0x5869a2){this['_normal_angle2']=_0x5869a2;if(this['clippingPlanes']&&this['clippingPlanes']['length']>0x0){const _0x47217f=this['clippingPlanes']['get'](this['clippingPlanes']['length']-0x1);this['_updateNormal'](_0x47217f,this['angle1'],_0x5869a2);}}get[_0x3d5d32(0xe7b)](){return this['_normalZ']||0x0;}set[_0x3d5d32(0xe7b)](_0x25c77f){const _0x3f183b={_0x1873b1:0xdea,_0x4d5db9:0xdea,_0x413d6e:0xc84},_0x25d5e7=_0x3d5d32;this['_normalZ']=_0x25c77f;if(this[_0x25d5e7(_0x3f183b._0x1873b1)]&&this['clippingPlanes']['length']>0x0){const _0xc65ea4=this[_0x25d5e7(_0x3f183b._0x1873b1)]['get'](this[_0x25d5e7(_0x3f183b._0x4d5db9)][_0x25d5e7(_0x3f183b._0x413d6e)]-0x1);_0xc65ea4['normal']['z']=_0x25c77f;}}get['type'](){return this['_type'];}set['type'](_0x1ec75a){const _0x5bc9ea={_0x1da8da:0xe95,_0x56ab98:0x92d},_0x1b5898=_0x3d5d32;this[_0x1b5898(0xc5a)]=_0x1ec75a;let _0x10bdff;switch(_0x1ec75a){case ClipType['Z']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),0x1)];break;case ClipType['ZR']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x1b5898(0xe95))](0x0,0x0,-0x1),0x1)];break;case ClipType['X']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x1b5898(0xe95))](0x1,0x0,0x0),0x1)];break;case ClipType['XR']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x1b5898(_0x5bc9ea._0x1da8da))](-0x1,0x0,0x0),0x1)];break;case ClipType['Y']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x1b5898(_0x5bc9ea._0x1da8da))](0x0,0x1,0x0),0x1)];break;case ClipType['YR']:_0x10bdff=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,-0x1,0x0),0x1)];break;}this[_0x1b5898(_0x5bc9ea._0x56ab98)](_0x10bdff);}get['positions'](){return this['_positions'];}set['positions'](_0x495b8e){this['_positions']=LngLatArray['toCartesians'](_0x495b8e),this['_setPositions'](this['_positions']);}get['clipOutSide'](){return this['options']['clipOutSide'];}set['clipOutSide'](_0xf09852){const _0x5ab0d2=_0x3d5d32;this['options'][_0x5ab0d2(0x2c4)]=_0xf09852,this[_0x5ab0d2(0x1d1)]&&this['_positions']&&this['_setPositions'](this['_positions']);}[_0x3d5d32(0xe4c)](){const _0x1e5e24={_0x4dc532:0xea4},_0x3e6ef3=_0x3d5d32;this['options']['showPlane']&&(this['_graphicLayer']=new GraphicLayer({...this['options'],'private':!![]}),this['options'][_0x3e6ef3(0xd21)]&&this['_graphicLayer'][_0x3e6ef3(_0x1e5e24._0x4dc532)]([{'text':this['_map']['getLangText']('_删除'),'icon':Icon['Delete'],'callback':_0x492645=>{const _0x3d2c96=_0x3e6ef3,_0x3a8907=_0x492645['graphic'];if(!_0x3a8907)return;this[_0x3d2c96(0x32f)]['removeGraphic'](_0x3a8907),this['fire'](EventType[_0x3d2c96(0xf06)],_0x492645);}}]));if(this[_0x3e6ef3(0x433)]['layer'])this['layer']=this['options']['layer'];else this['options'][_0x3e6ef3(0x7f7)]&&(this['clipTarget']=this['options']['tileset']);}['_map_click'](_0x4d07b8){const _0x10c07d={_0x1851ac:0x59b},_0x3d4fd6=_0x3d5d32;this[_0x3d4fd6(_0x10c07d._0x1851ac)]&&(this['_last_planeGraphics']['hasEdit']=![],this['_last_planeGraphics']['material']['color']=this['_last_planeGraphics'][_0x3d4fd6(0xd8f)]['color_bak'],delete this['_last_planeGraphics']),this['_graphicLayer_leftUp'](_0x4d07b8);}['_graphicLayer_click'](_0x510dae){const _0x2d9e0f={_0x3d8969:0x328,_0x5d5c66:0xb84,_0x2a5c0d:0xe8f},_0x133ec7=_0x3d5d32;var _0x11fc03,_0x10b0a1;const _0x46b0ae=(_0x11fc03=_0x510dae[_0x133ec7(_0x2d9e0f._0x3d8969)])===null||_0x11fc03===void 0x0?void 0x0:(_0x10b0a1=_0x11fc03[_0x133ec7(0x4e0)])===null||_0x10b0a1===void 0x0?void 0x0:_0x10b0a1['plane'];Cesium__namespace[_0x133ec7(_0x2d9e0f._0x5d5c66)](_0x46b0ae)&&(this['_map_click'](),_0x46b0ae['hasEdit']=!_0x46b0ae['hasEdit'],_0x46b0ae['material']['color_bak']=_0x46b0ae[_0x133ec7(0xd8f)][_0x133ec7(0xe8f)],_0x46b0ae['material'][_0x133ec7(_0x2d9e0f._0x2a5c0d)]=_0x510dae['graphic']['style'][_0x133ec7(0x322)],_0x46b0ae['hasEdit']&&(this['_last_planeGraphics']=_0x46b0ae),_0x510dae['stopPropagation']());}['_graphicLayer_leftDown'](_0x279eab){const _0x161b08={_0xee47c9:0x6c8,_0x295026:0xfc1},_0x15579e=_0x3d5d32;var _0x22d805,_0x3f014e;const _0x3ba087=(_0x22d805=_0x279eab['graphic'])===null||_0x22d805===void 0x0?void 0x0:(_0x3f014e=_0x22d805['entity'])===null||_0x3f014e===void 0x0?void 0x0:_0x3f014e[_0x15579e(_0x161b08._0xee47c9)];Cesium__namespace['defined'](_0x3ba087)&&_0x3ba087['hasEdit']&&(this['_selectedPlane']=_0x3ba087['plane']['getValue'](),this['_map'][_0x15579e(_0x161b08._0x295026)]['screenSpaceCameraController']['enableInputs']&&(this['_map']['scene']['screenSpaceCameraController']['enableInputs']=![],this['_hasChangeEnableInputs']=!![]));}['_graphicLayer_leftUp'](_0x4f6f14){const _0x2bcf33={_0x419a9e:0x441,_0x3e5a1d:0xccc,_0x33267c:0xa70},_0x3132e6=_0x3d5d32;Cesium__namespace['defined'](this[_0x3132e6(_0x2bcf33._0x419a9e)])&&(delete this['_selectedPlane'],this['_hasChangeEnableInputs']&&(this['_map']['scene'][_0x3132e6(_0x2bcf33._0x3e5a1d)]['enableInputs']=!![],delete this[_0x3132e6(_0x2bcf33._0x33267c)]));}[_0x3d5d32(0x2fb)](_0x3334e1){if(Cesium__namespace['defined'](this['_selectedPlane'])){const _0x44669f=_0x3334e1['startPosition']['x']-_0x3334e1['endPosition']['x'],_0x57e929=_0x3334e1['startPosition']['y']-_0x3334e1['endPosition']['y'],_0x4ef69a=(_0x44669f+_0x57e929)/0x2;this['_selectedPlane']['distance']=(this['_selectedPlane']['distance']||0x0)+_0x4ef69a,this['_map']['openSmallTooltip'](_0x3334e1['endPosition'],this['_map']['getLangText']('_释放后完成修改'));}else this['_map']['closeSmallTooltip']();}[_0x3d5d32(0x226)](){const _0x1c931c={_0x4a8536:0x1d1,_0xc8096d:0xb59,_0x269293:0x433,_0x1dc043:0xbb8,_0x2181bd:0x433,_0x362a6b:0x7f5,_0x485949:0xbd7},_0x31e33f=_0x3d5d32;this['_graphicLayer']&&(this['_map']['addLayer'](this['_graphicLayer']),this['options']['editPlane']&&(this[_0x31e33f(_0x1c931c._0x4a8536)]['on'](EventType[_0x31e33f(_0x1c931c._0xc8096d)],this['_map_click'],this),this['_graphicLayer']['on'](EventType[_0x31e33f(0xb59)],this[_0x31e33f(0x4ea)],this),this['_graphicLayer']['on'](EventType['leftDown'],this['_graphicLayer_leftDown'],this),this['_graphicLayer']['on'](EventType['leftUp'],this['_graphicLayer_leftUp'],this),this['_map']['on'](EventType['mouseMove'],this['_map_mouseMove'],this))),this['clipTarget']&&(Cesium__namespace['defined'](this[_0x31e33f(_0x1c931c._0x269293)]['positions'])&&(this['positions']=this['options'][_0x31e33f(_0x1c931c._0x1dc043)]),Cesium__namespace[_0x31e33f(0xb84)](this[_0x31e33f(_0x1c931c._0x2181bd)][_0x31e33f(_0x1c931c._0x362a6b)])&&(this['type']=this['options']['type']),Cesium__namespace[_0x31e33f(0xb84)](this['options'][_0x31e33f(_0x1c931c._0x485949)])&&(this['distance']=this['options'][_0x31e33f(0xbd7)]));}['_removedHook'](){const _0x561e32={_0x2696dd:0x32f,_0x381415:0xd21,_0x43f68a:0xb59,_0x36bfff:0x314},_0x2a76b3=_0x3d5d32;this['clear'](),this[_0x2a76b3(_0x561e32._0x2696dd)]&&(this['options'][_0x2a76b3(_0x561e32._0x381415)]&&(this['_map'][_0x2a76b3(0x9e7)](EventType['click'],this['_map_click'],this),this['_graphicLayer']['off'](EventType[_0x2a76b3(_0x561e32._0x43f68a)],this['_graphicLayer_click'],this),this['_graphicLayer']['off'](EventType['leftDown'],this['_graphicLayer_leftDown'],this),this['_graphicLayer']['off'](EventType['leftUp'],this[_0x2a76b3(0xbc1)],this),this['_map']['off'](EventType[_0x2a76b3(_0x561e32._0x36bfff)],this['_map_mouseMove'],this)),this['_map']['removeLayer'](this['_graphicLayer']));}[_0x3d5d32(0xa89)](_0x1912ff){const _0x573016={_0x345860:0xc84,_0x47c5d0:0xdbf,_0x2b71da:0xb84,_0x1cbd94:0x92d},_0x5868cd=_0x3d5d32;if(_0x1912ff['length']<0x2)return;const _0x4ad97f=[];if(_0x1912ff[_0x5868cd(_0x573016._0x345860)]===0x2){const _0x589224=this['_createPlaneByLine'](_0x1912ff[0x0],_0x1912ff[0x1]);_0x589224&&_0x4ad97f['push'](_0x589224);}else{let _0x14a6f8;const _0x512832=formatNum$1(getAngle(_0x1912ff[0x0],_0x1912ff[0x1]),0x2);if(_0x512832>-0.02&&_0x512832<0.02)_0x14a6f8=![];else{const _0x3541a5=formatNum$1(getAngle(_0x1912ff[0x0],_0x1912ff[0x2]),0x2);_0x14a6f8=_0x512832<_0x3541a5;}this[_0x5868cd(0x2c4)]&&(_0x14a6f8=!_0x14a6f8);let _0x385673;for(let _0x5f1aea=0x0,_0x1b8497=_0x1912ff['length'];_0x5f1aea<_0x1b8497;++_0x5f1aea){const _0xde228b=(_0x5f1aea+0x1)%_0x1b8497;_0x14a6f8?_0x385673=this['_createPlaneByLine'](_0x1912ff[_0xde228b],_0x1912ff[_0x5f1aea]):_0x385673=this['_createPlaneByLine'](_0x1912ff[_0x5f1aea],_0x1912ff[_0xde228b]),_0x385673&&((Cesium__namespace['defined'](this['_normal_angle1'])||Cesium__namespace['defined'](this['_normal_angle2']))&&this['_updateNormal'](_0x385673,this[_0x5868cd(_0x573016._0x47c5d0)],this['angle2']),_0x4ad97f['push'](_0x385673));}Cesium__namespace[_0x5868cd(_0x573016._0x2b71da)](this['options'][_0x5868cd(0x83e)])&&(_0x385673=new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,-0x1),this['options']['height']),_0x4ad97f['push'](_0x385673));}this[_0x5868cd(_0x573016._0x1cbd94)](_0x4ad97f);}['_createPlaneByLine'](_0x2a8047,_0x4b8db0){const _0x25a2bb={_0x5bd5fe:0x6a7,_0xf9d28e:0xe95,_0x2da378:0xf69},_0x60fe61=_0x3d5d32;if(Cesium__namespace['Cartesian3']['distance'](_0x2a8047,_0x4b8db0)<0.1)return null;const _0xd08817=this[_0x60fe61(_0x25a2bb._0x5bd5fe)],_0x4038c6=Cesium__namespace['Matrix4']['multiplyByPoint'](_0xd08817,_0x2a8047,new Cesium__namespace[(_0x60fe61(_0x25a2bb._0xf9d28e))]()),_0x58f1f8=Cesium__namespace['Matrix4']['multiplyByPoint'](_0xd08817,_0x4b8db0,new Cesium__namespace[(_0x60fe61(0xe95))]()),_0x368135=new Cesium__namespace['Cartesian3'](0x0,0x0,0xa),_0x4caf40=Cesium__namespace['Cartesian3'][_0x60fe61(0xd97)](_0x58f1f8,_0x4038c6,new Cesium__namespace['Cartesian3']());let _0x50f003=Cesium__namespace[_0x60fe61(0xe95)][_0x60fe61(0x24c)](_0x4caf40,_0x368135,new Cesium__namespace['Cartesian3']());_0x50f003=Cesium__namespace['Cartesian3'][_0x60fe61(_0x25a2bb._0x2da378)](_0x50f003,_0x50f003);const _0xce913b=Cesium__namespace['Plane'][_0x60fe61(0xe3d)](_0x4038c6,_0x50f003);return Cesium__namespace[_0x60fe61(0xa42)]['fromPlane'](_0xce913b);}[_0x3d5d32(0x92d)](_0xa0b8f8){const _0x2a1400={_0x3ec772:0x2c4,_0x2d73c2:0x32f},_0x5916f6=_0x3d5d32;if(!_0xa0b8f8)return;const _0x45f29f=new Cesium__namespace['ClippingPlaneCollection']({'planes':_0xa0b8f8,'edgeWidth':this['options'][_0x5916f6(0xe58)]??0x0,'edgeColor':this['options']['edgeColor']??Cesium__namespace['Color'][_0x5916f6(0x7a7)],'unionClippingRegions':this[_0x5916f6(_0x2a1400._0x3ec772)]??![]});this['clippingPlanes']=_0x45f29f;this['clipTarget']&&(this['clipTarget']['clippingPlanes']=_0x45f29f);if(this['options']['showPlane']){this[_0x5916f6(_0x2a1400._0x2d73c2)][_0x5916f6(0x76d)]();const _0x534cd1=this[_0x5916f6(0x841)]['boundingSphere']['radius'];for(let _0x4f3123=0x0;_0x4f3123<_0x45f29f['length'];++_0x4f3123){var _0x3aeb84;const _0x30e2a4=_0x45f29f['get'](_0x4f3123),_0xb40667=new PlaneEntity({'position':this['center'],'style':{'heading':0x168-(((_0x3aeb84=this[_0x5916f6(0x873)])===null||_0x3aeb84===void 0x0?void 0x0:_0x3aeb84['rotation_z'])??0x0),'dimensions':new Cesium__namespace['Cartesian2'](_0x534cd1,_0x534cd1),'color':Cesium__namespace['Color']['WHITE']['withAlpha'](0.2),'editColor':Cesium__namespace['Color']['WHITE']['withAlpha'](0.5),'outline':!![],'outlineColor':Cesium__namespace['Color']['WHITE'],...this[_0x5916f6(0x433)]['planeStyle']||{},'plane':new Cesium__namespace['CallbackProperty'](createPlaneUpdateFunction(_0x30e2a4),![])}});this[_0x5916f6(0x32f)]['addGraphic'](_0xb40667);}}}['clear'](){const _0x784042={_0x44e954:0x9bd,_0x2c5ef0:0xdea},_0x4bafd1=_0x3d5d32;this['_graphicLayer']&&this['_graphicLayer']['clear']();delete this[_0x4bafd1(_0x784042._0x44e954)],delete this['_normal_angle1'],delete this['_normal_angle2'],delete this[_0x4bafd1(0x924)],this['options']['clipOutSide']=![];this[_0x4bafd1(0xdea)]&&delete this['clippingPlanes'];if(this['clipTarget']){var _0x506ecf;(_0x506ecf=this['clipTarget'][_0x4bafd1(_0x784042._0x2c5ef0)])!==null&&_0x506ecf!==void 0x0&&_0x506ecf['enabled']&&(this[_0x4bafd1(0xd0a)]['clippingPlanes']['enabled']=![]),this['clipTarget'][_0x4bafd1(0xdea)]=undefined;}}[_0x3d5d32(0x2f4)](_0x411254){const _0x41ad67=_0x3d5d32;if(this['clippingPlanes']==null)return;for(let _0x2a63ef=0x0;_0x2a63ef0x0||(_0x5bd0c7=this['options']['flat'])!==null&&_0x5bd0c7!==void 0x0&&_0x5bd0c7['enabled'])&&this[_0x404ed2(_0x2e6f3a._0x80a6bc)](),(((_0x4afc3e=this[_0x404ed2(_0x2e6f3a._0x33df85)][_0x404ed2(_0x2e6f3a._0xdd7216)])===null||_0x4afc3e===void 0x0?void 0x0:(_0x339d6e=_0x4afc3e['area'])===null||_0x339d6e===void 0x0?void 0x0:_0x339d6e[_0x404ed2(0xc84)])>0x0||(_0x28a8c2=this['options'][_0x404ed2(_0x2e6f3a._0x44f5a0)])!==null&&_0x28a8c2!==void 0x0&&_0x28a8c2['enabled'])&&this[_0x404ed2(0xda4)](),(((_0x2f81b5=this['options']['clip'])===null||_0x2f81b5===void 0x0?void 0x0:(_0x96436b=_0x2f81b5['area'])===null||_0x96436b===void 0x0?void 0x0:_0x96436b['length'])>0x0||(_0x2a80f9=this['options']['clip'])!==null&&_0x2a80f9!==void 0x0&&_0x2a80f9[_0x404ed2(_0x2e6f3a._0x25732a)])&&this['_initTilesetClip'](),(((_0x312298=this['options']['planClip'])===null||_0x312298===void 0x0?void 0x0:(_0x24e0b6=_0x312298['positions'])===null||_0x24e0b6===void 0x0?void 0x0:_0x24e0b6[_0x404ed2(0xc84)])>0x0||(_0x4a5cf7=this['options']['planClip'])!==null&&_0x4a5cf7!==void 0x0&&_0x4a5cf7[_0x404ed2(_0x2e6f3a._0x25732a)])&&this['_initTilesetPlanClip'](),this['_createCesium3DTileset']()['then'](_0x514ca7=>{const _0x2125f3=_0x404ed2;this[_0x2125f3(_0x1ddfcb._0x384239)](EventType['loadBefore'],{'tileset':_0x514ca7}),this['_initModel'](_0x514ca7),this[_0x2125f3(_0x1ddfcb._0x3ee025)]=!![],this[_0x2125f3(0xaf2)]['resolve'](this),this['fire'](EventType[_0x2125f3(_0x1ddfcb._0x469e4f)],{'tileset':_0x514ca7});});}['_removedHook'](){const _0xd885b6={_0x412dc0:0xa98,_0x3ebd55:0x1081,_0x169508:0xa98,_0x1e2c71:0x1081,_0x5ba546:0x33c,_0x2be2f7:0xb73,_0x2a5e12:0xd42,_0x57e4e6:0x588,_0x5d6184:0x841},_0x26719a=_0x3d5d32;this[_0x26719a(_0xd885b6._0x412dc0)]&&(this['_map'][_0x26719a(_0xd885b6._0x3ebd55)](this[_0x26719a(_0xd885b6._0x169508)],!![]),delete this['_tilesetClip']),this['_tilesetFlat']&&(this['_map'][_0x26719a(_0xd885b6._0x1e2c71)](this['_tilesetFlat'],!![]),delete this[_0x26719a(_0xd885b6._0x5ba546)]),this['_tilesetFlood']&&(this['_map']['removeThing'](this['_tilesetFlood'],!![]),delete this[_0x26719a(_0xd885b6._0x2be2f7)]),this['_tilesetPlanClip']&&(this['_map'][_0x26719a(0x1081)](this['_tilesetPlanClip'],!![]),delete this['_tilesetPlanClip']),Cesium__namespace['defined'](this['_map']['tilesetMaxTotalMemory'])&&(delete this['_map'][_0x26719a(0xa4b)][this['id']],this['_tileset'][_0x26719a(0xf6f)][_0x26719a(_0xd885b6._0x2a5e12)](this['_tileset_tileLoadHandler'],this)),super['_removedHook'](),Cesium__namespace['defined'](this['options'][_0x26719a(0xc42)])&&this['_map'][_0x26719a(0x9e7)](EventType[_0x26719a(_0xd885b6._0x57e4e6)],this['updateVisibleDistance'],this),this[_0x26719a(_0xd885b6._0x5d6184)]&&(this['_map']['scene']['primitives']['remove'](this['_tileset']),delete this['_tileset']);}['reload'](){const _0x13a5da={_0x431f0b:0x294,_0x1abd1b:0x226},_0x562931=_0x3d5d32;this['_readyPromise']=Cesium__namespace[_0x562931(_0x13a5da._0x431f0b)](),this['_removedHook'](),this[_0x562931(_0x13a5da._0x1abd1b)]();}['_mergePostion'](_0x3a3932){const _0x147964={_0x241d79:0xce3,_0x37e82e:0xe5e,_0x3e9f3d:0xd57,_0x27c2e1:0xd29},_0xe4e835=_0x3d5d32;_0x3a3932&&((Array['isArray'](_0x3a3932)||isString(_0x3a3932))&&(_0x3a3932=LngLatPoint[_0xe4e835(_0x147964._0x241d79)](_0x3a3932)),!this['_center']&&(this[_0xe4e835(_0x147964._0x37e82e)]=new LngLatPoint()),_0x3a3932[_0xe4e835(_0x147964._0x3e9f3d)]&&(this['center']['lat']=_0x3a3932['lat']),_0x3a3932['lng']&&(this['center']['lng']=_0x3a3932[_0xe4e835(0x5d8)]),Cesium__namespace['defined'](_0x3a3932['alt_offset'])&&(this['center']['alt']=this['_orginCenterPoint']['alt']+_0x3a3932['alt_offset']),Cesium__namespace[_0xe4e835(0xb84)](_0x3a3932['alt'])&&(this['center'][_0xe4e835(_0x147964._0x27c2e1)]=_0x3a3932[_0xe4e835(_0x147964._0x27c2e1)]));}['_setOptionsHook'](_0x260e5c,_0x4d9e25){const _0x4fac17={_0x1660ab:0x56e,_0x57b244:0x786,_0x681562:0x981,_0x1582bc:0xfdc,_0x2f753e:0x7f7},_0x2f0555=_0x3d5d32;if(!this[_0x2f0555(0x841)])return;let _0x1ded53;for(const _0x3a3c78 in _0x4d9e25){const _0x37309c=_0x260e5c[_0x3a3c78];switch(_0x3a3c78){case _0x2f0555(_0x4fac17._0x1660ab):{var _0x471820,_0x41663f;(_0x471820=this['_last_picked'])!==null&&_0x471820!==void 0x0&&_0x471820['event']&&!((_0x41663f=_0x4d9e25['highlight'])!==null&&_0x41663f!==void 0x0&&_0x41663f[_0x2f0555(0x7f5)])?this['_highlight_mouseEventHandler'](this['_last_picked']['event']):super['_setOptionsHook'](_0x260e5c,_0x4d9e25);return;}case'classificationType':case'chinaCRS':case'flat':case _0x2f0555(_0x4fac17._0x57b244):case'clip':case'planClip':{this[_0x2f0555(_0x4fac17._0x681562)]();return;}case _0x2f0555(0xb69):case'rotation':case'scale':case'axis':_0x1ded53=!![];break;case _0x2f0555(_0x4fac17._0x1582bc):case'luminanceAtZenith':case'style':case'marsJzwStyle':case'customShader':this[_0x3a3c78]=_0x37309c;break;default:{try{this[_0x2f0555(_0x4fac17._0x2f753e)][_0x3a3c78]=_0x37309c;}catch(_0x463b4f){this['reload']();}break;}}}_0x1ded53&&(this['_mergePostion'](this[_0x2f0555(0x433)]['position']),this['updateMatrix']());}['_initModel'](_0x523774){const _0x2ecab0={_0x230ae6:0xe20,_0x4f214f:0xa4b,_0x150ceb:0x315,_0x47b57b:0x3fd,_0x3d3114:0x220,_0x3d4397:0x9dc,_0x1ee8ce:0xf5d,_0x18587c:0xe95,_0x502d0b:0xa4f,_0x6e7d19:0xaed,_0x3fc746:0xa4f,_0x4a95d9:0x4c9,_0x4709e8:0xb09,_0x4f198e:0x52c,_0x2635fa:0x60d,_0x19b68f:0xdde,_0x13c4ad:0xb69,_0x488168:0x49d,_0x24134f:0x1052},_0x430ca3=_0x3d5d32;var _0x4f2359,_0x22f7ae;this['_tileset']=_0x523774,this['_tileset']['name']=this['name'],this['_tileset'][_0x430ca3(0x792)]=this['show'],this['_tileset'][_0x430ca3(_0x2ecab0._0x230ae6)]=this['id'],this['_map']['scene'][_0x430ca3(0x730)]['add'](this['_tileset']),this[_0x430ca3(0x841)]['initialTilesLoaded']['addEventListener'](_0x4d21d2=>{const _0x3bbd7f=_0x430ca3;this['fire'](EventType[_0x3bbd7f(0x229)],_0x4d21d2);}),this['_tileset']['allTilesLoaded']['addEventListener'](_0x3f5d99=>{this['fire'](EventType['allTilesLoaded'],_0x3f5d99);});Cesium__namespace['defined'](this['_map'][_0x430ca3(0x2e0)])&&(this['_map'][_0x430ca3(_0x2ecab0._0x4f214f)]=this[_0x430ca3(0x1d1)]['_tilesets']||{},this['_map']['_tilesets'][this['id']]=this[_0x430ca3(0x841)],this['_tileset']['tileLoad']['addEventListener'](this['_tileset_tileLoadHandler'],this));this['_orginCenterPosition']=Cesium__namespace[_0x430ca3(_0x2ecab0._0x150ceb)](this[_0x430ca3(0x841)][_0x430ca3(0x788)]['center']);const _0xc998cb=(_0x4f2359=this['_tileset']['root'])===null||_0x4f2359===void 0x0?void 0x0:_0x4f2359['transform'];this['transform']=this['options'][_0x430ca3(0x461)]??Boolean(_0xc998cb&&!_0xc998cb['equals'](Cesium__namespace['Matrix4']['IDENTITY']));if(this['transform']){this[_0x430ca3(0x9be)]=Cesium__namespace['Matrix4']['inverse'](Cesium__namespace['Matrix4'][_0x430ca3(0x1fa)](this['_tileset']['_root']['transform']),new Cesium__namespace['Matrix4']());const _0x3f1515=Cesium__namespace[_0x430ca3(0xf5d)]['fromArray'](this['_tileset'][_0x430ca3(_0x2ecab0._0x47b57b)]['transform']),_0x426094=Cesium__namespace['Matrix4']['getTranslation'](_0x3f1515,new Cesium__namespace['Cartesian3']());if(Cesium__namespace['defined'](_0x426094)&&Cesium__namespace[_0x430ca3(_0x2ecab0._0x3d3114)]['fromCartesian'](_0x426094)){this['_orginCenterPosition']=_0x426094;const _0x312bf9=Cesium__namespace['Matrix4']['getMatrix3'](_0x3f1515,new Cesium__namespace[(_0x430ca3(_0x2ecab0._0x3d4397))]()),_0x559d48=Cesium__namespace[_0x430ca3(_0x2ecab0._0x1ee8ce)]['getMatrix3'](Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x426094),new Cesium__namespace['Matrix3']()),_0x35d33c=Cesium__namespace['Matrix3']['getColumn'](_0x559d48,0x0,new Cesium__namespace['Cartesian3']()),_0x5be5e3=Cesium__namespace['Matrix3']['getColumn'](_0x559d48,0x1,new Cesium__namespace[(_0x430ca3(_0x2ecab0._0x18587c))]()),_0x34cfb7=Cesium__namespace['Matrix3']['getColumn'](_0x559d48,0x2,new Cesium__namespace['Cartesian3']());let _0x5446fb=Cesium__namespace['Matrix3']['getColumn'](_0x312bf9,0x0,new Cesium__namespace[(_0x430ca3(0xe95))]());_0x5446fb=Cesium__namespace['Cartesian3']['cross'](_0x5446fb,_0x34cfb7,_0x5446fb),_0x5446fb=Cesium__namespace['Cartesian3']['cross'](_0x34cfb7,_0x5446fb,_0x5446fb),_0x5446fb=Cesium__namespace['Cartesian3'][_0x430ca3(0xf69)](_0x5446fb,_0x5446fb);let _0x43bdae=Cesium__namespace[_0x430ca3(0xe95)]['angleBetween'](_0x35d33c,_0x5446fb);const _0xd89571=Cesium__namespace['Cartesian3']['angleBetween'](_0x5be5e3,_0x5446fb);_0xd89571>Math['PI']*0.5&&(_0x43bdae=0x2*Math['PI']-_0x43bdae),this['orginRotation']={'x':0x0,'y':0x0,'z':Number(Cesium__namespace['Math']['toDegrees'](_0x43bdae)['toFixed'](0x1))};}else this['transform']=![];}this[_0x430ca3(_0x2ecab0._0x502d0b)]=LngLatPoint['fromCartesian'](this['_orginCenterPosition']),logInfo((this[_0x430ca3(_0x2ecab0._0x6e7d19)]||'TilesetLayer')+'\x20模型中心位置:'+this[_0x430ca3(_0x2ecab0._0x3fc746)][_0x430ca3(_0x2ecab0._0x4a95d9)]());if((_0x22f7ae=Cesium__namespace[_0x430ca3(_0x2ecab0._0x4709e8)])!==null&&_0x22f7ae!==void 0x0&&_0x22f7ae[_0x430ca3(_0x2ecab0._0x4f198e)]){const _0x48260d=Cesium__namespace['Mars3DEx'][_0x430ca3(_0x2ecab0._0x4f198e)](this['id']);_0x48260d!==null&&_0x48260d!==void 0x0&&_0x48260d['marsJzwStyle']&&_0x48260d['marsJzwStyle']['setUniform'](_0x430ca3(_0x2ecab0._0x2635fa),this['upAxis']===Cesium__namespace['Axis']['Z']);}Cesium__namespace[_0x430ca3(0xb84)](this['options'][_0x430ca3(_0x2ecab0._0x19b68f)])&&(this['style']=this['options'][_0x430ca3(0xdde)]);this['_opacity']!==0x1&&this['setOpacity'](this['_opacity']);this['_center']=this['_orginCenterPoint']['clone'](),this['_mergePostion'](this[_0x430ca3(0x433)][_0x430ca3(_0x2ecab0._0x13c4ad)]);if(this['options']['chinaCRS']){const _0x12af4d=this[_0x430ca3(_0x2ecab0._0x488168)](this['center']);this['_mergePostion'](_0x12af4d);}this['_hasUpdateMater']()&&this[_0x430ca3(_0x2ecab0._0x24134f)](),Cesium__namespace['defined'](this['options']['distanceDisplayCondition_far'])&&this['bindVisibleDistance'](),this['options']['clampToGround']&&this['clampToGround'](),this['options'][_0x430ca3(0xd67)]&&this[_0x430ca3(0x28e)]();}['clampToGround'](_0x4a4281=0x1){const _0x50149f={_0x3910e5:0xf0b,_0x16d855:0x1d1},_0x531414=_0x3d5d32;this[_0x531414(0x1d1)]&&this[_0x531414(0x1d1)][_0x531414(_0x50149f._0x3910e5)]?getSurfaceTerrainHeight(this[_0x531414(_0x50149f._0x16d855)]['scene'],this['_orginCenterPosition'])['then'](_0x5a79c1=>{const _0x2cba6f=_0x531414;Cesium__namespace[_0x2cba6f(0xb84)](_0x5a79c1['height'])&&(this['alt']=_0x5a79c1['height']-this['_orginCenterPoint']['alt']+_0x4a4281);}):this['alt']=-this['_orginCenterPoint']['alt']+_0x4a4281;}['_hasUpdateMater'](){const _0x4aedea={_0x84ea57:0x71f},_0x1caa43=_0x3d5d32;if(!this['center'][_0x1caa43(_0x4aedea._0x84ea57)](this[_0x1caa43(0xa4f)]))return!![];if(this['options'][_0x1caa43(0x31f)])return!![];if(this['options'][_0x1caa43(0x515)]>0x0&&this[_0x1caa43(0x433)]['scale']!==0x1)return!![];if(Cesium__namespace['defined'](this['options'][_0x1caa43(0xa71)]))return!![];return![];}['updateMatrix'](){const _0x1130ae={_0x4fd571:0x841,_0x15dbd9:0x724,_0x4d1ede:0xb69,_0x2939cf:0x9dc,_0x17137b:0xf2a,_0x4510c1:0xe08,_0x452a54:0xe37,_0x3a7c6d:0x989,_0x210232:0xf5d,_0x5bb869:0x433,_0x19f21c:0x515,_0x2b19ea:0xa71,_0x17522b:0x433,_0xd2ff8c:0x2ac,_0x3a4d3b:0x2ac,_0x56c780:0xb18,_0x8b7604:0xb18,_0x55722c:0x461,_0x47e029:0x3e8},_0x253dc6=_0x3d5d32;if(!this[_0x253dc6(_0x1130ae._0x4fd571)])return undefined;if(this['options']['updateMatrix']){const _0x305942=this['options']['updateMatrix'](this['position'],this);return this['_tileset']['modelMatrix']=_0x305942,_0x305942;}if(!this['transform'])return this['updateMatrix2']();let _0x1e6a3f=Cesium__namespace['Transforms'][_0x253dc6(_0x1130ae._0x15dbd9)](this[_0x253dc6(_0x1130ae._0x4d1ede)]);if(this['options']['rotation']){const _0x1ad072=Cesium__namespace[_0x253dc6(_0x1130ae._0x2939cf)][_0x253dc6(_0x1130ae._0x17137b)](Cesium__namespace['Math']['toRadians'](this['rotation_x'])),_0x1b87a4=Cesium__namespace['Matrix3'][_0x253dc6(_0x1130ae._0x4510c1)](Cesium__namespace[_0x253dc6(0x103e)]['toRadians'](this[_0x253dc6(_0x1130ae._0x452a54)])),_0x46fdba=Cesium__namespace[_0x253dc6(0x9dc)][_0x253dc6(_0x1130ae._0x3a7c6d)](Cesium__namespace['Math'][_0x253dc6(0x562)](0x168-this['rotation_z'])),_0x3324ba=Cesium__namespace[_0x253dc6(0xf5d)]['fromRotationTranslation'](_0x1ad072),_0x47bab1=Cesium__namespace[_0x253dc6(_0x1130ae._0x210232)]['fromRotationTranslation'](_0x1b87a4),_0xcb49e6=Cesium__namespace['Matrix4']['fromRotationTranslation'](_0x46fdba);Cesium__namespace['Matrix4']['multiply'](_0x1e6a3f,_0x3324ba,_0x1e6a3f),Cesium__namespace[_0x253dc6(_0x1130ae._0x210232)]['multiply'](_0x1e6a3f,_0x47bab1,_0x1e6a3f),Cesium__namespace[_0x253dc6(0xf5d)]['multiply'](_0x1e6a3f,_0xcb49e6,_0x1e6a3f);}this[_0x253dc6(_0x1130ae._0x5bb869)]['scale']>0x0&&this['options']['scale']!==0x1&&Cesium__namespace['Matrix4'][_0x253dc6(0xb62)](_0x1e6a3f,this['options'][_0x253dc6(_0x1130ae._0x19f21c)],_0x1e6a3f);if(Cesium__namespace[_0x253dc6(0xb84)](this[_0x253dc6(0x433)][_0x253dc6(0xa71)])){let _0x54a2c0;if(isString(this[_0x253dc6(_0x1130ae._0x5bb869)][_0x253dc6(_0x1130ae._0x2b19ea)]))switch(this[_0x253dc6(_0x1130ae._0x17522b)]['axis']['toUpperCase']()){case _0x253dc6(_0x1130ae._0xd2ff8c):_0x54a2c0=Cesium__namespace[_0x253dc6(0xb18)][_0x253dc6(_0x1130ae._0x3a4d3b)];break;case _0x253dc6(0xcfe):_0x54a2c0=Cesium__namespace['Axis'][_0x253dc6(0xcfe)];break;case'X_UP_TO_Z_UP':_0x54a2c0=Cesium__namespace[_0x253dc6(_0x1130ae._0x56c780)]['X_UP_TO_Z_UP'];break;case _0x253dc6(0x6e7):_0x54a2c0=Cesium__namespace['Axis'][_0x253dc6(0x6e7)];break;case'X_UP_TO_Y_UP':_0x54a2c0=Cesium__namespace['Axis']['X_UP_TO_Y_UP'];break;case'Y_UP_TO_X_UP':_0x54a2c0=Cesium__namespace[_0x253dc6(_0x1130ae._0x8b7604)]['Y_UP_TO_X_UP'];break;}else this[_0x253dc6(0x433)]['axis']instanceof Cesium__namespace['Axis']&&(_0x54a2c0=this['options']['axis']);_0x54a2c0&&(_0x1e6a3f=Cesium__namespace['Matrix4']['multiplyTransformation'](_0x1e6a3f,_0x54a2c0,_0x1e6a3f));}return this[_0x253dc6(_0x1130ae._0x4fd571)][_0x253dc6(0x3fd)][_0x253dc6(_0x1130ae._0x55722c)]=_0x1e6a3f,this['fire'](EventType[_0x253dc6(_0x1130ae._0x47e029)],{'position':this['position']}),_0x1e6a3f;}['updateMatrix2'](){const _0x245cc1={_0x13a5e0:0x3fd,_0x144483:0xe95,_0x595af2:0xefc},_0x3c8152=_0x3d5d32;if(!this['_tileset']||!this['_tileset'][_0x3c8152(_0x245cc1._0x13a5e0)])return;const _0x35da00=Cesium__namespace[_0x3c8152(0x220)]['fromCartesian'](this['_tileset']['boundingSphere']['center']),_0x40f1fc=Cesium__namespace[_0x3c8152(0xe95)][_0x3c8152(0x7d1)](_0x35da00['longitude'],_0x35da00['latitude'],0x0),_0x1ce545=this['position'],_0x5ae5ab=Cesium__namespace['Cartesian3']['subtract'](_0x1ce545,_0x40f1fc,new Cesium__namespace[(_0x3c8152(_0x245cc1._0x144483))]()),_0x3be7e2=Cesium__namespace['Matrix4']['fromTranslation'](_0x5ae5ab);return this['_tileset']['modelMatrix']=_0x3be7e2,this[_0x3c8152(_0x245cc1._0x595af2)](EventType[_0x3c8152(0x3e8)],{'position':this['position']}),_0x3be7e2;}['getPositionByOrginMatrix'](_0x474b00){const _0x2b655e={_0x5e9164:0x461,_0x187e42:0xf5d,_0x2a5a8c:0xf5d},_0x2d3618=_0x3d5d32;if(this['orginMatrix']){const _0x2849fa=Cesium__namespace['Matrix4']['multiply'](this['_tileset']['_root'][_0x2d3618(_0x2b655e._0x5e9164)],this['orginMatrix'],new Cesium__namespace[(_0x2d3618(_0x2b655e._0x187e42))]());return Cesium__namespace[_0x2d3618(_0x2b655e._0x2a5a8c)]['multiplyByPoint'](_0x2849fa,_0x474b00,new Cesium__namespace['Cartesian3']());}return _0x474b00;}['setOpacity'](_0x19cc34){this['options']['onSetOpacity']?this['options']['onSetOpacity'](_0x19cc34):this['_tileset']&&(this['_tileset']['style']=new Cesium__namespace['Cesium3DTileStyle']({'color':'color()\x20*vec4(1,1,1,'+_0x19cc34+')'}));}['flyTo'](_0x2941fd={}){const _0x4b2f93={_0x4f3112:0x1d1,_0x2a8de6:0x23f,_0x4ed269:0xc53,_0xd5bf8a:0x788},_0x407772={_0x31884b:0x841},_0x56ecfa=_0x3d5d32;if(!this[_0x56ecfa(0x1d1)])return Promise['resolve'](![]);this[_0x56ecfa(_0x4b2f93._0x4f3112)]['cancelFlyTo']();this[_0x56ecfa(0x433)][_0x56ecfa(_0x4b2f93._0x2a8de6)]&&(_0x2941fd={...this['options']['flyToOptions'],..._0x2941fd});if(this['options'][_0x56ecfa(0xe72)])return this['_map'][_0x56ecfa(_0x4b2f93._0x4ed269)](this['options']['center'],_0x2941fd);else{if(this['options']['extent'])return this['_map']['flyToExtent'](this['options']['extent'],_0x2941fd);else return this['loadOk']&&this['_tileset']['_root']?this[_0x56ecfa(0x1d1)]['flyToPoint'](this['_tileset'][_0x56ecfa(_0x4b2f93._0xd5bf8a)]['center'],{'radius':this['_tileset']['boundingSphere']['radius']*0x2,'maxPitch':-0x2d,..._0x2941fd}):this['readyPromise']['then'](_0x9246d4=>{const _0x58ef0d=_0x56ecfa;return this['_map']['flyToPoint'](this['_tileset']['boundingSphere']['center'],{'radius':this[_0x58ef0d(_0x407772._0x31884b)]['boundingSphere']['radius']*0x2,'maxPitch':-0x2d,..._0x2941fd});});}}['_toJsonEx'](_0x442a55){const _0xb36454={_0x4825cc:0xa98,_0x41d1b8:0x1010,_0x42e6af:0x6a8,_0x49f07e:0x33c},_0x683ba2=_0x3d5d32;if(!this['_tileset']||!this['loadOk'])return;_0x442a55[_0x683ba2(0xb69)]=this['center']['toArray'](),this['_tilesetPlanClip']&&(_0x442a55[_0x683ba2(0x4c4)]=this['_tilesetPlanClip']['toJSON']()),this[_0x683ba2(_0xb36454._0x4825cc)]&&(_0x442a55[_0x683ba2(_0xb36454._0x41d1b8)]=this[_0x683ba2(0xa98)]['toJSON']()),this['_tilesetFlat']&&(_0x442a55[_0x683ba2(_0xb36454._0x42e6af)]=this[_0x683ba2(_0xb36454._0x49f07e)]['toJSON']()),this[_0x683ba2(0xb73)]&&(_0x442a55['flood']=this['_tilesetFlood'][_0x683ba2(0x3db)]());}[_0x3d5d32(0x6f0)](_0x27497c,_0x3cb8a6){const _0x1b4486={_0x369fba:0x95a},_0xbe5db3=_0x3d5d32;return this['_idField']=_0x27497c,this[_0xbe5db3(_0x1b4486._0x369fba)]={},_0x3cb8a6['forEach'](_0x167ca1=>{const _0x13b643=_0x167ca1[_0x27497c];this['_properties'][_0x13b643]=_0x167ca1;}),this[_0xbe5db3(0x2e3)](),this;}['delProperties'](_0x36864f,_0x6e8b4e){const _0x519dc4={_0x57a235:0x74d},_0x5857f0={_0x304b84:0x95a},_0x2e602c=_0x3d5d32;if(!_0x36864f||!_0x6e8b4e){delete this['_properties'];this[_0x2e602c(_0x519dc4._0x57a235)]&&(this[_0x2e602c(0x841)]['tileVisible']['removeEventListener'](this['_updateTile'],this),this[_0x2e602c(0x74d)]=![]);return;}return _0x6e8b4e['forEach'](_0x4476ab=>{const _0x162c12=_0x2e602c,_0x436aff=_0x4476ab[_0x36864f];delete this[_0x162c12(_0x5857f0._0x304b84)][_0x436aff];}),this;}[_0x3d5d32(0x2e3)](){const _0x4e8422={_0x3d292e:0xccd},_0x4e8b8c={_0x28d9a2:0x841},_0x4aef32=_0x3d5d32;!this['_isBindTileVisible']&&this[_0x4aef32(_0x4e8422._0x3d292e)]['then'](()=>{const _0x256e82=_0x4aef32;this[_0x256e82(_0x4e8b8c._0x28d9a2)]['tileVisible']['addEventListener'](this['_updateTile'],this),this['_isBindTileVisible']=!![];});}['_updateTile'](_0xd1673e){const _0x2a6893={_0x5caa7a:0x240,_0x4882b4:0x635},_0x144c33=_0x3d5d32,_0x54ca6b=_0xd1673e[_0x144c33(0xfde)];for(let _0x50c8af=0x0;_0x50c8af<_0x54ca6b['featuresLength'];_0x50c8af++){const _0x36e827=_0x54ca6b['getFeature'](_0x50c8af);if(this[_0x144c33(0x95a)]){const _0x2a1c2d=_0x36e827['getProperty'](this[_0x144c33(_0x2a6893._0x5caa7a)]);_0x2a1c2d&&this['_setFeatureProperties'](_0x36e827,this[_0x144c33(0x95a)][_0x2a1c2d]);}}this[_0x144c33(0xefc)](EventType[_0x144c33(_0x2a6893._0x4882b4)]);}['_setFeatureProperties'](_0x5663b1,_0x4091c1){const _0x39c8af=_0x3d5d32;if(!_0x5663b1||!_0x4091c1)return;for(const _0x4cb936 in _0x4091c1){const _0x2712a0=_0x4091c1[_0x4cb936];if(_0x5663b1[_0x39c8af(0x589)](_0x4cb936)&&_0x5663b1[_0x39c8af(0x373)](_0x4cb936)===_0x2712a0)continue;_0x5663b1['setProperty'](_0x4cb936,_0x2712a0);}}[_0x3d5d32(0x3be)](){const _0x1819cf=_0x3d5d32;let _0x437cbd=0x0;const _0x198232=this[_0x1819cf(0x1d1)][_0x1819cf(0xa4b)];for(const _0x200220 in _0x198232){_0x437cbd+=_0x198232[_0x200220]['totalMemoryUsageInBytes']/0x400/0x400;}if(_0x437cbd>this['_map']['tilesetMaxTotalMemory'])for(const _0x47b87f in _0x198232){_0x198232[_0x47b87f]['trimLoadedTiles']();}}['transformCenter'](_0x468e9d){const _0x2de5c0=_0x3d5d32;if(!_0x468e9d)return![];const _0x3d95bb=this['_map']['chinaCRS'],_0x41ca1c=this['options'][_0x2de5c0(0xd96)],_0x54d4a1=getTransFun(_0x41ca1c,_0x3d95bb);if(!_0x54d4a1)return![];const _0x1437e9=_0x54d4a1([_0x468e9d['lng'],_0x468e9d['lat']]);return{'lng':_0x1437e9[0x0],'lat':_0x1437e9[0x1],'alt':_0x468e9d['alt']};}['bindVisibleDistance'](){this['_map']['on'](EventType['cameraChanged'],this['updateVisibleDistance'],this);}['updateVisibleDistance'](){const _0x1b50b8={_0x5258a3:0x443,_0x1b8bb2:0x433},_0x20eabd=_0x3d5d32;if(!this[_0x20eabd(_0x1b50b8._0x5258a3)]||!this[_0x20eabd(0x841)]||!this['loadOk'])return;if(this['_map']['scene']['mode']!==Cesium__namespace['SceneMode']['SCENE3D'])return;const _0x400f3d=Cesium__namespace[_0x20eabd(0xe95)]['distance'](this[_0x20eabd(0xb69)],this['_map']['camera']['positionWC']);this['_tileset']['show']=_0x400f3d{const _0xa26d41=_0x52b5ba;this['fire'](EventType['loadBefore'],{'provider':_0x5e1c79}),this['_initModel'](_0x5e1c79),this['loadOk']=!![],this['_readyPromise'][_0xa26d41(0xac9)](this),this['fire'](EventType[_0xa26d41(_0x35d65b._0x584e7f)],{'provider':_0x5e1c79,'layers':_0x5e1c79['_layers']});});}['_removedHook'](){const _0x494557={_0x34dda0:0x730},_0x12b635=_0x3d5d32;super['_removedHook'](),this['_i3sProvider']&&(this['_map']['scene'][_0x12b635(_0x494557._0x34dda0)]['remove'](this['_i3sProvider']),delete this['_i3sProvider']);}[_0x3d5d32(0x981)](){const _0x1cb1fe={_0x5ee465:0x566},_0x242c67=_0x3d5d32;this[_0x242c67(_0x1cb1fe._0x5ee465)](),this['_addedHook']();}[_0x3d5d32(0xf2f)](_0xf661b9){const _0x51b2b6={_0x5a4f14:0x792,_0x427a74:0x86b,_0x2a25e8:0x756,_0x4013b3:0x8dc,_0x511822:0xb45,_0x1051cd:0xe5e,_0x43b378:0xa4f},_0x5605c7=_0x3d5d32;this['_i3sProvider']=_0xf661b9,this['_i3sProvider']['_mars3d_layerId']=this['id'],this['_i3sProvider'][_0x5605c7(_0x51b2b6._0x5a4f14)]=this['show'],this[_0x5605c7(0x1d1)]['scene']['primitives'][_0x5605c7(0xff3)](this['_i3sProvider']),this[_0x5605c7(0x779)]=this['_i3sProvider'][_0x5605c7(_0x51b2b6._0x427a74)],this['_orginCenterPoint']=LngLatPoint['fromCartographic'](Cesium__namespace[_0x5605c7(_0x51b2b6._0x2a25e8)]['center'](this['_extent'])),this[_0x5605c7(_0x51b2b6._0x4013b3)]=this['_orginCenterPoint'][_0x5605c7(0xed4)](),logInfo((this['name']||_0x5605c7(0x854))+_0x5605c7(_0x51b2b6._0x511822)+this['_orginCenterPoint']['toString']()),this[_0x5605c7(_0x51b2b6._0x1051cd)]=this[_0x5605c7(_0x51b2b6._0x43b378)][_0x5605c7(0x315)](),this['options']['flyTo']&&this[_0x5605c7(0x28e)]();}['flyTo'](_0x3a45d6={}){const _0x33d7cf={_0x2ec620:0x1d1,_0x207f32:0xe5e,_0x2e20ce:0x629},_0x40bec5=_0x3d5d32;if(!this[_0x40bec5(_0x33d7cf._0x2ec620)])return Promise[_0x40bec5(0xac9)](![]);this['_map']['cancelFlyTo']();this['options']['flyToOptions']&&(_0x3a45d6={...this['options']['flyToOptions'],..._0x3a45d6});if(this['options']['center'])return this[_0x40bec5(0x1d1)]['setCameraView'](this['options']['center'],_0x3a45d6);else{if(this['options']['extent'])return this[_0x40bec5(0x1d1)]['flyToExtent'](this['options']['extent'],_0x3a45d6);else{if(this[_0x40bec5(_0x33d7cf._0x207f32)])return this[_0x40bec5(_0x33d7cf._0x2ec620)][_0x40bec5(_0x33d7cf._0x2e20ce)](this['_center'],{'maxPitch':-0x2d,..._0x3a45d6});}}}[_0x3d5d32(0x1039)](){const _0x1fef3d={_0x24dde5:0xbff,_0x5a1014:0x4aa,_0x3b67dd:0x83f,_0x2973b2:0xebc},_0x129167=_0x3d5d32;var _0x52bc8c;if(!((_0x52bc8c=Cesium__namespace['Mars3DEx'])!==null&&_0x52bc8c!==void 0x0&&_0x52bc8c['getCacheOrAdd']))return;this[_0x129167(_0x1fef3d._0x24dde5)]['customShaders']=this['id'];const _0x1cfb27=Cesium__namespace['Mars3DEx']['getCacheOrAdd'](this['id']);this[_0x129167(_0x1fef3d._0x5a1014)]?_0x1cfb27['marsJzwStyle']=new Cesium__namespace['CustomShader']({'lightingModel':Cesium__namespace[_0x129167(_0x1fef3d._0x3b67dd)][_0x129167(0x7ed)],'uniforms':{'u_mars3d_jzw_upz':{'type':Cesium__namespace['UniformType'][_0x129167(_0x1fef3d._0x2973b2)],'value':![]}},'fragmentShaderText':isString(this[_0x129167(0x4aa)])?this['marsJzwStyle']:_0x129167(0x300)}):delete _0x1cfb27[_0x129167(0x4aa)];}}register$2('i3s',I3SLayer);const mins=[Cesium__namespace['Math']['toRadians'](0.05),Cesium__namespace['Math']['toRadians'](0.1),Cesium__namespace['Math']['toRadians'](0.2),Cesium__namespace['Math']['toRadians'](0.5),Cesium__namespace['Math']['toRadians'](0x1),Cesium__namespace['Math'][_0x3d5d32(0x562)](0x2),Cesium__namespace['Math'][_0x3d5d32(0x562)](0x5),Cesium__namespace[_0x3d5d32(0x103e)]['toRadians'](0xa)];function gridPrecision(_0x22055b){if(_0x22055b<0.01)return 0x2;if(_0x22055b<0.1)return 0x1;if(_0x22055b<0x1)return 0x0;return 0x0;}function GraticuleProvider(_0x41c305){const _0x272fe3={_0x1319be:0x5c1,_0xecc434:0xa14,_0x2ce895:0x58a,_0x4abb7b:0x730,_0x21285f:0x486,_0x567ee6:0x83e,_0x5b6140:0x627,_0x453398:0xa18},_0x205ae8={_0x541917:0x443,_0x47df6b:0xa7f},_0x3caafc=_0x3d5d32;this['options']=_0x41c305,this['_tilingScheme']=_0x41c305['tilingScheme']||new Cesium__namespace['GeographicTilingScheme'](),this['_tileWidth']=_0x41c305['tileWidth']||0x100,this[_0x3caafc(_0x272fe3._0x1319be)]=_0x41c305['tileHeight']||0x100,this['_ready']=!![],this[_0x3caafc(0xc6e)]=_0x41c305['sexagesimal']||![],this['_numLines']=_0x41c305[_0x3caafc(_0x272fe3._0xecc434)]||0x32,this['_scene']=_0x41c305[_0x3caafc(0xfc1)],this[_0x3caafc(_0x272fe3._0x2ce895)]=this['_scene']['globe']['ellipsoid'],this['_labels']=new Cesium__namespace[(_0x3caafc(0x2b7))](),this['_scene'][_0x3caafc(_0x272fe3._0x4abb7b)]['add'](this['_labels']),this['_polylines']=new Cesium__namespace['PolylineCollection'](),this['_scene']['primitives']['add'](this[_0x3caafc(_0x272fe3._0x21285f)]);const _0x2249f1=document['createElement'](_0x3caafc(0x60f));_0x2249f1['width']=0x100,_0x2249f1[_0x3caafc(_0x272fe3._0x567ee6)]=0x100,this['_canvas']=_0x2249f1;const _0x1e9c73=this;this[_0x3caafc(_0x272fe3._0x5b6140)]['camera'][_0x3caafc(0x64d)][_0x3caafc(0x34f)](function(){const _0x1bfe73=_0x3caafc;if(!_0x1e9c73[_0x1bfe73(_0x205ae8._0x541917)])return;_0x1e9c73[_0x1bfe73(0x486)]['removeAll'](),_0x1e9c73['_labels']['removeAll'](),_0x1e9c73[_0x1bfe73(_0x205ae8._0x47df6b)]=null,_0x1e9c73['_drawGrid'](_0x1e9c73['_getExtentView']());}),this['_scene'][_0x3caafc(_0x272fe3._0x453398)]['addImageryProvider'](this);}Object['defineProperties'](GraticuleProvider['prototype'],{'url':{'get':function(){return undefined;}},'proxy':{'get':function(){return undefined;}},'tileWidth':{'get':function(){return this['_tileWidth'];}},'tileHeight':{'get':function(){return this['_tileHeight'];}},'maximumLevel':{'get':function(){return 0x12;}},'minimumLevel':{'get':function(){return 0x0;}},'tilingScheme':{'get':function(){return this['_tilingScheme'];}},'rectangle':{'get':function(){return this['_tilingScheme']['rectangle'];}},'tileDiscardPolicy':{'get':function(){return undefined;}},'errorEvent':{'get':function(){const _0x4f1fd0=_0x3d5d32;return this[_0x4f1fd0(0xff1)];}},'ready':{'get':function(){return this['_ready'];}},'credit':{'get':function(){return this['_credit'];}},'hasAlphaChannel':{'get':function(){return!![];}}}),GraticuleProvider[_0x3d5d32(0xf8c)][_0x3d5d32(0xb9e)]=function(_0x144113,_0x1fcb9a,_0x4d60b5,_0x34d388,_0x4df991){const _0x5eddc1={_0x5f578a:0x433,_0xef29bf:0xc0f,_0x14be8b:0xac5},_0x53ede5=_0x3d5d32,_0x1133e3=LabelStyleConver['toCesiumVal'](this[_0x53ede5(_0x5eddc1._0x5f578a)]['labelStyle']||{},{'style':Cesium__namespace['LabelStyle']['FILL_AND_OUTLINE'],'fillColor':Cesium__namespace['Color']['AZURE'],'outlineColor':Cesium__namespace['Color']['BLACK'],'outlineWidth':0x2,'pixelOffset':new Cesium__namespace[(_0x53ede5(0xb0e))](0x5,_0x34d388?0x5:-0x5),'eyeOffset':Cesium__namespace[_0x53ede5(0xe95)]['ZERO'],'horizontalOrigin':Cesium__namespace[_0x53ede5(0x1e7)]['LEFT'],'verticalOrigin':_0x34d388?Cesium__namespace[_0x53ede5(_0x5eddc1._0xef29bf)][_0x53ede5(_0x5eddc1._0x14be8b)]:Cesium__namespace[_0x53ede5(_0x5eddc1._0xef29bf)]['TOP'],'scale':0x1});_0x1133e3['position']=this['_ellipsoid']['cartographicToCartesian'](new Cesium__namespace['Cartographic'](_0x144113,_0x1fcb9a,0xa)),_0x1133e3['text']=_0x4d60b5,this['_labels']['add'](_0x1133e3);},GraticuleProvider['prototype']['_drawGrid']=function(_0x105683){const _0x51beb8={_0x1ab27d:0x486,_0x53b5d1:0x912,_0x1723da:0x5ed,_0x24490f:0xc84,_0x49d891:0xcd1,_0x16f6d4:0xcdc,_0x3cc839:0x6fa,_0x3d59f1:0x58a,_0x575bab:0x562,_0x4153cd:0x6fa,_0x22c2f9:0xb75,_0x195cf8:0xff3,_0xb280a8:0x82e},_0x1c40e0=_0x3d5d32;if(this[_0x1c40e0(0xa7f)]&&this['_currentExtent'][_0x1c40e0(0x71f)](_0x105683))return;this['_currentExtent']=_0x105683,this[_0x1c40e0(_0x51beb8._0x1ab27d)]['removeAll'](),this[_0x1c40e0(_0x51beb8._0x53b5d1)][_0x1c40e0(0xeeb)]();let _0x5d983e=0x0,_0x135984=0x0,_0x3c8352;for(_0x3c8352=0x0;_0x3c8352{const _0x116004=_0x4132;this['_show']&&this[_0x116004(_0x48059d._0xf48890)](this['_getExtentView']()),_0x55b59a(this['_canvas']);});},GraticuleProvider[_0x3d5d32(0xf8c)]['setVisible']=function(_0x118e5e){const _0x1777a3={_0x3e73d8:0xeeb,_0x4a2212:0xd30},_0x513b5=_0x3d5d32;this['_show']=_0x118e5e,!_0x118e5e?(this[_0x513b5(0x486)]['removeAll'](),this['_labels'][_0x513b5(_0x1777a3._0x3e73d8)]()):(this['_currentExtent']=null,this[_0x513b5(_0x1777a3._0x4a2212)](this['_getExtentView']()));},GraticuleProvider[_0x3d5d32(0xf8c)]['isVisible']=function(){const _0x58a65d=_0x3d5d32;return this[_0x58a65d(0x443)];},GraticuleProvider['prototype']['_decToSex']=function(_0x3c2bf8){const _0xe35d91={_0x36042b:0x719},_0x3925aa=_0x3d5d32;let _0x29a63e=Math['floor'](_0x3c2bf8),_0x15b5db=((Math['abs'](_0x3c2bf8)-_0x29a63e)*0x3c)[_0x3925aa(_0xe35d91._0x36042b)](0x2);return _0x15b5db==='60.00'&&(_0x29a63e+=0x1,_0x15b5db='0.00'),[_0x29a63e,':',_0x15b5db]['join']('');},GraticuleProvider['prototype'][_0x3d5d32(0xc26)]=function(){const _0x444930={_0x297be6:0xb0e,_0xd49356:0xb0e,_0x5ef4f5:0x83e,_0xefc5df:0xa68},_0x3a6076=_0x3d5d32,_0x105a16=this['_scene']['camera'],_0x57a784=this['_scene'][_0x3a6076(0x60f)],_0x2f2bc3=[_0x105a16['pickEllipsoid'](new Cesium__namespace[(_0x3a6076(_0x444930._0x297be6))](0x0,0x0),this['_ellipsoid']),_0x105a16[_0x3a6076(0x99b)](new Cesium__namespace[(_0x3a6076(_0x444930._0xd49356))](_0x57a784[_0x3a6076(0x1076)],0x0),this['_ellipsoid']),_0x105a16['pickEllipsoid'](new Cesium__namespace['Cartesian2'](0x0,_0x57a784[_0x3a6076(0x83e)]),this['_ellipsoid']),_0x105a16['pickEllipsoid'](new Cesium__namespace['Cartesian2'](_0x57a784['width'],_0x57a784[_0x3a6076(_0x444930._0x5ef4f5)]),this['_ellipsoid'])];for(let _0x5cb1cc=0x0;_0x5cb1cc<0x4;_0x5cb1cc++){if(_0x2f2bc3[_0x5cb1cc]===undefined)return Cesium__namespace[_0x3a6076(0x756)][_0x3a6076(_0x444930._0xefc5df)];}return Cesium__namespace['Rectangle']['fromCartographicArray'](this['_ellipsoid']['cartesianArrayToCartographicArray'](_0x2f2bc3));};class GraticuleLayer extends BaseLayer{get['layer'](){return this['_graticuleProvider'];}['_showHook'](_0x1f618d){const _0x10ffb8=_0x3d5d32;this['_graticuleProvider']&&this[_0x10ffb8(0x3c9)]['setVisible'](_0x1f618d);}['_mountedHook'](){const _0x8935a2={_0x27decf:0x433},_0x52b84b=_0x3d5d32;this['_graticuleProvider']=new GraticuleProvider({'scene':this['_map'][_0x52b84b(0xfc1)],'numLines':0xa,...this[_0x52b84b(_0x8935a2._0x27decf)]});}['_addedHook'](){const _0x475038={_0x3f6092:0x792},_0x452ce2=_0x3d5d32;this['_graticuleProvider'][_0x452ce2(0xc67)](this[_0x452ce2(_0x475038._0x3f6092)]);}[_0x3d5d32(0x566)](){const _0x1437ed={_0x35d79b:0x3c9},_0x31e4d8=_0x3d5d32;this[_0x31e4d8(_0x1437ed._0x35d79b)]['setVisible'](![]);}}register$2('graticule',GraticuleLayer);class LodGraphicLayer extends GraphicLayer{constructor(_0x41e7df={}){const _0x14e110=_0x3d5d32;super(_0x41e7df),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this['options']['IdField']=this[_0x14e110(0x433)][_0x14e110(0xcc9)]||'id',this['options']['debuggerTileInfo']&&this['bindPopup'](function(_0x3ee3d4){const _0x167d0a=_0x14e110;var _0x281bc8;const _0xc7b354=(_0x3ee3d4===null||_0x3ee3d4===void 0x0?void 0x0:(_0x281bc8=_0x3ee3d4['graphic'])===null||_0x281bc8===void 0x0?void 0x0:_0x281bc8['gridList'])||[];return _0xc7b354['join'](_0x167d0a(0x231));}),this['_cacheGrid']={},this['_cacheGraphic']={};}get['isLoading'](){const _0x39189c=_0x3d5d32;for(const _0x4355b9 in this['_cacheGrid']){const _0x33eee5=this[_0x39189c(0xfd2)][_0x4355b9];if(!_0x33eee5||!_0x33eee5['grid'])continue;if(_0x33eee5['isLoading'])return!![];}return![];}['_showHook'](_0x359471){const _0xbb3898=_0x3d5d32;super['_showHook'](_0x359471),this[_0xbb3898(0x569)]&&(this['_tileLayer'][_0xbb3898(0x792)]=_0x359471);}['_mountedHook'](){const _0x218787={_0x401cd0:0x569,_0x2e42d7:0x569,_0x1a012b:0xccd},_0x45a8e7=_0x3d5d32;super['_mountedHook']();const _0x41399b={...this['options'],'private':!![]};delete _0x41399b['id'],delete _0x41399b['name'],delete _0x41399b['url'],delete _0x41399b['type'],this[_0x45a8e7(_0x218787._0x401cd0)]=new EmptyTileLayer(_0x41399b),this[_0x45a8e7(_0x218787._0x2e42d7)][_0x45a8e7(_0x218787._0x1a012b)]['then'](()=>{this['_readyPromise']['resolve'](this);});}['_addedHook'](){const _0x539bb4={_0x3f6569:0x569,_0x33ae03:0xe77,_0x482212:0x581,_0x4f55f8:0x44d},_0xa53227={_0x41b7ae:0x1d1},_0x1a521d={_0x3a969b:0x9e7,_0xecd342:0x540},_0x57a3cb=_0x3d5d32;super['_addedHook'](),this[_0x57a3cb(_0x539bb4._0x3f6569)]['on'](EventType[_0x57a3cb(0xe10)],this['_tileLayer_addTileHandler'],this),this['_tileLayer']['on'](EventType['removeTile'],this['_tileLayer_removeTileHandler'],this);const _0x33562a=this[_0x57a3cb(0x1d1)];Promise[_0x57a3cb(_0x539bb4._0x33ae03)]([new Promise((_0x34963b,_0x437bda)=>{const _0x376b82=_0x57a3cb;function _0x3bf809(_0x351ae2){const _0x155eb8=_0x4132;_0x351ae2===0x0&&(_0x33562a[_0x155eb8(_0x1a521d._0x3a969b)](EventType[_0x155eb8(_0x1a521d._0xecd342)],_0x3bf809),_0x34963b(!![]));}_0x33562a['on'](EventType[_0x376b82(0x540)],_0x3bf809);}),this['_map'][_0x57a3cb(_0x539bb4._0x482212)]['readyPromise']])[_0x57a3cb(_0x539bb4._0x4f55f8)](_0x2edf46=>{const _0x36a28f=_0x57a3cb;this[_0x36a28f(_0xa53227._0x41b7ae)]['addLayer'](this[_0x36a28f(0x569)]);});}[_0x3d5d32(0x566)](){const _0x39f374={_0x163e9c:0x1d1},_0x3ffab4=_0x3d5d32;super['_removedHook'](),this[_0x3ffab4(0x569)]['off'](EventType['addTile'],this[_0x3ffab4(0x1030)],this),this['_tileLayer']['off'](EventType['removeTile'],this[_0x3ffab4(0x9af)],this),this[_0x3ffab4(_0x39f374._0x163e9c)][_0x3ffab4(0xa9e)](this['_tileLayer']),this['clear']();}['getGridKey'](_0x5e3c1a){return _0x5e3c1a['level']+'_x'+_0x5e3c1a['x']+'_y'+_0x5e3c1a['y'];}['checkHasBreak'](_0x1dac52){const _0x4e2801={_0x1c700e:0xfd2},_0x4ce4e4=_0x3d5d32;if(!this['show']||!this[_0x4ce4e4(_0x4e2801._0x1c700e)][_0x1dac52])return!![];return![];}['_tileLayer_addTileHandler'](_0x218810){const _0x276b04=_0x3d5d32;if(!this[_0x276b04(0x569)]['isInRange'](_0x218810['level']))return;const _0x296231=this['getGridKey'](_0x218810);_0x218810[_0x276b04(0xdfc)]=_0x296231,this['_cacheGrid'][_0x296231]={'grid':_0x218810,'isLoading':!![]},this['queryGridData'](_0x218810)['then'](_0x139a28=>{const _0x4465f5=_0x276b04;this[_0x4465f5(0x792)]&&this['_showData'](_0x139a28);});}['_getItemDataId'](_0xd087d4){const _0x3683c4={_0x1df4b6:0x5fc},_0xc9bf83=_0x3d5d32;if(_0xd087d4['id'])return _0xd087d4['id'];_0xd087d4['type']===_0xc9bf83(_0x3683c4._0x1df4b6)&&(_0xd087d4=_0xd087d4['properties']);if(_0xd087d4[this[_0xc9bf83(0x433)][_0xc9bf83(0xcc9)]])return _0xd087d4[this['options']['IdField']];return null;}['_showData'](_0x51f26c){const _0x307f18={_0x2fde59:0x1f9,_0x4a4f05:0x45e,_0x22cf99:0xb7c,_0x2d32e4:0xfd2},_0x2d5c1c=_0x3d5d32,_0x1fb9cc=_0x51f26c['list'],_0x6770d5=_0x51f26c['key'];if(this[_0x2d5c1c(0xa8c)][_0x6770d5])return;const _0x39c3d1=[],_0x3a38bc=[];for(let _0x141f32=0x0,_0x5b9411=_0x1fb9cc['length'];_0x141f32<_0x5b9411;_0x141f32++){const _0x37e3ea=_0x1fb9cc[_0x141f32],_0x40fc98=this['_getItemDataId'](_0x37e3ea);!_0x40fc98&&logWarn(_0x2d5c1c(_0x307f18._0x2fde59),_0x37e3ea);const _0x36a10a=this['_cacheGraphic'][_0x40fc98];if(_0x36a10a)_0x36a10a[_0x2d5c1c(_0x307f18._0x4a4f05)][_0x2d5c1c(0xb75)](_0x6770d5),this['updateGraphic'](_0x36a10a,_0x37e3ea);else{const _0x328c9b=this[_0x2d5c1c(_0x307f18._0x22cf99)](_0x51f26c,_0x37e3ea);if(!_0x328c9b)continue;_0x328c9b['gridList']=[_0x6770d5],this[_0x2d5c1c(0x9f6)][_0x40fc98]=_0x328c9b,_0x3a38bc['push'](_0x328c9b);}_0x39c3d1['push'](_0x40fc98);}this['_cacheGrid'][_0x6770d5]=this[_0x2d5c1c(_0x307f18._0x2d32e4)][_0x6770d5]||{},this['_cacheGrid'][_0x6770d5]['ids']=_0x39c3d1,this['_cacheGrid'][_0x6770d5]['isLoading']=![],this['fire'](EventType['update'],{'graphics':_0x3a38bc});}['_tileLayer_removeTileHandler'](_0x424a9b){const _0x1c3e51={_0x2a671a:0xc35},_0xf4c3ce=_0x3d5d32;if(this['_tileLayer'][_0xf4c3ce(0x325)](_0x424a9b['level'])){this['clear']();return;}const _0x4c5d0b=this[_0xf4c3ce(0x53a)](_0x424a9b),_0x5e7dad=this['_cacheGrid'][_0x4c5d0b];if(_0x5e7dad){if(_0x5e7dad[_0xf4c3ce(_0x1c3e51._0x2a671a)])for(let _0x5348ba=0x0;_0x5348ba<_0x5e7dad['ids']['length'];_0x5348ba++){const _0x4ddc45=_0x5e7dad['ids'][_0x5348ba],_0x279227=this['_cacheGraphic'][_0x4ddc45];if(!_0x279227)continue;removeArrayItem(_0x279227['gridList'],_0x4c5d0b),_0x279227['gridList']['length']===0x0&&(this['removeGraphic'](_0x279227),delete this['_cacheGraphic'][_0x4ddc45]);}delete this['_cacheGrid'][_0x4c5d0b];}}[_0x3d5d32(0xf2e)](_0x46adbe){const _0x370288=_0x3d5d32;if(this['options'][_0x370288(0xf2e)])return this['options']['queryGridData'](_0x46adbe);}['createGraphic'](_0x1cb3b9,_0x21980a){const _0x453c80=_0x3d5d32;if(this['options']['createGraphic'])return this['options'][_0x453c80(0xb7c)](_0x1cb3b9,_0x21980a);return null;}['updateGraphic'](_0x576533,_0x41702f){const _0x53379d={_0x4c007f:0x433},_0xfdc44e=_0x3d5d32;this[_0xfdc44e(0x433)]['updateGraphic']&&this[_0xfdc44e(_0x53379d._0x4c007f)][_0xfdc44e(0xf8f)](_0x576533,_0x41702f);}['clear'](_0x4c6066){const _0x11f673=_0x3d5d32;super['clear'](_0x4c6066),this[_0x11f673(0x9f6)]={},this['_cacheGrid']={};}['reload'](){const _0x765131={_0x212929:0x569},_0x2f196d=_0x3d5d32;this['clear'](!![]),this[_0x2f196d(_0x765131._0x212929)]&&this[_0x2f196d(0x569)]['reload']();}['_setOptionsHook'](_0x2051bf,_0x13f945){const _0x52e888=_0x3d5d32;super[_0x52e888(0xd4c)](_0x2051bf,_0x13f945),this['clear'](!![]);if(this['_tileLayer']){const _0x170cd6={..._0x13f945,'private':!![]};delete _0x170cd6['id'],delete _0x170cd6[_0x52e888(0xaed)],delete _0x170cd6['url'],delete _0x170cd6['type'],this['_tileLayer']['setOptions'](_0x170cd6);}}['_toJsonEx'](_0x3bfc28){}}register$2('lodGraphic',LodGraphicLayer);class GeodePoiLayer extends LodGraphicLayer{constructor(_0x20e27c={}){super(_0x20e27c),this['_key_index']=0x0,this['_keys']=this['options']['key']||gaodeArr,this['bindPopup'](function(_0x9664e8){const _0x105f1a=_0x4132;var _0x87e5a6;const _0x4c9e0a=_0x9664e8===null||_0x9664e8===void 0x0?void 0x0:(_0x87e5a6=_0x9664e8['graphic'])===null||_0x87e5a6===void 0x0?void 0x0:_0x87e5a6['attr'];if(!_0x4c9e0a)return;const _0x22998b='
名称:'+_0x4c9e0a['name']+_0x105f1a(0xfaf)+'
地址:'+_0x4c9e0a['address']+_0x105f1a(0xfaf)+'
区域:'+_0x4c9e0a['pname']+_0x4c9e0a['cityname']+_0x4c9e0a[_0x105f1a(0xad6)]+'
'+'
类别:'+_0x4c9e0a['type']+'
';return _0x22998b;},{'anchor':[0x0,-0xa]});}get['key'](){const _0x1db392=_0x3d5d32,_0x49633e=this['_key_index']++%this[_0x1db392(0x53b)]['length'];return this['_keys'][_0x49633e];}['queryGridData'](_0x3d4758){const _0x5bdbfc={_0x2252b5:0x104e},_0x383672={_0x58fe8a:0xd44,_0x3937b0:0xedd,_0x140dd6:0x9a9},_0x123a1c=_0x3d5d32,_0x5f2d52=wgs2gcj([_0x3d4758['extent']['xmin'],_0x3d4758['extent'][_0x123a1c(0x1058)]]),_0x312427=wgs2gcj([_0x3d4758[_0x123a1c(0x86b)]['xmax'],_0x3d4758['extent']['ymin']]),_0x1f3396=_0x5f2d52[0x0]+','+_0x5f2d52[0x1]+'|'+_0x312427[0x0]+','+_0x312427[0x1],_0x3974fb=this['options']['filter']||{};return _0x3974fb['output']='json',_0x3974fb['key']=this['key'],_0x3974fb[_0x123a1c(_0x5bdbfc._0x2252b5)]=_0x1f3396,!_0x3974fb['offset']&&(_0x3974fb['offset']=0x19),!_0x3974fb['types']&&(_0x3974fb['types']='120000|130000|190000'),new Promise((_0x15aeb0,_0x4aebd0)=>{const _0x4705eb=_0x123a1c;fetchJson({'url':_0x4705eb(0x1021),...this['options'],'queryParameters':_0x3974fb,'proxy':this['_proxy']})['then'](_0xedad1a=>{const _0x498223=_0x4705eb;if(_0xedad1a[_0x498223(_0x383672._0x58fe8a)]!=='10000'){logError$1('POI\x20请求失败',_0xedad1a),_0x3d4758[_0x498223(_0x383672._0x3937b0)]=[],_0x15aeb0(_0x3d4758);return;}_0x3d4758['list']=_0xedad1a[_0x498223(_0x383672._0x140dd6)],_0x15aeb0(_0x3d4758);});});}['createGraphic'](_0x333fc1,_0x5ad86d){const _0x4bba0c={_0x5014fe:0x83e},_0x3c75fe=_0x3d5d32;var _0x148bef;let _0x56331d=_0x5ad86d[_0x3c75fe(0x99c)]['split'](',');_0x56331d=gcj2wgs(_0x56331d);const _0x15bb39=getSymbolStyle(this['options']['symbol'],_0x5ad86d);_0x15bb39['clampToGround']=_0x15bb39['clampToGround']??!![];let _0x499a50;return(_0x148bef=this[_0x3c75fe(0x433)]['clustering'])!==null&&_0x148bef!==void 0x0&&_0x148bef['enabled']?_0x15bb39['image']?_0x499a50=new BillboardEntity({'position':[_0x56331d[0x0],_0x56331d[0x1],this[_0x3c75fe(0x433)]['height']||0x0],'style':_0x15bb39,'attr':_0x5ad86d}):_0x499a50=new PointEntity({'position':[_0x56331d[0x0],_0x56331d[0x1],this['options']['height']||0x0],'style':_0x15bb39,'attr':_0x5ad86d}):_0x15bb39['image']?_0x499a50=new BillboardPrimitive({'position':[_0x56331d[0x0],_0x56331d[0x1],this['options'][_0x3c75fe(_0x4bba0c._0x5014fe)]||0x0],'style':_0x15bb39,'attr':_0x5ad86d}):_0x499a50=new PointPrimitive({'position':[_0x56331d[0x0],_0x56331d[0x1],this[_0x3c75fe(0x433)][_0x3c75fe(0x83e)]||0x0],'style':_0x15bb39,'attr':_0x5ad86d}),this['addGraphic'](_0x499a50),_0x499a50;}}register$2('gaodePOI',GeodePoiLayer);class WfsLayer extends LodGraphicLayer{['_mountedHook'](){const _0x1531b4={_0x297423:0xe67,_0x390c6a:0xefc},_0x3cec33=_0x3d5d32;this[_0x3cec33(0x433)]['geometryName']=this['options']['geometryName']||'the_geom',super[_0x3cec33(0xe4c)](),Cesium__namespace['defaultValue'](this['options'][_0x3cec33(_0x1531b4._0x297423)],!![])&&this['getMetadata'](),this[_0x3cec33(_0x1531b4._0x390c6a)](EventType['load']);}[_0x3d5d32(0x5b3)](){const _0x321974={_0x558abb:0xc38},_0x39a92f=_0x3d5d32,_0x18993a={'service':'WFS','request':'GetCapabilities','version':'1.0.0'};let _0xdc5798=this['options']['url'];this['options']['templateValues']&&(_0xdc5798=template(_0xdc5798,this['options'][_0x39a92f(0x3c6)])),Cesium__namespace['Resource'][_0x39a92f(_0x321974._0x558abb)]({...this[_0x39a92f(0x433)],'url':_0xdc5798,'queryParameters':_0x18993a,'proxy':this['_proxy']})['then'](_0x21c97c=>{const _0x7beebb=_0x39a92f;if(!_0x21c97c||this['isDestroy'])return;this[_0x7beebb(0x972)]=_0x21c97c;try{this['_initByMetaData'](_0x21c97c);}catch(_0x426752){logInfo('解析GetCapabilities出错',_0x426752);}this['fire'](EventType['loadConfig'],{'capabilities':_0x21c97c});})[_0x39a92f(0x399)](_0x4efd30=>{logInfo('wfs请求GetCapabilities出错',_0x4efd30);});}[_0x3d5d32(0xcd4)](_0x46fcec){const _0x362dab={_0x59d7c2:0xf3b,_0x15b56d:0x361,_0x33adca:0xb4c,_0x5b70e2:0x433,_0x452ec6:0xd18,_0x512c0d:0x1058,_0x202112:0x86b,_0x27b986:0x525},_0x8f6c64=_0x3d5d32,_0x56875e=this[_0x8f6c64(0xb61)](_0x46fcec,_0x8f6c64(0xf11));if(!_0x56875e)return;const _0x3f5c91=this['_readNode'](_0x56875e,_0x8f6c64(_0x362dab._0x59d7c2));if(!_0x3f5c91)return;for(let _0x37d587=0x0,_0x36c3c4=_0x3f5c91['length'];_0x37d587<_0x36c3c4;_0x37d587++){const _0x18ec62=_0x3f5c91[_0x37d587],_0x43cd06=this[_0x8f6c64(_0x362dab._0x15b56d)](_0x18ec62,_0x8f6c64(_0x362dab._0x33adca));if(_0x43cd06===this['options'][_0x8f6c64(0x548)]){const _0x11740e=this['_readChildNodeVal'](_0x18ec62,_0x8f6c64(0xb6a));!this[_0x8f6c64(_0x362dab._0x5b70e2)][_0x8f6c64(0x980)]&&_0x11740e&&(this['options']['crs']=_0x11740e);const _0x259805=this['_readChildNode'](_0x18ec62,'LatLongBoundingBox');if(!this[_0x8f6c64(0x433)]['rectangle']&&_0x259805){const _0x119c09=Number(_0x259805[_0x8f6c64(_0x362dab._0x452ec6)]('minx')),_0x3ab36c=Number(_0x259805[_0x8f6c64(0xd18)](_0x8f6c64(0x81d))),_0x4e7027=Number(_0x259805[_0x8f6c64(0xd18)]('maxx')),_0x87d756=Number(_0x259805[_0x8f6c64(0xd18)]('maxy'));let _0x2ec269={'xmin':_0x119c09,'ymin':_0x3ab36c,'xmax':_0x4e7027,'ymax':_0x87d756};if(this['options']['crs']!==CRS['EPSG4326']&&this['options'][_0x8f6c64(0x980)]!==CRS['EPSG4490']){const _0x3646b8=proj4Trans([_0x2ec269[_0x8f6c64(0x525)],_0x2ec269['ymin']],this['options']['crs']),_0xa457af=proj4Trans([_0x2ec269['xmax'],_0x2ec269[_0x8f6c64(_0x362dab._0x512c0d)]],this[_0x8f6c64(0x433)]['crs']);_0x2ec269={'xmin':_0x3646b8[0x0],'ymin':_0x3646b8[0x1],'xmax':_0xa457af[0x0],'ymax':_0xa457af[0x1]};}this['options'][_0x8f6c64(_0x362dab._0x202112)]=_0x2ec269,this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x2ec269[_0x8f6c64(_0x362dab._0x27b986)],_0x2ec269[_0x8f6c64(0x470)],_0x2ec269['xmax'],_0x2ec269['ymax']),this['_tileLayer']&&(this['_tileLayer']['rectangle']=this['_rectangle']),this['options']['flyTo']&&this['flyToByAnimationEnd']();}break;}}}[_0x3d5d32(0xabb)](_0x5c66c6,_0x3e2fae){const _0x5d1d2f={_0x586fa9:0xb5a},_0x237f9e=_0x3d5d32;if(!_0x5c66c6)return null;let _0xd31e33=_0x5c66c6['getElementsByTagName'](_0x3e2fae);return(!_0xd31e33||_0xd31e33['length']===0x0)&&(_0xd31e33=_0x5c66c6[_0x237f9e(_0x5d1d2f._0x586fa9)]('wfs:'+_0x3e2fae)),_0xd31e33;}[_0x3d5d32(0xb61)](_0x3fe746,_0x50c6aa){const _0x299074=_0x3d5d32;if(!_0x3fe746)return null;const _0x10c095=this[_0x299074(0xabb)](_0x3fe746,_0x50c6aa);return _0x10c095['length']>0x0?_0x10c095[0x0]:null;}['_readChildNodeVal'](_0x5d51b7,_0x1d2672){const _0x4feca6=_0x3d5d32;var _0xb329f4,_0x1c2806;if(!_0x5d51b7)return null;let _0x37c36b=this['_readChildNode'](_0x5d51b7,_0x1d2672);!_0x37c36b&&(_0x37c36b=this[_0x4feca6(0xb61)](_0x5d51b7,'wfs:'+_0x1d2672));if((_0xb329f4=_0x37c36b)!==null&&_0xb329f4!==void 0x0&&_0xb329f4['innerHTML'])return _0x37c36b['innerHTML'];else return(_0x1c2806=_0x37c36b)!==null&&_0x1c2806!==void 0x0&&_0x1c2806['getInnerHTML']?_0x37c36b['getInnerHTML']():null;}['queryGridData'](_0x72625d){const _0x4750c0={_0x2c55cc:0x525,_0x3d2a14:0x86b,_0x5a2c1b:0x980,_0x5d6dc9:0x433,_0x3468e9:0x296,_0x317f4a:0x3c6},_0x530638=_0x3d5d32;let _0x4083f0;if(this['options']['crs']!==CRS['EPSG4326']&&this['options']['crs']!==CRS['EPSG4490']){const _0xbaff9d=proj4Trans([_0x72625d['extent'][_0x530638(_0x4750c0._0x2c55cc)],_0x72625d[_0x530638(_0x4750c0._0x3d2a14)]['ymin']],'EPSG:4326',this['options'][_0x530638(_0x4750c0._0x5a2c1b)]),_0x1a9d29=proj4Trans([_0x72625d['extent'][_0x530638(0x57e)],_0x72625d[_0x530638(0x86b)]['ymax']],'EPSG:4326',this[_0x530638(_0x4750c0._0x5d6dc9)]['crs']);_0x4083f0=_0xbaff9d[0x0]+','+_0xbaff9d[0x1]+','+_0x1a9d29[0x0]+','+_0x1a9d29[0x1];}else _0x4083f0=_0x72625d['extent']['xmin']+','+_0x72625d['extent']['ymin']+','+_0x72625d['extent'][_0x530638(0x57e)]+','+_0x72625d[_0x530638(_0x4750c0._0x3d2a14)]['ymax'];const _0x63c2ec={'service':'WFS','request':'GetFeature','typeName':this['options'][_0x530638(0x548)]||this[_0x530638(0x433)]['typeName'],'version':'1.0.0','outputFormat':'application/json','srsName':this['options']['crs']||_0x530638(0x853),'bbox':_0x4083f0};if(Cesium__namespace[_0x530638(0xb84)](this['options']['parameters']))for(const _0x37a5e7 in this['options']['parameters']){_0x37a5e7['toLowerCase']()===_0x530638(_0x4750c0._0x3468e9)?(delete _0x63c2ec['bbox'],_0x63c2ec[_0x37a5e7]=this['options']['parameters'][_0x37a5e7]+'\x20and\x20BBOX('+this[_0x530638(0x433)]['geometryName']+',\x20'+_0x4083f0+')'):_0x63c2ec[_0x37a5e7]=this['options']['parameters'][_0x37a5e7];}let _0x5c798f=this['options']['url'];return this['options']['templateValues']&&(_0x5c798f=template(_0x5c798f,this['options'][_0x530638(_0x4750c0._0x317f4a)])),new Promise((_0x139f9f,_0xceaa7b)=>{const _0xa3c89d=_0x530638;fetchJson({...this['options'],'url':_0x5c798f,'queryParameters':_0x63c2ec,'proxy':this['_proxy']})[_0xa3c89d(0x44d)](_0x42120c=>{const _0x258625=_0xa3c89d;_0x72625d['list']=[];if(!this[_0x258625(0x443)]||!this['_cacheGrid'][_0x72625d['key']]){_0x139f9f(_0x72625d);return;}if(_0x42120c===undefined||_0x42120c==null){_0x139f9f(_0x72625d);return;}_0x42120c['type']==='Feature'&&(_0x42120c={'type':'FeatureCollection','features':[_0x42120c]}),_0x72625d['list']=_0x42120c[_0x258625(0x7ab)],_0x139f9f(_0x72625d);})[_0xa3c89d(0x399)](_0x40162c=>{const _0x86d592=_0xa3c89d;logError$1(_0x86d592(0x330),_0x40162c);});});}['createGraphic'](_0x4027e9,_0x212017){const _0x32bb15=this['loadGeoJSON'](_0x212017,{'clear':![],'flyTo':![]});return(_0x32bb15===null||_0x32bb15===void 0x0?void 0x0:_0x32bb15['length'])>0x0?_0x32bb15[0x0]:null;}}register$2(_0x3d5d32(0x359),WfsLayer);class ArcGisWfsLayer extends LodGraphicLayer{[_0x3d5d32(0xe4c)](){super['_mountedHook'](),this['getMetadata']();}['getMetadata'](){const _0x709863={_0x56fc7b:0x433,_0x735fd4:0xee0},_0x3b0793=_0x3d5d32;let _0x24d194=this['options']['url'];this['options']['layers']&&this[_0x3b0793(0x433)][_0x3b0793(0x378)]['length']>0x0&&(_0x24d194+='/'+this[_0x3b0793(_0x709863._0x56fc7b)]['layers'][0x0]);const _0x2ee166={'f':_0x3b0793(0xde6)};this['options']['token']&&(_0x2ee166['token']=this['options'][_0x3b0793(_0x709863._0x735fd4)]),sendAjax({...this[_0x3b0793(_0x709863._0x56fc7b)],'url':_0x24d194,'queryParameters':_0x2ee166,'proxy':this[_0x3b0793(0xb2c)]})['then'](_0x285fd2=>{const _0x2f3494=_0x3b0793;if(!_0x285fd2||this['isDestroy'])return;this[_0x2f3494(0xcd4)](_0x285fd2),this['fire'](EventType[_0x2f3494(0xc08)],_0x285fd2);})['catch'](_0x4d07ca=>{logInfo('wfs请求getMetadata出错',_0x4d07ca);});}['_initByMetaData'](_0x416e06){const _0x47865a={_0x27f6db:0x62d,_0x1b846a:0x433,_0xf434ed:0x62d,_0x1d178c:0x1058,_0x1b4f35:0x5a3},_0x2a4b03=_0x3d5d32;this[_0x2a4b03(0xa97)]=_0x416e06;let _0x23172d=_0x416e06['fullExtent']||_0x416e06['extent'];if(!this['options']['rectangle']&&_0x23172d){var _0x34cfdd,_0x243fde;const _0x45fab0=((_0x34cfdd=_0x23172d)===null||_0x34cfdd===void 0x0?void 0x0:(_0x243fde=_0x34cfdd['spatialReference'])===null||_0x243fde===void 0x0?void 0x0:_0x243fde['wkid'])||this['options'][_0x2a4b03(_0x47865a._0x27f6db)];_0x45fab0&&(!this[_0x2a4b03(_0x47865a._0x1b846a)][_0x2a4b03(_0x47865a._0xf434ed)]&&(this['options']['wkid']=_0x45fab0));if(this['options']['wkid']){const _0x263cf0='EPSG:'+this['options']['wkid'];if(_0x263cf0!==CRS['EPSG4326']&&_0x263cf0!==CRS[_0x2a4b03(0xe15)]){const _0x113b53=proj4Trans([_0x23172d['xmin'],_0x23172d['ymin']],_0x263cf0),_0x27bf08=proj4Trans([_0x23172d['xmax'],_0x23172d[_0x2a4b03(_0x47865a._0x1d178c)]],_0x263cf0);_0x23172d={'xmin':_0x113b53[0x0],'ymin':_0x113b53[0x1],'xmax':_0x27bf08[0x0],'ymax':_0x27bf08[0x1]};}this['options']['extent']=_0x23172d,this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x23172d['xmin'],_0x23172d['ymin'],_0x23172d['xmax'],_0x23172d['ymax']),this['_tileLayer']&&(this[_0x2a4b03(0x569)][_0x2a4b03(_0x47865a._0x1b4f35)]=this['_rectangle']),this['options']['flyTo']&&this[_0x2a4b03(0x28e)]();}}}['queryGridData'](_0x4231c4){const _0x240d27={_0x59a2d5:0x525,_0x24c1d4:0x86b,_0x22fe16:0xee0,_0x2dad04:0x433},_0x24f4e2=_0x3d5d32;let _0x5ac305=this['options']['url'];this['options']['layers']&&this['options']['layers']['length']>0x0&&(_0x5ac305+='/'+this['options'][_0x24f4e2(0x378)][0x0]);const _0x324e3f={'f':this['options']['f']||_0x24f4e2(0xde6),'inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':this['options']['where']||'1=1','geometry':JSON['stringify']({'xmin':_0x4231c4[_0x24f4e2(0x86b)][_0x24f4e2(_0x240d27._0x59a2d5)],'ymin':_0x4231c4[_0x24f4e2(0x86b)][_0x24f4e2(0x470)],'xmax':_0x4231c4['extent']['xmax'],'ymax':_0x4231c4[_0x24f4e2(_0x240d27._0x24c1d4)][_0x24f4e2(0x1058)],'spatialReference':{'wkid':0x10e6}}),'geometryType':'esriGeometryEnvelope','spatialRel':'esriSpatialRelIntersects'};return this[_0x24f4e2(0x433)][_0x24f4e2(0xee0)]&&(_0x324e3f[_0x24f4e2(_0x240d27._0x22fe16)]=this[_0x24f4e2(_0x240d27._0x2dad04)]['token']),new Promise((_0x585994,_0x4c3494)=>{const _0x7baf8d={_0x5080d3:0x5fc},_0x5d2096=_0x24f4e2;sendAjax({...this[_0x5d2096(0x433)],'url':_0x5ac305+_0x5d2096(0x1047),'queryParameters':_0x324e3f,'proxy':this[_0x5d2096(0xb2c)]})['then'](_0x2c104d=>{const _0x31ef90=_0x5d2096;_0x4231c4['list']=[];if(!this['show']||!this['_cacheGrid'][_0x4231c4['key']]){_0x585994(_0x4231c4);return;}if(_0x2c104d===undefined||_0x2c104d==null){_0x585994(_0x4231c4);return;}let _0x2f85d9=arcgisToGeoJSON$1(_0x2c104d);_0x2f85d9['type']===_0x31ef90(_0x7baf8d._0x5080d3)&&(_0x2f85d9={'type':'FeatureCollection','features':[_0x2f85d9]}),_0x4231c4['list']=_0x2f85d9[_0x31ef90(0x7ab)],_0x585994(_0x4231c4);})[_0x5d2096(0x399)](_0x4633d9=>{logError$1('wfs请求出错',_0x4633d9);});});}[_0x3d5d32(0xd22)](_0x1b5c8a){const _0x506257={_0x42d57b:0x9e3,_0x3f6caf:0x9f2},_0x425da2=_0x3d5d32;var _0x4114ff,_0x2026c5;if(_0x1b5c8a['id'])return _0x1b5c8a['id'];_0x1b5c8a['type']==='Feature'&&(_0x1b5c8a=_0x1b5c8a['properties']);if(_0x1b5c8a[this['options']['IdField']])return _0x1b5c8a[this['options']['IdField']];if(_0x1b5c8a[_0x425da2(_0x506257._0x42d57b)])return _0x1b5c8a['OBJECTID'];if(_0x1b5c8a[_0x425da2(_0x506257._0x3f6caf)])return _0x1b5c8a['objectid'];if(((_0x4114ff=this['metaData'])===null||_0x4114ff===void 0x0?void 0x0:(_0x2026c5=_0x4114ff['fields'])===null||_0x2026c5===void 0x0?void 0x0:_0x2026c5['length'])>0x0){const _0x20f23f=this['metaData']['fields'][0x0][_0x425da2(0xaed)];if(_0x1b5c8a[_0x20f23f])return _0x1b5c8a[_0x20f23f];}return null;}['createGraphic'](_0x8ed26a,_0x2a584e){const _0x87f533={_0x34e20c:0xb7c},_0xa58475=_0x3d5d32;if(this['options']['createGraphic'])return this['options'][_0xa58475(_0x87f533._0x34e20c)](_0x8ed26a,_0x2a584e);const _0x229699=this['loadGeoJSON'](_0x2a584e,{'clear':![],'flyTo':![]});return(_0x229699===null||_0x229699===void 0x0?void 0x0:_0x229699[_0xa58475(0xc84)])>0x0?_0x229699[0x0]:null;}[_0x3d5d32(0xf47)](_0x271ad9){const _0x3afb39={_0x42adf0:0x433,_0x163efc:0xdcf},_0x548511=_0x3d5d32;this[_0x548511(_0x3afb39._0x42adf0)][_0x548511(_0x3afb39._0x163efc)]=_0x271ad9,this['reload']();}}register$2('arcgis_wfs',ArcGisWfsLayer);class ArcGisWfsSingleLayer extends GeoJsonLayer{['load'](_0x195476={}){const _0x3dbd02={_0x5a3f6f:0x378},_0x3039e6=_0x3d5d32;this[_0x3039e6(0x433)]={...this['options'],..._0x195476};let _0x51ff34=this['options']['url'];this['options'][_0x3039e6(_0x3dbd02._0x5a3f6f)]&&this['options']['layers']['length']>0x0&&(_0x51ff34+='/'+this[_0x3039e6(0x433)]['layers'][0x0]);const _0x26ae7d={'f':'json','inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':this[_0x3039e6(0x433)]['where']||'1=1'};this[_0x3039e6(0x433)]['token']&&(_0x26ae7d[_0x3039e6(0xee0)]=this['options']['token']),fetchJson({...this['options'],'url':_0x51ff34+'/query','queryParameters':_0x26ae7d,'proxy':this['_proxy']})['then'](_0x4ac91c=>{if(!_0x4ac91c){this['fire'](EventType['load']);return;}const _0x22a3ab=arcgisToGeoJSON$1(_0x4ac91c);this['_load_data'](_0x22a3ab);})[_0x3039e6(0x399)](_0xef3a63=>{logError$1('wfs请求出错',_0xef3a63);});}['setWhere'](_0x476006){this['load']({'where':_0x476006});}}register$2('arcgis_wfs_single',ArcGisWfsSingleLayer);var index$4={'__proto__':null,'BaseLayer':BaseLayer,'GroupLayer':GroupLayer,'BaseTileLayer':BaseTileLayer,'BaseGraphicLayer':BaseGraphicLayer,'TerrainLayer':TerrainLayer,'ArcGisCacheLayer':ArcGisCacheLayer,'ArcGisTileLayer':ArcGisTileLayer,'ArcGisLayer':ArcGisLayer,'BaiduLayer':BaiduLayer,'BingLayer':BingLayer,'GaodeLayer':GaodeLayer,'GeeLayer':GeeLayer,'GoogleLayer':GoogleLayer,'ImageLayer':ImageLayer,'IonLayer':IonLayer,'MapboxLayer':MapboxLayer,'OsmLayer':OsmLayer,'TdtLayer':TdtLayer,'TencentLayer':TencentLayer,'TmsLayer':TmsLayer,'WmsLayer':WmsLayer,'WmtsLayer':WmtsLayer,'XyzLayer':XyzLayer,'GridLayer':GridLayer,'TileInfoLayer':TileInfoLayer,'EmptyTileLayer':EmptyTileLayer,'CzmGeoJsonLayer':CzmGeoJsonLayer,'KmlLayer':KmlLayer,'CzmlLayer':CzmlLayer,'GraphicLayer':GraphicLayer,'GraphicGroupLayer':GraphicGroupLayer,'GeoJsonLayer':GeoJsonLayer,'BusineDataLayer':BusineDataLayer,'TilesetLayer':TilesetLayer,'OsmBuildingsLayer':OsmBuildingsLayer,'I3SLayer':I3SLayer,'GraticuleLayer':GraticuleLayer,'LodGraphicLayer':LodGraphicLayer,'GeodePoiLayer':GeodePoiLayer,'WfsLayer':WfsLayer,'ArcGisWfsLayer':ArcGisWfsLayer,'ArcGisWfsSingleLayer':ArcGisWfsSingleLayer,'register':register$2,'create':create$2,'createTerrainProvider':createTerrainProvider,'createImageryProvider':createImageryProvider$k};class Underground extends BaseThing{get['translucency'](){const _0x2136b0={_0x14ad9a:0x1d1},_0x361faf=_0x3d5d32;return this[_0x361faf(_0x2136b0._0x14ad9a)]['scene']['globe']['translucency'];}get['alpha'](){return this['_alpha'];}set['alpha'](_0x5b87bb){const _0x5934a3=_0x3d5d32;this['_alpha']=_0x5b87bb;if(!this['_map'])return;this[_0x5934a3(0x1e8)]['frontFaceAlpha']=this['_alpha'];}get['color'](){const _0x282b36=_0x3d5d32;return this['_map'][_0x282b36(0xfc1)]['globe']['undergroundColor'];}set['color'](_0x16639a){const _0x357a95=_0x3d5d32;this[_0x357a95(0x1d1)]['scene']['globe']['undergroundColor']=_0x16639a;}get['colorAlphaByDistance'](){const _0x58b6b8={_0x8ad025:0xfc1},_0x400df1=_0x3d5d32;return this['_map'][_0x400df1(_0x58b6b8._0x8ad025)]['globe']['undergroundColorAlphaByDistance'];}set['colorAlphaByDistance'](_0x3a7ac7){const _0x1691a9={_0x32246e:0xfc1,_0x212961:0xaa8,_0xabc4ae:0x526},_0x2f4d89=_0x3d5d32;this[_0x2f4d89(0x1d1)][_0x2f4d89(_0x1691a9._0x32246e)][_0x2f4d89(_0x1691a9._0x212961)][_0x2f4d89(_0x1691a9._0xabc4ae)]=_0x3a7ac7;}['_enabledHook'](_0x5e9a2f){const _0x24b0c3={_0x52266e:0xaa8,_0x144803:0xfc1,_0x20725a:0xa63},_0x2985f6=_0x3d5d32;if(!this['_map'])return;this['_map'][_0x2985f6(0xfc1)][_0x2985f6(_0x24b0c3._0x52266e)][_0x2985f6(0x5d9)]=_0x5e9a2f?!![]:this[_0x2985f6(0x879)],this['_map'][_0x2985f6(_0x24b0c3._0x144803)][_0x2985f6(0xccc)]['enableCollisionDetection']=!_0x5e9a2f,this[_0x2985f6(0x1e8)][_0x2985f6(_0x24b0c3._0x20725a)]=_0x5e9a2f;}['_mountedHook'](){const _0x386e23={_0x59d213:0x1e8,_0x2e5e2d:0xa90,_0x3132b4:0x24b,_0xb71c9f:0x433},_0x2ef463=_0x3d5d32;this[_0x2ef463(_0x386e23._0x59d213)][_0x2ef463(_0x386e23._0x2e5e2d)]=0x1,this['translucency'][_0x2ef463(0xba8)]=0x0,this[_0x2ef463(_0x386e23._0x3132b4)]=this['options']['alpha']??0.5,this['color']=this[_0x2ef463(_0x386e23._0xb71c9f)]['color']??Cesium__namespace['Color']['BLACK'];}['_addedHook'](){const _0x496fe9=_0x3d5d32;this['depthTestOld']=Cesium__namespace['clone'](this['_map'][_0x496fe9(0xfc1)]['globe']['depthTestAgainstTerrain']),this['_enabledHook'](this['enabled']);}['_removedHook'](){const _0x23d65f=_0x3d5d32;this[_0x23d65f(0x1d1)]['scene'][_0x23d65f(0xaa8)][_0x23d65f(0x5d9)]=this['depthTestOld'],this['_enabledHook'](![]);}}class Sightline extends BaseThing{constructor(_0x567372={}){const _0x4c76d={_0x3d4b6c:0x882,_0x380b8b:0xb89},_0x12518b=_0x3d5d32;super(_0x567372),this['_visibleColor']=_0x567372['visibleColor']??new Cesium__namespace[(_0x12518b(_0x4c76d._0x3d4b6c))](0x0,0x1,0x0,0.5),this['_hiddenColor']=_0x567372[_0x12518b(_0x4c76d._0x380b8b)]??new Cesium__namespace['Color'](0x1,0x0,0x0,0.5),this['_depthFailColor']=_0x567372['depthFailColor'],this['lines']=[];}get[_0x3d5d32(0x547)](){return this['_visibleColor'];}set[_0x3d5d32(0x547)](_0x19f510){this['_visibleColor']=_0x19f510;}get['hiddenColor'](){return this['_hiddenColor'];}set['hiddenColor'](_0x3d7aa0){this['_hiddenColor']=_0x3d7aa0;}get['depthFailColor'](){const _0x37d1ba={_0x5b319a:0x306},_0x5f1e2d=_0x3d5d32;return this[_0x5f1e2d(_0x37d1ba._0x5b319a)];}set[_0x3d5d32(0x706)](_0x4125f3){this['_depthFailColor']=_0x4125f3;}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){}['add'](_0x3597a6,_0x51e508,_0xce65fe={}){const _0x4c9864={_0x45ad7e:0x804,_0x4649f7:0xf6d,_0x4d928e:0x1d1,_0x1df483:0x5d9,_0x168364:0xc84,_0x28e198:0xe95},_0x1bb223=_0x3d5d32;_0xce65fe[_0x1bb223(_0x4c9864._0x45ad7e)]&&(_0x3597a6=addPositionsHeight(_0x3597a6,_0xce65fe['offsetHeight']));this['fire'](EventType[_0x1bb223(_0x4c9864._0x4649f7)]);!this[_0x1bb223(_0x4c9864._0x4d928e)][_0x1bb223(0xfc1)]['globe']['depthTestAgainstTerrain']&&(this['_map'][_0x1bb223(0xfc1)]['globe']['depthTestAgainstTerrain']=!![],this['old_depthTestAgainstTerrain']=this[_0x1bb223(0x1d1)]['scene']['globe'][_0x1bb223(_0x4c9864._0x1df483)]);this['_map']['scene']['requestRender']();const _0x437c75=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace['Cartesian3'][_0x1bb223(0xd97)](_0x51e508,_0x3597a6,new Cesium__namespace['Cartesian3']()),new Cesium__namespace[(_0x1bb223(0xe95))]()),_0x41db48=new Cesium__namespace[(_0x1bb223(0xcbc))](_0x3597a6,_0x437c75),_0x162fd1=this['_map']['scene'][_0x1bb223(0x6a3)](_0x41db48,0x2,this[_0x1bb223(0x4dc)]);if(Cesium__namespace['defined'](_0x162fd1)&&_0x162fd1[_0x1bb223(_0x4c9864._0x168364)]>0x0&&Cesium__namespace['defined'](_0x162fd1[0x0])&&Cesium__namespace[_0x1bb223(0xb84)](_0x162fd1[0x0]['position'])){const _0x322feb=_0x162fd1[0x0]['position'],_0xc2c3b2=Cesium__namespace['Cartesian3']['distance'](_0x3597a6,_0x51e508),_0x823e12=Cesium__namespace[_0x1bb223(_0x4c9864._0x28e198)]['distance'](_0x3597a6,_0x322feb);if(_0x823e12<_0xc2c3b2){const _0x173708=this['_showPolyline'](_0x3597a6,_0x51e508,_0x322feb),_0x8e603c={'block':!![],'position':_0x322feb,'entity':_0x173708};return this[_0x1bb223(0xefc)](EventType[_0x1bb223(0xb34)],_0x8e603c),_0x8e603c;}}const _0x24316d=this['_showPolyline'](_0x3597a6,_0x51e508),_0x2d5ca2={'block':![],'entity':_0x24316d};return Cesium__namespace['defined'](this['old_depthTestAgainstTerrain'])&&(this['_map']['scene']['globe']['depthTestAgainstTerrain']=this['old_depthTestAgainstTerrain'],delete this[_0x1bb223(0xfe0)]),this['fire'](EventType['end'],_0x2d5ca2),_0x2d5ca2;}['addAsync'](_0xdccc7b,_0x47638e,_0x1de522={}){const _0x2ff8c8={_0x69d6b2:0x804},_0xf5ff73={_0x1d4562:0x44d},_0x794436={_0x594102:0xc84,_0x196986:0x220,_0x535b4c:0xb34,_0x256d4b:0x2b5,_0x34e75e:0xefc},_0x27f440=_0x3d5d32;_0x1de522[_0x27f440(_0x2ff8c8._0x69d6b2)]&&(_0xdccc7b=addPositionsHeight(_0xdccc7b,_0x1de522['offsetHeight']));const _0x30b3fc=interLine([_0xdccc7b,_0x47638e],{'splitNum':_0x1de522[_0x27f440(0x7a6)]||0x32,'minDistance':_0x1de522['minDistance']});return this['fire'](EventType['start']),new Promise((_0x1e34a6,_0x1aa368)=>{const _0x3808e0=_0x27f440;computeSurfacePoints({'map':this['_map'],'positions':_0x30b3fc})[_0x3808e0(_0xf5ff73._0x1d4562)](_0x1188a6=>{const _0x26e11b=_0x3808e0;if(!_0x1188a6['noHeight'])for(let _0x45b3b2=0x0;_0x45b3b2<_0x30b3fc[_0x26e11b(_0x794436._0x594102)];_0x45b3b2++){const _0xa96d3b=_0x30b3fc[_0x45b3b2],_0xf20009=Cesium__namespace['Cartographic']['fromCartesian'](_0xa96d3b)['height'],_0xdb6f0b=Cesium__namespace[_0x26e11b(_0x794436._0x196986)]['fromCartesian'](_0x1188a6[_0x26e11b(0xbb8)][_0x45b3b2])['height'];if(_0xf20009<=_0xdb6f0b){const _0x2d94d2=this['_showPolyline'](_0xdccc7b,_0x47638e,_0xa96d3b),_0x376e50={'block':!![],'position':_0xa96d3b,'entity':_0x2d94d2};this['fire'](EventType[_0x26e11b(_0x794436._0x535b4c)],_0x376e50),_0x1e34a6(_0x376e50);return;}}const _0x4f9911=this[_0x26e11b(_0x794436._0x256d4b)](_0xdccc7b,_0x47638e),_0x3d8a64={'block':![],'entity':_0x4f9911};this[_0x26e11b(_0x794436._0x34e75e)](EventType['end'],_0x3d8a64),_0x1e34a6(_0x3d8a64);});});}['_showPolyline'](_0x50b9ec,_0xa76665,_0x529d4c){const _0x191937={_0x2c9fcc:0x4dc,_0x57070f:0xea8},_0x121fbf=_0x3d5d32;if(_0x529d4c){const _0x2d4963=this['_map']['entities']['add'](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x50b9ec,_0x529d4c],'width':0x2,'material':this['_visibleColor'],'depthFailMaterial':this['_depthFailColor']}}));this['lines']['push'](_0x2d4963);const _0x4cde6c=this['_map']['entities']['add'](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x529d4c,_0xa76665],'width':0x2,'material':this['_hiddenColor'],'depthFailMaterial':this['_depthFailColor']}}));return this[_0x121fbf(_0x191937._0x2c9fcc)]['push'](_0x4cde6c),[_0x2d4963,_0x4cde6c];}else{const _0x5b6d1b=this['_map'][_0x121fbf(_0x191937._0x57070f)][_0x121fbf(0xff3)](new Cesium__namespace['Entity']({'polyline':{'positions':[_0x50b9ec,_0xa76665],'width':0x2,'material':this['_visibleColor'],'depthFailMaterial':this[_0x121fbf(0x306)]}}));return this['lines']['push'](_0x5b6d1b),[_0x5b6d1b];}}['clear'](){const _0x20ce4e={_0x5a4031:0x4dc},_0x50e321=_0x3d5d32;for(let _0x45f324=0x0,_0x414fe3=this['lines']['length'];_0x45f324<_0x414fe3;_0x45f324++){this['_map']['entities']['remove'](this[_0x50e321(_0x20ce4e._0x5a4031)][_0x45f324]);}this['lines']=[];}}var fragmentShaderSource$1='#extension\x20GL_OES_standard_derivatives\x20:\x20enable\x0auniform\x20sampler2D\x20colorTexture;\x0auniform\x20sampler2D\x20depthTexture;\x0auniform\x20float\x20lineWidth;\x0auniform\x20float\x20height;\x0auniform\x20bvec3\x20strokeType;\x0auniform\x20vec3\x20tjxColor;\x0auniform\x20vec3\x20bjColor;\x0auniform\x20vec3\x20cameraPos;\x0auniform\x20float\x20mbDis;\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec4\x20toEye(in\x20vec2\x20uv,\x20in\x20float\x20depth)\x20{\x0a\x20\x20vec2\x20xy\x20=\x20vec2((uv.x\x20*\x202.0\x20-\x201.0),\x20(uv.y\x20*\x202.0\x20-\x201.0));\x0a\x20\x20vec4\x20posInCamera\x20=\x20czm_inverseProjection\x20*\x20vec4(xy,\x20depth,\x201.0);\x0a\x20\x20posInCamera\x20=\x20posInCamera\x20/\x20posInCamera.w;\x0a\x20\x20return\x20posInCamera;\x0a}\x0afloat\x20getDepth(in\x20vec4\x20depth)\x20{\x0a\x20\x20float\x20z_window\x20=\x20czm_unpackDepth(depth);\x0a\x20\x20z_window\x20=\x20czm_reverseLogDepth(z_window);\x0a\x20\x20float\x20n_range\x20=\x20czm_depthRange.near;\x0a\x20\x20float\x20f_range\x20=\x20czm_depthRange.far;\x0a\x20\x20return\x20(2.0\x20*\x20z_window\x20-\x20n_range\x20-\x20f_range)\x20/\x20(f_range\x20-\x20n_range);\x0a}\x0abool\x20isTJX(vec2\x20uv,\x20float\x20lw)\x20{\x0a\x20\x20vec2\x20pixelSize\x20=\x20lw\x20/\x20czm_viewport.zw;\x0a\x20\x20float\x20dx0\x20=\x20-pixelSize.x;\x0a\x20\x20float\x20dy0\x20=\x20-pixelSize.y;\x0a\x20\x20float\x20dx1\x20=\x20pixelSize.x;\x0a\x20\x20float\x20dy1\x20=\x20pixelSize.y;\x0a\x0a\x20\x20vec2\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x20dy0);\x0a\x20\x20vec4\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20float\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(0.0,\x20dy0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x20dy0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x200.0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x200.0);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx0,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(0.0,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20currUV\x20=\x20uv\x20+\x20vec2(dx1,\x20dy1);\x0a\x20\x20currDepth\x20=\x20texture(depthTexture,\x20currUV);\x0a\x20\x20depth\x20=\x20getDepth(currDepth);\x0a\x20\x20if(depth\x20>=\x201.0)\x0a\x20\x20\x20\x20return\x20true;\x0a\x0a\x20\x20return\x20false;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec4\x20color\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20if(height\x20>\x2014102.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20vec4\x20currD\x20=\x20texture(depthTexture,\x20v_textureCoordinates);\x0a\x20\x20if(currD.r\x20>=\x201.0)\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20return;\x0a\x20\x20}\x0a\x20\x20float\x20depth\x20=\x20getDepth(currD);\x0a\x20\x20vec4\x20positionEC\x20=\x20toEye(v_textureCoordinates,\x20depth);\x0a\x20\x20vec3\x20dx\x20=\x20dFdx(positionEC.xyz);\x0a\x20\x20vec3\x20dy\x20=\x20dFdy(positionEC.xyz);\x0a\x20\x20vec3\x20normal\x20=\x20normalize(cross(dx,\x20dy));\x0a\x0a\x20\x20if(strokeType.y\x20||\x20strokeType.z)\x20{\x0a\x20\x20\x20\x20vec4\x20wp\x20=\x20czm_inverseView\x20*\x20positionEC;\x0a\x20\x20\x20\x20if(distance(wp.xyz,\x20cameraPos)\x20>\x20mbDis)\x20{\x0a\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20color;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20float\x20dotNum\x20=\x20abs(dot(normal,\x20normalize(positionEC.xyz)));\x0a\x20\x20\x20\x20\x20\x20if(dotNum\x20<\x200.05)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(bjColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20if(strokeType.x\x20||\x20strokeType.z)\x20{\x0a\x20\x20\x20\x20bool\x20tjx\x20=\x20isTJX(v_textureCoordinates,\x20lineWidth);\x0a\x20\x20\x20\x20if(tjx)\x20{\x0a\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(tjxColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20out_FragColor\x20=\x20color;\x0a}\x0a';class Skyline extends BaseThing{constructor(_0x318470={}){const _0x4f4304={_0x2469fb:0xe8f,_0x2a2359:0x882},_0x4fc7b4=_0x3d5d32;super(_0x318470),this[_0x4fc7b4(_0x4f4304._0x2469fb)]=_0x318470['color']??new Cesium__namespace['Color'](0x1,0x0,0x0),this[_0x4fc7b4(0x1076)]=_0x318470['width']??0x2,this['strokeType']=_0x318470[_0x4fc7b4(0xb8a)]??new Cesium__namespace['Cartesian3'](!![],![],![]),this['bjColor']=_0x318470['bjColor']??new Cesium__namespace[(_0x4fc7b4(_0x4f4304._0x2a2359))](0x0,0x0,0x1),this['distance']=_0x318470['distance']??0x1f4;}[_0x3d5d32(0xacd)](_0x17c0fd){_0x17c0fd?!this['postProcessStage']&&this['_addedHook']():this['postProcessStage']&&this['_removedHook']();}['_addedHook'](){const _0x179e82={_0x16281d:0xff3},_0x55ffd1={_0x177326:0x4c0},_0x2361db=_0x3d5d32,_0x5105e0=this['_map']['camera'];this['postProcessStage']=new Cesium__namespace['PostProcessStage']({'fragmentShader':fragmentShaderSource$1,'uniforms':{'height':()=>{const _0x45550a=_0x4132;return _0x5105e0['positionCartographic'][_0x45550a(0x83e)];},'lineWidth':()=>{const _0x4ef147=_0x4132;return this[_0x4ef147(0x1076)];},'strokeType':()=>{return this['strokeType'];},'tjxColor':()=>{return this['color'];},'bjColor':()=>{const _0x519996=_0x4132;return this[_0x519996(_0x55ffd1._0x177326)];},'cameraPos':()=>{return _0x5105e0['position'];},'mbDis':()=>{return this['distance'];}}}),this['_map']['scene']['postProcessStages'][_0x2361db(_0x179e82._0x16281d)](this['postProcessStage']);}['_removedHook'](){const _0x29454b=_0x3d5d32;this['postProcessStage']&&(this['_map'][_0x29454b(0xfc1)]['postProcessStages']['remove'](this['postProcessStage']),this['postProcessStage']['destroy'](),delete this['postProcessStage']);}}class SkylineBody extends BaseThing{constructor(_0x4824c2={}){const _0x425580=_0x3d5d32;super(_0x4824c2),this['color']=_0x4824c2['color']??new Cesium__namespace[(_0x425580(0x882))](0x1,0x0,0x0),this['width']=_0x4824c2['width']??0x2,this['strokeType']=_0x4824c2[_0x425580(0xb8a)]??new Cesium__namespace['Cartesian3'](!![],![],![]),this['bjColor']=_0x4824c2['bjColor']??new Cesium__namespace['Color'](0x0,0x0,0x1),this[_0x425580(0xbd7)]=_0x4824c2['distance']??0x1f4;}['_enabledHook'](_0x3e037e){const _0x2a3e00=_0x3d5d32;_0x3e037e?!this[_0x2a3e00(0x922)]&&this['_addedHook']():this['postProcessStage']&&this[_0x2a3e00(0x566)]();}['_mountedHook'](){const _0x4a4593=_0x3d5d32;this[_0x4a4593(0x596)]=new GraphicLayer({'name':'天际线分析','private':!![]});}[_0x3d5d32(0x226)](){const _0x316465={_0x3e4058:0xc17,_0x10a2ec:0x433},_0x5148e0=_0x3d5d32;this['_map'][_0x5148e0(_0x316465._0x3e4058)](this['graphicLayer']);const _0x48f819=this['_map']['scene'],_0x564c29=0x200,_0x140404=new Cesium__namespace['Picking'](_0x48f819),_0x22888d=getRayIntersectingPositions(_0x48f819,_0x140404,_0x564c29),_0x4aec43=_0x48f819['camera']['position'],_0x2eea59=[_0x4aec43];for(let _0x141858=_0x564c29-0x1;_0x141858>=0x0;_0x141858--){for(let _0x594fd4=_0x564c29-0x1;_0x594fd4>=0x0;_0x594fd4--){const _0x4f6226=_0x22888d[_0x141858][_0x594fd4];if(_0x4f6226){_0x2eea59['push'](_0x4f6226);break;}}}_0x2eea59[_0x5148e0(0xb75)](_0x4aec43);const _0x505baa=new PolygonPrimitive({'positions':_0x2eea59,'style':{'color':'#007be6','opacity':0.5,'outline':![],'extrudedHeight':0x0,...this[_0x5148e0(_0x316465._0x10a2ec)]['style']||{},'perPositionHeight':!![]}});this[_0x5148e0(0x596)]['addGraphic'](_0x505baa),this['_graphic']=_0x505baa;}['_removedHook'](){this['_map']['removeLayer'](this['graphicLayer']);}['destroy'](_0x304fba){const _0x55cd3c={_0x274290:0x689},_0x2218df=_0x3d5d32;this['graphicLayer']&&this['graphicLayer'][_0x2218df(_0x55cd3c._0x274290)](_0x304fba),super['destroy'](_0x304fba);}}const fragmentShaderSource='\x0a\x20\x20\x20\x20precision\x20highp\x20float;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20u_positionTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20shadowMap_texture;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20vec4\x20getPositionEC(vec2\x20uv)\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20vec4\x20positionEC\x20=\x20\x20texture(u_positionTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20return\x20vec4(positionEC.xyz,\x201.0);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20void\x20main()\x20{\x0a\x20\x20\x20\x20\x20\x20vec2\x20uv\x20=\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20float\x20maxDepth\x20=\x20shadowMap_cascadeSplits[1].w;\x0a\x20\x20\x20\x20\x20\x20vec4\x20positionEC\x20=\x20getPositionEC(uv);\x0a\x20\x20\x20\x20\x20\x20vec3\x20normalEC\x20=\x20vec3(1.0);\x0a\x20\x20\x20\x20\x20\x20float\x20depth\x20=\x20-positionEC.z;\x0a\x0a\x20\x20\x20\x20\x20\x20if\x20(depth\x20>\x20maxDepth){\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20weights\x20=\x20czm_cascadeWeights(depth);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20shadowPosition\x20=\x20czm_cascadeMatrix(weights)\x20*\x20positionEC;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20deptha\x20=\x20czm_unpackDepth(texture(shadowMap_texture,\x20shadowPosition.xy));\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(step(shadowPosition.z,deptha),\x200.0,\x201.0,\x202.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=\x20vec4(uv,\x201.0,\x202.0);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20',vertexShaderSource='\x0a\x20\x20\x20\x20in\x20vec4\x20position;\x0a\x20\x20\x20\x20in\x20vec2\x20textureCoordinates;\x0a\x20\x20\x20\x20out\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20void\x20main()\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20position;\x0a\x20\x20\x20\x20\x20\x20\x20\x20v_textureCoordinates\x20=\x20textureCoordinates;\x0a\x20\x20\x20\x20}\x0a\x20\x20',texturePositions=new Float32Array([-0x1,-0x1,0x1,-0x1,0x1,0x1,-0x1,0x1]),textureUVs=new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1]),textureIndices=new Uint16Array([0x0,0x1,0x2,0x0,0x2,0x3]);function createTextureVA(_0x4012a5){const _0x2e32ff={_0x5f1867:0x105d,_0x242a7c:0x1012,_0x2f1a34:0xc09,_0x563cc9:0x3ac},_0x54dbec=_0x3d5d32,_0x404559=Cesium__namespace[_0x54dbec(0x805)]['createVertexBuffer']({'context':_0x4012a5,'typedArray':texturePositions,'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),_0x2e5893=Cesium__namespace['Buffer'][_0x54dbec(0xeaa)]({'context':_0x4012a5,'typedArray':textureUVs,'usage':Cesium__namespace['BufferUsage']['STATIC_DRAW']}),_0x14e9a1=Cesium__namespace['Buffer'][_0x54dbec(_0x2e32ff._0x5f1867)]({'context':_0x4012a5,'typedArray':textureIndices,'usage':Cesium__namespace['BufferUsage'][_0x54dbec(_0x2e32ff._0x242a7c)],'indexDatatype':Cesium__namespace[_0x54dbec(_0x2e32ff._0x2f1a34)]['UNSIGNED_SHORT']}),_0x55a70f=[{'index':0x0,'vertexBuffer':_0x404559,'componentsPerAttribute':0x2,'componentDatatype':Cesium__namespace[_0x54dbec(0x3ac)]['FLOAT']},{'index':0x1,'vertexBuffer':_0x2e5893,'componentsPerAttribute':0x2,'componentDatatype':Cesium__namespace[_0x54dbec(_0x2e32ff._0x563cc9)]['FLOAT']}];return new Cesium__namespace['VertexArray']({'context':_0x4012a5,'attributes':_0x55a70f,'indexBuffer':_0x14e9a1});}function createFramebuffer(_0x4be436,_0x3601ac){const _0x1b4605={_0xddf605:0x363},_0x48d2d3=_0x3d5d32;return new Cesium__namespace[(_0x48d2d3(_0x1b4605._0xddf605))]({'context':_0x4be436,'colorTextures':[_0x3601ac],'destroyAttachments':![]});}function computeTextureResolution(_0x4900bf){const _0x2bf2a6=Cesium__namespace['ContextLimits']['maximumTextureSize'],_0x4a203e=Math['min'](_0x4900bf,_0x2bf2a6),_0x41cd44=Math['ceil'](_0x4900bf/_0x4a203e);return{'x':_0x4a203e,'y':_0x41cd44};}function completionBuffer(_0x530bd7,_0x1485d8){const _0x588aba={_0x2f7124:0xb75},_0x3693ce=_0x3d5d32,_0x30413a=_0x1485d8['x']*_0x1485d8['y'],_0x5539d3=_0x530bd7['length']/0x4;for(let _0x375d41=_0x5539d3;_0x375d41<_0x30413a;_0x375d41++){_0x530bd7['push'](0x0),_0x530bd7[_0x3693ce(_0x588aba._0x2f7124)](0x0),_0x530bd7['push'](0x0),_0x530bd7['push'](0x0);}}class ShadowRateDrawCommand{constructor(_0x33cda8,_0x3d9ce8){const _0x40a74c={_0x156a12:0x92a,_0x3adbf4:0x34e,_0x2b304b:0xf42,_0x485829:0xa17},_0x83ed6b={_0x47259b:0x92a},_0x295405={_0x2fbf3c:0xe54},_0x11fe75={_0x2c591a:0x1064},_0x445d8c=_0x3d5d32;this[_0x445d8c(0xd9f)]=new Cesium__namespace['Event'](),this['_scene']=_0x33cda8,this[_0x445d8c(0x924)]=_0x3d9ce8,this['_stat']=![];const _0x2c06cb=_0x3d9ce8['length'];this['_requiredResolution']=computeTextureResolution(_0x2c06cb);const _0x316f9e=new Cesium__namespace['Texture']({'context':_0x33cda8[_0x445d8c(_0x40a74c._0x156a12)],'source':{'arrayBufferView':new Float32Array(this['_requiredResolution']['x']*this['_requiredResolution']['y']*0x4),'width':this['_requiredResolution']['x'],'height':this[_0x445d8c(0x3ce)]['y']},'pixelDatatype':Cesium__namespace['PixelDatatype'][_0x445d8c(_0x40a74c._0x3adbf4)],'pixelFormat':Cesium__namespace[_0x445d8c(0x2bb)][_0x445d8c(_0x40a74c._0x2b304b)],'flipY':![]}),_0x329371=createTextureVA(_0x33cda8[_0x445d8c(_0x40a74c._0x156a12)]),_0x587ea4=Cesium__namespace[_0x445d8c(_0x40a74c._0x485829)]['fromCache']({'context':_0x33cda8['context'],'vertexShaderSource':vertexShaderSource,'fragmentShaderSource':fragmentShaderSource,'attributeLocations':{'position':0x0,'textureCoordinates':0x1}});this[_0x445d8c(0xed5)]=new Cesium__namespace[(_0x445d8c(0xf84))]({'vertexArray':_0x329371,'shaderProgram':_0x587ea4,'outputTexture':_0x316f9e,'uniformMap':{'shadowMap_cascadeSplits':()=>{return _0x33cda8['shadowMap']['_cascadeSplits'];},'shadowMap_cascadeMatrices':()=>{const _0x52a2f0=_0x445d8c;return _0x33cda8[_0x52a2f0(_0x11fe75._0x2c591a)]['_cascadeMatrices'];},'shadowMap_texture':()=>{return _0x33cda8['shadowMap']['_shadowMapTexture'];},'u_positionTexture':()=>{const _0x3304fb=_0x445d8c;return this[_0x3304fb(_0x295405._0x2fbf3c)];}},'persists':!![],'owner':this,'postExecute':_0xcafafb=>{const _0x49a92b=_0x445d8c,_0x1d2c59=createFramebuffer(_0x33cda8['context'],_0xcafafb),_0x180dfc=_0x33cda8[_0x49a92b(_0x83ed6b._0x47259b)]['readPixels']({'framebuffer':_0x1d2c59,'width':this['_requiredResolution']['x'],'height':this['_requiredResolution']['y']});this['_event']['raiseEvent'](_0x180dfc['slice'](0x0,_0x2c06cb*0x4));}});}get[_0x3d5d32(0x8f7)](){return this['_event'];}['start'](){const _0x4f6417={_0xe15f58:0x627,_0x71c53c:0x1061},_0x1c8fac=_0x3d5d32,_0x5ada21=this[_0x1c8fac(_0x4f6417._0xe15f58)]['camera']['viewMatrix'],_0x489bc5=this['_positions']['map'](_0x35629a=>Cesium__namespace['Matrix4']['multiplyByPoint'](_0x5ada21,_0x35629a,new Cesium__namespace['Cartesian3']())),_0x4f3d1d=[];_0x489bc5[_0x1c8fac(_0x4f6417._0x71c53c)](_0xa1b60d=>{_0x4f3d1d['push'](_0xa1b60d['x']),_0x4f3d1d['push'](_0xa1b60d['y']),_0x4f3d1d['push'](_0xa1b60d['z']),_0x4f3d1d['push'](0x0);}),this[_0x1c8fac(0xe54)]&&this[_0x1c8fac(0xe54)]['destroy'](),completionBuffer(_0x4f3d1d,this[_0x1c8fac(0x3ce)]),this['_positionTexture']=new Cesium__namespace['Texture']({'context':this['_scene']['context'],'source':{'width':this['_requiredResolution']['x'],'height':this['_requiredResolution']['y'],'arrayBufferView':new Float32Array(_0x4f3d1d)},'pixelDatatype':Cesium__namespace['PixelDatatype']['FLOAT'],'flipY':![]}),this[_0x1c8fac(0xdfa)]=!![];}['update'](_0x3a6fcc){const _0x298582={_0x101fe0:0xdfa,_0x424cd4:0xed5},_0x419e35=_0x3d5d32;if(!this['drawCommand'])return;this[_0x419e35(_0x298582._0x101fe0)]&&(_0x3a6fcc['commandList']['push'](this[_0x419e35(_0x298582._0x424cd4)]),this['_stat']=![]);}[_0x3d5d32(0x689)](){const _0xe237a5={_0x3d5e7d:0x689},_0x323f7b=_0x3d5d32;this[_0x323f7b(0xe54)]&&this['_positionTexture'][_0x323f7b(_0xe237a5._0x3d5e7d)](),Cesium__namespace['destroyObject'](this);}}class Shadows extends BaseThing{get[_0x3d5d32(0x1064)](){const _0x3aafe9={_0x27f291:0x1064},_0x4583ae=_0x3d5d32;return this[_0x4583ae(0x1d1)]['scene'][_0x4583ae(_0x3aafe9._0x27f291)];}get[_0x3d5d32(0x5d6)](){const _0x25fda0={_0x2a2124:0x8b7},_0x3b8777=_0x3d5d32,_0x21da98=this['_map']['clock'][_0x3b8777(0x4f8)];return Cesium__namespace[_0x3b8777(_0x25fda0._0x2a2124)][_0x3b8777(0x834)](_0x21da98);}set['time'](_0x41578c){this['_map']['clock']['currentTime']=Cesium__namespace['JulianDate']['fromDate'](_0x41578c),this['stop']();}get[_0x3d5d32(0x37d)](){return this['_map']['clock']['shouldAnimate'];}get['multiplier'](){var _0x25ec8d;return(_0x25ec8d=this['_map'])===null||_0x25ec8d===void 0x0?void 0x0:_0x25ec8d['clock']['multiplier'];}set[_0x3d5d32(0xe09)](_0x4286d3){const _0x2c5379={_0x5e9131:0xe09},_0x2a3212=_0x3d5d32;this['options']['multiplier']=_0x4286d3,this['_map']&&(this['_map']['clock'][_0x2a3212(_0x2c5379._0x5e9131)]=_0x4286d3);}['_enabledHook'](_0x16c264){const _0x2eadc9={_0x27d0ad:0x433,_0x27cd0b:0xb81,_0x2a91fb:0x690},_0x1bf02a=_0x3d5d32;if(!this['_map'])return;this[_0x1bf02a(0x1d1)]['viewer'][_0x1bf02a(0x1001)]=_0x16c264,(this[_0x1bf02a(_0x2eadc9._0x27d0ad)]['terrain']??!![])&&(this['_map']['viewer'][_0x1bf02a(_0x2eadc9._0x27cd0b)]=_0x16c264?Cesium__namespace['ShadowMode'][_0x1bf02a(_0x2eadc9._0x2a91fb)]:Cesium__namespace[_0x1bf02a(0xddd)]['DISABLED']),(this['options']['lighting']??!![])&&(this['_map']['scene']['globe']['enableLighting']=_0x16c264);}[_0x3d5d32(0xe4c)](){}['_addedHook'](){const _0x79a3b5={_0x34a661:0x9f4,_0x53c5a1:0x4e7,_0xa7b3b9:0x1d1,_0x42b961:0xa63,_0x347ade:0x433,_0x30f6ab:0xe09,_0xc78d13:0x5d6,_0x5d39a1:0x6df},_0x18d38c=_0x3d5d32;this['_last_startTime']=this['_map']['clock'][_0x18d38c(0xee6)],this['_last_stopTime']=this[_0x18d38c(0x1d1)][_0x18d38c(_0x79a3b5._0x34a661)][_0x18d38c(0xd39)],this['_last_shouldAnimate']=this['_map']['clock'][_0x18d38c(_0x79a3b5._0x53c5a1)],this['_last_clockRange']=this['_map'][_0x18d38c(0x9f4)]['clockRange'],this['_last_multiplier']=this[_0x18d38c(_0x79a3b5._0xa7b3b9)][_0x18d38c(_0x79a3b5._0x34a661)]['multiplier'],this['_last_shadows']=this['_map']['viewer']['shadows'],this['_enabledHook'](this[_0x18d38c(_0x79a3b5._0x42b961)]),this['_map']['clock']['shouldAnimate']=![],this['_map']['clock']['clockRange']=this[_0x18d38c(_0x79a3b5._0x347ade)][_0x18d38c(0x700)]??Cesium__namespace['ClockRange']['CLAMPED'],this[_0x18d38c(0x1d1)][_0x18d38c(0x9f4)][_0x18d38c(_0x79a3b5._0x30f6ab)]=this['options']['multiplier']??0x640,this['options'][_0x18d38c(_0x79a3b5._0xc78d13)]&&(this[_0x18d38c(0x5d6)]=this['options'][_0x18d38c(0x5d6)]),this['_map']['on'](EventType[_0x18d38c(_0x79a3b5._0x5d39a1)],this['_onClockTickHanlder'],this);}[_0x3d5d32(0x566)](){const _0x4a7581={_0x450aa0:0x76d,_0xdb0914:0x9f4,_0x146a37:0x7b6},_0xb49731=_0x3d5d32;this['_map']['off'](EventType['clockTick'],this[_0xb49731(0x333)],this),this[_0xb49731(_0x4a7581._0x450aa0)](),this['_enabledHook'](![]),this['_map']['viewer'][_0xb49731(0x1001)]=this[_0xb49731(0x3c7)],this['_map'][_0xb49731(_0x4a7581._0xdb0914)]['clockRange']=this[_0xb49731(_0x4a7581._0x146a37)],this['_map']['clock']['multiplier']=this['_last_multiplier'],this['_map']['clock']['shouldAnimate']=this['_last_shouldAnimate'];}['_onClockTickHanlder'](){const _0x2fb069=_0x3d5d32;if(!this['_map']['clock']['shouldAnimate'])return;this['_drawCommand']&&(this['_drawCommand']['start'](),this['_rate_total']+=0x1),this[_0x2fb069(0xefc)](EventType['change']);}['start'](_0x36c9b7,_0x4af728,_0x481569){const _0x4a8578={_0x55b66f:0x1d1,_0x17494e:0xee6,_0x449aa5:0x8b7},_0x59005e=_0x3d5d32;if(!this['_map'])return;if(!_0x36c9b7||!_0x4af728||_0x36c9b7>=_0x4af728)return;this[_0x59005e(_0x4a8578._0x55b66f)]['clock'][_0x59005e(_0x4a8578._0x17494e)]=Cesium__namespace[_0x59005e(_0x4a8578._0x449aa5)]['fromDate'](_0x36c9b7),this['_map'][_0x59005e(0x9f4)]['currentTime']=Cesium__namespace['JulianDate'][_0x59005e(0xc1b)](_0x481569||_0x36c9b7),this['_map']['clock']['stopTime']=Cesium__namespace[_0x59005e(_0x4a8578._0x449aa5)]['fromDate'](_0x4af728),this[_0x59005e(_0x4a8578._0x55b66f)][_0x59005e(0x9f4)]['shouldAnimate']=!![];}['pause'](){this['_map']&&(this['_map']['clock']['shouldAnimate']=![]);}['proceed'](){const _0x1b7469=_0x3d5d32;this['_map']&&(this[_0x1b7469(0x1d1)]['clock'][_0x1b7469(0x4e7)]=!![]);}[_0x3d5d32(0x886)](){const _0x438da6=_0x3d5d32;this['_map']&&(this[_0x438da6(0x1d1)][_0x438da6(0x9f4)]['shouldAnimate']=![]);}[_0x3d5d32(0x76d)](){const _0x2a9f00={_0x46d459:0x1d1,_0x23479a:0xee6,_0x69d693:0xdfb},_0x48e674=_0x3d5d32;this[_0x48e674(0x886)](),this['currentTime']=new Date(),this[_0x48e674(_0x2a9f00._0x46d459)]['clock'][_0x48e674(_0x2a9f00._0x23479a)]=this[_0x48e674(0xa00)],this[_0x48e674(0x1d1)]['clock']['stopTime']=this['_last_stopTime'],this['_map']['off'](EventType['clockStop'],this[_0x48e674(_0x2a9f00._0x69d693)],this),this[_0x48e674(0x552)]();}['startRate'](_0x10a32b){const _0x2b46a1={_0x52fb8e:0x859,_0x316e8e:0x7d5,_0x558be6:0xb84,_0x45a340:0x7cb,_0x134f62:0x1d1,_0x29e1b2:0x456,_0xdfda9:0xa0c},_0x353ff3={_0x14f757:0xfc4},_0x26b0f4={_0x393012:0xe95,_0x419b05:0x5d8,_0x2465af:0xd29},_0x57c4c6={_0x4a8ed6:0xe69,_0x1667d6:0xd29,_0x1c9fe6:0xb75};return new Promise((_0x2c4901,_0x366be0)=>{const _0x11e315=_0x4132;if(!this['_map']||!_0x10a32b['positions']||_0x10a32b['positions']['length']===0x0)return _0x2c4901();if(!_0x10a32b[_0x11e315(_0x2b46a1._0x52fb8e)]||!_0x10a32b['endDate']||_0x10a32b['startDate']>=_0x10a32b['endDate'])return _0x2c4901();this['_promise_resolve']=_0x2c4901;const _0x5401b9=getGridPointsByPoly(_0x10a32b['positions'],_0x10a32b[_0x11e315(_0x2b46a1._0x316e8e)],_0x10a32b['minHeight']),_0x404ea5=[];if(Cesium__namespace['defined'](_0x10a32b['minHeight'])&&Cesium__namespace[_0x11e315(_0x2b46a1._0x558be6)](_0x10a32b['maxHeight'])&&_0x10a32b['minHeight']!==_0x10a32b[_0x11e315(0x7cb)])for(let _0x1c119a=_0x10a32b[_0x11e315(0xa28)];_0x1c119a<_0x10a32b[_0x11e315(_0x2b46a1._0x45a340)];_0x1c119a+=_0x10a32b['step']){_0x5401b9['forEach'](_0x3d881a=>{const _0xbb651f=_0x11e315,_0x2d1d01=Cesium__namespace[_0xbb651f(0xe95)][_0xbb651f(_0x57c4c6._0x4a8ed6)](_0x3d881a['lng'],_0x3d881a['lat'],_0x1c119a);_0x2d1d01[_0xbb651f(0x5d8)]=_0x3d881a['lng'],_0x2d1d01[_0xbb651f(0xd57)]=_0x3d881a['lat'],_0x2d1d01[_0xbb651f(_0x57c4c6._0x1667d6)]=_0x1c119a,_0x2d1d01[_0xbb651f(0x76c)]=0x0,_0x404ea5[_0xbb651f(_0x57c4c6._0x1c9fe6)](_0x2d1d01);});}else _0x5401b9['forEach'](_0x325a6d=>{const _0x33a693=_0x11e315,_0x617284=Cesium__namespace[_0x33a693(_0x26b0f4._0x393012)]['fromDegrees'](_0x325a6d[_0x33a693(_0x26b0f4._0x419b05)],_0x325a6d['lat'],_0x325a6d[_0x33a693(0xd29)]);_0x617284['lng']=_0x325a6d['lng'],_0x617284[_0x33a693(0xd57)]=_0x325a6d['lat'],_0x617284[_0x33a693(_0x26b0f4._0x2465af)]=_0x325a6d[_0x33a693(_0x26b0f4._0x2465af)],_0x617284['total']=0x0,_0x404ea5['push'](_0x617284);});this['_rate_positions']=_0x404ea5,this[_0x11e315(0x552)](),this['_drawCommand']=new ShadowRateDrawCommand(this[_0x11e315(_0x2b46a1._0x134f62)]['scene'],this['_rate_positions']),this[_0x11e315(0x1d1)]['scene']['primitives'][_0x11e315(0xff3)](this[_0x11e315(_0x2b46a1._0x29e1b2)]),this['_drawCommand']['event'][_0x11e315(0x34f)](_0x57d77c=>{const _0x23ee5d=_0x11e315,_0x156a9b=_0x57d77c[_0x23ee5d(0xc84)];let _0x318942=0x0;for(let _0xf5648f=0x0;_0xf5648f<_0x156a9b;_0xf5648f+=0x4){this[_0x23ee5d(_0x353ff3._0x14f757)][_0x318942]['total']+=_0x57d77c[_0xf5648f],_0x318942+=0x1;}}),this['_map']['on'](EventType['clockStop'],this[_0x11e315(0xdfb)],this),this['start'](_0x10a32b['startDate'],_0x10a32b[_0x11e315(_0x2b46a1._0xdfda9)]),this['fire'](EventType['start']);});}['_clearDraw'](){const _0x1d5a8e={_0x234194:0x730,_0x953685:0x456},_0x15cdb9=_0x3d5d32;this[_0x15cdb9(0xb8f)]=0x0;if(this['_rate_positions'])for(let _0xd7ede4=0x0,_0x3b7014=this['_rate_positions']['length'];_0xd7ede4<_0x3b7014;_0xd7ede4++){this['_rate_positions'][_0xd7ede4]['total']=0x0;}this[_0x15cdb9(0x456)]&&(this['_map']['scene'][_0x15cdb9(_0x1d5a8e._0x234194)]['remove'](this[_0x15cdb9(_0x1d5a8e._0x953685)]),this['_drawCommand']['destroy'](),delete this['_drawCommand']);}['_map_clockStopTickHandler'](_0x372c8e){const _0xb5f432={_0x34b637:0xfc1,_0x19ce9b:0xb0f},_0x3fc5cd=_0x3d5d32;this['_map'][_0x3fc5cd(0x9e7)](EventType[_0x3fc5cd(0xfc5)],this['_map_clockStopTickHandler'],this);this['_drawCommand']&&(this['_map'][_0x3fc5cd(_0xb5f432._0x34b637)]['primitives']['remove'](this['_drawCommand']),this['_drawCommand']['destroy'](),delete this['_drawCommand']);for(let _0x4c106e=0x0,_0x3d6b3c=this['_rate_positions']['length'];_0x4c106e<_0x3d6b3c;_0x4c106e++){this[_0x3fc5cd(0xfc4)][_0x4c106e]['rate']=0x1-this['_rate_positions'][_0x4c106e]['total']/this['_rate_total'];}const _0x3d7783={'total':this['_rate_total'],'positions':this['_rate_positions']};this[_0x3fc5cd(_0xb5f432._0x19ce9b)]&&(this[_0x3fc5cd(_0xb5f432._0x19ce9b)](_0x3d7783),delete this['_promise_resolve']),this['fire'](EventType['stop'],_0x3d7783);}}class Measure extends BaseThing{get[_0x3d5d32(0x596)](){return this['_graphicLayer'];}get[_0x3d5d32(0xf9d)](){return this['_graphicLayer']['graphics'];}get['hasMeasure'](){const _0x5e11b5={_0x45ebf8:0xc84},_0x4ab8ce=_0x3d5d32;return this[_0x4ab8ce(0x32f)][_0x4ab8ce(_0x5e11b5._0x45ebf8)]>0x0;}[_0x3d5d32(0xacd)](_0x5f4d9c){}['_mountedHook'](){const _0x8b1ee2={_0x216f4b:0x32f,_0x52adbf:0x1d1},_0x45402f={_0x1adbbf:0x358},_0x4681b4=_0x3d5d32;this[_0x4681b4(_0x8b1ee2._0x216f4b)]=new GraphicLayer({'hasEdit':!![],'eventParent':this,'isContinued':this['options']['isContinued'],'isAutoEditing':!this[_0x4681b4(0x433)]['isContinued'],...this['options'],'private':!![]}),this['_graphicLayer']['hasEdit']&&this['_graphicLayer']['bindContextMenu']([{'text':this[_0x4681b4(_0x8b1ee2._0x52adbf)]['getLangText']('_删除测量'),'icon':Icon['Delete'],'show':_0x2af25c=>{const _0x412230=_0x4681b4,_0x3d0983=_0x2af25c['graphic'];return _0x3d0983!==null&&_0x3d0983!==void 0x0&&_0x3d0983[_0x412230(0xce4)]&&!_0x3d0983['editing']?![]:!![];},'callback':_0x3f4436=>{const _0x5ee15a=_0x4681b4,_0x6868d6=_0x3f4436['graphic'];if(!_0x6868d6)return;const _0x479166=_0x6868d6[_0x5ee15a(0xd00)];this['_graphicLayer']['removeGraphic'](_0x6868d6),_0x479166&&this['_graphicLayer'][_0x5ee15a(_0x45402f._0x1adbbf)](_0x479166),this['fire'](EventType['remove'],{'mtype':this[_0x5ee15a(0xcf5)],'graphic':_0x6868d6});}}]);}['_addedHook'](){const _0x583388={_0x267f57:0x1d1},_0x6d653f=_0x3d5d32;this[_0x6d653f(_0x583388._0x267f57)]['addLayer'](this['_graphicLayer']);}['_removedHook'](){const _0x2b7c43={_0x4b0ca5:0x1d1,_0x1bdd86:0x32f},_0x431009=_0x3d5d32;this[_0x431009(_0x2b7c43._0x4b0ca5)]['removeLayer'](this[_0x431009(_0x2b7c43._0x1bdd86)]);}['distance'](_0xb9e447={}){const _0x4d9495={_0x5cf72b:0xf57},_0x6ea18f=_0x3d5d32;return this[_0x6ea18f(_0x4d9495._0x5cf72b)](),_0xb9e447['type']='distanceMeasure',this['_graphicLayer'][_0x6ea18f(0x8d9)](_0xb9e447);}['distanceSurface'](_0x895999={}){const _0x41bd33=_0x3d5d32;return this['stopDraw'](),_0x895999[_0x41bd33(0x7f5)]=_0x41bd33(0xe35),this['_graphicLayer']['startDraw'](_0x895999);}[_0x3d5d32(0xe51)](_0x6a1b37={}){const _0x2a4075={_0x203616:0x8d9},_0x456be8=_0x3d5d32;return this['stopDraw'](),_0x6a1b37['type']='sectionMeasure',this['_graphicLayer'][_0x456be8(_0x2a4075._0x203616)](_0x6a1b37);}[_0x3d5d32(0x772)](_0x296505={}){const _0x4e76b8={_0x2dab74:0x32f},_0x3bee90=_0x3d5d32;return this['stopDraw'](),_0x296505['type']='areaMeasure',this[_0x3bee90(_0x4e76b8._0x2dab74)]['startDraw'](_0x296505);}[_0x3d5d32(0xd3b)](_0x1d790d={}){return this['stopDraw'](),_0x1d790d['type']='areaSurfaceMeasure',this['_graphicLayer']['startDraw'](_0x1d790d);}['volume'](_0x211745={}){const _0x93cff6={_0x2c5495:0x32f},_0x4ba3dc=_0x3d5d32;return this['stopDraw'](),_0x211745['type']=_0x211745['depth']?_0x4ba3dc(0x2be):'volumeMeasure',this[_0x4ba3dc(_0x93cff6._0x2c5495)]['startDraw'](_0x211745);}['height'](_0x2bf182={}){const _0x304f80={_0x61b792:0x7f5},_0x16de77=_0x3d5d32;return this['stopDraw'](),_0x2bf182[_0x16de77(_0x304f80._0x61b792)]=_0x16de77(0x2de),this[_0x16de77(0x32f)]['startDraw'](_0x2bf182);}['heightTriangle'](_0x3fabc8={}){const _0x2495da=_0x3d5d32;return this['stopDraw'](),_0x3fabc8[_0x2495da(0x7f5)]=_0x2495da(0x35f),this['_graphicLayer']['startDraw'](_0x3fabc8);}[_0x3d5d32(0x247)](_0x5c99f7={}){return this['stopDraw'](),_0x5c99f7['type']='angleMeasure',this['_graphicLayer']['startDraw'](_0x5c99f7);}['point'](_0x1ff573={}){const _0x1bb3d2={_0x25c7e7:0x90d},_0xf7f4d7=_0x3d5d32;return this['stopDraw'](),_0x1ff573['type']=_0xf7f4d7(_0x1bb3d2._0x25c7e7),this['_graphicLayer']['startDraw'](_0x1ff573);}['stopDraw'](){const _0x329fee={_0xf55899:0x32f},_0x394f5c=_0x3d5d32;return this[_0x394f5c(_0x329fee._0xf55899)]['stopDraw']();}['clearDrawing'](){return this['_graphicLayer']['clearDrawing']();}['endDraw'](){const _0xba4e91=_0x3d5d32;return this[_0xba4e91(0x32f)]['endDraw']();}['clear'](){const _0x294533={_0x56bf81:0x76d},_0x45537b=_0x3d5d32;return this[_0x45537b(0x32f)][_0x45537b(_0x294533._0x56bf81)]();}[_0x3d5d32(0x5c2)](_0x53cfd1){const _0x581b4e={_0x465524:0xef9},_0x1f0629=_0x3d5d32;this[_0x1f0629(0x32f)]['eachGraphic'](_0x121fc5=>{const _0x5d302c=_0x1f0629;_0x121fc5['options'][_0x5d302c(_0x581b4e._0x465524)]=_0x53cfd1,_0x121fc5['showText']&&_0x121fc5['showText'](_0x53cfd1);});}[_0x3d5d32(0x689)](_0x1f0f86){const _0x29ed02={_0x34b6f9:0x32f},_0x8001e2=_0x3d5d32;this[_0x8001e2(_0x29ed02._0x34b6f9)][_0x8001e2(0x689)](_0x1f0f86),super['destroy'](_0x1f0f86);}}class FloodByGraphic extends BaseThing{get[_0x3d5d32(0xbb8)](){return this['options']['positions'];}set['positions'](_0x81c340){const _0x39a61e={_0x45e1c9:0xb84,_0x5837ae:0xfc1,_0x160a19:0xaa8},_0x3433c3={_0x2f5d75:0xed4},_0x1aad4e=_0x3d5d32;this['options']['positions']=_0x81c340;if(_0x81c340){const _0x413377=[],_0x29415e=[];_0x81c340['forEach'](_0x86b185=>{const _0x5d7382=_0x4132,_0x5325da=LngLatPoint[_0x5d7382(0xce3)](_0x86b185);if(!_0x5325da||!_0x5325da['valid']())return;_0x5325da['_alt_bak']=_0x5325da['alt'],_0x29415e['push'](_0x5325da),_0x413377[_0x5d7382(0xb75)](_0x5325da[_0x5d7382(_0x3433c3._0x2f5d75)](!![]));}),this['_poinst']=_0x29415e,this['_hierarchyPositions']=_0x413377;if(this['_map']){const _0x548ad9=this['options']['has3dtiles']??Cesium__namespace['defined'](this['_map']['pick3DTileset'](_0x413377));!_0x548ad9&&(!Cesium__namespace[_0x1aad4e(_0x39a61e._0x45e1c9)](this['_last_depthTestAgainstTerrain'])&&(this['_last_depthTestAgainstTerrain']=this['_map']['scene']['globe']['depthTestAgainstTerrain']),this['_map'][_0x1aad4e(_0x39a61e._0x5837ae)][_0x1aad4e(_0x39a61e._0x160a19)]['depthTestAgainstTerrain']=!![]);}}else this[_0x1aad4e(0xf71)]=null;}get['height'](){return this['_extrudedHeight']??this['options']['minHeight'];}set['height'](_0x23dcad){const _0x3f7b9c={_0xbef3ff:0xbb8,_0x35852e:0x216,_0xb308a7:0x73d},_0x300493={_0x51981c:0xf12,_0x1e362b:0xed4},_0x5dc3b6=_0x3d5d32;this['_extrudedHeight']=_0x23dcad;if(this['options']['perPositionHeight']){!this['_poinst']&&this[_0x5dc3b6(0x433)][_0x5dc3b6(_0x3f7b9c._0xbef3ff)]&&(this['positions']=this['options']['positions']);if(this[_0x5dc3b6(0x216)]){const _0x19eaca=[];this[_0x5dc3b6(_0x3f7b9c._0x35852e)]['forEach'](_0x8a5223=>{const _0x9daa33=_0x5dc3b6,_0x44ef80=LngLatPoint['parse'](_0x8a5223);if(!_0x44ef80||!_0x44ef80[_0x9daa33(_0x300493._0x51981c)]())return;_0x44ef80['alt']=_0x44ef80['_alt_bak']+_0x23dcad,_0x19eaca['push'](_0x44ef80[_0x9daa33(_0x300493._0x1e362b)](!![]));}),this[_0x5dc3b6(0xf71)]=_0x19eaca;}}this[_0x5dc3b6(0xefc)](EventType[_0x5dc3b6(_0x3f7b9c._0xb308a7)],{'height':this['_extrudedHeight']});}get['speed'](){const _0x27417c={_0x3d6896:0x85c},_0x50f709=_0x3d5d32;return this['options'][_0x50f709(_0x27417c._0x3d6896)];}set['speed'](_0x1dcecf){const _0x1590cf=_0x3d5d32;this['options'][_0x1590cf(0x85c)]=_0x1dcecf;}['_mountedHook'](){const _0x34960d={_0x408064:0x596,_0x264abe:0xd89},_0x42c192={_0x50ecc3:0xbb8},_0x15c3c0=_0x3d5d32;this[_0x15c3c0(_0x34960d._0x408064)]=new GraphicLayer({'name':'淹没分析','private':!![]}),this[_0x15c3c0(0xd89)]=0x0;const _0x207d77=new Cesium__namespace['PolygonHierarchy'](),_0x111a4a={'color':'#007be6','opacity':0.5,'outline':![],...this['options']['style']||{},'perPositionHeight':!![]};!this['options']['perPositionHeight']&&(_0x111a4a[_0x15c3c0(0x83e)]=this[_0x15c3c0(_0x34960d._0x264abe)],_0x111a4a['extrudedHeight']=new Cesium__namespace[(_0x15c3c0(0xc6d))](_0x259b15=>{return this['_extrudedHeight'];},![]));const _0x2ab611=new PolygonEntity({'positions':new Cesium__namespace[(_0x15c3c0(0xc6d))](_0x1a7a0a=>{const _0x3706ea=_0x15c3c0;if(!this['_hierarchyPositions'])return null;return _0x207d77[_0x3706ea(_0x42c192._0x50ecc3)]=this['_hierarchyPositions'],_0x207d77;},![]),'style':_0x111a4a});this['graphic']=_0x2ab611,Cesium__namespace['defined'](this['options']['minHeight'])&&Cesium__namespace['defined'](this['options'][_0x15c3c0(0x7cb)])&&Cesium__namespace['defined'](this['options']['positions'])&&this['setOptions']();}['_addedHook'](){const _0x2d6a16={_0x8e9484:0x1d1,_0x31dbd4:0x682},_0x3d810d=_0x3d5d32;this[_0x3d810d(_0x2d6a16._0x8e9484)][_0x3d810d(0xc17)](this['graphicLayer']),this['graphicLayer'][_0x3d810d(_0x2d6a16._0x31dbd4)](this['graphic']);}[_0x3d5d32(0x566)](){const _0x4cfd32=_0x3d5d32;this[_0x4cfd32(0x1d1)][_0x4cfd32(0xa9e)](this['graphicLayer']),this['clear']();}['setOptions'](_0x343604){const _0x57cc9f={_0x1157d8:0x433,_0x58cd70:0x433},_0x1ba5b6=_0x3d5d32;_0x343604&&(this[_0x1ba5b6(_0x57cc9f._0x1157d8)]={...this[_0x1ba5b6(_0x57cc9f._0x58cd70)],..._0x343604});this['stop']();let _0x3d46b3=this['options']['minHeight'],_0x435eca=this[_0x1ba5b6(0x433)]['maxHeight'];if(!Cesium__namespace['defined'](_0x3d46b3)){logError$1('minHeight\x20请传入有效数值!',_0x3d46b3);return;}if(!Cesium__namespace['defined'](_0x435eca)){logError$1('maxHeight\x20请传入有效数值!',_0x435eca);return;}if(_0x3d46b3>_0x435eca){const _0x374202=_0x3d46b3;_0x3d46b3=_0x435eca,_0x435eca=_0x374202;}return this['_extrudedHeight']=_0x3d46b3,this['_maxHeight']=_0x435eca,this['positions']=this['options']['positions'],this;}[_0x3d5d32(0xf6d)](){const _0x4a1355={_0x3f12fc:0xd89,_0x357066:0x886,_0x39f074:0x83e,_0xfbe1f8:0x83e},_0x3bfd03=_0x3d5d32;if(!this['_hierarchyPositions']){logError$1('请传入淹没区域才能开始分析');return;}this[_0x3bfd03(0x886)](),this['isStart']=!![],this[_0x3bfd03(0xefc)](EventType['start']),this['_timeTik']=setInterval(()=>{const _0x3cec76=_0x3bfd03;if(this[_0x3cec76(_0x4a1355._0x3f12fc)]>=this[_0x3cec76(0x2cc)]){this[_0x3cec76(_0x4a1355._0x357066)]();return;}const _0x2920cc=this[_0x3cec76(0xd89)]+this[_0x3cec76(0x85c)];_0x2920cc>this['_maxHeight']?this[_0x3cec76(_0x4a1355._0x39f074)]=this['_maxHeight']:this[_0x3cec76(_0x4a1355._0xfbe1f8)]=_0x2920cc;},0x64);}[_0x3d5d32(0x886)](){const _0x175d08={_0x27f9b4:0xdca,_0xb61456:0x37d},_0x565f6b=_0x3d5d32;if(!this['isStart'])return;this[_0x565f6b(_0x175d08._0x27f9b4)]&&(clearInterval(this['_timeTik']),delete this['_timeTik']),this[_0x565f6b(_0x175d08._0xb61456)]=![],this[_0x565f6b(0xefc)](EventType['end']);}[_0x3d5d32(0x8b9)](){const _0x3fead7={_0x4733f7:0xf6d},_0x2673ed=_0x3d5d32;this['setOptions'](),this[_0x2673ed(_0x3fead7._0x4733f7)]();}['clear'](){const _0x849ea0={_0x1f2d32:0x1d1,_0x4f7a40:0x9a5},_0x2d62b1=_0x3d5d32;this['positions']=null,this['_last_depthTestAgainstTerrain']!=null&&(this[_0x2d62b1(_0x849ea0._0x1f2d32)][_0x2d62b1(0xfc1)][_0x2d62b1(0xaa8)]['depthTestAgainstTerrain']=this['_last_depthTestAgainstTerrain'],delete this[_0x2d62b1(_0x849ea0._0x4f7a40)]),this['stop']();}[_0x3d5d32(0x689)](_0x1607e1){const _0x179a2b={_0x381688:0x596},_0x2f2e93=_0x3d5d32;this[_0x2f2e93(_0x179a2b._0x381688)]&&this[_0x2f2e93(0x596)]['destroy'](_0x1607e1),super['destroy'](_0x1607e1);}}class Slope extends BaseThing{constructor(_0x5c5d61={}){const _0x56bb8d={_0x214bcf:0x433,_0x4b3ea0:0xdf3,_0x5833d0:0x433,_0xfcee5b:0xdf3,_0x593fd0:0x1076,_0x222ab3:0x433},_0x732077=_0x3d5d32;super(_0x5c5d61),this['options']['arrow']=this['options']['arrow']||{},this['options'][_0x732077(0xdf3)]['show']=this[_0x732077(_0x56bb8d._0x214bcf)][_0x732077(_0x56bb8d._0x4b3ea0)]['show']??!![],this['options']['arrow'][_0x732077(0xe8f)]=this['options']['arrow']['color']??Cesium__namespace['Color'][_0x732077(0x6e8)],this[_0x732077(_0x56bb8d._0x5833d0)][_0x732077(_0x56bb8d._0xfcee5b)][_0x732077(_0x56bb8d._0x593fd0)]=this['options']['arrow'][_0x732077(0x1076)]??0xf,this[_0x732077(_0x56bb8d._0x222ab3)]['arrow']['scale']=this['options'][_0x732077(0xdf3)]['scale']??0.3;}['_mountedHook'](){const _0x1e2346=_0x3d5d32;this['graphicLayer']=new GraphicLayer({'name':'坡度坡向','tooltip':function(_0x451017){var _0x1bd388;const _0x3c750d=(_0x1bd388=_0x451017['graphic'])===null||_0x1bd388===void 0x0?void 0x0:_0x1bd388['attr'];if(!_0x3c750d)return;return'坡度:\x20'+_0x3c750d['slopeStr1']+'\x20\x20('+_0x3c750d['slopeStr2']+')坡向:\x20'+_0x3c750d['direction']+'°';},...this[_0x1e2346(0x433)],'private':!![]});}['_addedHook'](){const _0x5d7ade=_0x3d5d32;this[_0x5d7ade(0x1d1)]['addLayer'](this['graphicLayer']),this['options']['positions']&&this[_0x5d7ade(0x433)][_0x5d7ade(0xbb8)][_0x5d7ade(0xc84)]>0x0&&this['add'](this['options']['positions'],this['options']);}['_removedHook'](){const _0x318d2d=_0x3d5d32;this['_map']['removeLayer'](this['graphicLayer']),this[_0x318d2d(0x76d)]();}[_0x3d5d32(0xff3)](_0x30de6a,_0x67ead={}){const _0x5bf3bd={_0x5a4b6b:0xc84,_0x5ab257:0xdf3,_0x2437c8:0xc84},_0xd65989={_0x17a1be:0x9f7,_0x33568c:0x5ac,_0x17e23d:0xf68,_0x1cc9a6:0x7cb,_0x5b7fce:0xa28,_0x234fce:0x395},_0x12de77=_0x3d5d32;if(!_0x30de6a||_0x30de6a[_0x12de77(_0x5bf3bd._0x5a4b6b)]<0x1)return;_0x30de6a=LngLatArray['toCartesians'](_0x30de6a),this['_eventResult']={'positions':_0x30de6a},this['_stateOkIndex']=0x0,this['_arrowInstances']=[],this['_arrData']=[];const _0x51216a=_0x67ead[_0x12de77(0x7a6)]??0x8;if(_0x30de6a[_0x12de77(0xc84)]>0x2&&_0x51216a>0x1)interPolygon({'scene':this['_map']['scene'],'positions':_0x30de6a,'has3dtiles':![],'onlyPoint':!![],'splitNum':_0x51216a})['then'](_0x24d89d=>{const _0x27c448=_0x12de77;this['options']['arrow']['length']?this['_arrowLength']=this[_0x27c448(0x433)]['arrow'][_0x27c448(0xc84)]:this[_0x27c448(0xbaa)]=Cesium__namespace['Math']['chordLength'](_0x24d89d[_0x27c448(_0xd65989._0x17a1be)],this['_map']['scene']['globe'][_0x27c448(_0xd65989._0x33568c)][_0x27c448(_0xd65989._0x17e23d)])*this['options']['arrow']['scale'];this['_eventResult'][_0x27c448(_0xd65989._0x1cc9a6)]=_0x24d89d['maxHeight'],this['_eventResult'][_0x27c448(0xa28)]=_0x24d89d[_0x27c448(_0xd65989._0x5b7fce)],_0x30de6a=[];for(let _0x5e93d6=0x0;_0x5e93d6<_0x24d89d['list']['length'];_0x5e93d6++){_0x30de6a['push'](_0x24d89d['list'][_0x5e93d6][_0x27c448(0xf75)]);}this[_0x27c448(_0xd65989._0x234fce)]=_0x30de6a['length'];for(let _0x2dc400=0x0;_0x2dc400{const _0x58d22b=_0x595abe;if(this['_stateAll']===0x0)return;_0x1ec3e4[_0x58d22b(_0x7e166a._0x594f04)]&&logWarn('未获取到高度值,贴地高度计算存在误差');const _0x2f71b5=_0x76e4c9[_0x58d22b(_0x7e166a._0xf3f218)](_0x1ec3e4[_0x58d22b(0xbb8)]),_0x9aa22a=_0x2f71b5['pop']();let _0x202c35=0x0,_0x219933=_0x2f71b5[0x0]['height'],_0x40ebb7=0x0,_0x1de0a1=_0x2f71b5[0x0][_0x58d22b(0x83e)];for(let _0x302c38=0x1;_0x302c38<_0x2f71b5['length']-0x1;_0x302c38++){const _0x3d6308=_0x2f71b5[_0x302c38];_0x3d6308[_0x58d22b(0x83e)]>_0x219933&&(_0x219933=_0x3d6308['height'],_0x202c35=_0x302c38),_0x3d6308['height']<_0x1de0a1&&(_0x1de0a1=_0x3d6308['height'],_0x40ebb7=_0x302c38);}const _0x113fcb=_0x2f71b5[_0x202c35],_0x259cc7=_0x2f71b5[_0x40ebb7],_0x1a95a0=this['getSlope'](_0x9aa22a,_0x113fcb),_0x4b24a8=this['getSlope'](_0x9aa22a,_0x259cc7);_0x1a95a0>_0x4b24a8?this['_fxOnePointOk'](_0x15c94e,_0x9aa22a,_0x113fcb,_0x1a95a0):this['_fxOnePointOk'](_0x15c94e,_0x9aa22a,_0x259cc7,_0x4b24a8);});}[_0x3d5d32(0x4cc)](_0x2d5bc6,_0x1c9b09,_0x2d9292,_0x5f3c3d){const _0x1360a5={_0x101728:0xbaa,_0x3c6034:0x83e,_0x171c8d:0xb75,_0x3ad492:0xefc,_0x4b9c2c:0xeba,_0x1ce1da:0xefc,_0x466dd6:0xb92},_0x30b8ef=_0x3d5d32,_0x5c0540=Cesium__namespace['Cartographic']['toCartesian'](_0x1c9b09);let _0x18d2ef=Cesium__namespace['Cartographic']['toCartesian'](_0x2d9292);_0x18d2ef=getOnLinePointByLen(_0x5c0540,_0x18d2ef,this[_0x30b8ef(_0x1360a5._0x101728)]);let _0x34fe92;_0x1c9b09['height']>_0x2d9292[_0x30b8ef(_0x1360a5._0x3c6034)]?_0x34fe92=[_0x5c0540,_0x18d2ef]:_0x34fe92=[_0x18d2ef,_0x5c0540];const _0x361848=getAngle(_0x34fe92[0x0],_0x34fe92[0x1],!![]);let _0x406648=Math['atan'](_0x5f3c3d)*0xb4/Math['PI'];_0x406648=Number(_0x406648['toFixed'](0x2));const _0x283278=_0x406648+'°',_0x3d4aa9=(_0x5f3c3d*0x64)['toFixed'](0x2)+'%',_0x61345b={'position':_0x2d5bc6,'slope':_0x406648,'slopeStr1':_0x283278,'slopeStr2':_0x3d4aa9,'direction':_0x361848};!this['_arrData']&&(this['_arrData']=[]);this['_arrData'][_0x30b8ef(_0x1360a5._0x171c8d)](_0x61345b),this[_0x30b8ef(_0x1360a5._0x3ad492)](EventType['endItem'],{'data':_0x61345b,'index':this['_stateOkIndex']});this[_0x30b8ef(0x433)]['arrow']['show']&&this['_arrowInstances'][_0x30b8ef(0xb75)]({'positions':_0x34fe92,'attr':_0x61345b});this['_stateOkIndex']++;if(this['_stateOkIndex']>=this['_stateAll']){if(this['options']['arrow']['show']&&this['_arrowInstances']['length']>0x0){const _0x585068=new PolylineCombine({'instances':this[_0x30b8ef(_0x1360a5._0x4b9c2c)],'style':{'materialType':PolylineArrow,...this['options']['arrow']}});this['graphicLayer']['addGraphic'](_0x585068);}this[_0x30b8ef(_0x1360a5._0x1ce1da)](EventType['end'],{...this['_eventResult']||{},'data':this[_0x30b8ef(_0x1360a5._0x466dd6)]});}}['getSlope'](_0x10db85,_0x584071){const _0x26ae5a={_0x545746:0x4ba,_0xf29c99:0x83e,_0x39e515:0xed4},_0x116d42=_0x3d5d32;if(!_0x10db85||!_0x584071)return;const _0x58962b=Math[_0x116d42(_0x26ae5a._0x545746)](_0x10db85[_0x116d42(0x83e)]-_0x584071[_0x116d42(_0x26ae5a._0xf29c99)]),_0x5cb897=Cesium__namespace['Cartesian3']['distance'](Cesium__namespace['Cartographic'][_0x116d42(_0x26ae5a._0x39e515)](_0x10db85),Cesium__namespace['Cartesian3']['fromRadians'](_0x584071['longitude'],_0x584071['latitude'],_0x10db85['height'])),_0x5d58d7=_0x58962b/_0x5cb897;return _0x5d58d7;}['clear'](){const _0x2adef7={_0x921da6:0x596,_0x5075ff:0x76d},_0x467182=_0x3d5d32;this[_0x467182(_0x2adef7._0x921da6)][_0x467182(_0x2adef7._0x5075ff)](),this['_arrowInstances']=[],this['_arrData']=[],this[_0x467182(0x395)]=0x0,this['_stateOkIndex']=0x0;}static[_0x3d5d32(0x454)](_0x24b540){const _0x26beb0={_0x27c92e:0xc81};return new Promise((_0x13117f,_0xda20e6)=>{const _0x50fd5c={_0x2343fc:0x463},_0x2c51f5=_0x4132,_0x42ca49=new Slope({'positions':_0x24b540['positions'],'splitNum':0x1,'radius':_0x24b540['radius'],'count':_0x24b540['count'],'has3dtiles':_0x24b540['has3dtiles'],'point':{'show':![]},'arrow':{'show':![]}});_0x42ca49['addTo'](_0x24b540[_0x2c51f5(0x7e1)]),_0x24b540['endItem']&&_0x42ca49['on'](EventType['endItem'],_0x24b540[_0x2c51f5(_0x26beb0._0x27c92e)]),_0x42ca49['on'](EventType['end'],_0x395b7f=>{const _0x19422f=_0x2c51f5;_0x42ca49['destroy'](),_0x24b540[_0x19422f(_0x50fd5c._0x2343fc)]&&_0x24b540['callback'](_0x395b7f),_0x13117f(_0x395b7f);});});}}class TerrainPlanClip extends BaseThing{get[_0x3d5d32(0xbb8)](){return this['_positions'];}set['positions'](_0x5b6456){const _0x1c8b71=_0x3d5d32;this['clear'](),this['_positions']=_0x5b6456,this[_0x1c8b71(0x844)](_0x5b6456);}get['diffHeight'](){return this['options']['diffHeight'];}set[_0x3d5d32(0x9e2)](_0x116089){const _0x4974ff={_0x53311a:0xb72},_0x29d58c=_0x3d5d32;this['options']['diffHeight']=_0x116089,this['_graphicLayer']&&this[_0x29d58c(0x32f)][_0x29d58c(_0x4974ff._0x53311a)](_0x260bad=>{_0x260bad['diffHeight']=_0x116089;});}get['clipOutSide'](){const _0x49d24d=_0x3d5d32;return this[_0x49d24d(0x433)][_0x49d24d(0x2c4)];}set['clipOutSide'](_0x3cc885){const _0x5408a1={_0x3ef58f:0x844},_0x4a37ed=_0x3d5d32;this['options']['clipOutSide']=_0x3cc885,this['_map']&&this['_positions']&&this[_0x4a37ed(_0x5408a1._0x3ef58f)](this[_0x4a37ed(0x924)]);}[_0x3d5d32(0xacd)](_0x16d2ae){const _0x42dfd0={_0x40f857:0xfc1,_0x374769:0xaa8,_0x2e6f02:0xdea},_0x581ac3=_0x3d5d32;this[_0x581ac3(0x1d1)][_0x581ac3(_0x42dfd0._0x40f857)]['globe']['clippingPlanes']&&(this['_map'][_0x581ac3(0xfc1)][_0x581ac3(_0x42dfd0._0x374769)][_0x581ac3(_0x42dfd0._0x2e6f02)]['enabled']=_0x16d2ae),this['_graphicLayer']&&(this['_graphicLayer']['show']=_0x16d2ae);}[_0x3d5d32(0xe4c)](){}['_addedHook'](){const _0x3a789d={_0x970cd3:0x32f,_0xce9493:0x433},_0x476b70=_0x3d5d32;this[_0x476b70(0x32f)]=new GraphicLayer({...this[_0x476b70(0x433)],'private':!![]}),this[_0x476b70(0x1d1)]['addLayer'](this[_0x476b70(_0x3a789d._0x970cd3)]),this[_0x476b70(_0x3a789d._0xce9493)][_0x476b70(0xbb8)]&&this[_0x476b70(0x433)]['positions']['length']>0x0&&this['setPositions'](this['options']['positions']);}['_removedHook'](){this['clear'](),this['_graphicLayer']&&(this['_map']['removeLayer'](this['_graphicLayer']),delete this['_graphicLayer']);}['setPositions'](_0x4d29c4){const _0x322f53={_0x301ee0:0xf92,_0x4dcda1:0xe95,_0x35c072:0xe04,_0x190d03:0x24c,_0x48c1b2:0xb75,_0x454e8c:0xfc1,_0x3ceeae:0x8e1},_0x3e4021=_0x3d5d32;this['clear']();if(!_0x4d29c4||_0x4d29c4[_0x3e4021(0xc84)]<0x3){logError$1(_0x3e4021(_0x322f53._0x301ee0),_0x4d29c4);return;}_0x4d29c4=LngLatArray['toCartesians'](_0x4d29c4),this[_0x3e4021(0x924)]=_0x4d29c4;const _0x3069bd=[],_0x32531b=_0x4d29c4['length'];let _0x2936bd;const _0x3e5ee3=formatNum$1(getAngle(_0x4d29c4[0x0],_0x4d29c4[0x1]),0x2);if(_0x3e5ee3>-0.02&&_0x3e5ee3<0.02)_0x2936bd=![];else{const _0x507e40=formatNum$1(getAngle(_0x4d29c4[0x0],_0x4d29c4[0x2]),0x2);_0x2936bd=_0x3e5ee3<_0x507e40;}this['clipOutSide']&&(_0x2936bd=!_0x2936bd);for(let _0x4de71c=0x0;_0x4de71c<_0x32531b;++_0x4de71c){const _0x5d2bbb=(_0x4de71c+0x1)%_0x32531b,_0x4eb8c9=Cesium__namespace[_0x3e4021(_0x322f53._0x4dcda1)][_0x3e4021(_0x322f53._0x35c072)](_0x4d29c4[_0x4de71c],_0x4d29c4[_0x5d2bbb],new Cesium__namespace['Cartesian3']()),_0x22c549=Cesium__namespace['Cartesian3'][_0x3e4021(0xf69)](_0x4eb8c9,new Cesium__namespace['Cartesian3']());let _0x124ce5;_0x2936bd?_0x124ce5=Cesium__namespace['Cartesian3']['subtract'](_0x4d29c4[_0x4de71c],_0x4eb8c9,new Cesium__namespace[(_0x3e4021(_0x322f53._0x4dcda1))]()):_0x124ce5=Cesium__namespace['Cartesian3']['subtract'](_0x4d29c4[_0x5d2bbb],_0x4eb8c9,new Cesium__namespace['Cartesian3']());_0x124ce5=Cesium__namespace['Cartesian3'][_0x3e4021(0xf69)](_0x124ce5,_0x124ce5);let _0x4d4e63=Cesium__namespace['Cartesian3'][_0x3e4021(_0x322f53._0x190d03)](_0x124ce5,_0x22c549,new Cesium__namespace['Cartesian3']());_0x4d4e63=Cesium__namespace[_0x3e4021(_0x322f53._0x4dcda1)]['normalize'](_0x4d4e63,_0x4d4e63);const _0xa08f95=new Cesium__namespace['Plane'](_0x4d4e63,0x0),_0x3fb12d=Cesium__namespace['Plane']['getPointDistance'](_0xa08f95,_0x4eb8c9);_0x3069bd[_0x3e4021(_0x322f53._0x48c1b2)](new Cesium__namespace['ClippingPlane'](_0x4d4e63,_0x3fb12d));}this['_map'][_0x3e4021(_0x322f53._0x454e8c)]['globe']['clippingPlanes']=new Cesium__namespace['ClippingPlaneCollection']({'planes':_0x3069bd,'edgeWidth':this['options']['edgeWidth']??0x1,'edgeColor':this['options']['edgeColor']??Cesium__namespace[_0x3e4021(0x882)]['WHITE'],'unionClippingRegions':this['clipOutSide'],'enabled':!![]});if(this['options'][_0x3e4021(_0x322f53._0x3ceeae)]){const _0xe88568=new Pit({'style':this['options'],'positions':_0x4d29c4});this['_graphicLayer']['addGraphic'](_0xe88568);}}['clear'](){const _0x260212={_0x573373:0xa63},_0x2c699b=_0x3d5d32;var _0x1d4939,_0x2aa44f;if(!this['_map'])return;this['_positions']=null,this['_graphicLayer']&&this[_0x2c699b(0x32f)]['clear'](),(_0x1d4939=this['_map'][_0x2c699b(0xfc1)][_0x2c699b(0xaa8)])!==null&&_0x1d4939!==void 0x0&&(_0x2aa44f=_0x1d4939['clippingPlanes'])!==null&&_0x2aa44f!==void 0x0&&_0x2aa44f[_0x2c699b(_0x260212._0x573373)]&&(this['_map']['scene']['globe'][_0x2c699b(0xdea)]['enabled']=![]),this['_map']['scene']['globe']['clippingPlanes']=undefined;}}var TerrainEditVS=_0x3d5d32(0xc03),TerrainEditFS='\x0a#ifdef\x20GL_FRAGMENT_PRECISION_HIGH\x0aprecision\x20highp\x20float;\x0a#else\x0aprecision\x20mediump\x20float;\x0a#endif\x0a\x0avoid\x20main()\x20{\x0a\x20\x20out_FragColor\x20=\x20vec4(1.0,\x200.0,\x200.0,\x201.0);\x0a}\x0a';class TerrainOldEditBase extends BaseThing{constructor(_0x3c0a83={}){const _0x41a73a=_0x3d5d32;super(_0x3c0a83),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this['heightVal']=_0x3c0a83['heightVal']??new Cesium__namespace['Cartesian4'](0x0,0x0,0x0,0x1f4),this['_maxCanvasSize']=_0x3c0a83['maxCanvasSize']??0x1000,this[_0x41a73a(0x1028)]=[];}get['analysisOptions'](){const _0x48fba5=_0x3d5d32;var _0x42b795,_0x25f071,_0x41cd7c,_0x5ca154,_0x115920,_0x7605c6;return(_0x42b795=this['_map'])===null||_0x42b795===void 0x0?void 0x0:(_0x25f071=_0x42b795[_0x48fba5(0xfc1)])===null||_0x25f071===void 0x0?void 0x0:(_0x41cd7c=_0x25f071['globe'])===null||_0x41cd7c===void 0x0?void 0x0:(_0x5ca154=_0x41cd7c['_surface'])===null||_0x5ca154===void 0x0?void 0x0:(_0x115920=_0x5ca154['tileProvider'])===null||_0x115920===void 0x0?void 0x0:(_0x7605c6=_0x115920[_0x48fba5(0x524)])===null||_0x7605c6===void 0x0?void 0x0:_0x7605c6['flood'];}get['list'](){const _0xd8c2a9=_0x3d5d32;return this[_0xd8c2a9(0x1028)];}get['showElseArea'](){const _0x2851f1={_0x7e0f57:0xa9b},_0x559041=_0x3d5d32;var _0x626c2e;return((_0x626c2e=this['analysisOptions'])===null||_0x626c2e===void 0x0?void 0x0:_0x626c2e[_0x559041(_0x2851f1._0x7e0f57)])??!![];}set[_0x3d5d32(0xa9b)](_0x1feb58){this['analysisOptions']['showElseArea']=_0x1feb58;}get['positions'](){return this['length']>0x0?this['_areaList'][0x0]['positions']:null;}set['positions'](_0x5c98c4){const _0x51b010=_0x3d5d32;this[_0x51b010(0x76d)](),this['addArea'](_0x5c98c4);}get['length'](){const _0x17d713=_0x3d5d32;if(this[_0x17d713(0x1028)]){var _0x39603c;return(_0x39603c=this['_areaList'])===null||_0x39603c===void 0x0?void 0x0:_0x39603c['length'];}else return 0x0;}['_enabledHook'](_0x1d69e7){this['analysisOptions']['enabled']=_0x1d69e7;}['_addedHook'](){const _0x15d6e9={_0x19b889:0xa5b,_0x3da8fd:0xa7b},_0x17b95f=_0x3d5d32;this[_0x17b95f(_0x15d6e9._0x19b889)]['showElseArea']=this['options']['showElseArea']??!![],this['options']['positions']&&this['addArea'](this['options']['positions']),this[_0x17b95f(0x433)]['dynamicView']&&(this[_0x17b95f(_0x15d6e9._0x3da8fd)]=[],this['_map']['on'](EventType['preUpdate'],this['_map_preUpdateHandler'],this));}[_0x3d5d32(0x566)](){const _0x2bde44={_0x241651:0x433,_0x58f9d4:0x876,_0x2a8dd1:0x8c1,_0x50a6b7:0x3bc,_0x292e22:0x76d,_0x465b45:0xa5b,_0x5df938:0x8cc},_0x4491d3=_0x3d5d32;this[_0x4491d3(_0x2bde44._0x241651)][_0x4491d3(_0x2bde44._0x58f9d4)]&&(this['_map']['off'](EventType[_0x4491d3(_0x2bde44._0x2a8dd1)],this[_0x4491d3(_0x2bde44._0x50a6b7)],this),this['_scopeIds_last']=[]),this[_0x4491d3(_0x2bde44._0x292e22)](),this[_0x4491d3(0xa5b)]['enabled']=![],this['analysisOptions']['inverMatrix']=Cesium__namespace[_0x4491d3(0xf5d)]['IDENTITY'],this[_0x4491d3(_0x2bde44._0x465b45)][_0x4491d3(_0x2bde44._0x5df938)]=undefined;}[_0x3d5d32(0x76d)](){const _0x2ce2bd={_0x36873d:0x552},_0x2ba97d=_0x3d5d32;this['_areaList']=[],this[_0x2ba97d(_0x2ce2bd._0x36873d)]();}['_clearDraw'](){const _0x505a4f={_0x170320:0x49b},_0x3068ca=_0x3d5d32;this['analysisOptions']['inverMatrix']=Cesium__namespace['Matrix4'][_0x3068ca(_0x505a4f._0x170320)],this['analysisOptions']['polygonTexture']=undefined,this['_polygonTexture']&&(this['_polygonTexture'][_0x3068ca(0x689)](),delete this['_polygonTexture']),this['_framebuffer']&&(this['_framebuffer']['destroy'](),delete this[_0x3068ca(0x103a)]);}['getAreaById'](_0x5be477){if(!isNumber(_0x5be477))return _0x5be477;for(let _0xcdffad=0x0;_0xcdffad{const _0x24c729=_0x4132;if(!_0x2b6eb5['show']||!_0x2b6eb5[_0x24c729(0x2b0)]||!_0x2b6eb5['positions'])return;const _0x2500cb=Cesium__namespace['BoundingSphere'][_0x24c729(0xa46)](_0x2b6eb5['positions']);Cesium__namespace['Cartesian3']['add'](_0x1c5f11,_0x2500cb['center'],_0x1c5f11),_0x1f5503['push'](_0x2b6eb5);});const _0x3490b0=this[_0x573868(0x1d1)]['scene']['context'];if(_0x1f5503['length']===0x0)return;const _0x4914b2=Cesium__namespace[_0x573868(0xe95)]['multiplyByScalar'](_0x1c5f11,0x1/_0x1f5503[_0x573868(_0x5efde1._0x2165ac)],new Cesium__namespace['Cartesian3']()),_0x4b42ec=Cesium__namespace['Transforms'][_0x573868(0x724)](_0x4914b2);this['_inverMatrix']=Cesium__namespace['Matrix4']['inverse'](_0x4b42ec,new Cesium__namespace['Matrix4']());let _0x2c7ef0=0x5f5e0ff,_0x461604=0x5f5e0ff,_0x11ba67=-0x5f5e0ff,_0x5efe23=-0x5f5e0ff;_0x1f5503['forEach'](_0x3a1a1e=>{const _0x195e22=_0x573868;let _0x11a91c=new Cesium__namespace['PolygonGeometry']({'polygonHierarchy':new Cesium__namespace[(_0x195e22(_0xb04676._0x320e34))](_0x3a1a1e['positions'])});_0x11a91c=Cesium__namespace['PolygonGeometry']['createGeometry'](_0x11a91c);const _0x53a1be=_0x11a91c[_0x195e22(_0xb04676._0x56f056)],_0x1f5121=_0x11a91c['attributes'][_0x195e22(_0xb04676._0x4c02fc)]['values'],_0x55b027=_0x1f5121['length'],_0x3a4553=[],_0x55938b=[];for(let _0x3bf50e=0x0;_0x3bf50e<_0x55b027;_0x3bf50e+=0x3){const _0x531683=new Cesium__namespace['Cartesian3'](_0x1f5121[_0x3bf50e],_0x1f5121[_0x3bf50e+0x1],_0x1f5121[_0x3bf50e+0x2]),_0x54a273=Cesium__namespace['Matrix4']['multiplyByPoint'](this[_0x195e22(_0xb04676._0x5a572a)],_0x531683,new Cesium__namespace['Cartesian3']());_0x54a273['z']=0x0,_0x3a4553['push'](_0x54a273),_0x55938b['push'](_0x54a273['x']),_0x55938b[_0x195e22(_0xb04676._0x4736ae)](_0x54a273['y']),_0x55938b[_0x195e22(_0xb04676._0x5845e5)](_0x54a273['z']),_0x2c7ef0>=_0x54a273['x']&&(_0x2c7ef0=_0x54a273['x']),_0x461604>=_0x54a273['y']&&(_0x461604=_0x54a273['y']),_0x11ba67<=_0x54a273['x']&&(_0x11ba67=_0x54a273['x']),_0x5efe23<=_0x54a273['y']&&(_0x5efe23=_0x54a273['y']);}_0x3a1a1e['localPos']=_0x3a4553;const _0xb9b1e1=new Float64Array(_0x55938b),_0x3d5f70=Cesium__namespace['BoundingSphere']['fromVertices'](_0xb9b1e1),_0xf283f8=new Cesium__namespace['Geometry']({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0xb9b1e1})},'indices':_0x53a1be,'primitiveType':Cesium__namespace['PrimitiveType']['TRIANGLES'],'boundingSphere':_0x3d5f70}),_0x4bc696=Cesium__namespace['ShaderProgram']['fromCache']({'context':_0x3490b0,'vertexShaderSource':TerrainEditVS,'fragmentShaderSource':TerrainEditFS,'attributeLocations':{'position':0x0}}),_0x1de25b=Cesium__namespace['VertexArray']['fromGeometry']({'context':_0x3490b0,'geometry':_0xf283f8,'attributeLocations':_0x4bc696[_0x195e22(0x80a)],'bufferUsage':Cesium__namespace[_0x195e22(0xbdd)]['STATIC_DRAW'],'interleave':!![]}),_0x15717a=new Cesium__namespace['RenderState']();_0x15717a['depthRange'][_0x195e22(_0xb04676._0x95f7b)]=-0xf4240,_0x15717a['depthRange']['far']=0xf4240,_0x3a1a1e['drawAreaCommand']=new Cesium__namespace['DrawCommand']({'boundingVolume':_0x3d5f70,'primitiveType':Cesium__namespace['PrimitiveType'][_0x195e22(0x5b0)],'vertexArray':_0x1de25b,'shaderProgram':_0x4bc696,'renderState':_0x15717a,'pass':Cesium__namespace[_0x195e22(0x65b)][_0x195e22(_0xb04676._0x57fd03)]});});const _0x3cf79e=(_0x5efe23-_0x461604)/(_0x11ba67-_0x2c7ef0),_0x1a16e9=[_0x2c7ef0,_0x461604,_0x11ba67,_0x5efe23],_0x1daad1=0x1d4c0,_0x1313f1={'viewMatrix':Cesium__namespace[_0x573868(0xf5d)]['IDENTITY'],'inverseViewMatrix':Cesium__namespace['Matrix4']['IDENTITY'],'frustum':new Cesium__namespace[(_0x573868(0xa37))](),'positionCartographic':{'height':0x0,'latitude':0x0,'longitude':0x0},'positionWC':new Cesium__namespace['Cartesian3'](0x0,0x0,_0x1daad1/0x2),'directionWC':new Cesium__namespace['Cartesian3'](0x0,0x0,-0x1),'upWC':new Cesium__namespace[(_0x573868(0xe95))](0x0,0x1,0x0),'rightWC':new Cesium__namespace['Cartesian3'](0x1,0x0,0x0),'viewProjectionMatrix':Cesium__namespace[_0x573868(0xf5d)]['IDENTITY']};_0x1313f1['frustum'][_0x573868(0xfb5)]=_0x1a16e9[0x0],_0x1313f1['frustum']['top']=_0x1a16e9[0x3],_0x1313f1[_0x573868(_0x5efde1._0x5c473a)][_0x573868(_0x5efde1._0x1d574c)]=_0x1a16e9[0x2],_0x1313f1['frustum'][_0x573868(0x960)]=_0x1a16e9[0x1],_0x1313f1['frustum']['near']=0.1,_0x1313f1['frustum']['far']=-_0x1daad1,this[_0x573868(0xc8f)]=new Cesium__namespace[(_0x573868(_0x5efde1._0x2227f4))](_0x1a16e9[0x0],_0x1a16e9[0x1],_0x1a16e9[0x2]-_0x1a16e9[0x0],_0x1a16e9[0x3]-_0x1a16e9[0x1]);let _0x13b455,_0x2d5d79;_0x3cf79e>0x1?(_0x13b455=this['_maxCanvasSize']/_0x3cf79e,_0x2d5d79=this[_0x573868(0xe66)]):(_0x13b455=this[_0x573868(_0x5efde1._0x202c51)],_0x2d5d79=_0x13b455*_0x3cf79e);const _0x287beb=new Cesium__namespace['Texture']({'context':_0x3490b0,'width':_0x13b455,'height':_0x2d5d79,'pixelFormat':Cesium__namespace[_0x573868(0x2bb)]['RGBA'],'pixelDatatype':Cesium__namespace['PixelDatatype']['HALF_FLOAT'],'flipY':![]});this['_polygonTexture']=_0x287beb,this['analysisOptions']['polygonTexture']=this['_polygonTexture'],this['_framebuffer']=new Cesium__namespace['Framebuffer']({'context':_0x3490b0,'colorTextures':[_0x287beb],'destroyAttachments':![]});const _0x37a775=new Cesium__namespace[(_0x573868(0xbcf))]({'color':new Cesium__namespace[(_0x573868(0x882))](0x0,0x0,0x0,0x0),'framebuffer':this[_0x573868(0x103a)]}),_0x4bb2d9=new Cesium__namespace['PassState'](_0x3490b0);_0x4bb2d9[_0x573868(_0x5efde1._0x5cff45)]=new Cesium__namespace['BoundingRectangle'](0x0,0x0,_0x13b455,_0x2d5d79);const _0x366645=_0x3490b0['uniformState'];_0x366645['updateCamera'](_0x1313f1),_0x37a775['execute'](_0x3490b0),_0x1f5503['forEach'](_0xdf6bd3=>{const _0x24f485=_0x573868,_0x1ffbd0=_0xdf6bd3['drawAreaCommand'];_0x1ffbd0&&(_0x366645[_0x24f485(_0x4e6f46._0x27b99d)](_0x1ffbd0['pass']),_0x1ffbd0[_0x24f485(0xbe4)]=this[_0x24f485(0x103a)],_0x1ffbd0['execute'](_0x3490b0,_0x4bb2d9));}),this['_beginAnalysis']();}['_beginAnalysis'](){const _0x73b192={_0x51c881:0x8cc,_0x3393b2:0xa5b},_0x4e9860=_0x3d5d32;this['analysisOptions'][_0x4e9860(0xafe)]=this['_inverMatrix'],this['analysisOptions'][_0x4e9860(_0x73b192._0x51c881)]=this['_polygonTexture'],this['analysisOptions']['enabled']=!![],this['analysisOptions']['floodRect']=this['_tailorRect'],this[_0x4e9860(_0x73b192._0x3393b2)]['globe']=![];}['_map_preUpdateHandler'](){const _0x27f1b7={_0x329b6d:0x1061},_0x219e3a={_0x36ec42:0x2b0},_0x1bfb38=_0x3d5d32;if(!this['_map']||!this['_areaList']||this['_areaList']['length']===0x0&&this['_scopeIds_last']['length']===0x0)return;if(this[_0x1bfb38(0x2c4)])return;const _0x5a7a70=[];this[_0x1bfb38(0x1028)][_0x1bfb38(_0x27f1b7._0x329b6d)](_0x16640e=>{const _0x126016=_0x1bfb38;if(!_0x16640e['show'])return;_0x16640e[_0x126016(_0x219e3a._0x36ec42)]=this['_isInSceneCamera'](_0x16640e['positions']),_0x16640e['scope']&&_0x5a7a70['push'](_0x16640e['id']);});let _0x169472=_0x5a7a70['length']!==this['_scopeIds_last'][_0x1bfb38(0xc84)];if(!_0x169472)for(let _0x4bf97d=0x0;_0x4bf97d<_0x5a7a70['length'];_0x4bf97d++){if(this[_0x1bfb38(0xa7b)][_0x4bf97d]!==_0x5a7a70[_0x4bf97d]){_0x169472=!![];break;}}_0x169472&&(this['_update'](),this[_0x1bfb38(0xa7b)]=Cesium__namespace['clone'](_0x5a7a70));}['_isInSceneCamera'](_0x3bf522){const _0x252c7f=_0x3d5d32;if(!_0x3bf522||_0x3bf522['length']===0x0)return![];const _0x8f1794=this['_map']['scene'],_0x297026=this[_0x252c7f(0x1d1)]['getCenter'](),_0x102d14=_0x8f1794['camera'][_0x252c7f(0xf74)];for(let _0x48557b=0x0;_0x48557b<_0x3bf522['length'];_0x48557b++){const _0x42958c=_0x3bf522[_0x48557b],_0x2a06ad=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](_0x8f1794,_0x42958c,new Cesium__namespace['Cartesian2']());if(_0x2a06ad&&_0x2a06ad['x']>=0x0&&_0x2a06ad['x']<=_0x8f1794['context'][_0x252c7f(0xacb)]&&_0x2a06ad['y']>=0x0&&_0x2a06ad['y']<=_0x8f1794['context'][_0x252c7f(0x466)])return!![];if(_0x102d14&&_0x102d14['x']>=0x0&&Cesium__namespace['Cartesian3']['distance'](_0x42958c,_0x102d14)<0x30d40)return!![];if(_0x297026&&_0x297026['x']>=0x0&&Cesium__namespace['Cartesian3']['distance'](_0x42958c,_0x297026)<0x30d40)return!![];}return![];}}var GlobeFlodByMaterial=_0x3d5d32(0x2aa);const FloodByMaterialType='FlodByMaterial';class FloodByMaterial extends TerrainOldEditBase{constructor(_0x50c913={}){const _0x352546={_0x3e8a18:0x433},_0x5e1e5b=_0x3d5d32;super(_0x50c913),this['color']=this[_0x5e1e5b(_0x352546._0x3e8a18)]['color']??new Cesium__namespace['Color'](0.15,0.7,0.95,0.5);}get['height'](){const _0x28b073={_0x45875e:0x1cb},_0x150118=_0x3d5d32;return this['heightVal']['y']??this[_0x150118(_0x28b073._0x45875e)];}set['height'](_0x4a6a6a){this['heightVal']['y']=_0x4a6a6a,this['analysisOptions']['heightVal']['y']=_0x4a6a6a;}get['speed'](){const _0x388c14=_0x3d5d32;return this[_0x388c14(0x433)]['speed']||0x1;}set['speed'](_0x428704){this['options']['speed']=Number(_0x428704);}get['color'](){return this['_color'];}set['color'](_0x3b8f0f){const _0x8be91a={_0x740c59:0xa5b},_0x2987e1=_0x3d5d32;this['_color']=getCesiumColor(_0x3b8f0f),this[_0x2987e1(_0x8be91a._0x740c59)]&&(this['analysisOptions']['color']=this['_color']);}[_0x3d5d32(0xf32)](_0xa59c8c,_0xd7b9e9){return _0xa59c8c=setPositionsHeight(_0xa59c8c,0x0),super['addArea'](_0xa59c8c,_0xd7b9e9);}['setOptions'](_0x9a4ea){const _0x5bf6e7={_0x32a450:0x433,_0x4a74f4:0x2cc,_0x5e6ad7:0xd36,_0x2ec180:0xa5b,_0x1c052f:0xa9b,_0x16fea9:0x1d1},_0x4df13c=_0x3d5d32;_0x9a4ea&&(this[_0x4df13c(0x433)]={...this[_0x4df13c(_0x5bf6e7._0x32a450)],..._0x9a4ea});this['stop']();let _0x225bd4=this['options']['minHeight'],_0x24cb84=this['options']['maxHeight'];if(!Cesium__namespace['defined'](_0x225bd4)){logError$1('minHeight\x20请传入有效数值!',_0x225bd4);return;}if(!Cesium__namespace['defined'](_0x24cb84)){logError$1(_0x4df13c(0x669),_0x24cb84);return;}if(_0x225bd4>_0x24cb84){const _0x5bf6f0=_0x225bd4;_0x225bd4=_0x24cb84,_0x24cb84=_0x5bf6f0;}return this['_minHeight']=_0x225bd4,this[_0x4df13c(_0x5bf6e7._0x4a74f4)]=_0x24cb84,this['heightVal']=new Cesium__namespace[(_0x4df13c(_0x5bf6e7._0x5e6ad7))](this['_minHeight'],this['_minHeight'],this['_maxHeight'],this['_maxHeight']-this['_minHeight']),this['analysisOptions']['heightVal']['x']=this[_0x4df13c(0x1d0)]['x'],this['analysisOptions']['heightVal']['y']=this['heightVal']['y'],this[_0x4df13c(_0x5bf6e7._0x2ec180)]['color']=this['color'],this['analysisOptions']['globe']=![],this['analysisOptions']['showElseArea']=this['options'][_0x4df13c(_0x5bf6e7._0x1c052f)]??!![],this[_0x4df13c(_0x5bf6e7._0x16fea9)]['scene']['globe']['material']=Cesium__namespace['Material']['fromType'](FloodByMaterialType),this;}['_enabledHook'](_0x599bb4){const _0x51381b={_0x13b87c:0xfc1,_0x260f4:0x1d1},_0x45167a=_0x3d5d32;var _0x1d6068;super['_enabledHook'](_0x599bb4);if(_0x599bb4)this['_map'][_0x45167a(_0x51381b._0x13b87c)]['globe']['material']=Cesium__namespace['Material'][_0x45167a(0x712)](FloodByMaterialType);else((_0x1d6068=this[_0x45167a(_0x51381b._0x260f4)]['scene']['globe'][_0x45167a(0xd8f)])===null||_0x1d6068===void 0x0?void 0x0:_0x1d6068['type'])===FloodByMaterialType&&(this['_map']['scene']['globe'][_0x45167a(0xd8f)]=null);}['start'](){const _0x5a9937={_0x3bc70c:0xb3d},_0x594e44=_0x3d5d32;this['stop'](),this[_0x594e44(0x37d)]=!![],this['fire'](EventType['start']),this['_map']['on'](EventType['clockTick'],this[_0x594e44(_0x5a9937._0x3bc70c)],this);}[_0x3d5d32(0xb3d)](_0x279b0e){const _0x142772={_0x25cbe6:0x1d0,_0x283f85:0xefc},_0x70a70e=_0x3d5d32;this['heightVal']['y']+=this['speed']/0x32;if(this['heightVal']['y']>this['heightVal']['z']){this['heightVal']['y']=this['heightVal']['z'],this['stop']();return;}if(this['heightVal']['y']{_0x397aae['diffHeight']=_0x7220d9;});}[_0x3d5d32(0xacd)](_0x1d0c55){const _0xef96bc=_0x3d5d32;this['analysisOptions']['enabled']=_0x1d0c55,this[_0xef96bc(0x32f)]&&(this['_graphicLayer']['show']=_0x1d0c55);}['_addedHook'](){const _0x283910={_0xa21cf3:0x5d9,_0x130c8d:0xaa8,_0x1aae88:0xa63},_0x7827fd=_0x3d5d32;!this['_map'][_0x7827fd(0xfc1)]['globe'][_0x7827fd(_0x283910._0xa21cf3)]&&(this['_map']['scene'][_0x7827fd(_0x283910._0x130c8d)]['depthTestAgainstTerrain']=!![],this['_hasChangeDepthTestAgainstTerrain']=!![]),this['analysisOptions'][_0x7827fd(_0x283910._0x1aae88)]=!![],this['_graphicLayer']=new GraphicLayer({...this[_0x7827fd(0x433)],'private':!![]}),this['_map']['addLayer'](this['_graphicLayer']),super['_addedHook']();}[_0x3d5d32(0x566)](){const _0x55fe59={_0x5e0b6a:0x49b},_0x1a2615=_0x3d5d32;this[_0x1a2615(0x76d)](),this['analysisOptions'][_0x1a2615(0xa63)]=![],this['analysisOptions']['inverMatrix']=Cesium__namespace['Matrix4'][_0x1a2615(_0x55fe59._0x5e0b6a)],this['analysisOptions']['polygonTexture']=undefined,this['_map']['removeLayer'](this['_graphicLayer'],!![]),delete this[_0x1a2615(0x32f)],this[_0x1a2615(0x253)]&&(this[_0x1a2615(0x1d1)]['scene']['globe']['depthTestAgainstTerrain']=![],this['_hasChangeDepthTestAgainstTerrain']=![]);}['clear'](){const _0x1fe865=_0x3d5d32;this['_map']['scene']['globe']['_surface']['tileProvider'][_0x1fe865(0x524)][_0x1fe865(0x387)](),super['clear'](),this['_graphicLayer']['clear']();}['_addAreaHook'](_0x30143f,_0x4cea70){const _0x372f1a=_0x3d5d32;this[_0x372f1a(0x433)]['image']&&(_0x30143f['pitPrimitive']=new Pit({'style':{...this['options'],..._0x4cea70},'positions':_0x30143f['positions_original']}),this['_graphicLayer']['addGraphic'](_0x30143f[_0x372f1a(0x31b)]));}['_removeAreaHook'](_0x119536){const _0x328324={_0x2bd74e:0x31b},_0xf3788b=_0x3d5d32;_0x119536!==null&&_0x119536!==void 0x0&&_0x119536[_0xf3788b(_0x328324._0x2bd74e)]&&(this['_graphicLayer']['removeGraphic'](_0x119536[_0xf3788b(_0x328324._0x2bd74e)],!![]),delete _0x119536['pitPrimitive']);}[_0x3d5d32(0xe0c)](){const _0x365f01=_0x3d5d32;this[_0x365f01(0xa5b)][_0x365f01(0xa63)]=!![],this['analysisOptions']['inverMatrix']=this['_inverMatrix'],this['analysisOptions']['polygonTexture']=this['_polygonTexture'],this['analysisOptions'][_0x365f01(0xbf2)]=this['_tailorRect'];}}class ContourLine extends TerrainOldEditBase{constructor(_0x2dc81e={}){const _0x245280={_0x122180:0x8b5},_0x4c9209=_0x3d5d32;super(_0x2dc81e),this['_contourShow']=_0x2dc81e[_0x4c9209(0xf0a)]??!![],this['_contourSpacing']=_0x2dc81e[_0x4c9209(_0x245280._0x122180)]??0x64,this[_0x4c9209(0xe94)]=_0x2dc81e['width']??1.5,this['_contourColor']=getCesiumColor(_0x2dc81e['color'],Cesium__namespace['Color']['RED']),this['_shadingType']=_0x2dc81e['shadingType']??'none',this['_shadingAlpha']=_0x2dc81e['shadingAlpha']??0.6,this['colorScheme']=_0x2dc81e['colorScheme']||{'elevation':{'step':[0x0,0.045,0.1,0.15,0.37,0.54,0x1],'color':[_0x4c9209(0xd2c),'#2747E0','#D33B7D','#D33038','#FF9742','#FF9742','#ffd700']},'slope':{'step':[0x0,0.29,0.5,Math['sqrt'](0x2)/0x2,0.87,0.91,0x1],'color':[_0x4c9209(0xd2c),'#2747E0','#D33B7D','#D33038','#FF9742','#FF9742',_0x4c9209(0xcc5)]},'aspect':{'step':[0x0,0.2,0.4,0.6,0.8,0.9,0x1],'color':[_0x4c9209(0xd2c),_0x4c9209(0x9fa),'#D33B7D','#D33038',_0x4c9209(0xacf),'#FF9742','#ffd700']}},this['minHeight']=_0x2dc81e['minHeight']??-0x19e,this['maxHeight']=_0x2dc81e[_0x4c9209(0x7cb)]??0x2249;}get[_0x3d5d32(0xf0a)](){const _0x6ae0e=_0x3d5d32;return this[_0x6ae0e(0xdbe)];}set[_0x3d5d32(0xf0a)](_0x52309d){const _0x33ac65=_0x3d5d32;this['_contourShow']=_0x52309d,this[_0x33ac65(0xf36)]();}get['shadingType'](){return this['_shadingType'];}set['shadingType'](_0xc9092f){this['_shadingType']=_0xc9092f,this['updateMaterial']();}get['shadingAlpha'](){const _0x29cdfd=_0x3d5d32;return this[_0x29cdfd(0x920)];}set['shadingAlpha'](_0x1c814b){this['_shadingAlpha']=_0x1c814b,this['updateMaterial']();}get[_0x3d5d32(0x1076)](){const _0x2af9ea=_0x3d5d32;return this[_0x2af9ea(0xe94)];}set[_0x3d5d32(0x1076)](_0x4575f3){const _0x51aeb3={_0x4f2d7e:0x1076},_0x48198d=_0x3d5d32;this['_contourWidth']=_0x4575f3,this['contourUniforms']&&(this['contourUniforms'][_0x48198d(_0x51aeb3._0x4f2d7e)]=_0x4575f3);}get['spacing'](){return this['_contourSpacing'];}set['spacing'](_0x35d036){this['_contourSpacing']=_0x35d036,this['contourUniforms']&&(this['contourUniforms']['spacing']=_0x35d036);}get['color'](){return this['_contourColor'];}set['color'](_0x52db03){const _0x2813f1=_0x3d5d32;this['_contourColor']=getCesiumColor(_0x52db03),this['contourUniforms']&&(this[_0x2813f1(0xe59)]['color']=_0x52db03);}['_enabledHook'](_0x55e9aa){const _0x12a8f0={_0x2a8f0a:0xf36},_0x336e89=_0x3d5d32;super[_0x336e89(0xacd)](_0x55e9aa),this[_0x336e89(_0x12a8f0._0x2a8f0a)]();}['clear'](){const _0x217b2d={_0x336dfb:0xd8f,_0x1195aa:0x1e2,_0xd7d56a:0xfc1,_0x5b93e2:0x8b7,_0x1b4425:0x2e2},_0x12f7ae=_0x3d5d32;super['clear'](),this['_last_material']&&(this['_map']['scene']['globe'][_0x12f7ae(_0x217b2d._0x336dfb)]=this[_0x12f7ae(_0x217b2d._0x1195aa)],delete this['_last_material']),this['contourUniforms']=null,this['_map']['scene']['globe'][_0x12f7ae(0x785)]['tileProvider']['marsOptions']['resetFloodValue'](),this['_hasResetEnableLighting']&&(this['_map'][_0x12f7ae(_0x217b2d._0xd7d56a)]['globe']['enableLighting']=![],this[_0x12f7ae(0x1d1)]['clock'][_0x12f7ae(0x4f8)]=Cesium__namespace[_0x12f7ae(_0x217b2d._0x5b93e2)]['now'](),delete this[_0x12f7ae(_0x217b2d._0x1b4425)]);}[_0x3d5d32(0x50d)](){const _0x1d547c={_0x1f60f8:0x7cb},_0x4dadb9=_0x3d5d32;this['heightVal']=new Cesium__namespace[(_0x4dadb9(0xd36))](this['minHeight'],this['minHeight'],this[_0x4dadb9(_0x1d547c._0x1f60f8)],this['maxHeight']-this[_0x4dadb9(0xa28)]),this['updateMaterial']();}['updateMaterial'](){const _0x72abd0={_0x7481fc:0x30f,_0x12e0e5:0xfe3,_0x1e8f57:0xb68,_0x113d04:0xab3,_0x333cce:0xdcd,_0x475acb:0xab3,_0x2dcda6:0xe94,_0x1b1b2e:0xe8f,_0x398c87:0xfe3,_0x17c391:0x460,_0x711ef3:0x5ab,_0x44abfd:0x2e2,_0x7de08:0xaa8,_0x42c0a0:0x4f8,_0x1e92e1:0x419,_0x2ffed8:0xfc1,_0x2b599b:0xaa8},_0x1b2b86=_0x3d5d32;let _0x540db4,_0x2fcede,_0x35100b;const _0x22d920=this['_shadingType'];if(this['contourShow']){if(_0x22d920==='elevation')_0x540db4=this['getElevationContourMaterial'](),_0x35100b=_0x540db4['materials'][_0x1b2b86(_0x72abd0._0x7481fc)][_0x1b2b86(_0x72abd0._0x12e0e5)],_0x35100b['minimumHeight']=this['minHeight'],_0x35100b['maximumHeight']=this[_0x1b2b86(0x7cb)],_0x2fcede=_0x540db4[_0x1b2b86(_0x72abd0._0x1e8f57)][_0x1b2b86(_0x72abd0._0x113d04)][_0x1b2b86(0xfe3)];else{if(_0x22d920==='slope')_0x540db4=this['getSlopeContourMaterial'](),_0x35100b=_0x540db4['materials']['slopeRampMaterial']['uniforms'],_0x2fcede=_0x540db4['materials'][_0x1b2b86(_0x72abd0._0x113d04)]['uniforms'];else _0x22d920==='aspect'?(_0x540db4=this['getAspectContourMaterial'](),_0x35100b=_0x540db4['materials'][_0x1b2b86(_0x72abd0._0x333cce)]['uniforms'],_0x2fcede=_0x540db4['materials'][_0x1b2b86(_0x72abd0._0x475acb)]['uniforms']):(_0x540db4=Cesium__namespace[_0x1b2b86(0xc6b)]['fromType']('ElevationContour'),_0x2fcede=_0x540db4['uniforms']);}_0x2fcede[_0x1b2b86(0x1076)]=this[_0x1b2b86(_0x72abd0._0x2dcda6)],_0x2fcede['spacing']=this['_contourSpacing'],_0x2fcede[_0x1b2b86(_0x72abd0._0x1b1b2e)]=this['_contourColor'];}else{if(_0x22d920==='elevation')_0x540db4=Cesium__namespace['Material']['fromType']('ElevationRamp'),_0x35100b=_0x540db4[_0x1b2b86(_0x72abd0._0x398c87)],_0x35100b['minimumHeight']=this['minHeight'],_0x35100b[_0x1b2b86(0x242)]=this[_0x1b2b86(0x7cb)];else{if(_0x22d920==='slope')_0x540db4=Cesium__namespace['Material']['fromType'](_0x1b2b86(0x91e)),_0x35100b=_0x540db4['uniforms'];else _0x22d920==='aspect'&&(_0x540db4=Cesium__namespace['Material']['fromType']('AspectRamp'),_0x35100b=_0x540db4['uniforms']);}}_0x22d920!=='none'&&(_0x35100b['image']=this['getColorRamp'](_0x22d920));if(_0x22d920===_0x1b2b86(_0x72abd0._0x17c391)||_0x22d920==='aspect'){if(!this['_map']['scene']['globe']['enableLighting']){this['_map'][_0x1b2b86(0xfc1)]['globe'][_0x1b2b86(0x89f)]=!![];const _0x208bbf=new Date();_0x208bbf[_0x1b2b86(_0x72abd0._0x711ef3)](0xa),this['_map'][_0x1b2b86(0x9f4)]['currentTime']=Cesium__namespace['JulianDate']['fromDate'](new Date(_0x208bbf)),this[_0x1b2b86(_0x72abd0._0x44abfd)]=!![];}}else this['_hasResetEnableLighting']&&(this['_map']['scene'][_0x1b2b86(_0x72abd0._0x7de08)]['enableLighting']=![],this['_map'][_0x1b2b86(0x9f4)][_0x1b2b86(_0x72abd0._0x42c0a0)]=Cesium__namespace['JulianDate'][_0x1b2b86(_0x72abd0._0x1e92e1)](),delete this[_0x1b2b86(0x2e2)]);this['contourUniforms']=_0x2fcede,(!this[_0x1b2b86(0x1e2)]||this['_map'][_0x1b2b86(_0x72abd0._0x2ffed8)][_0x1b2b86(0xaa8)]['material'])&&(this['_last_material']=this['_map']['scene'][_0x1b2b86(_0x72abd0._0x2b599b)][_0x1b2b86(0xd8f)]),this[_0x1b2b86(0x1d1)]['scene'][_0x1b2b86(_0x72abd0._0x2b599b)]['material']=_0x540db4;}['getColorRamp'](_0x2654cf){const _0x5446f4={_0xbc78b7:0x901,_0x37661f:0xe8f},_0x54d57b=_0x3d5d32;var _0x44ce31;const _0x12ac1c=document[_0x54d57b(0x3dc)]('canvas');_0x12ac1c['width']=0x64,_0x12ac1c[_0x54d57b(0x83e)]=0x1;const _0x59c5bc=_0x12ac1c['getContext']('2d',{'willReadFrequently':!![]});_0x59c5bc[_0x54d57b(0xc96)]=this['shadingAlpha'];const _0xc0eb12=_0x59c5bc['createLinearGradient'](0x0,0x0,0x64,0x0),_0x5a97e0=this['colorScheme'][_0x2654cf];if((_0x5a97e0===null||_0x5a97e0===void 0x0?void 0x0:(_0x44ce31=_0x5a97e0[_0x54d57b(0x7d5)])===null||_0x44ce31===void 0x0?void 0x0:_0x44ce31['length'])>0x0)for(let _0x53dc76=0x0,_0x4afacd=_0x5a97e0['step']['length'];_0x53dc76<_0x4afacd;_0x53dc76++){_0xc0eb12[_0x54d57b(_0x5446f4._0xbc78b7)](_0x5a97e0['step'][_0x53dc76],_0x5a97e0[_0x54d57b(_0x5446f4._0x37661f)][_0x53dc76]);}return _0x59c5bc['fillStyle']=_0xc0eb12,_0x59c5bc['fillRect'](0x0,0x0,0x64,0x1),_0x12ac1c;}[_0x3d5d32(0x493)](){return new Cesium__namespace['Material']({'fabric':{'type':'ElevationColorContour','materials':{'contourMaterial':{'type':'ElevationContour'},'elevationRampMaterial':{'type':'ElevationRamp'}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20elevationRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':'max(contourMaterial.alpha,\x20elevationRampMaterial.alpha)'}},'translucent':![]});}['getSlopeContourMaterial'](){const _0x1387be={_0x2f1e2e:0xc6b,_0x4ff0f9:0x91e},_0x3531b2=_0x3d5d32;return new Cesium__namespace[(_0x3531b2(_0x1387be._0x2f1e2e))]({'fabric':{'type':'SlopeColorContour','materials':{'contourMaterial':{'type':'ElevationContour'},'slopeRampMaterial':{'type':_0x3531b2(_0x1387be._0x4ff0f9)}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20slopeRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':'max(contourMaterial.alpha,\x20slopeRampMaterial.alpha)'}},'translucent':![]});}[_0x3d5d32(0xc04)](){const _0x1e421b={_0x25efd5:0x48a},_0x42ead0=_0x3d5d32;return new Cesium__namespace['Material']({'fabric':{'type':'AspectColorContour','materials':{'contourMaterial':{'type':'ElevationContour'},'aspectRampMaterial':{'type':_0x42ead0(_0x1e421b._0x25efd5)}},'components':{'diffuse':'contourMaterial.alpha\x20==\x200.0\x20?\x20aspectRampMaterial.diffuse\x20:\x20contourMaterial.diffuse','alpha':_0x42ead0(0xe1d)}},'translucent':![]});}}class TerrainEditBase extends BaseThing{constructor(_0x143891={}){super(_0x143891),!isMars3DCesium&&logError$1('该功能需要引入mars3d修改版Cesium库(mars3d-cesium库)才支持!',this),this['_areaList']=[];}get['list'](){return this['_areaList'];}get['length'](){const _0x5a709f={_0x4cb47e:0x1028},_0x2d67c1=_0x3d5d32;if(this[_0x2d67c1(0x1028)]){var _0x16b016;return(_0x16b016=this[_0x2d67c1(_0x5a709f._0x4cb47e)])===null||_0x16b016===void 0x0?void 0x0:_0x16b016['length'];}else return 0x0;}['_enabledHook'](_0x5d75c3){this['analysisOptions']['enabled']=_0x5d75c3;}[_0x3d5d32(0x226)](){const _0x42cfbc={_0x3b5066:0x433},_0x5d3866=_0x3d5d32;this[_0x5d3866(_0x42cfbc._0x3b5066)]['area']&&this[_0x5d3866(0x433)]['area'][_0x5d3866(0x1061)](_0x257191=>{const _0x5ad66f=_0x5d3866;this['addArea'](_0x257191[_0x5ad66f(0xbb8)],_0x257191);});}['_removedHook'](){this['analysisOptions']['enabled']=![];}[_0x3d5d32(0x76d)](){this['_areaList']=[];}[_0x3d5d32(0x33e)](_0x55608e){const _0x7ffe66={_0x55e9b6:0x1028},_0x1364a7=_0x3d5d32;if(!isNumber(_0x55608e))return _0x55608e;for(let _0x4175e1=0x0;_0x4175e10x0){const _0x2816c3=this['_map']['scene'][_0x26a48f(_0x5d3612._0x1bed67)]['ellipsoid'],_0x1affba=[],_0x50cdfd=[],_0x183fdd=[];this['_areaList']['forEach'](_0x357d7d=>{const _0x56703e=_0x26a48f;if(!_0x357d7d[_0x56703e(_0x557bf1._0x5dae3f)]||!_0x357d7d[_0x56703e(_0x557bf1._0xa199e5)])return;const _0x3789c5=_0x2816c3['cartesianArrayToCartographicArray'](_0x357d7d[_0x56703e(0xbb8)]);let _0x4adaf1=_0x3789c5[0x0]['height'];_0x3789c5['forEach'](_0x3ca604=>{const _0x15e8f0=_0x56703e;_0x4adaf1=Math[_0x15e8f0(_0x30d534._0x169b15)](_0x4adaf1,_0x3ca604[_0x15e8f0(_0x30d534._0x4f407d)]);}),_0x1affba[_0x56703e(_0x557bf1._0x56ee99)](_0x4adaf1-(_0x357d7d['height']||0x0)),_0x50cdfd[_0x56703e(0xb75)](_0x3789c5),_0x183fdd[_0x56703e(0xb75)](Cesium__namespace['Rectangle']['fromCartographicArray'](_0x3789c5));}),_0x301750[_0x26a48f(_0x5d3612._0x1d5ff0)]=_0x1affba,_0x301750[_0x26a48f(0xde5)]=_0x183fdd,_0x301750['areas']=_0x50cdfd;}else _0x301750[_0x26a48f(_0x5d3612._0x15439b)]=undefined,_0x301750['rectangles']=undefined,_0x301750[_0x26a48f(0xa2e)]=undefined;_0x301750['hasUpdate']=!![];}}class TerrainUplift extends TerrainEditBase{get['analysisOptions'](){const _0x42630b={_0x220a44:0x96d},_0x295563=_0x3d5d32;var _0x22b671,_0x825ace,_0x540934,_0x52e086,_0x498266,_0xde36c0;return(_0x22b671=this[_0x295563(0x1d1)])===null||_0x22b671===void 0x0?void 0x0:(_0x825ace=_0x22b671['scene'])===null||_0x825ace===void 0x0?void 0x0:(_0x540934=_0x825ace['globe'])===null||_0x540934===void 0x0?void 0x0:(_0x52e086=_0x540934['_surface'])===null||_0x52e086===void 0x0?void 0x0:(_0x498266=_0x52e086['tileProvider'])===null||_0x498266===void 0x0?void 0x0:(_0xde36c0=_0x498266[_0x295563(0x524)])===null||_0xde36c0===void 0x0?void 0x0:_0xde36c0[_0x295563(_0x42630b._0x220a44)];}get[_0x3d5d32(0x903)](){var _0x1e1e38;return(_0x1e1e38=this['analysisOptions'])===null||_0x1e1e38===void 0x0?void 0x0:_0x1e1e38['showUp'];}set['showUp'](_0xd051c7){this['analysisOptions']['showUp']=_0xd051c7;}get['upHeight'](){const _0x2ba74f=_0x3d5d32;return this['options'][_0x2ba74f(0x1cd)]??0x0;}set[_0x3d5d32(0x1cd)](_0x46a974){const _0x4f3b88={_0x4e11d9:0x1028,_0x4db222:0x835},_0x12c6db=_0x3d5d32;this['options']['upHeight']=_0x46a974;if(this['_areaList']['length']>0x0){this['analysisOptions']['height']=_0x46a974,this['analysisOptions']['hasUpdate']=!![];for(let _0x2bb11b=0x0;_0x2bb11b{_0x1df043['positionsNew']=_0xcae97e['positions'],this['_addPitGraphic'](_0x1df043,_0x1fa24d);});}['_addPitGraphic'](_0x1e5202,_0x2a130f){const _0x443035={_0x13c3bb:0x9e2,_0x592359:0x1cd,_0x49e9b1:0x682,_0x2d6cfc:0x835},_0x4f6adb=_0x3d5d32,_0x3823a8=_0x1e5202['positionsNew'],_0x4cd99d=[];let _0x5211d6=Number['MAX_VALUE'];for(let _0x34ad70=0x0,_0x3e7457=_0x3823a8['length'];_0x34ad70<_0x3e7457;_0x34ad70++){const _0x3dd0f9=Cesium__namespace['Cartographic']['fromCartesian'](_0x3823a8[_0x34ad70]);_0x5211d6=Math['min'](_0x5211d6,_0x3dd0f9['height']),_0x4cd99d['push'](_0x3dd0f9['height']);}const _0x2c0296=_0x5211d6-_0x2a130f[_0x4f6adb(_0x443035._0x13c3bb)],_0x17d338=Array(_0x3823a8['length'])['fill'](_0x2c0296);_0x1e5202['minHeight']=_0x5211d6,_0x1e5202['diffHeight']=_0x2a130f['diffHeight'],_0x1e5202['downGraphic']=new PitEntity({'style':_0x2a130f,'data':{'height':_0x2c0296,'minHeight':_0x5211d6,'positionsWall':_0x3823a8,'minimumHeights':_0x17d338,'maximumHeights':_0x4cd99d},'positions':_0x1e5202['positions']}),this['_graphicLayer']['addGraphic'](_0x1e5202[_0x4f6adb(0xeae)]);const _0x47b1b3=this[_0x4f6adb(_0x443035._0x592359)];this[_0x4f6adb(0x903)]&&_0x47b1b3!==0x0&&(_0x1e5202['upGraphic']=new PitEntity({'style':_0x2a130f,'data':{'height':_0x2c0296,'minHeight':_0x5211d6,'positionsWall':_0x3823a8,'minimumHeights':_0x17d338,'maximumHeights':_0x4cd99d},'positions':_0x1e5202['positions']}),this['_graphicLayer'][_0x4f6adb(_0x443035._0x49e9b1)](_0x1e5202[_0x4f6adb(_0x443035._0x2d6cfc)]),_0x1e5202[_0x4f6adb(0x835)]['setUpHeight'](_0x47b1b3));}['_removeAreaHook'](_0x3a2b82){const _0x5e4c84={_0x29c6c6:0x32f,_0x1ea3ac:0x835,_0x5b2952:0x32f},_0x38ac81=_0x3d5d32;_0x3a2b82!==null&&_0x3a2b82!==void 0x0&&_0x3a2b82['downGraphic']&&(this[_0x38ac81(_0x5e4c84._0x29c6c6)]['removeGraphic'](_0x3a2b82['downGraphic'],!![]),delete _0x3a2b82['downGraphic']),_0x3a2b82!==null&&_0x3a2b82!==void 0x0&&_0x3a2b82[_0x38ac81(_0x5e4c84._0x1ea3ac)]&&(this[_0x38ac81(_0x5e4c84._0x5b2952)]['removeGraphic'](_0x3a2b82['upGraphic'],!![]),delete _0x3a2b82['upGraphic']);}[_0x3d5d32(0x8be)](){const _0x617c86={_0x513f99:0x5ac,_0x3bda68:0x83e,_0x276622:0xa2e},_0x4e3fb0={_0x1a91b0:0xb75},_0x23c1b1=_0x3d5d32,_0x41d439=this['analysisOptions'];if(this['_areaList']['length']>0x0){const _0x8b42ef=this['_map'][_0x23c1b1(0xfc1)]['globe'][_0x23c1b1(_0x617c86._0x513f99)],_0x746512=[],_0x50f247=[];this['_areaList']['forEach'](_0x168cf8=>{const _0x3a3464=_0x23c1b1;if(!_0x168cf8['show']||!_0x168cf8['positions'])return;const _0x31bf58=_0x8b42ef[_0x3a3464(0x55d)](_0x168cf8[_0x3a3464(0xbb8)]);_0x746512[_0x3a3464(_0x4e3fb0._0x1a91b0)](_0x31bf58),_0x50f247['push'](Cesium__namespace['Rectangle']['fromCartographicArray'](_0x31bf58));}),_0x41d439[_0x23c1b1(_0x617c86._0x3bda68)]=this[_0x23c1b1(0x1cd)],_0x41d439['rectangles']=_0x50f247,_0x41d439[_0x23c1b1(_0x617c86._0x276622)]=_0x746512;}else _0x41d439['height']=undefined,_0x41d439['rectangles']=undefined,_0x41d439['areas']=undefined;_0x41d439[_0x23c1b1(0xe46)]=!![];}}class LimitHeight extends BaseThing{get['layer'](){const _0x48245e={_0x1df06c:0x873},_0x5b4b2a=_0x3d5d32;return this[_0x5b4b2a(_0x48245e._0x1df06c)];}get['positions'](){const _0x1d431a=_0x3d5d32;return this['options'][_0x1d431a(0xbb8)];}set['positions'](_0x41d43d){this['options']['positions']=_0x41d43d,this['_createGraphic']();}get['height'](){const _0x14b136=_0x3d5d32;return this['options'][_0x14b136(0x83e)]||0x0;}set['height'](_0x5662bb){const _0x1e9687={_0x2655f6:0xa88},_0xade8df=_0x3d5d32;this['options']['height']=_0x5662bb,this[_0xade8df(_0x1e9687._0x2655f6)]();}get[_0x3d5d32(0x7fa)](){const _0x406340={_0x52bd40:0x7fa},_0x1f3512=_0x3d5d32;return this['options'][_0x1f3512(_0x406340._0x52bd40)]||0x0;}set[_0x3d5d32(0x7fa)](_0x2bf29d){const _0x4e87f1=_0x3d5d32;this[_0x4e87f1(0x433)]['bottomHeight']=_0x2bf29d,this['_createGraphic']();}[_0x3d5d32(0xe4c)](){const _0x33b962={_0x8019bb:0x873},_0x332340=_0x3d5d32;this[_0x332340(_0x33b962._0x8019bb)]=new GraphicLayer({'private':!![]});}['_addedHook'](){const _0x190de8=_0x3d5d32;this['_map']['addLayer'](this['_layer']),this[_0x190de8(0x433)]['positions']&&(this['positions']=this[_0x190de8(0x433)]['positions']);}[_0x3d5d32(0x566)](){const _0x37a4e9={_0x194d0f:0x873},_0x2dd99b=_0x3d5d32;this['_graphic']&&(this['_layer']['removeGraphic'](this[_0x2dd99b(0x6cc)]),delete this['_graphic']),this['_map']['removeLayer'](this[_0x2dd99b(_0x37a4e9._0x194d0f)]);}[_0x3d5d32(0xa88)](){const _0x7bf053={_0x52e897:0x6cc,_0x2ff039:0x233},_0xe73b44=_0x3d5d32;this[_0xe73b44(_0x7bf053._0x52e897)]&&(this['_layer'][_0xe73b44(0x358)](this[_0xe73b44(_0x7bf053._0x52e897)]),delete this['_graphic']);if(!this['options']['positions'])return;const _0x261635=LngLatArray['toCartesians'](this['options'][_0xe73b44(0xbb8)]);this[_0xe73b44(_0x7bf053._0x52e897)]=new PolygonPrimitive({'positions':_0x261635,'style':{...this['options'],'height':this['bottomHeight']+this['height'],'diffHeight':0x2710,'perPositionHeight':![],'classification':!![],'classificationType':Cesium__namespace['ClassificationType'][_0xe73b44(_0x7bf053._0x2ff039)]},'asynchronous':![]}),this['_layer']['addGraphic'](this['_graphic']);}['clear'](){const _0xd694c9={_0xd8de84:0x433,_0x515ad2:0x6cc},_0x36dcf9=_0x3d5d32;this[_0x36dcf9(_0xd694c9._0xd8de84)]['positions']=null,this[_0x36dcf9(_0xd694c9._0x515ad2)]&&(this['_layer']['removeGraphic'](this['_graphic']),delete this['_graphic']);}}class ModelPlanClip extends TilesetPlanClip{get['clipTarget'](){const _0x57efc3=_0x3d5d32;return this[_0x57efc3(0xb02)];}set['clipTarget'](_0x45f990){const _0x33832a={_0x5a102a:0xdea},_0x23aba1=_0x3d5d32;this[_0x23aba1(0xb02)]=_0x45f990,this['_inverseMatrix']=null,this['clippingPlanes']&&(this['_model']['clippingPlanes']=this[_0x23aba1(_0x33832a._0x5a102a)]);}get['graphic'](){return this['_graphic'];}set['graphic'](_0xbcf762){const _0x49add2={_0x58b0fe:0xb02,_0x5c4350:0x545},_0x35fea6=_0x3d5d32;if(_0xbcf762['readyPromise']){_0xbcf762['readyPromise']['then'](_0x2e4b6a=>{const _0x499be8=_0x4132;this['_model']=_0xbcf762[_0x499be8(0x8ec)],this[_0x499be8(0x545)]=_0xbcf762['modelMatrix'];});return;}this['_graphic']=_0xbcf762;if(_0xbcf762['entity'])this[_0x35fea6(0xb02)]=_0xbcf762['entity']['model'],this['_modelMatrix']=Cesium__namespace[_0x35fea6(0x5bb)]['eastNorthUpToFixedFrame'](getPositionValue(_0xbcf762[_0x35fea6(0xb69)]));else{if(_0xbcf762 instanceof Cesium__namespace['Entity'])this['_model']=_0xbcf762['model'],this[_0x35fea6(0x545)]=Cesium__namespace['Transforms'][_0x35fea6(0x724)](getPositionValue(_0xbcf762['position']));else{if(_0xbcf762[_0x35fea6(0x8ec)])this['_model']=_0xbcf762['primitive'],this['_modelMatrix']=_0xbcf762['modelMatrix'];else _0xbcf762 instanceof Cesium__namespace['Model']&&(this[_0x35fea6(_0x49add2._0x58b0fe)]=_0xbcf762,this[_0x35fea6(_0x49add2._0x5c4350)]=_0xbcf762[_0x35fea6(0xd93)]);}}}get[_0x3d5d32(0x6a7)](){const _0x51ed62={_0xa4e7bf:0xf1b},_0x7ebdef=_0x3d5d32;return!this[_0x7ebdef(_0x51ed62._0xa4e7bf)]&&this['_modelMatrix']&&(this['_inverseMatrix']=Cesium__namespace[_0x7ebdef(0xf5d)]['inverseTransformation'](this[_0x7ebdef(0x545)],new Cesium__namespace['Matrix4']())),this['_inverseMatrix'];}[_0x3d5d32(0xe4c)](){const _0x2ea97d={_0x5e19f9:0x328},_0x1d3252=_0x3d5d32;this['options'][_0x1d3252(0x328)]&&(this['graphic']=this['options'][_0x1d3252(_0x2ea97d._0x5e19f9)]);}}ModelPlanClip['Type']=ClipType;class TilesetBoxClip extends BaseThing{get['clipTarget'](){return this['_tileset'];}set[_0x3d5d32(0xd0a)](_0x52d192){const _0x20f394={_0x39e32b:0xf1b,_0x10cc5f:0xb84,_0x12423c:0x433},_0x993781=_0x3d5d32;this['_tileset']=_0x52d192,this[_0x993781(_0x20f394._0x39e32b)]=null,Cesium__namespace[_0x993781(_0x20f394._0x10cc5f)](this['options'][_0x993781(0xb69)])&&(this['position']=this[_0x993781(_0x20f394._0x12423c)]['position']);}get[_0x3d5d32(0x548)](){return this['_layer'];}set[_0x3d5d32(0x548)](_0x57ed1a){const _0x305b11={_0x1c1463:0xd0a};this['_layer']=_0x57ed1a,_0x57ed1a['loadOk']?this['clipTarget']=_0x57ed1a['tileset']:_0x57ed1a['on'](EventType['load'],_0x3de0a7=>{const _0x3b7d45=_0x4132;this[_0x3b7d45(_0x305b11._0x1c1463)]=_0x57ed1a[_0x3b7d45(0x7f7)];});}get['planes'](){return this['clippingPlanes'];}get['inverseMatrix'](){const _0xe95687={_0x279b45:0x71f},_0x44b6d3=_0x3d5d32;if(!this[_0x44b6d3(0xf1b)]){let _0x1601b2;const _0x4425c1=this[_0x44b6d3(0x841)]['root']['transform'];_0x4425c1&&_0x4425c1[_0x44b6d3(_0xe95687._0x279b45)](Cesium__namespace['Matrix4']['IDENTITY'])||!_0x4425c1?_0x1601b2=Cesium__namespace['Transforms'][_0x44b6d3(0x724)](this['_tileset']['boundingSphere'][_0x44b6d3(0xe72)]):_0x1601b2=Cesium__namespace['Matrix4']['fromArray'](this['_tileset']['root']['transform']),this['_inverseMatrix']=Cesium__namespace['Matrix4']['inverseTransformation'](_0x1601b2,new Cesium__namespace['Matrix4']());}return this['_inverseMatrix'];}get['center'](){if(this['_layer'])return this['_layer']['position'];return this['_tileset']['boundingSphere']['center'];}get[_0x3d5d32(0xb69)](){return this['_position'];}set[_0x3d5d32(0xb69)](_0x5adba1){this['_position']=LngLatPoint['toCartesian'](_0x5adba1),this['redraw']();}get['dimensions'](){return this['options']['dimensions'];}set['dimensions'](_0x4dc65b){this['options']['dimensions']=_0x4dc65b,this['redraw']();}get['showBox'](){return this['options']['showBox'];}set['showBox'](_0x3b92b0){const _0x47b1b6={_0x1e1a16:0x433,_0x175636:0x32f},_0x8de99f=_0x3d5d32;this[_0x8de99f(_0x47b1b6._0x1e1a16)]['showBox']=_0x3b92b0,this['options']['showBox']?(!this['_graphicLayer']&&(this[_0x8de99f(_0x47b1b6._0x175636)]=new GraphicLayer({...this['options'],'private':!![]})),this[_0x8de99f(0x32f)][_0x8de99f(0x792)]=!![]):this['_graphicLayer']&&(this[_0x8de99f(_0x47b1b6._0x175636)][_0x8de99f(0x792)]=![]),this['redraw']();}['_mountedHook'](){const _0x536e12={_0x14c2f1:0x433,_0x109596:0x433,_0x55dc09:0xd0a},_0x433b7a=_0x3d5d32;this[_0x433b7a(0x433)][_0x433b7a(0x760)]&&(this['_graphicLayer']=new GraphicLayer({...this[_0x433b7a(_0x536e12._0x14c2f1)],'private':!![]}));if(this[_0x433b7a(_0x536e12._0x109596)]['layer'])this['layer']=this['options']['layer'];else this[_0x433b7a(0x433)]['tileset']&&(this[_0x433b7a(_0x536e12._0x55dc09)]=this['options']['tileset']);}['_addedHook'](){const _0x31059a=_0x3d5d32;this['_graphicLayer']&&this['_map']['addLayer'](this['_graphicLayer']),this['clipTarget']&&(Cesium__namespace[_0x31059a(0xb84)](this[_0x31059a(0x433)]['position'])&&(this[_0x31059a(0xb69)]=this[_0x31059a(0x433)]['position']));}['_removedHook'](){const _0x4565dc={_0x5cac6b:0x32f,_0x2823c9:0x1d1},_0x546579=_0x3d5d32;this['clear'](),this[_0x546579(_0x4565dc._0x5cac6b)]&&this[_0x546579(_0x4565dc._0x2823c9)]['removeLayer'](this['_graphicLayer']);}[_0x3d5d32(0x9ba)](){const _0x3d113b={_0xcdec:0x9e5,_0x25dffb:0xe95,_0x38b2df:0xb2e,_0x145f03:0xe58,_0x1f1f8a:0x433,_0x4d82d6:0x9e0,_0x327381:0x2c4,_0x409ea4:0x760,_0xbf9397:0xe57,_0x160a1b:0x32f},_0x57f121=_0x3d5d32;if(!this['position']||!this['dimensions'])return;const _0x1b3396=this[_0x57f121(_0x3d113b._0xcdec)]['x']/0x2,_0x53fc0c=this['dimensions']['y']/0x2,_0x1123ca=this['dimensions']['z']/0x2,_0x32ecd9=this['inverseMatrix'],_0x133cfa=Cesium__namespace[_0x57f121(0xf5d)]['multiplyByPoint'](_0x32ecd9,this['center'],new Cesium__namespace['Cartesian3']()),_0xa2f7fb=Cesium__namespace[_0x57f121(0xf5d)]['multiplyByPoint'](_0x32ecd9,this['position'],new Cesium__namespace[(_0x57f121(_0x3d113b._0x25dffb))]()),_0x3b31d7=_0x133cfa['x']-_0xa2f7fb['x'],_0x15a867=_0x133cfa['y']-_0xa2f7fb['y'],_0x4b3341=_0x133cfa['z']-_0xa2f7fb['z'],_0x430ce5=[new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,0x1),-_0x1123ca+_0x4b3341),new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,0x0,-0x1),-_0x1123ca-_0x4b3341),new Cesium__namespace['ClippingPlane'](new Cesium__namespace[(_0x57f121(0xe95))](0x1,0x0,0x0),-_0x1b3396+_0x3b31d7),new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](-0x1,0x0,0x0),-_0x1b3396-_0x3b31d7),new Cesium__namespace[(_0x57f121(0xa42))](new Cesium__namespace['Cartesian3'](0x0,0x1,0x0),-_0x53fc0c+_0x15a867),new Cesium__namespace['ClippingPlane'](new Cesium__namespace['Cartesian3'](0x0,-0x1,0x0),-_0x53fc0c-_0x15a867)],_0x58bf93=new Cesium__namespace[(_0x57f121(_0x3d113b._0x38b2df))]({'planes':_0x430ce5,'edgeWidth':this['options'][_0x57f121(_0x3d113b._0x145f03)]??0x0,'edgeColor':this[_0x57f121(_0x3d113b._0x1f1f8a)][_0x57f121(_0x3d113b._0x4d82d6)]??Cesium__namespace['Color']['WHITE'],'unionClippingRegions':this['options'][_0x57f121(_0x3d113b._0x327381)]??![]});this['clippingPlanes']=_0x58bf93;this['clipTarget']&&(this['clipTarget']['clippingPlanes']=_0x58bf93);if(this['options'][_0x57f121(_0x3d113b._0x409ea4)]){this['_graphicLayer']['clear']();const _0x484527=new BoxEntity({'position':this['position'],'style':{'dimensions':this['options']['dimensions'],'color':Cesium__namespace['Color']['WHITE'][_0x57f121(_0x3d113b._0xbf9397)](0.2),...this['options']['boxStyle']||{}}});this[_0x57f121(_0x3d113b._0x160a1b)][_0x57f121(0x682)](_0x484527);}}['clear'](){const _0x33b76f={_0x3102b7:0xd0a},_0x425ed3=_0x3d5d32;var _0x40bedd,_0x305e6a;this['_graphicLayer']&&this['_graphicLayer']['clear'](),this['clippingPlanes']&&delete this['clippingPlanes'],(_0x40bedd=this['clipTarget'])!==null&&_0x40bedd!==void 0x0&&(_0x305e6a=_0x40bedd['clippingPlanes'])!==null&&_0x305e6a!==void 0x0&&_0x305e6a['enabled']&&(this['clipTarget']['clippingPlanes']['enabled']=![]),this[_0x425ed3(_0x33b76f._0x3102b7)]['clippingPlanes']=undefined;}}const scratchCurrentDirection=new Cesium__namespace['Cartesian3'](),scratchDeltaPosition=new Cesium__namespace['Cartesian3'](),scratchNextPosition=new Cesium__namespace['Cartesian3'](),scratchTerrainConsideredNextPosition=new Cesium__namespace['Cartesian3'](),scratchNextCartographic=new Cesium__namespace[(_0x3d5d32(0x220))](),RoamType={'DIRECTION_NONE':0x0,'DIRECTION_FORWARD':0x1,'DIRECTION_BACKWARD':0x2,'DIRECTION_LEFT':0x3,'DIRECTION_RIGHT':0x4};class FirstPersonRoam extends BaseThing{constructor(_0x22faec={}){const _0x75b6a0={_0x530fea:0x433,_0x5c8b25:0xe45},_0x46926f=_0x3d5d32;super(_0x22faec),this[_0x46926f(0x85c)]=this['options']['speed']??1.5,this['rotateSpeed']=this[_0x46926f(_0x75b6a0._0x530fea)][_0x46926f(_0x75b6a0._0x5c8b25)]??-0x5,this['height']=this['options']['height']??0xa,this['maxPitch']=this['options']['maxPitch']??0x58;}['_enabledHook'](_0x4c8455){_0x4c8455?this['activate']():this['disable']();}['_mountedHook'](){}['_addedHook'](){const _0x8837d0={_0x2f2c7c:0x390,_0x16d7e6:0x91b},_0x2dc431=_0x3d5d32;this['enabled']&&this[_0x2dc431(_0x8837d0._0x2f2c7c)](),this['_map']['on'](EventType[_0x2dc431(_0x8837d0._0x16d7e6)],this['_onLeftDownHandler'],this),this['_map']['on'](EventType['leftUp'],this['_onLeftUpHandler'],this),this['_map']['on'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map']['on'](EventType['dblClick'],this['_onDbClickHandler'],this),this['_map']['on'](EventType[_0x2dc431(0x8c6)],this['_onKeyDown'],this),this[_0x2dc431(0x1d1)]['on'](EventType['keyup'],this['_onKeyUp'],this),this[_0x2dc431(0x1d1)]['on'](EventType['clockTick'],this[_0x2dc431(0xd7b)],this);}['_removedHook'](){const _0x2efa5b={_0x48db88:0x1d1,_0x3339c8:0x91b,_0x32d966:0x9e7,_0x159517:0xc7b,_0x22738a:0x93c,_0xfc3ae5:0x1d1,_0x346528:0x9e7},_0x35bc70=_0x3d5d32;this['disable'](),this[_0x35bc70(_0x2efa5b._0x48db88)]['off'](EventType[_0x35bc70(_0x2efa5b._0x3339c8)],this['_onLeftDownHandler'],this),this['_map']['off'](EventType['leftUp'],this['_onLeftUpHandler'],this),this['_map']['off'](EventType['mouseMove'],this['_onMouseMoveHandler'],this),this['_map'][_0x35bc70(_0x2efa5b._0x32d966)](EventType[_0x35bc70(0xd83)],this[_0x35bc70(_0x2efa5b._0x159517)],this),this['_map'][_0x35bc70(0x9e7)](EventType['keydown'],this['_onKeyDown'],this),this['_map']['off'](EventType[_0x35bc70(_0x2efa5b._0x22738a)],this[_0x35bc70(0x619)],this),this[_0x35bc70(_0x2efa5b._0xfc3ae5)][_0x35bc70(_0x2efa5b._0x346528)](EventType['clockTick'],this['_onClockTick'],this);}[_0x3d5d32(0x90e)](_0x1f006e){const _0x26fe62={_0x29f81e:0x7a1,_0x1d0fca:0x69b},_0x5e27ec=_0x3d5d32;if(!this['enabled'])return;this['_looking']=!![],this[_0x5e27ec(_0x26fe62._0x29f81e)]=Cesium__namespace['Cartesian3']['clone'](_0x1f006e['position']),this[_0x5e27ec(_0x26fe62._0x1d0fca)]=this[_0x5e27ec(0x7a1)];}['_onDbClickHandler'](_0x1f3967){const _0x14c14f={_0x565a39:0xb69,_0x46603f:0x7a1},_0x34e34e=_0x3d5d32;if(!this['enabled'])return;this['_looking']=!![],this['_startMousePosition']=Cesium__namespace['Cartesian3']['clone'](_0x1f3967[_0x34e34e(_0x14c14f._0x565a39)]),this['_mousePosition']=this[_0x34e34e(_0x14c14f._0x46603f)];}['_onLeftUpHandler'](_0x17c91a){const _0x4699f0={_0x277359:0x81b},_0x3fedfe=_0x3d5d32;this[_0x3fedfe(_0x4699f0._0x277359)]=![];}['_onMouseMoveHandler'](_0x2766e2){const _0x3d15b3={_0x4a8d39:0xd13},_0x367030=_0x3d5d32;this['_mousePosition']=_0x2766e2[_0x367030(_0x3d15b3._0x4a8d39)];}['_onKeyDown'](_0x5dc191){const _0x58dc15={_0x406676:0xd8c,_0x5c625c:0xd8c},_0x44ae95=_0x3d5d32;if(!this[_0x44ae95(0xa63)])return;const _0x5891b7=_0x5dc191['keyCode'];this[_0x44ae95(_0x58dc15._0x406676)]=RoamType['DIRECTION_NONE'];switch(_0x5891b7){case'W'['charCodeAt'](0x0):this['_direction']=RoamType[_0x44ae95(0x991)];break;case'S'['charCodeAt'](0x0):this['_direction']=RoamType['DIRECTION_BACKWARD'];break;case'D'['charCodeAt'](0x0):this[_0x44ae95(_0x58dc15._0x5c625c)]=RoamType['DIRECTION_RIGHT'];break;case'A'['charCodeAt'](0x0):this['_direction']=RoamType['DIRECTION_LEFT'];break;}}[_0x3d5d32(0x619)](){const _0x2cd1ee={_0x269925:0xa63,_0x1ec363:0xd8c},_0x12d915=_0x3d5d32;if(!this[_0x12d915(_0x2cd1ee._0x269925)])return;this[_0x12d915(_0x2cd1ee._0x1ec363)]=RoamType['DIRECTION_NONE'];}['_onClockTick'](_0x5ec425){const _0x548a2e={_0x26fbb7:0x81b,_0x2b9789:0xd8c,_0x27f222:0xd8c,_0x1b4420:0x991,_0xf9eb:0x1d1,_0xa38b56:0x1d1,_0x232a0c:0xff3,_0x4909d1:0x5ac,_0x2a96fe:0x46c,_0x5a4895:0x83e,_0x5d6185:0x435,_0x4fe4e5:0xe39,_0x884312:0x952},_0x5eff0e=_0x3d5d32;if(!this['enabled'])return;const _0x621ce2=_0x5ec425['_clockStep'];this[_0x5eff0e(_0x548a2e._0x26fbb7)]&&this['_changeHeadingPitch'](_0x621ce2);if(this[_0x5eff0e(_0x548a2e._0x2b9789)]===RoamType['DIRECTION_NONE'])return;const _0x42fa53=this[_0x5eff0e(0x85c)]*_0x621ce2;if(this[_0x5eff0e(_0x548a2e._0x27f222)]===RoamType[_0x5eff0e(_0x548a2e._0x1b4420)])Cesium__namespace['Cartesian3']['multiplyByScalar'](this['_map']['camera']['direction'],0x1,scratchCurrentDirection);else{if(this['_direction']===RoamType['DIRECTION_BACKWARD'])Cesium__namespace['Cartesian3']['multiplyByScalar'](this[_0x5eff0e(_0x548a2e._0xf9eb)]['camera']['direction'],-0x1,scratchCurrentDirection);else{if(this['_direction']===RoamType['DIRECTION_LEFT'])Cesium__namespace['Cartesian3']['multiplyByScalar'](this[_0x5eff0e(_0x548a2e._0xa38b56)]['camera']['right'],-0x1,scratchCurrentDirection);else this['_direction']===RoamType['DIRECTION_RIGHT']&&Cesium__namespace['Cartesian3']['multiplyByScalar'](this['_map']['camera']['right'],0x1,scratchCurrentDirection);}}Cesium__namespace['Cartesian3']['multiplyByScalar'](scratchCurrentDirection,_0x42fa53,scratchDeltaPosition);const _0x550ce7=this[_0x5eff0e(_0x548a2e._0xf9eb)]['camera'][_0x5eff0e(0xb69)];Cesium__namespace['Cartesian3'][_0x5eff0e(_0x548a2e._0x232a0c)](_0x550ce7,scratchDeltaPosition,scratchNextPosition);const _0x58f8b4=this['_map']['scene']['globe'],_0xcb4b26=_0x58f8b4[_0x5eff0e(_0x548a2e._0x4909d1)];_0xcb4b26['cartesianToCartographic'](scratchNextPosition,scratchNextCartographic);const _0x3e68b3=_0x58f8b4[_0x5eff0e(_0x548a2e._0x2a96fe)](scratchNextCartographic);if(_0x3e68b3===undefined)return;scratchNextCartographic[_0x5eff0e(0x83e)]=_0x3e68b3+this[_0x5eff0e(_0x548a2e._0x5a4895)],_0xcb4b26['cartographicToCartesian'](scratchNextCartographic,scratchTerrainConsideredNextPosition),this[_0x5eff0e(0x1d1)][_0x5eff0e(_0x548a2e._0x5d6185)]['setView']({'destination':scratchTerrainConsideredNextPosition,'orientation':new Cesium__namespace['HeadingPitchRoll'](this[_0x5eff0e(_0x548a2e._0xf9eb)]['camera'][_0x5eff0e(_0x548a2e._0x4fe4e5)],this['_map']['camera'][_0x5eff0e(0x5cf)],this['_map']['camera'][_0x5eff0e(_0x548a2e._0x884312)]),'endTransform':Cesium__namespace['Matrix4'][_0x5eff0e(0x49b)]});}['_changeHeadingPitch'](_0x278a5d){const _0x378f6f={_0x36b032:0x1d1,_0x3e37ec:0x69b,_0x14472a:0x7a1,_0x5aa400:0x435,_0x5e7479:0xb93,_0x7f3c3c:0xb93},_0x2d5f70=_0x3d5d32,_0x16a621=this['_map']['canvas']['clientWidth'],_0x3b776d=this[_0x2d5f70(_0x378f6f._0x36b032)]['canvas']['clientHeight'],_0x4e4258=(this['_mousePosition']['x']-this['_startMousePosition']['x'])/_0x16a621,_0x598331=-(this[_0x2d5f70(_0x378f6f._0x3e37ec)]['y']-this[_0x2d5f70(_0x378f6f._0x14472a)]['y'])/_0x3b776d,_0x96503c=Cesium__namespace['Math']['toDegrees'](this['_map'][_0x2d5f70(_0x378f6f._0x5aa400)]['heading']),_0x218da2=_0x4e4258*this['rotateSpeed'],_0x4cfc86=_0x96503c+_0x218da2,_0x12cb1c=Cesium__namespace[_0x2d5f70(0x103e)][_0x2d5f70(0xa1f)](this['_map']['camera']['pitch']),_0x2e4cee=_0x598331*this['rotateSpeed'];let _0xa24998=_0x12cb1c+_0x2e4cee;_0xa24998>this['maxPitch']*0x2&&_0xa24998<0x168-this['maxPitch']?_0xa24998=0x168-this['maxPitch']:_0xa24998>this[_0x2d5f70(_0x378f6f._0x5e7479)]&&_0xa24998<0x168-this[_0x2d5f70(_0x378f6f._0x7f3c3c)]&&(_0xa24998=this['maxPitch']),this[_0x2d5f70(0x1d1)][_0x2d5f70(0x435)]['setView']({'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x4cfc86),'pitch':Cesium__namespace['Math']['toRadians'](_0xa24998),'roll':this['_map'][_0x2d5f70(0x435)]['roll']}});}['_enableScreenSpaceCameraController'](_0x352944){const _0x5f1073={_0x4bb226:0xccc,_0x531099:0xccc},_0x1f36af=_0x3d5d32,_0x184375=this['_map']['scene'];_0x184375['screenSpaceCameraController']['enableRotate']=_0x352944,_0x184375['screenSpaceCameraController']['enableTranslate']=_0x352944,_0x184375['screenSpaceCameraController']['enableZoom']=_0x352944,_0x184375[_0x1f36af(_0x5f1073._0x4bb226)]['enableTilt']=_0x352944,_0x184375[_0x1f36af(_0x5f1073._0x531099)][_0x1f36af(0x8c9)]=_0x352944;}[_0x3d5d32(0x390)](){const _0x20bffd={_0x4f4f2a:0x435,_0x3e1756:0x435},_0x383ffa=_0x3d5d32;this['_enabled']=!![],this['_enableScreenSpaceCameraController'](![]);const _0x3c51e3=this['_map'][_0x383ffa(_0x20bffd._0x4f4f2a)]['position'],_0x57f811=new Cesium__namespace[(_0x383ffa(0x220))](),_0x3396b6=this['_map']['scene']['globe'];_0x3396b6['ellipsoid']['cartesianToCartographic'](_0x3c51e3,_0x57f811);const _0x5b141f=_0x3396b6['getHeight'](_0x57f811);if(_0x5b141f===undefined)return![];_0x57f811['height']=_0x5b141f+this['height'];const _0x4b14b1=new Cesium__namespace['Cartesian3']();_0x3396b6['ellipsoid'][_0x383ffa(0x20f)](_0x57f811,_0x4b14b1);const _0x15a136=this['_map'][_0x383ffa(_0x20bffd._0x4f4f2a)]['heading'];return this['_heading']=_0x15a136,this['_map'][_0x383ffa(_0x20bffd._0x3e1756)]['flyTo']({'destination':_0x4b14b1,'orientation':{'heading':_0x15a136,'pitch':Cesium__namespace['Math']['toRadians'](0x0),'roll':0x0}}),!![];}['disable'](){this['_enabled']=![],this['_enableScreenSpaceCameraController'](!![]);}['startAutoForward'](){const _0x27d63a={_0x43f021:0xa63,_0x26e2ce:0x991},_0x5652a9=_0x3d5d32;!this[_0x5652a9(_0x27d63a._0x43f021)]&&this['activate'](),this['_direction']=RoamType[_0x5652a9(_0x27d63a._0x26e2ce)];}['stopAutoForward'](){this['_direction']=RoamType['DIRECTION_NONE'];}}class RotatePoint extends BaseThing{constructor(_0x5ea71f={}){const _0x528933={_0x18fe8d:0x433,_0xe13929:0x433},_0x25204d=_0x3d5d32;super(_0x5ea71f),this['_direction']=this[_0x25204d(_0x528933._0x18fe8d)][_0x25204d(0xe36)]?0x1:-0x1,this['_angle']=0x168/(0x3c*(this[_0x25204d(_0x528933._0xe13929)]['time']||0x3c)),this['_autoStopAngle']=this[_0x25204d(_0x528933._0x18fe8d)]['autoStopAngle'];}get[_0x3d5d32(0x37d)](){return this['_isStart'];}['_enabledHook'](_0x391efc){_0x391efc?this['start']():this['stop']();}[_0x3d5d32(0xe4c)](){}['_addedHook'](){const _0x6df488=_0x3d5d32;this['_map']['on'](EventType['mouseDown'],this['_map_mouseDownHandler'],this),this[_0x6df488(0x1d1)]['on'](EventType['mouseUp'],this['_map_mouseUpHandler'],this),this['_mouseDown']=![];}['_map_mouseDownHandler'](_0x18871c){this['_mouseDown']=!![];}['_map_mouseUpHandler'](_0x3d0697){const _0x400f87={_0x5d97f6:0x554,_0x230022:0x3f2,_0x4bc424:0xe5e},_0xce40d2=_0x3d5d32;this[_0xce40d2(_0x400f87._0x5d97f6)]=![];const _0x571d21=this[_0xce40d2(0x1d1)][_0xce40d2(_0x400f87._0x230022)]();if(!_0x571d21||_0x571d21[_0xce40d2(0xd29)]>0x7a120)return;this['_tikRender']=0x0,this['_center']=_0x571d21['toCartesian'](),this['_startHeading']=this['_map'][_0xce40d2(0x435)]['heading'],this[_0xce40d2(0xefb)]=this['_map'][_0xce40d2(0x435)]['pitch'],this['_distance']=Cesium__namespace[_0xce40d2(0xe95)]['distance'](this[_0xce40d2(_0x400f87._0x4bc424)],this['_map']['camera']['positionWC']);}['_removedHook'](){const _0x38bc42={_0x17f85d:0x1d1,_0x5a6c12:0x2f9,_0x596748:0x102f,_0xcca615:0x886},_0x4ffff3=_0x3d5d32;this[_0x4ffff3(_0x38bc42._0x17f85d)]['off'](EventType[_0x4ffff3(0x5e0)],this['_map_mouseDownHandler'],this),this['_map'][_0x4ffff3(0x9e7)](EventType[_0x4ffff3(_0x38bc42._0x5a6c12)],this[_0x4ffff3(_0x38bc42._0x596748)],this),this[_0x4ffff3(_0x38bc42._0xcca615)]();}['start'](_0x341c7e){const _0xbead67={_0xd84f54:0xce3,_0xd1005c:0xbd7,_0x4b8924:0xefb,_0x1ad893:0x1d1},_0x39fef7={_0x51ad19:0x1d1},_0x545ef4=_0x3d5d32;var _0x31b403;this['_isStart']&&this['stop']();this[_0x545ef4(0x7c6)]=!![];const _0x5f51a7=(_0x31b403=this['_map']['getCenter']())===null||_0x31b403===void 0x0?void 0x0:_0x31b403['toCartesian']();if(!_0x341c7e)this['_center']=_0x5f51a7;else _0x341c7e instanceof Cesium__namespace['Cartesian3']?this['_center']=_0x341c7e:this['_center']=LngLatPoint[_0x545ef4(_0xbead67._0xd84f54)](_0x341c7e)['toCartesian']();this['_distance']=this['options'][_0x545ef4(_0xbead67._0xd1005c)]||Cesium__namespace['Cartesian3'][_0x545ef4(0xbd7)](this['_center'],this['_map']['camera']['positionWC']),this[_0x545ef4(0xbae)]=this['_map']['camera']['heading'],this[_0x545ef4(_0xbead67._0x4b8924)]=this['_map']['camera']['pitch'];let _0x17a413=0x2;Cesium__namespace['Cartesian3']['distance'](_0x5f51a7,this[_0x545ef4(0xe5e)]){const _0x5c05a2=_0x545ef4;this['_isStart']=!![],this['_tikRender']=0x0,this[_0x5c05a2(_0x39fef7._0x51ad19)]['on'](EventType['preRender'],this['_onPreRenderHandler'],this);}});}[_0x3d5d32(0x6a4)](_0x21a5f4){const _0x32315c={_0x3e84f2:0xd8c,_0x32def3:0x435},_0x1b827c=_0x3d5d32;if(this[_0x1b827c(0x554)])return;this['_tikRender']++;const _0x4c9437=this[_0x1b827c(0x797)]*this['_angle'];this['_autoStopAngle']&&_0x4c9437>=this['_autoStopAngle']&&this['stop']();const _0x5e8b4a=Cesium__namespace['Math']['toRadians'](_0x4c9437*this[_0x1b827c(_0x32315c._0x3e84f2)])+this[_0x1b827c(0xbae)];this['_map']['scene'][_0x1b827c(_0x32315c._0x32def3)]['setView']({'destination':this['_center'],'orientation':{'heading':_0x5e8b4a,'pitch':this['_startPitch']}}),this['_map']['scene'][_0x1b827c(_0x32315c._0x32def3)]['moveBackward'](this['_distance']),this[_0x1b827c(0xefc)](EventType[_0x1b827c(0x73d)]);}[_0x3d5d32(0x886)](){const _0x254d3f=_0x3d5d32;if(!this['_isStart'])return;this[_0x254d3f(0x7c6)]=![],this['_map']['off'](EventType[_0x254d3f(0x90a)],this[_0x254d3f(0x6a4)],this),this[_0x254d3f(0xefc)](EventType['stop']);}}const MAX_PITCH_IN_DEGREE=0x58;class StreetView extends BaseThing{constructor(_0x51d1eb={}){const _0x31a3c6={_0x39adbb:0xd10},_0x37f94d=_0x3d5d32;super(_0x51d1eb),this[_0x37f94d(0xe45)]=_0x51d1eb['rotateSpeed']??0x1e,this[_0x37f94d(0x3fe)]=_0x51d1eb['heightStep']??0.2,this[_0x37f94d(_0x31a3c6._0x39adbb)]=_0x51d1eb[_0x37f94d(_0x31a3c6._0x39adbb)]??0.1;}[_0x3d5d32(0xacd)](_0x50ff49){const _0x139c3e={_0x1be63b:0xeb4,_0x5bc115:0x96a,_0x4b7d36:0xbcc,_0x3ea3f7:0x1d1},_0x2ef7ce=_0x3d5d32;this['_map']['mouseZoom']&&(this['_map']['mouseZoom'][_0x2ef7ce(0xa63)]=!_0x50ff49),_0x50ff49?(this[_0x2ef7ce(0xbcc)]=this['_map']['scene']['screenSpaceCameraController'][_0x2ef7ce(0x1ce)],this[_0x2ef7ce(_0x139c3e._0x1be63b)]=this[_0x2ef7ce(0x1d1)]['scene']['screenSpaceCameraController']['tiltEventTypes'],this['_map']['scene'][_0x2ef7ce(0xccc)]['zoomEventTypes']=[Cesium__namespace['CameraEventType']['WHEEL'],Cesium__namespace['CameraEventType'][_0x2ef7ce(0x919)],{'eventType':Cesium__namespace['CameraEventType']['RIGHT_DRAG'],'modifier':Cesium__namespace[_0x2ef7ce(0xcb5)][_0x2ef7ce(0x96a)]}],this[_0x2ef7ce(0x1d1)]['scene'][_0x2ef7ce(0xccc)]['tiltEventTypes']=[{'eventType':Cesium__namespace[_0x2ef7ce(0x605)]['MIDDLE_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier'][_0x2ef7ce(_0x139c3e._0x5bc115)]}]):(this['_default_zoomEventTypes']&&(this['_map']['scene']['screenSpaceCameraController']['zoomEventTypes']=this[_0x2ef7ce(_0x139c3e._0x4b7d36)],delete this['_default_zoomEventTypes']),this[_0x2ef7ce(0xeb4)]&&(this[_0x2ef7ce(_0x139c3e._0x3ea3f7)]['scene']['screenSpaceCameraController']['tiltEventTypes']=this['_default_tiltEventTypes'],delete this['_default_tiltEventTypes']));}['_mountedHook'](){}['_addedHook'](){const _0x566cf3=_0x3d5d32;this[_0x566cf3(0xacd)](this['enabled']),this['_map']['on'](EventType['rightDown'],this['_onRightDownHandler'],this),this['_map']['on'](EventType[_0x566cf3(0x314)],this['_onMouseMove'],this),this['_map']['on'](EventType[_0x566cf3(0x37a)],this['_onRightUpHandler'],this),this[_0x566cf3(0x1d1)]['on'](EventType[_0x566cf3(0x572)],this['_onMiddleDownHandler'],this),this[_0x566cf3(0x1d1)]['on'](EventType['middleUp'],this['_onMiddleUpHandler'],this),this['_map']['on'](EventType['click'],this['_onClickHandler'],this),this['_map']['on'](EventType['dblClick'],this['_onDbClickHandler'],this),this[_0x566cf3(0x1d1)]['on'](EventType['rightClick'],this['_onRightClickHandler'],this);}['_removedHook'](){const _0x2fd45b={_0x494ca8:0xacd,_0x44ed24:0x9e7,_0x57cad7:0x572,_0x3e3a62:0x1d1,_0x4494c2:0xa4d},_0x78cd09=_0x3d5d32;this[_0x78cd09(_0x2fd45b._0x494ca8)](![]),this['_map']['off'](EventType[_0x78cd09(0x1d9)],this['_onRightDownHandler'],this),this['_map'][_0x78cd09(_0x2fd45b._0x44ed24)](EventType['mouseMove'],this[_0x78cd09(0x9a6)],this),this['_map']['off'](EventType[_0x78cd09(0x37a)],this['_onRightUpHandler'],this),this['_map']['off'](EventType[_0x78cd09(_0x2fd45b._0x57cad7)],this['_onMiddleDownHandler'],this),this['_map'][_0x78cd09(_0x2fd45b._0x44ed24)](EventType['middleUp'],this['_onMiddleUpHandler'],this),this[_0x78cd09(_0x2fd45b._0x3e3a62)]['off'](EventType[_0x78cd09(0xb59)],this['_onClickHandler'],this),this[_0x78cd09(_0x2fd45b._0x3e3a62)]['off'](EventType['dblClick'],this['_onDbClickHandler'],this),this['_map']['off'](EventType['rightClick'],this['_onRightClickHandler'],this),this[_0x78cd09(_0x2fd45b._0x4494c2)]&&(this['_map']['removeThing'](this[_0x78cd09(0xa4d)],!![]),delete this[_0x78cd09(0xa4d)]);}['_onRightDownHandler'](_0x251796){const _0xd26a05={_0x1622a1:0x886,_0x5a0ea0:0x69b,_0x5ad85d:0x1d1,_0x4bc0ff:0x435,_0xf62b34:0xa1f},_0x2ab9a7=_0x3d5d32;if(!this['enabled'])return;this['rotatePoint']&&this['rotatePoint'][_0x2ab9a7(_0xd26a05._0x1622a1)](),this['_isMouseLeftButtonPressed']=!![],this[_0x2ab9a7(_0xd26a05._0x5a0ea0)]=this['_startMousePosition']=Cesium__namespace['Cartesian3']['clone'](_0x251796[_0x2ab9a7(0xb69)]),this['_headingWhenLeftClicked']=Cesium__namespace['Math']['toDegrees'](this[_0x2ab9a7(_0xd26a05._0x5ad85d)][_0x2ab9a7(_0xd26a05._0x4bc0ff)]['heading']),this['_pitchWhenLeftClicked']=Cesium__namespace['Math'][_0x2ab9a7(_0xd26a05._0xf62b34)](this['_map']['camera']['pitch']);}['_onMouseMove'](_0x11a38b){const _0x1f8136={_0x5a0e34:0xa63,_0x33f689:0x69b,_0x1779ce:0x60f,_0x1328f6:0xe0f,_0x175df4:0xc7c,_0x1a5dd5:0x103e,_0x559daf:0xe45,_0x35200b:0x435,_0x292d60:0x562,_0x4d6b76:0x952,_0x421de3:0x1d1},_0x1395e2=_0x3d5d32;if(!this[_0x1395e2(_0x1f8136._0x5a0e34)])return;this[_0x1395e2(_0x1f8136._0x33f689)]=_0x11a38b['endPosition'];if(this['_isMouseLeftButtonPressed']){const _0x2e2841=this[_0x1395e2(0x1d1)][_0x1395e2(_0x1f8136._0x1779ce)][_0x1395e2(_0x1f8136._0x1328f6)],_0xc8ec03=this['_map'][_0x1395e2(_0x1f8136._0x1779ce)]['clientHeight'],_0x33b55a=(this['_mousePosition']['x']-this['_startMousePosition']['x'])/_0x2e2841,_0x102705=-(this['_mousePosition']['y']-this['_startMousePosition']['y'])/_0xc8ec03;if(Cesium__namespace['Math']['equalsEpsilon'](_0x33b55a,0x0,Cesium__namespace['Math'][_0x1395e2(_0x1f8136._0x175df4)])&&Cesium__namespace[_0x1395e2(_0x1f8136._0x1a5dd5)]['equalsEpsilon'](_0x102705,0x0,Cesium__namespace['Math']['EPSILON6']))return;const _0x2e4523=_0x33b55a*this[_0x1395e2(_0x1f8136._0x559daf)],_0x15f86b=this['_headingWhenLeftClicked']+_0x2e4523,_0xd92f37=_0x102705*this['rotateSpeed'];let _0x212f5f=this['_pitchWhenLeftClicked']+_0xd92f37;_0x212f5f>MAX_PITCH_IN_DEGREE*0x2&&_0x212f5f<0x168-MAX_PITCH_IN_DEGREE?_0x212f5f=0x168-MAX_PITCH_IN_DEGREE:_0x212f5f>MAX_PITCH_IN_DEGREE&&_0x212f5f<0x168-MAX_PITCH_IN_DEGREE&&(_0x212f5f=MAX_PITCH_IN_DEGREE),this['_map'][_0x1395e2(_0x1f8136._0x35200b)]['setView']({'orientation':{'heading':Cesium__namespace[_0x1395e2(0x103e)][_0x1395e2(_0x1f8136._0x292d60)](_0x15f86b),'pitch':Cesium__namespace['Math']['toRadians'](_0x212f5f),'roll':this['_map']['camera'][_0x1395e2(_0x1f8136._0x4d6b76)]}});}else{if(this['_isMouseUpdownPressed']){const _0x13c1b7=-(this['_mousePosition']['y']-this['_startMousePosition']['y'])/this[_0x1395e2(_0x1f8136._0x421de3)][_0x1395e2(0x60f)]['clientHeight'],_0x5c7ca4=this[_0x1395e2(0x1d1)]['camera']['positionCartographic']['height']*this['heightStep'];this['_map']['camera']['moveDown'](_0x13c1b7*_0x5c7ca4);}}}[_0x3d5d32(0xf93)](_0x1c2853){this['_isMouseLeftButtonPressed']=![];}[_0x3d5d32(0xbe5)](_0x14fe5d){const _0x31ca30={_0x195237:0x69b},_0x449d24=_0x3d5d32;if(!this['enabled'])return;this[_0x449d24(0xa4d)]&&this['rotatePoint'][_0x449d24(0x886)](),this['_isMouseUpdownPressed']=!![],this['_startMousePosition']=Cesium__namespace['Cartesian3']['clone'](_0x14fe5d['position']),this[_0x449d24(_0x31ca30._0x195237)]=this['_startMousePosition'];}['_onMiddleUpHandler'](_0x261743){this['_isMouseUpdownPressed']=![];}['_onClickHandler'](_0x2762a0){if(!this['enabled'])return;this['rotatePoint']&&this['rotatePoint']['stop']();}[_0x3d5d32(0xc7b)](_0x3258af){const _0x235557={_0x6e911f:0x1d1},_0x411946=_0x3d5d32;if(!this['enabled'])return;this['rotatePoint']&&this['rotatePoint'][_0x411946(0x886)]();const _0x59a7e7=getCurrentMousePosition(this[_0x411946(0x1d1)]['scene'],_0x3258af['position']);if(_0x59a7e7){const _0x4acb72=Cesium__namespace[_0x411946(0xe95)]['distance'](_0x59a7e7,this['_map']['camera']['positionWC'])*this['moveStep'];this[_0x411946(_0x235557._0x6e911f)]['flyToPoint'](_0x59a7e7,{'radius':_0x4acb72,'maximumHeight':this['_map']['camera']['positionCartographic']['height'],'duration':this['options']['moveDuration']});}}[_0x3d5d32(0x1df)](_0x474548){const _0x150928={_0x5ac9b1:0x1d1,_0x35569b:0xa4d},_0x4a66be=_0x3d5d32;if(!this['enabled'])return;if(this[_0x4a66be(0x5d6)]){const _0x3dc299=Cesium__namespace['JulianDate']['secondsDifference'](this['_map']['clock']['currentTime'],this['time']);_0x3dc299<0.5&&(this[_0x4a66be(_0x150928._0x5ac9b1)]['closeContextMenu'](),!this['rotatePoint']&&(this['rotatePoint']=new RotatePoint(this[_0x4a66be(0x433)]['rotatePoint']),this['_map']['addThing'](this[_0x4a66be(_0x150928._0x35569b)])),this['rotatePoint'][_0x4a66be(0xf6d)](_0x474548['cartesian']));}this['time']=this['_map']['clock']['currentTime'][_0x4a66be(0x315)]();}}class CameraHistory extends BaseThing{constructor(_0x9720b0={}){const _0x93c14a={_0x10ab14:0xef3},_0x3576cd=_0x3d5d32;super(_0x9720b0),this['step']=0x0,this[_0x3576cd(_0x93c14a._0x10ab14)]=[],this['maxCacheCount']=this[_0x3576cd(0x433)]['maxCacheCount']??0x63;}get[_0x3d5d32(0xaf5)](){return this['options']['limit']&&this['options']['limit']['debugExtent'];}set['debugExtent'](_0x4ba61a){const _0x703933={_0x117a02:0x7d9,_0x3748b9:0xb69,_0x9341a4:0xea8,_0x3a6ecc:0xa16},_0x1e0f63=_0x3d5d32;if(!this['options'][_0x1e0f63(0x7d9)])return;this['options']['limit']['debugExtent']=_0x4ba61a;if(!this[_0x1e0f63(0xa16)]){const _0x1360f8=this['options']['limit']['radius'],_0x162c74=this[_0x1e0f63(0x433)][_0x1e0f63(_0x703933._0x117a02)][_0x1e0f63(_0x703933._0x3748b9)];this['debugExtentEntity']=this['_map'][_0x1e0f63(_0x703933._0x9341a4)][_0x1e0f63(0xff3)]({'name':_0x1e0f63(0x5eb),'position':_0x162c74,'ellipsoid':{'radii':new Cesium__namespace['Cartesian3'](_0x1360f8,_0x1360f8,_0x1360f8),'maximumCone':Cesium__namespace['Math']['PI_OVER_TWO'],'slicePartitions':0x2d,'stackPartitions':0x2d,'material':new Cesium__namespace['Color'](0x0,0x1,0x1,0x0),'outline':!![],'outlineColor':new Cesium__namespace['Color'](0x0,0x1,0x1,0x1)}});}this[_0x1e0f63(_0x703933._0x3a6ecc)]['show']=_0x4ba61a;}['_mountedHook'](){const _0x42a14f={_0x394507:0x433,_0x4da822:0x433,_0x41ecc1:0xaf5},_0x332fbb=_0x3d5d32;this[_0x332fbb(_0x42a14f._0x394507)]['limit']&&this[_0x332fbb(_0x42a14f._0x394507)]['limit']['debugExtent']&&(this['debugExtent']=this[_0x332fbb(_0x42a14f._0x4da822)]['limit'][_0x332fbb(_0x42a14f._0x41ecc1)]),this['_limitGlobe']();}[_0x3d5d32(0x226)](){const _0x4e50c5=_0x3d5d32;this['_map']['on'](EventType['cameraMoveStart'],this[_0x4e50c5(0x708)],this),this['_map']['on'](EventType[_0x4e50c5(0x2dc)],this['_cameraMoveEndHandler'],this);}['_removedHook'](){const _0x273cb3={_0x4ddc57:0x1d1},_0x501bd1=_0x3d5d32;this[_0x501bd1(_0x273cb3._0x4ddc57)]['off'](EventType[_0x501bd1(0x42f)],this[_0x501bd1(0x708)],this),this[_0x501bd1(0x1d1)]['off'](EventType['cameraMoveEnd'],this['_cameraMoveEndHandler'],this),this['views']=[],this['debugExtentEntity']&&(this[_0x501bd1(0x1d1)]['entities']['remove'](this['debugExtentEntity']),delete this['debugExtentEntity']);}['_cameraMoveStartHandler'](){this['_map']&&(this['isInPush']=!![],this['lastCameraView']=this['_map']['getCameraView']());}['_cameraMoveEndHandler'](){const _0x1cecea=_0x3d5d32;this[_0x1cecea(0x636)]();if(!this['isInPush'])return;this['_addCameraView']();}['_limitGlobe'](){const _0x5a5218={_0x2e11da:0xd61,_0x2cc5fc:0xbd7,_0x51af21:0x1d1},_0x5915a6={_0x1b6960:0x4b1},_0x3b6c0b=_0x3d5d32;if(!this[_0x3b6c0b(0x433)]['limit'])return;const _0x1be426=this['options']['limit']['position'],_0x3aedf8=this['options']['limit'][_0x3b6c0b(_0x5a5218._0x2e11da)],_0x3310f6=Cesium__namespace['Cartesian3'][_0x3b6c0b(_0x5a5218._0x2cc5fc)](_0x1be426,this['_map']['camera']['position']);if(this['options']['limit'][_0x3b6c0b(0xaf5)]);if(_0x3310f6<=_0x3aedf8)return;this['isInPush']=![],this['lastCameraView']?this[_0x3b6c0b(0x1d1)][_0x3b6c0b(0xc53)](this[_0x3b6c0b(0x4b1)],{'duration':0.5,'complete':()=>{const _0x13dbe8=_0x3b6c0b;this[_0x13dbe8(_0x5915a6._0x1b6960)]=null,this['isInPush']=!![];}}):this[_0x3b6c0b(_0x5a5218._0x51af21)][_0x3b6c0b(0x629)](_0x1be426,{'radius':_0x3aedf8*0.6,'pitch':-0x3c,'duration':0.5,'complete':()=>{const _0x2147b5=_0x3b6c0b;this[_0x2147b5(0x4b1)]=null,this['isInPush']=!![];}});}['_addCameraView'](){const _0x4bb0ec={_0x571d1c:0x1d1,_0x1a1fa6:0xc84,_0x11bdd1:0x7d5},_0x20e5e7=_0x3d5d32,_0x53dbbb=this[_0x20e5e7(_0x4bb0ec._0x571d1c)]['getCameraView']();this[_0x20e5e7(0xef3)]['push'](_0x53dbbb),this['views']['length']>this[_0x20e5e7(0x202)]&&this['views']['splice'](0x0,0x1),this[_0x20e5e7(0x7d5)]=this['views'][_0x20e5e7(_0x4bb0ec._0x1a1fa6)]-0x1,this['fire'](EventType['change'],{'index':this[_0x20e5e7(_0x4bb0ec._0x11bdd1)],'count':this['views']['length']});}['_goHistoryView'](){const _0x32b24c={_0x37e750:0x1d1,_0x56703a:0xd42,_0x5bb53d:0x64d,_0x34fe14:0x1d1},_0x4515f4={_0x1630a6:0x1d1,_0x564ab6:0x34f,_0x528a17:0x708,_0xc81ed:0xc84},_0xe1bb32=_0x3d5d32;this[_0xe1bb32(_0x32b24c._0x37e750)]['camera']['moveStart'][_0xe1bb32(_0x32b24c._0x56703a)](this['_cameraMoveStartHandler'],this),this['_map']['camera'][_0xe1bb32(_0x32b24c._0x5bb53d)]['removeEventListener'](this['_cameraMoveEndHandler'],this),this['isInPush']=![],this[_0xe1bb32(_0x32b24c._0x34fe14)]['setCameraView'](this['views'][this['step']],{'complete':()=>{const _0x167ff6=_0xe1bb32;this[_0x167ff6(_0x4515f4._0x1630a6)]['camera']['moveStart'][_0x167ff6(_0x4515f4._0x564ab6)](this[_0x167ff6(_0x4515f4._0x528a17)],this),this['_map'][_0x167ff6(0x435)]['moveEnd'][_0x167ff6(0x34f)](this['_cameraMoveEndHandler'],this),this['fire'](EventType['change'],{'index':this['step'],'count':this['views'][_0x167ff6(_0x4515f4._0xc81ed)]});}});}['goNext'](){const _0x4064d3={_0xfc6df4:0x7d5,_0x3ee2b0:0xef3,_0x5011b2:0xbc7},_0x52622e=_0x3d5d32;return this[_0x52622e(_0x4064d3._0xfc6df4)]>=this[_0x52622e(_0x4064d3._0x3ee2b0)]['length']-0x1?![]:(this[_0x52622e(0x7d5)]++,this[_0x52622e(_0x4064d3._0x5011b2)](),!![]);}['goLast'](){const _0x238a78=_0x3d5d32;return this[_0x238a78(0x7d5)]<=0x0?![]:(this['step']--,this['_goHistoryView'](),!![]);}['goNow'](){const _0x3265ae=_0x3d5d32;return this['step']===this[_0x3265ae(0xef3)][_0x3265ae(0xc84)]-0x1?![]:(this['step']=this['views']['length']-0x1,this['_goHistoryView'](),!![]);}['goFirst'](){const _0x241118=_0x3d5d32;return this[_0x241118(0x7d5)]<=0x0?![]:(this['step']=0x0,this['_goHistoryView'](),!![]);}}class RotateOut extends BaseThing{constructor(_0x3aa81f={}){const _0x132646={_0x691696:0x433,_0x3fa72c:0x5d6,_0x2e5b0d:0x433},_0x49c390=_0x3d5d32;super(_0x3aa81f),this['_angle']=0x168/(0x3c*this[_0x49c390(_0x132646._0x691696)][_0x49c390(_0x132646._0x3fa72c)]||0x3c),this['_direction']=this[_0x49c390(_0x132646._0x2e5b0d)]['direction']?-0x1:0x1,this['_autoStopAngle']=this[_0x49c390(0x433)]['autoStopAngle'];}get['isStart'](){const _0x2ed6ca=_0x3d5d32;return this[_0x2ed6ca(0x7c6)];}['_enabledHook'](_0x493840){_0x493840?this['start']():this['stop']();}['_mountedHook'](){}['_addedHook'](){}['_removedHook'](){this['stop']();}['start'](){const _0x16d319={_0x3f6038:0xe39,_0x7dd291:0xefb,_0x30fdaf:0x5cf,_0x4149b4:0x90a,_0x391937:0xefc},_0x5b0b2f=_0x3d5d32;this['_isStart']&&this['stop'](),this['_isStart']=!![],this['_tikRender']=0x0,this['_startHeading']=this['_map'][_0x5b0b2f(0x435)][_0x5b0b2f(_0x16d319._0x3f6038)],this[_0x5b0b2f(_0x16d319._0x7dd291)]=this['_map']['camera'][_0x5b0b2f(_0x16d319._0x30fdaf)],this['_map']['on'](EventType[_0x5b0b2f(_0x16d319._0x4149b4)],this['_onPreRenderHandler'],this),this[_0x5b0b2f(_0x16d319._0x391937)](EventType['start']);}['_onPreRenderHandler'](_0x53484c){const _0x44a28f={_0x46ef7a:0x797,_0x6f41d4:0xd46,_0x403a78:0xd46,_0x483e51:0xbae},_0x383c46=_0x3d5d32;this[_0x383c46(_0x44a28f._0x46ef7a)]++;const _0x3c0028=this['_tikRender']*this[_0x383c46(0x412)];this[_0x383c46(_0x44a28f._0x6f41d4)]&&_0x3c0028>=this[_0x383c46(_0x44a28f._0x403a78)]&&this['stop']();const _0x2b0e10=Cesium__namespace['Math']['toRadians'](_0x3c0028*this['_direction'])+this[_0x383c46(_0x44a28f._0x483e51)];this['_map']['scene']['camera']['setView']({'orientation':{'heading':_0x2b0e10,'pitch':this['_startPitch']}}),this['fire'](EventType['change']);}['stop'](){const _0x2e5052={_0x569609:0x7c6,_0x55f864:0x1d1,_0x1af962:0x90a},_0x351427=_0x3d5d32;if(!this[_0x351427(0x7c6)])return;this[_0x351427(_0x2e5052._0x569609)]=![],this[_0x351427(_0x2e5052._0x55f864)]['off'](EventType[_0x351427(_0x2e5052._0x1af962)],this['_onPreRenderHandler'],this),this['fire'](EventType['stop']);}}const PointEditElementColors={'X_TRANSLATION_COLOR':Cesium__namespace['Color'][_0x3d5d32(0xcab)][_0x3d5d32(0xe57)](0.6),'Y_TRANSLATION_COLOR':Cesium__namespace['Color']['GREEN']['withAlpha'](0.6),'Z_TRANSLATION_COLOR':Cesium__namespace[_0x3d5d32(0x882)]['BLUE']['withAlpha'](0.6),'XY_TRANSLATION_COLOR':Cesium__namespace['Color']['BLUE'][_0x3d5d32(0xe57)](0.6),'YZ_TRANSLATION_COLOR':Cesium__namespace['Color'][_0x3d5d32(0xcab)]['withAlpha'](0.6),'XZ_TRANSLATION_COLOR':Cesium__namespace[_0x3d5d32(0x882)]['GREEN']['withAlpha'](0.6)},HighlightColor=Cesium__namespace[_0x3d5d32(0x882)]['YELLOW'];class MatrixMove2 extends BaseThing{constructor(_0x17192e={}){const _0x37382d={_0x5d84db:0xa99,_0x131987:0xde0,_0x32f049:0x501},_0x41af92=_0x3d5d32;super(_0x17192e),this['_pointEditElementIDs']={'X_TRANSLATION':this['id']+'_PointEdit_X_TRANSLATION','Y_TRANSLATION':this['id']+_0x41af92(_0x37382d._0x5d84db),'Z_TRANSLATION':this['id']+_0x41af92(0xb24),'XY_TRANSLATION':this['id']+_0x41af92(_0x37382d._0x131987),'YZ_TRANSLATION':this['id']+'_PointEdit_YZ_TRANSLATION','XZ_TRANSLATION':this['id']+'_PointEdit_XZ_TRANSLATION'},this['_hideFeatures']={'X_TRANSLATION':!![],'Y_TRANSLATION':!![],'Z_TRANSLATION':!![],'XY_TRANSLATION':!![],'XZ_TRANSLATION':!![],'YZ_TRANSLATION':!![]},this['_radius']=Cesium__namespace[_0x41af92(_0x37382d._0x32f049)](_0x17192e[_0x41af92(0xd61)],0x64),this[_0x41af92(0xde8)]=new Cesium__namespace['Matrix4'](),this['_isLeftDown']=![],this['_pickedId']='',this['_oldPickedId']='',this['_oldPickPrimitive']=undefined,_0x17192e['position']&&(this['position']=_0x17192e['position']);}get['position'](){return this['_position'];}set[_0x3d5d32(0xb69)](_0x388c05){const _0x479345={_0x2473ab:0xb62},_0x1686b6=_0x3d5d32;this['_position']=LngLatPoint['toCartesian'](_0x388c05),this['_editMatrix']=Cesium__namespace['Matrix4'][_0x1686b6(_0x479345._0x2473ab)](Cesium__namespace[_0x1686b6(0x5bb)]['eastNorthUpToFixedFrame'](this['_position']),this['_radius'],this[_0x1686b6(0xde8)]),this[_0x1686b6(0xc5c)]();}get[_0x3d5d32(0xd61)](){return this['_radius'];}set['radius'](_0x332a9e){const _0x1ae3db=_0x3d5d32;this['_radius']=_0x332a9e,this[_0x1ae3db(0xde8)]=Cesium__namespace['Matrix4']['multiplyByUniformScale'](Cesium__namespace[_0x1ae3db(0x5bb)]['eastNorthUpToFixedFrame'](this['_position']),this['_radius'],this['_editMatrix']),this['_createGraphics']();}get['isMoveing'](){const _0x16f9ac=_0x3d5d32;if(!this['_map'])return![];return this[_0x16f9ac(0xa70)];}['_enabledHook'](_0x5bb995){const _0x3198ba=_0x3d5d32;this['_drawLayer'][_0x3198ba(0x792)]=_0x5bb995,_0x5bb995?this['_bindEvent']():this[_0x3198ba(0x85a)]();}['_mountedHook'](){const _0x736b0c={_0x44dfca:0x792},_0x2753f4=_0x3d5d32;this['_drawLayer']=new Cesium__namespace['PrimitiveCollection'](),this['_drawLayer']['show']=this[_0x2753f4(_0x736b0c._0x44dfca)]??!![];}['_addedHook'](){const _0x52beeb={_0x58561c:0xc5c},_0xc1ebd=_0x3d5d32;this[_0xc1ebd(0x1d1)]['scene']['primitives'][_0xc1ebd(0xff3)](this[_0xc1ebd(0xb14)]),this[_0xc1ebd(_0x52beeb._0x58561c)](),this['_bindEvent']();}['_removedHook'](){const _0x325e8f={_0x390433:0x85a},_0x1e5322=_0x3d5d32;this[_0x1e5322(_0x325e8f._0x390433)](),this['_drawLayer']['removeAll'](),this['_map']['scene']['primitives']['remove'](this['_drawLayer']);}['_createGraphics'](){const _0x1c2c64={_0x12f7ca:0xf5d,_0x244d59:0xb14,_0x1d83f8:0xff3,_0x2c95d7:0x45a,_0x6c2bd2:0x612,_0x2c5e04:0xe95,_0x25a3c9:0x592,_0x80005f:0x499,_0x162027:0x70b,_0x21eb59:0x8e8},_0x208709=_0x3d5d32;if(!this['_drawLayer'])return;this['_drawLayer']['removeAll']();if(!this[_0x208709(0x87d)])return;const _0x46dc60=Cesium__namespace[_0x208709(_0x1c2c64._0x12f7ca)][_0x208709(0x315)](this['_editMatrix']);this['_hideFeatures']['X_TRANSLATION']&&this[_0x208709(_0x1c2c64._0x244d59)][_0x208709(_0x1c2c64._0x1d83f8)](createPolylinePrimitive({'positions':[Cesium__namespace['Cartesian3']['ZERO'],Cesium__namespace['Cartesian3']['UNIT_X']],'modelMatrix':_0x46dc60,'id':this['_pointEditElementIDs'][_0x208709(0xc40)],'color':PointEditElementColors[_0x208709(0x848)]})),this['_hideFeatures'][_0x208709(_0x1c2c64._0x2c95d7)]&&this['_drawLayer']['add'](createPolylinePrimitive({'positions':[Cesium__namespace['Cartesian3']['ZERO'],Cesium__namespace[_0x208709(0xe95)]['UNIT_Y']],'modelMatrix':_0x46dc60,'id':this['_pointEditElementIDs']['Y_TRANSLATION'],'color':PointEditElementColors[_0x208709(_0x1c2c64._0x6c2bd2)]})),this['_hideFeatures']['Z_TRANSLATION']&&this['_drawLayer'][_0x208709(0xff3)](createPolylinePrimitive({'positions':[Cesium__namespace['Cartesian3']['ZERO'],Cesium__namespace[_0x208709(_0x1c2c64._0x2c5e04)]['UNIT_Z']],'modelMatrix':_0x46dc60,'id':this[_0x208709(0x523)]['Z_TRANSLATION'],'color':PointEditElementColors[_0x208709(_0x1c2c64._0x25a3c9)]})),this['_hideFeatures']['XY_TRANSLATION']&&this['_drawLayer']['add'](createPlanePrimitive({'positions':[0.1,0.1,0x0,0.1,0.3,0x0,0.3,0.3,0x0,0.3,0.1,0x0],'normals':[0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1],'modelMatrix':_0x46dc60,'id':this['_pointEditElementIDs']['XY_TRANSLATION'],'color':PointEditElementColors['XY_TRANSLATION_COLOR']})),this['_hideFeatures'][_0x208709(_0x1c2c64._0x80005f)]&&this['_drawLayer']['add'](createPlanePrimitive({'positions':[0x0,0.1,0.1,0x0,0.1,0.3,0x0,0.3,0.3,0x0,0.3,0.1],'normals':[0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0],'modelMatrix':_0x46dc60,'id':this[_0x208709(0x523)]['YZ_TRANSLATION'],'color':PointEditElementColors[_0x208709(_0x1c2c64._0x162027)]})),this['_hideFeatures'][_0x208709(_0x1c2c64._0x21eb59)]&&this['_drawLayer']['add'](createPlanePrimitive({'positions':[0.1,0x0,0.1,0.1,0x0,0.3,0.3,0x0,0.3,0.3,0x0,0.1],'normals':[0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x1,0x0],'modelMatrix':_0x46dc60,'id':this['_pointEditElementIDs']['XZ_TRANSLATION'],'color':PointEditElementColors['XZ_TRANSLATION_COLOR']}));}['_bindEvent'](){const _0xb76921={_0x60826b:0x5a8,_0x507fb9:0x5a5,_0x3fb482:0xb84,_0x181e4b:0xb0e,_0x4834fb:0xd82,_0x3adbf0:0x60f,_0xe3bbab:0x87d,_0x18aa56:0xf5d,_0x5798b5:0x7ca,_0x2fc3d3:0x1d1,_0x8ab427:0xe8f},_0x41b3e2={_0x419092:0x1d1,_0x605f0e:0x27b},_0x36cfe9={_0x5d59b7:0xfc1},_0x2c2f5b=_0x3d5d32;this[_0x2c2f5b(0x85a)](),this[_0x2c2f5b(0x77c)]=new Cesium__namespace['ScreenSpaceEventHandler'](this['_map']['canvas']),this['_handler']['setInputAction'](_0x37153c=>{const _0x1a838a=_0x2c2f5b,_0x2cfd85=drillPickTransformHelperComponent(this[_0x1a838a(0x1d1)]['scene'],_0x37153c['position'],this['_pointEditElementIDs']);_0x2cfd85&&(this['_map'][_0x1a838a(_0x36cfe9._0x5d59b7)]['screenSpaceCameraController']['enableInputs']=![],this['_isLeftDown']=!![],this['_pickedId']=_0x2cfd85['id']);},Cesium__namespace['ScreenSpaceEventType']['LEFT_DOWN']),this['_handler']['setInputAction'](()=>{const _0x3ffbf2=_0x2c2f5b;this[_0x3ffbf2(_0x41b3e2._0x419092)]['scene']['screenSpaceCameraController'][_0x3ffbf2(_0x41b3e2._0x605f0e)]=!![],this['_isLeftDown']=![],this['_pickedId']='',Cesium__namespace['defined'](this['_oldPickedId'])&&this['_oldPickedId']!==''&&(setPointEditElementColorsForId(this['_oldPickedId'],getPointEditElementColorsForId(this['_oldPickedId'],this['_pointEditElementIDs']),this[_0x3ffbf2(0x523)]),this['_oldPickedId']='',this['_createGraphics']());},Cesium__namespace[_0x2c2f5b(0x2d7)]['LEFT_UP']),this['_handler']['setInputAction'](_0x1dc42e=>{const _0x4802c6=_0x2c2f5b;let _0x1e1f68=![];if(Cesium__namespace['defined'](this[_0x4802c6(_0xb76921._0x60826b)])){var _0x2dff34;const _0x59a1fe=(_0x2dff34=this['_oldPickPrimitive'])===null||_0x2dff34===void 0x0?void 0x0:_0x2dff34['_instanceIds'];if(_0x59a1fe&&_0x59a1fe[0x0]){const _0x1d4a53=this['_oldPickPrimitive']['appearance']['material']['uniforms'];_0x1d4a53['color']=getPointEditElementColorsForId(_0x59a1fe[0x0],this['_pointEditElementIDs']),this['_oldPickPrimitive']=undefined;}}if(this[_0x4802c6(_0xb76921._0x507fb9)]){Cesium__namespace[_0x4802c6(_0xb76921._0x3fb482)](this['_pickedId'])&&this[_0x4802c6(0xdae)]!==''&&(setPointEditElementColorsForId(this['_pickedId'],HighlightColor,this['_pointEditElementIDs']),this['_oldPickedId']=this['_pickedId'],_0x1e1f68=!![]);const _0x5047b5=this['_map']['scene'];let _0x27832a=_0x5047b5['pickPosition'](_0x1dc42e['startPosition']),_0x10cfd6=_0x5047b5['pickPosition'](_0x1dc42e['endPosition']);const _0x4e7cb4=new Cesium__namespace[(_0x4802c6(_0xb76921._0x181e4b))]();!Cesium__namespace[_0x4802c6(0xb84)](_0x27832a)&&(_0x4e7cb4['x']=_0x1dc42e['startPosition']['x'],_0x4e7cb4['y']=_0x5047b5['canvas'][_0x4802c6(_0xb76921._0x4834fb)]-_0x1dc42e['startPosition']['y'],_0x27832a=getWorldPositionFromWindowPosition(_0x5047b5,_0x4e7cb4));!Cesium__namespace[_0x4802c6(_0xb76921._0x3fb482)](_0x10cfd6)&&(_0x4e7cb4['x']=_0x1dc42e['endPosition']['x'],_0x4e7cb4['y']=_0x5047b5[_0x4802c6(_0xb76921._0x3adbf0)]['clientHeight']-_0x1dc42e['endPosition']['y'],_0x10cfd6=getWorldPositionFromWindowPosition(_0x5047b5,_0x4e7cb4));if(Cesium__namespace['defined'](_0x27832a)&&Cesium__namespace['defined'](_0x10cfd6)){const _0x543e31=getChangeMatrixByMovingMouse(this,_0x27832a,_0x10cfd6,this[_0x4802c6(0x523)]);Cesium__namespace['defined'](_0x543e31)&&(this[_0x4802c6(0xde8)]=Cesium__namespace['Matrix4']['multiply'](this['_editMatrix'],_0x543e31,new Cesium__namespace['Matrix4']()),this[_0x4802c6(_0xb76921._0xe3bbab)]=Cesium__namespace[_0x4802c6(_0xb76921._0x18aa56)]['getTranslation'](this[_0x4802c6(0xde8)],this['_position']),this[_0x4802c6(_0xb76921._0x5798b5)]({'position':this['_position']}),_0x1e1f68=!![]);}_0x1e1f68&&this['_createGraphics']();}else{const _0x136a8b=drillPickTransformHelperComponent(this[_0x4802c6(_0xb76921._0x2fc3d3)]['scene'],_0x1dc42e['endPosition'],this['_pointEditElementIDs']);if(_0x136a8b){const _0x4238ce=_0x136a8b['primitive']['appearance']['material']['uniforms'];_0x4238ce[_0x4802c6(_0xb76921._0x8ab427)]=HighlightColor,this[_0x4802c6(_0xb76921._0x60826b)]=_0x136a8b['primitive'];}}},Cesium__namespace['ScreenSpaceEventType']['MOUSE_MOVE']);}['_unbindEvent'](){const _0x7cd2c6={_0xa33742:0x77c},_0x58cc70=_0x3d5d32;this['_handler']&&(this[_0x58cc70(0x77c)]['destroy'](),delete this[_0x58cc70(_0x7cd2c6._0xa33742)]);}['onChange'](_0x4d2983){const _0x5e923c={_0x6d6b6e:0x73d},_0x4bd022=_0x3d5d32;this['options']['onChange']&&this['options'][_0x4bd022(0x7ca)](_0x4d2983),this['fire'](EventType[_0x4bd022(_0x5e923c._0x6d6b6e)],_0x4d2983,!![]);}}function createPolylinePrimitive(_0xc5cd87){const _0x5a4969={_0x360188:0x263},_0x403b73=_0x3d5d32,{positions:_0x3b29b5,modelMatrix:_0x35871b,color:_0xb2228e,id:_0x557d3e}=_0xc5cd87,_0x11cad4=new Cesium__namespace[(_0x403b73(0x421))]({'material':Cesium__namespace[_0x403b73(0xc6b)]['fromType'](Cesium__namespace['Material']['PolylineArrowType'],{'color':_0xb2228e})});return new Cesium__namespace['Primitive']({'geometryInstances':new Cesium__namespace[(_0x403b73(_0x5a4969._0x360188))]({'geometry':new Cesium__namespace['PolylineGeometry']({'positions':_0x3b29b5,'width':0xf,'vertexFormat':Cesium__namespace[_0x403b73(0x421)][_0x403b73(0x748)],'arcType':Cesium__namespace['ArcType'][_0x403b73(0xa83)]}),'modelMatrix':_0x35871b,'id':_0x557d3e}),'appearance':_0x11cad4,'depthFailAppearance':_0x11cad4,'asynchronous':![]});}function createPlanePrimitive(_0x2e1b2e){const _0x163fa5={_0x3aabb9:0xc6b,_0x449045:0xbd8},_0x4bbf49=_0x3d5d32,{positions:_0x5bc6aa,modelMatrix:_0x40e880,normals:_0x4f98c9,color:_0x39017e,id:_0x4ec693}=_0x2e1b2e,_0x46f3b1=new Cesium__namespace[(_0x4bbf49(0xe55))]({'closed':![],'flat':!![],'materialSupport':Cesium__namespace['MaterialAppearance']['MaterialSupport']['BASIC'],'material':Cesium__namespace['Material']['fromType'](Cesium__namespace[_0x4bbf49(_0x163fa5._0x3aabb9)]['ColorType'],{'color':_0x39017e})});return new Cesium__namespace[(_0x4bbf49(0x684))]({'geometryInstances':new Cesium__namespace['GeometryInstance']({'geometry':new Cesium__namespace[(_0x4bbf49(0xcc4))]({'attributes':{'position':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace[_0x4bbf49(0x3ac)]['DOUBLE'],'componentsPerAttribute':0x3,'values':new Float64Array(_0x5bc6aa)}),'normal':new Cesium__namespace['GeometryAttribute']({'componentDatatype':Cesium__namespace['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array(_0x4f98c9)})},'indices':new Uint16Array([0x0,0x1,0x2,0x0,0x2,0x3]),'primitiveType':Cesium__namespace[_0x4bbf49(0xb1a)]['TRIANGLES'],'boundingSphere':Cesium__namespace[_0x4bbf49(_0x163fa5._0x449045)][_0x4bbf49(0xe27)](_0x5bc6aa)}),'modelMatrix':_0x40e880,'id':_0x4ec693}),'appearance':_0x46f3b1,'depthFailAppearance':_0x46f3b1,'asynchronous':![]});}function isTransformHelperComponent(_0x33a84f,_0x4ca35f){for(const _0x33d5da in _0x4ca35f){if(Object['hasOwnProperty']['call'](_0x4ca35f,_0x33d5da)){const _0x1f63ed=_0x4ca35f[_0x33d5da];if(_0x33a84f===_0x1f63ed)return!![];}}return![];}function getWorldPositionFromWindowPosition(_0x930dcf,_0x4cc39e){const _0x5f18a0={_0x57cf8f:0x54d,_0x2efe43:0xf2b},_0x296880=_0x3d5d32,_0x79d297=0.1,_0x3913b3=Cesium__namespace[_0x296880(_0x5f18a0._0x57cf8f)]['transformWindowToDrawingBuffer'](_0x930dcf,_0x4cc39e,new Cesium__namespace['Cartesian2']());return Cesium__namespace['SceneTransforms'][_0x296880(_0x5f18a0._0x2efe43)](_0x930dcf,_0x3913b3,_0x79d297);}function getChangeMatrixByMovingMouse(_0x299027,_0x3af460,_0x5e27a6,_0x305aa1){const _0x5612fe={_0x4ba640:0xde8,_0x30c731:0xd97,_0x54602e:0xe95,_0x4b71f1:0xe32,_0xc3dd33:0xa33,_0x44003b:0xc40,_0x553cf2:0x61a,_0x528724:0xa33,_0x12168f:0x24c,_0x19bf81:0xb71,_0xb883a8:0xf5d,_0x13e286:0xf5d},_0x339372=_0x3d5d32,_0x37c74f=_0x299027['_pickedId'],_0x3103a9=Cesium__namespace['Matrix4']['clone'](_0x299027[_0x339372(_0x5612fe._0x4ba640)]),_0x25dc96=Cesium__namespace['Matrix4']['inverse'](_0x3103a9,new Cesium__namespace['Matrix4']()),_0x3ab60e=_0x299027['_map']['camera']['positionWC'],_0x1f2b0e=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x25dc96,_0x3ab60e,new Cesium__namespace['Cartesian3']());Cesium__namespace['Cartesian3']['normalize'](_0x1f2b0e,_0x1f2b0e);const _0x60f9b1=Cesium__namespace['Cartesian3'][_0x339372(_0x5612fe._0x30c731)](_0x3af460,_0x3ab60e,new Cesium__namespace[(_0x339372(_0x5612fe._0x54602e))]()),_0x399e0e=Cesium__namespace['Cartesian3']['subtract'](_0x5e27a6,_0x3ab60e,new Cesium__namespace['Cartesian3']()),_0x59d618=new Cesium__namespace[(_0x339372(0xcbc))](_0x3ab60e,_0x60f9b1),_0x3f158a=new Cesium__namespace['Ray'](_0x3ab60e,_0x399e0e),_0x27a358=new Cesium__namespace['Cartesian3']();if(_0x37c74f===_0x305aa1[_0x339372(_0x5612fe._0x4b71f1)])Cesium__namespace[_0x339372(0xe95)]['clone'](Cesium__namespace[_0x339372(_0x5612fe._0x54602e)]['UNIT_Z'],_0x27a358);else{if(_0x37c74f===_0x305aa1['YZ_TRANSLATION'])Cesium__namespace['Cartesian3'][_0x339372(0x315)](Cesium__namespace[_0x339372(_0x5612fe._0x54602e)]['UNIT_X'],_0x27a358);else{if(_0x37c74f===_0x305aa1['XZ_TRANSLATION'])Cesium__namespace['Cartesian3']['clone'](Cesium__namespace['Cartesian3'][_0x339372(_0x5612fe._0xc3dd33)],_0x27a358);else{if(_0x37c74f===_0x305aa1[_0x339372(_0x5612fe._0x44003b)]||_0x37c74f===_0x305aa1[_0x339372(0x45a)]||_0x37c74f===_0x305aa1['Z_TRANSLATION']){let _0x573045=Cesium__namespace['Cartesian3'][_0x339372(_0x5612fe._0x553cf2)];if(_0x37c74f===_0x305aa1['X_TRANSLATION'])_0x573045=Cesium__namespace['Cartesian3']['UNIT_X'];else{if(_0x37c74f===_0x305aa1[_0x339372(0x45a)])_0x573045=Cesium__namespace['Cartesian3'][_0x339372(_0x5612fe._0x528724)];else _0x37c74f===_0x305aa1[_0x339372(0x223)]&&(_0x573045=Cesium__namespace[_0x339372(0xe95)]['UNIT_Z']);}const _0x3e3476=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['cross'](_0x1f2b0e,_0x573045,_0x3e3476),Cesium__namespace['Cartesian3'][_0x339372(_0x5612fe._0x12168f)](_0x573045,_0x3e3476,_0x27a358),Cesium__namespace[_0x339372(_0x5612fe._0x54602e)][_0x339372(0xf69)](_0x27a358,_0x27a358);}}}}const _0x58eb9f=new Cesium__namespace['Plane'](_0x27a358,0x0);Cesium__namespace['Plane'][_0x339372(0x461)](_0x58eb9f,_0x3103a9,_0x58eb9f);const _0x4685f3=Cesium__namespace[_0x339372(_0x5612fe._0x19bf81)]['rayPlane'](_0x59d618,_0x58eb9f),_0x100d80=Cesium__namespace['IntersectionTests']['rayPlane'](_0x3f158a,_0x58eb9f);if(!Cesium__namespace['defined'](_0x4685f3)||!Cesium__namespace[_0x339372(0xb84)](_0x100d80))return undefined;const _0x30ae4b=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x25dc96,_0x4685f3,new Cesium__namespace[(_0x339372(_0x5612fe._0x54602e))]()),_0x173794=Cesium__namespace['Matrix4']['multiplyByPoint'](_0x25dc96,_0x100d80,new Cesium__namespace['Cartesian3']()),_0x4293cb=new Cesium__namespace['Cartesian3']();Cesium__namespace['Cartesian3']['subtract'](_0x173794,_0x30ae4b,_0x4293cb);if(_0x37c74f===_0x305aa1['X_TRANSLATION'])_0x4293cb['y']=0x0,_0x4293cb['z']=0x0;else{if(_0x37c74f===_0x305aa1['Y_TRANSLATION'])_0x4293cb['x']=0x0,_0x4293cb['z']=0x0;else{if(_0x37c74f===_0x305aa1[_0x339372(0x223)])_0x4293cb['x']=0x0,_0x4293cb['y']=0x0;else{if(_0x37c74f===_0x305aa1['XY_TRANSLATION'])_0x4293cb['z']=0x0;else{if(_0x37c74f===_0x305aa1[_0x339372(0x499)])_0x4293cb['x']=0x0;else _0x37c74f===_0x305aa1['XZ_TRANSLATION']&&(_0x4293cb['y']=0x0);}}}}return Cesium__namespace[_0x339372(_0x5612fe._0xb883a8)]['fromTranslation'](_0x4293cb,new Cesium__namespace[(_0x339372(_0x5612fe._0x13e286))]());}function setPointEditElementColorsForId(_0x4920da,_0x56dd5e,_0x38e6e1){const _0x271a47={_0x48781e:0x45a,_0x3979cd:0x592},_0x390658=_0x3d5d32;switch(_0x4920da){case _0x38e6e1['X_TRANSLATION']:PointEditElementColors[_0x390658(0x848)]=_0x56dd5e;break;case _0x38e6e1[_0x390658(_0x271a47._0x48781e)]:PointEditElementColors[_0x390658(0x612)]=_0x56dd5e;break;case _0x38e6e1[_0x390658(0x223)]:PointEditElementColors[_0x390658(_0x271a47._0x3979cd)]=_0x56dd5e;break;case _0x38e6e1['XZ_TRANSLATION']:PointEditElementColors['XZ_TRANSLATION_COLOR']=_0x56dd5e;break;case _0x38e6e1['XY_TRANSLATION']:PointEditElementColors['XY_TRANSLATION_COLOR']=_0x56dd5e;break;case _0x38e6e1['YZ_TRANSLATION']:PointEditElementColors[_0x390658(0x70b)]=_0x56dd5e;break;}}function getPointEditElementColorsForId(_0x3d9c87,_0x341bbb){const _0x520bad={_0x525b53:0x882,_0x21e189:0x48b},_0x354a5c=_0x3d5d32;let _0x5cf13a;switch(_0x3d9c87){case _0x341bbb['X_TRANSLATION']:case _0x341bbb['YZ_TRANSLATION']:_0x5cf13a=Cesium__namespace[_0x354a5c(_0x520bad._0x525b53)]['RED']['withAlpha'](0.6);break;case _0x341bbb['Y_TRANSLATION']:case _0x341bbb['XZ_TRANSLATION']:_0x5cf13a=Cesium__namespace['Color'][_0x354a5c(_0x520bad._0x21e189)][_0x354a5c(0xe57)](0.6);break;case _0x341bbb['Z_TRANSLATION']:case _0x341bbb['XY_TRANSLATION']:_0x5cf13a=Cesium__namespace['Color']['BLUE']['withAlpha'](0.6);break;}return _0x5cf13a;}function drillPickTransformHelperComponent(_0x1e32d9,_0x4261ac,_0x400a73){const _0x3fb28b={_0x357c80:0x90f},_0x89b620=_0x3d5d32,_0x163ede=_0x1e32d9[_0x89b620(_0x3fb28b._0x357c80)](_0x4261ac),_0x3c60f0=_0x163ede['length'];let _0x4d521d;for(let _0x158d73=0x0;_0x158d73<_0x3c60f0;_0x158d73++){const _0x55805b=_0x163ede[_0x158d73];if(_0x55805b&&_0x55805b['id']&&isTransformHelperComponent(_0x55805b['id'],_0x400a73)){_0x4d521d=_0x55805b;break;}}return _0x4d521d;}var index$3={'__proto__':null,'Underground':Underground,'Sightline':Sightline,'Skyline':Skyline,'SkylineBody':SkylineBody,'Shadows':Shadows,'Measure':Measure,'FloodByGraphic':FloodByGraphic,'Slope':Slope,'TerrainPlanClip':TerrainPlanClip,'FloodByMaterial':FloodByMaterial,'TerrainClip':TerrainClip,'ContourLine':ContourLine,'TerrainFlat':TerrainFlat,'TerrainUplift':TerrainUplift,'LimitHeight':LimitHeight,'TilesetPlanClip':TilesetPlanClip,'ModelPlanClip':ModelPlanClip,'TilesetBoxClip':TilesetBoxClip,'TilesetClip':TilesetClip,'TilesetFlood':TilesetFlood,'TilesetFlat':TilesetFlat,'FirstPersonRoam':FirstPersonRoam,'StreetView':StreetView,'CameraHistory':CameraHistory,'RotatePoint':RotatePoint,'RotateOut':RotateOut,'MatrixMove':MatrixMove,'MatrixRotate':MatrixRotate,'MatrixMove2':MatrixMove2};class BaseEffect extends BaseThing{get['type'](){const _0x4a0c0d={_0xf7856a:0xc5a},_0x532d99=_0x3d5d32;return this[_0x532d99(_0x4a0c0d._0xf7856a)];}get[_0x3d5d32(0x2eb)](){return this['_postProcessStage'];}get['uniforms'](){const _0xdfddfe=_0x3d5d32;var _0x17924c;return(_0x17924c=this[_0xdfddfe(0x2e7)])===null||_0x17924c===void 0x0?void 0x0:_0x17924c['uniforms'];}['addTo'](_0x547168){return _0x547168&&_0x547168['addEffect']&&_0x547168['addEffect'](this),this;}[_0x3d5d32(0xf06)](_0x3ab2a6){const _0x36eabc={_0x1d1525:0xe9c},_0x299d25=_0x3d5d32;this['_map']&&this['_map'][_0x299d25(_0x36eabc._0x1d1525)](this,_0x3ab2a6);}['_enabledHook'](_0x3993d7){this['_postProcessStage']&&(this['_postProcessStage']['enabled']=_0x3993d7);}['_setOptionsHook'](_0x16a35c,_0x5423a7){for(const _0x39a214 in _0x5423a7){if(_0x39a214==='enabled')continue;this[_0x39a214]=_0x5423a7[_0x39a214];}}['_addedBaseHook'](){const _0x13d01e={_0x5b3d2e:0xe4c},_0x2f39fc=_0x3d5d32;!this['_postProcessStage']&&this[_0x2f39fc(_0x13d01e._0x5b3d2e)](),this['_enabledHook'](this[_0x2f39fc(0xa63)]),this['_postProcessStage']&&this[_0x2f39fc(0x1d1)][_0x2f39fc(0xfc1)]['postProcessStages']['add'](this['_postProcessStage']);}[_0x3d5d32(0xd3f)](){const _0x37db9f={_0x51e4dd:0x2e7},_0x5032ef=_0x3d5d32;this['_postProcessStage']&&(this['_map'][_0x5032ef(0xfc1)]['postProcessStages']['remove'](this['_postProcessStage']),this['_postProcessStage']['isDestroyed']()&&delete this[_0x5032ef(_0x37db9f._0x51e4dd)]);}[_0x3d5d32(0xefc)](_0x3b888d,_0x236f5d={},_0x5753e1){const _0x45c207=_0x3d5d32;return!_0x236f5d['effect']&&(_0x236f5d['effect']=this),super[_0x45c207(0xefc)](_0x3b888d,_0x236f5d,_0x5753e1);}['_getPickIds'](_0x3a55b0){const _0x3782f4={_0x5eec47:0xd2e,_0x5c497b:0x1087};let _0xdaf202=[];return _0x3a55b0['forEach'](_0x2555c3=>{const _0x445c24=_0x4132;_0x2555c3[_0x445c24(_0x3782f4._0x5eec47)]&&(_0x2555c3=_0x2555c3['czmObject']);if(_0x2555c3['_pickIds'])_0xdaf202=_0xdaf202[_0x445c24(0xc97)](this[_0x445c24(_0x3782f4._0x5c497b)](_0x2555c3['_pickIds']));else _0x2555c3[_0x445c24(0x832)]?_0xdaf202=_0xdaf202['concat'](this['_getPickIds']([_0x2555c3['pickId']])):_0xdaf202['push']({'pickId':_0x2555c3});}),_0xdaf202;}}var FogFS=_0x3d5d32(0x2cb);class FogEffect extends BaseEffect{constructor(_0x4655ec={}){const _0x16746c={_0x31a8f9:0xe8f,_0x3f26ec:0xd4c},_0x464340=_0x3d5d32;super(_0x4655ec),this['fogByDistance']=_0x4655ec['fogByDistance']??new Cesium__namespace['Cartesian4'](0xa,0x0,0x3e8,0.9),this['color']=getCesiumColor(_0x4655ec[_0x464340(_0x16746c._0x31a8f9)],Cesium__namespace['Color']['WHITE']),this['maxHeight']=_0x4655ec['maxHeight']??0x2328,this[_0x464340(_0x16746c._0x3f26ec)](_0x4655ec);}['_setOptionsHook'](_0x51e8fc,_0x5c4b36){const _0x4b7e38={_0x423513:0x4e8,_0x470e3e:0xb84,_0x3e0f2e:0x7cb},_0x2f2928=_0x3d5d32;Cesium__namespace[_0x2f2928(0xb84)](_0x51e8fc['fogByDistance_near'])&&(this['fogByDistance']['x']=_0x51e8fc['fogByDistance_near']),Cesium__namespace['defined'](_0x51e8fc[_0x2f2928(0x4e8)])&&(this['fogByDistance']['y']=_0x51e8fc[_0x2f2928(_0x4b7e38._0x423513)]),Cesium__namespace['defined'](_0x51e8fc['fogByDistance_far'])&&(this['fogByDistance']['z']=_0x51e8fc['fogByDistance_far']),Cesium__namespace['defined'](_0x51e8fc['fogByDistance_farValue'])&&(this['fogByDistance']['w']=_0x51e8fc['fogByDistance_farValue']),Cesium__namespace[_0x2f2928(_0x4b7e38._0x470e3e)](_0x5c4b36===null||_0x5c4b36===void 0x0?void 0x0:_0x5c4b36['color'])&&(this['color']=getCesiumColor(_0x51e8fc['color'],Cesium__namespace['Color']['WHITE'])),this[_0x2f2928(_0x4b7e38._0x3e0f2e)]=_0x51e8fc['maxHeight']??0x2328;}['_mountedHook'](){const _0x52442e=_0x3d5d32;this['_postProcessStage']=new Cesium__namespace['PostProcessStage']({'name':this[_0x52442e(0xed3)],'fragmentShader':FogFS,'uniforms':{'fogByDistance':()=>{return this['fogByDistance'];},'fogColor':()=>{return this['color'];}},'enabled':this['enabled']});}['_addedHook'](){const _0x5cea4e={_0x588da6:0x435},_0x33f728=_0x3d5d32;this['_map']['scene'][_0x33f728(_0x5cea4e._0x588da6)]['changed']['addEventListener'](this['camera_changedHandler'],this);}[_0x3d5d32(0x566)](){const _0x117ca0={_0x3ef624:0x9c3},_0x22072b=_0x3d5d32;this['_map']['scene']['camera'][_0x22072b(_0x117ca0._0x3ef624)]['removeEventListener'](this['camera_changedHandler'],this);}['camera_changedHandler'](_0x196536){const _0x15f171=_0x3d5d32;this['_map'][_0x15f171(0x435)]['positionCartographic'][_0x15f171(0x83e)]0x8)throw new Cesium__namespace[(_0x4f31cb(0x357))]('CesiumRenderPass:textureScale必须大于0小于等于8');function _0x130153(_0x1a2289,_0x4438de,_0x2adfe4,_0xabf63d){const _0x8eaae7=_0x4f31cb;let _0x5db128=_0x1a2289[_0x8eaae7(0x7de)]['getDerivedShaderProgram'](_0x4438de,_0x3db3aa);if(!Cesium__namespace[_0x8eaae7(0xb84)](_0x5db128)){const _0x5eddc5=_0x4438de['_attributeLocations'];let _0x1ca6a0=_0x4438de['fragmentShaderSource'],_0x7e8025=_0x4438de['vertexShaderSource'];const _0x568448=_0x4438de['_vertexShaderText'];let _0x37eb12=_0x1ca6a0['sources'],_0x33e129=_0x37eb12[_0x8eaae7(_0x3eaeb9._0x62399e)],_0x5bf6b6=!!_0x34811a&&_0x18b84d();Object['prototype']['toString']['call'](_0x2adfe4)==='[object\x20Object]'&&(_0x2adfe4['color']?_0x2adfe4='vec4('+Cesium__namespace[_0x8eaae7(0x882)]['floatToByte'](_0x2adfe4['color'][_0x8eaae7(_0x3eaeb9._0x2cfed5)])+',\x20'+Cesium__namespace['Color']['floatToByte'](_0x2adfe4[_0x8eaae7(0xe8f)][_0x8eaae7(_0x3eaeb9._0x4d9696)])+',\x20'+Cesium__namespace[_0x8eaae7(_0x3eaeb9._0x26e2a3)]['floatToByte'](_0x2adfe4['color'][_0x8eaae7(_0x3eaeb9._0x1d67cb)])+',\x20'+Cesium__namespace['Color']['floatToByte'](_0x2adfe4['color']['alpha'])+')':_0x2adfe4='vec4(1.0)');let _0x2dbdfe=cmz_selected_glsl;const _0x2b5d69=/texture\s?\(\s?model_pickTexture\s?,\s?selectedFeature.st\s?\)/['test'](_0x2adfe4);_0xabf63d==='varying'&&!_0x2b5d69?_0x2dbdfe+='\x0ain\x20float\x20me_isSelected;\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20bool\x20isSelected=\x20me_isSelected>0.0000001;\x0a\x20\x20\x20\x20if(!isSelected){\x0a\x20\x20\x20\x20\x20\x20\x20\x20isSelected=\x20czm_selected('+_0x2adfe4+');\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20return\x20isSelected;\x0a}\x0a\x20\x20\x20\x20':_0x2dbdfe+='\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20return\x20czm_selected('+_0x2adfe4+');\x0a}';const _0x1c2be6=cmz_selected_glsl+('\x0aout\x20float\x20me_isSelected;\x0abool\x20czm_selected(){\x0a\x20\x20\x20\x20return\x20czm_selected('+_0x2adfe4+_0x8eaae7(0xa31));let _0x4ed5ba=![],_0xc9605e=![];if(/in\s?vec3\s?normal\s?;/[_0x8eaae7(_0x3eaeb9._0x17daa5)](_0x568448)||/\n\s?vec3\s?normal\s?;/['test'](_0x568448))_0x4ed5ba=!![];else/out\s?vec3\s?v_normal\s?;/['test'](_0x568448)&&(_0xc9605e=!![]);if(_0x3b2f80){let _0x3a74bf=![];for(let _0x5c564a=0x0;_0x5c564a<_0x33e129;++_0x5c564a){if(/vec4\s?packDepthToRGBA\s?\(/['test'](_0x37eb12[_0x5c564a])){_0x3a74bf=!![];break;}}const _0x4cbd2d=(_0x3a74bf?'':packing_glsl)+(_0x5bf6b6?_0x2dbdfe:'')+Cesium__namespace['ShaderSource']['replaceMain'](_0x3b2f80,_0x29630d)+_0x8eaae7(0x272)+_0x8eaae7(0x60b)+(_0x1ef05e!=='replace'?'\x20\x20\x20\x20'+_0x5c18ea+_0x8eaae7(_0x3eaeb9._0x23acc4):'')+(_0x8eaae7(_0x3eaeb9._0x364c19)+_0x29630d+'();\x20\x0a')+'}\x20\x0a',_0x2b53fb=new Array(_0x33e129+0x1);for(let _0x464bdb=0x0;_0x464bdb<_0x33e129;++_0x464bdb){_0x2b53fb[_0x464bdb]=Cesium__namespace['ShaderSource'][_0x8eaae7(0x308)](_0x37eb12[_0x464bdb],_0x5c18ea);}_0x2b53fb[_0x33e129]=_0x4cbd2d;if(_0x4ed5ba)_0x1ca6a0[_0x8eaae7(_0x3eaeb9._0x1356af)]['push']('HAS_NORMAL_MARS3D');else _0xc9605e&&_0x1ca6a0['defines']['push'](_0x8eaae7(0x1011));_0x1ca6a0=new Cesium__namespace['ShaderSource']({'sources':_0x2b53fb,'defines':_0x1ca6a0[_0x8eaae7(0xea6)]});}if(_0x2debb6||_0x3b2f80){_0x37eb12=_0x7e8025[_0x8eaae7(_0x3eaeb9._0x39d8bf)],_0x33e129=_0x37eb12['length'];let _0x5671ac=![];for(let _0x53c3f8=0x0;_0x53c3f8<_0x33e129;++_0x53c3f8){if(/vec4\s?packDepthToRGBA\s?\(/[_0x8eaae7(0xdd1)](_0x37eb12[_0x53c3f8])){_0x5671ac=!![];break;}}_0x5bf6b6=_0x5bf6b6&&_0xabf63d===_0x8eaae7(_0x3eaeb9._0x483302)&&!_0x2b5d69;if(_0x4ed5ba)_0x7e8025['defines']['push']('HAS_NORMAL_MARS3D');else _0xc9605e&&_0x7e8025['defines']['push'](_0x8eaae7(0x1011));const _0x855351=(_0x5671ac?'':packing_glsl)+(_0x5bf6b6?_0x1c2be6:'')+Cesium__namespace['ShaderSource'][_0x8eaae7(0x308)](_0x2debb6||_0x8eaae7(_0x3eaeb9._0x13c9f5),_0x29630d)+'void\x20main()\x20\x0a'+_0x8eaae7(0x60b)+(_0x1ef05e!=='replace'?'\x20\x20\x20\x20'+_0x5c18ea+_0x8eaae7(_0x3eaeb9._0x486b26):'')+(_0x5bf6b6?'\x20me_isSelected\x20=\x200.0;\x0a\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20me_isSelected=czm_selected()?1.0:0.0;\x0a\x20#endif\x0a':'')+(_0x8eaae7(_0x3eaeb9._0x152d14)+_0x29630d+'();\x20\x0a')+_0x8eaae7(0xf46),_0x28fdf7=new Array(_0x33e129+0x1);for(let _0x2bbbdf=0x0;_0x2bbbdf<_0x33e129;++_0x2bbbdf){_0x28fdf7[_0x2bbbdf]=Cesium__namespace['ShaderSource']['replaceMain'](_0x37eb12[_0x2bbbdf],_0x5c18ea);}_0x28fdf7[_0x33e129]=_0x855351,_0x7e8025=new Cesium__namespace['ShaderSource']({'sources':_0x28fdf7,'defines':_0x7e8025['defines']});}_0x5db128=_0x1a2289[_0x8eaae7(0x7de)]['createDerivedShaderProgram'](_0x4438de,_0x3db3aa,{'vertexShaderSource':_0x7e8025,'fragmentShaderSource':_0x1ca6a0,'attributeLocations':_0x5eddc5});}return _0x5db128;}function _0x1b8bd0(_0x18a86e,_0x4d29a8){const _0x21e65d=_0x4f31cb;_0x18a86e['_renderPassCache']=_0x18a86e['_renderPassCache']||{},_0x18a86e[_0x21e65d(0xe02)][_0xa07d35]=_0x18a86e[_0x21e65d(0xe02)][_0xa07d35]||{};const _0x4176c5=_0x18a86e['_renderPassCache'][_0xa07d35];let _0x377f5f=_0x4176c5[_0x4d29a8['id']];if(!Cesium__namespace[_0x21e65d(_0x1ed910._0x2c830a)](_0x377f5f)){const _0x4ff8c9=Cesium__namespace['RenderState']['getState'](_0x4d29a8);typeof _0xbbce0d===_0x21e65d(_0x1ed910._0x4b011a)&&_0xbbce0d['call'](_0xdf506b,_0x4ff8c9),_0x377f5f=Cesium__namespace['RenderState']['fromCache'](_0x4ff8c9),_0x4176c5[_0x4d29a8['id']]=_0x377f5f;}return _0x377f5f;}function _0x1171cc(_0x583824,_0x3870ce,_0x2e2c03){const _0xcda944=_0x4f31cb,_0x2959ed=_0x583824,_0x2211f0=_0x3870ce['_frameState'];let _0xe1f23a=_0x583824['derivedCommands'];if(!Cesium__namespace['defined'](_0xe1f23a))return;_0x2211f0[_0xcda944(0xaa7)]&&Cesium__namespace['defined'](_0xe1f23a['logDepth'])&&(_0x583824=_0xe1f23a['logDepth'][_0xcda944(_0x413932._0x2dbb7c)]);_0xe1f23a=_0x583824[_0xcda944(0xf02)];let _0x4f2d22=_0xe1f23a['renderPass'];!Cesium__namespace['defined'](_0xe1f23a['renderPass'])&&(_0x4f2d22=_0xe1f23a['renderPass']={});let _0x5d7aad,_0x22b59f;Cesium__namespace[_0xcda944(_0x413932._0x2eb47b)](_0x4f2d22[_0x4e9ac3])&&(_0x5d7aad=_0x4f2d22[_0x4e9ac3]['shaderProgram'],_0x22b59f=_0x4f2d22[_0x4e9ac3]['renderState']);_0x4f2d22[_0x4e9ac3]=Cesium__namespace[_0xcda944(0xb8c)]['shallowClone'](_0x583824,_0x4f2d22[_0x4e9ac3]);if(!Cesium__namespace['defined'](_0x5d7aad)||_0x4f2d22['shaderProgramId']!==_0x583824['shaderProgram']['id']){const _0x300a89=_0x583824[_0xcda944(0x6cf)],_0x3206d9=_0x2959ed[_0xcda944(_0x413932._0x13b467)]=new RegExp(_0xcda944(_0x413932._0x393b43)+_0x583824['pickId'],'g')['test'](_0x300a89[_0xcda944(_0x413932._0x14314b)])?_0xcda944(0x64e):'varying';_0x4f2d22[_0x4e9ac3]['shaderProgram']=_0x130153(_0x2e2c03,_0x300a89,_0x583824[_0xcda944(0x832)],_0x3206d9),_0x4f2d22[_0x4e9ac3]['renderState']=_0x1b8bd0(_0x3870ce,_0x583824[_0xcda944(0x948)]),_0x4f2d22['shaderProgramId']=_0x583824['shaderProgram']['id'];}else _0x4f2d22[_0x4e9ac3]['shaderProgram']=_0x5d7aad,_0x4f2d22[_0x4e9ac3][_0xcda944(_0x413932._0x25dd1e)]=_0x22b59f;const _0x311575=_0x4f2d22[_0x4e9ac3]['uniformMap'];_0x3bccb2(_0x311575);}function _0xdf1d2b(_0x54cfcc){return function(){const _0x129820=_0x26977e[_0x54cfcc];if(typeof _0x129820==='function')return _0x129820();return _0x129820;};}function _0x454c4f(_0x578bdd,_0x52019e){return function(){const _0x56f55a=_0x578bdd[_0x52019e]();if(Cesium__namespace['defined'](_0x56f55a))return _0x56f55a['dimensions'];return undefined;};}function _0x3bccb2(_0x5696e0){const _0x2f7566=_0x4f31cb;if(_0x5696e0['__created'])return;_0x5696e0[_0x2f7566(0xa47)]=function(){return _0x34811a['_selectedIdTexture'];},_0x5696e0['czm_selectedIdTextureWidth']=function(){var _0x168b8e;return((_0x168b8e=_0x34811a['_selectedIdTexture'])===null||_0x168b8e===void 0x0?void 0x0:_0x168b8e['width'])??0x0;},_0x5696e0['czm_selectedIdTextureStep']=function(){var _0x135789;return(_0x135789=_0x34811a['_selectedIdTexture'])!==null&&_0x135789!==void 0x0&&_0x135789['width']?0x1/_0x34811a['_selectedIdTexture']['width']:-0x1;};if(!_0x26977e)return;_0x5696e0[_0x2f7566(_0x55d0a0._0x4ff2f3)]=!![];for(const _0x40dc2c in _0x26977e){if(_0x26977e[_0x2f7566(0x2d1)](_0x40dc2c)){typeof _0x26977e[_0x40dc2c]!=='function'?_0x5696e0[_0x40dc2c]=_0xdf1d2b(_0x40dc2c):_0x5696e0[_0x40dc2c]=_0x26977e[_0x40dc2c];const _0x289d01=_0x5696e0[_0x40dc2c]();(typeof _0x289d01===_0x2f7566(_0x55d0a0._0x19411f)||_0x289d01 instanceof Cesium__namespace['Texture']||_0x289d01 instanceof HTMLImageElement||_0x289d01 instanceof HTMLCanvasElement||_0x289d01 instanceof HTMLVideoElement)&&(_0x5696e0[_0x40dc2c+'Dimensions']=_0x454c4f(_0x5696e0,_0x40dc2c));}}}function _0x24a5cc(_0x541127){const _0x3e10cf=_0x4f31cb,_0x383f6a=_0x541127['_view'],_0x466d13=_0x383f6a['frustumCommandsList'],_0x3131c6=_0x466d13['length'];let _0x30f46a,_0x5a8dc5,_0x13fda3;for(let _0x3c62e3=0x0;_0x3c62e3<_0x3131c6;++_0x3c62e3){const _0x3f0f7f=_0x3131c6-_0x3c62e3-0x1,_0x34e7b7=_0x466d13[_0x3f0f7f];for(_0x5a8dc5=0x0;_0x5a8dc5<_0x34e7b7['commands'][_0x3e10cf(_0x301214._0x3cf0cd)];_0x5a8dc5++){const _0x4225bc=_0x34e7b7[_0x3e10cf(_0x301214._0x43f2e1)][_0x5a8dc5];_0x13fda3=_0x34e7b7['indices'][_0x5a8dc5];if(_0x34811a&&_0x5a8dc5===Cesium__namespace['Pass']['GLOBE'])continue;for(_0x30f46a=0x0;_0x30f46a<_0x13fda3;++_0x30f46a){const _0x166698=_0x4225bc[_0x30f46a];_0x1171cc(_0x166698,_0x541127,_0x541127['_context']);}}}}function _0x42c463(){_0x5c10b0&&(_0x5c10b0['destroy'](),_0xbbf012['destroy'](),_0xbbf012=undefined,_0x5c10b0=undefined),_0x3612e4&&(_0x3612e4['destroy'](),_0x3612e4=undefined);}function _0x39e949(_0x4d96a6,_0x6a0825,_0x232da9,_0x184828){const _0x3b35bb=_0x4f31cb,_0x1c665a=_0x6a0825[_0x3b35bb(0x1076)],_0xd72818=_0x6a0825['height'];if(_0x5c10b0&&_0x5c10b0['width']===_0x1c665a&&_0x5c10b0['height']===_0xd72818&&_0x232da9===_0x215fe4)return;_0x215fe4=_0x232da9,_0x42c463(),_0x5c10b0=new Cesium__namespace['Texture']({'context':_0x4d96a6,'width':_0x1c665a,'height':_0xd72818,'pixelFormat':_0x302eeb??Cesium__namespace[_0x3b35bb(_0x11c44f._0x2abe50)]['RGBA'],'pixelDatatype':_0x465295??Cesium__namespace['PixelDatatype']['FLOAT'],'sampler':_0x25e85e??Cesium__namespace[_0x3b35bb(0x509)][_0x3b35bb(_0x11c44f._0x5b46a8)]}),_0x3612e4=new Cesium__namespace['Texture']({'context':_0x4d96a6,'width':_0x1c665a,'height':_0xd72818,'pixelFormat':Cesium__namespace['PixelFormat']['DEPTH_COMPONENT'],'pixelDatatype':Cesium__namespace['PixelDatatype']['UNSIGNED_SHORT'],'sampler':Cesium__namespace['Sampler']['NEAREST']}),_0xbbf012=new Cesium__namespace['Framebuffer']({'colorTextures':[_0x5c10b0],'context':_0x4d96a6,'destroyAttachments':![],'depthTexture':_0x3612e4});}function _0x46aaab(_0x102887){const _0x469463=_0x4f31cb;_0x32bae5=Cesium__namespace['BoundingRectangle']['clone'](_0x102887[_0x469463(_0x2d6c69._0xfc7b25)],_0x32bae5);const _0x37e005=Object[_0x469463(0x20b)]({},_0x102887[_0x469463(_0x2d6c69._0x395174)]);return _0x37e005['viewport']=_0x32bae5,_0x37e005;}function _0x43764e(_0x3f8b4d,_0x5b2a20){const _0x527a33=_0x4f31cb,_0x4ae529=_0x3f8b4d['_us']['_frameState'],_0x3a56e9=_0x4ae529['camera'],_0x6248a7=_0x3a56e9['_scene'],_0xbbf3c5=_0x6248a7[_0x527a33(0x9b5)];try{if(!_0x2debb6&&!_0x3b2f80){const _0x2a22ae=_0x46aaab(_0xbbf3c5);typeof _0x485a39==='function'&&_0x485a39[_0x527a33(0xa86)](_0xdf506b,_0x6248a7,_0x5b2a20),_0x39e949(_0x3f8b4d,_0x32bae5,_0x6248a7['hdr'],_0xbbf3c5['sceneFramebuffer']),executeDerivedCommandList(_0x3f8b4d,_0xbbf012,_0x2a22ae);}else{const _0x1c6a47=_0x46aaab(_0xbbf3c5);typeof _0x485a39==='function'&&_0x485a39['call'](_0xdf506b,_0x6248a7,_0x5b2a20),_0x39e949(_0x3f8b4d,_0x32bae5,_0x6248a7['hdr'],_0xbbf3c5['sceneFramebuffer']),_0x24a5cc(_0x6248a7),executeDerivedCommandList(_0x3f8b4d,_0xbbf012,_0x1c6a47,'renderPass',_0x4e9ac3,_0x1410cf==='all'||!_0x34811a||!_0x34811a['_selectedIdTexture']?null:_0x419efa);}}catch(_0x159c8b){}}function _0x18b84d(){const _0x3b1add=_0x4f31cb;if(!_0x34811a)return;const _0x3b6d69=_0x34811a['selected']||_0x34811a[_0x3b1add(0x513)];if(_0x3b6d69['length'])return _0x3b6d69;}function _0x419efa(_0x4e4bd3,_0x243bf8){const _0x20a086=_0x4f31cb,_0x5b08ce=_0x34811a&&(_0x34811a[_0x20a086(0xda3)]||_0x34811a[_0x20a086(_0x1c19cf._0x50c473)]);if(!_0x34811a||!_0x5b08ce||!_0x5b08ce[_0x20a086(0xc84)])return![];if(!_0x4e4bd3[_0x20a086(0x832)]||_0x4e4bd3[_0x20a086(_0x1c19cf._0x3ae721)]!==_0x20a086(0x64e))return!![];let _0x419e1b=!![];const _0x118276=_0x4e4bd3['owner'],_0x34546d=_0x1410cf===_0x20a086(_0x1c19cf._0x1a01db);if(_0x118276&&_0x118276['isObject3D']){for(let _0x403ee8=0x0;_0x403ee8<_0x5b08ce['length'];_0x403ee8++){const _0x49f077=_0x5b08ce[_0x403ee8];if(_0x49f077===_0x118276)return _0x34546d;}return!_0x34546d;}const _0x360743=_0x4e4bd3['uniformMap'];if(_0x360743[_0x4e4bd3['pickId']]){const _0x5e1ce3=_0x360743[_0x4e4bd3[_0x20a086(0x832)]]();_0x419e1b=!_0x34546d;for(let _0x183003=0x0;_0x183003<_0x5b08ce['length'];_0x183003++){const _0x1504b8=_0x5b08ce[_0x183003],_0x3095b1=_0x1504b8['pickId']?[_0x1504b8['pickId']]:_0x1504b8['pickIds']||_0x1504b8[_0x20a086(_0x1c19cf._0x56ecc9)];for(let _0x48958b=0x0;_0x48958b<_0x3095b1['length'];_0x48958b++){const _0x48a6a5=_0x3095b1[_0x48958b];if(_0x48a6a5['color']===_0x5e1ce3||Cesium__namespace['Color']['equals'](_0x48a6a5[_0x20a086(0xe8f)],_0x5e1ce3))return _0x34546d;}}}return _0x419e1b;}function _0x193edc(_0x57668c){const _0x3bef24=_0x4f31cb;if(_0xbbf012){const _0x5affe5=_0x57668c[_0x3bef24(0xaa5)]['_frameState']['camera'][_0x3bef24(0x627)]['_view'];_0x3295c3['framebuffer']=_0xbbf012,_0x3295c3['execute'](_0x57668c,_0x5affe5[_0x3bef24(0xdb8)]),_0x3295c3[_0x3bef24(0xbe4)]=undefined;}}function _0x5d61a5(_0x59d219){const _0x15cc26=_0x4f31cb;_0x34811a&&_0xdf506b['prevStageUpdate']&&(_0x34811a['update']=_0xdf506b['prevStageUpdate'],_0xdf506b['prevStageUpdate']=null,_0xdf506b['prevStageExecute']=null);_0x34811a=_0x59d219;if(!_0x34811a)return;const _0x253ba8=_0x34811a[_0x15cc26(0x635)];_0xdf506b['prevStageUpdate']=_0x253ba8,_0x34811a['update']=function(_0x3e33bb,_0x3aa1e0){_0x193edc(_0x3e33bb),_0x253ba8['call'](_0x34811a,_0x3e33bb,_0x3aa1e0);if(!_0x34811a['enabled'])return;if(!_0x2debb6&&!_0x3b2f80)_0x43764e(_0x3e33bb,_0x3aa1e0);else{const _0x4d986d=_0x34811a['selected']||_0x34811a['parentSelected'];_0x4d986d&&_0x4d986d['length']&&_0x43764e(_0x3e33bb,_0x3aa1e0);}};}this['update']=_0x43764e,this['clear']=_0x193edc,Object[_0x4f31cb(_0x59b680._0x579816)](this,{'texture':{'get'(){return _0x5c10b0;}},'depthTexture':{'get'(){return _0x3612e4;}},'stage':{'get'(){return _0x34811a;},'set'(_0x1c827a){_0x34811a!==_0x1c827a&&_0x5d61a5(_0x1c827a);}}});}let scratchPerspectiveFrustum,scratchPerspectiveOffCenterFrustum,scratchOrthographicFrustum,scratchOrthographicOffCenterFrustum;function executeDerivedCommand(_0x5736ee,_0x4ca85c,_0x5d0efc,_0x3d9ef1,_0x90e2da,_0x60b1f5){const _0x52d103={_0x5565fb:0x1fc},_0x523128=_0x3d5d32,_0x7956fa=Cesium__namespace['defined'],_0x2c9843=_0x3d9ef1['_frameState'];let _0x556b30=_0x5736ee['derivedCommands'];if(!_0x7956fa(_0x556b30))return;_0x2c9843['useLogDepth']&&_0x7956fa(_0x556b30['logDepth'])&&(_0x5736ee=_0x556b30['logDepth'][_0x523128(_0x52d103._0x5565fb)]),_0x556b30=_0x5736ee[_0x523128(0xf02)],_0x7956fa(_0x556b30[_0x4ca85c])&&(_0x5736ee=_0x556b30[_0x4ca85c][_0x5d0efc],_0x5736ee['execute'](_0x90e2da,_0x60b1f5));}function executeDerivedCommandList(_0x551388,_0x2a3812,_0x77a191,_0x3e99bc,_0x1075fd,_0x2026e7){const _0x558825={_0x1c7ece:0x389,_0x31df21:0x585,_0x6860b5:0xea0,_0x300af3:0x233,_0x5486c7:0x47f,_0x44bc62:0xe60},_0x5f529f=_0x3d5d32,{Pass:_0x17801b,defined:_0x34108b,PerspectiveFrustum:_0x5f514c,PerspectiveOffCenterFrustum:_0x2ae38a,OrthographicFrustum:_0x26e02a,OrthographicOffCenterFrustum:_0x1a9340}=Cesium__namespace;scratchPerspectiveFrustum=scratchPerspectiveFrustum||new _0x5f514c(),scratchPerspectiveOffCenterFrustum=scratchPerspectiveOffCenterFrustum||new _0x2ae38a(),scratchOrthographicFrustum=scratchOrthographicFrustum||new _0x26e02a(),scratchOrthographicOffCenterFrustum=scratchOrthographicOffCenterFrustum||new _0x1a9340();const _0x275ec5=_0x551388['_us'],_0x29e0bc=_0x275ec5['_frameState'],_0x353dc7=_0x29e0bc[_0x5f529f(0x435)],_0xa75fbc=_0x353dc7['_scene'],_0x30ec1e=_0xa75fbc['_view'],_0x176011=_0x30ec1e['frustumCommandsList'],_0x6dcc37=_0x176011['length'],_0x52ad81=_0xa75fbc['_globeTranslucencyState'],_0x5484c9=_0x52ad81['translucent'],_0x28afa4=_0xa75fbc[_0x5f529f(0x9b5)]['globeTranslucencyFramebuffer'];let _0x1ce424;if(_0x34108b(_0x353dc7[_0x5f529f(_0x558825._0x1c7ece)]['fov']))_0x1ce424=_0x353dc7[_0x5f529f(0x389)][_0x5f529f(0x315)](scratchPerspectiveFrustum);else{if(_0x34108b(_0x353dc7['frustum']['infiniteProjectionMatrix']))_0x1ce424=_0x353dc7['frustum']['clone'](scratchPerspectiveOffCenterFrustum);else _0x34108b(_0x353dc7['frustum'][_0x5f529f(0x1076)])?_0x1ce424=_0x353dc7['frustum']['clone'](scratchOrthographicFrustum):_0x1ce424=_0x353dc7['frustum']['clone'](scratchOrthographicOffCenterFrustum);}function _0x50c589(_0x37183c,_0x4aeabf,_0x359b70,_0x9c52db){const _0x5ad22a=_0x2026e7?_0x2026e7(_0x37183c,_0x4aeabf):!![];if(_0x5ad22a)try{_0x3e99bc&&_0x1075fd?executeDerivedCommand(_0x37183c,_0x3e99bc,_0x1075fd,_0x4aeabf,_0x359b70,_0x9c52db):_0x37183c['execute'](_0x359b70,_0x9c52db);}catch(_0x5282c2){}}let _0x1fd2dc,_0xac4018,_0x5c8737;for(let _0x304c8c=0x0;_0x304c8c<_0x6dcc37;++_0x304c8c){const _0x37d0fe=_0x6dcc37-_0x304c8c-0x1,_0x1648b5=_0x176011[_0x37d0fe],_0x4a1f57=_0x77a191['framebuffer'];_0x77a191['framebuffer']=_0x2a3812,_0x1ce424['near']=_0x37d0fe!==0x0?_0x1648b5['near']*_0xa75fbc['opaqueFrustumNearOffset']:_0x1648b5[_0x5f529f(_0x558825._0x31df21)],_0x1ce424['far']=_0x1648b5['far'],_0x275ec5['updateFrustum'](_0x1ce424),_0x275ec5['updatePass'](_0x17801b[_0x5f529f(0xbe0)]),_0x5c8737=_0x1648b5['commands'][_0x17801b['GLOBE']],_0xac4018=_0x1648b5[_0x5f529f(_0x558825._0x6860b5)][_0x17801b[_0x5f529f(0xbe0)]];if(_0x5484c9)_0x52ad81[_0x5f529f(0xfc6)](_0x1648b5,_0x50c589,_0x28afa4,_0xa75fbc,_0x77a191);else for(_0x1fd2dc=0x0;_0x1fd2dc<_0xac4018;++_0x1fd2dc){_0x50c589(_0x5c8737[_0x1fd2dc],_0xa75fbc,_0x551388,_0x77a191);}_0x275ec5['updatePass'](_0x17801b[_0x5f529f(_0x558825._0x300af3)]),_0x5c8737=_0x1648b5['commands'][_0x17801b['CESIUM_3D_TILE']],_0xac4018=_0x1648b5['indices'][_0x17801b['CESIUM_3D_TILE']];for(_0x1fd2dc=0x0;_0x1fd2dc<_0xac4018;++_0x1fd2dc){_0x50c589(_0x5c8737[_0x1fd2dc],_0xa75fbc,_0x551388,_0x77a191);}_0x275ec5['updatePass'](_0x17801b[_0x5f529f(_0x558825._0x5486c7)]),_0x5c8737=_0x1648b5['commands'][_0x17801b['OPAQUE']],_0xac4018=_0x1648b5['indices'][_0x17801b['OPAQUE']];for(_0x1fd2dc=0x0;_0x1fd2dc<_0xac4018;++_0x1fd2dc){_0x50c589(_0x5c8737[_0x1fd2dc],_0xa75fbc,_0x551388,_0x77a191);}_0x275ec5[_0x5f529f(_0x558825._0x44bc62)](_0x17801b['TRANSLUCENT']),_0x5c8737=_0x1648b5[_0x5f529f(0xd4d)][_0x17801b[_0x5f529f(0xfe5)]],_0xac4018=_0x1648b5[_0x5f529f(0xea0)][_0x17801b['TRANSLUCENT']];for(_0x1fd2dc=0x0;_0x1fd2dc<_0xac4018;++_0x1fd2dc){_0x50c589(_0x5c8737[_0x1fd2dc],_0xa75fbc,_0x551388,_0x77a191);}_0x77a191['framebuffer']=_0x4a1f57;}}class OutlineEffect extends BaseEffect{constructor(_0x53b834={}){super(_0x53b834),this['_setOptionsHook'](_0x53b834);}get[_0x3d5d32(0xda3)](){var _0x4cb218;return(_0x4cb218=this['_postProcessStage'])===null||_0x4cb218===void 0x0?void 0x0:_0x4cb218['selected'];}set['selected'](_0x3b655c){const _0x1ada9f=_0x3d5d32;let _0x2bdb3e=[];_0x3b655c&&(!Array['isArray'](_0x3b655c)?_0x2bdb3e=this['_getPickIds']([_0x3b655c]):_0x2bdb3e=this['_getPickIds'](_0x3b655c)),this[_0x1ada9f(0x2e7)]&&(this['_postProcessStage']['selected']=_0x2bdb3e,this[_0x1ada9f(0x2e7)]['enabled']=this['enabled']&&this[_0x1ada9f(0xda3)]['length']>0x0);}get['color'](){return this['_color'];}set[_0x3d5d32(0xe8f)](_0xa38798){const _0x266927={_0x5806b9:0xd91},_0x548a78=_0x3d5d32;this['_color']=getCesiumColor(_0xa38798),this['_useSingleColor']=!this['_colorHidden']||this[_0x548a78(_0x266927._0x5806b9)]['equals'](this['_colorHidden']);}get['colorHidden'](){const _0x1edf1f={_0x2fb4ec:0xc91},_0x1c71b9=_0x3d5d32;return Cesium__namespace['defined'](this['_colorHidden'])?this[_0x1c71b9(_0x1edf1f._0x2fb4ec)]:this['_color'];}set['colorHidden'](_0x2cad52){const _0x39f812={_0x122653:0x71f},_0x5ea8d1=_0x3d5d32;this['_colorHidden']=getCesiumColor(_0x2cad52),this['_useSingleColor']=!this['_colorHidden']||this['_color'][_0x5ea8d1(_0x39f812._0x122653)](this['_colorHidden']);}get[_0x3d5d32(0x257)](){const _0x35c1c9=_0x3d5d32;return this[_0x35c1c9(0x21a)];}set['planeAngle'](_0xfc015c){const _0x2e469c=_0x3d5d32;this[_0x2e469c(0x21a)]=_0xfc015c,this['_planeAngleRadians']=Cesium__namespace['Math']['toRadians'](_0xfc015c);}[_0x3d5d32(0xacd)](_0x48dd6c){const _0x178183=_0x3d5d32;this['_postProcessStage']&&(this['_postProcessStage']['enabled']=_0x48dd6c&&this[_0x178183(0xda3)]['length']>0x0);}['_setOptionsHook'](_0x8b8cf2,_0x1b7927){const _0x5107be={_0x1a8304:0xff8,_0x3bb565:0x1076,_0x9ad8f6:0xe8f,_0x4b753a:0xe8f,_0xa0402b:0x882,_0x3bdd94:0x257},_0x4c965e=_0x3d5d32;this[_0x4c965e(_0x5107be._0x1a8304)]=_0x8b8cf2['eventType']??EventType['click'],this[_0x4c965e(0x1076)]=_0x8b8cf2[_0x4c965e(_0x5107be._0x3bb565)]??0x6,this[_0x4c965e(_0x5107be._0x9ad8f6)]=getCesiumColor(_0x8b8cf2[_0x4c965e(_0x5107be._0x4b753a)],Cesium__namespace[_0x4c965e(_0x5107be._0xa0402b)][_0x4c965e(0x7a7)]),this[_0x4c965e(0x3b2)]=_0x8b8cf2[_0x4c965e(0x3b2)],this['showPlane']=_0x8b8cf2['showPlane']??![],this['planeAngle']=_0x8b8cf2[_0x4c965e(_0x5107be._0x3bdd94)]??0xa,this['glow']=_0x8b8cf2['glow']??![],this['glowPower']=_0x8b8cf2['glowPower']??0x1,this[_0x4c965e(0x4ff)]=_0x8b8cf2['glowStrength']??0x3,this['onlySelected']=_0x8b8cf2['onlySelected']??![];}['_mountedHook'](){const _0x4b6f7d={_0x38faa0:0xc64,_0x225b21:0xcc3,_0x6945f5:0x2e7},_0x133111={_0x39afa9:0x24e},_0x58d2a8={_0x35bbd4:0x665},_0x4bf2b0={_0x424383:0x1076},_0x1449d9=_0x3d5d32,_0x35c7e5=this,_0x11f194=this['name']||this['type']||'',_0x5001d5=new CesiumRenderPass({'name':_0x11f194+_0x1449d9(0x65b),'vertexShader':_0x1449d9(0x22c),'fragmentShader':_0x1449d9(0x2c1),'sampler':new Cesium__namespace['Sampler']({'minificationFilter':Cesium__namespace['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium__namespace['TextureMagnificationFilter']['LINEAR']})}),_0x3d8e46=new Cesium__namespace['PostProcessStage']({'name':_0x11f194+_0x1449d9(0x407),'uniforms':{'outlineWidth'(){const _0x5e1fcc=_0x1449d9;return _0x35c7e5[_0x5e1fcc(_0x4bf2b0._0x424383)];},'devicePixelRatio':devicePixelRatio,'thresholdAngle':function(){return _0x35c7e5['_planeAngleRadians'];},'useSingleColor':function(){return _0x35c7e5['_useSingleColor'];},'showOutlineOnly':function(){const _0x3763fd=_0x1449d9;return!_0x35c7e5[_0x3763fd(0xd20)];},'visibleEdgeColor':function(){return _0x35c7e5['color'];},'hiddenEdgeColor':function(){return _0x35c7e5['colorHidden'];},'maskTexture'(){const _0x5e9f9f=_0x1449d9;return _0x5001d5[_0x5e9f9f(_0x58d2a8._0x35bbd4)];},'maskDepthTexture'(){return _0x5001d5['depthTexture'];}},'fragmentShader':'\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20vec2\x20colorTextureDimensions;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20depthTexture;\x0a\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskDepthTexture;\x0a\x20\x20\x20\x20uniform\x20float\x20thresholdAngle;\x0a\x20\x20\x20\x20uniform\x20bool\x20showOutlineOnly;\x0a\x0a\x20\x20\x20\x20uniform\x20float\x20outlineWidth;\x0a\x20\x20\x20\x20uniform\x20float\x20devicePixelRatio;\x0a\x20\x20\x20\x20uniform\x20vec3\x20visibleEdgeColor;\x0a\x20\x20\x20\x20uniform\x20vec3\x20hiddenEdgeColor;\x0a\x20\x20\x20\x20uniform\x20bool\x20useSingleColor;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20float\x20lengthSq(vec3\x20v){\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20v.x\x20*\x20v.x\x20+\x20v.y\x20*\x20v.y\x20+\x20v.z\x20*\x20v.z;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20float\x20normal_angleTo(vec3\x20a,vec3\x20b){\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20denominator\x20=\x20\x20sqrt(\x20\x20lengthSq(a)\x20*\x20lengthSq(b)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(\x20denominator\x20==\x200.\x20)\x20return\x20czm_pi\x20/\x202.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20theta\x20=\x20dot(a,\x20b\x20)\x20/\x20denominator;\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20clamp,\x20to\x20handle\x20numerical\x20problems\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20\x20acos(\x20\x20clamp(\x20theta,\x20-\x201.,\x201.\x20)\x20);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20compareNormal(vec4\x20n1,vec4\x20n2){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(\x20\x20abs\x20(\x20\x20normal_angleTo(\x20n1.xyz\x20,\x20n2.xyz\x20)\x20)\x20<\x20thresholdAngle\x20){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x200.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x201.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20compareDepth(const\x20in\x20vec2\x20uv){\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20maskDepth\x20=\x20czm_readDepth(\x20maskDepthTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20nonDepth\x20=\x20czm_readDepth(\x20depthTexture,\x20uv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20maskDepth>nonDepth?1.:0.;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20void\x20main(){\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv=v_textureCoordinates;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20vec4\x20color\x20=\x20texture(\x20colorTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20maskColor\x20=\x20texture(\x20maskTexture,\x20vUv);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(\x20maskColor.a\x20<\x200.0001){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20invSize\x20=\x20outlineWidth\x20/\x20colorTextureDimensions;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20uvOffset\x20=\x20vec4(1.0,\x200.0,\x200.0,\x201.0)\x20*\x20vec4(invSize,\x20invSize);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c1\x20=\x20texture(\x20maskTexture,\x20vUv\x20+\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c2\x20=\x20texture(\x20maskTexture,\x20vUv\x20-\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c3\x20=\x20texture(\x20maskTexture,\x20vUv\x20+\x20uvOffset.yw);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20c4\x20=\x20texture(\x20maskTexture,\x20vUv\x20-\x20uvOffset.yw);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20d;\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(showOutlineOnly){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff1\x20=\x20(c1.a\x20-\x20c2.a)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff2\x20=\x20(c3.a\x20-\x20c4.a)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d\x20=\x20length(\x20vec2(diff1,\x20diff2)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff1\x20=\x20compareNormal(c1,c2)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20diff2\x20=\x20compareNormal(c3,c4)*0.5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d\x20=\x20length(\x20vec2(diff1,\x20diff2)\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(useSingleColor==false){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp1\x20=\x20compareDepth(\x20vUv\x20+\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp2\x20=\x20compareDepth(\x20vUv\x20-\x20uvOffset.xy);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp3\x20=\x20compareDepth(\x20vUv\x20+\x20uvOffset.yw);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20dp4\x20=\x20compareDepth(\x20vUv\x20-\x20uvOffset.yw);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20a1\x20=\x20min(dp1,\x20dp2);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20a2\x20=\x20min(dp3,\x20dp4);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20visibilityFactor\x20=\x20min(a1,\x20a2);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20edgeColor\x20=\x201.0\x20-\x20visibilityFactor\x20>\x200.001\x20?\x20visibleEdgeColor\x20:\x20hiddenEdgeColor;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color+\x20vec4(\x20edgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(\x20edgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20out_FragColor\x20=color+\x20vec4(\x20visibleEdgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20\x20vec4(\x20visibleEdgeColor\x20,\x201.\x20)\x20*\x20vec4(d);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20'});_0x5001d5['stage']=_0x3d8e46;const _0x5bdb98=createBlurStage(_0x11f194+'Blur1',0x4,0x1,0.75),_0x31fe85=createBlurStage(_0x11f194+'Blur2',0x4,0x4,0.5),_0x2ea95f=new Cesium__namespace['PostProcessStageComposite']({'name':_0x11f194+'BlurComposite','stages':[_0x3d8e46,_0x5bdb98,_0x31fe85],'inputPreviousStageTexture':!![]}),_0x2591a4=new Cesium__namespace[(_0x1449d9(_0x4b6f7d._0x38faa0))]({'name':_0x11f194+_0x1449d9(_0x4b6f7d._0x225b21),'uniforms':{'showGlow':function(){const _0x545d5d=_0x1449d9;return _0x35c7e5[_0x545d5d(0xdf8)];},'edgeGlow':function(){const _0x2b3776=_0x1449d9;return _0x35c7e5[_0x2b3776(_0x133111._0x39afa9)];},'edgeStrength':function(){return _0x35c7e5['glowStrength'];},'edgeOnly'(){const _0x3e2916=_0x1449d9;return _0x35c7e5[_0x3e2916(0xf64)];},'maskTexture'(){return _0x5001d5['texture'];},'lineTexture':_0x3d8e46['name'],'edgeTexture1':_0x5bdb98[_0x1449d9(0xaed)],'edgeTexture2':_0x2ea95f['name']},'fragmentShader':'\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20edgeTexture1;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20edgeTexture2;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20lineTexture;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20maskTexture;\x0a\x20\x20\x20\x20uniform\x20bool\x20showGlow;\x0a\x20\x20\x20\x20uniform\x20float\x20edgeGlow;\x0a\x20\x20\x20\x20uniform\x20bool\x20edgeOnly;\x0a\x20\x20\x20\x20uniform\x20float\x20edgeStrength;\x0a\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20void\x20main(){\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv\x20=v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeColor=texture(\x20lineTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20color=texture(\x20colorTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20opacity=1.;\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(edgeOnly){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20maskColor=texture(\x20maskTexture,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20opacity=1.-maskColor.a;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20maskColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(showGlow){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeValue1\x20=\x20texture(edgeTexture1,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20edgeValue2\x20=\x20texture(edgeTexture2,\x20vUv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20glowColor\x20=\x20edgeValue1\x20+\x20edgeValue2\x20*\x20edgeGlow;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20opacity\x20*\x20color\x20+\x20edgeColor\x20+\x20edgeStrength\x20*\x20(1.\x20-\x20edgeColor.r)\x20*\x20glowColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20else{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20opacity\x20*\x20color\x20+\x20edgeColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20'}),_0x25ff34=new Cesium__namespace['PostProcessStageComposite']({'name':_0x11f194+'Composite','stages':[_0x2ea95f,_0x2591a4],'inputPreviousStageTexture':![]});function _0x3f2e78(_0x467c91){const _0x32716c={_0x1399cd:0xe8f},_0x2a8287={_0x4955fe:0x4ff},_0x59d54a=_0x1449d9;Object[_0x59d54a(0xba4)](_0x467c91,{'showGlow':{'get'(){return _0x35c7e5['glow'];},'set'(_0x3f1280){const _0x3b5026=_0x59d54a;_0x35c7e5[_0x3b5026(0xdf8)]=_0x3f1280;}},'edgeGlow':{'get'(){return _0x35c7e5['glowPower'];},'set'(_0x2d323a){_0x35c7e5['glowPower']=_0x2d323a;}},'edgeStrength':{'get'(){const _0x8cedc1=_0x59d54a;return _0x35c7e5[_0x8cedc1(_0x2a8287._0x4955fe)];},'set'(_0x2403c1){_0x35c7e5['glowStrength']=_0x2403c1;}},'thresholdAngle':{'get'(){return _0x35c7e5['_planeAngleRadians'];},'set'(_0x74ef2e){_0x35c7e5['_planeAngleRadians']=_0x74ef2e;}},'showOutlineOnly':{'get'(){const _0x3dff17=_0x59d54a;return!_0x35c7e5[_0x3dff17(0xd20)];},'set'(_0xa1597a){_0x35c7e5['showPlane']=!_0xa1597a;}},'edgeOnly':{'get'(){return _0x35c7e5['onlySelected'];},'set'(_0x444610){_0x35c7e5['onlySelected']=_0x444610;}},'useSingleColor':{'get'(){return _0x35c7e5['_useSingleColor'];}},'outlineWidth':{'get'(){const _0x366c3a=_0x59d54a;return _0x35c7e5[_0x366c3a(0x1076)];},'set'(_0x2e6337){_0x35c7e5['width']=_0x2e6337;}},'visibleEdgeColor':{'get'(){return _0x35c7e5['color'];},'set'(_0x3ea1e3){const _0x1e37b4=_0x59d54a;_0x35c7e5[_0x1e37b4(_0x32716c._0x1399cd)]=_0x3ea1e3;}},'hiddenEdgeColor':{'get'(){return _0x35c7e5['colorHidden'];},'set'(_0x5ef8e4){const _0x533381=_0x59d54a;_0x35c7e5[_0x533381(0x3b2)]=_0x5ef8e4;}}});}_0x3f2e78(_0x25ff34),_0x25ff34['_uniforms']=_0x25ff34[_0x1449d9(0xd9c)]||{},_0x3f2e78(_0x25ff34[_0x1449d9(0xd9c)]),_0x25ff34['selected']=[],_0x25ff34[_0x1449d9(0xa63)]=![],this[_0x1449d9(_0x4b6f7d._0x6945f5)]=_0x25ff34;}['_addedHook'](){this['eventType']&&this['_map']['on'](this['eventType'],this['_map_clickHandler'],this);}[_0x3d5d32(0x566)](){const _0x2f4185={_0x4e38ac:0x1d1},_0x1fb4f6=_0x3d5d32;this['eventType']&&this[_0x1fb4f6(_0x2f4185._0x4e38ac)][_0x1fb4f6(0x9e7)](this['eventType'],this['_map_clickHandler'],this);}['_map_clickHandler'](_0x51d8c8){const _0x458863=_0x3d5d32,_0x152986=this['options']['objectsToExclude'];if(_0x152986)for(let _0x146161=0x0,_0x49e12c=_0x152986[_0x458863(0xc84)];_0x146161<_0x49e12c;_0x146161++){const _0xab3944=_0x152986[_0x146161];if(_0x51d8c8['graphic']===_0xab3944||_0x51d8c8['layer']===_0xab3944)return;}const _0x40ae34=this[_0x458863(0x1d1)]['mouseEvent']['getPicked'](_0x51d8c8);this['selected']=_0x40ae34;}}register(_0x3d5d32(0xe7a),OutlineEffect);function createBlurStage(_0x5db880,_0x2eb23d,_0x493079,_0x27549b){const _0x3abcbe={_0x5ab244:0xcff,_0x11ca10:0xc64},_0x5e528b=_0x3d5d32,_0x43db79={'fragmentShader':'\x0a\x20\x20\x20\x20#define\x20MAX_RADIUS\x20'+_0x2eb23d+'\x0a\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20uniform\x20vec2\x20colorTextureDimensions;\x0a\x20\x20\x20\x20uniform\x20vec2\x20direction;\x0a\x20\x20\x20\x20uniform\x20float\x20kernelRadius;\x0a\x0a\x20\x20\x20\x20float\x20gaussianPdf(in\x20float\x20x,\x20in\x20float\x20sigma)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x200.39894\x20*\x20exp(\x20-0.5\x20*\x20x\x20*\x20x/(\x20sigma\x20*\x20sigma))/sigma;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20void\x20main()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20vUv=v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20invSize\x20=\x201.0\x20/\x20colorTextureDimensions;\x0a\x20\x20\x20\x20\x20\x20\x20\x20float\x20weightSum\x20=\x20gaussianPdf(0.0,\x20kernelRadius);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20diffuseSum\x20=\x20texture(\x20colorTexture,\x20vUv)\x20*\x20weightSum;\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20delta\x20=\x20direction\x20*\x20invSize\x20*\x20kernelRadius/float(MAX_RADIUS);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec2\x20uvOffset\x20=\x20delta;\x0a\x20\x20\x20\x20\x20\x20\x20\x20for(\x20int\x20i\x20=\x201;\x20i\x20<=\x20MAX_RADIUS;\x20i\x20++\x20)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20w\x20=\x20gaussianPdf(uvOffset.x,\x20kernelRadius);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20sample1\x20=\x20texture(\x20colorTexture,\x20vUv\x20+\x20uvOffset);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20sample2\x20=\x20texture(\x20colorTexture,\x20vUv\x20-\x20uvOffset);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20diffuseSum\x20+=\x20((sample1\x20+\x20sample2)\x20*\x20w);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20weightSum\x20+=\x20(2.0\x20*\x20w);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20uvOffset\x20+=\x20delta;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20diffuseSum/weightSum;\x0a\x20\x20\x20\x20}'},_0x3e9c30=new Cesium__namespace[(_0x5e528b(0xc64))]({'name':_0x5db880+_0x5e528b(_0x3abcbe._0x5ab244),'fragmentShader':_0x43db79[_0x5e528b(0x329)],'textureScale':_0x27549b,'forcePowerOfTwo':!![],'uniforms':{'kernelRadius':_0x493079,'direction':new Cesium__namespace[(_0x5e528b(0xb0e))](0x1,0x0)},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0x3fca16=new Cesium__namespace[(_0x5e528b(_0x3abcbe._0x11ca10))]({'name':_0x5db880+'_y_direction','fragmentShader':_0x43db79['fragmentShader'],'textureScale':_0x27549b,'forcePowerOfTwo':!![],'uniforms':{'kernelRadius':_0x493079,'direction':new Cesium__namespace['Cartesian2'](0x0,0x1)},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0x4973f7=new Cesium__namespace['PostProcessStageComposite']({'name':_0x5db880,'stages':[_0x3e9c30,_0x3fca16],'inputPreviousStageTexture':!![]});return _0x4973f7;}class BloomTargetEffect extends BaseEffect{constructor(_0x1ac851={}){const _0x2c80b6={_0x2ef7df:0xe8f,_0x11cc55:0xff8},_0x342205=_0x3d5d32;_0x1ac851={'contrast':0x80,'brightness':-0.3,'blurSamples':0x20,'delta':0x1,'sigma':3.78,'stepSize':0x5,'ratio':0x2,'threshold':0x0,'smoothWidth':0.01,..._0x1ac851},super(_0x1ac851),this[_0x342205(0xe8f)]=getCesiumColor(_0x1ac851[_0x342205(_0x2c80b6._0x2ef7df)],Cesium__namespace['Color']['WHITE']),this[_0x342205(_0x2c80b6._0x11cc55)]=_0x1ac851['eventType']??EventType['click'];}get['selected'](){const _0x33cd5f=_0x3d5d32;var _0x25f905;return(_0x25f905=this[_0x33cd5f(0x2e7)])===null||_0x25f905===void 0x0?void 0x0:_0x25f905['selected'];}set[_0x3d5d32(0xda3)](_0xc1bbe5){const _0x454993={_0x45d2be:0x2e7,_0x4211dc:0xda3,_0x611bc6:0xda3},_0x5a120a=_0x3d5d32;let _0x426b8a=[];_0xc1bbe5&&(!Array['isArray'](_0xc1bbe5)?_0x426b8a=this[_0x5a120a(0x1087)]([_0xc1bbe5]):_0x426b8a=this['_getPickIds'](_0xc1bbe5)),this['_postProcessStage']&&(this[_0x5a120a(_0x454993._0x45d2be)][_0x5a120a(_0x454993._0x4211dc)]=_0x426b8a,this['_postProcessStage']['enabled']=this[_0x5a120a(0xa63)]&&this[_0x5a120a(_0x454993._0x611bc6)]['length']>0x0);}['_enabledHook'](_0x193ce2){const _0x3253da={_0xe1da31:0xc84},_0x7eef92=_0x3d5d32;this['_postProcessStage']&&(this['_postProcessStage']['enabled']=_0x193ce2&&this[_0x7eef92(0xda3)][_0x7eef92(_0x3253da._0xe1da31)]>0x0);}[_0x3d5d32(0xe4c)](){const _0x36821b={_0x346bfe:0xde4,_0x264f88:0xaed},_0x58cdb6={_0x553a21:0x3d7},_0x27b02b=_0x3d5d32,_0xe98983=new Cesium__namespace['PostProcessStage']({'name':this['name']+'high','fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20vec3\x20marsColor;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20marsOpacity;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20threshold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20smoothWidth;\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20main()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20marstexel\x20=\x20texture(\x20colorTexture,\x20v_textureCoordinates\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!czm_selected())\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20marstexel\x20=\x20vec4(0.);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20luma\x20=\x20vec3(\x200.299,\x200.587,\x200.114\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20marsv\x20=\x20dot(\x20marstexel.xyz,\x20luma\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20outputColor\x20=\x20vec4(marsColor.rgb,marsOpacity);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20alpha\x20=\x20smoothstep(threshold,\x20threshold\x20+\x20smoothWidth,\x20marsv);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20mix(\x20outputColor,\x20marstexel,\x20alpha\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','uniforms':{'marsColor':Cesium__namespace[_0x27b02b(0x882)]['BLACK'],'marsOpacity':0x1,'smoothWidth':()=>{return this['options']['smoothWidth'];},'threshold':()=>{const _0x1e6d88=_0x27b02b;return this[_0x1e6d88(0x433)][_0x1e6d88(_0x58cdb6._0x553a21)];}}}),_0x4ea971='\x0a\x20\x20\x20\x20#define\x20SAMPLES\x20'+this['options']['blurSamples']+_0x27b02b(_0x36821b._0x346bfe),_0x1587be=new Cesium__namespace[(_0x27b02b(0xc64))]({'name':this['name']+'blur_x','fragmentShader':_0x4ea971,'uniforms':{'delta':()=>{return this['options']['delta'];},'sigma':()=>{return this['options']['sigma'];},'stepSize':()=>{return this['options']['stepSize'];},'direction':0x0},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0xa4231a=new Cesium__namespace['PostProcessStage']({'name':this['name']+'blur_y','fragmentShader':_0x4ea971,'uniforms':{'delta':()=>{return this['options']['delta'];},'sigma':()=>{return this['options']['sigma'];},'stepSize':()=>{return this['options']['stepSize'];},'direction':0x1},'sampleMode':Cesium__namespace['PostProcessStageSampleMode']['LINEAR']}),_0x46d14e=new Cesium__namespace['PostProcessStageComposite']({'name':this[_0x27b02b(_0x36821b._0x264f88)]+_0x27b02b(0x82c),'stages':[_0x1587be,_0xa4231a]}),_0x40e1d3=new Cesium__namespace[(_0x27b02b(0x9a7))]({'name':this['name']+'_blur_comp','stages':[_0xe98983,_0x46d14e],'inputPreviousStageTexture':!![]}),_0xa1543d=new Cesium__namespace[(_0x27b02b(0xc64))]({'name':this[_0x27b02b(0xaed)]+'contrast_bias','fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20contrast;\x0a\x20\x20\x20\x20\x20\x20\x20\x20uniform\x20float\x20brightness;\x0a\x20\x20\x20\x20\x20\x20\x20\x20void\x20main(void)\x0a\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vec3\x20sceneColor\x20=\x20texture(colorTexture,\x20v_textureCoordinates).xyz;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20czm_RGBToHSB(sceneColor);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor.z\x20+=\x20brightness;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20czm_HSBToRGB(sceneColor);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20factor\x20=\x20(259.0\x20*\x20(contrast\x20+\x20255.0))\x20/\x20(255.0\x20*\x20(259.0\x20-\x20contrast));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sceneColor\x20=\x20factor\x20*\x20(sceneColor\x20-\x20vec3(0.5))\x20+\x20vec3(0.5);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(sceneColor,\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}','uniforms':{'contrast':()=>{return this['options']['contrast'];},'brightness':()=>{return this['options']['brightness'];}}}),_0x4e782f=new Cesium__namespace['PostProcessStageComposite']({'name':this['name']+'contrast_bias_blur','stages':[_0xa1543d,_0x40e1d3]}),_0x149133=new Cesium__namespace['PostProcessStage']({'name':this[_0x27b02b(0xaed)]+'generate_composite','fragmentShader':'\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20colorTexture;\x0a\x20\x20\x20\x20\x20\x20uniform\x20sampler2D\x20bloomTexture;\x0a\x20\x20\x20\x20\x20\x20uniform\x20float\x20ratio;\x0a\x20\x20\x20\x20\x20\x20uniform\x20vec4\x20color;\x0a\x20\x20\x20\x20\x20\x20in\x20vec2\x20v_textureCoordinates;\x0a\x20\x20\x20\x20\x20\x20void\x20main(void)\x0a\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20color1\x20=\x20texture(colorTexture,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20\x20\x20\x20\x20vec4\x20bloom\x20=\x20texture(bloomTexture,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20\x20\x20\x20\x20bloom\x20*=\x20color\x20;\x0a\x20\x20\x20\x20\x20\x20\x20\x20#ifdef\x20CZM_SELECTED_FEATURE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(czm_selected())\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bloom\x20*=\x20ratio;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#endif\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20bloom\x20+\x20color1;\x0a\x20\x20\x20\x20\x20\x20}','uniforms':{'bloomTexture':_0x4e782f[_0x27b02b(_0x36821b._0x264f88)],'ratio':()=>{return this['options']['ratio'];},'color':()=>{const _0x449d21=_0x27b02b;return this[_0x449d21(0xe8f)];}}});this['_postProcessStage']=new Cesium__namespace[(_0x27b02b(0x9a7))]({'name':this['name'],'stages':[_0x4e782f,_0x149133],'inputPreviousStageTexture':![]}),this['_postProcessStage']['selected']=[];}['_addedHook'](){const _0x1f25de=_0x3d5d32;this[_0x1f25de(0xff8)]&&this[_0x1f25de(0x1d1)]['on'](this['eventType'],this['_map_clickHandler'],this);}['_removedHook'](){const _0x29d0e8=_0x3d5d32;this[_0x29d0e8(0xff8)]&&this[_0x29d0e8(0x1d1)]['off'](this[_0x29d0e8(0xff8)],this['_map_clickHandler'],this);}['_map_clickHandler'](_0x2b9c4b){const _0xd982c6={_0x5a1fba:0xc77},_0x297385=_0x3d5d32,_0xe848f9=this[_0x297385(0x433)][_0x297385(_0xd982c6._0x5a1fba)];if(_0xe848f9)for(let _0x3847be=0x0,_0x3a8194=_0xe848f9['length'];_0x3847be<_0x3a8194;_0x3847be++){const _0x565f70=_0xe848f9[_0x3847be];if(_0x2b9c4b['graphic']===_0x565f70||_0x2b9c4b['layer']===_0x565f70)return;}const _0x4cafcf=this['_map']['mouseEvent']['getPicked'](_0x2b9c4b);this[_0x297385(0xda3)]=_0x4cafcf;}}register('bloomTarget',BloomTargetEffect);var index$2={'__proto__':null,'BaseEffect':BaseEffect,'FogEffect':FogEffect,'RainEffect':RainEffect,'SnowEffect':SnowEffect,'SnowCoverEffect':SnowCoverEffect,'InvertedEffect':InvertedEffect,'NightVisionEffect':NightVisionEffect,'BloomEffect':BloomEffect,'BrightnessEffect':BrightnessEffect,'BlackAndWhiteEffect':BlackAndWhiteEffect,'MosaicEffect':MosaicEffect,'DepthOfFieldEffect':DepthOfFieldEffect,'OutlineEffect':OutlineEffect,'BloomTargetEffect':BloomTargetEffect};class BaseControl extends BaseThing{constructor(_0xf8bc80={}){const _0x3c2465=_0x3d5d32;super(_0xf8bc80),this['_show']=_0xf8bc80[_0x3c2465(0x792)]??!![];}get['show'](){return this['_show'];}set['show'](_0x55b7c9){const _0x34c980={_0x274e70:0xd92,_0x4fee0b:0x68e},_0x3a49a2=_0x3d5d32;if(this[_0x3a49a2(0x443)]===_0x55b7c9)return;this['_show']=_0x55b7c9,this['_container']&&(this['_container']['style'][_0x3a49a2(_0x34c980._0x274e70)]=_0x55b7c9?'block':'none'),this['_showHook']&&this[_0x3a49a2(_0x34c980._0x4fee0b)](_0x55b7c9),this['_map']['fire'](EventType[_0x3a49a2(0x3a2)],{'control':this});}get['type'](){return this['_type'];}get['container'](){return this['_container'];}get['parentContainer'](){var _0x330808;if(this['options']['parentContainer'])return this['options']['parentContainer'];return(_0x330808=this['_map'])===null||_0x330808===void 0x0?void 0x0:_0x330808['container'];}get['parentContainerId'](){var _0x25160b;return(_0x25160b=this['parentContainer'])===null||_0x25160b===void 0x0?void 0x0:_0x25160b['id'];}[_0x3d5d32(0xacd)](_0x156b08){const _0x47b20f={_0x1e4dce:0x72e,_0x1cd3d1:0x68e},_0x16e94d=_0x3d5d32;this['_container']&&(this[_0x16e94d(0x51f)]['style'][_0x16e94d(0xd92)]=_0x156b08?'block':_0x16e94d(_0x47b20f._0x1e4dce)),this[_0x16e94d(_0x47b20f._0x1cd3d1)]&&this['_showHook'](_0x156b08);}['setOptions'](_0x1e020d){const _0x33e414=_0x3d5d32;if(isBoolean(_0x1e020d))return;return this['options']=merge(this[_0x33e414(0x433)],_0x1e020d),this[_0x33e414(0x981)](),this;}['reload'](){const _0x554c9b=this['_map'];_0x554c9b&&(this['_onRemove'](),delete this['_container'],this['_onAdd'](_0x554c9b));}['addTo'](_0x58e89e){return _0x58e89e&&_0x58e89e['addControl']&&_0x58e89e['addControl'](this),this;}['remove'](_0x1109b6){const _0x40a985={_0x3042a3:0x1d1},_0x3dddd5=_0x3d5d32;this[_0x3dddd5(_0x40a985._0x3042a3)]&&this['_map'][_0x3dddd5(0x1d4)](this,_0x1109b6);}['_onAdd'](_0xe4abd){const _0x34f054={_0x4223e5:0x1d1,_0x5246ee:0xe4c,_0x56f41d:0x84e,_0x1d3d47:0x226,_0x526216:0x51f,_0x33235d:0x837},_0x1f85e7=_0x3d5d32;if(this['isAdded']||this['_state']===State[_0x1f85e7(0x37b)])return;this['_state']=State[_0x1f85e7(0x37b)],this[_0x1f85e7(_0x34f054._0x4223e5)]=_0xe4abd,this['_container']?!this['_container']['parentNode']&&this['_addChildContainer'](this['_container']):(this[_0x1f85e7(_0x34f054._0x5246ee)]&&this['_mountedHook'](),this['_container']&&this[_0x1f85e7(_0x34f054._0x56f41d)](this['_container'])),this[_0x1f85e7(_0x34f054._0x1d3d47)]&&this['_addedHook'](),this['_container']&&this[_0x1f85e7(_0x34f054._0x526216)]['addEventListener']('click',this[_0x1f85e7(_0x34f054._0x33235d)]['bind'](this)),this['_state']=State['ADDED'];}['_addChildContainer'](_0x57e482){const _0x4bd8ab={_0x3fa866:0xaf4,_0x43fa6a:0x22a,_0x3a6224:0x4da,_0x4cda9b:0x433,_0x39e02f:0x85b},_0x452df4=_0x3d5d32;if(this['options']['insertBefore'])this[_0x452df4(0x46a)][_0x452df4(_0x4bd8ab._0x3fa866)](_0x57e482,this['options']['insertBefore']);else{if(Cesium__namespace['defined'](this['options'][_0x452df4(_0x4bd8ab._0x43fa6a)])){const _0x366aa1=this['parentContainer'][_0x452df4(_0x4bd8ab._0x3a6224)];_0x366aa1['length']0x0)for(let _0x452075=0x0;_0x452075<_0x4ea241['length'];_0x452075++){_0x4ea241[_0x452075][_0x26467a]=function(_0x4a0fcb){const _0x29d8fd=_0x1dd01a,_0x536da1=_0x4a0fcb['currentTarget'][_0x29d8fd(_0xf9e261._0x33206f)](_0x3d4127);_0x52675a[_0x536da1]&&_0x4a0fcb[_0x29d8fd(0x946)][_0x29d8fd(_0xf9e261._0x1a35d2)](_0x3d4127,_0x52675a[_0x536da1]);};}}}class Animation extends BaseCzmControl{constructor(_0x211542={}){const _0x2e2925={_0x3aef2c:0x30a},_0x1f2eeb=_0x3d5d32;super(_0x211542),this[_0x1f2eeb(_0x2e2925._0x3aef2c)]='_animation',this['_czmContainerKey']='_container';}[_0x3d5d32(0xdff)](){return create$3('div','cesium-viewer-animationContainer');}['_createCzmControl'](){const _0x412cca={_0x416cfd:0x51f},_0x11a401=_0x3d5d32;return new Cesium__namespace['Animation'](this[_0x11a401(_0x412cca._0x416cfd)],new Cesium__namespace[(_0x11a401(0x75f))](this['viewer'][_0x11a401(0x45b)]));}['_toChineseLang'](_0x78bd6f){const _0x519233={_0x27ad15:0x434},_0x46cf4d=_0x3d5d32;let _0x16a15=_0x78bd6f['getElementsByClassName'](_0x46cf4d(0x8f8));if(_0x16a15['length']>0x0){_0x16a15=_0x16a15[0x0];const _0x43f5f4={'Today':'今天','Today\x20(real-time)':_0x46cf4d(_0x519233._0x27ad15),'Pause':'暂停','Play\x20Reverse':'后退播放','Play\x20Forward':_0x46cf4d(0x3ec),'Current\x20time\x20not\x20in\x20range':'当前时间不在范围内'};this['_updateDomByTagName'](_0x16a15,_0x43f5f4,'title');}}}register$1('animation',Animation);class BaseLayerPicker extends BaseCzmControl{constructor(_0x2ec1ad={}){const _0x4674c7={_0x2ec4e5:0x9d0},_0x4e9967=_0x3d5d32;super(_0x2ec1ad),this['_czmControlKey']='_baseLayerPicker',this[_0x4e9967(_0x4674c7._0x2ec4e5)]='_element',this[_0x4e9967(0x433)][_0x4e9967(0x22a)]=this['options']['insertIndex']??0x1;}get['parentContainer'](){const _0x1c3525={_0x1dbf4d:0x433,_0x5be077:0x46a,_0x5d7365:0x35e},_0x44fbf4=_0x3d5d32;if(this['options'][_0x44fbf4(0x46a)])return this[_0x44fbf4(_0x1c3525._0x1dbf4d)][_0x44fbf4(_0x1c3525._0x5be077)];return this['_map'][_0x44fbf4(_0x1c3525._0x5d7365)];}['_createCzmControl'](){const _0x3918e1={_0x47d7c6:0xfc1,_0xfc0987:0xf3a,_0x1d4b6e:0x38a,_0x7396a1:0x685},_0x38be57=_0x3d5d32;var _0x7069be;const _0x18bebe=this['_map']['options']['control']||{},_0x312180=this[_0x38be57(0x433)],_0x529709={'map':this['_map'],'globe':this['_map'][_0x38be57(_0x3918e1._0x47d7c6)]['globe'],'imageryProviderViewModels':_0x312180['imageryProviderViewModels']||_0x18bebe[_0x38be57(0xdb7)],'selectedImageryProviderViewModel':_0x312180['selectedImageryProviderViewModel']||_0x18bebe['selectedImageryProviderViewModel'],'terrainProviderViewModels':_0x312180['terrainProviderViewModels']||_0x18bebe['terrainProviderViewModels'],'selectedTerrainProviderViewModel':_0x312180['selectedTerrainProviderViewModel']||_0x18bebe[_0x38be57(0x685)]};if(!_0x529709['imageryProviderViewModels']&&((_0x7069be=this['_map']['options'][_0x38be57(_0x3918e1._0xfc0987)])===null||_0x7069be===void 0x0?void 0x0:_0x7069be['length'])>0x0){const _0x5c538f=getImageryProviderViewModels(this['_map']['options'][_0x38be57(0xf3a)],this['_map']['options']['templateValues']);_0x529709['imageryProviderViewModels']=_0x5c538f[_0x38be57(0xdb7)],_0x5c538f[_0x38be57(0x343)]!==-0x1&&(_0x529709['selectedImageryProviderViewModel']=_0x5c538f['imageryProviderViewModels'][_0x5c538f['selectedIndex']]);}if(!_0x529709['terrainProviderViewModels']){var _0xcf39e7;_0x529709['terrainProviderViewModels']=getTerrainProviderViewModels(this['_map'][_0x38be57(_0x3918e1._0x1d4b6e)]()),_0x529709[_0x38be57(_0x3918e1._0x7396a1)]=_0x529709['terrainProviderViewModels'][(_0xcf39e7=this['_map']['options']['terrain'])!==null&&_0xcf39e7!==void 0x0&&_0xcf39e7['show']?0x1:0x0];}return new Cesium__namespace[(_0x38be57(0x3a9))](this['_map']['toolbar'],_0x529709);}[_0x3d5d32(0xd40)](_0x5b9b8f){const _0x19f25a={_0x3072f5:0xc84,_0x2a5657:0x5bf,_0x1f2f38:0xd59,_0x238271:0x3d3},_0x29d48d={_0x88fd2c:0x946},_0x579947=_0x3d5d32;let _0xaaffa0=_0x5b9b8f['getElementsByClassName']('cesium-baseLayerPicker-dropDown');if(_0xaaffa0[_0x579947(_0x19f25a._0x3072f5)]>0x0){_0xaaffa0=_0xaaffa0[0x0];const _0x30c6f4={'Imagery':'影像','Cesium\x20ion':'官方ION','Other':'其他','Terrain':_0x579947(_0x19f25a._0x2a5657),'WGS84\x20Ellipsoid':'WGS84\x20椭球','Cesium\x20World\x20Terrain':'Cesium\x20世界地形图','WGS84\x20standard\x20ellipsoid,\x20also\x20known\x20as\x20EPSG:4326':'WGS84标准椭球,又称EPSG:4326','High-resolution\x20global\x20terrain\x20tileset\x20curated\x20from\x20several\x20datasources\x20and\x20hosted\x20by\x20Cesium\x20ion':'高分辨率全球地形图块集由几个数据源组成,由Cesium\x20ion托管'};this[_0x579947(_0x19f25a._0x1f2f38)](_0xaaffa0,_0x30c6f4,'cesium-baseLayerPicker-sectionTitle'),this[_0x579947(0xd59)](_0xaaffa0,_0x30c6f4,'cesium-baseLayerPicker-categoryTitle'),this['_updateDomInnerHtml'](_0xaaffa0,_0x30c6f4,'cesium-baseLayerPicker-itemLabel'),this['_updateDomAttribute'](_0xaaffa0,_0x30c6f4,_0x579947(_0x19f25a._0x238271),'title');const _0x17b0eb=_0x5b9b8f['getElementsByClassName']('cesium-baseLayerPicker-selected');_0x17b0eb['length']>0x0&&(_0x17b0eb[0x0]['parentElement'][_0x579947(0x3b7)]=function(_0x304154){const _0x2d227b=_0x579947,_0x1f9966=_0x304154[_0x2d227b(_0x29d48d._0x88fd2c)]['getAttribute']('title'),_0x587734=_0x1f9966['split']('\x0a');let _0x91f00f='',_0x374802='';_0x30c6f4[_0x587734[0x0]]?_0x91f00f+=_0x30c6f4[_0x587734[0x0]]:_0x91f00f+=_0x587734[0x0],_0x30c6f4[_0x587734[0x0]]?_0x374802+=_0x30c6f4[_0x587734[0x1]]:_0x374802+=_0x587734[0x1],_0x304154['currentTarget']['setAttribute']('title',_0x91f00f+'\x0a'+_0x374802);});}}}register$1(_0x3d5d32(0x5f2),BaseLayerPicker);class FullscreenButton extends BaseCzmControl{constructor(_0x58a6b3={}){const _0x234b98=_0x3d5d32;super(_0x58a6b3),this[_0x234b98(0x30a)]='_fullscreenButton',this['_czmContainerKey']='_container';}get[_0x3d5d32(0x46a)](){const _0x3e6cfb=_0x3d5d32;if(this['options']['parentContainer'])return this['options']['parentContainer'];return this['_map'][_0x3e6cfb(0x35e)];}['_createCzmContainer'](){const _0x3d7c68={_0x112593:0x667,_0x4202a3:0xbdf,_0x5e191c:0xdde},_0x2e6413=_0x3d5d32,_0x5233df=create$3(_0x2e6413(_0x3d7c68._0x112593),_0x2e6413(_0x3d7c68._0x4202a3));return _0x5233df[_0x2e6413(_0x3d7c68._0x5e191c)][_0x2e6413(0xd92)]='inline-block',_0x5233df;}[_0x3d5d32(0x59e)](){const _0x4e296c=_0x3d5d32;return new Cesium__namespace['FullscreenButton'](this[_0x4e296c(0x51f)],this['options']['fullscreenElement']);}[_0x3d5d32(0xd0d)](_0x3a1bd3){const _0x562580={_0x4cad6e:0x4c2},_0x1df5ba=_0x3d5d32;var _0xad13e6;removeClass(_0x3a1bd3,'cesium-viewer-fullscreenContainer'),addClass(_0x3a1bd3,_0x1df5ba(0xbdf)),_0x3a1bd3['style']['display']='inline-block',_0x3a1bd3['parentNode'][_0x1df5ba(0xac2)](_0x3a1bd3);const _0x56e987=(_0xad13e6=this[_0x1df5ba(_0x562580._0x4cad6e)]['navigationHelpButton'])===null||_0xad13e6===void 0x0?void 0x0:_0xad13e6['_wrapper'];_0x56e987?this['parentContainer']['insertBefore'](_0x3a1bd3,_0x56e987):this['parentContainer']['appendChild'](_0x3a1bd3);}[_0x3d5d32(0xd40)](_0x9f74dc){const _0x14d074=_0x3d5d32,_0x1e852c={'Full\x20screen':'全屏','Exit\x20full\x20screen':'退出全屏','Full\x20screen\x20unavailable':'全屏不可用'};this[_0x14d074(0x944)](_0x9f74dc,_0x1e852c,'cesium-fullscreenButton',_0x14d074(0xd50),'onmouseover');}}register$1('fullscreenButton',FullscreenButton);class GaodePOIGeocoder{constructor(_0x249d9b={}){const _0x3aa3d6=_0x3d5d32;this['options']=_0x249d9b,this['gaodekey']=_0x249d9b[_0x3aa3d6(0xdfc)]||gaodeArr;}['getArrayRandomOne'](){const _0x30c650=this['gaodekey'],_0xaf3f6c=Math['floor'](Math['random']()*_0x30c650['length']+0x1)-0x1;return _0x30c650[_0xaf3f6c];}['geocode'](_0x51c8fe){const _0x307bad={_0x29864c:0x52e,_0x454bc7:0x9a1,_0x50162d:0x79e,_0x36ac24:0x7e1,_0x47eb7c:0x9a9},_0x4b37e4={_0x1bb9ae:0x99c},_0x433b3b=this['getArrayRandomOne'](),_0x49def4=new Cesium__namespace['Resource']({'url':'https://restapi.amap.com/v3/place/text','queryParameters':{'count':0x14,'key':_0x433b3b,'keywords':_0x51c8fe,'types':'110000|120000|130000|140000|180000|190000|',...this['options']['parameters']||{}}}),_0x5dd640=this;return _0x49def4['fetchJson']()['then'](function(_0x39bbe9){const _0x24be88=_0x4132;if(_0x39bbe9['infocode']!==_0x24be88(_0x307bad._0x29864c))return logError$1('请求失败('+_0x39bbe9['infocode']+'):'+_0x39bbe9[_0x24be88(_0x307bad._0x454bc7)]),{};if(_0x39bbe9['pois']['length']===0x0)return logInfo(_0x24be88(_0x307bad._0x50162d)+_0x51c8fe+_0x24be88(0x2fe)),{};let _0x5c7a85=0xbb8;return _0x5dd640[_0x24be88(_0x307bad._0x36ac24)]['camera']['positionCartographic']['height']<_0x5c7a85&&(_0x5c7a85=_0x5dd640[_0x24be88(0x7e1)]['camera']['positionCartographic']['height']),_0x39bbe9[_0x24be88(_0x307bad._0x47eb7c)]['map'](function(_0x11ade6){const _0x3966e8=_0x24be88;let _0xb67df7=_0x11ade6[_0x3966e8(_0x4b37e4._0x1bb9ae)][_0x3966e8(0xdaa)](',');return _0xb67df7=gcj2wgs(_0xb67df7),{'displayName':_0x11ade6['name'],'destination':Cesium__namespace['Cartesian3']['fromDegrees'](_0xb67df7[0x0],_0xb67df7[0x1],_0x5c7a85)};});});}}class Geocoder extends BaseCzmControl{constructor(_0x46f450={}){const _0x28e4ac={_0x1dc480:0x30a},_0x57a4e0=_0x3d5d32;super(_0x46f450),this[_0x57a4e0(_0x28e4ac._0x1dc480)]='_geocoder',this['_czmContainerKey']='_form';}get['parentContainer'](){const _0x2a62eb=_0x3d5d32;if(this['options'][_0x2a62eb(0x46a)])return this['options']['parentContainer'];return this['_map']['toolbar'];}['_createCzmContainer'](){return create$3('div','cesium-viewer-geocoderContainer');}['_createCzmControl'](){const _0x224a5f=_0x3d5d32;let _0x3b70c6=this['options']['service'];if(!_0x3b70c6){const _0xf2d8dd=new GaodePOIGeocoder(this['options']['geocoderConfig']);_0xf2d8dd['map']=this,_0x3b70c6=[_0xf2d8dd];}return new Cesium__namespace[(_0x224a5f(0x728))]({'container':this['_container'],'geocoderServices':_0x3b70c6,'scene':this[_0x224a5f(0x1d1)]['scene']});}['_toChineseLang'](_0x4ea208){const _0x16fe9c={_0x412e53:0xa43},_0x797be0=_0x3d5d32,_0x55eff5={'Enter\x20an\x20address\x20or\x20landmark...':'请输入地址...','Searching...':_0x797be0(_0x16fe9c._0x412e53)};this[_0x797be0(0x33d)](_0x4ea208,_0x55eff5,'cesium-geocoder-input','placeholder');}}register$1('geocoder',Geocoder);class HomeButton extends BaseCzmControl{constructor(_0x20b4dd={}){const _0x56a4dc={_0x139db2:0x22a,_0x71e021:0x433,_0x19ee18:0x22a},_0x173f29=_0x3d5d32;super(_0x20b4dd),this['_czmControlKey']='_homeButton',this['_czmContainerKey']='_element',this['options'][_0x173f29(_0x56a4dc._0x139db2)]=this[_0x173f29(_0x56a4dc._0x71e021)][_0x173f29(_0x56a4dc._0x19ee18)]??0x0;}get['parentContainer'](){const _0xbb8d73={_0x1e26b5:0x433,_0x333165:0x46a},_0x1de3b9=_0x3d5d32;if(this[_0x1de3b9(_0xbb8d73._0x1e26b5)]['parentContainer'])return this['options'][_0x1de3b9(_0xbb8d73._0x333165)];return this['_map']['toolbar'];}['_createCzmControl'](){const _0x557fd8={_0x4b76b9:0x1d1},_0x346cf8=_0x3d5d32;return new Cesium__namespace['HomeButton'](this['_map']['toolbar'],this[_0x346cf8(_0x557fd8._0x4b76b9)]['scene']);}[_0x3d5d32(0xd40)](_0x636c0b){const _0x1c5c78=_0x3d5d32;this['_updateDomAttribute'](_0x636c0b,{'View\x20Home':_0x1c5c78(0x657)},'cesium-home-button','title');}}register$1(_0x3d5d32(0xfe9),HomeButton);class NavigationHelpButton extends BaseCzmControl{constructor(_0x168cf2={}){super(_0x168cf2),this['_czmControlKey']='_navigationHelpButton',this['_czmContainerKey']='_wrapper';}get['parentContainer'](){if(this['options']['parentContainer'])return this['options']['parentContainer'];return this['_map']['toolbar'];}['_createCzmControl'](){const _0x488cfb={_0x308f22:0x80e,_0x169154:0x35e,_0xfd8325:0x501,_0x49aec7:0x433},_0x28a100=_0x3d5d32;let _0x4e90ba=!![];try{if(Cesium__namespace['defined'](window[_0x28a100(_0x488cfb._0x308f22)])){const _0x31fc39=window['localStorage'][_0x28a100(0x54a)]('cesium-hasSeenNavHelp');Cesium__namespace['defined'](_0x31fc39)&&Boolean(_0x31fc39)?_0x4e90ba=![]:window['localStorage'][_0x28a100(0x55e)]('cesium-hasSeenNavHelp','true');}}catch(_0x470e84){}return new Cesium__namespace['NavigationHelpButton']({'container':this['_map'][_0x28a100(_0x488cfb._0x169154)],'instructionsInitiallyVisible':Cesium__namespace[_0x28a100(_0x488cfb._0xfd8325)](this[_0x28a100(_0x488cfb._0x49aec7)]['navigationInstructionsInitiallyVisible'],_0x4e90ba)});}[_0x3d5d32(0xd40)](_0x15d008){const _0x195232={_0x300237:0x33d,_0x481407:0x1015,_0x27731b:0x74f,_0x3f915c:0x7bf,_0x4a4b7f:0x68c,_0x365d15:0x66d,_0x24ff20:0x1e3,_0x35c1ae:0x7bf,_0x3e999c:0x950},_0x53243e=_0x3d5d32;this[_0x53243e(_0x195232._0x300237)](_0x15d008,{'Navigation\x20Instructions':'帮助'},'cesium-navigation-help-button','title');const _0x3e61e2={'Mouse':'鼠标操作','Touch':'触摸手势','Pan\x20view':_0x53243e(_0x195232._0x481407),'Left\x20click\x20+\x20drag':'鼠标左键+拖拽','Zoom\x20view':_0x53243e(_0x195232._0x27731b),'Right\x20click\x20+\x20drag,\x20or':'右键+拖拽,或者','Mouse\x20wheel\x20scroll':'中键滚动','Rotate\x20view':'旋转视图','Middle\x20click\x20+\x20drag,\x20or':'中键按下拖拽,或者','CTRL\x20+\x20Left/Right\x20click\x20+\x20drag':_0x53243e(0xaef),'One\x20finger\x20drag':'单指拖动','Two\x20finger\x20pinch':'双指向内或向外滑动','Tilt\x20view':'倾斜视图','Two\x20finger\x20drag,\x20same\x20direction':'双指按相同方向拖动','Two\x20finger\x20drag,\x20opposite\x20direction':'双指按相反方向拖动'};let _0x4c5b04=_0x15d008['getElementsByClassName']('cesium-navigation-button-left');_0x4c5b04['length']>0x0&&(_0x4c5b04=_0x4c5b04[0x0],_0x3e61e2[_0x4c5b04[_0x53243e(_0x195232._0x3f915c)]]&&(_0x4c5b04[_0x53243e(0xae5)]=_0x4c5b04[_0x53243e(_0x195232._0x4a4b7f)][0x0]['outerHTML']+_0x3e61e2[_0x4c5b04['textContent']]));let _0x240145=_0x15d008['getElementsByClassName'](_0x53243e(_0x195232._0x365d15));_0x240145['length']>0x0&&(_0x240145=_0x240145[0x0],_0x3e61e2[_0x240145['textContent']]&&(_0x240145[_0x53243e(0xae5)]=_0x240145['children'][0x0][_0x53243e(_0x195232._0x24ff20)]+_0x3e61e2[_0x240145[_0x53243e(_0x195232._0x35c1ae)]])),this['_updateDomInnerHtml'](_0x15d008,_0x3e61e2,_0x53243e(_0x195232._0x3e999c)),this['_updateDomInnerHtml'](_0x15d008,_0x3e61e2,_0x53243e(0xa4c)),this['_updateDomInnerHtml'](_0x15d008,_0x3e61e2,'cesium-navigation-help-zoom'),this['_updateDomInnerHtml'](_0x15d008,_0x3e61e2,_0x53243e(0xf6b)),this['_updateDomInnerHtml'](_0x15d008,_0x3e61e2,'cesium-navigation-help-tilt');}}register$1('navigationHelpButton',NavigationHelpButton);class ProjectionPicker extends BaseCzmControl{constructor(_0x15aa0e={}){super(_0x15aa0e),this['_czmControlKey']='_projectionPicker',this['_czmContainerKey']='_wrapper';}get[_0x3d5d32(0x46a)](){const _0x363a21={_0x58c45d:0x433},_0xefb67b=_0x3d5d32;if(this[_0xefb67b(_0x363a21._0x58c45d)]['parentContainer'])return this[_0xefb67b(_0x363a21._0x58c45d)]['parentContainer'];return this[_0xefb67b(0x1d1)]['toolbar'];}['_createCzmControl'](){const _0x1ce119={_0x2a4e8d:0x35e,_0x59ab20:0x1d1},_0x3f6208=_0x3d5d32;return new Cesium__namespace['ProjectionPicker'](this['_map'][_0x3f6208(_0x1ce119._0x2a4e8d)],this[_0x3f6208(_0x1ce119._0x59ab20)]['scene']);}[_0x3d5d32(0xd40)](_0x40ee67){const _0x470c5f={_0xa3ec04:0xd50},_0x3e9031=_0x3d5d32,_0x17dfa5={'Perspective\x20Projection':'透视投影','Orthographic\x20Projection':'正射投影'};this['_updateDomAttribute'](_0x40ee67,_0x17dfa5,'cesium-projectionPicker-buttonPerspective','title'),this['_updateDomAttribute'](_0x40ee67,_0x17dfa5,'cesium-projectionPicker-dropDown-icon',_0x3e9031(_0x470c5f._0xa3ec04));}}register$1('projectionPicker',ProjectionPicker);class SceneModePicker extends BaseCzmControl{constructor(_0x146b93={}){const _0x330677={_0x2c2100:0xadf,_0x1b6d1c:0x9d0},_0x148f04=_0x3d5d32;super(_0x146b93),this[_0x148f04(0x30a)]=_0x148f04(_0x330677._0x2c2100),this[_0x148f04(_0x330677._0x1b6d1c)]='_wrapper';}get['parentContainer'](){const _0x41512a={_0xbb37b3:0x46a,_0x3ddc0c:0x35e},_0x313990=_0x3d5d32;if(this['options']['parentContainer'])return this['options'][_0x313990(_0x41512a._0xbb37b3)];return this['_map'][_0x313990(_0x41512a._0x3ddc0c)];}['_createCzmControl'](){const _0x46cae6=_0x3d5d32;return new Cesium__namespace['SceneModePicker'](this['_map'][_0x46cae6(0x35e)],this['_map']['scene']);}[_0x3d5d32(0xd40)](_0xdd5f){const _0x126542={_0x1bb8f7:0xd50,_0x5b4ebe:0xd50},_0x13fbed=_0x3d5d32,_0x182c83={'2D':_0x13fbed(0x5b4),'3D':'三维视图','Columbus\x20View':'哥伦布2.5D视图'};this[_0x13fbed(0x944)](_0xdd5f,_0x182c83,'cesium-sceneModePicker-button3D',_0x13fbed(_0x126542._0x1bb8f7),_0x13fbed(0x3b7)),this['_updateDomAttribute'](_0xdd5f,_0x182c83,'cesium-sceneModePicker-dropDown-icon',_0x13fbed(_0x126542._0x5b4ebe));}}register$1('sceneModePicker',SceneModePicker);class Timeline extends BaseCzmControl{constructor(_0x52c4ff={}){const _0x4ccedd={_0x3036ca:0x1033},_0xdaf7c9=_0x3d5d32;super(_0x52c4ff),this['_czmControlKey']=_0xdaf7c9(_0x4ccedd._0x3036ca),this['_czmContainerKey']='container';}['_createCzmContainer'](){const _0x3a4d22={_0x18824f:0xe63,_0x2dfaac:0xdde},_0x4c2644=_0x3d5d32,_0x1ae461=create$3('div',_0x4c2644(_0x3a4d22._0x18824f));return _0x1ae461[_0x4c2644(_0x3a4d22._0x2dfaac)]['right']='0px',_0x1ae461;}[_0x3d5d32(0x59e)](){const _0x34b46f={_0x55e8f1:0x9f4},_0x58bc06=_0x3d5d32;return new Cesium__namespace['Timeline'](this[_0x58bc06(0x51f)],this['_map'][_0x58bc06(_0x34b46f._0x55e8f1)]);}['_addedHook'](){const _0x39d462={_0x2490a8:0x433},_0x1cff78={_0x4eaca9:0xbd5},_0x5459b5=_0x3d5d32;super[_0x5459b5(0x226)]();const _0xdcb33d=(this[_0x5459b5(_0x39d462._0x2490a8)]['maxSpan']??0x1)*0xa,_0xf94e12=this['_czmContrl'][_0x5459b5(0x508)];this['_czmContrl']['zoomTo']=function(_0x22c9df,_0x56ebd8){const _0x54d6aa=_0x5459b5,_0x47bcf1=Cesium__namespace['JulianDate'][_0x54d6aa(_0x1cff78._0x4eaca9)](_0x56ebd8,_0x22c9df);if(_0x47bcf1>_0xdcb33d)return _0xf94e12['bind'](this)(_0x22c9df,_0x56ebd8);},this[_0x5459b5(0xd74)]['addEventListener']('settime',this['onTimelineScrubfunction'],![]),this['_czmContrl']['zoomTo'](this['_map']['clock']['startTime'],this['_map']['clock']['stopTime']);}['onTimelineScrubfunction'](_0x10c279){const _0x44c80a=_0x10c279['clock'];_0x44c80a['currentTime']=_0x10c279['timeJulian'],_0x44c80a['shouldAnimate']=![];}['zoomTo'](_0x271231,_0x4cb5e0){const _0x40fc6c=_0x3d5d32;return this[_0x40fc6c(0xd74)]['zoomTo'](_0x271231,_0x4cb5e0);}['_removedHook'](){const _0x5de944=_0x3d5d32;this['_czmContrl']['removeEventListener']('settime',this[_0x5de944(0x932)],![]),super['_removedHook']();}['_rebindCzmContainer'](_0x5ac423){const _0x3616d0={_0x282491:0x63e},_0x6913ed=_0x3d5d32;_0x5ac423['style']['right']=_0x6913ed(_0x3616d0._0x282491);}}register$1(_0x3d5d32(0x449),Timeline);class VRButton extends BaseCzmControl{constructor(_0xc4599d={}){const _0xe43b73=_0x3d5d32;super(_0xc4599d),this['_czmControlKey']='_vrButton',this[_0xe43b73(0x9d0)]='_container';}get['parentContainer'](){const _0xfa6988={_0x27759c:0x1d1},_0x1ca94e=_0x3d5d32;if(this['options'][_0x1ca94e(0x46a)])return this['options'][_0x1ca94e(0x46a)];return this[_0x1ca94e(_0xfa6988._0x27759c)]['toolbar'];}['_createCzmContainer'](){const _0xdd1e63=_0x3d5d32;return create$3(_0xdd1e63(0x667),'cesium-button\x20cesium-toolbar-button\x20mars3d-vrButton');}['_createCzmControl'](){const _0x1d0d25=_0x3d5d32;return new Cesium__namespace['VRButton'](this['_container'],this[_0x1d0d25(0x1d1)]['scene'],this['options']['fullscreenElement']);}['_rebindCzmContainer'](_0x1562a6){const _0x48609a={_0xacfd65:0xdb4,_0x3b19da:0xbb9},_0x5cc83e=_0x3d5d32;var _0x4cb895;removeClass(_0x1562a6,_0x5cc83e(_0x48609a._0xacfd65)),addClass(_0x1562a6,_0x5cc83e(_0x48609a._0x3b19da)),_0x1562a6['parentNode']['removeChild'](_0x1562a6);const _0xad1ae2=(_0x4cb895=this[_0x5cc83e(0x4c2)]['navigationHelpButton'])===null||_0x4cb895===void 0x0?void 0x0:_0x4cb895['_wrapper'];_0xad1ae2?this['parentContainer']['insertBefore'](_0x1562a6,_0xad1ae2):this['parentContainer']['appendChild'](_0x1562a6);}[_0x3d5d32(0xd40)](_0x3fc87b){const _0xabf59b={_0x2ce794:0x9d7,_0x32cb30:0xd50},_0x33deaa=_0x3d5d32,_0x147b93={'Enter\x20VR\x20mode':'进入VR模式','Exit\x20VR\x20mode':'退出VR模式','VR\x20mode\x20is\x20unavailable':_0x33deaa(_0xabf59b._0x2ce794)};this['_updateDomAttributeByEvent'](_0x3fc87b,_0x147b93,_0x33deaa(0x5ea),_0x33deaa(_0xabf59b._0x32cb30),'onmouseover');}}register$1(_0x3d5d32(0x9ef),VRButton);class LocationBar extends BaseControl{constructor(_0x11badc={}){const _0x3b1483={_0x3bf2ac:0x433,_0x45cf66:0xa65},_0x1955fd=_0x3d5d32;super(_0x11badc),this[_0x1955fd(_0x3b1483._0x3bf2ac)][_0x1955fd(_0x3b1483._0x45cf66)]=this['options']['cacheTime']??0x32,this['locationData']={};}['_mountedHook'](){const _0x307737={_0x35881b:0x8a5,_0x494f11:0x433,_0x27e947:0x246,_0x5741bd:0xb84,_0x270ee2:0x980,_0x5169ac:0x667,_0x2b9bc7:0x433,_0x1cc4a3:0xa3d,_0x1f2335:0x4c3,_0x468870:0x775},_0x53ea61={_0x4233ce:0x1d1,_0x1c99a4:0x244,_0x1de663:0xe1e,_0xf5780b:0x895,_0x10e0ef:0x51f},_0x918096=_0x3d5d32;Cesium__namespace['defined'](this['options'][_0x918096(_0x307737._0x35881b)])?Array['isArray'](this['options']['template'])?this['template']=this[_0x918096(_0x307737._0x494f11)]['template'][this['_map']['lang']]:this['template']=this[_0x918096(0x433)]['template']:this[_0x918096(0x8a5)]=_0x918096(_0x307737._0x27e947);if(Cesium__namespace[_0x918096(_0x307737._0x5741bd)](this['options']['crs'])){if(isString(this['options'][_0x918096(_0x307737._0x270ee2)]))this['_crs']=this['options']['crs'];else this['options']['crs']&&(this['_crs']=CRS['CGCS2000_GK_Zone_3']);}else isString(this[_0x918096(0x8a5)])&&this['template'][_0x918096(0x54b)]('{crsx}')!==-0x1&&(this['_crs']=CRS['CGCS2000_GK_Zone_3']);this['_container']=create$3('div','mars3d-locationbar\x20no-print'),this['_containerCon']=create$3(_0x918096(_0x307737._0x5169ac),'mars3d-locationbar-content',this['_container']);this[_0x918096(_0x307737._0x2b9bc7)]['style']?this['setStyle'](this[_0x918096(0x433)]['style']):(this[_0x918096(_0x307737._0x1cc4a3)]=!![],this['_updateControlHandler']());if(this['options'][_0x918096(_0x307737._0x1f2335)]){this['_map']['scene']['debugShowFramesPerSecond']=!![];const _0x56ae46=setInterval(()=>{const _0x21660e=_0x918096;if(!this[_0x21660e(0x1d1)]||!this[_0x21660e(_0x53ea61._0x4233ce)][_0x21660e(0xfc1)][_0x21660e(_0x53ea61._0x1c99a4)])return;clearInterval(_0x56ae46),this['timeTik']=null;const _0x505d53=this[_0x21660e(0x1d1)]['container']['querySelector'](_0x21660e(_0x53ea61._0x1de663));if(_0x505d53){addClass(_0x505d53,'mars3d-locationbar-content'),removeClass(_0x505d53,'cesium-performanceDisplay');const _0x228038=_0x505d53[_0x21660e(_0x53ea61._0xf5780b)]('.cesium-performanceDisplay-throttled');remove(_0x228038),_0x505d53[_0x21660e(0x225)]['removeChild'](_0x505d53),this[_0x21660e(_0x53ea61._0x10e0ef)]['insertBefore'](_0x505d53,this['_containerCon']);}},0x64);this['timeTik']=_0x56ae46;}else this[_0x918096(_0x307737._0x468870)]&&(clearInterval(this['timeTik']),this['timeTik']=null),this['_map']['scene'][_0x918096(0x99a)]=![];}['_addedHook'](){const _0x322527={_0x31f278:0xad5},_0x9a8e94=_0x3d5d32;this['_map']['on'](EventType['mouseMove'],this[_0x9a8e94(_0x322527._0x31f278)],this),this['_map']['on'](EventType['cameraMoveEnd'],this['_cameraHandler'],this),this[_0x9a8e94(0x1d1)]['on'](EventType['addControl'],this['_updateControlHandler'],this),this['_map']['on'](EventType[_0x9a8e94(0x3a2)],this['_updateControlHandler'],this),this[_0x9a8e94(0x891)]();}['_removedHook'](){const _0x546dd4={_0x189f79:0xad5,_0xeaed28:0x9e7,_0x170e92:0x1d1,_0xacbb6:0x689,_0x4d3820:0x244},_0x1c6d13=_0x3d5d32;this[_0x1c6d13(0x1d1)]['off'](EventType['mouseMove'],this[_0x1c6d13(_0x546dd4._0x189f79)],this),this[_0x1c6d13(0x1d1)]['off'](EventType['cameraMoveEnd'],this['_cameraHandler'],this),this['_map']['off'](EventType[_0x1c6d13(0xb7f)],this[_0x1c6d13(0x1067)],this),this[_0x1c6d13(0x1d1)][_0x1c6d13(_0x546dd4._0xeaed28)](EventType['updateControl'],this['_updateControlHandler'],this),this['timeTik']&&(clearInterval(this['timeTik']),this['timeTik']=null),this['options']['fps']&&(this[_0x1c6d13(_0x546dd4._0x170e92)][_0x1c6d13(0xfc1)]['debugShowFramesPerSecond']=![],this['_map']['scene']['_performanceDisplay']&&(this['_map']['scene']['_performanceDisplay'][_0x1c6d13(_0x546dd4._0xacbb6)](),this['_map']['scene'][_0x1c6d13(_0x546dd4._0x4d3820)]=undefined));}['_cameraHandler'](){if(!this['enabled'])return;const _0x1fe587=this['_map']['getCenter']();_0x1fe587&&this['_templateHtml'](_0x1fe587);}[_0x3d5d32(0xad5)](_0x162098){this['moveTimer']&&(clearTimeout(this['moveTimer']),delete this['moveTimer']),this['moveTimer']=setTimeout(()=>{const _0x42cb53=_0x4132;delete this['moveTimer'];if(!this[_0x42cb53(0xa63)])return;const _0x3a1059=_0x162098['cartesian'];_0x3a1059&&this['_templateHtml'](LngLatPoint['fromCartesian'](_0x3a1059));},this['options']['cacheTime']);}['_templateHtml'](_0x187bcd){const _0x48468f={_0x730d6f:0x1d1,_0x39c5fc:0xa1f,_0x3b3b91:0xa6b,_0x2f3fbe:0xae2,_0x3a372c:0xd29,_0x282f9e:0x433,_0x5a7305:0x5d8,_0x1e8ca5:0xa6b,_0x22b195:0x640,_0x2015bb:0x3cc},_0x19f9a5=_0x3d5d32;this['locationData']['cameraHeight']=this[_0x19f9a5(_0x48468f._0x730d6f)][_0x19f9a5(0x435)]['positionCartographic']['height']['toFixed'](LngLatPoint['FormatAltLength']),this['locationData']['heading']=Cesium__namespace[_0x19f9a5(0x103e)][_0x19f9a5(_0x48468f._0x39c5fc)](this['_map']['camera'][_0x19f9a5(0xe39)])['toFixed'](0x0),this[_0x19f9a5(_0x48468f._0x3b3b91)]['pitch']=Cesium__namespace[_0x19f9a5(0x103e)]['toDegrees'](this['_map']['camera']['pitch'])[_0x19f9a5(0x719)](0x0),this[_0x19f9a5(_0x48468f._0x3b3b91)]['level']=this[_0x19f9a5(0x1d1)]['level'],this['locationData']['alt']=formatNum$1(this['_map'][_0x19f9a5(_0x48468f._0x2f3fbe)](_0x187bcd[_0x19f9a5(_0x48468f._0x3a372c)]),LngLatPoint['FormatAltLength']);const _0x2ec9e3=this[_0x19f9a5(_0x48468f._0x282f9e)]['latDecimal']??LngLatPoint['FormatLength'];this['locationData'][_0x19f9a5(_0x48468f._0x5a7305)]=_0x187bcd['lng']['toFixed'](_0x2ec9e3),this[_0x19f9a5(0xa6b)]['lat']=_0x187bcd['lat']['toFixed'](_0x2ec9e3);if(this['_crs']){const _0x43c284=this[_0x19f9a5(_0x48468f._0x282f9e)][_0x19f9a5(0xcf8)]??0x1,_0x5cd8a4=proj4Trans([_0x187bcd[_0x19f9a5(_0x48468f._0x5a7305)],_0x187bcd['lat']],'EPSG:4326',this['_crs']);_0x5cd8a4[0x0]===_0x187bcd['lng']?this['locationData']['crsx']='':this[_0x19f9a5(_0x48468f._0x1e8ca5)]['crsx']=_0x5cd8a4[0x0]['toFixed'](_0x43c284),_0x5cd8a4[0x1]===_0x187bcd['lat']?this['locationData']['crsy']='':this['locationData'][_0x19f9a5(_0x48468f._0x22b195)]=_0x5cd8a4[0x1]['toFixed'](_0x43c284);}let _0x1b734d;typeof this['template']===_0x19f9a5(_0x48468f._0x2015bb)?_0x1b734d=this['template'](this['locationData']):(this['options']['formatData']&&(this['locationData']=this['options']['formatData'](this['locationData'])),_0x1b734d=template(this[_0x19f9a5(0x8a5)],this['locationData'])),this['_containerCon']['innerHTML']=_0x1b734d,this['fire'](EventType['change']);}[_0x3d5d32(0x1067)](_0x35766e){const _0x12bf8b={_0x55ce01:0x999,_0x14a75a:0x7f5,_0x48d16f:0x792},_0xd14ce1=_0x3d5d32;var _0x462159,_0x6ad4df;if(this['_autoStyle']&&(!_0x35766e||((_0x462159=_0x35766e[_0xd14ce1(_0x12bf8b._0x55ce01)])===null||_0x462159===void 0x0?void 0x0:_0x462159[_0xd14ce1(_0x12bf8b._0x14a75a)])===_0xd14ce1(0xb5f)||((_0x6ad4df=_0x35766e['control'])===null||_0x6ad4df===void 0x0?void 0x0:_0x6ad4df[_0xd14ce1(0x7f5)])==='timeline')){var _0x43b6c2,_0x584c32,_0x217dd1;this['setStyle']({'left':(_0x43b6c2=this['_map']['controls']['animation'])!==null&&_0x43b6c2!==void 0x0&&_0x43b6c2['show']||(_0x584c32=this['_map']['controls']['clockAnimate'])!==null&&_0x584c32!==void 0x0&&_0x584c32[_0xd14ce1(_0x12bf8b._0x48d16f)]?'170px':'0','right':'0','bottom':(_0x217dd1=this['_map']['controls']['timeline'])!==null&&_0x217dd1!==void 0x0&&_0x217dd1['show']?'25px':'0'});}}}register$1('locationBar',LocationBar);class MouseDownView extends BaseControl{['_mountedHook'](){const _0x12c064={_0x4d0c17:0x667},_0x565bb4=_0x3d5d32;this['_container']=create$3('div','mars3d-mousedownview'),this['_container']['id']=this['parentContainerId']+_0x565bb4(0x565),create$3(_0x565bb4(_0x12c064._0x4d0c17),'mars3d-mousedownview-img',this['_container']);}['changeMouseModel'](){this['isAdded']&&(this['_removedHook'](),this['_addedHook']());}['_addedHook'](){const _0x56d6f2={_0x5bb85a:0x877,_0x4e4f10:0x1d1},_0x23919c=_0x3d5d32;if(!isPCBroswer())return;this['_map']['on'](EventType[_0x23919c(0x78e)],this['_mousWheelHandler'],this),this['_map'][_0x23919c(_0x56d6f2._0x5bb85a)]?(this[_0x23919c(_0x56d6f2._0x4e4f10)]['on'](EventType['rightDown'],this[_0x23919c(0x1f6)],this),this['_map']['on'](EventType[_0x23919c(0x37a)],this['_mousMiddleUpHandler'],this)):(this['_map']['on'](EventType['middleDown'],this[_0x23919c(0x1f6)],this),this[_0x23919c(0x1d1)]['on'](EventType['middleUp'],this['_mousMiddleUpHandler'],this)),this['_mousMiddleUpHandler']();}['_removedHook'](){const _0x2cccb5={_0x4c44ef:0x37a,_0x96a906:0x9e7,_0x57a0fc:0x1d2},_0x485dd0=_0x3d5d32;if(!isPCBroswer())return;this[_0x485dd0(0x1d1)]['off'](EventType['wheel'],this['_mousWheelHandler'],this),this[_0x485dd0(0x1d1)]['_hasRightTilt']?(this['_map']['off'](EventType['rightDown'],this['_mousMiddleDownHandler'],this),this['_map'][_0x485dd0(0x9e7)](EventType[_0x485dd0(_0x2cccb5._0x4c44ef)],this['_mousMiddleUpHandler'],this)):(this[_0x485dd0(0x1d1)][_0x485dd0(_0x2cccb5._0x96a906)](EventType['middleDown'],this['_mousMiddleDownHandler'],this),this['_map']['off'](EventType[_0x485dd0(0xe2e)],this['_mousMiddleUpHandler'],this)),this['_map'][_0x485dd0(_0x2cccb5._0x96a906)](EventType['mouseMove'],this['_mouseMoveHandler'],this),clearTimeout(this[_0x485dd0(_0x2cccb5._0x57a0fc)]);}[_0x3d5d32(0x939)](_0x5b8545){const _0x5eec05={_0x1731f5:0x9fe},_0x4ef73c=_0x3d5d32;if(!this['enabled'])return;addClass(this['_container'],_0x4ef73c(0x9fe)),clearTimeout(this['timetik']),this[_0x4ef73c(0x1d2)]=setTimeout(()=>{const _0x26799c=_0x4ef73c;removeClass(this['_container'],_0x26799c(_0x5eec05._0x1731f5));},0xc8);}['_mousMiddleDownHandler'](_0x2c197c){const _0x1f21e3={_0x1318ef:0xfc1,_0x38bcd6:0x1d1,_0xbcf822:0x819,_0x5f5665:0x1d2,_0x2471cd:0x51f},_0x4db3f2=_0x3d5d32;if(!this['enabled'])return;const _0x4f5fcc=getCurrentMousePosition(this['_map'][_0x4db3f2(_0x1f21e3._0x1318ef)],_0x2c197c['position']);if(!_0x4f5fcc)return;if(this[_0x4db3f2(_0x1f21e3._0x38bcd6)][_0x4db3f2(0x435)][_0x4db3f2(0xee4)]['height']>this['_map'][_0x4db3f2(_0x1f21e3._0x1318ef)]['screenSpaceCameraController'][_0x4db3f2(_0x1f21e3._0xbcf822)])return;this[_0x4db3f2(0x1d1)]['off'](EventType['mouseMove'],this['_mouseMoveHandler'],this),clearTimeout(this[_0x4db3f2(_0x1f21e3._0x5f5665)]),this[_0x4db3f2(_0x1f21e3._0x2471cd)][_0x4db3f2(0xdde)]['top']=_0x2c197c['position']['y']+'px',this['_container'][_0x4db3f2(0xdde)][_0x4db3f2(0xfb5)]=_0x2c197c['position']['x']+'px',addClass(this['_container'],'mars3d-mousedownview-show');}['_mousMiddleUpHandler'](_0x16cd85){const _0x2d538f={_0x216420:0x1d1,_0x413228:0x314},_0x5f59f7=_0x3d5d32;removeClass(this['_container'],'mars3d-mousedownview-show'),this[_0x5f59f7(_0x2d538f._0x216420)]['on'](EventType[_0x5f59f7(_0x2d538f._0x413228)],this['_mouseMoveHandler'],this);}['_mouseMoveHandler'](_0x45a08c){const _0x5f155b=_0x3d5d32;this['_container']['style']['top']=_0x45a08c[_0x5f155b(0xd13)]['y']+'px',this['_container']['style']['left']=_0x45a08c['endPosition']['x']+'px';}}register$1('mouseDownView',MouseDownView);const icon$7='\x0a\x0a\x20\x20\x0a\x20\x20\x0a\x20\x20\x0a',icon$6='\x0a\x0a\x20\x20\x0a\x20\x20\x0a';class Zoom extends BaseControl{get[_0x3d5d32(0x46a)](){const _0x31213a={_0x43b169:0x1d1},_0x1573de=_0x3d5d32;return this[_0x1573de(_0x31213a._0x43b169)]?this[_0x1573de(0x1d1)][_0x1573de(0x35e)]:document['getElementsByClassName']('cesium-viewer-toolbar')[0x0];}['_showHook'](_0x258440){const _0x2449ad=_0x3d5d32;this['_container2']&&(this['_container2']['style'][_0x2449ad(0xd92)]=_0x258440?_0x2449ad(0x6f6):'none');}['_mountedHook'](){const _0x4a6e3b={_0x176da2:0x667,_0x168d3c:0xdde,_0x345bd2:0xee9,_0x410106:0x1ee,_0x205741:0xd92,_0xd40cae:0x77e,_0x6b8fce:0x1ee,_0x2fb1c0:0xd50,_0x57e8f5:0xe7e,_0x318f59:0x6b7},_0x3b1bc3=_0x3d5d32;this['_container']=create$3(_0x3b1bc3(_0x4a6e3b._0x176da2),'cesium-button\x20cesium-toolbar-button\x20mar3d-toolButton'),this['_container'][_0x3b1bc3(_0x4a6e3b._0x168d3c)]['display']='inline-block',this['_container'][_0x3b1bc3(0xd85)]('title',this['_map']['getLangText']('_缩小')),this['_createIcon'](this['options'][_0x3b1bc3(_0x4a6e3b._0x345bd2)]||icon$6,this['_container']),this['_container']['addEventListener']('click',_0x51cdf9=>{const _0x5250f8=_0x3b1bc3;if(!this['enabled'])return;this['_map'][_0x5250f8(0x973)](this['options']['relativeAmount']);}),this[_0x3b1bc3(_0x4a6e3b._0x410106)]=create$3(_0x3b1bc3(0x667),'cesium-button\x20cesium-toolbar-button\x20mar3d-toolButton'),this[_0x3b1bc3(0x1ee)]['style'][_0x3b1bc3(_0x4a6e3b._0x205741)]=_0x3b1bc3(_0x4a6e3b._0xd40cae),this[_0x3b1bc3(_0x4a6e3b._0x6b8fce)]['setAttribute'](_0x3b1bc3(_0x4a6e3b._0x2fb1c0),this[_0x3b1bc3(0x1d1)]['getLangText'](_0x3b1bc3(_0x4a6e3b._0x57e8f5))),this[_0x3b1bc3(_0x4a6e3b._0x318f59)](this['options']['zoomInIcon']||icon$7,this['_container2']),this['_container2'][_0x3b1bc3(0x34f)](_0x3b1bc3(0xb59),_0x112695=>{const _0x14e0d1=_0x3b1bc3;if(!this['enabled'])return;this[_0x14e0d1(0x1d1)]['zoomIn'](this['options']['relativeAmount']);});}['_addedHook'](){const _0x1458e5={_0x99563b:0x1ee},_0x27f9f5=_0x3d5d32;this['parentContainer']['insertBefore'](this[_0x27f9f5(_0x1458e5._0x99563b)],this['_container']);}[_0x3d5d32(0x566)](){this['parentContainer']['removeChild'](this['_container2']);}}register$1(_0x3d5d32(0xaa9),Zoom);class ToolButton extends BaseControl{constructor(_0x4b9d08={}){super(_0x4b9d08),this['_type']='toolButton'+getGlobalId();}get['parentContainer'](){const _0x22b894={_0x33de56:0x1d1},_0x1303ec=_0x3d5d32;return this['_map']?this[_0x1303ec(_0x22b894._0x33de56)]['toolbar']:document[_0x1303ec(0x101b)]('cesium-viewer-toolbar')[0x0];}['_mountedHook'](){const _0xe88bd4={_0x587e8e:0x51f,_0x1587b6:0x433,_0x5197b8:0x51f,_0x4cfd9c:0xf01},_0x59f72d={_0x4c72ae:0x433},_0x2ba528=_0x3d5d32;this[_0x2ba528(_0xe88bd4._0x587e8e)]=create$3(_0x2ba528(0x667),'cesium-button\x20cesium-toolbar-button\x20mar3d-toolButton'),this['_container']['id']=this['id'],this['_container']['style']['display']='inline-block',this[_0x2ba528(0x51f)]['setAttribute']('title',this[_0x2ba528(0x433)]['title']||''),this[_0x2ba528(0x6b7)](this[_0x2ba528(_0xe88bd4._0x1587b6)]['icon'],this['_container']);let _0x2bd43c;this[_0x2ba528(_0xe88bd4._0x5197b8)]['addEventListener']('mouseover',_0x1254f8=>{const _0x593081=_0x2ba528;if(!this['enabled'])return;if(_0x2bd43c===this['id'])return;_0x2bd43c=this['id'],this['options']['mouseOver']&&this[_0x593081(_0x59f72d._0x4c72ae)]['mouseOver'](this[_0x593081(_0x59f72d._0x4c72ae)]),this[_0x593081(0xefc)](EventType['mouseOver'],{...this['options']});}),this['_container']['addEventListener'](_0x2ba528(_0xe88bd4._0x4cfd9c),_0x2e92cf=>{const _0x428f4a=_0x2ba528;_0x2bd43c=null;if(!this['enabled'])return;this['options'][_0x428f4a(0xbbb)]&&this[_0x428f4a(0x433)]['mouseOut'](this['options']),this['fire'](EventType['mouseOut'],{...this['options']});});}['setIcon'](_0x1fa7c1){const _0xc6f736={_0x3ed3c7:0x836,_0x1715dc:0x51f},_0x567c10=_0x3d5d32;this['options'][_0x567c10(_0xc6f736._0x3ed3c7)]=_0x1fa7c1,empty(this['_container']),this['_createIcon'](_0x1fa7c1,this[_0x567c10(_0xc6f736._0x1715dc)]);}}register$1('toolButton',ToolButton);const icon$5='\x0a\x0a\x20\x20\x20\x20拖拽调整四周方向角,双击回正北\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a',icon$4='\x0a\x0a\x20\x20\x20\x20拖拽调整俯仰角\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a',icon$3='\x0a\x0a\x20\x20\x20\x20导航球\x0a\x20\x20\x20\x20mars3d.cn\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x0a\x0a';class Compass extends BaseControl{constructor(_0x59e2b7={}){const _0x39c5cb={_0x247644:0xa9a,_0xe4c5a9:0xaee,_0x18b538:0x31f},_0x120977=_0x3d5d32;super(_0x59e2b7),this[_0x120977(_0x39c5cb._0x247644)]=0x0,this[_0x120977(_0x39c5cb._0xe4c5a9)]=0x0,this['_orbitLastTimestamp']=0x0,this['options']['rotation']=this['options'][_0x120977(_0x39c5cb._0x18b538)]??!![];}[_0x3d5d32(0x36f)](){const _0x31ab81={_0x300b43:0x474,_0x41d05e:0x433,_0x5d82ab:0x960},_0x52ceeb=_0x3d5d32,_0x45f34c={};if(Cesium__namespace['defined'](this['options'][_0x52ceeb(_0x31ab81._0x300b43)])&&this['options']['top']!=='')_0x45f34c[_0x52ceeb(_0x31ab81._0x300b43)]=this[_0x52ceeb(_0x31ab81._0x41d05e)]['top'];else{if(Cesium__namespace['defined'](this[_0x52ceeb(0x433)]['bottom'])&&this['options'][_0x52ceeb(_0x31ab81._0x5d82ab)]!==''){_0x45f34c[_0x52ceeb(_0x31ab81._0x5d82ab)]=this['options']['bottom'];if(_0x45f34c['bottom']==='toolbar'){const _0x3c0175=this['_map']['toolbar'];if(_0x3c0175){const _0x455597=_0x3c0175['offsetHeight']+0x28;_0x45f34c[_0x52ceeb(0x960)]=_0x455597+'px',this['domToolbar']=_0x3c0175;}}}}if(Cesium__namespace['defined'](this[_0x52ceeb(0x433)]['left'])&&this['options']['left']!=='')_0x45f34c['left']=this['options']['left'];else Cesium__namespace['defined'](this['options'][_0x52ceeb(0x28b)])&&this[_0x52ceeb(_0x31ab81._0x41d05e)][_0x52ceeb(0x28b)]!==''&&(_0x45f34c['right']=this[_0x52ceeb(0x433)]['right']);let _0x5c97c9='';for(const _0x34ef2e in _0x45f34c){_0x5c97c9+=_0x34ef2e+':\x20'+_0x45f34c[_0x34ef2e]+';';}return _0x5c97c9||_0x52ceeb(0x7a9);}[_0x3d5d32(0xe4c)](){const _0x341238={_0x3c47ff:0xdc3,_0x55b33f:0x51f,_0x3413fd:0xdde,_0x1e82ac:0x433,_0x322aa9:0x1f4,_0x3df58c:0x4d3},_0x3cc878={_0x3fd757:0x38d},_0x5c6e74=_0x3d5d32;this['_container']=create$3(_0x5c6e74(0x667),this['options'][_0x5c6e74(_0x341238._0x3c47ff)]||_0x5c6e74(0xdfd)),this[_0x5c6e74(_0x341238._0x55b33f)][_0x5c6e74(_0x341238._0x3413fd)]['cssText']=this['_getCssText'](),this[_0x5c6e74(0xb0c)]=parseDom(this[_0x5c6e74(_0x341238._0x1e82ac)]['outerSvg']||icon$5,!![],'mars3d-compass-outer'),this[_0x5c6e74(0x51f)]['appendChild'](this['_container_outer']),this[_0x5c6e74(0x910)]=parseDom(this['options']['innerSvg']||icon$4,!![],'mars3d-compass-inner'),this[_0x5c6e74(0x51f)]['appendChild'](this['_container_inner']),this['options']['rotation']&&(this['_container_rotationArc']=parseDom(this['options'][_0x5c6e74(0xf44)]||icon$3,!![],'mars3d-compass-rotation-arc'),this['_container']['appendChild'](this['_container_rotationArc']),this[_0x5c6e74(0x81a)]['style']['visibility']='hidden'),isPCBroswer()?(this['_container']['onmousedown']=_0x5de3bb=>{this['_handleMouseDown'](_0x5de3bb);},this['_container_outer'][_0x5c6e74(_0x341238._0x322aa9)]=_0xd2b152=>{this['_map']['camera']['setView']({'orientation':{'heading':0x0}});},this['_container_inner']['ondblclick']=_0x13b009=>{const _0x3d87a6=_0x5c6e74;this[_0x3d87a6(0x1d1)]['flyHome']();}):(this['_container'][_0x5c6e74(_0x341238._0x3df58c)]=_0x3889d3=>{const _0x23e6ca=_0x5c6e74;this[_0x23e6ca(0xc88)](_0x3889d3);},this['_container_outer']['onclick']=_0x47efdb=>{const _0x175551=_0x5c6e74;this['_map']['camera'][_0x175551(_0x3cc878._0x3fd757)]({'orientation':{'heading':0x0}});},this['_container_inner']['onclick']=_0x2f62e3=>{this['_map']['flyHome']();});}['setOuterSvg'](_0x4b5d91){this['_container_outer']['innerHTML']=_0x4b5d91;}['setInnerSvg'](_0x26c5b8){this['_container_inner']['innerHTML']=_0x26c5b8;}['setRotationSvg'](_0x380e40){const _0x1964fd={_0x161664:0xae5},_0x597908=_0x3d5d32;this['_container_rotationArc'][_0x597908(_0x1964fd._0x161664)]=_0x380e40;}['_addedHook'](){const _0x918ef0=_0x3d5d32;this[_0x918ef0(0x1d1)]['on'](EventType['postRender'],this['_postRenderHandler'],this),this['_map']['on'](EventType['addControl'],this[_0x918ef0(0x1067)],this),this[_0x918ef0(0x1d1)]['on'](EventType['updateControl'],this[_0x918ef0(0x1067)],this);}[_0x3d5d32(0x566)](){const _0x198741={_0x28bb0d:0x1d1,_0x45f36e:0x9e7},_0x2c513a=_0x3d5d32;this[_0x2c513a(_0x198741._0x28bb0d)][_0x2c513a(_0x198741._0x45f36e)](EventType['postRender'],this['_postRenderHandler'],this),this['_map']['off'](EventType[_0x2c513a(0xb7f)],this[_0x2c513a(0x1067)],this),this['_map']['off'](EventType['addControl'],this['_updateControlHandler'],this),this['_map']['off'](EventType['updateControl'],this['_updateControlHandler'],this);}[_0x3d5d32(0x1067)](){const _0x2aa2f4={_0x2a77e0:0x804},_0x91592e=_0x3d5d32;if(this['domToolbar']){const _0x1a0140=this[_0x91592e(0x603)][_0x91592e(_0x2aa2f4._0x2a77e0)]+0x28;this['_container']['style']['bottom']=_0x1a0140+'px';}}['_postRenderHandler'](){const _0x51fa72={_0x4a5874:0xdde,_0x5e39bd:0x36b},_0x28ddcc=_0x3d5d32,_0x5863d0=this['_map']['camera'][_0x28ddcc(0xe39)];this['_container_outer']&&(this['_container_outer'][_0x28ddcc(_0x51fa72._0x4a5874)][_0x28ddcc(0x3bd)]='\x0a\x20\x20\x20\x20\x20\x20transform\x20:\x20rotate(-'+_0x5863d0+_0x28ddcc(_0x51fa72._0x5e39bd)+_0x5863d0+'rad);\x0a\x20\x20\x20\x20\x20\x20');}['_handleMouseDown'](_0x2a1d52){const _0x34473c={_0x3c63bc:0xb22,_0x5a8b22:0x1076},_0x47c206=_0x3d5d32,_0x2588b4=this['_map']['scene'];if(_0x2588b4['mode']===Cesium__namespace[_0x47c206(_0x34473c._0x3c63bc)][_0x47c206(0xe70)])return!![];this['_compassRectangle']=_0x2a1d52['currentTarget'][_0x47c206(0x817)]();const _0x59b86b=this['_compassRectangle'][_0x47c206(_0x34473c._0x5a8b22)]/0x2,_0x33ccfc=this['_getVector'](_0x2a1d52),_0xfbe01b=Cesium__namespace['Cartesian2']['magnitude'](_0x33ccfc)/_0x59b86b;if(this['options']['rotation']&&_0xfbe01b<0x32/0x91)this[_0x47c206(0x60a)](_0x33ccfc);else{if(_0xfbe01b<0x1)this['_rotate'](_0x33ccfc);else return!![];}}['_getCameraFocus'](_0x30ae6d){const _0x511c11={_0x326818:0xf74,_0x32a149:0x6e1,_0x4530cd:0xb30},_0x1d0e2a=_0x3d5d32;let _0x51f4d8=new Cesium__namespace['Cartesian3']();const _0x301f8f=this['_map']['scene'],_0x49a864=_0x301f8f['camera'];if(_0x301f8f['mode']===Cesium__namespace['SceneMode']['MORPHING'])return undefined;if(this['_map']['trackedEntity'])_0x51f4d8=this[_0x1d0e2a(0x1d1)]['trackedEntity'][_0x1d0e2a(0xb69)]['getValue'](this['_map']['clock']['currentTime']);else{const _0x134f34=new Cesium__namespace['Ray']();_0x134f34['origin']=_0x49a864[_0x1d0e2a(_0x511c11._0x326818)],_0x134f34['direction']=_0x49a864['directionWC'],_0x51f4d8=_0x301f8f['globe']['pick'](_0x134f34,_0x301f8f);}if(!_0x51f4d8)return undefined;if(_0x301f8f[_0x1d0e2a(_0x511c11._0x32a149)]===Cesium__namespace['SceneMode'][_0x1d0e2a(0x8d7)]||_0x301f8f['mode']===Cesium__namespace['SceneMode'][_0x1d0e2a(0x3a8)]){_0x51f4d8=_0x49a864[_0x1d0e2a(0xc18)](_0x51f4d8);const _0x19ce1b=new Cesium__namespace['Cartographic']();_0x30ae6d&&(_0x51f4d8=_0x301f8f[_0x1d0e2a(0xaa8)][_0x1d0e2a(0x5ac)]['cartographicToCartesian'](_0x301f8f[_0x1d0e2a(_0x511c11._0x4530cd)]['unproject'](_0x51f4d8,_0x19ce1b)));}else!_0x30ae6d&&(_0x51f4d8=_0x49a864['worldToCameraCoordinatesPoint'](_0x51f4d8));return _0x51f4d8;}['_orbit'](_0x34de3f){const _0x5c6f80={_0x51f245:0x568,_0x4c9cb6:0x3a8,_0x5297c5:0x622,_0x3011c5:0x5bb,_0x4186f2:0xaa8,_0x273d8f:0x2c9,_0x382780:0xdde,_0x236822:0x101f,_0x20f135:0x25b,_0x3c949b:0x40c},_0x44020d=_0x3d5d32,_0x403325=this['_map']['scene'],_0x4340eb=_0x403325['screenSpaceCameraController'],_0x5b9554=_0x403325['camera'];if(_0x403325['mode']===Cesium__namespace['SceneMode']['MORPHING']||!_0x4340eb['enableInputs'])return;switch(_0x403325['mode']){case Cesium__namespace['SceneMode']['SCENE2D']:if(!_0x4340eb[_0x44020d(_0x5c6f80._0x51f245)])return;break;case Cesium__namespace['SceneMode'][_0x44020d(_0x5c6f80._0x4c9cb6)]:if(_0x4340eb['enableLook'])break;if(!_0x4340eb['enableTranslate']||!_0x4340eb['enableTilt'])return;break;case Cesium__namespace[_0x44020d(0xb22)]['SCENE3D']:default:if(_0x4340eb['enableLook'])break;if(!_0x4340eb['enableTilt']||!_0x4340eb[_0x44020d(_0x5c6f80._0x5297c5)])return;break;}this['_unbindDocumentEvent'](),this['_mouseMoveHandle']=_0x118437=>{this['_orbitMouseMoveFunction'](_0x118437);},this['_mouseUpHandle']=()=>{this['_orbitMouseUpFunction']();},this['_orbitLastTimestamp']=Cesium__namespace['getTimestamp']();if(this['_map']['trackedEntity'])this['_orbitFrame']=undefined,this['_orbitIsLook']=![];else{const _0x47c764=this['_getCameraFocus'](!![]);!_0x47c764?(this['_orbitFrame']=Cesium__namespace[_0x44020d(_0x5c6f80._0x3011c5)]['eastNorthUpToFixedFrame'](_0x5b9554['positionWC'],_0x403325[_0x44020d(_0x5c6f80._0x4186f2)]['ellipsoid']),this['_orbitIsLook']=!![]):(this[_0x44020d(0x26e)]=Cesium__namespace[_0x44020d(0x5bb)]['eastNorthUpToFixedFrame'](_0x47c764,_0x403325['globe']['ellipsoid']),this[_0x44020d(_0x5c6f80._0x273d8f)]=![]);}this[_0x44020d(0x81a)][_0x44020d(_0x5c6f80._0x382780)]['visibility']=_0x44020d(_0x5c6f80._0x236822),this['_container_inner']['className']+='\x20compass-inner-active',this[_0x44020d(_0x5c6f80._0x20f135)](),this['_map']['on'](EventType['clockTick'],this[_0x44020d(0x385)],this),this[_0x44020d(_0x5c6f80._0x3c949b)](_0x34de3f,this['_compassRectangle']['width']);}[_0x3d5d32(0x385)](_0x5c7d33){const _0x240eb0={_0x2c5d1e:0xfc1,_0x44db69:0x256,_0x4f6dd7:0x723,_0x450c19:0x26e,_0x5b9001:0x315,_0x41e592:0x8d7,_0x12bc2c:0x63c,_0x2636a0:0x60f},_0x1e022f=_0x3d5d32,_0x36db99=this['_map'][_0x1e022f(_0x240eb0._0x2c5d1e)],_0x12677c=this[_0x1e022f(0x1d1)]['camera'],_0x29fc40=Cesium__namespace[_0x1e022f(0x9ea)](),_0xc8ee20=_0x29fc40-this['_orbitLastTimestamp'],_0x547c2b=(this['_orbitCursorOpacity']-0.5)*2.5/0x3e8,_0x4f7beb=_0xc8ee20*_0x547c2b,_0xd2e610=this['_orbitCursorAngle']+Cesium__namespace[_0x1e022f(0x103e)]['PI_OVER_TWO'],_0x19e84f=Math[_0x1e022f(_0x240eb0._0x44db69)](_0xd2e610)*_0x4f7beb,_0x16b956=Math[_0x1e022f(_0x240eb0._0x4f6dd7)](_0xd2e610)*_0x4f7beb;let _0x217e12;this[_0x1e022f(_0x240eb0._0x450c19)]&&(_0x217e12=Cesium__namespace[_0x1e022f(0xf5d)][_0x1e022f(_0x240eb0._0x5b9001)](_0x12677c['transform']),_0x12677c['lookAtTransform'](this['_orbitFrame'])),_0x36db99[_0x1e022f(0x6e1)]===Cesium__namespace['SceneMode'][_0x1e022f(_0x240eb0._0x41e592)]?_0x12677c[_0x1e022f(_0x240eb0._0x12bc2c)](new Cesium__namespace['Cartesian3'](_0x19e84f,_0x16b956,0x0),Math['max'](_0x36db99['canvas']['clientWidth'],_0x36db99[_0x1e022f(_0x240eb0._0x2636a0)]['clientHeight'])/0x64*_0x12677c['positionCartographic'][_0x1e022f(0x83e)]*_0x4f7beb):this['_orbitIsLook']?(_0x12677c['look'](Cesium__namespace['Cartesian3'][_0x1e022f(0x7db)],-_0x19e84f),_0x12677c['look'](_0x12677c['right'],-_0x16b956)):(_0x12677c[_0x1e022f(0x751)](_0x19e84f),_0x12677c['rotateUp'](_0x16b956)),this['_orbitFrame']&&_0x217e12&&_0x12677c['lookAtTransform'](_0x217e12),this[_0x1e022f(0x679)]=_0x29fc40;}['_updateAngleAndOpacity'](_0x5599f8,_0x55c42b){const _0x217baa={_0x500dd4:0x81a},_0x293fd1=_0x3d5d32,_0x9c988e=Math['atan2'](-_0x5599f8['y'],_0x5599f8['x']);this['_orbitCursorAngle']=Cesium__namespace['Math']['zeroToTwoPi'](_0x9c988e-Cesium__namespace['Math']['PI_OVER_TWO']);const _0x4dbc7a=Cesium__namespace['Cartesian2']['magnitude'](_0x5599f8),_0x22ad30=_0x55c42b/0x2,_0x4289ef=Math['min'](_0x4dbc7a/_0x22ad30,0x1);this['_orbitCursorOpacity']=0.5*_0x4289ef*_0x4289ef+0.5,this[_0x293fd1(_0x217baa._0x500dd4)]['style'][_0x293fd1(0x3bd)]='\x0a\x20\x20\x20\x20\x20\x20transform:\x20rotate(-'+this['_orbitCursorAngle']+_0x293fd1(0x531)+this['_orbitCursorOpacity'];}['_orbitMouseMoveFunction'](_0x3062e0){const _0x26c8ba=_0x3d5d32;this['_updateAngleAndOpacity'](this[_0x26c8ba(0x2ca)](_0x3062e0),this['_compassRectangle']['width']);}['_orbitMouseUpFunction'](){const _0x3196c7={_0x2ea8a9:0x6df,_0x2519af:0xdde,_0x4f678d:0x910},_0x3698e9=_0x3d5d32;this['_unbindDocumentEvent'](),this[_0x3698e9(0x1d1)]['off'](EventType[_0x3698e9(_0x3196c7._0x2ea8a9)],this['_orbitTickFunction'],this),this['_container_rotationArc'][_0x3698e9(_0x3196c7._0x2519af)][_0x3698e9(0x103c)]=_0x3698e9(0x773),this[_0x3698e9(_0x3196c7._0x4f678d)]['className']=this['_container_inner'][_0x3698e9(0xdc3)]['replace']('compass-inner-active','');}[_0x3d5d32(0xd95)](_0x396363){const _0x3a8213={_0x722b11:0xb22,_0x55c30a:0xec8,_0x26d40d:0x1038,_0x638ec4:0x568,_0x265a07:0xb63},_0x2a0dfa={_0x421cfd:0xfb4},_0x583fd8=_0x3d5d32,_0x5ac4c1=this[_0x583fd8(0x1d1)][_0x583fd8(0xfc1)],_0x1a6c9a=_0x5ac4c1['camera'],_0x2b5c39=_0x5ac4c1['screenSpaceCameraController'];if(_0x5ac4c1['mode']===Cesium__namespace['SceneMode']['MORPHING']||_0x5ac4c1['mode']===Cesium__namespace['SceneMode']['SCENE2D']||!_0x2b5c39['enableInputs'])return;if(!_0x2b5c39['enableLook']&&(_0x5ac4c1[_0x583fd8(0x6e1)]===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']||_0x5ac4c1['mode']===Cesium__namespace[_0x583fd8(_0x3a8213._0x722b11)]['SCENE3D']&&!_0x2b5c39['enableRotate']))return;this['_unbindDocumentEvent'](),this['_mouseMoveHandle']=_0x10f9a8=>{this['_rotateMouseMoveFunction'](_0x10f9a8);},this['_mouseUpHandle']=()=>{const _0x5b14ae=_0x583fd8;this[_0x5b14ae(_0x2a0dfa._0x421cfd)]();},this['_rotateInitialCursorAngle']=Math[_0x583fd8(_0x3a8213._0x55c30a)](-_0x396363['y'],_0x396363['x']);if(this['_map'][_0x583fd8(0x98d)])this[_0x583fd8(_0x3a8213._0x26d40d)]=undefined;else{const _0x1c63b7=this[_0x583fd8(0x41e)](!![]);!_0x1c63b7||_0x5ac4c1['mode']===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']&&!_0x2b5c39['enableLook']&&!_0x2b5c39[_0x583fd8(_0x3a8213._0x638ec4)]?this['_rotateFrame']=Cesium__namespace['Transforms']['eastNorthUpToFixedFrame'](_0x1a6c9a['positionWC'],_0x5ac4c1['globe']['ellipsoid']):this[_0x583fd8(0x1038)]=Cesium__namespace['Transforms'][_0x583fd8(0x724)](_0x1c63b7,_0x5ac4c1['globe']['ellipsoid']);}let _0x3174f9;this[_0x583fd8(0x1038)]&&(_0x3174f9=Cesium__namespace['Matrix4'][_0x583fd8(0x315)](_0x1a6c9a['transform']),_0x1a6c9a[_0x583fd8(_0x3a8213._0x265a07)](this['_rotateFrame'])),this['_rotateInitialCameraAngle']=-_0x1a6c9a['heading'],this['_rotateFrame']&&_0x3174f9&&_0x1a6c9a['lookAtTransform'](_0x3174f9),this['_bindDocumentEvent']();}['_bindDocumentEvent'](){const _0x2b6a53={_0x51bff6:0xc01,_0x23c227:0x870},_0x351870=_0x3d5d32;this[_0x351870(0x8d3)]&&(document['addEventListener']('mousemove',this['_mouseMoveHandle'],![]),document['addEventListener'](_0x351870(_0x2b6a53._0x51bff6),this['_mouseMoveHandle'],![])),this[_0x351870(_0x2b6a53._0x23c227)]&&(document['addEventListener']('mouseup',this['_mouseUpHandle'],![]),document['addEventListener']('touchend',this[_0x351870(0x870)],![]),document['addEventListener']('touchcancel',this['_mouseUpHandle'],![]));}[_0x3d5d32(0xfb4)](){const _0x4289ae={_0x5ca741:0x870},_0xf84635=_0x3d5d32;this['_mouseMoveHandle']&&(document['removeEventListener'](_0xf84635(0xee1),this['_mouseMoveHandle'],![]),document['removeEventListener']('touchmove',this['_mouseMoveHandle'],![]),this['_mouseMoveHandle']=undefined),this[_0xf84635(_0x4289ae._0x5ca741)]&&(document['removeEventListener'](_0xf84635(0x100a),this['_mouseUpHandle'],![]),document[_0xf84635(0xd42)]('touchend',this['_mouseUpHandle'],![]),document['removeEventListener']('touchcancel',this['_mouseUpHandle'],![]),this['_mouseUpHandle']=undefined);}[_0x3d5d32(0xba7)](_0x9f2c0e){const _0x3c0ca7={_0x430437:0x1038},_0x1405cb=_0x3d5d32,_0x35cadf=this[_0x1405cb(0x1d1)]['camera'],_0xef5c17=this['_getVector'](_0x9f2c0e),_0x38ccb3=Math['atan2'](-_0xef5c17['y'],_0xef5c17['x']),_0x3e7fd5=_0x38ccb3-this['_rotateInitialCursorAngle'],_0x109061=Cesium__namespace['Math']['zeroToTwoPi'](this['_rotateInitialCameraAngle']-_0x3e7fd5);let _0x48b9a5;this['_rotateFrame']&&(_0x48b9a5=Cesium__namespace['Matrix4']['clone'](_0x35cadf['transform']),_0x35cadf[_0x1405cb(0xb63)](this['_rotateFrame']));const _0x3c2d9a=-_0x35cadf['heading'];_0x35cadf['rotateRight'](_0x109061-_0x3c2d9a),this[_0x1405cb(_0x3c0ca7._0x430437)]&&_0x48b9a5&&_0x35cadf[_0x1405cb(0xb63)](_0x48b9a5);}[_0x3d5d32(0x2ca)](_0x102534){const _0x4482dd={_0x1781b7:0x73c,_0xc91742:0xb0e,_0x5da0e7:0xfb5,_0x458afe:0x474},_0x3b358f=_0x3d5d32;var _0x19e91d;const _0x4c152f=this['_compassRectangle'],_0x42f9b5=new Cesium__namespace['Cartesian2']((_0x4c152f['right']-_0x4c152f[_0x3b358f(0xfb5)])/0x2,(_0x4c152f['bottom']-_0x4c152f['top'])/0x2);let _0x46792b=_0x102534['clientX'],_0x2e03f4=_0x102534[_0x3b358f(0xbc9)];((_0x19e91d=_0x102534[_0x3b358f(_0x4482dd._0x1781b7)])===null||_0x19e91d===void 0x0?void 0x0:_0x19e91d['length'])>0x0&&(_0x46792b=_0x102534['touches'][0x0]['clientX'],_0x2e03f4=_0x102534['touches'][0x0]['clientY']);const _0x4c9ad2=new Cesium__namespace[(_0x3b358f(_0x4482dd._0xc91742))](_0x46792b-_0x4c152f[_0x3b358f(_0x4482dd._0x5da0e7)],_0x2e03f4-_0x4c152f[_0x3b358f(_0x4482dd._0x458afe)]),_0x36d525=new Cesium__namespace['Cartesian2']();return Cesium__namespace[_0x3b358f(_0x4482dd._0xc91742)]['subtract'](_0x4c9ad2,_0x42f9b5,_0x36d525),_0x36d525;}}register$1('compass',Compass);const geodesic=new Cesium__namespace['EllipsoidGeodesic'](),BASE=[0x1,0x2,0x3,0x5],DIS=[...BASE,...BASE['map'](_0x15859d=>_0x15859d*0xa),...BASE[_0x3d5d32(0x7e1)](_0x4d9ed3=>_0x4d9ed3*0x64),...BASE['map'](_0x5834ff=>_0x5834ff*0x3e8),...BASE[_0x3d5d32(0x7e1)](_0x235624=>_0x235624*0x2710),...BASE['map'](_0x51085e=>_0x51085e*0x186a0),...BASE[_0x3d5d32(0x7e1)](_0x48d881=>_0x48d881*0xf4240)];class DistanceLegend extends BaseControl{get['distance'](){return this['_currDistance'];}[_0x3d5d32(0xe4c)](){const _0x4a574a={_0x86835c:0x667,_0x3bb9db:0x773,_0x2301b7:0x9ea},_0x2de1af=_0x3d5d32;this['_container']=create$3(_0x2de1af(0x667),'mars3d-distance-legend'),this['_container']['style']['cssText']=this[_0x2de1af(0x36f)](),this['_labelEl']=create$3('div','legend-label',this['_container']),this['_scaleBarEl']=create$3(_0x2de1af(_0x4a574a._0x86835c),_0x2de1af(0x971),this['_container']),this['_container']['style']['visibility']=_0x2de1af(_0x4a574a._0x3bb9db),this['_lastUpdate']=Cesium__namespace[_0x2de1af(_0x4a574a._0x2301b7)]();}['_getCssText'](){const _0x5890e5={_0x15e0f6:0x960,_0x2e60d0:0x433},_0x32587e=_0x3d5d32;var _0x127fb0;const _0x5ebfc1={};if(Cesium__namespace['defined'](this['options']['top'])&&this['options']['top']!=='')_0x5ebfc1['top']=this['options']['top'];else Cesium__namespace[_0x32587e(0xb84)](this['options']['bottom'])&&this[_0x32587e(0x433)][_0x32587e(_0x5890e5._0x15e0f6)]!==''&&(_0x5ebfc1[_0x32587e(_0x5890e5._0x15e0f6)]=this['options']['bottom']);if(Cesium__namespace['defined'](this['options'][_0x32587e(0xfb5)])&&this['options']['left']!=='')_0x5ebfc1['left']=this[_0x32587e(_0x5890e5._0x2e60d0)][_0x32587e(0xfb5)];else Cesium__namespace['defined'](this[_0x32587e(_0x5890e5._0x2e60d0)][_0x32587e(0x28b)])&&this['options']['right']!==''&&(_0x5ebfc1['right']=this['options']['right']);let _0x524285='';for(const _0x482a6c in _0x5ebfc1){_0x524285+=_0x482a6c+':\x20'+_0x5ebfc1[_0x482a6c]+';';}return _0x524285||'left:\x20120px;\x20bottom:\x20'+((_0x127fb0=this['_map']['controls']['timeline'])!==null&&_0x127fb0!==void 0x0&&_0x127fb0['show']?'27':'2')+_0x32587e(0xc83);}[_0x3d5d32(0x226)](){const _0x111604={_0x10165e:0x51a},_0x57e907=_0x3d5d32;this['_map']['on'](EventType[_0x57e907(_0x111604._0x10165e)],this['_updateContent'],this);}['_removedHook'](){const _0x15b622={_0x3f6e4e:0x1d1},_0x2b28be=_0x3d5d32;this[_0x2b28be(_0x15b622._0x3f6e4e)]['off'](EventType['postRender'],this['_updateContent'],this);}['_updateContent'](_0x37ed9a,_0x484069){const _0x40d644={_0x2dc9:0xb29,_0x42dca8:0x352,_0x558ff8:0x352,_0x976d8d:0xb0e,_0x142dbd:0x1037,_0x227cf7:0xaa8,_0x379382:0x7fd,_0xb65790:0xae5,_0x53e531:0xc83},_0x259bf3=_0x3d5d32,_0x551822=Cesium__namespace[_0x259bf3(0x9ea)]();if(_0x551822=0x0;--_0x3849a0){if(DIS[_0x3849a0]/_0x519ed8<_0x24d754){_0xd3a3c6=DIS[_0x3849a0];break;}}if(_0xd3a3c6){this['_currDistance']!==_0xd3a3c6&&(this[_0x259bf3(_0x40d644._0x379382)]=_0xd3a3c6,this['fire'](EventType['change'],{'distance':_0xd3a3c6}));this['_container'][_0x259bf3(0xdde)]['visibility']='visible',this['_labelEl'][_0x259bf3(_0x40d644._0xb65790)]=_0xd3a3c6>=0x3e8?_0xd3a3c6/0x3e8+'\x20km':_0xd3a3c6+'\x20m';const _0x396f5c=_0xd3a3c6/_0x519ed8|0x0;this['_scaleBarEl']['style']['cssText']='width:\x20'+_0x396f5c+'px;\x20left:\x20'+(0x7d-_0x396f5c)/0x2+_0x259bf3(_0x40d644._0x53e531);}}}register$1('distanceLegend',DistanceLegend);const icon$2='\x0a\x0a\x20\x20\x20\x20\x0a\x0a';class MapSplit extends BaseControl{get['type'](){return'mapSplit';}get[_0x3d5d32(0x5d3)](){const _0x5f1e67={_0x17be40:0x587},_0x59e867=_0x3d5d32;return this[_0x59e867(_0x5f1e67._0x17be40)];}set['leftLayer'](_0x2ebb2c){const _0x1f3609={_0x33e481:0x587,_0x1ab67a:0x587},_0x1a1787=_0x3d5d32;this['_leftLayer']&&(this[_0x1a1787(_0x1f3609._0x33e481)]['forEach'](_0x32602a=>{_0x32602a['_hasRemoveByMapSplit']&&_0x32602a['remove']();}),this['_leftLayer']=null),_0x2ebb2c&&(!Array['isArray'](_0x2ebb2c)&&(_0x2ebb2c=[_0x2ebb2c]),this[_0x1a1787(_0x1f3609._0x1ab67a)]=[],_0x2ebb2c['forEach'](_0x82c519=>{const _0x31e5f1=_0x1a1787;_0x82c519=this[_0x31e5f1(0x9d5)](_0x82c519,Cesium__namespace['SplitDirection']['LEFT']),this[_0x31e5f1(0x587)]['push'](_0x82c519);}));}get[_0x3d5d32(0x7b7)](){return this['_rightLayer'];}set['rightLayer'](_0x56ad9a){this['_rightLayer']&&(this['_rightLayer']['forEach'](_0x288684=>{_0x288684['_hasRemoveByMapSplit']&&_0x288684['remove']();}),this['_rightLayer']=null),_0x56ad9a&&(!Array['isArray'](_0x56ad9a)&&(_0x56ad9a=[_0x56ad9a]),this['_rightLayer']=[],_0x56ad9a['forEach'](_0x595180=>{_0x595180=this['setLayerSplitDirection'](_0x595180,Cesium__namespace['SplitDirection']['RIGHT']),this['_rightLayer']['push'](_0x595180);}));}[_0x3d5d32(0xe4c)](){const _0x598221={_0x222d4b:0x667,_0x13a084:0x7e8,_0x166363:0xcec,_0x30e46a:0x2d7},_0x40da93=_0x3d5d32;this['_container']=create$3(_0x40da93(_0x598221._0x222d4b),_0x40da93(_0x598221._0x13a084));const _0x356103=parseDom(icon$2,!![],'slider-splitter');this['_container']['appendChild'](_0x356103);const _0x2187c0=new Cesium__namespace['ScreenSpaceEventHandler'](_0x356103),_0x557b6b=this;_0x2187c0['setInputAction'](()=>{_0x557b6b['_moveActive']=!![];},Cesium__namespace['ScreenSpaceEventType']['LEFT_DOWN']),_0x2187c0[_0x40da93(_0x598221._0x166363)](()=>{_0x557b6b['_moveActive']=!![];},Cesium__namespace[_0x40da93(_0x598221._0x30e46a)]['PINCH_START']),_0x2187c0['setInputAction'](_0x1a0587=>{_0x557b6b['_moveHandler'](_0x1a0587);},Cesium__namespace['ScreenSpaceEventType']['MOUSE_MOVE']),_0x2187c0['setInputAction'](_0x327332=>{_0x557b6b['_moveHandler'](_0x327332);},Cesium__namespace['ScreenSpaceEventType']['PINCH_MOVE']),_0x2187c0['setInputAction'](()=>{_0x557b6b['_moveActive']=![];},Cesium__namespace['ScreenSpaceEventType']['LEFT_UP']),_0x2187c0['setInputAction'](()=>{_0x557b6b['_moveActive']=![];},Cesium__namespace[_0x40da93(0x2d7)]['PINCH_END']);}[_0x3d5d32(0x226)](){const _0x39f7c2={_0xbde12a:0xdde,_0x508ae0:0x595,_0x3597fd:0x433},_0x471e13=_0x3d5d32;this['_map']['scene']['splitPosition']=0.5,this['_container'][_0x471e13(_0x39f7c2._0xbde12a)]['left']='50%',this[_0x471e13(_0x39f7c2._0x508ae0)](),this['options'][_0x471e13(0x5d3)]&&(this['leftLayer']=this['options']['leftLayer']),this['options']['rightLayer']&&(this['rightLayer']=this[_0x471e13(_0x39f7c2._0x3597fd)]['rightLayer']);}['_removedHook'](){this['_map']['scene']['splitPosition']=0x0,this['leftLayer']=null,this['rightLayer']=null;}['_moveHandler'](_0x192595){const _0x501335={_0x5da8ea:0xfc1,_0x21d845:0x314},_0x1cb24a=_0x3d5d32;if(!this['_moveActive']||!this[_0x1cb24a(0xa63)])return;const _0x5e17d4=_0x192595?_0x192595['endPosition']['x']:0x0,_0x14df06=(this['_container'][_0x1cb24a(0xbbd)]+_0x5e17d4)/this['_container']['parentElement']['offsetWidth'];if(_0x14df06<0x0||_0x14df06>0x1)return;this['_container'][_0x1cb24a(0xdde)]['left']=0x64*_0x14df06+'%',this['_map'][_0x1cb24a(_0x501335._0x5da8ea)]['splitPosition']=_0x14df06,this['fire'](EventType[_0x1cb24a(_0x501335._0x21d845)],{'splitPosition':_0x14df06});}['setLayerSplitDirection'](_0x17834d,_0x4b7257){const _0x484c78={_0x409225:0xccd},_0x58ca97=_0x3d5d32;return!_0x17834d['isAdded']&&this['_map']&&(_0x17834d['type']&&!_0x17834d[_0x58ca97(0xb5d)]&&(_0x17834d=create$2(_0x17834d)),this['_map']['addLayer'](_0x17834d),_0x17834d['_hasRemoveByMapSplit']=!![]),_0x17834d[_0x58ca97(_0x484c78._0x409225)]['then'](_0x58ec2f=>{const _0xc2d640=_0x58ca97;if(_0x58ec2f['hasChildLayer'])for(let _0x10adb0=0x0;_0x10adb0<_0x58ec2f[_0xc2d640(0x274)]['length'];_0x10adb0++){const _0x3b3c56=_0x58ec2f['arrLayer'][_0x10adb0]['layer'];_0x3b3c56&&(_0x3b3c56['splitDirection']=_0x4b7257);}else{const _0x5e226c=_0x58ec2f[_0xc2d640(0x548)];_0x5e226c&&(_0x5e226c['splitDirection']=_0x4b7257);}}),_0x17834d;}}register$1('mapSplit',MapSplit);class SceneEvent{constructor(_0x33da6e){const _0x5aee84={_0x73788e:0x1d1,_0x31f1e9:0x435,_0x24b3bf:0xaa8},_0x46edcc=_0x3d5d32;this[_0x46edcc(_0x5aee84._0x73788e)]=_0x33da6e,this[_0x46edcc(0x71c)]=_0x33da6e[_0x46edcc(_0x5aee84._0x31f1e9)],this['_scene']=_0x33da6e[_0x46edcc(0xfc1)],this['_globe']=_0x33da6e['scene'][_0x46edcc(_0x5aee84._0x24b3bf)],this['_clock']=_0x33da6e['clock'];}[_0x3d5d32(0xa23)](_0x4cb0c3){const _0x459768={_0x1f8950:0x2dc,_0x25274b:0x71c,_0x2b767f:0x9c3,_0x43be00:0x627,_0x1e3c91:0x627,_0xb63403:0x8db},_0x824dc4=_0x3d5d32;switch(_0x4cb0c3){case EventType['cameraMoveStart']:return this['_camera']['moveStart'];case EventType[_0x824dc4(_0x459768._0x1f8950)]:return this[_0x824dc4(_0x459768._0x25274b)][_0x824dc4(0x64d)];case EventType['cameraChanged']:return this[_0x824dc4(_0x459768._0x25274b)][_0x824dc4(_0x459768._0x2b767f)];case EventType[_0x824dc4(0x8c1)]:return this['_scene'][_0x824dc4(0x8c1)];case EventType['postUpdate']:return this[_0x824dc4(_0x459768._0x43be00)]['postUpdate'];case EventType['preRender']:return this['_scene']['preRender'];case EventType['postRender']:return this['_scene']['postRender'];case EventType['renderError']:return this['_scene']['renderError'];case EventType['morphStart']:return this['_scene']['morphStart'];case EventType['morphComplete']:return this[_0x824dc4(_0x459768._0x1e3c91)][_0x824dc4(0x918)];case EventType[_0x824dc4(0x6df)]:return this['_clock']['onTick'];case EventType['clockStop']:return this['_clock'][_0x824dc4(0x207)];case EventType['terrainChange']:return this['_globe']['terrainProviderChanged'];case EventType['tileLoadProgress']:return this[_0x824dc4(_0x459768._0xb63403)][_0x824dc4(0x291)];default:return null;}}['hasType'](_0x3af66e){const _0x52a23c={_0x43e6a2:0xa23},_0x37f941=_0x3d5d32,_0x46c781=this[_0x37f941(_0x52a23c._0x43e6a2)](_0x3af66e);return Boolean(_0x46c781);}['on'](_0x3d5e5c,_0x199781,_0x4aee27){if(!_0x199781)return;const _0x339017=this['_getEventByType'](_0x3d5e5c);if(!_0x339017)return;return _0x339017['addEventListener'](_0x199781,_0x4aee27||this);}['off'](_0x424311,_0x2c373c,_0x39d178){const _0x260d6f={_0x2b3ec7:0xa23},_0xac86be=_0x3d5d32,_0x490801=this[_0xac86be(_0x260d6f._0x2b3ec7)](_0x424311);if(!_0x490801)return;return _0x490801['removeEventListener'](_0x2c373c,_0x39d178||this);}['listens'](_0xb6e787){const _0x21529b={_0x557720:0x283},_0x373427=_0x3d5d32,_0x370793=this['_getEventByType'](_0xb6e787);if(!_0x370793||_0x370793['numberOfListeners']===0x0)return![];for(let _0xd513ab=0x0;_0xd513ab<_0x370793[_0x373427(_0x21529b._0x557720)]['length'];_0xd513ab++){const _0x11001a=_0x370793[_0x373427(0x283)][_0xd513ab];if(_0x11001a===this['_map'])return!![];}return![];}}const DEF_OPTIONS={'enabledMoveTarget':!![],'moveDelay':0x1e,'pickWidth':0x4,'pickHeight':0x4,'pickLimit':0x9};class MouseEvent{constructor(_0x215f19,_0x215421={}){const _0x1635ed={_0x310254:0x22e},_0x261340=_0x3d5d32;_0x215421={...DEF_OPTIONS,..._0x215421},this['_map']=_0x215f19,this['_viewer']=_0x215f19['viewer'],this['options']=_0x215421,this['moveDelay']=_0x215421['moveDelay'],this[_0x261340(0x4a6)]=_0x215421['enabledMoveTarget'],this[_0x261340(0xece)]=undefined,this[_0x261340(_0x1635ed._0x310254)]();}get['enabledMoveTarget'](){const _0x194b9d={_0x466a3e:0x4a6},_0xcb5241=_0x3d5d32;return this[_0xcb5241(_0x194b9d._0x466a3e)];}set['enabledMoveTarget'](_0x5d33be){const _0x286198={_0x3f9400:0x4a6,_0x2492a4:0x224},_0x92c80e=_0x3d5d32;this[_0x92c80e(_0x286198._0x3f9400)]=_0x5d33be,this[_0x92c80e(_0x286198._0x2492a4)]();}get['noPickEntity'](){return this['_noPickEntity'];}set['noPickEntity'](_0x487f80){const _0x50b7ff={_0x18650b:0x31d},_0x160c2d=_0x3d5d32;this[_0x160c2d(_0x50b7ff._0x18650b)]=_0x487f80;}[_0x3d5d32(0x945)](_0x513e2d){const _0x56734a={_0x733998:0x7aa},_0x3e7843=_0x3d5d32;if(!_0x513e2d||Object['keys'](_0x513e2d)['length']===0x0)return this;return this['options']=merge(this['options'],_0x513e2d),this['moveDelay']=this['options'][_0x3e7843(_0x56734a._0x733998)],this[_0x3e7843(0x4a6)]=this['options']['enabledMoveTarget'],this;}['clearMoveTargetDelay'](){const _0x3c080d={_0x4d4f62:0xb6e,_0x491114:0xb6e},_0x3356c5=_0x3d5d32;this['_moveDelayTik']&&(clearTimeout(this[_0x3356c5(_0x3c080d._0x4d4f62)]),this[_0x3356c5(_0x3c080d._0x491114)]=null);}['_setInputAction'](){const _0x1cc52b={_0x2be209:0xfcc,_0x31f842:0x814,_0x5a7c1e:0xb55,_0x3af982:0x7c2,_0x9435b0:0x2d7,_0x2f3a66:0x87a,_0x1083a4:0x2d7,_0xabe9a9:0x238,_0x58c695:0xcec,_0x35f4f5:0x1d1},_0x2549e3={_0x7f4335:0x1d1,_0x41c3bb:0xefc},_0x249ca6={_0x33d4a8:0xefc},_0x42f3dd={_0x14c04f:0xfc1,_0x1b43cc:0x224},_0x4216b9={_0x5101a9:0xb6e},_0x3d8f6a={_0x5ce6cc:0xcda},_0x527726=_0x3d5d32;this[_0x527726(_0x1cc52b._0x2be209)]=new Cesium__namespace['ScreenSpaceEventHandler'](this[_0x527726(0x809)][_0x527726(0x60f)]),this[_0x527726(0xfcc)]['setInputAction'](_0x3c4941=>{this['_clickHandler'](_0x3c4941);},Cesium__namespace[_0x527726(0x2d7)]['LEFT_CLICK']),this['handler'][_0x527726(0xcec)](_0x4451a3=>{const _0x17a35a=_0x527726;this[_0x17a35a(0xd1e)](_0x4451a3,EventType[_0x17a35a(0xd83)]);},Cesium__namespace['ScreenSpaceEventType']['LEFT_DOUBLE_CLICK']),this['handler'][_0x527726(0xcec)](_0x43e324=>{this['_globeMouseHandler'](_0x43e324,[EventType['leftDown'],EventType['mouseDown']]);},Cesium__namespace[_0x527726(0x2d7)][_0x527726(_0x1cc52b._0x31f842)]),this['handler']['setInputAction'](_0x5aee62=>{const _0x3b6d91=_0x527726;this['_globeMouseHandler'](_0x5aee62,[EventType[_0x3b6d91(_0x3d8f6a._0x5ce6cc)],EventType['mouseUp']]);},Cesium__namespace['ScreenSpaceEventType'][_0x527726(_0x1cc52b._0x5a7c1e)]),this[_0x527726(0xfcc)]['setInputAction'](_0x57f405=>{const _0x417fbb=_0x527726,_0x3303ca=_0x57f405['endPosition'],_0x4bf50b=getCurrentMousePosition(this[_0x417fbb(0x809)][_0x417fbb(_0x42f3dd._0x14c04f)],_0x3303ca,this['noPickEntity']);_0x57f405['cartesian']=_0x4bf50b,this[_0x417fbb(0x276)]&&(this[_0x417fbb(_0x42f3dd._0x1b43cc)](),this['moveDelay']>0x0?this['_moveDelayTik']=setTimeout(_0xb59aea=>{const _0x6900f=_0x417fbb;this[_0x6900f(_0x4216b9._0x5101a9)]=null,this['_mouseMoveHandler'](_0x57f405);},this[_0x417fbb(0x7aa)]):this['_mouseMoveHandler'](_0x57f405)),this['_map']['fire'](EventType['mouseMove'],{..._0x57f405,'cartesian':_0x4bf50b,'windowPosition':_0x3303ca});},Cesium__namespace[_0x527726(0x2d7)]['MOUSE_MOVE']),this['handler']['setInputAction'](_0x197cea=>{const _0x391d97=_0x527726;this[_0x391d97(0x1d1)][_0x391d97(_0x249ca6._0x33d4a8)](EventType[_0x391d97(0x78e)],_0x197cea);},Cesium__namespace['ScreenSpaceEventType'][_0x527726(_0x1cc52b._0x3af982)]),this['handler']['setInputAction'](_0x151b92=>{const _0x1834d1=_0x527726;this[_0x1834d1(0xd1e)](_0x151b92,EventType['rightClick']);},Cesium__namespace['ScreenSpaceEventType']['RIGHT_CLICK']),this['handler']['setInputAction'](_0x11bda3=>{const _0x20931c=_0x527726;this[_0x20931c(0xd1e)](_0x11bda3,[EventType['rightDown'],EventType['mouseDown']]);},Cesium__namespace[_0x527726(_0x1cc52b._0x9435b0)]['RIGHT_DOWN']),this[_0x527726(_0x1cc52b._0x2be209)][_0x527726(0xcec)](_0x50ec19=>{this['_globeMouseHandler'](_0x50ec19,[EventType['rightUp'],EventType['mouseUp']]);},Cesium__namespace[_0x527726(0x2d7)][_0x527726(_0x1cc52b._0x2f3a66)]),this['handler']['setInputAction'](_0x4a46ec=>{const _0x5c2595=_0x527726;this['_globeMouseHandler'](_0x4a46ec,EventType[_0x5c2595(0xb67)]);},Cesium__namespace[_0x527726(_0x1cc52b._0x1083a4)][_0x527726(_0x1cc52b._0xabe9a9)]),this['handler']['setInputAction'](_0x4517ea=>{const _0x69822f=_0x527726;this[_0x69822f(0xd1e)](_0x4517ea,[EventType[_0x69822f(0x572)],EventType['mouseDown']]);},Cesium__namespace['ScreenSpaceEventType'][_0x527726(0x7f6)]),this[_0x527726(0xfcc)]['setInputAction'](_0x5f1676=>{this['_globeMouseHandler'](_0x5f1676,[EventType['middleUp'],EventType['mouseUp']]);},Cesium__namespace['ScreenSpaceEventType']['MIDDLE_UP']),this[_0x527726(_0x1cc52b._0x2be209)]['setInputAction'](_0x4cb822=>{this['_globeMouseHandler'](_0x4cb822,EventType['pinchStart']);},Cesium__namespace['ScreenSpaceEventType']['PINCH_START']),this['handler'][_0x527726(0xcec)](_0x4e5fca=>{const _0x46c15a=_0x527726;this[_0x46c15a(0xd1e)](_0x4e5fca,EventType[_0x46c15a(0xe6c)]);},Cesium__namespace['ScreenSpaceEventType']['PINCH_END']),this[_0x527726(0xfcc)][_0x527726(_0x1cc52b._0x58c695)](_0x5b712d=>{const _0x599ef7=_0x527726;this[_0x599ef7(_0x2549e3._0x7f4335)][_0x599ef7(_0x2549e3._0x41c3bb)](EventType['pinchMove'],_0x5b712d);},Cesium__namespace['ScreenSpaceEventType']['PINCH_MOVE']),this[_0x527726(_0x1cc52b._0x35f4f5)]['canvas']['addEventListener']('keydown',this['_onKeyDown']['bind'](this)),this['_map'][_0x527726(0x60f)]['addEventListener']('keyup',this['_onKeyUp']['bind'](this)),this['_map']['canvas'][_0x527726(0x34f)]('mouseover',this['_onMouseOver']['bind'](this)),this['_map'][_0x527726(0x60f)]['addEventListener']('mouseout',this['_onMouseOut']['bind'](this));}['_onMouseOver'](_0x2f0d59){this['_map']['fire'](EventType['mouseOver'],{'mouseEvent':_0x2f0d59});}[_0x3d5d32(0xdcb)](_0x17eb14){this['_map']['fire'](EventType['mouseOut'],{'mouseEvent':_0x17eb14});}['_onKeyDown'](_0x4f2276){const _0x7928d2=_0x3d5d32;this['_map']['fire'](EventType['keydown'],{'mouseEvent':_0x4f2276,'ctrlKey':_0x4f2276[_0x7928d2(0x84c)],'altKey':_0x4f2276['altKey'],'metaKey':_0x4f2276['metaKey'],'shiftKey':_0x4f2276['shiftKey'],'code':_0x4f2276[_0x7928d2(0x985)],'key':_0x4f2276['key'],'keyCode':_0x4f2276[_0x7928d2(0x404)]});}['_onKeyUp'](_0x4edc10){const _0x55bea3={_0x3decc7:0x1d1,_0x18b7cc:0xb23},_0x38c013=_0x3d5d32;this[_0x38c013(_0x55bea3._0x3decc7)]['fire'](EventType['keyup'],{'mouseEvent':_0x4edc10,'ctrlKey':_0x4edc10['ctrlKey'],'altKey':_0x4edc10['altKey'],'metaKey':_0x4edc10[_0x38c013(_0x55bea3._0x18b7cc)],'shiftKey':_0x4edc10['shiftKey'],'code':_0x4edc10['code'],'key':_0x4edc10['key'],'keyCode':_0x4edc10[_0x38c013(0x404)]});}['getPickTarget'](_0x414a09,_0x54893f){const _0x214b47={_0x1536b3:0x328,_0x2f925e:0xfc1,_0x3efebe:0x7e4,_0x261d72:0x433,_0x28de4d:0x75a,_0x42aaab:0xc84,_0x22d833:0x328,_0x54b169:0xf9d,_0x1a5777:0x7c5,_0x2246c0:0x4c1},_0xe302d6=_0x3d5d32;if(_0x54893f!==null&&_0x54893f!==void 0x0&&_0x54893f[_0xe302d6(_0x214b47._0x1536b3)])return _0x54893f;let _0x432cd5;try{_0x432cd5=this['_viewer']['scene']['pick'](_0x414a09,this['options']['pickWidth'],this[_0xe302d6(0x433)]['pickHeight']);}catch(_0x3f1a5b){}if(this['_lastPickedInfo']&&_0x432cd5&&this['_lastPickedInfo'][_0xe302d6(0x758)]===_0x432cd5){let _0x14d641=_0x54893f===null||_0x54893f===void 0x0?void 0x0:_0x54893f['cartesian'];if(!_0x14d641){var _0x1b36ff,_0x2a7e48;if(((_0x1b36ff=this['_lastPickedInfo'])===null||_0x1b36ff===void 0x0?void 0x0:(_0x2a7e48=_0x1b36ff[_0xe302d6(0x548)])===null||_0x2a7e48===void 0x0?void 0x0:_0x2a7e48['type'])==='3dtiles'){const _0x18e3a0=this['_viewer']['scene']['onlyPickModelPosition'];this['_viewer'][_0xe302d6(_0x214b47._0x2f925e)]['onlyPickModelPosition']=!![],_0x14d641=getCurrentMousePosition(this[_0xe302d6(0x809)][_0xe302d6(_0x214b47._0x2f925e)],_0x414a09,this[_0xe302d6(_0x214b47._0x3efebe)]),this[_0xe302d6(0x809)]['scene']['onlyPickModelPosition']=_0x18e3a0;}else _0x14d641=getCurrentMousePosition(this['_viewer'][_0xe302d6(_0x214b47._0x2f925e)],_0x414a09,this['noPickEntity']);}return{..._0x54893f,...this['_lastPickedInfo'],'cartesian':_0x14d641,'windowPosition':_0x414a09};}let _0x4672d1=this['_getTargetInfo'](_0x432cd5,_0x414a09);if(_0x432cd5&&this[_0xe302d6(0x455)](_0x4672d1)){const _0xa387fc=this['_viewer'][_0xe302d6(0xfc1)][_0xe302d6(0x90f)](_0x414a09,this['options']['pickLimit'],this[_0xe302d6(_0x214b47._0x261d72)]['pickWidth'],this['options'][_0xe302d6(_0x214b47._0x28de4d)]),_0x239e2f=[];if(_0xa387fc&&_0xa387fc[_0xe302d6(_0x214b47._0x42aaab)]>0x0)for(let _0x191342=0x0,_0x2eea81=_0xa387fc['length'];_0x191342<_0x2eea81;_0x191342++){const _0x3c59e6=_0xa387fc[_0x191342];if(_0x432cd5===_0x3c59e6){var _0x27bb19;_0x239e2f['push']((_0x27bb19=_0x4672d1)===null||_0x27bb19===void 0x0?void 0x0:_0x27bb19['graphic']);continue;}const _0x133cdc=this['_getTargetInfo'](_0x3c59e6,_0x414a09);_0x239e2f['push'](_0x133cdc===null||_0x133cdc===void 0x0?void 0x0:_0x133cdc[_0xe302d6(_0x214b47._0x22d833)]);if(this[_0xe302d6(0x455)](_0x133cdc)&&_0x191342!==_0x2eea81-0x1)continue;else{_0x4672d1=_0x133cdc,_0x4672d1['pickedObjects']=_0xa387fc,_0x4672d1[_0xe302d6(_0x214b47._0x54b169)]=_0x239e2f;break;}}}else this[_0xe302d6(_0x214b47._0x1a5777)]=_0x4672d1;let _0x105888=_0x54893f===null||_0x54893f===void 0x0?void 0x0:_0x54893f[_0xe302d6(_0x214b47._0x2246c0)];return!_0x105888&&(_0x105888=getCurrentMousePosition(this['_viewer']['scene'],_0x414a09,this['noPickEntity'])),{..._0x54893f,..._0x4672d1,'cartesian':_0x105888,'windowPosition':_0x414a09};}['_allowDrillPick'](_0x4a403f){var _0x547424,_0xee72bf;let _0x1022d8=(_0x547424=_0x4a403f['graphic'])===null||_0x547424===void 0x0?void 0x0:_0x547424['allowDrillPick'];if(_0x1022d8)return isFunction(_0x1022d8)?_0x1022d8(_0x4a403f):!![];_0x1022d8=(_0xee72bf=_0x4a403f['layer'])===null||_0xee72bf===void 0x0?void 0x0:_0xee72bf['allowDrillPick'];if(_0x1022d8)return isFunction(_0x1022d8)?_0x1022d8(_0x4a403f):!![];return![];}['_getTargetInfo'](_0x5c0fe0,_0x5817fa){const _0x39f73e={_0x222b0b:0xf7d,_0x964945:0x1017,_0x202018:0xb40,_0x4d24db:0x101c,_0x19adfe:0x1d1,_0xe7f136:0x334,_0x433c53:0x8ec,_0x2f7d57:0xe9b},_0x2666c0={_0x5c0eeb:0x328,_0x1b00ac:0xed2},_0x3c683f=_0x3d5d32;var _0xc2d24a,_0x12c145;if(!Cesium__namespace['defined'](_0x5c0fe0))return{};let _0x33d7cb,_0x11b405,_0x5b5671,_0x1b24e4;if(Cesium__namespace['defined'](_0x5c0fe0['id'])&&_0x5c0fe0['id']instanceof Cesium__namespace['Entity'])_0x33d7cb=_0x5c0fe0['id'],_0x1b24e4=_0x33d7cb['id'];else{if(_0x5c0fe0 instanceof Cesium__namespace[_0x3c683f(_0x39f73e._0x222b0b)]){_0x33d7cb=_0x5c0fe0,_0x1b24e4='3dtile_feature_'+_0x5c0fe0['_batchId'];const _0x322a06=_0x5c0fe0['tileset'];_0x11b405=this['_map'][_0x3c683f(0x334)](_0x322a06[_0x3c683f(0xe20)]),_0x5b5671={'attr':get3DTileFeatureAttr(_0x5c0fe0),'feature':_0x5c0fe0};}else{if(_0x5c0fe0['content']&&_0x5c0fe0['content']instanceof(Cesium__namespace[_0x3c683f(_0x39f73e._0x964945)]||Cesium__namespace[_0x3c683f(0x716)])){var _0x582109,_0x439ea1;_0x33d7cb=_0x5c0fe0[_0x3c683f(0xfde)],_0x1b24e4='3dtile_pnts_'+((_0x582109=_0x5c0fe0['content'])===null||_0x582109===void 0x0?void 0x0:(_0x439ea1=_0x582109['_pickId'])===null||_0x439ea1===void 0x0?void 0x0:_0x439ea1[_0x3c683f(0xdfc)])||0x0;const _0x121f90=_0x5c0fe0['primitive'];_0x11b405=this['_map']['getLayerById'](_0x121f90['_mars3d_layerId']);if(_0x5c0fe0['batchTable']);}else{if((_0xc2d24a=_0x5c0fe0['content'])!==null&&_0xc2d24a!==void 0x0&&(_0x12c145=_0xc2d24a['tile'])!==null&&_0x12c145!==void 0x0&&_0x12c145[_0x3c683f(_0x39f73e._0x202018)]){const _0x35bf97=_0x5c0fe0['content'][_0x3c683f(_0x39f73e._0x4d24db)]['i3sNode'],_0x131834=this['_viewer']['scene'][_0x3c683f(0xeb2)](_0x5817fa);_0x131834&&(_0x5b5671={'attr':_0x35bf97['loadFields']()[_0x3c683f(0x44d)](function(){return _0x35bf97['getFieldsForPickedPosition'](_0x131834);}),'feature':_0x35bf97}),_0x33d7cb=_0x35bf97,_0x1b24e4=_0x3c683f(0x337)+_0x35bf97['_nodeIndex']||0x0,_0x11b405=this[_0x3c683f(_0x39f73e._0x19adfe)][_0x3c683f(_0x39f73e._0xe7f136)](_0x35bf97['_dataProvider']['_mars3d_layerId']);}else Cesium__namespace[_0x3c683f(0xb84)](_0x5c0fe0[_0x3c683f(_0x39f73e._0x433c53)])?(_0x33d7cb=_0x5c0fe0['primitive'],_0x1b24e4=_0x5c0fe0['id']):logInfo('getPickTarget:拾取到了对象,请确认是否要做处理',_0x5c0fe0);}}}if(_0x33d7cb){_0x11b405=_0x11b405||this['_map']['getLayerById'](_0x33d7cb['_mars3d_layerId']);if(_0x11b405&&_0x11b405['getGraphicById']){_0x5b5671=_0x5b5671||_0x11b405['getGraphicById'](_0x33d7cb['_mars3d_graphicId']);if(_0x5b5671){_0x1b24e4=_0x5b5671['id'];if(_0x5b5671['getPickedObject']){const _0x2f63fd=_0x5c0fe0['id']||_0x5c0fe0['instanceId'];if(_0x2f63fd){var _0x385660;_0x1b24e4=_0x2f63fd,_0x5c0fe0['data']=_0x5b5671[_0x3c683f(0xe71)](_0x2f63fd),_0x5b5671[_0x3c683f(0xe12)]=(_0x385660=_0x5c0fe0[_0x3c683f(_0x39f73e._0x2f7d57)])===null||_0x385660===void 0x0?void 0x0:_0x385660['attr'];}}}else{var _0x1afa38;(_0x1afa38=_0x33d7cb)!==null&&_0x1afa38!==void 0x0&&_0x1afa38['_clusterData']&&(_0x5b5671=_0x33d7cb['_clusterData']);}}}return{'id':_0x1b24e4,'pickedObject':_0x5c0fe0,'sourceTarget':_0x33d7cb,'czmObject':_0x33d7cb,'layer':_0x11b405,'graphic':_0x5b5671,'hasClickEvent':function(){const _0x4d4bf5=_0x3c683f;if(this['graphic']){if(isFunction(this[_0x4d4bf5(_0x2666c0._0x5c0eeb)]['listens'])&&this['graphic']['listens'](EventType['click']))return!![];if(isFunction(this['graphic'][_0x4d4bf5(0xed2)])&&_0x5b5671[_0x4d4bf5(_0x2666c0._0x1b00ac)]())return!![];}if(this['layer']){var _0x498b06;if(isFunction(this['layer']['listens'])&&this[_0x4d4bf5(0x548)]['listens'](EventType['click']))return!![];if(isFunction(this['layer']['hasPopup'])&&(_0x498b06=_0x11b405)!==null&&_0x498b06!==void 0x0&&_0x498b06[_0x4d4bf5(0xed2)]())return!![];}return![];}};}[_0x3d5d32(0x5d5)](_0x4c619c){const _0x5c7cc5={_0x1bc181:0x680,_0x4ab87f:0x832,_0x1531b7:0xfde},_0x1727ab=_0x3d5d32;if(!_0x4c619c||!_0x4c619c['pickedObject'])return undefined;const _0x52d823=_0x4c619c['pickedObject'],_0x399180=_0x4c619c['czmObject'];if(_0x399180 instanceof Cesium__namespace[_0x1727ab(0xafa)]){const _0x2448ef=_0x52d823['primitive'][_0x1727ab(_0x5c7cc5._0x1bc181)];if((_0x2448ef===null||_0x2448ef===void 0x0?void 0x0:_0x2448ef['length'])>0x0){const _0x3f502a=_0x2448ef['find'](_0x40be40=>{return _0x40be40['object']===_0x52d823;});return _0x3f502a;}}else{if(_0x399180 instanceof Cesium__namespace[_0x1727ab(0xf7d)]){if(_0x52d823[_0x1727ab(_0x5c7cc5._0x4ab87f)])return _0x52d823['pickId'];}else{if(_0x52d823['content']&&_0x52d823[_0x1727ab(_0x5c7cc5._0x1531b7)]instanceof(Cesium__namespace['PointCloud3DTileContent']||Cesium__namespace['PointCloud'])){var _0x24a057;return(_0x24a057=_0x52d823[_0x1727ab(_0x5c7cc5._0x1531b7)])===null||_0x24a057===void 0x0?void 0x0:_0x24a057['_pickId'];}else{var _0x563d21,_0x4fb194;if(_0x52d823['primitive']['pickId'])return _0x52d823['primitive'][_0x1727ab(0x832)];if(_0x52d823['primitive']['_pickIds'])return _0x52d823['primitive'][_0x1727ab(0x680)];if((_0x563d21=_0x52d823['content'])!==null&&_0x563d21!==void 0x0&&(_0x4fb194=_0x563d21['_model'])!==null&&_0x4fb194!==void 0x0&&_0x4fb194['_pickIds']){var _0x110c6d,_0x412255;return(_0x110c6d=_0x52d823['content'])===null||_0x110c6d===void 0x0?void 0x0:(_0x412255=_0x110c6d['_model'])===null||_0x412255===void 0x0?void 0x0:_0x412255['_pickIds'];}}}}return undefined;}['pickImageryLayerFeatures'](_0x563a3c){const _0x1b4726={_0x21c360:0xed4,_0x51d19c:0x4bd},_0x46d508=_0x3d5d32,_0x2ba6c4=LngLatPoint[_0x46d508(_0x1b4726._0x21c360)](_0x563a3c),_0x4c92e4=Cesium__namespace[_0x46d508(0x54d)][_0x46d508(_0x1b4726._0x51d19c)](this['_viewer']['scene'],_0x2ba6c4);return this[_0x46d508(0xf99)](_0x4c92e4,{'cartesian':_0x2ba6c4});}['_pickImageryLayerFeatures'](_0x6d3ddd,_0x5e8ad1){const _0xcd4dcf={_0x18ee11:0x435,_0x20ae13:0x352,_0x477cac:0xa18},_0x52fdd1=_0x3d5d32,_0x39bbcf=this['_viewer']['scene'],_0x34d11f=_0x39bbcf[_0x52fdd1(_0xcd4dcf._0x18ee11)][_0x52fdd1(_0xcd4dcf._0x20ae13)](_0x6d3ddd),_0x4d53ac=_0x39bbcf[_0x52fdd1(_0xcd4dcf._0x477cac)]['pickImageryLayerFeatures'](_0x34d11f,_0x39bbcf);return _0x4d53ac&&_0x4d53ac['then']?_0x4d53ac['then'](_0x570eb5=>{const _0x3def96=_0x52fdd1;return this['_clickTileGraphic'](_0x570eb5,_0x6d3ddd,_0x5e8ad1===null||_0x5e8ad1===void 0x0?void 0x0:_0x5e8ad1[_0x3def96(0x4c1)]);}):Promise['resolve']();}['_clickTileGraphic'](_0x1b574c,_0x6836f,_0x2bf8cd){const _0x1039f4={_0xfb8928:0x271,_0x37bba6:0x62b,_0x29bdf3:0x31e,_0x57aded:0xe9b,_0x384d68:0x328,_0x4e7d9e:0x33f},_0x4831a5=_0x3d5d32;var _0x115a3f,_0x344528,_0x24a1d0;if(!Cesium__namespace['defined'](_0x1b574c)||_0x1b574c['length']===0x0)return;let _0x4886c0=_0x1b574c[0x0];const _0x2e46ee=_0x4886c0['imageryLayer'],_0x4ae120=this['_map']['getLayerById'](_0x2e46ee['_mars3d_layerId']);if(_0x4ae120&&(_0x115a3f=_0x4ae120[_0x4831a5(0x433)])!==null&&_0x115a3f!==void 0x0&&_0x115a3f['featureIndex']){var _0x19a46d;const _0x1875a4=_0x4ae120['options']['featureIndex'];if(((_0x19a46d=_0x4ae120['options'])===null||_0x19a46d===void 0x0?void 0x0:_0x19a46d['featureIndex'])==='end')_0x4886c0=_0x1b574c[_0x1b574c['length']-0x1];else{if(isNumber(_0x1875a4))_0x4886c0=_0x1b574c[_0x1875a4]||_0x4886c0;else isFunction(_0x1875a4)&&(_0x4886c0=_0x1875a4(_0x1b574c)||_0x4886c0);}}const _0x532857={'sourceTarget':_0x2e46ee,'layer':_0x4ae120,'features':_0x1b574c,'attr':_0x4886c0['properties']||((_0x344528=_0x4886c0[_0x4831a5(0xe9b)])===null||_0x344528===void 0x0?void 0x0:_0x344528[_0x4831a5(_0x1039f4._0xfb8928)]),'cartesian':_0x2bf8cd,'windowPosition':_0x6836f};if(_0x4886c0['data']&&_0x4ae120&&((_0x24a1d0=_0x4ae120['options'])!==null&&_0x24a1d0!==void 0x0&&_0x24a1d0['highlight']||_0x4ae120['listens'](EventType['click']))){if(_0x4ae120['options']['featureToGraphic']){const _0x161c58=_0x4ae120['options']['featureToGraphic'](_0x4886c0,_0x532857);if(_0x161c58){var _0x220651;Array[_0x4831a5(_0x1039f4._0x37bba6)](_0x161c58)?(_0x532857['graphic']=_0x161c58['length']>0x0?_0x161c58[0x0]:null,_0x532857['graphics']=_0x161c58):(_0x532857['graphic']=_0x161c58,_0x532857['graphics']=[_0x161c58]),(_0x220651=_0x532857['graphic'])!==null&&_0x220651!==void 0x0&&_0x220651['attr']&&(_0x532857['attr']=_0x532857['graphic']['attr']);}}else{const _0x440710=_0x4ae120['options']['hasToGraphic']??0x1388;let _0x236f26=!![];if(isBoolean(_0x440710))_0x236f26=_0x440710;else{if(isNumber(_0x440710)){var _0x44c725;const _0x54f76e=JSON[_0x4831a5(_0x1039f4._0x29bdf3)](((_0x44c725=_0x4886c0[_0x4831a5(0xe9b)])===null||_0x44c725===void 0x0?void 0x0:_0x44c725['geometry'])||{})['length'];_0x236f26=_0x54f76e<_0x440710;}else isFunction(_0x440710)&&(_0x236f26=_0x440710(_0x4886c0));}if(_0x236f26){var _0x391c67;const _0x438494=_0x4ae120===null||_0x4ae120===void 0x0?void 0x0:(_0x391c67=_0x4ae120[_0x4831a5(0x433)])===null||_0x391c67===void 0x0?void 0x0:_0x391c67['highlight'],_0x453229=geoJsonToGraphics(_0x4886c0[_0x4831a5(_0x1039f4._0x57aded)],{'type':_0x438494===null||_0x438494===void 0x0?void 0x0:_0x438494['type'],'crs':_0x4886c0['crs']||(_0x4ae120===null||_0x4ae120===void 0x0?void 0x0:_0x4ae120['crs']),'style':_0x438494});_0x532857[_0x4831a5(_0x1039f4._0x384d68)]=_0x453229['length']>0x0?_0x453229[0x0]:null,_0x532857[_0x4831a5(0xf9d)]=_0x453229;}else{var _0x250bc8;logInfo('_clickTileGraphic:\x20当前数据太大,避免卡顿未进行解析,如需展示矢量对象,请在图层配置加\x20hasToGraphic:true\x20参数\x20',_0x4ae120===null||_0x4ae120===void 0x0?void 0x0:_0x4ae120['options'],(_0x250bc8=_0x4886c0['data'])===null||_0x250bc8===void 0x0?void 0x0:_0x250bc8['geometry']);}}}return _0x4ae120&&_0x4ae120[_0x4831a5(0xefc)](EventType['click'],_0x532857,![]),this[_0x4831a5(0x1d1)][_0x4831a5(0xefc)](EventType[_0x4831a5(_0x1039f4._0x4e7d9e)],_0x532857),_0x532857;}['_clickHandler'](_0x3a312c){const _0x514ac5={_0x884f2:0x759,_0x403c78:0xcb7,_0x5c4255:0x1d1,_0x1c7bfd:0x8ef},_0x35afe9=_0x3d5d32;if(!_0x3a312c||!_0x3a312c[_0x35afe9(0xb69)])return![];const _0x447daf=_0x3a312c['position'],_0x352979=this['getPickTarget'](_0x447daf,_0x3a312c);this[_0x35afe9(0x1d1)][_0x35afe9(_0x514ac5._0x884f2)](_0x352979);if(_0x352979['sourceTarget']){var _0x27decc;this['fireTargetEvent'](EventType['click'],_0x352979),this[_0x35afe9(0x1d1)]['fire'](EventType['clickGraphic'],_0x352979),(_0x27decc=_0x352979['layer'])!==null&&_0x27decc!==void 0x0&&_0x27decc[_0x35afe9(_0x514ac5._0x403c78)]&&this[_0x35afe9(0xf99)](_0x447daf,_0x352979);}else this[_0x35afe9(_0x514ac5._0x5c4255)]['fire'](EventType['click'],_0x352979),this['_map']['fire'](EventType[_0x35afe9(_0x514ac5._0x1c7bfd)],_0x352979),this['_pickImageryLayerFeatures'](_0x447daf,_0x352979);}['_mouseMoveHandler'](_0x35fae3){const _0x1b261c={_0x1e6959:0xd60,_0x2eefa9:0xefc},_0x60b2d7=_0x3d5d32;if(!_0x35fae3||!_0x35fae3['endPosition'])return![];const _0xecffb6=_0x35fae3['endPosition'],_0x27c771=this['getPickTarget'](_0xecffb6,_0x35fae3),_0x1eae87=_0x27c771[_0x60b2d7(_0x1b261c._0x1e6959)];_0x1eae87&&!_0x1eae87['noMouseMove']?this['activateMouseOver'](_0x27c771):this['activateMouseOut'](),this['_map'][_0x60b2d7(_0x1b261c._0x2eefa9)](EventType['mouseMoveTarget'],{'czmObject':_0x1eae87,..._0x35fae3,..._0x27c771});}[_0x3d5d32(0x823)](_0x25d7d0){const _0x2cb54c={_0x147026:0xa50},_0x1a2427=_0x3d5d32;if(this['_lastMouseOverItem']&&_0x25d7d0['id']&&_0x25d7d0['id']===this['_lastMouseOverItem']['id'])return;this['activateMouseOut']();if(_0x25d7d0[_0x1a2427(0x984)]&&_0x25d7d0['hasClickEvent']()){var _0x1b5aa6,_0x5c98e2;let _0x2a45b2=_0x1a2427(_0x2cb54c._0x147026);(_0x1b5aa6=_0x25d7d0['graphic'])!==null&&_0x1b5aa6!==void 0x0&&(_0x5c98e2=_0x1b5aa6['style'])!==null&&_0x5c98e2!==void 0x0&&_0x5c98e2[_0x1a2427(0x8fd)]&&(_0x2a45b2=_0x25d7d0[_0x1a2427(0x328)]['style'][_0x1a2427(0x8fd)]),this['_map']['container'][_0x1a2427(0xdde)]['cursor']=_0x2a45b2;}this[_0x1a2427(0xead)](EventType['mouseOver'],_0x25d7d0),this['_lastMouseOverItem']=_0x25d7d0;}[_0x3d5d32(0xe78)](){const _0x245b7e={_0x2e290b:0x1d1},_0x51df92=_0x3d5d32;if(this['_lastMouseOverItem']==null)return;this[_0x51df92(_0x245b7e._0x2e290b)][_0x51df92(0xf7c)](![]),this['fireTargetEvent'](EventType['mouseOut'],this['_lastMouseOverItem']),this['_lastMouseOverItem']=null;}[_0x3d5d32(0xd1e)](_0x1e378d,_0x31c897){const _0x1de072={_0x1fb48e:0xb69,_0x3b14be:0xefc},_0x13af5c=_0x3d5d32;if(!_0x1e378d||!_0x1e378d['position'])return![];const _0x389cfd=_0x1e378d[_0x13af5c(_0x1de072._0x1fb48e)],_0xbfc626=this['getPickTarget'](_0x389cfd,_0x1e378d);Array[_0x13af5c(0x62b)](_0x31c897)?_0x31c897[_0x13af5c(0x1061)](_0x335354=>{const _0x2b84c7=_0x13af5c;_0xbfc626['sourceTarget']?this[_0x2b84c7(0xead)](_0x335354,_0xbfc626):this[_0x2b84c7(0x1d1)][_0x2b84c7(0xefc)](_0x335354,_0xbfc626);}):_0xbfc626['sourceTarget']?this['fireTargetEvent'](_0x31c897,_0xbfc626):this[_0x13af5c(0x1d1)][_0x13af5c(_0x1de072._0x3b14be)](_0x31c897,_0xbfc626);}['fireTargetEvent'](_0x45108e,_0x2d717a){const _0x4b2a54={_0x458d41:0x7ea,_0x2343d9:0x1d1},_0x455380=_0x3d5d32;var _0x45b886,_0x3189ea,_0x5889a0;const _0x3d0f01=_0x2d717a['sourceTarget'][_0x45108e];_0x3d0f01&&typeof _0x3d0f01==='function'&&_0x3d0f01(_0x2d717a);(_0x45b886=_0x2d717a['czmObject'][_0x455380(_0x4b2a54._0x458d41)])===null||_0x45b886===void 0x0?void 0x0:_0x45b886['fire'](_0x45108e,_0x2d717a);if((_0x3189ea=_0x2d717a['graphic'])!==null&&_0x3189ea!==void 0x0&&_0x3189ea['fire'])_0x2d717a[_0x455380(0x328)]['fire'](_0x45108e,_0x2d717a,!![]);else(_0x5889a0=_0x2d717a['layer'])!==null&&_0x5889a0!==void 0x0&&_0x5889a0['fire']?_0x2d717a['layer']['fire'](_0x45108e,_0x2d717a,!![]):this[_0x455380(_0x4b2a54._0x2343d9)]['fire'](_0x45108e,_0x2d717a);}['destroy'](){const _0x445319={_0x58d903:0x93c},_0x23737d=_0x3d5d32;!this['_graphicLayer']&&(this['_map']['removeLayer'](this['_graphicLayer'],!![]),delete this[_0x23737d(0x32f)]),this['handler']['destroy'](),delete this['handler'],this['_map'][_0x23737d(0x60f)]['removeEventListener']('keydown',this['_onKeyDown']),this['_map']['canvas'][_0x23737d(0xd42)](_0x23737d(_0x445319._0x58d903),this[_0x23737d(0x619)]);}}new Cesium__namespace[(_0x3d5d32(0x220))]();const rayScratch=new Cesium__namespace['Ray'](),cartesian3Scratch=new Cesium__namespace['Cartesian3']();class ZoomNavigation{constructor(_0x1b9845){this['viewer']=_0x1b9845;}[_0x3d5d32(0xd3d)](_0x3e8cf4=0x2,_0x4d9a36){return _0x3e8cf4=0x1/_0x3e8cf4,this['zoom'](_0x3e8cf4,_0x4d9a36);}['zoomOut'](_0x18b3fa=0x2,_0x16efa6){return this['zoom'](_0x18b3fa,_0x16efa6);}['zoom'](_0x4c7c44,_0x309dac){const _0x497e7d={_0x33a1f4:0xb22,_0x5abd61:0xd88,_0x44c0a4:0xb84,_0x305dbf:0x98d,_0x49f77c:0x1037,_0x2ced71:0xb84,_0x1ef6d6:0xb71,_0x430fc9:0xaa8,_0x5ed3ce:0x220,_0xa35eef:0x83e,_0x266500:0xd67},_0x18bd25=_0x3d5d32,_0x26a208=this['viewer']['scene'],_0xf1bb7c=_0x26a208['screenSpaceCameraController'];if(!_0x309dac&&(!_0xf1bb7c['enableInputs']||!_0xf1bb7c['enableZoom']))return![];const _0x376f01=_0x26a208['camera'];let _0x496ef2;switch(_0x26a208[_0x18bd25(0x6e1)]){case Cesium__namespace['SceneMode']['COLUMBUS_VIEW']:case Cesium__namespace['SceneMode']['MORPHING']:case Cesium__namespace[_0x18bd25(_0x497e7d._0x33a1f4)]['SCENE2D']:{const _0x257ec4=_0x376f01[_0x18bd25(0xee4)]['height']*(0x1-_0x4c7c44);_0x376f01['zoomIn'](_0x257ec4);const _0x33d110=_0xf1bb7c['minimumZoomDistance'],_0x2860e0=_0xf1bb7c['maximumZoomDistance'],_0x5d2f02=_0x376f01['positionCartographic']['height'];if(_0x5d2f02<_0x33d110)return _0x376f01['zoomOut'](_0x257ec4),![];if(_0x5d2f02<_0xf1bb7c['_minimumCollisionTerrainHeight']){const _0x13134c=_0xf1bb7c['_scene'][_0x18bd25(_0x497e7d._0x5abd61)];if(Cesium__namespace[_0x18bd25(_0x497e7d._0x44c0a4)](_0x13134c)&&_0x5d2f02<=_0x13134c+_0x33d110)return _0x376f01['zoomOut'](_0x257ec4),![];}if(_0x2860e0&&_0x5d2f02>_0x2860e0)return _0x376f01['zoomOut'](_0x257ec4),![];return!![];}default:{let _0x5a1fcd;Cesium__namespace[_0x18bd25(_0x497e7d._0x44c0a4)](this['viewer'][_0x18bd25(_0x497e7d._0x305dbf)])?_0x5a1fcd=new Cesium__namespace['Cartesian3']():(rayScratch['origin']=_0x376f01['positionWC'],rayScratch['direction']=_0x376f01['directionWC'],_0x5a1fcd=_0x26a208[_0x18bd25(0xaa8)][_0x18bd25(_0x497e7d._0x49f77c)](rayScratch,_0x26a208,new Cesium__namespace['Cartesian3']()),Cesium__namespace[_0x18bd25(_0x497e7d._0x2ced71)](_0x5a1fcd)&&(_0x5a1fcd=_0x376f01[_0x18bd25(0xc18)](_0x5a1fcd,_0x5a1fcd)));if(!Cesium__namespace['defined'](_0x5a1fcd)){const _0x3a7ed9=new Cesium__namespace['Ray'](_0x376f01['worldToCameraCoordinatesPoint'](_0x26a208['globe']['ellipsoid']['cartographicToCartesian'](_0x376f01['positionCartographic'])),_0x376f01['directionWC']);_0x5a1fcd=Cesium__namespace[_0x18bd25(_0x497e7d._0x1ef6d6)]['grazingAltitudeLocation'](_0x3a7ed9,_0x26a208[_0x18bd25(_0x497e7d._0x430fc9)]['ellipsoid']);if(!Cesium__namespace['defined'](_0x5a1fcd))return![];_0x496ef2={'heading':_0x376f01['heading'],'pitch':_0x376f01['pitch'],'roll':_0x376f01['roll']};}else _0x496ef2={'direction':_0x376f01['direction'],'up':_0x376f01['up']};const _0x53bd07=Cesium__namespace['Cartesian3']['subtract'](_0x376f01[_0x18bd25(0xb69)],_0x5a1fcd,cartesian3Scratch),_0x4a8049=Cesium__namespace['Cartesian3']['multiplyByScalar'](_0x53bd07,_0x4c7c44,_0x53bd07),_0x2ee847=Cesium__namespace[_0x18bd25(0xe95)]['add'](_0x5a1fcd,_0x4a8049,_0x5a1fcd);if(!Cesium__namespace[_0x18bd25(0xb84)](_0x2ee847))return![];const _0x4198df=_0xf1bb7c['minimumZoomDistance'],_0x23ac08=_0xf1bb7c[_0x18bd25(0x1dc)],_0xfcb0bf=Cesium__namespace[_0x18bd25(_0x497e7d._0x5ed3ce)][_0x18bd25(0xd14)](_0x2ee847)[_0x18bd25(_0x497e7d._0xa35eef)];if(_0xfcb0bf<_0x4198df)return![];if(_0xfcb0bf<_0xf1bb7c['_minimumCollisionTerrainHeight']){const _0xa52ac5=_0xf1bb7c[_0x18bd25(0x627)]['globeHeight'];if(Cesium__namespace[_0x18bd25(0xb84)](_0xa52ac5)&&_0xfcb0bf<=_0xa52ac5+_0x4198df)return![];}if(_0x23ac08&&_0xfcb0bf>_0x23ac08)return![];return Cesium__namespace[_0x18bd25(0xb84)](this[_0x18bd25(0x4c2)]['trackedEntity'])||_0x26a208['mode']===Cesium__namespace['SceneMode']['COLUMBUS_VIEW']?_0x376f01[_0x18bd25(0xb69)]=_0x2ee847:_0x376f01[_0x18bd25(_0x497e7d._0x266500)]({'destination':_0x2ee847,'orientation':_0x496ef2,'duration':0.5,'convert':![]}),!![];}}}}class SceneOption{constructor(_0x343154){this['_map']=_0x343154,this['_viewer']=_0x343154['viewer'],this['options']={},this['_init']();}['_init'](){const _0x568d53={_0x14c627:0x809,_0x5332fc:0xd92},_0x320b77=_0x3d5d32;var _0x3e6895,_0x1cbcfc;this[_0x320b77(_0x568d53._0x14c627)][_0x320b77(0xa7d)]['creditContainer']['style'][_0x320b77(_0x568d53._0x5332fc)]='none',this[_0x320b77(_0x568d53._0x14c627)]['scene'][_0x320b77(0xccc)]['maximumZoomDistance']=0x2faf080,this['_viewer']['scene']['backgroundColor']=Cesium__namespace['Color'][_0x320b77(0x81c)];this[_0x320b77(_0x568d53._0x14c627)]['sceneModePicker']&&(this['_viewer']['sceneModePicker']['viewModel']['duration']=0x0);(_0x3e6895=this[_0x320b77(0x809)])===null||_0x3e6895===void 0x0?void 0x0:(_0x1cbcfc=_0x3e6895['homeButton'])===null||_0x1cbcfc===void 0x0?void 0x0:_0x1cbcfc['viewModel']['command']['beforeExecute']['addEventListener'](_0x42c571=>{this['_map']['flyHome'](),_0x42c571['cancel']=!![];}),this[_0x320b77(0x809)]['_cesiumWidget']['_supportsImageRenderingPixelated']=Cesium__namespace['FeatureDetection'][_0x320b77(0x5be)](),this['_viewer']['_cesiumWidget']['_forceResize']=!![];if(Cesium__namespace[_0x320b77(0xa2c)]['supportsImageRenderingPixelated']()){let _0x16539a=window['devicePixelRatio'];while(_0x16539a>=0x2){_0x16539a/=0x2;}this['_viewer']['resolutionScale']=_0x16539a;}}['setOptions'](_0x529882,_0x2cd626){const _0x31f1c7={_0x19fedf:0xde3,_0x50b484:0xebd},_0x23da3e=_0x3d5d32;return _0x529882=_0x529882||{},_0x2cd626=_0x2cd626||{},this['options']=_0x529882,this[_0x23da3e(_0x31f1c7._0x19fedf)](_0x2cd626)['_setCanvasOption'](_0x2cd626)['_setSceneOption'](_0x2cd626)[_0x23da3e(_0x31f1c7._0x50b484)](_0x2cd626)['_setCameraOption'](_0x2cd626)['_setClockOption'](_0x2cd626),this;}['_setViewerOption'](_0x3dc09b){const _0x43ee01={_0x1a5b35:0xc53,_0x13f224:0xb81,_0x413cf0:0xb81,_0x1c3f06:0xd7d,_0xb722c2:0x433,_0x4a8972:0xb81},_0xb3ad30=_0x3d5d32;if(_0x3dc09b['center'])this['_map'][_0xb3ad30(_0x43ee01._0x1a5b35)](this['options']['center'],{'duration':0x0});else _0x3dc09b['extent']&&this['_map'][_0xb3ad30(0x66e)](this['options']['extent'],{'duration':0x0});return this['_viewer']['shadows']=this['options']['shadows']??![],(this[_0xb3ad30(0x433)]['removeDblClick']??!![])&&this['_viewer']['screenSpaceEventHandler']['removeInputAction'](Cesium__namespace['ScreenSpaceEventType']['LEFT_DOUBLE_CLICK']),this['options']['resolutionScale']&&(this['_viewer']['resolutionScale']=this[_0xb3ad30(0x433)]['resolutionScale']),Cesium__namespace['defined'](this['options'][_0xb3ad30(_0x43ee01._0x13f224)])&&(isBoolean(this['options'][_0xb3ad30(_0x43ee01._0x413cf0)])?this['_viewer']['terrainShadows']=this['options'][_0xb3ad30(0xb81)]?Cesium__namespace['ShadowMode']['ENABLED']:Cesium__namespace['ShadowMode'][_0xb3ad30(_0x43ee01._0x1c3f06)]:this['_viewer']['terrainShadows']=this[_0xb3ad30(_0x43ee01._0xb722c2)][_0xb3ad30(_0x43ee01._0x4a8972)]),this;}['_setCanvasOption'](_0x14b671){const _0x11f096={_0x413a8c:0x809,_0x1ca458:0xfca},_0x1aec11=_0x3d5d32,_0x598a6c=this[_0x1aec11(_0x11f096._0x413a8c)]['canvas'];return _0x598a6c['setAttribute']('tabindex',this['options']['tabIndex']??0x0),_0x598a6c[_0x1aec11(_0x11f096._0x1ca458)]=_0x19c520=>{_0x598a6c['focus']();},this;}['_setSceneOption'](_0x10a1a8){const _0x3def0f={_0x2c938d:0xc43,_0x490949:0xa63,_0x52e3b9:0xd6e,_0x1239c1:0xf15,_0x563a8d:0x43c,_0x127acc:0xb22,_0x59473e:0x632},_0x53c025=_0x3d5d32,_0x559235=this[_0x53c025(0x809)]['scene'],_0x223525=this['options'];_0x559235[_0x53c025(0x105a)][_0x53c025(0x792)]=_0x223525[_0x53c025(0x6c5)]??!![],_0x559235['moon']['show']=_0x223525['showMoon']??!![],_0x559235['skyBox']['show']=_0x223525[_0x53c025(_0x3def0f._0x2c938d)]??!![],_0x559235['skyAtmosphere']['show']=Boolean(_0x223525['showSkyAtmosphere']??!![]),_0x559235[_0x53c025(0xe92)]['enabled']=_0x223525['fog']??!![],_0x559235['postProcessStages']['fxaa'][_0x53c025(_0x3def0f._0x490949)]=_0x223525['fxaa']??!![],_0x559235['highDynamicRange']=_0x223525['highDynamicRange']??![];_0x223525[_0x53c025(_0x3def0f._0x52e3b9)]&&(_0x559235[_0x53c025(_0x3def0f._0x52e3b9)]=Cesium__namespace['Color'][_0x53c025(_0x3def0f._0x1239c1)](_0x223525['backgroundColor']));Cesium__namespace['defined'](_0x223525['orderIndependentTranslucency'])&&(_0x559235['_useOIT']=_0x223525['orderIndependentTranslucency']);switch(_0x223525['sceneMode']){case Cesium__namespace[_0x53c025(0xb22)]['SCENE2D']:_0x559235[_0x53c025(_0x3def0f._0x563a8d)](0x0);break;case Cesium__namespace[_0x53c025(_0x3def0f._0x127acc)]['COLUMBUS_VIEW']:_0x559235[_0x53c025(_0x3def0f._0x59473e)](0x0);break;case Cesium__namespace['SceneMode']['SCENE3D']:_0x559235['morphTo3D'](0x0);break;}return this;}['_setGlobeOption'](_0x2d34c0){const _0x444a93={_0x5a4701:0x433},_0x205bfa=_0x3d5d32,_0x408145=this['_viewer']['scene']['globe'],_0x553e5f=this[_0x205bfa(_0x444a93._0x5a4701)][_0x205bfa(0xaa8)]??{};return merge(_0x408145,{..._0x553e5f,'show':_0x553e5f['show']??!![],'depthTestAgainstTerrain':_0x553e5f['depthTestAgainstTerrain']??![],'baseColor':Cesium__namespace[_0x205bfa(0x882)]['fromCssColorString'](_0x553e5f['baseColor']||'#546a53'),'showGroundAtmosphere':_0x553e5f['showGroundAtmosphere']??!![],'enableLighting':_0x553e5f['enableLighting']??![]}),this;}['_setCameraOption'](_0x8e27a2){const _0x4f2d84={_0x18cdf6:0x809,_0x182d64:0xccc,_0x18c430:0x433,_0x23fd70:0x819,_0x468610:0x5d2},_0x381807=_0x3d5d32,_0x2d9211=this[_0x381807(_0x4f2d84._0x18cdf6)]['scene'][_0x381807(_0x4f2d84._0x182d64)],_0x26dabf=this[_0x381807(_0x4f2d84._0x18c430)]['cameraController']??{};return merge(_0x2d9211,{..._0x26dabf,'_zoomFactor':_0x26dabf['zoomFactor']||0x3,'minimumZoomDistance':_0x26dabf['minimumZoomDistance']??0x1,'maximumZoomDistance':_0x26dabf[_0x381807(0x1dc)]??0x2faf080,'minimumCollisionTerrainHeight':_0x26dabf[_0x381807(_0x4f2d84._0x23fd70)]??0x3a98,'enableRotate':_0x26dabf['enableRotate']??!![],'enableTranslate':_0x26dabf['enableTranslate']??!![],'enableTilt':_0x26dabf['enableTilt']??!![],'enableZoom':_0x26dabf[_0x381807(_0x4f2d84._0x468610)]??!![],'enableCollisionDetection':_0x26dabf['enableCollisionDetection']??!![]}),_0x26dabf['constrainedAxis']===![]&&(this[_0x381807(_0x4f2d84._0x18cdf6)]['camera']['constrainedAxis']=undefined),this;}['_setClockOption'](_0x277fa4){const _0xdf2d1={_0x3c6cf9:0x809,_0x308291:0x9f4,_0x37e2ee:0xee6,_0x2f24de:0x4f8,_0xbedd46:0xef4,_0x4ad9ef:0xd39,_0x55c972:0xd39,_0x1b889f:0xe09},_0x5ddde9=_0x3d5d32,_0x58868e=this[_0x5ddde9(_0xdf2d1._0x3c6cf9)][_0x5ddde9(_0xdf2d1._0x308291)],_0x4b4624=this['options']['clock']??{};return _0x4b4624['shouldAnimate']=_0x4b4624['shouldAnimate']??this['options'][_0x5ddde9(0x4e7)]??!![],_0x58868e['shouldAnimate']=_0x4b4624['shouldAnimate'],_0x4b4624[_0x5ddde9(_0xdf2d1._0x37e2ee)]&&(_0x58868e['startTime']=this['_getJulianDate'](_0x4b4624['startTime']),_0x58868e['currentTime']=_0x58868e['startTime']),_0x4b4624['stopTime']&&(_0x58868e['stopTime']=this['_getJulianDate'](_0x4b4624['stopTime'])),_0x4b4624[_0x5ddde9(_0xdf2d1._0x2f24de)]&&(_0x58868e['currentTime']=this[_0x5ddde9(_0xdf2d1._0xbedd46)](_0x4b4624['currentTime']),!_0x4b4624['startTime']&&(_0x58868e['startTime']=_0x58868e['currentTime'][_0x5ddde9(0x315)]()),!_0x4b4624[_0x5ddde9(_0xdf2d1._0x4ad9ef)]&&(_0x58868e[_0x5ddde9(_0xdf2d1._0x55c972)]=Cesium__namespace['JulianDate']['addDays'](_0x58868e['currentTime'],0x1,new Cesium__namespace['JulianDate']()))),_0x4b4624[_0x5ddde9(_0xdf2d1._0x1b889f)]&&(_0x58868e['multiplier']=_0x4b4624['multiplier']),this;}['_getJulianDate'](_0x5774da){return isString(_0x5774da)?_0x5774da['indexOf']('Z')===-0x1?Cesium__namespace['JulianDate']['fromDate'](new Date(_0x5774da)):Cesium__namespace['JulianDate']['fromIso8601'](_0x5774da):_0x5774da;}}function initBeforeCreateDefaultValue(_0x972a6c){const _0x5e575d=_0x3d5d32;var _0xcefc1c,_0xff3526;Cesium__namespace['Ion']['defaultAccessToken']=(_0x972a6c===null||_0x972a6c===void 0x0?void 0x0:(_0xcefc1c=_0x972a6c['scene'])===null||_0xcefc1c===void 0x0?void 0x0:_0xcefc1c['ionToken'])||ion,Cesium__namespace[_0x5e575d(0x75f)]['defaultTicks']=(_0x972a6c===null||_0x972a6c===void 0x0?void 0x0:(_0xff3526=_0x972a6c['control'])===null||_0xff3526===void 0x0?void 0x0:_0xff3526['animationTicks'])||[0.1,0.25,0.5,0x1,0x2,0x5,0xa,0xf,0x1e,0x3c,0x78,0x12c,0x258,0x384,0x708,0xe10],Cesium__namespace['Camera']['DEFAULT_VIEW_RECTANGLE']=Cesium__namespace['Rectangle']['fromDegrees'](89.5,20.4,110.4,61.2),Cesium__namespace['RequestScheduler']['maximumRequests']=0x64,Cesium__namespace['RequestScheduler']['maximumRequestsPerServer']=0x14;}class PopupMgr extends BaseControl{constructor(_0x2a1ec0={}){super(_0x2a1ec0),this['_depthTest']=_0x2a1ec0['depthTest']??!![];}get['depthTest'](){return this['_depthTest'];}set['depthTest'](_0x298354){this['_depthTest']=_0x298354;}[_0x3d5d32(0xe4c)](){const _0x2cf68a={_0x3a0529:0x873},_0x4dfc1b=_0x3d5d32;this[_0x4dfc1b(_0x2cf68a._0x3a0529)]=new GraphicLayer({'private':!![]}),this['_layer'][_0x4dfc1b(0x908)]=function(){};}[_0x3d5d32(0xacd)](_0x47005e){this['_layer']['show']=_0x47005e;}['_addedHook'](){const _0x4f97d3=_0x3d5d32;this['_map'][_0x4f97d3(0xc17)](this['_layer']),this['_bindEvent']();}['_removedHook'](){const _0x4c92d2={_0x1f1e2d:0x85a},_0x3ac56a=_0x3d5d32;this[_0x3ac56a(_0x4c92d2._0x1f1e2d)](),this['_map']['removeLayer'](this[_0x3ac56a(0x873)]);}['_bindEvent'](){const _0x357e8a={_0x4f9dae:0x1d1,_0x2c4628:0x2e8},_0x135830=_0x3d5d32;this[_0x135830(_0x357e8a._0x4f9dae)]['on'](EventType[_0x135830(0xb59)],this[_0x135830(0x2e8)],this),this['_map']['on'](EventType['clickTileGraphic'],this[_0x135830(_0x357e8a._0x2c4628)],this);}[_0x3d5d32(0x85a)](){const _0x1b811f=_0x3d5d32;this['_map']['off'](EventType['click'],this['_mouseClickHandler'],this),this['_map']['off'](EventType['clickTileGraphic'],this[_0x1b811f(0x2e8)],this);}['_mouseClickHandler'](_0x169cae){const _0x1b6a7d={_0x566645:0x33b,_0x4a7a32:0x3f3,_0x55ff99:0x433},_0x36d533=_0x3d5d32;var _0x4c9082,_0x3ef852;if(!this['enabled'])return;if(this['_openByMouseEvent'](_0x169cae['czmObject'],_0x169cae))return;if(this['_openByMouseEvent'](_0x169cae[_0x36d533(0x328)],_0x169cae))return;if(this[_0x36d533(0x33b)]((_0x4c9082=_0x169cae[_0x36d533(0x328)])===null||_0x4c9082===void 0x0?void 0x0:_0x4c9082['parent'],_0x169cae))return;if(this[_0x36d533(0x33b)](_0x169cae['layer'],_0x169cae))return;if(this[_0x36d533(_0x1b6a7d._0x566645)]((_0x3ef852=_0x169cae['layer'])===null||_0x3ef852===void 0x0?void 0x0:_0x3ef852['parent'],_0x169cae))return;const _0x360313=this[_0x36d533(0x873)][_0x36d533(_0x1b6a7d._0x4a7a32)]();for(let _0x454ca2=0x0,_0x368181=_0x360313['length'];_0x454ca2<_0x368181;_0x454ca2++){const _0x5e2937=_0x360313[_0x454ca2];_0x5e2937[_0x36d533(_0x1b6a7d._0x55ff99)]['closeOnClick']!==![]&&_0x5e2937['remove'](!![]);}}['_getConfig'](_0x54668c){const _0x38290e={_0x22872e:0xf80},_0x319bb9=_0x3d5d32;return _0x54668c[_0x319bb9(_0x38290e._0x22872e)]||_0x54668c['getPopupConfig']&&_0x54668c[_0x319bb9(0xbbf)]();}[_0x3d5d32(0x33b)](_0x20232f,_0x25d3dc){const _0xb0e075=_0x3d5d32;if(!_0x20232f)return![];let _0x288739=this[_0xb0e075(0xd70)](_0x20232f);if(_0x288739===![])return!![];if(!_0x288739)return![];return _0x288739={..._0x288739,..._0x25d3dc},this['open'](_0x25d3dc['cartesian'],_0x288739),!![];}['close'](_0x4738c8,_0x83e535){const _0x1865e8={_0x237944:0x873,_0x325da0:0xbd0},_0x309b90=_0x3d5d32;if(!this[_0x309b90(_0x1865e8._0x237944)])return;if(_0x4738c8){const _0x148313=this[_0x309b90(0x873)]['getGraphics']();for(let _0x291dcd=0x0,_0x141e73=_0x148313[_0x309b90(0xc84)];_0x291dcd<_0x141e73;_0x291dcd++){var _0x5c4c54,_0xb85fc3;const _0x483b8b=_0x148313[_0x291dcd];if(_0x483b8b['options']['checkData']){var _0x403f03;_0x483b8b['options'][_0x309b90(_0x1865e8._0x325da0)]((_0x403f03=_0x483b8b[_0x309b90(0x433)])===null||_0x403f03===void 0x0?void 0x0:_0x403f03['attr'],_0x4738c8)&&_0x483b8b['remove'](!![]);}else _0x4738c8===((_0x5c4c54=_0x483b8b['options'])===null||_0x5c4c54===void 0x0?void 0x0:(_0xb85fc3=_0x5c4c54['event'])===null||_0xb85fc3===void 0x0?void 0x0:_0xb85fc3['graphic'])&&_0x483b8b['remove'](!![]);}return;}if(_0x83e535){const _0x4a75fa=this['_layer'][_0x309b90(0x3f3)]();for(let _0x580e57=0x0,_0x24a7b8=_0x4a75fa['length'];_0x580e57<_0x24a7b8;_0x580e57++){var _0x3cf43c,_0x3319b2;const _0x41fc1a=_0x4a75fa[_0x580e57];if(_0x41fc1a['options']['checkData']){var _0x2c0b59;_0x41fc1a[_0x309b90(0x433)][_0x309b90(0xbd0)]((_0x2c0b59=_0x41fc1a[_0x309b90(0x433)])===null||_0x2c0b59===void 0x0?void 0x0:_0x2c0b59['attr'],_0x83e535)&&_0x41fc1a['remove'](!![]);}else _0x83e535===((_0x3cf43c=_0x41fc1a['options'])===null||_0x3cf43c===void 0x0?void 0x0:(_0x3319b2=_0x3cf43c[_0x309b90(0x8f7)])===null||_0x3319b2===void 0x0?void 0x0:_0x3319b2[_0x309b90(0x548)])&&_0x41fc1a['remove'](!![]);}return;}const _0x249c7a=this['_layer']['getGraphics']();for(let _0x2271a7=0x0,_0x4ccdee=_0x249c7a[_0x309b90(0xc84)];_0x2271a7<_0x4ccdee;_0x2271a7++){var _0x64ceea;const _0x1b7fcd=_0x249c7a[_0x2271a7];(((_0x64ceea=_0x1b7fcd['options'])===null||_0x64ceea===void 0x0?void 0x0:_0x64ceea['autoClose'])??!![])&&_0x1b7fcd[_0x309b90(0xf06)](!![]);}}['closeAll'](){const _0x13ec8c=_0x3d5d32;this['_layer']&&this['_layer'][_0x13ec8c(0x76d)]();}['open'](_0x408ab0,_0x24adec={}){const _0x5be40f={_0x8e08ac:0x328,_0x25c7b6:0x328,_0x5a08b8:0xd2e},_0xa29d49=_0x3d5d32;var _0x3c09d1;const _0x27aadf=_0x24adec['options']||{};if((_0x27aadf===null||_0x27aadf===void 0x0?void 0x0:_0x27aadf['autoClose'])??!![])this['close']();else _0x24adec!==null&&_0x24adec!==void 0x0&&_0x24adec[_0xa29d49(_0x5be40f._0x8e08ac)]&&this['close'](_0x24adec[_0xa29d49(_0x5be40f._0x8e08ac)]);let _0x1ed4f6=_0x24adec['target'];_0x24adec['layer']&&_0x24adec['layer']['fire']&&(_0x1ed4f6=_0x24adec['layer']);_0x24adec['graphic']&&_0x24adec['graphic']['fire']&&(_0x1ed4f6=_0x24adec[_0xa29d49(_0x5be40f._0x25c7b6)]);let _0x2a929a=Cesium__namespace['HeightReference']['NONE'];if(_0x24adec[_0xa29d49(_0x5be40f._0x5a08b8)]){const _0x338542=_0x24adec['czmObject'];_0x2a929a=this[_0xa29d49(0xc22)](_0x338542,_0x2a929a);if(_0x338542['billboard']||_0x338542['point'])_0x408ab0=_0x338542['position'];else _0x338542['position']&&!(_0x338542['position']instanceof Cesium__namespace[_0xa29d49(0x6a6)])&&(_0x408ab0=_0x338542['position']);}if(_0x24adec['graphic']){if(_0x24adec['graphic']['isPoint']){var _0x5de66b,_0x3bec6d;_0x2a929a=(_0x5de66b=_0x24adec['graphic']['style'])===null||_0x5de66b===void 0x0?void 0x0:_0x5de66b[_0xa29d49(0x27d)],(_0x3bec6d=_0x24adec['graphic'][_0xa29d49(0xdde)])!==null&&_0x3bec6d!==void 0x0&&_0x3bec6d[_0xa29d49(0x7c0)]&&(_0x2a929a=Cesium__namespace['HeightReference']['CLAMP_TO_GROUND']);}_0x24adec['target']&&_0x24adec['graphic']['property']&&(_0x408ab0=_0x24adec['graphic']['_getPopupPosition']());}const _0x4fd41b={..._0x27aadf,'heightReference':_0x2a929a,'html':_0x24adec[_0xa29d49(0xfde)]},_0x2ba9c9=this['_createDivGraphic']({'depthTest':this['depthTest'],..._0x27aadf,'position':_0x408ab0,'style':_0x4fd41b,'attr':(_0x3c09d1=_0x24adec['graphic'])===null||_0x3c09d1===void 0x0?void 0x0:_0x3c09d1['attr'],'target':_0x1ed4f6,'event':_0x24adec},_0x1ed4f6);this['_layer']['addGraphic'](_0x2ba9c9);}['getPopup'](_0x2cb88a){const _0x2673c0={_0x515725:0x873},_0x54b9f6=_0x3d5d32;return this[_0x54b9f6(_0x2673c0._0x515725)]['getGraphicById'](_0x2cb88a[_0x54b9f6(0xcde)]);}['_createDivGraphic'](_0x1e509d,_0x4c5672){const _0x399fae={_0x592912:0xcde},_0x530648=_0x3d5d32,_0x5997e6=new Popup(_0x1e509d);return _0x4c5672&&(_0x4c5672[_0x530648(_0x399fae._0x592912)]=_0x5997e6['id']),_0x5997e6;}[_0x3d5d32(0xc22)](_0x3f6b13,_0x3bb069){if(!_0x3f6b13)return _0x3bb069;if(Cesium__namespace['defined'](_0x3f6b13['_heightReference']))return _0x3f6b13['_heightReference'];const _0x541074=_0x3f6b13['billboard']||_0x3f6b13['point']||_0x3f6b13['model']||_0x3f6b13['label'];if(Cesium__namespace['defined'](_0x541074===null||_0x541074===void 0x0?void 0x0:_0x541074['heightReference']))return _0x541074['heightReference']['_value'];return _0x3bb069;}}register$1(_0x3d5d32(0x1055),PopupMgr);class TooltipMgr extends PopupMgr{constructor(_0x305230={}){const _0x3fdf97={_0x4113a7:0x433},_0xb90fa8=_0x3d5d32;super(_0x305230),this[_0xb90fa8(_0x3fdf97._0x4113a7)]['cacheTime']=this['options']['cacheTime']??0x14;}['_enabledHook'](_0x61e1ee){const _0x1ed7b4={_0x68ccd1:0xacd},_0x51dcef=_0x3d5d32;super[_0x51dcef(_0x1ed7b4._0x68ccd1)](_0x61e1ee),this['moveTimer']&&!_0x61e1ee&&(clearTimeout(this['moveTimer']),delete this['moveTimer']);}['_bindEvent'](){const _0x2461c8=_0x3d5d32;this['_map']['on'](EventType['mouseMoveTarget'],this['_mouseMoveHandler'],this),this['_map']['on'](EventType['mouseDown'],this['_mouseDownHandler'],this),this['_map']['on'](EventType['mouseUp'],this[_0x2461c8(0x3e2)],this);}['_unbindEvent'](){const _0x11746d={_0x8f81ba:0x2f7,_0x50e946:0xad5,_0xe072bf:0x1d1,_0x47285c:0x9e7,_0x423c3d:0x2f9},_0x563450=_0x3d5d32;this[_0x563450(0x1d1)]['off'](EventType[_0x563450(_0x11746d._0x8f81ba)],this[_0x563450(_0x11746d._0x50e946)],this),this[_0x563450(0x1d1)]['off'](EventType['mouseDown'],this[_0x563450(0x7b2)],this),this[_0x563450(_0x11746d._0xe072bf)][_0x563450(_0x11746d._0x47285c)](EventType[_0x563450(_0x11746d._0x423c3d)],this['_mouseUpHandler'],this);}['_mouseDownHandler'](_0x10b519){const _0x226201={_0x40324e:0x447},_0x228a6a=_0x3d5d32;if(!this[_0x228a6a(0xa63)])return;this['_isMouseUpdownPressed']=!![],this[_0x228a6a(_0x226201._0x40324e)]();}[_0x3d5d32(0x3e2)](_0x1619ba){if(!this['enabled'])return;this['_isMouseUpdownPressed']=![];}['_mouseMoveHandler'](_0x2b1336){const _0xfe33e2={_0xcfd578:0xa63,_0xa1d33b:0x86e,_0x2fa8b7:0x447},_0x21c8e8=_0x3d5d32;if(!this[_0x21c8e8(_0xfe33e2._0xcfd578)])return;this['moveTimer']&&(clearTimeout(this['moveTimer']),delete this['moveTimer']);if(this['_isMouseUpdownPressed']||!this[_0x21c8e8(_0xfe33e2._0xa1d33b)]){this[_0x21c8e8(_0xfe33e2._0x2fa8b7)]();return;}this['moveTimer']=setTimeout(()=>{delete this['moveTimer'],this['_mouseClickHandler'](_0x2b1336);},this['options']['cacheTime']);}['_getConfig'](_0x300f77){const _0x51fa11={_0x43e0ed:0xb8b},_0x336dd2=_0x3d5d32;return _0x300f77['_tooltipConfig']||_0x300f77['getTooltipConfig']&&_0x300f77[_0x336dd2(_0x51fa11._0x43e0ed)]();}[_0x3d5d32(0x101e)](_0x4b23a5,_0x56f922){const _0x49ef93=new Tooltip(_0x4b23a5);return _0x56f922&&(_0x56f922['_tooltipId']=_0x49ef93['id']),_0x49ef93;}['getTooltip'](_0x366859){return this['_layer']['getGraphicById'](_0x366859['_tooltipId']);}}register$1('tooltip',TooltipMgr);class SmallTooltip extends BaseControl{get['direction'](){const _0x188eef={_0x563c2e:0x433},_0x32daa3=_0x3d5d32;return this[_0x32daa3(_0x188eef._0x563c2e)]['direction'];}set['direction'](_0x248027){const _0x2f750f={_0x19b1c1:0x452,_0x4be465:0x452},_0x1b3f60=_0x3d5d32;this['options']['direction']=_0x248027,_0x248027?(addClass(this[_0x1b3f60(_0x2f750f._0x19b1c1)],'mars3d-smallTooltip-leftArrow'),removeClass(this[_0x1b3f60(_0x2f750f._0x4be465)],_0x1b3f60(0x56f))):(addClass(this[_0x1b3f60(0x452)],'mars3d-smallTooltip-rightArrow'),removeClass(this['_containerArrow'],'mars3d-smallTooltip-leftArrow'));}['_enabledHook'](_0x917416){this['show']=_0x917416;}['_mountedHook'](){const _0xe59b3d={_0x1cbaa6:0x51f,_0x453b83:0x667,_0x201a29:0xf2d,_0x1e1aa9:0x51f},_0x264aed={_0x25ac27:0x447},_0x3fb951=_0x3d5d32;this['_container']=create$3('div','mars3d-smallTooltip'),this['_container']['style']['display']='none',this['_containerArrow']=create$3('div','mars3d-smallTooltip-arrow\x20mars3d-smallTooltip-rightArrow',this[_0x3fb951(_0xe59b3d._0x1cbaa6)]),this['_containerContent']=create$3(_0x3fb951(_0xe59b3d._0x453b83),_0x3fb951(_0xe59b3d._0x201a29),this[_0x3fb951(_0xe59b3d._0x1e1aa9)]),this[_0x3fb951(_0xe59b3d._0x1e1aa9)]['addEventListener']('click',_0xbb255c=>{const _0x3285da=_0x3fb951;this[_0x3285da(_0x264aed._0x25ac27)]();});}['close'](){const _0x473b8b={_0x4df49b:0x51f,_0x4c78c1:0xdde,_0x34c2bc:0x72e},_0x322f34=_0x3d5d32;this[_0x322f34(_0x473b8b._0x4df49b)]&&(this['_container'][_0x322f34(_0x473b8b._0x4c78c1)]['display']=_0x322f34(_0x473b8b._0x34c2bc));}[_0x3d5d32(0x7b0)](_0x484c6c,_0xe08f84){const _0x14b5c7={_0x5d08bd:0x1d1,_0x75746b:0x51f,_0x281549:0xdde,_0x53f4ff:0x6f6,_0x1cbc67:0x474,_0x5e1a0a:0x433},_0x22e711=_0x3d5d32;if(!this['enabled'])return;_0xe08f84&&(this['_containerContent'][_0x22e711(0xae5)]=_0xe08f84),_0x484c6c?(_0x484c6c instanceof Cesium__namespace['Cartesian3']&&(_0x484c6c=Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](this[_0x22e711(_0x14b5c7._0x5d08bd)]['scene'],_0x484c6c)),this[_0x22e711(_0x14b5c7._0x75746b)][_0x22e711(_0x14b5c7._0x281549)]['display']=_0x22e711(_0x14b5c7._0x53f4ff),this['_container'][_0x22e711(0xdde)][_0x22e711(_0x14b5c7._0x1cbc67)]=_0x484c6c['y']-this[_0x22e711(0x51f)]['clientHeight']/0x2+'px',this[_0x22e711(_0x14b5c7._0x5e1a0a)][_0x22e711(0xe36)]?this['_container'][_0x22e711(_0x14b5c7._0x281549)]['left']=_0x484c6c['x']-this['_container']['clientWidth']-0x19+'px':this['_container']['style']['left']=_0x484c6c['x']+0x19+'px'):this[_0x22e711(0x51f)]['style']['display']='none';}}register$1(_0x3d5d32(0x6ea),SmallTooltip);class ContextMenu extends BaseControl{constructor(_0x59ea0b={}){super(_0x59ea0b),this['_menuIndex']=0x0,this['_menuObj']={};}get['target'](){return this['_target'];}[_0x3d5d32(0xacd)](){this['_target']=null;}['_mountedHook'](){const _0x28f684={_0x38d390:0xaa3,_0x1c030f:0x6c2,_0x2cc66a:0x667},_0x412ff8=_0x3d5d32;Cesium__namespace[_0x412ff8(0x501)](this['options'][_0x412ff8(_0x28f684._0x38d390)],!![])&&(this['_map'][_0x412ff8(_0x28f684._0x1c030f)]['oncontextmenu']=function(_0x264116){_0x264116['preventDefault']();}),this['_container']=create$3(_0x412ff8(_0x28f684._0x2cc66a),'mars3d-contextmenu'),this[_0x412ff8(0x51f)]['style']['display']='none',this['_containerUl']=create$3('ul','mars3d-contextmenu-ul',this['_container']),this[_0x412ff8(0x937)]['id']=this['parentContainerId']+'-mars3d-contextmenu-ul';}['_addedHook'](){const _0x200dce={_0x1a7f17:0x572,_0x59ddb4:0xa26},_0x2ee0a2=_0x3d5d32;this['_map']['on'](EventType[_0x2ee0a2(0x91b)],this[_0x2ee0a2(0xa26)],this),this['_map']['on'](EventType[_0x2ee0a2(_0x200dce._0x1a7f17)],this[_0x2ee0a2(_0x200dce._0x59ddb4)],this),this[_0x2ee0a2(0x1d1)]['on'](EventType['wheel'],this['_downHandler'],this),this['_map']['on'](EventType['rightClick'],this['_rightClickHandler'],this);}[_0x3d5d32(0x566)](){const _0x5c5dc5={_0x5dc5a4:0xa26},_0x52c28a=_0x3d5d32;this['_map']['off'](EventType[_0x52c28a(0x91b)],this['_downHandler'],this),this['_map'][_0x52c28a(0x9e7)](EventType['middleDown'],this[_0x52c28a(_0x5c5dc5._0x5dc5a4)],this),this['_map']['off'](EventType['wheel'],this['_downHandler'],this),this['_map']['off'](EventType['rightClick'],this['_rightClickHandler'],this),this['_target']=null,this['_eventResult']=null;}[_0x3d5d32(0xa26)](_0x1d6ca4){this['close']();}[_0x3d5d32(0xe3c)](_0x4e9b4e){const _0x1c267f={_0x5c356d:0x548,_0x3aa4f4:0x548},_0x2f37dc=_0x3d5d32;var _0x36897f,_0x1f4bf0;this['close']();if(!this['enabled'])return;if(this[_0x2f37dc(0xf85)](_0x4e9b4e['czmObject'],_0x4e9b4e))return;if(this[_0x2f37dc(0xf85)](_0x4e9b4e['graphic'],_0x4e9b4e))return;if(this['_openByClick']((_0x36897f=_0x4e9b4e['graphic'])===null||_0x36897f===void 0x0?void 0x0:_0x36897f[_0x2f37dc(0xd00)],_0x4e9b4e))return;if(this[_0x2f37dc(0xf85)](_0x4e9b4e[_0x2f37dc(_0x1c267f._0x5c356d)],_0x4e9b4e))return;if(this[_0x2f37dc(0xf85)]((_0x1f4bf0=_0x4e9b4e[_0x2f37dc(_0x1c267f._0x3aa4f4)])===null||_0x1f4bf0===void 0x0?void 0x0:_0x1f4bf0['parent'],_0x4e9b4e))return;this[_0x2f37dc(0xf85)](this['_map'],_0x4e9b4e);}[_0x3d5d32(0xf85)](_0x39bdee,_0x1d8a40){const _0x3cd1b2={_0x12f532:0xab5,_0x3384fc:0x7b0,_0x4650aa:0x4c1},_0x1451e8=_0x3d5d32;if(!_0x39bdee)return![];let _0x29bcd7=_0x39bdee[_0x1451e8(_0x3cd1b2._0x12f532)]||_0x39bdee['getContextMenu']&&_0x39bdee['getContextMenu']();if(_0x29bcd7===![])return!![];if(!_0x29bcd7)return![];return _0x29bcd7={..._0x29bcd7,..._0x1d8a40},this[_0x1451e8(_0x3cd1b2._0x3384fc)](_0x1d8a40[_0x1451e8(_0x3cd1b2._0x4650aa)],_0x29bcd7),!![];}['close'](_0x4047fb,_0x170b67){const _0x46da0a={_0x283c5e:0x792,_0x538994:0xefc},_0x1bbb72=_0x3d5d32;var _0xc611cf,_0x34cf24,_0x16a163;if(this['_show']===![])return;if(_0x4047fb&&_0x4047fb!==((_0xc611cf=this[_0x1bbb72(0x4d0)])===null||_0xc611cf===void 0x0?void 0x0:_0xc611cf['graphic']))return;if(_0x170b67&&_0x170b67!==((_0x34cf24=this['_eventResult'])===null||_0x34cf24===void 0x0?void 0x0:_0x34cf24['layer']))return;this[_0x1bbb72(_0x46da0a._0x283c5e)]=![],(_0x16a163=this['target'])!==null&&_0x16a163!==void 0x0&&_0x16a163[_0x1bbb72(_0x46da0a._0x538994)]?this['target']['fire'](EventType['contextMenuClose'],{},!![]):this['_map']['fire'](EventType['contextMenuClose']);}['open'](_0x449946,_0x227dc4={}){const _0xa18eda={_0x54ccc0:0xc84,_0x53eeda:0x447,_0x23adb0:0x548,_0x544617:0x328,_0x23aead:0x328,_0x1425cf:0x4d0,_0x3f9735:0x2eb,_0x3b1337:0xd32,_0x9f6dd3:0x8ca,_0x27905e:0x51f,_0x3ed9fb:0xdde,_0x1f9802:0x423,_0xd1cb54:0x60f,_0x2713c2:0xdde,_0xbebda7:0xfb5,_0xe97a8b:0x6ae},_0x4ccd29={_0x5f452a:0xdde},_0x402ed6={_0x12e960:0x8cb},_0x4b4877=_0x3d5d32;var _0xb69672;const _0x46632d=_0x227dc4['options']||{},_0x568d39=_0x227dc4['content'];if(!_0x568d39||_0x568d39[_0x4b4877(_0xa18eda._0x54ccc0)]===0x0){this[_0x4b4877(_0xa18eda._0x53eeda)]();return;}const _0x274bed=_0x227dc4['windowPosition']||Cesium__namespace['SceneTransforms']['wgs84ToWindowCoordinates'](this['_map']['scene'],_0x449946),_0x35c237={..._0x227dc4,'windowPosition':_0x274bed,'position':_0x449946};_0x227dc4['layer']&&_0x227dc4['layer']['fire']&&(_0x35c237['target']=_0x227dc4[_0x4b4877(_0xa18eda._0x23adb0)]);if(_0x227dc4[_0x4b4877(_0xa18eda._0x544617)]&&_0x227dc4[_0x4b4877(_0xa18eda._0x544617)]['fire']){_0x35c237[_0x4b4877(0x2eb)]=_0x227dc4[_0x4b4877(_0xa18eda._0x23aead)];const _0x12b4b2=_0x227dc4['graphic']['parent'];_0x12b4b2&&_0x12b4b2['fire']&&(_0x35c237['graphic_parent']=_0x12b4b2);}this[_0x4b4877(_0xa18eda._0x1425cf)]=_0x35c237;let _0x2d35d3='';for(let _0x211599=0x0,_0x3e39e3=_0x568d39['length'];_0x211599<_0x3e39e3;_0x211599++){const _0x3be821=_0x568d39[_0x211599],_0x52fb7a=this['_getItemHtml'](_0x3be821,_0x35c237);_0x52fb7a&&(_0x2d35d3+=_0x52fb7a);}if(_0x2d35d3===''){this['close']();return;}this[_0x4b4877(0x937)]['innerHTML']=_0x2d35d3;const _0xbf9506=this[_0x4b4877(0x937)]['querySelectorAll']('.contextmenu-item'),_0x4fde76=this;for(let _0x438134=0x0;_0x438134<_0xbf9506['length'];_0x438134++){const _0x565e19=_0xbf9506[_0x438134];_0x565e19['addEventListener']('click',function(_0x48f501){const _0x7d71a=_0x4b4877;var _0x112349;_0x48f501['stopPropagation']&&_0x48f501['stopPropagation']();const _0x4ea4e8=Number(this['getAttribute']('data-index')),_0x39128e=_0x4fde76['_menuObj'][_0x4ea4e8],_0x5ca323={..._0x35c237,'data':_0x39128e},_0x57d185=_0x39128e['callback'];if(_0x57d185){if(isFunction(_0x57d185))_0x57d185(_0x5ca323);else isString(_0x57d185)&&(window[_0x7d71a(0x4b3)]=_0x5ca323,eval(_0x57d185+'(window._contextmenuItemClickResult)'),delete window[_0x7d71a(0x4b3)]);}(_0x112349=_0x4fde76['target'])!==null&&_0x112349!==void 0x0&&_0x112349[_0x7d71a(0xefc)]?_0x4fde76['target']['fire'](EventType['contextMenuClick'],_0x5ca323,!![]):_0x4fde76['_map']['fire'](EventType['contextMenuClick'],_0x5ca323);const _0x502da5=Number(this['getAttribute'](_0x7d71a(_0x402ed6._0x12e960))||0x0);_0x502da5===0x0&&_0x4fde76['close']();}),_0x565e19['addEventListener']('mouseover',function(_0x45e67f){const _0x52727a=_0x4b4877,_0x23134e=_0x4fde76['_container']['querySelectorAll']('.mars3d-sub-menu');for(let _0x4e26c1=0x0;_0x4e26c1<_0x23134e['length'];_0x4e26c1++){_0x23134e[_0x4e26c1][_0x52727a(_0x4ccd29._0x5f452a)]['display']='none';}const _0x20e909=this['querySelector'](_0x52727a(0xe01));_0x20e909&&(_0x20e909[_0x52727a(0xdde)]['display']='block'),removeClass(_0x4fde76['_containerUl']['querySelector'](_0x52727a(0x453)),'active'),addClass(this,'active');});}this['show']=!![],this['_target']=_0x35c237[_0x4b4877(_0xa18eda._0x3f9735)];let _0x2a27cb=_0x274bed['y'],_0x1e75ec=_0x274bed['x'];_0x46632d[_0x4b4877(0x72a)]?(_0x1e75ec+=_0x46632d['anchor'][0x0],_0x2a27cb+=_0x46632d['anchor'][0x1]):(_0x46632d['offsetX']&&(_0x1e75ec+=_0x46632d[_0x4b4877(_0xa18eda._0x3b1337)]),_0x46632d['offsetY']&&(_0x2a27cb+=_0x46632d['offsetY']));const _0x3a7c7f=this['_container']['offsetHeight'],_0x17d23c=this['_container'][_0x4b4877(_0xa18eda._0x9f6dd3)];_0x2a27cb+_0x3a7c7f>this['_map']['scene']['canvas']['clientHeight']?(_0x2a27cb-=_0x3a7c7f-0xa,_0x2a27cb<=0x0&&(_0x2a27cb=0x0)):_0x2a27cb+=0xa;let _0x4ccfb6=!![];_0x1e75ec+_0x17d23c>this['_map']['scene']['canvas']['clientWidth']?(_0x1e75ec-=_0x17d23c-0xa,_0x4ccfb6=![],_0x1e75ec<=0x0&&(_0x1e75ec=0x0)):_0x1e75ec+=0xa;this[_0x4b4877(_0xa18eda._0x27905e)]['style']['left']=_0x1e75ec+'px',this['_container']['style']['top']=_0x2a27cb+'px';const _0x76d97a=this['_containerUl']['querySelectorAll']('.mars3d-sub-menu');for(let _0x1814b5=0x0;_0x1814b5<_0x76d97a[_0x4b4877(0xc84)];_0x1814b5++){const _0x5951ad=_0x76d97a[_0x1814b5],_0x542c57=Number(_0x5951ad['getAttribute']('data-count')||0x1)*0x22;let _0xf0a75e=_0x2a27cb+_0x5951ad['parentElement']['offsetTop'];_0x5951ad['style']['top']='0',_0x5951ad[_0x4b4877(_0xa18eda._0x3ed9fb)][_0x4b4877(0x960)]=_0x4b4877(_0xa18eda._0x1f9802),_0xf0a75e+_0x542c57>this['_map']['scene'][_0x4b4877(_0xa18eda._0xd1cb54)]['clientHeight']&&(_0xf0a75e-=_0x542c57,_0xf0a75e>0x0&&(_0x5951ad[_0x4b4877(_0xa18eda._0x2713c2)]['top']=_0x4b4877(0x423),_0x5951ad['style']['bottom']='0')),_0x4ccfb6?_0x5951ad['style'][_0x4b4877(_0xa18eda._0xbebda7)]=_0x17d23c+0xa+'px':_0x5951ad[_0x4b4877(0xdde)]['right']=_0x17d23c+0xa+'px';}(_0xb69672=_0x35c237['target'])!==null&&_0xb69672!==void 0x0&&_0xb69672['fire']?_0x35c237['target']['fire'](EventType[_0x4b4877(0x6ae)],{},!![]):this['_map'][_0x4b4877(0xefc)](EventType[_0x4b4877(_0xa18eda._0xe97a8b)]);}['_getItemHtml'](_0x2e9333,_0x514c36){const _0x2361b3={_0x1c46be:0x792,_0x42b9a8:0x52d,_0x1e93e2:0x76b,_0x92c730:0xc84},_0x4120ff=_0x3d5d32;if(_0x2e9333['hasOwnProperty']('show')){let _0x328bdd=_0x2e9333['show'];try{_0x514c36['data']=_0x2e9333;if(isFunction(_0x328bdd))_0x328bdd=_0x2e9333[_0x4120ff(_0x2361b3._0x1c46be)](_0x514c36);else isString(_0x328bdd)&&(window['_contextmenuItemClickShowResult']=_0x514c36,_0x328bdd=eval(_0x328bdd+'(window._contextmenuItemClickShowResult)'),delete window['_contextmenuItemClickShowResult']);}catch(_0x5406f1){logError$1(_0x4120ff(_0x2361b3._0x42b9a8),_0x5406f1);}if(!_0x328bdd)return;}let _0x23e635;if(_0x2e9333[_0x4120ff(_0x2361b3._0x1e93e2)]){let _0x3ad02a='',_0x192cdd='',_0x3a6fc3=0x0;if(_0x2e9333['children']){for(let _0x9ed2f3=0x0,_0x867869=_0x2e9333['children'][_0x4120ff(_0x2361b3._0x92c730)];_0x9ed2f3<_0x867869;_0x9ed2f3++){const _0x1f2642=_0x2e9333['children'][_0x9ed2f3];_0x514c36['data']=_0x1f2642;const _0x55d924=this['_getItemHtml'](_0x1f2642,_0x514c36);_0x55d924&&(_0x3ad02a+=_0x55d924,_0x3a6fc3++);}if(_0x3a6fc3===0x0)return;_0x3ad02a=_0x4120ff(0xb47)+_0x3a6fc3+'\x22>'+_0x3ad02a+'',_0x192cdd=_0x4120ff(0x995);}this['_menuIndex']++,this['_menuObj'][this['_menuIndex']]=_0x2e9333;const _0x27b6fb=this['_createIcon'](_0x2e9333['icon']||_0x2e9333['iconCls'],null,'contextmenu-icon');_0x23e635='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x27b6fb+_0x2e9333['text']+_0x192cdd+_0x4120ff(0xcc2)+_0x3ad02a+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';}else _0x23e635='';return _0x23e635;}}register$1('contextMenu',ContextMenu);class KeyboardRoam extends BaseControl{constructor(_0x3eeb77={}){const _0x24e104=_0x3d5d32;super(_0x3eeb77),this['setOptions'](_0x3eeb77),this[_0x24e104(0x906)]={'moveForward':![],'moveBackward':![],'moveUp':![],'moveDown':![],'moveLeft':![],'moveRight':![]};}get[_0x3d5d32(0xd10)](){return this['_moveStep'];}set['moveStep'](_0x1d0e1e){this['_moveStep']=_0x1d0e1e;}get['dirStep'](){const _0x45da4a={_0x222caa:0xde9},_0x408730=_0x3d5d32;return this[_0x408730(_0x45da4a._0x222caa)];}set[_0x3d5d32(0xca0)](_0x5ee76c){const _0xd0e4bb={_0xfe233b:0xde9},_0x30e550=_0x3d5d32;this[_0x30e550(_0xd0e4bb._0xfe233b)]=_0x5ee76c;}get['rotateStep'](){const _0xe9dd64=_0x3d5d32;return this[_0xe9dd64(0x98a)];}set[_0x3d5d32(0x2bd)](_0x218d45){this['_rotateStep']=_0x218d45;}get['minPitch'](){return this['_minPitch'];}set[_0x3d5d32(0xad0)](_0x1fa5a9){this['_minPitch']=_0x1fa5a9;}get['maxPitch'](){const _0x2b21={_0x5c55d7:0xa78},_0x517c91=_0x3d5d32;return this[_0x517c91(_0x2b21._0x5c55d7)];}set['maxPitch'](_0x22dc1f){this['_maxPitch']=_0x22dc1f;}get['minHeight'](){return this['_minHeight'];}set['minHeight'](_0x3adc50){this['_minHeight']=_0x3adc50;}[_0x3d5d32(0x945)](_0x261457){const _0x38d94f={_0x36edb4:0x433,_0x18a78b:0xde9,_0x5c7b34:0xca0,_0x3fcac5:0x2bd},_0x45e644=_0x3d5d32;return this['options']={...this[_0x45e644(_0x38d94f._0x36edb4)],..._0x261457},this[_0x45e644(0xf17)]=this['options']['moveStep']??0xa,this[_0x45e644(_0x38d94f._0x18a78b)]=this['options'][_0x45e644(_0x38d94f._0x5c7b34)]??0x19,this['_rotateStep']=this[_0x45e644(_0x38d94f._0x36edb4)][_0x45e644(_0x38d94f._0x3fcac5)]??0x1,this[_0x45e644(0xb11)]=this['options']['minPitch']??0.1,this['_maxPitch']=this['options']['maxPitch']??0.95,this['_minHeight']=this[_0x45e644(0x433)]['minHeight']??0x0,this;}['_addedHook'](){const _0x504fcd={_0x3d9c38:0x6df,_0x139d4c:0xd7b},_0x6068e1=_0x3d5d32;this['_map']['on'](EventType[_0x6068e1(0x8c6)],this['_onKeyDown'],this),this['_map']['on'](EventType['keyup'],this['_onKeyUp'],this),this[_0x6068e1(0x1d1)]['on'](EventType[_0x6068e1(_0x504fcd._0x3d9c38)],this[_0x6068e1(_0x504fcd._0x139d4c)],this);}['_removedHook'](){const _0x4bad1e={_0x522d62:0x1d1,_0x3f0bcb:0x9e7},_0x4cf59f=_0x3d5d32;this[_0x4cf59f(_0x4bad1e._0x522d62)][_0x4cf59f(0x9e7)](EventType['keydown'],this['_onKeyDown'],this),this['_map'][_0x4cf59f(_0x4bad1e._0x3f0bcb)](EventType['keyup'],this['_onKeyUp'],this),this['_map']['off'](EventType['clockTick'],this['_onClockTick'],this);}[_0x3d5d32(0xfc7)](_0x28ca6d){const _0x349b5d={_0xc52961:0x404},_0x120171=_0x3d5d32;if(!this['enabled'])return;const _0x1184aa=this['_getFlagForKeyCode'](_0x28ca6d[_0x120171(_0x349b5d._0xc52961)]);typeof _0x1184aa!=='undefined'&&(this['flags'][_0x1184aa]=!![]);}['_onKeyUp'](_0x5301e2){const _0x26d46e={_0x21de21:0xfbf},_0x1e56fa=_0x3d5d32;if(!this['enabled'])return;const _0x4736f4=this[_0x1e56fa(_0x26d46e._0x21de21)](_0x5301e2['keyCode']);typeof _0x4736f4!==_0x1e56fa(0x23c)&&(this['flags'][_0x4736f4]=![]);}[_0x3d5d32(0xfbf)](_0x47839b){const _0x235a06={_0x408eaa:0x3ee,_0xf8beed:0xe7c,_0x48b3db:0x7e9,_0x3fbfbc:0xc8d,_0x174569:0xc99},_0x437409=_0x3d5d32;switch(_0x47839b){case'W'['charCodeAt'](0x0):return'moveForward';case'S'['charCodeAt'](0x0):return'moveBackward';case'D'['charCodeAt'](0x0):return'moveRight';case'A'[_0x437409(0xc99)](0x0):return _0x437409(0xc85);case'Q'['charCodeAt'](0x0):return _0x437409(_0x235a06._0x408eaa);case'E'['charCodeAt'](0x0):return _0x437409(_0x235a06._0xf8beed);case 0x26:this['rotateCamera'](MoveType[_0x437409(_0x235a06._0x48b3db)]);break;case 0x25:this['rotateCamera'](MoveType[_0x437409(_0x235a06._0x3fbfbc)]);break;case 0x27:this['rotateCamera'](MoveType[_0x437409(0x68f)]);break;case 0x28:this['rotateCamera'](MoveType['BOTTOM_ROTATE']);break;case'I'[_0x437409(0xc99)](0x0):case 0x68:this['moveCamera'](MoveType[_0x437409(0x964)]);break;case'K'[_0x437409(0xc99)](0x0):case 0x65:this['moveCamera'](MoveType[_0x437409(0x27a)]);break;case'J'['charCodeAt'](0x0):case 0x64:this['moveCamera'](MoveType['LEFT_ROTATE']);break;case'L'[_0x437409(0xc99)](0x0):case 0x66:this['moveCamera'](MoveType['RIGHT_ROTATE']);break;case'U'[_0x437409(_0x235a06._0x174569)](0x0):case 0x67:this['moveCamera'](MoveType['TOP_ROTATE']);break;case'O'['charCodeAt'](0x0):case 0x69:this[_0x437409(0x6ca)](MoveType['BOTTOM_ROTATE']);break;}return undefined;}['startMoveForward'](){this['flags']['moveForward']=!![];}[_0x3d5d32(0x3b3)](){const _0x25a20a=_0x3d5d32;this['flags'][_0x25a20a(0x1054)]=![];}['startMoveBackward'](){this['flags']['moveBackward']=!![];}[_0x3d5d32(0x900)](){this['flags']['moveBackward']=![];}[_0x3d5d32(0xffa)](){const _0x11fd2d=_0x3d5d32;this[_0x11fd2d(0x906)]['moveRight']=!![];}[_0x3d5d32(0xe79)](){this['flags']['moveRight']=![];}[_0x3d5d32(0xb46)](){const _0xdfd343={_0x260022:0xc85},_0x5006ce=_0x3d5d32;this['flags'][_0x5006ce(_0xdfd343._0x260022)]=!![];}['stopMoveLeft'](){this['flags']['moveLeft']=![];}['moveForward'](_0x9eb6b0){const _0x37207f={_0x273514:0x1d1,_0x5ba6a1:0xe95,_0x48a2b5:0xff3},_0xf7361a=_0x3d5d32,_0x2f94d9=this[_0xf7361a(_0x37207f._0x273514)]['camera'];let _0x1a509e=_0x2f94d9['direction'];const _0x2159b8=Cesium__namespace['Cartesian3']['normalize'](_0x2f94d9['position'],new Cesium__namespace['Cartesian3']()),_0x95dc77=Cesium__namespace['Cartesian3'][_0xf7361a(0x24c)](_0x1a509e,_0x2159b8,new Cesium__namespace[(_0xf7361a(0xe95))]());_0x1a509e=Cesium__namespace[_0xf7361a(0xe95)]['cross'](_0x2159b8,_0x95dc77,new Cesium__namespace['Cartesian3']()),_0x1a509e=Cesium__namespace[_0xf7361a(_0x37207f._0x5ba6a1)]['normalize'](_0x1a509e,_0x1a509e),_0x1a509e=Cesium__namespace['Cartesian3'][_0xf7361a(0xadd)](_0x1a509e,_0x9eb6b0,_0x1a509e),_0x2f94d9['position']=Cesium__namespace['Cartesian3'][_0xf7361a(_0x37207f._0x48a2b5)](_0x2f94d9['position'],_0x1a509e,_0x2f94d9['position']);}['_onClockTick'](_0x347c3d){const _0x13dc48={_0x57d5dc:0xd10,_0x4ba31c:0x906},_0x4b6c7a=_0x3d5d32;if(!this['enabled'])return;const _0x3e923e=this['_map']['camera'],_0x3e8804=this[_0x4b6c7a(_0x13dc48._0x57d5dc)];this['flags'][_0x4b6c7a(0x1054)]&&this[_0x4b6c7a(0x1054)](_0x3e8804),this['flags'][_0x4b6c7a(0x74e)]&&this['moveForward'](-_0x3e8804),this['flags']['moveUp']&&_0x3e923e['moveUp'](_0x3e8804),this['flags']['moveDown']&&(_0x3e923e['positionCartographic']['height']-_0x3e8804>=this['minHeight']&&_0x3e923e['moveDown'](_0x3e8804)),this[_0x4b6c7a(_0x13dc48._0x4ba31c)]['moveLeft']&&_0x3e923e['moveLeft'](_0x3e8804),this['flags']['moveRight']&&_0x3e923e['moveRight'](_0x3e8804);}['_resetCamera'](_0x565e30){const _0x249945={_0x334c60:0x1d1,_0x148358:0xe36,_0x4a6090:0x1d1,_0x960639:0xfc1},_0x2c0382=_0x3d5d32;if(!_0x565e30)return;this[_0x2c0382(_0x249945._0x334c60)]['scene']['camera'][_0x2c0382(0xb69)]=_0x565e30[_0x2c0382(0xb69)],this['_map']['scene']['camera']['direction']=_0x565e30[_0x2c0382(_0x249945._0x148358)],this['_map']['scene'][_0x2c0382(0x435)]['right']=_0x565e30['right'],this[_0x2c0382(_0x249945._0x4a6090)][_0x2c0382(_0x249945._0x960639)]['camera']['up']=_0x565e30['up'];}['_limitAngle'](_0x2a8bfc,_0x1e3e0b,_0x34cbf9){const _0x30ade2={_0x3fcdc3:0xf69,_0x3a3be4:0xe95,_0x4b64f8:0xb93},_0x595496=_0x3d5d32,_0x380388=Cesium__namespace['Cartesian3']['dot'](_0x2a8bfc,Cesium__namespace[_0x595496(0xe95)][_0x595496(_0x30ade2._0x3fcdc3)](_0x1e3e0b,new Cesium__namespace[(_0x595496(_0x30ade2._0x3a3be4))]()));if(_0x34cbf9==='up'&&_0x380388this[_0x595496(_0x30ade2._0x4b64f8)])return![];return!![];}['_computedNewPos'](_0x270ac0,_0x48e0e1,_0x3ecaf3){const _0x101a73={_0x5bba02:0xe36,_0x443d56:0xe95,_0x9e4e64:0xb69,_0x5c42b9:0xe95},_0x21b96e=_0x3d5d32,_0x938e60=_0x270ac0[_0x21b96e(0xb69)],_0x2bc4d4=this['_map']['getCenter']();if(!_0x2bc4d4)return;const _0x4fb83e=_0x2bc4d4['toCartesian']();if(!_0x4fb83e)return;const _0x505981=Cesium__namespace['Cartesian3']['distance'](_0x4fb83e,_0x938e60);let _0x5b0bd0=_0x505981/0x64;_0x5b0bd0=_0x3ecaf3?_0x5b0bd0*this['rotateStep']:_0x5b0bd0;const _0x263c28={};let _0x6b8579=new Cesium__namespace['Ray'](_0x938e60,_0x48e0e1);_0x263c28['position']=Cesium__namespace['Ray'][_0x21b96e(0xa0a)](_0x6b8579,_0x5b0bd0),_0x263c28['direction']=_0x270ac0[_0x21b96e(_0x101a73._0x5bba02)],_0x263c28[_0x21b96e(0x28b)]=_0x270ac0['right'],_0x263c28['up']=_0x270ac0['up'];if(_0x3ecaf3){const _0x544ff7=Cesium__namespace['Cartesian3']['normalize'](Cesium__namespace[_0x21b96e(_0x101a73._0x443d56)]['subtract'](_0x263c28['position'],_0x4fb83e,new Cesium__namespace[(_0x21b96e(0xe95))]()),new Cesium__namespace['Cartesian3']());_0x6b8579=new Cesium__namespace['Ray'](_0x4fb83e,_0x544ff7),_0x263c28['position']=Cesium__namespace['Ray']['getPoint'](_0x6b8579,_0x505981),_0x263c28['direction']=Cesium__namespace['Cartesian3']['negate'](_0x544ff7,new Cesium__namespace['Cartesian3']()),_0x263c28['up']=Cesium__namespace['Cartesian3']['normalize'](_0x263c28[_0x21b96e(_0x101a73._0x9e4e64)],new Cesium__namespace[(_0x21b96e(_0x101a73._0x5c42b9))]()),_0x263c28['right']=Cesium__namespace[_0x21b96e(0xe95)]['cross'](_0x263c28['direction'],_0x263c28['up'],new Cesium__namespace['Cartesian3']());}return _0x263c28;}['moveCamera'](_0x31a35b){const _0x5acd73={_0xd5c1da:0xfc1,_0x984596:0xe95,_0x525d51:0x7e9,_0x451eac:0x315},_0xef0f91=_0x3d5d32,_0x44278e=this['_map'][_0xef0f91(_0x5acd73._0xd5c1da)]['camera'];let _0x3d2c54;switch(_0x31a35b){case MoveType['NARROW']:_0x3d2c54=this['_computedNewPos'](_0x44278e,Cesium__namespace['Cartesian3']['negate'](_0x44278e[_0xef0f91(0xe36)],new Cesium__namespace[(_0xef0f91(0xe95))]()));break;case MoveType['LEFT_ROTATE']:_0x3d2c54=this['_computedNewPos'](_0x44278e,Cesium__namespace[_0xef0f91(_0x5acd73._0x984596)]['negate'](_0x44278e['right'],new Cesium__namespace['Cartesian3']()),!![]);break;case MoveType['RIGHT_ROTATE']:_0x3d2c54=this[_0xef0f91(0x347)](_0x44278e,_0x44278e['right'],!![]);break;case MoveType[_0xef0f91(_0x5acd73._0x525d51)]:if(!this['_limitAngle'](Cesium__namespace['clone'](_0x44278e['up']),Cesium__namespace[_0xef0f91(0x315)](_0x44278e['position']),'up'))return;_0x3d2c54=this['_computedNewPos'](_0x44278e,Cesium__namespace['clone'](_0x44278e['up']),!![]);break;case MoveType['BOTTOM_ROTATE']:if(!this['_limitAngle'](Cesium__namespace['clone'](_0x44278e['up']),Cesium__namespace[_0xef0f91(_0x5acd73._0x451eac)](_0x44278e['position']),_0xef0f91(0xf29)))return;_0x3d2c54=this[_0xef0f91(0x347)](_0x44278e,Cesium__namespace['Cartesian3']['negate'](_0x44278e['up'],new Cesium__namespace['Cartesian3']()),!![]);break;case MoveType[_0xef0f91(0x964)]:default:_0x3d2c54=this['_computedNewPos'](_0x44278e,_0x44278e['direction']);break;}if(!_0x3d2c54)return;this['_resetCamera'](_0x3d2c54);}[_0x3d5d32(0x928)](_0x55b6f3){const _0x15299d={_0xa0d734:0xe0f,_0x3eb6b0:0x68f,_0x2135ed:0x2ef,_0x4741ed:0xa45,_0x42babe:0x425,_0x8d5700:0x24c},_0xccca95=_0x3d5d32;let _0x59e551=[0x0,0x0];const _0x1a9189=this['_map']['scene']['canvas'][_0xccca95(_0x15299d._0xa0d734)],_0x540850=this[_0xccca95(0x1d1)][_0xccca95(0xfc1)][_0xccca95(0x60f)]['clientHeight'],_0x2764a9=(_0x1a9189+_0x540850)/this['dirStep'];switch(_0x55b6f3){case MoveType['LEFT_ROTATE']:_0x59e551=[-_0x2764a9*_0x1a9189/_0x540850,0x0];break;case MoveType[_0xccca95(_0x15299d._0x3eb6b0)]:_0x59e551=[_0x2764a9*_0x1a9189/_0x540850,0x0];break;case MoveType['TOP_ROTATE']:_0x59e551=[0x0,_0x2764a9];break;case MoveType[_0xccca95(_0x15299d._0x2135ed)]:_0x59e551=[0x0,-_0x2764a9];break;default:return;}const _0x54018d=_0x59e551[0x0]/_0x1a9189,_0x504bf2=_0x59e551[0x1]/_0x540850,_0x3987a6=0.05,_0x351d15=this['_map']['camera'];_0x351d15[_0xccca95(_0x15299d._0x4741ed)](_0x54018d*_0x3987a6),_0x351d15[_0xccca95(_0x15299d._0x42babe)](_0x504bf2*_0x3987a6);const _0x2c9b55=_0x351d15['direction'];let _0x26c0df=Cesium__namespace['Cartesian3']['normalize'](_0x351d15['position'],new Cesium__namespace['Cartesian3']());const _0x2fc2a0=Cesium__namespace['Cartesian3']['cross'](_0x2c9b55,_0x26c0df,new Cesium__namespace[(_0xccca95(0xe95))]());_0x26c0df=Cesium__namespace['Cartesian3'][_0xccca95(_0x15299d._0x8d5700)](_0x2fc2a0,_0x2c9b55,new Cesium__namespace['Cartesian3']()),_0x351d15['up']=_0x26c0df,_0x351d15[_0xccca95(0x28b)]=_0x2fc2a0;}}register$1('keyboardRoam',KeyboardRoam),KeyboardRoam['MoveType']=MoveType;function getDefaultContextMenu(_0x173be2){const _0x2432d6={_0x3657ff:0xc93,_0x38a354:0xc73,_0x3da655:0x8c4,_0x767399:0x5c6,_0x2476ff:0xd1b,_0x57aed2:0xd1b,_0x2cf7b5:0x6aa,_0x1c5fb9:0x5e1,_0x516566:0xd1b,_0x3833b7:0xd1b,_0x5bba4b:0xd1b,_0x5f2159:0xd1b,_0x1b8680:0x812,_0x327a02:0x78b,_0x277cf7:0xd66,_0x34625e:0x3c0,_0x12bd70:0xd1b,_0x579738:0x8dd,_0x5c1ab1:0x4f6,_0x581cfe:0x543},_0x1ebd47={_0x9684e:0xaa8},_0x3ce0b4={_0x1f1746:0xfc1},_0x5cb7c2={_0x2769f3:0x89f},_0x2f34fd={_0x28dcaa:0xc14},_0x2a2543={_0x1b2e20:0x5d9},_0x2f8e2c={_0xfcdbfe:0xe9c,_0x59ac67:0xeed},_0x3c766e={_0x3fee9c:0x784},_0xc52fd8={_0xd4312b:0x784},_0x570b83={_0x2396a6:0x409},_0x4697c2={_0x5c64d4:0x409},_0x2b385b={_0x103067:0xb4b},_0x1a2a7b={_0x3b9d2:0xb4b},_0x22e3a4={_0x4b28ab:0x2ea,_0xf450ec:0xe9c,_0xf4d525:0x2ea},_0x4a6ea7={_0x4b20e9:0x528},_0x232f5b={_0x239aee:0x29e},_0x58537f={_0x374031:0x596},_0x41b8b1={_0x3f6857:0x596,_0x3751af:0xff5},_0x59a18a={_0x27c57c:0x8d9},_0x302193={_0x2d13b6:0x7b1,_0x1b4083:0x2ae},_0x165fc1={_0x49e565:0x7b1},_0x3c4b79={_0x35abed:0x744},_0x5ef20a={_0x1fb3b8:0x744,_0x1dccc5:0xa2d,_0x2b9346:0x744},_0x5437f3={_0x2c61c4:0x744},_0x17debb={_0x54ff3d:0xfc1,_0xce571d:0x391,_0xa0b1a6:0xcbe},_0x427650={_0xa28985:0xcbe},_0x1a83ee={_0x501942:0x9cf},_0x1bac58={_0x34353a:0x4c1,_0x3a3517:0xac0},_0x351b52={_0x59dc4e:0xac0,_0x765bb3:0xc7f},_0x5759cc={_0x685e71:0x98d,_0x3baebe:0x328},_0x23c35a={_0x2a9caa:0xa63},_0x2061d5={_0x326448:0xbd7,_0x5e81ab:0x629},_0x501cae={_0x421478:0xb84},_0xe4906c={_0x175b2a:0xa4d,_0x1a7eee:0xa4d,_0x560a41:0xa4d},_0x569f67={_0x35bad0:0xd1b},_0x2af849={_0x2bc6e9:0xfcb,_0x1a4248:0x9a4,_0x212351:0x103b},_0x5bd046=_0x3d5d32,_0x4aeb2a=_0x173be2['contextmenu'];return[{'text':_0x173be2['getLangText'](_0x5bd046(_0x2432d6._0x3657ff)),'icon':Icon['Coordinates'],'show':function(_0x4d79d0){return Cesium__namespace['defined'](_0x4d79d0['cartesian']);},'callback':function(_0x1334aa){const _0x442faa=_0x5bd046,_0x3e270a=LngLatPoint['fromCartesian'](_0x1334aa['cartesian']),_0x5cd809=proj4Trans([_0x3e270a['lng'],_0x3e270a['lat']],'EPSG:4326',CRS[_0x442faa(0xc44)]),_0x5615f4='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x173be2['getLangText']('_经度')+':'+_0x3e270a[_0x442faa(0x5d8)]+',\x20'+_0x173be2[_0x442faa(0xd1b)](_0x442faa(_0x2af849._0x2bc6e9))+':'+_0x3e270a['lat']+',\x20'+_0x173be2['getLangText'](_0x442faa(_0x2af849._0x1a4248))+':'+_0x3e270a['alt']+',\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x173be2['getLangText'](_0x442faa(_0x2af849._0x212351))+':'+_0x5cd809[0x0]['toFixed'](0x1)+',\x20'+_0x173be2['getLangText']('_纵坐标')+':'+_0x5cd809[0x1]['toFixed'](0x1)+'\x20(CGCS2000)\x0a\x20\x20\x20\x20\x20\x20\x20\x20';alert(_0x5615f4,_0x173be2['getLangText']('_位置信息'));const _0x508c15=formatNum$1(_0x1334aa['cartesian']['x'],0x1),_0x870e4b=formatNum$1(_0x1334aa['cartesian']['y'],0x1),_0x584584=formatNum$1(_0x1334aa['cartesian']['z'],0x1);logInfo('经纬度:'+_0x3e270a['toString']()+'\x20,\x20笛卡尔:'+_0x508c15+','+_0x870e4b+','+_0x584584);}},{'text':_0x173be2['getLangText']('_查看当前视角'),'icon':Icon[_0x5bd046(_0x2432d6._0x38a354)],'callback':function(_0x16de4e){const _0x54c56c=_0x5bd046,_0x41df38=JSON[_0x54c56c(0x31e)](_0x173be2['getCameraView']());logInfo(_0x41df38),alert(_0x41df38,_0x173be2[_0x54c56c(_0x569f67._0x35bad0)]('_当前视角信息'));}},{'text':_0x173be2['getLangText']('_视角切换'),'icon':Icon['Camera'],'children':[{'text':_0x173be2['getLangText']('_允许进入地下'),'icon':Icon[_0x5bd046(_0x2432d6._0x3da655)],'show':function(_0x58dbd2){const _0x59c107=_0x5bd046;return _0x173be2['scene'][_0x59c107(0xccc)]['enableCollisionDetection'];},'callback':function(_0x9afc90){_0x173be2['scene']['screenSpaceCameraController']['enableCollisionDetection']=![];}},{'text':_0x173be2['getLangText']('_禁止进入地下'),'icon':Icon[_0x5bd046(0x41c)],'show':function(_0x1d4db9){const _0x46cbb5=_0x5bd046;return!_0x173be2[_0x46cbb5(0xfc1)]['screenSpaceCameraController']['enableCollisionDetection'];},'callback':function(_0x447b92){_0x173be2['scene']['screenSpaceCameraController']['enableCollisionDetection']=!![];}},{'text':_0x173be2['getLangText']('_绕此处环绕飞行'),'icon':Icon['RotatePointStart'],'show':function(_0x279494){const _0x1c7e96=_0x5bd046;var _0x5bb356;return _0x279494['cartesian']&&(!_0x4aeb2a['rotatePoint']||!((_0x5bb356=_0x4aeb2a['rotatePoint'])!==null&&_0x5bb356!==void 0x0&&_0x5bb356[_0x1c7e96(0x37d)]));},'callback':function(_0x83d73e){const _0x1ef235=_0x5bd046;!_0x4aeb2a[_0x1ef235(_0xe4906c._0x175b2a)]&&(_0x4aeb2a[_0x1ef235(_0xe4906c._0x1a7eee)]=new RotatePoint(),_0x173be2['addThing'](_0x4aeb2a[_0x1ef235(_0xe4906c._0x560a41)])),_0x4aeb2a[_0x1ef235(0xa4d)]['start'](_0x83d73e['cartesian']);}},{'text':_0x173be2['getLangText']('_关闭环绕飞行'),'icon':Icon['RotatePointStop'],'show':function(_0x15b4e6){const _0x1f813e=_0x5bd046;var _0xc0ca23;return(_0xc0ca23=_0x4aeb2a['rotatePoint'])===null||_0xc0ca23===void 0x0?void 0x0:_0xc0ca23[_0x1f813e(0x37d)];},'callback':function(_0x483d25){const _0x258325=_0x5bd046;_0x4aeb2a[_0x258325(0xa4d)]&&_0x4aeb2a['rotatePoint']['stop']();}},{'text':_0x173be2[_0x5bd046(0xd1b)]('_移动到此处'),'icon':Icon['FlyToPoint'],'show':function(_0x26fef2){const _0x4fb4be=_0x5bd046;return Cesium__namespace[_0x4fb4be(_0x501cae._0x421478)](_0x26fef2['cartesian']);},'callback':function(_0x3d803f){const _0x2f2d0d=_0x5bd046,_0xf2355=Cesium__namespace['Cartesian3'][_0x2f2d0d(_0x2061d5._0x326448)](_0x3d803f['cartesian'],_0x173be2[_0x2f2d0d(0x435)]['positionWC'])*0.1;_0x173be2[_0x2f2d0d(_0x2061d5._0x5e81ab)](_0x3d803f['cartesian'],{'radius':_0xf2355,'maximumHeight':_0x173be2['camera']['positionCartographic'][_0x2f2d0d(0x83e)]});}},{'text':_0x173be2['getLangText']('_第一视角站到此处'),'icon':Icon['FirstPerspective'],'show':function(_0xa67c8d){return Cesium__namespace['defined'](_0xa67c8d['cartesian']);},'callback':function(_0x37eb09){const _0x220fe1=_0x5bd046;_0x173be2['camera']['flyTo']({'destination':addPositionsHeight(_0x37eb09[_0x220fe1(0x4c1)],0xa),'orientation':{'heading':_0x173be2['camera']['heading'],'pitch':0x0,'roll':0x0},'maximumHeight':_0x173be2['camera']['positionCartographic']['height']});}},{'text':_0x173be2['getLangText'](_0x5bd046(0x228)),'icon':Icon['KeyboardRoamYes'],'show':function(_0x441d14){const _0x2a6e1d=_0x5bd046;return!_0x173be2['keyboardRoam'][_0x2a6e1d(_0x23c35a._0x2a9caa)];},'callback':function(_0x5abc52){_0x173be2['keyboardRoam']['enabled']=!![];}},{'text':_0x173be2['getLangText'](_0x5bd046(0xc5f)),'icon':Icon['KeyboardRoamNo'],'show':function(_0x3bf207){return _0x173be2['keyboardRoam']['enabled'];},'callback':function(_0x4e0a4e){const _0x2ccab5=_0x5bd046;_0x173be2[_0x2ccab5(0x90b)]['enabled']=![];}},{'text':_0x173be2['getLangText'](_0x5bd046(_0x2432d6._0x767399)),'icon':Icon['TrackedEntityYes'],'show':function(_0x151a65){const _0x56208d=_0x5bd046,_0x15d33f=_0x151a65['graphic'];if(!_0x15d33f)return![];if(_0x15d33f['entity']instanceof Cesium__namespace[_0x56208d(0xafa)])return!![];else{if(_0x15d33f['trackedEntity']instanceof Cesium__namespace['Entity'])return!![];}return![];},'callback':function(_0x134c65){const _0x46441d=_0x5bd046;_0x173be2[_0x46441d(_0x5759cc._0x685e71)]=_0x134c65[_0x46441d(_0x5759cc._0x3baebe)];}},{'text':_0x173be2['getLangText']('_取消锁定'),'icon':Icon['TrackedEntityNo'],'show':function(_0x3ab2b2){return _0x173be2['trackedEntity']!==undefined;},'callback':function(_0xc4a591){_0x173be2['trackedEntity']=undefined;}}]},{'text':_0x173be2['getLangText']('_三维模型'),'icon':Icon[_0x5bd046(0xb8e)],'show':function(_0x41a485){const _0x18309b=_0x5bd046,_0x39ef4e=_0x173be2[_0x18309b(0xd27)](_0x41a485['cartesian']);return Cesium__namespace['defined'](_0x39ef4e);},'children':[{'text':_0x173be2['getLangText']('_显示三角网'),'icon':Icon[_0x5bd046(0xd5b)],'show':function(_0x17e218){const _0x392486=_0x5bd046,_0x12a315=_0x173be2['pick3DTileset'](_0x17e218['cartesian']);return!_0x12a315[_0x392486(_0x351b52._0x59dc4e)]&&_0x12a315[_0x392486(_0x351b52._0x765bb3)];},'callback':function(_0x1bb186){const _0x265e4c=_0x173be2['pick3DTileset'](_0x1bb186['cartesian']);_0x265e4c['debugWireframe']=!![];}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x2476ff)]('_关闭三角网'),'icon':Icon[_0x5bd046(0x9e8)],'show':function(_0xdf5a81){const _0x1eeffa=_0x173be2['pick3DTileset'](_0xdf5a81['cartesian']);return _0x1eeffa['debugWireframe']&&_0x1eeffa['_enableDebugWireframe'];},'callback':function(_0x1c1f05){const _0x5eb6a0=_0x5bd046,_0x54e986=_0x173be2['pick3DTileset'](_0x1c1f05[_0x5eb6a0(_0x1bac58._0x34353a)]);_0x54e986[_0x5eb6a0(_0x1bac58._0x3a3517)]=![];}},{'text':_0x173be2['getLangText']('_显示包围盒'),'icon':Icon[_0x5bd046(0x7da)],'show':function(_0x1eebd2){const _0x22751f=_0x5bd046,_0x5e25ba=_0x173be2['pick3DTileset'](_0x1eebd2[_0x22751f(0x4c1)]);return!_0x5e25ba[_0x22751f(_0x1a83ee._0x501942)];},'callback':function(_0x3deffb){const _0x5e0a8e=_0x5bd046,_0x5f4415=_0x173be2['pick3DTileset'](_0x3deffb['cartesian']);_0x5f4415[_0x5e0a8e(0x9cf)]=!![];}},{'text':_0x173be2['getLangText']('_关闭包围盒'),'icon':Icon[_0x5bd046(0xd16)],'show':function(_0x576a21){const _0xdb3502=_0x5bd046,_0x31878f=_0x173be2['pick3DTileset'](_0x576a21[_0xdb3502(0x4c1)]);return _0x31878f['debugShowBoundingVolume'];},'callback':function(_0x4312a8){const _0xe989d6=_0x173be2['pick3DTileset'](_0x4312a8['cartesian']);_0xe989d6['debugShowBoundingVolume']=![];}}]},{'text':_0x173be2[_0x5bd046(0xd1b)]('_地形服务'),'icon':Icon['Terrain'],'show':function(_0x2bb58e){return Cesium__namespace['defined'](_0x2bb58e['cartesian']);},'children':[{'text':_0x173be2['getLangText']('_开启地形'),'icon':Icon['TerrainYes'],'show':function(_0x46a020){return!_0x173be2['hasTerrain'];},'callback':function(_0x2e1dc1){const _0x5f59a4=_0x5bd046;_0x173be2[_0x5f59a4(0xf0b)]=!![];}},{'text':_0x173be2['getLangText']('_关闭地形'),'icon':Icon[_0x5bd046(0x39a)],'show':function(_0x4dc46f){const _0x5afb48=_0x5bd046;return _0x173be2[_0x5afb48(0xf0b)];},'callback':function(_0x4a5dd0){_0x173be2['hasTerrain']=![];}},{'text':_0x173be2['getLangText']('_显示三角网'),'icon':Icon['TerrainWireframeYes'],'show':function(_0x408a9a){const _0x453006=_0x5bd046;return!_0x173be2['scene']['globe']['_surface']['tileProvider'][_0x453006(_0x427650._0xa28985)]['wireframe'];},'callback':function(_0x314f9d){const _0x2427f9=_0x5bd046;_0x173be2[_0x2427f9(0xfc1)]['globe']['_surface']['tileProvider'][_0x2427f9(0xcbe)]['wireframe']=!![];}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x57aed2)]('_关闭三角网'),'icon':Icon[_0x5bd046(0x961)],'show':function(_0x45e944){return _0x173be2['scene']['globe']['_surface']['tileProvider']['_debug']['wireframe'];},'callback':function(_0x1b5fc6){const _0x1701fb=_0x5bd046;_0x173be2[_0x1701fb(_0x17debb._0x54ff3d)]['globe'][_0x1701fb(0x785)][_0x1701fb(_0x17debb._0xce571d)][_0x1701fb(_0x17debb._0xa0b1a6)]['wireframe']=![];}}]},{'text':_0x173be2['getLangText']('_图上量算'),'icon':Icon['Measure'],'children':[{'text':_0x173be2[_0x5bd046(_0x2432d6._0x2476ff)]('_距离'),'icon':Icon['MeasureDistance'],'callback':function(_0x4f8d5d){const _0x436934=_0x5bd046;!_0x4aeb2a[_0x436934(0x744)]&&(_0x4aeb2a['measure']=new Measure(),_0x173be2['addThing'](_0x4aeb2a['measure'])),_0x4aeb2a[_0x436934(_0x5437f3._0x2c61c4)]['distance']();}},{'text':_0x173be2['getLangText']('_面积'),'icon':Icon['MeasureArea'],'callback':function(_0x5e297b){!_0x4aeb2a['measure']&&(_0x4aeb2a['measure']=new Measure(),_0x173be2['addThing'](_0x4aeb2a['measure'])),_0x4aeb2a['measure']['area']();}},{'text':_0x173be2['getLangText'](_0x5bd046(_0x2432d6._0x2cf7b5)),'icon':Icon[_0x5bd046(0x39f)],'callback':function(_0x150ee8){const _0x5f1127=_0x5bd046;!_0x4aeb2a[_0x5f1127(_0x5ef20a._0x1fb3b8)]&&(_0x4aeb2a['measure']=new Measure(),_0x173be2[_0x5f1127(_0x5ef20a._0x1dccc5)](_0x4aeb2a['measure'])),_0x4aeb2a[_0x5f1127(_0x5ef20a._0x2b9346)]['heightTriangle']();}},{'text':_0x173be2['getLangText']('_角度'),'icon':Icon[_0x5bd046(_0x2432d6._0x1c5fb9)],'callback':function(_0x457767){!_0x4aeb2a['measure']&&(_0x4aeb2a['measure']=new Measure(),_0x173be2['addThing'](_0x4aeb2a['measure'])),_0x4aeb2a['measure']['angle']();}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x516566)]('_删除测量'),'icon':Icon['Delete'],'show':function(_0x295827){const _0x4c6813=_0x5bd046;return _0x4aeb2a[_0x4c6813(_0x3c4b79._0x35abed)]&&_0x4aeb2a['measure']['hasMeasure'];},'callback':function(_0x5f3d46){_0x4aeb2a['measure']&&_0x4aeb2a['measure']['clear']();}}]},{'text':_0x173be2['getLangText']('_图上标记'),'icon':Icon['Draw'],'children':[{'text':_0x173be2[_0x5bd046(_0x2432d6._0x3833b7)]('_标记点'),'icon':Icon[_0x5bd046(0x86f)],'callback':function(_0x25def8){const _0x5abfe2={_0x57e5eb:0x31e};_0x173be2['graphicLayer']['startDraw']({'type':'point','style':{'pixelSize':0xc,'color':'#3388ff'},'success':function(_0x173d47){const _0x3b7a6d=_0x4132;console['log'](JSON[_0x3b7a6d(_0x5abfe2._0x57e5eb)](_0x173d47['coordinates']));}});}},{'text':_0x173be2['getLangText']('_标记线'),'icon':Icon['DrawPolyline'],'callback':function(_0x114c50){const _0x53b8a8=_0x5bd046;_0x173be2['graphicLayer'][_0x53b8a8(0x8d9)]({'type':_0x53b8a8(0x96e),'style':{'color':'#55ff33','width':0x3},'success':function(_0x588510){const _0x4c2db3=_0x53b8a8;console[_0x4c2db3(_0x165fc1._0x49e565)](JSON['stringify'](_0x588510['coordinates']));}});}},{'text':_0x173be2['getLangText'](_0x5bd046(0xbee)),'icon':Icon['DrawPolygon'],'callback':function(_0x597e78){const _0x896ee8=_0x5bd046;_0x173be2['graphicLayer'][_0x896ee8(_0x59a18a._0x27c57c)]({'type':'polygon','style':{'color':'#29cf34','opacity':0.5,'outline':!![],'outlineWidth':0x2},'success':function(_0x3d54f5){const _0x167fbe=_0x896ee8;console[_0x167fbe(_0x302193._0x2d13b6)](JSON['stringify'](_0x3d54f5[_0x167fbe(_0x302193._0x1b4083)]));}});}},{'text':_0x173be2['getLangText']('_标记圆'),'icon':Icon['DrawCircle'],'callback':function(_0x19607c){_0x173be2['graphicLayer']['startDraw']({'type':'circle','style':{'color':'#ffff00','opacity':0.6},'success':function(_0x50d269){console['log'](JSON['stringify'](_0x50d269['coordinates']));}});}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x5bba4b)]('_标记矩形'),'icon':Icon['DrawRectangle'],'callback':function(_0x28f301){const _0xa1dc89=_0x5bd046;_0x173be2[_0xa1dc89(_0x41b8b1._0x3f6857)]['startDraw']({'type':'rectangle','style':{'color':_0xa1dc89(_0x41b8b1._0x3751af),'opacity':0.6},'success':function(_0x245a42){const _0xd5472f=_0xa1dc89;console[_0xd5472f(0x7b1)](JSON['stringify'](_0x245a42['coordinates']));}});}},{'text':_0x173be2['getLangText'](_0x5bd046(0x241)),'icon':Icon['DrawEditYes'],'show':function(_0x32d9fb){const _0x422f8b=_0x5bd046;return!_0x173be2[_0x422f8b(0x596)]['hasEdit'];},'callback':function(_0x5d9e4e){const _0x5ed4f7=_0x5bd046;_0x173be2[_0x5ed4f7(_0x58537f._0x374031)]['hasEdit']=!![];}},{'text':_0x173be2['getLangText']('_禁止编辑'),'icon':Icon['DrawEditNo'],'show':function(_0x399dcd){return _0x173be2['graphicLayer']['hasEdit'];},'callback':function(_0x49df02){_0x173be2['graphicLayer']['hasEdit']=![];}},{'text':_0x173be2[_0x5bd046(0xd1b)](_0x5bd046(0x69e)),'icon':Icon['DrawDownJson'],'show':function(_0x1ff3e3){return _0x173be2['graphicLayer']['length']>0x0;},'callback':function(_0x173118){const _0x3deeb2=_0x5bd046;downloadFile('图上标记.json',JSON[_0x3deeb2(0x31e)](_0x173be2['graphicLayer'][_0x3deeb2(_0x232f5b._0x239aee)]()));}},{'text':_0x173be2['getLangText']('_清除所有标记'),'icon':Icon['Delete'],'show':function(_0x59f762){const _0x4298b0=_0x5bd046;return _0x173be2['graphicLayer'][_0x4298b0(0xc84)]>0x0;},'callback':function(_0x1b23c5){const _0x1a5e51=_0x5bd046;_0x173be2[_0x1a5e51(0x596)]['clear']();}}]},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x5f2159)](_0x5bd046(0x89a)),'icon':Icon['Effect'],'children':[{'text':_0x173be2['getLangText']('_开启下雨'),'icon':Icon[_0x5bd046(_0x2432d6._0x1b8680)],'show':function(_0x2e5398){const _0x4793cb=_0x5bd046;return!_0x4aeb2a[_0x4793cb(0x69a)];},'callback':function(_0x4094df){const _0x4c361a=_0x5bd046;!_0x4aeb2a[_0x4c361a(0x69a)]&&(_0x4aeb2a['rainEffect']=new RainEffect(),_0x173be2[_0x4c361a(_0x4a6ea7._0x4b20e9)](_0x4aeb2a['rainEffect']));}},{'text':_0x173be2[_0x5bd046(0xd1b)]('_关闭下雨'),'icon':Icon['RainEffectNo'],'show':function(_0x377928){return _0x4aeb2a['rainEffect'];},'callback':function(_0x135a72){const _0x225dde=_0x5bd046;_0x4aeb2a['rainEffect']&&(_0x173be2['removeEffect'](_0x4aeb2a[_0x225dde(0x69a)],!![]),delete _0x4aeb2a[_0x225dde(0x69a)]);}},{'text':_0x173be2[_0x5bd046(0xd1b)]('_开启下雪'),'icon':Icon['SnowEffectYes'],'show':function(_0x30437a){const _0x282f9b=_0x5bd046;return!_0x4aeb2a[_0x282f9b(0x2ea)];},'callback':function(_0x578780){!_0x4aeb2a['snowEffect']&&(_0x4aeb2a['snowEffect']=new SnowEffect(),_0x173be2['addEffect'](_0x4aeb2a['snowEffect']));}},{'text':_0x173be2['getLangText']('_关闭下雪'),'icon':Icon[_0x5bd046(_0x2432d6._0x327a02)],'show':function(_0x32f739){return _0x4aeb2a['snowEffect'];},'callback':function(_0xc05ef6){const _0xda37d8=_0x5bd046;_0x4aeb2a[_0xda37d8(_0x22e3a4._0x4b28ab)]&&(_0x173be2[_0xda37d8(_0x22e3a4._0xf450ec)](_0x4aeb2a['snowEffect'],!![]),delete _0x4aeb2a[_0xda37d8(_0x22e3a4._0xf4d525)]);}},{'text':_0x173be2['getLangText'](_0x5bd046(0xe65)),'icon':Icon['FogEffectYes'],'show':function(_0x42e2ce){return!_0x4aeb2a['fogEffect'];},'callback':function(_0x15a81e){const _0x572de4=_0x5bd046;if(!_0x4aeb2a['fogEffect']){const _0x1cbbd5=_0x173be2['camera']['positionCartographic'][_0x572de4(0x83e)]*0x2;_0x4aeb2a['fogEffect']=new FogEffect({'fogByDistance':new Cesium__namespace['Cartesian4'](0.1*_0x1cbbd5,0.1,_0x1cbbd5,0.8)}),_0x173be2['addEffect'](_0x4aeb2a[_0x572de4(_0x1a2a7b._0x3b9d2)]);}}},{'text':_0x173be2['getLangText'](_0x5bd046(0x3f8)),'icon':Icon['FogEffectNo'],'show':function(_0x8eaf03){const _0x2ce525=_0x5bd046;return _0x4aeb2a[_0x2ce525(_0x2b385b._0x103067)];},'callback':function(_0x4d5ab3){const _0xb3e1bb=_0x5bd046;_0x4aeb2a[_0xb3e1bb(0xb4b)]&&(_0x173be2['removeEffect'](_0x4aeb2a[_0xb3e1bb(0xb4b)],!![]),delete _0x4aeb2a['fogEffect']);}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x516566)]('_开启泛光'),'icon':Icon['BloomEffectYes'],'show':function(_0x12ba51){return!_0x4aeb2a['bloomEffect'];},'callback':function(_0x5eca11){const _0x32346b=_0x5bd046;!_0x4aeb2a['bloomEffect']&&(_0x4aeb2a['bloomEffect']=new BloomEffect(),_0x173be2[_0x32346b(0x528)](_0x4aeb2a['bloomEffect']));}},{'text':_0x173be2['getLangText']('_关闭泛光'),'icon':Icon[_0x5bd046(0xdf9)],'show':function(_0x3a48f9){return _0x4aeb2a['bloomEffect'];},'callback':function(_0x54cf25){const _0x27cf66=_0x5bd046;_0x4aeb2a[_0x27cf66(0x394)]&&(_0x173be2['removeEffect'](_0x4aeb2a['bloomEffect'],!![]),delete _0x4aeb2a[_0x27cf66(0x394)]);}},{'text':_0x173be2['getLangText']('_开启亮度'),'icon':Icon[_0x5bd046(_0x2432d6._0x277cf7)],'show':function(_0x3ea925){return!_0x4aeb2a['brightnessEffect'];},'callback':function(_0x3a0899){!_0x4aeb2a['brightnessEffect']&&(_0x4aeb2a['brightnessEffect']=new BrightnessEffect(),_0x173be2['addEffect'](_0x4aeb2a['brightnessEffect']));}},{'text':_0x173be2[_0x5bd046(0xd1b)](_0x5bd046(0xbac)),'icon':Icon['BrightnessEffectNo'],'show':function(_0x2c7c20){return _0x4aeb2a['brightnessEffect'];},'callback':function(_0xaa04c1){_0x4aeb2a['brightnessEffect']&&(_0x173be2['removeEffect'](_0x4aeb2a['brightnessEffect'],!![]),delete _0x4aeb2a['brightnessEffect']);}},{'text':_0x173be2['getLangText']('_开启夜视'),'icon':Icon['NightVisionEffectYes'],'show':function(_0x42757b){const _0x197f81=_0x5bd046;return!_0x4aeb2a[_0x197f81(_0x4697c2._0x5c64d4)];},'callback':function(_0x45d6dc){const _0x1c2f45=_0x5bd046;!_0x4aeb2a['nightVisionEffect']&&(_0x4aeb2a[_0x1c2f45(0x409)]=new NightVisionEffect(),_0x173be2['addEffect'](_0x4aeb2a['nightVisionEffect']));}},{'text':_0x173be2['getLangText']('_关闭夜视'),'icon':Icon['NightVisionEffectNo'],'show':function(_0x3a77ae){const _0x4501ff=_0x5bd046;return _0x4aeb2a[_0x4501ff(_0x570b83._0x2396a6)];},'callback':function(_0x29e517){const _0x2340b0=_0x5bd046;_0x4aeb2a[_0x2340b0(0x409)]&&(_0x173be2['removeEffect'](_0x4aeb2a['nightVisionEffect'],!![]),delete _0x4aeb2a['nightVisionEffect']);}},{'text':_0x173be2['getLangText']('_开启黑白'),'icon':Icon[_0x5bd046(0xe81)],'show':function(_0x56fda9){const _0xd64a9d=_0x5bd046;return!_0x4aeb2a[_0xd64a9d(_0xc52fd8._0xd4312b)];},'callback':function(_0xb98ebb){const _0x41d3e3=_0x5bd046;!_0x4aeb2a[_0x41d3e3(_0x3c766e._0x3fee9c)]&&(_0x4aeb2a['blackAndWhiteEffect']=new BlackAndWhiteEffect(),_0x173be2['addEffect'](_0x4aeb2a[_0x41d3e3(0x784)]));}},{'text':_0x173be2['getLangText']('_关闭黑白'),'icon':Icon['BlackAndWhiteEffectNo'],'show':function(_0x6e6062){return _0x4aeb2a['blackAndWhiteEffect'];},'callback':function(_0x1a1759){const _0x29e6e3=_0x5bd046;_0x4aeb2a[_0x29e6e3(0x784)]&&(_0x173be2[_0x29e6e3(0xe9c)](_0x4aeb2a['blackAndWhiteEffect'],!![]),delete _0x4aeb2a['blackAndWhiteEffect']);}},{'text':_0x173be2['getLangText']('_开启拾取高亮'),'icon':Icon['OutlineEffectYes'],'show':function(_0x489284){return!_0x4aeb2a['outlineEffect'];},'callback':function(_0x2ee854){!_0x4aeb2a['outlineEffect']&&(_0x4aeb2a['outlineEffect']=new OutlineEffect(),_0x173be2['addEffect'](_0x4aeb2a['outlineEffect']));}},{'text':_0x173be2['getLangText']('_关闭拾取高亮'),'icon':Icon['OutlineEffectNo'],'show':function(_0x10126f){return _0x4aeb2a['outlineEffect'];},'callback':function(_0x2db57a){const _0x385b26=_0x5bd046;_0x4aeb2a['outlineEffect']&&(_0x173be2[_0x385b26(_0x2f8e2c._0xfcdbfe)](_0x4aeb2a['outlineEffect'],!![]),delete _0x4aeb2a[_0x385b26(_0x2f8e2c._0x59ac67)]);}}]},{'text':_0x173be2[_0x5bd046(0xd1b)]('_场景设置'),'icon':Icon['Scene'],'children':[{'text':_0x173be2['getLangText']('_开启深度监测'),'icon':Icon['DepthTestYes'],'show':function(_0x357881){return!_0x173be2['scene']['globe']['depthTestAgainstTerrain'];},'callback':function(_0x3c553a){const _0x43f75e=_0x5bd046;_0x173be2[_0x43f75e(0xfc1)]['globe']['depthTestAgainstTerrain']=!![];}},{'text':_0x173be2['getLangText'](_0x5bd046(_0x2432d6._0x34625e)),'icon':Icon['DepthTestNo'],'show':function(_0x2d95b3){const _0x4e61b4=_0x5bd046;return _0x173be2[_0x4e61b4(0xfc1)]['globe']['depthTestAgainstTerrain'];},'callback':function(_0x44948e){const _0x1e9a38=_0x5bd046;_0x173be2['scene']['globe'][_0x1e9a38(_0x2a2543._0x1b2e20)]=![];}},{'text':_0x173be2['getLangText'](_0x5bd046(0xce9)),'icon':Icon['SkyBoxYes'],'show':function(_0x41dc7a){const _0x33d42c=_0x5bd046;return!_0x173be2['scene'][_0x33d42c(_0x2f34fd._0x28dcaa)]['show'];},'callback':function(_0x349625){const _0x1e9f3a=_0x5bd046;_0x173be2[_0x1e9f3a(0xfc1)]['skyBox']['show']=!![],_0x173be2['scene']['moon']['show']=!![],_0x173be2['scene']['sun']['show']=!![];}},{'text':_0x173be2[_0x5bd046(_0x2432d6._0x12bd70)](_0x5bd046(0xbd1)),'icon':Icon['SkyBoxNo'],'show':function(_0x33d25b){return _0x173be2['scene']['skyBox']['show'];},'callback':function(_0x4e7d32){const _0x1f2af5=_0x5bd046;_0x173be2['scene']['skyBox']['show']=![],_0x173be2['scene'][_0x1f2af5(0x1088)]['show']=![],_0x173be2['scene']['sun']['show']=![];}},{'text':_0x173be2['getLangText']('_开启日照阴影'),'icon':Icon['ShadowYes'],'show':function(_0x15dbfe){return!_0x173be2['viewer']['shadows'];},'callback':function(_0x30a28a){const _0x5ac9cb=_0x5bd046;_0x173be2['viewer']['shadows']=!![],_0x173be2['viewer']['terrainShadows']=Cesium__namespace['ShadowMode']['ENABLED'],_0x173be2['scene']['globe'][_0x5ac9cb(_0x5cb7c2._0x2769f3)]=!![];}},{'text':_0x173be2['getLangText']('_关闭日照阴影'),'icon':Icon['ShadowNo'],'show':function(_0x3960ac){return _0x173be2['viewer']['shadows'];},'callback':function(_0x3c19ad){const _0xc5dbf6=_0x5bd046;_0x173be2[_0xc5dbf6(0x4c2)]['shadows']=![],_0x173be2['viewer']['terrainShadows']=Cesium__namespace['ShadowMode']['RECEIVE_ONLY'],_0x173be2['scene']['globe']['enableLighting']=![];}},{'text':_0x173be2['getLangText']('_开启大气渲染'),'icon':Icon[_0x5bd046(_0x2432d6._0x579738)],'show':function(_0x298509){const _0x7427c=_0x5bd046;return!_0x173be2[_0x7427c(_0x3ce0b4._0x1f1746)]['skyAtmosphere'][_0x7427c(0x792)];},'callback':function(_0x4de3a6){const _0x10e6a8=_0x5bd046;_0x173be2[_0x10e6a8(0xfc1)]['skyAtmosphere']['show']=!![],_0x173be2['scene'][_0x10e6a8(0xaa8)]['showGroundAtmosphere']=!![];}},{'text':_0x173be2['getLangText'](_0x5bd046(_0x2432d6._0x5c1ab1)),'icon':Icon[_0x5bd046(_0x2432d6._0x581cfe)],'show':function(_0xfa6d48){const _0x31f7bf=_0x5bd046;return _0x173be2[_0x31f7bf(0xfc1)]['skyAtmosphere']['show'];},'callback':function(_0x372186){const _0x45efc7=_0x5bd046;_0x173be2['scene']['skyAtmosphere'][_0x45efc7(0x792)]=![],_0x173be2[_0x45efc7(0xfc1)][_0x45efc7(_0x1ebd47._0x9684e)]['showGroundAtmosphere']=![];}},{'text':_0x173be2['getLangText']('_场景出图'),'icon':Icon['ExpImage'],'callback':function(_0x3d9444){_0x173be2['expImage']();}}]}];}function toChineseBeforeCreate(_0x28e6c4){const _0x39b511={_0x59d538:0x75f,_0x4916bd:0x2f3,_0x513546:0xf8c,_0x1f9860:0xb9e},_0x577f29={_0x529bfc:0x8b7,_0x5c65da:0xe6f,_0x390ebb:0x108c,_0x28c2c5:0x834,_0x1c0547:0x1035},_0x5019f2={_0x19aba4:0x8b7},_0x1d38f2=_0x3d5d32;Cesium__namespace[_0x1d38f2(_0x39b511._0x59d538)]['defaultDateFormatter']=function(_0x267c0f,_0x543df6){const _0x346e6c=Cesium__namespace['JulianDate']['toDate'](_0x267c0f);return formatDate(_0x346e6c,'yyyy-MM-dd');},Cesium__namespace[_0x1d38f2(0x75f)][_0x1d38f2(_0x39b511._0x4916bd)]=function(_0x50021c,_0x247f0f){const _0x1ccb63=_0x1d38f2,_0xe550e2=Cesium__namespace[_0x1ccb63(_0x5019f2._0x19aba4)]['toDate'](_0x50021c);return formatDate(_0xe550e2,_0x1ccb63(0xa9d));},Cesium__namespace[_0x1d38f2(0xf66)][_0x1d38f2(_0x39b511._0x513546)][_0x1d38f2(_0x39b511._0x1f9860)]=function(_0xaba066){const _0x12825f=_0x1d38f2,_0x4f016a=Cesium__namespace[_0x12825f(_0x577f29._0x529bfc)]['toDate'](this['_startJulian']),_0x415f60=Cesium__namespace['JulianDate'][_0x12825f(0x834)](this['_endJulian']),_0x39641f=_0x415f60[_0x12825f(_0x577f29._0x5c65da)]()-_0x4f016a['getFullYear'](),_0x3fbe41=_0x415f60['getMonth']()-_0x4f016a['getMonth'](),_0x516aa8=_0x415f60['getDate']()-_0x4f016a['getDate'](),_0x172fbd=_0x415f60['getHours']()-_0x4f016a[_0x12825f(_0x577f29._0x390ebb)](),_0x5aca51=_0x415f60['getMinutes']()-_0x4f016a['getMinutes'](),_0x922729=_0x415f60['getSeconds']()-_0x4f016a['getSeconds'](),_0x5ce481=Cesium__namespace['JulianDate'][_0x12825f(_0x577f29._0x28c2c5)](_0xaba066);if(_0x39641f===0x0){if(_0x3fbe41===0x0&&_0x516aa8<0xa){if(_0x516aa8===0x0){if(_0x172fbd===0x0){if(_0x5aca51===0x0&&_0x922729<0xa){if(_0x922729===0x0)return formatDate(_0x5ce481,'S');return formatDate(_0x5ce481,'HH:mm:ss\x20S');}return formatDate(_0x5ce481,'HH:mm:ss');}return formatDate(_0x5ce481,'HH:mm:ss');}return formatDate(_0x5ce481,_0x12825f(0x7bc));}return formatDate(_0x5ce481,_0x12825f(_0x577f29._0x1c0547));}return formatDate(_0x5ce481,'yyyy-MM-dd');};}function toChineseCreateEnd(_0x52b605,_0x326ead){const _0x3ca350={_0x1762c3:0x727},_0xf7684d=_0x3d5d32,_0x364fcc=_0x326ead['container'];_0x326ead['scene'][_0xf7684d(0x4e1)]['addEventListener'](function(_0xae500f,_0x6fcd4a){const _0x30d862=_0xf7684d,_0x4ee3c2={'An\x20error\x20occurred\x20while\x20rendering.\x20\x20Rendering\x20has\x20stopped.':_0x30d862(_0x3ca350._0x1762c3),'Error\x20constructing\x20CesiumWidget.':'构造CesiumWidget时出错'};_updateDomInnerHtml(_0x364fcc,_0x4ee3c2,'cesium-widget-errorPanel-header');});}function _updateDomInnerHtml(_0x5b579e,_0x3d9e07,_0x4c7bcd){const _0x34cc90={_0x553f8b:0xc84},_0x2af1ae=_0x3d5d32,_0x30d008=_0x5b579e['getElementsByClassName'](_0x4c7bcd);for(let _0x51166b=0x0;_0x51166b<_0x30d008[_0x2af1ae(_0x34cc90._0x553f8b)];_0x51166b++){_0x3d9e07[_0x30d008[_0x51166b]['innerHTML']]&&(_0x30d008[_0x51166b][_0x2af1ae(0xae5)]=_0x3d9e07[_0x30d008[_0x51166b]['innerHTML']]);}}const DefaultOptions={'animation':![],'timeline':![],'fullscreenButton':![],'vrButton':![],'geocoder':![],'sceneModePicker':![],'homeButton':![],'navigationHelpButton':![],'navigationInstructionsInitiallyVisible':![],'infoBox':![],'selectionIndicator':![],'shouldAnimate':!![],'showRenderLoopErrors':!![],'baseLayerPicker':![],'requestRenderMode':![]};class Map extends BaseClass{constructor(_0xea3ef7,_0x4833d5={}){const _0x1c056a={_0x231885:0x809,_0x1237b9:0x7f1,_0x552552:0x433,_0xc759c3:0x826,_0x1c910e:0xfc1},_0x5b5a5a=_0x3d5d32;super(_0x4833d5),this['options']=_0x4833d5,_0x4833d5[_0x5b5a5a(0xee0)]&&updateAll(_0x4833d5[_0x5b5a5a(0xee0)]),_0x4833d5[_0x5b5a5a(0x6b0)]=_0x4833d5['lang']??LangType['ZH'],(_0x4833d5['lang']===LangType['ZH']||_0x4833d5['lang']===LangType['ZHHK'])&&toChineseBeforeCreate(),initBeforeCreateDefaultValue(_0x4833d5),_0xea3ef7 instanceof Cesium__namespace['Viewer']?this[_0x5b5a5a(0x809)]=_0xea3ef7:this[_0x5b5a5a(_0x1c056a._0x231885)]=this['_createViewer'](_0xea3ef7,_0x4833d5),this[_0x5b5a5a(0xc33)]=![],this[_0x5b5a5a(_0x1c056a._0x1237b9)]=!![],this['_controlList']=new MarsArray(),this['_thingList']=new MarsArray(),this['_layerList']=new MarsArray(),this['_optionsBasemapsList']=new MarsArray(),this['_optionsLayersList']=new MarsArray(),this['_lights']=new MarsArray(),this['_visibilitys']=new MarsArray(),this[_0x5b5a5a(0x430)]={},this['_effects']={},this['chinaCRS']=this[_0x5b5a5a(_0x1c056a._0x552552)]['chinaCRS']||ChinaCRS['WGS84'],(_0x4833d5['lang']===LangType['ZH']||_0x4833d5['lang']===LangType['ZHHK'])&&toChineseCreateEnd(_0x4833d5,this[_0x5b5a5a(_0x1c056a._0x231885)]),this[_0x5b5a5a(_0x1c056a._0xc759c3)]=new SceneEvent(this),this['_mouseEvent']=new MouseEvent(this,_0x4833d5['mouse']),this['_sceneOption']=new SceneOption(this),this['_zoomNavigation']=new ZoomNavigation(this['_viewer']),this['_initLayers'](),this['_initControls'](),this['_initEffect'](),this['_sceneOption']['setOptions'](this[_0x5b5a5a(0x433)]['scene'],this['options'][_0x5b5a5a(_0x1c056a._0x1c910e)]);}get['viewer'](){return this['_viewer'];}get['container'](){const _0x4b8078=_0x3d5d32;return this['_viewer'][_0x4b8078(0x6c2)];}get[_0x3d5d32(0x35e)](){const _0x2119d6=_0x3d5d32;return this[_0x2119d6(0x809)][_0x2119d6(0xc3f)];}get[_0x3d5d32(0x60f)](){const _0x4d68b4={_0x2e1fa6:0x809},_0x276093=_0x3d5d32;var _0x48cc10;return(_0x48cc10=this[_0x276093(_0x4d68b4._0x2e1fa6)])===null||_0x48cc10===void 0x0?void 0x0:_0x48cc10['scene']['canvas'];}get[_0x3d5d32(0xfc1)](){const _0x217cd7={_0x471d8a:0x809},_0x138294=_0x3d5d32;var _0x117a6;return(_0x117a6=this[_0x138294(_0x217cd7._0x471d8a)])===null||_0x117a6===void 0x0?void 0x0:_0x117a6['scene'];}get['camera'](){const _0x1dacaf={_0x4e0beb:0x809,_0x4c473b:0x435},_0x254da5=_0x3d5d32;return this[_0x254da5(_0x1dacaf._0x4e0beb)][_0x254da5(_0x1dacaf._0x4c473b)];}get['imageryLayers'](){const _0x3001d7=_0x3d5d32;return this[_0x3001d7(0x809)]['imageryLayers'];}get['dataSources'](){const _0xda50f3={_0x3aeafd:0x809,_0x3189e0:0x926},_0x1e0456=_0x3d5d32;return this[_0x1e0456(_0xda50f3._0x3aeafd)][_0x1e0456(_0xda50f3._0x3189e0)];}get['entities'](){const _0x2fd0f1={_0x506cd1:0x809},_0x348e58=_0x3d5d32;return this[_0x348e58(_0x2fd0f1._0x506cd1)][_0x348e58(0xea8)];}get[_0x3d5d32(0x9f4)](){return this['_viewer']['clock'];}get['currentTime'](){const _0xe52e82={_0x314cb1:0x809},_0x53282a=_0x3d5d32;return this[_0x53282a(_0xe52e82._0x314cb1)]['clock']['currentTime'];}set['currentTime'](_0xbbb4f2){const _0x348e3b={_0x4a6756:0x809},_0x15805e=_0x3d5d32;this[_0x15805e(_0x348e3b._0x4a6756)]['clock'][_0x15805e(0x4f8)]=_0xbbb4f2;}get['cesiumWidget'](){const _0x244344={_0x479873:0x809},_0x8b6bc=_0x3d5d32;return this[_0x8b6bc(_0x244344._0x479873)]['cesiumWidget'];}get[_0x3d5d32(0x98d)](){const _0x4de7f4={_0x557f13:0x809},_0xedaf68=_0x3d5d32;return this[_0xedaf68(_0x4de7f4._0x557f13)]['trackedEntity'];}set[_0x3d5d32(0x98d)](_0x343903){const _0x7c4ecd={_0xadb18:0x809,_0x2bb6fa:0xafa,_0xf1af16:0x98d},_0x245e05=_0x3d5d32;if(_0x343903){if(_0x343903 instanceof Cesium__namespace['Entity'])this[_0x245e05(_0x7c4ecd._0xadb18)]['trackedEntity']=_0x343903;else{if(_0x343903['entity']instanceof Cesium__namespace[_0x245e05(_0x7c4ecd._0x2bb6fa)])this[_0x245e05(_0x7c4ecd._0xadb18)]['trackedEntity']=_0x343903['entity'];else{if(_0x343903['czmObject']instanceof Cesium__namespace['Entity'])this['_viewer'][_0x245e05(_0x7c4ecd._0xf1af16)]=_0x343903['czmObject'];else _0x343903[_0x245e05(0x98d)]instanceof Cesium__namespace[_0x245e05(_0x7c4ecd._0x2bb6fa)]&&(this['_viewer'][_0x245e05(0x98d)]=_0x343903['trackedEntity']);}}}else this['_viewer']['trackedEntity']=undefined;}get['terrainProvider'](){return this['_viewer']['terrainProvider'];}set['terrainProvider'](_0x5e86cf){const _0x3895eb={_0x4c0304:0xbff,_0x572a1d:0x428,_0x5e74b0:0x809},_0x1316ac={_0x3ac774:0x857},_0x3d5d1d=_0x3d5d32;if(_0x5e86cf){if(_0x5e86cf['then']){_0x5e86cf['then'](_0x3ddb95=>{this['terrainProvider']=_0x3ddb95;});return;}_0x5e86cf[_0x3d5d1d(_0x3895eb._0x4c0304)]=_0x5e86cf['_marsOptions']||{},_0x5e86cf['_marsOptions']['onLoadSuccess']=_0x17a847=>{const _0x4d1aff=_0x3d5d1d;this[_0x4d1aff(_0x1316ac._0x3ac774)](_0x17a847);},_0x5e86cf[_0x3d5d1d(_0x3895eb._0x4c0304)][_0x3d5d1d(_0x3895eb._0x572a1d)]=_0x8b41ae=>{this['_terrain_onLoadError'](_0x8b41ae);};}this[_0x3d5d1d(_0x3895eb._0x5e74b0)]['terrainProvider']=_0x5e86cf,this['_defaultTerrainProvider']=_0x5e86cf,_0x5e86cf instanceof Cesium__namespace['EllipsoidTerrainProvider']&&this[_0x3d5d1d(0xefc)](EventType['terrainLoadSuccess']);}get[_0x3d5d32(0xf0b)](){const _0x30d62b={_0x4474d6:0x581,_0x574901:0x3ab},_0x347f28=_0x3d5d32;return Boolean(this[_0x347f28(0x809)][_0x347f28(_0x30d62b._0x4474d6)][_0x347f28(_0x30d62b._0x574901)]);}set['hasTerrain'](_0x126614){const _0x1e1321={_0x50f34f:0x809,_0x25729b:0xefc},_0x4d4307=_0x3d5d32;_0x126614?this['_defaultTerrainProvider']==null?this['terrainProvider']=createTerrainProvider(this['_getTerrainOptions']()):this[_0x4d4307(_0x1e1321._0x50f34f)]['terrainProvider']=this['_defaultTerrainProvider']:(this['_viewer']['terrainProvider']=getNoTerrainProvider(),this[_0x4d4307(_0x1e1321._0x25729b)](EventType['terrainLoadSuccess']));}get[_0x3d5d32(0x91d)](){const _0x58acc8={_0x1bf986:0x55b},_0x59814a=_0x3d5d32,_0x13ede5=this[_0x59814a(_0x58acc8._0x1bf986)]['values'];if(_0x13ede5['length']===0x0){if(this[_0x59814a(0x809)][_0x59814a(0x5f2)])return this['_viewer']['baseLayerPicker']['viewModel']['selectedImagery'];return undefined;}for(let _0x2947a3=0x0;_0x2947a3<_0x13ede5['length'];_0x2947a3++){const _0x54ec93=_0x13ede5[_0x2947a3];if(_0x54ec93['hasEmptyGroup'])continue;if(_0x54ec93['isAdded'])return _0x54ec93;}return undefined;}set['basemap'](_0x2818f3){const _0x4c8a7b={_0x1f7ec3:0x809,_0x3dae50:0x5f2,_0x4de8dc:0x433,_0x74482a:0xdb7,_0x5cafad:0x842,_0x454dd7:0xc17},_0x1ea3ea=_0x3d5d32;let _0x50f53c,_0x5d9e03;_0x2818f3&&isObject(_0x2818f3)?(_0x50f53c=_0x2818f3['id'],_0x5d9e03=_0x2818f3['name']):(_0x50f53c=_0x2818f3,_0x5d9e03=_0x2818f3);const _0x407590=this['_optionsBasemapsList']['values'];if(_0x407590[_0x1ea3ea(0xc84)]===0x0){if(this[_0x1ea3ea(_0x4c8a7b._0x1f7ec3)]['baseLayerPicker']){const _0x259bd9=this['_viewer'][_0x1ea3ea(_0x4c8a7b._0x3dae50)]['viewModel'];let _0x33d7f8;if(_0x2818f3){let _0x2bf637,_0x43f593=-0x1;for(let _0x16097e=0x0;_0x16097e{_0x441d69['toBottom']&&_0x441d69['toBottom'](),this['fire'](EventType['changeBasemap'],{'layer':_0x4821fb});})):_0x441d69['isAdded']&&(delete _0x441d69['options']['show'],this['removeLayer'](_0x441d69));}}get['onlyPickModelPosition'](){var _0x529d5b;return(_0x529d5b=this['_viewer'])===null||_0x529d5b===void 0x0?void 0x0:_0x529d5b['scene']['onlyPickModelPosition'];}set['onlyPickModelPosition'](_0x1c794a){const _0x2bc955={_0x3968ab:0xda8},_0x1c7566=_0x3d5d32;this['_viewer'][_0x1c7566(0xfc1)][_0x1c7566(_0x2bc955._0x3968ab)]=_0x1c794a;}get['onlyPickTerrainPosition'](){const _0x4cfa7b=_0x3d5d32;var _0x190edc;return(_0x190edc=this[_0x4cfa7b(0x809)])===null||_0x190edc===void 0x0?void 0x0:_0x190edc['scene']['onlyPickTerrainPosition'];}set['onlyPickTerrainPosition'](_0x3ac907){this['_viewer']['scene']['onlyPickTerrainPosition']=_0x3ac907;}get[_0x3d5d32(0x2e0)](){const _0x470004=_0x3d5d32;return this[_0x470004(0xf1c)];}set['tilesetMaxTotalMemory'](_0x3867fc){this['_tilesetMaxTotalMemory']=_0x3867fc;}get[_0x3d5d32(0x49a)](){const _0x5afed9=_0x3d5d32;return this[_0x5afed9(0xd90)];}get['popup'](){const _0x5b11f8=_0x3d5d32;return this[_0x5b11f8(0x1006)];}get['tooltip'](){const _0x4b0cba={_0x2a3193:0x839},_0x4c7086=_0x3d5d32;return this[_0x4c7086(_0x4b0cba._0x2a3193)];}get[_0x3d5d32(0x6ea)](){const _0x5e8879=_0x3d5d32;return this[_0x5e8879(0xfe2)];}get[_0x3d5d32(0x45c)](){return this['_contextmenuMgr'];}get['keyboardRoam'](){const _0x224cb0=_0x3d5d32;return this[_0x224cb0(0x6ba)];}get['controls'](){return this['_controls'];}get['effects'](){return this['_effects'];}get['graphicLayer'](){const _0x5890a1={_0x4d90a0:0x32f,_0x57187d:0x32f},_0x11fa97=_0x3d5d32;return this[_0x11fa97(_0x5890a1._0x4d90a0)]==null&&(this[_0x11fa97(_0x5890a1._0x57187d)]=new GraphicLayer({'name':'默认数据图层','private':!![]}),this['addLayer'](this[_0x11fa97(0x32f)])),this['_graphicLayer'];}get['level'](){const _0xf69721={_0x1e4a16:0xdc1},_0x562e92=_0x3d5d32,_0x27278d=Math['abs'](this['_viewer']['camera']['positionCartographic']['height']);if(_0x27278d===this['_prevCameraHeight'])return this[_0x562e92(_0xf69721._0x1e4a16)];return this['_level']=heightToZoom(_0x27278d),this[_0x562e92(0x776)]=_0x27278d,this['_level'];}get['fixedLight'](){return this['_fixedLight'];}set['fixedLight'](_0x5b6416){const _0x217be0={_0x3fcf9e:0xfc1,_0xe8b33d:0xe95,_0x14c2b8:0x707,_0x17f4d9:0xcb4},_0x288ee8=_0x3d5d32;this['_fixedLight']=_0x5b6416;!this['_sunlight']&&(this['_sunlight']=this[_0x288ee8(_0x217be0._0x3fcf9e)]['light']);if(_0x5b6416){const _0x27bdbb=new Cesium__namespace['DirectionalLight']({'direction':new Cesium__namespace[(_0x288ee8(_0x217be0._0xe8b33d))](0.35492591601301104,-0.8909182691839401,-0.2833588392420772)});this['scene'][_0x288ee8(_0x217be0._0x14c2b8)]=_0x27bdbb;}else this['scene']['light']=this[_0x288ee8(_0x217be0._0x17f4d9)];}get['lang'](){const _0x598e85={_0x3f9a13:0x6b0},_0x5e3ba9=_0x3d5d32;return this[_0x5e3ba9(0x433)][_0x5e3ba9(_0x598e85._0x3f9a13)]||LangType['ZH'];}set['lang'](_0x58fc18){const _0x31ec68={_0x51eb6e:0x6b0},_0x2c3233=_0x3d5d32;this['options'][_0x2c3233(_0x31ec68._0x51eb6e)]=_0x58fc18;}get['zoomFactor'](){return this['scene']['screenSpaceCameraController']['_zoomFactor'];}set['zoomFactor'](_0x1beb74){const _0x5ca23a=_0x3d5d32;this['scene']['screenSpaceCameraController'][_0x5ca23a(0xcd6)]=_0x1beb74;}get['highlightEnabled'](){return this['_highlightEnabled'];}set['highlightEnabled'](_0x4847b6){this['_highlightEnabled']=_0x4847b6,!_0x4847b6&&this['closeHighlight']();}['_createViewer'](_0x1367cf,_0x56e809){const _0x1b1ced={_0x1e2ddf:0x8f2,_0x4e5477:0xe98,_0xe95bfa:0xb30,_0x559297:0x289,_0x2f42dd:0x341,_0x20eb48:0x42a,_0x210a25:0xc14,_0x596fa9:0x9c2,_0x318a58:0xdb7,_0x487291:0xddf,_0x3a08aa:0x38a,_0x163df2:0xa18,_0x58e2a1:0xc84,_0x5cffb2:0x40a},_0x529567=_0x3d5d32;if(!_0x1367cf)throw new Error(_0x529567(_0x1b1ced._0x1e2ddf));const _0x55a22f={...DefaultOptions,..._0x56e809[_0x529567(0x999)]||{},..._0x56e809['scene']||{},'baseLayerPicker':![],'timeline':![]};_0x55a22f['globe']&&!(_0x55a22f['globe']instanceof Cesium__namespace[_0x529567(_0x1b1ced._0x4e5477)])&&delete _0x55a22f['globe'];_0x55a22f['cameraController']&&delete _0x55a22f['cameraController'];_0x55a22f['contextmenu']&&delete _0x55a22f['contextmenu'];_0x55a22f[_0x529567(0x99c)]&&delete _0x55a22f['location'];_0x55a22f['mouseDownView']&&delete _0x55a22f['mouseDownView'];_0x55a22f['navigation']&&delete _0x55a22f[_0x529567(0x7f4)];Cesium__namespace['defined'](_0x55a22f[_0x529567(_0x1b1ced._0xe95bfa)])&&(_0x55a22f['mapProjection']===CRS['EPSG3857']?_0x55a22f['mapProjection']=new Cesium__namespace[(_0x529567(_0x1b1ced._0x559297))](_0x55a22f['ellipsoid']):_0x55a22f['mapProjection']=new Cesium__namespace[(_0x529567(_0x1b1ced._0x2f42dd))](_0x55a22f['ellipsoid']));Cesium__namespace['defined'](_0x55a22f['ellipsoid'])&&(_0x55a22f[_0x529567(0xaa8)]=new Cesium__namespace['Globe'](_0x55a22f['ellipsoid']));if(Cesium__namespace['defined'](_0x55a22f['skyBox'])&&isPlainObject(_0x55a22f[_0x529567(0xc14)]))switch(_0x55a22f['skyBox'][_0x529567(0x7f5)]){case _0x529567(_0x1b1ced._0x20eb48):case'GroundSkyBox':_0x55a22f[_0x529567(_0x1b1ced._0x210a25)]=new GroundSkyBox(_0x55a22f['skyBox']);break;case'multiple':case'MultipleSkyBox':_0x55a22f['skyBox']=new MultipleSkyBox(_0x55a22f['skyBox']);break;default:_0x55a22f['skyBox']=new Cesium__namespace['SkyBox'](_0x55a22f['skyBox']);break;}_0x55a22f['geocoder']==='gaode'&&_0x56e809['lang']===LangType['ZH']&&(_0x55a22f[_0x529567(_0x1b1ced._0x596fa9)]=new GaodePOIGeocoder(_0x55a22f['geocoderConfig']),_0x55a22f['geocoder']['map']=this);let _0x4caa47=![];if(_0x55a22f[_0x529567(0x5f2)]){var _0x31353b;if(!_0x55a22f['imageryProviderViewModels']&&((_0x31353b=_0x56e809[_0x529567(0xf3a)])===null||_0x31353b===void 0x0?void 0x0:_0x31353b[_0x529567(0xc84)])>0x0){const _0x32fa70=getImageryProviderViewModels(_0x56e809['basemaps'],this['options']['templateValues']);_0x55a22f['imageryProviderViewModels']=_0x32fa70[_0x529567(_0x1b1ced._0x318a58)],_0x32fa70['selectedIndex']===-0x1?_0x4caa47=!![]:_0x55a22f['selectedImageryProviderViewModel']=_0x32fa70[_0x529567(0xdb7)][_0x32fa70['selectedIndex']];}if(!_0x55a22f['terrainProviderViewModels']){var _0x432726;_0x55a22f[_0x529567(_0x1b1ced._0x487291)]=getTerrainProviderViewModels(this['_getTerrainOptions']()),_0x55a22f['selectedTerrainProviderViewModel']=_0x55a22f['terrainProviderViewModels'][(_0x432726=_0x56e809['terrain'])!==null&&_0x432726!==void 0x0&&_0x432726['show']?0x1:0x0];}}else _0x55a22f['imageryProvider']==null&&(_0x4caa47=!![],_0x55a22f['baseLayer']=Cesium__namespace['ImageryLayer']['fromProviderAsync'](Cesium__namespace['TileMapServiceImageryProvider']['fromUrl'](Cesium__namespace['buildModuleUrl']('Assets/Textures/NaturalEarthII')))),_0x56e809['terrain']&&_0x56e809['terrain']['show']?this[_0x529567(0x581)]=createTerrainProvider(this[_0x529567(_0x1b1ced._0x3a08aa)]()):_0x55a22f[_0x529567(0x581)]=getNoTerrainProvider();const _0x39bcc=new Cesium__namespace['Viewer'](_0x1367cf,_0x55a22f);if(_0x4caa47){const _0x123a5b=_0x39bcc[_0x529567(_0x1b1ced._0x163df2)],_0x66afcb=_0x123a5b[_0x529567(_0x1b1ced._0x58e2a1)];for(let _0x5695a3=0x0;_0x5695a3<_0x66afcb;_0x5695a3++){const _0x57a61d=_0x123a5b[_0x529567(_0x1b1ced._0x5cffb2)](0x0);_0x123a5b['remove'](_0x57a61d,!![]);}}return _0x39bcc;}[_0x3d5d32(0x857)](_0xf32657){const _0x3d499a={_0x2a93a4:0xefc,_0x66ccab:0x1060},_0x4407ba=_0x3d5d32;this[_0x4407ba(_0x3d499a._0x2a93a4)](EventType[_0x4407ba(_0x3d499a._0x66ccab)],{'data':_0xf32657});}['_terrain_onLoadError'](_0x136094){const _0x2e8061={_0x37fde5:0xefc},_0x3dc0a5=_0x3d5d32;this['hasTerrain']=![],this[_0x3dc0a5(_0x2e8061._0x37fde5)](EventType[_0x3dc0a5(0x1f3)],{'error':_0x136094});}[_0x3d5d32(0x38a)](){const _0x59450a={_0x3fc36f:0x433},_0x190346=_0x3d5d32;if(!this[_0x190346(_0x59450a._0x3fc36f)]['terrain'])return this['options']['terrain'];const _0x166195={'templateValues':this['options']['templateValues'],'marsOptions':{'onLoadSuccess':_0xeb00c9=>{this['_terrain_onLoadSuccess'](_0xeb00c9);},'onLoadError':_0x9f69c4=>{this['_terrain_onLoadError'](_0x9f69c4);}},...this['options']['terrain']};return _0x166195;}['setOptions'](_0x5adce4){const _0x35c917={_0x21ce2b:0x433,_0x516781:0x44d,_0x6adb87:0xdee,_0x2b6065:0x884,_0x49b5a7:0x433,_0x29c3fe:0x999,_0x329a5c:0x792,_0x50a305:0x792,_0x361847:0x945,_0x3fcd78:0xd98,_0x8e3338:0x528},_0x14e4c4=_0x3d5d32;if(!_0x5adce4||Object['keys'](_0x5adce4)[_0x14e4c4(0xc84)]===0x0)return this;this[_0x14e4c4(_0x35c917._0x21ce2b)]=merge(this['options'],_0x5adce4);for(const _0x4f1deb in _0x5adce4){const _0x2b93cd=_0x5adce4[_0x4f1deb];switch(_0x4f1deb){case _0x14e4c4(0xfc1):{this['_sceneOption']['setOptions'](this['options']['scene'],_0x2b93cd);break;}case'mouse':{this['_mouseEvent'][_0x14e4c4(0x945)](this['options']['mouse']);break;}case'terrain':{createTerrainProvider(this['_getTerrainOptions']())[_0x14e4c4(_0x35c917._0x516781)](_0x50e670=>{const _0xb43559=_0x14e4c4;this[_0xb43559(0x581)]=_0x50e670,this['controls']['baseLayerPicker']&&this['controls']['baseLayerPicker']['reload']();});break;}case'basemaps':{this['setBasemapsOptions'](_0x2b93cd);break;}case'layers':{this[_0x14e4c4(0x87e)](_0x2b93cd);break;}case'chinaCRS':{this['chinaCRS']=_0x2b93cd||ChinaCRS[_0x14e4c4(_0x35c917._0x6adb87)];break;}case'lang':{(_0x2b93cd===LangType['ZH']||_0x2b93cd===LangType[_0x14e4c4(_0x35c917._0x2b6065)])&&toChineseBeforeCreate(this[_0x14e4c4(_0x35c917._0x49b5a7)]);break;}case'token':{updateAll(_0x2b93cd);break;}case _0x14e4c4(_0x35c917._0x29c3fe):{for(const _0xe41c71 in _0x2b93cd){const _0x3a1197=this['options'][_0x14e4c4(_0x35c917._0x29c3fe)][_0xe41c71],_0x33ac14=this['_controls'][_0xe41c71];if(_0x33ac14)!_0x3a1197||(_0x3a1197===null||_0x3a1197===void 0x0?void 0x0:_0x3a1197[_0x14e4c4(0xa63)])===![]?(_0x33ac14[_0x14e4c4(_0x35c917._0x329a5c)]=![],_0x33ac14[_0x14e4c4(0xa63)]=![]):(_0x33ac14[_0x14e4c4(_0x35c917._0x50a305)]=!![],_0x33ac14['enabled']=!![],_0x33ac14[_0x14e4c4(_0x35c917._0x361847)]&&_0x3a1197!==!![]&&_0x33ac14['setOptions'](_0x3a1197));else{if(!_0x3a1197||_0x3a1197['enabled']===![])continue;const _0x510ef4=create$1(_0xe41c71,_0x3a1197);_0x510ef4?this['addControl'](_0x510ef4):logWarn(_0x14e4c4(0x70a),_0xe41c71,_0x3a1197);}}break;}case'effect':{for(const _0x6ae256 in _0x2b93cd){const _0x506f12=this['options']['effect'][_0x6ae256],_0x5eb079=this[_0x14e4c4(_0x35c917._0x3fcd78)][_0x6ae256];if(_0x5eb079)!_0x506f12||(_0x506f12===null||_0x506f12===void 0x0?void 0x0:_0x506f12[_0x14e4c4(0xa63)])===![]?_0x5eb079['enabled']=![]:(_0x5eb079['enabled']=!![],_0x5eb079[_0x14e4c4(0x945)]&&_0x5eb079['setOptions'](_0x506f12));else{if(!_0x506f12||_0x506f12['enabled']===![])continue;const _0xf6ae3c=create(_0x6ae256,_0x506f12);_0xf6ae3c&&this[_0x14e4c4(_0x35c917._0x8e3338)](_0xf6ae3c);}}break;}default:{logWarn(_0x14e4c4(0x5a6),_0x2b93cd);break;}}}return this;}['setSceneOptions'](_0x1cb9b3){const _0x298351={_0x176df7:0x433},_0x43b94e=_0x3d5d32;if(!_0x1cb9b3||Object['keys'](_0x1cb9b3)['length']===0x0)return this;return this[_0x43b94e(0x433)]['scene']=merge(this[_0x43b94e(_0x298351._0x176df7)]['scene'],_0x1cb9b3),this['_sceneOption']['setOptions'](this[_0x43b94e(0x433)]['scene'],_0x1cb9b3),this;}['getOptions'](){const _0x19ca8c={_0x520d7a:0x4b7},_0x4fc843=_0x3d5d32;return clone(this['options'],['parent',_0x4fc843(_0x19ca8c._0x520d7a)]);}['getCurrentOptions'](){const _0x1725cb={_0x536ac3:0xc84},_0x22307b=_0x3d5d32,_0x443ab9=this['getOptions']();_0x443ab9[_0x22307b(0xfc1)]['center']=this['getCameraView'](),_0x443ab9['layers']=[];const _0x42615e=this[_0x22307b(0x7d7)]({'basemaps':![]});for(let _0x6eab99=_0x42615e[_0x22307b(_0x1725cb._0x536ac3)]-0x1;_0x6eab99>=0x0;_0x6eab99--){const _0x1784fc=_0x42615e[_0x6eab99];if(_0x1784fc['isPrivate']||_0x1784fc['parent'])continue;_0x443ab9['layers']['push'](_0x1784fc['toJSON']());}return _0x443ab9;}['getDefaultContextMenu'](){return getDefaultContextMenu(this);}['getCenter'](){const _0xfbe9a9=_0x3d5d32;return getCenter(this[_0xfbe9a9(0xfc1)]);}[_0x3d5d32(0x95f)](){const _0x198179={_0x11bd5c:0x3f2,_0x361fcf:0xbd7},_0xbcb8e0=_0x3d5d32,_0xb67514=this[_0xbcb8e0(_0x198179._0x11bd5c)]();if(_0xb67514){const _0x1e6506=Cesium__namespace['Cartesian3'][_0xbcb8e0(_0x198179._0x361fcf)](_0xb67514['toCartesian'](),this['_viewer']['camera']['positionWC']);return _0x1e6506;}else return 0x0;}['getExtent'](_0x35d496){return getExtent(this,_0x35d496);}['getRealAlt'](_0x53b257){const _0x1eae5f=_0x3d5d32;var _0x444d15,_0x4a6e14;if(!((_0x444d15=this['options'][_0x1eae5f(0xfc1)])!==null&&_0x444d15!==void 0x0&&(_0x4a6e14=_0x444d15['globe'])!==null&&_0x4a6e14!==void 0x0&&_0x4a6e14['realAlt']))return _0x53b257;const _0x2d81a5=this['_viewer']['scene'][_0x1eae5f(0xaa8)][_0x1eae5f(0x85d)]||this['_viewer'][_0x1eae5f(0xfc1)]['terrainExaggeration'];if(_0x2d81a5)return _0x53b257/_0x2d81a5;return _0x53b257;}[_0x3d5d32(0x536)](_0x194da8){return expImage(this['_viewer'],_0x194da8);}['setCursor'](_0x2a64d8=''){const _0x5613ac={_0x1d8a18:0x106f},_0x288751=_0x3d5d32;this['_default_cursor']=_0x2a64d8,this['container']['style'][_0x288751(_0x5613ac._0x1d8a18)]=_0x2a64d8;}['_setEditCursor'](_0x2e0e40){const _0x583d51={_0x12bdf9:0x6c2},_0x30fd3b=_0x3d5d32;if(!this[_0x30fd3b(_0x583d51._0x12bdf9)])return;_0x2e0e40?this['container']['style']['cursor']='crosshair':this['container']['style']['cursor']=this[_0x30fd3b(0xfb3)]||'';}['pick3DTileset'](_0x4fec9f){return pick3DTileset(this['scene'],_0x4fec9f);}['pickTilesetLayer'](_0x97845e){const _0x26915a=pick3DTileset(this['scene'],_0x97845e);return _0x26915a?this['getLayerById'](_0x26915a['_mars3d_layerId']):null;}['on'](_0x1992b8,_0x4ebe50,_0x5ca216){const _0x3d02ed=this['_sceneEvent']['on'](_0x1992b8,_0x4ebe50,_0x5ca216||this);return!_0x3d02ed&&super['on'](_0x1992b8,_0x4ebe50,_0x5ca216),this;}['off'](_0x3673c8,_0x3bdb91,_0x33cec9){const _0x4ce4d5={_0x2fd29f:0x826},_0x5246bd=_0x3d5d32,_0xfa38df=this[_0x5246bd(_0x4ce4d5._0x2fd29f)]['off'](_0x3673c8,_0x3bdb91,_0x33cec9||this);return!_0xfa38df&&super['off'](_0x3673c8,_0x3bdb91,_0x33cec9),this;}['listens'](_0x52f09c,_0x54ba9d){const _0x236a89=_0x3d5d32;return this['_sceneEvent']['hasType'](_0x52f09c)?this[_0x236a89(0x826)]['listens'](_0x52f09c):super['listens'](_0x52f09c,_0x54ba9d);}[_0x3d5d32(0xbf7)](){const _0x5c390e={_0x2a7342:0x433,_0x34d7f2:0x433,_0x28db16:0x378,_0x3f59d1:0xcee,_0x1c774e:0xb75,_0x39d0fe:0xc17,_0x510efe:0x792,_0x19918d:0xc84,_0x4f25f8:0xb75,_0x5d917b:0xd00,_0x525bac:0x377,_0x54d9da:0xe77},_0x1ad3bd=_0x3d5d32;this[_0x1ad3bd(_0x5c390e._0x2a7342)][_0x1ad3bd(0xf3a)]=this[_0x1ad3bd(_0x5c390e._0x34d7f2)]['basemaps']||[],this['options'][_0x1ad3bd(_0x5c390e._0x28db16)]=this['options']['layers']||[],this['_layerIdx']=0x1,this[_0x1ad3bd(0xcee)]=[];const _0x45f4cd=this['options']['basemaps'],_0x14cae8=this[_0x1ad3bd(_0x5c390e._0x2a7342)][_0x1ad3bd(0x378)];for(let _0x1e68c5=0x0;_0x1e68c5<_0x45f4cd['length'];_0x1e68c5++){const _0x12bc24=_0x45f4cd[_0x1e68c5];_0x12bc24['id']&&(this[_0x1ad3bd(_0x5c390e._0x3f59d1)]['indexOf'](_0x12bc24['id'])!==-0x1&&(delete _0x12bc24['id'],logWarn('addLayer:图层id存在冲突,已重新赋值id',_0x12bc24)),this['_arrLayerIdx'][_0x1ad3bd(0xb75)](_0x12bc24['id']));}for(let _0x57303f=0x0;_0x57303f<_0x14cae8['length'];_0x57303f++){const _0x4cefbd=_0x14cae8[_0x57303f];_0x4cefbd['id']&&(this['_arrLayerIdx']['indexOf'](_0x4cefbd['id'])!==-0x1&&(delete _0x4cefbd['id'],logWarn(_0x1ad3bd(0xf4c),_0x4cefbd)),this['_arrLayerIdx'][_0x1ad3bd(_0x5c390e._0x1c774e)](_0x4cefbd['id']));}const _0x423067=[],_0x535d36=[];if(!this['_viewer'][_0x1ad3bd(0x5f2)])for(let _0x392497=0x0;_0x392497<_0x45f4cd['length'];_0x392497++){const _0x290724=_0x45f4cd[_0x392497];!_0x290724['name']&&(_0x290724[_0x1ad3bd(0xaed)]='');!_0x290724['id']&&(_0x290724['id']=this['getNextLayerId']());const _0x4220f2=create$2(_0x290724,this['options']['templateValues']);if(!_0x4220f2)continue;_0x4220f2['_hasMapInit']=!![];if(_0x290724[_0x1ad3bd(0x792)]){const _0x24305b=this[_0x1ad3bd(_0x5c390e._0x39d0fe)](_0x4220f2);_0x535d36['push'](_0x24305b);}else delete _0x290724[_0x1ad3bd(_0x5c390e._0x510efe)];this['_optionsBasemapsList'][_0x1ad3bd(0x631)](_0x290724['id'],_0x4220f2),_0x423067[_0x1ad3bd(0xb75)](_0x290724);if(_0x4220f2['hasChildLayer']&&_0x290724[_0x1ad3bd(0x378)])for(let _0x32d513=0x0;_0x32d513<_0x290724['layers'][_0x1ad3bd(_0x5c390e._0x19918d)];_0x32d513++){const _0x52a6f3=_0x290724[_0x1ad3bd(0x378)][_0x32d513];_0x52a6f3['pid']=_0x290724['id'],_0x52a6f3['parent']=_0x4220f2,!_0x52a6f3['id']&&(_0x52a6f3['id']=this['getNextLayerId']()),_0x423067[_0x1ad3bd(_0x5c390e._0x4f25f8)](_0x52a6f3);}}for(let _0x418fe3=0x0;_0x418fe3<_0x14cae8['length'];_0x418fe3++){const _0x2375da=_0x14cae8[_0x418fe3];!_0x2375da['id']&&(_0x2375da['id']=this[_0x1ad3bd(0x947)]());const _0x27ef49=create$2(_0x2375da,this['options']['templateValues']);if(!_0x27ef49)continue;_0x27ef49['_hasMapInit']=!![];if(_0x2375da[_0x1ad3bd(0x792)]){const _0x25e0ea=this['addLayer'](_0x27ef49);_0x535d36['push'](_0x25e0ea);}else delete _0x2375da['show'];this[_0x1ad3bd(0xa3f)]['set'](_0x2375da['id'],_0x27ef49),_0x423067['push'](_0x2375da);if(_0x27ef49[_0x1ad3bd(0x3a4)]&&_0x2375da['layers'])for(let _0x2defd0=0x0;_0x2defd0<_0x2375da['layers']['length'];_0x2defd0++){const _0x539967=_0x2375da['layers'][_0x2defd0];_0x539967['pid']=_0x2375da['id'],_0x539967[_0x1ad3bd(_0x5c390e._0x5d917b)]=_0x27ef49,!_0x539967['id']&&(_0x539967['id']=this[_0x1ad3bd(0x947)]()),_0x423067['push'](_0x539967);}}for(let _0x225854=0x0;_0x225854<_0x423067['length'];_0x225854++){const _0x46611f=_0x423067[_0x225854];let _0x3259cc=Number(_0x46611f['zIndex']);isNaN(_0x3259cc)&&(_0x3259cc=_0x225854);_0x46611f[_0x1ad3bd(_0x5c390e._0x525bac)]=_0x3259cc;const _0x228960=this['_layerList']['get'](_0x46611f['id']);_0x228960&&(_0x228960[_0x1ad3bd(0x377)]=_0x3259cc);}_0x535d36['push'](new Promise((_0x16287b,_0x35a39c)=>{const _0x1e275b=_0x1ad3bd;function _0x5d24cf(_0x19c6f1){_0x19c6f1===0x0&&(this['off'](EventType['tileLoadProgress'],_0x5d24cf),_0x16287b(!![]));}this['on'](EventType[_0x1e275b(0x540)],_0x5d24cf);})),Promise[_0x1ad3bd(_0x5c390e._0x54d9da)](_0x535d36)[_0x1ad3bd(0x44d)](_0x321e3c=>{this['fire'](EventType['load'],{'list':_0x321e3c});});}['setBasemapsOptions'](_0x5d8349,_0x4cb8d6=!![]){const _0x50158a={_0x2d8262:0xc84,_0x46c726:0x55b,_0x2b0d3a:0x3a4},_0x410875={_0x12f106:0x689},_0x1eb8c5=_0x3d5d32;if(!_0x5d8349||_0x5d8349[_0x1eb8c5(_0x50158a._0x2d8262)]===0x0)return;this['options'][_0x1eb8c5(0xf3a)]=_0x5d8349;if(_0x4cb8d6){this[_0x1eb8c5(_0x50158a._0x46c726)]['forEach'](_0x2f9ea7=>{const _0x36697b=_0x1eb8c5;_0x2f9ea7[_0x36697b(_0x410875._0x12f106)]();}),this['_optionsBasemapsList']['removeAll']();for(let _0x249871=0x0;_0x249871<_0x5d8349[_0x1eb8c5(0xc84)];_0x249871++){const _0x54049d=_0x5d8349[_0x249871];!_0x54049d[_0x1eb8c5(0xaed)]&&(_0x54049d['name']='');!_0x54049d['id']&&(_0x54049d['id']=this['getNextLayerId']());let _0x48c17f=Number(_0x54049d['zIndex']);isNaN(_0x48c17f)&&(_0x48c17f=_0x249871);_0x54049d['zIndex']=_0x48c17f;const _0xbd1557=create$2(_0x54049d,this[_0x1eb8c5(0x433)]['templateValues']);if(!_0xbd1557)continue;_0x54049d['show']&&(this['addLayer'](_0xbd1557),_0xbd1557['readyPromise']['then'](function(_0x5f6ac9){const _0x26a444=_0x1eb8c5;_0x5f6ac9['toBottom']&&_0x5f6ac9[_0x26a444(0x927)]();}));this['_optionsBasemapsList']['set'](_0x54049d['id'],_0xbd1557);if(_0xbd1557[_0x1eb8c5(_0x50158a._0x2b0d3a)]&&_0x54049d[_0x1eb8c5(0x378)])for(let _0x170161=0x0;_0x170161<_0x54049d[_0x1eb8c5(0x378)]['length'];_0x170161++){const _0xf79d50=_0x54049d['layers'][_0x170161];_0xf79d50['pid']=_0x54049d['id'],_0xf79d50[_0x1eb8c5(0xd00)]=_0xbd1557,!_0xf79d50['id']&&(_0xf79d50['id']=this['getNextLayerId']());}}}return this['controls']['baseLayerPicker']&&this['controls']['baseLayerPicker']['reload'](),this['_optionsBasemapsList']['values'];}['setLayersOptions'](_0x410f25){const _0x61d800={_0x21a468:0xc84},_0x235794=_0x3d5d32;if(!_0x410f25||_0x410f25[_0x235794(_0x61d800._0x21a468)]===0x0)return;this['_optionsLayersList']['forEach'](_0x547915=>{_0x547915['destroy']();}),this['_optionsLayersList']['removeAll'](),this['options']['layers']=_0x410f25;for(let _0x261a40=0x0;_0x261a40<_0x410f25['length'];_0x261a40++){const _0x328287=_0x410f25[_0x261a40];!_0x328287['id']&&(_0x328287['id']=this['getNextLayerId']());const _0x25aefa=create$2(_0x328287,this['options']['templateValues']);if(!_0x25aefa)continue;_0x328287['show']&&this['addLayer'](_0x25aefa);this['_optionsLayersList'][_0x235794(0x631)](_0x328287['id'],_0x25aefa);if(_0x25aefa['hasChildLayer']&&_0x328287['layers'])for(let _0x1e7402=0x0;_0x1e7402<_0x328287['layers']['length'];_0x1e7402++){const _0x2fd226=_0x328287['layers'][_0x1e7402];_0x2fd226['pid']=_0x328287['id'],_0x2fd226['parent']=_0x25aefa,!_0x2fd226['id']&&(_0x2fd226['id']=this['getNextLayerId']());}}return this['_optionsLayersList']['values'];}['getNextLayerId'](){const _0xd7f749={_0x512ed4:0xcee},_0x228784=_0x3d5d32;while(this[_0x228784(_0xd7f749._0x512ed4)]['indexOf'](this['_layerIdx'])!==-0x1){this['_layerIdx']++;}return this[_0x228784(0xcee)]['push'](this[_0x228784(0x97a)]),this['_layerIdx'];}['addLayer'](_0xa140eb,_0xa00667){const _0x29d969={_0x4c66fb:0xb5d};return new Promise((_0x30bdc5,_0x6ec57c)=>{const _0x266899=_0x4132;if(!_0xa140eb||!_0xa140eb[_0x266899(_0x29d969._0x4c66fb)]){_0x30bdc5(![]);return;}Cesium__namespace['defined'](_0xa00667)&&(_0xa140eb['show']=_0xa00667);if(_0xa140eb['_state']===State['ADDED']){_0x30bdc5(![]);return;}_0xa140eb['_onAdd'](this);const _0x1bc84e=this['_layerList']['get'](_0xa140eb['id']);_0x1bc84e&&_0x1bc84e!==_0xa140eb&&(_0xa140eb['id']=this['getNextLayerId'](),logWarn('addLayer:图层id存在冲突,已重新赋值id',_0xa140eb)),this['_layerList']['set'](_0xa140eb['id'],_0xa140eb),_0xa140eb['readyPromise']['then'](function(_0x2f20ac){_0x30bdc5(!![]);});});}[_0x3d5d32(0xa9e)](_0xcc765f,_0x349ea4){const _0x3a3ac6={_0x59b6af:0x842,_0x5c5de3:0x689},_0x1e42df=_0x3d5d32;if(!_0xcc765f)return this;if(isString(_0xcc765f)||isNumber(_0xcc765f)){_0xcc765f=this['_layerList']['get'](_0xcc765f);if(!_0xcc765f)return this;}if(!_0xcc765f[_0x1e42df(_0x3a3ac6._0x59b6af)])return;return this['_layerList']['remove'](_0xcc765f['id']),_0x349ea4&&_0xcc765f['clear']&&_0xcc765f['clear'](),_0xcc765f['_onRemove'](),_0x349ea4&&(this['_optionsBasemapsList']['remove'](_0xcc765f['id']),this[_0x1e42df(0xa3f)][_0x1e42df(0xf06)](_0xcc765f['id']),_0xcc765f[_0x1e42df(_0x3a3ac6._0x5c5de3)]()),this;}['hasLayer'](_0x1cc958){if(!_0x1cc958)return![];return isObject(_0x1cc958)&&(_0x1cc958=_0x1cc958['id']),this['_layerList']['contains'](_0x1cc958);}['eachLayer'](_0x565ef0,_0x172b9c){const _0x36b987=_0x3d5d32;return this[_0x36b987(0xedf)]['forEach'](_0x565ef0,_0x172b9c||this),this;}[_0x3d5d32(0xc16)](_0xcbe61a,_0x283411){return isObject(_0xcbe61a)&&(_0xcbe61a=_0xcbe61a['id']),this['getLayerByAttr'](_0xcbe61a,_0x283411);}[_0x3d5d32(0x334)](_0x34a43c){const _0x5acd9b=_0x3d5d32;let _0x746a1e=this[_0x5acd9b(0xedf)]['get'](_0x34a43c);if(_0x746a1e)return _0x746a1e;_0x746a1e=this['_optionsLayersList']['get'](_0x34a43c);if(_0x746a1e)return _0x746a1e;_0x746a1e=this['_optionsBasemapsList'][_0x5acd9b(0x40a)](_0x34a43c);if(_0x746a1e)return _0x746a1e;const _0x583347=this['getLayers']({'basemaps':!![],'layers':!![]});for(let _0x349296=0x0,_0x2f9f41=_0x583347['length'];_0x349296<_0x2f9f41;_0x349296++){const _0x92804b=_0x583347[_0x349296];if(_0x92804b['id']===_0x34a43c)return _0x92804b;if(_0x92804b['hasChildLayer']&&_0x92804b['arrLayer'])for(let _0x10a6ca=0x0;_0x10a6ca<_0x92804b['arrLayer']['length'];_0x10a6ca++){const _0x37ef96=_0x92804b['arrLayer'][_0x10a6ca];if(_0x37ef96['id']===_0x34a43c)return _0x37ef96;}}return undefined;}['getLayerByAttr'](_0x3dd661,_0x4276fc){const _0x32b746={_0xa3518b:0x24a},_0x475814=_0x3d5d32;let _0x37b06c=this['_layerList']['getByAttr'](_0x3dd661,_0x4276fc);if(_0x37b06c)return _0x37b06c;_0x37b06c=this['_optionsLayersList'][_0x475814(_0x32b746._0xa3518b)](_0x3dd661,_0x4276fc);if(_0x37b06c)return _0x37b06c;_0x37b06c=this['_optionsBasemapsList']['getByAttr'](_0x3dd661,_0x4276fc);if(_0x37b06c)return _0x37b06c;return undefined;}['getLayersByAttr'](_0x8a0707,_0x552449){const _0x40b1fe=_0x3d5d32,_0x3bdc1d=this[_0x40b1fe(0xedf)]['getListByAttr'](_0x8a0707,_0x552449);let _0x323670=this['_optionsLayersList']['getListByAttr'](_0x8a0707,_0x552449);for(let _0x5b746f=0x0,_0x2bcdd3=_0x323670['length'];_0x5b746f<_0x2bcdd3;_0x5b746f++){const _0x3929cb=_0x323670[_0x5b746f];!this['_layerList']['contains'](_0x3929cb['id'])&&_0x3bdc1d[_0x40b1fe(0xb75)](_0x3929cb);}_0x323670=this[_0x40b1fe(0x55b)]['getListByAttr'](_0x8a0707,_0x552449);for(let _0x5bbf84=0x0,_0x12a328=_0x323670['length'];_0x5bbf84<_0x12a328;_0x5bbf84++){const _0x137abf=_0x323670[_0x5bbf84];!this[_0x40b1fe(0xedf)]['contains'](_0x137abf['id'])&&_0x3bdc1d['push'](_0x137abf);}return _0x3bdc1d;}['getLayers'](_0x3f2c8c={}){const _0x453605={_0x5d8033:0x378,_0x194128:0xc97,_0x4b8b02:0xa3f,_0x49778c:0x1061},_0x26daed={_0x16e485:0xb84,_0x227817:0xf3a,_0x3647d4:0x378,_0x3e0915:0x3f1},_0x3f4a8f=_0x3d5d32;let _0x42185e=[];return _0x3f2c8c['basemaps']&&(_0x42185e=_0x42185e['concat'](this['_optionsBasemapsList']['values'])),_0x3f2c8c[_0x3f4a8f(_0x453605._0x5d8033)]&&(_0x42185e=_0x42185e[_0x3f4a8f(_0x453605._0x194128)](this[_0x3f4a8f(_0x453605._0x4b8b02)]['values'])),_0x3f2c8c['filter']&&(_0x3f2c8c[_0x3f4a8f(0xf3a)]=![],_0x3f2c8c[_0x3f4a8f(0x378)]=![]),this[_0x3f4a8f(0xedf)][_0x3f4a8f(_0x453605._0x49778c)](_0x95a309=>{const _0x4e6b2e=_0x3f4a8f;if(_0x95a309['isPrivate'])return;if(_0x3f2c8c['childs']===![]&&_0x95a309['parent'])return;if(Cesium__namespace[_0x4e6b2e(_0x26daed._0x16e485)](_0x3f2c8c[_0x4e6b2e(_0x26daed._0x227817)])&&this['_optionsBasemapsList']['contains'](_0x95a309['id']))return;if(Cesium__namespace['defined'](_0x3f2c8c[_0x4e6b2e(_0x26daed._0x3647d4)])&&this['_optionsLayersList'][_0x4e6b2e(_0x26daed._0x3e0915)](_0x95a309['id']))return;_0x42185e['push'](_0x95a309);}),_0x42185e;}[_0x3d5d32(0x765)](_0x1f2e24){const _0x2b9885={_0x3aa03e:0x7b1},_0xcd2f7d=_0x3d5d32;if(this[_0xcd2f7d(0x809)]['baseLayerPicker'])return console[_0xcd2f7d(_0x2b9885._0x3aa03e)]('baseLayerPicker打开时,由baseLayerPicker机制决定,无法获取底图图层。'),[];if(_0x1f2e24){const _0x546b9d=[];return this['_optionsBasemapsList']['forEach'](_0x276679=>{const _0x2ad3b8=_0xcd2f7d;if(_0x276679[_0x2ad3b8(0xc8b)])return;_0x546b9d['push'](_0x276679);}),_0x546b9d;}else return this['_optionsBasemapsList']['values'];}[_0x3d5d32(0x28f)](){let _0x48783f=[];return _0x48783f=_0x48783f['concat'](this['getBasemaps'](!![])),this['_optionsLayersList']['forEach'](_0x5492d5=>{_0x5492d5['isTile']&&!_0x5492d5['isPrivate']&&_0x48783f['push'](_0x5492d5);}),this['_layerList']['forEach'](_0x14040f=>{const _0x328a87=_0x4132;if(!_0x14040f['isTile']||_0x14040f['isPrivate'])return;if(this[_0x328a87(0x55b)]['contains'](_0x14040f['id']))return;if(this['_optionsLayersList']['contains'](_0x14040f['id']))return;_0x48783f['push'](_0x14040f);}),_0x48783f;}[_0x3d5d32(0xb79)](){const _0x11645d={_0x5b0c4f:0x809,_0x493f3d:0x1006,_0x55968f:0xe85,_0x4674a1:0xea4,_0x528c1f:0xc1f,_0x2ff6fa:0x6ba},_0x3b2cc6=_0x3d5d32;var _0x396237,_0x21622b,_0x4dea6d;const _0x2106f4=((_0x396237=this['options'])===null||_0x396237===void 0x0?void 0x0:_0x396237['control'])||{};add((_0x21622b=this[_0x3b2cc6(_0x11645d._0x5b0c4f)])===null||_0x21622b===void 0x0?void 0x0:_0x21622b['scene'],this['options']['licenseUrl']),this['_popupMgr']=new PopupMgr(_0x2106f4['popup']),this['_popupMgr']['isPrivate']=!![],this[_0x3b2cc6(0xb7f)](this[_0x3b2cc6(_0x11645d._0x493f3d)]),this[_0x3b2cc6(0x839)]=new TooltipMgr(_0x2106f4['tooltip']),this['_tooltipMgr']['isPrivate']=!![],this[_0x3b2cc6(0xb7f)](this['_tooltipMgr']),this['_contextmenuMgr']=new ContextMenu(_0x2106f4['contextmenu']),this['_contextmenuMgr'][_0x3b2cc6(_0x11645d._0x55968f)]=!![],this['addControl'](this['_contextmenuMgr']);(((_0x4dea6d=_0x2106f4['contextmenu'])===null||_0x4dea6d===void 0x0?void 0x0:_0x4dea6d['hasDefault'])??!![])&&this[_0x3b2cc6(_0x11645d._0x4674a1)](this[_0x3b2cc6(_0x11645d._0x528c1f)]());this['_smallTooltip']=new SmallTooltip(_0x2106f4['smallTooltip']),this['_smallTooltip'][_0x3b2cc6(0xe85)]=!![],this['addControl'](this[_0x3b2cc6(0xfe2)]),this['_keyboardRoam']=new KeyboardRoam({'enabled':![],..._0x2106f4[_0x3b2cc6(0x90b)]||{}}),this[_0x3b2cc6(_0x11645d._0x2ff6fa)]['isPrivate']=!![],this['addControl'](this[_0x3b2cc6(0x6ba)]);for(const _0x41599a in _0x2106f4){const _0x35a46a=_0x2106f4[_0x41599a];if(!_0x35a46a||_0x35a46a[_0x3b2cc6(0xa63)]===![])continue;const _0x2f906a=create$1(_0x41599a,_0x35a46a);_0x2f906a&&this['addControl'](_0x2f906a);}}['addControl'](_0x5ec6ec,_0x28a718){const _0x31c209={_0x53298e:0x7f5,_0x11862e:0x7f5,_0x5cae36:0xb84,_0x23f420:0xe5f,_0x3dba58:0x430},_0x20ab7d=_0x3d5d32;if(!_0x5ec6ec||!_0x5ec6ec['_onAdd'])return this;if(this[_0x20ab7d(0x430)][_0x5ec6ec[_0x20ab7d(_0x31c209._0x53298e)]])return logWarn('地图上已有'+_0x5ec6ec[_0x20ab7d(_0x31c209._0x11862e)]+_0x20ab7d(0x9df)+_0x5ec6ec[_0x20ab7d(_0x31c209._0x11862e)]+'\x20对象\x20',this),this;return Cesium__namespace[_0x20ab7d(_0x31c209._0x5cae36)](_0x28a718)&&(_0x5ec6ec[_0x20ab7d(0xa63)]=_0x28a718),_0x5ec6ec['_onAdd'](this),this[_0x20ab7d(_0x31c209._0x23f420)][_0x20ab7d(0x631)](_0x5ec6ec['id'],_0x5ec6ec),this[_0x20ab7d(_0x31c209._0x3dba58)][_0x5ec6ec['type']]=_0x5ec6ec,this['fire'](EventType['addControl'],{'control':_0x5ec6ec}),this;}['removeControl'](_0x5a6bab,_0x44d3ae){const _0x1f154b={_0x5189e3:0x8f1},_0xecebf1=_0x3d5d32;if(!_0x5a6bab)return this;return this['_controlList']['remove'](_0x5a6bab['id']),delete this['_controls'][_0x5a6bab['type']],_0x5a6bab[_0xecebf1(_0x1f154b._0x5189e3)](),this['fire'](EventType['removeControl'],{'control':_0x5a6bab}),_0x44d3ae&&_0x5a6bab['destroy'](),this;}[_0x3d5d32(0xee3)](_0x3ddd8b){return this['_controlList']['contains']((_0x3ddd8b===null||_0x3ddd8b===void 0x0?void 0x0:_0x3ddd8b['id'])||_0x3ddd8b);}['eachControl'](_0x5abe42,_0x253eb8){const _0x27f0ec={_0x346e77:0x1061},_0x356348=_0x3d5d32;return this['_controlList'][_0x356348(_0x27f0ec._0x346e77)](_0x5abe42,_0x253eb8||this),this;}['getControl'](_0x117901,_0x9f0c0a='type'){return this['_controlList']['getByAttr'](_0x117901,_0x9f0c0a);}['_initEffect'](){const _0x55c328={_0x24b065:0x433},_0x4b5c3b=_0x3d5d32;var _0x1a2fff;const _0x29cd1a=(_0x1a2fff=this[_0x4b5c3b(_0x55c328._0x24b065)])===null||_0x1a2fff===void 0x0?void 0x0:_0x1a2fff['effect'];if(_0x29cd1a)for(const _0x4b095d in _0x29cd1a){const _0x494f2d=_0x29cd1a[_0x4b095d];if(!_0x494f2d||_0x494f2d['enabled']===![])continue;const _0x1ef890=create(_0x4b095d,_0x494f2d);_0x1ef890&&this['addEffect'](_0x1ef890);}}['addEffect'](_0x57ad99){const _0x1d2383={_0x8d3a02:0xd98,_0x2b5447:0x65c,_0x3f7f18:0x7f5,_0x305a4e:0xefc,_0x4ccbde:0x528},_0x581a57=_0x3d5d32;if(!_0x57ad99||!_0x57ad99['_onAdd'])return this;if(this[_0x581a57(_0x1d2383._0x8d3a02)][_0x57ad99[_0x581a57(0x7f5)]]){logError$1(_0x581a57(_0x1d2383._0x2b5447)+_0x57ad99[_0x581a57(_0x1d2383._0x3f7f18)]+'特效,请直接使用\x20map.effects.'+_0x57ad99['type']+'\x20对象\x20',this);return;}this['addThing'](_0x57ad99),this['_effects'][_0x57ad99['type']]=_0x57ad99,this[_0x581a57(_0x1d2383._0x305a4e)](EventType[_0x581a57(_0x1d2383._0x4ccbde)],{'effect':_0x57ad99});}['removeEffect'](_0x2a3904,_0x545089){delete this['_effects'][_0x2a3904['type']],this['fire'](EventType['removeEffect'],{'effect':_0x2a3904}),this['removeThing'](_0x2a3904,_0x545089);}['getEffect'](_0x2f9bdc,_0x4069ef=_0x3d5d32(0x7f5)){return this['getThing'](_0x2f9bdc,_0x4069ef);}['addThing'](_0x426275){const _0x2592d9={_0x1fa4ed:0x27c},_0x9f4980=_0x3d5d32;if(!_0x426275||!_0x426275['_onAdd'])return this;return _0x426275['_onAdd'](this),this[_0x9f4980(_0x2592d9._0x1fa4ed)][_0x9f4980(0x631)](_0x426275['id'],_0x426275),this;}['removeThing'](_0x422293,_0x35a92e){const _0x3dc9fa=_0x3d5d32;if(!_0x422293)return this;return this['_thingList']['remove'](_0x422293['id']),_0x35a92e&&_0x422293['clear']&&_0x422293['clear'](),_0x422293[_0x3dc9fa(0x8f1)](),_0x35a92e&&_0x422293[_0x3dc9fa(0x689)](),this;}['hasThing'](_0x272d41){const _0xd97a07={_0xaea592:0x3f1},_0x3ad473=_0x3d5d32;return this['_thingList'][_0x3ad473(_0xd97a07._0xaea592)]((_0x272d41===null||_0x272d41===void 0x0?void 0x0:_0x272d41['id'])||_0x272d41);}[_0x3d5d32(0x243)](_0x34b1dd,_0x3753f6){return this['_thingList']['forEach'](_0x34b1dd,_0x3753f6||this),this;}[_0x3d5d32(0xf38)](_0x4a8f7d,_0x35ea46){return this['_thingList']['getByAttr'](_0x4a8f7d,_0x35ea46);}['getLangText'](_0x49a8b2){return getLangText(_0x49a8b2,this['lang']);}['zoomIn'](_0x2e134c,_0xd9f434){const _0x4694ba=_0x3d5d32,_0x1e5358=this['_zoomNavigation']['zoomIn'](_0x2e134c,_0xd9f434);return _0x1e5358&&this[_0x4694ba(0xefc)](EventType['zoom'],{'ztype':'zoomIn','relativeAmount':_0x2e134c,'mandatory':_0xd9f434}),_0x1e5358;}['zoomOut'](_0x410325,_0x592f28){const _0x26909b=this['_zoomNavigation']['zoomOut'](_0x410325,_0x592f28);return _0x26909b&&this['fire'](EventType['zoom'],{'ztype':'zoomOut','relativeAmount':_0x410325,'mandatory':_0x592f28}),_0x26909b;}[_0x3d5d32(0x82a)](_0x2d8dd1){const _0x222316={_0x58e1d1:0xf0c,_0x2e1700:0x605,_0x4667ea:0x809},_0x1db687=_0x3d5d32;this['_hasRightTilt']=_0x2d8dd1,_0x2d8dd1?(this['_viewer']['scene']['screenSpaceCameraController']['tiltEventTypes']=[Cesium__namespace['CameraEventType']['RIGHT_DRAG'],Cesium__namespace['CameraEventType']['PINCH'],{'eventType':Cesium__namespace['CameraEventType']['LEFT_DRAG'],'modifier':Cesium__namespace[_0x1db687(0xcb5)]['CTRL']},{'eventType':Cesium__namespace['CameraEventType'][_0x1db687(0x80b)],'modifier':Cesium__namespace['KeyboardEventModifier']['CTRL']}],this['_viewer']['scene']['screenSpaceCameraController']['zoomEventTypes']=[Cesium__namespace['CameraEventType'][_0x1db687(_0x222316._0x58e1d1)],Cesium__namespace['CameraEventType'][_0x1db687(0x7c2)],Cesium__namespace['CameraEventType']['PINCH']]):(this['_viewer']['scene']['screenSpaceCameraController']['tiltEventTypes']=[Cesium__namespace[_0x1db687(_0x222316._0x2e1700)]['MIDDLE_DRAG'],Cesium__namespace['CameraEventType']['PINCH'],{'eventType':Cesium__namespace['CameraEventType']['LEFT_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier']['CTRL']},{'eventType':Cesium__namespace['CameraEventType']['RIGHT_DRAG'],'modifier':Cesium__namespace['KeyboardEventModifier']['CTRL']}],this[_0x1db687(_0x222316._0x4667ea)]['scene']['screenSpaceCameraController'][_0x1db687(0x1ce)]=[Cesium__namespace['CameraEventType']['RIGHT_DRAG'],Cesium__namespace['CameraEventType']['WHEEL'],Cesium__namespace['CameraEventType']['PINCH']]),this['controls']['mouseDownView']&&this['controls']['mouseDownView'][_0x1db687(0x82a)]();}['clearPitchRange'](){const _0x3a032c={_0x4db067:0xfc1,_0x1fa15b:0xccc,_0x5c75d2:0x437,_0x263921:0x997,_0x17b211:0xbb4,_0x51cb39:0x42f},_0x452b28=_0x3d5d32;delete this['_pitch_max'],delete this['_pitch_min'],delete this[_0x452b28(0x44b)],this['_viewer'][_0x452b28(_0x3a032c._0x4db067)][_0x452b28(_0x3a032c._0x1fa15b)]['inertiaSpin']=0.9,this['_viewer'][_0x452b28(0xfc1)]['screenSpaceCameraController'][_0x452b28(_0x3a032c._0x5c75d2)]=0.9,this['off'](EventType['mouseDown'],this[_0x452b28(_0x3a032c._0x263921)],this),this['off'](EventType['mouseUp'],this[_0x452b28(_0x3a032c._0x17b211)],this),this['off'](EventType['mouseMove'],this['_setPitchRange_mouseMoveHandler'],this),this[_0x452b28(0x9e7)](EventType[_0x452b28(_0x3a032c._0x51cb39)],this[_0x452b28(0x615)],this);}['setPitchRange'](_0x4f185b,_0xbd2cdb=-0x5a){const _0x379d7a={_0x27fe7d:0x1022,_0x26363d:0x5e0,_0x29a10a:0x997},_0x9eb10d=_0x3d5d32;this['clearPitchRange'](),this['_viewer']['scene']['screenSpaceCameraController']['inertiaSpin']=0x0,this['_viewer'][_0x9eb10d(0xfc1)]['screenSpaceCameraController']['inertiaTranslate']=0x0,this['_pitch_max']=Cesium__namespace['Math'][_0x9eb10d(0x562)](_0x4f185b),this[_0x9eb10d(_0x379d7a._0x27fe7d)]=Cesium__namespace['Math']['toRadians'](_0xbd2cdb),this['on'](EventType[_0x9eb10d(_0x379d7a._0x26363d)],this[_0x9eb10d(_0x379d7a._0x29a10a)],this),this['on'](EventType['mouseUp'],this['_setPitchRange_rightUpHandler'],this);}['_setPitchRange_rightDownHandler'](_0x4a6583){const _0x1a5c9f={_0x6ab6eb:0xee4},_0x33ee6e=_0x3d5d32;if(this[_0x33ee6e(0x809)][_0x33ee6e(0xfc1)]['mode']!==Cesium__namespace[_0x33ee6e(0xb22)]['SCENE3D'])return;if(this['_viewer']['camera'][_0x33ee6e(_0x1a5c9f._0x6ab6eb)]['height']>this['_viewer'][_0x33ee6e(0xfc1)][_0x33ee6e(0xccc)][_0x33ee6e(0x819)])return;this['_pitch_minHeight']=this['_viewer']['camera']['positionCartographic']['height'],this['on'](EventType['mouseMove'],this[_0x33ee6e(0x5b7)],this),this['on'](EventType[_0x33ee6e(0x588)],this['_setPitchRange_cameraChangedHandler'],this);}['_setPitchRange_rightUpHandler'](_0x57920f){const _0x382560={_0x505d5e:0x9e7,_0x3a12ad:0x314},_0x5eeeae=_0x3d5d32;this['_viewer']['scene']['screenSpaceCameraController']['enableTilt']=!![],this[_0x5eeeae(_0x382560._0x505d5e)](EventType[_0x5eeeae(_0x382560._0x3a12ad)],this['_setPitchRange_mouseMoveHandler'],this),this['off'](EventType['cameraChanged'],this[_0x5eeeae(0x615)],this);}['_setPitchRange_mouseMoveHandler'](_0x41fdc0){const _0x18645e={_0x5a741d:0x809,_0x1dfc3c:0x5cf},_0x2eeb9c=_0x3d5d32;let _0x18ebba=!![];const _0x257ec1=_0x41fdc0['endPosition']['y']<_0x41fdc0['startPosition']['y'];if(_0x257ec1&&this[_0x2eeb9c(_0x18645e._0x5a741d)]['camera']['pitch']>this['_pitch_max'])_0x18ebba=![];else!_0x257ec1&&this['_viewer']['camera'][_0x2eeb9c(_0x18645e._0x1dfc3c)]this['_viewer'][_0x4e25f4(_0x520bef._0xa705db)]['screenSpaceCameraController']['minimumCollisionTerrainHeight'])return;let _0x1f90e1=this['_viewer']['camera']['pitch'];if(_0x1f90e1>this['_pitch_max']||_0x1f90e1this[_0x4e25f4(_0x520bef._0x2e96c)])_0x1f90e1=this[_0x4e25f4(0x104a)];else _0x1f90e1{const _0x1f4d20=_0x4132;if(!_0x3d89ad||_0x3d89ad['lng']===0x0&&_0x3d89ad['lat']===0x0&&_0x3d89ad[_0x1f4d20(_0x24872a._0x12e68b)]===0x0){_0x5e87d6(![]);return;}isNumber(_0x216a98)&&(_0x216a98={'duration':_0x216a98});let _0x56da82=_0x216a98['minHeight']??0x9c4;this[_0x1f4d20(_0x24872a._0x2beb98)]['camera']['positionCartographic'][_0x1f4d20(0x83e)]<_0x56da82&&(_0x56da82=this['_viewer']['camera'][_0x1f4d20(_0x24872a._0x56a96f)]['height']);Cesium__namespace[_0x1f4d20(0xb84)](_0x3d89ad[_0x1f4d20(_0x24872a._0x273095)])&&(_0x56da82=_0x3d89ad[_0x1f4d20(0xd29)]);let _0x5828cc;if(Cesium__namespace[_0x1f4d20(_0x24872a._0x4a7afa)](_0x3d89ad['lng'])&&Cesium__namespace['defined'](_0x3d89ad['lat']))_0x5828cc=Cesium__namespace[_0x1f4d20(0xe95)]['fromDegrees'](_0x3d89ad['lng'],_0x3d89ad['lat'],_0x56da82);else Cesium__namespace['defined'](_0x3d89ad['x'])&&Cesium__namespace[_0x1f4d20(0xb84)](_0x3d89ad['y'])?(Cesium__namespace[_0x1f4d20(0xb84)](_0x3d89ad['z'])&&(_0x56da82=_0x3d89ad['z']),_0x5828cc=Cesium__namespace[_0x1f4d20(_0x24872a._0x27829f)][_0x1f4d20(_0x24872a._0xd2a2bd)](_0x3d89ad['x'],_0x3d89ad['y'],_0x56da82)):_0x5828cc=this[_0x1f4d20(0x809)][_0x1f4d20(_0x24872a._0x3451f4)]['position'];const _0x13c861={..._0x216a98,'destination':_0x5828cc,'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x3d89ad[_0x1f4d20(0xe39)]??0x0),'pitch':Cesium__namespace['Math']['toRadians'](_0x3d89ad['pitch']??-0x5a),'roll':Cesium__namespace['Math']['toRadians'](_0x3d89ad['roll']??0x0)},'complete':()=>{_0x216a98['complete']&&_0x216a98['complete'](),_0x5e87d6(!![]);},'cancel':()=>{_0x216a98['cancel']&&_0x216a98['cancel'](),_0x5e87d6(![]);}};_0x216a98['duration']===0x0?(this['_viewer'][_0x1f4d20(0x435)][_0x1f4d20(0x38d)](_0x13c861),_0x216a98['complete']&&_0x216a98[_0x1f4d20(0x106a)](),_0x5e87d6(!![])):this['_viewer']['camera']['flyTo'](_0x13c861);});}[_0x3d5d32(0xe6b)](_0x730fbe,_0x2c612a){return this['setCameraView'](_0x730fbe,_0x2c612a);}['flyHome'](_0x17e4bb){const _0x5daac1={_0x4e4a57:0xfc1,_0x113109:0x433},_0x2a6414=_0x3d5d32;var _0x1a1be3,_0x5ace0f,_0x29e214,_0x175c7e;if((_0x1a1be3=this['options'])!==null&&_0x1a1be3!==void 0x0&&(_0x5ace0f=_0x1a1be3[_0x2a6414(_0x5daac1._0x4e4a57)])!==null&&_0x5ace0f!==void 0x0&&_0x5ace0f['center'])this['setCameraView'](this[_0x2a6414(0x433)]['scene']['center'],_0x17e4bb);else(_0x29e214=this['options'])!==null&&_0x29e214!==void 0x0&&(_0x175c7e=_0x29e214['scene'])!==null&&_0x175c7e!==void 0x0&&_0x175c7e[_0x2a6414(0x86b)]&&this[_0x2a6414(0x66e)](this[_0x2a6414(_0x5daac1._0x113109)]['scene']['extent'],_0x17e4bb);}['setCameraViewList'](_0x57cc31,_0x4f0fed={}){const _0x4ec96c=_0x3d5d32;this['cancelFlyTo'](),this['_setCameraViewListArr']=_0x57cc31,this['_setCameraViewListOptions']=_0x4f0fed,this['_setCameraViewListState']=!![],this[_0x4ec96c(0xde2)](0x0,_0x4f0fed);}['pauseCameraViewList'](){const _0x46fba2={_0x329c29:0xff6},_0x1dfd64=_0x3d5d32;this[_0x1dfd64(_0x46fba2._0x329c29)]();}['proceedCameraViewList'](){const _0x2d35fd={_0x1e13fa:0xdc6},_0x648bb4=_0x3d5d32;this['_setCameraViewListState']=!![],this['_setCameraViewListItem'](this[_0x648bb4(_0x2d35fd._0x1e13fa)],this['_setCameraViewListOptions']);}[_0x3d5d32(0xde2)](_0x28f16c,_0x15c341){const _0xe74b7f={_0x4904ca:0xd71},_0x454de1=_0x3d5d32,_0x7e2dbe=this;if(!this['_setCameraViewListState']||_0x28f16c<0x0||_0x28f16c>=this['_setCameraViewListArr']['length']){this['_setCameraViewListState']=![];_0x15c341!==null&&_0x15c341!==void 0x0&&_0x15c341[_0x454de1(0x106a)]&&_0x15c341['complete']();return;}this['_setCameraViewListIndex']=_0x28f16c;const _0x5c22d0=this['_setCameraViewListArr'][_0x28f16c];_0x5c22d0['onStart']&&_0x5c22d0['onStart']();let _0x44ec38;this['setCameraView'](_0x5c22d0,{'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],..._0x15c341,'duration':_0x5c22d0['duration'],'complete':function(){const _0x42372d=_0x454de1;_0x5c22d0['onEnd']&&_0x5c22d0[_0x42372d(0x72c)]();const _0x496d70=_0x5c22d0['stop']??0x1;_0x44ec38=setTimeout(()=>{_0x7e2dbe['_setCameraViewListItem'](++_0x28f16c,_0x15c341);},_0x496d70*0x3e8);},'cancle':function(){const _0x1a3bbc=_0x454de1;this[_0x1a3bbc(_0xe74b7f._0x4904ca)]=![],clearTimeout(_0x44ec38),_0x15c341!==null&&_0x15c341!==void 0x0&&_0x15c341['cancel']&&_0x15c341['cancel']();}});}[_0x3d5d32(0xd67)](_0x2af39c,_0x368f63){if(!_0x2af39c)return;return this['_viewer']['flyTo'](_0x2af39c,_0x368f63);}['flyToGraphic'](_0x430ce1,_0x192997={}){const _0x4d4b07={_0x3c398f:0x7c0,_0x73a757:0xc84,_0x2d8bcb:0xded},_0x117823=_0x3d5d32;if(!_0x430ce1||_0x430ce1['length']===0x0)return Promise['resolve'](![]);if(_0x430ce1['flyTo']){var _0x435566;return _0x192997['clampToGround']=(_0x435566=_0x430ce1['style'])===null||_0x435566===void 0x0?void 0x0:_0x435566[_0x117823(_0x4d4b07._0x3c398f)],_0x430ce1['flyTo'](_0x192997);}if(!Array['isArray'](_0x430ce1))return Promise['resolve'](![]);if(_0x430ce1['length']===0x1)return _0x430ce1[0x0]['flyTo'](_0x192997);let _0x15921f;for(let _0x906cd5=0x0,_0x5c6fa3=_0x430ce1[_0x117823(_0x4d4b07._0x73a757)];_0x906cd5<_0x5c6fa3;_0x906cd5++){const _0xcdfb9d=_0x430ce1[_0x906cd5];if(!_0xcdfb9d['getRectangle'])continue;const _0x3f547b=_0xcdfb9d['getRectangle']();if(!Cesium__namespace['defined'](_0x3f547b))continue;_0x15921f?_0x15921f=Cesium__namespace['Rectangle'][_0x117823(_0x4d4b07._0x2d8bcb)](_0x3f547b,_0x15921f):_0x15921f=_0x3f547b;}return this[_0x117823(0x66e)](_0x15921f,_0x192997);}[_0x3d5d32(0x58b)](_0x52d349,_0x4d0bad={}){const _0x4443bc={_0x2e489d:0x629,_0x18cf4e:0xac9,_0x2bf8aa:0x57e,_0x6d9123:0x515},_0x5a4cc0=_0x3d5d32;if(!_0x52d349||_0x52d349['length']===0x0)return Promise['resolve'](![]);if(_0x52d349['length']===0x1)return this[_0x5a4cc0(_0x4443bc._0x2e489d)](_0x52d349[0x0],_0x4d0bad);const _0x1909c2=getRectangle(_0x52d349,!![]);if(!_0x1909c2)return Promise[_0x5a4cc0(_0x4443bc._0x18cf4e)](![]);return _0x1909c2['xmin']===_0x1909c2[_0x5a4cc0(_0x4443bc._0x2bf8aa)]&&_0x1909c2[_0x5a4cc0(0x470)]===_0x1909c2['ymax']||_0x1909c2[_0x5a4cc0(_0x4443bc._0x2bf8aa)]-_0x1909c2['xmin']>0xc8?this['flyToPoint']([_0x1909c2['xmin'],_0x1909c2['ymin'],_0x1909c2['height']],_0x4d0bad):(_0x1909c2['height']=getMaxHeight(_0x52d349),_0x4d0bad['scale']=_0x4d0bad[_0x5a4cc0(_0x4443bc._0x6d9123)]||1.2,this['flyToExtent'](_0x1909c2,_0x4d0bad));}['flyToExtent'](_0x39595b,_0x333d06={}){const _0x38a2ae={_0x1abf85:0x809,_0x4a4473:0xfc1,_0x235189:0xe95},_0x2a1196=_0x3d5d32;_0x39595b instanceof Cesium__namespace['Rectangle']&&(_0x39595b=formatRectangle(_0x39595b));const _0x4a9470=_0x39595b['xmin'],_0x1b0811=_0x39595b['xmax'],_0xfb76ee=_0x39595b[_0x2a1196(0x470)],_0x3ed28d=_0x39595b['ymax'],_0x15413d=(_0x4a9470+_0x1b0811)/0x2,_0x529a05=(_0xfb76ee+_0x3ed28d)/0x2;if(_0x15413d===0x0&&_0x529a05===0x0)return Promise['resolve'](![]);let _0x34a733=_0x39595b[_0x2a1196(0x83e)]??_0x333d06['height']??0x0;if(_0x34a733===0x0){var _0x292303;_0x34a733=getHeight((_0x292303=this[_0x2a1196(_0x38a2ae._0x1abf85)])===null||_0x292303===void 0x0?void 0x0:_0x292303[_0x2a1196(_0x38a2ae._0x4a4473)],Cesium__namespace[_0x2a1196(_0x38a2ae._0x235189)]['fromDegrees'](_0x15413d,_0x529a05));}const _0x4b6db1=Cesium__namespace['Rectangle'][_0x2a1196(0xe69)](_0x4a9470,_0xfb76ee,_0x1b0811,_0x3ed28d),_0x264a00=Math['max'](_0x4b6db1['height'],_0x4b6db1['width']);if(_0x264a00>0x0){var _0x3e7000;_0x333d06['radius']=(_0x333d06['radius']??0x0)+Cesium__namespace['Math']['chordLength'](_0x264a00,(_0x3e7000=this[_0x2a1196(_0x38a2ae._0x1abf85)])===null||_0x3e7000===void 0x0?void 0x0:_0x3e7000['scene']['globe'][_0x2a1196(0x5ac)]['maximumRadius']);}return this['flyToPoint'](new LngLatPoint(_0x15413d,_0x529a05,_0x34a733),_0x333d06);}['flyToPoint'](_0x5c10f4,_0x3e49c5={}){const _0x2dadb3={_0x4ffde0:0xa28,_0x310e6e:0x103e,_0x1de05a:0x435,_0xd7757b:0x2b4,_0x199d7c:0x80d,_0x1f636e:0x7be,_0x4a846e:0xf5d,_0x3c0a86:0x49b,_0x562c0c:0x106a},_0x458cd3={_0x41862b:0x31a},_0x45645e={_0x4a7fb9:0xd29,_0x34bbd3:0x83e,_0x45db81:0xfc1,_0xd6119c:0x7c0};return new Promise((_0x158ccf,_0x4f6ae9)=>{const _0x2a869d=_0x4132;if(!_0x5c10f4){_0x158ccf(![]);return;}_0x5c10f4=LngLatPoint[_0x2a869d(0xce3)](_0x5c10f4);let _0x38f70e=_0x5c10f4[_0x2a869d(0xed4)]();if(_0x3e49c5['clampToGround']){if(this['hasTerrain']){getSurfaceHeight(this['_viewer'][_0x2a869d(0xfc1)],_0x38f70e,{'has3dtiles':!![]})['then'](_0x13680f=>{const _0x581bfd=_0x2a869d;_0x5c10f4[_0x581bfd(_0x45645e._0x4a7fb9)]=_0x13680f[_0x581bfd(_0x45645e._0x34bbd3)]*(this['_viewer'][_0x581bfd(_0x45645e._0x45db81)][_0x581bfd(0xaa8)]['terrainExaggeration']||0x1),delete _0x3e49c5[_0x581bfd(_0x45645e._0xd6119c)],this['flyToPoint'](_0x5c10f4,_0x3e49c5)['then'](_0x2a88b9=>{_0x158ccf(_0x2a88b9);});});return;}else _0x5c10f4['alt']=0x0,_0x38f70e=_0x5c10f4['toCartesian']();}let _0x44130f=_0x3e49c5['radius']||this['getCameraDistance']()||0x64;Cesium__namespace['defined'](_0x3e49c5['scale'])&&_0x3e49c5['scale']>0x0&&(_0x44130f*=_0x3e49c5[_0x2a869d(0x515)]);Cesium__namespace['defined'](_0x3e49c5[_0x2a869d(0xa28)])&&_0x44130f<_0x3e49c5[_0x2a869d(_0x2dadb3._0x4ffde0)]&&(_0x44130f=_0x3e49c5[_0x2a869d(_0x2dadb3._0x4ffde0)]);Cesium__namespace['defined'](_0x3e49c5[_0x2a869d(0x7cb)])&&_0x44130f>_0x3e49c5['maxHeight']&&(_0x44130f=_0x3e49c5['maxHeight']);let _0x2f8209;if(Cesium__namespace['defined'](_0x3e49c5['pitch']))_0x2f8209=Cesium__namespace[_0x2a869d(_0x2dadb3._0x310e6e)]['toRadians'](_0x3e49c5[_0x2a869d(0x5cf)]);else{_0x2f8209=this[_0x2a869d(0x809)][_0x2a869d(_0x2dadb3._0x1de05a)]['pitch'];const _0x11bf4d=Cesium__namespace['Math']['toDegrees'](_0x2f8209);Cesium__namespace['defined'](_0x3e49c5['minPitch'])&&_0x11bf4d<_0x3e49c5['minPitch']&&(_0x2f8209=Cesium__namespace['Math']['toRadians'](_0x3e49c5[_0x2a869d(0xad0)])),Cesium__namespace['defined'](_0x3e49c5['maxPitch'])&&_0x11bf4d>_0x3e49c5[_0x2a869d(0xb93)]&&(_0x2f8209=Cesium__namespace['Math']['toRadians'](_0x3e49c5['maxPitch']));}const _0x221e3a=Cesium__namespace[_0x2a869d(0xb84)](_0x3e49c5['heading'])?Cesium__namespace[_0x2a869d(0x103e)]['toRadians'](_0x3e49c5['heading']):this['_viewer']['camera']['heading'],_0x5470ab=new Cesium__namespace[(_0x2a869d(_0x2dadb3._0xd7757b))](_0x221e3a,_0x2f8209,_0x44130f),_0x382f42=new Cesium__namespace['BoundingSphere'](_0x38f70e,0x0);_0x3e49c5[_0x2a869d(_0x2dadb3._0x199d7c)]===0x0?(this['_viewer'][_0x2a869d(_0x2dadb3._0x1de05a)]['lookAt'](_0x38f70e,_0x5470ab),!_0x3e49c5[_0x2a869d(_0x2dadb3._0x1f636e)]&&!this['_viewer']['trackedEntity']&&this['_viewer']['camera']['lookAtTransform'](Cesium__namespace[_0x2a869d(_0x2dadb3._0x4a846e)][_0x2a869d(_0x2dadb3._0x3c0a86)]),_0x3e49c5['complete']&&_0x3e49c5[_0x2a869d(_0x2dadb3._0x562c0c)](),_0x158ccf(!![])):this[_0x2a869d(0x809)]['camera']['flyToBoundingSphere'](_0x382f42,{..._0x3e49c5,'offset':_0x5470ab,'complete':()=>{_0x3e49c5['complete']&&_0x3e49c5['complete'](),_0x158ccf(!![]);},'cancel':()=>{const _0x533bc3=_0x2a869d;_0x3e49c5['cancel']&&_0x3e49c5[_0x533bc3(_0x458cd3._0x41862b)](),_0x158ccf(![]);}});});}['isFlyAnimation'](){const _0x3f94be=_0x3d5d32;return this[_0x3f94be(0xc33)];}['openFlyAnimation'](_0x116519={}){const _0x59a8ae={_0x3da869:0xa8f},_0x363f42={_0x24c9c1:0xe95},_0x1b6934={_0x1d7b66:0x463},_0x13f567=_0x3d5d32,_0x2197e5=this['_viewer'],_0x37ec2b=_0x116519[_0x13f567(0xe72)]||this[_0x13f567(_0x59a8ae._0x3da869)]();return new Promise((_0x5b98fd,_0xf048e2)=>{const _0xb9d46e={_0x277fe3:0xc53},_0x491776={_0x52e115:0x295},_0x2c93a5=_0x13f567;this[_0x2c93a5(0xc33)]=!![];const _0x56c363=this;function _0x23c555(_0x4b6b18){const _0x4d5ae8=_0x2c93a5;_0x5b98fd(_0x4b6b18),_0x116519['callback']&&_0x116519[_0x4d5ae8(_0x1b6934._0x1d7b66)](_0x4b6b18),_0x56c363[_0x4d5ae8(0xc33)]=![],_0x56c363['openFlyAnimationEndFun']&&(_0x56c363['openFlyAnimationEndFun'](),delete _0x56c363['openFlyAnimationEndFun']);}_0x2197e5['camera']['setView']({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](-85.16,13.71,0x15ef3c0)}),_0x2197e5['camera'][_0x2c93a5(0xd67)]({'destination':Cesium__namespace[_0x2c93a5(_0x363f42._0x24c9c1)]['fromDegrees'](_0x37ec2b['lng'],_0x37ec2b['lat'],0x15ef3c0),'duration':_0x116519['duration1']||0x2,'easingFunction':_0x116519['easingFunction1']||Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':()=>{const _0x59b9b9=_0x2c93a5;let _0x46a0dc=_0x37ec2b['alt']??0x15f90;_0x46a0dc<0x30d40&&_0x37ec2b['pitch']!==-0x5a?(_0x46a0dc=_0x46a0dc*1.2+0x1f40,_0x2197e5['camera']['flyTo']({'destination':Cesium__namespace[_0x59b9b9(0xe95)][_0x59b9b9(0xe69)](_0x37ec2b['lng'],_0x37ec2b[_0x59b9b9(0xd57)],_0x46a0dc),'duration':_0x116519['duration2'],'easingFunction':_0x116519[_0x59b9b9(0x5f6)],'complete':()=>{const _0x4fe8b7=_0x59b9b9;this['setCameraView'](_0x37ec2b,{'duration':_0x116519['duration3']||0x2,'easingFunction':_0x116519[_0x4fe8b7(_0x491776._0x52e115)],'complete':()=>{_0x23c555(!![]);},'cancel':()=>{_0x23c555(![]);}});},'cancel':()=>{_0x23c555(![]);}})):this[_0x59b9b9(_0xb9d46e._0x277fe3)](_0x37ec2b,{'duration':_0x116519['duration3']||0x2,'easingFunction':_0x116519['easingFunction3'],'complete':()=>{_0x23c555(!![]);},'cancel':()=>{_0x23c555(![]);}});},'cancel':()=>{_0x23c555(![]);}});});}[_0x3d5d32(0x599)](_0x2722dc={}){const _0x5d172c={_0x339cd2:0xe95,_0x13bce7:0xe69},_0x1f4e5d=this['_viewer'],_0x49cc25=_0x2722dc['center']||this['getCameraView']({'simplify':![]}),_0xec9c25=(_0x2722dc['duration']??0xa)/0x3;return new Promise((_0x317976,_0x4ef34a)=>{const _0x832972={_0x3ace51:0x435,_0x30b0e8:0xd67,_0x258b02:0xe69,_0x445ab1:0x562},_0x537cd0=_0x4132;_0x1f4e5d['camera']['flyTo']({'destination':Cesium__namespace[_0x537cd0(_0x5d172c._0x339cd2)][_0x537cd0(_0x5d172c._0x13bce7)](_0x49cc25['lng']+0x78,_0x49cc25['lat'],_0x49cc25['alt']),'orientation':{'heading':Cesium__namespace[_0x537cd0(0x103e)]['toRadians'](_0x49cc25['heading']),'pitch':Cesium__namespace[_0x537cd0(0x103e)]['toRadians'](_0x49cc25['pitch']),'roll':Cesium__namespace[_0x537cd0(0x103e)]['toRadians'](_0x49cc25['roll']||0x0)},'duration':_0xec9c25,'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':function(){const _0x420cfc={_0x8f6112:0xd29,_0x46b495:0xe39},_0x28351e=_0x537cd0;_0x1f4e5d[_0x28351e(_0x832972._0x3ace51)][_0x28351e(_0x832972._0x30b0e8)]({'destination':Cesium__namespace['Cartesian3'][_0x28351e(_0x832972._0x258b02)](_0x49cc25['lng']+0xf0,_0x49cc25['lat'],_0x49cc25['alt']),'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x49cc25['heading']),'pitch':Cesium__namespace['Math'][_0x28351e(_0x832972._0x445ab1)](_0x49cc25['pitch']),'roll':Cesium__namespace[_0x28351e(0x103e)]['toRadians'](_0x49cc25['roll']||0x0)},'duration':_0xec9c25,'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':function(){const _0x5d1b9c=_0x28351e;_0x1f4e5d['camera']['flyTo']({'destination':Cesium__namespace['Cartesian3']['fromDegrees'](_0x49cc25['lng'],_0x49cc25[_0x5d1b9c(0xd57)],_0x49cc25[_0x5d1b9c(_0x420cfc._0x8f6112)]),'orientation':{'heading':Cesium__namespace['Math']['toRadians'](_0x49cc25[_0x5d1b9c(_0x420cfc._0x46b495)]),'pitch':Cesium__namespace[_0x5d1b9c(0x103e)][_0x5d1b9c(0x562)](_0x49cc25['pitch']),'roll':Cesium__namespace['Math']['toRadians'](_0x49cc25['roll']||0x0)},'duration':_0xec9c25,'easingFunction':Cesium__namespace['EasingFunction']['LINEAR_NONE'],'complete':function(){_0x317976(!![]);},'cancel':()=>{_0x317976(![]);}});},'cancel':()=>{_0x317976(![]);}});},'cancel':()=>{_0x317976(![]);}});});}['closeHighlight'](_0x477c86){const _0x3df17b={_0x1bad37:0xe05},_0x15dd4d=_0x3d5d32;if((_0x477c86===null||_0x477c86===void 0x0?void 0x0:_0x477c86[_0x15dd4d(0x328)])===this['last_highlighGraphic'])return;this['last_highlighGraphic']&&this['last_highlighGraphic']['closeHighlight']&&this[_0x15dd4d(_0x3df17b._0x1bad37)]['closeHighlight'](),this['_clearLastHighlight']();}['_clearLastHighlight'](){this['last_highlighGraphic']&&(this['last_highlighGraphic']=null),this['outlineEffect']&&(this['outlineEffect']['selected']=[]);}['openHighlight'](_0x25b7c5,_0x2cc7db,_0x90dde9){const _0x584503={_0x5a8963:0x70e},_0x5f4979=_0x3d5d32;if(!this['_highlightEnabled'])return;if(!_0x25b7c5[_0x5f4979(_0x584503._0x5a8963)]){logInfo('该对象暂不支持highlight高亮',_0x25b7c5);return;}this['closeHighlight'](),_0x2cc7db['outlineEffect']?(!this[_0x5f4979(0xeed)]&&(this['outlineEffect']=new OutlineEffect({'eventType':![]}),this['addEffect'](this['outlineEffect'])),this['outlineEffect']['setOptions'](_0x2cc7db),this[_0x5f4979(0xeed)]['selected']=this['mouseEvent']['getPicked'](_0x90dde9)):_0x25b7c5['openHighlight'](_0x2cc7db,![],_0x90dde9===null||_0x90dde9===void 0x0?void 0x0:_0x90dde9['pickedObject']),this['last_highlighGraphic']=_0x25b7c5,this['_viewer']['scene']['requestRender']();}['openPopup'](_0x5d51da,_0x50df55,_0x135623){const _0x2b66c9={_0x3f8477:0x1006},_0x30beac=_0x3d5d32;return this[_0x30beac(_0x2b66c9._0x3f8477)]['open'](_0x5d51da,{'content':_0x50df55,'options':_0x135623}),this;}['closePopup'](){return this['_popupMgr']&&this['_popupMgr']['closeAll'](),this;}['openTooltip'](_0x2fee03,_0x3d1775,_0x49ee9f={}){const _0x44ccb0={_0x3b24b4:0x839,_0x4e4302:0x7b0},_0x1b318d=_0x3d5d32;return this[_0x1b318d(_0x44ccb0._0x3b24b4)][_0x1b318d(_0x44ccb0._0x4e4302)](_0x2fee03,{'content':_0x3d1775,'options':_0x49ee9f,'target':this}),this;}['closeTooltip'](){const _0xefb209=_0x3d5d32;return this['_tooltipMgr']&&this[_0xefb209(0x839)][_0xefb209(0x447)](),this;}['getContextMenu'](){const _0x43f398={_0x52abc6:0xfde},_0x42984a=_0x3d5d32;var _0x5ca9a0;return(_0x5ca9a0=this['_contextmenuConfig'])===null||_0x5ca9a0===void 0x0?void 0x0:_0x5ca9a0[_0x42984a(_0x43f398._0x52abc6)];}[_0x3d5d32(0xea4)](_0x33e157,_0x533260){const _0x3fd62a={_0x4645ef:0xab5},_0x3013de=_0x3d5d32;return this[_0x3013de(_0x3fd62a._0x4645ef)]={'content':_0x33e157,'options':_0x533260},this;}['unbindContextMenu'](){return this['_contextmenuConfig']=null,this;}[_0x3d5d32(0x22f)](_0x3bd57b){const _0x268c6f=_0x3d5d32;return this[_0x268c6f(0xe00)]['open'](_0x3bd57b,this['_contextmenuConfig']),this;}['closeContextMenu'](){const _0x1f92c9=_0x3d5d32;return this[_0x1f92c9(0xe00)]&&this['_contextmenuMgr']['close'](),this;}[_0x3d5d32(0xd86)](_0x5ed2f2,_0x450556){const _0x4d9edd={_0x1be56e:0xfe2},_0x1f5d87=_0x3d5d32;return this[_0x1f5d87(_0x4d9edd._0x1be56e)]['open'](_0x5ed2f2,_0x450556),this;}['closeSmallTooltip'](){const _0x3a9172={_0x1e6164:0x447},_0x1889de=_0x3d5d32;if(!this['_smallTooltip'])return;return this['_smallTooltip'][_0x1889de(_0x3a9172._0x1e6164)](),this;}[_0x3d5d32(0x76d)](_0x5c90d8=!![]){const _0xed3d4b={_0x11e409:0x27c,_0x42f8bc:0xeeb},_0x42a696=_0x3d5d32;this[_0x42a696(_0xed3d4b._0x11e409)]['forEach'](_0x5d4dfd=>{this['removeThing'](_0x5d4dfd,_0x5c90d8);},this,!![]),this['_thingList'][_0x42a696(_0xed3d4b._0x42f8bc)](),this['_controlList']['forEach'](_0x1b3b8b=>{const _0x10bd64=_0x42a696;if(!_0x1b3b8b||_0x1b3b8b['isPrivate'])return;this[_0x10bd64(0x1d4)](_0x1b3b8b,_0x5c90d8);},this,!![]),this['_controlList']['removeAll'](),this[_0x42a696(0xedf)][_0x42a696(0x1061)](_0x16f738=>{const _0x47d8d3=_0x42a696;if(!_0x16f738||_0x16f738[_0x47d8d3(0xe85)])return;this['removeLayer'](_0x16f738,_0x5c90d8);},this,!![]),this['_layerList']['removeAll'](),this['hasTerrain']=![],this['_lights']['removeAll'](),this['_visibilitys']['removeAll'](),this['_controls']={},this['_effects']={};}['destroy'](){const _0x184883={_0x28b278:0x27c,_0x215f40:0x689},_0x5ac3c8=_0x3d5d32;if(!this['_viewer'])return;try{this['_controlList']['destroy']();}catch(_0x5dee7c){logWarn('_controlList.destroy\x20异常',_0x5dee7c);}try{this[_0x5ac3c8(_0x184883._0x28b278)][_0x5ac3c8(0x689)]();}catch(_0x572ac2){logWarn('_thingList.destroy\x20异常',_0x572ac2);}try{this[_0x5ac3c8(0xd90)][_0x5ac3c8(_0x184883._0x215f40)]();}catch(_0x163c16){logWarn('_mouseEvent.destroy\x20异常',_0x163c16);}try{this[_0x5ac3c8(0xedf)][_0x5ac3c8(0x689)]();}catch(_0x112586){logWarn(_0x5ac3c8(0x675),_0x112586);}try{this['_viewer']['destroy']();}catch(_0x4b7a79){logWarn(_0x5ac3c8(0x567),_0x4b7a79);}for(const _0x2c3310 in this){delete this[_0x2c3310];}}}class MapCompare extends BaseControl{get['mapEx'](){const _0x1272f2={_0x2aca99:0x6f3},_0x2dd62b=_0x3d5d32;return this[_0x2dd62b(_0x1272f2._0x2aca99)];}['_mountedHook'](){const _0xd4d32a={_0x23fec0:0x51f,_0x38077b:0x433},_0x5f5d88=_0x3d5d32;this[_0x5f5d88(_0xd4d32a._0x23fec0)]=create$3(_0x5f5d88(0x667),this[_0x5f5d88(_0xd4d32a._0x38077b)]['className']||_0x5f5d88(0xe42));}['_addedHook'](){const _0x4651d9={_0x173e44:0x46a,_0x1ea67f:0x1d1,_0x9a269:0x433,_0x5ebcc9:0x378,_0x197036:0x9c7,_0x477224:0x435},_0x460d04=_0x3d5d32;!this['options'][_0x460d04(_0x4651d9._0x173e44)]&&(this[_0x460d04(_0x4651d9._0x1ea67f)]['container']['firstChild']['style']['width']='50%');let _0x2415e0={...this[_0x460d04(_0x4651d9._0x9a269)]};!_0x2415e0[_0x460d04(0xf3a)]&&!_0x2415e0[_0x460d04(_0x4651d9._0x5ebcc9)]&&(_0x2415e0=merge(_0x2415e0,this['_map']['getCurrentOptions']()),_0x2415e0['control']=_0x2415e0['control']||{},_0x2415e0['control']['baseLayerPicker']=!![],_0x2415e0['control'][_0x460d04(_0x4651d9._0x197036)]=![]),this['_mapEx']=new Map(this['_container'],_0x2415e0),this['_map']['on'](EventType['morphComplete'],this['_morphCompleteHandler'],this),this['_map']['on'](EventType['cameraChanged'],this['_map_extentChangeHandler'],this),this['_map'][_0x460d04(_0x4651d9._0x477224)][_0x460d04(0x9c9)]=0.001,this['_mapEx']['on'](EventType[_0x460d04(0x588)],this['_mapEx_extentChangeHandler'],this),this['_mapEx'][_0x460d04(_0x4651d9._0x477224)]['percentageChanged']=0.001,this[_0x460d04(0x482)]();}['_removedBeforeHook'](){const _0x4633f8={_0x32e263:0x588},_0x42f914=_0x3d5d32;this['_map']['off'](EventType[_0x42f914(0x918)],this['_morphCompleteHandler'],this),this['_map'][_0x42f914(0x9e7)](EventType[_0x42f914(_0x4633f8._0x32e263)],this['_map_extentChangeHandler'],this),this['_mapEx']['off'](EventType[_0x42f914(_0x4633f8._0x32e263)],this['_mapEx_extentChangeHandler'],this),this['_mapEx'][_0x42f914(0x689)](),delete this['_mapEx'];}['_morphCompleteHandler'](_0x463639){const _0x5ce22a={_0x453e5a:0x6e1,_0x17b304:0x7af},_0x3dc752=_0x3d5d32;this['_map'][_0x3dc752(0xfc1)][_0x3dc752(_0x5ce22a._0x453e5a)]===Cesium__namespace[_0x3dc752(0xb22)]['SCENE2D']?this[_0x3dc752(0x6f3)][_0x3dc752(0xfc1)]['screenSpaceCameraController']['enableTilt']=![]:this['_mapEx']['scene']['screenSpaceCameraController'][_0x3dc752(_0x5ce22a._0x17b304)]=!![];}['_map_extentChangeHandler'](_0xe353b4){const _0x5e14da={_0x32514f:0x588},_0x2ce18d={_0x5b75aa:0x588},_0x190f9e=_0x3d5d32;clearTimeout(this[_0x190f9e(0x91f)]),this['_mapEx']['off'](EventType[_0x190f9e(_0x5e14da._0x32514f)],this['_mapEx_extentChangeHandler'],this),this['_updateView'](this['_map'],this[_0x190f9e(0x6f3)]),this['_map_timeTik']=setTimeout(()=>{const _0x15ac90=_0x190f9e;this['_mapEx']['on'](EventType[_0x15ac90(_0x2ce18d._0x5b75aa)],this[_0x15ac90(0x551)],this);},0xa);}['_mapEx_extentChangeHandler'](_0x3d545e){const _0x42f64e={_0x1911a9:0x482,_0x4d6ba1:0x6f3},_0xfe5586=_0x3d5d32;clearTimeout(this['_mapEx_timeTik']),this['_map']['off'](EventType[_0xfe5586(0x588)],this[_0xfe5586(_0x42f64e._0x1911a9)],this),this['_updateView'](this[_0xfe5586(_0x42f64e._0x4d6ba1)],this['_map']),this['_mapEx_timeTik']=setTimeout(()=>{this['_map']['on'](EventType['cameraChanged'],this['_map_extentChangeHandler'],this);},0xa);}[_0x3d5d32(0x5f3)](_0x5b43c5,_0x361fe3){const _0x382847=_0x5b43c5['getCameraView']({'simplify':![]});_0x361fe3['setCameraView'](_0x382847,{'duration':0x0});}}register$1('mapCompare',MapCompare);class OverviewMap extends BaseControl{get['smallMap'](){return this['_smallMap'];}get['center'](){return this['_center'];}['_mountedHook'](){const _0x1f0014={_0x4df16a:0xd0b,_0x498ec0:0xa2a,_0x4a8b2e:0x4eb},_0x45bc43=_0x3d5d32;this['options']['flyToOptions']=this['options']['flyToOptions']||{},this[_0x45bc43(0x51f)]=create$3(_0x45bc43(0x667),_0x45bc43(_0x1f0014._0x4df16a)),this[_0x45bc43(_0x1f0014._0x498ec0)](this['options']['style']||{'right':'10px','top':_0x45bc43(_0x1f0014._0x4a8b2e)});}[_0x3d5d32(0x226)](){const _0x5a3d1f={_0x1a9d54:0xc45},_0x9bb6ba=_0x3d5d32;this[_0x9bb6ba(_0x5a3d1f._0x1a9d54)](),this['_map']['camera'][_0x9bb6ba(0x9c9)]=0.01,this['_map']['on'](EventType['cameraChanged'],this['_map_cameraChanged'],this),this['_map_cameraChanged']();}['_removedHook'](){const _0x23dbf2={_0x3b40c1:0x588,_0x1798ff:0xc37},_0x51fed4=_0x3d5d32;this['_map'][_0x51fed4(0x9e7)](EventType[_0x51fed4(_0x23dbf2._0x3b40c1)],this[_0x51fed4(_0x23dbf2._0x1798ff)],this),this['_smallMap']['destroy'](),delete this['_smallMap'];}[_0x3d5d32(0xc37)](){const _0x2ac84b={_0x3d21ce:0x570},_0x2e276f=_0x3d5d32,_0x261dcf=this[_0x2e276f(0x1d1)]['getExtent']();this['_rectangle']=Cesium__namespace['Rectangle']['fromDegrees'](_0x261dcf['xmin'],_0x261dcf['ymin'],_0x261dcf['xmax'],_0x261dcf['ymax']),this['_center']=Cesium__namespace['Cartographic']['toCartesian'](Cesium__namespace['Rectangle']['center'](this[_0x2e276f(_0x2ac84b._0x3d21ce)])),this['_smallMap']['flyToExtent'](_0x261dcf,{'duration':0x0,'scale':0x2,...this['options']['flyToOptions']}),this['fire'](EventType['change']);}[_0x3d5d32(0xc45)](){const _0xd4f684={_0x3aafe0:0xb22,_0x167f6d:0xfc1,_0x130fc:0x433,_0x23d264:0x756,_0x351aa2:0x470,_0x10ae05:0x57e,_0x461ca8:0x682},_0x2880f0=_0x3d5d32,_0x102733=this['_map']['getExtent'](),_0x2d17db={'scene':{'sceneMode':Cesium__namespace[_0x2880f0(_0xd4f684._0x3aafe0)]['SCENE2D'],'cameraController':{'enableRotate':![],'enableTranslate':![],'enableTilt':![],'enableZoom':![]},...this['options'][_0x2880f0(_0xd4f684._0x167f6d)],'extent':_0x102733},'control':{'contextmenu':{'hasDefault':![]},...this[_0x2880f0(_0xd4f684._0x130fc)]['control']},'basemaps':[{...this[_0x2880f0(0x433)]['basemap'],'show':!![]}],'layers':this['options']['layers']};this['_smallMap']=new Map(this['_container'],_0x2d17db),this['options']['rectangle']&&(this['_rectangle']=Cesium__namespace[_0x2880f0(_0xd4f684._0x23d264)]['fromDegrees'](_0x102733['xmin'],_0x102733[_0x2880f0(_0xd4f684._0x351aa2)],_0x102733[_0x2880f0(_0xd4f684._0x10ae05)],_0x102733['ymax']),this['_extentGraphic']=new RectangleEntity({'rectangle':new Cesium__namespace['CallbackProperty'](_0x1eaf7e=>{return this['_rectangle'];},![]),'style':{'color':_0x2880f0(0xa21),'outline':!![],'outlineWidth':0x1,'outlineColor':'#ff7800',...this['options']['rectangle']}}),this['_smallMap']['graphicLayer'][_0x2880f0(_0xd4f684._0x461ca8)](this['_extentGraphic']));}}register$1('overviewMap',OverviewMap);const icon$1='\x0a\x0a\x20\x20\x0a\x20\x20\x0a\x20\x20\x0a',icon='\x0a\x0a\x20\x20\x0a\x20\x20\x0a';class ClockAnimate extends BaseControl{['_mountedHook'](){this['_container']=create$3('div','mars3d-clockAnimate'),this['_container']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+icon$1+'\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x202017-08-25\x2000:00:00\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20';}['_addedHook'](){const _0x3929ed={_0x5b5289:0x895,_0x3bc201:0x895,_0x4c044a:0x2d6,_0x4a91e6:0x51f,_0x391b3f:0x1d1,_0x28830c:0x32d},_0x37f205={_0x4fba66:0x73d},_0x479565={_0x20acf7:0x1d1,_0x41e377:0x1d1,_0x42b7a5:0xa02,_0x101a35:0x9f4},_0x4ff8ce={_0x4f6f3d:0xefc,_0x3771a1:0x419,_0x2f86c3:0x1d1,_0x3e8e47:0x9f4},_0x240b5b=_0x3d5d32,_0xd0bb43=this['_container'][_0x240b5b(_0x3929ed._0x5b5289)]('#btn-clockAnimate-now');_0xd0bb43['addEventListener']('click',_0x16083e=>{const _0x326559=_0x240b5b;this[_0x326559(0x1d1)]['clock']['currentTime']=Cesium__namespace['JulianDate']['now'](),this['updateStatus'](),this[_0x326559(_0x4ff8ce._0x4f6f3d)](EventType['click'],{'mouseEvent':_0x16083e,'targetType':_0x326559(_0x4ff8ce._0x3771a1),'time':this[_0x326559(_0x4ff8ce._0x2f86c3)][_0x326559(_0x4ff8ce._0x3e8e47)]['currentTime']});});const _0x467d78=this['_container'][_0x240b5b(_0x3929ed._0x3bc201)]('#btn-clockAnimate-start');_0x467d78['addEventListener']('click',_0x4a079c=>{const _0x5e4540=_0x240b5b;this[_0x5e4540(_0x479565._0x20acf7)]['clock'][_0x5e4540(0x4e7)]=!this[_0x5e4540(_0x479565._0x41e377)]['clock']['shouldAnimate'],this['updateStatus'](),this['fire'](EventType['click'],{'mouseEvent':_0x4a079c,'targetType':_0x5e4540(_0x479565._0x42b7a5),'state':this['_map'][_0x5e4540(_0x479565._0x101a35)]['shouldAnimate']});}),this[_0x240b5b(0x9c4)]=_0x467d78,this[_0x240b5b(0x34a)]=this['_container']['querySelector'](_0x240b5b(_0x3929ed._0x4c044a)),this['_containerTime']['addEventListener']('click',_0x1678e8=>{this['fire'](EventType['click'],{'mouseEvent':_0x1678e8,'targetType':'label'});}),this[_0x240b5b(0x32d)]=this[_0x240b5b(_0x3929ed._0x4a91e6)]['querySelector']('#txt-clockAnimate-speed'),this['_containerSpeed'][_0x240b5b(0xd85)]('value',this[_0x240b5b(_0x3929ed._0x391b3f)][_0x240b5b(0x9f4)]['multiplier']),this[_0x240b5b(_0x3929ed._0x28830c)]['addEventListener']('change',_0x4e85d5=>{const _0x4a3e96=_0x240b5b,_0x260113=Number(this['_containerSpeed'][_0x4a3e96(0x1062)]||0x1);!isNaN(_0x260113)&&(this['_map']['clock'][_0x4a3e96(0xe09)]=_0x260113,this[_0x4a3e96(0xefc)](EventType[_0x4a3e96(_0x37f205._0x4fba66)],{'mouseEvent':_0x4e85d5,'speed':_0x260113}));}),setTimeout(()=>{this['_showHook'](!![]);},0x3e8),this['timeTik']=setInterval(()=>{this['clock_onTickHandler']();},0x1f4),this['clock_onTickHandler']();}['_showHook'](_0xff7a74){const _0x1da978={_0x20a5b3:0xb04,_0x3448ff:0xfb5,_0x4413a2:0x51f,_0x2aaba2:0xd92},_0x596fe7=_0x3d5d32;var _0x39da1a;const _0x1051f2=this['_map'][_0x596fe7(_0x1da978._0x20a5b3)]['timeline'],_0x31749f=_0x1051f2===null||_0x1051f2===void 0x0?void 0x0:_0x1051f2['container'];_0x31749f&&(_0x31749f['style'][_0x596fe7(_0x1da978._0x3448ff)]=_0xff7a74?this[_0x596fe7(_0x1da978._0x4413a2)][_0x596fe7(0x8ca)]+0x1+'px':'0');if((_0x39da1a=this[_0x596fe7(0x1d1)]['controls'])!==null&&_0x39da1a!==void 0x0&&_0x39da1a['distanceLegend']){const _0x58728d=_0xff7a74||_0x31749f&&_0x31749f[_0x596fe7(0xdde)][_0x596fe7(_0x1da978._0x2aaba2)]!=='none';this[_0x596fe7(0x1d1)]['controls']['distanceLegend']['setStyle']({'bottom':_0x58728d?_0x596fe7(0x582):'2px'});}}[_0x3d5d32(0x566)](){this['timeTik']&&(clearInterval(this['timeTik']),this['timeTik']=null);}['clock_onTickHandler'](){const _0x1422be={_0x3b4e78:0x1d1},_0x3170f6=_0x3d5d32;this['updateStatus']();const _0x3da14c=Number(this['_containerSpeed']['value']);this['_map']['clock'][_0x3170f6(0xe09)]!==_0x3da14c&&this['_containerSpeed']['setAttribute']('value',this[_0x3170f6(0x1d1)]['clock'][_0x3170f6(0xe09)]);const _0x105e33=Cesium__namespace['JulianDate']['toDate'](this[_0x3170f6(_0x1422be._0x3b4e78)]['clock']['currentTime']);this['_containerTime'][_0x3170f6(0xae5)]=formatDate(_0x105e33,this[_0x3170f6(0x433)]['format']||'yyyy-MM-dd\x20HH:mm:ss');}[_0x3d5d32(0x43a)](){const _0x584bd1={_0x1c06dd:0x4e7,_0xffc6bc:0x2c7,_0x4bdcbd:0x2c7,_0x128531:0x62e,_0x5b03cb:0x9c4,_0x353976:0xae5,_0x342e10:0x6c2},_0xf6d2df=_0x3d5d32;if(this['isAnimate']===this[_0xf6d2df(0x1d1)]['clock'][_0xf6d2df(_0x584bd1._0x1c06dd)])return;this[_0xf6d2df(_0x584bd1._0xffc6bc)]=this['_map']['clock']['shouldAnimate'];this[_0xf6d2df(_0x584bd1._0x4bdcbd)]?(this['_containerBtnStart']['setAttribute']('title','暂停'),this['_containerBtnStart']['innerHTML']=icon$1,this['_containerSpeed']['style']['display']=_0xf6d2df(_0x584bd1._0x128531)):(this['_containerBtnStart'][_0xf6d2df(0xd85)]('title','继续'),this[_0xf6d2df(_0x584bd1._0x5b03cb)][_0xf6d2df(_0x584bd1._0x353976)]=icon,this['_containerSpeed']['style']['display']='none');const _0x3d0789=this['_map']['controls']['timeline'],_0x34fa9a=_0x3d0789===null||_0x3d0789===void 0x0?void 0x0:_0x3d0789[_0xf6d2df(_0x584bd1._0x342e10)];_0x34fa9a&&(_0x34fa9a['style']['left']=this['_container']['offsetWidth']+0x1+'px');}}register$1(_0x3d5d32(0x6b8),ClockAnimate);var index$1={'__proto__':null,'BaseControl':BaseControl,'Animation':Animation,'BaseLayerPicker':BaseLayerPicker,'FullscreenButton':FullscreenButton,'Geocoder':Geocoder,'HomeButton':HomeButton,'NavigationHelpButton':NavigationHelpButton,'ProjectionPicker':ProjectionPicker,'SceneModePicker':SceneModePicker,'Timeline':Timeline,'VRButton':VRButton,'LocationBar':LocationBar,'MouseDownView':MouseDownView,'Zoom':Zoom,'ToolButton':ToolButton,'Compass':Compass,'DistanceLegend':DistanceLegend,'MapSplit':MapSplit,'MapCompare':MapCompare,'OverviewMap':OverviewMap,'ClockAnimate':ClockAnimate};class BaiduPOI{constructor(_0x5220e4={}){const _0x21e323=_0x3d5d32;this['options']=_0x5220e4,this[_0x21e323(0x510)]=0x0,this[_0x21e323(0x53b)]=_0x5220e4['key']||baiduArr,this['_city']=_0x5220e4[_0x21e323(0xe8d)]||'全国';}get['keys'](){return this['_keys'];}set[_0x3d5d32(0xabc)](_0xe8d107){this['_keys']=_0xe8d107;}get['key'](){const _0x42519c=_0x3d5d32,_0x441d17=this['_key_index']++%this[_0x42519c(0x53b)]['length'];return this['_keys'][_0x441d17];}[_0x3d5d32(0xc60)](_0x26e496){const _0x2d9ebe={_0x5284c3:0xa5a,_0x361a99:0x772,_0x29c3a5:0xb32},_0x28aea0=_0x3d5d32,_0x22db01=[];for(let _0x2625d5=0x0;_0x2625d5<_0x26e496['length'];_0x2625d5++){var _0x4ffdec,_0x5ae941;const _0x396f18=_0x26e496[_0x2625d5];let _0x5d02f0=[];_0x396f18['location']&&(_0x5d02f0=gcj2wgs([_0x396f18[_0x28aea0(0x99c)]['lng'],_0x396f18['location'][_0x28aea0(0xd57)]])),_0x22db01['push']({'id':_0x396f18['uid'],'name':_0x396f18['name'],'lng':_0x5d02f0[0x0],'lat':_0x5d02f0[0x1],'type':((_0x4ffdec=_0x396f18[_0x28aea0(_0x2d9ebe._0x5284c3)])===null||_0x4ffdec===void 0x0?void 0x0:_0x4ffdec['tag'])??_0x396f18[_0x28aea0(0x798)],'xzqh':_0x396f18['province']+_0x396f18['city']+(_0x396f18['district']||_0x396f18[_0x28aea0(_0x2d9ebe._0x361a99)]||''),'address':_0x396f18['address'],'tel':_0x396f18[_0x28aea0(0x78a)]||'','detailUrl':(_0x5ae941=_0x396f18[_0x28aea0(0xa5a)])===null||_0x5ae941===void 0x0?void 0x0:_0x5ae941[_0x28aea0(_0x2d9ebe._0x29c3a5)],'info':_0x396f18,'x':_0x5d02f0[0x0],'y':_0x5d02f0[0x1],'detail_info':_0x396f18['detail_info']});}return _0x22db01;}['_getKeywords'](_0x5563ac){if(isString(_0x5563ac))return _0x5563ac['replace'](/ /gm,'$')['replace'](/,/gm,'$');else{if(Array['isArray'](_0x5563ac))return _0x5563ac['join']('$');}return _0x5563ac;}['getAddress'](_0xd29def){const _0x4f665c={_0x5bb0e6:0x5b2,_0x1ac166:0x399},_0x4f8be2={_0x408db9:0x5b2},_0x404c96=_0x3d5d32;if(this[_0x404c96(0x5b2)])return Promise[_0x404c96(0xac9)]();const _0x3af736={'ak':this['key'],'output':'json','language':'zh-CN','coordtype':'wgs84ll','ret_coordtype':'gcj02ll'},_0x355550=LngLatPoint['parse'](_0xd29def['location']);return _0x3af736['location']=_0x355550['lat']+','+_0x355550['lng'],this[_0x404c96(_0x4f665c._0x5bb0e6)]=!![],Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/reverse_geocoding/v3/',...this[_0x404c96(0x433)],'queryParameters':_0x3af736})['then'](_0x536b51=>{const _0x1cfbcc=_0x404c96;this[_0x1cfbcc(_0x4f8be2._0x408db9)]=![];if(_0x536b51['status']!==0x0){console['log']('未查询到相关结果!',_0x536b51);return;}const _0x489667=_0x536b51['result'],_0x366310={'address':_0x489667['formatted_address'],'city':_0x489667[_0x1cfbcc(0x239)],'component':_0x489667[_0x1cfbcc(0xca1)]};return _0xd29def[_0x1cfbcc(0x9de)]&&_0xd29def['success'](_0x366310),_0x366310;})[_0x404c96(_0x4f665c._0x1ac166)](_0x2f641b=>{const _0x51b562=_0x404c96;this[_0x51b562(0x5b2)]=![],logError$1('BaiduPOI\x20请求出错',_0x2f641b),_0xd29def['error']&&_0xd29def['error']('请求出错',_0x2f641b);});}['autoTip'](_0x5a05f3){const _0x4c9ff1={_0x486b8e:0xe8d,_0xf8c8d8:0xc7d,_0xdc1496:0x236,_0x18a592:0x2a6,_0xae80e9:0xac1},_0x2b64ff={_0x1c3de1:0xfd7},_0x3a5cde=_0x3d5d32,_0x4c0778={'ak':this['key'],'output':_0x3a5cde(0xde6),'ret_coordtype':'gcj02ll'};Cesium__namespace[_0x3a5cde(0xb84)](this['_city'])&&(_0x4c0778['region']=this[_0x3a5cde(0x25d)],_0x4c0778['city_limit']=!![]);Cesium__namespace['defined'](_0x5a05f3[_0x3a5cde(_0x4c9ff1._0x486b8e)])&&(_0x4c0778[_0x3a5cde(_0x4c9ff1._0xf8c8d8)]=_0x5a05f3['city'],_0x4c0778['city_limit']=!![]);Cesium__namespace['defined'](_0x5a05f3['citylimit'])&&(_0x4c0778[_0x3a5cde(0x850)]=_0x5a05f3[_0x3a5cde(_0x4c9ff1._0xdc1496)]);_0x5a05f3['text']&&(_0x4c0778['query']=this[_0x3a5cde(_0x4c9ff1._0x18a592)](_0x5a05f3['text']));if(_0x5a05f3['location']){_0x4c0778['coord_type']=0x1;const _0x177950=LngLatPoint['parse'](_0x5a05f3['location']);_0x4c0778['location']=_0x177950['lat']+','+_0x177950['lng'];}return Cesium__namespace['Resource']['fetchJsonp']({'url':_0x3a5cde(_0x4c9ff1._0xae80e9),...this[_0x3a5cde(0x433)],'queryParameters':_0x4c0778})['then'](_0x2a5129=>{const _0x2c770a=_0x3a5cde;if(_0x2a5129[_0x2c770a(_0x2b64ff._0x1c3de1)]!==0x0){console[_0x2c770a(0x7b1)]('未查询到相关结果!',_0x2a5129);return;}const _0x569e53=this[_0x2c770a(0xc60)](_0x2a5129['result']),_0x5271d5={'allcount':_0x2a5129['total'],'count':_0x569e53[_0x2c770a(0xc84)],'list':_0x569e53};return _0x5a05f3['success']&&_0x5a05f3['success'](_0x5271d5),_0x5271d5;})['catch'](_0x1e63cb=>{logError$1('BaiduPOI\x20请求出错',_0x1e63cb),_0x5a05f3['error']&&_0x5a05f3['error']('请求出错',_0x1e63cb);});}['detail'](_0x47f388){const _0x11a4de={_0x214a26:0xde6},_0x2737d6={_0x53a0b6:0x77b},_0xff9ede={_0x188b48:0xc84,_0x5f0dd3:0xfa6},_0x375675=_0x3d5d32,_0x2b42a2={'ak':this['key'],'output':_0x375675(_0x11a4de._0x214a26),'ret_coordtype':'gcj02ll','uid':_0x47f388['id']};return Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/detail','queryParameters':_0x2b42a2,...this['options']})['then'](_0x2885cb=>{const _0x44a374=_0x375675;if(_0x2885cb['status']!==0x0){console['log'](_0x44a374(0xfa6),_0x2885cb);return;}if(!_0x2885cb['pois']||_0x2885cb['pois'][_0x44a374(_0xff9ede._0x188b48)]===0x0){_0x47f388['error']&&_0x47f388['error'](_0x44a374(_0xff9ede._0x5f0dd3),_0x2885cb);return;}const _0x438296=_0x2885cb;return _0x47f388['success']&&_0x47f388['success'](_0x438296),_0x438296;})[_0x375675(0x399)](_0x3b883b=>{const _0x44eecf=_0x375675;logError$1('BaiduPOI\x20请求出错',_0x3b883b),_0x47f388['error']&&_0x47f388[_0x44eecf(_0x2737d6._0x53a0b6)](_0x44eecf(0x9d1),_0x3b883b);});}['query'](_0x49d8fb){const _0x38053c={_0xfcc581:0x7f5,_0x2c7595:0xd61,_0x1f32e9:0x762},_0x853ae4=_0x3d5d32,_0x3e018e=_0x49d8fb['graphic'];if(_0x3e018e){if(_0x3e018e[_0x853ae4(_0x38053c._0xfcc581)]==='rectangle')return _0x49d8fb['polygon']=_0x3e018e['outlineCoordinates'],this['queryPolygon'](_0x49d8fb);else{if(_0x3e018e['type']==='polygon')return _0x49d8fb['polygon']=_0x3e018e['coordinates'],this['queryPolygon'](_0x49d8fb);else return _0x3e018e[_0x853ae4(_0x38053c._0xfcc581)]==='circle'?(_0x49d8fb['location']=_0x3e018e['point'],_0x49d8fb['radius']=_0x3e018e[_0x853ae4(_0x38053c._0x2c7595)],this['queryCircle'](_0x49d8fb)):Promise['resolve'](![]);}}else return _0x49d8fb['polygon']?this['queryPolygon'](_0x49d8fb):this[_0x853ae4(_0x38053c._0x1f32e9)](_0x49d8fb);}[_0x3d5d32(0x762)](_0xb38867){const _0x11e5b0={_0x3abd1d:0xdfc,_0x54bfa8:0xe19,_0x19e8c4:0x850,_0x469327:0xe8d,_0x131d43:0x44d},_0x3c6ed6={_0x53f1a7:0x9de,_0x1fe059:0xb3f,_0x11c0f2:0x762,_0xc7527c:0x76c},_0x30f65b=_0x3d5d32,_0x1aa8a6={'ak':this[_0x30f65b(_0x11e5b0._0x3abd1d)],'output':'json','ret_coordtype':_0x30f65b(_0x11e5b0._0x54bfa8),'scope':0x2,'page_num':_0xb38867['page']||0x0,'page_size':_0xb38867[_0x30f65b(0xc25)]||0x14,'tag':_0xb38867['types']||''};Cesium__namespace['defined'](this['_city'])&&(_0x1aa8a6['region']=this['_city'],_0x1aa8a6[_0x30f65b(_0x11e5b0._0x19e8c4)]=!![]);Cesium__namespace['defined'](_0xb38867['city'])&&(_0x1aa8a6['region']=_0xb38867[_0x30f65b(_0x11e5b0._0x469327)],_0x1aa8a6['city_limit']=!![]);Cesium__namespace['defined'](_0xb38867['citylimit'])&&(_0x1aa8a6[_0x30f65b(_0x11e5b0._0x19e8c4)]=_0xb38867['citylimit']);_0xb38867['text']&&(_0x1aa8a6['query']=this['_getKeywords'](_0xb38867[_0x30f65b(0x76b)]));if(_0xb38867[_0x30f65b(0x99c)]){_0x1aa8a6[_0x30f65b(0xe5b)]=0x1;const _0x4890cc=LngLatPoint['parse'](_0xb38867['location']);_0x1aa8a6['location']=_0x4890cc['lat']+','+_0x4890cc['lng'];}return Cesium__namespace['defined'](_0xb38867['radius'])&&(_0xb38867['radius']>0x4c4b40?delete _0x1aa8a6['location']:_0x1aa8a6['radius']=_0xb38867['radius'],Cesium__namespace['defined'](_0xb38867['radiuslimit'])&&(_0x1aa8a6['radius_limit']=_0xb38867['radiuslimit'])),Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/search',...this['options'],'queryParameters':_0x1aa8a6})[_0x30f65b(_0x11e5b0._0x131d43)](_0x599223=>{const _0x5f2145=_0x30f65b;if(_0x599223[_0x5f2145(0xfd7)]!==0x0){const _0x1c6296='POI\x20请求失败('+_0x599223['status']+'):'+_0x599223['message'];_0xb38867[_0x5f2145(0x77b)]&&_0xb38867[_0x5f2145(0x77b)](_0x1c6296);return;}if(!_0x599223['results']||_0x599223['result_type']==='city_type'||_0x599223['results']['length']===0x0){if(_0xb38867[_0x5f2145(0xb3f)]){const _0x294e2e={'allcount':0x0,'count':0x0,'list':[]};return _0xb38867[_0x5f2145(_0x3c6ed6._0x53f1a7)]&&_0xb38867['success'](_0x294e2e),_0x294e2e;}else return delete _0xb38867['radius'],delete _0xb38867[_0x5f2145(0x99c)],_0xb38867[_0x5f2145(_0x3c6ed6._0x1fe059)]=0x1,this[_0x5f2145(_0x3c6ed6._0x11c0f2)](_0xb38867);}const _0x2fe28e=this['_formatPOIData'](_0x599223['results']),_0x4148e3={'allcount':_0x599223[_0x5f2145(_0x3c6ed6._0xc7527c)],'count':_0x2fe28e['length'],'list':_0x2fe28e};return _0xb38867['success']&&_0xb38867['success'](_0x4148e3),_0x4148e3;})[_0x30f65b(0x399)](_0x16c169=>{const _0x1f2535=_0x30f65b;logError$1('BaiduPOI\x20请求出错',_0x16c169),_0xb38867['error']&&_0xb38867[_0x1f2535(0x77b)]('请求出错',_0x16c169);});}[_0x3d5d32(0xb74)](_0x2d5e30){const _0xe2f852={_0x426d67:0x99c,_0x1a2058:0xd57,_0x31a495:0x399},_0x18a57f={_0x263e9d:0x82f,_0x1c691e:0xc60,_0x2dd967:0xa40,_0x54d130:0xd61,_0x4d4aed:0x9de},_0x277a40=_0x3d5d32,_0x47a985={'ak':this['key'],'output':'json','ret_coordtype':'gcj02ll','scope':0x2,'radius':_0x2d5e30['radius']||0xbb8,'radius_limit':_0x2d5e30['limit'],'page_num':_0x2d5e30['page']||0x0,'page_size':_0x2d5e30[_0x277a40(0xc25)]||0x14,'tag':_0x2d5e30[_0x277a40(0x761)]||''};if(_0x2d5e30['location']){_0x47a985['coord_type']=0x1;const _0x41cd9b=LngLatPoint['parse'](_0x2d5e30['location']);_0x47a985[_0x277a40(_0xe2f852._0x426d67)]=_0x41cd9b[_0x277a40(_0xe2f852._0x1a2058)]+','+_0x41cd9b['lng'];}else logError$1('BaiduPOI:\x20请传入参location数');return _0x2d5e30[_0x277a40(0x76b)]?_0x47a985['query']=this['_getKeywords'](_0x2d5e30['text']):_0x47a985['query']='行政地标',Cesium__namespace['Resource']['fetchJsonp']({'url':'https://api.map.baidu.com/place/v2/search',...this[_0x277a40(0x433)],'queryParameters':_0x47a985})['then'](_0x366e35=>{const _0x3eef0b=_0x277a40;if(_0x366e35[_0x3eef0b(0xfd7)]!==0x0){const _0x18ed4b=_0x3eef0b(_0x18a57f._0x263e9d)+_0x366e35['status']+'):'+_0x366e35['message'];_0x2d5e30['error']&&_0x2d5e30[_0x3eef0b(0x77b)](_0x18ed4b);return;}if(!_0x366e35['results']||_0x366e35[_0x3eef0b(0xff0)]==='city_type'||_0x366e35['results'][_0x3eef0b(0xc84)]===0x0){_0x2d5e30['error']&&_0x2d5e30[_0x3eef0b(0x77b)]('未查询到相关结果!',_0x366e35);return;}const _0x18278a=this[_0x3eef0b(_0x18a57f._0x1c691e)](_0x366e35['results']);let _0x286898;_0x2d5e30['limit']?_0x286898=this[_0x3eef0b(_0x18a57f._0x2dd967)](_0x18278a,_0x2d5e30['location'],_0x47a985[_0x3eef0b(_0x18a57f._0x54d130)]):_0x286898=_0x18278a;const _0x5a1375={'allcount':_0x366e35[_0x3eef0b(0x76c)],'count':_0x286898['length'],'list':_0x286898};return _0x2d5e30['success']&&_0x2d5e30[_0x3eef0b(_0x18a57f._0x4d4aed)](_0x5a1375),_0x5a1375;})[_0x277a40(_0xe2f852._0x31a495)](_0x2bf90a=>{logError$1('BaiduPOI\x20请求出错',_0x2bf90a),_0x2d5e30['error']&&_0x2d5e30['error']('请求出错',_0x2bf90a);});}['_filterPOIData_circle'](_0x57a123,_0x4484eb,_0x4e0554){const _0x38c484=_0x3d5d32;if(!_0x57a123||!_0x4484eb||!_0x4e0554)return _0x57a123;const _0x12a050=_0x4484eb['toCartesian'](),_0x1159bd=[];for(let _0x149bce=0x0;_0x149bce<_0x57a123['length'];_0x149bce++){const _0x7791e0=_0x57a123[_0x149bce],_0x4c97a4=Cesium__namespace['Cartesian3']['fromDegrees'](_0x7791e0['x'],_0x7791e0['y'],_0x4484eb['alt']),_0x82e506=Cesium__namespace[_0x38c484(0xe95)]['distance'](_0x4c97a4,_0x12a050);_0x82e506<_0x4e0554&&_0x1159bd['push'](_0x7791e0);}return _0x1159bd;}[_0x3d5d32(0x721)](_0x398bb0){const _0x4f7f99={_0x391a6c:0xe5b,_0x3f820b:0x99c,_0x551265:0xd61,_0x3340a9:0x1058,_0x449180:0xe8e,_0x1abd0c:0x57e,_0x373a71:0x214,_0x3a71b9:0x413,_0xabc927:0x399},_0x13cb8c={_0x5051e9:0x9d1},_0x1d56dd={_0x202351:0xc6a,_0x3d04bc:0x541,_0x5c360d:0xfa6,_0x16238d:0x9de},_0x384733=_0x3d5d32,_0x2b01cb={'ak':this['key'],'output':'json','ret_coordtype':'gcj02ll','scope':0x2,'radius':_0x398bb0['radius']||0xbb8,'radius_limit':_0x398bb0['limit'],'page_num':_0x398bb0['page']||0x0,'page_size':_0x398bb0['count']||0x14,'tag':_0x398bb0['types']||''},_0x39ed39=_0x398bb0['polygon'];let _0x3ab709=_0x39ed39;if(_0x39ed39['length']===0x2){const _0x74b565=_0x39ed39[0x0][0x0],_0x5f1078=_0x39ed39[0x1][0x0],_0x480981=_0x39ed39[0x0][0x1],_0x412264=_0x39ed39[0x1][0x1],_0x432b33=(_0x74b565+_0x5f1078)/0x2,_0xd606af=(_0x480981+_0x412264)/0x2;_0x3ab709=[[_0x74b565,_0x412264],[_0x74b565,_0x480981],[_0x5f1078,_0x480981],[_0x5f1078,_0x412264],[_0x74b565,_0x412264]],_0x2b01cb[_0x384733(_0x4f7f99._0x391a6c)]=0x1,_0x2b01cb[_0x384733(_0x4f7f99._0x3f820b)]=_0xd606af+','+_0x432b33,_0x2b01cb[_0x384733(_0x4f7f99._0x551265)]=Math['max'](getDistance([[_0x432b33,_0xd606af],_0x39ed39[0x0]]),getDistance([[_0x432b33,_0xd606af],_0x39ed39[0x1]]));}else{const _0x54cb64=getExtentByGeoJSON({'type':'Feature','properties':{},'geometry':{'type':'LineString','coordinates':_0x39ed39}}),_0x514f07=(_0x54cb64['xmin']+_0x54cb64['xmax'])/0x2,_0x11ec34=(_0x54cb64['ymin']+_0x54cb64[_0x384733(_0x4f7f99._0x3340a9)])/0x2;_0x2b01cb['coord_type']=0x1,_0x2b01cb['location']=_0x11ec34+','+_0x514f07,_0x2b01cb['radius']=Math[_0x384733(_0x4f7f99._0x449180)](getDistance([[_0x514f07,_0x11ec34],[_0x54cb64['xmin'],_0x54cb64[_0x384733(0x470)]]]),getDistance([[_0x514f07,_0x11ec34],[_0x54cb64[_0x384733(_0x4f7f99._0x1abd0c)],_0x54cb64['ymax']]]));}return _0x398bb0['text']?_0x2b01cb[_0x384733(0x214)]=this['_getKeywords'](_0x398bb0['text']):_0x2b01cb[_0x384733(_0x4f7f99._0x373a71)]=_0x384733(0xfff),Cesium__namespace[_0x384733(_0x4f7f99._0x3a71b9)][_0x384733(0xcb1)]({'url':_0x384733(0x4a3),'queryParameters':_0x2b01cb,...this[_0x384733(0x433)]})['then'](_0x18078a=>{const _0x4d328f=_0x384733;if(_0x18078a['status']!==0x0){const _0x413a63='POI\x20请求失败('+_0x18078a['status']+'):'+_0x18078a['message'];_0x398bb0['error']&&_0x398bb0['error'](_0x413a63);return;}if(!_0x18078a[_0x4d328f(_0x1d56dd._0x202351)]||_0x18078a['result_type']===_0x4d328f(_0x1d56dd._0x3d04bc)||_0x18078a[_0x4d328f(_0x1d56dd._0x202351)]['length']===0x0){_0x398bb0['error']&&_0x398bb0['error'](_0x4d328f(_0x1d56dd._0x5c360d),_0x18078a);return;}const _0xf5e4ec=this['_formatPOIData'](_0x18078a['results']);let _0x48d121;_0x398bb0[_0x4d328f(0x7d9)]?_0x48d121=this['_filterPOIData_polygon'](_0xf5e4ec,_0x3ab709):_0x48d121=_0xf5e4ec;const _0x4ab854={'allcount':_0x18078a['total'],'count':_0x48d121['length'],'list':_0x48d121};return _0x398bb0[_0x4d328f(_0x1d56dd._0x16238d)]&&_0x398bb0[_0x4d328f(_0x1d56dd._0x16238d)](_0x4ab854),_0x4ab854;})[_0x384733(_0x4f7f99._0xabc927)](_0x1b3ea2=>{const _0x50bdec=_0x384733;logError$1('BaiduPOI\x20请求出错',_0x1b3ea2),_0x398bb0['error']&&_0x398bb0[_0x50bdec(0x77b)](_0x50bdec(_0x13cb8c._0x5051e9),_0x1b3ea2);});}['_filterPOIData_polygon'](_0x17c049,_0xa2ac3a){const _0x2a8c7f={_0x307d88:0xb75},_0x27de1d=_0x3d5d32;if(!_0x17c049||!_0xa2ac3a)return;_0xa2ac3a=_0xa2ac3a['concat']([_0xa2ac3a[0x0]]);const _0x4b48a2={'type':'Polygon','coordinates':[_0xa2ac3a]},_0x279916=[];for(let _0x1fba69=0x0;_0x1fba69<_0x17c049['length'];_0x1fba69++){const _0x2b98e=_0x17c049[_0x1fba69],_0xead0c8={'type':'Feature','geometry':{'type':'Point','coordinates':[_0x2b98e['x'],_0x2b98e['y']]}};booleanPointInPolygon(_0xead0c8,_0x4b48a2)&&_0x279916[_0x27de1d(_0x2a8c7f._0x307d88)](_0x2b98e);}return _0x279916;}}class GaodePOI{constructor(_0x15f653={}){const _0x215ff2=_0x3d5d32;this['options']=_0x15f653,this['_key_index']=0x0,this['_keys']=_0x15f653[_0x215ff2(0xdfc)]||gaodeArr;}get['keys'](){return this['_keys'];}set[_0x3d5d32(0xabc)](_0x4cb23b){this['_keys']=_0x4cb23b;}get[_0x3d5d32(0xdfc)](){const _0x19212e={_0xdf4066:0x53b},_0x434ce7=_0x3d5d32,_0x31061e=this['_key_index']++%this[_0x434ce7(_0x19212e._0xdf4066)]['length'];return this['_keys'][_0x31061e];}['_formatPOIData'](_0x5c30e0){const _0x40e9a7={_0x5209e0:0xdaa},_0x186cba=_0x3d5d32,_0x7959aa=[];for(let _0x5b53bc=0x0;_0x5b53bc<_0x5c30e0['length'];_0x5b53bc++){const _0x2f128b=_0x5c30e0[_0x5b53bc];let _0x23b449=[];_0x2f128b['location']&&_0x2f128b['location']['length']>0x0&&(_0x23b449=gcj2wgs(_0x2f128b['location'][_0x186cba(_0x40e9a7._0x5209e0)](','))),_0x7959aa[_0x186cba(0xb75)]({'id':_0x2f128b['id'],'name':_0x2f128b['name'],'lng':Number(_0x23b449[0x0]),'lat':Number(_0x23b449[0x1]),'type':_0x2f128b['type'],'xzqh':_0x2f128b['pname']+_0x2f128b['cityname']+_0x2f128b[_0x186cba(0xad6)],'address':_0x2f128b['address'],'tel':_0x2f128b['tel']||'','info':_0x2f128b,'x':Number(_0x23b449[0x0]),'y':Number(_0x23b449[0x1])});}return _0x7959aa;}['_getKeywords'](_0x3c04b2){if(isString(_0x3c04b2))return _0x3c04b2['replace'](/ /gm,'|')['replace'](/,/gm,'|');else{if(Array['isArray'](_0x3c04b2))return _0x3c04b2['join']('|');}return _0x3c04b2;}['getAddress'](_0x57d20e){const _0x49aee5={_0x4a4ff9:0x5d8,_0x51e92a:0x99d},_0x24befb={_0x21a62b:0x5b2},_0xd42eca={_0x1680f0:0xd44,_0x49ece0:0x609},_0x422d77=_0x3d5d32;if(this['_getAddress_ing'])return Promise['resolve']();const _0x1bf8f6={'key':this['key'],'output':'json'};_0x57d20e['location']=LngLatPoint['parse'](_0x57d20e['location']);const _0x24deff=wgs2gcj([_0x57d20e['location'][_0x422d77(_0x49aee5._0x4a4ff9)],_0x57d20e['location'][_0x422d77(0xd57)]]);return _0x1bf8f6[_0x422d77(0x99c)]=_0x24deff[0x0]+','+_0x24deff[0x1],this['_getAddress_ing']=!![],Cesium__namespace['Resource']['fetchJsonp']({'url':_0x422d77(_0x49aee5._0x51e92a),...this['options'],'queryParameters':_0x1bf8f6})['then'](_0x1ef2cb=>{const _0x985758=_0x422d77;var _0x17cbc5;this['_getAddress_ing']=![];if(_0x1ef2cb[_0x985758(_0xd42eca._0x1680f0)]!==_0x985758(0x52e)){console['log']('未查询到相关结果!',_0x1ef2cb);return;}const _0x5727d3=_0x1ef2cb['regeocode'],_0x300de8={'address':_0x5727d3[_0x985758(_0xd42eca._0x49ece0)],'city':(_0x17cbc5=_0x5727d3['addressComponent'])===null||_0x17cbc5===void 0x0?void 0x0:_0x17cbc5['adcode'],'component':_0x5727d3['addressComponent']};return _0x57d20e['success']&&_0x57d20e[_0x985758(0x9de)](_0x300de8),_0x300de8;})['catch'](_0x2f78d4=>{const _0x2a0296=_0x422d77;this[_0x2a0296(_0x24befb._0x21a62b)]=![],logError$1('GaodePOI\x20请求出错',_0x2f78d4),_0x57d20e[_0x2a0296(0x77b)]&&_0x57d20e['error']('请求出错',_0x2f78d4);});}[_0x3d5d32(0x504)](_0x111e94){const _0x6bba3c={_0x23de08:0x236},_0xde84de={_0x57ab25:0x397,_0x5a5d76:0x77b},_0x417dcc={_0x4beb4b:0xc25},_0x2b36da=_0x3d5d32,_0x5080da={'key':this['key'],'output':'json'};Cesium__namespace['defined'](_0x111e94[_0x2b36da(0xe8d)])&&(_0x5080da['city']=_0x111e94[_0x2b36da(0xe8d)],_0x5080da['citylimit']=!![]);Cesium__namespace['defined'](_0x111e94['citylimit'])&&(_0x5080da[_0x2b36da(_0x6bba3c._0x23de08)]=_0x111e94['citylimit']);_0x111e94['text']&&(_0x5080da['keywords']=this[_0x2b36da(0x2a6)](_0x111e94['text']));if(_0x111e94[_0x2b36da(0x99c)]){_0x111e94['location']=LngLatPoint['parse'](_0x111e94['location']);const _0x13aa63=wgs2gcj([_0x111e94[_0x2b36da(0x99c)]['lng'],_0x111e94['location']['lat']]);_0x5080da['location']=_0x13aa63[0x0]+','+_0x13aa63[0x1];}return fetchJson({'url':'https://restapi.amap.com/v3/assistant/inputtips','queryParameters':_0x5080da,...this['options']})['then'](_0x222c4d=>{const _0x14a0e8=_0x2b36da;if(!_0x222c4d['tips']){console['log']('未查询到相关结果!',_0x222c4d);return;}const _0x1d7121=this[_0x14a0e8(0xc60)](_0x222c4d[_0x14a0e8(0xb31)]),_0x113ff9={'allcount':_0x222c4d[_0x14a0e8(_0x417dcc._0x4beb4b)],'count':_0x1d7121[_0x14a0e8(0xc84)],'list':_0x1d7121};return _0x111e94['success']&&_0x111e94[_0x14a0e8(0x9de)](_0x113ff9),_0x113ff9;})[_0x2b36da(0x399)](_0x194a41=>{const _0xe84f04=_0x2b36da;logError$1(_0xe84f04(_0xde84de._0x57ab25),_0x194a41),_0x111e94[_0xe84f04(_0xde84de._0x5a5d76)]&&_0x111e94[_0xe84f04(_0xde84de._0x5a5d76)]('请求出错',_0x194a41);});}['detail'](_0x4b76cf){const _0x56423a={_0x5c3acd:0x44d},_0x2c234d={_0x5391ef:0x9a9},_0x87fc1f=_0x3d5d32,_0x56bd44={'key':this['key'],'id':_0x4b76cf['id'],'output':'json'};return fetchJson({'url':'https://restapi.amap.com/v3/place/detail','queryParameters':_0x56bd44,...this['options']})[_0x87fc1f(_0x56423a._0x5c3acd)](_0xa1a5ad=>{const _0x30cad9=_0x87fc1f;if(_0xa1a5ad[_0x30cad9(0xd44)]!=='10000'){const _0x248b3c='POI\x20请求失败('+_0xa1a5ad['infocode']+'):'+_0xa1a5ad['info'];_0x4b76cf['error']&&_0x4b76cf['error'](_0x248b3c);return;}if(!_0xa1a5ad[_0x30cad9(0x9a9)]||_0xa1a5ad['pois'][_0x30cad9(0xc84)]===0x0){_0x4b76cf['error']&&_0x4b76cf['error'](_0x30cad9(0xfa6),_0xa1a5ad);return;}const _0x1eb9c5=_0xa1a5ad[_0x30cad9(_0x2c234d._0x5391ef)][0x0];return _0x4b76cf['success']&&_0x4b76cf[_0x30cad9(0x9de)](_0x1eb9c5),_0x1eb9c5;})[_0x87fc1f(0x399)](_0xb433cd=>{const _0x62afc8=_0x87fc1f;logError$1('GaodePOI\x20请求出错',_0xb433cd),_0x4b76cf['error']&&_0x4b76cf[_0x62afc8(0x77b)](_0x62afc8(0x9d1),_0xb433cd);});}[_0x3d5d32(0x214)](_0x3d5a3e){const _0x4b2f57={_0x9751f0:0x654,_0x18a190:0xbbe},_0x11ce09=_0x3d5d32,_0x3c821a=_0x3d5a3e['graphic'];if(_0x3c821a){if(_0x3c821a[_0x11ce09(0x7f5)]==='rectangle')return _0x3d5a3e['polygon']=_0x3c821a[_0x11ce09(0x649)],this[_0x11ce09(0x721)](_0x3d5a3e);else{if(_0x3c821a['type']==='polygon')return _0x3d5a3e['polygon']=_0x3c821a['coordinates'],this[_0x11ce09(0x721)](_0x3d5a3e);else return _0x3c821a['type']===_0x11ce09(_0x4b2f57._0x9751f0)?(_0x3d5a3e['location']=_0x3c821a[_0x11ce09(_0x4b2f57._0x18a190)],_0x3d5a3e['radius']=_0x3c821a['radius'],this['queryCircle'](_0x3d5a3e)):Promise['resolve']();}}else return _0x3d5a3e['polygon']?this['queryPolygon'](_0x3d5a3e):this['queryText'](_0x3d5a3e);}[_0x3d5d32(0x762)](_0x36e8cb){const _0x15e7d5={_0x542829:0x76b,_0x28e220:0x2a6,_0x721359:0x399},_0x7846ae={_0x6705ca:0x9a9,_0x5cb090:0x77b,_0x364177:0xfa6},_0x420a63=_0x3d5d32,_0x127a4e={'key':this['key'],'output':'json','page':(_0x36e8cb['page']||0x0)+0x1,'offset':_0x36e8cb['count']||0x14,'types':_0x36e8cb['types']||''};return Cesium__namespace['defined'](_0x36e8cb['city'])&&(_0x127a4e['city']=_0x36e8cb[_0x420a63(0xe8d)],_0x127a4e['citylimit']=!![]),Cesium__namespace['defined'](_0x36e8cb['citylimit'])&&(_0x127a4e['citylimit']=_0x36e8cb['citylimit']),_0x36e8cb[_0x420a63(_0x15e7d5._0x542829)]?_0x127a4e['keywords']=this[_0x420a63(_0x15e7d5._0x28e220)](_0x36e8cb['text']):!_0x127a4e['types']&&(_0x127a4e['types']='120000|130000|190000'),fetchJson({'url':'https://restapi.amap.com/v3/place/text','queryParameters':_0x127a4e,...this['options']})[_0x420a63(0x44d)](_0x731d61=>{const _0x5f5df0=_0x420a63;if(_0x731d61['infocode']!=='10000'){const _0xffb870='POI\x20请求失败('+_0x731d61['infocode']+'):'+_0x731d61['info'];_0x36e8cb['error']&&_0x36e8cb['error'](_0xffb870);return;}if(!_0x731d61[_0x5f5df0(_0x7846ae._0x6705ca)]){_0x36e8cb['error']&&_0x36e8cb[_0x5f5df0(_0x7846ae._0x5cb090)](_0x5f5df0(_0x7846ae._0x364177),_0x731d61);return;}const _0x44030b=this[_0x5f5df0(0xc60)](_0x731d61['pois']),_0x3d49cf={'allcount':_0x731d61['count'],'count':_0x44030b['length'],'list':_0x44030b};return _0x36e8cb['success']&&_0x36e8cb['success'](_0x3d49cf),_0x3d49cf;})[_0x420a63(_0x15e7d5._0x721359)](_0x29e9f4=>{const _0x1ec23f=_0x420a63;logError$1('GaodePOI\x20请求出错',_0x29e9f4),_0x36e8cb[_0x1ec23f(0x77b)]&&_0x36e8cb[_0x1ec23f(0x77b)](_0x1ec23f(0x9d1),_0x29e9f4);});}[_0x3d5d32(0xb74)](_0x29bc62){const _0x541b0b={_0x5c12f8:0x93d},_0x4fb232={_0x14b218:0x77b},_0x29f874={_0x585454:0xd44,_0x3c22cc:0xa40,_0x5cbf84:0x9de},_0x3c259a=_0x3d5d32,_0x5d8dd0={'output':'json','key':this['key'],'radius':_0x29bc62['radius']||0xbb8,'page':(_0x29bc62[_0x3c259a(0xc4c)]||0x0)+0x1,'offset':_0x29bc62[_0x3c259a(0xc25)]||0x14,'types':_0x29bc62['types']||''};if(_0x29bc62['location']){_0x29bc62['location']=LngLatPoint['parse'](_0x29bc62['location']);const _0x548fd4=wgs2gcj([_0x29bc62['location']['lng'],_0x29bc62['location']['lat']]);_0x5d8dd0['location']=_0x548fd4[0x0]+','+_0x548fd4[0x1];}else logError$1('GaodePOI:\x20请传入参location数');return _0x29bc62[_0x3c259a(0x76b)]?_0x5d8dd0['keywords']=this[_0x3c259a(0x2a6)](_0x29bc62[_0x3c259a(0x76b)]):!_0x5d8dd0['types']&&(_0x5d8dd0[_0x3c259a(0x761)]='120000|130000|190000'),fetchJson({'url':_0x3c259a(_0x541b0b._0x5c12f8),'queryParameters':_0x5d8dd0,...this['options']})['then'](_0x54af33=>{const _0xb16ff7=_0x3c259a;if(_0x54af33['infocode']!=='10000'){if(_0x29bc62['error']){const _0x2c64b9='POI\x20请求失败('+_0x54af33[_0xb16ff7(_0x29f874._0x585454)]+'):'+_0x54af33['info'];_0x29bc62['error'](_0x2c64b9);}return;}if(!_0x54af33['pois']){_0x29bc62['error']&&_0x29bc62['error']('未查询到相关结果!',_0x54af33);return;}const _0x4286d9=this['_formatPOIData'](_0x54af33['pois']);let _0x38b146;_0x29bc62['limit']?_0x38b146=this[_0xb16ff7(_0x29f874._0x3c22cc)](_0x4286d9,_0x29bc62['location'],_0x5d8dd0['radius']):_0x38b146=_0x4286d9;const _0x3d49fc={'allcount':_0x54af33['count'],'count':_0x38b146['length'],'list':_0x38b146};return _0x29bc62[_0xb16ff7(0x9de)]&&_0x29bc62[_0xb16ff7(_0x29f874._0x5cbf84)](_0x3d49fc),_0x3d49fc;})['catch'](_0x57dfbc=>{const _0x4eb143=_0x3c259a;logError$1('GaodePOI\x20请求出错',_0x57dfbc),_0x29bc62[_0x4eb143(_0x4fb232._0x14b218)]&&_0x29bc62['error']('请求出错',_0x57dfbc);});}[_0x3d5d32(0xa40)](_0x3d4029,_0x54b29a,_0x3581ee){const _0x57dbb6=_0x3d5d32;if(!_0x3d4029||!_0x54b29a||!_0x3581ee)return _0x3d4029;const _0x44c37a=_0x54b29a['toCartesian'](),_0x280c27=[];for(let _0x1710e6=0x0;_0x1710e6<_0x3d4029['length'];_0x1710e6++){const _0x59ec68=_0x3d4029[_0x1710e6],_0x1a6d3e=Cesium__namespace[_0x57dbb6(0xe95)]['fromDegrees'](_0x59ec68['x'],_0x59ec68['y'],_0x54b29a['alt']),_0x4f3372=Cesium__namespace['Cartesian3']['distance'](_0x1a6d3e,_0x44c37a);_0x4f3372<_0x3581ee&&_0x280c27['push'](_0x59ec68);}return _0x280c27;}['queryPolygon'](_0xdb54d7){const _0x274a4e={_0x41a5d7:0xc25,_0x17e743:0xc84,_0x47894f:0x104e,_0x381e00:0x76b,_0x5f019d:0x761,_0xce9b4a:0x399},_0x5ca153={_0x51dfdc:0x77b,_0x826f:0x5cd},_0x455e73=_0x3d5d32,_0x8857c7={'key':this['key'],'output':'json','page':(_0xdb54d7['page']||0x0)+0x1,'offset':_0xdb54d7[_0x455e73(_0x274a4e._0x41a5d7)]||0x14,'types':_0xdb54d7['types']||''},_0x62aad4=_0xdb54d7['polygon'];let _0x75b9f9=[];if(_0x62aad4['length']===0x2){const _0x2403a3=wgs2gcj(_0x62aad4[0x0]),_0x46d157=wgs2gcj(_0x62aad4[0x1]);_0x8857c7[_0x455e73(0x104e)]=_0x2403a3[0x0]+','+_0x2403a3[0x1]+'|'+_0x46d157[0x0]+','+_0x46d157[0x1],_0x75b9f9=[_0x62aad4[0x0],[_0x62aad4[0x0][0x0],_0x62aad4[0x1][0x1]],_0x62aad4[0x1],[_0x62aad4[0x1][0x0],_0x62aad4[0x0][0x1]]];}else{_0x75b9f9=_0x62aad4;let _0x2b336f='';const _0x428410=_0x62aad4['concat']([_0x62aad4[0x0]]);for(let _0x183f65=0x0;_0x183f65<_0x428410[_0x455e73(_0x274a4e._0x17e743)];_0x183f65++){const _0x5c1eab=wgs2gcj(_0x428410[_0x183f65]);_0x183f65===_0x428410['length']-0x1?_0x2b336f+=_0x5c1eab[0x0]+','+_0x5c1eab[0x1]:_0x2b336f+=_0x5c1eab[0x0]+','+_0x5c1eab[0x1]+'|';}_0x8857c7[_0x455e73(_0x274a4e._0x47894f)]=_0x2b336f;}return _0xdb54d7['text']?_0x8857c7['keywords']=this['_getKeywords'](_0xdb54d7[_0x455e73(_0x274a4e._0x381e00)]):!_0x8857c7[_0x455e73(_0x274a4e._0x5f019d)]&&(_0x8857c7['types']='120000|130000|190000'),fetchJson({'url':'https://restapi.amap.com/v3/place/polygon','queryParameters':_0x8857c7,...this['options']})['then'](_0x24946e=>{const _0x5b445b=_0x455e73;if(_0x24946e['infocode']!=='10000'){if(_0xdb54d7[_0x5b445b(_0x5ca153._0x51dfdc)]){const _0xc04bda='POI\x20请求失败('+_0x24946e[_0x5b445b(0xd44)]+'):'+_0x24946e['info'];_0xdb54d7['error'](_0xc04bda);}return;}if(!_0x24946e['pois']){_0xdb54d7[_0x5b445b(0x77b)]&&_0xdb54d7['error'](_0x5b445b(0xfa6),_0x24946e);return;}const _0x31a9a7=this['_formatPOIData'](_0x24946e['pois']);let _0x5f48d6;_0xdb54d7['limit']?_0x5f48d6=this[_0x5b445b(_0x5ca153._0x826f)](_0x31a9a7,_0x75b9f9):_0x5f48d6=_0x31a9a7;const _0x520748={'allcount':_0x24946e['count'],'count':_0x5f48d6['length'],'list':_0x5f48d6};return _0xdb54d7['success']&&_0xdb54d7['success'](_0x520748),_0x520748;})[_0x455e73(_0x274a4e._0xce9b4a)](_0x57b005=>{const _0x14eba6=_0x455e73;logError$1('GaodePOI\x20请求出错',_0x57b005),_0xdb54d7['error']&&_0xdb54d7[_0x14eba6(0x77b)]('请求出错',_0x57b005);});}['_filterPOIData_polygon'](_0x504229,_0x1b810f){const _0x2a22fc={_0x3e2645:0x5fc,_0x382e34:0xb75},_0x1bb385=_0x3d5d32;if(!_0x504229||!_0x1b810f)return;_0x1b810f=_0x1b810f['concat']([_0x1b810f[0x0]]);const _0x583f30={'type':'Polygon','coordinates':[_0x1b810f]},_0x36f100=[];for(let _0x46c5fe=0x0;_0x46c5fe<_0x504229['length'];_0x46c5fe++){const _0x6578df=_0x504229[_0x46c5fe],_0x43611e={'type':_0x1bb385(_0x2a22fc._0x3e2645),'geometry':{'type':'Point','coordinates':[_0x6578df['x'],_0x6578df['y']]}};booleanPointInPolygon(_0x43611e,_0x583f30)&&_0x36f100[_0x1bb385(_0x2a22fc._0x382e34)](_0x6578df);}return _0x36f100;}}class TdtPOI{constructor(_0x322041={}){const _0x1fd997={_0x1e8902:0x510},_0x4a725f=_0x3d5d32;this[_0x4a725f(0x433)]=_0x322041,this[_0x4a725f(_0x1fd997._0x1e8902)]=0x0,this['_keys']=_0x322041[_0x4a725f(0xdfc)]||tiandituArr;}get[_0x3d5d32(0xabc)](){return this['_keys'];}set['keys'](_0x558991){this['_keys']=_0x558991;}get[_0x3d5d32(0xdfc)](){const _0xeb9c09=_0x3d5d32,_0x8baa71=this['_key_index']++%this[_0xeb9c09(0x53b)]['length'];return this[_0xeb9c09(0x53b)][_0x8baa71];}[_0x3d5d32(0xc60)](_0x35b9c5){const _0x2eb785={_0x2b8ec9:0xc84,_0x2ff750:0xdaa},_0xd2c74c=_0x3d5d32,_0x5ef149=[];for(let _0x1c5b1a=0x0;_0x1c5b1a<_0x35b9c5[_0xd2c74c(_0x2eb785._0x2b8ec9)];_0x1c5b1a++){const _0x290594=_0x35b9c5[_0x1c5b1a];let _0x1e988c=[];_0x290594['lonlat']&&_0x290594['lonlat']['length']>0x0&&(_0x1e988c=_0x290594['lonlat'][_0xd2c74c(_0x2eb785._0x2ff750)](',')),_0x5ef149[_0xd2c74c(0xb75)]({'id':_0x290594['hotPointID'],'name':_0x290594['name'],'lng':Number(_0x1e988c[0x0]),'lat':Number(_0x1e988c[0x1]),'type':_0x290594['typeName'],'xzqh':_0x290594['province']+_0x290594['city']+_0x290594['county'],'address':_0x290594['address'],'tel':_0x290594['phone']||'','info':_0x290594,'x':Number(_0x1e988c[0x0]),'y':Number(_0x1e988c[0x1])});}return _0x5ef149;}['_getKeywords'](_0x509365){const _0x21784a=_0x3d5d32;if(isString(_0x509365))return _0x509365['replace'](/ /gm,'|')[_0x21784a(0xbb6)](/,/gm,'|');else{if(Array['isArray'](_0x509365))return _0x509365['join']('|');}return _0x509365;}['getAddress'](_0xcc912b){const _0xae35ac={_0x2bdb13:0x5b2,_0x27e924:0x99c,_0x1354d3:0x5fa,_0x1e6425:0x5d8,_0x485e36:0x6d5,_0x207c2f:0x868,_0x585736:0x399},_0x5d9e7e={_0x13dc95:0xca1},_0x577537=_0x3d5d32;if(this[_0x577537(_0xae35ac._0x2bdb13)])return Promise['resolve']();const _0x509812={'ver':0x1};return _0xcc912b['location']=LngLatPoint['parse'](_0xcc912b[_0x577537(_0xae35ac._0x27e924)]),_0x509812[_0x577537(_0xae35ac._0x1354d3)]=_0xcc912b['location'][_0x577537(_0xae35ac._0x1e6425)],_0x509812['lat']=_0xcc912b['location']['lat'],this[_0x577537(0x5b2)]=!![],sendAjax({'url':_0x577537(_0xae35ac._0x485e36),...this['options'],'queryParameters':{'type':_0x577537(_0xae35ac._0x207c2f),'tk':this['key'],'postStr':JSON['stringify'](_0x509812)}})['then'](_0x31f4cf=>{const _0x192dc4=_0x577537;var _0x189b44,_0x150365;this['_getAddress_ing']=![];if(((_0x189b44=_0x31f4cf['status'])===null||_0x189b44===void 0x0?void 0x0:_0x189b44[_0x192dc4(0xd44)])!==0x3e8){console[_0x192dc4(0x7b1)]('未查询到相关结果!',_0x31f4cf);return;}const _0x1d43d6=_0x31f4cf['result'],_0x4cc760={'address':_0x1d43d6['formatted_address'],'city':(((_0x150365=_0x1d43d6[_0x192dc4(_0x5d9e7e._0x13dc95)])===null||_0x150365===void 0x0?void 0x0:_0x150365[_0x192dc4(0x8ed)])||'')['replace']('156',''),'component':_0x1d43d6[_0x192dc4(_0x5d9e7e._0x13dc95)]};return _0xcc912b['success']&&_0xcc912b[_0x192dc4(0x9de)](_0x4cc760),_0x4cc760;})[_0x577537(_0xae35ac._0x585736)](_0x42afed=>{this['_getAddress_ing']=![],logError$1('TdtPOI\x20请求出错',_0x42afed),_0xcc912b['error']&&_0xcc912b['error']('请求出错',_0x42afed);});}['autoTip'](_0x553860){const _0x5e5f4a={_0x33dca1:0x998,_0x1dc15e:0xaaa,_0x505bd8:0xb84},_0x5072ba={_0x133245:0x77b},_0x353ded={_0x1e1912:0x77b,_0x2a06e4:0xfd7},_0x3a85b3=_0x3d5d32,_0x86180c={'queryType':0x7,'show':0x1,'level':_0x553860[_0x3a85b3(_0x5e5f4a._0x33dca1)]||0x12,'mapBound':_0x553860['mapBound']||_0x3a85b3(_0x5e5f4a._0x1dc15e),'start':0x0,'offset':0xa};return Cesium__namespace['defined'](_0x553860['city'])&&(_0x86180c[_0x3a85b3(0x47a)]='156'+_0x553860['city']),Cesium__namespace[_0x3a85b3(_0x5e5f4a._0x505bd8)](_0x553860['types'])&&(_0x86180c['dataTypes']=_0x553860['types']),_0x553860['text']&&(_0x86180c['keyWord']=this['_getKeywords'](_0x553860['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':'query','tk':this['key'],'postStr':JSON['stringify'](_0x86180c)},...this['options']})['then'](_0x26d24d=>{const _0x12f82e=_0x3a85b3;var _0x258c28;if(((_0x258c28=_0x26d24d[_0x12f82e(0xfd7)])===null||_0x258c28===void 0x0?void 0x0:_0x258c28['infocode'])!==0x3e8){console[_0x12f82e(0x7b1)]('未查询到相关结果!',_0x26d24d);_0x553860['error']&&_0x553860[_0x12f82e(_0x353ded._0x1e1912)](_0x26d24d[_0x12f82e(_0x353ded._0x2a06e4)]['cndesc'],_0x26d24d);return;}if(!_0x26d24d['pois']){_0x553860['error']&&_0x553860['error'](_0x12f82e(0xfa6),_0x26d24d);return;}const _0xfc53ae=this['_formatPOIData'](_0x26d24d['pois']),_0x4634b5={'allcount':_0x26d24d['count'],'count':_0xfc53ae['length'],'list':_0xfc53ae};return _0x553860['success']&&_0x553860['success'](_0x4634b5),_0x4634b5;})[_0x3a85b3(0x399)](_0x3c49f4=>{const _0x567426=_0x3a85b3;logError$1('TdtPOI\x20请求出错',_0x3c49f4),_0x553860[_0x567426(_0x5072ba._0x133245)]&&_0x553860['error']('请求出错',_0x3c49f4);});}['query'](_0x369972){const _0x102995={_0x56bd9c:0x104e,_0x3afa2b:0x7f5,_0x5e36e4:0x654},_0x6fb650=_0x3d5d32,_0x4266fe=_0x369972['graphic'];if(_0x4266fe){if(_0x4266fe['type']==='rectangle')return _0x369972['polygon']=_0x4266fe['outlineCoordinates'],this['queryPolygon'](_0x369972);else{if(_0x4266fe['type']==='polygon')return _0x369972[_0x6fb650(_0x102995._0x56bd9c)]=_0x4266fe['coordinates'],this['queryPolygon'](_0x369972);else return _0x4266fe[_0x6fb650(_0x102995._0x3afa2b)]===_0x6fb650(_0x102995._0x5e36e4)?(_0x369972['location']=_0x4266fe['point'],_0x369972['radius']=_0x4266fe['radius'],this['queryCircle'](_0x369972)):Promise['resolve']();}}else return _0x369972['polygon']?this['queryPolygon'](_0x369972):this['queryText'](_0x369972);}['queryText'](_0x213c24){const _0x5770a3={_0x4dad0f:0x998,_0x18cc6e:0xc4c,_0x57087c:0x35d,_0x12f639:0x362},_0xff2173={_0x48f75e:0x9d1},_0xf1eee9={_0x34faec:0xfa6,_0x20234d:0x77b,_0x328784:0xfd7,_0x2ca461:0x9b1,_0xfbaff4:0x9a9,_0x389a3e:0x9de},_0x14c7fb=_0x3d5d32,_0x5d22f3=_0x213c24['count']||0x14,_0x2858bd={'queryType':0x7,'show':0x2,'level':_0x213c24[_0x14c7fb(_0x5770a3._0x4dad0f)]||0x12,'mapBound':_0x213c24['mapBound']||_0x14c7fb(0xaaa),'start':(_0x213c24[_0x14c7fb(_0x5770a3._0x18cc6e)]||0x0)*_0x5d22f3,'offset':_0x5d22f3};return Cesium__namespace['defined'](_0x213c24['city'])&&(_0x2858bd['specify']=_0x14c7fb(_0x5770a3._0x57087c)+_0x213c24['city']),Cesium__namespace['defined'](_0x213c24['types'])&&(_0x2858bd['dataTypes']=_0x213c24['types']),_0x213c24['text']&&(_0x2858bd[_0x14c7fb(0x71b)]=this['_getKeywords'](_0x213c24['text'])),fetchJson({'url':_0x14c7fb(_0x5770a3._0x12f639),'queryParameters':{'type':'query','tk':this['key'],'postStr':JSON['stringify'](_0x2858bd)},...this['options']})['then'](_0x23cf21=>{const _0x5ce0c2=_0x14c7fb;var _0x2fac90;if(((_0x2fac90=_0x23cf21['status'])===null||_0x2fac90===void 0x0?void 0x0:_0x2fac90['infocode'])!==0x3e8){console['log'](_0x5ce0c2(_0xf1eee9._0x34faec),_0x23cf21);_0x213c24['error']&&_0x213c24[_0x5ce0c2(_0xf1eee9._0x20234d)](_0x23cf21[_0x5ce0c2(_0xf1eee9._0x328784)][_0x5ce0c2(_0xf1eee9._0x2ca461)],_0x23cf21);return;}if(!_0x23cf21[_0x5ce0c2(0x9a9)]){_0x213c24['error']&&_0x213c24['error']('未查询到相关结果!',_0x23cf21);return;}const _0x4a9f39=this['_formatPOIData'](_0x23cf21[_0x5ce0c2(_0xf1eee9._0xfbaff4)]),_0x5205b6={'allcount':_0x23cf21['count'],'count':_0x4a9f39['length'],'list':_0x4a9f39};return _0x213c24['success']&&_0x213c24[_0x5ce0c2(_0xf1eee9._0x389a3e)](_0x5205b6),_0x5205b6;})['catch'](_0x83c06d=>{const _0x57aace=_0x14c7fb;logError$1('TdtPOI\x20请求出错',_0x83c06d),_0x213c24['error']&&_0x213c24[_0x57aace(0x77b)](_0x57aace(_0xff2173._0x48f75e),_0x83c06d);});}['queryCircle'](_0x13ce01){const _0x28bc86={_0x100a27:0xdfc},_0x514aa6={_0x135449:0xd44,_0x58f96b:0x77b,_0x27109f:0xc25},_0xab9d20=_0x3d5d32,_0x2f2128=_0x13ce01['count']||0x14,_0x41fe0b={'queryType':0x3,'show':0x2,'queryRadius':formatNum$1(_0x13ce01['radius']||0xbb8,0x0),'start':(_0x13ce01['page']||0x0)*_0x2f2128,'offset':_0x2f2128};return _0x13ce01['location']?(_0x13ce01['location']=LngLatPoint[_0xab9d20(0xce3)](_0x13ce01['location']),_0x41fe0b['pointLonlat']=_0x13ce01['location']['lng']+','+_0x13ce01['location']['lat']):logError$1('TdtPOI:\x20请传入参location数'),Cesium__namespace['defined'](_0x13ce01['types'])&&(_0x41fe0b['dataTypes']=_0x13ce01['types']),_0x13ce01['text']&&(_0x41fe0b['keyWord']=this['_getKeywords'](_0x13ce01['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':_0xab9d20(0x214),'tk':this[_0xab9d20(_0x28bc86._0x100a27)],'postStr':JSON['stringify'](_0x41fe0b)},...this['options']})[_0xab9d20(0x44d)](_0x58e7a1=>{const _0x559805=_0xab9d20;var _0xbb1807;if(((_0xbb1807=_0x58e7a1['status'])===null||_0xbb1807===void 0x0?void 0x0:_0xbb1807[_0x559805(_0x514aa6._0x135449)])!==0x3e8){_0x13ce01['error']&&_0x13ce01['error'](_0x58e7a1['status'][_0x559805(0x9b1)],_0x58e7a1);return;}if(!_0x58e7a1['pois']){_0x13ce01['error']&&_0x13ce01[_0x559805(_0x514aa6._0x58f96b)]('未查询到相关结果!',_0x58e7a1);return;}const _0x30a5ea=this['_formatPOIData'](_0x58e7a1['pois']);let _0x286a84;_0x13ce01['limit']?_0x286a84=this['_filterPOIData_circle'](_0x30a5ea,_0x13ce01['location'],_0x41fe0b['radius']):_0x286a84=_0x30a5ea;const _0x508904={'allcount':_0x58e7a1[_0x559805(_0x514aa6._0x27109f)],'count':_0x286a84['length'],'list':_0x286a84};return _0x13ce01['success']&&_0x13ce01[_0x559805(0x9de)](_0x508904),_0x508904;})['catch'](_0x180996=>{logError$1('TdtPOI\x20请求出错',_0x180996),_0x13ce01['error']&&_0x13ce01['error']('请求出错',_0x180996);});}['_filterPOIData_circle'](_0x1be2ce,_0x21b155,_0x133ae8){const _0x47e066={_0x28c0fa:0xe69,_0x4ea319:0xb75},_0x1cae4a=_0x3d5d32;if(!_0x1be2ce||!_0x21b155||!_0x133ae8)return _0x1be2ce;const _0x22385c=_0x21b155['toCartesian'](),_0x27c796=[];for(let _0x460423=0x0;_0x460423<_0x1be2ce[_0x1cae4a(0xc84)];_0x460423++){const _0x174fd2=_0x1be2ce[_0x460423],_0x4161cc=Cesium__namespace[_0x1cae4a(0xe95)][_0x1cae4a(_0x47e066._0x28c0fa)](_0x174fd2['x'],_0x174fd2['y'],_0x21b155[_0x1cae4a(0xd29)]),_0x49a11c=Cesium__namespace['Cartesian3']['distance'](_0x4161cc,_0x22385c);_0x49a11c<_0x133ae8&&_0x27c796[_0x1cae4a(_0x47e066._0x4ea319)](_0x174fd2);}return _0x27c796;}['queryPolygon'](_0x1e1f9d){const _0x21afe2={_0x8977a5:0x104e,_0x358aa1:0x86b,_0x12e6f5:0xc84,_0x1fc5de:0x761,_0x4ae049:0x2a6},_0x4616da={_0x1c471b:0x77b},_0x2f8ba1={_0x5e7836:0x77b,_0x4a2340:0x9b1,_0x180d4d:0x9a9,_0x3e71e4:0xc84},_0x1625c2=_0x3d5d32,_0x24a455=_0x1e1f9d['count']||0x14,_0x39cd6e={'queryType':0xa,'show':0x2,'start':(_0x1e1f9d['page']||0x0)*_0x24a455,'offset':_0x24a455},_0x3eb803=LngLatArray['toArray'](_0x1e1f9d[_0x1625c2(_0x21afe2._0x8977a5)]);if(_0x3eb803['length']===0x2)return _0x1e1f9d[_0x1625c2(_0x21afe2._0x358aa1)]=_0x1e1f9d['polygon'],this['queryExtent'](_0x1e1f9d);let _0x4a170b='';const _0x4817ae=_0x3eb803['concat']([_0x3eb803[0x0]]);for(let _0x2a83ff=0x0;_0x2a83ff<_0x4817ae['length'];_0x2a83ff++){const _0x57324f=_0x4817ae[_0x2a83ff];_0x2a83ff===_0x4817ae[_0x1625c2(_0x21afe2._0x12e6f5)]-0x1?_0x4a170b+=_0x57324f[0x0]+','+_0x57324f[0x1]:_0x4a170b+=_0x57324f[0x0]+','+_0x57324f[0x1]+',';}return _0x39cd6e[_0x1625c2(_0x21afe2._0x8977a5)]=_0x4a170b,Cesium__namespace['defined'](_0x1e1f9d['types'])&&(_0x39cd6e['dataTypes']=_0x1e1f9d[_0x1625c2(_0x21afe2._0x1fc5de)]),_0x1e1f9d['text']&&(_0x39cd6e['keyWord']=this[_0x1625c2(_0x21afe2._0x4ae049)](_0x1e1f9d['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':'query','tk':this['key'],'postStr':JSON['stringify'](_0x39cd6e)},...this['options']})['then'](_0x57636a=>{const _0x35ea70=_0x1625c2;var _0x56465e;if(((_0x56465e=_0x57636a['status'])===null||_0x56465e===void 0x0?void 0x0:_0x56465e['infocode'])!==0x3e8){_0x1e1f9d['error']&&_0x1e1f9d[_0x35ea70(_0x2f8ba1._0x5e7836)](_0x57636a['status'][_0x35ea70(_0x2f8ba1._0x4a2340)],_0x57636a);return;}if(!_0x57636a[_0x35ea70(_0x2f8ba1._0x180d4d)]){_0x1e1f9d['error']&&_0x1e1f9d[_0x35ea70(0x77b)]('未查询到相关结果!',_0x57636a);return;}const _0x3f67c4=this['_formatPOIData'](_0x57636a['pois']);let _0x67ef4b;_0x1e1f9d['limit']?_0x67ef4b=this[_0x35ea70(0x5cd)](_0x3f67c4,_0x3eb803):_0x67ef4b=_0x3f67c4;const _0x24a00b={'allcount':_0x57636a['count'],'count':_0x67ef4b[_0x35ea70(_0x2f8ba1._0x3e71e4)],'list':_0x67ef4b};return _0x1e1f9d[_0x35ea70(0x9de)]&&_0x1e1f9d['success'](_0x24a00b),_0x24a00b;})['catch'](_0x15213c=>{const _0x2f6b0e=_0x1625c2;logError$1(_0x2f6b0e(0x432),_0x15213c),_0x1e1f9d[_0x2f6b0e(_0x4616da._0x1c471b)]&&_0x1e1f9d['error']('请求出错',_0x15213c);});}['_filterPOIData_polygon'](_0x4f0b79,_0x7e5473){const _0x1f0ee2={_0xffe9a6:0x5fc},_0x12cba4=_0x3d5d32;if(!_0x4f0b79||!_0x7e5473)return;_0x7e5473=_0x7e5473['concat']([_0x7e5473[0x0]]);const _0x5393c5={'type':'Polygon','coordinates':[_0x7e5473]},_0x5906fd=[];for(let _0x483769=0x0;_0x483769<_0x4f0b79['length'];_0x483769++){const _0x1c1c81=_0x4f0b79[_0x483769],_0x48106b={'type':_0x12cba4(_0x1f0ee2._0xffe9a6),'geometry':{'type':'Point','coordinates':[_0x1c1c81['x'],_0x1c1c81['y']]}};booleanPointInPolygon(_0x48106b,_0x5393c5)&&_0x5906fd[_0x12cba4(0xb75)](_0x1c1c81);}return _0x5906fd;}['queryExtent'](_0x156c32){const _0x27851f={_0x55d46c:0xb84,_0x35082b:0xa93,_0x543cf3:0x71b,_0x1f6015:0x2a6,_0x4aadc3:0x31e,_0x33773b:0x433},_0x3de9b2=_0x3d5d32,_0x1b3f8b=_0x156c32['count']||0x14,_0x49bcbe={'queryType':0x2,'show':0x2,'level':0x12,'start':(_0x156c32['page']||0x0)*_0x1b3f8b,'offset':_0x1b3f8b},_0x3d55d6=_0x156c32[_0x3de9b2(0x86b)][0x0],_0x4c034e=_0x156c32[_0x3de9b2(0x86b)][0x1];return _0x49bcbe['mapBound']=_0x3d55d6[0x0]+','+_0x3d55d6[0x1]+','+_0x4c034e[0x0]+','+_0x4c034e[0x1],Cesium__namespace[_0x3de9b2(_0x27851f._0x55d46c)](_0x156c32['types'])&&(_0x49bcbe[_0x3de9b2(_0x27851f._0x35082b)]=_0x156c32['types']),_0x156c32['text']&&(_0x49bcbe[_0x3de9b2(_0x27851f._0x543cf3)]=this[_0x3de9b2(_0x27851f._0x1f6015)](_0x156c32['text'])),fetchJson({'url':'http://api.tianditu.gov.cn/v2/search','queryParameters':{'type':'query','tk':this[_0x3de9b2(0xdfc)],'postStr':JSON[_0x3de9b2(_0x27851f._0x4aadc3)](_0x49bcbe)},...this[_0x3de9b2(_0x27851f._0x33773b)]})[_0x3de9b2(0x44d)](_0x2ad668=>{const _0xfcfeb6=_0x3de9b2;var _0x4d7959;if(((_0x4d7959=_0x2ad668[_0xfcfeb6(0xfd7)])===null||_0x4d7959===void 0x0?void 0x0:_0x4d7959['infocode'])!==0x3e8){_0x156c32['error']&&_0x156c32['error'](_0x2ad668[_0xfcfeb6(0xfd7)]['cndesc'],_0x2ad668);return;}if(!_0x2ad668['pois']){_0x156c32['error']&&_0x156c32['error']('未查询到相关结果!',_0x2ad668);return;}const _0x4d90b2=this['_formatPOIData'](_0x2ad668['pois']),_0x49f72c={'allcount':_0x2ad668['count'],'count':_0x4d90b2['length'],'list':_0x4d90b2};return _0x156c32['success']&&_0x156c32['success'](_0x49f72c),_0x49f72c;})['catch'](_0x4a4264=>{const _0x266f78=_0x3de9b2;logError$1('TdtPOI\x20请求出错',_0x4a4264),_0x156c32['error']&&_0x156c32[_0x266f78(0x77b)](_0x266f78(0x9d1),_0x4a4264);});}}const RouteType={'Walking':0x1,'Bicycling':0x2,'Driving':0x3};class GaodeRoute{constructor(_0xdf8690={}){const _0x5c6113=_0x3d5d32;this['options']=_0xdf8690,this['_key_index']=0x0,this['_keys']=_0xdf8690[_0x5c6113(0xdfc)]||gaodeArr;}get['keys'](){return this['_keys'];}set['keys'](_0x4602a3){this['_keys']=_0x4602a3;}get['key'](){const _0x4bfa24={_0x5a8279:0x510},_0x2b8dac=_0x3d5d32,_0x30ac7c=this[_0x2b8dac(_0x4bfa24._0x5a8279)]++%this['_keys'][_0x2b8dac(0xc84)];return this['_keys'][_0x30ac7c];}['_formatRouteData'](_0x3aae42,_0x458113,_0x4e25ea){const _0x4af9fa={_0x55ba0c:0xc84,_0x439a88:0xbe6,_0x308c94:0xdaa,_0x10681a:0xbd7,_0x2a1500:0x80d},_0x55f8b2=_0x3d5d32;let _0x11e2bb,_0x1cb10e;const _0x4c36d4=[];_0x3aae42&&(_0x11e2bb=gcj2wgs(_0x3aae42['split'](',')));_0x458113&&(_0x1cb10e=gcj2wgs(_0x458113['split'](',')));if(_0x4e25ea&&_0x4e25ea[_0x55f8b2(_0x4af9fa._0x55ba0c)]>0x0)for(let _0x2a0dbc=0x0;_0x2a0dbc<_0x4e25ea['length'];_0x2a0dbc++){const _0x2b1cec=[];_0x2b1cec['push'](_0x11e2bb);const _0x52c7c1=_0x4e25ea[_0x2a0dbc],_0x461445=_0x52c7c1['steps'],_0x4a8502=[],_0x322ca5=[];for(let _0x58eb59=0x0;_0x58eb59<_0x461445[_0x55f8b2(0xc84)];_0x58eb59++){const _0x4d3ebc={'instruction':_0x461445[_0x58eb59][_0x55f8b2(_0x4af9fa._0x439a88)],'distance':_0x461445[_0x58eb59]['distance'],'duration':_0x461445[_0x58eb59]['duration'],'points':[],'route':_0x461445[_0x58eb59]['road']},_0x15e5b7=_0x461445[_0x58eb59]['polyline'],_0x5a2b6c=_0x15e5b7['split'](';');for(let _0x27154c=0x0;_0x27154c<_0x5a2b6c[_0x55f8b2(0xc84)];_0x27154c++){const _0x3b92bb=_0x5a2b6c[_0x27154c],_0x8bfc1f=gcj2wgs(_0x3b92bb[_0x55f8b2(_0x4af9fa._0x308c94)](','));_0x2b1cec['push'](_0x8bfc1f),_0x4d3ebc['points']['push'](_0x8bfc1f);}_0x322ca5['push'](_0x4d3ebc['route']),_0x4a8502['push'](_0x4d3ebc);}_0x2b1cec['push'](_0x1cb10e),_0x4c36d4['push']({'allDistance':_0x52c7c1[_0x55f8b2(_0x4af9fa._0x10681a)],'allDuration':_0x52c7c1[_0x55f8b2(_0x4af9fa._0x2a1500)],'steps':_0x4a8502,'points':_0x2b1cec,'road':_0x322ca5});}return{'origin':_0x11e2bb,'destination':_0x1cb10e,'paths':_0x4c36d4};}['query'](_0x5da2f4){const _0x594057={_0x3be960:0x7f5},_0x4d5786=_0x3d5d32;switch(_0x5da2f4[_0x4d5786(_0x594057._0x3be960)]){case RouteType['Bicycling']:return this['queryBicycling'](_0x5da2f4);case RouteType['Driving']:return this['queryDriving'](_0x5da2f4);case RouteType['Walking']:default:return this['queryWalking'](_0x5da2f4);}}[_0x3d5d32(0x349)](_0x2c5784){const _0x18aa3a={_0x597b17:0x9de,_0x26e9f2:0x214};return new Promise((_0x104c50,_0x45e370)=>{const _0x34552b=_0x4132,_0xdd86d7=this;let _0x5914a7=-0x1;const _0xdda041={};for(const _0x1a1676 in _0x2c5784){if(_0x1a1676===_0x34552b(0xbf8)||_0x1a1676==='success'||_0x1a1676==='error')continue;_0xdda041[_0x1a1676]=_0x2c5784[_0x1a1676];}const _0x4e9a1e=_0x2c5784['points'],_0x59b84f=[];function _0x56d959(){const _0x42596a={_0x4dd731:0xc84,_0x5b0088:0x3fa},_0x3cbc2d=_0x34552b;_0x5914a7++,_0xdda041['points']=_0x4e9a1e[_0x5914a7],_0xdda041[_0x3cbc2d(_0x18aa3a._0x597b17)]=function(_0x419921){const _0x3e4ed3=_0x3cbc2d;_0x419921&&_0x419921[_0x3e4ed3(0x3fa)]&&_0x419921['paths'][_0x3e4ed3(_0x42596a._0x4dd731)]>0x0?_0x59b84f[_0x3e4ed3(0xb75)](_0x419921[_0x3e4ed3(_0x42596a._0x5b0088)][0x0]):_0x59b84f[_0x3e4ed3(0xb75)](null),_0x5914a7>=_0x4e9a1e['length']-0x1?(_0x2c5784['success']&&_0x2c5784['success'](_0x59b84f),_0x104c50(_0x59b84f)):_0x56d959();},_0xdda041['error']=_0xdda041['success'],_0xdd86d7[_0x3cbc2d(_0x18aa3a._0x26e9f2)](_0xdda041);}_0x56d959();});}[_0x3d5d32(0x102c)](_0x1371f6){const _0x42f1e7={_0xe985aa:0xa68},_0x2d2708=_0x3d5d32;let _0x922170=Number[_0x2d2708(_0x42f1e7._0xe985aa)],_0x5e563f=null,_0x27c082=-0x1;for(let _0x4c423b=0x0;_0x4c423b<_0x1371f6['length'];_0x4c423b++){const _0x36d0c8=_0x1371f6[_0x4c423b];_0x36d0c8&&(_0x36d0c8['allDistance']<=_0x922170&&(_0x5e563f=_0x36d0c8,_0x27c082=_0x4c423b,_0x922170=_0x36d0c8[_0x2d2708(0x32b)]));}return{'lineData':_0x5e563f,'index':_0x27c082};}['queryWalking'](_0x2a677a){const _0x3b15d3={_0x8073ff:0xbf8,_0x5493e7:0x433,_0xb691cb:0x399},_0x50af91={_0x5181e4:0x77b},_0x2ccd38={_0x5a81de:0xd44,_0x8ed80:0x52e,_0x52b932:0xe99,_0x2f7af6:0x417,_0x20b001:0x864},_0x9bfb9b=_0x3d5d32,_0x1096f6={'key':this['key'],'output':'json'},_0x35653c=wgs2gcj(_0x2a677a[_0x9bfb9b(_0x3b15d3._0x8073ff)][0x0]),_0x132dab=wgs2gcj(_0x2a677a['points'][_0x2a677a[_0x9bfb9b(0xbf8)]['length']-0x1]);return _0x1096f6['origin']=_0x35653c[0x0]+','+_0x35653c[0x1],_0x1096f6['destination']=_0x132dab[0x0]+','+_0x132dab[0x1],fetchJson({'url':'https://restapi.amap.com/v3/direction/walking','queryParameters':_0x1096f6,...this[_0x9bfb9b(_0x3b15d3._0x5493e7)]})[_0x9bfb9b(0x44d)](_0x1786ee=>{const _0x36903e=_0x9bfb9b;if(_0x1786ee[_0x36903e(_0x2ccd38._0x5a81de)]!==_0x36903e(_0x2ccd38._0x8ed80)){if(_0x2a677a['error']){const _0x5e7468=_0x36903e(_0x2ccd38._0x52b932)+_0x1786ee['infocode']+'):'+_0x1786ee['info'];_0x2a677a['error'](_0x5e7468);}return;}if(!_0x1786ee['route']||!_0x1786ee[_0x36903e(0x864)][_0x36903e(0x3fa)]){_0x2a677a['error']&&_0x2a677a['error'](_0x36903e(0xfa6));return;}const _0x5dd9c7=this[_0x36903e(_0x2ccd38._0x2f7af6)](_0x1096f6[_0x36903e(0x1eb)],_0x1096f6['destination'],_0x1786ee[_0x36903e(_0x2ccd38._0x20b001)]['paths']);return _0x2a677a['success']&&_0x2a677a['success'](_0x5dd9c7),_0x5dd9c7;})[_0x9bfb9b(_0x3b15d3._0xb691cb)](_0x1308da=>{const _0x31f45e=_0x9bfb9b;logError$1('GaodeRoute\x20请求出错',_0x1308da),_0x2a677a[_0x31f45e(_0x50af91._0x5181e4)]&&_0x2a677a['error']('请求出错',_0x1308da);});}[_0x3d5d32(0x2b9)](_0x4e1438){const _0x1d2b4b={_0x4db940:0x597,_0x37c106:0x3fa},_0x47746d=_0x3d5d32,_0x532b08={'key':this[_0x47746d(0xdfc)],'output':_0x47746d(0xde6)},_0xcb76b=wgs2gcj(_0x4e1438['points'][0x0]),_0x1d732b=wgs2gcj(_0x4e1438['points'][_0x4e1438[_0x47746d(0xbf8)]['length']-0x1]);return _0x532b08['origin']=_0xcb76b[0x0]+','+_0xcb76b[0x1],_0x532b08[_0x47746d(0x597)]=_0x1d732b[0x0]+','+_0x1d732b[0x1],fetchJson({'url':'https://restapi.amap.com/v4/direction/bicycling','queryParameters':_0x532b08,...this['options']})['then'](_0x2f7c80=>{const _0x4c532c=_0x47746d;if(_0x2f7c80['infocode']!=='10000'){const _0x2d3103='路径规划\x20请求失败('+_0x2f7c80[_0x4c532c(0xd44)]+'):'+_0x2f7c80['info'];_0x4e1438['error']&&_0x4e1438['error'](_0x2d3103);return;}if(!_0x2f7c80['route']||!_0x2f7c80['route']['paths']){_0x4e1438['error']&&_0x4e1438['error']('未查询到相关结果!');return;}const _0x817775=this['_formatRouteData'](_0x532b08['origin'],_0x532b08[_0x4c532c(_0x1d2b4b._0x4db940)],_0x2f7c80['route'][_0x4c532c(_0x1d2b4b._0x37c106)]);return _0x4e1438['success']&&_0x4e1438['success'](_0x817775),_0x817775;})['catch'](_0x4aecd7=>{logError$1('GaodeRoute\x20请求出错',_0x4aecd7),_0x4e1438['error']&&_0x4e1438['error']('请求出错',_0x4aecd7);});}[_0x3d5d32(0xf1e)](_0x5cc825){const _0x1dd06d={_0x189982:0x1eb,_0x2efa06:0xc84,_0x57ca1b:0x433},_0xa80584={_0x38a588:0x864,_0x335bcf:0x77b,_0x428393:0x417,_0x1b6e9e:0x1eb},_0x1851bf=_0x3d5d32;var _0x4b54fb;const _0x3991ad={'key':this['key'],'output':'json','extensions':_0x5cc825['extensions']||_0x1851bf(0x3f9),'strategy':_0x5cc825['strategy']||0x0},_0x2a29f2=wgs2gcj(_0x5cc825['points'][0x0]),_0x2c89c1=wgs2gcj(_0x5cc825['points'][_0x5cc825['points']['length']-0x1]);_0x3991ad[_0x1851bf(_0x1dd06d._0x189982)]=_0x2a29f2[0x0]+','+_0x2a29f2[0x1],_0x3991ad[_0x1851bf(0x597)]=_0x2c89c1[0x0]+','+_0x2c89c1[0x1];if(_0x5cc825['points'][_0x1851bf(0xc84)]>0x2){let _0x253d02='';for(let _0x15c783=0x1,_0x11025a=_0x5cc825['points']['length']-0x1;_0x15c783<_0x11025a;_0x15c783++){const _0x358dde=wgs2gcj(_0x5cc825['points'][_0x15c783]);_0x253d02+=_0x358dde[0x0]+','+_0x358dde[0x1]+';';}_0x3991ad['waypoints']=_0x253d02;}if(((_0x4b54fb=_0x5cc825['avoidpolygons'])===null||_0x4b54fb===void 0x0?void 0x0:_0x4b54fb[_0x1851bf(_0x1dd06d._0x2efa06)])>0x0){let _0x29b901='';for(let _0x2c5832=0x0,_0x1073ea=_0x5cc825['avoidpolygons'][_0x1851bf(_0x1dd06d._0x2efa06)];_0x2c5832<_0x1073ea;_0x2c5832++){_0x2c5832>0x0&&(_0x29b901+='|');const _0x541f5c=_0x5cc825['avoidpolygons'][_0x2c5832];for(let _0x1141ca=0x0,_0x201f81=_0x541f5c['length'];_0x1141ca<_0x201f81;_0x1141ca++){const _0xfbe617=wgs2gcj(_0x541f5c[_0x1141ca]);_0x29b901+=_0xfbe617[0x0]+','+_0xfbe617[0x1]+';';}}_0x3991ad['avoidpolygons']=_0x29b901;}return fetchJson({'url':'https://restapi.amap.com/v3/direction/driving','queryParameters':_0x3991ad,...this[_0x1851bf(_0x1dd06d._0x57ca1b)]})['then'](_0x817f55=>{const _0x37c99c=_0x1851bf;if(_0x817f55[_0x37c99c(0xd44)]!=='10000'){if(_0x5cc825['error']){const _0x22917c='路径规划\x20请求失败('+_0x817f55['infocode']+'):'+_0x817f55['info'];_0x5cc825['error'](_0x22917c);}return;}if(!_0x817f55['route']||!_0x817f55['route']['paths']||_0x817f55[_0x37c99c(_0xa80584._0x38a588)][_0x37c99c(0x3fa)]['length']===0x0){_0x5cc825['error']&&_0x5cc825[_0x37c99c(_0xa80584._0x335bcf)](_0x37c99c(0xfa6));return;}const _0x3b4ff7=this[_0x37c99c(_0xa80584._0x428393)](_0x3991ad[_0x37c99c(_0xa80584._0x1b6e9e)],_0x3991ad['destination'],_0x817f55['route']['paths']);return _0x5cc825['success']&&_0x5cc825['success'](_0x3b4ff7),_0x3b4ff7;})['catch'](_0x4dd582=>{const _0x38b5fa=_0x1851bf;logError$1('GaodeRoute\x20请求出错',_0x4dd582),_0x5cc825['error']&&_0x5cc825['error'](_0x38b5fa(0x9d1),_0x4dd582);});}}GaodeRoute['RouteType']=RouteType;const Def_Parameters={'service':'WFS','request':'GetFeature','version':'1.0.0','outputFormat':'application/json','maxFeatures':0x3e8};class QueryGeoServer extends BaseClass{get['layer'](){const _0x3300f2={_0x42055a:0x433,_0x1db022:0x921},_0x357ba6=_0x3d5d32;if(!this['_geoJsonLayer']){const _0x51aca3={...this[_0x357ba6(_0x3300f2._0x42055a)]};delete _0x51aca3['url'],delete _0x51aca3['data'],this['_geoJsonLayer']=new GeoJsonLayer(_0x51aca3),this[_0x357ba6(_0x3300f2._0x1db022)]['on'](EventType['load'],this['geoJsonLayer_onLoadHandler'],this),this['_geoJsonLayer']['on'](EventType[_0x357ba6(0xb59)],this['geoJsonLayer_onClickHandler'],this);}return this['_geoJsonLayer'];}[_0x3d5d32(0x214)](_0x1575e2){const _0xa160bf={_0x2fcbd0:0xaae,_0x348f59:0x328,_0x1f2fda:0x525,_0x289a7a:0xb84,_0x577f95:0x525,_0x158b1d:0x470,_0x4642f2:0x853,_0x5c802f:0x433,_0xd6e262:0x548,_0x4ca4bf:0x77b},_0xbd9675={_0x14c28f:0x44d},_0x43e0a5=_0x3d5d32;let _0x1c88d8='';_0x1575e2['text']&&(Cesium__namespace['defaultValue'](_0x1575e2['like'],!![])?_0x1c88d8+='\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1575e2['column']+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20*'+_0x1575e2['text']+'*\x0a\x20\x20\x20\x20\x20\x20\x20\x20':_0x1c88d8+='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1575e2[_0x43e0a5(_0xa160bf._0x2fcbd0)]+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1575e2['text']+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20');if(_0x1575e2[_0x43e0a5(_0xa160bf._0x348f59)]){const _0x35a56c=_0x1575e2['graphic'];let _0x20fe2e;if(_0x35a56c['type']==='rectangle')_0x20fe2e=_0x35a56c['outlineCoordinates'];else{if(_0x35a56c['type']==='polygon')_0x20fe2e=_0x35a56c[_0x43e0a5(0x2ae)];else{if(_0x35a56c['type']==='circle')_0x20fe2e=_0x35a56c['getOutlineCoordinates'](!![],0x1e);else Cesium__namespace['defined'](_0x35a56c['xmax'])&&Cesium__namespace[_0x43e0a5(0xb84)](_0x35a56c[_0x43e0a5(_0xa160bf._0x1f2fda)])&&Cesium__namespace[_0x43e0a5(_0xa160bf._0x289a7a)](_0x35a56c['ymin'])&&Cesium__namespace['defined'](_0x35a56c['ymax'])&&(_0x20fe2e=[[_0x35a56c[_0x43e0a5(_0xa160bf._0x577f95)],_0x35a56c['ymax']],[_0x35a56c['xmin'],_0x35a56c[_0x43e0a5(_0xa160bf._0x158b1d)]],[_0x35a56c['xmax'],_0x35a56c[_0x43e0a5(0x470)]],[_0x35a56c['xmax'],_0x35a56c['ymax']]]);}}if(_0x20fe2e){_0x20fe2e['push'](_0x20fe2e[0x0]);let _0x5b1626='';for(let _0x4417fa=0x0;_0x4417fa<_0x20fe2e['length'];_0x4417fa++){let _0x3a1186=_0x20fe2e[_0x4417fa];this['options']['crs']&&this['options'][_0x43e0a5(0x980)]!==CRS['EPSG4326']&&this['options']['crs']!==CRS['EPSG4490']&&(_0x3a1186=proj4Trans(_0x3a1186,_0x43e0a5(_0xa160bf._0x4642f2),this[_0x43e0a5(_0xa160bf._0x5c802f)]['crs'])),_0x5b1626+=_0x3a1186[0x0]+','+_0x3a1186[0x1]+'\x20';}_0x1c88d8+='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1575e2[_0x43e0a5(0xbb5)]||_0x43e0a5(0x683))+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5b1626+_0x43e0a5(0x26f);}}_0x1c88d8+='';const _0x584389={...Def_Parameters,..._0x1575e2,'typeName':this[_0x43e0a5(_0xa160bf._0x5c802f)][_0x43e0a5(_0xa160bf._0xd6e262)],'filter':_0x1c88d8};return delete _0x584389[_0x43e0a5(0x9de)],delete _0x584389[_0x43e0a5(_0xa160bf._0x4ca4bf)],delete _0x584389['graphic'],delete _0x584389[_0x43e0a5(0x76b)],delete _0x584389['column'],new Promise((_0x2bd2af,_0x83e5ec)=>{const _0x1eaacd=_0x43e0a5;sendAjax({...this['options'],'queryParameters':_0x584389})[_0x1eaacd(_0xbd9675._0x14c28f)](_0x11d372=>{_0x1575e2['_promise']={'resolve':_0x2bd2af,'reject':_0x83e5ec},this['processFeatureCollection'](_0x11d372,_0x1575e2);})['catch'](_0x2560a0=>{logError$1('QueryGeoServer\x20请求出错',_0x2560a0),_0x1575e2['error']&&_0x1575e2['error']('请求出错',_0x2560a0);});});}['queryBySql'](_0x410958){const _0x552484={_0xac2f3c:0x296,_0xf78ed2:0xb84,_0x2bd305:0x57e,_0x10768d:0xb75,_0xe8b5ef:0xdf7,_0x18679f:0xb17,_0x54e13e:0x9de},_0x462b50=_0x3d5d32;let _0x4ea087=_0x410958[_0x462b50(_0x552484._0xac2f3c)]||_0x462b50(0xf34);if(_0x410958['graphic']){let _0x2e4ea8=_0x410958[_0x462b50(0x328)];const _0x141891=_0x410958['geometryName']||'the_geom';let _0x49f9f8;if(_0x2e4ea8[_0x462b50(0x7f5)]==='rectangle'){_0x2e4ea8=_0x2e4ea8['getRectangle']({'isFormat':!![]});const _0x526959=_0x2e4ea8['xmin']+','+_0x2e4ea8['ymin']+','+_0x2e4ea8['xmax']+','+_0x2e4ea8['ymax'];_0x4ea087+='\x20and\x20BBOX('+_0x141891+',\x20'+_0x526959+')';}else{if(_0x2e4ea8[_0x462b50(0x7f5)]==='polygon')_0x49f9f8=_0x2e4ea8['coordinates'];else{if(_0x2e4ea8['type']==='circle')_0x49f9f8=_0x2e4ea8['getOutlineCoordinates'](!![],0x1e);else{if(Cesium__namespace['defined'](_0x2e4ea8['xmax'])&&Cesium__namespace[_0x462b50(0xb84)](_0x2e4ea8['xmin'])&&Cesium__namespace['defined'](_0x2e4ea8['ymin'])&&Cesium__namespace[_0x462b50(_0x552484._0xf78ed2)](_0x2e4ea8['ymax'])){const _0x31045f=_0x2e4ea8['xmin']+','+_0x2e4ea8[_0x462b50(0x470)]+','+_0x2e4ea8[_0x462b50(_0x552484._0x2bd305)]+','+_0x2e4ea8['ymax'];_0x4ea087+='\x20and\x20BBOX('+_0x141891+',\x20'+_0x31045f+')';}}}}if(_0x49f9f8){_0x49f9f8[_0x462b50(0xb75)](_0x49f9f8[0x0]);const _0x301e48=[];for(let _0x1dfbf1=0x0;_0x1dfbf1<_0x49f9f8['length'];_0x1dfbf1++){_0x301e48[_0x462b50(_0x552484._0x10768d)](_0x49f9f8[_0x1dfbf1][0x0]+'\x20'+_0x49f9f8[_0x1dfbf1][0x1]);}_0x4ea087+='\x20and\x20INTERSECTS\x20('+_0x141891+_0x462b50(_0x552484._0xe8b5ef)+_0x301e48[_0x462b50(_0x552484._0x18679f)](',')+')))';}}const _0x4147d8={...Def_Parameters,..._0x410958,'typeName':this['options']['layer'],'cql_filter':_0x4ea087};return delete _0x4147d8[_0x462b50(_0x552484._0x54e13e)],delete _0x4147d8['error'],delete _0x4147d8['graphic'],new Promise((_0x24e30c,_0x2e01f7)=>{const _0xf655ef={_0x834135:0x9d1},_0x374613=_0x462b50;sendAjax({...this[_0x374613(0x433)],'queryParameters':_0x4147d8})[_0x374613(0x44d)](_0x4b0274=>{_0x410958['_promise']={'resolve':_0x24e30c,'reject':_0x2e01f7},this['processFeatureCollection'](_0x4b0274,_0x410958);})[_0x374613(0x399)](_0x1ff0b0=>{const _0x1428df=_0x374613;logError$1('QueryGeoServer\x20请求出错',_0x1ff0b0),_0x410958['error']&&_0x410958[_0x1428df(0x77b)](_0x1428df(_0xf655ef._0x834135),_0x1ff0b0);});});}[_0x3d5d32(0x84a)](_0x486261,_0x4dada5){const _0x2afd84={_0x227abc:0x5fc,_0x2cbcad:0x2ae,_0x1753b6:0xc84,_0x3d3759:0x2a0,_0x17139a:0x9de,_0x5b43e6:0x227},_0x58dd13={_0x41a91e:0xc84,_0x27ce35:0x227},_0x463a53=_0x3d5d32;_0x486261&&_0x486261['type']===_0x463a53(_0x2afd84._0x227abc)&&(_0x486261={'type':'FeatureCollection','features':[_0x486261]});if(!_0x486261||!_0x486261['features']||_0x486261['features']['length']===0x0){var _0x213b8a;_0x4dada5['success']&&_0x4dada5['success']({'count':0x0}),(_0x213b8a=_0x4dada5['_promise'])!==null&&_0x213b8a!==void 0x0&&_0x213b8a['resolve']&&_0x4dada5['_promise'][_0x463a53(0xac9)]({'count':0x0});}else{const _0x208100=[];for(let _0x2c5d9f=0x0;_0x2c5d9f<_0x486261['features']['length'];_0x2c5d9f++){var _0x5fcb8,_0x22985e;const _0xe548eb=_0x486261['features'][_0x2c5d9f];(_0xe548eb===null||_0xe548eb===void 0x0?void 0x0:(_0x5fcb8=_0xe548eb['geometry'])===null||_0x5fcb8===void 0x0?void 0x0:(_0x22985e=_0x5fcb8[_0x463a53(_0x2afd84._0x2cbcad)])===null||_0x22985e===void 0x0?void 0x0:_0x22985e[_0x463a53(_0x2afd84._0x1753b6)])>0x0&&_0x208100['push'](_0xe548eb);}_0x486261['features']=_0x208100;if(this[_0x463a53(0x921)])this[_0x463a53(_0x2afd84._0x3d3759)]=_0x4ac1d4=>{const _0x314162=_0x463a53;var _0x4bd70e;const _0x5c8bcd={'geojson':_0x486261,'count':_0x486261['features'][_0x314162(_0x58dd13._0x41a91e)],'list':_0x4ac1d4};_0x4dada5['success']&&_0x4dada5['success'](_0x5c8bcd),(_0x4bd70e=_0x4dada5[_0x314162(_0x58dd13._0x27ce35)])!==null&&_0x4bd70e!==void 0x0&&_0x4bd70e['resolve']&&_0x4dada5['_promise']['resolve'](_0x5c8bcd);},this['_geoJsonLayer']['load']({'data':_0x486261});else{var _0x52385c;const _0x305fee={'geojson':_0x486261,'count':_0x486261[_0x463a53(0x7ab)]['length']};_0x4dada5[_0x463a53(_0x2afd84._0x17139a)]&&_0x4dada5[_0x463a53(_0x2afd84._0x17139a)](_0x305fee),(_0x52385c=_0x4dada5[_0x463a53(_0x2afd84._0x5b43e6)])!==null&&_0x52385c!==void 0x0&&_0x52385c['resolve']&&_0x4dada5[_0x463a53(0x227)]['resolve'](_0x305fee);}}}[_0x3d5d32(0x35a)](_0x2389fb){const _0x55d88b=_0x3d5d32;this['_last_success']&&(this['_last_success'](_0x2389fb['list']),this['_last_success']=null),this['fire'](EventType[_0x55d88b(0xffe)],_0x2389fb);}['geoJsonLayer_onClickHandler'](_0x55c819){const _0x5ebef7=_0x3d5d32;this[_0x5ebef7(0xefc)](EventType['click'],{..._0x55c819,'layer':this['_geoJsonLayer']});}['clear'](){const _0x2e72d3={_0x514d08:0x76d},_0x3f57b5=_0x3d5d32;this['_last_success']&&(this['_last_success']=null),this['_geoJsonLayer']&&this['_geoJsonLayer'][_0x3f57b5(_0x2e72d3._0x514d08)]();}}class QueryArcServer extends BaseClass{constructor(_0x1087db={}){const _0x5caf78={_0x1828d6:0x433},_0x20b19b=_0x3d5d32;super(_0x1087db),this[_0x20b19b(_0x5caf78._0x1828d6)]=_0x1087db,this['_pageSize']=_0x1087db['pageSize']??0xa,this['_allCount']=0x0,this['_allPage']=0x0,this['_pageIndex']=0x1,this['arrIDS']=[];}get['url'](){const _0x5cc81b=_0x3d5d32;return this[_0x5cc81b(0x433)]['url'];}set['url'](_0x2e460a){this['options']['url']=_0x2e460a;}get['pageSize'](){return this['_pageSize'];}set[_0x3d5d32(0x46b)](_0x1d2375){const _0x2445ef=_0x3d5d32;this[_0x2445ef(0x2d9)]=_0x1d2375;}get['allCount'](){return this['_allCount'];}get['allPage'](){return this['_allPage'];}get['pageIndex'](){const _0x229377=_0x3d5d32;return this[_0x229377(0x9b4)];}set['pageIndex'](_0xe29d00){const _0x4a40be=_0x3d5d32;this[_0x4a40be(0x9b4)]=_0xe29d00,this['showPage'](_0xe29d00);}get[_0x3d5d32(0x548)](){const _0x26f0d2={_0xb71f5a:0x433,_0x431181:0xffe,_0x4f19ea:0x921},_0x31eb8c=_0x3d5d32;if(!this['_geoJsonLayer']){const _0x44bcb3={...this[_0x31eb8c(_0x26f0d2._0xb71f5a)]};delete _0x44bcb3['url'],delete _0x44bcb3['data'],this['_geoJsonLayer']=new GeoJsonLayer(_0x44bcb3),this['_geoJsonLayer']['on'](EventType[_0x31eb8c(_0x26f0d2._0x431181)],this[_0x31eb8c(0x35a)],this),this[_0x31eb8c(_0x26f0d2._0x4f19ea)]['on'](EventType['click'],this['geoJsonLayer_onClickHandler'],this);}return this['_geoJsonLayer'];}['showFirstPage'](){this['showPage'](0x1);}['showPretPage'](){const _0x11a3ae={_0x331d80:0x9b4},_0x58e7ad=_0x3d5d32;this['_pageIndex']=this['_pageIndex']-0x1,this['_pageIndex']<0x1&&(this['_pageIndex']=0x1),this['showPage'](this[_0x58e7ad(_0x11a3ae._0x331d80)]);}['showNextPage'](){const _0x15e36a=_0x3d5d32;this['_pageIndex']=this['_pageIndex']+0x1,this['_pageIndex']>this['allPage']&&(this['_pageIndex']=this[_0x15e36a(0x916)]),this['showPage'](this['_pageIndex']);}['showPage'](_0xdb27dc){this['_pageIndex']=_0xdb27dc,this['_queryPageByIds']();}['query'](_0x244b2e){const _0xbce24a={_0x13c961:0xee0,_0xdb6962:0x433,_0x17cdfa:0x31e,_0x37c96a:0x525,_0xc024b5:0x470,_0x38df35:0x31e,_0x169e7f:0x5a7},_0x5d6199={_0x5def14:0xc4c,_0x5cd378:0x399,_0x3b4691:0x5ee},_0x167767={_0x684bf1:0x89d},_0x1ae2bc={_0x416c29:0x84a},_0x162510={_0x48ff94:0x41d},_0xca9249=_0x3d5d32;this['_pageIndex']=0x1,this['arrIDS']=[];const _0x36d362={'f':'json','inSr':0x10e6,'outSR':0x10e6,'outFields':'*','returnGeometry':!![],'where':_0x244b2e['where']||_0xca9249(0xf34)};this['options'][_0xca9249(_0xbce24a._0x13c961)]&&(_0x36d362['token']=this[_0xca9249(_0xbce24a._0xdb6962)]['token']);if(_0x244b2e[_0xca9249(0xaae)]){let _0xb8e357='';_0x244b2e['like']??!![]?_0xb8e357=_0x244b2e['column']+'\x20\x20like\x20\x27%'+_0x244b2e['text']+'%\x27\x20':_0xb8e357=_0x244b2e[_0xca9249(0xaae)]+'=\x27'+_0x244b2e['text']+'\x27',_0x36d362['where']=_0xb8e357;}if(_0x244b2e[_0xca9249(0x328)]){const _0x484e91=_0x244b2e[_0xca9249(0x328)];_0x36d362['spatialRel']='esriSpatialRelIntersects';if(_0x484e91['type']==='rectangle'){const _0x5c8877=_0x484e91['outlineCoordinates'];_0x36d362['geometryType']='esriGeometryEnvelope',_0x36d362['geometry']=JSON[_0xca9249(_0xbce24a._0x17cdfa)]({'xmin':_0x5c8877[0x0][0x0],'ymin':_0x5c8877[0x0][0x1],'xmax':_0x5c8877[0x2][0x0],'ymax':_0x5c8877[0x2][0x1],'spatialReference':{'wkid':0x10e6}});}else{if(Cesium__namespace['defined'](_0x484e91['xmax'])&&Cesium__namespace[_0xca9249(0xb84)](_0x484e91[_0xca9249(_0xbce24a._0x37c96a)])&&Cesium__namespace['defined'](_0x484e91[_0xca9249(_0xbce24a._0xc024b5)])&&Cesium__namespace['defined'](_0x484e91['ymax']))_0x36d362['geometryType']='esriGeometryEnvelope',_0x36d362['geometry']=JSON['stringify']({'xmin':_0x484e91['xmin'],'ymin':_0x484e91['ymin'],'xmax':_0x484e91['xmax'],'ymax':_0x484e91[_0xca9249(0x1058)],'spatialReference':{'wkid':0x10e6}});else{let _0x19430a;if(_0x484e91['type']==='polygon')_0x19430a=_0x484e91['toGeoJSON']();else _0x484e91[_0xca9249(0x7f5)]==='circle'?_0x19430a={'type':_0xca9249(0x5fc),'geometry':{'type':'Polygon','coordinates':[_0x484e91['outlineCoordinates']]}}:_0x19430a=_0x244b2e['graphic'];_0x36d362['geometry']=JSON[_0xca9249(_0xbce24a._0x38df35)](geojsonToArcGIS$1(_0x19430a[_0xca9249(_0xbce24a._0x169e7f)])),_0x36d362['geometryType']=geojsonTypeToArcGIS(_0x19430a[_0xca9249(_0xbce24a._0x169e7f)][_0xca9249(0x7f5)]);}}}return new Promise((_0x321c6d,_0x57c215)=>{const _0x249ab0={_0x8f7311:0x89d},_0x827006=_0xca9249;_0x244b2e['_promise']={'resolve':_0x321c6d,'reject':_0x57c215},_0x244b2e[_0x827006(_0x5d6199._0x5def14)]??!![]?(_0x36d362['returnIdsOnly']=!![],sendAjax({...this['options'],'url':this['url']+'/query','queryParameters':_0x36d362})['then'](_0xb39363=>{const _0x7b05e8=_0x827006,_0x4f732a=_0xb39363['objectIds'];_0x4f732a&&(this['arrIDS']=_0x4f732a,this['_allCount']=_0x4f732a['length'],this['_allPage']=Math['ceil'](this['_allCount']/this['_pageSize'])),delete _0x36d362['returnIdsOnly'],this[_0x7b05e8(_0x162510._0x48ff94)](_0x36d362,_0x244b2e);})[_0x827006(_0x5d6199._0x5cd378)](_0x45bfb7=>{const _0x2e69db=_0x827006;logError$1(_0x2e69db(_0x249ab0._0x8f7311),_0x45bfb7),_0x244b2e['error']&&_0x244b2e['error'](_0x45bfb7,_0x45bfb7['message']);})):sendAjax({...this['options'],'url':this[_0x827006(_0x5d6199._0x3b4691)]+'/query','queryParameters':_0x36d362})[_0x827006(0x44d)](_0x43dfc2=>{const _0x5b5618=_0x827006,_0x3347a6=arcgisToGeoJSON$1(_0x43dfc2);this[_0x5b5618(_0x1ae2bc._0x416c29)](_0x3347a6,_0x244b2e);})[_0x827006(0x399)](_0x708057=>{const _0x3d9c01=_0x827006;logError$1(_0x3d9c01(_0x167767._0x684bf1),_0x708057),_0x244b2e['error']&&_0x244b2e['error'](_0x708057,_0x708057['message']);});});}['_queryPageByIds'](_0x78284f,_0x500844){const _0x33a365={_0x47e078:0x8ff,_0x52b3cb:0xa20,_0x17be05:0x46b,_0x131d2b:0xb17,_0x4af9fc:0x44d,_0xe7bb2f:0x399},_0x46874b={_0x2aea91:0x89d},_0x547a9b={_0x23a583:0x84a},_0x34a859=_0x3d5d32;if(_0x78284f)this['lastParameters']=_0x78284f;else this['lastParameters']&&(_0x78284f=this[_0x34a859(_0x33a365._0x47e078)]);if(_0x500844)this['lastQueryOpts']=_0x500844;else this['lastParameters']&&(_0x500844=this[_0x34a859(0x709)]);if(!this['arrIDS']||this['arrIDS']['length']===0x0||this[_0x34a859(0x9b4)]<0x1||this['_pageIndex']>this['allPage']){var _0x5ecd1e;const _0x155d1c={'geojson':null,'count':0x0,'allCount':this[_0x34a859(_0x33a365._0x52b3cb)],'pageSize':this[_0x34a859(_0x33a365._0x17be05)],'allPage':this['allPage'],'pageIndex':this['pageIndex']};_0x500844['success']&&_0x500844['success'](_0x155d1c);(_0x5ecd1e=_0x500844['_promise'])!==null&&_0x5ecd1e!==void 0x0&&_0x5ecd1e['resolve']&&_0x500844['_promise']['resolve'](_0x155d1c);return;}const _0x20090d=(this[_0x34a859(0x9b4)]-0x1)*this['_pageSize'],_0x4c897e=this['_pageIndex']*this['_pageSize'],_0x580b7e=this[_0x34a859(0xd4e)]['slice'](_0x20090d,_0x4c897e);_0x78284f['objectIds']=_0x580b7e[_0x34a859(_0x33a365._0x131d2b)](','),sendAjax({...this['options'],'url':this[_0x34a859(0x5ee)]+'/query','queryParameters':_0x78284f})[_0x34a859(_0x33a365._0x4af9fc)](_0x27faae=>{const _0x2798b3=_0x34a859,_0x4d5eb4=arcgisToGeoJSON$1(_0x27faae);this[_0x2798b3(_0x547a9b._0x23a583)](_0x4d5eb4,_0x500844);})[_0x34a859(_0x33a365._0xe7bb2f)](_0x3b4020=>{const _0x3e1bf1=_0x34a859;logError$1(_0x3e1bf1(_0x46874b._0x2aea91),_0x3b4020),_0x500844[_0x3e1bf1(0x77b)]&&_0x500844[_0x3e1bf1(0x77b)](_0x3b4020,_0x3b4020['message']);});}['processFeatureCollection'](_0x453a70,_0x2f6465){const _0xd1fa14={_0x3e911c:0xf49,_0xd6fabf:0xc84},_0x45f5bc=_0x3d5d32;if(!_0x453a70||!_0x453a70[_0x45f5bc(0x7ab)]||_0x453a70['features']['length']===0x0){var _0x57ce8a;const _0x44c98d={'geojson':null,'count':0x0,'allCount':this['allCount'],'pageSize':this['pageSize'],'allPage':this['allPage'],'pageIndex':this[_0x45f5bc(_0xd1fa14._0x3e911c)]};_0x2f6465['success']&&_0x2f6465['success'](_0x44c98d),(_0x57ce8a=_0x2f6465['_promise'])!==null&&_0x57ce8a!==void 0x0&&_0x57ce8a['resolve']&&_0x2f6465['_promise']['resolve'](_0x44c98d);}else{const _0x528032=[];for(let _0x34aae9=0x0;_0x34aae9<_0x453a70['features']['length'];_0x34aae9++){var _0x4a8022,_0x389f89;const _0xbb259f=_0x453a70[_0x45f5bc(0x7ab)][_0x34aae9];(_0xbb259f===null||_0xbb259f===void 0x0?void 0x0:(_0x4a8022=_0xbb259f[_0x45f5bc(0x5a7)])===null||_0x4a8022===void 0x0?void 0x0:(_0x389f89=_0x4a8022['coordinates'])===null||_0x389f89===void 0x0?void 0x0:_0x389f89[_0x45f5bc(_0xd1fa14._0xd6fabf)])>0x0&&_0x528032['push'](_0xbb259f);}_0x453a70['features']=_0x528032;const _0x5435ce={'geojson':_0x453a70,'count':_0x453a70['features']['length'],'allCount':this['allCount'],'pageSize':this['pageSize'],'allPage':this['allPage'],'pageIndex':this[_0x45f5bc(0xf49)]};if(this['_geoJsonLayer'])this['_last_success']=_0x426f32=>{const _0x40aa6d=_0x45f5bc;var _0x1f1f3f;_0x5435ce['list']=_0x426f32,_0x2f6465['success']&&_0x2f6465[_0x40aa6d(0x9de)](_0x5435ce),(_0x1f1f3f=_0x2f6465[_0x40aa6d(0x227)])!==null&&_0x1f1f3f!==void 0x0&&_0x1f1f3f['resolve']&&_0x2f6465['_promise']['resolve'](_0x5435ce);},this['_geoJsonLayer']['load']({'data':_0x453a70});else{var _0x4b7581;_0x2f6465['success']&&_0x2f6465[_0x45f5bc(0x9de)](_0x5435ce),(_0x4b7581=_0x2f6465['_promise'])!==null&&_0x4b7581!==void 0x0&&_0x4b7581['resolve']&&_0x2f6465['_promise']['resolve'](_0x5435ce);}}}[_0x3d5d32(0x35a)](_0x293464){this['_last_success']&&(this['_last_success'](_0x293464['list']),this['_last_success']=null),this['fire'](EventType['load'],_0x293464);}['geoJsonLayer_onClickHandler'](_0x3eea7d){const _0x14fc8e=_0x3d5d32;this[_0x14fc8e(0xefc)](EventType['click'],{..._0x3eea7d,'layer':this['_geoJsonLayer']});}['clear'](){const _0x24a7cd={_0x55e8b5:0x921},_0x2eb13d=_0x3d5d32;this['_last_success']&&(this['_last_success']=null),this[_0x2eb13d(_0x24a7cd._0x55e8b5)]&&this['_geoJsonLayer']['clear']();}}function geojsonTypeToArcGIS(_0x105800){const _0x16d20e={_0x1ecf51:0xfb6},_0x7ba158=_0x3d5d32;let _0x32e1b2;switch(_0x105800){case'MultiPoint':_0x32e1b2='esriGeometryMultipoint';break;case'LineString':_0x32e1b2='esriGeometryPolyline';break;case'MultiLineString':_0x32e1b2='esriGeometryPolyline';break;case'Polygon':_0x32e1b2='esriGeometryPolygon';break;case _0x7ba158(_0x16d20e._0x1ecf51):_0x32e1b2='esriGeometryPolygon';break;case _0x7ba158(0xb39):default:_0x32e1b2='esriGeometryPoint';break;}return _0x32e1b2;}var index={'__proto__':null,'BaiduPOI':BaiduPOI,'GaodePOI':GaodePOI,'TdtPOI':TdtPOI,'GaodeRoute':GaodeRoute,'QueryGeoServer':QueryGeoServer,'QueryArcServer':QueryArcServer};const name='Mars3D三维可视化平台',website='http://mars3d.cn',author='合肥火星科技有限公司';exports['Cesium']=Cesium__namespace,Object['defineProperty'](exports,'Resource',{'enumerable':!![],'get':function(){return Cesium['Resource'];}}),exports['BaseClass']=BaseClass,exports['BaseMaterialConver']=BaseMaterialConver,exports[_0x3d5d32(0x49c)]=BaseStyleConver,exports['BaseThing']=BaseThing,exports[_0x3d5d32(0x889)]=BillboardStyleConver,exports['BoxStyleConver']=BoxStyleConver,exports[_0x3d5d32(0x200)]=CRS,exports[_0x3d5d32(0xe0a)]=ChinaCRS,exports['CircleStyleConver']=CircleStyleConver,exports['ClipType']=ClipType,exports['CloudStyleConver']=CloudStyleConver,exports['ColorOptsConver']=ColorOptsConver,exports['ControlType']=ControlType,exports['ControlUtil']=ControlUtil,exports[_0x3d5d32(0x8ba)]=CorridorStyleConver,exports['CylinderStyleConver']=CylinderStyleConver,exports['DivGraphicStyleConver']=DivGraphicStyleConver,exports['DomUtil']=DomUtil,exports['DrawUtil']=DrawUtil,exports['EffectType']=EffectType,exports['EffectUtil']=EffectUtil,exports[_0x3d5d32(0xc13)]=EllipsoidStyleConver,exports['EventType']=EventType,exports[_0x3d5d32(0xb41)]=GraphicType,exports[_0x3d5d32(0x6eb)]=GraphicUtil,exports[_0x3d5d32(0x255)]=GroundSkyBox,exports['GroupThing']=GroupThing,exports['Icon']=Icon,exports[_0x3d5d32(0xa05)]=ImageOptsConver,exports['LabelStyleConver']=LabelStyleConver,exports['Lang']=Lang,exports['LangType']=LangType,exports['LayerType']=LayerType,exports[_0x3d5d32(0xf56)]=LayerUtil,exports['LngLatArray']=LngLatArray,exports[_0x3d5d32(0xf7b)]=LngLatPoint,exports['LocalWorldTransform']=LocalWorldTransform,exports['Log']=Log,exports['Map']=Map,exports['MarsArray']=MarsArray,exports['MaterialType']=MaterialType$1,exports['MaterialUtil']=MaterialUtil,exports['MeasureUtil']=MeasureUtil,exports['ModelStyleConver']=ModelStyleConver,exports['MoveType']=MoveType,exports['MultipleSkyBox']=MultipleSkyBox,exports['PathStyleConver']=PathStyleConver,exports['PlaneStyleConver']=PlaneStyleConver,exports[_0x3d5d32(0x670)]=PointStyleConver,exports['PointTrans']=PointTrans,exports['PointUtil']=PointUtil,exports['PolyUtil']=PolyUtil,exports['PolygonStyleConver']=PolygonStyleConver,exports['PolylineStyleConver']=PolylineStyleConver,exports[_0x3d5d32(0xb0a)]=PolylineVolumeStyleConver,exports['RectangleStyleConver']=RectangleStyleConver,exports['RectangularSensorStyleConver']=RectangularSensorStyleConver,exports[_0x3d5d32(0x6d8)]=State,exports['Texture3']=Texture3,exports['Token']=Token,exports['Util']=Util,exports['WallStyleConver']=WallStyleConver,exports['author']=author,exports[_0x3d5d32(0x999)]=index$1,exports[_0x3d5d32(0xd1f)]=index$2,exports['graphic']=index$6,exports[_0x3d5d32(0x548)]=index$4,exports['material']=index$7,exports['name']=name,exports[_0x3d5d32(0xd0f)]=proj4,exports['provider']=index$5,exports['query']=index,exports['thing']=index$3,exports[_0x3d5d32(0x635)]=update,exports[_0x3d5d32(0xaaf)]=version,exports['website']=website,Object['defineProperty'](exports,'__esModule',{'value':!![]}); })); diff --git a/public/lib/mars3d/plugins/echarts/mars3d-echarts.js b/public/lib/mars3d/plugins/echarts/mars3d-echarts.js index 36191b94..35f64a2e 100644 --- a/public/lib/mars3d/plugins/echarts/mars3d-echarts.js +++ b/public/lib/mars3d/plugins/echarts/mars3d-echarts.js @@ -1,8 +1,8 @@ /** * Mars3D平台插件,结合echarts可视化功能插件 mars3d-echarts * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:31:11 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:11:05 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'echarts', 'mars3d'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-echarts"] = {}, global.echarts, global.mars3d)); })(this, (function (exports, echarts, mars3d) { -'use strict';const _0x2d49fc=_0x42fa;(function(_0x5b0794,_0x3a8e43){const _0x4c12e2={_0x497afe:0xec,_0x563705:0xd8,_0x22849f:0xcb,_0x5dc55e:0xf5},_0x3ee455=_0x42fa,_0xec817f=_0x5b0794();while(!![]){try{const _0x302ecd=parseInt(_0x3ee455(0xca))/0x1*(parseInt(_0x3ee455(_0x4c12e2._0x497afe))/0x2)+-parseInt(_0x3ee455(0xd1))/0x3*(-parseInt(_0x3ee455(_0x4c12e2._0x563705))/0x4)+parseInt(_0x3ee455(_0x4c12e2._0x22849f))/0x5+-parseInt(_0x3ee455(_0x4c12e2._0x5dc55e))/0x6+-parseInt(_0x3ee455(0xf9))/0x7+-parseInt(_0x3ee455(0xe8))/0x8+parseInt(_0x3ee455(0x105))/0x9*(parseInt(_0x3ee455(0xf3))/0xa);if(_0x302ecd===_0x3a8e43)break;else _0xec817f['push'](_0xec817f['shift']());}catch(_0xa2b666){_0xec817f['push'](_0xec817f['shift']());}}}(_0x17b1,0x9fb1d));function _interopNamespace(_0x5ee532){const _0x240e09=_0x42fa;if(_0x5ee532&&_0x5ee532['__esModule'])return _0x5ee532;var _0x125f4e=Object[_0x240e09(0x107)](null);return _0x5ee532&&Object[_0x240e09(0x109)](_0x5ee532)['forEach'](function(_0x517543){const _0xdd5550=_0x240e09;if(_0x517543!==_0xdd5550(0xe2)){var _0x35d7b3=Object['getOwnPropertyDescriptor'](_0x5ee532,_0x517543);Object['defineProperty'](_0x125f4e,_0x517543,_0x35d7b3['get']?_0x35d7b3:{'enumerable':!![],'get':function(){return _0x5ee532[_0x517543];}});}}),_0x125f4e['default']=_0x5ee532,_0x125f4e;}var echarts__namespace=_interopNamespace(echarts),mars3d__namespace=_interopNamespace(mars3d);const Cesium$1=mars3d__namespace[_0x2d49fc(0xf6)];class CompositeCoordinateSystem{constructor(_0x3769d9,_0x5d0fc8){const _0xa8b657={_0x48352e:0xd3,_0x5372da:0x108},_0x546228=_0x2d49fc;this[_0x546228(_0xa8b657._0x48352e)]=_0x3769d9,this['dimensions']=['lng','lat'],this[_0x546228(0xd0)]=[0x0,0x0],this[_0x546228(_0xa8b657._0x5372da)]=_0x5d0fc8;}[_0x2d49fc(0xf1)](_0x5c8034){this['_mapOffset']=_0x5c8034;}['getBMap'](){return this['_mars3d_scene'];}[_0x2d49fc(0xdf)](_0x5d366e){const _0x3d32ff={_0x36517d:0xfb,_0x2ccf3d:0xd0},_0x304c49=_0x2d49fc,_0x3d4168=this['_mars3d_scene'],_0x619358=[NaN,NaN];let _0x4d6174=_0x3d4168['echartsFixedHeight'];_0x3d4168[_0x304c49(0xf8)]&&(_0x4d6174=_0x3d4168['globe']['getHeight'](Cesium$1['Cartographic']['fromDegrees'](_0x5d366e[0x0],_0x5d366e[0x1])));const _0x235112=Cesium$1['Cartesian3']['fromDegrees'](_0x5d366e[0x0],_0x5d366e[0x1],_0x4d6174);if(!_0x235112)return _0x619358;const _0x211cf6=Cesium$1['SceneTransforms'][_0x304c49(_0x3d32ff._0x36517d)](_0x3d4168,_0x235112);if(!_0x211cf6)return _0x619358;if(_0x3d4168['echartsDepthTest']&&_0x3d4168['mode']===Cesium$1['SceneMode']['SCENE3D']){const _0x3f94ff=new Cesium$1['EllipsoidalOccluder'](_0x3d4168['globe']['ellipsoid'],_0x3d4168['camera']['positionWC']),_0x325eb3=_0x3f94ff['isPointVisible'](_0x235112);if(!_0x325eb3)return _0x619358;}return[_0x211cf6['x']-this[_0x304c49(_0x3d32ff._0x2ccf3d)][0x0],_0x211cf6['y']-this[_0x304c49(0xd0)][0x1]];}[_0x2d49fc(0xda)](){const _0x3c1a60=this['_api'];return new echarts__namespace['graphic']['BoundingRect'](0x0,0x0,_0x3c1a60['getWidth'](),_0x3c1a60['getHeight']());}['getRoamTransform'](){const _0x456206=_0x2d49fc;return echarts__namespace[_0x456206(0xd6)]['create']();}}CompositeCoordinateSystem['dimensions']=['lng','lat'],CompositeCoordinateSystem[_0x2d49fc(0x107)]=function(_0x408cc6,_0x5131f6){const _0x3fe002={_0x439926:0xd3},_0x3d7586=_0x2d49fc;let _0x5267af;const _0x564cae=_0x408cc6['scheduler']['ecInstance'][_0x3d7586(_0x3fe002._0x439926)];_0x408cc6['eachComponent'](_0x3d7586(0xdb),function(_0x55f78a){const _0x275fe3=_0x5131f6['getZr']()['painter'];if(!_0x275fe3)return;!_0x5267af&&(_0x5267af=new CompositeCoordinateSystem(_0x564cae,_0x5131f6)),_0x55f78a['coordinateSystem']=_0x5267af,_0x5267af['setMapOffset'](_0x55f78a['__mapOffset']||[0x0,0x0]);}),_0x408cc6['eachSeries'](function(_0x2e59ad){const _0x29853b=_0x3d7586;_0x2e59ad['get'](_0x29853b(0xcf))===_0x29853b(0xdb)&&(!_0x5267af&&(_0x5267af=new CompositeCoordinateSystem(_0x564cae,_0x5131f6)),_0x2e59ad['coordinateSystem']=_0x5267af);});};if(echarts__namespace!==null&&echarts__namespace!==void 0x0&&echarts__namespace['init'])echarts__namespace['registerCoordinateSystem']('mars3dMap',CompositeCoordinateSystem),echarts__namespace['registerAction']({'type':'mars3dMapRoam','event':'mars3dMapRoam','update':'updateLayout'},function(_0x4f7d28,_0x13def1){}),echarts__namespace['extendComponentModel']({'type':'mars3dMap','getBMap':function(){const _0x463755=_0x2d49fc;return this[_0x463755(0xd3)];},'defaultOption':{'roam':![]}}),echarts__namespace[_0x2d49fc(0xf0)]({'type':'mars3dMap','init':function(_0x1edf45,_0x921ed6){const _0x5b8346=_0x2d49fc;this['api']=_0x921ed6,this[_0x5b8346(0xcc)]=_0x1edf45[_0x5b8346(0xe4)]['ecInstance']['_mars3d_scene'],this['scene']['postRender']['addEventListener'](this['moveHandler'],this);},'moveHandler':function(_0x350b98,_0x96839a){const _0x5914a5=_0x2d49fc;this[_0x5914a5(0xe5)]['dispatchAction']({'type':'mars3dMapRoam'});},'render':function(_0x518edc,_0x2d8e23,_0x4a8f4b){},'dispose':function(_0x133b58){this['scene']['postRender']['removeEventListener'](this['moveHandler'],this);}});else throw new Error(_0x2d49fc(0xe9));function _0x42fa(_0x2b2876,_0x51dbfe){const _0x17b180=_0x17b1();return _0x42fa=function(_0x42fa14,_0x34aba3){_0x42fa14=_0x42fa14-0xca;let _0x555fde=_0x17b180[_0x42fa14];return _0x555fde;},_0x42fa(_0x2b2876,_0x51dbfe);}function _0x17b1(){const _0x332c64=['max','echartsFixedHeight','options','450rxpMfB','series','create','_api','keys','346FMPWAt','920700PuiNtf','scene','coords','fromDegrees','coordinateSystem','_mapOffset','6flsWha','none','_mars3d_scene','layer','forEach','matrix','left','1648488mnwIGZ','dispose','getViewRect','mars3dMap','isFormat','visible','value','dataToPoint','style','_echartsInstance','default','_createChartOverlay','scheduler','api','pointerEvents','div','10112448ZdhHsl','请引入\x20echarts\x20库\x20','register','absolute','3866yGxlgA','_removedHook','defineProperty','isArray','extendComponentView','setMapOffset','_map','444240KlAXyf','setEchartsOption','5778480CwWaZi','Cesium','DomUtil','echartsAutoHeight','7120099dIePpU','width','wgs84ToWindowCoordinates','echartsDepthTest','canvas','_echartsContainer','hasOwnProperty','height','_addedHook'];_0x17b1=function(){return _0x332c64;};return _0x17b1();}const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'];class EchartsLayer extends BaseLayer{constructor(_0x1aeb1a={}){super(_0x1aeb1a),this['_pointerEvents']=this['options']['pointerEvents'];}get[_0x2d49fc(0xd4)](){const _0x44c152=_0x2d49fc;return this[_0x44c152(0xe1)];}get[_0x2d49fc(0xe6)](){return this['_pointerEvents'];}set[_0x2d49fc(0xe6)](_0x32666c){const _0xaec774={_0x1aadbf:0xfe,_0xcdfef8:0xe6,_0x12b7d4:0xfe,_0x10fb5b:0xe0},_0x4ad4cd=_0x2d49fc;this['_pointerEvents']=_0x32666c,this[_0x4ad4cd(0xfe)]&&(_0x32666c?this[_0x4ad4cd(_0xaec774._0x1aadbf)]['style'][_0x4ad4cd(_0xaec774._0xcdfef8)]='all':this[_0x4ad4cd(_0xaec774._0x12b7d4)][_0x4ad4cd(_0xaec774._0x10fb5b)]['pointerEvents']='none');}['_setOptionsHook'](_0x38c510,_0x495e1a){this['setEchartsOption'](_0x38c510);}['_showHook'](_0x39bcc4){const _0x581673=_0x2d49fc;_0x39bcc4?this[_0x581673(0xfe)]['style']['visibility']=_0x581673(0xdd):this[_0x581673(0xfe)]['style']['visibility']='hidden';}['_mountedHook'](){const _0x52c53e={_0x452d47:0xfc,_0x56a56d:0x104,_0x3942c4:0x103},_0x3f91a8=_0x2d49fc;this['_map']['scene'][_0x3f91a8(_0x52c53e._0x452d47)]=this[_0x3f91a8(_0x52c53e._0x56a56d)]['depthTest']??!![],this['_map']['scene']['echartsAutoHeight']=this['options']['clampToGround']??![],this[_0x3f91a8(0xf2)]['scene'][_0x3f91a8(_0x52c53e._0x3942c4)]=this['options']['fixedHeight']??0x0;}[_0x2d49fc(0x101)](){const _0x4e2603=_0x2d49fc;this['_echartsContainer']=this[_0x4e2603(0xe3)](),this['_echartsInstance']=echarts__namespace['init'](this['_echartsContainer']),this['_echartsInstance']['_mars3d_scene']=this['_map']['scene'],this['setEchartsOption'](this['options']);}[_0x2d49fc(0xed)](){const _0x8d0aa2={_0x142132:0xe1},_0x216790=_0x2d49fc;this[_0x216790(_0x8d0aa2._0x142132)]&&(this['_echartsInstance']['clear'](),this['_echartsInstance'][_0x216790(0xd9)](),delete this[_0x216790(0xe1)]),this['_echartsContainer']&&(this['_map']['container']['removeChild'](this[_0x216790(0xfe)]),delete this[_0x216790(0xfe)]);}['_createChartOverlay'](){const _0x340878={_0x1339c4:0xeb,_0x3aac29:0xfa},_0x15625b=_0x2d49fc,_0x49da6c=mars3d__namespace[_0x15625b(0xf7)]['create'](_0x15625b(0xe7),'mars3d-echarts',this['_map']['container']);return _0x49da6c['id']=this['id'],_0x49da6c['style']['position']=_0x15625b(_0x340878._0x1339c4),_0x49da6c['style']['top']='0px',_0x49da6c['style'][_0x15625b(0xd7)]='0px',_0x49da6c['style'][_0x15625b(_0x340878._0x3aac29)]=this['_map'][_0x15625b(0xcc)]['canvas']['clientWidth']+'px',_0x49da6c['style']['height']=this['_map']['scene']['canvas']['clientHeight']+'px',_0x49da6c['style']['pointerEvents']=this['_pointerEvents']?'all':_0x15625b(0xd2),_0x49da6c['style']['zIndex']=this['options']['zIndex']??0x9,_0x49da6c;}['resize'](){const _0x35b400={_0x22ec42:0xfd,_0x48197f:0xe1},_0x13e5a0=_0x2d49fc;if(!this['_echartsInstance'])return;this['_echartsContainer']['style']['width']=this['_map']['scene'][_0x13e5a0(_0x35b400._0x22ec42)]['clientWidth']+'px',this['_echartsContainer']['style'][_0x13e5a0(0x100)]=this['_map']['scene']['canvas']['clientHeight']+'px',this[_0x13e5a0(_0x35b400._0x48197f)]['resize']();}[_0x2d49fc(0xf4)](_0x468457,_0xec7d18,_0x2e763b){const _0xaf712d=_0x2d49fc;this['_echartsInstance']&&(_0x468457[_0xaf712d(0xdb)]=_0x468457['mars3dMap']||{},this['_echartsInstance']['setOption'](_0x468457,_0xec7d18,_0x2e763b));}['getRectangle'](_0x1d2579){const _0x42b191={_0x51fbe9:0x106,_0x9cb504:0xdc,_0x1ac25b:0xce},_0x1a0790={_0x169f02:0xcd,_0x253b8c:0xd5},_0x34a890={_0x35f196:0xef},_0x31ebee=_0x2d49fc;let _0x5d2033,_0xd76e1e,_0x337010,_0x412947;function _0x383597(_0x524751){const _0x4cec40=_0x42fa;if(!Array[_0x4cec40(_0x34a890._0x35f196)](_0x524751))return;const _0x169753=_0x524751[0x0]||0x0,_0x425f0b=_0x524751[0x1]||0x0;_0x169753!==0x0&&_0x425f0b!==0x0&&(_0x5d2033===undefined?(_0x5d2033=_0x169753,_0xd76e1e=_0x169753,_0x337010=_0x425f0b,_0x412947=_0x425f0b):(_0x5d2033=Math['min'](_0x5d2033,_0x169753),_0xd76e1e=Math[_0x4cec40(0x102)](_0xd76e1e,_0x169753),_0x337010=Math['min'](_0x337010,_0x425f0b),_0x412947=Math['max'](_0x412947,_0x425f0b)));}const _0x2384e7=this['options'][_0x31ebee(_0x42b191._0x51fbe9)];_0x2384e7&&_0x2384e7['forEach'](_0x31dcc5=>{const _0x53bc94=_0x31ebee;_0x31dcc5['data']&&_0x31dcc5['data'][_0x53bc94(0xd5)](_0xd651d=>{const _0x119701=_0x53bc94;if(_0xd651d['value'])_0x383597(_0xd651d[_0x119701(0xde)]);else _0xd651d['coords']&&_0xd651d[_0x119701(_0x1a0790._0x169f02)][_0x119701(_0x1a0790._0x253b8c)](_0x17d65d=>{_0x383597(_0x17d65d);});});});if(_0x5d2033===0x0&&_0x337010===0x0&&_0xd76e1e===0x0&&_0x412947===0x0)return null;return _0x1d2579!==null&&_0x1d2579!==void 0x0&&_0x1d2579[_0x31ebee(_0x42b191._0x9cb504)]?{'xmin':_0x5d2033,'xmax':_0xd76e1e,'ymin':_0x337010,'ymax':_0x412947}:Cesium['Rectangle'][_0x31ebee(_0x42b191._0x1ac25b)](_0x5d2033,_0x337010,_0xd76e1e,_0x412947);}['on'](_0x5ae525,_0x51f3ae,_0x4b96ed){const _0x158e1a={_0x49868b:0xe1},_0x1ea589=_0x2d49fc;return this[_0x1ea589(_0x158e1a._0x49868b)]['on'](_0x5ae525,_0x51f3ae,_0x4b96ed||this),this;}['onByQuery'](_0x1eed71,_0x3f5cb7,_0xc374ad,_0x2e563f){return this['_echartsInstance']['on'](_0x1eed71,_0x3f5cb7,_0xc374ad,_0x2e563f||this),this;}['off'](_0x5328dc,_0xb139af,_0x121cc5){const _0x8eb4a5={_0x37a750:0xe1},_0x1110e1=_0x2d49fc;return this[_0x1110e1(_0x8eb4a5._0x37a750)]['off'](_0x5328dc,_0xb139af,_0x121cc5||this),this;}}mars3d__namespace['LayerUtil'][_0x2d49fc(0xea)]('echarts',EchartsLayer),mars3d__namespace['layer']['EchartsLayer']=EchartsLayer,exports['EchartsLayer']=EchartsLayer,Object['keys'](echarts)[_0x2d49fc(0xd5)](function(_0x2f7aec){const _0x4058f4=_0x2d49fc;if(_0x2f7aec!=='default'&&!exports[_0x4058f4(0xff)](_0x2f7aec))Object[_0x4058f4(0xee)](exports,_0x2f7aec,{'enumerable':!![],'get':function(){return echarts[_0x2f7aec];}});}),Object['defineProperty'](exports,'__esModule',{'value':!![]}); +'use strict';const _0x1b2592=_0x3e8c;(function(_0x52eef3,_0x52d5c5){const _0x87e614={_0x13be8d:0x14f,_0x4ffe05:0x160,_0x476b60:0x136,_0x3f31ed:0x168,_0x1b601a:0x162},_0x4ac101=_0x3e8c,_0x5761a0=_0x52eef3();while(!![]){try{const _0x248312=parseInt(_0x4ac101(_0x87e614._0x13be8d))/0x1*(parseInt(_0x4ac101(0x16b))/0x2)+parseInt(_0x4ac101(_0x87e614._0x4ffe05))/0x3+-parseInt(_0x4ac101(_0x87e614._0x476b60))/0x4*(parseInt(_0x4ac101(_0x87e614._0x3f31ed))/0x5)+parseInt(_0x4ac101(0x16c))/0x6+-parseInt(_0x4ac101(0x147))/0x7*(parseInt(_0x4ac101(0x131))/0x8)+parseInt(_0x4ac101(0x13a))/0x9+parseInt(_0x4ac101(_0x87e614._0x1b601a))/0xa;if(_0x248312===_0x52d5c5)break;else _0x5761a0['push'](_0x5761a0['shift']());}catch(_0x20c77e){_0x5761a0['push'](_0x5761a0['shift']());}}}(_0x217a,0x9b217));function _interopNamespace(_0x35f2e6){const _0x200157={_0x443716:0x146,_0x5de980:0x133},_0x4347d2=_0x3e8c;if(_0x35f2e6&&_0x35f2e6['__esModule'])return _0x35f2e6;var _0x26d4f0=Object[_0x4347d2(_0x200157._0x443716)](null);return _0x35f2e6&&Object[_0x4347d2(0x15d)](_0x35f2e6)[_0x4347d2(_0x200157._0x5de980)](function(_0x4cec20){if(_0x4cec20!=='default'){var _0x581cb=Object['getOwnPropertyDescriptor'](_0x35f2e6,_0x4cec20);Object['defineProperty'](_0x26d4f0,_0x4cec20,_0x581cb['get']?_0x581cb:{'enumerable':!![],'get':function(){return _0x35f2e6[_0x4cec20];}});}}),_0x26d4f0[_0x4347d2(0x156)]=_0x35f2e6,_0x26d4f0;}var echarts__namespace=_interopNamespace(echarts),mars3d__namespace=_interopNamespace(mars3d);function _0x217a(){const _0x1757e8=['_removedHook','width','eachComponent','create','322FSmqcs','camera','clampToGround','coords','series','mars3dMap','_pointerEvents','container','299091vdJfMM','echartsDepthTest','value','getViewRect','defineProperty','scene','hasOwnProperty','default','SCENE3D','eachSeries','setEchartsOption','left','registerAction','getHeight','keys','height','_mars3d_scene','1267623LAOUYO','DomUtil','1339660mgBesi','style','_map','0px','extendComponentModel','absolute','4960dqgvJR','pointerEvents','matrix','6lyBXwq','2440560UNxdSP','请引入\x20echarts\x20库\x20','coordinateSystem','mars3dMapRoam','echarts','postRender','off','max','ecInstance','onByQuery','Cartesian3','_mapOffset','58768FtjdVz','EchartsLayer','forEach','options','_echartsInstance','3608lYZCNw','init','scheduler','globe','68175fFXnht','_echartsContainer','resize','setMapOffset','SceneMode','_api','layer','depthTest','min'];_0x217a=function(){return _0x1757e8;};return _0x217a();}const Cesium$1=mars3d__namespace['Cesium'];class CompositeCoordinateSystem{constructor(_0x52db53,_0x35e934){const _0x49d6e6=_0x3e8c;this['_mars3d_scene']=_0x52db53,this['dimensions']=['lng','lat'],this['_mapOffset']=[0x0,0x0],this[_0x49d6e6(0x13f)]=_0x35e934;}[_0x1b2592(0x13d)](_0x170ae1){this['_mapOffset']=_0x170ae1;}['getBMap'](){return this['_mars3d_scene'];}['dataToPoint'](_0x50daf6){const _0x3eeb3d={_0x58f48c:0x15f,_0x2cec95:0x139,_0x3102d6:0x15c,_0x5887d9:0x176,_0x16c0af:0x13e,_0xa01987:0x157},_0x14ed3d=_0x1b2592,_0x2ad452=this[_0x14ed3d(_0x3eeb3d._0x58f48c)],_0x5efc9c=[NaN,NaN];let _0x160deb=_0x2ad452['echartsFixedHeight'];_0x2ad452['echartsAutoHeight']&&(_0x160deb=_0x2ad452[_0x14ed3d(_0x3eeb3d._0x2cec95)][_0x14ed3d(_0x3eeb3d._0x3102d6)](Cesium$1['Cartographic']['fromDegrees'](_0x50daf6[0x0],_0x50daf6[0x1])));const _0x4bf5ac=Cesium$1[_0x14ed3d(_0x3eeb3d._0x5887d9)]['fromDegrees'](_0x50daf6[0x0],_0x50daf6[0x1],_0x160deb);if(!_0x4bf5ac)return _0x5efc9c;const _0x40c2d2=Cesium$1['SceneTransforms']['wgs84ToWindowCoordinates'](_0x2ad452,_0x4bf5ac);if(!_0x40c2d2)return _0x5efc9c;if(_0x2ad452['echartsDepthTest']&&_0x2ad452['mode']===Cesium$1[_0x14ed3d(_0x3eeb3d._0x16c0af)][_0x14ed3d(_0x3eeb3d._0xa01987)]){const _0x26579b=new Cesium$1['EllipsoidalOccluder'](_0x2ad452['globe']['ellipsoid'],_0x2ad452[_0x14ed3d(0x148)]['positionWC']),_0x3181f6=_0x26579b['isPointVisible'](_0x4bf5ac);if(!_0x3181f6)return _0x5efc9c;}return[_0x40c2d2['x']-this[_0x14ed3d(0x177)][0x0],_0x40c2d2['y']-this['_mapOffset'][0x1]];}[_0x1b2592(0x152)](){const _0x280a0f=_0x1b2592,_0x85cff9=this[_0x280a0f(0x13f)];return new echarts__namespace['graphic']['BoundingRect'](0x0,0x0,_0x85cff9['getWidth'](),_0x85cff9[_0x280a0f(0x15c)]());}['getRoamTransform'](){const _0x5f3568={_0xef180e:0x16a,_0x3452e6:0x146},_0x472d58=_0x1b2592;return echarts__namespace[_0x472d58(_0x5f3568._0xef180e)][_0x472d58(_0x5f3568._0x3452e6)]();}}CompositeCoordinateSystem['dimensions']=['lng','lat'],CompositeCoordinateSystem['create']=function(_0x3ff511,_0x536662){const _0x45e38c={_0x76c90c:0x158},_0xd8e08c={_0x54fbef:0x16e},_0x410ad9={_0x4b151c:0x16e},_0x166044=_0x1b2592;let _0x2d453f;const _0x4ce434=_0x3ff511[_0x166044(0x138)][_0x166044(0x174)]['_mars3d_scene'];_0x3ff511[_0x166044(0x145)]('mars3dMap',function(_0x7d50c5){const _0x14a37e=_0x166044,_0xf14cad=_0x536662['getZr']()['painter'];if(!_0xf14cad)return;!_0x2d453f&&(_0x2d453f=new CompositeCoordinateSystem(_0x4ce434,_0x536662)),_0x7d50c5[_0x14a37e(_0x410ad9._0x4b151c)]=_0x2d453f,_0x2d453f['setMapOffset'](_0x7d50c5['__mapOffset']||[0x0,0x0]);}),_0x3ff511[_0x166044(_0x45e38c._0x76c90c)](function(_0x2e6415){const _0x23517f=_0x166044;_0x2e6415['get']('coordinateSystem')==='mars3dMap'&&(!_0x2d453f&&(_0x2d453f=new CompositeCoordinateSystem(_0x4ce434,_0x536662)),_0x2e6415[_0x23517f(_0xd8e08c._0x54fbef)]=_0x2d453f);});};if(echarts__namespace!==null&&echarts__namespace!==void 0x0&&echarts__namespace['init'])echarts__namespace['registerCoordinateSystem']('mars3dMap',CompositeCoordinateSystem),echarts__namespace[_0x1b2592(0x15b)]({'type':_0x1b2592(0x16f),'event':_0x1b2592(0x16f),'update':'updateLayout'},function(_0x4f99c6,_0x4c09e0){}),echarts__namespace[_0x1b2592(0x166)]({'type':_0x1b2592(0x14c),'getBMap':function(){return this['_mars3d_scene'];},'defaultOption':{'roam':![]}}),echarts__namespace['extendComponentView']({'type':'mars3dMap','init':function(_0x3bec7c,_0x5c92f3){const _0x212385={_0x21aa64:0x154},_0x68a867=_0x1b2592;this['api']=_0x5c92f3,this[_0x68a867(_0x212385._0x21aa64)]=_0x3bec7c['scheduler']['ecInstance'][_0x68a867(0x15f)],this[_0x68a867(0x154)][_0x68a867(0x171)]['addEventListener'](this['moveHandler'],this);},'moveHandler':function(_0x4a7d5f,_0x570fae){const _0x16feb7={_0x3b4bb3:0x16f},_0x1b41c8=_0x1b2592;this['api']['dispatchAction']({'type':_0x1b41c8(_0x16feb7._0x3b4bb3)});},'render':function(_0x24d8de,_0x4699e0,_0x172f07){},'dispose':function(_0x45ad95){this['scene']['postRender']['removeEventListener'](this['moveHandler'],this);}});else throw new Error(_0x1b2592(0x16d));function _0x3e8c(_0x4b224b,_0xcbeb88){const _0x217a43=_0x217a();return _0x3e8c=function(_0x3e8cf3,_0x2827df){_0x3e8cf3=_0x3e8cf3-0x131;let _0x290074=_0x217a43[_0x3e8cf3];return _0x290074;},_0x3e8c(_0x4b224b,_0xcbeb88);}const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'];class EchartsLayer extends BaseLayer{constructor(_0x470f99={}){const _0x50e6d7={_0x48de7c:0x14d},_0x2f9f48=_0x1b2592;super(_0x470f99),this[_0x2f9f48(_0x50e6d7._0x48de7c)]=this['options']['pointerEvents'];}get['layer'](){return this['_echartsInstance'];}get['pointerEvents'](){return this['_pointerEvents'];}set['pointerEvents'](_0x472917){const _0x19d876={_0x26ac01:0x169,_0x366fe2:0x13b},_0x1acca4=_0x1b2592;this['_pointerEvents']=_0x472917,this['_echartsContainer']&&(_0x472917?this[_0x1acca4(0x13b)][_0x1acca4(0x163)][_0x1acca4(_0x19d876._0x26ac01)]='all':this[_0x1acca4(_0x19d876._0x366fe2)]['style']['pointerEvents']='none');}['_setOptionsHook'](_0xaebd6c,_0x52c6f4){this['setEchartsOption'](_0xaebd6c);}['_showHook'](_0xe5f96a){_0xe5f96a?this['_echartsContainer']['style']['visibility']='visible':this['_echartsContainer']['style']['visibility']='hidden';}['_mountedHook'](){const _0x160d8d={_0x4a99f1:0x141,_0x309a04:0x154,_0x4f50e1:0x149,_0x119c72:0x134},_0xb4e933=_0x1b2592;this['_map'][_0xb4e933(0x154)][_0xb4e933(0x150)]=this['options'][_0xb4e933(_0x160d8d._0x4a99f1)]??!![],this[_0xb4e933(0x164)][_0xb4e933(_0x160d8d._0x309a04)]['echartsAutoHeight']=this[_0xb4e933(0x134)][_0xb4e933(_0x160d8d._0x4f50e1)]??![],this[_0xb4e933(0x164)]['scene']['echartsFixedHeight']=this[_0xb4e933(_0x160d8d._0x119c72)]['fixedHeight']??0x0;}['_addedHook'](){const _0x13ac81=_0x1b2592;this['_echartsContainer']=this['_createChartOverlay'](),this[_0x13ac81(0x135)]=echarts__namespace[_0x13ac81(0x137)](this['_echartsContainer']),this['_echartsInstance']['_mars3d_scene']=this[_0x13ac81(0x164)]['scene'],this['setEchartsOption'](this[_0x13ac81(0x134)]);}[_0x1b2592(0x143)](){const _0x4c01be={_0x45d462:0x164},_0x156a88=_0x1b2592;this['_echartsInstance']&&(this['_echartsInstance']['clear'](),this['_echartsInstance']['dispose'](),delete this['_echartsInstance']),this['_echartsContainer']&&(this[_0x156a88(_0x4c01be._0x45d462)]['container']['removeChild'](this[_0x156a88(0x13b)]),delete this['_echartsContainer']);}['_createChartOverlay'](){const _0x2678bd={_0x25d498:0x161,_0x124b9b:0x14e,_0x15c75a:0x167,_0x5f072e:0x163,_0x4ac466:0x165,_0x2758ad:0x154},_0x23b828=_0x1b2592,_0x294926=mars3d__namespace[_0x23b828(_0x2678bd._0x25d498)]['create']('div','mars3d-echarts',this['_map'][_0x23b828(_0x2678bd._0x124b9b)]);return _0x294926['id']=this['id'],_0x294926['style']['position']=_0x23b828(_0x2678bd._0x15c75a),_0x294926[_0x23b828(_0x2678bd._0x5f072e)]['top']=_0x23b828(_0x2678bd._0x4ac466),_0x294926['style'][_0x23b828(0x15a)]=_0x23b828(0x165),_0x294926['style'][_0x23b828(0x144)]=this['_map'][_0x23b828(_0x2678bd._0x2758ad)]['canvas']['clientWidth']+'px',_0x294926['style']['height']=this['_map']['scene']['canvas']['clientHeight']+'px',_0x294926[_0x23b828(_0x2678bd._0x5f072e)][_0x23b828(0x169)]=this['_pointerEvents']?'all':'none',_0x294926['style']['zIndex']=this['options']['zIndex']??0x9,_0x294926;}['resize'](){const _0x504325={_0x3e1ad5:0x13b,_0x3684da:0x15e,_0xd8cacb:0x13c},_0x408365=_0x1b2592;if(!this['_echartsInstance'])return;this['_echartsContainer']['style']['width']=this['_map']['scene']['canvas']['clientWidth']+'px',this[_0x408365(_0x504325._0x3e1ad5)]['style'][_0x408365(_0x504325._0x3684da)]=this['_map']['scene']['canvas']['clientHeight']+'px',this['_echartsInstance'][_0x408365(_0x504325._0xd8cacb)]();}[_0x1b2592(0x159)](_0x5319d6,_0x21f90e,_0xddac11){const _0x57987f={_0x2dc9a0:0x14c},_0x2dc9b4=_0x1b2592;this['_echartsInstance']&&(_0x5319d6[_0x2dc9b4(_0x57987f._0x2dc9a0)]=_0x5319d6['mars3dMap']||{},this['_echartsInstance']['setOption'](_0x5319d6,_0x21f90e,_0xddac11));}['getRectangle'](_0x1bbefd){const _0x6213b5={_0x5ade27:0x14b,_0x286044:0x133},_0x531f87=_0x1b2592;let _0xc1e074,_0x579fb4,_0xd3d00a,_0x29f371;function _0x4861a8(_0x3c457f){const _0x1b2dc2=_0x3e8c;if(!Array['isArray'](_0x3c457f))return;const _0x302db6=_0x3c457f[0x0]||0x0,_0x2955e3=_0x3c457f[0x1]||0x0;_0x302db6!==0x0&&_0x2955e3!==0x0&&(_0xc1e074===undefined?(_0xc1e074=_0x302db6,_0x579fb4=_0x302db6,_0xd3d00a=_0x2955e3,_0x29f371=_0x2955e3):(_0xc1e074=Math['min'](_0xc1e074,_0x302db6),_0x579fb4=Math['max'](_0x579fb4,_0x302db6),_0xd3d00a=Math[_0x1b2dc2(0x142)](_0xd3d00a,_0x2955e3),_0x29f371=Math[_0x1b2dc2(0x173)](_0x29f371,_0x2955e3)));}const _0x485d3e=this['options'][_0x531f87(_0x6213b5._0x5ade27)];_0x485d3e&&_0x485d3e[_0x531f87(_0x6213b5._0x286044)](_0x4cd87b=>{const _0x5bf82b={_0x202323:0x151,_0x48a92a:0x14a};_0x4cd87b['data']&&_0x4cd87b['data']['forEach'](_0x2259b2=>{const _0x2bca5a=_0x3e8c;if(_0x2259b2[_0x2bca5a(_0x5bf82b._0x202323)])_0x4861a8(_0x2259b2[_0x2bca5a(_0x5bf82b._0x202323)]);else _0x2259b2[_0x2bca5a(_0x5bf82b._0x48a92a)]&&_0x2259b2[_0x2bca5a(0x14a)][_0x2bca5a(0x133)](_0xd05d73=>{_0x4861a8(_0xd05d73);});});});if(_0xc1e074===0x0&&_0xd3d00a===0x0&&_0x579fb4===0x0&&_0x29f371===0x0)return null;return _0x1bbefd!==null&&_0x1bbefd!==void 0x0&&_0x1bbefd['isFormat']?{'xmin':_0xc1e074,'xmax':_0x579fb4,'ymin':_0xd3d00a,'ymax':_0x29f371}:Cesium['Rectangle']['fromDegrees'](_0xc1e074,_0xd3d00a,_0x579fb4,_0x29f371);}['on'](_0x1687a5,_0x13ac27,_0x68bae8){return this['_echartsInstance']['on'](_0x1687a5,_0x13ac27,_0x68bae8||this),this;}[_0x1b2592(0x175)](_0x3b772d,_0x8fd648,_0x1c9e3e,_0x1173ab){return this['_echartsInstance']['on'](_0x3b772d,_0x8fd648,_0x1c9e3e,_0x1173ab||this),this;}[_0x1b2592(0x172)](_0x5ac1cb,_0x2a23fa,_0x42544e){const _0x4192be={_0x4eea16:0x135},_0x230f10=_0x1b2592;return this[_0x230f10(_0x4192be._0x4eea16)]['off'](_0x5ac1cb,_0x2a23fa,_0x42544e||this),this;}}mars3d__namespace['LayerUtil']['register'](_0x1b2592(0x170),EchartsLayer),mars3d__namespace[_0x1b2592(0x140)]['EchartsLayer']=EchartsLayer,mars3d__namespace['echarts']=echarts__namespace,exports[_0x1b2592(0x132)]=EchartsLayer,Object['keys'](echarts)['forEach'](function(_0x17524b){const _0x36bcc7={_0xfcc238:0x156},_0x458388=_0x1b2592;if(_0x17524b!==_0x458388(_0x36bcc7._0xfcc238)&&!exports[_0x458388(0x155)](_0x17524b))Object['defineProperty'](exports,_0x17524b,{'enumerable':!![],'get':function(){return echarts[_0x17524b];}});}),Object[_0x1b2592(0x153)](exports,'__esModule',{'value':!![]}); })); diff --git a/public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js b/public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js index 74096c83..0cf7e2d5 100644 --- a/public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js +++ b/public/lib/mars3d/plugins/heatmap/mars3d-heatmap.js @@ -1,8 +1,8 @@ /** * Mars3D平台插件,结合heatmap可视化功能插件 mars3d-heatmap * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:31:10 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:11:04 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'mars3d', '@mars3d/heatmap.js'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-heatmap"] = {}, global.mars3d, global.h337)); })(this, (function (exports, mars3d, h337) { -'use strict';const _0x2aa105=_0x346a;(function(_0x1a3477,_0x104d67){const _0x2efced={_0x5354ed:0xe4,_0x3c8e11:0xf3,_0x2c9cc7:0x128},_0x31c3df=_0x346a,_0x3c6a79=_0x1a3477();while(!![]){try{const _0x1b1407=parseInt(_0x31c3df(0x104))/0x1+-parseInt(_0x31c3df(0xfa))/0x2*(parseInt(_0x31c3df(0xe7))/0x3)+-parseInt(_0x31c3df(0x112))/0x4+parseInt(_0x31c3df(0x113))/0x5*(parseInt(_0x31c3df(0x121))/0x6)+parseInt(_0x31c3df(_0x2efced._0x5354ed))/0x7+-parseInt(_0x31c3df(_0x2efced._0x3c8e11))/0x8+-parseInt(_0x31c3df(_0x2efced._0x2c9cc7))/0x9*(-parseInt(_0x31c3df(0x10d))/0xa);if(_0x1b1407===_0x104d67)break;else _0x3c6a79['push'](_0x3c6a79['shift']());}catch(_0x2a4161){_0x3c6a79['push'](_0x3c6a79['shift']());}}}(_0x11c5,0xe81ca));function _interopNamespace(_0x55a2cb){const _0x106d8a={_0x128b05:0x117},_0x5c34b5={_0x7e22ce:0xd8},_0x9d1a19=_0x346a;if(_0x55a2cb&&_0x55a2cb['__esModule'])return _0x55a2cb;var _0x303b74=Object[_0x9d1a19(_0x106d8a._0x128b05)](null);return _0x55a2cb&&Object['keys'](_0x55a2cb)['forEach'](function(_0x56ea61){const _0x29c8d5=_0x9d1a19;if(_0x56ea61!=='default'){var _0x3b5bbd=Object[_0x29c8d5(0xfe)](_0x55a2cb,_0x56ea61);Object[_0x29c8d5(_0x5c34b5._0x7e22ce)](_0x303b74,_0x56ea61,_0x3b5bbd[_0x29c8d5(0x119)]?_0x3b5bbd:{'enumerable':!![],'get':function(){return _0x55a2cb[_0x56ea61];}});}}),_0x303b74['default']=_0x55a2cb,_0x303b74;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial='uniform\x20sampler2D\x20image;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0)\x20||\x20colorImage.rgb\x20==\x20vec3(0.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20return\x20material;\x0a}\x0a';if(!h337__namespace['create'])throw new Error('请引入\x20heatmap.js\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer'][_0x2aa105(0x10e)],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:'green',0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x2a9389={}){const _0xce9155={_0x21a091:0x10c,_0x2b150f:0x10c,_0x25f8bf:0x127,_0x4eef30:0xd2,_0x568e05:0xed},_0x3e7735=_0x2aa105;super(_0x2a9389),this[_0x3e7735(_0xce9155._0x21a091)]['maxCanvasSize']=this[_0x3e7735(_0xce9155._0x2b150f)][_0x3e7735(_0xce9155._0x25f8bf)]??document['body']['clientWidth'],this['options']['maxCanvasSize']=Math['min'](this['options'][_0x3e7735(_0xce9155._0x25f8bf)],0x1388),this['options']['minCanvasSize']=this['options']['minCanvasSize']??document['body'][_0x3e7735(0x116)],this['options']['minCanvasSize']=Math[_0x3e7735(0xef)](this['options'][_0x3e7735(_0xce9155._0x4eef30)],0x2bc),this['options'][_0x3e7735(_0xce9155._0x568e05)]={...DEF_HEATSTYLE,...this[_0x3e7735(0x10c)]['heatStyle']||{}},this['options']['style']={...DEF_STYLE,...this['options'][_0x3e7735(0xf0)]||{}};}get[_0x2aa105(0xff)](){const _0x50af22=_0x2aa105;return this[_0x50af22(0x110)];}get['heatStyle'](){const _0x164d90=_0x2aa105;return this['options'][_0x164d90(0xed)];}set['heatStyle'](_0x2e11d4){const _0x5e533c={_0x307da7:0x10c,_0x553700:0x12c},_0x10cdc8=_0x2aa105;this['options'][_0x10cdc8(0xed)]=mars3d__namespace[_0x10cdc8(0xec)]['merge'](this[_0x10cdc8(_0x5e533c._0x307da7)]['heatStyle'],_0x2e11d4),this['_heat']&&(this[_0x10cdc8(0x129)]['configure'](this['options']['heatStyle']),this[_0x10cdc8(_0x5e533c._0x553700)](!![]));}get[_0x2aa105(0xf0)](){return this['options']['style'];}set['style'](_0x1f231f){const _0x1e0edc={_0x66fb3b:0xfc},_0x47f2e3=_0x2aa105;this['options']['style']=mars3d__namespace['Util'][_0x47f2e3(_0x1e0edc._0x66fb3b)](this['options']['style'],_0x1f231f);}get['positions'](){const _0x4cc222=_0x2aa105;return this[_0x4cc222(0xf6)];}set['positions'](_0x470403){this['setPositions'](_0x470403);}get['coordinates'](){const _0x7ea0a4=_0x2aa105,_0x5dbeec=[];return this[_0x7ea0a4(0xf9)]['forEach'](_0x3ab0c7=>{_0x5dbeec['push'](_0x3ab0c7['toArray']());}),_0x5dbeec;}get['rectangle'](){const _0x29e18a={_0xb4f4ec:0x120},_0x1559e0=_0x2aa105;return this[_0x1559e0(_0x29e18a._0xb4f4ec)];}['_setOptionsHook'](_0x52c625,_0x45befd){_0x52c625['positions']&&(this['positions']=_0x52c625['positions']);}['_mountedHook'](){const _0x37c740={_0x29d789:0xff,_0x9aef69:0x110},_0x111f8b=_0x2aa105;this['style'][_0x111f8b(0x11c)]==='image'?this[_0x111f8b(0x110)]=new mars3d__namespace[(_0x111f8b(_0x37c740._0x29d789))][(_0x111f8b(0xdc))]({'crs':_0x111f8b(0xdd),'private':!![]}):this[_0x111f8b(_0x37c740._0x9aef69)]=new mars3d__namespace['layer'][(_0x111f8b(0xe3))]({'private':!![]});}[_0x2aa105(0xd9)](){const _0x4a09e3={_0xeeec26:0xcf},_0x5e5a14=_0x2aa105;this['_map'][_0x5e5a14(_0x4a09e3._0xeeec26)](this['_layer']),this['_container']=mars3d__namespace['DomUtil']['create']('div',_0x5e5a14(0x11f),this['_map']['container']),this['options']['positions']&&(this['positions']=this['options']['positions']),this['options']['flyTo']&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x2ca87c={_0x4aac76:0xe0,_0xa9524:0x110},_0x19c1ba=_0x2aa105;this[_0x19c1ba(_0x2ca87c._0x4aac76)]&&(mars3d__namespace['DomUtil']['remove'](this['_container']),delete this['_container']),this['clear'](),this['_map']['removeLayer'](this[_0x19c1ba(_0x2ca87c._0xa9524)]);}[_0x2aa105(0x106)](_0x224293,_0x673fab){const _0x550a05=_0x2aa105;this['_positions']=this['_positions']||[],this[_0x550a05(0xf6)]['push'](_0x224293),this[_0x550a05(0x12c)](_0x673fab);}[_0x2aa105(0x122)](_0x4b04c2,_0x249d76){const _0x561af5={_0x295d2c:0x12c},_0x228118=_0x2aa105;this['_positions']=_0x4b04c2,this[_0x228118(_0x561af5._0x295d2c)](_0x249d76);}['clear'](){this['_graphic']&&(this['_layer']['removeGraphic'](this['_graphic'],!![]),delete this['_graphic']),this['_graphic2']&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x38aaf7){const _0x516d76={_0x42fbf3:0x110,_0x43f0f7:0xd3,_0x177ad6:0xeb,_0x3a0ec8:0xd3,_0x12e132:0x12e,_0x11bb26:0xd3,_0x4cdb55:0x12d,_0xe8a26f:0xdf},_0x2d8ffe=_0x2aa105;if(!this['show']||!this['_map']||!this['positions']||this['positions'][_0x2d8ffe(0xda)]===0x0)return this;const _0x4577be=this[_0x2d8ffe(0xd0)]();if(this['style']['type']==='image')this[_0x2d8ffe(_0x516d76._0x42fbf3)]['setOptions']({'url':_0x4577be['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this[_0x2d8ffe(_0x516d76._0x43f0f7)]&&_0x38aaf7?(this[_0x2d8ffe(_0x516d76._0x43f0f7)][_0x2d8ffe(0x12d)][_0x2d8ffe(_0x516d76._0x177ad6)]=_0x4577be,this[_0x2d8ffe(_0x516d76._0x3a0ec8)]['uniforms']['bumpMap']=this[_0x2d8ffe(_0x516d76._0x12e132)](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x4577be,this[_0x2d8ffe(0xfd)]['uniforms']['bumpMap']=this['_graphic']['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x4577be):this[_0x2d8ffe(0xd3)]&&_0x38aaf7?this[_0x2d8ffe(_0x516d76._0x11bb26)][_0x2d8ffe(_0x516d76._0x4cdb55)][_0x2d8ffe(0xeb)]=_0x4577be:this[_0x2d8ffe(_0x516d76._0xe8a26f)](_0x4577be);return this;}['_createGraphic'](_0x44284b){const _0x23645a={_0x14d375:0x120},_0x5338ab=_0x2aa105;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x5338ab(_0x23645a._0x14d375)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x44284b},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer']['addGraphic'](this['_graphic']);}['_createArcGraphic'](_0x635ee4){const _0x242e62={_0x354798:0x11b,_0x1d0ebb:0x11d,_0x512618:0x115,_0x573e91:0x103,_0x2b6d0f:0xee,_0x31556f:0xe6,_0x5e6f33:0x10a,_0x346186:0xf5,_0x10a3a5:0x120,_0x46481a:0x120,_0x4d17e7:0xf0,_0x3ea722:0xd3,_0x1ce7fe:0x108,_0x1d2499:0x110},_0x56ee5a=_0x2aa105;this['clear']();const _0x6e9a98=Cesium[_0x56ee5a(_0x242e62._0x354798)]['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction'][_0x56ee5a(_0x242e62._0x1d0ebb)],'frontOperation':{'fail':Cesium[_0x56ee5a(_0x242e62._0x512618)]['KEEP'],'zFail':Cesium[_0x56ee5a(_0x242e62._0x512618)][_0x56ee5a(_0x242e62._0x573e91)],'zPass':Cesium['StencilOperation'][_0x56ee5a(_0x242e62._0x2b6d0f)]},'backFunction':Cesium[_0x56ee5a(0xe2)][_0x56ee5a(_0x242e62._0x1d0ebb)],'backOperation':{'fail':Cesium[_0x56ee5a(0x115)]['KEEP'],'zFail':Cesium['StencilOperation'][_0x56ee5a(0x103)],'zPass':Cesium[_0x56ee5a(_0x242e62._0x512618)]['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium[_0x56ee5a(_0x242e62._0x31556f)]['ALPHA_BLEND']}),_0x3bb48f=Math['floor'](this['style']['diffHeight']??this[_0x56ee5a(_0x242e62._0x5e6f33)]*0.02)+0.1;this['style']['diffHeight']&&delete this['style'][_0x56ee5a(_0x242e62._0x346186)];const _0x18ab30=(this['style']['splitNum'],0x64);let _0x940355=Math['max'](this[_0x56ee5a(_0x242e62._0x10a3a5)]['height'],this[_0x56ee5a(_0x242e62._0x46481a)]['width']);this[_0x56ee5a(_0x242e62._0x4d17e7)][_0x56ee5a(0xfb)]=_0x940355/=_0x18ab30;const _0x26d272=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x635ee4,'repeat':new Cesium[(_0x56ee5a(0xf7))](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x4035ea=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace['graphic'][(_0x56ee5a(0xea))]({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x6e9a98,'material':_0x26d272,'vertexShaderSource':getVertexShaderSource(_0x3bb48f*_0x4035ea)})}),this['_layer'][_0x56ee5a(0x126)](this[_0x56ee5a(_0x242e62._0x3ea722)]),this['style'][_0x56ee5a(_0x242e62._0x1ce7fe)]===0x0&&(this['_graphic2']=new mars3d__namespace['graphic'][(_0x56ee5a(0xea))]({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x6e9a98,'material':_0x26d272,'vertexShaderSource':getVertexShaderSource(-_0x3bb48f)})}),this[_0x56ee5a(_0x242e62._0x1d2499)]['addGraphic'](this['_graphic2']));}[_0x2aa105(0xf4)](_0x2b15a2){const _0x3647c3={_0x52b78f:0x120},_0x5883ac=_0x2aa105;return _0x2b15a2!==null&&_0x2b15a2!==void 0x0&&_0x2b15a2['isFormat']&&this['_rectangle']?mars3d__namespace['PolyUtil']['formatRectangle'](this['_rectangle']):this[_0x5883ac(_0x3647c3._0x52b78f)];}['_getHeatCanvas'](){const _0x47c524={_0x1a0de8:0x10a,_0xc0f448:0x10c,_0x11645e:0xed,_0x214d91:0x111,_0x1f6c7a:0x11a,_0x5539c0:0x124,_0x3a9c70:0xf1,_0x5a731b:0x12f,_0x597ce6:0xdb,_0x1c127c:0x12a,_0x5043a3:0x109},_0xca4626={_0x6d988f:0x125},_0x477a9c={_0x9d3811:0x10b,_0x1961b6:0xd6},_0x2100ff=_0x2aa105,_0x28a714=this['_positions'],_0x499f05=[];let _0x138904,_0x380186,_0x79c97d,_0x46f65c;_0x28a714[_0x2100ff(0x11a)](_0x21abe3=>{const _0x4e86a4=_0x2100ff,_0x192fd1=mars3d__namespace['LngLatPoint']['parse'](_0x21abe3);if(!_0x192fd1)return;_0x192fd1[_0x4e86a4(_0x477a9c._0x9d3811)]=_0x21abe3[_0x4e86a4(0x10b)]||0x1,!this['options']['rectangle']&&(_0x138904===undefined?(_0x138904=_0x192fd1['lng'],_0x380186=_0x192fd1['lng'],_0x79c97d=_0x192fd1['lat'],_0x46f65c=_0x192fd1['lat']):(_0x138904=Math[_0x4e86a4(_0x477a9c._0x1961b6)](_0x138904,_0x192fd1[_0x4e86a4(0x101)]),_0x380186=Math['max'](_0x380186,_0x192fd1['lng']),_0x79c97d=Math[_0x4e86a4(0xd6)](_0x79c97d,_0x192fd1['lat']),_0x46f65c=Math['max'](_0x46f65c,_0x192fd1['lat']))),_0x499f05['push'](_0x192fd1);});let _0x31276e=this['options']['rectangle']||{'xmin':_0x138904,'xmax':_0x380186,'ymin':_0x79c97d,'ymax':_0x46f65c};const _0xb2fb3c=getMercatorBounds(_0x31276e),_0x54abb8=Math['abs'](_0xb2fb3c['xmax']-_0xb2fb3c['xmin']),_0x49e387=Math['abs'](_0xb2fb3c['ymax']-_0xb2fb3c['ymin']),_0x16c86b=Math['max'](_0x54abb8,_0x49e387),_0x100917=Math['min'](_0x54abb8,_0x49e387);this[_0x2100ff(_0x47c524._0x1a0de8)]=_0x16c86b;let _0x27bfb7=0x1;if(_0x16c86b>this[_0x2100ff(0x10c)]['maxCanvasSize'])_0x27bfb7=_0x16c86b/this[_0x2100ff(_0x47c524._0xc0f448)]['maxCanvasSize'],_0x100917/_0x27bfb7this[_0x2100ff(_0x47c524._0xc0f448)]['maxCanvasSize']&&(_0x27bfb7=_0x16c86b/this['options']['maxCanvasSize']));const _0x176ef2=this[_0x2100ff(_0x47c524._0x11645e)][_0x2100ff(_0x47c524._0x214d91)]*1.5,_0x1e2167=_0x54abb8/_0x27bfb7+_0x176ef2*0x2,_0x32ddda=_0x49e387/_0x27bfb7+_0x176ef2*0x2,_0xf3784d=_0x176ef2*_0x27bfb7;_0xb2fb3c['xmin']-=_0xf3784d,_0xb2fb3c[_0x2100ff(0xf1)]-=_0xf3784d,_0xb2fb3c['xmax']+=_0xf3784d,_0xb2fb3c['ymax']+=_0xf3784d,this['_scale']=_0x27bfb7,_0x31276e=geLatLngBounds(_0xb2fb3c),this[_0x2100ff(0x120)]=Cesium[_0x2100ff(0xd5)][_0x2100ff(0x118)](_0x31276e['xmin'],_0x31276e[_0x2100ff(0xf1)],_0x31276e[_0x2100ff(0xf8)],_0x31276e['ymax']);let _0x5f2226=_0x499f05[0x0]['value']??0x1,_0x19ee77=_0x499f05[0x0]['value']??0x0;const _0x455796=[];_0x499f05[_0x2100ff(_0x47c524._0x1f6c7a)](_0x9408a8=>{const _0x146fbf=_0x2100ff,_0x355335=mars3d__namespace['PointTrans'][_0x146fbf(_0xca4626._0x6d988f)]([_0x9408a8['lng'],_0x9408a8['lat']]),_0x380325=_0x9408a8['value']||0x1,_0x5d582c=Math['round']((_0x355335[0x0]-_0xb2fb3c['xmin'])/_0x27bfb7),_0x770d84=Math['round']((_0xb2fb3c['ymax']-_0x355335[0x1])/_0x27bfb7);_0x5f2226=Math['max'](_0x5f2226,_0x380325),_0x19ee77=Math['min'](_0x19ee77,_0x380325),_0x455796[_0x146fbf(0x102)]({'x':_0x5d582c,'y':_0x770d84,'value':_0x380325});});const _0x18e59c={'min':this['options'][_0x2100ff(0xd6)]??_0x19ee77,'max':this['options'][_0x2100ff(0xef)]??_0x5f2226,'data':_0x455796};this[_0x2100ff(0x105)]=_0x18e59c;if(!this[_0x2100ff(_0x47c524._0x5539c0)]||_0xb2fb3c['xmin']!==this[_0x2100ff(_0x47c524._0x5539c0)]['xmin']||_0xb2fb3c[_0x2100ff(_0x47c524._0x3a9c70)]!==this['_last_mBounds']['ymin']||_0xb2fb3c[_0x2100ff(0xf8)]!==this[_0x2100ff(0x124)]['xmax']||_0xb2fb3c['ymax']!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0xb2fb3c,this['_container']['style'][_0x2100ff(_0x47c524._0x5a731b)]=_0x2100ff(_0x47c524._0x597ce6)+_0x1e2167+'px;height:'+_0x32ddda+'px;';const _0x6d5f29={...this[_0x2100ff(0xed)],'container':this['_container']};!this[_0x2100ff(0x129)]?this['_heat']=h337__namespace['create'](_0x6d5f29):this['_heat']['configure'](_0x6d5f29);}this['_heat'][_0x2100ff(_0x47c524._0x1c127c)](_0x18e59c);const _0x55a83d=mars3d__namespace[_0x2100ff(_0x47c524._0x5043a3)]['copyCanvas'](this[_0x2100ff(0x129)]['_renderer']['canvas']);return _0x55a83d;}[_0x2aa105(0x12e)](){const _0x15d02c={_0x35c545:0xf0,_0x318a7d:0x11e,_0x2a8eeb:0xe9,_0x4712d3:0x10c},_0x4838df=_0x2aa105;this['_heat'][_0x4838df(0x114)]({'radius':this['heatStyle'][_0x4838df(0x111)]*this[_0x4838df(_0x15d02c._0x35c545)]['arcRadiusScale'],'blur':this['heatStyle'][_0x4838df(_0x15d02c._0x318a7d)]*this[_0x4838df(0xf0)]['arcBlurScale'],'gradient':this[_0x4838df(0xed)][_0x4838df(_0x15d02c._0x2a8eeb)]||{0.25:_0x4838df(0x10f),0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x42e6ee=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x4838df(0x129)][_0x4838df(0xf2)]['canvas']);return this['_heat']['configure'](this[_0x4838df(_0x15d02c._0x4712d3)]['heatStyle']),_0x42e6ee;}['getPointData'](_0x12fc47){const _0x71eb68={_0x2fc1cd:0x123,_0x2185b7:0xe8,_0x5f4343:0x107,_0x2d2104:0x100},_0x115b9d=_0x2aa105,_0x83e5ee=mars3d__namespace['LngLatPoint'][_0x115b9d(0xd7)](_0x12fc47);if(!_0x83e5ee)return{};const _0x5161d4=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x83e5ee['lng'],_0x83e5ee['lat']]),_0x594278=this['_last_mBounds'],_0x3d8059=Math['round']((_0x5161d4[0x0]-_0x594278['xmin'])/this[_0x115b9d(_0x71eb68._0x2fc1cd)]),_0x42cd4e=Math[_0x115b9d(_0x71eb68._0x2185b7)]((_0x594278[_0x115b9d(_0x71eb68._0x5f4343)]-_0x5161d4[0x1])/this['_scale']),_0x24b407=this['_heat'][_0x115b9d(0xde)]({'x':_0x3d8059,'y':_0x42cd4e}),_0x40ba3c=this['_heat']['_renderer'][_0x115b9d(_0x71eb68._0x2d2104)]['getImageData'](_0x3d8059-0x1,_0x42cd4e-0x1,0x1,0x1)['data'];return{'x':_0x3d8059,'y':_0x42cd4e,'value':_0x24b407,'color':_0x115b9d(0xe5)+_0x40ba3c[0x0]+','+_0x40ba3c[0x1]+','+_0x40ba3c[0x2]+','+_0x40ba3c[0x3]+')'};}}function _0x11c5(){const _0x44acdd=['addPosition','ymax','arcDirection','DomUtil','_mBoundsMax','value','options','70FdRoSf','BaseLayer','rgb(0,0,0)','_layer','radius','3987308UKlgml','10CUsUbK','configure','StencilOperation','clientHeight','create','fromDegrees','get','forEach','RenderState','type','ALWAYS','blur','mars3d-heatmap\x20mars3d-hideDiv','_rectangle','3752556AolNGd','setPositions','_scale','_last_mBounds','lonlat2mercator','addGraphic','maxCanvasSize','2176110AyFyUD','_heat','setData','PointTrans','_updatePositionsHook','uniforms','_getArcHeatCanvas','cssText','addLayer','_getHeatCanvas','mercator2lonlat','minCanvasSize','_graphic','HeatLayer','Rectangle','min','parse','defineProperty','_addedHook','length','width:','ImageLayer','EPSG:3857','getValueAt','_createGraphic','_container','xmin','StencilFunction','GraphicLayer','4669833KXYhdW','rgba(','BlendingState','1104cqDeSn','round','gradientArc','RectanglePrimitive','image','Util','heatStyle','REPLACE','max','style','ymin','_renderer','10774600nftmvM','getRectangle','diffHeight','_positions','Cartesian2','xmax','points','6128JXvPeG','granularity','merge','_graphic2','getOwnPropertyDescriptor','layer','ctx','lng','push','KEEP','811433sWXgoA','_last_heatData'];_0x11c5=function(){return _0x44acdd;};return _0x11c5();}mars3d__namespace[_0x2aa105(0xff)]['HeatLayer']=HeatLayer,mars3d__namespace['LayerUtil']['register']('heat',HeatLayer);function getMercatorBounds(_0x35e0df){const _0x5e8d44=_0x2aa105,_0x524b3a=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x35e0df['xmin'],_0x35e0df['ymin']]),_0x1e7845=mars3d__namespace['PointTrans'][_0x5e8d44(0x125)]([_0x35e0df['xmax'],_0x35e0df['ymax']]);return{'xmin':_0x524b3a[0x0],'ymin':_0x524b3a[0x1],'xmax':_0x1e7845[0x0],'ymax':_0x1e7845[0x1]};}function geLatLngBounds(_0x5befcc){const _0x387338={_0x111ddc:0xd1,_0x181ef5:0xf1},_0x153f6f=_0x2aa105,_0x5f23bc=mars3d__namespace['PointTrans'][_0x153f6f(_0x387338._0x111ddc)]([_0x5befcc[_0x153f6f(0xe1)],_0x5befcc[_0x153f6f(_0x387338._0x181ef5)]]),_0x20914d=mars3d__namespace[_0x153f6f(0x12b)]['mercator2lonlat']([_0x5befcc['xmax'],_0x5befcc['ymax']]);return{'xmin':_0x5f23bc[0x0],'ymin':_0x5f23bc[0x1],'xmax':_0x20914d[0x0],'ymax':_0x20914d[0x1]};}function getVertexShaderSource(_0x257011){return'in\x20vec3\x20position3DHigh;\x0a\x20\x20in\x20vec3\x20position3DLow;\x0a\x20\x20in\x20vec2\x20st;\x0a\x20\x20in\x20float\x20batchId;\x0a\x20\x20uniform\x20sampler2D\x20bumpMap_3;\x0a\x20\x20out\x20vec3\x20v_positionMC;\x0a\x20\x20out\x20vec3\x20v_positionEC;\x0a\x20\x20out\x20vec2\x20v_st;\x0a\x0a\x20\x20void\x20main()\x0a\x20\x20{\x0a\x20\x20\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x20\x20\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x0a\x20\x20\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20\x20\x20v_st\x20=\x20st;\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(bumpMap_3,\x20v_st);\x0a\x20\x20\x20\x20float\x20centerBump\x20=\x20distance(vec3(0.0),color.rgb);\x0a\x20\x20\x20\x20vec3\x20upDir\x20=\x20normalize(v_positionMC.xyz);\x0a\x20\x20\x20\x20vec3\x20disPos\x20=\x20upDir\x20*\x20centerBump\x20*\x20'+_0x257011+';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a';}function _0x346a(_0x3e4e31,_0x32e15e){const _0x11c555=_0x11c5();return _0x346a=function(_0x346a7d,_0x22ff41){_0x346a7d=_0x346a7d-0xcf;let _0x169a2d=_0x11c555[_0x346a7d];return _0x169a2d;},_0x346a(_0x3e4e31,_0x32e15e);}exports[_0x2aa105(0xd4)]=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]}); +'use strict';const _0x315cc2=_0x3b6e;function _0x3b6e(_0x57a322,_0x32978d){const _0x47b43e=_0x47b4();return _0x3b6e=function(_0x3b6e00,_0x431b9c){_0x3b6e00=_0x3b6e00-0x1cb;let _0x490a7d=_0x47b43e[_0x3b6e00];return _0x490a7d;},_0x3b6e(_0x57a322,_0x32978d);}(function(_0x4e02d7,_0x133da8){const _0xe14f5c={_0x50f48e:0x20d,_0x498ac7:0x1db,_0x5740ae:0x1ff,_0x46a8b0:0x1f4,_0x411229:0x1df,_0x58fe75:0x200},_0x53b643=_0x3b6e,_0x3fc047=_0x4e02d7();while(!![]){try{const _0x4e7b77=-parseInt(_0x53b643(_0xe14f5c._0x50f48e))/0x1*(parseInt(_0x53b643(_0xe14f5c._0x498ac7))/0x2)+parseInt(_0x53b643(0x20e))/0x3+parseInt(_0x53b643(_0xe14f5c._0x5740ae))/0x4*(-parseInt(_0x53b643(0x1f7))/0x5)+parseInt(_0x53b643(0x1e2))/0x6*(parseInt(_0x53b643(_0xe14f5c._0x46a8b0))/0x7)+parseInt(_0x53b643(_0xe14f5c._0x411229))/0x8+-parseInt(_0x53b643(0x1ed))/0x9*(parseInt(_0x53b643(0x20f))/0xa)+parseInt(_0x53b643(_0xe14f5c._0x58fe75))/0xb;if(_0x4e7b77===_0x133da8)break;else _0x3fc047['push'](_0x3fc047['shift']());}catch(_0x303217){_0x3fc047['push'](_0x3fc047['shift']());}}}(_0x47b4,0xa4282));function _interopNamespace(_0x40a8e3){const _0x2a6752={_0x3cd191:0x213},_0x4c5822=_0x3b6e;if(_0x40a8e3&&_0x40a8e3['__esModule'])return _0x40a8e3;var _0x66c728=Object['create'](null);return _0x40a8e3&&Object['keys'](_0x40a8e3)['forEach'](function(_0xeafd84){if(_0xeafd84!=='default'){var _0x56f997=Object['getOwnPropertyDescriptor'](_0x40a8e3,_0xeafd84);Object['defineProperty'](_0x66c728,_0xeafd84,_0x56f997['get']?_0x56f997:{'enumerable':!![],'get':function(){return _0x40a8e3[_0xeafd84];}});}}),_0x66c728[_0x4c5822(_0x2a6752._0x3cd191)]=_0x40a8e3,_0x66c728;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial='uniform\x20sampler2D\x20image;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0)\x20||\x20colorImage.rgb\x20==\x20vec3(0.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20return\x20material;\x0a}\x0a';if(!h337__namespace['create'])throw new Error('请引入\x20heatmap.js\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:_0x315cc2(0x1f0),0.8:'yellow',0.9:_0x315cc2(0x1fa)}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};function _0x47b4(){const _0x25f1ec=['116188dMOVWs','11952809eFVBAQ','cssText','show','type','register','arcBlurScale','xmin','arcDirection','canvas','lat','style','ymax','_graphic','490868vClcia','2037741xSTwwH','4050140SWCfLU','StencilFunction','heatStyle','EllipsoidSurfaceAppearance','default','rgba(','bumpMap','toArray','_scale','_createGraphic','gradientArc','body','ymin','diffHeight','ALWAYS','setData','DomUtil','_container','options','min','_map','Material','_heat','removeLayer','__esModule','_layer','_renderer','arc','flyTo','_graphic2','_updatePositionsHook','2yRxgHB','floor','maxCanvasSize','graphic','320360IoXPCU','_positions','StencilOperation','18KMUOiQ','splitNum','merge','rgb(216,216,216)','isFormat','image','minCanvasSize','addPosition','forEach','positions','uniforms','9TOrBIf','clear','max','green','_getArcHeatCanvas','remove','image/png','123263ONkYKr','_rectangle','fromDegrees','50XZVTmI','_removedHook','Util','red','RectanglePrimitive','_last_heatData','push','coordinates'];_0x47b4=function(){return _0x25f1ec;};return _0x47b4();}class HeatLayer extends BaseLayer{constructor(_0x4153b9={}){const _0x198d7f={_0x9efc42:0x1dd,_0x4c3932:0x21a},_0x790d81=_0x315cc2;super(_0x4153b9),this['options'][_0x790d81(_0x198d7f._0x9efc42)]=this[_0x790d81(0x1ce)]['maxCanvasSize']??document['body']['clientWidth'],this['options'][_0x790d81(0x1dd)]=Math[_0x790d81(0x1cf)](this['options']['maxCanvasSize'],0x1388),this['options']['minCanvasSize']=this[_0x790d81(0x1ce)]['minCanvasSize']??document[_0x790d81(_0x198d7f._0x4c3932)]['clientHeight'],this['options'][_0x790d81(0x1e8)]=Math['max'](this['options'][_0x790d81(0x1e8)],0x2bc),this[_0x790d81(0x1ce)]['heatStyle']={...DEF_HEATSTYLE,...this[_0x790d81(0x1ce)]['heatStyle']||{}},this['options']['style']={...DEF_STYLE,...this['options']['style']||{}};}get['layer'](){const _0xb5498b={_0x127259:0x1d5},_0x442663=_0x315cc2;return this[_0x442663(_0xb5498b._0x127259)];}get[_0x315cc2(0x211)](){return this['options']['heatStyle'];}set['heatStyle'](_0x216fed){const _0x1b343a={_0x480177:0x211,_0xeb6db3:0x1d2,_0x11bec4:0x211},_0x141571=_0x315cc2;this['options'][_0x141571(_0x1b343a._0x480177)]=mars3d__namespace['Util']['merge'](this[_0x141571(0x1ce)][_0x141571(0x211)],_0x216fed),this[_0x141571(_0x1b343a._0xeb6db3)]&&(this['_heat']['configure'](this['options'][_0x141571(_0x1b343a._0x11bec4)]),this['_updatePositionsHook'](!![]));}get['style'](){const _0x1a50e1=_0x315cc2;return this['options'][_0x1a50e1(0x20a)];}set['style'](_0x2af985){const _0xdad0ab={_0x35ab2d:0x1e4},_0xba32db=_0x315cc2;this['options'][_0xba32db(0x20a)]=mars3d__namespace[_0xba32db(0x1f9)][_0xba32db(_0xdad0ab._0x35ab2d)](this['options']['style'],_0x2af985);}get['positions'](){return this['_positions'];}set[_0x315cc2(0x1eb)](_0xb961aa){this['setPositions'](_0xb961aa);}get[_0x315cc2(0x1fe)](){const _0x1738da=[];return this['points']['forEach'](_0x458071=>{const _0x982bf1=_0x3b6e;_0x1738da['push'](_0x458071[_0x982bf1(0x216)]());}),_0x1738da;}get['rectangle'](){return this['_rectangle'];}['_setOptionsHook'](_0x1da4bb,_0x35aa78){_0x1da4bb['positions']&&(this['positions']=_0x1da4bb['positions']);}['_mountedHook'](){const _0x36bc85=_0x315cc2;this[_0x36bc85(0x20a)][_0x36bc85(0x203)]==='image'?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this['_layer']=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x437c41={_0x479659:0x1d0,_0xa43b14:0x1d5},_0x291319=_0x315cc2;this[_0x291319(_0x437c41._0x479659)]['addLayer'](this[_0x291319(_0x437c41._0xa43b14)]),this['_container']=mars3d__namespace['DomUtil']['create']('div','mars3d-heatmap\x20mars3d-hideDiv',this[_0x291319(0x1d0)]['container']),this[_0x291319(0x1ce)]['positions']&&(this['positions']=this['options']['positions']),this['options'][_0x291319(0x1d8)]&&this['flyToByAnimationEnd']();}[_0x315cc2(0x1f8)](){const _0x29cd93={_0x55bb74:0x1d3},_0x482399=_0x315cc2;this['_container']&&(mars3d__namespace[_0x482399(0x1cc)][_0x482399(0x1f2)](this['_container']),delete this[_0x482399(0x1cd)]),this['clear'](),this['_map'][_0x482399(_0x29cd93._0x55bb74)](this['_layer']);}[_0x315cc2(0x1e9)](_0x48afb8,_0x5cdd9c){const _0x3afd95=_0x315cc2;this['_positions']=this[_0x3afd95(0x1e0)]||[],this['_positions'][_0x3afd95(0x1fd)](_0x48afb8),this['_updatePositionsHook'](_0x5cdd9c);}['setPositions'](_0x31dd95,_0x1d1f7a){const _0x1a3d0c=_0x315cc2;this['_positions']=_0x31dd95,this[_0x1a3d0c(0x1da)](_0x1d1f7a);}['clear'](){const _0x45f17a={_0x1e2163:0x1d9},_0x2e3979=_0x315cc2;this['_graphic']&&(this[_0x2e3979(0x1d5)]['removeGraphic'](this['_graphic'],!![]),delete this['_graphic']),this[_0x2e3979(_0x45f17a._0x1e2163)]&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this[_0x2e3979(0x1d9)]);}[_0x315cc2(0x1da)](_0x105cda){const _0x460c41={_0x4e8d1f:0x202,_0x50b01a:0x1d0,_0x5a7069:0x203,_0x4629e8:0x1f3,_0x2440c8:0x1d7,_0x39b302:0x1ec,_0x4f460b:0x1ec},_0x3647ac=_0x315cc2;if(!this[_0x3647ac(_0x460c41._0x4e8d1f)]||!this[_0x3647ac(_0x460c41._0x50b01a)]||!this['positions']||this['positions']['length']===0x0)return this;const _0x34b020=this['_getHeatCanvas']();if(this['style'][_0x3647ac(_0x460c41._0x5a7069)]==='image')this['_layer']['setOptions']({'url':_0x34b020['toDataURL'](_0x3647ac(_0x460c41._0x4629e8)),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style'][_0x3647ac(_0x460c41._0x2440c8)]?this['_graphic']&&_0x105cda?(this['_graphic'][_0x3647ac(_0x460c41._0x39b302)][_0x3647ac(0x1e7)]=_0x34b020,this['_graphic']['uniforms'][_0x3647ac(0x215)]=this[_0x3647ac(0x1f1)](),this['_graphic2']&&(this[_0x3647ac(0x1d9)][_0x3647ac(_0x460c41._0x4f460b)]['image']=_0x34b020,this[_0x3647ac(0x1d9)]['uniforms'][_0x3647ac(0x215)]=this[_0x3647ac(0x20c)][_0x3647ac(0x1ec)]['bumpMap'])):this['_createArcGraphic'](_0x34b020):this[_0x3647ac(0x20c)]&&_0x105cda?this['_graphic']['uniforms'][_0x3647ac(0x1e7)]=_0x34b020:this[_0x3647ac(0x218)](_0x34b020);return this;}[_0x315cc2(0x218)](_0x34331a){const _0x326b09={_0x40b44f:0x1ce,_0x5d18d9:0x1d1,_0x1411f1:0x20c},_0x155b84=_0x315cc2;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x155b84(_0x326b09._0x40b44f)],'rectangle':this[_0x155b84(0x1f5)],'appearance':new Cesium[(_0x155b84(0x212))]({'material':new Cesium[(_0x155b84(_0x326b09._0x5d18d9))]({'fabric':{'uniforms':{'image':_0x34331a},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x155b84(0x1d5)]['addGraphic'](this[_0x155b84(_0x326b09._0x1411f1)]);}['_createArcGraphic'](_0x213e6d){const _0xb31f1e={_0x1aa459:0x1ee,_0x4cb04b:0x210,_0x435f95:0x21d,_0xec9823:0x1dc,_0x173e73:0x21c,_0x57d411:0x20a,_0x53ba86:0x1e3,_0x362566:0x1f5,_0x5a35f3:0x1f5,_0x3b9a7b:0x1de,_0x348477:0x212,_0x125adb:0x1d5,_0x3f61da:0x1de,_0x172c4e:0x1fb},_0x539e2d=_0x315cc2;this[_0x539e2d(_0xb31f1e._0x1aa459)]();const _0xd82958=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction'][_0x539e2d(0x21d)],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x539e2d(0x1e1)]['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium[_0x539e2d(_0xb31f1e._0x4cb04b)][_0x539e2d(_0xb31f1e._0x435f95)],'backOperation':{'fail':Cesium[_0x539e2d(0x1e1)]['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x52f549=Math[_0x539e2d(_0xb31f1e._0xec9823)](this['style'][_0x539e2d(_0xb31f1e._0x173e73)]??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this['style']['diffHeight'];const _0x2348cd=(this[_0x539e2d(_0xb31f1e._0x57d411)][_0x539e2d(_0xb31f1e._0x53ba86)],0x64);let _0x4891f9=Math['max'](this[_0x539e2d(_0xb31f1e._0x362566)]['height'],this[_0x539e2d(_0xb31f1e._0x5a35f3)]['width']);this[_0x539e2d(0x20a)]['granularity']=_0x4891f9/=_0x2348cd;const _0xd9b6a7=new Cesium[(_0x539e2d(0x1d1))]({'fabric':{'uniforms':{'image':_0x213e6d,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x18ad22=this['style'][_0x539e2d(0x207)]||0x1;this['_graphic']=new mars3d__namespace[(_0x539e2d(_0xb31f1e._0x3b9a7b))]['RectanglePrimitive']({...this[_0x539e2d(0x1ce)],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x539e2d(_0xb31f1e._0x348477))]({'flat':!![],'aboveGround':!![],'renderState':_0xd82958,'material':_0xd9b6a7,'vertexShaderSource':getVertexShaderSource(_0x52f549*_0x18ad22)})}),this[_0x539e2d(_0xb31f1e._0x125adb)]['addGraphic'](this[_0x539e2d(0x20c)]),this['style']['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace[(_0x539e2d(_0xb31f1e._0x3f61da))][(_0x539e2d(_0xb31f1e._0x172c4e))]({...this[_0x539e2d(0x1ce)],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x539e2d(_0xb31f1e._0x348477))]({'flat':!![],'aboveGround':!![],'renderState':_0xd82958,'material':_0xd9b6a7,'vertexShaderSource':getVertexShaderSource(-_0x52f549)})}),this['_layer']['addGraphic'](this['_graphic2']));}['getRectangle'](_0x28042e){const _0x2f72f9={_0x1a8e90:0x1f5,_0x2fb574:0x1f5},_0x2de36b=_0x315cc2;return _0x28042e!==null&&_0x28042e!==void 0x0&&_0x28042e[_0x2de36b(0x1e6)]&&this['_rectangle']?mars3d__namespace['PolyUtil']['formatRectangle'](this[_0x2de36b(_0x2f72f9._0x1a8e90)]):this[_0x2de36b(_0x2f72f9._0x2fb574)];}['_getHeatCanvas'](){const _0x238838={_0x28b84a:0x1ea,_0x17fb67:0x1dd,_0x4e4f2f:0x1ef,_0x3ae104:0x1cd,_0x35f79a:0x1d2,_0x48cf73:0x1cb},_0x2f5a41={_0x3789ff:0x209,_0x4f2958:0x1cf},_0x376e94=_0x315cc2,_0x4507a0=this['_positions'],_0x505f32=[];let _0x1712a3,_0x1d39f1,_0x1a0e18,_0x6dc857;_0x4507a0[_0x376e94(_0x238838._0x28b84a)](_0x42cc17=>{const _0x12a926=_0x376e94,_0x26c949=mars3d__namespace['LngLatPoint']['parse'](_0x42cc17);if(!_0x26c949)return;_0x26c949['value']=_0x42cc17['value']||0x1,!this['options']['rectangle']&&(_0x1712a3===undefined?(_0x1712a3=_0x26c949['lng'],_0x1d39f1=_0x26c949['lng'],_0x1a0e18=_0x26c949['lat'],_0x6dc857=_0x26c949['lat']):(_0x1712a3=Math['min'](_0x1712a3,_0x26c949['lng']),_0x1d39f1=Math[_0x12a926(0x1ef)](_0x1d39f1,_0x26c949['lng']),_0x1a0e18=Math[_0x12a926(0x1cf)](_0x1a0e18,_0x26c949['lat']),_0x6dc857=Math['max'](_0x6dc857,_0x26c949['lat']))),_0x505f32['push'](_0x26c949);});_0x1712a3===_0x1d39f1&&(_0x1712a3-=0.000001,_0x1d39f1+=0.000001);_0x1a0e18===_0x6dc857&&(_0x1a0e18-=0.000001,_0x6dc857+=0.000001);let _0x51acd3=this['options']['rectangle']||{'xmin':_0x1712a3,'xmax':_0x1d39f1,'ymin':_0x1a0e18,'ymax':_0x6dc857};const _0x4d7e95=getMercatorBounds(_0x51acd3),_0x5ac0a1=Math['abs'](_0x4d7e95['xmax']-_0x4d7e95['xmin']),_0x236580=Math['abs'](_0x4d7e95['ymax']-_0x4d7e95[_0x376e94(0x21b)]),_0x51b77a=Math['max'](_0x5ac0a1,_0x236580),_0x4ac774=Math['min'](_0x5ac0a1,_0x236580);this['_mBoundsMax']=_0x51b77a;let _0xb35178=0x1;if(_0x51b77a>this['options'][_0x376e94(0x1dd)])_0xb35178=_0x51b77a/this[_0x376e94(0x1ce)][_0x376e94(0x1dd)],_0x4ac774/_0xb35178this['options']['maxCanvasSize']&&(_0xb35178=_0x51b77a/this['options'][_0x376e94(_0x238838._0x17fb67)]));const _0x5837b7=this['heatStyle']['radius']*1.5,_0xdc1697=_0x5ac0a1/_0xb35178+_0x5837b7*0x2,_0x382d8c=_0x236580/_0xb35178+_0x5837b7*0x2,_0x3611a7=_0x5837b7*_0xb35178;_0x4d7e95['xmin']-=_0x3611a7,_0x4d7e95['ymin']-=_0x3611a7,_0x4d7e95['xmax']+=_0x3611a7,_0x4d7e95['ymax']+=_0x3611a7,this['_scale']=_0xb35178,_0x51acd3=geLatLngBounds(_0x4d7e95),this['_rectangle']=Cesium['Rectangle'][_0x376e94(0x1f6)](_0x51acd3['xmin'],_0x51acd3['ymin'],_0x51acd3['xmax'],_0x51acd3['ymax']);let _0x243df9=_0x505f32[0x0]['value']??0x1,_0x2c0e65=_0x505f32[0x0]['value']??0x0;const _0x4d5dc7=[];_0x505f32[_0x376e94(_0x238838._0x28b84a)](_0x14c4bb=>{const _0x594a2e=_0x376e94,_0x50de46=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x14c4bb['lng'],_0x14c4bb[_0x594a2e(_0x2f5a41._0x3789ff)]]),_0x2b4791=_0x14c4bb['value']||0x1,_0x2f0160=Math['round']((_0x50de46[0x0]-_0x4d7e95['xmin'])/_0xb35178),_0x3b1c90=Math['round']((_0x4d7e95['ymax']-_0x50de46[0x1])/_0xb35178);_0x243df9=Math['max'](_0x243df9,_0x2b4791),_0x2c0e65=Math[_0x594a2e(_0x2f5a41._0x4f2958)](_0x2c0e65,_0x2b4791),_0x4d5dc7['push']({'x':_0x2f0160,'y':_0x3b1c90,'value':_0x2b4791});});const _0x3d4fc3={'min':this['options']['min']??_0x2c0e65,'max':this[_0x376e94(0x1ce)][_0x376e94(_0x238838._0x4e4f2f)]??_0x243df9,'data':_0x4d5dc7};this[_0x376e94(0x1fc)]=_0x3d4fc3;if(!this['_last_mBounds']||_0x4d7e95['xmin']!==this['_last_mBounds']['xmin']||_0x4d7e95['ymin']!==this['_last_mBounds'][_0x376e94(0x21b)]||_0x4d7e95['xmax']!==this['_last_mBounds']['xmax']||_0x4d7e95['ymax']!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0x4d7e95,this['_container']['style'][_0x376e94(0x201)]='width:'+_0xdc1697+'px;height:'+_0x382d8c+'px;';const _0x403afb={...this['heatStyle'],'container':this[_0x376e94(_0x238838._0x3ae104)]};!this['_heat']?this['_heat']=h337__namespace['create'](_0x403afb):this[_0x376e94(_0x238838._0x35f79a)]['configure'](_0x403afb);}this[_0x376e94(0x1d2)][_0x376e94(_0x238838._0x48cf73)](_0x3d4fc3);const _0x22433b=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x376e94(0x1d2)]['_renderer']['canvas']);return _0x22433b;}[_0x315cc2(0x1f1)](){const _0x5356e7={_0x457b94:0x219,_0x58f6b6:0x1d2},_0x16467d=_0x315cc2;this['_heat']['configure']({'radius':this['heatStyle']['radius']*this['style']['arcRadiusScale'],'blur':this['heatStyle']['blur']*this['style'][_0x16467d(0x205)],'gradient':this['heatStyle'][_0x16467d(_0x5356e7._0x457b94)]||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:_0x16467d(0x1e5),0x1:'rgb(255,255,255)'}});const _0x399f04=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x16467d(_0x5356e7._0x58f6b6)][_0x16467d(0x1d6)][_0x16467d(0x208)]);return this['_heat']['configure'](this['options']['heatStyle']),_0x399f04;}['getPointData'](_0x3f46a3){const _0x3e9945={_0x1feaef:0x217,_0x213ea8:0x1d6,_0x17c582:0x214},_0x2a30dd=_0x315cc2,_0x50b955=mars3d__namespace['LngLatPoint']['parse'](_0x3f46a3);if(!_0x50b955)return{};const _0x50d6dc=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x50b955['lng'],_0x50b955['lat']]),_0xfaebb2=this['_last_mBounds'],_0x59e20d=Math['round']((_0x50d6dc[0x0]-_0xfaebb2['xmin'])/this[_0x2a30dd(_0x3e9945._0x1feaef)]),_0x2319cc=Math['round']((_0xfaebb2['ymax']-_0x50d6dc[0x1])/this[_0x2a30dd(_0x3e9945._0x1feaef)]),_0x49055b=this[_0x2a30dd(0x1d2)]['getValueAt']({'x':_0x59e20d,'y':_0x2319cc}),_0x394cfd=this['_heat'][_0x2a30dd(_0x3e9945._0x213ea8)]['ctx']['getImageData'](_0x59e20d-0x1,_0x2319cc-0x1,0x1,0x1)['data'];return{'x':_0x59e20d,'y':_0x2319cc,'value':_0x49055b,'color':_0x2a30dd(_0x3e9945._0x17c582)+_0x394cfd[0x0]+','+_0x394cfd[0x1]+','+_0x394cfd[0x2]+','+_0x394cfd[0x3]+')'};}}mars3d__namespace['LayerUtil'][_0x315cc2(0x204)]('heat',HeatLayer),mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x285356){const _0x3485d0={_0x22d5c4:0x206,_0x1771bb:0x20b},_0x43cf10=_0x315cc2,_0x1fb37c=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x285356[_0x43cf10(_0x3485d0._0x22d5c4)],_0x285356[_0x43cf10(0x21b)]]),_0x34bdab=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x285356['xmax'],_0x285356[_0x43cf10(_0x3485d0._0x1771bb)]]);return{'xmin':_0x1fb37c[0x0],'ymin':_0x1fb37c[0x1],'xmax':_0x34bdab[0x0],'ymax':_0x34bdab[0x1]};}function geLatLngBounds(_0x21e4a1){const _0x51f623=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x21e4a1['xmin'],_0x21e4a1['ymin']]),_0x2f8a66=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x21e4a1['xmax'],_0x21e4a1['ymax']]);return{'xmin':_0x51f623[0x0],'ymin':_0x51f623[0x1],'xmax':_0x2f8a66[0x0],'ymax':_0x2f8a66[0x1]};}function getVertexShaderSource(_0x572bc8){return'in\x20vec3\x20position3DHigh;\x0a\x20\x20in\x20vec3\x20position3DLow;\x0a\x20\x20in\x20vec2\x20st;\x0a\x20\x20in\x20float\x20batchId;\x0a\x20\x20uniform\x20sampler2D\x20bumpMap_3;\x0a\x20\x20out\x20vec3\x20v_positionMC;\x0a\x20\x20out\x20vec3\x20v_positionEC;\x0a\x20\x20out\x20vec2\x20v_st;\x0a\x0a\x20\x20void\x20main()\x0a\x20\x20{\x0a\x20\x20\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x20\x20\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x0a\x20\x20\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20\x20\x20v_st\x20=\x20st;\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(bumpMap_3,\x20v_st);\x0a\x20\x20\x20\x20float\x20centerBump\x20=\x20distance(vec3(0.0),color.rgb);\x0a\x20\x20\x20\x20vec3\x20upDir\x20=\x20normalize(v_positionMC.xyz);\x0a\x20\x20\x20\x20vec3\x20disPos\x20=\x20upDir\x20*\x20centerBump\x20*\x20'+_0x572bc8+';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a';}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,_0x315cc2(0x1d4),{'value':!![]}); })); diff --git a/public/lib/mars3d/plugins/mapv/mars3d-mapv.js b/public/lib/mars3d/plugins/mapv/mars3d-mapv.js index ddff4b61..cb7ccd4f 100644 --- a/public/lib/mars3d/plugins/mapv/mars3d-mapv.js +++ b/public/lib/mars3d/plugins/mapv/mars3d-mapv.js @@ -1,8 +1,8 @@ /** * Mars3D平台插件,结合mapv可视化功能插件 mars3d-mapv * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:31:10 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:11:04 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'mapv', 'mars3d'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-mapv"] = {}, global.mapv, global.mars3d)); })(this, (function (exports, mapv, mars3d) { -'use strict';const _0x9d903f=_0x297d;(function(_0xbf2c8c,_0x4f1a8d){const _0x2ec6c0={_0x254fa6:0xff,_0x26c612:0xce,_0x5997fc:0xca,_0x3bbbf8:0xc6},_0x3a0bfd=_0x297d,_0xaeaa58=_0xbf2c8c();while(!![]){try{const _0x217069=parseInt(_0x3a0bfd(0x11f))/0x1+-parseInt(_0x3a0bfd(0x102))/0x2+parseInt(_0x3a0bfd(_0x2ec6c0._0x254fa6))/0x3*(parseInt(_0x3a0bfd(0xd4))/0x4)+-parseInt(_0x3a0bfd(_0x2ec6c0._0x26c612))/0x5+parseInt(_0x3a0bfd(0xec))/0x6*(-parseInt(_0x3a0bfd(0xc7))/0x7)+-parseInt(_0x3a0bfd(_0x2ec6c0._0x5997fc))/0x8*(parseInt(_0x3a0bfd(0xc2))/0x9)+parseInt(_0x3a0bfd(_0x2ec6c0._0x3bbbf8))/0xa;if(_0x217069===_0x4f1a8d)break;else _0xaeaa58['push'](_0xaeaa58['shift']());}catch(_0x31276c){_0xaeaa58['push'](_0xaeaa58['shift']());}}}(_0x3999,0x5302d));function _interopNamespace(_0x27f657){const _0x1710db={_0x2bfecc:0x106},_0x3afb15=_0x297d;if(_0x27f657&&_0x27f657[_0x3afb15(0x115)])return _0x27f657;var _0x544103=Object[_0x3afb15(0xbe)](null);return _0x27f657&&Object['keys'](_0x27f657)['forEach'](function(_0x1be8df){const _0x40c273=_0x3afb15;if(_0x1be8df!==_0x40c273(_0x1710db._0x2bfecc)){var _0x45f24e=Object['getOwnPropertyDescriptor'](_0x27f657,_0x1be8df);Object['defineProperty'](_0x544103,_0x1be8df,_0x45f24e['get']?_0x45f24e:{'enumerable':!![],'get':function(){return _0x27f657[_0x1be8df];}});}}),_0x544103['default']=_0x27f657,_0x544103;}var mapv__namespace=_interopNamespace(mapv),mars3d__namespace=_interopNamespace(mars3d);function _0x3999(){const _0x1e7eae=['windowPosition','678848CiSxGG','concat','_showHook','time','2227870BsWhQb','mapvFixedHeight','height','render','_addedHook','clear','8ywiliN','animation','stepsRange','initDevicePixelRatio','Cesium','resize','_onMoveStartEvent','MultiPolygon','canvas','FeatureCollection','push','animator','trails','_coordinates','Polygon','fillRect','scene','Rectangle','canvasLayer','isPointVisible','step','mapvAutoHeight','_dataCache','fromDegrees','231894YhjWsM','updateData','MapVLayer','argCheck','draw','getData','top','removeData','fillStyle','EventType','dataSet','layer','style','width','addData','forEach','animatorMoveendEvent','stopAniamation','devicePixelRatio','556287YMKsKF','defineProperty','mode','334854bmqIfD','BaseLayer','keys','cameraMoveEnd','default','_mountedHook','_pointerEvents','mousemove','stop','update','_onMapClick','Util','0px','pointerEvents','mouseMove','getRectangle','options','methods','_onMoveEndEvent','__esModule','positionWC','absolute','cameraMoveStart','mars3d-mapv','getContext','register','fixedHeight','destroy','bind','96227QeLIkt','Cartesian3','click','data','_reset','parentElement','_mapVRenderer','block','isEnabledTime','cartesianToCanvasCoordinates','_cache_event','unbindEvent','MultiLineString','clearData','length','postRender','_map','size','create','off','DataSet','globe','9qPIjxr','zIndex','_data','ymax','10732220QjdeAq','91KUxWNo','initAnimator'];_0x3999=function(){return _0x1e7eae;};return _0x3999();}function _0x297d(_0x24c6f2,_0x5a0a03){const _0x399988=_0x3999();return _0x297d=function(_0x297df8,_0x43dff0){_0x297df8=_0x297df8-0xbc;let _0x385e09=_0x399988[_0x297df8];return _0x385e09;},_0x297d(_0x24c6f2,_0x5a0a03);}const Cesium$1=mars3d__namespace[_0x9d903f(0xd8)],baiduMapLayer=mapv__namespace?mapv__namespace['baiduMapLayer']:null,BaseLayer$1=baiduMapLayer?baiduMapLayer['__proto__']:Function;class MapVRenderer extends BaseLayer$1{constructor(_0xbc3c7d,_0x10944e,_0x24264c,_0x15cbcb){const _0x4a04af={_0x701105:0xf6},_0x484515=_0x9d903f;super(_0xbc3c7d,_0x10944e,_0x24264c);if(!BaseLayer$1)return;this['map']=_0xbc3c7d,this['scene']=_0xbc3c7d['scene'],this[_0x484515(_0x4a04af._0x701105)]=_0x10944e,_0x24264c=_0x24264c||{},this['init'](_0x24264c),this[_0x484515(0xef)](_0x24264c),this['initDevicePixelRatio'](),this['canvasLayer']=_0x15cbcb,this['stopAniamation']=!0x1,this['animation']=_0x24264c['animation'];}[_0x9d903f(0xd7)](){const _0xab4db7=_0x9d903f;this[_0xab4db7(0xfe)]=window['devicePixelRatio']||0x1;}['addAnimatorEvent'](){}['animatorMovestartEvent'](){const _0x3a22ae={_0x5a42fc:0xd5,_0x180e17:0x127},_0x165ba0=_0x9d903f,_0x2d29fc=this['options'][_0x165ba0(_0x3a22ae._0x5a42fc)];this[_0x165ba0(_0x3a22ae._0x180e17)]()&&this[_0x165ba0(0xdf)]&&(this['steps'][_0x165ba0(0xe8)]=_0x2d29fc[_0x165ba0(0xd6)]['start']);}[_0x9d903f(0xfc)](){this['isEnabledTime']()&&this['animator'];}[_0x9d903f(0x11a)](){const _0x1806fb=_0x9d903f;return this['canvasLayer'][_0x1806fb(0xdc)]['getContext'](this['context']);}['init'](_0x1a1415){const _0x3b61f3={_0x140933:0xe6,_0x4465e3:0xc3},_0x202b0d=_0x9d903f;this['options']=_0x1a1415,this['initDataRange'](_0x1a1415),this['context']=this['options']['context']||'2d',this['options']['zIndex']&&this[_0x202b0d(_0x3b61f3._0x140933)]&&this['canvasLayer']['setZIndex']&&this['canvasLayer']['setZIndex'](this['options'][_0x202b0d(_0x3b61f3._0x4465e3)]),this[_0x202b0d(0xc8)]();}['_canvasUpdate'](_0x288dad){const _0x177386={_0x55db21:0x112},_0x10a8c5={_0x1e24ac:0xe0,_0x5d9f1e:0xcd,_0x47bada:0xcd},_0x45ff3b={_0x2c49f6:0xe7},_0x35b132=_0x9d903f,_0xa67d39=this['scene'];if(this['canvasLayer']&&!this[_0x35b132(0xfd)]){const _0x7fe53d=this['options']['animation'],_0x2810fc=this[_0x35b132(0x11a)]();if(this['isEnabledTime']()){if(void 0x0===_0x288dad)return void this['clear'](_0x2810fc);this['context']==='2d'&&(_0x2810fc['save'](),_0x2810fc['globalCompositeOperation']='destination-out',_0x2810fc[_0x35b132(0xf4)]='rgba(0,\x200,\x200,\x20.1)',_0x2810fc[_0x35b132(0xe3)](0x0,0x0,_0x2810fc['canvas']['width'],_0x2810fc['canvas']['height']),_0x2810fc['restore']());}else this['clear'](_0x2810fc);if(this['context']==='2d')for(const _0x1b3499 in this[_0x35b132(_0x177386._0x55db21)]){_0x2810fc[_0x1b3499]=this[_0x35b132(0x112)][_0x1b3499];}else _0x2810fc['clear'](_0x2810fc['COLOR_BUFFER_BIT']);const _0x2542b2={'transferCoordinate':function(_0x48d460){const _0x2be2cc=_0x35b132,_0x389608=null;let _0x4096df=_0xa67d39[_0x2be2cc(0xcf)];_0xa67d39['mapvAutoHeight']&&(_0x4096df=_0xa67d39['globe']['getHeight'](Cesium$1['Cartographic']['fromDegrees'](_0x48d460[0x0],_0x48d460[0x1])));const _0x3e5ad7=Cesium$1[_0x2be2cc(0x120)]['fromDegrees'](_0x48d460[0x0],_0x48d460[0x1],_0x4096df);if(!_0x3e5ad7)return _0x389608;const _0xe1e88d=_0xa67d39[_0x2be2cc(0x128)](_0x3e5ad7);if(!_0xe1e88d)return _0x389608;if(_0xa67d39['mapvDepthTest']&&_0xa67d39[_0x2be2cc(0x101)]===Cesium$1['SceneMode']['SCENE3D']){const _0x1dcd37=new Cesium$1['EllipsoidalOccluder'](_0xa67d39[_0x2be2cc(0xc1)]['ellipsoid'],_0xa67d39['camera'][_0x2be2cc(0x116)]),_0x3ffeab=_0x1dcd37[_0x2be2cc(_0x45ff3b._0x2c49f6)](_0x3e5ad7);if(!_0x3ffeab)return _0x389608;}return[_0xe1e88d['x'],_0xe1e88d['y']];}};void 0x0!==_0x288dad&&(_0x2542b2['filter']=function(_0x3cbe5d){const _0x4d974c=_0x35b132,_0x5079d0=_0x7fe53d[_0x4d974c(_0x10a8c5._0x1e24ac)]||0xa;return!!(_0x288dad&&_0x3cbe5d[_0x4d974c(_0x10a8c5._0x5d9f1e)]>_0x288dad-_0x5079d0&&_0x3cbe5d[_0x4d974c(_0x10a8c5._0x47bada)]<_0x288dad);});const _0x535568=this['dataSet']['get'](_0x2542b2);this['processData'](_0x535568),this[_0x35b132(_0x177386._0x55db21)]['unit']==='m'&&this['options']['size'],this['options']['_size']=this['options'][_0x35b132(0xbd)];const _0x3b9d1d=_0xa67d39['cartesianToCanvasCoordinates'](Cesium$1['Cartesian3']['fromDegrees'](0x0,0x0));if(!_0x3b9d1d)return;this['drawContext'](_0x2810fc,new mapv__namespace[(_0x35b132(0xc0))](_0x535568),this['options'],_0x3b9d1d),this['options']['updateCallback']&&this[_0x35b132(0x112)]['updateCallback'](_0x288dad);}}['updateData'](_0x445d2b,_0x47bbd8){const _0x6fcfab=_0x9d903f;let _0x30d924=_0x445d2b;_0x30d924&&_0x30d924['get']&&(_0x30d924=_0x30d924['get']()),void 0x0!==_0x30d924&&this[_0x6fcfab(0xf6)]['set'](_0x30d924),super['update']({'options':_0x47bbd8});}['addData'](_0x1dc620,_0x134744){const _0x54f386={_0x24e097:0xf6},_0x6cf1d5=_0x9d903f;let _0x110ef2=_0x1dc620;_0x1dc620&&_0x1dc620['get']&&(_0x110ef2=_0x1dc620['get']()),this[_0x6cf1d5(_0x54f386._0x24e097)]['add'](_0x110ef2),this[_0x6cf1d5(0x10b)]({'options':_0x134744});}['getData'](){const _0x4b61d7=_0x9d903f;return this[_0x4b61d7(0xf6)];}['removeData'](_0x212203){const _0x1a692e=_0x9d903f;if(this['dataSet']){const _0x1759bd=this[_0x1a692e(0xf6)]['get']({'filter':function(_0x3768ea){return _0x212203==null||typeof _0x212203!=='function'||!_0x212203(_0x3768ea);}});this['dataSet']['set'](_0x1759bd),this['update']({'options':null});}}['clearData'](){const _0x48dd9c={_0xe9a7da:0xf6,_0x331a85:0xd3},_0x2de5a9=_0x9d903f;this['dataSet']&&this[_0x2de5a9(_0x48dd9c._0xe9a7da)][_0x2de5a9(_0x48dd9c._0x331a85)](),this['update']({'options':null});}['draw'](){const _0x2f130c=_0x9d903f;this['canvasLayer'][_0x2f130c(0xf0)]();}[_0x9d903f(0xd3)](_0x54fa6a){const _0x3f5d2f={_0x141256:0xdc},_0x25afaf=_0x9d903f;_0x54fa6a&&_0x54fa6a['clearRect']&&_0x54fa6a['clearRect'](0x0,0x0,_0x54fa6a[_0x25afaf(_0x3f5d2f._0x141256)]['width'],_0x54fa6a['canvas']['height']);}[_0x9d903f(0x11d)](){const _0x2d29b3={_0x2e13fb:0x12c,_0x515645:0x10a},_0x5c9022=_0x9d903f;this['clear'](this['getContext']()),this[_0x5c9022(_0x2d29b3._0x2e13fb)](),this['animator']&&this['animator'][_0x5c9022(_0x2d29b3._0x515645)](),this['animator']=null,this['canvasLayer']=null;}}if(mapv__namespace!==null&&mapv__namespace!==void 0x0&&mapv__namespace['DataSet'])mapv__namespace['DataSet']['prototype']['transferCoordinate']=function(_0x2c8123,_0x39c370,_0x480dd1,_0x5e3856){const _0x5e1a64={_0x1d4d38:0xe1,_0x337aa9:0x12b,_0x4a3b20:0xdb,_0x3f05ee:0xde},_0x1dcdf4={_0x4e1293:0x12d},_0x13794a=_0x9d903f;_0x5e3856=_0x5e3856||_0x13794a(_0x5e1a64._0x1d4d38),_0x480dd1=_0x480dd1||'coordinates';for(let _0x3a02aa=0x0;_0x3a02aa<_0x2c8123['length'];_0x3a02aa++){const _0x16cb36=_0x2c8123[_0x3a02aa]['geometry'],_0x28a653=_0x16cb36[_0x480dd1];switch(_0x16cb36['type']){case'Point':{const _0x1ae0fc=_0x39c370(_0x28a653);_0x1ae0fc?_0x16cb36[_0x5e3856]=_0x1ae0fc:_0x16cb36[_0x5e3856]=[-0x3e7,-0x3e7];}break;case'LineString':{const _0x2ad3c3=[];for(let _0x2afef8=0x0;_0x2afef8<_0x28a653['length'];_0x2afef8++){const _0x5a77c3=_0x39c370(_0x28a653[_0x2afef8]);_0x5a77c3&&_0x2ad3c3['push'](_0x5a77c3);}_0x16cb36[_0x5e3856]=_0x2ad3c3;}break;case _0x13794a(_0x5e1a64._0x337aa9):case _0x13794a(0xe2):{const _0x5ef35a=_0xd7dce0(_0x28a653);_0x16cb36[_0x5e3856]=_0x5ef35a;}break;case _0x13794a(_0x5e1a64._0x4a3b20):{const _0x519b29=[];for(let _0x414778=0x0;_0x414778<_0x28a653['length'];_0x414778++){const _0x1438ff=_0xd7dce0(_0x28a653[_0x414778]);_0x1438ff['length']>0x0&&_0x519b29[_0x13794a(_0x5e1a64._0x3f05ee)](_0x1438ff);}_0x16cb36[_0x5e3856]=_0x519b29;}break;}}function _0xd7dce0(_0x240472){const _0x15a3bf=_0x13794a,_0x5ee170=[];for(let _0x35c24b=0x0;_0x35c24b<_0x240472['length'];_0x35c24b++){const _0x362314=_0x240472[_0x35c24b],_0x365873=[];for(let _0x7108c2=0x0;_0x7108c2<_0x362314['length'];_0x7108c2++){const _0x743f63=_0x39c370(_0x362314[_0x7108c2]);_0x743f63&&_0x365873['push'](_0x743f63);}_0x365873[_0x15a3bf(_0x1dcdf4._0x4e1293)]>0x0&&_0x5ee170['push'](_0x365873);}return _0x5ee170;}return _0x2c8123;};else throw new Error('请引入\x20mapv\x20库\x20');const Cesium=mars3d__namespace[_0x9d903f(0xd8)],BaseLayer=mars3d__namespace[_0x9d903f(0xf7)][_0x9d903f(0x103)];class MapVLayer extends BaseLayer{constructor(_0x39327a,_0x3d2f97){const _0x4f6fd2=_0x9d903f;super(_0x39327a),this[_0x4f6fd2(0x108)]=this['options']['pointerEvents'],this['dataSet']=_0x3d2f97||new mapv__namespace['DataSet'](_0x39327a[_0x4f6fd2(0x122)]),this[_0x4f6fd2(0xdc)]=null;}get['pointerEvents'](){const _0x52babe={_0x2a7a5f:0x108},_0x566cdc=_0x9d903f;return this[_0x566cdc(_0x52babe._0x2a7a5f)];}set[_0x9d903f(0x10f)](_0x2d57bd){const _0x2e9bf9={_0x2991b0:0x108,_0xa230e1:0xf8,_0x164735:0x10f},_0x24bb2c=_0x9d903f;this[_0x24bb2c(_0x2e9bf9._0x2991b0)]=_0x2d57bd,this['canvas']&&(_0x2d57bd?this['canvas'][_0x24bb2c(_0x2e9bf9._0xa230e1)][_0x24bb2c(_0x2e9bf9._0x164735)]='all':this['canvas']['style']['pointerEvents']='none');}[_0x9d903f(0xcc)](_0x4245e7){const _0x158471={_0x359afa:0xf8},_0x59c8a8=_0x9d903f;_0x4245e7?this['canvas'][_0x59c8a8(_0x158471._0x359afa)]['display']=_0x59c8a8(0x126):this['canvas']['style']['display']='none';}[_0x9d903f(0x107)](){const _0x51a5ee={_0x208b47:0xe4,_0x315202:0xe9,_0x3310b8:0x11c},_0x289cba=_0x9d903f;this[_0x289cba(0xbc)][_0x289cba(_0x51a5ee._0x208b47)]['mapvDepthTest']=this['options']['depthTest']??!![],this['_map']['scene'][_0x289cba(_0x51a5ee._0x315202)]=this['options']['clampToGround']??![],this['_map']['scene']['mapvFixedHeight']=this['options'][_0x289cba(_0x51a5ee._0x3310b8)]??0x0;}['_addedHook'](){const _0x524a37={_0x565b4d:0xf6,_0x8d2329:0xf6,_0x334323:0xdc,_0x281c44:0x123},_0x2f7abe=_0x9d903f;this['dataSet']&&(!this['dataSet']['_data']||this[_0x2f7abe(_0x524a37._0x565b4d)]['_data']['length']===0x0)&&(this['dataSet'][_0x2f7abe(0xc4)]=[][_0x2f7abe(0xcb)](this['dataSet'][_0x2f7abe(0xea)])),this[_0x2f7abe(0x125)]=new MapVRenderer(this['_map'],this[_0x2f7abe(_0x524a37._0x8d2329)],this['options'],this),this['initDevicePixelRatio'](),this[_0x2f7abe(_0x524a37._0x334323)]=this['_createCanvas'](),this['render']=this[_0x2f7abe(0xd1)]['bind'](this),this['bindEvent'](),this[_0x2f7abe(_0x524a37._0x281c44)]();}['_removedHook'](){const _0x3714dc={_0x5c1f8b:0x12a,_0x3c1c02:0x125,_0x1ff9cd:0x125},_0x4253f6=_0x9d903f;this[_0x4253f6(_0x3714dc._0x5c1f8b)](),this[_0x4253f6(_0x3714dc._0x3c1c02)]&&(this['_mapVRenderer']['destroy'](),this[_0x4253f6(_0x3714dc._0x1ff9cd)]=null),this[_0x4253f6(0xdc)]['parentElement']['removeChild'](this['canvas']);}['initDevicePixelRatio'](){this['devicePixelRatio']=window['devicePixelRatio']||0x1;}['bindEvent'](){const _0x394d5f={_0x2ffece:0xf5,_0x4b2d3f:0xbc,_0xbc2aef:0x10c,_0x29d630:0xf5},_0x4d87d7=_0x9d903f;var _0xd06550,_0x516e42,_0x25b848,_0x59147f;this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMoveStartEvent'],this),this['_map']['on'](mars3d__namespace[_0x4d87d7(_0x394d5f._0x2ffece)][_0x4d87d7(0x118)],this['_onMoveStartEvent'],this),this[_0x4d87d7(_0x394d5f._0x4b2d3f)]['on'](mars3d__namespace['EventType']['cameraMoveEnd'],this['_onMoveEndEvent'],this),(_0xd06550=this['options'])!==null&&_0xd06550!==void 0x0&&(_0x516e42=_0xd06550['methods'])!==null&&_0x516e42!==void 0x0&&_0x516e42[_0x4d87d7(0x121)]&&this['_map']['on'](mars3d__namespace['EventType']['click'],this[_0x4d87d7(_0x394d5f._0xbc2aef)],this),(_0x25b848=this[_0x4d87d7(0x112)])!==null&&_0x25b848!==void 0x0&&(_0x59147f=_0x25b848['methods'])!==null&&_0x59147f!==void 0x0&&_0x59147f['mousemove']&&this[_0x4d87d7(_0x394d5f._0x4b2d3f)]['on'](mars3d__namespace[_0x4d87d7(_0x394d5f._0x29d630)][_0x4d87d7(0x110)],this['_onMapMouseMove'],this);}['unbindEvent'](){const _0xf41082={_0x4135d9:0xbc,_0x26b373:0xbf,_0x1709d2:0xda,_0x4444a0:0xbc,_0x9d9770:0x105,_0x46e16f:0xf5,_0x5bb826:0x113,_0x448dd2:0x109},_0x3770fe=_0x9d903f;var _0x3d069f,_0xe5f895,_0x3f2971,_0x374b55;this[_0x3770fe(_0xf41082._0x4135d9)][_0x3770fe(_0xf41082._0x26b373)](mars3d__namespace['EventType']['mouseDown'],this['_onMoveStartEvent'],this),this['_map']['off'](mars3d__namespace['EventType']['cameraMoveStart'],this[_0x3770fe(_0xf41082._0x1709d2)],this),this[_0x3770fe(_0xf41082._0x4444a0)]['off'](mars3d__namespace[_0x3770fe(0xf5)][_0x3770fe(_0xf41082._0x9d9770)],this[_0x3770fe(0x114)],this),this['_map']['off'](mars3d__namespace['EventType']['postRender'],this['_reset'],this),(_0x3d069f=this['options'])!==null&&_0x3d069f!==void 0x0&&(_0xe5f895=_0x3d069f['methods'])!==null&&_0xe5f895!==void 0x0&&_0xe5f895[_0x3770fe(0x121)]&&this['_map'][_0x3770fe(0xbf)](mars3d__namespace[_0x3770fe(_0xf41082._0x46e16f)]['click'],this['_onMapClick'],this),(_0x3f2971=this['options'])!==null&&_0x3f2971!==void 0x0&&(_0x374b55=_0x3f2971[_0x3770fe(_0xf41082._0x5bb826)])!==null&&_0x374b55!==void 0x0&&_0x374b55[_0x3770fe(_0xf41082._0x448dd2)]&&this[_0x3770fe(0xbc)][_0x3770fe(_0xf41082._0x26b373)](mars3d__namespace['EventType']['mouseMove'],this['_onMapMouseMove'],this);}['_onMoveStartEvent'](){const _0x284cda={_0x2ab1ce:0xbc},_0x4fa594=_0x9d903f;this['_mapVRenderer']&&(this['_mapVRenderer']['animatorMovestartEvent'](),this[_0x4fa594(_0x284cda._0x2ab1ce)]['off'](mars3d__namespace['EventType']['postRender'],this['_reset'],this),this['_map']['on'](mars3d__namespace['EventType'][_0x4fa594(0x12e)],this['_reset'],this));}[_0x9d903f(0x114)](){const _0x30b198={_0x9becbe:0xf5},_0x2f8cd7=_0x9d903f;this['_mapVRenderer']&&(this['_map'][_0x2f8cd7(0xbf)](mars3d__namespace[_0x2f8cd7(_0x30b198._0x9becbe)]['postRender'],this['_reset'],this),this[_0x2f8cd7(0x125)]['animatorMoveendEvent'](),this['_reset']());}['_setOptionsHook'](_0x5d4b13,_0x5bba86){const _0xea4e89=_0x9d903f;this['_removedHook'](),this[_0xea4e89(0xd2)]();}['addData'](_0x47b198){const _0xbcef40={_0x1eb06d:0xfa},_0x2ee970=_0x9d903f;this['_mapVRenderer']&&this['_mapVRenderer'][_0x2ee970(_0xbcef40._0x1eb06d)](_0x47b198,this['options']);}['updateData'](_0x22c929){const _0x51c44e=_0x9d903f;this[_0x51c44e(0x125)]&&this['_mapVRenderer'][_0x51c44e(0xed)](_0x22c929,this['options']);}['getData'](){const _0xdecf6={_0x1b3269:0xf1},_0x10ff28=_0x9d903f;return this['_mapVRenderer']&&(this['dataSet']=this['_mapVRenderer'][_0x10ff28(_0xdecf6._0x1b3269)]()),this['dataSet'];}['removeData'](_0xacc3e5){const _0x536117={_0x579295:0x125},_0x3ecbfb=_0x9d903f;this['_mapVRenderer']&&this[_0x3ecbfb(_0x536117._0x579295)][_0x3ecbfb(0xf3)](_0xacc3e5);}['removeAllData'](){const _0x2e82f7={_0x202e44:0x125},_0x72b5f4=_0x9d903f;this['_mapVRenderer']&&this[_0x72b5f4(_0x2e82f7._0x202e44)]['clearData']();}['_createCanvas'](){const _0x52b3d2={_0x24a99a:0x10e,_0x508cfc:0xdc,_0x3643e4:0xf9,_0x206748:0xbc,_0x36cec6:0xd0,_0x210a50:0xdc,_0x4dcdef:0x112},_0x29cec2=_0x9d903f,_0x40695e=mars3d__namespace['DomUtil']['create']('canvas',_0x29cec2(0x119),this['_map']['container']);_0x40695e['id']=this['id'],_0x40695e['style']['position']='absolute',_0x40695e['style'][_0x29cec2(0xf2)]=_0x29cec2(_0x52b3d2._0x24a99a),_0x40695e['style']['left']='0px',_0x40695e['width']=parseInt(this[_0x29cec2(0xbc)][_0x29cec2(_0x52b3d2._0x508cfc)][_0x29cec2(_0x52b3d2._0x3643e4)]),_0x40695e['height']=parseInt(this[_0x29cec2(_0x52b3d2._0x206748)]['canvas'][_0x29cec2(_0x52b3d2._0x36cec6)]),_0x40695e['style']['width']=this[_0x29cec2(0xbc)][_0x29cec2(_0x52b3d2._0x210a50)]['style']['width'],_0x40695e['style'][_0x29cec2(_0x52b3d2._0x36cec6)]=this['_map']['canvas']['style']['height'],_0x40695e['style'][_0x29cec2(0x10f)]=this[_0x29cec2(0x108)]?'auto':'none',_0x40695e['style']['zIndex']=this['options']['zIndex']??0x9;if(this['options']['context']==='2d'){const _0x5924c5=this['devicePixelRatio'];_0x40695e['getContext'](this[_0x29cec2(_0x52b3d2._0x4dcdef)]['context'])['scale'](_0x5924c5,_0x5924c5);}return _0x40695e;}['_reset'](){const _0x574646={_0x198297:0xd9},_0x19476e=_0x9d903f;this[_0x19476e(_0x574646._0x198297)](),this['render']();}['draw'](){this['_reset']();}['remove'](){const _0x17b854={_0x427a27:0x124},_0x298d95=_0x9d903f;this['_mapVRenderer']&&(this['_mapVRenderer']['destroy'](),this[_0x298d95(0x125)]=null),this['canvas'][_0x298d95(_0x17b854._0x427a27)]['removeChild'](this['canvas']);}['render'](){this['_mapVRenderer']['_canvasUpdate']();}['resize'](){const _0x57f839={_0x2dbeae:0xf8,_0x3b60cf:0xf2,_0x2cc64e:0x10e,_0x1b82f8:0xbc,_0xf25a18:0xdc},_0x52cb7d=_0x9d903f;if(this['canvas']){const _0x1e8879=this['canvas'];_0x1e8879[_0x52cb7d(_0x57f839._0x2dbeae)]['position']=_0x52cb7d(0x117),_0x1e8879['style'][_0x52cb7d(_0x57f839._0x3b60cf)]=_0x52cb7d(_0x57f839._0x2cc64e),_0x1e8879['style']['left']='0px',_0x1e8879['width']=parseInt(this[_0x52cb7d(_0x57f839._0x1b82f8)][_0x52cb7d(0xdc)]['width']),_0x1e8879['height']=parseInt(this[_0x52cb7d(_0x57f839._0x1b82f8)][_0x52cb7d(_0x57f839._0xf25a18)]['height']),_0x1e8879['style'][_0x52cb7d(0xf9)]=this['_map'][_0x52cb7d(0xdc)][_0x52cb7d(0xf8)]['width'],_0x1e8879['style']['height']=this['_map']['canvas']['style']['height'];}}[_0x9d903f(0x111)](_0x2e9dc8){const _0x4c9b88={_0x386c14:0x10d,_0x4f6ff2:0xe5},_0x3fa928=_0x9d903f;if(!this[_0x3fa928(0xf6)]||!this['dataSet']['_data'])return;const _0x3d8f0d=mars3d__namespace[_0x3fa928(_0x4c9b88._0x386c14)]['getExtentByGeoJSON']({'type':_0x3fa928(0xdd),'features':this['dataSet'][_0x3fa928(0xc4)]});if(!_0x3d8f0d)return;return _0x2e9dc8!==null&&_0x2e9dc8!==void 0x0&&_0x2e9dc8['isFormat']?_0x3d8f0d:Cesium[_0x3fa928(_0x4c9b88._0x4f6ff2)][_0x3fa928(0xeb)](_0x3d8f0d['xmin'],_0x3d8f0d['ymin'],_0x3d8f0d['xmax'],_0x3d8f0d[_0x3fa928(0xc5)]);}['_onMapClick'](_0x4a1217){const _0x5e110d={_0x390011:0xc9},_0x4fbbd9=_0x9d903f;this['_cache_event']=_0x4a1217,this['_mapVRenderer']&&this['_mapVRenderer']['clickEvent'](_0x4a1217[_0x4fbbd9(_0x5e110d._0x390011)],_0x4a1217);}['_onMapMouseMove'](_0x7375dd){const _0x2f6d36={_0x3e3879:0xc9},_0xa42ed5=_0x9d903f;this['_cache_event']=_0x7375dd,this['_mapVRenderer']&&this['_mapVRenderer']['mousemoveEvent'](_0x7375dd[_0xa42ed5(_0x2f6d36._0x3e3879)],_0x7375dd);}['on'](_0x45c4f9,_0x246e5b,_0x609c8e){const _0x14bf0b={_0x22a0e9:0x121,_0x1928d1:0x113,_0x898702:0x110},_0x9ac2ed=_0x9d903f;this['options']['methods']=this['options'][_0x9ac2ed(0x113)]||{};if(_0x45c4f9===mars3d__namespace['EventType'][_0x9ac2ed(_0x14bf0b._0x22a0e9)])this['options'][_0x9ac2ed(_0x14bf0b._0x1928d1)][_0x9ac2ed(0x121)]=_0x1c804f=>{const _0x52bd00=_0x9ac2ed;_0x1c804f&&_0x246e5b[_0x52bd00(0x11e)](_0x609c8e)({...this['_cache_event'],'layer':this,'data':_0x1c804f});},this['_map']['on'](mars3d__namespace['EventType'][_0x9ac2ed(_0x14bf0b._0x22a0e9)],this['_onMapClick'],this);else _0x45c4f9===mars3d__namespace['EventType'][_0x9ac2ed(_0x14bf0b._0x898702)]&&(this['options'][_0x9ac2ed(0x113)]['mousemove']=_0xed3477=>{const _0x51c864=_0x9ac2ed;_0xed3477&&_0x246e5b['bind'](_0x609c8e)({...this[_0x51c864(0x129)],'layer':this,'data':_0xed3477});},this[_0x9ac2ed(0xbc)]['on'](mars3d__namespace['EventType']['mouseMove'],this['_onMapMouseMove'],this));return this;}['off'](_0x3befbe,_0x4c1118){const _0x53a541={_0x2c6ae7:0xbc,_0x1f1922:0x112},_0x3a8870=_0x9d903f;if(_0x3befbe===_0x3a8870(0x121)){var _0x398976;this[_0x3a8870(_0x53a541._0x2c6ae7)]['off'](_0x3befbe,this['_onMapClick'],this),(_0x398976=this['options']['methods'])!==null&&_0x398976!==void 0x0&&_0x398976['mousemove']&&delete this['options']['methods']['click'];}else{if(_0x3befbe==='mouseMove'){var _0x3f84ad;this[_0x3a8870(0xbc)]['off'](_0x3befbe,this['_onMapMouseMove'],this),(_0x3f84ad=this[_0x3a8870(_0x53a541._0x1f1922)]['methods'])!==null&&_0x3f84ad!==void 0x0&&_0x3f84ad['mousemove']&&delete this['options']['methods']['mousemove'];}}return this;}}mars3d__namespace['LayerUtil'][_0x9d903f(0x11b)]('mapv',MapVLayer),mars3d__namespace[_0x9d903f(0xf7)][_0x9d903f(0xee)]=MapVLayer,exports[_0x9d903f(0xee)]=MapVLayer,Object[_0x9d903f(0x104)](mapv)[_0x9d903f(0xfb)](function(_0x44fe37){if(_0x44fe37!=='default'&&!exports['hasOwnProperty'](_0x44fe37))Object['defineProperty'](exports,_0x44fe37,{'enumerable':!![],'get':function(){return mapv[_0x44fe37];}});}),Object[_0x9d903f(0x100)](exports,_0x9d903f(0x115),{'value':!![]}); +'use strict';const _0x46920f=_0x3fc0;(function(_0x5bdf48,_0x507548){const _0x4d5d4a={_0x367b39:0xc4,_0x579e5d:0xfb,_0x5a41b4:0xc5,_0x1df06a:0xed,_0x7e470b:0xc6,_0x3f0faf:0xc7,_0x2e1a0c:0xd3},_0x271ea9=_0x3fc0,_0x20a88d=_0x5bdf48();while(!![]){try{const _0x4bcc64=parseInt(_0x271ea9(_0x4d5d4a._0x367b39))/0x1+parseInt(_0x271ea9(_0x4d5d4a._0x579e5d))/0x2*(parseInt(_0x271ea9(0xff))/0x3)+parseInt(_0x271ea9(_0x4d5d4a._0x5a41b4))/0x4*(parseInt(_0x271ea9(_0x4d5d4a._0x1df06a))/0x5)+parseInt(_0x271ea9(_0x4d5d4a._0x7e470b))/0x6+-parseInt(_0x271ea9(_0x4d5d4a._0x3f0faf))/0x7*(parseInt(_0x271ea9(0xb6))/0x8)+-parseInt(_0x271ea9(0xe0))/0x9+-parseInt(_0x271ea9(0xcb))/0xa*(-parseInt(_0x271ea9(_0x4d5d4a._0x2e1a0c))/0xb);if(_0x4bcc64===_0x507548)break;else _0x20a88d['push'](_0x20a88d['shift']());}catch(_0x2c8ea6){_0x20a88d['push'](_0x20a88d['shift']());}}}(_0x4b4f,0xd9429));function _0x4b4f(){const _0x2d36d5=['1130248VtjAhs','hasOwnProperty','style','MapVLayer','animation','context','devicePixelRatio','Cesium','cartesianToCanvasCoordinates','mouseMove','position','methods','rgba(0,\x200,\x200,\x20.1)','_pointerEvents','471148spTBBn','1092KasgvD','284094lpYYfr','77NeKQhb','drawContext','none','getData','20LJLSPd','height','processData','time','_onMoveEndEvent','updateCallback','_cache_event','postRender','3166647sipTLr','off','_onMapClick','draw','removeData','mousemove','MultiPolygon','LayerUtil','camera','argCheck','updateData','_map','auto','4741830hShYNm','fillRect','SceneMode','mapvAutoHeight','_addedHook','_mapVRenderer','size','left','_onMapMouseMove','create','fromDegrees','globalCompositeOperation','_coordinates','10780UGWkFe','destroy','globe','_data','xmin','container','clear','dataSet','zIndex','__esModule','clearData','scene','mode','width','2576038ueAopI','canvasLayer','_canvasUpdate','DataSet','3TMxxvu','animator','canvas','click','bind','ymax','_reset','cameraMoveStart','options','EventType','defineProperty','update','clickEvent','0px','get','initDevicePixelRatio','_onMoveStartEvent','resize','length','top'];_0x4b4f=function(){return _0x2d36d5;};return _0x4b4f();}function _interopNamespace(_0x3acfc7){const _0x131be7={_0x17acca:0xb0};if(_0x3acfc7&&_0x3acfc7['__esModule'])return _0x3acfc7;var _0xc482f9=Object['create'](null);return _0x3acfc7&&Object['keys'](_0x3acfc7)['forEach'](function(_0x148abd){const _0x2fa32c=_0x3fc0;if(_0x148abd!=='default'){var _0x2dc760=Object['getOwnPropertyDescriptor'](_0x3acfc7,_0x148abd);Object['defineProperty'](_0xc482f9,_0x148abd,_0x2dc760[_0x2fa32c(_0x131be7._0x17acca)]?_0x2dc760:{'enumerable':!![],'get':function(){return _0x3acfc7[_0x148abd];}});}}),_0xc482f9['default']=_0x3acfc7,_0xc482f9;}var mapv__namespace=_interopNamespace(mapv),mars3d__namespace=_interopNamespace(mars3d);const Cesium$1=mars3d__namespace[_0x46920f(0xbd)],baiduMapLayer=mapv__namespace?mapv__namespace['baiduMapLayer']:null,BaseLayer$1=baiduMapLayer?baiduMapLayer['__proto__']:Function;class MapVRenderer extends BaseLayer$1{constructor(_0x4f79c9,_0x4245ea,_0x1a454e,_0x5e05c0){const _0x190599=_0x46920f;super(_0x4f79c9,_0x4245ea,_0x1a454e);if(!BaseLayer$1)return;this['map']=_0x4f79c9,this['scene']=_0x4f79c9['scene'],this[_0x190599(0xf4)]=_0x4245ea,_0x1a454e=_0x1a454e||{},this['init'](_0x1a454e),this[_0x190599(0xdc)](_0x1a454e),this['initDevicePixelRatio'](),this[_0x190599(0xfc)]=_0x5e05c0,this['stopAniamation']=!0x1,this['animation']=_0x1a454e['animation'];}['initDevicePixelRatio'](){this['devicePixelRatio']=window['devicePixelRatio']||0x1;}['addAnimatorEvent'](){}['animatorMovestartEvent'](){const _0x20bab1={_0x51d847:0xba,_0x2c0e57:0x100},_0x384f73=_0x46920f,_0x59f836=this['options'][_0x384f73(_0x20bab1._0x51d847)];this['isEnabledTime']()&&this[_0x384f73(_0x20bab1._0x2c0e57)]&&(this['steps']['step']=_0x59f836['stepsRange']['start']);}['animatorMoveendEvent'](){this['isEnabledTime']()&&this['animator'];}['getContext'](){const _0x1c064d={_0x1fa402:0xfc,_0x2d9c56:0xbb},_0x2b347f=_0x46920f;return this[_0x2b347f(_0x1c064d._0x1fa402)]['canvas']['getContext'](this[_0x2b347f(_0x1c064d._0x2d9c56)]);}['init'](_0x351b4c){const _0x839d4d={_0x2e7dc0:0xbb,_0x4e6e17:0xaa},_0x256d2c=_0x46920f;this[_0x256d2c(0xaa)]=_0x351b4c,this['initDataRange'](_0x351b4c),this['context']=this['options'][_0x256d2c(_0x839d4d._0x2e7dc0)]||'2d',this[_0x256d2c(_0x839d4d._0x4e6e17)]['zIndex']&&this['canvasLayer']&&this['canvasLayer']['setZIndex']&&this['canvasLayer']['setZIndex'](this['options']['zIndex']),this['initAnimator']();}[_0x46920f(0xfd)](_0x47eb8b){const _0x2ec837={_0x345325:0xba,_0xe38d0a:0xeb,_0x371f26:0xe1,_0x5785ab:0xaa,_0x468c59:0xaa,_0xdc8c6:0xaa},_0x5bfebf={_0x162155:0xe3,_0x554e4a:0xef,_0x7a5c4e:0xea,_0x515e8b:0xdb},_0x3e051e=_0x46920f,_0x2b1825=this[_0x3e051e(0xf8)];if(this[_0x3e051e(0xfc)]&&!this['stopAniamation']){const _0x2c1de4=this['options'][_0x3e051e(_0x2ec837._0x345325)],_0x26497a=this['getContext']();if(this['isEnabledTime']()){if(void 0x0===_0x47eb8b)return void this['clear'](_0x26497a);this['context']==='2d'&&(_0x26497a['save'](),_0x26497a[_0x3e051e(_0x2ec837._0xe38d0a)]='destination-out',_0x26497a['fillStyle']=_0x3e051e(0xc2),_0x26497a[_0x3e051e(_0x2ec837._0x371f26)](0x0,0x0,_0x26497a['canvas'][_0x3e051e(0xfa)],_0x26497a['canvas']['height']),_0x26497a['restore']());}else this['clear'](_0x26497a);if(this['context']==='2d')for(const _0x18784e in this['options']){_0x26497a[_0x18784e]=this[_0x3e051e(_0x2ec837._0x5785ab)][_0x18784e];}else _0x26497a[_0x3e051e(0xf3)](_0x26497a['COLOR_BUFFER_BIT']);const _0x370361={'transferCoordinate':function(_0x4be671){const _0x28f391=_0x3e051e,_0x7cc0b7=null;let _0x3ad383=_0x2b1825['mapvFixedHeight'];_0x2b1825[_0x28f391(_0x5bfebf._0x162155)]&&(_0x3ad383=_0x2b1825[_0x28f391(_0x5bfebf._0x554e4a)]['getHeight'](Cesium$1['Cartographic']['fromDegrees'](_0x4be671[0x0],_0x4be671[0x1])));const _0x1f8922=Cesium$1['Cartesian3'][_0x28f391(_0x5bfebf._0x7a5c4e)](_0x4be671[0x0],_0x4be671[0x1],_0x3ad383);if(!_0x1f8922)return _0x7cc0b7;const _0x598fc6=_0x2b1825[_0x28f391(0xbe)](_0x1f8922);if(!_0x598fc6)return _0x7cc0b7;if(_0x2b1825['mapvDepthTest']&&_0x2b1825[_0x28f391(0xf9)]===Cesium$1[_0x28f391(0xe2)]['SCENE3D']){const _0x32e265=new Cesium$1['EllipsoidalOccluder'](_0x2b1825['globe']['ellipsoid'],_0x2b1825[_0x28f391(_0x5bfebf._0x515e8b)]['positionWC']),_0x52528a=_0x32e265['isPointVisible'](_0x1f8922);if(!_0x52528a)return _0x7cc0b7;}return[_0x598fc6['x'],_0x598fc6['y']];}};void 0x0!==_0x47eb8b&&(_0x370361['filter']=function(_0x15f8bd){const _0x12ce64=_0x3e051e,_0x3eca46=_0x2c1de4['trails']||0xa;return!!(_0x47eb8b&&_0x15f8bd[_0x12ce64(0xce)]>_0x47eb8b-_0x3eca46&&_0x15f8bd['time']<_0x47eb8b);});const _0x202c85=this['dataSet']['get'](_0x370361);this[_0x3e051e(0xcd)](_0x202c85),this['options']['unit']==='m'&&this[_0x3e051e(_0x2ec837._0x468c59)]['size'],this['options']['_size']=this['options'][_0x3e051e(0xe6)];const _0x2ae2cb=_0x2b1825['cartesianToCanvasCoordinates'](Cesium$1['Cartesian3']['fromDegrees'](0x0,0x0));if(!_0x2ae2cb)return;this[_0x3e051e(0xc8)](_0x26497a,new mapv__namespace['DataSet'](_0x202c85),this['options'],_0x2ae2cb),this['options'][_0x3e051e(0xd0)]&&this[_0x3e051e(_0x2ec837._0xdc8c6)]['updateCallback'](_0x47eb8b);}}['updateData'](_0x4560ac,_0x23ad75){const _0x2ce9cc={_0x36917a:0xad},_0x3db0a6=_0x46920f;let _0x3b8ff9=_0x4560ac;_0x3b8ff9&&_0x3b8ff9['get']&&(_0x3b8ff9=_0x3b8ff9['get']()),void 0x0!==_0x3b8ff9&&this['dataSet']['set'](_0x3b8ff9),super[_0x3db0a6(_0x2ce9cc._0x36917a)]({'options':_0x23ad75});}['addData'](_0x5a45f2,_0x504fa8){let _0x38815a=_0x5a45f2;_0x5a45f2&&_0x5a45f2['get']&&(_0x38815a=_0x5a45f2['get']()),this['dataSet']['add'](_0x38815a),this['update']({'options':_0x504fa8});}['getData'](){return this['dataSet'];}['removeData'](_0x27bf2a){const _0x17ece7={_0x5d0dbc:0xf4},_0x3cf111=_0x46920f;if(this['dataSet']){const _0x2f7eaf=this[_0x3cf111(_0x17ece7._0x5d0dbc)][_0x3cf111(0xb0)]({'filter':function(_0x3184c7){return _0x27bf2a==null||typeof _0x27bf2a!=='function'||!_0x27bf2a(_0x3184c7);}});this['dataSet']['set'](_0x2f7eaf),this['update']({'options':null});}}['clearData'](){const _0xb3d5ab={_0x4e1e8e:0xad},_0x250ac0=_0x46920f;this['dataSet']&&this['dataSet'][_0x250ac0(0xf3)](),this[_0x250ac0(_0xb3d5ab._0x4e1e8e)]({'options':null});}[_0x46920f(0xd6)](){this['canvasLayer']['draw']();}['clear'](_0x86010d){const _0x36c7e3={_0x1cfe3e:0x101},_0x281093=_0x46920f;_0x86010d&&_0x86010d['clearRect']&&_0x86010d['clearRect'](0x0,0x0,_0x86010d['canvas']['width'],_0x86010d[_0x281093(_0x36c7e3._0x1cfe3e)][_0x281093(0xcc)]);}['destroy'](){this['clear'](this['getContext']()),this['clearData'](),this['animator']&&this['animator']['stop'](),this['animator']=null,this['canvasLayer']=null;}}function _0x3fc0(_0x2983a6,_0x14e700){const _0x4b4f24=_0x4b4f();return _0x3fc0=function(_0x3fc077,_0xba280a){_0x3fc077=_0x3fc077-0xa8;let _0x5e593e=_0x4b4f24[_0x3fc077];return _0x5e593e;},_0x3fc0(_0x2983a6,_0x14e700);}if(mapv__namespace!==null&&mapv__namespace!==void 0x0&&mapv__namespace[_0x46920f(0xfe)])mapv__namespace['DataSet']['prototype']['transferCoordinate']=function(_0x46ec9c,_0xbc1b83,_0x3413df,_0x1016a7){const _0x5fda62={_0x3b530e:0xec,_0x11c714:0xd9},_0xcc05db=_0x46920f;_0x1016a7=_0x1016a7||_0xcc05db(_0x5fda62._0x3b530e),_0x3413df=_0x3413df||'coordinates';for(let _0x37e0f6=0x0;_0x37e0f6<_0x46ec9c['length'];_0x37e0f6++){const _0x157fd7=_0x46ec9c[_0x37e0f6]['geometry'],_0x22cf4f=_0x157fd7[_0x3413df];switch(_0x157fd7['type']){case'Point':{const _0x306e2f=_0xbc1b83(_0x22cf4f);_0x306e2f?_0x157fd7[_0x1016a7]=_0x306e2f:_0x157fd7[_0x1016a7]=[-0x3e7,-0x3e7];}break;case'LineString':{const _0x123c73=[];for(let _0x59ff77=0x0;_0x59ff77<_0x22cf4f[_0xcc05db(0xb4)];_0x59ff77++){const _0x2d5658=_0xbc1b83(_0x22cf4f[_0x59ff77]);_0x2d5658&&_0x123c73['push'](_0x2d5658);}_0x157fd7[_0x1016a7]=_0x123c73;}break;case'MultiLineString':case'Polygon':{const _0x3262f3=_0x22feee(_0x22cf4f);_0x157fd7[_0x1016a7]=_0x3262f3;}break;case _0xcc05db(_0x5fda62._0x11c714):{const _0x5b056c=[];for(let _0x37c7ff=0x0;_0x37c7ff<_0x22cf4f['length'];_0x37c7ff++){const _0x3c7b8d=_0x22feee(_0x22cf4f[_0x37c7ff]);_0x3c7b8d['length']>0x0&&_0x5b056c['push'](_0x3c7b8d);}_0x157fd7[_0x1016a7]=_0x5b056c;}break;}}function _0x22feee(_0x449faf){const _0x55688e=[];for(let _0x32699a=0x0;_0x32699a<_0x449faf['length'];_0x32699a++){const _0x30dcbd=_0x449faf[_0x32699a],_0x362b3d=[];for(let _0xc2897a=0x0;_0xc2897a<_0x30dcbd['length'];_0xc2897a++){const _0x10c9ca=_0xbc1b83(_0x30dcbd[_0xc2897a]);_0x10c9ca&&_0x362b3d['push'](_0x10c9ca);}_0x362b3d['length']>0x0&&_0x55688e['push'](_0x362b3d);}return _0x55688e;}return _0x46ec9c;};else throw new Error('请引入\x20mapv\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'];class MapVLayer extends BaseLayer{constructor(_0x2ef570,_0x532c1d){const _0x1464c7=_0x46920f;super(_0x2ef570),this['_pointerEvents']=this['options']['pointerEvents'],this['dataSet']=_0x532c1d||new mapv__namespace['DataSet'](_0x2ef570['data']),this[_0x1464c7(0x101)]=null;}get['pointerEvents'](){return this['_pointerEvents'];}set['pointerEvents'](_0x471ecd){const _0x5baa2d=_0x46920f;this['_pointerEvents']=_0x471ecd,this['canvas']&&(_0x471ecd?this[_0x5baa2d(0x101)]['style']['pointerEvents']='all':this['canvas']['style']['pointerEvents']='none');}['_showHook'](_0x178c31){_0x178c31?this['canvas']['style']['display']='block':this['canvas']['style']['display']='none';}['_mountedHook'](){const _0x53da3f={_0xc4ac22:0xf8,_0x550c2f:0xaa},_0x4b9354=_0x46920f;this[_0x4b9354(0xde)]['scene']['mapvDepthTest']=this['options']['depthTest']??!![],this[_0x4b9354(0xde)][_0x4b9354(_0x53da3f._0xc4ac22)]['mapvAutoHeight']=this['options']['clampToGround']??![],this[_0x4b9354(0xde)][_0x4b9354(0xf8)]['mapvFixedHeight']=this[_0x4b9354(_0x53da3f._0x550c2f)]['fixedHeight']??0x0;}['_addedHook'](){const _0x3c1f4e={_0x30d417:0xf4},_0x598aac=_0x46920f;this[_0x598aac(0xf4)]&&(!this['dataSet']['_data']||this['dataSet']['_data']['length']===0x0)&&(this[_0x598aac(0xf4)]['_data']=[]['concat'](this[_0x598aac(_0x3c1f4e._0x30d417)]['_dataCache'])),this['_mapVRenderer']=new MapVRenderer(this['_map'],this['dataSet'],this['options'],this),this['initDevicePixelRatio'](),this['canvas']=this['_createCanvas'](),this['render']=this['render']['bind'](this),this['bindEvent'](),this[_0x598aac(0xa8)]();}['_removedHook'](){const _0x2f0765=_0x46920f;this['unbindEvent'](),this['_mapVRenderer']&&(this['_mapVRenderer'][_0x2f0765(0xee)](),this['_mapVRenderer']=null),this['canvas']['parentElement']['removeChild'](this['canvas']);}[_0x46920f(0xb1)](){const _0x476903={_0xd1ef03:0xbc},_0x3ed28f=_0x46920f;this[_0x3ed28f(_0x476903._0xd1ef03)]=window['devicePixelRatio']||0x1;}['bindEvent'](){const _0x4916b9={_0x5c4f7a:0xa9,_0x5a9ad3:0xd5,_0x1d6a55:0xbf},_0x54525d=_0x46920f;var _0x1a74cf,_0x14f925,_0x4542b7,_0x3a21c0;this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMoveStartEvent'],this),this['_map']['on'](mars3d__namespace['EventType'][_0x54525d(_0x4916b9._0x5c4f7a)],this['_onMoveStartEvent'],this),this[_0x54525d(0xde)]['on'](mars3d__namespace['EventType']['cameraMoveEnd'],this['_onMoveEndEvent'],this),(_0x1a74cf=this[_0x54525d(0xaa)])!==null&&_0x1a74cf!==void 0x0&&(_0x14f925=_0x1a74cf['methods'])!==null&&_0x14f925!==void 0x0&&_0x14f925['click']&&this[_0x54525d(0xde)]['on'](mars3d__namespace['EventType']['click'],this[_0x54525d(_0x4916b9._0x5a9ad3)],this),(_0x4542b7=this['options'])!==null&&_0x4542b7!==void 0x0&&(_0x3a21c0=_0x4542b7['methods'])!==null&&_0x3a21c0!==void 0x0&&_0x3a21c0['mousemove']&&this['_map']['on'](mars3d__namespace['EventType'][_0x54525d(_0x4916b9._0x1d6a55)],this[_0x54525d(0xe8)],this);}['unbindEvent'](){const _0xd1fb7c={_0x6b3c57:0xab,_0x3d1819:0xd4,_0x203438:0xa8,_0x300dac:0xaa},_0x11e246=_0x46920f;var _0x4c408b,_0x46fe91,_0x104b2f,_0x44ab9b;this['_map']['off'](mars3d__namespace[_0x11e246(_0xd1fb7c._0x6b3c57)]['mouseDown'],this['_onMoveStartEvent'],this),this['_map'][_0x11e246(_0xd1fb7c._0x3d1819)](mars3d__namespace['EventType'][_0x11e246(0xa9)],this['_onMoveStartEvent'],this),this['_map']['off'](mars3d__namespace['EventType']['cameraMoveEnd'],this[_0x11e246(0xcf)],this),this['_map']['off'](mars3d__namespace['EventType'][_0x11e246(0xd2)],this[_0x11e246(_0xd1fb7c._0x203438)],this),(_0x4c408b=this[_0x11e246(_0xd1fb7c._0x300dac)])!==null&&_0x4c408b!==void 0x0&&(_0x46fe91=_0x4c408b[_0x11e246(0xc1)])!==null&&_0x46fe91!==void 0x0&&_0x46fe91['click']&&this['_map']['off'](mars3d__namespace['EventType']['click'],this['_onMapClick'],this),(_0x104b2f=this['options'])!==null&&_0x104b2f!==void 0x0&&(_0x44ab9b=_0x104b2f['methods'])!==null&&_0x44ab9b!==void 0x0&&_0x44ab9b['mousemove']&&this['_map']['off'](mars3d__namespace['EventType'][_0x11e246(0xbf)],this['_onMapMouseMove'],this);}[_0x46920f(0xb2)](){const _0xf5ca55=_0x46920f;this['_mapVRenderer']&&(this['_mapVRenderer']['animatorMovestartEvent'](),this['_map']['off'](mars3d__namespace[_0xf5ca55(0xab)]['postRender'],this['_reset'],this),this['_map']['on'](mars3d__namespace['EventType']['postRender'],this['_reset'],this));}['_onMoveEndEvent'](){const _0x39b3e3=_0x46920f;this[_0x39b3e3(0xe5)]&&(this['_map']['off'](mars3d__namespace['EventType']['postRender'],this['_reset'],this),this['_mapVRenderer']['animatorMoveendEvent'](),this['_reset']());}['_setOptionsHook'](_0x530f54,_0x3e1448){const _0x474c0e=_0x46920f;this['_removedHook'](),this[_0x474c0e(0xe4)]();}['addData'](_0x318d05){const _0x4c5b8d=_0x46920f;this['_mapVRenderer']&&this[_0x4c5b8d(0xe5)]['addData'](_0x318d05,this['options']);}['updateData'](_0x405fb4){const _0x843937={_0x22e46b:0xe5,_0x749050:0xaa},_0x52bd06=_0x46920f;this[_0x52bd06(_0x843937._0x22e46b)]&&this[_0x52bd06(0xe5)][_0x52bd06(0xdd)](_0x405fb4,this[_0x52bd06(_0x843937._0x749050)]);}['getData'](){const _0x26c3c4={_0xdb3df:0xe5,_0x4cd11b:0xca,_0x4525f0:0xf4},_0x11b58e=_0x46920f;return this['_mapVRenderer']&&(this['dataSet']=this[_0x11b58e(_0x26c3c4._0xdb3df)][_0x11b58e(_0x26c3c4._0x4cd11b)]()),this[_0x11b58e(_0x26c3c4._0x4525f0)];}[_0x46920f(0xd7)](_0x3e3236){const _0x1af0a5=_0x46920f;this['_mapVRenderer']&&this[_0x1af0a5(0xe5)]['removeData'](_0x3e3236);}['removeAllData'](){const _0x372d92=_0x46920f;this['_mapVRenderer']&&this['_mapVRenderer'][_0x372d92(0xf7)]();}['_createCanvas'](){const _0x1e8468={_0x5adced:0xe9,_0x2e83ea:0xb8,_0x1c20a1:0xfa,_0xb05b5:0xdf,_0x4cd3dd:0xf5},_0x383833=_0x46920f,_0xb0586b=mars3d__namespace['DomUtil'][_0x383833(_0x1e8468._0x5adced)](_0x383833(0x101),'mars3d-mapv',this['_map'][_0x383833(0xf2)]);_0xb0586b['id']=this['id'],_0xb0586b[_0x383833(_0x1e8468._0x2e83ea)]['position']='absolute',_0xb0586b[_0x383833(0xb8)]['top']=_0x383833(0xaf),_0xb0586b['style'][_0x383833(0xe7)]='0px',_0xb0586b['width']=parseInt(this['_map']['canvas']['width']),_0xb0586b['height']=parseInt(this['_map']['canvas']['height']),_0xb0586b['style'][_0x383833(_0x1e8468._0x1c20a1)]=this[_0x383833(0xde)][_0x383833(0x101)]['style']['width'],_0xb0586b[_0x383833(0xb8)]['height']=this['_map']['canvas']['style']['height'],_0xb0586b['style']['pointerEvents']=this[_0x383833(0xc3)]?_0x383833(_0x1e8468._0xb05b5):_0x383833(0xc9),_0xb0586b['style'][_0x383833(_0x1e8468._0x4cd3dd)]=this['options']['zIndex']??0x9;if(this['options']['context']==='2d'){const _0x12d183=this['devicePixelRatio'];_0xb0586b['getContext'](this[_0x383833(0xaa)][_0x383833(0xbb)])['scale'](_0x12d183,_0x12d183);}return _0xb0586b;}['_reset'](){const _0x3fceba={_0xc8f53:0xb3},_0x4468b9=_0x46920f;this[_0x4468b9(_0x3fceba._0xc8f53)](),this['render']();}[_0x46920f(0xd6)](){this['_reset']();}['remove'](){const _0x218f37={_0x15a2d6:0x101},_0xd14c1b=_0x46920f;this['_mapVRenderer']&&(this[_0xd14c1b(0xe5)]['destroy'](),this['_mapVRenderer']=null),this[_0xd14c1b(_0x218f37._0x15a2d6)]['parentElement']['removeChild'](this[_0xd14c1b(_0x218f37._0x15a2d6)]);}['render'](){this['_mapVRenderer']['_canvasUpdate']();}['resize'](){const _0x4d571a={_0x43bce0:0x101,_0x5bcbb0:0xc0,_0x303681:0xb8},_0x28812a=_0x46920f;if(this[_0x28812a(0x101)]){const _0xde00c5=this[_0x28812a(_0x4d571a._0x43bce0)];_0xde00c5[_0x28812a(0xb8)][_0x28812a(_0x4d571a._0x5bcbb0)]='absolute',_0xde00c5['style'][_0x28812a(0xb5)]='0px',_0xde00c5['style']['left']='0px',_0xde00c5['width']=parseInt(this[_0x28812a(0xde)][_0x28812a(0x101)]['width']),_0xde00c5[_0x28812a(0xcc)]=parseInt(this['_map']['canvas']['height']),_0xde00c5[_0x28812a(0xb8)]['width']=this['_map']['canvas'][_0x28812a(_0x4d571a._0x303681)]['width'],_0xde00c5['style']['height']=this['_map'][_0x28812a(_0x4d571a._0x43bce0)][_0x28812a(0xb8)]['height'];}}['getRectangle'](_0x458c0a){const _0x3504bf={_0x51ba1d:0xf0,_0x1e8d99:0xea,_0x492d01:0xf1,_0x35c787:0x104},_0x131bb2=_0x46920f;if(!this[_0x131bb2(0xf4)]||!this['dataSet']['_data'])return;const _0x440b42=mars3d__namespace['Util']['getExtentByGeoJSON']({'type':'FeatureCollection','features':this['dataSet'][_0x131bb2(_0x3504bf._0x51ba1d)]});if(!_0x440b42)return;return _0x458c0a!==null&&_0x458c0a!==void 0x0&&_0x458c0a['isFormat']?_0x440b42:Cesium['Rectangle'][_0x131bb2(_0x3504bf._0x1e8d99)](_0x440b42[_0x131bb2(_0x3504bf._0x492d01)],_0x440b42['ymin'],_0x440b42['xmax'],_0x440b42[_0x131bb2(_0x3504bf._0x35c787)]);}['_onMapClick'](_0x8ed463){const _0x479389={_0x262562:0xd1},_0x2f0f43=_0x46920f;this[_0x2f0f43(_0x479389._0x262562)]=_0x8ed463,this['_mapVRenderer']&&this['_mapVRenderer'][_0x2f0f43(0xae)](_0x8ed463['windowPosition'],_0x8ed463);}['_onMapMouseMove'](_0x395918){const _0xf40bb={_0x5bb7b2:0xe5},_0x143a8a=_0x46920f;this['_cache_event']=_0x395918,this[_0x143a8a(0xe5)]&&this[_0x143a8a(_0xf40bb._0x5bb7b2)]['mousemoveEvent'](_0x395918['windowPosition'],_0x395918);}['on'](_0x4d5b66,_0x46b3fc,_0x2f4247){const _0x534518={_0x2ce4a4:0xc1},_0x833985={_0xf93ac0:0x103},_0x57c559=_0x46920f;this['options']['methods']=this['options']['methods']||{};if(_0x4d5b66===mars3d__namespace['EventType'][_0x57c559(0x102)])this[_0x57c559(0xaa)]['methods']['click']=_0x2912ca=>{const _0x151fd2=_0x57c559;_0x2912ca&&_0x46b3fc[_0x151fd2(0x103)](_0x2f4247)({...this['_cache_event'],'layer':this,'data':_0x2912ca});},this['_map']['on'](mars3d__namespace[_0x57c559(0xab)]['click'],this['_onMapClick'],this);else _0x4d5b66===mars3d__namespace['EventType']['mouseMove']&&(this['options'][_0x57c559(_0x534518._0x2ce4a4)]['mousemove']=_0x50470c=>{const _0x154742=_0x57c559;_0x50470c&&_0x46b3fc[_0x154742(_0x833985._0xf93ac0)](_0x2f4247)({...this['_cache_event'],'layer':this,'data':_0x50470c});},this[_0x57c559(0xde)]['on'](mars3d__namespace['EventType']['mouseMove'],this['_onMapMouseMove'],this));return this;}[_0x46920f(0xd4)](_0x14dad7,_0x44a08c){const _0x56f09a={_0x295ba4:0xde,_0x5f2e02:0xc1,_0x5a8b80:0xe8,_0x2356e0:0xaa},_0x4214e3=_0x46920f;if(_0x14dad7==='click'){var _0x13f7b3;this[_0x4214e3(_0x56f09a._0x295ba4)]['off'](_0x14dad7,this['_onMapClick'],this),(_0x13f7b3=this['options'][_0x4214e3(_0x56f09a._0x5f2e02)])!==null&&_0x13f7b3!==void 0x0&&_0x13f7b3[_0x4214e3(0xd8)]&&delete this['options']['methods']['click'];}else{if(_0x14dad7==='mouseMove'){var _0x4e8c7b;this[_0x4214e3(_0x56f09a._0x295ba4)]['off'](_0x14dad7,this[_0x4214e3(_0x56f09a._0x5a8b80)],this),(_0x4e8c7b=this[_0x4214e3(_0x56f09a._0x2356e0)]['methods'])!==null&&_0x4e8c7b!==void 0x0&&_0x4e8c7b['mousemove']&&delete this['options']['methods']['mousemove'];}}return this;}}mars3d__namespace[_0x46920f(0xda)]['register']('mapv',MapVLayer),mars3d__namespace['layer'][_0x46920f(0xb9)]=MapVLayer,mars3d__namespace['mapv']=mapv__namespace,exports['MapVLayer']=MapVLayer,Object['keys'](mapv)['forEach'](function(_0x2805b6){const _0x55c6b1={_0x2f900a:0xb7},_0x520417=_0x46920f;if(_0x2805b6!=='default'&&!exports[_0x520417(_0x55c6b1._0x2f900a)](_0x2805b6))Object[_0x520417(0xac)](exports,_0x2805b6,{'enumerable':!![],'get':function(){return mapv[_0x2805b6];}});}),Object['defineProperty'](exports,_0x46920f(0xf6),{'value':!![]}); })); diff --git a/public/lib/mars3d/plugins/space/mars3d-space.js b/public/lib/mars3d/plugins/space/mars3d-space.js index 7be44b9c..5787a117 100644 --- a/public/lib/mars3d/plugins/space/mars3d-space.js +++ b/public/lib/mars3d/plugins/space/mars3d-space.js @@ -1,8 +1,8 @@ /** * Mars3D平台插件, 卫星及相关视锥体可视化功能 mars3d-space * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:31:07 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:11:01 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'mars3d'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-space"] = {}, global.mars3d)); })(this, (function (exports, mars3d) { -'use strict';var _0xf77eb6=_0x8ca3;(function(_0x74e171,_0x47bd06){var _0x181b10=_0x8ca3,_0x2ed649=_0x74e171();while(!![]){try{var _0x50f768=-parseInt(_0x181b10(0x21f))/0x1+parseInt(_0x181b10(0x2e5))/0x2+-parseInt(_0x181b10(0x125))/0x3*(parseInt(_0x181b10(0x27a))/0x4)+-parseInt(_0x181b10(0x113))/0x5+-parseInt(_0x181b10(0x18c))/0x6+-parseInt(_0x181b10(0x1ea))/0x7*(parseInt(_0x181b10(0x27c))/0x8)+parseInt(_0x181b10(0x103))/0x9*(parseInt(_0x181b10(0x2e9))/0xa);if(_0x50f768===_0x47bd06)break;else _0x2ed649['push'](_0x2ed649['shift']());}catch(_0x4e322e){_0x2ed649['push'](_0x2ed649['shift']());}}}(_0x52f6,0xb5307));function _interopNamespace(_0x364062){var _0x1d6ad2=_0x8ca3;if(_0x364062&&_0x364062['__esModule'])return _0x364062;var _0x124b94=Object[_0x1d6ad2(0x202)](null);return _0x364062&&Object[_0x1d6ad2(0x2ba)](_0x364062)['forEach'](function(_0x3e2175){var _0x45158f=_0x1d6ad2;if(_0x3e2175!==_0x45158f(0xfa)){var _0x4d73f1=Object['getOwnPropertyDescriptor'](_0x364062,_0x3e2175);Object['defineProperty'](_0x124b94,_0x3e2175,_0x4d73f1['get']?_0x4d73f1:{'enumerable':!![],'get':function(){return _0x364062[_0x3e2175];}});}}),_0x124b94[_0x1d6ad2(0xfa)]=_0x364062,_0x124b94;}function _mergeNamespaces(_0x24dc2e,_0x378871){var _0x3f784e=_0x8ca3;return _0x378871[_0x3f784e(0x1d0)](function(_0x50a371){var _0x2b6543=_0x3f784e;_0x50a371&&typeof _0x50a371!=='string'&&!Array[_0x2b6543(0x171)](_0x50a371)&&Object['keys'](_0x50a371)['forEach'](function(_0x2215b4){var _0x1576c1=_0x2b6543;if(_0x2215b4!=='default'&&!(_0x2215b4 in _0x24dc2e)){var _0x3f7409=Object['getOwnPropertyDescriptor'](_0x50a371,_0x2215b4);Object['defineProperty'](_0x24dc2e,_0x2215b4,_0x3f7409[_0x1576c1(0x138)]?_0x3f7409:{'enumerable':!![],'get':function(){return _0x50a371[_0x2215b4];}});}});}),_0x24dc2e;}var mars3d__namespace=_interopNamespace(mars3d),pi$1=Math['PI'],twoPi$1=pi$1*0x2,deg2rad$1=pi$1/0xb4,rad2deg$1=0xb4/pi$1,minutesPerDay$1=0x5a0,mu$1=398600.8,earthRadius$1=6378.135,xke$1=0x3c/Math['sqrt'](earthRadius$1*earthRadius$1*earthRadius$1/mu$1),vkmpersec$1=earthRadius$1*xke$1/0x3c,tumin$1=0x1/xke$1,j2$1=0.001082616,j3$1=-0.00000253881,j4$1=-0.00000165597,j3oj2$1=j3$1/j2$1,x2o3$1=0x2/0x3,constants$1=Object['freeze']({'__proto__':null,'deg2rad':deg2rad$1,'earthRadius':earthRadius$1,'j2':j2$1,'j3':j3$1,'j3oj2':j3oj2$1,'j4':j4$1,'minutesPerDay':minutesPerDay$1,'mu':mu$1,'pi':pi$1,'rad2deg':rad2deg$1,'tumin':tumin$1,'twoPi':twoPi$1,'vkmpersec':vkmpersec$1,'x2o3':x2o3$1,'xke':xke$1});function days2mdhms$1(_0xd0fe08,_0x515064){var _0x80ff4b=_0x8ca3,_0x5edf3d=[0x1f,_0xd0fe08%0x4===0x0?0x1d:0x1c,0x1f,0x1e,0x1f,0x1e,0x1f,0x1f,0x1e,0x1f,0x1e,0x1f],_0x4f5222=Math[_0x80ff4b(0x27f)](_0x515064),_0x37ea8d=0x1,_0x487555=0x0;while(_0x4f5222>_0x487555+_0x5edf3d[_0x37ea8d-0x1]&&_0x37ea8d<0xc){_0x487555+=_0x5edf3d[_0x37ea8d-0x1],_0x37ea8d+=0x1;}var _0x182a03=_0x37ea8d,_0x3e790d=_0x4f5222-_0x487555,_0xf109f=(_0x515064-_0x4f5222)*0x18,_0xedf397=Math['floor'](_0xf109f);_0xf109f=(_0xf109f-_0xedf397)*0x3c;var _0x1c2542=Math['floor'](_0xf109f),_0x12e5fc=(_0xf109f-_0x1c2542)*0x3c;return{'mon':_0x182a03,'day':_0x3e790d,'hr':_0xedf397,'minute':_0x1c2542,'sec':_0x12e5fc};}function jdayInternal$1(_0x5a4081,_0x49ba0b,_0x14cbbd,_0x45721f,_0x3f6a50,_0x2a3f5a){var _0x2ef68b=_0x8ca3,_0x4cb9c0=arguments['length']>0x6&&arguments[0x6]!==undefined?arguments[0x6]:0x0;return 0x16f*_0x5a4081-Math['floor'](0x7*(_0x5a4081+Math[_0x2ef68b(0x27f)]((_0x49ba0b+0x9)/0xc))*0.25)+Math['floor'](0x113*_0x49ba0b/0x9)+_0x14cbbd+1721013.5+((_0x4cb9c0/0xea60+_0x2a3f5a/0x3c+_0x3f6a50)/0x3c+_0x45721f)/0x18;}function jday$1(_0x1729ae,_0x57bc35,_0x306110,_0x560626,_0x3bb2a8,_0x3a3d84,_0x5806f8){var _0x450cd7=_0x8ca3;if(_0x1729ae instanceof Date){var _0x2e1698=_0x1729ae;return jdayInternal$1(_0x2e1698['getUTCFullYear'](),_0x2e1698['getUTCMonth']()+0x1,_0x2e1698['getUTCDate'](),_0x2e1698['getUTCHours'](),_0x2e1698['getUTCMinutes'](),_0x2e1698['getUTCSeconds'](),_0x2e1698[_0x450cd7(0x313)]());}return jdayInternal$1(_0x1729ae,_0x57bc35,_0x306110,_0x560626,_0x3bb2a8,_0x3a3d84,_0x5806f8);}function invjday$1(_0x251d6b,_0x29d380){var _0x2cd41b=_0x8ca3,_0x35510e=_0x251d6b-2415019.5,_0x4980f1=_0x35510e/365.25,_0x38e7d2=0x76c+Math['floor'](_0x4980f1),_0x4693ae=Math[_0x2cd41b(0x27f)]((_0x38e7d2-0x76d)*0.25),_0x4d603d=_0x35510e-((_0x38e7d2-0x76c)*0x16d+_0x4693ae)+1e-11;_0x4d603d<0x1&&(_0x38e7d2-=0x1,_0x4693ae=Math[_0x2cd41b(0x27f)]((_0x38e7d2-0x76d)*0.25),_0x4d603d=_0x35510e-((_0x38e7d2-0x76c)*0x16d+_0x4693ae));var _0x1093e1=days2mdhms$1(_0x38e7d2,_0x4d603d),_0x3dbee9=_0x1093e1['mon'],_0x118648=_0x1093e1['day'],_0x5412e0=_0x1093e1['hr'],_0x4ca061=_0x1093e1['minute'],_0x4b3cde=_0x1093e1['sec']-8.64e-7;if(_0x29d380)return[_0x38e7d2,_0x3dbee9,_0x118648,_0x5412e0,_0x4ca061,Math['floor'](_0x4b3cde)];return new Date(Date['UTC'](_0x38e7d2,_0x3dbee9-0x1,_0x118648,_0x5412e0,_0x4ca061,Math['floor'](_0x4b3cde)));}function dpper$1(_0x2b410d,_0x487930){var _0x2e3fca=_0x8ca3,_0x3e4921=_0x2b410d['e3'],_0x379ebc=_0x2b410d['ee2'],_0x46f2ef=_0x2b410d['peo'],_0x59a987=_0x2b410d['pgho'],_0x5d5db3=_0x2b410d['pho'],_0x3b38f2=_0x2b410d['pinco'],_0x32b20c=_0x2b410d['plo'],_0x51c512=_0x2b410d[_0x2e3fca(0x147)],_0x326a76=_0x2b410d['se3'],_0x107cb8=_0x2b410d['sgh2'],_0x570855=_0x2b410d['sgh3'],_0x4cc2cb=_0x2b410d['sgh4'],_0x505089=_0x2b410d['sh2'],_0x588d49=_0x2b410d['sh3'],_0x294915=_0x2b410d[_0x2e3fca(0x170)],_0x2aaafa=_0x2b410d['si3'],_0x22d357=_0x2b410d['sl2'],_0x405f5b=_0x2b410d[_0x2e3fca(0x292)],_0x1bc0ff=_0x2b410d['sl4'],_0x3edb02=_0x2b410d['t'],_0x3e2f55=_0x2b410d['xgh2'],_0x294f6b=_0x2b410d['xgh3'],_0x3454b0=_0x2b410d[_0x2e3fca(0x312)],_0x3b7b3a=_0x2b410d['xh2'],_0x24a70b=_0x2b410d[_0x2e3fca(0x225)],_0x56a4ee=_0x2b410d['xi2'],_0x3d5414=_0x2b410d['xi3'],_0x149b03=_0x2b410d['xl2'],_0x3cc69=_0x2b410d['xl3'],_0x52b0cd=_0x2b410d[_0x2e3fca(0x216)],_0x408836=_0x2b410d[_0x2e3fca(0x252)],_0x10305c=_0x2b410d['zmos'],_0x4125e0=_0x487930['init'],_0x1ef2e7=_0x487930['opsmode'],_0x2bb0d2=_0x487930['ep'],_0x410d0a=_0x487930['inclp'],_0xfaa854=_0x487930[_0x2e3fca(0x23b)],_0x3e54e3=_0x487930['argpp'],_0x100442=_0x487930['mp'],_0x593f4d,_0x289384,_0x766e2d,_0xbcac2e,_0x3c6ab3,_0x3182e2,_0x1e773f,_0x28a347,_0x443995,_0x2a7690,_0x4222de,_0x298af9,_0x362d4d,_0x5e6614,_0x23d3cc,_0x55bf56,_0x86306a,_0x9ea203,_0x204bd7,_0x691e16,_0x1a2a97,_0x34535b=0.0000119459,_0x26111c=0.01675,_0x4d339d=0.00015835218,_0x25dadb=0.0549;_0x1a2a97=_0x10305c+_0x34535b*_0x3edb02;_0x4125e0==='y'&&(_0x1a2a97=_0x10305c);_0x691e16=_0x1a2a97+0x2*_0x26111c*Math['sin'](_0x1a2a97),_0x86306a=Math['sin'](_0x691e16),_0x2a7690=0.5*_0x86306a*_0x86306a-0.25,_0x4222de=-0.5*_0x86306a*Math['cos'](_0x691e16);var _0x41a0e5=_0x51c512*_0x2a7690+_0x326a76*_0x4222de,_0x32981d=_0x294915*_0x2a7690+_0x2aaafa*_0x4222de,_0x1668cc=_0x22d357*_0x2a7690+_0x405f5b*_0x4222de+_0x1bc0ff*_0x86306a,_0x423ed7=_0x107cb8*_0x2a7690+_0x570855*_0x4222de+_0x4cc2cb*_0x86306a,_0x335bc0=_0x505089*_0x2a7690+_0x588d49*_0x4222de;_0x1a2a97=_0x408836+_0x4d339d*_0x3edb02;_0x4125e0==='y'&&(_0x1a2a97=_0x408836);_0x691e16=_0x1a2a97+0x2*_0x25dadb*Math['sin'](_0x1a2a97),_0x86306a=Math['sin'](_0x691e16),_0x2a7690=0.5*_0x86306a*_0x86306a-0.25,_0x4222de=-0.5*_0x86306a*Math['cos'](_0x691e16);var _0x407489=_0x379ebc*_0x2a7690+_0x3e4921*_0x4222de,_0x198bce=_0x56a4ee*_0x2a7690+_0x3d5414*_0x4222de,_0x4f66f8=_0x149b03*_0x2a7690+_0x3cc69*_0x4222de+_0x52b0cd*_0x86306a,_0x324829=_0x3e2f55*_0x2a7690+_0x294f6b*_0x4222de+_0x3454b0*_0x86306a,_0x25c0b4=_0x3b7b3a*_0x2a7690+_0x24a70b*_0x4222de;return _0x298af9=_0x41a0e5+_0x407489,_0x23d3cc=_0x32981d+_0x198bce,_0x55bf56=_0x1668cc+_0x4f66f8,_0x362d4d=_0x423ed7+_0x324829,_0x5e6614=_0x335bc0+_0x25c0b4,_0x4125e0==='n'&&(_0x298af9-=_0x46f2ef,_0x23d3cc-=_0x3b38f2,_0x55bf56-=_0x32b20c,_0x362d4d-=_0x59a987,_0x5e6614-=_0x5d5db3,_0x410d0a+=_0x23d3cc,_0x2bb0d2+=_0x298af9,_0xbcac2e=Math[_0x2e3fca(0x280)](_0x410d0a),_0x766e2d=Math['cos'](_0x410d0a),_0x410d0a>=0.2?(_0x5e6614/=_0xbcac2e,_0x362d4d-=_0x766e2d*_0x5e6614,_0x3e54e3+=_0x362d4d,_0xfaa854+=_0x5e6614,_0x100442+=_0x55bf56):(_0x3182e2=Math['sin'](_0xfaa854),_0x3c6ab3=Math['cos'](_0xfaa854),_0x593f4d=_0xbcac2e*_0x3182e2,_0x289384=_0xbcac2e*_0x3c6ab3,_0x1e773f=_0x5e6614*_0x3c6ab3+_0x23d3cc*_0x766e2d*_0x3182e2,_0x28a347=-_0x5e6614*_0x3182e2+_0x23d3cc*_0x766e2d*_0x3c6ab3,_0x593f4d+=_0x1e773f,_0x289384+=_0x28a347,_0xfaa854%=twoPi$1,_0xfaa854<0x0&&_0x1ef2e7==='a'&&(_0xfaa854+=twoPi$1),_0x9ea203=_0x100442+_0x3e54e3+_0x766e2d*_0xfaa854,_0x443995=_0x55bf56+_0x362d4d-_0x23d3cc*_0xfaa854*_0xbcac2e,_0x9ea203+=_0x443995,_0x204bd7=_0xfaa854,_0xfaa854=Math[_0x2e3fca(0x298)](_0x593f4d,_0x289384),_0xfaa854<0x0&&_0x1ef2e7==='a'&&(_0xfaa854+=twoPi$1),Math['abs'](_0x204bd7-_0xfaa854)>pi$1&&(_0xfaa854<_0x204bd7?_0xfaa854+=twoPi$1:_0xfaa854-=twoPi$1),_0x100442+=_0x55bf56,_0x3e54e3=_0x9ea203-_0x100442-_0x766e2d*_0xfaa854)),{'ep':_0x2bb0d2,'inclp':_0x410d0a,'nodep':_0xfaa854,'argpp':_0x3e54e3,'mp':_0x100442};}function dscom$1(_0x5c80f5){var _0x4af5cc=_0x8ca3,_0x32be8a=_0x5c80f5['epoch'],_0xd066a2=_0x5c80f5['ep'],_0x1efc39=_0x5c80f5['argpp'],_0x2e3bfb=_0x5c80f5['tc'],_0xbfb172=_0x5c80f5[_0x4af5cc(0x1a4)],_0x419f1f=_0x5c80f5['nodep'],_0x33a5fd=_0x5c80f5['np'],_0xc54313,_0x3c4e6a,_0x505660,_0x31e975,_0x290a0e,_0x4f8710,_0x240bbe,_0x23462e,_0x3482a1,_0x410aff,_0x26f9ed,_0x4a6756,_0x52e17a,_0x3d718e,_0x704cf,_0xcaa66d,_0x2b8596,_0x420aa7,_0x5a2269,_0x4769b7,_0x2c26eb,_0x2ebfa7,_0x927713,_0x434a41,_0x2d3538,_0x17f2fd,_0x553c32,_0x39dc60,_0x11db0d,_0x200a73,_0x16213a,_0x24df6f,_0x53beab,_0x59d781,_0x13ebf0,_0x1462e3,_0x1a95a4,_0x4762ee,_0x944867,_0x5313ec,_0xfbb417,_0x10562e,_0x4b3ce7,_0x3a573d,_0x1a2b38,_0x15e463,_0x305223,_0x317e6b,_0x29435f,_0x14323a,_0x1cf6c2,_0x506779,_0x12fa47,_0x3096a8,_0x20d0be,_0x1e3ce6,_0x3cdaf3,_0x1e5b35,_0x3676a3,_0x3cc047,_0xffb56d,_0x581efc,_0x471b98,_0x303aac=0.01675,_0x2a28ce=0.0549,_0x12ad57=0.0000029864797,_0x5044c7=4.7968065e-7,_0x15bd51=0.39785416,_0x2b5773=0.91744867,_0x495a6e=0.1945905,_0x566fa5=-0.98088458,_0x212f48=_0x33a5fd,_0x4d7ead=_0xd066a2,_0x4b1cc9=Math['sin'](_0x419f1f),_0x4d5220=Math['cos'](_0x419f1f),_0x10e560=Math[_0x4af5cc(0x280)](_0x1efc39),_0xd20202=Math['cos'](_0x1efc39),_0x4ab980=Math['sin'](_0xbfb172),_0x4623db=Math[_0x4af5cc(0x1b8)](_0xbfb172),_0x1ac07f=_0x4d7ead*_0x4d7ead,_0x121905=0x1-_0x1ac07f,_0x4bf740=Math['sqrt'](_0x121905),_0x330b2d=0x0,_0x3b6105=0x0,_0x556fda=0x0,_0x1f58ec=0x0,_0x32c690=0x0,_0x364d59=_0x32be8a+18261.5+_0x2e3bfb/0x5a0,_0x4fffae=(4.523602-0.00092422029*_0x364d59)%twoPi$1,_0x453985=Math['sin'](_0x4fffae),_0x3355c7=Math['cos'](_0x4fffae),_0x1539c9=0.91375164-0.03568096*_0x3355c7,_0x20221d=Math['sqrt'](0x1-_0x1539c9*_0x1539c9),_0x4487e8=0.089683511*_0x453985/_0x20221d,_0x5cdadc=Math['sqrt'](0x1-_0x4487e8*_0x4487e8),_0x413e49=5.8351514+0.001944368*_0x364d59,_0x2349df=0.39785416*_0x453985/_0x20221d,_0x36cfce=_0x5cdadc*_0x3355c7+0.91744867*_0x4487e8*_0x453985;_0x2349df=Math['atan2'](_0x2349df,_0x36cfce),_0x2349df+=_0x413e49-_0x4fffae;var _0x4f9faa=Math[_0x4af5cc(0x1b8)](_0x2349df),_0x39db4e=Math['sin'](_0x2349df);_0x4769b7=_0x495a6e,_0x2c26eb=_0x566fa5,_0x434a41=_0x2b5773,_0x2d3538=_0x15bd51,_0x2ebfa7=_0x4d5220,_0x927713=_0x4b1cc9,_0x26f9ed=_0x12ad57;var _0x4f7aea=0x1/_0x212f48,_0x4ae279=0x0;while(_0x4ae279<0x2){_0x4ae279+=0x1,_0xc54313=_0x4769b7*_0x2ebfa7+_0x2c26eb*_0x434a41*_0x927713,_0x505660=-_0x2c26eb*_0x2ebfa7+_0x4769b7*_0x434a41*_0x927713,_0x240bbe=-_0x4769b7*_0x927713+_0x2c26eb*_0x434a41*_0x2ebfa7,_0x23462e=_0x2c26eb*_0x2d3538,_0x3482a1=_0x2c26eb*_0x927713+_0x4769b7*_0x434a41*_0x2ebfa7,_0x410aff=_0x4769b7*_0x2d3538,_0x3c4e6a=_0x4623db*_0x240bbe+_0x4ab980*_0x23462e,_0x31e975=_0x4623db*_0x3482a1+_0x4ab980*_0x410aff,_0x290a0e=-_0x4ab980*_0x240bbe+_0x4623db*_0x23462e,_0x4f8710=-_0x4ab980*_0x3482a1+_0x4623db*_0x410aff,_0x4a6756=_0xc54313*_0xd20202+_0x3c4e6a*_0x10e560,_0x52e17a=_0x505660*_0xd20202+_0x31e975*_0x10e560,_0x3d718e=-_0xc54313*_0x10e560+_0x3c4e6a*_0xd20202,_0x704cf=-_0x505660*_0x10e560+_0x31e975*_0xd20202,_0xcaa66d=_0x290a0e*_0x10e560,_0x2b8596=_0x4f8710*_0x10e560,_0x420aa7=_0x290a0e*_0xd20202,_0x5a2269=_0x4f8710*_0xd20202,_0xffb56d=0xc*_0x4a6756*_0x4a6756-0x3*_0x3d718e*_0x3d718e,_0x581efc=0x18*_0x4a6756*_0x52e17a-0x6*_0x3d718e*_0x704cf,_0x471b98=0xc*_0x52e17a*_0x52e17a-0x3*_0x704cf*_0x704cf,_0x506779=0x3*(_0xc54313*_0xc54313+_0x3c4e6a*_0x3c4e6a)+_0xffb56d*_0x1ac07f,_0x12fa47=0x6*(_0xc54313*_0x505660+_0x3c4e6a*_0x31e975)+_0x581efc*_0x1ac07f,_0x3096a8=0x3*(_0x505660*_0x505660+_0x31e975*_0x31e975)+_0x471b98*_0x1ac07f,_0x20d0be=-0x6*_0xc54313*_0x290a0e+_0x1ac07f*(-0x18*_0x4a6756*_0x420aa7-0x6*_0x3d718e*_0xcaa66d),_0x1e3ce6=-0x6*(_0xc54313*_0x4f8710+_0x505660*_0x290a0e)+_0x1ac07f*(-0x18*(_0x52e17a*_0x420aa7+_0x4a6756*_0x5a2269)+-0x6*(_0x3d718e*_0x2b8596+_0x704cf*_0xcaa66d)),_0x3cdaf3=-0x6*_0x505660*_0x4f8710+_0x1ac07f*(-0x18*_0x52e17a*_0x5a2269-0x6*_0x704cf*_0x2b8596),_0x1e5b35=0x6*_0x3c4e6a*_0x290a0e+_0x1ac07f*(0x18*_0x4a6756*_0xcaa66d-0x6*_0x3d718e*_0x420aa7),_0x3676a3=0x6*(_0x31e975*_0x290a0e+_0x3c4e6a*_0x4f8710)+_0x1ac07f*(0x18*(_0x52e17a*_0xcaa66d+_0x4a6756*_0x2b8596)-0x6*(_0x704cf*_0x420aa7+_0x3d718e*_0x5a2269)),_0x3cc047=0x6*_0x31e975*_0x4f8710+_0x1ac07f*(0x18*_0x52e17a*_0x2b8596-0x6*_0x704cf*_0x5a2269),_0x506779=_0x506779+_0x506779+_0x121905*_0xffb56d,_0x12fa47=_0x12fa47+_0x12fa47+_0x121905*_0x581efc,_0x3096a8=_0x3096a8+_0x3096a8+_0x121905*_0x471b98,_0x305223=_0x26f9ed*_0x4f7aea,_0x15e463=-0.5*_0x305223/_0x4bf740,_0x317e6b=_0x305223*_0x4bf740,_0x1a2b38=-0xf*_0x4d7ead*_0x317e6b,_0x29435f=_0x4a6756*_0x3d718e+_0x52e17a*_0x704cf,_0x14323a=_0x52e17a*_0x3d718e+_0x4a6756*_0x704cf,_0x1cf6c2=_0x52e17a*_0x704cf-_0x4a6756*_0x3d718e,_0x4ae279===0x1&&(_0x17f2fd=_0x1a2b38,_0x553c32=_0x15e463,_0x39dc60=_0x305223,_0x11db0d=_0x317e6b,_0x200a73=_0x29435f,_0x16213a=_0x14323a,_0x24df6f=_0x1cf6c2,_0x53beab=_0x506779,_0x59d781=_0x12fa47,_0x13ebf0=_0x3096a8,_0x1462e3=_0x20d0be,_0x1a95a4=_0x1e3ce6,_0x4762ee=_0x3cdaf3,_0x944867=_0x1e5b35,_0x5313ec=_0x3676a3,_0xfbb417=_0x3cc047,_0x10562e=_0xffb56d,_0x4b3ce7=_0x581efc,_0x3a573d=_0x471b98,_0x4769b7=_0x4f9faa,_0x2c26eb=_0x39db4e,_0x434a41=_0x1539c9,_0x2d3538=_0x20221d,_0x2ebfa7=_0x5cdadc*_0x4d5220+_0x4487e8*_0x4b1cc9,_0x927713=_0x4b1cc9*_0x5cdadc-_0x4d5220*_0x4487e8,_0x26f9ed=_0x5044c7);}var _0x23ab5b=(4.7199672+(0.2299715*_0x364d59-_0x413e49))%twoPi$1,_0x258571=(6.2565837+0.017201977*_0x364d59)%twoPi$1,_0x1dcc1c=0x2*_0x17f2fd*_0x16213a,_0x282245=0x2*_0x17f2fd*_0x24df6f,_0x47e0e9=0x2*_0x553c32*_0x1a95a4,_0xff98d8=0x2*_0x553c32*(_0x4762ee-_0x1462e3),_0xf63cbf=-0x2*_0x39dc60*_0x59d781,_0x5658e4=-0x2*_0x39dc60*(_0x13ebf0-_0x53beab),_0x79f130=-0x2*_0x39dc60*(-0x15-0x9*_0x1ac07f)*_0x303aac,_0x1033e1=0x2*_0x11db0d*_0x4b3ce7,_0x20ef0f=0x2*_0x11db0d*(_0x3a573d-_0x10562e),_0x71207d=-0x12*_0x11db0d*_0x303aac,_0x571e80=-0x2*_0x553c32*_0x5313ec,_0x59fed3=-0x2*_0x553c32*(_0xfbb417-_0x944867),_0x5c2b15=0x2*_0x1a2b38*_0x14323a,_0x3989b2=0x2*_0x1a2b38*_0x1cf6c2,_0x32861b=0x2*_0x15e463*_0x1e3ce6,_0x5869d1=0x2*_0x15e463*(_0x3cdaf3-_0x20d0be),_0x42a257=-0x2*_0x305223*_0x12fa47,_0x41a778=-0x2*_0x305223*(_0x3096a8-_0x506779),_0x3e7b5c=-0x2*_0x305223*(-0x15-0x9*_0x1ac07f)*_0x2a28ce,_0xb9e258=0x2*_0x317e6b*_0x581efc,_0x138cb6=0x2*_0x317e6b*(_0x471b98-_0xffb56d),_0x1ae8eb=-0x12*_0x317e6b*_0x2a28ce,_0x29452d=-0x2*_0x15e463*_0x3676a3,_0x2bb07d=-0x2*_0x15e463*(_0x3cc047-_0x1e5b35);return{'snodm':_0x4b1cc9,'cnodm':_0x4d5220,'sinim':_0x4ab980,'cosim':_0x4623db,'sinomm':_0x10e560,'cosomm':_0xd20202,'day':_0x364d59,'e3':_0x3989b2,'ee2':_0x5c2b15,'em':_0x4d7ead,'emsq':_0x1ac07f,'gam':_0x413e49,'peo':_0x330b2d,'pgho':_0x1f58ec,'pho':_0x32c690,'pinco':_0x3b6105,'plo':_0x556fda,'rtemsq':_0x4bf740,'se2':_0x1dcc1c,'se3':_0x282245,'sgh2':_0x1033e1,'sgh3':_0x20ef0f,'sgh4':_0x71207d,'sh2':_0x571e80,'sh3':_0x59fed3,'si2':_0x47e0e9,'si3':_0xff98d8,'sl2':_0xf63cbf,'sl3':_0x5658e4,'sl4':_0x79f130,'s1':_0x1a2b38,'s2':_0x15e463,'s3':_0x305223,'s4':_0x317e6b,'s5':_0x29435f,'s6':_0x14323a,'s7':_0x1cf6c2,'ss1':_0x17f2fd,'ss2':_0x553c32,'ss3':_0x39dc60,'ss4':_0x11db0d,'ss5':_0x200a73,'ss6':_0x16213a,'ss7':_0x24df6f,'sz1':_0x53beab,'sz2':_0x59d781,'sz3':_0x13ebf0,'sz11':_0x1462e3,'sz12':_0x1a95a4,'sz13':_0x4762ee,'sz21':_0x944867,'sz22':_0x5313ec,'sz23':_0xfbb417,'sz31':_0x10562e,'sz32':_0x4b3ce7,'sz33':_0x3a573d,'xgh2':_0xb9e258,'xgh3':_0x138cb6,'xgh4':_0x1ae8eb,'xh2':_0x29452d,'xh3':_0x2bb07d,'xi2':_0x32861b,'xi3':_0x5869d1,'xl2':_0x42a257,'xl3':_0x41a778,'xl4':_0x3e7b5c,'nm':_0x212f48,'z1':_0x506779,'z2':_0x12fa47,'z3':_0x3096a8,'z11':_0x20d0be,'z12':_0x1e3ce6,'z13':_0x3cdaf3,'z21':_0x1e5b35,'z22':_0x3676a3,'z23':_0x3cc047,'z31':_0xffb56d,'z32':_0x581efc,'z33':_0x471b98,'zmol':_0x23ab5b,'zmos':_0x258571};}function dsinit$1(_0x2af240){var _0x513001=_0x8ca3,_0x5d3d92=_0x2af240['cosim'],_0x1764d5=_0x2af240['argpo'],_0x24f0e8=_0x2af240['s1'],_0x461d54=_0x2af240['s2'],_0x1cf7fd=_0x2af240['s3'],_0x309555=_0x2af240['s4'],_0x16c398=_0x2af240['s5'],_0x301a32=_0x2af240['sinim'],_0x1243a0=_0x2af240[_0x513001(0x120)],_0x378042=_0x2af240['ss2'],_0x3187d9=_0x2af240['ss3'],_0x327809=_0x2af240['ss4'],_0x44840a=_0x2af240['ss5'],_0x4ff614=_0x2af240[_0x513001(0x1bc)],_0x147d4b=_0x2af240['sz3'],_0x2813c1=_0x2af240[_0x513001(0x30c)],_0x2eab3a=_0x2af240['sz13'],_0x57262d=_0x2af240[_0x513001(0x281)],_0x324a61=_0x2af240[_0x513001(0x205)],_0x3dcc9e=_0x2af240['sz31'],_0x202353=_0x2af240[_0x513001(0x2d3)],_0x4dfe07=_0x2af240['t'],_0x1f8352=_0x2af240['tc'],_0x45d8f2=_0x2af240[_0x513001(0x2c2)],_0x303e35=_0x2af240['mo'],_0x14180e=_0x2af240['mdot'],_0x4b9405=_0x2af240['no'],_0x38d108=_0x2af240['nodeo'],_0x478d97=_0x2af240['nodedot'],_0x27fc40=_0x2af240['xpidot'],_0x351ca9=_0x2af240['z1'],_0x192da3=_0x2af240['z3'],_0x4453ed=_0x2af240['z11'],_0x5ebdfe=_0x2af240[_0x513001(0x142)],_0x3f6278=_0x2af240['z21'],_0x20bc00=_0x2af240['z23'],_0xdd519e=_0x2af240['z31'],_0x173ba6=_0x2af240[_0x513001(0x1e7)],_0x46690a=_0x2af240['ecco'],_0xe4263a=_0x2af240['eccsq'],_0x4b9b43=_0x2af240['emsq'],_0x37d4c6=_0x2af240['em'],_0x297469=_0x2af240['argpm'],_0x177931=_0x2af240['inclm'],_0x808e35=_0x2af240['mm'],_0x1117ca=_0x2af240['nm'],_0x59a057=_0x2af240['nodem'],_0x478093=_0x2af240['irez'],_0x2a4b29=_0x2af240[_0x513001(0x2cd)],_0x5bffb8=_0x2af240[_0x513001(0x315)],_0x3ff47c=_0x2af240[_0x513001(0x2c7)],_0x1d146c=_0x2af240['d3210'],_0x28fae6=_0x2af240['d3222'],_0x46bef7=_0x2af240['d4410'],_0x2b25d0=_0x2af240[_0x513001(0x157)],_0x2a8cc6=_0x2af240['d5220'],_0x323f4a=_0x2af240[_0x513001(0x12b)],_0xf6a3a4=_0x2af240['d5421'],_0xe1268d=_0x2af240['d5433'],_0x5d6366=_0x2af240[_0x513001(0x204)],_0x29c1fc=_0x2af240[_0x513001(0x150)],_0x2f8952=_0x2af240['dmdt'],_0x2cbed3=_0x2af240['dnodt'],_0x8e13ec=_0x2af240['domdt'],_0x4a7319=_0x2af240[_0x513001(0x210)],_0x32065a=_0x2af240['del2'],_0x3919f0=_0x2af240['del3'],_0x2265b5=_0x2af240[_0x513001(0x181)],_0x2e6ab6=_0x2af240['xlamo'],_0x251e43=_0x2af240[_0x513001(0x24e)],_0x4c5928=_0x2af240['xni'],_0x56dba9,_0xf3f4b4,_0x2e1fc9,_0x383b3b,_0x6ae211,_0x1f493f,_0x271f69,_0x4e6b65,_0x151745,_0x395afb,_0x4d1847,_0x492786,_0x3f6d43,_0x5e471e,_0x2f17fd,_0x9943e2,_0x2770a3,_0x4e935c,_0x33ea4d,_0xa0a3d8,_0x54a786,_0x56d89b,_0x4ac50c,_0x38ce9b,_0x3725da,_0x540307,_0x38d3db,_0x352b91,_0x4fad1a,_0x4c8885,_0x53f88a,_0xc75b9a,_0x576358=0.0000017891679,_0x2b4879=0.0000021460748,_0x12f6aa=2.2123015e-7,_0x5ed689=0.0000017891679,_0x22e4ba=7.3636953e-9,_0x27c668=2.1765803e-9,_0x479067=0.0043752690880113,_0x69f2a0=3.7393792e-7,_0x8a69b5=1.1428639e-7,_0x5e113c=0.00015835218,_0x11d107=0.0000119459;_0x478093=0x0;_0x1117ca<0.0052359877&&_0x1117ca>0.0034906585&&(_0x478093=0x1);_0x1117ca>=0.00826&&_0x1117ca<=0.00924&&_0x37d4c6>=0.5&&(_0x478093=0x2);var _0x31b958=_0x1243a0*_0x11d107*_0x44840a,_0xa8fe80=_0x378042*_0x11d107*(_0x2813c1+_0x2eab3a),_0x5c3421=-_0x11d107*_0x3187d9*(_0x4ff614+_0x147d4b-0xe-0x6*_0x4b9b43),_0x3ce2b7=_0x327809*_0x11d107*(_0x3dcc9e+_0x202353-0x6),_0x49db97=-_0x11d107*_0x378042*(_0x57262d+_0x324a61);(_0x177931<0.052359877||_0x177931>pi$1-0.052359877)&&(_0x49db97=0x0);_0x301a32!==0x0&&(_0x49db97/=_0x301a32);var _0x3f902b=_0x3ce2b7-_0x5d3d92*_0x49db97;_0x5d6366=_0x31b958+_0x24f0e8*_0x5e113c*_0x16c398,_0x29c1fc=_0xa8fe80+_0x461d54*_0x5e113c*(_0x4453ed+_0x5ebdfe),_0x2f8952=_0x5c3421-_0x5e113c*_0x1cf7fd*(_0x351ca9+_0x192da3-0xe-0x6*_0x4b9b43);var _0x1ccbea=_0x309555*_0x5e113c*(_0xdd519e+_0x173ba6-0x6),_0x2028eb=-_0x5e113c*_0x461d54*(_0x3f6278+_0x20bc00);(_0x177931<0.052359877||_0x177931>pi$1-0.052359877)&&(_0x2028eb=0x0);_0x8e13ec=_0x3f902b+_0x1ccbea,_0x2cbed3=_0x49db97;_0x301a32!==0x0&&(_0x8e13ec-=_0x5d3d92/_0x301a32*_0x2028eb,_0x2cbed3+=_0x2028eb/_0x301a32);var _0x2ce740=0x0,_0x35c996=(_0x45d8f2+_0x1f8352*_0x479067)%twoPi$1;_0x37d4c6+=_0x5d6366*_0x4dfe07,_0x177931+=_0x29c1fc*_0x4dfe07,_0x297469+=_0x8e13ec*_0x4dfe07,_0x59a057+=_0x2cbed3*_0x4dfe07,_0x808e35+=_0x2f8952*_0x4dfe07;if(_0x478093!==0x0){_0x4c8885=Math['pow'](_0x1117ca/xke$1,x2o3$1);if(_0x478093===0x2){_0x53f88a=_0x5d3d92*_0x5d3d92;var _0x1e5149=_0x37d4c6;_0x37d4c6=_0x46690a;var _0x6bbe88=_0x4b9b43;_0x4b9b43=_0xe4263a,_0xc75b9a=_0x37d4c6*_0x4b9b43,_0x5e471e=-0.306-(_0x37d4c6-0.64)*0.44,_0x37d4c6<=0.65?(_0x2f17fd=3.616-13.247*_0x37d4c6+16.29*_0x4b9b43,_0x2770a3=-19.302+117.39*_0x37d4c6-228.419*_0x4b9b43+156.591*_0xc75b9a,_0x4e935c=-18.9068+109.7927*_0x37d4c6-214.6334*_0x4b9b43+146.5816*_0xc75b9a,_0x33ea4d=-41.122+242.694*_0x37d4c6-471.094*_0x4b9b43+313.953*_0xc75b9a,_0xa0a3d8=-146.407+841.88*_0x37d4c6-1629.014*_0x4b9b43+1083.435*_0xc75b9a,_0x54a786=-532.114+3017.977*_0x37d4c6-5740.032*_0x4b9b43+3708.276*_0xc75b9a):(_0x2f17fd=-72.099+331.819*_0x37d4c6-508.738*_0x4b9b43+266.724*_0xc75b9a,_0x2770a3=-346.844+1582.851*_0x37d4c6-2415.925*_0x4b9b43+1246.113*_0xc75b9a,_0x4e935c=-342.585+1554.908*_0x37d4c6-2366.899*_0x4b9b43+1215.972*_0xc75b9a,_0x33ea4d=-1052.797+4758.686*_0x37d4c6-7193.992*_0x4b9b43+3651.957*_0xc75b9a,_0xa0a3d8=-3581.69+16178.11*_0x37d4c6-24462.77*_0x4b9b43+12422.52*_0xc75b9a,_0x37d4c6>0.715?_0x54a786=-5149.66+29936.92*_0x37d4c6-54087.36*_0x4b9b43+31324.56*_0xc75b9a:_0x54a786=1464.74-4664.75*_0x37d4c6+3763.64*_0x4b9b43),_0x37d4c6<0.7?(_0x38ce9b=-919.2277+4988.61*_0x37d4c6-9064.77*_0x4b9b43+5542.21*_0xc75b9a,_0x56d89b=-822.71072+4568.6173*_0x37d4c6-8491.4146*_0x4b9b43+5337.524*_0xc75b9a,_0x4ac50c=-853.666+4690.25*_0x37d4c6-8624.77*_0x4b9b43+5341.4*_0xc75b9a):(_0x38ce9b=-37995.78+161616.52*_0x37d4c6-229838.2*_0x4b9b43+109377.94*_0xc75b9a,_0x56d89b=-51752.104+218913.95*_0x37d4c6-309468.16*_0x4b9b43+146349.42*_0xc75b9a,_0x4ac50c=-40023.88+170470.89*_0x37d4c6-242699.48*_0x4b9b43+115605.82*_0xc75b9a),_0x3725da=_0x301a32*_0x301a32,_0x56dba9=0.75*(0x1+0x2*_0x5d3d92+_0x53f88a),_0xf3f4b4=1.5*_0x3725da,_0x383b3b=1.875*_0x301a32*(0x1-0x2*_0x5d3d92-0x3*_0x53f88a),_0x6ae211=-1.875*_0x301a32*(0x1+0x2*_0x5d3d92-0x3*_0x53f88a),_0x271f69=0x23*_0x3725da*_0x56dba9,_0x4e6b65=39.375*_0x3725da*_0x3725da,_0x151745=9.84375*_0x301a32*(_0x3725da*(0x1-0x2*_0x5d3d92-0x5*_0x53f88a)+0.33333333*(-0x2+0x4*_0x5d3d92+0x6*_0x53f88a)),_0x395afb=_0x301a32*(4.92187512*_0x3725da*(-0x2-0x4*_0x5d3d92+0xa*_0x53f88a)+6.56250012*(0x1+0x2*_0x5d3d92-0x3*_0x53f88a)),_0x4d1847=29.53125*_0x301a32*(0x2-0x8*_0x5d3d92+_0x53f88a*(-0xc+0x8*_0x5d3d92+0xa*_0x53f88a)),_0x492786=29.53125*_0x301a32*(-0x2-0x8*_0x5d3d92+_0x53f88a*(0xc+0x8*_0x5d3d92-0xa*_0x53f88a)),_0x352b91=_0x1117ca*_0x1117ca,_0x4fad1a=_0x4c8885*_0x4c8885,_0x38d3db=0x3*_0x352b91*_0x4fad1a,_0x540307=_0x38d3db*_0x5ed689,_0x5bffb8=_0x540307*_0x56dba9*_0x5e471e,_0x3ff47c=_0x540307*_0xf3f4b4*_0x2f17fd,_0x38d3db*=_0x4c8885,_0x540307=_0x38d3db*_0x69f2a0,_0x1d146c=_0x540307*_0x383b3b*_0x2770a3,_0x28fae6=_0x540307*_0x6ae211*_0x4e935c,_0x38d3db*=_0x4c8885,_0x540307=0x2*_0x38d3db*_0x22e4ba,_0x46bef7=_0x540307*_0x271f69*_0x33ea4d,_0x2b25d0=_0x540307*_0x4e6b65*_0xa0a3d8,_0x38d3db*=_0x4c8885,_0x540307=_0x38d3db*_0x8a69b5,_0x2a8cc6=_0x540307*_0x151745*_0x54a786,_0x323f4a=_0x540307*_0x395afb*_0x4ac50c,_0x540307=0x2*_0x38d3db*_0x27c668,_0xf6a3a4=_0x540307*_0x4d1847*_0x56d89b,_0xe1268d=_0x540307*_0x492786*_0x38ce9b,_0x2e6ab6=(_0x303e35+_0x38d108+_0x38d108-(_0x35c996+_0x35c996))%twoPi$1,_0x2265b5=_0x14180e+_0x2f8952+0x2*(_0x478d97+_0x2cbed3-_0x479067)-_0x4b9405,_0x37d4c6=_0x1e5149,_0x4b9b43=_0x6bbe88;}_0x478093===0x1&&(_0x3f6d43=0x1+_0x4b9b43*(-2.5+0.8125*_0x4b9b43),_0x2770a3=0x1+0x2*_0x4b9b43,_0x9943e2=0x1+_0x4b9b43*(-0x6+6.60937*_0x4b9b43),_0x56dba9=0.75*(0x1+_0x5d3d92)*(0x1+_0x5d3d92),_0x2e1fc9=0.9375*_0x301a32*_0x301a32*(0x1+0x3*_0x5d3d92)-0.75*(0x1+_0x5d3d92),_0x1f493f=0x1+_0x5d3d92,_0x1f493f*=1.875*_0x1f493f*_0x1f493f,_0x4a7319=0x3*_0x1117ca*_0x1117ca*_0x4c8885*_0x4c8885,_0x32065a=0x2*_0x4a7319*_0x56dba9*_0x3f6d43*_0x576358,_0x3919f0=0x3*_0x4a7319*_0x1f493f*_0x9943e2*_0x12f6aa*_0x4c8885,_0x4a7319=_0x4a7319*_0x2e1fc9*_0x2770a3*_0x2b4879*_0x4c8885,_0x2e6ab6=(_0x303e35+_0x38d108+_0x1764d5-_0x35c996)%twoPi$1,_0x2265b5=_0x14180e+_0x27fc40+_0x2f8952+_0x8e13ec+_0x2cbed3-(_0x4b9405+_0x479067)),_0x251e43=_0x2e6ab6,_0x4c5928=_0x4b9405,_0x2a4b29=0x0,_0x1117ca=_0x4b9405+_0x2ce740;}return{'em':_0x37d4c6,'argpm':_0x297469,'inclm':_0x177931,'mm':_0x808e35,'nm':_0x1117ca,'nodem':_0x59a057,'irez':_0x478093,'atime':_0x2a4b29,'d2201':_0x5bffb8,'d2211':_0x3ff47c,'d3210':_0x1d146c,'d3222':_0x28fae6,'d4410':_0x46bef7,'d4422':_0x2b25d0,'d5220':_0x2a8cc6,'d5232':_0x323f4a,'d5421':_0xf6a3a4,'d5433':_0xe1268d,'dedt':_0x5d6366,'didt':_0x29c1fc,'dmdt':_0x2f8952,'dndt':_0x2ce740,'dnodt':_0x2cbed3,'domdt':_0x8e13ec,'del1':_0x4a7319,'del2':_0x32065a,'del3':_0x3919f0,'xfact':_0x2265b5,'xlamo':_0x2e6ab6,'xli':_0x251e43,'xni':_0x4c5928};}function gstimeInternal$1(_0x204bdc){var _0x42f9d2=(_0x204bdc-0x256859)/0x8ead,_0x1da9d5=-0.0000062*_0x42f9d2*_0x42f9d2*_0x42f9d2+0.093104*_0x42f9d2*_0x42f9d2+(0xd6038*0xe10+8640184.812866)*_0x42f9d2+67310.54841;return _0x1da9d5=_0x1da9d5*deg2rad$1/0xf0%twoPi$1,_0x1da9d5<0x0&&(_0x1da9d5+=twoPi$1),_0x1da9d5;}function gstime$1(){var _0x40dd1b=_0x8ca3;if((arguments[_0x40dd1b(0x31f)]<=0x0?undefined:arguments[0x0])instanceof Date||arguments[_0x40dd1b(0x31f)]>0x1)return gstimeInternal$1(jday$1['apply'](void 0x0,arguments));return gstimeInternal$1[_0x40dd1b(0x1d3)](void 0x0,arguments);}function initl$1(_0x512972){var _0x48ab2d=_0x8ca3,_0x464464=_0x512972['ecco'],_0x39e1ca=_0x512972['epoch'],_0x1ab925=_0x512972[_0x48ab2d(0x26a)],_0x165b9d=_0x512972['opsmode'],_0xc321e=_0x512972['no'],_0x36d176=_0x464464*_0x464464,_0xde7aa8=0x1-_0x36d176,_0xe832c0=Math['sqrt'](_0xde7aa8),_0x4303d4=Math['cos'](_0x1ab925),_0x5444bb=_0x4303d4*_0x4303d4,_0x1c7c37=Math[_0x48ab2d(0x2ef)](xke$1/_0xc321e,x2o3$1),_0x52d2bd=0.75*j2$1*(0x3*_0x5444bb-0x1)/(_0xe832c0*_0xde7aa8),_0x8b77c4=_0x52d2bd/(_0x1c7c37*_0x1c7c37),_0xb6273a=_0x1c7c37*(0x1-_0x8b77c4*_0x8b77c4-_0x8b77c4*(0x1/0x3+0x86*_0x8b77c4*_0x8b77c4/0x51));_0x8b77c4=_0x52d2bd/(_0xb6273a*_0xb6273a),_0xc321e/=0x1+_0x8b77c4;var _0x3ce759=Math['pow'](xke$1/_0xc321e,x2o3$1),_0x9c9fd3=Math['sin'](_0x1ab925),_0x312e63=_0x3ce759*_0xde7aa8,_0x9ed2ff=0x1-0x5*_0x5444bb,_0x20f066=-_0x9ed2ff-_0x5444bb-_0x5444bb,_0x5d82da=0x1/_0x3ce759,_0x5310b5=_0x312e63*_0x312e63,_0x4267a4=_0x3ce759*(0x1-_0x464464),_0x1799b4='n',_0x4e9cf2;if(_0x165b9d==='a'){var _0x1306a4=_0x39e1ca-0x1c89,_0x5d870d=Math['floor'](_0x1306a4+1e-8),_0xa6e07e=_0x1306a4-_0x5d870d,_0x2ce4b8=0.017202791694070362,_0x4c4e32=1.7321343856509375,_0x1806cb=5.075514194322695e-15,_0xf38606=_0x2ce4b8+twoPi$1;_0x4e9cf2=(_0x4c4e32+_0x2ce4b8*_0x5d870d+_0xf38606*_0xa6e07e+_0x1306a4*_0x1306a4*_0x1806cb)%twoPi$1,_0x4e9cf2<0x0&&(_0x4e9cf2+=twoPi$1);}else _0x4e9cf2=gstime$1(_0x39e1ca+2433281.5);return{'no':_0xc321e,'method':_0x1799b4,'ainv':_0x5d82da,'ao':_0x3ce759,'con41':_0x20f066,'con42':_0x9ed2ff,'cosio':_0x4303d4,'cosio2':_0x5444bb,'eccsq':_0x36d176,'omeosq':_0xde7aa8,'posq':_0x5310b5,'rp':_0x4267a4,'rteosq':_0xe832c0,'sinio':_0x9c9fd3,'gsto':_0x4e9cf2};}function dspace$1(_0x24af5e){var _0x4a5dcd=_0x8ca3,_0x14e53a=_0x24af5e[_0x4a5dcd(0x1cd)],_0x5b53b3=_0x24af5e['d2201'],_0xae1be6=_0x24af5e['d2211'],_0x2d0e1f=_0x24af5e[_0x4a5dcd(0xff)],_0x1a7551=_0x24af5e[_0x4a5dcd(0x104)],_0x26aa7e=_0x24af5e['d4410'],_0x4f2336=_0x24af5e['d4422'],_0x5496c7=_0x24af5e[_0x4a5dcd(0x309)],_0xa4d59=_0x24af5e['d5232'],_0x54e9e2=_0x24af5e['d5421'],_0x44e027=_0x24af5e[_0x4a5dcd(0x1cb)],_0x5d5868=_0x24af5e['dedt'],_0x5deb22=_0x24af5e['del1'],_0x3a9563=_0x24af5e['del2'],_0xf3314=_0x24af5e[_0x4a5dcd(0x17d)],_0x577e7c=_0x24af5e['didt'],_0x341fb3=_0x24af5e['dmdt'],_0x234436=_0x24af5e['dnodt'],_0xab277e=_0x24af5e[_0x4a5dcd(0x102)],_0x103a7b=_0x24af5e[_0x4a5dcd(0x2e7)],_0x2af2c8=_0x24af5e[_0x4a5dcd(0x159)],_0x34add6=_0x24af5e['t'],_0x1a0639=_0x24af5e['tc'],_0x527a1a=_0x24af5e['gsto'],_0x1f724a=_0x24af5e['xfact'],_0x47a298=_0x24af5e['xlamo'],_0x130224=_0x24af5e['no'],_0x12649c=_0x24af5e['atime'],_0x3f07ed=_0x24af5e['em'],_0x39c756=_0x24af5e['argpm'],_0xd06178=_0x24af5e['inclm'],_0x26a33e=_0x24af5e['xli'],_0x3c3c49=_0x24af5e['mm'],_0x2fe41d=_0x24af5e[_0x4a5dcd(0x1c9)],_0x2a3d5f=_0x24af5e['nodem'],_0x513103=_0x24af5e['nm'],_0x193549=0.13130908,_0x529528=2.8843198,_0x57f8c8=0.37448087,_0x6f2ac=5.7686396,_0x1b0502=0.95240898,_0x30403a=1.8014998,_0x4f3c4f=1.050833,_0x3f8e1f=4.4108898,_0x3fde8b=0.0043752690880113,_0x4605a6=0x2d0,_0x131caf=-0x2d0,_0x576d84=0x3f480,_0x28a60f,_0x1fac4e,_0x4d3965,_0x357e26,_0x36ba78,_0x26bca0,_0x4d6397,_0x4f37c9,_0x431276=0x0,_0x5bc73c=0x0,_0x52eb2b=(_0x527a1a+_0x1a0639*_0x3fde8b)%twoPi$1;_0x3f07ed+=_0x5d5868*_0x34add6,_0xd06178+=_0x577e7c*_0x34add6,_0x39c756+=_0xab277e*_0x34add6,_0x2a3d5f+=_0x234436*_0x34add6,_0x3c3c49+=_0x341fb3*_0x34add6;if(_0x14e53a!==0x0){(_0x12649c===0x0||_0x34add6*_0x12649c<=0x0||Math['abs'](_0x34add6)0x0?_0x28a60f=_0x4605a6:_0x28a60f=_0x131caf;var _0x3324be=0x17d;while(_0x3324be===0x17d){_0x14e53a!==0x2?(_0x4d6397=_0x5deb22*Math[_0x4a5dcd(0x280)](_0x26a33e-_0x193549)+_0x3a9563*Math['sin'](0x2*(_0x26a33e-_0x529528))+_0xf3314*Math['sin'](0x3*(_0x26a33e-_0x57f8c8)),_0x36ba78=_0x2fe41d+_0x1f724a,_0x26bca0=_0x5deb22*Math['cos'](_0x26a33e-_0x193549)+0x2*_0x3a9563*Math[_0x4a5dcd(0x1b8)](0x2*(_0x26a33e-_0x529528))+0x3*_0xf3314*Math['cos'](0x3*(_0x26a33e-_0x57f8c8)),_0x26bca0*=_0x36ba78):(_0x4f37c9=_0x103a7b+_0x2af2c8*_0x12649c,_0x4d3965=_0x4f37c9+_0x4f37c9,_0x1fac4e=_0x26a33e+_0x26a33e,_0x4d6397=_0x5b53b3*Math[_0x4a5dcd(0x280)](_0x4d3965+_0x26a33e-_0x6f2ac)+_0xae1be6*Math['sin'](_0x26a33e-_0x6f2ac)+_0x2d0e1f*Math['sin'](_0x4f37c9+_0x26a33e-_0x1b0502)+_0x1a7551*Math[_0x4a5dcd(0x280)](-_0x4f37c9+_0x26a33e-_0x1b0502)+_0x26aa7e*Math['sin'](_0x4d3965+_0x1fac4e-_0x30403a)+_0x4f2336*Math['sin'](_0x1fac4e-_0x30403a)+_0x5496c7*Math['sin'](_0x4f37c9+_0x26a33e-_0x4f3c4f)+_0xa4d59*Math['sin'](-_0x4f37c9+_0x26a33e-_0x4f3c4f)+_0x54e9e2*Math[_0x4a5dcd(0x280)](_0x4f37c9+_0x1fac4e-_0x3f8e1f)+_0x44e027*Math['sin'](-_0x4f37c9+_0x1fac4e-_0x3f8e1f),_0x36ba78=_0x2fe41d+_0x1f724a,_0x26bca0=_0x5b53b3*Math['cos'](_0x4d3965+_0x26a33e-_0x6f2ac)+_0xae1be6*Math[_0x4a5dcd(0x1b8)](_0x26a33e-_0x6f2ac)+_0x2d0e1f*Math[_0x4a5dcd(0x1b8)](_0x4f37c9+_0x26a33e-_0x1b0502)+_0x1a7551*Math['cos'](-_0x4f37c9+_0x26a33e-_0x1b0502)+_0x5496c7*Math['cos'](_0x4f37c9+_0x26a33e-_0x4f3c4f)+_0xa4d59*Math['cos'](-_0x4f37c9+_0x26a33e-_0x4f3c4f)+0x2*(_0x26aa7e*Math['cos'](_0x4d3965+_0x1fac4e-_0x30403a)+_0x4f2336*Math['cos'](_0x1fac4e-_0x30403a)+_0x54e9e2*Math[_0x4a5dcd(0x1b8)](_0x4f37c9+_0x1fac4e-_0x3f8e1f)+_0x44e027*Math['cos'](-_0x4f37c9+_0x1fac4e-_0x3f8e1f)),_0x26bca0*=_0x36ba78),Math['abs'](_0x34add6-_0x12649c)>=_0x4605a6?_0x3324be=0x17d:(_0x5bc73c=_0x34add6-_0x12649c,_0x3324be=0x0),_0x3324be===0x17d&&(_0x26a33e+=_0x36ba78*_0x28a60f+_0x4d6397*_0x576d84,_0x2fe41d+=_0x4d6397*_0x28a60f+_0x26bca0*_0x576d84,_0x12649c+=_0x28a60f);}_0x513103=_0x2fe41d+_0x4d6397*_0x5bc73c+_0x26bca0*_0x5bc73c*_0x5bc73c*0.5,_0x357e26=_0x26a33e+_0x36ba78*_0x5bc73c+_0x4d6397*_0x5bc73c*_0x5bc73c*0.5,_0x14e53a!==0x1?(_0x3c3c49=_0x357e26-0x2*_0x2a3d5f+0x2*_0x52eb2b,_0x431276=_0x513103-_0x130224):(_0x3c3c49=_0x357e26-_0x2a3d5f-_0x39c756+_0x52eb2b,_0x431276=_0x513103-_0x130224),_0x513103=_0x130224+_0x431276;}return{'atime':_0x12649c,'em':_0x3f07ed,'argpm':_0x39c756,'inclm':_0xd06178,'xli':_0x26a33e,'mm':_0x3c3c49,'xni':_0x2fe41d,'nodem':_0x2a3d5f,'dndt':_0x431276,'nm':_0x513103};}function sgp4$1(_0x3fbd32,_0x331693){var _0x218774=_0x8ca3,_0x5f1b55,_0x5045d3,_0x5f407a,_0x2248e7,_0x564ca2,_0x35ef99,_0x28a30d,_0xab2aef,_0x22d46d,_0x869324,_0x30607a,_0x5c0875,_0x56ecf7,_0x474aa7,_0x18a255,_0x21d8ea,_0x20ba43,_0x49b561,_0x4aa8ba,_0x222f65,_0x569d07,_0x590d00,_0x5676d7,_0x2c1fdb,_0x3b4a61,_0x1fac4b,_0x3f0ebb,_0x23d471=1.5e-12;_0x3fbd32['t']=_0x331693,_0x3fbd32['error']=0x0;var _0x385d00=_0x3fbd32['mo']+_0x3fbd32['mdot']*_0x3fbd32['t'],_0x47ec1c=_0x3fbd32['argpo']+_0x3fbd32[_0x218774(0x159)]*_0x3fbd32['t'],_0x5f20d8=_0x3fbd32[_0x218774(0x30b)]+_0x3fbd32[_0x218774(0x21a)]*_0x3fbd32['t'];_0x22d46d=_0x47ec1c,_0x569d07=_0x385d00;var _0x47b26a=_0x3fbd32['t']*_0x3fbd32['t'];_0x5676d7=_0x5f20d8+_0x3fbd32['nodecf']*_0x47b26a,_0x20ba43=0x1-_0x3fbd32['cc1']*_0x3fbd32['t'],_0x49b561=_0x3fbd32['bstar']*_0x3fbd32[_0x218774(0x250)]*_0x3fbd32['t'],_0x4aa8ba=_0x3fbd32[_0x218774(0x22b)]*_0x47b26a;if(_0x3fbd32['isimp']!==0x1){_0x28a30d=_0x3fbd32['omgcof']*_0x3fbd32['t'];var _0x27937f=0x1+_0x3fbd32['eta']*Math['cos'](_0x385d00);_0x35ef99=_0x3fbd32['xmcof']*(_0x27937f*_0x27937f*_0x27937f-_0x3fbd32['delmo']),_0x21d8ea=_0x28a30d+_0x35ef99,_0x569d07=_0x385d00+_0x21d8ea,_0x22d46d=_0x47ec1c-_0x21d8ea,_0x5c0875=_0x47b26a*_0x3fbd32['t'],_0x56ecf7=_0x5c0875*_0x3fbd32['t'],_0x20ba43=_0x20ba43-_0x3fbd32['d2']*_0x47b26a-_0x3fbd32['d3']*_0x5c0875-_0x3fbd32['d4']*_0x56ecf7,_0x49b561+=_0x3fbd32['bstar']*_0x3fbd32['cc5']*(Math['sin'](_0x569d07)-_0x3fbd32[_0x218774(0x30a)]),_0x4aa8ba=_0x4aa8ba+_0x3fbd32['t3cof']*_0x5c0875+_0x56ecf7*(_0x3fbd32['t4cof']+_0x3fbd32['t']*_0x3fbd32[_0x218774(0x2cf)]);}_0x590d00=_0x3fbd32['no'];var _0x27affe=_0x3fbd32['ecco'];_0x222f65=_0x3fbd32['inclo'];if(_0x3fbd32['method']==='d'){_0x474aa7=_0x3fbd32['t'];var _0x2ecdfd={'irez':_0x3fbd32['irez'],'d2201':_0x3fbd32[_0x218774(0x315)],'d2211':_0x3fbd32['d2211'],'d3210':_0x3fbd32['d3210'],'d3222':_0x3fbd32[_0x218774(0x104)],'d4410':_0x3fbd32['d4410'],'d4422':_0x3fbd32['d4422'],'d5220':_0x3fbd32['d5220'],'d5232':_0x3fbd32[_0x218774(0x12b)],'d5421':_0x3fbd32['d5421'],'d5433':_0x3fbd32['d5433'],'dedt':_0x3fbd32['dedt'],'del1':_0x3fbd32[_0x218774(0x210)],'del2':_0x3fbd32[_0x218774(0x2b2)],'del3':_0x3fbd32['del3'],'didt':_0x3fbd32['didt'],'dmdt':_0x3fbd32['dmdt'],'dnodt':_0x3fbd32['dnodt'],'domdt':_0x3fbd32['domdt'],'argpo':_0x3fbd32['argpo'],'argpdot':_0x3fbd32['argpdot'],'t':_0x3fbd32['t'],'tc':_0x474aa7,'gsto':_0x3fbd32[_0x218774(0x2c2)],'xfact':_0x3fbd32[_0x218774(0x181)],'xlamo':_0x3fbd32['xlamo'],'no':_0x3fbd32['no'],'atime':_0x3fbd32[_0x218774(0x2cd)],'em':_0x27affe,'argpm':_0x22d46d,'inclm':_0x222f65,'xli':_0x3fbd32['xli'],'mm':_0x569d07,'xni':_0x3fbd32['xni'],'nodem':_0x5676d7,'nm':_0x590d00},_0x491ba4=dspace$1(_0x2ecdfd);_0x27affe=_0x491ba4['em'],_0x22d46d=_0x491ba4['argpm'],_0x222f65=_0x491ba4[_0x218774(0x22d)],_0x569d07=_0x491ba4['mm'],_0x5676d7=_0x491ba4['nodem'],_0x590d00=_0x491ba4['nm'];}if(_0x590d00<=0x0)return _0x3fbd32[_0x218774(0x2c3)]=0x2,[![],![]];var _0x1abd36=Math['pow'](xke$1/_0x590d00,x2o3$1)*_0x20ba43*_0x20ba43;_0x590d00=xke$1/Math['pow'](_0x1abd36,1.5),_0x27affe-=_0x49b561;if(_0x27affe>=0x1||_0x27affe<-0.001)return _0x3fbd32['error']=0x1,[![],![]];_0x27affe<0.000001&&(_0x27affe=0.000001);_0x569d07+=_0x3fbd32['no']*_0x4aa8ba,_0x3b4a61=_0x569d07+_0x22d46d+_0x5676d7,_0x5676d7%=twoPi$1,_0x22d46d%=twoPi$1,_0x3b4a61%=twoPi$1,_0x569d07=(_0x3b4a61-_0x22d46d-_0x5676d7)%twoPi$1;var _0x4d6e0b=Math[_0x218774(0x280)](_0x222f65),_0x3b4457=Math[_0x218774(0x1b8)](_0x222f65),_0x870c74=_0x27affe;_0x2c1fdb=_0x222f65,_0x869324=_0x22d46d,_0x3f0ebb=_0x5676d7,_0x1fac4b=_0x569d07,_0x2248e7=_0x4d6e0b,_0x5f407a=_0x3b4457;if(_0x3fbd32['method']==='d'){var _0x446e67={'inclo':_0x3fbd32['inclo'],'init':'n','ep':_0x870c74,'inclp':_0x2c1fdb,'nodep':_0x3f0ebb,'argpp':_0x869324,'mp':_0x1fac4b,'opsmode':_0x3fbd32['operationmode']},_0x1fa369=dpper$1(_0x3fbd32,_0x446e67);_0x870c74=_0x1fa369['ep'],_0x3f0ebb=_0x1fa369[_0x218774(0x23b)],_0x869324=_0x1fa369[_0x218774(0x25d)],_0x1fac4b=_0x1fa369['mp'],_0x2c1fdb=_0x1fa369['inclp'];_0x2c1fdb<0x0&&(_0x2c1fdb=-_0x2c1fdb,_0x3f0ebb+=pi$1,_0x869324-=pi$1);if(_0x870c74<0x0||_0x870c74>0x1)return _0x3fbd32['error']=0x3,[![],![]];}_0x3fbd32['method']==='d'&&(_0x2248e7=Math['sin'](_0x2c1fdb),_0x5f407a=Math['cos'](_0x2c1fdb),_0x3fbd32['aycof']=-0.5*j3oj2$1*_0x2248e7,Math['abs'](_0x5f407a+0x1)>1.5e-12?_0x3fbd32['xlcof']=-0.25*j3oj2$1*_0x2248e7*(0x3+0x5*_0x5f407a)/(0x1+_0x5f407a):_0x3fbd32[_0x218774(0x1a0)]=-0.25*j3oj2$1*_0x2248e7*(0x3+0x5*_0x5f407a)/_0x23d471);var _0x3a2a89=_0x870c74*Math[_0x218774(0x1b8)](_0x869324);_0x21d8ea=0x1/(_0x1abd36*(0x1-_0x870c74*_0x870c74));var _0x2633a3=_0x870c74*Math['sin'](_0x869324)+_0x21d8ea*_0x3fbd32[_0x218774(0x13b)],_0x3ab9b7=_0x1fac4b+_0x869324+_0x3f0ebb+_0x21d8ea*_0x3fbd32['xlcof']*_0x3a2a89,_0x2dca05=(_0x3ab9b7-_0x3f0ebb)%twoPi$1;_0xab2aef=_0x2dca05,_0x18a255=9999.9;var _0x295a46=0x1;while(Math['abs'](_0x18a255)>=1e-12&&_0x295a46<=0xa){_0x5045d3=Math['sin'](_0xab2aef),_0x5f1b55=Math['cos'](_0xab2aef),_0x18a255=0x1-_0x5f1b55*_0x3a2a89-_0x5045d3*_0x2633a3,_0x18a255=(_0x2dca05-_0x2633a3*_0x5f1b55+_0x3a2a89*_0x5045d3-_0xab2aef)/_0x18a255,Math['abs'](_0x18a255)>=0.95&&(_0x18a255>0x0?_0x18a255=0.95:_0x18a255=-0.95),_0xab2aef+=_0x18a255,_0x295a46+=0x1;}var _0x4be0a1=_0x3a2a89*_0x5f1b55+_0x2633a3*_0x5045d3,_0x44e3cb=_0x3a2a89*_0x5045d3-_0x2633a3*_0x5f1b55,_0x383c67=_0x3a2a89*_0x3a2a89+_0x2633a3*_0x2633a3,_0x5d443e=_0x1abd36*(0x1-_0x383c67);if(_0x5d443e<0x0)return _0x3fbd32[_0x218774(0x2c3)]=0x4,[![],![]];var _0x4cfa21=_0x1abd36*(0x1-_0x4be0a1),_0x4bf3ab=Math[_0x218774(0x25a)](_0x1abd36)*_0x44e3cb/_0x4cfa21,_0xb1b443=Math['sqrt'](_0x5d443e)/_0x4cfa21,_0x557d27=Math[_0x218774(0x25a)](0x1-_0x383c67);_0x21d8ea=_0x44e3cb/(0x1+_0x557d27);var _0x4e139b=_0x1abd36/_0x4cfa21*(_0x5045d3-_0x2633a3-_0x3a2a89*_0x21d8ea),_0xf01d1=_0x1abd36/_0x4cfa21*(_0x5f1b55-_0x3a2a89+_0x2633a3*_0x21d8ea);_0x30607a=Math[_0x218774(0x298)](_0x4e139b,_0xf01d1);var _0x2c3793=(_0xf01d1+_0xf01d1)*_0x4e139b,_0xdb5e46=0x1-0x2*_0x4e139b*_0x4e139b;_0x21d8ea=0x1/_0x5d443e;var _0x19ba21=0.5*j2$1*_0x21d8ea,_0xf46f94=_0x19ba21*_0x21d8ea;_0x3fbd32[_0x218774(0x1eb)]==='d'&&(_0x564ca2=_0x5f407a*_0x5f407a,_0x3fbd32[_0x218774(0x152)]=0x3*_0x564ca2-0x1,_0x3fbd32['x1mth2']=0x1-_0x564ca2,_0x3fbd32[_0x218774(0x12e)]=0x7*_0x564ca2-0x1);var _0x3a2325=_0x4cfa21*(0x1-1.5*_0xf46f94*_0x557d27*_0x3fbd32['con41'])+0.5*_0x19ba21*_0x3fbd32['x1mth2']*_0xdb5e46;if(_0x3a2325<0x1)return _0x3fbd32['error']=0x6,{'position':![],'velocity':![]};_0x30607a-=0.25*_0xf46f94*_0x3fbd32['x7thm1']*_0x2c3793;var _0x36dc8c=_0x3f0ebb+1.5*_0xf46f94*_0x5f407a*_0x2c3793,_0x2fabf4=_0x2c1fdb+1.5*_0xf46f94*_0x5f407a*_0x2248e7*_0xdb5e46,_0x83cd8a=_0x4bf3ab-_0x590d00*_0x19ba21*_0x3fbd32[_0x218774(0x221)]*_0x2c3793/xke$1,_0x3090fe=_0xb1b443+_0x590d00*_0x19ba21*(_0x3fbd32[_0x218774(0x221)]*_0xdb5e46+1.5*_0x3fbd32[_0x218774(0x152)])/xke$1,_0x326687=Math['sin'](_0x30607a),_0x415426=Math['cos'](_0x30607a),_0x574a66=Math[_0x218774(0x280)](_0x36dc8c),_0x1d2ece=Math['cos'](_0x36dc8c),_0xde8154=Math['sin'](_0x2fabf4),_0x5c3dd5=Math['cos'](_0x2fabf4),_0x18de23=-_0x574a66*_0x5c3dd5,_0x1c85d4=_0x1d2ece*_0x5c3dd5,_0x3411d2=_0x18de23*_0x326687+_0x1d2ece*_0x415426,_0x4746b7=_0x1c85d4*_0x326687+_0x574a66*_0x415426,_0x30af2a=_0xde8154*_0x326687,_0x19436c=_0x18de23*_0x415426-_0x1d2ece*_0x326687,_0x394b7b=_0x1c85d4*_0x415426-_0x574a66*_0x326687,_0x193192=_0xde8154*_0x415426,_0x2f3b39={'x':_0x3a2325*_0x3411d2*earthRadius$1,'y':_0x3a2325*_0x4746b7*earthRadius$1,'z':_0x3a2325*_0x30af2a*earthRadius$1},_0x29bf32={'x':(_0x83cd8a*_0x3411d2+_0x3090fe*_0x19436c)*vkmpersec$1,'y':(_0x83cd8a*_0x4746b7+_0x3090fe*_0x394b7b)*vkmpersec$1,'z':(_0x83cd8a*_0x30af2a+_0x3090fe*_0x193192)*vkmpersec$1};return{'position':_0x2f3b39,'velocity':_0x29bf32};}function sgp4init$1(_0x1ac10c,_0x3eeefe){var _0x3baee0=_0x8ca3,_0x34774e=_0x3eeefe['opsmode'],_0x247662=_0x3eeefe['satn'],_0x5e1e2f=_0x3eeefe['epoch'],_0x4f8663=_0x3eeefe['xbstar'],_0x37dbab=_0x3eeefe['xecco'],_0x1e7265=_0x3eeefe['xargpo'],_0x52507d=_0x3eeefe['xinclo'],_0x5347ac=_0x3eeefe['xmo'],_0x15ad6e=_0x3eeefe['xno'],_0x2c2115=_0x3eeefe['xnodeo'],_0x303d81,_0x391bec,_0x37b736,_0x4bb626,_0x43eca9,_0x3211b4,_0x4eae60,_0x2b5752,_0x141e38,_0x5a15ee,_0x441b78,_0x46c6be,_0x526525,_0x14f572,_0x285d2a,_0x349459,_0x2594ed,_0x56facf,_0x310a7f,_0x39a053,_0x213a68,_0x2f5841,_0x114c1f,_0x4d1a89,_0x431b16,_0x37b170,_0x132bed,_0x540c60,_0x2779cd,_0x58a111,_0x190578,_0x4584f4,_0x3732e4,_0x4d6a82,_0x2f872b,_0x22c637,_0x36e1fa,_0x36d65b,_0x482091,_0xf9e5d6,_0x531d3c,_0x4f5646,_0x21f163,_0x346ec0,_0x257b14,_0x48a478,_0x5961ea,_0x50ce21,_0x26e59,_0x2e0c36,_0x3eaefb,_0x5955b6,_0x285f28,_0x3caadc,_0x16e21f,_0x482124,_0x1d6b09=1.5e-12;_0x1ac10c['isimp']=0x0,_0x1ac10c['method']='n',_0x1ac10c[_0x3baee0(0x13b)]=0x0,_0x1ac10c[_0x3baee0(0x152)]=0x0,_0x1ac10c[_0x3baee0(0x180)]=0x0,_0x1ac10c['cc4']=0x0,_0x1ac10c[_0x3baee0(0x2ce)]=0x0,_0x1ac10c['d2']=0x0,_0x1ac10c['d3']=0x0,_0x1ac10c['d4']=0x0,_0x1ac10c['delmo']=0x0,_0x1ac10c['eta']=0x0,_0x1ac10c['argpdot']=0x0,_0x1ac10c['omgcof']=0x0,_0x1ac10c['sinmao']=0x0,_0x1ac10c['t']=0x0,_0x1ac10c['t2cof']=0x0,_0x1ac10c['t3cof']=0x0,_0x1ac10c['t4cof']=0x0,_0x1ac10c['t5cof']=0x0,_0x1ac10c[_0x3baee0(0x221)]=0x0,_0x1ac10c[_0x3baee0(0x12e)]=0x0,_0x1ac10c[_0x3baee0(0x2ac)]=0x0,_0x1ac10c[_0x3baee0(0x21a)]=0x0,_0x1ac10c['xlcof']=0x0,_0x1ac10c[_0x3baee0(0x1f8)]=0x0,_0x1ac10c['nodecf']=0x0,_0x1ac10c['irez']=0x0,_0x1ac10c[_0x3baee0(0x315)]=0x0,_0x1ac10c[_0x3baee0(0x2c7)]=0x0,_0x1ac10c['d3210']=0x0,_0x1ac10c['d3222']=0x0,_0x1ac10c['d4410']=0x0,_0x1ac10c['d4422']=0x0,_0x1ac10c[_0x3baee0(0x309)]=0x0,_0x1ac10c['d5232']=0x0,_0x1ac10c['d5421']=0x0,_0x1ac10c['d5433']=0x0,_0x1ac10c['dedt']=0x0,_0x1ac10c[_0x3baee0(0x210)]=0x0,_0x1ac10c[_0x3baee0(0x2b2)]=0x0,_0x1ac10c[_0x3baee0(0x17d)]=0x0,_0x1ac10c['didt']=0x0,_0x1ac10c['dmdt']=0x0,_0x1ac10c[_0x3baee0(0x1c5)]=0x0,_0x1ac10c[_0x3baee0(0x102)]=0x0,_0x1ac10c['e3']=0x0,_0x1ac10c['ee2']=0x0,_0x1ac10c['peo']=0x0,_0x1ac10c['pgho']=0x0,_0x1ac10c['pho']=0x0,_0x1ac10c['pinco']=0x0,_0x1ac10c[_0x3baee0(0x203)]=0x0,_0x1ac10c[_0x3baee0(0x147)]=0x0,_0x1ac10c['se3']=0x0,_0x1ac10c['sgh2']=0x0,_0x1ac10c['sgh3']=0x0,_0x1ac10c['sgh4']=0x0,_0x1ac10c[_0x3baee0(0x234)]=0x0,_0x1ac10c['sh3']=0x0,_0x1ac10c[_0x3baee0(0x170)]=0x0,_0x1ac10c['si3']=0x0,_0x1ac10c['sl2']=0x0,_0x1ac10c['sl3']=0x0,_0x1ac10c['sl4']=0x0,_0x1ac10c[_0x3baee0(0x2c2)]=0x0,_0x1ac10c['xfact']=0x0,_0x1ac10c['xgh2']=0x0,_0x1ac10c['xgh3']=0x0,_0x1ac10c['xgh4']=0x0,_0x1ac10c['xh2']=0x0,_0x1ac10c[_0x3baee0(0x225)]=0x0,_0x1ac10c['xi2']=0x0,_0x1ac10c['xi3']=0x0,_0x1ac10c['xl2']=0x0,_0x1ac10c['xl3']=0x0,_0x1ac10c['xl4']=0x0,_0x1ac10c['xlamo']=0x0,_0x1ac10c['zmol']=0x0,_0x1ac10c['zmos']=0x0,_0x1ac10c['atime']=0x0,_0x1ac10c['xli']=0x0,_0x1ac10c['xni']=0x0,_0x1ac10c['bstar']=_0x4f8663,_0x1ac10c[_0x3baee0(0x13a)]=_0x37dbab,_0x1ac10c['argpo']=_0x1e7265,_0x1ac10c['inclo']=_0x52507d,_0x1ac10c['mo']=_0x5347ac,_0x1ac10c['no']=_0x15ad6e,_0x1ac10c[_0x3baee0(0x30b)]=_0x2c2115,_0x1ac10c['operationmode']=_0x34774e;var _0x53ea58=0x4e/earthRadius$1+0x1,_0x5594ee=(0x78-0x4e)/earthRadius$1,_0x49396a=_0x5594ee*_0x5594ee*_0x5594ee*_0x5594ee;_0x1ac10c['init']='y',_0x1ac10c['t']=0x0;var _0x41d28f={'satn':_0x247662,'ecco':_0x1ac10c['ecco'],'epoch':_0x5e1e2f,'inclo':_0x1ac10c['inclo'],'no':_0x1ac10c['no'],'method':_0x1ac10c['method'],'opsmode':_0x1ac10c['operationmode']},_0x4a9228=initl$1(_0x41d28f),_0x1d90db=_0x4a9228['ao'],_0x2f2a13=_0x4a9228[_0x3baee0(0x2f5)],_0x1fcdf5=_0x4a9228['cosio'],_0x103f02=_0x4a9228['cosio2'],_0xf30a1f=_0x4a9228['eccsq'],_0x312281=_0x4a9228['omeosq'],_0x577521=_0x4a9228['posq'],_0x146d56=_0x4a9228['rp'],_0x23cde9=_0x4a9228['rteosq'],_0x515312=_0x4a9228[_0x3baee0(0x2cb)];_0x1ac10c['no']=_0x4a9228['no'],_0x1ac10c[_0x3baee0(0x152)]=_0x4a9228['con41'],_0x1ac10c[_0x3baee0(0x2c2)]=_0x4a9228['gsto'],_0x1ac10c['a']=Math['pow'](_0x1ac10c['no']*tumin$1,-0x2/0x3),_0x1ac10c['alta']=_0x1ac10c['a']*(0x1+_0x1ac10c[_0x3baee0(0x13a)])-0x1,_0x1ac10c[_0x3baee0(0x10e)]=_0x1ac10c['a']*(0x1-_0x1ac10c['ecco'])-0x1,_0x1ac10c[_0x3baee0(0x2c3)]=0x0;if(_0x312281>=0x0||_0x1ac10c['no']>=0x0){_0x1ac10c['isimp']=0x0;_0x146d56<0xdc/earthRadius$1+0x1&&(_0x1ac10c['isimp']=0x1);_0x132bed=_0x53ea58,_0x213a68=_0x49396a,_0x56facf=(_0x146d56-0x1)*earthRadius$1;if(_0x56facf<0x9c){_0x132bed=_0x56facf-0x4e;_0x56facf<0x62&&(_0x132bed=0x14);var _0x3a9f14=(0x78-_0x132bed)/earthRadius$1;_0x213a68=_0x3a9f14*_0x3a9f14*_0x3a9f14*_0x3a9f14,_0x132bed=_0x132bed/earthRadius$1+0x1;}_0x310a7f=0x1/_0x577521,_0x48a478=0x1/(_0x1d90db-_0x132bed),_0x1ac10c[_0x3baee0(0x284)]=_0x1d90db*_0x1ac10c['ecco']*_0x48a478,_0x46c6be=_0x1ac10c['eta']*_0x1ac10c[_0x3baee0(0x284)],_0x441b78=_0x1ac10c[_0x3baee0(0x13a)]*_0x1ac10c[_0x3baee0(0x284)],_0x39a053=Math['abs'](0x1-_0x46c6be),_0x3211b4=_0x213a68*Math['pow'](_0x48a478,0x4),_0x4eae60=_0x3211b4/Math[_0x3baee0(0x2ef)](_0x39a053,3.5),_0x4bb626=_0x4eae60*_0x1ac10c['no']*(_0x1d90db*(0x1+1.5*_0x46c6be+_0x441b78*(0x4+_0x46c6be))+0.375*j2$1*_0x48a478/_0x39a053*_0x1ac10c['con41']*(0x8+0x3*_0x46c6be*(0x8+_0x46c6be))),_0x1ac10c[_0x3baee0(0x180)]=_0x1ac10c['bstar']*_0x4bb626,_0x43eca9=0x0;_0x1ac10c['ecco']>0.0001&&(_0x43eca9=-0x2*_0x3211b4*_0x48a478*j3oj2$1*_0x1ac10c['no']*_0x515312/_0x1ac10c['ecco']);_0x1ac10c['x1mth2']=0x1-_0x103f02,_0x1ac10c[_0x3baee0(0x250)]=0x2*_0x1ac10c['no']*_0x4eae60*_0x1d90db*_0x312281*(_0x1ac10c[_0x3baee0(0x284)]*(0x2+0.5*_0x46c6be)+_0x1ac10c['ecco']*(0.5+0x2*_0x46c6be)-j2$1*_0x48a478/(_0x1d90db*_0x39a053)*(-0x3*_0x1ac10c['con41']*(0x1-0x2*_0x441b78+_0x46c6be*(1.5-0.5*_0x441b78))+0.75*_0x1ac10c['x1mth2']*(0x2*_0x46c6be-_0x441b78*(0x1+_0x46c6be))*Math[_0x3baee0(0x1b8)](0x2*_0x1ac10c['argpo']))),_0x1ac10c['cc5']=0x2*_0x4eae60*_0x1d90db*_0x312281*(0x1+2.75*(_0x46c6be+_0x441b78)+_0x441b78*_0x46c6be),_0x2b5752=_0x103f02*_0x103f02,_0x21f163=1.5*j2$1*_0x310a7f*_0x1ac10c['no'],_0x346ec0=0.5*_0x21f163*j2$1*_0x310a7f,_0x257b14=-0.46875*j4$1*_0x310a7f*_0x310a7f*_0x1ac10c['no'],_0x1ac10c[_0x3baee0(0x2ac)]=_0x1ac10c['no']+0.5*_0x21f163*_0x23cde9*_0x1ac10c[_0x3baee0(0x152)]+0.0625*_0x346ec0*_0x23cde9*(0xd-0x4e*_0x103f02+0x89*_0x2b5752),_0x1ac10c[_0x3baee0(0x159)]=-0.5*_0x21f163*_0x2f2a13+0.0625*_0x346ec0*(0x7-0x72*_0x103f02+0x18b*_0x2b5752)+_0x257b14*(0x3-0x24*_0x103f02+0x31*_0x2b5752),_0x50ce21=-_0x21f163*_0x1fcdf5,_0x1ac10c[_0x3baee0(0x21a)]=_0x50ce21+(0.5*_0x346ec0*(0x4-0x13*_0x103f02)+0x2*_0x257b14*(0x3-0x7*_0x103f02))*_0x1fcdf5,_0x5961ea=_0x1ac10c['argpdot']+_0x1ac10c['nodedot'],_0x1ac10c[_0x3baee0(0xf0)]=_0x1ac10c[_0x3baee0(0xfc)]*_0x43eca9*Math[_0x3baee0(0x1b8)](_0x1ac10c[_0x3baee0(0x2e7)]),_0x1ac10c['xmcof']=0x0;_0x1ac10c['ecco']>0.0001&&(_0x1ac10c[_0x3baee0(0x1f8)]=-x2o3$1*_0x3211b4*_0x1ac10c['bstar']/_0x441b78);_0x1ac10c[_0x3baee0(0x131)]=3.5*_0x312281*_0x50ce21*_0x1ac10c['cc1'],_0x1ac10c['t2cof']=1.5*_0x1ac10c['cc1'];Math['abs'](_0x1fcdf5+0x1)>1.5e-12?_0x1ac10c[_0x3baee0(0x1a0)]=-0.25*j3oj2$1*_0x515312*(0x3+0x5*_0x1fcdf5)/(0x1+_0x1fcdf5):_0x1ac10c['xlcof']=-0.25*j3oj2$1*_0x515312*(0x3+0x5*_0x1fcdf5)/_0x1d6b09;_0x1ac10c['aycof']=-0.5*j3oj2$1*_0x515312;var _0x28ef05=0x1+_0x1ac10c[_0x3baee0(0x284)]*Math['cos'](_0x1ac10c['mo']);_0x1ac10c['delmo']=_0x28ef05*_0x28ef05*_0x28ef05,_0x1ac10c['sinmao']=Math['sin'](_0x1ac10c['mo']),_0x1ac10c[_0x3baee0(0x12e)]=0x7*_0x103f02-0x1;if(0x2*pi$1/_0x1ac10c['no']>=0xe1){_0x1ac10c['method']='d',_0x1ac10c['isimp']=0x1,_0x531d3c=0x0,_0x285d2a=_0x1ac10c['inclo'];var _0x567326={'epoch':_0x5e1e2f,'ep':_0x1ac10c['ecco'],'argpp':_0x1ac10c[_0x3baee0(0x2e7)],'tc':_0x531d3c,'inclp':_0x1ac10c['inclo'],'nodep':_0x1ac10c['nodeo'],'np':_0x1ac10c['no'],'e3':_0x1ac10c['e3'],'ee2':_0x1ac10c['ee2'],'peo':_0x1ac10c['peo'],'pgho':_0x1ac10c['pgho'],'pho':_0x1ac10c[_0x3baee0(0x261)],'pinco':_0x1ac10c[_0x3baee0(0x107)],'plo':_0x1ac10c['plo'],'se2':_0x1ac10c[_0x3baee0(0x147)],'se3':_0x1ac10c[_0x3baee0(0x1be)],'sgh2':_0x1ac10c['sgh2'],'sgh3':_0x1ac10c['sgh3'],'sgh4':_0x1ac10c[_0x3baee0(0x189)],'sh2':_0x1ac10c[_0x3baee0(0x234)],'sh3':_0x1ac10c['sh3'],'si2':_0x1ac10c['si2'],'si3':_0x1ac10c[_0x3baee0(0x1a7)],'sl2':_0x1ac10c['sl2'],'sl3':_0x1ac10c['sl3'],'sl4':_0x1ac10c['sl4'],'xgh2':_0x1ac10c['xgh2'],'xgh3':_0x1ac10c['xgh3'],'xgh4':_0x1ac10c[_0x3baee0(0x312)],'xh2':_0x1ac10c['xh2'],'xh3':_0x1ac10c[_0x3baee0(0x225)],'xi2':_0x1ac10c[_0x3baee0(0x19a)],'xi3':_0x1ac10c['xi3'],'xl2':_0x1ac10c['xl2'],'xl3':_0x1ac10c['xl3'],'xl4':_0x1ac10c['xl4'],'zmol':_0x1ac10c[_0x3baee0(0x252)],'zmos':_0x1ac10c[_0x3baee0(0x314)]},_0x7654d6=dscom$1(_0x567326);_0x1ac10c['e3']=_0x7654d6['e3'],_0x1ac10c['ee2']=_0x7654d6['ee2'],_0x1ac10c['peo']=_0x7654d6['peo'],_0x1ac10c[_0x3baee0(0x295)]=_0x7654d6['pgho'],_0x1ac10c[_0x3baee0(0x261)]=_0x7654d6['pho'],_0x1ac10c['pinco']=_0x7654d6[_0x3baee0(0x107)],_0x1ac10c[_0x3baee0(0x203)]=_0x7654d6[_0x3baee0(0x203)],_0x1ac10c[_0x3baee0(0x147)]=_0x7654d6[_0x3baee0(0x147)],_0x1ac10c[_0x3baee0(0x1be)]=_0x7654d6[_0x3baee0(0x1be)],_0x1ac10c['sgh2']=_0x7654d6['sgh2'],_0x1ac10c[_0x3baee0(0x273)]=_0x7654d6['sgh3'],_0x1ac10c['sgh4']=_0x7654d6['sgh4'],_0x1ac10c['sh2']=_0x7654d6['sh2'],_0x1ac10c['sh3']=_0x7654d6[_0x3baee0(0xf5)],_0x1ac10c['si2']=_0x7654d6[_0x3baee0(0x170)],_0x1ac10c['si3']=_0x7654d6['si3'],_0x1ac10c['sl2']=_0x7654d6['sl2'],_0x1ac10c['sl3']=_0x7654d6['sl3'],_0x1ac10c[_0x3baee0(0x29c)]=_0x7654d6['sl4'],_0x391bec=_0x7654d6['sinim'],_0x303d81=_0x7654d6['cosim'],_0x141e38=_0x7654d6['em'],_0x5a15ee=_0x7654d6['emsq'],_0x2f5841=_0x7654d6['s1'],_0x114c1f=_0x7654d6['s2'],_0x4d1a89=_0x7654d6['s3'],_0x431b16=_0x7654d6['s4'],_0x37b170=_0x7654d6['s5'],_0x540c60=_0x7654d6['ss1'],_0x2779cd=_0x7654d6[_0x3baee0(0x236)],_0x58a111=_0x7654d6[_0x3baee0(0x174)],_0x190578=_0x7654d6['ss4'],_0x4584f4=_0x7654d6['ss5'],_0x3732e4=_0x7654d6['sz1'],_0x4d6a82=_0x7654d6['sz3'],_0x2f872b=_0x7654d6['sz11'],_0x22c637=_0x7654d6['sz13'],_0x36e1fa=_0x7654d6['sz21'],_0x36d65b=_0x7654d6[_0x3baee0(0x205)],_0x482091=_0x7654d6[_0x3baee0(0x311)],_0xf9e5d6=_0x7654d6[_0x3baee0(0x2d3)],_0x1ac10c['xgh2']=_0x7654d6['xgh2'],_0x1ac10c[_0x3baee0(0x1f5)]=_0x7654d6['xgh3'],_0x1ac10c[_0x3baee0(0x312)]=_0x7654d6[_0x3baee0(0x312)],_0x1ac10c['xh2']=_0x7654d6['xh2'],_0x1ac10c['xh3']=_0x7654d6[_0x3baee0(0x225)],_0x1ac10c['xi2']=_0x7654d6['xi2'],_0x1ac10c['xi3']=_0x7654d6['xi3'],_0x1ac10c['xl2']=_0x7654d6['xl2'],_0x1ac10c['xl3']=_0x7654d6['xl3'],_0x1ac10c['xl4']=_0x7654d6['xl4'],_0x1ac10c['zmol']=_0x7654d6[_0x3baee0(0x252)],_0x1ac10c[_0x3baee0(0x314)]=_0x7654d6['zmos'],_0x2594ed=_0x7654d6['nm'],_0x26e59=_0x7654d6['z1'],_0x2e0c36=_0x7654d6['z3'],_0x3eaefb=_0x7654d6[_0x3baee0(0x293)],_0x5955b6=_0x7654d6['z13'],_0x285f28=_0x7654d6['z21'],_0x3caadc=_0x7654d6['z23'],_0x16e21f=_0x7654d6[_0x3baee0(0x2d2)],_0x482124=_0x7654d6['z33'];var _0x3cf5e8={'inclo':_0x285d2a,'init':_0x1ac10c[_0x3baee0(0x1e4)],'ep':_0x1ac10c['ecco'],'inclp':_0x1ac10c['inclo'],'nodep':_0x1ac10c['nodeo'],'argpp':_0x1ac10c['argpo'],'mp':_0x1ac10c['mo'],'opsmode':_0x1ac10c['operationmode']},_0x3a7513=dpper$1(_0x1ac10c,_0x3cf5e8);_0x1ac10c['ecco']=_0x3a7513['ep'],_0x1ac10c['inclo']=_0x3a7513['inclp'],_0x1ac10c['nodeo']=_0x3a7513['nodep'],_0x1ac10c['argpo']=_0x3a7513['argpp'],_0x1ac10c['mo']=_0x3a7513['mp'],_0x526525=0x0,_0x14f572=0x0,_0x349459=0x0;var _0x238b62={'cosim':_0x303d81,'emsq':_0x5a15ee,'argpo':_0x1ac10c[_0x3baee0(0x2e7)],'s1':_0x2f5841,'s2':_0x114c1f,'s3':_0x4d1a89,'s4':_0x431b16,'s5':_0x37b170,'sinim':_0x391bec,'ss1':_0x540c60,'ss2':_0x2779cd,'ss3':_0x58a111,'ss4':_0x190578,'ss5':_0x4584f4,'sz1':_0x3732e4,'sz3':_0x4d6a82,'sz11':_0x2f872b,'sz13':_0x22c637,'sz21':_0x36e1fa,'sz23':_0x36d65b,'sz31':_0x482091,'sz33':_0xf9e5d6,'t':_0x1ac10c['t'],'tc':_0x531d3c,'gsto':_0x1ac10c['gsto'],'mo':_0x1ac10c['mo'],'mdot':_0x1ac10c['mdot'],'no':_0x1ac10c['no'],'nodeo':_0x1ac10c['nodeo'],'nodedot':_0x1ac10c[_0x3baee0(0x21a)],'xpidot':_0x5961ea,'z1':_0x26e59,'z3':_0x2e0c36,'z11':_0x3eaefb,'z13':_0x5955b6,'z21':_0x285f28,'z23':_0x3caadc,'z31':_0x16e21f,'z33':_0x482124,'ecco':_0x1ac10c['ecco'],'eccsq':_0xf30a1f,'em':_0x141e38,'argpm':_0x526525,'inclm':_0x285d2a,'mm':_0x349459,'nm':_0x2594ed,'nodem':_0x14f572,'irez':_0x1ac10c['irez'],'atime':_0x1ac10c['atime'],'d2201':_0x1ac10c[_0x3baee0(0x315)],'d2211':_0x1ac10c['d2211'],'d3210':_0x1ac10c['d3210'],'d3222':_0x1ac10c['d3222'],'d4410':_0x1ac10c['d4410'],'d4422':_0x1ac10c[_0x3baee0(0x157)],'d5220':_0x1ac10c['d5220'],'d5232':_0x1ac10c['d5232'],'d5421':_0x1ac10c['d5421'],'d5433':_0x1ac10c[_0x3baee0(0x1cb)],'dedt':_0x1ac10c[_0x3baee0(0x204)],'didt':_0x1ac10c[_0x3baee0(0x150)],'dmdt':_0x1ac10c['dmdt'],'dnodt':_0x1ac10c['dnodt'],'domdt':_0x1ac10c['domdt'],'del1':_0x1ac10c['del1'],'del2':_0x1ac10c['del2'],'del3':_0x1ac10c['del3'],'xfact':_0x1ac10c['xfact'],'xlamo':_0x1ac10c[_0x3baee0(0x22e)],'xli':_0x1ac10c[_0x3baee0(0x24e)],'xni':_0x1ac10c['xni']},_0x10e3df=dsinit$1(_0x238b62);_0x1ac10c['irez']=_0x10e3df['irez'],_0x1ac10c['atime']=_0x10e3df['atime'],_0x1ac10c['d2201']=_0x10e3df[_0x3baee0(0x315)],_0x1ac10c[_0x3baee0(0x2c7)]=_0x10e3df['d2211'],_0x1ac10c['d3210']=_0x10e3df['d3210'],_0x1ac10c['d3222']=_0x10e3df['d3222'],_0x1ac10c['d4410']=_0x10e3df['d4410'],_0x1ac10c[_0x3baee0(0x157)]=_0x10e3df[_0x3baee0(0x157)],_0x1ac10c[_0x3baee0(0x309)]=_0x10e3df['d5220'],_0x1ac10c[_0x3baee0(0x12b)]=_0x10e3df['d5232'],_0x1ac10c[_0x3baee0(0x15c)]=_0x10e3df['d5421'],_0x1ac10c['d5433']=_0x10e3df['d5433'],_0x1ac10c['dedt']=_0x10e3df['dedt'],_0x1ac10c['didt']=_0x10e3df['didt'],_0x1ac10c['dmdt']=_0x10e3df['dmdt'],_0x1ac10c['dnodt']=_0x10e3df[_0x3baee0(0x1c5)],_0x1ac10c['domdt']=_0x10e3df['domdt'],_0x1ac10c['del1']=_0x10e3df[_0x3baee0(0x210)],_0x1ac10c['del2']=_0x10e3df[_0x3baee0(0x2b2)],_0x1ac10c['del3']=_0x10e3df[_0x3baee0(0x17d)],_0x1ac10c[_0x3baee0(0x181)]=_0x10e3df['xfact'],_0x1ac10c[_0x3baee0(0x22e)]=_0x10e3df['xlamo'],_0x1ac10c['xli']=_0x10e3df['xli'],_0x1ac10c[_0x3baee0(0x1c9)]=_0x10e3df[_0x3baee0(0x1c9)];}_0x1ac10c['isimp']!==0x1&&(_0x37b736=_0x1ac10c[_0x3baee0(0x180)]*_0x1ac10c['cc1'],_0x1ac10c['d2']=0x4*_0x1d90db*_0x48a478*_0x37b736,_0x4f5646=_0x1ac10c['d2']*_0x48a478*_0x1ac10c['cc1']/0x3,_0x1ac10c['d3']=(0x11*_0x1d90db+_0x132bed)*_0x4f5646,_0x1ac10c['d4']=0.5*_0x4f5646*_0x1d90db*_0x48a478*(0xdd*_0x1d90db+0x1f*_0x132bed)*_0x1ac10c[_0x3baee0(0x180)],_0x1ac10c['t3cof']=_0x1ac10c['d2']+0x2*_0x37b736,_0x1ac10c['t4cof']=0.25*(0x3*_0x1ac10c['d3']+_0x1ac10c[_0x3baee0(0x180)]*(0xc*_0x1ac10c['d2']+0xa*_0x37b736)),_0x1ac10c['t5cof']=0.2*(0x3*_0x1ac10c['d4']+0xc*_0x1ac10c[_0x3baee0(0x180)]*_0x1ac10c['d3']+0x6*_0x1ac10c['d2']*_0x1ac10c['d2']+0xf*_0x37b736*(0x2*_0x1ac10c['d2']+_0x37b736)));}sgp4$1(_0x1ac10c,0x0),_0x1ac10c['init']='n';}function twoline2satrec$1(_0xecdf82,_0x5084f4){var _0x27a570=_0x8ca3,_0x375274='i',_0x2eb164=0x5a0/(0x2*pi$1),_0x1aa8bc=0x0,_0x365901={};_0x365901['error']=0x0,_0x365901['satnum']=_0xecdf82['substring'](0x2,0x7),_0x365901['epochyr']=parseInt(_0xecdf82['substring'](0x12,0x14),0xa),_0x365901['epochdays']=parseFloat(_0xecdf82['substring'](0x14,0x20)),_0x365901[_0x27a570(0x122)]=parseFloat(_0xecdf82[_0x27a570(0x1ed)](0x21,0x2b)),_0x365901['nddot']=parseFloat('.'['concat'](parseInt(_0xecdf82[_0x27a570(0x1ed)](0x2c,0x32),0xa),'E')['concat'](_0xecdf82['substring'](0x32,0x34))),_0x365901['bstar']=parseFloat(''['concat'](_0xecdf82['substring'](0x35,0x36),'.')['concat'](parseInt(_0xecdf82[_0x27a570(0x1ed)](0x36,0x3b),0xa),'E')['concat'](_0xecdf82['substring'](0x3b,0x3d))),_0x365901['inclo']=parseFloat(_0x5084f4['substring'](0x8,0x10)),_0x365901['nodeo']=parseFloat(_0x5084f4[_0x27a570(0x1ed)](0x11,0x19)),_0x365901['ecco']=parseFloat('.'[_0x27a570(0x27d)](_0x5084f4['substring'](0x1a,0x21))),_0x365901['argpo']=parseFloat(_0x5084f4['substring'](0x22,0x2a)),_0x365901['mo']=parseFloat(_0x5084f4[_0x27a570(0x1ed)](0x2b,0x33)),_0x365901['no']=parseFloat(_0x5084f4[_0x27a570(0x1ed)](0x34,0x3f)),_0x365901['no']/=_0x2eb164,_0x365901[_0x27a570(0x26a)]*=deg2rad$1,_0x365901[_0x27a570(0x30b)]*=deg2rad$1,_0x365901[_0x27a570(0x2e7)]*=deg2rad$1,_0x365901['mo']*=deg2rad$1;_0x365901['epochyr']<0x39?_0x1aa8bc=_0x365901['epochyr']+0x7d0:_0x1aa8bc=_0x365901['epochyr']+0x76c;var _0x4ca441=days2mdhms$1(_0x1aa8bc,_0x365901[_0x27a570(0x2dc)]),_0x4d2f1d=_0x4ca441[_0x27a570(0x297)],_0x33507a=_0x4ca441[_0x27a570(0x241)],_0xe7cdd=_0x4ca441['hr'],_0x5e7747=_0x4ca441['minute'],_0x132189=_0x4ca441['sec'];return _0x365901['jdsatepoch']=jday$1(_0x1aa8bc,_0x4d2f1d,_0x33507a,_0xe7cdd,_0x5e7747,_0x132189),sgp4init$1(_0x365901,{'opsmode':_0x375274,'satn':_0x365901['satnum'],'epoch':_0x365901[_0x27a570(0x2d7)]-2433281.5,'xbstar':_0x365901['bstar'],'xecco':_0x365901['ecco'],'xargpo':_0x365901[_0x27a570(0x2e7)],'xinclo':_0x365901['inclo'],'xmo':_0x365901['mo'],'xno':_0x365901['no'],'xnodeo':_0x365901['nodeo']}),_0x365901;}function _toConsumableArray$1(_0x292636){return _arrayWithoutHoles$1(_0x292636)||_iterableToArray$1(_0x292636)||_unsupportedIterableToArray$1(_0x292636)||_nonIterableSpread$1();}function _arrayWithoutHoles$1(_0x5059c7){if(Array['isArray'](_0x5059c7))return _arrayLikeToArray$1(_0x5059c7);}function _iterableToArray$1(_0x4e4e5e){var _0x42d584=_0x8ca3;if(typeof Symbol!=='undefined'&&_0x4e4e5e[Symbol[_0x42d584(0x20e)]]!=null||_0x4e4e5e['@@iterator']!=null)return Array[_0x42d584(0x211)](_0x4e4e5e);}function _unsupportedIterableToArray$1(_0x5f2baa,_0x340ebf){var _0x5787cc=_0x8ca3;if(!_0x5f2baa)return;if(typeof _0x5f2baa==='string')return _arrayLikeToArray$1(_0x5f2baa,_0x340ebf);var _0x30a35b=Object['prototype']['toString'][_0x5787cc(0x2a1)](_0x5f2baa)['slice'](0x8,-0x1);if(_0x30a35b==='Object'&&_0x5f2baa['constructor'])_0x30a35b=_0x5f2baa['constructor']['name'];if(_0x30a35b===_0x5787cc(0x20a)||_0x30a35b===_0x5787cc(0x121))return Array['from'](_0x5f2baa);if(_0x30a35b==='Arguments'||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/['test'](_0x30a35b))return _arrayLikeToArray$1(_0x5f2baa,_0x340ebf);}function _arrayLikeToArray$1(_0x123f8e,_0x320ba2){var _0x2965cf=_0x8ca3;if(_0x320ba2==null||_0x320ba2>_0x123f8e['length'])_0x320ba2=_0x123f8e[_0x2965cf(0x31f)];for(var _0x1bddb5=0x0,_0x1410e0=new Array(_0x320ba2);_0x1bddb5<_0x320ba2;_0x1bddb5++)_0x1410e0[_0x1bddb5]=_0x123f8e[_0x1bddb5];return _0x1410e0;}function _nonIterableSpread$1(){throw new TypeError('Invalid\x20attempt\x20to\x20spread\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.');}function propagate$1(){var _0x5e4d1c=_0x8ca3;for(var _0x1d1f0a=arguments['length'],_0x2441d2=new Array(_0x1d1f0a),_0x5edccb=0x0;_0x5edccb<_0x1d1f0a;_0x5edccb++){_0x2441d2[_0x5edccb]=arguments[_0x5edccb];}var _0x20f7e1=_0x2441d2[0x0],_0x24c27f=Array[_0x5e4d1c(0x14a)]['slice']['call'](_0x2441d2,0x1),_0x3ac924=jday$1['apply'](void 0x0,_toConsumableArray$1(_0x24c27f)),_0x35b873=(_0x3ac924-_0x20f7e1['jdsatepoch'])*minutesPerDay$1;return sgp4$1(_0x20f7e1,_0x35b873);}function dopplerFactor$1(_0xdf5179,_0x14deb4,_0x6db642){var _0x20fcd4=_0x8ca3,_0x184b09=0.00007292115,_0x113e12=299792.458,_0x45447a={'x':_0x14deb4['x']-_0xdf5179['x'],'y':_0x14deb4['y']-_0xdf5179['y'],'z':_0x14deb4['z']-_0xdf5179['z']};_0x45447a['w']=Math[_0x20fcd4(0x25a)](Math[_0x20fcd4(0x2ef)](_0x45447a['x'],0x2)+Math[_0x20fcd4(0x2ef)](_0x45447a['y'],0x2)+Math['pow'](_0x45447a['z'],0x2));var _0xefbd69={'x':_0x6db642['x']+_0x184b09*_0xdf5179['y'],'y':_0x6db642['y']-_0x184b09*_0xdf5179['x'],'z':_0x6db642['z']};function _0x40c5fc(_0x24f920){return _0x24f920>=0x0?0x1:-0x1;}var _0x11827b=(_0x45447a['x']*_0xefbd69['x']+_0x45447a['y']*_0xefbd69['y']+_0x45447a['z']*_0xefbd69['z'])/_0x45447a['w'];return 0x1+_0x11827b/_0x113e12*_0x40c5fc(_0x11827b);}function radiansToDegrees$1(_0x2cfcaf){return _0x2cfcaf*rad2deg$1;}function degreesToRadians$1(_0x57d745){return _0x57d745*deg2rad$1;}function degreesLat$1(_0x2d18d0){if(_0x2d18d0<-pi$1/0x2||_0x2d18d0>pi$1/0x2)throw new RangeError('Latitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi/2;\x20pi/2].');return radiansToDegrees$1(_0x2d18d0);}function _0x52f6(){var _0x126ee3=['getAverageOrbitTimeMins','topS','vertexArray','_clearGeometry','getEpochTimestamp','Matrix4','translucent','_createOuterCurveCommand','_topOutlineShow','add','type','updateVolumeGeometry','IDENTITY','_createLeftCrossSectionCommand','test','point','cos','_topSteps','fixedFrameTransform','rangeSat','sz1','_reverse','se3','_headingRadians','Util','_position','vao','_volumeGeometry','getClassification','dnodt','gstime','GeometryAttribute','endFovV','xni','Quaternion','d5433','topShow','irez','getInclination','getAreaCoords','forEach','clone','cospar','apply','Latitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi/2;\x20pi/2].','DrawCommand','_angle1','ee2','000000','intDesignatorLaunchNumber','_subSegmentH','startFovH','xpidot','extend2Earth','startRadius','_bottomHeight','tle1','_addGroundPolyEntity','_topWidth','Longitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi;\x20pi].','init','zReverse','passes','z33','IndexDatatype','intDesignatorYear','4305CJkJZJ','method','JulianDate','substring','_STRING','updateGeometry','fromDate','_promise','flyToPoint','norad','startFovV','xgh3','_quaternion','_showOneCone','xmcof','_lookAt','_show','_addedHook','topOutlineShow','_time_current','_rollRadians','drawShow','_getEciPositionAndVelocity','_removedHook','create','plo','dedt','sz23','Cesium','_topGeometry','indices','tle2coe','Map','tan','parseTLE','fromCache','iterator','DOUBLE','del1','from','sz3','normalize','shadowShow','Type','xl4','\x20\x20.00000000\x20\x2000000-0\x20\x2000000-0\x200\x200000','PrimitiveType','_map','nodedot','Geometry','t3cof','LINES','uniform','901027QsvkZU','lbcenter','x1mth2','boundingVolume','Math','EventType','xh3','toFixed','reverse','command','update','getLineNumber2','t2cof','Cartographic','inclm','xlamo','_outlineColor','radius','map','computeMatrix','VertexArray','sh2','graphic','ss2','timeRange','coe2tle','coneEntity','slice','nodep','repeat','_child','__esModule','topZ','RectSensor','day','computeChecksum','subtract','value','_startFovV','angle1','withAlpha','ShaderSource','_ARRAY','BoundingSphere','property','pass','_endFovH','xli','ConicSensor','cc4','NaN','zmol','eastNorthUpToFixedFrame','_createRawCommand','postUpdate','_positionCartesian','RenderState','epochDay','isString','sqrt','Buffer','hideRayEllipsoid','argpp','register','Latitude\x20degrees\x20must\x20be\x20in\x20range\x20[-90;\x2090].','_showListCone','pho','_coneList','_rayEllipsoid','_createInnerCurveCommand','_outerFovRadiusPairs','outline','renderState','xh2','_groundCircleEntity','inclo','_groundPolyColor','IntersectionTests','endFovH','_groundCircleShow','GraphicUtil','_layer','cross','_outlinePositions','sgh3','topPsts','_trackGeometries','tle2','_primitive','Cartesian3','cosio2','724YDQCUU','_modelMatrix','11752FZjhkD','concat','padStart','floor','sin','sz21','_attributes_positions','_boundingSphere','eta','epoch','clearPosition','Character\x20array\x20empty!','has','heading','_endFovV','getUTCFullYear','computeNormal','CallbackProperty','getTleSetNumber','_subSegmentV','format','fourPir','sl3','z11','_drawCommands','pgho','HeadingPitchRoll','mon','atan2','PolyUtil','_pitch_reality','topHeight','sl4','exports','inverse','getRayEarthPosition','sensorType','call','context','getLineNumber1','constructor','updateGroundCircleRadius','values','name','getPoint','topPindices','referenceFrame','cone','mdot','inclination','rayEllipsoid','_segmentH','modelMatrix','_commands','del2','outlineColor','lookAt','_property','_innerFovRadiusPairs','_updateCone','outlineOpacity','bottomCenter','keys','_startRadius','_positions','BasePointPrimitive','color','resolve','_fixedFrameTransform','getUTCHours','gsto','error','destroy','distance','peo','d2211','_FLOAT','_rayEllipsoidType','_updateStyleHook','sinio','czmObject','atime','cc5','t5cof','getRayEarthPositions','next','z31','sz33','dmdt','perigee','xi3','jdsatepoch','bottomWidth','eccsq','Satellite\x20has\x20decayed','_parseTLE','epochdays','pickId','period_time','czm_pickColor','topRadius','sgh2','now','fromTranslationQuaternionRotationScale','PointTrans','2936758HsIEFX','getOrbitTrack','argpo','getTime','207310hoaFPg','sec','getPositionValue','replaceCache','RHUMB','ZERO','pow','createDrawCommand','multiplyByPoint','degreesLat','fromVertices','segmentH','con42','bindPickId','getDefaultRenderState','fromGeometry','t4cof','angle2','PolygonHierarchy','time','getEpochYear','meanMotion','flat','contains','getEcfPosition','addSample','origin','fromAngleAndLength','STATIC_DRAW','_groundArea','_pickCommands','_geometry','d5220','sinmao','nodeo','sz11','Ray','fromArray','substr','d4410','sz31','xgh4','getUTCMilliseconds','zmos','d2201','_angle2','twoline2satrec','_intersectEllipsoid','getChecksum2','longitude','boundingSphere','center','_groundOutLine','updateModelMatrix','length','epochyr','pitch','needsUpdate','getCatalogNumber','alta','ShaderProgram','omgcof','angle','trim','_length','yaw','sh3','tleSetNumber','ellipsoid','roll','_updatePosition','default','getGroundTracks','bstar','setOpacity','opacity','d3210','commandList','clock','domdt','2061vsIWdx','d3222','_groundConeEntity','xgh2','pinco','_createRightCrossSectionCommand','FLOAT','closed','lineCommand','_time_path_end','epochYear','altp','equals','options','getIntDesignatorPieceOfLaunch','getMeanAnomaly','6796440FIYJIv','render','fourPposition','SceneMode','createAttributeLocations','_satrec','bottomHeight','_pitchRadians','topWidth','_sensorType','eciToGeodetic','abs','getCesiumColor','ss1','Set','ndot','isSimpleType','globalAlpha','19263HoDXFe','_mountedHook','shaderProgram','primitiveType','clear','_slices','d5232','getHeadingPitchRollForLine','_segmentV','x7thm1','all','BufferUsage','nodecf','tle','date','_trackPositions','uniformMap','createGeometry','SatelliteSensor','get','_INT','ecco','aycof','period','remove','_outlineGeometry','ComponentDatatype','arr','push','z13','fov','getIntDesignatorLaunchNumber','topPpositions','_addGroundCircleEntity','se2','headingRadians','_createGeometry','prototype','_roll_reality','Appearance','xl2','fromHeadingPitchRoll','latitude','didt','toRadians','con41','xmo','entity','_scale','opsmode','d4422','direction','argpdot','_heading_reality','toDate','d5421','_imagingAreaPositions','height','undefined','_outline','attributes','_bottomWidth','Pass','_depthTestChange','primitiveCollection','getTopOutlineGeometry','GeometryPipeline','_translation','Conic','model','lat','bottomRadius','entities','normal','_groundPolyEntity','si2','isArray','xbstar','Color','ss3','TRANSLUCENT','TRIANGLES','operationmode','getCesiumValue','_getDrawEntityClass','getMeanMotion','posq','_topShow','del3','_startFovH','Mean\x20motion\x20less\x20than\x200.0','cc1','xfact','style','groundPolyColor','_angle','getLatLonArr','mode','xl3','show','sgh4','getOrbitModel','position','6886056sqjllh','ecfToLookAngles','],\x20but\x20got\x20','_matrix','_replaceFragmentShaderSourceByStyle','topOindices','lonlats2cartesians','_time_path_start','string','eccentricity','_zReverse','delmo','_ground_radius','getEccentricity','xi2','_color','PointUtil','_clearDrawCommand','gmst','_CHAR','xlcof','calculate_cam_sight','defined','_noDestroy','inclp','getFullYear','ecfToEci','si3'];_0x52f6=function(){return _0x126ee3;};return _0x52f6();}function degreesLong$1(_0x4f69fe){if(_0x4f69fe<-pi$1||_0x4f69fe>pi$1)throw new RangeError('Longitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi;\x20pi].');return radiansToDegrees$1(_0x4f69fe);}function radiansLat$1(_0x1aca12){if(_0x1aca12<-0x5a||_0x1aca12>0x5a)throw new RangeError('Latitude\x20degrees\x20must\x20be\x20in\x20range\x20[-90;\x2090].');return degreesToRadians$1(_0x1aca12);}function radiansLong$1(_0x16dd02){if(_0x16dd02<-0xb4||_0x16dd02>0xb4)throw new RangeError('Longitude\x20degrees\x20must\x20be\x20in\x20range\x20[-180;\x20180].');return degreesToRadians$1(_0x16dd02);}function geodeticToEcf$1(_0x187726){var _0x419bea=_0x8ca3,_0x58c7c7=_0x187726['longitude'],_0x13efe1=_0x187726['latitude'],_0x18be72=_0x187726['height'],_0x2834b0=6378.137,_0x43c4d2=6356.7523142,_0x5b42b1=(_0x2834b0-_0x43c4d2)/_0x2834b0,_0x1aef5e=0x2*_0x5b42b1-_0x5b42b1*_0x5b42b1,_0x148f97=_0x2834b0/Math['sqrt'](0x1-_0x1aef5e*(Math['sin'](_0x13efe1)*Math[_0x419bea(0x280)](_0x13efe1))),_0x35e371=(_0x148f97+_0x18be72)*Math['cos'](_0x13efe1)*Math[_0x419bea(0x1b8)](_0x58c7c7),_0x482ecf=(_0x148f97+_0x18be72)*Math[_0x419bea(0x1b8)](_0x13efe1)*Math['sin'](_0x58c7c7),_0x27896f=(_0x148f97*(0x1-_0x1aef5e)+_0x18be72)*Math[_0x419bea(0x280)](_0x13efe1);return{'x':_0x35e371,'y':_0x482ecf,'z':_0x27896f};}function eciToGeodetic$1(_0x42a4e8,_0x4c3a48){var _0x1fdad0=_0x8ca3,_0x180ac8=6378.137,_0x415f41=6356.7523142,_0x6c8af3=Math['sqrt'](_0x42a4e8['x']*_0x42a4e8['x']+_0x42a4e8['y']*_0x42a4e8['y']),_0x4fe313=(_0x180ac8-_0x415f41)/_0x180ac8,_0x13803f=0x2*_0x4fe313-_0x4fe313*_0x4fe313,_0x31f6d3=Math[_0x1fdad0(0x298)](_0x42a4e8['y'],_0x42a4e8['x'])-_0x4c3a48;while(_0x31f6d3<-pi$1){_0x31f6d3+=twoPi$1;}while(_0x31f6d3>pi$1){_0x31f6d3-=twoPi$1;}var _0x437665=0x14,_0x5abbea=0x0,_0x105e14=Math['atan2'](_0x42a4e8['z'],Math['sqrt'](_0x42a4e8['x']*_0x42a4e8['x']+_0x42a4e8['y']*_0x42a4e8['y'])),_0x47cc95;while(_0x5abbea<_0x437665){_0x47cc95=0x1/Math['sqrt'](0x1-_0x13803f*(Math[_0x1fdad0(0x280)](_0x105e14)*Math[_0x1fdad0(0x280)](_0x105e14))),_0x105e14=Math['atan2'](_0x42a4e8['z']+_0x180ac8*_0x47cc95*_0x13803f*Math[_0x1fdad0(0x280)](_0x105e14),_0x6c8af3),_0x5abbea+=0x1;}var _0x13ffcc=_0x6c8af3/Math['cos'](_0x105e14)-_0x180ac8*_0x47cc95;return{'longitude':_0x31f6d3,'latitude':_0x105e14,'height':_0x13ffcc};}function ecfToEci$1(_0x54a36b,_0x203909){var _0x1d59eb=_0x8ca3,_0x426dd9=_0x54a36b['x']*Math[_0x1d59eb(0x1b8)](_0x203909)-_0x54a36b['y']*Math['sin'](_0x203909),_0xbf3ac5=_0x54a36b['x']*Math['sin'](_0x203909)+_0x54a36b['y']*Math[_0x1d59eb(0x1b8)](_0x203909),_0x256b49=_0x54a36b['z'];return{'x':_0x426dd9,'y':_0xbf3ac5,'z':_0x256b49};}function eciToEcf$1(_0x596a52,_0x3d8ae6){var _0x23a13a=_0x8ca3,_0x458840=_0x596a52['x']*Math[_0x23a13a(0x1b8)](_0x3d8ae6)+_0x596a52['y']*Math[_0x23a13a(0x280)](_0x3d8ae6),_0xc38d13=_0x596a52['x']*-Math['sin'](_0x3d8ae6)+_0x596a52['y']*Math[_0x23a13a(0x1b8)](_0x3d8ae6),_0x34b620=_0x596a52['z'];return{'x':_0x458840,'y':_0xc38d13,'z':_0x34b620};}function topocentric$1(_0x1a4ce6,_0x25646a){var _0x2a7b1f=_0x8ca3,_0x21d95e=_0x1a4ce6[_0x2a7b1f(0x31a)],_0x45198c=_0x1a4ce6[_0x2a7b1f(0x14f)],_0x3e4beb=geodeticToEcf$1(_0x1a4ce6),_0x3b9f0f=_0x25646a['x']-_0x3e4beb['x'],_0x2bf6ad=_0x25646a['y']-_0x3e4beb['y'],_0x33fb40=_0x25646a['z']-_0x3e4beb['z'],_0x38ba29=Math[_0x2a7b1f(0x280)](_0x45198c)*Math['cos'](_0x21d95e)*_0x3b9f0f+Math['sin'](_0x45198c)*Math[_0x2a7b1f(0x280)](_0x21d95e)*_0x2bf6ad-Math['cos'](_0x45198c)*_0x33fb40,_0x3d484c=-Math['sin'](_0x21d95e)*_0x3b9f0f+Math['cos'](_0x21d95e)*_0x2bf6ad,_0x2076f4=Math[_0x2a7b1f(0x1b8)](_0x45198c)*Math['cos'](_0x21d95e)*_0x3b9f0f+Math[_0x2a7b1f(0x1b8)](_0x45198c)*Math['sin'](_0x21d95e)*_0x2bf6ad+Math['sin'](_0x45198c)*_0x33fb40;return{'topS':_0x38ba29,'topE':_0x3d484c,'topZ':_0x2076f4};}function topocentricToLookAngles$1(_0x5eb95e){var _0x4b58cb=_0x8ca3,_0x4f5325=_0x5eb95e['topS'],_0x61e8a1=_0x5eb95e['topE'],_0x47edd2=_0x5eb95e[_0x4b58cb(0x23f)],_0x48f6ff=Math['sqrt'](_0x4f5325*_0x4f5325+_0x61e8a1*_0x61e8a1+_0x47edd2*_0x47edd2),_0x59d2d9=Math['asin'](_0x47edd2/_0x48f6ff),_0x58b074=Math[_0x4b58cb(0x298)](-_0x61e8a1,_0x4f5325)+pi$1;return{'azimuth':_0x58b074,'elevation':_0x59d2d9,'rangeSat':_0x48f6ff};}function ecfToLookAngles$1(_0x37bb3d,_0x3ba8a2){var _0x3fdcca=topocentric$1(_0x37bb3d,_0x3ba8a2);return topocentricToLookAngles$1(_0x3fdcca);}var satellite={'__proto__':null,'constants':constants$1,'degreesLat':degreesLat$1,'degreesLong':degreesLong$1,'degreesToRadians':degreesToRadians$1,'dopplerFactor':dopplerFactor$1,'ecfToEci':ecfToEci$1,'ecfToLookAngles':ecfToLookAngles$1,'eciToEcf':eciToEcf$1,'eciToGeodetic':eciToGeodetic$1,'geodeticToEcf':geodeticToEcf$1,'gstime':gstime$1,'invjday':invjday$1,'jday':jday$1,'propagate':propagate$1,'radiansLat':radiansLat$1,'radiansLong':radiansLong$1,'radiansToDegrees':radiansToDegrees$1,'sgp4':sgp4$1,'twoline2satrec':twoline2satrec$1},commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs(_0x1bc016){var _0x1ee354=_0x8ca3;return _0x1bc016&&_0x1bc016[_0x1ee354(0x23e)]&&Object['prototype']['hasOwnProperty'][_0x1ee354(0x2a1)](_0x1bc016,'default')?_0x1bc016[_0x1ee354(0xfa)]:_0x1bc016;}function getAugmentedNamespace(_0x2ac586){var _0x42855e=_0x8ca3;if(_0x2ac586[_0x42855e(0x23e)])return _0x2ac586;var _0x2c4ad2=Object['defineProperty']({},'__esModule',{'value':!![]});return Object['keys'](_0x2ac586)[_0x42855e(0x1d0)](function(_0x1cb494){var _0x4f8064=_0x42855e,_0x4297b2=Object['getOwnPropertyDescriptor'](_0x2ac586,_0x1cb494);Object['defineProperty'](_0x2c4ad2,_0x1cb494,_0x4297b2[_0x4f8064(0x138)]?_0x4297b2:{'enumerable':!![],'get':function(){return _0x2ac586[_0x1cb494];}});}),_0x2c4ad2;}var tlejs_umd$1={'exports':{}},pi=Math['PI'],twoPi=pi*0x2,deg2rad=pi/0xb4,rad2deg=0xb4/pi,minutesPerDay=0x5a0,mu=398600.5,earthRadius=6378.137,xke=0x3c/Math['sqrt'](earthRadius*earthRadius*earthRadius/mu),vkmpersec=earthRadius*xke/0x3c,tumin=0x1/xke,j2=0.00108262998905,j3=-0.00000253215306,j4=-0.00000161098761,j3oj2=j3/j2,x2o3=0x2/0x3,constants=Object['freeze']({'__proto__':null,'pi':pi,'twoPi':twoPi,'deg2rad':deg2rad,'rad2deg':rad2deg,'minutesPerDay':minutesPerDay,'mu':mu,'earthRadius':earthRadius,'xke':xke,'vkmpersec':vkmpersec,'tumin':tumin,'j2':j2,'j3':j3,'j4':j4,'j3oj2':j3oj2,'x2o3':x2o3});function days2mdhms(_0x6b9cd,_0xd3c437){var _0x2fd4e4=_0x8ca3,_0x5ec652=[0x1f,_0x6b9cd%0x4===0x0?0x1d:0x1c,0x1f,0x1e,0x1f,0x1e,0x1f,0x1f,0x1e,0x1f,0x1e,0x1f],_0x3e28d3=Math['floor'](_0xd3c437),_0x384c26=0x1,_0x5c99f7=0x0;while(_0x3e28d3>_0x5c99f7+_0x5ec652[_0x384c26-0x1]&&_0x384c26<0xc){_0x5c99f7+=_0x5ec652[_0x384c26-0x1],_0x384c26+=0x1;}var _0x506a12=_0x384c26,_0x488fda=_0x3e28d3-_0x5c99f7,_0x2a1f07=(_0xd3c437-_0x3e28d3)*0x18,_0x42f21c=Math[_0x2fd4e4(0x27f)](_0x2a1f07);_0x2a1f07=(_0x2a1f07-_0x42f21c)*0x3c;var _0xb05337=Math['floor'](_0x2a1f07),_0xec75a7=(_0x2a1f07-_0xb05337)*0x3c;return{'mon':_0x506a12,'day':_0x488fda,'hr':_0x42f21c,'minute':_0xb05337,'sec':_0xec75a7};}function jdayInternal(_0x5e25f1,_0x31006a,_0x26266e,_0x35cd46,_0x15d10a,_0xd27b5f){var _0x341b0c=_0x8ca3,_0x2d2331=arguments[_0x341b0c(0x31f)]>0x6&&arguments[0x6]!==undefined?arguments[0x6]:0x0;return 0x16f*_0x5e25f1-Math[_0x341b0c(0x27f)](0x7*(_0x5e25f1+Math['floor']((_0x31006a+0x9)/0xc))*0.25)+Math['floor'](0x113*_0x31006a/0x9)+_0x26266e+1721013.5+((_0x2d2331/0xea60+_0xd27b5f/0x3c+_0x15d10a)/0x3c+_0x35cd46)/0x18;}function jday(_0x3e0544,_0x2a966a,_0x1b6833,_0x132e35,_0x41e31a,_0xd59afd,_0x38e037){var _0x1fd424=_0x8ca3;if(_0x3e0544 instanceof Date){var _0x447c1a=_0x3e0544;return jdayInternal(_0x447c1a[_0x1fd424(0x28b)](),_0x447c1a['getUTCMonth']()+0x1,_0x447c1a['getUTCDate'](),_0x447c1a[_0x1fd424(0x2c1)](),_0x447c1a['getUTCMinutes'](),_0x447c1a['getUTCSeconds'](),_0x447c1a['getUTCMilliseconds']());}return jdayInternal(_0x3e0544,_0x2a966a,_0x1b6833,_0x132e35,_0x41e31a,_0xd59afd,_0x38e037);}function invjday(_0x4cb82e,_0x2dc485){var _0x1730be=_0x8ca3,_0x41fd9b=_0x4cb82e-2415019.5,_0x4e381f=_0x41fd9b/365.25,_0x410335=0x76c+Math['floor'](_0x4e381f),_0x1cc70d=Math['floor']((_0x410335-0x76d)*0.25),_0x182bc2=_0x41fd9b-((_0x410335-0x76c)*0x16d+_0x1cc70d)+1e-11;_0x182bc2<0x1&&(_0x410335-=0x1,_0x1cc70d=Math['floor']((_0x410335-0x76d)*0.25),_0x182bc2=_0x41fd9b-((_0x410335-0x76c)*0x16d+_0x1cc70d));var _0x4adb96=days2mdhms(_0x410335,_0x182bc2),_0x1a8b34=_0x4adb96['mon'],_0x5f1378=_0x4adb96[_0x1730be(0x241)],_0x248d17=_0x4adb96['hr'],_0x2a2274=_0x4adb96['minute'],_0x3e7c71=_0x4adb96[_0x1730be(0x2ea)]-8.64e-7;if(_0x2dc485)return[_0x410335,_0x1a8b34,_0x5f1378,_0x248d17,_0x2a2274,Math[_0x1730be(0x27f)](_0x3e7c71)];return new Date(Date['UTC'](_0x410335,_0x1a8b34-0x1,_0x5f1378,_0x248d17,_0x2a2274,Math['floor'](_0x3e7c71)));}function dpper(_0x9df3f8,_0xc619d2){var _0x49899e=_0x8ca3,_0x422028=_0x9df3f8['e3'],_0x5a371e=_0x9df3f8['ee2'],_0x403b60=_0x9df3f8['peo'],_0x51999d=_0x9df3f8[_0x49899e(0x295)],_0x4a127c=_0x9df3f8['pho'],_0x3f0a4d=_0x9df3f8['pinco'],_0x1a436d=_0x9df3f8[_0x49899e(0x203)],_0x2bac49=_0x9df3f8[_0x49899e(0x147)],_0x53a6f3=_0x9df3f8['se3'],_0x114531=_0x9df3f8['sgh2'],_0x41e6b7=_0x9df3f8[_0x49899e(0x273)],_0x36f29b=_0x9df3f8[_0x49899e(0x189)],_0x377e42=_0x9df3f8[_0x49899e(0x234)],_0x4f114c=_0x9df3f8['sh3'],_0x577efd=_0x9df3f8[_0x49899e(0x170)],_0x4f983f=_0x9df3f8[_0x49899e(0x1a7)],_0x5d23e1=_0x9df3f8['sl2'],_0xb5ed92=_0x9df3f8['sl3'],_0x641aff=_0x9df3f8['sl4'],_0x3c2b65=_0x9df3f8['t'],_0x1942af=_0x9df3f8['xgh2'],_0xadc0a6=_0x9df3f8['xgh3'],_0x30a8ee=_0x9df3f8['xgh4'],_0x52384f=_0x9df3f8['xh2'],_0xd8fe35=_0x9df3f8[_0x49899e(0x225)],_0x39e7f7=_0x9df3f8['xi2'],_0x454294=_0x9df3f8['xi3'],_0x4e610a=_0x9df3f8['xl2'],_0xde1fe2=_0x9df3f8['xl3'],_0x7a6091=_0x9df3f8[_0x49899e(0x216)],_0x1c1b42=_0x9df3f8['zmol'],_0x209931=_0x9df3f8[_0x49899e(0x314)],_0x560484=_0xc619d2['init'],_0x4e1f5c=_0xc619d2['opsmode'],_0x4e04fa=_0xc619d2['ep'],_0x852f79=_0xc619d2[_0x49899e(0x1a4)],_0x1dc0f4=_0xc619d2['nodep'],_0x128056=_0xc619d2['argpp'],_0x5ec55d=_0xc619d2['mp'],_0x25e9a9,_0x1eb9f5,_0x5704e3,_0x549ad3,_0x3cabc8,_0x4febd5,_0x154589,_0xb7136c,_0x60d247,_0x1c8be7,_0x4da8cd,_0x19fc1f,_0x10de8f,_0xe42187,_0x547add,_0x3f6522,_0x25c1d3,_0x37169e,_0x2395fc,_0x26e6d1,_0x11d9cb,_0x602536=0.0000119459,_0x2d91e6=0.01675,_0x20f393=0.00015835218,_0x1d938f=0.0549;_0x11d9cb=_0x209931+_0x602536*_0x3c2b65;_0x560484==='y'&&(_0x11d9cb=_0x209931);_0x26e6d1=_0x11d9cb+0x2*_0x2d91e6*Math['sin'](_0x11d9cb),_0x25c1d3=Math[_0x49899e(0x280)](_0x26e6d1),_0x1c8be7=0.5*_0x25c1d3*_0x25c1d3-0.25,_0x4da8cd=-0.5*_0x25c1d3*Math['cos'](_0x26e6d1);var _0x2e62c6=_0x2bac49*_0x1c8be7+_0x53a6f3*_0x4da8cd,_0x547ad8=_0x577efd*_0x1c8be7+_0x4f983f*_0x4da8cd,_0x1a78c3=_0x5d23e1*_0x1c8be7+_0xb5ed92*_0x4da8cd+_0x641aff*_0x25c1d3,_0x4336a7=_0x114531*_0x1c8be7+_0x41e6b7*_0x4da8cd+_0x36f29b*_0x25c1d3,_0xbb28e5=_0x377e42*_0x1c8be7+_0x4f114c*_0x4da8cd;_0x11d9cb=_0x1c1b42+_0x20f393*_0x3c2b65;_0x560484==='y'&&(_0x11d9cb=_0x1c1b42);_0x26e6d1=_0x11d9cb+0x2*_0x1d938f*Math['sin'](_0x11d9cb),_0x25c1d3=Math['sin'](_0x26e6d1),_0x1c8be7=0.5*_0x25c1d3*_0x25c1d3-0.25,_0x4da8cd=-0.5*_0x25c1d3*Math['cos'](_0x26e6d1);var _0x1fbd60=_0x5a371e*_0x1c8be7+_0x422028*_0x4da8cd,_0x432284=_0x39e7f7*_0x1c8be7+_0x454294*_0x4da8cd,_0xdac497=_0x4e610a*_0x1c8be7+_0xde1fe2*_0x4da8cd+_0x7a6091*_0x25c1d3,_0x17f297=_0x1942af*_0x1c8be7+_0xadc0a6*_0x4da8cd+_0x30a8ee*_0x25c1d3,_0xea4435=_0x52384f*_0x1c8be7+_0xd8fe35*_0x4da8cd;return _0x19fc1f=_0x2e62c6+_0x1fbd60,_0x547add=_0x547ad8+_0x432284,_0x3f6522=_0x1a78c3+_0xdac497,_0x10de8f=_0x4336a7+_0x17f297,_0xe42187=_0xbb28e5+_0xea4435,_0x560484==='n'&&(_0x19fc1f-=_0x403b60,_0x547add-=_0x3f0a4d,_0x3f6522-=_0x1a436d,_0x10de8f-=_0x51999d,_0xe42187-=_0x4a127c,_0x852f79+=_0x547add,_0x4e04fa+=_0x19fc1f,_0x549ad3=Math['sin'](_0x852f79),_0x5704e3=Math['cos'](_0x852f79),_0x852f79>=0.2?(_0xe42187/=_0x549ad3,_0x10de8f-=_0x5704e3*_0xe42187,_0x128056+=_0x10de8f,_0x1dc0f4+=_0xe42187,_0x5ec55d+=_0x3f6522):(_0x4febd5=Math[_0x49899e(0x280)](_0x1dc0f4),_0x3cabc8=Math['cos'](_0x1dc0f4),_0x25e9a9=_0x549ad3*_0x4febd5,_0x1eb9f5=_0x549ad3*_0x3cabc8,_0x154589=_0xe42187*_0x3cabc8+_0x547add*_0x5704e3*_0x4febd5,_0xb7136c=-_0xe42187*_0x4febd5+_0x547add*_0x5704e3*_0x3cabc8,_0x25e9a9+=_0x154589,_0x1eb9f5+=_0xb7136c,_0x1dc0f4%=twoPi,_0x1dc0f4<0x0&&_0x4e1f5c==='a'&&(_0x1dc0f4+=twoPi),_0x37169e=_0x5ec55d+_0x128056+_0x5704e3*_0x1dc0f4,_0x60d247=_0x3f6522+_0x10de8f-_0x547add*_0x1dc0f4*_0x549ad3,_0x37169e+=_0x60d247,_0x2395fc=_0x1dc0f4,_0x1dc0f4=Math['atan2'](_0x25e9a9,_0x1eb9f5),_0x1dc0f4<0x0&&_0x4e1f5c==='a'&&(_0x1dc0f4+=twoPi),Math[_0x49899e(0x11e)](_0x2395fc-_0x1dc0f4)>pi&&(_0x1dc0f4<_0x2395fc?_0x1dc0f4+=twoPi:_0x1dc0f4-=twoPi),_0x5ec55d+=_0x3f6522,_0x128056=_0x37169e-_0x5ec55d-_0x5704e3*_0x1dc0f4)),{'ep':_0x4e04fa,'inclp':_0x852f79,'nodep':_0x1dc0f4,'argpp':_0x128056,'mp':_0x5ec55d};}function dscom(_0x35900f){var _0xa36519=_0x8ca3,_0x37b6ce=_0x35900f[_0xa36519(0x285)],_0x57bb92=_0x35900f['ep'],_0x2121a3=_0x35900f[_0xa36519(0x25d)],_0x49f9e5=_0x35900f['tc'],_0x3eed63=_0x35900f[_0xa36519(0x1a4)],_0x65e655=_0x35900f['nodep'],_0x4f7500=_0x35900f['np'],_0x164bb3,_0x4fd84d,_0xeb2131,_0x1406fe,_0x3d9c37,_0x19cebf,_0x210765,_0x1999f4,_0x568dfc,_0x5700c1,_0x3d6aed,_0x100a2a,_0x2a5426,_0x1c1f5d,_0x280954,_0x152a75,_0x460b1c,_0x4c670a,_0x31118d,_0x24c7f2,_0x3a5621,_0x5c48b9,_0x2efc87,_0x1b4632,_0x858d2f,_0x4adb73,_0x2fe234,_0x1690c5,_0x2a782c,_0x2977f7,_0x4cb94,_0x37308e,_0x274d64,_0x1bb74c,_0x3cb4c0,_0x5a9844,_0x2274e4,_0x7a19ed,_0x51702f,_0x55d6fd,_0x178dff,_0x4474c5,_0x3481da,_0x5b488f,_0xa142a2,_0x5d4015,_0x385eea,_0x47ec4b,_0x3b77d0,_0x4958a6,_0x17fd92,_0x53c3ac,_0x19eaa6,_0x26cdf9,_0x411ca9,_0x5d7a4c,_0xf805e0,_0x569a00,_0x445f1e,_0x3137d9,_0x334dd8,_0x35af35,_0x39ebc9,_0x3d6ee7=0.01675,_0xd0c721=0.0549,_0x15289f=0.0000029864797,_0x407e3b=4.7968065e-7,_0x2d6f9e=0.39785416,_0x5bcbf4=0.91744867,_0x528fe9=0.1945905,_0x54a953=-0.98088458,_0x5908ca=_0x4f7500,_0x367eea=_0x57bb92,_0x1cca83=Math['sin'](_0x65e655),_0x580f54=Math['cos'](_0x65e655),_0xe2ccff=Math['sin'](_0x2121a3),_0x3f43ea=Math[_0xa36519(0x1b8)](_0x2121a3),_0x2b3a8b=Math['sin'](_0x3eed63),_0x3fb586=Math['cos'](_0x3eed63),_0x1b5b02=_0x367eea*_0x367eea,_0x15907e=0x1-_0x1b5b02,_0x8dd4ad=Math['sqrt'](_0x15907e),_0x5250d2=0x0,_0x1cec84=0x0,_0x53ef2a=0x0,_0x24c026=0x0,_0x492007=0x0,_0x5a50b7=_0x37b6ce+18261.5+_0x49f9e5/0x5a0,_0x226da3=(4.523602-0.00092422029*_0x5a50b7)%twoPi,_0x978129=Math['sin'](_0x226da3),_0x5971ae=Math['cos'](_0x226da3),_0x289676=0.91375164-0.03568096*_0x5971ae,_0x3dc2de=Math[_0xa36519(0x25a)](0x1-_0x289676*_0x289676),_0x19e1f0=0.089683511*_0x978129/_0x3dc2de,_0x5eea51=Math['sqrt'](0x1-_0x19e1f0*_0x19e1f0),_0x253e9b=5.8351514+0.001944368*_0x5a50b7,_0x47ab66=0.39785416*_0x978129/_0x3dc2de,_0x34bcea=_0x5eea51*_0x5971ae+0.91744867*_0x19e1f0*_0x978129;_0x47ab66=Math['atan2'](_0x47ab66,_0x34bcea),_0x47ab66+=_0x253e9b-_0x226da3;var _0x336ed2=Math['cos'](_0x47ab66),_0xe6b767=Math['sin'](_0x47ab66);_0x24c7f2=_0x528fe9,_0x3a5621=_0x54a953,_0x1b4632=_0x5bcbf4,_0x858d2f=_0x2d6f9e,_0x5c48b9=_0x580f54,_0x2efc87=_0x1cca83,_0x3d6aed=_0x15289f;var _0x187462=0x1/_0x5908ca,_0x4df52d=0x0;while(_0x4df52d<0x2){_0x4df52d+=0x1,_0x164bb3=_0x24c7f2*_0x5c48b9+_0x3a5621*_0x1b4632*_0x2efc87,_0xeb2131=-_0x3a5621*_0x5c48b9+_0x24c7f2*_0x1b4632*_0x2efc87,_0x210765=-_0x24c7f2*_0x2efc87+_0x3a5621*_0x1b4632*_0x5c48b9,_0x1999f4=_0x3a5621*_0x858d2f,_0x568dfc=_0x3a5621*_0x2efc87+_0x24c7f2*_0x1b4632*_0x5c48b9,_0x5700c1=_0x24c7f2*_0x858d2f,_0x4fd84d=_0x3fb586*_0x210765+_0x2b3a8b*_0x1999f4,_0x1406fe=_0x3fb586*_0x568dfc+_0x2b3a8b*_0x5700c1,_0x3d9c37=-_0x2b3a8b*_0x210765+_0x3fb586*_0x1999f4,_0x19cebf=-_0x2b3a8b*_0x568dfc+_0x3fb586*_0x5700c1,_0x100a2a=_0x164bb3*_0x3f43ea+_0x4fd84d*_0xe2ccff,_0x2a5426=_0xeb2131*_0x3f43ea+_0x1406fe*_0xe2ccff,_0x1c1f5d=-_0x164bb3*_0xe2ccff+_0x4fd84d*_0x3f43ea,_0x280954=-_0xeb2131*_0xe2ccff+_0x1406fe*_0x3f43ea,_0x152a75=_0x3d9c37*_0xe2ccff,_0x460b1c=_0x19cebf*_0xe2ccff,_0x4c670a=_0x3d9c37*_0x3f43ea,_0x31118d=_0x19cebf*_0x3f43ea,_0x334dd8=0xc*_0x100a2a*_0x100a2a-0x3*_0x1c1f5d*_0x1c1f5d,_0x35af35=0x18*_0x100a2a*_0x2a5426-0x6*_0x1c1f5d*_0x280954,_0x39ebc9=0xc*_0x2a5426*_0x2a5426-0x3*_0x280954*_0x280954,_0x53c3ac=0x3*(_0x164bb3*_0x164bb3+_0x4fd84d*_0x4fd84d)+_0x334dd8*_0x1b5b02,_0x19eaa6=0x6*(_0x164bb3*_0xeb2131+_0x4fd84d*_0x1406fe)+_0x35af35*_0x1b5b02,_0x26cdf9=0x3*(_0xeb2131*_0xeb2131+_0x1406fe*_0x1406fe)+_0x39ebc9*_0x1b5b02,_0x411ca9=-0x6*_0x164bb3*_0x3d9c37+_0x1b5b02*(-0x18*_0x100a2a*_0x4c670a-0x6*_0x1c1f5d*_0x152a75),_0x5d7a4c=-0x6*(_0x164bb3*_0x19cebf+_0xeb2131*_0x3d9c37)+_0x1b5b02*(-0x18*(_0x2a5426*_0x4c670a+_0x100a2a*_0x31118d)+-0x6*(_0x1c1f5d*_0x460b1c+_0x280954*_0x152a75)),_0xf805e0=-0x6*_0xeb2131*_0x19cebf+_0x1b5b02*(-0x18*_0x2a5426*_0x31118d-0x6*_0x280954*_0x460b1c),_0x569a00=0x6*_0x4fd84d*_0x3d9c37+_0x1b5b02*(0x18*_0x100a2a*_0x152a75-0x6*_0x1c1f5d*_0x4c670a),_0x445f1e=0x6*(_0x1406fe*_0x3d9c37+_0x4fd84d*_0x19cebf)+_0x1b5b02*(0x18*(_0x2a5426*_0x152a75+_0x100a2a*_0x460b1c)-0x6*(_0x280954*_0x4c670a+_0x1c1f5d*_0x31118d)),_0x3137d9=0x6*_0x1406fe*_0x19cebf+_0x1b5b02*(0x18*_0x2a5426*_0x460b1c-0x6*_0x280954*_0x31118d),_0x53c3ac=_0x53c3ac+_0x53c3ac+_0x15907e*_0x334dd8,_0x19eaa6=_0x19eaa6+_0x19eaa6+_0x15907e*_0x35af35,_0x26cdf9=_0x26cdf9+_0x26cdf9+_0x15907e*_0x39ebc9,_0x385eea=_0x3d6aed*_0x187462,_0x5d4015=-0.5*_0x385eea/_0x8dd4ad,_0x47ec4b=_0x385eea*_0x8dd4ad,_0xa142a2=-0xf*_0x367eea*_0x47ec4b,_0x3b77d0=_0x100a2a*_0x1c1f5d+_0x2a5426*_0x280954,_0x4958a6=_0x2a5426*_0x1c1f5d+_0x100a2a*_0x280954,_0x17fd92=_0x2a5426*_0x280954-_0x100a2a*_0x1c1f5d,_0x4df52d===0x1&&(_0x4adb73=_0xa142a2,_0x2fe234=_0x5d4015,_0x1690c5=_0x385eea,_0x2a782c=_0x47ec4b,_0x2977f7=_0x3b77d0,_0x4cb94=_0x4958a6,_0x37308e=_0x17fd92,_0x274d64=_0x53c3ac,_0x1bb74c=_0x19eaa6,_0x3cb4c0=_0x26cdf9,_0x5a9844=_0x411ca9,_0x2274e4=_0x5d7a4c,_0x7a19ed=_0xf805e0,_0x51702f=_0x569a00,_0x55d6fd=_0x445f1e,_0x178dff=_0x3137d9,_0x4474c5=_0x334dd8,_0x3481da=_0x35af35,_0x5b488f=_0x39ebc9,_0x24c7f2=_0x336ed2,_0x3a5621=_0xe6b767,_0x1b4632=_0x289676,_0x858d2f=_0x3dc2de,_0x5c48b9=_0x5eea51*_0x580f54+_0x19e1f0*_0x1cca83,_0x2efc87=_0x1cca83*_0x5eea51-_0x580f54*_0x19e1f0,_0x3d6aed=_0x407e3b);}var _0x3d6486=(4.7199672+(0.2299715*_0x5a50b7-_0x253e9b))%twoPi,_0x3e9298=(6.2565837+0.017201977*_0x5a50b7)%twoPi,_0x20af70=0x2*_0x4adb73*_0x4cb94,_0x584076=0x2*_0x4adb73*_0x37308e,_0x107ddc=0x2*_0x2fe234*_0x2274e4,_0x20f18e=0x2*_0x2fe234*(_0x7a19ed-_0x5a9844),_0x30f825=-0x2*_0x1690c5*_0x1bb74c,_0x5bd4a4=-0x2*_0x1690c5*(_0x3cb4c0-_0x274d64),_0x8611a3=-0x2*_0x1690c5*(-0x15-0x9*_0x1b5b02)*_0x3d6ee7,_0x5cfd82=0x2*_0x2a782c*_0x3481da,_0x136124=0x2*_0x2a782c*(_0x5b488f-_0x4474c5),_0x562d8c=-0x12*_0x2a782c*_0x3d6ee7,_0x10d0e0=-0x2*_0x2fe234*_0x55d6fd,_0x3f237b=-0x2*_0x2fe234*(_0x178dff-_0x51702f),_0x34f44c=0x2*_0xa142a2*_0x4958a6,_0x5ac11c=0x2*_0xa142a2*_0x17fd92,_0x3c9956=0x2*_0x5d4015*_0x5d7a4c,_0x2041c6=0x2*_0x5d4015*(_0xf805e0-_0x411ca9),_0x5a6749=-0x2*_0x385eea*_0x19eaa6,_0x223ea8=-0x2*_0x385eea*(_0x26cdf9-_0x53c3ac),_0x4edd8c=-0x2*_0x385eea*(-0x15-0x9*_0x1b5b02)*_0xd0c721,_0x1fbbdb=0x2*_0x47ec4b*_0x35af35,_0x3fb7f2=0x2*_0x47ec4b*(_0x39ebc9-_0x334dd8),_0x478cc4=-0x12*_0x47ec4b*_0xd0c721,_0x18d60e=-0x2*_0x5d4015*_0x445f1e,_0x1efbe5=-0x2*_0x5d4015*(_0x3137d9-_0x569a00);return{'snodm':_0x1cca83,'cnodm':_0x580f54,'sinim':_0x2b3a8b,'cosim':_0x3fb586,'sinomm':_0xe2ccff,'cosomm':_0x3f43ea,'day':_0x5a50b7,'e3':_0x5ac11c,'ee2':_0x34f44c,'em':_0x367eea,'emsq':_0x1b5b02,'gam':_0x253e9b,'peo':_0x5250d2,'pgho':_0x24c026,'pho':_0x492007,'pinco':_0x1cec84,'plo':_0x53ef2a,'rtemsq':_0x8dd4ad,'se2':_0x20af70,'se3':_0x584076,'sgh2':_0x5cfd82,'sgh3':_0x136124,'sgh4':_0x562d8c,'sh2':_0x10d0e0,'sh3':_0x3f237b,'si2':_0x107ddc,'si3':_0x20f18e,'sl2':_0x30f825,'sl3':_0x5bd4a4,'sl4':_0x8611a3,'s1':_0xa142a2,'s2':_0x5d4015,'s3':_0x385eea,'s4':_0x47ec4b,'s5':_0x3b77d0,'s6':_0x4958a6,'s7':_0x17fd92,'ss1':_0x4adb73,'ss2':_0x2fe234,'ss3':_0x1690c5,'ss4':_0x2a782c,'ss5':_0x2977f7,'ss6':_0x4cb94,'ss7':_0x37308e,'sz1':_0x274d64,'sz2':_0x1bb74c,'sz3':_0x3cb4c0,'sz11':_0x5a9844,'sz12':_0x2274e4,'sz13':_0x7a19ed,'sz21':_0x51702f,'sz22':_0x55d6fd,'sz23':_0x178dff,'sz31':_0x4474c5,'sz32':_0x3481da,'sz33':_0x5b488f,'xgh2':_0x1fbbdb,'xgh3':_0x3fb7f2,'xgh4':_0x478cc4,'xh2':_0x18d60e,'xh3':_0x1efbe5,'xi2':_0x3c9956,'xi3':_0x2041c6,'xl2':_0x5a6749,'xl3':_0x223ea8,'xl4':_0x4edd8c,'nm':_0x5908ca,'z1':_0x53c3ac,'z2':_0x19eaa6,'z3':_0x26cdf9,'z11':_0x411ca9,'z12':_0x5d7a4c,'z13':_0xf805e0,'z21':_0x569a00,'z22':_0x445f1e,'z23':_0x3137d9,'z31':_0x334dd8,'z32':_0x35af35,'z33':_0x39ebc9,'zmol':_0x3d6486,'zmos':_0x3e9298};}function dsinit(_0xbb8b59){var _0x59a501=_0x8ca3,_0x5e0266=_0xbb8b59['cosim'],_0x17e229=_0xbb8b59[_0x59a501(0x2e7)],_0x3ef5cf=_0xbb8b59['s1'],_0x1137b4=_0xbb8b59['s2'],_0x32d5a6=_0xbb8b59['s3'],_0x28bfd4=_0xbb8b59['s4'],_0x4a97f0=_0xbb8b59['s5'],_0xec55e6=_0xbb8b59['sinim'],_0x1b2436=_0xbb8b59['ss1'],_0x1820aa=_0xbb8b59[_0x59a501(0x236)],_0x314d95=_0xbb8b59[_0x59a501(0x174)],_0x5b0b71=_0xbb8b59['ss4'],_0x4bd455=_0xbb8b59['ss5'],_0x57d22f=_0xbb8b59[_0x59a501(0x1bc)],_0x8ba25f=_0xbb8b59[_0x59a501(0x212)],_0x4a5979=_0xbb8b59[_0x59a501(0x30c)],_0x3503cf=_0xbb8b59['sz13'],_0x17d9d8=_0xbb8b59['sz21'],_0xbe6e91=_0xbb8b59['sz23'],_0x3ae8ad=_0xbb8b59['sz31'],_0x23ad9b=_0xbb8b59['sz33'],_0x5affda=_0xbb8b59['t'],_0x487bd5=_0xbb8b59['tc'],_0x4e03d9=_0xbb8b59['gsto'],_0x543f36=_0xbb8b59['mo'],_0xf5a284=_0xbb8b59['mdot'],_0x501522=_0xbb8b59['no'],_0x169340=_0xbb8b59[_0x59a501(0x30b)],_0x4ef66d=_0xbb8b59['nodedot'],_0x5a8c5e=_0xbb8b59[_0x59a501(0x1dc)],_0x1af3e6=_0xbb8b59['z1'],_0x3e6ed7=_0xbb8b59['z3'],_0x396adc=_0xbb8b59['z11'],_0x26e503=_0xbb8b59['z13'],_0x5ecf99=_0xbb8b59['z21'],_0x5df61a=_0xbb8b59['z23'],_0x2b51aa=_0xbb8b59['z31'],_0x150c65=_0xbb8b59[_0x59a501(0x1e7)],_0x4f41db=_0xbb8b59['ecco'],_0x53b234=_0xbb8b59[_0x59a501(0x2d9)],_0xc9c53=_0xbb8b59['emsq'],_0x3d9c26=_0xbb8b59['em'],_0x1cc6fb=_0xbb8b59['argpm'],_0x107393=_0xbb8b59['inclm'],_0xcf5755=_0xbb8b59['mm'],_0x20b3b4=_0xbb8b59['nm'],_0x5ca7dc=_0xbb8b59['nodem'],_0xc1ad38=_0xbb8b59[_0x59a501(0x1cd)],_0x4090b2=_0xbb8b59['atime'],_0x5bb347=_0xbb8b59['d2201'],_0xa9b25d=_0xbb8b59['d2211'],_0x3e92df=_0xbb8b59['d3210'],_0x414f29=_0xbb8b59['d3222'],_0x239a83=_0xbb8b59['d4410'],_0x3a923d=_0xbb8b59['d4422'],_0x3fc201=_0xbb8b59['d5220'],_0x4b51e1=_0xbb8b59[_0x59a501(0x12b)],_0x215cd9=_0xbb8b59['d5421'],_0x32d8b0=_0xbb8b59['d5433'],_0x1d3b36=_0xbb8b59[_0x59a501(0x204)],_0x5f20ff=_0xbb8b59['didt'],_0x4113f4=_0xbb8b59[_0x59a501(0x2d4)],_0x3c838a=_0xbb8b59['dnodt'],_0x3fd2f8=_0xbb8b59['domdt'],_0x2b3b41=_0xbb8b59[_0x59a501(0x210)],_0x344336=_0xbb8b59['del2'],_0x1891c8=_0xbb8b59[_0x59a501(0x17d)],_0x105f45=_0xbb8b59['xfact'],_0x4e301b=_0xbb8b59['xlamo'],_0x473922=_0xbb8b59['xli'],_0xe5acb9=_0xbb8b59['xni'],_0xbc618c,_0x2cf35f,_0x2acb43,_0x336817,_0x5197a2,_0x43633c,_0x2e7f9e,_0x484759,_0x3d721c,_0x2ca568,_0x5e6e4e,_0x2e8c1b,_0x1d3029,_0x4ebed4,_0x2641d8,_0x8f886f,_0x4541bb,_0x110e60,_0x183574,_0x670209,_0x2b1a17,_0x28ffe2,_0x3fe63a,_0x2aad2d,_0x19c0a7,_0x4b4199,_0x185fa2,_0x4bb76a,_0x52cec0,_0x238e2d,_0x4bbe61,_0x2b815e,_0x470835=0.0000017891679,_0x6956aa=0.0000021460748,_0x4014a9=2.2123015e-7,_0x4ce1f7=0.0000017891679,_0x44fb9d=7.3636953e-9,_0x27869b=2.1765803e-9,_0x2f3546=0.0043752690880113,_0x2c550e=3.7393792e-7,_0x2bc86f=1.1428639e-7,_0x283e2a=0.00015835218,_0x5e862e=0.0000119459;_0xc1ad38=0x0;_0x20b3b4<0.0052359877&&_0x20b3b4>0.0034906585&&(_0xc1ad38=0x1);_0x20b3b4>=0.00826&&_0x20b3b4<=0.00924&&_0x3d9c26>=0.5&&(_0xc1ad38=0x2);var _0x15b8b0=_0x1b2436*_0x5e862e*_0x4bd455,_0x385cf4=_0x1820aa*_0x5e862e*(_0x4a5979+_0x3503cf),_0x46d572=-_0x5e862e*_0x314d95*(_0x57d22f+_0x8ba25f-0xe-0x6*_0xc9c53),_0xbdf8c8=_0x5b0b71*_0x5e862e*(_0x3ae8ad+_0x23ad9b-0x6),_0x5bebeb=-_0x5e862e*_0x1820aa*(_0x17d9d8+_0xbe6e91);(_0x107393<0.052359877||_0x107393>pi-0.052359877)&&(_0x5bebeb=0x0);_0xec55e6!==0x0&&(_0x5bebeb/=_0xec55e6);var _0x2b58f8=_0xbdf8c8-_0x5e0266*_0x5bebeb;_0x1d3b36=_0x15b8b0+_0x3ef5cf*_0x283e2a*_0x4a97f0,_0x5f20ff=_0x385cf4+_0x1137b4*_0x283e2a*(_0x396adc+_0x26e503),_0x4113f4=_0x46d572-_0x283e2a*_0x32d5a6*(_0x1af3e6+_0x3e6ed7-0xe-0x6*_0xc9c53);var _0x31dfaf=_0x28bfd4*_0x283e2a*(_0x2b51aa+_0x150c65-0x6),_0xf7d7a=-_0x283e2a*_0x1137b4*(_0x5ecf99+_0x5df61a);(_0x107393<0.052359877||_0x107393>pi-0.052359877)&&(_0xf7d7a=0x0);_0x3fd2f8=_0x2b58f8+_0x31dfaf,_0x3c838a=_0x5bebeb;_0xec55e6!==0x0&&(_0x3fd2f8-=_0x5e0266/_0xec55e6*_0xf7d7a,_0x3c838a+=_0xf7d7a/_0xec55e6);var _0x44622a=0x0,_0x3c4751=(_0x4e03d9+_0x487bd5*_0x2f3546)%twoPi;_0x3d9c26+=_0x1d3b36*_0x5affda,_0x107393+=_0x5f20ff*_0x5affda,_0x1cc6fb+=_0x3fd2f8*_0x5affda,_0x5ca7dc+=_0x3c838a*_0x5affda,_0xcf5755+=_0x4113f4*_0x5affda;if(_0xc1ad38!==0x0){_0x238e2d=Math['pow'](_0x20b3b4/xke,x2o3);if(_0xc1ad38===0x2){_0x4bbe61=_0x5e0266*_0x5e0266;var _0x4691dd=_0x3d9c26;_0x3d9c26=_0x4f41db;var _0x305080=_0xc9c53;_0xc9c53=_0x53b234,_0x2b815e=_0x3d9c26*_0xc9c53,_0x4ebed4=-0.306-(_0x3d9c26-0.64)*0.44,_0x3d9c26<=0.65?(_0x2641d8=3.616-13.247*_0x3d9c26+16.29*_0xc9c53,_0x4541bb=-19.302+117.39*_0x3d9c26-228.419*_0xc9c53+156.591*_0x2b815e,_0x110e60=-18.9068+109.7927*_0x3d9c26-214.6334*_0xc9c53+146.5816*_0x2b815e,_0x183574=-41.122+242.694*_0x3d9c26-471.094*_0xc9c53+313.953*_0x2b815e,_0x670209=-146.407+841.88*_0x3d9c26-1629.014*_0xc9c53+1083.435*_0x2b815e,_0x2b1a17=-532.114+3017.977*_0x3d9c26-5740.032*_0xc9c53+3708.276*_0x2b815e):(_0x2641d8=-72.099+331.819*_0x3d9c26-508.738*_0xc9c53+266.724*_0x2b815e,_0x4541bb=-346.844+1582.851*_0x3d9c26-2415.925*_0xc9c53+1246.113*_0x2b815e,_0x110e60=-342.585+1554.908*_0x3d9c26-2366.899*_0xc9c53+1215.972*_0x2b815e,_0x183574=-1052.797+4758.686*_0x3d9c26-7193.992*_0xc9c53+3651.957*_0x2b815e,_0x670209=-3581.69+16178.11*_0x3d9c26-24462.77*_0xc9c53+12422.52*_0x2b815e,_0x3d9c26>0.715?_0x2b1a17=-5149.66+29936.92*_0x3d9c26-54087.36*_0xc9c53+31324.56*_0x2b815e:_0x2b1a17=1464.74-4664.75*_0x3d9c26+3763.64*_0xc9c53),_0x3d9c26<0.7?(_0x2aad2d=-919.2277+4988.61*_0x3d9c26-9064.77*_0xc9c53+5542.21*_0x2b815e,_0x28ffe2=-822.71072+4568.6173*_0x3d9c26-8491.4146*_0xc9c53+5337.524*_0x2b815e,_0x3fe63a=-853.666+4690.25*_0x3d9c26-8624.77*_0xc9c53+5341.4*_0x2b815e):(_0x2aad2d=-37995.78+161616.52*_0x3d9c26-229838.2*_0xc9c53+109377.94*_0x2b815e,_0x28ffe2=-51752.104+218913.95*_0x3d9c26-309468.16*_0xc9c53+146349.42*_0x2b815e,_0x3fe63a=-40023.88+170470.89*_0x3d9c26-242699.48*_0xc9c53+115605.82*_0x2b815e),_0x19c0a7=_0xec55e6*_0xec55e6,_0xbc618c=0.75*(0x1+0x2*_0x5e0266+_0x4bbe61),_0x2cf35f=1.5*_0x19c0a7,_0x336817=1.875*_0xec55e6*(0x1-0x2*_0x5e0266-0x3*_0x4bbe61),_0x5197a2=-1.875*_0xec55e6*(0x1+0x2*_0x5e0266-0x3*_0x4bbe61),_0x2e7f9e=0x23*_0x19c0a7*_0xbc618c,_0x484759=39.375*_0x19c0a7*_0x19c0a7,_0x3d721c=9.84375*_0xec55e6*(_0x19c0a7*(0x1-0x2*_0x5e0266-0x5*_0x4bbe61)+0.33333333*(-0x2+0x4*_0x5e0266+0x6*_0x4bbe61)),_0x2ca568=_0xec55e6*(4.92187512*_0x19c0a7*(-0x2-0x4*_0x5e0266+0xa*_0x4bbe61)+6.56250012*(0x1+0x2*_0x5e0266-0x3*_0x4bbe61)),_0x5e6e4e=29.53125*_0xec55e6*(0x2-0x8*_0x5e0266+_0x4bbe61*(-0xc+0x8*_0x5e0266+0xa*_0x4bbe61)),_0x2e8c1b=29.53125*_0xec55e6*(-0x2-0x8*_0x5e0266+_0x4bbe61*(0xc+0x8*_0x5e0266-0xa*_0x4bbe61)),_0x4bb76a=_0x20b3b4*_0x20b3b4,_0x52cec0=_0x238e2d*_0x238e2d,_0x185fa2=0x3*_0x4bb76a*_0x52cec0,_0x4b4199=_0x185fa2*_0x4ce1f7,_0x5bb347=_0x4b4199*_0xbc618c*_0x4ebed4,_0xa9b25d=_0x4b4199*_0x2cf35f*_0x2641d8,_0x185fa2*=_0x238e2d,_0x4b4199=_0x185fa2*_0x2c550e,_0x3e92df=_0x4b4199*_0x336817*_0x4541bb,_0x414f29=_0x4b4199*_0x5197a2*_0x110e60,_0x185fa2*=_0x238e2d,_0x4b4199=0x2*_0x185fa2*_0x44fb9d,_0x239a83=_0x4b4199*_0x2e7f9e*_0x183574,_0x3a923d=_0x4b4199*_0x484759*_0x670209,_0x185fa2*=_0x238e2d,_0x4b4199=_0x185fa2*_0x2bc86f,_0x3fc201=_0x4b4199*_0x3d721c*_0x2b1a17,_0x4b51e1=_0x4b4199*_0x2ca568*_0x3fe63a,_0x4b4199=0x2*_0x185fa2*_0x27869b,_0x215cd9=_0x4b4199*_0x5e6e4e*_0x28ffe2,_0x32d8b0=_0x4b4199*_0x2e8c1b*_0x2aad2d,_0x4e301b=(_0x543f36+_0x169340+_0x169340-(_0x3c4751+_0x3c4751))%twoPi,_0x105f45=_0xf5a284+_0x4113f4+0x2*(_0x4ef66d+_0x3c838a-_0x2f3546)-_0x501522,_0x3d9c26=_0x4691dd,_0xc9c53=_0x305080;}_0xc1ad38===0x1&&(_0x1d3029=0x1+_0xc9c53*(-2.5+0.8125*_0xc9c53),_0x4541bb=0x1+0x2*_0xc9c53,_0x8f886f=0x1+_0xc9c53*(-0x6+6.60937*_0xc9c53),_0xbc618c=0.75*(0x1+_0x5e0266)*(0x1+_0x5e0266),_0x2acb43=0.9375*_0xec55e6*_0xec55e6*(0x1+0x3*_0x5e0266)-0.75*(0x1+_0x5e0266),_0x43633c=0x1+_0x5e0266,_0x43633c*=1.875*_0x43633c*_0x43633c,_0x2b3b41=0x3*_0x20b3b4*_0x20b3b4*_0x238e2d*_0x238e2d,_0x344336=0x2*_0x2b3b41*_0xbc618c*_0x1d3029*_0x470835,_0x1891c8=0x3*_0x2b3b41*_0x43633c*_0x8f886f*_0x4014a9*_0x238e2d,_0x2b3b41=_0x2b3b41*_0x2acb43*_0x4541bb*_0x6956aa*_0x238e2d,_0x4e301b=(_0x543f36+_0x169340+_0x17e229-_0x3c4751)%twoPi,_0x105f45=_0xf5a284+_0x5a8c5e+_0x4113f4+_0x3fd2f8+_0x3c838a-(_0x501522+_0x2f3546)),_0x473922=_0x4e301b,_0xe5acb9=_0x501522,_0x4090b2=0x0,_0x20b3b4=_0x501522+_0x44622a;}return{'em':_0x3d9c26,'argpm':_0x1cc6fb,'inclm':_0x107393,'mm':_0xcf5755,'nm':_0x20b3b4,'nodem':_0x5ca7dc,'irez':_0xc1ad38,'atime':_0x4090b2,'d2201':_0x5bb347,'d2211':_0xa9b25d,'d3210':_0x3e92df,'d3222':_0x414f29,'d4410':_0x239a83,'d4422':_0x3a923d,'d5220':_0x3fc201,'d5232':_0x4b51e1,'d5421':_0x215cd9,'d5433':_0x32d8b0,'dedt':_0x1d3b36,'didt':_0x5f20ff,'dmdt':_0x4113f4,'dndt':_0x44622a,'dnodt':_0x3c838a,'domdt':_0x3fd2f8,'del1':_0x2b3b41,'del2':_0x344336,'del3':_0x1891c8,'xfact':_0x105f45,'xlamo':_0x4e301b,'xli':_0x473922,'xni':_0xe5acb9};}function gstimeInternal(_0x43e991){var _0x8761d=(_0x43e991-0x256859)/0x8ead,_0x198540=-0.0000062*_0x8761d*_0x8761d*_0x8761d+0.093104*_0x8761d*_0x8761d+(0xd6038*0xe10+8640184.812866)*_0x8761d+67310.54841;return _0x198540=_0x198540*deg2rad/0xf0%twoPi,_0x198540<0x0&&(_0x198540+=twoPi),_0x198540;}function gstime(){var _0x16a9f0=_0x8ca3;if((arguments['length']<=0x0?undefined:arguments[0x0])instanceof Date||arguments['length']>0x1)return gstimeInternal(jday['apply'](void 0x0,arguments));return gstimeInternal[_0x16a9f0(0x1d3)](void 0x0,arguments);}function initl(_0x44016d){var _0x368e69=_0x8ca3,_0x5d90be=_0x44016d['ecco'],_0x97d7de=_0x44016d[_0x368e69(0x285)],_0x35b319=_0x44016d['inclo'],_0x5a81a5=_0x44016d[_0x368e69(0x156)],_0x24fd16=_0x44016d['no'],_0x145e26=_0x5d90be*_0x5d90be,_0x3b0ca1=0x1-_0x145e26,_0x19c519=Math['sqrt'](_0x3b0ca1),_0x597517=Math['cos'](_0x35b319),_0x4c9f45=_0x597517*_0x597517,_0xfd66b5=Math[_0x368e69(0x2ef)](xke/_0x24fd16,x2o3),_0xc85019=0.75*j2*(0x3*_0x4c9f45-0x1)/(_0x19c519*_0x3b0ca1),_0x5b2410=_0xc85019/(_0xfd66b5*_0xfd66b5),_0xbf6487=_0xfd66b5*(0x1-_0x5b2410*_0x5b2410-_0x5b2410*(0x1/0x3+0x86*_0x5b2410*_0x5b2410/0x51));_0x5b2410=_0xc85019/(_0xbf6487*_0xbf6487),_0x24fd16/=0x1+_0x5b2410;var _0x11dda3=Math[_0x368e69(0x2ef)](xke/_0x24fd16,x2o3),_0x28b9fd=Math['sin'](_0x35b319),_0x4b724e=_0x11dda3*_0x3b0ca1,_0x1fc3a5=0x1-0x5*_0x4c9f45,_0x416730=-_0x1fc3a5-_0x4c9f45-_0x4c9f45,_0x5d4909=0x1/_0x11dda3,_0x58307b=_0x4b724e*_0x4b724e,_0x349463=_0x11dda3*(0x1-_0x5d90be),_0x35cade='n',_0x240d81;if(_0x5a81a5==='a'){var _0x387580=_0x97d7de-0x1c89,_0x49efe8=Math[_0x368e69(0x27f)](_0x387580+1e-8),_0x56e79a=_0x387580-_0x49efe8,_0x15c96e=0.017202791694070362,_0x191c91=1.7321343856509375,_0x1cf636=5.075514194322695e-15,_0x49327c=_0x15c96e+twoPi;_0x240d81=(_0x191c91+_0x15c96e*_0x49efe8+_0x49327c*_0x56e79a+_0x387580*_0x387580*_0x1cf636)%twoPi,_0x240d81<0x0&&(_0x240d81+=twoPi);}else _0x240d81=gstime(_0x97d7de+2433281.5);return{'no':_0x24fd16,'method':_0x35cade,'ainv':_0x5d4909,'ao':_0x11dda3,'con41':_0x416730,'con42':_0x1fc3a5,'cosio':_0x597517,'cosio2':_0x4c9f45,'eccsq':_0x145e26,'omeosq':_0x3b0ca1,'posq':_0x58307b,'rp':_0x349463,'rteosq':_0x19c519,'sinio':_0x28b9fd,'gsto':_0x240d81};}function dspace(_0x7a0847){var _0x3bf93f=_0x8ca3,_0x585460=_0x7a0847['irez'],_0x54714f=_0x7a0847[_0x3bf93f(0x315)],_0x1f7590=_0x7a0847['d2211'],_0x4eb1d8=_0x7a0847[_0x3bf93f(0xff)],_0x48f676=_0x7a0847[_0x3bf93f(0x104)],_0x1cc57d=_0x7a0847[_0x3bf93f(0x310)],_0x4b7d61=_0x7a0847[_0x3bf93f(0x157)],_0x2eaada=_0x7a0847['d5220'],_0x1f1971=_0x7a0847[_0x3bf93f(0x12b)],_0xe21aea=_0x7a0847[_0x3bf93f(0x15c)],_0x335591=_0x7a0847['d5433'],_0x43fedf=_0x7a0847['dedt'],_0x5c65c5=_0x7a0847['del1'],_0xb8e009=_0x7a0847[_0x3bf93f(0x2b2)],_0x3db1bc=_0x7a0847['del3'],_0x43c19a=_0x7a0847[_0x3bf93f(0x150)],_0x8517ab=_0x7a0847[_0x3bf93f(0x2d4)],_0x3214c0=_0x7a0847[_0x3bf93f(0x1c5)],_0x5ce41f=_0x7a0847['domdt'],_0x10aaaa=_0x7a0847['argpo'],_0x2f8d1a=_0x7a0847[_0x3bf93f(0x159)],_0x44e385=_0x7a0847['t'],_0xe46e3c=_0x7a0847['tc'],_0x37a42e=_0x7a0847['gsto'],_0x4ad41a=_0x7a0847['xfact'],_0x15ed4d=_0x7a0847['xlamo'],_0x108c0a=_0x7a0847['no'],_0x8dbc52=_0x7a0847['atime'],_0x3d22cd=_0x7a0847['em'],_0xc34bd0=_0x7a0847['argpm'],_0x2a1905=_0x7a0847['inclm'],_0x460b7d=_0x7a0847['xli'],_0x5db7a9=_0x7a0847['mm'],_0x18ac68=_0x7a0847[_0x3bf93f(0x1c9)],_0x4190c7=_0x7a0847['nodem'],_0x5b28e2=_0x7a0847['nm'],_0x545050=0.13130908,_0x5d08a5=2.8843198,_0x575d8f=0.37448087,_0x14958c=5.7686396,_0x11af45=0.95240898,_0x4afe50=1.8014998,_0xdb169d=1.050833,_0x443086=4.4108898,_0x5ac2f8=0.0043752690880113,_0x3517b3=0x2d0,_0x791b0e=-0x2d0,_0x1471e2=0x3f480,_0x5aad8c,_0x24c2fe,_0x1be781,_0xd7f28d,_0x56b79b,_0x59cbee,_0x4b6ee0,_0x5ee327,_0x31d95b=0x0,_0x524960=0x0,_0x3390ed=(_0x37a42e+_0xe46e3c*_0x5ac2f8)%twoPi;_0x3d22cd+=_0x43fedf*_0x44e385,_0x2a1905+=_0x43c19a*_0x44e385,_0xc34bd0+=_0x5ce41f*_0x44e385,_0x4190c7+=_0x3214c0*_0x44e385,_0x5db7a9+=_0x8517ab*_0x44e385;if(_0x585460!==0x0){(_0x8dbc52===0x0||_0x44e385*_0x8dbc52<=0x0||Math['abs'](_0x44e385)0x0?_0x5aad8c=_0x3517b3:_0x5aad8c=_0x791b0e;var _0xd5aa44=0x17d;while(_0xd5aa44===0x17d){_0x585460!==0x2?(_0x4b6ee0=_0x5c65c5*Math['sin'](_0x460b7d-_0x545050)+_0xb8e009*Math['sin'](0x2*(_0x460b7d-_0x5d08a5))+_0x3db1bc*Math['sin'](0x3*(_0x460b7d-_0x575d8f)),_0x56b79b=_0x18ac68+_0x4ad41a,_0x59cbee=_0x5c65c5*Math['cos'](_0x460b7d-_0x545050)+0x2*_0xb8e009*Math[_0x3bf93f(0x1b8)](0x2*(_0x460b7d-_0x5d08a5))+0x3*_0x3db1bc*Math['cos'](0x3*(_0x460b7d-_0x575d8f)),_0x59cbee*=_0x56b79b):(_0x5ee327=_0x10aaaa+_0x2f8d1a*_0x8dbc52,_0x1be781=_0x5ee327+_0x5ee327,_0x24c2fe=_0x460b7d+_0x460b7d,_0x4b6ee0=_0x54714f*Math[_0x3bf93f(0x280)](_0x1be781+_0x460b7d-_0x14958c)+_0x1f7590*Math['sin'](_0x460b7d-_0x14958c)+_0x4eb1d8*Math['sin'](_0x5ee327+_0x460b7d-_0x11af45)+_0x48f676*Math['sin'](-_0x5ee327+_0x460b7d-_0x11af45)+_0x1cc57d*Math[_0x3bf93f(0x280)](_0x1be781+_0x24c2fe-_0x4afe50)+_0x4b7d61*Math['sin'](_0x24c2fe-_0x4afe50)+_0x2eaada*Math['sin'](_0x5ee327+_0x460b7d-_0xdb169d)+_0x1f1971*Math['sin'](-_0x5ee327+_0x460b7d-_0xdb169d)+_0xe21aea*Math[_0x3bf93f(0x280)](_0x5ee327+_0x24c2fe-_0x443086)+_0x335591*Math['sin'](-_0x5ee327+_0x24c2fe-_0x443086),_0x56b79b=_0x18ac68+_0x4ad41a,_0x59cbee=_0x54714f*Math[_0x3bf93f(0x1b8)](_0x1be781+_0x460b7d-_0x14958c)+_0x1f7590*Math['cos'](_0x460b7d-_0x14958c)+_0x4eb1d8*Math['cos'](_0x5ee327+_0x460b7d-_0x11af45)+_0x48f676*Math['cos'](-_0x5ee327+_0x460b7d-_0x11af45)+_0x2eaada*Math['cos'](_0x5ee327+_0x460b7d-_0xdb169d)+_0x1f1971*Math['cos'](-_0x5ee327+_0x460b7d-_0xdb169d)+0x2*_0x1cc57d*Math[_0x3bf93f(0x1b8)](_0x1be781+_0x24c2fe-_0x4afe50)+_0x4b7d61*Math['cos'](_0x24c2fe-_0x4afe50)+_0xe21aea*Math[_0x3bf93f(0x1b8)](_0x5ee327+_0x24c2fe-_0x443086)+_0x335591*Math[_0x3bf93f(0x1b8)](-_0x5ee327+_0x24c2fe-_0x443086),_0x59cbee*=_0x56b79b),Math['abs'](_0x44e385-_0x8dbc52)>=_0x3517b3?_0xd5aa44=0x17d:(_0x524960=_0x44e385-_0x8dbc52,_0xd5aa44=0x0),_0xd5aa44===0x17d&&(_0x460b7d+=_0x56b79b*_0x5aad8c+_0x4b6ee0*_0x1471e2,_0x18ac68+=_0x4b6ee0*_0x5aad8c+_0x59cbee*_0x1471e2,_0x8dbc52+=_0x5aad8c);}_0x5b28e2=_0x18ac68+_0x4b6ee0*_0x524960+_0x59cbee*_0x524960*_0x524960*0.5,_0xd7f28d=_0x460b7d+_0x56b79b*_0x524960+_0x4b6ee0*_0x524960*_0x524960*0.5,_0x585460!==0x1?(_0x5db7a9=_0xd7f28d-0x2*_0x4190c7+0x2*_0x3390ed,_0x31d95b=_0x5b28e2-_0x108c0a):(_0x5db7a9=_0xd7f28d-_0x4190c7-_0xc34bd0+_0x3390ed,_0x31d95b=_0x5b28e2-_0x108c0a),_0x5b28e2=_0x108c0a+_0x31d95b;}return{'atime':_0x8dbc52,'em':_0x3d22cd,'argpm':_0xc34bd0,'inclm':_0x2a1905,'xli':_0x460b7d,'mm':_0x5db7a9,'xni':_0x18ac68,'nodem':_0x4190c7,'dndt':_0x31d95b,'nm':_0x5b28e2};}function sgp4(_0xab8982,_0x15e763){var _0x1dd070=_0x8ca3,_0x2e4b36,_0x2d7172,_0x16d32c,_0x1b1419,_0x4d775e,_0x4cb740,_0xb66918,_0x3eff66,_0x242efb,_0x19b812,_0x43006b,_0x25c16b,_0x373ed7,_0x4fedb0,_0x288d8e,_0x18ab65,_0x532237,_0x33bc00,_0x331bac,_0x27e7f9,_0x640824,_0x6f7ba1,_0x3e2b22,_0x5477a9,_0x1d4ccd,_0x29e699,_0x3a65a6,_0x3a8b84=1.5e-12;_0xab8982['t']=_0x15e763,_0xab8982['error']=0x0;var _0x4d2c77=_0xab8982['mo']+_0xab8982[_0x1dd070(0x2ac)]*_0xab8982['t'],_0x592106=_0xab8982['argpo']+_0xab8982['argpdot']*_0xab8982['t'],_0x5430ec=_0xab8982['nodeo']+_0xab8982[_0x1dd070(0x21a)]*_0xab8982['t'];_0x242efb=_0x592106,_0x640824=_0x4d2c77;var _0x2b2cb2=_0xab8982['t']*_0xab8982['t'];_0x3e2b22=_0x5430ec+_0xab8982['nodecf']*_0x2b2cb2,_0x532237=0x1-_0xab8982['cc1']*_0xab8982['t'],_0x33bc00=_0xab8982[_0x1dd070(0xfc)]*_0xab8982[_0x1dd070(0x250)]*_0xab8982['t'],_0x331bac=_0xab8982['t2cof']*_0x2b2cb2;if(_0xab8982['isimp']!==0x1){_0xb66918=_0xab8982['omgcof']*_0xab8982['t'];var _0x287a19=0x1+_0xab8982[_0x1dd070(0x284)]*Math['cos'](_0x4d2c77);_0x4cb740=_0xab8982['xmcof']*(_0x287a19*_0x287a19*_0x287a19-_0xab8982['delmo']),_0x18ab65=_0xb66918+_0x4cb740,_0x640824=_0x4d2c77+_0x18ab65,_0x242efb=_0x592106-_0x18ab65,_0x25c16b=_0x2b2cb2*_0xab8982['t'],_0x373ed7=_0x25c16b*_0xab8982['t'],_0x532237=_0x532237-_0xab8982['d2']*_0x2b2cb2-_0xab8982['d3']*_0x25c16b-_0xab8982['d4']*_0x373ed7,_0x33bc00+=_0xab8982[_0x1dd070(0xfc)]*_0xab8982['cc5']*(Math[_0x1dd070(0x280)](_0x640824)-_0xab8982['sinmao']),_0x331bac=_0x331bac+_0xab8982['t3cof']*_0x25c16b+_0x373ed7*(_0xab8982['t4cof']+_0xab8982['t']*_0xab8982[_0x1dd070(0x2cf)]);}_0x6f7ba1=_0xab8982['no'];var _0x12ba4b=_0xab8982['ecco'];_0x27e7f9=_0xab8982[_0x1dd070(0x26a)];if(_0xab8982[_0x1dd070(0x1eb)]==='d'){_0x4fedb0=_0xab8982['t'];var _0x14d337={'irez':_0xab8982['irez'],'d2201':_0xab8982['d2201'],'d2211':_0xab8982['d2211'],'d3210':_0xab8982['d3210'],'d3222':_0xab8982['d3222'],'d4410':_0xab8982['d4410'],'d4422':_0xab8982[_0x1dd070(0x157)],'d5220':_0xab8982[_0x1dd070(0x309)],'d5232':_0xab8982['d5232'],'d5421':_0xab8982[_0x1dd070(0x15c)],'d5433':_0xab8982['d5433'],'dedt':_0xab8982['dedt'],'del1':_0xab8982['del1'],'del2':_0xab8982['del2'],'del3':_0xab8982['del3'],'didt':_0xab8982['didt'],'dmdt':_0xab8982[_0x1dd070(0x2d4)],'dnodt':_0xab8982['dnodt'],'domdt':_0xab8982['domdt'],'argpo':_0xab8982['argpo'],'argpdot':_0xab8982['argpdot'],'t':_0xab8982['t'],'tc':_0x4fedb0,'gsto':_0xab8982['gsto'],'xfact':_0xab8982['xfact'],'xlamo':_0xab8982['xlamo'],'no':_0xab8982['no'],'atime':_0xab8982['atime'],'em':_0x12ba4b,'argpm':_0x242efb,'inclm':_0x27e7f9,'xli':_0xab8982['xli'],'mm':_0x640824,'xni':_0xab8982[_0x1dd070(0x1c9)],'nodem':_0x3e2b22,'nm':_0x6f7ba1},_0xa9ef06=dspace(_0x14d337);_0x12ba4b=_0xa9ef06['em'],_0x242efb=_0xa9ef06['argpm'],_0x27e7f9=_0xa9ef06['inclm'],_0x640824=_0xa9ef06['mm'],_0x3e2b22=_0xa9ef06['nodem'],_0x6f7ba1=_0xa9ef06['nm'];}if(_0x6f7ba1<=0x0)return _0xab8982['error']=0x2,[![],![]];var _0x2fc941=Math[_0x1dd070(0x2ef)](xke/_0x6f7ba1,x2o3)*_0x532237*_0x532237;_0x6f7ba1=xke/Math[_0x1dd070(0x2ef)](_0x2fc941,1.5),_0x12ba4b-=_0x33bc00;if(_0x12ba4b>=0x1||_0x12ba4b<-0.001)return _0xab8982['error']=0x1,[![],![]];_0x12ba4b<0.000001&&(_0x12ba4b=0.000001);_0x640824+=_0xab8982['no']*_0x331bac,_0x1d4ccd=_0x640824+_0x242efb+_0x3e2b22,_0x3e2b22%=twoPi,_0x242efb%=twoPi,_0x1d4ccd%=twoPi,_0x640824=(_0x1d4ccd-_0x242efb-_0x3e2b22)%twoPi;var _0x31ae2e=Math[_0x1dd070(0x280)](_0x27e7f9),_0x1e15a2=Math['cos'](_0x27e7f9),_0x52e3ec=_0x12ba4b;_0x5477a9=_0x27e7f9,_0x19b812=_0x242efb,_0x3a65a6=_0x3e2b22,_0x29e699=_0x640824,_0x1b1419=_0x31ae2e,_0x16d32c=_0x1e15a2;if(_0xab8982['method']==='d'){var _0x3b092f={'inclo':_0xab8982['inclo'],'init':'n','ep':_0x52e3ec,'inclp':_0x5477a9,'nodep':_0x3a65a6,'argpp':_0x19b812,'mp':_0x29e699,'opsmode':_0xab8982['operationmode']},_0x10bacf=dpper(_0xab8982,_0x3b092f);_0x52e3ec=_0x10bacf['ep'],_0x3a65a6=_0x10bacf['nodep'],_0x19b812=_0x10bacf['argpp'],_0x29e699=_0x10bacf['mp'],_0x5477a9=_0x10bacf['inclp'];_0x5477a9<0x0&&(_0x5477a9=-_0x5477a9,_0x3a65a6+=pi,_0x19b812-=pi);if(_0x52e3ec<0x0||_0x52e3ec>0x1)return _0xab8982[_0x1dd070(0x2c3)]=0x3,[![],![]];}_0xab8982['method']==='d'&&(_0x1b1419=Math['sin'](_0x5477a9),_0x16d32c=Math['cos'](_0x5477a9),_0xab8982[_0x1dd070(0x13b)]=-0.5*j3oj2*_0x1b1419,Math['abs'](_0x16d32c+0x1)>1.5e-12?_0xab8982['xlcof']=-0.25*j3oj2*_0x1b1419*(0x3+0x5*_0x16d32c)/(0x1+_0x16d32c):_0xab8982['xlcof']=-0.25*j3oj2*_0x1b1419*(0x3+0x5*_0x16d32c)/_0x3a8b84);var _0x1e231a=_0x52e3ec*Math[_0x1dd070(0x1b8)](_0x19b812);_0x18ab65=0x1/(_0x2fc941*(0x1-_0x52e3ec*_0x52e3ec));var _0x51ff1a=_0x52e3ec*Math['sin'](_0x19b812)+_0x18ab65*_0xab8982['aycof'],_0x1a293d=_0x29e699+_0x19b812+_0x3a65a6+_0x18ab65*_0xab8982[_0x1dd070(0x1a0)]*_0x1e231a,_0x5d823b=(_0x1a293d-_0x3a65a6)%twoPi;_0x3eff66=_0x5d823b,_0x288d8e=9999.9;var _0x365893=0x1;while(Math['abs'](_0x288d8e)>=1e-12&&_0x365893<=0xa){_0x2d7172=Math[_0x1dd070(0x280)](_0x3eff66),_0x2e4b36=Math['cos'](_0x3eff66),_0x288d8e=0x1-_0x2e4b36*_0x1e231a-_0x2d7172*_0x51ff1a,_0x288d8e=(_0x5d823b-_0x51ff1a*_0x2e4b36+_0x1e231a*_0x2d7172-_0x3eff66)/_0x288d8e,Math['abs'](_0x288d8e)>=0.95&&(_0x288d8e>0x0?_0x288d8e=0.95:_0x288d8e=-0.95),_0x3eff66+=_0x288d8e,_0x365893+=0x1;}var _0x10ae97=_0x1e231a*_0x2e4b36+_0x51ff1a*_0x2d7172,_0x1e1537=_0x1e231a*_0x2d7172-_0x51ff1a*_0x2e4b36,_0x310d72=_0x1e231a*_0x1e231a+_0x51ff1a*_0x51ff1a,_0x5592bb=_0x2fc941*(0x1-_0x310d72);if(_0x5592bb<0x0)return _0xab8982['error']=0x4,[![],![]];var _0x4a02e=_0x2fc941*(0x1-_0x10ae97),_0x29fa10=Math['sqrt'](_0x2fc941)*_0x1e1537/_0x4a02e,_0x33bc63=Math['sqrt'](_0x5592bb)/_0x4a02e,_0x32b541=Math['sqrt'](0x1-_0x310d72);_0x18ab65=_0x1e1537/(0x1+_0x32b541);var _0x2d94bb=_0x2fc941/_0x4a02e*(_0x2d7172-_0x51ff1a-_0x1e231a*_0x18ab65),_0x3510d0=_0x2fc941/_0x4a02e*(_0x2e4b36-_0x1e231a+_0x51ff1a*_0x18ab65);_0x43006b=Math[_0x1dd070(0x298)](_0x2d94bb,_0x3510d0);var _0x1aea9d=(_0x3510d0+_0x3510d0)*_0x2d94bb,_0x52d05a=0x1-0x2*_0x2d94bb*_0x2d94bb;_0x18ab65=0x1/_0x5592bb;var _0x502b81=0.5*j2*_0x18ab65,_0x62c1ab=_0x502b81*_0x18ab65;_0xab8982['method']==='d'&&(_0x4d775e=_0x16d32c*_0x16d32c,_0xab8982['con41']=0x3*_0x4d775e-0x1,_0xab8982['x1mth2']=0x1-_0x4d775e,_0xab8982['x7thm1']=0x7*_0x4d775e-0x1);var _0x2ad311=_0x4a02e*(0x1-1.5*_0x62c1ab*_0x32b541*_0xab8982[_0x1dd070(0x152)])+0.5*_0x502b81*_0xab8982['x1mth2']*_0x52d05a;if(_0x2ad311<0x1)return _0xab8982['error']=0x6,{'position':![],'velocity':![]};_0x43006b-=0.25*_0x62c1ab*_0xab8982['x7thm1']*_0x1aea9d;var _0x52f50d=_0x3a65a6+1.5*_0x62c1ab*_0x16d32c*_0x1aea9d,_0x32264c=_0x5477a9+1.5*_0x62c1ab*_0x16d32c*_0x1b1419*_0x52d05a,_0x31c68e=_0x29fa10-_0x6f7ba1*_0x502b81*_0xab8982[_0x1dd070(0x221)]*_0x1aea9d/xke,_0x3d871c=_0x33bc63+_0x6f7ba1*_0x502b81*(_0xab8982['x1mth2']*_0x52d05a+1.5*_0xab8982['con41'])/xke,_0x4dfe6d=Math['sin'](_0x43006b),_0x1f7fb0=Math['cos'](_0x43006b),_0x361ed6=Math['sin'](_0x52f50d),_0x47029d=Math[_0x1dd070(0x1b8)](_0x52f50d),_0x2c2106=Math['sin'](_0x32264c),_0x576db8=Math['cos'](_0x32264c),_0x57082e=-_0x361ed6*_0x576db8,_0x57f389=_0x47029d*_0x576db8,_0x20f979=_0x57082e*_0x4dfe6d+_0x47029d*_0x1f7fb0,_0x3ed13b=_0x57f389*_0x4dfe6d+_0x361ed6*_0x1f7fb0,_0x2da987=_0x2c2106*_0x4dfe6d,_0x41e1e6=_0x57082e*_0x1f7fb0-_0x47029d*_0x4dfe6d,_0x4040b3=_0x57f389*_0x1f7fb0-_0x361ed6*_0x4dfe6d,_0x366c9b=_0x2c2106*_0x1f7fb0,_0x13ab85={'x':_0x2ad311*_0x20f979*earthRadius,'y':_0x2ad311*_0x3ed13b*earthRadius,'z':_0x2ad311*_0x2da987*earthRadius},_0x51ff30={'x':(_0x31c68e*_0x20f979+_0x3d871c*_0x41e1e6)*vkmpersec,'y':(_0x31c68e*_0x3ed13b+_0x3d871c*_0x4040b3)*vkmpersec,'z':(_0x31c68e*_0x2da987+_0x3d871c*_0x366c9b)*vkmpersec};return{'position':_0x13ab85,'velocity':_0x51ff30};}function sgp4init(_0x529d38,_0x43ca7a){var _0x477c0c=_0x8ca3,_0x5b151e=_0x43ca7a['opsmode'],_0x12b829=_0x43ca7a['satn'],_0x357996=_0x43ca7a[_0x477c0c(0x285)],_0x4b1e33=_0x43ca7a[_0x477c0c(0x172)],_0x1b8589=_0x43ca7a['xecco'],_0x277ac9=_0x43ca7a['xargpo'],_0xcb7dc9=_0x43ca7a['xinclo'],_0x49b5e7=_0x43ca7a[_0x477c0c(0x153)],_0x1aeef8=_0x43ca7a['xno'],_0x15f662=_0x43ca7a['xnodeo'],_0x1b8880,_0x205c35,_0x4d0ba5,_0x49d3ac,_0x4a6985,_0x3add76,_0x2607ff,_0x162264,_0x108e93,_0x19fbad,_0x453852,_0x232d0a,_0x4fc21f,_0x5666f1,_0x13ac58,_0x28a5e9,_0x45baa5,_0x141ae5,_0x38ec10,_0x390c76,_0x57e6d1,_0x2890bf,_0x4a43a1,_0x136280,_0x5e1416,_0x38f7d4,_0x505427,_0x21e073,_0x3488a3,_0x39262e,_0x1abe45,_0x21849c,_0xb6aae5,_0x4f545c,_0x582630,_0x548379,_0x8c71df,_0x1632d3,_0x45dedf,_0x3fd896,_0x1e8f50,_0x35e7ff,_0x29fdff,_0x5c2363,_0x48c505,_0x40879e,_0x260873,_0x4c5b1b,_0x23be2b,_0x213ab7,_0x553b23,_0x39d057,_0x42d264,_0x40c4c6,_0x227e62,_0x652e7c,_0x4b48f7=1.5e-12;_0x529d38['isimp']=0x0,_0x529d38['method']='n',_0x529d38['aycof']=0x0,_0x529d38['con41']=0x0,_0x529d38['cc1']=0x0,_0x529d38['cc4']=0x0,_0x529d38[_0x477c0c(0x2ce)]=0x0,_0x529d38['d2']=0x0,_0x529d38['d3']=0x0,_0x529d38['d4']=0x0,_0x529d38[_0x477c0c(0x197)]=0x0,_0x529d38[_0x477c0c(0x284)]=0x0,_0x529d38['argpdot']=0x0,_0x529d38['omgcof']=0x0,_0x529d38[_0x477c0c(0x30a)]=0x0,_0x529d38['t']=0x0,_0x529d38['t2cof']=0x0,_0x529d38['t3cof']=0x0,_0x529d38[_0x477c0c(0x2f9)]=0x0,_0x529d38[_0x477c0c(0x2cf)]=0x0,_0x529d38[_0x477c0c(0x221)]=0x0,_0x529d38['x7thm1']=0x0,_0x529d38['mdot']=0x0,_0x529d38['nodedot']=0x0,_0x529d38[_0x477c0c(0x1a0)]=0x0,_0x529d38['xmcof']=0x0,_0x529d38['nodecf']=0x0,_0x529d38['irez']=0x0,_0x529d38['d2201']=0x0,_0x529d38['d2211']=0x0,_0x529d38['d3210']=0x0,_0x529d38['d3222']=0x0,_0x529d38[_0x477c0c(0x310)]=0x0,_0x529d38['d4422']=0x0,_0x529d38['d5220']=0x0,_0x529d38['d5232']=0x0,_0x529d38['d5421']=0x0,_0x529d38['d5433']=0x0,_0x529d38['dedt']=0x0,_0x529d38[_0x477c0c(0x210)]=0x0,_0x529d38['del2']=0x0,_0x529d38[_0x477c0c(0x17d)]=0x0,_0x529d38[_0x477c0c(0x150)]=0x0,_0x529d38[_0x477c0c(0x2d4)]=0x0,_0x529d38['dnodt']=0x0,_0x529d38['domdt']=0x0,_0x529d38['e3']=0x0,_0x529d38['ee2']=0x0,_0x529d38[_0x477c0c(0x2c6)]=0x0,_0x529d38['pgho']=0x0,_0x529d38['pho']=0x0,_0x529d38['pinco']=0x0,_0x529d38['plo']=0x0,_0x529d38['se2']=0x0,_0x529d38['se3']=0x0,_0x529d38['sgh2']=0x0,_0x529d38[_0x477c0c(0x273)]=0x0,_0x529d38['sgh4']=0x0,_0x529d38['sh2']=0x0,_0x529d38['sh3']=0x0,_0x529d38['si2']=0x0,_0x529d38[_0x477c0c(0x1a7)]=0x0,_0x529d38['sl2']=0x0,_0x529d38['sl3']=0x0,_0x529d38[_0x477c0c(0x29c)]=0x0,_0x529d38['gsto']=0x0,_0x529d38['xfact']=0x0,_0x529d38[_0x477c0c(0x106)]=0x0,_0x529d38[_0x477c0c(0x1f5)]=0x0,_0x529d38['xgh4']=0x0,_0x529d38['xh2']=0x0,_0x529d38['xh3']=0x0,_0x529d38['xi2']=0x0,_0x529d38[_0x477c0c(0x2d6)]=0x0,_0x529d38[_0x477c0c(0x14d)]=0x0,_0x529d38[_0x477c0c(0x187)]=0x0,_0x529d38['xl4']=0x0,_0x529d38[_0x477c0c(0x22e)]=0x0,_0x529d38['zmol']=0x0,_0x529d38['zmos']=0x0,_0x529d38[_0x477c0c(0x2cd)]=0x0,_0x529d38['xli']=0x0,_0x529d38['xni']=0x0,_0x529d38[_0x477c0c(0xfc)]=_0x4b1e33,_0x529d38['ecco']=_0x1b8589,_0x529d38['argpo']=_0x277ac9,_0x529d38['inclo']=_0xcb7dc9,_0x529d38['mo']=_0x49b5e7,_0x529d38['no']=_0x1aeef8,_0x529d38['nodeo']=_0x15f662,_0x529d38['operationmode']=_0x5b151e;var _0x3c1b3f=0x4e/earthRadius+0x1,_0x104118=(0x78-0x4e)/earthRadius,_0x3d97b5=_0x104118*_0x104118*_0x104118*_0x104118;_0x529d38['init']='y',_0x529d38['t']=0x0;var _0x3b3798={'satn':_0x12b829,'ecco':_0x529d38['ecco'],'epoch':_0x357996,'inclo':_0x529d38[_0x477c0c(0x26a)],'no':_0x529d38['no'],'method':_0x529d38[_0x477c0c(0x1eb)],'opsmode':_0x529d38[_0x477c0c(0x177)]},_0x1116ef=initl(_0x3b3798),_0x5d2dea=_0x1116ef['ao'],_0x447cff=_0x1116ef['con42'],_0x1d2793=_0x1116ef['cosio'],_0x34d3f1=_0x1116ef[_0x477c0c(0x279)],_0x5554d8=_0x1116ef['eccsq'],_0x2076e3=_0x1116ef['omeosq'],_0x3434cc=_0x1116ef[_0x477c0c(0x17b)],_0x22af4e=_0x1116ef['rp'],_0x13e2cb=_0x1116ef['rteosq'],_0xe5cd81=_0x1116ef[_0x477c0c(0x2cb)];_0x529d38['no']=_0x1116ef['no'],_0x529d38['con41']=_0x1116ef['con41'],_0x529d38[_0x477c0c(0x2c2)]=_0x1116ef[_0x477c0c(0x2c2)],_0x529d38['error']=0x0;if(_0x2076e3>=0x0||_0x529d38['no']>=0x0){_0x529d38['isimp']=0x0;_0x22af4e<0xdc/earthRadius+0x1&&(_0x529d38['isimp']=0x1);_0x505427=_0x3c1b3f,_0x57e6d1=_0x3d97b5,_0x141ae5=(_0x22af4e-0x1)*earthRadius;if(_0x141ae5<0x9c){_0x505427=_0x141ae5-0x4e;_0x141ae5<0x62&&(_0x505427=0x14);var _0x1cc6e4=(0x78-_0x505427)/earthRadius;_0x57e6d1=_0x1cc6e4*_0x1cc6e4*_0x1cc6e4*_0x1cc6e4,_0x505427=_0x505427/earthRadius+0x1;}_0x38ec10=0x1/_0x3434cc,_0x40879e=0x1/(_0x5d2dea-_0x505427),_0x529d38[_0x477c0c(0x284)]=_0x5d2dea*_0x529d38['ecco']*_0x40879e,_0x232d0a=_0x529d38[_0x477c0c(0x284)]*_0x529d38['eta'],_0x453852=_0x529d38[_0x477c0c(0x13a)]*_0x529d38['eta'],_0x390c76=Math[_0x477c0c(0x11e)](0x1-_0x232d0a),_0x3add76=_0x57e6d1*Math['pow'](_0x40879e,0x4),_0x2607ff=_0x3add76/Math['pow'](_0x390c76,3.5),_0x49d3ac=_0x2607ff*_0x529d38['no']*(_0x5d2dea*(0x1+1.5*_0x232d0a+_0x453852*(0x4+_0x232d0a))+0.375*j2*_0x40879e/_0x390c76*_0x529d38[_0x477c0c(0x152)]*(0x8+0x3*_0x232d0a*(0x8+_0x232d0a))),_0x529d38[_0x477c0c(0x180)]=_0x529d38['bstar']*_0x49d3ac,_0x4a6985=0x0;_0x529d38[_0x477c0c(0x13a)]>0.0001&&(_0x4a6985=-0x2*_0x3add76*_0x40879e*j3oj2*_0x529d38['no']*_0xe5cd81/_0x529d38['ecco']);_0x529d38['x1mth2']=0x1-_0x34d3f1,_0x529d38['cc4']=0x2*_0x529d38['no']*_0x2607ff*_0x5d2dea*_0x2076e3*(_0x529d38['eta']*(0x2+0.5*_0x232d0a)+_0x529d38['ecco']*(0.5+0x2*_0x232d0a)-j2*_0x40879e/(_0x5d2dea*_0x390c76)*(-0x3*_0x529d38['con41']*(0x1-0x2*_0x453852+_0x232d0a*(1.5-0.5*_0x453852))+0.75*_0x529d38['x1mth2']*(0x2*_0x232d0a-_0x453852*(0x1+_0x232d0a))*Math[_0x477c0c(0x1b8)](0x2*_0x529d38['argpo']))),_0x529d38['cc5']=0x2*_0x2607ff*_0x5d2dea*_0x2076e3*(0x1+2.75*(_0x232d0a+_0x453852)+_0x453852*_0x232d0a),_0x162264=_0x34d3f1*_0x34d3f1,_0x29fdff=1.5*j2*_0x38ec10*_0x529d38['no'],_0x5c2363=0.5*_0x29fdff*j2*_0x38ec10,_0x48c505=-0.46875*j4*_0x38ec10*_0x38ec10*_0x529d38['no'],_0x529d38['mdot']=_0x529d38['no']+0.5*_0x29fdff*_0x13e2cb*_0x529d38['con41']+0.0625*_0x5c2363*_0x13e2cb*(0xd-0x4e*_0x34d3f1+0x89*_0x162264),_0x529d38['argpdot']=-0.5*_0x29fdff*_0x447cff+0.0625*_0x5c2363*(0x7-0x72*_0x34d3f1+0x18b*_0x162264)+_0x48c505*(0x3-0x24*_0x34d3f1+0x31*_0x162264),_0x4c5b1b=-_0x29fdff*_0x1d2793,_0x529d38[_0x477c0c(0x21a)]=_0x4c5b1b+(0.5*_0x5c2363*(0x4-0x13*_0x34d3f1)+0x2*_0x48c505*(0x3-0x7*_0x34d3f1))*_0x1d2793,_0x260873=_0x529d38['argpdot']+_0x529d38['nodedot'],_0x529d38['omgcof']=_0x529d38['bstar']*_0x4a6985*Math['cos'](_0x529d38['argpo']),_0x529d38['xmcof']=0x0;_0x529d38['ecco']>0.0001&&(_0x529d38[_0x477c0c(0x1f8)]=-x2o3*_0x3add76*_0x529d38['bstar']/_0x453852);_0x529d38['nodecf']=3.5*_0x2076e3*_0x4c5b1b*_0x529d38['cc1'],_0x529d38[_0x477c0c(0x22b)]=1.5*_0x529d38['cc1'];Math['abs'](_0x1d2793+0x1)>1.5e-12?_0x529d38[_0x477c0c(0x1a0)]=-0.25*j3oj2*_0xe5cd81*(0x3+0x5*_0x1d2793)/(0x1+_0x1d2793):_0x529d38['xlcof']=-0.25*j3oj2*_0xe5cd81*(0x3+0x5*_0x1d2793)/_0x4b48f7;_0x529d38[_0x477c0c(0x13b)]=-0.5*j3oj2*_0xe5cd81;var _0x9ff34f=0x1+_0x529d38['eta']*Math['cos'](_0x529d38['mo']);_0x529d38['delmo']=_0x9ff34f*_0x9ff34f*_0x9ff34f,_0x529d38['sinmao']=Math['sin'](_0x529d38['mo']),_0x529d38[_0x477c0c(0x12e)]=0x7*_0x34d3f1-0x1;if(0x2*pi/_0x529d38['no']>=0xe1){_0x529d38[_0x477c0c(0x1eb)]='d',_0x529d38['isimp']=0x1,_0x1e8f50=0x0,_0x13ac58=_0x529d38['inclo'];var _0x4ca009={'epoch':_0x357996,'ep':_0x529d38['ecco'],'argpp':_0x529d38[_0x477c0c(0x2e7)],'tc':_0x1e8f50,'inclp':_0x529d38['inclo'],'nodep':_0x529d38['nodeo'],'np':_0x529d38['no'],'e3':_0x529d38['e3'],'ee2':_0x529d38['ee2'],'peo':_0x529d38['peo'],'pgho':_0x529d38[_0x477c0c(0x295)],'pho':_0x529d38['pho'],'pinco':_0x529d38['pinco'],'plo':_0x529d38['plo'],'se2':_0x529d38['se2'],'se3':_0x529d38['se3'],'sgh2':_0x529d38['sgh2'],'sgh3':_0x529d38[_0x477c0c(0x273)],'sgh4':_0x529d38[_0x477c0c(0x189)],'sh2':_0x529d38['sh2'],'sh3':_0x529d38['sh3'],'si2':_0x529d38['si2'],'si3':_0x529d38[_0x477c0c(0x1a7)],'sl2':_0x529d38['sl2'],'sl3':_0x529d38[_0x477c0c(0x292)],'sl4':_0x529d38['sl4'],'xgh2':_0x529d38['xgh2'],'xgh3':_0x529d38['xgh3'],'xgh4':_0x529d38['xgh4'],'xh2':_0x529d38[_0x477c0c(0x268)],'xh3':_0x529d38['xh3'],'xi2':_0x529d38['xi2'],'xi3':_0x529d38['xi3'],'xl2':_0x529d38['xl2'],'xl3':_0x529d38['xl3'],'xl4':_0x529d38['xl4'],'zmol':_0x529d38['zmol'],'zmos':_0x529d38['zmos']},_0x2e5864=dscom(_0x4ca009);_0x529d38['e3']=_0x2e5864['e3'],_0x529d38['ee2']=_0x2e5864[_0x477c0c(0x1d7)],_0x529d38['peo']=_0x2e5864['peo'],_0x529d38['pgho']=_0x2e5864['pgho'],_0x529d38['pho']=_0x2e5864['pho'],_0x529d38['pinco']=_0x2e5864[_0x477c0c(0x107)],_0x529d38[_0x477c0c(0x203)]=_0x2e5864['plo'],_0x529d38['se2']=_0x2e5864['se2'],_0x529d38['se3']=_0x2e5864['se3'],_0x529d38[_0x477c0c(0x2e1)]=_0x2e5864['sgh2'],_0x529d38['sgh3']=_0x2e5864['sgh3'],_0x529d38['sgh4']=_0x2e5864[_0x477c0c(0x189)],_0x529d38['sh2']=_0x2e5864['sh2'],_0x529d38['sh3']=_0x2e5864['sh3'],_0x529d38[_0x477c0c(0x170)]=_0x2e5864['si2'],_0x529d38[_0x477c0c(0x1a7)]=_0x2e5864['si3'],_0x529d38['sl2']=_0x2e5864['sl2'],_0x529d38['sl3']=_0x2e5864['sl3'],_0x529d38['sl4']=_0x2e5864['sl4'],_0x205c35=_0x2e5864['sinim'],_0x1b8880=_0x2e5864['cosim'],_0x108e93=_0x2e5864['em'],_0x19fbad=_0x2e5864['emsq'],_0x2890bf=_0x2e5864['s1'],_0x4a43a1=_0x2e5864['s2'],_0x136280=_0x2e5864['s3'],_0x5e1416=_0x2e5864['s4'],_0x38f7d4=_0x2e5864['s5'],_0x21e073=_0x2e5864[_0x477c0c(0x120)],_0x3488a3=_0x2e5864['ss2'],_0x39262e=_0x2e5864['ss3'],_0x1abe45=_0x2e5864['ss4'],_0x21849c=_0x2e5864['ss5'],_0xb6aae5=_0x2e5864['sz1'],_0x4f545c=_0x2e5864[_0x477c0c(0x212)],_0x582630=_0x2e5864[_0x477c0c(0x30c)],_0x548379=_0x2e5864['sz13'],_0x8c71df=_0x2e5864[_0x477c0c(0x281)],_0x1632d3=_0x2e5864['sz23'],_0x45dedf=_0x2e5864[_0x477c0c(0x311)],_0x3fd896=_0x2e5864[_0x477c0c(0x2d3)],_0x529d38['xgh2']=_0x2e5864[_0x477c0c(0x106)],_0x529d38['xgh3']=_0x2e5864['xgh3'],_0x529d38[_0x477c0c(0x312)]=_0x2e5864['xgh4'],_0x529d38['xh2']=_0x2e5864['xh2'],_0x529d38[_0x477c0c(0x225)]=_0x2e5864['xh3'],_0x529d38['xi2']=_0x2e5864[_0x477c0c(0x19a)],_0x529d38['xi3']=_0x2e5864['xi3'],_0x529d38[_0x477c0c(0x14d)]=_0x2e5864['xl2'],_0x529d38[_0x477c0c(0x187)]=_0x2e5864['xl3'],_0x529d38['xl4']=_0x2e5864['xl4'],_0x529d38['zmol']=_0x2e5864['zmol'],_0x529d38['zmos']=_0x2e5864['zmos'],_0x45baa5=_0x2e5864['nm'],_0x23be2b=_0x2e5864['z1'],_0x213ab7=_0x2e5864['z3'],_0x553b23=_0x2e5864['z11'],_0x39d057=_0x2e5864['z13'],_0x42d264=_0x2e5864['z21'],_0x40c4c6=_0x2e5864['z23'],_0x227e62=_0x2e5864['z31'],_0x652e7c=_0x2e5864['z33'];var _0x800242={'inclo':_0x13ac58,'init':_0x529d38['init'],'ep':_0x529d38[_0x477c0c(0x13a)],'inclp':_0x529d38[_0x477c0c(0x26a)],'nodep':_0x529d38['nodeo'],'argpp':_0x529d38[_0x477c0c(0x2e7)],'mp':_0x529d38['mo'],'opsmode':_0x529d38['operationmode']},_0x13ba7e=dpper(_0x529d38,_0x800242);_0x529d38['ecco']=_0x13ba7e['ep'],_0x529d38['inclo']=_0x13ba7e[_0x477c0c(0x1a4)],_0x529d38['nodeo']=_0x13ba7e['nodep'],_0x529d38['argpo']=_0x13ba7e['argpp'],_0x529d38['mo']=_0x13ba7e['mp'],_0x4fc21f=0x0,_0x5666f1=0x0,_0x28a5e9=0x0;var _0x4c446c={'cosim':_0x1b8880,'emsq':_0x19fbad,'argpo':_0x529d38[_0x477c0c(0x2e7)],'s1':_0x2890bf,'s2':_0x4a43a1,'s3':_0x136280,'s4':_0x5e1416,'s5':_0x38f7d4,'sinim':_0x205c35,'ss1':_0x21e073,'ss2':_0x3488a3,'ss3':_0x39262e,'ss4':_0x1abe45,'ss5':_0x21849c,'sz1':_0xb6aae5,'sz3':_0x4f545c,'sz11':_0x582630,'sz13':_0x548379,'sz21':_0x8c71df,'sz23':_0x1632d3,'sz31':_0x45dedf,'sz33':_0x3fd896,'t':_0x529d38['t'],'tc':_0x1e8f50,'gsto':_0x529d38[_0x477c0c(0x2c2)],'mo':_0x529d38['mo'],'mdot':_0x529d38[_0x477c0c(0x2ac)],'no':_0x529d38['no'],'nodeo':_0x529d38['nodeo'],'nodedot':_0x529d38['nodedot'],'xpidot':_0x260873,'z1':_0x23be2b,'z3':_0x213ab7,'z11':_0x553b23,'z13':_0x39d057,'z21':_0x42d264,'z23':_0x40c4c6,'z31':_0x227e62,'z33':_0x652e7c,'ecco':_0x529d38[_0x477c0c(0x13a)],'eccsq':_0x5554d8,'em':_0x108e93,'argpm':_0x4fc21f,'inclm':_0x13ac58,'mm':_0x28a5e9,'nm':_0x45baa5,'nodem':_0x5666f1,'irez':_0x529d38['irez'],'atime':_0x529d38['atime'],'d2201':_0x529d38['d2201'],'d2211':_0x529d38['d2211'],'d3210':_0x529d38[_0x477c0c(0xff)],'d3222':_0x529d38['d3222'],'d4410':_0x529d38['d4410'],'d4422':_0x529d38[_0x477c0c(0x157)],'d5220':_0x529d38['d5220'],'d5232':_0x529d38['d5232'],'d5421':_0x529d38[_0x477c0c(0x15c)],'d5433':_0x529d38['d5433'],'dedt':_0x529d38['dedt'],'didt':_0x529d38['didt'],'dmdt':_0x529d38[_0x477c0c(0x2d4)],'dnodt':_0x529d38['dnodt'],'domdt':_0x529d38['domdt'],'del1':_0x529d38[_0x477c0c(0x210)],'del2':_0x529d38['del2'],'del3':_0x529d38['del3'],'xfact':_0x529d38['xfact'],'xlamo':_0x529d38[_0x477c0c(0x22e)],'xli':_0x529d38['xli'],'xni':_0x529d38['xni']},_0x7aef2b=dsinit(_0x4c446c);_0x529d38['irez']=_0x7aef2b['irez'],_0x529d38[_0x477c0c(0x2cd)]=_0x7aef2b['atime'],_0x529d38[_0x477c0c(0x315)]=_0x7aef2b[_0x477c0c(0x315)],_0x529d38[_0x477c0c(0x2c7)]=_0x7aef2b[_0x477c0c(0x2c7)],_0x529d38[_0x477c0c(0xff)]=_0x7aef2b['d3210'],_0x529d38['d3222']=_0x7aef2b['d3222'],_0x529d38['d4410']=_0x7aef2b[_0x477c0c(0x310)],_0x529d38['d4422']=_0x7aef2b['d4422'],_0x529d38['d5220']=_0x7aef2b[_0x477c0c(0x309)],_0x529d38['d5232']=_0x7aef2b['d5232'],_0x529d38['d5421']=_0x7aef2b['d5421'],_0x529d38['d5433']=_0x7aef2b['d5433'],_0x529d38['dedt']=_0x7aef2b[_0x477c0c(0x204)],_0x529d38['didt']=_0x7aef2b['didt'],_0x529d38['dmdt']=_0x7aef2b['dmdt'],_0x529d38['dnodt']=_0x7aef2b['dnodt'],_0x529d38['domdt']=_0x7aef2b['domdt'],_0x529d38[_0x477c0c(0x210)]=_0x7aef2b[_0x477c0c(0x210)],_0x529d38[_0x477c0c(0x2b2)]=_0x7aef2b['del2'],_0x529d38['del3']=_0x7aef2b[_0x477c0c(0x17d)],_0x529d38[_0x477c0c(0x181)]=_0x7aef2b['xfact'],_0x529d38[_0x477c0c(0x22e)]=_0x7aef2b[_0x477c0c(0x22e)],_0x529d38['xli']=_0x7aef2b[_0x477c0c(0x24e)],_0x529d38['xni']=_0x7aef2b[_0x477c0c(0x1c9)];}_0x529d38['isimp']!==0x1&&(_0x4d0ba5=_0x529d38['cc1']*_0x529d38['cc1'],_0x529d38['d2']=0x4*_0x5d2dea*_0x40879e*_0x4d0ba5,_0x35e7ff=_0x529d38['d2']*_0x40879e*_0x529d38[_0x477c0c(0x180)]/0x3,_0x529d38['d3']=(0x11*_0x5d2dea+_0x505427)*_0x35e7ff,_0x529d38['d4']=0.5*_0x35e7ff*_0x5d2dea*_0x40879e*(0xdd*_0x5d2dea+0x1f*_0x505427)*_0x529d38['cc1'],_0x529d38[_0x477c0c(0x21c)]=_0x529d38['d2']+0x2*_0x4d0ba5,_0x529d38['t4cof']=0.25*(0x3*_0x529d38['d3']+_0x529d38['cc1']*(0xc*_0x529d38['d2']+0xa*_0x4d0ba5)),_0x529d38[_0x477c0c(0x2cf)]=0.2*(0x3*_0x529d38['d4']+0xc*_0x529d38['cc1']*_0x529d38['d3']+0x6*_0x529d38['d2']*_0x529d38['d2']+0xf*_0x4d0ba5*(0x2*_0x529d38['d2']+_0x4d0ba5)));}sgp4(_0x529d38,0x0),_0x529d38['init']='n';}function twoline2satrec(_0x3bdfc2,_0x58db25){var _0x3d4afd=_0x8ca3,_0x3000b9='i',_0x356a6a=0x5a0/(0x2*pi),_0x48171e=0x0,_0x17ef94={};_0x17ef94['error']=0x0,_0x17ef94['satnum']=_0x3bdfc2['substring'](0x2,0x7),_0x17ef94[_0x3d4afd(0x320)]=parseInt(_0x3bdfc2['substring'](0x12,0x14),0xa),_0x17ef94[_0x3d4afd(0x2dc)]=parseFloat(_0x3bdfc2['substring'](0x14,0x20)),_0x17ef94[_0x3d4afd(0x122)]=parseFloat(_0x3bdfc2['substring'](0x21,0x2b)),_0x17ef94['nddot']=parseFloat('.'[_0x3d4afd(0x27d)](parseInt(_0x3bdfc2['substring'](0x2c,0x32),0xa),'E')['concat'](_0x3bdfc2[_0x3d4afd(0x1ed)](0x32,0x34))),_0x17ef94[_0x3d4afd(0xfc)]=parseFloat(''[_0x3d4afd(0x27d)](_0x3bdfc2[_0x3d4afd(0x1ed)](0x35,0x36),'.')['concat'](parseInt(_0x3bdfc2['substring'](0x36,0x3b),0xa),'E')[_0x3d4afd(0x27d)](_0x3bdfc2[_0x3d4afd(0x1ed)](0x3b,0x3d))),_0x17ef94['inclo']=parseFloat(_0x58db25['substring'](0x8,0x10)),_0x17ef94[_0x3d4afd(0x30b)]=parseFloat(_0x58db25['substring'](0x11,0x19)),_0x17ef94['ecco']=parseFloat('.'['concat'](_0x58db25['substring'](0x1a,0x21))),_0x17ef94['argpo']=parseFloat(_0x58db25[_0x3d4afd(0x1ed)](0x22,0x2a)),_0x17ef94['mo']=parseFloat(_0x58db25['substring'](0x2b,0x33)),_0x17ef94['no']=parseFloat(_0x58db25['substring'](0x34,0x3f)),_0x17ef94['no']/=_0x356a6a,_0x17ef94['a']=Math[_0x3d4afd(0x2ef)](_0x17ef94['no']*tumin,-0x2/0x3),_0x17ef94['ndot']/=_0x356a6a*0x5a0,_0x17ef94['nddot']/=_0x356a6a*0x5a0*0x5a0,_0x17ef94['inclo']*=deg2rad,_0x17ef94['nodeo']*=deg2rad,_0x17ef94['argpo']*=deg2rad,_0x17ef94['mo']*=deg2rad,_0x17ef94[_0x3d4afd(0x324)]=_0x17ef94['a']*(0x1+_0x17ef94[_0x3d4afd(0x13a)])-0x1,_0x17ef94[_0x3d4afd(0x10e)]=_0x17ef94['a']*(0x1-_0x17ef94['ecco'])-0x1;_0x17ef94[_0x3d4afd(0x320)]<0x39?_0x48171e=_0x17ef94['epochyr']+0x7d0:_0x48171e=_0x17ef94['epochyr']+0x76c;var _0x57d467=days2mdhms(_0x48171e,_0x17ef94['epochdays']),_0x3d3974=_0x57d467['mon'],_0x5d1551=_0x57d467['day'],_0x498c84=_0x57d467['hr'],_0x5a5212=_0x57d467['minute'],_0x5e3993=_0x57d467['sec'];return _0x17ef94['jdsatepoch']=jday(_0x48171e,_0x3d3974,_0x5d1551,_0x498c84,_0x5a5212,_0x5e3993),sgp4init(_0x17ef94,{'opsmode':_0x3000b9,'satn':_0x17ef94['satnum'],'epoch':_0x17ef94['jdsatepoch']-2433281.5,'xbstar':_0x17ef94[_0x3d4afd(0xfc)],'xecco':_0x17ef94['ecco'],'xargpo':_0x17ef94[_0x3d4afd(0x2e7)],'xinclo':_0x17ef94['inclo'],'xmo':_0x17ef94['mo'],'xno':_0x17ef94['no'],'xnodeo':_0x17ef94[_0x3d4afd(0x30b)]}),_0x17ef94;}function _toConsumableArray(_0x441734){return _arrayWithoutHoles(_0x441734)||_iterableToArray(_0x441734)||_unsupportedIterableToArray(_0x441734)||_nonIterableSpread();}function _arrayWithoutHoles(_0x4adec3){var _0x3636d7=_0x8ca3;if(Array[_0x3636d7(0x171)](_0x4adec3))return _arrayLikeToArray(_0x4adec3);}function _iterableToArray(_0x5a3e48){var _0x50f285=_0x8ca3;if(typeof Symbol!==_0x50f285(0x15f)&&Symbol['iterator']in Object(_0x5a3e48))return Array['from'](_0x5a3e48);}function _unsupportedIterableToArray(_0x5c0de0,_0x51007c){var _0x2be8b1=_0x8ca3;if(!_0x5c0de0)return;if(typeof _0x5c0de0===_0x2be8b1(0x194))return _arrayLikeToArray(_0x5c0de0,_0x51007c);var _0x50d496=Object[_0x2be8b1(0x14a)]['toString']['call'](_0x5c0de0)['slice'](0x8,-0x1);if(_0x50d496==='Object'&&_0x5c0de0[_0x2be8b1(0x2a4)])_0x50d496=_0x5c0de0[_0x2be8b1(0x2a4)][_0x2be8b1(0x2a7)];if(_0x50d496==='Map'||_0x50d496===_0x2be8b1(0x121))return Array['from'](_0x5c0de0);if(_0x50d496==='Arguments'||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/[_0x2be8b1(0x1b6)](_0x50d496))return _arrayLikeToArray(_0x5c0de0,_0x51007c);}function _arrayLikeToArray(_0x2818ed,_0x5c9e83){if(_0x5c9e83==null||_0x5c9e83>_0x2818ed['length'])_0x5c9e83=_0x2818ed['length'];for(var _0x2fb855=0x0,_0x27dc03=new Array(_0x5c9e83);_0x2fb855<_0x5c9e83;_0x2fb855++)_0x27dc03[_0x2fb855]=_0x2818ed[_0x2fb855];return _0x27dc03;}function _nonIterableSpread(){throw new TypeError('Invalid\x20attempt\x20to\x20spread\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.');}function propagate(){var _0x2fda15=_0x8ca3;for(var _0x2e9172=arguments[_0x2fda15(0x31f)],_0x50d8a6=new Array(_0x2e9172),_0x50a5e0=0x0;_0x50a5e0<_0x2e9172;_0x50a5e0++){_0x50d8a6[_0x50a5e0]=arguments[_0x50a5e0];}var _0x383f29=_0x50d8a6[0x0],_0x61bbb7=Array['prototype'][_0x2fda15(0x23a)][_0x2fda15(0x2a1)](_0x50d8a6,0x1),_0x55f5d7=jday['apply'](void 0x0,_toConsumableArray(_0x61bbb7)),_0x475747=(_0x55f5d7-_0x383f29[_0x2fda15(0x2d7)])*minutesPerDay;return sgp4(_0x383f29,_0x475747);}function dopplerFactor(_0xc011c2,_0x30ec00,_0x26a4a9){var _0x27d515=_0x8ca3,_0x109011=0.00007292115,_0x29b7a7=299792.458,_0x2344b9={'x':_0x30ec00['x']-_0xc011c2['x'],'y':_0x30ec00['y']-_0xc011c2['y'],'z':_0x30ec00['z']-_0xc011c2['z']};_0x2344b9['w']=Math['sqrt'](Math[_0x27d515(0x2ef)](_0x2344b9['x'],0x2)+Math['pow'](_0x2344b9['y'],0x2)+Math[_0x27d515(0x2ef)](_0x2344b9['z'],0x2));var _0x110b4e={'x':_0x26a4a9['x']+_0x109011*_0xc011c2['y'],'y':_0x26a4a9['y']-_0x109011*_0xc011c2['x'],'z':_0x26a4a9['z']};function _0x52b0ac(_0xcef448){return _0xcef448>=0x0?0x1:-0x1;}var _0x35e22a=(_0x2344b9['x']*_0x110b4e['x']+_0x2344b9['y']*_0x110b4e['y']+_0x2344b9['z']*_0x110b4e['z'])/_0x2344b9['w'];return 0x1+_0x35e22a/_0x29b7a7*_0x52b0ac(_0x35e22a);}function radiansToDegrees(_0x132819){return _0x132819*rad2deg;}function degreesToRadians(_0x1da55c){return _0x1da55c*deg2rad;}function degreesLat(_0x49f484){var _0x190e4b=_0x8ca3;if(_0x49f484<-pi/0x2||_0x49f484>pi/0x2)throw new RangeError(_0x190e4b(0x1d4));return radiansToDegrees(_0x49f484);}function degreesLong(_0x3647dc){var _0x455aea=_0x8ca3;if(_0x3647dc<-pi||_0x3647dc>pi)throw new RangeError(_0x455aea(0x1e3));return radiansToDegrees(_0x3647dc);}function radiansLat(_0x12ddd3){var _0x229197=_0x8ca3;if(_0x12ddd3<-0x5a||_0x12ddd3>0x5a)throw new RangeError(_0x229197(0x25f));return degreesToRadians(_0x12ddd3);}function radiansLong(_0x1d45f2){if(_0x1d45f2<-0xb4||_0x1d45f2>0xb4)throw new RangeError('Longitude\x20degrees\x20must\x20be\x20in\x20range\x20[-180;\x20180].');return degreesToRadians(_0x1d45f2);}function geodeticToEcf(_0x3d9edb){var _0x4d2538=_0x8ca3,_0x3a1947=_0x3d9edb['longitude'],_0x1de9a7=_0x3d9edb[_0x4d2538(0x14f)],_0x32dde2=_0x3d9edb['height'],_0x5ae23e=6378.137,_0x392258=6356.7523142,_0x3b1f1b=(_0x5ae23e-_0x392258)/_0x5ae23e,_0x391458=0x2*_0x3b1f1b-_0x3b1f1b*_0x3b1f1b,_0x5e10e4=_0x5ae23e/Math['sqrt'](0x1-_0x391458*(Math[_0x4d2538(0x280)](_0x1de9a7)*Math[_0x4d2538(0x280)](_0x1de9a7))),_0x476c82=(_0x5e10e4+_0x32dde2)*Math['cos'](_0x1de9a7)*Math['cos'](_0x3a1947),_0x37dde2=(_0x5e10e4+_0x32dde2)*Math['cos'](_0x1de9a7)*Math['sin'](_0x3a1947),_0x993554=(_0x5e10e4*(0x1-_0x391458)+_0x32dde2)*Math['sin'](_0x1de9a7);return{'x':_0x476c82,'y':_0x37dde2,'z':_0x993554};}function eciToGeodetic(_0x9732e1,_0x10a073){var _0x5add87=_0x8ca3,_0x40c0e5=6378.137,_0x16c377=6356.7523142,_0x258d5c=Math['sqrt'](_0x9732e1['x']*_0x9732e1['x']+_0x9732e1['y']*_0x9732e1['y']),_0x1fc43d=(_0x40c0e5-_0x16c377)/_0x40c0e5,_0x17487e=0x2*_0x1fc43d-_0x1fc43d*_0x1fc43d,_0x9a40d0=Math['atan2'](_0x9732e1['y'],_0x9732e1['x'])-_0x10a073;while(_0x9a40d0<-pi){_0x9a40d0+=twoPi;}while(_0x9a40d0>pi){_0x9a40d0-=twoPi;}var _0x2f6468=0x14,_0x1023d5=0x0,_0x5c269a=Math[_0x5add87(0x298)](_0x9732e1['z'],Math['sqrt'](_0x9732e1['x']*_0x9732e1['x']+_0x9732e1['y']*_0x9732e1['y'])),_0x4c5852;while(_0x1023d5<_0x2f6468){_0x4c5852=0x1/Math['sqrt'](0x1-_0x17487e*(Math['sin'](_0x5c269a)*Math[_0x5add87(0x280)](_0x5c269a))),_0x5c269a=Math['atan2'](_0x9732e1['z']+_0x40c0e5*_0x4c5852*_0x17487e*Math[_0x5add87(0x280)](_0x5c269a),_0x258d5c),_0x1023d5+=0x1;}var _0xca8d01=_0x258d5c/Math['cos'](_0x5c269a)-_0x40c0e5*_0x4c5852;return{'longitude':_0x9a40d0,'latitude':_0x5c269a,'height':_0xca8d01};}function ecfToEci(_0x2d7fdf,_0x490ec7){var _0x18aaa1=_0x8ca3,_0x2c77c2=_0x2d7fdf['x']*Math['cos'](_0x490ec7)-_0x2d7fdf['y']*Math[_0x18aaa1(0x280)](_0x490ec7),_0x1ab432=_0x2d7fdf['x']*Math['sin'](_0x490ec7)+_0x2d7fdf['y']*Math['cos'](_0x490ec7),_0x54bd54=_0x2d7fdf['z'];return{'x':_0x2c77c2,'y':_0x1ab432,'z':_0x54bd54};}function eciToEcf(_0x20d4e3,_0x5748ea){var _0x588647=_0x8ca3,_0x2d740f=_0x20d4e3['x']*Math[_0x588647(0x1b8)](_0x5748ea)+_0x20d4e3['y']*Math[_0x588647(0x280)](_0x5748ea),_0x5dd3e6=_0x20d4e3['x']*-Math[_0x588647(0x280)](_0x5748ea)+_0x20d4e3['y']*Math['cos'](_0x5748ea),_0x1dd2c7=_0x20d4e3['z'];return{'x':_0x2d740f,'y':_0x5dd3e6,'z':_0x1dd2c7};}function topocentric(_0x3bcde1,_0x351838){var _0x3e086f=_0x8ca3,_0xedd85d=_0x3bcde1[_0x3e086f(0x31a)],_0xb76d5a=_0x3bcde1['latitude'],_0x10a976=geodeticToEcf(_0x3bcde1),_0x11ed99=_0x351838['x']-_0x10a976['x'],_0x3a6901=_0x351838['y']-_0x10a976['y'],_0xff1c9e=_0x351838['z']-_0x10a976['z'],_0x45041c=Math[_0x3e086f(0x280)](_0xb76d5a)*Math['cos'](_0xedd85d)*_0x11ed99+Math[_0x3e086f(0x280)](_0xb76d5a)*Math['sin'](_0xedd85d)*_0x3a6901-Math[_0x3e086f(0x1b8)](_0xb76d5a)*_0xff1c9e,_0x19e5f9=-Math[_0x3e086f(0x280)](_0xedd85d)*_0x11ed99+Math['cos'](_0xedd85d)*_0x3a6901,_0x3c5b3e=Math[_0x3e086f(0x1b8)](_0xb76d5a)*Math['cos'](_0xedd85d)*_0x11ed99+Math[_0x3e086f(0x1b8)](_0xb76d5a)*Math[_0x3e086f(0x280)](_0xedd85d)*_0x3a6901+Math['sin'](_0xb76d5a)*_0xff1c9e;return{'topS':_0x45041c,'topE':_0x19e5f9,'topZ':_0x3c5b3e};}function topocentricToLookAngles(_0x54d97c){var _0x1cc4f1=_0x8ca3,_0xb7e9d1=_0x54d97c[_0x1cc4f1(0x1a9)],_0x53ad8e=_0x54d97c['topE'],_0x5e5e5c=_0x54d97c['topZ'],_0x45c1c8=Math[_0x1cc4f1(0x25a)](_0xb7e9d1*_0xb7e9d1+_0x53ad8e*_0x53ad8e+_0x5e5e5c*_0x5e5e5c),_0x566c53=Math['asin'](_0x5e5e5c/_0x45c1c8),_0x44c5a2=Math['atan2'](-_0x53ad8e,_0xb7e9d1)+pi;return{'azimuth':_0x44c5a2,'elevation':_0x566c53,'rangeSat':_0x45c1c8};}function ecfToLookAngles(_0x9acb01,_0x2ed480){var _0x1cac77=topocentric(_0x9acb01,_0x2ed480);return topocentricToLookAngles(_0x1cac77);}var satellite_es={'__proto__':null,'constants':constants,'degreesLat':degreesLat,'degreesLong':degreesLong,'degreesToRadians':degreesToRadians,'dopplerFactor':dopplerFactor,'ecfToEci':ecfToEci,'ecfToLookAngles':ecfToLookAngles,'eciToEcf':eciToEcf,'eciToGeodetic':eciToGeodetic,'geodeticToEcf':geodeticToEcf,'gstime':gstime,'invjday':invjday,'jday':jday,'propagate':propagate,'radiansLat':radiansLat,'radiansLong':radiansLong,'radiansToDegrees':radiansToDegrees,'sgp4':sgp4,'twoline2satrec':twoline2satrec},require$$0=getAugmentedNamespace(satellite_es);(function(_0x1697a7,_0x28fa3c){(function(_0x4c398e,_0x4140d2){_0x4140d2(_0x28fa3c,require$$0);}(commonjsGlobal,function(_0x5d5dab,_0x5a9918){var _0x34ba48=_0x8ca3;const _0xfb2e93=0x5265c00,_0x3b060a=0x3e8,_0x2eb92d=0xea60,_0x5d2493={'_INT':Symbol(),'_FLOAT':Symbol(),'_CHAR':Symbol(),'_DECIMAL_ASSUMED':Symbol(),'_DECIMAL_ASSUMED_E':Symbol()},_0x22e16c={'_ARRAY':'array','_STRING':'string','_OBJECT':'object','_DATE':_0x34ba48(0x133),'_NAN':_0x34ba48(0x251)};function _0x4990b2(_0x198d44){var _0x42c1f9=_0x34ba48;const _0x12e361=typeof _0x198d44;if(Array['isArray'](_0x198d44))return _0x22e16c[_0x42c1f9(0x249)];if(_0x198d44 instanceof Date)return _0x22e16c['_DATE'];if(Number['isNaN'](_0x198d44))return _0x22e16c['_NAN'];return _0x12e361;}const _0x43835f=_0x12d6a3=>_0x12d6a3>=0x0,_0xef636d=_0x44a4f2=>{var _0x259e49=_0x34ba48;const _0x2ee85b=Math['abs'](_0x44a4f2);return _0x2ee85b['toString']()[_0x259e49(0x31f)];},_0x54cc8d=_0x4aefc2=>{var _0x139cea=_0x34ba48;const _0x47468d=_0xef636d(_0x4aefc2),_0x1df318='0'[_0x139cea(0x23c)](_0x47468d-0x1);return parseFloat(_0x4aefc2*('0.'+_0x1df318+'1'));},_0x46a560=_0x4bd8d8=>{var _0x12a878=_0x34ba48;const _0x8e5f03=_0x4bd8d8[_0x12a878(0x30f)](0x0,_0x4bd8d8['length']-0x2),_0x349ab0=_0x54cc8d(_0x8e5f03),_0x564b9a=parseInt(_0x4bd8d8['substr'](_0x4bd8d8[_0x12a878(0x31f)]-0x2,0x2),0xa),_0x325f76=_0x349ab0*Math['pow'](0xa,_0x564b9a);return parseFloat(_0x325f76['toPrecision'](0x5));},_0x201391=(_0x584a5a,_0x56fe4f=new Date()[_0x34ba48(0x1a5)]())=>{const _0x25bcbf=new Date('1/1/'+_0x56fe4f+'\x200:0:0\x20Z'),_0x3c56fe=_0x25bcbf['getTime']();return Math['floor'](_0x3c56fe+(_0x584a5a-0x1)*_0xfb2e93);},_0x28e9f2=_0xd483cd=>_0xd483cd*(0xb4/Math['PI']),_0x36ffb9=_0x33d3cb=>_0x33d3cb*(Math['PI']/0xb4),_0x405df6=(_0x3624b9,_0x272423)=>{if(!_0x3624b9||!_0x272423)return![];const _0x3e9f5a=_0x43835f(_0x3624b9),_0x33fc72=_0x43835f(_0x272423),_0x3ef580=_0x3e9f5a===_0x33fc72;if(_0x3ef580)return![];const _0x3daacc=Math['abs'](_0x3624b9)>0x64;return _0x3daacc;};function _0x2d75c4(_0x50e84a){const _0x101827=parseInt(_0x50e84a,0xa);return _0x101827<0x64&&_0x101827>0x38?_0x101827+0x76c:_0x101827+0x7d0;}function _0x710378(_0x110d50,_0xad4c8b,_0x27f660){var _0x3aac85=_0x34ba48;const {tle:_0x49cd72}=_0x110d50,_0x22fa2a=_0xad4c8b===0x1?_0x49cd72[0x0]:_0x49cd72[0x1],{start:_0x1e8c1d,length:_0x5dd0e7,type:_0x2df93d}=_0x27f660,_0x16955b=_0x22fa2a['substr'](_0x1e8c1d,_0x5dd0e7);let _0x536b06;switch(_0x2df93d){case _0x5d2493['_INT']:_0x536b06=parseInt(_0x16955b,0xa);break;case _0x5d2493['_FLOAT']:_0x536b06=parseFloat(_0x16955b);break;case _0x5d2493['_DECIMAL_ASSUMED']:_0x536b06=parseFloat('0.'+_0x16955b);break;case _0x5d2493['_DECIMAL_ASSUMED_E']:_0x536b06=_0x46a560(_0x16955b);break;case _0x5d2493[_0x3aac85(0x19f)]:default:_0x536b06=_0x16955b['trim']();break;}return _0x536b06;}const _0x530e4b=_0x246467=>Object['keys'](_0x246467)['length'],_0x502b2c={'_TYPE':(_0x4e879e='',_0x362516=[],_0x1fb31c='')=>_0x4e879e+'\x20must\x20be\x20of\x20type\x20['+_0x362516['join'](',\x20')+_0x34ba48(0x18e)+_0x1fb31c+'.','_NOT_PARSED_OBJECT':'Input\x20object\x20is\x20malformed\x20(should\x20have\x20name\x20and\x20tle\x20properties).'};function _0xa82ae5(_0x1b014c){var _0x5f212b=_0x34ba48;return typeof _0x1b014c===_0x22e16c['_OBJECT']&&_0x1b014c['tle']&&_0x4990b2(_0x1b014c[_0x5f212b(0x132)])===_0x22e16c['_ARRAY']&&_0x1b014c['tle'][_0x5f212b(0x31f)]===0x2;}const _0x42d6ad=(_0x2aaa13,_0x2de2e9)=>{if(_0x2aaa13===_0x22e16c['_ARRAY'])return _0x2de2e9['length']===0x3?_0x2de2e9[0x1]:_0x2de2e9[0x0];return _0x2de2e9;};let _0x4019ea={};const _0x132b0c=()=>_0x4019ea={},_0x3ec26d=[_0x22e16c[_0x34ba48(0x249)],_0x22e16c[_0x34ba48(0x1ee)],_0x22e16c['_OBJECT']];function _0x513795(_0x4c0158,_0xe8786c=!![]){var _0x2904be=_0x34ba48;const _0x47b2f3=_0x4990b2(_0x4c0158),_0x5e3400={};let _0xe67645=[];const _0x2fc2b6=_0xa82ae5(_0x4c0158);if(_0x2fc2b6)return _0x4c0158;const _0x4d97ef=!_0x2fc2b6&&_0x47b2f3===_0x22e16c['_OBJECT'];if(_0x4d97ef)throw new Error(_0x502b2c['_NOT_PARSED_OBJECT']);const _0x1f1a17=_0x42d6ad(_0x47b2f3,_0x4c0158);if(_0x4019ea[_0x1f1a17])return _0x4019ea[_0x1f1a17];if(!_0x3ec26d['includes'](_0x47b2f3))throw new Error(_0x502b2c['_TYPE']('Source\x20TLE',_0x3ec26d,_0x47b2f3));if(_0x47b2f3===_0x22e16c['_STRING'])_0xe67645=_0x4c0158['split']('\x0a');else _0x47b2f3===_0x22e16c['_ARRAY']&&(_0xe67645=Array['from'](_0x4c0158));if(_0xe67645['length']===0x3){let _0xeb96f3=_0xe67645[0x0][_0x2904be(0xf2)]();_0xe67645=_0xe67645[_0x2904be(0x23a)](0x1),_0xeb96f3['startsWith']('0\x20')&&(_0xeb96f3=_0xeb96f3['substr'](0x2)),_0x5e3400[_0x2904be(0x2a7)]=_0xeb96f3;}_0x5e3400['tle']=_0xe67645['map'](_0x58a612=>_0x58a612[_0x2904be(0xf2)]());if(!_0xe8786c){const _0x485781=_0x520194(_0x5e3400['tle']);!_0x485781&&(_0x5e3400['error']='TLE\x20parse\x20error:\x20bad\x20TLE');}return _0x4019ea[_0x1f1a17]=_0x5e3400,_0x5e3400;}function _0x52c494(_0x5520e0){var _0x5202bf=_0x34ba48;const _0x18a7b4=_0x5520e0['split']('');_0x18a7b4['splice'](_0x18a7b4['length']-0x1,0x1);if(_0x18a7b4['length']===0x0)throw new Error(_0x5202bf(0x287),_0x5520e0);const _0x4cd98a=_0x18a7b4['reduce']((_0xbd1ce4,_0x3e6132)=>{const _0x4b590d=parseInt(_0x3e6132,0xa),_0x52a3dc=parseInt(_0xbd1ce4,0xa);if(Number['isInteger'](_0x4b590d))return _0x52a3dc+_0x4b590d;if(_0x3e6132==='-')return _0x52a3dc+0x1;return _0x52a3dc;},0x0);return _0x4cd98a%0xa;}function _0x8ea3ef(_0x29dab9,_0xf25b6b){const {tle:_0x17cfc3}=_0x29dab9;return _0xf25b6b===parseInt(_0x17cfc3[_0xf25b6b-0x1][0x0],0xa);}function _0x5cc13c(_0xee5e92,_0x4c962e){const {tle:_0x35817d}=_0xee5e92,_0x5f0fe8=_0x35817d[_0x4c962e-0x1],_0x597f23=parseInt(_0x5f0fe8[_0x5f0fe8['length']-0x1],0xa),_0x2a1069=_0x52c494(_0x35817d[_0x4c962e-0x1]);return _0x2a1069===_0x597f23;}function _0x520194(_0x52dc3d){let _0x28174c;try{_0x28174c=_0x513795(_0x52dc3d);}catch(_0x2d25f9){return![];}const _0x52771c=_0x8ea3ef(_0x28174c,0x1),_0x56547f=_0x8ea3ef(_0x28174c,0x2);if(!_0x52771c||!_0x56547f)return![];const _0x22dc46=_0x5cc13c(_0x28174c,0x1),_0x2957b5=_0x5cc13c(_0x28174c,0x2);if(!_0x22dc46||!_0x2957b5)return![];return!![];}const _0x5f1e2f={'start':0x0,'length':0x1,'type':_0x5d2493['_INT']},_0x5ceca8={'start':0x2,'length':0x5,'type':_0x5d2493[_0x34ba48(0x139)]},_0x17c37f={'start':0x7,'length':0x1,'type':_0x5d2493[_0x34ba48(0x19f)]},_0x1a1619={'start':0x9,'length':0x2,'type':_0x5d2493['_INT']},_0x2e4c52={'start':0xb,'length':0x3,'type':_0x5d2493['_INT']},_0x1b63f1={'start':0xe,'length':0x3,'type':_0x5d2493[_0x34ba48(0x19f)]},_0x187356={'start':0x12,'length':0x2,'type':_0x5d2493['_INT']},_0xbc1d85={'start':0x14,'length':0xc,'type':_0x5d2493[_0x34ba48(0x2c8)]},_0xb8de84={'start':0x21,'length':0xb,'type':_0x5d2493['_FLOAT']},_0x2942d3={'start':0x2c,'length':0x8,'type':_0x5d2493['_DECIMAL_ASSUMED_E']},_0xbaf6bb={'start':0x35,'length':0x8,'type':_0x5d2493['_DECIMAL_ASSUMED_E']},_0x580d3e={'start':0x3e,'length':0x1,'type':_0x5d2493['_INT']},_0x634683={'start':0x40,'length':0x4,'type':_0x5d2493['_INT']},_0x45a6e1={'start':0x44,'length':0x1,'type':_0x5d2493['_INT']};function _0x5a3345(_0x11a343,_0x69599d,_0x286a8e=![]){const _0x55d69f=_0x286a8e?_0x11a343:_0x513795(_0x11a343);return _0x710378(_0x55d69f,0x1,_0x69599d);}function _0x1ca95f(_0xf49d7d,_0x28258){return _0x5a3345(_0xf49d7d,_0x5f1e2f,_0x28258);}function _0x38cc2f(_0x29e915,_0x33bc08){return _0x5a3345(_0x29e915,_0x5ceca8,_0x33bc08);}function _0x2ec901(_0x4ad5c7,_0x229e66){return _0x5a3345(_0x4ad5c7,_0x17c37f,_0x229e66);}function _0x135e33(_0x5d54cb,_0x391b37){return _0x5a3345(_0x5d54cb,_0x1a1619,_0x391b37);}function _0x3d5952(_0x102281,_0x27c821){return _0x5a3345(_0x102281,_0x2e4c52,_0x27c821);}function _0x46c1b7(_0x295ee4,_0x2ec704){return _0x5a3345(_0x295ee4,_0x1b63f1,_0x2ec704);}function _0x41436e(_0x3759b8,_0x214e39){return _0x5a3345(_0x3759b8,_0x187356,_0x214e39);}function _0x30f710(_0x3dcc5d,_0x42577b){return _0x5a3345(_0x3dcc5d,_0xbc1d85,_0x42577b);}function _0x1b1acc(_0x258d32,_0x582731){return _0x5a3345(_0x258d32,_0xb8de84,_0x582731);}function _0x221623(_0x2af8fb,_0x4894aa){return _0x5a3345(_0x2af8fb,_0x2942d3,_0x4894aa);}function _0x12ac5e(_0x29a615,_0x1b7873){return _0x5a3345(_0x29a615,_0xbaf6bb,_0x1b7873);}function _0x489fa0(_0x23c8c3,_0xdf7567){return _0x5a3345(_0x23c8c3,_0x580d3e,_0xdf7567);}function _0xba47c(_0x1fb09c,_0x3d0eea){return _0x5a3345(_0x1fb09c,_0x634683,_0x3d0eea);}function _0x43e8cd(_0x42efec,_0x51866b){return _0x5a3345(_0x42efec,_0x45a6e1,_0x51866b);}const _0x111cda={'start':0x0,'length':0x1,'type':_0x5d2493['_INT']},_0x46cf1e={'start':0x2,'length':0x5,'type':_0x5d2493['_INT']},_0x56b51e={'start':0x8,'length':0x8,'type':_0x5d2493['_FLOAT']},_0x505471={'start':0x11,'length':0x8,'type':_0x5d2493[_0x34ba48(0x2c8)]},_0x18d72f={'start':0x1a,'length':0x7,'type':_0x5d2493['_DECIMAL_ASSUMED']},_0x59b079={'start':0x22,'length':0x8,'type':_0x5d2493['_FLOAT']},_0x4bfdc1={'start':0x2b,'length':0x8,'type':_0x5d2493['_FLOAT']},_0x5496b1={'start':0x34,'length':0xb,'type':_0x5d2493[_0x34ba48(0x2c8)]},_0x398355={'start':0x3f,'length':0x5,'type':_0x5d2493['_INT']},_0x25c6d9={'start':0x44,'length':0x1,'type':_0x5d2493['_INT']};function _0x114544(_0x583912,_0x433d74,_0x36be1a=![]){const _0x23f55b=_0x36be1a?_0x583912:_0x513795(_0x583912);return _0x710378(_0x23f55b,0x2,_0x433d74);}function _0x39de22(_0x1d2459,_0x10f9dc){return _0x114544(_0x1d2459,_0x111cda,_0x10f9dc);}function _0x170c44(_0x2a9fc1,_0x43fcd4){return _0x114544(_0x2a9fc1,_0x46cf1e,_0x43fcd4);}function _0x3803f6(_0xac0940,_0x488373){return _0x114544(_0xac0940,_0x56b51e,_0x488373);}function _0x266bde(_0x13f5da,_0x2cf971){return _0x114544(_0x13f5da,_0x505471,_0x2cf971);}function _0x46a294(_0x3ef6dd,_0x3ce09b){return _0x114544(_0x3ef6dd,_0x18d72f,_0x3ce09b);}function _0x4b740c(_0x4c249b,_0x42be3a){return _0x114544(_0x4c249b,_0x59b079,_0x42be3a);}function _0x14fd78(_0x18b62d,_0x36dd36){return _0x114544(_0x18b62d,_0x4bfdc1,_0x36dd36);}function _0x2c84c9(_0x3c2e3e,_0x23d6ba){return _0x114544(_0x3c2e3e,_0x5496b1,_0x23d6ba);}function _0x47f197(_0x345134,_0xcfce65){return _0x114544(_0x345134,_0x398355,_0xcfce65);}function _0x514430(_0x438562,_0x5efee8){return _0x114544(_0x438562,_0x25c6d9,_0x5efee8);}function _0x46cd14(_0x106944,_0x108251){const _0x54165b=_0x135e33(_0x106944,_0x108251),_0x4b7588=_0x2d75c4(_0x54165b),_0x130be0=_0x3d5952(_0x106944,_0x108251),_0x2bd5dd=_0x130be0['toString']()['padStart'](0x3,0x0),_0x39d68c=_0x46c1b7(_0x106944,_0x108251);return _0x4b7588+'-'+_0x2bd5dd+_0x39d68c;}function _0x3abe97(_0x400e8c,_0x274ef7=![]){const _0x502c25=_0x513795(_0x400e8c),{name:_0x45a855}=_0x502c25;return _0x274ef7?_0x45a855||_0x46cd14(_0x502c25,!![]):_0x45a855||'Unknown';}function _0x63b0c4(_0x484285){const _0x506ff6=_0x30f710(_0x484285),_0x3c9d9c=_0x41436e(_0x484285);return _0x201391(_0x506ff6,_0x3c9d9c);}function _0x434fe3(_0x3da263){return parseInt(_0xfb2e93/_0x2c84c9(_0x3da263),0xa);}function _0x7f846e(_0x1e6566){return _0x434fe3(_0x1e6566)/_0x2eb92d;}function _0xeb10cc(_0x2d99dc){return _0x434fe3(_0x2d99dc)/_0x3b060a;}const _0x2901e0={'_DEFAULT':'Problematic\x20TLE\x20with\x20unknown\x20error.',0x1:'Mean\x20elements,\x20ecc\x20>=\x201.0\x20or\x20ecc\x20<\x20-0.001\x20or\x20a\x20<\x200.95\x20er',0x2:_0x34ba48(0x17f),0x3:'Pert\x20elements,\x20ecc\x20<\x200.0\x20\x20or\x20\x20ecc\x20>\x201.0',0x4:'Semi-latus\x20rectum\x20<\x200.0',0x5:'Epoch\x20elements\x20are\x20sub-orbital',0x6:_0x34ba48(0x2da)};let _0xd8adf2={},_0x27450a={},_0x5f3d9c={},_0x5c4cdc={};const _0x488ecd=[_0xd8adf2,_0x27450a,_0x5f3d9c,_0x5c4cdc];function _0x264d8e(){var _0x23f58a=_0x34ba48;return _0x488ecd[_0x23f58a(0x231)](_0x530e4b);}function _0x395e67(){_0x488ecd['forEach']((_0x59ab67,_0x49ba39)=>{_0x488ecd[_0x49ba39]={};});}function _0x409408(_0x11879f,_0x18cfd2,_0x1a248e,_0xf5986e,_0x147af8){var _0x285836=_0x34ba48;const _0x12f34f=_0x18cfd2||Date['now'](),{tle:_0x13d8cf,error:_0x4fbe70}=_0x513795(_0x11879f);if(_0x4fbe70)throw new Error(_0x4fbe70);const _0x3985dd={'lat':36.9613422,'lng':-122.0308,'height':0.37},_0x35395a=_0x1a248e||_0x3985dd['lat'],_0x549c7b=_0xf5986e||_0x3985dd['lng'],_0x511e78=_0x147af8||_0x3985dd['height'],_0x567512=_0x13d8cf[0x0]+'-'+_0x12f34f+'-'+_0x1a248e+'-'+_0xf5986e+'\x0a-'+_0x147af8;if(_0xd8adf2[_0x567512])return _0xd8adf2[_0x567512];const _0x479c77=_0x5a9918[_0x285836(0x317)](_0x13d8cf[0x0],_0x13d8cf[0x1]);if(_0x479c77['error'])throw new Error(_0x2901e0[_0x479c77['error']]||_0x2901e0['_DEFAULT']);const _0x45ae0d=new Date(_0x12f34f),_0x270b46=_0x5a9918['propagate'](_0x479c77,_0x45ae0d),_0x4afd3f=_0x270b46['position'],_0x150b45=_0x270b46['velocity'],_0x3dd47f={'latitude':_0x36ffb9(_0x35395a),'longitude':_0x36ffb9(_0x549c7b),'height':_0x511e78},_0x58d3b7=_0x5a9918['gstime'](_0x45ae0d),_0x65b946=_0x5a9918['eciToEcf'](_0x4afd3f,_0x58d3b7),_0x79ccff=_0x5a9918['eciToGeodetic'](_0x4afd3f,_0x58d3b7),_0x73b382=_0x5a9918[_0x285836(0x18d)](_0x3dd47f,_0x65b946),_0x519e02=Math[_0x285836(0x25a)](Math[_0x285836(0x2ef)](_0x150b45['x'],0x2)+Math['pow'](_0x150b45['y'],0x2)+Math[_0x285836(0x2ef)](_0x150b45['z'],0x2)),{azimuth:_0x2a34e1,elevation:_0x1e9fff,rangeSat:_0x45ad08}=_0x73b382,{longitude:_0x30ca22,latitude:_0x1064bf,height:_0x54aaf3}=_0x79ccff,_0x499799={'lng':_0x5a9918['degreesLong'](_0x30ca22),'lat':_0x5a9918[_0x285836(0x2f2)](_0x1064bf),'elevation':_0x28e9f2(_0x1e9fff),'azimuth':_0x28e9f2(_0x2a34e1),'range':_0x45ad08,'height':_0x54aaf3,'velocity':_0x519e02};return _0xd8adf2[_0x567512]=_0x499799,_0x499799;}function _0x4050c7(_0x3b0a9e,_0x8acf0f){var _0x8fc787=_0x34ba48;const {tle:_0x4e4f8d}=_0x3b0a9e,_0x288700=_0x7f846e(_0x4e4f8d)*0x3c*0x3e8,_0x16fda4=_0x4e4f8d[0x0][_0x8fc787(0x30f)](0x0,0x1e),_0x887972=_0x27450a[_0x16fda4];if(!_0x887972)return![];if(_0x887972===-0x1)return _0x887972;const _0x342090=_0x887972['filter'](_0x388b6a=>{if(typeof _0x388b6a==='object'&&_0x388b6a['tle']===_0x4e4f8d)return-0x1;const _0x3c2187=_0x8acf0f-_0x388b6a,_0x258acf=_0x3c2187>0x0,_0x41c330=_0x258acf&&_0x3c2187<_0x288700;return _0x41c330;});return _0x342090[0x0]||![];}function _0x150760(_0x17980b,_0x4b45b3){const _0x2093d9=_0x513795(_0x17980b),{tle:_0x3b5be1}=_0x2093d9,_0x32d36c=_0x4050c7(_0x2093d9,_0x4b45b3);if(_0x32d36c)return _0x32d36c;const _0x5a2042=_0x4b45b3||Date['now']();let _0x1ba965=0x3e8*0x3c*0x3,_0x56e8be=[],_0x3a1b37=[],_0x54623f=_0x5a2042,_0x3b7249=![],_0x397bc5=0x0,_0x5e5ced=![];const _0x25685b=0x3e8;while(!_0x5e5ced){_0x56e8be=_0x570ff0(_0x3b5be1,_0x54623f);const [_0x4cd4a4]=_0x56e8be;_0x3b7249=_0x405df6(_0x3a1b37[0x0],_0x4cd4a4),_0x3b7249?(_0x54623f+=_0x1ba965,_0x1ba965=_0x1ba965/0x2):(_0x54623f-=_0x1ba965,_0x3a1b37=_0x56e8be),_0x5e5ced=_0x1ba965<0x1f4||_0x397bc5>=_0x25685b,_0x397bc5++;}const _0x50b5c2=_0x397bc5-0x1===_0x25685b,_0x5bfb2b=_0x50b5c2?-0x1:parseInt(_0x54623f,0xa),_0x52bca7=_0x3b5be1[0x0];return!_0x27450a[_0x52bca7]&&(_0x27450a[_0x52bca7]=[]),_0x50b5c2?_0x27450a[_0x52bca7]=-0x1:_0x27450a[_0x52bca7]['push'](_0x5bfb2b),_0x5bfb2b;}function _0x5807a9(_0x55a58c,_0x4397a8=Date['now']()){const {lat:_0x3db79b,lng:_0x2a7506}=_0x409408(_0x55a58c,_0x4397a8);return{'lat':_0x3db79b,'lng':_0x2a7506};}function _0x570ff0(_0x2166cc,_0x4fa483=Date[_0x34ba48(0x2e2)]()){const {lat:_0x2d07b5,lng:_0x44c4b5}=_0x409408(_0x2166cc,_0x4fa483);return[_0x44c4b5,_0x2d07b5];}function _0xa97566(_0x5a2bc8){return _0x570ff0(_0x5a2bc8,_0x63b0c4(_0x5a2bc8));}function _0x57bed4({observerLat:_0x45d1a1,observerLng:_0x5906f7,observerHeight:observerHeight=0x0,tles:tles=[],elevationThreshold:elevationThreshold=0x0,timestampMS:timestampMS=Date[_0x34ba48(0x2e2)]()}){return tles['reduce']((_0x3d6672,_0x19c0d9)=>{let _0x2aa614;try{_0x2aa614=_0x409408(_0x19c0d9,timestampMS,_0x45d1a1,_0x5906f7,observerHeight);}catch(_0x15b73f){return _0x3d6672;}const {elevation:_0x25dae2,velocity:_0x59f04e,range:_0x2fa013}=_0x2aa614;return _0x25dae2>=elevationThreshold?_0x3d6672['concat']({'tleArr':_0x19c0d9,'info':_0x2aa614}):_0x3d6672;},[]);}function*_0x1f5d81(_0x55f49f,_0x173b4b,_0x588e53){let _0x4f7c74=_0x173b4b-_0x588e53;while(!![]){_0x4f7c74+=_0x588e53,yield{'curTimeMS':_0x4f7c74,'lngLat':_0x570ff0(_0x55f49f,_0x4f7c74)};}}function _0x34620e(_0x1fc81a){return new Promise(_0x31ad48=>setTimeout(_0x31ad48,_0x1fc81a));}async function _0x2c8f9d({tle:_0x5cb3bc,startTimeMS:startTimeMS=Date['now'](),stepMS:stepMS=0x3e8,sleepMS:sleepMS=0x0,jobChunkSize:jobChunkSize=0x3e8,maxTimeMS:maxTimeMS=0x5b8d80,isLngLatFormat:isLngLatFormat=!![]}){var _0x55eb8a=_0x34ba48;const {tle:_0xd2baaa}=_0x513795(_0x5cb3bc),_0x2949a4=(startTimeMS/0x3e8)[_0x55eb8a(0x226)](),_0x7d5bce=_0xd2baaa[0x0]+'-'+_0x2949a4+'-'+stepMS+'-'+isLngLatFormat;if(_0x5f3d9c[_0x7d5bce])return _0x5f3d9c[_0x7d5bce];const _0x2f8efc=_0x1f5d81(_0xd2baaa,startTimeMS,stepMS);let _0x244be6=0x0,_0x51fad2=![],_0x584b6d=[],_0xe01bca;while(!_0x51fad2){const {curTimeMS:_0x317592,lngLat:_0x4bcca1}=_0x2f8efc[_0x55eb8a(0x2d1)]()[_0x55eb8a(0x244)],[_0x1a025b,_0x2e1e6a]=_0x4bcca1,_0x309996=_0x405df6(_0xe01bca,_0x1a025b),_0xf030f5=maxTimeMS&&_0x317592-startTimeMS>maxTimeMS;_0x51fad2=_0x309996||_0xf030f5;if(_0x51fad2)break;isLngLatFormat?_0x584b6d['push'](_0x4bcca1):_0x584b6d['push']([_0x2e1e6a,_0x1a025b]),sleepMS&&_0x244be6%jobChunkSize===0x0&&await _0x34620e(sleepMS),_0xe01bca=_0x1a025b,_0x244be6++;}return _0x5f3d9c[_0x7d5bce]=_0x584b6d,_0x584b6d;}function _0x23a713({tle:_0x38de69,startTimeMS:startTimeMS=Date['now'](),stepMS:stepMS=0x3e8,maxTimeMS:maxTimeMS=0x5b8d80,isLngLatFormat:isLngLatFormat=!![]}){const {tle:_0xf037ee}=_0x513795(_0x38de69),_0x102bc1=(startTimeMS/0x3e8)['toFixed'](),_0x4e3973=_0xf037ee[0x0]+'-'+_0x102bc1+'-'+stepMS+'-'+isLngLatFormat;if(_0x5f3d9c[_0x4e3973])return _0x5f3d9c[_0x4e3973];let _0x5697cb=![],_0x1133c5=[],_0x261bfe,_0x5d0e29=startTimeMS;while(!_0x5697cb){const _0x477320=_0x570ff0(_0xf037ee,_0x5d0e29),[_0x28ee44,_0x212a9c]=_0x477320,_0x419665=_0x405df6(_0x261bfe,_0x28ee44),_0x25d4e5=maxTimeMS&&_0x5d0e29-startTimeMS>maxTimeMS;_0x5697cb=_0x419665||_0x25d4e5;if(_0x5697cb)break;isLngLatFormat?_0x1133c5['push'](_0x477320):_0x1133c5['push']([_0x212a9c,_0x28ee44]),_0x261bfe=_0x28ee44,_0x5d0e29+=stepMS;}return _0x5f3d9c[_0x4e3973]=_0x1133c5,_0x1133c5;}function _0x9001c3({tle:_0x12269f,startTimeMS:startTimeMS=Date[_0x34ba48(0x2e2)](),stepMS:stepMS=0x3e8,isLngLatFormat:isLngLatFormat=!![]}){var _0xd98784=_0x34ba48;const _0x2be0a7=_0x513795(_0x12269f),_0x55411f=_0x434fe3(_0x2be0a7),_0x231f77=_0x150760(_0x2be0a7,startTimeMS),_0xdc825f=_0x231f77!==-0x1;if(!_0xdc825f)return Promise[_0xd98784(0x12f)]([_0x2c8f9d({'tle':_0x2be0a7,'startTimeMS':startTimeMS,'stepMS':_0x2eb92d,'maxTimeMS':_0xfb2e93/0x4,'isLngLatFormat':isLngLatFormat})]);const _0x3671c0=_0x55411f/0x5,_0x3f3c95=_0x150760(_0x2be0a7,_0x231f77-_0x3671c0),_0x5a2854=_0x150760(_0x2be0a7,_0x231f77+_0x55411f+_0x3671c0),_0x3996fe=[_0x2c8f9d({'tle':_0x2be0a7,'startTimeMS':_0x3f3c95,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat}),_0x2c8f9d({'tle':_0x2be0a7,'startTimeMS':_0x231f77,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat}),_0x2c8f9d({'tle':_0x2be0a7,'startTimeMS':_0x5a2854,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat})];return Promise['all'](_0x3996fe);}function _0x9b2f94({tle:_0x31c0e9,stepMS:stepMS=0x3e8,optionalTimeMS:optionalTimeMS=Date['now'](),isLngLatFormat:isLngLatFormat=!![]}){var _0xe61d45=_0x34ba48;const _0x520b41=_0x513795(_0x31c0e9),{tle:_0x204fad}=_0x520b41,_0x206d12=_0x434fe3(_0x204fad),_0x1e76a9=_0x150760(_0x520b41,optionalTimeMS),_0x2c349f=_0x1e76a9!==-0x1;if(!_0x2c349f){const _0x2a9a32=_0x23a713({'tle':_0x520b41,'startTimeMS':optionalTimeMS,'stepMS':_0x2eb92d,'maxTimeMS':_0xfb2e93/0x4});return _0x2a9a32;}const _0x25dd65=_0x206d12/0x5,_0x358220=_0x150760(_0x520b41,_0x1e76a9-_0x25dd65),_0x49b80c=_0x150760(_0x520b41,_0x1e76a9+_0x206d12+_0x25dd65),_0x1b4155=[_0x358220,_0x1e76a9,_0x49b80c],_0x2bb540=_0x1b4155[_0xe61d45(0x231)](_0x2ed15b=>{return _0x23a713({'tle':_0x520b41,'startTimeMS':_0x2ed15b,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat});});return _0x2bb540;}function _0x320b1f(_0x46950,_0x35b1cf=Date[_0x34ba48(0x2e2)]()){var _0x4ef261=_0x34ba48;const _0x4679bc=this[_0x4ef261(0x20c)](_0x46950),_0x877589=this[_0x4ef261(0x185)](_0x4679bc['arr'],_0x35b1cf),_0x22fa36=this['getLatLonArr'](_0x4679bc[_0x4ef261(0x140)],_0x35b1cf+0x2710),_0x5b75f0=_0x405df6(_0x877589[0x1],_0x22fa36[0x1]);if(_0x5b75f0)return{};const _0x791790=_0x36ffb9(_0x877589[0x0]),_0x28be2e=_0x36ffb9(_0x22fa36[0x0]),_0x7ee2f6=_0x36ffb9(_0x877589[0x1]),_0x55376c=_0x36ffb9(_0x22fa36[0x1]),_0x3a313b=_0x791790>=_0x28be2e?'S':'N',_0x5f0608=_0x7ee2f6>=_0x55376c?'W':'E',_0x50b825=Math['sin'](_0x55376c-_0x7ee2f6)*Math['cos'](_0x28be2e),_0x570996=Math[_0x4ef261(0x1b8)](_0x791790)*Math[_0x4ef261(0x280)](_0x28be2e)-Math['sin'](_0x791790)*Math['cos'](_0x28be2e)*Math[_0x4ef261(0x1b8)](_0x55376c-_0x7ee2f6),_0x143aea=_0x28e9f2(Math['atan2'](_0x50b825,_0x570996));return{'degrees':_0x143aea,'compass':''+_0x3a313b+_0x5f0608};}_0x5d5dab['clearCache']=_0x395e67,_0x5d5dab['clearTLEParseCache']=_0x132b0c,_0x5d5dab[_0x34ba48(0x242)]=_0x52c494,_0x5d5dab['getAverageOrbitTimeMS']=_0x434fe3,_0x5d5dab[_0x34ba48(0x1a8)]=_0x7f846e,_0x5d5dab['getAverageOrbitTimeS']=_0xeb10cc,_0x5d5dab['getBstarDrag']=_0x12ac5e,_0x5d5dab['getCOSPAR']=_0x46cd14,_0x5d5dab['getCacheSizes']=_0x264d8e,_0x5d5dab['getCatalogNumber']=_0x38cc2f,_0x5d5dab['getCatalogNumber1']=_0x38cc2f,_0x5d5dab['getCatalogNumber2']=_0x170c44,_0x5d5dab['getChecksum1']=_0x43e8cd,_0x5d5dab[_0x34ba48(0x319)]=_0x514430,_0x5d5dab['getClassification']=_0x2ec901,_0x5d5dab[_0x34ba48(0x199)]=_0x46a294,_0x5d5dab['getEpochDay']=_0x30f710,_0x5d5dab[_0x34ba48(0x1ac)]=_0x63b0c4,_0x5d5dab[_0x34ba48(0x2fd)]=_0x41436e,_0x5d5dab['getFirstTimeDerivative']=_0x1b1acc,_0x5d5dab[_0x34ba48(0xfb)]=_0x9001c3,_0x5d5dab['getGroundTracksSync']=_0x9b2f94,_0x5d5dab['getInclination']=_0x3803f6,_0x5d5dab['getIntDesignatorLaunchNumber']=_0x3d5952,_0x5d5dab['getIntDesignatorPieceOfLaunch']=_0x46c1b7,_0x5d5dab['getIntDesignatorYear']=_0x135e33,_0x5d5dab['getLastAntemeridianCrossingTimeMS']=_0x150760,_0x5d5dab['getLatLngObj']=_0x5807a9,_0x5d5dab[_0x34ba48(0x2a3)]=_0x1ca95f,_0x5d5dab[_0x34ba48(0x22a)]=_0x39de22,_0x5d5dab['getLngLatAtEpoch']=_0xa97566,_0x5d5dab[_0x34ba48(0x112)]=_0x14fd78,_0x5d5dab[_0x34ba48(0x17a)]=_0x2c84c9,_0x5d5dab[_0x34ba48(0x18a)]=_0x489fa0,_0x5d5dab[_0x34ba48(0x2e6)]=_0x2c8f9d,_0x5d5dab['getOrbitTrackSync']=_0x23a713,_0x5d5dab['getPerigee']=_0x4b740c,_0x5d5dab['getRevNumberAtEpoch']=_0x47f197,_0x5d5dab['getRightAscension']=_0x266bde,_0x5d5dab['getSatBearing']=_0x320b1f,_0x5d5dab['getSatelliteInfo']=_0x409408,_0x5d5dab['getSatelliteName']=_0x3abe97,_0x5d5dab['getSecondTimeDerivative']=_0x221623,_0x5d5dab[_0x34ba48(0x28e)]=_0xba47c,_0x5d5dab['getVisibleSatellites']=_0x57bed4,_0x5d5dab['isValidTLE']=_0x520194,_0x5d5dab['parseTLE']=_0x513795,Object['defineProperty'](_0x5d5dab,_0x34ba48(0x23e),{'value':!![]});}));}(tlejs_umd$1,tlejs_umd$1[_0xf77eb6(0x29d)]));var tlejs_umd=getDefaultExportFromCjs(tlejs_umd$1['exports']),tle=_mergeNamespaces({'__proto__':null,'default':tlejs_umd},[tlejs_umd$1['exports']]);const Cesium$9=mars3d__namespace[_0xf77eb6(0x206)];class Tle{constructor(_0x5c562a,_0x45c945,_0x7ef7){var _0x2a7119=_0xf77eb6;this['tle1']=_0x5c562a,this['tle2']=_0x45c945,this['name']=_0x7ef7||'',this['_satrec']=twoline2satrec$1(_0x5c562a,_0x45c945),this['_parseTLE']=tlejs_umd$1['exports'][_0x2a7119(0x20c)]([this[_0x2a7119(0x2a7)],this[_0x2a7119(0x1e0)],this['tle2']]);}get[_0xf77eb6(0x1d2)](){return tlejs_umd$1['exports']['getCOSPAR'](this['_parseTLE'],!![]);}get[_0xf77eb6(0x1f3)](){var _0x56d081=_0xf77eb6;return tlejs_umd$1['exports'][_0x56d081(0x323)](this['_parseTLE'],!![]);}get['classification'](){var _0x4403b1=_0xf77eb6;return tlejs_umd$1['exports'][_0x4403b1(0x1c4)](this[_0x4403b1(0x2db)],!![]);}get[_0xf77eb6(0x1e9)](){var _0x3d0619=_0xf77eb6;return tlejs_umd$1[_0x3d0619(0x29d)]['getIntDesignatorYear'](this[_0x3d0619(0x2db)],!![]);}get[_0xf77eb6(0x1d9)](){var _0x22ab57=_0xf77eb6;return tlejs_umd$1['exports'][_0x22ab57(0x144)](this[_0x22ab57(0x2db)],!![]);}get['intDesignatorPieceOfLaunch'](){var _0x2accce=_0xf77eb6;return tlejs_umd$1[_0x2accce(0x29d)][_0x2accce(0x111)](this['_parseTLE'],!![]);}get['epochYear'](){var _0xbbbac8=_0xf77eb6;return tlejs_umd$1[_0xbbbac8(0x29d)]['getEpochYear'](this['_parseTLE'],!![]);}get[_0xf77eb6(0x258)](){var _0x2d46c7=_0xf77eb6;return tlejs_umd$1['exports']['getEpochDay'](this[_0x2d46c7(0x2db)],!![]);}get['firstTimeDerivative'](){return tlejs_umd$1['exports']['getFirstTimeDerivative'](this['_parseTLE'],!![]);}get['secondTimeDerivative'](){return tlejs_umd$1['exports']['getSecondTimeDerivative'](this['_parseTLE'],!![]);}get['bstarDrag'](){return tlejs_umd$1['exports']['getBstarDrag'](this['_parseTLE'],!![]);}get['orbitModel'](){return tlejs_umd$1['exports']['getOrbitModel'](this['_parseTLE'],!![]);}get[_0xf77eb6(0xf6)](){var _0x3a8c07=_0xf77eb6;return tlejs_umd$1[_0x3a8c07(0x29d)][_0x3a8c07(0x28e)](this[_0x3a8c07(0x2db)],!![]);}get['checksum1'](){return tlejs_umd$1['exports']['getChecksum1'](this['_parseTLE'],!![]);}get['inclination'](){var _0x118fa6=_0xf77eb6;return tlejs_umd$1['exports'][_0x118fa6(0x1ce)](this['_parseTLE'],!![]);}get['rightAscension'](){return tlejs_umd$1['exports']['getRightAscension'](this['_parseTLE'],!![]);}get['eccentricity'](){var _0x1eb615=_0xf77eb6;return tlejs_umd$1['exports'][_0x1eb615(0x199)](this['_parseTLE'],!![]);}get['perigee'](){var _0x584268=_0xf77eb6;return tlejs_umd$1['exports']['getPerigee'](this[_0x584268(0x2db)],!![]);}get['meanAnomaly'](){var _0x3d0753=_0xf77eb6;return tlejs_umd$1[_0x3d0753(0x29d)][_0x3d0753(0x112)](this['_parseTLE'],!![]);}get[_0xf77eb6(0x2fe)](){var _0x33b14c=_0xf77eb6;return tlejs_umd$1['exports']['getMeanMotion'](this[_0x33b14c(0x2db)],!![]);}get['period'](){var _0x501d39=_0xf77eb6;return parseInt(0x5a0/parseFloat(this[_0x501d39(0x2fe)]));}get['revNumberAtEpoch'](){return tlejs_umd$1['exports']['getRevNumberAtEpoch'](this['_parseTLE'],!![]);}get['checksum2'](){return tlejs_umd$1['exports']['getChecksum2'](this['_parseTLE'],!![]);}[_0xf77eb6(0x200)](_0x489649,_0x544922){var _0x2d2434=_0xf77eb6;if(!_0x489649)_0x489649=new Date();else{if(mars3d__namespace[_0x2d2434(0x1c0)]['isNumber'](_0x489649))_0x489649=new Date(_0x489649);else _0x489649 instanceof Cesium$9['JulianDate']&&(_0x489649=Cesium$9['JulianDate']['toDate'](_0x489649));}const _0x5753f0=propagate$1(this[_0x2d2434(0x118)],_0x489649),_0x22c2eb=_0x5753f0['position'];if(_0x22c2eb==null||isNaN(_0x22c2eb['x']))return null;return _0x544922&&(_0x5753f0[_0x2d2434(0x19e)]=gstime$1(_0x489649)),_0x5753f0;}[_0xf77eb6(0x301)](_0x478bdd){var _0x567a89=_0xf77eb6;const _0x3e0bf5=this[_0x567a89(0x200)](_0x478bdd,!![]);if(!_0x3e0bf5)return;const _0x386905=_0x3e0bf5['gmst'],_0x1f7c80=_0x3e0bf5[_0x567a89(0x18b)],_0x1a8440=eciToEcf$1(_0x1f7c80,_0x386905);return new Cesium$9['Cartesian3'](_0x1a8440['x']*0x3e8,_0x1a8440['y']*0x3e8,_0x1a8440['z']*0x3e8);}['getEciPosition'](_0x1f3efd){const _0x520aba=this['_getEciPositionAndVelocity'](_0x1f3efd);if(!_0x520aba)return;const _0x5116e9=_0x520aba['position'];return new Cesium$9['Cartesian3'](_0x5116e9['x']*0x3e8,_0x5116e9['y']*0x3e8,_0x5116e9['z']*0x3e8);}['getEciPositionAndGeodetic'](_0x22e550){var _0x59c34f=_0xf77eb6;const _0x38beb0=this['_getEciPositionAndVelocity'](_0x22e550,!![]);if(!_0x38beb0)return;const _0x139318=_0x38beb0['gmst'],_0xb61085=_0x38beb0[_0x59c34f(0x18b)],_0x22ebb9=eciToGeodetic$1(_0xb61085,_0x139318),_0xfd5eb8=degreesLong$1(_0x22ebb9[_0x59c34f(0x31a)]),_0x4a7189=degreesLat$1(_0x22ebb9[_0x59c34f(0x14f)]),_0x5a81a6=_0x22ebb9['height']*0x3e8;return{'positionEci':new Cesium$9['Cartesian3'](_0xb61085['x']*0x3e8,_0xb61085['y']*0x3e8,_0xb61085['z']*0x3e8),'velocityEci':_0x38beb0['velocity'],'lng':_0xfd5eb8,'lat':_0x4a7189,'alt':_0x5a81a6};}['getPoint'](_0x129d86){var _0x4a5c41=_0xf77eb6;const _0x15b0dd=this['getEciPositionAndGeodetic'](_0x129d86);return _0x15b0dd?new mars3d__namespace['LngLatPoint'](_0x15b0dd['lng'],_0x15b0dd[_0x4a5c41(0x16b)],_0x15b0dd['alt']):undefined;}['getLookAngles'](_0xfe6a00,_0x14addb){var _0x5065af=_0xf77eb6;const _0x3483f5=this['_getEciPositionAndVelocity'](_0x14addb,!![]);if(!_0x3483f5)return;const _0x2aa18f=_0x3483f5['gmst'],_0x32be92=_0x3483f5['position'],_0x5e0928=eciToEcf$1(_0x32be92,_0x2aa18f),_0x20f20b={'longitude':degreesToRadians$1(_0xfe6a00['lng']),'latitude':degreesToRadians$1(_0xfe6a00['lat']),'height':_0xfe6a00['alt']/0x3e8},_0x579b5b=ecfToLookAngles$1(_0x20f20b,_0x5e0928);return{'position':new Cesium$9['Cartesian3'](_0x5e0928['x']*0x3e8,_0x5e0928['y']*0x3e8,_0x5e0928['z']*0x3e8),'range':_0x579b5b[_0x5065af(0x1bb)]*0x3e8,'azimuth':radiansToDegrees$1(_0x579b5b['azimuth']),'elevation':radiansToDegrees$1(_0x579b5b['elevation'])};}static[_0xf77eb6(0x2a8)](_0x101249,_0xbb3aba,_0x5eae3f){return new Tle(_0x101249,_0xbb3aba)['getPoint'](_0x5eae3f);}static[_0xf77eb6(0x301)](_0x2c960e,_0x33ceae,_0x5cb171){return new Tle(_0x2c960e,_0x33ceae)['getEcfPosition'](_0x5cb171);}static[_0xf77eb6(0x1c6)](_0x30cb01){var _0x5883eb=_0xf77eb6;return _0x30cb01 instanceof Cesium$9['JulianDate']&&(_0x30cb01=Cesium$9[_0x5883eb(0x1ec)]['toDate'](_0x30cb01)),gstime$1(_0x30cb01);}static[_0xf77eb6(0x11d)](_0x1e3c21,_0x20da12){var _0x472682=_0xf77eb6;const _0x47abe6=Tle[_0x472682(0x1c6)](_0x20da12),_0x3514b4={'x':_0x1e3c21['x']/0x3e8,'y':_0x1e3c21['y']/0x3e8,'z':_0x1e3c21['z']/0x3e8},_0x375770=eciToGeodetic$1(_0x3514b4,_0x47abe6),_0x308606=degreesLong$1(_0x375770['longitude']),_0x37eccc=degreesLat$1(_0x375770['latitude']),_0x9f3f15=_0x375770[_0x472682(0x15e)]*0x3e8;return new mars3d__namespace['LngLatPoint'](_0x308606,_0x37eccc,_0x9f3f15);}static['eciToEcf'](_0x84cf82,_0x410da4){const _0x348dfb=Tle['gstime'](_0x410da4),_0x51e47d={'x':_0x84cf82['x']/0x3e8,'y':_0x84cf82['y']/0x3e8,'z':_0x84cf82['z']/0x3e8},_0x5f08ce=eciToEcf$1(_0x51e47d,_0x348dfb);return new Cesium$9['Cartesian3'](_0x5f08ce['x']*0x3e8,_0x5f08ce['y']*0x3e8,_0x5f08ce['z']*0x3e8);}static[_0xf77eb6(0x1a6)](_0x92487a,_0x2d9fa3){const _0x1dcf7d=Tle['gstime'](_0x2d9fa3),_0x803866={'x':_0x92487a['x']/0x3e8,'y':_0x92487a['y']/0x3e8,'z':_0x92487a['z']/0x3e8},_0x50b6e0=ecfToEci$1(_0x803866,_0x1dcf7d);return new Cesium$9['Cartesian3'](_0x50b6e0['x']*0x3e8,_0x50b6e0['y']*0x3e8,_0x50b6e0['z']*0x3e8);}static[_0xf77eb6(0x238)](_0x5313a9){var _0x10ba9e=_0xf77eb6;const _0x3e6836=formatStr(_0x5313a9[_0x10ba9e(0x2a7)],0x5,'\x20'),_0x512735=_0x5313a9[_0x10ba9e(0x10d)],_0x7341a=String(_0x5313a9['epochDay'])['substring'](0x0,0xc),_0x428f4e=formatStr(_0x5313a9[_0x10ba9e(0x2ad)],0x7),_0x37832a=formatStr(_0x5313a9['rightAscension'],0x8),_0x4b6fac=formatStr(_0x5313a9['eccentricity'],0x7),_0x1b667d=formatStr(_0x5313a9[_0x10ba9e(0x2d5)],0x8),_0x4eec7d=formatStr(_0x5313a9['meanAnomaly'],0x8),_0x22e13b=formatStr(_0x5313a9['meanMotion'],0xb),_0x39edfb='1\x20'+_0x3e6836+'U\x2013018A\x20\x20\x20'+_0x512735+_0x7341a+_0x10ba9e(0x217),_0x39e2ef='2\x20'+_0x3e6836+'\x20'+_0x428f4e+'\x20'+_0x37832a+'\x20\x20'+_0x4b6fac+'\x20'+_0x1b667d+'\x20'+_0x4eec7d+'\x20'+_0x22e13b+_0x10ba9e(0x1d8);return[_0x39edfb,_0x39e2ef];}static[_0xf77eb6(0x209)](_0x16b824,_0x1d2a85){var _0x2845b3=_0xf77eb6;const _0x53d28c=new Tle(_0x16b824,_0x1d2a85);return{'name':_0x53d28c[_0x2845b3(0x2a7)],'epochYear':_0x53d28c['epochYear'],'epochDay':_0x53d28c[_0x2845b3(0x258)],'inclination':_0x53d28c[_0x2845b3(0x2ad)],'rightAscension':_0x53d28c['rightAscension'],'eccentricity':_0x53d28c[_0x2845b3(0x195)],'perigee':_0x53d28c['perigee'],'meanAnomaly':_0x53d28c['meanAnomaly'],'meanMotion':_0x53d28c['meanMotion']};}}Tle['satellite']=satellite,Tle['tle']=tle,mars3d__namespace['Tle']=Tle;function formatStr(_0x84c2eb,_0x1f64d9,_0x2eb4e5='0'){var _0x6818d6=_0xf77eb6;_0x84c2eb=(_0x84c2eb??'')['toString']();const _0x2e7837=_0x84c2eb['length']-_0x1f64d9;return _0x2e7837<=0x0?_0x84c2eb[_0x6818d6(0x27e)](_0x1f64d9,_0x2eb4e5):_0x84c2eb[_0x6818d6(0x1ed)](_0x2e7837);}var SatelliteSensorFS='in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0a\x0auniform\x20vec4\x20marsColor;\x0auniform\x20float\x20globalAlpha;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.,\x200.,\x201.),\x20-normalEC);\x0a\x20\x20#endif\x0a\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.diffuse\x20=\x20marsColor.rgb;\x0a\x20\x20material.alpha\x20=\x20marsColor.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20#endif\x0a}\x0a',SatelliteSensorVS='\x0a#ifdef\x20GL_ES\x0aprecision\x20highp\x20float;\x0a#endif\x0a\x0ain\x20vec3\x20position;\x0ain\x20vec3\x20normal;\x0a\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0a\x0avoid\x20main(void)\x20{\x0a\x20\x20v_positionEC\x20=\x20(czm_modelView\x20*\x20vec4(position,\x201.0)).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjection\x20*\x20vec4(position,\x201.0);\x0a}\x0a';const Cesium$8=mars3d__namespace[_0xf77eb6(0x206)];class CamberRadarPrimitive{constructor(_0x3606d8){var _0x1f93bb=_0xf77eb6;this['id']=_0x3606d8['id'],this[_0x1f93bb(0x2a7)]=_0x3606d8['name'],this[_0x1f93bb(0x17e)]=0x0,this['_endFovH']=0x0,this[_0x1f93bb(0x245)]=0x0,this['_endFovV']=0x0,this['_segmentH']=0x1,this[_0x1f93bb(0x12d)]=0x1,this[_0x1f93bb(0x1da)]=0x1,this['_subSegmentV']=0x1,this['_globalAlpha']=0x1,this['_command']=undefined,this['_initBoundingSphere']=undefined,this[_0x1f93bb(0x283)]=new Cesium$8['BoundingSphere'](),this['_modelMatrix']=Cesium$8[_0x1f93bb(0x1ad)]['clone'](Cesium$8[_0x1f93bb(0x1ad)][_0x1f93bb(0x1b4)]),this['innerFovRadiusPairs']=_0x3606d8['innerFovRadiusPairs'],this['outerFovRadiusPairs']=_0x3606d8['outerFovRadiusPairs'],this['radius']=_0x3606d8['radius'],this['startRadius']=_0x3606d8[_0x1f93bb(0x1de)],this['translucent']=_0x3606d8['translucent'],this['closed']=_0x3606d8['closed'],this['modelMatrix']=_0x3606d8['modelMatrix']??Cesium$8['Matrix4'][_0x1f93bb(0x1b4)],this[_0x1f93bb(0x1db)]=_0x3606d8['startFovH']??Cesium$8['Math']['toRadians'](-0x32),this['endFovH']=_0x3606d8['endFovH']??Cesium$8['Math'][_0x1f93bb(0x151)](0x32),this[_0x1f93bb(0x1f4)]=_0x3606d8['startFovV']??Cesium$8['Math']['toRadians'](0x5),this[_0x1f93bb(0x1c8)]=_0x3606d8['endFovV']??Cesium$8['Math'][_0x1f93bb(0x151)](0x55),this['segmentH']=_0x3606d8['segmentH']??0x3c,this['segmentV']=_0x3606d8['segmentV']??0x14,this['subSegmentH']=_0x3606d8['subSegmentH']??0x3,this['subSegmentV']=_0x3606d8['subSegmentV']??0x3,this['color']=_0x3606d8[_0x1f93bb(0x2be)]??new Cesium$8[(_0x1f93bb(0x173))](0x1,0x1,0x0,0.5),this[_0x1f93bb(0x2b3)]=_0x3606d8['outlineColor']??new Cesium$8['Color'](0x1,0x1,0x1),this[_0x1f93bb(0x188)]=_0x3606d8[_0x1f93bb(0x188)]??!![];}get['startRadius'](){var _0x169813=_0xf77eb6;return this[_0x169813(0x2bb)];}set[_0xf77eb6(0x1de)](_0x5c3a4a){var _0x363384=_0xf77eb6;this['_startRadius']=_0x5c3a4a,this['innerFovRadiusPairs']=[{'fov':Cesium$8['Math']['toRadians'](0x0),'radius':_0x5c3a4a},{'fov':Cesium$8[_0x363384(0x223)]['toRadians'](0xa),'radius':0.9*_0x5c3a4a},{'fov':Cesium$8['Math']['toRadians'](0x14),'radius':0.8*_0x5c3a4a},{'fov':Cesium$8['Math']['toRadians'](0x1e),'radius':0.7*_0x5c3a4a},{'fov':Cesium$8['Math'][_0x363384(0x151)](0x28),'radius':0.6*_0x5c3a4a},{'fov':Cesium$8['Math'][_0x363384(0x151)](0x32),'radius':0.5*_0x5c3a4a},{'fov':Cesium$8['Math'][_0x363384(0x151)](0x3c),'radius':0.4*_0x5c3a4a},{'fov':Cesium$8['Math']['toRadians'](0x46),'radius':0.3*_0x5c3a4a},{'fov':Cesium$8[_0x363384(0x223)]['toRadians'](0x50),'radius':0.1*_0x5c3a4a},{'fov':Cesium$8['Math'][_0x363384(0x151)](0x5a),'radius':0.01*_0x5c3a4a}];}get['radius'](){return this['_radius'];}set[_0xf77eb6(0x230)](_0x5b623c){var _0x30dff7=_0xf77eb6;this['_radius']=_0x5b623c,this['outerFovRadiusPairs']=[{'fov':Cesium$8['Math']['toRadians'](0x0),'radius':_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0xa),'radius':0.9*_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0x14),'radius':0.8*_0x5b623c},{'fov':Cesium$8['Math'][_0x30dff7(0x151)](0x1e),'radius':0.7*_0x5b623c},{'fov':Cesium$8[_0x30dff7(0x223)]['toRadians'](0x28),'radius':0.6*_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0x32),'radius':0.5*_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0x3c),'radius':0.4*_0x5b623c},{'fov':Cesium$8[_0x30dff7(0x223)]['toRadians'](0x46),'radius':0.3*_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0x50),'radius':0.1*_0x5b623c},{'fov':Cesium$8['Math']['toRadians'](0x5a),'radius':0.01*_0x5b623c}];}['_createOuterCurveCommand'](_0x12aff7){var _0x29bc63=_0xf77eb6;const _0x4879bb=this['_subSegmentH']*this[_0x29bc63(0x2af)],_0x430ced=this[_0x29bc63(0x28f)]*this['_segmentV'],_0x44f8e5=getGridDirs(this['_startFovH'],this[_0x29bc63(0x24d)],this['_startFovV'],this['_endFovV'],_0x4879bb,_0x430ced,this['_outerFovRadiusPairs']),_0x51299d=getGridDirs(this[_0x29bc63(0x17e)],this['_endFovH'],this['_startFovV'],this[_0x29bc63(0x28a)],_0x4879bb,_0x430ced,this['_outerFovRadiusPairs']),_0xf90ddf=getGridIndices(_0x4879bb,_0x430ced),_0x2ddbb5=getLineGridIndices(this['_segmentH'],this['_segmentV'],this['_subSegmentH'],this[_0x29bc63(0x28f)]);return this[_0x29bc63(0x254)](_0x12aff7,_0x44f8e5,_0x51299d,_0xf90ddf,_0x2ddbb5);}['_createInnerCurveCommand'](_0x15b2f4){var _0x23e0ad=_0xf77eb6;const _0x4540ab=this[_0x23e0ad(0x1da)]*this['_segmentH'],_0x5cbeae=this['_subSegmentV']*this['_segmentV'],_0x286aa0=getGridDirs(this['_startFovH'],this['_endFovH'],this[_0x23e0ad(0x245)],this['_endFovV'],_0x4540ab,_0x5cbeae,this[_0x23e0ad(0x2b6)]),_0x4e122e=getGridDirs(this['_startFovH'],this['_endFovH'],this['_startFovV'],this[_0x23e0ad(0x28a)],_0x4540ab,_0x5cbeae,this[_0x23e0ad(0x2b6)]),_0xdd820f=getGridIndices(_0x4540ab,_0x5cbeae),_0x4d00de=getLineGridIndices(this['_segmentH'],this[_0x23e0ad(0x12d)],this['_subSegmentH'],this[_0x23e0ad(0x28f)]);return this[_0x23e0ad(0x254)](_0x15b2f4,_0x286aa0,_0x4e122e,_0xdd820f,_0x4d00de);}[_0xf77eb6(0x1b5)](_0x550ced){var _0x2958d7=_0xf77eb6;const _0x2b3ff0=0x1*0xa,_0x32d35d=this['_subSegmentV']*this['_segmentV'],_0x321a44=getCrossSectionPositions(this['_startFovH'],this['_startFovV'],this['_endFovV'],_0x2b3ff0,_0x32d35d,this['_innerFovRadiusPairs'],this['_outerFovRadiusPairs']),_0x4b94d9=getCrossSectionPositions(this[_0x2958d7(0x17e)],this['_startFovV'],this['_endFovV'],_0x2b3ff0,_0x32d35d,this['_innerFovRadiusPairs'],this[_0x2958d7(0x265)]),_0x598d4a=getGridIndices(_0x2b3ff0,_0x32d35d),_0x31cc54=getLineGridIndices(0xa,this[_0x2958d7(0x12d)],0x1,this['_subSegmentV']);return this['_createRawCommand'](_0x550ced,_0x321a44,_0x4b94d9,_0x598d4a,_0x31cc54);}[_0xf77eb6(0x108)](_0x5d751f){var _0x529374=_0xf77eb6;const _0x2907ef=0x1*0xa,_0x13d93e=this['_subSegmentV']*this['_segmentV'],_0x33304e=getCrossSectionPositions(this['_endFovH'],this[_0x529374(0x245)],this['_endFovV'],_0x2907ef,_0x13d93e,this['_innerFovRadiusPairs'],this['_outerFovRadiusPairs']),_0x49b1a3=getCrossSectionPositions(this[_0x529374(0x24d)],this['_startFovV'],this[_0x529374(0x28a)],_0x2907ef,_0x13d93e,this[_0x529374(0x2b6)],this['_outerFovRadiusPairs']),_0x84abea=getGridIndices(_0x2907ef,_0x13d93e),_0x590fd5=getLineGridIndices(0xa,this['_segmentV'],0x1,this['_subSegmentV']);return this[_0x529374(0x254)](_0x5d751f,_0x33304e,_0x49b1a3,_0x84abea,_0x590fd5);}[_0xf77eb6(0x254)](_0x39cf37,_0x378e17,_0x1dba05,_0x5bf8fb,_0x5a33fe){var _0x3f5c29=_0xf77eb6;const _0x125d51=Cesium$8[_0x3f5c29(0xef)]['replaceCache']({'context':_0x39cf37,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':SatelliteSensorFS,'attributeLocations':attributeLocations}),_0x640821=Cesium$8[_0x3f5c29(0x25b)]['createVertexBuffer']({'context':_0x39cf37,'typedArray':_0x378e17,'usage':Cesium$8[_0x3f5c29(0x130)][_0x3f5c29(0x305)]}),_0xbc4b93=Cesium$8['Buffer']['createVertexBuffer']({'context':_0x39cf37,'typedArray':_0x1dba05,'usage':Cesium$8[_0x3f5c29(0x130)][_0x3f5c29(0x305)]}),_0x27f57b=Cesium$8[_0x3f5c29(0x25b)]['createIndexBuffer']({'context':_0x39cf37,'typedArray':_0x5bf8fb,'usage':Cesium$8[_0x3f5c29(0x130)][_0x3f5c29(0x305)],'indexDatatype':Cesium$8[_0x3f5c29(0x1e8)]['UNSIGNED_SHORT']}),_0x4ea8f5=Cesium$8['Buffer']['createIndexBuffer']({'context':_0x39cf37,'typedArray':_0x5a33fe,'usage':Cesium$8['BufferUsage']['STATIC_DRAW'],'indexDatatype':Cesium$8[_0x3f5c29(0x1e8)]['UNSIGNED_SHORT']}),_0x554e1a=new Cesium$8['VertexArray']({'context':_0x39cf37,'attributes':[{'index':0x0,'vertexBuffer':_0x640821,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8[_0x3f5c29(0x13f)]['FLOAT']},{'index':0x1,'vertexBuffer':_0xbc4b93,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']}],'indexBuffer':_0x27f57b}),_0x5cfcb9=new Cesium$8['VertexArray']({'context':_0x39cf37,'attributes':[{'index':0x0,'vertexBuffer':_0x640821,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']},{'index':0x1,'vertexBuffer':_0xbc4b93,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']}],'indexBuffer':_0x4ea8f5}),_0x3d4af7=Cesium$8['BoundingSphere']['fromVertices'](_0x378e17),_0x7021ee=this['translucent']??!![],_0x4ea041=this['closed']??![],_0x151921=Cesium$8['Appearance']['getDefaultRenderState'](_0x7021ee,_0x4ea041,undefined),_0x29a493=Cesium$8['RenderState']['fromCache'](_0x151921),_0x3c26e3=new Cesium$8['DrawCommand']({'vertexArray':_0x554e1a,'primitiveType':Cesium$8[_0x3f5c29(0x218)]['TRIANGLES'],'renderState':_0x29a493,'shaderProgram':_0x125d51,'uniformMap':{'marsColor':()=>{var _0x35575a=_0x3f5c29;return this[_0x35575a(0x2be)];},'globalAlpha':()=>{return this['_globalAlpha'];}},'owner':this,'pass':Cesium$8['Pass']['TRANSLUCENT'],'modelMatrix':new Cesium$8['Matrix4'](),'boundingVolume':new Cesium$8[(_0x3f5c29(0x24a))](),'cull':!![]}),_0x5b378b=new Cesium$8['DrawCommand']({'vertexArray':_0x5cfcb9,'primitiveType':Cesium$8['PrimitiveType'][_0x3f5c29(0x21d)],'renderState':_0x29a493,'shaderProgram':_0x125d51,'uniformMap':{'marsColor':()=>{return this['outlineColor'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'owner':this,'pass':Cesium$8['Pass'][_0x3f5c29(0x175)],'modelMatrix':new Cesium$8['Matrix4'](),'boundingVolume':new Cesium$8[(_0x3f5c29(0x24a))](),'cull':!![]});return{'command':_0x3c26e3,'lineCommand':_0x5b378b,'initBoundingSphere':_0x3d4af7};}['update'](_0x4bf3ad){var _0xd0c91d=_0xf77eb6;if(!this['show'])return;const _0x1fc325=this['innerFovRadiusPairs']!==this['_innerFovRadiusPairs']||this['outerFovRadiusPairs']!==this['_outerFovRadiusPairs']||this['startFovH']!==this['_startFovH']||this['endFovH']!==this[_0xd0c91d(0x24d)]||this['startFovV']!==this[_0xd0c91d(0x245)]||this['endFovV']!==this['_endFovV']||this['segmentH']!==this[_0xd0c91d(0x2af)]||this['segmentV']!==this[_0xd0c91d(0x12d)]||this['subSegmentH']!==this[_0xd0c91d(0x1da)]||this['subSegmentV']!==this['_subSegmentV'];_0x1fc325&&(this['_innerFovRadiusPairs']=this['innerFovRadiusPairs'],this[_0xd0c91d(0x265)]=this['outerFovRadiusPairs'],this['_startFovH']=this['startFovH'],this['_endFovH']=this['endFovH'],this[_0xd0c91d(0x245)]=this[_0xd0c91d(0x1f4)],this[_0xd0c91d(0x28a)]=this['endFovV'],this['_segmentH']=this[_0xd0c91d(0x2f4)],this['_segmentV']=this['segmentV'],this[_0xd0c91d(0x1da)]=this['subSegmentH'],this['_subSegmentV']=this['subSegmentV'],this['_modelMatrix']=Cesium$8['clone'](Cesium$8['Matrix4']['IDENTITY']),this['_destroyCommands']()),(!Cesium$8[_0xd0c91d(0x1a2)](this['_commands'])||this['_commands']['length']===0x0)&&(this['_commands']||(this[_0xd0c91d(0x2b1)]=[]),this['_destroyCommands'](),this[_0xd0c91d(0x2b1)]['push'](this[_0xd0c91d(0x1af)](_0x4bf3ad[_0xd0c91d(0x2a2)])),this['_commands']['push'](this['_createLeftCrossSectionCommand'](_0x4bf3ad['context'])),this[_0xd0c91d(0x2b1)]['push'](this['_createRightCrossSectionCommand'](_0x4bf3ad[_0xd0c91d(0x2a2)])),this['_commands']['push'](this[_0xd0c91d(0x264)](_0x4bf3ad['context']))),!Cesium$8[_0xd0c91d(0x1ad)][_0xd0c91d(0x10f)](this['modelMatrix'],this['_modelMatrix'])&&(Cesium$8['Matrix4']['clone'](this['modelMatrix'],this['_modelMatrix']),this['_commands']['forEach'](_0x150f5d=>{var _0x4abd75=_0xd0c91d;_0x150f5d[_0x4abd75(0x228)]['modelMatrix']=Cesium$8['Matrix4']['IDENTITY'],_0x150f5d[_0x4abd75(0x228)]['modelMatrix']=this['_modelMatrix'],_0x150f5d['command'][_0x4abd75(0x222)]=Cesium$8['BoundingSphere']['transform'](_0x150f5d['initBoundingSphere'],this['_modelMatrix'],this[_0x4abd75(0x283)]),_0x150f5d['lineCommand']['modelMatrix']=Cesium$8[_0x4abd75(0x1ad)]['IDENTITY'],_0x150f5d['lineCommand'][_0x4abd75(0x2b0)]=this['_modelMatrix'],_0x150f5d[_0x4abd75(0x10b)][_0x4abd75(0x222)]=Cesium$8[_0x4abd75(0x24a)]['transform'](_0x150f5d['initBoundingSphere'],this['_modelMatrix'],this[_0x4abd75(0x283)]);})),this[_0xd0c91d(0x2b1)][_0xd0c91d(0x1d0)](_0x387a7a=>{var _0x1e3f34=_0xd0c91d;_0x387a7a[_0x1e3f34(0x228)]&&_0x4bf3ad['commandList'][_0x1e3f34(0x141)](_0x387a7a['command']),_0x387a7a['lineCommand']&&_0x4bf3ad['commandList'][_0x1e3f34(0x141)](_0x387a7a[_0x1e3f34(0x10b)]);});}['isDestroyed'](){return![];}['_destroyCommands'](){var _0x1b59fe=_0xf77eb6;this['_commands']&&this['_commands']['forEach'](_0x495bb5=>{var _0x345543=_0x8ca3;Cesium$8['defined'](_0x495bb5['command'])&&(_0x495bb5[_0x345543(0x228)]['shaderProgram']=_0x495bb5['command'][_0x345543(0x127)]&&_0x495bb5['command']['shaderProgram'][_0x345543(0x2c4)](),_0x495bb5[_0x345543(0x228)]['vertexArray']=_0x495bb5[_0x345543(0x228)][_0x345543(0x1aa)]&&_0x495bb5['command']['vertexArray']['destroy'](),_0x495bb5['command']=undefined),Cesium$8['defined'](_0x495bb5['lineCommand'])&&(_0x495bb5[_0x345543(0x10b)][_0x345543(0x127)]=_0x495bb5['lineCommand']['shaderProgram']&&_0x495bb5['lineCommand']['shaderProgram']['destroy'](),_0x495bb5['lineCommand'][_0x345543(0x1aa)]=_0x495bb5['lineCommand']['vertexArray']&&_0x495bb5['lineCommand'][_0x345543(0x1aa)]['destroy'](),_0x495bb5['lineCommand']=undefined);}),this[_0x1b59fe(0x2b1)]&&(this['_commands']['length']=0x0);}[_0xf77eb6(0x2c4)](){return this['_destroyCommands'](),Cesium$8['destroyObject'](this);}}const attributeLocations={'position':0x0,'normal':0x1};function getDir(_0x1ec1bf,_0x3045bd){const _0x10b3b3=_0x1ec1bf,_0x1da0f1=_0x3045bd,_0x19ef61=Math['cos'],_0x586891=Math['sin'],_0x497aea=[_0x19ef61(-_0x10b3b3)*_0x19ef61(_0x1da0f1),_0x586891(-_0x10b3b3)*_0x19ef61(_0x1da0f1),_0x586891(_0x1da0f1)];return _0x497aea;}function getFov(_0x27e217,_0x4f9259,_0x3e3a7e,_0x2b3b85){return _0x27e217+(_0x4f9259-_0x27e217)*(_0x2b3b85/_0x3e3a7e);}function getRadius(_0x38705a,_0x3299d2){var _0xaec77f=_0xf77eb6;const _0x48b49e=_0x3299d2['findIndex'](_0xfab7e=>{var _0x3b70fb=_0x8ca3;return _0xfab7e[_0x3b70fb(0x143)]>_0x38705a;});if(_0x48b49e>0x0){const _0x1c3ccb=_0x3299d2[_0x48b49e-0x1],_0x12c616=_0x3299d2[_0x48b49e],_0x5aa635=(_0x38705a-_0x1c3ccb[_0xaec77f(0x143)])/(_0x12c616[_0xaec77f(0x143)]-_0x1c3ccb['fov']),_0x8d30bd=_0x1c3ccb[_0xaec77f(0x230)]*(0x1-_0x5aa635)+_0x12c616['radius']*_0x5aa635;return _0x8d30bd;}else return undefined;}function getGridDirs(_0x454257,_0xe0d38,_0x3eadc5,_0x35eab9,_0x553f15,_0x3bae64,_0x19f18a){const _0x1198ba=new Float32Array((_0x553f15+0x1)*(_0x3bae64+0x1)*0x3);for(let _0x47c2a8=0x0;_0x47c2a8<_0x553f15+0x1;++_0x47c2a8){for(let _0x114630=0x0;_0x114630<_0x3bae64+0x1;++_0x114630){const _0x5af6b0=getFov(_0x3eadc5,_0x35eab9,_0x3bae64,_0x114630),_0x5e79f4=getDir(getFov(_0x454257,_0xe0d38,_0x553f15,_0x47c2a8),_0x5af6b0),_0x1c6f4f=_0x19f18a?getRadius(_0x5af6b0,_0x19f18a):0x1;_0x1198ba[(_0x114630*(_0x553f15+0x1)+_0x47c2a8)*0x3+0x0]=_0x5e79f4[0x0]*_0x1c6f4f,_0x1198ba[(_0x114630*(_0x553f15+0x1)+_0x47c2a8)*0x3+0x1]=_0x5e79f4[0x1]*_0x1c6f4f,_0x1198ba[(_0x114630*(_0x553f15+0x1)+_0x47c2a8)*0x3+0x2]=_0x5e79f4[0x2]*_0x1c6f4f;}}return _0x1198ba;}function getCrossSectionPositions(_0x292a59,_0x47dc28,_0x20b5d0,_0x1f9219,_0x5a21aa,_0x3793df,_0x218f79){const _0x571a2d=new Float32Array((_0x1f9219+0x1)*(_0x5a21aa+0x1)*0x3);for(let _0x30c1e4=0x0;_0x30c1e4<_0x1f9219+0x1;++_0x30c1e4){for(let _0x490e35=0x0;_0x490e35<_0x5a21aa+0x1;++_0x490e35){const _0x2582c8=getFov(_0x47dc28,_0x20b5d0,_0x5a21aa,_0x490e35),_0x5db37e=getDir(_0x292a59,_0x2582c8),_0x1b4e1f=_0x3793df?getRadius(_0x2582c8,_0x3793df):0x1,_0x43199c=_0x218f79?getRadius(_0x2582c8,_0x218f79):0x1,_0x66ab19=getFov(_0x1b4e1f,_0x43199c,_0x1f9219,_0x30c1e4);_0x571a2d[(_0x490e35*(_0x1f9219+0x1)+_0x30c1e4)*0x3+0x0]=_0x5db37e[0x0]*_0x66ab19,_0x571a2d[(_0x490e35*(_0x1f9219+0x1)+_0x30c1e4)*0x3+0x1]=_0x5db37e[0x1]*_0x66ab19,_0x571a2d[(_0x490e35*(_0x1f9219+0x1)+_0x30c1e4)*0x3+0x2]=_0x5db37e[0x2]*_0x66ab19;}}return _0x571a2d;}function getGridIndices(_0x1b8031,_0x4fd2f8){const _0x1faa6d=new Uint16Array(_0x1b8031*_0x4fd2f8*0x6);for(let _0x4243d6=0x0;_0x4243d6<_0x1b8031;++_0x4243d6){for(let _0x52d457=0x0;_0x52d457<_0x4fd2f8;++_0x52d457){const _0x55cefa=_0x52d457*(_0x1b8031+0x1)+_0x4243d6,_0x50f683=_0x52d457*(_0x1b8031+0x1)+_0x4243d6+0x1,_0x2628d2=(_0x52d457+0x1)*(_0x1b8031+0x1)+_0x4243d6,_0x262eeb=(_0x52d457+0x1)*(_0x1b8031+0x1)+_0x4243d6+0x1,_0x13ecfe=(_0x52d457*_0x1b8031+_0x4243d6)*0x6;_0x1faa6d[_0x13ecfe+0x0]=_0x55cefa,_0x1faa6d[_0x13ecfe+0x1]=_0x50f683,_0x1faa6d[_0x13ecfe+0x2]=_0x262eeb,_0x1faa6d[_0x13ecfe+0x3]=_0x55cefa,_0x1faa6d[_0x13ecfe+0x4]=_0x262eeb,_0x1faa6d[_0x13ecfe+0x5]=_0x2628d2;}}return _0x1faa6d;}function _0x8ca3(_0x3cda4f,_0x573af6){var _0x52f66a=_0x52f6();return _0x8ca3=function(_0x8ca3a5,_0x25f3ba){_0x8ca3a5=_0x8ca3a5-0xef;var _0x31a23b=_0x52f66a[_0x8ca3a5];return _0x31a23b;},_0x8ca3(_0x3cda4f,_0x573af6);}function getLineGridIndices(_0x14ecf7,_0x5f1c8e,_0x1ed52a,_0xed66ff){const _0x487d26=_0x14ecf7*_0x1ed52a,_0x18cc83=_0x5f1c8e*_0xed66ff,_0x444ffc=new Uint16Array((_0x14ecf7+0x1)*(_0x18cc83*0x2)+(_0x5f1c8e+0x1)*(_0x487d26*0x2)+0x4*0x2);for(let _0x3b3094=0x0;_0x3b3094<_0x14ecf7+0x1;++_0x3b3094){for(let _0x3ddbd1=0x0;_0x3ddbd1<_0x18cc83;++_0x3ddbd1){const _0x5e03bf=_0x3b3094*_0x1ed52a;_0x444ffc[(_0x3b3094*_0x18cc83+_0x3ddbd1)*0x2+0x0]=_0x3ddbd1*(_0x487d26+0x1)+_0x5e03bf,_0x444ffc[(_0x3b3094*_0x18cc83+_0x3ddbd1)*0x2+0x1]=(_0x3ddbd1+0x1)*(_0x487d26+0x1)+_0x5e03bf;}}const _0x1ae214=(_0x14ecf7+0x1)*(_0x18cc83*0x2);for(let _0x16b90c=0x0;_0x16b90c<_0x5f1c8e+0x1;++_0x16b90c){for(let _0x3dbea4=0x0;_0x3dbea4<_0x487d26;++_0x3dbea4){const _0x34eeea=_0x16b90c*_0xed66ff;_0x444ffc[_0x1ae214+(_0x3dbea4+_0x16b90c*_0x487d26)*0x2+0x0]=_0x34eeea*(_0x487d26+0x1)+_0x3dbea4,_0x444ffc[_0x1ae214+(_0x3dbea4+_0x16b90c*_0x487d26)*0x2+0x1]=_0x34eeea*(_0x487d26+0x1)+_0x3dbea4+0x1;}}return _0x444ffc;}const Cesium$7=mars3d__namespace['Cesium'];function computeVertexNormals(_0x237f34){var _0x135e4a=_0xf77eb6;const _0x18eb04=_0x237f34['indices'],_0x379acb=_0x237f34[_0x135e4a(0x161)],_0x4fe3a1=_0x18eb04['length'];if(_0x379acb['position']){const _0x14c401=_0x379acb['position']['values'];if(_0x379acb['normal']===undefined)_0x379acb[_0x135e4a(0x16e)]=new Cesium$7[(_0x135e4a(0x1c7))]({'componentDatatype':Cesium$7[_0x135e4a(0x13f)]['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array(_0x14c401[_0x135e4a(0x31f)])});else{const _0xd5f3ad=_0x379acb['normal'][_0x135e4a(0x2a6)];for(let _0x501335=0x0;_0x501335<_0x4fe3a1;_0x501335++){_0xd5f3ad[_0x501335]=0x0;}}const _0x3c3046=_0x379acb['normal'][_0x135e4a(0x2a6)];let _0x2ef73f,_0x391791,_0x584fee;const _0x305948=new Cesium$7['Cartesian3'](),_0xd6fb5=new Cesium$7['Cartesian3'](),_0x5acbd9=new Cesium$7[(_0x135e4a(0x278))](),_0x2fb145=new Cesium$7['Cartesian3'](),_0x7bdc3f=new Cesium$7['Cartesian3']();for(let _0xf91d0b=0x0;_0xf91d0b<_0x4fe3a1;_0xf91d0b+=0x3){_0x2ef73f=_0x18eb04[_0xf91d0b+0x0]*0x3,_0x391791=_0x18eb04[_0xf91d0b+0x1]*0x3,_0x584fee=_0x18eb04[_0xf91d0b+0x2]*0x3,Cesium$7['Cartesian3']['fromArray'](_0x14c401,_0x2ef73f,_0x305948),Cesium$7['Cartesian3'][_0x135e4a(0x30e)](_0x14c401,_0x391791,_0xd6fb5),Cesium$7['Cartesian3']['fromArray'](_0x14c401,_0x584fee,_0x5acbd9),Cesium$7['Cartesian3'][_0x135e4a(0x243)](_0x5acbd9,_0xd6fb5,_0x2fb145),Cesium$7[_0x135e4a(0x278)]['subtract'](_0x305948,_0xd6fb5,_0x7bdc3f),Cesium$7[_0x135e4a(0x278)][_0x135e4a(0x271)](_0x2fb145,_0x7bdc3f,_0x2fb145),_0x3c3046[_0x2ef73f]+=_0x2fb145['x'],_0x3c3046[_0x2ef73f+0x1]+=_0x2fb145['y'],_0x3c3046[_0x2ef73f+0x2]+=_0x2fb145['z'],_0x3c3046[_0x391791]+=_0x2fb145['x'],_0x3c3046[_0x391791+0x1]+=_0x2fb145['y'],_0x3c3046[_0x391791+0x2]+=_0x2fb145['z'],_0x3c3046[_0x584fee]+=_0x2fb145['x'],_0x3c3046[_0x584fee+0x1]+=_0x2fb145['y'],_0x3c3046[_0x584fee+0x2]+=_0x2fb145['z'];}normalizeNormals(_0x237f34),_0x379acb['normal'][_0x135e4a(0x322)]=!![];}return _0x237f34;}function normalizeNormals(_0x261bd0){var _0xaed034=_0xf77eb6;const _0x3e7a67=_0x261bd0[_0xaed034(0x161)]['normal'][_0xaed034(0x2a6)];let _0x450c03,_0x3e8ba4,_0x54fd8d,_0x21b887;for(let _0x3e9a37=0x0;_0x3e9a37<_0x3e7a67['length'];_0x3e9a37+=0x3){_0x450c03=_0x3e7a67[_0x3e9a37],_0x3e8ba4=_0x3e7a67[_0x3e9a37+0x1],_0x54fd8d=_0x3e7a67[_0x3e9a37+0x2],_0x21b887=0x1/Math['sqrt'](_0x450c03*_0x450c03+_0x3e8ba4*_0x3e8ba4+_0x54fd8d*_0x54fd8d),_0x3e7a67[_0x3e9a37]=_0x450c03*_0x21b887,_0x3e7a67[_0x3e9a37+0x1]=_0x3e8ba4*_0x21b887,_0x3e7a67[_0x3e9a37+0x2]=_0x54fd8d*_0x21b887;}}function style2Primitive(_0x47693e={},_0x58af9a){var _0x4cb95f=_0xf77eb6;_0x47693e=_0x47693e||{};_0x58af9a==null&&(_0x58af9a={});for(const _0x98589b in _0x47693e){const _0x1f1f52=_0x47693e[_0x98589b];if(mars3d__namespace['Util'][_0x4cb95f(0x123)](_0x1f1f52))switch(_0x98589b){case'opacity':case'outlineOpacity':break;case'color':{let _0x444e3f;mars3d__namespace[_0x4cb95f(0x1c0)][_0x4cb95f(0x259)](_0x1f1f52)?(_0x444e3f=Cesium$7['Color']['fromCssColorString'](_0x1f1f52),Cesium$7['defined'](_0x47693e[_0x4cb95f(0xfe)])&&(_0x444e3f=_0x444e3f['withAlpha'](Number(_0x47693e['opacity'])))):_0x444e3f=_0x1f1f52;_0x58af9a['color']=_0x444e3f;break;}case'outline':_0x58af9a[_0x4cb95f(0x266)]=_0x1f1f52;!_0x1f1f52&&(_0x58af9a['outlineColor']=new Cesium$7['Color'](0x0,0x0,0x0,0x0));break;case _0x4cb95f(0x2b3):{let _0x5bf336;if(mars3d__namespace['Util']['isString'](_0x1f1f52)){_0x5bf336=Cesium$7[_0x4cb95f(0x173)]['fromCssColorString'](_0x1f1f52);if(Cesium$7[_0x4cb95f(0x1a2)](_0x47693e[_0x4cb95f(0x2b8)]))_0x5bf336=_0x5bf336['withAlpha'](Number(_0x47693e['outlineOpacity']));else Cesium$7['defined'](_0x47693e[_0x4cb95f(0xfe)])&&(_0x5bf336=_0x5bf336['withAlpha'](Number(_0x47693e['opacity'])));}else _0x5bf336=_0x1f1f52;_0x58af9a['outlineColor']=_0x5bf336;break;}case'startFovV':case'endFovV':case'startFovH':case'endFovH':_0x58af9a[_0x98589b]=Cesium$7['Math']['toRadians'](_0x1f1f52);break;default:_0x58af9a[_0x98589b]=_0x1f1f52;break;}else _0x58af9a[_0x98589b]=_0x1f1f52;}return _0x58af9a;}var SpaceUtil={'__proto__':null,'computeVertexNormals':computeVertexNormals,'style2Primitive':style2Primitive};const Cesium$6=mars3d__namespace['Cesium'],BasePointPrimitive$3=mars3d__namespace[_0xf77eb6(0x235)][_0xf77eb6(0x2bd)];class CamberRadar extends BasePointPrimitive$3{get['startRadius'](){var _0x18424a=_0xf77eb6;return this['style'][_0x18424a(0x1de)];}set['startRadius'](_0x438f90){var _0x56bebb=_0xf77eb6;this[_0x56bebb(0x182)]['startRadius']=_0x438f90,this['_primitive']&&(this['_primitive'][_0x56bebb(0x1de)]=_0x438f90);}get['radius'](){return this['style']['radius'];}set['radius'](_0x2da5ca){var _0x30b35c=_0xf77eb6;this[_0x30b35c(0x182)][_0x30b35c(0x230)]=_0x2da5ca,this['_primitive']&&(this['_primitive'][_0x30b35c(0x230)]=_0x2da5ca);}get['startFovV'](){return this['style']['startFovV'];}set['startFovV'](_0x3719a5){var _0x149ecb=_0xf77eb6;this['style']['startFovV']=_0x3719a5,this[_0x149ecb(0x277)]&&(this[_0x149ecb(0x277)][_0x149ecb(0x1f4)]=Cesium$6[_0x149ecb(0x223)]['toRadians'](_0x3719a5));}get['endFovV'](){var _0x572da6=_0xf77eb6;return this[_0x572da6(0x182)][_0x572da6(0x1c8)];}set[_0xf77eb6(0x1c8)](_0x299573){var _0x381ec2=_0xf77eb6;this['style']['endFovV']=_0x299573,this['_primitive']&&(this[_0x381ec2(0x277)][_0x381ec2(0x1c8)]=Cesium$6['Math']['toRadians'](_0x299573));}get['startFovH'](){return this['style']['startFovH'];}set['startFovH'](_0x2ac508){var _0x12e9c5=_0xf77eb6;this[_0x12e9c5(0x182)]['startFovH']=_0x2ac508,this[_0x12e9c5(0x277)]&&(this['_primitive']['startFovH']=Cesium$6[_0x12e9c5(0x223)]['toRadians'](_0x2ac508));}get['endFovH'](){return this['style']['endFovH'];}set['endFovH'](_0x47c775){var _0x1c9047=_0xf77eb6;this['style'][_0x1c9047(0x26d)]=_0x47c775,this['_primitive']&&(this['_primitive']['endFovH']=Cesium$6['Math'][_0x1c9047(0x151)](_0x47c775));}get['color'](){return this['style']['color'];}set[_0xf77eb6(0x2be)](_0x2407b3){var _0xe76dfb=_0xf77eb6;this[_0xe76dfb(0x182)][_0xe76dfb(0x2be)]=_0x2407b3,this['_primitive']&&(this[_0xe76dfb(0x277)][_0xe76dfb(0x2be)]=mars3d__namespace[_0xe76dfb(0x1c0)]['getCesiumColor'](_0x2407b3));}['_addedHook'](){var _0x29d0a1=_0xf77eb6;this[_0x29d0a1(0x277)]=this[_0x29d0a1(0x165)]['add'](new CamberRadarPrimitive({...style2Primitive(this['style']),'id':this['id'],'modelMatrix':this[_0x29d0a1(0x2b0)]}));}['_updateStyleHook'](_0x6e0c1f,_0x165dbe){var _0x5d431f=_0xf77eb6;(Cesium$6['defined']('heading')||Cesium$6['defined'](_0x5d431f(0x321))||Cesium$6['defined']('roll'))&&(this[_0x5d431f(0x277)]['modelMatrix']=this[_0x5d431f(0x2b0)]),style2Primitive(_0x165dbe,this['_primitive']);}[_0xf77eb6(0xfd)](_0x195d45){this['style']['globalAlpha']=_0x195d45,this['_primitive']&&(this['_primitive']['_globalAlpha']=_0x195d45);}['_getDrawEntityClass'](_0x3ab3bc,_0x185b48){var _0x1ed9b0=_0xf77eb6;return _0x3ab3bc['drawShow']=![],mars3d__namespace[_0x1ed9b0(0x26f)][_0x1ed9b0(0x202)](_0x1ed9b0(0x1b7),_0x3ab3bc);}}mars3d__namespace['graphic']['CamberRadar']=CamberRadar,mars3d__namespace[_0xf77eb6(0x26f)]['register']('camberRadar',CamberRadar,!![]);const Cesium$5=mars3d__namespace['Cesium'];class ConicGeometry{constructor(_0x1ec18e){var _0x34a892=_0xf77eb6;this[_0x34a892(0x31f)]=_0x1ec18e['length'],this['topRadius']=_0x1ec18e['topRadius'],this['bottomRadius']=_0x1ec18e['bottomRadius'],this['zReverse']=_0x1ec18e[_0x34a892(0x1e5)],this['slices']=_0x1ec18e['slices']??0x40;}static['fromAngleAndLength'](_0x2c25b7,_0xc2179e,_0x172e81){var _0x2012bd=_0xf77eb6;const _0x4f559e=Math['max'](Math[_0x2012bd(0x27f)](_0x2c25b7*0x2),0x40);_0x2c25b7=Cesium$5[_0x2012bd(0x223)]['toRadians'](_0x2c25b7);const _0x3e817e=Math[_0x2012bd(0x20b)](_0x2c25b7)*_0xc2179e;return new ConicGeometry({'topRadius':_0x3e817e,'bottomRadius':0x0,'length':_0xc2179e,'slices':_0x4f559e,'zReverse':_0x172e81});}static[_0xf77eb6(0x136)](_0x2bcdd6,_0xd23490){var _0x2c551d=_0xf77eb6;if(!_0xd23490)return ConicGeometry['_createGeometry'](_0x2bcdd6);const _0x33aab7=new Cesium$5['Cartesian3'](),_0x148632=new Cesium$5['Ray']();Cesium$5['Matrix4'][_0x2c551d(0x2f1)](_0xd23490,Cesium$5['Cartesian3']['ZERO'],_0x33aab7),_0x33aab7[_0x2c551d(0x1d1)](_0x148632['origin']);const _0x16752c=_0x2bcdd6[_0x2c551d(0x31f)],_0x21fcf2=_0x2bcdd6[_0x2c551d(0x2e0)],_0x381ede=_0x2bcdd6['slices'],_0x4ba180=Math['PI']*0x2/(_0x381ede-0x1),_0x5a8c2c=_0x2bcdd6['zReverse'],_0x3414cc=0x10;let _0xcfd0d0=[],_0x1ad12c=[],_0x3b7a21=[];const _0x4380b8=[],_0x52a21d=[0x0,_0x5a8c2c?-_0x16752c:_0x16752c];let _0x35e3aa=0x0;_0xcfd0d0['push'](0x0,0x0,0x0),_0x1ad12c['push'](0x1,0x1),_0x35e3aa++;const _0x4adc74=new Cesium$5[(_0x2c551d(0x278))](),_0x387b3d=_0x21fcf2/(_0x3414cc-0x1);for(let _0x334843=0x0;_0x334843<_0x3414cc;_0x334843++){const _0x369fbf=_0x387b3d*_0x334843,_0x41edb=[];for(let _0x1476e3=0x0;_0x1476e3<_0x381ede;_0x1476e3++){const _0x4654b5=_0x4ba180*_0x1476e3,_0x3cc2c8=_0x369fbf*Math[_0x2c551d(0x1b8)](_0x4654b5),_0x31e3be=_0x369fbf*Math['sin'](_0x4654b5);_0x4adc74['x']=_0x3cc2c8,_0x4adc74['y']=_0x31e3be,_0x4adc74['z']=_0x52a21d[0x1];let _0x487f00=Cesium$5['Matrix4']['multiplyByPoint'](_0xd23490,_0x4adc74,new Cesium$5['Cartesian3']());!_0x487f00?(_0x487f00=_0x33aab7,_0x41edb['push'](-0x1)):(_0x41edb['push'](_0x35e3aa),_0xcfd0d0[_0x2c551d(0x141)](_0x3cc2c8,_0x31e3be,_0x52a21d[0x1]),_0x1ad12c['push'](_0x334843/(_0x3414cc-0x1),0x1),_0x35e3aa++);}_0x4380b8[_0x2c551d(0x141)](_0x41edb);}const _0x2faef2=[0x0,_0x4380b8['length']-0x1];let _0x40a397,_0x4b8cce;for(let _0x1f2707=0x0;_0x1f2707<_0x2faef2['length'];_0x1f2707++){const _0x502685=_0x2faef2[_0x1f2707];for(let _0x566d2c=0x1;_0x566d2c<_0x4380b8[_0x502685]['length'];_0x566d2c++){_0x40a397=_0x4380b8[_0x502685][_0x566d2c-0x1],_0x4b8cce=_0x4380b8[_0x502685][_0x566d2c],_0x40a397>=0x0&&_0x4b8cce>=0x0&&_0x3b7a21['push'](0x0,_0x40a397,_0x4b8cce);}}_0xcfd0d0=new Float32Array(_0xcfd0d0),_0x3b7a21=new Int32Array(_0x3b7a21),_0x1ad12c=new Float32Array(_0x1ad12c);const _0xc8466e={'position':new Cesium$5[(_0x2c551d(0x1c7))]({'componentDatatype':Cesium$5['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0xcfd0d0}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x1ad12c})},_0x12c62e=Cesium$5['BoundingSphere']['fromVertices'](_0xcfd0d0),_0x131c93=new Cesium$5['Geometry']({'attributes':_0xc8466e,'indices':_0x3b7a21,'primitiveType':Cesium$5['PrimitiveType']['TRIANGLES'],'boundingSphere':_0x12c62e});return computeVertexNormals(_0x131c93),_0xcfd0d0=[],_0x3b7a21=[],_0x131c93;}static['_createGeometry'](_0x2de248){var _0xc54143=_0xf77eb6;const _0x1023d9=_0x2de248[_0xc54143(0x31f)],_0x3afd20=_0x2de248['topRadius'],_0x13c311=_0x2de248[_0xc54143(0x16c)],_0x1f3e3c=_0x2de248['slices'],_0x477cb5=Math['PI']*0x2/(_0x1f3e3c-0x1),_0x21846e=_0x2de248[_0xc54143(0x1e5)];let _0x4ff8ec=[],_0x204f17=[],_0x9458c2=[];const _0xdfd9ed=[],_0xcfedfd=[_0x13c311,_0x3afd20],_0x9ff168=[0x0,_0x21846e?-_0x1023d9:_0x1023d9];let _0x4aec0f=0x0;const _0x3f1e94=new Cesium$5['Cartesian2'](),_0x126d29=Math['atan2'](_0x13c311-_0x3afd20,_0x1023d9),_0x37c0b3=_0x3f1e94;_0x37c0b3['z']=Math[_0xc54143(0x280)](_0x126d29);const _0x520085=Math['cos'](_0x126d29);for(let _0x25b77f=0x0;_0x25b77f<_0x9ff168['length'];_0x25b77f++){_0xdfd9ed[_0x25b77f]=[];const _0x293b1b=_0xcfedfd[_0x25b77f];for(let _0x3c45ea=0x0;_0x3c45ea<_0x1f3e3c;_0x3c45ea++){_0xdfd9ed[_0x25b77f]['push'](_0x4aec0f++);const _0x5b30b7=_0x477cb5*_0x3c45ea;let _0x2077d3=_0x293b1b*Math[_0xc54143(0x1b8)](_0x5b30b7),_0x16940f=_0x293b1b*Math['sin'](_0x5b30b7);_0x4ff8ec['push'](_0x2077d3,_0x16940f,_0x9ff168[_0x25b77f]),_0x2077d3=_0x520085*Math['cos'](_0x5b30b7),_0x16940f=_0x520085*Math['sin'](_0x5b30b7),_0x204f17['push'](_0x2077d3,_0x16940f,_0x37c0b3['z']),_0x9458c2['push'](_0x25b77f/(_0x9ff168['length']-0x1),0x0);}}let _0x51d8ea=[];for(let _0x14162e=0x1;_0x14162e<_0x9ff168['length'];_0x14162e++){for(let _0x4c3aa6=0x1;_0x4c3aa6<_0x1f3e3c;_0x4c3aa6++){let _0x34f7c6=_0xdfd9ed[_0x14162e-0x1][_0x4c3aa6-0x1],_0x408bed=_0xdfd9ed[_0x14162e][_0x4c3aa6-0x1],_0x5d8b04=_0xdfd9ed[_0x14162e][_0x4c3aa6],_0x19eb58=_0xdfd9ed[_0x14162e-0x1][_0x4c3aa6];_0x51d8ea['push'](_0x5d8b04),_0x51d8ea[_0xc54143(0x141)](_0x19eb58),_0x51d8ea[_0xc54143(0x141)](_0x34f7c6),_0x51d8ea['push'](_0x5d8b04),_0x51d8ea['push'](_0x34f7c6),_0x51d8ea['push'](_0x408bed),_0x4c3aa6===_0xdfd9ed[_0x14162e][_0xc54143(0x31f)]-0x1&&(_0x34f7c6=_0xdfd9ed[_0x14162e-0x1][_0x4c3aa6],_0x408bed=_0xdfd9ed[_0x14162e][_0x4c3aa6],_0x5d8b04=_0xdfd9ed[_0x14162e][0x0],_0x19eb58=_0xdfd9ed[_0x14162e-0x1][0x0],_0x51d8ea[_0xc54143(0x141)](_0x5d8b04),_0x51d8ea[_0xc54143(0x141)](_0x19eb58),_0x51d8ea['push'](_0x34f7c6),_0x51d8ea[_0xc54143(0x141)](_0x5d8b04),_0x51d8ea['push'](_0x34f7c6),_0x51d8ea['push'](_0x408bed));}}_0x51d8ea=new Int16Array(_0x51d8ea),_0x4ff8ec=new Float32Array(_0x4ff8ec),_0x204f17=new Float32Array(_0x204f17),_0x9458c2=new Float32Array(_0x9458c2);const _0x3eebaf={'position':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype'][_0xc54143(0x20f)],'componentsPerAttribute':0x3,'values':_0x4ff8ec}),'normal':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':_0x204f17}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x9458c2})},_0xda7d40=Cesium$5['BoundingSphere'][_0xc54143(0x2f3)](_0x4ff8ec),_0x277282=new Cesium$5[(_0xc54143(0x21b))]({'attributes':_0x3eebaf,'indices':_0x51d8ea,'primitiveType':Cesium$5[_0xc54143(0x218)]['TRIANGLES'],'boundingSphere':_0xda7d40});return _0x4ff8ec=[],_0x51d8ea=[],_0x9458c2=[],_0x277282;}static['createOutlineGeometry'](_0x107e83){var _0x71e9bc=_0xf77eb6;const _0x3191f9=_0x107e83['length'],_0x5c6fbb=_0x107e83['topRadius'],_0x4b536d=_0x107e83['bottomRadius'],_0x1a4d44=_0x107e83['slices'],_0xeef088=Math['PI']*0x2/(_0x1a4d44-0x1),_0x384253=_0x107e83[_0x71e9bc(0x1e5)];let _0x3f37c5=[],_0xc83ccf=[],_0x2adbc1=[];const _0x490af0=[],_0x56199c=[_0x4b536d,_0x5c6fbb],_0x5a49c6=[0x0,_0x384253?-_0x3191f9:_0x3191f9];let _0x21d0f3=0x0;const _0x40b79b=new Cesium$5['Cartesian2'](),_0x5e12c4=Math['atan2'](_0x4b536d-_0x5c6fbb,_0x3191f9),_0x5017cf=_0x40b79b;_0x5017cf['z']=Math['sin'](_0x5e12c4);const _0x3b0c8b=Math['cos'](_0x5e12c4);for(let _0x581bcf=0x0;_0x581bcf<_0x5a49c6['length'];_0x581bcf++){_0x490af0[_0x581bcf]=[];const _0x2694e5=_0x56199c[_0x581bcf];for(let _0x5a787b=0x0;_0x5a787b<_0x1a4d44;_0x5a787b++){_0x490af0[_0x581bcf]['push'](_0x21d0f3++);const _0x15a658=_0xeef088*_0x5a787b;let _0x2f9dc0=_0x2694e5*Math['cos'](_0x15a658),_0x18c019=_0x2694e5*Math[_0x71e9bc(0x280)](_0x15a658);_0x3f37c5[_0x71e9bc(0x141)](_0x2f9dc0,_0x18c019,_0x5a49c6[_0x581bcf]),_0x2f9dc0=_0x3b0c8b*Math[_0x71e9bc(0x1b8)](_0x15a658),_0x18c019=_0x3b0c8b*Math['sin'](_0x15a658),_0xc83ccf[_0x71e9bc(0x141)](_0x2f9dc0,_0x18c019,_0x5017cf['z']),_0x2adbc1['push'](_0x581bcf/(_0x5a49c6[_0x71e9bc(0x31f)]-0x1),0x0);}}let _0x4855b0=[];for(let _0xec4cae=0x1;_0xec4cae<_0x5a49c6['length'];_0xec4cae++){for(let _0x357cd6=0x1;_0x357cd6<_0x1a4d44;_0x357cd6+=0x1){const _0x4745db=_0x490af0[_0xec4cae-0x1][_0x357cd6-0x1],_0x3e794f=_0x490af0[_0xec4cae][_0x357cd6-0x1];_0x490af0[_0xec4cae][_0x357cd6],_0x490af0[_0xec4cae-0x1][_0x357cd6],_0x357cd6%0x8===0x1&&_0x4855b0['push'](_0x4745db,_0x3e794f);}}_0x4855b0=new Int16Array(_0x4855b0),_0x3f37c5=new Float32Array(_0x3f37c5),_0xc83ccf=new Float32Array(_0xc83ccf),_0x2adbc1=new Float32Array(_0x2adbc1);const _0x578279={'position':new Cesium$5[(_0x71e9bc(0x1c7))]({'componentDatatype':Cesium$5['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x3f37c5}),'normal':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5[_0x71e9bc(0x13f)]['FLOAT'],'componentsPerAttribute':0x3,'values':_0xc83ccf}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x2adbc1})},_0x472d1b=Cesium$5['BoundingSphere']['fromVertices'](_0x3f37c5),_0x2ded88=new Cesium$5['Geometry']({'attributes':_0x578279,'indices':_0x4855b0,'primitiveType':Cesium$5['PrimitiveType']['LINES'],'boundingSphere':_0x472d1b});return _0x3f37c5=[],_0x4855b0=[],_0x2adbc1=[],_0x2ded88;}}const Cesium$4=mars3d__namespace['Cesium'],BasePointPrimitive$2=mars3d__namespace['graphic'][_0xf77eb6(0x2bd)];class ConicSensor extends BasePointPrimitive$2{constructor(_0xbc4caa={}){var _0x5e88ee=_0xf77eb6;super(_0xbc4caa),this[_0x5e88ee(0x27b)]=Cesium$4['Matrix4']['clone'](Cesium$4['Matrix4']['IDENTITY']),this['_quaternion']=new Cesium$4['Quaternion'](),this['_translation']=new Cesium$4[(_0x5e88ee(0x278))](),this['_scale']=new Cesium$4[(_0x5e88ee(0x278))](0x1,0x1,0x1),this['_matrix']=new Cesium$4['Matrix4'](),this['_lookAt']=this['options']['lookAt'],this[_0x5e88ee(0x2c0)]=this['options'][_0x5e88ee(0x1ba)]??Cesium$4['Transforms']['eastNorthUpToFixedFrame'],this['_reverse']=this['options']['reverse']??![],this[_0x5e88ee(0x182)][_0x5e88ee(0x124)]=0x1,this[_0x5e88ee(0x2ca)](_0xbc4caa[_0x5e88ee(0x182)],_0xbc4caa['style']);}get['czmObject'](){return this;}get[_0xf77eb6(0x2b4)](){var _0x263521=_0xf77eb6;return this[_0x263521(0x1f9)];}set['lookAt'](_0x4c119d){this['_lookAt']=_0x4c119d;}get['color'](){return this['_color'];}set['color'](_0x43339f){var _0x856622=_0xf77eb6;this[_0x856622(0x19b)]=mars3d__namespace['Util'][_0x856622(0x11f)](_0x43339f);}get['outlineColor'](){return this['outlineColor'];}set['outlineColor'](_0x204b1e){var _0x328e84=_0xf77eb6;this[_0x328e84(0x22f)]=mars3d__namespace[_0x328e84(0x1c0)]['getCesiumColor'](_0x204b1e);}get['outline'](){var _0x284199=_0xf77eb6;return this[_0x284199(0x160)];}set['outline'](_0x3b5c80){this['_outline']=_0x3b5c80,this['updateGeometry']();}get['topShow'](){return this['_topShow'];}set[_0xf77eb6(0x1cc)](_0x18c70d){var _0x45e5ad=_0xf77eb6;this[_0x45e5ad(0x17c)]=_0x18c70d,this[_0x45e5ad(0x1ef)]();}get['topOutlineShow'](){return this['_topOutlineShow'];}set['topOutlineShow'](_0x29f63b){var _0x164efd=_0xf77eb6;this['_topOutlineShow']=_0x29f63b,this[_0x164efd(0x1ef)]();}get[_0xf77eb6(0xf1)](){var _0xdb2a55=_0xf77eb6;return this[_0xdb2a55(0x184)];}set[_0xf77eb6(0xf1)](_0xecc93c){this['_angle']=0x5a-_0xecc93c,this['updateGroundCircleRadius'](),this['updateGeometry']();}get['length'](){return mars3d__namespace['Util']['getCesiumValue'](this['_length'],Number);}set['length'](_0x320ade){this['_length']=_0x320ade,this['updateGroundCircleRadius'](),this['updateGeometry']();}get[_0xf77eb6(0x289)](){return Cesium$4['Math']['toDegrees'](this['headingRadians']);}set['heading'](_0x217116){var _0x3f5d80=_0xf77eb6;_0x217116 instanceof Cesium$4['CallbackProperty']?this[_0x3f5d80(0x1bf)]=_0x217116:this['_headingRadians']=Cesium$4['Math']['toRadians'](_0x217116);}get['headingRadians'](){var _0x1b9b36=_0xf77eb6;return this['_headingRadians']instanceof Cesium$4[_0x1b9b36(0x28d)]?Cesium$4['Math'][_0x1b9b36(0x151)](mars3d__namespace['Util']['getCesiumValue'](this['_headingRadians'],Number)):this[_0x1b9b36(0x1bf)];}get['pitch'](){var _0x289290=_0xf77eb6;return Cesium$4[_0x289290(0x223)]['toDegrees'](this['_pitchRadians']);}set[_0xf77eb6(0x321)](_0x5c0bbe){var _0x47f6ad=_0xf77eb6;this['_pitchRadians']=Cesium$4[_0x47f6ad(0x223)]['toRadians'](_0x5c0bbe);}get['roll'](){return Cesium$4['Math']['toDegrees'](this['_rollRadians']);}set['roll'](_0x5e48ee){this['_rollRadians']=Cesium$4['Math']['toRadians'](_0x5e48ee);}get[_0xf77eb6(0x214)](){var _0x3fa946=_0xf77eb6;return this[_0x3fa946(0x26e)];}set[_0xf77eb6(0x214)](_0x54f649){var _0x2d8f45=_0xf77eb6;this['_groundCircleShow']=_0x54f649,this[_0x2d8f45(0x146)](this[_0x2d8f45(0x26e)]);}get['matrix'](){return this['_matrix'];}get['rayPosition'](){var _0x1c1a60=_0xf77eb6;if(!this[_0x1c1a60(0x18f)])return null;return Cesium$4['Matrix4'][_0x1c1a60(0x2f1)](this[_0x1c1a60(0x18f)],new Cesium$4['Cartesian3'](0x0,0x0,this[_0x1c1a60(0x227)]?-this['length']:this['length']),new Cesium$4[(_0x1c1a60(0x278))]());}get['reverse'](){var _0x3efc84=_0xf77eb6;return this[_0x3efc84(0x1bd)];}get['intersectEllipsoid'](){var _0x4973bf=_0xf77eb6;return this[_0x4973bf(0x318)];}[_0xf77eb6(0x2ca)](_0x179d62,_0x54faff){var _0x57aede=_0xf77eb6;_0x179d62=style2Primitive(_0x179d62),this[_0x57aede(0x184)]=0x5a-(_0x179d62[_0x57aede(0xf1)]??0x55),this['_length']=_0x179d62['length']??0x64,this[_0x57aede(0x19b)]=_0x179d62['color']??Cesium$4['Color']['YELLOW'],this['_outline']=_0x179d62[_0x57aede(0x266)]??![],this['_outlineColor']=_0x179d62[_0x57aede(0x2b3)]??this['_color'],this['_topShow']=_0x179d62['topShow']??!![],this['_topOutlineShow']=_0x179d62[_0x57aede(0x1fc)]??!![],this[_0x57aede(0x26e)]=_0x179d62['shadowShow']??![],Cesium$4['defined'](_0x54faff['shadowShow'])&&this['_addGroundCircleEntity'](this[_0x57aede(0x26e)]),this['_hintPotsNum']=_0x179d62['hintPotsNum']??0xf,this['pitch']=_0x179d62[_0x57aede(0x321)]??0x0,this['heading']=_0x179d62[_0x57aede(0x289)]??0x0,this['roll']=_0x179d62['roll']??0x0,this['updateGroundCircleRadius'](),this[_0x57aede(0x1ef)]();}[_0xf77eb6(0x1fb)](){var _0x5a8a31=_0xf77eb6;this['ellipsoid']=this['_map']['scene']['globe'][_0x5a8a31(0xf7)];if(!this['_show'])return;this['primitiveCollection']['add'](this),this[_0x5a8a31(0x1ef)](),this[_0x5a8a31(0x269)]?this['_map'][_0x5a8a31(0x16d)]['add'](this['_groundCircleEntity']):this['_addGroundCircleEntity'](this['_groundCircleShow']),this['_groundConeEntity']?this[_0x5a8a31(0x219)]['entities']['add'](this[_0x5a8a31(0x105)]):this['_addGroundConeEntity']();}[_0xf77eb6(0x201)](){var _0x220686=_0xf77eb6;if(!this['_map'])return;this['_groundCircleEntity']&&this[_0x220686(0x219)]['entities']['remove'](this['_groundCircleEntity']),this['_groundConeEntity']&&this[_0x220686(0x219)][_0x220686(0x16d)][_0x220686(0x13d)](this[_0x220686(0x105)]),this['primitiveCollection']['contains'](this)&&(this['_noDestroy']=!![],this[_0x220686(0x165)][_0x220686(0x13d)](this),this['_noDestroy']=![]),this['_clearDrawCommand']();}['update'](_0x5c62bf){var _0x1c6424=_0xf77eb6;if(!this['show'])return;this['fire'](mars3d__namespace[_0x1c6424(0x224)]['preUpdate'],{'time':_0x5c62bf[_0x1c6424(0x2fc)]}),this['_length']instanceof Cesium$4['CallbackProperty']&&this[_0x1c6424(0x1ef)](),this[_0x1c6424(0x232)](_0x5c62bf['time']),_0x5c62bf[_0x1c6424(0x186)]===Cesium$4['SceneMode']['SCENE3D']?((!Cesium$4[_0x1c6424(0x1a2)](this[_0x1c6424(0x294)])||this['_drawCommands']['length']===0x0)&&(this[_0x1c6424(0x308)][_0x1c6424(0x31b)]=Cesium$4[_0x1c6424(0x24a)]['fromVertices'](this['_geometry']['attributes']['position']['values']),this['_drawCommands']=[],this['_pickCommands']=[],this[_0x1c6424(0x294)][_0x1c6424(0x141)](this[_0x1c6424(0x2f0)](this['_geometry'],_0x5c62bf)),this['_outline']&&this[_0x1c6424(0x294)]['push'](this['createDrawCommand'](this['_outlineGeometry'],_0x5c62bf,!![])),this['_topShow']&&(this['_drawCommands']['push'](this[_0x1c6424(0x2f0)](this['_topGeometry'],_0x5c62bf)),this['_topOutlineShow']&&this['_drawCommands']['push'](this['createDrawCommand'](this['_topOutlineGeometry'],_0x5c62bf,!![])))),_0x5c62bf['passes'][_0x1c6424(0x114)]?this[_0x1c6424(0x294)]&&_0x5c62bf['commandList'][_0x1c6424(0x141)](...this[_0x1c6424(0x294)]):this[_0x1c6424(0x307)]&&_0x5c62bf['commandList']['push'](...this['_pickCommands']),this['_groundCircleEntity']&&(this['_groundCircleEntity']['show']=this[_0x1c6424(0x26e)]&&this['_pitchRadians']===0x0&&this['_rollRadians']===0x0),this['_groundConeEntity']&&(this['_groundConeEntity'][_0x1c6424(0x188)]=![])):(this[_0x1c6424(0x105)]&&(this['_pitchRadians']!==0x0||this['_rollRadians']!==0x0)&&(this['_groundConeEntity'][_0x1c6424(0x188)]=!![]),!this['_groundCircleEntity']&&this['_addGroundCircleEntity'](!![]),this['_groundCircleEntity']['show']=this['_pitchRadians']===0x0&&this['_rollRadians']===0x0),this['fire'](mars3d__namespace[_0x1c6424(0x224)]['postUpdate'],{'time':_0x5c62bf['time']});}['_clearDrawCommand'](){var _0x5d47c0=_0xf77eb6;this[_0x5d47c0(0x294)]&&this[_0x5d47c0(0x294)]['length']>0x0&&(this[_0x5d47c0(0x294)]['forEach'](function(_0x405a95){var _0x44a60c=_0x5d47c0;_0x405a95['vertexArray']&&_0x405a95[_0x44a60c(0x1aa)]['destroy'](),_0x405a95['shaderProgram']&&_0x405a95['shaderProgram']['destroy']();}),delete this[_0x5d47c0(0x294)]),this['_pickCommands']&&this['_pickCommands']['length']>0x0&&(this[_0x5d47c0(0x307)]['forEach'](function(_0x25d3ff){var _0x5e5cef=_0x5d47c0;_0x25d3ff['vertexArray']&&_0x25d3ff[_0x5e5cef(0x1aa)][_0x5e5cef(0x2c4)](),_0x25d3ff['shaderProgram']&&_0x25d3ff['shaderProgram'][_0x5e5cef(0x2c4)]();}),delete this['_pickCommands']);}[_0xf77eb6(0x2f0)](_0x3800c2,_0x290656,_0x54df4f){var _0x34086b=_0xf77eb6;const _0x5682f3=_0x290656['context'],_0x16dad5=this['style'][_0x34086b(0x1ae)]??!![],_0x509bdf=this['style'][_0x34086b(0x10a)]??!![],_0x142977=Cesium$4['Appearance'][_0x34086b(0x2f7)](_0x16dad5,_0x509bdf,this['options']['renderState']),_0x5bd6e8=Cesium$4['RenderState']['fromCache'](_0x142977),_0x4db529=Cesium$4['GeometryPipeline']['createAttributeLocations'](_0x3800c2),_0x55ba27=Cesium$4['ShaderProgram']['replaceCache']({'context':_0x5682f3,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':this['_replaceFragmentShaderSourceByStyle'](SatelliteSensorFS),'attributeLocations':_0x4db529}),_0x566a2d=Cesium$4['VertexArray']['fromGeometry']({'context':_0x5682f3,'geometry':_0x3800c2,'attributeLocations':_0x4db529,'bufferUsage':Cesium$4['BufferUsage'][_0x34086b(0x305)]}),_0x4d3785=new Cesium$4['Cartesian3']();Cesium$4[_0x34086b(0x1ad)]['multiplyByPoint'](this['_matrix'],_0x3800c2['boundingSphere'][_0x34086b(0x31c)],_0x4d3785);const _0x100dec=new Cesium$4[(_0x34086b(0x24a))](_0x4d3785,_0x3800c2['boundingSphere']['radius']),_0x4b4163=new Cesium$4[(_0x34086b(0x1d5))]({'primitiveType':_0x3800c2['primitiveType'],'shaderProgram':_0x55ba27,'vertexArray':_0x566a2d,'modelMatrix':this['_matrix'],'renderState':_0x5bd6e8,'boundingVolume':_0x100dec,'uniformMap':{'marsColor':_0x54df4f?()=>{var _0x4f4fd7=_0x34086b;return this[_0x4f4fd7(0x22f)];}:()=>{return this['_color'];},'globalAlpha':()=>{return this['style']['globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$4[_0x34086b(0x163)]['TRANSLUCENT'],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$4['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x4b4163),_0x4b4163[_0x34086b(0x2dd)]=_0x5682f3['createPickId']({'primitive':_0x4b4163,'id':this['id']});if(!_0x54df4f){const _0x47e62f=new Cesium$4[(_0x34086b(0x1d5))]({'owner':_0x4b4163,'primitiveType':_0x3800c2[_0x34086b(0x128)],'pickOnly':!![]});_0x47e62f[_0x34086b(0x1aa)]=_0x566a2d,_0x47e62f[_0x34086b(0x267)]=_0x5bd6e8;const _0x160959=Cesium$4['ShaderProgram'][_0x34086b(0x20d)]({'context':_0x5682f3,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$4['ShaderSource']['createPickFragmentShaderSource'](SatelliteSensorFS,_0x34086b(0x21e)),'attributeLocations':_0x4db529});_0x47e62f['shaderProgram']=_0x160959,_0x47e62f['uniformMap']=_0x4b4163['uniformMap'],_0x47e62f['uniformMap']['czm_pickColor']=()=>{var _0x3471a7=_0x34086b;return _0x4b4163['pickId'][_0x3471a7(0x2be)];},_0x47e62f['pass']=Cesium$4[_0x34086b(0x163)][_0x34086b(0x175)],_0x47e62f['boundingVolume']=_0x100dec,_0x47e62f['modelMatrix']=this[_0x34086b(0x18f)],this['_pickCommands'][_0x34086b(0x141)](_0x47e62f);}return _0x4b4163;}['computeMatrix'](_0x4ef752,_0x1f11ef){var _0x33d653=_0xf77eb6;this['_positionCartesian']=mars3d__namespace['PointUtil'][_0x33d653(0x2eb)](this['position'],_0x4ef752);if(!this['_positionCartesian'])return this['_matrix']=new Cesium$4[(_0x33d653(0x1ad))](),this['_matrix'];if(this[_0x33d653(0x1f9)]){const _0x5e3113=this['_positionCartesian'],_0x3f073c=mars3d__namespace[_0x33d653(0x19c)][_0x33d653(0x2eb)](this['_lookAt'],_0x4ef752);if(Cesium$4['defined'](_0x3f073c)){this['length']=Cesium$4['Cartesian3']['distance'](_0x5e3113,_0x3f073c);const _0x350be8=mars3d__namespace['PointUtil']['getHeadingPitchRollForLine'](_0x5e3113,_0x3f073c,this['ellipsoid'],this['_fixedFrameTransform']);this[_0x33d653(0x11a)]=_0x350be8['pitch'],this['_rollRadians']=_0x350be8['roll'],!(this['_headingRadians']instanceof Cesium$4[_0x33d653(0x28d)])&&(this['_headingRadians']=_0x350be8['heading']);}}if(this['style']['rayEllipsoid']){const _0x5c2c8b=this['getRayEarthLength']();this[_0x33d653(0x318)]=_0x5c2c8b>0x0;if(this[_0x33d653(0x318)]){if(this['style']['hideRayEllipsoid'])return this[_0x33d653(0x18f)]=new Cesium$4['Matrix4'](),this[_0x33d653(0x18f)];this[_0x33d653(0x31f)]=_0x5c2c8b;}}return this['_modelMatrix']=this[_0x33d653(0x2c0)](this['_positionCartesian'],this[_0x33d653(0xf7)],this['_modelMatrix']),this['_quaternion']=Cesium$4['Quaternion']['fromHeadingPitchRoll'](new Cesium$4['HeadingPitchRoll'](this['headingRadians'],this['_pitchRadians'],this['_rollRadians']),this['_quaternion']),this['_matrix']=Cesium$4[_0x33d653(0x1ad)][_0x33d653(0x2e3)](this['_translation'],this[_0x33d653(0x1f6)],this['_scale'],this['_matrix']),Cesium$4['Matrix4']['multiplyTransformation'](this['_modelMatrix'],this['_matrix'],this[_0x33d653(0x18f)]),this[_0x33d653(0x18f)];}[_0xf77eb6(0x1ef)](){var _0x216c89=_0xf77eb6;if(!this[_0x216c89(0x219)])return;const _0x1b6a71=this['length'];this['_geometry']=ConicGeometry['createGeometry'](new ConicGeometry({'topRadius':_0x1b6a71*Math[_0x216c89(0x1b8)](Cesium$4[_0x216c89(0x223)][_0x216c89(0x151)](this['angle'])),'bottomRadius':0x0,'length':_0x1b6a71*Math[_0x216c89(0x280)](Cesium$4[_0x216c89(0x223)][_0x216c89(0x151)](this['angle'])),'zReverse':this[_0x216c89(0x1bd)]})),this['_topGeometry']=this['getTopGeometry'](),this['_topOutlineGeometry']=this['getTopOutlineGeometry'](),this['_outlineGeometry']=ConicGeometry['createOutlineGeometry'](new ConicGeometry({'topRadius':_0x1b6a71*Math['cos'](Cesium$4[_0x216c89(0x223)]['toRadians'](this[_0x216c89(0xf1)])),'bottomRadius':0x0,'slices':0x80,'length':_0x1b6a71*Math['sin'](Cesium$4['Math']['toRadians'](this['angle'])),'zReverse':this['_reverse']})),this['_attributes_positions']=new Float32Array(this['_geometry']['attributes'][_0x216c89(0x18b)]['values']['length']);for(let _0x3ca640=0x0;_0x3ca640{return this['_ground_radius'];},![]),'semiMajorAxis':new Cesium$4['CallbackProperty'](_0x64b9d3=>{return this['_ground_radius'];},![]),'material':this['_color']},'show':this['_pitchRadians']===0x0&&this['_rollRadians']===0x0});}['updateGroundCircleRadius'](){var _0x49121f=_0xf77eb6;this[_0x49121f(0x198)]=this[_0x49121f(0x31f)]*Math['cos'](Cesium$4[_0x49121f(0x223)][_0x49121f(0x151)](this[_0x49121f(0x184)]));}['_addGroundConeEntity'](){var _0x95dd46=_0xf77eb6;if(this['_groundConeEntity'])return;const _0x4fe27b=this;this[_0x95dd46(0x105)]=this['_map']['entities'][_0x95dd46(0x1b1)]({'polygon':{'arcType':Cesium$4['ArcType']['RHUMB'],'hierarchy':new Cesium$4['CallbackProperty'](function(_0x2fad7a,_0x505544){var _0x55e00d=_0x95dd46;return new Cesium$4[(_0x55e00d(0x2fb))](_0x4fe27b['_computeGroundConePositions'](_0x2fad7a));},![]),'outline':!![],'outlineColor':Cesium$4[_0x95dd46(0x173)]['WHITE']['withAlpha'](0x1),'outlineWidth':0x1,'material':Cesium$4['Color']['RED'][_0x95dd46(0x247)](0.5)},'show':this['_map']['scene']['mode']===Cesium$4['SceneMode']['SCENE2D']});}['_computeGroundConePositions'](_0x5a9daf){var _0x5d81c6=_0xf77eb6;const _0x37397c=[],_0x1b9fc9=mars3d__namespace[_0x5d81c6(0x19c)]['getPositionValue'](this['position'],_0x5a9daf);if(!_0x1b9fc9)return _0x37397c;const _0x3e9f7d=this['length'],_0x5ed349=_0x3e9f7d*Math['sin'](Cesium$4['Math']['toRadians'](0x5a-this['_angle'])),_0x4faa55=Cesium$4[_0x5d81c6(0x1ad)]['multiplyByPoint'](this['_matrix'],this['lbcenter'],new Cesium$4['Cartesian3']()),_0x624404=Cesium$4[_0x5d81c6(0x278)]['subtract'](_0x4faa55,_0x1b9fc9,new Cesium$4['Cartesian3']()),_0x7d6e6a=Cesium$4['Cartesian3']['cross'](_0x624404,_0x4faa55,new Cesium$4[(_0x5d81c6(0x278))]()),_0x36ff9e=Cesium$4['Cartesian3']['cross'](_0x4faa55,_0x624404,new Cesium$4[(_0x5d81c6(0x278))]());for(let _0x1d0515=0x0;_0x1d0515<=this['_hintPotsNum'];_0x1d0515++){let _0x3ca674=new Cesium$4['Ray'](_0x4faa55,_0x7d6e6a);const _0x27e3bc=_0x5ed349*_0x1d0515/this['_hintPotsNum'],_0x5a94c3=Cesium$4['Ray'][_0x5d81c6(0x2a8)](_0x3ca674,_0x27e3bc,new Cesium$4[(_0x5d81c6(0x278))]()),_0x573215=Cesium$4['Cartesian3']['subtract'](_0x5a94c3,_0x1b9fc9,new Cesium$4['Cartesian3']());_0x3ca674=new Cesium$4['Ray'](_0x1b9fc9,_0x573215);const _0x34fad5=Cesium$4['Ray']['getPoint'](_0x3ca674,_0x3e9f7d,new Cesium$4[(_0x5d81c6(0x278))]());_0x37397c['push'](_0x34fad5);}_0x37397c['push'](_0x1b9fc9);for(let _0x3a1570=this['_hintPotsNum'];_0x3a1570>=0x0;_0x3a1570--){let _0x335832=new Cesium$4['Ray'](_0x4faa55,_0x36ff9e);const _0x56b839=_0x5ed349*_0x3a1570/this['_hintPotsNum'],_0x202e3d=Cesium$4[_0x5d81c6(0x30d)]['getPoint'](_0x335832,_0x56b839,new Cesium$4[(_0x5d81c6(0x278))]()),_0x2676fd=Cesium$4['Cartesian3'][_0x5d81c6(0x243)](_0x202e3d,_0x1b9fc9,new Cesium$4[(_0x5d81c6(0x278))]());_0x335832=new Cesium$4['Ray'](_0x1b9fc9,_0x2676fd);const _0x30fd29=Cesium$4[_0x5d81c6(0x30d)]['getPoint'](_0x335832,_0x3e9f7d,new Cesium$4['Cartesian3']());_0x37397c[_0x5d81c6(0x141)](_0x30fd29);}return _0x37397c;}['getRayEarthLength'](){var _0xd098b4=_0xf77eb6;let _0x357336=0x0;const _0x3c9b9b=mars3d__namespace['PointUtil']['getRayEarthPosition'](this[_0xd098b4(0x256)],new Cesium$4['HeadingPitchRoll'](this['headingRadians'],this['_pitchRadians'],this['_rollRadians']),this[_0xd098b4(0x1bd)]);if(_0x3c9b9b){const _0x9d106a=Cesium$4[_0xd098b4(0x278)][_0xd098b4(0x2c5)](this['_positionCartesian'],_0x3c9b9b);if(_0x9d106a>_0x357336)return _0x357336=_0x9d106a,_0x357336;}return _0x357336;}['getRayEarthPositions'](){var _0x258419=_0xf77eb6;const _0x15b9e4=this[_0x258419(0x256)],_0x34152c=Cesium$4['Math']['toRadians'](this['pitch']+this['_angle']),_0x5cdb09=Cesium$4['Math']['toRadians'](this['pitch']-this['_angle']),_0x5d8013=Cesium$4['Math']['toRadians'](this['roll']+this['_angle']),_0x582a6f=Cesium$4[_0x258419(0x223)][_0x258419(0x151)](this['roll']-this[_0x258419(0x184)]),_0xb3103a=mars3d__namespace[_0x258419(0x19c)][_0x258419(0x29f)](_0x15b9e4,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x34152c,_0x5d8013),this['_reverse']),_0x2f0d3d=mars3d__namespace['PointUtil'][_0x258419(0x29f)](_0x15b9e4,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x34152c,_0x582a6f),this['_reverse']),_0x1112fa=mars3d__namespace[_0x258419(0x19c)]['getRayEarthPosition'](_0x15b9e4,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x5cdb09,_0x582a6f),this['_reverse']),_0x3ba870=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x15b9e4,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x5cdb09,_0x5d8013),this[_0x258419(0x1bd)]);return[_0xb3103a,_0x2f0d3d,_0x1112fa,_0x3ba870];}[_0xf77eb6(0x179)](_0x2809a8,_0x4ffc10){var _0x240549=_0xf77eb6;return _0x2809a8[_0x240549(0x1ff)]=![],mars3d__namespace['GraphicUtil']['create']('point',_0x2809a8);}}mars3d__namespace['graphic'][_0xf77eb6(0x24f)]=ConicSensor,mars3d__namespace[_0xf77eb6(0x26f)]['register']('conicSensor',ConicSensor,!![]);const Cesium$3=mars3d__namespace['Cesium'];class RectGeometry{constructor(_0x3b6a85){var _0x5afbea=_0xf77eb6;this['_length']=_0x3b6a85['length'],this[_0x5afbea(0x1e2)]=_0x3b6a85['topWidth'],this['_topHeight']=_0x3b6a85['topHeight'],this['_bottomWidth']=_0x3b6a85['bottomWidth'],this['_bottomHeight']=_0x3b6a85[_0x5afbea(0x119)],this[_0x5afbea(0x196)]=_0x3b6a85['zReverse'],this['_slices']=_0x3b6a85['slices']??0x8,this[_0x5afbea(0x12a)]=_0x3b6a85['slices']??0x8;}static['fromAnglesLength'](_0xb47e32,_0x143f53,_0x388187,_0x1ffc17){var _0x400148=_0xf77eb6;const _0x1f996e=Math['max'](Math[_0x400148(0x27f)](Math['max'](_0xb47e32,_0x143f53,0x1)*0x2),0x40),_0x12a277={'length':_0x388187,'zReverse':_0x1ffc17,'bottomHeight':_0x388187,'bottomWidth':_0x388187,'topHeight':_0x388187,'topWidth':_0x388187,'slices':_0x1f996e};return _0xb47e32=Cesium$3['Math']['toRadians'](_0xb47e32),_0x143f53=Cesium$3['Math']['toRadians'](_0x143f53),!_0x1ffc17?(_0x12a277['topHeight']=0x0,_0x12a277['topWidth']=0x0,_0x12a277[_0x400148(0x119)]=_0x388187*Math['tan'](_0xb47e32),_0x12a277[_0x400148(0x2d8)]=_0x388187*Math['tan'](_0x143f53)):(_0x12a277[_0x400148(0x119)]=0x0,_0x12a277['bottomWidth']=0x0,_0x12a277[_0x400148(0x29b)]=_0x388187*Math[_0x400148(0x20b)](_0xb47e32),_0x12a277[_0x400148(0x11b)]=_0x388187*Math['tan'](_0x143f53)),new RectGeometry(_0x12a277);}static[_0xf77eb6(0x136)](_0x221b4a,_0xe4410b){var _0x232236=_0xf77eb6;if(!_0xe4410b)return RectGeometry['_createGeometry'](_0x221b4a);const _0x24e466=new Cesium$3['Cartesian3'](),_0x1e4ebf=new Cesium$3['Ray']();Cesium$3['Matrix4']['multiplyByPoint'](_0xe4410b,Cesium$3[_0x232236(0x278)][_0x232236(0x2ee)],_0x24e466),_0x24e466['clone'](_0x1e4ebf['origin']);const _0x4c6d80=_0x221b4a[_0x232236(0x12a)],_0x46a4ac=_0x221b4a['_topWidth'],_0x2c484e=_0x221b4a['_topHeight'],_0x22ddbb=_0x221b4a[_0x232236(0x196)],_0x5c474f=(_0x22ddbb?-0x1:0x1)*_0x221b4a['_length'];let _0x29d5fb=[],_0x59219a=[],_0x3c1fd5=[];const _0x199eb5=_0x46a4ac,_0x2e1c8c=_0x2c484e,_0x27fd45=_0x4c6d80,_0x353116=_0x4c6d80;let _0x115560=0x0;_0x29d5fb[_0x232236(0x141)](0x0,0x0,0x0),_0x3c1fd5['push'](0x1,0x1),_0x115560++;const _0xa99870=new Cesium$3[(_0x232236(0x278))](),_0x38893b=[];for(let _0x53c032=-_0x353116;_0x53c032<=_0x353116;_0x53c032++){const _0xf74d1b=[];for(let _0x58c7d2=-_0x27fd45;_0x58c7d2<=_0x27fd45;_0x58c7d2++){const _0x1e36f1=_0x2e1c8c*_0x53c032/_0x353116,_0x43af4c=_0x199eb5*_0x58c7d2/_0x27fd45;_0xa99870['x']=_0x43af4c,_0xa99870['y']=_0x1e36f1,_0xa99870['z']=_0x5c474f;const _0x36aab3=mars3d__namespace['PointUtil'][_0x232236(0x1dd)](_0xa99870,_0xe4410b,_0x1e4ebf);!_0x36aab3?(_0x29d5fb['push'](_0x43af4c,_0x1e36f1,_0x5c474f),_0x3c1fd5['push'](0x1,0x1),_0xf74d1b[_0x232236(0x141)](_0x115560),_0x115560++):(_0x29d5fb['push'](_0x43af4c,_0x1e36f1,_0x5c474f),_0x3c1fd5['push'](0x1,0x1),_0xf74d1b['push'](_0x115560),_0x115560++);}_0x38893b['push'](_0xf74d1b);}const _0x22fc16=[0x0,_0x38893b[_0x232236(0x31f)]-0x1];let _0x1a95de,_0xa15f08;for(let _0xa68de8=0x0;_0xa68de8<_0x22fc16[_0x232236(0x31f)];_0xa68de8++){const _0x1ae9e3=_0x22fc16[_0xa68de8];for(let _0x43254f=0x1;_0x43254f<_0x38893b[_0x1ae9e3]['length'];_0x43254f++){_0x1a95de=_0x38893b[_0x1ae9e3][_0x43254f-0x1],_0xa15f08=_0x38893b[_0x1ae9e3][_0x43254f],_0x1a95de>=0x0&&_0xa15f08>=0x0&&_0x59219a['push'](0x0,_0x1a95de,_0xa15f08);}}for(let _0x371a28=0x0;_0x371a28<_0x38893b['length'];_0x371a28++){if(_0x371a28===0x0||_0x371a28===_0x38893b['length']-0x1)for(let _0x3ea987=0x1;_0x3ea987<_0x38893b['length'];_0x3ea987++){_0x1a95de=_0x38893b[_0x3ea987-0x1][_0x371a28],_0xa15f08=_0x38893b[_0x3ea987][_0x371a28],_0x1a95de>=0x0&&_0xa15f08>=0x0&&_0x59219a['push'](0x0,_0x1a95de,_0xa15f08);}}_0x29d5fb=new Float32Array(_0x29d5fb),_0x59219a=new Int32Array(_0x59219a),_0x3c1fd5=new Float32Array(_0x3c1fd5);const _0x4e57f9={'position':new Cesium$3[(_0x232236(0x1c7))]({'componentDatatype':Cesium$3['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x29d5fb}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x3c1fd5})},_0x4197fa=Cesium$3['BoundingSphere']['fromVertices'](_0x29d5fb),_0x4a0e0b=new Cesium$3[(_0x232236(0x21b))]({'attributes':_0x4e57f9,'indices':_0x59219a,'primitiveType':Cesium$3[_0x232236(0x218)]['TRIANGLES'],'boundingSphere':_0x4197fa});return _0x4a0e0b['myindexs']=_0x59219a,computeVertexNormals(_0x4a0e0b),_0x29d5fb=[],_0x59219a=[],_0x4a0e0b;}static[_0xf77eb6(0x149)](_0x31864b){var _0x272f13=_0xf77eb6;const _0xaebc0e=_0x31864b[_0x272f13(0x162)],_0x343e15=_0x31864b[_0x272f13(0x1df)],_0x4963d1=_0x31864b[_0x272f13(0x1e2)],_0x75969a=_0x31864b['_topHeight'],_0x3c186a=_0x31864b['_zReverse'],_0x4b2a1a=(_0x3c186a?-0x1:0x1)*_0x31864b['_length'];let _0x3400e1=new Float32Array(0x8*0x3),_0x9981c5=[],_0x1a5129=[];const _0x3c7fc2=new Cesium$3['Cartesian3'](0x0,0x0,_0x4b2a1a),_0x22cc26=[0x0,_0x4b2a1a],_0x417b68=[_0xaebc0e,_0x4963d1],_0x3b0d45=[_0x343e15,_0x75969a];let _0x14131c=0x0;for(let _0x533eb0=0x0;_0x533eb0<0x2;_0x533eb0++){_0x3400e1[_0x14131c*0x3]=-_0x417b68[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x1]=-_0x3b0d45[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x2]=_0x22cc26[_0x533eb0],_0x1a5129[_0x14131c*0x2]=_0x533eb0,_0x1a5129[_0x14131c*0x2+0x1]=0x0,_0x14131c++,_0x3400e1[_0x14131c*0x3]=-_0x417b68[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x1]=_0x3b0d45[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x2]=_0x22cc26[_0x533eb0],_0x1a5129[_0x14131c*0x2]=_0x533eb0,_0x1a5129[_0x14131c*0x2+0x1]=0x0,_0x14131c++,_0x3400e1[_0x14131c*0x3]=_0x417b68[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x1]=_0x3b0d45[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x2]=_0x22cc26[_0x533eb0],_0x1a5129[_0x14131c*0x2]=_0x533eb0,_0x1a5129[_0x14131c*0x2+0x1]=0x0,_0x14131c++,_0x3400e1[_0x14131c*0x3]=_0x417b68[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x1]=-_0x3b0d45[_0x533eb0]/0x2,_0x3400e1[_0x14131c*0x3+0x2]=_0x22cc26[_0x533eb0],_0x1a5129[_0x14131c*0x2]=_0x533eb0,_0x1a5129[_0x14131c*0x2+0x1]=0x0,_0x14131c++;}_0x9981c5[_0x272f13(0x141)](0x0,0x1,0x3),_0x9981c5[_0x272f13(0x141)](0x1,0x2,0x3),_0x9981c5['push'](0x0,0x4,0x5),_0x9981c5['push'](0x0,0x5,0x1),_0x9981c5['push'](0x1,0x2,0x6),_0x9981c5['push'](0x1,0x6,0x5),_0x9981c5['push'](0x2,0x3,0x7),_0x9981c5[_0x272f13(0x141)](0x7,0x6,0x2),_0x9981c5[_0x272f13(0x141)](0x0,0x3,0x7),_0x9981c5[_0x272f13(0x141)](0x7,0x4,0x0),_0x9981c5[_0x272f13(0x141)](0x4,0x5,0x6),_0x9981c5['push'](0x6,0x7,0x4),_0x9981c5=new Int16Array(_0x9981c5),_0x1a5129=new Float32Array(_0x1a5129);const _0x508482={'position':new Cesium$3[(_0x272f13(0x1c7))]({'componentDatatype':Cesium$3['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x3400e1}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0x272f13(0x13f)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x1a5129})},_0x2eb79a=Cesium$3[_0x272f13(0x24a)]['fromVertices'](_0x3400e1);let _0x20bc8b=new Cesium$3['Geometry']({'attributes':_0x508482,'indices':_0x9981c5,'primitiveType':Cesium$3['PrimitiveType'][_0x272f13(0x176)],'boundingSphere':_0x2eb79a});return _0x20bc8b=Cesium$3['GeometryPipeline'][_0x272f13(0x28c)](_0x20bc8b),_0x3400e1=[],_0x9981c5=[],_0x20bc8b[_0x272f13(0x2b9)]=_0x3c7fc2,_0x20bc8b;}static['createOutlineGeometry'](_0xc929da){var _0x46fd21=_0xf77eb6;const _0x5a8154=_0xc929da['_bottomWidth'],_0xf50738=_0xc929da[_0x46fd21(0x1df)],_0x5e078b=_0xc929da['_topWidth'],_0x5de6ca=_0xc929da['_topHeight'],_0x13b737=_0xc929da['_zReverse'],_0x4d9ac9=(_0x13b737?-0x1:0x1)*_0xc929da['_length'];let _0x5f5870=new Float32Array(0x8*0x3),_0x49f589=[],_0x4930c8=[];const _0xc0a0e0=[0x0,_0x4d9ac9],_0x10221a=[_0x5a8154,_0x5e078b],_0x40df96=[_0xf50738,_0x5de6ca];let _0xb4e162=0x0;for(let _0x275afc=0x0;_0x275afc<0x2;_0x275afc++){_0x5f5870[_0xb4e162*0x3]=-_0x10221a[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x1]=-_0x40df96[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x2]=_0xc0a0e0[_0x275afc],_0x4930c8[_0xb4e162*0x2]=_0x275afc,_0x4930c8[_0xb4e162*0x2+0x1]=0x0,_0xb4e162++,_0x5f5870[_0xb4e162*0x3]=-_0x10221a[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x1]=_0x40df96[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x2]=_0xc0a0e0[_0x275afc],_0x4930c8[_0xb4e162*0x2]=_0x275afc,_0x4930c8[_0xb4e162*0x2+0x1]=0x0,_0xb4e162++,_0x5f5870[_0xb4e162*0x3]=_0x10221a[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x1]=_0x40df96[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x2]=_0xc0a0e0[_0x275afc],_0x4930c8[_0xb4e162*0x2]=_0x275afc,_0x4930c8[_0xb4e162*0x2+0x1]=0x0,_0xb4e162++,_0x5f5870[_0xb4e162*0x3]=_0x10221a[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x1]=-_0x40df96[_0x275afc]/0x2,_0x5f5870[_0xb4e162*0x3+0x2]=_0xc0a0e0[_0x275afc],_0x4930c8[_0xb4e162*0x2]=_0x275afc,_0x4930c8[_0xb4e162*0x2+0x1]=0x0,_0xb4e162++;}_0x49f589['push'](0x0,0x1,0x1,0x2),_0x49f589[_0x46fd21(0x141)](0x2,0x3,0x3,0x0),_0x49f589['push'](0x0,0x4),_0x49f589['push'](0x1,0x5),_0x49f589['push'](0x2,0x6),_0x49f589['push'](0x3,0x7),_0x49f589['push'](0x4,0x5,0x5,0x6),_0x49f589[_0x46fd21(0x141)](0x6,0x7,0x7,0x4),_0x49f589=new Int16Array(_0x49f589),_0x4930c8=new Float32Array(_0x4930c8);const _0x5b5754={'position':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0x46fd21(0x13f)]['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x5f5870}),'st':new Cesium$3[(_0x46fd21(0x1c7))]({'componentDatatype':Cesium$3['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x4930c8})},_0x2cbd7e=Cesium$3[_0x46fd21(0x24a)]['fromVertices'](_0x5f5870),_0x59ce27=new Cesium$3[(_0x46fd21(0x21b))]({'attributes':_0x5b5754,'indices':_0x49f589,'primitiveType':Cesium$3[_0x46fd21(0x218)][_0x46fd21(0x21d)],'boundingSphere':_0x2cbd7e});return _0x5f5870=[],_0x49f589=[],_0x59ce27;}static['createOutlineGeometry2'](_0x2d3721){var _0x15451a=_0xf77eb6;const _0x41444a=_0x2d3721[_0x15451a(0x1e2)],_0x434720=_0x2d3721['_topHeight'],_0x52c2df=_0x2d3721[_0x15451a(0x196)],_0x3b7ee9=(_0x52c2df?-0x1:0x1)*_0x2d3721['_length'];let _0x24492a=[],_0x388998=[],_0x16bd2b=[];const _0x1bbcce=_0x41444a/0x2,_0x14cd03=_0x434720/0x2,_0x3d9432=0x10,_0x45dcb8=0x10;let _0x1d4503=0x0;_0x24492a['push'](0x0,0x0,0x0),_0x16bd2b['push'](0x1,0x1),_0x1d4503++;const _0x5c5c43=[];for(let _0x3d7aea=-_0x45dcb8;_0x3d7aea<_0x45dcb8;_0x3d7aea++){const _0x37c318=[];for(let _0x810727=-_0x3d9432;_0x810727<_0x3d9432;_0x810727++){_0x37c318['push'](_0x1d4503);const _0x453f4d=_0x14cd03*_0x3d7aea/_0x45dcb8,_0x212d8a=_0x1bbcce*_0x810727/_0x3d9432;_0x24492a['push'](_0x212d8a,_0x453f4d,_0x3b7ee9),_0x16bd2b['push'](0x1,0x1),_0x1d4503++;}_0x5c5c43['push'](_0x37c318);}const _0x3bc516=[0x0,_0x5c5c43[_0x15451a(0x31f)]-0x1];let _0x4eba19,_0x497d83;for(let _0x3da8d8=0x0;_0x3da8d8<_0x3bc516['length'];_0x3da8d8++){const _0x492dd8=_0x3bc516[_0x3da8d8];for(let _0x3634b1=0x1;_0x3634b1<_0x5c5c43[_0x492dd8][_0x15451a(0x31f)];_0x3634b1++){_0x4eba19=_0x5c5c43[_0x492dd8][_0x3634b1-0x1],_0x497d83=_0x5c5c43[_0x492dd8][_0x3634b1],_0x388998[_0x15451a(0x141)](0x0,_0x4eba19,_0x497d83);}}const _0x1ad71d=[0x0,_0x5c5c43[0x0]['length']-0x1];for(let _0x3f470e=0x0;_0x3f470e<_0x1ad71d[_0x15451a(0x31f)];_0x3f470e++){const _0x484636=_0x1ad71d[_0x3f470e];for(let _0x3a8aae=0x1;_0x3a8aae<_0x5c5c43['length'];_0x3a8aae++){_0x4eba19=_0x5c5c43[_0x3a8aae-0x1][_0x484636],_0x497d83=_0x5c5c43[_0x3a8aae][_0x484636],_0x388998['push'](0x0,_0x4eba19,_0x497d83);}}_0x24492a=new Float32Array(_0x24492a),_0x388998=new Int16Array(_0x388998),_0x16bd2b=new Float32Array(_0x16bd2b);const _0x3229db={'position':new Cesium$3[(_0x15451a(0x1c7))]({'componentDatatype':Cesium$3['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x24492a}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0x15451a(0x13f)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x16bd2b})},_0xc9fbb=Cesium$3['BoundingSphere']['fromVertices'](_0x24492a),_0x82bfa2=new Cesium$3['Geometry']({'attributes':_0x3229db,'indices':_0x388998,'primitiveType':Cesium$3['PrimitiveType']['TRIANGLES'],'boundingSphere':_0xc9fbb});return computeVertexNormals(_0x82bfa2),Cesium$3['GeometryPipeline']['toWireframe'](_0x82bfa2),_0x24492a=[],_0x388998=[],_0x82bfa2;}}const Cesium$2=mars3d__namespace['Cesium'],BasePointPrimitive$1=mars3d__namespace['graphic']['BasePointPrimitive'];class RectSensor extends BasePointPrimitive$1{constructor(_0x10e301={}){var _0x94c22f=_0xf77eb6;super(_0x10e301),this[_0x94c22f(0x27b)]=Cesium$2['Matrix4'][_0x94c22f(0x1d1)](Cesium$2['Matrix4']['IDENTITY']),this[_0x94c22f(0x1f6)]=new Cesium$2['Quaternion'](),this['_translation']=new Cesium$2[(_0x94c22f(0x278))](),this['_scale']=new Cesium$2['Cartesian3'](0x1,0x1,0x1),this[_0x94c22f(0x18f)]=new Cesium$2['Matrix4'](),this['_lookAt']=this['options'][_0x94c22f(0x2b4)],this['_fixedFrameTransform']=this['options']['fixedFrameTransform']??Cesium$2['Transforms']['eastNorthUpToFixedFrame'],this['_reverse']=this['options'][_0x94c22f(0x227)]??![],this['style']['globalAlpha']=0x1,this['_updateStyleHook'](_0x10e301['style'],_0x10e301['style']);}get[_0xf77eb6(0x2cc)](){return this;}get[_0xf77eb6(0x2b4)](){return this['_lookAt'];}set['lookAt'](_0x49d29f){this['_lookAt']=_0x49d29f;}get['color'](){return this['_color'];}set['color'](_0x449b3b){this['_color']=mars3d__namespace['Util']['getCesiumColor'](_0x449b3b);}get[_0xf77eb6(0x2b3)](){var _0x11f162=_0xf77eb6;return this[_0x11f162(0x22f)];}set['outlineColor'](_0x1d45dc){var _0x1c8c8f=_0xf77eb6;this[_0x1c8c8f(0x22f)]=mars3d__namespace['Util']['getCesiumColor'](_0x1d45dc);}get['outline'](){return this['_outline'];}set['outline'](_0x198faf){this['_outline']=_0x198faf,this['updateGeometry']();}get['topShow'](){return this['_topShow'];}set[_0xf77eb6(0x1cc)](_0x4f11aa){var _0x294de9=_0xf77eb6;this[_0x294de9(0x17c)]=_0x4f11aa,this[_0x294de9(0x1ef)]();}get['topOutlineShow'](){return this['_topOutlineShow'];}set['topOutlineShow'](_0x4d2c06){var _0x4fc1fa=_0xf77eb6;this[_0x4fc1fa(0x1b0)]=_0x4d2c06,this['updateGeometry']();}get['angle'](){return this['_angle1'];}set['angle'](_0x31207b){var _0x5311e9=_0xf77eb6;this[_0x5311e9(0x1d6)]=_0x31207b,this['_angle2']=_0x31207b,this[_0x5311e9(0x1ef)]();}get['angle1'](){return this['_angle1'];}set[_0xf77eb6(0x246)](_0x25d1ff){this['_angle1']=_0x25d1ff,this['updateGeometry']();}get['angle2'](){var _0xbb11d7=_0xf77eb6;return this[_0xbb11d7(0x316)];}set[_0xf77eb6(0x2fa)](_0x5f3ae0){var _0x74bba9=_0xf77eb6;this['_angle2']=_0x5f3ae0,this[_0x74bba9(0x1ef)]();}get['length'](){var _0x164d0f=_0xf77eb6;return mars3d__namespace['Util'][_0x164d0f(0x178)](this['_length'],Number);}set['length'](_0x257c68){this['_length']=_0x257c68,this['updateGeometry']();}get['heading'](){return Cesium$2['Math']['toDegrees'](this['headingRadians']);}set['heading'](_0x4d2e45){var _0x5c41cb=_0xf77eb6;_0x4d2e45 instanceof Cesium$2[_0x5c41cb(0x28d)]?this['_headingRadians']=_0x4d2e45:this['_headingRadians']=Cesium$2[_0x5c41cb(0x223)]['toRadians'](_0x4d2e45);}get['headingRadians'](){return this['_headingRadians']instanceof Cesium$2['CallbackProperty']?Cesium$2['Math']['toRadians'](mars3d__namespace['Util']['getCesiumValue'](this['_headingRadians'],Number)):this['_headingRadians'];}get['pitch'](){var _0x4296e8=_0xf77eb6;return Cesium$2[_0x4296e8(0x223)]['toDegrees'](this['_pitchRadians']);}set['pitch'](_0x29e496){this['_pitchRadians']=Cesium$2['Math']['toRadians'](_0x29e496);}get['roll'](){return Cesium$2['Math']['toDegrees'](this['_rollRadians']);}set['roll'](_0x4c6e15){var _0x1e0308=_0xf77eb6;this[_0x1e0308(0x1fe)]=Cesium$2['Math'][_0x1e0308(0x151)](_0x4c6e15);}get['matrix'](){return this['_matrix'];}get['rayPosition'](){var _0x2c82db=_0xf77eb6;if(!this['_matrix'])return null;return Cesium$2['Matrix4']['multiplyByPoint'](this[_0x2c82db(0x18f)],new Cesium$2['Cartesian3'](0x0,0x0,this['reverse']?-this['length']:this['length']),new Cesium$2['Cartesian3']());}get['reverse'](){return this['_reverse'];}get['intersectEllipsoid'](){return this['_intersectEllipsoid'];}['_updateStyleHook'](_0x8a17df,_0x25223f){var _0x1321d5=_0xf77eb6;_0x8a17df=style2Primitive(_0x8a17df),this['_angle1']=_0x8a17df[_0x1321d5(0x246)]||_0x8a17df['angle']||0x5,this['_angle2']=_0x8a17df['angle2']||_0x8a17df[_0x1321d5(0xf1)]||0x5,this[_0x1321d5(0xf3)]=_0x8a17df['length']??0x64,this['_color']=_0x8a17df[_0x1321d5(0x2be)]??new Cesium$2[(_0x1321d5(0x173))](0x0,0x1,0x1,0.2),this[_0x1321d5(0x160)]=_0x8a17df['outline']??![],this['_outlineColor']=_0x8a17df['outlineColor']??new Cesium$2['Color'](0x1,0x1,0x1,0.4),this['_topShow']=_0x8a17df['topShow']??!![],this[_0x1321d5(0x1b0)]=_0x8a17df['topOutlineShow']??this['_outline'],this[_0x1321d5(0x1b9)]=_0x8a17df['topSteps']??0x8,this['pitch']=_0x8a17df['pitch']??0x0,this['heading']=_0x8a17df['heading']??0x0,this['roll']=_0x8a17df[_0x1321d5(0xf8)]??0x0,this[_0x1321d5(0x1ef)]();}[_0xf77eb6(0x1fb)](){var _0x1f51f0=_0xf77eb6;this['ellipsoid']=this['_map']['scene']['globe'][_0x1f51f0(0xf7)];if(!this['_show'])return;this['primitiveCollection'][_0x1f51f0(0x1b1)](this),this['updateGeometry']();}[_0xf77eb6(0x201)](){var _0xc42a31=_0xf77eb6;if(!this['_map'])return;this['primitiveCollection'][_0xc42a31(0x300)](this)&&(this['_noDestroy']=!![],this['primitiveCollection'][_0xc42a31(0x13d)](this),this[_0xc42a31(0x1a3)]=![]),this[_0xc42a31(0x19d)]();}[_0xf77eb6(0x229)](_0x22f432){var _0x57bcc7=_0xf77eb6;if(!this['show'])return;this['fire'](mars3d__namespace[_0x57bcc7(0x224)]['preUpdate'],{'time':_0x22f432['time']});this['_length']instanceof Cesium$2['CallbackProperty']&&this[_0x57bcc7(0x1ef)]();this['computeMatrix'](_0x22f432['time']);if(_0x22f432[_0x57bcc7(0x186)]===Cesium$2[_0x57bcc7(0x116)]['SCENE3D']){if(!Cesium$2['defined'](this['_drawCommands'])||this['_drawCommands'][_0x57bcc7(0x31f)]===0x0){this['_geometry']['boundingSphere']=Cesium$2[_0x57bcc7(0x24a)]['fromVertices'](this['_geometry'][_0x57bcc7(0x161)][_0x57bcc7(0x18b)]['values']),this[_0x57bcc7(0x294)]=[],this['_pickCommands']=[],this[_0x57bcc7(0x294)]['push'](this['createDrawCommand'](this[_0x57bcc7(0x308)],_0x22f432));this['_outline']&&this['_drawCommands']['push'](this['createDrawCommand'](this['_outlineGeometry'],_0x22f432,!![]));if(this['_topShow']){const _0x6ce3e1=this['createDrawCommand'](this['_topGeometry'],_0x22f432);this['_drawCommands']['push'](_0x6ce3e1);if(this['_topOutlineShow']){const _0x213265=this[_0x57bcc7(0x2f0)](this['_topOutlineGeometry'],_0x22f432,!![]);this['_drawCommands']['push'](_0x213265);}}}_0x22f432['passes']['render']?this['_drawCommands']&&_0x22f432['commandList'][_0x57bcc7(0x141)](...this['_drawCommands']):this[_0x57bcc7(0x307)]&&_0x22f432['commandList']['push'](...this[_0x57bcc7(0x307)]);}this['fire'](mars3d__namespace['EventType'][_0x57bcc7(0x255)],{'time':_0x22f432['time']});}[_0xf77eb6(0x2f0)](_0x2d9197,_0x57997f,_0x5db702){var _0x3fd5db=_0xf77eb6;const _0x2dc489=_0x57997f['context'],_0x4ed4fd=this['style']['translucent']??!![],_0x23a2a6=this['style']['closed']??![],_0x3dc0e7=Cesium$2['Appearance'][_0x3fd5db(0x2f7)](_0x4ed4fd,_0x23a2a6,this[_0x3fd5db(0x110)][_0x3fd5db(0x267)]),_0x2b309e=Cesium$2[_0x3fd5db(0x257)][_0x3fd5db(0x20d)](_0x3dc0e7),_0x221080=Cesium$2['GeometryPipeline'][_0x3fd5db(0x117)](_0x2d9197),_0xc37b51=Cesium$2['ShaderProgram'][_0x3fd5db(0x2ec)]({'context':_0x2dc489,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':this[_0x3fd5db(0x190)](SatelliteSensorFS),'attributeLocations':_0x221080}),_0x46f4c4=Cesium$2[_0x3fd5db(0x233)]['fromGeometry']({'context':_0x2dc489,'geometry':_0x2d9197,'attributeLocations':_0x221080,'bufferUsage':Cesium$2['BufferUsage']['STATIC_DRAW']}),_0x12483d=new Cesium$2[(_0x3fd5db(0x278))]();Cesium$2['Matrix4'][_0x3fd5db(0x2f1)](this['_matrix'],_0x2d9197[_0x3fd5db(0x31b)]['center'],_0x12483d);const _0x563f1c=new Cesium$2['BoundingSphere'](_0x12483d,_0x2d9197['boundingSphere'][_0x3fd5db(0x230)]),_0x54e9ef=new Cesium$2['DrawCommand']({'primitiveType':_0x2d9197['primitiveType'],'shaderProgram':_0xc37b51,'vertexArray':_0x46f4c4,'modelMatrix':this[_0x3fd5db(0x18f)],'renderState':_0x2b309e,'boundingVolume':_0x563f1c,'uniformMap':{'marsColor':_0x5db702?()=>{return this['_outlineColor'];}:()=>{var _0x579f54=_0x3fd5db;return this[_0x579f54(0x19b)];},'globalAlpha':()=>{var _0x4a022b=_0x3fd5db;return this[_0x4a022b(0x182)]['globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$2[_0x3fd5db(0x163)]['TRANSLUCENT'],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$2['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x54e9ef),_0x54e9ef[_0x3fd5db(0x2dd)]=_0x2dc489['createPickId']({'primitive':_0x54e9ef,'id':this['id']});if(!_0x5db702){const _0x216a99=new Cesium$2['DrawCommand']({'owner':_0x54e9ef,'primitiveType':_0x2d9197['primitiveType'],'pickOnly':!![]});_0x216a99['vertexArray']=_0x46f4c4,_0x216a99[_0x3fd5db(0x267)]=_0x2b309e;const _0x13b981=Cesium$2['ShaderProgram'][_0x3fd5db(0x20d)]({'context':_0x2dc489,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$2['ShaderSource']['createPickFragmentShaderSource'](SatelliteSensorFS,'uniform'),'attributeLocations':_0x221080});_0x216a99[_0x3fd5db(0x127)]=_0x13b981,_0x216a99[_0x3fd5db(0x135)]=_0x54e9ef['uniformMap'],_0x216a99['uniformMap']['czm_pickColor']=()=>{var _0x3a3f6f=_0x3fd5db;return _0x54e9ef['pickId'][_0x3a3f6f(0x2be)];},_0x216a99[_0x3fd5db(0x24c)]=Cesium$2['Pass']['TRANSLUCENT'],_0x216a99[_0x3fd5db(0x222)]=_0x563f1c,_0x216a99['modelMatrix']=this['_matrix'],this['_pickCommands']['push'](_0x216a99);}return _0x54e9ef;}['_clearDrawCommand'](){var _0x10ce99=_0xf77eb6;this['_drawCommands']&&this['_drawCommands']['length']>0x0&&(this['_drawCommands']['forEach'](function(_0x5e2bac){var _0x52a285=_0x8ca3;_0x5e2bac['vertexArray']&&_0x5e2bac['vertexArray']['destroy'](),_0x5e2bac[_0x52a285(0x127)]&&_0x5e2bac['shaderProgram']['destroy']();}),delete this['_drawCommands']),this[_0x10ce99(0x307)]&&this['_pickCommands'][_0x10ce99(0x31f)]>0x0&&(this['_pickCommands']['forEach'](function(_0x4ed42e){var _0x34c3dd=_0x10ce99;_0x4ed42e['vertexArray']&&_0x4ed42e['vertexArray']['destroy'](),_0x4ed42e['shaderProgram']&&_0x4ed42e[_0x34c3dd(0x127)][_0x34c3dd(0x2c4)]();}),delete this['_pickCommands']);}[_0xf77eb6(0x232)](_0x38b920,_0x360648){var _0x36bc15=_0xf77eb6;this['_positionCartesian']=mars3d__namespace['PointUtil']['getPositionValue'](this['position'],_0x38b920);if(!this['_positionCartesian'])return this[_0x36bc15(0x18f)]=new Cesium$2[(_0x36bc15(0x1ad))](),this['_matrix'];if(this['_lookAt']){const _0x573cdc=this[_0x36bc15(0x256)],_0x35083c=mars3d__namespace['PointUtil'][_0x36bc15(0x2eb)](this[_0x36bc15(0x1f9)],_0x38b920);if(Cesium$2['defined'](_0x35083c)){this[_0x36bc15(0x31f)]=Cesium$2['Cartesian3']['distance'](_0x573cdc,_0x35083c);const _0x530fe2=mars3d__namespace[_0x36bc15(0x19c)]['getHeadingPitchRollForLine'](_0x573cdc,_0x35083c,this[_0x36bc15(0xf7)],this['_fixedFrameTransform']);this['_pitchRadians']=_0x530fe2['pitch'],this['_rollRadians']=_0x530fe2[_0x36bc15(0xf8)],!(this['_headingRadians']instanceof Cesium$2['CallbackProperty'])&&(this['_headingRadians']=_0x530fe2['heading']);}}if(this['style']['rayEllipsoid']){const _0x321c8c=this['getRayEarthLength']();this['_intersectEllipsoid']=_0x321c8c>0x0;if(this['_intersectEllipsoid']){if(this[_0x36bc15(0x182)][_0x36bc15(0x25c)])return this['_matrix']=new Cesium$2['Matrix4'](),this['_matrix'];this[_0x36bc15(0x31f)]=_0x321c8c;}}return this['_modelMatrix']=this['_fixedFrameTransform'](this[_0x36bc15(0x256)],this['ellipsoid'],this['_modelMatrix']),this['_quaternion']=Cesium$2['Quaternion']['fromHeadingPitchRoll'](new Cesium$2['HeadingPitchRoll'](this['headingRadians'],this[_0x36bc15(0x11a)],this['_rollRadians']),this[_0x36bc15(0x1f6)]),this['_matrix']=Cesium$2[_0x36bc15(0x1ad)]['fromTranslationQuaternionRotationScale'](this[_0x36bc15(0x168)],this['_quaternion'],this[_0x36bc15(0x155)],this[_0x36bc15(0x18f)]),Cesium$2['Matrix4']['multiplyTransformation'](this[_0x36bc15(0x27b)],this['_matrix'],this['_matrix']),this[_0x36bc15(0x18f)];}['updateGeometry'](){var _0x272cfe=_0xf77eb6;const _0x1bfa64=RectGeometry['fromAnglesLength'](this['_angle1'],this[_0x272cfe(0x316)],this['length'],!![]);this[_0x272cfe(0x291)]=_0x1bfa64,this['vao']=this['prepareVAO'](),this['_geometry']=this[_0x272cfe(0x136)](this[_0x272cfe(0x1c2)]['fourPindices'],this[_0x272cfe(0x1c2)][_0x272cfe(0x115)],this['vao'][_0x272cfe(0x274)],Cesium$2['PrimitiveType']['TRIANGLES'],this['_color']),this[_0x272cfe(0x207)]=this['createGeometry'](this['vao'][_0x272cfe(0x2a9)],this['vao'][_0x272cfe(0x145)],this['vao'][_0x272cfe(0x274)],Cesium$2['PrimitiveType']['TRIANGLES'],this['_color']),this['_topOutlineGeometry']=this['createGeometry'](this['vao'][_0x272cfe(0x191)],this['vao']['topPpositions'],this['vao']['topPsts'],Cesium$2['PrimitiveType']['LINES'],this[_0x272cfe(0x22f)]),this[_0x272cfe(0x13e)]=this[_0x272cfe(0x136)](this[_0x272cfe(0x1c2)]['fourOindices'],this['vao'][_0x272cfe(0x115)],this['vao']['topPsts'],Cesium$2['PrimitiveType'][_0x272cfe(0x21d)],this['_outlineColor']),this[_0x272cfe(0x282)]=new Float32Array(this[_0x272cfe(0x308)]['attributes']['position'][_0x272cfe(0x2a6)]['length']);for(let _0x230315=0x0;_0x230315_0x4836fa)return _0x4836fa=_0x2e7314,_0x4836fa;}const _0x11b9ce=this[_0x8240ba(0x2d0)]();return _0x11b9ce[_0x8240ba(0x1d0)]((_0x4e4a0e,_0x20f49b)=>{var _0x158d27=_0x8240ba;if(_0x4e4a0e==null)return;const _0x1b03e7=Cesium$2['Cartesian3'][_0x158d27(0x2c5)](this['_positionCartesian'],_0x4e4a0e);_0x1b03e7>_0x4836fa&&(_0x4836fa=_0x1b03e7);}),_0x4836fa;}['getRayEarthPositions'](){var _0x1eb05e=_0xf77eb6;const _0x42686f=this[_0x1eb05e(0x256)],_0x4dab60=Cesium$2[_0x1eb05e(0x223)]['toRadians'](this['pitch']+this['angle2']),_0x103666=Cesium$2[_0x1eb05e(0x223)]['toRadians'](this['pitch']-this[_0x1eb05e(0x2fa)]),_0x2e40cb=Cesium$2['Math']['toRadians'](this[_0x1eb05e(0xf8)]+this[_0x1eb05e(0x246)]),_0x56dbe6=Cesium$2['Math']['toRadians'](this['roll']-this[_0x1eb05e(0x246)]),_0x17c84d=mars3d__namespace[_0x1eb05e(0x19c)]['getRayEarthPosition'](_0x42686f,new Cesium$2['HeadingPitchRoll'](this['headingRadians'],_0x4dab60,_0x2e40cb),this['_reverse']),_0x2944fd=mars3d__namespace[_0x1eb05e(0x19c)]['getRayEarthPosition'](_0x42686f,new Cesium$2[(_0x1eb05e(0x296))](this[_0x1eb05e(0x148)],_0x4dab60,_0x56dbe6),this['_reverse']),_0x6228b7=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x42686f,new Cesium$2['HeadingPitchRoll'](this['headingRadians'],_0x103666,_0x56dbe6),this['_reverse']),_0x5f34c3=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x42686f,new Cesium$2[(_0x1eb05e(0x296))](this['headingRadians'],_0x103666,_0x2e40cb),this[_0x1eb05e(0x1bd)]);return[_0x17c84d,_0x2944fd,_0x6228b7,_0x5f34c3];}[_0xf77eb6(0x179)](_0x47bcc8,_0x3504e6){var _0x6780af=_0xf77eb6;return _0x47bcc8[_0x6780af(0x1ff)]=![],mars3d__namespace[_0x6780af(0x26f)]['create'](_0x6780af(0x1b7),_0x47bcc8);}}mars3d__namespace[_0xf77eb6(0x235)]['RectSensor']=RectSensor,mars3d__namespace['GraphicUtil'][_0xf77eb6(0x25e)]('rectSensor',RectSensor,!![]);const SensorType={'Rect':0x0,'Conic':0x1},Cesium$1=mars3d__namespace['Cesium'],BasePointPrimitive=mars3d__namespace[_0xf77eb6(0x235)]['BasePointPrimitive'],RayEllipsoidType={'None':0x0,'All':0x1,'Part':0x2};class SatelliteSensor extends BasePointPrimitive{constructor(_0xe28275={}){var _0x575cd0=_0xf77eb6;super(_0xe28275),this[_0x575cd0(0x27b)]=Cesium$1['Matrix4'][_0x575cd0(0x1d1)](Cesium$1[_0x575cd0(0x1ad)]['IDENTITY']),this['_quaternion']=new Cesium$1[(_0x575cd0(0x1ca))](),this[_0x575cd0(0x168)]=new Cesium$1[(_0x575cd0(0x278))](),this['_scale']=new Cesium$1['Cartesian3'](0x1,0x1,0x1),this[_0x575cd0(0x18f)]=new Cesium$1[(_0x575cd0(0x1ad))](),this['_outlinePositions']=[],this['_imagingAreaPositions']=[],this[_0x575cd0(0x164)]=![],this['style']['globalAlpha']=0x1,this['style'][_0x575cd0(0x2ff)]=this['style']['flat']??!![];const _0x47fbf1=style2Primitive(this[_0x575cd0(0x182)]);this[_0x575cd0(0x11c)]=_0x47fbf1[_0x575cd0(0x2a0)]??SensorType['Rect'],this['_angle1']=_0x47fbf1['angle1']||_0x47fbf1[_0x575cd0(0xf1)]||0x5,this['_angle2']=_0x47fbf1['angle2']||_0x47fbf1[_0x575cd0(0xf1)]||0x5,this['_length']=_0x47fbf1['length']??0x0,this['_color']=_0x47fbf1['color']??Cesium$1['Color']['YELLOW'],this['_outline']=_0x47fbf1[_0x575cd0(0x266)]??![],this['_outlineColor']=_0x47fbf1['outlineColor'],this['_groundPolyColor']=_0x47fbf1[_0x575cd0(0x183)],this['_groundOutLineColor']=_0x47fbf1['groundOutLineColor'],this['_rayEllipsoid']=_0x47fbf1['rayEllipsoid']??![],this['pitch']=_0x47fbf1['pitch']??0x0,this[_0x575cd0(0x289)]=_0x47fbf1['heading']??0x0,this['roll']=_0x47fbf1[_0x575cd0(0xf8)]??0x0,this['_fixedFrameTransform']=this[_0x575cd0(0x110)]['fixedFrameTransform']??Cesium$1['Transforms'][_0x575cd0(0x253)],this['_reverse']=this[_0x575cd0(0x110)][_0x575cd0(0x227)]??!![],this[_0x575cd0(0x1f9)]=this[_0x575cd0(0x110)][_0x575cd0(0x2b4)],this[_0x575cd0(0x134)]=[],this[_0x575cd0(0x275)]=[];}get['sensorType'](){return this['_sensorType'];}set['sensorType'](_0x47fbbe){this['_sensorType']=_0x47fbbe,this['updateGeometry']();}get['color'](){return this['_color'];}set['color'](_0x228a7a){var _0x2dcc84=_0xf77eb6;this['_color']=mars3d__namespace['Util'][_0x2dcc84(0x11f)](_0x228a7a);}get['outlineColor'](){var _0x563387=_0xf77eb6;return this[_0x563387(0x22f)];}set[_0xf77eb6(0x2b3)](_0x1cea93){var _0x4ae32c=_0xf77eb6;this[_0x4ae32c(0x22f)]=mars3d__namespace[_0x4ae32c(0x1c0)]['getCesiumColor'](_0x1cea93);}get['angle'](){return this['_angle1'];}set['angle'](_0x2f76f0){var _0x5e4716=_0xf77eb6;this[_0x5e4716(0x1d6)]=_0x2f76f0,this[_0x5e4716(0x316)]=_0x2f76f0,this[_0x5e4716(0x1ef)]();}get[_0xf77eb6(0x246)](){return this['_angle1'];}set[_0xf77eb6(0x246)](_0x5a1d1f){var _0x1e1a78=_0xf77eb6;this[_0x1e1a78(0x1d6)]=Number(_0x5a1d1f),this[_0x1e1a78(0x1ef)]();}get['angle2'](){return this['_angle2'];}set[_0xf77eb6(0x2fa)](_0x24acda){var _0x3ccddf=_0xf77eb6;this[_0x3ccddf(0x316)]=Number(_0x24acda),this[_0x3ccddf(0x1ef)]();}get[_0xf77eb6(0x289)](){return Cesium$1['Math']['toDegrees'](this['_headingRadians']);}set['heading'](_0x337661){var _0x226c09=_0xf77eb6;this[_0x226c09(0x1bf)]=Cesium$1[_0x226c09(0x223)][_0x226c09(0x151)](_0x337661);}get['pitch'](){var _0x26d63d=_0xf77eb6;return Cesium$1['Math']['toDegrees'](this[_0x26d63d(0x11a)]);}set['pitch'](_0x33c8a4){var _0x229aeb=_0xf77eb6;this['_pitchRadians']=Cesium$1['Math'][_0x229aeb(0x151)](_0x33c8a4);}get['roll'](){var _0x10113c=_0xf77eb6;return Cesium$1[_0x10113c(0x223)]['toDegrees'](this[_0x10113c(0x1fe)]);}set['roll'](_0x3b7aac){var _0x42c7f3=_0xf77eb6;this['_rollRadians']=Cesium$1[_0x42c7f3(0x223)][_0x42c7f3(0x151)](_0x3b7aac);}get[_0xf77eb6(0x266)](){return this['_outline'];}set['outline'](_0x5d19e1){this['_outline']=_0x5d19e1;}get['lookAt'](){return this['_lookAt'];}set['lookAt'](_0xb76131){this['_lookAt']=_0xb76131;}get['matrix'](){return this['_matrix'];}get['groundPosition'](){var _0x213b48=_0xf77eb6;return mars3d__namespace[_0x213b48(0x19c)]['getRayEarthPositionByMatrix'](this['_matrix'],this['_reverse']);}get['rayEllipsoid'](){var _0x378d54=_0xf77eb6;return this[_0x378d54(0x263)];}set[_0xf77eb6(0x2ae)](_0x56dcfd){this['_rayEllipsoid']=_0x56dcfd;}get['intersectEllipsoid'](){return this['_rayEllipsoidType'];}get['geometryLength'](){return this['_length']+0x61529c;}['_updatePositionsHook'](){this['updateGeometry']();}['updateModelMatrix'](){var _0xe61d6c=_0xf77eb6;this[_0xe61d6c(0x1ef)](),super[_0xe61d6c(0x31e)]();}['_addedHook'](){var _0x364180=_0xf77eb6;this['ellipsoid']=this['_map']['scene']['globe']['ellipsoid'];if(!this['_show'])return;this[_0x364180(0x165)]['add'](this),this['_groundPolyEntity']?this['_map']['entities']['add'](this['_groundPolyEntity']):this[_0x364180(0x1e1)](this[_0x364180(0x306)]||this[_0x364180(0x31d)]);}[_0xf77eb6(0x201)](){var _0x2bfdfb=_0xf77eb6;if(!this['_map'])return;this['_groundPolyEntity']&&this[_0x2bfdfb(0x219)][_0x2bfdfb(0x16d)]['remove'](this[_0x2bfdfb(0x16f)]),this[_0x2bfdfb(0x165)][_0x2bfdfb(0x300)](this)&&(this['_noDestroy']=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![]),this['_clearGeometry'](),this[_0x2bfdfb(0x19d)]();}[_0xf77eb6(0x229)](_0x28d369){var _0x4607ff=_0xf77eb6;if(!this['_show'])return;this['computeMatrix'](_0x28d369['time']);if(!this['_positionCartesian'])return;!this[_0x4607ff(0x308)]&&this['updateGeometry']();if(_0x28d369[_0x4607ff(0x186)]===Cesium$1['SceneMode']['SCENE3D'])this[_0x4607ff(0x294)]=[],this['_pickCommands']=[],this['_outlinePositions']=this['extend2CartesianArray'](this['_outlinePositions']),this[_0x4607ff(0x263)]&&this[_0x4607ff(0x2c9)]===RayEllipsoidType['Part']?this['_imagingAreaPositions']=mars3d__namespace[_0x4607ff(0x19c)]['setPositionsHeight'](this['_outlinePositions'],0x0):this['_imagingAreaPositions']=Cesium$1['clone'](this['_outlinePositions']),this[_0x4607ff(0x1b3)](),this[_0x4607ff(0x1c3)]&&(this['_drawCommands']['push'](this['createDrawCommand'](this['_volumeGeometry'],_0x28d369)),this['_outline']&&this['_drawCommands']['push'](this[_0x4607ff(0x2f0)](this['_volumeOutlineGeometry'],_0x28d369,!![]))),_0x28d369[_0x4607ff(0x1e6)]['render']?this['_drawCommands']&&_0x28d369[_0x4607ff(0x100)][_0x4607ff(0x141)](...this['_drawCommands']):this['_pickCommands']&&_0x28d369['commandList'][_0x4607ff(0x141)](...this['_pickCommands']),this['_groundPolyEntity']&&(this['_groundPolyEntity'][_0x4607ff(0x188)]=Boolean(this['_groundArea']&&this[_0x4607ff(0x1fa)]));else{const _0x541d20=this[_0x4607ff(0x1cf)]();_0x541d20&&_0x541d20['length']>0x0?(this['_imagingAreaPositions']=mars3d__namespace[_0x4607ff(0x2e4)][_0x4607ff(0x192)](_0x541d20),!this['_groundPolyEntity']&&this['_addGroundPolyEntity'](!![]),this['_groundPolyEntity']['show']!==!![]&&(this['_groundPolyEntity']['show']=!![])):this['_groundPolyEntity']&&this[_0x4607ff(0x16f)]['show']!==![]&&(this[_0x4607ff(0x16f)]['show']=![]);}}['computeMatrix'](_0x4da6cd,_0xa1a37a){var _0x3f89d1=_0xf77eb6;this['property']&&(this[_0x3f89d1(0x1c1)]=this['property']['getValue'](_0x4da6cd));this['_positionCartesian']=mars3d__namespace['PointUtil']['getPositionValue'](this[_0x3f89d1(0x18b)],_0x4da6cd);if(!this['_positionCartesian'])return this[_0x3f89d1(0x18f)]=new Cesium$1[(_0x3f89d1(0x1ad))](),this[_0x3f89d1(0x18f)];if(this['options']['orientation']){const _0x5c05c7=mars3d__namespace['Util'][_0x3f89d1(0x178)](this['options']['orientation'],Cesium$1['Quaternion'],_0x4da6cd);if(this['_positionCartesian']&&_0x5c05c7){const _0x1ed2e2=mars3d__namespace['PointUtil']['getHeadingPitchRollByOrientation'](this[_0x3f89d1(0x256)],_0x5c05c7,this['ellipsoid'],this['_fixedFrameTransform']);!Cesium$1['defined'](this['style']['heading'])&&(this[_0x3f89d1(0x1bf)]=_0x1ed2e2['heading']),!Cesium$1['defined'](this['style']['roll'])&&(this['_rollRadians']=_0x1ed2e2['roll']),!Cesium$1['defined'](this['style']['pitch'])&&(this['_pitchRadians']=_0x1ed2e2['pitch']);}}if(this[_0x3f89d1(0x1f9)]){const _0x5af817=this['_positionCartesian'],_0x4d80d4=mars3d__namespace['PointUtil']['getPositionValue'](this['_lookAt'],_0x4da6cd);if(Cesium$1['defined'](_0x4d80d4)){const _0x1281a6=mars3d__namespace['PointUtil'][_0x3f89d1(0x12c)](_0x4d80d4,_0x5af817,this['ellipsoid'],this['_fixedFrameTransform']);this['_headingRadians']=_0x1281a6['heading'],this['_pitchRadians']=_0x1281a6['pitch'],this[_0x3f89d1(0x1fe)]=_0x1281a6['roll'];}}return this['_modelMatrix']=this['_fixedFrameTransform'](this['_positionCartesian'],this['ellipsoid'],this['_modelMatrix']),this[_0x3f89d1(0x1f6)]=Cesium$1[_0x3f89d1(0x1ca)][_0x3f89d1(0x14e)](new Cesium$1[(_0x3f89d1(0x296))](this['_headingRadians'],this['_pitchRadians'],this['_rollRadians']),this['_quaternion']),this['_matrix']=Cesium$1['Matrix4'][_0x3f89d1(0x2e3)](this['_translation'],this[_0x3f89d1(0x1f6)],this['_scale'],this[_0x3f89d1(0x18f)]),Cesium$1['Matrix4']['multiplyTransformation'](this['_modelMatrix'],this['_matrix'],this[_0x3f89d1(0x18f)]),this['_matrix'];}['updateGeometry'](){var _0x7ca94a=_0xf77eb6;this[_0x7ca94a(0x1ab)]();const _0x2df9cc=this['_reverse']?this['geometryLength']:-this['geometryLength'];this['_sensorType']===SensorType[_0x7ca94a(0x169)]?(this['_geometry']=ConicGeometry['createGeometry'](ConicGeometry['fromAngleAndLength'](this['_angle1'],_0x2df9cc,!![]),this[_0x7ca94a(0x18f)],this),this['_outlineGeometry']=ConicGeometry['createOutlineGeometry'](ConicGeometry[_0x7ca94a(0x304)](this['_angle1'],_0x2df9cc,!![]))):(this['_geometry']=RectGeometry['createGeometry'](RectGeometry['fromAnglesLength'](this['_angle1'],this['_angle2'],_0x2df9cc,!![]),this['_matrix'],this),this['_outlineGeometry']=RectGeometry['createOutlineGeometry'](RectGeometry['fromAnglesLength'](this['_angle1'],this[_0x7ca94a(0x316)],_0x2df9cc,!![])));this['_positions']=new Float32Array(this[_0x7ca94a(0x308)]['attributes']['position']['values'][_0x7ca94a(0x31f)]);for(let _0x391212=0x0;_0x391212{return this['_outlineColor'];}:()=>{return this['_color'];},'globalAlpha':()=>{var _0x10b429=_0x56ca85;return this[_0x10b429(0x182)]['globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$1['Pass'][_0x56ca85(0x175)],'cull':!![],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$1[(_0x56ca85(0x1d5))]({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x2c435b),_0x2c435b[_0x56ca85(0x2dd)]=_0x37e1b7['createPickId']({'primitive':_0x2c435b,'id':this['id']});if(!_0x270e73){const _0x1c57ca=new Cesium$1[(_0x56ca85(0x1d5))]({'owner':_0x2c435b,'primitiveType':_0x31de99['primitiveType'],'pickOnly':!![]});_0x1c57ca['vertexArray']=_0x251b3d,_0x1c57ca['renderState']=_0x1b1417;const _0x467bb8=Cesium$1['ShaderProgram'][_0x56ca85(0x20d)]({'context':_0x37e1b7,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$1[_0x56ca85(0x248)]['createPickFragmentShaderSource'](SatelliteSensorFS,'uniform'),'attributeLocations':_0x5adeec});_0x1c57ca[_0x56ca85(0x127)]=_0x467bb8,_0x1c57ca['uniformMap']=_0x2c435b['uniformMap'],_0x1c57ca['uniformMap'][_0x56ca85(0x2df)]=()=>{return _0x2c435b['pickId']['color'];},_0x1c57ca['pass']=Cesium$1['Pass']['TRANSLUCENT'],_0x1c57ca['boundingVolume']=_0x1ac786,_0x1c57ca['modelMatrix']=this['_matrix'],this['_pickCommands'][_0x56ca85(0x141)](_0x1c57ca);}return _0x2c435b;}['_clearDrawCommand'](){var _0x36d8b9=_0xf77eb6;this[_0x36d8b9(0x294)]&&this['_drawCommands']['length']>0x0&&(this['_drawCommands']['forEach'](function(_0x5796bc){var _0x3c2bcd=_0x36d8b9;_0x5796bc['vertexArray']&&_0x5796bc[_0x3c2bcd(0x1aa)]['destroy'](),_0x5796bc['shaderProgram']&&_0x5796bc[_0x3c2bcd(0x127)][_0x3c2bcd(0x2c4)]();}),delete this['_drawCommands']),this['_pickCommands']&&this['_pickCommands']['length']>0x0&&(this[_0x36d8b9(0x307)]['forEach'](function(_0x39e2f4){var _0x512b56=_0x36d8b9;_0x39e2f4[_0x512b56(0x1aa)]&&_0x39e2f4['vertexArray']['destroy'](),_0x39e2f4['shaderProgram']&&_0x39e2f4[_0x512b56(0x127)]['destroy']();}),delete this['_pickCommands']);}[_0xf77eb6(0xfd)](_0x3d0c27){this['style']['globalAlpha']=_0x3d0c27;}['getAreaCoords'](){var _0x12dfd8=_0xf77eb6;if(this[_0x12dfd8(0x2c9)]===RayEllipsoidType['None'])return null;let _0x4239eb=this[_0x12dfd8(0x272)];!this['_rayEllipsoid']&&(this[_0x12dfd8(0x263)]=!![],_0x4239eb=this['extend2CartesianArray'](),this['_rayEllipsoid']=![]);let _0x1f26c6=mars3d__namespace[_0x12dfd8(0x2e4)]['cartesians2lonlats'](_0x4239eb);return _0x1f26c6=mars3d__namespace[_0x12dfd8(0x299)]['convex'](_0x1f26c6),_0x1f26c6;}['extend2CartesianArray'](_0x28fc8e=[]){var _0x287bf3=_0xf77eb6;const _0x593397=new Cesium$1['Matrix4'](),_0x4b705c=new Cesium$1['Cartesian3'](),_0x32340c=new Cesium$1['Cartesian3'](),_0x574e4d=new Cesium$1[(_0x287bf3(0x30d))]();Cesium$1['Matrix4'][_0x287bf3(0x29e)](this[_0x287bf3(0x18f)],_0x593397),Cesium$1[_0x287bf3(0x1ad)]['multiplyByPoint'](this['_matrix'],Cesium$1['Cartesian3']['ZERO'],_0x32340c),_0x32340c['clone'](_0x574e4d['origin']);let _0x177fec=0x0;const _0x139f6c=this[_0x287bf3(0x2bc)][_0x287bf3(0x31f)];for(let _0x1dbae8=0x3;_0x1dbae8<_0x139f6c;_0x1dbae8+=0x3){Cesium$1[_0x287bf3(0x278)]['unpack'](this[_0x287bf3(0x2bc)],_0x1dbae8,_0x4b705c),Cesium$1[_0x287bf3(0x1ad)]['multiplyByPoint'](this['_matrix'],_0x4b705c,_0x32340c),Cesium$1['Cartesian3']['subtract'](_0x32340c,_0x574e4d['origin'],_0x574e4d['direction']),Cesium$1['Cartesian3'][_0x287bf3(0x213)](_0x574e4d[_0x287bf3(0x158)],_0x574e4d[_0x287bf3(0x158)]);const _0x3bcea1=Cesium$1[_0x287bf3(0x26c)]['rayEllipsoid'](_0x574e4d,this[_0x287bf3(0xf7)]);let _0x42777c=null;if(this['_length']){const _0x3b177c=Math['max'](this['angle1']||0x0,this[_0x287bf3(0x2fa)]||0x0),_0x372554=this['_length']/Math['cos'](Cesium$1['Math'][_0x287bf3(0x151)](_0x3b177c));_0x42777c=Cesium$1['Ray']['getPoint'](_0x574e4d,_0x372554);}else{if(_0x3bcea1)this[_0x287bf3(0x2c9)]=RayEllipsoidType['All'],_0x42777c=Cesium$1['Ray'][_0x287bf3(0x2a8)](_0x574e4d,_0x3bcea1['start']);else return this['_rayEllipsoidType']=RayEllipsoidType['None'],this['extend2CartesianArrayZC'](_0x28fc8e);}if(_0x42777c)_0x42777c['clone'](_0x32340c);else continue;_0x28fc8e[_0x177fec]=_0x32340c['clone'](_0x28fc8e[_0x177fec]);const _0x13dd12=this['_geometry'][_0x287bf3(0x161)][_0x287bf3(0x18b)][_0x287bf3(0x2a6)];_0x13dd12&&_0x13dd12 instanceof Float32Array&&(Cesium$1['Matrix4'][_0x287bf3(0x2f1)](_0x593397,_0x32340c,_0x32340c),_0x13dd12[_0x1dbae8]=_0x32340c['x'],_0x13dd12[_0x1dbae8+0x1]=_0x32340c['y'],_0x13dd12[_0x1dbae8+0x2]=_0x32340c['z']),_0x177fec++;}return _0x28fc8e;}['extend2CartesianArrayZC'](_0x51f24d=[]){var _0xdc858=_0xf77eb6;const _0xcfb5e5=new Cesium$1[(_0xdc858(0x1ad))](),_0x42460e=new Cesium$1[(_0xdc858(0x278))](),_0x4e37a6=new Cesium$1['Cartesian3'](),_0xb500ef=new Cesium$1['Ray']();Cesium$1['Matrix4']['inverse'](this[_0xdc858(0x18f)],_0xcfb5e5),Cesium$1['Matrix4']['multiplyByPoint'](this['_matrix'],Cesium$1[_0xdc858(0x278)][_0xdc858(0x2ee)],_0x4e37a6),_0x4e37a6[_0xdc858(0x1d1)](_0xb500ef[_0xdc858(0x303)]);let _0x4134fc=0x0;const _0x18e1dd=this['_positions'][_0xdc858(0x31f)];for(let _0x5da322=0x3;_0x5da322<_0x18e1dd;_0x5da322+=0x3){Cesium$1[_0xdc858(0x278)]['unpack'](this['_positions'],_0x5da322,_0x42460e),Cesium$1['Matrix4'][_0xdc858(0x2f1)](this[_0xdc858(0x18f)],_0x42460e,_0x4e37a6),Cesium$1['Cartesian3'][_0xdc858(0x243)](_0x4e37a6,_0xb500ef[_0xdc858(0x303)],_0xb500ef['direction']),Cesium$1['Cartesian3']['normalize'](_0xb500ef[_0xdc858(0x158)],_0xb500ef[_0xdc858(0x158)]);const _0x5d40c4=Cesium$1['IntersectionTests'][_0xdc858(0x2ae)](_0xb500ef,this['ellipsoid']);_0x5d40c4&&(this['_rayEllipsoidType']=RayEllipsoidType['Part']);let _0x251c7e=null;this['_rayEllipsoid']&&_0x5d40c4&&(_0x251c7e=Cesium$1[_0xdc858(0x30d)]['getPoint'](_0xb500ef,_0x5d40c4['start']));if(!_0x251c7e){const _0x3c4f6c=Cesium$1['Cartographic']['fromCartesian'](_0xb500ef['origin'])[_0xdc858(0x15e)],_0x23f75c=_0x3c4f6c+0x61529c;_0x251c7e=Cesium$1['Ray']['getPoint'](_0xb500ef,_0x23f75c);}if(_0x251c7e)_0x251c7e['clone'](_0x4e37a6);else continue;_0x51f24d[_0x4134fc]=_0x4e37a6['clone'](_0x51f24d[_0x4134fc]);const _0x414a56=this['_geometry'][_0xdc858(0x161)]['position']['values'];_0x414a56&&_0x414a56 instanceof Float32Array&&(Cesium$1['Matrix4']['multiplyByPoint'](_0xcfb5e5,_0x4e37a6,_0x4e37a6),_0x414a56[0x3+_0x5da322*0x3]=_0x4e37a6['x'],_0x414a56[0x3+_0x5da322*0x3+0x1]=_0x4e37a6['y'],_0x414a56[0x3+_0x5da322*0x3+0x2]=_0x4e37a6['z']),_0x4134fc++;}return _0x51f24d;}['_addGroundPolyEntity'](_0x49a21c){var _0x5c7e54=_0xf77eb6;if(!_0x49a21c||this['_groundPolyEntity'])return;const _0x37f8c9=new Cesium$1['PolygonHierarchy']();this['_groundPolyEntity']=this['_map']['entities']['add']({'show':Boolean(this['_groundArea']),'polygon':{'arcType':Cesium$1['ArcType']['RHUMB'],'material':this[_0x5c7e54(0x26b)]||this[_0x5c7e54(0x19b)],'hierarchy':new Cesium$1['CallbackProperty'](_0x23a5b0=>{return _0x37f8c9['positions']=this['groundAreaPositions']||this['_imagingAreaPositions'],_0x37f8c9;},![])}});}[_0xf77eb6(0x179)](_0x45c480,_0x406264){var _0x4231f9=_0xf77eb6;return _0x45c480[_0x4231f9(0x1ff)]=![],mars3d__namespace['GraphicUtil'][_0x4231f9(0x202)](_0x4231f9(0x1b7),_0x45c480);}}mars3d__namespace[_0xf77eb6(0x235)][_0xf77eb6(0x137)]=SatelliteSensor,mars3d__namespace['GraphicUtil'][_0xf77eb6(0x25e)]('satelliteSensor',SatelliteSensor),SatelliteSensor[_0xf77eb6(0x215)]=SensorType;const Cesium=mars3d__namespace['Cesium'],Route=mars3d__namespace['graphic']['Route'];class Satellite extends Route{constructor(_0x205daf={}){var _0x186e9c=_0xf77eb6;_0x205daf['referenceFrame']=_0x205daf[_0x186e9c(0x2aa)]??Cesium['ReferenceFrame']['INERTIAL'],super(_0x205daf);if(this['options'][_0x186e9c(0x1e0)]&&this[_0x186e9c(0x110)]['tle2']){this['_tle']=new Tle(this['options']['tle1'],this['options'][_0x186e9c(0x276)],this['options']['name']);if(!Cesium['defined'](this['options']['period'])){this['options']['period']=this['_tle']['period'];if(!Cesium['defined'](this['options']['period']))throw new Error('Satellite:\x20period\x20is\x20null');}this['period_time']=this[_0x186e9c(0x110)]['period']*0x3c*0x3e8,this['_pointsNum']=this['options']['pointsNum']??0x3c;}}get['tle'](){return this['_tle'];}get[_0xf77eb6(0x237)](){var _0x5b135c=_0xf77eb6;return{'start':new Date(this['_time_path_start'])['format']('yyyy-MM-dd\x20HH:mm:ss'),'end':new Date(this[_0x5b135c(0x10c)])[_0x5b135c(0x290)]('yyyy-MM-dd\x20HH:mm:ss')};}get['cone'](){var _0x495ed3=_0xf77eb6;return this['coneEntity']||this[_0x495ed3(0x262)];}set['cone'](_0x47952a){this['options']['cone']=_0x47952a,this['_updateCone']();}get['angle1'](){return this['cone']['angle1'];}set['angle1'](_0x430e04){this['cone']['angle1']=_0x430e04;}get['angle2'](){var _0x3030db=_0xf77eb6;return this[_0x3030db(0x2ab)]['angle2'];}set['angle2'](_0x51da1f){this['cone']['angle2']=_0x51da1f;}get['coneShow'](){var _0xfd1d20;return(_0xfd1d20=this['options']['cone'])===null||_0xfd1d20===void 0x0?void 0x0:_0xfd1d20['show'];}set['coneShow'](_0x38d9f7){this['options']['cone']['show']=_0x38d9f7,this['_updateCone']();}get['lookAt'](){var _0x39985c=_0xf77eb6;return this[_0x39985c(0x1f9)];}set[_0xf77eb6(0x2b4)](_0x2a4e80){var _0x347768=_0xf77eb6;this['_lookAt']=_0x2a4e80,this['_coneList']&&this['_coneList']['forEach'](function(_0x55f397,_0x47ca59,_0x3e67d7){var _0x46d909=_0x8ca3;_0x55f397[_0x46d909(0x2b4)]=_0x2a4e80;}),this['coneEntity']&&(this[_0x347768(0x239)][_0x347768(0x2b4)]=_0x2a4e80);}['_mountedHook'](){var _0x544e37=_0xf77eb6;super[_0x544e37(0x126)](),this[_0x544e37(0x2b7)]();}[_0xf77eb6(0x1fb)](_0x1f2ab2){var _0x11fab1=_0xf77eb6;super['_addedHook'](_0x1f2ab2);if(!this[_0x11fab1(0x188)])return;this['_initSampledPositionProperty']();if(this['options'][_0x11fab1(0x18b)]){var _0x4fb128,_0x17828e,_0x40a6b2;if(((_0x4fb128=this['property'])===null||_0x4fb128===void 0x0?void 0x0:(_0x17828e=_0x4fb128['_property'])===null||_0x17828e===void 0x0?void 0x0:(_0x40a6b2=_0x17828e['_times'])===null||_0x40a6b2===void 0x0?void 0x0:_0x40a6b2['length'])>0x0){const _0x39d8e7=this['property'][_0x11fab1(0x2b5)]['_times'];this['_time_path_start']=Cesium['JulianDate']['toDate'](_0x39d8e7[0x0])[_0x11fab1(0x2e8)](),this[_0x11fab1(0x10c)]=Cesium['JulianDate']['toDate'](_0x39d8e7[_0x39d8e7[_0x11fab1(0x31f)]-0x1])['getTime']();}}else this['_time_current']=Cesium['JulianDate'][_0x11fab1(0x15b)](this[_0x11fab1(0x219)]['clock']['currentTime'])['getTime'](),this['calculateOrbitPoints']();}['_setOptionsHook'](_0xb8a73a,_0x1cb117){var _0x6b3250=_0xf77eb6;for(const _0x1f871 in _0x1cb117){switch(_0x1f871){case'tle1':case'tle2':{if(this['options']['tle1']&&this['options']['tle2']){this['_tle']=new Tle(this['options']['tle1'],this[_0x6b3250(0x110)]['tle2'],this['options']['name']);if(!Cesium['defined'](this['options'][_0x6b3250(0x13c)])){this['options']['period']=this['_tle']['period'];if(!Cesium[_0x6b3250(0x1a2)](this['options']['period']))throw new Error('Satellite:\x20period\x20is\x20null');}this['period_time']=this[_0x6b3250(0x110)][_0x6b3250(0x13c)]*0x3c*0x3e8,this[_0x6b3250(0x1fd)]=Cesium['JulianDate']['toDate'](this['_map']['clock']['currentTime'])['getTime'](),this['calculateOrbitPoints']();}break;}case'cone':this['_updateCone']();break;default:super['_setOptionsHook'](_0xb8a73a,_0x1cb117);break;}}}['_updatePosition'](){var _0x3fc98f=_0xf77eb6;super[_0x3fc98f(0xf9)](),!this['_modelMatrix']&&(this[_0x3fc98f(0x27b)]=this['_getModelMatrix'](this['_position'],this['_orientation_show'])),this[_0x3fc98f(0x262)]&&this['_coneList']['forEach']((_0x41a313,_0x56cd34,_0x1a8647)=>{var _0x2faf6e=_0x3fc98f;const _0x3b13a8=_0x41a313['attr']['pitchOffset'],_0x1cd345=this['calculate_cam_sight'](this['_heading_reality'],this[_0x2faf6e(0x29a)],this['_roll_reality'],_0x3b13a8);_0x41a313['_headingRadians']=_0x1cd345[_0x2faf6e(0xf4)],_0x41a313['_pitchRadians']=_0x1cd345['pitch'],_0x41a313['_rollRadians']=_0x1cd345['roll'];}),this['coneEntity']&&(this['coneEntity']['_headingRadians']=this['_heading_reality'],this['coneEntity']['_pitchRadians']=this[_0x3fc98f(0x29a)],this[_0x3fc98f(0x239)]['_rollRadians']=this[_0x3fc98f(0x14b)]),this['_time_current']=Cesium['JulianDate'][_0x3fc98f(0x15b)](this[_0x3fc98f(0x219)][_0x3fc98f(0x101)]['currentTime'])['getTime'](),!this['options']['position']&&this['isNeedRecalculate']()&&this['calculateOrbitPoints']();}['isNeedRecalculate'](){var _0x39ca97=_0xf77eb6;if(this['_time_path_start']==null||this['_time_path_end']==null)return!![];const _0x2e4829=this['_time_path_start']+this[_0x39ca97(0x2de)]/0x4,_0xd140d5=this['_time_path_end']-this[_0x39ca97(0x2de)]/0x4;return this['_time_current']>_0x2e4829&&this['_time_current']<_0xd140d5?![]:!![];}['calculateOrbitPoints'](){var _0x50a208=_0xf77eb6,_0xf897f8,_0x1d327d;this[_0x50a208(0x286)]();let _0x1fc103=Math['floor'](this['period_time']/this['_pointsNum']);_0x1fc103<0x3e8&&(_0x1fc103=0x3e8);const _0x3f844e=this['_time_current']-this[_0x50a208(0x2de)]/0x2;let _0x4edabe,_0x1020f6;for(let _0x2cf800=0x0;_0x2cf800<=this['_pointsNum'];_0x2cf800++){_0x4edabe=_0x3f844e+_0x2cf800*_0x1fc103;const _0xe4dc96=this['_tle']['getEciPosition'](_0x4edabe);if(!_0xe4dc96)continue;const _0x5b132d=Cesium['JulianDate']['fromDate'](new Date(_0x4edabe));this['property']['addSample'](_0x5b132d,_0xe4dc96),!_0x1020f6&&(_0x1020f6=_0xe4dc96);}(((_0xf897f8=this['options']['path'])===null||_0xf897f8===void 0x0?void 0x0:_0xf897f8['closure'])??![])&&this[_0x50a208(0x24b)][_0x50a208(0x302)](Cesium[_0x50a208(0x1ec)]['fromDate'](new Date(_0x4edabe)),_0x1020f6),this['property']['setInterpolationOptions']({'interpolationDegree':0x2,'interpolationAlgorithm':Cesium['LagrangePolynomialApproximation']}),this[_0x50a208(0x193)]=this[_0x50a208(0x1fd)]-this['period_time']/0x2,this[_0x50a208(0x10c)]=this['_time_current']+this['period_time']/0x2+_0x1fc103,(_0x1d327d=this[_0x50a208(0x23d)]['path'])!==null&&_0x1d327d!==void 0x0&&_0x1d327d[_0x50a208(0x154)]&&(this['_child']['path']['entity']['availability']=new Cesium['TimeIntervalCollection']([new Cesium['TimeInterval']({'start':Cesium['JulianDate'][_0x50a208(0x1f0)](new Date(this[_0x50a208(0x193)])),'stop':Cesium[_0x50a208(0x1ec)]['fromDate'](new Date(this['_time_path_end']))})]));}[_0xf77eb6(0x1a1)](_0xc3b0c0,_0x187927,_0x55ee86,_0x4d1a00){var _0x23e116=_0xf77eb6;const _0x4433de=[Math['cos'](_0x4d1a00),0x0,Math['sin'](_0x4d1a00),0x0,0x1,0x0,0x0-Math['sin'](_0x4d1a00),0x0,Math[_0x23e116(0x1b8)](_0x4d1a00)],_0x44d4df=_0x4433de[0x0],_0x576d30=_0x4433de[0x1],_0xcfe336=_0x4433de[0x2],_0x1bcc1f=_0x4433de[0x3],_0x190771=_0x4433de[0x4],_0x39e7f9=_0x4433de[0x5],_0x4b4732=_0x4433de[0x6],_0x421f9f=_0x4433de[0x7],_0x30886f=_0x4433de[0x8],_0x41438a=Math['cos'](_0x187927)*Math['cos'](_0xc3b0c0),_0x3ec2b8=0x0-Math['cos'](_0x187927)*Math['sin'](_0xc3b0c0),_0x50bd18=Math['sin'](_0x187927),_0x499a8a=Math['sin'](_0x55ee86)*Math['cos'](_0x187927)*Math[_0x23e116(0x1b8)](_0xc3b0c0)+Math['cos'](_0x55ee86)*Math['sin'](_0xc3b0c0),_0x42348e=0x0-Math['sin'](_0x55ee86)*Math['sin'](_0x187927)*Math['sin'](_0xc3b0c0)+Math['cos'](_0x55ee86)*Math['cos'](_0xc3b0c0),_0xa46a61=0x0-Math[_0x23e116(0x280)](_0x55ee86)*Math['cos'](_0x187927),_0x270122=0x0-Math['cos'](_0x55ee86)*Math['sin'](_0x187927)*Math['cos'](_0xc3b0c0)+Math[_0x23e116(0x280)](_0x55ee86)*Math[_0x23e116(0x280)](_0xc3b0c0),_0x346b02=Math['cos'](_0x55ee86)*Math[_0x23e116(0x280)](_0x187927)*Math[_0x23e116(0x280)](_0xc3b0c0)+Math['sin'](_0x55ee86)*Math['cos'](_0xc3b0c0),_0x421b7d=Math['cos'](_0x55ee86)*Math['cos'](_0x187927),_0x677891=_0x44d4df*_0x41438a+_0x576d30*_0x499a8a+_0xcfe336*_0x270122,_0xd6163c=_0x44d4df*_0x3ec2b8+_0x576d30*_0x42348e+_0xcfe336*_0x346b02,_0x5eae97=_0x44d4df*_0x50bd18+_0x576d30*_0xa46a61+_0xcfe336*_0x421b7d,_0xa4ebf6=_0x1bcc1f*_0x50bd18+_0x190771*_0xa46a61+_0x39e7f9*_0x421b7d,_0x1f816a=_0x4b4732*_0x50bd18+_0x421f9f*_0xa46a61+_0x30886f*_0x421b7d,_0x3832e8=Math[_0x23e116(0x298)](0x0-_0xa4ebf6,_0x1f816a),_0x3088bc=Math['atan2'](_0x5eae97,Math['sqrt'](_0x677891*_0x677891+_0xd6163c*_0xd6163c)),_0x105ed9=Math[_0x23e116(0x298)](0x0-_0xd6163c,_0x677891);return{'roll':_0x3832e8,'pitch':_0x3088bc,'yaw':_0x105ed9};}[_0xf77eb6(0x2b7)](){var _0x2e69c3=_0xf77eb6;const _0x165049=this['options'][_0x2e69c3(0x2ab)];_0x165049&&(_0x165049['show']??!![])?_0x165049['list']&&_0x165049['list']['length']>0x0?this['_showListCone'](_0x165049):this[_0x2e69c3(0x1f7)](_0x165049):(this[_0x2e69c3(0x262)]&&(this['_coneList']['forEach'](function(_0x827673,_0x371871,_0x2640a3){this['_layer']['removeGraphic'](_0x827673,!![]);}),this['_coneList'][_0x2e69c3(0x129)]()),this[_0x2e69c3(0x239)]&&(this['_layer']['removeGraphic'](this[_0x2e69c3(0x239)],!![]),delete this['coneEntity']));}[_0xf77eb6(0x260)](_0x250a04){var _0x1f516b=_0xf77eb6;!this['_coneList']&&(this['_coneList']=new Map());for(let _0x3404e7=0x0;_0x3404e7<_0x250a04['list']['length'];_0x3404e7++){const _0x166f42=_0x250a04['list'][_0x3404e7];_0x166f42[_0x1f516b(0x2a7)]=_0x166f42['name']||_0x3404e7;if(_0x166f42['hasOwnProperty'](_0x1f516b(0x188))&&!_0x166f42[_0x1f516b(0x188)]){if(this['_coneList']['has'](_0x166f42['name'])){const _0x4225fa=this['_coneList']['get'](_0x166f42[_0x1f516b(0x2a7)]);_0x4225fa['remove'](),_0x4225fa['destroy'](!![]),this['_coneList']['delete'](_0x166f42[_0x1f516b(0x2a7)]);}}else{const _0x4b3bde=_0x166f42[_0x1f516b(0x246)],_0x5d71b5=_0x166f42['angel2'],_0x4325fe=Cesium['Math']['toRadians'](this[_0x1f516b(0x110)][_0x1f516b(0x16a)]['heading']||0x0),_0x42e9e1=Cesium[_0x1f516b(0x223)]['toRadians'](this['options']['model']['pitch']||0x0),_0x34b7d8=Cesium['Math'][_0x1f516b(0x151)](this[_0x1f516b(0x110)][_0x1f516b(0x16a)][_0x1f516b(0xf8)]||0x0),_0x33e401=Cesium['Math']['toRadians'](_0x166f42['pitchOffset']),_0x24563e=this['calculate_cam_sight'](_0x4325fe,_0x42e9e1,_0x34b7d8,_0x33e401);if(this[_0x1f516b(0x262)][_0x1f516b(0x288)](_0x166f42['name'])){const _0x24c145=this['_coneList']['get'](_0x166f42['name']);_0x24c145['angle1']=_0x4b3bde,_0x24c145['angle2']=_0x5d71b5,_0x24c145['sensorType']=_0x250a04[_0x1f516b(0x2a0)],_0x24c145['color']=_0x166f42[_0x1f516b(0x2be)],_0x24c145[_0x1f516b(0x266)]=_0x166f42['outline'],_0x24c145['_headingRadians']=_0x24563e['yaw'],_0x24c145['_pitchRadians']=_0x24563e['pitch'],_0x24c145['_rollRadians']=_0x24563e['roll'];}else{const _0x1d23a3=new SatelliteSensor({'position':new Cesium['CallbackProperty'](_0x55c2db=>{return this['_position'];},![]),'style':{..._0x166f42,'sensorType':_0x250a04['sensorType'],'angle1':_0x4b3bde,'angle2':_0x5d71b5,'heading':Cesium['Math']['toDegrees'](_0x24563e[_0x1f516b(0xf4)]),'pitch':Cesium[_0x1f516b(0x223)]['toDegrees'](_0x24563e[_0x1f516b(0x321)]),'roll':Cesium['Math']['toDegrees'](_0x24563e['roll'])},'attr':{'pitchOffset':_0x33e401},'reverse':_0x250a04[_0x1f516b(0x227)],'rayEllipsoid':_0x250a04[_0x1f516b(0x2ae)]});this['_layer']['addGraphic'](_0x1d23a3),this[_0x1f516b(0x2f6)](_0x1d23a3),this['_coneList']['set'](_0x166f42['name'],_0x1d23a3);}}}}['_showOneCone'](_0x23d7cc){var _0x579871=_0xf77eb6;if(this['coneEntity'])this['coneEntity'][_0x579871(0x246)]=_0x23d7cc['angle1']||0x14,this['coneEntity']['angle2']=_0x23d7cc[_0x579871(0x2fa)]||0x14,this['coneEntity']['sensorType']=_0x23d7cc['sensorType'],this['coneEntity'][_0x579871(0x2be)]=_0x23d7cc['color'],this['coneEntity']['outline']=_0x23d7cc[_0x579871(0x266)],this['coneEntity'][_0x579871(0x1bf)]=this[_0x579871(0x15a)],this['coneEntity']['_pitchRadians']=this['_pitch_reality'],this[_0x579871(0x239)]['_rollRadians']=this['_roll_reality'];else{const _0x28a893=new SatelliteSensor({'position':new Cesium['CallbackProperty'](_0x22e14e=>{var _0x4ff1cb=_0x579871;return this[_0x4ff1cb(0x1c1)];},![]),'style':{..._0x23d7cc,'heading':this['options'][_0x579871(0x16a)]['heading']||0x0,'pitch':this['options']['model'][_0x579871(0x321)]||0x0,'roll':this[_0x579871(0x110)]['model']['roll']||0x0},'reverse':_0x23d7cc['reverse'],'rayEllipsoid':_0x23d7cc['rayEllipsoid']});this[_0x579871(0x270)]['addGraphic'](_0x28a893),this['bindPickId'](_0x28a893),this['coneEntity']=_0x28a893;}}['flyToPoint'](_0x45cabb={}){var _0x489e1b=_0xf77eb6;if(!this['_map'])return;const _0x52c321=this['_position'];if(!_0x52c321)return;const _0x5edd00=Cesium[_0x489e1b(0x22c)]['fromCartesian'](_0x52c321)[_0x489e1b(0x15e)]*(_0x45cabb['scale']??1.5);let _0x580879;if(Cesium['defined'](_0x45cabb['heading'])){var _0xc9cde5;_0x580879=_0x45cabb['heading']+Cesium['Math']['toDegrees'](((_0xc9cde5=this['hpr'])===null||_0xc9cde5===void 0x0?void 0x0:_0xc9cde5['heading'])||0x0);}return this['_map'][_0x489e1b(0x1f2)](_0x52c321,{..._0x45cabb,'radius':_0x5edd00,'heading':_0x580879});}['flyTo'](_0x253e90){return this['flyToPoint'](_0x253e90);}['startDraw'](_0xf40e36){var _0x4086a5=_0xf77eb6,_0x1508d9,_0x28535b,_0x195a63;if(this['_enabledDraw'])return this;this['_enabledDraw']=!![],_0xf40e36&&this['addTo'](_0xf40e36),this['fire'](mars3d__namespace[_0x4086a5(0x224)]['drawCreated'],{'drawtype':this[_0x4086a5(0x1b2)],'positions':this['_positions_draw']},!![]),(_0x1508d9=this[_0x4086a5(0x110)])!==null&&_0x1508d9!==void 0x0&&_0x1508d9['success']&&this[_0x4086a5(0x110)]['success'](this),(_0x28535b=this['options'])!==null&&_0x28535b!==void 0x0&&(_0x195a63=_0x28535b['_promise'])!==null&&_0x195a63!==void 0x0&&_0x195a63[_0x4086a5(0x2bf)]&&this['options'][_0x4086a5(0x1f1)]['resolve'](this);}}mars3d__namespace[_0xf77eb6(0x235)]['Satellite']=Satellite,mars3d__namespace['GraphicUtil']['register']('satellite',Satellite),exports['CamberRadar']=CamberRadar,exports['ConicSensor']=ConicSensor,exports[_0xf77eb6(0x240)]=RectSensor,exports['Satellite']=Satellite,exports[_0xf77eb6(0x137)]=SatelliteSensor,exports['SpaceUtil']=SpaceUtil,exports['Tle']=Tle,Object['defineProperty'](exports,'__esModule',{'value':!![]}); +'use strict';var _0x16ff71=_0x15c6;(function(_0x541673,_0x5f5b6c){var _0x3ddd7a=_0x15c6,_0x43afa4=_0x541673();while(!![]){try{var _0xc9ed31=-parseInt(_0x3ddd7a(0x1ba))/0x1+parseInt(_0x3ddd7a(0x276))/0x2*(-parseInt(_0x3ddd7a(0x35e))/0x3)+parseInt(_0x3ddd7a(0x267))/0x4+-parseInt(_0x3ddd7a(0x2fb))/0x5+-parseInt(_0x3ddd7a(0x21e))/0x6*(parseInt(_0x3ddd7a(0x20a))/0x7)+-parseInt(_0x3ddd7a(0x2f3))/0x8*(parseInt(_0x3ddd7a(0x179))/0x9)+parseInt(_0x3ddd7a(0x248))/0xa;if(_0xc9ed31===_0x5f5b6c)break;else _0x43afa4['push'](_0x43afa4['shift']());}catch(_0x4a1a16){_0x43afa4['push'](_0x43afa4['shift']());}}}(_0x5a1f,0xafa7a));function _interopNamespace(_0x2a9f37){var _0x5d8d3e=_0x15c6;if(_0x2a9f37&&_0x2a9f37[_0x5d8d3e(0x14e)])return _0x2a9f37;var _0x287e84=Object['create'](null);return _0x2a9f37&&Object['keys'](_0x2a9f37)['forEach'](function(_0x3edb33){var _0x5940d2=_0x5d8d3e;if(_0x3edb33!=='default'){var _0x1290e5=Object['getOwnPropertyDescriptor'](_0x2a9f37,_0x3edb33);Object['defineProperty'](_0x287e84,_0x3edb33,_0x1290e5[_0x5940d2(0x310)]?_0x1290e5:{'enumerable':!![],'get':function(){return _0x2a9f37[_0x3edb33];}});}}),_0x287e84['default']=_0x2a9f37,_0x287e84;}function _mergeNamespaces(_0x49478f,_0x43a12f){return _0x43a12f['forEach'](function(_0x835d6f){var _0x4a5e83=_0x15c6;_0x835d6f&&typeof _0x835d6f!=='string'&&!Array[_0x4a5e83(0x327)](_0x835d6f)&&Object['keys'](_0x835d6f)['forEach'](function(_0x4af234){var _0xa99547=_0x4a5e83;if(_0x4af234!=='default'&&!(_0x4af234 in _0x49478f)){var _0xd40991=Object[_0xa99547(0x2b0)](_0x835d6f,_0x4af234);Object['defineProperty'](_0x49478f,_0x4af234,_0xd40991['get']?_0xd40991:{'enumerable':!![],'get':function(){return _0x835d6f[_0x4af234];}});}});}),_0x49478f;}var mars3d__namespace=_interopNamespace(mars3d),pi$1=Math['PI'],twoPi$1=pi$1*0x2,deg2rad$1=pi$1/0xb4,rad2deg$1=0xb4/pi$1,minutesPerDay$1=0x5a0,mu$1=398600.8,earthRadius$1=6378.135,xke$1=0x3c/Math['sqrt'](earthRadius$1*earthRadius$1*earthRadius$1/mu$1),vkmpersec$1=earthRadius$1*xke$1/0x3c,tumin$1=0x1/xke$1,j2$1=0.001082616,j3$1=-0.00000253881,j4$1=-0.00000165597,j3oj2$1=j3$1/j2$1,x2o3$1=0x2/0x3,constants$1=Object['freeze']({'__proto__':null,'deg2rad':deg2rad$1,'earthRadius':earthRadius$1,'j2':j2$1,'j3':j3$1,'j3oj2':j3oj2$1,'j4':j4$1,'minutesPerDay':minutesPerDay$1,'mu':mu$1,'pi':pi$1,'rad2deg':rad2deg$1,'tumin':tumin$1,'twoPi':twoPi$1,'vkmpersec':vkmpersec$1,'x2o3':x2o3$1,'xke':xke$1});function days2mdhms$1(_0x454a26,_0x400510){var _0x4b75fa=_0x15c6,_0x1f1d10=[0x1f,_0x454a26%0x4===0x0?0x1d:0x1c,0x1f,0x1e,0x1f,0x1e,0x1f,0x1f,0x1e,0x1f,0x1e,0x1f],_0x308562=Math['floor'](_0x400510),_0x3451b7=0x1,_0x488502=0x0;while(_0x308562>_0x488502+_0x1f1d10[_0x3451b7-0x1]&&_0x3451b7<0xc){_0x488502+=_0x1f1d10[_0x3451b7-0x1],_0x3451b7+=0x1;}var _0x551159=_0x3451b7,_0x565378=_0x308562-_0x488502,_0x259638=(_0x400510-_0x308562)*0x18,_0x504eff=Math[_0x4b75fa(0x2d4)](_0x259638);_0x259638=(_0x259638-_0x504eff)*0x3c;var _0x21eca5=Math['floor'](_0x259638),_0x253a62=(_0x259638-_0x21eca5)*0x3c;return{'mon':_0x551159,'day':_0x565378,'hr':_0x504eff,'minute':_0x21eca5,'sec':_0x253a62};}function jdayInternal$1(_0x3f6fe6,_0x5301f4,_0x1e9a60,_0x358099,_0x98d12e,_0x5afb0d){var _0x5c9d65=_0x15c6,_0x4b0fb3=arguments[_0x5c9d65(0x152)]>0x6&&arguments[0x6]!==undefined?arguments[0x6]:0x0;return 0x16f*_0x3f6fe6-Math['floor'](0x7*(_0x3f6fe6+Math['floor']((_0x5301f4+0x9)/0xc))*0.25)+Math['floor'](0x113*_0x5301f4/0x9)+_0x1e9a60+1721013.5+((_0x4b0fb3/0xea60+_0x5afb0d/0x3c+_0x98d12e)/0x3c+_0x358099)/0x18;}function jday$1(_0x1d27a0,_0x53162d,_0xd10983,_0x17546f,_0x3d3995,_0x36d1a3,_0x4973d2){var _0x1b59ad=_0x15c6;if(_0x1d27a0 instanceof Date){var _0x2eb2e4=_0x1d27a0;return jdayInternal$1(_0x2eb2e4['getUTCFullYear'](),_0x2eb2e4['getUTCMonth']()+0x1,_0x2eb2e4['getUTCDate'](),_0x2eb2e4[_0x1b59ad(0x177)](),_0x2eb2e4['getUTCMinutes'](),_0x2eb2e4['getUTCSeconds'](),_0x2eb2e4['getUTCMilliseconds']());}return jdayInternal$1(_0x1d27a0,_0x53162d,_0xd10983,_0x17546f,_0x3d3995,_0x36d1a3,_0x4973d2);}function invjday$1(_0xf4a3cb,_0x4a3130){var _0x10870d=_0x15c6,_0x251d60=_0xf4a3cb-2415019.5,_0x1ef63e=_0x251d60/365.25,_0x5a942c=0x76c+Math['floor'](_0x1ef63e),_0x416601=Math['floor']((_0x5a942c-0x76d)*0.25),_0x4dd022=_0x251d60-((_0x5a942c-0x76c)*0x16d+_0x416601)+1e-11;_0x4dd022<0x1&&(_0x5a942c-=0x1,_0x416601=Math[_0x10870d(0x2d4)]((_0x5a942c-0x76d)*0.25),_0x4dd022=_0x251d60-((_0x5a942c-0x76c)*0x16d+_0x416601));var _0x2f1854=days2mdhms$1(_0x5a942c,_0x4dd022),_0x2858bc=_0x2f1854['mon'],_0x25e92f=_0x2f1854['day'],_0x4f2425=_0x2f1854['hr'],_0x30bb98=_0x2f1854[_0x10870d(0x347)],_0x3d58fc=_0x2f1854['sec']-8.64e-7;if(_0x4a3130)return[_0x5a942c,_0x2858bc,_0x25e92f,_0x4f2425,_0x30bb98,Math['floor'](_0x3d58fc)];return new Date(Date['UTC'](_0x5a942c,_0x2858bc-0x1,_0x25e92f,_0x4f2425,_0x30bb98,Math['floor'](_0x3d58fc)));}function dpper$1(_0x4b9186,_0x624a1b){var _0xca127a=_0x15c6,_0x40e14a=_0x4b9186['e3'],_0x4543d0=_0x4b9186['ee2'],_0x5bb682=_0x4b9186[_0xca127a(0x164)],_0x2c2c2d=_0x4b9186[_0xca127a(0x16b)],_0x516dfd=_0x4b9186['pho'],_0x4add1b=_0x4b9186['pinco'],_0x33f860=_0x4b9186['plo'],_0x2ae530=_0x4b9186['se2'],_0xdfa1b=_0x4b9186[_0xca127a(0x2ff)],_0x4a798f=_0x4b9186['sgh2'],_0x489578=_0x4b9186['sgh3'],_0x20f783=_0x4b9186['sgh4'],_0x4dc8cc=_0x4b9186['sh2'],_0xe79fcc=_0x4b9186['sh3'],_0x21d001=_0x4b9186[_0xca127a(0x350)],_0x3f2b95=_0x4b9186['si3'],_0x2d0b7d=_0x4b9186['sl2'],_0x19b8d4=_0x4b9186['sl3'],_0x48e63d=_0x4b9186['sl4'],_0x28c7a2=_0x4b9186['t'],_0x56b103=_0x4b9186['xgh2'],_0x406580=_0x4b9186['xgh3'],_0x160c15=_0x4b9186['xgh4'],_0xd137e4=_0x4b9186['xh2'],_0x3a91f6=_0x4b9186['xh3'],_0x189652=_0x4b9186['xi2'],_0x3abbc5=_0x4b9186[_0xca127a(0x172)],_0x4f70ac=_0x4b9186['xl2'],_0xf597b3=_0x4b9186['xl3'],_0x5f47ca=_0x4b9186['xl4'],_0x26b3b5=_0x4b9186['zmol'],_0x5cd6fc=_0x4b9186['zmos'],_0x48e3e2=_0x624a1b[_0xca127a(0x1f0)],_0x12c7dc=_0x624a1b['opsmode'],_0x2d8802=_0x624a1b['ep'],_0x510128=_0x624a1b[_0xca127a(0x349)],_0x5e9bbe=_0x624a1b[_0xca127a(0x292)],_0x4b6fed=_0x624a1b['argpp'],_0xd6deb4=_0x624a1b['mp'],_0x5bef48,_0x3f4f68,_0x416e5a,_0x481782,_0x53cfa5,_0xf2d9c5,_0x1d5b0c,_0x54cedf,_0x39a665,_0x512b15,_0x59e805,_0x3689ed,_0x44931a,_0x114bb7,_0xcdb280,_0x1547c1,_0xa6f7ac,_0x4669d5,_0x3ed136,_0x1f45e6,_0x5ea777,_0x53966c=0.0000119459,_0x335546=0.01675,_0x2d0c86=0.00015835218,_0x3e5621=0.0549;_0x5ea777=_0x5cd6fc+_0x53966c*_0x28c7a2;_0x48e3e2==='y'&&(_0x5ea777=_0x5cd6fc);_0x1f45e6=_0x5ea777+0x2*_0x335546*Math['sin'](_0x5ea777),_0xa6f7ac=Math['sin'](_0x1f45e6),_0x512b15=0.5*_0xa6f7ac*_0xa6f7ac-0.25,_0x59e805=-0.5*_0xa6f7ac*Math['cos'](_0x1f45e6);var _0x318c8c=_0x2ae530*_0x512b15+_0xdfa1b*_0x59e805,_0x379a13=_0x21d001*_0x512b15+_0x3f2b95*_0x59e805,_0x4f7ab8=_0x2d0b7d*_0x512b15+_0x19b8d4*_0x59e805+_0x48e63d*_0xa6f7ac,_0x3a8115=_0x4a798f*_0x512b15+_0x489578*_0x59e805+_0x20f783*_0xa6f7ac,_0x596bd4=_0x4dc8cc*_0x512b15+_0xe79fcc*_0x59e805;_0x5ea777=_0x26b3b5+_0x2d0c86*_0x28c7a2;_0x48e3e2==='y'&&(_0x5ea777=_0x26b3b5);_0x1f45e6=_0x5ea777+0x2*_0x3e5621*Math['sin'](_0x5ea777),_0xa6f7ac=Math['sin'](_0x1f45e6),_0x512b15=0.5*_0xa6f7ac*_0xa6f7ac-0.25,_0x59e805=-0.5*_0xa6f7ac*Math['cos'](_0x1f45e6);var _0x5e261a=_0x4543d0*_0x512b15+_0x40e14a*_0x59e805,_0x20428d=_0x189652*_0x512b15+_0x3abbc5*_0x59e805,_0x195918=_0x4f70ac*_0x512b15+_0xf597b3*_0x59e805+_0x5f47ca*_0xa6f7ac,_0x17656b=_0x56b103*_0x512b15+_0x406580*_0x59e805+_0x160c15*_0xa6f7ac,_0x320884=_0xd137e4*_0x512b15+_0x3a91f6*_0x59e805;return _0x3689ed=_0x318c8c+_0x5e261a,_0xcdb280=_0x379a13+_0x20428d,_0x1547c1=_0x4f7ab8+_0x195918,_0x44931a=_0x3a8115+_0x17656b,_0x114bb7=_0x596bd4+_0x320884,_0x48e3e2==='n'&&(_0x3689ed-=_0x5bb682,_0xcdb280-=_0x4add1b,_0x1547c1-=_0x33f860,_0x44931a-=_0x2c2c2d,_0x114bb7-=_0x516dfd,_0x510128+=_0xcdb280,_0x2d8802+=_0x3689ed,_0x481782=Math['sin'](_0x510128),_0x416e5a=Math[_0xca127a(0x2dd)](_0x510128),_0x510128>=0.2?(_0x114bb7/=_0x481782,_0x44931a-=_0x416e5a*_0x114bb7,_0x4b6fed+=_0x44931a,_0x5e9bbe+=_0x114bb7,_0xd6deb4+=_0x1547c1):(_0xf2d9c5=Math['sin'](_0x5e9bbe),_0x53cfa5=Math['cos'](_0x5e9bbe),_0x5bef48=_0x481782*_0xf2d9c5,_0x3f4f68=_0x481782*_0x53cfa5,_0x1d5b0c=_0x114bb7*_0x53cfa5+_0xcdb280*_0x416e5a*_0xf2d9c5,_0x54cedf=-_0x114bb7*_0xf2d9c5+_0xcdb280*_0x416e5a*_0x53cfa5,_0x5bef48+=_0x1d5b0c,_0x3f4f68+=_0x54cedf,_0x5e9bbe%=twoPi$1,_0x5e9bbe<0x0&&_0x12c7dc==='a'&&(_0x5e9bbe+=twoPi$1),_0x4669d5=_0xd6deb4+_0x4b6fed+_0x416e5a*_0x5e9bbe,_0x39a665=_0x1547c1+_0x44931a-_0xcdb280*_0x5e9bbe*_0x481782,_0x4669d5+=_0x39a665,_0x3ed136=_0x5e9bbe,_0x5e9bbe=Math['atan2'](_0x5bef48,_0x3f4f68),_0x5e9bbe<0x0&&_0x12c7dc==='a'&&(_0x5e9bbe+=twoPi$1),Math['abs'](_0x3ed136-_0x5e9bbe)>pi$1&&(_0x5e9bbe<_0x3ed136?_0x5e9bbe+=twoPi$1:_0x5e9bbe-=twoPi$1),_0xd6deb4+=_0x1547c1,_0x4b6fed=_0x4669d5-_0xd6deb4-_0x416e5a*_0x5e9bbe)),{'ep':_0x2d8802,'inclp':_0x510128,'nodep':_0x5e9bbe,'argpp':_0x4b6fed,'mp':_0xd6deb4};}function dscom$1(_0x6a043a){var _0x4b8a44=_0x15c6,_0x3a89d4=_0x6a043a[_0x4b8a44(0x302)],_0x4e7ff0=_0x6a043a['ep'],_0x460a91=_0x6a043a['argpp'],_0x18633e=_0x6a043a['tc'],_0x27118a=_0x6a043a[_0x4b8a44(0x349)],_0x47de47=_0x6a043a['nodep'],_0x5e778b=_0x6a043a['np'],_0x2bbe8f,_0x39517c,_0xc1d183,_0x23bdce,_0x4149cd,_0x370865,_0x20138b,_0x562d5e,_0x12e585,_0x290d31,_0x19abbc,_0x5baf1f,_0x398cf5,_0x4cac79,_0x3012cd,_0x39b8b8,_0x4f6ec8,_0x8d3029,_0x40a5be,_0x1075df,_0x1b802f,_0x11f5e0,_0x2e4522,_0x57a929,_0x41df1f,_0x366521,_0x2ec3e3,_0x4fe930,_0x4a2fdc,_0x568169,_0x5c3a4b,_0x3555a5,_0x247800,_0x3e0237,_0x28132f,_0x240be6,_0x485ba0,_0x21b5e4,_0xf12d23,_0x4ccdc8,_0x2e02d4,_0x1a73db,_0xc59555,_0x47db78,_0x551865,_0x567a01,_0x2050d5,_0x44c40f,_0x404886,_0x5879b9,_0x56af1d,_0x3387fe,_0x770d38,_0x2438bb,_0x4a4105,_0x2fff5d,_0x3425dc,_0xefa323,_0x1741af,_0x3aa24a,_0x31d72f,_0x26022b,_0x220f0c,_0x3eb09d=0.01675,_0x1c4864=0.0549,_0x2a76f8=0.0000029864797,_0x248f2e=4.7968065e-7,_0x245db5=0.39785416,_0x327a0e=0.91744867,_0x410819=0.1945905,_0x2dc684=-0.98088458,_0x523046=_0x5e778b,_0x2f2124=_0x4e7ff0,_0x133024=Math['sin'](_0x47de47),_0x272adb=Math['cos'](_0x47de47),_0x47fc6e=Math[_0x4b8a44(0x226)](_0x460a91),_0x3024fa=Math['cos'](_0x460a91),_0x56ec8c=Math['sin'](_0x27118a),_0xd26912=Math[_0x4b8a44(0x2dd)](_0x27118a),_0x55929c=_0x2f2124*_0x2f2124,_0x1055e8=0x1-_0x55929c,_0x1e8ccd=Math['sqrt'](_0x1055e8),_0x384128=0x0,_0x1cc4ef=0x0,_0x1fa788=0x0,_0x385be8=0x0,_0x67a642=0x0,_0x48aa19=_0x3a89d4+18261.5+_0x18633e/0x5a0,_0x3faa3a=(4.523602-0.00092422029*_0x48aa19)%twoPi$1,_0x4b96dc=Math['sin'](_0x3faa3a),_0x477400=Math['cos'](_0x3faa3a),_0x4348b8=0.91375164-0.03568096*_0x477400,_0xc70fb3=Math[_0x4b8a44(0x1d2)](0x1-_0x4348b8*_0x4348b8),_0x27d6cd=0.089683511*_0x4b96dc/_0xc70fb3,_0x414ecf=Math['sqrt'](0x1-_0x27d6cd*_0x27d6cd),_0x51efe0=5.8351514+0.001944368*_0x48aa19,_0x5ad5cd=0.39785416*_0x4b96dc/_0xc70fb3,_0x4095c6=_0x414ecf*_0x477400+0.91744867*_0x27d6cd*_0x4b96dc;_0x5ad5cd=Math['atan2'](_0x5ad5cd,_0x4095c6),_0x5ad5cd+=_0x51efe0-_0x3faa3a;var _0x5e5240=Math[_0x4b8a44(0x2dd)](_0x5ad5cd),_0xa1bf71=Math['sin'](_0x5ad5cd);_0x1075df=_0x410819,_0x1b802f=_0x2dc684,_0x57a929=_0x327a0e,_0x41df1f=_0x245db5,_0x11f5e0=_0x272adb,_0x2e4522=_0x133024,_0x19abbc=_0x2a76f8;var _0xb29462=0x1/_0x523046,_0x53c464=0x0;while(_0x53c464<0x2){_0x53c464+=0x1,_0x2bbe8f=_0x1075df*_0x11f5e0+_0x1b802f*_0x57a929*_0x2e4522,_0xc1d183=-_0x1b802f*_0x11f5e0+_0x1075df*_0x57a929*_0x2e4522,_0x20138b=-_0x1075df*_0x2e4522+_0x1b802f*_0x57a929*_0x11f5e0,_0x562d5e=_0x1b802f*_0x41df1f,_0x12e585=_0x1b802f*_0x2e4522+_0x1075df*_0x57a929*_0x11f5e0,_0x290d31=_0x1075df*_0x41df1f,_0x39517c=_0xd26912*_0x20138b+_0x56ec8c*_0x562d5e,_0x23bdce=_0xd26912*_0x12e585+_0x56ec8c*_0x290d31,_0x4149cd=-_0x56ec8c*_0x20138b+_0xd26912*_0x562d5e,_0x370865=-_0x56ec8c*_0x12e585+_0xd26912*_0x290d31,_0x5baf1f=_0x2bbe8f*_0x3024fa+_0x39517c*_0x47fc6e,_0x398cf5=_0xc1d183*_0x3024fa+_0x23bdce*_0x47fc6e,_0x4cac79=-_0x2bbe8f*_0x47fc6e+_0x39517c*_0x3024fa,_0x3012cd=-_0xc1d183*_0x47fc6e+_0x23bdce*_0x3024fa,_0x39b8b8=_0x4149cd*_0x47fc6e,_0x4f6ec8=_0x370865*_0x47fc6e,_0x8d3029=_0x4149cd*_0x3024fa,_0x40a5be=_0x370865*_0x3024fa,_0x31d72f=0xc*_0x5baf1f*_0x5baf1f-0x3*_0x4cac79*_0x4cac79,_0x26022b=0x18*_0x5baf1f*_0x398cf5-0x6*_0x4cac79*_0x3012cd,_0x220f0c=0xc*_0x398cf5*_0x398cf5-0x3*_0x3012cd*_0x3012cd,_0x3387fe=0x3*(_0x2bbe8f*_0x2bbe8f+_0x39517c*_0x39517c)+_0x31d72f*_0x55929c,_0x770d38=0x6*(_0x2bbe8f*_0xc1d183+_0x39517c*_0x23bdce)+_0x26022b*_0x55929c,_0x2438bb=0x3*(_0xc1d183*_0xc1d183+_0x23bdce*_0x23bdce)+_0x220f0c*_0x55929c,_0x4a4105=-0x6*_0x2bbe8f*_0x4149cd+_0x55929c*(-0x18*_0x5baf1f*_0x8d3029-0x6*_0x4cac79*_0x39b8b8),_0x2fff5d=-0x6*(_0x2bbe8f*_0x370865+_0xc1d183*_0x4149cd)+_0x55929c*(-0x18*(_0x398cf5*_0x8d3029+_0x5baf1f*_0x40a5be)+-0x6*(_0x4cac79*_0x4f6ec8+_0x3012cd*_0x39b8b8)),_0x3425dc=-0x6*_0xc1d183*_0x370865+_0x55929c*(-0x18*_0x398cf5*_0x40a5be-0x6*_0x3012cd*_0x4f6ec8),_0xefa323=0x6*_0x39517c*_0x4149cd+_0x55929c*(0x18*_0x5baf1f*_0x39b8b8-0x6*_0x4cac79*_0x8d3029),_0x1741af=0x6*(_0x23bdce*_0x4149cd+_0x39517c*_0x370865)+_0x55929c*(0x18*(_0x398cf5*_0x39b8b8+_0x5baf1f*_0x4f6ec8)-0x6*(_0x3012cd*_0x8d3029+_0x4cac79*_0x40a5be)),_0x3aa24a=0x6*_0x23bdce*_0x370865+_0x55929c*(0x18*_0x398cf5*_0x4f6ec8-0x6*_0x3012cd*_0x40a5be),_0x3387fe=_0x3387fe+_0x3387fe+_0x1055e8*_0x31d72f,_0x770d38=_0x770d38+_0x770d38+_0x1055e8*_0x26022b,_0x2438bb=_0x2438bb+_0x2438bb+_0x1055e8*_0x220f0c,_0x2050d5=_0x19abbc*_0xb29462,_0x567a01=-0.5*_0x2050d5/_0x1e8ccd,_0x44c40f=_0x2050d5*_0x1e8ccd,_0x551865=-0xf*_0x2f2124*_0x44c40f,_0x404886=_0x5baf1f*_0x4cac79+_0x398cf5*_0x3012cd,_0x5879b9=_0x398cf5*_0x4cac79+_0x5baf1f*_0x3012cd,_0x56af1d=_0x398cf5*_0x3012cd-_0x5baf1f*_0x4cac79,_0x53c464===0x1&&(_0x366521=_0x551865,_0x2ec3e3=_0x567a01,_0x4fe930=_0x2050d5,_0x4a2fdc=_0x44c40f,_0x568169=_0x404886,_0x5c3a4b=_0x5879b9,_0x3555a5=_0x56af1d,_0x247800=_0x3387fe,_0x3e0237=_0x770d38,_0x28132f=_0x2438bb,_0x240be6=_0x4a4105,_0x485ba0=_0x2fff5d,_0x21b5e4=_0x3425dc,_0xf12d23=_0xefa323,_0x4ccdc8=_0x1741af,_0x2e02d4=_0x3aa24a,_0x1a73db=_0x31d72f,_0xc59555=_0x26022b,_0x47db78=_0x220f0c,_0x1075df=_0x5e5240,_0x1b802f=_0xa1bf71,_0x57a929=_0x4348b8,_0x41df1f=_0xc70fb3,_0x11f5e0=_0x414ecf*_0x272adb+_0x27d6cd*_0x133024,_0x2e4522=_0x133024*_0x414ecf-_0x272adb*_0x27d6cd,_0x19abbc=_0x248f2e);}var _0x38e7b6=(4.7199672+(0.2299715*_0x48aa19-_0x51efe0))%twoPi$1,_0x692d41=(6.2565837+0.017201977*_0x48aa19)%twoPi$1,_0xd65979=0x2*_0x366521*_0x5c3a4b,_0x50588f=0x2*_0x366521*_0x3555a5,_0x5fbdf4=0x2*_0x2ec3e3*_0x485ba0,_0x11a810=0x2*_0x2ec3e3*(_0x21b5e4-_0x240be6),_0x1aeb36=-0x2*_0x4fe930*_0x3e0237,_0x5c3b25=-0x2*_0x4fe930*(_0x28132f-_0x247800),_0x24da85=-0x2*_0x4fe930*(-0x15-0x9*_0x55929c)*_0x3eb09d,_0x5a6cbf=0x2*_0x4a2fdc*_0xc59555,_0x567139=0x2*_0x4a2fdc*(_0x47db78-_0x1a73db),_0x7a4a75=-0x12*_0x4a2fdc*_0x3eb09d,_0x48e22c=-0x2*_0x2ec3e3*_0x4ccdc8,_0x2f9924=-0x2*_0x2ec3e3*(_0x2e02d4-_0xf12d23),_0x337fbf=0x2*_0x551865*_0x5879b9,_0x32075e=0x2*_0x551865*_0x56af1d,_0x3166ad=0x2*_0x567a01*_0x2fff5d,_0x1eeaba=0x2*_0x567a01*(_0x3425dc-_0x4a4105),_0x1d177e=-0x2*_0x2050d5*_0x770d38,_0x20bd75=-0x2*_0x2050d5*(_0x2438bb-_0x3387fe),_0x5d72b3=-0x2*_0x2050d5*(-0x15-0x9*_0x55929c)*_0x1c4864,_0x1095ae=0x2*_0x44c40f*_0x26022b,_0x19984d=0x2*_0x44c40f*(_0x220f0c-_0x31d72f),_0x35498a=-0x12*_0x44c40f*_0x1c4864,_0x2b20d6=-0x2*_0x567a01*_0x1741af,_0x34cdb3=-0x2*_0x567a01*(_0x3aa24a-_0xefa323);return{'snodm':_0x133024,'cnodm':_0x272adb,'sinim':_0x56ec8c,'cosim':_0xd26912,'sinomm':_0x47fc6e,'cosomm':_0x3024fa,'day':_0x48aa19,'e3':_0x32075e,'ee2':_0x337fbf,'em':_0x2f2124,'emsq':_0x55929c,'gam':_0x51efe0,'peo':_0x384128,'pgho':_0x385be8,'pho':_0x67a642,'pinco':_0x1cc4ef,'plo':_0x1fa788,'rtemsq':_0x1e8ccd,'se2':_0xd65979,'se3':_0x50588f,'sgh2':_0x5a6cbf,'sgh3':_0x567139,'sgh4':_0x7a4a75,'sh2':_0x48e22c,'sh3':_0x2f9924,'si2':_0x5fbdf4,'si3':_0x11a810,'sl2':_0x1aeb36,'sl3':_0x5c3b25,'sl4':_0x24da85,'s1':_0x551865,'s2':_0x567a01,'s3':_0x2050d5,'s4':_0x44c40f,'s5':_0x404886,'s6':_0x5879b9,'s7':_0x56af1d,'ss1':_0x366521,'ss2':_0x2ec3e3,'ss3':_0x4fe930,'ss4':_0x4a2fdc,'ss5':_0x568169,'ss6':_0x5c3a4b,'ss7':_0x3555a5,'sz1':_0x247800,'sz2':_0x3e0237,'sz3':_0x28132f,'sz11':_0x240be6,'sz12':_0x485ba0,'sz13':_0x21b5e4,'sz21':_0xf12d23,'sz22':_0x4ccdc8,'sz23':_0x2e02d4,'sz31':_0x1a73db,'sz32':_0xc59555,'sz33':_0x47db78,'xgh2':_0x1095ae,'xgh3':_0x19984d,'xgh4':_0x35498a,'xh2':_0x2b20d6,'xh3':_0x34cdb3,'xi2':_0x3166ad,'xi3':_0x1eeaba,'xl2':_0x1d177e,'xl3':_0x20bd75,'xl4':_0x5d72b3,'nm':_0x523046,'z1':_0x3387fe,'z2':_0x770d38,'z3':_0x2438bb,'z11':_0x4a4105,'z12':_0x2fff5d,'z13':_0x3425dc,'z21':_0xefa323,'z22':_0x1741af,'z23':_0x3aa24a,'z31':_0x31d72f,'z32':_0x26022b,'z33':_0x220f0c,'zmol':_0x38e7b6,'zmos':_0x692d41};}function dsinit$1(_0x1f77e9){var _0x5abff0=_0x15c6,_0x542b39=_0x1f77e9[_0x5abff0(0x317)],_0x4b7a66=_0x1f77e9['argpo'],_0x4a607a=_0x1f77e9['s1'],_0x20a912=_0x1f77e9['s2'],_0x4cc036=_0x1f77e9['s3'],_0x5525cb=_0x1f77e9['s4'],_0x2aacf6=_0x1f77e9['s5'],_0x5b29ab=_0x1f77e9['sinim'],_0x12888f=_0x1f77e9['ss1'],_0x55199d=_0x1f77e9[_0x5abff0(0x297)],_0x3d45fb=_0x1f77e9['ss3'],_0x2e6296=_0x1f77e9[_0x5abff0(0x242)],_0x10f65b=_0x1f77e9['ss5'],_0x75017d=_0x1f77e9['sz1'],_0x365e66=_0x1f77e9['sz3'],_0x119f0c=_0x1f77e9[_0x5abff0(0x283)],_0x225a7c=_0x1f77e9['sz13'],_0x19f3c8=_0x1f77e9[_0x5abff0(0x309)],_0xc36620=_0x1f77e9[_0x5abff0(0x260)],_0x4f92c0=_0x1f77e9['sz31'],_0x4bbe81=_0x1f77e9['sz33'],_0xf3c7f2=_0x1f77e9['t'],_0x327681=_0x1f77e9['tc'],_0x565c0b=_0x1f77e9['gsto'],_0x1dfb3f=_0x1f77e9['mo'],_0x44d0b9=_0x1f77e9['mdot'],_0xfbdcc=_0x1f77e9['no'],_0xddee6c=_0x1f77e9[_0x5abff0(0x322)],_0x385c90=_0x1f77e9['nodedot'],_0x52f65f=_0x1f77e9['xpidot'],_0x5d7ab5=_0x1f77e9['z1'],_0x23fa12=_0x1f77e9['z3'],_0x20927b=_0x1f77e9[_0x5abff0(0x1d8)],_0x3adf3c=_0x1f77e9['z13'],_0xa42e34=_0x1f77e9['z21'],_0x27f2e0=_0x1f77e9['z23'],_0xd5c630=_0x1f77e9[_0x5abff0(0x27a)],_0x3ffa34=_0x1f77e9['z33'],_0x5475d9=_0x1f77e9['ecco'],_0x543ac8=_0x1f77e9['eccsq'],_0x29b9ca=_0x1f77e9['emsq'],_0x2ce853=_0x1f77e9['em'],_0x425295=_0x1f77e9[_0x5abff0(0x26c)],_0x15866d=_0x1f77e9[_0x5abff0(0x312)],_0x4fe1b7=_0x1f77e9['mm'],_0x4cd982=_0x1f77e9['nm'],_0x1fb810=_0x1f77e9[_0x5abff0(0x203)],_0xb3886c=_0x1f77e9['irez'],_0x25085f=_0x1f77e9['atime'],_0x4b2df6=_0x1f77e9[_0x5abff0(0x33f)],_0x487ce7=_0x1f77e9[_0x5abff0(0x323)],_0x4b6e5f=_0x1f77e9['d3210'],_0x51a354=_0x1f77e9['d3222'],_0x3897b7=_0x1f77e9['d4410'],_0x9dcce7=_0x1f77e9['d4422'],_0x536edd=_0x1f77e9['d5220'],_0x11422b=_0x1f77e9['d5232'],_0xf04ed0=_0x1f77e9['d5421'],_0x4f3487=_0x1f77e9['d5433'],_0x291bf7=_0x1f77e9[_0x5abff0(0x2cc)],_0x499ae2=_0x1f77e9['didt'],_0x2355e4=_0x1f77e9['dmdt'],_0x4abeea=_0x1f77e9[_0x5abff0(0x166)],_0x85b864=_0x1f77e9[_0x5abff0(0x269)],_0x22c15e=_0x1f77e9['del1'],_0x188572=_0x1f77e9['del2'],_0x348ccf=_0x1f77e9['del3'],_0x1eca2c=_0x1f77e9['xfact'],_0x22abe2=_0x1f77e9['xlamo'],_0x3eb1d1=_0x1f77e9['xli'],_0xa95cfb=_0x1f77e9['xni'],_0x408c4a,_0x4ba840,_0x54b5bc,_0x5726d2,_0x1d8814,_0x1b5ad0,_0x26349d,_0x593c17,_0x3974b2,_0x3b02bd,_0x44fa7a,_0x3c9141,_0x56262e,_0x52004a,_0x5057ad,_0x130856,_0x3ae4ac,_0x2b9c42,_0x1a44fb,_0x353ef0,_0x3642f8,_0x5de0c3,_0x3bc218,_0x72d779,_0x377ac2,_0x2a5c88,_0x1c2008,_0x2153df,_0x9f8198,_0x1ca227,_0x4da6c5,_0x46ef17,_0x5493d4=0.0000017891679,_0x49ee6e=0.0000021460748,_0x306ff1=2.2123015e-7,_0xc261e0=0.0000017891679,_0x1e9627=7.3636953e-9,_0x3d8464=2.1765803e-9,_0x4a0a54=0.0043752690880113,_0x559ea4=3.7393792e-7,_0x5faeb=1.1428639e-7,_0x3c61ed=0.00015835218,_0x6fdf5a=0.0000119459;_0xb3886c=0x0;_0x4cd982<0.0052359877&&_0x4cd982>0.0034906585&&(_0xb3886c=0x1);_0x4cd982>=0.00826&&_0x4cd982<=0.00924&&_0x2ce853>=0.5&&(_0xb3886c=0x2);var _0x582014=_0x12888f*_0x6fdf5a*_0x10f65b,_0x4312a6=_0x55199d*_0x6fdf5a*(_0x119f0c+_0x225a7c),_0x1d8ff3=-_0x6fdf5a*_0x3d45fb*(_0x75017d+_0x365e66-0xe-0x6*_0x29b9ca),_0x18cc72=_0x2e6296*_0x6fdf5a*(_0x4f92c0+_0x4bbe81-0x6),_0x1fffa8=-_0x6fdf5a*_0x55199d*(_0x19f3c8+_0xc36620);(_0x15866d<0.052359877||_0x15866d>pi$1-0.052359877)&&(_0x1fffa8=0x0);_0x5b29ab!==0x0&&(_0x1fffa8/=_0x5b29ab);var _0x189280=_0x18cc72-_0x542b39*_0x1fffa8;_0x291bf7=_0x582014+_0x4a607a*_0x3c61ed*_0x2aacf6,_0x499ae2=_0x4312a6+_0x20a912*_0x3c61ed*(_0x20927b+_0x3adf3c),_0x2355e4=_0x1d8ff3-_0x3c61ed*_0x4cc036*(_0x5d7ab5+_0x23fa12-0xe-0x6*_0x29b9ca);var _0x3f34f8=_0x5525cb*_0x3c61ed*(_0xd5c630+_0x3ffa34-0x6),_0x387e68=-_0x3c61ed*_0x20a912*(_0xa42e34+_0x27f2e0);(_0x15866d<0.052359877||_0x15866d>pi$1-0.052359877)&&(_0x387e68=0x0);_0x85b864=_0x189280+_0x3f34f8,_0x4abeea=_0x1fffa8;_0x5b29ab!==0x0&&(_0x85b864-=_0x542b39/_0x5b29ab*_0x387e68,_0x4abeea+=_0x387e68/_0x5b29ab);var _0x214a4f=0x0,_0x5e958f=(_0x565c0b+_0x327681*_0x4a0a54)%twoPi$1;_0x2ce853+=_0x291bf7*_0xf3c7f2,_0x15866d+=_0x499ae2*_0xf3c7f2,_0x425295+=_0x85b864*_0xf3c7f2,_0x1fb810+=_0x4abeea*_0xf3c7f2,_0x4fe1b7+=_0x2355e4*_0xf3c7f2;if(_0xb3886c!==0x0){_0x1ca227=Math[_0x5abff0(0x22c)](_0x4cd982/xke$1,x2o3$1);if(_0xb3886c===0x2){_0x4da6c5=_0x542b39*_0x542b39;var _0xf44729=_0x2ce853;_0x2ce853=_0x5475d9;var _0x306ea1=_0x29b9ca;_0x29b9ca=_0x543ac8,_0x46ef17=_0x2ce853*_0x29b9ca,_0x52004a=-0.306-(_0x2ce853-0.64)*0.44,_0x2ce853<=0.65?(_0x5057ad=3.616-13.247*_0x2ce853+16.29*_0x29b9ca,_0x3ae4ac=-19.302+117.39*_0x2ce853-228.419*_0x29b9ca+156.591*_0x46ef17,_0x2b9c42=-18.9068+109.7927*_0x2ce853-214.6334*_0x29b9ca+146.5816*_0x46ef17,_0x1a44fb=-41.122+242.694*_0x2ce853-471.094*_0x29b9ca+313.953*_0x46ef17,_0x353ef0=-146.407+841.88*_0x2ce853-1629.014*_0x29b9ca+1083.435*_0x46ef17,_0x3642f8=-532.114+3017.977*_0x2ce853-5740.032*_0x29b9ca+3708.276*_0x46ef17):(_0x5057ad=-72.099+331.819*_0x2ce853-508.738*_0x29b9ca+266.724*_0x46ef17,_0x3ae4ac=-346.844+1582.851*_0x2ce853-2415.925*_0x29b9ca+1246.113*_0x46ef17,_0x2b9c42=-342.585+1554.908*_0x2ce853-2366.899*_0x29b9ca+1215.972*_0x46ef17,_0x1a44fb=-1052.797+4758.686*_0x2ce853-7193.992*_0x29b9ca+3651.957*_0x46ef17,_0x353ef0=-3581.69+16178.11*_0x2ce853-24462.77*_0x29b9ca+12422.52*_0x46ef17,_0x2ce853>0.715?_0x3642f8=-5149.66+29936.92*_0x2ce853-54087.36*_0x29b9ca+31324.56*_0x46ef17:_0x3642f8=1464.74-4664.75*_0x2ce853+3763.64*_0x29b9ca),_0x2ce853<0.7?(_0x72d779=-919.2277+4988.61*_0x2ce853-9064.77*_0x29b9ca+5542.21*_0x46ef17,_0x5de0c3=-822.71072+4568.6173*_0x2ce853-8491.4146*_0x29b9ca+5337.524*_0x46ef17,_0x3bc218=-853.666+4690.25*_0x2ce853-8624.77*_0x29b9ca+5341.4*_0x46ef17):(_0x72d779=-37995.78+161616.52*_0x2ce853-229838.2*_0x29b9ca+109377.94*_0x46ef17,_0x5de0c3=-51752.104+218913.95*_0x2ce853-309468.16*_0x29b9ca+146349.42*_0x46ef17,_0x3bc218=-40023.88+170470.89*_0x2ce853-242699.48*_0x29b9ca+115605.82*_0x46ef17),_0x377ac2=_0x5b29ab*_0x5b29ab,_0x408c4a=0.75*(0x1+0x2*_0x542b39+_0x4da6c5),_0x4ba840=1.5*_0x377ac2,_0x5726d2=1.875*_0x5b29ab*(0x1-0x2*_0x542b39-0x3*_0x4da6c5),_0x1d8814=-1.875*_0x5b29ab*(0x1+0x2*_0x542b39-0x3*_0x4da6c5),_0x26349d=0x23*_0x377ac2*_0x408c4a,_0x593c17=39.375*_0x377ac2*_0x377ac2,_0x3974b2=9.84375*_0x5b29ab*(_0x377ac2*(0x1-0x2*_0x542b39-0x5*_0x4da6c5)+0.33333333*(-0x2+0x4*_0x542b39+0x6*_0x4da6c5)),_0x3b02bd=_0x5b29ab*(4.92187512*_0x377ac2*(-0x2-0x4*_0x542b39+0xa*_0x4da6c5)+6.56250012*(0x1+0x2*_0x542b39-0x3*_0x4da6c5)),_0x44fa7a=29.53125*_0x5b29ab*(0x2-0x8*_0x542b39+_0x4da6c5*(-0xc+0x8*_0x542b39+0xa*_0x4da6c5)),_0x3c9141=29.53125*_0x5b29ab*(-0x2-0x8*_0x542b39+_0x4da6c5*(0xc+0x8*_0x542b39-0xa*_0x4da6c5)),_0x2153df=_0x4cd982*_0x4cd982,_0x9f8198=_0x1ca227*_0x1ca227,_0x1c2008=0x3*_0x2153df*_0x9f8198,_0x2a5c88=_0x1c2008*_0xc261e0,_0x4b2df6=_0x2a5c88*_0x408c4a*_0x52004a,_0x487ce7=_0x2a5c88*_0x4ba840*_0x5057ad,_0x1c2008*=_0x1ca227,_0x2a5c88=_0x1c2008*_0x559ea4,_0x4b6e5f=_0x2a5c88*_0x5726d2*_0x3ae4ac,_0x51a354=_0x2a5c88*_0x1d8814*_0x2b9c42,_0x1c2008*=_0x1ca227,_0x2a5c88=0x2*_0x1c2008*_0x1e9627,_0x3897b7=_0x2a5c88*_0x26349d*_0x1a44fb,_0x9dcce7=_0x2a5c88*_0x593c17*_0x353ef0,_0x1c2008*=_0x1ca227,_0x2a5c88=_0x1c2008*_0x5faeb,_0x536edd=_0x2a5c88*_0x3974b2*_0x3642f8,_0x11422b=_0x2a5c88*_0x3b02bd*_0x3bc218,_0x2a5c88=0x2*_0x1c2008*_0x3d8464,_0xf04ed0=_0x2a5c88*_0x44fa7a*_0x5de0c3,_0x4f3487=_0x2a5c88*_0x3c9141*_0x72d779,_0x22abe2=(_0x1dfb3f+_0xddee6c+_0xddee6c-(_0x5e958f+_0x5e958f))%twoPi$1,_0x1eca2c=_0x44d0b9+_0x2355e4+0x2*(_0x385c90+_0x4abeea-_0x4a0a54)-_0xfbdcc,_0x2ce853=_0xf44729,_0x29b9ca=_0x306ea1;}_0xb3886c===0x1&&(_0x56262e=0x1+_0x29b9ca*(-2.5+0.8125*_0x29b9ca),_0x3ae4ac=0x1+0x2*_0x29b9ca,_0x130856=0x1+_0x29b9ca*(-0x6+6.60937*_0x29b9ca),_0x408c4a=0.75*(0x1+_0x542b39)*(0x1+_0x542b39),_0x54b5bc=0.9375*_0x5b29ab*_0x5b29ab*(0x1+0x3*_0x542b39)-0.75*(0x1+_0x542b39),_0x1b5ad0=0x1+_0x542b39,_0x1b5ad0*=1.875*_0x1b5ad0*_0x1b5ad0,_0x22c15e=0x3*_0x4cd982*_0x4cd982*_0x1ca227*_0x1ca227,_0x188572=0x2*_0x22c15e*_0x408c4a*_0x56262e*_0x5493d4,_0x348ccf=0x3*_0x22c15e*_0x1b5ad0*_0x130856*_0x306ff1*_0x1ca227,_0x22c15e=_0x22c15e*_0x54b5bc*_0x3ae4ac*_0x49ee6e*_0x1ca227,_0x22abe2=(_0x1dfb3f+_0xddee6c+_0x4b7a66-_0x5e958f)%twoPi$1,_0x1eca2c=_0x44d0b9+_0x52f65f+_0x2355e4+_0x85b864+_0x4abeea-(_0xfbdcc+_0x4a0a54)),_0x3eb1d1=_0x22abe2,_0xa95cfb=_0xfbdcc,_0x25085f=0x0,_0x4cd982=_0xfbdcc+_0x214a4f;}return{'em':_0x2ce853,'argpm':_0x425295,'inclm':_0x15866d,'mm':_0x4fe1b7,'nm':_0x4cd982,'nodem':_0x1fb810,'irez':_0xb3886c,'atime':_0x25085f,'d2201':_0x4b2df6,'d2211':_0x487ce7,'d3210':_0x4b6e5f,'d3222':_0x51a354,'d4410':_0x3897b7,'d4422':_0x9dcce7,'d5220':_0x536edd,'d5232':_0x11422b,'d5421':_0xf04ed0,'d5433':_0x4f3487,'dedt':_0x291bf7,'didt':_0x499ae2,'dmdt':_0x2355e4,'dndt':_0x214a4f,'dnodt':_0x4abeea,'domdt':_0x85b864,'del1':_0x22c15e,'del2':_0x188572,'del3':_0x348ccf,'xfact':_0x1eca2c,'xlamo':_0x22abe2,'xli':_0x3eb1d1,'xni':_0xa95cfb};}function gstimeInternal$1(_0x47d2b8){var _0x336b47=(_0x47d2b8-0x256859)/0x8ead,_0x420103=-0.0000062*_0x336b47*_0x336b47*_0x336b47+0.093104*_0x336b47*_0x336b47+(0xd6038*0xe10+8640184.812866)*_0x336b47+67310.54841;return _0x420103=_0x420103*deg2rad$1/0xf0%twoPi$1,_0x420103<0x0&&(_0x420103+=twoPi$1),_0x420103;}function gstime$1(){var _0x3c932a=_0x15c6;if((arguments[_0x3c932a(0x152)]<=0x0?undefined:arguments[0x0])instanceof Date||arguments[_0x3c932a(0x152)]>0x1)return gstimeInternal$1(jday$1[_0x3c932a(0x26b)](void 0x0,arguments));return gstimeInternal$1['apply'](void 0x0,arguments);}function initl$1(_0x532d16){var _0x100708=_0x15c6,_0x6c8008=_0x532d16['ecco'],_0x3855b1=_0x532d16['epoch'],_0x2c971b=_0x532d16['inclo'],_0x3a8264=_0x532d16[_0x100708(0x375)],_0x5a6ee9=_0x532d16['no'],_0x11d484=_0x6c8008*_0x6c8008,_0x28b256=0x1-_0x11d484,_0x54b28b=Math['sqrt'](_0x28b256),_0x22bc0=Math['cos'](_0x2c971b),_0x480995=_0x22bc0*_0x22bc0,_0x403827=Math[_0x100708(0x22c)](xke$1/_0x5a6ee9,x2o3$1),_0x5dd20c=0.75*j2$1*(0x3*_0x480995-0x1)/(_0x54b28b*_0x28b256),_0x1e6962=_0x5dd20c/(_0x403827*_0x403827),_0x42494b=_0x403827*(0x1-_0x1e6962*_0x1e6962-_0x1e6962*(0x1/0x3+0x86*_0x1e6962*_0x1e6962/0x51));_0x1e6962=_0x5dd20c/(_0x42494b*_0x42494b),_0x5a6ee9/=0x1+_0x1e6962;var _0x48e307=Math[_0x100708(0x22c)](xke$1/_0x5a6ee9,x2o3$1),_0x1ece2c=Math['sin'](_0x2c971b),_0x2e727d=_0x48e307*_0x28b256,_0x2816c5=0x1-0x5*_0x480995,_0x76111f=-_0x2816c5-_0x480995-_0x480995,_0x152a22=0x1/_0x48e307,_0xc7dc61=_0x2e727d*_0x2e727d,_0x1aa65f=_0x48e307*(0x1-_0x6c8008),_0xee1466='n',_0x364e5f;if(_0x3a8264==='a'){var _0x188114=_0x3855b1-0x1c89,_0x3e424b=Math['floor'](_0x188114+1e-8),_0x7f5709=_0x188114-_0x3e424b,_0x259a20=0.017202791694070362,_0x54e8cd=1.7321343856509375,_0x117fa8=5.075514194322695e-15,_0x57ea65=_0x259a20+twoPi$1;_0x364e5f=(_0x54e8cd+_0x259a20*_0x3e424b+_0x57ea65*_0x7f5709+_0x188114*_0x188114*_0x117fa8)%twoPi$1,_0x364e5f<0x0&&(_0x364e5f+=twoPi$1);}else _0x364e5f=gstime$1(_0x3855b1+2433281.5);return{'no':_0x5a6ee9,'method':_0xee1466,'ainv':_0x152a22,'ao':_0x48e307,'con41':_0x76111f,'con42':_0x2816c5,'cosio':_0x22bc0,'cosio2':_0x480995,'eccsq':_0x11d484,'omeosq':_0x28b256,'posq':_0xc7dc61,'rp':_0x1aa65f,'rteosq':_0x54b28b,'sinio':_0x1ece2c,'gsto':_0x364e5f};}function dspace$1(_0x163abe){var _0x1e5568=_0x15c6,_0x3d4c05=_0x163abe['irez'],_0x9f221d=_0x163abe['d2201'],_0x3b4d13=_0x163abe['d2211'],_0x1a7324=_0x163abe[_0x1e5568(0x2ca)],_0x4d9691=_0x163abe['d3222'],_0x2e3369=_0x163abe['d4410'],_0xfc2877=_0x163abe[_0x1e5568(0x21a)],_0x4f8b90=_0x163abe[_0x1e5568(0x2ac)],_0x29892f=_0x163abe[_0x1e5568(0x31b)],_0x174129=_0x163abe['d5421'],_0x3f89f7=_0x163abe['d5433'],_0xf12e84=_0x163abe[_0x1e5568(0x2cc)],_0x54b7e9=_0x163abe['del1'],_0xf01c13=_0x163abe['del2'],_0x25c850=_0x163abe[_0x1e5568(0x1fb)],_0x5cc366=_0x163abe['didt'],_0x618df1=_0x163abe['dmdt'],_0x43a034=_0x163abe['dnodt'],_0x4c8783=_0x163abe['domdt'],_0x4a7b94=_0x163abe['argpo'],_0x119bd0=_0x163abe[_0x1e5568(0x237)],_0x58851e=_0x163abe['t'],_0x44fe88=_0x163abe['tc'],_0x5d4812=_0x163abe['gsto'],_0x5012ed=_0x163abe[_0x1e5568(0x22f)],_0x35a0e0=_0x163abe['xlamo'],_0x8b1888=_0x163abe['no'],_0x36a092=_0x163abe[_0x1e5568(0x2b4)],_0x1b2d95=_0x163abe['em'],_0x8d8334=_0x163abe['argpm'],_0x3f1d82=_0x163abe[_0x1e5568(0x312)],_0x317b13=_0x163abe['xli'],_0x47232a=_0x163abe['mm'],_0x31ca37=_0x163abe['xni'],_0x2c2a07=_0x163abe['nodem'],_0xe84c85=_0x163abe['nm'],_0x325e74=0.13130908,_0x1fa234=2.8843198,_0x40a45d=0.37448087,_0x135df1=5.7686396,_0x35464e=0.95240898,_0x3d061d=1.8014998,_0x4afff1=1.050833,_0x2d9307=4.4108898,_0x4d1888=0.0043752690880113,_0x3fbb8b=0x2d0,_0x351c38=-0x2d0,_0x3d1478=0x3f480,_0x50144c,_0x3d5390,_0x2bc978,_0x352434,_0x5c69cd,_0x85aa4a,_0x239edf,_0x13afe8,_0x4c9be8=0x0,_0x5a9892=0x0,_0x2ca51e=(_0x5d4812+_0x44fe88*_0x4d1888)%twoPi$1;_0x1b2d95+=_0xf12e84*_0x58851e,_0x3f1d82+=_0x5cc366*_0x58851e,_0x8d8334+=_0x4c8783*_0x58851e,_0x2c2a07+=_0x43a034*_0x58851e,_0x47232a+=_0x618df1*_0x58851e;if(_0x3d4c05!==0x0){(_0x36a092===0x0||_0x58851e*_0x36a092<=0x0||Math['abs'](_0x58851e)0x0?_0x50144c=_0x3fbb8b:_0x50144c=_0x351c38;var _0x50b045=0x17d;while(_0x50b045===0x17d){_0x3d4c05!==0x2?(_0x239edf=_0x54b7e9*Math['sin'](_0x317b13-_0x325e74)+_0xf01c13*Math['sin'](0x2*(_0x317b13-_0x1fa234))+_0x25c850*Math['sin'](0x3*(_0x317b13-_0x40a45d)),_0x5c69cd=_0x31ca37+_0x5012ed,_0x85aa4a=_0x54b7e9*Math[_0x1e5568(0x2dd)](_0x317b13-_0x325e74)+0x2*_0xf01c13*Math['cos'](0x2*(_0x317b13-_0x1fa234))+0x3*_0x25c850*Math[_0x1e5568(0x2dd)](0x3*(_0x317b13-_0x40a45d)),_0x85aa4a*=_0x5c69cd):(_0x13afe8=_0x4a7b94+_0x119bd0*_0x36a092,_0x2bc978=_0x13afe8+_0x13afe8,_0x3d5390=_0x317b13+_0x317b13,_0x239edf=_0x9f221d*Math['sin'](_0x2bc978+_0x317b13-_0x135df1)+_0x3b4d13*Math['sin'](_0x317b13-_0x135df1)+_0x1a7324*Math[_0x1e5568(0x226)](_0x13afe8+_0x317b13-_0x35464e)+_0x4d9691*Math['sin'](-_0x13afe8+_0x317b13-_0x35464e)+_0x2e3369*Math[_0x1e5568(0x226)](_0x2bc978+_0x3d5390-_0x3d061d)+_0xfc2877*Math['sin'](_0x3d5390-_0x3d061d)+_0x4f8b90*Math['sin'](_0x13afe8+_0x317b13-_0x4afff1)+_0x29892f*Math['sin'](-_0x13afe8+_0x317b13-_0x4afff1)+_0x174129*Math[_0x1e5568(0x226)](_0x13afe8+_0x3d5390-_0x2d9307)+_0x3f89f7*Math['sin'](-_0x13afe8+_0x3d5390-_0x2d9307),_0x5c69cd=_0x31ca37+_0x5012ed,_0x85aa4a=_0x9f221d*Math['cos'](_0x2bc978+_0x317b13-_0x135df1)+_0x3b4d13*Math['cos'](_0x317b13-_0x135df1)+_0x1a7324*Math[_0x1e5568(0x2dd)](_0x13afe8+_0x317b13-_0x35464e)+_0x4d9691*Math[_0x1e5568(0x2dd)](-_0x13afe8+_0x317b13-_0x35464e)+_0x4f8b90*Math['cos'](_0x13afe8+_0x317b13-_0x4afff1)+_0x29892f*Math['cos'](-_0x13afe8+_0x317b13-_0x4afff1)+0x2*(_0x2e3369*Math['cos'](_0x2bc978+_0x3d5390-_0x3d061d)+_0xfc2877*Math[_0x1e5568(0x2dd)](_0x3d5390-_0x3d061d)+_0x174129*Math['cos'](_0x13afe8+_0x3d5390-_0x2d9307)+_0x3f89f7*Math['cos'](-_0x13afe8+_0x3d5390-_0x2d9307)),_0x85aa4a*=_0x5c69cd),Math['abs'](_0x58851e-_0x36a092)>=_0x3fbb8b?_0x50b045=0x17d:(_0x5a9892=_0x58851e-_0x36a092,_0x50b045=0x0),_0x50b045===0x17d&&(_0x317b13+=_0x5c69cd*_0x50144c+_0x239edf*_0x3d1478,_0x31ca37+=_0x239edf*_0x50144c+_0x85aa4a*_0x3d1478,_0x36a092+=_0x50144c);}_0xe84c85=_0x31ca37+_0x239edf*_0x5a9892+_0x85aa4a*_0x5a9892*_0x5a9892*0.5,_0x352434=_0x317b13+_0x5c69cd*_0x5a9892+_0x239edf*_0x5a9892*_0x5a9892*0.5,_0x3d4c05!==0x1?(_0x47232a=_0x352434-0x2*_0x2c2a07+0x2*_0x2ca51e,_0x4c9be8=_0xe84c85-_0x8b1888):(_0x47232a=_0x352434-_0x2c2a07-_0x8d8334+_0x2ca51e,_0x4c9be8=_0xe84c85-_0x8b1888),_0xe84c85=_0x8b1888+_0x4c9be8;}return{'atime':_0x36a092,'em':_0x1b2d95,'argpm':_0x8d8334,'inclm':_0x3f1d82,'xli':_0x317b13,'mm':_0x47232a,'xni':_0x31ca37,'nodem':_0x2c2a07,'dndt':_0x4c9be8,'nm':_0xe84c85};}function sgp4$1(_0x30a156,_0x4c4734){var _0x284dde=_0x15c6,_0x51872e,_0x532f3c,_0x1247b3,_0x3d993e,_0x2206d8,_0x4feca7,_0x1930f1,_0x2f9df7,_0x130821,_0x14b33d,_0x211534,_0x6429fa,_0x298cb5,_0x15bf0e,_0x1a7aba,_0x218f38,_0x314d21,_0x1e88d2,_0x40bf1f,_0xaf26bd,_0x455f42,_0x8864e0,_0x2598dc,_0x431ab6,_0x4def3a,_0x4af5b5,_0x7c935e,_0x388d1d=1.5e-12;_0x30a156['t']=_0x4c4734,_0x30a156['error']=0x0;var _0x21980f=_0x30a156['mo']+_0x30a156['mdot']*_0x30a156['t'],_0x4cd206=_0x30a156[_0x284dde(0x26e)]+_0x30a156[_0x284dde(0x237)]*_0x30a156['t'],_0x3215fd=_0x30a156[_0x284dde(0x322)]+_0x30a156['nodedot']*_0x30a156['t'];_0x130821=_0x4cd206,_0x455f42=_0x21980f;var _0x35be3a=_0x30a156['t']*_0x30a156['t'];_0x2598dc=_0x3215fd+_0x30a156['nodecf']*_0x35be3a,_0x314d21=0x1-_0x30a156[_0x284dde(0x37b)]*_0x30a156['t'],_0x1e88d2=_0x30a156['bstar']*_0x30a156[_0x284dde(0x187)]*_0x30a156['t'],_0x40bf1f=_0x30a156['t2cof']*_0x35be3a;if(_0x30a156['isimp']!==0x1){_0x1930f1=_0x30a156['omgcof']*_0x30a156['t'];var _0x5d0411=0x1+_0x30a156[_0x284dde(0x20d)]*Math['cos'](_0x21980f);_0x4feca7=_0x30a156['xmcof']*(_0x5d0411*_0x5d0411*_0x5d0411-_0x30a156[_0x284dde(0x371)]),_0x218f38=_0x1930f1+_0x4feca7,_0x455f42=_0x21980f+_0x218f38,_0x130821=_0x4cd206-_0x218f38,_0x6429fa=_0x35be3a*_0x30a156['t'],_0x298cb5=_0x6429fa*_0x30a156['t'],_0x314d21=_0x314d21-_0x30a156['d2']*_0x35be3a-_0x30a156['d3']*_0x6429fa-_0x30a156['d4']*_0x298cb5,_0x1e88d2+=_0x30a156[_0x284dde(0x1a7)]*_0x30a156[_0x284dde(0x20c)]*(Math['sin'](_0x455f42)-_0x30a156[_0x284dde(0x362)]),_0x40bf1f=_0x40bf1f+_0x30a156['t3cof']*_0x6429fa+_0x298cb5*(_0x30a156[_0x284dde(0x211)]+_0x30a156['t']*_0x30a156['t5cof']);}_0x8864e0=_0x30a156['no'];var _0x4c0b9c=_0x30a156['ecco'];_0xaf26bd=_0x30a156['inclo'];if(_0x30a156['method']==='d'){_0x15bf0e=_0x30a156['t'];var _0x2ab6c0={'irez':_0x30a156[_0x284dde(0x1aa)],'d2201':_0x30a156['d2201'],'d2211':_0x30a156['d2211'],'d3210':_0x30a156['d3210'],'d3222':_0x30a156['d3222'],'d4410':_0x30a156['d4410'],'d4422':_0x30a156['d4422'],'d5220':_0x30a156['d5220'],'d5232':_0x30a156[_0x284dde(0x31b)],'d5421':_0x30a156['d5421'],'d5433':_0x30a156['d5433'],'dedt':_0x30a156['dedt'],'del1':_0x30a156['del1'],'del2':_0x30a156[_0x284dde(0x2f2)],'del3':_0x30a156['del3'],'didt':_0x30a156['didt'],'dmdt':_0x30a156['dmdt'],'dnodt':_0x30a156[_0x284dde(0x166)],'domdt':_0x30a156['domdt'],'argpo':_0x30a156[_0x284dde(0x26e)],'argpdot':_0x30a156['argpdot'],'t':_0x30a156['t'],'tc':_0x15bf0e,'gsto':_0x30a156['gsto'],'xfact':_0x30a156[_0x284dde(0x22f)],'xlamo':_0x30a156['xlamo'],'no':_0x30a156['no'],'atime':_0x30a156['atime'],'em':_0x4c0b9c,'argpm':_0x130821,'inclm':_0xaf26bd,'xli':_0x30a156['xli'],'mm':_0x455f42,'xni':_0x30a156['xni'],'nodem':_0x2598dc,'nm':_0x8864e0},_0x16f510=dspace$1(_0x2ab6c0);_0x4c0b9c=_0x16f510['em'],_0x130821=_0x16f510['argpm'],_0xaf26bd=_0x16f510['inclm'],_0x455f42=_0x16f510['mm'],_0x2598dc=_0x16f510['nodem'],_0x8864e0=_0x16f510['nm'];}if(_0x8864e0<=0x0)return _0x30a156['error']=0x2,[![],![]];var _0xaa05f3=Math[_0x284dde(0x22c)](xke$1/_0x8864e0,x2o3$1)*_0x314d21*_0x314d21;_0x8864e0=xke$1/Math['pow'](_0xaa05f3,1.5),_0x4c0b9c-=_0x1e88d2;if(_0x4c0b9c>=0x1||_0x4c0b9c<-0.001)return _0x30a156['error']=0x1,[![],![]];_0x4c0b9c<0.000001&&(_0x4c0b9c=0.000001);_0x455f42+=_0x30a156['no']*_0x40bf1f,_0x4def3a=_0x455f42+_0x130821+_0x2598dc,_0x2598dc%=twoPi$1,_0x130821%=twoPi$1,_0x4def3a%=twoPi$1,_0x455f42=(_0x4def3a-_0x130821-_0x2598dc)%twoPi$1;var _0x10e99e=Math['sin'](_0xaf26bd),_0x5d94e2=Math['cos'](_0xaf26bd),_0x29301a=_0x4c0b9c;_0x431ab6=_0xaf26bd,_0x14b33d=_0x130821,_0x7c935e=_0x2598dc,_0x4af5b5=_0x455f42,_0x3d993e=_0x10e99e,_0x1247b3=_0x5d94e2;if(_0x30a156[_0x284dde(0x1fd)]==='d'){var _0x336be1={'inclo':_0x30a156['inclo'],'init':'n','ep':_0x29301a,'inclp':_0x431ab6,'nodep':_0x7c935e,'argpp':_0x14b33d,'mp':_0x4af5b5,'opsmode':_0x30a156['operationmode']},_0x1f94e9=dpper$1(_0x30a156,_0x336be1);_0x29301a=_0x1f94e9['ep'],_0x7c935e=_0x1f94e9['nodep'],_0x14b33d=_0x1f94e9['argpp'],_0x4af5b5=_0x1f94e9['mp'],_0x431ab6=_0x1f94e9[_0x284dde(0x349)];_0x431ab6<0x0&&(_0x431ab6=-_0x431ab6,_0x7c935e+=pi$1,_0x14b33d-=pi$1);if(_0x29301a<0x0||_0x29301a>0x1)return _0x30a156['error']=0x3,[![],![]];}_0x30a156['method']==='d'&&(_0x3d993e=Math['sin'](_0x431ab6),_0x1247b3=Math[_0x284dde(0x2dd)](_0x431ab6),_0x30a156[_0x284dde(0x1df)]=-0.5*j3oj2$1*_0x3d993e,Math[_0x284dde(0x2d9)](_0x1247b3+0x1)>1.5e-12?_0x30a156['xlcof']=-0.25*j3oj2$1*_0x3d993e*(0x3+0x5*_0x1247b3)/(0x1+_0x1247b3):_0x30a156[_0x284dde(0x153)]=-0.25*j3oj2$1*_0x3d993e*(0x3+0x5*_0x1247b3)/_0x388d1d);var _0xef689c=_0x29301a*Math['cos'](_0x14b33d);_0x218f38=0x1/(_0xaa05f3*(0x1-_0x29301a*_0x29301a));var _0x161040=_0x29301a*Math['sin'](_0x14b33d)+_0x218f38*_0x30a156[_0x284dde(0x1df)],_0x9112ca=_0x4af5b5+_0x14b33d+_0x7c935e+_0x218f38*_0x30a156['xlcof']*_0xef689c,_0x2e0bc4=(_0x9112ca-_0x7c935e)%twoPi$1;_0x2f9df7=_0x2e0bc4,_0x1a7aba=9999.9;var _0x2c92e3=0x1;while(Math[_0x284dde(0x2d9)](_0x1a7aba)>=1e-12&&_0x2c92e3<=0xa){_0x532f3c=Math[_0x284dde(0x226)](_0x2f9df7),_0x51872e=Math['cos'](_0x2f9df7),_0x1a7aba=0x1-_0x51872e*_0xef689c-_0x532f3c*_0x161040,_0x1a7aba=(_0x2e0bc4-_0x161040*_0x51872e+_0xef689c*_0x532f3c-_0x2f9df7)/_0x1a7aba,Math['abs'](_0x1a7aba)>=0.95&&(_0x1a7aba>0x0?_0x1a7aba=0.95:_0x1a7aba=-0.95),_0x2f9df7+=_0x1a7aba,_0x2c92e3+=0x1;}var _0x4a09a1=_0xef689c*_0x51872e+_0x161040*_0x532f3c,_0x198774=_0xef689c*_0x532f3c-_0x161040*_0x51872e,_0x226fab=_0xef689c*_0xef689c+_0x161040*_0x161040,_0x82e151=_0xaa05f3*(0x1-_0x226fab);if(_0x82e151<0x0)return _0x30a156['error']=0x4,[![],![]];var _0x16a953=_0xaa05f3*(0x1-_0x4a09a1),_0x4894a7=Math['sqrt'](_0xaa05f3)*_0x198774/_0x16a953,_0x47e6a9=Math['sqrt'](_0x82e151)/_0x16a953,_0x208bb2=Math['sqrt'](0x1-_0x226fab);_0x218f38=_0x198774/(0x1+_0x208bb2);var _0x5a090f=_0xaa05f3/_0x16a953*(_0x532f3c-_0x161040-_0xef689c*_0x218f38),_0x1dba32=_0xaa05f3/_0x16a953*(_0x51872e-_0xef689c+_0x161040*_0x218f38);_0x211534=Math['atan2'](_0x5a090f,_0x1dba32);var _0x893d0d=(_0x1dba32+_0x1dba32)*_0x5a090f,_0x1f9387=0x1-0x2*_0x5a090f*_0x5a090f;_0x218f38=0x1/_0x82e151;var _0x518e88=0.5*j2$1*_0x218f38,_0x54b058=_0x518e88*_0x218f38;_0x30a156['method']==='d'&&(_0x2206d8=_0x1247b3*_0x1247b3,_0x30a156['con41']=0x3*_0x2206d8-0x1,_0x30a156['x1mth2']=0x1-_0x2206d8,_0x30a156['x7thm1']=0x7*_0x2206d8-0x1);var _0x4c7f47=_0x16a953*(0x1-1.5*_0x54b058*_0x208bb2*_0x30a156[_0x284dde(0x182)])+0.5*_0x518e88*_0x30a156['x1mth2']*_0x1f9387;if(_0x4c7f47<0x1)return _0x30a156['error']=0x6,{'position':![],'velocity':![]};_0x211534-=0.25*_0x54b058*_0x30a156['x7thm1']*_0x893d0d;var _0x69e63d=_0x7c935e+1.5*_0x54b058*_0x1247b3*_0x893d0d,_0x41265d=_0x431ab6+1.5*_0x54b058*_0x1247b3*_0x3d993e*_0x1f9387,_0x2039c2=_0x4894a7-_0x8864e0*_0x518e88*_0x30a156['x1mth2']*_0x893d0d/xke$1,_0x572447=_0x47e6a9+_0x8864e0*_0x518e88*(_0x30a156['x1mth2']*_0x1f9387+1.5*_0x30a156['con41'])/xke$1,_0x1fdf84=Math['sin'](_0x211534),_0x2e890d=Math['cos'](_0x211534),_0x3daf69=Math['sin'](_0x69e63d),_0x4028a4=Math['cos'](_0x69e63d),_0x540649=Math['sin'](_0x41265d),_0x546b51=Math['cos'](_0x41265d),_0x3a9ee6=-_0x3daf69*_0x546b51,_0x2752f7=_0x4028a4*_0x546b51,_0x42b69c=_0x3a9ee6*_0x1fdf84+_0x4028a4*_0x2e890d,_0x11c4d8=_0x2752f7*_0x1fdf84+_0x3daf69*_0x2e890d,_0x4cdcb9=_0x540649*_0x1fdf84,_0x5cf7e5=_0x3a9ee6*_0x2e890d-_0x4028a4*_0x1fdf84,_0x5905b7=_0x2752f7*_0x2e890d-_0x3daf69*_0x1fdf84,_0x39d432=_0x540649*_0x2e890d,_0x5163d3={'x':_0x4c7f47*_0x42b69c*earthRadius$1,'y':_0x4c7f47*_0x11c4d8*earthRadius$1,'z':_0x4c7f47*_0x4cdcb9*earthRadius$1},_0x2dfb3e={'x':(_0x2039c2*_0x42b69c+_0x572447*_0x5cf7e5)*vkmpersec$1,'y':(_0x2039c2*_0x11c4d8+_0x572447*_0x5905b7)*vkmpersec$1,'z':(_0x2039c2*_0x4cdcb9+_0x572447*_0x39d432)*vkmpersec$1};return{'position':_0x5163d3,'velocity':_0x2dfb3e};}function sgp4init$1(_0x75e276,_0x5f49db){var _0x1df1c2=_0x15c6,_0x4a7a94=_0x5f49db['opsmode'],_0x40856d=_0x5f49db[_0x1df1c2(0x1f4)],_0x112cf8=_0x5f49db['epoch'],_0x265e6f=_0x5f49db['xbstar'],_0xd4465f=_0x5f49db['xecco'],_0x4bb612=_0x5f49db[_0x1df1c2(0x342)],_0x246a36=_0x5f49db['xinclo'],_0x22b4fa=_0x5f49db['xmo'],_0x1be177=_0x5f49db[_0x1df1c2(0x216)],_0x1e6eb0=_0x5f49db['xnodeo'],_0x116424,_0x4a182b,_0x46509e,_0x1a1d4,_0x2040ce,_0x1f2df8,_0x10ebf0,_0x526ad9,_0x42eb00,_0x2ae70f,_0x4e0ed0,_0x364ec6,_0x2515b1,_0x3cce62,_0x365137,_0x5629ac,_0x4dc5a2,_0xcc1b0f,_0x37ffc3,_0x3e8f5c,_0x3f6d6c,_0x131525,_0x2cba33,_0x590dd5,_0x346c27,_0x1b629d,_0x4f378c,_0x57c607,_0x3c5957,_0x4609a,_0x4fd172,_0x11fe5e,_0x17ef70,_0x2eeee8,_0x4ccbfd,_0x4084ca,_0x541a44,_0x1c88ab,_0x57b3b6,_0x387d78,_0x1860b4,_0x3fac2e,_0x3d2521,_0x26efdb,_0x2d8705,_0x90c927,_0x300472,_0x26d17a,_0x33d38f,_0x37017c,_0x2382aa,_0x46c9db,_0x422781,_0x3d6898,_0x23a254,_0x32f6fd,_0x28b3b8=1.5e-12;_0x75e276['isimp']=0x0,_0x75e276[_0x1df1c2(0x1fd)]='n',_0x75e276[_0x1df1c2(0x1df)]=0x0,_0x75e276[_0x1df1c2(0x182)]=0x0,_0x75e276[_0x1df1c2(0x37b)]=0x0,_0x75e276['cc4']=0x0,_0x75e276[_0x1df1c2(0x20c)]=0x0,_0x75e276['d2']=0x0,_0x75e276['d3']=0x0,_0x75e276['d4']=0x0,_0x75e276['delmo']=0x0,_0x75e276['eta']=0x0,_0x75e276[_0x1df1c2(0x237)]=0x0,_0x75e276['omgcof']=0x0,_0x75e276['sinmao']=0x0,_0x75e276['t']=0x0,_0x75e276['t2cof']=0x0,_0x75e276[_0x1df1c2(0x17c)]=0x0,_0x75e276[_0x1df1c2(0x211)]=0x0,_0x75e276['t5cof']=0x0,_0x75e276['x1mth2']=0x0,_0x75e276[_0x1df1c2(0x2c0)]=0x0,_0x75e276['mdot']=0x0,_0x75e276['nodedot']=0x0,_0x75e276['xlcof']=0x0,_0x75e276['xmcof']=0x0,_0x75e276[_0x1df1c2(0x374)]=0x0,_0x75e276['irez']=0x0,_0x75e276['d2201']=0x0,_0x75e276[_0x1df1c2(0x323)]=0x0,_0x75e276[_0x1df1c2(0x2ca)]=0x0,_0x75e276['d3222']=0x0,_0x75e276['d4410']=0x0,_0x75e276[_0x1df1c2(0x21a)]=0x0,_0x75e276[_0x1df1c2(0x2ac)]=0x0,_0x75e276[_0x1df1c2(0x31b)]=0x0,_0x75e276['d5421']=0x0,_0x75e276['d5433']=0x0,_0x75e276['dedt']=0x0,_0x75e276['del1']=0x0,_0x75e276['del2']=0x0,_0x75e276['del3']=0x0,_0x75e276[_0x1df1c2(0x16e)]=0x0,_0x75e276['dmdt']=0x0,_0x75e276['dnodt']=0x0,_0x75e276[_0x1df1c2(0x269)]=0x0,_0x75e276['e3']=0x0,_0x75e276['ee2']=0x0,_0x75e276[_0x1df1c2(0x164)]=0x0,_0x75e276['pgho']=0x0,_0x75e276[_0x1df1c2(0x2c4)]=0x0,_0x75e276[_0x1df1c2(0x33e)]=0x0,_0x75e276['plo']=0x0,_0x75e276[_0x1df1c2(0x196)]=0x0,_0x75e276[_0x1df1c2(0x2ff)]=0x0,_0x75e276['sgh2']=0x0,_0x75e276['sgh3']=0x0,_0x75e276['sgh4']=0x0,_0x75e276['sh2']=0x0,_0x75e276['sh3']=0x0,_0x75e276[_0x1df1c2(0x350)]=0x0,_0x75e276[_0x1df1c2(0x22d)]=0x0,_0x75e276['sl2']=0x0,_0x75e276[_0x1df1c2(0x201)]=0x0,_0x75e276['sl4']=0x0,_0x75e276['gsto']=0x0,_0x75e276['xfact']=0x0,_0x75e276['xgh2']=0x0,_0x75e276['xgh3']=0x0,_0x75e276[_0x1df1c2(0x186)]=0x0,_0x75e276['xh2']=0x0,_0x75e276['xh3']=0x0,_0x75e276['xi2']=0x0,_0x75e276['xi3']=0x0,_0x75e276['xl2']=0x0,_0x75e276['xl3']=0x0,_0x75e276['xl4']=0x0,_0x75e276['xlamo']=0x0,_0x75e276['zmol']=0x0,_0x75e276['zmos']=0x0,_0x75e276['atime']=0x0,_0x75e276[_0x1df1c2(0x2c6)]=0x0,_0x75e276['xni']=0x0,_0x75e276['bstar']=_0x265e6f,_0x75e276[_0x1df1c2(0x271)]=_0xd4465f,_0x75e276['argpo']=_0x4bb612,_0x75e276['inclo']=_0x246a36,_0x75e276['mo']=_0x22b4fa,_0x75e276['no']=_0x1be177,_0x75e276[_0x1df1c2(0x322)]=_0x1e6eb0,_0x75e276['operationmode']=_0x4a7a94;var _0x547067=0x4e/earthRadius$1+0x1,_0x463d7c=(0x78-0x4e)/earthRadius$1,_0x197487=_0x463d7c*_0x463d7c*_0x463d7c*_0x463d7c;_0x75e276['init']='y',_0x75e276['t']=0x0;var _0x3c32ac={'satn':_0x40856d,'ecco':_0x75e276[_0x1df1c2(0x271)],'epoch':_0x112cf8,'inclo':_0x75e276['inclo'],'no':_0x75e276['no'],'method':_0x75e276['method'],'opsmode':_0x75e276['operationmode']},_0x5e83c4=initl$1(_0x3c32ac),_0x4ce8ff=_0x5e83c4['ao'],_0x51dfd2=_0x5e83c4['con42'],_0x29faba=_0x5e83c4['cosio'],_0x40542f=_0x5e83c4['cosio2'],_0x1d53de=_0x5e83c4[_0x1df1c2(0x1e6)],_0x549db3=_0x5e83c4['omeosq'],_0x762d62=_0x5e83c4[_0x1df1c2(0x291)],_0x56240d=_0x5e83c4['rp'],_0x5977e1=_0x5e83c4['rteosq'],_0x2e3231=_0x5e83c4['sinio'];_0x75e276['no']=_0x5e83c4['no'],_0x75e276[_0x1df1c2(0x182)]=_0x5e83c4[_0x1df1c2(0x182)],_0x75e276['gsto']=_0x5e83c4[_0x1df1c2(0x1c2)],_0x75e276['a']=Math['pow'](_0x75e276['no']*tumin$1,-0x2/0x3),_0x75e276['alta']=_0x75e276['a']*(0x1+_0x75e276['ecco'])-0x1,_0x75e276['altp']=_0x75e276['a']*(0x1-_0x75e276[_0x1df1c2(0x271)])-0x1,_0x75e276['error']=0x0;if(_0x549db3>=0x0||_0x75e276['no']>=0x0){_0x75e276[_0x1df1c2(0x35f)]=0x0;_0x56240d<0xdc/earthRadius$1+0x1&&(_0x75e276['isimp']=0x1);_0x4f378c=_0x547067,_0x3f6d6c=_0x197487,_0xcc1b0f=(_0x56240d-0x1)*earthRadius$1;if(_0xcc1b0f<0x9c){_0x4f378c=_0xcc1b0f-0x4e;_0xcc1b0f<0x62&&(_0x4f378c=0x14);var _0x52f00a=(0x78-_0x4f378c)/earthRadius$1;_0x3f6d6c=_0x52f00a*_0x52f00a*_0x52f00a*_0x52f00a,_0x4f378c=_0x4f378c/earthRadius$1+0x1;}_0x37ffc3=0x1/_0x762d62,_0x90c927=0x1/(_0x4ce8ff-_0x4f378c),_0x75e276['eta']=_0x4ce8ff*_0x75e276['ecco']*_0x90c927,_0x364ec6=_0x75e276[_0x1df1c2(0x20d)]*_0x75e276['eta'],_0x4e0ed0=_0x75e276['ecco']*_0x75e276['eta'],_0x3e8f5c=Math['abs'](0x1-_0x364ec6),_0x1f2df8=_0x3f6d6c*Math['pow'](_0x90c927,0x4),_0x10ebf0=_0x1f2df8/Math['pow'](_0x3e8f5c,3.5),_0x1a1d4=_0x10ebf0*_0x75e276['no']*(_0x4ce8ff*(0x1+1.5*_0x364ec6+_0x4e0ed0*(0x4+_0x364ec6))+0.375*j2$1*_0x90c927/_0x3e8f5c*_0x75e276['con41']*(0x8+0x3*_0x364ec6*(0x8+_0x364ec6))),_0x75e276['cc1']=_0x75e276['bstar']*_0x1a1d4,_0x2040ce=0x0;_0x75e276[_0x1df1c2(0x271)]>0.0001&&(_0x2040ce=-0x2*_0x1f2df8*_0x90c927*j3oj2$1*_0x75e276['no']*_0x2e3231/_0x75e276['ecco']);_0x75e276[_0x1df1c2(0x357)]=0x1-_0x40542f,_0x75e276['cc4']=0x2*_0x75e276['no']*_0x10ebf0*_0x4ce8ff*_0x549db3*(_0x75e276[_0x1df1c2(0x20d)]*(0x2+0.5*_0x364ec6)+_0x75e276['ecco']*(0.5+0x2*_0x364ec6)-j2$1*_0x90c927/(_0x4ce8ff*_0x3e8f5c)*(-0x3*_0x75e276['con41']*(0x1-0x2*_0x4e0ed0+_0x364ec6*(1.5-0.5*_0x4e0ed0))+0.75*_0x75e276[_0x1df1c2(0x357)]*(0x2*_0x364ec6-_0x4e0ed0*(0x1+_0x364ec6))*Math['cos'](0x2*_0x75e276[_0x1df1c2(0x26e)]))),_0x75e276['cc5']=0x2*_0x10ebf0*_0x4ce8ff*_0x549db3*(0x1+2.75*(_0x364ec6+_0x4e0ed0)+_0x4e0ed0*_0x364ec6),_0x526ad9=_0x40542f*_0x40542f,_0x3d2521=1.5*j2$1*_0x37ffc3*_0x75e276['no'],_0x26efdb=0.5*_0x3d2521*j2$1*_0x37ffc3,_0x2d8705=-0.46875*j4$1*_0x37ffc3*_0x37ffc3*_0x75e276['no'],_0x75e276['mdot']=_0x75e276['no']+0.5*_0x3d2521*_0x5977e1*_0x75e276['con41']+0.0625*_0x26efdb*_0x5977e1*(0xd-0x4e*_0x40542f+0x89*_0x526ad9),_0x75e276['argpdot']=-0.5*_0x3d2521*_0x51dfd2+0.0625*_0x26efdb*(0x7-0x72*_0x40542f+0x18b*_0x526ad9)+_0x2d8705*(0x3-0x24*_0x40542f+0x31*_0x526ad9),_0x26d17a=-_0x3d2521*_0x29faba,_0x75e276['nodedot']=_0x26d17a+(0.5*_0x26efdb*(0x4-0x13*_0x40542f)+0x2*_0x2d8705*(0x3-0x7*_0x40542f))*_0x29faba,_0x300472=_0x75e276['argpdot']+_0x75e276['nodedot'],_0x75e276['omgcof']=_0x75e276['bstar']*_0x2040ce*Math[_0x1df1c2(0x2dd)](_0x75e276['argpo']),_0x75e276[_0x1df1c2(0x223)]=0x0;_0x75e276[_0x1df1c2(0x271)]>0.0001&&(_0x75e276['xmcof']=-x2o3$1*_0x1f2df8*_0x75e276[_0x1df1c2(0x1a7)]/_0x4e0ed0);_0x75e276['nodecf']=3.5*_0x549db3*_0x26d17a*_0x75e276['cc1'],_0x75e276['t2cof']=1.5*_0x75e276['cc1'];Math[_0x1df1c2(0x2d9)](_0x29faba+0x1)>1.5e-12?_0x75e276[_0x1df1c2(0x153)]=-0.25*j3oj2$1*_0x2e3231*(0x3+0x5*_0x29faba)/(0x1+_0x29faba):_0x75e276['xlcof']=-0.25*j3oj2$1*_0x2e3231*(0x3+0x5*_0x29faba)/_0x28b3b8;_0x75e276['aycof']=-0.5*j3oj2$1*_0x2e3231;var _0x14db06=0x1+_0x75e276['eta']*Math['cos'](_0x75e276['mo']);_0x75e276['delmo']=_0x14db06*_0x14db06*_0x14db06,_0x75e276['sinmao']=Math['sin'](_0x75e276['mo']),_0x75e276['x7thm1']=0x7*_0x40542f-0x1;if(0x2*pi$1/_0x75e276['no']>=0xe1){_0x75e276['method']='d',_0x75e276[_0x1df1c2(0x35f)]=0x1,_0x1860b4=0x0,_0x365137=_0x75e276['inclo'];var _0x20a633={'epoch':_0x112cf8,'ep':_0x75e276[_0x1df1c2(0x271)],'argpp':_0x75e276['argpo'],'tc':_0x1860b4,'inclp':_0x75e276['inclo'],'nodep':_0x75e276['nodeo'],'np':_0x75e276['no'],'e3':_0x75e276['e3'],'ee2':_0x75e276['ee2'],'peo':_0x75e276['peo'],'pgho':_0x75e276['pgho'],'pho':_0x75e276['pho'],'pinco':_0x75e276['pinco'],'plo':_0x75e276['plo'],'se2':_0x75e276['se2'],'se3':_0x75e276[_0x1df1c2(0x2ff)],'sgh2':_0x75e276['sgh2'],'sgh3':_0x75e276['sgh3'],'sgh4':_0x75e276[_0x1df1c2(0x1ca)],'sh2':_0x75e276['sh2'],'sh3':_0x75e276['sh3'],'si2':_0x75e276['si2'],'si3':_0x75e276['si3'],'sl2':_0x75e276[_0x1df1c2(0x2e2)],'sl3':_0x75e276[_0x1df1c2(0x201)],'sl4':_0x75e276['sl4'],'xgh2':_0x75e276['xgh2'],'xgh3':_0x75e276['xgh3'],'xgh4':_0x75e276['xgh4'],'xh2':_0x75e276['xh2'],'xh3':_0x75e276['xh3'],'xi2':_0x75e276['xi2'],'xi3':_0x75e276[_0x1df1c2(0x172)],'xl2':_0x75e276['xl2'],'xl3':_0x75e276['xl3'],'xl4':_0x75e276['xl4'],'zmol':_0x75e276[_0x1df1c2(0x37e)],'zmos':_0x75e276['zmos']},_0x57e338=dscom$1(_0x20a633);_0x75e276['e3']=_0x57e338['e3'],_0x75e276['ee2']=_0x57e338['ee2'],_0x75e276[_0x1df1c2(0x164)]=_0x57e338['peo'],_0x75e276[_0x1df1c2(0x16b)]=_0x57e338['pgho'],_0x75e276['pho']=_0x57e338[_0x1df1c2(0x2c4)],_0x75e276['pinco']=_0x57e338['pinco'],_0x75e276['plo']=_0x57e338[_0x1df1c2(0x165)],_0x75e276['se2']=_0x57e338[_0x1df1c2(0x196)],_0x75e276[_0x1df1c2(0x2ff)]=_0x57e338[_0x1df1c2(0x2ff)],_0x75e276[_0x1df1c2(0x2e4)]=_0x57e338[_0x1df1c2(0x2e4)],_0x75e276['sgh3']=_0x57e338[_0x1df1c2(0x1a6)],_0x75e276['sgh4']=_0x57e338['sgh4'],_0x75e276['sh2']=_0x57e338['sh2'],_0x75e276['sh3']=_0x57e338['sh3'],_0x75e276[_0x1df1c2(0x350)]=_0x57e338['si2'],_0x75e276['si3']=_0x57e338[_0x1df1c2(0x22d)],_0x75e276[_0x1df1c2(0x2e2)]=_0x57e338['sl2'],_0x75e276[_0x1df1c2(0x201)]=_0x57e338[_0x1df1c2(0x201)],_0x75e276['sl4']=_0x57e338['sl4'],_0x4a182b=_0x57e338['sinim'],_0x116424=_0x57e338['cosim'],_0x42eb00=_0x57e338['em'],_0x2ae70f=_0x57e338['emsq'],_0x131525=_0x57e338['s1'],_0x2cba33=_0x57e338['s2'],_0x590dd5=_0x57e338['s3'],_0x346c27=_0x57e338['s4'],_0x1b629d=_0x57e338['s5'],_0x57c607=_0x57e338[_0x1df1c2(0x2f5)],_0x3c5957=_0x57e338[_0x1df1c2(0x297)],_0x4609a=_0x57e338[_0x1df1c2(0x194)],_0x4fd172=_0x57e338[_0x1df1c2(0x242)],_0x11fe5e=_0x57e338['ss5'],_0x17ef70=_0x57e338['sz1'],_0x2eeee8=_0x57e338['sz3'],_0x4ccbfd=_0x57e338['sz11'],_0x4084ca=_0x57e338['sz13'],_0x541a44=_0x57e338['sz21'],_0x1c88ab=_0x57e338['sz23'],_0x57b3b6=_0x57e338['sz31'],_0x387d78=_0x57e338['sz33'],_0x75e276['xgh2']=_0x57e338[_0x1df1c2(0x150)],_0x75e276['xgh3']=_0x57e338[_0x1df1c2(0x1c4)],_0x75e276['xgh4']=_0x57e338['xgh4'],_0x75e276[_0x1df1c2(0x34a)]=_0x57e338[_0x1df1c2(0x34a)],_0x75e276['xh3']=_0x57e338['xh3'],_0x75e276['xi2']=_0x57e338['xi2'],_0x75e276['xi3']=_0x57e338['xi3'],_0x75e276['xl2']=_0x57e338['xl2'],_0x75e276['xl3']=_0x57e338['xl3'],_0x75e276['xl4']=_0x57e338['xl4'],_0x75e276['zmol']=_0x57e338['zmol'],_0x75e276['zmos']=_0x57e338['zmos'],_0x4dc5a2=_0x57e338['nm'],_0x33d38f=_0x57e338['z1'],_0x37017c=_0x57e338['z3'],_0x2382aa=_0x57e338['z11'],_0x46c9db=_0x57e338[_0x1df1c2(0x377)],_0x422781=_0x57e338['z21'],_0x3d6898=_0x57e338['z23'],_0x23a254=_0x57e338['z31'],_0x32f6fd=_0x57e338['z33'];var _0x1f5839={'inclo':_0x365137,'init':_0x75e276['init'],'ep':_0x75e276['ecco'],'inclp':_0x75e276['inclo'],'nodep':_0x75e276['nodeo'],'argpp':_0x75e276['argpo'],'mp':_0x75e276['mo'],'opsmode':_0x75e276['operationmode']},_0x32751a=dpper$1(_0x75e276,_0x1f5839);_0x75e276['ecco']=_0x32751a['ep'],_0x75e276['inclo']=_0x32751a['inclp'],_0x75e276['nodeo']=_0x32751a['nodep'],_0x75e276['argpo']=_0x32751a['argpp'],_0x75e276['mo']=_0x32751a['mp'],_0x2515b1=0x0,_0x3cce62=0x0,_0x5629ac=0x0;var _0x55e183={'cosim':_0x116424,'emsq':_0x2ae70f,'argpo':_0x75e276[_0x1df1c2(0x26e)],'s1':_0x131525,'s2':_0x2cba33,'s3':_0x590dd5,'s4':_0x346c27,'s5':_0x1b629d,'sinim':_0x4a182b,'ss1':_0x57c607,'ss2':_0x3c5957,'ss3':_0x4609a,'ss4':_0x4fd172,'ss5':_0x11fe5e,'sz1':_0x17ef70,'sz3':_0x2eeee8,'sz11':_0x4ccbfd,'sz13':_0x4084ca,'sz21':_0x541a44,'sz23':_0x1c88ab,'sz31':_0x57b3b6,'sz33':_0x387d78,'t':_0x75e276['t'],'tc':_0x1860b4,'gsto':_0x75e276['gsto'],'mo':_0x75e276['mo'],'mdot':_0x75e276['mdot'],'no':_0x75e276['no'],'nodeo':_0x75e276['nodeo'],'nodedot':_0x75e276[_0x1df1c2(0x184)],'xpidot':_0x300472,'z1':_0x33d38f,'z3':_0x37017c,'z11':_0x2382aa,'z13':_0x46c9db,'z21':_0x422781,'z23':_0x3d6898,'z31':_0x23a254,'z33':_0x32f6fd,'ecco':_0x75e276['ecco'],'eccsq':_0x1d53de,'em':_0x42eb00,'argpm':_0x2515b1,'inclm':_0x365137,'mm':_0x5629ac,'nm':_0x4dc5a2,'nodem':_0x3cce62,'irez':_0x75e276['irez'],'atime':_0x75e276['atime'],'d2201':_0x75e276['d2201'],'d2211':_0x75e276['d2211'],'d3210':_0x75e276[_0x1df1c2(0x2ca)],'d3222':_0x75e276[_0x1df1c2(0x372)],'d4410':_0x75e276['d4410'],'d4422':_0x75e276['d4422'],'d5220':_0x75e276[_0x1df1c2(0x2ac)],'d5232':_0x75e276['d5232'],'d5421':_0x75e276['d5421'],'d5433':_0x75e276[_0x1df1c2(0x252)],'dedt':_0x75e276['dedt'],'didt':_0x75e276['didt'],'dmdt':_0x75e276['dmdt'],'dnodt':_0x75e276['dnodt'],'domdt':_0x75e276['domdt'],'del1':_0x75e276['del1'],'del2':_0x75e276['del2'],'del3':_0x75e276[_0x1df1c2(0x1fb)],'xfact':_0x75e276['xfact'],'xlamo':_0x75e276['xlamo'],'xli':_0x75e276['xli'],'xni':_0x75e276['xni']},_0x47b570=dsinit$1(_0x55e183);_0x75e276['irez']=_0x47b570['irez'],_0x75e276[_0x1df1c2(0x2b4)]=_0x47b570[_0x1df1c2(0x2b4)],_0x75e276['d2201']=_0x47b570['d2201'],_0x75e276[_0x1df1c2(0x323)]=_0x47b570['d2211'],_0x75e276['d3210']=_0x47b570['d3210'],_0x75e276['d3222']=_0x47b570['d3222'],_0x75e276['d4410']=_0x47b570['d4410'],_0x75e276['d4422']=_0x47b570['d4422'],_0x75e276[_0x1df1c2(0x2ac)]=_0x47b570['d5220'],_0x75e276['d5232']=_0x47b570[_0x1df1c2(0x31b)],_0x75e276['d5421']=_0x47b570['d5421'],_0x75e276[_0x1df1c2(0x252)]=_0x47b570['d5433'],_0x75e276['dedt']=_0x47b570['dedt'],_0x75e276[_0x1df1c2(0x16e)]=_0x47b570['didt'],_0x75e276[_0x1df1c2(0x379)]=_0x47b570['dmdt'],_0x75e276[_0x1df1c2(0x166)]=_0x47b570['dnodt'],_0x75e276[_0x1df1c2(0x269)]=_0x47b570['domdt'],_0x75e276[_0x1df1c2(0x212)]=_0x47b570[_0x1df1c2(0x212)],_0x75e276['del2']=_0x47b570['del2'],_0x75e276[_0x1df1c2(0x1fb)]=_0x47b570['del3'],_0x75e276['xfact']=_0x47b570[_0x1df1c2(0x22f)],_0x75e276['xlamo']=_0x47b570['xlamo'],_0x75e276[_0x1df1c2(0x2c6)]=_0x47b570['xli'],_0x75e276[_0x1df1c2(0x279)]=_0x47b570['xni'];}_0x75e276[_0x1df1c2(0x35f)]!==0x1&&(_0x46509e=_0x75e276['cc1']*_0x75e276['cc1'],_0x75e276['d2']=0x4*_0x4ce8ff*_0x90c927*_0x46509e,_0x3fac2e=_0x75e276['d2']*_0x90c927*_0x75e276[_0x1df1c2(0x37b)]/0x3,_0x75e276['d3']=(0x11*_0x4ce8ff+_0x4f378c)*_0x3fac2e,_0x75e276['d4']=0.5*_0x3fac2e*_0x4ce8ff*_0x90c927*(0xdd*_0x4ce8ff+0x1f*_0x4f378c)*_0x75e276['cc1'],_0x75e276['t3cof']=_0x75e276['d2']+0x2*_0x46509e,_0x75e276['t4cof']=0.25*(0x3*_0x75e276['d3']+_0x75e276['cc1']*(0xc*_0x75e276['d2']+0xa*_0x46509e)),_0x75e276['t5cof']=0.2*(0x3*_0x75e276['d4']+0xc*_0x75e276['cc1']*_0x75e276['d3']+0x6*_0x75e276['d2']*_0x75e276['d2']+0xf*_0x46509e*(0x2*_0x75e276['d2']+_0x46509e)));}sgp4$1(_0x75e276,0x0),_0x75e276[_0x1df1c2(0x1f0)]='n';}function twoline2satrec$1(_0x4055ed,_0x199ff1){var _0x5e45e7=_0x15c6,_0x14fc9a='i',_0x2d1ebf=0x5a0/(0x2*pi$1),_0x18d9be=0x0,_0x5ac8c4={};_0x5ac8c4['error']=0x0,_0x5ac8c4['satnum']=_0x4055ed['substring'](0x2,0x7),_0x5ac8c4['epochyr']=parseInt(_0x4055ed[_0x5e45e7(0x354)](0x12,0x14),0xa),_0x5ac8c4['epochdays']=parseFloat(_0x4055ed[_0x5e45e7(0x354)](0x14,0x20)),_0x5ac8c4['ndot']=parseFloat(_0x4055ed[_0x5e45e7(0x354)](0x21,0x2b)),_0x5ac8c4['nddot']=parseFloat('.'['concat'](parseInt(_0x4055ed[_0x5e45e7(0x354)](0x2c,0x32),0xa),'E')['concat'](_0x4055ed['substring'](0x32,0x34))),_0x5ac8c4[_0x5e45e7(0x1a7)]=parseFloat(''['concat'](_0x4055ed['substring'](0x35,0x36),'.')['concat'](parseInt(_0x4055ed['substring'](0x36,0x3b),0xa),'E')['concat'](_0x4055ed[_0x5e45e7(0x354)](0x3b,0x3d))),_0x5ac8c4['inclo']=parseFloat(_0x199ff1['substring'](0x8,0x10)),_0x5ac8c4['nodeo']=parseFloat(_0x199ff1['substring'](0x11,0x19)),_0x5ac8c4[_0x5e45e7(0x271)]=parseFloat('.'['concat'](_0x199ff1['substring'](0x1a,0x21))),_0x5ac8c4['argpo']=parseFloat(_0x199ff1['substring'](0x22,0x2a)),_0x5ac8c4['mo']=parseFloat(_0x199ff1['substring'](0x2b,0x33)),_0x5ac8c4['no']=parseFloat(_0x199ff1[_0x5e45e7(0x354)](0x34,0x3f)),_0x5ac8c4['no']/=_0x2d1ebf,_0x5ac8c4[_0x5e45e7(0x18d)]*=deg2rad$1,_0x5ac8c4[_0x5e45e7(0x322)]*=deg2rad$1,_0x5ac8c4['argpo']*=deg2rad$1,_0x5ac8c4['mo']*=deg2rad$1;_0x5ac8c4[_0x5e45e7(0x174)]<0x39?_0x18d9be=_0x5ac8c4['epochyr']+0x7d0:_0x18d9be=_0x5ac8c4['epochyr']+0x76c;var _0x4cc917=days2mdhms$1(_0x18d9be,_0x5ac8c4['epochdays']),_0x389b7d=_0x4cc917[_0x5e45e7(0x1b2)],_0x183d2d=_0x4cc917[_0x5e45e7(0x18c)],_0x199598=_0x4cc917['hr'],_0x113591=_0x4cc917['minute'],_0x2729e4=_0x4cc917[_0x5e45e7(0x1cc)];return _0x5ac8c4['jdsatepoch']=jday$1(_0x18d9be,_0x389b7d,_0x183d2d,_0x199598,_0x113591,_0x2729e4),sgp4init$1(_0x5ac8c4,{'opsmode':_0x14fc9a,'satn':_0x5ac8c4['satnum'],'epoch':_0x5ac8c4['jdsatepoch']-2433281.5,'xbstar':_0x5ac8c4['bstar'],'xecco':_0x5ac8c4['ecco'],'xargpo':_0x5ac8c4['argpo'],'xinclo':_0x5ac8c4['inclo'],'xmo':_0x5ac8c4['mo'],'xno':_0x5ac8c4['no'],'xnodeo':_0x5ac8c4['nodeo']}),_0x5ac8c4;}function _toConsumableArray$1(_0x29d3bf){return _arrayWithoutHoles$1(_0x29d3bf)||_iterableToArray$1(_0x29d3bf)||_unsupportedIterableToArray$1(_0x29d3bf)||_nonIterableSpread$1();}function _arrayWithoutHoles$1(_0x221269){if(Array['isArray'](_0x221269))return _arrayLikeToArray$1(_0x221269);}function _iterableToArray$1(_0x1fb7d2){var _0xee61b8=_0x15c6;if(typeof Symbol!=='undefined'&&_0x1fb7d2[Symbol[_0xee61b8(0x1f7)]]!=null||_0x1fb7d2[_0xee61b8(0x21d)]!=null)return Array[_0xee61b8(0x299)](_0x1fb7d2);}function _unsupportedIterableToArray$1(_0x5de70f,_0x265271){var _0x3b1168=_0x15c6;if(!_0x5de70f)return;if(typeof _0x5de70f==='string')return _arrayLikeToArray$1(_0x5de70f,_0x265271);var _0x440c07=Object['prototype'][_0x3b1168(0x1e7)][_0x3b1168(0x19c)](_0x5de70f)['slice'](0x8,-0x1);if(_0x440c07==='Object'&&_0x5de70f['constructor'])_0x440c07=_0x5de70f['constructor'][_0x3b1168(0x36e)];if(_0x440c07==='Map'||_0x440c07==='Set')return Array['from'](_0x5de70f);if(_0x440c07==='Arguments'||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/[_0x3b1168(0x1ae)](_0x440c07))return _arrayLikeToArray$1(_0x5de70f,_0x265271);}function _arrayLikeToArray$1(_0x507988,_0x4fd879){if(_0x4fd879==null||_0x4fd879>_0x507988['length'])_0x4fd879=_0x507988['length'];for(var _0x82252f=0x0,_0x3cc62d=new Array(_0x4fd879);_0x82252f<_0x4fd879;_0x82252f++)_0x3cc62d[_0x82252f]=_0x507988[_0x82252f];return _0x3cc62d;}function _nonIterableSpread$1(){var _0x6dc1d0=_0x15c6;throw new TypeError(_0x6dc1d0(0x373));}function propagate$1(){var _0x305d93=_0x15c6;for(var _0x371cb7=arguments[_0x305d93(0x152)],_0xbe94ea=new Array(_0x371cb7),_0x1ee73e=0x0;_0x1ee73e<_0x371cb7;_0x1ee73e++){_0xbe94ea[_0x1ee73e]=arguments[_0x1ee73e];}var _0x28a1f1=_0xbe94ea[0x0],_0x3a37b8=Array[_0x305d93(0x1cd)][_0x305d93(0x2ef)]['call'](_0xbe94ea,0x1),_0x5a964b=jday$1[_0x305d93(0x26b)](void 0x0,_toConsumableArray$1(_0x3a37b8)),_0x39c454=(_0x5a964b-_0x28a1f1[_0x305d93(0x316)])*minutesPerDay$1;return sgp4$1(_0x28a1f1,_0x39c454);}function dopplerFactor$1(_0x4c931b,_0x397826,_0x56c87b){var _0x1168da=_0x15c6,_0xe29f32=0.00007292115,_0x4df6eb=299792.458,_0x5e428e={'x':_0x397826['x']-_0x4c931b['x'],'y':_0x397826['y']-_0x4c931b['y'],'z':_0x397826['z']-_0x4c931b['z']};_0x5e428e['w']=Math['sqrt'](Math['pow'](_0x5e428e['x'],0x2)+Math[_0x1168da(0x22c)](_0x5e428e['y'],0x2)+Math['pow'](_0x5e428e['z'],0x2));var _0x22f8cd={'x':_0x56c87b['x']+_0xe29f32*_0x4c931b['y'],'y':_0x56c87b['y']-_0xe29f32*_0x4c931b['x'],'z':_0x56c87b['z']};function _0x3fda9d(_0x49364f){return _0x49364f>=0x0?0x1:-0x1;}var _0x4c2e69=(_0x5e428e['x']*_0x22f8cd['x']+_0x5e428e['y']*_0x22f8cd['y']+_0x5e428e['z']*_0x22f8cd['z'])/_0x5e428e['w'];return 0x1+_0x4c2e69/_0x4df6eb*_0x3fda9d(_0x4c2e69);}function radiansToDegrees$1(_0xeec7fb){return _0xeec7fb*rad2deg$1;}function degreesToRadians$1(_0xc5f8ff){return _0xc5f8ff*deg2rad$1;}function degreesLat$1(_0x4a9f96){if(_0x4a9f96<-pi$1/0x2||_0x4a9f96>pi$1/0x2)throw new RangeError('Latitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi/2;\x20pi/2].');return radiansToDegrees$1(_0x4a9f96);}function degreesLong$1(_0x2c8c4e){if(_0x2c8c4e<-pi$1||_0x2c8c4e>pi$1)throw new RangeError('Longitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi;\x20pi].');return radiansToDegrees$1(_0x2c8c4e);}function radiansLat$1(_0x519c88){if(_0x519c88<-0x5a||_0x519c88>0x5a)throw new RangeError('Latitude\x20degrees\x20must\x20be\x20in\x20range\x20[-90;\x2090].');return degreesToRadians$1(_0x519c88);}function radiansLong$1(_0x3f1cb1){if(_0x3f1cb1<-0xb4||_0x3f1cb1>0xb4)throw new RangeError('Longitude\x20degrees\x20must\x20be\x20in\x20range\x20[-180;\x20180].');return degreesToRadians$1(_0x3f1cb1);}function geodeticToEcf$1(_0x1546bd){var _0x4ad052=_0x15c6,_0x1b43db=_0x1546bd['longitude'],_0x258492=_0x1546bd['latitude'],_0x555b05=_0x1546bd['height'],_0x5ae945=6378.137,_0xd14ec0=6356.7523142,_0x1b801a=(_0x5ae945-_0xd14ec0)/_0x5ae945,_0x3fda85=0x2*_0x1b801a-_0x1b801a*_0x1b801a,_0x29aa6d=_0x5ae945/Math['sqrt'](0x1-_0x3fda85*(Math['sin'](_0x258492)*Math[_0x4ad052(0x226)](_0x258492))),_0x8ffefd=(_0x29aa6d+_0x555b05)*Math['cos'](_0x258492)*Math['cos'](_0x1b43db),_0x4d58c3=(_0x29aa6d+_0x555b05)*Math['cos'](_0x258492)*Math['sin'](_0x1b43db),_0x5ba17d=(_0x29aa6d*(0x1-_0x3fda85)+_0x555b05)*Math['sin'](_0x258492);return{'x':_0x8ffefd,'y':_0x4d58c3,'z':_0x5ba17d};}function eciToGeodetic$1(_0x3371c5,_0x19895e){var _0x1df131=_0x15c6,_0x2b2141=6378.137,_0x52a13d=6356.7523142,_0x39510b=Math['sqrt'](_0x3371c5['x']*_0x3371c5['x']+_0x3371c5['y']*_0x3371c5['y']),_0x40721b=(_0x2b2141-_0x52a13d)/_0x2b2141,_0x251607=0x2*_0x40721b-_0x40721b*_0x40721b,_0x1b6294=Math['atan2'](_0x3371c5['y'],_0x3371c5['x'])-_0x19895e;while(_0x1b6294<-pi$1){_0x1b6294+=twoPi$1;}while(_0x1b6294>pi$1){_0x1b6294-=twoPi$1;}var _0x18d827=0x14,_0x5b1ad0=0x0,_0x1ac138=Math['atan2'](_0x3371c5['z'],Math['sqrt'](_0x3371c5['x']*_0x3371c5['x']+_0x3371c5['y']*_0x3371c5['y'])),_0x46d30f;while(_0x5b1ad0<_0x18d827){_0x46d30f=0x1/Math['sqrt'](0x1-_0x251607*(Math['sin'](_0x1ac138)*Math['sin'](_0x1ac138))),_0x1ac138=Math[_0x1df131(0x1e8)](_0x3371c5['z']+_0x2b2141*_0x46d30f*_0x251607*Math['sin'](_0x1ac138),_0x39510b),_0x5b1ad0+=0x1;}var _0x2e46f6=_0x39510b/Math['cos'](_0x1ac138)-_0x2b2141*_0x46d30f;return{'longitude':_0x1b6294,'latitude':_0x1ac138,'height':_0x2e46f6};}function ecfToEci$1(_0x45d07e,_0x3b1ebd){var _0x295ca2=_0x45d07e['x']*Math['cos'](_0x3b1ebd)-_0x45d07e['y']*Math['sin'](_0x3b1ebd),_0x5254ce=_0x45d07e['x']*Math['sin'](_0x3b1ebd)+_0x45d07e['y']*Math['cos'](_0x3b1ebd),_0x4a8e41=_0x45d07e['z'];return{'x':_0x295ca2,'y':_0x5254ce,'z':_0x4a8e41};}function eciToEcf$1(_0xd6c420,_0xbc1636){var _0x4732c8=_0x15c6,_0x57fd38=_0xd6c420['x']*Math[_0x4732c8(0x2dd)](_0xbc1636)+_0xd6c420['y']*Math['sin'](_0xbc1636),_0x334b84=_0xd6c420['x']*-Math[_0x4732c8(0x226)](_0xbc1636)+_0xd6c420['y']*Math['cos'](_0xbc1636),_0x244be8=_0xd6c420['z'];return{'x':_0x57fd38,'y':_0x334b84,'z':_0x244be8};}function topocentric$1(_0x1450e1,_0x4a6607){var _0xabe2aa=_0x15c6,_0x545ffa=_0x1450e1['longitude'],_0x29b0d4=_0x1450e1[_0xabe2aa(0x348)],_0x11ce2a=geodeticToEcf$1(_0x1450e1),_0xc9a99=_0x4a6607['x']-_0x11ce2a['x'],_0x420582=_0x4a6607['y']-_0x11ce2a['y'],_0x3826cc=_0x4a6607['z']-_0x11ce2a['z'],_0x28163a=Math['sin'](_0x29b0d4)*Math[_0xabe2aa(0x2dd)](_0x545ffa)*_0xc9a99+Math['sin'](_0x29b0d4)*Math['sin'](_0x545ffa)*_0x420582-Math[_0xabe2aa(0x2dd)](_0x29b0d4)*_0x3826cc,_0x105a47=-Math['sin'](_0x545ffa)*_0xc9a99+Math['cos'](_0x545ffa)*_0x420582,_0x55785a=Math['cos'](_0x29b0d4)*Math['cos'](_0x545ffa)*_0xc9a99+Math[_0xabe2aa(0x2dd)](_0x29b0d4)*Math[_0xabe2aa(0x226)](_0x545ffa)*_0x420582+Math[_0xabe2aa(0x226)](_0x29b0d4)*_0x3826cc;return{'topS':_0x28163a,'topE':_0x105a47,'topZ':_0x55785a};}function topocentricToLookAngles$1(_0x11ee1f){var _0x4eb26d=_0x15c6,_0x2cf57a=_0x11ee1f[_0x4eb26d(0x1d7)],_0x908203=_0x11ee1f['topE'],_0x3e7a19=_0x11ee1f['topZ'],_0x276e04=Math['sqrt'](_0x2cf57a*_0x2cf57a+_0x908203*_0x908203+_0x3e7a19*_0x3e7a19),_0x4d82c0=Math['asin'](_0x3e7a19/_0x276e04),_0x2db787=Math['atan2'](-_0x908203,_0x2cf57a)+pi$1;return{'azimuth':_0x2db787,'elevation':_0x4d82c0,'rangeSat':_0x276e04};}function ecfToLookAngles$1(_0x384417,_0x522465){var _0x46dd38=topocentric$1(_0x384417,_0x522465);return topocentricToLookAngles$1(_0x46dd38);}function _0x15c6(_0x598207,_0x1aad53){var _0x5a1f5a=_0x5a1f();return _0x15c6=function(_0x15c6b7,_0x5e19b2){_0x15c6b7=_0x15c6b7-0x14d;var _0x49db8a=_0x5a1f5a[_0x15c6b7];return _0x49db8a;},_0x15c6(_0x598207,_0x1aad53);}var satellite={'__proto__':null,'constants':constants$1,'degreesLat':degreesLat$1,'degreesLong':degreesLong$1,'degreesToRadians':degreesToRadians$1,'dopplerFactor':dopplerFactor$1,'ecfToEci':ecfToEci$1,'ecfToLookAngles':ecfToLookAngles$1,'eciToEcf':eciToEcf$1,'eciToGeodetic':eciToGeodetic$1,'geodeticToEcf':geodeticToEcf$1,'gstime':gstime$1,'invjday':invjday$1,'jday':jday$1,'propagate':propagate$1,'radiansLat':radiansLat$1,'radiansLong':radiansLong$1,'radiansToDegrees':radiansToDegrees$1,'sgp4':sgp4$1,'twoline2satrec':twoline2satrec$1},commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!==_0x16ff71(0x1c3)?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs(_0x2dc6f0){var _0xb289c4=_0x16ff71;return _0x2dc6f0&&_0x2dc6f0['__esModule']&&Object[_0xb289c4(0x1cd)][_0xb289c4(0x368)][_0xb289c4(0x19c)](_0x2dc6f0,_0xb289c4(0x261))?_0x2dc6f0['default']:_0x2dc6f0;}function getAugmentedNamespace(_0x3e1553){var _0xd08b0=_0x16ff71;if(_0x3e1553['__esModule'])return _0x3e1553;var _0x3304d1=Object['defineProperty']({},_0xd08b0(0x14e),{'value':!![]});return Object['keys'](_0x3e1553)['forEach'](function(_0x1a5452){var _0x17c287=Object['getOwnPropertyDescriptor'](_0x3e1553,_0x1a5452);Object['defineProperty'](_0x3304d1,_0x1a5452,_0x17c287['get']?_0x17c287:{'enumerable':!![],'get':function(){return _0x3e1553[_0x1a5452];}});}),_0x3304d1;}var tlejs_umd$1={'exports':{}},pi=Math['PI'],twoPi=pi*0x2,deg2rad=pi/0xb4,rad2deg=0xb4/pi,minutesPerDay=0x5a0,mu=398600.5,earthRadius=6378.137,xke=0x3c/Math[_0x16ff71(0x1d2)](earthRadius*earthRadius*earthRadius/mu),vkmpersec=earthRadius*xke/0x3c,tumin=0x1/xke,j2=0.00108262998905,j3=-0.00000253215306,j4=-0.00000161098761,j3oj2=j3/j2,x2o3=0x2/0x3,constants=Object['freeze']({'__proto__':null,'pi':pi,'twoPi':twoPi,'deg2rad':deg2rad,'rad2deg':rad2deg,'minutesPerDay':minutesPerDay,'mu':mu,'earthRadius':earthRadius,'xke':xke,'vkmpersec':vkmpersec,'tumin':tumin,'j2':j2,'j3':j3,'j4':j4,'j3oj2':j3oj2,'x2o3':x2o3});function days2mdhms(_0x46ee89,_0x426a16){var _0xc412f2=[0x1f,_0x46ee89%0x4===0x0?0x1d:0x1c,0x1f,0x1e,0x1f,0x1e,0x1f,0x1f,0x1e,0x1f,0x1e,0x1f],_0x44385f=Math['floor'](_0x426a16),_0x1facd6=0x1,_0x4f7b44=0x0;while(_0x44385f>_0x4f7b44+_0xc412f2[_0x1facd6-0x1]&&_0x1facd6<0xc){_0x4f7b44+=_0xc412f2[_0x1facd6-0x1],_0x1facd6+=0x1;}var _0x63589c=_0x1facd6,_0x2e463c=_0x44385f-_0x4f7b44,_0x57f1f1=(_0x426a16-_0x44385f)*0x18,_0x3f1c08=Math['floor'](_0x57f1f1);_0x57f1f1=(_0x57f1f1-_0x3f1c08)*0x3c;var _0x50498e=Math['floor'](_0x57f1f1),_0x4f3f23=(_0x57f1f1-_0x50498e)*0x3c;return{'mon':_0x63589c,'day':_0x2e463c,'hr':_0x3f1c08,'minute':_0x50498e,'sec':_0x4f3f23};}function jdayInternal(_0x2d2502,_0x2d5f0d,_0x3abe30,_0x472910,_0x20bc7a,_0x19d17d){var _0xe6ecdb=_0x16ff71,_0xa35dca=arguments[_0xe6ecdb(0x152)]>0x6&&arguments[0x6]!==undefined?arguments[0x6]:0x0;return 0x16f*_0x2d2502-Math['floor'](0x7*(_0x2d2502+Math[_0xe6ecdb(0x2d4)]((_0x2d5f0d+0x9)/0xc))*0.25)+Math['floor'](0x113*_0x2d5f0d/0x9)+_0x3abe30+1721013.5+((_0xa35dca/0xea60+_0x19d17d/0x3c+_0x20bc7a)/0x3c+_0x472910)/0x18;}function jday(_0x3dafa4,_0x11c933,_0x353404,_0x58ed1f,_0x4be341,_0x2a0ccf,_0x117a16){var _0x3730db=_0x16ff71;if(_0x3dafa4 instanceof Date){var _0x17d0e8=_0x3dafa4;return jdayInternal(_0x17d0e8['getUTCFullYear'](),_0x17d0e8['getUTCMonth']()+0x1,_0x17d0e8['getUTCDate'](),_0x17d0e8[_0x3730db(0x177)](),_0x17d0e8['getUTCMinutes'](),_0x17d0e8[_0x3730db(0x22b)](),_0x17d0e8['getUTCMilliseconds']());}return jdayInternal(_0x3dafa4,_0x11c933,_0x353404,_0x58ed1f,_0x4be341,_0x2a0ccf,_0x117a16);}function invjday(_0x2c6fe3,_0x196e8d){var _0x1dc431=_0x16ff71,_0x2fa3de=_0x2c6fe3-2415019.5,_0x13335=_0x2fa3de/365.25,_0x1faa57=0x76c+Math[_0x1dc431(0x2d4)](_0x13335),_0x460349=Math[_0x1dc431(0x2d4)]((_0x1faa57-0x76d)*0.25),_0x59db29=_0x2fa3de-((_0x1faa57-0x76c)*0x16d+_0x460349)+1e-11;_0x59db29<0x1&&(_0x1faa57-=0x1,_0x460349=Math['floor']((_0x1faa57-0x76d)*0.25),_0x59db29=_0x2fa3de-((_0x1faa57-0x76c)*0x16d+_0x460349));var _0x5f51e4=days2mdhms(_0x1faa57,_0x59db29),_0x2e3e2a=_0x5f51e4['mon'],_0x189754=_0x5f51e4[_0x1dc431(0x18c)],_0x5c28de=_0x5f51e4['hr'],_0x21cc2a=_0x5f51e4['minute'],_0x2bef55=_0x5f51e4['sec']-8.64e-7;if(_0x196e8d)return[_0x1faa57,_0x2e3e2a,_0x189754,_0x5c28de,_0x21cc2a,Math['floor'](_0x2bef55)];return new Date(Date['UTC'](_0x1faa57,_0x2e3e2a-0x1,_0x189754,_0x5c28de,_0x21cc2a,Math[_0x1dc431(0x2d4)](_0x2bef55)));}function dpper(_0x3a0e98,_0x2298ed){var _0x5856e6=_0x16ff71,_0x1a1e5c=_0x3a0e98['e3'],_0x5e28b9=_0x3a0e98['ee2'],_0x563417=_0x3a0e98[_0x5856e6(0x164)],_0x45080b=_0x3a0e98[_0x5856e6(0x16b)],_0x269eb6=_0x3a0e98['pho'],_0x2adf49=_0x3a0e98['pinco'],_0x55749d=_0x3a0e98['plo'],_0x378b1c=_0x3a0e98[_0x5856e6(0x196)],_0x14aa6f=_0x3a0e98[_0x5856e6(0x2ff)],_0x28b8a6=_0x3a0e98['sgh2'],_0x6720d6=_0x3a0e98['sgh3'],_0x19b817=_0x3a0e98['sgh4'],_0x3e4de7=_0x3a0e98['sh2'],_0x37d4ec=_0x3a0e98['sh3'],_0x57b042=_0x3a0e98[_0x5856e6(0x350)],_0x53d0ea=_0x3a0e98[_0x5856e6(0x22d)],_0x183b51=_0x3a0e98['sl2'],_0x5dcb25=_0x3a0e98[_0x5856e6(0x201)],_0x28a20f=_0x3a0e98['sl4'],_0x4b5b9e=_0x3a0e98['t'],_0x263df0=_0x3a0e98['xgh2'],_0x27ff4b=_0x3a0e98[_0x5856e6(0x1c4)],_0x520d4d=_0x3a0e98['xgh4'],_0x374e34=_0x3a0e98[_0x5856e6(0x34a)],_0xe92ba=_0x3a0e98[_0x5856e6(0x2e0)],_0x38235a=_0x3a0e98[_0x5856e6(0x2df)],_0x31442c=_0x3a0e98['xi3'],_0x25ea25=_0x3a0e98['xl2'],_0x3afd7f=_0x3a0e98['xl3'],_0x4a6bd8=_0x3a0e98[_0x5856e6(0x274)],_0x2477ac=_0x3a0e98[_0x5856e6(0x37e)],_0x1036b4=_0x3a0e98['zmos'],_0x4b42e0=_0x2298ed[_0x5856e6(0x1f0)],_0x5f52c2=_0x2298ed['opsmode'],_0x2fe2a3=_0x2298ed['ep'],_0x4ec3c8=_0x2298ed['inclp'],_0x29e99c=_0x2298ed[_0x5856e6(0x292)],_0x4cb2cb=_0x2298ed['argpp'],_0x46d936=_0x2298ed['mp'],_0x2a6785,_0x596a44,_0x1c5f50,_0x35789c,_0xcbc3ba,_0x14389f,_0x1f0bbc,_0x20e7a6,_0x3ebf5d,_0x10c7a5,_0x56de23,_0x2c6f2a,_0x906472,_0x3c572e,_0x365e90,_0x553e49,_0x481d55,_0x5edcd2,_0x234a5e,_0x1dcf09,_0x470539,_0x5dfcca=0.0000119459,_0x2e271c=0.01675,_0x997453=0.00015835218,_0x55c4a6=0.0549;_0x470539=_0x1036b4+_0x5dfcca*_0x4b5b9e;_0x4b42e0==='y'&&(_0x470539=_0x1036b4);_0x1dcf09=_0x470539+0x2*_0x2e271c*Math['sin'](_0x470539),_0x481d55=Math['sin'](_0x1dcf09),_0x10c7a5=0.5*_0x481d55*_0x481d55-0.25,_0x56de23=-0.5*_0x481d55*Math[_0x5856e6(0x2dd)](_0x1dcf09);var _0x275010=_0x378b1c*_0x10c7a5+_0x14aa6f*_0x56de23,_0x117760=_0x57b042*_0x10c7a5+_0x53d0ea*_0x56de23,_0x18e669=_0x183b51*_0x10c7a5+_0x5dcb25*_0x56de23+_0x28a20f*_0x481d55,_0x1abfbe=_0x28b8a6*_0x10c7a5+_0x6720d6*_0x56de23+_0x19b817*_0x481d55,_0x34ea37=_0x3e4de7*_0x10c7a5+_0x37d4ec*_0x56de23;_0x470539=_0x2477ac+_0x997453*_0x4b5b9e;_0x4b42e0==='y'&&(_0x470539=_0x2477ac);_0x1dcf09=_0x470539+0x2*_0x55c4a6*Math['sin'](_0x470539),_0x481d55=Math[_0x5856e6(0x226)](_0x1dcf09),_0x10c7a5=0.5*_0x481d55*_0x481d55-0.25,_0x56de23=-0.5*_0x481d55*Math['cos'](_0x1dcf09);var _0x14c3b4=_0x5e28b9*_0x10c7a5+_0x1a1e5c*_0x56de23,_0x44bc78=_0x38235a*_0x10c7a5+_0x31442c*_0x56de23,_0x26698b=_0x25ea25*_0x10c7a5+_0x3afd7f*_0x56de23+_0x4a6bd8*_0x481d55,_0x553904=_0x263df0*_0x10c7a5+_0x27ff4b*_0x56de23+_0x520d4d*_0x481d55,_0x5e3cd4=_0x374e34*_0x10c7a5+_0xe92ba*_0x56de23;return _0x2c6f2a=_0x275010+_0x14c3b4,_0x365e90=_0x117760+_0x44bc78,_0x553e49=_0x18e669+_0x26698b,_0x906472=_0x1abfbe+_0x553904,_0x3c572e=_0x34ea37+_0x5e3cd4,_0x4b42e0==='n'&&(_0x2c6f2a-=_0x563417,_0x365e90-=_0x2adf49,_0x553e49-=_0x55749d,_0x906472-=_0x45080b,_0x3c572e-=_0x269eb6,_0x4ec3c8+=_0x365e90,_0x2fe2a3+=_0x2c6f2a,_0x35789c=Math['sin'](_0x4ec3c8),_0x1c5f50=Math[_0x5856e6(0x2dd)](_0x4ec3c8),_0x4ec3c8>=0.2?(_0x3c572e/=_0x35789c,_0x906472-=_0x1c5f50*_0x3c572e,_0x4cb2cb+=_0x906472,_0x29e99c+=_0x3c572e,_0x46d936+=_0x553e49):(_0x14389f=Math[_0x5856e6(0x226)](_0x29e99c),_0xcbc3ba=Math['cos'](_0x29e99c),_0x2a6785=_0x35789c*_0x14389f,_0x596a44=_0x35789c*_0xcbc3ba,_0x1f0bbc=_0x3c572e*_0xcbc3ba+_0x365e90*_0x1c5f50*_0x14389f,_0x20e7a6=-_0x3c572e*_0x14389f+_0x365e90*_0x1c5f50*_0xcbc3ba,_0x2a6785+=_0x1f0bbc,_0x596a44+=_0x20e7a6,_0x29e99c%=twoPi,_0x29e99c<0x0&&_0x5f52c2==='a'&&(_0x29e99c+=twoPi),_0x5edcd2=_0x46d936+_0x4cb2cb+_0x1c5f50*_0x29e99c,_0x3ebf5d=_0x553e49+_0x906472-_0x365e90*_0x29e99c*_0x35789c,_0x5edcd2+=_0x3ebf5d,_0x234a5e=_0x29e99c,_0x29e99c=Math['atan2'](_0x2a6785,_0x596a44),_0x29e99c<0x0&&_0x5f52c2==='a'&&(_0x29e99c+=twoPi),Math['abs'](_0x234a5e-_0x29e99c)>pi&&(_0x29e99c<_0x234a5e?_0x29e99c+=twoPi:_0x29e99c-=twoPi),_0x46d936+=_0x553e49,_0x4cb2cb=_0x5edcd2-_0x46d936-_0x1c5f50*_0x29e99c)),{'ep':_0x2fe2a3,'inclp':_0x4ec3c8,'nodep':_0x29e99c,'argpp':_0x4cb2cb,'mp':_0x46d936};}function dscom(_0x1aca30){var _0x253517=_0x16ff71,_0x2b8a59=_0x1aca30[_0x253517(0x302)],_0x363a62=_0x1aca30['ep'],_0x4c2818=_0x1aca30['argpp'],_0xb4bf2f=_0x1aca30['tc'],_0x219874=_0x1aca30['inclp'],_0xa88d97=_0x1aca30['nodep'],_0x29a0b4=_0x1aca30['np'],_0x491600,_0x4a9d57,_0x138f65,_0x4aadab,_0x1a211e,_0xee0802,_0x383932,_0x2cd933,_0x4549f4,_0x2fdfaf,_0x12c3fc,_0x4e64b7,_0x2907d5,_0x174d50,_0x2847b0,_0x3f301c,_0x9e6e38,_0x276197,_0x4e3415,_0x1a037b,_0x3a9704,_0x5c961e,_0x21d99c,_0x28cc1c,_0x2d2c60,_0x128d4d,_0x8781fb,_0x157ce1,_0x35313e,_0x162647,_0x1ce051,_0xd5292a,_0x5e7332,_0x208962,_0x523aa3,_0x2722a9,_0x2bc051,_0x312882,_0x180c42,_0x5708f2,_0x5f327e,_0x3c5ebb,_0x36e06c,_0x21b0db,_0x297871,_0x4f457f,_0x838400,_0x3cb928,_0x3c27ca,_0x1d601c,_0x139591,_0x101985,_0x9f9d05,_0x1c3136,_0x38426c,_0x1a7759,_0x1a6ec9,_0x49502e,_0x472a94,_0xa68cf4,_0x26130a,_0x1ccd65,_0x12f958,_0x1c2501=0.01675,_0x579c11=0.0549,_0x2036f=0.0000029864797,_0x3108aa=4.7968065e-7,_0xfddc99=0.39785416,_0x2a5589=0.91744867,_0x4f7a57=0.1945905,_0x286a04=-0.98088458,_0x1342a0=_0x29a0b4,_0x54678c=_0x363a62,_0x598f22=Math['sin'](_0xa88d97),_0x1c12c4=Math[_0x253517(0x2dd)](_0xa88d97),_0xb96ec=Math['sin'](_0x4c2818),_0x419d05=Math['cos'](_0x4c2818),_0x5cb346=Math['sin'](_0x219874),_0x1bb75b=Math['cos'](_0x219874),_0x2c5882=_0x54678c*_0x54678c,_0x46108d=0x1-_0x2c5882,_0x12f9e1=Math['sqrt'](_0x46108d),_0x1873a3=0x0,_0x1889fc=0x0,_0xbace68=0x0,_0x1792a5=0x0,_0x3e2d36=0x0,_0x3001a3=_0x2b8a59+18261.5+_0xb4bf2f/0x5a0,_0x1b2e33=(4.523602-0.00092422029*_0x3001a3)%twoPi,_0x3507f6=Math['sin'](_0x1b2e33),_0x2b65d9=Math['cos'](_0x1b2e33),_0x16c44c=0.91375164-0.03568096*_0x2b65d9,_0x34f8af=Math[_0x253517(0x1d2)](0x1-_0x16c44c*_0x16c44c),_0x261a94=0.089683511*_0x3507f6/_0x34f8af,_0x10d585=Math['sqrt'](0x1-_0x261a94*_0x261a94),_0x524f91=5.8351514+0.001944368*_0x3001a3,_0x1e47a2=0.39785416*_0x3507f6/_0x34f8af,_0x90840f=_0x10d585*_0x2b65d9+0.91744867*_0x261a94*_0x3507f6;_0x1e47a2=Math['atan2'](_0x1e47a2,_0x90840f),_0x1e47a2+=_0x524f91-_0x1b2e33;var _0x1fd9b4=Math['cos'](_0x1e47a2),_0x52ab10=Math['sin'](_0x1e47a2);_0x1a037b=_0x4f7a57,_0x3a9704=_0x286a04,_0x28cc1c=_0x2a5589,_0x2d2c60=_0xfddc99,_0x5c961e=_0x1c12c4,_0x21d99c=_0x598f22,_0x12c3fc=_0x2036f;var _0x3f595d=0x1/_0x1342a0,_0x42e4dd=0x0;while(_0x42e4dd<0x2){_0x42e4dd+=0x1,_0x491600=_0x1a037b*_0x5c961e+_0x3a9704*_0x28cc1c*_0x21d99c,_0x138f65=-_0x3a9704*_0x5c961e+_0x1a037b*_0x28cc1c*_0x21d99c,_0x383932=-_0x1a037b*_0x21d99c+_0x3a9704*_0x28cc1c*_0x5c961e,_0x2cd933=_0x3a9704*_0x2d2c60,_0x4549f4=_0x3a9704*_0x21d99c+_0x1a037b*_0x28cc1c*_0x5c961e,_0x2fdfaf=_0x1a037b*_0x2d2c60,_0x4a9d57=_0x1bb75b*_0x383932+_0x5cb346*_0x2cd933,_0x4aadab=_0x1bb75b*_0x4549f4+_0x5cb346*_0x2fdfaf,_0x1a211e=-_0x5cb346*_0x383932+_0x1bb75b*_0x2cd933,_0xee0802=-_0x5cb346*_0x4549f4+_0x1bb75b*_0x2fdfaf,_0x4e64b7=_0x491600*_0x419d05+_0x4a9d57*_0xb96ec,_0x2907d5=_0x138f65*_0x419d05+_0x4aadab*_0xb96ec,_0x174d50=-_0x491600*_0xb96ec+_0x4a9d57*_0x419d05,_0x2847b0=-_0x138f65*_0xb96ec+_0x4aadab*_0x419d05,_0x3f301c=_0x1a211e*_0xb96ec,_0x9e6e38=_0xee0802*_0xb96ec,_0x276197=_0x1a211e*_0x419d05,_0x4e3415=_0xee0802*_0x419d05,_0x26130a=0xc*_0x4e64b7*_0x4e64b7-0x3*_0x174d50*_0x174d50,_0x1ccd65=0x18*_0x4e64b7*_0x2907d5-0x6*_0x174d50*_0x2847b0,_0x12f958=0xc*_0x2907d5*_0x2907d5-0x3*_0x2847b0*_0x2847b0,_0x101985=0x3*(_0x491600*_0x491600+_0x4a9d57*_0x4a9d57)+_0x26130a*_0x2c5882,_0x9f9d05=0x6*(_0x491600*_0x138f65+_0x4a9d57*_0x4aadab)+_0x1ccd65*_0x2c5882,_0x1c3136=0x3*(_0x138f65*_0x138f65+_0x4aadab*_0x4aadab)+_0x12f958*_0x2c5882,_0x38426c=-0x6*_0x491600*_0x1a211e+_0x2c5882*(-0x18*_0x4e64b7*_0x276197-0x6*_0x174d50*_0x3f301c),_0x1a7759=-0x6*(_0x491600*_0xee0802+_0x138f65*_0x1a211e)+_0x2c5882*(-0x18*(_0x2907d5*_0x276197+_0x4e64b7*_0x4e3415)+-0x6*(_0x174d50*_0x9e6e38+_0x2847b0*_0x3f301c)),_0x1a6ec9=-0x6*_0x138f65*_0xee0802+_0x2c5882*(-0x18*_0x2907d5*_0x4e3415-0x6*_0x2847b0*_0x9e6e38),_0x49502e=0x6*_0x4a9d57*_0x1a211e+_0x2c5882*(0x18*_0x4e64b7*_0x3f301c-0x6*_0x174d50*_0x276197),_0x472a94=0x6*(_0x4aadab*_0x1a211e+_0x4a9d57*_0xee0802)+_0x2c5882*(0x18*(_0x2907d5*_0x3f301c+_0x4e64b7*_0x9e6e38)-0x6*(_0x2847b0*_0x276197+_0x174d50*_0x4e3415)),_0xa68cf4=0x6*_0x4aadab*_0xee0802+_0x2c5882*(0x18*_0x2907d5*_0x9e6e38-0x6*_0x2847b0*_0x4e3415),_0x101985=_0x101985+_0x101985+_0x46108d*_0x26130a,_0x9f9d05=_0x9f9d05+_0x9f9d05+_0x46108d*_0x1ccd65,_0x1c3136=_0x1c3136+_0x1c3136+_0x46108d*_0x12f958,_0x838400=_0x12c3fc*_0x3f595d,_0x4f457f=-0.5*_0x838400/_0x12f9e1,_0x3cb928=_0x838400*_0x12f9e1,_0x297871=-0xf*_0x54678c*_0x3cb928,_0x3c27ca=_0x4e64b7*_0x174d50+_0x2907d5*_0x2847b0,_0x1d601c=_0x2907d5*_0x174d50+_0x4e64b7*_0x2847b0,_0x139591=_0x2907d5*_0x2847b0-_0x4e64b7*_0x174d50,_0x42e4dd===0x1&&(_0x128d4d=_0x297871,_0x8781fb=_0x4f457f,_0x157ce1=_0x838400,_0x35313e=_0x3cb928,_0x162647=_0x3c27ca,_0x1ce051=_0x1d601c,_0xd5292a=_0x139591,_0x5e7332=_0x101985,_0x208962=_0x9f9d05,_0x523aa3=_0x1c3136,_0x2722a9=_0x38426c,_0x2bc051=_0x1a7759,_0x312882=_0x1a6ec9,_0x180c42=_0x49502e,_0x5708f2=_0x472a94,_0x5f327e=_0xa68cf4,_0x3c5ebb=_0x26130a,_0x36e06c=_0x1ccd65,_0x21b0db=_0x12f958,_0x1a037b=_0x1fd9b4,_0x3a9704=_0x52ab10,_0x28cc1c=_0x16c44c,_0x2d2c60=_0x34f8af,_0x5c961e=_0x10d585*_0x1c12c4+_0x261a94*_0x598f22,_0x21d99c=_0x598f22*_0x10d585-_0x1c12c4*_0x261a94,_0x12c3fc=_0x3108aa);}var _0x84a89=(4.7199672+(0.2299715*_0x3001a3-_0x524f91))%twoPi,_0x4b12b9=(6.2565837+0.017201977*_0x3001a3)%twoPi,_0x134204=0x2*_0x128d4d*_0x1ce051,_0xb3fe76=0x2*_0x128d4d*_0xd5292a,_0x3d3ced=0x2*_0x8781fb*_0x2bc051,_0x840ce1=0x2*_0x8781fb*(_0x312882-_0x2722a9),_0x9bf7e4=-0x2*_0x157ce1*_0x208962,_0x4d52e5=-0x2*_0x157ce1*(_0x523aa3-_0x5e7332),_0x528cfc=-0x2*_0x157ce1*(-0x15-0x9*_0x2c5882)*_0x1c2501,_0x33dc75=0x2*_0x35313e*_0x36e06c,_0x193573=0x2*_0x35313e*(_0x21b0db-_0x3c5ebb),_0x15a595=-0x12*_0x35313e*_0x1c2501,_0xa27d58=-0x2*_0x8781fb*_0x5708f2,_0x56bc71=-0x2*_0x8781fb*(_0x5f327e-_0x180c42),_0x2cacab=0x2*_0x297871*_0x1d601c,_0x46670a=0x2*_0x297871*_0x139591,_0x243ebe=0x2*_0x4f457f*_0x1a7759,_0x3fcf5c=0x2*_0x4f457f*(_0x1a6ec9-_0x38426c),_0x57270d=-0x2*_0x838400*_0x9f9d05,_0x3e63ab=-0x2*_0x838400*(_0x1c3136-_0x101985),_0x3635c8=-0x2*_0x838400*(-0x15-0x9*_0x2c5882)*_0x579c11,_0x2e0554=0x2*_0x3cb928*_0x1ccd65,_0x329959=0x2*_0x3cb928*(_0x12f958-_0x26130a),_0x422a6f=-0x12*_0x3cb928*_0x579c11,_0x2770a1=-0x2*_0x4f457f*_0x472a94,_0x17b4c7=-0x2*_0x4f457f*(_0xa68cf4-_0x49502e);return{'snodm':_0x598f22,'cnodm':_0x1c12c4,'sinim':_0x5cb346,'cosim':_0x1bb75b,'sinomm':_0xb96ec,'cosomm':_0x419d05,'day':_0x3001a3,'e3':_0x46670a,'ee2':_0x2cacab,'em':_0x54678c,'emsq':_0x2c5882,'gam':_0x524f91,'peo':_0x1873a3,'pgho':_0x1792a5,'pho':_0x3e2d36,'pinco':_0x1889fc,'plo':_0xbace68,'rtemsq':_0x12f9e1,'se2':_0x134204,'se3':_0xb3fe76,'sgh2':_0x33dc75,'sgh3':_0x193573,'sgh4':_0x15a595,'sh2':_0xa27d58,'sh3':_0x56bc71,'si2':_0x3d3ced,'si3':_0x840ce1,'sl2':_0x9bf7e4,'sl3':_0x4d52e5,'sl4':_0x528cfc,'s1':_0x297871,'s2':_0x4f457f,'s3':_0x838400,'s4':_0x3cb928,'s5':_0x3c27ca,'s6':_0x1d601c,'s7':_0x139591,'ss1':_0x128d4d,'ss2':_0x8781fb,'ss3':_0x157ce1,'ss4':_0x35313e,'ss5':_0x162647,'ss6':_0x1ce051,'ss7':_0xd5292a,'sz1':_0x5e7332,'sz2':_0x208962,'sz3':_0x523aa3,'sz11':_0x2722a9,'sz12':_0x2bc051,'sz13':_0x312882,'sz21':_0x180c42,'sz22':_0x5708f2,'sz23':_0x5f327e,'sz31':_0x3c5ebb,'sz32':_0x36e06c,'sz33':_0x21b0db,'xgh2':_0x2e0554,'xgh3':_0x329959,'xgh4':_0x422a6f,'xh2':_0x2770a1,'xh3':_0x17b4c7,'xi2':_0x243ebe,'xi3':_0x3fcf5c,'xl2':_0x57270d,'xl3':_0x3e63ab,'xl4':_0x3635c8,'nm':_0x1342a0,'z1':_0x101985,'z2':_0x9f9d05,'z3':_0x1c3136,'z11':_0x38426c,'z12':_0x1a7759,'z13':_0x1a6ec9,'z21':_0x49502e,'z22':_0x472a94,'z23':_0xa68cf4,'z31':_0x26130a,'z32':_0x1ccd65,'z33':_0x12f958,'zmol':_0x84a89,'zmos':_0x4b12b9};}function dsinit(_0x50752a){var _0x14038a=_0x16ff71,_0x423439=_0x50752a['cosim'],_0x2d3339=_0x50752a['argpo'],_0x408b78=_0x50752a['s1'],_0x2d1e33=_0x50752a['s2'],_0xe63b5d=_0x50752a['s3'],_0x3a8337=_0x50752a['s4'],_0x551c3b=_0x50752a['s5'],_0x2e4a93=_0x50752a['sinim'],_0x4d6866=_0x50752a['ss1'],_0x4576ff=_0x50752a['ss2'],_0x109fa9=_0x50752a['ss3'],_0x128b7c=_0x50752a['ss4'],_0x2e8d8b=_0x50752a['ss5'],_0x45aafe=_0x50752a[_0x14038a(0x360)],_0x3ce8aa=_0x50752a[_0x14038a(0x1bc)],_0xc4e638=_0x50752a['sz11'],_0x51cf4e=_0x50752a[_0x14038a(0x313)],_0xbd0a37=_0x50752a['sz21'],_0x2ebc49=_0x50752a['sz23'],_0x2489ac=_0x50752a['sz31'],_0x45523c=_0x50752a[_0x14038a(0x273)],_0x50392a=_0x50752a['t'],_0x54e29f=_0x50752a['tc'],_0x268dc7=_0x50752a['gsto'],_0x16c13a=_0x50752a['mo'],_0x2c487f=_0x50752a['mdot'],_0x53e511=_0x50752a['no'],_0x424b38=_0x50752a[_0x14038a(0x322)],_0x244ff6=_0x50752a[_0x14038a(0x184)],_0xa213b2=_0x50752a['xpidot'],_0x23e7d5=_0x50752a['z1'],_0xcfd6dc=_0x50752a['z3'],_0x2fad08=_0x50752a[_0x14038a(0x1d8)],_0x33aea5=_0x50752a['z13'],_0x409038=_0x50752a['z21'],_0x45dbd9=_0x50752a['z23'],_0xb3cf14=_0x50752a['z31'],_0x46aef6=_0x50752a['z33'],_0x3f8b21=_0x50752a['ecco'],_0x5838a2=_0x50752a['eccsq'],_0x1b9536=_0x50752a['emsq'],_0x3ec637=_0x50752a['em'],_0x3f15cd=_0x50752a['argpm'],_0x509368=_0x50752a['inclm'],_0x584abe=_0x50752a['mm'],_0x3618b2=_0x50752a['nm'],_0x3252a9=_0x50752a[_0x14038a(0x203)],_0x2e6500=_0x50752a[_0x14038a(0x1aa)],_0x525b50=_0x50752a[_0x14038a(0x2b4)],_0x281e39=_0x50752a[_0x14038a(0x33f)],_0x428a7e=_0x50752a['d2211'],_0x204fba=_0x50752a['d3210'],_0x5a2c7d=_0x50752a['d3222'],_0x13fcd5=_0x50752a[_0x14038a(0x2e9)],_0x7315c0=_0x50752a[_0x14038a(0x21a)],_0x2e9bbc=_0x50752a['d5220'],_0x58affd=_0x50752a['d5232'],_0x26ede7=_0x50752a['d5421'],_0x4366dd=_0x50752a['d5433'],_0x3d1e40=_0x50752a['dedt'],_0xb6003e=_0x50752a['didt'],_0x11e06f=_0x50752a['dmdt'],_0x22bdfe=_0x50752a['dnodt'],_0x4a3fec=_0x50752a[_0x14038a(0x269)],_0x528cf4=_0x50752a[_0x14038a(0x212)],_0x3cae3d=_0x50752a['del2'],_0xe58cee=_0x50752a['del3'],_0x9e6369=_0x50752a['xfact'],_0xe93715=_0x50752a['xlamo'],_0x29bacd=_0x50752a['xli'],_0x3e4a8e=_0x50752a['xni'],_0x2fab78,_0x2f2e22,_0x19098b,_0x52a816,_0x450af5,_0x18a5e1,_0x5110a8,_0x41421e,_0x94e635,_0x2d78cb,_0x414b12,_0x3f2183,_0x2c8a40,_0x3f6b1f,_0x2ed27e,_0x3271f9,_0x4cfba6,_0x3bc5cb,_0x51bb8d,_0x5336e9,_0x591ad2,_0x109a4f,_0xf63e9e,_0x196e40,_0x287583,_0x3ef6cc,_0x38738c,_0x5571e4,_0x45ff78,_0x1a45a5,_0x768244,_0x3563e7,_0x5106b6=0.0000017891679,_0xa6b61b=0.0000021460748,_0x3bacb1=2.2123015e-7,_0x4f2d12=0.0000017891679,_0x50acf9=7.3636953e-9,_0x1fc74e=2.1765803e-9,_0x454dee=0.0043752690880113,_0x5ce82a=3.7393792e-7,_0x46169f=1.1428639e-7,_0x26f65a=0.00015835218,_0x21223f=0.0000119459;_0x2e6500=0x0;_0x3618b2<0.0052359877&&_0x3618b2>0.0034906585&&(_0x2e6500=0x1);_0x3618b2>=0.00826&&_0x3618b2<=0.00924&&_0x3ec637>=0.5&&(_0x2e6500=0x2);var _0x47e53d=_0x4d6866*_0x21223f*_0x2e8d8b,_0x3a8063=_0x4576ff*_0x21223f*(_0xc4e638+_0x51cf4e),_0x3f7385=-_0x21223f*_0x109fa9*(_0x45aafe+_0x3ce8aa-0xe-0x6*_0x1b9536),_0x41e7f6=_0x128b7c*_0x21223f*(_0x2489ac+_0x45523c-0x6),_0x21c16e=-_0x21223f*_0x4576ff*(_0xbd0a37+_0x2ebc49);(_0x509368<0.052359877||_0x509368>pi-0.052359877)&&(_0x21c16e=0x0);_0x2e4a93!==0x0&&(_0x21c16e/=_0x2e4a93);var _0x46b57e=_0x41e7f6-_0x423439*_0x21c16e;_0x3d1e40=_0x47e53d+_0x408b78*_0x26f65a*_0x551c3b,_0xb6003e=_0x3a8063+_0x2d1e33*_0x26f65a*(_0x2fad08+_0x33aea5),_0x11e06f=_0x3f7385-_0x26f65a*_0xe63b5d*(_0x23e7d5+_0xcfd6dc-0xe-0x6*_0x1b9536);var _0x144554=_0x3a8337*_0x26f65a*(_0xb3cf14+_0x46aef6-0x6),_0x876d37=-_0x26f65a*_0x2d1e33*(_0x409038+_0x45dbd9);(_0x509368<0.052359877||_0x509368>pi-0.052359877)&&(_0x876d37=0x0);_0x4a3fec=_0x46b57e+_0x144554,_0x22bdfe=_0x21c16e;_0x2e4a93!==0x0&&(_0x4a3fec-=_0x423439/_0x2e4a93*_0x876d37,_0x22bdfe+=_0x876d37/_0x2e4a93);var _0x28b084=0x0,_0x4f582b=(_0x268dc7+_0x54e29f*_0x454dee)%twoPi;_0x3ec637+=_0x3d1e40*_0x50392a,_0x509368+=_0xb6003e*_0x50392a,_0x3f15cd+=_0x4a3fec*_0x50392a,_0x3252a9+=_0x22bdfe*_0x50392a,_0x584abe+=_0x11e06f*_0x50392a;if(_0x2e6500!==0x0){_0x1a45a5=Math['pow'](_0x3618b2/xke,x2o3);if(_0x2e6500===0x2){_0x768244=_0x423439*_0x423439;var _0x403535=_0x3ec637;_0x3ec637=_0x3f8b21;var _0x409425=_0x1b9536;_0x1b9536=_0x5838a2,_0x3563e7=_0x3ec637*_0x1b9536,_0x3f6b1f=-0.306-(_0x3ec637-0.64)*0.44,_0x3ec637<=0.65?(_0x2ed27e=3.616-13.247*_0x3ec637+16.29*_0x1b9536,_0x4cfba6=-19.302+117.39*_0x3ec637-228.419*_0x1b9536+156.591*_0x3563e7,_0x3bc5cb=-18.9068+109.7927*_0x3ec637-214.6334*_0x1b9536+146.5816*_0x3563e7,_0x51bb8d=-41.122+242.694*_0x3ec637-471.094*_0x1b9536+313.953*_0x3563e7,_0x5336e9=-146.407+841.88*_0x3ec637-1629.014*_0x1b9536+1083.435*_0x3563e7,_0x591ad2=-532.114+3017.977*_0x3ec637-5740.032*_0x1b9536+3708.276*_0x3563e7):(_0x2ed27e=-72.099+331.819*_0x3ec637-508.738*_0x1b9536+266.724*_0x3563e7,_0x4cfba6=-346.844+1582.851*_0x3ec637-2415.925*_0x1b9536+1246.113*_0x3563e7,_0x3bc5cb=-342.585+1554.908*_0x3ec637-2366.899*_0x1b9536+1215.972*_0x3563e7,_0x51bb8d=-1052.797+4758.686*_0x3ec637-7193.992*_0x1b9536+3651.957*_0x3563e7,_0x5336e9=-3581.69+16178.11*_0x3ec637-24462.77*_0x1b9536+12422.52*_0x3563e7,_0x3ec637>0.715?_0x591ad2=-5149.66+29936.92*_0x3ec637-54087.36*_0x1b9536+31324.56*_0x3563e7:_0x591ad2=1464.74-4664.75*_0x3ec637+3763.64*_0x1b9536),_0x3ec637<0.7?(_0x196e40=-919.2277+4988.61*_0x3ec637-9064.77*_0x1b9536+5542.21*_0x3563e7,_0x109a4f=-822.71072+4568.6173*_0x3ec637-8491.4146*_0x1b9536+5337.524*_0x3563e7,_0xf63e9e=-853.666+4690.25*_0x3ec637-8624.77*_0x1b9536+5341.4*_0x3563e7):(_0x196e40=-37995.78+161616.52*_0x3ec637-229838.2*_0x1b9536+109377.94*_0x3563e7,_0x109a4f=-51752.104+218913.95*_0x3ec637-309468.16*_0x1b9536+146349.42*_0x3563e7,_0xf63e9e=-40023.88+170470.89*_0x3ec637-242699.48*_0x1b9536+115605.82*_0x3563e7),_0x287583=_0x2e4a93*_0x2e4a93,_0x2fab78=0.75*(0x1+0x2*_0x423439+_0x768244),_0x2f2e22=1.5*_0x287583,_0x52a816=1.875*_0x2e4a93*(0x1-0x2*_0x423439-0x3*_0x768244),_0x450af5=-1.875*_0x2e4a93*(0x1+0x2*_0x423439-0x3*_0x768244),_0x5110a8=0x23*_0x287583*_0x2fab78,_0x41421e=39.375*_0x287583*_0x287583,_0x94e635=9.84375*_0x2e4a93*(_0x287583*(0x1-0x2*_0x423439-0x5*_0x768244)+0.33333333*(-0x2+0x4*_0x423439+0x6*_0x768244)),_0x2d78cb=_0x2e4a93*(4.92187512*_0x287583*(-0x2-0x4*_0x423439+0xa*_0x768244)+6.56250012*(0x1+0x2*_0x423439-0x3*_0x768244)),_0x414b12=29.53125*_0x2e4a93*(0x2-0x8*_0x423439+_0x768244*(-0xc+0x8*_0x423439+0xa*_0x768244)),_0x3f2183=29.53125*_0x2e4a93*(-0x2-0x8*_0x423439+_0x768244*(0xc+0x8*_0x423439-0xa*_0x768244)),_0x5571e4=_0x3618b2*_0x3618b2,_0x45ff78=_0x1a45a5*_0x1a45a5,_0x38738c=0x3*_0x5571e4*_0x45ff78,_0x3ef6cc=_0x38738c*_0x4f2d12,_0x281e39=_0x3ef6cc*_0x2fab78*_0x3f6b1f,_0x428a7e=_0x3ef6cc*_0x2f2e22*_0x2ed27e,_0x38738c*=_0x1a45a5,_0x3ef6cc=_0x38738c*_0x5ce82a,_0x204fba=_0x3ef6cc*_0x52a816*_0x4cfba6,_0x5a2c7d=_0x3ef6cc*_0x450af5*_0x3bc5cb,_0x38738c*=_0x1a45a5,_0x3ef6cc=0x2*_0x38738c*_0x50acf9,_0x13fcd5=_0x3ef6cc*_0x5110a8*_0x51bb8d,_0x7315c0=_0x3ef6cc*_0x41421e*_0x5336e9,_0x38738c*=_0x1a45a5,_0x3ef6cc=_0x38738c*_0x46169f,_0x2e9bbc=_0x3ef6cc*_0x94e635*_0x591ad2,_0x58affd=_0x3ef6cc*_0x2d78cb*_0xf63e9e,_0x3ef6cc=0x2*_0x38738c*_0x1fc74e,_0x26ede7=_0x3ef6cc*_0x414b12*_0x109a4f,_0x4366dd=_0x3ef6cc*_0x3f2183*_0x196e40,_0xe93715=(_0x16c13a+_0x424b38+_0x424b38-(_0x4f582b+_0x4f582b))%twoPi,_0x9e6369=_0x2c487f+_0x11e06f+0x2*(_0x244ff6+_0x22bdfe-_0x454dee)-_0x53e511,_0x3ec637=_0x403535,_0x1b9536=_0x409425;}_0x2e6500===0x1&&(_0x2c8a40=0x1+_0x1b9536*(-2.5+0.8125*_0x1b9536),_0x4cfba6=0x1+0x2*_0x1b9536,_0x3271f9=0x1+_0x1b9536*(-0x6+6.60937*_0x1b9536),_0x2fab78=0.75*(0x1+_0x423439)*(0x1+_0x423439),_0x19098b=0.9375*_0x2e4a93*_0x2e4a93*(0x1+0x3*_0x423439)-0.75*(0x1+_0x423439),_0x18a5e1=0x1+_0x423439,_0x18a5e1*=1.875*_0x18a5e1*_0x18a5e1,_0x528cf4=0x3*_0x3618b2*_0x3618b2*_0x1a45a5*_0x1a45a5,_0x3cae3d=0x2*_0x528cf4*_0x2fab78*_0x2c8a40*_0x5106b6,_0xe58cee=0x3*_0x528cf4*_0x18a5e1*_0x3271f9*_0x3bacb1*_0x1a45a5,_0x528cf4=_0x528cf4*_0x19098b*_0x4cfba6*_0xa6b61b*_0x1a45a5,_0xe93715=(_0x16c13a+_0x424b38+_0x2d3339-_0x4f582b)%twoPi,_0x9e6369=_0x2c487f+_0xa213b2+_0x11e06f+_0x4a3fec+_0x22bdfe-(_0x53e511+_0x454dee)),_0x29bacd=_0xe93715,_0x3e4a8e=_0x53e511,_0x525b50=0x0,_0x3618b2=_0x53e511+_0x28b084;}return{'em':_0x3ec637,'argpm':_0x3f15cd,'inclm':_0x509368,'mm':_0x584abe,'nm':_0x3618b2,'nodem':_0x3252a9,'irez':_0x2e6500,'atime':_0x525b50,'d2201':_0x281e39,'d2211':_0x428a7e,'d3210':_0x204fba,'d3222':_0x5a2c7d,'d4410':_0x13fcd5,'d4422':_0x7315c0,'d5220':_0x2e9bbc,'d5232':_0x58affd,'d5421':_0x26ede7,'d5433':_0x4366dd,'dedt':_0x3d1e40,'didt':_0xb6003e,'dmdt':_0x11e06f,'dndt':_0x28b084,'dnodt':_0x22bdfe,'domdt':_0x4a3fec,'del1':_0x528cf4,'del2':_0x3cae3d,'del3':_0xe58cee,'xfact':_0x9e6369,'xlamo':_0xe93715,'xli':_0x29bacd,'xni':_0x3e4a8e};}function gstimeInternal(_0xfec931){var _0x19fbda=(_0xfec931-0x256859)/0x8ead,_0x1fe3cc=-0.0000062*_0x19fbda*_0x19fbda*_0x19fbda+0.093104*_0x19fbda*_0x19fbda+(0xd6038*0xe10+8640184.812866)*_0x19fbda+67310.54841;return _0x1fe3cc=_0x1fe3cc*deg2rad/0xf0%twoPi,_0x1fe3cc<0x0&&(_0x1fe3cc+=twoPi),_0x1fe3cc;}function gstime(){var _0x3c8a3a=_0x16ff71;if((arguments['length']<=0x0?undefined:arguments[0x0])instanceof Date||arguments['length']>0x1)return gstimeInternal(jday[_0x3c8a3a(0x26b)](void 0x0,arguments));return gstimeInternal['apply'](void 0x0,arguments);}function initl(_0x32eecd){var _0x327242=_0x16ff71,_0x151fdd=_0x32eecd['ecco'],_0x1e9737=_0x32eecd[_0x327242(0x302)],_0x4c09c9=_0x32eecd['inclo'],_0x1ff5f3=_0x32eecd['opsmode'],_0xa04a13=_0x32eecd['no'],_0x1a050=_0x151fdd*_0x151fdd,_0x3a4147=0x1-_0x1a050,_0x590804=Math[_0x327242(0x1d2)](_0x3a4147),_0x60efe8=Math['cos'](_0x4c09c9),_0x455bc2=_0x60efe8*_0x60efe8,_0x461e2c=Math[_0x327242(0x22c)](xke/_0xa04a13,x2o3),_0x2c0d7a=0.75*j2*(0x3*_0x455bc2-0x1)/(_0x590804*_0x3a4147),_0x1749da=_0x2c0d7a/(_0x461e2c*_0x461e2c),_0x3877e3=_0x461e2c*(0x1-_0x1749da*_0x1749da-_0x1749da*(0x1/0x3+0x86*_0x1749da*_0x1749da/0x51));_0x1749da=_0x2c0d7a/(_0x3877e3*_0x3877e3),_0xa04a13/=0x1+_0x1749da;var _0x3d8134=Math['pow'](xke/_0xa04a13,x2o3),_0x5ad488=Math[_0x327242(0x226)](_0x4c09c9),_0x3a861f=_0x3d8134*_0x3a4147,_0x3ce33c=0x1-0x5*_0x455bc2,_0x4d2122=-_0x3ce33c-_0x455bc2-_0x455bc2,_0x1d743f=0x1/_0x3d8134,_0x5db130=_0x3a861f*_0x3a861f,_0x4e861c=_0x3d8134*(0x1-_0x151fdd),_0x5a65bf='n',_0x16e5a0;if(_0x1ff5f3==='a'){var _0xe909cf=_0x1e9737-0x1c89,_0x25a51c=Math['floor'](_0xe909cf+1e-8),_0x2dab2f=_0xe909cf-_0x25a51c,_0x43e2c0=0.017202791694070362,_0xe95bff=1.7321343856509375,_0xf55af2=5.075514194322695e-15,_0x566e35=_0x43e2c0+twoPi;_0x16e5a0=(_0xe95bff+_0x43e2c0*_0x25a51c+_0x566e35*_0x2dab2f+_0xe909cf*_0xe909cf*_0xf55af2)%twoPi,_0x16e5a0<0x0&&(_0x16e5a0+=twoPi);}else _0x16e5a0=gstime(_0x1e9737+2433281.5);return{'no':_0xa04a13,'method':_0x5a65bf,'ainv':_0x1d743f,'ao':_0x3d8134,'con41':_0x4d2122,'con42':_0x3ce33c,'cosio':_0x60efe8,'cosio2':_0x455bc2,'eccsq':_0x1a050,'omeosq':_0x3a4147,'posq':_0x5db130,'rp':_0x4e861c,'rteosq':_0x590804,'sinio':_0x5ad488,'gsto':_0x16e5a0};}function dspace(_0x5a5c80){var _0x11baeb=_0x16ff71,_0x4550c5=_0x5a5c80[_0x11baeb(0x1aa)],_0x1ebe71=_0x5a5c80['d2201'],_0x6b2152=_0x5a5c80['d2211'],_0x1c6c79=_0x5a5c80[_0x11baeb(0x2ca)],_0x4359ba=_0x5a5c80[_0x11baeb(0x372)],_0x32e70d=_0x5a5c80['d4410'],_0x250ae5=_0x5a5c80['d4422'],_0x58f01d=_0x5a5c80[_0x11baeb(0x2ac)],_0x429760=_0x5a5c80['d5232'],_0x462c11=_0x5a5c80['d5421'],_0x20087f=_0x5a5c80['d5433'],_0x3acd7c=_0x5a5c80['dedt'],_0x434981=_0x5a5c80['del1'],_0x2db96a=_0x5a5c80['del2'],_0x1541af=_0x5a5c80['del3'],_0x4813ba=_0x5a5c80[_0x11baeb(0x16e)],_0x40935a=_0x5a5c80['dmdt'],_0x1fc9bc=_0x5a5c80['dnodt'],_0x40ab16=_0x5a5c80[_0x11baeb(0x269)],_0x16ce82=_0x5a5c80['argpo'],_0x58a09f=_0x5a5c80['argpdot'],_0x4ced75=_0x5a5c80['t'],_0x243aaf=_0x5a5c80['tc'],_0x412aa3=_0x5a5c80['gsto'],_0x59dcc4=_0x5a5c80['xfact'],_0x1a7ceb=_0x5a5c80[_0x11baeb(0x356)],_0x25b557=_0x5a5c80['no'],_0x25cb14=_0x5a5c80[_0x11baeb(0x2b4)],_0x5eed19=_0x5a5c80['em'],_0x2358aa=_0x5a5c80[_0x11baeb(0x26c)],_0x1e90ef=_0x5a5c80[_0x11baeb(0x312)],_0x53370b=_0x5a5c80['xli'],_0x579f0e=_0x5a5c80['mm'],_0xb4758b=_0x5a5c80['xni'],_0x46a6f1=_0x5a5c80[_0x11baeb(0x203)],_0x3dd9b7=_0x5a5c80['nm'],_0x63a684=0.13130908,_0x221c56=2.8843198,_0x17f4dc=0.37448087,_0x47d691=5.7686396,_0xaf15dc=0.95240898,_0x15fcd7=1.8014998,_0x5c7238=1.050833,_0xb45f6a=4.4108898,_0x48e09d=0.0043752690880113,_0x34755a=0x2d0,_0x5d9de9=-0x2d0,_0x4c4126=0x3f480,_0x200f73,_0x3d3d3f,_0x56c7ee,_0x30d3b0,_0x5c12f1,_0x34b324,_0x40d1e0,_0x52eb23,_0x52ca51=0x0,_0x4d61a2=0x0,_0x494c9d=(_0x412aa3+_0x243aaf*_0x48e09d)%twoPi;_0x5eed19+=_0x3acd7c*_0x4ced75,_0x1e90ef+=_0x4813ba*_0x4ced75,_0x2358aa+=_0x40ab16*_0x4ced75,_0x46a6f1+=_0x1fc9bc*_0x4ced75,_0x579f0e+=_0x40935a*_0x4ced75;if(_0x4550c5!==0x0){(_0x25cb14===0x0||_0x4ced75*_0x25cb14<=0x0||Math['abs'](_0x4ced75)0x0?_0x200f73=_0x34755a:_0x200f73=_0x5d9de9;var _0x5595c5=0x17d;while(_0x5595c5===0x17d){_0x4550c5!==0x2?(_0x40d1e0=_0x434981*Math['sin'](_0x53370b-_0x63a684)+_0x2db96a*Math[_0x11baeb(0x226)](0x2*(_0x53370b-_0x221c56))+_0x1541af*Math[_0x11baeb(0x226)](0x3*(_0x53370b-_0x17f4dc)),_0x5c12f1=_0xb4758b+_0x59dcc4,_0x34b324=_0x434981*Math[_0x11baeb(0x2dd)](_0x53370b-_0x63a684)+0x2*_0x2db96a*Math[_0x11baeb(0x2dd)](0x2*(_0x53370b-_0x221c56))+0x3*_0x1541af*Math['cos'](0x3*(_0x53370b-_0x17f4dc)),_0x34b324*=_0x5c12f1):(_0x52eb23=_0x16ce82+_0x58a09f*_0x25cb14,_0x56c7ee=_0x52eb23+_0x52eb23,_0x3d3d3f=_0x53370b+_0x53370b,_0x40d1e0=_0x1ebe71*Math['sin'](_0x56c7ee+_0x53370b-_0x47d691)+_0x6b2152*Math[_0x11baeb(0x226)](_0x53370b-_0x47d691)+_0x1c6c79*Math['sin'](_0x52eb23+_0x53370b-_0xaf15dc)+_0x4359ba*Math[_0x11baeb(0x226)](-_0x52eb23+_0x53370b-_0xaf15dc)+_0x32e70d*Math[_0x11baeb(0x226)](_0x56c7ee+_0x3d3d3f-_0x15fcd7)+_0x250ae5*Math['sin'](_0x3d3d3f-_0x15fcd7)+_0x58f01d*Math[_0x11baeb(0x226)](_0x52eb23+_0x53370b-_0x5c7238)+_0x429760*Math['sin'](-_0x52eb23+_0x53370b-_0x5c7238)+_0x462c11*Math['sin'](_0x52eb23+_0x3d3d3f-_0xb45f6a)+_0x20087f*Math['sin'](-_0x52eb23+_0x3d3d3f-_0xb45f6a),_0x5c12f1=_0xb4758b+_0x59dcc4,_0x34b324=_0x1ebe71*Math['cos'](_0x56c7ee+_0x53370b-_0x47d691)+_0x6b2152*Math[_0x11baeb(0x2dd)](_0x53370b-_0x47d691)+_0x1c6c79*Math[_0x11baeb(0x2dd)](_0x52eb23+_0x53370b-_0xaf15dc)+_0x4359ba*Math['cos'](-_0x52eb23+_0x53370b-_0xaf15dc)+_0x58f01d*Math['cos'](_0x52eb23+_0x53370b-_0x5c7238)+_0x429760*Math['cos'](-_0x52eb23+_0x53370b-_0x5c7238)+0x2*_0x32e70d*Math[_0x11baeb(0x2dd)](_0x56c7ee+_0x3d3d3f-_0x15fcd7)+_0x250ae5*Math[_0x11baeb(0x2dd)](_0x3d3d3f-_0x15fcd7)+_0x462c11*Math['cos'](_0x52eb23+_0x3d3d3f-_0xb45f6a)+_0x20087f*Math[_0x11baeb(0x2dd)](-_0x52eb23+_0x3d3d3f-_0xb45f6a),_0x34b324*=_0x5c12f1),Math['abs'](_0x4ced75-_0x25cb14)>=_0x34755a?_0x5595c5=0x17d:(_0x4d61a2=_0x4ced75-_0x25cb14,_0x5595c5=0x0),_0x5595c5===0x17d&&(_0x53370b+=_0x5c12f1*_0x200f73+_0x40d1e0*_0x4c4126,_0xb4758b+=_0x40d1e0*_0x200f73+_0x34b324*_0x4c4126,_0x25cb14+=_0x200f73);}_0x3dd9b7=_0xb4758b+_0x40d1e0*_0x4d61a2+_0x34b324*_0x4d61a2*_0x4d61a2*0.5,_0x30d3b0=_0x53370b+_0x5c12f1*_0x4d61a2+_0x40d1e0*_0x4d61a2*_0x4d61a2*0.5,_0x4550c5!==0x1?(_0x579f0e=_0x30d3b0-0x2*_0x46a6f1+0x2*_0x494c9d,_0x52ca51=_0x3dd9b7-_0x25b557):(_0x579f0e=_0x30d3b0-_0x46a6f1-_0x2358aa+_0x494c9d,_0x52ca51=_0x3dd9b7-_0x25b557),_0x3dd9b7=_0x25b557+_0x52ca51;}return{'atime':_0x25cb14,'em':_0x5eed19,'argpm':_0x2358aa,'inclm':_0x1e90ef,'xli':_0x53370b,'mm':_0x579f0e,'xni':_0xb4758b,'nodem':_0x46a6f1,'dndt':_0x52ca51,'nm':_0x3dd9b7};}function sgp4(_0x2c2257,_0x2d1caf){var _0x165255=_0x16ff71,_0x174eb0,_0x291637,_0x369b84,_0x4ec03b,_0x151e1e,_0x470a84,_0x2ea33b,_0x268547,_0x541a48,_0x2be160,_0x255747,_0x5a303b,_0x257c44,_0x54c342,_0x351384,_0x49ad32,_0x2e7727,_0x5dd1df,_0x106923,_0x48b711,_0x1fdc19,_0x723729,_0x5a6b6d,_0x2a4420,_0x4d48f7,_0xd7765c,_0xd4050,_0x597c65=1.5e-12;_0x2c2257['t']=_0x2d1caf,_0x2c2257['error']=0x0;var _0x55ece6=_0x2c2257['mo']+_0x2c2257[_0x165255(0x2a5)]*_0x2c2257['t'],_0x1baadb=_0x2c2257['argpo']+_0x2c2257['argpdot']*_0x2c2257['t'],_0x31199a=_0x2c2257['nodeo']+_0x2c2257['nodedot']*_0x2c2257['t'];_0x541a48=_0x1baadb,_0x1fdc19=_0x55ece6;var _0x3bd6bc=_0x2c2257['t']*_0x2c2257['t'];_0x5a6b6d=_0x31199a+_0x2c2257[_0x165255(0x374)]*_0x3bd6bc,_0x2e7727=0x1-_0x2c2257[_0x165255(0x37b)]*_0x2c2257['t'],_0x5dd1df=_0x2c2257['bstar']*_0x2c2257[_0x165255(0x187)]*_0x2c2257['t'],_0x106923=_0x2c2257['t2cof']*_0x3bd6bc;if(_0x2c2257['isimp']!==0x1){_0x2ea33b=_0x2c2257['omgcof']*_0x2c2257['t'];var _0x4f7939=0x1+_0x2c2257['eta']*Math['cos'](_0x55ece6);_0x470a84=_0x2c2257['xmcof']*(_0x4f7939*_0x4f7939*_0x4f7939-_0x2c2257[_0x165255(0x371)]),_0x49ad32=_0x2ea33b+_0x470a84,_0x1fdc19=_0x55ece6+_0x49ad32,_0x541a48=_0x1baadb-_0x49ad32,_0x5a303b=_0x3bd6bc*_0x2c2257['t'],_0x257c44=_0x5a303b*_0x2c2257['t'],_0x2e7727=_0x2e7727-_0x2c2257['d2']*_0x3bd6bc-_0x2c2257['d3']*_0x5a303b-_0x2c2257['d4']*_0x257c44,_0x5dd1df+=_0x2c2257['bstar']*_0x2c2257[_0x165255(0x20c)]*(Math['sin'](_0x1fdc19)-_0x2c2257['sinmao']),_0x106923=_0x106923+_0x2c2257[_0x165255(0x17c)]*_0x5a303b+_0x257c44*(_0x2c2257[_0x165255(0x211)]+_0x2c2257['t']*_0x2c2257['t5cof']);}_0x723729=_0x2c2257['no'];var _0x4feba2=_0x2c2257['ecco'];_0x48b711=_0x2c2257[_0x165255(0x18d)];if(_0x2c2257[_0x165255(0x1fd)]==='d'){_0x54c342=_0x2c2257['t'];var _0x1a566f={'irez':_0x2c2257[_0x165255(0x1aa)],'d2201':_0x2c2257['d2201'],'d2211':_0x2c2257['d2211'],'d3210':_0x2c2257['d3210'],'d3222':_0x2c2257['d3222'],'d4410':_0x2c2257['d4410'],'d4422':_0x2c2257['d4422'],'d5220':_0x2c2257['d5220'],'d5232':_0x2c2257['d5232'],'d5421':_0x2c2257['d5421'],'d5433':_0x2c2257[_0x165255(0x252)],'dedt':_0x2c2257['dedt'],'del1':_0x2c2257[_0x165255(0x212)],'del2':_0x2c2257['del2'],'del3':_0x2c2257['del3'],'didt':_0x2c2257[_0x165255(0x16e)],'dmdt':_0x2c2257[_0x165255(0x379)],'dnodt':_0x2c2257[_0x165255(0x166)],'domdt':_0x2c2257['domdt'],'argpo':_0x2c2257[_0x165255(0x26e)],'argpdot':_0x2c2257['argpdot'],'t':_0x2c2257['t'],'tc':_0x54c342,'gsto':_0x2c2257[_0x165255(0x1c2)],'xfact':_0x2c2257['xfact'],'xlamo':_0x2c2257['xlamo'],'no':_0x2c2257['no'],'atime':_0x2c2257['atime'],'em':_0x4feba2,'argpm':_0x541a48,'inclm':_0x48b711,'xli':_0x2c2257['xli'],'mm':_0x1fdc19,'xni':_0x2c2257['xni'],'nodem':_0x5a6b6d,'nm':_0x723729},_0x5e339a=dspace(_0x1a566f);_0x4feba2=_0x5e339a['em'],_0x541a48=_0x5e339a[_0x165255(0x26c)],_0x48b711=_0x5e339a['inclm'],_0x1fdc19=_0x5e339a['mm'],_0x5a6b6d=_0x5e339a[_0x165255(0x203)],_0x723729=_0x5e339a['nm'];}if(_0x723729<=0x0)return _0x2c2257['error']=0x2,[![],![]];var _0x396c53=Math['pow'](xke/_0x723729,x2o3)*_0x2e7727*_0x2e7727;_0x723729=xke/Math['pow'](_0x396c53,1.5),_0x4feba2-=_0x5dd1df;if(_0x4feba2>=0x1||_0x4feba2<-0.001)return _0x2c2257['error']=0x1,[![],![]];_0x4feba2<0.000001&&(_0x4feba2=0.000001);_0x1fdc19+=_0x2c2257['no']*_0x106923,_0x4d48f7=_0x1fdc19+_0x541a48+_0x5a6b6d,_0x5a6b6d%=twoPi,_0x541a48%=twoPi,_0x4d48f7%=twoPi,_0x1fdc19=(_0x4d48f7-_0x541a48-_0x5a6b6d)%twoPi;var _0x108293=Math['sin'](_0x48b711),_0xc8d33c=Math[_0x165255(0x2dd)](_0x48b711),_0x545ef4=_0x4feba2;_0x2a4420=_0x48b711,_0x2be160=_0x541a48,_0xd4050=_0x5a6b6d,_0xd7765c=_0x1fdc19,_0x4ec03b=_0x108293,_0x369b84=_0xc8d33c;if(_0x2c2257['method']==='d'){var _0x156b14={'inclo':_0x2c2257['inclo'],'init':'n','ep':_0x545ef4,'inclp':_0x2a4420,'nodep':_0xd4050,'argpp':_0x2be160,'mp':_0xd7765c,'opsmode':_0x2c2257['operationmode']},_0x54addb=dpper(_0x2c2257,_0x156b14);_0x545ef4=_0x54addb['ep'],_0xd4050=_0x54addb['nodep'],_0x2be160=_0x54addb['argpp'],_0xd7765c=_0x54addb['mp'],_0x2a4420=_0x54addb['inclp'];_0x2a4420<0x0&&(_0x2a4420=-_0x2a4420,_0xd4050+=pi,_0x2be160-=pi);if(_0x545ef4<0x0||_0x545ef4>0x1)return _0x2c2257['error']=0x3,[![],![]];}_0x2c2257['method']==='d'&&(_0x4ec03b=Math['sin'](_0x2a4420),_0x369b84=Math['cos'](_0x2a4420),_0x2c2257['aycof']=-0.5*j3oj2*_0x4ec03b,Math['abs'](_0x369b84+0x1)>1.5e-12?_0x2c2257['xlcof']=-0.25*j3oj2*_0x4ec03b*(0x3+0x5*_0x369b84)/(0x1+_0x369b84):_0x2c2257[_0x165255(0x153)]=-0.25*j3oj2*_0x4ec03b*(0x3+0x5*_0x369b84)/_0x597c65);var _0x1ffce2=_0x545ef4*Math[_0x165255(0x2dd)](_0x2be160);_0x49ad32=0x1/(_0x396c53*(0x1-_0x545ef4*_0x545ef4));var _0x5b0771=_0x545ef4*Math['sin'](_0x2be160)+_0x49ad32*_0x2c2257['aycof'],_0x3ba47f=_0xd7765c+_0x2be160+_0xd4050+_0x49ad32*_0x2c2257['xlcof']*_0x1ffce2,_0x43edfc=(_0x3ba47f-_0xd4050)%twoPi;_0x268547=_0x43edfc,_0x351384=9999.9;var _0x4790bd=0x1;while(Math['abs'](_0x351384)>=1e-12&&_0x4790bd<=0xa){_0x291637=Math['sin'](_0x268547),_0x174eb0=Math['cos'](_0x268547),_0x351384=0x1-_0x174eb0*_0x1ffce2-_0x291637*_0x5b0771,_0x351384=(_0x43edfc-_0x5b0771*_0x174eb0+_0x1ffce2*_0x291637-_0x268547)/_0x351384,Math['abs'](_0x351384)>=0.95&&(_0x351384>0x0?_0x351384=0.95:_0x351384=-0.95),_0x268547+=_0x351384,_0x4790bd+=0x1;}var _0x9770d7=_0x1ffce2*_0x174eb0+_0x5b0771*_0x291637,_0x37659d=_0x1ffce2*_0x291637-_0x5b0771*_0x174eb0,_0x71bb56=_0x1ffce2*_0x1ffce2+_0x5b0771*_0x5b0771,_0x4a09e4=_0x396c53*(0x1-_0x71bb56);if(_0x4a09e4<0x0)return _0x2c2257[_0x165255(0x1ed)]=0x4,[![],![]];var _0x570dde=_0x396c53*(0x1-_0x9770d7),_0x42f1cc=Math[_0x165255(0x1d2)](_0x396c53)*_0x37659d/_0x570dde,_0x44ddfc=Math['sqrt'](_0x4a09e4)/_0x570dde,_0x254209=Math['sqrt'](0x1-_0x71bb56);_0x49ad32=_0x37659d/(0x1+_0x254209);var _0x2f8f09=_0x396c53/_0x570dde*(_0x291637-_0x5b0771-_0x1ffce2*_0x49ad32),_0x50d7f7=_0x396c53/_0x570dde*(_0x174eb0-_0x1ffce2+_0x5b0771*_0x49ad32);_0x255747=Math[_0x165255(0x1e8)](_0x2f8f09,_0x50d7f7);var _0x3f595b=(_0x50d7f7+_0x50d7f7)*_0x2f8f09,_0x546017=0x1-0x2*_0x2f8f09*_0x2f8f09;_0x49ad32=0x1/_0x4a09e4;var _0x240d6e=0.5*j2*_0x49ad32,_0x15647f=_0x240d6e*_0x49ad32;_0x2c2257['method']==='d'&&(_0x151e1e=_0x369b84*_0x369b84,_0x2c2257[_0x165255(0x182)]=0x3*_0x151e1e-0x1,_0x2c2257['x1mth2']=0x1-_0x151e1e,_0x2c2257['x7thm1']=0x7*_0x151e1e-0x1);var _0x43a395=_0x570dde*(0x1-1.5*_0x15647f*_0x254209*_0x2c2257[_0x165255(0x182)])+0.5*_0x240d6e*_0x2c2257['x1mth2']*_0x546017;if(_0x43a395<0x1)return _0x2c2257[_0x165255(0x1ed)]=0x6,{'position':![],'velocity':![]};_0x255747-=0.25*_0x15647f*_0x2c2257[_0x165255(0x2c0)]*_0x3f595b;var _0x279ddb=_0xd4050+1.5*_0x15647f*_0x369b84*_0x3f595b,_0x2e3e15=_0x2a4420+1.5*_0x15647f*_0x369b84*_0x4ec03b*_0x546017,_0xbc13d=_0x42f1cc-_0x723729*_0x240d6e*_0x2c2257['x1mth2']*_0x3f595b/xke,_0xe6fecf=_0x44ddfc+_0x723729*_0x240d6e*(_0x2c2257[_0x165255(0x357)]*_0x546017+1.5*_0x2c2257[_0x165255(0x182)])/xke,_0x50b77e=Math[_0x165255(0x226)](_0x255747),_0x540d7e=Math[_0x165255(0x2dd)](_0x255747),_0x5bb054=Math['sin'](_0x279ddb),_0x4048c4=Math['cos'](_0x279ddb),_0x244ffd=Math['sin'](_0x2e3e15),_0x231ddb=Math['cos'](_0x2e3e15),_0x1f71c7=-_0x5bb054*_0x231ddb,_0x4ce021=_0x4048c4*_0x231ddb,_0x4636ac=_0x1f71c7*_0x50b77e+_0x4048c4*_0x540d7e,_0x467022=_0x4ce021*_0x50b77e+_0x5bb054*_0x540d7e,_0x1dd67a=_0x244ffd*_0x50b77e,_0x40b0bf=_0x1f71c7*_0x540d7e-_0x4048c4*_0x50b77e,_0x539589=_0x4ce021*_0x540d7e-_0x5bb054*_0x50b77e,_0x20e325=_0x244ffd*_0x540d7e,_0x4c7766={'x':_0x43a395*_0x4636ac*earthRadius,'y':_0x43a395*_0x467022*earthRadius,'z':_0x43a395*_0x1dd67a*earthRadius},_0x36c835={'x':(_0xbc13d*_0x4636ac+_0xe6fecf*_0x40b0bf)*vkmpersec,'y':(_0xbc13d*_0x467022+_0xe6fecf*_0x539589)*vkmpersec,'z':(_0xbc13d*_0x1dd67a+_0xe6fecf*_0x20e325)*vkmpersec};return{'position':_0x4c7766,'velocity':_0x36c835};}function sgp4init(_0x75dddd,_0x440a06){var _0x12cd66=_0x16ff71,_0xd145a9=_0x440a06['opsmode'],_0x4f6ec0=_0x440a06[_0x12cd66(0x1f4)],_0x1f8c26=_0x440a06[_0x12cd66(0x302)],_0x3e0c36=_0x440a06['xbstar'],_0x289b10=_0x440a06['xecco'],_0x25b781=_0x440a06['xargpo'],_0x18771e=_0x440a06['xinclo'],_0x54d276=_0x440a06['xmo'],_0x4199c8=_0x440a06['xno'],_0x2c173b=_0x440a06['xnodeo'],_0x28ae68,_0x38de07,_0x16533b,_0x32292f,_0x49b9a0,_0x261540,_0x81dcd,_0x17bc5a,_0x3276e0,_0x6dd7b2,_0x46447e,_0x909bc7,_0x229e63,_0x105e21,_0x2cd7f0,_0x3d19a6,_0x4cc4fe,_0x2762d3,_0x1af2c3,_0x44c4da,_0x11c6f9,_0x189867,_0x5e46a2,_0x3c2ac3,_0x5762ed,_0x4af6b0,_0xb96a7b,_0xa09960,_0xd1c7d7,_0x1dfc61,_0x38794c,_0x47dba2,_0x8f403e,_0x381aac,_0x1b2a6d,_0x39102b,_0x10e4c1,_0xa0658c,_0x5718b6,_0x5dae71,_0x54677f,_0x8e6ae7,_0x10d954,_0x58749a,_0xb4da2b,_0xd0c0e2,_0x3917f4,_0x3a74b5,_0x4005c9,_0xbd98f9,_0x5460b6,_0x4a23bb,_0x951238,_0x4fabbb,_0x4b2984,_0x521279,_0xb06742=1.5e-12;_0x75dddd[_0x12cd66(0x35f)]=0x0,_0x75dddd['method']='n',_0x75dddd['aycof']=0x0,_0x75dddd[_0x12cd66(0x182)]=0x0,_0x75dddd['cc1']=0x0,_0x75dddd[_0x12cd66(0x187)]=0x0,_0x75dddd['cc5']=0x0,_0x75dddd['d2']=0x0,_0x75dddd['d3']=0x0,_0x75dddd['d4']=0x0,_0x75dddd[_0x12cd66(0x371)]=0x0,_0x75dddd['eta']=0x0,_0x75dddd[_0x12cd66(0x237)]=0x0,_0x75dddd[_0x12cd66(0x1ac)]=0x0,_0x75dddd['sinmao']=0x0,_0x75dddd['t']=0x0,_0x75dddd['t2cof']=0x0,_0x75dddd[_0x12cd66(0x17c)]=0x0,_0x75dddd['t4cof']=0x0,_0x75dddd['t5cof']=0x0,_0x75dddd[_0x12cd66(0x357)]=0x0,_0x75dddd['x7thm1']=0x0,_0x75dddd[_0x12cd66(0x2a5)]=0x0,_0x75dddd['nodedot']=0x0,_0x75dddd['xlcof']=0x0,_0x75dddd['xmcof']=0x0,_0x75dddd['nodecf']=0x0,_0x75dddd['irez']=0x0,_0x75dddd[_0x12cd66(0x33f)]=0x0,_0x75dddd['d2211']=0x0,_0x75dddd['d3210']=0x0,_0x75dddd['d3222']=0x0,_0x75dddd['d4410']=0x0,_0x75dddd['d4422']=0x0,_0x75dddd['d5220']=0x0,_0x75dddd['d5232']=0x0,_0x75dddd['d5421']=0x0,_0x75dddd[_0x12cd66(0x252)]=0x0,_0x75dddd[_0x12cd66(0x2cc)]=0x0,_0x75dddd['del1']=0x0,_0x75dddd['del2']=0x0,_0x75dddd['del3']=0x0,_0x75dddd['didt']=0x0,_0x75dddd['dmdt']=0x0,_0x75dddd['dnodt']=0x0,_0x75dddd['domdt']=0x0,_0x75dddd['e3']=0x0,_0x75dddd['ee2']=0x0,_0x75dddd['peo']=0x0,_0x75dddd['pgho']=0x0,_0x75dddd[_0x12cd66(0x2c4)]=0x0,_0x75dddd['pinco']=0x0,_0x75dddd['plo']=0x0,_0x75dddd[_0x12cd66(0x196)]=0x0,_0x75dddd[_0x12cd66(0x2ff)]=0x0,_0x75dddd[_0x12cd66(0x2e4)]=0x0,_0x75dddd['sgh3']=0x0,_0x75dddd['sgh4']=0x0,_0x75dddd[_0x12cd66(0x286)]=0x0,_0x75dddd['sh3']=0x0,_0x75dddd[_0x12cd66(0x350)]=0x0,_0x75dddd['si3']=0x0,_0x75dddd['sl2']=0x0,_0x75dddd['sl3']=0x0,_0x75dddd['sl4']=0x0,_0x75dddd['gsto']=0x0,_0x75dddd['xfact']=0x0,_0x75dddd['xgh2']=0x0,_0x75dddd['xgh3']=0x0,_0x75dddd[_0x12cd66(0x186)]=0x0,_0x75dddd['xh2']=0x0,_0x75dddd['xh3']=0x0,_0x75dddd['xi2']=0x0,_0x75dddd['xi3']=0x0,_0x75dddd[_0x12cd66(0x24e)]=0x0,_0x75dddd['xl3']=0x0,_0x75dddd['xl4']=0x0,_0x75dddd['xlamo']=0x0,_0x75dddd['zmol']=0x0,_0x75dddd['zmos']=0x0,_0x75dddd[_0x12cd66(0x2b4)]=0x0,_0x75dddd['xli']=0x0,_0x75dddd[_0x12cd66(0x279)]=0x0,_0x75dddd['bstar']=_0x3e0c36,_0x75dddd['ecco']=_0x289b10,_0x75dddd['argpo']=_0x25b781,_0x75dddd['inclo']=_0x18771e,_0x75dddd['mo']=_0x54d276,_0x75dddd['no']=_0x4199c8,_0x75dddd[_0x12cd66(0x322)]=_0x2c173b,_0x75dddd[_0x12cd66(0x34d)]=_0xd145a9;var _0x4b4b7c=0x4e/earthRadius+0x1,_0xde6a55=(0x78-0x4e)/earthRadius,_0x520e9b=_0xde6a55*_0xde6a55*_0xde6a55*_0xde6a55;_0x75dddd['init']='y',_0x75dddd['t']=0x0;var _0x47e7a5={'satn':_0x4f6ec0,'ecco':_0x75dddd['ecco'],'epoch':_0x1f8c26,'inclo':_0x75dddd['inclo'],'no':_0x75dddd['no'],'method':_0x75dddd['method'],'opsmode':_0x75dddd['operationmode']},_0x5acc2d=initl(_0x47e7a5),_0x5ed71e=_0x5acc2d['ao'],_0x48c72b=_0x5acc2d['con42'],_0x187f7c=_0x5acc2d[_0x12cd66(0x264)],_0x3a938f=_0x5acc2d['cosio2'],_0x3b9d4e=_0x5acc2d['eccsq'],_0x40441e=_0x5acc2d['omeosq'],_0x103e83=_0x5acc2d['posq'],_0x3a337a=_0x5acc2d['rp'],_0x1a2d4c=_0x5acc2d['rteosq'],_0x4b69e5=_0x5acc2d['sinio'];_0x75dddd['no']=_0x5acc2d['no'],_0x75dddd['con41']=_0x5acc2d[_0x12cd66(0x182)],_0x75dddd['gsto']=_0x5acc2d['gsto'],_0x75dddd['error']=0x0;if(_0x40441e>=0x0||_0x75dddd['no']>=0x0){_0x75dddd['isimp']=0x0;_0x3a337a<0xdc/earthRadius+0x1&&(_0x75dddd[_0x12cd66(0x35f)]=0x1);_0xb96a7b=_0x4b4b7c,_0x11c6f9=_0x520e9b,_0x2762d3=(_0x3a337a-0x1)*earthRadius;if(_0x2762d3<0x9c){_0xb96a7b=_0x2762d3-0x4e;_0x2762d3<0x62&&(_0xb96a7b=0x14);var _0x10c616=(0x78-_0xb96a7b)/earthRadius;_0x11c6f9=_0x10c616*_0x10c616*_0x10c616*_0x10c616,_0xb96a7b=_0xb96a7b/earthRadius+0x1;}_0x1af2c3=0x1/_0x103e83,_0xd0c0e2=0x1/(_0x5ed71e-_0xb96a7b),_0x75dddd['eta']=_0x5ed71e*_0x75dddd[_0x12cd66(0x271)]*_0xd0c0e2,_0x909bc7=_0x75dddd[_0x12cd66(0x20d)]*_0x75dddd['eta'],_0x46447e=_0x75dddd['ecco']*_0x75dddd[_0x12cd66(0x20d)],_0x44c4da=Math[_0x12cd66(0x2d9)](0x1-_0x909bc7),_0x261540=_0x11c6f9*Math['pow'](_0xd0c0e2,0x4),_0x81dcd=_0x261540/Math['pow'](_0x44c4da,3.5),_0x32292f=_0x81dcd*_0x75dddd['no']*(_0x5ed71e*(0x1+1.5*_0x909bc7+_0x46447e*(0x4+_0x909bc7))+0.375*j2*_0xd0c0e2/_0x44c4da*_0x75dddd['con41']*(0x8+0x3*_0x909bc7*(0x8+_0x909bc7))),_0x75dddd[_0x12cd66(0x37b)]=_0x75dddd['bstar']*_0x32292f,_0x49b9a0=0x0;_0x75dddd['ecco']>0.0001&&(_0x49b9a0=-0x2*_0x261540*_0xd0c0e2*j3oj2*_0x75dddd['no']*_0x4b69e5/_0x75dddd[_0x12cd66(0x271)]);_0x75dddd['x1mth2']=0x1-_0x3a938f,_0x75dddd[_0x12cd66(0x187)]=0x2*_0x75dddd['no']*_0x81dcd*_0x5ed71e*_0x40441e*(_0x75dddd['eta']*(0x2+0.5*_0x909bc7)+_0x75dddd['ecco']*(0.5+0x2*_0x909bc7)-j2*_0xd0c0e2/(_0x5ed71e*_0x44c4da)*(-0x3*_0x75dddd[_0x12cd66(0x182)]*(0x1-0x2*_0x46447e+_0x909bc7*(1.5-0.5*_0x46447e))+0.75*_0x75dddd['x1mth2']*(0x2*_0x909bc7-_0x46447e*(0x1+_0x909bc7))*Math[_0x12cd66(0x2dd)](0x2*_0x75dddd[_0x12cd66(0x26e)]))),_0x75dddd['cc5']=0x2*_0x81dcd*_0x5ed71e*_0x40441e*(0x1+2.75*(_0x909bc7+_0x46447e)+_0x46447e*_0x909bc7),_0x17bc5a=_0x3a938f*_0x3a938f,_0x10d954=1.5*j2*_0x1af2c3*_0x75dddd['no'],_0x58749a=0.5*_0x10d954*j2*_0x1af2c3,_0xb4da2b=-0.46875*j4*_0x1af2c3*_0x1af2c3*_0x75dddd['no'],_0x75dddd['mdot']=_0x75dddd['no']+0.5*_0x10d954*_0x1a2d4c*_0x75dddd['con41']+0.0625*_0x58749a*_0x1a2d4c*(0xd-0x4e*_0x3a938f+0x89*_0x17bc5a),_0x75dddd[_0x12cd66(0x237)]=-0.5*_0x10d954*_0x48c72b+0.0625*_0x58749a*(0x7-0x72*_0x3a938f+0x18b*_0x17bc5a)+_0xb4da2b*(0x3-0x24*_0x3a938f+0x31*_0x17bc5a),_0x3a74b5=-_0x10d954*_0x187f7c,_0x75dddd[_0x12cd66(0x184)]=_0x3a74b5+(0.5*_0x58749a*(0x4-0x13*_0x3a938f)+0x2*_0xb4da2b*(0x3-0x7*_0x3a938f))*_0x187f7c,_0x3917f4=_0x75dddd['argpdot']+_0x75dddd[_0x12cd66(0x184)],_0x75dddd['omgcof']=_0x75dddd[_0x12cd66(0x1a7)]*_0x49b9a0*Math[_0x12cd66(0x2dd)](_0x75dddd['argpo']),_0x75dddd['xmcof']=0x0;_0x75dddd[_0x12cd66(0x271)]>0.0001&&(_0x75dddd['xmcof']=-x2o3*_0x261540*_0x75dddd['bstar']/_0x46447e);_0x75dddd['nodecf']=3.5*_0x40441e*_0x3a74b5*_0x75dddd['cc1'],_0x75dddd['t2cof']=1.5*_0x75dddd[_0x12cd66(0x37b)];Math['abs'](_0x187f7c+0x1)>1.5e-12?_0x75dddd[_0x12cd66(0x153)]=-0.25*j3oj2*_0x4b69e5*(0x3+0x5*_0x187f7c)/(0x1+_0x187f7c):_0x75dddd['xlcof']=-0.25*j3oj2*_0x4b69e5*(0x3+0x5*_0x187f7c)/_0xb06742;_0x75dddd['aycof']=-0.5*j3oj2*_0x4b69e5;var _0x6eea57=0x1+_0x75dddd['eta']*Math['cos'](_0x75dddd['mo']);_0x75dddd['delmo']=_0x6eea57*_0x6eea57*_0x6eea57,_0x75dddd['sinmao']=Math[_0x12cd66(0x226)](_0x75dddd['mo']),_0x75dddd[_0x12cd66(0x2c0)]=0x7*_0x3a938f-0x1;if(0x2*pi/_0x75dddd['no']>=0xe1){_0x75dddd['method']='d',_0x75dddd['isimp']=0x1,_0x54677f=0x0,_0x2cd7f0=_0x75dddd['inclo'];var _0x229ea1={'epoch':_0x1f8c26,'ep':_0x75dddd['ecco'],'argpp':_0x75dddd['argpo'],'tc':_0x54677f,'inclp':_0x75dddd[_0x12cd66(0x18d)],'nodep':_0x75dddd['nodeo'],'np':_0x75dddd['no'],'e3':_0x75dddd['e3'],'ee2':_0x75dddd[_0x12cd66(0x15f)],'peo':_0x75dddd['peo'],'pgho':_0x75dddd['pgho'],'pho':_0x75dddd['pho'],'pinco':_0x75dddd['pinco'],'plo':_0x75dddd[_0x12cd66(0x165)],'se2':_0x75dddd['se2'],'se3':_0x75dddd['se3'],'sgh2':_0x75dddd['sgh2'],'sgh3':_0x75dddd['sgh3'],'sgh4':_0x75dddd['sgh4'],'sh2':_0x75dddd[_0x12cd66(0x286)],'sh3':_0x75dddd['sh3'],'si2':_0x75dddd[_0x12cd66(0x350)],'si3':_0x75dddd['si3'],'sl2':_0x75dddd['sl2'],'sl3':_0x75dddd['sl3'],'sl4':_0x75dddd['sl4'],'xgh2':_0x75dddd['xgh2'],'xgh3':_0x75dddd[_0x12cd66(0x1c4)],'xgh4':_0x75dddd['xgh4'],'xh2':_0x75dddd[_0x12cd66(0x34a)],'xh3':_0x75dddd['xh3'],'xi2':_0x75dddd[_0x12cd66(0x2df)],'xi3':_0x75dddd['xi3'],'xl2':_0x75dddd['xl2'],'xl3':_0x75dddd['xl3'],'xl4':_0x75dddd['xl4'],'zmol':_0x75dddd[_0x12cd66(0x37e)],'zmos':_0x75dddd['zmos']},_0x47eccd=dscom(_0x229ea1);_0x75dddd['e3']=_0x47eccd['e3'],_0x75dddd['ee2']=_0x47eccd['ee2'],_0x75dddd['peo']=_0x47eccd['peo'],_0x75dddd['pgho']=_0x47eccd['pgho'],_0x75dddd['pho']=_0x47eccd['pho'],_0x75dddd['pinco']=_0x47eccd['pinco'],_0x75dddd[_0x12cd66(0x165)]=_0x47eccd['plo'],_0x75dddd['se2']=_0x47eccd['se2'],_0x75dddd['se3']=_0x47eccd['se3'],_0x75dddd[_0x12cd66(0x2e4)]=_0x47eccd[_0x12cd66(0x2e4)],_0x75dddd['sgh3']=_0x47eccd[_0x12cd66(0x1a6)],_0x75dddd[_0x12cd66(0x1ca)]=_0x47eccd['sgh4'],_0x75dddd['sh2']=_0x47eccd['sh2'],_0x75dddd['sh3']=_0x47eccd['sh3'],_0x75dddd['si2']=_0x47eccd['si2'],_0x75dddd[_0x12cd66(0x22d)]=_0x47eccd[_0x12cd66(0x22d)],_0x75dddd[_0x12cd66(0x2e2)]=_0x47eccd['sl2'],_0x75dddd[_0x12cd66(0x201)]=_0x47eccd['sl3'],_0x75dddd['sl4']=_0x47eccd['sl4'],_0x38de07=_0x47eccd[_0x12cd66(0x37d)],_0x28ae68=_0x47eccd[_0x12cd66(0x317)],_0x3276e0=_0x47eccd['em'],_0x6dd7b2=_0x47eccd[_0x12cd66(0x214)],_0x189867=_0x47eccd['s1'],_0x5e46a2=_0x47eccd['s2'],_0x3c2ac3=_0x47eccd['s3'],_0x5762ed=_0x47eccd['s4'],_0x4af6b0=_0x47eccd['s5'],_0xa09960=_0x47eccd[_0x12cd66(0x2f5)],_0xd1c7d7=_0x47eccd[_0x12cd66(0x297)],_0x1dfc61=_0x47eccd['ss3'],_0x38794c=_0x47eccd['ss4'],_0x47dba2=_0x47eccd['ss5'],_0x8f403e=_0x47eccd['sz1'],_0x381aac=_0x47eccd['sz3'],_0x1b2a6d=_0x47eccd['sz11'],_0x39102b=_0x47eccd['sz13'],_0x10e4c1=_0x47eccd['sz21'],_0xa0658c=_0x47eccd[_0x12cd66(0x260)],_0x5718b6=_0x47eccd['sz31'],_0x5dae71=_0x47eccd['sz33'],_0x75dddd[_0x12cd66(0x150)]=_0x47eccd['xgh2'],_0x75dddd['xgh3']=_0x47eccd['xgh3'],_0x75dddd[_0x12cd66(0x186)]=_0x47eccd['xgh4'],_0x75dddd['xh2']=_0x47eccd['xh2'],_0x75dddd['xh3']=_0x47eccd['xh3'],_0x75dddd['xi2']=_0x47eccd['xi2'],_0x75dddd['xi3']=_0x47eccd['xi3'],_0x75dddd[_0x12cd66(0x24e)]=_0x47eccd[_0x12cd66(0x24e)],_0x75dddd[_0x12cd66(0x1fc)]=_0x47eccd['xl3'],_0x75dddd['xl4']=_0x47eccd[_0x12cd66(0x274)],_0x75dddd['zmol']=_0x47eccd['zmol'],_0x75dddd['zmos']=_0x47eccd['zmos'],_0x4cc4fe=_0x47eccd['nm'],_0x4005c9=_0x47eccd['z1'],_0xbd98f9=_0x47eccd['z3'],_0x5460b6=_0x47eccd['z11'],_0x4a23bb=_0x47eccd[_0x12cd66(0x377)],_0x951238=_0x47eccd['z21'],_0x4fabbb=_0x47eccd[_0x12cd66(0x25f)],_0x4b2984=_0x47eccd['z31'],_0x521279=_0x47eccd['z33'];var _0x292b20={'inclo':_0x2cd7f0,'init':_0x75dddd['init'],'ep':_0x75dddd[_0x12cd66(0x271)],'inclp':_0x75dddd['inclo'],'nodep':_0x75dddd['nodeo'],'argpp':_0x75dddd['argpo'],'mp':_0x75dddd['mo'],'opsmode':_0x75dddd['operationmode']},_0x25b475=dpper(_0x75dddd,_0x292b20);_0x75dddd['ecco']=_0x25b475['ep'],_0x75dddd['inclo']=_0x25b475['inclp'],_0x75dddd['nodeo']=_0x25b475['nodep'],_0x75dddd[_0x12cd66(0x26e)]=_0x25b475['argpp'],_0x75dddd['mo']=_0x25b475['mp'],_0x229e63=0x0,_0x105e21=0x0,_0x3d19a6=0x0;var _0x7c16c2={'cosim':_0x28ae68,'emsq':_0x6dd7b2,'argpo':_0x75dddd['argpo'],'s1':_0x189867,'s2':_0x5e46a2,'s3':_0x3c2ac3,'s4':_0x5762ed,'s5':_0x4af6b0,'sinim':_0x38de07,'ss1':_0xa09960,'ss2':_0xd1c7d7,'ss3':_0x1dfc61,'ss4':_0x38794c,'ss5':_0x47dba2,'sz1':_0x8f403e,'sz3':_0x381aac,'sz11':_0x1b2a6d,'sz13':_0x39102b,'sz21':_0x10e4c1,'sz23':_0xa0658c,'sz31':_0x5718b6,'sz33':_0x5dae71,'t':_0x75dddd['t'],'tc':_0x54677f,'gsto':_0x75dddd[_0x12cd66(0x1c2)],'mo':_0x75dddd['mo'],'mdot':_0x75dddd['mdot'],'no':_0x75dddd['no'],'nodeo':_0x75dddd[_0x12cd66(0x322)],'nodedot':_0x75dddd['nodedot'],'xpidot':_0x3917f4,'z1':_0x4005c9,'z3':_0xbd98f9,'z11':_0x5460b6,'z13':_0x4a23bb,'z21':_0x951238,'z23':_0x4fabbb,'z31':_0x4b2984,'z33':_0x521279,'ecco':_0x75dddd[_0x12cd66(0x271)],'eccsq':_0x3b9d4e,'em':_0x3276e0,'argpm':_0x229e63,'inclm':_0x2cd7f0,'mm':_0x3d19a6,'nm':_0x4cc4fe,'nodem':_0x105e21,'irez':_0x75dddd['irez'],'atime':_0x75dddd['atime'],'d2201':_0x75dddd['d2201'],'d2211':_0x75dddd['d2211'],'d3210':_0x75dddd['d3210'],'d3222':_0x75dddd['d3222'],'d4410':_0x75dddd['d4410'],'d4422':_0x75dddd['d4422'],'d5220':_0x75dddd['d5220'],'d5232':_0x75dddd[_0x12cd66(0x31b)],'d5421':_0x75dddd['d5421'],'d5433':_0x75dddd[_0x12cd66(0x252)],'dedt':_0x75dddd['dedt'],'didt':_0x75dddd['didt'],'dmdt':_0x75dddd['dmdt'],'dnodt':_0x75dddd['dnodt'],'domdt':_0x75dddd['domdt'],'del1':_0x75dddd['del1'],'del2':_0x75dddd[_0x12cd66(0x2f2)],'del3':_0x75dddd['del3'],'xfact':_0x75dddd[_0x12cd66(0x22f)],'xlamo':_0x75dddd['xlamo'],'xli':_0x75dddd[_0x12cd66(0x2c6)],'xni':_0x75dddd['xni']},_0xdb2428=dsinit(_0x7c16c2);_0x75dddd[_0x12cd66(0x1aa)]=_0xdb2428['irez'],_0x75dddd['atime']=_0xdb2428['atime'],_0x75dddd[_0x12cd66(0x33f)]=_0xdb2428['d2201'],_0x75dddd['d2211']=_0xdb2428['d2211'],_0x75dddd['d3210']=_0xdb2428['d3210'],_0x75dddd['d3222']=_0xdb2428[_0x12cd66(0x372)],_0x75dddd[_0x12cd66(0x2e9)]=_0xdb2428['d4410'],_0x75dddd['d4422']=_0xdb2428['d4422'],_0x75dddd['d5220']=_0xdb2428['d5220'],_0x75dddd[_0x12cd66(0x31b)]=_0xdb2428[_0x12cd66(0x31b)],_0x75dddd[_0x12cd66(0x2c2)]=_0xdb2428['d5421'],_0x75dddd['d5433']=_0xdb2428['d5433'],_0x75dddd['dedt']=_0xdb2428['dedt'],_0x75dddd['didt']=_0xdb2428['didt'],_0x75dddd[_0x12cd66(0x379)]=_0xdb2428[_0x12cd66(0x379)],_0x75dddd['dnodt']=_0xdb2428['dnodt'],_0x75dddd[_0x12cd66(0x269)]=_0xdb2428['domdt'],_0x75dddd['del1']=_0xdb2428[_0x12cd66(0x212)],_0x75dddd[_0x12cd66(0x2f2)]=_0xdb2428[_0x12cd66(0x2f2)],_0x75dddd['del3']=_0xdb2428[_0x12cd66(0x1fb)],_0x75dddd[_0x12cd66(0x22f)]=_0xdb2428[_0x12cd66(0x22f)],_0x75dddd[_0x12cd66(0x356)]=_0xdb2428[_0x12cd66(0x356)],_0x75dddd['xli']=_0xdb2428[_0x12cd66(0x2c6)],_0x75dddd['xni']=_0xdb2428['xni'];}_0x75dddd['isimp']!==0x1&&(_0x16533b=_0x75dddd['cc1']*_0x75dddd[_0x12cd66(0x37b)],_0x75dddd['d2']=0x4*_0x5ed71e*_0xd0c0e2*_0x16533b,_0x8e6ae7=_0x75dddd['d2']*_0xd0c0e2*_0x75dddd['cc1']/0x3,_0x75dddd['d3']=(0x11*_0x5ed71e+_0xb96a7b)*_0x8e6ae7,_0x75dddd['d4']=0.5*_0x8e6ae7*_0x5ed71e*_0xd0c0e2*(0xdd*_0x5ed71e+0x1f*_0xb96a7b)*_0x75dddd['cc1'],_0x75dddd['t3cof']=_0x75dddd['d2']+0x2*_0x16533b,_0x75dddd['t4cof']=0.25*(0x3*_0x75dddd['d3']+_0x75dddd['cc1']*(0xc*_0x75dddd['d2']+0xa*_0x16533b)),_0x75dddd[_0x12cd66(0x2dc)]=0.2*(0x3*_0x75dddd['d4']+0xc*_0x75dddd['cc1']*_0x75dddd['d3']+0x6*_0x75dddd['d2']*_0x75dddd['d2']+0xf*_0x16533b*(0x2*_0x75dddd['d2']+_0x16533b)));}sgp4(_0x75dddd,0x0),_0x75dddd[_0x12cd66(0x1f0)]='n';}function twoline2satrec(_0x13f766,_0x42b94){var _0x37fcfe=_0x16ff71,_0x477098='i',_0x2cc002=0x5a0/(0x2*pi),_0x199d03=0x0,_0xe71376={};_0xe71376[_0x37fcfe(0x1ed)]=0x0,_0xe71376['satnum']=_0x13f766['substring'](0x2,0x7),_0xe71376['epochyr']=parseInt(_0x13f766['substring'](0x12,0x14),0xa),_0xe71376['epochdays']=parseFloat(_0x13f766['substring'](0x14,0x20)),_0xe71376['ndot']=parseFloat(_0x13f766['substring'](0x21,0x2b)),_0xe71376['nddot']=parseFloat('.'[_0x37fcfe(0x2c7)](parseInt(_0x13f766[_0x37fcfe(0x354)](0x2c,0x32),0xa),'E')['concat'](_0x13f766[_0x37fcfe(0x354)](0x32,0x34))),_0xe71376['bstar']=parseFloat(''['concat'](_0x13f766['substring'](0x35,0x36),'.')[_0x37fcfe(0x2c7)](parseInt(_0x13f766['substring'](0x36,0x3b),0xa),'E')['concat'](_0x13f766['substring'](0x3b,0x3d))),_0xe71376['inclo']=parseFloat(_0x42b94['substring'](0x8,0x10)),_0xe71376['nodeo']=parseFloat(_0x42b94[_0x37fcfe(0x354)](0x11,0x19)),_0xe71376['ecco']=parseFloat('.'['concat'](_0x42b94[_0x37fcfe(0x354)](0x1a,0x21))),_0xe71376[_0x37fcfe(0x26e)]=parseFloat(_0x42b94['substring'](0x22,0x2a)),_0xe71376['mo']=parseFloat(_0x42b94['substring'](0x2b,0x33)),_0xe71376['no']=parseFloat(_0x42b94[_0x37fcfe(0x354)](0x34,0x3f)),_0xe71376['no']/=_0x2cc002,_0xe71376['a']=Math[_0x37fcfe(0x22c)](_0xe71376['no']*tumin,-0x2/0x3),_0xe71376['ndot']/=_0x2cc002*0x5a0,_0xe71376[_0x37fcfe(0x16c)]/=_0x2cc002*0x5a0*0x5a0,_0xe71376[_0x37fcfe(0x18d)]*=deg2rad,_0xe71376['nodeo']*=deg2rad,_0xe71376[_0x37fcfe(0x26e)]*=deg2rad,_0xe71376['mo']*=deg2rad,_0xe71376[_0x37fcfe(0x381)]=_0xe71376['a']*(0x1+_0xe71376['ecco'])-0x1,_0xe71376['altp']=_0xe71376['a']*(0x1-_0xe71376['ecco'])-0x1;_0xe71376['epochyr']<0x39?_0x199d03=_0xe71376[_0x37fcfe(0x174)]+0x7d0:_0x199d03=_0xe71376['epochyr']+0x76c;var _0x1d5852=days2mdhms(_0x199d03,_0xe71376['epochdays']),_0x5eeb9c=_0x1d5852['mon'],_0x54a17c=_0x1d5852['day'],_0x4b9206=_0x1d5852['hr'],_0x4bd6ab=_0x1d5852['minute'],_0x37663c=_0x1d5852['sec'];return _0xe71376['jdsatepoch']=jday(_0x199d03,_0x5eeb9c,_0x54a17c,_0x4b9206,_0x4bd6ab,_0x37663c),sgp4init(_0xe71376,{'opsmode':_0x477098,'satn':_0xe71376['satnum'],'epoch':_0xe71376['jdsatepoch']-2433281.5,'xbstar':_0xe71376[_0x37fcfe(0x1a7)],'xecco':_0xe71376['ecco'],'xargpo':_0xe71376['argpo'],'xinclo':_0xe71376['inclo'],'xmo':_0xe71376['mo'],'xno':_0xe71376['no'],'xnodeo':_0xe71376['nodeo']}),_0xe71376;}function _toConsumableArray(_0x127864){return _arrayWithoutHoles(_0x127864)||_iterableToArray(_0x127864)||_unsupportedIterableToArray(_0x127864)||_nonIterableSpread();}function _arrayWithoutHoles(_0x38d6dc){var _0x534989=_0x16ff71;if(Array[_0x534989(0x327)](_0x38d6dc))return _arrayLikeToArray(_0x38d6dc);}function _iterableToArray(_0x33fb43){if(typeof Symbol!=='undefined'&&Symbol['iterator']in Object(_0x33fb43))return Array['from'](_0x33fb43);}function _unsupportedIterableToArray(_0x215eed,_0x1db1ae){var _0x14f504=_0x16ff71;if(!_0x215eed)return;if(typeof _0x215eed===_0x14f504(0x170))return _arrayLikeToArray(_0x215eed,_0x1db1ae);var _0x38ddad=Object['prototype']['toString']['call'](_0x215eed)['slice'](0x8,-0x1);if(_0x38ddad==='Object'&&_0x215eed[_0x14f504(0x326)])_0x38ddad=_0x215eed['constructor']['name'];if(_0x38ddad==='Map'||_0x38ddad===_0x14f504(0x1a3))return Array[_0x14f504(0x299)](_0x215eed);if(_0x38ddad===_0x14f504(0x1e9)||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/['test'](_0x38ddad))return _arrayLikeToArray(_0x215eed,_0x1db1ae);}function _arrayLikeToArray(_0x4109a1,_0x3af442){if(_0x3af442==null||_0x3af442>_0x4109a1['length'])_0x3af442=_0x4109a1['length'];for(var _0x5d76f7=0x0,_0x7ab973=new Array(_0x3af442);_0x5d76f7<_0x3af442;_0x5d76f7++)_0x7ab973[_0x5d76f7]=_0x4109a1[_0x5d76f7];return _0x7ab973;}function _nonIterableSpread(){throw new TypeError('Invalid\x20attempt\x20to\x20spread\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.');}function propagate(){var _0x3a8e47=_0x16ff71;for(var _0x2c4eb7=arguments['length'],_0x4c32f4=new Array(_0x2c4eb7),_0xaf1798=0x0;_0xaf1798<_0x2c4eb7;_0xaf1798++){_0x4c32f4[_0xaf1798]=arguments[_0xaf1798];}var _0x2cfb31=_0x4c32f4[0x0],_0x2f7977=Array['prototype'][_0x3a8e47(0x2ef)]['call'](_0x4c32f4,0x1),_0x210cae=jday['apply'](void 0x0,_toConsumableArray(_0x2f7977)),_0x2dbd23=(_0x210cae-_0x2cfb31['jdsatepoch'])*minutesPerDay;return sgp4(_0x2cfb31,_0x2dbd23);}function dopplerFactor(_0xc5b91a,_0x2c1782,_0x2eadca){var _0x4d7e44=_0x16ff71,_0xc44f2c=0.00007292115,_0x205304=299792.458,_0x5d1651={'x':_0x2c1782['x']-_0xc5b91a['x'],'y':_0x2c1782['y']-_0xc5b91a['y'],'z':_0x2c1782['z']-_0xc5b91a['z']};_0x5d1651['w']=Math['sqrt'](Math['pow'](_0x5d1651['x'],0x2)+Math[_0x4d7e44(0x22c)](_0x5d1651['y'],0x2)+Math['pow'](_0x5d1651['z'],0x2));var _0x1a6d6d={'x':_0x2eadca['x']+_0xc44f2c*_0xc5b91a['y'],'y':_0x2eadca['y']-_0xc44f2c*_0xc5b91a['x'],'z':_0x2eadca['z']};function _0x43ab1d(_0x3937e0){return _0x3937e0>=0x0?0x1:-0x1;}var _0x4ca594=(_0x5d1651['x']*_0x1a6d6d['x']+_0x5d1651['y']*_0x1a6d6d['y']+_0x5d1651['z']*_0x1a6d6d['z'])/_0x5d1651['w'];return 0x1+_0x4ca594/_0x205304*_0x43ab1d(_0x4ca594);}function radiansToDegrees(_0x5322b0){return _0x5322b0*rad2deg;}function degreesToRadians(_0x9e4ca6){return _0x9e4ca6*deg2rad;}function degreesLat(_0x24f9b2){var _0x3c892c=_0x16ff71;if(_0x24f9b2<-pi/0x2||_0x24f9b2>pi/0x2)throw new RangeError(_0x3c892c(0x353));return radiansToDegrees(_0x24f9b2);}function degreesLong(_0x4619bf){var _0x33ef21=_0x16ff71;if(_0x4619bf<-pi||_0x4619bf>pi)throw new RangeError(_0x33ef21(0x19a));return radiansToDegrees(_0x4619bf);}function radiansLat(_0xc6711f){if(_0xc6711f<-0x5a||_0xc6711f>0x5a)throw new RangeError('Latitude\x20degrees\x20must\x20be\x20in\x20range\x20[-90;\x2090].');return degreesToRadians(_0xc6711f);}function radiansLong(_0x11fba7){if(_0x11fba7<-0xb4||_0x11fba7>0xb4)throw new RangeError('Longitude\x20degrees\x20must\x20be\x20in\x20range\x20[-180;\x20180].');return degreesToRadians(_0x11fba7);}function geodeticToEcf(_0x2ba72){var _0x3c8151=_0x16ff71,_0x3a954e=_0x2ba72[_0x3c8151(0x1d6)],_0x360a2f=_0x2ba72['latitude'],_0x5d491c=_0x2ba72['height'],_0x4c72db=6378.137,_0x2a9507=6356.7523142,_0xbd7d1a=(_0x4c72db-_0x2a9507)/_0x4c72db,_0x52484a=0x2*_0xbd7d1a-_0xbd7d1a*_0xbd7d1a,_0x559b6a=_0x4c72db/Math['sqrt'](0x1-_0x52484a*(Math['sin'](_0x360a2f)*Math['sin'](_0x360a2f))),_0x3fda45=(_0x559b6a+_0x5d491c)*Math['cos'](_0x360a2f)*Math['cos'](_0x3a954e),_0x19210b=(_0x559b6a+_0x5d491c)*Math['cos'](_0x360a2f)*Math['sin'](_0x3a954e),_0x2db5fe=(_0x559b6a*(0x1-_0x52484a)+_0x5d491c)*Math['sin'](_0x360a2f);return{'x':_0x3fda45,'y':_0x19210b,'z':_0x2db5fe};}function eciToGeodetic(_0x45d688,_0x204070){var _0x46262d=_0x16ff71,_0xb177dc=6378.137,_0xedd7f9=6356.7523142,_0x2a3953=Math['sqrt'](_0x45d688['x']*_0x45d688['x']+_0x45d688['y']*_0x45d688['y']),_0x4486f4=(_0xb177dc-_0xedd7f9)/_0xb177dc,_0x4d33b8=0x2*_0x4486f4-_0x4486f4*_0x4486f4,_0x5b44b2=Math['atan2'](_0x45d688['y'],_0x45d688['x'])-_0x204070;while(_0x5b44b2<-pi){_0x5b44b2+=twoPi;}while(_0x5b44b2>pi){_0x5b44b2-=twoPi;}var _0x51b88f=0x14,_0x51e0b9=0x0,_0x2e7f7a=Math['atan2'](_0x45d688['z'],Math['sqrt'](_0x45d688['x']*_0x45d688['x']+_0x45d688['y']*_0x45d688['y'])),_0x5af7ec;while(_0x51e0b9<_0x51b88f){_0x5af7ec=0x1/Math[_0x46262d(0x1d2)](0x1-_0x4d33b8*(Math[_0x46262d(0x226)](_0x2e7f7a)*Math['sin'](_0x2e7f7a))),_0x2e7f7a=Math['atan2'](_0x45d688['z']+_0xb177dc*_0x5af7ec*_0x4d33b8*Math['sin'](_0x2e7f7a),_0x2a3953),_0x51e0b9+=0x1;}var _0x8d46c8=_0x2a3953/Math['cos'](_0x2e7f7a)-_0xb177dc*_0x5af7ec;return{'longitude':_0x5b44b2,'latitude':_0x2e7f7a,'height':_0x8d46c8};}function ecfToEci(_0x513694,_0x4c9f07){var _0x58f137=_0x16ff71,_0x32034d=_0x513694['x']*Math[_0x58f137(0x2dd)](_0x4c9f07)-_0x513694['y']*Math['sin'](_0x4c9f07),_0x3e3f43=_0x513694['x']*Math['sin'](_0x4c9f07)+_0x513694['y']*Math['cos'](_0x4c9f07),_0x4839f2=_0x513694['z'];return{'x':_0x32034d,'y':_0x3e3f43,'z':_0x4839f2};}function eciToEcf(_0x2b4e28,_0x8eafba){var _0x5a1e7c=_0x16ff71,_0x4f9636=_0x2b4e28['x']*Math['cos'](_0x8eafba)+_0x2b4e28['y']*Math['sin'](_0x8eafba),_0x5cc33b=_0x2b4e28['x']*-Math[_0x5a1e7c(0x226)](_0x8eafba)+_0x2b4e28['y']*Math['cos'](_0x8eafba),_0x49b3ee=_0x2b4e28['z'];return{'x':_0x4f9636,'y':_0x5cc33b,'z':_0x49b3ee};}function topocentric(_0x21dfe1,_0x50cc43){var _0x1e3c3a=_0x16ff71,_0x110d4c=_0x21dfe1[_0x1e3c3a(0x1d6)],_0x5ba1df=_0x21dfe1['latitude'],_0x1b4b16=geodeticToEcf(_0x21dfe1),_0x5ada26=_0x50cc43['x']-_0x1b4b16['x'],_0x3ff3d9=_0x50cc43['y']-_0x1b4b16['y'],_0x36886e=_0x50cc43['z']-_0x1b4b16['z'],_0xc314de=Math['sin'](_0x5ba1df)*Math['cos'](_0x110d4c)*_0x5ada26+Math['sin'](_0x5ba1df)*Math['sin'](_0x110d4c)*_0x3ff3d9-Math[_0x1e3c3a(0x2dd)](_0x5ba1df)*_0x36886e,_0xc38807=-Math[_0x1e3c3a(0x226)](_0x110d4c)*_0x5ada26+Math['cos'](_0x110d4c)*_0x3ff3d9,_0x4ce509=Math['cos'](_0x5ba1df)*Math[_0x1e3c3a(0x2dd)](_0x110d4c)*_0x5ada26+Math['cos'](_0x5ba1df)*Math['sin'](_0x110d4c)*_0x3ff3d9+Math['sin'](_0x5ba1df)*_0x36886e;return{'topS':_0xc314de,'topE':_0xc38807,'topZ':_0x4ce509};}function topocentricToLookAngles(_0x1cb72a){var _0x7a7bc3=_0x16ff71,_0x261855=_0x1cb72a[_0x7a7bc3(0x1d7)],_0x5105a1=_0x1cb72a['topE'],_0x4c11f6=_0x1cb72a[_0x7a7bc3(0x1b7)],_0x134e5b=Math['sqrt'](_0x261855*_0x261855+_0x5105a1*_0x5105a1+_0x4c11f6*_0x4c11f6),_0xf2dcf9=Math['asin'](_0x4c11f6/_0x134e5b),_0x39fecc=Math['atan2'](-_0x5105a1,_0x261855)+pi;return{'azimuth':_0x39fecc,'elevation':_0xf2dcf9,'rangeSat':_0x134e5b};}function ecfToLookAngles(_0x58977c,_0x502479){var _0x29bfd7=topocentric(_0x58977c,_0x502479);return topocentricToLookAngles(_0x29bfd7);}var satellite_es={'__proto__':null,'constants':constants,'degreesLat':degreesLat,'degreesLong':degreesLong,'degreesToRadians':degreesToRadians,'dopplerFactor':dopplerFactor,'ecfToEci':ecfToEci,'ecfToLookAngles':ecfToLookAngles,'eciToEcf':eciToEcf,'eciToGeodetic':eciToGeodetic,'geodeticToEcf':geodeticToEcf,'gstime':gstime,'invjday':invjday,'jday':jday,'propagate':propagate,'radiansLat':radiansLat,'radiansLong':radiansLong,'radiansToDegrees':radiansToDegrees,'sgp4':sgp4,'twoline2satrec':twoline2satrec},require$$0=getAugmentedNamespace(satellite_es);(function(_0x406513,_0x150012){(function(_0x1a5f9a,_0x4ca659){_0x4ca659(_0x150012,require$$0);}(commonjsGlobal,function(_0x577406,_0x196317){var _0x1e2dc1=_0x15c6;const _0x3a2d46=0x5265c00,_0x15840f=0x3e8,_0x17ace0=0xea60,_0x2c7b18={'_INT':Symbol(),'_FLOAT':Symbol(),'_CHAR':Symbol(),'_DECIMAL_ASSUMED':Symbol(),'_DECIMAL_ASSUMED_E':Symbol()},_0x2bee50={'_ARRAY':'array','_STRING':_0x1e2dc1(0x170),'_OBJECT':_0x1e2dc1(0x20b),'_DATE':'date','_NAN':'NaN'};function _0x3c70aa(_0x4ccd3f){var _0x4bd883=_0x1e2dc1;const _0x46437c=typeof _0x4ccd3f;if(Array['isArray'](_0x4ccd3f))return _0x2bee50[_0x4bd883(0x193)];if(_0x4ccd3f instanceof Date)return _0x2bee50['_DATE'];if(Number['isNaN'](_0x4ccd3f))return _0x2bee50['_NAN'];return _0x46437c;}const _0x27a097=_0x23d249=>_0x23d249>=0x0,_0x482d7d=_0x4af324=>{const _0xd91092=Math['abs'](_0x4af324);return _0xd91092['toString']()['length'];},_0x5455db=_0x25d87f=>{var _0x495c14=_0x1e2dc1;const _0x4da877=_0x482d7d(_0x25d87f),_0x2e9f85='0'[_0x495c14(0x330)](_0x4da877-0x1);return parseFloat(_0x25d87f*('0.'+_0x2e9f85+'1'));},_0x3c05ba=_0x50879a=>{var _0x3a4697=_0x1e2dc1;const _0x35fbed=_0x50879a['substr'](0x0,_0x50879a['length']-0x2),_0x26d4b3=_0x5455db(_0x35fbed),_0x3cc069=parseInt(_0x50879a['substr'](_0x50879a[_0x3a4697(0x152)]-0x2,0x2),0xa),_0x302ddd=_0x26d4b3*Math[_0x3a4697(0x22c)](0xa,_0x3cc069);return parseFloat(_0x302ddd['toPrecision'](0x5));},_0x4860ae=(_0x1df662,_0x462fc3=new Date()['getFullYear']())=>{var _0x30b998=_0x1e2dc1;const _0x385eb2=new Date(_0x30b998(0x1f1)+_0x462fc3+_0x30b998(0x2e7)),_0x5bd6c=_0x385eb2['getTime']();return Math['floor'](_0x5bd6c+(_0x1df662-0x1)*_0x3a2d46);},_0x1b6528=_0x1e2c62=>_0x1e2c62*(0xb4/Math['PI']),_0x5c2828=_0x58babb=>_0x58babb*(Math['PI']/0xb4),_0x2ee115=(_0x5a56c3,_0x42e649)=>{if(!_0x5a56c3||!_0x42e649)return![];const _0x36f3e2=_0x27a097(_0x5a56c3),_0x62e4ab=_0x27a097(_0x42e649),_0x46c2a2=_0x36f3e2===_0x62e4ab;if(_0x46c2a2)return![];const _0x174e53=Math['abs'](_0x5a56c3)>0x64;return _0x174e53;};function _0x333cb4(_0x512797){const _0xa2052=parseInt(_0x512797,0xa);return _0xa2052<0x64&&_0xa2052>0x38?_0xa2052+0x76c:_0xa2052+0x7d0;}function _0x3e537f(_0x117792,_0x158f95,_0x1d2a89){var _0x3a13b8=_0x1e2dc1;const {tle:_0x50c7f9}=_0x117792,_0x3977c3=_0x158f95===0x1?_0x50c7f9[0x0]:_0x50c7f9[0x1],{start:_0xf2d1b1,length:_0x10c985,type:_0xc8ab62}=_0x1d2a89,_0x45ade0=_0x3977c3['substr'](_0xf2d1b1,_0x10c985);let _0x44b7ef;switch(_0xc8ab62){case _0x2c7b18['_INT']:_0x44b7ef=parseInt(_0x45ade0,0xa);break;case _0x2c7b18['_FLOAT']:_0x44b7ef=parseFloat(_0x45ade0);break;case _0x2c7b18['_DECIMAL_ASSUMED']:_0x44b7ef=parseFloat('0.'+_0x45ade0);break;case _0x2c7b18['_DECIMAL_ASSUMED_E']:_0x44b7ef=_0x3c05ba(_0x45ade0);break;case _0x2c7b18[_0x3a13b8(0x207)]:default:_0x44b7ef=_0x45ade0[_0x3a13b8(0x28c)]();break;}return _0x44b7ef;}const _0x26cf7f=_0x140e55=>Object['keys'](_0x140e55)[_0x1e2dc1(0x152)],_0x43e172={'_TYPE':(_0x18a491='',_0xf2dad9=[],_0x2d0caa='')=>_0x18a491+'\x20must\x20be\x20of\x20type\x20['+_0xf2dad9['join'](',\x20')+'],\x20but\x20got\x20'+_0x2d0caa+'.','_NOT_PARSED_OBJECT':_0x1e2dc1(0x15b)};function _0x534e92(_0x44d714){var _0x5bbda4=_0x1e2dc1;return typeof _0x44d714===_0x2bee50[_0x5bbda4(0x34e)]&&_0x44d714[_0x5bbda4(0x278)]&&_0x3c70aa(_0x44d714[_0x5bbda4(0x278)])===_0x2bee50['_ARRAY']&&_0x44d714['tle']['length']===0x2;}const _0x2a069a=(_0x59af10,_0x299f34)=>{if(_0x59af10===_0x2bee50['_ARRAY'])return _0x299f34['length']===0x3?_0x299f34[0x1]:_0x299f34[0x0];return _0x299f34;};let _0x46032e={};const _0x7834be=()=>_0x46032e={},_0x4fe13d=[_0x2bee50['_ARRAY'],_0x2bee50['_STRING'],_0x2bee50['_OBJECT']];function _0x5e6f87(_0x288990,_0x1d086b=!![]){var _0x18228f=_0x1e2dc1;const _0x2a7b8a=_0x3c70aa(_0x288990),_0x524071={};let _0x103ad5=[];const _0x2be55b=_0x534e92(_0x288990);if(_0x2be55b)return _0x288990;const _0x1b6331=!_0x2be55b&&_0x2a7b8a===_0x2bee50['_OBJECT'];if(_0x1b6331)throw new Error(_0x43e172['_NOT_PARSED_OBJECT']);const _0x497fa9=_0x2a069a(_0x2a7b8a,_0x288990);if(_0x46032e[_0x497fa9])return _0x46032e[_0x497fa9];if(!_0x4fe13d[_0x18228f(0x36c)](_0x2a7b8a))throw new Error(_0x43e172['_TYPE']('Source\x20TLE',_0x4fe13d,_0x2a7b8a));if(_0x2a7b8a===_0x2bee50['_STRING'])_0x103ad5=_0x288990[_0x18228f(0x197)]('\x0a');else _0x2a7b8a===_0x2bee50['_ARRAY']&&(_0x103ad5=Array['from'](_0x288990));if(_0x103ad5[_0x18228f(0x152)]===0x3){let _0x3c6f10=_0x103ad5[0x0][_0x18228f(0x28c)]();_0x103ad5=_0x103ad5['slice'](0x1),_0x3c6f10['startsWith']('0\x20')&&(_0x3c6f10=_0x3c6f10['substr'](0x2)),_0x524071['name']=_0x3c6f10;}_0x524071['tle']=_0x103ad5[_0x18228f(0x235)](_0x20434b=>_0x20434b['trim']());if(!_0x1d086b){const _0x57187c=_0x5c9ce6(_0x524071['tle']);!_0x57187c&&(_0x524071['error']='TLE\x20parse\x20error:\x20bad\x20TLE');}return _0x46032e[_0x497fa9]=_0x524071,_0x524071;}function _0x258689(_0x18ab0a){var _0x12eee5=_0x1e2dc1;const _0x20d177=_0x18ab0a['split']('');_0x20d177['splice'](_0x20d177[_0x12eee5(0x152)]-0x1,0x1);if(_0x20d177['length']===0x0)throw new Error(_0x12eee5(0x15a),_0x18ab0a);const _0x504e89=_0x20d177[_0x12eee5(0x2e6)]((_0x365800,_0x1bc1bc)=>{var _0x27a185=_0x12eee5;const _0x585a69=parseInt(_0x1bc1bc,0xa),_0x1cb595=parseInt(_0x365800,0xa);if(Number[_0x27a185(0x24d)](_0x585a69))return _0x1cb595+_0x585a69;if(_0x1bc1bc==='-')return _0x1cb595+0x1;return _0x1cb595;},0x0);return _0x504e89%0xa;}function _0x1ea595(_0x18c4f5,_0x41268e){const {tle:_0x52e5cd}=_0x18c4f5;return _0x41268e===parseInt(_0x52e5cd[_0x41268e-0x1][0x0],0xa);}function _0x1ad233(_0x5872fd,_0x37023f){var _0x1f458a=_0x1e2dc1;const {tle:_0x20f285}=_0x5872fd,_0x4b9500=_0x20f285[_0x37023f-0x1],_0x74169d=parseInt(_0x4b9500[_0x4b9500[_0x1f458a(0x152)]-0x1],0xa),_0x4956c6=_0x258689(_0x20f285[_0x37023f-0x1]);return _0x4956c6===_0x74169d;}function _0x5c9ce6(_0x5a9b63){let _0x4f77f2;try{_0x4f77f2=_0x5e6f87(_0x5a9b63);}catch(_0x414e13){return![];}const _0x4bdd89=_0x1ea595(_0x4f77f2,0x1),_0x1fb2b8=_0x1ea595(_0x4f77f2,0x2);if(!_0x4bdd89||!_0x1fb2b8)return![];const _0x1f616b=_0x1ad233(_0x4f77f2,0x1),_0x12b012=_0x1ad233(_0x4f77f2,0x2);if(!_0x1f616b||!_0x12b012)return![];return!![];}const _0x51d8de={'start':0x0,'length':0x1,'type':_0x2c7b18['_INT']},_0x30ca99={'start':0x2,'length':0x5,'type':_0x2c7b18['_INT']},_0x5600a9={'start':0x7,'length':0x1,'type':_0x2c7b18[_0x1e2dc1(0x207)]},_0x4531f6={'start':0x9,'length':0x2,'type':_0x2c7b18[_0x1e2dc1(0x2de)]},_0x2ecea1={'start':0xb,'length':0x3,'type':_0x2c7b18[_0x1e2dc1(0x2de)]},_0x22a765={'start':0xe,'length':0x3,'type':_0x2c7b18[_0x1e2dc1(0x207)]},_0x102eee={'start':0x12,'length':0x2,'type':_0x2c7b18['_INT']},_0x3fcb62={'start':0x14,'length':0xc,'type':_0x2c7b18['_FLOAT']},_0x532c06={'start':0x21,'length':0xb,'type':_0x2c7b18['_FLOAT']},_0x5c7e1c={'start':0x2c,'length':0x8,'type':_0x2c7b18['_DECIMAL_ASSUMED_E']},_0x5418d0={'start':0x35,'length':0x8,'type':_0x2c7b18[_0x1e2dc1(0x2cf)]},_0x488286={'start':0x3e,'length':0x1,'type':_0x2c7b18['_INT']},_0x560e81={'start':0x40,'length':0x4,'type':_0x2c7b18[_0x1e2dc1(0x2de)]},_0x27c2bb={'start':0x44,'length':0x1,'type':_0x2c7b18['_INT']};function _0x411097(_0x226998,_0x3b442b,_0x309376=![]){const _0x351517=_0x309376?_0x226998:_0x5e6f87(_0x226998);return _0x3e537f(_0x351517,0x1,_0x3b442b);}function _0x24cf28(_0x1ac8da,_0x16909e){return _0x411097(_0x1ac8da,_0x51d8de,_0x16909e);}function _0x37c160(_0x3ab83f,_0x5abb33){return _0x411097(_0x3ab83f,_0x30ca99,_0x5abb33);}function _0x4e2141(_0x9cfc54,_0x1066a5){return _0x411097(_0x9cfc54,_0x5600a9,_0x1066a5);}function _0x294a26(_0x529858,_0x57ffa8){return _0x411097(_0x529858,_0x4531f6,_0x57ffa8);}function _0x5d3dda(_0x35ef53,_0x100f59){return _0x411097(_0x35ef53,_0x2ecea1,_0x100f59);}function _0x4d3937(_0x477bc0,_0x5ead17){return _0x411097(_0x477bc0,_0x22a765,_0x5ead17);}function _0x1e605c(_0x59890e,_0x1cdc2d){return _0x411097(_0x59890e,_0x102eee,_0x1cdc2d);}function _0x134468(_0x9845c1,_0x5eacbf){return _0x411097(_0x9845c1,_0x3fcb62,_0x5eacbf);}function _0x46d831(_0x3cf616,_0x5ea04c){return _0x411097(_0x3cf616,_0x532c06,_0x5ea04c);}function _0x227e9d(_0x167f78,_0x5883bd){return _0x411097(_0x167f78,_0x5c7e1c,_0x5883bd);}function _0x3c8b77(_0x5473c,_0x429fd0){return _0x411097(_0x5473c,_0x5418d0,_0x429fd0);}function _0x2c9f7e(_0x15382a,_0x4df115){return _0x411097(_0x15382a,_0x488286,_0x4df115);}function _0x421ed9(_0x3e9bfd,_0x35812f){return _0x411097(_0x3e9bfd,_0x560e81,_0x35812f);}function _0x36ca9a(_0xb8a7e2,_0x3f0d22){return _0x411097(_0xb8a7e2,_0x27c2bb,_0x3f0d22);}const _0x72833d={'start':0x0,'length':0x1,'type':_0x2c7b18['_INT']},_0x188456={'start':0x2,'length':0x5,'type':_0x2c7b18['_INT']},_0x369ead={'start':0x8,'length':0x8,'type':_0x2c7b18[_0x1e2dc1(0x1e4)]},_0x279859={'start':0x11,'length':0x8,'type':_0x2c7b18[_0x1e2dc1(0x1e4)]},_0x4e8ad9={'start':0x1a,'length':0x7,'type':_0x2c7b18[_0x1e2dc1(0x2e1)]},_0x3d58d4={'start':0x22,'length':0x8,'type':_0x2c7b18['_FLOAT']},_0x495313={'start':0x2b,'length':0x8,'type':_0x2c7b18['_FLOAT']},_0x3361b1={'start':0x34,'length':0xb,'type':_0x2c7b18['_FLOAT']},_0x14a00c={'start':0x3f,'length':0x5,'type':_0x2c7b18[_0x1e2dc1(0x2de)]},_0x3d8dba={'start':0x44,'length':0x1,'type':_0x2c7b18['_INT']};function _0x57391a(_0x142100,_0x110c73,_0x488d60=![]){const _0x242fac=_0x488d60?_0x142100:_0x5e6f87(_0x142100);return _0x3e537f(_0x242fac,0x2,_0x110c73);}function _0x71f9c1(_0x120826,_0x3521de){return _0x57391a(_0x120826,_0x72833d,_0x3521de);}function _0x34d9b4(_0x57948a,_0x18683c){return _0x57391a(_0x57948a,_0x188456,_0x18683c);}function _0x2cde2c(_0x4f20bb,_0x541820){return _0x57391a(_0x4f20bb,_0x369ead,_0x541820);}function _0x1beba5(_0x26e56c,_0x4c7acd){return _0x57391a(_0x26e56c,_0x279859,_0x4c7acd);}function _0x45caa8(_0x228b47,_0x75b9da){return _0x57391a(_0x228b47,_0x4e8ad9,_0x75b9da);}function _0xa77ec2(_0x5db2b7,_0x307c9d){return _0x57391a(_0x5db2b7,_0x3d58d4,_0x307c9d);}function _0x2fe186(_0x4c424b,_0x42aeaf){return _0x57391a(_0x4c424b,_0x495313,_0x42aeaf);}function _0x695abe(_0x37e555,_0x9af6b9){return _0x57391a(_0x37e555,_0x3361b1,_0x9af6b9);}function _0x48f93d(_0x4b76ca,_0x58ea84){return _0x57391a(_0x4b76ca,_0x14a00c,_0x58ea84);}function _0x109e25(_0x4510bb,_0x156527){return _0x57391a(_0x4510bb,_0x3d8dba,_0x156527);}function _0x452617(_0x8bd7c0,_0x5b1d24){const _0xe00523=_0x294a26(_0x8bd7c0,_0x5b1d24),_0x5576ed=_0x333cb4(_0xe00523),_0x289870=_0x5d3dda(_0x8bd7c0,_0x5b1d24),_0x8e5f9f=_0x289870['toString']()['padStart'](0x3,0x0),_0x368f63=_0x4d3937(_0x8bd7c0,_0x5b1d24);return _0x5576ed+'-'+_0x8e5f9f+_0x368f63;}function _0x57856e(_0x12f302,_0x4f364c=![]){var _0x15b8d7=_0x1e2dc1;const _0x4d6602=_0x5e6f87(_0x12f302),{name:_0x2f1e4e}=_0x4d6602;return _0x4f364c?_0x2f1e4e||_0x452617(_0x4d6602,!![]):_0x2f1e4e||_0x15b8d7(0x1f2);}function _0x287848(_0x17a99b){const _0x1b29b5=_0x134468(_0x17a99b),_0x241bf3=_0x1e605c(_0x17a99b);return _0x4860ae(_0x1b29b5,_0x241bf3);}function _0x97366a(_0x4738cd){return parseInt(_0x3a2d46/_0x695abe(_0x4738cd),0xa);}function _0x19ce25(_0x3e20b1){return _0x97366a(_0x3e20b1)/_0x17ace0;}function _0x4a00ce(_0x224f1a){return _0x97366a(_0x224f1a)/_0x15840f;}const _0x16b1ce={'_DEFAULT':_0x1e2dc1(0x35a),0x1:'Mean\x20elements,\x20ecc\x20>=\x201.0\x20or\x20ecc\x20<\x20-0.001\x20or\x20a\x20<\x200.95\x20er',0x2:_0x1e2dc1(0x34b),0x3:'Pert\x20elements,\x20ecc\x20<\x200.0\x20\x20or\x20\x20ecc\x20>\x201.0',0x4:'Semi-latus\x20rectum\x20<\x200.0',0x5:'Epoch\x20elements\x20are\x20sub-orbital',0x6:'Satellite\x20has\x20decayed'};let _0x5ac392={},_0x166a11={},_0x34146c={},_0x49528d={};const _0x307434=[_0x5ac392,_0x166a11,_0x34146c,_0x49528d];function _0x9813c4(){var _0x3a4d31=_0x1e2dc1;return _0x307434[_0x3a4d31(0x235)](_0x26cf7f);}function _0x3f3809(){var _0x3541a4=_0x1e2dc1;_0x307434[_0x3541a4(0x25d)]((_0x43fbab,_0x2d2eb4)=>{_0x307434[_0x2d2eb4]={};});}function _0x529e81(_0x30f1da,_0x2ab8be,_0xe43db0,_0x1921ef,_0x4e142b){var _0x4aa6c4=_0x1e2dc1;const _0x55d42b=_0x2ab8be||Date['now'](),{tle:_0x4b1ecf,error:_0x2aeddb}=_0x5e6f87(_0x30f1da);if(_0x2aeddb)throw new Error(_0x2aeddb);const _0xadb3ea={'lat':36.9613422,'lng':-122.0308,'height':0.37},_0x375fef=_0xe43db0||_0xadb3ea[_0x4aa6c4(0x251)],_0x32e839=_0x1921ef||_0xadb3ea['lng'],_0x191fd6=_0x4e142b||_0xadb3ea['height'],_0xc8ed16=_0x4b1ecf[0x0]+'-'+_0x55d42b+'-'+_0xe43db0+'-'+_0x1921ef+'\x0a-'+_0x4e142b;if(_0x5ac392[_0xc8ed16])return _0x5ac392[_0xc8ed16];const _0x101805=_0x196317['twoline2satrec'](_0x4b1ecf[0x0],_0x4b1ecf[0x1]);if(_0x101805['error'])throw new Error(_0x16b1ce[_0x101805['error']]||_0x16b1ce['_DEFAULT']);const _0x4ed5eb=new Date(_0x55d42b),_0x16b99c=_0x196317['propagate'](_0x101805,_0x4ed5eb),_0x310c23=_0x16b99c[_0x4aa6c4(0x27d)],_0x14abc2=_0x16b99c[_0x4aa6c4(0x314)],_0x48abaa={'latitude':_0x5c2828(_0x375fef),'longitude':_0x5c2828(_0x32e839),'height':_0x191fd6},_0x77015f=_0x196317['gstime'](_0x4ed5eb),_0x17eb1c=_0x196317['eciToEcf'](_0x310c23,_0x77015f),_0x1b4e23=_0x196317['eciToGeodetic'](_0x310c23,_0x77015f),_0x5a51ef=_0x196317['ecfToLookAngles'](_0x48abaa,_0x17eb1c),_0x5af21c=Math['sqrt'](Math[_0x4aa6c4(0x22c)](_0x14abc2['x'],0x2)+Math['pow'](_0x14abc2['y'],0x2)+Math['pow'](_0x14abc2['z'],0x2)),{azimuth:_0x3bb363,elevation:_0x3f8d6b,rangeSat:_0x7d27c4}=_0x5a51ef,{longitude:_0x39c08a,latitude:_0xb65bfe,height:_0x866256}=_0x1b4e23,_0x36424d={'lng':_0x196317['degreesLong'](_0x39c08a),'lat':_0x196317['degreesLat'](_0xb65bfe),'elevation':_0x1b6528(_0x3f8d6b),'azimuth':_0x1b6528(_0x3bb363),'range':_0x7d27c4,'height':_0x866256,'velocity':_0x5af21c};return _0x5ac392[_0xc8ed16]=_0x36424d,_0x36424d;}function _0x22c0dd(_0x5de983,_0x4d2c40){var _0x4cf5b3=_0x1e2dc1;const {tle:_0x4548ec}=_0x5de983,_0x132450=_0x19ce25(_0x4548ec)*0x3c*0x3e8,_0x42edbd=_0x4548ec[0x0][_0x4cf5b3(0x28f)](0x0,0x1e),_0x58341c=_0x166a11[_0x42edbd];if(!_0x58341c)return![];if(_0x58341c===-0x1)return _0x58341c;const _0x27fccf=_0x58341c[_0x4cf5b3(0x311)](_0x2f4030=>{var _0x123d71=_0x4cf5b3;if(typeof _0x2f4030===_0x123d71(0x20b)&&_0x2f4030['tle']===_0x4548ec)return-0x1;const _0x2f6b6e=_0x4d2c40-_0x2f4030,_0x42b76c=_0x2f6b6e>0x0,_0x2291f0=_0x42b76c&&_0x2f6b6e<_0x132450;return _0x2291f0;});return _0x27fccf[0x0]||![];}function _0x5bfa5d(_0x1e556c,_0x42c779){var _0x30bc98=_0x1e2dc1;const _0x52ddc8=_0x5e6f87(_0x1e556c),{tle:_0xa95c48}=_0x52ddc8,_0x3c74ab=_0x22c0dd(_0x52ddc8,_0x42c779);if(_0x3c74ab)return _0x3c74ab;const _0x316614=_0x42c779||Date['now']();let _0x43706d=0x3e8*0x3c*0x3,_0x281550=[],_0x43d7dd=[],_0x3970e6=_0x316614,_0x4a8b65=![],_0x4396ab=0x0,_0x13aab5=![];const _0x47e75a=0x3e8;while(!_0x13aab5){_0x281550=_0x51d3c1(_0xa95c48,_0x3970e6);const [_0x1e75c5]=_0x281550;_0x4a8b65=_0x2ee115(_0x43d7dd[0x0],_0x1e75c5),_0x4a8b65?(_0x3970e6+=_0x43706d,_0x43706d=_0x43706d/0x2):(_0x3970e6-=_0x43706d,_0x43d7dd=_0x281550),_0x13aab5=_0x43706d<0x1f4||_0x4396ab>=_0x47e75a,_0x4396ab++;}const _0x3b0357=_0x4396ab-0x1===_0x47e75a,_0x32cb2d=_0x3b0357?-0x1:parseInt(_0x3970e6,0xa),_0x3c9a07=_0xa95c48[0x0];return!_0x166a11[_0x3c9a07]&&(_0x166a11[_0x3c9a07]=[]),_0x3b0357?_0x166a11[_0x3c9a07]=-0x1:_0x166a11[_0x3c9a07][_0x30bc98(0x1fa)](_0x32cb2d),_0x32cb2d;}function _0x4b2709(_0x40774d,_0x5871aa=Date[_0x1e2dc1(0x2bb)]()){const {lat:_0x376f86,lng:_0x2cd0a6}=_0x529e81(_0x40774d,_0x5871aa);return{'lat':_0x376f86,'lng':_0x2cd0a6};}function _0x51d3c1(_0x309ae2,_0x51e2d2=Date['now']()){const {lat:_0x275cb9,lng:_0x2b4497}=_0x529e81(_0x309ae2,_0x51e2d2);return[_0x2b4497,_0x275cb9];}function _0x328db0(_0x31ebc3){return _0x51d3c1(_0x31ebc3,_0x287848(_0x31ebc3));}function _0x105587({observerLat:_0x46f092,observerLng:_0x56f9da,observerHeight:observerHeight=0x0,tles:tles=[],elevationThreshold:elevationThreshold=0x0,timestampMS:timestampMS=Date['now']()}){return tles['reduce']((_0x330d69,_0x4116f3)=>{let _0x1b28f2;try{_0x1b28f2=_0x529e81(_0x4116f3,timestampMS,_0x46f092,_0x56f9da,observerHeight);}catch(_0x3f90c2){return _0x330d69;}const {elevation:_0x2d49de,velocity:_0x42bd0a,range:_0x45519b}=_0x1b28f2;return _0x2d49de>=elevationThreshold?_0x330d69['concat']({'tleArr':_0x4116f3,'info':_0x1b28f2}):_0x330d69;},[]);}function*_0x426774(_0x4e6214,_0x299264,_0x5be2f7){let _0x4aaaf8=_0x299264-_0x5be2f7;while(!![]){_0x4aaaf8+=_0x5be2f7,yield{'curTimeMS':_0x4aaaf8,'lngLat':_0x51d3c1(_0x4e6214,_0x4aaaf8)};}}function _0x5c1d6a(_0x397c0c){return new Promise(_0x5f3c55=>setTimeout(_0x5f3c55,_0x397c0c));}async function _0x534cb0({tle:_0xbfc0c4,startTimeMS:startTimeMS=Date['now'](),stepMS:stepMS=0x3e8,sleepMS:sleepMS=0x0,jobChunkSize:jobChunkSize=0x3e8,maxTimeMS:maxTimeMS=0x5b8d80,isLngLatFormat:isLngLatFormat=!![]}){var _0x5057fd=_0x1e2dc1;const {tle:_0x7dffda}=_0x5e6f87(_0xbfc0c4),_0x3a7153=(startTimeMS/0x3e8)[_0x5057fd(0x183)](),_0x5aa4bd=_0x7dffda[0x0]+'-'+_0x3a7153+'-'+stepMS+'-'+isLngLatFormat;if(_0x34146c[_0x5aa4bd])return _0x34146c[_0x5aa4bd];const _0x899029=_0x426774(_0x7dffda,startTimeMS,stepMS);let _0xbf07e6=0x0,_0xe27489=![],_0x315028=[],_0x163060;while(!_0xe27489){const {curTimeMS:_0x4ecad0,lngLat:_0x2f7f50}=_0x899029['next']()['value'],[_0x2ca6d8,_0x5dbc3f]=_0x2f7f50,_0x3364ad=_0x2ee115(_0x163060,_0x2ca6d8),_0x49ae3c=maxTimeMS&&_0x4ecad0-startTimeMS>maxTimeMS;_0xe27489=_0x3364ad||_0x49ae3c;if(_0xe27489)break;isLngLatFormat?_0x315028['push'](_0x2f7f50):_0x315028['push']([_0x5dbc3f,_0x2ca6d8]),sleepMS&&_0xbf07e6%jobChunkSize===0x0&&await _0x5c1d6a(sleepMS),_0x163060=_0x2ca6d8,_0xbf07e6++;}return _0x34146c[_0x5aa4bd]=_0x315028,_0x315028;}function _0xc95a16({tle:_0x341a39,startTimeMS:startTimeMS=Date[_0x1e2dc1(0x2bb)](),stepMS:stepMS=0x3e8,maxTimeMS:maxTimeMS=0x5b8d80,isLngLatFormat:isLngLatFormat=!![]}){const {tle:_0x1c03ed}=_0x5e6f87(_0x341a39),_0x47a917=(startTimeMS/0x3e8)['toFixed'](),_0x3c189d=_0x1c03ed[0x0]+'-'+_0x47a917+'-'+stepMS+'-'+isLngLatFormat;if(_0x34146c[_0x3c189d])return _0x34146c[_0x3c189d];let _0x1e2b67=![],_0x4e8bd4=[],_0x274dcd,_0x439863=startTimeMS;while(!_0x1e2b67){const _0x543585=_0x51d3c1(_0x1c03ed,_0x439863),[_0x5b4c04,_0x60110d]=_0x543585,_0x463d62=_0x2ee115(_0x274dcd,_0x5b4c04),_0x28e760=maxTimeMS&&_0x439863-startTimeMS>maxTimeMS;_0x1e2b67=_0x463d62||_0x28e760;if(_0x1e2b67)break;isLngLatFormat?_0x4e8bd4['push'](_0x543585):_0x4e8bd4['push']([_0x60110d,_0x5b4c04]),_0x274dcd=_0x5b4c04,_0x439863+=stepMS;}return _0x34146c[_0x3c189d]=_0x4e8bd4,_0x4e8bd4;}function _0x3cd874({tle:_0x33cbc5,startTimeMS:startTimeMS=Date['now'](),stepMS:stepMS=0x3e8,isLngLatFormat:isLngLatFormat=!![]}){var _0x3a532d=_0x1e2dc1;const _0x457539=_0x5e6f87(_0x33cbc5),_0x46592f=_0x97366a(_0x457539),_0x41780d=_0x5bfa5d(_0x457539,startTimeMS),_0x24ff28=_0x41780d!==-0x1;if(!_0x24ff28)return Promise['all']([_0x534cb0({'tle':_0x457539,'startTimeMS':startTimeMS,'stepMS':_0x17ace0,'maxTimeMS':_0x3a2d46/0x4,'isLngLatFormat':isLngLatFormat})]);const _0x13c3d4=_0x46592f/0x5,_0x5f4955=_0x5bfa5d(_0x457539,_0x41780d-_0x13c3d4),_0x3e2d0a=_0x5bfa5d(_0x457539,_0x41780d+_0x46592f+_0x13c3d4),_0x3cc1a6=[_0x534cb0({'tle':_0x457539,'startTimeMS':_0x5f4955,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat}),_0x534cb0({'tle':_0x457539,'startTimeMS':_0x41780d,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat}),_0x534cb0({'tle':_0x457539,'startTimeMS':_0x3e2d0a,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat})];return Promise[_0x3a532d(0x1c0)](_0x3cc1a6);}function _0x1307ec({tle:_0x4ec5ae,stepMS:stepMS=0x3e8,optionalTimeMS:optionalTimeMS=Date['now'](),isLngLatFormat:isLngLatFormat=!![]}){const _0x5038ed=_0x5e6f87(_0x4ec5ae),{tle:_0x5b843d}=_0x5038ed,_0x42fe4a=_0x97366a(_0x5b843d),_0x54b029=_0x5bfa5d(_0x5038ed,optionalTimeMS),_0x19c99b=_0x54b029!==-0x1;if(!_0x19c99b){const _0x11e9e4=_0xc95a16({'tle':_0x5038ed,'startTimeMS':optionalTimeMS,'stepMS':_0x17ace0,'maxTimeMS':_0x3a2d46/0x4});return _0x11e9e4;}const _0x1987cb=_0x42fe4a/0x5,_0x5ceb3a=_0x5bfa5d(_0x5038ed,_0x54b029-_0x1987cb),_0xdd1810=_0x5bfa5d(_0x5038ed,_0x54b029+_0x42fe4a+_0x1987cb),_0x45927d=[_0x5ceb3a,_0x54b029,_0xdd1810],_0x48f1b0=_0x45927d['map'](_0x51a0cc=>{return _0xc95a16({'tle':_0x5038ed,'startTimeMS':_0x51a0cc,'stepMS':stepMS,'isLngLatFormat':isLngLatFormat});});return _0x48f1b0;}function _0x5524c1(_0x1743b6,_0x9e598e=Date['now']()){var _0x4388eb=_0x1e2dc1;const _0x1b3371=this['parseTLE'](_0x1743b6),_0x3e866c=this[_0x4388eb(0x2c3)](_0x1b3371['arr'],_0x9e598e),_0x475494=this[_0x4388eb(0x2c3)](_0x1b3371['arr'],_0x9e598e+0x2710),_0xeb613a=_0x2ee115(_0x3e866c[0x1],_0x475494[0x1]);if(_0xeb613a)return{};const _0x42751b=_0x5c2828(_0x3e866c[0x0]),_0x5e1101=_0x5c2828(_0x475494[0x0]),_0x424732=_0x5c2828(_0x3e866c[0x1]),_0x29c60e=_0x5c2828(_0x475494[0x1]),_0x3506f5=_0x42751b>=_0x5e1101?'S':'N',_0x470c5b=_0x424732>=_0x29c60e?'W':'E',_0x399e0d=Math[_0x4388eb(0x226)](_0x29c60e-_0x424732)*Math['cos'](_0x5e1101),_0x11796a=Math['cos'](_0x42751b)*Math['sin'](_0x5e1101)-Math[_0x4388eb(0x226)](_0x42751b)*Math[_0x4388eb(0x2dd)](_0x5e1101)*Math['cos'](_0x29c60e-_0x424732),_0x298f8f=_0x1b6528(Math[_0x4388eb(0x1e8)](_0x399e0d,_0x11796a));return{'degrees':_0x298f8f,'compass':''+_0x3506f5+_0x470c5b};}_0x577406['clearCache']=_0x3f3809,_0x577406['clearTLEParseCache']=_0x7834be,_0x577406['computeChecksum']=_0x258689,_0x577406['getAverageOrbitTimeMS']=_0x97366a,_0x577406['getAverageOrbitTimeMins']=_0x19ce25,_0x577406['getAverageOrbitTimeS']=_0x4a00ce,_0x577406['getBstarDrag']=_0x3c8b77,_0x577406[_0x1e2dc1(0x2aa)]=_0x452617,_0x577406[_0x1e2dc1(0x25e)]=_0x9813c4,_0x577406['getCatalogNumber']=_0x37c160,_0x577406['getCatalogNumber1']=_0x37c160,_0x577406['getCatalogNumber2']=_0x34d9b4,_0x577406['getChecksum1']=_0x36ca9a,_0x577406[_0x1e2dc1(0x1c8)]=_0x109e25,_0x577406['getClassification']=_0x4e2141,_0x577406['getEccentricity']=_0x45caa8,_0x577406['getEpochDay']=_0x134468,_0x577406['getEpochTimestamp']=_0x287848,_0x577406['getEpochYear']=_0x1e605c,_0x577406['getFirstTimeDerivative']=_0x46d831,_0x577406['getGroundTracks']=_0x3cd874,_0x577406[_0x1e2dc1(0x238)]=_0x1307ec,_0x577406[_0x1e2dc1(0x14d)]=_0x2cde2c,_0x577406['getIntDesignatorLaunchNumber']=_0x5d3dda,_0x577406['getIntDesignatorPieceOfLaunch']=_0x4d3937,_0x577406['getIntDesignatorYear']=_0x294a26,_0x577406['getLastAntemeridianCrossingTimeMS']=_0x5bfa5d,_0x577406['getLatLngObj']=_0x4b2709,_0x577406[_0x1e2dc1(0x290)]=_0x24cf28,_0x577406[_0x1e2dc1(0x32b)]=_0x71f9c1,_0x577406['getLngLatAtEpoch']=_0x328db0,_0x577406['getMeanAnomaly']=_0x2fe186,_0x577406['getMeanMotion']=_0x695abe,_0x577406['getOrbitModel']=_0x2c9f7e,_0x577406['getOrbitTrack']=_0x534cb0,_0x577406['getOrbitTrackSync']=_0xc95a16,_0x577406['getPerigee']=_0xa77ec2,_0x577406['getRevNumberAtEpoch']=_0x48f93d,_0x577406['getRightAscension']=_0x1beba5,_0x577406['getSatBearing']=_0x5524c1,_0x577406['getSatelliteInfo']=_0x529e81,_0x577406['getSatelliteName']=_0x57856e,_0x577406[_0x1e2dc1(0x1af)]=_0x227e9d,_0x577406['getTleSetNumber']=_0x421ed9,_0x577406['getVisibleSatellites']=_0x105587,_0x577406['isValidTLE']=_0x5c9ce6,_0x577406['parseTLE']=_0x5e6f87,Object[_0x1e2dc1(0x20f)](_0x577406,'__esModule',{'value':!![]});}));}(tlejs_umd$1,tlejs_umd$1[_0x16ff71(0x192)]));var tlejs_umd=getDefaultExportFromCjs(tlejs_umd$1['exports']),tle=_mergeNamespaces({'__proto__':null,'default':tlejs_umd},[tlejs_umd$1['exports']]);const Cesium$9=mars3d__namespace[_0x16ff71(0x244)];class Tle{constructor(_0x3f2bf2,_0xfa2f3a,_0x51af28){var _0x173612=_0x16ff71;this['tle1']=_0x3f2bf2,this['tle2']=_0xfa2f3a,this['name']=_0x51af28||'',this['_satrec']=twoline2satrec$1(_0x3f2bf2,_0xfa2f3a),this['_parseTLE']=tlejs_umd$1['exports'][_0x173612(0x2f6)]([this[_0x173612(0x36e)],this['tle1'],this[_0x173612(0x341)]]);}get['cospar'](){var _0x11d1f6=_0x16ff71;return tlejs_umd$1[_0x11d1f6(0x192)][_0x11d1f6(0x2aa)](this[_0x11d1f6(0x21c)],!![]);}get['norad'](){var _0x12d328=_0x16ff71;return tlejs_umd$1['exports']['getCatalogNumber'](this[_0x12d328(0x21c)],!![]);}get[_0x16ff71(0x255)](){var _0x2a99ee=_0x16ff71;return tlejs_umd$1['exports'][_0x2a99ee(0x29a)](this['_parseTLE'],!![]);}get['intDesignatorYear'](){return tlejs_umd$1['exports']['getIntDesignatorYear'](this['_parseTLE'],!![]);}get['intDesignatorLaunchNumber'](){var _0xb3cf52=_0x16ff71;return tlejs_umd$1[_0xb3cf52(0x192)]['getIntDesignatorLaunchNumber'](this['_parseTLE'],!![]);}get[_0x16ff71(0x1ea)](){var _0x536f92=_0x16ff71;return tlejs_umd$1['exports'][_0x536f92(0x2a9)](this[_0x536f92(0x21c)],!![]);}get['epochYear'](){return tlejs_umd$1['exports']['getEpochYear'](this['_parseTLE'],!![]);}get[_0x16ff71(0x220)](){return tlejs_umd$1['exports']['getEpochDay'](this['_parseTLE'],!![]);}get['firstTimeDerivative'](){var _0x57419a=_0x16ff71;return tlejs_umd$1[_0x57419a(0x192)]['getFirstTimeDerivative'](this['_parseTLE'],!![]);}get['secondTimeDerivative'](){return tlejs_umd$1['exports']['getSecondTimeDerivative'](this['_parseTLE'],!![]);}get[_0x16ff71(0x386)](){return tlejs_umd$1['exports']['getBstarDrag'](this['_parseTLE'],!![]);}get[_0x16ff71(0x227)](){var _0xbfaaf5=_0x16ff71;return tlejs_umd$1[_0xbfaaf5(0x192)]['getOrbitModel'](this['_parseTLE'],!![]);}get['tleSetNumber'](){return tlejs_umd$1['exports']['getTleSetNumber'](this['_parseTLE'],!![]);}get['checksum1'](){return tlejs_umd$1['exports']['getChecksum1'](this['_parseTLE'],!![]);}get['inclination'](){return tlejs_umd$1['exports']['getInclination'](this['_parseTLE'],!![]);}get['rightAscension'](){return tlejs_umd$1['exports']['getRightAscension'](this['_parseTLE'],!![]);}get['eccentricity'](){var _0x405666=_0x16ff71;return tlejs_umd$1[_0x405666(0x192)]['getEccentricity'](this['_parseTLE'],!![]);}get['perigee'](){return tlejs_umd$1['exports']['getPerigee'](this['_parseTLE'],!![]);}get['meanAnomaly'](){var _0x51baec=_0x16ff71;return tlejs_umd$1['exports'][_0x51baec(0x1dd)](this['_parseTLE'],!![]);}get[_0x16ff71(0x176)](){var _0x201447=_0x16ff71;return tlejs_umd$1['exports']['getMeanMotion'](this[_0x201447(0x21c)],!![]);}get['period'](){return parseInt(0x5a0/parseFloat(this['meanMotion']));}get['revNumberAtEpoch'](){return tlejs_umd$1['exports']['getRevNumberAtEpoch'](this['_parseTLE'],!![]);}get[_0x16ff71(0x23d)](){var _0x25d681=_0x16ff71;return tlejs_umd$1['exports']['getChecksum2'](this[_0x25d681(0x21c)],!![]);}[_0x16ff71(0x2fd)](_0x5f13b0,_0x47c402){var _0x5c2348=_0x16ff71;if(!_0x5f13b0)_0x5f13b0=new Date();else{if(mars3d__namespace['Util'][_0x5c2348(0x17e)](_0x5f13b0))_0x5f13b0=new Date(_0x5f13b0);else _0x5f13b0 instanceof Cesium$9[_0x5c2348(0x22e)]&&(_0x5f13b0=Cesium$9['JulianDate']['toDate'](_0x5f13b0));}const _0x4a612e=propagate$1(this['_satrec'],_0x5f13b0),_0x4df975=_0x4a612e[_0x5c2348(0x27d)];if(_0x4df975==null||isNaN(_0x4df975['x']))return null;return _0x47c402&&(_0x4a612e[_0x5c2348(0x156)]=gstime$1(_0x5f13b0)),_0x4a612e;}[_0x16ff71(0x29d)](_0x40d6a0){var _0x2187e2=_0x16ff71;const _0x2e503e=this['_getEciPositionAndVelocity'](_0x40d6a0,!![]);if(!_0x2e503e)return;const _0x5cc88f=_0x2e503e[_0x2187e2(0x156)],_0x452ade=_0x2e503e[_0x2187e2(0x27d)],_0x42aec5=eciToEcf$1(_0x452ade,_0x5cc88f);return new Cesium$9['Cartesian3'](_0x42aec5['x']*0x3e8,_0x42aec5['y']*0x3e8,_0x42aec5['z']*0x3e8);}[_0x16ff71(0x1bd)](_0x52bad5){var _0xb5f6fa=_0x16ff71;const _0x47d1b7=this['_getEciPositionAndVelocity'](_0x52bad5);if(!_0x47d1b7)return;const _0xac3ae4=_0x47d1b7[_0xb5f6fa(0x27d)];return new Cesium$9['Cartesian3'](_0xac3ae4['x']*0x3e8,_0xac3ae4['y']*0x3e8,_0xac3ae4['z']*0x3e8);}['getEciPositionAndGeodetic'](_0x57914f){var _0x2ea668=_0x16ff71;const _0xdc9ea0=this['_getEciPositionAndVelocity'](_0x57914f,!![]);if(!_0xdc9ea0)return;const _0x5f4ed7=_0xdc9ea0[_0x2ea668(0x156)],_0x30354f=_0xdc9ea0['position'],_0x2f24e7=eciToGeodetic$1(_0x30354f,_0x5f4ed7),_0x181c1f=degreesLong$1(_0x2f24e7[_0x2ea668(0x1d6)]),_0x304e5b=degreesLat$1(_0x2f24e7['latitude']),_0x4f62a5=_0x2f24e7[_0x2ea668(0x1ee)]*0x3e8;return{'positionEci':new Cesium$9['Cartesian3'](_0x30354f['x']*0x3e8,_0x30354f['y']*0x3e8,_0x30354f['z']*0x3e8),'velocityEci':_0xdc9ea0['velocity'],'lng':_0x181c1f,'lat':_0x304e5b,'alt':_0x4f62a5};}[_0x16ff71(0x382)](_0x37f41b){var _0x1901af=_0x16ff71;const _0x2c9a49=this[_0x1901af(0x2b8)](_0x37f41b);return _0x2c9a49?new mars3d__namespace['LngLatPoint'](_0x2c9a49['lng'],_0x2c9a49[_0x1901af(0x251)],_0x2c9a49[_0x1901af(0x364)]):undefined;}['getLookAngles'](_0x5a72f3,_0x164e83){var _0x5f1312=_0x16ff71;const _0x355279=this[_0x5f1312(0x2fd)](_0x164e83,!![]);if(!_0x355279)return;const _0x1acfa2=_0x355279[_0x5f1312(0x156)],_0x108f50=_0x355279['position'],_0x1486cb=eciToEcf$1(_0x108f50,_0x1acfa2),_0x5e22f2={'longitude':degreesToRadians$1(_0x5a72f3[_0x5f1312(0x224)]),'latitude':degreesToRadians$1(_0x5a72f3[_0x5f1312(0x251)]),'height':_0x5a72f3['alt']/0x3e8},_0x2503c2=ecfToLookAngles$1(_0x5e22f2,_0x1486cb);return{'position':new Cesium$9['Cartesian3'](_0x1486cb['x']*0x3e8,_0x1486cb['y']*0x3e8,_0x1486cb['z']*0x3e8),'range':_0x2503c2['rangeSat']*0x3e8,'azimuth':radiansToDegrees$1(_0x2503c2[_0x5f1312(0x2ce)]),'elevation':radiansToDegrees$1(_0x2503c2['elevation'])};}static[_0x16ff71(0x382)](_0x14bf30,_0x59064b,_0xdc18f0){return new Tle(_0x14bf30,_0x59064b)['getPoint'](_0xdc18f0);}static['getEcfPosition'](_0x269e1b,_0x17195b,_0x387404){return new Tle(_0x269e1b,_0x17195b)['getEcfPosition'](_0x387404);}static['gstime'](_0x4d38e1){var _0x14f175=_0x16ff71;return _0x4d38e1 instanceof Cesium$9[_0x14f175(0x22e)]&&(_0x4d38e1=Cesium$9[_0x14f175(0x22e)]['toDate'](_0x4d38e1)),gstime$1(_0x4d38e1);}static[_0x16ff71(0x234)](_0x203f5d,_0x5d551d){var _0x10fc97=_0x16ff71;const _0x59bfed=Tle['gstime'](_0x5d551d),_0x4e0ff2={'x':_0x203f5d['x']/0x3e8,'y':_0x203f5d['y']/0x3e8,'z':_0x203f5d['z']/0x3e8},_0x47dd86=eciToGeodetic$1(_0x4e0ff2,_0x59bfed),_0x17212c=degreesLong$1(_0x47dd86[_0x10fc97(0x1d6)]),_0x35aaad=degreesLat$1(_0x47dd86['latitude']),_0x2a45ff=_0x47dd86['height']*0x3e8;return new mars3d__namespace['LngLatPoint'](_0x17212c,_0x35aaad,_0x2a45ff);}static['eciToEcf'](_0x58073d,_0x5e02b7){var _0x373927=_0x16ff71;const _0xef450c=Tle[_0x373927(0x1a2)](_0x5e02b7),_0x5e4b72={'x':_0x58073d['x']/0x3e8,'y':_0x58073d['y']/0x3e8,'z':_0x58073d['z']/0x3e8},_0x2459c5=eciToEcf$1(_0x5e4b72,_0xef450c);return new Cesium$9[(_0x373927(0x265))](_0x2459c5['x']*0x3e8,_0x2459c5['y']*0x3e8,_0x2459c5['z']*0x3e8);}static['ecfToEci'](_0x17dfb7,_0x32ad4d){const _0x1038f3=Tle['gstime'](_0x32ad4d),_0x3783a7={'x':_0x17dfb7['x']/0x3e8,'y':_0x17dfb7['y']/0x3e8,'z':_0x17dfb7['z']/0x3e8},_0xcd00ad=ecfToEci$1(_0x3783a7,_0x1038f3);return new Cesium$9['Cartesian3'](_0xcd00ad['x']*0x3e8,_0xcd00ad['y']*0x3e8,_0xcd00ad['z']*0x3e8);}static['coe2tle'](_0x491550){var _0x2a495e=_0x16ff71;const _0x467e4d=formatStr(_0x491550['name'],0x5,'\x20'),_0x56efd8=_0x491550['epochYear'],_0x2e1853=String(_0x491550['epochDay'])[_0x2a495e(0x354)](0x0,0xc),_0x38b410=formatStr(_0x491550['inclination'],0x7),_0x5c5f34=formatStr(_0x491550['rightAscension'],0x8),_0x1c85d9=formatStr(_0x491550['eccentricity'],0x7),_0xb1e836=formatStr(_0x491550['perigee'],0x8),_0x24c28e=formatStr(_0x491550['meanAnomaly'],0x8),_0x7e01ea=formatStr(_0x491550[_0x2a495e(0x176)],0xb),_0x53cda0='1\x20'+_0x467e4d+'U\x2013018A\x20\x20\x20'+_0x56efd8+_0x2e1853+'\x20\x20.00000000\x20\x2000000-0\x20\x2000000-0\x200\x200000',_0x2e1c95='2\x20'+_0x467e4d+'\x20'+_0x38b410+'\x20'+_0x5c5f34+'\x20\x20'+_0x1c85d9+'\x20'+_0xb1e836+'\x20'+_0x24c28e+'\x20'+_0x7e01ea+_0x2a495e(0x159);return[_0x53cda0,_0x2e1c95];}static['tle2coe'](_0x2c341a,_0x3fb601){var _0x33d5e2=_0x16ff71;const _0x7c0a2=new Tle(_0x2c341a,_0x3fb601);return{'name':_0x7c0a2['name'],'epochYear':_0x7c0a2['epochYear'],'epochDay':_0x7c0a2['epochDay'],'inclination':_0x7c0a2['inclination'],'rightAscension':_0x7c0a2[_0x33d5e2(0x2f0)],'eccentricity':_0x7c0a2['eccentricity'],'perigee':_0x7c0a2[_0x33d5e2(0x2af)],'meanAnomaly':_0x7c0a2['meanAnomaly'],'meanMotion':_0x7c0a2['meanMotion']};}}Tle['satellite']=satellite,Tle['tle']=tle,mars3d__namespace[_0x16ff71(0x222)]=Tle;function formatStr(_0xb6c47c,_0x18d38b,_0x431f3b='0'){var _0x49d6fc=_0x16ff71;_0xb6c47c=(_0xb6c47c??'')[_0x49d6fc(0x1e7)]();const _0x44eaf6=_0xb6c47c[_0x49d6fc(0x152)]-_0x18d38b;return _0x44eaf6<=0x0?_0xb6c47c['padStart'](_0x18d38b,_0x431f3b):_0xb6c47c['substring'](_0x44eaf6);}var SatelliteSensorFS=_0x16ff71(0x1c9),SatelliteSensorVS='\x0a#ifdef\x20GL_ES\x0aprecision\x20highp\x20float;\x0a#endif\x0a\x0ain\x20vec3\x20position;\x0ain\x20vec3\x20normal;\x0a\x0aout\x20vec3\x20v_positionEC;\x0aout\x20vec3\x20v_normalEC;\x0a\x0avoid\x20main(void)\x20{\x0a\x20\x20v_positionEC\x20=\x20(czm_modelView\x20*\x20vec4(position,\x201.0)).xyz;\x0a\x20\x20v_normalEC\x20=\x20czm_normal\x20*\x20normal;\x0a\x20\x20gl_Position\x20=\x20czm_modelViewProjection\x20*\x20vec4(position,\x201.0);\x0a}\x0a';const Cesium$8=mars3d__namespace['Cesium'];class CamberRadarPrimitive{constructor(_0x281bed){var _0x35273c=_0x16ff71;this['id']=_0x281bed['id'],this['name']=_0x281bed[_0x35273c(0x36e)],this['_startFovH']=0x0,this['_endFovH']=0x0,this['_startFovV']=0x0,this[_0x35273c(0x210)]=0x0,this['_segmentH']=0x1,this['_segmentV']=0x1,this['_subSegmentH']=0x1,this[_0x35273c(0x1b0)]=0x1,this['_globalAlpha']=0x1,this['_command']=undefined,this[_0x35273c(0x2b5)]=undefined,this['_boundingSphere']=new Cesium$8['BoundingSphere'](),this['_modelMatrix']=Cesium$8['Matrix4'][_0x35273c(0x37a)](Cesium$8['Matrix4'][_0x35273c(0x270)]),this['innerFovRadiusPairs']=_0x281bed['innerFovRadiusPairs'],this['outerFovRadiusPairs']=_0x281bed['outerFovRadiusPairs'],this['radius']=_0x281bed['radius'],this['startRadius']=_0x281bed['startRadius'],this[_0x35273c(0x1ec)]=_0x281bed['translucent'],this[_0x35273c(0x190)]=_0x281bed[_0x35273c(0x190)],this['modelMatrix']=_0x281bed['modelMatrix']??Cesium$8[_0x35273c(0x1f8)]['IDENTITY'],this[_0x35273c(0x19f)]=_0x281bed['startFovH']??Cesium$8['Math'][_0x35273c(0x30c)](-0x32),this['endFovH']=_0x281bed[_0x35273c(0x29b)]??Cesium$8['Math']['toRadians'](0x32),this['startFovV']=_0x281bed[_0x35273c(0x1c5)]??Cesium$8['Math']['toRadians'](0x5),this['endFovV']=_0x281bed['endFovV']??Cesium$8[_0x35273c(0x257)]['toRadians'](0x55),this[_0x35273c(0x306)]=_0x281bed[_0x35273c(0x306)]??0x3c,this['segmentV']=_0x281bed['segmentV']??0x14,this['subSegmentH']=_0x281bed['subSegmentH']??0x3,this['subSegmentV']=_0x281bed['subSegmentV']??0x3,this['color']=_0x281bed['color']??new Cesium$8['Color'](0x1,0x1,0x0,0.5),this['outlineColor']=_0x281bed['outlineColor']??new Cesium$8[(_0x35273c(0x308))](0x1,0x1,0x1),this['show']=_0x281bed[_0x35273c(0x1eb)]??!![];}get['startRadius'](){var _0x252000=_0x16ff71;return this[_0x252000(0x324)];}set['startRadius'](_0x3b40b8){var _0x202fe8=_0x16ff71;this['_startRadius']=_0x3b40b8,this['innerFovRadiusPairs']=[{'fov':Cesium$8['Math']['toRadians'](0x0),'radius':_0x3b40b8},{'fov':Cesium$8['Math'][_0x202fe8(0x30c)](0xa),'radius':0.9*_0x3b40b8},{'fov':Cesium$8['Math']['toRadians'](0x14),'radius':0.8*_0x3b40b8},{'fov':Cesium$8['Math'][_0x202fe8(0x30c)](0x1e),'radius':0.7*_0x3b40b8},{'fov':Cesium$8[_0x202fe8(0x257)][_0x202fe8(0x30c)](0x28),'radius':0.6*_0x3b40b8},{'fov':Cesium$8['Math'][_0x202fe8(0x30c)](0x32),'radius':0.5*_0x3b40b8},{'fov':Cesium$8['Math']['toRadians'](0x3c),'radius':0.4*_0x3b40b8},{'fov':Cesium$8[_0x202fe8(0x257)]['toRadians'](0x46),'radius':0.3*_0x3b40b8},{'fov':Cesium$8['Math'][_0x202fe8(0x30c)](0x50),'radius':0.1*_0x3b40b8},{'fov':Cesium$8[_0x202fe8(0x257)]['toRadians'](0x5a),'radius':0.01*_0x3b40b8}];}get['radius'](){return this['_radius'];}set[_0x16ff71(0x2d1)](_0x6376ca){var _0x8517c8=_0x16ff71;this['_radius']=_0x6376ca,this['outerFovRadiusPairs']=[{'fov':Cesium$8['Math']['toRadians'](0x0),'radius':_0x6376ca},{'fov':Cesium$8[_0x8517c8(0x257)]['toRadians'](0xa),'radius':0.9*_0x6376ca},{'fov':Cesium$8['Math']['toRadians'](0x14),'radius':0.8*_0x6376ca},{'fov':Cesium$8['Math'][_0x8517c8(0x30c)](0x1e),'radius':0.7*_0x6376ca},{'fov':Cesium$8['Math']['toRadians'](0x28),'radius':0.6*_0x6376ca},{'fov':Cesium$8['Math'][_0x8517c8(0x30c)](0x32),'radius':0.5*_0x6376ca},{'fov':Cesium$8['Math']['toRadians'](0x3c),'radius':0.4*_0x6376ca},{'fov':Cesium$8['Math']['toRadians'](0x46),'radius':0.3*_0x6376ca},{'fov':Cesium$8['Math'][_0x8517c8(0x30c)](0x50),'radius':0.1*_0x6376ca},{'fov':Cesium$8['Math'][_0x8517c8(0x30c)](0x5a),'radius':0.01*_0x6376ca}];}[_0x16ff71(0x185)](_0x1650ab){var _0x1718f1=_0x16ff71;const _0x9204f8=this[_0x1718f1(0x2b2)]*this['_segmentH'],_0x33a1b6=this['_subSegmentV']*this['_segmentV'],_0x37ca21=getGridDirs(this[_0x1718f1(0x376)],this['_endFovH'],this[_0x1718f1(0x361)],this['_endFovV'],_0x9204f8,_0x33a1b6,this['_outerFovRadiusPairs']),_0x4762e2=getGridDirs(this['_startFovH'],this['_endFovH'],this[_0x1718f1(0x361)],this['_endFovV'],_0x9204f8,_0x33a1b6,this['_outerFovRadiusPairs']),_0x459cee=getGridIndices(_0x9204f8,_0x33a1b6),_0x388c0c=getLineGridIndices(this['_segmentH'],this['_segmentV'],this['_subSegmentH'],this[_0x1718f1(0x1b0)]);return this['_createRawCommand'](_0x1650ab,_0x37ca21,_0x4762e2,_0x459cee,_0x388c0c);}['_createInnerCurveCommand'](_0x2fa136){var _0x437768=_0x16ff71;const _0x405c88=this['_subSegmentH']*this['_segmentH'],_0x23b6f5=this['_subSegmentV']*this['_segmentV'],_0x5ce196=getGridDirs(this['_startFovH'],this['_endFovH'],this['_startFovV'],this['_endFovV'],_0x405c88,_0x23b6f5,this['_innerFovRadiusPairs']),_0x27d673=getGridDirs(this['_startFovH'],this['_endFovH'],this[_0x437768(0x361)],this[_0x437768(0x210)],_0x405c88,_0x23b6f5,this[_0x437768(0x277)]),_0x367eca=getGridIndices(_0x405c88,_0x23b6f5),_0xf59c91=getLineGridIndices(this['_segmentH'],this['_segmentV'],this['_subSegmentH'],this['_subSegmentV']);return this['_createRawCommand'](_0x2fa136,_0x5ce196,_0x27d673,_0x367eca,_0xf59c91);}[_0x16ff71(0x2b9)](_0x55db3e){var _0x21983c=_0x16ff71;const _0x2f5570=0x1*0xa,_0x569dea=this['_subSegmentV']*this['_segmentV'],_0x1f71a5=getCrossSectionPositions(this['_startFovH'],this['_startFovV'],this[_0x21983c(0x210)],_0x2f5570,_0x569dea,this[_0x21983c(0x277)],this['_outerFovRadiusPairs']),_0x4d21fa=getCrossSectionPositions(this['_startFovH'],this[_0x21983c(0x361)],this['_endFovV'],_0x2f5570,_0x569dea,this['_innerFovRadiusPairs'],this['_outerFovRadiusPairs']),_0x20b5b1=getGridIndices(_0x2f5570,_0x569dea),_0xb4c76d=getLineGridIndices(0xa,this['_segmentV'],0x1,this['_subSegmentV']);return this['_createRawCommand'](_0x55db3e,_0x1f71a5,_0x4d21fa,_0x20b5b1,_0xb4c76d);}[_0x16ff71(0x370)](_0x2049b3){var _0x114722=_0x16ff71;const _0x4f4e61=0x1*0xa,_0x22e7fe=this['_subSegmentV']*this['_segmentV'],_0x3b46e6=getCrossSectionPositions(this['_endFovH'],this['_startFovV'],this['_endFovV'],_0x4f4e61,_0x22e7fe,this[_0x114722(0x277)],this[_0x114722(0x157)]),_0x4f345b=getCrossSectionPositions(this['_endFovH'],this['_startFovV'],this['_endFovV'],_0x4f4e61,_0x22e7fe,this['_innerFovRadiusPairs'],this[_0x114722(0x157)]),_0x420e6a=getGridIndices(_0x4f4e61,_0x22e7fe),_0xa6f7cf=getLineGridIndices(0xa,this['_segmentV'],0x1,this[_0x114722(0x1b0)]);return this['_createRawCommand'](_0x2049b3,_0x3b46e6,_0x4f345b,_0x420e6a,_0xa6f7cf);}['_createRawCommand'](_0x2425e5,_0xa12483,_0x314c07,_0x4ec667,_0x7174ee){var _0x1a7777=_0x16ff71;const _0x10ea85=Cesium$8['ShaderProgram']['replaceCache']({'context':_0x2425e5,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':SatelliteSensorFS,'attributeLocations':attributeLocations}),_0x534446=Cesium$8['Buffer']['createVertexBuffer']({'context':_0x2425e5,'typedArray':_0xa12483,'usage':Cesium$8[_0x1a7777(0x2ba)]['STATIC_DRAW']}),_0x5c11f2=Cesium$8['Buffer']['createVertexBuffer']({'context':_0x2425e5,'typedArray':_0x314c07,'usage':Cesium$8['BufferUsage'][_0x1a7777(0x37c)]}),_0x50a8f6=Cesium$8['Buffer'][_0x1a7777(0x24c)]({'context':_0x2425e5,'typedArray':_0x4ec667,'usage':Cesium$8[_0x1a7777(0x2ba)][_0x1a7777(0x37c)],'indexDatatype':Cesium$8['IndexDatatype'][_0x1a7777(0x2fe)]}),_0x4525bf=Cesium$8['Buffer'][_0x1a7777(0x24c)]({'context':_0x2425e5,'typedArray':_0x7174ee,'usage':Cesium$8[_0x1a7777(0x2ba)][_0x1a7777(0x37c)],'indexDatatype':Cesium$8['IndexDatatype'][_0x1a7777(0x2fe)]}),_0x39e4d0=new Cesium$8['VertexArray']({'context':_0x2425e5,'attributes':[{'index':0x0,'vertexBuffer':_0x534446,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']},{'index':0x1,'vertexBuffer':_0x5c11f2,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']}],'indexBuffer':_0x50a8f6}),_0x1d56e4=new Cesium$8[(_0x1a7777(0x30a))]({'context':_0x2425e5,'attributes':[{'index':0x0,'vertexBuffer':_0x534446,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8[_0x1a7777(0x2f7)]['FLOAT']},{'index':0x1,'vertexBuffer':_0x5c11f2,'componentsPerAttribute':0x3,'componentDatatype':Cesium$8['ComponentDatatype']['FLOAT']}],'indexBuffer':_0x4525bf}),_0x479f68=Cesium$8['BoundingSphere']['fromVertices'](_0xa12483),_0x59b26e=this[_0x1a7777(0x1ec)]??!![],_0xccdf78=this['closed']??![],_0x39d9d9=Cesium$8['Appearance']['getDefaultRenderState'](_0x59b26e,_0xccdf78,undefined),_0x2b6d35=Cesium$8['RenderState']['fromCache'](_0x39d9d9),_0xffc71e=new Cesium$8['DrawCommand']({'vertexArray':_0x39e4d0,'primitiveType':Cesium$8['PrimitiveType'][_0x1a7777(0x285)],'renderState':_0x2b6d35,'shaderProgram':_0x10ea85,'uniformMap':{'marsColor':()=>{return this['color'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'owner':this,'pass':Cesium$8['Pass']['TRANSLUCENT'],'modelMatrix':new Cesium$8['Matrix4'](),'boundingVolume':new Cesium$8['BoundingSphere'](),'cull':!![]}),_0x4ffb35=new Cesium$8['DrawCommand']({'vertexArray':_0x1d56e4,'primitiveType':Cesium$8['PrimitiveType']['LINES'],'renderState':_0x2b6d35,'shaderProgram':_0x10ea85,'uniformMap':{'marsColor':()=>{return this['outlineColor'];},'globalAlpha':()=>{return this['_globalAlpha'];}},'owner':this,'pass':Cesium$8['Pass']['TRANSLUCENT'],'modelMatrix':new Cesium$8['Matrix4'](),'boundingVolume':new Cesium$8['BoundingSphere'](),'cull':!![]});return{'command':_0xffc71e,'lineCommand':_0x4ffb35,'initBoundingSphere':_0x479f68};}[_0x16ff71(0x30d)](_0x5a83fb){var _0x255cfd=_0x16ff71;if(!this['show'])return;const _0x5a1b45=this[_0x255cfd(0x2c8)]!==this['_innerFovRadiusPairs']||this['outerFovRadiusPairs']!==this['_outerFovRadiusPairs']||this[_0x255cfd(0x19f)]!==this['_startFovH']||this['endFovH']!==this['_endFovH']||this['startFovV']!==this['_startFovV']||this['endFovV']!==this['_endFovV']||this[_0x255cfd(0x306)]!==this['_segmentH']||this[_0x255cfd(0x151)]!==this['_segmentV']||this[_0x255cfd(0x298)]!==this[_0x255cfd(0x2b2)]||this['subSegmentV']!==this['_subSegmentV'];_0x5a1b45&&(this['_innerFovRadiusPairs']=this['innerFovRadiusPairs'],this['_outerFovRadiusPairs']=this['outerFovRadiusPairs'],this[_0x255cfd(0x376)]=this['startFovH'],this[_0x255cfd(0x32a)]=this['endFovH'],this['_startFovV']=this['startFovV'],this[_0x255cfd(0x210)]=this['endFovV'],this['_segmentH']=this['segmentH'],this['_segmentV']=this['segmentV'],this['_subSegmentH']=this[_0x255cfd(0x298)],this['_subSegmentV']=this['subSegmentV'],this['_modelMatrix']=Cesium$8['clone'](Cesium$8['Matrix4']['IDENTITY']),this['_destroyCommands']()),(!Cesium$8[_0x255cfd(0x31a)](this['_commands'])||this['_commands'][_0x255cfd(0x152)]===0x0)&&(this['_commands']||(this[_0x255cfd(0x272)]=[]),this['_destroyCommands'](),this['_commands']['push'](this['_createOuterCurveCommand'](_0x5a83fb['context'])),this['_commands']['push'](this[_0x255cfd(0x2b9)](_0x5a83fb['context'])),this['_commands'][_0x255cfd(0x1fa)](this[_0x255cfd(0x370)](_0x5a83fb['context'])),this['_commands']['push'](this['_createInnerCurveCommand'](_0x5a83fb['context']))),!Cesium$8[_0x255cfd(0x1f8)][_0x255cfd(0x344)](this['modelMatrix'],this[_0x255cfd(0x32d)])&&(Cesium$8[_0x255cfd(0x1f8)]['clone'](this['modelMatrix'],this['_modelMatrix']),this['_commands'][_0x255cfd(0x25d)](_0x44c49d=>{var _0x4918be=_0x255cfd;_0x44c49d['command'][_0x4918be(0x32c)]=Cesium$8[_0x4918be(0x1f8)]['IDENTITY'],_0x44c49d['command']['modelMatrix']=this['_modelMatrix'],_0x44c49d['command']['boundingVolume']=Cesium$8['BoundingSphere']['transform'](_0x44c49d['initBoundingSphere'],this['_modelMatrix'],this['_boundingSphere']),_0x44c49d['lineCommand']['modelMatrix']=Cesium$8['Matrix4']['IDENTITY'],_0x44c49d['lineCommand'][_0x4918be(0x32c)]=this['_modelMatrix'],_0x44c49d['lineCommand'][_0x4918be(0x325)]=Cesium$8['BoundingSphere']['transform'](_0x44c49d['initBoundingSphere'],this['_modelMatrix'],this[_0x4918be(0x31d)]);})),this['_commands'][_0x255cfd(0x25d)](_0x24bf30=>{var _0x2fb20b=_0x255cfd;_0x24bf30['command']&&_0x5a83fb['commandList']['push'](_0x24bf30[_0x2fb20b(0x351)]),_0x24bf30['lineCommand']&&_0x5a83fb['commandList'][_0x2fb20b(0x1fa)](_0x24bf30[_0x2fb20b(0x2b7)]);});}[_0x16ff71(0x321)](){return![];}['_destroyCommands'](){var _0x39b335=_0x16ff71;this['_commands']&&this['_commands'][_0x39b335(0x25d)](_0x489558=>{var _0x49d926=_0x39b335;Cesium$8['defined'](_0x489558[_0x49d926(0x351)])&&(_0x489558[_0x49d926(0x351)]['shaderProgram']=_0x489558['command']['shaderProgram']&&_0x489558['command']['shaderProgram']['destroy'](),_0x489558['command'][_0x49d926(0x162)]=_0x489558[_0x49d926(0x351)][_0x49d926(0x162)]&&_0x489558['command'][_0x49d926(0x162)]['destroy'](),_0x489558['command']=undefined),Cesium$8[_0x49d926(0x31a)](_0x489558['lineCommand'])&&(_0x489558[_0x49d926(0x2b7)]['shaderProgram']=_0x489558['lineCommand'][_0x49d926(0x240)]&&_0x489558[_0x49d926(0x2b7)]['shaderProgram']['destroy'](),_0x489558[_0x49d926(0x2b7)]['vertexArray']=_0x489558[_0x49d926(0x2b7)]['vertexArray']&&_0x489558['lineCommand'][_0x49d926(0x162)]['destroy'](),_0x489558['lineCommand']=undefined);}),this['_commands']&&(this['_commands']['length']=0x0);}['destroy'](){var _0x1dda69=_0x16ff71;return this[_0x1dda69(0x335)](),Cesium$8['destroyObject'](this);}}const attributeLocations={'position':0x0,'normal':0x1};function getDir(_0x3dcac8,_0x4b5f9c){const _0x3c80c8=_0x3dcac8,_0x31a2c7=_0x4b5f9c,_0x1c4a63=Math['cos'],_0x584667=Math['sin'],_0x727e57=[_0x1c4a63(-_0x3c80c8)*_0x1c4a63(_0x31a2c7),_0x584667(-_0x3c80c8)*_0x1c4a63(_0x31a2c7),_0x584667(_0x31a2c7)];return _0x727e57;}function getFov(_0x3159bf,_0x27c365,_0x57b7bb,_0x236e42){return _0x3159bf+(_0x27c365-_0x3159bf)*(_0x236e42/_0x57b7bb);}function getRadius(_0x5abbce,_0x581680){var _0x143973=_0x16ff71;const _0x1fbd38=_0x581680[_0x143973(0x2db)](_0x4c6a40=>{return _0x4c6a40['fov']>_0x5abbce;});if(_0x1fbd38>0x0){const _0x358b22=_0x581680[_0x1fbd38-0x1],_0x47c459=_0x581680[_0x1fbd38],_0x477432=(_0x5abbce-_0x358b22[_0x143973(0x1c7)])/(_0x47c459[_0x143973(0x1c7)]-_0x358b22['fov']),_0x1420c4=_0x358b22['radius']*(0x1-_0x477432)+_0x47c459['radius']*_0x477432;return _0x1420c4;}else return undefined;}function getGridDirs(_0x244066,_0x1913f9,_0x4928df,_0x567582,_0x51cf93,_0x105186,_0x5a42bd){const _0x1ae473=new Float32Array((_0x51cf93+0x1)*(_0x105186+0x1)*0x3);for(let _0x346c57=0x0;_0x346c57<_0x51cf93+0x1;++_0x346c57){for(let _0x477e61=0x0;_0x477e61<_0x105186+0x1;++_0x477e61){const _0x147a17=getFov(_0x4928df,_0x567582,_0x105186,_0x477e61),_0xe12264=getDir(getFov(_0x244066,_0x1913f9,_0x51cf93,_0x346c57),_0x147a17),_0x3019df=_0x5a42bd?getRadius(_0x147a17,_0x5a42bd):0x1;_0x1ae473[(_0x477e61*(_0x51cf93+0x1)+_0x346c57)*0x3+0x0]=_0xe12264[0x0]*_0x3019df,_0x1ae473[(_0x477e61*(_0x51cf93+0x1)+_0x346c57)*0x3+0x1]=_0xe12264[0x1]*_0x3019df,_0x1ae473[(_0x477e61*(_0x51cf93+0x1)+_0x346c57)*0x3+0x2]=_0xe12264[0x2]*_0x3019df;}}return _0x1ae473;}function getCrossSectionPositions(_0x2918a9,_0x1b79fd,_0x3a3eaa,_0x2344b1,_0x3ee42d,_0x9baa6e,_0x42b577){const _0x2edfeb=new Float32Array((_0x2344b1+0x1)*(_0x3ee42d+0x1)*0x3);for(let _0x5ed63c=0x0;_0x5ed63c<_0x2344b1+0x1;++_0x5ed63c){for(let _0x5ed1fb=0x0;_0x5ed1fb<_0x3ee42d+0x1;++_0x5ed1fb){const _0x52175b=getFov(_0x1b79fd,_0x3a3eaa,_0x3ee42d,_0x5ed1fb),_0x4c958d=getDir(_0x2918a9,_0x52175b),_0x31903b=_0x9baa6e?getRadius(_0x52175b,_0x9baa6e):0x1,_0x455812=_0x42b577?getRadius(_0x52175b,_0x42b577):0x1,_0x5ccbd2=getFov(_0x31903b,_0x455812,_0x2344b1,_0x5ed63c);_0x2edfeb[(_0x5ed1fb*(_0x2344b1+0x1)+_0x5ed63c)*0x3+0x0]=_0x4c958d[0x0]*_0x5ccbd2,_0x2edfeb[(_0x5ed1fb*(_0x2344b1+0x1)+_0x5ed63c)*0x3+0x1]=_0x4c958d[0x1]*_0x5ccbd2,_0x2edfeb[(_0x5ed1fb*(_0x2344b1+0x1)+_0x5ed63c)*0x3+0x2]=_0x4c958d[0x2]*_0x5ccbd2;}}return _0x2edfeb;}function _0x5a1f(){var _0x385e93=['t4cof','del1','passes','emsq','pointsNum','xno','_coneList','setOpacity','getRayEarthPosition','d4422','fromHeadingPitchRoll','_parseTLE','@@iterator','7392PKRHQA','topPsts','epochDay','attributes','Tle','xmcof','lng','SpaceUtil','sin','orbitModel','hintPotsNum','_topWidth','_time_path_end','getUTCSeconds','pow','si3','JulianDate','xfact','_ground_radius','clock','list','getHeadingPitchRollForLine','eciToGeodetic','map','tan','argpdot','getGroundTracksSync','_slices','updateGroundCircleRadius','eastNorthUpToFixedFrame','GeometryPipeline','checksum2','style','WHITE','shaderProgram','fromCartesian','ss4','Ray','Cesium','_trackGeometries','bottomWidth','getRayEarthPositionByMatrix','34414930fsnWJX','_quaternion','_positionCartesian','INERTIAL','createIndexBuffer','isInteger','xl2','isString','_showOneCone','lat','d5433','commandList','_computeGroundConePositions','classification','add','Math','intersectEllipsoid','outlineColor','yaw','getCesiumColor','_pitchRadians','forEach','getCacheSizes','z23','sz23','default','Util','lookAt','cosio','Cartesian3','SceneMode','359996xTiKnn','primitiveType','domdt','conicSensor','apply','argpm','lerp','argpo','path','IDENTITY','ecco','_commands','sz33','xl4','DOUBLE','26JPkxCA','_innerFovRadiusPairs','tle','xni','z31','uniform','extend2CartesianArray','position','getAreaCoords','vao','drawShow','_zReverse','Pass','sz11','DrawCommand','TRIANGLES','sh2','referenceFrame','options','mode','topRadius','outlineOpacity','trim','pitch','getRayEarthPositions','substr','getLineNumber1','posq','nodep','startRadius','delete','cross','lonlats2cartesians','ss2','subSegmentH','from','getClassification','endFovH','LagrangePolynomialApproximation','getEcfPosition','TRANSLUCENT','opacity','_scale','topOutlineShow','_property','_topGeometry','destroy','mdot','values','_pickCommands','_mountedHook','getIntDesignatorPieceOfLaunch','getCOSPAR','PrimitiveType','d5220','fromArray','_updatePositionsHook','perigee','getOwnPropertyDescriptor','sensorType','_subSegmentH','HeadingPitchRoll','atime','_initBoundingSphere','endFovV','lineCommand','getEciPositionAndGeodetic','_createLeftCrossSectionCommand','BufferUsage','now','color','ConicSensor','BoundingSphere','_clearGeometry','x7thm1','_groundCircleEntity','d5421','getLatLonArr','pho','_topOutlineShow','xli','concat','innerFovRadiusPairs','_outline','d3210','_time_current','dedt','_roll_reality','azimuth','_DECIMAL_ASSUMED_E','_addGroundCircleEntity','radius','bottomHeight','currentTime','floor','groundPolyColor','rayEllipsoid','TimeInterval','scene','abs','angle2','findIndex','t5cof','cos','_INT','xi2','xh3','_DECIMAL_ASSUMED','sl2','angle1','sgh2','normal','reduce','\x200:0:0\x20Z','_lookAt','d4410','_matrix','_heading_reality','Appearance','period','hpr','slice','rightAscension','boundingSphere','del2','387320DYcttd','calculate_cam_sight','ss1','parseTLE','ComponentDatatype','_topOutlineGeometry','ellipsoid','roll','144800HwyefM','drawCreated','_getEciPositionAndVelocity','UNSIGNED_SHORT','se3','indices','_reverse','epoch','resolve','FLOAT','tle1','segmentH','fromVertices','Color','sz21','VertexArray','ArcType','toRadians','update','computeNormal','flyToPoint','get','filter','inclm','sz13','velocity','_layer','jdsatepoch','cosim','_angle1','_rayEllipsoidType','defined','d5232','_imagingAreaPositions','_boundingSphere','_enabledDraw','_topHeight','_hintPotsNum','isDestroyed','nodeo','d2211','_startRadius','boundingVolume','constructor','isArray','_headingRadians','outline','_endFovH','getLineNumber2','modelMatrix','_modelMatrix','getTopGeometry','multiplyTransformation','repeat','_angle2','_bottomHeight','start','getValue','_destroyCommands','removeGraphic','_updateStyleHook','distance','fourPir','replaceCache','PolyUtil','SCENE3D','Transforms','pinco','d2201','coneEntity','tle2','xargpo','RectSensor','equals','primitiveCollection','success','minute','latitude','inclp','xh2','Mean\x20motion\x20less\x20than\x200.0','LINES','operationmode','_OBJECT','_rayEllipsoid','si2','command','CallbackProperty','Latitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi/2;\x20pi/2].','substring','_outlineGeometry','xlamo','x1mth2','groundPosition','max','Problematic\x20TLE\x20with\x20unknown\x20error.','_setOptionsHook','_angle','rayPosition','112569CAoHWY','isimp','sz1','_startFovV','sinmao','_showListCone','alt','pass','create','zReverse','hasOwnProperty','createGeometry','_pitch_reality','globalAlpha','includes','format','name','model','_createRightCrossSectionCommand','delmo','d3222','Invalid\x20attempt\x20to\x20spread\x20non-iterable\x20instance.\x0aIn\x20order\x20to\x20be\x20iterable,\x20non-array\x20objects\x20must\x20have\x20a\x20[Symbol.iterator]()\x20method.','nodecf','opsmode','_startFovH','z13','pickId','dmdt','clone','cc1','STATIC_DRAW','sinim','zmol','period_time','renderState','alta','getPoint','orientation','bindPickId','_groundPolyEntity','bstarDrag','getInclination','__esModule','subtract','xgh2','segmentV','length','xlcof','GraphicUtil','GeometryAttribute','gmst','_outerFovRadiusPairs','computeMatrix','000000','Character\x20array\x20empty!','Input\x20object\x20is\x20malformed\x20(should\x20have\x20name\x20and\x20tle\x20properties).','RHUMB','_createGeometry','getTime','ee2','_orientation_show','_translation','vertexArray','getPositionValue','peo','plo','dnodt','createPickId','topShow','fourPindices','topSteps','pgho','nddot','headingRadians','didt','_geometry','string','_topShow','xi3','time','epochyr','matrix','meanMotion','getUTCHours','_positions','9inYbXT','_noDestroy','updateGeometry','t3cof','_globalAlpha','isNumber','_fixedFrameTransform','origin','toDate','con41','toFixed','nodedot','_createOuterCurveCommand','xgh4','cc4','render','fire','_clearDrawCommand','Quaternion','day','inclo','register','reverse','closed','_show','exports','_ARRAY','ss3','_depthTestChange','se2','split','SatelliteSensor','closure','Longitude\x20radians\x20must\x20be\x20in\x20range\x20[-pi;\x20pi].','uniformMap','call','RenderState','remove','startFovH','_promise','fixedFrameTransform','gstime','Set','_drawCommands','fromAngleAndLength','sgh3','bstar','myindexs','BasePointPrimitive','irez','_addGroundConeEntity','omgcof','_outlinePositions','test','getSecondTimeDerivative','_subSegmentV','angle','mon','czmObject','entities','createPickFragmentShaderSource','prepareVAO','topZ','getTopOutlineGeometry','_position','1279716IBANFc','_intersectEllipsoid','sz3','getEciPosition','_outlineColor','direction','all','multiplyByPoint','gsto','undefined','xgh3','startFovV','_time_path_start','fov','getChecksum2','in\x20vec3\x20v_positionEC;\x0ain\x20vec3\x20v_normalEC;\x0a\x0auniform\x20vec4\x20marsColor;\x0auniform\x20float\x20globalAlpha;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec3\x20positionToEyeEC\x20=\x20-v_positionEC;\x0a\x0a\x20\x20vec3\x20normalEC\x20=\x20normalize(v_normalEC);\x0a\x20\x20#ifdef\x20FACE_FORWARD\x0a\x20\x20normalEC\x20=\x20faceforward(normalEC,\x20vec3(0.,\x200.,\x201.),\x20-normalEC);\x0a\x20\x20#endif\x0a\x0a\x20\x20czm_materialInput\x20materialInput;\x0a\x20\x20materialInput.normalEC\x20=\x20normalEC;\x0a\x20\x20materialInput.positionToEyeEC\x20=\x20positionToEyeEC;\x0a\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20material.diffuse\x20=\x20marsColor.rgb;\x0a\x20\x20material.alpha\x20=\x20marsColor.a\x20*\x20globalAlpha;\x0a\x0a\x20\x20#ifdef\x20FLAT\x0a\x20\x20out_FragColor\x20=\x20vec4(material.diffuse\x20+\x20material.emission,\x20material.alpha);\x0a\x20\x20#else\x0a\x20\x20out_FragColor\x20=\x20czm_phong(normalize(positionToEyeEC),\x20material,\x20czm_lightDirectionEC);\x0a\x20\x20#endif\x0a}\x0a','sgh4','_rollRadians','sec','prototype','IntersectionTests','_map','graphic','PointUtil','sqrt','toDegrees','calculateOrbitPoints','fromGeometry','longitude','topS','z11','createOutlineGeometry','_color','point','RED','getMeanAnomaly','_addedHook','aycof','_length','_primitive','rectSensor','type','_FLOAT','_volumeOutlineGeometry','eccsq','toString','atan2','Arguments','intDesignatorPieceOfLaunch','show','translucent','error','height','getCesiumValue','init','1/1/','Unknown','getDefaultRenderState','satn','_tle','groundOutLineColor','iterator','Matrix4','attr','push','del3','xl3','method','_bottomWidth','_updateCone','heading','sl3','_getDrawEntityClass','nodem','inverse','context','withAlpha','_CHAR','Geometry','createDrawCommand','5495kauApb','object','cc5','eta','_attributes_positions','defineProperty','_endFovV'];_0x5a1f=function(){return _0x385e93;};return _0x5a1f();}function getGridIndices(_0x43aa5a,_0x47af2a){const _0x46811e=new Uint16Array(_0x43aa5a*_0x47af2a*0x6);for(let _0x54c4dd=0x0;_0x54c4dd<_0x43aa5a;++_0x54c4dd){for(let _0x59d8b7=0x0;_0x59d8b7<_0x47af2a;++_0x59d8b7){const _0x196452=_0x59d8b7*(_0x43aa5a+0x1)+_0x54c4dd,_0x127b22=_0x59d8b7*(_0x43aa5a+0x1)+_0x54c4dd+0x1,_0x47029d=(_0x59d8b7+0x1)*(_0x43aa5a+0x1)+_0x54c4dd,_0x1e9a76=(_0x59d8b7+0x1)*(_0x43aa5a+0x1)+_0x54c4dd+0x1,_0x1b606a=(_0x59d8b7*_0x43aa5a+_0x54c4dd)*0x6;_0x46811e[_0x1b606a+0x0]=_0x196452,_0x46811e[_0x1b606a+0x1]=_0x127b22,_0x46811e[_0x1b606a+0x2]=_0x1e9a76,_0x46811e[_0x1b606a+0x3]=_0x196452,_0x46811e[_0x1b606a+0x4]=_0x1e9a76,_0x46811e[_0x1b606a+0x5]=_0x47029d;}}return _0x46811e;}function getLineGridIndices(_0x5a97ad,_0x47e1a9,_0x62852b,_0x364de9){const _0x21116b=_0x5a97ad*_0x62852b,_0xa89b31=_0x47e1a9*_0x364de9,_0x27f6ca=new Uint16Array((_0x5a97ad+0x1)*(_0xa89b31*0x2)+(_0x47e1a9+0x1)*(_0x21116b*0x2)+0x4*0x2);for(let _0x553bf2=0x0;_0x553bf2<_0x5a97ad+0x1;++_0x553bf2){for(let _0x4c3d66=0x0;_0x4c3d66<_0xa89b31;++_0x4c3d66){const _0x42634b=_0x553bf2*_0x62852b;_0x27f6ca[(_0x553bf2*_0xa89b31+_0x4c3d66)*0x2+0x0]=_0x4c3d66*(_0x21116b+0x1)+_0x42634b,_0x27f6ca[(_0x553bf2*_0xa89b31+_0x4c3d66)*0x2+0x1]=(_0x4c3d66+0x1)*(_0x21116b+0x1)+_0x42634b;}}const _0x49b766=(_0x5a97ad+0x1)*(_0xa89b31*0x2);for(let _0x17f957=0x0;_0x17f957<_0x47e1a9+0x1;++_0x17f957){for(let _0x3f39b0=0x0;_0x3f39b0<_0x21116b;++_0x3f39b0){const _0x116255=_0x17f957*_0x364de9;_0x27f6ca[_0x49b766+(_0x3f39b0+_0x17f957*_0x21116b)*0x2+0x0]=_0x116255*(_0x21116b+0x1)+_0x3f39b0,_0x27f6ca[_0x49b766+(_0x3f39b0+_0x17f957*_0x21116b)*0x2+0x1]=_0x116255*(_0x21116b+0x1)+_0x3f39b0+0x1;}}return _0x27f6ca;}const Cesium$7=mars3d__namespace['Cesium'];function computeVertexNormals(_0x3eb223){var _0x449706=_0x16ff71;const _0x2cc197=_0x3eb223[_0x449706(0x300)],_0x501e4a=_0x3eb223[_0x449706(0x221)],_0x58ff0d=_0x2cc197['length'];if(_0x501e4a['position']){const _0xf5bb81=_0x501e4a[_0x449706(0x27d)]['values'];if(_0x501e4a[_0x449706(0x2e5)]===undefined)_0x501e4a[_0x449706(0x2e5)]=new Cesium$7[(_0x449706(0x155))]({'componentDatatype':Cesium$7[_0x449706(0x2f7)][_0x449706(0x304)],'componentsPerAttribute':0x3,'values':new Float32Array(_0xf5bb81[_0x449706(0x152)])});else{const _0x4caa49=_0x501e4a['normal'][_0x449706(0x2a6)];for(let _0x53a69c=0x0;_0x53a69c<_0x58ff0d;_0x53a69c++){_0x4caa49[_0x53a69c]=0x0;}}const _0x25c58c=_0x501e4a[_0x449706(0x2e5)][_0x449706(0x2a6)];let _0xfbae28,_0x49e478,_0x101fd;const _0xf1234f=new Cesium$7['Cartesian3'](),_0x4238ef=new Cesium$7['Cartesian3'](),_0x314294=new Cesium$7[(_0x449706(0x265))](),_0x340ee8=new Cesium$7['Cartesian3'](),_0x10f4d2=new Cesium$7['Cartesian3']();for(let _0x3f262d=0x0;_0x3f262d<_0x58ff0d;_0x3f262d+=0x3){_0xfbae28=_0x2cc197[_0x3f262d+0x0]*0x3,_0x49e478=_0x2cc197[_0x3f262d+0x1]*0x3,_0x101fd=_0x2cc197[_0x3f262d+0x2]*0x3,Cesium$7[_0x449706(0x265)]['fromArray'](_0xf5bb81,_0xfbae28,_0xf1234f),Cesium$7['Cartesian3'][_0x449706(0x2ad)](_0xf5bb81,_0x49e478,_0x4238ef),Cesium$7['Cartesian3']['fromArray'](_0xf5bb81,_0x101fd,_0x314294),Cesium$7[_0x449706(0x265)]['subtract'](_0x314294,_0x4238ef,_0x340ee8),Cesium$7['Cartesian3']['subtract'](_0xf1234f,_0x4238ef,_0x10f4d2),Cesium$7['Cartesian3']['cross'](_0x340ee8,_0x10f4d2,_0x340ee8),_0x25c58c[_0xfbae28]+=_0x340ee8['x'],_0x25c58c[_0xfbae28+0x1]+=_0x340ee8['y'],_0x25c58c[_0xfbae28+0x2]+=_0x340ee8['z'],_0x25c58c[_0x49e478]+=_0x340ee8['x'],_0x25c58c[_0x49e478+0x1]+=_0x340ee8['y'],_0x25c58c[_0x49e478+0x2]+=_0x340ee8['z'],_0x25c58c[_0x101fd]+=_0x340ee8['x'],_0x25c58c[_0x101fd+0x1]+=_0x340ee8['y'],_0x25c58c[_0x101fd+0x2]+=_0x340ee8['z'];}normalizeNormals(_0x3eb223),_0x501e4a['normal']['needsUpdate']=!![];}return _0x3eb223;}function normalizeNormals(_0x17e961){var _0x1c5742=_0x16ff71;const _0x823fd9=_0x17e961[_0x1c5742(0x221)]['normal']['values'];let _0xf042e2,_0x46399d,_0x5f5e6c,_0xad4716;for(let _0xb7df62=0x0;_0xb7df62<_0x823fd9['length'];_0xb7df62+=0x3){_0xf042e2=_0x823fd9[_0xb7df62],_0x46399d=_0x823fd9[_0xb7df62+0x1],_0x5f5e6c=_0x823fd9[_0xb7df62+0x2],_0xad4716=0x1/Math['sqrt'](_0xf042e2*_0xf042e2+_0x46399d*_0x46399d+_0x5f5e6c*_0x5f5e6c),_0x823fd9[_0xb7df62]=_0xf042e2*_0xad4716,_0x823fd9[_0xb7df62+0x1]=_0x46399d*_0xad4716,_0x823fd9[_0xb7df62+0x2]=_0x5f5e6c*_0xad4716;}}function style2Primitive(_0x2f9ad9={},_0x3f749d){var _0x51456e=_0x16ff71;_0x2f9ad9=_0x2f9ad9||{};_0x3f749d==null&&(_0x3f749d={});for(const _0x5f37b5 in _0x2f9ad9){const _0x5b4ebd=_0x2f9ad9[_0x5f37b5];if(mars3d__namespace['Util']['isSimpleType'](_0x5b4ebd))switch(_0x5f37b5){case _0x51456e(0x29f):case _0x51456e(0x28b):break;case'color':{let _0x1b92ec;mars3d__namespace[_0x51456e(0x262)]['isString'](_0x5b4ebd)?(_0x1b92ec=Cesium$7['Color']['fromCssColorString'](_0x5b4ebd),Cesium$7[_0x51456e(0x31a)](_0x2f9ad9['opacity'])&&(_0x1b92ec=_0x1b92ec[_0x51456e(0x206)](Number(_0x2f9ad9['opacity'])))):_0x1b92ec=_0x5b4ebd;_0x3f749d['color']=_0x1b92ec;break;}case _0x51456e(0x329):_0x3f749d['outline']=_0x5b4ebd;!_0x5b4ebd&&(_0x3f749d[_0x51456e(0x259)]=new Cesium$7['Color'](0x0,0x0,0x0,0x0));break;case _0x51456e(0x259):{let _0xf435e3;if(mars3d__namespace['Util'][_0x51456e(0x24f)](_0x5b4ebd)){_0xf435e3=Cesium$7[_0x51456e(0x308)]['fromCssColorString'](_0x5b4ebd);if(Cesium$7[_0x51456e(0x31a)](_0x2f9ad9['outlineOpacity']))_0xf435e3=_0xf435e3['withAlpha'](Number(_0x2f9ad9['outlineOpacity']));else Cesium$7['defined'](_0x2f9ad9['opacity'])&&(_0xf435e3=_0xf435e3['withAlpha'](Number(_0x2f9ad9['opacity'])));}else _0xf435e3=_0x5b4ebd;_0x3f749d['outlineColor']=_0xf435e3;break;}case'startFovV':case _0x51456e(0x2b6):case'startFovH':case _0x51456e(0x29b):_0x3f749d[_0x5f37b5]=Cesium$7['Math'][_0x51456e(0x30c)](_0x5b4ebd);break;default:_0x3f749d[_0x5f37b5]=_0x5b4ebd;break;}else _0x3f749d[_0x5f37b5]=_0x5b4ebd;}return _0x3f749d;}var SpaceUtil={'__proto__':null,'computeVertexNormals':computeVertexNormals,'style2Primitive':style2Primitive};const Cesium$6=mars3d__namespace['Cesium'],BasePointPrimitive$3=mars3d__namespace['graphic']['BasePointPrimitive'];class CamberRadar extends BasePointPrimitive$3{get['startRadius'](){var _0x34d70d=_0x16ff71;return this[_0x34d70d(0x23e)]['startRadius'];}set['startRadius'](_0x211d33){var _0x2999ff=_0x16ff71;this['style'][_0x2999ff(0x293)]=_0x211d33,this[_0x2999ff(0x1e1)]&&(this['_primitive']['startRadius']=_0x211d33);}get[_0x16ff71(0x2d1)](){return this['style']['radius'];}set[_0x16ff71(0x2d1)](_0x5d750b){var _0xdaa4b5=_0x16ff71;this[_0xdaa4b5(0x23e)]['radius']=_0x5d750b,this['_primitive']&&(this['_primitive']['radius']=_0x5d750b);}get['startFovV'](){return this['style']['startFovV'];}set['startFovV'](_0x33b70e){var _0xdefb93=_0x16ff71;this[_0xdefb93(0x23e)]['startFovV']=_0x33b70e,this[_0xdefb93(0x1e1)]&&(this['_primitive']['startFovV']=Cesium$6['Math']['toRadians'](_0x33b70e));}get[_0x16ff71(0x2b6)](){return this['style']['endFovV'];}set['endFovV'](_0x31816c){var _0x4532c0=_0x16ff71;this['style']['endFovV']=_0x31816c,this['_primitive']&&(this['_primitive']['endFovV']=Cesium$6[_0x4532c0(0x257)]['toRadians'](_0x31816c));}get['startFovH'](){return this['style']['startFovH'];}set[_0x16ff71(0x19f)](_0x419689){this['style']['startFovH']=_0x419689,this['_primitive']&&(this['_primitive']['startFovH']=Cesium$6['Math']['toRadians'](_0x419689));}get['endFovH'](){var _0xee4537=_0x16ff71;return this['style'][_0xee4537(0x29b)];}set['endFovH'](_0x14c71f){var _0x571dba=_0x16ff71;this['style']['endFovH']=_0x14c71f,this['_primitive']&&(this['_primitive']['endFovH']=Cesium$6[_0x571dba(0x257)]['toRadians'](_0x14c71f));}get['color'](){return this['style']['color'];}set['color'](_0x25ffc4){var _0x455119=_0x16ff71;this['style']['color']=_0x25ffc4,this['_primitive']&&(this['_primitive']['color']=mars3d__namespace[_0x455119(0x262)][_0x455119(0x25b)](_0x25ffc4));}[_0x16ff71(0x1de)](){var _0x35f47d=_0x16ff71;this[_0x35f47d(0x1e1)]=this['primitiveCollection']['add'](new CamberRadarPrimitive({...style2Primitive(this['style']),'id':this['id'],'modelMatrix':this['modelMatrix']}));}['_updateStyleHook'](_0xac32b8,_0x4a61ef){var _0xcfd440=_0x16ff71;(Cesium$6['defined']('heading')||Cesium$6[_0xcfd440(0x31a)]('pitch')||Cesium$6['defined'](_0xcfd440(0x2fa)))&&(this[_0xcfd440(0x1e1)]['modelMatrix']=this['modelMatrix']),style2Primitive(_0x4a61ef,this['_primitive']);}['setOpacity'](_0x710638){var _0x2afae2=_0x16ff71;this['style']['globalAlpha']=_0x710638,this[_0x2afae2(0x1e1)]&&(this['_primitive'][_0x2afae2(0x17d)]=_0x710638);}['_getDrawEntityClass'](_0x1d6d35,_0x174644){return _0x1d6d35['drawShow']=![],mars3d__namespace['GraphicUtil']['create']('point',_0x1d6d35);}}mars3d__namespace['graphic']['CamberRadar']=CamberRadar,mars3d__namespace[_0x16ff71(0x154)][_0x16ff71(0x18e)]('camberRadar',CamberRadar,!![]);const Cesium$5=mars3d__namespace['Cesium'];class ConicGeometry{constructor(_0x3bb17f){var _0x362ec6=_0x16ff71;this['length']=_0x3bb17f['length'],this[_0x362ec6(0x28a)]=_0x3bb17f['topRadius'],this['bottomRadius']=_0x3bb17f['bottomRadius'],this[_0x362ec6(0x367)]=_0x3bb17f['zReverse'],this['slices']=_0x3bb17f['slices']??0x40;}static[_0x16ff71(0x1a5)](_0x348d97,_0xb390eb,_0x1a881a){var _0x59b649=_0x16ff71;const _0x41e764=Math[_0x59b649(0x359)](Math[_0x59b649(0x2d4)](_0x348d97*0x2),0x40);_0x348d97=Cesium$5['Math']['toRadians'](_0x348d97);const _0x36b933=Math['tan'](_0x348d97)*_0xb390eb;return new ConicGeometry({'topRadius':_0x36b933,'bottomRadius':0x0,'length':_0xb390eb,'slices':_0x41e764,'zReverse':_0x1a881a});}static['createGeometry'](_0x396cfc,_0x5f855d){var _0x2ed2a9=_0x16ff71;if(!_0x5f855d)return ConicGeometry['_createGeometry'](_0x396cfc);const _0x5706d4=new Cesium$5['Cartesian3'](),_0x1c717e=new Cesium$5[(_0x2ed2a9(0x243))]();Cesium$5['Matrix4']['multiplyByPoint'](_0x5f855d,Cesium$5['Cartesian3']['ZERO'],_0x5706d4),_0x5706d4['clone'](_0x1c717e['origin']);const _0x513d97=_0x396cfc['length'],_0x36621c=_0x396cfc['topRadius'],_0x4309d1=_0x396cfc['slices'],_0x36eba9=Math['PI']*0x2/(_0x4309d1-0x1),_0xae58d9=_0x396cfc['zReverse'],_0x1d1b18=0x10;let _0x541543=[],_0x12e3ce=[],_0xf683ae=[];const _0x9d813f=[],_0xb4802e=[0x0,_0xae58d9?-_0x513d97:_0x513d97];let _0x3ae830=0x0;_0x541543['push'](0x0,0x0,0x0),_0x12e3ce['push'](0x1,0x1),_0x3ae830++;const _0x5ca3f8=new Cesium$5['Cartesian3'](),_0x31f3c4=_0x36621c/(_0x1d1b18-0x1);for(let _0x2c0845=0x0;_0x2c0845<_0x1d1b18;_0x2c0845++){const _0x2b1d14=_0x31f3c4*_0x2c0845,_0xe4396f=[];for(let _0x55858c=0x0;_0x55858c<_0x4309d1;_0x55858c++){const _0x4000d9=_0x36eba9*_0x55858c,_0x4dccd1=_0x2b1d14*Math['cos'](_0x4000d9),_0x3395f5=_0x2b1d14*Math['sin'](_0x4000d9);_0x5ca3f8['x']=_0x4dccd1,_0x5ca3f8['y']=_0x3395f5,_0x5ca3f8['z']=_0xb4802e[0x1];let _0x18d467=Cesium$5[_0x2ed2a9(0x1f8)][_0x2ed2a9(0x1c1)](_0x5f855d,_0x5ca3f8,new Cesium$5[(_0x2ed2a9(0x265))]());!_0x18d467?(_0x18d467=_0x5706d4,_0xe4396f['push'](-0x1)):(_0xe4396f['push'](_0x3ae830),_0x541543[_0x2ed2a9(0x1fa)](_0x4dccd1,_0x3395f5,_0xb4802e[0x1]),_0x12e3ce['push'](_0x2c0845/(_0x1d1b18-0x1),0x1),_0x3ae830++);}_0x9d813f['push'](_0xe4396f);}const _0x3ab3f2=[0x0,_0x9d813f[_0x2ed2a9(0x152)]-0x1];let _0x1a09c4,_0x5405c4;for(let _0x1a6b9f=0x0;_0x1a6b9f<_0x3ab3f2['length'];_0x1a6b9f++){const _0x1c9576=_0x3ab3f2[_0x1a6b9f];for(let _0x3bdec9=0x1;_0x3bdec9<_0x9d813f[_0x1c9576]['length'];_0x3bdec9++){_0x1a09c4=_0x9d813f[_0x1c9576][_0x3bdec9-0x1],_0x5405c4=_0x9d813f[_0x1c9576][_0x3bdec9],_0x1a09c4>=0x0&&_0x5405c4>=0x0&&_0xf683ae['push'](0x0,_0x1a09c4,_0x5405c4);}}_0x541543=new Float32Array(_0x541543),_0xf683ae=new Int32Array(_0xf683ae),_0x12e3ce=new Float32Array(_0x12e3ce);const _0x3cab89={'position':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype'][_0x2ed2a9(0x275)],'componentsPerAttribute':0x3,'values':_0x541543}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5[_0x2ed2a9(0x2f7)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x12e3ce})},_0x2672d1=Cesium$5['BoundingSphere'][_0x2ed2a9(0x307)](_0x541543),_0x8dc614=new Cesium$5[(_0x2ed2a9(0x208))]({'attributes':_0x3cab89,'indices':_0xf683ae,'primitiveType':Cesium$5['PrimitiveType'][_0x2ed2a9(0x285)],'boundingSphere':_0x2672d1});return computeVertexNormals(_0x8dc614),_0x541543=[],_0xf683ae=[],_0x8dc614;}static[_0x16ff71(0x15d)](_0x4ce48c){var _0x34cb43=_0x16ff71;const _0x3b5299=_0x4ce48c['length'],_0x489fde=_0x4ce48c[_0x34cb43(0x28a)],_0x554d8a=_0x4ce48c['bottomRadius'],_0x5c7d97=_0x4ce48c['slices'],_0x393dec=Math['PI']*0x2/(_0x5c7d97-0x1),_0x2ff6db=_0x4ce48c['zReverse'];let _0x19ca3b=[],_0x270d6b=[],_0x30c3d4=[];const _0x39cbb1=[],_0x30449d=[_0x554d8a,_0x489fde],_0x116013=[0x0,_0x2ff6db?-_0x3b5299:_0x3b5299];let _0xb57ada=0x0;const _0x4393e4=new Cesium$5['Cartesian2'](),_0x1c5b8c=Math['atan2'](_0x554d8a-_0x489fde,_0x3b5299),_0xda24ec=_0x4393e4;_0xda24ec['z']=Math['sin'](_0x1c5b8c);const _0x5913de=Math['cos'](_0x1c5b8c);for(let _0x12ffca=0x0;_0x12ffca<_0x116013[_0x34cb43(0x152)];_0x12ffca++){_0x39cbb1[_0x12ffca]=[];const _0x1c6289=_0x30449d[_0x12ffca];for(let _0x561655=0x0;_0x561655<_0x5c7d97;_0x561655++){_0x39cbb1[_0x12ffca]['push'](_0xb57ada++);const _0x4ce4a4=_0x393dec*_0x561655;let _0x306376=_0x1c6289*Math['cos'](_0x4ce4a4),_0x95ccc3=_0x1c6289*Math['sin'](_0x4ce4a4);_0x19ca3b[_0x34cb43(0x1fa)](_0x306376,_0x95ccc3,_0x116013[_0x12ffca]),_0x306376=_0x5913de*Math['cos'](_0x4ce4a4),_0x95ccc3=_0x5913de*Math['sin'](_0x4ce4a4),_0x270d6b['push'](_0x306376,_0x95ccc3,_0xda24ec['z']),_0x30c3d4['push'](_0x12ffca/(_0x116013[_0x34cb43(0x152)]-0x1),0x0);}}let _0x40e977=[];for(let _0x47fcda=0x1;_0x47fcda<_0x116013['length'];_0x47fcda++){for(let _0x72e870=0x1;_0x72e870<_0x5c7d97;_0x72e870++){let _0x398ade=_0x39cbb1[_0x47fcda-0x1][_0x72e870-0x1],_0x5ad817=_0x39cbb1[_0x47fcda][_0x72e870-0x1],_0x307cdb=_0x39cbb1[_0x47fcda][_0x72e870],_0x31dde1=_0x39cbb1[_0x47fcda-0x1][_0x72e870];_0x40e977['push'](_0x307cdb),_0x40e977['push'](_0x31dde1),_0x40e977[_0x34cb43(0x1fa)](_0x398ade),_0x40e977['push'](_0x307cdb),_0x40e977[_0x34cb43(0x1fa)](_0x398ade),_0x40e977[_0x34cb43(0x1fa)](_0x5ad817),_0x72e870===_0x39cbb1[_0x47fcda][_0x34cb43(0x152)]-0x1&&(_0x398ade=_0x39cbb1[_0x47fcda-0x1][_0x72e870],_0x5ad817=_0x39cbb1[_0x47fcda][_0x72e870],_0x307cdb=_0x39cbb1[_0x47fcda][0x0],_0x31dde1=_0x39cbb1[_0x47fcda-0x1][0x0],_0x40e977['push'](_0x307cdb),_0x40e977['push'](_0x31dde1),_0x40e977['push'](_0x398ade),_0x40e977['push'](_0x307cdb),_0x40e977[_0x34cb43(0x1fa)](_0x398ade),_0x40e977['push'](_0x5ad817));}}_0x40e977=new Int16Array(_0x40e977),_0x19ca3b=new Float32Array(_0x19ca3b),_0x270d6b=new Float32Array(_0x270d6b),_0x30c3d4=new Float32Array(_0x30c3d4);const _0x12522d={'position':new Cesium$5[(_0x34cb43(0x155))]({'componentDatatype':Cesium$5['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x19ca3b}),'normal':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5[_0x34cb43(0x2f7)][_0x34cb43(0x304)],'componentsPerAttribute':0x3,'values':_0x270d6b}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x30c3d4})},_0x2aab59=Cesium$5['BoundingSphere'][_0x34cb43(0x307)](_0x19ca3b),_0x246dbe=new Cesium$5['Geometry']({'attributes':_0x12522d,'indices':_0x40e977,'primitiveType':Cesium$5['PrimitiveType'][_0x34cb43(0x285)],'boundingSphere':_0x2aab59});return _0x19ca3b=[],_0x40e977=[],_0x30c3d4=[],_0x246dbe;}static['createOutlineGeometry'](_0x5bde1e){var _0x643aff=_0x16ff71;const _0x118a6a=_0x5bde1e['length'],_0x20785f=_0x5bde1e[_0x643aff(0x28a)],_0x354275=_0x5bde1e['bottomRadius'],_0x23bb5c=_0x5bde1e['slices'],_0x41dfa5=Math['PI']*0x2/(_0x23bb5c-0x1),_0x3946ff=_0x5bde1e['zReverse'];let _0x17494c=[],_0x589b41=[],_0x121251=[];const _0x203b87=[],_0x27eaec=[_0x354275,_0x20785f],_0x53c2f6=[0x0,_0x3946ff?-_0x118a6a:_0x118a6a];let _0x1eff8c=0x0;const _0x484e29=new Cesium$5['Cartesian2'](),_0x26b1f5=Math[_0x643aff(0x1e8)](_0x354275-_0x20785f,_0x118a6a),_0x257ec7=_0x484e29;_0x257ec7['z']=Math['sin'](_0x26b1f5);const _0x4150e0=Math['cos'](_0x26b1f5);for(let _0xa2cbce=0x0;_0xa2cbce<_0x53c2f6[_0x643aff(0x152)];_0xa2cbce++){_0x203b87[_0xa2cbce]=[];const _0x556346=_0x27eaec[_0xa2cbce];for(let _0x5676af=0x0;_0x5676af<_0x23bb5c;_0x5676af++){_0x203b87[_0xa2cbce]['push'](_0x1eff8c++);const _0x327e0a=_0x41dfa5*_0x5676af;let _0x2b0ca1=_0x556346*Math[_0x643aff(0x2dd)](_0x327e0a),_0x10749a=_0x556346*Math[_0x643aff(0x226)](_0x327e0a);_0x17494c['push'](_0x2b0ca1,_0x10749a,_0x53c2f6[_0xa2cbce]),_0x2b0ca1=_0x4150e0*Math['cos'](_0x327e0a),_0x10749a=_0x4150e0*Math[_0x643aff(0x226)](_0x327e0a),_0x589b41['push'](_0x2b0ca1,_0x10749a,_0x257ec7['z']),_0x121251['push'](_0xa2cbce/(_0x53c2f6['length']-0x1),0x0);}}let _0x778a00=[];for(let _0x53393b=0x1;_0x53393b<_0x53c2f6['length'];_0x53393b++){for(let _0x59f134=0x1;_0x59f134<_0x23bb5c;_0x59f134+=0x1){const _0x5be47e=_0x203b87[_0x53393b-0x1][_0x59f134-0x1],_0x5a3d09=_0x203b87[_0x53393b][_0x59f134-0x1];_0x203b87[_0x53393b][_0x59f134],_0x203b87[_0x53393b-0x1][_0x59f134],_0x59f134%0x8===0x1&&_0x778a00['push'](_0x5be47e,_0x5a3d09);}}_0x778a00=new Int16Array(_0x778a00),_0x17494c=new Float32Array(_0x17494c),_0x589b41=new Float32Array(_0x589b41),_0x121251=new Float32Array(_0x121251);const _0xc4b801={'position':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x17494c}),'normal':new Cesium$5[(_0x643aff(0x155))]({'componentDatatype':Cesium$5[_0x643aff(0x2f7)]['FLOAT'],'componentsPerAttribute':0x3,'values':_0x589b41}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x121251})},_0x3b1271=Cesium$5['BoundingSphere']['fromVertices'](_0x17494c),_0x5c87a0=new Cesium$5[(_0x643aff(0x208))]({'attributes':_0xc4b801,'indices':_0x778a00,'primitiveType':Cesium$5['PrimitiveType'][_0x643aff(0x34c)],'boundingSphere':_0x3b1271});return _0x17494c=[],_0x778a00=[],_0x121251=[],_0x5c87a0;}}const Cesium$4=mars3d__namespace['Cesium'],BasePointPrimitive$2=mars3d__namespace[_0x16ff71(0x1d0)]['BasePointPrimitive'];class ConicSensor extends BasePointPrimitive$2{constructor(_0x2bd7c8={}){var _0x43013e=_0x16ff71;super(_0x2bd7c8),this['_modelMatrix']=Cesium$4[_0x43013e(0x1f8)]['clone'](Cesium$4['Matrix4']['IDENTITY']),this['_quaternion']=new Cesium$4['Quaternion'](),this['_translation']=new Cesium$4[(_0x43013e(0x265))](),this['_scale']=new Cesium$4['Cartesian3'](0x1,0x1,0x1),this['_matrix']=new Cesium$4[(_0x43013e(0x1f8))](),this['_lookAt']=this[_0x43013e(0x288)]['lookAt'],this['_fixedFrameTransform']=this['options'][_0x43013e(0x1a1)]??Cesium$4['Transforms']['eastNorthUpToFixedFrame'],this['_reverse']=this['options']['reverse']??![],this[_0x43013e(0x23e)]['globalAlpha']=0x1,this['_updateStyleHook'](_0x2bd7c8['style'],_0x2bd7c8['style']);}get[_0x16ff71(0x1b3)](){return this;}get[_0x16ff71(0x263)](){return this['_lookAt'];}set['lookAt'](_0x333982){this['_lookAt']=_0x333982;}get['color'](){return this['_color'];}set['color'](_0x383d5b){this['_color']=mars3d__namespace['Util']['getCesiumColor'](_0x383d5b);}get['outlineColor'](){return this['outlineColor'];}set['outlineColor'](_0x5e18a1){this['_outlineColor']=mars3d__namespace['Util']['getCesiumColor'](_0x5e18a1);}get[_0x16ff71(0x329)](){return this['_outline'];}set['outline'](_0xa7922b){var _0x286323=_0x16ff71;this['_outline']=_0xa7922b,this[_0x286323(0x17b)]();}get['topShow'](){return this['_topShow'];}set['topShow'](_0x4cd88f){this['_topShow']=_0x4cd88f,this['updateGeometry']();}get['topOutlineShow'](){var _0x552660=_0x16ff71;return this[_0x552660(0x2c5)];}set['topOutlineShow'](_0x4b3991){this['_topOutlineShow']=_0x4b3991,this['updateGeometry']();}get['angle'](){return this['_angle'];}set[_0x16ff71(0x1b1)](_0x37f91a){var _0x366021=_0x16ff71;this['_angle']=0x5a-_0x37f91a,this[_0x366021(0x23a)](),this['updateGeometry']();}get[_0x16ff71(0x152)](){return mars3d__namespace['Util']['getCesiumValue'](this['_length'],Number);}set[_0x16ff71(0x152)](_0x406113){var _0x2b4573=_0x16ff71;this['_length']=_0x406113,this[_0x2b4573(0x23a)](),this['updateGeometry']();}get['heading'](){var _0xd6b612=_0x16ff71;return Cesium$4['Math']['toDegrees'](this[_0xd6b612(0x16d)]);}set['heading'](_0x2481b0){var _0x4e869f=_0x16ff71;_0x2481b0 instanceof Cesium$4['CallbackProperty']?this[_0x4e869f(0x328)]=_0x2481b0:this[_0x4e869f(0x328)]=Cesium$4['Math']['toRadians'](_0x2481b0);}get['headingRadians'](){var _0x5254c6=_0x16ff71;return this['_headingRadians']instanceof Cesium$4[_0x5254c6(0x352)]?Cesium$4['Math'][_0x5254c6(0x30c)](mars3d__namespace['Util'][_0x5254c6(0x1ef)](this['_headingRadians'],Number)):this['_headingRadians'];}get['pitch'](){var _0x21970e=_0x16ff71;return Cesium$4['Math'][_0x21970e(0x1d3)](this['_pitchRadians']);}set[_0x16ff71(0x28d)](_0x35f101){var _0x340b8b=_0x16ff71;this['_pitchRadians']=Cesium$4[_0x340b8b(0x257)]['toRadians'](_0x35f101);}get[_0x16ff71(0x2fa)](){var _0x67cca2=_0x16ff71;return Cesium$4['Math']['toDegrees'](this[_0x67cca2(0x1cb)]);}set[_0x16ff71(0x2fa)](_0x4ba5bd){var _0x46a758=_0x16ff71;this['_rollRadians']=Cesium$4['Math'][_0x46a758(0x30c)](_0x4ba5bd);}get['shadowShow'](){return this['_groundCircleShow'];}set['shadowShow'](_0x2d4e95){this['_groundCircleShow']=_0x2d4e95,this['_addGroundCircleEntity'](this['_groundCircleShow']);}get['matrix'](){var _0x1c520d=_0x16ff71;return this[_0x1c520d(0x2ea)];}get[_0x16ff71(0x35d)](){var _0x3e350a=_0x16ff71;if(!this['_matrix'])return null;return Cesium$4[_0x3e350a(0x1f8)][_0x3e350a(0x1c1)](this['_matrix'],new Cesium$4['Cartesian3'](0x0,0x0,this['reverse']?-this['length']:this[_0x3e350a(0x152)]),new Cesium$4['Cartesian3']());}get['reverse'](){return this['_reverse'];}get[_0x16ff71(0x258)](){var _0x135352=_0x16ff71;return this[_0x135352(0x1bb)];}['_updateStyleHook'](_0x4211f1,_0x1be257){var _0x4afa4f=_0x16ff71;_0x4211f1=style2Primitive(_0x4211f1),this['_angle']=0x5a-(_0x4211f1['angle']??0x55),this['_length']=_0x4211f1[_0x4afa4f(0x152)]??0x64,this['_color']=_0x4211f1[_0x4afa4f(0x2bc)]??Cesium$4['Color']['YELLOW'],this[_0x4afa4f(0x2c9)]=_0x4211f1['outline']??![],this[_0x4afa4f(0x1be)]=_0x4211f1['outlineColor']??this[_0x4afa4f(0x1da)],this['_topShow']=_0x4211f1['topShow']??!![],this['_topOutlineShow']=_0x4211f1['topOutlineShow']??!![],this['_groundCircleShow']=_0x4211f1['shadowShow']??![],Cesium$4['defined'](_0x1be257['shadowShow'])&&this['_addGroundCircleEntity'](this['_groundCircleShow']),this['_hintPotsNum']=_0x4211f1[_0x4afa4f(0x228)]??0xf,this[_0x4afa4f(0x28d)]=_0x4211f1['pitch']??0x0,this['heading']=_0x4211f1['heading']??0x0,this[_0x4afa4f(0x2fa)]=_0x4211f1[_0x4afa4f(0x2fa)]??0x0,this['updateGroundCircleRadius'](),this['updateGeometry']();}['_addedHook'](){var _0x46da17=_0x16ff71;this['ellipsoid']=this['_map'][_0x46da17(0x2d8)]['globe'][_0x46da17(0x2f9)];if(!this[_0x46da17(0x191)])return;this[_0x46da17(0x345)]['add'](this),this['updateGeometry'](),this[_0x46da17(0x2c1)]?this['_map']['entities']['add'](this[_0x46da17(0x2c1)]):this[_0x46da17(0x2d0)](this['_groundCircleShow']),this['_groundConeEntity']?this['_map']['entities'][_0x46da17(0x256)](this['_groundConeEntity']):this[_0x46da17(0x1ab)]();}['_removedHook'](){var _0x7613dc=_0x16ff71;if(!this['_map'])return;this['_groundCircleEntity']&&this['_map']['entities']['remove'](this[_0x7613dc(0x2c1)]),this['_groundConeEntity']&&this['_map']['entities'][_0x7613dc(0x19e)](this['_groundConeEntity']),this[_0x7613dc(0x345)]['contains'](this)&&(this[_0x7613dc(0x17a)]=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![]),this[_0x7613dc(0x18a)]();}['update'](_0x2cf622){var _0x5a73b9=_0x16ff71;if(!this['show'])return;this[_0x5a73b9(0x189)](mars3d__namespace['EventType']['preUpdate'],{'time':_0x2cf622['time']}),this['_length']instanceof Cesium$4['CallbackProperty']&&this['updateGeometry'](),this['computeMatrix'](_0x2cf622['time']),_0x2cf622['mode']===Cesium$4[_0x5a73b9(0x266)]['SCENE3D']?((!Cesium$4[_0x5a73b9(0x31a)](this[_0x5a73b9(0x1a4)])||this['_drawCommands']['length']===0x0)&&(this['_geometry'][_0x5a73b9(0x2f1)]=Cesium$4['BoundingSphere']['fromVertices'](this['_geometry']['attributes'][_0x5a73b9(0x27d)]['values']),this[_0x5a73b9(0x1a4)]=[],this['_pickCommands']=[],this['_drawCommands'][_0x5a73b9(0x1fa)](this['createDrawCommand'](this['_geometry'],_0x2cf622)),this['_outline']&&this['_drawCommands'][_0x5a73b9(0x1fa)](this['createDrawCommand'](this[_0x5a73b9(0x355)],_0x2cf622,!![])),this[_0x5a73b9(0x171)]&&(this[_0x5a73b9(0x1a4)]['push'](this['createDrawCommand'](this['_topGeometry'],_0x2cf622)),this['_topOutlineShow']&&this['_drawCommands'][_0x5a73b9(0x1fa)](this[_0x5a73b9(0x209)](this['_topOutlineGeometry'],_0x2cf622,!![])))),_0x2cf622['passes'][_0x5a73b9(0x188)]?this[_0x5a73b9(0x1a4)]&&_0x2cf622['commandList']['push'](...this['_drawCommands']):this['_pickCommands']&&_0x2cf622['commandList']['push'](...this[_0x5a73b9(0x2a7)]),this['_groundCircleEntity']&&(this[_0x5a73b9(0x2c1)]['show']=this['_groundCircleShow']&&this['_pitchRadians']===0x0&&this['_rollRadians']===0x0),this['_groundConeEntity']&&(this['_groundConeEntity'][_0x5a73b9(0x1eb)]=![])):(this['_groundConeEntity']&&(this['_pitchRadians']!==0x0||this[_0x5a73b9(0x1cb)]!==0x0)&&(this['_groundConeEntity']['show']=!![]),!this['_groundCircleEntity']&&this[_0x5a73b9(0x2d0)](!![]),this[_0x5a73b9(0x2c1)][_0x5a73b9(0x1eb)]=this[_0x5a73b9(0x25c)]===0x0&&this['_rollRadians']===0x0),this['fire'](mars3d__namespace['EventType']['postUpdate'],{'time':_0x2cf622['time']});}['_clearDrawCommand'](){var _0x49b6da=_0x16ff71;this[_0x49b6da(0x1a4)]&&this['_drawCommands']['length']>0x0&&(this['_drawCommands']['forEach'](function(_0x3610ee){var _0xbbaada=_0x49b6da;_0x3610ee['vertexArray']&&_0x3610ee['vertexArray'][_0xbbaada(0x2a4)](),_0x3610ee['shaderProgram']&&_0x3610ee[_0xbbaada(0x240)]['destroy']();}),delete this['_drawCommands']),this[_0x49b6da(0x2a7)]&&this['_pickCommands']['length']>0x0&&(this['_pickCommands'][_0x49b6da(0x25d)](function(_0x51e652){var _0x15be05=_0x49b6da;_0x51e652[_0x15be05(0x162)]&&_0x51e652['vertexArray']['destroy'](),_0x51e652['shaderProgram']&&_0x51e652[_0x15be05(0x240)]['destroy']();}),delete this[_0x49b6da(0x2a7)]);}['createDrawCommand'](_0xc0ab9b,_0x2bbeef,_0x1e0f3a){var _0x1f2aad=_0x16ff71;const _0x3cb9ed=_0x2bbeef['context'],_0x1f8d5f=this['style'][_0x1f2aad(0x1ec)]??!![],_0x694983=this['style']['closed']??!![],_0x340f44=Cesium$4[_0x1f2aad(0x2ec)][_0x1f2aad(0x1f3)](_0x1f8d5f,_0x694983,this[_0x1f2aad(0x288)][_0x1f2aad(0x380)]),_0x5b98ab=Cesium$4['RenderState']['fromCache'](_0x340f44),_0x24d493=Cesium$4[_0x1f2aad(0x23c)]['createAttributeLocations'](_0xc0ab9b),_0x39dfcd=Cesium$4['ShaderProgram']['replaceCache']({'context':_0x3cb9ed,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':this['_replaceFragmentShaderSourceByStyle'](SatelliteSensorFS),'attributeLocations':_0x24d493}),_0x185cb3=Cesium$4[_0x1f2aad(0x30a)][_0x1f2aad(0x1d5)]({'context':_0x3cb9ed,'geometry':_0xc0ab9b,'attributeLocations':_0x24d493,'bufferUsage':Cesium$4['BufferUsage'][_0x1f2aad(0x37c)]}),_0x1dc9bf=new Cesium$4['Cartesian3']();Cesium$4['Matrix4']['multiplyByPoint'](this['_matrix'],_0xc0ab9b['boundingSphere']['center'],_0x1dc9bf);const _0x4551a6=new Cesium$4['BoundingSphere'](_0x1dc9bf,_0xc0ab9b[_0x1f2aad(0x2f1)][_0x1f2aad(0x2d1)]),_0x271eb1=new Cesium$4['DrawCommand']({'primitiveType':_0xc0ab9b['primitiveType'],'shaderProgram':_0x39dfcd,'vertexArray':_0x185cb3,'modelMatrix':this[_0x1f2aad(0x2ea)],'renderState':_0x5b98ab,'boundingVolume':_0x4551a6,'uniformMap':{'marsColor':_0x1e0f3a?()=>{return this['_outlineColor'];}:()=>{return this['_color'];},'globalAlpha':()=>{return this['style']['globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$4['Pass']['TRANSLUCENT'],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$4[(_0x1f2aad(0x284))]({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x271eb1),_0x271eb1['pickId']=_0x3cb9ed['createPickId']({'primitive':_0x271eb1,'id':this['id']});if(!_0x1e0f3a){const _0x49d02a=new Cesium$4['DrawCommand']({'owner':_0x271eb1,'primitiveType':_0xc0ab9b[_0x1f2aad(0x268)],'pickOnly':!![]});_0x49d02a['vertexArray']=_0x185cb3,_0x49d02a[_0x1f2aad(0x380)]=_0x5b98ab;const _0x50e6bb=Cesium$4['ShaderProgram']['fromCache']({'context':_0x3cb9ed,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$4['ShaderSource'][_0x1f2aad(0x1b5)](SatelliteSensorFS,'uniform'),'attributeLocations':_0x24d493});_0x49d02a[_0x1f2aad(0x240)]=_0x50e6bb,_0x49d02a['uniformMap']=_0x271eb1['uniformMap'],_0x49d02a[_0x1f2aad(0x19b)]['czm_pickColor']=()=>{var _0x23bac3=_0x1f2aad;return _0x271eb1[_0x23bac3(0x378)]['color'];},_0x49d02a['pass']=Cesium$4[_0x1f2aad(0x282)]['TRANSLUCENT'],_0x49d02a['boundingVolume']=_0x4551a6,_0x49d02a['modelMatrix']=this['_matrix'],this['_pickCommands'][_0x1f2aad(0x1fa)](_0x49d02a);}return _0x271eb1;}['computeMatrix'](_0x4b3727,_0x30f6c3){var _0x1f2940=_0x16ff71;this['_positionCartesian']=mars3d__namespace['PointUtil']['getPositionValue'](this['position'],_0x4b3727);if(!this['_positionCartesian'])return this['_matrix']=new Cesium$4['Matrix4'](),this[_0x1f2940(0x2ea)];if(this['_lookAt']){const _0x370e2c=this['_positionCartesian'],_0x4a82b0=mars3d__namespace['PointUtil']['getPositionValue'](this['_lookAt'],_0x4b3727);if(Cesium$4['defined'](_0x4a82b0)){this[_0x1f2940(0x152)]=Cesium$4['Cartesian3']['distance'](_0x370e2c,_0x4a82b0);const _0x4b772d=mars3d__namespace[_0x1f2940(0x1d1)][_0x1f2940(0x233)](_0x370e2c,_0x4a82b0,this[_0x1f2940(0x2f9)],this[_0x1f2940(0x17f)]);this['_pitchRadians']=_0x4b772d[_0x1f2940(0x28d)],this['_rollRadians']=_0x4b772d[_0x1f2940(0x2fa)],!(this['_headingRadians']instanceof Cesium$4[_0x1f2940(0x352)])&&(this[_0x1f2940(0x328)]=_0x4b772d['heading']);}}if(this[_0x1f2940(0x23e)]['rayEllipsoid']){const _0x2b362e=this['getRayEarthLength']();this['_intersectEllipsoid']=_0x2b362e>0x0;if(this['_intersectEllipsoid']){if(this[_0x1f2940(0x23e)]['hideRayEllipsoid'])return this[_0x1f2940(0x2ea)]=new Cesium$4[(_0x1f2940(0x1f8))](),this['_matrix'];this[_0x1f2940(0x152)]=_0x2b362e;}}return this['_modelMatrix']=this['_fixedFrameTransform'](this[_0x1f2940(0x24a)],this['ellipsoid'],this[_0x1f2940(0x32d)]),this['_quaternion']=Cesium$4[_0x1f2940(0x18b)][_0x1f2940(0x21b)](new Cesium$4['HeadingPitchRoll'](this[_0x1f2940(0x16d)],this['_pitchRadians'],this['_rollRadians']),this[_0x1f2940(0x249)]),this['_matrix']=Cesium$4['Matrix4']['fromTranslationQuaternionRotationScale'](this['_translation'],this['_quaternion'],this['_scale'],this[_0x1f2940(0x2ea)]),Cesium$4['Matrix4'][_0x1f2940(0x32f)](this[_0x1f2940(0x32d)],this['_matrix'],this['_matrix']),this['_matrix'];}['updateGeometry'](){var _0x14346c=_0x16ff71;if(!this['_map'])return;const _0xdd2bbd=this['length'];this[_0x14346c(0x16f)]=ConicGeometry['createGeometry'](new ConicGeometry({'topRadius':_0xdd2bbd*Math[_0x14346c(0x2dd)](Cesium$4['Math']['toRadians'](this['angle'])),'bottomRadius':0x0,'length':_0xdd2bbd*Math['sin'](Cesium$4['Math']['toRadians'](this['angle'])),'zReverse':this['_reverse']})),this[_0x14346c(0x2a3)]=this[_0x14346c(0x32e)](),this['_topOutlineGeometry']=this['getTopOutlineGeometry'](),this['_outlineGeometry']=ConicGeometry['createOutlineGeometry'](new ConicGeometry({'topRadius':_0xdd2bbd*Math[_0x14346c(0x2dd)](Cesium$4['Math']['toRadians'](this[_0x14346c(0x1b1)])),'bottomRadius':0x0,'slices':0x80,'length':_0xdd2bbd*Math['sin'](Cesium$4['Math']['toRadians'](this[_0x14346c(0x1b1)])),'zReverse':this[_0x14346c(0x301)]})),this[_0x14346c(0x20e)]=new Float32Array(this[_0x14346c(0x16f)][_0x14346c(0x221)]['position'][_0x14346c(0x2a6)]['length']);for(let _0x141084=0x0;_0x141084{var _0x27f0d3=_0x35369f;return this[_0x27f0d3(0x230)];},![]),'semiMajorAxis':new Cesium$4[(_0x35369f(0x352))](_0x3def0c=>{return this['_ground_radius'];},![]),'material':this['_color']},'show':this['_pitchRadians']===0x0&&this[_0x35369f(0x1cb)]===0x0});}['updateGroundCircleRadius'](){var _0xd7689e=_0x16ff71;this[_0xd7689e(0x230)]=this[_0xd7689e(0x152)]*Math['cos'](Cesium$4[_0xd7689e(0x257)][_0xd7689e(0x30c)](this['_angle']));}['_addGroundConeEntity'](){var _0x15404a=_0x16ff71;if(this['_groundConeEntity'])return;const _0x1a1975=this;this['_groundConeEntity']=this['_map']['entities']['add']({'polygon':{'arcType':Cesium$4['ArcType']['RHUMB'],'hierarchy':new Cesium$4['CallbackProperty'](function(_0x12bef0,_0x7ba6f4){var _0xcf309=_0x15c6;return new Cesium$4['PolygonHierarchy'](_0x1a1975[_0xcf309(0x254)](_0x12bef0));},![]),'outline':!![],'outlineColor':Cesium$4[_0x15404a(0x308)][_0x15404a(0x23f)][_0x15404a(0x206)](0x1),'outlineWidth':0x1,'material':Cesium$4['Color'][_0x15404a(0x1dc)][_0x15404a(0x206)](0.5)},'show':this['_map'][_0x15404a(0x2d8)]['mode']===Cesium$4['SceneMode']['SCENE2D']});}['_computeGroundConePositions'](_0xd7dcb2){var _0x3eb3e8=_0x16ff71;const _0x2d4245=[],_0x265c23=mars3d__namespace['PointUtil'][_0x3eb3e8(0x163)](this['position'],_0xd7dcb2);if(!_0x265c23)return _0x2d4245;const _0x3e92de=this['length'],_0x1403f5=_0x3e92de*Math['sin'](Cesium$4['Math'][_0x3eb3e8(0x30c)](0x5a-this['_angle'])),_0x103d7a=Cesium$4['Matrix4']['multiplyByPoint'](this[_0x3eb3e8(0x2ea)],this['lbcenter'],new Cesium$4['Cartesian3']()),_0x7e5abc=Cesium$4['Cartesian3'][_0x3eb3e8(0x14f)](_0x103d7a,_0x265c23,new Cesium$4['Cartesian3']()),_0x80f1c0=Cesium$4[_0x3eb3e8(0x265)][_0x3eb3e8(0x295)](_0x7e5abc,_0x103d7a,new Cesium$4['Cartesian3']()),_0x257411=Cesium$4['Cartesian3']['cross'](_0x103d7a,_0x7e5abc,new Cesium$4['Cartesian3']());for(let _0x5097e5=0x0;_0x5097e5<=this['_hintPotsNum'];_0x5097e5++){let _0x3ee182=new Cesium$4['Ray'](_0x103d7a,_0x80f1c0);const _0x1017fb=_0x1403f5*_0x5097e5/this['_hintPotsNum'],_0x5513ef=Cesium$4[_0x3eb3e8(0x243)]['getPoint'](_0x3ee182,_0x1017fb,new Cesium$4['Cartesian3']()),_0x152a48=Cesium$4['Cartesian3'][_0x3eb3e8(0x14f)](_0x5513ef,_0x265c23,new Cesium$4['Cartesian3']());_0x3ee182=new Cesium$4['Ray'](_0x265c23,_0x152a48);const _0x549cc2=Cesium$4['Ray']['getPoint'](_0x3ee182,_0x3e92de,new Cesium$4['Cartesian3']());_0x2d4245[_0x3eb3e8(0x1fa)](_0x549cc2);}_0x2d4245[_0x3eb3e8(0x1fa)](_0x265c23);for(let _0x644e94=this[_0x3eb3e8(0x320)];_0x644e94>=0x0;_0x644e94--){let _0x51c660=new Cesium$4['Ray'](_0x103d7a,_0x257411);const _0x46bd46=_0x1403f5*_0x644e94/this[_0x3eb3e8(0x320)],_0x22593a=Cesium$4[_0x3eb3e8(0x243)]['getPoint'](_0x51c660,_0x46bd46,new Cesium$4['Cartesian3']()),_0x3ad784=Cesium$4[_0x3eb3e8(0x265)]['subtract'](_0x22593a,_0x265c23,new Cesium$4['Cartesian3']());_0x51c660=new Cesium$4[(_0x3eb3e8(0x243))](_0x265c23,_0x3ad784);const _0x211880=Cesium$4[_0x3eb3e8(0x243)]['getPoint'](_0x51c660,_0x3e92de,new Cesium$4['Cartesian3']());_0x2d4245['push'](_0x211880);}return _0x2d4245;}['getRayEarthLength'](){var _0x2a6531=_0x16ff71;let _0x476a71=0x0;const _0x57c1c1=mars3d__namespace['PointUtil']['getRayEarthPosition'](this['_positionCartesian'],new Cesium$4['HeadingPitchRoll'](this['headingRadians'],this['_pitchRadians'],this['_rollRadians']),this['_reverse']);if(_0x57c1c1){const _0x125c0c=Cesium$4[_0x2a6531(0x265)][_0x2a6531(0x338)](this['_positionCartesian'],_0x57c1c1);if(_0x125c0c>_0x476a71)return _0x476a71=_0x125c0c,_0x476a71;}return _0x476a71;}['getRayEarthPositions'](){var _0x1ada69=_0x16ff71;const _0x275ba1=this['_positionCartesian'],_0x127914=Cesium$4['Math']['toRadians'](this['pitch']+this[_0x1ada69(0x35c)]),_0x4160c1=Cesium$4['Math']['toRadians'](this[_0x1ada69(0x28d)]-this[_0x1ada69(0x35c)]),_0x839253=Cesium$4['Math']['toRadians'](this[_0x1ada69(0x2fa)]+this['_angle']),_0x495103=Cesium$4['Math'][_0x1ada69(0x30c)](this[_0x1ada69(0x2fa)]-this['_angle']),_0x386042=mars3d__namespace['PointUtil'][_0x1ada69(0x219)](_0x275ba1,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x127914,_0x839253),this['_reverse']),_0x9afb3c=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x275ba1,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x127914,_0x495103),this[_0x1ada69(0x301)]),_0x3f4b49=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x275ba1,new Cesium$4[(_0x1ada69(0x2b3))](this['headingRadians'],_0x4160c1,_0x495103),this['_reverse']),_0x1cfec7=mars3d__namespace[_0x1ada69(0x1d1)][_0x1ada69(0x219)](_0x275ba1,new Cesium$4['HeadingPitchRoll'](this['headingRadians'],_0x4160c1,_0x839253),this[_0x1ada69(0x301)]);return[_0x386042,_0x9afb3c,_0x3f4b49,_0x1cfec7];}[_0x16ff71(0x202)](_0xc3c476,_0x3e2849){var _0x3f6193=_0x16ff71;return _0xc3c476[_0x3f6193(0x280)]=![],mars3d__namespace['GraphicUtil'][_0x3f6193(0x366)]('point',_0xc3c476);}}mars3d__namespace['graphic'][_0x16ff71(0x2bd)]=ConicSensor,mars3d__namespace['GraphicUtil'][_0x16ff71(0x18e)](_0x16ff71(0x26a),ConicSensor,!![]);const Cesium$3=mars3d__namespace['Cesium'];class RectGeometry{constructor(_0x17d1e3){var _0x31b677=_0x16ff71;this[_0x31b677(0x1e0)]=_0x17d1e3[_0x31b677(0x152)],this['_topWidth']=_0x17d1e3['topWidth'],this['_topHeight']=_0x17d1e3['topHeight'],this['_bottomWidth']=_0x17d1e3['bottomWidth'],this[_0x31b677(0x332)]=_0x17d1e3[_0x31b677(0x2d2)],this['_zReverse']=_0x17d1e3['zReverse'],this[_0x31b677(0x239)]=_0x17d1e3['slices']??0x8,this[_0x31b677(0x239)]=_0x17d1e3['slices']??0x8;}static['fromAnglesLength'](_0x12e889,_0x4f907b,_0x16222c,_0xf7c1){var _0x27d5fb=_0x16ff71;const _0x1ad965=Math[_0x27d5fb(0x359)](Math['floor'](Math['max'](_0x12e889,_0x4f907b,0x1)*0x2),0x40),_0x5347d0={'length':_0x16222c,'zReverse':_0xf7c1,'bottomHeight':_0x16222c,'bottomWidth':_0x16222c,'topHeight':_0x16222c,'topWidth':_0x16222c,'slices':_0x1ad965};return _0x12e889=Cesium$3['Math'][_0x27d5fb(0x30c)](_0x12e889),_0x4f907b=Cesium$3[_0x27d5fb(0x257)]['toRadians'](_0x4f907b),!_0xf7c1?(_0x5347d0['topHeight']=0x0,_0x5347d0['topWidth']=0x0,_0x5347d0[_0x27d5fb(0x2d2)]=_0x16222c*Math[_0x27d5fb(0x236)](_0x12e889),_0x5347d0['bottomWidth']=_0x16222c*Math['tan'](_0x4f907b)):(_0x5347d0['bottomHeight']=0x0,_0x5347d0[_0x27d5fb(0x246)]=0x0,_0x5347d0['topHeight']=_0x16222c*Math['tan'](_0x12e889),_0x5347d0['topWidth']=_0x16222c*Math['tan'](_0x4f907b)),new RectGeometry(_0x5347d0);}static['createGeometry'](_0x565df9,_0x372682){var _0x5dc5be=_0x16ff71;if(!_0x372682)return RectGeometry[_0x5dc5be(0x15d)](_0x565df9);const _0x742384=new Cesium$3['Cartesian3'](),_0x20dc16=new Cesium$3['Ray']();Cesium$3[_0x5dc5be(0x1f8)]['multiplyByPoint'](_0x372682,Cesium$3['Cartesian3']['ZERO'],_0x742384),_0x742384['clone'](_0x20dc16['origin']);const _0x515709=_0x565df9['_slices'],_0x142e5c=_0x565df9[_0x5dc5be(0x229)],_0x4526fe=_0x565df9['_topHeight'],_0x1999fb=_0x565df9[_0x5dc5be(0x281)],_0x40b5b3=(_0x1999fb?-0x1:0x1)*_0x565df9['_length'];let _0x969ed4=[],_0x198c54=[],_0x17f296=[];const _0x57f4d1=_0x142e5c,_0x48e7e4=_0x4526fe,_0x425dfb=_0x515709,_0x185a2b=_0x515709;let _0x1bc507=0x0;_0x969ed4['push'](0x0,0x0,0x0),_0x17f296[_0x5dc5be(0x1fa)](0x1,0x1),_0x1bc507++;const _0x286f11=new Cesium$3['Cartesian3'](),_0x532038=[];for(let _0x446a3e=-_0x185a2b;_0x446a3e<=_0x185a2b;_0x446a3e++){const _0x2785f0=[];for(let _0x428616=-_0x425dfb;_0x428616<=_0x425dfb;_0x428616++){const _0x439661=_0x48e7e4*_0x446a3e/_0x185a2b,_0x10f248=_0x57f4d1*_0x428616/_0x425dfb;_0x286f11['x']=_0x10f248,_0x286f11['y']=_0x439661,_0x286f11['z']=_0x40b5b3;const _0x4dcf23=mars3d__namespace[_0x5dc5be(0x1d1)]['extend2Earth'](_0x286f11,_0x372682,_0x20dc16);!_0x4dcf23?(_0x969ed4['push'](_0x10f248,_0x439661,_0x40b5b3),_0x17f296['push'](0x1,0x1),_0x2785f0[_0x5dc5be(0x1fa)](_0x1bc507),_0x1bc507++):(_0x969ed4['push'](_0x10f248,_0x439661,_0x40b5b3),_0x17f296['push'](0x1,0x1),_0x2785f0['push'](_0x1bc507),_0x1bc507++);}_0x532038['push'](_0x2785f0);}const _0xec9b1f=[0x0,_0x532038[_0x5dc5be(0x152)]-0x1];let _0x107f9b,_0xc8d472;for(let _0x19e255=0x0;_0x19e255<_0xec9b1f['length'];_0x19e255++){const _0x117dc5=_0xec9b1f[_0x19e255];for(let _0x56e94f=0x1;_0x56e94f<_0x532038[_0x117dc5]['length'];_0x56e94f++){_0x107f9b=_0x532038[_0x117dc5][_0x56e94f-0x1],_0xc8d472=_0x532038[_0x117dc5][_0x56e94f],_0x107f9b>=0x0&&_0xc8d472>=0x0&&_0x198c54[_0x5dc5be(0x1fa)](0x0,_0x107f9b,_0xc8d472);}}for(let _0x1a73c0=0x0;_0x1a73c0<_0x532038['length'];_0x1a73c0++){if(_0x1a73c0===0x0||_0x1a73c0===_0x532038['length']-0x1)for(let _0x2eff30=0x1;_0x2eff30<_0x532038[_0x5dc5be(0x152)];_0x2eff30++){_0x107f9b=_0x532038[_0x2eff30-0x1][_0x1a73c0],_0xc8d472=_0x532038[_0x2eff30][_0x1a73c0],_0x107f9b>=0x0&&_0xc8d472>=0x0&&_0x198c54['push'](0x0,_0x107f9b,_0xc8d472);}}_0x969ed4=new Float32Array(_0x969ed4),_0x198c54=new Int32Array(_0x198c54),_0x17f296=new Float32Array(_0x17f296);const _0x5e31bb={'position':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3['ComponentDatatype'][_0x5dc5be(0x275)],'componentsPerAttribute':0x3,'values':_0x969ed4}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0x5dc5be(0x2f7)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x17f296})},_0x397351=Cesium$3[_0x5dc5be(0x2be)]['fromVertices'](_0x969ed4),_0x30540f=new Cesium$3['Geometry']({'attributes':_0x5e31bb,'indices':_0x198c54,'primitiveType':Cesium$3['PrimitiveType']['TRIANGLES'],'boundingSphere':_0x397351});return _0x30540f[_0x5dc5be(0x1a8)]=_0x198c54,computeVertexNormals(_0x30540f),_0x969ed4=[],_0x198c54=[],_0x30540f;}static[_0x16ff71(0x15d)](_0x3c7838){var _0x35ae4b=_0x16ff71;const _0x577d14=_0x3c7838[_0x35ae4b(0x1fe)],_0x4dc0bb=_0x3c7838['_bottomHeight'],_0x33ef97=_0x3c7838['_topWidth'],_0x144e03=_0x3c7838['_topHeight'],_0x309947=_0x3c7838['_zReverse'],_0xb169f8=(_0x309947?-0x1:0x1)*_0x3c7838['_length'];let _0x4432db=new Float32Array(0x8*0x3),_0xc7749=[],_0x216298=[];const _0x297381=new Cesium$3['Cartesian3'](0x0,0x0,_0xb169f8),_0x1e978d=[0x0,_0xb169f8],_0x598fec=[_0x577d14,_0x33ef97],_0x3be949=[_0x4dc0bb,_0x144e03];let _0x2557c4=0x0;for(let _0x3fb9c6=0x0;_0x3fb9c6<0x2;_0x3fb9c6++){_0x4432db[_0x2557c4*0x3]=-_0x598fec[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x1]=-_0x3be949[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x2]=_0x1e978d[_0x3fb9c6],_0x216298[_0x2557c4*0x2]=_0x3fb9c6,_0x216298[_0x2557c4*0x2+0x1]=0x0,_0x2557c4++,_0x4432db[_0x2557c4*0x3]=-_0x598fec[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x1]=_0x3be949[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x2]=_0x1e978d[_0x3fb9c6],_0x216298[_0x2557c4*0x2]=_0x3fb9c6,_0x216298[_0x2557c4*0x2+0x1]=0x0,_0x2557c4++,_0x4432db[_0x2557c4*0x3]=_0x598fec[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x1]=_0x3be949[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x2]=_0x1e978d[_0x3fb9c6],_0x216298[_0x2557c4*0x2]=_0x3fb9c6,_0x216298[_0x2557c4*0x2+0x1]=0x0,_0x2557c4++,_0x4432db[_0x2557c4*0x3]=_0x598fec[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x1]=-_0x3be949[_0x3fb9c6]/0x2,_0x4432db[_0x2557c4*0x3+0x2]=_0x1e978d[_0x3fb9c6],_0x216298[_0x2557c4*0x2]=_0x3fb9c6,_0x216298[_0x2557c4*0x2+0x1]=0x0,_0x2557c4++;}_0xc7749['push'](0x0,0x1,0x3),_0xc7749['push'](0x1,0x2,0x3),_0xc7749['push'](0x0,0x4,0x5),_0xc7749[_0x35ae4b(0x1fa)](0x0,0x5,0x1),_0xc7749['push'](0x1,0x2,0x6),_0xc7749['push'](0x1,0x6,0x5),_0xc7749['push'](0x2,0x3,0x7),_0xc7749['push'](0x7,0x6,0x2),_0xc7749[_0x35ae4b(0x1fa)](0x0,0x3,0x7),_0xc7749['push'](0x7,0x4,0x0),_0xc7749[_0x35ae4b(0x1fa)](0x4,0x5,0x6),_0xc7749[_0x35ae4b(0x1fa)](0x6,0x7,0x4),_0xc7749=new Int16Array(_0xc7749),_0x216298=new Float32Array(_0x216298);const _0x2c0bb8={'position':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0x35ae4b(0x2f7)]['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x4432db}),'st':new Cesium$3[(_0x35ae4b(0x155))]({'componentDatatype':Cesium$3['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x216298})},_0x217bc5=Cesium$3['BoundingSphere']['fromVertices'](_0x4432db);let _0x5aeea8=new Cesium$3['Geometry']({'attributes':_0x2c0bb8,'indices':_0xc7749,'primitiveType':Cesium$3['PrimitiveType']['TRIANGLES'],'boundingSphere':_0x217bc5});return _0x5aeea8=Cesium$3['GeometryPipeline'][_0x35ae4b(0x30e)](_0x5aeea8),_0x4432db=[],_0xc7749=[],_0x5aeea8['bottomCenter']=_0x297381,_0x5aeea8;}static[_0x16ff71(0x1d9)](_0x187a32){var _0x9c393b=_0x16ff71;const _0x8cc344=_0x187a32['_bottomWidth'],_0x546f55=_0x187a32['_bottomHeight'],_0x317691=_0x187a32[_0x9c393b(0x229)],_0x1289be=_0x187a32['_topHeight'],_0x1ac050=_0x187a32['_zReverse'],_0x3fd6e6=(_0x1ac050?-0x1:0x1)*_0x187a32['_length'];let _0x41c6b4=new Float32Array(0x8*0x3),_0x52d15b=[],_0x5564a1=[];const _0x49fa4a=[0x0,_0x3fd6e6],_0x5e8796=[_0x8cc344,_0x317691],_0x46dc7b=[_0x546f55,_0x1289be];let _0x5683fa=0x0;for(let _0x9b9f4d=0x0;_0x9b9f4d<0x2;_0x9b9f4d++){_0x41c6b4[_0x5683fa*0x3]=-_0x5e8796[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x1]=-_0x46dc7b[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x2]=_0x49fa4a[_0x9b9f4d],_0x5564a1[_0x5683fa*0x2]=_0x9b9f4d,_0x5564a1[_0x5683fa*0x2+0x1]=0x0,_0x5683fa++,_0x41c6b4[_0x5683fa*0x3]=-_0x5e8796[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x1]=_0x46dc7b[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x2]=_0x49fa4a[_0x9b9f4d],_0x5564a1[_0x5683fa*0x2]=_0x9b9f4d,_0x5564a1[_0x5683fa*0x2+0x1]=0x0,_0x5683fa++,_0x41c6b4[_0x5683fa*0x3]=_0x5e8796[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x1]=_0x46dc7b[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x2]=_0x49fa4a[_0x9b9f4d],_0x5564a1[_0x5683fa*0x2]=_0x9b9f4d,_0x5564a1[_0x5683fa*0x2+0x1]=0x0,_0x5683fa++,_0x41c6b4[_0x5683fa*0x3]=_0x5e8796[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x1]=-_0x46dc7b[_0x9b9f4d]/0x2,_0x41c6b4[_0x5683fa*0x3+0x2]=_0x49fa4a[_0x9b9f4d],_0x5564a1[_0x5683fa*0x2]=_0x9b9f4d,_0x5564a1[_0x5683fa*0x2+0x1]=0x0,_0x5683fa++;}_0x52d15b['push'](0x0,0x1,0x1,0x2),_0x52d15b['push'](0x2,0x3,0x3,0x0),_0x52d15b['push'](0x0,0x4),_0x52d15b['push'](0x1,0x5),_0x52d15b['push'](0x2,0x6),_0x52d15b['push'](0x3,0x7),_0x52d15b[_0x9c393b(0x1fa)](0x4,0x5,0x5,0x6),_0x52d15b['push'](0x6,0x7,0x7,0x4),_0x52d15b=new Int16Array(_0x52d15b),_0x5564a1=new Float32Array(_0x5564a1);const _0x2a0369={'position':new Cesium$3[(_0x9c393b(0x155))]({'componentDatatype':Cesium$3['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x41c6b4}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x5564a1})},_0x481518=Cesium$3['BoundingSphere']['fromVertices'](_0x41c6b4),_0x496620=new Cesium$3[(_0x9c393b(0x208))]({'attributes':_0x2a0369,'indices':_0x52d15b,'primitiveType':Cesium$3['PrimitiveType']['LINES'],'boundingSphere':_0x481518});return _0x41c6b4=[],_0x52d15b=[],_0x496620;}static['createOutlineGeometry2'](_0x574525){var _0xa3d388=_0x16ff71;const _0x481217=_0x574525['_topWidth'],_0x3caf62=_0x574525['_topHeight'],_0x56d503=_0x574525['_zReverse'],_0x2938d8=(_0x56d503?-0x1:0x1)*_0x574525[_0xa3d388(0x1e0)];let _0x5b9652=[],_0x4af7a6=[],_0x8e3046=[];const _0x2c6ce7=_0x481217/0x2,_0x14ab8e=_0x3caf62/0x2,_0xc2e56a=0x10,_0x4c9341=0x10;let _0xa87975=0x0;_0x5b9652['push'](0x0,0x0,0x0),_0x8e3046['push'](0x1,0x1),_0xa87975++;const _0x31ca8f=[];for(let _0x2050e7=-_0x4c9341;_0x2050e7<_0x4c9341;_0x2050e7++){const _0x33f4a6=[];for(let _0x5e791e=-_0xc2e56a;_0x5e791e<_0xc2e56a;_0x5e791e++){_0x33f4a6['push'](_0xa87975);const _0x2c4f01=_0x14ab8e*_0x2050e7/_0x4c9341,_0x32236f=_0x2c6ce7*_0x5e791e/_0xc2e56a;_0x5b9652['push'](_0x32236f,_0x2c4f01,_0x2938d8),_0x8e3046['push'](0x1,0x1),_0xa87975++;}_0x31ca8f[_0xa3d388(0x1fa)](_0x33f4a6);}const _0xf24b83=[0x0,_0x31ca8f[_0xa3d388(0x152)]-0x1];let _0x4b09ac,_0x31a716;for(let _0x1046f5=0x0;_0x1046f5<_0xf24b83[_0xa3d388(0x152)];_0x1046f5++){const _0x391d61=_0xf24b83[_0x1046f5];for(let _0x2f6ce9=0x1;_0x2f6ce9<_0x31ca8f[_0x391d61][_0xa3d388(0x152)];_0x2f6ce9++){_0x4b09ac=_0x31ca8f[_0x391d61][_0x2f6ce9-0x1],_0x31a716=_0x31ca8f[_0x391d61][_0x2f6ce9],_0x4af7a6[_0xa3d388(0x1fa)](0x0,_0x4b09ac,_0x31a716);}}const _0x2500e5=[0x0,_0x31ca8f[0x0][_0xa3d388(0x152)]-0x1];for(let _0x4fe1f7=0x0;_0x4fe1f7<_0x2500e5['length'];_0x4fe1f7++){const _0x22f287=_0x2500e5[_0x4fe1f7];for(let _0x275b6b=0x1;_0x275b6b<_0x31ca8f[_0xa3d388(0x152)];_0x275b6b++){_0x4b09ac=_0x31ca8f[_0x275b6b-0x1][_0x22f287],_0x31a716=_0x31ca8f[_0x275b6b][_0x22f287],_0x4af7a6[_0xa3d388(0x1fa)](0x0,_0x4b09ac,_0x31a716);}}_0x5b9652=new Float32Array(_0x5b9652),_0x4af7a6=new Int16Array(_0x4af7a6),_0x8e3046=new Float32Array(_0x8e3046);const _0x10172c={'position':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3['ComponentDatatype']['DOUBLE'],'componentsPerAttribute':0x3,'values':_0x5b9652}),'st':new Cesium$3['GeometryAttribute']({'componentDatatype':Cesium$3[_0xa3d388(0x2f7)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x8e3046})},_0x70101a=Cesium$3['BoundingSphere'][_0xa3d388(0x307)](_0x5b9652),_0x5cc54f=new Cesium$3['Geometry']({'attributes':_0x10172c,'indices':_0x4af7a6,'primitiveType':Cesium$3['PrimitiveType'][_0xa3d388(0x285)],'boundingSphere':_0x70101a});return computeVertexNormals(_0x5cc54f),Cesium$3['GeometryPipeline']['toWireframe'](_0x5cc54f),_0x5b9652=[],_0x4af7a6=[],_0x5cc54f;}}const Cesium$2=mars3d__namespace['Cesium'],BasePointPrimitive$1=mars3d__namespace['graphic']['BasePointPrimitive'];class RectSensor extends BasePointPrimitive$1{constructor(_0x55e71d={}){var _0x125463=_0x16ff71;super(_0x55e71d),this['_modelMatrix']=Cesium$2['Matrix4']['clone'](Cesium$2[_0x125463(0x1f8)][_0x125463(0x270)]),this['_quaternion']=new Cesium$2['Quaternion'](),this['_translation']=new Cesium$2['Cartesian3'](),this[_0x125463(0x2a0)]=new Cesium$2['Cartesian3'](0x1,0x1,0x1),this[_0x125463(0x2ea)]=new Cesium$2['Matrix4'](),this['_lookAt']=this[_0x125463(0x288)][_0x125463(0x263)],this[_0x125463(0x17f)]=this['options']['fixedFrameTransform']??Cesium$2['Transforms'][_0x125463(0x23b)],this[_0x125463(0x301)]=this['options'][_0x125463(0x18f)]??![],this[_0x125463(0x23e)]['globalAlpha']=0x1,this[_0x125463(0x337)](_0x55e71d['style'],_0x55e71d[_0x125463(0x23e)]);}get['czmObject'](){return this;}get['lookAt'](){return this['_lookAt'];}set['lookAt'](_0x35c259){this['_lookAt']=_0x35c259;}get['color'](){return this['_color'];}set['color'](_0x4b666d){var _0x4d7791=_0x16ff71;this[_0x4d7791(0x1da)]=mars3d__namespace['Util']['getCesiumColor'](_0x4b666d);}get['outlineColor'](){return this['_outlineColor'];}set['outlineColor'](_0x2f3853){var _0x2aa529=_0x16ff71;this['_outlineColor']=mars3d__namespace[_0x2aa529(0x262)]['getCesiumColor'](_0x2f3853);}get['outline'](){return this['_outline'];}set[_0x16ff71(0x329)](_0x56a6bf){var _0x5ed1f2=_0x16ff71;this['_outline']=_0x56a6bf,this[_0x5ed1f2(0x17b)]();}get[_0x16ff71(0x168)](){return this['_topShow'];}set[_0x16ff71(0x168)](_0xbc7c1d){var _0x2219bd=_0x16ff71;this['_topShow']=_0xbc7c1d,this[_0x2219bd(0x17b)]();}get['topOutlineShow'](){var _0x3e6a63=_0x16ff71;return this[_0x3e6a63(0x2c5)];}set[_0x16ff71(0x2a1)](_0x123b95){var _0x2c4c7f=_0x16ff71;this[_0x2c4c7f(0x2c5)]=_0x123b95,this['updateGeometry']();}get['angle'](){return this['_angle1'];}set['angle'](_0x153569){var _0x3d7e90=_0x16ff71;this['_angle1']=_0x153569,this['_angle2']=_0x153569,this[_0x3d7e90(0x17b)]();}get['angle1'](){var _0x3a42d3=_0x16ff71;return this[_0x3a42d3(0x318)];}set['angle1'](_0x123148){this['_angle1']=_0x123148,this['updateGeometry']();}get['angle2'](){return this['_angle2'];}set[_0x16ff71(0x2da)](_0x1e2259){this['_angle2']=_0x1e2259,this['updateGeometry']();}get['length'](){var _0x159c52=_0x16ff71;return mars3d__namespace[_0x159c52(0x262)]['getCesiumValue'](this[_0x159c52(0x1e0)],Number);}set['length'](_0xe25c8b){this['_length']=_0xe25c8b,this['updateGeometry']();}get['heading'](){var _0x339644=_0x16ff71;return Cesium$2['Math']['toDegrees'](this[_0x339644(0x16d)]);}set['heading'](_0x5b8040){_0x5b8040 instanceof Cesium$2['CallbackProperty']?this['_headingRadians']=_0x5b8040:this['_headingRadians']=Cesium$2['Math']['toRadians'](_0x5b8040);}get[_0x16ff71(0x16d)](){var _0x4287b9=_0x16ff71;return this[_0x4287b9(0x328)]instanceof Cesium$2[_0x4287b9(0x352)]?Cesium$2[_0x4287b9(0x257)][_0x4287b9(0x30c)](mars3d__namespace['Util']['getCesiumValue'](this['_headingRadians'],Number)):this['_headingRadians'];}get['pitch'](){return Cesium$2['Math']['toDegrees'](this['_pitchRadians']);}set['pitch'](_0x4d67e3){this['_pitchRadians']=Cesium$2['Math']['toRadians'](_0x4d67e3);}get['roll'](){return Cesium$2['Math']['toDegrees'](this['_rollRadians']);}set['roll'](_0x5cc9ee){var _0x5398de=_0x16ff71;this['_rollRadians']=Cesium$2['Math'][_0x5398de(0x30c)](_0x5cc9ee);}get['matrix'](){return this['_matrix'];}get['rayPosition'](){var _0x458623=_0x16ff71;if(!this['_matrix'])return null;return Cesium$2['Matrix4']['multiplyByPoint'](this['_matrix'],new Cesium$2['Cartesian3'](0x0,0x0,this['reverse']?-this['length']:this[_0x458623(0x152)]),new Cesium$2['Cartesian3']());}get['reverse'](){return this['_reverse'];}get['intersectEllipsoid'](){return this['_intersectEllipsoid'];}['_updateStyleHook'](_0x2d7c22,_0x32b2e0){var _0x598618=_0x16ff71;_0x2d7c22=style2Primitive(_0x2d7c22),this[_0x598618(0x318)]=_0x2d7c22['angle1']||_0x2d7c22['angle']||0x5,this[_0x598618(0x331)]=_0x2d7c22['angle2']||_0x2d7c22['angle']||0x5,this['_length']=_0x2d7c22['length']??0x64,this[_0x598618(0x1da)]=_0x2d7c22[_0x598618(0x2bc)]??new Cesium$2['Color'](0x0,0x1,0x1,0.2),this['_outline']=_0x2d7c22['outline']??![],this[_0x598618(0x1be)]=_0x2d7c22['outlineColor']??new Cesium$2[(_0x598618(0x308))](0x1,0x1,0x1,0.4),this['_topShow']=_0x2d7c22[_0x598618(0x168)]??!![],this[_0x598618(0x2c5)]=_0x2d7c22['topOutlineShow']??this['_outline'],this['_topSteps']=_0x2d7c22[_0x598618(0x16a)]??0x8,this['pitch']=_0x2d7c22['pitch']??0x0,this['heading']=_0x2d7c22['heading']??0x0,this[_0x598618(0x2fa)]=_0x2d7c22[_0x598618(0x2fa)]??0x0,this['updateGeometry']();}['_addedHook'](){var _0x5169b5=_0x16ff71;this['ellipsoid']=this[_0x5169b5(0x1cf)]['scene']['globe']['ellipsoid'];if(!this['_show'])return;this['primitiveCollection'][_0x5169b5(0x256)](this),this['updateGeometry']();}['_removedHook'](){if(!this['_map'])return;this['primitiveCollection']['contains'](this)&&(this['_noDestroy']=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![]),this['_clearDrawCommand']();}[_0x16ff71(0x30d)](_0xfd26cd){var _0x5c65f4=_0x16ff71;if(!this['show'])return;this['fire'](mars3d__namespace['EventType']['preUpdate'],{'time':_0xfd26cd['time']});this['_length']instanceof Cesium$2['CallbackProperty']&&this['updateGeometry']();this['computeMatrix'](_0xfd26cd[_0x5c65f4(0x173)]);if(_0xfd26cd['mode']===Cesium$2[_0x5c65f4(0x266)][_0x5c65f4(0x33c)]){if(!Cesium$2['defined'](this['_drawCommands'])||this['_drawCommands']['length']===0x0){this['_geometry']['boundingSphere']=Cesium$2['BoundingSphere']['fromVertices'](this[_0x5c65f4(0x16f)]['attributes'][_0x5c65f4(0x27d)][_0x5c65f4(0x2a6)]),this['_drawCommands']=[],this[_0x5c65f4(0x2a7)]=[],this['_drawCommands']['push'](this['createDrawCommand'](this['_geometry'],_0xfd26cd));this['_outline']&&this['_drawCommands']['push'](this['createDrawCommand'](this[_0x5c65f4(0x355)],_0xfd26cd,!![]));if(this['_topShow']){const _0x251323=this[_0x5c65f4(0x209)](this['_topGeometry'],_0xfd26cd);this['_drawCommands']['push'](_0x251323);if(this['_topOutlineShow']){const _0x153520=this['createDrawCommand'](this[_0x5c65f4(0x2f8)],_0xfd26cd,!![]);this['_drawCommands'][_0x5c65f4(0x1fa)](_0x153520);}}}_0xfd26cd[_0x5c65f4(0x213)]['render']?this[_0x5c65f4(0x1a4)]&&_0xfd26cd[_0x5c65f4(0x253)][_0x5c65f4(0x1fa)](...this['_drawCommands']):this[_0x5c65f4(0x2a7)]&&_0xfd26cd['commandList']['push'](...this[_0x5c65f4(0x2a7)]);}this['fire'](mars3d__namespace['EventType']['postUpdate'],{'time':_0xfd26cd[_0x5c65f4(0x173)]});}[_0x16ff71(0x209)](_0x58d79e,_0xba989d,_0x3df553){var _0x1def19=_0x16ff71;const _0x4332f3=_0xba989d[_0x1def19(0x205)],_0x17451e=this['style']['translucent']??!![],_0x4a0311=this[_0x1def19(0x23e)]['closed']??![],_0xa1d7e1=Cesium$2['Appearance']['getDefaultRenderState'](_0x17451e,_0x4a0311,this[_0x1def19(0x288)][_0x1def19(0x380)]),_0xe3297d=Cesium$2[_0x1def19(0x19d)]['fromCache'](_0xa1d7e1),_0x3e2bc5=Cesium$2['GeometryPipeline']['createAttributeLocations'](_0x58d79e),_0x19a531=Cesium$2['ShaderProgram'][_0x1def19(0x33a)]({'context':_0x4332f3,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':this['_replaceFragmentShaderSourceByStyle'](SatelliteSensorFS),'attributeLocations':_0x3e2bc5}),_0x17336e=Cesium$2['VertexArray']['fromGeometry']({'context':_0x4332f3,'geometry':_0x58d79e,'attributeLocations':_0x3e2bc5,'bufferUsage':Cesium$2[_0x1def19(0x2ba)][_0x1def19(0x37c)]}),_0x1fdf64=new Cesium$2['Cartesian3']();Cesium$2[_0x1def19(0x1f8)]['multiplyByPoint'](this['_matrix'],_0x58d79e[_0x1def19(0x2f1)]['center'],_0x1fdf64);const _0x942ab7=new Cesium$2['BoundingSphere'](_0x1fdf64,_0x58d79e[_0x1def19(0x2f1)]['radius']),_0x278d9c=new Cesium$2['DrawCommand']({'primitiveType':_0x58d79e['primitiveType'],'shaderProgram':_0x19a531,'vertexArray':_0x17336e,'modelMatrix':this['_matrix'],'renderState':_0xe3297d,'boundingVolume':_0x942ab7,'uniformMap':{'marsColor':_0x3df553?()=>{return this['_outlineColor'];}:()=>{var _0x4990eb=_0x1def19;return this[_0x4990eb(0x1da)];},'globalAlpha':()=>{return this['style']['globalAlpha'];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$2[_0x1def19(0x282)]['TRANSLUCENT'],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$2[(_0x1def19(0x284))]({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x278d9c),_0x278d9c[_0x1def19(0x378)]=_0x4332f3[_0x1def19(0x167)]({'primitive':_0x278d9c,'id':this['id']});if(!_0x3df553){const _0x578660=new Cesium$2['DrawCommand']({'owner':_0x278d9c,'primitiveType':_0x58d79e['primitiveType'],'pickOnly':!![]});_0x578660['vertexArray']=_0x17336e,_0x578660[_0x1def19(0x380)]=_0xe3297d;const _0x5529c1=Cesium$2['ShaderProgram']['fromCache']({'context':_0x4332f3,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$2['ShaderSource']['createPickFragmentShaderSource'](SatelliteSensorFS,'uniform'),'attributeLocations':_0x3e2bc5});_0x578660['shaderProgram']=_0x5529c1,_0x578660['uniformMap']=_0x278d9c[_0x1def19(0x19b)],_0x578660['uniformMap']['czm_pickColor']=()=>{var _0x843942=_0x1def19;return _0x278d9c['pickId'][_0x843942(0x2bc)];},_0x578660[_0x1def19(0x365)]=Cesium$2['Pass'][_0x1def19(0x29e)],_0x578660[_0x1def19(0x325)]=_0x942ab7,_0x578660['modelMatrix']=this[_0x1def19(0x2ea)],this['_pickCommands']['push'](_0x578660);}return _0x278d9c;}[_0x16ff71(0x18a)](){var _0x41e62e=_0x16ff71;this['_drawCommands']&&this[_0x41e62e(0x1a4)]['length']>0x0&&(this['_drawCommands']['forEach'](function(_0x14aef1){_0x14aef1['vertexArray']&&_0x14aef1['vertexArray']['destroy'](),_0x14aef1['shaderProgram']&&_0x14aef1['shaderProgram']['destroy']();}),delete this['_drawCommands']),this[_0x41e62e(0x2a7)]&&this['_pickCommands']['length']>0x0&&(this[_0x41e62e(0x2a7)]['forEach'](function(_0x29ea53){var _0x7001fe=_0x41e62e;_0x29ea53[_0x7001fe(0x162)]&&_0x29ea53[_0x7001fe(0x162)]['destroy'](),_0x29ea53['shaderProgram']&&_0x29ea53['shaderProgram']['destroy']();}),delete this['_pickCommands']);}['computeMatrix'](_0x2fb096,_0x310a1a){var _0xcf61a8=_0x16ff71;this['_positionCartesian']=mars3d__namespace['PointUtil'][_0xcf61a8(0x163)](this['position'],_0x2fb096);if(!this['_positionCartesian'])return this['_matrix']=new Cesium$2['Matrix4'](),this['_matrix'];if(this['_lookAt']){const _0x28fcb7=this['_positionCartesian'],_0x2dcef6=mars3d__namespace[_0xcf61a8(0x1d1)]['getPositionValue'](this[_0xcf61a8(0x2e8)],_0x2fb096);if(Cesium$2[_0xcf61a8(0x31a)](_0x2dcef6)){this['length']=Cesium$2['Cartesian3']['distance'](_0x28fcb7,_0x2dcef6);const _0x426366=mars3d__namespace['PointUtil']['getHeadingPitchRollForLine'](_0x28fcb7,_0x2dcef6,this['ellipsoid'],this['_fixedFrameTransform']);this[_0xcf61a8(0x25c)]=_0x426366['pitch'],this['_rollRadians']=_0x426366['roll'],!(this['_headingRadians']instanceof Cesium$2['CallbackProperty'])&&(this[_0xcf61a8(0x328)]=_0x426366['heading']);}}if(this['style'][_0xcf61a8(0x2d6)]){const _0x2dbbd8=this['getRayEarthLength']();this['_intersectEllipsoid']=_0x2dbbd8>0x0;if(this['_intersectEllipsoid']){if(this['style']['hideRayEllipsoid'])return this['_matrix']=new Cesium$2[(_0xcf61a8(0x1f8))](),this['_matrix'];this['length']=_0x2dbbd8;}}return this['_modelMatrix']=this['_fixedFrameTransform'](this['_positionCartesian'],this['ellipsoid'],this['_modelMatrix']),this['_quaternion']=Cesium$2['Quaternion']['fromHeadingPitchRoll'](new Cesium$2['HeadingPitchRoll'](this['headingRadians'],this[_0xcf61a8(0x25c)],this['_rollRadians']),this['_quaternion']),this[_0xcf61a8(0x2ea)]=Cesium$2[_0xcf61a8(0x1f8)]['fromTranslationQuaternionRotationScale'](this[_0xcf61a8(0x161)],this['_quaternion'],this['_scale'],this['_matrix']),Cesium$2['Matrix4']['multiplyTransformation'](this['_modelMatrix'],this['_matrix'],this['_matrix']),this['_matrix'];}['updateGeometry'](){var _0x58d2b6=_0x16ff71;const _0x92c81d=RectGeometry['fromAnglesLength'](this['_angle1'],this['_angle2'],this['length'],!![]);this[_0x58d2b6(0x339)]=_0x92c81d,this['vao']=this[_0x58d2b6(0x1b6)](),this['_geometry']=this[_0x58d2b6(0x369)](this['vao'][_0x58d2b6(0x169)],this['vao']['fourPposition'],this[_0x58d2b6(0x27f)]['topPsts'],Cesium$2['PrimitiveType'][_0x58d2b6(0x285)],this['_color']),this['_topGeometry']=this[_0x58d2b6(0x369)](this['vao']['topPindices'],this['vao']['topPpositions'],this[_0x58d2b6(0x27f)][_0x58d2b6(0x21f)],Cesium$2['PrimitiveType']['TRIANGLES'],this['_color']),this['_topOutlineGeometry']=this['createGeometry'](this['vao']['topOindices'],this[_0x58d2b6(0x27f)]['topPpositions'],this['vao'][_0x58d2b6(0x21f)],Cesium$2['PrimitiveType'][_0x58d2b6(0x34c)],this['_outlineColor']),this['_outlineGeometry']=this['createGeometry'](this['vao']['fourOindices'],this['vao']['fourPposition'],this[_0x58d2b6(0x27f)][_0x58d2b6(0x21f)],Cesium$2['PrimitiveType'][_0x58d2b6(0x34c)],this['_outlineColor']),this['_attributes_positions']=new Float32Array(this['_geometry']['attributes']['position'][_0x58d2b6(0x2a6)]['length']);for(let _0x56af5a=0x0;_0x56af5a_0x453a63)return _0x453a63=_0x3fb87a,_0x453a63;}const _0x5268f6=this[_0x367619(0x28e)]();return _0x5268f6['forEach']((_0x3400b5,_0x3eed2b)=>{var _0x39143c=_0x367619;if(_0x3400b5==null)return;const _0x3329a9=Cesium$2[_0x39143c(0x265)]['distance'](this[_0x39143c(0x24a)],_0x3400b5);_0x3329a9>_0x453a63&&(_0x453a63=_0x3329a9);}),_0x453a63;}['getRayEarthPositions'](){var _0x12356a=_0x16ff71;const _0x56368b=this['_positionCartesian'],_0x393014=Cesium$2['Math']['toRadians'](this['pitch']+this['angle2']),_0x4ad69a=Cesium$2['Math']['toRadians'](this[_0x12356a(0x28d)]-this['angle2']),_0x378427=Cesium$2[_0x12356a(0x257)]['toRadians'](this[_0x12356a(0x2fa)]+this['angle1']),_0x3824de=Cesium$2['Math'][_0x12356a(0x30c)](this['roll']-this[_0x12356a(0x2e3)]),_0x24093d=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x56368b,new Cesium$2[(_0x12356a(0x2b3))](this[_0x12356a(0x16d)],_0x393014,_0x378427),this['_reverse']),_0x3bf10b=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x56368b,new Cesium$2[(_0x12356a(0x2b3))](this[_0x12356a(0x16d)],_0x393014,_0x3824de),this['_reverse']),_0x437242=mars3d__namespace['PointUtil']['getRayEarthPosition'](_0x56368b,new Cesium$2['HeadingPitchRoll'](this['headingRadians'],_0x4ad69a,_0x3824de),this['_reverse']),_0xd1f88d=mars3d__namespace[_0x12356a(0x1d1)]['getRayEarthPosition'](_0x56368b,new Cesium$2[(_0x12356a(0x2b3))](this['headingRadians'],_0x4ad69a,_0x378427),this[_0x12356a(0x301)]);return[_0x24093d,_0x3bf10b,_0x437242,_0xd1f88d];}[_0x16ff71(0x202)](_0x1b266b,_0x3564c3){var _0x51d2a8=_0x16ff71;return _0x1b266b['drawShow']=![],mars3d__namespace['GraphicUtil']['create'](_0x51d2a8(0x1db),_0x1b266b);}}mars3d__namespace['graphic'][_0x16ff71(0x343)]=RectSensor,mars3d__namespace[_0x16ff71(0x154)]['register'](_0x16ff71(0x1e2),RectSensor,!![]);const SensorType={'Rect':0x0,'Conic':0x1},Cesium$1=mars3d__namespace['Cesium'],BasePointPrimitive=mars3d__namespace['graphic'][_0x16ff71(0x1a9)],RayEllipsoidType={'None':0x0,'All':0x1,'Part':0x2};class SatelliteSensor extends BasePointPrimitive{constructor(_0xaae677={}){var _0x203358=_0x16ff71;super(_0xaae677),this['_modelMatrix']=Cesium$1[_0x203358(0x1f8)]['clone'](Cesium$1['Matrix4']['IDENTITY']),this['_quaternion']=new Cesium$1['Quaternion'](),this[_0x203358(0x161)]=new Cesium$1['Cartesian3'](),this[_0x203358(0x2a0)]=new Cesium$1[(_0x203358(0x265))](0x1,0x1,0x1),this[_0x203358(0x2ea)]=new Cesium$1['Matrix4'](),this['_outlinePositions']=[],this['_imagingAreaPositions']=[],this[_0x203358(0x195)]=![],this['style']['globalAlpha']=0x1,this[_0x203358(0x23e)]['flat']=this[_0x203358(0x23e)]['flat']??!![];const _0x2abbe2=style2Primitive(this['style']);this['_sensorType']=_0x2abbe2[_0x203358(0x2b1)]??SensorType['Rect'],this['_angle1']=_0x2abbe2['angle1']||_0x2abbe2['angle']||0x5,this['_angle2']=_0x2abbe2['angle2']||_0x2abbe2['angle']||0x5,this[_0x203358(0x1e0)]=_0x2abbe2[_0x203358(0x152)]??0x0,this['_color']=_0x2abbe2['color']??Cesium$1['Color']['YELLOW'],this['_outline']=_0x2abbe2['outline']??![],this['_outlineColor']=_0x2abbe2['outlineColor'],this['_groundPolyColor']=_0x2abbe2[_0x203358(0x2d5)],this['_groundOutLineColor']=_0x2abbe2[_0x203358(0x1f6)],this['_rayEllipsoid']=_0x2abbe2['rayEllipsoid']??![],this['pitch']=_0x2abbe2['pitch']??0x0,this['heading']=_0x2abbe2['heading']??0x0,this['roll']=_0x2abbe2['roll']??0x0,this['_fixedFrameTransform']=this[_0x203358(0x288)]['fixedFrameTransform']??Cesium$1[_0x203358(0x33d)]['eastNorthUpToFixedFrame'],this['_reverse']=this['options']['reverse']??!![],this['_lookAt']=this['options']['lookAt'],this['_trackPositions']=[],this[_0x203358(0x245)]=[];}get[_0x16ff71(0x2b1)](){return this['_sensorType'];}set[_0x16ff71(0x2b1)](_0x509902){this['_sensorType']=_0x509902,this['updateGeometry']();}get[_0x16ff71(0x2bc)](){return this['_color'];}set['color'](_0x4743b8){this['_color']=mars3d__namespace['Util']['getCesiumColor'](_0x4743b8);}get['outlineColor'](){return this['_outlineColor'];}set['outlineColor'](_0x437e02){this['_outlineColor']=mars3d__namespace['Util']['getCesiumColor'](_0x437e02);}get['angle'](){return this['_angle1'];}set['angle'](_0x1cfc7d){var _0x3911e9=_0x16ff71;this['_angle1']=_0x1cfc7d,this[_0x3911e9(0x331)]=_0x1cfc7d,this['updateGeometry']();}get['angle1'](){var _0x2c42df=_0x16ff71;return this[_0x2c42df(0x318)];}set['angle1'](_0x3c3a17){this['_angle1']=Number(_0x3c3a17),this['updateGeometry']();}get['angle2'](){return this['_angle2'];}set['angle2'](_0x79f9a1){var _0x307e7d=_0x16ff71;this['_angle2']=Number(_0x79f9a1),this[_0x307e7d(0x17b)]();}get['heading'](){var _0x10f23d=_0x16ff71;return Cesium$1[_0x10f23d(0x257)]['toDegrees'](this['_headingRadians']);}set['heading'](_0x2a7d2e){this['_headingRadians']=Cesium$1['Math']['toRadians'](_0x2a7d2e);}get['pitch'](){return Cesium$1['Math']['toDegrees'](this['_pitchRadians']);}set['pitch'](_0x537203){this['_pitchRadians']=Cesium$1['Math']['toRadians'](_0x537203);}get['roll'](){return Cesium$1['Math']['toDegrees'](this['_rollRadians']);}set[_0x16ff71(0x2fa)](_0x121cca){var _0x819648=_0x16ff71;this[_0x819648(0x1cb)]=Cesium$1['Math']['toRadians'](_0x121cca);}get['outline'](){return this['_outline'];}set['outline'](_0x1b4901){this['_outline']=_0x1b4901;}get['lookAt'](){return this['_lookAt'];}set[_0x16ff71(0x263)](_0x28576d){var _0xf8823c=_0x16ff71;this[_0xf8823c(0x2e8)]=_0x28576d;}get[_0x16ff71(0x175)](){return this['_matrix'];}get[_0x16ff71(0x358)](){var _0x355940=_0x16ff71;return mars3d__namespace[_0x355940(0x1d1)][_0x355940(0x247)](this['_matrix'],this[_0x355940(0x301)]);}get[_0x16ff71(0x2d6)](){return this['_rayEllipsoid'];}set[_0x16ff71(0x2d6)](_0x4a3b5f){this['_rayEllipsoid']=_0x4a3b5f;}get['intersectEllipsoid'](){return this['_rayEllipsoidType'];}get['geometryLength'](){return this['_length']+0x61529c;}[_0x16ff71(0x2ae)](){this['updateGeometry']();}['updateModelMatrix'](){this['updateGeometry'](),super['updateModelMatrix']();}['_addedHook'](){var _0x507e45=_0x16ff71;this['ellipsoid']=this[_0x507e45(0x1cf)]['scene']['globe']['ellipsoid'];if(!this[_0x507e45(0x191)])return;this['primitiveCollection']['add'](this),this[_0x507e45(0x385)]?this['_map']['entities']['add'](this['_groundPolyEntity']):this['_addGroundPolyEntity'](this['_groundArea']||this['_groundOutLine']);}['_removedHook'](){if(!this['_map'])return;this['_groundPolyEntity']&&this['_map']['entities']['remove'](this['_groundPolyEntity']),this['primitiveCollection']['contains'](this)&&(this['_noDestroy']=!![],this['primitiveCollection']['remove'](this),this['_noDestroy']=![]),this['_clearGeometry'](),this['_clearDrawCommand']();}[_0x16ff71(0x30d)](_0xb3c58e){var _0x47379b=_0x16ff71;if(!this['_show'])return;this[_0x47379b(0x158)](_0xb3c58e['time']);if(!this['_positionCartesian'])return;!this['_geometry']&&this['updateGeometry']();if(_0xb3c58e[_0x47379b(0x289)]===Cesium$1['SceneMode']['SCENE3D'])this['_drawCommands']=[],this['_pickCommands']=[],this['_outlinePositions']=this['extend2CartesianArray'](this['_outlinePositions']),this['_rayEllipsoid']&&this['_rayEllipsoidType']===RayEllipsoidType['Part']?this['_imagingAreaPositions']=mars3d__namespace['PointUtil']['setPositionsHeight'](this['_outlinePositions'],0x0):this['_imagingAreaPositions']=Cesium$1['clone'](this['_outlinePositions']),this['updateVolumeGeometry'](),this['_volumeGeometry']&&(this[_0x47379b(0x1a4)]['push'](this[_0x47379b(0x209)](this['_volumeGeometry'],_0xb3c58e)),this['_outline']&&this[_0x47379b(0x1a4)]['push'](this['createDrawCommand'](this['_volumeOutlineGeometry'],_0xb3c58e,!![]))),_0xb3c58e[_0x47379b(0x213)]['render']?this[_0x47379b(0x1a4)]&&_0xb3c58e['commandList']['push'](...this['_drawCommands']):this['_pickCommands']&&_0xb3c58e[_0x47379b(0x253)]['push'](...this[_0x47379b(0x2a7)]),this[_0x47379b(0x385)]&&(this['_groundPolyEntity']['show']=Boolean(this['_groundArea']&&this[_0x47379b(0x191)]));else{const _0x3606e6=this['getAreaCoords']();_0x3606e6&&_0x3606e6[_0x47379b(0x152)]>0x0?(this['_imagingAreaPositions']=mars3d__namespace['PointTrans'][_0x47379b(0x296)](_0x3606e6),!this['_groundPolyEntity']&&this['_addGroundPolyEntity'](!![]),this['_groundPolyEntity']['show']!==!![]&&(this['_groundPolyEntity']['show']=!![])):this['_groundPolyEntity']&&this['_groundPolyEntity']['show']!==![]&&(this[_0x47379b(0x385)]['show']=![]);}}['computeMatrix'](_0x12ddcd,_0x4b4851){var _0x1395fa=_0x16ff71;this['property']&&(this['_position']=this['property'][_0x1395fa(0x334)](_0x12ddcd));this[_0x1395fa(0x24a)]=mars3d__namespace['PointUtil']['getPositionValue'](this['position'],_0x12ddcd);if(!this['_positionCartesian'])return this[_0x1395fa(0x2ea)]=new Cesium$1[(_0x1395fa(0x1f8))](),this['_matrix'];if(this['options']['orientation']){const _0xfd4f18=mars3d__namespace['Util'][_0x1395fa(0x1ef)](this[_0x1395fa(0x288)][_0x1395fa(0x383)],Cesium$1['Quaternion'],_0x12ddcd);if(this['_positionCartesian']&&_0xfd4f18){const _0x194239=mars3d__namespace['PointUtil']['getHeadingPitchRollByOrientation'](this['_positionCartesian'],_0xfd4f18,this['ellipsoid'],this['_fixedFrameTransform']);!Cesium$1['defined'](this['style'][_0x1395fa(0x200)])&&(this['_headingRadians']=_0x194239[_0x1395fa(0x200)]),!Cesium$1['defined'](this[_0x1395fa(0x23e)]['roll'])&&(this[_0x1395fa(0x1cb)]=_0x194239['roll']),!Cesium$1['defined'](this['style']['pitch'])&&(this['_pitchRadians']=_0x194239['pitch']);}}if(this['_lookAt']){const _0x33d274=this[_0x1395fa(0x24a)],_0x45fa4f=mars3d__namespace['PointUtil']['getPositionValue'](this['_lookAt'],_0x12ddcd);if(Cesium$1[_0x1395fa(0x31a)](_0x45fa4f)){const _0x790552=mars3d__namespace['PointUtil'][_0x1395fa(0x233)](_0x45fa4f,_0x33d274,this[_0x1395fa(0x2f9)],this['_fixedFrameTransform']);this['_headingRadians']=_0x790552['heading'],this['_pitchRadians']=_0x790552[_0x1395fa(0x28d)],this[_0x1395fa(0x1cb)]=_0x790552[_0x1395fa(0x2fa)];}}return this['_modelMatrix']=this['_fixedFrameTransform'](this['_positionCartesian'],this['ellipsoid'],this['_modelMatrix']),this['_quaternion']=Cesium$1[_0x1395fa(0x18b)]['fromHeadingPitchRoll'](new Cesium$1['HeadingPitchRoll'](this['_headingRadians'],this['_pitchRadians'],this['_rollRadians']),this['_quaternion']),this['_matrix']=Cesium$1['Matrix4']['fromTranslationQuaternionRotationScale'](this['_translation'],this[_0x1395fa(0x249)],this['_scale'],this['_matrix']),Cesium$1['Matrix4']['multiplyTransformation'](this['_modelMatrix'],this['_matrix'],this['_matrix']),this['_matrix'];}['updateGeometry'](){var _0x1e3d04=_0x16ff71;this[_0x1e3d04(0x2bf)]();const _0x1c2a7b=this['_reverse']?this['geometryLength']:-this['geometryLength'];this['_sensorType']===SensorType['Conic']?(this['_geometry']=ConicGeometry['createGeometry'](ConicGeometry[_0x1e3d04(0x1a5)](this[_0x1e3d04(0x318)],_0x1c2a7b,!![]),this['_matrix'],this),this[_0x1e3d04(0x355)]=ConicGeometry['createOutlineGeometry'](ConicGeometry[_0x1e3d04(0x1a5)](this[_0x1e3d04(0x318)],_0x1c2a7b,!![]))):(this['_geometry']=RectGeometry['createGeometry'](RectGeometry['fromAnglesLength'](this[_0x1e3d04(0x318)],this['_angle2'],_0x1c2a7b,!![]),this[_0x1e3d04(0x2ea)],this),this['_outlineGeometry']=RectGeometry['createOutlineGeometry'](RectGeometry['fromAnglesLength'](this['_angle1'],this[_0x1e3d04(0x331)],_0x1c2a7b,!![])));this[_0x1e3d04(0x178)]=new Float32Array(this[_0x1e3d04(0x16f)]['attributes']['position']['values']['length']);for(let _0x461966=0x0;_0x461966{return this['_outlineColor'];}:()=>{return this['_color'];},'globalAlpha':()=>{var _0x49de9f=_0x11aa9e;return this['style'][_0x49de9f(0x36b)];}},'castShadows':![],'receiveShadows':![],'pass':Cesium$1[_0x11aa9e(0x282)]['TRANSLUCENT'],'cull':!![],'owner':this,'pickOnly':!![],'pickCommand':new Cesium$1['DrawCommand']({'owner':this,'pickOnly':!![]})});this['bindPickId'](_0x54579d),_0x54579d['pickId']=_0x3eb036[_0x11aa9e(0x167)]({'primitive':_0x54579d,'id':this['id']});if(!_0x35263a){const _0x39c806=new Cesium$1['DrawCommand']({'owner':_0x54579d,'primitiveType':_0x166d6a['primitiveType'],'pickOnly':!![]});_0x39c806[_0x11aa9e(0x162)]=_0x326483,_0x39c806['renderState']=_0x3455cd;const _0xd1ed4f=Cesium$1['ShaderProgram']['fromCache']({'context':_0x3eb036,'vertexShaderSource':SatelliteSensorVS,'fragmentShaderSource':Cesium$1['ShaderSource'][_0x11aa9e(0x1b5)](SatelliteSensorFS,_0x11aa9e(0x27b)),'attributeLocations':_0xb867a6});_0x39c806['shaderProgram']=_0xd1ed4f,_0x39c806[_0x11aa9e(0x19b)]=_0x54579d['uniformMap'],_0x39c806['uniformMap']['czm_pickColor']=()=>{return _0x54579d['pickId']['color'];},_0x39c806['pass']=Cesium$1['Pass']['TRANSLUCENT'],_0x39c806['boundingVolume']=_0x4750c3,_0x39c806[_0x11aa9e(0x32c)]=this['_matrix'],this[_0x11aa9e(0x2a7)]['push'](_0x39c806);}return _0x54579d;}['_clearDrawCommand'](){var _0x50a6d1=_0x16ff71;this['_drawCommands']&&this[_0x50a6d1(0x1a4)][_0x50a6d1(0x152)]>0x0&&(this['_drawCommands']['forEach'](function(_0x5a7559){var _0x74c083=_0x50a6d1;_0x5a7559[_0x74c083(0x162)]&&_0x5a7559['vertexArray'][_0x74c083(0x2a4)](),_0x5a7559['shaderProgram']&&_0x5a7559[_0x74c083(0x240)]['destroy']();}),delete this['_drawCommands']),this['_pickCommands']&&this[_0x50a6d1(0x2a7)]['length']>0x0&&(this['_pickCommands']['forEach'](function(_0x1b042c){var _0x4e1b50=_0x50a6d1;_0x1b042c['vertexArray']&&_0x1b042c['vertexArray'][_0x4e1b50(0x2a4)](),_0x1b042c['shaderProgram']&&_0x1b042c[_0x4e1b50(0x240)]['destroy']();}),delete this['_pickCommands']);}['setOpacity'](_0x368f95){var _0x1602f8=_0x16ff71;this[_0x1602f8(0x23e)]['globalAlpha']=_0x368f95;}[_0x16ff71(0x27e)](){var _0x34762e=_0x16ff71;if(this['_rayEllipsoidType']===RayEllipsoidType['None'])return null;let _0xce1fdc=this['_outlinePositions'];!this['_rayEllipsoid']&&(this[_0x34762e(0x34f)]=!![],_0xce1fdc=this[_0x34762e(0x27c)](),this['_rayEllipsoid']=![]);let _0xf709c7=mars3d__namespace['PointTrans']['cartesians2lonlats'](_0xce1fdc);return _0xf709c7=mars3d__namespace[_0x34762e(0x33b)]['convex'](_0xf709c7),_0xf709c7;}[_0x16ff71(0x27c)](_0x18cd59=[]){var _0x521590=_0x16ff71;const _0x5840e3=new Cesium$1['Matrix4'](),_0x6d954a=new Cesium$1[(_0x521590(0x265))](),_0x1d9a8d=new Cesium$1['Cartesian3'](),_0x372f19=new Cesium$1['Ray']();Cesium$1['Matrix4'][_0x521590(0x204)](this['_matrix'],_0x5840e3),Cesium$1[_0x521590(0x1f8)]['multiplyByPoint'](this[_0x521590(0x2ea)],Cesium$1['Cartesian3']['ZERO'],_0x1d9a8d),_0x1d9a8d['clone'](_0x372f19['origin']);let _0x3e6793=0x0;const _0x1ea6bc=this['_positions']['length'];for(let _0x4f1b38=0x3;_0x4f1b38<_0x1ea6bc;_0x4f1b38+=0x3){Cesium$1[_0x521590(0x265)]['unpack'](this['_positions'],_0x4f1b38,_0x6d954a),Cesium$1['Matrix4']['multiplyByPoint'](this['_matrix'],_0x6d954a,_0x1d9a8d),Cesium$1['Cartesian3'][_0x521590(0x14f)](_0x1d9a8d,_0x372f19[_0x521590(0x180)],_0x372f19['direction']),Cesium$1['Cartesian3']['normalize'](_0x372f19[_0x521590(0x1bf)],_0x372f19['direction']);const _0x93209e=Cesium$1[_0x521590(0x1ce)]['rayEllipsoid'](_0x372f19,this['ellipsoid']);let _0x9e0d36=null;if(this['_length']){const _0x38b338=Math['max'](this['angle1']||0x0,this[_0x521590(0x2da)]||0x0),_0x46a012=this['_length']/Math['cos'](Cesium$1[_0x521590(0x257)][_0x521590(0x30c)](_0x38b338));_0x9e0d36=Cesium$1['Ray']['getPoint'](_0x372f19,_0x46a012);}else{if(_0x93209e)this['_rayEllipsoidType']=RayEllipsoidType['All'],_0x9e0d36=Cesium$1['Ray']['getPoint'](_0x372f19,_0x93209e['start']);else return this[_0x521590(0x319)]=RayEllipsoidType['None'],this['extend2CartesianArrayZC'](_0x18cd59);}if(_0x9e0d36)_0x9e0d36['clone'](_0x1d9a8d);else continue;_0x18cd59[_0x3e6793]=_0x1d9a8d[_0x521590(0x37a)](_0x18cd59[_0x3e6793]);const _0x434dea=this[_0x521590(0x16f)]['attributes']['position']['values'];_0x434dea&&_0x434dea instanceof Float32Array&&(Cesium$1['Matrix4'][_0x521590(0x1c1)](_0x5840e3,_0x1d9a8d,_0x1d9a8d),_0x434dea[_0x4f1b38]=_0x1d9a8d['x'],_0x434dea[_0x4f1b38+0x1]=_0x1d9a8d['y'],_0x434dea[_0x4f1b38+0x2]=_0x1d9a8d['z']),_0x3e6793++;}return _0x18cd59;}['extend2CartesianArrayZC'](_0x5d5d74=[]){var _0x369a7a=_0x16ff71;const _0x51e534=new Cesium$1['Matrix4'](),_0x4f58f6=new Cesium$1['Cartesian3'](),_0x4f5823=new Cesium$1['Cartesian3'](),_0x18ed57=new Cesium$1[(_0x369a7a(0x243))]();Cesium$1[_0x369a7a(0x1f8)]['inverse'](this['_matrix'],_0x51e534),Cesium$1['Matrix4']['multiplyByPoint'](this['_matrix'],Cesium$1['Cartesian3']['ZERO'],_0x4f5823),_0x4f5823['clone'](_0x18ed57['origin']);let _0x4a614d=0x0;const _0x809e50=this[_0x369a7a(0x178)]['length'];for(let _0x5d3e5a=0x3;_0x5d3e5a<_0x809e50;_0x5d3e5a+=0x3){Cesium$1['Cartesian3']['unpack'](this['_positions'],_0x5d3e5a,_0x4f58f6),Cesium$1[_0x369a7a(0x1f8)]['multiplyByPoint'](this['_matrix'],_0x4f58f6,_0x4f5823),Cesium$1[_0x369a7a(0x265)][_0x369a7a(0x14f)](_0x4f5823,_0x18ed57[_0x369a7a(0x180)],_0x18ed57['direction']),Cesium$1[_0x369a7a(0x265)]['normalize'](_0x18ed57['direction'],_0x18ed57['direction']);const _0x229b62=Cesium$1['IntersectionTests']['rayEllipsoid'](_0x18ed57,this['ellipsoid']);_0x229b62&&(this['_rayEllipsoidType']=RayEllipsoidType['Part']);let _0x3dc2d8=null;this[_0x369a7a(0x34f)]&&_0x229b62&&(_0x3dc2d8=Cesium$1['Ray']['getPoint'](_0x18ed57,_0x229b62[_0x369a7a(0x333)]));if(!_0x3dc2d8){const _0x72dcf6=Cesium$1['Cartographic'][_0x369a7a(0x241)](_0x18ed57[_0x369a7a(0x180)])['height'],_0x4589e6=_0x72dcf6+0x61529c;_0x3dc2d8=Cesium$1[_0x369a7a(0x243)]['getPoint'](_0x18ed57,_0x4589e6);}if(_0x3dc2d8)_0x3dc2d8['clone'](_0x4f5823);else continue;_0x5d5d74[_0x4a614d]=_0x4f5823['clone'](_0x5d5d74[_0x4a614d]);const _0xd3ff32=this[_0x369a7a(0x16f)][_0x369a7a(0x221)][_0x369a7a(0x27d)]['values'];_0xd3ff32&&_0xd3ff32 instanceof Float32Array&&(Cesium$1['Matrix4']['multiplyByPoint'](_0x51e534,_0x4f5823,_0x4f5823),_0xd3ff32[0x3+_0x5d3e5a*0x3]=_0x4f5823['x'],_0xd3ff32[0x3+_0x5d3e5a*0x3+0x1]=_0x4f5823['y'],_0xd3ff32[0x3+_0x5d3e5a*0x3+0x2]=_0x4f5823['z']),_0x4a614d++;}return _0x5d5d74;}['_addGroundPolyEntity'](_0x267f60){var _0x403031=_0x16ff71;if(!_0x267f60||this['_groundPolyEntity'])return;const _0x190b32=new Cesium$1['PolygonHierarchy']();this['_groundPolyEntity']=this['_map'][_0x403031(0x1b4)][_0x403031(0x256)]({'show':Boolean(this['_groundArea']),'polygon':{'arcType':Cesium$1['ArcType']['RHUMB'],'material':this['_groundPolyColor']||this['_color'],'hierarchy':new Cesium$1['CallbackProperty'](_0x2d18ff=>{var _0x43f921=_0x403031;return _0x190b32['positions']=this['groundAreaPositions']||this[_0x43f921(0x31c)],_0x190b32;},![])}});}[_0x16ff71(0x202)](_0x3ebe00,_0x3de735){var _0x987389=_0x16ff71;return _0x3ebe00[_0x987389(0x280)]=![],mars3d__namespace['GraphicUtil']['create']('point',_0x3ebe00);}}mars3d__namespace['graphic'][_0x16ff71(0x198)]=SatelliteSensor,mars3d__namespace['GraphicUtil'][_0x16ff71(0x18e)]('satelliteSensor',SatelliteSensor),SatelliteSensor['Type']=SensorType;const Cesium=mars3d__namespace[_0x16ff71(0x244)],Route=mars3d__namespace['graphic']['Route'];class Satellite extends Route{constructor(_0xffee4c={}){var _0x42354f=_0x16ff71;_0xffee4c['referenceFrame']=_0xffee4c[_0x42354f(0x287)]??Cesium['ReferenceFrame'][_0x42354f(0x24b)],super(_0xffee4c);if(this['options']['tle1']&&this['options']['tle2']){this[_0x42354f(0x1f5)]=new Tle(this['options']['tle1'],this['options']['tle2'],this[_0x42354f(0x288)]['name']);if(!Cesium[_0x42354f(0x31a)](this[_0x42354f(0x288)]['period'])){this['options']['period']=this['_tle']['period'];if(!Cesium[_0x42354f(0x31a)](this[_0x42354f(0x288)]['period']))throw new Error('Satellite:\x20period\x20is\x20null');}this[_0x42354f(0x37f)]=this[_0x42354f(0x288)]['period']*0x3c*0x3e8,this['_pointsNum']=this['options'][_0x42354f(0x215)]??0x3c;}}get['tle'](){return this['_tle'];}get['timeRange'](){var _0x413260=_0x16ff71;return{'start':new Date(this[_0x413260(0x1c6)])[_0x413260(0x36d)]('yyyy-MM-dd\x20HH:mm:ss'),'end':new Date(this['_time_path_end'])[_0x413260(0x36d)]('yyyy-MM-dd\x20HH:mm:ss')};}get['cone'](){var _0xabd7f2=_0x16ff71;return this['coneEntity']||this[_0xabd7f2(0x217)];}set['cone'](_0x1d1570){this['options']['cone']=_0x1d1570,this['_updateCone']();}get[_0x16ff71(0x2e3)](){return this['cone']['angle1'];}set[_0x16ff71(0x2e3)](_0x51cd80){this['cone']['angle1']=_0x51cd80;}get[_0x16ff71(0x2da)](){return this['cone']['angle2'];}set[_0x16ff71(0x2da)](_0x320a57){this['cone']['angle2']=_0x320a57;}get['coneShow'](){var _0x2f7ced;return(_0x2f7ced=this['options']['cone'])===null||_0x2f7ced===void 0x0?void 0x0:_0x2f7ced['show'];}set['coneShow'](_0xe8ce9b){var _0x2fd11b=_0x16ff71;this['options']['cone'][_0x2fd11b(0x1eb)]=_0xe8ce9b,this[_0x2fd11b(0x1ff)]();}get['lookAt'](){var _0x3c8a72=_0x16ff71;return this[_0x3c8a72(0x2e8)];}set[_0x16ff71(0x263)](_0x1cb141){this['_lookAt']=_0x1cb141,this['_coneList']&&this['_coneList']['forEach'](function(_0xaf9e02,_0x1fc0b7,_0x34f980){_0xaf9e02['lookAt']=_0x1cb141;}),this['coneEntity']&&(this['coneEntity']['lookAt']=_0x1cb141);}['_mountedHook'](){var _0x2aadc7=_0x16ff71;super[_0x2aadc7(0x2a8)](),this['_updateCone']();}['_addedHook'](_0x17f4d8){var _0x167f18=_0x16ff71;super['_addedHook'](_0x17f4d8);if(!this['show'])return;this['_initSampledPositionProperty']();if(this[_0x167f18(0x288)]['position']){var _0xad2a4,_0x11a46b,_0x4603f8;if(((_0xad2a4=this['property'])===null||_0xad2a4===void 0x0?void 0x0:(_0x11a46b=_0xad2a4['_property'])===null||_0x11a46b===void 0x0?void 0x0:(_0x4603f8=_0x11a46b['_times'])===null||_0x4603f8===void 0x0?void 0x0:_0x4603f8['length'])>0x0){const _0x1a5f3f=this['property'][_0x167f18(0x2a2)]['_times'];this['_time_path_start']=Cesium['JulianDate'][_0x167f18(0x181)](_0x1a5f3f[0x0])['getTime'](),this['_time_path_end']=Cesium['JulianDate']['toDate'](_0x1a5f3f[_0x1a5f3f['length']-0x1])[_0x167f18(0x15e)]();}}else this[_0x167f18(0x2cb)]=Cesium['JulianDate']['toDate'](this['_map']['clock']['currentTime'])['getTime'](),this['calculateOrbitPoints']();}[_0x16ff71(0x35b)](_0x583ab2,_0x258688){var _0x47cb5b=_0x16ff71;for(const _0x190f5d in _0x258688){switch(_0x190f5d){case'tle1':case'tle2':{if(this['options'][_0x47cb5b(0x305)]&&this[_0x47cb5b(0x288)]['tle2']){this[_0x47cb5b(0x1f5)]=new Tle(this['options']['tle1'],this['options']['tle2'],this[_0x47cb5b(0x288)]['name']);if(!Cesium[_0x47cb5b(0x31a)](this['options'][_0x47cb5b(0x2ed)])){this['options']['period']=this[_0x47cb5b(0x1f5)][_0x47cb5b(0x2ed)];if(!Cesium['defined'](this[_0x47cb5b(0x288)]['period']))throw new Error('Satellite:\x20period\x20is\x20null');}this['period_time']=this['options']['period']*0x3c*0x3e8,this['_time_current']=Cesium['JulianDate']['toDate'](this['_map']['clock'][_0x47cb5b(0x2d3)])[_0x47cb5b(0x15e)](),this[_0x47cb5b(0x1d4)]();}break;}case'cone':this['_updateCone']();break;default:super['_setOptionsHook'](_0x583ab2,_0x258688);break;}}}['_updatePosition'](){var _0x4bbb2b=_0x16ff71;super['_updatePosition'](),!this['_modelMatrix']&&(this['_modelMatrix']=this['_getModelMatrix'](this['_position'],this[_0x4bbb2b(0x160)])),this[_0x4bbb2b(0x217)]&&this['_coneList']['forEach']((_0x1a9b67,_0xc90fd2,_0x102927)=>{var _0x2ce3e3=_0x4bbb2b;const _0x582731=_0x1a9b67[_0x2ce3e3(0x1f9)]['pitchOffset'],_0x62df8c=this[_0x2ce3e3(0x2f4)](this['_heading_reality'],this['_pitch_reality'],this[_0x2ce3e3(0x2cd)],_0x582731);_0x1a9b67[_0x2ce3e3(0x328)]=_0x62df8c['yaw'],_0x1a9b67[_0x2ce3e3(0x25c)]=_0x62df8c[_0x2ce3e3(0x28d)],_0x1a9b67['_rollRadians']=_0x62df8c['roll'];}),this['coneEntity']&&(this['coneEntity'][_0x4bbb2b(0x328)]=this['_heading_reality'],this['coneEntity']['_pitchRadians']=this[_0x4bbb2b(0x36a)],this['coneEntity']['_rollRadians']=this['_roll_reality']),this['_time_current']=Cesium[_0x4bbb2b(0x22e)]['toDate'](this[_0x4bbb2b(0x1cf)][_0x4bbb2b(0x231)]['currentTime'])[_0x4bbb2b(0x15e)](),!this['options'][_0x4bbb2b(0x27d)]&&this['isNeedRecalculate']()&&this['calculateOrbitPoints']();}['isNeedRecalculate'](){var _0x279ad7=_0x16ff71;if(this['_time_path_start']==null||this['_time_path_end']==null)return!![];const _0x39cfc5=this['_time_path_start']+this['period_time']/0x4,_0x35c20b=this['_time_path_end']-this['period_time']/0x4;return this['_time_current']>_0x39cfc5&&this[_0x279ad7(0x2cb)]<_0x35c20b?![]:!![];}['calculateOrbitPoints'](){var _0x2ee645=_0x16ff71,_0x3d8919,_0x452a3d;this['clearPosition']();let _0x48ee76=Math['floor'](this[_0x2ee645(0x37f)]/this['_pointsNum']);_0x48ee76<0x3e8&&(_0x48ee76=0x3e8);const _0x12e1ad=this[_0x2ee645(0x2cb)]-this[_0x2ee645(0x37f)]/0x2;let _0xcf8e6f,_0x384c5e;for(let _0x3ed667=0x0;_0x3ed667<=this['_pointsNum'];_0x3ed667++){_0xcf8e6f=_0x12e1ad+_0x3ed667*_0x48ee76;const _0x454988=this['_tle']['getEciPosition'](_0xcf8e6f);if(!_0x454988)continue;const _0x5d9cf2=Cesium['JulianDate']['fromDate'](new Date(_0xcf8e6f));this['property']['addSample'](_0x5d9cf2,_0x454988),!_0x384c5e&&(_0x384c5e=_0x454988);}(((_0x3d8919=this['options']['path'])===null||_0x3d8919===void 0x0?void 0x0:_0x3d8919[_0x2ee645(0x199)])??![])&&this['property']['addSample'](Cesium['JulianDate']['fromDate'](new Date(_0xcf8e6f)),_0x384c5e),this['property']['setInterpolationOptions']({'interpolationDegree':0x2,'interpolationAlgorithm':Cesium[_0x2ee645(0x29c)]}),this[_0x2ee645(0x1c6)]=this[_0x2ee645(0x2cb)]-this['period_time']/0x2,this[_0x2ee645(0x22a)]=this['_time_current']+this['period_time']/0x2,(_0x452a3d=this['_child']['path'])!==null&&_0x452a3d!==void 0x0&&_0x452a3d['entity']&&(this['_child'][_0x2ee645(0x26f)]['entity']['availability']=new Cesium['TimeIntervalCollection']([new Cesium[(_0x2ee645(0x2d7))]({'start':Cesium['JulianDate']['fromDate'](new Date(this['_time_path_start'])),'stop':Cesium['JulianDate']['fromDate'](new Date(this['_time_path_end']))})]));}[_0x16ff71(0x2f4)](_0x587184,_0x472cb0,_0x181e35,_0x2c638e){var _0x5439d9=_0x16ff71;const _0x32f0f2=[Math[_0x5439d9(0x2dd)](_0x2c638e),0x0,Math[_0x5439d9(0x226)](_0x2c638e),0x0,0x1,0x0,0x0-Math[_0x5439d9(0x226)](_0x2c638e),0x0,Math['cos'](_0x2c638e)],_0x49439c=_0x32f0f2[0x0],_0x39a89b=_0x32f0f2[0x1],_0x5b8657=_0x32f0f2[0x2],_0x19f2f2=_0x32f0f2[0x3],_0x60bdbe=_0x32f0f2[0x4],_0x4f146f=_0x32f0f2[0x5],_0x35665f=_0x32f0f2[0x6],_0x17f75d=_0x32f0f2[0x7],_0x1211c6=_0x32f0f2[0x8],_0x405925=Math[_0x5439d9(0x2dd)](_0x472cb0)*Math['cos'](_0x587184),_0x162b7b=0x0-Math[_0x5439d9(0x2dd)](_0x472cb0)*Math['sin'](_0x587184),_0x45a963=Math['sin'](_0x472cb0),_0x4bf304=Math['sin'](_0x181e35)*Math['cos'](_0x472cb0)*Math['cos'](_0x587184)+Math['cos'](_0x181e35)*Math['sin'](_0x587184),_0x64959e=0x0-Math['sin'](_0x181e35)*Math[_0x5439d9(0x226)](_0x472cb0)*Math['sin'](_0x587184)+Math['cos'](_0x181e35)*Math['cos'](_0x587184),_0x311778=0x0-Math[_0x5439d9(0x226)](_0x181e35)*Math['cos'](_0x472cb0),_0x3ea182=0x0-Math['cos'](_0x181e35)*Math[_0x5439d9(0x226)](_0x472cb0)*Math[_0x5439d9(0x2dd)](_0x587184)+Math['sin'](_0x181e35)*Math[_0x5439d9(0x226)](_0x587184),_0xb7e86d=Math['cos'](_0x181e35)*Math['sin'](_0x472cb0)*Math['sin'](_0x587184)+Math['sin'](_0x181e35)*Math[_0x5439d9(0x2dd)](_0x587184),_0x25c86a=Math['cos'](_0x181e35)*Math['cos'](_0x472cb0),_0x326987=_0x49439c*_0x405925+_0x39a89b*_0x4bf304+_0x5b8657*_0x3ea182,_0x19f86b=_0x49439c*_0x162b7b+_0x39a89b*_0x64959e+_0x5b8657*_0xb7e86d,_0x5614f9=_0x49439c*_0x45a963+_0x39a89b*_0x311778+_0x5b8657*_0x25c86a,_0x15946c=_0x19f2f2*_0x45a963+_0x60bdbe*_0x311778+_0x4f146f*_0x25c86a,_0xc4372=_0x35665f*_0x45a963+_0x17f75d*_0x311778+_0x1211c6*_0x25c86a,_0xfbc431=Math[_0x5439d9(0x1e8)](0x0-_0x15946c,_0xc4372),_0x58e312=Math['atan2'](_0x5614f9,Math['sqrt'](_0x326987*_0x326987+_0x19f86b*_0x19f86b)),_0x12801b=Math['atan2'](0x0-_0x19f86b,_0x326987);return{'roll':_0xfbc431,'pitch':_0x58e312,'yaw':_0x12801b};}['_updateCone'](){var _0x2a3f11=_0x16ff71;const _0x39082f=this['options']['cone'];_0x39082f&&(_0x39082f['show']??!![])?_0x39082f['list']&&_0x39082f['list']['length']>0x0?this[_0x2a3f11(0x363)](_0x39082f):this['_showOneCone'](_0x39082f):(this['_coneList']&&(this['_coneList'][_0x2a3f11(0x25d)](function(_0x2661f,_0x1622df,_0x5e61d8){this['_layer']['removeGraphic'](_0x2661f,!![]);}),this['_coneList']['clear']()),this['coneEntity']&&(this['_layer'][_0x2a3f11(0x336)](this['coneEntity'],!![]),delete this['coneEntity']));}['_showListCone'](_0x4b0749){var _0x1ad7d6=_0x16ff71;!this['_coneList']&&(this['_coneList']=new Map());for(let _0x223ef0=0x0;_0x223ef0<_0x4b0749['list']['length'];_0x223ef0++){const _0x4259f5=_0x4b0749[_0x1ad7d6(0x232)][_0x223ef0];_0x4259f5[_0x1ad7d6(0x36e)]=_0x4259f5['name']||_0x223ef0;if(_0x4259f5['hasOwnProperty']('show')&&!_0x4259f5['show']){if(this['_coneList']['has'](_0x4259f5[_0x1ad7d6(0x36e)])){const _0x2d9447=this['_coneList'][_0x1ad7d6(0x310)](_0x4259f5['name']);_0x2d9447['remove'](),_0x2d9447[_0x1ad7d6(0x2a4)](!![]),this[_0x1ad7d6(0x217)][_0x1ad7d6(0x294)](_0x4259f5['name']);}}else{const _0x1e5dc7=_0x4259f5['angle1'],_0x2121ca=_0x4259f5['angel2'],_0x1dc74e=Cesium[_0x1ad7d6(0x257)]['toRadians'](this[_0x1ad7d6(0x288)][_0x1ad7d6(0x36f)][_0x1ad7d6(0x200)]||0x0),_0x1cdd15=Cesium[_0x1ad7d6(0x257)]['toRadians'](this['options']['model']['pitch']||0x0),_0x1c273e=Cesium[_0x1ad7d6(0x257)]['toRadians'](this['options']['model']['roll']||0x0),_0x5de821=Cesium['Math'][_0x1ad7d6(0x30c)](_0x4259f5['pitchOffset']),_0x14093b=this['calculate_cam_sight'](_0x1dc74e,_0x1cdd15,_0x1c273e,_0x5de821);if(this['_coneList']['has'](_0x4259f5[_0x1ad7d6(0x36e)])){const _0x1e7c59=this['_coneList']['get'](_0x4259f5['name']);_0x1e7c59['angle1']=_0x1e5dc7,_0x1e7c59[_0x1ad7d6(0x2da)]=_0x2121ca,_0x1e7c59[_0x1ad7d6(0x2b1)]=_0x4b0749[_0x1ad7d6(0x2b1)],_0x1e7c59['color']=_0x4259f5['color'],_0x1e7c59['outline']=_0x4259f5['outline'],_0x1e7c59['_headingRadians']=_0x14093b[_0x1ad7d6(0x25a)],_0x1e7c59['_pitchRadians']=_0x14093b['pitch'],_0x1e7c59['_rollRadians']=_0x14093b['roll'];}else{const _0x3edb65=new SatelliteSensor({'position':new Cesium[(_0x1ad7d6(0x352))](_0x2bd1bd=>{var _0x488fa7=_0x1ad7d6;return this[_0x488fa7(0x1b9)];},![]),'style':{..._0x4259f5,'sensorType':_0x4b0749[_0x1ad7d6(0x2b1)],'angle1':_0x1e5dc7,'angle2':_0x2121ca,'heading':Cesium['Math'][_0x1ad7d6(0x1d3)](_0x14093b['yaw']),'pitch':Cesium['Math'][_0x1ad7d6(0x1d3)](_0x14093b['pitch']),'roll':Cesium['Math']['toDegrees'](_0x14093b['roll'])},'attr':{'pitchOffset':_0x5de821},'reverse':_0x4b0749[_0x1ad7d6(0x18f)],'rayEllipsoid':_0x4b0749['rayEllipsoid']});this['_layer']['addGraphic'](_0x3edb65),this[_0x1ad7d6(0x384)](_0x3edb65),this['_coneList']['set'](_0x4259f5['name'],_0x3edb65);}}}}[_0x16ff71(0x250)](_0x3caf28){var _0x35573c=_0x16ff71;if(this[_0x35573c(0x340)])this[_0x35573c(0x340)]['angle1']=_0x3caf28['angle1']||0x14,this['coneEntity']['angle2']=_0x3caf28[_0x35573c(0x2da)]||0x14,this[_0x35573c(0x340)]['sensorType']=_0x3caf28['sensorType'],this['coneEntity'][_0x35573c(0x2bc)]=_0x3caf28['color'],this[_0x35573c(0x340)]['outline']=_0x3caf28[_0x35573c(0x329)],this['coneEntity'][_0x35573c(0x328)]=this[_0x35573c(0x2eb)],this['coneEntity']['_pitchRadians']=this['_pitch_reality'],this['coneEntity']['_rollRadians']=this['_roll_reality'];else{const _0x430293=new SatelliteSensor({'position':new Cesium['CallbackProperty'](_0x2d663c=>{return this['_position'];},![]),'style':{..._0x3caf28,'heading':this[_0x35573c(0x288)][_0x35573c(0x36f)][_0x35573c(0x200)]||0x0,'pitch':this[_0x35573c(0x288)]['model']['pitch']||0x0,'roll':this['options']['model']['roll']||0x0},'reverse':_0x3caf28[_0x35573c(0x18f)],'rayEllipsoid':_0x3caf28['rayEllipsoid']});this[_0x35573c(0x315)]['addGraphic'](_0x430293),this[_0x35573c(0x384)](_0x430293),this['coneEntity']=_0x430293;}}['flyToPoint'](_0x2656f3={}){var _0x3eb49e=_0x16ff71;if(!this[_0x3eb49e(0x1cf)])return;const _0x35834c=this[_0x3eb49e(0x1b9)];if(!_0x35834c)return;const _0x33e097=Cesium['Cartographic']['fromCartesian'](_0x35834c)['height']*(_0x2656f3['scale']??1.5);let _0x5e801f;if(Cesium['defined'](_0x2656f3['heading'])){var _0x28623a;_0x5e801f=_0x2656f3['heading']+Cesium['Math']['toDegrees'](((_0x28623a=this[_0x3eb49e(0x2ee)])===null||_0x28623a===void 0x0?void 0x0:_0x28623a['heading'])||0x0);}return this[_0x3eb49e(0x1cf)][_0x3eb49e(0x30f)](_0x35834c,{..._0x2656f3,'radius':_0x33e097,'heading':_0x5e801f});}['flyTo'](_0x19ea67){return this['flyToPoint'](_0x19ea67);}['startDraw'](_0x4bcf41){var _0x1e0471=_0x16ff71,_0x16f24e,_0x8fb1df,_0x39073;if(this[_0x1e0471(0x31e)])return this;this['_enabledDraw']=!![],_0x4bcf41&&this['addTo'](_0x4bcf41),this['fire'](mars3d__namespace['EventType'][_0x1e0471(0x2fc)],{'drawtype':this[_0x1e0471(0x1e3)],'positions':this['_positions_draw']},!![]),(_0x16f24e=this['options'])!==null&&_0x16f24e!==void 0x0&&_0x16f24e[_0x1e0471(0x346)]&&this['options']['success'](this),(_0x8fb1df=this['options'])!==null&&_0x8fb1df!==void 0x0&&(_0x39073=_0x8fb1df[_0x1e0471(0x1a0)])!==null&&_0x39073!==void 0x0&&_0x39073[_0x1e0471(0x303)]&&this['options']['_promise']['resolve'](this);}}mars3d__namespace['graphic']['Satellite']=Satellite,mars3d__namespace['GraphicUtil'][_0x16ff71(0x18e)]('satellite',Satellite),exports['CamberRadar']=CamberRadar,exports['ConicSensor']=ConicSensor,exports[_0x16ff71(0x343)]=RectSensor,exports['Satellite']=Satellite,exports['SatelliteSensor']=SatelliteSensor,exports[_0x16ff71(0x225)]=SpaceUtil,exports['Tle']=Tle,Object['defineProperty'](exports,_0x16ff71(0x14e),{'value':!![]}); })); diff --git a/public/lib/mars3d/plugins/tdt/mars3d-tdt.js b/public/lib/mars3d/plugins/tdt/mars3d-tdt.js index 6dba181d..4b7174ca 100644 --- a/public/lib/mars3d/plugins/tdt/mars3d-tdt.js +++ b/public/lib/mars3d/plugins/tdt/mars3d-tdt.js @@ -9,4 +9,4 @@ * @license long.js (c) 2013 Daniel Wirtz * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details - */;void 0===(n="function"==typeof(r=function(){function e(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var i={},r={};function n(e,t){var n,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=r[e])?o:(n=a(e,(0|e)<0?-1:0,!0),s&&(r[e]=n),n):(s=-128<=(e|=0)&&e<128)&&(o=i[e])?o:(n=a(e,e<0?-1:0,!1),s&&(i[e]=n),n)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?g:d;if(t){if(e<0)return g;if(e>=u)return C}else{if(e<=-h)return y;if(e+1>=h)return v}return e<0?o(-e,t).neg():a(e%c|0,e/c|0,t)}function a(t,i,r){return new e(t,i,r)}e.fromInt=n,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function x(e,t,i){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d;if("number"==typeof t?(i=t,t=!1):t=!!t,(i=i||10)<2||360)throw Error("interior hyphen");if(0===r)return x(e.substring(1),t,i).neg();for(var n=o(s(i,8)),a=d,l=0;l>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=l).isZero())return c+x;for(;c.length<6;)c="0"+c;x=""+c+x}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var i=this.isNegative(),r=e.isNegative();return i&&!r?-1:!i&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(p)},_.neg=_.negate,_.add=function(e){t(e)||(e=l(e));var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,x=65535&e.high,c=e.low>>>16,u=0,h=0,f=0,d=0;return f+=(d+=o+(65535&e.low))>>>16,h+=(f+=n+c)>>>16,u+=(h+=r+x)>>>16,u+=i+s,a((f&=65535)<<16|(d&=65535),(u&=65535)<<16|(h&=65535),this.unsigned)},_.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return d;if(t(e)||(e=l(e)),e.isZero())return d;if(this.eq(y))return e.isOdd()?y:d;if(e.eq(y))return this.isOdd()?y:d;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,x=e.high>>>16,c=65535&e.high,u=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,b=0;return m+=(b+=s*h)>>>16,p+=(m+=n*h)>>>16,m&=65535,p+=(m+=s*u)>>>16,g+=(p+=r*h)>>>16,p&=65535,g+=(p+=n*u)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=i*h+r*u+n*c+s*x,a((m&=65535)<<16|(b&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:d;var i,r,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;n=g}else{if(this.eq(y))return e.eq(p)||e.eq(b)?y:e.eq(y)?p:(i=this.shr(1).div(e).shl(1)).eq(d)?e.isNegative()?p:b:(r=this.sub(e.mul(i)),n=i.add(r.div(e)));if(e.eq(y))return this.unsigned?g:d;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=d}for(r=this;r.gte(e);){i=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),x=a<=48?1:s(2,a-48),c=o(i),u=c.mul(e);u.isNegative()||u.gt(r);)u=(c=o(i-=x,this.unsigned)).mul(e);c.isZero()&&(c=p),n=n.add(c),r=r.sub(u)}return n},_.div=_.divide,_.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return a(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=l(e)),a(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low<>>32-e,this.unsigned):a(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var i=this.high;return e<32?a(this.low>>>e|i<<32-e,i>>>e,this.unsigned):a(32===e?i:i>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?r.apply(t,[]):r)||(e.exports=n)},function(e,t){},function(e,t,i){i(194);var r=i(5).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,i){var r=i(12);r(r.S+r.F*!i(25),"Object",{defineProperties:i(109)})},function(e,t,i){i(34)("Uint8",1,(function(e){return function(t,i,r){return e(this,t,i,r)}}),!0)},function(e,t,i){var r=i(10),n=i(11),o=i(35),a=i(123),s=i(20),x=i(124),l=i(18),c=i(125),u=i(29),h=i(19),f=i(126),d=i(41).f,g=i(13).f,p=i(92),m=i(55),b=r.ArrayBuffer,v=r.DataView,C=r.Math,y=r.RangeError,_=r.Infinity,A=b,I=C.abs,w=C.pow,G=C.floor,E=C.log,S=C.LN2,T=n?"_b":"buffer",P=n?"_l":"byteLength",M=n?"_o":"byteOffset";function N(e,t,i){var r,n,o,a=new Array(i),s=8*i-t-1,x=(1<>1,c=23===t?w(2,-24)-w(2,-77):0,u=0,h=e<0||0===e&&1/e<0?1:0;for((e=I(e))!==e||e===_?(n=e!=e?1:0,r=x):(r=G(E(e)/S),e*(o=w(2,-r))<1&&(r--,o*=2),(e+=r+l>=1?c/o:c*w(2,1-l))*o>=2&&(r++,o/=2),r+l>=x?(n=0,r=x):r+l>=1?(n=(e*o-1)*w(2,t),r+=l):(n=e*w(2,l-1)*w(2,t),r=0));t>=8;a[u++]=255&n,n/=256,t-=8);for(r=r<0;a[u++]=255&r,r/=256,s-=8);return a[--u]|=128*h,a}function L(e,t,i){var r,n=8*i-t-1,o=(1<>1,s=n-7,x=i-1,l=e[x--],c=127&l;for(l>>=7;s>0;c=256*c+e[x],x--,s-=8);for(r=c&(1<<-s)-1,c>>=-s,s+=t;s>0;r=256*r+e[x],x--,s-=8);if(0===c)c=1-a;else{if(c===o)return r?NaN:l?-_:_;r+=w(2,t),c-=a}return(l?-1:1)*r*w(2,c-t)}function R(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function O(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function D(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function k(e){return N(e,52,8)}function U(e){return N(e,23,4)}function B(e,t,i){g(e.prototype,t,{get:function(){return this[i]}})}function W(e,t,i,r){var n=f(+i);if(n+t>e[P])throw y("Wrong index!");var o=e[T]._b,a=n+e[M],s=o.slice(a,a+t);return r?s:s.reverse()}function V(e,t,i,r,n,o){var a=f(+i);if(a+t>e[P])throw y("Wrong index!");for(var s=e[T]._b,x=a+e[M],l=r(+n),c=0;cq;)(j=H[q++])in b||s(b,j,A[j]);o||(z.constructor=b)}var X=new v(new b(2)),Y=v.prototype.setInt8;X.setInt8(0,2147483648),X.setInt8(1,2147483649),!X.getInt8(0)&&X.getInt8(1)||x(v.prototype,{setInt8:function(e,t){Y.call(this,e,t<<24>>24)},setUint8:function(e,t){Y.call(this,e,t<<24>>24)}},!0)}else b=function(e){c(this,b,"ArrayBuffer");var t=f(e);this._b=p.call(new Array(t),0),this[P]=t},v=function(e,t,i){c(this,v,"DataView"),c(e,b,"DataView");var r=e[P],n=u(t);if(n<0||n>r)throw y("Wrong offset!");if(n+(i=void 0===i?r-n:h(i))>r)throw y("Wrong length!");this[T]=e,this[M]=n,this[P]=i},n&&(B(b,"byteLength","_l"),B(v,"buffer","_b"),B(v,"byteLength","_l"),B(v,"byteOffset","_o")),x(v.prototype,{getInt8:function(e){return W(this,1,e)[0]<<24>>24},getUint8:function(e){return W(this,1,e)[0]},getInt16:function(e){var t=W(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=W(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return R(W(this,4,e,arguments[1]))},getUint32:function(e){return R(W(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return L(W(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return L(W(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){V(this,1,e,O,t)},setUint8:function(e,t){V(this,1,e,O,t)},setInt16:function(e,t){V(this,2,e,F,t,arguments[2])},setUint16:function(e,t){V(this,2,e,F,t,arguments[2])},setInt32:function(e,t){V(this,4,e,D,t,arguments[2])},setUint32:function(e,t){V(this,4,e,D,t,arguments[2])},setFloat32:function(e,t){V(this,4,e,U,t,arguments[2])},setFloat64:function(e,t){V(this,8,e,k,t,arguments[2])}});m(b,"ArrayBuffer"),m(v,"DataView"),s(v.prototype,a.VIEW,!0),t.ArrayBuffer=b,t.DataView=v},function(e,t,i){var r=i(36),n=i(4)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[n]===e)}},function(e,t,i){var r=i(63),n=i(4)("iterator"),o=i(36);e.exports=i(43).getIteratorMethod=function(e){if(null!==e)return e[n]||e["@@iterator"]||o[r(e)]}},function(e,t,i){var r=i(51),n=i(100),o=i(30),a=i(19),s=i(200);e.exports=function(e,t){var i=1===e,x=2===e,l=3===e,c=4===e,u=6===e,h=5===e||u,f=t||s;return function(t,s,d){for(var g,p,m=o(t),b=n(m),v=r(s,d,3),C=a(b.length),y=0,_=i?f(t,C):x?f(t,0):void 0;C>y;y++)if((h||y in b)&&(p=v(g=b[y],y,m),e))if(i)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return g;case 6:return y;case 2:_.push(g)}else if(c)return!1;return u?-1:l||c?c:_}}},function(e,t,i){var r=i(201);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,i){var r=i(21),n=i(127),o=i(4)("species");e.exports=function(e){var t;return n(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!n(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,i){var r=i(4)("iterator"),n=!1;try{var o=[7][r]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:i=!0}},o[r]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){var r=i(30),n=i(54),o=i(19);e.exports=[].copyWithin||function(e,t){var i=r(this),a=o(i.length),s=n(e,a),x=n(t,a),l=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===l?a:n(l,a))-x,a-s),u=1;for(x0;)x in i?i[s]=i[x]:delete i[s],s+=u,x+=u;return i}},function(e,t,i){i(34)("Uint32",4,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Float64",8,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Uint8",1,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Int16",2,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){var r=i(23);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,i){i(210),e.exports=i(5).Date.now},function(e,t,i){var r=i(12);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,i){i(34)("Uint16",2,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){var r=i(23);r(r.P,"Array",{fill:i(92)}),i(97)("fill")},function(e,t,i){i(34)("Float32",4,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(119),i(113),i(116),i(215),i(227),i(228),e.exports=i(5).Promise},function(e,t,i){var r,n,o,a,s=i(48),x=i(7),l=i(59),c=i(133),u=i(12),h=i(33),f=i(60),d=i(216),g=i(217),p=i(134),m=i(135).set,b=i(222)(),v=i(94),C=i(136),y=i(223),_=i(137),A=x.TypeError,I=x.process,w=I&&I.versions,G=w&&w.v8||"",E=x.Promise,S="process"===c(I),T=function(){},P=n=v.f,M=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[i(14)("species")]=function(e){e(T,T)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==G.indexOf("6.6")&&-1===y.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},L=function(e,t){if(!e._n){e._n=!0;var i=e._c;b((function(){for(var r=e._v,n=1===e._s,o=0,a=function(t){var i,o,a,s=n?t.ok:t.fail,x=t.resolve,l=t.reject,c=t.domain;try{s?(n||(2===e._h&&F(e),e._h=1),!0===s?i=r:(c&&c.enter(),i=s(r),c&&(c.exit(),a=!0)),i===t.promise?l(A("Promise-chain cycle")):(o=N(i))?o.call(i,x,l):x(i)):l(r)}catch(e){c&&!a&&c.exit(),l(e)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&R(e)}))}},R=function(e){m.call(x,(function(){var t,i,r,n=e._v,o=O(e);if(o&&(t=C((function(){S?I.emit("unhandledRejection",n,e):(i=x.onunhandledrejection)?i({promise:e,reason:n}):(r=x.console)&&r.error&&r.error("Unhandled promise rejection",n)})),e._h=S||O(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},O=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){m.call(x,(function(){var t;S?I.emit("rejectionHandled",e):(t=x.onrejectionhandled)&&t({promise:e,reason:e._v})}))},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),L(t,!0))},k=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw A("Promise can't be resolved itself");(t=N(e))?b((function(){var r={_w:i,_d:!1};try{t.call(e,l(k,r,1),l(D,r,1))}catch(e){D.call(r,e)}})):(i._v=e,i._s=1,L(i,!1))}catch(e){D.call({_w:i,_d:!1},e)}}};M||(E=function(e){d(this,E,"Promise","_h"),f(e),r.call(this);try{e(l(k,this,1),l(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(224)(E.prototype,{then:function(e,t){var i=P(p(this,E));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=S?I.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&L(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(k,e,1),this.reject=l(D,e,1)},v.f=P=function(e){return e===E||e===a?new o(e):n(e)}),u(u.G+u.W+u.F*!M,{Promise:E}),i(66)(E,"Promise"),i(225)("Promise"),a=i(5).Promise,u(u.S+u.F*!M,"Promise",{reject:function(e){var t=P(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(s||!M),"Promise",{resolve:function(e){return _(s&&this===a?E:this,e)}}),u(u.S+u.F*!(M&&i(226)((function(e){E.all(e).catch(T)}))),"Promise",{all:function(e){var t=this,i=P(t),r=i.resolve,n=i.reject,o=C((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,x=!1;i.push(void 0),a++,t.resolve(e).then((function(e){x||(x=!0,i[s]=e,--a||r(i))}),n)})),--a||r(i)}));return o.e&&n(o.v),i.promise},race:function(e){var t=this,i=P(t),r=i.reject,n=C((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,r)}))}));return n.e&&r(n.v),i.promise}})},function(e,t){e.exports=function(e,t,i,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var r=i(59),n=i(218),o=i(219),a=i(27),s=i(106),x=i(220),l={},c={};(t=e.exports=function(e,t,i,u,h){var f,d,g,p,m=h?function(){return e}:x(e),b=r(i,u,t?2:1),v=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(f=s(e.length);f>v;v++)if((p=t?b(a(d=e[v])[0],d[1]):b(e[v]))===l||p===c)return p}else for(g=m.call(e);!(d=g.next()).done;)if((p=n(g,b,d.value,t))===l||p===c)return p}).BREAK=l,t.RETURN=c},function(e,t,i){var r=i(27);e.exports=function(e,t,i,n){try{return n?t(r(i)[0],i[1]):t(i)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,i){var r=i(49),n=i(14)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[n]===e)}},function(e,t,i){var r=i(133),n=i(14)("iterator"),o=i(49);e.exports=i(5).getIteratorMethod=function(e){if(null!==e)return e[n]||e["@@iterator"]||o[r(e)]}},function(e,t){e.exports=function(e,t,i){var r=void 0===i;switch(t.length){case 0:return r?e():e.call(i);case 1:return r?e(t[0]):e.call(i,t[0]);case 2:return r?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var r=i(7),n=i(135).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,x="process"===i(47)(a);e.exports=function(){var e,t,i,l=function(){var r,n;for(x&&(r=a.domain)&&r.exit();e;){n=e.fn,e=e.next;try{n()}catch(r){throw e?i():t=void 0,r}}t=void 0,r&&r.enter()};if(x)i=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);i=function(){c.then(l)}}else i=function(){n.call(r,l)};else{var u=!0,h=document.createTextNode("");new o(l).observe(h,{characterData:!0}),i=function(){h.data=u=!u}}return function(r){var n={fn:r,next:void 0};t&&(t.next=n),e||(e=n,i()),t=n}}},function(e,t,i){var r=i(7).navigator;e.exports=r&&r.userAgent||""},function(e,t,i){var r=i(32);e.exports=function(e,t,i){for(var n in t)i&&e[n]?e[n]=t[n]:r(e,n,t[n]);return e}},function(e,t,i){var r=i(7),n=i(5),o=i(26),a=i(25),s=i(14)("species");e.exports=function(e){var t="function"==typeof n[e]?n[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,i){var r=i(14)("iterator"),n=!1;try{var o=[7][r]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:i=!0}},o[r]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){var r=i(12),n=i(5),o=i(7),a=i(134),s=i(137);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,n.Promise||o.Promise),i="function"==typeof e;return this.then(i?function(i){return s(t,e()).then((function(){return i}))}:e,i?function(i){return s(t,e()).then((function(){throw i}))}:e)}})},function(e,t,i){var r=i(12),n=i(94),o=i(136);r(r.S,"Promise",{try:function(e){var t=n.f(this),i=o(e);return(i.e?t.reject:t.resolve)(i.v),t.promise}})},function(e,t,i){i(138)("asyncIterator")},function(e,t,i){var r=i(10),n=i(24),o=i(11),a=i(23),s=i(22),x=i(231).KEY,l=i(18),c=i(50),u=i(55),h=i(28),f=i(4),d=i(139),g=i(138),p=i(232),m=i(127),b=i(17),v=i(21),C=i(30),y=i(37),_=i(44),A=i(45),I=i(52),w=i(233),G=i(67),E=i(140),S=i(13),T=i(53),P=G.f,M=S.f,N=w.f,L=r.Symbol,R=r.JSON,O=R&&R.stringify,F=f("_hidden"),D=f("toPrimitive"),k={}.propertyIsEnumerable,U=c("symbol-registry"),B=c("symbols"),W=c("op-symbols"),V=Object.prototype,j="function"==typeof L&&!!E.f,z=r.QObject,H=!z||!z.prototype||!z.prototype.findChild,q=o&&l((function(){return 7!=I(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a}))?function(e,t,i){var r=P(V,t);r&&delete V[t],M(e,t,i),r&&e!==V&&M(V,t,r)}:M,X=function(e){var t=B[e]=I(L.prototype);return t._k=e,t},Y=j&&"symbol"==typeof L.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof L},K=function(e,t,i){return e===V&&K(W,t,i),b(e),t=_(t,!0),b(i),n(B,t)?(i.enumerable?(n(e,F)&&e[F][t]&&(e[F][t]=!1),i=I(i,{enumerable:A(0,!1)})):(n(e,F)||M(e,F,A(1,{})),e[F][t]=!0),q(e,t,i)):M(e,t,i)},Q=function(e,t){b(e);for(var i,r=p(t=y(t)),n=0,o=r.length;o>n;)K(e,i=r[n++],t[i]);return e},Z=function(e){var t=k.call(this,e=_(e,!0));return!(this===V&&n(B,e)&&!n(W,e))&&(!(t||!n(this,e)||!n(B,e)||n(this,F)&&this[F][e])||t)},J=function(e,t){if(e=y(e),t=_(t,!0),e!==V||!n(B,t)||n(W,t)){var i=P(e,t);return!i||!n(B,t)||n(e,F)&&e[F][t]||(i.enumerable=!0),i}},$=function(e){for(var t,i=N(y(e)),r=[],o=0;i.length>o;)n(B,t=i[o++])||t===F||t===x||r.push(t);return r},ee=function(e){for(var t,i=e===V,r=N(i?W:y(e)),o=[],a=0;r.length>a;)!n(B,t=r[a++])||i&&!n(V,t)||o.push(B[t]);return o};j||(s((L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(i){this===V&&t.call(W,i),n(this,F)&&n(this[F],e)&&(this[F][e]=!1),q(this,e,A(1,i))};return o&&H&&q(V,e,{configurable:!0,set:t}),X(e)}).prototype,"toString",(function(){return this._k})),G.f=J,S.f=K,i(41).f=w.f=$,i(93).f=Z,E.f=ee,o&&!i(35)&&s(V,"propertyIsEnumerable",Z,!0),d.f=function(e){return X(f(e))}),a(a.G+a.W+a.F*!j,{Symbol:L});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ie=0;te.length>ie;)f(te[ie++]);for(var re=T(f.store),ne=0;re.length>ne;)g(re[ne++]);a(a.S+a.F*!j,"Symbol",{for:function(e){return n(U,e+="")?U[e]:U[e]=L(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!j,"Object",{create:function(e,t){return void 0===t?I(e):Q(I(e),t)},defineProperty:K,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:ee});var oe=l((function(){E.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return E.f(C(e))}}),R&&a(a.S+a.F*(!j||l((function(){var e=L();return"[null]"!==O([e])||"{}"!=O({a:e})||"{}"!==O(Object(e))}))),"JSON",{stringify:function(e){for(var t,i,r=[e],n=1;arguments.length>n;)r.push(arguments[n++]);if(i=t=r[1],(v(t)||void 0!==e)&&!Y(e))return m(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!Y(t))return t}),r[1]=t,O.apply(R,r)}}),L.prototype[D]||i(20)(L.prototype,D,L.prototype.valueOf),u(L,"Symbol"),u(Math,"Math",!0),u(r.JSON,"JSON",!0)},function(e,t,i){var r=i(28)("meta"),n=i(21),o=i(24),a=i(13).f,s=0,x=Object.isExtensible||function(){return!0},l=!i(18)((function(){return x(Object.preventExtensions({}))})),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},u=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!n(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!x(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!x(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&u.NEED&&x(e)&&!o(e,r)&&c(e),e}}},function(e,t,i){var r=i(53),n=i(140),o=i(93);e.exports=function(e){var t=r(e),i=n.f;if(i)for(var a,s=i(e),x=o.f,l=0;s.length>l;)x.call(e,a=s[l++])&&t.push(a);return t}},function(e,t,i){var r=i(37),n=i(41).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"===o.call(e)?function(e){try{return n(e)}catch(e){return a.slice()}}(e):n(r(e))}},function(e,t,i){var r=i(21),n=i(17),o=function(e,t){if(n(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=i(51)(Function.call,i(67).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return o(e,i),t?e.__proto__=i:r(e,i),e}}({},!1):void 0),check:o}},function(e,t,i){var r=i(23),n=i(38),o=i(18),a=i(236),s="["+a+"]",x=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),c=function(e,t,i){var n={},s=o((function(){return!!a[e]()||"​…"!=="​…"[e]()})),x=n[e]=s?t(u):a[e];i&&(n[i]=x),r(r.P+r.F*s,"String",n)},u=c.trim=function(e,t){return e=String(n(e)),1&t&&(e=e.replace(x,"")),2&t&&(e=e.replace(l,"")),e};e.exports=c},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(module,__webpack_exports__,__webpack_require__){(function(module,global){var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(69);__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__);var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(42);__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__);var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(15),_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(84);__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_3__);var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8),_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es6_string_ends_with__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(129);__webpack_require__.n(core_js_modules_es6_string_ends_with__WEBPACK_IMPORTED_MODULE_5__);var core_js_modules_es6_string_starts_with__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(132);__webpack_require__.n(core_js_modules_es6_string_starts_with__WEBPACK_IMPORTED_MODULE_6__);var _babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1),_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(141);__webpack_require__.n(core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_8__);var core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(239);__webpack_require__.n(core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_9__);var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(88);__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_10__);var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(0),_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11__),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(2),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(85);__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_13__);var core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(86);__webpack_require__.n(core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_14__);var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(79);__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_15__);var core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(241);__webpack_require__.n(core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_16__);var core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(143),require,require,e;__webpack_require__.n(core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_17__),window.GeoGlobe=window.GeoGlobe||{},window.GeoGlobe.Class=window.GeoGlobe.Class||{},window.GeoGlobe.LngLatBounds=window.GeoGlobe.LngLatBounds||{},window.GeoGlobe.LngLat=window.GeoGlobe.LngLat||{},window.GeoGlobe.Filter=window.GeoGlobe.Filter||{},window.GeoGlobe.Format=window.GeoGlobe.Format||{},window.GeoGlobe.Protocol=window.GeoGlobe.Protocol||{},window.GeoGlobe.Query=window.GeoGlobe.Query||{},window.GeoGlobe.Service=window.GeoGlobe.Service||{},window.GeoGlobe.Analysis=window.GeoGlobe.Analysis||{},GeoGlobe.getScriptLocation=function(e){for(var t="",i=new RegExp("(^|(.*?\\/))("+e+")(\\?|$)"),r=document.getElementsByTagName("script"),n=0,o=r.length;n1?[r,t].concat(Array.prototype.slice.call(arguments).slice(1,e-1),i):r.prototype=i,r},GeoGlobe.Class4OL=function(){var e=arguments.length,t=arguments[0],i=arguments[e-1],r="function"==typeof i.initialize?i.initialize:function(){t.prototype.initialize.apply(this,arguments)};if(e>1){var n=[r,t].concat(Array.prototype.slice.call(arguments).slice(1,e-1),i);GeoGlobe.inherit.apply(null,n)}else r.prototype=i;return r},GeoGlobe.inherit=function(e,t){var i,r,n,o=function(){};for(o.prototype=t.prototype,e.prototype=new o,i=2,r=arguments.length;i=0;i--)e[i]===t&&e.splice(i,1);return e},GeoGlobe.Util.indexOf=function(e,t){if("function"==typeof e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i=5.5&&t<7}return GeoGlobe.Util.alphaHackNeeded},GeoGlobe.Util.upperCaseObject=function(e){var t={};for(var i in e)t[i.toUpperCase()]=e[i];return t},GeoGlobe.Util.applyDefaults=function(e,t){e=e||{};var i="function"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!i&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},GeoGlobe.Util.getParameterString=function(e){var t=[];for(var i in e){var r=e[i];if(null!==r&&"function"!=typeof r){var n;if("object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(r)&&r.constructor===Array){for(var o,a=[],s=0,x=r.length;s1e-12&&--g>0;){var p=Math.sin(f),m=Math.cos(f),b=Math.sqrt(h*p*(h*p)+(c*u-l*h*m)*(c*u-l*h*m));if(0===b)return 0;var v=l*u+c*h*m,C=Math.atan2(b,v),y=Math.asin(c*h*p/b),_=Math.cos(y)*Math.cos(y),A=v-2*l*u/_,I=o/16*_*(4+o*(4-3*_));d=f,f=a+(1-I)*o*Math.sin(y)*(C+I*b*(A+I*v*(2*A*A-1)))}if(0===g)return NaN;var w=_*(r*r-n*n)/(n*n),G=w/1024*(256+w*(w*(74-47*w)-128));return(n*(1+w/16384*(4096+w*(w*(320-175*w)-768)))*(C-G*b*(A+G/4*(v*(2*A*A-1)-G/6*A*(4*b*b-3)*(4*A*A-3))))).toFixed(3)/1e3},GeoGlobe.Util.destinationVincenty=function(e,t,i){for(var r=GeoGlobe.Util,n=r.VincentyConstants,o=n.a,a=n.b,s=n.f,x=e.lng,l=e.lat,c=i,u=r.rad(t),h=Math.sin(u),f=Math.cos(u),d=(1-s)*Math.tan(r.rad(l)),g=1/Math.sqrt(1+d*d),p=d*g,m=Math.atan2(d,f),b=g*h,v=1-b*b,C=v*(o*o-a*a)/(a*a),y=1+C/16384*(4096+C*(C*(320-175*C)-768)),_=C/1024*(256+C*(C*(74-47*C)-128)),A=c/(a*y),I=2*Math.PI;Math.abs(A-I)>1e-12;){var w=Math.cos(2*m+A),G=Math.sin(A),E=Math.cos(A);I=A,A=c/(a*y)+_*G*(w+_/4*(E*(2*w*w-1)-_/6*w*(4*G*G-3)*(4*w*w-3)))}var S=p*G-g*E*f,T=Math.atan2(p*E+g*G*f,(1-s)*Math.sqrt(b*b+S*S)),P=s/16*v*(4+s*(4-3*v)),M=Math.atan2(G*h,g*E-p*G*f)-(1-P)*s*b*(A+P*G*(w+P*E*(2*w*w-1)));return new GeoGlobe.LngLat(x+r.deg(M),r.deg(T))},GeoGlobe.Util.getParameters=function(e,t){t=t||{},e=null===e?window.location.href:e;var i="";if(GeoGlobe.String.contains(e,"?")){var r=e.indexOf("?")+1,n=GeoGlobe.String.contains(e,"#")?e.indexOf("#"):e.length;i=e.substring(r,n)}for(var o={},a=i.split(/[&;]/),s=0,x=a.length;s1?1/e:e},GeoGlobe.Util.getResolutionFromScale=function(e,t){var i;return e&&(null===t&&(t="degrees"),i=1/(GeoGlobe.Util.normalizeScale(e)*GeoGlobe.INCHES_PER_UNIT[t]*GeoGlobe.DOTS_PER_INCH)),i},GeoGlobe.Util.getScaleFromResolution=function(e,t){return null===t&&(t="degrees"),e*GeoGlobe.INCHES_PER_UNIT[t]*GeoGlobe.DOTS_PER_INCH},GeoGlobe.Util.pagePosition=function(e){var t=[0,0],i=GeoGlobe.Util.getViewportElement();if(!e||e===window||e===i)return t;var r,n=GeoGlobe.IS_GECKO&&document.getBoxObjectFor&&"absolute"===GeoGlobe.Element.getStyle(e,"position")&&(""===e.style.top||""===e.style.left),o=null;if(e.getBoundingClientRect){r=e.getBoundingClientRect();var a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;t[0]=r.left+s,t[1]=r.top+a}else if(document.getBoxObjectFor&&!n){r=document.getBoxObjectFor(e);var x=document.getBoxObjectFor(i);t[0]=r.screenX-x.screenX,t[1]=r.screenY-x.screenY}else{if(t[0]=e.offsetLeft,t[1]=e.offsetTop,(o=e.offsetParent)!==e)for(;o;)t[0]+=o.offsetLeft,t[1]+=o.offsetTop,o=o.offsetParent;var l=GeoGlobe.BROWSER_NAME;for(("opera"===l||"safari"===l&&"absolute"===GeoGlobe.Element.getStyle(e,"position"))&&(t[1]-=document.body.offsetTop),o=e.offsetParent;o&&o!==document.body;)t[0]-=o.scrollLeft,"opera"===l&&"TR"===o.tagName||(t[1]-=o.scrollTop),o=o.offsetParent}return t},GeoGlobe.Util.getViewportElement=function(){var e=arguments.callee.viewportElement;return null===e&&(e="msie"===GeoGlobe.BROWSER_NAME&&"CSS1Compat"!==document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=e),e},GeoGlobe.Util.isEquivalentUrl=function(e,t,i){i=i||{},GeoGlobe.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1});var r=GeoGlobe.Util.createUrlObject(e,i),n=GeoGlobe.Util.createUrlObject(t,i);for(var o in r)if("args"!==o&&r[o]!==n[o])return!1;for(var o in r.args){if(r.args[o]!==n.args[o])return!1;delete n.args[o]}for(var o in n.args)return!1;return!0},GeoGlobe.Util.createUrlObject=function(e,t){if(t=t||{},!/^\w+:\/\//.test(e)){var i=window.location,r=i.port?":"+i.port:"",n=i.protocol+"//"+i.host.split(":").shift()+r;if(0===e.indexOf("/"))e=n+e;else{var o=i.pathname.split("/");o.pop(),e=n+o.join("/")+"/"+e}}t.ignoreCase&&(e=e.toLowerCase());var a=document.createElement("a");a.href=e;var s={};s.host=a.host.split(":").shift(),s.protocol=a.protocol,t.ignorePort80?s.port="80"===a.port||"0"===a.port?"":a.port:s.port=""===a.port||"0"===a.port?"80":a.port,s.hash=t.ignoreHash||"#"===a.hash?"":a.hash;var x=a.search;if(!x){var l=e.indexOf("?");x=-1!==l?e.substr(l):""}return s.args=GeoGlobe.Util.getParameters(x,{splitArgs:t.splitArgs}),s.pathname="/"===a.pathname.charAt(0)?a.pathname:"/"+a.pathname,s},GeoGlobe.Util.removeTail=function(e){var t=e.indexOf("?"),i=e.indexOf("#");return-1===t?-1!==i?e.substr(0,i):e:-1!==i?e.substr(0,Math.min(t,i)):e.substr(0,t)},GeoGlobe.IS_GECKO=(e=navigator.userAgent.toLowerCase(),-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")),GeoGlobe.CANVAS_SUPPORTED=function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),GeoGlobe.BROWSER_NAME=function(){var e="",t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("opera")?e="opera":-1!==t.indexOf("msie")?e="msie":-1!==t.indexOf("safari")?e="safari":-1!==t.indexOf("mozilla")&&(e=-1!==t.indexOf("firefox")?"firefox":"mozilla"),e}(),GeoGlobe.Util.getBrowserName=function(){return GeoGlobe.BROWSER_NAME},GeoGlobe.Util.getScrollbarWidth=function(){var e=GeoGlobe.Util._scrollbarWidth;if(null===e){var t,i,r=null,n=null;(r=document.createElement("div")).style.position="absolute",r.style.top="-1000px",r.style.left="-1000px",r.style.width="100px",r.style.height="50px",r.style.overflow="hidden",(n=document.createElement("div")).style.width="100%",n.style.height="200px",r.appendChild(n),document.body.appendChild(r),t=n.offsetWidth,r.style.overflow="scroll",i=n.offsetWidth,document.body.removeChild(document.body.lastChild),GeoGlobe.Util._scrollbarWidth=t-i,e=GeoGlobe.Util._scrollbarWidth}return e},GeoGlobe.Util.randomStr=function(e){for(var t="",i=[],r=0;rn);i++)n=r;return Math.max(0,i-1)},GeoGlobe.Util.getMapLevelFormScale=function(e,t,i,r){i=i||"degrees",r=r||96;var n=GeoGlobe.Util.getResolutionFromScale_DPI(t,i,r);return GeoGlobe.Util.getMapLevelFormResolution(e,n)},GeoGlobe.Util.delayFun=function(e,t,i){var r;return function(){var n=this,o=arguments,a=i&&!r;clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(n,o)}),t),a&&e.apply(n,o)}},GeoGlobe.Util.clone=function(e){if("object"!==_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(e))return e;if(null===e)return e;var t=e.constructor===Array?[]:{};for(var i in e)t[i]=GeoGlobe.Util.clone(e[i]);return t},GeoGlobe.Util.getType=function(e){var t=Object.prototype.toString;return e instanceof Element?"element":{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[t.call(e)]},GeoGlobe.Util.formatNumberToThousands=function(e,t,i){e=e.toString().replace(/\$|\,/g,""),isNaN(e)&&(e="0");var r=e===(e=Math.abs(e)),n=(e=Math.floor(e*Math.pow(10,t)+.50000000001))%Math.pow(10,t);for(e=Math.floor(e/Math.pow(10,t)).toString(),n=n.toString();n.length0?(r?"":"-")+e+"."+n:(r?"":"-")+e},GeoGlobe.Util.getFormattedString=function(e,t){var i=t;if((i=(i=i.replace(/{a}/g,e.a)).replace(/{b}/g,e.b)).contains("{c"))for(var r=i.split("{c"),n=0,o=0;o>16)+r,o=(i>>8&255)+r,a=(255&i)+r;return"#"+(16777216+65536*(n<255?n<1?0:n:255)+256*(o<255?o<1?0:o:255)+(a<255?a<1?0:a:255)).toString(16).slice(1)},GeoGlobe.Util.getHexColor=function(e){if(e=e.toLowerCase(),/^(rgb|rgba)/.test(e)){for(var t=e.split("(")[1].split(")")[0].split(","),i="#",r=0;r<3;r++){var n=Number(t[r]).toString(16);"0"===n&&(n+=n),1===n.length&&(n="0"+n),i+=n}return 7!==i.length&&(i=e),i}if(!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e))return e;var o=e.replace(/#/,"").split("");if(6===o.length)return e;if(3===o.length){var a="#";for(r=0;r=0;--n)r(o[n],a);for(n=a.length-1;n>=0;--n)r(a[n],o)}(),GeoGlobe.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(e){alert(e)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"GeoGlobe.Console"},function(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t=0?t+e:t+encodeURIComponent(e)),e},issue:function(e){var t=GeoGlobe.Util.extend(this.DEFAULT_CONFIG,{proxy:GeoGlobe.ProxyHost});(e=e||{}).headers=e.headers||{},(e=GeoGlobe.Util.applyDefaults(e,t)).headers=GeoGlobe.Util.applyDefaults(e.headers,t.headers);var i,r=!1;for(i in e.headers)e.headers.hasOwnProperty(i)&&"x-requested-with"===i.toLowerCase()&&(r=!0);!1===r&&(e.headers["X-Requested-With"]="XMLHttpRequest");var n=new GeoGlobe.Request.XMLHttpRequest;e.url=encodeURI(e.url);var o=GeoGlobe.Util.urlAppend(e.url,GeoGlobe.Util.getParameterString(e.params||{}));for(var a in o=GeoGlobe.Request.makeSameOrigin(o,e.proxy),n.open(e.method,o,e.async,e.user,e.password),e.headers)n.setRequestHeader(a,e.headers[a]);var s=this;return n.onreadystatechange=function(){n.readyState===GeoGlobe.Request.XMLHttpRequest.DONE&&s.runCallbacks({request:n,config:e,requestUrl:o})},!1===e.async?n.send(e.data):window.setTimeout((function(){0!==n.readyState&&n.send(e.data)}),0),n},runCallbacks:function(e){var t,i,r=e.request,n=e.config,o=n.scope?GeoGlobe.Function.bind(n.callback,n.scope):n.callback;n.success&&(t=n.scope?GeoGlobe.Function.bind(n.success,n.scope):n.success),n.failure&&(i=n.scope?GeoGlobe.Function.bind(n.failure,n.scope):n.failure),"file:"===GeoGlobe.Util.createUrlObject(n.url).protocol&&r.responseText&&(r.status=200),o(r),(!r.status||r.status>=200&&r.status<300)&&t&&t(r),r.status&&(r.status<200||r.status>=300)&&i&&i(r)},GET:function(e){return e=GeoGlobe.Util.extend(e,{method:"GET"}),GeoGlobe.Request.issue(e)},POST:function(e){return(e=GeoGlobe.Util.extend(e,{method:"POST"})).headers=e.headers?e.headers:{},"CONTENT-TYPE"in GeoGlobe.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),GeoGlobe.Request.issue(e)},PUT:function(e){return(e=GeoGlobe.Util.extend(e,{method:"PUT"})).headers=e.headers?e.headers:{},"CONTENT-TYPE"in GeoGlobe.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),GeoGlobe.Request.issue(e)},DELETE:function(e){return e=GeoGlobe.Util.extend(e,{method:"DELETE"}),GeoGlobe.Request.issue(e)},HEAD:function(e){return e=GeoGlobe.Util.extend(e,{method:"HEAD"}),GeoGlobe.Request.issue(e)},OPTIONS:function(e){return e=GeoGlobe.Util.extend(e,{method:"OPTIONS"}),GeoGlobe.Request.issue(e)}}),GeoGlobe.nullHandler=function(e){GeoGlobe.Console.userError(GeoGlobe.i18n("unhandledRequest",{statusText:e.statusText}))},GeoGlobe.loadURL=function(e,t,i,r,n){"string"==typeof t&&(t=GeoGlobe.Util.getParameters(t));var o=r||GeoGlobe.nullHandler,a=n||GeoGlobe.nullHandler;return GeoGlobe.Request.GET({url:e,params:t,success:o,failure:a,scope:i})},GeoGlobe.Request.setProxyHost=function(e){GeoGlobe.ProxyHost=e},GeoGlobe.Request.getProxyHost=function(){return GeoGlobe.ProxyHost},GeoGlobe.appendToProxy=function(e){var t=e.split("?"),i=GeoGlobe.ProxyHost+encodeURI(encodeURI(t[0]));return 2===t.length&&(i+="?"+t[1]),i},GeoGlobe.loadScript=function(e){GeoGlobe.Request.GET({url:e,async:!1,headers:{Accept:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"},success:function(e){GeoGlobe.Util.globalEval(e.responseText)},failure:function(t){alert("加载:"+e+" 失败。")}})},function(){var e=window.XMLHttpRequest,t=!!window.controllers,i=window.document.all&&!window.opera,r=i&&window.navigator.userAgent.match(/MSIE 7.0/);function n(){this._object=e&&!r?new e:new window.ActiveXObject("Microsoft.XMLHTTP"),this._listeners=[]}function o(){return new n}function a(e){o.onreadystatechange&&o.onreadystatechange.apply(e),e.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function s(e){try{e.responseText=e._object.responseText}catch(e){}try{e.responseXML=(r=(t=e._object).responseXML,n=t.responseText,i&&n&&r&&!r.documentElement&&t.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&&((r=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,r.validateOnParse=!1,r.loadXML(n)),r&&(i&&0!==r.parseError||!r.documentElement||r.documentElement&&"parsererror"===r.documentElement.tagName)?null:r)}catch(e){}var t,r,n;try{e.status=e._object.status}catch(e){}try{e.statusText=e._object.statusText}catch(e){}}function x(e){e._object.onreadystatechange=new window.Function}o.prototype=n.prototype,t&&e.wrapped&&(o.wrapped=e.wrapped),o.UNSENT=0,o.OPENED=1,o.HEADERS_RECEIVED=2,o.LOADING=3,o.DONE=4,o.prototype.readyState=o.UNSENT,o.prototype.responseText="",o.prototype.responseXML=null,o.prototype.status=0,o.prototype.statusText="",o.prototype.priority="NORMAL",o.prototype.onreadystatechange=null,o.onreadystatechange=null,o.onopen=null,o.onsend=null,o.onabort=null,o.prototype.open=function(e,r,n,l,c){delete this._headers,arguments.length<3&&(n=!0),this._async=n;var u,h=this,f=this.readyState;i&&n&&(u=function(){f!==o.DONE&&(x(h),h.abort())},window.attachEvent("onunload",u)),o.onopen&&o.onopen.apply(this,arguments),arguments.length>4?this._object.open(e,r,n,l,c):arguments.length>3?this._object.open(e,r,n,l):this._object.open(e,r,n);try{this._object.responseType="msxml-document"}catch(e){}this.readyState=o.OPENED,a(this),this._object.onreadystatechange=function(){t&&!n||(h.readyState=h._object.readyState,s(h),h._aborted?h.readyState=o.UNSENT:(h.readyState===o.DONE&&(delete h._data,x(h),i&&n&&window.detachEvent("onunload",u)),f!==h.readyState&&a(h),f=h.readyState))}},o.prototype.send=function(e){o.onsend&&o.onsend.apply(this,arguments),arguments.length||(e=null),e&&e.nodeType&&(e=window.XMLSerializer?(new window.XMLSerializer).serializeToString(e):e.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")),this._data=e,function(e){if(e._object.send(e._data),t&&!e._async)for(e.readyState=o.OPENED,s(e);e.readyStateo.UNSENT&&(this._aborted=!0),this._object.abort(),x(this),this.readyState=o.UNSENT,delete this._data},o.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()},o.prototype.getResponseHeader=function(e){return this._object.getResponseHeader(e)},o.prototype.setRequestHeader=function(e,t){return this._headers||(this._headers={}),this._headers[e]=t,this._object.setRequestHeader(e,t)},o.prototype.addEventListener=function(e,t,i){for(var r,n=0;r=this._listeners[n];n++)if(r[0]===e&&r[1]===t&&r[2]===i)return;this._listeners.push([e,t,i])},o.prototype.removeEventListener=function(e,t,i){for(var r,n=0;(r=this._listeners[n])&&(r[0]!==e||r[1]!==t||r[2]!==i);n++);r&&this._listeners.splice(n,1)},o.prototype.dispatchEvent=function(e){var t={type:e.type,target:this,currentTarget:this,eventPhase:2,bubbles:e.bubbles,cancelable:e.cancelable,timeStamp:e.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};"readystatechange"===t.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[t]);for(var i,r=0;i=this._listeners[r];r++)i[0]!==t.type||i[2]||(i[1].handleEvent||i[1]).apply(this,[t])},o.prototype.toString=function(){return"[object XMLHttpRequest]"},o.toString=function(){return"[XMLHttpRequest]"},window.Function.prototype.apply||(window.Function.prototype.apply=function(e,t){t||(t=[]),e.__func=this,e.__func(t[0],t[1],t[2],t[3],t[4]),delete e.__func}),GeoGlobe.Request||(GeoGlobe.Request={}),GeoGlobe.Request.XMLHttpRequest=o}(),GeoGlobe.Lang={code:null,defaultCode:"zh-CN",getCode:function(){return GeoGlobe.Lang.code||GeoGlobe.Lang.setCode(),GeoGlobe.Lang.code},setCode:function(e){var t;e||(e="msie"===GeoGlobe.BROWSER_NAME?navigator.userLanguage:navigator.language);var i=e.split("-");if(i[0]=i[0].toLowerCase(),"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(GeoGlobe.Lang[i[0]])&&(t=i[0]),i[1]){var r=i[0]+"-"+i[1].toUpperCase();"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(GeoGlobe.Lang[r])&&(t=r)}t||(GeoGlobe.Console.warn("Failed to find GeoGlobe.Lang."+i.join("-")+" dictionary, falling back to default language"),t=GeoGlobe.Lang.defaultCode),GeoGlobe.Lang.code=t},translate:function(e,t){var i=GeoGlobe.Lang[GeoGlobe.Lang.getCode()],r=i&&i[e];return r||(r=e),t&&(r=GeoGlobe.String.format(r,t)),r}},GeoGlobe.i18n=GeoGlobe.Lang.translate,GeoGlobe.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",end:""},GeoGlobe.Lang["zh-CN"]={unhandledRequest:"未处理的请求,返回值为 ${statusText}",end:""},GeoGlobe.String={startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){return-1!==e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),i=t[0],r=1,n=t.length;r0&&(i=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.toPrecision(t))),i},format:function(e,t,i,r){t=void 0!==t?t:0,i=void 0!==i?i:GeoGlobe.Number.thousandsSeparator,r=void 0!==r?r:GeoGlobe.Number.decimalSeparator,null!==t&&(e=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.toFixed(t)));var n=e.toString().split(".");1===n.length&&null===t&&(t=0);var o,a=n[0];if(i)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+i+"$2");if(0===t)o=a;else{var x=n.length>1?n[1]:"0";null!==t&&(x+=new Array(t-x.length+1).join("0")),o=a+r+x}return o},zeroPad:function(e,t,i){for(var r=e.toString(i||10);r.lengthi.length)&&(t=i.length),t-=e.length;var r=i.lastIndexOf(e,t);return-1!==r&&r===t}),GeoGlobe.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:"toISOString"in Date.prototype?function(e){return e.toISOString()}:function(e){return isNaN(e.getTime())?"Invalid Date":e.getUTCFullYear()+"-"+GeoGlobe.Number.zeroPad(e.getUTCMonth()+1,2)+"-"+GeoGlobe.Number.zeroPad(e.getUTCDate(),2)+"T"+GeoGlobe.Number.zeroPad(e.getUTCHours(),2)+":"+GeoGlobe.Number.zeroPad(e.getUTCMinutes(),2)+":"+GeoGlobe.Number.zeroPad(e.getUTCSeconds(),2)+"."+GeoGlobe.Number.zeroPad(e.getUTCMilliseconds(),3)+"Z"},parse:function(e){var t,i=e.match(this.dateRegEx);if(i&&(i[1]||i[7])){var r=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[1],10)||0,n=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[2],10)-1||0,o=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[3],10)||1;t=new Date(Date.UTC(r,n,o));var a=i[7];if(a){var s=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[4],10),x=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[5],10),l=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(i[6]),c=0|l,u=Math.round(1e3*(l-c));if(t.setUTCHours(s,x,c,u),"Z"!==a){var h=-1e3*(60*_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(a,10)*60+60*(_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[8],10)||0));t=new Date(t.getTime()+h)}}}else t=new Date("invalid");return t}},window._GeoGlobe=function e(t,i,r){function n(a,s){if(!i[a]){if(!t[a]){if(!s&&"function"==typeof require&&require)return require(a,!0);if(o)return o(a,!0);var x=new Error("Cannot find module '"+a+"'");throw x.code="MODULE_NOT_FOUND",x}var l=i[a]={exports:{}};t[a][0].call(l.exports,(function(e){return n(t[a][1][e]||e)}),l,l.exports,e,t,i,r)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a, lat: }, or an array of [, ]")},t.exports=r},{"./lng_lat_bounds":2}],2:[function(e,t,i){var r=e("./lng_lat"),n=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};n.prototype.setNorthEast=function(e){return this._ne=e instanceof r?new r(e.lng,e.lat):r.convert(e),this},n.prototype.setSouthWest=function(e){return this._sw=e instanceof r?new r(e.lng,e.lat):r.convert(e),this},n.prototype.extend=function(e){var t,i,o=this._sw,a=this._ne;if(e instanceof r)t=e,i=e;else{if(!(e instanceof n))return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(e)?e.every(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default.a)?this.extend(n.convert(e)):this.extend(r.convert(e)):this;if(t=e._sw,i=e._ne,!t||!i)return this}return o||a?(o.lng=Math.min(t.lng,o.lng),o.lat=Math.min(t.lat,o.lat),a.lng=Math.max(i.lng,a.lng),a.lat=Math.max(i.lat,a.lat)):(this._sw=new r(t.lng,t.lat),this._ne=new r(i.lng,i.lat)),this},n.prototype.getCenter=function(){return new r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},n.prototype.getSouthWest=function(){return this._sw},n.prototype.getNorthEast=function(){return this._ne},n.prototype.getNorthWest=function(){return new r(this.getWest(),this.getNorth())},n.prototype.getSouthEast=function(){return new r(this.getEast(),this.getSouth())},n.prototype.getWest=function(){return this._sw.lng},n.prototype.getSouth=function(){return this._sw.lat},n.prototype.getEast=function(){return this._ne.lng},n.prototype.getNorth=function(){return this._ne.lat},n.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},n.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},n.convert=function(e){return!e||e instanceof n?e:new n(e)},t.exports=n},{"./lng_lat":1}],3:[function(e,t,i){var r=e("./geo/lng_lat"),n=e("./geo/lng_lat_bounds");t.exports={LngLat:r,LngLatBounds:n}},{"./geo/lng_lat":1,"./geo/lng_lat_bounds":2}]},{},[3])(3),window.GeoGlobe.Util.extend(window.GeoGlobe,window._GeoGlobe),GeoGlobe.LngLat.prototype.CLASS_NAME="GeoGlobe.LngLat",GeoGlobe.LngLatBounds.prototype.clone=function(){return new GeoGlobe.LngLatBounds(this._sw,this._ne)},GeoGlobe.LngLatBounds.prototype.contains=function(e,t,i){return null===i&&(i=!0),null!==e&&null!==t&&(e=GeoGlobe.Util.toFloat(e),t=GeoGlobe.Util.toFloat(t),i?e>=this._sw.lng&&e<=this._ne.lng&&t>=this._sw.lat&&t<=this._ne.lat:e>this._sw.lng&&ethis._sw.lat&&t=0&&g<=1&&p>=0&&p<=1)if(r){var m=e.x1+g*x,b=e.y1+g*l;o=new GeoGlobe.Geometry.Point(m,b)}else o=!0}if(n)if(o){if(r){var v,C=[e,t];e:for(var y=0;y<2;++y){v=C[y];for(var _=1;_<3;++_)if(m=v["x"+_],b=v["y"+_],Math.sqrt(Math.pow(m-o.x,2)+Math.pow(b-o.y,2))=1?(i=x,r=l):(i=a+h*c,r=s+h*u),{distance:Math.pow(i-n,2)+Math.pow(r-o,2),x:i,y:r,along:h}},GeoGlobe.Geometry.fromGeoJson=function(e){var t;if(GeoGlobe.Format&&GeoGlobe.Format.GeoJSON){format=new GeoGlobe.Format.GeoJSON;var i=null;try{i=format.parseGeometry(geojson)}catch(e){console.log(e)}t=i}return t},GeoGlobe.Geometry.Collection=GeoGlobe.Class4OL(GeoGlobe.Geometry,{components:null,componentTypes:null,initialize:function(e){GeoGlobe.Geometry.prototype.initialize.apply(this,arguments),this.components=[],null!==e&&this.addComponents(e)},destroy:function(){this.components.length=0,this.components=null,GeoGlobe.Geometry.prototype.destroy.apply(this,arguments)},clone:function clone(){for(var geometry=eval("new "+this.CLASS_NAME+"()"),i=0,len=this.components.length;i-1)){if(null!==t&&t=0;--i)t=this.removeComponent(e[i])||t;return t},removeComponent:function(e){return GeoGlobe.Util.removeItem(this.components,e),this.clearBounds(),!0},getLength:function(){for(var e=0,t=0,i=this.components.length;t0?x:a,n.push(l))}if(t=r.length,0===o){for(s=0;s1)for(var t=1,i=this.components.length;t1)for(var n,o,a=1,s=t.components.length;a2;return t&&GeoGlobe.Geometry.Collection.prototype.removeComponent.apply(this,arguments),t},intersects:function(e){var t=!1,i=e.CLASS_NAME;if("GeoGlobe.Geometry.LineString"===i||"GeoGlobe.Geometry.LinearRing"===i||"GeoGlobe.Geometry.Point"===i){var r,n,o,a,s,x,l,c,u,h=this.getSortedSegments();r="GeoGlobe.Geometry.Point"===i?[{x1:e.x,y1:e.y,x2:e.x,y2:e.y}]:e.getSortedSegments();e:for(var f=0,d=h.length;fa);++g)if(!(l.x2Math.max(s,x))&&!(Math.max(c,u)0){var m=e.x10&&(h.unshift(b,1),Array.prototype.splice.apply(o,h),b+=h.length-2),s))for(var v=0,C=u.points.length;v0&&g.length>0&&(g.push(l.clone()),n.push(new GeoGlobe.Geometry.LineString(g)))}else a=e.splitWith(this,t);return o&&o.length>1?r=!0:o=[],n&&n.length>1?i=!0:n=[],(r||i)&&(a=s?[n,o]:o),a},splitWith:function(e,t){return e.split(this,t)},getVertices:function(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(e,t){var i,r=!(t&&!1===t.edge)&&t&&t.details,n={},o=Number.POSITIVE_INFINITY;if(e instanceof GeoGlobe.Geometry.Point){for(var a,s=this.getSortedSegments(),x=e.x,l=e.y,c=0,u=s.length;cx&&(l>a.y1&&la.y2))break;n=r?{distance:n.distance,x0:n.x,y0:n.y,x1:x,y1:l}:n.distance}else if(e instanceof GeoGlobe.Geometry.LineString){var h,f,d,g,p,m=this.getSortedSegments(),b=e.getSortedSegments(),v=b.length,C={point:!0};e:for(c=0,u=m.length;cx&&(x=s,l=c);x>a&&l!==r&&(n.push(l),e(t,r,l,a),e(t,l,o,a))}(t,0,r,e);var o=[];n.sort((function(e,t){return e-t}));for(var a=0;a0&&(t=t.concat(r))}return new GeoGlobe.Geometry.LineString(t)},GeoGlobe.Geometry.LineString.getCurveCoordinatesByTwoPoints=function(e,t){if(!(e&&t&&e instanceof GeoGlobe.Geometry.Point&&t instanceof GeoGlobe.Geometry.Point))return null;var i=function(e){return 1-2*e+e*e},r=function(e){return 2*e-2*e*e},n=function(e){return e*e};curveCoordinates=[];var o,a,s,x,l,c,u=0,h=0;if(void 0!==t){var f=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.y),d=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(t.y),g=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.x),p=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(t.x);for(p>g&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(p-g)>180&&g<0&&(g=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(360+g)),g>p&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(g-p)>180&&p<0&&(p=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(360+p)),c=0,d===f?(o=0,a=g-p):p===g?(o=Math.PI/2,a=f-d):(o=Math.atan((d-f)/(p-g)),a=(d-f)/Math.sin(o)),0===c&&(c=o+Math.PI/5),l=(s=a/2)*Math.cos(c)+g,x=s*Math.sin(c)+f,u=0;u<31;u++)curveCoordinates.push(new GeoGlobe.Geometry.Point(g*i(h)+l*r(h)+p*n(h),f*i(h)+x*r(h)+d*n(h))),h+=1/30;return curveCoordinates}"undefined"!=typeof curveCoordinates&&(curveCoordinates=[])},GeoGlobe.Geometry.LinearRing=GeoGlobe.Class4OL(GeoGlobe.Geometry.LineString,{componentTypes:["GeoGlobe.Geometry.Point"],addComponent:function(e,t){var i=!1,r=this.components.pop();null===t&&e.equals(r)||(i=GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,arguments));var n=this.components[0];return GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,[n]),i},removeComponent:function(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),GeoGlobe.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var i=this.components[0];GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,[i])}return t},move:function(e,t){for(var i=0,r=this.components.length;i0&&e<=2)return this.components[0].clone();if(e>2){var t=0,i=0,r=this.components[0].x,n=this.components[0].y,o=-1*this.getArea();if(0!==o){for(var a=0;a2){for(var t=0,i=0,r=this.components.length;i2){for(var o,a,s=0;s=n&&h<=a||n>a&&h<=n&&h>=a)){d=-1;break}s<=u||r!==o&&(sMath.max(r,o))||(n=n&&ha&&h=a)&&++d}else if(h===n&&(r<=o&&u>=r&&u<=o||r>=o&&u<=r&&u>=o)){d=-1;break}return-1===d?1:!!(1&d)},intersects:function(e){var t=!1;if("GeoGlobe.Geometry.Point"===e.CLASS_NAME)t=this.containsPoint(e);else if("GeoGlobe.Geometry.LineString"===e.CLASS_NAME)t=e.intersects(this);else if("GeoGlobe.Geometry.LinearRing"===e.CLASS_NAME)t=GeoGlobe.Geometry.LineString.prototype.intersects.apply(this,[e]);else for(var i=0,r=e.components.length;i0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t0){t+=Math.abs(this.components[0].getGeodesicArea(e));for(var i=1,r=this.components.length;i0&&1!==(i=this.components[0].containsPoint(e))&&i&&t>1)for(var r,n=1;n1?o=!0:l=[],c&&c.length>1?a=!0:c=[],(o||a)&&(s=x?[l,c]:c),s},splitWith:function(e,t){var i,r,n,o,a,s,x,l=null,c=t&&t.mutual;if(e instanceof GeoGlobe.Geometry.LineString){x=[],s=[e];for(var u=0,h=this.components.length;u1?o=!0:s=[],x&&x.length>1?a=!0:x=[],(o||a)&&(l=c?[s,x]:x),l},CLASS_NAME:"GeoGlobe.Geometry.MultiLineString"}),GeoGlobe.Geometry.MultiPolygon=GeoGlobe.Class4OL(GeoGlobe.Geometry.Collection,{componentTypes:["GeoGlobe.Geometry.Polygon"],CLASS_NAME:"GeoGlobe.Geometry.MultiPolygon"}),GeoGlobe.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"},GeoGlobe.Feature=GeoGlobe.Class4OL({id:null,fid:null,lonlat:null,geometry:null,attributes:null,data:null,bounds:null,state:null,url:null,modified:null,initialize:function(e,t){this.data=null!==t?t:{},this.id=GeoGlobe.Util.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=null,this.geometry=e||null,this.state=null,this.attributes={},t&&(this.attributes=GeoGlobe.Util.extend(this.attributes,t))},destroy:function(){this.geometry=null,this.modified=null,this.id=null,this.lonlat=null,this.data=null},clone:function(){return new GeoGlobe.Feature(this.geometry?this.geometry.clone():null,this.attributes)},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(e,t,i){var r=!1;return this.geometry&&(r=this.geometry.atPoint(e,t,i)),r},destroyPopup:function(){},toState:function(e){if(e===GeoGlobe.State.UPDATE)switch(this.state){case GeoGlobe.State.UNKNOWN:case GeoGlobe.State.DELETE:this.state=e;case GeoGlobe.State.UPDATE:case GeoGlobe.State.INSERT:}else if(e===GeoGlobe.State.INSERT)if(this.state===GeoGlobe.State.UNKNOWN);else this.state=e;else if(e===GeoGlobe.State.DELETE)switch(this.state){case GeoGlobe.State.INSERT:case GeoGlobe.State.DELETE:break;case GeoGlobe.State.UNKNOWN:case GeoGlobe.State.UPDATE:this.state=e}else e===GeoGlobe.State.UNKNOWN&&(this.state=e)},CLASS_NAME:"GeoGlobe.Feature"}),GeoGlobe.Feature.getBoundsByFeatures=function(e){for(var t=e.length,i=new Array(t),r=0;rthis.value;break;case GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:i=r<=this.value;break;case GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:i=r>=this.value;break;case GeoGlobe.Filter.Comparison.BETWEEN:i=r>=this.lowerBoundary&&r<=this.upperBoundary;break;case GeoGlobe.Filter.Comparison.LIKE:i=new RegExp(this.value,"gi").test(r);break;case GeoGlobe.Filter.Comparison.IS_NULL:i=null===r}return i},value2regex:function(e,t,i){if("."===e)throw new Error("'.' is an unsupported wildCard character for GeoGlobe.Filter.Comparison");return e=e||"*",t=t||".",i=i||"!",this.value=this.value.replace(new RegExp("\\"+i+"(.|$)","g"),"\\$1"),this.value=this.value.replace(new RegExp("\\"+t,"g"),"."),this.value=this.value.replace(new RegExp("\\"+e,"g"),".*"),this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e),this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+t),this.value},regex2value:function(){var e=this.value;return(e=(e=(e=(e=e.replace(/!/g,"!!")).replace(/(\\)?\\\./g,(function(e,t){return t?e:"!."}))).replace(/(\\)?\\\*/g,(function(e,t){return t?e:"!*"}))).replace(/\\\\/g,"\\")).replace(/\.\*/g,"*")},clone:function(){return GeoGlobe.Util.extend(new GeoGlobe.Filter.Comparison,this)},CLASS_NAME:"GeoGlobe.Filter.Comparison"}),GeoGlobe.Filter.Comparison.EQUAL_TO="==",GeoGlobe.Filter.Comparison.NOT_EQUAL_TO="!=",GeoGlobe.Filter.Comparison.LESS_THAN="<",GeoGlobe.Filter.Comparison.GREATER_THAN=">",GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=",GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=",GeoGlobe.Filter.Comparison.BETWEEN="..",GeoGlobe.Filter.Comparison.LIKE="~",GeoGlobe.Filter.Comparison.IS_NULL="NULL",GeoGlobe.Filter.Spatial=GeoGlobe.Class4OL(GeoGlobe.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(e){var t=!1;switch(this.type){case GeoGlobe.Filter.Spatial.BBOX:case GeoGlobe.Filter.Spatial.INTERSECTS:if(e.geometry){var i=this.value;"GeoGlobe.LngLatBounds"===this.value.CLASS_NAME&&(i=this.value.toGeometry()),e.geometry.intersects(i)&&(t=!0)}break;default:throw new Error("evaluate is not implemented for this filter type.")}return t},clone:function(){var e=GeoGlobe.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new GeoGlobe.Filter.Spatial(e)},CLASS_NAME:"GeoGlobe.Filter.Spatial"}),GeoGlobe.Filter.Spatial.BBOX="BBOX",GeoGlobe.Filter.Spatial.INTERSECTS="INTERSECTS",GeoGlobe.Filter.Spatial.DWITHIN="DWITHIN",GeoGlobe.Filter.Spatial.WITHIN="WITHIN",GeoGlobe.Filter.Spatial.CONTAINS="CONTAINS",GeoGlobe.Filter.Function=GeoGlobe.Class4OL(GeoGlobe.Filter,{name:null,params:null,CLASS_NAME:"GeoGlobe.Filter.Function"}),GeoGlobe.Protocol=GeoGlobe.Class4OL({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(e){e=e||{},GeoGlobe.Util.extend(this,e),this.options=e},mergeWithDefaultFilter:function(e){return e&&this.defaultFilter?new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.AND,filters:[this.defaultFilter,e]}):e||this.defaultFilter||void 0},destroy:function(){this.options=null,this.format=null},read:function(e){(e=e||{}).filter=this.mergeWithDefaultFilter(e.filter)},create:function(){},update:function(){},delete:function(){},commit:function(){},abort:function(e){},createCallback:function(e,t,i){return GeoGlobe.Function.bind((function(){e.apply(this,[t,i])}),this)},CLASS_NAME:"GeoGlobe.Protocol"}),GeoGlobe.Protocol.Response=GeoGlobe.Class4OL({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(e){GeoGlobe.Util.extend(this,e)},success:function(){return this.code>0},CLASS_NAME:"GeoGlobe.Protocol.Response"}),GeoGlobe.Protocol.Response.SUCCESS=1,GeoGlobe.Protocol.Response.FAILURE=0,GeoGlobe.Protocol.HTTP=GeoGlobe.Class4OL(GeoGlobe.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(e){if(e=e||{},this.params={},this.headers={},GeoGlobe.Protocol.prototype.initialize.apply(this,arguments),!this.filterToParams&&GeoGlobe.Format.QueryStringFilter){var t=new GeoGlobe.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams=function(e,i){return t.write(e,i)}}},destroy:function(){this.params=null,this.headers=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),(e=e||{}).params=GeoGlobe.Util.applyDefaults(e.params,this.options.params),(e=GeoGlobe.Util.applyDefaults(e,this.options)).filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=void 0!==e.readWithPOST?e.readWithPOST:this.readWithPOST,i=new GeoGlobe.Protocol.Response({requestType:"read"});if(t){var r=e.headers||{};r["Content-Type"]="application/x-www-form-urlencoded",i.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,i,e),data:GeoGlobe.Util.getParameterString(e.params),headers:r})}else i.priv=GeoGlobe.Request.GET({url:e.url,callback:this.createCallback(this.handleRead,i,e),params:e.params,headers:e.headers});return i},handleRead:function(e,t){this.handleResponse(e,t)},create:function(e,t){t=GeoGlobe.Util.applyDefaults(t,this.options);var i=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"create"});return i.priv=GeoGlobe.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(e)}),i},handleCreate:function(e,t){this.handleResponse(e,t)},update:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=GeoGlobe.Util.applyDefaults(t,this.options);var r=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"update"}),n=this.updateWithPOST?"POST":"PUT";return r.priv=GeoGlobe.Request[n]({url:i,callback:this.createCallback(this.handleUpdate,r,t),headers:t.headers,data:this.format.write(e)}),r},handleUpdate:function(e,t){this.handleResponse(e,t)},delete:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=GeoGlobe.Util.applyDefaults(t,this.options);var r=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"delete"}),n=this.deleteWithPOST?"POST":"DELETE",o={url:i,callback:this.createCallback(this.handleDelete,r,t),headers:t.headers};return this.deleteWithPOST&&(o.data=this.format.write(e)),r.priv=GeoGlobe.Request[n](o),r},handleDelete:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){var i=e.priv;t.callback&&(i.status>=200&&i.status<300?("delete"!==e.requestType&&(e.features=this.parseFeatures(i)),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,t.callback.call(t.scope,e))},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},commit:function(e,t){t=GeoGlobe.Util.applyDefaults(t,this.options);var i=[],r=0,n={};n[GeoGlobe.State.INSERT]=[],n[GeoGlobe.State.UPDATE]=[],n[GeoGlobe.State.DELETE]=[];for(var o,a,s=[],x=0,l=e.length;x0?1:0)+n[GeoGlobe.State.UPDATE].length+n[GeoGlobe.State.DELETE].length,u=!0,h=new GeoGlobe.Protocol.Response({reqFeatures:s});function f(e){this.callUserCallback(e,t),u=u&&e.success(),++r>=c&&t.callback&&(h.code=u?GeoGlobe.Protocol.Response.SUCCESS:GeoGlobe.Protocol.Response.FAILURE,t.callback.apply(t.scope,[h]))}var d=n[GeoGlobe.State.INSERT];for(d.length>0&&i.push(this.create(d,GeoGlobe.Util.applyDefaults({callback:function(e){for(var t=e.features?e.features.length:0,i=new Array(t),r=0;r=0;--x)i.push(this.update(d[x],GeoGlobe.Util.applyDefaults({callback:f,scope:this},t.update)));for(x=(d=n[GeoGlobe.State.DELETE]).length-1;x>=0;--x)i.push(this.delete(d[x],GeoGlobe.Util.applyDefaults({callback:f,scope:this},t.delete)));return i},abort:function(e){e&&e.priv.abort()},callUserCallback:function(e,t){var i=t[e.requestType];i&&i.callback&&i.callback.call(i.scope,e)},CLASS_NAME:"GeoGlobe.Protocol.HTTP"}),GeoGlobe.Protocol.WFS=function(e){e=GeoGlobe.Util.applyDefaults(e,GeoGlobe.Protocol.WFS.DEFAULTS);var t=GeoGlobe.Protocol.WFS["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFS version: "+e.version;return new t(e)},GeoGlobe.Protocol.WFS.DEFAULTS={version:"1.0.0"},GeoGlobe.Protocol.WFS.v1=GeoGlobe.Class4OL(GeoGlobe.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(e){GeoGlobe.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=GeoGlobe.Format.WFST(GeoGlobe.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))),!e.geometryName&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(this.format.version)>1&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),e=GeoGlobe.Util.extend({},e),GeoGlobe.Util.applyDefaults(e,this.options||{});var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=GeoGlobe.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",e)]);return t.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},setFeatureType:function(e){this.featureType=e,this.format.featureType=e},setGeometryName:function(e){this.geometryName=e,this.format.geometryName=e},handleRead:function(e,t){if(t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options),t.callback){var i=e.priv;if(i.status>=200&&i.status<300){var r=this.parseResponse(i,t.readOptions);r&&!1!==r.success?(t.readOptions&&"object"===t.readOptions.output?GeoGlobe.Util.extend(e,r):e.features=r,e.code=GeoGlobe.Protocol.Response.SUCCESS):(e.code=GeoGlobe.Protocol.Response.FAILURE,e.error=r)}else e.code=GeoGlobe.Protocol.Response.FAILURE;t.callback.call(t.scope,e)}},parseResponse:function(e,t){var i=e.responseXML;if(i&&i.documentElement||(i=e.responseText),!i||i.length<=0)return null;var r=null;try{r=null!==this.readFormat?this.readFormat.read(i):this.format.read(i,t)}catch(e){var n="程序运行异常:"+e.name+","+e.message;alert(n)}if(!this.featureNS){var o=this.readFormat||this.format;this.featureNS=o.featureNS,o.autoConfig=!1,this.geometryName||this.setGeometryName(o.geometryName)}return r},commit:function(e,t){t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options);var i=new GeoGlobe.Protocol.Response({requestType:"commit",reqFeatures:e});return i.priv=GeoGlobe.Request.POST({url:t.url,headers:t.headers,data:this.format.write(e,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(e,t){if(t.callback){var i=e.priv,r=i.responseXML;r&&r.documentElement||(r=i.responseText);var n=this.format.read(r)||{};e.insertIds=n.insertIds||[],n.success?e.code=GeoGlobe.Protocol.Response.SUCCESS:(e.code=GeoGlobe.Protocol.Response.FAILURE,e.error=n),t.callback.call(t.scope,e)}},filterDelete:function(e,t){t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options),new GeoGlobe.Protocol.Response({requestType:"commit"});var i=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}}),r=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(t.featureNS?this.featurePrefix+":":"")+t.featureType}});t.featureNS&&r.setAttribute("xmlns:"+this.featurePrefix,t.featureNS);var n=this.format.writeNode("ogc:Filter",e);r.appendChild(n),i.appendChild(r);var o=GeoGlobe.Format.XML.prototype.write.apply(this.format,[i]);return GeoGlobe.Request.POST({url:this.url,callback:t.callback||function(){},data:o})},abort:function(e){e&&e.priv.abort()},CLASS_NAME:"GeoGlobe.Protocol.WFS.v1"}),GeoGlobe.Protocol.WFS.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"GeoGlobe.Protocol.WFS.v1_0_0"}),GeoGlobe.Protocol.WFS.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Protocol.WFS.v1,{version:"1.1.0",initialize:function(e){GeoGlobe.Protocol.WFS.v1.prototype.initialize.apply(this,arguments),this.outputFormat&&!this.readFormat&&("gml2"===this.outputFormat.toLowerCase()?this.readFormat=new GeoGlobe.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName}):"json"===this.outputFormat.toLowerCase()&&(this.readFormat=new GeoGlobe.Format.GeoJSON))},CLASS_NAME:"GeoGlobe.Protocol.WFS.v1_1_0"}),GeoGlobe.Protocol.CSW=function(e){e=GeoGlobe.Util.applyDefaults(e,GeoGlobe.Protocol.CSW.DEFAULTS);var t=GeoGlobe.Protocol.CSW["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSW version: "+e.version;return new t(e)},GeoGlobe.Protocol.CSW.DEFAULTS={version:"2.0.2"},GeoGlobe.Protocol.CSW.v2_0_2=GeoGlobe.Class4OL(GeoGlobe.Protocol,{formatOptions:null,initialize:function(e){GeoGlobe.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=new GeoGlobe.Format.CSWGetRecords.v2_0_2(GeoGlobe.Util.extend({},this.formatOptions)))},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){e=GeoGlobe.Util.extend({},e),GeoGlobe.Util.applyDefaults(e,this.options||{});var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=this.format.write(e.params||e);return t.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},handleRead:function(e,t){if(t.callback){var i=e.priv;i.status>=200&&i.status<300?(e.data=this.parseData(i),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},parseData:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},CLASS_NAME:"GeoGlobe.Protocol.CSW.v2_0_2"}),GeoGlobe.Protocol.Script=GeoGlobe.Class4OL(GeoGlobe.Protocol,{url:null,params:null,callback:null,callbackTemplate:"GeoGlobe.Protocol.Script.registry.${id}",callbackKey:"callback",callbackPrefix:"",scope:null,format:null,pendingRequests:null,srsInBBOX:!1,initialize:function(e){if(e=e||{},this.params={},this.pendingRequests={},GeoGlobe.Protocol.prototype.initialize.apply(this,arguments),this.format||(this.format=new GeoGlobe.Format.GeoJSON),!this.filterToParams&&GeoGlobe.Format.QueryStringFilter){var t=new GeoGlobe.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(e,i){return t.write(e,i)}}},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),(e=GeoGlobe.Util.applyDefaults(e,this.options)).params=GeoGlobe.Util.applyDefaults(e.params,this.options.params),e.filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=this.createRequest(e.url,e.params,GeoGlobe.Function.bind((function(i){t.data=i,this.handleRead(t,e)}),this));return t.priv=i,t},createRequest:function(e,t,i){var r=GeoGlobe.Protocol.Script.register(i),n=GeoGlobe.String.format(this.callbackTemplate,{id:r});(t=GeoGlobe.Util.extend({},t))[this.callbackKey]=this.callbackPrefix+n,e=GeoGlobe.Util.urlAppend(e,GeoGlobe.Util.getParameterString(t));var o=document.createElement("script");return o.type="text/javascript",o.src=e,o.id="GeoGlobe_Protocol_Script_"+r,this.pendingRequests[o.id]=o,document.getElementsByTagName("head")[0].appendChild(o),o},destroyRequest:function(e){GeoGlobe.Protocol.Script.unregister(e.id.split("_").pop()),delete this.pendingRequests[e.id],e.parentNode&&e.parentNode.removeChild(e)},handleRead:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){t.callback&&(e.data?(e.features=this.parseFeatures(e.data),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,this.destroyRequest(e.priv),t.callback.call(t.scope,e))},parseFeatures:function(e){return this.format.read(e)},abort:function(e){if(e)this.destroyRequest(e.priv);else for(var t in this.pendingRequests)this.destroyRequest(this.pendingRequests[t])},destroy:function(){this.abort(),delete this.params,delete this.format,GeoGlobe.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"GeoGlobe.Protocol.Script"}),function(){var e=GeoGlobe.Protocol.Script,t=0;e.registry={},e.register=function(i){var r="c"+ ++t;return e.registry[r]=function(){i.apply(this,arguments)},r},e.unregister=function(t){delete e.registry[t]}}(),GeoGlobe.Format=GeoGlobe.Class4OL({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(e){GeoGlobe.Util.extend(this,e),this.options=e},destroy:function(){},read:function(e){throw new Error("Read not implemented.")},write:function(e){throw new Error("Write not implemented.")},CLASS_NAME:"GeoGlobe.Format"}),GeoGlobe.Format.XML=GeoGlobe.Class4OL(GeoGlobe.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(e){for(var t in window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")),GeoGlobe.Format.prototype.initialize.apply(this,[e]),this.namespaces=GeoGlobe.Util.extend({},this.namespaces),this.namespaceAlias={},this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null,GeoGlobe.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(e,t){this.namespaces[e]=t,this.namespaceAlias[t]=e},read:function(e){var t=e.indexOf("<");t>0&&(e=e.substring(t));var i=GeoGlobe.Util.Try(GeoGlobe.Function.bind((function(){var t;return(t=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom).loadXML(e),t}),this),(function(){return(new DOMParser).parseFromString(e,"text/xml")}),(function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(e),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML}));return this.keepData&&(this.data=i),i},write:function(e){var t;if(e.xml)t=e.xml;else{var i=new XMLSerializer;if(1===e.nodeType){var r=document.implementation.createDocument("","",null);r.importNode&&(e=r.importNode(e,!0)),r.appendChild(e),t=i.serializeToString(r)}else t=i.serializeToString(e)}return t},createElementNS:function(e,t){return this.xmldom?"string"==typeof e?this.xmldom.createNode(1,t,e):this.xmldom.createNode(1,t,""):document.createElementNS(e,t)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(e){return"string"!=typeof e&&(e=String(e)),this.xmldom?this.xmldom.createTextNode(e):document.createTextNode(e)},getElementsByTagNameNS:function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var n,o,a=e.getElementsByTagName("*"),s=0,x=a.length;s0?(r=e.substring(0,o),n=e.substring(o+1)):(r=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,n=e);var a=this.writers[r][n].apply(this,[t]);return i&&i.appendChild(a),a},getChildEl:function(e,t,i){return e&&this.getThisOrNextEl(e.firstChild,t,i)},getNextEl:function(e,t,i){return e&&this.getThisOrNextEl(e.nextSibling,t,i)},getThisOrNextEl:function(e,t,i){e:for(var r=e;r;r=r.nextSibling)switch(r.nodeType){case 1:if(!(t&&t!==(r.localName||r.nodeName.split(":").pop())||i&&i!==r.namespaceURI))break e;r=null;break e;case 3:if(/^\s*$/.test(r.nodeValue))break;case 4:case 6:case 12:case 10:case 11:r=null;break e}return r||null},lookupNamespaceURI:function(e,t){var i=null;if(e)if(e.lookupNamespaceURI)i=e.lookupNamespaceURI(t);else e:switch(e.nodeType){case 1:if(null!==e.namespaceURI&&e.prefix===t){i=e.namespaceURI;break e}var r=e.attributes.length;if(r)for(var n,o=0;o0){if(!(n=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);r=n.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection);break}var x,l=this.getElementsByTagNameNS(e,this.gmlns,"Box");for(s=0;s0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),0===i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coordinates")).length>0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.removeSpace,"").split(",")),0===i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coord")).length>0){var r=this.getElementsByTagNameNS(t[0],this.gmlns,"X"),n=this.getElementsByTagNameNS(t[0],this.gmlns,"Y");r.length>0&&n.length>0&&(i=[r[0].firstChild.nodeValue,n[0].firstChild.nodeValue])}return 2===i.length&&(i[2]=null),this.xy?new GeoGlobe.Geometry.Point(i[0],i[1],i[2]):new GeoGlobe.Geometry.Point(i[1],i[0],i[2])},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"Point"),i=[];if(t.length>0)for(var r,n=0;n0){r=this.getChildValue(i[0]).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace);for(var o,a,s,x,l=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[0].getAttribute("dimension")),c=0;c0){var u=this.getChildValue(i[0]).replace(this.regExes.trimSpace,"").replace(this.regExes.trimComma,",").split(this.regExes.splitSpace);for(c=0;c0)for(var r,n=0;n0)for(var r,n=0;n0)for(var r,n=0;n0){var n=[];if(r.length>0&&(n=r[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2===n.length&&(n[2]=null),this.xy)var o=new GeoGlobe.Geometry.Point(n[0],n[1],n[2]);else o=new GeoGlobe.Geometry.Point(n[1],n[0],n[2])}var a=this.getElementsByTagNameNS(e,this.gmlns,"upperCorner");if(a.length>0)if(n=[],a.length>0&&(n=a[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2===n.length&&(n[2]=null),this.xy)var s=new GeoGlobe.Geometry.Point(n[0],n[1],n[2]);else s=new GeoGlobe.Geometry.Point(n[1],n[0],n[2]);if(o&&s){i.push(new GeoGlobe.Geometry.Point(o.x,o.y)),i.push(new GeoGlobe.Geometry.Point(s.x,o.y)),i.push(new GeoGlobe.Geometry.Point(s.x,s.y)),i.push(new GeoGlobe.Geometry.Point(o.x,s.y)),i.push(new GeoGlobe.Geometry.Point(o.x,o.y));var x=new GeoGlobe.Geometry.LinearRing(i);t=new GeoGlobe.Geometry.Polygon([x])}return t},box:function(e){var t,i=this.getElementsByTagNameNS(e,this.gmlns,"coordinates"),r=null,n=null;if(i.length>0&&2===(t=i[0].firstChild.nodeValue.split(" ")).length&&(r=t[0].split(","),n=t[1].split(",")),null!==r&&null!==n){var o=new GeoGlobe.LngLat(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(r[0]),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(r[1])),a=new GeoGlobe.LngLat(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(n[0]),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(n[1]));return new GeoGlobe.LngLatBounds(o,a)}}},parseAttributes:function(e){for(var t,i,r,n,o,a,s,x={},l=e.firstChild;l;){if(1===l.nodeType){for(t=l.childNodes,i=0;i0&&(t.bounds=i.components[0])},Point:function(e,t){var i={points:[]};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(i.points[0])},coordinates:function(e,t){for(var i,r=this.getChildValue(e).replace(this.regExes.trimSpace,""),n=(r=r.replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),o=n.length,a=new Array(o),s=0;s0&&(t.components=[new GeoGlobe.Geometry.MultiLineString(i.components)])},curveMember:function(e,t){this.readChildNodes(e,t)},MultiSurface:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),i.components.length>0&&(t.components=[new GeoGlobe.Geometry.MultiPolygon(i.components)])},surfaceMember:function(e,t){this.readChildNodes(e,t)},surfaceMembers:function(e,t){this.readChildNodes(e,t)},pointMembers:function(e,t){this.readChildNodes(e,t)},lineStringMembers:function(e,t){this.readChildNodes(e,t)},polygonMembers:function(e,t){this.readChildNodes(e,t)},geometryMembers:function(e,t){this.readChildNodes(e,t)},Envelope:function(e,t){var i={points:new Array(2)};this.readChildNodes(e,i),t.components||(t.components=[]);var r=i.points[0],n=i.points[1],o=new GeoGlobe.LngLat(r.x,r.y),a=new GeoGlobe.LngLat(n.x,n.y);t.components.push(new GeoGlobe.LngLatBounds(o,a))},lowerCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[0]=i.points[0]},upperCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[1]=i.points[0]}},GeoGlobe.Format.GML.Base.prototype.readers.gml),feature:GeoGlobe.Format.GML.Base.prototype.readers.feature,wfs:GeoGlobe.Format.GML.Base.prototype.readers.wfs},write:function(e){var t;t=GeoGlobe.Util.isArray(e)?"featureMembers":"featureMember";var i=this.writeNode("gml:"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),GeoGlobe.Format.XML.prototype.write.apply(this,[i])},writers:{gml:GeoGlobe.Util.applyDefaults({featureMembers:function(e){for(var t=this.createElementNSPlus("gml:featureMembers"),i=0,r=e.length;i=this.maxDepth)return!1;var i=GeoGlobe.Util.extend({},t);i.depth++;for(var r=0,n=e.length;r0){var c=l[0],u={features:[],feature:a};this.readNode(c,u),u.features.length>0&&i.push.apply(i,u.features)}}else i.push(a)}this.features=this.features.concat(i)},readers:{kml:{when:function(e,t){t.whens.push(GeoGlobe.Date.parse(this.getChildValue(e)))},_trackPointAttribute:function(e,t){var i=e.nodeName.split(":").pop();t.attributes[i].push(this.getChildValue(e))}},gx:{Track:function(e,t){var i={whens:[],points:[],angles:[]};if(this.trackAttributes){i.attributes={};for(var r=0,n=this.trackAttributes.length;r0;if(x&&i.whens.length!==i.angles.length)throw new Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:angles ("+i.angles.length+") elements.");for(r=0,n=i.whens.length;r2&&(r.z=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(i[2])),t.points.push(r)},angles:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(/\s+/);t.angles.push(i)}}},parseFeature:function(e){for(var t,i,r,n,o=["MultiGeometry","Polygon","LineString","Point"],a=0,s=o.length;a0){var x;if(!(x=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);r=x.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection);break}this.extractAttributes&&(n=this.parseAttributes(e));var l=new GeoGlobe.Feature(r,n),c=e.getAttribute("id")||e.getAttribute("name");return null!==c&&(l.fid=c),l},getStyle:function(e,t){var i=GeoGlobe.Util.removeTail(e),r=GeoGlobe.Util.extend({},t);if(r.depth++,r.styleBaseUrl=i,!this.styles[e]&&!GeoGlobe.String.startsWith(e,"#")&&r.depth<=this.maxDepth&&!this.fetched[i]){var n=this.fetchLink(i);n&&this.parseData(n,r)}return GeoGlobe.Util.extend({},this.styles[e])},parseGeometry:{point:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),i=[];if(t.length>0){var r=t[0].firstChild.nodeValue;i=(r=r.replace(this.regExes.removeSpace,"")).split(",")}if(!(i.length>1))throw"Bad coordinate string: "+r;return 2===i.length&&(i[2]=null),new GeoGlobe.Geometry.Point(i[0],i[1],i[2])},linestring:function(e,t){var i=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),r=null;if(i.length>0){for(var n,o=this.getChildValue(i[0]),a=(o=(o=o.replace(this.regExes.trimSpace,"")).replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),s=a.length,x=new Array(s),l=0;l1))throw"Bad LineString point coordinates: "+a[l];2===n.length&&(n[2]=null),x[l]=new GeoGlobe.Geometry.Point(n[0],n[1],n[2])}if(!s)throw"Bad LineString coordinates: "+o;r=t?new GeoGlobe.Geometry.LinearRing(x):new GeoGlobe.Geometry.LineString(x)}return r},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"LinearRing"),i=t.length,r=new Array(i);if(i>0)for(var n,o=0,a=t.length;o=1&&i.length<=3){var x;switch(i.length){case 1:x=i[0];break;case 2:var l=i[0],c=i[1];x=3===l.nodeType||4===l.nodeType?l:c;break;default:x=i[1]}if(3===x.nodeType||4===x.nodeType){var u=t.prefix?t.nodeName.split(":")[1]:t.nodeName,h=GeoGlobe.Util.getXmlNodeValue(x);h&&(h=h.replace(this.regExes.trimSpace,""),r[u]=h)}}return r},parseExtendedData:function(e){var t,i,r,n,o={},a=e.getElementsByTagName("Data");for(t=0,i=a.length;t0&&(t.featureNS=this.lookupNamespaceURI(e,r[0]))}},Title:function(e,t){var i=this.getChildValue(e);i&&(t.title=i)},Abstract:function(e,t){var i=this.getChildValue(e);i&&(t.abstract=i)}}},CLASS_NAME:"GeoGlobe.Format.WFSCapabilities.v1"}),GeoGlobe.Format.WFSCapabilities.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Format.WFSCapabilities.v1,{readers:{wfs:GeoGlobe.Util.applyDefaults({Service:function(e,t){t.service={},this.readChildNodes(e,t.service)},Fees:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.accessConstraints=i)},OnlineResource:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.onlineResource=i)},Keywords:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.keywords=i.split(", "))},Capability:function(e,t){t.capability={},this.readChildNodes(e,t.capability)},Request:function(e,t){t.request={},this.readChildNodes(e,t.request)},GetFeature:function(e,t){t.getfeature={href:{},formats:[]},this.readChildNodes(e,t.getfeature)},ResultFormat:function(e,t){for(var i,r=e.childNodes,n=0;n0&&n.push(","),i=t[o].geometry,n.push(this.extractGeometry(i));return r&&n.push(")"),n.join("")},extractGeometry:function(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?(this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection),("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")"):null},extract:{point:function(e){return e.x+" "+e.y},multipoint:function(e){for(var t=[],i=0,r=e.components.length;i|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(e){var t=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(e);if(t){var i=e.length,r=e.indexOf("(",t[0].length);if(r>-1)for(var n=1;r0;)switch(r++,e.charAt(r)){case"(":n++;break;case")":n--}return[e.substr(0,r+1)]}},END:/^$/},i={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},r={"=":GeoGlobe.Filter.Comparison.EQUAL_TO,"<>":GeoGlobe.Filter.Comparison.NOT_EQUAL_TO,"<":GeoGlobe.Filter.Comparison.LESS_THAN,"<=":GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":GeoGlobe.Filter.Comparison.GREATER_THAN,">=":GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:GeoGlobe.Filter.Comparison.LIKE,BETWEEN:GeoGlobe.Filter.Comparison.BETWEEN,"IS NULL":GeoGlobe.Filter.Comparison.IS_NULL},n={},o={AND:GeoGlobe.Filter.Logical.AND,OR:GeoGlobe.Filter.Logical.OR},a={},s={RPAREN:3,LOGICAL:2,COMPARISON:1};for(e in r)r.hasOwnProperty(e)&&(n[r[e]]=e);for(e in o)o.hasOwnProperty(e)&&(a[o[e]]=e);function x(e,i){var r,n,o,a,s=i.length;for(r=0;r0&&s[t[t.length-1].type]<=a;)i.push(t.pop());t.push(n);break;case"SPATIAL":case"NOT":case"LPAREN":t.push(n);break;case"RPAREN":for(;t.length>0&&"LPAREN"!==t[t.length-1].type;)i.push(t.pop());t.pop(),t.length>0&&"SPATIAL"===t[t.length-1].type&&i.push(t.pop());case"COMMA":case"END":break;default:throw new Error("Unknown token type "+n.type)}}for(;t.length>0;)i.push(t.pop());var x=function e(){var t=i.pop();switch(t.type){case"LOGICAL":var n=e(),a=e();return new GeoGlobe.Filter.Logical({filters:[a,n],type:o[t.text.toUpperCase()]});case"NOT":var s=e();return new GeoGlobe.Filter.Logical({filters:[s],type:GeoGlobe.Filter.Logical.NOT});case"BETWEEN":var x,l;return i.pop(),l=e(),x=e(),u=e(),new GeoGlobe.Filter.Comparison({property:u,lowerBoundary:x,upperBoundary:l,type:GeoGlobe.Filter.Comparison.BETWEEN});case"COMPARISON":var c=e(),u=e();return new GeoGlobe.Filter.Comparison({property:u,value:c,type:r[t.text.toUpperCase()]});case"IS_NULL":return u=e(),new GeoGlobe.Filter.Comparison({property:u,type:r[t.text.toUpperCase()]});case"VALUE":var h=t.text.match(/^'(.*)'$/);return h?h[1].replace(/''/g,"'"):Number(t.text);case"SPATIAL":switch(t.text.toUpperCase()){case"BBOX":var f=e(),d=e(),g=e(),p=e(),m=e();return new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.BBOX,property:m,value:GeoGlobe.LngLatBounds.fromArray([p,g,d,f])});case"INTERSECTS":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.INTERSECTS,property:u,value:c});case"WITHIN":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.WITHIN,property:u,value:c});case"CONTAINS":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.CONTAINS,property:u,value:c});case"DWITHIN":var b=e();return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.DWITHIN,value:c,property:u,distance:Number(b)})}case"GEOMETRY":return GeoGlobe.Geometry.fromWKT(t.text);default:return t.text}}();if(i.length>0){for(var l="Remaining tokens after building AST: \n",c=i.length-1;c>=0;c--)l+=i[c].type+": "+i[c].text+"\n";throw new Error(l)}return x}(function(e){var t,r=[],n=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{if(e=(t=x(e,n)).remainder,n=i[t.type],"END"!==t.type&&!n)throw new Error("No follows list for "+t.type);r.push(t)}while("END"!==t.type);return r}(e));return this.keepData&&(this.data=t),t},write:function(e){if(e instanceof GeoGlobe.Geometry)return e.toString();switch(e.CLASS_NAME){case"GeoGlobe.Filter.Spatial":switch(e.type){case GeoGlobe.Filter.Spatial.BBOX:return"BBOX("+e.property+","+e.value.toBBOX()+")";case GeoGlobe.Filter.Spatial.DWITHIN:return"DWITHIN("+e.property+", "+this.write(e.value)+", "+e.distance+")";case GeoGlobe.Filter.Spatial.WITHIN:return"WITHIN("+e.property+", "+this.write(e.value)+")";case GeoGlobe.Filter.Spatial.INTERSECTS:return"INTERSECTS("+e.property+", "+this.write(e.value)+")";case GeoGlobe.Filter.Spatial.CONTAINS:return"CONTAINS("+e.property+", "+this.write(e.value)+")";default:throw new Error("Unknown spatial filter type: "+e.type)}case"GeoGlobe.Filter.Logical":if(e.type===GeoGlobe.Filter.Logical.NOT)return"NOT ("+this.write(e.filters[0])+")";for(var t="(",i=!0,r=0;r0?t.filter=new GeoGlobe.Filter.FeatureId({fids:i.fids}):i.filters.length>0&&(t.filter=i.filters[0])},FeatureId:function(e,t){var i=e.getAttribute("fid");i&&t.fids.push(i)},And:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.AND});this.readChildNodes(e,i),t.filters.push(i)},Or:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.OR});this.readChildNodes(e,i),t.filters.push(i)},Not:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.NOT});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThan:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LESS_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThan:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.GREATER_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsBetween:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.BETWEEN});this.readChildNodes(e,i),t.filters.push(i)},Literal:function(e,t){t.value=GeoGlobe.String.numericIf(this.getChildValue(e),!0)},PropertyName:function(e,t){t.property=this.getChildValue(e)},LowerBoundary:function(e,t){t.lowerBoundary=GeoGlobe.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},UpperBoundary:function(e,t){t.upperBoundary=GeoGlobe.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},Intersects:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.INTERSECTS)},Within:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.WITHIN)},Contains:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.CONTAINS)},DWithin:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.DWITHIN)},Distance:function(e,t){t.distance=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(this.getChildValue(e)),t.distanceUnits=e.getAttribute("units")},Function:function(e,t){},PropertyIsNull:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.IS_NULL});this.readChildNodes(e,i),t.filters.push(i)}}},readSpatial:function(e,t,i){var r=new GeoGlobe.Filter.Spatial({type:i});this.readChildNodes(e,r),r.value=r.components[0],delete r.components,t.filters.push(r)},encodeLiteral:function(e){return e instanceof Date&&(e=GeoGlobe.Date.toISOString(e)),e},writeOgcExpression:function(e,t){return e instanceof GeoGlobe.Filter.Function?this.writeNode("Function",e,t):this.writeNode("Literal",e,t),t},write:function(e){return this.writers.ogc.Filter.apply(this,[e])},writers:{ogc:{Filter:function(e){var t=this.createElementNSPlus("ogc:Filter");return this.writeNode(this.getFilterType(e),e,t),t},_featureIds:function(e){for(var t=this.createDocumentFragment(),i=0,r=e.fids.length;i":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},CLASS_NAME:"GeoGlobe.Format.Filter.v1"}),GeoGlobe.Format.Filter.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Format.GML.v2,GeoGlobe.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(e){GeoGlobe.Format.GML.v2.prototype.initialize.apply(this,[e])},readers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsNotEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLike:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LIKE});this.readChildNodes(e,i);var r=e.getAttribute("wildCard"),n=e.getAttribute("singleChar"),o=e.getAttribute("escape");i.value2regex(r,n,o),t.filters.push(i)}},GeoGlobe.Format.Filter.v1.prototype.readers.ogc),gml:GeoGlobe.Format.GML.v2.prototype.readers.gml,feature:GeoGlobe.Format.GML.v2.prototype.readers.feature},writers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Box",e.value,t);return e.projection&&i.setAttribute("srsName",e.projection),t}},GeoGlobe.Format.Filter.v1.prototype.writers.ogc),gml:GeoGlobe.Format.GML.v2.prototype.writers.gml,feature:GeoGlobe.Format.GML.v2.prototype.writers.feature},writeSpatial:function(e,t){var i,r=this.createElementNSPlus("ogc:"+t);return this.writeNode("PropertyName",e,r),e.value instanceof GeoGlobe.Filter.Function?this.writeNode("Function",e.value,r):(i=e.value instanceof GeoGlobe.Geometry?this.writeNode("feature:_geometry",e.value).firstChild:this.writeNode("gml:Box",e.value),e.projection&&i.setAttribute("srsName",e.projection),r.appendChild(i)),r},CLASS_NAME:"GeoGlobe.Format.Filter.v1_0_0"}),GeoGlobe.Format.Filter.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Format.GML.v3,GeoGlobe.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(e){GeoGlobe.Format.GML.v3.prototype.initialize.apply(this,[e])},readers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=e.getAttribute("matchCase"),r=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,r),t.filters.push(r)},PropertyIsNotEqualTo:function(e,t){var i=e.getAttribute("matchCase"),r=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,r),t.filters.push(r)},PropertyIsLike:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LIKE});this.readChildNodes(e,i);var r=e.getAttribute("wildCard"),n=e.getAttribute("singleChar"),o=e.getAttribute("escapeChar");i.value2regex(r,n,o),t.filters.push(i)}},GeoGlobe.Format.Filter.v1.prototype.readers.ogc),gml:GeoGlobe.Format.GML.v3.prototype.readers.gml,feature:GeoGlobe.Format.GML.v3.prototype.readers.feature},writers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:e.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Envelope",e.value);return e.projection&&i.setAttribute("srsName",e.projection),t.appendChild(i),t},SortBy:function(e){for(var t=this.createElementNSPlus("ogc:SortBy"),i=0,r=e.length;i0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,(function(e,i){var r=t[i];return r||(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))}))+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}},CLASS_NAME:"GeoGlobe.Format.JSON"}),GeoGlobe.Format.GeoJSON=GeoGlobe.Class4OL(GeoGlobe.Format.JSON,{ignoreExtraDims:!1,read:function(e,t,i){t=t||"FeatureCollection";var r,n=null;if(r="string"==typeof e?GeoGlobe.Format.JSON.prototype.read.apply(this,[e,i]):e){if("string"!=typeof r.type)GeoGlobe.Console.error("Bad GeoJSON - no type: "+e);else if(this.isValidType(r,t))switch(t){case"Geometry":try{n=this.parseGeometry(r)}catch(e){GeoGlobe.Console.error(e)}break;case"Feature":try{(n=this.parseFeature(r)).type="Feature"}catch(e){GeoGlobe.Console.error(e)}break;case"FeatureCollection":switch(n=[],r.type){case"Feature":try{n.push(this.parseFeature(r))}catch(e){n=null,GeoGlobe.Console.error(e)}break;case"FeatureCollection":for(var o=0,a=r.features.length;o=1&&(s=n.tileMatrixSets[r.tileMatrixSetLinks[0].tileMatrixSet]);if(!s)throw new Error("matrixSet not found");for(o=0,a=r.styles.length;o=1&&(s=n.tileMatrixSets[r.tileMatrixSetLinks[0].tileMatrixSet]);if(!s)throw new Error("matrixSet not found");var c=[];i.styleName&&""!==i.styleName?c[0]=i.styleName:this.GetStyleName((function(e){c=e}));var u=i.requestEncoding;u||(u="KVP",t.operationsMetadata.GetTile.dcp.http);var h=[],f=i.params||{};delete i.params;for(var d=0,g=r.dimensions.length;d0&&(f.prefix=d[0]),r.layers.push(f),void 0===f.formats&&(f.formats=g.getmap.formats),void 0===f.infoFormats&&p&&(f.infoFormats=p.formats)}},Attribution:function(e,t){t.attribution={},this.readChildNodes(e,t.attribution)},LogoURL:function(e,t){t.logo={width:e.getAttribute("width"),height:e.getAttribute("height")},this.readChildNodes(e,t.logo)},Style:function(e,t){var i={};t.styles.push(i),this.readChildNodes(e,i)},LegendURL:function(e,t){var i={width:e.getAttribute("width"),height:e.getAttribute("height")};t.legend=i,this.readChildNodes(e,i)},MetadataURL:function(e,t){var i={type:e.getAttribute("type")};t.metadataURLs.push(i),this.readChildNodes(e,i)},DataURL:function(e,t){t.dataURL={},this.readChildNodes(e,t.dataURL)},FeatureListURL:function(e,t){t.featureListURL={},this.readChildNodes(e,t.featureListURL)},AuthorityURL:function(e,t){var i=e.getAttribute("name"),r={};this.readChildNodes(e,r),t.authorityURLs[i]=r.href},Identifier:function(e,t){var i=e.getAttribute("authority");t.identifiers[i]=this.getChildValue(e)},KeywordList:function(e,t){this.readChildNodes(e,t)},SRS:function(e,t){t.srs[this.getChildValue(e)]=!0}}},CLASS_NAME:"GeoGlobe.Format.WMSCapabilities.v1"}),GeoGlobe.Format.WMSCapabilities.v1_1=GeoGlobe.Class4OL(GeoGlobe.Format.WMSCapabilities.v1,{readers:{wms:GeoGlobe.Util.applyDefaults({WMT_MS_Capabilities:function(e,t){this.readChildNodes(e,t)},Keyword:function(e,t){t.keywords&&t.keywords.push(this.getChildValue(e))},DescribeLayer:function(e,t){t.describelayer={formats:[]},this.readChildNodes(e,t.describelayer)},GetLegendGraphic:function(e,t){t.getlegendgraphic={formats:[]},this.readChildNodes(e,t.getlegendgraphic)},GetStyles:function(e,t){t.getstyles={formats:[]},this.readChildNodes(e,t.getstyles)},PutStyles:function(e,t){t.putstyles={formats:[]},this.readChildNodes(e,t.putstyles)},UserDefinedSymbolization:function(e,t){var i={supportSLD:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("SupportSLD")),userLayer:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("UserLayer")),userStyle:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("UserStyle")),remoteWFS:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("RemoteWFS"))};t.userSymbols=i},LatLonBoundingBox:function(e,t){t.llbbox=[_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("minx")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("miny")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("maxx")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("maxy"))]},BoundingBox:function(e,t){var i=GeoGlobe.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[e,t]);i.srs=e.getAttribute("SRS"),t.bbox[i.srs]=i},ScaleHint:function(e,t){var i=e.getAttribute("min"),r=e.getAttribute("max"),n=Math.pow(2,.5),o=GeoGlobe.INCHES_PER_UNIT.m;0!==i&&(t.maxScale=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()((i/n*o*GeoGlobe.DOTS_PER_INCH).toPrecision(13))),r!==Number.POSITIVE_INFINITY&&(t.minScale=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()((r/n*o*GeoGlobe.DOTS_PER_INCH).toPrecision(13)))},Dimension:function(e,t){var i={name:e.getAttribute("name").toLowerCase(),units:e.getAttribute("units"),unitsymbol:e.getAttribute("unitSymbol")};t.dimensions[i.name]=i},Extent:function(e,t){var i=e.getAttribute("name").toLowerCase();if(i in t.dimensions){var r=t.dimensions[i];r.nearestVal="1"===e.getAttribute("nearestValue"),r.multipleVal="1"===e.getAttribute("multipleValues"),r.current="1"===e.getAttribute("current"),r.default=e.getAttribute("default")||"";var n=this.getChildValue(e);r.values=n.split(",")}}},GeoGlobe.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"GeoGlobe.Format.WMSCapabilities.v1_1"}),GeoGlobe.Format.WMSCapabilities.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Format.WMSCapabilities.v1_1,{version:"1.1.0",readers:{wms:GeoGlobe.Util.applyDefaults({SRS:function(e,t){for(var i=this.getChildValue(e).split(/ +/),r=0,n=i.length;r=1&&(a=r.tileMatrixSets[i.tileMatrixSetLinks[0].tileMatrixSet]);if(!a)throw new Error("matrixSet not found");for(n=0,o=i.styles.length;n=1&&(a=r.tileMatrixSets[i.tileMatrixSetLinks[0].tileMatrixSet]);if(!a)throw new Error("matrixSet not found");for(n=0,o=i.styles.length;n0&&this.runChildNodes(i,t[0]),i},runChildNodes:function(e,t,i){for(var r,n,o=t.childNodes,a=0;a/g,"/>")).replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,""),t.sort||(t=t.split(","));var r=this.no_fast_endings(e);r=this.attris_to_tags(r),r=(r=escape(r)).split("%3C").join("<").split("%3E").join(">").split("%3D").join("=").split("%22").join('"');for(var n=0;n","g"),"*$**"+t[n]+"**$*")).replace(new RegExp("","g"),"*$***"+t[n]+"**$*");r=""+r+"",this.xmlobject={};var o=this.xml_to_object(r).JSONTAGWRAPPER;return i&&(o=this.show_json_structure(o,i)),o},xml_to_object:function xml_to_object(xmlcode){var x=xmlcode.replace(/<\//g,"?");x=x.split("<");for(var y=[],level=0,opentags=[],i=1;i")[0];for(opentags.push(tagname),level++,y.push(level+"<"+x[i].split("?")[0]);x[i].indexOf("?"+opentags[opentags.length-1]+">")>=0;)level--,opentags.pop()}for(var oldniva=-1,objname="this.xmlobject",i=0;i")[0];tagnamn=tagnamn.replace(/%3A/,"_");var rest=y[i].split(">")[1];if(niva<=oldniva)for(var tabort=oldniva-niva+1,j=0;j")),"'"===rest.charAt(0)&&(rest="unescape("+rest+")"),already&&!eval(objname+".sort")&&(preeval+=objname+"=["+objname+"];\n");var before="=";after="",already&&(before=".push(",after=")");var toeval=preeval+objname+before+rest+after;eval(toeval),eval(objname+".sort")&&(objname+="["+eval(objname+".length-1")+"]"),oldniva=niva}return this.xmlobject},show_json_structure:function(e,t,i){var r="";for(var n in e.sort?r+="[\n":r+="{\n",e)e.sort||(r+=n+":"),"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(e[n])?r+=this.show_json_structure(e[n],!1,1):"function"==typeof e[n]?r+=e[n]+"":"string"!=typeof e[n]?r+=e[n]+",\n":r+="'"+e[n].replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")+"',\n";if(e.sort?r+="],\n":r+="},\n",!i){var o=(r=(r=(r=r.substring(0,r.lastIndexOf(","))).replace(new RegExp(",\n}","g"),"\n}")).replace(new RegExp(",\n]","g"),"\n]")).split("\n");r="";var a=0;for(n=0;n=0||o[n].indexOf("]")>=0)&&a--,tabs="";for(var s=0;s=0||o[n].indexOf("[")>=0)&&a++}"html"===t&&(r=(r=r.replace(//g,">")).replace(/\n/g,"
").replace(/\t/g,"    ")),"compact"===t&&(r=r.replace(/\n/g,"").replace(/\t/g,""))}return r},no_fast_endings:function(e){e=e.split("/>");for(var t=1;t"+e[t]}return e.join("")},attris_to_tags:function(e){var t=" =\"'".split("");e=e.split(">");for(var i=0;i")).replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2"/g,">").replace(/"0)for(var r=0,n=i.length;r0)for(var r=0,n=i.length;r/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function r(e,t,i,r){for(var n=0;n0&&r(e.arrayAccessFormPaths,t,i,n)&&(t[i]=[t[i]])}function o(e){var t=e.split(/[-T:+Z]/g),i=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(i.setHours(t[3],t[4],r[0]),r.length>1&&i.setMilliseconds(r[1]),t[6]&&t[7]){var n=60*t[6]+Number(t[7]);n=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*n:n),i.setMinutes(i.getMinutes()-n-i.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(i=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())));return i}function a(t,i,n,o){return!(1===i&&e.xmlElementsFilter.length>0)||r(e.xmlElementsFilter,t,n,o)}function s(i,x){if(9===i.nodeType){for(var l=new Object,c=i.childNodes,u=0;u0){var a=n.split(".#")[0];return r(e.datetimeAccessFormPaths,t,i,a)?o(t):t}return t}(l.__text,f,x+"."+f)),null!==l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"===e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0===l.__cnt&&"text"===e.emptyNodeForm?l="":1===l.__cnt&&null!==l.__text?l=l.__text:1!==l.__cnt||null===l.__cdata||e.keepCData?l.__cnt>1&&null!==l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""===l.__text||""===l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null===l.__text&&null===l.__cdata||(l.toString=function(){return(null!==this.__text?this.__text:"")+(null!==this.__cdata?this.__cdata:"")}),l}if(3===i.nodeType||4===i.nodeType)return i.nodeValue}function x(t,r,n,o){var a="<"+(null!==t&&null!==t.__prefix?t.__prefix+":":"")+r;if(null!==n)for(var s=0;s":">")}function l(e,t){return""}function c(t,i){return"property"===e.arrayAccessForm&&(n="_asArray",-1!==(r=i.toString()).indexOf(n,r.length-n.length))||0===i.toString().indexOf(e.attributePrefix)||0===i.toString().indexOf("__")||t[i]instanceof Function;var r,n}function u(e){var t=0;if(e instanceof Object)for(var i in e)c(e,i)||t++;return t}function h(t){var i=[];if(t instanceof Object)for(var r in t)-1===r.toString().indexOf("__")&&0===r.toString().indexOf(e.attributePrefix)&&i.push(r);return i}function f(t){var r,n,o="";return t instanceof Object?o+=(n="",null!==(r=t).__cdata&&(n+=""),null!==r.__text&&(e.escapeMode?n+=i(r.__text):n+=r.__text),n):null!==t&&(e.escapeMode?o+=i(t):o+=t),o}function d(e,t){return""===e?t:e+"."+t}function g(e,t,i,r){var n="";if(0===e.length)n+=x(e,t,i,!0);else for(var o=0;o0)for(var m in t)if(!c(t,m)&&(""===i||(n=t,o=m,a=d(i,m),0===e.jsonPropertiesFilter.length||""===a||r(e.jsonPropertiesFilter,n,o,a)))){var b=t[m],v=h(b);null===b||null===b?s+=x(b,m,v,!0):b instanceof Object?b instanceof Array?s+=g(b,m,v,i):b instanceof Date?(s+=x(b,m,v,!1),s+=b.toISOString(),s+=l(b,m)):u(b)>0||null!==b.__text||null!==b.__cdata?(s+=x(b,m,v,!1),s+=p(b,d(i,m)),s+=l(b,m)):s+=x(b,m,v,!0):(s+=x(b,m,v,!1),s+=f(b),s+=l(b,m))}return s+f(t)}this.parseXmlString=function(e){var t,i=window.ActiveXObject||"ActiveXObject"in window;if(void 0===e)return null;if(window.DOMParser){var r=new window.DOMParser,n=null;if(!i)try{n=r.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){n=null}try{t=r.parseFromString(e,"text/xml"),null!==n&&t.getElementsByTagNameNS(n,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0===e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?o(e):e},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!==t?this.xml2json(t):null},this.json2xml_str=function(e){return p(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},e.GeoGlobe.Format.X2JS.CLASS_NAME="GeoGlobe.Format.X2JS"}(window),GeoGlobe.Query.Service=GeoGlobe.Class4OL({name:null,url:null,version:null,userid:"test@liferay.com",initialize:function(e,t,i){this.name=e,this.url=t,GeoGlobe.Util.extend(this,i)},getCapabilities:function(e,t){},isExist:function(){},failFn:function(e){alert("服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+this.url+"\n操作类型:"+e)},_parseToXML:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),(new GeoGlobe.Format.XML).read(t)},_checkIsError:function(e){return(new GeoGlobe.Format.XML).read(e).selectNodes("ServiceExceptionReport").length>0?this._parseToJSON(e):null},_isException:function(e){return!(!e||!e.ServiceExceptionReport)},_parseToJSON:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},CLASS_NAME:"GeoGlobe.Query.Service"}),GeoGlobe.Query.RouteQuery=GeoGlobe.Class4OL(GeoGlobe.Query.Service,{_format:null,initialize:function(e,t,i){this.name=e,this.url=t,this._format=new GeoGlobe.Format.RouteQuery,GeoGlobe.Util.extend(this,i)},getCapabilities:function(e,t){var i=this.url;GeoGlobe.loadURL(i,{REQUEST:"GetCapabilities"},this,e,t)},findRoute:function(e,t,i){var r={REQUEST:"FindRoute",SERVICE:"ROUTE",VERSION:"1.0.0"};for(var n in{data:!0,orig:!0,dest:!0})if(!(n in e))throw new Error("Missing property '"+n+"'");r.DATA=e.data,r.ORIG=e.orig,r.DEST=e.dest,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.radius&&void 0!==e.radius&&(r.RADIUS=e.radius),null!==e.queryType&&void 0!==e.queryType&&(r.QUERYTYPE=e.queryType),null!==e.midpos&&void 0!==e.midpos&&(r.MIDPOS=e.midpos),null!==e.avoidPos&&void 0!==e.avoidPos&&(r.AVOIDPOS=e.avoidPos),null!==e.filterRoute&&void 0!==e.filterRoute&&(r.FILTERROUTE=e.filterRoute),null!==e.resultCount&&void 0!==e.resultCount&&(r.RESULTCOUNT=e.resultCount),GeoGlobe.Request.GET({url:this.url,params:r,async:!1,scope:this,success:function(e){var i=this._format.read(e.responseText);if("string"!=typeof i.exceptionInfo){var r=new GeoGlobe.Query.RoutesResult(i),n=r.routes,o=(new GeoGlobe.Format.GeoJSON).write(n),a=new GeoGlobe.Format.JSON;geojsonRoute=a.read(o),r.geojsonRoute=geojsonRoute,t(r)}else t(i)},failure:i})},getRouteInfo:function(e,t,i){var r={REQUEST:"GetRouteInfo",SERVICE:"ROUTE",VERSION:"1.0.0"};if(!e.data||!e.id)throw"Error!Not data and id for bus query.";r.DATA=e.data,r.ID=e.id,GeoGlobe.Request.GET({url:this.url,params:r,scope:this,success:function(e){var i=this._format.read(e.responseText);"string"!=typeof i.exceptionInfo?(i=new GeoGlobe.Query.RouteInfoResult(i),t(i)):t(i)},failure:i})},CLASS_NAME:"GeoGlobe.Query.RouteQuery"}),GeoGlobe.Format.RouteQuery=new GeoGlobe.Class4OL(GeoGlobe.Format.XML,{initialize:function(e){GeoGlobe.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){var t={},i=[];if("string"==typeof e&&(e=GeoGlobe.Format.XML.prototype.read.apply(this,[e])),e&&9===e.nodeType){i=[];var r=GeoGlobe.Format.XML.prototype.getChildEl.apply(this,[e]).nodeName;if("ServiceExceptionReport"===r){var n=GeoGlobe.Format.XML.prototype.getElementsByTagNameNS(e,"*","ServiceException")[0];return{exceptionInfo:GeoGlobe.Format.XML.prototype.getChildValue.apply(this,[n]),exceptionCode:n.getAttribute("code")}}for(var o=e.getElementsByTagName(r)[0].childNodes,a=0;a0){for(var n=r.split(" "),o=[],a=0,s=n.length;a0){for(var n=r.split(" "),o=[],a=0,s=n.length;a"+(t=t||this.maxPerPage)+""+(e=e||1)+""},_orderByToString:function(e,t){return e?""+e+"":""},_geometryToString:function(e){return'20,30 21,41 52,42 53,33 20,30'},_stringToGeometry:function(e){return GeoGlobe.Geometry.Polygon.createRegularPolygon(new GeoGlobe.Geometry.Point(360*Math.random()-160,90*Math.random()-70),Math.round(20*Math.random()),Math.round(10*Math.random()))},_parserFeatures:function(e){var t=new GeoGlobe.Format.GML;return t.gmlns="*",t.read(e)},_parserResponseText:function(e,t){if(t){var i=new RegExp("<"+t+">",["g"]),r=new RegExp("",["g"]);e=(e=e.replace(i,"<"+t+">")).replace(r,"")}return(e=(e=(e=e.replace(//g,"")).replace(/<\/gml:LineString>/g,"")).replace(//g,"")).replace(/<\/gml:Point>/g,"")},_parserFeaturesNew:function(e,t){var i=new GeoGlobe.Format.GML;return i.gmlns="*",t&&(i.featureName=t),i.read(e)},_parserSuccessResult:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},_parseToXML:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),(new GeoGlobe.Format.XML).read(t)},_parseToJSON:function(e){return(new GeoGlobe.Format.XML2JSON).read(e)},queryTransferScheme:function(e,t,i){var r={request:"QueryTransferScheme",SERVICE:"BUS",VERSION:"1.0.0"};for(var n in{networkName:!0,transferMode:!0,startInput:!0,endInput:!0})if(!(n in e))throw new Error("缺少必选属性:'"+n+"'。");r.networkName=e.networkName,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.transferMode&&void 0!==e.transferMode&&(r.TRANSFERMODE=e.transferMode),null!==e.startInput&&void 0!==e.startInput&&(r.STARTINPUT=e.startInput),null!==e.endInput&&void 0!==e.endInput&&(r.ENDINPUT=e.endInput),null!==e.inputMode&&void 0!==e.inputMode&&(r.INPUTMODEL=e.inputMode),null!==e.ExistGoTime&&void 0!==e.ExistGoTime&&(r.EXISTGOTIME=e.ExistGoTime),null!==e.StartTime&&void 0!==e.StartTime&&(r.STARTTIME=e.StartTime),null!==e.MaxSearchDistance&&void 0!==e.MaxSearchDistance&&(r.MAXSEARCHDISTANCE=e.MaxSearchDistance),null!==e.PrioritySubset&&void 0!==e.PrioritySubset&&(r.PRIORITYSUBSET=e.PrioritySubset),null!==e.ExistAbsolutePriority&&void 0!==e.ExistAbsolutePriority&&(r.EXISTABSOLUTEPRIORITY=e.ExistAbsolutePriority),null!==e.LagSubset&&void 0!==e.LagSubset&&(r.LAGSUBSET=e.LagSubset),null!==e.OutputPage&&void 0!==e.OutputPage&&(r.OUTPUTPAGE=e.OutputPage),null!==e.PageSize&&void 0!==e.PageSize&&(r.PAGESIZE=e.PageSize),null!==e.ChangeCount&&void 0!==e.ChangeCount&&(r.CHANGECOUNT=e.ChangeCount),GeoGlobe.Request.GET({url:this.url,params:r,async:!1,scope:this,success:GeoGlobe.Function.bind((function(e){var i=e.responseXML,r={startPoint:[],transferScheme:[],endPoint:[]};if(!i)return t(r),r;var n=new GeoGlobe.Format.XML,o=i.selectNodes("/ServiceExceptionReport/ServiceExceptionMessage");if(o&&o.length>0)return t(r),r;var a=i.selectNodes("/QueryTransferSchemeResponse"),s=n.write(a[0]),x=this._parseToJSON(s),l=x.QueryTransferSchemeResponse.StartPoint;GeoGlobe.Util.isArray(l)||(l=[l]);var c=x.QueryTransferSchemeResponse.EndPoint;GeoGlobe.Util.isArray(c)||(c=[c]);var u=x.QueryTransferSchemeResponse.TransferScheme,h=this._getPointGeometryByGMLPointStr(l[0].Geometry.gml_Point),f=new GeoGlobe.Feature(h),d=this._getPointGeometryByGMLPointStr(c[0].Geometry.gml_Point),g=new GeoGlobe.Feature(d),p=this._parserTransferScheme(u);t(r={startPoint:f,transferScheme:p,endPoint:g})}),this),failure:i})},_parserTransferScheme:function(e){GeoGlobe.Util.isArray(e)||(e=[e]);for(var t=new Array,i=0;i0)return r;var a=i.selectNodes("/QueryKeyWordResponse"),s=n.write(a[0]),x=this._parseToJSON(s);if(1===t){var l=x.QueryKeyWordResponse.Stations.Station;l&&!GeoGlobe.Util.isArray(l)&&(l=[l]);for(var c=0;c0){var o=t.write(r[0]);n=this._parseToJSON(o).Lines.Line,GeoGlobe.Util.isArray(n)||(n=[n])}return n;case"Passageways":r=i.selectNodes("/QueryStationInfoResponse");var a=new Array;if(r.length>0){o=t.write(r[0]);var s=this._parseToJSON(o).QueryStationInfoResponse.StationInfo.Passageways;s&&(a=s.Passageway,GeoGlobe.Util.isArray(a)||(a=[a]))}return a;default:return[]}},queryLineInfo:function(e,t,i){var r={REQUEST:"QueryLineInfo",SERVICE:"BUS",VERSION:"1.0.0"};if(!e.networkName)throw"Error!Not network name for bus query.";if(null===e.lineId||void 0===e.lineId||""===e.lineId)throw"Error!Not lineId for bus query.";r.NETWORKNAME=e.networkName,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.lineId&&void 0!==e.lineId&&(r.LINEID=e.lineId),null!==e.startNodeNumber&&void 0!==e.startNodeNumber&&(r.STARTNODENUMBER=e.startNodeNumber),null!==e.endNodeNumber&&void 0!==e.endNodeNumber&&(r.ENDNODENUMBER=e.endNodeNumber),GeoGlobe.Request.GET({url:this.url,params:r,scope:this,success:function(e){var i=[],r=null;if(e.responseXML){var n=(r=e.responseXML).selectNodes("/ServiceExceptionReport/ServiceExceptionMessage");if(n&&n.length>0)return void t(i);for(var o=new GeoGlobe.Format.XML,a=this._parserQueryLineInfoNode("Line",o,r),s=new Array,x=0;x0)return t(r),r;var o=this._parserResponseText(e.responseText);r=this._parserFeaturesNew(o,"Stations"),t(r)}})},_queryByName:function(e,t,i){var r=this,n=null;return r.queryKeyWord({networkName:r.networkName,keyWord:e,keyWordType:1,SEARCHTYPE:2},(function(e){if(0!==e.length){var o=e[0].geometry.x+" "+e[0].geometry.y;r.queryKeyWord({networkName:r.networkName,keyWord:t,keyWordType:1,SEARCHTYPE:2},(function(e){if(0!==e.length){var t=e[0].geometry.x+" "+e[0].geometry.y;n=r._queryTransferScheme(o,t,i)}else alert("没有查询到终点")}))}else alert("没有查询到起点")})),n},queryBus:function(e,t,i){var r=this,n=null;return r.getCapabilities(GeoGlobe.Function.bind((function(o){var a=o.responseXML;a&&a.documentElement||(a=o.responseText);var s=(new GeoGlobe.Format.BusCapabilities).read(a);if(s.capability){var x=s.capability.networks[0];if(r.networkName=x,"string"==typeof e&&"string"==typeof t)n=r._queryByName(e,t,i);else{var l=e.lng+" "+e.lat,c=t.lng+" "+t.lat;n=r._queryTransferScheme(l,c,i)}}else alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")}),this),(function(){alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")})),{flag:!!n,featuresInfo:n}},failFn:function(){alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")},_queryTransferScheme:function(e,t,i){return this.queryTransferScheme({networkName:this.networkName,transferMode:i||0,inputMode:0,startInput:e,endInput:t},(function(e){featuresInfo=e})),this.transferScheme=featuresInfo.transferScheme,featuresInfo},queryBusTransferSchemeByIndex:function(e){var t=null,r=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e),n=this.transferScheme[r].SectionInfo,o=new Array,a=new Array;for(i=0;i0?i[0]:null},Element.prototype.selectSingleNode=function(e){if(this.ownerDocument.selectSingleNode)return this.ownerDocument.selectSingleNode(e,this);throw"For XML Elements Only"}),GeoGlobe.Query.WFSQuery=GeoGlobe.Class4OL({url:null,version:"1.0.0",featureNS:null,isReverse:!1,featurePrefix:"",featureType:"",maxFeatures:10,filter:null,geometryName:"the_geom",protocol:null,format:null,formatOptions:null,isSeparate:!1,srsName:"EPSG:4326",time:null,userecent:!0,sortBy:null,groupBy:null,resultType:"Results",startPosition:null,initialize:function(e,t,i){this.url=e,this.featureType=t;var r=null;i&&(!0===i.isReverse||!1===i.isReverse?(this.isReverse=i.isReverse,r=!i.isReverse):r=!this.isReverse,i.format?(i.format instanceof GeoGlobe.Format.GML.v2||i.format instanceof GeoGlobe.Format.GML.v3)&&i.format.setFeatureType_(t):this.format=new GeoGlobe.Format.GML({xy:r})),GeoGlobe.Util.extend(this,i)},query:function(e,t,i){this.protocol=new GeoGlobe.Protocol.WFS({readFormat:this.format,formatOptions:this.formatOptions,propertyNames:this.propertyNames,maxFeatures:this.maxFeatures,featurePrefix:this.featurePrefix,featureNS:this.featureNS,url:this.url,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent,srsName:this.srsName});var r=e||this.filter,n=t||this.successFn,o=i||this.failFn,a=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;this.isSeparate&&(t=this._separateFeatures(t));var i=this._read_trueName(e);i&&(t.trueNames=i);var r=(new GeoGlobe.Format.GeoJSON).write(t),a=(new GeoGlobe.Format.JSON).read(r);n({features:t,geojson:a})}else o()}),this);this.response=this.protocol.read({sortBy:this.sortBy,filter:r,callback:a})},queryPage:function(e,t,i,r){var n=r&&r.perPageNumber||15,o=((r&&r.pageNumber||1)-1)*n+1;this.protocol=new GeoGlobe.Protocol.WFS({readFormat:this.format,multi:!0,formatOptions:this.formatOptions,propertyNames:this.propertyNames,maxFeatures:n,startPosition:o,featurePrefix:this.featurePrefix,url:this.url,featureNS:this.featureNS,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent,srsName:this.srsName});var a=e||this.filter,s=t||this.successFn,x=i||this.failFn,l=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;this.isSeparate&&(t=this._separateFeatures(t));var i=this._read_trueName(e);t.trueNames=i;var r=(new GeoGlobe.Format.GeoJSON).write(t),n=(new GeoGlobe.Format.JSON).read(r);s({features:t,geojson:n})}else x()}),this);this.response=this.protocol.read({sortBy:this.sortBy,filter:a,callback:l})},queryTotalNumber:function(e,t,i){var r=new GeoGlobe.Format.WFSHits;this.protocol=new GeoGlobe.Protocol.WFS({readFormat:r,propertyNames:this.propertyNames,resultType:"hits",maxFeatures:this.maxFeatures,featurePrefix:this.featurePrefix,featureNS:this.featureNS,url:this.url,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent});var n=e||this.filter,o=t||this.successFn,a=i||this.failFn,s=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;o(t)}else a()}),this);this.response=this.protocol.read({filter:n,callback:s})},_read_trueName:function(e){var t=[];if(e.priv&&e.priv.responseText){if(null===this.format)return null;var i=this.format.getXMLDoc().getElementsByTagName("trueName");if(null===i||0===i.length)return null;for(var r=0;r0){t=new GeoGlobe.LngLatBounds;for(var i=null,r=0,n=e.length;r0&&(i=e.results)&&(t.results=this._analysis_GeoCodeResult_statistics(i))}return t},_analysis_GeoCodeResult_results:function(e){var t=[];if(GeoGlobe.Util.isArray(e)){for(var i=0,r=e.length;i0?this._parseToJSON(e):null},_isException:function(e){return!(!e||!e.ServiceExceptionReport)},_parseToJSON:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},CLASS_NAME:"GeoGlobe.Service"}),GeoGlobe.Service.WFST=GeoGlobe.Class4OL(GeoGlobe.Service,{xy:!0,initialize:function(e,t,i){GeoGlobe.Service.prototype.initialize.apply(this,arguments)},getCapabilities:function(e,t){var i=this.url,r={REQUEST:"GetCapabilities",SERVICE:"WFS",VERSION:"1.0.0"};t||(t=function(){this.failFn(r.REQUEST)}),GeoGlobe.loadURL(i,r,this,(function(t){e(t)}),t)},isExist:function(){var e=!1,t=this.url;return GeoGlobe.Request.GET({url:t,params:{REQUEST:"GetCapabilities",SERVICE:"WFS"},scope:this,async:!1,success:function(){e=!0}}),e},describeFeatureType:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"WFS",VERSION:"1.0.0",REQUEST:"DescribeFeatureType"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(e){t(e)}),i)},getFeature:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"WFS",VERSION:"1.0.0",REQUEST:"GetFeature"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(e){t(e)}),i)},lockFeature:function(e,t,i){this.url,GeoGlobe.Util.applyDefaults(e,{service:"WFS",version:"1.0.0",request:"LockFeature",expiry:1,lockAction:"ALL"});var r=this._parserFilterToString(e.filter),n=GeoGlobe.String.format('${filterXMLString}',{version:e.version,service:e.service,lockAction:e.lockAction,expiry:e.expiry,typeName:e.typeName,filterXMLString:r});i||(i=function(){this.failFn(e.request)}),new GeoGlobe.Request.POST({url:this.url,data:n,scope:this,success:t,failure:i})},transaction:function(e,t,i,r,n,o){var a=this.url;GeoGlobe.Util.applyDefaults(e,{service:"WFS",version:"1.0.0",request:"Transaction",releaseAction:"ALL"});var s=e.lockId,x="";s&&(x+=""+s+"");var l="";t&&(l+=this._getInsertString(t)),i&&(l+=this._getUpdateString(i)),r&&(l+=this._getDeleteString(r));var c=GeoGlobe.String.format('${lockIdString}${transactionString}',{releaseAction:e.releaseAction,version:e.version,service:e.service,lockIdString:x,transactionString:l});o||(o=function(){this.failFn(e.request)}),new GeoGlobe.Request.POST({url:a,data:c,scope:this,success:n,failure:o})},parseTransactionResult:function(e){var t=(new GeoGlobe.Format.XML2JSON).read(e.responseText),i=new Array,r=this._objToArray(t.wfs_WFS_TransactionResponse.wfs_TransactionResult.wfs_Status),n=this._objToArray(t.wfs_WFS_TransactionResponse.wfs_InsertResults);if(!r)return i;for(var o=0;o'+this._getInsertFeatureString(o,i)+""}return r},_getInsertFeatureString:function(e,t){var i="";for(var r in e.attributes)"OID"!==r&&(i+=GeoGlobe.String.format("<${tag}>",{value:e.attributes[r]?e.attributes[r]:"",tag:r}));return i+=GeoGlobe.String.format("${geometry}",{geometry:this._getGeometryStringByFeature(e)}),GeoGlobe.String.format("<${typeName}>${content}",{typeName:t,content:i})},_getUpdateString:function(e){e.filter;for(var t=e.typeName,i=e.features,r="",n=0;n'+o+this._parserFilterToString(a)+""}return r},_getUpdatePropertyString:function(e){var t="";for(var i in e.data)"OID"!==i&&e.data[i]&&(t+="");return t+"Geometry"+this._getGeometryStringByFeature(e)+""},_getGeometryStringByFeature:function(e){var t=new GeoGlobe.Format.GML({xy:this.xy});t.buildCoordinatesNode=GeoGlobe.Function.bind((function(e){var t=this.createElementNS(this.gmlns,"gml:coordinates");t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," ");var i=[];if(e instanceof GeoGlobe.LngLatBounds)this.xy?(i.push(e.left+","+e.bottom),i.push(e.right+","+e.top)):(i.push(e.bottom+","+e.left),i.push(e.top+","+e.right));else for(var r=e.components?e.components:[e],n=0;n';var o=new GeoGlobe.Filter.FeatureId({fids:[t.fids[n]]});r+=this._parserFilterToString(o),r+=""}return r},_parserFilterToString:function(e){if(e){var t=(new GeoGlobe.Format.Filter.v1).write(e);return(new GeoGlobe.Format.XML).write(t)}return""},CLASS_NAME:"GeoGlobe.Service.WFST"}),GeoGlobe.Service.CTS=GeoGlobe.Class4OL(GeoGlobe.Service,{initialize:function(e,t,i){GeoGlobe.Service.prototype.initialize.apply(this,arguments)},getCapabilities:function(e,t){var i=this.url,r={REQUEST:"GetCapabilities",SERVICE:"CTS"};t||(t=function(){this.failFn(r.REQUEST)}),GeoGlobe.loadURL(i,r,this,(function(t){e(t)}),t)},isExist:function(){var e=!1,t=this.url;return GeoGlobe.Request.GET({url:t,params:{REQUEST:"GetCapabilities",SERVICE:"CTS"},scope:this,async:!1,success:function(){e=!0}}),e},TransCoords:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"CTS",REQUEST:"TransCoords"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(i){if("xml"===e.FORMAT){var r={},n=i.responseXML;GeoGlobe.Function.bind(this.xmltoJson,this);var o=this.xmltoJson(n);r.attributes=o.CTS_TransResult["cts:Coordinate"].attributes.dim;for(var a=o.CTS_TransResult["cts:Coordinate"].text.split(","),s=[],x=0;x0){t.attributes={};for(var i=0;i0){t.attributes={};for(var i=0;i0)for(var c=0,u=l.length;c0){t.attributes={};for(var i=0;iBufferInputPolygon'+(new GeoGlobe.Format.GML).write(e)+"BufferDistance"+t+"BufferType"+this.type+"BufferAccuracy"+this.accuracy+"BufferedPolygon"},_getFeaturesCenter:function(e){return this._getFeaturesExtent(e).getCenterLonLat()},_getFeaturesExtent:function(e){GeoGlobe.Util.isArray(e)||(e=[e]);var t=null;if(e&&e.length>0){t=new GeoGlobe.LngLatBounds;for(var i=null,r=0,n=e.length;rsourceMaxZoom){var a=[0,0,4096,4096],i=o-sourceMaxZoom,p=r-(r>>i<>i<Click to add first point

","random",")

","

Double click to finish drawing

","LEFT_DOUBLE_CLICK","cartographicArrayToCartesianArray","Rectangle","northwest","southwest","startDrawingTailedAttack","firstTime","test","

点击以增加第一个控制点

","单击以增加一个新的控制点","poly","

双击可结束绘制

","startDrawingExtent","ExtentPrimitive","

拖动改变箭头

再次点击结束绘制

","setEditable","_editable","executeListeners","dragEnd","_highlighted","_strokeColor","fromCssColorString","white","_markers","onEdited","EllipsoidGeodesic","interpolateUsingFraction","billBoard","removeBillboard","index","Drag to create a new point","_editMarkers","_globeClickhandler","Extent","cartesianArrayToCartographicArray","doubleArrow","拖动以钳击形状","PolygonPrimitive单击","拖动以改变形状","TailedAttackPrimitive单击","DrawHelperWidget","Container is required","./img/glyphicons_242_google_maps.png","./img/glyphicons_097_vector_path_line.png","./img/qianjijiantou.png","./img/glyphicons_095_vector_path_circle.png","./img/zhijiaojiantou.png","DIV","button","title","onclick","SPAN","IMG","extentIcon","点击以绘制直箭头","extentCreated","点击以绘制钳击箭头","polygonCreated","点击以绘制攻击箭头","tailedAttackCreated","clearIcon","addToolbar","ClearWidget","DrawWidget","west","east","south","north","EPSILON7","pow","toFixed","twipsy-arrow","twipsy-inner","_div","block","none","_title","undefined","constructor","_listeners","addListener","getCircleCenterOfThreePoints","getIntersectPoint","getAzimuth","getPointOnLine","getCubicValue","getArcPoints","FITTING_COUNT","getBisectorNormals","ZERO_TOLERANCE","getCurvePoints","getLeftMostControlPoint","getRightMostControlPoint","getNormal","getBinomialFactor","getFactorial","getQuadricBSplineFactor","MeasureAreaWidget","tags","tag","userAgent","MeasureAreaWidget_draw_point","WHITE","MeasureAreaWidget_draw_label","measureEnd","selectFeatures","indexOf","polygon","YELLOW","delete","MeasureAreaWidget_draw_polygon","MeasureAreaWidget_","area","km²","MeasureAzimuthWidget","hideInfobox","MeasureAzimuthWidget_result_label","FILL_AND_OUTLINE","18px KaiTi","CADETBLUE","Cesium3DTileset","warn","单击结束绘制","MeasureAzimuthWidget_draw_polyline","MeasureAzimuthWidget_","PolylineArrowMaterialProperty","AQUA","_polylineGraphicsAzimuth","PolylineDashMaterialProperty","_polylineGraphicsNorth","polyline","point","coordinates","12px sans-serif","角度:","showInfobox","display","selectionIndicator","infoBox","MeasureCoordinateWidget","请点击模型","MeasureCoordinateWidget_","MeasureCoordinateWidget_draw_coordinate","MeasureCoordinateWidget_result_label","经度:","纬度:","高程:","collection","MeasureDistanceWidget","MeasureDistanceWidget_draw_point","flag","!cartesian","MeasureDistanceWidget_draw_label","MeasureDistanceWidget_draw_polyline","总长:","_polylineCollection","_polyline","_primitives","MeasureDistanceWidget_result_label","lerp","MeasureElevationWidget_","高程值:","MeasureElevationWidget","MeasureElevationWidget_result_label","MeasureHeightWidget","MeasureHeightWidget_draw_point","MeasureHeightWidget_draw_polyline","GREEN","水平距离:","垂直高度:","空间距离:","result_labelHeight","MeasureHeightWidget_result_labelHeight","MeasureSlopeWidget","_camera","_canvas","_lineColor","_lineWidth","text","MeasureSlopeWidget_draw_polyline","MeasureSlopeWidget_","PolylineArrow","MeasureSlopeWidget_draw_label","单击开始绘制","atan","MeasureSlopeWidget_result_label_","LabelStyle","16px KaiTi","MeasureVolumeWidget","_designElevation","_samplingPointsNumber","samplingPointsNumber","_depthTestAgainstTerrain","depthTestAgainstTerrain","_classificationPrimitives","_pickedClassificationPrimitives","_tin","_minHeight","_maxHeight","MeasureVolumeWidget_","MeasureVolumeWidget_draw_label","_volumeResult","then","addClassificationPrimitive","addVerticalPolylines","addBasePolygon","_classificationPrimitive","BLUE","_interpolationPoints","features","_verticalPolylines","MeasureVolumeWidget_draw_vertical_polylines","properties","lineString","bboxPolygon","randomPoint","booleanPointInPolygon","ceil","FeatureCollection","Feature","Point","apply","getVolume","intersection","vertexSerial","excavationVolume","excavationArea","fillVolume","fillArea","baseArea","volume","底面积:","km³","_resultLabels","MeasureVolumeWidget_result_label_volume","getGeometryInstanceAttributes","_polylines","toValue","updateBaseElevation","updateClassificationPrimitive","体积:","updateVerticalPolylinesAndBasePolygon","ClassificationPrimitive","MeasureVolumeWidget_draw_base_polygon","miles","convex","steps","edgeWidth","edgeColor","cylinderRadius","clippingModeUnion","enabled","clippingPlanes","modelEntityClippingPlanes","computePlanes","ClippingPlane","createClippingPlanes","ClippingPlaneCollection","GeoFlood","cartesianArrayHeights","fragmentShader","normalMapUrl","createWaterFace","creatPrimitive","Water","PolygonHierarchy","VERSION","parseFloat","varying vec3 v_positionMC;\n\t\t\t\t\tvarying vec3 v_positionEC;\n\t\t\t\t\tvarying vec2 v_st;\n\t\t\t\t\t\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tczm_materialInput materialInput;\n\t\t\t\t\t\tvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\t\t\t\t\t#ifdef FACE_FORWARD\n\t\t\t\t\t\tnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\t\t\t\t\t#endif\n\t\t\t\t\t\tmaterialInput.s = v_st.s;\n\t\t\t\t\t\tmaterialInput.st = v_st;\n\t\t\t\t\t\tmaterialInput.str = vec3(v_st, 0.0);\n\t\t\t\t\t\tmaterialInput.normalEC = normalEC;\n\t\t\t\t\t\tmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\t\t\t\t\t\tvec3 positionToEyeEC = -v_positionEC;\n\t\t\t\t\t\tmaterialInput.positionToEyeEC = positionToEyeEC;\n\t\t\t\t\t\tczm_material material = czm_getMaterial(materialInput);\n\t\t\t\t\t#ifdef FLAT\n\t\t\t\t\t\tgl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\t\t\t\t\t#else\n\t\t\t\t\t\tgl_FragColor = czm_phong(normalize(positionToEyeEC), material",", czm_lightDirectionEC","GeoLimitHeight","labelEntity","polygonPlaneEntity","targetHeight","labelOption","polygonPlaneOption","polygonFitOption","drawLabel","drawPolygonPlane","drawPolygonFit","clearLabelEntity","labelPosition","labelText","labelPixelOffset","labelFillColor","labelFont","18px 楷体","labelOutlineWidth","labelStyle","polygonPlanePerPositionHeight","polygonPlaneHeight","polygonPlaneMaterial","polygonPlaneOutline","polygonPlaneShow","clearPolygonFitPrimitive","polygonFitPositions","error","请输入有效的坐标数组!","polygonFitHeight","polygonFitExtrudedHeight","polygonFitColor","polygonFitPrimitive","clearAll","clearPolygonPlaneEntity","GeoPLSViewShed3D_LIGHTPOINT","GeoPLSViewShed3D_BOUNDARY","GeoPLSViewShed3D_DASHLINE","GeoPLSViewShed3D_ORIENTLINE","GeoPLSViewShed3D","groundPrimitives","_pointLightHeight","_pointLightPixelSize","pointLightPixelSize","_pointLightColor","pointLightColor","_boundaryWidth","boundaryWidth","_boundaryColor","boundaryColor","_orientLineWidth","orientLineWidth","_orientLineColor","orientLineColor","baseDEMLerpCfg","_intervalAnalysis","intervalAnalysis","_pointLightCamera","当前Cesium版本:",",点光源可视域分析暂不支持该版本,请更换至1.50以上的版本!","firstLeftClick","shadowMap","enableGeoPLSViewShed3D","_baseDEMLerpCfg","enable","angleInterval","timeInterval","num","boundaryPositionArr","startPointLng","startPointLat","startPointHgt","interpolationBase","visibleColor","invisibleColor","单击左键确定可视域位置","tipPosition","单击左键固定可视域半径","fromAlpha","视高:","半径:","BOTTOM","dynamicAnalysis","pointLightPosition","realTimeRadius","Camera","context","size","_pointLightRadius","depthBias","fromRadians","toCartesian","sort","terrainShadows","ShadowMode","ENABLED","GroundPolylineGeometry","GroundPolylinePrimitive","showBackground","backgroundColor","horizontalOrigin","verticalOrigin","pixelOffset","fillColor","outlineWidth","outlineColor","GeoProfile","getLerpValue","lng_origin","lat_origin","hgt_origin","lng_destination","lat_destination","hgt_destination","floor","samplingNum","minHeight","maxHeight","surfaceLen","YValueArray","addLenArray","lerpCoordnatesArray","drawChart","getElementById","onmousedown","clientX","onmousemove","clientY","onmouseup","init","剖面示意图","#ccc","bold","axis","
","12%","#aaa","solid","category","长度(米)","rgba(0.0, 128, 255, 0.6)","bolder","dashed","高程(米)","rgba(0.0,255.0,255.0,0.8)","setOption","table","tbody","innerHTML","起点经度:","投影距离:","起点纬度:","终点高程:","地表距离:","终点经度:","最高高程:","straightLen","最低高程:","oTable","originCoordanate","originImage","destinationCoordanate","clearChart","myChart","chartContainer","removeChild","GEOSIGHTLINE_TIP","REDLINE","GREENLINE","GeoSightline","observeRelativeHeight","targetRelativeHeight","observeImage","targetImage","objectsToExclude","observeActualPosition","targetActualPosition","observeEntity","targetEntity",",通视分析暂不支持该版本,请更换至1.50以上的版本!","destroyHandler","enableGeoSightline","pickFromRays","单击左键确定观察点","drillPickFromRay","clampToHeight","_entities","_array","GeoSkyLineVolume","skyLineShow","skylineShow","skyLineWidth","skyLineMaterial","skyLineVolumeMaterial","ORANGE","skyLineVolumeOutLine","skyLineVolumeOutLineColor","BLACK","extrudeRatio","skyLine","skyLineVolume","calculateSkyLinePositions","data","skyLinePositions","drawSkyLine","skyLineDepthFailMaterial","drawSkyLineVolume","cameraPosition","cameraHeight","天际线示意图","宽度(PX)","line","getPointDistance","interNumber","holeDepth","arrPoints","earth","sideMaterial","bottomMaterial","GeoExcavationRegion","samplingPoints","_sideMaterial","_interNumber","_depth","depth","StripeMaterialProperty","_entitys","_samplingPoints","_callback","_bottomMaterial","_vPolyline","_vertexNum","_excavationRegion","_arrayVertex","_outPoints","GeoTerrainSlope","shadingUniforms","updateMaterial","contour","spacing","selectedShading","slope","aspect","elevation","materials","elevationRampMaterial","minimumHeight","maximumHeight","contourMaterial","slopeRampMaterial","contourUniforms","ElevationContour","ElevationRamp","SlopeRamp","AspectRamp","image","getContext","createLinearGradient","#000000","addColorStop","#2747E0","#ffffff","#0a8d33","#afdd76","#f2b602","#eea706","#df7702","#a52100","#682b06","#6a2402","fillStyle","ElevationColorContour","max(contourMaterial.alpha, elevationRampMaterial.alpha)","SlopeColorContour","max(contourMaterial.alpha, slopeRampMaterial.alpha)","AspectColorContour","max(contourMaterial.alpha, aspectRampMaterial.alpha)","_ready","dirty","polys","isCartesian3Point","platSlot","content","bindTileset","_tileset","There is a tileset already, Only One Bind","platBodyDebug","tileLoad","showPlat","isPlatShow","isPlatDirty","clearPlatDirty","addPlatArea","platPickPoints","_show","getPlatArea","removePlatArea","number","_pickObject","_tile","_runtime","rootNodes","_boundingVolume","halfAxes","matOrg","createHalfMatrix","matOrgI","invertMatrix","matPrj","matPrjI","modelMatrix","computedMatrix","initBoxMatrixes","modelMatrixI","buffers","initRegionMatrixes","initializePlatPoly","buffer","byteOffset","BYTES_PER_ELEMENT","isPlatPoint","replaceCommandVertexBuffer","platPolys","toPlatBoxModel","toPlatModel","_header","boundingVolume","region","toPlatRegionModel","platModel","hitPlatTest","isUsed","toUnplatModel","platPickRegion","initPlatBodyDebug","createTileRegion","tileRegion","initializeCartographicPlatPoly","initializeCartesianPlatPoly","divideByScalar","initCompressPlane","_orientedBoundingBox","isPlatPointResult","mapPosition","compressPlane","isPlatPointNoResult","normal","isInsidedPoint","minY","isEqualFloat","_nodeCommands","BufferUsage","STATIC_DRAW","command","_vertexArray","_attributes","vertexBuffer","vertexArrayDestroyable","_vao","glDeleteVertexArray","_cachedGltf","_gltf","bufferViews","getBuffer","inverse","setColumn","createNormal","createMatrix","GEOVIEWRADAR_TIP","GEOVIEWRADAR_LIGHTPOINT","GeoViewRadar","pointLightHeight","boundingSphereStackPartitions","boundingSphereSlicePartitions","boundingSphereSubdivisions",",雷达分析暂不支持该版本,请更换至1.50以上的版本!","enableGeoViewRadar","单击左键确定雷达位置","单击左键固定雷达半径","ShadowMap","debugShow","_boundingSphere","slicePartitions","subdivisions","GEOVIEWSHED3D_TIP","GEOVIEWSHED3D_SPOTID","GeoViewShed3D","spotLightHeight","_shadowMapNum","_spotLightCameraList","expandShadowMapList","spotLightPosition","realTimeHeading","realTimePitching","realTimeDistance","realTimeFieldAngle","单击左键确定观察位置","单击左键固定视域范围","analysis","observePtCoordinate","frustumLength","frustumField","_terrainBias","enableGeoViewShed3D","lookAt","fromHsl","GeoVolumeCalculate_LINE","GeoVolumeCalculate_TIP","GeoVolumeCalculate_GON","GeoVolumeCalculate_DEGON","GeoVolumeCalculate_CORAL","designElevation","getValue","shift","polylineEntity","volumeAnalysis","VOLUME","designPolygonEntity","CORAL","polygonEntity","designPolygonEntity_coral","左键点击绘制,右键点击结束","15px sans-serif","SingleBuildingWidget","PrimitiveCollection","CORNFLOWERBLUE","highlightColor_click","highlightColor_move","_INTERSECTED_FLOOR","_INTERSECTED_FLOOR2","classificationPrimitiveCollection","extrudeToBuilding","_INTERSECTED_FLOOR3","baseHeight","sampleHeightSupported","sampleHeight","地形还未准备好!","建筑物基础高度baseHeight是必需的!","levels","GEO_SINGLEBUILDING","callback_click","_primitiveOptions","geometryInstances","toString","callback_move","highlightFloor","deActivate","removeInputAction","FlyAround","_pitch","_roll","speed","_distance","_positionCartographic","isFlying","deltaHeight","keyEvent","preRender","_play","_heading","deltaDistance","play","参数不可缺省!","_preRender","pause","continue","removeEventListener","keydown","shiftKey","deltaRadians","FreeFlight","direct","lat","planePrimitive","hpRoll","fromBehind","fixedFrameTransform","pathPosition","SampledPositionProperty","speedVector","hpRange","readyPromise","activeAnimations","ModelAnimationLoop","REPEAT","boundingSphere","range","PolylineGlowMaterialProperty","PALEGOLDENROD","addSample","JulianDate","now","headingPitchRollToFixedFrame","lon","postRender","keydownOption","keyCode","RouteFly","cartographicArray","pointArray","_stop","cartesian3","initialHeading","differentBearing","reduceBearing","HorizontalRadian","initializationFly","clock","startTime","stopTime","clockRange","CLAMPED","computeCirclularFlight","addSeconds","TRANSPARENT","TimeInterval","currentTime","multiplier","VerticalRadians","WalkBrowse","orientationAngle","point1","point2","point3","bearing1","bearing2","moveForward","lookRight","GeoCirclePipe","topRadius","bottomRadius","_numSubGeometrys","numSubGeometrys","_imageColor","imageColor","_rotationXPerFrame","rotationXPerFrame","_rotationYPerFrame","rotationYPerFrame","rotationZPerFrame","_instanceName","endRadian","_useImage","_image","_color","multiplyByTranslation","CirclePipeGeometry","_startRadian","_endRadian","MaterialAppearance","_waitForBuildingMaterial","onTick","onFrame","_circlePipePrimitive","fromRotationX","fromRotationY","fromRotationZ","_rotationZPerFrame","multiplyByMatrix3","Image","slices","onMouseEnter","onMouseLeave","_onMouseLeftClick","onMouseLeftClick","_previousEnter","_moveHandler","_clickHandler","images","instanceNames","_circlePipeCollection","_onMouseEnter","_onMouseLeave","instanceName","_center","_drawCommandAlpha","_drawCommandOpaque","_needUpdate","_va","_speed","_actived","actived","_lastTime","_maxRadius","_hSpeed","_life","_metallicFactor","metallicFactor","_roughnessFactor","roughnessFactor","_emissiveFactor","emissiveFactor","_initTransform","_modelTransform","_updateTime","_updateCommands","commandList","vertexArray","shaderProgram","owner","_updateVA","_time","getTimestamp","_updateAlphaCommand","_updateOpaqueCommand","DrawCommand","pass","renderState","RenderState","fromCache","WebGLConstants","LEQUAL","BlendingState","ALPHA_BLEND","ShaderProgram","HDR","uniformMap","multiplyTransformation","viewMatrix","getRotation","getMatrix3","transpose","Pass","OPAQUE","_computeStepCount","createTypedArray","ComponentDatatype","FLOAT","Buffer","createVertexBuffer","createIndexBuffer","UNSIGNED_SHORT","VertexArray","_updateBoundingVolume","round","BoundingSphere","in vec3 aPoint;\n","in vec3 aNormal;\n","in float aT;\n","uniform mat3 u_normalMatrix;\n","varying vec3 v_normalEC;\n","varying vec3 v_positionEC;\n","varying float v_t;\n","void main(){\n"," v_positionEC = (czm_modelViewRelativeToEye * vec4(aPoint, 1.0)).xyz;\n"," v_normalEC = u_normalMatrix * aNormal;\n","uniform vec4 u_color;\n","uniform float u_metallicFactor;\n","uniform float u_roughnessFactor;\n","uniform vec3 u_emissiveFactor;\n","float M_PI = 3.141592653589793;\n","vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n"," return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n","float smithVisibilityG1(float NdotV, float roughness) \n"," return NdotV / (NdotV * (1.0 - k) + k);\n","float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n"," return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n","float GGX(float roughness, float NdotH) \n"," float roughnessSquared = roughness * roughness;\n"," float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n"," return roughnessSquared / (M_PI * f * f);\n","vec3 lambertianDiffuse(vec3 diffuseColor) \n"," return diffuseColor / M_PI;\n","vec3 LINEARtoSRGB(vec3 linearIn) \n","#ifndef HDR \n"," return pow(linearIn, vec3(1.0/2.2));\n","#else \n","#endif \n"," if (!gl_FrontFacing){\n"," n = -n;\n"," }\n"," vec4 baseColorWithAlpha = u_color;\n"," if (v_t > 0.5){"," baseColorWithAlpha.a = (2.0 - v_t * 2.0);\n"," else{\n"," baseColorWithAlpha.a = 1.0;\n"," vec3 baseColor = baseColorWithAlpha.rgb;\n"," float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n"," float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n"," vec3 lightColor = vec3(1.5, 1.4, 1.2);\n"," vec3 h = normalize(v + l);\n"," float NdotL = clamp(dot(n, l), 0.001, 1.0);\n"," float NdotH = clamp(dot(n, h), 0.0, 1.0);\n"," float VdotH = clamp(dot(v, h), 0.0, 1.0);\n"," vec3 f0 = vec3(0.04);\n"," vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n"," float alpha = roughness * roughness;\n"," float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n"," vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n"," vec3 r0 = specularColor.rgb;\n"," float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n"," float D = GGX(alpha, NdotH);\n"," vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n"," vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n"," vec3 color = NdotL * lightColor * (diffuseContribution + specularContribution);\n"," color += u_emissiveFactor;\n"," color = LINEARtoSRGB(color);\n"," out_FragColor = vec4(color, baseColorWithAlpha.a);\n"," float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n"," return linearIn;\n"," if (v_t > 0.5){discard;}\n"," vec3 n = normalize(v_normalEC);\n"," baseColorWithAlpha.a = 1.0;\n"," vec3 v = -normalize(v_positionEC);\n"," vec3 l = normalize(czm_sunDirectionEC);\n"," float LdotH = clamp(dot(l, h), 0.0, 1.0);\n"," vec3 specularColor = mix(f0, baseColor, metalness);\n"," vec3 F = fresnelSchlick2(r0, r90, VdotH);\n","viewer is required.","DEFAULT_HEIGHT","_radius","GeoDynamicCircle","_classificationType","classificationType","DEFAULT_CLASSIFICATION_TYPE","_bottomEllipse","_waveEllipse","_createDynamicCircle","isShow","setShow","_isShow","setColor","DEFAULT_COLOR","ellipse","getColor","setRadius","DEFAULT_RADIUS","semiMajorAxis","getRadius","setCenter","position is required.","ImageMaterialProperty","CallbackProperty","rgba(255, 255, 255, 1.0)","rgba(255, 255, 255, 0.0)","rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.2)","clearRect","beginPath","arc","restore","strokeStyle","rgb(255, 255, 255)","setLineDash","stroke","center is required.","_length","GeoDynamicCylinder","DEFAULT_LENGTH","_topRadius","_bottomRadius","particlesColor","DEFAULT_PARTICLES_COLOR","_cylinderColor","cylinderColor","particlesImageUrl","_cylinderPrimitive","_createDynamicCylinder","_particlesPrimitive","\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n //varying vec4 v_color;\n //uniform sampler2D u_image;\n //uniform vec4 u_color;\n void main()\n {\n float powerRatio = fract(czm_frameNumber / 30.0) + 1.0;\n float alpha = pow(1.0 - v_st.t, powerRatio);\n vec4 color = vec4(","red","green","blue","alpha",");\n // out_FragColor = vec4(u_color.rgb, alpha*u_color.a);\n out_FragColor = vec4(color.rgb, alpha*color.a);\n }\n ","particles primitive","_particlesImageUrl","\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n //varying vec4 v_color;\n //uniform sampler2D u_image;\n //uniform vec4 u_color;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\n float dt = fract(czm_frameNumber / 90.0);\n vec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt));\n //vec4 imageColor = texture(u_image, st);\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = st;\n czm_material material = czm_getMaterial(materialInput);\n\n\n vec3 diffuse = material.diffuse;\n float alpha = material.alpha;\n\n //diffuse *= v_color.rgb;\n //alpha *= v_color.a;\n \n vec4 ucolor = vec4(",");\n diffuse *= ucolor.rgb;\n alpha *= ucolor.a;\n\n //diffuse *= u_color.rgb;\n //alpha *= u_color.a;\n\n out_FragColor = vec4(diffuse, alpha * pow(1.0 - v_st.t, 2.0));\n }\n ","\n in vec3 position3DHigh;\n in vec3 position3DLow;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n\n void main()\n {\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n }\n ","DEFAULT_CYLINDER_COLOR","GOLD","GeoHeatMap","heatmapOptions","orange","useEntities","defaults","gradient","maxOpacity","minOpacity","_computeBounds","_getContainer","width: ","px; height: ","body","_getImageryProvider","getDataURL","_rectangle","_tilingScheme","WebMercatorTilingScheme","_mbounds","_getID","charAt","WebMercatorProjection","wgs84ToMercator","wgs84ToMercatorBB","mercatorToWgs84","mercatorToWgs84BB","rad2deg","deg2rad","mercatorPointToHeatmapPoint","_xoffset","_factor","_spacing","maxCanvasSize","minCanvasSize","setData","_initBounds","_setWidthAndHeight","radiusFactor","_yoffset","bounds","_container","px; margin: 0px; display: none;","repaint","_heatmap","-hm","wgs84PointToHeatmapPoint","_layer","imageryLayers","updateLayer","_renderer","1.21","transparent","addImageryProvider","url","url is required.","_url","GeoImageCircle","_ellipse","_createImageCircle","TERRAIN","_position","_direction","_baseScale","_mode","buildModuleUrl","_url_1","urlTop","explode","_positions","_startScale","_endScale","_imageSize","_endColor","smoking","life","_minLife","_maxLife","_minSpeed","_maxSpeed","_count","_grow","grow","_texture_0","_texture_1","_drawCommand","_pointsArray","_speedScaleLifeTimesArray","_preTime","_loadTexture","_initFires","addPosition","_explode","_owner","_fires","_directionsArray","frameState","Resource","Texture","fetchImage","_emissionPosition","randomBetween","_growFires","baseScale","_updateFire","_initFire","_clock","shouldAnimate","secondsOfDay","_updateCommand","_isCommandReady","updateNext","instanceCount","_updateCommandBoundingVolume","_updateCommandShaderProgram","_updateCommandUniforms","_updateCommandRenderState","aPosition","aDirection","aSpeedScaleLifeTime","_updateCommandVA","time","aTexcoord","aPlane","u_startScale","u_endScale","u_imageSize","u_endColor","u_texture_0","u_texture_1","_updateCommandModelMatrix","in vec2 aPlane;\n","in vec4 aDirection;\n","in vec4 aSpeedScaleLifeTime;\n","in vec2 aTexcoord;\n","uniform float u_endScale;\n","varying vec3 v_texcoord_0;\n","varying vec4 v_colorFact;\n","vec4 computePosition(vec3 position, vec2 plane, vec3 direction, float imageSize, float baseScale, float speed, float time){\n"," vec3 v = normalize(direction) * speed * time;\n"," vec4 result = czm_modelView * vec4(v, 1.0);\n"," result.xy += plane * imageSize * baseScale;\n"," return result;\n","void main()\n"," float speed = aSpeedScaleLifeTime.x;\n"," float baseScale = aSpeedScaleLifeTime.y;\n"," float life = aSpeedScaleLifeTime.z;\n"," baseScale *= mix(u_startScale, u_endScale, t);\n"," gl_Position = czm_projection * positionEC;\n"," v_texcoord_0.z = aDirection.w;\n"," if (t > 0.618){\n"," v_texIndex = 2.0;\n"," else if (t > 0.382){\n"," v_texIndex = 1.0;\n"," v_texIndex = 0.0;\n"," v_colorFact = vec4(1.0 - t);\n"," v_colorFact = mix(u_startColor, u_endColor, t);\n","uniform sampler2D u_texture_0;\n","uniform sampler2D u_texture_1;\n"," int mode = int(v_texcoord_0.z);\n"," vec4 color = vec4(0.0);\n"," if (mode === 0){\n"," color = texture(u_texture_1, v_texcoord_0.xy);\n"," color = texture(u_texture_0, v_texcoord_0.xy);\n"," }\n"," else if (mode === 1){\n"," color.rg *= 1.4;\n"," else if (mode === 2){\n"," color = v_colorFact;\n"," if (color.a === 1.0){\n"," color.a = mc;\n"," if (color.a > 0.995){\n"," vec4 fact = czm_gammaCorrect(v_colorFact);\n"," color *= fact;\n"," if (color.a < 0.1){discard;}\n"," out_FragColor = color;\n","_normalFact","_alphaFact","GeoLineSmokeEffect","_startColor","density","normalFactor","_smokes","_needTime","_door","_maxNormalFactor","_minNormalFactor","_growSmokes","_initSmokes","_initSmoke","multiply","fromRotationTranslation","multiplyByPointAsVector","alphaFact","normalFact","_updateSmoke","_udoor","TRANSLUCENT","_updateCommandShaderProgramAlpha","_updateCommandRepeatVA","_updateCommandShaderProgramOpaque","IndexDatatype","u_startColor","in vec4 aPosition;\n","uniform vec4 u_endColor;\n","uniform float u_imageSize;\n"," vec3 v = position;\n"," result /= result.w;\n"," float time = aSpeedScaleLifeTime.w;\n"," float t = time / life;\n"," vec4 positionEC = computePosition(aPosition.xyz, aPlane, aDirection.xyz, u_imageSize, baseScale, speed, time);\n"," v_texcoord_0.xy = aTexcoord;\n"," v_texcoord_0.z = t;\n"," color = texture(u_texture_0, v_texcoord_0.xy);\n"," vec4 fact = v_colorFact;\n"," if (v_texcoord_0.z > 0.9){color.a *= 0.1;}\n","uniform vec4 u_startColor;\n","uniform float u_startScale;\n"," v_colorFact = vec4(mix(u_startColor.rgb, u_endColor.rgb, aPosition.w * (u_startColor.a + u_endColor.a) / 2.0), aPosition.w);\n"," if (v_texcoord_0.z > 0.9){discard;}\n"," color = czm_gammaCorrect(color);\n","playing","sampleMaxHeight","sampleMaxPoint","isParabola","autoToGround","_name","createGuid","render","_data","posititons","getData","_createPolylines","_lines","duration","_clearPolylines","_definitionChanged","Event","createPropertyDescriptor","getType","getValueOrClonedDefault","_materialCache","addMaterial","GeoOutlineFireEffect","_fireEffect","_postProcess","_assigned","_depthAttachment","_clearCommand","_yPlane","_zPlane","_xyRange","_checkPositionsOrder","_createGroundTexture","_createXYPlanes","_createPostProcess","_updateAssiged","_viewMatrix","_invViewMatrix","postProcessStages","useLogDepth","_createFireEffect","GeoLineFireEffect","_computePlane","_createAssignedFrameBuffer","drawingBufferWidth","drawingBufferHeight","_framebuffer","PixelFormat","DEPTH_STENCIL","PixelDatatype","UNSIGNED_INT_24_8","Sampler","CLAMP_TO_EDGE","TextureWrap","TextureMinificationFilter","NEAREST","TextureMagnificationFilter","Framebuffer","ClearCommand","addFireEffect","addSmokeEffect","_depthStencilTexture","_view","passState","framebuffer","execute","uniform mat4 u_nViewMatrix;\n","uniform int u_count;\n","uniform vec4 u_planes[","];\n","uniform vec4 u_xPlane;\n","uniform vec4 u_yPlane;\n","uniform vec4 u_zPlane;\n","uniform vec2 u_xyRange;\n","uniform sampler2D colorTexture;\n","uniform sampler2D depthTexture;\n","uniform sampler2D u_assignedTexture;\n","uniform sampler2D u_groundTexture;\n","varying vec2 v_textureCoordinates;\n","vec4 toEye(in vec2 uv, in float depth){\n"," vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n"," posInCamera = posInCamera / posInCamera.w;\n","float getDepth(in vec4 depth){\n"," float z_window = czm_unpackDepth(depth);\n"," z_window = czm_reverseLogDepth(z_window);\n"," float n_range = czm_depthRange.near;\n"," float f_range = czm_depthRange.far;\n"," return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n","vec2 getGroundTexCoord(in vec3 position){\n"," float y = czm_planeDistance(u_yPlane, position) / u_xyRange.y;\n"," return vec2(x * 4.0, y * 4.0);\n"," vec4 color = texture(colorTexture, v_textureCoordinates);\n"," vec4 currD = texture(depthTexture, v_textureCoordinates);\n"," if(currD.r>=1.0){\n"," out_FragColor = color;\n"," return;\n"," vec4 assigned = texture(u_assignedTexture, v_textureCoordinates);\n"," }\n"," float depth = getDepth(currD);\n"," float z = czm_planeDistance(u_zPlane, position.xyz);\n"," vec2 gndTexCoord = getGroundTexCoord(position.xyz);\n"," vec4 colorGround = texture(u_groundTexture, gndTexCoord);\n"," for (int i = 0; i < "," if (i >= u_count){\n"," break;\n"," }\n"," float d0 = czm_planeDistance(u_planes[i], position.xyz);\n"," float d2 = czm_planeDistance(u_planes[i+2], position.xyz);\n"," if (d0 > 0.0 && d1 > 0.0 && d2 > 0.0){\n"," if (z < -1000.0){break;}\n"," break;\n","PostProcessStage","_groundTexture","_xPlane","urlGround","function ","join","l-1",";while(l<=h){ var m=(l+h)>>>1,x=a[m]",";if(x===y){return m}else if(x<=y){",";var p=c(x,y);if(p===0){return m}else if(p<=0){",";if(","){i=m;","l=m+1}else{h=m-1}","h=m-1}else{l=m+1}","return -1};","return i};","c(x,y)","function dispatchBsearch","(a,y,c,l,h){ if(typeof(c)==='function'){ return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c) }else{ return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y) }} return dispatchBsearch","triangulation","binary-search-bounds","stars","edges","removeTriangle","addTriangle","flip","opposite","cells","neighbor","flags","next","locate","boundary","constraint","two-sum","twoProduct","fastTwoSum","robust-subtract","robustSubtract","robust-sum","linearExpansionSum","two-product","robust-scale","scaleLinearExpansion","sum(","split","substr","prod(","scale(","prod(m","var w","=scale(w","[0]);","var p=","sum","diff","slow","function testInSphere(",":return o","robust-in-sphere","delaunay","isConstraint","),prod(-","Exact","){var p=",",n=",",d=sub(p,n); return d[d.length-1];};return ","prod","function getOrientation(","case ","}var s=new Array(arguments.length);for(var i=0;i 0.0)\n"," {\n"," j++;\n"," clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"," clipNormal = clippingPlane.xyz;\n"," clipPosition = -clippingPlane.w * clipNormal;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," if (amount > 0.0)\n"," {\n"," clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"," clipNormal = clippingPlane.xyz;\n"," amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," {\n"," bDiscard = false;\n"," break;\n"," }\n"," }\n"," if (bDiscard) {\n"," discard;\n","getClipAndStyleCodeForMulArea","uniform sampler2D gltf_clippingPlanes; \n","uniform mat4 gltf_clippingPlanesMatrix; \n","uniform vec4 gltf_clippingPlanesEdgeStyle; \n","{ \n"," gltf_clip_main(); \n","); \n"," clippingPlanesEdgeColor.rgb = ",".rgb; \n"," float clippingPlanesEdgeWidth = "," if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n"," out_FragColor = clippingPlanesEdgeColor;\n"," } \n","} \n"," vec3 clipPosition = vec3(0.0);\n"," int j = i;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"," j++;\n"," if (amount > 0.0)\n"," //break;\n","void main() \n"," float clipDistance = clip(gl_FragCoord, ",".a; \n"," if (clipDistance < 0.0) \n"," { \n","peekSource","addOutlinePosition","_outline","tileUnload","raiseEvent","_statistics","decrementLoadCounts","numberOfTilesWithContentReady","unloadContent","_enableTileset","_root","_removeEffectFromTileset","_cache","trim","unloadTiles","_unloadTileCallback","GeoRadarScan","DEFAULT_LINE_WIDTH","_sectorColor","_sectorWidth","sectorWidth","DEFAULT_SECTOR_WIDTH","_createRadarScan","_updateBorderMaterial","_updateSectorMaterial","_radarScanEntity","_borderEntity","setLineColor","getLineColor","setsectorColor","radar","rgba(","rgba(255,255,255,1)","255,255,255",",1)","moveTo","lineTo","fill","_createCanvas","GeoScanCircleEffect","_repeat","repeat","_scanCirclePostProcess","_scanAperturePostProcess","_normal","_setLife","_setTime","_color0","_finishedEvent","_updatePostProcesses","_finish","inverseViewMatrix","_updateScanAperturePostProcess","_updateScanCirclePostProcess","uniform mat4 u_invViewMatrix;\n","uniform vec3 u_center;\n"," vec4 color = texture(colorTexture, v_textureCoordinates);\n"," vec4 currD = texture(depthTexture, v_textureCoordinates);\n"," if(currD.r >= 1.0){\n"," return;\n"," float zd = czm_unpackDepth(currD);\n"," zd = czm_reverseLogDepth(zd);\n"," zd = (2.0 * zd - czm_depthRange.near - czm_depthRange.far) / (czm_depthRange.far - czm_depthRange.near);\n"," vec2 xy = vec2((v_textureCoordinates.x * 2.0 - 1.0), (v_textureCoordinates.y * 2.0 - 1.0));\n"," vec4 position = czm_inverseProjection * vec4(xy, zd, 1.0);\n"," float z = 0.0;\n"," if (all(notEqual(n, b))){\n"," vec3 nc = cross(b, n);\n"," b = normalize(b);\n"," z = dot(b, position.xyz) - dot(b, u_center);\n"," float d5 = u_param0.z * u_param0.y;\n"," float hw = u_param0.w / 2.0;\n"," float hw5 = hw * 12.0;\n"," float hd = dot(u_normal, position.xyz) - dot(u_normal, u_center);\n"," if (z < (d5 + hw5) && z > (d5 - hw5)){\n"," color.rgb = mix(color.rgb, u_color.rgb, smoothstep(0.0, 1.0, z1));\n"," float r = abs(z - d);\n"," if (u_color.a < 1.0){\n"," z = (r - hw * u_color.a) / (hw * (1.0 - u_color.a));\n"," color.rgb = mix(color.rgb, u_color.rgb, clamp(al * ((hw * u_color.a > r) ? 1.0 : exp(-(pow(z, 2.27)))), 0.0, 1.0));\n","invViewMatrix","uniform vec3 u_normal;\n","uniform vec4 u_param0;\n"," position /= position.w;\n"," float t = (u_param0.y > u_param0.x) ? u_param0.x : u_param0.y;\n"," vec3 b = normalize(position.xyz - u_center);\n"," b = cross(n, nc);\n"," float d = u_param0.z * t;\n"," float r = abs(z - d5);\n"," color.rgb *= ((r / hw5) > 0.5) ? 0.996 : 1.018;\n"," color.rgb += vec3(0.01) * u_color.rgb;\n"," if (z < (d + hw) && z > (d - hw)){\n"," r = 1.5707963 * r / hw;\n"," color.rgb = color.rgb * vec3(0.618) + u_color.rgb * vec3(cos(r) * 0.382);\n","GeoScanRingEffect","longest","_textureUrl","_scanPostProcess","_texture","_param1","_param3","_loading","_checkVisible","_updateTexture","_udpateParams","setTextureUrl","_param0","_param4","_longest","only-if-cache","_param2","uniform vec4 u_param3;\n"," out_FragColor = color;\n"," position = u_invViewMatrix * position;\n"," float z0 = dot(u_param3.xyz, position.xyz) + u_param3.w;\n"," if(z0 < -800.0 || z0 > 800.0){\n"," vec3 v = u_param3.xyz * z0;\n"," vec3 p = position.xyz - v;\n"," float z2 = distance(u_param0.xyz, p);\n"," float z3 = u_param2.x * 0.75;\n"," if(z2 < z3){\n"," out_FragColor = mix(color, u_color, (z2 - z3) * 0.8 / (u_param2.x * 0.25));\n","uniform vec4 u_param2;\n","uniform vec4 u_param4;\n"," float z0 = dot(u_param0.xyz, position.xyz) + u_param0.w;\n"," if(z0 < 0.0){\n"," float z1 = dot(u_param1.xyz, position.xyz) + u_param1.w;\n"," if(z1 < 0.0){\n"," float z2 = dot(u_param2.xyz, position.xyz) + u_param2.w;\n"," if(z2 < 0.0){\n"," float z3 = dot(u_param3.xyz, position.xyz) + u_param3.w;\n"," if(z3 < 0.0){\n"," float z4 = dot(u_param4.xyz, position.xyz) + u_param4.w;\n"," float a = max(sColor.r, max(sColor.g, sColor.b));\n"," out_FragColor = mix(color, sColor, a * 0.8);\n","_angle","angle","emit","velocity","imageSize","_particleLife","particleLife","_emissionRate","emissionRate","_lifetime","lifetime","_system","_initializeParticleSystem","_reset","_particles","_billboard","_particlePool","VisualSenseStyleCondition","_fieldName","_fieldValue","fieldValue","minValue","_maxValue","maxValue","_topic","topic","vec4(","_makeColorShader","if (visualSenseStyle_enabledMixColor === 1.0) { \n","out_FragColor *= ","_minValue"," === ",".0) \n","if (",".0 && ","_makeLuminanceShader",") \n"," >= "," && ","mixedColor","luminanceAtZenith","getLuminanceByProperty","true","getProperty","ConditionParser","parse","fieldName","_useElevation","bloom","glowOnly","contrast","brightness","sigma","stepSize","isSelected","GeoVisualSenseStyle","_enabledMixedColor","_enabledLuminanceAtZenith","_enabledBloom","_bloomStep","_map","_conditionParser","_mixedColorConditions","parseLuminanceAtZenith","lightBand","_enabledLightBand","_luminanceAtZenithConditions","conditions","makeFragmentColorShader","if (visualSenseStyle_enabledLuminanceAtZenith === 1.0) { \n","luminanceValue = heightLightValue; \n","makeShader","makeLightBandShader","float vtxf_a13 = fract(czm_frameNumber / 360.0);\n","float vtxf_h = clamp(v_elevationPos.z / 300.0, 0.0, 1.0);\n","vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\n","float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));\n","out_FragColor.rgb += out_FragColor.rgb * (1.0 - vtxf_diff);\n","GeoWind","level","rectangle","velocityScale","particleMultiplier","maxWindIntensity","colors","#00ffff","#64f0ff","#87e1ff","#a0d0ff","#c6adff","#d49bff","#ec6dff","#ff1edb","canvasContext","_initWindy","Windy","header","parameterCategory","parameterNumber","2,2","2,3","lo1","la1","refTime","setHours","getHours","forecastTime","interpolate","release","randomize","substring","indexFor","rgba(0, 0, 0, 0.97)","age","globalCompositeOperation","fillRect","timer","field","_locationCoordinate","_size","_bounds","tan","_getLevel","_getCenterPoint","_calculateBounds","1.16","windy","GEO_OVERVIEW_ICO_LAYER","GEO_OVERVIWE_ICO_ID","map2DOptions","raster","http://t3.tianditu.com/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&LAYER=vec&TILEMATRIXSET=c&FORMAT=tiles&VERSION=1.0.0&STYLE=default&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e90d56e5a09d1767899ad45846b0cefd","tdt_layer_overview","visible","movingTargetIco","movingTargetIcoSize","movingTargetZoomLevel","_isReady","modelType","ROAM","_initOverview","geo-cesium-viewer-overview","layout","toLocaleUpperCase","startsWith","bottom","5px","absolute","_bindEvent","map2D","load","loadImage","addImage","addSource","addLayer","updateAimingRect","_unbindEvent","GEOOVERVIEW_3D_RENDER_EVENT","getMap2D","getMap2DLayer","getLayer","addMap2DLayer","removeLayer","getMap2DSource","addMap2DSource","removeMap2DSource","_latelyUpdateStamp","_modelType","getSource","setLayoutProperty","icon-rotate","setModel","setScalable","boolean","GeoOverviewWidget","CustomGeographicTilingScheme","_resolutions","resolutions","_maximumLevel","_origin","_fullExtent","fullExtent","_dataRectangle","_matrixWidth","_matrixHeight","LN2","_topTileExtent","_numberOfLevelZeroTilesY","_centerPoint","_proposalHeight","GeographicTilingScheme","_numberOfLevelZeroTilesX","getNumberOfXTilesAtLevel","CustomWebMercatorTilingScheme","matrixWidth","numberOfLevelZeroTilesX","numberOfLevelZeroTilesY","_rectangleSouthwestInMeters","rectangleSouthwestInMeters","rectangleNortheastInMeters","_rectangleNortheastInMeters","getNumberOfYTilesAtLevel","LineString","GeoGeodesic","radiansToDegrees","degreesToRadians","atan2","_destination","along","_bearing","geoTranslateByDistance","GeoGeographicTilingScheme","GeographicProjection","when","defer","ToolManager","_tools","ModifyTerrainTool","vertices","heights","mtHeight","mtType","fromKML","resolve","lenght","timeStamp","getTileDataAvailable","_errorEvent","_credit","string","Credit","heightMapWidth","heightMapHeight","_subdomains","firstRequestUrl","{s}","sTag","_firstRequest","layerName","&Styles=&Format=image/mpt","pngOnly","maxTerrainLevel","_maxTerrainLevel","setFormatMPT","_urlTemplate","request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=","_format","_levelZeroMaximumGeometricError","TerrainProvider","_workerPool","_pendingRequests","_requestsCache","_requestsCacheKeys","errorEvent","GeoSkylineTerrainProvider","_geometricErrorFactor","mpt","png","_isMPT","replace","requestFactorForLevel","_requestGridSize","getRequestBaseTerrainUrl","getRequestElevationLayer","getRequestUrl","tilingScheme","tileXYToNativeRectangle","{north}","{west}","{east}","{optimizedOnly}","{height}","isT_Inside_E","DEGREES_PER_RADIAN","isT_Intersects_E","RADIANS_PER_DEGREE","refreshElevationLayer","_surface","_levelZeroTiles","findDirectParent","freeResources","isTileAvailable","tileXYToRectangle","terrainData","_childTileMask","markTileAsUnavailable","requestTileGeometryBuffers","requestedRectangle","layer","requestTileHeightBuffer","all","myReject","reject","isFloor","arrayToHeightmapTerrainData","catch","_allElevationLayers","each","requestElevationLayerTileGeometry","requestBaseTerrainTileGeometry","nullTolerance","nullValueNumber","polygonVerticesX","polygonVerticesY","mergeBuffers","offset","tolerance","_buffer","Request","subdomains","/SG","/Elevation","format","image/png","image/mpt","_modifyTerrainObjects","modelFloorBestLevel","NoMerge","_selectedTiles","NoFloor","rootFloorRectangle","getHRMTFP","_model","hasOwnProperty","dataLoaded","fetchArrayBuffer","workerFinished","queueWorkItem","rejected","extractTileHeightBuffer","message","HeightmapTerrainData","workerPath is required.","_workerPath","workerPath","_poolSize","poolSize","_workers","_defered","jobQueueSize","onWorkerError","workerId","deferedId","postMessage","trimPool","timerId","terminate","onWorkerMessage","options.urls is required.","_dataType","dataType","GeoTerrainProvider","INT","_tileType","tileType","HEIGHTMAP","_urls","urls","_urls_length","_url_i","_url_step","_readyPromise","credit","_heightmapWidth","_heightmapHeight","getEstimatedLevelZeroGeometricErrorForAHeightmap","_opacity","opacity","_maxExtent","maxExtent","_topLevel","_bottomLevel","bottomLevel","ready","requestTileGeometry must not be called before ready returns true.","promise","requestTileGeometry","&y=","&l=","_proxy","getURL","QUANTIZED_MESH","_terrainDataStructure","_skirtHeight","getLevelMaximumGeometricError","getvHeightBuffer","_vHeightBuffer","transformBuffer","setInt8","requestFunction","GET","open","responseType","arraybuffer","async","RequestScheduler","request","readyState","status","response","byteLength","Inflate","decompress","_rectangles","getFloat64","getFloat32","subarray","getUint32","createTypedArrayFromArrayBuffer","getUint8","OCT_VERTEX_NORMALS","_requestVertexNormals","WATER_MASK","METADATA","_requestMetadata","available","endY","EPSILON5","fromRectangle","_tileCredits","int","float","quantized-mesh","heightmap","tileset","source","autoActivate","originalColor","fromBytes","moveColor","selectedFeature","groundPrimitiveCollection","geojson","activateAction","_seletedEvent","XMLHttpRequest","withCredentials","Accept","application/json","onerror","statusText","onload","_loadGroundPrimitives","data的类型不被支持!","Polygon","类型,该类型不被支持!","GEO_MONOMER_FEATURE","reloadGeoJSON","_loadGeoJSON","description","isContaintFeature","drillPick","selectedColor","deactivateAction","Cesium3DTilesetMonomer","EasingFunction","Intersect","OrthographicFrustum","PerspectiveFrustum","CameraFlightPath","_transform","_invTransform","_actualTransform","_transformChanged","isTDT","_positionWC","_directionWC","_up","_upWC","_right","aspectRatio","fov","defaultMoveAmount","defaultLookAmount","defaultRotateAmount","defaultZoomAmount","maximumZoomFactor","_moveEnd","_changed","_changedDirection","_changedFrustum","percentageChanged","_modeChanged","_max2Dfrustum","_suspendTerrainAdjustment","DEFAULT_VIEW_RECTANGLE","DEFAULT_VIEW_FACTOR","TRANSFORM_2D","TRANSFORM_2D_INVERSE","PI_OVER_FOUR","computeView","_updateCameraChanged","numberOfListeners","_changedPosition","fovy","_adjustHeightForTerrain","basisTo2D","getColumn","EPSILON10","inverseTransformation","_actualInvTransform","_rightWC","zeroToTwoPi","MORPHING","_moveStart","mode is required.","An OrthographicOffCenterFrustum is required in 2D.","A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view","The camera frustum is expected to be orthographic for 2D camera control.","tileProvider","_tileLoadQueueHigh","_tileLoadQueueMedium","_tileLoadQueueLow","_debug","tilesWaitingForChildren","pickPositionWorldCoordinates","ROTATE","fromHeadingPitchRoll","endTransform","getRectangleCameraCoordinates","flyHome","completeMorph","flyTo","cartesian is required.","worldToCameraCoordinatesVector","cameraToWorldCoordinates","cameraToWorldCoordinatesPoint","cameraToWorldCoordinatesVector","direction is required.","moveUp","moveDown","moveRight","lookLeft","lookDown","twistLeft","axis is required.","rotateDown","rotateLeft","zoomOut","offset is required","lookAt is not supported while morphing.","UNIT_Y","transform is required","lookAtTransform is not supported while morphing.","setEndPoints","_offCenterFrustum","MAX_VALUE","rectangle is required","windowPosition is required.","near","distanceToBoundingSphere","boundingSphere is required.","getPixelSize","drawingBufferHeight is required.","getPixelDimensions","EXPONENTIAL_OUT","createCorrectPositionTween","duration is required.","_currentFlight","destination is required.","cancelFlight","convert","complete","cancel","pitchAdjustHeight","flyOverLongitude","flyOverLongitudeWeight","easingFunction","createTween","DEFAULT_OFFSET","viewBoundingSphere is not supported while morphing.","fromCartesian4","radii","multiplyComponents","oneOverRadii","upWC","computeVisibility","fromCartographicArray","EPSILON9","switchToPerspectiveFrustum","switchToOrthographicFrustum","projectionMatrix","CameraEventType","_update","_isDown","_movement","prevAngle","_buttonsDown","position1","_eventHandler","PINCH_END","PINCH_MOVE","_eventStartPosition","_pressTime","_releaseTime","RIGHT_DOWN","RIGHT_UP","MIDDLE_DRAG","MIDDLE_UP","_lastMovement","valid","canvas is required.","_currentMousePosition","ALT","type is required.","GeoCloudPrimitive","speedScale","_base","_step","_gamma","gamma","_isInverse","_animationMatrix","_colorTexture_0","_requestUrl","_requestCommand","../../../resource/images/10.jpg","_url_0","_createTexture","_context","RGBA","CloudPrimitive fetchImage is failed!","passes","_isTexturesReady","_timeoutWorkerCommand","_updateAnimationMatrix","_createCommandByWorker","var PI_OVER_TWO = PI / 2.0;\n","onmessage = function (e) {\n"," var xCount = params.xCount;\n"," if (!xCount){\n"," var yCount = params.yCount;\n"," if (!yCount){\n"," postMessage({error:true});\n"," var radius = params.radius;\n"," if (!radius){\n"," var pointsCount = (xCount + 1) * (yCount - 1) + 2 * xCount;\n"," var pointsArray = new Float32Array(3 * pointsCount);\n"," var texcoordArray = new Float32Array(2 * pointsCount);\n"," var ptIndex = 0;\n"," var tcIndex = 0;\n"," var hFovRad = PI * 2.0;\n"," var angleH = 0;\n"," var angelV = 0;\n"," var stepVRad = vFovRad / yCount;\n"," for (var F = 0; F < xCount; F++){\n"," pointsArray[ptIndex ++] = 0.0;\n"," pointsArray[ptIndex ++] = -radius;\n"," texcoordArray[tcIndex ++] = F / xCount + 1 / (xCount * 2.0);\n"," texcoordArray[tcIndex ++] = 0.0;\n"," var startHRad = -PI;\n"," var startVRad = -PI_OVER_TWO + stepVRad;\n"," for (var U = 0; U < yCount - 1; U++) {\n"," angelV = startVRad + U * stepVRad;\n"," angleH = startHRad + F * stepHRad;\n"," pointsArray[ptIndex ++] = radius * Math.cos(angelV) * Math.cos(angleH);\n"," pointsArray[ptIndex ++] = radius * Math.cos(angelV) * Math.sin(angleH);\n"," pointsArray[ptIndex ++] = radius * Math.sin(angelV);\n"," tt = 0.5 + angleH / hFovRad;\n"," texcoordArray[tcIndex ++] = tt;\n"," texcoordArray[tcIndex ++] = (U + 1) / yCount;\n"," pointsArray[ptIndex ++] = radius;\n"," texcoordArray[tcIndex ++] = 1.0;\n"," var faceIndexCount = (xCount * (yCount - 2) + xCount) * 6;\n"," var faceIndex = 0;\n"," for (var F = 0; F < xCount; F ++){\n"," faceIndexArray[faceIndex ++] = F + xCount + 1;\n"," faceIndexArray[faceIndex ++] = F + xCount;\n"," for (var U = 0; U < yCount - 2; U ++){\n"," faceIndexArray[faceIndex ++] = F + xCount + U * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + 1 + U * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + 1 + (U + 1) * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + (U + 1) * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + (yCount - 2) * (xCount + 1);\n"," postMessage({\n"," faceIndexArray: faceIndexArray\n","};\n","onerror = function(error){\n","application/javascript","onmessage","faceIndexArray","PrimitiveType","TRIANGLES","FUNC_ADD","ONE","_createShaderProgram","cull","_card"," in vec3 a_position;\n in vec2 a_texcoord_0;\n uniform mat4 u_animationMatrix;\n varying vec2 v_texcoord_0;\n "," void main()\n {\n vec4 p = vec4(a_position, 1.0);\n v_texcoord_0 = a_texcoord_0;\n gl_Position = czm_modelViewProjection * u_animationMatrix * p;\n }\n "," uniform sampler2D u_colorTexture_0;\n uniform vec4 u_gamma;\n varying vec2 v_texcoord_0;\n "," float computeW(vec4 color){\n float w = color.w;\n if (w === 1.0){\n //w = min(min(color.r, color.g), color.b);\n w = sin(color.r * color.g * color.b * 1.5707963);\n }\n w = pow(w, u_gamma.w * 10.0);\n return w;\n }\n void main()\n {\n vec4 color_0 = texture(u_colorTexture_0, v_texcoord_0);\n color_0.w = computeW(color_0);\n color_0.rgb *= u_gamma.xyz;\n out_FragColor = color_0;\n }\n ","topCylinderColor","bottomCylinderColor","createPrestrainPrimitive","ellipseAppearance","prestrainEllipsePrimitive","trackedEntity","pointEntity","ellipsePrimitive","cylinderPrimitive","MIDDLE_DOWN","prestrainCylinderPrimitive","removeById","EllipseGeometry","VERTEXT_FORMAT","POSITION_AND_NORMAL","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAA6E2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS41LWMwMTQgNzkuMTUxNDgxLCAyMDEzLzAzLzEzLTEyOjA5OjE1ICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpPC94bXA6Q3JlYXRvclRvb2w+CiAgICAgICAgIDx4bXA6Q3JlYXRlRGF0ZT4yMDE5LTA2LTExVDA5OjQ2OjU3KzA4OjAwPC94bXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTktMDYtMTFUMTA6MTY6NTMrMDg6MDA8L3htcDpNb2RpZnlEYXRlPgogICAgICAgICA8eG1wOk1ldGFkYXRhRGF0ZT4yMDE5LTA2LTExVDEwOjE2OjUzKzA4OjAwPC94bXA6TWV0YWRhdGFEYXRlPgogICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3BuZzwvZGM6Zm9ybWF0PgogICAgICAgICA8cGhvdG9zaG9wOkNvbG9yTW9kZT4zPC9waG90b3Nob3A6Q29sb3JNb2RlPgogICAgICAgICA8cGhvdG9zaG9wOklDQ1Byb2ZpbGU+c1JHQiBJRUM2MTk2Ni0yLjE8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8eG1wTU06SW5zdGFuY2VJRD54bXAuaWlkOjNkNWU2OTU5LTZiOTMtZTQ0Mi1hNmFkLWVhMmExOWQxZGI0MTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+eG1wLmRpZDo5ODQ4MzQ2Ny03Mjg5LTUzNGQtOTUyOC05MGY3MWU0MTEwMmU8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDo5ODQ4MzQ2Ny03Mjg5LTUzNGQtOTUyOC05MGY3MWU0MTEwMmU8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6OTg0ODM0NjctNzI4OS01MzRkLTk1MjgtOTBmNzFlNDExMDJlPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE5LTA2LTExVDA5OjQ2OjU3KzA4OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpPC9zdEV2dDpzb2Z0d2FyZUFnZW50PgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+c2F2ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+eG1wLmlpZDozZDVlNjk1OS02YjkzLWU0NDItYTZhZC1lYTJhMTlkMWRiNDE8L3N0RXZ0Omluc3RhbmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTktMDYtMTFUMTA6MTY6NTMrMDg6MDA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50PkFkb2JlIFBob3Rvc2hvcCBDQyAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzIwMDAwLzEwMDAwPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WVJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/Pu16zW8AAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAEbhJREFUeNrsW3t0VPWd//x+9955ZDKTyeRNnrxCXEGEgAqyQXqEWmtdtbj0gVsaaVfWB6tSjh5r67J2j0qhPrrWcnqaLisKVK0bLdsKIiBGBOVhSYiERwghk5AQ8pqZ3Dv3/r77x/yGjrOZyUSC7jnu95zfyeP+Ht/f5/5+3/dlRIQvM3F8yenzACAPwDIAc0cwZhyABwBUXGrm1Es4dz6AbwGYB+BvAPzrCMZ6AHwfwE0A3gewGcChS8EkuwQy4DYA1QBKAZwDsA/AWwB2AwiN4GRWArgRwLUACgB0A3gNwDP/VwH4HoD7ANgB/BnAbwHUj9Lc2QDuBPB3AHwAXgHw41GZmYguts0mov1EdISIVozCfMO1hUT0ARE1EdGdFzvfxTKzjoi6ieipz2Hj8W0JEZ0moneJKOPzBiCfiE4Q0SEiKv0CNh/bXiaiEBF97bOM/ywyYB6APwFYB+DeEYzzAZgG4DKp5nwAFPlMABgA0AzgKIADAFpGMPcdAH4H4LERapsRn4BvUoS+l2J/HxEtJaI3iaiXUieLiN4jooeJaGKKa11GRANE9ItLdQVulszNSaFvERE9TUQ9iXZomqZlGIZpGIZlGIY5DCCvSWE73LppRNRBRGtG+wrMBLBXWnO7hun7UwAPAXDE/M+sq6s7vmfPnuaGhgZ/a2tr/7lz53TTNIkxxgCQ1+vVxowZk15eXp47c+bM0qqqqvEulys9bu71cm5/kvVdADoB/ATAz0fDDvDKCX8IoCZJvyskg1Oj//D7/Z01NTUf1NbW1h88eNCv67oBQOGca3a7XeGcI7q+YRjCNE0TQBgAr6ioyLnhhhsmLV68eEZlZeWEmHX6APwjgI1JeJkAoAnAfADbLhaAj+XbX5qkz3cAbLjwuk1z8LHHHvvjunXr9nZ2dp5XFMWTm5vrstvtXModBoDFiyPGGMnx1N3dPRgMBns1TbMtWrRoyqpVq24cO3bsmJj+qwGsTMLTrdJy9ADo/6wAPCIdmaIkfR4AsCb6x7Zt2w7de++9f2hsbDzjdruzc3JynEIIQUQqgHR5Naxij9s2PsOT7rQM5VjfQH/TQCgktYIpGTYUReEDAwPm2bNnz2ZkZLgef/zxr95zzz0LYtZ+CcB3k/D2nwBKkjliyQAoAnAawBQAhxP0uRvAL6N/rFmzZsuKFStqATjHjRvnE0KYROQAkCn9gBYAJwG0PVKcWzY1M+M6h6JkHusPvPPAsdP7pANVJptXAtGvqqra3t4eCAQCnXfcccc169ev/36MI/eyPIGJKCCv74aRAvA2gDapY4eimwC8Ef3jwQcffHnt2rVbMzMzC3w+n900TZKucEA6RB/W3TTvOBgD0zToRw7foR9peJQrWqlWNvZRraT0KTJNgAhzdh/IkzbDLOkIdXLOjXA4zFpbW1vnzp07cevWrcs1TbPL5X8O4EcJ+LwdwAsAskYSD7haSv4fJnheAKA2+sfDDz+8ee3atdvy8/OLvV6vZpqmDcAYadA8DWDT/oeWH3dMvgKOK66E88pKqJneYqurZ6Le3GkTg4ZHzc6C4s2A4s3A+zdd1yGNrdXSk8wQQnhVVbXKyspKdu7ceXzBggXPArAkCysA3JKA199LrbFqJAD8Qh6tRO5rbVSI1dTU7HziiSf+nJeXV+h0OiGEcEvBs1lai60AYLafiTR/K8JtLTarv6+YGCAEQIKXkBAVZFo2CpugsBldZ0B6fr8CoBNRLoBwWVlZ4Y4dO45WV1f/R9xGvQn4/RGAf0oVgHEAxkp9OxQtATADAI4cOXKqurp6o8fjyXW5XFxu3gHg1/HqJ7h/T7R5Qvveuz58+uQk6FL8G+HJYlCvIgE7MQX0v9mql8e8h4jyAFiFhYVFNTU1u2tqanbGBHfWJeD5vwG0A7gnFQAeAvAhgPNDPNPkkQYAWrp06UYAak5OjtOyLLt88+uk6vwUmaeaI635pMc4eaLK6usdz5yAogFWZ+v4cMuxK3m6Q1NzfFAyPUNtokuezBARZdpsNkpPT8+97777Xvf7/V0x9/2KBCDUyCjTsADMTWLwLAOQAQDr169/t66urqm0tDTHNE0BIEfq3Y+HNM+uW4D0r94Mx7SrMkiIKhEIljAVUDIBq/+8xzjdMoMBecxmA1OURIK5W54uuxDClpeX5xoYGAg98sgjb8T0eTLB2BekAzYpGQDXyp+vJdH5ICJz9erVOzVN83LOhYzYHJGRoKGDj3kF0AqLoXgyJtLAwAQYAszOwNI0kA5YXQFP+GzHlHDrKY/RcjKZbXJMCsZc0zTNnJyc3BdffPFAU1NTq3x+QwK7JSBVcHUyAL4rOw1F18g4H2praw8cPnz4TEFBgVsIoch5XkvGdejghwgd+rBcP940R/QEXOAAc6gAY4AJUMDyit7+vwVDCfdmDGedbpF3Ot3tdqvhcNhYt25dXVx4bijaCaBKmspDAjA9ibOzKPrLpk2bDgLQOOdRP/+g9OUTkggFYDQfqzSaPqkSuqlBYQDngACYBpAYzDLbz8xnmlZqGzt2OAAMuRmvZVkiLS3N++abbzbouh7VWt9Mor2yASxMBMDSJFHXrwBAT09Pb11d3SmPx+ORRpQqDZ2k5Jw5C6rbPZkCfdOgQAVnkTAIAJ6pgKm6qh87Osns6ipNMV2xTwpqm8/nczY2Nnbt2rWrST6bJu2QeDog7YXfJwLgsLwr8ZQDYDIA7N27t7mlpaXX4/FoUuV1yChOUhLBwBirp28K6brKnWBMkwAQwO0M4IDoBUSQplJYTEoBgF4AxwG4VVUFALFnz57mOGNuKKqX40aUGKmIgtXQ0NBORJaqqoyI0qTbGRxugv4d7/xDuKmtQnQDzEkAWZHGAMYBywBMAejNLTcyTi0AfpYCX80ApsmTqDU2Np6NeZYKiCkDcEGqnjlzpj/Gh1BlrGBYKszUzgyUF+4z9IIuxcHPCzDBAHAOUlRuWSHdEQ7odueEMW32orxPcOCTVKbtkN4jUxRF8/v9AzHPikcTgAuWSXd3dzhOiwRTmcCVQVudqnoQYZ7GbUwnzgVxBs4AaAohCIX6LZVl2wLwOc6myFcwCoDdbmc9PT1hy7KEoig8ludRzQ3KYManrncq4zb1TW4Ph1m7SRwAg2AcBEABQVEYzNAgwrqBzEAx0vuyU2XnwtqRyBqYEAJKYkPqMwPAYgD4TLm05T3XFrmddpdiU7lOsAQxBgEwEuCWgG6EedgSfFzIo2f3Oc8lMMWHezk0FM+jAYB1wRnQtNiJKSa2n5SKHcZSZuqzLJNl2zjvFWAMBMaIiDOCzdBdImxxj6WccAu8BOD1FPlnACCEgKqqTFEUFs/zaADQfUEf5uTYZfwORCQAuFOZYHJ5vvr2lg8mnT7dWcrcOZZ8ZRH+VQUUDCjcHDQ1jHOEzZzcFPlyyz2QrusiKyvLxjln8TyPBgCnLrzJ4uKMaEJFRnDzU5lg2pVFGz/6+NRXTncZpU63TdEUDi7lAFc4Bp0KINyC2R1vChJvpchXAQCFMUZCCKOwsNATpyJTysOnQo1RaT916tQxmqZp4XCYpNFUImN+yWPr3rQTmT5PPZwOy7QIXFVgd2rQbAoM04RmV5Gd6+lLc9q2M8aaU+RrHIBBeQ3MKVOmFMQZPCMG4FsyGBJPAwA+AoDp06eXlZeXZ/X09AzKE+ADcPmwCDb6RV5W2geluZ5DRm8IpmGBAFiWQDBggCwaTE/TPjQtq30goKfC+xjJ64Cu65bNZrPPmTNnXIyvsHeIMQqAbwO4LhEAj0Zd3iHoLQCw2+2OefPmjQ8Gg33yvgWTmJ0X6Fx3wCwfn7N74rjsAzAFhBDSCmTgjEFV+HFF4X8yDPNsMJgSALMBOBljZmdnZ2D69OkFM2bMGC+f7ZIJlKH8meejEa2hANgcm9mJo5ejvyxevHgGAKbrugDQI83OymTcTqrIM0vLshp9eZ5GxeOEKYDBUBhEBM2mwONxnPT5XNuyfK7urCzXcJvPkrGLLsaYYppm38KFC6+I2c/GJJHsvQB+kwiADQAKE0j24wA+AICrr7560vXXXz+xra2tWxod/TITk1CoGoaFYCgMu11pzc11tUEIMdCvQ9dNKJyhpNh7bOb04voZ04qMyiuLhgNgIQAHY0w/d+5cMDs721tdXT07Gn0DsCnBuFnyJPckAuCYvO9LEkxwwUF59NFH5wPQQ6GQYIz1So8xUSAC7+05ibd3HEVPz2Dz2OLs3RrnvVb3AMIDRrhoTObxMQXew5wzcIUjYskmpCp5hDsYY2pfX1/n/fffPyczMzMaRVkn9xBPpQBy48N9Q630qhQUQ9EbMvSFqqqqy5csWXKV3+9vVxRFlbH3WQC+MdTAvBw3crPTMbY06+SEcdm7HC6tHyAwjetOp7anr09vqD/SjobGDjQeTegKTJa8damqyk6ePNk9adKkwpUrV94Q0+enCcbeD+BEvH0wFABrAYyXKbGh6M7oL88888zf5+fnZ5w4ceK8qqpMhqlulu3TCrvAg4ICD/Lz3B2Zmc73XS77ABw2OF2OQE62e2uG23FIVRRoaqQNQdMRyQoHOOeD3d3dOoBATU3Nt1VVtcVsvisB37dhiHQ5T6Dy3olNeMbR+9Fj5PF43LW1tT8goqDf7w+oqmpKF/UbEqi06KCGI+1oONKOQ385g2PHu7o0RTnPnXZwzvQsb9rHBXme4Ji8DERbHH0dwA8ADHLO+0KhEJ0/f97/3HPPLZw1a1ZFjIxalcgVkY7TllQtwX+WE06UAY94qpa6dOzMmTMnvvLKK0sWLlz4W7/fj4KCApdpmm0ArpJG0lsA3ms44o86LFAUbnrcjsbCPPdVlhBdgaDe390dgG6Y8etcJqO8lwHoUhRFDwQC1NHRcWbFihUL4jLFX0siNx6WexpRcvTf5SZmJnheBuATADYA2Lx58/uLFi1aD8A5fvz4TMuyTCLyylNwTBpSDZVzftwBwMs5+3pPT+iq3t7Qac5ZDSJVpWg/+csMAOUyrjdFWnmdqqryzs7Owb6+vo6VK1cuePLJJxfFGXCJJP8qmTC5bKQAMHkdqpNMfo28EgCA3bt3NyxatGh9W1vb+YKCgnyn08kty4JMpjili9sqZUW/VFlRjzINkWxykdQoFoDznHOLiHhzc3MXAOv555+/ddmyZdfHCbenE/CXK69kJYD9IwUAiNTq/lFuoC9BnznymDsB4Ny5c+eXL1/+yoYNGz4CYCssLPTZbDYuhBDytKTJnzzOZxfStA7Juw4hBFpbW/sty+qdPXv2hGefffbWysrK8pgx9wF4Lgn/hxFJ8y9P+JZTiG/8Th7HqUn6lAP4AyJV4ZHMxZYtH61Zs2bX9u3bjwMQaWlpHq/Xa9c0jUtXeujAg2VRf3+/0dvb2w/AnDx5csFdd901++6774596zoiRRHJkjFPyqtRmjTSk2KApx7AnlgVmODKvIC4moLt27cffvXVVw/u3LnzRFNTU7dhGEaSaA0xxpSSkpKMWbNmldxyyy1Tbr/99umcc3tcdufO2NB2giTORumqd4wGAC5EqkWeSiFcPR/Av0ij6K/Ry2AwsH///pb6+np/S0tLb2dn56BpmtFYHnw+n1ZYWOiuqKjInzZtWnFeXp4vbt4ziFSB/nqY9a9FpDS/CsC7qcTRUm1FRNRPRD9Jsf/tRLSNLp4+JqIHiciRwprziEgQ0W2Xqli6SJa8bhjBmMtlyevbsrJ8OBokon1EtJqI5o5gnbvl+FsudbG0S+blwogUTnePYGyGzMyWIVLOosZogAFEqshOIHkl6FC0AZGPKRYAqBtpKPliytR7R+OjhYto1xDRUSL6CxF5vogPJhYS0Rki2k1E0z7HjfuIaD0RdRHRz77IL0ZivxxpJqLXiejqS7jxQiL6lVxry2h8rDGaH00VSRV5jTR3axEpZe28yHlV6cp+RxpcLQD+DcNXraeW8roEn81lIvIlyXyZoOxApHDqNzK8nuocy6ROL5GW3x5E6gXrR5NZdom/HZ6MSEXGfGnAvJTiuKnSwTkI4L8A7LhUDLL//3j6S05fegD+ZwD3gk1Njxe3yQAAAABJRU5ErkJggg==","varying vec3 v_positionMC;\n\t\t\t\tvarying vec3 v_positionEC;\n\t\t\t\tvarying vec2 v_st;\n\t\t\t\t\n\t\t\t\tvoid main()\n\t\t\t\t{\n\t\t\t\t\tczm_materialInput materialInput;\n\t\t\t\t\tvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\t\t\t\t#ifdef FACE_FORWARD\n\t\t\t\t\tnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\t\t\t\t#endif\n\t\t\t\t\tmaterialInput.s = v_st.s;\n\t\t\t\t\tmaterialInput.st = v_st;\n\t\t\t\t\tmaterialInput.str = vec3(v_st, 0.0);\n\t\t\t\t\tmaterialInput.normalEC = normalEC;\n\t\t\t\t\tmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\t\t\t\t\tvec3 positionToEyeEC = -v_positionEC;\n\t\t\t\t\tmaterialInput.positionToEyeEC = positionToEyeEC;\n\t\t\t\t\tczm_material material = czm_getMaterial(materialInput);\n\t\t\t\t#ifdef FLAT\n\t\t\t\t\tgl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\t\t\t\t#else\n\t\t\t\t\tgl_FragColor = czm_phong(normalize(positionToEyeEC), material",");\n\t\t\t\t\tif(out_FragColor.r==1.0&&out_FragColor.g==1.0&&out_FragColor.b==1.0&&out_FragColor.a==1.0){\n\t\t\t\t\t\tgl_FragColor.a = 0.0;\n\t\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t\t}\n\t\t\t","GeoLocateRatate","GeoRayPick","isOnly","BoundingRectangle","View","deferred","doPick","minimumRadius","postProcess","offscreen","_frameState","brdfLutGenerator","_brdfLutGenerator","environmentMap","_cubeMap","morphTime","cullingVolume","computeCullingVolume","_terrainExaggeration","minimumDisableDepthTestDistance","_minimumDisableDepthTestDistance","invertClassification","_sunColor","_actualInvertClassificationColor","isTranslucencySupported","invertClassificationColor","maximumScreenSpaceError","CullingVolume","_environmentState","skyAtmosphereCommand","skyBoxCommand","sunDrawCommand","sunComputeCommand","moonCommand","_depthPlane","renderTranslucentDepthForPick","planes","originalFramebuffer","useGlobeDepthFramebuffer","viewport","_hdr","globeDepth","useOIT","usePostProcess","useInvertClassification","PickDepth","derivedCommands","picking","depthOnlyCommand","EPSILON12","mergeSort","updateCamera","far","updateFrustum","ENVIRONMENT","clearGlobeDepth","_depthClearCommand","frustumCommandsList","opaqueFrustumNearOffset","stencilBuffer","updatePass","commands","GLOBE","indices","executeCopyDepth","TERRAIN_CLASSIFICATION","CLASSIFICATION","CESIUM_3D_TILE","CESIUM_3D_TILE_CLASSIFICATION","depthTexture","useDepthPicking","createPotentiallyVisibleSet","executeCopyColor","uniformState","_pickOffscreenView","pickFramebuffer","begin","disableThisFrame","pickEx","end","_defaultView","endFrame","_pick","ray","getDepthEx","readPixels","unpack","getPixelsEx","PickFramebuffer","watchPlane","_picker","Scene","_originalDestory","_originalUpdate","_updatePicked","_content","computeVisibilityWithPlaneMask","MASK_INDETERMINATE","MASK_OUTSIDE","_visibility_Old","visibility","computeIntersectionWithBoundingVolume","clippingPlanesOriginMatrix","_isClipped","INSIDE","OUTSIDE","Cesium3DTile","projectTo2D","_boundingVolume2D","MASK_INSIDE","INTERSECTING","COLUMN0ROW0","COLUMN0ROW1","COLUMN0ROW2","COLUMN1ROW0","COLUMN2ROW0","COLUMN2ROW2","_videoProject","_context2D","_width","_dirty","_sampler","_updateSize","videoWidth","timeupdate","_getCurrentTexture","_createSampler","_source","params","UNSIGNED_BYTE","copyFrom","_recreateParseCanvas","drawImage","nextPowerOfTwo","_readVideoFramePixels","videoHeight","_videoProjection","_uniforms","_postStage","_videoTexture","_addEvent","_removeEvent","_createEvent","_FS_Cone","uniform float mixNum;\n","uniform float videoDistance;\n","uniform sampler2D videoTexture;\n","uniform mat4 videoMapMatrix;\n","uniform mat4 videoViewMatrix;\n","uniform vec3 videoMapPosition;\n"," vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n"," return posInCamera;\n","bool videoVisibility(sampler2D shadowMap, vec4 position){\n"," vec4 positionEC = toEye(v_textureCoordinates, depth);\n"," if (any(lessThan(videoPosition.xyz, vec3(0.0))) || any(greaterThan(videoPosition.xyz, vec3(1.0))))\n"," bool visibility = videoVisibility(videoMapTexture, videoPosition);\n"," if(visibility){\n"," vec4 videoColor = texture(videoTexture, videoPosition.xy);\n"," }else{\n","_FS_Cone_Fill","uniform sampler2D videoMapTexture;\n","uniform vec4 u_videoColor;\n"," float visibility = step(position.z, texture(shadowMap, position.xy).r);\n"," return (visibility === 1.0);\n"," vec4 videoPosition = videoMapMatrix * positionEC;\n"," videoPosition /= videoPosition.w;\n"," vec4 videoColor = u_videoColor;\n"," out_FragColor = vec4(mix(color.rgb, videoColor.rgb, mixNum), 1.0);\n","_FS_Sphere"," mat4 viewScene = videoViewMatrix;\n"," out_FragColor = color;\n"," return;\n","_FS_Sphere_Fill"," vec4 positionWC = viewScene * positionEC;\n"," depth = length(videoMapPosition - positionWC.xyz);\n","_updateState","_getCurrentVideoTexture","fillVideo","_createUniforms","_createPostStage","_clearData","_addToScene","_removeFromScene","mixFactor","_getShadowMapTexture","_getShadowMapMatrix","_getViewMatrix","hitlineColor","fovDistance","_updatePost","hitlineType","_MinFovX","_maxFovX","_minFovY","_MinFovY","_maxFovY","_MaxFovY","_minFovDistance","_MinFovDistance","_maxFovDistance","_MaxFovDistance","_minHeading","_MinHeading","_maxHeading","_MaxHeading","_MinPitch","_maxPitch","_MaxPitch","_minRoll","_MinRoll","_MaxRoll","_minSegmentCount","_maxSegmentCount","_MaxSegmentCount","_isInvSphere","_isSphereType","_minFovX","_minPitch","_maxRoll","_MinSegmentCount","clampSegmentCount","clampFovY","clampFovDistance","clampHeading","clampPitch","_videoProjectionCamera","_fovY","_fovDistance","_mixFactor","_vs","_fs","_renderState","_segmentCount","_isNeedRecreate","_visibly","_shaderProgram","minFovX","config","maxFovX","maxFovY","minFovDistance","minHeading","maxHeading","minPitch","maxPitch","minRoll","maxRoll","minSegmentCount","maxSegmentCount","isSphereType","isInvSphere","fovX!","minFovY","fovY!","maxFovDistance","fovDistance!","heading!","roll!","mixFactor!","_render","render!","_getProjectionCamera","update!","_updatePosition","_tryCreate","_updateFovX","fovX","_updateFovY","_updatePitch","_updateRoll","_updateParams","fovY","_computeTransformInv","_computeTransform!","_createVS","uniform vec4 uDiffuseColor;\n","varying vec4 vColor;\n","varying vec4 clip_vertex;\n","varying float fWindowZ;\n","varying vec3 normal_vertex;\n","vec4 depthClampFarPlane(vec4 clipPos)\n"," fWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\n"," return clipPos;\n"," vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n"," gl_Position = depthClampFarPlane(pos);\n"," vColor = uDiffuseColor;\n"," normal_vertex = aPosition.xyz;\n","#extension GL_EXT_frag_depth : enable\n","#extension GL_OES_standard_derivatives : enable\n"," gl_FragDepth = min(fWindowZ * gl_FragCoord.w, 1.0);\n"," vec3 normal = cross(vec3(dFdx(normal_vertex.x), dFdx(normal_vertex.y), dFdx(normal_vertex.z)), vec3(dFdy(normal_vertex.x), dFdy(normal_vertex.y), dFdy(normal_vertex.z)));\n"," normal = normalize(normal);\n"," vec3 lightDirection = normalize(czm_sunPositionWC - vec3(eyePosition));\n"," vec4 diffuse = vColor * LIGHT_COLOR * nDotL;\n"," vec4 ambient = vColor * LIGHT_COLOR;\n"," out_FragColor = clamp(diffuse + ambient, vec4(0.0), vec4(1.0));\n","_createVACone","_fovX","_createBoundingVolume","_createVASphere","_createVA!","_createVASphereInv","_createRenderState","_createAttributes","_createShadeProgram","_createShadeProgram!","_createFS","fromCornerPoints","_updateBoundingVolume!","_computeTransform","_recreate!","LINES","_shadowMap","_updateMatrixEvent","_updateEvent","_createFramebufferDepth","_textureSize","_passes","_shadowMapTexture","_clearFramebuffer","_clearPassState","_destroyShadowFramebuffer","_colorAttachment","build","_updateOri","_sceneCamera","_lightCamera","videoProjectionMaps","deactive","updateFovX","updateFovY","updateFovDistance","_shadowMapMatrix","_nextName","VideoProjection","_instance","nextName","GeoVideoProjection","_videoProjectionConfig","_videoProjectionFrustumPrimitive","_videoTextureSource","_videoProjectionPostRender","_videoShadowMap","_fillVideo","DeveloperErrorEvent","AddToSceneEvent","RemoveFromSceneEvent","UpdateMatrixEvent","UpdateEvent","_rebuildPostRender","CreationEvent","clampFovX","_createShadowMap","_destroyPostStage","updatePosition","_updateFovDistance","_updateHeading","updateHeadingPitchRoll","updatePitch","updateRoll","clampRoll","updateHitLineColor","updateMixFactor","updateLineWidth","isSamedName","isSelf","updateHeading","_type","visibly","_removeAllEvent","_projectBackFaces","noname!","_findByName","destoryObject","getByIndex","removeByIndex","removeByName","getNames","_videoProjectionCollection","_renderVideoProjectionCollection","destroyAllVideoProjections","destroyVideoProjection","createVideoProjection","getVideoProjectionCollection","_clearPassesVideoProjectionCommands","_executePassesVideoProjectionCommands","_executeVideoProjectionCommand","shadows","castCommands","projectBackFaces","outOfView","shadowMapCullingVolume","_updateVideoProjectionCommand","castShadows","isVisible","originalCommand","createCastDerivedCommand","_updateVideoProjectionCommands","debugCommandFilter","logDepth","hdr","debugShowCommands","shadowState","receiveShadows","receiveCommand","oit","lightShadowMaps","lightShadowsEnabled","pickId","DerivedCommand","pickOnly","createDepthOnlyDerivedCommand","createHdrCommand","createReceiveDerivedCommand","isSupported","createDerivedCommands","GeoViewAnalyse","_stage","filterFar","inputPreviousStageTexture","_textureCache","outputTexture","_index","pixelFormat","forcePowerOfTwo","pixelDatatype","clearColor","initStage","uniform float u_filterFar;\n","vec4 clipToEye(vec2 uv, float depth)\n"," vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n"," vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\n"," posEC = posEC / posEC.w;\n","void main() {\n"," hsb.g = clamp(hsb.g + 0.03, 0.0, 1.0);\n"," if (hsb.b > 0.5)\n"," hsb.b = clamp(hsb.b + 0.01, 0.0, 1.0);\n"," hsb.b = clamp(hsb.b - 0.02, 0.0, 1.0);\n"," float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n"," vec4 posInCamera = clipToEye(v_textureCoordinates, depth);\n"," float d = length(posInCamera.xyz);\n"," if (d > u_filterFar)\n"," out_FragColor = vec4(mix(color.rgb, vec3(0.8, 0.85, 0.85), 1.0 - u_filterFar / d), 1.0);\n"," else \n"," out_FragColor = vec4(color.rgb, 1.0);\n","enableFilter","_isSupported","GeoWalkerAnimationCamera","path","moveStep","rotateStep","frameChange","_lockCamera","walkFrame","addChangeEventListener","_hooker","_hookUpdate","geoposition","unactivate","_walkAnimation","_isPause","changeEvent","raiseChangeEvent","isDone","_isDone","isPause","_begin","_toStop","state","_loadGeoposition","_loadDirection","run","ComputeTimeDelta","getMilliseconds","getSeconds","getMinutes","_createState","date","endDirection","moveSpeed","rotateSpeed","rotateSize","manHeight","manRange","stateType","UNKNOWN","_readyCamera","_walkQueue","canLog","_collideActived","collideActived","filterFog","keys","GeoWalkerCamera","logarithmicDepthBuffer","raiseUpdate","FORWARD","LEFTWARD","computeLeftward","UPWARD","computeTrunUp","DOWNWARD","computeTrunDown","computeTrunRight","jumpUp","computeInitialPosition","computeForeward","_computeCollideDistance","Forward : height = ","Forward Node : height = ","computeBackward","getTangentNormal","Backward : height = ","Backward Node : height = ","collide :"," max: ","Not collide","computeTrunLeft","raiseMouseMove","filterWithCamera","getFront","getRear","getAvgHeight","getDropThreshold","preventFalling","getLatelyHeight","GeoWater","_pointsToCartographic","_waterColor","_refractColor","_waveWidth","_flowDirection","_flowSpeed","_normalTexture","_m_startTime","_reflectCamera","_reflectPassState","_isVisible","_waterPolygon","_computeBoundingRectangle","_polygonHierarchy","_lonMin","_latMin","_waterCenterPos","initialize","RenderbufferFormat","DEPTH_COMPONENT16","PassState","_initialized","waterPolygon","workingFrustums","_fScale","setRow","invWorldViewMatrix","modelViewMatrix","modeiViewProjection","_fElapse","_frameTime","_flowAngle","in vec3 position;\n\t\t\t\t\t\t\t\t\t\t\tattribute vec2 st;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_modelViewProjectionMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_modelViewMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_invWorldViewMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_texCoordOffset;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_texCoordScale;\n\t\t\t\t\t\t\t\t\t\t\tuniform float u_frameTime;\n\t\t\t\t\t\t\t\t\t\t\tuniform int u_clampToGroud;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec3 u_camPos;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec3 u_scale;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec3 eyeDir;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec2 texCoord;\n\t\t\t\t\t\t\t\t\t\t\tvarying float myTime;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec4 projectionCoord;\n\t\t\t\t\t\t\t\t\t\t\tvoid main(void)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//gl_Position = ftransform();\n\t\t\t\t\t\t\t\t\t\t\t\tgl_Position = u_modelViewProjectionMatrix * vec4(position.xyz,1.0);\n\t\t\t\t\t\t\t\t\t\t\t\tif (u_clampToGroud === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\teyeDir = (u_camPos - position.xyz) * u_scale;\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec4 pos = u_modelViewMatrix * vec4(position.xyz,1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\teyeDir = vec3(u_invWorldViewMatrix*vec4(pos.xyz,0.0));\n\t\t\t\t\t\t\t\t\t\t\t\t\tprojectionCoord = gl_Position;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\ttexCoord = (st+u_texCoordOffset)*u_texCoordScale;\n\t\t\t\t\t\t\t\t\t\t\t\tmyTime = 0.01 * u_frameTime;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t","uniform sampler2D u_normalMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform sampler2D u_refractMap;\n\t\t\t\t\t\t\t\t\t\t\t\t//uniform samplerCube u_cubeMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform sampler2D u_reflectMap;\n\t\t\t\t\t\t\t\t\t\t\t\t//uniform sampler2D u_flowMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_waterColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_refractColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform int u_useRefractTex;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_reflectColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform int u_reflection;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_flowDir;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec3 eyeDir;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec2 texCoord;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying float myTime;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec4 projectionCoord;\n\t\t\t\t\t\t\t\t\t\t\t\tvoid main (void)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t// texScale determines the amount of tiles generated.\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat texScale = 35.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// texScale2 determines the repeat of the water texture (the normalmap) itself\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat texScale2 = 10.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat myangle;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat transp;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 myNormal;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 mytexFlowCoord = texCoord * texScale;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// ff is the factor that blends the tiles.\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 ff = abs(2.0*(fract(mytexFlowCoord)) - 1.0) -0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// take a third power, to make the area with more or less equal contribution\n\t\t\t\t\t\t\t\t\t\t\t\t\t// of more tile bigger\n\t\t\t\t\t\t\t\t\t\t\t\t\tff = 0.5-4.0*ff*ff*ff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// ffscale is a scaling factor that compensates for the effect that\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adding normal vectors together tends to get them closer to the average normal\n\t\t\t\t\t\t\t\t\t\t\t\t\t// which is a visible effect. For more or less random waves, this factor\n\t\t\t\t\t\t\t\t\t\t\t\t\t// compensates for it\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 ffscale = sqrt(ff*ff + (1.0-ff)*(1.0-ff));\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 Tcoord = texCoord * texScale2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// offset makes the water move\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 offset = vec2(myTime,0.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// I scale the texFlowCoord and floor the value to create the tiling\n\t\t\t\t\t\t\t\t\t\t\t\t\t// This could have be replace by an extremely lo-res texture lookup\n\t\t\t\t\t\t\t\t\t\t\t\t\t// using NEAREST pixel.\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 sample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor(mytexFlowCoord)/ texScale).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// flowdir is supposed to go from -1 to 1 and the line below\n\t\t\t\t\t\t\t\t\t\t\t\t\t// used to be sample.xy * 2.0 - 1.0, but saves a multiply by\n\t\t\t\t\t\t\t\t\t\t\t\t\t// moving this factor two to the sample.b\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 flowdir = sample.xy -0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// sample.b is used for the inverse length of the wave\n\t\t\t\t\t\t\t\t\t\t\t\t\t// could be premultiplied in sample.xy, but this is easier for editing flowtexture\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir *= sample.b;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// build the rotation matrix that scales and rotates the complete tile\n\t\t\t\t\t\t\t\t\t\t\t\t\tmat2 rotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// this is the normal for tile A\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT0 = texture(u_normalMap, rotmat * Tcoord - offset).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// for the next tile (B) I shift by half the tile size in the x-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.5,0)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and the normal for tile B...\n\t\t\t\t\t\t\t\t\t\t\t\t\t// multiply the offset by some number close to 1 to give it a different speed\n\t\t\t\t\t\t\t\t\t\t\t\t\t// The result is that after blending the water starts to animate and look\n\t\t\t\t\t\t\t\t\t\t\t\t\t// realistic, instead of just sliding in some direction.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// This is also why I took the third power of ff above, so the area where the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// water animates is as big as possible\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adding a small arbitrary constant isn't really needed, but helps to show\n\t\t\t\t\t\t\t\t\t\t\t\t\t// a bit less tiling in the beginning of the program. After a few seconds, the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tiling cannot be seen anymore so this constant could be removed.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// For the quick demo I leave them in. In a simulation that keeps running for\n\t\t\t\t\t\t\t\t\t\t\t\t\t// some time, you could just as well remove these small constant offsets\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT1 = texture(u_normalMap, rotmat * Tcoord - offset*1.06+0.62).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blend them together using the ff factor\n\t\t\t\t\t\t\t\t\t\t\t\t\t// use ff.x because this tile is shifted in the x-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalTAB = ff.x * NormalT0 + (1.0-ff.x) * NormalT1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the scaling of NormalTab and NormalTCD is moved to a single scale of\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalT later in the program, which is mathematically identical to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalTAB = (NormalTAB - 0.5) / ffscale.x + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tile C is shifted in the y-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.0,0.5)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT0 = texture(u_normalMap, rotmat * Tcoord - offset*1.33+0.27).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tile D is shifted in both x- and y-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.5,0.5)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT1 = texture(u_normalMap, rotmat * Tcoord - offset*1.24).rg ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalTCD = ff.x * NormalT0 + (1.0-ff.x) * NormalT1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalTCD = (NormalTCD - 0.5) / ffscale.x + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// now blend the two values togetherv\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT = ff.y * NormalTAB + (1.0-ff.y) * NormalTCD;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// this line below used to be here for scaling the result\n\t\t\t\t\t\t\t\t\t\t\t\t\t//NormalT = (NormalT - 0.5) / ffscale.y + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// below the new, direct scaling of NormalT\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT = (NormalT - 0.5) / (ffscale.y * ffscale.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// scaling by 0.3 is arbritrary, and could be done by just\n\t\t\t\t\t\t\t\t\t\t\t\t\t// changing the values in the normal map\n\t\t\t\t\t\t\t\t\t\t\t\t\t// without this factor, the waves look very strong\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT *= 0.3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// to make the water more transparent\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransp = 1.0;//texture( u_flowMap, texFlowCoord ).a;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and scale the normals with the transparency\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT *= transp*transp;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// assume normal of plane is 0,0,1 and produce the normalized sum of adding NormalT to it\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyNormal = vec3(NormalT,sqrt(1.0-NormalT.x*NormalT.x - NormalT.y*NormalT.y));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 获取反射颜色。\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 envColor = u_reflectColor.rgb;//vec3(0.5647, 0.6941, 0.8235);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (u_reflection === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//vec3 reflectDir = reflect(eyeDir, myNormal);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//vec3 envColor = vec3(czm_textureCube(u_cubeMap, -reflectDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 如果要实现反射真实场景,需要把场景渲染5遍构建一个无底的立方体纹理。\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 目前使用一张反射纹理近似模拟。\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 final = projectionCoord.xy / projectionCoord.w;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfinal = final * 0.5 + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfinal.y = 1.0 - final.y;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tenvColor = texture(u_reflectMap, final + myNormal.xy/texScale2*transp).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t// very ugly version of fresnel effect\n\t\t\t\t\t\t\t\t\t\t\t\t\t// but it gives a nice transparent water, but not too transparent\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyangle = dot(myNormal,normalize(eyeDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyangle = 0.95-0.6*myangle*myangle;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blend in the color of the plane below the water\n\t\t\t\t\t\t\t\t\t\t\t\t\t// add in a little distortion of the colormap for the effect of a refracted\n\t\t\t\t\t\t\t\t\t\t\t\t\t// view of the image below the surface.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// (this isn't really tested, just a last minute addition\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and perhaps should be coded differently\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the correct way, would be to use the refract routine, use the alpha channel for depth of\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the water (and make the water disappear when depth = 0), add some watercolor to the colormap\n\t\t\t\t\t\t\t\t\t\t\t\t\t// depending on the depth, and use the calculated refractdir and the depth to find the right\n\t\t\t\t\t\t\t\t\t\t\t\t\t// pixel in the colormap.... who knows, something for the next version\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 base = u_refractColor.rgb;//vec3(0.3, 0.4, 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (u_useRefractTex === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbase = texture(u_refractMap,(texCoord + myNormal.xy/texScale2*0.03*transp)*32.0).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbase = mix(base, u_waterColor.rgb, u_waterColor.a);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 光照计算\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 lightDir = czm_sunDirectionEC;//normalize(vec3(0.0, 0.0, 1.0)); // 光照方向需要从外面传入\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 reflectVec = reflect(-lightDir, myNormal);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat diffuse = max(0.0, dot(myNormal, lightDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat spec = max(dot(reflectVec, normalize(-eyeDir)), 0.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tspec = pow(spec, 128.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//float lightIntensity = 0.7 * diffuse + 0.3 * spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat lightIntensity = 0.3 * spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(mix(base, envColor, myangle*transp), 1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor += vec4(0.8)*lightIntensity;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// note that smaller waves appear to move slower than bigger waves\n\t\t\t\t\t\t\t\t\t\t\t\t\t// one could use the tiles and give each tile a different speed if that\n\t\t\t\t\t\t\t\t\t\t\t\t\t// is what you want\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t","_uniformMap","getColorTexture","_reflectColor","_waterGeometry","UNSIGNED_INT","water","_updateReflectTexture","ComputeCommand","proxy","metadata","roadMetadata","roadUrl","labelGraphics","billboardGraphics","aotuCollide","collisionPadding","serverFirstStyle","tileCache","labelCache","_isInitial","_latelyGrid","_UUID","GEO_WTFS_LABEL_","_UUIDRoad","getCacheTile","removeCacheTile","getCacheLabel","oid","addCacheLabel","removeCacheLabel","timestamp","getTileUrl","/GetTiles?lxys={z},{x},{y}","getIcoUrl","/GetIcon?id={id}","getRoadTileUrl","_timer","_tilesToRender","getTilesToRender","compareArray","_queueCall","_latelyRefreshStamp"];n=S,function(e){for(;--e;)n.push(n.shift())}(310);var T,P=function(e,t){return S[e-=0]},M=function(){function e(e,t){for(var i=0;iL.toRadians(20)?.75*v.positionCartographic[P("0x8b")]:v[P("0x91")].height-p);v[P("0x9e")](Le,Ne*Re)}}else G=!0}}e[P("0x58")]=!G}if(!A&&G||I){var Oe=S[P("0x9f")](m,e._zoomWorldPosition,B),Fe=(C!==E[P("0x8a")]&&n[P("0x84")](t,e[P("0x51")])&&l(Oe)?v[P("0x86")](Oe,k):v.getPickRay(t,k)).direction;C!==E[P("0x8a")]&&C!==E.SCENE2D||o[P("0x88")](Fe.y,Fe.z,Fe.x,Fe),v[P("0xa0")](Fe,p),e[P("0x57")]=!0}else v[P("0x82")](p);v[P("0x9c")](se)}else v[P("0x82")](p)}}}}var le=new y,ce=new y,ue=new o;function he(e,t,i){var r=e[P("0x42")][P("0x7e")],n=r[P("0x86")](i[P("0x63")],le)[P("0x87")],a=r[P("0x86")](i.endPosition,ce).origin;n=o[P("0x88")](n.y,n.z,n.x,n),a=o[P("0x88")](a.y,a.z,a.x,a);var s=o[P("0x95")](n,a,ue),x=o[P("0x96")](s);0e[P("0x5e")]&&(i=e[P("0x5e")]),ia[P("0x8c")].z&&l(r))return o.clone(r,e._strafeStartPosition),e[P("0x56")]=!0,tt(e,t,i),void(e[P("0xb7")]=n[P("0x6e")](t,e[P("0xb7")]));var f=v[P("0xb9")](u,h,Ee);c=a[P("0x86")](s,ye);var g=d.rayPlane(c,f,Ae),p=a.getPickRay(x,_e),m=d[P("0xba")](p,f,Ie);if(!l(g)||!l(m))return e[P("0x54")]=!0,Bt(e,t,i),void n[P("0x6e")](t,e[P("0xb6")]);var b=o[P("0x95")](g,m,we),C=b.x;b.x=b.y,b.y=b.z,b.z=C;var y=o[P("0x96")](b);y>L[P("0xbb")]&&(o[P("0x8d")](b,b),a[P("0xa0")](b,y))}}var Me=new n,Ne=new y,Le=new o,Re=new o,Oe=new m,Fe=new m,De=new o,ke=new v(o.UNIT_X,0),Ue=new o,Be=new s,We=new m,Ve=new C,je=new p,ze=new o;function He(e,t,i){if(l(i[P("0xaa")])&&(i=i.angleAndHeight),n.equals(t,e[P("0x4d")])||(e[P("0x53")]=!1,e._looking=!1),e[P("0x54")])Bt(e,t,i);else{var r=e[P("0x42")].camera;e[P("0x53")]||!e[P("0xbc")]()||r[P("0x8c")].z>e[P("0x3c")]?(e[P("0x53")]=!0,function(e,t,i){var r=e[P("0x42")],a=r.camera,s=r.canvas,x=Me;x.x=s[P("0x94")]/2,x.y=s[P("0x7c")]/2;var c,u=a[P("0x86")](x,Ne),f=o[P("0xb8")],d=u.origin,g=u[P("0x93")],p=o[P("0x92")](f,g);if(Math[P("0x78")](p)>L[P("0xbb")]&&(c=-o.dot(f,d)/p),!l(c)||c<=0)return e[P("0x54")]=!0,Bt(e,t,i),n[P("0x6e")](t,e[P("0x4d")]);var b=o.multiplyByScalar(g,c,Le);o.add(d,b,b);var v=r[P("0xbd")],C=v.ellipsoid;o[P("0x88")](b.y,b.z,b.x,b);var y=v[P("0xbe")](b,Be);C[P("0xa7")](y,b);var A=_[P("0xbf")](b,C,Oe),I=e[P("0x43")],w=e._ellipsoid;e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e._rotateFactor=1,e[P("0xc1")]=1;var G=m[P("0x6e")](a[P("0xaf")],We);a[P("0xc2")](A),xt(e,t,i,o[P("0xc3")]),a._setTransform(G),e[P("0x43")]=I;var E=(e[P("0x44")]=w)[P("0xc4")];e._rotateFactor=1/E,e[P("0xc1")]=E}(e,t,i)):function(e,t,i){var r,a,s=e[P("0x42")],x=s[P("0x7e")],c=o[P("0xb8")];if(n.equals(t,e[P("0x4d")]))r=o[P("0x6e")](e[P("0xc5")],Le);else{if(x[P("0x8c")].zL[P("0xbb")]&&(u=-o[P("0x92")](c,f)/b),!l(u)||u<=0)return e[P("0x54")]=!0,Bt(e,t,i),n[P("0x6e")](t,e[P("0x4d")]);r=o[P("0x6c")](g,u,Le),o.add(f,r,r)}n[P("0x6e")](t,e._tiltCenterMousePosition),o[P("0x6e")](r,e[P("0xc5")])}var y=s[P("0x48")],A=Me;A.x=y[P("0x94")]/2,A.y=e._tiltCenterMousePosition.y,a=x[P("0x86")](A,Ne);var I=o[P("0x6e")](o.ZERO,De);I.x=r.x;var w=v[P("0xb9")](I,c,ke),G=d[P("0xba")](a,w,Re),E=x[P("0xc6")],S=E.ellipsoid;o[P("0x88")](r.y,r.z,r.x,r);var T=E[P("0xbe")](r,Be);S[P("0xa7")](T,r);var M,N=_[P("0xbf")](r,S,Oe);M=l(G)?(o[P("0x88")](G.y,G.z,G.x,G),T=E[P("0xbe")](G,Be),S[P("0xa7")](T,G),_[P("0xbf")](G,S,Fe)):N;var R=e._globe,O=e._ellipsoid;e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e[P("0x5d")]=1,e[P("0xc1")]=1;var F=o[P("0xc3")],D=m[P("0x6e")](x.transform,We);x[P("0xc2")](N);var k=o[P("0x99")](o[P("0xc3")],o[P("0x8d")](x.position,Ue),Ue),U=o[P("0x92")](x[P("0x9b")],k);if(xt(e,t,i,F,!1,!0),x._setTransform(M),U<0){i[P("0x63")].y>i[P("0x64")].y&&(F=void 0);var B=x.constrainedAxis;x[P("0xc7")]=void 0,xt(e,t,i,F,!0,!1),x[P("0xc7")]=B}else xt(e,t,i,F,!0,!1);if(l(x[P("0xc7")])){var W=o[P("0x99")](x[P("0x93")],x.constrainedAxis,ze);o[P("0x62")](W,o[P("0x6f")],L[P("0xbb")])||(o[P("0x92")](W,x[P("0x9b")])<0&&o[P("0xc8")](W,W),o[P("0x99")](W,x.direction,x.up),o.cross(x[P("0x93")],x.up,x[P("0x9b")]),o.normalize(x.up,x.up),o.normalize(x[P("0x9b")],x[P("0x9b")]))}x._setTransform(D),e[P("0x43")]=R;var V=(e._ellipsoid=O)[P("0xc4")];e[P("0x5d")]=1/V,e[P("0xc1")]=V;var j=o[P("0x6e")](x[P("0xa5")],Ue);if(e[P("0x41")]&&jt(e),!o[P("0x84")](x[P("0xa5")],j)){x._setTransform(M),x[P("0xc9")](j,j);var z=o.magnitudeSquared(j);o.magnitudeSquared(x[P("0x8c")])>z&&(o.normalize(x[P("0x8c")],x[P("0x8c")]),o[P("0x6c")](x[P("0x8c")],Math[P("0xca")](z),x.position));var H=o[P("0xcb")](j,x[P("0x8c")]),q=o[P("0x99")](j,x[P("0x8c")],j);o[P("0x8d")](q,q);var X=C[P("0xcc")](q,H,Ve),Y=p[P("0xcd")](X,je);p[P("0xce")](Y,x.direction,x[P("0x93")]),p[P("0xce")](Y,x.up,x.up),o[P("0x99")](x[P("0x93")],x.up,x[P("0x9b")]),o.cross(x[P("0x9b")],x[P("0x93")],x.up),x._setTransform(D)}}(e,t,i)}}var qe=new n,Xe=new y,Ye=new o;function Ke(e,t,i){l(i.distance)&&(i=i[P("0x8e")]);var r=e[P("0x42")],n=r[P("0x7e")],a=r[P("0x48")],s=qe;s.x=a.clientWidth/2,s.y=a[P("0x7c")]/2;var x,c,u=n[P("0x86")](s,Xe);if(n[P("0x8c")].ze._minimumTrackBallHeight?(e[P("0x55")]=!0,xt(e,t,i)):(e[P("0x54")]=!0,Bt(e,t,i,c)),n.clone(t,e._rotateMousePosition))}else{i&&i[P("0x63")]&&i[P("0x64")]&&(t=i[P("0x64")],i[P("0x64")]=i[P("0x63")],i.startPosition=t,i[P("0x64")].x=(i.startPosition.x+i[P("0x64")].x)/2,i[P("0x64")].y=(i[P("0x63")].y+i[P("0x64")].y)/2);var p=function(e){var t=e[P("0x42")],i=t[P("0x7e")],r=t[P("0x43")][P("0x44")],n=_[P("0xbf")](i[P("0x8c")],r,wt),a=m.clone(i[P("0xaf")],Et);i[P("0xc2")](n);var s=new o;return s=m[P("0xd4")](i.viewMatrix,s,s),i._setTransform(a),s}(e);r[P("0x80")]>L[P("0x77")](e.constrainedPitch,-L.PI,0)&&0<=i.startPosition.y-i[P("0x64")].y||0e[P("0x5e")]&&(d=e[P("0x5e")]),de[P("0x3e")]?(e._tiltOnEllipsoid=!0,function(e,t,i){var r=e[P("0x44")],a=e[P("0x42")],s=a[P("0x7e")],x=.25*e[P("0x30")],c=r[P("0xd6")](s[P("0xa5")],Lt)[P("0x8b")];if(!(c-x-1e._minimumTrackBallHeight)){e[P("0x54")]=!0;var v=e[P("0x44")][P("0xd5")](s.position,Mt);return Bt(e,t,i,v),n[P("0x6e")](t,e._tiltCenterMousePosition)}var C=d[P("0xe3")](p,r);if(!l(C))return;var A=r[P("0xd6")](C,Pt);A.height=0,g=r.cartographicToCartesian(A,At)}var I=_[P("0xbf")](g,r,wt),w=e[P("0x43")],G=e[P("0x44")];e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e[P("0x5d")]=1,e[P("0xc1")]=1;var E=m[P("0x6e")](s[P("0xaf")],Et);s._setTransform(I),s[P("0x80")]>L[P("0x77")](e.constrainedPitch,-L.PI,0)&&0<=i[P("0x63")].y-i[P("0x64")].y?xt(e,0,i,o.UNIT_Z,!1,!0):xt(e,0,i,o[P("0xc3")]),s._setTransform(E),e[P("0x43")]=w;var S=(e._ellipsoid=G)[P("0xc4")];e._rotateFactor=1/S,e[P("0xc1")]=S}}(e,t,i)):function(e,t,i){var r,a,s,x=e[P("0x44")],c=e[P("0x42")],u=c[P("0x7e")];if(n[P("0x84")](t,e[P("0x4d")]))r=o.clone(e[P("0xc5")],At);else{if(r=Ce(e,t,At),!l(r)){if(a=u[P("0x86")](t,_t),s=d.rayEllipsoid(a,x),!l(s)){if(x[P("0xd6")](u[P("0x8c")],Pt)[P("0x8b")]<=e[P("0x40")]){e._looking=!0;var f=e[P("0x44")][P("0xd5")](u[P("0x8c")],Mt);Bt(e,t,i,f),n[P("0x6e")](t,e._tiltCenterMousePosition)}return}r=y[P("0xe1")](a,s[P("0xe2")],At)}n.clone(t,e[P("0x4d")]),o.clone(r,e[P("0xc5")])}var g=c[P("0x48")],b=yt;b.x=g[P("0x94")]/2,b.y=e[P("0x4d")].y,a=u[P("0x86")](b,_t);var v=o.magnitude(r),A=o[P("0x88")](v,v,v,nt),I=h[P("0xd7")](A,ot);if(s=d[P("0xe0")](a,I),l(s)){var w=o[P("0x96")](a[P("0x87")])>v?s.start:s[P("0xe4")],G=y[P("0xe1")](a,w,It),E=_[P("0xbf")](r,x,wt),S=_[P("0xbf")](G,I,Gt),T=e[P("0x43")],M=e[P("0x44")];e[P("0x43")]=void 0,e[P("0x44")]=h.UNIT_SPHERE,e[P("0x5d")]=1,e[P("0xc1")]=1;var N=o[P("0xc3")],R=m[P("0x6e")](u[P("0xaf")],Et);u._setTransform(E);var O=o[P("0x99")](G,u.positionWC,ze),F=o[P("0x92")](u[P("0xe5")],O);if(xt(e,0,i,N,!1,!0),u[P("0xc2")](S),F<0){i.startPosition.y>i[P("0x64")].y&&(N=void 0);var D=u[P("0xc7")];u[P("0xc7")]=void 0,xt(e,0,i,N,!0,!1),u.constrainedAxis=D}else(u[P("0x80")]W&&(o.normalize(u[P("0x8c")],u[P("0x8c")]),o[P("0x6c")](u[P("0x8c")],Math[P("0xca")](W),u[P("0x8c")]));var V=o[P("0xcb")](B,u[P("0x8c")]),j=o[P("0x99")](B,u.position,B);o[P("0x8d")](j,j);var z=C.fromAxisAngle(j,V,St),H=p[P("0xcd")](z,Tt);p[P("0xce")](H,u[P("0x93")],u[P("0x93")]),p[P("0xce")](H,u.up,u.up),o[P("0x99")](u[P("0x93")],u.up,u[P("0x9b")]),o[P("0x99")](u[P("0x9b")],u[P("0x93")],u.up),u._setTransform(R)}}}(e,t,i)}}var Lt=new s,Rt=new n,Ot=new n,Ft=new y,Dt=new y,kt=new o,Ut=new o;function Bt(e,t,i,r){var n=e[P("0x42")][P("0x7e")],a=Rt;a.x=i.startPosition.x,a.y=0;var s=Ot;s.x=i[P("0x64")].x,s.y=0;var c,u,h=n[P("0x86")](a,Ft),f=n[P("0x86")](s,Dt),d=0;n.frustum instanceof b?(c=h[P("0x87")],u=f[P("0x87")],o[P("0x6d")](n[P("0x93")],c,c),o.add(n[P("0x93")],u,u),o[P("0x95")](c,n[P("0x8c")],c),o[P("0x95")](u,n[P("0x8c")],u),o[P("0x8d")](c,c),o[P("0x8d")](u,u)):(c=h[P("0x93")],u=f[P("0x93")]);var g=o[P("0x92")](c,u);g<1&&(d=Math[P("0xdc")](g)),d=i[P("0x63")].x>i[P("0x64")].x?-d:d;var p=e[P("0x4c")];if(l(r)?n[P("0xe7")](r,-d):l(p)?n[P("0xe7")](p,-d):n.lookLeft(d),a.x=0,a.y=i[P("0x63")].y,s.x=0,s.y=i[P("0x64")].y,h=n.getPickRay(a,Ft),f=n[P("0x86")](s,Dt),d=0,n[P("0xe8")]instanceof b?(c=h[P("0x87")],u=f.origin,o[P("0x6d")](n[P("0x93")],c,c),o[P("0x6d")](n[P("0x93")],u,u),o.subtract(c,n[P("0x8c")],c),o[P("0x95")](u,n.position,u),o.normalize(c,c),o[P("0x8d")](u,u)):(c=h[P("0x93")],u=f.direction),(g=o.dot(c,u))<1&&(d=Math.acos(g)),d=i.startPosition.y>i[P("0x64")].y?-d:d,r=x(r,p),l(r)){var m=n[P("0x93")],v=o.negate(r,kt),C=o[P("0x62")](m,r,L[P("0xe9")]),y=o.equalsEpsilon(m,v,L[P("0xe9")]);if(C||y)(C&&d<0||y&&0=n[5]?(n[6]=n[0],n[7]=n[1],n[8]=n[5]):(n[6]=n[3],n[7]=n[4],n[8]=n[2]),t[P("0x187")](t[P("0x0")]-1)[P("0x19f")]=e[P("0x11")].fromDegreesArrayHeights(n)),i?i.get(i[P("0x0")]-1).position=e[P("0x11")][P("0x1a1")](l,c,u):((i=r[P("0x17d")][P("0x6d")](new e.LabelCollection)).name=P("0x193"),i[P("0x6d")]({text:P("0x185"),font:P("0x1a0"),showBackground:!0,disableDepthTestDistance:Number[P("0x31")]}),i[P("0x187")](i[P("0x0")]-1).position=e[P("0x11")][P("0x1a1")](l,c,u))}else i&&(r[P("0x17d")].remove(i),i=null)}),e[P("0x161")][P("0x163")]),this[P("0x16f")][P("0x160")]((function(t){if(r[P("0x16f")]=r.handler&&r.handler.destroy(),r.viewer[P("0x48")].style[P("0x170")]=P("0x18c"),i&&(r[P("0x17d")][P("0x17f")](i),i=null),r[P("0x191")]){var o=new(e[P("0x18e")])({polyline:{positions:e[P("0x11")][P("0x19e")](n)}});r.callback(o)}}),e[P("0x161")][P("0x189")])}},t.prototype[P("0x192")]=function(){this[P("0x16f")]=this.handler&&this[P("0x16f")][P("0xf4")](),this[P("0x13b")][P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),i(P("0x193"),this[P("0x17d")]),i("draw_polyline",this[P("0x17d")])}}(Cesium$2),function(e){var t=e[P("0x1a2")]=function(t,i){this.viewer=t.viewer,this[P("0x169")]=t[P("0x169")]?t[P("0x169")]:e[P("0x16a")][P("0x16b")],this[P("0x1a3")]=t[P("0x1a3")]?t[P("0x1a3")]:10,this.scene=this[P("0x13b")][P("0x10f")],this.camera=this[P("0x13b")][P("0x7e")],this.canvas=this.scene.canvas,this[P("0x17d")]=this.scene.primitives,this[P("0xef")]=this.scene.globe.ellipsoid,this.callback=i||null};function i(e,t){for(var i=0;i=W[P("0x1e1")].HALF_PI&&x=Math.PI&&x<1.5*Math.PI?(r=s*Math[P("0x98")](x-Math.PI),n=s*Math[P("0x9a")](x-Math.PI),o=W[P("0x1d2")][P("0x1df")](e,a,W[P("0x1e1")].HALF_PI,r,!0),W[P("0x1d2")].getThirdPoint(a,o,W[P("0x1e1")][P("0x1e0")],n,!0)):(r=s*Math[P("0x98")](2*Math.PI-x),n=s*Math[P("0x9a")](2*Math.PI-x),o=W[P("0x1d2")][P("0x1df")](e,a,W.Constants[P("0x1e0")],r,!0),W.PlotUtils[P("0x1df")](a,o,W[P("0x1e1")][P("0x1e0")],n,!1))},R[P("0x1cd")][P("0x1ea")]=function(e){e=R[P("0x1cd")].dereplication(e),this[P("0x1eb")]=F.tailWidthFactor,this[P("0x1ec")]=F[P("0x1ec")],this[P("0x1ed")]=F.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(!((d=(t[P("0x1d8")]=e)[P("0x0")])<2)){if(2===e.length)return t.polygonalPoint=e,t;var i=e,r=i[0],n=i[1];W[P("0x1d2")].isClockWise(i[0],i[1],i[2])&&(r=i[1],n=i[0]);var o=[W.PlotUtils[P("0x1e5")](r,n)].concat(i[P("0x1d5")](2)),a=R[P("0x1cd")][P("0x1ee")](o,r,n,F),s=a[0],x=a[4],l=W[P("0x1d2")][P("0x8e")](r,n),c=W[P("0x1d2")][P("0x1e2")](o),u=c*this[P("0x1eb")]*this[P("0x1ec")];this.swallowTailPnt=W[P("0x1d2")][P("0x1df")](o[1],o[0],0,u,!0);var h=l/c,f=R[P("0x1cd")][P("0x1ef")](o,s,x,h),d=f[P("0x0")],g=[r][P("0x1c6")](f[P("0x1d5")](0,d/2));g[P("0x17c")](s);var p,m=[n][P("0x1c6")](f.slice(d/2,d));m[P("0x17c")](x),g=W[P("0x1d2")].getQBSplinePoints(g),m=W[P("0x1d2")][P("0x1f0")](m),p=R[P("0x1cd")][P("0x1d7")](g[P("0x1c6")](a,m[P("0x1e3")](),[this[P("0x1ed")],g[0]])),t.polygonalPoint=Cesium$2.Cartesian3[P("0x1da")](p)}return t},R[P("0x1cd")][P("0x1ee")]=function(e,t,i,r){this[P("0x1db")]=r[P("0x1db")],this.headTailFactor=r[P("0x1f1")],this[P("0x1dc")]=r[P("0x1dc")],this[P("0x1de")]=r[P("0x1de")],this[P("0x1dd")]=r[P("0x1dd")];var n=W[P("0x1d2")].getBaseLength(e),o=n*this.headHeightFactor,a=e[e[P("0x0")]-1];n=W[P("0x1d2")].distance(a,e[e[P("0x0")]-2]);var s=W[P("0x1d2")][P("0x8e")](t,i);o>s*this.headTailFactor&&(o=s*this[P("0x1f1")]);var x=o*this[P("0x1dc")],l=o*this.neckWidthFactor,c=(o=nClick to add new point ("+x[P("0x0")]+P("0x267")+(2双击可结束绘制

":P("0x272");a[P("0x205")](i,h)}}}),D.ScreenSpaceEventType.MOUSE_MOVE),u[P("0x160")]((function(e){r[P("0x188")](e,t)}),D.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},i[P("0x5")].drawEnd=function(t,i){var r,n=this.positions,o=this.minPoints,a=this[P("0x273")];if(i=this[P("0x132")],null===t){if(this[P("0x26f")]){if(this.stopDrawing(),w()(i[P("0x191")])!==P("0x8"))return;n[P("0x0")],i[P("0x191")](a[P("0x19f")],a[P("0x236")]),this[P("0x26f")]=!1}}else if(null!==(r=t[P("0x8c")])){if(n[P("0x0")]点击以增加第一个控制点

");else{var r=a[P("0x7e")][P("0xa2")](i,e),o=D.Cartographic.fromCartesian(r),s=[D.Math.toDegrees(o[P("0x112")]),D.Math[P("0x113")](o[P("0x114")])];if(r){if(l[P("0x25c")](),r.y+=1+Math.random(),l[P("0x17c")](r),3===c[P("0x0")]&&(c[P("0x25c")](),c[P("0x17c")](s)),2===c[P("0x0")]&&c[P("0x17c")](s),2<=l.length){var u=R[P("0x1cd")].doubleArrow(c);n[P("0x19f")]=u?u[P("0x1d9")]:null,n.custom=u?u[P("0x1d8")]:null,n[P("0x219")]=!0}var h=3===l[P("0x0")]?P("0x274"):P("0x272");x[P("0x205")](i,h)}}}),D[P("0x161")][P("0x163")]),h.setInputAction((function(e){o[P("0x188")](e,r)}),D[P("0x161")][P("0x269")])},i.prototype[P("0x275")]=function(t){t=G(t,o),this.startDrawing((function(){null!==l&&a[P("0x17f")](l),c[P("0x17f")](),u[P("0xf4")](),s.setVisible(!1)}));var r=this,n=this._scene,a=this[P("0x42")].primitives,s=this[P("0x1f6")],x=[],l=null,c=null,u=new(D[P("0x15f")])(n[P("0x48")]);u.setInputAction((function(o){if(null!==o.position){var s=n[P("0x7e")][P("0xa2")](o[P("0x8c")],e);if(s)if(null===l){var u=D.Cartographic[P("0x175")](s),h=D[P("0x23")][P("0x113")](u[P("0x112")]),f=D[P("0x23")][P("0x113")](u[P("0x114")]);x.push(h,f);var d=y(x,x);l=new(i[P("0x276")])({extent:d,asynchronous:!1,material:t[P("0x19c")]}),a[P("0x6d")](l),c=new i.BillboardGroup(r,p);var g=_([x,x]);c[P("0x243")](g)}else r.stopDrawing(),w()(t[P("0x191")])===P("0x8")&&(u=D[P("0x13")][P("0x175")](s),h=D.Math[P("0x113")](u.longitude),f=D[P("0x23")][P("0x113")](u[P("0x114")]),t[P("0x191")](y(x,[h,f])))}}),D[P("0x161")].LEFT_DOWN),u[P("0x160")]((function(t){var i=t[P("0x64")];if(null!==i)if(null===l)s.showAt(i,"

点击开始绘制

");else{var r=n[P("0x7e")][P("0xa2")](i,e);if(r){var o=D.Cartographic[P("0x175")](r),a=D.Math[P("0x113")](o[P("0x112")]),u=D.Math[P("0x113")](o[P("0x114")]),h=y(x,[a,u]);l[P("0x230")](h);var f=_([x,[a,u]]);c[P("0x25d")](f),s.showAt(i,P("0x277"))}}}),D.ScreenSpaceEventType[P("0x163")])},i.prototype[P("0x1f8")]=function(){var r=this;function n(e){r[P("0x42")],this[P("0x27c")]&&this._highlighted===e||!0!==this[P("0x204")]&&((this[P("0x27c")]=e)?(r.setHighlighted(this),this[P("0x27d")]=this[P("0x228")],this[P("0x22c")](D[P("0x16a")][P("0x27e")](P("0x27f")),this.strokeWidth)):this._strokeColor?this[P("0x22c")](this._strokeColor,this[P("0x22d")]):this[P("0x22c")](void 0,void 0))}function o(n){if(this[P("0x204")]!==n)if(r[P("0x20d")](),n){r[P("0x20f")](this);var o=r[P("0x42")],a=this;if(null===this[P("0x280")]){function n(e,t){var i=e-1<0?t.length-1:e-1;i=e[1]&&t[0]>=e[0]?i=r+Math.PI:t[1]>=e[1]&&t[0]=e[0]&&(i=Math.PI-r),i},W[P("0x1d2")].getAngleOfThreePoints=function(e,t,i){var r=W[P("0x1d2")][P("0x2bc")](t,e)-W[P("0x1d2")][P("0x2bc")](t,i);return r<0?r+W[P("0x1e1")].TWO_PI:r},W[P("0x1d2")].isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},W[P("0x1d2")][P("0x2bd")]=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},W.PlotUtils[P("0x2be")]=function(e,t,i,r,n){var o=1-(e=Math[P("0xee")](Math[P("0x7d")](e,1),0)),a=e*e,s=a*e,x=o*o,l=x*o;return[l*t[0]+3*x*e*i[0]+3*o*a*r[0]+s*n[0],l*t[1]+3*x*e*i[1]+3*o*a*r[1]+s*n[1]]},W.PlotUtils[P("0x1df")]=function(e,t,i,r,n){var o=W[P("0x1d2")][P("0x2bc")](e,t),a=n?o+i:o-i,s=r*Math.cos(a),x=r*Math[P("0x98")](a);return[t[0]+s,t[1]+x]},W[P("0x1d2")][P("0x2bf")]=function(e,t,i,r){var n,o,a=[],s=r-i;s=s<0?s+W[P("0x1e1")].TWO_PI:s;for(var x=0;x<=W[P("0x1e1")][P("0x2c0")];x++){var l=i+s*x/W.Constants[P("0x2c0")];n=e[0]+t*Math[P("0x9a")](l),o=e[1]+t*Math.sin(l),a[P("0x17c")]([n,o])}return a},W[P("0x1d2")][P("0x2c1")]=function(e,t,i,r){var n=W[P("0x1d2")].getNormal(t,i,r),o=Math[P("0xca")](n[0]*n[0]+n[1]*n[1]),a=n[0]/o,s=n[1]/o,x=W[P("0x1d2")].distance(t,i),l=W[P("0x1d2")][P("0x8e")](i,r);if(o>W[P("0x1e1")][P("0x2c2")])if(W.PlotUtils[P("0x1d3")](t,i,r)){var c=e*x,u=i[0]-c*s,h=i[1]+c*a,f=[u,h];c=e*l;var d=[u=i[0]+c*s,h=i[1]-c*a]}else c=e*x,f=[u=i[0]+c*s,h=i[1]-c*a],c=e*l,d=[u=i[0]-c*s,h=i[1]+c*a];else f=[u=i[0]+e*(t[0]-i[0]),h=i[1]+e*(t[1]-i[1])],d=[u=i[0]+e*(r[0]-i[0]),h=i[1]+e*(r[1]-i[1])];return[f,d]},W[P("0x1d2")].getNormal=function(e,t,i){var r=e[0]-t[0],n=e[1]-t[1],o=Math[P("0xca")](r*r+n*n);r/=o,n/=o;var a=i[0]-t[0],s=i[1]-t[1],x=Math[P("0xca")](a*a+s*s);return[r+(a/=x),n+(s/=x)]},W[P("0x1d2")][P("0x2c3")]=function(e,t){for(var i=[W.PlotUtils[P("0x2c4")](t)],r=0;rW[P("0x1e1")][P("0x2c2")])var s=W.PlotUtils.mid(i,r),x=i[0]-s[0],l=i[1]-s[1],c=2/W[P("0x1d2")][P("0x8e")](i,r),u=-c*l,h=c*x,f=u*u-h*h,d=2*u*h,g=h*h-u*u,p=o[0]-s[0],m=o[1]-s[1],b=s[0]+f*p+d*m,v=s[1]+d*p+g*m;else b=i[0]+t*(r[0]-i[0]),v=i[1]+t*(r[1]-i[1]);return[b,v]},W[P("0x1d2")].getRightMostControlPoint=function(e){var i=e[P("0x0")],r=e[i-3],n=e[i-2],o=e[i-1],a=W[P("0x1d2")][P("0x2c1")](0,r,n,o)[1],s=W.PlotUtils[P("0x2c6")](r,n,o);if(Math[P("0xca")](s[0]*s[0]+s[1]*s[1])>W[P("0x1e1")].ZERO_TOLERANCE)var x=W.PlotUtils[P("0x1e5")](n,o),l=o[0]-x[0],c=o[1]-x[1],u=2/W[P("0x1d2")][P("0x8e")](n,o),h=-u*c,f=u*l,d=h*h-f*f,g=2*h*f,p=f*f-h*h,m=a[0]-x[0],b=a[1]-x[1],v=x[0]+d*m+g*b,C=x[1]+g*m+p*b;else v=o[0]+t*(n[0]-o[0]),C=o[1]+t*(n[1]-o[1]);return[v,C]},W[P("0x1d2")][P("0x1d6")]=function(e){if(e[P("0x0")]<=2)return e;for(var t=[],i=e[P("0x0")]-1,r=0;r<=1;r+=.01){for(var n=y=0,o=0;o<=i;o++){var a=W[P("0x1d2")][P("0x2c7")](i,o),s=Math[P("0x2ae")](r,o),x=Math[P("0x2ae")](1-r,i-o);n+=a*s*x*e[o][0],y+=a*s*x*e[o][1]}t.push([n,y])}return t[P("0x17c")](e[i]),t},W.PlotUtils[P("0x2c7")]=function(e,t){return W[P("0x1d2")][P("0x2c8")](e)/(W[P("0x1d2")][P("0x2c8")](t)*W[P("0x1d2")][P("0x2c8")](e-t))},W[P("0x1d2")][P("0x2c8")]=function(e){if(e<=1)return 1;if(2===e)return 2;if(3===e)return 6;if(4===e)return 24;if(5===e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},W[P("0x1d2")].getQBSplinePoints=function(e){if(e[P("0x0")]<=2)return e;var t=[],i=e[P("0x0")]-2-1;t[P("0x17c")](e[0]);for(var r=0;r<=i;r++)for(var n=0;n<=1;n+=.05){for(var o=y=0,a=0;a<=2;a++){var s=W[P("0x1d2")][P("0x2c9")](a,n);o+=s*e[r+a][0],y+=s*e[r+a][1]}t.push([o,y])}return t[P("0x17c")](e[e[P("0x0")]-1]),t},W[P("0x1d2")][P("0x2c9")]=function(e,t){return 0===e?Math[P("0x2ae")](t-1,2)/2:1===e?(-2*Math[P("0x2ae")](t,2)+2*t+1)/2:2===e?Math[P("0x2ae")](t,2)/2:0},W[P("0x1e1")]={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},function(e){var t=e[P("0x2ca")]=function(t,i){this.viewer=t[P("0x13b")],this.color=t[P("0x169")]?t[P("0x169")]:e[P("0x16a")][P("0x196")].withAlpha(.5),this[P("0x197")]=t.lineWidth?t[P("0x197")]:2,this.scene=this[P("0x13b")][P("0x10f")],this.camera=this[P("0x13b")][P("0x7e")],this[P("0x48")]=this[P("0x10f")][P("0x48")],this[P("0x17d")]=this[P("0x10f")][P("0x17d")],this[P("0xef")]=this[P("0x10f")][P("0xa3")].ellipsoid,this[P("0x1a9")]=0,this[P("0x2cb")]=[],this[P("0xd3")]=t[P("0xd3")]?t[P("0xd3")]:1};function i(e,t){for(var i=0;i=n[5]?(n[6]=n[0],n[7]=n[1],n[8]=n[5]):(n[6]=n[3],n[7]=n[4],n[8]=n[2]),t[P("0x187")](t.length-1).positions=e[P("0x11")][P("0x19e")](n)),(i=r[P("0x17d")].add(new(e[P("0x1a4")])))[P("0x2cc")]=P("0x30d")+"_"+r.count,i[P("0x176")]=P("0x30e"),i[P("0x6d")]({position:a,color:r[P("0x169")],pixelSize:r[P("0x1a3")]}),r[P("0x172")]=n,r.measureEnd()),0===n.length&&(n[P("0x17c")](l),n[P("0x17c")](c),n.push(u),n[P("0x17c")](l),n[P("0x17c")](c),n[P("0x17c")](u),n[P("0x17c")](l),n.push(c),n[P("0x17c")](u),(t=r.primitives[P("0x6d")](new e.PolylineCollection))[P("0x2cc")]=P("0x30d")+"_"+r[P("0x1a9")],t.name=P("0x30f"),t[P("0x6d")]({polyline:{}}),t.get(t[P("0x0")]-1)[P("0x19a")]=r[P("0x197")],t.get(t[P("0x0")]-1)[P("0x19b")]=!0,t[P("0x187")](t[P("0x0")]-1)[P("0x19c")].uniforms[P("0x169")]=r[P("0x169")],t[P("0x187")](t[P("0x0")]-1)[P("0x19f")]=e[P("0x11")][P("0x19e")](n),(i=r.primitives[P("0x6d")](new e.PointPrimitiveCollection))[P("0x2cc")]=P("0x30d")+"_"+r.count,i[P("0x176")]=P("0x30e"),i[P("0x6d")]({position:a,color:r[P("0x169")],pixelSize:r[P("0x1a3")]}))}}),e.ScreenSpaceEventType[P("0x17e")])}},t[P("0x5")][P("0x2d2")]=function(t){this[P("0x16f")]=this[P("0x16f")]&&this[P("0x16f")][P("0xf4")](),this[P("0x16f")]=new(e[P("0x15f")])(this[P("0x48")]);var i=this;this[P("0x16f")][P("0x160")]((function(t){var r=i.viewer[P("0x10f")].pick(t.position);r&&r[P("0x2fc")]&&r[P("0x2fc")][P("0x2cc")]&&-1=this[P("0x172")][5]?(x.push(this._array_[5]),this._array_[5]):(x.push(this[P("0x172")][2]),this._array_[2]);var r=e.Cartesian3[P("0x1a1")](this[P("0x172")][0],this[P("0x172")][1],t),n=e[P("0x11")].fromDegrees(this._array_[3],this[P("0x172")][4],t),o=e[P("0x11")][P("0x8e")](r,n);a=o<1e3?P("0x311")+o.toFixed(2)+"m":P("0x311")+(o/1e3)[P("0x2af")](2)+"km",i(this[P("0x17d")],a,x,this.count);var a,s=Math.abs(this._array_[2]-this[P("0x172")][5]),x=[];this[P("0x172")][2]>=this[P("0x172")][5]?(x[P("0x17c")](this[P("0x172")][0]),x[P("0x17c")](this[P("0x172")][1])):(x.push(this[P("0x172")][3]),x.push(this[P("0x172")][4])),x[P("0x17c")]((this[P("0x172")][2]+this._array_[5])/2),a=s<1e3?P("0x312")+s[P("0x2af")](2)+"m":P("0x312")+(s/1e3)[P("0x2af")](2)+"km",i(this[P("0x17d")],a,x,this[P("0x1a9")]),(x=[]).push((this[P("0x172")][0]+this[P("0x172")][3])/2),x[P("0x17c")]((this[P("0x172")][1]+this[P("0x172")][4])/2),x[P("0x17c")]((this[P("0x172")][2]+this[P("0x172")][5])/2);var l=Math[P("0xca")](Math.pow(o,2)+Math[P("0x2ae")](s,2));a=l<1e3?P("0x313")+l[P("0x2af")](2)+"m":P("0x313")+(l/1e3)[P("0x2af")](2)+"km",i(this.primitives,a,x,this[P("0x1a9")]),this[P("0x1a9")]++,this.callback(o,s,l,this._array_)},t[P("0x5")][P("0x192")]=function(){this[P("0x16f")]=this[P("0x16f")]&&this.handler[P("0xf4")](),this[P("0x13b")][P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),function(e){for(var t=0;t=t[5]?(t[6]=t[0],t[7]=t[1],t[8]=t[5],r=t[5],n=[t[3],t[4],t[5]],t[0],t[3],t[1],t[4],t[0],t[1],t[2],t[5],o[P("0x17c")](t[3],t[4],t[5],t[0],t[1],t[2]),a.push(t[3],t[4],t[5],t[0],t[1],t[5])):(t[6]=t[3],t[7]=t[4],t[8]=t[2],r=t[2],n=[t[0],t[1],t[2]],t[0],t[3],t[1],t[4],t[3],t[4],t[2],t[5],o[P("0x17c")](t[0],t[1],t[2],t[3],t[4],t[5]),a[P("0x17c")](t[0],t[1],t[2],t[3],t[4],t[2])),i.get(0)[P("0x19f")]=e[P("0x11")][P("0x19e")](o),i[P("0x187")](1)[P("0x19f")]=e.Cartesian3[P("0x19e")](a);var s=e[P("0x11")][P("0x1a1")](t[0],t[1],r),x=e[P("0x11")][P("0x1a1")](t[3],t[4],r);!function(t,i,r,n,o){var a;t<1e3?t[P("0x2af")](2):(t/1e3)[P("0x2af")](2),i<1e3?i[P("0x2af")](2):(i/1e3)[P("0x2af")](2),a=Math.round(e[P("0x23")].toDegrees(Math[P("0x321")](i/t)))+"°";var s=function(e,t){for(var i=0;ithis[P("0x32f")]&&(this[P("0x326")]=this[P("0x32f")]),ti._maxHeight&&(i._designElevation=i[P("0x32f")]),oe.Math.PI_OVER_TWO&&(a.x=-1,a.y*=-1),o>e.Math.PI&&(a.x=-1),o>3*e[P("0x23")][P("0x5b")]&&(a.x=1,a.y=-a.y),e[P("0x11")][P("0x8d")](a,a);var s=new(e[P("0x368")])(a,this.cylinderRadius);r[P("0x17c")](s)}return this[P("0x365")]=r},i[P("0x5")][P("0x369")]=function(t,i){for(var r=new(e[P("0x36a")])({modelMatrix:e[P("0x14")](t)?t:e[P("0x1b")][P("0xae")],edgeWidth:this[P("0x360")],edgeColor:this[P("0x361")],unionClippingRegions:this[P("0x363")],enabled:this[P("0x364")]}),n=this[P("0x367")](i),o=0;oI[I[P("0x0")]-1]&&x[S+1]I[I[P("0x0")]-1]&&x[S-1]t[P("0x45d")]&&t[P("0x45f")][P("0x25c")](),t._arrayVertex[P("0x17c")](r),t[P("0x45c")].positions=t[P("0x45f")]}}),e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(i){if(null!==t._polylineCollection){var r=t[P("0x13b")][P("0x7e")][P("0x86")](i.position),n=t[P("0x13b")][P("0x10f")][P("0xa3")][P("0xa4")](r,t[P("0x13b")].scene),o=e[P("0x13")].fromCartesian(n);t[P("0x460")][P("0x17c")](e.Math[P("0x113")](o.longitude)),t[P("0x460")][P("0x17c")](e.Math[P("0x113")](o.latitude)),t._outPoints.push(o[P("0x8b")]),t[P("0x304")][P("0x17f")](t[P("0x45c")]),t.viewer.scene[P("0x17d")][P("0x17f")](t[P("0x304")]),t.handler.destroy(),t.handler=void 0,t._polylineCollection=void 0,t[P("0x45c")]=void 0,t[P("0x45d")]=0,t.viewer[P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),t._excavationRegion=new e.GeoExcavationRegion({viewer:t[P("0x13b")],samplingPoints:t[P("0x45f")],depth:t[P("0x456")],sideMaterial:t._sideMaterial,bottomMaterial:t._bottomMaterial,interNumber:10}),t[P("0x45a")](t[P("0x460")])}}),e[P("0x161")][P("0x189")])}},t[P("0x5")].clear=function(){this[P("0x45e")]&&(this[P("0x460")][P("0x0")]=0,this._arrayVertex[P("0x0")]=0,this[P("0x45e")][P("0xf4")](),this[P("0x45e")]=void 0)}}(Cesium$2),function(e){var t=e[P("0x102")];(e[P("0x461")]=function(e,i){e=t(e,t[P("0x128")]),this.viewer=e.viewer,this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x48")]=this[P("0x10f")][P("0x48")],this.camera=this.scene[P("0x7e")],this[P("0x17d")]=this[P("0x10f")].primitives,this[P("0x191")]=i||null,this.contourUniforms={},this[P("0x462")]={}}).prototype[P("0x463")]=function(o){var a=!1;if(o&&o[P("0x464")]){a=t(o[P("0x464")][P("0x3b6")],!1);var s=t(o[P("0x464")][P("0x19a")],2),x=t(o.contour[P("0x465")],150),l=t(o[P("0x464")][P("0x169")],e[P("0x16a")].RED[P("0x6e")]())}var c="none";if(o&&o[P("0x466")]&&(c=o[P("0x466")],-1===["elevation",P("0x467"),P("0x468"),P("0x2b4")][P("0x2d3")](c)))return alert("输入值可选elevation,slope,aspect,none中的一个!"),!1;var u,h=-414,f=8777;return o&&o.minHeight&&(h=o[P("0x3ea")]),o&&o[P("0x3eb")]&&(f=o.maxHeight),a?(c===P("0x469")?(u=new e.Material({fabric:{type:P("0x485"),materials:{contourMaterial:{type:P("0x471")},elevationRampMaterial:{type:P("0x472")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x486")}},translucent:!1}),this[P("0x462")]=u[P("0x46a")][P("0x46b")][P("0x19d")],this[P("0x462")][P("0x46c")]=h,this[P("0x462")][P("0x46d")]=f,this.contourUniforms=u[P("0x46a")][P("0x46e")].uniforms):c===P("0x467")?(u=new(e[P("0x212")])({fabric:{type:P("0x487"),materials:{contourMaterial:{type:P("0x471")},slopeRampMaterial:{type:P("0x473")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x488")}},translucent:!0}),this[P("0x462")]=u[P("0x46a")][P("0x46f")].uniforms,this[P("0x470")]=u[P("0x46a")][P("0x46e")][P("0x19d")]):c===P("0x468")?(u=new(e[P("0x212")])({fabric:{type:P("0x489"),materials:{contourMaterial:{type:P("0x471")},aspectRampMaterial:{type:P("0x474")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x48a")}},translucent:!1}),this[P("0x462")]=u[P("0x46a")].aspectRampMaterial[P("0x19d")],this[P("0x470")]=u.materials[P("0x46e")][P("0x19d")]):(u=e[P("0x212")][P("0x213")](P("0x471")),this[P("0x470")]=u[P("0x19d")]),this.contourUniforms.width=s,this[P("0x470")][P("0x465")]=x,this.contourUniforms.color=l):c===P("0x469")?(u=e.Material[P("0x213")](P("0x472")),this.shadingUniforms=u.uniforms,this[P("0x462")].minimumHeight=h,this[P("0x462")].maximumHeight=f):c===P("0x467")?(u=e.Material[P("0x213")](P("0x473")),this[P("0x462")]=u[P("0x19d")]):c===P("0x468")&&(u=e[P("0x212")][P("0x213")](P("0x474")),this[P("0x462")]=u.uniforms),c!==P("0x2b4")&&(this.shadingUniforms[P("0x475")]=function(e){var t=document[P("0x15c")](P("0x48"));t[P("0x19a")]=100,t[P("0x8b")]=1;var o,a=t[P("0x476")]("2d");e===P("0x469")?o=i:e===P("0x467")?o=r:"aspect"===e&&(o=n);var s=a[P("0x477")](0,0,100,0);return 7===o[P("0x0")]?(s.addColorStop(o[0],P("0x478")),s[P("0x479")](o[1],P("0x47a")),s[P("0x479")](o[2],"#D33B7D"),s[P("0x479")](o[3],"#D33038"),s[P("0x479")](o[4],"#FF9742"),s[P("0x479")](o[5],"#ffd700"),s[P("0x479")](o[6],P("0x47b"))):(s[P("0x479")](o[0],P("0x47c")),s[P("0x479")](o[1],"#599668"),s.addColorStop(o[2],P("0x47d")),s[P("0x479")](o[3],"#fafcb4"),s.addColorStop(o[4],P("0x47e")),s.addColorStop(o[5],P("0x47f")),s[P("0x479")](o[6],P("0x480")),s[P("0x479")](o[7],P("0x481")),s[P("0x479")](o[8],P("0x482")),s[P("0x479")](o[9],P("0x483")),s[P("0x479")](o[10],"#420202")),a[P("0x484")]=s,a.fillRect(0,0,100,1),t}(c)),this[P("0x10f")][P("0xa3")][P("0x19c")]=u,!0};var i=[0,.045,.1,.15,.37,.54,1],r=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],n=[0,.2,.4,.6,.8,.9,1]}(Cesium$2),function(e){var t=e.GeoTilesetFlatten=function(t){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x48b")]=!1,this[P("0x48c")]=!1,this[P("0x48d")]=[],this[P("0x48e")]=e[P("0x102")](t[P("0x48e")],!0),this.show=e.defaultValue(t[P("0x221")],!0),this[P("0xef")]=e.defaultValue(t[P("0xef")],e[P("0x16")].WGS84)};function i(t){var i=t.content._model;e.defined(i)&&e[P("0x14")](i.platSlot)&&delete i[P("0x48f")]}function r(t){var i=t[P("0x490")]._model;if(e.defined(i)){var r=i[P("0x48f")];if(!e[P("0x14")](r))throw new e.DeveloperError("storing of model vertex buffers is fail.")}}t.prototype[P("0x491")]=function(t){if(!e[P("0x14")](t))throw new(e[P("0x15")])("parameter tileset is required.");if(e[P("0x14")](this[P("0x492")]))throw new(e[P("0x15")])(P("0x493"));this[P("0x492")]=t,(this._tileset[P("0x494")]=this)[P("0x48c")]=!0,this[P("0x492")].tileUnload[P("0x130")](i),this[P("0x492")][P("0x495")].addEventListener(r)},t.prototype[P("0x496")]=function(e){this.show!==e&&(this[P("0x48c")]=!0),this[P("0x221")]=e},t[P("0x5")][P("0x497")]=function(e){return this[P("0x221")]},t[P("0x5")][P("0x498")]=function(){return this[P("0x48c")]},t[P("0x5")][P("0x499")]=function(){this[P("0x48c")]=!1},t[P("0x5")][P("0x49a")]=function(t){var i=this;if(void 0!==t&&t instanceof Array){var r=t.length;if(!(r<3)){for(var n=[],o=i[P("0x48e")],a=0;aa[P("0x112")]?u=a[P("0x112")]:ca[P("0x114")]?h=a.latitude:f(o=e.Cartographic.clone(d[n],new(e[P("0x13")])))[P("0x112")]?u=o[P("0x112")]:co[P("0x114")]?h=o[P("0x114")]:fL.x?u=L.x:hL.y?f=L.y:dL.z?g=L.z:pU[P("0x112")]?R=U[P("0x112")]:OU[P("0x114")]?D=U[P("0x114")]:Fy.x?f=y.x:gy.y?d=y.y:pI.x?b=I.x:CI.y?v=I.y:yt.maxX||st.maxY)return!1;var x,l,c,u,h,f,d={z:!1,b:!1,t:!1},g=t.pts,p=g.length;for(n=0,o=p-1;nthis[P("0x4fa")]&&this[P("0x10f")][P("0x4fc")][P("0x259")](d-1,1);var g,p=this[P("0x4fb")][h-1];p.frustum=new e.PerspectiveFrustum({fov:e[P("0x23")][P("0x119")](s),aspectRatio:1.6,near:1,far:n}),g={context:this[P("0x10f")][P("0x3cc")],lightCamera:p,cascadesEnabled:!1,darkness:.5,isPointLight:!1},this[P("0x10f")][P("0x4fc")].push(new e.ShadowMap(g));var m=this[P("0x10f")].expandShadowMapList[this[P("0x10f")].expandShadowMapList.length-1];m[P("0x508")][P("0x3cf")]=0,m[P("0x364")]=!0,m.size=2048,m[P("0x509")]=!0,p[P("0x50a")](l,new(e[P("0xa9")])(c,u,1e-21)),x(f,this[P("0x17d")]),this.primitives.add(new e.DebugCameraPrimitive({camera:p,color:e[P("0x16a")][P("0x50b")](1,1,1,1),id:f}))}},r[P("0x5")][P("0x192")]=function(){this[P("0x10f")][P("0x3b3")][P("0x509")]=void 0;for(var e=this[P("0x4fb")].length,r=0;r-e[P("0x23")][P("0xab")]&&(t[P("0x537")]-=e[P("0x23")].TWO_PI));break;case 39:i[P("0x54a")]?(t[P("0x538")]+=t[P("0x54b")],t[P("0x538")]>e[P("0x23")][P("0xab")]&&(t._roll-=e[P("0x23")][P("0xab")])):t[P("0x542")]-=50;break;case 37:i[P("0x54a")]?(t[P("0x538")]-=t[P("0x54b")],t[P("0x538")]e.Math[P("0xab")]&&(t[P("0x550")][P("0x80")]-=e[P("0x23")][P("0xab")]));break;case 39:i.shiftKey?(t[P("0x550")][P("0x81")]+=t[P("0x54b")],t[P("0x550")].roll>e[P("0x23")][P("0xab")]&&(t[P("0x550")][P("0x81")]-=e[P("0x23")].TWO_PI)):(t[P("0x550")][P("0x7f")]+=t.deltaRadians,t[P("0x550")][P("0x7f")]>e[P("0x23")].TWO_PI&&(t.hpRoll[P("0x7f")]-=e[P("0x23")][P("0xab")]));break;case 37:i[P("0x54a")]?(t.hpRoll.roll-=t[P("0x54b")],t.hpRoll.roll<0&&(t[P("0x550")][P("0x81")]+=e[P("0x23")][P("0xab")])):(t[P("0x550")][P("0x7f")]-=t[P("0x54b")],t[P("0x550")][P("0x7f")]<0&&(t.hpRoll[P("0x7f")]+=e[P("0x23")].TWO_PI))}}))}}(Cesium$2),function(e){var t=e[P("0x567")]=function(t){this[P("0x13b")]=t[P("0x13b")],this[P("0x568")]=t[P("0x568")],this[P("0x569")]=t.pointArray,this[P("0xe2")]=t[P("0xe2")],this[P("0x56a")]=t[P("0xe4")],this[P("0x539")]=t[P("0x539")],this.deltaHeight=e[P("0x102")](t[P("0x53d")],10),this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x7e")]=this[P("0x13b")][P("0x7e")],this[P("0x56b")]=new(e[P("0x11")])(0,0,0),this[P("0x56c")]=[],this[P("0x565")]=null,this[P("0x2ec")]=[],this.bearing=[],this[P("0x56d")]=[],this[P("0x56e")]=[],this[P("0x56f")]=0,this.VerticalRadians=0,this.i=0,this[P("0x53e")]()};t[P("0x5")][P("0x3f7")]=function(){for(var t=0;t=this[P("0x5bf")]&&(this[P("0x5cf")]=0);var t=e[P("0x5d0")]()/1e3;0this[P("0x5bf")]&&(this[P("0x5cf")]=this._life)):this[P("0x5bc")]=t},t[P("0x5")][P("0x5c9")]=function(e){this[P("0x5d1")](e),this[P("0x5d2")](e)},t.prototype[P("0x5d1")]=function(t){var s=t.context,x=this;if(!this[P("0x5b5")]){var l=this[P("0x5b5")]=new(e[P("0x5d3")]);l[P("0x5d4")]=e.Pass.TRANSLUCENT,l[P("0x5cd")]=this,l[P("0x4ac")]=this[P("0x5c7")],l[P("0x5d5")]=e[P("0x5d6")][P("0x5d7")]({cull:{enabled:!1},depthTest:{enabled:!0,func:e[P("0x5d8")][P("0x5d9")]},depthMask:!1,blending:e[P("0x5da")][P("0x5db")]}),l[P("0x5cc")]=e[P("0x5dc")][P("0x5d7")]({context:s,defines:[P("0x5dd")],vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:{aPoint:0,aNormal:1,aT:2}}),l[P("0x5de")]={u_color:function(){return x[P("0x596")]},u_metallicFactor:function(){return x[P("0x5c0")]},u_roughnessFactor:function(){return x[P("0x5c2")]},u_emissiveFactor:function(){return x[P("0x5c4")]},u_normalMatrix:function(){return e[P("0x1b")][P("0x5df")](t[P("0x7e")][P("0x5e0")],x[P("0x5c7")],i),e[P("0x1b")][P("0x4e2")](i,r),e[P("0x1b")][P("0x5e1")]?e[P("0x1b")][P("0x5e1")](r,n):e.Matrix4[P("0x5e2")]?e.Matrix4[P("0x5e2")](r,n):(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10]),e[P("0x1a")][P("0x5e3")](n,n)}}}this[P("0x5b5")][P("0x5cb")]=this[P("0x5b8")],this[P("0x5b5")].boundingVolume=this[P("0x4a4")]};var i=new(e[P("0x1b")]),r=new(e[P("0x1b")]),n=new(e[P("0x1a")]);t[P("0x5")][P("0x5d2")]=function(t){var a=t.context,x=this;if(!this[P("0x5b6")]){var l=this._drawCommandOpaque=new(e[P("0x5d3")]);l[P("0x5d4")]=e[P("0x5e4")][P("0x5e5")],l[P("0x5cd")]=this,l.modelMatrix=this._modelTransform,l.renderState=e[P("0x5d6")][P("0x5d7")]({cull:{enabled:!1},depthTest:{enabled:!0,func:e[P("0x5d8")].LEQUAL},depthMask:!1}),l[P("0x5cc")]=e[P("0x5dc")][P("0x5d7")]({context:a,defines:["HDR"],vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:{aPoint:0,aNormal:1,aT:2}}),l[P("0x5de")]={u_color:function(){return x._color},u_metallicFactor:function(){return x[P("0x5c0")]},u_roughnessFactor:function(){return x._roughnessFactor},u_emissiveFactor:function(){return x._emissiveFactor},u_normalMatrix:function(){return e[P("0x1b")][P("0x5df")](t[P("0x7e")][P("0x5e0")],x[P("0x5c7")],i),e[P("0x1b")][P("0x4e2")](i,r),e.Matrix4[P("0x5e1")]?e.Matrix4[P("0x5e1")](r,n):e.Matrix4[P("0x5e2")]?e[P("0x1b")][P("0x5e2")](r,n):(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10]),e[P("0x1a")][P("0x5e3")](n,n)}}}this[P("0x5b6")][P("0x5cb")]=this._va,this[P("0x5b6")][P("0x4bc")]=this[P("0x4a4")]},t[P("0x5")]._updateVA=function(t){this[P("0x5b8")]&&(this._va[P("0xf4")](),this[P("0x5b8")]=null);var i=e[P("0x23")][P("0xab")],r=this[P("0x5cf")]*this[P("0x5b9")];if(!(r<1e-5)){var n=0;if(this[P("0x5cf")]/this[P("0x5bf")]<.5)n=this[P("0x5be")]*this[P("0x5cf")];else{var o=this._life-this[P("0x5cf")];n=this[P("0x5be")]*o}var a=this[P("0x5e6")](r);if(!(n<1e-5)){for(var s,x,l,c,u=t.context,h=i/a,f=2*a,d=3*f,g=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")][P("0x5e9")],3*f),p=e.ComponentDatatype.createTypedArray(e[P("0x5e8")][P("0x5e9")],3*f),m=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")][P("0x5e9")],f),b=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")].UNSIGNED_SHORT,d),v=0,C=0,y=0,_=0,A=0;At.west?t.west:r,t[P("0x2aa")]=r>t[P("0x2aa")]?r:t[P("0x2aa")],t[P("0x2ab")]=n>t[P("0x2ab")]?t[P("0x2ab")]:n,t[P("0x2ac")]=n>t[P("0x2ac")]?n:t[P("0x2ac")]}return t}return!1},t[P("0x5")][P("0x683")]=function(e,t,i){var r=document[P("0x15c")](P("0x15d"));return i&&r.setAttribute("id",i),r[P("0x21b")]("style",P("0x684")+e+P("0x685")+t+"px; margin: 0px; display: none;"),document[P("0x686")][P("0x167")](r),r},t[P("0x5")][P("0x687")]=function(t){var i=t._heatmap[P("0x688")](),r=new(e[P("0x10c")])({url:i,rectangle:t[P("0x689")]});return r[P("0x68a")]=new(e[P("0x68b")])({rectangleSouthwestInMeters:new(e[P("0x10")])(t[P("0x68c")][P("0x2a9")],t[P("0x68c")][P("0x2ab")]),rectangleNortheastInMeters:new(e[P("0x10")])(t[P("0x68c")][P("0x2aa")],t._mbounds[P("0x2ac")])}),r},t.prototype[P("0x68d")]=function(e){for(var t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<(e||8);r++)t+=i[P("0x68e")](Math[P("0x3e8")](Math[P("0x266")]()*i[P("0x0")]));return t};var i=new(e[P("0x68f")]);t[P("0x5")][P("0x690")]=function(t){var r=i[P("0x5a")](e.Cartographic[P("0x1a1")](t.x,t.y));return{x:r.x,y:r.y}},t[P("0x5")][P("0x691")]=function(t){var r=i.project(e[P("0x13")][P("0x1a1")](t[P("0x2a9")],t[P("0x2ab")])),n=i[P("0x5a")](e[P("0x13")][P("0x1a1")](t[P("0x2aa")],t.north));return{north:n.y,east:n.x,south:r.y,west:r.x}},t.prototype[P("0x692")]=function(t){var r=i[P("0xbe")](new(e[P("0x11")])(t.x,t.y));return{x:r[P("0x112")],y:r[P("0x114")]}},t.prototype[P("0x693")]=function(t){var r=i[P("0xbe")](new e.Cartesian3(t[P("0x2a9")],t[P("0x2ab")])),n=i[P("0xbe")](new(e[P("0x11")])(t[P("0x2aa")],t.north));return{north:this[P("0x694")](n.latitude),east:this.rad2deg(n[P("0x112")]),south:this[P("0x694")](r[P("0x114")]),west:this[P("0x694")](r[P("0x112")])}},t[P("0x5")][P("0x695")]=function(e){return e*(Math.PI/180)},t.prototype[P("0x694")]=function(e){return e/(Math.PI/180)},t[P("0x5")].wgs84PointToHeatmapPoint=function(e){return this.mercatorPointToHeatmapPoint(this[P("0x690")](e))},t[P("0x5")][P("0x696")]=function(e){var t={};return t.x=Math[P("0x5f0")]((e.x-this[P("0x697")])/this[P("0x698")]+this._spacing),t.y=Math.round((e.y-this._yoffset)/this[P("0x698")]+this[P("0x699")]),t.y=this.height-t.y,t},t[P("0x5")]._setWidthAndHeight=function(e){this[P("0x19a")]=0this[P("0x8b")]&&this[P("0x19a")]>this[P("0x67e")][P("0x69a")]?(this._factor=this[P("0x19a")]/this.defaults[P("0x69a")],this[P("0x8b")]/this[P("0x698")]this[P("0x19a")]&&this[P("0x8b")]>this[P("0x67e")][P("0x69a")]?(this[P("0x698")]=this[P("0x8b")]/this[P("0x67e")][P("0x69a")],this[P("0x19a")]/this._factorthis[P("0x67e")][P("0x69a")]&&(this[P("0x698")]=this[P("0x8b")]/this.defaults[P("0x69a")])):this.heightthis.defaults[P("0x69a")]&&(this[P("0x698")]=this[P("0x19a")]/this[P("0x67e")][P("0x69a")])),this[P("0x19a")]=this[P("0x19a")]/this[P("0x698")],this.height=this[P("0x8b")]/this[P("0x698")]},t[P("0x5")][P("0x69c")]=function(t,i,r){if(this._id=this[P("0x68d")](),this[P("0x69d")]=this._computeBounds(r),this[P("0x68c")]=this[P("0x691")](this[P("0x69d")]),this[P("0x69e")](this[P("0x68c")]),this[P("0x67b")][P("0x181")]=Math.round(this.heatmapOptions.radius?this[P("0x67b")].radius:this[P("0x19a")]>this[P("0x8b")]?this[P("0x19a")]/this[P("0x67e")][P("0x69f")]:this.height/this[P("0x67e")].radiusFactor),this[P("0x699")]=this[P("0x67b")][P("0x181")]*this[P("0x67e")].spacingFactor,this[P("0x697")]=this[P("0x68c")].west,this[P("0x6a0")]=this[P("0x68c")][P("0x2ab")],this[P("0x19a")]=Math.round(this[P("0x19a")]+2*this[P("0x699")]),this[P("0x8b")]=Math[P("0x5f0")](this[P("0x8b")]+2*this[P("0x699")]),this[P("0x68c")][P("0x2a9")]-=this[P("0x699")]*this[P("0x698")],this[P("0x68c")][P("0x2aa")]+=this[P("0x699")]*this[P("0x698")],this._mbounds[P("0x2ab")]-=this._spacing*this._factor,this[P("0x68c")].north+=this[P("0x699")]*this[P("0x698")],this.bounds=this[P("0x693")](this._mbounds),this[P("0x689")]=e[P("0x26b")].fromDegrees(this[P("0x6a1")][P("0x2a9")],this[P("0x6a1")][P("0x2ab")],this[P("0x6a1")].east,this[P("0x6a1")].north),this[P("0x6a2")]?(this[P("0x224")]&&this[P("0x6a2")].setAttribute("id",this[P("0x224")]),this._container.setAttribute("style",P("0x684")+this[P("0x19a")]+P("0x685")+this[P("0x8b")]+P("0x6a3"))):this[P("0x6a2")]=this[P("0x683")](this[P("0x19a")],this[P("0x8b")],this[P("0x224")]),this.heatmapOptions[P("0x131")]=this[P("0x6a2")],this._heatmap?this._heatmap[P("0x6a4")]():this[P("0x6a5")]=h337[P("0xa")](this[P("0x67b")]),this._container[P("0x12f")][0].setAttribute("id",this[P("0x224")]+P("0x6a6")),r&&0=P("0x6ac")?t[P("0x6ad")]=!0:"1.16"<=e[P("0x373")]&&(t[P("0x671")]=.99),this[P("0x6a8")]=this[P("0x13b")][P("0x194")][P("0x6d")]({show:!0,rectangle:{coordinates:this[P("0x689")],material:t}})}else this._layer&&this.viewer[P("0x10f")][P("0x6a9")].remove(this[P("0x6a8")]),this[P("0x6a8")]=this[P("0x13b")][P("0x10f")].imageryLayers[P("0x6ae")](this._getImageryProvider(this))}}(Cesium$2),function(e){function t(t){if(t=e[P("0x102")](t,e[P("0x102")].EMPTY_OBJECT),!e.defined(t[P("0x13b")]))throw new DeveloperError(P("0x63a"));if(this[P("0x13c")]=t[P("0x13b")],!e[P("0x14")](t.center))throw new DeveloperError(P("0x65f"));if(!e[P("0x14")](t[P("0x6af")]))throw new DeveloperError(P("0x6b0"));this[P("0x5b4")]=e[P("0x102")](t[P("0x11a")],[]),this[P("0x6b1")]=t.url;var i=e[P("0x102")](this[P("0x5b4")][2],e.GeoImageCircle.DEFAULT_HEIGHT);this[P("0x217")]=i,this._radius=e.defaultValue(t[P("0x181")],e[P("0x6b2")][P("0x64c")]),this[P("0x596")]=e[P("0x102")](t[P("0x169")],e[P("0x6b2")][P("0x648")]);var r=this[P("0x5b4")][0],n=this._center[1],o=e[P("0x102")](this[P("0x63c")],0),a=this._color,s=this[P("0x6b1")];this._ellipse=null,this[P("0x63e")]=e[P("0x102")](t.classificationType,e[P("0x6b2")][P("0x640")]),this._createImageCircle(r,n,i,o,s,a),this[P("0x646")]=e[P("0x102")](t.isShow,!0),this[P("0x645")](this._isShow)}t[P("0x5")][P("0xf4")]=function(){this._viewer&&this._viewer[P("0x194")][P("0x17f")](this[P("0x6b3")])},t[P("0x5")].setShow=function(t){this[P("0x646")]=e[P("0x102")](t,!0),this[P("0x6b3")][P("0x221")]=t},t[P("0x5")].setColor=function(t){this[P("0x596")]=e[P("0x102")](t,e[P("0x6b2")][P("0x648")]),this[P("0x6b3")][P("0x649")][P("0x19c")][P("0x169")]=this[P("0x596")]},t[P("0x5")][P("0x64a")]=function(){return this[P("0x596")]},t[P("0x5")][P("0x64b")]=function(t){this[P("0x63c")]=e[P("0x102")](t,e[P("0x6b2")][P("0x64c")]),this[P("0x6b3")][P("0x649")][P("0x64d")]=this._radius,this[P("0x6b3")].ellipse[P("0x64d")]=this._radius},t[P("0x5")].getRadius=function(){return this[P("0x63c")]},t[P("0x5")].setCenter=function(t){if(!e.defined(t))throw new DeveloperError(P("0x650"));this[P("0x6b3")].position=position,this[P("0x5b4")]=position},t[P("0x5")][P("0x6b4")]=function(t,i,r,n,o,a){var s=this[P("0x13c")],x=e[P("0x23")][P("0x119")](30);if(!this[P("0x6b3")]){var l=s[P("0x194")].add({position:e[P("0x11")][P("0x1a1")](t,i,r),ellipse:{classificationType:this._classificationType,semiMinorAxis:n,semiMajorAxis:n,rotation:new(e[P("0x652")])(c,!1),stRotation:new(e[P("0x652")])(c,!1),material:new(e[P("0x651")])({color:a,image:o,transparent:!0})}});this._ellipse=l}function c(){return x+=.05}},e.GeoImageCircle=t,e.GeoImageCircle[P("0x63b")]=0,e[P("0x6b2")][P("0x640")]=e[P("0x17a")][P("0x6b5")],e.GeoImageCircle[P("0x64c")]=25e3,e[P("0x6b2")][P("0x648")]=e[P("0x16a")].WHITE}(Cesium$2),function(e){function t(){this[P("0x6b6")]=null,this[P("0x5ba")]=!1,this._speed=0,this[P("0x6b7")]=null,this[P("0x6b8")]=1,this[P("0x5bf")]=0,this[P("0x5cf")]=0,this._mode=0}t[P("0x5")][P("0x69")]=function(){this[P("0x5ba")]=!0,this[P("0x5cf")]=0},t[P("0x5")][P("0xd2")]=function(e){this._actived&&(this[P("0x5cf")]+=e,this[P("0x5cf")]>this[P("0x5bf")]&&(this[P("0x5ba")]=!1))},e[P("0xf")](t.prototype,{position:{get:function(){return this[P("0x6b6")]},set:function(e){e&&(this._position=e[P("0x6e")](this[P("0x6b6")]))}},direction:{get:function(){return this[P("0x6b7")]},set:function(e){e&&(this._direction=e.clone(this[P("0x6b7")]))}},actived:{get:function(){return this[P("0x5ba")]}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}},baseScale:{get:function(){return this[P("0x6b8")]},set:function(e){this._baseScale=e}},life:{get:function(){return this[P("0x5bf")]},set:function(e){this[P("0x5bf")]=e}},time:{get:function(){return this[P("0x5cf")]}},mode:{get:function(){return this[P("0x6b9")]},set:function(e){this._mode=e}}});var i=new(e[P("0x11")]),r=e.GeoLineFireEffect=function(t){t=t||{},this[P("0x6b1")]=t.url?e[P("0x6ba")](t[P("0x6af")]):null,this[P("0x6bb")]=t[P("0x6bc")]?e[P("0x6ba")](t[P("0x6bc")]):null,this._explode=t.explode?t[P("0x6bd")]:0,this[P("0x6be")]=[],this._scene=t[P("0x13b")][P("0x10f")],this._clock=t.viewer[P("0x571")];var i=t[P("0xfc")]?t[P("0xfc")]:1;this[P("0x6bf")]=2*i,this[P("0x6c0")]=.1*i,this[P("0x6c1")]=1*i,this._startColor=new(e[P("0x16a")])(1,1,1,1),this[P("0x6c2")]=new(e[P("0x16a")])(.8,0,0,.01),t.smoking&&(this._endColor[P("0x66e")]=1-t[P("0x6c3")]);var r=t[P("0x6c4")]?t.life:1;this[P("0x6c5")]=.5*r,this[P("0x6c6")]=2*r;var n=t[P("0x539")]?t[P("0x539")]:1;if(this[P("0x6c7")]=7*n,this[P("0x6c8")]=20*n,this[P("0x6c9")]=t[P("0x1a9")]?t.count:0,this[P("0x63c")]=t.radius?t[P("0x181")]:1,this[P("0x6ca")]=t[P("0x6cb")]?t[P("0x6cb")]:4,this._fires=[],this[P("0x6cc")]=null,this[P("0x6cd")]=null,this[P("0x6ce")]=null,this[P("0x6cf")]=null,this._directionsArray=null,this[P("0x6d0")]=null,this[P("0x5b7")]=!0,this[P("0x6d1")]=0,this[P("0x5cf")]=0,this[P("0x6d2")](),this[P("0x6d3")](this[P("0x6c9")]),t[P("0x19f")]&&t[P("0x19f")][P("0x0")])for(var o=t[P("0x19f")],a=0;a1-this._explode&&(t[P("0xd3")]=1,t[P("0x6e0")]*=1.2,t[P("0x6c4")]*=.2,t[P("0x539")]*=2),null!==t.position},r[P("0x5")][P("0x6e1")]=function(e){e.update(this[P("0x5cf")]),e.actived||this[P("0x6e2")](e)&&e[P("0x69")]()},r.prototype[P("0x5c8")]=function(t){var i;if(i=this[P("0x6e3")][P("0x6e4")]?t.time[P("0x6e5")]:e[P("0x5d0")]()/1e3,0===this[P("0x6d1")])this[P("0x6d1")]=i;else{var r=i-this[P("0x6d1")];r>this[P("0x6c6")]&&(r=this[P("0x6c6")]),this[P("0x5cf")]=r,this[P("0x6d1")]=i}},r[P("0x5")].update=function(e){this[P("0x5c8")](e);var t=this[P("0x6c9")];if(!(t<1||t!==this[P("0x6d7")][P("0x0")]||this[P("0x6be")][P("0x0")]<1)&&this[P("0x6cc")]){if(this[P("0x5b7")]){for(var i=0;i 0.618){\n"+P("0x714")+P("0x614")+" else{\n"+P("0x715")+" }\n}",a=P("0x701")+P("0x702")+"varying float v_texIndex;\n"+P("0x716")+P("0x717")+P("0x708")+"{\n"+P("0x718")+P("0x719")+P("0x71a")+" if (v_texIndex === 1.0){\n"+P("0x71b")+" }\n else{\n"+P("0x71c")+P("0x71d")+P("0x614")+P("0x71e")+" if (v_texIndex === 1.0){\n"+P("0x71b")+P("0x71d")+" else{\n"+P("0x71c")+P("0x71d")+P("0x71f")+P("0x614")+P("0x720")+P("0x721")+P("0x614")+P("0x722")+" float mc = max(max(color.r, color.g), color.b);\n"+P("0x723")+P("0x614")+" else{\n"+P("0x724")+" color.a = 0.0;\n }\n"+P("0x614")+" color = czm_gammaCorrect(color);\n"+P("0x725")+P("0x726")+P("0x727")+P("0x728")+"}"}(Cesium$2),function(e){function t(){this[P("0x6b6")]=null,this[P("0x5ba")]=!1,this[P("0x5b9")]=0,this[P("0x6b7")]=null,this[P("0x6b8")]=1,this._life=0,this[P("0x5cf")]=0,this[P("0x6b9")]=0,this._alphaFact=0,this._normalFact=1}t[P("0x5")].active=function(){this._actived=!0,this[P("0x5cf")]=0};var i=new(e[P("0x11")]),r=new e.Cartesian3;t.prototype[P("0xd2")]=function(t){if(this[P("0x5ba")])if(this[P("0x5cf")]+=t,this[P("0x5cf")]>this[P("0x5bf")])this[P("0x5ba")]=!1;else{var n=e[P("0x11")].normalize(this._position,i),o=e[P("0x11")][P("0x6c")](this[P("0x6b7")],this[P("0x729")],r);e.Cartesian3[P("0x6d")](n,o,n),e.Cartesian3[P("0x8d")](n,this[P("0x6b7")]),e.Cartesian3[P("0x6c")](this[P("0x6b7")],t*this[P("0x5b9")],n),e[P("0x11")][P("0x6d")](this._position,n,this._position),.025this[P("0x6c6")]&&(r=this[P("0x6c6")]),this[P("0x5cf")]=r,this._preTime=i}},o[P("0x5")][P("0xd2")]=function(e){this[P("0x5c8")](e);var t=this._count;if(!(t<1||t!==this[P("0x72f")][P("0x0")]||this[P("0x6be")][P("0x0")]<1)&&this[P("0x6cc")]){if(this._needUpdate){this[P("0x73d")]=this._door*t;for(var i=0;i=",!1,"GE"),gt:t(">",!1,"GT"),lt:t("<",!0,"LT"),le:t("<=",!0,"LE"),eq:t("-",!0,"EQ",!0)}})(),function(e){e[P("0x7d8")]={};var t=e[P("0x7d9")];function i(e,t){this[P("0x7da")]=e,this.edges=t}var r,n=i[P("0x5")];function o(e,t,i){for(var r=1,n=e.length;r>1;return[P("0x7f1"),a(e[P("0x1d5")](0,t)),",",a(e.slice(t)),")"].join("")}function s(e,t){if("m"!==e[P("0x68e")](0))return s(t,e);if("w"!==t[P("0x68e")](0))return[P("0x7f4"),e,",",t,")"][P("0x7ca")]("");var i=e[P("0x7f2")]("[");return["w",t[P("0x7f3")](1),"m",i[0][P("0x7f3")](1)][P("0x7ca")]("")}function x(e){if(2===e[P("0x0")])return[["diff(",s(e[0][0],e[1][1]),",",s(e[1][0],e[0][1]),")"][P("0x7ca")]("")];for(var t=[],i=0;i>1;return[P("0x7f1"),a(e.slice(0,t)),",",a(e.slice(t)),")"].join("")}function s(e){if(2===e[P("0x0")])return[["sum(prod(",e[0][0],",",e[1][1],P("0x803"),e[0][1],",",e[1][0],"))"][P("0x7ca")]("")];for(var t=[],i=0;ig[0]&&u[P("0x17c")](new n(g,d,2,h),new n(d,g,1,h))}u[P("0x3d2")](o);for(var p,m,b,v,C,y,_=u[0].a[0]-(1+Math[P("0x78")](u[0].a[0]))*Math[P("0x2ae")](2,-52),A=[new r([_,1],[_,0],-1,[],[],[],[])],I=[],w=(h=0,u.length);h 0.0)\n"+P("0x871")+P("0x872")+P("0x873")+P("0x874")+P("0x875")+P("0x7bf")+P("0x7b7")+P("0x876")+P("0x877")+" }\n return clipAmount;\n}\n"},r.mularea[P("0x878")]=function(e,t,i){return P("0x879")+P("0x87a")+P("0x87b")+"void main() \n"+P("0x87c")+P("0x87d")+" float clipDistance = clip(gl_FragCoord, "+e+", "+t+P("0x87e")+" vec4 clippingPlanesEdgeColor = vec4(1.0); \n"+P("0x87f")+i+P("0x880")+P("0x881")+i+".a; \n"+P("0x882")+" { \n"+P("0x883")+P("0x884")+P("0x885")},r}},a.prototype[P("0x854")]=function(t){var i=this._generateSourcePlanes(t);if(e[P("0x14")](i)){var r=new(e[P("0x36a")])({planes:i,edgeWidth:this[P("0x824")][P("0x671")],edgeColor:this[P("0x824")],unionClippingRegions:!0});return r[P("0x857")]={},r[P("0x857")][P("0x858")]=!1,r[P("0x857")][P("0x859")]=function(e){return P("0x85a")+"{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n"+P("0x886")+P("0x85c")+P("0x85d")+P("0x85e")+P("0x7bc")+e+"; i+=3)\n"+P("0x85f")+P("0x887")+P("0x860")+P("0x861")+" clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"+P("0x888")+P("0x864")+P("0x865")+" j++;\n"+P("0x867")+P("0x868")+P("0x869")+P("0x889")+P("0x86a")+P("0x86b")+P("0x86c")+P("0x88a")+" clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"+P("0x86e")+" clipPosition = -clippingPlane.w * clipNormal;\n"+P("0x86f")+P("0x870")+P("0x88b")+P("0x871")+" bDiscard = false;\n"+P("0x873")+" }\n"+P("0x875")+P("0x7bf")+P("0x88c")+P("0x7b7")+P("0x876")+" return -100.0;\n }\n return 100.0;\n}\n"},r[P("0x857")][P("0x878")]=function(e,t,i){return P("0x879")+P("0x87a")+P("0x87b")+P("0x88d")+"{ \n"+P("0x87d")+P("0x88e")+e+", "+t+P("0x87e")+" vec4 clippingPlanesEdgeColor = vec4(1.0); \n"+P("0x87f")+i+P("0x880")+P("0x881")+i+P("0x88f")+P("0x890")+P("0x891")+" out_FragColor = mix(out_FragColor, clippingPlanesEdgeColor, clippingPlanesEdgeWidth);\n"+P("0x884")+P("0x885")},r}},a[P("0x5")][P("0x855")]=function(e){var t=this[P("0x826")],i=t[P("0x0")];if(!(i<1)){for(var r=[],n=0;nr&&(this._repeat||this[P("0x8c4")](),this[P("0x6f2")]=0),this[P("0x5bc")]=t}},t[P("0x5")][P("0x8c4")]=function(){this[P("0x82b")]=!1,this[P("0x8c2")][P("0x896")]()},t[P("0x5")][P("0x8c3")]=function(e){var t=e[P("0x7e")];this[P("0x77b")]=t[P("0x8c5")].clone(this._invViewMatrix),this._updateScanCirclePostProcess(e),this[P("0x8c6")](e)},t[P("0x5")][P("0x8c7")]=function(t){var i=this;if(i[P("0x8bc")])return this[P("0x8bc")][P("0x364")]=!0,void(this[P("0x13c")].scene[P("0x77c")][P("0xd1")](this[P("0x8bc")])||(this[P("0x13c")][P("0x10f")].postProcessStages[P("0x6d")](this[P("0x8bc")]),this[P("0x8bc")][P("0xd2")](t.context,t[P("0x77d")])));var r=P("0x7a0")+P("0x7a1")+P("0x8c8")+P("0x8c9")+"uniform vec3 u_normal;\n"+P("0x5fc")+"uniform vec4 u_param0;\n"+P("0x7a4")+P("0x5f9")+P("0x8ca")+P("0x8cb")+P("0x8cc")+" out_FragColor = color;\n"+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+" position = u_invViewMatrix * position;\n position /= position.w;\n float t = (u_param0.y > u_param0.x) ? u_param0.x : u_param0.y;\n float al = (u_param0.y <= u_param0.x) ? 1.0 : clamp(1.0 - (u_param0.y - u_param0.x) / (0.65 * u_param0.x), 0.0, 1.0);\n"+P("0x8d3")+" vec3 b = normalize(position.xyz - u_center);\n vec3 n = normalize(u_normal);\n"+P("0x8d4")+P("0x8d5")+" b = cross(n, nc);\n"+P("0x8d6")+P("0x8d7")+P("0x614")+" float d = u_param0.z * t;\n"+P("0x8d8")+P("0x8d9")+P("0x8da")+P("0x8db")+P("0x8dc")+" float r = abs(z - d5);\n float z1 = clamp(u_color.a, 0.1, 0.6) * (1.0 - r / hw5);\n"+P("0x8dd")+" }\n if (z < (d + hw) && z > (d - hw)){\n"+P("0x8de")+P("0x8df")+P("0x8e0")+P("0x71d")+P("0x8e1")+" }\n out_FragColor = color;\n}",n=new(e[P("0x12")]);i[P("0x8bc")]=new e.PostProcessStage({fragmentShader:r,uniforms:{u_invViewMatrix:function(){return i[P("0x8e2")]},u_center:function(){return i[P("0x11a")]},u_normal:function(){return i[P("0x4d0")]},u_color:function(){return i[P("0x169")]},u_param0:function(){return n.x=.607*i.life,n.y=i.time,n.z=i[P("0x539")],n.w=i.lineWidth,n}}}),i[P("0x8bc")].enabled=!1},t.prototype._updateScanAperturePostProcess=function(t){var i=this;if(i[P("0x8bd")])return this[P("0x8bd")][P("0x364")]=!0,void(this._viewer.scene[P("0x77c")][P("0xd1")](this._scanAperturePostProcess)||(this[P("0x13c")][P("0x10f")][P("0x77c")][P("0x6d")](this[P("0x8bd")]),this[P("0x8bd")][P("0xd2")](t.context,t[P("0x77d")])));var r="uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform mat4 u_invViewMatrix;\nuniform vec3 u_center;\n"+P("0x8e3")+"uniform vec4 u_color;\n"+P("0x8e4")+"varying vec2 v_textureCoordinates;\n"+P("0x5f9")+" vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+P("0x8cc")+" out_FragColor = color;\n"+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+" zd = (2.0 * zd - czm_depthRange.near - czm_depthRange.far) / (czm_depthRange.far - czm_depthRange.near);\n"+P("0x8d1")+" vec4 position = czm_inverseProjection * vec4(xy, zd, 1.0);\n position = u_invViewMatrix * position;\n"+P("0x8e5")+P("0x8e6")+" float al = (u_param0.y <= u_param0.x) ? 1.0 : clamp(1.0 - (u_param0.y - u_param0.x) / (0.65 * u_param0.x), 0.0, 1.0);\n"+P("0x8d3")+P("0x8e7")+" vec3 n = normalize(u_normal);\n"+P("0x8d4")+P("0x8d5")+P("0x8e8")+P("0x8d6")+P("0x8d7")+" }\n"+P("0x8e9")+" float d5 = u_param0.z * u_param0.y;\n"+P("0x8d9")+" float hw5 = hw * 12.0;\n float hd = dot(u_normal, position.xyz) - dot(u_normal, u_center);\n if (z < (d5 + hw5) && z > (d5 - hw5)){\n"+P("0x8ea")+P("0x8eb")+P("0x8ec")+P("0x614")+P("0x8ed")+" float r = abs(z - d);\n"+P("0x8ee")+P("0x8ef")+P("0x614")+P("0x728")+"}",n=new(e[P("0x12")]);i[P("0x8bd")]=new(e[P("0x7c5")])({fragmentShader:r,uniforms:{u_invViewMatrix:function(){return i[P("0x8e2")]},u_center:function(){return i[P("0x11a")]},u_normal:function(){return i.normal},u_color:function(){return i[P("0x8c1")]},u_param0:function(){return n.x=.607*i.life,n.y=i[P("0x6f2")],n.z=i.speed,n.w=i[P("0x197")],n}}}),i[P("0x8bd")].enabled=!1}}(Cesium$2),function(e){var t=e[P("0x8f0")]=function(t){this[P("0x13c")]=t[P("0x13b")];var i=e[P("0x13")][P("0x1a1")].apply(this,t[P("0x11a")]);this[P("0x5b4")]=e[P("0x11")].fromRadians(i[P("0x112")],i.latitude,i[P("0x8b")]),this[P("0x63c")]=t[P("0x181")],this[P("0x596")]=t[P("0x169")]?t[P("0x169")].clone():e[P("0x16a")][P("0x438")][P("0x6e")](),this[P("0x5b9")]=t.speed?t.speed:1,this[P("0x8ba")]=!!t[P("0x8bb")]&&t[P("0x8bb")],this._enabled=!t.enabled||t[P("0x364")],this._longest=e.defined(t[P("0x8f1")])?t[P("0x8f1")]:15e3,this[P("0x8f2")]=e.defined(t.url)?t.url:null,this[P("0x8f3")]=null,this[P("0x5bc")]=0,this[P("0x48b")]=!1,this[P("0x8be")]=e.Cartesian3[P("0x8d")](this[P("0x5b4")],new(e[P("0x11")])),this[P("0x5bf")]=this._radius/this._speed,this[P("0x5cf")]=0,this[P("0x77b")]=null,this[P("0x8f4")]=null,this._param0=null,this[P("0x8f5")]=null,this._param2=null,this[P("0x8f6")]=null,this._param4=null,this[P("0x8f7")]=!1};e.defineProperties(t.prototype,{enabled:{get:function(){return this[P("0x82b")]},set:function(e){this[P("0x82b")]=e}},radius:{get:function(){return this[P("0x63c")]},set:function(t){e[P("0x14")](t)&&0!==t&&t!==this._radius&&(this[P("0x63c")]=t,this[P("0x5bf")]=this[P("0x63c")]/this[P("0x5b9")])}},speed:{get:function(){return this._speed},set:function(t){e[P("0x14")](t)&&0!==t&&t!==this[P("0x5b9")]&&(this[P("0x5b9")]=t,this[P("0x5bf")]=this._radius/this[P("0x5b9")])}},color:{get:function(){return this[P("0x596")]},set:function(e){this[P("0x596")]=e}}}),t.prototype[P("0xd2")]=function(e){var t=this;t[P("0x8f8")](e[P("0x7e")])?(t[P("0x8f9")](e),t[P("0x82b")]?(t._updateTime(),t._enabled&&(t[P("0x8fa")](),t._updatePostProcesses(e))):t[P("0x8f3")]&&(t[P("0x8f3")][P("0x364")]=!1)):t[P("0x8f3")]&&(t[P("0x8f3")][P("0x364")]=!1)},t[P("0x5")][P("0x8fb")]=function(e){var t=this;t[P("0x8f2")]!==e&&(t[P("0x8f2")]=e,t._ready=!1,t[P("0x8fc")]=null,t[P("0x8f5")]=null,t._param2=null,t[P("0x8f6")]=null,t[P("0x8fd")]=null,t[P("0x8f3")]&&(t._scanPostProcess[P("0x364")]=!1,t[P("0x13c")][P("0x10f")].postProcessStages[P("0x17f")](t._scanPostProcess),t[P("0x8f3")]=null),t._texture&&(t._texture[P("0xf4")](),t._texture=null),t[P("0x8f7")]=!1)};var i=new(e[P("0x11")]);t[P("0x5")][P("0x8f8")]=function(t){return!(e[P("0x11")][P("0x96")](e.Cartesian3[P("0x95")](t.position,this[P("0x5b4")],i))>this[P("0x8fe")])},t.prototype[P("0xf4")]=function(){this[P("0x8f3")]&&(this._scanPostProcess[P("0x364")]=!1,this[P("0x13c")][P("0x10f")].postProcessStages[P("0x17f")](this[P("0x8f3")]),this._scanPostProcess=null)},t[P("0x5")][P("0x5c8")]=function(){var t=e[P("0x5d0")]()/1e3;if(0===this[P("0x5bc")])this[P("0x5bc")]=t,this._time=0;else{var i=t-this._lastTime,r=this[P("0x5bf")];rr&&(this[P("0x8ba")]||this[P("0x8c4")](),this[P("0x5cf")]=0),this._lastTime=t}},t.prototype[P("0x8c4")]=function(){this[P("0x82b")]=!1},t[P("0x5")][P("0x8f9")]=function(t){var i=this;if(null!==i[P("0x8f2")]){if(i._texture)i[P("0x48b")]=!0;else if(i[P("0x48b")]=!1,!i._loading){i._loading=!0;var r=t.context,n=e[P("0x6ba")](i._textureUrl);e[P("0x6da")][P("0x6dc")]({url:n,headers:{"cache-control":P("0x8ff")}})[P("0x333")]((function(t){i[P("0x8f7")]=!1,i[P("0x8f4")]=new(e[P("0x6db")])({context:r,source:t},(function(e){hat[P("0x8f2")]=null}))}))}}else i[P("0x48b")]=!0},t[P("0x5")][P("0x8fa")]=function(){var t=this,i=t[P("0x5b4")],r=t[P("0x8be")],n=e[P("0x11")][P("0x99")](e[P("0x11")][P("0xc3")],r,new(e[P("0x11")])),o=e[P("0x11")].cross(r,n,new(e[P("0x11")]));e.Cartesian3[P("0x8d")](n,n),e[P("0x11")][P("0x8d")](o,o);var a=e.Cartesian3[P("0xc8")](n,new(e[P("0x11")])),s=e[P("0x11")][P("0xc8")](o,new e.Cartesian3),x=t[P("0x5b9")]*t._time;if(null===t[P("0x8f2")])x/=1.532,t._param0=new(e[P("0x12")])(i.x,i.y,i.z),t[P("0x8f5")]=new e.Cartesian4(r.x,r.y,r.z),t[P("0x900")]=new(e[P("0x12")])(x),t[P("0x8f6")]=new(e[P("0x12")])(r.x,r.y,r.z,-e[P("0x11")][P("0x92")](r,i));else{var l=e.Cartesian3[P("0x6d")](i,e[P("0x11")][P("0x6c")](a,x,new(e[P("0x11")])),new(e[P("0x11")])),c=e[P("0x11")][P("0x6d")](i,e[P("0x11")][P("0x6c")](n,x,new(e[P("0x11")])),new(e[P("0x11")])),u=e[P("0x11")][P("0x6d")](i,e[P("0x11")][P("0x6c")](s,x,new e.Cartesian3),new(e[P("0x11")])),h=e[P("0x11")].add(i,e[P("0x11")][P("0x6c")](o,x,new(e[P("0x11")])),new(e[P("0x11")]));t._param0=new(e[P("0x12")])(n.x,n.y,n.z,-e[P("0x11")][P("0x92")](n,l)),t._param1=new(e[P("0x12")])(a.x,a.y,a.z,-e[P("0x11")][P("0x92")](a,c)),t[P("0x900")]=new(e[P("0x12")])(o.x,o.y,o.z,-e[P("0x11")].dot(o,u)),t[P("0x8f6")]=new(e[P("0x12")])(s.x,s.y,s.z,-e.Cartesian3[P("0x92")](s,h)),t[P("0x8fd")]=new(e[P("0x12")])(r.x,r.y,r.z,-e[P("0x11")][P("0x92")](r,i))}},t[P("0x5")][P("0x8c3")]=function(t){var i=this;if(i._ready){var r=t[P("0x7e")];if(i._invViewMatrix=r[P("0x8c5")][P("0x6e")](i[P("0x77b")]),i[P("0x8f3")])return i[P("0x8f3")][P("0x364")]=!0,void(i._viewer[P("0x10f")][P("0x77c")][P("0xd1")](i[P("0x8f3")])||(i[P("0x13c")][P("0x10f")][P("0x77c")].add(i[P("0x8f3")]),i._scanPostProcess.update(t.context,t[P("0x77d")])));if(null===i[P("0x8f2")]){var n=P("0x7a0")+"uniform sampler2D depthTexture;\n"+P("0x8c8")+P("0x5fc")+"uniform vec4 u_param0;\nuniform vec4 u_param1;\nuniform vec4 u_param2;\n"+P("0x901")+P("0x7a4")+"void main(){\n vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+P("0x8cc")+P("0x902")+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+P("0x903")+" position /= position.w;\n"+P("0x904")+P("0x905")+" out_FragColor = color;\n return;\n"+P("0x614")+P("0x906")+P("0x907")+P("0x908")+" if(z2 > u_param2.x){\n"+P("0x902")+P("0x8cd")+P("0x614")+P("0x909")+P("0x90a")+P("0x902")+P("0x8cd")+P("0x614")+P("0x90b")+"}";i[P("0x8f3")]=new e.PostProcessStage({fragmentShader:n,uniforms:{u_invViewMatrix:function(){return i[P("0x77b")]},u_color:function(){return i[P("0x596")]},u_param0:function(){return i._param0},u_param1:function(){return i[P("0x8f5")]},u_param2:function(){return i[P("0x900")]},u_param3:function(){return i._param3}}})}else n="uniform sampler2D colorTexture;\n"+P("0x7a1")+"uniform sampler2D u_texture;\n"+P("0x8c8")+"uniform vec4 u_color;\n"+P("0x8e4")+"uniform vec4 u_param1;\n"+P("0x90c")+P("0x901")+P("0x90d")+P("0x7a4")+P("0x5f9")+" vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+" if(currD.r >= 1.0){\n"+P("0x902")+" return;\n"+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+P("0x903")+P("0x8e5")+P("0x90e")+P("0x90f")+P("0x902")+P("0x8cd")+P("0x614")+P("0x910")+P("0x911")+P("0x902")+P("0x8cd")+P("0x614")+P("0x912")+P("0x913")+P("0x902")+P("0x8cd")+P("0x614")+P("0x914")+P("0x915")+P("0x902")+" return;\n"+P("0x614")+P("0x916")+" if(z4 < -800.0 || z4 > 800.0){\n"+P("0x902")+" return;\n"+P("0x614")+" float u = z0 / (z0 + z1);\n float v = z2 / (z2 + z3);\n vec4 sColor = texture(u_texture, vec2(u, v));\n"+P("0x917")+" sColor = sColor * (1.0 - a) + a * u_color;\n"+P("0x918")+"}",i[P("0x8f3")]=new(e[P("0x7c5")])({fragmentShader:n,uniforms:{u_invViewMatrix:function(){return i._invViewMatrix},u_color:function(){return i._color},u_texture:function(){return i._texture},u_param0:function(){return i._param0},u_param1:function(){return i._param1},u_param2:function(){return i[P("0x900")]},u_param3:function(){return i[P("0x8f6")]},u_param4:function(){return i[P("0x8fd")]}}});i[P("0x8f3")].enabled=!1}}}(Cesium$2),function(e){function t(e){this[P("0x63c")]=e[P("0x181")],this._direction=e[P("0x93")],this[P("0x919")]=e[P("0x91a")]}var i=new e.Cartesian3,r=new(e[P("0x11")]),n=new(e[P("0x17")]),o=new e.Quaternion,a=new(e[P("0x1a")]),s=new(e[P("0x1b")]);t[P("0x5")][P("0x91b")]=function(t){var x,l,c,u,h,f;x=this[P("0x6b7")],(l=n)[P("0x7f")]=x.heading,l[P("0x80")]=x[P("0x81")],l.roll=x[P("0x80")],c=n,u=o,e[P("0x1d")].fromHeadingPitchRoll(c,u),h=o,f=a,e[P("0x1a")][P("0xcd")](h,f);var d,g,p,m,b,v,C,y,_=(d=a,g=s,e[P("0x1b")][P("0x738")](d,void 0,g));p=i,m=r,b=this[P("0x63c")],v=this[P("0x919")],C=e[P("0x23")][P("0x6de")](0,e.Math.TWO_PI),y=(b=e[P("0x23")][P("0x6de")](0,b))+Math.tan(e[P("0x23")][P("0x119")](v)),p.x=b*Math[P("0x9a")](C),p.y=e[P("0x23")][P("0x6de")](0,10),p.z=-b*Math[P("0x98")](C),m.x=y*Math[P("0x9a")](C),m.y=p.y+1,m.z=-y*Math.sin(C),e[P("0x1b")][P("0xd4")](_,i,i),e[P("0x1b")][P("0xd4")](_,r,r),t.position=e.Cartesian3.clone(i,t[P("0x8c")]),t[P("0x91c")]=e[P("0x11")][P("0x95")](r,i,t[P("0x91c")]),e[P("0x11")].normalize(t[P("0x91c")],t[P("0x91c")])};var x=e.GeoSprinklerParticleSystem=function(t){this._image=t[P("0x475")],this[P("0x6b6")]=t[P("0x11a")],this[P("0x6b7")]=t[P("0x93")],this[P("0x6c1")]=e[P("0x14")](t.imageSize)?t[P("0x91d")]:new(e[P("0x10")])(4.9,4.9),this[P("0x91e")]=e[P("0x14")](t[P("0x91f")])?t[P("0x91f")]:4.9,this[P("0x5b9")]=e.defined(t.speed)?t[P("0x539")]:27.46,this[P("0x920")]=e.defined(t.emissionRate)?t[P("0x921")]:800,this[P("0x63c")]=e.defined(t[P("0x181")])?t[P("0x181")]:.2,this[P("0x922")]=e.defined(t.lifetime)?t[P("0x923")]:1,this[P("0x919")]=e[P("0x14")](t[P("0x91a")])?t[P("0x91a")]:.89,this[P("0x8fe")]=e.defined(t[P("0x8f1")])?t[P("0x8f1")]:2e3;var i=e.Color[P("0x2cf")];this[P("0x72c")]=i[P("0x16c")](.8),this[P("0x6c2")]=i.withAlpha(0),this[P("0x924")]=null,this[P("0x925")]()};x[P("0x5")][P("0xd2")]=function(e){this[P("0x924")]&&(this[P("0x8f8")](e[P("0x7e")])?this[P("0x924")][P("0xd2")](e):this[P("0x926")]())},x[P("0x5")][P("0x925")]=function(){if(!this[P("0x924")]){var i=e[P("0x13")][P("0x1a1")].apply(this,this[P("0x6b6")]);i=e[P("0x11")].fromRadians(i.longitude,i.latitude,i[P("0x8b")]);var r=e[P("0x1f")][P("0xbf")](i);return this._system=new e.ParticleSystem({image:this[P("0x595")],startColor:this[P("0x72c")],endColor:this[P("0x6c2")],particleLife:this[P("0x91e")],speed:this[P("0x5b9")],imageSize:this[P("0x6c1")],emissionRate:this[P("0x920")],emitter:new t({radius:this._radius,direction:this._direction,angle:this._angle}),lifetime:this[P("0x922")],updateCallback:h,modelMatrix:r}),this[P("0x924")]}},x[P("0x5")].destroy=function(){this[P("0x924")]&&(this[P("0x924")].destroy(),this._system=null)},x[P("0x5")][P("0x926")]=function(){this._system&&function(t){if(e[P("0x14")](t[P("0x927")])){for(var i=t[P("0x927")],r=i[P("0x0")],n=0;nthis[P("0x8fe")])};var u=new(e[P("0x11")]);function h(t,i){var r=e.Cartesian3[P("0x8d")](t[P("0x8c")],u);e.Cartesian3[P("0xc8")](r,r),e[P("0x11")][P("0x6c")](r,8.16*i,r),t[P("0x91c")]=e[P("0x11")].add(t[P("0x91c")],r,t[P("0x91c")])}}(Cesium$2),function(e){var t=e[P("0x92a")]=function(e){this[P("0x92b")]=e.fieldName,this[P("0x92c")]=e[P("0x92d")],this._minValue=e[P("0x92e")],this[P("0x92f")]=e[P("0x930")],this[P("0x931")]=e[P("0x932")]};t[P("0x5")][P("0x934")]=function(){var t=function(t){if(!e[P("0x14")](t))return"";var i=255*t.red,r=255*t[P("0x66f")],n=255*t[P("0x670")],o=t.alpha;return P("0x933")+i+","+r+","+n+","+o+");"}(this[P("0x92c")]),i=P("0x935");if(!e[P("0x14")](this[P("0x92b")]))return(i+=P("0x936")+t+";\n")+"} \n";var r="";return this[P("0x92b")]===P("0x469")&&(r="v_elevationPos.z"),i+=1===(this[P("0x92f")]===this[P("0x937")])?"if ("+r+P("0x938")+this._minValue+P("0x939"):P("0x93a")+r+" >= "+this[P("0x937")]+P("0x93b")+r+" <= "+this[P("0x92f")]+P("0x939"),i+="{ \n",i+=P("0x936")+t+";\n",(i+=P("0x885"))+P("0x885")},t.prototype[P("0x93c")]=function(){if(!e[P("0x14")](this[P("0x92b")])||this[P("0x92b")]!==P("0x469"))return"";var t="",i="";this[P("0x92b")]===P("0x469")&&(i="v_elevationPos.z");var r=this[P("0x92f")]===this[P("0x937")],n=this[P("0x937")][P("0x531")]();-1===n[P("0x2d3")](".")&&(n+=".0");var o=this._maxValue.toString();-1===o[P("0x2d3")](".")&&(o+=".0");var a=this[P("0x92c")][P("0x531")]();return-1===a[P("0x2d3")](".")&&(a+=".0"),t+=1===r?P("0x93a")+i+P("0x938")+n+P("0x93d"):P("0x93a")+i+P("0x93e")+n+P("0x93f")+i+" <= "+o+P("0x93d"),t+=P("0x87c"),(t+="luminanceValue = "+a+";\n")+P("0x885")},t.prototype.makeShader=function(){var e;return this._topic===P("0x940")&&(e=this[P("0x934")]()),this[P("0x931")]===P("0x941")&&(e=this[P("0x93c")]()),e},t[P("0x5")][P("0x942")]=function(t){if(this[P("0x931")]===P("0x941")){if(!e[P("0x14")](this[P("0x92b")]))return this[P("0x92c")];if(this._fieldName!==P("0x469")){if(this[P("0x92b")]===P("0x943"))return this._fieldValue;var i=t[P("0x944")](this[P("0x92b")]);return i>=this[P("0x937")]&&i<=this[P("0x92f")]?this._fieldValue:void 0}}}}(Cesium$2),function(e){(e[P("0x945")]=function(){})[P("0x5")][P("0x946")]=function(t,i,r){var n=i,o={};return o[P("0x932")]=t,4===i[P("0x0")]?(o[P("0x92d")]=n[0],o.fieldName=n[1],"$"===o[P("0x947")][P("0x7f3")](0,1)&&(o[P("0x947")]=o.fieldName[P("0x7f3")](1,o[P("0x947")][P("0x0")]-1)),o.minValue=n[2],o.maxValue=n[3],i[1]===P("0x469")&&(r[P("0x948")]=!0)):1===i[P("0x0")]?o[P("0x92d")]=i[0]:2===i[P("0x0")]&&(o[P("0x92d")]=n[0],o[P("0x947")]=n[1]),new(e[P("0x92a")])(o)}}(Cesium$2),function(e){function t(e,t,i){var r=i[P("0x10f")][P("0x77c")][P("0x949")];r[P("0x364")]=e,r[P("0x19d")][P("0x94a")]=!1,r[P("0x19d")][P("0x94b")]=119,r.uniforms[P("0x94c")]=-.4,r[P("0x19d")].delta=.9,r[P("0x19d")][P("0x94d")]=3.78,r.uniforms[P("0x94e")]=t,r[P("0x19d")][P("0x94f")]=!1}var i=e[P("0x950")]=function(i){if(e[P("0x14")](i)){if(this[P("0x951")]=!1,this[P("0x952")]=!1,this._enabledLightBand=!1,this[P("0x953")]=!1,this[P("0x954")]=5,this[P("0x955")]=i[P("0x815")],this._useElevation=!1,this[P("0x956")]=new(e[P("0x945")]),e[P("0x14")](i.mixedColor)){this[P("0x951")]=e[P("0x102")](i[P("0x940")][P("0x364")],!1);var r=i[P("0x940")].conditions;if(e[P("0x14")](r)){this._mixedColorConditions=[];for(var n=0;n=P("0x996")&&(i[P("0x671")]=.99),this[P("0x6a8")]=this.viewer[P("0x194")][P("0x6d")]({rectangle:{coordinates:this._rectangle,material:i}})},t[P("0x5")].setData=function(e){this[P("0x440")]=e,this[P("0x997")]=new(this[P("0x978")]),this[P("0x6aa")]()}}(Cesium$2),function(e){var t="GEO_OVERVIEW_ICO_SOURCE",i=P("0x998"),r=P("0x999");function n(t,i){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x13b")]=t[P("0x13b")],this.map2D=null,this[P("0x99a")]=e[P("0x102")](t[P("0x99a")],{mapCRS:{topTileExtent:[-180,-270,180,90],coordtransform:"none"},style:{version:8,sources:{tdt_source_overview:{type:P("0x99b"),tiles:[P("0x99c")],tileSize:256}},layers:[{id:P("0x99d"),type:"raster",source:"tdt_source_overview",layout:{visibility:P("0x99e")}}]},zoom:4,center:[112.939,31.377],renderWorldCopies:!1,isIntScrollZoom:!0,isAttributionControl:!1}),this[P("0x19a")]=t[P("0x19a")],this[P("0x8b")]=t[P("0x8b")],this.layout=e.defaultValue(t.layout,"BR"),this[P("0x99f")]=t[P("0x99f")],this[P("0x9a0")]=e[P("0x102")](t[P("0x9a0")],1),this[P("0x9a1")]=e.defaultValue(t.movingTargetZoomLevel,14),this.callback="function"==typeof i?i:function(){},this.scalable=!1,this[P("0x9a2")]=!1,this._latelyUpdateStamp=0,this._modelType=n[P("0x9a3")][P("0x9a4")],this[P("0x9a5")](),this._bindEvent()}n[P("0x5")]._initOverview=function(){var e=this[P("0x13b")].cesiumWidget[P("0x131")].parentElement,t=document[P("0x15c")]("div");t.className=P("0x9a6"),t[P("0x150")].display="block",t.style[P("0x8c")]="absolute",t.style[P("0x19a")]=this.width+"px",t.style.height=this[P("0x8b")]+"px",this[P("0x9a7")][P("0x9a8")]()[P("0x9a9")]("B")?t[P("0x150")][P("0x9aa")]=P("0x9ab"):this.layout[P("0x9a8")]().startsWith("T")&&(t[P("0x150")][P("0x151")]=P("0x9ab")),this[P("0x9a7")][P("0x9a8")]().endsWith("R")?t[P("0x150")][P("0x9b")]=P("0x9ab"):this.layout[P("0x9a8")]().endsWith("L")&&(t[P("0x150")][P("0x149")]="5px"),e[P("0x167")](t);var i=document[P("0x15c")](P("0x15d"));i.style[P("0x8c")]=P("0x9ac"),i[P("0x150")][P("0x19a")]=i[P("0x150")][P("0x8b")]="100%",t[P("0x167")](i),this[P("0x99a")][P("0x131")]||(this[P("0x99a")][P("0x131")]=i),this.map2D=new(GeoGlobe[P("0x101")])(this[P("0x99a")])},n.prototype[P("0x9ad")]=function(){var e=this;this[P("0x9ae")].on(P("0x9af"),(function(){var n=e.map2D;n[P("0x9b0")](e[P("0x99f")],(function(o,a){var s=e[P("0x9a0")],x=n.getCenter().toArray();n[P("0x9b1")](r,a),n[P("0x9b2")](t,{type:"geojson",data:{type:"Point",coordinates:x}}),n[P("0x9b3")]({id:i,source:t,type:P("0x1f4"),layout:{"icon-image":r,"icon-size":s,"icon-rotate":0}}),e[P("0x9a2")]=!0,e[P("0x191")]&&e[P("0x191")](e)}))})),this[P("0x13b")].scene[P("0x53f")][P("0x130")]((function(){e[P("0x9b4")]()}))},n[P("0x5")][P("0x9b5")]=function(){for(var e=this[P("0x13b")][P("0x10f")][P("0x53f")]._listeners,t=0;t=i[P("0x2a9")]*e.Math[P("0xa2a")]&&t.east<=i.east*e[P("0x23")][P("0xa2a")]&&t[P("0x2ab")]>=i[P("0x2ab")]*e[P("0x23")][P("0xa2a")]&&t.north<=i[P("0x2ac")]*e[P("0x23")][P("0xa2a")]},t.prototype[P("0xa2b")]=function(t,i){var r=t[P("0x2a9")]*e[P("0x23")].RADIANS_PER_DEGREE,n=t[P("0x2aa")]*e[P("0x23")][P("0xa2c")],o=t[P("0x2ab")]*e[P("0x23")].RADIANS_PER_DEGREE,a=t[P("0x2ac")]*e[P("0x23")].RADIANS_PER_DEGREE,s=new e.Rectangle(r,o,n,a);return e[P("0x26b")].intersection(s,i,new(e[P("0x26b")]))},t.prototype[P("0xa05")]=function(e,t,i){if(null===this[P("0xa02")])return"";var r=(e+t+i)%this[P("0xa02")][P("0x0")];return this[P("0xa02")][r]},t[P("0x5")][P("0xa2d")]=function(e){e[P("0x969")]&&void 0!==viewer[P("0x10f")].globe[P("0xa2e")][P("0xa2f")]&&this[P("0xa30")](e.rectangle,!0)[P("0xa31")]()},t[P("0x5")][P("0xa30")]=function(t,i){function r(t,i,n){var o=n?4.1:2.1;if(t[P("0x689")].width<=i[P("0x19a")]*o&&e[P("0x26b")].contains(t._rectangle,e.Rectangle.center(i)))return t;for(var a=t[P("0x12f")].length,s=0;s=g-p&&i[P("0xa4c")][s]<=g+p?t[P("0xa4c")][s]:i[P("0xa4c")][s]*c+u:i._buffer[s]?i[P("0xa4c")][s]*c+u:t[P("0xa4c")][s];return this[P("0xa3f")](m,33,33,15)},t[P("0x5")].requestTileHeightBuffer=function(t,i,r,n,o,a){if(!isNaN(t+i+r)){e.defined(n)&&!1!==n||(n=new(e[P("0xa4d")])({defer:!0}));var s=0===n.defer;o=e.defaultValue(s,!1);var x,l=e[P("0x9ee")][P("0x9ef")]();if(void 0!==a)a.getUrlFromSTag=function(e,t,i){return void 0===a.subdomains?a[P("0x6af")]:a[P("0xa4e")][0]+P("0xa4f")},x=this.getRequestElevationLayer(t,i,r).replace(this[P("0x248")][P("0x6af")],a.getUrlFromSTag(t,i,r)+P("0xa50"))[P("0xa1c")](this[P("0x248")][P("0xa07")],a[P("0x176")]),a[P("0xa51")]===P("0xa19")&&(x=x[P("0xa1c")](P("0xa52"),P("0xa53")));else{x=this[P("0xa1f")](t,i,r,s||o);var c=this._tilingScheme.tileXYToRectangle(t,i,r),u=this[P("0xa54")],h=e[P("0x9ee")][P("0x9ef")]();if(void 0!==u){var f=[];if(u[P("0x1e4")]((function(t){t[P("0x221")]&&null!==e[P("0x26b")][P("0x348")](c,t.rectangle,new(e[P("0x26b")]))&&f[P("0x17c")](t)})),0f[0][P("0xa55")])h[P("0x9f8")]("NoMerge");else{var d=function(t,i){var r=e.when[P("0x9ef")](),n=[];return t[P("0x1e4")]((function(t){var r,o,a,s;n[P("0x17c")]((r=t,o=i,s=e[P("0x9ee")][P("0x9ef")](),(a=TerraExplorer.tools[P("0x9f0")][P("0x9f1")][P("0x9f2")].fillArrayFromVerticesAndHeight(r[P("0x9f3")],o,r[P("0x9f4")][0])).timeStamp=r.timeStamp,a[P("0x9f5")]=r[P("0x9f4")],a[P("0x9f6")]=r[P("0x9f6")],a[P("0x9f7")]=r[P("0x9f7")],a.rect=r[P("0x969")],a[P("0x968")]=r[P("0x968")],s[P("0x9f8")](a),s))})),e[P("0x9ee")].all(n,(function(e){if(e[0][P("0x9f9")],1===e[P("0x0")])r[P("0x9f8")](e[0]);else{var t=e[P("0x3d2")]((function(e,t){return t[P("0x9fa")]-e[P("0x9fa")]})),i=t.shift();t.forEach((function(e){i.forEach((function(t,r){1===t&&1!==e[r]&&(i[r]=e[r])}))})),r[P("0x9f8")](i)}})),r}(f,c);e[P("0x9ee")](d,(function(e){h.resolve(e)}))[P("0xa40")]((function(e){console[P("0x133")](e)}))}else h[P("0x9f8")]("NoMerge")}else h[P("0x9f8")](P("0xa56"));var g=e.when[P("0x9ef")](),p=[].filter((function(e){return 0p[0][P("0x968")])g[P("0x9f8")](P("0xa58"));else{var m=!1;p[P("0x1e4")]((function(t){if(t.ready&&t[P("0x221")]&&void 0!==t[P("0xa59")]&&void 0!==e[P("0x26b")][P("0x348")](c,t[P("0xa59")])){for(var i,r=new Uint16Array(1024),n=c.west,o=(c[P("0x2ab")],(c[P("0x2aa")]-c[P("0x2a9")])/32),a=(c[P("0x2ac")]-c[P("0x2ab")])/32,s=0;s<32;s++)for(var x=0;x<32;x++){var l=n+o*x+o/2,u=c[P("0x2ac")]-a*s-a/2,h=new(e[P("0x13")])(l,u);i=65535;var f=t[P("0xa5a")](t,h,!0);null!==f&&f[P("0x490")]&&f[P("0x490")][P("0xa5b")]&&f[P("0x490")][P("0xa5b")].floor&&(i=f[P("0x490")]._model[P("0x3e8")][P("0xed")](h.longitude,h[P("0x114")])),65535!==i&&(i+=1.5),r[32*s+x]=i}m=!0,g[P("0x9f8")](r)}})),m||g[P("0x9f8")]("NoFloor")}this[P("0x68a")][P("0xef")]}if(!1===this[P("0xa14")][P("0xa5c")](x)){if(this._requestsCache[x]={},this[P("0xa15")][P("0x17c")](x),100l&&(l=e[g]),e[g]=this._urls_length&&(this[P("0xa80")]=0)));var x=this[P("0xa7d")][this[P("0xa80")]];if(this[P("0x68a")][P("0x9e2")](a),a=this[P("0xa8b")]){var l,c=-1===x[P("0x2d3")]("?")?"?":"&",u=x+c+"x="+r+P("0xa92")+o+P("0xa93")+(a+1),h=this[P("0xa94")];if(e.defined(h)&&(u=h[P("0xa95")](u)),s=e[P("0x102")](s,!0)){if(l=i(u,s),!e.defined(l))return}else l=i(u);if(this._tileType===t[P("0xa96")])return l.then((function(e){return function(e,t,i,r,n){var o=0,a=3*Float64Array[P("0x4b5")],s=4*Float64Array[P("0x4b5")],x=3*Uint16Array.BYTES_PER_ELEMENT,l=Uint16Array[P("0x4b5")],c=3*l,u=new DataView(t),h=new Cartesian3(u[P("0xaad")](o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0));o+=a;var f=u[P("0xaae")](o,!0);o+=Float32Array.BYTES_PER_ELEMENT;var d=u[P("0xaae")](o,!0);o+=Float32Array.BYTES_PER_ELEMENT;var g=new BoundingSphere(new Cartesian3(u.getFloat64(o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0)),u[P("0xaad")](o+a,!0));o+=s;var p=new Cartesian3(u[P("0xaad")](o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0));o+=a;var m=u.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var b=new Uint16Array(t,o,3*m);o+=m*x,65536=this[P("0xa8c")]?new C.a((function(e,t){t("该级别不发送请求!")})):void 0},t[P("0x5")][P("0xa99")]=function(t){if(!this[P("0xa8e")])throw new(e[P("0x15")])("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<b.EPSILON10)r[P("0x99")](l,u,h);else{var f=n[P("0x6d")](C.getColumn(e[P("0xae5")],1,k),o,k);i[P("0xd6")](f,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,r.subtract(h,x,h),h.x=0,r.magnitudeSquared(h)b[P("0xe9")]){var y=1/r[P("0xe6")](c),_=r[P("0x92")](c,x)*y,A=r[P("0x6c")](x,_,z);c=r[P("0x8d")](r[P("0x95")](c,A,e[P("0xaec")]),e._up),r[P("0x6e")](c,e.up),h=r[P("0x99")](x,c,e[P("0xaee")]),r[P("0x6e")](h,e[P("0x9b")])}}(l||g)&&(e[P("0xaeb")]=C[P("0x739")](p,x,e[P("0xaeb")]),r.normalize(e[P("0xaeb")],e[P("0xaeb")])),(u||g)&&(e[P("0xaed")]=C[P("0x739")](p,c,e._upWC),r.normalize(e[P("0xaed")],e._upWC)),(f||g)&&(e[P("0xb0e")]=C[P("0x739")](p,h,e._rightWC),r[P("0x8d")](e[P("0xb0e")],e[P("0xb0e")])),(s||l||u||f||g)&&L(e)}function q(e,t){var i;return i=b[P("0x62")](Math[P("0x78")](e.z),1,b.EPSILON3)?Math[P("0x9e7")](t.y,t.x)-b[P("0x5b")]:Math.atan2(e.y,e.x)-b[P("0x5b")],b[P("0xab")]-b[P("0xb0f")](i)}function X(e){return b[P("0x5b")]-b[P("0x9d")](e.z)}function Y(e,t,i){var r=0;return b[P("0x62")](Math.abs(e.z),1,b[P("0xdf")])||(r=Math[P("0x9e7")](-i.z,t.z),r=b[P("0xb0f")](r+b[P("0xab")])),r}var K=new C,Q=new C;x(N[P("0x5")],{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return H(this),this[P("0xae6")]}},viewMatrix:{get:function(){return H(this),this[P("0x77a")]}},inverseViewMatrix:{get:function(){return H(this),this._invViewMatrix}},positionCartographic:{get:function(){return H(this),this[P("0x53b")]}},positionWC:{get:function(){return H(this),this[P("0xaea")]}},directionWC:{get:function(){return H(this),this._directionWC}},upWC:{get:function(){return H(this),this[P("0xaed")]}},rightWC:{get:function(){return H(this),this._rightWC}},heading:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")].ellipsoid,t=C.clone(this[P("0xae5")],K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this._setTransform(i);var r=q(this[P("0x93")],this.up);return this[P("0xc2")](t),r}}},pitch:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")].ellipsoid,t=C[P("0x6e")](this._transform,K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this._setTransform(i);var r=X(this[P("0x93")]);return this[P("0xc2")](t),r}}},roll:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")][P("0xef")],t=C[P("0x6e")](this[P("0xae5")],K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this[P("0xc2")](i);var r=Y(this.direction,this.up,this.right);return this[P("0xc2")](t),r}}},moveStart:{get:function(){return this[P("0xb11")]}},moveEnd:{get:function(){return this[P("0xaf6")]}},changed:{get:function(){return this[P("0xaf7")]}}}),N[P("0x5")].update=function(e){if(!s(e))throw new l(P("0xb12"));if(e===M.SCENE2D&&!(this[P("0xe8")]instanceof _))throw new l(P("0xb13"));if(!(e!==M[P("0x90")]&&e!==M[P("0x8a")]||this[P("0xe8")]instanceof A||this[P("0xe8")]instanceof y))throw new l(P("0xb14"));var t=!1;if(e!==this[P("0x6b9")]&&(this[P("0x6b9")]=e,this[P("0xafb")]=e!==M.MORPHING,t=this[P("0x6b9")]===M[P("0x85")]),t){var i=this[P("0xafc")]=this[P("0xe8")][P("0x6e")]();if(!(i instanceof _))throw new l(P("0xb15"));var r=i[P("0x151")]/i[P("0x9b")];i[P("0x9b")]=2*this[P("0x59")].x,i.left=-i.right,i[P("0x151")]=r*i[P("0x9b")],i[P("0x9aa")]=-i[P("0x151")]}this._mode===M[P("0x85")]&&me(this,this[P("0x8c")]);var n=this._scene[P("0xa3")],o=!s(n)||n._surface[P("0xb16")].ready&&0===n[P("0xa2e")][P("0xb17")].length&&0===n[P("0xa2e")][P("0xb18")].length&&0===n[P("0xa2e")][P("0xb19")].length&&0===n._surface[P("0xb1a")][P("0xb1b")];this[P("0xafd")]&&(this[P("0xafd")]=!o),this[P("0xb08")]()};var Z=new r,J=new r,$=new r;N[P("0x5")][P("0xc2")]=function(e){var t=r[P("0x6e")](this[P("0xa5")],Z),i=r[P("0x6e")](this.upWC,J),n=r[P("0x6e")](this[P("0xa6")],$);C[P("0x6e")](e,this._transform),this[P("0xae8")]=!0,H(this);var o=this[P("0xb0d")];C[P("0xd4")](o,t,this[P("0x8c")]),C[P("0x739")](o,n,this[P("0x93")]),C[P("0x739")](o,i,this.up),r.cross(this[P("0x93")],this.up,this.right),H(this)};var ee=new i,te=new w,ie=new r,re=new r;N[P("0x5")][P("0x83")]=function(e){if(this[P("0xe8")]instanceof y&&(e||!(this[P("0x53b")].height<15e4)))if(C[P("0x84")](C[P("0xae")],this[P("0xaf")])){var t,i,n=this[P("0x42")],o=n[P("0x43")];if(s(o)){var a=ee;a.x=n[P("0x782")]/2,a.y=n[P("0x783")]/2;var x=this[P("0x86")](a,te);if(t=o[P("0xa4")](x,n,ie),n.pickPositionSupported&&(i=n[P("0xb1c")](a,re)),s(t)&&s(i)){var l=s(i)?r[P("0x8e")](i,this[P("0xa5")]):Number[P("0x31")],c=s(t)?r[P("0x8e")](t,this.positionWC):Number[P("0x31")];this[P("0xe8")][P("0x19a")]=Math[P("0x7d")](l,c)}else s(i)?this[P("0xe8")][P("0x19a")]=r[P("0x8e")](i,this.positionWC):s(t)&&(this[P("0xe8")].width=r[P("0x8e")](t,this.positionWC))}if(!s(o)||!s(t)&&!s(i)){var u=Math[P("0xee")](this.positionCartographic[P("0x8b")],0);this.frustum[P("0x19a")]=u}}else this[P("0xe8")][P("0x19a")]=r[P("0x96")](this[P("0x8c")])};var ne=new r,oe=new C,ae=new C,se=new I,xe=new v,le=new o,ce=new r,ue=new r,he=new r;function fe(e,t,i,n){var o=r.clone(i[P("0x93")],ce),a=r.clone(i.up,ue);if(e[P("0x42")][P("0xd3")]===M[P("0x90")]){var s=e[P("0xc6")][P("0xef")],x=E[P("0xbf")](t,s,K),l=C[P("0xb0c")](x,Q);C[P("0x739")](l,o,o),C[P("0x739")](l,a,a)}var c=r[P("0x99")](o,a,he);return n.heading=q(o,a),n.pitch=X(o),n[P("0x81")]=Y(o,a,c),n}var de={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},ge=new g;N.prototype[P("0x9c")]=function(e){e=a(e,a[P("0x128")]);var t=a(e[P("0x11e")],a[P("0x128")]),n=this[P("0x6b9")];if(n!==M[P("0xb10")]){s(e[P("0xb1f")])&&this[P("0xc2")](e.endTransform);var o=a(e.convert,!0),x=a(e[P("0x11d")],r.clone(this[P("0xa5")],ne));s(x)&&s(x[P("0x2a9")])&&(x=this[P("0xb20")](x,ne),o=!1),s(t[P("0x93")])&&(t=fe(this,x,t,de[P("0x11e")])),ge[P("0x7f")]=a(t[P("0x7f")],0),ge[P("0x80")]=a(t.pitch,-b[P("0x5b")]),ge.roll=a(t[P("0x81")],0),this[P("0xafd")]=!1,n===M[P("0x90")]?function(e,t,i){var n=C[P("0x6e")](e[P("0xaf")],oe),o=E[P("0xbf")](t,e[P("0xc6")][P("0xef")],ae);e[P("0xc2")](o),r[P("0x6e")](r.ZERO,e[P("0x8c")]),i[P("0x7f")]=i[P("0x7f")]-b[P("0x5b")];var a=I.fromHeadingPitchRoll(i,se),s=v.fromQuaternion(a,xe);v[P("0xb0a")](s,0,e[P("0x93")]),v[P("0xb0a")](s,2,e.up),r.cross(e.direction,e.up,e[P("0x9b")]),e[P("0xc2")](n),e[P("0x83")](!0)}(this,x,ge):n===M[P("0x85")]?function(e,t,n,o){var a=C[P("0x6e")](e[P("0xaf")],oe);if(e[P("0xc2")](C[P("0xae")]),!r[P("0x84")](t,e.positionWC)){if(o){var s=e[P("0xc6")],x=s[P("0xef")][P("0xd6")](t,le);t=s[P("0x5a")](x,ne)}i.clone(t,e.position);var l=.5*-t.z,c=-l,u=e.frustum;if(lo&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}N[P("0x5")][P("0xb21")]=function(e){var t=this[P("0x6b9")];if(t===M.MORPHING&&this[P("0x42")][P("0xb22")](),t===M.SCENE2D)this[P("0xb23")]({destination:N.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:C[P("0xae")]});else if(t===M.SCENE3D){var i=this[P("0xb20")](N[P("0xafe")]),n=r[P("0x96")](i);n+=n*N[P("0xaff")],r.normalize(i,i),r[P("0x6c")](i,n,i),this[P("0xb23")]({destination:i,duration:e,endTransform:C.IDENTITY})}else if(t===M[P("0x8a")]){var o=this[P("0xc6")][P("0xef")][P("0xc4")],a=new r(0,-1,1);a=r.multiplyByScalar(r[P("0x8d")](a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math[P("0xdc")](r[P("0x8d")](a,pe).z),roll:0},endTransform:C[P("0xae")],convert:!1})}},N.prototype[P("0xdb")]=function(e,t){if(!s(e))throw new l("cartesian is required.");return s(t)||(t=new n),H(this),C[P("0xce")](this[P("0xb0d")],e,t)},N[P("0x5")][P("0xc9")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C.multiplyByPoint(this[P("0xb0d")],e,t)},N[P("0x5")][P("0xb25")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0x739")](this._actualInvTransform,e,t)},N.prototype[P("0xb26")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new n),H(this),C[P("0xce")](this._actualTransform,e,t)},N[P("0x5")][P("0xb27")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0xd4")](this[P("0xae7")],e,t)},N.prototype[P("0xb28")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0x739")](this[P("0xae7")],e,t)};var be=new r;N[P("0x5")][P("0xa0")]=function(e,t){if(!s(e))throw new l(P("0xb29"));var i=this.position;r.multiplyByScalar(e,t,be),r[P("0x6d")](i,be,i),this[P("0x6b9")]===M.SCENE2D&&me(this,i),this[P("0x83")](!0)},N[P("0x5")][P("0x584")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x93")],e)},N[P("0x5")][P("0x11c")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x93")],-e)},N[P("0x5")][P("0xb2a")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this.up,e)},N[P("0x5")][P("0xb2b")]=function(e){e=a(e,this[P("0xaf1")]),this.move(this.up,-e)},N[P("0x5")][P("0xb2c")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x9b")],e)},N.prototype.moveLeft=function(e){e=a(e,this.defaultMoveAmount),this[P("0xa0")](this[P("0x9b")],-e)},N[P("0x5")][P("0xb2d")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.up,-e)},N.prototype[P("0x585")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.up,e)},N.prototype[P("0xeb")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this[P("0x9b")],-e)},N[P("0x5")][P("0xb2e")]=function(e){e=a(e,this[P("0xaf2")]),this.look(this[P("0x9b")],e)};var ve=new I,Ce=new v;N.prototype[P("0xe7")]=function(e,t){if(!s(e))throw new l("axis is required.");var i=a(t,this[P("0xaf2")]),r=I[P("0xcc")](e,-i,ve),n=v[P("0xcd")](r,Ce),o=this.direction,x=this.up,c=this[P("0x9b")];v.multiplyByVector(n,o,o),v[P("0xce")](n,x,x),v[P("0xce")](n,c,c)},N[P("0x5")][P("0xb2f")]=function(e){e=a(e,this[P("0xaf2")]),this.look(this.direction,e)},N.prototype[P("0xac")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.direction,-e)};var ye=new I,_e=new v;N[P("0x5")][P("0x9e")]=function(e,t){if(!s(e))throw new l(P("0xb30"));var i=a(t,this[P("0xaf3")]),n=I[P("0xcc")](e,-i,ye),o=v[P("0xcd")](n,_e);v.multiplyByVector(o,this[P("0x8c")],this.position),v.multiplyByVector(o,this[P("0x93")],this[P("0x93")]),v[P("0xce")](o,this.up,this.up),r[P("0x99")](this[P("0x93")],this.up,this[P("0x9b")]),r[P("0x99")](this[P("0x9b")],this.direction,this.up),this[P("0x83")](!1)},N[P("0x5")][P("0xb31")]=function(e){Ee(this,e=a(e,this.defaultRotateAmount))},N[P("0x5")][P("0xda")]=function(e){Ee(this,-(e=a(e,this[P("0xaf3")])))};var Ae=new r,Ie=new r,we=new r,Ge=new r;function Ee(e,t){var i=e.position,n=r.normalize(i,Ae);if(s(e[P("0xc7")])){var o=r[P("0x62")](n,e[P("0xc7")],b[P("0xe9")]),a=r.equalsEpsilon(n,r.negate(e[P("0xc7")],Ge),b[P("0xe9")]);if(o||a)(o&&t<0||a&&0Math.abs(r.left)+Math[P("0x78")](r[P("0x9b")])){var n=r[P("0x151")]-t,o=r[P("0x9aa")]+t,a=e[P("0x59")].y;e._scene[P("0xad")]===T[P("0xb1d")]&&(a*=e[P("0xaf5")]),ab.PI_OVER_TWO-b[P("0xa2c")])f=0;else{var g=ke;g[P("0x112")]=d,g[P("0x114")]=x,g.height=0;var p=Ue;p[P("0x112")]=d,p[P("0x114")]=l,p[P("0x8b")]=0;var m=De;s(m)&&m[P("0xef")]===o||(De=m=new h(void 0,void 0,o)),m[P("0xb39")](g,p),f=m[P("0x283")](.5,ke).latitude}var v=ke;v[P("0x112")]=d,v[P("0x114")]=f,v[P("0x8b")]=0;var C=o[P("0xa7")](v,qe),_=ke;_[P("0x112")]=c,_.latitude=x;var A=o[P("0xa7")](_,Be);_[P("0x112")]=u;var I=o.cartographicToCartesian(_,Ve);_.longitude=d;var w=o[P("0xa7")](_,ze);_.latitude=l;var G=o[P("0xa7")](_,He);_[P("0x112")]=c;var E=o[P("0xa7")](_,je);_[P("0x112")]=u;var S=o[P("0xa7")](_,We);r[P("0x95")](I,C,I),r[P("0x95")](E,C,E),r.subtract(A,C,A),r[P("0x95")](S,C,S),r[P("0x95")](w,C,w),r[P("0x95")](G,C,G);var T=o[P("0xd5")](C,a[P("0x93")]);r.negate(T,T);var M=r.cross(T,r[P("0xc3")],a.right);r[P("0x8d")](M,M);var N,L=r[P("0x99")](M,T,a.up);if(e[P("0xe8")]instanceof y){var R,O,F=Math.max(r[P("0x8e")](A,I),r[P("0x8e")](E,S)),D=Math[P("0xee")](r.distance(A,E),r[P("0x8e")](I,S)),k=e[P("0xe8")][P("0xb3a")].right/e[P("0xe8")]._offCenterFrustum[P("0x151")],U=D*k;Ut[P("0x2aa")]&&(t=G[P("0xb3b")]);var n=e[P("0xae7")],o=e[P("0xb0d")],a=Ze;a[P("0x112")]=t[P("0x2aa")],a[P("0x114")]=t.north;var x=r.project(a,Je);C[P("0xd4")](n,x,x),C[P("0xd4")](o,x,x),a[P("0x112")]=t[P("0x2a9")],a[P("0x114")]=t.south;var l=r[P("0x5a")](a,$e);if(C[P("0xd4")](n,l,l),C.multiplyByPoint(o,l,l),i.x=.5*(x.x-l.x)+l.x,i.y=.5*(x.y-l.y)+l.y,s(e[P("0xe8")][P("0xb07")])){var c=Math[P("0x992")](.5*e[P("0xe8")][P("0xb07")]),u=e.frustum[P("0xaef")]*c;i.z=.5*Math[P("0xee")]((x.x-l.x)/u,(x.y-l.y)/c)}else{var h=x.x-l.x,f=x.y-l.y;i.z=Math[P("0xee")](h,f)}return i}(this,e,t):i===M.SCENE2D?function(e,t,i){var r=e._projection;t.west>t[P("0x2aa")]&&(t=G[P("0xb3b")]);var n=et;n[P("0x112")]=t.east,n[P("0x114")]=t[P("0x2ac")];var o=r.project(n,tt);n[P("0x112")]=t.west,n[P("0x114")]=t.south;var a,s,x=r[P("0x5a")](n,it),l=.5*Math[P("0x78")](o.x-x.x),c=.5*Math.abs(o.y-x.y),u=e[P("0xe8")][P("0x9b")]/e[P("0xe8")].top,h=c*u;return hb[P("0x5b")]))return i.ellipsoid[P("0xa7")](o,r)}(this,e,this[P("0xc6")],i);else{if(this[P("0x6b9")]!==M[P("0x8a")])return;i=function(e,t,i,n){var o=e.getPickRay(t,ot),a=-o[P("0x87")].x/o[P("0x93")].x;w[P("0xe1")](o,a,n);var s=i.unproject(new r(n.y,n.z,0));if(!(s[P("0x114")]<-b[P("0x5b")]||s[P("0x114")]>b[P("0x5b")]||s[P("0x112")]<-Math.PI||s.longitude>Math.PI))return i[P("0xef")][P("0xa7")](s,n)}(this,e,this[P("0xc6")],i)}return i}};var at=new r,st=new r,xt=new r,lt=new r;N[P("0x5")][P("0x86")]=function(e,t){if(!s(e))throw new l(P("0xb3d"));s(t)||(t=new w);var i=this[P("0xe8")];return s(i[P("0xaef")])&&s(i[P("0xaf0")])&&s(i[P("0xb3e")])?function(e,t,i){var n=e[P("0x42")].canvas,o=n[P("0x94")],a=n[P("0x7c")],s=Math[P("0x992")](.5*e[P("0xe8")].fovy),x=e.frustum[P("0xaef")]*s,l=e.frustum.near,c=2/o*t.x-1,u=2/a*(a-t.y)-1,h=e[P("0xa5")];r[P("0x6e")](h,i[P("0x87")]);var f=r[P("0x6c")](e[P("0xa6")],l,at);r[P("0x6d")](h,f,f);var d=r[P("0x6c")](e.rightWC,c*l*x,st),g=r[P("0x6c")](e.upWC,u*l*s,xt),p=r[P("0x6d")](f,d,i[P("0x93")]);return r[P("0x6d")](p,g,p),r[P("0x95")](p,h,p),r[P("0x8d")](p,p),i}(this,e,t):function(e,t,i){var n=e[P("0x42")].canvas,o=n[P("0x94")],a=n[P("0x7c")],x=e.frustum;s(x._offCenterFrustum)&&(x=x._offCenterFrustum);var l=2/o*t.x-1;l*=.5*(x[P("0x9b")]-x[P("0x149")]);var c=2/a*(a-t.y)-1;c*=.5*(x.top-x[P("0x9aa")]);var u=i.origin;return r[P("0x6e")](e.position,u),r[P("0x6c")](e.right,l,lt),r.add(lt,u,u),r.multiplyByScalar(e.up,c,lt),r[P("0x6d")](lt,u,u),r[P("0x6e")](e[P("0xa6")],i[P("0x93")]),e[P("0x6b9")]===M[P("0x8a")]&&r[P("0x88")](i[P("0x87")].z,i[P("0x87")].x,i.origin.y,i[P("0x87")]),i}(this,e,t)};var ct=new r,ut=new r;N[P("0x5")][P("0xb3f")]=function(e){if(!s(e))throw new l(P("0xb40"));var t=r[P("0x95")](this[P("0xa5")],e[P("0x11a")],ct),i=r[P("0x6c")](this[P("0xa6")],r[P("0x92")](t,this[P("0xa6")]),ut);return Math[P("0xee")](0,r[P("0x96")](i)-e[P("0x181")])};var ht=new i;function ft(e,t,i,n,o,a){var s=r.clone(t);return i.y>n?s.y-=i.y-n:i.y<-n&&(s.y+=-n-i.y),i.z>o?s.z-=i.z-o:i.z<-o&&(s.z+=-o-i.z),{easingFunction:c[P("0xb44")],startObject:{time:0},stopObject:{time:1},duration:a,update:function(i){var n=r[P("0x308")](t,s,i.time,new r);e[P("0xc9")](n,e[P("0x8c")])}}}N.prototype[P("0xb41")]=function(e,t,i){if(!s(e))throw new l(P("0xb40"));if(!s(t))throw new l("drawingBufferWidth is required.");if(!s(i))throw new l(P("0xb42"));var r=this[P("0xb3f")](e),n=this.frustum[P("0xb43")](t,i,r,ht);return Math[P("0xee")](n.x,n.y)};var dt=new r,gt=new r,pt=new r,mt=new r;N[P("0x5")][P("0xb45")]=function(e){if(!s(e))throw new l(P("0xb46"));if(this[P("0x6b9")]===M[P("0x8a")])return function(e,t){var i=e[P("0x8c")],n=e[P("0x93")],o=e.worldToCameraCoordinatesVector(r[P("0xb8")],dt),a=-r[P("0x92")](o,i)/r[P("0x92")](o,n),s=r[P("0x6d")](i,r[P("0x6c")](n,a,gt),gt);e[P("0xb27")](s,s),i=e[P("0xb27")](e.position,pt);var x=Math[P("0x992")](.5*e[P("0xe8")][P("0xb07")]),l=e[P("0xe8")][P("0xaef")]*x,c=r.magnitude(r[P("0x95")](i,s,mt)),u=l*c,h=x*c,f=e._maxCoord.x,d=e[P("0x59")].y,g=Math.max(u-f,f),p=Math[P("0xee")](h-d,d);if(i.z<-g||i.z>g||i.y<-p||i.y>p){var m=s.y<-g||s.y>g,b=s.z<-p||s.z>p;if(m||b)return ft(e,i,s,g,p,t)}}(this,e)};var bt=new r,vt={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function Ct(e,t,i){s(i)||(i=d[P("0x6e")](N[P("0xb52")]));var r,n,o,a,x=e[P("0x42")][P("0x24f")][P("0x30")],l=e[P("0x42")][P("0x24f")][P("0x79")],c=i[P("0x55c")];if(!s(c)||0===c){var u=t[P("0x181")];0===u?i[P("0x55c")]=100:e.frustum instanceof y||e[P("0x6b9")]===M[P("0x85")]?i[P("0x55c")]=function(e,t){var i,r,n=e[P("0xe8")];s(n[P("0xb3a")])&&(n=n[P("0xb3a")]);var o=n[P("0x9b")]/n.top,a=t*o;return ab.PI?f+=b.TWO_PI-v:f+=v,d=m}return b.equalsEpsilon(Math[P("0x78")](f),b.TWO_PI,b[P("0xb5b")])&&(i[P("0x2a9")]=-b.PI,i[P("0x2aa")]=b.PI,0<=Ft[0][P("0x114")]?i.north=b[P("0x5b")]:i[P("0x2ab")]=-b.PI_OVER_TWO),i}},N.prototype[P("0xb5c")]=function(){if(!(this._mode===M[P("0x85")]||this.frustum instanceof A)){var e=this[P("0x42")];this[P("0xe8")]=new A,this.frustum[P("0xaef")]=e[P("0x782")]/e[P("0x783")],this.frustum.fov=b[P("0x119")](60)}},N[P("0x5")][P("0xb5d")]=function(){if(!(this._mode===M[P("0x85")]||this.frustum instanceof y)){var e=this._scene;this[P("0xe8")]=new y,this[P("0xe8")][P("0xaef")]=e.drawingBufferWidth/e[P("0x783")],this[P("0xe8")][P("0x19a")]=r.magnitude(this.position);var t=this.frustum[P("0xb5e")];s(t)&&this[P("0x83")](!0)}},N[P("0x6e")]=function(e,t){return s(t)||(t=new N(e[P("0x42")])),r.clone(e[P("0x8c")],t[P("0x8c")]),r[P("0x6e")](e[P("0x93")],t[P("0x93")]),r.clone(e.up,t.up),r[P("0x6e")](e[P("0x9b")],t[P("0x9b")]),C.clone(e[P("0xae5")],t[P("0xaf")]),t[P("0xae8")]=!0,t},e.GeoCamera=N}(Cesium$2),function(e){var t=e[P("0x10")],i=e.defined,r=e[P("0xf")],n=e[P("0x22b")],o=e.DeveloperError,a=e[P("0x19")],s=e[P("0x23")],x=e[P("0x15f")],l=e[P("0x161")],c=e[P("0xb5f")];function u(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e,r,n){var o=u(c[P("0x35")],r),a=e[P("0xb60")],s=e[P("0xb61")],x=e._eventStartPosition,h=e._pressTime,f=e._releaseTime;a[o]=!0,s[o]=!1,x[o]=new t;var d=e[P("0xb62")][o];i(d)||(d=e[P("0xb62")][o]={}),d[P("0x8e")]={startPosition:new t,endPosition:new t},d[P("0xaa")]={startPosition:new t,endPosition:new t},d[P("0xb63")]=0,e._eventHandler[P("0x160")]((function(i){e[P("0xb64")]++,s[o]=!0,h[o]=new Date,t[P("0x308")](i[P("0xb65")],i.position2,.5,x[o])}),l[P("0x162")],r),e[P("0xb66")][P("0x160")]((function(){e._buttonsDown=Math[P("0xee")](e[P("0xb64")]-1,0),s[o]=!1,f[o]=new Date}),l[P("0xb67")],r),e[P("0xb66")][P("0x160")]((function(e){if(s[o]){a[o]?(l=e,c=d,t[P("0x6e")](l[P("0x8e")].startPosition,c.distance[P("0x63")]),t[P("0x6e")](l[P("0x8e")][P("0x64")],c[P("0x8e")][P("0x64")]),t[P("0x6e")](l[P("0xaa")].startPosition,c[P("0xaa")].startPosition),t[P("0x6e")](l.angleAndHeight[P("0x64")],c[P("0xaa")][P("0x64")]),a[o]=!1,d[P("0xb63")]=d[P("0xaa")][P("0x63")].x):(t.clone(e.distance[P("0x64")],d[P("0x8e")].endPosition),t[P("0x6e")](e.angleAndHeight[P("0x64")],d[P("0xaa")][P("0x64")]));for(var i=d.angleAndHeight[P("0x64")].x,r=d[P("0xb63")],x=2*Math.PI;i>=r+Math.PI;)i-=x;for(;i -0.5){\n"+P("0xc89")+P("0xc8a")+P("0x7bf")+P("0xc7c")+P("0xc86")+P("0xc7d")+P("0x7b4")+" }\n}",i[P("0xc8b")]="uniform float mixNum;\n"+P("0xc70")+P("0x7a0")+P("0xc7f")+P("0x7a1")+P("0xc72")+P("0xc73")+P("0xc74")+P("0xc80")+"varying vec2 v_textureCoordinates;\n"+P("0x7a5")+P("0x7a6")+P("0xc75")+P("0x7a7")+P("0xc76")+"}\n"+P("0x7a8")+P("0x7a9")+P("0x7aa")+" float n_range = czm_depthRange.near;\n"+P("0x7ac")+" return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\n"+P("0xc77")+P("0xc81")+" return (visibility === 1.0);\n}\nvoid main()\n{\n"+P("0x7b1")+P("0x7b2")+P("0x7b3")+" out_FragColor = color;\n"+P("0x7b5")+P("0x7b7")+P("0x7b8")+P("0xc78")+P("0xc83")+P("0xc84")+P("0xc79")+" {\n"+P("0x7b4")+P("0x7b5")+P("0x7b7")+P("0xc7a")+P("0xc7b")+P("0xc88")+P("0xc8c")+" positionWC /= positionWC.w;\n"+P("0xc8d")+" if(depth - videoDistance > -0.5){\n"+P("0xc89")+P("0xc8a")+P("0x7bf")+P("0xc85")+" out_FragColor = vec4(mix(color.rgb, videoColor.rgb, mixNum), 1.0);\n"+P("0xc7d")+P("0x7b4")+" }\n}",e[P("0xf")](i[P("0x5")],{CreationEvent:{get:function(){return this[P("0xc6d")]}},AddToSceneEvent:{get:function(){return this[P("0xc6b")]}},RemoveFromSceneEvent:{get:function(){return this[P("0xc6c")]}}}),i.prototype[P("0xc8e")]=function(){var e=this[P("0xc67")];if(e){if(this[P("0xc6a")]=e[P("0xc8f")](),this._videoTexture)e.fillVideo||(this[P("0xc6a")]=null);else if(e[P("0xc90")])return void this._removeFromScene();this[P("0xc91")](),this[P("0xc92")](),this._addToScene()}},i[P("0x5")][P("0xc93")]=function(){this[P("0xc68")]=null,this._removeFromScene()},i[P("0x5")][P("0xc94")]=function(){this._postStage&&(this[P("0x42")][P("0x77c")][P("0xd1")](this[P("0xc69")])||(this._scene.postProcessStages[P("0x6d")](this[P("0xc69")]),this[P("0xc6b")][P("0x896")](this)))},i.prototype[P("0xc95")]=function(){this._postStage&&this._scene[P("0x77c")][P("0xd1")](this._postStage)&&(this[P("0x42")][P("0x77c")][P("0x17f")](this._postStage),this[P("0xc69")]=null,this[P("0xc6c")][P("0x896")](this))},i[P("0x5")][P("0xc91")]=function(){if(!this._uniforms){var e=this,t=e[P("0xc67")];e._videoTexture?this[P("0xc68")]={mixNum:function(){return t[P("0xc96")]},videoMapTexture:function(){return t[P("0xc97")]()},videoTexture:function(){return e[P("0xc6a")]},videoMapMatrix:function(){return t[P("0xc98")]()},videoViewMatrix:function(){return t[P("0xc99")]()},videoDistance:function(){return t.fovDistance},videoMapPosition:function(){return t[P("0x8c")]},u_videoColor:function(){return t[P("0xc9a")]}}:this[P("0xc68")]={mixNum:function(){return t.mixFactor},videoMapTexture:function(){return t[P("0xc97")]()},videoMapMatrix:function(){return t[P("0xc98")]()},videoViewMatrix:function(){return t[P("0xc99")]()},videoDistance:function(){return t[P("0xc9b")]},videoMapPosition:function(){return t[P("0x8c")]},u_videoColor:function(){return t[P("0xc9a")]}}}},i[P("0x5")][P("0xc9c")]=function(){var e=this[P("0xc69")];e&&(e.enabled=this[P("0xc67")][P("0x5ba")])},i[P("0x5")][P("0xc92")]=function(){var t;this[P("0xc69")]||(t=1===this[P("0xc67")][P("0xc9d")]?this[P("0xc6a")]?i._FS_Cone:i[P("0xc7e")]:this[P("0xc6a")]?i[P("0xc87")]:i[P("0xc8b")],this._postStage=new(e[P("0x7c5")])({fragmentShader:t,enabled:!1,uniforms:this[P("0xc68")]}),this[P("0xc6d")][P("0x896")](this))},i[P("0x5")]._destroyPostStage=function(){this._postStage&&this[P("0xc95")](),this[P("0xc68")]=null},e[P("0xf")](r[P("0x5")],{minFovX:{get:function(){return this[P("0xcb7")]},set:function(e){this[P("0xcb7")]=e}},maxFovX:{get:function(){return this[P("0xc9f")]},set:function(e){this[P("0xc9f")]=e}},minFovY:{get:function(){return this[P("0xca0")]},set:function(e){this[P("0xca0")]=e}},maxFovY:{get:function(){return this[P("0xca2")]},set:function(e){this[P("0xca2")]=e}},minFovDistance:{get:function(){return this[P("0xca4")]},set:function(e){this[P("0xca4")]=e}},maxFovDistance:{get:function(){return this[P("0xca6")]},set:function(e){this[P("0xca6")]=e}},minHeading:{get:function(){return this[P("0xca8")]},set:function(e){this[P("0xca8")]=e}},maxHeading:{get:function(){return this[P("0xcaa")]},set:function(e){this._maxHeading=e}},minPitch:{get:function(){return this[P("0xcb8")]},set:function(e){this[P("0xcb8")]=e}},maxPitch:{get:function(){return this._maxPitch},set:function(e){this._maxPitch=e}},minRoll:{get:function(){return this[P("0xcaf")]},set:function(e){this._minRoll=e}},maxRoll:{get:function(){return this[P("0xcb9")]},set:function(e){this._maxRoll=e}},minSegmentCount:{get:function(){return this[P("0xcb2")]},set:function(e){this[P("0xcb2")]=e}},maxSegmentCount:{get:function(){return this[P("0xcb3")]},set:function(e){this[P("0xcb3")]=e}},isInvSphere:{get:function(){return this._isInvSphere},set:function(e){this._isInvSphere=e}},isSphereType:{get:function(){return this._isSphereType},set:function(e){this[P("0xcb6")]=e}}}),r[P("0xcba")]=5,r[P("0xcb4")]=10,r[P("0xc9e")]=1,r._MaxFovX=160,r[P("0xca1")]=1,r._MaxFovY=90,r[P("0xca5")]=1,r._MaxFovDistance=500,r[P("0xca9")]=-180,r[P("0xcab")]=180,r[P("0xcb0")]=-90,r[P("0xcb1")]=90,r[P("0xcac")]=-90,r[P("0xcae")]=90,r[P("0x5")][P("0xcbb")]=function(e){return e?ethis[P("0xcb3")]?this[P("0xcb3")]:e:this._minSegmentCount},r[P("0x5")].clampFovX=function(e){return e?ethis._maxFovX?this._maxFovX:e:this[P("0xc9f")]},r[P("0x5")][P("0xcbc")]=function(e){return e?ethis._maxFovY?this[P("0xca2")]:e:this._maxFovY},r[P("0x5")][P("0xcbd")]=function(e){return e?ethis._maxFovDistance?this[P("0xca6")]:e:this[P("0xca4")]},r.prototype[P("0xcbe")]=function(e){return e?ethis._maxHeading?this[P("0xcaa")]:e:0},r.prototype[P("0xcbf")]=function(e){return e?ethis._maxPitch?this[P("0xcad")]:e:0},r[P("0x5")].clampRoll=function(e){return e?ethis[P("0xcb9")]?this[P("0xcb9")]:e:0},n[P("0x5")][P("0xf4")]=function(){this[P("0x42")]=null,this[P("0xc67")]=null,this[P("0x224")]=null,this[P("0x9fc")]=null,this._boundingVolume=null,this[P("0xcc0")]=null,this[P("0xcc6")]=null,this[P("0x5ba")]=!1,this[P("0xcc9")]=!1,this[P("0x6ce")]&&(this[P("0x6ce")][P("0xcca")]&&(this[P("0x6ce")][P("0xcca")][P("0xf4")](),this[P("0x6ce")][P("0xcca")]=null),this._drawCommand[P("0x4d8")]&&(this._drawCommand._vertexArray[P("0xf4")](),this[P("0x6ce")][P("0x4d8")]=null),this[P("0x6ce")]=null)},e.defineProperties(n[P("0x5")],{id:{get:function(){return this._id},set:function(e){this._id=e}},actived:{get:function(){return this[P("0x5ba")]},set:function(e){this[P("0x5ba")]=e}},visibly:{get:function(){return this._visibly},set:function(e){this[P("0xcc9")]=e}},DeveloperErrorEvent:{get:function(){return this[P("0x9fc")]}},minFovX:{get:function(){return this._videoProjection.config[P("0xccb")]}},maxFovX:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xccd")]}},minFovY:{get:function(){return this[P("0xc67")][P("0xccc")].minFovY}},maxFovY:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcce")]}},minFovDistance:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xccf")]}},maxFovDistance:{get:function(){return this._videoProjection.config.maxFovDistance}},minHeading:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd0")]}},maxHeading:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd1")]}},minPitch:{get:function(){return this[P("0xc67")].config[P("0xcd2")]}},maxPitch:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd3")]}},minRoll:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd4")]}},maxRoll:{get:function(){return this._videoProjection.config[P("0xcd5")]}},minSegmentCount:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd6")]}},maxSegmentCount:{get:function(){return this._videoProjection.config[P("0xcd7")]}},isSphereType:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd8")]}},isInvSphere:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd9")]}},position:{get:function(){return this[P("0x6b6")]}},fovX:{get:function(){return this._fovX},set:function(e){ethis[P("0xccd")]?this[P("0x9fc")][P("0x896")](P("0xcda")):this._fovX!==e&&(this._fovX=e,this[P("0xcc8")]=!0)}},fovY:{get:function(){return this[P("0xcc1")]},set:function(e){ethis[P("0xcce")]?this[P("0x9fc")].raiseEvent(P("0xcdc")):this._fovY!==e&&(this[P("0xcc1")]=e,this._isNeedRecreate=!0)}},fovDistance:{get:function(){return this[P("0xcc2")]},set:function(e){ethis[P("0xcdd")]?this[P("0x9fc")][P("0x896")](P("0xcde")):this[P("0xcc2")]!==e&&(this[P("0xcc2")]=e,this[P("0xcc8")]=!0)}},heading:{get:function(){return this[P("0x541")]},set:function(e){ethis[P("0xcd1")]?this[P("0x9fc")][P("0x896")](P("0xcdf")):this[P("0x541")]!==e&&(this._heading=e,this[P("0xcc8")]=!0)}},roll:{get:function(){return this[P("0x538")]},set:function(e){ethis[P("0xcd5")]?this._errorEvent[P("0x896")](P("0xce0")):this._roll!==e&&(this[P("0x538")]=e,this._isNeedRecreate=!0)}},pitch:{get:function(){return this._pitch},set:function(e){ethis.maxPitch?this[P("0x9fc")][P("0x896")]("pitch!"):this._pitch!==e&&(this[P("0x537")]=e,this[P("0xcc8")]=!0)}},color:{get:function(){return this[P("0x596")]},set:function(e){this[P("0x596")]=e[P("0x6e")]()}},lineWidth:{get:function(){return this[P("0x31a")]},set:function(e){e<1?this._errorEvent.raiseEvent("lineWidth!"):this[P("0x31a")]=e}},mixFactor:{get:function(){return this[P("0xcc3")]},set:function(e){e<0||1=this[P("0xdaa")][P("0xd9f")].length?(this[P("0xdad")](this[P("0xdb1")]),void this._toStop()):(this.state=this._createState(),void 0===this[P("0xdb3")]?this.state:(this[P("0xdb3")][P("0xdbc")]=new Date,this[P("0xdb3")])));if(r(t[P("0x93")],t[P("0xdbd")])){var n=e[P("0x11")][P("0x8e")](t[P("0x64")],t[P("0x8c")]),o=this._walkAnimation[P("0xda0")]+t[P("0xdbe")];return x=new Date,l=i.ComputeTimeDelta(t[P("0xdbc")],x),t.date=x,n<=(o*=l/1e3)?(t[P("0x8c")]=e[P("0x11")][P("0x6e")](t.endPosition,new e.Cartesian3),t):(a=e[P("0x11")][P("0x95")](t[P("0x64")],t[P("0x8c")],new(e[P("0x11")])),e[P("0x11")][P("0x8d")](a,a),e[P("0x11")][P("0x6c")](a,o,a),t[P("0x8c")]=e[P("0x11")][P("0x6d")](t.position,a,new(e[P("0x11")])),t)}var a=e[P("0x11")][P("0x99")](t.direction,t[P("0xdbd")],new e.Cartesian3);e[P("0x11")][P("0x8d")](a,a);var s=e[P("0x23")][P("0x119")](this[P("0xdaa")][P("0xda1")]+t.rotateSpeed),x=new Date,l=i.ComputeTimeDelta(t[P("0xdbc")],x);if(t[P("0xdbc")]=x,(s*=l/1e3)=r[P("0x0")])return this.raiseChangeEvent(i),void this[P("0xdb2")]();var n={},o=r[t],a=r[i];return n[P("0x8c")]=e.Cartesian3[P("0x1a1")](o[P("0xda8")].longitude,o.geoposition[P("0x114")],o[P("0xda8")][P("0x8b")],this[P("0xdaa")][P("0xef")],new(e[P("0x11")])),n[P("0x93")]=e[P("0x11")].clone(o[P("0x93")],new(e[P("0x11")])),n[P("0xdbe")]=o[P("0xdbe")],n[P("0xdbf")]=o.rotateSpeed,n.endPosition=e[P("0x11")][P("0x1a1")](a.geoposition[P("0x112")],a[P("0xda8")].latitude,a.geoposition.height,this[P("0xdaa")][P("0xef")],new(e[P("0x11")])),n[P("0xdbd")]=e[P("0x11")][P("0x6e")](a[P("0x93")],new e.Cartesian3),n};var o=new e.Matrix4,a=(new(e[P("0x11")]),new(e[P("0x11")])),s=new e.Cartesian3}(Cesium$2),function(e){var t=e.GeoWalkerCamera=function(i){this.viewer=i[P("0x13b")],this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x7e")]=this[P("0x13b")].camera,this[P("0x94e")]=e[P("0x102")](i[P("0x94e")],1),this[P("0xdc0")]=e[P("0x102")](i[P("0xdc0")],5),this[P("0xdc1")]=e[P("0x102")](i.manHeight,1.6),this[P("0xdc2")]=e.defaultValue(i[P("0xdc2")],.8),this[P("0xdb3")]=t[P("0xdc3")][P("0xdc4")],this._lockCamera=!1,this[P("0xdc5")]=!1,this[P("0x44")]=this.scene[P("0xa3")][P("0xef")],this[P("0xdc6")]=new l,this[P("0xdc7")]=!1,this[P("0xd81")]=e.defaultValue(i.filterFar,null),this[P("0xdc8")]=e[P("0x102")](i[P("0xdc9")],!0),i[P("0xdca")]&&this[P("0x13b")]&&viewer[P("0x10f")][P("0x77c")].add(new(e[P("0xd7f")])({scene:viewer[P("0x10f")]}))};t[P("0x5")].setState=function(t){0=e[P("0xe77")]&&t.minX<=e.maxX&&t[P("0x4d2")]>=e[P("0x4d2")]&&t[P("0x4d2")]<=e.maxY||t[P("0xe78")]>=e[P("0xe77")]&&t.maxX<=e[P("0xe78")]&&t[P("0xe79")]>=e[P("0x4d2")]&&t[P("0xe79")]<=e.maxY||t[P("0xe77")]>=e[P("0xe77")]&&t[P("0xe77")]<=e[P("0xe78")]&&t[P("0xe79")]>=e[P("0x4d2")]&&t.maxY<=e[P("0xe79")]||t[P("0xe78")]>=e[P("0xe77")]&&t.maxX<=e.maxX&&t[P("0x4d2")]>=e[P("0x4d2")]&&t[P("0x4d2")]<=e.maxY}function n(e,t){var i=e.x,r=e.y,n=e.width,o=e.height,a=t.x,s=t.y,x=t[P("0x19a")],l=t[P("0x8b")];return!(a<=i&&a+x<=i||i<=a&&i+n<=a||s<=r&&s+l<=r||r<=s&&r+o<=s)}e[P("0x14")],e.defineProperties(i[P("0x5")],{}),i.prototype[P("0xe28")]=function(e,t,i,r){for(var n=0;ne[P("0x968")]+1||t[P("0xe19")][P("0x109")]e[P("0x968")]+1||t[P("0xe1a")][P("0x109")]=this[P("0xe39")]&&!this.viewer[P("0x194")].contains(this.labelCache[e])&&(this._isInitial&&this[P("0xe1e")]&&(this[P("0xe22")][e][P("0x221")]=!1),this[P("0x13b")][P("0x194")][P("0x6d")](this.labelCache[e]));if(!this[P("0xe23")]){for(e=0;et[P("0x9b")]+10||e.y<-10||e.y>t[P("0x9aa")]+10)};var o=function(e){for(var t=0,i=0;i=r[5]?(r.push(r[0]),r[P("0x17c")](r[1]),r[P("0x17c")](r[5])):(r[P("0x17c")](r[3]),r[P("0x17c")](r[4]),r[P("0x17c")](r[2]));var l={horizontalDistance:null,verticalHeight:null,spaceDistance:null},c=1e3*turf[P("0x8e")](turf.point([r[0],r[1]]),turf[P("0x2ec")]([r[3],r[4]]));(h=[])[P("0x17c")]((r[0]+r[3])/2),h[P("0x17c")]((r[1]+r[4])/2),r[2]>=r[5]?h.push(r[5]):h[P("0x17c")](r[2]),c<1e3?l.horizontalDistance=P("0x311")+c[P("0x2af")](2)+"m":l[P("0xebb")]=P("0x311")+(c/1e3)[P("0x2af")](2)+"km";var u=Math[P("0x78")](r[2]-r[5]),h=[];r[2]>=r[5]?(h[P("0x17c")](r[0]),h.push(r[1])):(h[P("0x17c")](r[3]),h[P("0x17c")](r[4])),h.push((r[2]+r[5])/2),l[P("0xebc")]=u<1e3?P("0x312")+u[P("0x2af")](2)+"m":"垂直高度:"+(u/1e3)[P("0x2af")](2)+"km";var f=Math[P("0xca")](Math[P("0x2ae")](c,2)+Math[P("0x2ae")](u,2));return(h=[])[P("0x17c")]((r[0]+r[3])/2),h[P("0x17c")]((r[1]+r[4])/2),h.push((r[2]+r[5])/2),f<1e3?l.spaceDistance=P("0x313")+f.toFixed(2)+"m":l[P("0xebd")]=P("0x313")+(f/1e3)[P("0x2af")](2)+"km",l}}},t[P("0x5")].elevation=function(t){if(t[P("0x2ec")]){var i=[t.position._value];if(1===i[P("0x0")]){var r=e[P("0x13")][P("0x175")](i[0])[P("0x8b")];P("0x30a"),r.toFixed(2),createResultLabel2(this.options,this.primitives,i)}}}}(Cesium$2),U=(void 0===A.a?"undefined":w()(A.a))===P("0x8")&&"symbol"===w()(Symbol[P("0x1f3")])?function(e){return w()(e)}:function(e){return e&&(void 0===A.a?"undefined":w()(A.a))===P("0x8")&&e[P("0x2b7")]===A.a&&e!==Symbol[P("0x5")]?P("0x1f4"):w()(e)},function(e){var t=e[P("0xebe")]=function(t){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x13c")]=t[P("0x13b")],this[P("0x68a")]=e[P("0x14")](t[P("0xa22")])?t[P("0xa22")]:new e.WebMercatorTilingScheme({ellipsoid:t[P("0xef")]}),this[P("0xebf")]=e[P("0x102")](t[P("0xec0")],512),this[P("0xec1")]=e[P("0x102")](t.tileHeight,512),this._readyPromise=e[P("0x9ee")].resolve(!0),this[P("0xec2")]=new GeoOLMS.MVT,this[P("0xa94")]=t[P("0xe18")],this[P("0x6a8")]=t[P("0xa39")],this._styleName=t[P("0xec3")],this[P("0xec4")]=t.tileMatrixSetID,this[P("0xec5")]=t.tileMatrixLabels,this[P("0xa0f")]=P("0xec6"),this._maximumLevel=t[P("0xec7")],this._rectangle=e[P("0x102")](t[P("0x969")],this._tilingScheme[P("0x969")]),this[P("0xec8")]=e[P("0x102")](t[P("0xec9")],22),this[P("0xeca")]=e[P("0x102")](t.symbolVisibility,P("0x2b4")),this[P("0xecb")]=e[P("0x102")](t[P("0xecb")],!0),this[P("0xecc")]=new(e[P("0x766")]),this[P("0xecd")]=e[P("0x102")](t[P("0x4")],""),this._url=e[P("0x102")](t[P("0x6af")],P("0xece"));var i=null;this[P("0x68a")]instanceof e.WebMercatorTilingScheme?i=[-20037508.342789244,-20037508.342789244,20037508.342789244,20037508.342789244]:this[P("0x68a")]instanceof e[P("0x9d7")]&&(i=[-180,-270,180,90]),this._resolutions=GeoOLMS[P("0xecf")](i,22,this._tileWidth)[P("0xed0")](),this[P("0xed1")]=1,this[P("0xae5")]=[.125,0,0,.125,0,0],this._replays=[P("0xed2"),P("0x5a5"),"Polygon",P("0x9e3"),P("0xed3")],this._tileQueueForCanvas=new e.TileReplacementQueue,this[P("0xed4")]=new(e[P("0xed5")]),this[P("0xed6")]=1e3,this._styles=void 0,this[P("0xb7f")]=this[P("0xed7")](),this[P("0xed8")]=void 0,this[P("0xed9")]={},this[P("0xeda")]={},this[P("0xedb")]=document.createElement(P("0x48")),this[P("0xedb")].width=512,this[P("0xedb")][P("0x8b")]=512,P("0xedc")in window?this[P("0xedd")]=!e.defined(t[P("0xede")])||t.useWebWorker:(e[P("0x14")](t[P("0xede")])&&!0===t.useWebWorker&&console.warn(P("0xedf")),this[P("0xedd")]=!1),1===this._useWebWorker&&(this[P("0xeca")]=P("0x2b4")),this[P("0xee0")]=function(){return[]};var n=this,o=this[P("0xee1")]();if(r(o=this[P("0xa94")]?this[P("0xa94")].getURL(o):o,!1,(function(i){if(i){if(!i[P("0xee2")]){for(var r="mysourceid",o=0;oi&&e[P("0x14")](s);){var x=s[P("0xf00")];r=t,a=o=void 0,o=(n=s).replacementPrevious,a=n[P("0xefe")],n===r[P("0xeff")]&&(r._lastBeforeStartOfFrame=a),n===r.head?r[P("0xefb")]=a:o.replacementNext=a,n===r.tail?r.tail=o:a[P("0xf00")]=o,n[P("0xf00")]=void 0,n[P("0xefe")]=void 0,--r.count,s=null,s=x}}e[P("0xf")](t[P("0x5")],{url:{get:function(){return this._url}},proxy:{get:function(){return this[P("0xa94")]}},tileWidth:{get:function(){return this[P("0xebf")]}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},sourceMaxzoom:{get:function(){return this[P("0xec8")]}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this[P("0x689")]}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this[P("0xa82")]}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},styles:{get:function(){return this._styles}},pickedEvent:{get:function(){return this[P("0xecc")]}},useWebWorker:{get:function(){return this[P("0xedd")]}},symbolVisibility:{get:function(){return this._symbolVisibility}}}),t[P("0x5")][P("0xefa")]=function(e,t,i){},t[P("0x5")][P("0xeee")]=function(){var e=P("0xf02")+this[P("0xec8")]+P("0xf03")+this[P("0x9c9")]+P("0xf04")+this[P("0xf05")]+P("0xf06")+this[P("0xebf")]+P("0xf07")+this._tileHeight+P("0xf08"),t=new Blob([e],{type:P("0xf09")}),i=URL[P("0xf0a")](t);this[P("0xf0b")]=[];for(var r=this.currentActor=0;r<4;r++){var n=new Worker(i),o=new a(n,this,1);o[P("0x176")]=P("0xf0c")+r,this[P("0xf0b")].push(o)}var s={style:JSON[P("0xf0d")](this[P("0xee5")]),spriteUrl:this._spriteUrl};for(r=0;rthis[P("0xed6")]&&o(this[P("0xed4")],this[P("0xed6")]/4),(g=e[P("0x33a")]).xMvt=a,g[P("0xefc")]=x,g[P("0xefd")]=c,this[P("0xed4")].markTileRendered(g));else{var u=new String("bad request");this[P("0xed9")][e.key].resolve(this.blankCanvas)}for(var h in this[P("0xeef")][P("0x1a9")]>this[P("0xed6")]&&o(this[P("0xeef")],this[P("0xed6")]/4),u.xMvt=a,u[P("0xefc")]=x,u.zMvt=c,this[P("0xeef")].markTileRendered(u),this[P("0xed9")][e[P("0x4")]].state=t[P("0xf19")][P("0xf23")],delete this.deferCache[e[P("0x4")]],this[P("0xeda")]){var f=this[P("0xed9")][h];if(f&&(f[P("0xdb3")]===t[P("0xf19")][P("0xf1d")]||f.state===t[P("0xf19")].RELOADED)){var d,g;e=(g=n(a=(d=JSON[P("0x946")](h))[0],x=d[1],c=d[2],this[P("0xed4")]))?{key:h,data:g}:{key:h,data:l[P("0xfa")](this,a,x,c)[P("0x33a")]},r[P("0xe45")](P("0xf17"),e,s[P("0xf10")](this)),delete this.messageCache[h],f.state=t[P("0xf19")][P("0xef5")];break}}}else if(e.type===P("0xf24")||e[P("0x165")]===P("0x9c2")||"setStyle"===e.type){var p=this;this[P("0x6c9")]++,4===this[P("0x6c9")]&&(this[P("0x6c9")]=0,i[P("0xfa")](this),setTimeout((function(){p[P("0xaf6")]()}),200))}}function l(t,i,r){for(var o=null,a=null,s=t,x=i,l=r;l>this._sourceMaxzoom&&(o=n(s=s/2|0,x=x/2|0,--l,this._tileQueueForFeatures),!e.defined(o)););if(e[P("0x14")](o))a={features:o,x:s,y:x,z:l};else{var c=this[P("0xb7f")][P("0xa1c")](P("0xe3f"),s).replace(P("0xf1b"),x)[P("0xa1c")](P("0xe3e"),l).replace(P("0xf1c"),this[P("0xecd")]);a={features:c=this[P("0xa94")]?this[P("0xa94")][P("0xa95")](c):c,x:s,y:x,z:l}}return a}function u(e,t,i){var r=JSON[P("0x946")](t),n=r[0],o=r[1],a=r[2];if(i>x<>x<f[P("0xed6")]&&o(f[P("0xed4")],f._cacheSize/4),e[P("0xf29")]=i,e[P("0xefc")]=r,e[P("0xefd")]=m,f._tileQueueForFeatures[P("0xf2a")](e);var t=u(f[P("0xec2")][P("0xf26")](e),b,f[P("0xec8")]),n=f[P("0xf27")](t,i,r,m);d.resolve(n)})):I instanceof ArrayBuffer&&(this[P("0xed4")][P("0x1a9")]>this[P("0xed6")]&&o(this[P("0xed4")],this[P("0xed6")]/4),I[P("0xf29")]=i,I[P("0xefc")]=r,I[P("0xefd")]=m,this[P("0xed4")][P("0xf2a")](I),_=u(this._mvtParser[P("0xf26")](I),b,this[P("0xec8")]),A=this.renderCanvas(_,i,r,m),d.resolve(A))}}return d[P("0xa90")]},t[P("0x5")].renderCanvas=function(t,i,r,n){var a=GeoOLMS[P("0xf2b")](9,void 0),s=document.createElement(P("0x48"));s[P("0x19a")]=512,s.height=512;for(var x=s.getContext("2d"),l=this.styleFunc,c=e[P("0x14")](t[P("0xf2c")])?t.rect:[0,0,4096,4096],u=new GeoOLMS.ReplayGroup(0,c,8,window[P("0xf2d")],!0,a,100),h=0;hthis._cacheSize&&o(this._tileQueueForCanvas,this[P("0xed6")]/4),s[P("0xf29")]=i,s.yMvt=r,s[P("0xefd")]=n,this[P("0xeef")].markTileRendered(s),s},t.prototype[P("0xf24")]=function(e,t,r){for(var n=this._styles,o=0;othis._sourceMaxzoom?this[P("0xec8")]:x,v=(u-c[0])/(c[2]-c[0])*Math[P("0x2ae")](2,b),C=(c[3]-d)/(c[3]-c[1])*Math[P("0x2ae")](2,b),y=4096*(v-Math[P("0x3e8")](v)),_=4096*(C-Math[P("0x3e8")](C)),A=[],I=[],w=0;w>>8&255]<<16|u[e>>>16&255]<<8|u[e>>>24&255])>>32-t:u[e]>>8-t),t+a<8)s=s<>t-r-1&1,8==++a&&(a=0,n[o++]=u[s],s=0,o===n[P("0x0")]&&(n=this.f()));n[o]=s,this[P("0x4b3")]=n,this.i=a,this[P("0x286")]=o},o[P("0x5")].finish=function(){var e=this[P("0x4b3")],t=this[P("0x286")];return 0>>1;c;c>>>=1)x<<=1,x|=1&c,--l;s[a]=(x<>>0}var u=s;function h(e){this[P("0x4b3")]=new(n?Uint16Array:Array)(2*e),this.length=0}function f(e){var t,i,r,o,a,s,x,l,c,u,h=e[P("0x0")],f=0,d=Number[P("0x31")];for(l=0;lf&&(f=e[l]),e[l]>=1;for(u=r<<16|l,c=s;co[r]);)n=o[i],o[i]=o[r],o[r]=n,n=o[i+1],o[i+1]=o[r+1],o[r+1]=n,i=r;return this[P("0x0")]},h.prototype[P("0x25c")]=function(){var e,t,i,r,n,o=this.buffer;for(t=o[0],e=o[1],this[P("0x0")]-=2,o[0]=o[this.length],o[1]=o[this[P("0x0")]+1],n=0;!((r=2*n+2)>=this[P("0x0")])&&(r+2o[r]&&(r+=2),o[r]>o[n]);)i=o[n],o[n]=o[r],o[r]=i,i=o[n+1],o[n+1]=o[r+1],o[r+1]=i,n=r;return{index:e,value:t,length:this.length}};var g,p=2,m={NONE:0,r:1,k:p,O:3},b=[];for(g=0;g<288;g++)switch(!0){case g<=143:b[P("0x17c")]([g+48,8]);break;case g<=255:b.push([g-144+400,9]);break;case g<=279:b[P("0x17c")]([g-256+0,7]);break;case g<=287:b.push([g-280+192,8]);break;default:e("invalid literal: "+g)}function v(e,t){this[P("0x0")]=e,this.H=t}d.prototype.j=function(){var i,r,a,s,x=this[P("0xf53")];switch(this.h){case 0:for(a=0,s=x[P("0x0")];a>>8&255,m[v++]=255&u,m[v++]=u>>>8&255,n)m.set(h,v),v+=h[P("0x0")],m=m.subarray(0,v);else{for(d=0,g=h.length;d>16&255,x[l++]=r>>24,!0){case 1===s:n=[0,s-1,0];break;case 2===s:n=[1,s-2,0];break;case 3===s:n=[2,s-3,0];break;case 4===s:n=[3,s-4,0];break;case s<=6:n=[4,s-5,1];break;case s<=8:n=[5,s-7,1];break;case s<=12:n=[6,s-9,2];break;case s<=16:n=[7,s-13,2];break;case s<=24:n=[8,s-17,3];break;case s<=32:n=[9,s-25,3];break;case s<=48:n=[10,s-33,4];break;case s<=64:n=[11,s-49,4];break;case s<=96:n=[12,s-65,5];break;case s<=128:n=[13,s-97,5];break;case s<=192:n=[14,s-129,6];break;case s<=256:n=[15,s-193,6];break;case s<=384:n=[16,s-257,7];break;case s<=512:n=[17,s-385,7];break;case s<=768:n=[18,s-513,8];break;case s<=1024:n=[19,s-769,8];break;case s<=1536:n=[20,s-1025,9];break;case s<=2048:n=[21,s-1537,9];break;case s<=3072:n=[22,s-2049,10];break;case s<=4096:n=[23,s-3073,10];break;case s<=6144:n=[24,s-4097,11];break;case s<=8192:n=[25,s-6145,11];break;case s<=12288:n=[26,s-8193,12];break;case s<=16384:n=[27,s-12289,12];break;case s<=24576:n=[28,s-16385,13];break;case s<=32768:n=[29,s-24577,13];break;default:e(P("0xf59"))}for(r=n,x[l++]=r[0],x[l++]=r[1],x[l++]=r[2],o=0,a=x[P("0x0")];o2*c[a-1]+u[a]&&(c[a]=2*c[a-1]+u[a]),f[a]=Array(c[a]),d[a]=Array(c[a]);for(o=0;oe[o]?(f[a][s]=x,d[a][s]=t,l+=2):(f[a][s]=e[o],d[a][s]=o,++o);g[a]=0,1===u[a]&&r(a)}return h}(r,r[P("0x0")],t),a=0,s=i[P("0x0")];a>>=1;return a}function E(t,i){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this[P("0xf53")]=n?new Uint8Array(t):t,this.s=!1,this.n=T,this.C=!1,(i||(i={},0))&&(i[P("0x286")]&&(this.c=i[P("0x286")]),i[P("0xf5a")]&&(this.m=i.bufferSize),i.bufferType&&(this.n=i[P("0xf5b")]),i[P("0xf5c")]&&(this.C=i[P("0xf5c")])),this.n){case S:this.b=32768,this.a=new(n?Uint8Array:Array)(32768+this.m+258);break;case T:this.b=0,this.a=new(n?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error(P("0xf5d")))}}var S=0,T=1,M=S,N=T;E[P("0x5")].p=function(){for(;!this.s;){var i=Z(this,3);switch(1&i&&(this.s=!0),i>>>=1){case 0:var r=this[P("0xf53")],o=this.c,a=this.a,s=this.b,x=r.length,l=t,c=a[P("0x0")],u=t;switch(this.e=this.g=0,x<=o+1&&e(Error("invalid uncompressed block header: LEN")),l=r[o++]|r[o++]<<8,x<=o+1&&e(Error("invalid uncompressed block header: NLEN")),l===~(r[o++]|r[o++]<<8)&&e(Error(P("0xf5e"))),o+l>r[P("0x0")]&&e(Error(P("0xf5f"))),this.n){case S:for(;s+l>a[P("0x0")];){if(l-=u=c-s,n)a.set(r[P("0xaaf")](o,o+u),s),s+=u,o+=u;else for(;u--;)a[s++]=r[o++];this.b=s,a=this.f(),s=this.b}break;case T:for(;s+l>a[P("0x0")];)a=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(n)a[P("0xf60")](r.subarray(o,o+l),s),s+=l,o+=l;else for(;l--;)a[s++]=r[o++];this.c=o,this.b=s,this.a=a;break;case 1:this.o(Y,Q);break;case 2:$(this);break;default:e(Error(P("0xf61")+i))}}return this.t()};var L,R,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=n?new Uint16Array(O):O,D=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],k=n?new Uint16Array(D):D,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],B=n?new Uint8Array(U):U,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],V=n?new Uint16Array(W):W,j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],z=n?new Uint8Array(j):j,H=new(n?Uint8Array:Array)(288);for(L=0,R=H[P("0x0")];L>>i,t.e=o-i,t.c=s,r}function J(e,t){for(var i,r,n=e.g,o=e.e,a=e[P("0xf53")],s=e.c,x=a[P("0x0")],l=t[0],c=t[1];o>>16,e.g=n>>r,e.e=o-r,e.c=s,65535&i}function $(e){function t(e,t,i){var r,n,o,a=this.z;for(o=0;o>>0;e=r}for(var n,o=1,a=0,s=e.length,x=0;0>>0}function te(t,i){var r,n;if(this.input=t,this.c=0,(i||(i={},0))&&(i[P("0x286")]&&(this.c=i.index),i.verify&&(this.N=i[P("0xf62")])),r=t[this.c++],n=t[this.c++],(15&r)===ie)this.method=ie;else e(Error(P("0xf63")));0!=((r<<8)+n)%31&&e(Error(P("0xf64")+((r<<8)+n)%31)),32&n&&e(Error(P("0xf65"))),this.B=new E(t,{index:this.c,bufferSize:i[P("0xf5a")],bufferType:i[P("0xf5b")],resize:i[P("0xf5c")]})}E[P("0x5")].o=function(e,t){var i=this.a,r=this.b;this.u=e;for(var n,o,a,s,x=i[P("0x0")]-258;256!==(n=J(this,e));)if(n<256)x<=r&&(this.b=r,i=this.f(),r=this.b),i[r++]=n;else for(s=k[o=n-257],0t&&(this.a[P("0x0")]=t),e=this.a),this[P("0x4b3")]=e},te[P("0x5")].p=function(){var t,i=this[P("0xf53")];return t=this.B.p(),this.c=this.B.c,this.N&&(i[this.c++]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==ee(t)&&e(Error(P("0xf66"))),t};var ie=8;function re(e,t){this[P("0xf53")]=e,this.a=new(n?Uint8Array:Array)(32768),this.h=ne.k;var i,r={};for(i in(t||(t={},0))&&P("0x49f")===w()(t.compressionType)&&(this.h=t[P("0xf55")]),t)r[i]=t[i];r[P("0xf56")]=this.a,this.A=new d(this.input,r)}var ne=m;function oe(e,t){var i,n,o,a;if(Object[P("0xdcb")])i=Object[P("0xdcb")](t);else for(n in i=[],o=0,t)i[o++]=n;for(o=0,a=i[P("0x0")];o>24&255,x[l++]=s>>16&255,x[l++]=s>>8&255,x[l++]=255&s,x},r(P("0xf69"),te),r(P("0xf6a"),te.prototype.p),oe(P("0xf6b"),{ADAPTIVE:N,BLOCK:M}),r(P("0xf6c"),re),r(P("0xf6d"),(function(e,t){return new re(e,t).j()})),r(P("0xf6e"),re[P("0x5")].j),oe("Zlib.Deflate.CompressionType",{NONE:ne[P("0xe5d")],FIXED:ne.r,DYNAMIC:ne.k})}[P("0xfa")](window),r(237)}]);const Cesium$1=mars3d__namespace.Cesium,BaseLayer=mars3d__namespace.layer.BaseLayer;class TdtDmLayer extends BaseLayer{get layer(){return this.wtfs}_addedHook(){const e=this.options.url||"https://t{s}.tianditu.gov.cn/mapservice/GetTiles",t=this.options.key||mars3d__namespace.Token.tianditu;let i;if(i=Array.isArray(this.options.subdomains)?this.options.subdomains.slice():Cesium$1.defined(this.options.subdomains)&&this.options.subdomains.length>0?this.options.subdomains.split(""):["0","1","2","3","4","5","6","7"],!Cesium$1.GeoWTFS)return void console.error("请确认正确引入天地图官方提供的cesiumTdt.js文件,并确认无冲突!");const r=new Cesium$1.GeoWTFS({...this.options,viewer:this._map.viewer,subdomains:i,metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:Cesium$1.Color.WHITE,scale:.5,outlineColor:Cesium$1.Color.BLACK,outlineWidth:5,style:Cesium$1.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:Cesium$1.Color.RED,backgroundPadding:new Cesium$1.Cartesian2(10,10),horizontalOrigin:Cesium$1.HorizontalOrigin.MIDDLE,verticalOrigin:Cesium$1.VerticalOrigin.TOP,eyeOffset:Cesium$1.Cartesian3.ZERO,pixelOffset:new Cesium$1.Cartesian2(0,8)},billboardGraphics:{horizontalOrigin:Cesium$1.HorizontalOrigin.CENTER,verticalOrigin:Cesium$1.VerticalOrigin.CENTER,eyeOffset:Cesium$1.Cartesian3.ZERO,pixelOffset:Cesium$1.Cartesian2.ZERO,alignedAxis:Cesium$1.Cartesian3.ZERO,color:Cesium$1.Color.WHITE,rotation:0,scale:1,width:18,height:18}});r.getTileUrl=function(){return e+"?lxys={z},{x},{y}&tk="+t},r.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),this.wtfs=r}_removedHook(){this.wtfs&&(this.wtfs.destroy(),this.wtfs=null)}}mars3d__namespace.layer.TdtDmLayer=TdtDmLayer,mars3d__namespace.layer.register("tdt_dm",TdtDmLayer);const Cesium=mars3d__namespace.Cesium;class TdtTerrainProvider extends Cesium.GeoTerrainProvider{constructor(e={}){if(!e.urls){const t=e.url||"https://t{s}.tianditu.gov.cn/DataServer",i=e.key||mars3d__namespace.Token.tianditu;let r;r=Array.isArray(e.subdomains)?e.subdomains.slice():Cesium.defined(e.subdomains)&&e.subdomains.length>0?e.subdomains.split(""):["0","1","2","3","4","5","6","7"];const n=[];r.forEach((e=>{const r=mars3d__namespace.Util.template(t,{s:e})+"?T=elv_c&tk="+i;n.push(r)})),e.urls=n}super(e)}}mars3d__namespace.LayerUtil.registerTerrainProvider("tdt",TdtTerrainProvider),mars3d__namespace.provider.TdtTerrainProvider=TdtTerrainProvider,exports.TdtDmLayer=TdtDmLayer,exports.TdtTerrainProvider=TdtTerrainProvider,Object.defineProperty(exports,"__esModule",{value:!0})})); + */;void 0===(n="function"==typeof(r=function(){function e(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var i={},r={};function n(e,t){var n,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=r[e])?o:(n=a(e,(0|e)<0?-1:0,!0),s&&(r[e]=n),n):(s=-128<=(e|=0)&&e<128)&&(o=i[e])?o:(n=a(e,e<0?-1:0,!1),s&&(i[e]=n),n)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?g:d;if(t){if(e<0)return g;if(e>=u)return C}else{if(e<=-h)return y;if(e+1>=h)return v}return e<0?o(-e,t).neg():a(e%c|0,e/c|0,t)}function a(t,i,r){return new e(t,i,r)}e.fromInt=n,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function x(e,t,i){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d;if("number"==typeof t?(i=t,t=!1):t=!!t,(i=i||10)<2||360)throw Error("interior hyphen");if(0===r)return x(e.substring(1),t,i).neg();for(var n=o(s(i,8)),a=d,l=0;l>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=l).isZero())return c+x;for(;c.length<6;)c="0"+c;x=""+c+x}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var i=this.isNegative(),r=e.isNegative();return i&&!r?-1:!i&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(p)},_.neg=_.negate,_.add=function(e){t(e)||(e=l(e));var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,x=65535&e.high,c=e.low>>>16,u=0,h=0,f=0,d=0;return f+=(d+=o+(65535&e.low))>>>16,h+=(f+=n+c)>>>16,u+=(h+=r+x)>>>16,u+=i+s,a((f&=65535)<<16|(d&=65535),(u&=65535)<<16|(h&=65535),this.unsigned)},_.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return d;if(t(e)||(e=l(e)),e.isZero())return d;if(this.eq(y))return e.isOdd()?y:d;if(e.eq(y))return this.isOdd()?y:d;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,x=e.high>>>16,c=65535&e.high,u=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,b=0;return m+=(b+=s*h)>>>16,p+=(m+=n*h)>>>16,m&=65535,p+=(m+=s*u)>>>16,g+=(p+=r*h)>>>16,p&=65535,g+=(p+=n*u)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=i*h+r*u+n*c+s*x,a((m&=65535)<<16|(b&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:d;var i,r,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;n=g}else{if(this.eq(y))return e.eq(p)||e.eq(b)?y:e.eq(y)?p:(i=this.shr(1).div(e).shl(1)).eq(d)?e.isNegative()?p:b:(r=this.sub(e.mul(i)),n=i.add(r.div(e)));if(e.eq(y))return this.unsigned?g:d;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=d}for(r=this;r.gte(e);){i=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),x=a<=48?1:s(2,a-48),c=o(i),u=c.mul(e);u.isNegative()||u.gt(r);)u=(c=o(i-=x,this.unsigned)).mul(e);c.isZero()&&(c=p),n=n.add(c),r=r.sub(u)}return n},_.div=_.divide,_.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return a(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=l(e)),a(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low<>>32-e,this.unsigned):a(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var i=this.high;return e<32?a(this.low>>>e|i<<32-e,i>>>e,this.unsigned):a(32===e?i:i>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?r.apply(t,[]):r)||(e.exports=n)},function(e,t){},function(e,t,i){i(194);var r=i(5).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,i){var r=i(12);r(r.S+r.F*!i(25),"Object",{defineProperties:i(109)})},function(e,t,i){i(34)("Uint8",1,(function(e){return function(t,i,r){return e(this,t,i,r)}}),!0)},function(e,t,i){var r=i(10),n=i(11),o=i(35),a=i(123),s=i(20),x=i(124),l=i(18),c=i(125),u=i(29),h=i(19),f=i(126),d=i(41).f,g=i(13).f,p=i(92),m=i(55),b=r.ArrayBuffer,v=r.DataView,C=r.Math,y=r.RangeError,_=r.Infinity,A=b,I=C.abs,w=C.pow,G=C.floor,E=C.log,S=C.LN2,T=n?"_b":"buffer",P=n?"_l":"byteLength",M=n?"_o":"byteOffset";function N(e,t,i){var r,n,o,a=new Array(i),s=8*i-t-1,x=(1<>1,c=23===t?w(2,-24)-w(2,-77):0,u=0,h=e<0||0===e&&1/e<0?1:0;for((e=I(e))!==e||e===_?(n=e!=e?1:0,r=x):(r=G(E(e)/S),e*(o=w(2,-r))<1&&(r--,o*=2),(e+=r+l>=1?c/o:c*w(2,1-l))*o>=2&&(r++,o/=2),r+l>=x?(n=0,r=x):r+l>=1?(n=(e*o-1)*w(2,t),r+=l):(n=e*w(2,l-1)*w(2,t),r=0));t>=8;a[u++]=255&n,n/=256,t-=8);for(r=r<0;a[u++]=255&r,r/=256,s-=8);return a[--u]|=128*h,a}function L(e,t,i){var r,n=8*i-t-1,o=(1<>1,s=n-7,x=i-1,l=e[x--],c=127&l;for(l>>=7;s>0;c=256*c+e[x],x--,s-=8);for(r=c&(1<<-s)-1,c>>=-s,s+=t;s>0;r=256*r+e[x],x--,s-=8);if(0===c)c=1-a;else{if(c===o)return r?NaN:l?-_:_;r+=w(2,t),c-=a}return(l?-1:1)*r*w(2,c-t)}function R(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function O(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function D(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function k(e){return N(e,52,8)}function U(e){return N(e,23,4)}function B(e,t,i){g(e.prototype,t,{get:function(){return this[i]}})}function W(e,t,i,r){var n=f(+i);if(n+t>e[P])throw y("Wrong index!");var o=e[T]._b,a=n+e[M],s=o.slice(a,a+t);return r?s:s.reverse()}function V(e,t,i,r,n,o){var a=f(+i);if(a+t>e[P])throw y("Wrong index!");for(var s=e[T]._b,x=a+e[M],l=r(+n),c=0;cq;)(j=H[q++])in b||s(b,j,A[j]);o||(z.constructor=b)}var X=new v(new b(2)),Y=v.prototype.setInt8;X.setInt8(0,2147483648),X.setInt8(1,2147483649),!X.getInt8(0)&&X.getInt8(1)||x(v.prototype,{setInt8:function(e,t){Y.call(this,e,t<<24>>24)},setUint8:function(e,t){Y.call(this,e,t<<24>>24)}},!0)}else b=function(e){c(this,b,"ArrayBuffer");var t=f(e);this._b=p.call(new Array(t),0),this[P]=t},v=function(e,t,i){c(this,v,"DataView"),c(e,b,"DataView");var r=e[P],n=u(t);if(n<0||n>r)throw y("Wrong offset!");if(n+(i=void 0===i?r-n:h(i))>r)throw y("Wrong length!");this[T]=e,this[M]=n,this[P]=i},n&&(B(b,"byteLength","_l"),B(v,"buffer","_b"),B(v,"byteLength","_l"),B(v,"byteOffset","_o")),x(v.prototype,{getInt8:function(e){return W(this,1,e)[0]<<24>>24},getUint8:function(e){return W(this,1,e)[0]},getInt16:function(e){var t=W(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=W(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return R(W(this,4,e,arguments[1]))},getUint32:function(e){return R(W(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return L(W(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return L(W(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){V(this,1,e,O,t)},setUint8:function(e,t){V(this,1,e,O,t)},setInt16:function(e,t){V(this,2,e,F,t,arguments[2])},setUint16:function(e,t){V(this,2,e,F,t,arguments[2])},setInt32:function(e,t){V(this,4,e,D,t,arguments[2])},setUint32:function(e,t){V(this,4,e,D,t,arguments[2])},setFloat32:function(e,t){V(this,4,e,U,t,arguments[2])},setFloat64:function(e,t){V(this,8,e,k,t,arguments[2])}});m(b,"ArrayBuffer"),m(v,"DataView"),s(v.prototype,a.VIEW,!0),t.ArrayBuffer=b,t.DataView=v},function(e,t,i){var r=i(36),n=i(4)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[n]===e)}},function(e,t,i){var r=i(63),n=i(4)("iterator"),o=i(36);e.exports=i(43).getIteratorMethod=function(e){if(null!==e)return e[n]||e["@@iterator"]||o[r(e)]}},function(e,t,i){var r=i(51),n=i(100),o=i(30),a=i(19),s=i(200);e.exports=function(e,t){var i=1===e,x=2===e,l=3===e,c=4===e,u=6===e,h=5===e||u,f=t||s;return function(t,s,d){for(var g,p,m=o(t),b=n(m),v=r(s,d,3),C=a(b.length),y=0,_=i?f(t,C):x?f(t,0):void 0;C>y;y++)if((h||y in b)&&(p=v(g=b[y],y,m),e))if(i)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return g;case 6:return y;case 2:_.push(g)}else if(c)return!1;return u?-1:l||c?c:_}}},function(e,t,i){var r=i(201);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,i){var r=i(21),n=i(127),o=i(4)("species");e.exports=function(e){var t;return n(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!n(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,i){var r=i(4)("iterator"),n=!1;try{var o=[7][r]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:i=!0}},o[r]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){var r=i(30),n=i(54),o=i(19);e.exports=[].copyWithin||function(e,t){var i=r(this),a=o(i.length),s=n(e,a),x=n(t,a),l=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===l?a:n(l,a))-x,a-s),u=1;for(x0;)x in i?i[s]=i[x]:delete i[s],s+=u,x+=u;return i}},function(e,t,i){i(34)("Uint32",4,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Float64",8,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Uint8",1,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(34)("Int16",2,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){var r=i(23);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,i){i(210),e.exports=i(5).Date.now},function(e,t,i){var r=i(12);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,i){i(34)("Uint16",2,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){var r=i(23);r(r.P,"Array",{fill:i(92)}),i(97)("fill")},function(e,t,i){i(34)("Float32",4,(function(e){return function(t,i,r){return e(this,t,i,r)}}))},function(e,t,i){i(119),i(113),i(116),i(215),i(227),i(228),e.exports=i(5).Promise},function(e,t,i){var r,n,o,a,s=i(48),x=i(7),l=i(59),c=i(133),u=i(12),h=i(33),f=i(60),d=i(216),g=i(217),p=i(134),m=i(135).set,b=i(222)(),v=i(94),C=i(136),y=i(223),_=i(137),A=x.TypeError,I=x.process,w=I&&I.versions,G=w&&w.v8||"",E=x.Promise,S="process"===c(I),T=function(){},P=n=v.f,M=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[i(14)("species")]=function(e){e(T,T)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==G.indexOf("6.6")&&-1===y.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},L=function(e,t){if(!e._n){e._n=!0;var i=e._c;b((function(){for(var r=e._v,n=1===e._s,o=0,a=function(t){var i,o,a,s=n?t.ok:t.fail,x=t.resolve,l=t.reject,c=t.domain;try{s?(n||(2===e._h&&F(e),e._h=1),!0===s?i=r:(c&&c.enter(),i=s(r),c&&(c.exit(),a=!0)),i===t.promise?l(A("Promise-chain cycle")):(o=N(i))?o.call(i,x,l):x(i)):l(r)}catch(e){c&&!a&&c.exit(),l(e)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&R(e)}))}},R=function(e){m.call(x,(function(){var t,i,r,n=e._v,o=O(e);if(o&&(t=C((function(){S?I.emit("unhandledRejection",n,e):(i=x.onunhandledrejection)?i({promise:e,reason:n}):(r=x.console)&&r.error&&r.error("Unhandled promise rejection",n)})),e._h=S||O(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},O=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){m.call(x,(function(){var t;S?I.emit("rejectionHandled",e):(t=x.onrejectionhandled)&&t({promise:e,reason:e._v})}))},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),L(t,!0))},k=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw A("Promise can't be resolved itself");(t=N(e))?b((function(){var r={_w:i,_d:!1};try{t.call(e,l(k,r,1),l(D,r,1))}catch(e){D.call(r,e)}})):(i._v=e,i._s=1,L(i,!1))}catch(e){D.call({_w:i,_d:!1},e)}}};M||(E=function(e){d(this,E,"Promise","_h"),f(e),r.call(this);try{e(l(k,this,1),l(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(224)(E.prototype,{then:function(e,t){var i=P(p(this,E));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=S?I.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&L(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(k,e,1),this.reject=l(D,e,1)},v.f=P=function(e){return e===E||e===a?new o(e):n(e)}),u(u.G+u.W+u.F*!M,{Promise:E}),i(66)(E,"Promise"),i(225)("Promise"),a=i(5).Promise,u(u.S+u.F*!M,"Promise",{reject:function(e){var t=P(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(s||!M),"Promise",{resolve:function(e){return _(s&&this===a?E:this,e)}}),u(u.S+u.F*!(M&&i(226)((function(e){E.all(e).catch(T)}))),"Promise",{all:function(e){var t=this,i=P(t),r=i.resolve,n=i.reject,o=C((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,x=!1;i.push(void 0),a++,t.resolve(e).then((function(e){x||(x=!0,i[s]=e,--a||r(i))}),n)})),--a||r(i)}));return o.e&&n(o.v),i.promise},race:function(e){var t=this,i=P(t),r=i.reject,n=C((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,r)}))}));return n.e&&r(n.v),i.promise}})},function(e,t){e.exports=function(e,t,i,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var r=i(59),n=i(218),o=i(219),a=i(27),s=i(106),x=i(220),l={},c={};(t=e.exports=function(e,t,i,u,h){var f,d,g,p,m=h?function(){return e}:x(e),b=r(i,u,t?2:1),v=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(f=s(e.length);f>v;v++)if((p=t?b(a(d=e[v])[0],d[1]):b(e[v]))===l||p===c)return p}else for(g=m.call(e);!(d=g.next()).done;)if((p=n(g,b,d.value,t))===l||p===c)return p}).BREAK=l,t.RETURN=c},function(e,t,i){var r=i(27);e.exports=function(e,t,i,n){try{return n?t(r(i)[0],i[1]):t(i)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,i){var r=i(49),n=i(14)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[n]===e)}},function(e,t,i){var r=i(133),n=i(14)("iterator"),o=i(49);e.exports=i(5).getIteratorMethod=function(e){if(null!==e)return e[n]||e["@@iterator"]||o[r(e)]}},function(e,t){e.exports=function(e,t,i){var r=void 0===i;switch(t.length){case 0:return r?e():e.call(i);case 1:return r?e(t[0]):e.call(i,t[0]);case 2:return r?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var r=i(7),n=i(135).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,x="process"===i(47)(a);e.exports=function(){var e,t,i,l=function(){var r,n;for(x&&(r=a.domain)&&r.exit();e;){n=e.fn,e=e.next;try{n()}catch(r){throw e?i():t=void 0,r}}t=void 0,r&&r.enter()};if(x)i=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);i=function(){c.then(l)}}else i=function(){n.call(r,l)};else{var u=!0,h=document.createTextNode("");new o(l).observe(h,{characterData:!0}),i=function(){h.data=u=!u}}return function(r){var n={fn:r,next:void 0};t&&(t.next=n),e||(e=n,i()),t=n}}},function(e,t,i){var r=i(7).navigator;e.exports=r&&r.userAgent||""},function(e,t,i){var r=i(32);e.exports=function(e,t,i){for(var n in t)i&&e[n]?e[n]=t[n]:r(e,n,t[n]);return e}},function(e,t,i){var r=i(7),n=i(5),o=i(26),a=i(25),s=i(14)("species");e.exports=function(e){var t="function"==typeof n[e]?n[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,i){var r=i(14)("iterator"),n=!1;try{var o=[7][r]();o.return=function(){n=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:i=!0}},o[r]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){var r=i(12),n=i(5),o=i(7),a=i(134),s=i(137);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,n.Promise||o.Promise),i="function"==typeof e;return this.then(i?function(i){return s(t,e()).then((function(){return i}))}:e,i?function(i){return s(t,e()).then((function(){throw i}))}:e)}})},function(e,t,i){var r=i(12),n=i(94),o=i(136);r(r.S,"Promise",{try:function(e){var t=n.f(this),i=o(e);return(i.e?t.reject:t.resolve)(i.v),t.promise}})},function(e,t,i){i(138)("asyncIterator")},function(e,t,i){var r=i(10),n=i(24),o=i(11),a=i(23),s=i(22),x=i(231).KEY,l=i(18),c=i(50),u=i(55),h=i(28),f=i(4),d=i(139),g=i(138),p=i(232),m=i(127),b=i(17),v=i(21),C=i(30),y=i(37),_=i(44),A=i(45),I=i(52),w=i(233),G=i(67),E=i(140),S=i(13),T=i(53),P=G.f,M=S.f,N=w.f,L=r.Symbol,R=r.JSON,O=R&&R.stringify,F=f("_hidden"),D=f("toPrimitive"),k={}.propertyIsEnumerable,U=c("symbol-registry"),B=c("symbols"),W=c("op-symbols"),V=Object.prototype,j="function"==typeof L&&!!E.f,z=r.QObject,H=!z||!z.prototype||!z.prototype.findChild,q=o&&l((function(){return 7!=I(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a}))?function(e,t,i){var r=P(V,t);r&&delete V[t],M(e,t,i),r&&e!==V&&M(V,t,r)}:M,X=function(e){var t=B[e]=I(L.prototype);return t._k=e,t},Y=j&&"symbol"==typeof L.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof L},K=function(e,t,i){return e===V&&K(W,t,i),b(e),t=_(t,!0),b(i),n(B,t)?(i.enumerable?(n(e,F)&&e[F][t]&&(e[F][t]=!1),i=I(i,{enumerable:A(0,!1)})):(n(e,F)||M(e,F,A(1,{})),e[F][t]=!0),q(e,t,i)):M(e,t,i)},Q=function(e,t){b(e);for(var i,r=p(t=y(t)),n=0,o=r.length;o>n;)K(e,i=r[n++],t[i]);return e},Z=function(e){var t=k.call(this,e=_(e,!0));return!(this===V&&n(B,e)&&!n(W,e))&&(!(t||!n(this,e)||!n(B,e)||n(this,F)&&this[F][e])||t)},J=function(e,t){if(e=y(e),t=_(t,!0),e!==V||!n(B,t)||n(W,t)){var i=P(e,t);return!i||!n(B,t)||n(e,F)&&e[F][t]||(i.enumerable=!0),i}},$=function(e){for(var t,i=N(y(e)),r=[],o=0;i.length>o;)n(B,t=i[o++])||t===F||t===x||r.push(t);return r},ee=function(e){for(var t,i=e===V,r=N(i?W:y(e)),o=[],a=0;r.length>a;)!n(B,t=r[a++])||i&&!n(V,t)||o.push(B[t]);return o};j||(s((L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(i){this===V&&t.call(W,i),n(this,F)&&n(this[F],e)&&(this[F][e]=!1),q(this,e,A(1,i))};return o&&H&&q(V,e,{configurable:!0,set:t}),X(e)}).prototype,"toString",(function(){return this._k})),G.f=J,S.f=K,i(41).f=w.f=$,i(93).f=Z,E.f=ee,o&&!i(35)&&s(V,"propertyIsEnumerable",Z,!0),d.f=function(e){return X(f(e))}),a(a.G+a.W+a.F*!j,{Symbol:L});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ie=0;te.length>ie;)f(te[ie++]);for(var re=T(f.store),ne=0;re.length>ne;)g(re[ne++]);a(a.S+a.F*!j,"Symbol",{for:function(e){return n(U,e+="")?U[e]:U[e]=L(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!j,"Object",{create:function(e,t){return void 0===t?I(e):Q(I(e),t)},defineProperty:K,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:ee});var oe=l((function(){E.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return E.f(C(e))}}),R&&a(a.S+a.F*(!j||l((function(){var e=L();return"[null]"!==O([e])||"{}"!=O({a:e})||"{}"!==O(Object(e))}))),"JSON",{stringify:function(e){for(var t,i,r=[e],n=1;arguments.length>n;)r.push(arguments[n++]);if(i=t=r[1],(v(t)||void 0!==e)&&!Y(e))return m(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!Y(t))return t}),r[1]=t,O.apply(R,r)}}),L.prototype[D]||i(20)(L.prototype,D,L.prototype.valueOf),u(L,"Symbol"),u(Math,"Math",!0),u(r.JSON,"JSON",!0)},function(e,t,i){var r=i(28)("meta"),n=i(21),o=i(24),a=i(13).f,s=0,x=Object.isExtensible||function(){return!0},l=!i(18)((function(){return x(Object.preventExtensions({}))})),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},u=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!n(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!x(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!x(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&u.NEED&&x(e)&&!o(e,r)&&c(e),e}}},function(e,t,i){var r=i(53),n=i(140),o=i(93);e.exports=function(e){var t=r(e),i=n.f;if(i)for(var a,s=i(e),x=o.f,l=0;s.length>l;)x.call(e,a=s[l++])&&t.push(a);return t}},function(e,t,i){var r=i(37),n=i(41).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"===o.call(e)?function(e){try{return n(e)}catch(e){return a.slice()}}(e):n(r(e))}},function(e,t,i){var r=i(21),n=i(17),o=function(e,t){if(n(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=i(51)(Function.call,i(67).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return o(e,i),t?e.__proto__=i:r(e,i),e}}({},!1):void 0),check:o}},function(e,t,i){var r=i(23),n=i(38),o=i(18),a=i(236),s="["+a+"]",x=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),c=function(e,t,i){var n={},s=o((function(){return!!a[e]()||"​…"!=="​…"[e]()})),x=n[e]=s?t(u):a[e];i&&(n[i]=x),r(r.P+r.F*s,"String",n)},u=c.trim=function(e,t){return e=String(n(e)),1&t&&(e=e.replace(x,"")),2&t&&(e=e.replace(l,"")),e};e.exports=c},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(module,__webpack_exports__,__webpack_require__){(function(module,global){var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(69);__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__);var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(42);__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__);var _babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(15),_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_json_stringify__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(84);__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_3__);var _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8),_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es6_string_ends_with__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(129);__webpack_require__.n(core_js_modules_es6_string_ends_with__WEBPACK_IMPORTED_MODULE_5__);var core_js_modules_es6_string_starts_with__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(132);__webpack_require__.n(core_js_modules_es6_string_starts_with__WEBPACK_IMPORTED_MODULE_6__);var _babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1),_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(141);__webpack_require__.n(core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_8__);var core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(239);__webpack_require__.n(core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_9__);var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(88);__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_10__);var _babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(0),_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11__),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(2),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(85);__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_13__);var core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(86);__webpack_require__.n(core_js_modules_es6_object_to_string__WEBPACK_IMPORTED_MODULE_14__);var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(79);__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_15__);var core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(241);__webpack_require__.n(core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_16__);var core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(143),require,require,e;__webpack_require__.n(core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_17__),window.GeoGlobe=window.GeoGlobe||{},window.GeoGlobe.Class=window.GeoGlobe.Class||{},window.GeoGlobe.LngLatBounds=window.GeoGlobe.LngLatBounds||{},window.GeoGlobe.LngLat=window.GeoGlobe.LngLat||{},window.GeoGlobe.Filter=window.GeoGlobe.Filter||{},window.GeoGlobe.Format=window.GeoGlobe.Format||{},window.GeoGlobe.Protocol=window.GeoGlobe.Protocol||{},window.GeoGlobe.Query=window.GeoGlobe.Query||{},window.GeoGlobe.Service=window.GeoGlobe.Service||{},window.GeoGlobe.Analysis=window.GeoGlobe.Analysis||{},GeoGlobe.getScriptLocation=function(e){for(var t="",i=new RegExp("(^|(.*?\\/))("+e+")(\\?|$)"),r=document.getElementsByTagName("script"),n=0,o=r.length;n1?[r,t].concat(Array.prototype.slice.call(arguments).slice(1,e-1),i):r.prototype=i,r},GeoGlobe.Class4OL=function(){var e=arguments.length,t=arguments[0],i=arguments[e-1],r="function"==typeof i.initialize?i.initialize:function(){t.prototype.initialize.apply(this,arguments)};if(e>1){var n=[r,t].concat(Array.prototype.slice.call(arguments).slice(1,e-1),i);GeoGlobe.inherit.apply(null,n)}else r.prototype=i;return r},GeoGlobe.inherit=function(e,t){var i,r,n,o=function(){};for(o.prototype=t.prototype,e.prototype=new o,i=2,r=arguments.length;i=0;i--)e[i]===t&&e.splice(i,1);return e},GeoGlobe.Util.indexOf=function(e,t){if("function"==typeof e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i=5.5&&t<7}return GeoGlobe.Util.alphaHackNeeded},GeoGlobe.Util.upperCaseObject=function(e){var t={};for(var i in e)t[i.toUpperCase()]=e[i];return t},GeoGlobe.Util.applyDefaults=function(e,t){e=e||{};var i="function"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!i&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},GeoGlobe.Util.getParameterString=function(e){var t=[];for(var i in e){var r=e[i];if(null!==r&&"function"!=typeof r){var n;if("object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(r)&&r.constructor===Array){for(var o,a=[],s=0,x=r.length;s1e-12&&--g>0;){var p=Math.sin(f),m=Math.cos(f),b=Math.sqrt(h*p*(h*p)+(c*u-l*h*m)*(c*u-l*h*m));if(0===b)return 0;var v=l*u+c*h*m,C=Math.atan2(b,v),y=Math.asin(c*h*p/b),_=Math.cos(y)*Math.cos(y),A=v-2*l*u/_,I=o/16*_*(4+o*(4-3*_));d=f,f=a+(1-I)*o*Math.sin(y)*(C+I*b*(A+I*v*(2*A*A-1)))}if(0===g)return NaN;var w=_*(r*r-n*n)/(n*n),G=w/1024*(256+w*(w*(74-47*w)-128));return(n*(1+w/16384*(4096+w*(w*(320-175*w)-768)))*(C-G*b*(A+G/4*(v*(2*A*A-1)-G/6*A*(4*b*b-3)*(4*A*A-3))))).toFixed(3)/1e3},GeoGlobe.Util.destinationVincenty=function(e,t,i){for(var r=GeoGlobe.Util,n=r.VincentyConstants,o=n.a,a=n.b,s=n.f,x=e.lng,l=e.lat,c=i,u=r.rad(t),h=Math.sin(u),f=Math.cos(u),d=(1-s)*Math.tan(r.rad(l)),g=1/Math.sqrt(1+d*d),p=d*g,m=Math.atan2(d,f),b=g*h,v=1-b*b,C=v*(o*o-a*a)/(a*a),y=1+C/16384*(4096+C*(C*(320-175*C)-768)),_=C/1024*(256+C*(C*(74-47*C)-128)),A=c/(a*y),I=2*Math.PI;Math.abs(A-I)>1e-12;){var w=Math.cos(2*m+A),G=Math.sin(A),E=Math.cos(A);I=A,A=c/(a*y)+_*G*(w+_/4*(E*(2*w*w-1)-_/6*w*(4*G*G-3)*(4*w*w-3)))}var S=p*G-g*E*f,T=Math.atan2(p*E+g*G*f,(1-s)*Math.sqrt(b*b+S*S)),P=s/16*v*(4+s*(4-3*v)),M=Math.atan2(G*h,g*E-p*G*f)-(1-P)*s*b*(A+P*G*(w+P*E*(2*w*w-1)));return new GeoGlobe.LngLat(x+r.deg(M),r.deg(T))},GeoGlobe.Util.getParameters=function(e,t){t=t||{},e=null===e?window.location.href:e;var i="";if(GeoGlobe.String.contains(e,"?")){var r=e.indexOf("?")+1,n=GeoGlobe.String.contains(e,"#")?e.indexOf("#"):e.length;i=e.substring(r,n)}for(var o={},a=i.split(/[&;]/),s=0,x=a.length;s1?1/e:e},GeoGlobe.Util.getResolutionFromScale=function(e,t){var i;return e&&(null===t&&(t="degrees"),i=1/(GeoGlobe.Util.normalizeScale(e)*GeoGlobe.INCHES_PER_UNIT[t]*GeoGlobe.DOTS_PER_INCH)),i},GeoGlobe.Util.getScaleFromResolution=function(e,t){return null===t&&(t="degrees"),e*GeoGlobe.INCHES_PER_UNIT[t]*GeoGlobe.DOTS_PER_INCH},GeoGlobe.Util.pagePosition=function(e){var t=[0,0],i=GeoGlobe.Util.getViewportElement();if(!e||e===window||e===i)return t;var r,n=GeoGlobe.IS_GECKO&&document.getBoxObjectFor&&"absolute"===GeoGlobe.Element.getStyle(e,"position")&&(""===e.style.top||""===e.style.left),o=null;if(e.getBoundingClientRect){r=e.getBoundingClientRect();var a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;t[0]=r.left+s,t[1]=r.top+a}else if(document.getBoxObjectFor&&!n){r=document.getBoxObjectFor(e);var x=document.getBoxObjectFor(i);t[0]=r.screenX-x.screenX,t[1]=r.screenY-x.screenY}else{if(t[0]=e.offsetLeft,t[1]=e.offsetTop,(o=e.offsetParent)!==e)for(;o;)t[0]+=o.offsetLeft,t[1]+=o.offsetTop,o=o.offsetParent;var l=GeoGlobe.BROWSER_NAME;for(("opera"===l||"safari"===l&&"absolute"===GeoGlobe.Element.getStyle(e,"position"))&&(t[1]-=document.body.offsetTop),o=e.offsetParent;o&&o!==document.body;)t[0]-=o.scrollLeft,"opera"===l&&"TR"===o.tagName||(t[1]-=o.scrollTop),o=o.offsetParent}return t},GeoGlobe.Util.getViewportElement=function(){var e=arguments.callee.viewportElement;return null===e&&(e="msie"===GeoGlobe.BROWSER_NAME&&"CSS1Compat"!==document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=e),e},GeoGlobe.Util.isEquivalentUrl=function(e,t,i){i=i||{},GeoGlobe.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1});var r=GeoGlobe.Util.createUrlObject(e,i),n=GeoGlobe.Util.createUrlObject(t,i);for(var o in r)if("args"!==o&&r[o]!==n[o])return!1;for(var o in r.args){if(r.args[o]!==n.args[o])return!1;delete n.args[o]}for(var o in n.args)return!1;return!0},GeoGlobe.Util.createUrlObject=function(e,t){if(t=t||{},!/^\w+:\/\//.test(e)){var i=window.location,r=i.port?":"+i.port:"",n=i.protocol+"//"+i.host.split(":").shift()+r;if(0===e.indexOf("/"))e=n+e;else{var o=i.pathname.split("/");o.pop(),e=n+o.join("/")+"/"+e}}t.ignoreCase&&(e=e.toLowerCase());var a=document.createElement("a");a.href=e;var s={};s.host=a.host.split(":").shift(),s.protocol=a.protocol,t.ignorePort80?s.port="80"===a.port||"0"===a.port?"":a.port:s.port=""===a.port||"0"===a.port?"80":a.port,s.hash=t.ignoreHash||"#"===a.hash?"":a.hash;var x=a.search;if(!x){var l=e.indexOf("?");x=-1!==l?e.substr(l):""}return s.args=GeoGlobe.Util.getParameters(x,{splitArgs:t.splitArgs}),s.pathname="/"===a.pathname.charAt(0)?a.pathname:"/"+a.pathname,s},GeoGlobe.Util.removeTail=function(e){var t=e.indexOf("?"),i=e.indexOf("#");return-1===t?-1!==i?e.substr(0,i):e:-1!==i?e.substr(0,Math.min(t,i)):e.substr(0,t)},GeoGlobe.IS_GECKO=(e=navigator.userAgent.toLowerCase(),-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")),GeoGlobe.CANVAS_SUPPORTED=function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),GeoGlobe.BROWSER_NAME=function(){var e="",t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("opera")?e="opera":-1!==t.indexOf("msie")?e="msie":-1!==t.indexOf("safari")?e="safari":-1!==t.indexOf("mozilla")&&(e=-1!==t.indexOf("firefox")?"firefox":"mozilla"),e}(),GeoGlobe.Util.getBrowserName=function(){return GeoGlobe.BROWSER_NAME},GeoGlobe.Util.getScrollbarWidth=function(){var e=GeoGlobe.Util._scrollbarWidth;if(null===e){var t,i,r=null,n=null;(r=document.createElement("div")).style.position="absolute",r.style.top="-1000px",r.style.left="-1000px",r.style.width="100px",r.style.height="50px",r.style.overflow="hidden",(n=document.createElement("div")).style.width="100%",n.style.height="200px",r.appendChild(n),document.body.appendChild(r),t=n.offsetWidth,r.style.overflow="scroll",i=n.offsetWidth,document.body.removeChild(document.body.lastChild),GeoGlobe.Util._scrollbarWidth=t-i,e=GeoGlobe.Util._scrollbarWidth}return e},GeoGlobe.Util.randomStr=function(e){for(var t="",i=[],r=0;rn);i++)n=r;return Math.max(0,i-1)},GeoGlobe.Util.getMapLevelFormScale=function(e,t,i,r){i=i||"degrees",r=r||96;var n=GeoGlobe.Util.getResolutionFromScale_DPI(t,i,r);return GeoGlobe.Util.getMapLevelFormResolution(e,n)},GeoGlobe.Util.delayFun=function(e,t,i){var r;return function(){var n=this,o=arguments,a=i&&!r;clearTimeout(r),r=setTimeout((function(){r=null,i||e.apply(n,o)}),t),a&&e.apply(n,o)}},GeoGlobe.Util.clone=function(e){if("object"!==_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(e))return e;if(null===e)return e;var t=e.constructor===Array?[]:{};for(var i in e)t[i]=GeoGlobe.Util.clone(e[i]);return t},GeoGlobe.Util.getType=function(e){var t=Object.prototype.toString;return e instanceof Element?"element":{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[t.call(e)]},GeoGlobe.Util.formatNumberToThousands=function(e,t,i){e=e.toString().replace(/\$|\,/g,""),isNaN(e)&&(e="0");var r=e===(e=Math.abs(e)),n=(e=Math.floor(e*Math.pow(10,t)+.50000000001))%Math.pow(10,t);for(e=Math.floor(e/Math.pow(10,t)).toString(),n=n.toString();n.length0?(r?"":"-")+e+"."+n:(r?"":"-")+e},GeoGlobe.Util.getFormattedString=function(e,t){var i=t;if((i=(i=i.replace(/{a}/g,e.a)).replace(/{b}/g,e.b)).contains("{c"))for(var r=i.split("{c"),n=0,o=0;o>16)+r,o=(i>>8&255)+r,a=(255&i)+r;return"#"+(16777216+65536*(n<255?n<1?0:n:255)+256*(o<255?o<1?0:o:255)+(a<255?a<1?0:a:255)).toString(16).slice(1)},GeoGlobe.Util.getHexColor=function(e){if(e=e.toLowerCase(),/^(rgb|rgba)/.test(e)){for(var t=e.split("(")[1].split(")")[0].split(","),i="#",r=0;r<3;r++){var n=Number(t[r]).toString(16);"0"===n&&(n+=n),1===n.length&&(n="0"+n),i+=n}return 7!==i.length&&(i=e),i}if(!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e))return e;var o=e.replace(/#/,"").split("");if(6===o.length)return e;if(3===o.length){var a="#";for(r=0;r=0;--n)r(o[n],a);for(n=a.length-1;n>=0;--n)r(a[n],o)}(),GeoGlobe.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(e){alert(e)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"GeoGlobe.Console"},function(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t=0?t+e:t+encodeURIComponent(e)),e},issue:function(e){var t=GeoGlobe.Util.extend(this.DEFAULT_CONFIG,{proxy:GeoGlobe.ProxyHost});(e=e||{}).headers=e.headers||{},(e=GeoGlobe.Util.applyDefaults(e,t)).headers=GeoGlobe.Util.applyDefaults(e.headers,t.headers);var i,r=!1;for(i in e.headers)e.headers.hasOwnProperty(i)&&"x-requested-with"===i.toLowerCase()&&(r=!0);!1===r&&(e.headers["X-Requested-With"]="XMLHttpRequest");var n=new GeoGlobe.Request.XMLHttpRequest;e.url=encodeURI(e.url);var o=GeoGlobe.Util.urlAppend(e.url,GeoGlobe.Util.getParameterString(e.params||{}));for(var a in o=GeoGlobe.Request.makeSameOrigin(o,e.proxy),n.open(e.method,o,e.async,e.user,e.password),e.headers)n.setRequestHeader(a,e.headers[a]);var s=this;return n.onreadystatechange=function(){n.readyState===GeoGlobe.Request.XMLHttpRequest.DONE&&s.runCallbacks({request:n,config:e,requestUrl:o})},!1===e.async?n.send(e.data):window.setTimeout((function(){0!==n.readyState&&n.send(e.data)}),0),n},runCallbacks:function(e){var t,i,r=e.request,n=e.config,o=n.scope?GeoGlobe.Function.bind(n.callback,n.scope):n.callback;n.success&&(t=n.scope?GeoGlobe.Function.bind(n.success,n.scope):n.success),n.failure&&(i=n.scope?GeoGlobe.Function.bind(n.failure,n.scope):n.failure),"file:"===GeoGlobe.Util.createUrlObject(n.url).protocol&&r.responseText&&(r.status=200),o(r),(!r.status||r.status>=200&&r.status<300)&&t&&t(r),r.status&&(r.status<200||r.status>=300)&&i&&i(r)},GET:function(e){return e=GeoGlobe.Util.extend(e,{method:"GET"}),GeoGlobe.Request.issue(e)},POST:function(e){return(e=GeoGlobe.Util.extend(e,{method:"POST"})).headers=e.headers?e.headers:{},"CONTENT-TYPE"in GeoGlobe.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),GeoGlobe.Request.issue(e)},PUT:function(e){return(e=GeoGlobe.Util.extend(e,{method:"PUT"})).headers=e.headers?e.headers:{},"CONTENT-TYPE"in GeoGlobe.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),GeoGlobe.Request.issue(e)},DELETE:function(e){return e=GeoGlobe.Util.extend(e,{method:"DELETE"}),GeoGlobe.Request.issue(e)},HEAD:function(e){return e=GeoGlobe.Util.extend(e,{method:"HEAD"}),GeoGlobe.Request.issue(e)},OPTIONS:function(e){return e=GeoGlobe.Util.extend(e,{method:"OPTIONS"}),GeoGlobe.Request.issue(e)}}),GeoGlobe.nullHandler=function(e){GeoGlobe.Console.userError(GeoGlobe.i18n("unhandledRequest",{statusText:e.statusText}))},GeoGlobe.loadURL=function(e,t,i,r,n){"string"==typeof t&&(t=GeoGlobe.Util.getParameters(t));var o=r||GeoGlobe.nullHandler,a=n||GeoGlobe.nullHandler;return GeoGlobe.Request.GET({url:e,params:t,success:o,failure:a,scope:i})},GeoGlobe.Request.setProxyHost=function(e){GeoGlobe.ProxyHost=e},GeoGlobe.Request.getProxyHost=function(){return GeoGlobe.ProxyHost},GeoGlobe.appendToProxy=function(e){var t=e.split("?"),i=GeoGlobe.ProxyHost+encodeURI(encodeURI(t[0]));return 2===t.length&&(i+="?"+t[1]),i},GeoGlobe.loadScript=function(e){GeoGlobe.Request.GET({url:e,async:!1,headers:{Accept:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"},success:function(e){GeoGlobe.Util.globalEval(e.responseText)},failure:function(t){alert("加载:"+e+" 失败。")}})},function(){var e=window.XMLHttpRequest,t=!!window.controllers,i=window.document.all&&!window.opera,r=i&&window.navigator.userAgent.match(/MSIE 7.0/);function n(){this._object=e&&!r?new e:new window.ActiveXObject("Microsoft.XMLHTTP"),this._listeners=[]}function o(){return new n}function a(e){o.onreadystatechange&&o.onreadystatechange.apply(e),e.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function s(e){try{e.responseText=e._object.responseText}catch(e){}try{e.responseXML=(r=(t=e._object).responseXML,n=t.responseText,i&&n&&r&&!r.documentElement&&t.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&&((r=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,r.validateOnParse=!1,r.loadXML(n)),r&&(i&&0!==r.parseError||!r.documentElement||r.documentElement&&"parsererror"===r.documentElement.tagName)?null:r)}catch(e){}var t,r,n;try{e.status=e._object.status}catch(e){}try{e.statusText=e._object.statusText}catch(e){}}function x(e){e._object.onreadystatechange=new window.Function}o.prototype=n.prototype,t&&e.wrapped&&(o.wrapped=e.wrapped),o.UNSENT=0,o.OPENED=1,o.HEADERS_RECEIVED=2,o.LOADING=3,o.DONE=4,o.prototype.readyState=o.UNSENT,o.prototype.responseText="",o.prototype.responseXML=null,o.prototype.status=0,o.prototype.statusText="",o.prototype.priority="NORMAL",o.prototype.onreadystatechange=null,o.onreadystatechange=null,o.onopen=null,o.onsend=null,o.onabort=null,o.prototype.open=function(e,r,n,l,c){delete this._headers,arguments.length<3&&(n=!0),this._async=n;var u,h=this,f=this.readyState;i&&n&&(u=function(){f!==o.DONE&&(x(h),h.abort())},window.attachEvent("onunload",u)),o.onopen&&o.onopen.apply(this,arguments),arguments.length>4?this._object.open(e,r,n,l,c):arguments.length>3?this._object.open(e,r,n,l):this._object.open(e,r,n);try{this._object.responseType="msxml-document"}catch(e){}this.readyState=o.OPENED,a(this),this._object.onreadystatechange=function(){t&&!n||(h.readyState=h._object.readyState,s(h),h._aborted?h.readyState=o.UNSENT:(h.readyState===o.DONE&&(delete h._data,x(h),i&&n&&window.detachEvent("onunload",u)),f!==h.readyState&&a(h),f=h.readyState))}},o.prototype.send=function(e){o.onsend&&o.onsend.apply(this,arguments),arguments.length||(e=null),e&&e.nodeType&&(e=window.XMLSerializer?(new window.XMLSerializer).serializeToString(e):e.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")),this._data=e,function(e){if(e._object.send(e._data),t&&!e._async)for(e.readyState=o.OPENED,s(e);e.readyStateo.UNSENT&&(this._aborted=!0),this._object.abort(),x(this),this.readyState=o.UNSENT,delete this._data},o.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()},o.prototype.getResponseHeader=function(e){return this._object.getResponseHeader(e)},o.prototype.setRequestHeader=function(e,t){return this._headers||(this._headers={}),this._headers[e]=t,this._object.setRequestHeader(e,t)},o.prototype.addEventListener=function(e,t,i){for(var r,n=0;r=this._listeners[n];n++)if(r[0]===e&&r[1]===t&&r[2]===i)return;this._listeners.push([e,t,i])},o.prototype.removeEventListener=function(e,t,i){for(var r,n=0;(r=this._listeners[n])&&(r[0]!==e||r[1]!==t||r[2]!==i);n++);r&&this._listeners.splice(n,1)},o.prototype.dispatchEvent=function(e){var t={type:e.type,target:this,currentTarget:this,eventPhase:2,bubbles:e.bubbles,cancelable:e.cancelable,timeStamp:e.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};"readystatechange"===t.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[t]);for(var i,r=0;i=this._listeners[r];r++)i[0]!==t.type||i[2]||(i[1].handleEvent||i[1]).apply(this,[t])},o.prototype.toString=function(){return"[object XMLHttpRequest]"},o.toString=function(){return"[XMLHttpRequest]"},window.Function.prototype.apply||(window.Function.prototype.apply=function(e,t){t||(t=[]),e.__func=this,e.__func(t[0],t[1],t[2],t[3],t[4]),delete e.__func}),GeoGlobe.Request||(GeoGlobe.Request={}),GeoGlobe.Request.XMLHttpRequest=o}(),GeoGlobe.Lang={code:null,defaultCode:"zh-CN",getCode:function(){return GeoGlobe.Lang.code||GeoGlobe.Lang.setCode(),GeoGlobe.Lang.code},setCode:function(e){var t;e||(e="msie"===GeoGlobe.BROWSER_NAME?navigator.userLanguage:navigator.language);var i=e.split("-");if(i[0]=i[0].toLowerCase(),"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(GeoGlobe.Lang[i[0]])&&(t=i[0]),i[1]){var r=i[0]+"-"+i[1].toUpperCase();"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(GeoGlobe.Lang[r])&&(t=r)}t||(GeoGlobe.Console.warn("Failed to find GeoGlobe.Lang."+i.join("-")+" dictionary, falling back to default language"),t=GeoGlobe.Lang.defaultCode),GeoGlobe.Lang.code=t},translate:function(e,t){var i=GeoGlobe.Lang[GeoGlobe.Lang.getCode()],r=i&&i[e];return r||(r=e),t&&(r=GeoGlobe.String.format(r,t)),r}},GeoGlobe.i18n=GeoGlobe.Lang.translate,GeoGlobe.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",end:""},GeoGlobe.Lang["zh-CN"]={unhandledRequest:"未处理的请求,返回值为 ${statusText}",end:""},GeoGlobe.String={startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){return-1!==e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),i=t[0],r=1,n=t.length;r0&&(i=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.toPrecision(t))),i},format:function(e,t,i,r){t=void 0!==t?t:0,i=void 0!==i?i:GeoGlobe.Number.thousandsSeparator,r=void 0!==r?r:GeoGlobe.Number.decimalSeparator,null!==t&&(e=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.toFixed(t)));var n=e.toString().split(".");1===n.length&&null===t&&(t=0);var o,a=n[0];if(i)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+i+"$2");if(0===t)o=a;else{var x=n.length>1?n[1]:"0";null!==t&&(x+=new Array(t-x.length+1).join("0")),o=a+r+x}return o},zeroPad:function(e,t,i){for(var r=e.toString(i||10);r.lengthi.length)&&(t=i.length),t-=e.length;var r=i.lastIndexOf(e,t);return-1!==r&&r===t}),GeoGlobe.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:"toISOString"in Date.prototype?function(e){return e.toISOString()}:function(e){return isNaN(e.getTime())?"Invalid Date":e.getUTCFullYear()+"-"+GeoGlobe.Number.zeroPad(e.getUTCMonth()+1,2)+"-"+GeoGlobe.Number.zeroPad(e.getUTCDate(),2)+"T"+GeoGlobe.Number.zeroPad(e.getUTCHours(),2)+":"+GeoGlobe.Number.zeroPad(e.getUTCMinutes(),2)+":"+GeoGlobe.Number.zeroPad(e.getUTCSeconds(),2)+"."+GeoGlobe.Number.zeroPad(e.getUTCMilliseconds(),3)+"Z"},parse:function(e){var t,i=e.match(this.dateRegEx);if(i&&(i[1]||i[7])){var r=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[1],10)||0,n=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[2],10)-1||0,o=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[3],10)||1;t=new Date(Date.UTC(r,n,o));var a=i[7];if(a){var s=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[4],10),x=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[5],10),l=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(i[6]),c=0|l,u=Math.round(1e3*(l-c));if(t.setUTCHours(s,x,c,u),"Z"!==a){var h=-1e3*(60*_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(a,10)*60+60*(_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[8],10)||0));t=new Date(t.getTime()+h)}}}else t=new Date("invalid");return t}},window._GeoGlobe=function e(t,i,r){function n(a,s){if(!i[a]){if(!t[a]){if(!s&&"function"==typeof require&&require)return require(a,!0);if(o)return o(a,!0);var x=new Error("Cannot find module '"+a+"'");throw x.code="MODULE_NOT_FOUND",x}var l=i[a]={exports:{}};t[a][0].call(l.exports,(function(e){return n(t[a][1][e]||e)}),l,l.exports,e,t,i,r)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a, lat: }, or an array of [, ]")},t.exports=r},{"./lng_lat_bounds":2}],2:[function(e,t,i){var r=e("./lng_lat"),n=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};n.prototype.setNorthEast=function(e){return this._ne=e instanceof r?new r(e.lng,e.lat):r.convert(e),this},n.prototype.setSouthWest=function(e){return this._sw=e instanceof r?new r(e.lng,e.lat):r.convert(e),this},n.prototype.extend=function(e){var t,i,o=this._sw,a=this._ne;if(e instanceof r)t=e,i=e;else{if(!(e instanceof n))return _babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default()(e)?e.every(_babel_runtime_corejs2_core_js_array_is_array__WEBPACK_IMPORTED_MODULE_4___default.a)?this.extend(n.convert(e)):this.extend(r.convert(e)):this;if(t=e._sw,i=e._ne,!t||!i)return this}return o||a?(o.lng=Math.min(t.lng,o.lng),o.lat=Math.min(t.lat,o.lat),a.lng=Math.max(i.lng,a.lng),a.lat=Math.max(i.lat,a.lat)):(this._sw=new r(t.lng,t.lat),this._ne=new r(i.lng,i.lat)),this},n.prototype.getCenter=function(){return new r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},n.prototype.getSouthWest=function(){return this._sw},n.prototype.getNorthEast=function(){return this._ne},n.prototype.getNorthWest=function(){return new r(this.getWest(),this.getNorth())},n.prototype.getSouthEast=function(){return new r(this.getEast(),this.getSouth())},n.prototype.getWest=function(){return this._sw.lng},n.prototype.getSouth=function(){return this._sw.lat},n.prototype.getEast=function(){return this._ne.lng},n.prototype.getNorth=function(){return this._ne.lat},n.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},n.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},n.convert=function(e){return!e||e instanceof n?e:new n(e)},t.exports=n},{"./lng_lat":1}],3:[function(e,t,i){var r=e("./geo/lng_lat"),n=e("./geo/lng_lat_bounds");t.exports={LngLat:r,LngLatBounds:n}},{"./geo/lng_lat":1,"./geo/lng_lat_bounds":2}]},{},[3])(3),window.GeoGlobe.Util.extend(window.GeoGlobe,window._GeoGlobe),GeoGlobe.LngLat.prototype.CLASS_NAME="GeoGlobe.LngLat",GeoGlobe.LngLatBounds.prototype.clone=function(){return new GeoGlobe.LngLatBounds(this._sw,this._ne)},GeoGlobe.LngLatBounds.prototype.contains=function(e,t,i){return null===i&&(i=!0),null!==e&&null!==t&&(e=GeoGlobe.Util.toFloat(e),t=GeoGlobe.Util.toFloat(t),i?e>=this._sw.lng&&e<=this._ne.lng&&t>=this._sw.lat&&t<=this._ne.lat:e>this._sw.lng&&ethis._sw.lat&&t=0&&g<=1&&p>=0&&p<=1)if(r){var m=e.x1+g*x,b=e.y1+g*l;o=new GeoGlobe.Geometry.Point(m,b)}else o=!0}if(n)if(o){if(r){var v,C=[e,t];e:for(var y=0;y<2;++y){v=C[y];for(var _=1;_<3;++_)if(m=v["x"+_],b=v["y"+_],Math.sqrt(Math.pow(m-o.x,2)+Math.pow(b-o.y,2))=1?(i=x,r=l):(i=a+h*c,r=s+h*u),{distance:Math.pow(i-n,2)+Math.pow(r-o,2),x:i,y:r,along:h}},GeoGlobe.Geometry.fromGeoJson=function(e){var t;if(GeoGlobe.Format&&GeoGlobe.Format.GeoJSON){format=new GeoGlobe.Format.GeoJSON;var i=null;try{i=format.parseGeometry(geojson)}catch(e){console.log(e)}t=i}return t},GeoGlobe.Geometry.Collection=GeoGlobe.Class4OL(GeoGlobe.Geometry,{components:null,componentTypes:null,initialize:function(e){GeoGlobe.Geometry.prototype.initialize.apply(this,arguments),this.components=[],null!==e&&this.addComponents(e)},destroy:function(){this.components.length=0,this.components=null,GeoGlobe.Geometry.prototype.destroy.apply(this,arguments)},clone:function clone(){for(var geometry=eval("new "+this.CLASS_NAME+"()"),i=0,len=this.components.length;i-1)){if(null!==t&&t=0;--i)t=this.removeComponent(e[i])||t;return t},removeComponent:function(e){return GeoGlobe.Util.removeItem(this.components,e),this.clearBounds(),!0},getLength:function(){for(var e=0,t=0,i=this.components.length;t0?x:a,n.push(l))}if(t=r.length,0===o){for(s=0;s1)for(var t=1,i=this.components.length;t1)for(var n,o,a=1,s=t.components.length;a2;return t&&GeoGlobe.Geometry.Collection.prototype.removeComponent.apply(this,arguments),t},intersects:function(e){var t=!1,i=e.CLASS_NAME;if("GeoGlobe.Geometry.LineString"===i||"GeoGlobe.Geometry.LinearRing"===i||"GeoGlobe.Geometry.Point"===i){var r,n,o,a,s,x,l,c,u,h=this.getSortedSegments();r="GeoGlobe.Geometry.Point"===i?[{x1:e.x,y1:e.y,x2:e.x,y2:e.y}]:e.getSortedSegments();e:for(var f=0,d=h.length;fa);++g)if(!(l.x2Math.max(s,x))&&!(Math.max(c,u)0){var m=e.x10&&(h.unshift(b,1),Array.prototype.splice.apply(o,h),b+=h.length-2),s))for(var v=0,C=u.points.length;v0&&g.length>0&&(g.push(l.clone()),n.push(new GeoGlobe.Geometry.LineString(g)))}else a=e.splitWith(this,t);return o&&o.length>1?r=!0:o=[],n&&n.length>1?i=!0:n=[],(r||i)&&(a=s?[n,o]:o),a},splitWith:function(e,t){return e.split(this,t)},getVertices:function(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(e,t){var i,r=!(t&&!1===t.edge)&&t&&t.details,n={},o=Number.POSITIVE_INFINITY;if(e instanceof GeoGlobe.Geometry.Point){for(var a,s=this.getSortedSegments(),x=e.x,l=e.y,c=0,u=s.length;cx&&(l>a.y1&&la.y2))break;n=r?{distance:n.distance,x0:n.x,y0:n.y,x1:x,y1:l}:n.distance}else if(e instanceof GeoGlobe.Geometry.LineString){var h,f,d,g,p,m=this.getSortedSegments(),b=e.getSortedSegments(),v=b.length,C={point:!0};e:for(c=0,u=m.length;cx&&(x=s,l=c);x>a&&l!==r&&(n.push(l),e(t,r,l,a),e(t,l,o,a))}(t,0,r,e);var o=[];n.sort((function(e,t){return e-t}));for(var a=0;a0&&(t=t.concat(r))}return new GeoGlobe.Geometry.LineString(t)},GeoGlobe.Geometry.LineString.getCurveCoordinatesByTwoPoints=function(e,t){if(!(e&&t&&e instanceof GeoGlobe.Geometry.Point&&t instanceof GeoGlobe.Geometry.Point))return null;var i=function(e){return 1-2*e+e*e},r=function(e){return 2*e-2*e*e},n=function(e){return e*e};curveCoordinates=[];var o,a,s,x,l,c,u=0,h=0;if(void 0!==t){var f=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.y),d=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(t.y),g=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.x),p=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(t.x);for(p>g&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(p-g)>180&&g<0&&(g=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(360+g)),g>p&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(g-p)>180&&p<0&&(p=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(360+p)),c=0,d===f?(o=0,a=g-p):p===g?(o=Math.PI/2,a=f-d):(o=Math.atan((d-f)/(p-g)),a=(d-f)/Math.sin(o)),0===c&&(c=o+Math.PI/5),l=(s=a/2)*Math.cos(c)+g,x=s*Math.sin(c)+f,u=0;u<31;u++)curveCoordinates.push(new GeoGlobe.Geometry.Point(g*i(h)+l*r(h)+p*n(h),f*i(h)+x*r(h)+d*n(h))),h+=1/30;return curveCoordinates}"undefined"!=typeof curveCoordinates&&(curveCoordinates=[])},GeoGlobe.Geometry.LinearRing=GeoGlobe.Class4OL(GeoGlobe.Geometry.LineString,{componentTypes:["GeoGlobe.Geometry.Point"],addComponent:function(e,t){var i=!1,r=this.components.pop();null===t&&e.equals(r)||(i=GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,arguments));var n=this.components[0];return GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,[n]),i},removeComponent:function(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),GeoGlobe.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var i=this.components[0];GeoGlobe.Geometry.Collection.prototype.addComponent.apply(this,[i])}return t},move:function(e,t){for(var i=0,r=this.components.length;i0&&e<=2)return this.components[0].clone();if(e>2){var t=0,i=0,r=this.components[0].x,n=this.components[0].y,o=-1*this.getArea();if(0!==o){for(var a=0;a2){for(var t=0,i=0,r=this.components.length;i2){for(var o,a,s=0;s=n&&h<=a||n>a&&h<=n&&h>=a)){d=-1;break}s<=u||r!==o&&(sMath.max(r,o))||(n=n&&ha&&h=a)&&++d}else if(h===n&&(r<=o&&u>=r&&u<=o||r>=o&&u<=r&&u>=o)){d=-1;break}return-1===d?1:!!(1&d)},intersects:function(e){var t=!1;if("GeoGlobe.Geometry.Point"===e.CLASS_NAME)t=this.containsPoint(e);else if("GeoGlobe.Geometry.LineString"===e.CLASS_NAME)t=e.intersects(this);else if("GeoGlobe.Geometry.LinearRing"===e.CLASS_NAME)t=GeoGlobe.Geometry.LineString.prototype.intersects.apply(this,[e]);else for(var i=0,r=e.components.length;i0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t0){t+=Math.abs(this.components[0].getGeodesicArea(e));for(var i=1,r=this.components.length;i0&&1!==(i=this.components[0].containsPoint(e))&&i&&t>1)for(var r,n=1;n1?o=!0:l=[],c&&c.length>1?a=!0:c=[],(o||a)&&(s=x?[l,c]:c),s},splitWith:function(e,t){var i,r,n,o,a,s,x,l=null,c=t&&t.mutual;if(e instanceof GeoGlobe.Geometry.LineString){x=[],s=[e];for(var u=0,h=this.components.length;u1?o=!0:s=[],x&&x.length>1?a=!0:x=[],(o||a)&&(l=c?[s,x]:x),l},CLASS_NAME:"GeoGlobe.Geometry.MultiLineString"}),GeoGlobe.Geometry.MultiPolygon=GeoGlobe.Class4OL(GeoGlobe.Geometry.Collection,{componentTypes:["GeoGlobe.Geometry.Polygon"],CLASS_NAME:"GeoGlobe.Geometry.MultiPolygon"}),GeoGlobe.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"},GeoGlobe.Feature=GeoGlobe.Class4OL({id:null,fid:null,lonlat:null,geometry:null,attributes:null,data:null,bounds:null,state:null,url:null,modified:null,initialize:function(e,t){this.data=null!==t?t:{},this.id=GeoGlobe.Util.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=null,this.geometry=e||null,this.state=null,this.attributes={},t&&(this.attributes=GeoGlobe.Util.extend(this.attributes,t))},destroy:function(){this.geometry=null,this.modified=null,this.id=null,this.lonlat=null,this.data=null},clone:function(){return new GeoGlobe.Feature(this.geometry?this.geometry.clone():null,this.attributes)},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(e,t,i){var r=!1;return this.geometry&&(r=this.geometry.atPoint(e,t,i)),r},destroyPopup:function(){},toState:function(e){if(e===GeoGlobe.State.UPDATE)switch(this.state){case GeoGlobe.State.UNKNOWN:case GeoGlobe.State.DELETE:this.state=e;case GeoGlobe.State.UPDATE:case GeoGlobe.State.INSERT:}else if(e===GeoGlobe.State.INSERT)if(this.state===GeoGlobe.State.UNKNOWN);else this.state=e;else if(e===GeoGlobe.State.DELETE)switch(this.state){case GeoGlobe.State.INSERT:case GeoGlobe.State.DELETE:break;case GeoGlobe.State.UNKNOWN:case GeoGlobe.State.UPDATE:this.state=e}else e===GeoGlobe.State.UNKNOWN&&(this.state=e)},CLASS_NAME:"GeoGlobe.Feature"}),GeoGlobe.Feature.getBoundsByFeatures=function(e){for(var t=e.length,i=new Array(t),r=0;rthis.value;break;case GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:i=r<=this.value;break;case GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:i=r>=this.value;break;case GeoGlobe.Filter.Comparison.BETWEEN:i=r>=this.lowerBoundary&&r<=this.upperBoundary;break;case GeoGlobe.Filter.Comparison.LIKE:i=new RegExp(this.value,"gi").test(r);break;case GeoGlobe.Filter.Comparison.IS_NULL:i=null===r}return i},value2regex:function(e,t,i){if("."===e)throw new Error("'.' is an unsupported wildCard character for GeoGlobe.Filter.Comparison");return e=e||"*",t=t||".",i=i||"!",this.value=this.value.replace(new RegExp("\\"+i+"(.|$)","g"),"\\$1"),this.value=this.value.replace(new RegExp("\\"+t,"g"),"."),this.value=this.value.replace(new RegExp("\\"+e,"g"),".*"),this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e),this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+t),this.value},regex2value:function(){var e=this.value;return(e=(e=(e=(e=e.replace(/!/g,"!!")).replace(/(\\)?\\\./g,(function(e,t){return t?e:"!."}))).replace(/(\\)?\\\*/g,(function(e,t){return t?e:"!*"}))).replace(/\\\\/g,"\\")).replace(/\.\*/g,"*")},clone:function(){return GeoGlobe.Util.extend(new GeoGlobe.Filter.Comparison,this)},CLASS_NAME:"GeoGlobe.Filter.Comparison"}),GeoGlobe.Filter.Comparison.EQUAL_TO="==",GeoGlobe.Filter.Comparison.NOT_EQUAL_TO="!=",GeoGlobe.Filter.Comparison.LESS_THAN="<",GeoGlobe.Filter.Comparison.GREATER_THAN=">",GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=",GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=",GeoGlobe.Filter.Comparison.BETWEEN="..",GeoGlobe.Filter.Comparison.LIKE="~",GeoGlobe.Filter.Comparison.IS_NULL="NULL",GeoGlobe.Filter.Spatial=GeoGlobe.Class4OL(GeoGlobe.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(e){var t=!1;switch(this.type){case GeoGlobe.Filter.Spatial.BBOX:case GeoGlobe.Filter.Spatial.INTERSECTS:if(e.geometry){var i=this.value;"GeoGlobe.LngLatBounds"===this.value.CLASS_NAME&&(i=this.value.toGeometry()),e.geometry.intersects(i)&&(t=!0)}break;default:throw new Error("evaluate is not implemented for this filter type.")}return t},clone:function(){var e=GeoGlobe.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new GeoGlobe.Filter.Spatial(e)},CLASS_NAME:"GeoGlobe.Filter.Spatial"}),GeoGlobe.Filter.Spatial.BBOX="BBOX",GeoGlobe.Filter.Spatial.INTERSECTS="INTERSECTS",GeoGlobe.Filter.Spatial.DWITHIN="DWITHIN",GeoGlobe.Filter.Spatial.WITHIN="WITHIN",GeoGlobe.Filter.Spatial.CONTAINS="CONTAINS",GeoGlobe.Filter.Function=GeoGlobe.Class4OL(GeoGlobe.Filter,{name:null,params:null,CLASS_NAME:"GeoGlobe.Filter.Function"}),GeoGlobe.Protocol=GeoGlobe.Class4OL({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(e){e=e||{},GeoGlobe.Util.extend(this,e),this.options=e},mergeWithDefaultFilter:function(e){return e&&this.defaultFilter?new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.AND,filters:[this.defaultFilter,e]}):e||this.defaultFilter||void 0},destroy:function(){this.options=null,this.format=null},read:function(e){(e=e||{}).filter=this.mergeWithDefaultFilter(e.filter)},create:function(){},update:function(){},delete:function(){},commit:function(){},abort:function(e){},createCallback:function(e,t,i){return GeoGlobe.Function.bind((function(){e.apply(this,[t,i])}),this)},CLASS_NAME:"GeoGlobe.Protocol"}),GeoGlobe.Protocol.Response=GeoGlobe.Class4OL({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(e){GeoGlobe.Util.extend(this,e)},success:function(){return this.code>0},CLASS_NAME:"GeoGlobe.Protocol.Response"}),GeoGlobe.Protocol.Response.SUCCESS=1,GeoGlobe.Protocol.Response.FAILURE=0,GeoGlobe.Protocol.HTTP=GeoGlobe.Class4OL(GeoGlobe.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(e){if(e=e||{},this.params={},this.headers={},GeoGlobe.Protocol.prototype.initialize.apply(this,arguments),!this.filterToParams&&GeoGlobe.Format.QueryStringFilter){var t=new GeoGlobe.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams=function(e,i){return t.write(e,i)}}},destroy:function(){this.params=null,this.headers=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),(e=e||{}).params=GeoGlobe.Util.applyDefaults(e.params,this.options.params),(e=GeoGlobe.Util.applyDefaults(e,this.options)).filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=void 0!==e.readWithPOST?e.readWithPOST:this.readWithPOST,i=new GeoGlobe.Protocol.Response({requestType:"read"});if(t){var r=e.headers||{};r["Content-Type"]="application/x-www-form-urlencoded",i.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,i,e),data:GeoGlobe.Util.getParameterString(e.params),headers:r})}else i.priv=GeoGlobe.Request.GET({url:e.url,callback:this.createCallback(this.handleRead,i,e),params:e.params,headers:e.headers});return i},handleRead:function(e,t){this.handleResponse(e,t)},create:function(e,t){t=GeoGlobe.Util.applyDefaults(t,this.options);var i=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"create"});return i.priv=GeoGlobe.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(e)}),i},handleCreate:function(e,t){this.handleResponse(e,t)},update:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=GeoGlobe.Util.applyDefaults(t,this.options);var r=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"update"}),n=this.updateWithPOST?"POST":"PUT";return r.priv=GeoGlobe.Request[n]({url:i,callback:this.createCallback(this.handleUpdate,r,t),headers:t.headers,data:this.format.write(e)}),r},handleUpdate:function(e,t){this.handleResponse(e,t)},delete:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=GeoGlobe.Util.applyDefaults(t,this.options);var r=new GeoGlobe.Protocol.Response({reqFeatures:e,requestType:"delete"}),n=this.deleteWithPOST?"POST":"DELETE",o={url:i,callback:this.createCallback(this.handleDelete,r,t),headers:t.headers};return this.deleteWithPOST&&(o.data=this.format.write(e)),r.priv=GeoGlobe.Request[n](o),r},handleDelete:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){var i=e.priv;t.callback&&(i.status>=200&&i.status<300?("delete"!==e.requestType&&(e.features=this.parseFeatures(i)),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,t.callback.call(t.scope,e))},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},commit:function(e,t){t=GeoGlobe.Util.applyDefaults(t,this.options);var i=[],r=0,n={};n[GeoGlobe.State.INSERT]=[],n[GeoGlobe.State.UPDATE]=[],n[GeoGlobe.State.DELETE]=[];for(var o,a,s=[],x=0,l=e.length;x0?1:0)+n[GeoGlobe.State.UPDATE].length+n[GeoGlobe.State.DELETE].length,u=!0,h=new GeoGlobe.Protocol.Response({reqFeatures:s});function f(e){this.callUserCallback(e,t),u=u&&e.success(),++r>=c&&t.callback&&(h.code=u?GeoGlobe.Protocol.Response.SUCCESS:GeoGlobe.Protocol.Response.FAILURE,t.callback.apply(t.scope,[h]))}var d=n[GeoGlobe.State.INSERT];for(d.length>0&&i.push(this.create(d,GeoGlobe.Util.applyDefaults({callback:function(e){for(var t=e.features?e.features.length:0,i=new Array(t),r=0;r=0;--x)i.push(this.update(d[x],GeoGlobe.Util.applyDefaults({callback:f,scope:this},t.update)));for(x=(d=n[GeoGlobe.State.DELETE]).length-1;x>=0;--x)i.push(this.delete(d[x],GeoGlobe.Util.applyDefaults({callback:f,scope:this},t.delete)));return i},abort:function(e){e&&e.priv.abort()},callUserCallback:function(e,t){var i=t[e.requestType];i&&i.callback&&i.callback.call(i.scope,e)},CLASS_NAME:"GeoGlobe.Protocol.HTTP"}),GeoGlobe.Protocol.WFS=function(e){e=GeoGlobe.Util.applyDefaults(e,GeoGlobe.Protocol.WFS.DEFAULTS);var t=GeoGlobe.Protocol.WFS["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFS version: "+e.version;return new t(e)},GeoGlobe.Protocol.WFS.DEFAULTS={version:"1.0.0"},GeoGlobe.Protocol.WFS.v1=GeoGlobe.Class4OL(GeoGlobe.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(e){GeoGlobe.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=GeoGlobe.Format.WFST(GeoGlobe.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))),!e.geometryName&&_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(this.format.version)>1&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),e=GeoGlobe.Util.extend({},e),GeoGlobe.Util.applyDefaults(e,this.options||{});var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=GeoGlobe.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",e)]);return t.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},setFeatureType:function(e){this.featureType=e,this.format.featureType=e},setGeometryName:function(e){this.geometryName=e,this.format.geometryName=e},handleRead:function(e,t){if(t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options),t.callback){var i=e.priv;if(i.status>=200&&i.status<300){var r=this.parseResponse(i,t.readOptions);r&&!1!==r.success?(t.readOptions&&"object"===t.readOptions.output?GeoGlobe.Util.extend(e,r):e.features=r,e.code=GeoGlobe.Protocol.Response.SUCCESS):(e.code=GeoGlobe.Protocol.Response.FAILURE,e.error=r)}else e.code=GeoGlobe.Protocol.Response.FAILURE;t.callback.call(t.scope,e)}},parseResponse:function(e,t){var i=e.responseXML;if(i&&i.documentElement||(i=e.responseText),!i||i.length<=0)return null;var r=null;try{r=null!==this.readFormat?this.readFormat.read(i):this.format.read(i,t)}catch(e){var n="程序运行异常:"+e.name+","+e.message;alert(n)}if(!this.featureNS){var o=this.readFormat||this.format;this.featureNS=o.featureNS,o.autoConfig=!1,this.geometryName||this.setGeometryName(o.geometryName)}return r},commit:function(e,t){t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options);var i=new GeoGlobe.Protocol.Response({requestType:"commit",reqFeatures:e});return i.priv=GeoGlobe.Request.POST({url:t.url,headers:t.headers,data:this.format.write(e,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(e,t){if(t.callback){var i=e.priv,r=i.responseXML;r&&r.documentElement||(r=i.responseText);var n=this.format.read(r)||{};e.insertIds=n.insertIds||[],n.success?e.code=GeoGlobe.Protocol.Response.SUCCESS:(e.code=GeoGlobe.Protocol.Response.FAILURE,e.error=n),t.callback.call(t.scope,e)}},filterDelete:function(e,t){t=GeoGlobe.Util.extend({},t),GeoGlobe.Util.applyDefaults(t,this.options),new GeoGlobe.Protocol.Response({requestType:"commit"});var i=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}}),r=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(t.featureNS?this.featurePrefix+":":"")+t.featureType}});t.featureNS&&r.setAttribute("xmlns:"+this.featurePrefix,t.featureNS);var n=this.format.writeNode("ogc:Filter",e);r.appendChild(n),i.appendChild(r);var o=GeoGlobe.Format.XML.prototype.write.apply(this.format,[i]);return GeoGlobe.Request.POST({url:this.url,callback:t.callback||function(){},data:o})},abort:function(e){e&&e.priv.abort()},CLASS_NAME:"GeoGlobe.Protocol.WFS.v1"}),GeoGlobe.Protocol.WFS.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"GeoGlobe.Protocol.WFS.v1_0_0"}),GeoGlobe.Protocol.WFS.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Protocol.WFS.v1,{version:"1.1.0",initialize:function(e){GeoGlobe.Protocol.WFS.v1.prototype.initialize.apply(this,arguments),this.outputFormat&&!this.readFormat&&("gml2"===this.outputFormat.toLowerCase()?this.readFormat=new GeoGlobe.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName}):"json"===this.outputFormat.toLowerCase()&&(this.readFormat=new GeoGlobe.Format.GeoJSON))},CLASS_NAME:"GeoGlobe.Protocol.WFS.v1_1_0"}),GeoGlobe.Protocol.CSW=function(e){e=GeoGlobe.Util.applyDefaults(e,GeoGlobe.Protocol.CSW.DEFAULTS);var t=GeoGlobe.Protocol.CSW["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSW version: "+e.version;return new t(e)},GeoGlobe.Protocol.CSW.DEFAULTS={version:"2.0.2"},GeoGlobe.Protocol.CSW.v2_0_2=GeoGlobe.Class4OL(GeoGlobe.Protocol,{formatOptions:null,initialize:function(e){GeoGlobe.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=new GeoGlobe.Format.CSWGetRecords.v2_0_2(GeoGlobe.Util.extend({},this.formatOptions)))},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,GeoGlobe.Protocol.prototype.destroy.apply(this)},read:function(e){e=GeoGlobe.Util.extend({},e),GeoGlobe.Util.applyDefaults(e,this.options||{});var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=this.format.write(e.params||e);return t.priv=GeoGlobe.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},handleRead:function(e,t){if(t.callback){var i=e.priv;i.status>=200&&i.status<300?(e.data=this.parseData(i),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},parseData:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},CLASS_NAME:"GeoGlobe.Protocol.CSW.v2_0_2"}),GeoGlobe.Protocol.Script=GeoGlobe.Class4OL(GeoGlobe.Protocol,{url:null,params:null,callback:null,callbackTemplate:"GeoGlobe.Protocol.Script.registry.${id}",callbackKey:"callback",callbackPrefix:"",scope:null,format:null,pendingRequests:null,srsInBBOX:!1,initialize:function(e){if(e=e||{},this.params={},this.pendingRequests={},GeoGlobe.Protocol.prototype.initialize.apply(this,arguments),this.format||(this.format=new GeoGlobe.Format.GeoJSON),!this.filterToParams&&GeoGlobe.Format.QueryStringFilter){var t=new GeoGlobe.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(e,i){return t.write(e,i)}}},read:function(e){GeoGlobe.Protocol.prototype.read.apply(this,arguments),(e=GeoGlobe.Util.applyDefaults(e,this.options)).params=GeoGlobe.Util.applyDefaults(e.params,this.options.params),e.filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=new GeoGlobe.Protocol.Response({requestType:"read"}),i=this.createRequest(e.url,e.params,GeoGlobe.Function.bind((function(i){t.data=i,this.handleRead(t,e)}),this));return t.priv=i,t},createRequest:function(e,t,i){var r=GeoGlobe.Protocol.Script.register(i),n=GeoGlobe.String.format(this.callbackTemplate,{id:r});(t=GeoGlobe.Util.extend({},t))[this.callbackKey]=this.callbackPrefix+n,e=GeoGlobe.Util.urlAppend(e,GeoGlobe.Util.getParameterString(t));var o=document.createElement("script");return o.type="text/javascript",o.src=e,o.id="GeoGlobe_Protocol_Script_"+r,this.pendingRequests[o.id]=o,document.getElementsByTagName("head")[0].appendChild(o),o},destroyRequest:function(e){GeoGlobe.Protocol.Script.unregister(e.id.split("_").pop()),delete this.pendingRequests[e.id],e.parentNode&&e.parentNode.removeChild(e)},handleRead:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){t.callback&&(e.data?(e.features=this.parseFeatures(e.data),e.code=GeoGlobe.Protocol.Response.SUCCESS):e.code=GeoGlobe.Protocol.Response.FAILURE,this.destroyRequest(e.priv),t.callback.call(t.scope,e))},parseFeatures:function(e){return this.format.read(e)},abort:function(e){if(e)this.destroyRequest(e.priv);else for(var t in this.pendingRequests)this.destroyRequest(this.pendingRequests[t])},destroy:function(){this.abort(),delete this.params,delete this.format,GeoGlobe.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"GeoGlobe.Protocol.Script"}),function(){var e=GeoGlobe.Protocol.Script,t=0;e.registry={},e.register=function(i){var r="c"+ ++t;return e.registry[r]=function(){i.apply(this,arguments)},r},e.unregister=function(t){delete e.registry[t]}}(),GeoGlobe.Format=GeoGlobe.Class4OL({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(e){GeoGlobe.Util.extend(this,e),this.options=e},destroy:function(){},read:function(e){throw new Error("Read not implemented.")},write:function(e){throw new Error("Write not implemented.")},CLASS_NAME:"GeoGlobe.Format"}),GeoGlobe.Format.XML=GeoGlobe.Class4OL(GeoGlobe.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(e){for(var t in window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")),GeoGlobe.Format.prototype.initialize.apply(this,[e]),this.namespaces=GeoGlobe.Util.extend({},this.namespaces),this.namespaceAlias={},this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null,GeoGlobe.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(e,t){this.namespaces[e]=t,this.namespaceAlias[t]=e},read:function(e){var t=e.indexOf("<");t>0&&(e=e.substring(t));var i=GeoGlobe.Util.Try(GeoGlobe.Function.bind((function(){var t;return(t=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom).loadXML(e),t}),this),(function(){return(new DOMParser).parseFromString(e,"text/xml")}),(function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(e),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML}));return this.keepData&&(this.data=i),i},write:function(e){var t;if(e.xml)t=e.xml;else{var i=new XMLSerializer;if(1===e.nodeType){var r=document.implementation.createDocument("","",null);r.importNode&&(e=r.importNode(e,!0)),r.appendChild(e),t=i.serializeToString(r)}else t=i.serializeToString(e)}return t},createElementNS:function(e,t){return this.xmldom?"string"==typeof e?this.xmldom.createNode(1,t,e):this.xmldom.createNode(1,t,""):document.createElementNS(e,t)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(e){return"string"!=typeof e&&(e=String(e)),this.xmldom?this.xmldom.createTextNode(e):document.createTextNode(e)},getElementsByTagNameNS:function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var n,o,a=e.getElementsByTagName("*"),s=0,x=a.length;s0?(r=e.substring(0,o),n=e.substring(o+1)):(r=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,n=e);var a=this.writers[r][n].apply(this,[t]);return i&&i.appendChild(a),a},getChildEl:function(e,t,i){return e&&this.getThisOrNextEl(e.firstChild,t,i)},getNextEl:function(e,t,i){return e&&this.getThisOrNextEl(e.nextSibling,t,i)},getThisOrNextEl:function(e,t,i){e:for(var r=e;r;r=r.nextSibling)switch(r.nodeType){case 1:if(!(t&&t!==(r.localName||r.nodeName.split(":").pop())||i&&i!==r.namespaceURI))break e;r=null;break e;case 3:if(/^\s*$/.test(r.nodeValue))break;case 4:case 6:case 12:case 10:case 11:r=null;break e}return r||null},lookupNamespaceURI:function(e,t){var i=null;if(e)if(e.lookupNamespaceURI)i=e.lookupNamespaceURI(t);else e:switch(e.nodeType){case 1:if(null!==e.namespaceURI&&e.prefix===t){i=e.namespaceURI;break e}var r=e.attributes.length;if(r)for(var n,o=0;o0){if(!(n=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);r=n.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection);break}var x,l=this.getElementsByTagNameNS(e,this.gmlns,"Box");for(s=0;s0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),0===i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coordinates")).length>0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.removeSpace,"").split(",")),0===i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coord")).length>0){var r=this.getElementsByTagNameNS(t[0],this.gmlns,"X"),n=this.getElementsByTagNameNS(t[0],this.gmlns,"Y");r.length>0&&n.length>0&&(i=[r[0].firstChild.nodeValue,n[0].firstChild.nodeValue])}return 2===i.length&&(i[2]=null),this.xy?new GeoGlobe.Geometry.Point(i[0],i[1],i[2]):new GeoGlobe.Geometry.Point(i[1],i[0],i[2])},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"Point"),i=[];if(t.length>0)for(var r,n=0;n0){r=this.getChildValue(i[0]).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace);for(var o,a,s,x,l=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(i[0].getAttribute("dimension")),c=0;c0){var u=this.getChildValue(i[0]).replace(this.regExes.trimSpace,"").replace(this.regExes.trimComma,",").split(this.regExes.splitSpace);for(c=0;c0)for(var r,n=0;n0)for(var r,n=0;n0)for(var r,n=0;n0){var n=[];if(r.length>0&&(n=r[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2===n.length&&(n[2]=null),this.xy)var o=new GeoGlobe.Geometry.Point(n[0],n[1],n[2]);else o=new GeoGlobe.Geometry.Point(n[1],n[0],n[2])}var a=this.getElementsByTagNameNS(e,this.gmlns,"upperCorner");if(a.length>0)if(n=[],a.length>0&&(n=a[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2===n.length&&(n[2]=null),this.xy)var s=new GeoGlobe.Geometry.Point(n[0],n[1],n[2]);else s=new GeoGlobe.Geometry.Point(n[1],n[0],n[2]);if(o&&s){i.push(new GeoGlobe.Geometry.Point(o.x,o.y)),i.push(new GeoGlobe.Geometry.Point(s.x,o.y)),i.push(new GeoGlobe.Geometry.Point(s.x,s.y)),i.push(new GeoGlobe.Geometry.Point(o.x,s.y)),i.push(new GeoGlobe.Geometry.Point(o.x,o.y));var x=new GeoGlobe.Geometry.LinearRing(i);t=new GeoGlobe.Geometry.Polygon([x])}return t},box:function(e){var t,i=this.getElementsByTagNameNS(e,this.gmlns,"coordinates"),r=null,n=null;if(i.length>0&&2===(t=i[0].firstChild.nodeValue.split(" ")).length&&(r=t[0].split(","),n=t[1].split(",")),null!==r&&null!==n){var o=new GeoGlobe.LngLat(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(r[0]),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(r[1])),a=new GeoGlobe.LngLat(_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(n[0]),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(n[1]));return new GeoGlobe.LngLatBounds(o,a)}}},parseAttributes:function(e){for(var t,i,r,n,o,a,s,x={},l=e.firstChild;l;){if(1===l.nodeType){for(t=l.childNodes,i=0;i0&&(t.bounds=i.components[0])},Point:function(e,t){var i={points:[]};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(i.points[0])},coordinates:function(e,t){for(var i,r=this.getChildValue(e).replace(this.regExes.trimSpace,""),n=(r=r.replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),o=n.length,a=new Array(o),s=0;s0&&(t.components=[new GeoGlobe.Geometry.MultiLineString(i.components)])},curveMember:function(e,t){this.readChildNodes(e,t)},MultiSurface:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),i.components.length>0&&(t.components=[new GeoGlobe.Geometry.MultiPolygon(i.components)])},surfaceMember:function(e,t){this.readChildNodes(e,t)},surfaceMembers:function(e,t){this.readChildNodes(e,t)},pointMembers:function(e,t){this.readChildNodes(e,t)},lineStringMembers:function(e,t){this.readChildNodes(e,t)},polygonMembers:function(e,t){this.readChildNodes(e,t)},geometryMembers:function(e,t){this.readChildNodes(e,t)},Envelope:function(e,t){var i={points:new Array(2)};this.readChildNodes(e,i),t.components||(t.components=[]);var r=i.points[0],n=i.points[1],o=new GeoGlobe.LngLat(r.x,r.y),a=new GeoGlobe.LngLat(n.x,n.y);t.components.push(new GeoGlobe.LngLatBounds(o,a))},lowerCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[0]=i.points[0]},upperCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[1]=i.points[0]}},GeoGlobe.Format.GML.Base.prototype.readers.gml),feature:GeoGlobe.Format.GML.Base.prototype.readers.feature,wfs:GeoGlobe.Format.GML.Base.prototype.readers.wfs},write:function(e){var t;t=GeoGlobe.Util.isArray(e)?"featureMembers":"featureMember";var i=this.writeNode("gml:"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),GeoGlobe.Format.XML.prototype.write.apply(this,[i])},writers:{gml:GeoGlobe.Util.applyDefaults({featureMembers:function(e){for(var t=this.createElementNSPlus("gml:featureMembers"),i=0,r=e.length;i=this.maxDepth)return!1;var i=GeoGlobe.Util.extend({},t);i.depth++;for(var r=0,n=e.length;r0){var c=l[0],u={features:[],feature:a};this.readNode(c,u),u.features.length>0&&i.push.apply(i,u.features)}}else i.push(a)}this.features=this.features.concat(i)},readers:{kml:{when:function(e,t){t.whens.push(GeoGlobe.Date.parse(this.getChildValue(e)))},_trackPointAttribute:function(e,t){var i=e.nodeName.split(":").pop();t.attributes[i].push(this.getChildValue(e))}},gx:{Track:function(e,t){var i={whens:[],points:[],angles:[]};if(this.trackAttributes){i.attributes={};for(var r=0,n=this.trackAttributes.length;r0;if(x&&i.whens.length!==i.angles.length)throw new Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:angles ("+i.angles.length+") elements.");for(r=0,n=i.whens.length;r2&&(r.z=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(i[2])),t.points.push(r)},angles:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(/\s+/);t.angles.push(i)}}},parseFeature:function(e){for(var t,i,r,n,o=["MultiGeometry","Polygon","LineString","Point"],a=0,s=o.length;a0){var x;if(!(x=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);r=x.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection);break}this.extractAttributes&&(n=this.parseAttributes(e));var l=new GeoGlobe.Feature(r,n),c=e.getAttribute("id")||e.getAttribute("name");return null!==c&&(l.fid=c),l},getStyle:function(e,t){var i=GeoGlobe.Util.removeTail(e),r=GeoGlobe.Util.extend({},t);if(r.depth++,r.styleBaseUrl=i,!this.styles[e]&&!GeoGlobe.String.startsWith(e,"#")&&r.depth<=this.maxDepth&&!this.fetched[i]){var n=this.fetchLink(i);n&&this.parseData(n,r)}return GeoGlobe.Util.extend({},this.styles[e])},parseGeometry:{point:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),i=[];if(t.length>0){var r=t[0].firstChild.nodeValue;i=(r=r.replace(this.regExes.removeSpace,"")).split(",")}if(!(i.length>1))throw"Bad coordinate string: "+r;return 2===i.length&&(i[2]=null),new GeoGlobe.Geometry.Point(i[0],i[1],i[2])},linestring:function(e,t){var i=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),r=null;if(i.length>0){for(var n,o=this.getChildValue(i[0]),a=(o=(o=o.replace(this.regExes.trimSpace,"")).replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),s=a.length,x=new Array(s),l=0;l1))throw"Bad LineString point coordinates: "+a[l];2===n.length&&(n[2]=null),x[l]=new GeoGlobe.Geometry.Point(n[0],n[1],n[2])}if(!s)throw"Bad LineString coordinates: "+o;r=t?new GeoGlobe.Geometry.LinearRing(x):new GeoGlobe.Geometry.LineString(x)}return r},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"LinearRing"),i=t.length,r=new Array(i);if(i>0)for(var n,o=0,a=t.length;o=1&&i.length<=3){var x;switch(i.length){case 1:x=i[0];break;case 2:var l=i[0],c=i[1];x=3===l.nodeType||4===l.nodeType?l:c;break;default:x=i[1]}if(3===x.nodeType||4===x.nodeType){var u=t.prefix?t.nodeName.split(":")[1]:t.nodeName,h=GeoGlobe.Util.getXmlNodeValue(x);h&&(h=h.replace(this.regExes.trimSpace,""),r[u]=h)}}return r},parseExtendedData:function(e){var t,i,r,n,o={},a=e.getElementsByTagName("Data");for(t=0,i=a.length;t0&&(t.featureNS=this.lookupNamespaceURI(e,r[0]))}},Title:function(e,t){var i=this.getChildValue(e);i&&(t.title=i)},Abstract:function(e,t){var i=this.getChildValue(e);i&&(t.abstract=i)}}},CLASS_NAME:"GeoGlobe.Format.WFSCapabilities.v1"}),GeoGlobe.Format.WFSCapabilities.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Format.WFSCapabilities.v1,{readers:{wfs:GeoGlobe.Util.applyDefaults({Service:function(e,t){t.service={},this.readChildNodes(e,t.service)},Fees:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.accessConstraints=i)},OnlineResource:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.onlineResource=i)},Keywords:function(e,t){var i=this.getChildValue(e);i&&"none"!==i.toLowerCase()&&(t.keywords=i.split(", "))},Capability:function(e,t){t.capability={},this.readChildNodes(e,t.capability)},Request:function(e,t){t.request={},this.readChildNodes(e,t.request)},GetFeature:function(e,t){t.getfeature={href:{},formats:[]},this.readChildNodes(e,t.getfeature)},ResultFormat:function(e,t){for(var i,r=e.childNodes,n=0;n0&&n.push(","),i=t[o].geometry,n.push(this.extractGeometry(i));return r&&n.push(")"),n.join("")},extractGeometry:function(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?(this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection),("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")"):null},extract:{point:function(e){return e.x+" "+e.y},multipoint:function(e){for(var t=[],i=0,r=e.components.length;i|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(e){var t=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(e);if(t){var i=e.length,r=e.indexOf("(",t[0].length);if(r>-1)for(var n=1;r0;)switch(r++,e.charAt(r)){case"(":n++;break;case")":n--}return[e.substr(0,r+1)]}},END:/^$/},i={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},r={"=":GeoGlobe.Filter.Comparison.EQUAL_TO,"<>":GeoGlobe.Filter.Comparison.NOT_EQUAL_TO,"<":GeoGlobe.Filter.Comparison.LESS_THAN,"<=":GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":GeoGlobe.Filter.Comparison.GREATER_THAN,">=":GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:GeoGlobe.Filter.Comparison.LIKE,BETWEEN:GeoGlobe.Filter.Comparison.BETWEEN,"IS NULL":GeoGlobe.Filter.Comparison.IS_NULL},n={},o={AND:GeoGlobe.Filter.Logical.AND,OR:GeoGlobe.Filter.Logical.OR},a={},s={RPAREN:3,LOGICAL:2,COMPARISON:1};for(e in r)r.hasOwnProperty(e)&&(n[r[e]]=e);for(e in o)o.hasOwnProperty(e)&&(a[o[e]]=e);function x(e,i){var r,n,o,a,s=i.length;for(r=0;r0&&s[t[t.length-1].type]<=a;)i.push(t.pop());t.push(n);break;case"SPATIAL":case"NOT":case"LPAREN":t.push(n);break;case"RPAREN":for(;t.length>0&&"LPAREN"!==t[t.length-1].type;)i.push(t.pop());t.pop(),t.length>0&&"SPATIAL"===t[t.length-1].type&&i.push(t.pop());case"COMMA":case"END":break;default:throw new Error("Unknown token type "+n.type)}}for(;t.length>0;)i.push(t.pop());var x=function e(){var t=i.pop();switch(t.type){case"LOGICAL":var n=e(),a=e();return new GeoGlobe.Filter.Logical({filters:[a,n],type:o[t.text.toUpperCase()]});case"NOT":var s=e();return new GeoGlobe.Filter.Logical({filters:[s],type:GeoGlobe.Filter.Logical.NOT});case"BETWEEN":var x,l;return i.pop(),l=e(),x=e(),u=e(),new GeoGlobe.Filter.Comparison({property:u,lowerBoundary:x,upperBoundary:l,type:GeoGlobe.Filter.Comparison.BETWEEN});case"COMPARISON":var c=e(),u=e();return new GeoGlobe.Filter.Comparison({property:u,value:c,type:r[t.text.toUpperCase()]});case"IS_NULL":return u=e(),new GeoGlobe.Filter.Comparison({property:u,type:r[t.text.toUpperCase()]});case"VALUE":var h=t.text.match(/^'(.*)'$/);return h?h[1].replace(/''/g,"'"):Number(t.text);case"SPATIAL":switch(t.text.toUpperCase()){case"BBOX":var f=e(),d=e(),g=e(),p=e(),m=e();return new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.BBOX,property:m,value:GeoGlobe.LngLatBounds.fromArray([p,g,d,f])});case"INTERSECTS":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.INTERSECTS,property:u,value:c});case"WITHIN":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.WITHIN,property:u,value:c});case"CONTAINS":return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.CONTAINS,property:u,value:c});case"DWITHIN":var b=e();return c=e(),u=e(),new GeoGlobe.Filter.Spatial({type:GeoGlobe.Filter.Spatial.DWITHIN,value:c,property:u,distance:Number(b)})}case"GEOMETRY":return GeoGlobe.Geometry.fromWKT(t.text);default:return t.text}}();if(i.length>0){for(var l="Remaining tokens after building AST: \n",c=i.length-1;c>=0;c--)l+=i[c].type+": "+i[c].text+"\n";throw new Error(l)}return x}(function(e){var t,r=[],n=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{if(e=(t=x(e,n)).remainder,n=i[t.type],"END"!==t.type&&!n)throw new Error("No follows list for "+t.type);r.push(t)}while("END"!==t.type);return r}(e));return this.keepData&&(this.data=t),t},write:function(e){if(e instanceof GeoGlobe.Geometry)return e.toString();switch(e.CLASS_NAME){case"GeoGlobe.Filter.Spatial":switch(e.type){case GeoGlobe.Filter.Spatial.BBOX:return"BBOX("+e.property+","+e.value.toBBOX()+")";case GeoGlobe.Filter.Spatial.DWITHIN:return"DWITHIN("+e.property+", "+this.write(e.value)+", "+e.distance+")";case GeoGlobe.Filter.Spatial.WITHIN:return"WITHIN("+e.property+", "+this.write(e.value)+")";case GeoGlobe.Filter.Spatial.INTERSECTS:return"INTERSECTS("+e.property+", "+this.write(e.value)+")";case GeoGlobe.Filter.Spatial.CONTAINS:return"CONTAINS("+e.property+", "+this.write(e.value)+")";default:throw new Error("Unknown spatial filter type: "+e.type)}case"GeoGlobe.Filter.Logical":if(e.type===GeoGlobe.Filter.Logical.NOT)return"NOT ("+this.write(e.filters[0])+")";for(var t="(",i=!0,r=0;r0?t.filter=new GeoGlobe.Filter.FeatureId({fids:i.fids}):i.filters.length>0&&(t.filter=i.filters[0])},FeatureId:function(e,t){var i=e.getAttribute("fid");i&&t.fids.push(i)},And:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.AND});this.readChildNodes(e,i),t.filters.push(i)},Or:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.OR});this.readChildNodes(e,i),t.filters.push(i)},Not:function(e,t){var i=new GeoGlobe.Filter.Logical({type:GeoGlobe.Filter.Logical.NOT});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThan:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LESS_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThan:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.GREATER_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsBetween:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.BETWEEN});this.readChildNodes(e,i),t.filters.push(i)},Literal:function(e,t){t.value=GeoGlobe.String.numericIf(this.getChildValue(e),!0)},PropertyName:function(e,t){t.property=this.getChildValue(e)},LowerBoundary:function(e,t){t.lowerBoundary=GeoGlobe.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},UpperBoundary:function(e,t){t.upperBoundary=GeoGlobe.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},Intersects:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.INTERSECTS)},Within:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.WITHIN)},Contains:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.CONTAINS)},DWithin:function(e,t){this.readSpatial(e,t,GeoGlobe.Filter.Spatial.DWITHIN)},Distance:function(e,t){t.distance=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(this.getChildValue(e)),t.distanceUnits=e.getAttribute("units")},Function:function(e,t){},PropertyIsNull:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.IS_NULL});this.readChildNodes(e,i),t.filters.push(i)}}},readSpatial:function(e,t,i){var r=new GeoGlobe.Filter.Spatial({type:i});this.readChildNodes(e,r),r.value=r.components[0],delete r.components,t.filters.push(r)},encodeLiteral:function(e){return e instanceof Date&&(e=GeoGlobe.Date.toISOString(e)),e},writeOgcExpression:function(e,t){return e instanceof GeoGlobe.Filter.Function?this.writeNode("Function",e,t):this.writeNode("Literal",e,t),t},write:function(e){return this.writers.ogc.Filter.apply(this,[e])},writers:{ogc:{Filter:function(e){var t=this.createElementNSPlus("ogc:Filter");return this.writeNode(this.getFilterType(e),e,t),t},_featureIds:function(e){for(var t=this.createDocumentFragment(),i=0,r=e.fids.length;i":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},CLASS_NAME:"GeoGlobe.Format.Filter.v1"}),GeoGlobe.Format.Filter.v1_0_0=GeoGlobe.Class4OL(GeoGlobe.Format.GML.v2,GeoGlobe.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(e){GeoGlobe.Format.GML.v2.prototype.initialize.apply(this,[e])},readers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsNotEqualTo:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLike:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LIKE});this.readChildNodes(e,i);var r=e.getAttribute("wildCard"),n=e.getAttribute("singleChar"),o=e.getAttribute("escape");i.value2regex(r,n,o),t.filters.push(i)}},GeoGlobe.Format.Filter.v1.prototype.readers.ogc),gml:GeoGlobe.Format.GML.v2.prototype.readers.gml,feature:GeoGlobe.Format.GML.v2.prototype.readers.feature},writers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Box",e.value,t);return e.projection&&i.setAttribute("srsName",e.projection),t}},GeoGlobe.Format.Filter.v1.prototype.writers.ogc),gml:GeoGlobe.Format.GML.v2.prototype.writers.gml,feature:GeoGlobe.Format.GML.v2.prototype.writers.feature},writeSpatial:function(e,t){var i,r=this.createElementNSPlus("ogc:"+t);return this.writeNode("PropertyName",e,r),e.value instanceof GeoGlobe.Filter.Function?this.writeNode("Function",e.value,r):(i=e.value instanceof GeoGlobe.Geometry?this.writeNode("feature:_geometry",e.value).firstChild:this.writeNode("gml:Box",e.value),e.projection&&i.setAttribute("srsName",e.projection),r.appendChild(i)),r},CLASS_NAME:"GeoGlobe.Format.Filter.v1_0_0"}),GeoGlobe.Format.Filter.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Format.GML.v3,GeoGlobe.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(e){GeoGlobe.Format.GML.v3.prototype.initialize.apply(this,[e])},readers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=e.getAttribute("matchCase"),r=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,r),t.filters.push(r)},PropertyIsNotEqualTo:function(e,t){var i=e.getAttribute("matchCase"),r=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,r),t.filters.push(r)},PropertyIsLike:function(e,t){var i=new GeoGlobe.Filter.Comparison({type:GeoGlobe.Filter.Comparison.LIKE});this.readChildNodes(e,i);var r=e.getAttribute("wildCard"),n=e.getAttribute("singleChar"),o=e.getAttribute("escapeChar");i.value2regex(r,n,o),t.filters.push(i)}},GeoGlobe.Format.Filter.v1.prototype.readers.ogc),gml:GeoGlobe.Format.GML.v3.prototype.readers.gml,feature:GeoGlobe.Format.GML.v3.prototype.readers.feature},writers:{ogc:GeoGlobe.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:e.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Envelope",e.value);return e.projection&&i.setAttribute("srsName",e.projection),t.appendChild(i),t},SortBy:function(e){for(var t=this.createElementNSPlus("ogc:SortBy"),i=0,r=e.length;i0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,(function(e,i){var r=t[i];return r||(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))}))+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}},CLASS_NAME:"GeoGlobe.Format.JSON"}),GeoGlobe.Format.GeoJSON=GeoGlobe.Class4OL(GeoGlobe.Format.JSON,{ignoreExtraDims:!1,read:function(e,t,i){t=t||"FeatureCollection";var r,n=null;if(r="string"==typeof e?GeoGlobe.Format.JSON.prototype.read.apply(this,[e,i]):e){if("string"!=typeof r.type)GeoGlobe.Console.error("Bad GeoJSON - no type: "+e);else if(this.isValidType(r,t))switch(t){case"Geometry":try{n=this.parseGeometry(r)}catch(e){GeoGlobe.Console.error(e)}break;case"Feature":try{(n=this.parseFeature(r)).type="Feature"}catch(e){GeoGlobe.Console.error(e)}break;case"FeatureCollection":switch(n=[],r.type){case"Feature":try{n.push(this.parseFeature(r))}catch(e){n=null,GeoGlobe.Console.error(e)}break;case"FeatureCollection":for(var o=0,a=r.features.length;o=1&&(s=n.tileMatrixSets[r.tileMatrixSetLinks[0].tileMatrixSet]);if(!s)throw new Error("matrixSet not found");for(o=0,a=r.styles.length;o=1&&(s=n.tileMatrixSets[r.tileMatrixSetLinks[0].tileMatrixSet]);if(!s)throw new Error("matrixSet not found");var c=[];i.styleName&&""!==i.styleName?c[0]=i.styleName:this.GetStyleName((function(e){c=e}));var u=i.requestEncoding;u||(u="KVP",t.operationsMetadata.GetTile.dcp.http);var h=[],f=i.params||{};delete i.params;for(var d=0,g=r.dimensions.length;d0&&(f.prefix=d[0]),r.layers.push(f),void 0===f.formats&&(f.formats=g.getmap.formats),void 0===f.infoFormats&&p&&(f.infoFormats=p.formats)}},Attribution:function(e,t){t.attribution={},this.readChildNodes(e,t.attribution)},LogoURL:function(e,t){t.logo={width:e.getAttribute("width"),height:e.getAttribute("height")},this.readChildNodes(e,t.logo)},Style:function(e,t){var i={};t.styles.push(i),this.readChildNodes(e,i)},LegendURL:function(e,t){var i={width:e.getAttribute("width"),height:e.getAttribute("height")};t.legend=i,this.readChildNodes(e,i)},MetadataURL:function(e,t){var i={type:e.getAttribute("type")};t.metadataURLs.push(i),this.readChildNodes(e,i)},DataURL:function(e,t){t.dataURL={},this.readChildNodes(e,t.dataURL)},FeatureListURL:function(e,t){t.featureListURL={},this.readChildNodes(e,t.featureListURL)},AuthorityURL:function(e,t){var i=e.getAttribute("name"),r={};this.readChildNodes(e,r),t.authorityURLs[i]=r.href},Identifier:function(e,t){var i=e.getAttribute("authority");t.identifiers[i]=this.getChildValue(e)},KeywordList:function(e,t){this.readChildNodes(e,t)},SRS:function(e,t){t.srs[this.getChildValue(e)]=!0}}},CLASS_NAME:"GeoGlobe.Format.WMSCapabilities.v1"}),GeoGlobe.Format.WMSCapabilities.v1_1=GeoGlobe.Class4OL(GeoGlobe.Format.WMSCapabilities.v1,{readers:{wms:GeoGlobe.Util.applyDefaults({WMT_MS_Capabilities:function(e,t){this.readChildNodes(e,t)},Keyword:function(e,t){t.keywords&&t.keywords.push(this.getChildValue(e))},DescribeLayer:function(e,t){t.describelayer={formats:[]},this.readChildNodes(e,t.describelayer)},GetLegendGraphic:function(e,t){t.getlegendgraphic={formats:[]},this.readChildNodes(e,t.getlegendgraphic)},GetStyles:function(e,t){t.getstyles={formats:[]},this.readChildNodes(e,t.getstyles)},PutStyles:function(e,t){t.putstyles={formats:[]},this.readChildNodes(e,t.putstyles)},UserDefinedSymbolization:function(e,t){var i={supportSLD:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("SupportSLD")),userLayer:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("UserLayer")),userStyle:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("UserStyle")),remoteWFS:1===_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e.getAttribute("RemoteWFS"))};t.userSymbols=i},LatLonBoundingBox:function(e,t){t.llbbox=[_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("minx")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("miny")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("maxx")),_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()(e.getAttribute("maxy"))]},BoundingBox:function(e,t){var i=GeoGlobe.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[e,t]);i.srs=e.getAttribute("SRS"),t.bbox[i.srs]=i},ScaleHint:function(e,t){var i=e.getAttribute("min"),r=e.getAttribute("max"),n=Math.pow(2,.5),o=GeoGlobe.INCHES_PER_UNIT.m;0!==i&&(t.maxScale=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()((i/n*o*GeoGlobe.DOTS_PER_INCH).toPrecision(13))),r!==Number.POSITIVE_INFINITY&&(t.minScale=_babel_runtime_corejs2_core_js_parse_float__WEBPACK_IMPORTED_MODULE_12___default()((r/n*o*GeoGlobe.DOTS_PER_INCH).toPrecision(13)))},Dimension:function(e,t){var i={name:e.getAttribute("name").toLowerCase(),units:e.getAttribute("units"),unitsymbol:e.getAttribute("unitSymbol")};t.dimensions[i.name]=i},Extent:function(e,t){var i=e.getAttribute("name").toLowerCase();if(i in t.dimensions){var r=t.dimensions[i];r.nearestVal="1"===e.getAttribute("nearestValue"),r.multipleVal="1"===e.getAttribute("multipleValues"),r.current="1"===e.getAttribute("current"),r.default=e.getAttribute("default")||"";var n=this.getChildValue(e);r.values=n.split(",")}}},GeoGlobe.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"GeoGlobe.Format.WMSCapabilities.v1_1"}),GeoGlobe.Format.WMSCapabilities.v1_1_0=GeoGlobe.Class4OL(GeoGlobe.Format.WMSCapabilities.v1_1,{version:"1.1.0",readers:{wms:GeoGlobe.Util.applyDefaults({SRS:function(e,t){for(var i=this.getChildValue(e).split(/ +/),r=0,n=i.length;r=1&&(a=r.tileMatrixSets[i.tileMatrixSetLinks[0].tileMatrixSet]);if(!a)throw new Error("matrixSet not found");for(n=0,o=i.styles.length;n=1&&(a=r.tileMatrixSets[i.tileMatrixSetLinks[0].tileMatrixSet]);if(!a)throw new Error("matrixSet not found");for(n=0,o=i.styles.length;n0&&this.runChildNodes(i,t[0]),i},runChildNodes:function(e,t,i){for(var r,n,o=t.childNodes,a=0;a/g,"/>")).replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,""),t.sort||(t=t.split(","));var r=this.no_fast_endings(e);r=this.attris_to_tags(r),r=(r=escape(r)).split("%3C").join("<").split("%3E").join(">").split("%3D").join("=").split("%22").join('"');for(var n=0;n","g"),"*$**"+t[n]+"**$*")).replace(new RegExp("","g"),"*$***"+t[n]+"**$*");r=""+r+"",this.xmlobject={};var o=this.xml_to_object(r).JSONTAGWRAPPER;return i&&(o=this.show_json_structure(o,i)),o},xml_to_object:function xml_to_object(xmlcode){var x=xmlcode.replace(/<\//g,"?");x=x.split("<");for(var y=[],level=0,opentags=[],i=1;i")[0];for(opentags.push(tagname),level++,y.push(level+"<"+x[i].split("?")[0]);x[i].indexOf("?"+opentags[opentags.length-1]+">")>=0;)level--,opentags.pop()}for(var oldniva=-1,objname="this.xmlobject",i=0;i")[0];tagnamn=tagnamn.replace(/%3A/,"_");var rest=y[i].split(">")[1];if(niva<=oldniva)for(var tabort=oldniva-niva+1,j=0;j")),"'"===rest.charAt(0)&&(rest="unescape("+rest+")"),already&&!eval(objname+".sort")&&(preeval+=objname+"=["+objname+"];\n");var before="=";after="",already&&(before=".push(",after=")");var toeval=preeval+objname+before+rest+after;eval(toeval),eval(objname+".sort")&&(objname+="["+eval(objname+".length-1")+"]"),oldniva=niva}return this.xmlobject},show_json_structure:function(e,t,i){var r="";for(var n in e.sort?r+="[\n":r+="{\n",e)e.sort||(r+=n+":"),"object"===_babel_runtime_corejs2_helpers_typeof__WEBPACK_IMPORTED_MODULE_11___default()(e[n])?r+=this.show_json_structure(e[n],!1,1):"function"==typeof e[n]?r+=e[n]+"":"string"!=typeof e[n]?r+=e[n]+",\n":r+="'"+e[n].replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")+"',\n";if(e.sort?r+="],\n":r+="},\n",!i){var o=(r=(r=(r=r.substring(0,r.lastIndexOf(","))).replace(new RegExp(",\n}","g"),"\n}")).replace(new RegExp(",\n]","g"),"\n]")).split("\n");r="";var a=0;for(n=0;n=0||o[n].indexOf("]")>=0)&&a--,tabs="";for(var s=0;s=0||o[n].indexOf("[")>=0)&&a++}"html"===t&&(r=(r=r.replace(//g,">")).replace(/\n/g,"
").replace(/\t/g,"    ")),"compact"===t&&(r=r.replace(/\n/g,"").replace(/\t/g,""))}return r},no_fast_endings:function(e){e=e.split("/>");for(var t=1;t"+e[t]}return e.join("")},attris_to_tags:function(e){var t=" =\"'".split("");e=e.split(">");for(var i=0;i")).replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2"/g,">").replace(/"0)for(var r=0,n=i.length;r0)for(var r=0,n=i.length;r/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function r(e,t,i,r){for(var n=0;n0&&r(e.arrayAccessFormPaths,t,i,n)&&(t[i]=[t[i]])}function o(e){var t=e.split(/[-T:+Z]/g),i=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(i.setHours(t[3],t[4],r[0]),r.length>1&&i.setMilliseconds(r[1]),t[6]&&t[7]){var n=60*t[6]+Number(t[7]);n=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*n:n),i.setMinutes(i.getMinutes()-n-i.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(i=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())));return i}function a(t,i,n,o){return!(1===i&&e.xmlElementsFilter.length>0)||r(e.xmlElementsFilter,t,n,o)}function s(i,x){if(9===i.nodeType){for(var l=new Object,c=i.childNodes,u=0;u0){var a=n.split(".#")[0];return r(e.datetimeAccessFormPaths,t,i,a)?o(t):t}return t}(l.__text,f,x+"."+f)),null!==l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"===e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0===l.__cnt&&"text"===e.emptyNodeForm?l="":1===l.__cnt&&null!==l.__text?l=l.__text:1!==l.__cnt||null===l.__cdata||e.keepCData?l.__cnt>1&&null!==l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""===l.__text||""===l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null===l.__text&&null===l.__cdata||(l.toString=function(){return(null!==this.__text?this.__text:"")+(null!==this.__cdata?this.__cdata:"")}),l}if(3===i.nodeType||4===i.nodeType)return i.nodeValue}function x(t,r,n,o){var a="<"+(null!==t&&null!==t.__prefix?t.__prefix+":":"")+r;if(null!==n)for(var s=0;s":">")}function l(e,t){return""}function c(t,i){return"property"===e.arrayAccessForm&&(n="_asArray",-1!==(r=i.toString()).indexOf(n,r.length-n.length))||0===i.toString().indexOf(e.attributePrefix)||0===i.toString().indexOf("__")||t[i]instanceof Function;var r,n}function u(e){var t=0;if(e instanceof Object)for(var i in e)c(e,i)||t++;return t}function h(t){var i=[];if(t instanceof Object)for(var r in t)-1===r.toString().indexOf("__")&&0===r.toString().indexOf(e.attributePrefix)&&i.push(r);return i}function f(t){var r,n,o="";return t instanceof Object?o+=(n="",null!==(r=t).__cdata&&(n+=""),null!==r.__text&&(e.escapeMode?n+=i(r.__text):n+=r.__text),n):null!==t&&(e.escapeMode?o+=i(t):o+=t),o}function d(e,t){return""===e?t:e+"."+t}function g(e,t,i,r){var n="";if(0===e.length)n+=x(e,t,i,!0);else for(var o=0;o0)for(var m in t)if(!c(t,m)&&(""===i||(n=t,o=m,a=d(i,m),0===e.jsonPropertiesFilter.length||""===a||r(e.jsonPropertiesFilter,n,o,a)))){var b=t[m],v=h(b);null===b||null===b?s+=x(b,m,v,!0):b instanceof Object?b instanceof Array?s+=g(b,m,v,i):b instanceof Date?(s+=x(b,m,v,!1),s+=b.toISOString(),s+=l(b,m)):u(b)>0||null!==b.__text||null!==b.__cdata?(s+=x(b,m,v,!1),s+=p(b,d(i,m)),s+=l(b,m)):s+=x(b,m,v,!0):(s+=x(b,m,v,!1),s+=f(b),s+=l(b,m))}return s+f(t)}this.parseXmlString=function(e){var t,i=window.ActiveXObject||"ActiveXObject"in window;if(void 0===e)return null;if(window.DOMParser){var r=new window.DOMParser,n=null;if(!i)try{n=r.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){n=null}try{t=r.parseFromString(e,"text/xml"),null!==n&&t.getElementsByTagNameNS(n,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0===e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?o(e):e},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!==t?this.xml2json(t):null},this.json2xml_str=function(e){return p(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},e.GeoGlobe.Format.X2JS.CLASS_NAME="GeoGlobe.Format.X2JS"}(window),GeoGlobe.Query.Service=GeoGlobe.Class4OL({name:null,url:null,version:null,userid:"test@liferay.com",initialize:function(e,t,i){this.name=e,this.url=t,GeoGlobe.Util.extend(this,i)},getCapabilities:function(e,t){},isExist:function(){},failFn:function(e){alert("服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+this.url+"\n操作类型:"+e)},_parseToXML:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),(new GeoGlobe.Format.XML).read(t)},_checkIsError:function(e){return(new GeoGlobe.Format.XML).read(e).selectNodes("ServiceExceptionReport").length>0?this._parseToJSON(e):null},_isException:function(e){return!(!e||!e.ServiceExceptionReport)},_parseToJSON:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},CLASS_NAME:"GeoGlobe.Query.Service"}),GeoGlobe.Query.RouteQuery=GeoGlobe.Class4OL(GeoGlobe.Query.Service,{_format:null,initialize:function(e,t,i){this.name=e,this.url=t,this._format=new GeoGlobe.Format.RouteQuery,GeoGlobe.Util.extend(this,i)},getCapabilities:function(e,t){var i=this.url;GeoGlobe.loadURL(i,{REQUEST:"GetCapabilities"},this,e,t)},findRoute:function(e,t,i){var r={REQUEST:"FindRoute",SERVICE:"ROUTE",VERSION:"1.0.0"};for(var n in{data:!0,orig:!0,dest:!0})if(!(n in e))throw new Error("Missing property '"+n+"'");r.DATA=e.data,r.ORIG=e.orig,r.DEST=e.dest,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.radius&&void 0!==e.radius&&(r.RADIUS=e.radius),null!==e.queryType&&void 0!==e.queryType&&(r.QUERYTYPE=e.queryType),null!==e.midpos&&void 0!==e.midpos&&(r.MIDPOS=e.midpos),null!==e.avoidPos&&void 0!==e.avoidPos&&(r.AVOIDPOS=e.avoidPos),null!==e.filterRoute&&void 0!==e.filterRoute&&(r.FILTERROUTE=e.filterRoute),null!==e.resultCount&&void 0!==e.resultCount&&(r.RESULTCOUNT=e.resultCount),GeoGlobe.Request.GET({url:this.url,params:r,async:!1,scope:this,success:function(e){var i=this._format.read(e.responseText);if("string"!=typeof i.exceptionInfo){var r=new GeoGlobe.Query.RoutesResult(i),n=r.routes,o=(new GeoGlobe.Format.GeoJSON).write(n),a=new GeoGlobe.Format.JSON;geojsonRoute=a.read(o),r.geojsonRoute=geojsonRoute,t(r)}else t(i)},failure:i})},getRouteInfo:function(e,t,i){var r={REQUEST:"GetRouteInfo",SERVICE:"ROUTE",VERSION:"1.0.0"};if(!e.data||!e.id)throw"Error!Not data and id for bus query.";r.DATA=e.data,r.ID=e.id,GeoGlobe.Request.GET({url:this.url,params:r,scope:this,success:function(e){var i=this._format.read(e.responseText);"string"!=typeof i.exceptionInfo?(i=new GeoGlobe.Query.RouteInfoResult(i),t(i)):t(i)},failure:i})},CLASS_NAME:"GeoGlobe.Query.RouteQuery"}),GeoGlobe.Format.RouteQuery=new GeoGlobe.Class4OL(GeoGlobe.Format.XML,{initialize:function(e){GeoGlobe.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){var t={},i=[];if("string"==typeof e&&(e=GeoGlobe.Format.XML.prototype.read.apply(this,[e])),e&&9===e.nodeType){i=[];var r=GeoGlobe.Format.XML.prototype.getChildEl.apply(this,[e]).nodeName;if("ServiceExceptionReport"===r){var n=GeoGlobe.Format.XML.prototype.getElementsByTagNameNS(e,"*","ServiceException")[0];return{exceptionInfo:GeoGlobe.Format.XML.prototype.getChildValue.apply(this,[n]),exceptionCode:n.getAttribute("code")}}for(var o=e.getElementsByTagName(r)[0].childNodes,a=0;a0){for(var n=r.split(" "),o=[],a=0,s=n.length;a0){for(var n=r.split(" "),o=[],a=0,s=n.length;a"+(t=t||this.maxPerPage)+""+(e=e||1)+""},_orderByToString:function(e,t){return e?""+e+"":""},_geometryToString:function(e){return'20,30 21,41 52,42 53,33 20,30'},_stringToGeometry:function(e){return GeoGlobe.Geometry.Polygon.createRegularPolygon(new GeoGlobe.Geometry.Point(360*Math.random()-160,90*Math.random()-70),Math.round(20*Math.random()),Math.round(10*Math.random()))},_parserFeatures:function(e){var t=new GeoGlobe.Format.GML;return t.gmlns="*",t.read(e)},_parserResponseText:function(e,t){if(t){var i=new RegExp("<"+t+">",["g"]),r=new RegExp("",["g"]);e=(e=e.replace(i,"<"+t+">")).replace(r,"")}return(e=(e=(e=e.replace(//g,"")).replace(/<\/gml:LineString>/g,"")).replace(//g,"")).replace(/<\/gml:Point>/g,"")},_parserFeaturesNew:function(e,t){var i=new GeoGlobe.Format.GML;return i.gmlns="*",t&&(i.featureName=t),i.read(e)},_parserSuccessResult:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},_parseToXML:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),(new GeoGlobe.Format.XML).read(t)},_parseToJSON:function(e){return(new GeoGlobe.Format.XML2JSON).read(e)},queryTransferScheme:function(e,t,i){var r={request:"QueryTransferScheme",SERVICE:"BUS",VERSION:"1.0.0"};for(var n in{networkName:!0,transferMode:!0,startInput:!0,endInput:!0})if(!(n in e))throw new Error("缺少必选属性:'"+n+"'。");r.networkName=e.networkName,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.transferMode&&void 0!==e.transferMode&&(r.TRANSFERMODE=e.transferMode),null!==e.startInput&&void 0!==e.startInput&&(r.STARTINPUT=e.startInput),null!==e.endInput&&void 0!==e.endInput&&(r.ENDINPUT=e.endInput),null!==e.inputMode&&void 0!==e.inputMode&&(r.INPUTMODEL=e.inputMode),null!==e.ExistGoTime&&void 0!==e.ExistGoTime&&(r.EXISTGOTIME=e.ExistGoTime),null!==e.StartTime&&void 0!==e.StartTime&&(r.STARTTIME=e.StartTime),null!==e.MaxSearchDistance&&void 0!==e.MaxSearchDistance&&(r.MAXSEARCHDISTANCE=e.MaxSearchDistance),null!==e.PrioritySubset&&void 0!==e.PrioritySubset&&(r.PRIORITYSUBSET=e.PrioritySubset),null!==e.ExistAbsolutePriority&&void 0!==e.ExistAbsolutePriority&&(r.EXISTABSOLUTEPRIORITY=e.ExistAbsolutePriority),null!==e.LagSubset&&void 0!==e.LagSubset&&(r.LAGSUBSET=e.LagSubset),null!==e.OutputPage&&void 0!==e.OutputPage&&(r.OUTPUTPAGE=e.OutputPage),null!==e.PageSize&&void 0!==e.PageSize&&(r.PAGESIZE=e.PageSize),null!==e.ChangeCount&&void 0!==e.ChangeCount&&(r.CHANGECOUNT=e.ChangeCount),GeoGlobe.Request.GET({url:this.url,params:r,async:!1,scope:this,success:GeoGlobe.Function.bind((function(e){var i=e.responseXML,r={startPoint:[],transferScheme:[],endPoint:[]};if(!i)return t(r),r;var n=new GeoGlobe.Format.XML,o=i.selectNodes("/ServiceExceptionReport/ServiceExceptionMessage");if(o&&o.length>0)return t(r),r;var a=i.selectNodes("/QueryTransferSchemeResponse"),s=n.write(a[0]),x=this._parseToJSON(s),l=x.QueryTransferSchemeResponse.StartPoint;GeoGlobe.Util.isArray(l)||(l=[l]);var c=x.QueryTransferSchemeResponse.EndPoint;GeoGlobe.Util.isArray(c)||(c=[c]);var u=x.QueryTransferSchemeResponse.TransferScheme,h=this._getPointGeometryByGMLPointStr(l[0].Geometry.gml_Point),f=new GeoGlobe.Feature(h),d=this._getPointGeometryByGMLPointStr(c[0].Geometry.gml_Point),g=new GeoGlobe.Feature(d),p=this._parserTransferScheme(u);t(r={startPoint:f,transferScheme:p,endPoint:g})}),this),failure:i})},_parserTransferScheme:function(e){GeoGlobe.Util.isArray(e)||(e=[e]);for(var t=new Array,i=0;i0)return r;var a=i.selectNodes("/QueryKeyWordResponse"),s=n.write(a[0]),x=this._parseToJSON(s);if(1===t){var l=x.QueryKeyWordResponse.Stations.Station;l&&!GeoGlobe.Util.isArray(l)&&(l=[l]);for(var c=0;c0){var o=t.write(r[0]);n=this._parseToJSON(o).Lines.Line,GeoGlobe.Util.isArray(n)||(n=[n])}return n;case"Passageways":r=i.selectNodes("/QueryStationInfoResponse");var a=new Array;if(r.length>0){o=t.write(r[0]);var s=this._parseToJSON(o).QueryStationInfoResponse.StationInfo.Passageways;s&&(a=s.Passageway,GeoGlobe.Util.isArray(a)||(a=[a]))}return a;default:return[]}},queryLineInfo:function(e,t,i){var r={REQUEST:"QueryLineInfo",SERVICE:"BUS",VERSION:"1.0.0"};if(!e.networkName)throw"Error!Not network name for bus query.";if(null===e.lineId||void 0===e.lineId||""===e.lineId)throw"Error!Not lineId for bus query.";r.NETWORKNAME=e.networkName,null!==e.service&&void 0!==e.service&&(r.SERVICE=e.service),null!==e.version&&void 0!==e.version&&(r.VERSION=e.version),null!==e.lineId&&void 0!==e.lineId&&(r.LINEID=e.lineId),null!==e.startNodeNumber&&void 0!==e.startNodeNumber&&(r.STARTNODENUMBER=e.startNodeNumber),null!==e.endNodeNumber&&void 0!==e.endNodeNumber&&(r.ENDNODENUMBER=e.endNodeNumber),GeoGlobe.Request.GET({url:this.url,params:r,scope:this,success:function(e){var i=[],r=null;if(e.responseXML){var n=(r=e.responseXML).selectNodes("/ServiceExceptionReport/ServiceExceptionMessage");if(n&&n.length>0)return void t(i);for(var o=new GeoGlobe.Format.XML,a=this._parserQueryLineInfoNode("Line",o,r),s=new Array,x=0;x0)return t(r),r;var o=this._parserResponseText(e.responseText);r=this._parserFeaturesNew(o,"Stations"),t(r)}})},_queryByName:function(e,t,i){var r=this,n=null;return r.queryKeyWord({networkName:r.networkName,keyWord:e,keyWordType:1,SEARCHTYPE:2},(function(e){if(0!==e.length){var o=e[0].geometry.x+" "+e[0].geometry.y;r.queryKeyWord({networkName:r.networkName,keyWord:t,keyWordType:1,SEARCHTYPE:2},(function(e){if(0!==e.length){var t=e[0].geometry.x+" "+e[0].geometry.y;n=r._queryTransferScheme(o,t,i)}else alert("没有查询到终点")}))}else alert("没有查询到起点")})),n},queryBus:function(e,t,i){var r=this,n=null;return r.getCapabilities(GeoGlobe.Function.bind((function(o){var a=o.responseXML;a&&a.documentElement||(a=o.responseText);var s=(new GeoGlobe.Format.BusCapabilities).read(a);if(s.capability){var x=s.capability.networks[0];if(r.networkName=x,"string"==typeof e&&"string"==typeof t)n=r._queryByName(e,t,i);else{var l=e.lng+" "+e.lat,c=t.lng+" "+t.lat;n=r._queryTransferScheme(l,c,i)}}else alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")}),this),(function(){alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")})),{flag:!!n,featuresInfo:n}},failFn:function(){alert("公交服务请求失败,请检查服务是否正常运行或请求地址是否正确。\n请求地址:"+url+"\n操作类型:GetCapabilities")},_queryTransferScheme:function(e,t,i){return this.queryTransferScheme({networkName:this.networkName,transferMode:i||0,inputMode:0,startInput:e,endInput:t},(function(e){featuresInfo=e})),this.transferScheme=featuresInfo.transferScheme,featuresInfo},queryBusTransferSchemeByIndex:function(e){var t=null,r=_babel_runtime_corejs2_core_js_parse_int__WEBPACK_IMPORTED_MODULE_7___default()(e),n=this.transferScheme[r].SectionInfo,o=new Array,a=new Array;for(i=0;i0?i[0]:null},Element.prototype.selectSingleNode=function(e){if(this.ownerDocument.selectSingleNode)return this.ownerDocument.selectSingleNode(e,this);throw"For XML Elements Only"}),GeoGlobe.Query.WFSQuery=GeoGlobe.Class4OL({url:null,version:"1.0.0",featureNS:null,isReverse:!1,featurePrefix:"",featureType:"",maxFeatures:10,filter:null,geometryName:"the_geom",protocol:null,format:null,formatOptions:null,isSeparate:!1,srsName:"EPSG:4326",time:null,userecent:!0,sortBy:null,groupBy:null,resultType:"Results",startPosition:null,initialize:function(e,t,i){this.url=e,this.featureType=t;var r=null;i&&(!0===i.isReverse||!1===i.isReverse?(this.isReverse=i.isReverse,r=!i.isReverse):r=!this.isReverse,i.format?(i.format instanceof GeoGlobe.Format.GML.v2||i.format instanceof GeoGlobe.Format.GML.v3)&&i.format.setFeatureType_(t):this.format=new GeoGlobe.Format.GML({xy:r})),GeoGlobe.Util.extend(this,i)},query:function(e,t,i){this.protocol=new GeoGlobe.Protocol.WFS({readFormat:this.format,formatOptions:this.formatOptions,propertyNames:this.propertyNames,maxFeatures:this.maxFeatures,featurePrefix:this.featurePrefix,featureNS:this.featureNS,url:this.url,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent,srsName:this.srsName});var r=e||this.filter,n=t||this.successFn,o=i||this.failFn,a=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;this.isSeparate&&(t=this._separateFeatures(t));var i=this._read_trueName(e);i&&(t.trueNames=i);var r=(new GeoGlobe.Format.GeoJSON).write(t),a=(new GeoGlobe.Format.JSON).read(r);n({features:t,geojson:a})}else o()}),this);this.response=this.protocol.read({sortBy:this.sortBy,filter:r,callback:a})},queryPage:function(e,t,i,r){var n=r&&r.perPageNumber||15,o=((r&&r.pageNumber||1)-1)*n+1;this.protocol=new GeoGlobe.Protocol.WFS({readFormat:this.format,multi:!0,formatOptions:this.formatOptions,propertyNames:this.propertyNames,maxFeatures:n,startPosition:o,featurePrefix:this.featurePrefix,url:this.url,featureNS:this.featureNS,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent,srsName:this.srsName});var a=e||this.filter,s=t||this.successFn,x=i||this.failFn,l=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;this.isSeparate&&(t=this._separateFeatures(t));var i=this._read_trueName(e);t.trueNames=i;var r=(new GeoGlobe.Format.GeoJSON).write(t),n=(new GeoGlobe.Format.JSON).read(r);s({features:t,geojson:n})}else x()}),this);this.response=this.protocol.read({sortBy:this.sortBy,filter:a,callback:l})},queryTotalNumber:function(e,t,i){var r=new GeoGlobe.Format.WFSHits;this.protocol=new GeoGlobe.Protocol.WFS({readFormat:r,propertyNames:this.propertyNames,resultType:"hits",maxFeatures:this.maxFeatures,featurePrefix:this.featurePrefix,featureNS:this.featureNS,url:this.url,version:this.version,geometryName:this.geometryName,featureType:this.featureType,time:this.time,userecent:this.userecent});var n=e||this.filter,o=t||this.successFn,a=i||this.failFn,s=GeoGlobe.Function.bind((function(e){if(e.success()){var t=e.features;o(t)}else a()}),this);this.response=this.protocol.read({filter:n,callback:s})},_read_trueName:function(e){var t=[];if(e.priv&&e.priv.responseText){if(null===this.format)return null;var i=this.format.getXMLDoc().getElementsByTagName("trueName");if(null===i||0===i.length)return null;for(var r=0;r0){t=new GeoGlobe.LngLatBounds;for(var i=null,r=0,n=e.length;r0&&(i=e.results)&&(t.results=this._analysis_GeoCodeResult_statistics(i))}return t},_analysis_GeoCodeResult_results:function(e){var t=[];if(GeoGlobe.Util.isArray(e)){for(var i=0,r=e.length;i0?this._parseToJSON(e):null},_isException:function(e){return!(!e||!e.ServiceExceptionReport)},_parseToJSON:function(e){return(new GeoGlobe.Util.Format.XML2JSON).read(e)},CLASS_NAME:"GeoGlobe.Service"}),GeoGlobe.Service.WFST=GeoGlobe.Class4OL(GeoGlobe.Service,{xy:!0,initialize:function(e,t,i){GeoGlobe.Service.prototype.initialize.apply(this,arguments)},getCapabilities:function(e,t){var i=this.url,r={REQUEST:"GetCapabilities",SERVICE:"WFS",VERSION:"1.0.0"};t||(t=function(){this.failFn(r.REQUEST)}),GeoGlobe.loadURL(i,r,this,(function(t){e(t)}),t)},isExist:function(){var e=!1,t=this.url;return GeoGlobe.Request.GET({url:t,params:{REQUEST:"GetCapabilities",SERVICE:"WFS"},scope:this,async:!1,success:function(){e=!0}}),e},describeFeatureType:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"WFS",VERSION:"1.0.0",REQUEST:"DescribeFeatureType"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(e){t(e)}),i)},getFeature:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"WFS",VERSION:"1.0.0",REQUEST:"GetFeature"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(e){t(e)}),i)},lockFeature:function(e,t,i){this.url,GeoGlobe.Util.applyDefaults(e,{service:"WFS",version:"1.0.0",request:"LockFeature",expiry:1,lockAction:"ALL"});var r=this._parserFilterToString(e.filter),n=GeoGlobe.String.format('${filterXMLString}',{version:e.version,service:e.service,lockAction:e.lockAction,expiry:e.expiry,typeName:e.typeName,filterXMLString:r});i||(i=function(){this.failFn(e.request)}),new GeoGlobe.Request.POST({url:this.url,data:n,scope:this,success:t,failure:i})},transaction:function(e,t,i,r,n,o){var a=this.url;GeoGlobe.Util.applyDefaults(e,{service:"WFS",version:"1.0.0",request:"Transaction",releaseAction:"ALL"});var s=e.lockId,x="";s&&(x+=""+s+"");var l="";t&&(l+=this._getInsertString(t)),i&&(l+=this._getUpdateString(i)),r&&(l+=this._getDeleteString(r));var c=GeoGlobe.String.format('${lockIdString}${transactionString}',{releaseAction:e.releaseAction,version:e.version,service:e.service,lockIdString:x,transactionString:l});o||(o=function(){this.failFn(e.request)}),new GeoGlobe.Request.POST({url:a,data:c,scope:this,success:n,failure:o})},parseTransactionResult:function(e){var t=(new GeoGlobe.Format.XML2JSON).read(e.responseText),i=new Array,r=this._objToArray(t.wfs_WFS_TransactionResponse.wfs_TransactionResult.wfs_Status),n=this._objToArray(t.wfs_WFS_TransactionResponse.wfs_InsertResults);if(!r)return i;for(var o=0;o'+this._getInsertFeatureString(o,i)+""}return r},_getInsertFeatureString:function(e,t){var i="";for(var r in e.attributes)"OID"!==r&&(i+=GeoGlobe.String.format("<${tag}>",{value:e.attributes[r]?e.attributes[r]:"",tag:r}));return i+=GeoGlobe.String.format("${geometry}",{geometry:this._getGeometryStringByFeature(e)}),GeoGlobe.String.format("<${typeName}>${content}",{typeName:t,content:i})},_getUpdateString:function(e){e.filter;for(var t=e.typeName,i=e.features,r="",n=0;n'+o+this._parserFilterToString(a)+""}return r},_getUpdatePropertyString:function(e){var t="";for(var i in e.data)"OID"!==i&&e.data[i]&&(t+="");return t+"Geometry"+this._getGeometryStringByFeature(e)+""},_getGeometryStringByFeature:function(e){var t=new GeoGlobe.Format.GML({xy:this.xy});t.buildCoordinatesNode=GeoGlobe.Function.bind((function(e){var t=this.createElementNS(this.gmlns,"gml:coordinates");t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," ");var i=[];if(e instanceof GeoGlobe.LngLatBounds)this.xy?(i.push(e.left+","+e.bottom),i.push(e.right+","+e.top)):(i.push(e.bottom+","+e.left),i.push(e.top+","+e.right));else for(var r=e.components?e.components:[e],n=0;n';var o=new GeoGlobe.Filter.FeatureId({fids:[t.fids[n]]});r+=this._parserFilterToString(o),r+=""}return r},_parserFilterToString:function(e){if(e){var t=(new GeoGlobe.Format.Filter.v1).write(e);return(new GeoGlobe.Format.XML).write(t)}return""},CLASS_NAME:"GeoGlobe.Service.WFST"}),GeoGlobe.Service.CTS=GeoGlobe.Class4OL(GeoGlobe.Service,{initialize:function(e,t,i){GeoGlobe.Service.prototype.initialize.apply(this,arguments)},getCapabilities:function(e,t){var i=this.url,r={REQUEST:"GetCapabilities",SERVICE:"CTS"};t||(t=function(){this.failFn(r.REQUEST)}),GeoGlobe.loadURL(i,r,this,(function(t){e(t)}),t)},isExist:function(){var e=!1,t=this.url;return GeoGlobe.Request.GET({url:t,params:{REQUEST:"GetCapabilities",SERVICE:"CTS"},scope:this,async:!1,success:function(){e=!0}}),e},TransCoords:function(e,t,i){var r=this.url;GeoGlobe.Util.applyDefaults(e,{SERVICE:"CTS",REQUEST:"TransCoords"}),i||(i=function(){this.failFn(e.REQUEST)}),GeoGlobe.loadURL(r,e,this,(function(i){if("xml"===e.FORMAT){var r={},n=i.responseXML;GeoGlobe.Function.bind(this.xmltoJson,this);var o=this.xmltoJson(n);r.attributes=o.CTS_TransResult["cts:Coordinate"].attributes.dim;for(var a=o.CTS_TransResult["cts:Coordinate"].text.split(","),s=[],x=0;x0){t.attributes={};for(var i=0;i0){t.attributes={};for(var i=0;i0)for(var c=0,u=l.length;c0){t.attributes={};for(var i=0;iBufferInputPolygon'+(new GeoGlobe.Format.GML).write(e)+"BufferDistance"+t+"BufferType"+this.type+"BufferAccuracy"+this.accuracy+"BufferedPolygon"},_getFeaturesCenter:function(e){return this._getFeaturesExtent(e).getCenterLonLat()},_getFeaturesExtent:function(e){GeoGlobe.Util.isArray(e)||(e=[e]);var t=null;if(e&&e.length>0){t=new GeoGlobe.LngLatBounds;for(var i=null,r=0,n=e.length;rsourceMaxZoom){var a=[0,0,4096,4096],i=o-sourceMaxZoom,p=r-(r>>i<>i<Click to add first point

","random",")

","

Double click to finish drawing

","LEFT_DOUBLE_CLICK","cartographicArrayToCartesianArray","Rectangle","northwest","southwest","startDrawingTailedAttack","firstTime","test","

点击以增加第一个控制点

","单击以增加一个新的控制点","poly","

双击可结束绘制

","startDrawingExtent","ExtentPrimitive","

拖动改变箭头

再次点击结束绘制

","setEditable","_editable","executeListeners","dragEnd","_highlighted","_strokeColor","fromCssColorString","white","_markers","onEdited","EllipsoidGeodesic","interpolateUsingFraction","billBoard","removeBillboard","index","Drag to create a new point","_editMarkers","_globeClickhandler","Extent","cartesianArrayToCartographicArray","doubleArrow","拖动以钳击形状","PolygonPrimitive单击","拖动以改变形状","TailedAttackPrimitive单击","DrawHelperWidget","Container is required","./img/glyphicons_242_google_maps.png","./img/glyphicons_097_vector_path_line.png","./img/qianjijiantou.png","./img/glyphicons_095_vector_path_circle.png","./img/zhijiaojiantou.png","DIV","button","title","onclick","SPAN","IMG","extentIcon","点击以绘制直箭头","extentCreated","点击以绘制钳击箭头","polygonCreated","点击以绘制攻击箭头","tailedAttackCreated","clearIcon","addToolbar","ClearWidget","DrawWidget","west","east","south","north","EPSILON7","pow","toFixed","twipsy-arrow","twipsy-inner","_div","block","none","_title","undefined","constructor","_listeners","addListener","getCircleCenterOfThreePoints","getIntersectPoint","getAzimuth","getPointOnLine","getCubicValue","getArcPoints","FITTING_COUNT","getBisectorNormals","ZERO_TOLERANCE","getCurvePoints","getLeftMostControlPoint","getRightMostControlPoint","getNormal","getBinomialFactor","getFactorial","getQuadricBSplineFactor","MeasureAreaWidget","tags","tag","userAgent","MeasureAreaWidget_draw_point","WHITE","MeasureAreaWidget_draw_label","measureEnd","selectFeatures","indexOf","polygon","YELLOW","delete","MeasureAreaWidget_draw_polygon","MeasureAreaWidget_","area","km²","MeasureAzimuthWidget","hideInfobox","MeasureAzimuthWidget_result_label","FILL_AND_OUTLINE","18px KaiTi","CADETBLUE","Cesium3DTileset","warn","单击结束绘制","MeasureAzimuthWidget_draw_polyline","MeasureAzimuthWidget_","PolylineArrowMaterialProperty","AQUA","_polylineGraphicsAzimuth","PolylineDashMaterialProperty","_polylineGraphicsNorth","polyline","point","coordinates","12px sans-serif","角度:","showInfobox","display","selectionIndicator","infoBox","MeasureCoordinateWidget","请点击模型","MeasureCoordinateWidget_","MeasureCoordinateWidget_draw_coordinate","MeasureCoordinateWidget_result_label","经度:","纬度:","高程:","collection","MeasureDistanceWidget","MeasureDistanceWidget_draw_point","flag","!cartesian","MeasureDistanceWidget_draw_label","MeasureDistanceWidget_draw_polyline","总长:","_polylineCollection","_polyline","_primitives","MeasureDistanceWidget_result_label","lerp","MeasureElevationWidget_","高程值:","MeasureElevationWidget","MeasureElevationWidget_result_label","MeasureHeightWidget","MeasureHeightWidget_draw_point","MeasureHeightWidget_draw_polyline","GREEN","水平距离:","垂直高度:","空间距离:","result_labelHeight","MeasureHeightWidget_result_labelHeight","MeasureSlopeWidget","_camera","_canvas","_lineColor","_lineWidth","text","MeasureSlopeWidget_draw_polyline","MeasureSlopeWidget_","PolylineArrow","MeasureSlopeWidget_draw_label","单击开始绘制","atan","MeasureSlopeWidget_result_label_","LabelStyle","16px KaiTi","MeasureVolumeWidget","_designElevation","_samplingPointsNumber","samplingPointsNumber","_depthTestAgainstTerrain","depthTestAgainstTerrain","_classificationPrimitives","_pickedClassificationPrimitives","_tin","_minHeight","_maxHeight","MeasureVolumeWidget_","MeasureVolumeWidget_draw_label","_volumeResult","then","addClassificationPrimitive","addVerticalPolylines","addBasePolygon","_classificationPrimitive","BLUE","_interpolationPoints","features","_verticalPolylines","MeasureVolumeWidget_draw_vertical_polylines","properties","lineString","bboxPolygon","randomPoint","booleanPointInPolygon","ceil","FeatureCollection","Feature","Point","apply","getVolume","intersection","vertexSerial","excavationVolume","excavationArea","fillVolume","fillArea","baseArea","volume","底面积:","km³","_resultLabels","MeasureVolumeWidget_result_label_volume","getGeometryInstanceAttributes","_polylines","toValue","updateBaseElevation","updateClassificationPrimitive","体积:","updateVerticalPolylinesAndBasePolygon","ClassificationPrimitive","MeasureVolumeWidget_draw_base_polygon","miles","convex","steps","edgeWidth","edgeColor","cylinderRadius","clippingModeUnion","enabled","clippingPlanes","modelEntityClippingPlanes","computePlanes","ClippingPlane","createClippingPlanes","ClippingPlaneCollection","GeoFlood","cartesianArrayHeights","fragmentShader","normalMapUrl","createWaterFace","creatPrimitive","Water","PolygonHierarchy","VERSION","parseFloat","varying vec3 v_positionMC;\n\t\t\t\t\tvarying vec3 v_positionEC;\n\t\t\t\t\tvarying vec2 v_st;\n\t\t\t\t\t\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tczm_materialInput materialInput;\n\t\t\t\t\t\tvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\t\t\t\t\t#ifdef FACE_FORWARD\n\t\t\t\t\t\tnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\t\t\t\t\t#endif\n\t\t\t\t\t\tmaterialInput.s = v_st.s;\n\t\t\t\t\t\tmaterialInput.st = v_st;\n\t\t\t\t\t\tmaterialInput.str = vec3(v_st, 0.0);\n\t\t\t\t\t\tmaterialInput.normalEC = normalEC;\n\t\t\t\t\t\tmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\t\t\t\t\t\tvec3 positionToEyeEC = -v_positionEC;\n\t\t\t\t\t\tmaterialInput.positionToEyeEC = positionToEyeEC;\n\t\t\t\t\t\tczm_material material = czm_getMaterial(materialInput);\n\t\t\t\t\t#ifdef FLAT\n\t\t\t\t\t\tgl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\t\t\t\t\t#else\n\t\t\t\t\t\tgl_FragColor = czm_phong(normalize(positionToEyeEC), material",", czm_lightDirectionEC","GeoLimitHeight","labelEntity","polygonPlaneEntity","targetHeight","labelOption","polygonPlaneOption","polygonFitOption","drawLabel","drawPolygonPlane","drawPolygonFit","clearLabelEntity","labelPosition","labelText","labelPixelOffset","labelFillColor","labelFont","18px 楷体","labelOutlineWidth","labelStyle","polygonPlanePerPositionHeight","polygonPlaneHeight","polygonPlaneMaterial","polygonPlaneOutline","polygonPlaneShow","clearPolygonFitPrimitive","polygonFitPositions","error","请输入有效的坐标数组!","polygonFitHeight","polygonFitExtrudedHeight","polygonFitColor","polygonFitPrimitive","clearAll","clearPolygonPlaneEntity","GeoPLSViewShed3D_LIGHTPOINT","GeoPLSViewShed3D_BOUNDARY","GeoPLSViewShed3D_DASHLINE","GeoPLSViewShed3D_ORIENTLINE","GeoPLSViewShed3D","groundPrimitives","_pointLightHeight","_pointLightPixelSize","pointLightPixelSize","_pointLightColor","pointLightColor","_boundaryWidth","boundaryWidth","_boundaryColor","boundaryColor","_orientLineWidth","orientLineWidth","_orientLineColor","orientLineColor","baseDEMLerpCfg","_intervalAnalysis","intervalAnalysis","_pointLightCamera","当前Cesium版本:",",点光源可视域分析暂不支持该版本,请更换至1.50以上的版本!","firstLeftClick","shadowMap","enableGeoPLSViewShed3D","_baseDEMLerpCfg","enable","angleInterval","timeInterval","num","boundaryPositionArr","startPointLng","startPointLat","startPointHgt","interpolationBase","visibleColor","invisibleColor","单击左键确定可视域位置","tipPosition","单击左键固定可视域半径","fromAlpha","视高:","半径:","BOTTOM","dynamicAnalysis","pointLightPosition","realTimeRadius","Camera","context","size","_pointLightRadius","depthBias","fromRadians","toCartesian","sort","terrainShadows","ShadowMode","ENABLED","GroundPolylineGeometry","GroundPolylinePrimitive","showBackground","backgroundColor","horizontalOrigin","verticalOrigin","pixelOffset","fillColor","outlineWidth","outlineColor","GeoProfile","getLerpValue","lng_origin","lat_origin","hgt_origin","lng_destination","lat_destination","hgt_destination","floor","samplingNum","minHeight","maxHeight","surfaceLen","YValueArray","addLenArray","lerpCoordnatesArray","drawChart","getElementById","onmousedown","clientX","onmousemove","clientY","onmouseup","init","剖面示意图","#ccc","bold","axis","
","12%","#aaa","solid","category","长度(米)","rgba(0.0, 128, 255, 0.6)","bolder","dashed","高程(米)","rgba(0.0,255.0,255.0,0.8)","setOption","table","tbody","innerHTML","起点经度:","投影距离:","起点纬度:","终点高程:","地表距离:","终点经度:","最高高程:","straightLen","最低高程:","oTable","originCoordanate","originImage","destinationCoordanate","clearChart","myChart","chartContainer","removeChild","GEOSIGHTLINE_TIP","REDLINE","GREENLINE","GeoSightline","observeRelativeHeight","targetRelativeHeight","observeImage","targetImage","objectsToExclude","observeActualPosition","targetActualPosition","observeEntity","targetEntity",",通视分析暂不支持该版本,请更换至1.50以上的版本!","destroyHandler","enableGeoSightline","pickFromRays","单击左键确定观察点","drillPickFromRay","clampToHeight","_entities","_array","GeoSkyLineVolume","skyLineShow","skylineShow","skyLineWidth","skyLineMaterial","skyLineVolumeMaterial","ORANGE","skyLineVolumeOutLine","skyLineVolumeOutLineColor","BLACK","extrudeRatio","skyLine","skyLineVolume","calculateSkyLinePositions","data","skyLinePositions","drawSkyLine","skyLineDepthFailMaterial","drawSkyLineVolume","cameraPosition","cameraHeight","天际线示意图","宽度(PX)","line","getPointDistance","interNumber","holeDepth","arrPoints","earth","sideMaterial","bottomMaterial","GeoExcavationRegion","samplingPoints","_sideMaterial","_interNumber","_depth","depth","StripeMaterialProperty","_entitys","_samplingPoints","_callback","_bottomMaterial","_vPolyline","_vertexNum","_excavationRegion","_arrayVertex","_outPoints","GeoTerrainSlope","shadingUniforms","updateMaterial","contour","spacing","selectedShading","slope","aspect","elevation","materials","elevationRampMaterial","minimumHeight","maximumHeight","contourMaterial","slopeRampMaterial","contourUniforms","ElevationContour","ElevationRamp","SlopeRamp","AspectRamp","image","getContext","createLinearGradient","#000000","addColorStop","#2747E0","#ffffff","#0a8d33","#afdd76","#f2b602","#eea706","#df7702","#a52100","#682b06","#6a2402","fillStyle","ElevationColorContour","max(contourMaterial.alpha, elevationRampMaterial.alpha)","SlopeColorContour","max(contourMaterial.alpha, slopeRampMaterial.alpha)","AspectColorContour","max(contourMaterial.alpha, aspectRampMaterial.alpha)","_ready","dirty","polys","isCartesian3Point","platSlot","content","bindTileset","_tileset","There is a tileset already, Only One Bind","platBodyDebug","tileLoad","showPlat","isPlatShow","isPlatDirty","clearPlatDirty","addPlatArea","platPickPoints","_show","getPlatArea","removePlatArea","number","_pickObject","_tile","_runtime","rootNodes","_boundingVolume","halfAxes","matOrg","createHalfMatrix","matOrgI","invertMatrix","matPrj","matPrjI","modelMatrix","computedMatrix","initBoxMatrixes","modelMatrixI","buffers","initRegionMatrixes","initializePlatPoly","buffer","byteOffset","BYTES_PER_ELEMENT","isPlatPoint","replaceCommandVertexBuffer","platPolys","toPlatBoxModel","toPlatModel","_header","boundingVolume","region","toPlatRegionModel","platModel","hitPlatTest","isUsed","toUnplatModel","platPickRegion","initPlatBodyDebug","createTileRegion","tileRegion","initializeCartographicPlatPoly","initializeCartesianPlatPoly","divideByScalar","initCompressPlane","_orientedBoundingBox","isPlatPointResult","mapPosition","compressPlane","isPlatPointNoResult","normal","isInsidedPoint","minY","isEqualFloat","_nodeCommands","BufferUsage","STATIC_DRAW","command","_vertexArray","_attributes","vertexBuffer","vertexArrayDestroyable","_vao","glDeleteVertexArray","_cachedGltf","_gltf","bufferViews","getBuffer","inverse","setColumn","createNormal","createMatrix","GEOVIEWRADAR_TIP","GEOVIEWRADAR_LIGHTPOINT","GeoViewRadar","pointLightHeight","boundingSphereStackPartitions","boundingSphereSlicePartitions","boundingSphereSubdivisions",",雷达分析暂不支持该版本,请更换至1.50以上的版本!","enableGeoViewRadar","单击左键确定雷达位置","单击左键固定雷达半径","ShadowMap","debugShow","_boundingSphere","slicePartitions","subdivisions","GEOVIEWSHED3D_TIP","GEOVIEWSHED3D_SPOTID","GeoViewShed3D","spotLightHeight","_shadowMapNum","_spotLightCameraList","expandShadowMapList","spotLightPosition","realTimeHeading","realTimePitching","realTimeDistance","realTimeFieldAngle","单击左键确定观察位置","单击左键固定视域范围","analysis","observePtCoordinate","frustumLength","frustumField","_terrainBias","enableGeoViewShed3D","lookAt","fromHsl","GeoVolumeCalculate_LINE","GeoVolumeCalculate_TIP","GeoVolumeCalculate_GON","GeoVolumeCalculate_DEGON","GeoVolumeCalculate_CORAL","designElevation","getValue","shift","polylineEntity","volumeAnalysis","VOLUME","designPolygonEntity","CORAL","polygonEntity","designPolygonEntity_coral","左键点击绘制,右键点击结束","15px sans-serif","SingleBuildingWidget","PrimitiveCollection","CORNFLOWERBLUE","highlightColor_click","highlightColor_move","_INTERSECTED_FLOOR","_INTERSECTED_FLOOR2","classificationPrimitiveCollection","extrudeToBuilding","_INTERSECTED_FLOOR3","baseHeight","sampleHeightSupported","sampleHeight","地形还未准备好!","建筑物基础高度baseHeight是必需的!","levels","GEO_SINGLEBUILDING","callback_click","_primitiveOptions","geometryInstances","toString","callback_move","highlightFloor","deActivate","removeInputAction","FlyAround","_pitch","_roll","speed","_distance","_positionCartographic","isFlying","deltaHeight","keyEvent","preRender","_play","_heading","deltaDistance","play","参数不可缺省!","_preRender","pause","continue","removeEventListener","keydown","shiftKey","deltaRadians","FreeFlight","direct","lat","planePrimitive","hpRoll","fromBehind","fixedFrameTransform","pathPosition","SampledPositionProperty","speedVector","hpRange","readyPromise","activeAnimations","ModelAnimationLoop","REPEAT","boundingSphere","range","PolylineGlowMaterialProperty","PALEGOLDENROD","addSample","JulianDate","now","headingPitchRollToFixedFrame","lon","postRender","keydownOption","keyCode","RouteFly","cartographicArray","pointArray","_stop","cartesian3","initialHeading","differentBearing","reduceBearing","HorizontalRadian","initializationFly","clock","startTime","stopTime","clockRange","CLAMPED","computeCirclularFlight","addSeconds","TRANSPARENT","TimeInterval","currentTime","multiplier","VerticalRadians","WalkBrowse","orientationAngle","point1","point2","point3","bearing1","bearing2","moveForward","lookRight","GeoCirclePipe","topRadius","bottomRadius","_numSubGeometrys","numSubGeometrys","_imageColor","imageColor","_rotationXPerFrame","rotationXPerFrame","_rotationYPerFrame","rotationYPerFrame","rotationZPerFrame","_instanceName","endRadian","_useImage","_image","_color","multiplyByTranslation","CirclePipeGeometry","_startRadian","_endRadian","MaterialAppearance","_waitForBuildingMaterial","onTick","onFrame","_circlePipePrimitive","fromRotationX","fromRotationY","fromRotationZ","_rotationZPerFrame","multiplyByMatrix3","Image","slices","onMouseEnter","onMouseLeave","_onMouseLeftClick","onMouseLeftClick","_previousEnter","_moveHandler","_clickHandler","images","instanceNames","_circlePipeCollection","_onMouseEnter","_onMouseLeave","instanceName","_center","_drawCommandAlpha","_drawCommandOpaque","_needUpdate","_va","_speed","_actived","actived","_lastTime","_maxRadius","_hSpeed","_life","_metallicFactor","metallicFactor","_roughnessFactor","roughnessFactor","_emissiveFactor","emissiveFactor","_initTransform","_modelTransform","_updateTime","_updateCommands","commandList","vertexArray","shaderProgram","owner","_updateVA","_time","getTimestamp","_updateAlphaCommand","_updateOpaqueCommand","DrawCommand","pass","renderState","RenderState","fromCache","WebGLConstants","LEQUAL","BlendingState","ALPHA_BLEND","ShaderProgram","HDR","uniformMap","multiplyTransformation","viewMatrix","getRotation","getMatrix3","transpose","Pass","OPAQUE","_computeStepCount","createTypedArray","ComponentDatatype","FLOAT","Buffer","createVertexBuffer","createIndexBuffer","UNSIGNED_SHORT","VertexArray","_updateBoundingVolume","round","BoundingSphere","in vec3 aPoint;\n","in vec3 aNormal;\n","in float aT;\n","uniform mat3 u_normalMatrix;\n","varying vec3 v_normalEC;\n","varying vec3 v_positionEC;\n","varying float v_t;\n","void main(){\n"," v_positionEC = (czm_modelViewRelativeToEye * vec4(aPoint, 1.0)).xyz;\n"," v_normalEC = u_normalMatrix * aNormal;\n","uniform vec4 u_color;\n","uniform float u_metallicFactor;\n","uniform float u_roughnessFactor;\n","uniform vec3 u_emissiveFactor;\n","float M_PI = 3.141592653589793;\n","vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n"," return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n","float smithVisibilityG1(float NdotV, float roughness) \n"," return NdotV / (NdotV * (1.0 - k) + k);\n","float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n"," return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n","float GGX(float roughness, float NdotH) \n"," float roughnessSquared = roughness * roughness;\n"," float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n"," return roughnessSquared / (M_PI * f * f);\n","vec3 lambertianDiffuse(vec3 diffuseColor) \n"," return diffuseColor / M_PI;\n","vec3 LINEARtoSRGB(vec3 linearIn) \n","#ifndef HDR \n"," return pow(linearIn, vec3(1.0/2.2));\n","#else \n","#endif \n"," if (!gl_FrontFacing){\n"," n = -n;\n"," }\n"," vec4 baseColorWithAlpha = u_color;\n"," if (v_t > 0.5){"," baseColorWithAlpha.a = (2.0 - v_t * 2.0);\n"," else{\n"," baseColorWithAlpha.a = 1.0;\n"," vec3 baseColor = baseColorWithAlpha.rgb;\n"," float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n"," float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n"," vec3 lightColor = vec3(1.5, 1.4, 1.2);\n"," vec3 h = normalize(v + l);\n"," float NdotL = clamp(dot(n, l), 0.001, 1.0);\n"," float NdotH = clamp(dot(n, h), 0.0, 1.0);\n"," float VdotH = clamp(dot(v, h), 0.0, 1.0);\n"," vec3 f0 = vec3(0.04);\n"," vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n"," float alpha = roughness * roughness;\n"," float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n"," vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n"," vec3 r0 = specularColor.rgb;\n"," float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n"," float D = GGX(alpha, NdotH);\n"," vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n"," vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n"," vec3 color = NdotL * lightColor * (diffuseContribution + specularContribution);\n"," color += u_emissiveFactor;\n"," color = LINEARtoSRGB(color);\n"," out_FragColor = vec4(color, baseColorWithAlpha.a);\n"," float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n"," return linearIn;\n"," if (v_t > 0.5){discard;}\n"," vec3 n = normalize(v_normalEC);\n"," baseColorWithAlpha.a = 1.0;\n"," vec3 v = -normalize(v_positionEC);\n"," vec3 l = normalize(czm_sunDirectionEC);\n"," float LdotH = clamp(dot(l, h), 0.0, 1.0);\n"," vec3 specularColor = mix(f0, baseColor, metalness);\n"," vec3 F = fresnelSchlick2(r0, r90, VdotH);\n","viewer is required.","DEFAULT_HEIGHT","_radius","GeoDynamicCircle","_classificationType","classificationType","DEFAULT_CLASSIFICATION_TYPE","_bottomEllipse","_waveEllipse","_createDynamicCircle","isShow","setShow","_isShow","setColor","DEFAULT_COLOR","ellipse","getColor","setRadius","DEFAULT_RADIUS","semiMajorAxis","getRadius","setCenter","position is required.","ImageMaterialProperty","CallbackProperty","rgba(255, 255, 255, 1.0)","rgba(255, 255, 255, 0.0)","rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.2)","clearRect","beginPath","arc","restore","strokeStyle","rgb(255, 255, 255)","setLineDash","stroke","center is required.","_length","GeoDynamicCylinder","DEFAULT_LENGTH","_topRadius","_bottomRadius","particlesColor","DEFAULT_PARTICLES_COLOR","_cylinderColor","cylinderColor","particlesImageUrl","_cylinderPrimitive","_createDynamicCylinder","_particlesPrimitive","\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n //varying vec4 v_color;\n //uniform sampler2D u_image;\n //uniform vec4 u_color;\n void main()\n {\n float powerRatio = fract(czm_frameNumber / 30.0) + 1.0;\n float alpha = pow(1.0 - v_st.t, powerRatio);\n vec4 color = vec4(","red","green","blue","alpha",");\n // out_FragColor = vec4(u_color.rgb, alpha*u_color.a);\n out_FragColor = vec4(color.rgb, alpha*color.a);\n }\n ","particles primitive","_particlesImageUrl","\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n //varying vec4 v_color;\n //uniform sampler2D u_image;\n //uniform vec4 u_color;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\n float dt = fract(czm_frameNumber / 90.0);\n vec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt));\n //vec4 imageColor = texture(u_image, st);\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = st;\n czm_material material = czm_getMaterial(materialInput);\n\n\n vec3 diffuse = material.diffuse;\n float alpha = material.alpha;\n\n //diffuse *= v_color.rgb;\n //alpha *= v_color.a;\n \n vec4 ucolor = vec4(",");\n diffuse *= ucolor.rgb;\n alpha *= ucolor.a;\n\n //diffuse *= u_color.rgb;\n //alpha *= u_color.a;\n\n out_FragColor = vec4(diffuse, alpha * pow(1.0 - v_st.t, 2.0));\n }\n ","\n in vec3 position3DHigh;\n in vec3 position3DLow;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n\n void main()\n {\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n }\n ","DEFAULT_CYLINDER_COLOR","GOLD","GeoHeatMap","heatmapOptions","orange","useEntities","defaults","gradient","maxOpacity","minOpacity","_computeBounds","_getContainer","width: ","px; height: ","body","_getImageryProvider","getDataURL","_rectangle","_tilingScheme","WebMercatorTilingScheme","_mbounds","_getID","charAt","WebMercatorProjection","wgs84ToMercator","wgs84ToMercatorBB","mercatorToWgs84","mercatorToWgs84BB","rad2deg","deg2rad","mercatorPointToHeatmapPoint","_xoffset","_factor","_spacing","maxCanvasSize","minCanvasSize","setData","_initBounds","_setWidthAndHeight","radiusFactor","_yoffset","bounds","_container","px; margin: 0px; display: none;","repaint","_heatmap","-hm","wgs84PointToHeatmapPoint","_layer","imageryLayers","updateLayer","_renderer","1.21","transparent","addImageryProvider","url","url is required.","_url","GeoImageCircle","_ellipse","_createImageCircle","TERRAIN","_position","_direction","_baseScale","_mode","buildModuleUrl","_url_1","urlTop","explode","_positions","_startScale","_endScale","_imageSize","_endColor","smoking","life","_minLife","_maxLife","_minSpeed","_maxSpeed","_count","_grow","grow","_texture_0","_texture_1","_drawCommand","_pointsArray","_speedScaleLifeTimesArray","_preTime","_loadTexture","_initFires","addPosition","_explode","_owner","_fires","_directionsArray","frameState","Resource","Texture","fetchImage","_emissionPosition","randomBetween","_growFires","baseScale","_updateFire","_initFire","_clock","shouldAnimate","secondsOfDay","_updateCommand","_isCommandReady","updateNext","instanceCount","_updateCommandBoundingVolume","_updateCommandShaderProgram","_updateCommandUniforms","_updateCommandRenderState","aPosition","aDirection","aSpeedScaleLifeTime","_updateCommandVA","time","aTexcoord","aPlane","u_startScale","u_endScale","u_imageSize","u_endColor","u_texture_0","u_texture_1","_updateCommandModelMatrix","in vec2 aPlane;\n","in vec4 aDirection;\n","in vec4 aSpeedScaleLifeTime;\n","in vec2 aTexcoord;\n","uniform float u_endScale;\n","varying vec3 v_texcoord_0;\n","varying vec4 v_colorFact;\n","vec4 computePosition(vec3 position, vec2 plane, vec3 direction, float imageSize, float baseScale, float speed, float time){\n"," vec3 v = normalize(direction) * speed * time;\n"," vec4 result = czm_modelView * vec4(v, 1.0);\n"," result.xy += plane * imageSize * baseScale;\n"," return result;\n","void main()\n"," float speed = aSpeedScaleLifeTime.x;\n"," float baseScale = aSpeedScaleLifeTime.y;\n"," float life = aSpeedScaleLifeTime.z;\n"," baseScale *= mix(u_startScale, u_endScale, t);\n"," gl_Position = czm_projection * positionEC;\n"," v_texcoord_0.z = aDirection.w;\n"," if (t > 0.618){\n"," v_texIndex = 2.0;\n"," else if (t > 0.382){\n"," v_texIndex = 1.0;\n"," v_texIndex = 0.0;\n"," v_colorFact = vec4(1.0 - t);\n"," v_colorFact = mix(u_startColor, u_endColor, t);\n","uniform sampler2D u_texture_0;\n","uniform sampler2D u_texture_1;\n"," int mode = int(v_texcoord_0.z);\n"," vec4 color = vec4(0.0);\n"," if (mode === 0){\n"," color = texture(u_texture_1, v_texcoord_0.xy);\n"," color = texture(u_texture_0, v_texcoord_0.xy);\n"," }\n"," else if (mode === 1){\n"," color.rg *= 1.4;\n"," else if (mode === 2){\n"," color = v_colorFact;\n"," if (color.a === 1.0){\n"," color.a = mc;\n"," if (color.a > 0.995){\n"," vec4 fact = czm_gammaCorrect(v_colorFact);\n"," color *= fact;\n"," if (color.a < 0.1){discard;}\n"," out_FragColor = color;\n","_normalFact","_alphaFact","GeoLineSmokeEffect","_startColor","density","normalFactor","_smokes","_needTime","_door","_maxNormalFactor","_minNormalFactor","_growSmokes","_initSmokes","_initSmoke","multiply","fromRotationTranslation","multiplyByPointAsVector","alphaFact","normalFact","_updateSmoke","_udoor","TRANSLUCENT","_updateCommandShaderProgramAlpha","_updateCommandRepeatVA","_updateCommandShaderProgramOpaque","IndexDatatype","u_startColor","in vec4 aPosition;\n","uniform vec4 u_endColor;\n","uniform float u_imageSize;\n"," vec3 v = position;\n"," result /= result.w;\n"," float time = aSpeedScaleLifeTime.w;\n"," float t = time / life;\n"," vec4 positionEC = computePosition(aPosition.xyz, aPlane, aDirection.xyz, u_imageSize, baseScale, speed, time);\n"," v_texcoord_0.xy = aTexcoord;\n"," v_texcoord_0.z = t;\n"," color = texture(u_texture_0, v_texcoord_0.xy);\n"," vec4 fact = v_colorFact;\n"," if (v_texcoord_0.z > 0.9){color.a *= 0.1;}\n","uniform vec4 u_startColor;\n","uniform float u_startScale;\n"," v_colorFact = vec4(mix(u_startColor.rgb, u_endColor.rgb, aPosition.w * (u_startColor.a + u_endColor.a) / 2.0), aPosition.w);\n"," if (v_texcoord_0.z > 0.9){discard;}\n"," color = czm_gammaCorrect(color);\n","playing","sampleMaxHeight","sampleMaxPoint","isParabola","autoToGround","_name","createGuid","render","_data","posititons","getData","_createPolylines","_lines","duration","_clearPolylines","_definitionChanged","Event","createPropertyDescriptor","getType","getValueOrClonedDefault","_materialCache","addMaterial","GeoOutlineFireEffect","_fireEffect","_postProcess","_assigned","_depthAttachment","_clearCommand","_yPlane","_zPlane","_xyRange","_checkPositionsOrder","_createGroundTexture","_createXYPlanes","_createPostProcess","_updateAssiged","_viewMatrix","_invViewMatrix","postProcessStages","useLogDepth","_createFireEffect","GeoLineFireEffect","_computePlane","_createAssignedFrameBuffer","drawingBufferWidth","drawingBufferHeight","_framebuffer","PixelFormat","DEPTH_STENCIL","PixelDatatype","UNSIGNED_INT_24_8","Sampler","CLAMP_TO_EDGE","TextureWrap","TextureMinificationFilter","NEAREST","TextureMagnificationFilter","Framebuffer","ClearCommand","addFireEffect","addSmokeEffect","_depthStencilTexture","_view","passState","framebuffer","execute","uniform mat4 u_nViewMatrix;\n","uniform int u_count;\n","uniform vec4 u_planes[","];\n","uniform vec4 u_xPlane;\n","uniform vec4 u_yPlane;\n","uniform vec4 u_zPlane;\n","uniform vec2 u_xyRange;\n","uniform sampler2D colorTexture;\n","uniform sampler2D depthTexture;\n","uniform sampler2D u_assignedTexture;\n","uniform sampler2D u_groundTexture;\n","varying vec2 v_textureCoordinates;\n","vec4 toEye(in vec2 uv, in float depth){\n"," vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n"," posInCamera = posInCamera / posInCamera.w;\n","float getDepth(in vec4 depth){\n"," float z_window = czm_unpackDepth(depth);\n"," z_window = czm_reverseLogDepth(z_window);\n"," float n_range = czm_depthRange.near;\n"," float f_range = czm_depthRange.far;\n"," return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n","vec2 getGroundTexCoord(in vec3 position){\n"," float y = czm_planeDistance(u_yPlane, position) / u_xyRange.y;\n"," return vec2(x * 4.0, y * 4.0);\n"," vec4 color = texture(colorTexture, v_textureCoordinates);\n"," vec4 currD = texture(depthTexture, v_textureCoordinates);\n"," if(currD.r>=1.0){\n"," out_FragColor = color;\n"," return;\n"," vec4 assigned = texture(u_assignedTexture, v_textureCoordinates);\n"," }\n"," float depth = getDepth(currD);\n"," float z = czm_planeDistance(u_zPlane, position.xyz);\n"," vec2 gndTexCoord = getGroundTexCoord(position.xyz);\n"," vec4 colorGround = texture(u_groundTexture, gndTexCoord);\n"," for (int i = 0; i < "," if (i >= u_count){\n"," break;\n"," }\n"," float d0 = czm_planeDistance(u_planes[i], position.xyz);\n"," float d2 = czm_planeDistance(u_planes[i+2], position.xyz);\n"," if (d0 > 0.0 && d1 > 0.0 && d2 > 0.0){\n"," if (z < -1000.0){break;}\n"," break;\n","PostProcessStage","_groundTexture","_xPlane","urlGround","function ","join","l-1",";while(l<=h){ var m=(l+h)>>>1,x=a[m]",";if(x===y){return m}else if(x<=y){",";var p=c(x,y);if(p===0){return m}else if(p<=0){",";if(","){i=m;","l=m+1}else{h=m-1}","h=m-1}else{l=m+1}","return -1};","return i};","c(x,y)","function dispatchBsearch","(a,y,c,l,h){ if(typeof(c)==='function'){ return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c) }else{ return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y) }} return dispatchBsearch","triangulation","binary-search-bounds","stars","edges","removeTriangle","addTriangle","flip","opposite","cells","neighbor","flags","next","locate","boundary","constraint","two-sum","twoProduct","fastTwoSum","robust-subtract","robustSubtract","robust-sum","linearExpansionSum","two-product","robust-scale","scaleLinearExpansion","sum(","split","substr","prod(","scale(","prod(m","var w","=scale(w","[0]);","var p=","sum","diff","slow","function testInSphere(",":return o","robust-in-sphere","delaunay","isConstraint","),prod(-","Exact","){var p=",",n=",",d=sub(p,n); return d[d.length-1];};return ","prod","function getOrientation(","case ","}var s=new Array(arguments.length);for(var i=0;i 0.0)\n"," {\n"," j++;\n"," clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"," clipNormal = clippingPlane.xyz;\n"," clipPosition = -clippingPlane.w * clipNormal;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," if (amount > 0.0)\n"," {\n"," clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"," clipNormal = clippingPlane.xyz;\n"," amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," {\n"," bDiscard = false;\n"," break;\n"," }\n"," }\n"," if (bDiscard) {\n"," discard;\n","getClipAndStyleCodeForMulArea","uniform sampler2D gltf_clippingPlanes; \n","uniform mat4 gltf_clippingPlanesMatrix; \n","uniform vec4 gltf_clippingPlanesEdgeStyle; \n","{ \n"," gltf_clip_main(); \n","); \n"," clippingPlanesEdgeColor.rgb = ",".rgb; \n"," float clippingPlanesEdgeWidth = "," if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n"," out_FragColor = clippingPlanesEdgeColor;\n"," } \n","} \n"," vec3 clipPosition = vec3(0.0);\n"," int j = i;\n"," clipAmount = czm_branchFreeTernary(j === 0, amount, min(amount, clipAmount));\n"," amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"," j++;\n"," if (amount > 0.0)\n"," //break;\n","void main() \n"," float clipDistance = clip(gl_FragCoord, ",".a; \n"," if (clipDistance < 0.0) \n"," { \n","peekSource","addOutlinePosition","_outline","tileUnload","raiseEvent","_statistics","decrementLoadCounts","numberOfTilesWithContentReady","unloadContent","_enableTileset","_root","_removeEffectFromTileset","_cache","trim","unloadTiles","_unloadTileCallback","GeoRadarScan","DEFAULT_LINE_WIDTH","_sectorColor","_sectorWidth","sectorWidth","DEFAULT_SECTOR_WIDTH","_createRadarScan","_updateBorderMaterial","_updateSectorMaterial","_radarScanEntity","_borderEntity","setLineColor","getLineColor","setsectorColor","radar","rgba(","rgba(255,255,255,1)","255,255,255",",1)","moveTo","lineTo","fill","_createCanvas","GeoScanCircleEffect","_repeat","repeat","_scanCirclePostProcess","_scanAperturePostProcess","_normal","_setLife","_setTime","_color0","_finishedEvent","_updatePostProcesses","_finish","inverseViewMatrix","_updateScanAperturePostProcess","_updateScanCirclePostProcess","uniform mat4 u_invViewMatrix;\n","uniform vec3 u_center;\n"," vec4 color = texture(colorTexture, v_textureCoordinates);\n"," vec4 currD = texture(depthTexture, v_textureCoordinates);\n"," if(currD.r >= 1.0){\n"," return;\n"," float zd = czm_unpackDepth(currD);\n"," zd = czm_reverseLogDepth(zd);\n"," zd = (2.0 * zd - czm_depthRange.near - czm_depthRange.far) / (czm_depthRange.far - czm_depthRange.near);\n"," vec2 xy = vec2((v_textureCoordinates.x * 2.0 - 1.0), (v_textureCoordinates.y * 2.0 - 1.0));\n"," vec4 position = czm_inverseProjection * vec4(xy, zd, 1.0);\n"," float z = 0.0;\n"," if (all(notEqual(n, b))){\n"," vec3 nc = cross(b, n);\n"," b = normalize(b);\n"," z = dot(b, position.xyz) - dot(b, u_center);\n"," float d5 = u_param0.z * u_param0.y;\n"," float hw = u_param0.w / 2.0;\n"," float hw5 = hw * 12.0;\n"," float hd = dot(u_normal, position.xyz) - dot(u_normal, u_center);\n"," if (z < (d5 + hw5) && z > (d5 - hw5)){\n"," color.rgb = mix(color.rgb, u_color.rgb, smoothstep(0.0, 1.0, z1));\n"," float r = abs(z - d);\n"," if (u_color.a < 1.0){\n"," z = (r - hw * u_color.a) / (hw * (1.0 - u_color.a));\n"," color.rgb = mix(color.rgb, u_color.rgb, clamp(al * ((hw * u_color.a > r) ? 1.0 : exp(-(pow(z, 2.27)))), 0.0, 1.0));\n","invViewMatrix","uniform vec3 u_normal;\n","uniform vec4 u_param0;\n"," position /= position.w;\n"," float t = (u_param0.y > u_param0.x) ? u_param0.x : u_param0.y;\n"," vec3 b = normalize(position.xyz - u_center);\n"," b = cross(n, nc);\n"," float d = u_param0.z * t;\n"," float r = abs(z - d5);\n"," color.rgb *= ((r / hw5) > 0.5) ? 0.996 : 1.018;\n"," color.rgb += vec3(0.01) * u_color.rgb;\n"," if (z < (d + hw) && z > (d - hw)){\n"," r = 1.5707963 * r / hw;\n"," color.rgb = color.rgb * vec3(0.618) + u_color.rgb * vec3(cos(r) * 0.382);\n","GeoScanRingEffect","longest","_textureUrl","_scanPostProcess","_texture","_param1","_param3","_loading","_checkVisible","_updateTexture","_udpateParams","setTextureUrl","_param0","_param4","_longest","only-if-cache","_param2","uniform vec4 u_param3;\n"," out_FragColor = color;\n"," position = u_invViewMatrix * position;\n"," float z0 = dot(u_param3.xyz, position.xyz) + u_param3.w;\n"," if(z0 < -800.0 || z0 > 800.0){\n"," vec3 v = u_param3.xyz * z0;\n"," vec3 p = position.xyz - v;\n"," float z2 = distance(u_param0.xyz, p);\n"," float z3 = u_param2.x * 0.75;\n"," if(z2 < z3){\n"," out_FragColor = mix(color, u_color, (z2 - z3) * 0.8 / (u_param2.x * 0.25));\n","uniform vec4 u_param2;\n","uniform vec4 u_param4;\n"," float z0 = dot(u_param0.xyz, position.xyz) + u_param0.w;\n"," if(z0 < 0.0){\n"," float z1 = dot(u_param1.xyz, position.xyz) + u_param1.w;\n"," if(z1 < 0.0){\n"," float z2 = dot(u_param2.xyz, position.xyz) + u_param2.w;\n"," if(z2 < 0.0){\n"," float z3 = dot(u_param3.xyz, position.xyz) + u_param3.w;\n"," if(z3 < 0.0){\n"," float z4 = dot(u_param4.xyz, position.xyz) + u_param4.w;\n"," float a = max(sColor.r, max(sColor.g, sColor.b));\n"," out_FragColor = mix(color, sColor, a * 0.8);\n","_angle","angle","emit","velocity","imageSize","_particleLife","particleLife","_emissionRate","emissionRate","_lifetime","lifetime","_system","_initializeParticleSystem","_reset","_particles","_billboard","_particlePool","VisualSenseStyleCondition","_fieldName","_fieldValue","fieldValue","minValue","_maxValue","maxValue","_topic","topic","vec4(","_makeColorShader","if (visualSenseStyle_enabledMixColor === 1.0) { \n","out_FragColor *= ","_minValue"," === ",".0) \n","if (",".0 && ","_makeLuminanceShader",") \n"," >= "," && ","mixedColor","luminanceAtZenith","getLuminanceByProperty","true","getProperty","ConditionParser","parse","fieldName","_useElevation","bloom","glowOnly","contrast","brightness","sigma","stepSize","isSelected","GeoVisualSenseStyle","_enabledMixedColor","_enabledLuminanceAtZenith","_enabledBloom","_bloomStep","_map","_conditionParser","_mixedColorConditions","parseLuminanceAtZenith","lightBand","_enabledLightBand","_luminanceAtZenithConditions","conditions","makeFragmentColorShader","if (visualSenseStyle_enabledLuminanceAtZenith === 1.0) { \n","luminanceValue = heightLightValue; \n","makeShader","makeLightBandShader","float vtxf_a13 = fract(czm_frameNumber / 360.0);\n","float vtxf_h = clamp(v_elevationPos.z / 300.0, 0.0, 1.0);\n","vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\n","float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));\n","out_FragColor.rgb += out_FragColor.rgb * (1.0 - vtxf_diff);\n","GeoWind","level","rectangle","velocityScale","particleMultiplier","maxWindIntensity","colors","#00ffff","#64f0ff","#87e1ff","#a0d0ff","#c6adff","#d49bff","#ec6dff","#ff1edb","canvasContext","_initWindy","Windy","header","parameterCategory","parameterNumber","2,2","2,3","lo1","la1","refTime","setHours","getHours","forecastTime","interpolate","release","randomize","substring","indexFor","rgba(0, 0, 0, 0.97)","age","globalCompositeOperation","fillRect","timer","field","_locationCoordinate","_size","_bounds","tan","_getLevel","_getCenterPoint","_calculateBounds","1.16","windy","GEO_OVERVIEW_ICO_LAYER","GEO_OVERVIWE_ICO_ID","map2DOptions","raster","http://t3.tianditu.com/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&LAYER=vec&TILEMATRIXSET=c&FORMAT=tiles&VERSION=1.0.0&STYLE=default&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e90d56e5a09d1767899ad45846b0cefd","tdt_layer_overview","visible","movingTargetIco","movingTargetIcoSize","movingTargetZoomLevel","_isReady","modelType","ROAM","_initOverview","geo-cesium-viewer-overview","layout","toLocaleUpperCase","startsWith","bottom","5px","absolute","_bindEvent","map2D","load","loadImage","addImage","addSource","addLayer","updateAimingRect","_unbindEvent","GEOOVERVIEW_3D_RENDER_EVENT","getMap2D","getMap2DLayer","getLayer","addMap2DLayer","removeLayer","getMap2DSource","addMap2DSource","removeMap2DSource","_latelyUpdateStamp","_modelType","getSource","setLayoutProperty","icon-rotate","setModel","setScalable","boolean","GeoOverviewWidget","CustomGeographicTilingScheme","_resolutions","resolutions","_maximumLevel","_origin","_fullExtent","fullExtent","_dataRectangle","_matrixWidth","_matrixHeight","LN2","_topTileExtent","_numberOfLevelZeroTilesY","_centerPoint","_proposalHeight","GeographicTilingScheme","_numberOfLevelZeroTilesX","getNumberOfXTilesAtLevel","CustomWebMercatorTilingScheme","matrixWidth","numberOfLevelZeroTilesX","numberOfLevelZeroTilesY","_rectangleSouthwestInMeters","rectangleSouthwestInMeters","rectangleNortheastInMeters","_rectangleNortheastInMeters","getNumberOfYTilesAtLevel","LineString","GeoGeodesic","radiansToDegrees","degreesToRadians","atan2","_destination","along","_bearing","geoTranslateByDistance","GeoGeographicTilingScheme","GeographicProjection","when","defer","ToolManager","_tools","ModifyTerrainTool","vertices","heights","mtHeight","mtType","fromKML","resolve","lenght","timeStamp","getTileDataAvailable","_errorEvent","_credit","string","Credit","heightMapWidth","heightMapHeight","_subdomains","firstRequestUrl","{s}","sTag","_firstRequest","layerName","&Styles=&Format=image/mpt","pngOnly","maxTerrainLevel","_maxTerrainLevel","setFormatMPT","_urlTemplate","request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=","_format","_levelZeroMaximumGeometricError","TerrainProvider","_workerPool","_pendingRequests","_requestsCache","_requestsCacheKeys","errorEvent","GeoSkylineTerrainProvider","_geometricErrorFactor","mpt","png","_isMPT","replace","requestFactorForLevel","_requestGridSize","getRequestBaseTerrainUrl","getRequestElevationLayer","getRequestUrl","tilingScheme","tileXYToNativeRectangle","{north}","{west}","{east}","{optimizedOnly}","{height}","isT_Inside_E","DEGREES_PER_RADIAN","isT_Intersects_E","RADIANS_PER_DEGREE","refreshElevationLayer","_surface","_levelZeroTiles","findDirectParent","freeResources","isTileAvailable","tileXYToRectangle","terrainData","_childTileMask","markTileAsUnavailable","requestTileGeometryBuffers","requestedRectangle","layer","requestTileHeightBuffer","all","myReject","reject","isFloor","arrayToHeightmapTerrainData","catch","_allElevationLayers","each","requestElevationLayerTileGeometry","requestBaseTerrainTileGeometry","nullTolerance","nullValueNumber","polygonVerticesX","polygonVerticesY","mergeBuffers","offset","tolerance","_buffer","Request","subdomains","/SG","/Elevation","format","image/png","image/mpt","_modifyTerrainObjects","modelFloorBestLevel","NoMerge","_selectedTiles","NoFloor","rootFloorRectangle","getHRMTFP","_model","hasOwnProperty","dataLoaded","fetchArrayBuffer","workerFinished","queueWorkItem","rejected","extractTileHeightBuffer","message","HeightmapTerrainData","workerPath is required.","_workerPath","workerPath","_poolSize","poolSize","_workers","_defered","jobQueueSize","onWorkerError","workerId","deferedId","postMessage","trimPool","timerId","terminate","onWorkerMessage","options.urls is required.","_dataType","dataType","GeoTerrainProvider","INT","_tileType","tileType","HEIGHTMAP","_urls","urls","_urls_length","_url_i","_url_step","_readyPromise","credit","_heightmapWidth","_heightmapHeight","getEstimatedLevelZeroGeometricErrorForAHeightmap","_opacity","opacity","_maxExtent","maxExtent","_topLevel","_bottomLevel","bottomLevel","ready","requestTileGeometry must not be called before ready returns true.","promise","requestTileGeometry","&y=","&l=","_proxy","getURL","QUANTIZED_MESH","_terrainDataStructure","_skirtHeight","getLevelMaximumGeometricError","getvHeightBuffer","_vHeightBuffer","transformBuffer","setInt8","requestFunction","GET","open","responseType","arraybuffer","async","RequestScheduler","request","readyState","status","response","byteLength","Inflate","decompress","_rectangles","getFloat64","getFloat32","subarray","getUint32","createTypedArrayFromArrayBuffer","getUint8","OCT_VERTEX_NORMALS","_requestVertexNormals","WATER_MASK","METADATA","_requestMetadata","available","endY","EPSILON5","fromRectangle","_tileCredits","int","float","quantized-mesh","heightmap","tileset","source","autoActivate","originalColor","fromBytes","moveColor","selectedFeature","groundPrimitiveCollection","geojson","activateAction","_seletedEvent","XMLHttpRequest","withCredentials","Accept","application/json","onerror","statusText","onload","_loadGroundPrimitives","data的类型不被支持!","Polygon","类型,该类型不被支持!","GEO_MONOMER_FEATURE","reloadGeoJSON","_loadGeoJSON","description","isContaintFeature","drillPick","selectedColor","deactivateAction","Cesium3DTilesetMonomer","EasingFunction","Intersect","OrthographicFrustum","PerspectiveFrustum","CameraFlightPath","_transform","_invTransform","_actualTransform","_transformChanged","isTDT","_positionWC","_directionWC","_up","_upWC","_right","aspectRatio","fov","defaultMoveAmount","defaultLookAmount","defaultRotateAmount","defaultZoomAmount","maximumZoomFactor","_moveEnd","_changed","_changedDirection","_changedFrustum","percentageChanged","_modeChanged","_max2Dfrustum","_suspendTerrainAdjustment","DEFAULT_VIEW_RECTANGLE","DEFAULT_VIEW_FACTOR","TRANSFORM_2D","TRANSFORM_2D_INVERSE","PI_OVER_FOUR","computeView","_updateCameraChanged","numberOfListeners","_changedPosition","fovy","_adjustHeightForTerrain","basisTo2D","getColumn","EPSILON10","inverseTransformation","_actualInvTransform","_rightWC","zeroToTwoPi","MORPHING","_moveStart","mode is required.","An OrthographicOffCenterFrustum is required in 2D.","A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view","The camera frustum is expected to be orthographic for 2D camera control.","tileProvider","_tileLoadQueueHigh","_tileLoadQueueMedium","_tileLoadQueueLow","_debug","tilesWaitingForChildren","pickPositionWorldCoordinates","ROTATE","fromHeadingPitchRoll","endTransform","getRectangleCameraCoordinates","flyHome","completeMorph","flyTo","cartesian is required.","worldToCameraCoordinatesVector","cameraToWorldCoordinates","cameraToWorldCoordinatesPoint","cameraToWorldCoordinatesVector","direction is required.","moveUp","moveDown","moveRight","lookLeft","lookDown","twistLeft","axis is required.","rotateDown","rotateLeft","zoomOut","offset is required","lookAt is not supported while morphing.","UNIT_Y","transform is required","lookAtTransform is not supported while morphing.","setEndPoints","_offCenterFrustum","MAX_VALUE","rectangle is required","windowPosition is required.","near","distanceToBoundingSphere","boundingSphere is required.","getPixelSize","drawingBufferHeight is required.","getPixelDimensions","EXPONENTIAL_OUT","createCorrectPositionTween","duration is required.","_currentFlight","destination is required.","cancelFlight","convert","complete","cancel","pitchAdjustHeight","flyOverLongitude","flyOverLongitudeWeight","easingFunction","createTween","DEFAULT_OFFSET","viewBoundingSphere is not supported while morphing.","fromCartesian4","radii","multiplyComponents","oneOverRadii","upWC","computeVisibility","fromCartographicArray","EPSILON9","switchToPerspectiveFrustum","switchToOrthographicFrustum","projectionMatrix","CameraEventType","_update","_isDown","_movement","prevAngle","_buttonsDown","position1","_eventHandler","PINCH_END","PINCH_MOVE","_eventStartPosition","_pressTime","_releaseTime","RIGHT_DOWN","RIGHT_UP","MIDDLE_DRAG","MIDDLE_UP","_lastMovement","valid","canvas is required.","_currentMousePosition","ALT","type is required.","GeoCloudPrimitive","speedScale","_base","_step","_gamma","gamma","_isInverse","_animationMatrix","_colorTexture_0","_requestUrl","_requestCommand","../../../resource/images/10.jpg","_url_0","_createTexture","_context","RGBA","CloudPrimitive fetchImage is failed!","passes","_isTexturesReady","_timeoutWorkerCommand","_updateAnimationMatrix","_createCommandByWorker","var PI_OVER_TWO = PI / 2.0;\n","onmessage = function (e) {\n"," var xCount = params.xCount;\n"," if (!xCount){\n"," var yCount = params.yCount;\n"," if (!yCount){\n"," postMessage({error:true});\n"," var radius = params.radius;\n"," if (!radius){\n"," var pointsCount = (xCount + 1) * (yCount - 1) + 2 * xCount;\n"," var pointsArray = new Float32Array(3 * pointsCount);\n"," var texcoordArray = new Float32Array(2 * pointsCount);\n"," var ptIndex = 0;\n"," var tcIndex = 0;\n"," var hFovRad = PI * 2.0;\n"," var angleH = 0;\n"," var angelV = 0;\n"," var stepVRad = vFovRad / yCount;\n"," for (var F = 0; F < xCount; F++){\n"," pointsArray[ptIndex ++] = 0.0;\n"," pointsArray[ptIndex ++] = -radius;\n"," texcoordArray[tcIndex ++] = F / xCount + 1 / (xCount * 2.0);\n"," texcoordArray[tcIndex ++] = 0.0;\n"," var startHRad = -PI;\n"," var startVRad = -PI_OVER_TWO + stepVRad;\n"," for (var U = 0; U < yCount - 1; U++) {\n"," angelV = startVRad + U * stepVRad;\n"," angleH = startHRad + F * stepHRad;\n"," pointsArray[ptIndex ++] = radius * Math.cos(angelV) * Math.cos(angleH);\n"," pointsArray[ptIndex ++] = radius * Math.cos(angelV) * Math.sin(angleH);\n"," pointsArray[ptIndex ++] = radius * Math.sin(angelV);\n"," tt = 0.5 + angleH / hFovRad;\n"," texcoordArray[tcIndex ++] = tt;\n"," texcoordArray[tcIndex ++] = (U + 1) / yCount;\n"," pointsArray[ptIndex ++] = radius;\n"," texcoordArray[tcIndex ++] = 1.0;\n"," var faceIndexCount = (xCount * (yCount - 2) + xCount) * 6;\n"," var faceIndex = 0;\n"," for (var F = 0; F < xCount; F ++){\n"," faceIndexArray[faceIndex ++] = F + xCount + 1;\n"," faceIndexArray[faceIndex ++] = F + xCount;\n"," for (var U = 0; U < yCount - 2; U ++){\n"," faceIndexArray[faceIndex ++] = F + xCount + U * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + 1 + U * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + 1 + (U + 1) * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + (U + 1) * (xCount + 1);\n"," faceIndexArray[faceIndex ++] = F + xCount + (yCount - 2) * (xCount + 1);\n"," postMessage({\n"," faceIndexArray: faceIndexArray\n","};\n","onerror = function(error){\n","application/javascript","onmessage","faceIndexArray","PrimitiveType","TRIANGLES","FUNC_ADD","ONE","_createShaderProgram","cull","_card"," in vec3 a_position;\n in vec2 a_texcoord_0;\n uniform mat4 u_animationMatrix;\n varying vec2 v_texcoord_0;\n "," void main()\n {\n vec4 p = vec4(a_position, 1.0);\n v_texcoord_0 = a_texcoord_0;\n gl_Position = czm_modelViewProjection * u_animationMatrix * p;\n }\n "," uniform sampler2D u_colorTexture_0;\n uniform vec4 u_gamma;\n varying vec2 v_texcoord_0;\n "," float computeW(vec4 color){\n float w = color.w;\n if (w === 1.0){\n //w = min(min(color.r, color.g), color.b);\n w = sin(color.r * color.g * color.b * 1.5707963);\n }\n w = pow(w, u_gamma.w * 10.0);\n return w;\n }\n void main()\n {\n vec4 color_0 = texture(u_colorTexture_0, v_texcoord_0);\n color_0.w = computeW(color_0);\n color_0.rgb *= u_gamma.xyz;\n out_FragColor = color_0;\n }\n ","topCylinderColor","bottomCylinderColor","createPrestrainPrimitive","ellipseAppearance","prestrainEllipsePrimitive","trackedEntity","pointEntity","ellipsePrimitive","cylinderPrimitive","MIDDLE_DOWN","prestrainCylinderPrimitive","removeById","EllipseGeometry","VERTEXT_FORMAT","POSITION_AND_NORMAL","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAA6E2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS41LWMwMTQgNzkuMTUxNDgxLCAyMDEzLzAzLzEzLTEyOjA5OjE1ICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpPC94bXA6Q3JlYXRvclRvb2w+CiAgICAgICAgIDx4bXA6Q3JlYXRlRGF0ZT4yMDE5LTA2LTExVDA5OjQ2OjU3KzA4OjAwPC94bXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTktMDYtMTFUMTA6MTY6NTMrMDg6MDA8L3htcDpNb2RpZnlEYXRlPgogICAgICAgICA8eG1wOk1ldGFkYXRhRGF0ZT4yMDE5LTA2LTExVDEwOjE2OjUzKzA4OjAwPC94bXA6TWV0YWRhdGFEYXRlPgogICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3BuZzwvZGM6Zm9ybWF0PgogICAgICAgICA8cGhvdG9zaG9wOkNvbG9yTW9kZT4zPC9waG90b3Nob3A6Q29sb3JNb2RlPgogICAgICAgICA8cGhvdG9zaG9wOklDQ1Byb2ZpbGU+c1JHQiBJRUM2MTk2Ni0yLjE8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8eG1wTU06SW5zdGFuY2VJRD54bXAuaWlkOjNkNWU2OTU5LTZiOTMtZTQ0Mi1hNmFkLWVhMmExOWQxZGI0MTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+eG1wLmRpZDo5ODQ4MzQ2Ny03Mjg5LTUzNGQtOTUyOC05MGY3MWU0MTEwMmU8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDo5ODQ4MzQ2Ny03Mjg5LTUzNGQtOTUyOC05MGY3MWU0MTEwMmU8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6OTg0ODM0NjctNzI4OS01MzRkLTk1MjgtOTBmNzFlNDExMDJlPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE5LTA2LTExVDA5OjQ2OjU3KzA4OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpPC9zdEV2dDpzb2Z0d2FyZUFnZW50PgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+c2F2ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+eG1wLmlpZDozZDVlNjk1OS02YjkzLWU0NDItYTZhZC1lYTJhMTlkMWRiNDE8L3N0RXZ0Omluc3RhbmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTktMDYtMTFUMTA6MTY6NTMrMDg6MDA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50PkFkb2JlIFBob3Rvc2hvcCBDQyAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzIwMDAwLzEwMDAwPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WVJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/Pu16zW8AAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAEbhJREFUeNrsW3t0VPWd//x+9955ZDKTyeRNnrxCXEGEgAqyQXqEWmtdtbj0gVsaaVfWB6tSjh5r67J2j0qhPrrWcnqaLisKVK0bLdsKIiBGBOVhSYiERwghk5AQ8pqZ3Dv3/r77x/yGjrOZyUSC7jnu95zfyeP+Ht/f5/5+3/dlRIQvM3F8yenzACAPwDIAc0cwZhyABwBUXGrm1Es4dz6AbwGYB+BvAPzrCMZ6AHwfwE0A3gewGcChS8EkuwQy4DYA1QBKAZwDsA/AWwB2AwiN4GRWArgRwLUACgB0A3gNwDP/VwH4HoD7ANgB/BnAbwHUj9Lc2QDuBPB3AHwAXgHw41GZmYguts0mov1EdISIVozCfMO1hUT0ARE1EdGdFzvfxTKzjoi6ieipz2Hj8W0JEZ0moneJKOPzBiCfiE4Q0SEiKv0CNh/bXiaiEBF97bOM/ywyYB6APwFYB+DeEYzzAZgG4DKp5nwAFPlMABgA0AzgKIADAFpGMPcdAH4H4LERapsRn4BvUoS+l2J/HxEtJaI3iaiXUieLiN4jooeJaGKKa11GRANE9ItLdQVulszNSaFvERE9TUQ9iXZomqZlGIZpGIZlGIY5DCCvSWE73LppRNRBRGtG+wrMBLBXWnO7hun7UwAPAXDE/M+sq6s7vmfPnuaGhgZ/a2tr/7lz53TTNIkxxgCQ1+vVxowZk15eXp47c+bM0qqqqvEulys9bu71cm5/kvVdADoB/ATAz0fDDvDKCX8IoCZJvyskg1Oj//D7/Z01NTUf1NbW1h88eNCv67oBQOGca3a7XeGcI7q+YRjCNE0TQBgAr6ioyLnhhhsmLV68eEZlZeWEmHX6APwjgI1JeJkAoAnAfADbLhaAj+XbX5qkz3cAbLjwuk1z8LHHHvvjunXr9nZ2dp5XFMWTm5vrstvtXModBoDFiyPGGMnx1N3dPRgMBns1TbMtWrRoyqpVq24cO3bsmJj+qwGsTMLTrdJy9ADo/6wAPCIdmaIkfR4AsCb6x7Zt2w7de++9f2hsbDzjdruzc3JynEIIQUQqgHR5Naxij9s2PsOT7rQM5VjfQH/TQCgktYIpGTYUReEDAwPm2bNnz2ZkZLgef/zxr95zzz0LYtZ+CcB3k/D2nwBKkjliyQAoAnAawBQAhxP0uRvAL6N/rFmzZsuKFStqATjHjRvnE0KYROQAkCn9gBYAJwG0PVKcWzY1M+M6h6JkHusPvPPAsdP7pANVJptXAtGvqqra3t4eCAQCnXfcccc169ev/36MI/eyPIGJKCCv74aRAvA2gDapY4eimwC8Ef3jwQcffHnt2rVbMzMzC3w+n900TZKucEA6RB/W3TTvOBgD0zToRw7foR9peJQrWqlWNvZRraT0KTJNgAhzdh/IkzbDLOkIdXLOjXA4zFpbW1vnzp07cevWrcs1TbPL5X8O4EcJ+LwdwAsAskYSD7haSv4fJnheAKA2+sfDDz+8ee3atdvy8/OLvV6vZpqmDcAYadA8DWDT/oeWH3dMvgKOK66E88pKqJneYqurZ6Le3GkTg4ZHzc6C4s2A4s3A+zdd1yGNrdXSk8wQQnhVVbXKyspKdu7ceXzBggXPArAkCysA3JKA199LrbFqJAD8Qh6tRO5rbVSI1dTU7HziiSf+nJeXV+h0OiGEcEvBs1lai60AYLafiTR/K8JtLTarv6+YGCAEQIKXkBAVZFo2CpugsBldZ0B6fr8CoBNRLoBwWVlZ4Y4dO45WV1f/R9xGvQn4/RGAf0oVgHEAxkp9OxQtATADAI4cOXKqurp6o8fjyXW5XFxu3gHg1/HqJ7h/T7R5Qvveuz58+uQk6FL8G+HJYlCvIgE7MQX0v9mql8e8h4jyAFiFhYVFNTU1u2tqanbGBHfWJeD5vwG0A7gnFQAeAvAhgPNDPNPkkQYAWrp06UYAak5OjtOyLLt88+uk6vwUmaeaI635pMc4eaLK6usdz5yAogFWZ+v4cMuxK3m6Q1NzfFAyPUNtokuezBARZdpsNkpPT8+97777Xvf7/V0x9/2KBCDUyCjTsADMTWLwLAOQAQDr169/t66urqm0tDTHNE0BIEfq3Y+HNM+uW4D0r94Mx7SrMkiIKhEIljAVUDIBq/+8xzjdMoMBecxmA1OURIK5W54uuxDClpeX5xoYGAg98sgjb8T0eTLB2BekAzYpGQDXyp+vJdH5ICJz9erVOzVN83LOhYzYHJGRoKGDj3kF0AqLoXgyJtLAwAQYAszOwNI0kA5YXQFP+GzHlHDrKY/RcjKZbXJMCsZc0zTNnJyc3BdffPFAU1NTq3x+QwK7JSBVcHUyAL4rOw1F18g4H2praw8cPnz4TEFBgVsIoch5XkvGdejghwgd+rBcP940R/QEXOAAc6gAY4AJUMDyit7+vwVDCfdmDGedbpF3Ot3tdqvhcNhYt25dXVx4bijaCaBKmspDAjA9ibOzKPrLpk2bDgLQOOdRP/+g9OUTkggFYDQfqzSaPqkSuqlBYQDngACYBpAYzDLbz8xnmlZqGzt2OAAMuRmvZVkiLS3N++abbzbouh7VWt9Mor2yASxMBMDSJFHXrwBAT09Pb11d3SmPx+ORRpQqDZ2k5Jw5C6rbPZkCfdOgQAVnkTAIAJ6pgKm6qh87Osns6ipNMV2xTwpqm8/nczY2Nnbt2rWrST6bJu2QeDog7YXfJwLgsLwr8ZQDYDIA7N27t7mlpaXX4/FoUuV1yChOUhLBwBirp28K6brKnWBMkwAQwO0M4IDoBUSQplJYTEoBgF4AxwG4VVUFALFnz57mOGNuKKqX40aUGKmIgtXQ0NBORJaqqoyI0qTbGRxugv4d7/xDuKmtQnQDzEkAWZHGAMYBywBMAejNLTcyTi0AfpYCX80ApsmTqDU2Np6NeZYKiCkDcEGqnjlzpj/Gh1BlrGBYKszUzgyUF+4z9IIuxcHPCzDBAHAOUlRuWSHdEQ7odueEMW32orxPcOCTVKbtkN4jUxRF8/v9AzHPikcTgAuWSXd3dzhOiwRTmcCVQVudqnoQYZ7GbUwnzgVxBs4AaAohCIX6LZVl2wLwOc6myFcwCoDdbmc9PT1hy7KEoig8ludRzQ3KYManrncq4zb1TW4Ph1m7SRwAg2AcBEABQVEYzNAgwrqBzEAx0vuyU2XnwtqRyBqYEAJKYkPqMwPAYgD4TLm05T3XFrmddpdiU7lOsAQxBgEwEuCWgG6EedgSfFzIo2f3Oc8lMMWHezk0FM+jAYB1wRnQtNiJKSa2n5SKHcZSZuqzLJNl2zjvFWAMBMaIiDOCzdBdImxxj6WccAu8BOD1FPlnACCEgKqqTFEUFs/zaADQfUEf5uTYZfwORCQAuFOZYHJ5vvr2lg8mnT7dWcrcOZZ8ZRH+VQUUDCjcHDQ1jHOEzZzcFPlyyz2QrusiKyvLxjln8TyPBgCnLrzJ4uKMaEJFRnDzU5lg2pVFGz/6+NRXTncZpU63TdEUDi7lAFc4Bp0KINyC2R1vChJvpchXAQCFMUZCCKOwsNATpyJTysOnQo1RaT916tQxmqZp4XCYpNFUImN+yWPr3rQTmT5PPZwOy7QIXFVgd2rQbAoM04RmV5Gd6+lLc9q2M8aaU+RrHIBBeQ3MKVOmFMQZPCMG4FsyGBJPAwA+AoDp06eXlZeXZ/X09AzKE+ADcPmwCDb6RV5W2geluZ5DRm8IpmGBAFiWQDBggCwaTE/TPjQtq30goKfC+xjJ64Cu65bNZrPPmTNnXIyvsHeIMQqAbwO4LhEAj0Zd3iHoLQCw2+2OefPmjQ8Gg33yvgWTmJ0X6Fx3wCwfn7N74rjsAzAFhBDSCmTgjEFV+HFF4X8yDPNsMJgSALMBOBljZmdnZ2D69OkFM2bMGC+f7ZIJlKH8meejEa2hANgcm9mJo5ejvyxevHgGAKbrugDQI83OymTcTqrIM0vLshp9eZ5GxeOEKYDBUBhEBM2mwONxnPT5XNuyfK7urCzXcJvPkrGLLsaYYppm38KFC6+I2c/GJJHsvQB+kwiADQAKE0j24wA+AICrr7560vXXXz+xra2tWxod/TITk1CoGoaFYCgMu11pzc11tUEIMdCvQ9dNKJyhpNh7bOb04voZ04qMyiuLhgNgIQAHY0w/d+5cMDs721tdXT07Gn0DsCnBuFnyJPckAuCYvO9LEkxwwUF59NFH5wPQQ6GQYIz1So8xUSAC7+05ibd3HEVPz2Dz2OLs3RrnvVb3AMIDRrhoTObxMQXew5wzcIUjYskmpCp5hDsYY2pfX1/n/fffPyczMzMaRVkn9xBPpQBy48N9Q630qhQUQ9EbMvSFqqqqy5csWXKV3+9vVxRFlbH3WQC+MdTAvBw3crPTMbY06+SEcdm7HC6tHyAwjetOp7anr09vqD/SjobGDjQeTegKTJa8damqyk6ePNk9adKkwpUrV94Q0+enCcbeD+BEvH0wFABrAYyXKbGh6M7oL88888zf5+fnZ5w4ceK8qqpMhqlulu3TCrvAg4ICD/Lz3B2Zmc73XS77ABw2OF2OQE62e2uG23FIVRRoaqQNQdMRyQoHOOeD3d3dOoBATU3Nt1VVtcVsvisB37dhiHQ5T6Dy3olNeMbR+9Fj5PF43LW1tT8goqDf7w+oqmpKF/UbEqi06KCGI+1oONKOQ385g2PHu7o0RTnPnXZwzvQsb9rHBXme4Ji8DERbHH0dwA8ADHLO+0KhEJ0/f97/3HPPLZw1a1ZFjIxalcgVkY7TllQtwX+WE06UAY94qpa6dOzMmTMnvvLKK0sWLlz4W7/fj4KCApdpmm0ArpJG0lsA3ms44o86LFAUbnrcjsbCPPdVlhBdgaDe390dgG6Y8etcJqO8lwHoUhRFDwQC1NHRcWbFihUL4jLFX0siNx6WexpRcvTf5SZmJnheBuATADYA2Lx58/uLFi1aD8A5fvz4TMuyTCLyylNwTBpSDZVzftwBwMs5+3pPT+iq3t7Qac5ZDSJVpWg/+csMAOUyrjdFWnmdqqryzs7Owb6+vo6VK1cuePLJJxfFGXCJJP8qmTC5bKQAMHkdqpNMfo28EgCA3bt3NyxatGh9W1vb+YKCgnyn08kty4JMpjili9sqZUW/VFlRjzINkWxykdQoFoDznHOLiHhzc3MXAOv555+/ddmyZdfHCbenE/CXK69kJYD9IwUAiNTq/lFuoC9BnznymDsB4Ny5c+eXL1/+yoYNGz4CYCssLPTZbDYuhBDytKTJnzzOZxfStA7Juw4hBFpbW/sty+qdPXv2hGefffbWysrK8pgx9wF4Lgn/hxFJ8y9P+JZTiG/8Th7HqUn6lAP4AyJV4ZHMxZYtH61Zs2bX9u3bjwMQaWlpHq/Xa9c0jUtXeujAg2VRf3+/0dvb2w/AnDx5csFdd901++6774596zoiRRHJkjFPyqtRmjTSk2KApx7AnlgVmODKvIC4moLt27cffvXVVw/u3LnzRFNTU7dhGEaSaA0xxpSSkpKMWbNmldxyyy1Tbr/99umcc3tcdufO2NB2giTORumqd4wGAC5EqkWeSiFcPR/Av0ij6K/Ry2AwsH///pb6+np/S0tLb2dn56BpmtFYHnw+n1ZYWOiuqKjInzZtWnFeXp4vbt4ziFSB/nqY9a9FpDS/CsC7qcTRUm1FRNRPRD9Jsf/tRLSNLp4+JqIHiciRwprziEgQ0W2Xqli6SJa8bhjBmMtlyevbsrJ8OBokon1EtJqI5o5gnbvl+FsudbG0S+blwogUTnePYGyGzMyWIVLOosZogAFEqshOIHkl6FC0AZGPKRYAqBtpKPliytR7R+OjhYto1xDRUSL6CxF5vogPJhYS0Rki2k1E0z7HjfuIaD0RdRHRz77IL0ZivxxpJqLXiejqS7jxQiL6lVxry2h8rDGaH00VSRV5jTR3axEpZe28yHlV6cp+RxpcLQD+DcNXraeW8roEn81lIvIlyXyZoOxApHDqNzK8nuocy6ROL5GW3x5E6gXrR5NZdom/HZ6MSEXGfGnAvJTiuKnSwTkI4L8A7LhUDLL//3j6S05fegD+ZwD3gk1Njxe3yQAAAABJRU5ErkJggg==","varying vec3 v_positionMC;\n\t\t\t\tvarying vec3 v_positionEC;\n\t\t\t\tvarying vec2 v_st;\n\t\t\t\t\n\t\t\t\tvoid main()\n\t\t\t\t{\n\t\t\t\t\tczm_materialInput materialInput;\n\t\t\t\t\tvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\t\t\t\t#ifdef FACE_FORWARD\n\t\t\t\t\tnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\t\t\t\t#endif\n\t\t\t\t\tmaterialInput.s = v_st.s;\n\t\t\t\t\tmaterialInput.st = v_st;\n\t\t\t\t\tmaterialInput.str = vec3(v_st, 0.0);\n\t\t\t\t\tmaterialInput.normalEC = normalEC;\n\t\t\t\t\tmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\t\t\t\t\tvec3 positionToEyeEC = -v_positionEC;\n\t\t\t\t\tmaterialInput.positionToEyeEC = positionToEyeEC;\n\t\t\t\t\tczm_material material = czm_getMaterial(materialInput);\n\t\t\t\t#ifdef FLAT\n\t\t\t\t\tgl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\t\t\t\t#else\n\t\t\t\t\tgl_FragColor = czm_phong(normalize(positionToEyeEC), material",");\n\t\t\t\t\tif(out_FragColor.r==1.0&&out_FragColor.g==1.0&&out_FragColor.b==1.0&&out_FragColor.a==1.0){\n\t\t\t\t\t\tgl_FragColor.a = 0.0;\n\t\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t\t}\n\t\t\t","GeoLocateRatate","GeoRayPick","isOnly","BoundingRectangle","View","deferred","doPick","minimumRadius","postProcess","offscreen","_frameState","brdfLutGenerator","_brdfLutGenerator","environmentMap","_cubeMap","morphTime","cullingVolume","computeCullingVolume","_terrainExaggeration","minimumDisableDepthTestDistance","_minimumDisableDepthTestDistance","invertClassification","_sunColor","_actualInvertClassificationColor","isTranslucencySupported","invertClassificationColor","maximumScreenSpaceError","CullingVolume","_environmentState","skyAtmosphereCommand","skyBoxCommand","sunDrawCommand","sunComputeCommand","moonCommand","_depthPlane","renderTranslucentDepthForPick","planes","originalFramebuffer","useGlobeDepthFramebuffer","viewport","_hdr","globeDepth","useOIT","usePostProcess","useInvertClassification","PickDepth","derivedCommands","picking","depthOnlyCommand","EPSILON12","mergeSort","updateCamera","far","updateFrustum","ENVIRONMENT","clearGlobeDepth","_depthClearCommand","frustumCommandsList","opaqueFrustumNearOffset","stencilBuffer","updatePass","commands","GLOBE","indices","executeCopyDepth","TERRAIN_CLASSIFICATION","CLASSIFICATION","CESIUM_3D_TILE","CESIUM_3D_TILE_CLASSIFICATION","depthTexture","useDepthPicking","createPotentiallyVisibleSet","executeCopyColor","uniformState","_pickOffscreenView","pickFramebuffer","begin","disableThisFrame","pickEx","end","_defaultView","endFrame","_pick","ray","getDepthEx","readPixels","unpack","getPixelsEx","PickFramebuffer","watchPlane","_picker","Scene","_originalDestory","_originalUpdate","_updatePicked","_content","computeVisibilityWithPlaneMask","MASK_INDETERMINATE","MASK_OUTSIDE","_visibility_Old","visibility","computeIntersectionWithBoundingVolume","clippingPlanesOriginMatrix","_isClipped","INSIDE","OUTSIDE","Cesium3DTile","projectTo2D","_boundingVolume2D","MASK_INSIDE","INTERSECTING","COLUMN0ROW0","COLUMN0ROW1","COLUMN0ROW2","COLUMN1ROW0","COLUMN2ROW0","COLUMN2ROW2","_videoProject","_context2D","_width","_dirty","_sampler","_updateSize","videoWidth","timeupdate","_getCurrentTexture","_createSampler","_source","params","UNSIGNED_BYTE","copyFrom","_recreateParseCanvas","drawImage","nextPowerOfTwo","_readVideoFramePixels","videoHeight","_videoProjection","_uniforms","_postStage","_videoTexture","_addEvent","_removeEvent","_createEvent","_FS_Cone","uniform float mixNum;\n","uniform float videoDistance;\n","uniform sampler2D videoTexture;\n","uniform mat4 videoMapMatrix;\n","uniform mat4 videoViewMatrix;\n","uniform vec3 videoMapPosition;\n"," vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n"," return posInCamera;\n","bool videoVisibility(sampler2D shadowMap, vec4 position){\n"," vec4 positionEC = toEye(v_textureCoordinates, depth);\n"," if (any(lessThan(videoPosition.xyz, vec3(0.0))) || any(greaterThan(videoPosition.xyz, vec3(1.0))))\n"," bool visibility = videoVisibility(videoMapTexture, videoPosition);\n"," if(visibility){\n"," vec4 videoColor = texture(videoTexture, videoPosition.xy);\n"," }else{\n","_FS_Cone_Fill","uniform sampler2D videoMapTexture;\n","uniform vec4 u_videoColor;\n"," float visibility = step(position.z, texture(shadowMap, position.xy).r);\n"," return (visibility === 1.0);\n"," vec4 videoPosition = videoMapMatrix * positionEC;\n"," videoPosition /= videoPosition.w;\n"," vec4 videoColor = u_videoColor;\n"," out_FragColor = vec4(mix(color.rgb, videoColor.rgb, mixNum), 1.0);\n","_FS_Sphere"," mat4 viewScene = videoViewMatrix;\n"," out_FragColor = color;\n"," return;\n","_FS_Sphere_Fill"," vec4 positionWC = viewScene * positionEC;\n"," depth = length(videoMapPosition - positionWC.xyz);\n","_updateState","_getCurrentVideoTexture","fillVideo","_createUniforms","_createPostStage","_clearData","_addToScene","_removeFromScene","mixFactor","_getShadowMapTexture","_getShadowMapMatrix","_getViewMatrix","hitlineColor","fovDistance","_updatePost","hitlineType","_MinFovX","_maxFovX","_minFovY","_MinFovY","_maxFovY","_MaxFovY","_minFovDistance","_MinFovDistance","_maxFovDistance","_MaxFovDistance","_minHeading","_MinHeading","_maxHeading","_MaxHeading","_MinPitch","_maxPitch","_MaxPitch","_minRoll","_MinRoll","_MaxRoll","_minSegmentCount","_maxSegmentCount","_MaxSegmentCount","_isInvSphere","_isSphereType","_minFovX","_minPitch","_maxRoll","_MinSegmentCount","clampSegmentCount","clampFovY","clampFovDistance","clampHeading","clampPitch","_videoProjectionCamera","_fovY","_fovDistance","_mixFactor","_vs","_fs","_renderState","_segmentCount","_isNeedRecreate","_visibly","_shaderProgram","minFovX","config","maxFovX","maxFovY","minFovDistance","minHeading","maxHeading","minPitch","maxPitch","minRoll","maxRoll","minSegmentCount","maxSegmentCount","isSphereType","isInvSphere","fovX!","minFovY","fovY!","maxFovDistance","fovDistance!","heading!","roll!","mixFactor!","_render","render!","_getProjectionCamera","update!","_updatePosition","_tryCreate","_updateFovX","fovX","_updateFovY","_updatePitch","_updateRoll","_updateParams","fovY","_computeTransformInv","_computeTransform!","_createVS","uniform vec4 uDiffuseColor;\n","varying vec4 vColor;\n","varying vec4 clip_vertex;\n","varying float fWindowZ;\n","varying vec3 normal_vertex;\n","vec4 depthClampFarPlane(vec4 clipPos)\n"," fWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\n"," return clipPos;\n"," vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n"," gl_Position = depthClampFarPlane(pos);\n"," vColor = uDiffuseColor;\n"," normal_vertex = aPosition.xyz;\n","#extension GL_EXT_frag_depth : enable\n","#extension GL_OES_standard_derivatives : enable\n"," gl_FragDepth = min(fWindowZ * gl_FragCoord.w, 1.0);\n"," vec3 normal = cross(vec3(dFdx(normal_vertex.x), dFdx(normal_vertex.y), dFdx(normal_vertex.z)), vec3(dFdy(normal_vertex.x), dFdy(normal_vertex.y), dFdy(normal_vertex.z)));\n"," normal = normalize(normal);\n"," vec3 lightDirection = normalize(czm_sunPositionWC - vec3(eyePosition));\n"," vec4 diffuse = vColor * LIGHT_COLOR * nDotL;\n"," vec4 ambient = vColor * LIGHT_COLOR;\n"," out_FragColor = clamp(diffuse + ambient, vec4(0.0), vec4(1.0));\n","_createVACone","_fovX","_createBoundingVolume","_createVASphere","_createVA!","_createVASphereInv","_createRenderState","_createAttributes","_createShadeProgram","_createShadeProgram!","_createFS","fromCornerPoints","_updateBoundingVolume!","_computeTransform","_recreate!","LINES","_shadowMap","_updateMatrixEvent","_updateEvent","_createFramebufferDepth","_textureSize","_passes","_shadowMapTexture","_clearFramebuffer","_clearPassState","_destroyShadowFramebuffer","_colorAttachment","build","_updateOri","_sceneCamera","_lightCamera","videoProjectionMaps","deactive","updateFovX","updateFovY","updateFovDistance","_shadowMapMatrix","_nextName","VideoProjection","_instance","nextName","GeoVideoProjection","_videoProjectionConfig","_videoProjectionFrustumPrimitive","_videoTextureSource","_videoProjectionPostRender","_videoShadowMap","_fillVideo","DeveloperErrorEvent","AddToSceneEvent","RemoveFromSceneEvent","UpdateMatrixEvent","UpdateEvent","_rebuildPostRender","CreationEvent","clampFovX","_createShadowMap","_destroyPostStage","updatePosition","_updateFovDistance","_updateHeading","updateHeadingPitchRoll","updatePitch","updateRoll","clampRoll","updateHitLineColor","updateMixFactor","updateLineWidth","isSamedName","isSelf","updateHeading","_type","visibly","_removeAllEvent","_projectBackFaces","noname!","_findByName","destoryObject","getByIndex","removeByIndex","removeByName","getNames","_videoProjectionCollection","_renderVideoProjectionCollection","destroyAllVideoProjections","destroyVideoProjection","createVideoProjection","getVideoProjectionCollection","_clearPassesVideoProjectionCommands","_executePassesVideoProjectionCommands","_executeVideoProjectionCommand","shadows","castCommands","projectBackFaces","outOfView","shadowMapCullingVolume","_updateVideoProjectionCommand","castShadows","isVisible","originalCommand","createCastDerivedCommand","_updateVideoProjectionCommands","debugCommandFilter","logDepth","hdr","debugShowCommands","shadowState","receiveShadows","receiveCommand","oit","lightShadowMaps","lightShadowsEnabled","pickId","DerivedCommand","pickOnly","createDepthOnlyDerivedCommand","createHdrCommand","createReceiveDerivedCommand","isSupported","createDerivedCommands","GeoViewAnalyse","_stage","filterFar","inputPreviousStageTexture","_textureCache","outputTexture","_index","pixelFormat","forcePowerOfTwo","pixelDatatype","clearColor","initStage","uniform float u_filterFar;\n","vec4 clipToEye(vec2 uv, float depth)\n"," vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n"," vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\n"," posEC = posEC / posEC.w;\n","void main() {\n"," hsb.g = clamp(hsb.g + 0.03, 0.0, 1.0);\n"," if (hsb.b > 0.5)\n"," hsb.b = clamp(hsb.b + 0.01, 0.0, 1.0);\n"," hsb.b = clamp(hsb.b - 0.02, 0.0, 1.0);\n"," float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n"," vec4 posInCamera = clipToEye(v_textureCoordinates, depth);\n"," float d = length(posInCamera.xyz);\n"," if (d > u_filterFar)\n"," out_FragColor = vec4(mix(color.rgb, vec3(0.8, 0.85, 0.85), 1.0 - u_filterFar / d), 1.0);\n"," else \n"," out_FragColor = vec4(color.rgb, 1.0);\n","enableFilter","_isSupported","GeoWalkerAnimationCamera","path","moveStep","rotateStep","frameChange","_lockCamera","walkFrame","addChangeEventListener","_hooker","_hookUpdate","geoposition","unactivate","_walkAnimation","_isPause","changeEvent","raiseChangeEvent","isDone","_isDone","isPause","_begin","_toStop","state","_loadGeoposition","_loadDirection","run","ComputeTimeDelta","getMilliseconds","getSeconds","getMinutes","_createState","date","endDirection","moveSpeed","rotateSpeed","rotateSize","manHeight","manRange","stateType","UNKNOWN","_readyCamera","_walkQueue","canLog","_collideActived","collideActived","filterFog","keys","GeoWalkerCamera","logarithmicDepthBuffer","raiseUpdate","FORWARD","LEFTWARD","computeLeftward","UPWARD","computeTrunUp","DOWNWARD","computeTrunDown","computeTrunRight","jumpUp","computeInitialPosition","computeForeward","_computeCollideDistance","Forward : height = ","Forward Node : height = ","computeBackward","getTangentNormal","Backward : height = ","Backward Node : height = ","collide :"," max: ","Not collide","computeTrunLeft","raiseMouseMove","filterWithCamera","getFront","getRear","getAvgHeight","getDropThreshold","preventFalling","getLatelyHeight","GeoWater","_pointsToCartographic","_waterColor","_refractColor","_waveWidth","_flowDirection","_flowSpeed","_normalTexture","_m_startTime","_reflectCamera","_reflectPassState","_isVisible","_waterPolygon","_computeBoundingRectangle","_polygonHierarchy","_lonMin","_latMin","_waterCenterPos","initialize","RenderbufferFormat","DEPTH_COMPONENT16","PassState","_initialized","waterPolygon","workingFrustums","_fScale","setRow","invWorldViewMatrix","modelViewMatrix","modeiViewProjection","_fElapse","_frameTime","_flowAngle","in vec3 position;\n\t\t\t\t\t\t\t\t\t\t\tattribute vec2 st;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_modelViewProjectionMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_modelViewMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform mat4 u_invWorldViewMatrix;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_texCoordOffset;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_texCoordScale;\n\t\t\t\t\t\t\t\t\t\t\tuniform float u_frameTime;\n\t\t\t\t\t\t\t\t\t\t\tuniform int u_clampToGroud;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec3 u_camPos;\n\t\t\t\t\t\t\t\t\t\t\tuniform vec3 u_scale;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec3 eyeDir;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec2 texCoord;\n\t\t\t\t\t\t\t\t\t\t\tvarying float myTime;\n\t\t\t\t\t\t\t\t\t\t\tvarying vec4 projectionCoord;\n\t\t\t\t\t\t\t\t\t\t\tvoid main(void)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//gl_Position = ftransform();\n\t\t\t\t\t\t\t\t\t\t\t\tgl_Position = u_modelViewProjectionMatrix * vec4(position.xyz,1.0);\n\t\t\t\t\t\t\t\t\t\t\t\tif (u_clampToGroud === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\teyeDir = (u_camPos - position.xyz) * u_scale;\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec4 pos = u_modelViewMatrix * vec4(position.xyz,1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\teyeDir = vec3(u_invWorldViewMatrix*vec4(pos.xyz,0.0));\n\t\t\t\t\t\t\t\t\t\t\t\t\tprojectionCoord = gl_Position;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\ttexCoord = (st+u_texCoordOffset)*u_texCoordScale;\n\t\t\t\t\t\t\t\t\t\t\t\tmyTime = 0.01 * u_frameTime;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t","uniform sampler2D u_normalMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform sampler2D u_refractMap;\n\t\t\t\t\t\t\t\t\t\t\t\t//uniform samplerCube u_cubeMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform sampler2D u_reflectMap;\n\t\t\t\t\t\t\t\t\t\t\t\t//uniform sampler2D u_flowMap;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_waterColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_refractColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform int u_useRefractTex;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec4 u_reflectColor;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform int u_reflection;\n\t\t\t\t\t\t\t\t\t\t\t\tuniform vec2 u_flowDir;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec3 eyeDir;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec2 texCoord;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying float myTime;\n\t\t\t\t\t\t\t\t\t\t\t\tvarying vec4 projectionCoord;\n\t\t\t\t\t\t\t\t\t\t\t\tvoid main (void)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t// texScale determines the amount of tiles generated.\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat texScale = 35.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// texScale2 determines the repeat of the water texture (the normalmap) itself\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat texScale2 = 10.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat myangle;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat transp;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 myNormal;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 mytexFlowCoord = texCoord * texScale;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// ff is the factor that blends the tiles.\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 ff = abs(2.0*(fract(mytexFlowCoord)) - 1.0) -0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// take a third power, to make the area with more or less equal contribution\n\t\t\t\t\t\t\t\t\t\t\t\t\t// of more tile bigger\n\t\t\t\t\t\t\t\t\t\t\t\t\tff = 0.5-4.0*ff*ff*ff;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// ffscale is a scaling factor that compensates for the effect that\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adding normal vectors together tends to get them closer to the average normal\n\t\t\t\t\t\t\t\t\t\t\t\t\t// which is a visible effect. For more or less random waves, this factor\n\t\t\t\t\t\t\t\t\t\t\t\t\t// compensates for it\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 ffscale = sqrt(ff*ff + (1.0-ff)*(1.0-ff));\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 Tcoord = texCoord * texScale2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// offset makes the water move\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 offset = vec2(myTime,0.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// I scale the texFlowCoord and floor the value to create the tiling\n\t\t\t\t\t\t\t\t\t\t\t\t\t// This could have be replace by an extremely lo-res texture lookup\n\t\t\t\t\t\t\t\t\t\t\t\t\t// using NEAREST pixel.\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 sample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor(mytexFlowCoord)/ texScale).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// flowdir is supposed to go from -1 to 1 and the line below\n\t\t\t\t\t\t\t\t\t\t\t\t\t// used to be sample.xy * 2.0 - 1.0, but saves a multiply by\n\t\t\t\t\t\t\t\t\t\t\t\t\t// moving this factor two to the sample.b\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 flowdir = sample.xy -0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// sample.b is used for the inverse length of the wave\n\t\t\t\t\t\t\t\t\t\t\t\t\t// could be premultiplied in sample.xy, but this is easier for editing flowtexture\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir *= sample.b;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// build the rotation matrix that scales and rotates the complete tile\n\t\t\t\t\t\t\t\t\t\t\t\t\tmat2 rotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// this is the normal for tile A\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT0 = texture(u_normalMap, rotmat * Tcoord - offset).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// for the next tile (B) I shift by half the tile size in the x-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.5,0)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and the normal for tile B...\n\t\t\t\t\t\t\t\t\t\t\t\t\t// multiply the offset by some number close to 1 to give it a different speed\n\t\t\t\t\t\t\t\t\t\t\t\t\t// The result is that after blending the water starts to animate and look\n\t\t\t\t\t\t\t\t\t\t\t\t\t// realistic, instead of just sliding in some direction.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// This is also why I took the third power of ff above, so the area where the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// water animates is as big as possible\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adding a small arbitrary constant isn't really needed, but helps to show\n\t\t\t\t\t\t\t\t\t\t\t\t\t// a bit less tiling in the beginning of the program. After a few seconds, the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tiling cannot be seen anymore so this constant could be removed.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// For the quick demo I leave them in. In a simulation that keeps running for\n\t\t\t\t\t\t\t\t\t\t\t\t\t// some time, you could just as well remove these small constant offsets\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT1 = texture(u_normalMap, rotmat * Tcoord - offset*1.06+0.62).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blend them together using the ff factor\n\t\t\t\t\t\t\t\t\t\t\t\t\t// use ff.x because this tile is shifted in the x-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalTAB = ff.x * NormalT0 + (1.0-ff.x) * NormalT1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the scaling of NormalTab and NormalTCD is moved to a single scale of\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalT later in the program, which is mathematically identical to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalTAB = (NormalTAB - 0.5) / ffscale.x + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tile C is shifted in the y-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.0,0.5)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT0 = texture(u_normalMap, rotmat * Tcoord - offset*1.33+0.27).rg;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// tile D is shifted in both x- and y-direction\n\t\t\t\t\t\t\t\t\t\t\t\t\tsample = vec3(u_flowDir, 1.0);//texture( u_flowMap, floor((mytexFlowCoord + vec2(0.5,0.5)))/ texScale ).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tflowdir = sample.b * (sample.xy - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\trotmat = mat2(flowdir.x, -flowdir.y, flowdir.y ,flowdir.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT1 = texture(u_normalMap, rotmat * Tcoord - offset*1.24).rg ;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalTCD = ff.x * NormalT0 + (1.0-ff.x) * NormalT1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// NormalTCD = (NormalTCD - 0.5) / ffscale.x + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// now blend the two values togetherv\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 NormalT = ff.y * NormalTAB + (1.0-ff.y) * NormalTCD;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// this line below used to be here for scaling the result\n\t\t\t\t\t\t\t\t\t\t\t\t\t//NormalT = (NormalT - 0.5) / ffscale.y + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// below the new, direct scaling of NormalT\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT = (NormalT - 0.5) / (ffscale.y * ffscale.x);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// scaling by 0.3 is arbritrary, and could be done by just\n\t\t\t\t\t\t\t\t\t\t\t\t\t// changing the values in the normal map\n\t\t\t\t\t\t\t\t\t\t\t\t\t// without this factor, the waves look very strong\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT *= 0.3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// to make the water more transparent\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransp = 1.0;//texture( u_flowMap, texFlowCoord ).a;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and scale the normals with the transparency\n\t\t\t\t\t\t\t\t\t\t\t\t\tNormalT *= transp*transp;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// assume normal of plane is 0,0,1 and produce the normalized sum of adding NormalT to it\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyNormal = vec3(NormalT,sqrt(1.0-NormalT.x*NormalT.x - NormalT.y*NormalT.y));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 获取反射颜色。\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 envColor = u_reflectColor.rgb;//vec3(0.5647, 0.6941, 0.8235);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (u_reflection === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//vec3 reflectDir = reflect(eyeDir, myNormal);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//vec3 envColor = vec3(czm_textureCube(u_cubeMap, -reflectDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 如果要实现反射真实场景,需要把场景渲染5遍构建一个无底的立方体纹理。\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 目前使用一张反射纹理近似模拟。\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvec2 final = projectionCoord.xy / projectionCoord.w;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfinal = final * 0.5 + 0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfinal.y = 1.0 - final.y;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tenvColor = texture(u_reflectMap, final + myNormal.xy/texScale2*transp).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t// very ugly version of fresnel effect\n\t\t\t\t\t\t\t\t\t\t\t\t\t// but it gives a nice transparent water, but not too transparent\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyangle = dot(myNormal,normalize(eyeDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\tmyangle = 0.95-0.6*myangle*myangle;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blend in the color of the plane below the water\n\t\t\t\t\t\t\t\t\t\t\t\t\t// add in a little distortion of the colormap for the effect of a refracted\n\t\t\t\t\t\t\t\t\t\t\t\t\t// view of the image below the surface.\n\t\t\t\t\t\t\t\t\t\t\t\t\t// (this isn't really tested, just a last minute addition\n\t\t\t\t\t\t\t\t\t\t\t\t\t// and perhaps should be coded differently\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the correct way, would be to use the refract routine, use the alpha channel for depth of\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the water (and make the water disappear when depth = 0), add some watercolor to the colormap\n\t\t\t\t\t\t\t\t\t\t\t\t\t// depending on the depth, and use the calculated refractdir and the depth to find the right\n\t\t\t\t\t\t\t\t\t\t\t\t\t// pixel in the colormap.... who knows, something for the next version\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 base = u_refractColor.rgb;//vec3(0.3, 0.4, 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (u_useRefractTex === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbase = texture(u_refractMap,(texCoord + myNormal.xy/texScale2*0.03*transp)*32.0).rgb;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbase = mix(base, u_waterColor.rgb, u_waterColor.a);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// 光照计算\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 lightDir = czm_sunDirectionEC;//normalize(vec3(0.0, 0.0, 1.0)); // 光照方向需要从外面传入\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec3 reflectVec = reflect(-lightDir, myNormal);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat diffuse = max(0.0, dot(myNormal, lightDir));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat spec = max(dot(reflectVec, normalize(-eyeDir)), 0.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tspec = pow(spec, 128.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//float lightIntensity = 0.7 * diffuse + 0.3 * spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat lightIntensity = 0.3 * spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(mix(base, envColor, myangle*transp), 1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor += vec4(0.8)*lightIntensity;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// note that smaller waves appear to move slower than bigger waves\n\t\t\t\t\t\t\t\t\t\t\t\t\t// one could use the tiles and give each tile a different speed if that\n\t\t\t\t\t\t\t\t\t\t\t\t\t// is what you want\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t","_uniformMap","getColorTexture","_reflectColor","_waterGeometry","UNSIGNED_INT","water","_updateReflectTexture","ComputeCommand","proxy","metadata","roadMetadata","roadUrl","labelGraphics","billboardGraphics","aotuCollide","collisionPadding","serverFirstStyle","tileCache","labelCache","_isInitial","_latelyGrid","_UUID","GEO_WTFS_LABEL_","_UUIDRoad","getCacheTile","removeCacheTile","getCacheLabel","oid","addCacheLabel","removeCacheLabel","timestamp","getTileUrl","/GetTiles?lxys={z},{x},{y}","getIcoUrl","/GetIcon?id={id}","getRoadTileUrl","_timer","_tilesToRender","getTilesToRender","compareArray","_queueCall","_latelyRefreshStamp"];n=S,function(e){for(;--e;)n.push(n.shift())}(310);var T,P=function(e,t){return S[e-=0]},M=function(){function e(e,t){for(var i=0;iL.toRadians(20)?.75*v.positionCartographic[P("0x8b")]:v[P("0x91")].height-p);v[P("0x9e")](Le,Ne*Re)}}else G=!0}}e[P("0x58")]=!G}if(!A&&G||I){var Oe=S[P("0x9f")](m,e._zoomWorldPosition,B),Fe=(C!==E[P("0x8a")]&&n[P("0x84")](t,e[P("0x51")])&&l(Oe)?v[P("0x86")](Oe,k):v.getPickRay(t,k)).direction;C!==E[P("0x8a")]&&C!==E.SCENE2D||o[P("0x88")](Fe.y,Fe.z,Fe.x,Fe),v[P("0xa0")](Fe,p),e[P("0x57")]=!0}else v[P("0x82")](p);v[P("0x9c")](se)}else v[P("0x82")](p)}}}}var le=new y,ce=new y,ue=new o;function he(e,t,i){var r=e[P("0x42")][P("0x7e")],n=r[P("0x86")](i[P("0x63")],le)[P("0x87")],a=r[P("0x86")](i.endPosition,ce).origin;n=o[P("0x88")](n.y,n.z,n.x,n),a=o[P("0x88")](a.y,a.z,a.x,a);var s=o[P("0x95")](n,a,ue),x=o[P("0x96")](s);0e[P("0x5e")]&&(i=e[P("0x5e")]),ia[P("0x8c")].z&&l(r))return o.clone(r,e._strafeStartPosition),e[P("0x56")]=!0,tt(e,t,i),void(e[P("0xb7")]=n[P("0x6e")](t,e[P("0xb7")]));var f=v[P("0xb9")](u,h,Ee);c=a[P("0x86")](s,ye);var g=d.rayPlane(c,f,Ae),p=a.getPickRay(x,_e),m=d[P("0xba")](p,f,Ie);if(!l(g)||!l(m))return e[P("0x54")]=!0,Bt(e,t,i),void n[P("0x6e")](t,e[P("0xb6")]);var b=o[P("0x95")](g,m,we),C=b.x;b.x=b.y,b.y=b.z,b.z=C;var y=o[P("0x96")](b);y>L[P("0xbb")]&&(o[P("0x8d")](b,b),a[P("0xa0")](b,y))}}var Me=new n,Ne=new y,Le=new o,Re=new o,Oe=new m,Fe=new m,De=new o,ke=new v(o.UNIT_X,0),Ue=new o,Be=new s,We=new m,Ve=new C,je=new p,ze=new o;function He(e,t,i){if(l(i[P("0xaa")])&&(i=i.angleAndHeight),n.equals(t,e[P("0x4d")])||(e[P("0x53")]=!1,e._looking=!1),e[P("0x54")])Bt(e,t,i);else{var r=e[P("0x42")].camera;e[P("0x53")]||!e[P("0xbc")]()||r[P("0x8c")].z>e[P("0x3c")]?(e[P("0x53")]=!0,function(e,t,i){var r=e[P("0x42")],a=r.camera,s=r.canvas,x=Me;x.x=s[P("0x94")]/2,x.y=s[P("0x7c")]/2;var c,u=a[P("0x86")](x,Ne),f=o[P("0xb8")],d=u.origin,g=u[P("0x93")],p=o[P("0x92")](f,g);if(Math[P("0x78")](p)>L[P("0xbb")]&&(c=-o.dot(f,d)/p),!l(c)||c<=0)return e[P("0x54")]=!0,Bt(e,t,i),n[P("0x6e")](t,e[P("0x4d")]);var b=o.multiplyByScalar(g,c,Le);o.add(d,b,b);var v=r[P("0xbd")],C=v.ellipsoid;o[P("0x88")](b.y,b.z,b.x,b);var y=v[P("0xbe")](b,Be);C[P("0xa7")](y,b);var A=_[P("0xbf")](b,C,Oe),I=e[P("0x43")],w=e._ellipsoid;e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e._rotateFactor=1,e[P("0xc1")]=1;var G=m[P("0x6e")](a[P("0xaf")],We);a[P("0xc2")](A),xt(e,t,i,o[P("0xc3")]),a._setTransform(G),e[P("0x43")]=I;var E=(e[P("0x44")]=w)[P("0xc4")];e._rotateFactor=1/E,e[P("0xc1")]=E}(e,t,i)):function(e,t,i){var r,a,s=e[P("0x42")],x=s[P("0x7e")],c=o[P("0xb8")];if(n.equals(t,e[P("0x4d")]))r=o[P("0x6e")](e[P("0xc5")],Le);else{if(x[P("0x8c")].zL[P("0xbb")]&&(u=-o[P("0x92")](c,f)/b),!l(u)||u<=0)return e[P("0x54")]=!0,Bt(e,t,i),n[P("0x6e")](t,e[P("0x4d")]);r=o[P("0x6c")](g,u,Le),o.add(f,r,r)}n[P("0x6e")](t,e._tiltCenterMousePosition),o[P("0x6e")](r,e[P("0xc5")])}var y=s[P("0x48")],A=Me;A.x=y[P("0x94")]/2,A.y=e._tiltCenterMousePosition.y,a=x[P("0x86")](A,Ne);var I=o[P("0x6e")](o.ZERO,De);I.x=r.x;var w=v[P("0xb9")](I,c,ke),G=d[P("0xba")](a,w,Re),E=x[P("0xc6")],S=E.ellipsoid;o[P("0x88")](r.y,r.z,r.x,r);var T=E[P("0xbe")](r,Be);S[P("0xa7")](T,r);var M,N=_[P("0xbf")](r,S,Oe);M=l(G)?(o[P("0x88")](G.y,G.z,G.x,G),T=E[P("0xbe")](G,Be),S[P("0xa7")](T,G),_[P("0xbf")](G,S,Fe)):N;var R=e._globe,O=e._ellipsoid;e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e[P("0x5d")]=1,e[P("0xc1")]=1;var F=o[P("0xc3")],D=m[P("0x6e")](x.transform,We);x[P("0xc2")](N);var k=o[P("0x99")](o[P("0xc3")],o[P("0x8d")](x.position,Ue),Ue),U=o[P("0x92")](x[P("0x9b")],k);if(xt(e,t,i,F,!1,!0),x._setTransform(M),U<0){i[P("0x63")].y>i[P("0x64")].y&&(F=void 0);var B=x.constrainedAxis;x[P("0xc7")]=void 0,xt(e,t,i,F,!0,!1),x[P("0xc7")]=B}else xt(e,t,i,F,!0,!1);if(l(x[P("0xc7")])){var W=o[P("0x99")](x[P("0x93")],x.constrainedAxis,ze);o[P("0x62")](W,o[P("0x6f")],L[P("0xbb")])||(o[P("0x92")](W,x[P("0x9b")])<0&&o[P("0xc8")](W,W),o[P("0x99")](W,x.direction,x.up),o.cross(x[P("0x93")],x.up,x[P("0x9b")]),o.normalize(x.up,x.up),o.normalize(x[P("0x9b")],x[P("0x9b")]))}x._setTransform(D),e[P("0x43")]=R;var V=(e._ellipsoid=O)[P("0xc4")];e[P("0x5d")]=1/V,e[P("0xc1")]=V;var j=o[P("0x6e")](x[P("0xa5")],Ue);if(e[P("0x41")]&&jt(e),!o[P("0x84")](x[P("0xa5")],j)){x._setTransform(M),x[P("0xc9")](j,j);var z=o.magnitudeSquared(j);o.magnitudeSquared(x[P("0x8c")])>z&&(o.normalize(x[P("0x8c")],x[P("0x8c")]),o[P("0x6c")](x[P("0x8c")],Math[P("0xca")](z),x.position));var H=o[P("0xcb")](j,x[P("0x8c")]),q=o[P("0x99")](j,x[P("0x8c")],j);o[P("0x8d")](q,q);var X=C[P("0xcc")](q,H,Ve),Y=p[P("0xcd")](X,je);p[P("0xce")](Y,x.direction,x[P("0x93")]),p[P("0xce")](Y,x.up,x.up),o[P("0x99")](x[P("0x93")],x.up,x[P("0x9b")]),o.cross(x[P("0x9b")],x[P("0x93")],x.up),x._setTransform(D)}}(e,t,i)}}var qe=new n,Xe=new y,Ye=new o;function Ke(e,t,i){l(i.distance)&&(i=i[P("0x8e")]);var r=e[P("0x42")],n=r[P("0x7e")],a=r[P("0x48")],s=qe;s.x=a.clientWidth/2,s.y=a[P("0x7c")]/2;var x,c,u=n[P("0x86")](s,Xe);if(n[P("0x8c")].ze._minimumTrackBallHeight?(e[P("0x55")]=!0,xt(e,t,i)):(e[P("0x54")]=!0,Bt(e,t,i,c)),n.clone(t,e._rotateMousePosition))}else{i&&i[P("0x63")]&&i[P("0x64")]&&(t=i[P("0x64")],i[P("0x64")]=i[P("0x63")],i.startPosition=t,i[P("0x64")].x=(i.startPosition.x+i[P("0x64")].x)/2,i[P("0x64")].y=(i[P("0x63")].y+i[P("0x64")].y)/2);var p=function(e){var t=e[P("0x42")],i=t[P("0x7e")],r=t[P("0x43")][P("0x44")],n=_[P("0xbf")](i[P("0x8c")],r,wt),a=m.clone(i[P("0xaf")],Et);i[P("0xc2")](n);var s=new o;return s=m[P("0xd4")](i.viewMatrix,s,s),i._setTransform(a),s}(e);r[P("0x80")]>L[P("0x77")](e.constrainedPitch,-L.PI,0)&&0<=i.startPosition.y-i[P("0x64")].y||0e[P("0x5e")]&&(d=e[P("0x5e")]),de[P("0x3e")]?(e._tiltOnEllipsoid=!0,function(e,t,i){var r=e[P("0x44")],a=e[P("0x42")],s=a[P("0x7e")],x=.25*e[P("0x30")],c=r[P("0xd6")](s[P("0xa5")],Lt)[P("0x8b")];if(!(c-x-1e._minimumTrackBallHeight)){e[P("0x54")]=!0;var v=e[P("0x44")][P("0xd5")](s.position,Mt);return Bt(e,t,i,v),n[P("0x6e")](t,e._tiltCenterMousePosition)}var C=d[P("0xe3")](p,r);if(!l(C))return;var A=r[P("0xd6")](C,Pt);A.height=0,g=r.cartographicToCartesian(A,At)}var I=_[P("0xbf")](g,r,wt),w=e[P("0x43")],G=e[P("0x44")];e[P("0x43")]=void 0,e[P("0x44")]=h[P("0xc0")],e[P("0x5d")]=1,e[P("0xc1")]=1;var E=m[P("0x6e")](s[P("0xaf")],Et);s._setTransform(I),s[P("0x80")]>L[P("0x77")](e.constrainedPitch,-L.PI,0)&&0<=i[P("0x63")].y-i[P("0x64")].y?xt(e,0,i,o.UNIT_Z,!1,!0):xt(e,0,i,o[P("0xc3")]),s._setTransform(E),e[P("0x43")]=w;var S=(e._ellipsoid=G)[P("0xc4")];e._rotateFactor=1/S,e[P("0xc1")]=S}}(e,t,i)):function(e,t,i){var r,a,s,x=e[P("0x44")],c=e[P("0x42")],u=c[P("0x7e")];if(n[P("0x84")](t,e[P("0x4d")]))r=o.clone(e[P("0xc5")],At);else{if(r=Ce(e,t,At),!l(r)){if(a=u[P("0x86")](t,_t),s=d.rayEllipsoid(a,x),!l(s)){if(x[P("0xd6")](u[P("0x8c")],Pt)[P("0x8b")]<=e[P("0x40")]){e._looking=!0;var f=e[P("0x44")][P("0xd5")](u[P("0x8c")],Mt);Bt(e,t,i,f),n[P("0x6e")](t,e._tiltCenterMousePosition)}return}r=y[P("0xe1")](a,s[P("0xe2")],At)}n.clone(t,e[P("0x4d")]),o.clone(r,e[P("0xc5")])}var g=c[P("0x48")],b=yt;b.x=g[P("0x94")]/2,b.y=e[P("0x4d")].y,a=u[P("0x86")](b,_t);var v=o.magnitude(r),A=o[P("0x88")](v,v,v,nt),I=h[P("0xd7")](A,ot);if(s=d[P("0xe0")](a,I),l(s)){var w=o[P("0x96")](a[P("0x87")])>v?s.start:s[P("0xe4")],G=y[P("0xe1")](a,w,It),E=_[P("0xbf")](r,x,wt),S=_[P("0xbf")](G,I,Gt),T=e[P("0x43")],M=e[P("0x44")];e[P("0x43")]=void 0,e[P("0x44")]=h.UNIT_SPHERE,e[P("0x5d")]=1,e[P("0xc1")]=1;var N=o[P("0xc3")],R=m[P("0x6e")](u[P("0xaf")],Et);u._setTransform(E);var O=o[P("0x99")](G,u.positionWC,ze),F=o[P("0x92")](u[P("0xe5")],O);if(xt(e,0,i,N,!1,!0),u[P("0xc2")](S),F<0){i.startPosition.y>i[P("0x64")].y&&(N=void 0);var D=u[P("0xc7")];u[P("0xc7")]=void 0,xt(e,0,i,N,!0,!1),u.constrainedAxis=D}else(u[P("0x80")]W&&(o.normalize(u[P("0x8c")],u[P("0x8c")]),o[P("0x6c")](u[P("0x8c")],Math[P("0xca")](W),u[P("0x8c")]));var V=o[P("0xcb")](B,u[P("0x8c")]),j=o[P("0x99")](B,u.position,B);o[P("0x8d")](j,j);var z=C.fromAxisAngle(j,V,St),H=p[P("0xcd")](z,Tt);p[P("0xce")](H,u[P("0x93")],u[P("0x93")]),p[P("0xce")](H,u.up,u.up),o[P("0x99")](u[P("0x93")],u.up,u[P("0x9b")]),o[P("0x99")](u[P("0x9b")],u[P("0x93")],u.up),u._setTransform(R)}}}(e,t,i)}}var Lt=new s,Rt=new n,Ot=new n,Ft=new y,Dt=new y,kt=new o,Ut=new o;function Bt(e,t,i,r){var n=e[P("0x42")][P("0x7e")],a=Rt;a.x=i.startPosition.x,a.y=0;var s=Ot;s.x=i[P("0x64")].x,s.y=0;var c,u,h=n[P("0x86")](a,Ft),f=n[P("0x86")](s,Dt),d=0;n.frustum instanceof b?(c=h[P("0x87")],u=f[P("0x87")],o[P("0x6d")](n[P("0x93")],c,c),o.add(n[P("0x93")],u,u),o[P("0x95")](c,n[P("0x8c")],c),o[P("0x95")](u,n[P("0x8c")],u),o[P("0x8d")](c,c),o[P("0x8d")](u,u)):(c=h[P("0x93")],u=f[P("0x93")]);var g=o[P("0x92")](c,u);g<1&&(d=Math[P("0xdc")](g)),d=i[P("0x63")].x>i[P("0x64")].x?-d:d;var p=e[P("0x4c")];if(l(r)?n[P("0xe7")](r,-d):l(p)?n[P("0xe7")](p,-d):n.lookLeft(d),a.x=0,a.y=i[P("0x63")].y,s.x=0,s.y=i[P("0x64")].y,h=n.getPickRay(a,Ft),f=n[P("0x86")](s,Dt),d=0,n[P("0xe8")]instanceof b?(c=h[P("0x87")],u=f.origin,o[P("0x6d")](n[P("0x93")],c,c),o[P("0x6d")](n[P("0x93")],u,u),o.subtract(c,n[P("0x8c")],c),o[P("0x95")](u,n.position,u),o.normalize(c,c),o[P("0x8d")](u,u)):(c=h[P("0x93")],u=f.direction),(g=o.dot(c,u))<1&&(d=Math.acos(g)),d=i.startPosition.y>i[P("0x64")].y?-d:d,r=x(r,p),l(r)){var m=n[P("0x93")],v=o.negate(r,kt),C=o[P("0x62")](m,r,L[P("0xe9")]),y=o.equalsEpsilon(m,v,L[P("0xe9")]);if(C||y)(C&&d<0||y&&0=n[5]?(n[6]=n[0],n[7]=n[1],n[8]=n[5]):(n[6]=n[3],n[7]=n[4],n[8]=n[2]),t[P("0x187")](t[P("0x0")]-1)[P("0x19f")]=e[P("0x11")].fromDegreesArrayHeights(n)),i?i.get(i[P("0x0")]-1).position=e[P("0x11")][P("0x1a1")](l,c,u):((i=r[P("0x17d")][P("0x6d")](new e.LabelCollection)).name=P("0x193"),i[P("0x6d")]({text:P("0x185"),font:P("0x1a0"),showBackground:!0,disableDepthTestDistance:Number[P("0x31")]}),i[P("0x187")](i[P("0x0")]-1).position=e[P("0x11")][P("0x1a1")](l,c,u))}else i&&(r[P("0x17d")].remove(i),i=null)}),e[P("0x161")][P("0x163")]),this[P("0x16f")][P("0x160")]((function(t){if(r[P("0x16f")]=r.handler&&r.handler.destroy(),r.viewer[P("0x48")].style[P("0x170")]=P("0x18c"),i&&(r[P("0x17d")][P("0x17f")](i),i=null),r[P("0x191")]){var o=new(e[P("0x18e")])({polyline:{positions:e[P("0x11")][P("0x19e")](n)}});r.callback(o)}}),e[P("0x161")][P("0x189")])}},t.prototype[P("0x192")]=function(){this[P("0x16f")]=this.handler&&this[P("0x16f")][P("0xf4")](),this[P("0x13b")][P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),i(P("0x193"),this[P("0x17d")]),i("draw_polyline",this[P("0x17d")])}}(Cesium$2),function(e){var t=e[P("0x1a2")]=function(t,i){this.viewer=t.viewer,this[P("0x169")]=t[P("0x169")]?t[P("0x169")]:e[P("0x16a")][P("0x16b")],this[P("0x1a3")]=t[P("0x1a3")]?t[P("0x1a3")]:10,this.scene=this[P("0x13b")][P("0x10f")],this.camera=this[P("0x13b")][P("0x7e")],this.canvas=this.scene.canvas,this[P("0x17d")]=this.scene.primitives,this[P("0xef")]=this.scene.globe.ellipsoid,this.callback=i||null};function i(e,t){for(var i=0;i=W[P("0x1e1")].HALF_PI&&x=Math.PI&&x<1.5*Math.PI?(r=s*Math[P("0x98")](x-Math.PI),n=s*Math[P("0x9a")](x-Math.PI),o=W[P("0x1d2")][P("0x1df")](e,a,W[P("0x1e1")].HALF_PI,r,!0),W[P("0x1d2")].getThirdPoint(a,o,W[P("0x1e1")][P("0x1e0")],n,!0)):(r=s*Math[P("0x98")](2*Math.PI-x),n=s*Math[P("0x9a")](2*Math.PI-x),o=W[P("0x1d2")][P("0x1df")](e,a,W.Constants[P("0x1e0")],r,!0),W.PlotUtils[P("0x1df")](a,o,W[P("0x1e1")][P("0x1e0")],n,!1))},R[P("0x1cd")][P("0x1ea")]=function(e){e=R[P("0x1cd")].dereplication(e),this[P("0x1eb")]=F.tailWidthFactor,this[P("0x1ec")]=F[P("0x1ec")],this[P("0x1ed")]=F.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(!((d=(t[P("0x1d8")]=e)[P("0x0")])<2)){if(2===e.length)return t.polygonalPoint=e,t;var i=e,r=i[0],n=i[1];W[P("0x1d2")].isClockWise(i[0],i[1],i[2])&&(r=i[1],n=i[0]);var o=[W.PlotUtils[P("0x1e5")](r,n)].concat(i[P("0x1d5")](2)),a=R[P("0x1cd")][P("0x1ee")](o,r,n,F),s=a[0],x=a[4],l=W[P("0x1d2")][P("0x8e")](r,n),c=W[P("0x1d2")][P("0x1e2")](o),u=c*this[P("0x1eb")]*this[P("0x1ec")];this.swallowTailPnt=W[P("0x1d2")][P("0x1df")](o[1],o[0],0,u,!0);var h=l/c,f=R[P("0x1cd")][P("0x1ef")](o,s,x,h),d=f[P("0x0")],g=[r][P("0x1c6")](f[P("0x1d5")](0,d/2));g[P("0x17c")](s);var p,m=[n][P("0x1c6")](f.slice(d/2,d));m[P("0x17c")](x),g=W[P("0x1d2")].getQBSplinePoints(g),m=W[P("0x1d2")][P("0x1f0")](m),p=R[P("0x1cd")][P("0x1d7")](g[P("0x1c6")](a,m[P("0x1e3")](),[this[P("0x1ed")],g[0]])),t.polygonalPoint=Cesium$2.Cartesian3[P("0x1da")](p)}return t},R[P("0x1cd")][P("0x1ee")]=function(e,t,i,r){this[P("0x1db")]=r[P("0x1db")],this.headTailFactor=r[P("0x1f1")],this[P("0x1dc")]=r[P("0x1dc")],this[P("0x1de")]=r[P("0x1de")],this[P("0x1dd")]=r[P("0x1dd")];var n=W[P("0x1d2")].getBaseLength(e),o=n*this.headHeightFactor,a=e[e[P("0x0")]-1];n=W[P("0x1d2")].distance(a,e[e[P("0x0")]-2]);var s=W[P("0x1d2")][P("0x8e")](t,i);o>s*this.headTailFactor&&(o=s*this[P("0x1f1")]);var x=o*this[P("0x1dc")],l=o*this.neckWidthFactor,c=(o=nClick to add new point ("+x[P("0x0")]+P("0x267")+(2双击可结束绘制

":P("0x272");a[P("0x205")](i,h)}}}),D.ScreenSpaceEventType.MOUSE_MOVE),u[P("0x160")]((function(e){r[P("0x188")](e,t)}),D.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},i[P("0x5")].drawEnd=function(t,i){var r,n=this.positions,o=this.minPoints,a=this[P("0x273")];if(i=this[P("0x132")],null===t){if(this[P("0x26f")]){if(this.stopDrawing(),w()(i[P("0x191")])!==P("0x8"))return;n[P("0x0")],i[P("0x191")](a[P("0x19f")],a[P("0x236")]),this[P("0x26f")]=!1}}else if(null!==(r=t[P("0x8c")])){if(n[P("0x0")]点击以增加第一个控制点

");else{var r=a[P("0x7e")][P("0xa2")](i,e),o=D.Cartographic.fromCartesian(r),s=[D.Math.toDegrees(o[P("0x112")]),D.Math[P("0x113")](o[P("0x114")])];if(r){if(l[P("0x25c")](),r.y+=1+Math.random(),l[P("0x17c")](r),3===c[P("0x0")]&&(c[P("0x25c")](),c[P("0x17c")](s)),2===c[P("0x0")]&&c[P("0x17c")](s),2<=l.length){var u=R[P("0x1cd")].doubleArrow(c);n[P("0x19f")]=u?u[P("0x1d9")]:null,n.custom=u?u[P("0x1d8")]:null,n[P("0x219")]=!0}var h=3===l[P("0x0")]?P("0x274"):P("0x272");x[P("0x205")](i,h)}}}),D[P("0x161")][P("0x163")]),h.setInputAction((function(e){o[P("0x188")](e,r)}),D[P("0x161")][P("0x269")])},i.prototype[P("0x275")]=function(t){t=G(t,o),this.startDrawing((function(){null!==l&&a[P("0x17f")](l),c[P("0x17f")](),u[P("0xf4")](),s.setVisible(!1)}));var r=this,n=this._scene,a=this[P("0x42")].primitives,s=this[P("0x1f6")],x=[],l=null,c=null,u=new(D[P("0x15f")])(n[P("0x48")]);u.setInputAction((function(o){if(null!==o.position){var s=n[P("0x7e")][P("0xa2")](o[P("0x8c")],e);if(s)if(null===l){var u=D.Cartographic[P("0x175")](s),h=D[P("0x23")][P("0x113")](u[P("0x112")]),f=D[P("0x23")][P("0x113")](u[P("0x114")]);x.push(h,f);var d=y(x,x);l=new(i[P("0x276")])({extent:d,asynchronous:!1,material:t[P("0x19c")]}),a[P("0x6d")](l),c=new i.BillboardGroup(r,p);var g=_([x,x]);c[P("0x243")](g)}else r.stopDrawing(),w()(t[P("0x191")])===P("0x8")&&(u=D[P("0x13")][P("0x175")](s),h=D.Math[P("0x113")](u.longitude),f=D[P("0x23")][P("0x113")](u[P("0x114")]),t[P("0x191")](y(x,[h,f])))}}),D[P("0x161")].LEFT_DOWN),u[P("0x160")]((function(t){var i=t[P("0x64")];if(null!==i)if(null===l)s.showAt(i,"

点击开始绘制

");else{var r=n[P("0x7e")][P("0xa2")](i,e);if(r){var o=D.Cartographic[P("0x175")](r),a=D.Math[P("0x113")](o[P("0x112")]),u=D.Math[P("0x113")](o[P("0x114")]),h=y(x,[a,u]);l[P("0x230")](h);var f=_([x,[a,u]]);c[P("0x25d")](f),s.showAt(i,P("0x277"))}}}),D.ScreenSpaceEventType[P("0x163")])},i.prototype[P("0x1f8")]=function(){var r=this;function n(e){r[P("0x42")],this[P("0x27c")]&&this._highlighted===e||!0!==this[P("0x204")]&&((this[P("0x27c")]=e)?(r.setHighlighted(this),this[P("0x27d")]=this[P("0x228")],this[P("0x22c")](D[P("0x16a")][P("0x27e")](P("0x27f")),this.strokeWidth)):this._strokeColor?this[P("0x22c")](this._strokeColor,this[P("0x22d")]):this[P("0x22c")](void 0,void 0))}function o(n){if(this[P("0x204")]!==n)if(r[P("0x20d")](),n){r[P("0x20f")](this);var o=r[P("0x42")],a=this;if(null===this[P("0x280")]){function n(e,t){var i=e-1<0?t.length-1:e-1;i=e[1]&&t[0]>=e[0]?i=r+Math.PI:t[1]>=e[1]&&t[0]=e[0]&&(i=Math.PI-r),i},W[P("0x1d2")].getAngleOfThreePoints=function(e,t,i){var r=W[P("0x1d2")][P("0x2bc")](t,e)-W[P("0x1d2")][P("0x2bc")](t,i);return r<0?r+W[P("0x1e1")].TWO_PI:r},W[P("0x1d2")].isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},W[P("0x1d2")][P("0x2bd")]=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},W.PlotUtils[P("0x2be")]=function(e,t,i,r,n){var o=1-(e=Math[P("0xee")](Math[P("0x7d")](e,1),0)),a=e*e,s=a*e,x=o*o,l=x*o;return[l*t[0]+3*x*e*i[0]+3*o*a*r[0]+s*n[0],l*t[1]+3*x*e*i[1]+3*o*a*r[1]+s*n[1]]},W.PlotUtils[P("0x1df")]=function(e,t,i,r,n){var o=W[P("0x1d2")][P("0x2bc")](e,t),a=n?o+i:o-i,s=r*Math.cos(a),x=r*Math[P("0x98")](a);return[t[0]+s,t[1]+x]},W[P("0x1d2")][P("0x2bf")]=function(e,t,i,r){var n,o,a=[],s=r-i;s=s<0?s+W[P("0x1e1")].TWO_PI:s;for(var x=0;x<=W[P("0x1e1")][P("0x2c0")];x++){var l=i+s*x/W.Constants[P("0x2c0")];n=e[0]+t*Math[P("0x9a")](l),o=e[1]+t*Math.sin(l),a[P("0x17c")]([n,o])}return a},W[P("0x1d2")][P("0x2c1")]=function(e,t,i,r){var n=W[P("0x1d2")].getNormal(t,i,r),o=Math[P("0xca")](n[0]*n[0]+n[1]*n[1]),a=n[0]/o,s=n[1]/o,x=W[P("0x1d2")].distance(t,i),l=W[P("0x1d2")][P("0x8e")](i,r);if(o>W[P("0x1e1")][P("0x2c2")])if(W.PlotUtils[P("0x1d3")](t,i,r)){var c=e*x,u=i[0]-c*s,h=i[1]+c*a,f=[u,h];c=e*l;var d=[u=i[0]+c*s,h=i[1]-c*a]}else c=e*x,f=[u=i[0]+c*s,h=i[1]-c*a],c=e*l,d=[u=i[0]-c*s,h=i[1]+c*a];else f=[u=i[0]+e*(t[0]-i[0]),h=i[1]+e*(t[1]-i[1])],d=[u=i[0]+e*(r[0]-i[0]),h=i[1]+e*(r[1]-i[1])];return[f,d]},W[P("0x1d2")].getNormal=function(e,t,i){var r=e[0]-t[0],n=e[1]-t[1],o=Math[P("0xca")](r*r+n*n);r/=o,n/=o;var a=i[0]-t[0],s=i[1]-t[1],x=Math[P("0xca")](a*a+s*s);return[r+(a/=x),n+(s/=x)]},W[P("0x1d2")][P("0x2c3")]=function(e,t){for(var i=[W.PlotUtils[P("0x2c4")](t)],r=0;rW[P("0x1e1")][P("0x2c2")])var s=W.PlotUtils.mid(i,r),x=i[0]-s[0],l=i[1]-s[1],c=2/W[P("0x1d2")][P("0x8e")](i,r),u=-c*l,h=c*x,f=u*u-h*h,d=2*u*h,g=h*h-u*u,p=o[0]-s[0],m=o[1]-s[1],b=s[0]+f*p+d*m,v=s[1]+d*p+g*m;else b=i[0]+t*(r[0]-i[0]),v=i[1]+t*(r[1]-i[1]);return[b,v]},W[P("0x1d2")].getRightMostControlPoint=function(e){var i=e[P("0x0")],r=e[i-3],n=e[i-2],o=e[i-1],a=W[P("0x1d2")][P("0x2c1")](0,r,n,o)[1],s=W.PlotUtils[P("0x2c6")](r,n,o);if(Math[P("0xca")](s[0]*s[0]+s[1]*s[1])>W[P("0x1e1")].ZERO_TOLERANCE)var x=W.PlotUtils[P("0x1e5")](n,o),l=o[0]-x[0],c=o[1]-x[1],u=2/W[P("0x1d2")][P("0x8e")](n,o),h=-u*c,f=u*l,d=h*h-f*f,g=2*h*f,p=f*f-h*h,m=a[0]-x[0],b=a[1]-x[1],v=x[0]+d*m+g*b,C=x[1]+g*m+p*b;else v=o[0]+t*(n[0]-o[0]),C=o[1]+t*(n[1]-o[1]);return[v,C]},W[P("0x1d2")][P("0x1d6")]=function(e){if(e[P("0x0")]<=2)return e;for(var t=[],i=e[P("0x0")]-1,r=0;r<=1;r+=.01){for(var n=y=0,o=0;o<=i;o++){var a=W[P("0x1d2")][P("0x2c7")](i,o),s=Math[P("0x2ae")](r,o),x=Math[P("0x2ae")](1-r,i-o);n+=a*s*x*e[o][0],y+=a*s*x*e[o][1]}t.push([n,y])}return t[P("0x17c")](e[i]),t},W.PlotUtils[P("0x2c7")]=function(e,t){return W[P("0x1d2")][P("0x2c8")](e)/(W[P("0x1d2")][P("0x2c8")](t)*W[P("0x1d2")][P("0x2c8")](e-t))},W[P("0x1d2")][P("0x2c8")]=function(e){if(e<=1)return 1;if(2===e)return 2;if(3===e)return 6;if(4===e)return 24;if(5===e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},W[P("0x1d2")].getQBSplinePoints=function(e){if(e[P("0x0")]<=2)return e;var t=[],i=e[P("0x0")]-2-1;t[P("0x17c")](e[0]);for(var r=0;r<=i;r++)for(var n=0;n<=1;n+=.05){for(var o=y=0,a=0;a<=2;a++){var s=W[P("0x1d2")][P("0x2c9")](a,n);o+=s*e[r+a][0],y+=s*e[r+a][1]}t.push([o,y])}return t[P("0x17c")](e[e[P("0x0")]-1]),t},W[P("0x1d2")][P("0x2c9")]=function(e,t){return 0===e?Math[P("0x2ae")](t-1,2)/2:1===e?(-2*Math[P("0x2ae")](t,2)+2*t+1)/2:2===e?Math[P("0x2ae")](t,2)/2:0},W[P("0x1e1")]={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},function(e){var t=e[P("0x2ca")]=function(t,i){this.viewer=t[P("0x13b")],this.color=t[P("0x169")]?t[P("0x169")]:e[P("0x16a")][P("0x196")].withAlpha(.5),this[P("0x197")]=t.lineWidth?t[P("0x197")]:2,this.scene=this[P("0x13b")][P("0x10f")],this.camera=this[P("0x13b")][P("0x7e")],this[P("0x48")]=this[P("0x10f")][P("0x48")],this[P("0x17d")]=this[P("0x10f")][P("0x17d")],this[P("0xef")]=this[P("0x10f")][P("0xa3")].ellipsoid,this[P("0x1a9")]=0,this[P("0x2cb")]=[],this[P("0xd3")]=t[P("0xd3")]?t[P("0xd3")]:1};function i(e,t){for(var i=0;i=n[5]?(n[6]=n[0],n[7]=n[1],n[8]=n[5]):(n[6]=n[3],n[7]=n[4],n[8]=n[2]),t[P("0x187")](t.length-1).positions=e[P("0x11")][P("0x19e")](n)),(i=r[P("0x17d")].add(new(e[P("0x1a4")])))[P("0x2cc")]=P("0x30d")+"_"+r.count,i[P("0x176")]=P("0x30e"),i[P("0x6d")]({position:a,color:r[P("0x169")],pixelSize:r[P("0x1a3")]}),r[P("0x172")]=n,r.measureEnd()),0===n.length&&(n[P("0x17c")](l),n[P("0x17c")](c),n.push(u),n[P("0x17c")](l),n[P("0x17c")](c),n[P("0x17c")](u),n[P("0x17c")](l),n.push(c),n[P("0x17c")](u),(t=r.primitives[P("0x6d")](new e.PolylineCollection))[P("0x2cc")]=P("0x30d")+"_"+r[P("0x1a9")],t.name=P("0x30f"),t[P("0x6d")]({polyline:{}}),t.get(t[P("0x0")]-1)[P("0x19a")]=r[P("0x197")],t.get(t[P("0x0")]-1)[P("0x19b")]=!0,t[P("0x187")](t[P("0x0")]-1)[P("0x19c")].uniforms[P("0x169")]=r[P("0x169")],t[P("0x187")](t[P("0x0")]-1)[P("0x19f")]=e[P("0x11")][P("0x19e")](n),(i=r.primitives[P("0x6d")](new e.PointPrimitiveCollection))[P("0x2cc")]=P("0x30d")+"_"+r.count,i[P("0x176")]=P("0x30e"),i[P("0x6d")]({position:a,color:r[P("0x169")],pixelSize:r[P("0x1a3")]}))}}),e.ScreenSpaceEventType[P("0x17e")])}},t[P("0x5")][P("0x2d2")]=function(t){this[P("0x16f")]=this[P("0x16f")]&&this[P("0x16f")][P("0xf4")](),this[P("0x16f")]=new(e[P("0x15f")])(this[P("0x48")]);var i=this;this[P("0x16f")][P("0x160")]((function(t){var r=i.viewer[P("0x10f")].pick(t.position);r&&r[P("0x2fc")]&&r[P("0x2fc")][P("0x2cc")]&&-1=this[P("0x172")][5]?(x.push(this._array_[5]),this._array_[5]):(x.push(this[P("0x172")][2]),this._array_[2]);var r=e.Cartesian3[P("0x1a1")](this[P("0x172")][0],this[P("0x172")][1],t),n=e[P("0x11")].fromDegrees(this._array_[3],this[P("0x172")][4],t),o=e[P("0x11")][P("0x8e")](r,n);a=o<1e3?P("0x311")+o.toFixed(2)+"m":P("0x311")+(o/1e3)[P("0x2af")](2)+"km",i(this[P("0x17d")],a,x,this.count);var a,s=Math.abs(this._array_[2]-this[P("0x172")][5]),x=[];this[P("0x172")][2]>=this[P("0x172")][5]?(x[P("0x17c")](this[P("0x172")][0]),x[P("0x17c")](this[P("0x172")][1])):(x.push(this[P("0x172")][3]),x.push(this[P("0x172")][4])),x[P("0x17c")]((this[P("0x172")][2]+this._array_[5])/2),a=s<1e3?P("0x312")+s[P("0x2af")](2)+"m":P("0x312")+(s/1e3)[P("0x2af")](2)+"km",i(this[P("0x17d")],a,x,this[P("0x1a9")]),(x=[]).push((this[P("0x172")][0]+this[P("0x172")][3])/2),x[P("0x17c")]((this[P("0x172")][1]+this[P("0x172")][4])/2),x[P("0x17c")]((this[P("0x172")][2]+this[P("0x172")][5])/2);var l=Math[P("0xca")](Math.pow(o,2)+Math[P("0x2ae")](s,2));a=l<1e3?P("0x313")+l[P("0x2af")](2)+"m":P("0x313")+(l/1e3)[P("0x2af")](2)+"km",i(this.primitives,a,x,this[P("0x1a9")]),this[P("0x1a9")]++,this.callback(o,s,l,this._array_)},t[P("0x5")][P("0x192")]=function(){this[P("0x16f")]=this[P("0x16f")]&&this.handler[P("0xf4")](),this[P("0x13b")][P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),function(e){for(var t=0;t=t[5]?(t[6]=t[0],t[7]=t[1],t[8]=t[5],r=t[5],n=[t[3],t[4],t[5]],t[0],t[3],t[1],t[4],t[0],t[1],t[2],t[5],o[P("0x17c")](t[3],t[4],t[5],t[0],t[1],t[2]),a.push(t[3],t[4],t[5],t[0],t[1],t[5])):(t[6]=t[3],t[7]=t[4],t[8]=t[2],r=t[2],n=[t[0],t[1],t[2]],t[0],t[3],t[1],t[4],t[3],t[4],t[2],t[5],o[P("0x17c")](t[0],t[1],t[2],t[3],t[4],t[5]),a[P("0x17c")](t[0],t[1],t[2],t[3],t[4],t[2])),i.get(0)[P("0x19f")]=e[P("0x11")][P("0x19e")](o),i[P("0x187")](1)[P("0x19f")]=e.Cartesian3[P("0x19e")](a);var s=e[P("0x11")][P("0x1a1")](t[0],t[1],r),x=e[P("0x11")][P("0x1a1")](t[3],t[4],r);!function(t,i,r,n,o){var a;t<1e3?t[P("0x2af")](2):(t/1e3)[P("0x2af")](2),i<1e3?i[P("0x2af")](2):(i/1e3)[P("0x2af")](2),a=Math.round(e[P("0x23")].toDegrees(Math[P("0x321")](i/t)))+"°";var s=function(e,t){for(var i=0;ithis[P("0x32f")]&&(this[P("0x326")]=this[P("0x32f")]),ti._maxHeight&&(i._designElevation=i[P("0x32f")]),oe.Math.PI_OVER_TWO&&(a.x=-1,a.y*=-1),o>e.Math.PI&&(a.x=-1),o>3*e[P("0x23")][P("0x5b")]&&(a.x=1,a.y=-a.y),e[P("0x11")][P("0x8d")](a,a);var s=new(e[P("0x368")])(a,this.cylinderRadius);r[P("0x17c")](s)}return this[P("0x365")]=r},i[P("0x5")][P("0x369")]=function(t,i){for(var r=new(e[P("0x36a")])({modelMatrix:e[P("0x14")](t)?t:e[P("0x1b")][P("0xae")],edgeWidth:this[P("0x360")],edgeColor:this[P("0x361")],unionClippingRegions:this[P("0x363")],enabled:this[P("0x364")]}),n=this[P("0x367")](i),o=0;oI[I[P("0x0")]-1]&&x[S+1]I[I[P("0x0")]-1]&&x[S-1]t[P("0x45d")]&&t[P("0x45f")][P("0x25c")](),t._arrayVertex[P("0x17c")](r),t[P("0x45c")].positions=t[P("0x45f")]}}),e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(i){if(null!==t._polylineCollection){var r=t[P("0x13b")][P("0x7e")][P("0x86")](i.position),n=t[P("0x13b")][P("0x10f")][P("0xa3")][P("0xa4")](r,t[P("0x13b")].scene),o=e[P("0x13")].fromCartesian(n);t[P("0x460")][P("0x17c")](e.Math[P("0x113")](o.longitude)),t[P("0x460")][P("0x17c")](e.Math[P("0x113")](o.latitude)),t._outPoints.push(o[P("0x8b")]),t[P("0x304")][P("0x17f")](t[P("0x45c")]),t.viewer.scene[P("0x17d")][P("0x17f")](t[P("0x304")]),t.handler.destroy(),t.handler=void 0,t._polylineCollection=void 0,t[P("0x45c")]=void 0,t[P("0x45d")]=0,t.viewer[P("0x48")][P("0x150")][P("0x170")]=P("0x18c"),t._excavationRegion=new e.GeoExcavationRegion({viewer:t[P("0x13b")],samplingPoints:t[P("0x45f")],depth:t[P("0x456")],sideMaterial:t._sideMaterial,bottomMaterial:t._bottomMaterial,interNumber:10}),t[P("0x45a")](t[P("0x460")])}}),e[P("0x161")][P("0x189")])}},t[P("0x5")].clear=function(){this[P("0x45e")]&&(this[P("0x460")][P("0x0")]=0,this._arrayVertex[P("0x0")]=0,this[P("0x45e")][P("0xf4")](),this[P("0x45e")]=void 0)}}(Cesium$2),function(e){var t=e[P("0x102")];(e[P("0x461")]=function(e,i){e=t(e,t[P("0x128")]),this.viewer=e.viewer,this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x48")]=this[P("0x10f")][P("0x48")],this.camera=this.scene[P("0x7e")],this[P("0x17d")]=this[P("0x10f")].primitives,this[P("0x191")]=i||null,this.contourUniforms={},this[P("0x462")]={}}).prototype[P("0x463")]=function(o){var a=!1;if(o&&o[P("0x464")]){a=t(o[P("0x464")][P("0x3b6")],!1);var s=t(o[P("0x464")][P("0x19a")],2),x=t(o.contour[P("0x465")],150),l=t(o[P("0x464")][P("0x169")],e[P("0x16a")].RED[P("0x6e")]())}var c="none";if(o&&o[P("0x466")]&&(c=o[P("0x466")],-1===["elevation",P("0x467"),P("0x468"),P("0x2b4")][P("0x2d3")](c)))return alert("输入值可选elevation,slope,aspect,none中的一个!"),!1;var u,h=-414,f=8777;return o&&o.minHeight&&(h=o[P("0x3ea")]),o&&o[P("0x3eb")]&&(f=o.maxHeight),a?(c===P("0x469")?(u=new e.Material({fabric:{type:P("0x485"),materials:{contourMaterial:{type:P("0x471")},elevationRampMaterial:{type:P("0x472")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x486")}},translucent:!1}),this[P("0x462")]=u[P("0x46a")][P("0x46b")][P("0x19d")],this[P("0x462")][P("0x46c")]=h,this[P("0x462")][P("0x46d")]=f,this.contourUniforms=u[P("0x46a")][P("0x46e")].uniforms):c===P("0x467")?(u=new(e[P("0x212")])({fabric:{type:P("0x487"),materials:{contourMaterial:{type:P("0x471")},slopeRampMaterial:{type:P("0x473")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x488")}},translucent:!0}),this[P("0x462")]=u[P("0x46a")][P("0x46f")].uniforms,this[P("0x470")]=u[P("0x46a")][P("0x46e")][P("0x19d")]):c===P("0x468")?(u=new(e[P("0x212")])({fabric:{type:P("0x489"),materials:{contourMaterial:{type:P("0x471")},aspectRampMaterial:{type:P("0x474")}},components:{diffuse:"contourMaterial.alpha === 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:P("0x48a")}},translucent:!1}),this[P("0x462")]=u[P("0x46a")].aspectRampMaterial[P("0x19d")],this[P("0x470")]=u.materials[P("0x46e")][P("0x19d")]):(u=e[P("0x212")][P("0x213")](P("0x471")),this[P("0x470")]=u[P("0x19d")]),this.contourUniforms.width=s,this[P("0x470")][P("0x465")]=x,this.contourUniforms.color=l):c===P("0x469")?(u=e.Material[P("0x213")](P("0x472")),this.shadingUniforms=u.uniforms,this[P("0x462")].minimumHeight=h,this[P("0x462")].maximumHeight=f):c===P("0x467")?(u=e.Material[P("0x213")](P("0x473")),this[P("0x462")]=u[P("0x19d")]):c===P("0x468")&&(u=e[P("0x212")][P("0x213")](P("0x474")),this[P("0x462")]=u.uniforms),c!==P("0x2b4")&&(this.shadingUniforms[P("0x475")]=function(e){var t=document[P("0x15c")](P("0x48"));t[P("0x19a")]=100,t[P("0x8b")]=1;var o,a=t[P("0x476")]("2d");e===P("0x469")?o=i:e===P("0x467")?o=r:"aspect"===e&&(o=n);var s=a[P("0x477")](0,0,100,0);return 7===o[P("0x0")]?(s.addColorStop(o[0],P("0x478")),s[P("0x479")](o[1],P("0x47a")),s[P("0x479")](o[2],"#D33B7D"),s[P("0x479")](o[3],"#D33038"),s[P("0x479")](o[4],"#FF9742"),s[P("0x479")](o[5],"#ffd700"),s[P("0x479")](o[6],P("0x47b"))):(s[P("0x479")](o[0],P("0x47c")),s[P("0x479")](o[1],"#599668"),s.addColorStop(o[2],P("0x47d")),s[P("0x479")](o[3],"#fafcb4"),s.addColorStop(o[4],P("0x47e")),s.addColorStop(o[5],P("0x47f")),s[P("0x479")](o[6],P("0x480")),s[P("0x479")](o[7],P("0x481")),s[P("0x479")](o[8],P("0x482")),s[P("0x479")](o[9],P("0x483")),s[P("0x479")](o[10],"#420202")),a[P("0x484")]=s,a.fillRect(0,0,100,1),t}(c)),this[P("0x10f")][P("0xa3")][P("0x19c")]=u,!0};var i=[0,.045,.1,.15,.37,.54,1],r=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],n=[0,.2,.4,.6,.8,.9,1]}(Cesium$2),function(e){var t=e.GeoTilesetFlatten=function(t){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x48b")]=!1,this[P("0x48c")]=!1,this[P("0x48d")]=[],this[P("0x48e")]=e[P("0x102")](t[P("0x48e")],!0),this.show=e.defaultValue(t[P("0x221")],!0),this[P("0xef")]=e.defaultValue(t[P("0xef")],e[P("0x16")].WGS84)};function i(t){var i=t.content._model;e.defined(i)&&e[P("0x14")](i.platSlot)&&delete i[P("0x48f")]}function r(t){var i=t[P("0x490")]._model;if(e.defined(i)){var r=i[P("0x48f")];if(!e[P("0x14")](r))throw new e.DeveloperError("storing of model vertex buffers is fail.")}}t.prototype[P("0x491")]=function(t){if(!e[P("0x14")](t))throw new(e[P("0x15")])("parameter tileset is required.");if(e[P("0x14")](this[P("0x492")]))throw new(e[P("0x15")])(P("0x493"));this[P("0x492")]=t,(this._tileset[P("0x494")]=this)[P("0x48c")]=!0,this[P("0x492")].tileUnload[P("0x130")](i),this[P("0x492")][P("0x495")].addEventListener(r)},t.prototype[P("0x496")]=function(e){this.show!==e&&(this[P("0x48c")]=!0),this[P("0x221")]=e},t[P("0x5")][P("0x497")]=function(e){return this[P("0x221")]},t[P("0x5")][P("0x498")]=function(){return this[P("0x48c")]},t[P("0x5")][P("0x499")]=function(){this[P("0x48c")]=!1},t[P("0x5")][P("0x49a")]=function(t){var i=this;if(void 0!==t&&t instanceof Array){var r=t.length;if(!(r<3)){for(var n=[],o=i[P("0x48e")],a=0;aa[P("0x112")]?u=a[P("0x112")]:ca[P("0x114")]?h=a.latitude:f(o=e.Cartographic.clone(d[n],new(e[P("0x13")])))[P("0x112")]?u=o[P("0x112")]:co[P("0x114")]?h=o[P("0x114")]:fL.x?u=L.x:hL.y?f=L.y:dL.z?g=L.z:pU[P("0x112")]?R=U[P("0x112")]:OU[P("0x114")]?D=U[P("0x114")]:Fy.x?f=y.x:gy.y?d=y.y:pI.x?b=I.x:CI.y?v=I.y:yt.maxX||st.maxY)return!1;var x,l,c,u,h,f,d={z:!1,b:!1,t:!1},g=t.pts,p=g.length;for(n=0,o=p-1;nthis[P("0x4fa")]&&this[P("0x10f")][P("0x4fc")][P("0x259")](d-1,1);var g,p=this[P("0x4fb")][h-1];p.frustum=new e.PerspectiveFrustum({fov:e[P("0x23")][P("0x119")](s),aspectRatio:1.6,near:1,far:n}),g={context:this[P("0x10f")][P("0x3cc")],lightCamera:p,cascadesEnabled:!1,darkness:.5,isPointLight:!1},this[P("0x10f")][P("0x4fc")].push(new e.ShadowMap(g));var m=this[P("0x10f")].expandShadowMapList[this[P("0x10f")].expandShadowMapList.length-1];m[P("0x508")][P("0x3cf")]=0,m[P("0x364")]=!0,m.size=2048,m[P("0x509")]=!0,p[P("0x50a")](l,new(e[P("0xa9")])(c,u,1e-21)),x(f,this[P("0x17d")]),this.primitives.add(new e.DebugCameraPrimitive({camera:p,color:e[P("0x16a")][P("0x50b")](1,1,1,1),id:f}))}},r[P("0x5")][P("0x192")]=function(){this[P("0x10f")][P("0x3b3")][P("0x509")]=void 0;for(var e=this[P("0x4fb")].length,r=0;r-e[P("0x23")][P("0xab")]&&(t[P("0x537")]-=e[P("0x23")].TWO_PI));break;case 39:i[P("0x54a")]?(t[P("0x538")]+=t[P("0x54b")],t[P("0x538")]>e[P("0x23")][P("0xab")]&&(t._roll-=e[P("0x23")][P("0xab")])):t[P("0x542")]-=50;break;case 37:i[P("0x54a")]?(t[P("0x538")]-=t[P("0x54b")],t[P("0x538")]e.Math[P("0xab")]&&(t[P("0x550")][P("0x80")]-=e[P("0x23")][P("0xab")]));break;case 39:i.shiftKey?(t[P("0x550")][P("0x81")]+=t[P("0x54b")],t[P("0x550")].roll>e[P("0x23")][P("0xab")]&&(t[P("0x550")][P("0x81")]-=e[P("0x23")].TWO_PI)):(t[P("0x550")][P("0x7f")]+=t.deltaRadians,t[P("0x550")][P("0x7f")]>e[P("0x23")].TWO_PI&&(t.hpRoll[P("0x7f")]-=e[P("0x23")][P("0xab")]));break;case 37:i[P("0x54a")]?(t.hpRoll.roll-=t[P("0x54b")],t.hpRoll.roll<0&&(t[P("0x550")][P("0x81")]+=e[P("0x23")][P("0xab")])):(t[P("0x550")][P("0x7f")]-=t[P("0x54b")],t[P("0x550")][P("0x7f")]<0&&(t.hpRoll[P("0x7f")]+=e[P("0x23")].TWO_PI))}}))}}(Cesium$2),function(e){var t=e[P("0x567")]=function(t){this[P("0x13b")]=t[P("0x13b")],this[P("0x568")]=t[P("0x568")],this[P("0x569")]=t.pointArray,this[P("0xe2")]=t[P("0xe2")],this[P("0x56a")]=t[P("0xe4")],this[P("0x539")]=t[P("0x539")],this.deltaHeight=e[P("0x102")](t[P("0x53d")],10),this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x7e")]=this[P("0x13b")][P("0x7e")],this[P("0x56b")]=new(e[P("0x11")])(0,0,0),this[P("0x56c")]=[],this[P("0x565")]=null,this[P("0x2ec")]=[],this.bearing=[],this[P("0x56d")]=[],this[P("0x56e")]=[],this[P("0x56f")]=0,this.VerticalRadians=0,this.i=0,this[P("0x53e")]()};t[P("0x5")][P("0x3f7")]=function(){for(var t=0;t=this[P("0x5bf")]&&(this[P("0x5cf")]=0);var t=e[P("0x5d0")]()/1e3;0this[P("0x5bf")]&&(this[P("0x5cf")]=this._life)):this[P("0x5bc")]=t},t[P("0x5")][P("0x5c9")]=function(e){this[P("0x5d1")](e),this[P("0x5d2")](e)},t.prototype[P("0x5d1")]=function(t){var s=t.context,x=this;if(!this[P("0x5b5")]){var l=this[P("0x5b5")]=new(e[P("0x5d3")]);l[P("0x5d4")]=e.Pass.TRANSLUCENT,l[P("0x5cd")]=this,l[P("0x4ac")]=this[P("0x5c7")],l[P("0x5d5")]=e[P("0x5d6")][P("0x5d7")]({cull:{enabled:!1},depthTest:{enabled:!0,func:e[P("0x5d8")][P("0x5d9")]},depthMask:!1,blending:e[P("0x5da")][P("0x5db")]}),l[P("0x5cc")]=e[P("0x5dc")][P("0x5d7")]({context:s,defines:[P("0x5dd")],vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:{aPoint:0,aNormal:1,aT:2}}),l[P("0x5de")]={u_color:function(){return x[P("0x596")]},u_metallicFactor:function(){return x[P("0x5c0")]},u_roughnessFactor:function(){return x[P("0x5c2")]},u_emissiveFactor:function(){return x[P("0x5c4")]},u_normalMatrix:function(){return e[P("0x1b")][P("0x5df")](t[P("0x7e")][P("0x5e0")],x[P("0x5c7")],i),e[P("0x1b")][P("0x4e2")](i,r),e[P("0x1b")][P("0x5e1")]?e[P("0x1b")][P("0x5e1")](r,n):e.Matrix4[P("0x5e2")]?e.Matrix4[P("0x5e2")](r,n):(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10]),e[P("0x1a")][P("0x5e3")](n,n)}}}this[P("0x5b5")][P("0x5cb")]=this[P("0x5b8")],this[P("0x5b5")].boundingVolume=this[P("0x4a4")]};var i=new(e[P("0x1b")]),r=new(e[P("0x1b")]),n=new(e[P("0x1a")]);t[P("0x5")][P("0x5d2")]=function(t){var a=t.context,x=this;if(!this[P("0x5b6")]){var l=this._drawCommandOpaque=new(e[P("0x5d3")]);l[P("0x5d4")]=e[P("0x5e4")][P("0x5e5")],l[P("0x5cd")]=this,l.modelMatrix=this._modelTransform,l.renderState=e[P("0x5d6")][P("0x5d7")]({cull:{enabled:!1},depthTest:{enabled:!0,func:e[P("0x5d8")].LEQUAL},depthMask:!1}),l[P("0x5cc")]=e[P("0x5dc")][P("0x5d7")]({context:a,defines:["HDR"],vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:{aPoint:0,aNormal:1,aT:2}}),l[P("0x5de")]={u_color:function(){return x._color},u_metallicFactor:function(){return x[P("0x5c0")]},u_roughnessFactor:function(){return x._roughnessFactor},u_emissiveFactor:function(){return x._emissiveFactor},u_normalMatrix:function(){return e[P("0x1b")][P("0x5df")](t[P("0x7e")][P("0x5e0")],x[P("0x5c7")],i),e[P("0x1b")][P("0x4e2")](i,r),e.Matrix4[P("0x5e1")]?e.Matrix4[P("0x5e1")](r,n):e.Matrix4[P("0x5e2")]?e[P("0x1b")][P("0x5e2")](r,n):(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10]),e[P("0x1a")][P("0x5e3")](n,n)}}}this[P("0x5b6")][P("0x5cb")]=this._va,this[P("0x5b6")][P("0x4bc")]=this[P("0x4a4")]},t[P("0x5")]._updateVA=function(t){this[P("0x5b8")]&&(this._va[P("0xf4")](),this[P("0x5b8")]=null);var i=e[P("0x23")][P("0xab")],r=this[P("0x5cf")]*this[P("0x5b9")];if(!(r<1e-5)){var n=0;if(this[P("0x5cf")]/this[P("0x5bf")]<.5)n=this[P("0x5be")]*this[P("0x5cf")];else{var o=this._life-this[P("0x5cf")];n=this[P("0x5be")]*o}var a=this[P("0x5e6")](r);if(!(n<1e-5)){for(var s,x,l,c,u=t.context,h=i/a,f=2*a,d=3*f,g=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")][P("0x5e9")],3*f),p=e.ComponentDatatype.createTypedArray(e[P("0x5e8")][P("0x5e9")],3*f),m=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")][P("0x5e9")],f),b=e.ComponentDatatype[P("0x5e7")](e[P("0x5e8")].UNSIGNED_SHORT,d),v=0,C=0,y=0,_=0,A=0;At.west?t.west:r,t[P("0x2aa")]=r>t[P("0x2aa")]?r:t[P("0x2aa")],t[P("0x2ab")]=n>t[P("0x2ab")]?t[P("0x2ab")]:n,t[P("0x2ac")]=n>t[P("0x2ac")]?n:t[P("0x2ac")]}return t}return!1},t[P("0x5")][P("0x683")]=function(e,t,i){var r=document[P("0x15c")](P("0x15d"));return i&&r.setAttribute("id",i),r[P("0x21b")]("style",P("0x684")+e+P("0x685")+t+"px; margin: 0px; display: none;"),document[P("0x686")][P("0x167")](r),r},t[P("0x5")][P("0x687")]=function(t){var i=t._heatmap[P("0x688")](),r=new(e[P("0x10c")])({url:i,rectangle:t[P("0x689")]});return r[P("0x68a")]=new(e[P("0x68b")])({rectangleSouthwestInMeters:new(e[P("0x10")])(t[P("0x68c")][P("0x2a9")],t[P("0x68c")][P("0x2ab")]),rectangleNortheastInMeters:new(e[P("0x10")])(t[P("0x68c")][P("0x2aa")],t._mbounds[P("0x2ac")])}),r},t.prototype[P("0x68d")]=function(e){for(var t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<(e||8);r++)t+=i[P("0x68e")](Math[P("0x3e8")](Math[P("0x266")]()*i[P("0x0")]));return t};var i=new(e[P("0x68f")]);t[P("0x5")][P("0x690")]=function(t){var r=i[P("0x5a")](e.Cartographic[P("0x1a1")](t.x,t.y));return{x:r.x,y:r.y}},t[P("0x5")][P("0x691")]=function(t){var r=i.project(e[P("0x13")][P("0x1a1")](t[P("0x2a9")],t[P("0x2ab")])),n=i[P("0x5a")](e[P("0x13")][P("0x1a1")](t[P("0x2aa")],t.north));return{north:n.y,east:n.x,south:r.y,west:r.x}},t.prototype[P("0x692")]=function(t){var r=i[P("0xbe")](new(e[P("0x11")])(t.x,t.y));return{x:r[P("0x112")],y:r[P("0x114")]}},t.prototype[P("0x693")]=function(t){var r=i[P("0xbe")](new e.Cartesian3(t[P("0x2a9")],t[P("0x2ab")])),n=i[P("0xbe")](new(e[P("0x11")])(t[P("0x2aa")],t.north));return{north:this[P("0x694")](n.latitude),east:this.rad2deg(n[P("0x112")]),south:this[P("0x694")](r[P("0x114")]),west:this[P("0x694")](r[P("0x112")])}},t[P("0x5")][P("0x695")]=function(e){return e*(Math.PI/180)},t.prototype[P("0x694")]=function(e){return e/(Math.PI/180)},t[P("0x5")].wgs84PointToHeatmapPoint=function(e){return this.mercatorPointToHeatmapPoint(this[P("0x690")](e))},t[P("0x5")][P("0x696")]=function(e){var t={};return t.x=Math[P("0x5f0")]((e.x-this[P("0x697")])/this[P("0x698")]+this._spacing),t.y=Math.round((e.y-this._yoffset)/this[P("0x698")]+this[P("0x699")]),t.y=this.height-t.y,t},t[P("0x5")]._setWidthAndHeight=function(e){this[P("0x19a")]=0this[P("0x8b")]&&this[P("0x19a")]>this[P("0x67e")][P("0x69a")]?(this._factor=this[P("0x19a")]/this.defaults[P("0x69a")],this[P("0x8b")]/this[P("0x698")]this[P("0x19a")]&&this[P("0x8b")]>this[P("0x67e")][P("0x69a")]?(this[P("0x698")]=this[P("0x8b")]/this[P("0x67e")][P("0x69a")],this[P("0x19a")]/this._factorthis[P("0x67e")][P("0x69a")]&&(this[P("0x698")]=this[P("0x8b")]/this.defaults[P("0x69a")])):this.heightthis.defaults[P("0x69a")]&&(this[P("0x698")]=this[P("0x19a")]/this[P("0x67e")][P("0x69a")])),this[P("0x19a")]=this[P("0x19a")]/this[P("0x698")],this.height=this[P("0x8b")]/this[P("0x698")]},t[P("0x5")][P("0x69c")]=function(t,i,r){if(this._id=this[P("0x68d")](),this[P("0x69d")]=this._computeBounds(r),this[P("0x68c")]=this[P("0x691")](this[P("0x69d")]),this[P("0x69e")](this[P("0x68c")]),this[P("0x67b")][P("0x181")]=Math.round(this.heatmapOptions.radius?this[P("0x67b")].radius:this[P("0x19a")]>this[P("0x8b")]?this[P("0x19a")]/this[P("0x67e")][P("0x69f")]:this.height/this[P("0x67e")].radiusFactor),this[P("0x699")]=this[P("0x67b")][P("0x181")]*this[P("0x67e")].spacingFactor,this[P("0x697")]=this[P("0x68c")].west,this[P("0x6a0")]=this[P("0x68c")][P("0x2ab")],this[P("0x19a")]=Math.round(this[P("0x19a")]+2*this[P("0x699")]),this[P("0x8b")]=Math[P("0x5f0")](this[P("0x8b")]+2*this[P("0x699")]),this[P("0x68c")][P("0x2a9")]-=this[P("0x699")]*this[P("0x698")],this[P("0x68c")][P("0x2aa")]+=this[P("0x699")]*this[P("0x698")],this._mbounds[P("0x2ab")]-=this._spacing*this._factor,this[P("0x68c")].north+=this[P("0x699")]*this[P("0x698")],this.bounds=this[P("0x693")](this._mbounds),this[P("0x689")]=e[P("0x26b")].fromDegrees(this[P("0x6a1")][P("0x2a9")],this[P("0x6a1")][P("0x2ab")],this[P("0x6a1")].east,this[P("0x6a1")].north),this[P("0x6a2")]?(this[P("0x224")]&&this[P("0x6a2")].setAttribute("id",this[P("0x224")]),this._container.setAttribute("style",P("0x684")+this[P("0x19a")]+P("0x685")+this[P("0x8b")]+P("0x6a3"))):this[P("0x6a2")]=this[P("0x683")](this[P("0x19a")],this[P("0x8b")],this[P("0x224")]),this.heatmapOptions[P("0x131")]=this[P("0x6a2")],this._heatmap?this._heatmap[P("0x6a4")]():this[P("0x6a5")]=h337[P("0xa")](this[P("0x67b")]),this._container[P("0x12f")][0].setAttribute("id",this[P("0x224")]+P("0x6a6")),r&&0=P("0x6ac")?t[P("0x6ad")]=!0:"1.16"<=e[P("0x373")]&&(t[P("0x671")]=.99),this[P("0x6a8")]=this[P("0x13b")][P("0x194")][P("0x6d")]({show:!0,rectangle:{coordinates:this[P("0x689")],material:t}})}else this._layer&&this.viewer[P("0x10f")][P("0x6a9")].remove(this[P("0x6a8")]),this[P("0x6a8")]=this[P("0x13b")][P("0x10f")].imageryLayers[P("0x6ae")](this._getImageryProvider(this))}}(Cesium$2),function(e){function t(t){if(t=e[P("0x102")](t,e[P("0x102")].EMPTY_OBJECT),!e.defined(t[P("0x13b")]))throw new DeveloperError(P("0x63a"));if(this[P("0x13c")]=t[P("0x13b")],!e[P("0x14")](t.center))throw new DeveloperError(P("0x65f"));if(!e[P("0x14")](t[P("0x6af")]))throw new DeveloperError(P("0x6b0"));this[P("0x5b4")]=e[P("0x102")](t[P("0x11a")],[]),this[P("0x6b1")]=t.url;var i=e[P("0x102")](this[P("0x5b4")][2],e.GeoImageCircle.DEFAULT_HEIGHT);this[P("0x217")]=i,this._radius=e.defaultValue(t[P("0x181")],e[P("0x6b2")][P("0x64c")]),this[P("0x596")]=e[P("0x102")](t[P("0x169")],e[P("0x6b2")][P("0x648")]);var r=this[P("0x5b4")][0],n=this._center[1],o=e[P("0x102")](this[P("0x63c")],0),a=this._color,s=this[P("0x6b1")];this._ellipse=null,this[P("0x63e")]=e[P("0x102")](t.classificationType,e[P("0x6b2")][P("0x640")]),this._createImageCircle(r,n,i,o,s,a),this[P("0x646")]=e[P("0x102")](t.isShow,!0),this[P("0x645")](this._isShow)}t[P("0x5")][P("0xf4")]=function(){this._viewer&&this._viewer[P("0x194")][P("0x17f")](this[P("0x6b3")])},t[P("0x5")].setShow=function(t){this[P("0x646")]=e[P("0x102")](t,!0),this[P("0x6b3")][P("0x221")]=t},t[P("0x5")].setColor=function(t){this[P("0x596")]=e[P("0x102")](t,e[P("0x6b2")][P("0x648")]),this[P("0x6b3")][P("0x649")][P("0x19c")][P("0x169")]=this[P("0x596")]},t[P("0x5")][P("0x64a")]=function(){return this[P("0x596")]},t[P("0x5")][P("0x64b")]=function(t){this[P("0x63c")]=e[P("0x102")](t,e[P("0x6b2")][P("0x64c")]),this[P("0x6b3")][P("0x649")][P("0x64d")]=this._radius,this[P("0x6b3")].ellipse[P("0x64d")]=this._radius},t[P("0x5")].getRadius=function(){return this[P("0x63c")]},t[P("0x5")].setCenter=function(t){if(!e.defined(t))throw new DeveloperError(P("0x650"));this[P("0x6b3")].position=position,this[P("0x5b4")]=position},t[P("0x5")][P("0x6b4")]=function(t,i,r,n,o,a){var s=this[P("0x13c")],x=e[P("0x23")][P("0x119")](30);if(!this[P("0x6b3")]){var l=s[P("0x194")].add({position:e[P("0x11")][P("0x1a1")](t,i,r),ellipse:{classificationType:this._classificationType,semiMinorAxis:n,semiMajorAxis:n,rotation:new(e[P("0x652")])(c,!1),stRotation:new(e[P("0x652")])(c,!1),material:new(e[P("0x651")])({color:a,image:o,transparent:!0})}});this._ellipse=l}function c(){return x+=.05}},e.GeoImageCircle=t,e.GeoImageCircle[P("0x63b")]=0,e[P("0x6b2")][P("0x640")]=e[P("0x17a")][P("0x6b5")],e.GeoImageCircle[P("0x64c")]=25e3,e[P("0x6b2")][P("0x648")]=e[P("0x16a")].WHITE}(Cesium$2),function(e){function t(){this[P("0x6b6")]=null,this[P("0x5ba")]=!1,this._speed=0,this[P("0x6b7")]=null,this[P("0x6b8")]=1,this[P("0x5bf")]=0,this[P("0x5cf")]=0,this._mode=0}t[P("0x5")][P("0x69")]=function(){this[P("0x5ba")]=!0,this[P("0x5cf")]=0},t[P("0x5")][P("0xd2")]=function(e){this._actived&&(this[P("0x5cf")]+=e,this[P("0x5cf")]>this[P("0x5bf")]&&(this[P("0x5ba")]=!1))},e[P("0xf")](t.prototype,{position:{get:function(){return this[P("0x6b6")]},set:function(e){e&&(this._position=e[P("0x6e")](this[P("0x6b6")]))}},direction:{get:function(){return this[P("0x6b7")]},set:function(e){e&&(this._direction=e.clone(this[P("0x6b7")]))}},actived:{get:function(){return this[P("0x5ba")]}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}},baseScale:{get:function(){return this[P("0x6b8")]},set:function(e){this._baseScale=e}},life:{get:function(){return this[P("0x5bf")]},set:function(e){this[P("0x5bf")]=e}},time:{get:function(){return this[P("0x5cf")]}},mode:{get:function(){return this[P("0x6b9")]},set:function(e){this._mode=e}}});var i=new(e[P("0x11")]),r=e.GeoLineFireEffect=function(t){t=t||{},this[P("0x6b1")]=t.url?e[P("0x6ba")](t[P("0x6af")]):null,this[P("0x6bb")]=t[P("0x6bc")]?e[P("0x6ba")](t[P("0x6bc")]):null,this._explode=t.explode?t[P("0x6bd")]:0,this[P("0x6be")]=[],this._scene=t[P("0x13b")][P("0x10f")],this._clock=t.viewer[P("0x571")];var i=t[P("0xfc")]?t[P("0xfc")]:1;this[P("0x6bf")]=2*i,this[P("0x6c0")]=.1*i,this[P("0x6c1")]=1*i,this._startColor=new(e[P("0x16a")])(1,1,1,1),this[P("0x6c2")]=new(e[P("0x16a")])(.8,0,0,.01),t.smoking&&(this._endColor[P("0x66e")]=1-t[P("0x6c3")]);var r=t[P("0x6c4")]?t.life:1;this[P("0x6c5")]=.5*r,this[P("0x6c6")]=2*r;var n=t[P("0x539")]?t[P("0x539")]:1;if(this[P("0x6c7")]=7*n,this[P("0x6c8")]=20*n,this[P("0x6c9")]=t[P("0x1a9")]?t.count:0,this[P("0x63c")]=t.radius?t[P("0x181")]:1,this[P("0x6ca")]=t[P("0x6cb")]?t[P("0x6cb")]:4,this._fires=[],this[P("0x6cc")]=null,this[P("0x6cd")]=null,this[P("0x6ce")]=null,this[P("0x6cf")]=null,this._directionsArray=null,this[P("0x6d0")]=null,this[P("0x5b7")]=!0,this[P("0x6d1")]=0,this[P("0x5cf")]=0,this[P("0x6d2")](),this[P("0x6d3")](this[P("0x6c9")]),t[P("0x19f")]&&t[P("0x19f")][P("0x0")])for(var o=t[P("0x19f")],a=0;a1-this._explode&&(t[P("0xd3")]=1,t[P("0x6e0")]*=1.2,t[P("0x6c4")]*=.2,t[P("0x539")]*=2),null!==t.position},r[P("0x5")][P("0x6e1")]=function(e){e.update(this[P("0x5cf")]),e.actived||this[P("0x6e2")](e)&&e[P("0x69")]()},r.prototype[P("0x5c8")]=function(t){var i;if(i=this[P("0x6e3")][P("0x6e4")]?t.time[P("0x6e5")]:e[P("0x5d0")]()/1e3,0===this[P("0x6d1")])this[P("0x6d1")]=i;else{var r=i-this[P("0x6d1")];r>this[P("0x6c6")]&&(r=this[P("0x6c6")]),this[P("0x5cf")]=r,this[P("0x6d1")]=i}},r[P("0x5")].update=function(e){this[P("0x5c8")](e);var t=this[P("0x6c9")];if(!(t<1||t!==this[P("0x6d7")][P("0x0")]||this[P("0x6be")][P("0x0")]<1)&&this[P("0x6cc")]){if(this[P("0x5b7")]){for(var i=0;i 0.618){\n"+P("0x714")+P("0x614")+" else{\n"+P("0x715")+" }\n}",a=P("0x701")+P("0x702")+"varying float v_texIndex;\n"+P("0x716")+P("0x717")+P("0x708")+"{\n"+P("0x718")+P("0x719")+P("0x71a")+" if (v_texIndex === 1.0){\n"+P("0x71b")+" }\n else{\n"+P("0x71c")+P("0x71d")+P("0x614")+P("0x71e")+" if (v_texIndex === 1.0){\n"+P("0x71b")+P("0x71d")+" else{\n"+P("0x71c")+P("0x71d")+P("0x71f")+P("0x614")+P("0x720")+P("0x721")+P("0x614")+P("0x722")+" float mc = max(max(color.r, color.g), color.b);\n"+P("0x723")+P("0x614")+" else{\n"+P("0x724")+" color.a = 0.0;\n }\n"+P("0x614")+" color = czm_gammaCorrect(color);\n"+P("0x725")+P("0x726")+P("0x727")+P("0x728")+"}"}(Cesium$2),function(e){function t(){this[P("0x6b6")]=null,this[P("0x5ba")]=!1,this[P("0x5b9")]=0,this[P("0x6b7")]=null,this[P("0x6b8")]=1,this._life=0,this[P("0x5cf")]=0,this[P("0x6b9")]=0,this._alphaFact=0,this._normalFact=1}t[P("0x5")].active=function(){this._actived=!0,this[P("0x5cf")]=0};var i=new(e[P("0x11")]),r=new e.Cartesian3;t.prototype[P("0xd2")]=function(t){if(this[P("0x5ba")])if(this[P("0x5cf")]+=t,this[P("0x5cf")]>this[P("0x5bf")])this[P("0x5ba")]=!1;else{var n=e[P("0x11")].normalize(this._position,i),o=e[P("0x11")][P("0x6c")](this[P("0x6b7")],this[P("0x729")],r);e.Cartesian3[P("0x6d")](n,o,n),e.Cartesian3[P("0x8d")](n,this[P("0x6b7")]),e.Cartesian3[P("0x6c")](this[P("0x6b7")],t*this[P("0x5b9")],n),e[P("0x11")][P("0x6d")](this._position,n,this._position),.025this[P("0x6c6")]&&(r=this[P("0x6c6")]),this[P("0x5cf")]=r,this._preTime=i}},o[P("0x5")][P("0xd2")]=function(e){this[P("0x5c8")](e);var t=this._count;if(!(t<1||t!==this[P("0x72f")][P("0x0")]||this[P("0x6be")][P("0x0")]<1)&&this[P("0x6cc")]){if(this._needUpdate){this[P("0x73d")]=this._door*t;for(var i=0;i=",!1,"GE"),gt:t(">",!1,"GT"),lt:t("<",!0,"LT"),le:t("<=",!0,"LE"),eq:t("-",!0,"EQ",!0)}})(),function(e){e[P("0x7d8")]={};var t=e[P("0x7d9")];function i(e,t){this[P("0x7da")]=e,this.edges=t}var r,n=i[P("0x5")];function o(e,t,i){for(var r=1,n=e.length;r>1;return[P("0x7f1"),a(e[P("0x1d5")](0,t)),",",a(e.slice(t)),")"].join("")}function s(e,t){if("m"!==e[P("0x68e")](0))return s(t,e);if("w"!==t[P("0x68e")](0))return[P("0x7f4"),e,",",t,")"][P("0x7ca")]("");var i=e[P("0x7f2")]("[");return["w",t[P("0x7f3")](1),"m",i[0][P("0x7f3")](1)][P("0x7ca")]("")}function x(e){if(2===e[P("0x0")])return[["diff(",s(e[0][0],e[1][1]),",",s(e[1][0],e[0][1]),")"][P("0x7ca")]("")];for(var t=[],i=0;i>1;return[P("0x7f1"),a(e.slice(0,t)),",",a(e.slice(t)),")"].join("")}function s(e){if(2===e[P("0x0")])return[["sum(prod(",e[0][0],",",e[1][1],P("0x803"),e[0][1],",",e[1][0],"))"][P("0x7ca")]("")];for(var t=[],i=0;ig[0]&&u[P("0x17c")](new n(g,d,2,h),new n(d,g,1,h))}u[P("0x3d2")](o);for(var p,m,b,v,C,y,_=u[0].a[0]-(1+Math[P("0x78")](u[0].a[0]))*Math[P("0x2ae")](2,-52),A=[new r([_,1],[_,0],-1,[],[],[],[])],I=[],w=(h=0,u.length);h 0.0)\n"+P("0x871")+P("0x872")+P("0x873")+P("0x874")+P("0x875")+P("0x7bf")+P("0x7b7")+P("0x876")+P("0x877")+" }\n return clipAmount;\n}\n"},r.mularea[P("0x878")]=function(e,t,i){return P("0x879")+P("0x87a")+P("0x87b")+"void main() \n"+P("0x87c")+P("0x87d")+" float clipDistance = clip(gl_FragCoord, "+e+", "+t+P("0x87e")+" vec4 clippingPlanesEdgeColor = vec4(1.0); \n"+P("0x87f")+i+P("0x880")+P("0x881")+i+".a; \n"+P("0x882")+" { \n"+P("0x883")+P("0x884")+P("0x885")},r}},a.prototype[P("0x854")]=function(t){var i=this._generateSourcePlanes(t);if(e[P("0x14")](i)){var r=new(e[P("0x36a")])({planes:i,edgeWidth:this[P("0x824")][P("0x671")],edgeColor:this[P("0x824")],unionClippingRegions:!0});return r[P("0x857")]={},r[P("0x857")][P("0x858")]=!1,r[P("0x857")][P("0x859")]=function(e){return P("0x85a")+"{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n"+P("0x886")+P("0x85c")+P("0x85d")+P("0x85e")+P("0x7bc")+e+"; i+=3)\n"+P("0x85f")+P("0x887")+P("0x860")+P("0x861")+" clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n"+P("0x888")+P("0x864")+P("0x865")+" j++;\n"+P("0x867")+P("0x868")+P("0x869")+P("0x889")+P("0x86a")+P("0x86b")+P("0x86c")+P("0x88a")+" clippingPlane = getClippingPlane(clippingPlanes, j, clippingPlanesMatrix);\n"+P("0x86e")+" clipPosition = -clippingPlane.w * clipNormal;\n"+P("0x86f")+P("0x870")+P("0x88b")+P("0x871")+" bDiscard = false;\n"+P("0x873")+" }\n"+P("0x875")+P("0x7bf")+P("0x88c")+P("0x7b7")+P("0x876")+" return -100.0;\n }\n return 100.0;\n}\n"},r[P("0x857")][P("0x878")]=function(e,t,i){return P("0x879")+P("0x87a")+P("0x87b")+P("0x88d")+"{ \n"+P("0x87d")+P("0x88e")+e+", "+t+P("0x87e")+" vec4 clippingPlanesEdgeColor = vec4(1.0); \n"+P("0x87f")+i+P("0x880")+P("0x881")+i+P("0x88f")+P("0x890")+P("0x891")+" out_FragColor = mix(out_FragColor, clippingPlanesEdgeColor, clippingPlanesEdgeWidth);\n"+P("0x884")+P("0x885")},r}},a[P("0x5")][P("0x855")]=function(e){var t=this[P("0x826")],i=t[P("0x0")];if(!(i<1)){for(var r=[],n=0;nr&&(this._repeat||this[P("0x8c4")](),this[P("0x6f2")]=0),this[P("0x5bc")]=t}},t[P("0x5")][P("0x8c4")]=function(){this[P("0x82b")]=!1,this[P("0x8c2")][P("0x896")]()},t[P("0x5")][P("0x8c3")]=function(e){var t=e[P("0x7e")];this[P("0x77b")]=t[P("0x8c5")].clone(this._invViewMatrix),this._updateScanCirclePostProcess(e),this[P("0x8c6")](e)},t[P("0x5")][P("0x8c7")]=function(t){var i=this;if(i[P("0x8bc")])return this[P("0x8bc")][P("0x364")]=!0,void(this[P("0x13c")].scene[P("0x77c")][P("0xd1")](this[P("0x8bc")])||(this[P("0x13c")][P("0x10f")].postProcessStages[P("0x6d")](this[P("0x8bc")]),this[P("0x8bc")][P("0xd2")](t.context,t[P("0x77d")])));var r=P("0x7a0")+P("0x7a1")+P("0x8c8")+P("0x8c9")+"uniform vec3 u_normal;\n"+P("0x5fc")+"uniform vec4 u_param0;\n"+P("0x7a4")+P("0x5f9")+P("0x8ca")+P("0x8cb")+P("0x8cc")+" out_FragColor = color;\n"+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+" position = u_invViewMatrix * position;\n position /= position.w;\n float t = (u_param0.y > u_param0.x) ? u_param0.x : u_param0.y;\n float al = (u_param0.y <= u_param0.x) ? 1.0 : clamp(1.0 - (u_param0.y - u_param0.x) / (0.65 * u_param0.x), 0.0, 1.0);\n"+P("0x8d3")+" vec3 b = normalize(position.xyz - u_center);\n vec3 n = normalize(u_normal);\n"+P("0x8d4")+P("0x8d5")+" b = cross(n, nc);\n"+P("0x8d6")+P("0x8d7")+P("0x614")+" float d = u_param0.z * t;\n"+P("0x8d8")+P("0x8d9")+P("0x8da")+P("0x8db")+P("0x8dc")+" float r = abs(z - d5);\n float z1 = clamp(u_color.a, 0.1, 0.6) * (1.0 - r / hw5);\n"+P("0x8dd")+" }\n if (z < (d + hw) && z > (d - hw)){\n"+P("0x8de")+P("0x8df")+P("0x8e0")+P("0x71d")+P("0x8e1")+" }\n out_FragColor = color;\n}",n=new(e[P("0x12")]);i[P("0x8bc")]=new e.PostProcessStage({fragmentShader:r,uniforms:{u_invViewMatrix:function(){return i[P("0x8e2")]},u_center:function(){return i[P("0x11a")]},u_normal:function(){return i[P("0x4d0")]},u_color:function(){return i[P("0x169")]},u_param0:function(){return n.x=.607*i.life,n.y=i.time,n.z=i[P("0x539")],n.w=i.lineWidth,n}}}),i[P("0x8bc")].enabled=!1},t.prototype._updateScanAperturePostProcess=function(t){var i=this;if(i[P("0x8bd")])return this[P("0x8bd")][P("0x364")]=!0,void(this._viewer.scene[P("0x77c")][P("0xd1")](this._scanAperturePostProcess)||(this[P("0x13c")][P("0x10f")][P("0x77c")][P("0x6d")](this[P("0x8bd")]),this[P("0x8bd")][P("0xd2")](t.context,t[P("0x77d")])));var r="uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform mat4 u_invViewMatrix;\nuniform vec3 u_center;\n"+P("0x8e3")+"uniform vec4 u_color;\n"+P("0x8e4")+"varying vec2 v_textureCoordinates;\n"+P("0x5f9")+" vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+P("0x8cc")+" out_FragColor = color;\n"+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+" zd = (2.0 * zd - czm_depthRange.near - czm_depthRange.far) / (czm_depthRange.far - czm_depthRange.near);\n"+P("0x8d1")+" vec4 position = czm_inverseProjection * vec4(xy, zd, 1.0);\n position = u_invViewMatrix * position;\n"+P("0x8e5")+P("0x8e6")+" float al = (u_param0.y <= u_param0.x) ? 1.0 : clamp(1.0 - (u_param0.y - u_param0.x) / (0.65 * u_param0.x), 0.0, 1.0);\n"+P("0x8d3")+P("0x8e7")+" vec3 n = normalize(u_normal);\n"+P("0x8d4")+P("0x8d5")+P("0x8e8")+P("0x8d6")+P("0x8d7")+" }\n"+P("0x8e9")+" float d5 = u_param0.z * u_param0.y;\n"+P("0x8d9")+" float hw5 = hw * 12.0;\n float hd = dot(u_normal, position.xyz) - dot(u_normal, u_center);\n if (z < (d5 + hw5) && z > (d5 - hw5)){\n"+P("0x8ea")+P("0x8eb")+P("0x8ec")+P("0x614")+P("0x8ed")+" float r = abs(z - d);\n"+P("0x8ee")+P("0x8ef")+P("0x614")+P("0x728")+"}",n=new(e[P("0x12")]);i[P("0x8bd")]=new(e[P("0x7c5")])({fragmentShader:r,uniforms:{u_invViewMatrix:function(){return i[P("0x8e2")]},u_center:function(){return i[P("0x11a")]},u_normal:function(){return i.normal},u_color:function(){return i[P("0x8c1")]},u_param0:function(){return n.x=.607*i.life,n.y=i[P("0x6f2")],n.z=i.speed,n.w=i[P("0x197")],n}}}),i[P("0x8bd")].enabled=!1}}(Cesium$2),function(e){var t=e[P("0x8f0")]=function(t){this[P("0x13c")]=t[P("0x13b")];var i=e[P("0x13")][P("0x1a1")].apply(this,t[P("0x11a")]);this[P("0x5b4")]=e[P("0x11")].fromRadians(i[P("0x112")],i.latitude,i[P("0x8b")]),this[P("0x63c")]=t[P("0x181")],this[P("0x596")]=t[P("0x169")]?t[P("0x169")].clone():e[P("0x16a")][P("0x438")][P("0x6e")](),this[P("0x5b9")]=t.speed?t.speed:1,this[P("0x8ba")]=!!t[P("0x8bb")]&&t[P("0x8bb")],this._enabled=!t.enabled||t[P("0x364")],this._longest=e.defined(t[P("0x8f1")])?t[P("0x8f1")]:15e3,this[P("0x8f2")]=e.defined(t.url)?t.url:null,this[P("0x8f3")]=null,this[P("0x5bc")]=0,this[P("0x48b")]=!1,this[P("0x8be")]=e.Cartesian3[P("0x8d")](this[P("0x5b4")],new(e[P("0x11")])),this[P("0x5bf")]=this._radius/this._speed,this[P("0x5cf")]=0,this[P("0x77b")]=null,this[P("0x8f4")]=null,this._param0=null,this[P("0x8f5")]=null,this._param2=null,this[P("0x8f6")]=null,this._param4=null,this[P("0x8f7")]=!1};e.defineProperties(t.prototype,{enabled:{get:function(){return this[P("0x82b")]},set:function(e){this[P("0x82b")]=e}},radius:{get:function(){return this[P("0x63c")]},set:function(t){e[P("0x14")](t)&&0!==t&&t!==this._radius&&(this[P("0x63c")]=t,this[P("0x5bf")]=this[P("0x63c")]/this[P("0x5b9")])}},speed:{get:function(){return this._speed},set:function(t){e[P("0x14")](t)&&0!==t&&t!==this[P("0x5b9")]&&(this[P("0x5b9")]=t,this[P("0x5bf")]=this._radius/this[P("0x5b9")])}},color:{get:function(){return this[P("0x596")]},set:function(e){this[P("0x596")]=e}}}),t.prototype[P("0xd2")]=function(e){var t=this;t[P("0x8f8")](e[P("0x7e")])?(t[P("0x8f9")](e),t[P("0x82b")]?(t._updateTime(),t._enabled&&(t[P("0x8fa")](),t._updatePostProcesses(e))):t[P("0x8f3")]&&(t[P("0x8f3")][P("0x364")]=!1)):t[P("0x8f3")]&&(t[P("0x8f3")][P("0x364")]=!1)},t[P("0x5")][P("0x8fb")]=function(e){var t=this;t[P("0x8f2")]!==e&&(t[P("0x8f2")]=e,t._ready=!1,t[P("0x8fc")]=null,t[P("0x8f5")]=null,t._param2=null,t[P("0x8f6")]=null,t[P("0x8fd")]=null,t[P("0x8f3")]&&(t._scanPostProcess[P("0x364")]=!1,t[P("0x13c")][P("0x10f")].postProcessStages[P("0x17f")](t._scanPostProcess),t[P("0x8f3")]=null),t._texture&&(t._texture[P("0xf4")](),t._texture=null),t[P("0x8f7")]=!1)};var i=new(e[P("0x11")]);t[P("0x5")][P("0x8f8")]=function(t){return!(e[P("0x11")][P("0x96")](e.Cartesian3[P("0x95")](t.position,this[P("0x5b4")],i))>this[P("0x8fe")])},t.prototype[P("0xf4")]=function(){this[P("0x8f3")]&&(this._scanPostProcess[P("0x364")]=!1,this[P("0x13c")][P("0x10f")].postProcessStages[P("0x17f")](this[P("0x8f3")]),this._scanPostProcess=null)},t[P("0x5")][P("0x5c8")]=function(){var t=e[P("0x5d0")]()/1e3;if(0===this[P("0x5bc")])this[P("0x5bc")]=t,this._time=0;else{var i=t-this._lastTime,r=this[P("0x5bf")];rr&&(this[P("0x8ba")]||this[P("0x8c4")](),this[P("0x5cf")]=0),this._lastTime=t}},t.prototype[P("0x8c4")]=function(){this[P("0x82b")]=!1},t[P("0x5")][P("0x8f9")]=function(t){var i=this;if(null!==i[P("0x8f2")]){if(i._texture)i[P("0x48b")]=!0;else if(i[P("0x48b")]=!1,!i._loading){i._loading=!0;var r=t.context,n=e[P("0x6ba")](i._textureUrl);e[P("0x6da")][P("0x6dc")]({url:n,headers:{"cache-control":P("0x8ff")}})[P("0x333")]((function(t){i[P("0x8f7")]=!1,i[P("0x8f4")]=new(e[P("0x6db")])({context:r,source:t},(function(e){hat[P("0x8f2")]=null}))}))}}else i[P("0x48b")]=!0},t[P("0x5")][P("0x8fa")]=function(){var t=this,i=t[P("0x5b4")],r=t[P("0x8be")],n=e[P("0x11")][P("0x99")](e[P("0x11")][P("0xc3")],r,new(e[P("0x11")])),o=e[P("0x11")].cross(r,n,new(e[P("0x11")]));e.Cartesian3[P("0x8d")](n,n),e[P("0x11")][P("0x8d")](o,o);var a=e.Cartesian3[P("0xc8")](n,new(e[P("0x11")])),s=e[P("0x11")][P("0xc8")](o,new e.Cartesian3),x=t[P("0x5b9")]*t._time;if(null===t[P("0x8f2")])x/=1.532,t._param0=new(e[P("0x12")])(i.x,i.y,i.z),t[P("0x8f5")]=new e.Cartesian4(r.x,r.y,r.z),t[P("0x900")]=new(e[P("0x12")])(x),t[P("0x8f6")]=new(e[P("0x12")])(r.x,r.y,r.z,-e[P("0x11")][P("0x92")](r,i));else{var l=e.Cartesian3[P("0x6d")](i,e[P("0x11")][P("0x6c")](a,x,new(e[P("0x11")])),new(e[P("0x11")])),c=e[P("0x11")][P("0x6d")](i,e[P("0x11")][P("0x6c")](n,x,new(e[P("0x11")])),new(e[P("0x11")])),u=e[P("0x11")][P("0x6d")](i,e[P("0x11")][P("0x6c")](s,x,new e.Cartesian3),new(e[P("0x11")])),h=e[P("0x11")].add(i,e[P("0x11")][P("0x6c")](o,x,new(e[P("0x11")])),new(e[P("0x11")]));t._param0=new(e[P("0x12")])(n.x,n.y,n.z,-e[P("0x11")][P("0x92")](n,l)),t._param1=new(e[P("0x12")])(a.x,a.y,a.z,-e[P("0x11")][P("0x92")](a,c)),t[P("0x900")]=new(e[P("0x12")])(o.x,o.y,o.z,-e[P("0x11")].dot(o,u)),t[P("0x8f6")]=new(e[P("0x12")])(s.x,s.y,s.z,-e.Cartesian3[P("0x92")](s,h)),t[P("0x8fd")]=new(e[P("0x12")])(r.x,r.y,r.z,-e[P("0x11")][P("0x92")](r,i))}},t[P("0x5")][P("0x8c3")]=function(t){var i=this;if(i._ready){var r=t[P("0x7e")];if(i._invViewMatrix=r[P("0x8c5")][P("0x6e")](i[P("0x77b")]),i[P("0x8f3")])return i[P("0x8f3")][P("0x364")]=!0,void(i._viewer[P("0x10f")][P("0x77c")][P("0xd1")](i[P("0x8f3")])||(i[P("0x13c")][P("0x10f")][P("0x77c")].add(i[P("0x8f3")]),i._scanPostProcess.update(t.context,t[P("0x77d")])));if(null===i[P("0x8f2")]){var n=P("0x7a0")+"uniform sampler2D depthTexture;\n"+P("0x8c8")+P("0x5fc")+"uniform vec4 u_param0;\nuniform vec4 u_param1;\nuniform vec4 u_param2;\n"+P("0x901")+P("0x7a4")+"void main(){\n vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+P("0x8cc")+P("0x902")+P("0x8cd")+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+P("0x903")+" position /= position.w;\n"+P("0x904")+P("0x905")+" out_FragColor = color;\n return;\n"+P("0x614")+P("0x906")+P("0x907")+P("0x908")+" if(z2 > u_param2.x){\n"+P("0x902")+P("0x8cd")+P("0x614")+P("0x909")+P("0x90a")+P("0x902")+P("0x8cd")+P("0x614")+P("0x90b")+"}";i[P("0x8f3")]=new e.PostProcessStage({fragmentShader:n,uniforms:{u_invViewMatrix:function(){return i[P("0x77b")]},u_color:function(){return i[P("0x596")]},u_param0:function(){return i._param0},u_param1:function(){return i[P("0x8f5")]},u_param2:function(){return i[P("0x900")]},u_param3:function(){return i._param3}}})}else n="uniform sampler2D colorTexture;\n"+P("0x7a1")+"uniform sampler2D u_texture;\n"+P("0x8c8")+"uniform vec4 u_color;\n"+P("0x8e4")+"uniform vec4 u_param1;\n"+P("0x90c")+P("0x901")+P("0x90d")+P("0x7a4")+P("0x5f9")+" vec4 color = texture(colorTexture, v_textureCoordinates);\n"+P("0x8cb")+" if(currD.r >= 1.0){\n"+P("0x902")+" return;\n"+P("0x614")+P("0x8ce")+P("0x8cf")+P("0x8d0")+P("0x8d1")+P("0x8d2")+P("0x903")+P("0x8e5")+P("0x90e")+P("0x90f")+P("0x902")+P("0x8cd")+P("0x614")+P("0x910")+P("0x911")+P("0x902")+P("0x8cd")+P("0x614")+P("0x912")+P("0x913")+P("0x902")+P("0x8cd")+P("0x614")+P("0x914")+P("0x915")+P("0x902")+" return;\n"+P("0x614")+P("0x916")+" if(z4 < -800.0 || z4 > 800.0){\n"+P("0x902")+" return;\n"+P("0x614")+" float u = z0 / (z0 + z1);\n float v = z2 / (z2 + z3);\n vec4 sColor = texture(u_texture, vec2(u, v));\n"+P("0x917")+" sColor = sColor * (1.0 - a) + a * u_color;\n"+P("0x918")+"}",i[P("0x8f3")]=new(e[P("0x7c5")])({fragmentShader:n,uniforms:{u_invViewMatrix:function(){return i._invViewMatrix},u_color:function(){return i._color},u_texture:function(){return i._texture},u_param0:function(){return i._param0},u_param1:function(){return i._param1},u_param2:function(){return i[P("0x900")]},u_param3:function(){return i[P("0x8f6")]},u_param4:function(){return i[P("0x8fd")]}}});i[P("0x8f3")].enabled=!1}}}(Cesium$2),function(e){function t(e){this[P("0x63c")]=e[P("0x181")],this._direction=e[P("0x93")],this[P("0x919")]=e[P("0x91a")]}var i=new e.Cartesian3,r=new(e[P("0x11")]),n=new(e[P("0x17")]),o=new e.Quaternion,a=new(e[P("0x1a")]),s=new(e[P("0x1b")]);t[P("0x5")][P("0x91b")]=function(t){var x,l,c,u,h,f;x=this[P("0x6b7")],(l=n)[P("0x7f")]=x.heading,l[P("0x80")]=x[P("0x81")],l.roll=x[P("0x80")],c=n,u=o,e[P("0x1d")].fromHeadingPitchRoll(c,u),h=o,f=a,e[P("0x1a")][P("0xcd")](h,f);var d,g,p,m,b,v,C,y,_=(d=a,g=s,e[P("0x1b")][P("0x738")](d,void 0,g));p=i,m=r,b=this[P("0x63c")],v=this[P("0x919")],C=e[P("0x23")][P("0x6de")](0,e.Math.TWO_PI),y=(b=e[P("0x23")][P("0x6de")](0,b))+Math.tan(e[P("0x23")][P("0x119")](v)),p.x=b*Math[P("0x9a")](C),p.y=e[P("0x23")][P("0x6de")](0,10),p.z=-b*Math[P("0x98")](C),m.x=y*Math[P("0x9a")](C),m.y=p.y+1,m.z=-y*Math.sin(C),e[P("0x1b")][P("0xd4")](_,i,i),e[P("0x1b")][P("0xd4")](_,r,r),t.position=e.Cartesian3.clone(i,t[P("0x8c")]),t[P("0x91c")]=e[P("0x11")][P("0x95")](r,i,t[P("0x91c")]),e[P("0x11")].normalize(t[P("0x91c")],t[P("0x91c")])};var x=e.GeoSprinklerParticleSystem=function(t){this._image=t[P("0x475")],this[P("0x6b6")]=t[P("0x11a")],this[P("0x6b7")]=t[P("0x93")],this[P("0x6c1")]=e[P("0x14")](t.imageSize)?t[P("0x91d")]:new(e[P("0x10")])(4.9,4.9),this[P("0x91e")]=e[P("0x14")](t[P("0x91f")])?t[P("0x91f")]:4.9,this[P("0x5b9")]=e.defined(t.speed)?t[P("0x539")]:27.46,this[P("0x920")]=e.defined(t.emissionRate)?t[P("0x921")]:800,this[P("0x63c")]=e.defined(t[P("0x181")])?t[P("0x181")]:.2,this[P("0x922")]=e.defined(t.lifetime)?t[P("0x923")]:1,this[P("0x919")]=e[P("0x14")](t[P("0x91a")])?t[P("0x91a")]:.89,this[P("0x8fe")]=e.defined(t[P("0x8f1")])?t[P("0x8f1")]:2e3;var i=e.Color[P("0x2cf")];this[P("0x72c")]=i[P("0x16c")](.8),this[P("0x6c2")]=i.withAlpha(0),this[P("0x924")]=null,this[P("0x925")]()};x[P("0x5")][P("0xd2")]=function(e){this[P("0x924")]&&(this[P("0x8f8")](e[P("0x7e")])?this[P("0x924")][P("0xd2")](e):this[P("0x926")]())},x[P("0x5")][P("0x925")]=function(){if(!this[P("0x924")]){var i=e[P("0x13")][P("0x1a1")].apply(this,this[P("0x6b6")]);i=e[P("0x11")].fromRadians(i.longitude,i.latitude,i[P("0x8b")]);var r=e[P("0x1f")][P("0xbf")](i);return this._system=new e.ParticleSystem({image:this[P("0x595")],startColor:this[P("0x72c")],endColor:this[P("0x6c2")],particleLife:this[P("0x91e")],speed:this[P("0x5b9")],imageSize:this[P("0x6c1")],emissionRate:this[P("0x920")],emitter:new t({radius:this._radius,direction:this._direction,angle:this._angle}),lifetime:this[P("0x922")],updateCallback:h,modelMatrix:r}),this[P("0x924")]}},x[P("0x5")].destroy=function(){this[P("0x924")]&&(this[P("0x924")].destroy(),this._system=null)},x[P("0x5")][P("0x926")]=function(){this._system&&function(t){if(e[P("0x14")](t[P("0x927")])){for(var i=t[P("0x927")],r=i[P("0x0")],n=0;nthis[P("0x8fe")])};var u=new(e[P("0x11")]);function h(t,i){var r=e.Cartesian3[P("0x8d")](t[P("0x8c")],u);e.Cartesian3[P("0xc8")](r,r),e[P("0x11")][P("0x6c")](r,8.16*i,r),t[P("0x91c")]=e[P("0x11")].add(t[P("0x91c")],r,t[P("0x91c")])}}(Cesium$2),function(e){var t=e[P("0x92a")]=function(e){this[P("0x92b")]=e.fieldName,this[P("0x92c")]=e[P("0x92d")],this._minValue=e[P("0x92e")],this[P("0x92f")]=e[P("0x930")],this[P("0x931")]=e[P("0x932")]};t[P("0x5")][P("0x934")]=function(){var t=function(t){if(!e[P("0x14")](t))return"";var i=255*t.red,r=255*t[P("0x66f")],n=255*t[P("0x670")],o=t.alpha;return P("0x933")+i+","+r+","+n+","+o+");"}(this[P("0x92c")]),i=P("0x935");if(!e[P("0x14")](this[P("0x92b")]))return(i+=P("0x936")+t+";\n")+"} \n";var r="";return this[P("0x92b")]===P("0x469")&&(r="v_elevationPos.z"),i+=1===(this[P("0x92f")]===this[P("0x937")])?"if ("+r+P("0x938")+this._minValue+P("0x939"):P("0x93a")+r+" >= "+this[P("0x937")]+P("0x93b")+r+" <= "+this[P("0x92f")]+P("0x939"),i+="{ \n",i+=P("0x936")+t+";\n",(i+=P("0x885"))+P("0x885")},t.prototype[P("0x93c")]=function(){if(!e[P("0x14")](this[P("0x92b")])||this[P("0x92b")]!==P("0x469"))return"";var t="",i="";this[P("0x92b")]===P("0x469")&&(i="v_elevationPos.z");var r=this[P("0x92f")]===this[P("0x937")],n=this[P("0x937")][P("0x531")]();-1===n[P("0x2d3")](".")&&(n+=".0");var o=this._maxValue.toString();-1===o[P("0x2d3")](".")&&(o+=".0");var a=this[P("0x92c")][P("0x531")]();return-1===a[P("0x2d3")](".")&&(a+=".0"),t+=1===r?P("0x93a")+i+P("0x938")+n+P("0x93d"):P("0x93a")+i+P("0x93e")+n+P("0x93f")+i+" <= "+o+P("0x93d"),t+=P("0x87c"),(t+="luminanceValue = "+a+";\n")+P("0x885")},t.prototype.makeShader=function(){var e;return this._topic===P("0x940")&&(e=this[P("0x934")]()),this[P("0x931")]===P("0x941")&&(e=this[P("0x93c")]()),e},t[P("0x5")][P("0x942")]=function(t){if(this[P("0x931")]===P("0x941")){if(!e[P("0x14")](this[P("0x92b")]))return this[P("0x92c")];if(this._fieldName!==P("0x469")){if(this[P("0x92b")]===P("0x943"))return this._fieldValue;var i=t[P("0x944")](this[P("0x92b")]);return i>=this[P("0x937")]&&i<=this[P("0x92f")]?this._fieldValue:void 0}}}}(Cesium$2),function(e){(e[P("0x945")]=function(){})[P("0x5")][P("0x946")]=function(t,i,r){var n=i,o={};return o[P("0x932")]=t,4===i[P("0x0")]?(o[P("0x92d")]=n[0],o.fieldName=n[1],"$"===o[P("0x947")][P("0x7f3")](0,1)&&(o[P("0x947")]=o.fieldName[P("0x7f3")](1,o[P("0x947")][P("0x0")]-1)),o.minValue=n[2],o.maxValue=n[3],i[1]===P("0x469")&&(r[P("0x948")]=!0)):1===i[P("0x0")]?o[P("0x92d")]=i[0]:2===i[P("0x0")]&&(o[P("0x92d")]=n[0],o[P("0x947")]=n[1]),new(e[P("0x92a")])(o)}}(Cesium$2),function(e){function t(e,t,i){var r=i[P("0x10f")][P("0x77c")][P("0x949")];r[P("0x364")]=e,r[P("0x19d")][P("0x94a")]=!1,r[P("0x19d")][P("0x94b")]=119,r.uniforms[P("0x94c")]=-.4,r[P("0x19d")].delta=.9,r[P("0x19d")][P("0x94d")]=3.78,r.uniforms[P("0x94e")]=t,r[P("0x19d")][P("0x94f")]=!1}var i=e[P("0x950")]=function(i){if(e[P("0x14")](i)){if(this[P("0x951")]=!1,this[P("0x952")]=!1,this._enabledLightBand=!1,this[P("0x953")]=!1,this[P("0x954")]=5,this[P("0x955")]=i[P("0x815")],this._useElevation=!1,this[P("0x956")]=new(e[P("0x945")]),e[P("0x14")](i.mixedColor)){this[P("0x951")]=e[P("0x102")](i[P("0x940")][P("0x364")],!1);var r=i[P("0x940")].conditions;if(e[P("0x14")](r)){this._mixedColorConditions=[];for(var n=0;n=P("0x996")&&(i[P("0x671")]=.99),this[P("0x6a8")]=this.viewer[P("0x194")][P("0x6d")]({rectangle:{coordinates:this._rectangle,material:i}})},t[P("0x5")].setData=function(e){this[P("0x440")]=e,this[P("0x997")]=new(this[P("0x978")]),this[P("0x6aa")]()}}(Cesium$2),function(e){var t="GEO_OVERVIEW_ICO_SOURCE",i=P("0x998"),r=P("0x999");function n(t,i){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x13b")]=t[P("0x13b")],this.map2D=null,this[P("0x99a")]=e[P("0x102")](t[P("0x99a")],{mapCRS:{topTileExtent:[-180,-270,180,90],coordtransform:"none"},style:{version:8,sources:{tdt_source_overview:{type:P("0x99b"),tiles:[P("0x99c")],tileSize:256}},layers:[{id:P("0x99d"),type:"raster",source:"tdt_source_overview",layout:{visibility:P("0x99e")}}]},zoom:4,center:[112.939,31.377],renderWorldCopies:!1,isIntScrollZoom:!0,isAttributionControl:!1}),this[P("0x19a")]=t[P("0x19a")],this[P("0x8b")]=t[P("0x8b")],this.layout=e.defaultValue(t.layout,"BR"),this[P("0x99f")]=t[P("0x99f")],this[P("0x9a0")]=e[P("0x102")](t[P("0x9a0")],1),this[P("0x9a1")]=e.defaultValue(t.movingTargetZoomLevel,14),this.callback="function"==typeof i?i:function(){},this.scalable=!1,this[P("0x9a2")]=!1,this._latelyUpdateStamp=0,this._modelType=n[P("0x9a3")][P("0x9a4")],this[P("0x9a5")](),this._bindEvent()}n[P("0x5")]._initOverview=function(){var e=this[P("0x13b")].cesiumWidget[P("0x131")].parentElement,t=document[P("0x15c")]("div");t.className=P("0x9a6"),t[P("0x150")].display="block",t.style[P("0x8c")]="absolute",t.style[P("0x19a")]=this.width+"px",t.style.height=this[P("0x8b")]+"px",this[P("0x9a7")][P("0x9a8")]()[P("0x9a9")]("B")?t[P("0x150")][P("0x9aa")]=P("0x9ab"):this.layout[P("0x9a8")]().startsWith("T")&&(t[P("0x150")][P("0x151")]=P("0x9ab")),this[P("0x9a7")][P("0x9a8")]().endsWith("R")?t[P("0x150")][P("0x9b")]=P("0x9ab"):this.layout[P("0x9a8")]().endsWith("L")&&(t[P("0x150")][P("0x149")]="5px"),e[P("0x167")](t);var i=document[P("0x15c")](P("0x15d"));i.style[P("0x8c")]=P("0x9ac"),i[P("0x150")][P("0x19a")]=i[P("0x150")][P("0x8b")]="100%",t[P("0x167")](i),this[P("0x99a")][P("0x131")]||(this[P("0x99a")][P("0x131")]=i),this.map2D=new(GeoGlobe[P("0x101")])(this[P("0x99a")])},n.prototype[P("0x9ad")]=function(){var e=this;this[P("0x9ae")].on(P("0x9af"),(function(){var n=e.map2D;n[P("0x9b0")](e[P("0x99f")],(function(o,a){var s=e[P("0x9a0")],x=n.getCenter().toArray();n[P("0x9b1")](r,a),n[P("0x9b2")](t,{type:"geojson",data:{type:"Point",coordinates:x}}),n[P("0x9b3")]({id:i,source:t,type:P("0x1f4"),layout:{"icon-image":r,"icon-size":s,"icon-rotate":0}}),e[P("0x9a2")]=!0,e[P("0x191")]&&e[P("0x191")](e)}))})),this[P("0x13b")].scene[P("0x53f")][P("0x130")]((function(){e[P("0x9b4")]()}))},n[P("0x5")][P("0x9b5")]=function(){for(var e=this[P("0x13b")][P("0x10f")][P("0x53f")]._listeners,t=0;t=i[P("0x2a9")]*e.Math[P("0xa2a")]&&t.east<=i.east*e[P("0x23")][P("0xa2a")]&&t[P("0x2ab")]>=i[P("0x2ab")]*e[P("0x23")][P("0xa2a")]&&t.north<=i[P("0x2ac")]*e[P("0x23")][P("0xa2a")]},t.prototype[P("0xa2b")]=function(t,i){var r=t[P("0x2a9")]*e[P("0x23")].RADIANS_PER_DEGREE,n=t[P("0x2aa")]*e[P("0x23")][P("0xa2c")],o=t[P("0x2ab")]*e[P("0x23")].RADIANS_PER_DEGREE,a=t[P("0x2ac")]*e[P("0x23")].RADIANS_PER_DEGREE,s=new e.Rectangle(r,o,n,a);return e[P("0x26b")].intersection(s,i,new(e[P("0x26b")]))},t.prototype[P("0xa05")]=function(e,t,i){if(null===this[P("0xa02")])return"";var r=(e+t+i)%this[P("0xa02")][P("0x0")];return this[P("0xa02")][r]},t[P("0x5")][P("0xa2d")]=function(e){e[P("0x969")]&&void 0!==viewer[P("0x10f")].globe[P("0xa2e")][P("0xa2f")]&&this[P("0xa30")](e.rectangle,!0)[P("0xa31")]()},t[P("0x5")][P("0xa30")]=function(t,i){function r(t,i,n){var o=n?4.1:2.1;if(t[P("0x689")].width<=i[P("0x19a")]*o&&e[P("0x26b")].contains(t._rectangle,e.Rectangle.center(i)))return t;for(var a=t[P("0x12f")].length,s=0;s=g-p&&i[P("0xa4c")][s]<=g+p?t[P("0xa4c")][s]:i[P("0xa4c")][s]*c+u:i._buffer[s]?i[P("0xa4c")][s]*c+u:t[P("0xa4c")][s];return this[P("0xa3f")](m,33,33,15)},t[P("0x5")].requestTileHeightBuffer=function(t,i,r,n,o,a){if(!isNaN(t+i+r)){e.defined(n)&&!1!==n||(n=new(e[P("0xa4d")])({defer:!0}));var s=0===n.defer;o=e.defaultValue(s,!1);var x,l=e[P("0x9ee")][P("0x9ef")]();if(void 0!==a)a.getUrlFromSTag=function(e,t,i){return void 0===a.subdomains?a[P("0x6af")]:a[P("0xa4e")][0]+P("0xa4f")},x=this.getRequestElevationLayer(t,i,r).replace(this[P("0x248")][P("0x6af")],a.getUrlFromSTag(t,i,r)+P("0xa50"))[P("0xa1c")](this[P("0x248")][P("0xa07")],a[P("0x176")]),a[P("0xa51")]===P("0xa19")&&(x=x[P("0xa1c")](P("0xa52"),P("0xa53")));else{x=this[P("0xa1f")](t,i,r,s||o);var c=this._tilingScheme.tileXYToRectangle(t,i,r),u=this[P("0xa54")],h=e[P("0x9ee")][P("0x9ef")]();if(void 0!==u){var f=[];if(u[P("0x1e4")]((function(t){t[P("0x221")]&&null!==e[P("0x26b")][P("0x348")](c,t.rectangle,new(e[P("0x26b")]))&&f[P("0x17c")](t)})),0f[0][P("0xa55")])h[P("0x9f8")]("NoMerge");else{var d=function(t,i){var r=e.when[P("0x9ef")](),n=[];return t[P("0x1e4")]((function(t){var r,o,a,s;n[P("0x17c")]((r=t,o=i,s=e[P("0x9ee")][P("0x9ef")](),(a=TerraExplorer.tools[P("0x9f0")][P("0x9f1")][P("0x9f2")].fillArrayFromVerticesAndHeight(r[P("0x9f3")],o,r[P("0x9f4")][0])).timeStamp=r.timeStamp,a[P("0x9f5")]=r[P("0x9f4")],a[P("0x9f6")]=r[P("0x9f6")],a[P("0x9f7")]=r[P("0x9f7")],a.rect=r[P("0x969")],a[P("0x968")]=r[P("0x968")],s[P("0x9f8")](a),s))})),e[P("0x9ee")].all(n,(function(e){if(e[0][P("0x9f9")],1===e[P("0x0")])r[P("0x9f8")](e[0]);else{var t=e[P("0x3d2")]((function(e,t){return t[P("0x9fa")]-e[P("0x9fa")]})),i=t.shift();t.forEach((function(e){i.forEach((function(t,r){1===t&&1!==e[r]&&(i[r]=e[r])}))})),r[P("0x9f8")](i)}})),r}(f,c);e[P("0x9ee")](d,(function(e){h.resolve(e)}))[P("0xa40")]((function(e){console[P("0x133")](e)}))}else h[P("0x9f8")]("NoMerge")}else h[P("0x9f8")](P("0xa56"));var g=e.when[P("0x9ef")](),p=[].filter((function(e){return 0p[0][P("0x968")])g[P("0x9f8")](P("0xa58"));else{var m=!1;p[P("0x1e4")]((function(t){if(t.ready&&t[P("0x221")]&&void 0!==t[P("0xa59")]&&void 0!==e[P("0x26b")][P("0x348")](c,t[P("0xa59")])){for(var i,r=new Uint16Array(1024),n=c.west,o=(c[P("0x2ab")],(c[P("0x2aa")]-c[P("0x2a9")])/32),a=(c[P("0x2ac")]-c[P("0x2ab")])/32,s=0;s<32;s++)for(var x=0;x<32;x++){var l=n+o*x+o/2,u=c[P("0x2ac")]-a*s-a/2,h=new(e[P("0x13")])(l,u);i=65535;var f=t[P("0xa5a")](t,h,!0);null!==f&&f[P("0x490")]&&f[P("0x490")][P("0xa5b")]&&f[P("0x490")][P("0xa5b")].floor&&(i=f[P("0x490")]._model[P("0x3e8")][P("0xed")](h.longitude,h[P("0x114")])),65535!==i&&(i+=1.5),r[32*s+x]=i}m=!0,g[P("0x9f8")](r)}})),m||g[P("0x9f8")]("NoFloor")}this[P("0x68a")][P("0xef")]}if(!1===this[P("0xa14")][P("0xa5c")](x)){if(this._requestsCache[x]={},this[P("0xa15")][P("0x17c")](x),100l&&(l=e[g]),e[g]=this._urls_length&&(this[P("0xa80")]=0)));var x=this[P("0xa7d")][this[P("0xa80")]];if(this[P("0x68a")][P("0x9e2")](a),a=this[P("0xa8b")]){var l,c=-1===x[P("0x2d3")]("?")?"?":"&",u=x+c+"x="+r+P("0xa92")+o+P("0xa93")+(a+1),h=this[P("0xa94")];if(e.defined(h)&&(u=h[P("0xa95")](u)),s=e[P("0x102")](s,!0)){if(l=i(u,s),!e.defined(l))return}else l=i(u);if(this._tileType===t[P("0xa96")])return l.then((function(e){return function(e,t,i,r,n){var o=0,a=3*Float64Array[P("0x4b5")],s=4*Float64Array[P("0x4b5")],x=3*Uint16Array.BYTES_PER_ELEMENT,l=Uint16Array[P("0x4b5")],c=3*l,u=new DataView(t),h=new Cartesian3(u[P("0xaad")](o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0));o+=a;var f=u[P("0xaae")](o,!0);o+=Float32Array.BYTES_PER_ELEMENT;var d=u[P("0xaae")](o,!0);o+=Float32Array.BYTES_PER_ELEMENT;var g=new BoundingSphere(new Cartesian3(u.getFloat64(o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0)),u[P("0xaad")](o+a,!0));o+=s;var p=new Cartesian3(u[P("0xaad")](o,!0),u[P("0xaad")](o+8,!0),u[P("0xaad")](o+16,!0));o+=a;var m=u.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var b=new Uint16Array(t,o,3*m);o+=m*x,65536=this[P("0xa8c")]?new C.a((function(e,t){t("该级别不发送请求!")})):void 0},t[P("0x5")][P("0xa99")]=function(t){if(!this[P("0xa8e")])throw new(e[P("0x15")])("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<b.EPSILON10)r[P("0x99")](l,u,h);else{var f=n[P("0x6d")](C.getColumn(e[P("0xae5")],1,k),o,k);i[P("0xd6")](f,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,r.subtract(h,x,h),h.x=0,r.magnitudeSquared(h)b[P("0xe9")]){var y=1/r[P("0xe6")](c),_=r[P("0x92")](c,x)*y,A=r[P("0x6c")](x,_,z);c=r[P("0x8d")](r[P("0x95")](c,A,e[P("0xaec")]),e._up),r[P("0x6e")](c,e.up),h=r[P("0x99")](x,c,e[P("0xaee")]),r[P("0x6e")](h,e[P("0x9b")])}}(l||g)&&(e[P("0xaeb")]=C[P("0x739")](p,x,e[P("0xaeb")]),r.normalize(e[P("0xaeb")],e[P("0xaeb")])),(u||g)&&(e[P("0xaed")]=C[P("0x739")](p,c,e._upWC),r.normalize(e[P("0xaed")],e._upWC)),(f||g)&&(e[P("0xb0e")]=C[P("0x739")](p,h,e._rightWC),r[P("0x8d")](e[P("0xb0e")],e[P("0xb0e")])),(s||l||u||f||g)&&L(e)}function q(e,t){var i;return i=b[P("0x62")](Math[P("0x78")](e.z),1,b.EPSILON3)?Math[P("0x9e7")](t.y,t.x)-b[P("0x5b")]:Math.atan2(e.y,e.x)-b[P("0x5b")],b[P("0xab")]-b[P("0xb0f")](i)}function X(e){return b[P("0x5b")]-b[P("0x9d")](e.z)}function Y(e,t,i){var r=0;return b[P("0x62")](Math.abs(e.z),1,b[P("0xdf")])||(r=Math[P("0x9e7")](-i.z,t.z),r=b[P("0xb0f")](r+b[P("0xab")])),r}var K=new C,Q=new C;x(N[P("0x5")],{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return H(this),this[P("0xae6")]}},viewMatrix:{get:function(){return H(this),this[P("0x77a")]}},inverseViewMatrix:{get:function(){return H(this),this._invViewMatrix}},positionCartographic:{get:function(){return H(this),this[P("0x53b")]}},positionWC:{get:function(){return H(this),this[P("0xaea")]}},directionWC:{get:function(){return H(this),this._directionWC}},upWC:{get:function(){return H(this),this[P("0xaed")]}},rightWC:{get:function(){return H(this),this._rightWC}},heading:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")].ellipsoid,t=C.clone(this[P("0xae5")],K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this._setTransform(i);var r=q(this[P("0x93")],this.up);return this[P("0xc2")](t),r}}},pitch:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")].ellipsoid,t=C[P("0x6e")](this._transform,K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this._setTransform(i);var r=X(this[P("0x93")]);return this[P("0xc2")](t),r}}},roll:{get:function(){if(this[P("0x6b9")]!==M[P("0xb10")]){var e=this[P("0xc6")][P("0xef")],t=C[P("0x6e")](this[P("0xae5")],K),i=E[P("0xbf")](this[P("0xa5")],e,Q);this[P("0xc2")](i);var r=Y(this.direction,this.up,this.right);return this[P("0xc2")](t),r}}},moveStart:{get:function(){return this[P("0xb11")]}},moveEnd:{get:function(){return this[P("0xaf6")]}},changed:{get:function(){return this[P("0xaf7")]}}}),N[P("0x5")].update=function(e){if(!s(e))throw new l(P("0xb12"));if(e===M.SCENE2D&&!(this[P("0xe8")]instanceof _))throw new l(P("0xb13"));if(!(e!==M[P("0x90")]&&e!==M[P("0x8a")]||this[P("0xe8")]instanceof A||this[P("0xe8")]instanceof y))throw new l(P("0xb14"));var t=!1;if(e!==this[P("0x6b9")]&&(this[P("0x6b9")]=e,this[P("0xafb")]=e!==M.MORPHING,t=this[P("0x6b9")]===M[P("0x85")]),t){var i=this[P("0xafc")]=this[P("0xe8")][P("0x6e")]();if(!(i instanceof _))throw new l(P("0xb15"));var r=i[P("0x151")]/i[P("0x9b")];i[P("0x9b")]=2*this[P("0x59")].x,i.left=-i.right,i[P("0x151")]=r*i[P("0x9b")],i[P("0x9aa")]=-i[P("0x151")]}this._mode===M[P("0x85")]&&me(this,this[P("0x8c")]);var n=this._scene[P("0xa3")],o=!s(n)||n._surface[P("0xb16")].ready&&0===n[P("0xa2e")][P("0xb17")].length&&0===n[P("0xa2e")][P("0xb18")].length&&0===n[P("0xa2e")][P("0xb19")].length&&0===n._surface[P("0xb1a")][P("0xb1b")];this[P("0xafd")]&&(this[P("0xafd")]=!o),this[P("0xb08")]()};var Z=new r,J=new r,$=new r;N[P("0x5")][P("0xc2")]=function(e){var t=r[P("0x6e")](this[P("0xa5")],Z),i=r[P("0x6e")](this.upWC,J),n=r[P("0x6e")](this[P("0xa6")],$);C[P("0x6e")](e,this._transform),this[P("0xae8")]=!0,H(this);var o=this[P("0xb0d")];C[P("0xd4")](o,t,this[P("0x8c")]),C[P("0x739")](o,n,this[P("0x93")]),C[P("0x739")](o,i,this.up),r.cross(this[P("0x93")],this.up,this.right),H(this)};var ee=new i,te=new w,ie=new r,re=new r;N[P("0x5")][P("0x83")]=function(e){if(this[P("0xe8")]instanceof y&&(e||!(this[P("0x53b")].height<15e4)))if(C[P("0x84")](C[P("0xae")],this[P("0xaf")])){var t,i,n=this[P("0x42")],o=n[P("0x43")];if(s(o)){var a=ee;a.x=n[P("0x782")]/2,a.y=n[P("0x783")]/2;var x=this[P("0x86")](a,te);if(t=o[P("0xa4")](x,n,ie),n.pickPositionSupported&&(i=n[P("0xb1c")](a,re)),s(t)&&s(i)){var l=s(i)?r[P("0x8e")](i,this[P("0xa5")]):Number[P("0x31")],c=s(t)?r[P("0x8e")](t,this.positionWC):Number[P("0x31")];this[P("0xe8")][P("0x19a")]=Math[P("0x7d")](l,c)}else s(i)?this[P("0xe8")][P("0x19a")]=r[P("0x8e")](i,this.positionWC):s(t)&&(this[P("0xe8")].width=r[P("0x8e")](t,this.positionWC))}if(!s(o)||!s(t)&&!s(i)){var u=Math[P("0xee")](this.positionCartographic[P("0x8b")],0);this.frustum[P("0x19a")]=u}}else this[P("0xe8")][P("0x19a")]=r[P("0x96")](this[P("0x8c")])};var ne=new r,oe=new C,ae=new C,se=new I,xe=new v,le=new o,ce=new r,ue=new r,he=new r;function fe(e,t,i,n){var o=r.clone(i[P("0x93")],ce),a=r.clone(i.up,ue);if(e[P("0x42")][P("0xd3")]===M[P("0x90")]){var s=e[P("0xc6")][P("0xef")],x=E[P("0xbf")](t,s,K),l=C[P("0xb0c")](x,Q);C[P("0x739")](l,o,o),C[P("0x739")](l,a,a)}var c=r[P("0x99")](o,a,he);return n.heading=q(o,a),n.pitch=X(o),n[P("0x81")]=Y(o,a,c),n}var de={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},ge=new g;N.prototype[P("0x9c")]=function(e){e=a(e,a[P("0x128")]);var t=a(e[P("0x11e")],a[P("0x128")]),n=this[P("0x6b9")];if(n!==M[P("0xb10")]){s(e[P("0xb1f")])&&this[P("0xc2")](e.endTransform);var o=a(e.convert,!0),x=a(e[P("0x11d")],r.clone(this[P("0xa5")],ne));s(x)&&s(x[P("0x2a9")])&&(x=this[P("0xb20")](x,ne),o=!1),s(t[P("0x93")])&&(t=fe(this,x,t,de[P("0x11e")])),ge[P("0x7f")]=a(t[P("0x7f")],0),ge[P("0x80")]=a(t.pitch,-b[P("0x5b")]),ge.roll=a(t[P("0x81")],0),this[P("0xafd")]=!1,n===M[P("0x90")]?function(e,t,i){var n=C[P("0x6e")](e[P("0xaf")],oe),o=E[P("0xbf")](t,e[P("0xc6")][P("0xef")],ae);e[P("0xc2")](o),r[P("0x6e")](r.ZERO,e[P("0x8c")]),i[P("0x7f")]=i[P("0x7f")]-b[P("0x5b")];var a=I.fromHeadingPitchRoll(i,se),s=v.fromQuaternion(a,xe);v[P("0xb0a")](s,0,e[P("0x93")]),v[P("0xb0a")](s,2,e.up),r.cross(e.direction,e.up,e[P("0x9b")]),e[P("0xc2")](n),e[P("0x83")](!0)}(this,x,ge):n===M[P("0x85")]?function(e,t,n,o){var a=C[P("0x6e")](e[P("0xaf")],oe);if(e[P("0xc2")](C[P("0xae")]),!r[P("0x84")](t,e.positionWC)){if(o){var s=e[P("0xc6")],x=s[P("0xef")][P("0xd6")](t,le);t=s[P("0x5a")](x,ne)}i.clone(t,e.position);var l=.5*-t.z,c=-l,u=e.frustum;if(lo&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}N[P("0x5")][P("0xb21")]=function(e){var t=this[P("0x6b9")];if(t===M.MORPHING&&this[P("0x42")][P("0xb22")](),t===M.SCENE2D)this[P("0xb23")]({destination:N.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:C[P("0xae")]});else if(t===M.SCENE3D){var i=this[P("0xb20")](N[P("0xafe")]),n=r[P("0x96")](i);n+=n*N[P("0xaff")],r.normalize(i,i),r[P("0x6c")](i,n,i),this[P("0xb23")]({destination:i,duration:e,endTransform:C.IDENTITY})}else if(t===M[P("0x8a")]){var o=this[P("0xc6")][P("0xef")][P("0xc4")],a=new r(0,-1,1);a=r.multiplyByScalar(r[P("0x8d")](a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math[P("0xdc")](r[P("0x8d")](a,pe).z),roll:0},endTransform:C[P("0xae")],convert:!1})}},N.prototype[P("0xdb")]=function(e,t){if(!s(e))throw new l("cartesian is required.");return s(t)||(t=new n),H(this),C[P("0xce")](this[P("0xb0d")],e,t)},N[P("0x5")][P("0xc9")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C.multiplyByPoint(this[P("0xb0d")],e,t)},N[P("0x5")][P("0xb25")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0x739")](this._actualInvTransform,e,t)},N.prototype[P("0xb26")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new n),H(this),C[P("0xce")](this._actualTransform,e,t)},N[P("0x5")][P("0xb27")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0xd4")](this[P("0xae7")],e,t)},N.prototype[P("0xb28")]=function(e,t){if(!s(e))throw new l(P("0xb24"));return s(t)||(t=new r),H(this),C[P("0x739")](this[P("0xae7")],e,t)};var be=new r;N[P("0x5")][P("0xa0")]=function(e,t){if(!s(e))throw new l(P("0xb29"));var i=this.position;r.multiplyByScalar(e,t,be),r[P("0x6d")](i,be,i),this[P("0x6b9")]===M.SCENE2D&&me(this,i),this[P("0x83")](!0)},N[P("0x5")][P("0x584")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x93")],e)},N[P("0x5")][P("0x11c")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x93")],-e)},N[P("0x5")][P("0xb2a")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this.up,e)},N[P("0x5")][P("0xb2b")]=function(e){e=a(e,this[P("0xaf1")]),this.move(this.up,-e)},N[P("0x5")][P("0xb2c")]=function(e){e=a(e,this[P("0xaf1")]),this[P("0xa0")](this[P("0x9b")],e)},N.prototype.moveLeft=function(e){e=a(e,this.defaultMoveAmount),this[P("0xa0")](this[P("0x9b")],-e)},N[P("0x5")][P("0xb2d")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.up,-e)},N.prototype[P("0x585")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.up,e)},N.prototype[P("0xeb")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this[P("0x9b")],-e)},N[P("0x5")][P("0xb2e")]=function(e){e=a(e,this[P("0xaf2")]),this.look(this[P("0x9b")],e)};var ve=new I,Ce=new v;N.prototype[P("0xe7")]=function(e,t){if(!s(e))throw new l("axis is required.");var i=a(t,this[P("0xaf2")]),r=I[P("0xcc")](e,-i,ve),n=v[P("0xcd")](r,Ce),o=this.direction,x=this.up,c=this[P("0x9b")];v.multiplyByVector(n,o,o),v[P("0xce")](n,x,x),v[P("0xce")](n,c,c)},N[P("0x5")][P("0xb2f")]=function(e){e=a(e,this[P("0xaf2")]),this.look(this.direction,e)},N.prototype[P("0xac")]=function(e){e=a(e,this[P("0xaf2")]),this[P("0xe7")](this.direction,-e)};var ye=new I,_e=new v;N[P("0x5")][P("0x9e")]=function(e,t){if(!s(e))throw new l(P("0xb30"));var i=a(t,this[P("0xaf3")]),n=I[P("0xcc")](e,-i,ye),o=v[P("0xcd")](n,_e);v.multiplyByVector(o,this[P("0x8c")],this.position),v.multiplyByVector(o,this[P("0x93")],this[P("0x93")]),v[P("0xce")](o,this.up,this.up),r[P("0x99")](this[P("0x93")],this.up,this[P("0x9b")]),r[P("0x99")](this[P("0x9b")],this.direction,this.up),this[P("0x83")](!1)},N[P("0x5")][P("0xb31")]=function(e){Ee(this,e=a(e,this.defaultRotateAmount))},N[P("0x5")][P("0xda")]=function(e){Ee(this,-(e=a(e,this[P("0xaf3")])))};var Ae=new r,Ie=new r,we=new r,Ge=new r;function Ee(e,t){var i=e.position,n=r.normalize(i,Ae);if(s(e[P("0xc7")])){var o=r[P("0x62")](n,e[P("0xc7")],b[P("0xe9")]),a=r.equalsEpsilon(n,r.negate(e[P("0xc7")],Ge),b[P("0xe9")]);if(o||a)(o&&t<0||a&&0Math.abs(r.left)+Math[P("0x78")](r[P("0x9b")])){var n=r[P("0x151")]-t,o=r[P("0x9aa")]+t,a=e[P("0x59")].y;e._scene[P("0xad")]===T[P("0xb1d")]&&(a*=e[P("0xaf5")]),ab.PI_OVER_TWO-b[P("0xa2c")])f=0;else{var g=ke;g[P("0x112")]=d,g[P("0x114")]=x,g.height=0;var p=Ue;p[P("0x112")]=d,p[P("0x114")]=l,p[P("0x8b")]=0;var m=De;s(m)&&m[P("0xef")]===o||(De=m=new h(void 0,void 0,o)),m[P("0xb39")](g,p),f=m[P("0x283")](.5,ke).latitude}var v=ke;v[P("0x112")]=d,v[P("0x114")]=f,v[P("0x8b")]=0;var C=o[P("0xa7")](v,qe),_=ke;_[P("0x112")]=c,_.latitude=x;var A=o[P("0xa7")](_,Be);_[P("0x112")]=u;var I=o.cartographicToCartesian(_,Ve);_.longitude=d;var w=o[P("0xa7")](_,ze);_.latitude=l;var G=o[P("0xa7")](_,He);_[P("0x112")]=c;var E=o[P("0xa7")](_,je);_[P("0x112")]=u;var S=o[P("0xa7")](_,We);r[P("0x95")](I,C,I),r[P("0x95")](E,C,E),r.subtract(A,C,A),r[P("0x95")](S,C,S),r[P("0x95")](w,C,w),r[P("0x95")](G,C,G);var T=o[P("0xd5")](C,a[P("0x93")]);r.negate(T,T);var M=r.cross(T,r[P("0xc3")],a.right);r[P("0x8d")](M,M);var N,L=r[P("0x99")](M,T,a.up);if(e[P("0xe8")]instanceof y){var R,O,F=Math.max(r[P("0x8e")](A,I),r[P("0x8e")](E,S)),D=Math[P("0xee")](r.distance(A,E),r[P("0x8e")](I,S)),k=e[P("0xe8")][P("0xb3a")].right/e[P("0xe8")]._offCenterFrustum[P("0x151")],U=D*k;Ut[P("0x2aa")]&&(t=G[P("0xb3b")]);var n=e[P("0xae7")],o=e[P("0xb0d")],a=Ze;a[P("0x112")]=t[P("0x2aa")],a[P("0x114")]=t.north;var x=r.project(a,Je);C[P("0xd4")](n,x,x),C[P("0xd4")](o,x,x),a[P("0x112")]=t[P("0x2a9")],a[P("0x114")]=t.south;var l=r[P("0x5a")](a,$e);if(C[P("0xd4")](n,l,l),C.multiplyByPoint(o,l,l),i.x=.5*(x.x-l.x)+l.x,i.y=.5*(x.y-l.y)+l.y,s(e[P("0xe8")][P("0xb07")])){var c=Math[P("0x992")](.5*e[P("0xe8")][P("0xb07")]),u=e.frustum[P("0xaef")]*c;i.z=.5*Math[P("0xee")]((x.x-l.x)/u,(x.y-l.y)/c)}else{var h=x.x-l.x,f=x.y-l.y;i.z=Math[P("0xee")](h,f)}return i}(this,e,t):i===M.SCENE2D?function(e,t,i){var r=e._projection;t.west>t[P("0x2aa")]&&(t=G[P("0xb3b")]);var n=et;n[P("0x112")]=t.east,n[P("0x114")]=t[P("0x2ac")];var o=r.project(n,tt);n[P("0x112")]=t.west,n[P("0x114")]=t.south;var a,s,x=r[P("0x5a")](n,it),l=.5*Math[P("0x78")](o.x-x.x),c=.5*Math.abs(o.y-x.y),u=e[P("0xe8")][P("0x9b")]/e[P("0xe8")].top,h=c*u;return hb[P("0x5b")]))return i.ellipsoid[P("0xa7")](o,r)}(this,e,this[P("0xc6")],i);else{if(this[P("0x6b9")]!==M[P("0x8a")])return;i=function(e,t,i,n){var o=e.getPickRay(t,ot),a=-o[P("0x87")].x/o[P("0x93")].x;w[P("0xe1")](o,a,n);var s=i.unproject(new r(n.y,n.z,0));if(!(s[P("0x114")]<-b[P("0x5b")]||s[P("0x114")]>b[P("0x5b")]||s[P("0x112")]<-Math.PI||s.longitude>Math.PI))return i[P("0xef")][P("0xa7")](s,n)}(this,e,this[P("0xc6")],i)}return i}};var at=new r,st=new r,xt=new r,lt=new r;N[P("0x5")][P("0x86")]=function(e,t){if(!s(e))throw new l(P("0xb3d"));s(t)||(t=new w);var i=this[P("0xe8")];return s(i[P("0xaef")])&&s(i[P("0xaf0")])&&s(i[P("0xb3e")])?function(e,t,i){var n=e[P("0x42")].canvas,o=n[P("0x94")],a=n[P("0x7c")],s=Math[P("0x992")](.5*e[P("0xe8")].fovy),x=e.frustum[P("0xaef")]*s,l=e.frustum.near,c=2/o*t.x-1,u=2/a*(a-t.y)-1,h=e[P("0xa5")];r[P("0x6e")](h,i[P("0x87")]);var f=r[P("0x6c")](e[P("0xa6")],l,at);r[P("0x6d")](h,f,f);var d=r[P("0x6c")](e.rightWC,c*l*x,st),g=r[P("0x6c")](e.upWC,u*l*s,xt),p=r[P("0x6d")](f,d,i[P("0x93")]);return r[P("0x6d")](p,g,p),r[P("0x95")](p,h,p),r[P("0x8d")](p,p),i}(this,e,t):function(e,t,i){var n=e[P("0x42")].canvas,o=n[P("0x94")],a=n[P("0x7c")],x=e.frustum;s(x._offCenterFrustum)&&(x=x._offCenterFrustum);var l=2/o*t.x-1;l*=.5*(x[P("0x9b")]-x[P("0x149")]);var c=2/a*(a-t.y)-1;c*=.5*(x.top-x[P("0x9aa")]);var u=i.origin;return r[P("0x6e")](e.position,u),r[P("0x6c")](e.right,l,lt),r.add(lt,u,u),r.multiplyByScalar(e.up,c,lt),r[P("0x6d")](lt,u,u),r[P("0x6e")](e[P("0xa6")],i[P("0x93")]),e[P("0x6b9")]===M[P("0x8a")]&&r[P("0x88")](i[P("0x87")].z,i[P("0x87")].x,i.origin.y,i[P("0x87")]),i}(this,e,t)};var ct=new r,ut=new r;N[P("0x5")][P("0xb3f")]=function(e){if(!s(e))throw new l(P("0xb40"));var t=r[P("0x95")](this[P("0xa5")],e[P("0x11a")],ct),i=r[P("0x6c")](this[P("0xa6")],r[P("0x92")](t,this[P("0xa6")]),ut);return Math[P("0xee")](0,r[P("0x96")](i)-e[P("0x181")])};var ht=new i;function ft(e,t,i,n,o,a){var s=r.clone(t);return i.y>n?s.y-=i.y-n:i.y<-n&&(s.y+=-n-i.y),i.z>o?s.z-=i.z-o:i.z<-o&&(s.z+=-o-i.z),{easingFunction:c[P("0xb44")],startObject:{time:0},stopObject:{time:1},duration:a,update:function(i){var n=r[P("0x308")](t,s,i.time,new r);e[P("0xc9")](n,e[P("0x8c")])}}}N.prototype[P("0xb41")]=function(e,t,i){if(!s(e))throw new l(P("0xb40"));if(!s(t))throw new l("drawingBufferWidth is required.");if(!s(i))throw new l(P("0xb42"));var r=this[P("0xb3f")](e),n=this.frustum[P("0xb43")](t,i,r,ht);return Math[P("0xee")](n.x,n.y)};var dt=new r,gt=new r,pt=new r,mt=new r;N[P("0x5")][P("0xb45")]=function(e){if(!s(e))throw new l(P("0xb46"));if(this[P("0x6b9")]===M[P("0x8a")])return function(e,t){var i=e[P("0x8c")],n=e[P("0x93")],o=e.worldToCameraCoordinatesVector(r[P("0xb8")],dt),a=-r[P("0x92")](o,i)/r[P("0x92")](o,n),s=r[P("0x6d")](i,r[P("0x6c")](n,a,gt),gt);e[P("0xb27")](s,s),i=e[P("0xb27")](e.position,pt);var x=Math[P("0x992")](.5*e[P("0xe8")][P("0xb07")]),l=e[P("0xe8")][P("0xaef")]*x,c=r.magnitude(r[P("0x95")](i,s,mt)),u=l*c,h=x*c,f=e._maxCoord.x,d=e[P("0x59")].y,g=Math.max(u-f,f),p=Math[P("0xee")](h-d,d);if(i.z<-g||i.z>g||i.y<-p||i.y>p){var m=s.y<-g||s.y>g,b=s.z<-p||s.z>p;if(m||b)return ft(e,i,s,g,p,t)}}(this,e)};var bt=new r,vt={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function Ct(e,t,i){s(i)||(i=d[P("0x6e")](N[P("0xb52")]));var r,n,o,a,x=e[P("0x42")][P("0x24f")][P("0x30")],l=e[P("0x42")][P("0x24f")][P("0x79")],c=i[P("0x55c")];if(!s(c)||0===c){var u=t[P("0x181")];0===u?i[P("0x55c")]=100:e.frustum instanceof y||e[P("0x6b9")]===M[P("0x85")]?i[P("0x55c")]=function(e,t){var i,r,n=e[P("0xe8")];s(n[P("0xb3a")])&&(n=n[P("0xb3a")]);var o=n[P("0x9b")]/n.top,a=t*o;return ab.PI?f+=b.TWO_PI-v:f+=v,d=m}return b.equalsEpsilon(Math[P("0x78")](f),b.TWO_PI,b[P("0xb5b")])&&(i[P("0x2a9")]=-b.PI,i[P("0x2aa")]=b.PI,0<=Ft[0][P("0x114")]?i.north=b[P("0x5b")]:i[P("0x2ab")]=-b.PI_OVER_TWO),i}},N.prototype[P("0xb5c")]=function(){if(!(this._mode===M[P("0x85")]||this.frustum instanceof A)){var e=this[P("0x42")];this[P("0xe8")]=new A,this.frustum[P("0xaef")]=e[P("0x782")]/e[P("0x783")],this.frustum.fov=b[P("0x119")](60)}},N[P("0x5")][P("0xb5d")]=function(){if(!(this._mode===M[P("0x85")]||this.frustum instanceof y)){var e=this._scene;this[P("0xe8")]=new y,this[P("0xe8")][P("0xaef")]=e.drawingBufferWidth/e[P("0x783")],this[P("0xe8")][P("0x19a")]=r.magnitude(this.position);var t=this.frustum[P("0xb5e")];s(t)&&this[P("0x83")](!0)}},N[P("0x6e")]=function(e,t){return s(t)||(t=new N(e[P("0x42")])),r.clone(e[P("0x8c")],t[P("0x8c")]),r[P("0x6e")](e[P("0x93")],t[P("0x93")]),r.clone(e.up,t.up),r[P("0x6e")](e[P("0x9b")],t[P("0x9b")]),C.clone(e[P("0xae5")],t[P("0xaf")]),t[P("0xae8")]=!0,t},e.GeoCamera=N}(Cesium$2),function(e){var t=e[P("0x10")],i=e.defined,r=e[P("0xf")],n=e[P("0x22b")],o=e.DeveloperError,a=e[P("0x19")],s=e[P("0x23")],x=e[P("0x15f")],l=e[P("0x161")],c=e[P("0xb5f")];function u(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e,r,n){var o=u(c[P("0x35")],r),a=e[P("0xb60")],s=e[P("0xb61")],x=e._eventStartPosition,h=e._pressTime,f=e._releaseTime;a[o]=!0,s[o]=!1,x[o]=new t;var d=e[P("0xb62")][o];i(d)||(d=e[P("0xb62")][o]={}),d[P("0x8e")]={startPosition:new t,endPosition:new t},d[P("0xaa")]={startPosition:new t,endPosition:new t},d[P("0xb63")]=0,e._eventHandler[P("0x160")]((function(i){e[P("0xb64")]++,s[o]=!0,h[o]=new Date,t[P("0x308")](i[P("0xb65")],i.position2,.5,x[o])}),l[P("0x162")],r),e[P("0xb66")][P("0x160")]((function(){e._buttonsDown=Math[P("0xee")](e[P("0xb64")]-1,0),s[o]=!1,f[o]=new Date}),l[P("0xb67")],r),e[P("0xb66")][P("0x160")]((function(e){if(s[o]){a[o]?(l=e,c=d,t[P("0x6e")](l[P("0x8e")].startPosition,c.distance[P("0x63")]),t[P("0x6e")](l[P("0x8e")][P("0x64")],c[P("0x8e")][P("0x64")]),t[P("0x6e")](l[P("0xaa")].startPosition,c[P("0xaa")].startPosition),t[P("0x6e")](l.angleAndHeight[P("0x64")],c[P("0xaa")][P("0x64")]),a[o]=!1,d[P("0xb63")]=d[P("0xaa")][P("0x63")].x):(t.clone(e.distance[P("0x64")],d[P("0x8e")].endPosition),t[P("0x6e")](e.angleAndHeight[P("0x64")],d[P("0xaa")][P("0x64")]));for(var i=d.angleAndHeight[P("0x64")].x,r=d[P("0xb63")],x=2*Math.PI;i>=r+Math.PI;)i-=x;for(;i -0.5){\n"+P("0xc89")+P("0xc8a")+P("0x7bf")+P("0xc7c")+P("0xc86")+P("0xc7d")+P("0x7b4")+" }\n}",i[P("0xc8b")]="uniform float mixNum;\n"+P("0xc70")+P("0x7a0")+P("0xc7f")+P("0x7a1")+P("0xc72")+P("0xc73")+P("0xc74")+P("0xc80")+"varying vec2 v_textureCoordinates;\n"+P("0x7a5")+P("0x7a6")+P("0xc75")+P("0x7a7")+P("0xc76")+"}\n"+P("0x7a8")+P("0x7a9")+P("0x7aa")+" float n_range = czm_depthRange.near;\n"+P("0x7ac")+" return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\n"+P("0xc77")+P("0xc81")+" return (visibility === 1.0);\n}\nvoid main()\n{\n"+P("0x7b1")+P("0x7b2")+P("0x7b3")+" out_FragColor = color;\n"+P("0x7b5")+P("0x7b7")+P("0x7b8")+P("0xc78")+P("0xc83")+P("0xc84")+P("0xc79")+" {\n"+P("0x7b4")+P("0x7b5")+P("0x7b7")+P("0xc7a")+P("0xc7b")+P("0xc88")+P("0xc8c")+" positionWC /= positionWC.w;\n"+P("0xc8d")+" if(depth - videoDistance > -0.5){\n"+P("0xc89")+P("0xc8a")+P("0x7bf")+P("0xc85")+" out_FragColor = vec4(mix(color.rgb, videoColor.rgb, mixNum), 1.0);\n"+P("0xc7d")+P("0x7b4")+" }\n}",e[P("0xf")](i[P("0x5")],{CreationEvent:{get:function(){return this[P("0xc6d")]}},AddToSceneEvent:{get:function(){return this[P("0xc6b")]}},RemoveFromSceneEvent:{get:function(){return this[P("0xc6c")]}}}),i.prototype[P("0xc8e")]=function(){var e=this[P("0xc67")];if(e){if(this[P("0xc6a")]=e[P("0xc8f")](),this._videoTexture)e.fillVideo||(this[P("0xc6a")]=null);else if(e[P("0xc90")])return void this._removeFromScene();this[P("0xc91")](),this[P("0xc92")](),this._addToScene()}},i[P("0x5")][P("0xc93")]=function(){this[P("0xc68")]=null,this._removeFromScene()},i[P("0x5")][P("0xc94")]=function(){this._postStage&&(this[P("0x42")][P("0x77c")][P("0xd1")](this[P("0xc69")])||(this._scene.postProcessStages[P("0x6d")](this[P("0xc69")]),this[P("0xc6b")][P("0x896")](this)))},i.prototype[P("0xc95")]=function(){this._postStage&&this._scene[P("0x77c")][P("0xd1")](this._postStage)&&(this[P("0x42")][P("0x77c")][P("0x17f")](this._postStage),this[P("0xc69")]=null,this[P("0xc6c")][P("0x896")](this))},i[P("0x5")][P("0xc91")]=function(){if(!this._uniforms){var e=this,t=e[P("0xc67")];e._videoTexture?this[P("0xc68")]={mixNum:function(){return t[P("0xc96")]},videoMapTexture:function(){return t[P("0xc97")]()},videoTexture:function(){return e[P("0xc6a")]},videoMapMatrix:function(){return t[P("0xc98")]()},videoViewMatrix:function(){return t[P("0xc99")]()},videoDistance:function(){return t.fovDistance},videoMapPosition:function(){return t[P("0x8c")]},u_videoColor:function(){return t[P("0xc9a")]}}:this[P("0xc68")]={mixNum:function(){return t.mixFactor},videoMapTexture:function(){return t[P("0xc97")]()},videoMapMatrix:function(){return t[P("0xc98")]()},videoViewMatrix:function(){return t[P("0xc99")]()},videoDistance:function(){return t[P("0xc9b")]},videoMapPosition:function(){return t[P("0x8c")]},u_videoColor:function(){return t[P("0xc9a")]}}}},i[P("0x5")][P("0xc9c")]=function(){var e=this[P("0xc69")];e&&(e.enabled=this[P("0xc67")][P("0x5ba")])},i[P("0x5")][P("0xc92")]=function(){var t;this[P("0xc69")]||(t=1===this[P("0xc67")][P("0xc9d")]?this[P("0xc6a")]?i._FS_Cone:i[P("0xc7e")]:this[P("0xc6a")]?i[P("0xc87")]:i[P("0xc8b")],this._postStage=new(e[P("0x7c5")])({fragmentShader:t,enabled:!1,uniforms:this[P("0xc68")]}),this[P("0xc6d")][P("0x896")](this))},i[P("0x5")]._destroyPostStage=function(){this._postStage&&this[P("0xc95")](),this[P("0xc68")]=null},e[P("0xf")](r[P("0x5")],{minFovX:{get:function(){return this[P("0xcb7")]},set:function(e){this[P("0xcb7")]=e}},maxFovX:{get:function(){return this[P("0xc9f")]},set:function(e){this[P("0xc9f")]=e}},minFovY:{get:function(){return this[P("0xca0")]},set:function(e){this[P("0xca0")]=e}},maxFovY:{get:function(){return this[P("0xca2")]},set:function(e){this[P("0xca2")]=e}},minFovDistance:{get:function(){return this[P("0xca4")]},set:function(e){this[P("0xca4")]=e}},maxFovDistance:{get:function(){return this[P("0xca6")]},set:function(e){this[P("0xca6")]=e}},minHeading:{get:function(){return this[P("0xca8")]},set:function(e){this[P("0xca8")]=e}},maxHeading:{get:function(){return this[P("0xcaa")]},set:function(e){this._maxHeading=e}},minPitch:{get:function(){return this[P("0xcb8")]},set:function(e){this[P("0xcb8")]=e}},maxPitch:{get:function(){return this._maxPitch},set:function(e){this._maxPitch=e}},minRoll:{get:function(){return this[P("0xcaf")]},set:function(e){this._minRoll=e}},maxRoll:{get:function(){return this[P("0xcb9")]},set:function(e){this._maxRoll=e}},minSegmentCount:{get:function(){return this[P("0xcb2")]},set:function(e){this[P("0xcb2")]=e}},maxSegmentCount:{get:function(){return this[P("0xcb3")]},set:function(e){this[P("0xcb3")]=e}},isInvSphere:{get:function(){return this._isInvSphere},set:function(e){this._isInvSphere=e}},isSphereType:{get:function(){return this._isSphereType},set:function(e){this[P("0xcb6")]=e}}}),r[P("0xcba")]=5,r[P("0xcb4")]=10,r[P("0xc9e")]=1,r._MaxFovX=160,r[P("0xca1")]=1,r._MaxFovY=90,r[P("0xca5")]=1,r._MaxFovDistance=500,r[P("0xca9")]=-180,r[P("0xcab")]=180,r[P("0xcb0")]=-90,r[P("0xcb1")]=90,r[P("0xcac")]=-90,r[P("0xcae")]=90,r[P("0x5")][P("0xcbb")]=function(e){return e?ethis[P("0xcb3")]?this[P("0xcb3")]:e:this._minSegmentCount},r[P("0x5")].clampFovX=function(e){return e?ethis._maxFovX?this._maxFovX:e:this[P("0xc9f")]},r[P("0x5")][P("0xcbc")]=function(e){return e?ethis._maxFovY?this[P("0xca2")]:e:this._maxFovY},r[P("0x5")][P("0xcbd")]=function(e){return e?ethis._maxFovDistance?this[P("0xca6")]:e:this[P("0xca4")]},r.prototype[P("0xcbe")]=function(e){return e?ethis._maxHeading?this[P("0xcaa")]:e:0},r.prototype[P("0xcbf")]=function(e){return e?ethis._maxPitch?this[P("0xcad")]:e:0},r[P("0x5")].clampRoll=function(e){return e?ethis[P("0xcb9")]?this[P("0xcb9")]:e:0},n[P("0x5")][P("0xf4")]=function(){this[P("0x42")]=null,this[P("0xc67")]=null,this[P("0x224")]=null,this[P("0x9fc")]=null,this._boundingVolume=null,this[P("0xcc0")]=null,this[P("0xcc6")]=null,this[P("0x5ba")]=!1,this[P("0xcc9")]=!1,this[P("0x6ce")]&&(this[P("0x6ce")][P("0xcca")]&&(this[P("0x6ce")][P("0xcca")][P("0xf4")](),this[P("0x6ce")][P("0xcca")]=null),this._drawCommand[P("0x4d8")]&&(this._drawCommand._vertexArray[P("0xf4")](),this[P("0x6ce")][P("0x4d8")]=null),this[P("0x6ce")]=null)},e.defineProperties(n[P("0x5")],{id:{get:function(){return this._id},set:function(e){this._id=e}},actived:{get:function(){return this[P("0x5ba")]},set:function(e){this[P("0x5ba")]=e}},visibly:{get:function(){return this._visibly},set:function(e){this[P("0xcc9")]=e}},DeveloperErrorEvent:{get:function(){return this[P("0x9fc")]}},minFovX:{get:function(){return this._videoProjection.config[P("0xccb")]}},maxFovX:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xccd")]}},minFovY:{get:function(){return this[P("0xc67")][P("0xccc")].minFovY}},maxFovY:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcce")]}},minFovDistance:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xccf")]}},maxFovDistance:{get:function(){return this._videoProjection.config.maxFovDistance}},minHeading:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd0")]}},maxHeading:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd1")]}},minPitch:{get:function(){return this[P("0xc67")].config[P("0xcd2")]}},maxPitch:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd3")]}},minRoll:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd4")]}},maxRoll:{get:function(){return this._videoProjection.config[P("0xcd5")]}},minSegmentCount:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd6")]}},maxSegmentCount:{get:function(){return this._videoProjection.config[P("0xcd7")]}},isSphereType:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd8")]}},isInvSphere:{get:function(){return this[P("0xc67")][P("0xccc")][P("0xcd9")]}},position:{get:function(){return this[P("0x6b6")]}},fovX:{get:function(){return this._fovX},set:function(e){ethis[P("0xccd")]?this[P("0x9fc")][P("0x896")](P("0xcda")):this._fovX!==e&&(this._fovX=e,this[P("0xcc8")]=!0)}},fovY:{get:function(){return this[P("0xcc1")]},set:function(e){ethis[P("0xcce")]?this[P("0x9fc")].raiseEvent(P("0xcdc")):this._fovY!==e&&(this[P("0xcc1")]=e,this._isNeedRecreate=!0)}},fovDistance:{get:function(){return this[P("0xcc2")]},set:function(e){ethis[P("0xcdd")]?this[P("0x9fc")][P("0x896")](P("0xcde")):this[P("0xcc2")]!==e&&(this[P("0xcc2")]=e,this[P("0xcc8")]=!0)}},heading:{get:function(){return this[P("0x541")]},set:function(e){ethis[P("0xcd1")]?this[P("0x9fc")][P("0x896")](P("0xcdf")):this[P("0x541")]!==e&&(this._heading=e,this[P("0xcc8")]=!0)}},roll:{get:function(){return this[P("0x538")]},set:function(e){ethis[P("0xcd5")]?this._errorEvent[P("0x896")](P("0xce0")):this._roll!==e&&(this[P("0x538")]=e,this._isNeedRecreate=!0)}},pitch:{get:function(){return this._pitch},set:function(e){ethis.maxPitch?this[P("0x9fc")][P("0x896")]("pitch!"):this._pitch!==e&&(this[P("0x537")]=e,this[P("0xcc8")]=!0)}},color:{get:function(){return this[P("0x596")]},set:function(e){this[P("0x596")]=e[P("0x6e")]()}},lineWidth:{get:function(){return this[P("0x31a")]},set:function(e){e<1?this._errorEvent.raiseEvent("lineWidth!"):this[P("0x31a")]=e}},mixFactor:{get:function(){return this[P("0xcc3")]},set:function(e){e<0||1=this[P("0xdaa")][P("0xd9f")].length?(this[P("0xdad")](this[P("0xdb1")]),void this._toStop()):(this.state=this._createState(),void 0===this[P("0xdb3")]?this.state:(this[P("0xdb3")][P("0xdbc")]=new Date,this[P("0xdb3")])));if(r(t[P("0x93")],t[P("0xdbd")])){var n=e[P("0x11")][P("0x8e")](t[P("0x64")],t[P("0x8c")]),o=this._walkAnimation[P("0xda0")]+t[P("0xdbe")];return x=new Date,l=i.ComputeTimeDelta(t[P("0xdbc")],x),t.date=x,n<=(o*=l/1e3)?(t[P("0x8c")]=e[P("0x11")][P("0x6e")](t.endPosition,new e.Cartesian3),t):(a=e[P("0x11")][P("0x95")](t[P("0x64")],t[P("0x8c")],new(e[P("0x11")])),e[P("0x11")][P("0x8d")](a,a),e[P("0x11")][P("0x6c")](a,o,a),t[P("0x8c")]=e[P("0x11")][P("0x6d")](t.position,a,new(e[P("0x11")])),t)}var a=e[P("0x11")][P("0x99")](t.direction,t[P("0xdbd")],new e.Cartesian3);e[P("0x11")][P("0x8d")](a,a);var s=e[P("0x23")][P("0x119")](this[P("0xdaa")][P("0xda1")]+t.rotateSpeed),x=new Date,l=i.ComputeTimeDelta(t[P("0xdbc")],x);if(t[P("0xdbc")]=x,(s*=l/1e3)=r[P("0x0")])return this.raiseChangeEvent(i),void this[P("0xdb2")]();var n={},o=r[t],a=r[i];return n[P("0x8c")]=e.Cartesian3[P("0x1a1")](o[P("0xda8")].longitude,o.geoposition[P("0x114")],o[P("0xda8")][P("0x8b")],this[P("0xdaa")][P("0xef")],new(e[P("0x11")])),n[P("0x93")]=e[P("0x11")].clone(o[P("0x93")],new(e[P("0x11")])),n[P("0xdbe")]=o[P("0xdbe")],n[P("0xdbf")]=o.rotateSpeed,n.endPosition=e[P("0x11")][P("0x1a1")](a.geoposition[P("0x112")],a[P("0xda8")].latitude,a.geoposition.height,this[P("0xdaa")][P("0xef")],new(e[P("0x11")])),n[P("0xdbd")]=e[P("0x11")][P("0x6e")](a[P("0x93")],new e.Cartesian3),n};var o=new e.Matrix4,a=(new(e[P("0x11")]),new(e[P("0x11")])),s=new e.Cartesian3}(Cesium$2),function(e){var t=e.GeoWalkerCamera=function(i){this.viewer=i[P("0x13b")],this[P("0x10f")]=this[P("0x13b")][P("0x10f")],this[P("0x7e")]=this[P("0x13b")].camera,this[P("0x94e")]=e[P("0x102")](i[P("0x94e")],1),this[P("0xdc0")]=e[P("0x102")](i[P("0xdc0")],5),this[P("0xdc1")]=e[P("0x102")](i.manHeight,1.6),this[P("0xdc2")]=e.defaultValue(i[P("0xdc2")],.8),this[P("0xdb3")]=t[P("0xdc3")][P("0xdc4")],this._lockCamera=!1,this[P("0xdc5")]=!1,this[P("0x44")]=this.scene[P("0xa3")][P("0xef")],this[P("0xdc6")]=new l,this[P("0xdc7")]=!1,this[P("0xd81")]=e.defaultValue(i.filterFar,null),this[P("0xdc8")]=e[P("0x102")](i[P("0xdc9")],!0),i[P("0xdca")]&&this[P("0x13b")]&&viewer[P("0x10f")][P("0x77c")].add(new(e[P("0xd7f")])({scene:viewer[P("0x10f")]}))};t[P("0x5")].setState=function(t){0=e[P("0xe77")]&&t.minX<=e.maxX&&t[P("0x4d2")]>=e[P("0x4d2")]&&t[P("0x4d2")]<=e.maxY||t[P("0xe78")]>=e[P("0xe77")]&&t.maxX<=e[P("0xe78")]&&t[P("0xe79")]>=e[P("0x4d2")]&&t[P("0xe79")]<=e.maxY||t[P("0xe77")]>=e[P("0xe77")]&&t[P("0xe77")]<=e[P("0xe78")]&&t[P("0xe79")]>=e[P("0x4d2")]&&t.maxY<=e[P("0xe79")]||t[P("0xe78")]>=e[P("0xe77")]&&t.maxX<=e.maxX&&t[P("0x4d2")]>=e[P("0x4d2")]&&t[P("0x4d2")]<=e.maxY}function n(e,t){var i=e.x,r=e.y,n=e.width,o=e.height,a=t.x,s=t.y,x=t[P("0x19a")],l=t[P("0x8b")];return!(a<=i&&a+x<=i||i<=a&&i+n<=a||s<=r&&s+l<=r||r<=s&&r+o<=s)}e[P("0x14")],e.defineProperties(i[P("0x5")],{}),i.prototype[P("0xe28")]=function(e,t,i,r){for(var n=0;ne[P("0x968")]+1||t[P("0xe19")][P("0x109")]e[P("0x968")]+1||t[P("0xe1a")][P("0x109")]=this[P("0xe39")]&&!this.viewer[P("0x194")].contains(this.labelCache[e])&&(this._isInitial&&this[P("0xe1e")]&&(this[P("0xe22")][e][P("0x221")]=!1),this[P("0x13b")][P("0x194")][P("0x6d")](this.labelCache[e]));if(!this[P("0xe23")]){for(e=0;et[P("0x9b")]+10||e.y<-10||e.y>t[P("0x9aa")]+10)};var o=function(e){for(var t=0,i=0;i=r[5]?(r.push(r[0]),r[P("0x17c")](r[1]),r[P("0x17c")](r[5])):(r[P("0x17c")](r[3]),r[P("0x17c")](r[4]),r[P("0x17c")](r[2]));var l={horizontalDistance:null,verticalHeight:null,spaceDistance:null},c=1e3*turf[P("0x8e")](turf.point([r[0],r[1]]),turf[P("0x2ec")]([r[3],r[4]]));(h=[])[P("0x17c")]((r[0]+r[3])/2),h[P("0x17c")]((r[1]+r[4])/2),r[2]>=r[5]?h.push(r[5]):h[P("0x17c")](r[2]),c<1e3?l.horizontalDistance=P("0x311")+c[P("0x2af")](2)+"m":l[P("0xebb")]=P("0x311")+(c/1e3)[P("0x2af")](2)+"km";var u=Math[P("0x78")](r[2]-r[5]),h=[];r[2]>=r[5]?(h[P("0x17c")](r[0]),h.push(r[1])):(h[P("0x17c")](r[3]),h[P("0x17c")](r[4])),h.push((r[2]+r[5])/2),l[P("0xebc")]=u<1e3?P("0x312")+u[P("0x2af")](2)+"m":"垂直高度:"+(u/1e3)[P("0x2af")](2)+"km";var f=Math[P("0xca")](Math[P("0x2ae")](c,2)+Math[P("0x2ae")](u,2));return(h=[])[P("0x17c")]((r[0]+r[3])/2),h[P("0x17c")]((r[1]+r[4])/2),h.push((r[2]+r[5])/2),f<1e3?l.spaceDistance=P("0x313")+f.toFixed(2)+"m":l[P("0xebd")]=P("0x313")+(f/1e3)[P("0x2af")](2)+"km",l}}},t[P("0x5")].elevation=function(t){if(t[P("0x2ec")]){var i=[t.position._value];if(1===i[P("0x0")]){var r=e[P("0x13")][P("0x175")](i[0])[P("0x8b")];P("0x30a"),r.toFixed(2),createResultLabel2(this.options,this.primitives,i)}}}}(Cesium$2),U=(void 0===A.a?"undefined":w()(A.a))===P("0x8")&&"symbol"===w()(Symbol[P("0x1f3")])?function(e){return w()(e)}:function(e){return e&&(void 0===A.a?"undefined":w()(A.a))===P("0x8")&&e[P("0x2b7")]===A.a&&e!==Symbol[P("0x5")]?P("0x1f4"):w()(e)},function(e){var t=e[P("0xebe")]=function(t){t=e[P("0x102")](t,e[P("0x102")][P("0x128")]),this[P("0x13c")]=t[P("0x13b")],this[P("0x68a")]=e[P("0x14")](t[P("0xa22")])?t[P("0xa22")]:new e.WebMercatorTilingScheme({ellipsoid:t[P("0xef")]}),this[P("0xebf")]=e[P("0x102")](t[P("0xec0")],512),this[P("0xec1")]=e[P("0x102")](t.tileHeight,512),this._readyPromise=e[P("0x9ee")].resolve(!0),this[P("0xec2")]=new GeoOLMS.MVT,this[P("0xa94")]=t[P("0xe18")],this[P("0x6a8")]=t[P("0xa39")],this._styleName=t[P("0xec3")],this[P("0xec4")]=t.tileMatrixSetID,this[P("0xec5")]=t.tileMatrixLabels,this[P("0xa0f")]=P("0xec6"),this._maximumLevel=t[P("0xec7")],this._rectangle=e[P("0x102")](t[P("0x969")],this._tilingScheme[P("0x969")]),this[P("0xec8")]=e[P("0x102")](t[P("0xec9")],22),this[P("0xeca")]=e[P("0x102")](t.symbolVisibility,P("0x2b4")),this[P("0xecb")]=e[P("0x102")](t[P("0xecb")],!0),this[P("0xecc")]=new(e[P("0x766")]),this[P("0xecd")]=e[P("0x102")](t[P("0x4")],""),this._url=e[P("0x102")](t[P("0x6af")],P("0xece"));var i=null;this[P("0x68a")]instanceof e.WebMercatorTilingScheme?i=[-20037508.342789244,-20037508.342789244,20037508.342789244,20037508.342789244]:this[P("0x68a")]instanceof e[P("0x9d7")]&&(i=[-180,-270,180,90]),this._resolutions=GeoOLMS[P("0xecf")](i,22,this._tileWidth)[P("0xed0")](),this[P("0xed1")]=1,this[P("0xae5")]=[.125,0,0,.125,0,0],this._replays=[P("0xed2"),P("0x5a5"),"Polygon",P("0x9e3"),P("0xed3")],this._tileQueueForCanvas=new e.TileReplacementQueue,this[P("0xed4")]=new(e[P("0xed5")]),this[P("0xed6")]=1e3,this._styles=void 0,this[P("0xb7f")]=this[P("0xed7")](),this[P("0xed8")]=void 0,this[P("0xed9")]={},this[P("0xeda")]={},this[P("0xedb")]=document.createElement(P("0x48")),this[P("0xedb")].width=512,this[P("0xedb")][P("0x8b")]=512,P("0xedc")in window?this[P("0xedd")]=!e.defined(t[P("0xede")])||t.useWebWorker:(e[P("0x14")](t[P("0xede")])&&!0===t.useWebWorker&&console.warn(P("0xedf")),this[P("0xedd")]=!1),1===this._useWebWorker&&(this[P("0xeca")]=P("0x2b4")),this[P("0xee0")]=function(){return[]};var n=this,o=this[P("0xee1")]();if(r(o=this[P("0xa94")]?this[P("0xa94")].getURL(o):o,!1,(function(i){if(i){if(!i[P("0xee2")]){for(var r="mysourceid",o=0;oi&&e[P("0x14")](s);){var x=s[P("0xf00")];r=t,a=o=void 0,o=(n=s).replacementPrevious,a=n[P("0xefe")],n===r[P("0xeff")]&&(r._lastBeforeStartOfFrame=a),n===r.head?r[P("0xefb")]=a:o.replacementNext=a,n===r.tail?r.tail=o:a[P("0xf00")]=o,n[P("0xf00")]=void 0,n[P("0xefe")]=void 0,--r.count,s=null,s=x}}e[P("0xf")](t[P("0x5")],{url:{get:function(){return this._url}},proxy:{get:function(){return this[P("0xa94")]}},tileWidth:{get:function(){return this[P("0xebf")]}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},sourceMaxzoom:{get:function(){return this[P("0xec8")]}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this[P("0x689")]}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this[P("0xa82")]}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},styles:{get:function(){return this._styles}},pickedEvent:{get:function(){return this[P("0xecc")]}},useWebWorker:{get:function(){return this[P("0xedd")]}},symbolVisibility:{get:function(){return this._symbolVisibility}}}),t[P("0x5")][P("0xefa")]=function(e,t,i){},t[P("0x5")][P("0xeee")]=function(){var e=P("0xf02")+this[P("0xec8")]+P("0xf03")+this[P("0x9c9")]+P("0xf04")+this[P("0xf05")]+P("0xf06")+this[P("0xebf")]+P("0xf07")+this._tileHeight+P("0xf08"),t=new Blob([e],{type:P("0xf09")}),i=URL[P("0xf0a")](t);this[P("0xf0b")]=[];for(var r=this.currentActor=0;r<4;r++){var n=new Worker(i),o=new a(n,this,1);o[P("0x176")]=P("0xf0c")+r,this[P("0xf0b")].push(o)}var s={style:JSON[P("0xf0d")](this[P("0xee5")]),spriteUrl:this._spriteUrl};for(r=0;rthis[P("0xed6")]&&o(this[P("0xed4")],this[P("0xed6")]/4),(g=e[P("0x33a")]).xMvt=a,g[P("0xefc")]=x,g[P("0xefd")]=c,this[P("0xed4")].markTileRendered(g));else{var u=new String("bad request");this[P("0xed9")][e.key].resolve(this.blankCanvas)}for(var h in this[P("0xeef")][P("0x1a9")]>this[P("0xed6")]&&o(this[P("0xeef")],this[P("0xed6")]/4),u.xMvt=a,u[P("0xefc")]=x,u.zMvt=c,this[P("0xeef")].markTileRendered(u),this[P("0xed9")][e[P("0x4")]].state=t[P("0xf19")][P("0xf23")],delete this.deferCache[e[P("0x4")]],this[P("0xeda")]){var f=this[P("0xed9")][h];if(f&&(f[P("0xdb3")]===t[P("0xf19")][P("0xf1d")]||f.state===t[P("0xf19")].RELOADED)){var d,g;e=(g=n(a=(d=JSON[P("0x946")](h))[0],x=d[1],c=d[2],this[P("0xed4")]))?{key:h,data:g}:{key:h,data:l[P("0xfa")](this,a,x,c)[P("0x33a")]},r[P("0xe45")](P("0xf17"),e,s[P("0xf10")](this)),delete this.messageCache[h],f.state=t[P("0xf19")][P("0xef5")];break}}}else if(e.type===P("0xf24")||e[P("0x165")]===P("0x9c2")||"setStyle"===e.type){var p=this;this[P("0x6c9")]++,4===this[P("0x6c9")]&&(this[P("0x6c9")]=0,i[P("0xfa")](this),setTimeout((function(){p[P("0xaf6")]()}),200))}}function l(t,i,r){for(var o=null,a=null,s=t,x=i,l=r;l>this._sourceMaxzoom&&(o=n(s=s/2|0,x=x/2|0,--l,this._tileQueueForFeatures),!e.defined(o)););if(e[P("0x14")](o))a={features:o,x:s,y:x,z:l};else{var c=this[P("0xb7f")][P("0xa1c")](P("0xe3f"),s).replace(P("0xf1b"),x)[P("0xa1c")](P("0xe3e"),l).replace(P("0xf1c"),this[P("0xecd")]);a={features:c=this[P("0xa94")]?this[P("0xa94")][P("0xa95")](c):c,x:s,y:x,z:l}}return a}function u(e,t,i){var r=JSON[P("0x946")](t),n=r[0],o=r[1],a=r[2];if(i>x<>x<f[P("0xed6")]&&o(f[P("0xed4")],f._cacheSize/4),e[P("0xf29")]=i,e[P("0xefc")]=r,e[P("0xefd")]=m,f._tileQueueForFeatures[P("0xf2a")](e);var t=u(f[P("0xec2")][P("0xf26")](e),b,f[P("0xec8")]),n=f[P("0xf27")](t,i,r,m);d.resolve(n)})):I instanceof ArrayBuffer&&(this[P("0xed4")][P("0x1a9")]>this[P("0xed6")]&&o(this[P("0xed4")],this[P("0xed6")]/4),I[P("0xf29")]=i,I[P("0xefc")]=r,I[P("0xefd")]=m,this[P("0xed4")][P("0xf2a")](I),_=u(this._mvtParser[P("0xf26")](I),b,this[P("0xec8")]),A=this.renderCanvas(_,i,r,m),d.resolve(A))}}return d[P("0xa90")]},t[P("0x5")].renderCanvas=function(t,i,r,n){var a=GeoOLMS[P("0xf2b")](9,void 0),s=document.createElement(P("0x48"));s[P("0x19a")]=512,s.height=512;for(var x=s.getContext("2d"),l=this.styleFunc,c=e[P("0x14")](t[P("0xf2c")])?t.rect:[0,0,4096,4096],u=new GeoOLMS.ReplayGroup(0,c,8,window[P("0xf2d")],!0,a,100),h=0;hthis._cacheSize&&o(this._tileQueueForCanvas,this[P("0xed6")]/4),s[P("0xf29")]=i,s.yMvt=r,s[P("0xefd")]=n,this[P("0xeef")].markTileRendered(s),s},t.prototype[P("0xf24")]=function(e,t,r){for(var n=this._styles,o=0;othis._sourceMaxzoom?this[P("0xec8")]:x,v=(u-c[0])/(c[2]-c[0])*Math[P("0x2ae")](2,b),C=(c[3]-d)/(c[3]-c[1])*Math[P("0x2ae")](2,b),y=4096*(v-Math[P("0x3e8")](v)),_=4096*(C-Math[P("0x3e8")](C)),A=[],I=[],w=0;w>>8&255]<<16|u[e>>>16&255]<<8|u[e>>>24&255])>>32-t:u[e]>>8-t),t+a<8)s=s<>t-r-1&1,8==++a&&(a=0,n[o++]=u[s],s=0,o===n[P("0x0")]&&(n=this.f()));n[o]=s,this[P("0x4b3")]=n,this.i=a,this[P("0x286")]=o},o[P("0x5")].finish=function(){var e=this[P("0x4b3")],t=this[P("0x286")];return 0>>1;c;c>>>=1)x<<=1,x|=1&c,--l;s[a]=(x<>>0}var u=s;function h(e){this[P("0x4b3")]=new(n?Uint16Array:Array)(2*e),this.length=0}function f(e){var t,i,r,o,a,s,x,l,c,u,h=e[P("0x0")],f=0,d=Number[P("0x31")];for(l=0;lf&&(f=e[l]),e[l]>=1;for(u=r<<16|l,c=s;co[r]);)n=o[i],o[i]=o[r],o[r]=n,n=o[i+1],o[i+1]=o[r+1],o[r+1]=n,i=r;return this[P("0x0")]},h.prototype[P("0x25c")]=function(){var e,t,i,r,n,o=this.buffer;for(t=o[0],e=o[1],this[P("0x0")]-=2,o[0]=o[this.length],o[1]=o[this[P("0x0")]+1],n=0;!((r=2*n+2)>=this[P("0x0")])&&(r+2o[r]&&(r+=2),o[r]>o[n]);)i=o[n],o[n]=o[r],o[r]=i,i=o[n+1],o[n+1]=o[r+1],o[r+1]=i,n=r;return{index:e,value:t,length:this.length}};var g,p=2,m={NONE:0,r:1,k:p,O:3},b=[];for(g=0;g<288;g++)switch(!0){case g<=143:b[P("0x17c")]([g+48,8]);break;case g<=255:b.push([g-144+400,9]);break;case g<=279:b[P("0x17c")]([g-256+0,7]);break;case g<=287:b.push([g-280+192,8]);break;default:e("invalid literal: "+g)}function v(e,t){this[P("0x0")]=e,this.H=t}d.prototype.j=function(){var i,r,a,s,x=this[P("0xf53")];switch(this.h){case 0:for(a=0,s=x[P("0x0")];a>>8&255,m[v++]=255&u,m[v++]=u>>>8&255,n)m.set(h,v),v+=h[P("0x0")],m=m.subarray(0,v);else{for(d=0,g=h.length;d>16&255,x[l++]=r>>24,!0){case 1===s:n=[0,s-1,0];break;case 2===s:n=[1,s-2,0];break;case 3===s:n=[2,s-3,0];break;case 4===s:n=[3,s-4,0];break;case s<=6:n=[4,s-5,1];break;case s<=8:n=[5,s-7,1];break;case s<=12:n=[6,s-9,2];break;case s<=16:n=[7,s-13,2];break;case s<=24:n=[8,s-17,3];break;case s<=32:n=[9,s-25,3];break;case s<=48:n=[10,s-33,4];break;case s<=64:n=[11,s-49,4];break;case s<=96:n=[12,s-65,5];break;case s<=128:n=[13,s-97,5];break;case s<=192:n=[14,s-129,6];break;case s<=256:n=[15,s-193,6];break;case s<=384:n=[16,s-257,7];break;case s<=512:n=[17,s-385,7];break;case s<=768:n=[18,s-513,8];break;case s<=1024:n=[19,s-769,8];break;case s<=1536:n=[20,s-1025,9];break;case s<=2048:n=[21,s-1537,9];break;case s<=3072:n=[22,s-2049,10];break;case s<=4096:n=[23,s-3073,10];break;case s<=6144:n=[24,s-4097,11];break;case s<=8192:n=[25,s-6145,11];break;case s<=12288:n=[26,s-8193,12];break;case s<=16384:n=[27,s-12289,12];break;case s<=24576:n=[28,s-16385,13];break;case s<=32768:n=[29,s-24577,13];break;default:e(P("0xf59"))}for(r=n,x[l++]=r[0],x[l++]=r[1],x[l++]=r[2],o=0,a=x[P("0x0")];o2*c[a-1]+u[a]&&(c[a]=2*c[a-1]+u[a]),f[a]=Array(c[a]),d[a]=Array(c[a]);for(o=0;oe[o]?(f[a][s]=x,d[a][s]=t,l+=2):(f[a][s]=e[o],d[a][s]=o,++o);g[a]=0,1===u[a]&&r(a)}return h}(r,r[P("0x0")],t),a=0,s=i[P("0x0")];a>>=1;return a}function E(t,i){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this[P("0xf53")]=n?new Uint8Array(t):t,this.s=!1,this.n=T,this.C=!1,(i||(i={},0))&&(i[P("0x286")]&&(this.c=i[P("0x286")]),i[P("0xf5a")]&&(this.m=i.bufferSize),i.bufferType&&(this.n=i[P("0xf5b")]),i[P("0xf5c")]&&(this.C=i[P("0xf5c")])),this.n){case S:this.b=32768,this.a=new(n?Uint8Array:Array)(32768+this.m+258);break;case T:this.b=0,this.a=new(n?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error(P("0xf5d")))}}var S=0,T=1,M=S,N=T;E[P("0x5")].p=function(){for(;!this.s;){var i=Z(this,3);switch(1&i&&(this.s=!0),i>>>=1){case 0:var r=this[P("0xf53")],o=this.c,a=this.a,s=this.b,x=r.length,l=t,c=a[P("0x0")],u=t;switch(this.e=this.g=0,x<=o+1&&e(Error("invalid uncompressed block header: LEN")),l=r[o++]|r[o++]<<8,x<=o+1&&e(Error("invalid uncompressed block header: NLEN")),l===~(r[o++]|r[o++]<<8)&&e(Error(P("0xf5e"))),o+l>r[P("0x0")]&&e(Error(P("0xf5f"))),this.n){case S:for(;s+l>a[P("0x0")];){if(l-=u=c-s,n)a.set(r[P("0xaaf")](o,o+u),s),s+=u,o+=u;else for(;u--;)a[s++]=r[o++];this.b=s,a=this.f(),s=this.b}break;case T:for(;s+l>a[P("0x0")];)a=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(n)a[P("0xf60")](r.subarray(o,o+l),s),s+=l,o+=l;else for(;l--;)a[s++]=r[o++];this.c=o,this.b=s,this.a=a;break;case 1:this.o(Y,Q);break;case 2:$(this);break;default:e(Error(P("0xf61")+i))}}return this.t()};var L,R,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=n?new Uint16Array(O):O,D=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],k=n?new Uint16Array(D):D,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],B=n?new Uint8Array(U):U,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],V=n?new Uint16Array(W):W,j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],z=n?new Uint8Array(j):j,H=new(n?Uint8Array:Array)(288);for(L=0,R=H[P("0x0")];L>>i,t.e=o-i,t.c=s,r}function J(e,t){for(var i,r,n=e.g,o=e.e,a=e[P("0xf53")],s=e.c,x=a[P("0x0")],l=t[0],c=t[1];o>>16,e.g=n>>r,e.e=o-r,e.c=s,65535&i}function $(e){function t(e,t,i){var r,n,o,a=this.z;for(o=0;o>>0;e=r}for(var n,o=1,a=0,s=e.length,x=0;0>>0}function te(t,i){var r,n;if(this.input=t,this.c=0,(i||(i={},0))&&(i[P("0x286")]&&(this.c=i.index),i.verify&&(this.N=i[P("0xf62")])),r=t[this.c++],n=t[this.c++],(15&r)===ie)this.method=ie;else e(Error(P("0xf63")));0!=((r<<8)+n)%31&&e(Error(P("0xf64")+((r<<8)+n)%31)),32&n&&e(Error(P("0xf65"))),this.B=new E(t,{index:this.c,bufferSize:i[P("0xf5a")],bufferType:i[P("0xf5b")],resize:i[P("0xf5c")]})}E[P("0x5")].o=function(e,t){var i=this.a,r=this.b;this.u=e;for(var n,o,a,s,x=i[P("0x0")]-258;256!==(n=J(this,e));)if(n<256)x<=r&&(this.b=r,i=this.f(),r=this.b),i[r++]=n;else for(s=k[o=n-257],0t&&(this.a[P("0x0")]=t),e=this.a),this[P("0x4b3")]=e},te[P("0x5")].p=function(){var t,i=this[P("0xf53")];return t=this.B.p(),this.c=this.B.c,this.N&&(i[this.c++]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==ee(t)&&e(Error(P("0xf66"))),t};var ie=8;function re(e,t){this[P("0xf53")]=e,this.a=new(n?Uint8Array:Array)(32768),this.h=ne.k;var i,r={};for(i in(t||(t={},0))&&P("0x49f")===w()(t.compressionType)&&(this.h=t[P("0xf55")]),t)r[i]=t[i];r[P("0xf56")]=this.a,this.A=new d(this.input,r)}var ne=m;function oe(e,t){var i,n,o,a;if(Object[P("0xdcb")])i=Object[P("0xdcb")](t);else for(n in i=[],o=0,t)i[o++]=n;for(o=0,a=i[P("0x0")];o>24&255,x[l++]=s>>16&255,x[l++]=s>>8&255,x[l++]=255&s,x},r(P("0xf69"),te),r(P("0xf6a"),te.prototype.p),oe(P("0xf6b"),{ADAPTIVE:N,BLOCK:M}),r(P("0xf6c"),re),r(P("0xf6d"),(function(e,t){return new re(e,t).j()})),r(P("0xf6e"),re[P("0x5")].j),oe("Zlib.Deflate.CompressionType",{NONE:ne[P("0xe5d")],FIXED:ne.r,DYNAMIC:ne.k})}[P("0xfa")](window),r(237)}]);const Cesium$1=mars3d__namespace.Cesium,BaseLayer=mars3d__namespace.layer.BaseLayer;class TdtDmLayer extends BaseLayer{get layer(){return this.wtfs}_addedHook(){const e=this.options.url||"https://t{s}.tianditu.gov.cn/mapservice/GetTiles",t=this.options.key||mars3d__namespace.Token.tianditu;let i;if(i=Array.isArray(this.options.subdomains)?this.options.subdomains.slice():Cesium$1.defined(this.options.subdomains)&&this.options.subdomains.length>0?this.options.subdomains.split(""):["0","1","2","3","4","5","6","7"],!Cesium$1.GeoWTFS)return void console.error("请确认正确引入天地图官方提供的cesiumTdt.js文件,并确认无冲突!");const r=new Cesium$1.GeoWTFS({...this.options,viewer:this._map.viewer,subdomains:i,metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:Cesium$1.Color.WHITE,scale:.5,outlineColor:Cesium$1.Color.BLACK,outlineWidth:5,style:Cesium$1.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:Cesium$1.Color.RED,backgroundPadding:new Cesium$1.Cartesian2(10,10),horizontalOrigin:Cesium$1.HorizontalOrigin.MIDDLE,verticalOrigin:Cesium$1.VerticalOrigin.TOP,eyeOffset:Cesium$1.Cartesian3.ZERO,pixelOffset:new Cesium$1.Cartesian2(0,8)},billboardGraphics:{horizontalOrigin:Cesium$1.HorizontalOrigin.CENTER,verticalOrigin:Cesium$1.VerticalOrigin.CENTER,eyeOffset:Cesium$1.Cartesian3.ZERO,pixelOffset:Cesium$1.Cartesian2.ZERO,alignedAxis:Cesium$1.Cartesian3.ZERO,color:Cesium$1.Color.WHITE,rotation:0,scale:1,width:18,height:18}});r.getTileUrl=function(){return e+"?lxys={z},{x},{y}&tk="+t},r.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),this.wtfs=r}_removedHook(){this.wtfs&&(this.wtfs.destroy(),this.wtfs=null)}}mars3d__namespace.layer.TdtDmLayer=TdtDmLayer,mars3d__namespace.layer.register("tdt_dm",TdtDmLayer);const Cesium=mars3d__namespace.Cesium;class TdtTerrainProvider extends Cesium.GeoTerrainProvider{constructor(e={}){if(!e.urls){const t=e.url||"https://t{s}.tianditu.gov.cn/mapservice/swdx",i=e.key||mars3d__namespace.Token.tianditu;let r;r=Array.isArray(e.subdomains)?e.subdomains.slice():Cesium.defined(e.subdomains)&&e.subdomains.length>0?e.subdomains.split(""):["0","1","2","3","4","5","6","7"];const n=[];r.forEach((e=>{const r=mars3d__namespace.Util.template(t,{s:e})+"?T=elv_c&tk="+i;n.push(r)})),e.urls=n}super(e),this._layers=[]}}mars3d__namespace.LayerUtil.registerTerrainProvider("tdt",TdtTerrainProvider),mars3d__namespace.provider.TdtTerrainProvider=TdtTerrainProvider,exports.TdtDmLayer=TdtDmLayer,exports.TdtTerrainProvider=TdtTerrainProvider,Object.defineProperty(exports,"__esModule",{value:!0})})); diff --git a/public/lib/mars3d/plugins/wind/mars3d-wind.js b/public/lib/mars3d/plugins/wind/mars3d-wind.js index bcc850db..c60d62c2 100644 --- a/public/lib/mars3d/plugins/wind/mars3d-wind.js +++ b/public/lib/mars3d/plugins/wind/mars3d-wind.js @@ -1,8 +1,8 @@ /** * Mars3D平台插件,支持气象 风向图 功能插件 mars3d-wind * - * 版本信息:v3.5.10 - * 编译日期:2023-06-05 18:30:50 + * 版本信息:v3.5.12 + * 编译日期:2023-06-19 10:10:45 * 版权所有:Copyright by 火星科技 http://mars3d.cn * 使用单位:免费公开版 ,2023-03-17 */ @@ -11,5 +11,5 @@ typeof define === 'function' && define.amd ? define(['exports', 'mars3d'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-wind"] = {}, global.mars3d)); })(this, (function (exports, mars3d) { -'use strict';const _0x5be5a1=_0x3f55;(function(_0x2d2a75,_0x4e673f){const _0x35f3b7=_0x3f55,_0x523f19=_0x2d2a75();while(!![]){try{const _0x16b819=parseInt(_0x35f3b7(0xc9))/0x1+parseInt(_0x35f3b7(0x17f))/0x2*(-parseInt(_0x35f3b7(0x189))/0x3)+parseInt(_0x35f3b7(0x11e))/0x4*(parseInt(_0x35f3b7(0x136))/0x5)+parseInt(_0x35f3b7(0x12b))/0x6+-parseInt(_0x35f3b7(0xb0))/0x7+parseInt(_0x35f3b7(0x187))/0x8*(-parseInt(_0x35f3b7(0x12e))/0x9)+parseInt(_0x35f3b7(0x10f))/0xa;if(_0x16b819===_0x4e673f)break;else _0x523f19['push'](_0x523f19['shift']());}catch(_0x7dd1b1){_0x523f19['push'](_0x523f19['shift']());}}}(_0x5057,0xcba3b));function _interopNamespace(_0x1a70c4){const _0x9c5f27=_0x3f55;if(_0x1a70c4&&_0x1a70c4['__esModule'])return _0x1a70c4;var _0x572b61=Object['create'](null);return _0x1a70c4&&Object[_0x9c5f27(0xfb)](_0x1a70c4)[_0x9c5f27(0xab)](function(_0x58ffca){const _0x16fa29=_0x9c5f27;if(_0x58ffca!==_0x16fa29(0x105)){var _0x395924=Object['getOwnPropertyDescriptor'](_0x1a70c4,_0x58ffca);Object[_0x16fa29(0x108)](_0x572b61,_0x58ffca,_0x395924['get']?_0x395924:{'enumerable':!![],'get':function(){return _0x1a70c4[_0x58ffca];}});}}),_0x572b61['default']=_0x1a70c4,_0x572b61;}var mars3d__namespace=_interopNamespace(mars3d);const Cesium$7=mars3d__namespace['Cesium'];function getU(_0x3ed9ae,_0x3bfcb1){const _0x1eb0f0=_0x3f55,_0xcc1891=_0x3ed9ae*Math['cos'](Cesium$7[_0x1eb0f0(0x17e)][_0x1eb0f0(0x194)](_0x3bfcb1));return _0xcc1891;}function getV(_0x33e5b3,_0x4431ad){const _0x5ac429=_0x3f55,_0xfe0cdc=_0x33e5b3*Math['sin'](Cesium$7[_0x5ac429(0x17e)]['toRadians'](_0x4431ad));return _0xfe0cdc;}function getSpeed(_0x46cccd,_0x1e8388){const _0x21faf8=_0x3f55,_0x1d8376=Math['sqrt'](Math[_0x21faf8(0x114)](_0x46cccd,0x2)+Math['pow'](_0x1e8388,0x2));return _0x1d8376;}function getDirection(_0x5f507f,_0x47b392){const _0x7435ed=_0x3f55;let _0xb95526=Cesium$7[_0x7435ed(0x17e)]['toDegrees'](Math['atan2'](_0x47b392,_0x5f507f));return _0xb95526+=_0xb95526<0x0?0x168:0x0,_0xb95526;}var WindUtil={'__proto__':null,'getU':getU,'getV':getV,'getSpeed':getSpeed,'getDirection':getDirection};const Cesium$6=mars3d__namespace['Cesium'];class CustomPrimitive{constructor(_0x5b3c34){const _0x133a9e=_0x3f55;this[_0x133a9e(0x135)]=_0x5b3c34['commandType'],this['geometry']=_0x5b3c34[_0x133a9e(0x149)],this['attributeLocations']=_0x5b3c34['attributeLocations'],this[_0x133a9e(0xd3)]=_0x5b3c34[_0x133a9e(0xd3)],this['uniformMap']=_0x5b3c34[_0x133a9e(0x11c)],this['vertexShaderSource']=_0x5b3c34['vertexShaderSource'],this['fragmentShaderSource']=_0x5b3c34['fragmentShaderSource'],this[_0x133a9e(0xa5)]=_0x5b3c34['rawRenderState'],this['framebuffer']=_0x5b3c34['framebuffer'],this['outputTexture']=_0x5b3c34[_0x133a9e(0x14d)],this['autoClear']=_0x5b3c34[_0x133a9e(0xd8)]??![],this['preExecute']=_0x5b3c34['preExecute'],this[_0x133a9e(0x182)]=!![],this['commandToExecute']=undefined,this['clearCommand']=undefined,this['autoClear']&&(this['clearCommand']=new Cesium$6['ClearCommand']({'color':new Cesium$6['Color'](0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':this[_0x133a9e(0xcd)],'pass':Cesium$6[_0x133a9e(0x117)]['OPAQUE']}));}['createCommand'](_0x1a6320){const _0x41ddab=_0x3f55;switch(this['commandType']){case'Draw':{const _0x5008ae=Cesium$6['VertexArray'][_0x41ddab(0x138)]({'context':_0x1a6320,'geometry':this['geometry'],'attributeLocations':this['attributeLocations'],'bufferUsage':Cesium$6[_0x41ddab(0x195)]['STATIC_DRAW']}),_0x19c563=Cesium$6['ShaderProgram'][_0x41ddab(0x15f)]({'context':_0x1a6320,'attributeLocations':this[_0x41ddab(0xe4)],'vertexShaderSource':this['vertexShaderSource'],'fragmentShaderSource':this[_0x41ddab(0x155)]}),_0x1890be=Cesium$6['RenderState'][_0x41ddab(0x15f)](this[_0x41ddab(0xa5)]);return new Cesium$6['DrawCommand']({'primitiveType':this['primitiveType'],'shaderProgram':_0x19c563,'vertexArray':_0x5008ae,'modelMatrix':Cesium$6['Matrix4'][_0x41ddab(0x15a)],'renderState':_0x1890be,'uniformMap':this['uniformMap'],'castShadows':![],'receiveShadows':![],'framebuffer':this['framebuffer'],'pass':Cesium$6[_0x41ddab(0x117)]['OPAQUE'],'pickOnly':!![],'owner':this});}case _0x41ddab(0x146):{return new Cesium$6['ComputeCommand']({'owner':this,'fragmentShaderSource':this['fragmentShaderSource'],'uniformMap':this['uniformMap'],'outputTexture':this['outputTexture'],'persists':!![]});}}}[_0x5be5a1(0xd7)](_0x3cffbd,_0x383d41){this['geometry']=_0x383d41;const _0x4fc6df=Cesium$6['VertexArray']['fromGeometry']({'context':_0x3cffbd,'geometry':this['geometry'],'attributeLocations':this['attributeLocations'],'bufferUsage':Cesium$6['BufferUsage']['STATIC_DRAW']});this['commandToExecute']['vertexArray']=_0x4fc6df;}['update'](_0x318892){const _0x3356c9=_0x5be5a1;if(!this['show'])return;if(_0x318892['mode']!==Cesium$6['SceneMode'][_0x3356c9(0x12c)])return;!Cesium$6[_0x3356c9(0x16c)](this['commandToExecute'])&&(this['commandToExecute']=this['createCommand'](_0x318892[_0x3356c9(0x123)])),Cesium$6['defined'](this['preExecute'])&&this['preExecute'](),Cesium$6[_0x3356c9(0x16c)](this[_0x3356c9(0xee)])&&_0x318892['commandList']['push'](this['clearCommand']),_0x318892[_0x3356c9(0xbe)]['push'](this['commandToExecute']);}['isDestroyed'](){return![];}['destroy'](){const _0x1fde12=_0x5be5a1;if(this['clearCommand']){var _0x4cb4c9,_0x4552e9;(_0x4cb4c9=this[_0x1fde12(0xee)])!==null&&_0x4cb4c9!==void 0x0&&_0x4cb4c9['vertexArray']&&this['clearCommand']['vertexArray']['destroy'](),(_0x4552e9=this['clearCommand'])!==null&&_0x4552e9!==void 0x0&&_0x4552e9['shaderProgram']&&this['clearCommand']['shaderProgram'][_0x1fde12(0xba)](),delete this['clearCommand'];}return this['commandToExecute']&&(this['commandToExecute'][_0x1fde12(0x11a)]&&this['commandToExecute']['vertexArray'][_0x1fde12(0xba)](),this[_0x1fde12(0x147)]['shaderProgram']&&this['commandToExecute']['shaderProgram'][_0x1fde12(0xba)](),delete this[_0x1fde12(0x147)]),Cesium$6['destroyObject'](this);}}const Cesium$5=mars3d__namespace['Cesium'],Util=(function(){const _0x12d380=function(){const _0x1e173d=_0x3f55,_0xf6bd0a=new Cesium$5[(_0x1e173d(0x116))]({'attributes':new Cesium$5['GeometryAttributes']({'position':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array([-0x1,-0x1,0x0,0x1,-0x1,0x0,0x1,0x1,0x0,-0x1,0x1,0x0])}),'st':new Cesium$5['GeometryAttribute']({'componentDatatype':Cesium$5['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1])})}),'indices':new Uint32Array([0x3,0x2,0x0,0x0,0x2,0x1])});return _0xf6bd0a;},_0x4a9ee0=function(_0x2533da,_0x2d214c){if(Cesium$5['defined'](_0x2d214c)){const _0x4bae48={};_0x4bae48['arrayBufferView']=_0x2d214c,_0x2533da['source']=_0x4bae48;}const _0xae0603=new Cesium$5['Texture'](_0x2533da);return _0xae0603;},_0x27f47e=function(_0x41b2b4,_0x4ac017,_0x501288){const _0x56a379=new Cesium$5['Framebuffer']({'context':_0x41b2b4,'colorTextures':[_0x4ac017],'depthTexture':_0x501288});return _0x56a379;},_0x1d98e7=function(_0x5ab391){const _0x50573d=_0x3f55,_0x1896d2=!![],_0x38e720=![],_0x1c922f={'viewport':_0x5ab391[_0x50573d(0x127)],'depthTest':_0x5ab391[_0x50573d(0x17a)],'depthMask':_0x5ab391['depthMask'],'blending':_0x5ab391['blending']},_0x26af5d=Cesium$5[_0x50573d(0xd5)]['getDefaultRenderState'](_0x1896d2,_0x38e720,_0x1c922f);return _0x26af5d;},_0x3a93b4=function(_0xed380a){const _0x51714c=_0x3f55,_0x4337e2={},_0x288544=Cesium$5['Math']['mod'](_0xed380a['west'],Cesium$5[_0x51714c(0x17e)][_0x51714c(0x150)]),_0x3b73fb=Cesium$5['Math']['mod'](_0xed380a[_0x51714c(0x145)],Cesium$5['Math']['TWO_PI']),_0x291029=_0xed380a[_0x51714c(0x172)];let _0x3f1f19,_0x763804;_0x291029>Cesium$5[_0x51714c(0x17e)]['THREE_PI_OVER_TWO']?(_0x3f1f19=0x0,_0x763804=Cesium$5['Math']['TWO_PI']):_0x3b73fb-_0x288544<_0x291029?(_0x3f1f19=_0x288544,_0x763804=_0x288544+_0x291029):(_0x3f1f19=_0x288544,_0x763804=_0x3b73fb);_0x4337e2['lon']={'min':Cesium$5['Math']['toDegrees'](_0x3f1f19),'max':Cesium$5['Math'][_0x51714c(0x115)](_0x763804)};const _0x9eaa75=_0xed380a['south'],_0x587ecb=_0xed380a['north'],_0x41f3a5=_0xed380a['height'],_0x275659=_0x41f3a5>Cesium$5[_0x51714c(0x17e)]['PI']/0xc?_0x41f3a5/0x2:0x0;let _0x3570a5=Cesium$5[_0x51714c(0x17e)]['clampToLatitudeRange'](_0x9eaa75-_0x275659),_0x564fcd=Cesium$5['Math']['clampToLatitudeRange'](_0x587ecb+_0x275659);return _0x3570a5<-Cesium$5[_0x51714c(0x17e)]['PI_OVER_THREE']&&(_0x3570a5=-Cesium$5['Math']['PI_OVER_TWO']),_0x564fcd>Cesium$5['Math']['PI_OVER_THREE']&&(_0x564fcd=Cesium$5['Math']['PI_OVER_TWO']),_0x4337e2[_0x51714c(0x137)]={'min':Cesium$5['Math']['toDegrees'](_0x3570a5),'max':Cesium$5['Math'][_0x51714c(0x115)](_0x564fcd)},_0x4337e2;};return{'getFullscreenQuad':_0x12d380,'createTexture':_0x4a9ee0,'createFramebuffer':_0x27f47e,'createRawRenderState':_0x1d98e7,'viewRectangleToLonLatRange':_0x3a93b4};}());var segmentDraw_vert='in\x20vec2\x20st;\x0a//\x20it\x20is\x20not\x20normal\x20itself,\x20but\x20used\x20to\x20control\x20normal\x0ain\x20vec3\x20normal;\x20//\x20(point\x20to\x20use,\x20offset\x20sign,\x20not\x20used\x20component)\x0a\x0auniform\x20sampler2D\x20currentParticlesPosition;\x0auniform\x20sampler2D\x20postProcessingPosition;\x0auniform\x20sampler2D\x20postProcessingSpeed;\x0a\x0auniform\x20float\x20particleHeight;\x0a\x0auniform\x20float\x20aspect;\x0auniform\x20float\x20pixelSize;\x0auniform\x20float\x20lineWidth;\x0a\x0aout\x20float\x20speedNormalization;\x0a\x0avec3\x20convertCoordinate(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20WGS84\x20(lon,\x20lat,\x20lev)\x20->\x20ECEF\x20(x,\x20y,\x20z)\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20WGS\x2084\x20geometric\x20constants\x0a\x20\x20\x20\x20float\x20a\x20=\x206378137.0;\x20//\x20Semi-major\x20axis\x0a\x20\x20\x20\x20float\x20b\x20=\x206356752.3142;\x20//\x20Semi-minor\x20axis\x0a\x20\x20\x20\x20float\x20e2\x20=\x206.69437999014e-3;\x20//\x20First\x20eccentricity\x20squared\x0a\x0a\x20\x20\x20\x20float\x20latitude\x20=\x20radians(lonLatLev.y);\x0a\x20\x20\x20\x20float\x20longitude\x20=\x20radians(lonLatLev.x);\x0a\x0a\x20\x20\x20\x20float\x20cosLat\x20=\x20cos(latitude);\x0a\x20\x20\x20\x20float\x20sinLat\x20=\x20sin(latitude);\x0a\x20\x20\x20\x20float\x20cosLon\x20=\x20cos(longitude);\x0a\x20\x20\x20\x20float\x20sinLon\x20=\x20sin(longitude);\x0a\x0a\x20\x20\x20\x20float\x20N_Phi\x20=\x20a\x20/\x20sqrt(1.0\x20-\x20e2\x20*\x20sinLat\x20*\x20sinLat);\x0a\x20\x20\x20\x20float\x20h\x20=\x20particleHeight;\x20//\x20it\x20should\x20be\x20high\x20enough\x20otherwise\x20the\x20particle\x20may\x20not\x20pass\x20the\x20terrain\x20depth\x20test\x0a\x0a\x20\x20\x20\x20vec3\x20cartesian\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20cartesian.x\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20cosLon;\x0a\x20\x20\x20\x20cartesian.y\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20sinLon;\x0a\x20\x20\x20\x20cartesian.z\x20=\x20((b\x20*\x20b)\x20/\x20(a\x20*\x20a)\x20*\x20N_Phi\x20+\x20h)\x20*\x20sinLat;\x0a\x20\x20\x20\x20return\x20cartesian;\x0a}\x0a\x0avec4\x20calcProjectedCoordinate(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20the\x20range\x20of\x20longitude\x20in\x20Cesium\x20is\x20[-180,\x20180]\x20but\x20the\x20range\x20of\x20longitude\x20in\x20the\x20NetCDF\x20file\x20is\x20[0,\x20360]\x0a\x20\x20\x20\x20//\x20[0,\x20180]\x20is\x20corresponding\x20to\x20[0,\x20180]\x20and\x20[180,\x20360]\x20is\x20corresponding\x20to\x20[-180,\x200]\x0a\x20\x20\x20\x20lonLatLev.x\x20=\x20mod(lonLatLev.x\x20+\x20180.0,\x20360.0)\x20-\x20180.0;\x0a\x20\x20\x20\x20vec3\x20particlePosition\x20=\x20convertCoordinate(lonLatLev);\x0a\x20\x20\x20\x20vec4\x20projectedCoordinate\x20=\x20czm_modelViewProjection\x20*\x20vec4(particlePosition,\x201.0);\x0a\x20\x20\x20\x20return\x20projectedCoordinate;\x0a}\x0a\x0avec4\x20calcOffset(vec4\x20currentProjectedCoordinate,\x20vec4\x20nextProjectedCoordinate,\x20float\x20offsetSign)\x20{\x0a\x20\x20\x20\x20vec2\x20aspectVec2\x20=\x20vec2(aspect,\x201.0);\x0a\x20\x20\x20\x20vec2\x20currentXY\x20=\x20(currentProjectedCoordinate.xy\x20/\x20currentProjectedCoordinate.w)\x20*\x20aspectVec2;\x0a\x20\x20\x20\x20vec2\x20nextXY\x20=\x20(nextProjectedCoordinate.xy\x20/\x20nextProjectedCoordinate.w)\x20*\x20aspectVec2;\x0a\x0a\x20\x20\x20\x20float\x20offsetLength\x20=\x20lineWidth\x20/\x202.0;\x0a\x20\x20\x20\x20vec2\x20direction\x20=\x20normalize(nextXY\x20-\x20currentXY);\x0a\x20\x20\x20\x20vec2\x20normalVector\x20=\x20vec2(-direction.y,\x20direction.x);\x0a\x20\x20\x20\x20normalVector.x\x20=\x20normalVector.x\x20/\x20aspect;\x0a\x20\x20\x20\x20normalVector\x20=\x20offsetLength\x20*\x20normalVector;\x0a\x0a\x20\x20\x20\x20vec4\x20offset\x20=\x20vec4(offsetSign\x20*\x20normalVector,\x200.0,\x200.0);\x0a\x20\x20\x20\x20return\x20offset;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec2\x20particleIndex\x20=\x20st;\x0a\x0a\x20\x20\x20\x20vec3\x20currentPosition\x20=\x20texture(currentParticlesPosition,\x20particleIndex).rgb;\x0a\x20\x20\x20\x20vec4\x20nextPosition\x20=\x20texture(postProcessingPosition,\x20particleIndex);\x0a\x0a\x20\x20\x20\x20vec4\x20currentProjectedCoordinate\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20vec4\x20nextProjectedCoordinate\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20if\x20(nextPosition.w\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20currentProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20\x20\x20\x20\x20nextProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20currentProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20\x20\x20\x20\x20nextProjectedCoordinate\x20=\x20calcProjectedCoordinate(nextPosition.xyz);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20pointToUse\x20=\x20normal.x;\x20//\x20-1\x20is\x20currentProjectedCoordinate\x20and\x20+1\x20is\x20nextProjectedCoordinate\x0a\x20\x20\x20\x20float\x20offsetSign\x20=\x20normal.y;\x0a\x0a\x20\x20\x20\x20vec4\x20offset\x20=\x20pixelSize\x20*\x20calcOffset(currentProjectedCoordinate,\x20nextProjectedCoordinate,\x20offsetSign);\x0a\x20\x20\x20\x20if\x20(pointToUse\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20currentProjectedCoordinate\x20+\x20offset;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20nextProjectedCoordinate\x20+\x20offset;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20speedNormalization\x20=\x20texture(postProcessingSpeed,\x20particleIndex).a;\x0a}\x0a',segmentDraw_frag=_0x5be5a1(0x100),fullscreen_vert='in\x20vec3\x20position;\x0ain\x20vec2\x20st;\x0a\x0aout\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20textureCoordinate\x20=\x20st;\x0a\x20\x20\x20\x20gl_Position\x20=\x20vec4(position,\x201.0);\x0a}\x0a',trailDraw_frag=_0x5be5a1(0xe8),screenDraw_frag='uniform\x20sampler2D\x20trailsColorTexture;\x0auniform\x20sampler2D\x20trailsDepthTexture;\x0a\x0ain\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20trailsColor\x20=\x20texture(trailsColorTexture,\x20textureCoordinate);\x0a\x20\x20\x20\x20float\x20trailsDepth\x20=\x20texture(trailsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20globeDepth\x20=\x20czm_unpackDepth(texture(czm_globeDepthTexture,\x20textureCoordinate));\x0a\x0a\x20\x20\x20\x20if\x20(trailsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20trailsColor;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20}\x0a}\x0a';const Cesium$4=mars3d__namespace['Cesium'];class ParticlesRendering{constructor(_0x4e9df4,_0x48fb86,_0xdbd6d8,_0x41b6f2,_0x56db18){this['createRenderingTextures'](_0x4e9df4,_0x48fb86,_0xdbd6d8['colors']),this['createRenderingFramebuffers'](_0x4e9df4),this['createRenderingPrimitives'](_0x4e9df4,_0xdbd6d8,_0x41b6f2,_0x56db18);}['createRenderingTextures'](_0x5129b2,_0x1acf52,_0x2f4c55){const _0x29856b=_0x5be5a1,_0x431afa={'context':_0x5129b2,'width':_0x5129b2['drawingBufferWidth'],'height':_0x5129b2['drawingBufferHeight'],'pixelFormat':Cesium$4[_0x29856b(0x110)][_0x29856b(0xaf)],'pixelDatatype':Cesium$4['PixelDatatype'][_0x29856b(0xdb)]},_0x34ed3={'context':_0x5129b2,'width':_0x5129b2['drawingBufferWidth'],'height':_0x5129b2[_0x29856b(0x16e)],'pixelFormat':Cesium$4[_0x29856b(0x110)]['DEPTH_COMPONENT'],'pixelDatatype':Cesium$4['PixelDatatype']['UNSIGNED_INT']},_0x3f79e1=_0x2f4c55[_0x29856b(0xa7)],_0x469e02=new Float32Array(_0x3f79e1*0x3);for(let _0x591ae9=0x0;_0x591ae9<_0x3f79e1;_0x591ae9++){const _0x562507=Cesium$4['Color'][_0x29856b(0xc0)](_0x2f4c55[_0x591ae9]);_0x469e02[0x3*_0x591ae9]=_0x562507['red'],_0x469e02[0x3*_0x591ae9+0x1]=_0x562507[_0x29856b(0xf7)],_0x469e02[0x3*_0x591ae9+0x2]=_0x562507['blue'];}const _0x57f8f6={'context':_0x5129b2,'width':_0x3f79e1,'height':0x1,'pixelFormat':Cesium$4['PixelFormat'][_0x29856b(0xdd)],'pixelDatatype':Cesium$4[_0x29856b(0xd9)]['FLOAT'],'sampler':new Cesium$4['Sampler']({'minificationFilter':Cesium$4['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium$4[_0x29856b(0x18c)]['LINEAR']})};this[_0x29856b(0xe2)]={'segmentsColor':Util['createTexture'](_0x431afa),'segmentsDepth':Util['createTexture'](_0x34ed3),'currentTrailsColor':Util[_0x29856b(0x19d)](_0x431afa),'currentTrailsDepth':Util['createTexture'](_0x34ed3),'nextTrailsColor':Util[_0x29856b(0x19d)](_0x431afa),'nextTrailsDepth':Util[_0x29856b(0x19d)](_0x34ed3),'colorTable':Util['createTexture'](_0x57f8f6,_0x469e02)};}['createRenderingFramebuffers'](_0x2d180b){const _0x40ef7d=_0x5be5a1;this['framebuffers']={'segments':Util['createFramebuffer'](_0x2d180b,this['textures']['segmentsColor'],this['textures']['segmentsDepth']),'currentTrails':Util['createFramebuffer'](_0x2d180b,this['textures']['currentTrailsColor'],this['textures'][_0x40ef7d(0xfe)]),'nextTrails':Util['createFramebuffer'](_0x2d180b,this['textures']['nextTrailsColor'],this[_0x40ef7d(0xe2)]['nextTrailsDepth'])};}['createSegmentsGeometry'](_0x440553){const _0x24a8e7=_0x5be5a1,_0x4f204e=0x4;let _0x14ff12=[];for(let _0x361f6c=0x0;_0x361f6c<_0x440553[_0x24a8e7(0x19c)];_0x361f6c++){for(let _0x2fc11b=0x0;_0x2fc11b<_0x440553['particlesTextureSize'];_0x2fc11b++){for(let _0x3ede89=0x0;_0x3ede89<_0x4f204e;_0x3ede89++){_0x14ff12['push'](_0x361f6c/_0x440553['particlesTextureSize']),_0x14ff12[_0x24a8e7(0xf0)](_0x2fc11b/_0x440553[_0x24a8e7(0x19c)]);}}}_0x14ff12=new Float32Array(_0x14ff12);let _0x40c284=[];const _0x2dc5f8=[-0x1,0x1],_0x18d66d=[-0x1,0x1];for(let _0x491902=0x0;_0x491902<_0x440553['maxParticles'];_0x491902++){for(let _0x3a04f4=0x0;_0x3a04f4<_0x4f204e/0x2;_0x3a04f4++){for(let _0x131a0b=0x0;_0x131a0b<_0x4f204e/0x2;_0x131a0b++){_0x40c284['push'](_0x2dc5f8[_0x3a04f4]),_0x40c284['push'](_0x18d66d[_0x131a0b]),_0x40c284['push'](0x0);}}}_0x40c284=new Float32Array(_0x40c284);const _0x56dbfb=0x6*_0x440553['maxParticles'],_0x3b8d24=new Uint32Array(_0x56dbfb);for(let _0x4956e3=0x0,_0x4e64e6=0x0,_0x5707f2=0x0;_0x4956e3<_0x440553[_0x24a8e7(0x140)];_0x4956e3++){_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x0,_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x1,_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x2,_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x2,_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x1,_0x3b8d24[_0x4e64e6++]=_0x5707f2+0x3,_0x5707f2+=0x4;}const _0x57047e=new Cesium$4[(_0x24a8e7(0x116))]({'attributes':new Cesium$4[(_0x24a8e7(0x160))]({'st':new Cesium$4['GeometryAttribute']({'componentDatatype':Cesium$4[_0x24a8e7(0x104)]['FLOAT'],'componentsPerAttribute':0x2,'values':_0x14ff12}),'normal':new Cesium$4['GeometryAttribute']({'componentDatatype':Cesium$4[_0x24a8e7(0x104)][_0x24a8e7(0xfa)],'componentsPerAttribute':0x3,'values':_0x40c284})}),'indices':_0x3b8d24});return _0x57047e;}[_0x5be5a1(0xed)](_0x3fbeeb,_0x10239a,_0x585e45,_0x121d59){const _0x39678a=_0x5be5a1,_0x350375=this;this['primitives']={'segments':new CustomPrimitive({'commandType':'Draw','attributeLocations':{'st':0x0,'normal':0x1},'geometry':this['createSegmentsGeometry'](_0x10239a),'primitiveType':Cesium$4['PrimitiveType']['TRIANGLES'],'uniformMap':{'currentParticlesPosition':function(){const _0x1a8b4b=_0x3f55;return _0x121d59['particlesTextures'][_0x1a8b4b(0x181)];},'postProcessingPosition':function(){return _0x121d59['particlesTextures']['postProcessingPosition'];},'postProcessingSpeed':function(){const _0xc2cd8f=_0x3f55;return _0x121d59[_0xc2cd8f(0x10d)]['postProcessingSpeed'];},'colorTable':function(){return _0x350375['textures']['colorTable'];},'aspect':function(){const _0x258be4=_0x3f55;return _0x3fbeeb['drawingBufferWidth']/_0x3fbeeb[_0x258be4(0x16e)];},'pixelSize':function(){return _0x585e45['pixelSize'];},'lineWidth':function(){const _0x196df5=_0x3f55;return _0x10239a[_0x196df5(0x179)];},'particleHeight':function(){const _0x4a524a=_0x3f55;return _0x10239a[_0x4a524a(0x177)];}},'vertexShaderSource':new Cesium$4['ShaderSource']({'sources':[segmentDraw_vert]}),'fragmentShaderSource':new Cesium$4['ShaderSource']({'sources':[segmentDraw_frag]}),'rawRenderState':Util[_0x39678a(0x13c)]({'viewport':undefined,'depthTest':{'enabled':!![]},'depthMask':!![]}),'framebuffer':this[_0x39678a(0x10a)]['segments'],'autoClear':!![]}),'trails':new CustomPrimitive({'commandType':'Draw','attributeLocations':{'position':0x0,'st':0x1},'geometry':Util[_0x39678a(0x125)](),'primitiveType':Cesium$4['PrimitiveType'][_0x39678a(0x159)],'uniformMap':{'segmentsColorTexture':function(){return _0x350375['textures']['segmentsColor'];},'segmentsDepthTexture':function(){const _0x6e3c90=_0x39678a;return _0x350375['textures'][_0x6e3c90(0x190)];},'currentTrailsColor':function(){const _0x3dc62f=_0x39678a;return _0x350375['framebuffers'][_0x3dc62f(0x139)][_0x3dc62f(0x156)](0x0);},'trailsDepthTexture':function(){const _0x1a808d=_0x39678a;return _0x350375['framebuffers'][_0x1a808d(0x139)]['depthTexture'];},'fadeOpacity':function(){return _0x10239a['fadeOpacity'];}},'vertexShaderSource':new Cesium$4[(_0x39678a(0xec))]({'defines':['DISABLE_GL_POSITION_LOG_DEPTH'],'sources':[fullscreen_vert]}),'fragmentShaderSource':new Cesium$4['ShaderSource']({'defines':[_0x39678a(0xc2)],'sources':[trailDraw_frag]}),'rawRenderState':Util['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':!![],'func':Cesium$4[_0x39678a(0xf8)]['ALWAYS']},'depthMask':!![]}),'framebuffer':this[_0x39678a(0x10a)][_0x39678a(0x158)],'autoClear':!![],'preExecute':function(){const _0x2e7975=_0x39678a,_0x232089=_0x350375['framebuffers']['currentTrails'];_0x350375[_0x2e7975(0x10a)][_0x2e7975(0x139)]=_0x350375['framebuffers']['nextTrails'],_0x350375['framebuffers']['nextTrails']=_0x232089,_0x350375['primitives']['trails']['commandToExecute']['framebuffer']=_0x350375['framebuffers']['nextTrails'],_0x350375['primitives']['trails']['clearCommand']['framebuffer']=_0x350375['framebuffers']['nextTrails'];}}),'screen':new CustomPrimitive({'commandType':_0x39678a(0xb4),'attributeLocations':{'position':0x0,'st':0x1},'geometry':Util['getFullscreenQuad'](),'primitiveType':Cesium$4[_0x39678a(0xbb)]['TRIANGLES'],'uniformMap':{'trailsColorTexture':function(){const _0x1782f0=_0x39678a;return _0x350375[_0x1782f0(0x10a)][_0x1782f0(0x158)]['getColorTexture'](0x0);},'trailsDepthTexture':function(){return _0x350375['framebuffers']['nextTrails']['depthTexture'];}},'vertexShaderSource':new Cesium$4[(_0x39678a(0xec))]({'defines':['DISABLE_GL_POSITION_LOG_DEPTH'],'sources':[fullscreen_vert]}),'fragmentShaderSource':new Cesium$4['ShaderSource']({'defines':[_0x39678a(0xc2)],'sources':[screenDraw_frag]}),'rawRenderState':Util['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':![]},'depthMask':!![],'blending':{'enabled':!![]}}),'framebuffer':undefined})};}}var getWind_frag='//\x20the\x20size\x20of\x20UV\x20textures:\x20width\x20=\x20lon,\x20height\x20=\x20lat*lev\x0auniform\x20sampler2D\x20U;\x20//\x20eastward\x20wind\x0auniform\x20sampler2D\x20V;\x20//\x20northward\x20wind\x0a\x0auniform\x20sampler2D\x20currentParticlesPosition;\x20//\x20(lon,\x20lat,\x20lev)\x0a\x0auniform\x20vec3\x20dimension;\x20//\x20(lon,\x20lat,\x20lev)\x0auniform\x20vec3\x20minimum;\x20//\x20minimum\x20of\x20each\x20dimension\x0auniform\x20vec3\x20maximum;\x20//\x20maximum\x20of\x20each\x20dimension\x0auniform\x20vec3\x20interval;\x20//\x20interval\x20of\x20each\x20dimension\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec2\x20mapPositionToNormalizedIndex2D(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20ensure\x20the\x20range\x20of\x20longitude\x20and\x20latitude\x0a\x20\x20\x20\x20lonLatLev.x\x20=\x20mod(lonLatLev.x,\x20360.0);\x0a\x20\x20\x20\x20lonLatLev.y\x20=\x20clamp(lonLatLev.y,\x20-90.0,\x2090.0);\x0a\x0a\x20\x20\x20\x20vec3\x20index3D\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20index3D.x\x20=\x20(lonLatLev.x\x20-\x20minimum.x)\x20/\x20interval.x;\x0a\x20\x20\x20\x20index3D.y\x20=\x20(lonLatLev.y\x20-\x20minimum.y)\x20/\x20interval.y;\x0a\x20\x20\x20\x20index3D.z\x20=\x20(lonLatLev.z\x20-\x20minimum.z)\x20/\x20interval.z;\x0a\x0a\x20\x20\x20\x20//\x20the\x20st\x20texture\x20coordinate\x20corresponding\x20to\x20(col,\x20row)\x20index\x0a\x20\x20\x20\x20//\x20example\x0a\x20\x20\x20\x20//\x20data\x20array\x20is\x20[0,\x201,\x202,\x203,\x204,\x205],\x20width\x20=\x203,\x20height\x20=\x202\x0a\x20\x20\x20\x20//\x20the\x20content\x20of\x20texture\x20will\x20be\x0a\x20\x20\x20\x20//\x20t\x201.0\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x20\x203\x204\x205\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x20\x200\x201\x202\x0a\x20\x20\x20\x20//\x20\x20\x200.0------1.0\x20s\x0a\x0a\x20\x20\x20\x20vec2\x20index2D\x20=\x20vec2(index3D.x,\x20index3D.z\x20*\x20dimension.y\x20+\x20index3D.y);\x0a\x20\x20\x20\x20vec2\x20normalizedIndex2D\x20=\x20vec2(index2D.x\x20/\x20dimension.x,\x20index2D.y\x20/\x20(dimension.y\x20*\x20dimension.z));\x0a\x20\x20\x20\x20return\x20normalizedIndex2D;\x0a}\x0a\x0afloat\x20getWind(sampler2D\x20windTexture,\x20vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20vec2\x20normalizedIndex2D\x20=\x20mapPositionToNormalizedIndex2D(lonLatLev);\x0a\x20\x20\x20\x20float\x20result\x20=\x20texture(windTexture,\x20normalizedIndex2D).r;\x0a\x20\x20\x20\x20return\x20result;\x0a}\x0a\x0aconst\x20mat4\x20kernelMatrix\x20=\x20mat4(\x0a\x20\x20\x20\x200.0,\x20-1.0,\x202.0,\x20-1.0,\x20//\x20first\x20column\x0a\x20\x20\x20\x202.0,\x200.0,\x20-5.0,\x203.0,\x20//\x20second\x20column\x0a\x20\x20\x20\x200.0,\x201.0,\x204.0,\x20-3.0,\x20//\x20third\x20column\x0a\x20\x20\x20\x200.0,\x200.0,\x20-1.0,\x201.0\x20//\x20fourth\x20column\x0a);\x0afloat\x20oneDimensionInterpolation(float\x20t,\x20float\x20p0,\x20float\x20p1,\x20float\x20p2,\x20float\x20p3)\x20{\x0a\x20\x20\x20\x20vec4\x20tVec4\x20=\x20vec4(1.0,\x20t,\x20t\x20*\x20t,\x20t\x20*\x20t\x20*\x20t);\x0a\x20\x20\x20\x20tVec4\x20=\x20tVec4\x20/\x202.0;\x0a\x20\x20\x20\x20vec4\x20pVec4\x20=\x20vec4(p0,\x20p1,\x20p2,\x20p3);\x0a\x20\x20\x20\x20return\x20dot((tVec4\x20*\x20kernelMatrix),\x20pVec4);\x0a}\x0a\x0afloat\x20calculateB(sampler2D\x20windTexture,\x20float\x20t,\x20float\x20lon,\x20float\x20lat,\x20float\x20lev)\x20{\x0a\x20\x20\x20\x20float\x20lon0\x20=\x20floor(lon)\x20-\x201.0\x20*\x20interval.x;\x0a\x20\x20\x20\x20float\x20lon1\x20=\x20floor(lon);\x0a\x20\x20\x20\x20float\x20lon2\x20=\x20floor(lon)\x20+\x201.0\x20*\x20interval.x;\x0a\x20\x20\x20\x20float\x20lon3\x20=\x20floor(lon)\x20+\x202.0\x20*\x20interval.x;\x0a\x0a\x20\x20\x20\x20float\x20p0\x20=\x20getWind(windTexture,\x20vec3(lon0,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p1\x20=\x20getWind(windTexture,\x20vec3(lon1,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p2\x20=\x20getWind(windTexture,\x20vec3(lon2,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p3\x20=\x20getWind(windTexture,\x20vec3(lon3,\x20lat,\x20lev));\x0a\x0a\x20\x20\x20\x20return\x20oneDimensionInterpolation(t,\x20p0,\x20p1,\x20p2,\x20p3);\x0a}\x0a\x0afloat\x20interpolateOneTexture(sampler2D\x20windTexture,\x20vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20float\x20lon\x20=\x20lonLatLev.x;\x0a\x20\x20\x20\x20float\x20lat\x20=\x20lonLatLev.y;\x0a\x20\x20\x20\x20float\x20lev\x20=\x20lonLatLev.z;\x0a\x0a\x20\x20\x20\x20float\x20lat0\x20=\x20floor(lat)\x20-\x201.0\x20*\x20interval.y;\x0a\x20\x20\x20\x20float\x20lat1\x20=\x20floor(lat);\x0a\x20\x20\x20\x20float\x20lat2\x20=\x20floor(lat)\x20+\x201.0\x20*\x20interval.y;\x0a\x20\x20\x20\x20float\x20lat3\x20=\x20floor(lat)\x20+\x202.0\x20*\x20interval.y;\x0a\x0a\x20\x20\x20\x20vec2\x20coefficient\x20=\x20lonLatLev.xy\x20-\x20floor(lonLatLev.xy);\x0a\x20\x20\x20\x20float\x20b0\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat0,\x20lev);\x0a\x20\x20\x20\x20float\x20b1\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat1,\x20lev);\x0a\x20\x20\x20\x20float\x20b2\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat2,\x20lev);\x0a\x20\x20\x20\x20float\x20b3\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat3,\x20lev);\x0a\x0a\x20\x20\x20\x20return\x20oneDimensionInterpolation(coefficient.y,\x20b0,\x20b1,\x20b2,\x20b3);\x0a}\x0a\x0avec3\x20bicubic(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20https://en.wikipedia.org/wiki/Bicubic_interpolation#Bicubic_convolution_algorithm\x0a\x20\x20\x20\x20float\x20u\x20=\x20interpolateOneTexture(U,\x20lonLatLev);\x0a\x20\x20\x20\x20float\x20v\x20=\x20interpolateOneTexture(V,\x20lonLatLev);\x0a\x20\x20\x20\x20float\x20w\x20=\x200.0;\x0a\x20\x20\x20\x20return\x20vec3(u,\x20v,\x20w);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20vec3\x20lonLatLev\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20windVector\x20=\x20bicubic(lonLatLev);\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(windVector,\x200.0);\x0a}\x0a',updateSpeed_frag='uniform\x20sampler2D\x20currentParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0auniform\x20sampler2D\x20particlesWind;\x0a\x0a//\x20used\x20to\x20calculate\x20the\x20wind\x20norm\x0auniform\x20vec2\x20uSpeedRange;\x20//\x20(min,\x20max);\x0auniform\x20vec2\x20vSpeedRange;\x0auniform\x20float\x20pixelSize;\x0auniform\x20float\x20speedFactor;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0afloat\x20calculateWindNorm(vec3\x20speed)\x20{\x0a\x20\x20\x20\x20vec3\x20percent\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20percent.x\x20=\x20(speed.x\x20-\x20uSpeedRange.x)\x20/\x20(uSpeedRange.y\x20-\x20uSpeedRange.x);\x0a\x20\x20\x20\x20percent.y\x20=\x20(speed.y\x20-\x20vSpeedRange.x)\x20/\x20(vSpeedRange.y\x20-\x20vSpeedRange.x);\x0a\x20\x20\x20\x20float\x20normalization\x20=\x20length(percent);\x0a\x0a\x20\x20\x20\x20return\x20normalization;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20//\x20vec3\x20currentSpeed\x20=\x20texture(currentParticlesSpeed,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20windVector\x20=\x20texture(particlesWind,\x20v_textureCoordinates).rgb;\x0a\x0a\x20\x20\x20\x20vec4\x20nextSpeed\x20=\x20vec4(speedFactor\x20*\x20pixelSize\x20*\x20windVector,\x20calculateWindNorm(windVector));\x0a\x20\x20\x20\x20out_FragColor\x20=\x20nextSpeed;\x0a}\x0a',updatePosition_frag='uniform\x20sampler2D\x20currentParticlesPosition;\x20//\x20(lon,\x20lat,\x20lev)\x0auniform\x20sampler2D\x20currentParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec2\x20lengthOfLonLat(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20unit\x20conversion:\x20meters\x20->\x20longitude\x20latitude\x20degrees\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Geographic_coordinate_system#Length_of_a_degree\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20the\x20length\x20of\x20a\x20degree\x20of\x20latitude\x20and\x20longitude\x20in\x20meters\x0a\x20\x20\x20\x20float\x20latitude\x20=\x20radians(lonLatLev.y);\x0a\x0a\x20\x20\x20\x20float\x20term1\x20=\x20111132.92;\x0a\x20\x20\x20\x20float\x20term2\x20=\x20559.82\x20*\x20cos(2.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term3\x20=\x201.175\x20*\x20cos(4.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term4\x20=\x200.0023\x20*\x20cos(6.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20latLength\x20=\x20term1\x20-\x20term2\x20+\x20term3\x20-\x20term4;\x0a\x0a\x20\x20\x20\x20float\x20term5\x20=\x20111412.84\x20*\x20cos(latitude);\x0a\x20\x20\x20\x20float\x20term6\x20=\x2093.5\x20*\x20cos(3.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term7\x20=\x200.118\x20*\x20cos(5.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20longLength\x20=\x20term5\x20-\x20term6\x20+\x20term7;\x0a\x0a\x20\x20\x20\x20return\x20vec2(longLength,\x20latLength);\x0a}\x0a\x0avoid\x20updatePosition(vec3\x20lonLatLev,\x20vec3\x20speed)\x20{\x0a\x20\x20\x20\x20vec2\x20lonLatLength\x20=\x20lengthOfLonLat(lonLatLev);\x0a\x20\x20\x20\x20float\x20u\x20=\x20speed.x\x20/\x20lonLatLength.x;\x0a\x20\x20\x20\x20float\x20v\x20=\x20speed.y\x20/\x20lonLatLength.y;\x0a\x20\x20\x20\x20float\x20w\x20=\x200.0;\x0a\x20\x20\x20\x20vec3\x20windVectorInLonLatLev\x20=\x20vec3(u,\x20v,\x20w);\x0a\x0a\x20\x20\x20\x20vec3\x20nextParticle\x20=\x20lonLatLev\x20+\x20windVectorInLonLatLev;\x0a\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(nextParticle,\x200.0);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20vec3\x20lonLatLev\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20speed\x20=\x20texture(currentParticlesSpeed,\x20v_textureCoordinates).rgb;\x0a\x0a\x20\x20\x20\x20updatePosition(lonLatLev,\x20speed);\x0a}\x0a',postProcessingPosition_frag='uniform\x20sampler2D\x20nextParticlesPosition;\x0auniform\x20sampler2D\x20nextParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0a\x0a//\x20range\x20(min,\x20max)\x0auniform\x20vec2\x20lonRange;\x0auniform\x20vec2\x20latRange;\x0a\x0auniform\x20float\x20randomCoefficient;\x20//\x20use\x20to\x20improve\x20the\x20pseudo-random\x20generator\x0auniform\x20float\x20dropRate;\x20//\x20drop\x20rate\x20is\x20a\x20chance\x20a\x20particle\x20will\x20restart\x20at\x20random\x20position\x20to\x20avoid\x20degeneration\x0auniform\x20float\x20dropRateBump;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0a//\x20pseudo-random\x20generator\x0aconst\x20vec3\x20randomConstants\x20=\x20vec3(12.9898,\x2078.233,\x204375.85453);\x0aconst\x20vec2\x20normalRange\x20=\x20vec2(0.0,\x201.0);\x0afloat\x20rand(vec2\x20seed,\x20vec2\x20range)\x20{\x0a\x20\x20\x20\x20vec2\x20randomSeed\x20=\x20randomCoefficient\x20*\x20seed;\x0a\x20\x20\x20\x20float\x20temp\x20=\x20dot(randomConstants.xy,\x20randomSeed);\x0a\x20\x20\x20\x20temp\x20=\x20fract(sin(temp)\x20*\x20(randomConstants.z\x20+\x20temp));\x0a\x20\x20\x20\x20return\x20temp\x20*\x20(range.y\x20-\x20range.x)\x20+\x20range.x;\x0a}\x0a\x0avec3\x20generateRandomParticle(vec2\x20seed,\x20float\x20lev)\x20{\x0a\x20\x20\x20\x20//\x20ensure\x20the\x20longitude\x20is\x20in\x20[0,\x20360]\x0a\x20\x20\x20\x20float\x20randomLon\x20=\x20mod(rand(seed,\x20lonRange),\x20360.0);\x0a\x20\x20\x20\x20float\x20randomLat\x20=\x20rand(-seed,\x20latRange);\x0a\x0a\x20\x20\x20\x20return\x20vec3(randomLon,\x20randomLat,\x20lev);\x0a}\x0a\x0abool\x20particleOutbound(vec3\x20particle)\x20{\x0a\x20\x20\x20\x20return\x20particle.y\x20<\x20-90.0\x20||\x20particle.y\x20>\x2090.0;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec3\x20nextParticle\x20=\x20texture(nextParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec4\x20nextSpeed\x20=\x20texture(nextParticlesSpeed,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20float\x20particleDropRate\x20=\x20dropRate\x20+\x20dropRateBump\x20*\x20nextSpeed.a;\x0a\x0a\x20\x20\x20\x20vec2\x20seed1\x20=\x20nextParticle.xy\x20+\x20v_textureCoordinates;\x0a\x20\x20\x20\x20vec2\x20seed2\x20=\x20nextSpeed.xy\x20+\x20v_textureCoordinates;\x0a\x20\x20\x20\x20vec3\x20randomParticle\x20=\x20generateRandomParticle(seed1,\x20nextParticle.z);\x0a\x20\x20\x20\x20float\x20randomNumber\x20=\x20rand(seed2,\x20normalRange);\x0a\x0a\x20\x20\x20\x20if\x20(randomNumber\x20<\x20particleDropRate\x20||\x20particleOutbound(nextParticle))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(randomParticle,\x201.0);\x20//\x201.0\x20means\x20this\x20is\x20a\x20random\x20particle\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(nextParticle,\x200.0);\x0a\x20\x20\x20\x20}\x0a}\x0a',postProcessingSpeed_frag=_0x5be5a1(0xe0);const Cesium$3=mars3d__namespace[_0x5be5a1(0x122)];class ParticlesComputing{constructor(_0x33bf35,_0xa790be,_0x435531,_0x8702b){this['data']=_0xa790be,this['createWindTextures'](_0x33bf35,_0xa790be),this['createParticlesTextures'](_0x33bf35,_0x435531,_0x8702b),this['createComputingPrimitives'](_0xa790be,_0x435531,_0x8702b);}['createWindTextures'](_0x28073c,_0x53d2fd){const _0x3a79a5=_0x5be5a1,_0x22303b={'context':_0x28073c,'width':_0x53d2fd['dimensions']['lon'],'height':_0x53d2fd[_0x3a79a5(0x14b)][_0x3a79a5(0x137)]*(_0x53d2fd['dimensions']['lev']||0x1),'pixelFormat':Cesium$3[_0x3a79a5(0x110)]['LUMINANCE'],'pixelDatatype':Cesium$3['PixelDatatype'][_0x3a79a5(0xfa)],'flipY':![],'sampler':new Cesium$3['Sampler']({'minificationFilter':Cesium$3[_0x3a79a5(0x15c)]['NEAREST'],'magnificationFilter':Cesium$3[_0x3a79a5(0x18c)]['NEAREST']})};this[_0x3a79a5(0x184)]={'U':Util[_0x3a79a5(0x19d)](_0x22303b,_0x53d2fd['U']['array']),'V':Util['createTexture'](_0x22303b,_0x53d2fd['V']['array'])};}['createParticlesTextures'](_0x8c84e1,_0x23a822,_0x2869a1){const _0x5ecaea=_0x5be5a1,_0x59f6e4={'context':_0x8c84e1,'width':_0x23a822['particlesTextureSize'],'height':_0x23a822['particlesTextureSize'],'pixelFormat':Cesium$3['PixelFormat'][_0x5ecaea(0xaf)],'pixelDatatype':Cesium$3['PixelDatatype']['FLOAT'],'flipY':![],'sampler':new Cesium$3['Sampler']({'minificationFilter':Cesium$3[_0x5ecaea(0x15c)]['NEAREST'],'magnificationFilter':Cesium$3['TextureMagnificationFilter']['NEAREST']})},_0x13b87a=this['randomizeParticles'](_0x23a822['maxParticles'],_0x2869a1),_0x3a84fa=new Float32Array(0x4*_0x23a822['maxParticles'])['fill'](0x0);this['particlesTextures']={'particlesWind':Util['createTexture'](_0x59f6e4),'currentParticlesPosition':Util['createTexture'](_0x59f6e4,_0x13b87a),'nextParticlesPosition':Util[_0x5ecaea(0x19d)](_0x59f6e4,_0x13b87a),'currentParticlesSpeed':Util['createTexture'](_0x59f6e4,_0x3a84fa),'nextParticlesSpeed':Util['createTexture'](_0x59f6e4,_0x3a84fa),'postProcessingPosition':Util['createTexture'](_0x59f6e4,_0x13b87a),'postProcessingSpeed':Util[_0x5ecaea(0x19d)](_0x59f6e4,_0x3a84fa)};}['randomizeParticles'](_0x3d1d15,_0x31568b){const _0x7f92ec=_0x5be5a1,_0x3d36ff=new Float32Array(0x4*_0x3d1d15);for(let _0x2a5822=0x0;_0x2a5822<_0x3d1d15;_0x2a5822++){_0x3d36ff[0x4*_0x2a5822]=Cesium$3[_0x7f92ec(0x17e)]['randomBetween'](_0x31568b[_0x7f92ec(0x148)]['x'],_0x31568b[_0x7f92ec(0x148)]['y']),_0x3d36ff[0x4*_0x2a5822+0x1]=Cesium$3['Math'][_0x7f92ec(0x153)](_0x31568b['latRange']['x'],_0x31568b['latRange']['y']),_0x3d36ff[0x4*_0x2a5822+0x2]=Cesium$3['Math']['randomBetween'](this['data']['lev']['min'],this[_0x7f92ec(0x13d)][_0x7f92ec(0x143)]['max']),_0x3d36ff[0x4*_0x2a5822+0x3]=0x0;}return _0x3d36ff;}['destroyParticlesTextures'](){const _0x1593e8=_0x5be5a1;Object['keys'](this[_0x1593e8(0x10d)])['forEach'](_0x43f57e=>{this['particlesTextures'][_0x43f57e]['destroy']();});}['createComputingPrimitives'](_0x592e57,_0xa47db2,_0x37a3a2){const _0x1676ce=_0x5be5a1,_0x1f9a9c=new Cesium$3[(_0x1676ce(0xb8))](_0x592e57['dimensions'][_0x1676ce(0x175)],_0x592e57['dimensions']['lat'],_0x592e57[_0x1676ce(0x14b)]['lev']),_0x90d3d7=new Cesium$3[(_0x1676ce(0xb8))](_0x592e57[_0x1676ce(0x175)]['min'],_0x592e57['lat'][_0x1676ce(0x186)],_0x592e57[_0x1676ce(0x143)]['min']),_0x5745a4=new Cesium$3['Cartesian3'](_0x592e57[_0x1676ce(0x175)][_0x1676ce(0x151)],_0x592e57[_0x1676ce(0x137)]['max'],_0x592e57['lev']['max']),_0x3ef678=new Cesium$3[(_0x1676ce(0xb8))]((_0x5745a4['x']-_0x90d3d7['x'])/(_0x1f9a9c['x']-0x1),(_0x5745a4['y']-_0x90d3d7['y'])/(_0x1f9a9c['y']-0x1),_0x1f9a9c['z']>0x1?(_0x5745a4['z']-_0x90d3d7['z'])/(_0x1f9a9c['z']-0x1):0x1),_0x1f371f=new Cesium$3['Cartesian2'](_0x592e57['U'][_0x1676ce(0x186)],_0x592e57['U']['max']),_0x16a195=new Cesium$3['Cartesian2'](_0x592e57['V']['min'],_0x592e57['V']['max']),_0x46b733=this;this['primitives']={'getWind':new CustomPrimitive({'commandType':'Compute','uniformMap':{'U':function(){const _0x42688e=_0x1676ce;return _0x46b733[_0x42688e(0x184)]['U'];},'V':function(){return _0x46b733['windTextures']['V'];},'currentParticlesPosition':function(){const _0x444287=_0x1676ce;return _0x46b733['particlesTextures'][_0x444287(0x181)];},'dimension':function(){return _0x1f9a9c;},'minimum':function(){return _0x90d3d7;},'maximum':function(){return _0x5745a4;},'interval':function(){return _0x3ef678;}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[getWind_frag]}),'outputTexture':this[_0x1676ce(0x10d)]['particlesWind'],'preExecute':function(){const _0x5b5354=_0x1676ce;_0x46b733[_0x5b5354(0x12a)]['getWind']['commandToExecute']['outputTexture']=_0x46b733[_0x5b5354(0x10d)]['particlesWind'];}}),'updateSpeed':new CustomPrimitive({'commandType':'Compute','uniformMap':{'currentParticlesSpeed':function(){return _0x46b733['particlesTextures']['currentParticlesSpeed'];},'particlesWind':function(){const _0x997397=_0x1676ce;return _0x46b733[_0x997397(0x10d)]['particlesWind'];},'uSpeedRange':function(){return _0x1f371f;},'vSpeedRange':function(){return _0x16a195;},'pixelSize':function(){return _0x37a3a2['pixelSize'];},'speedFactor':function(){return _0xa47db2['speedFactor'];}},'fragmentShaderSource':new Cesium$3[(_0x1676ce(0xec))]({'sources':[updateSpeed_frag]}),'outputTexture':this['particlesTextures']['nextParticlesSpeed'],'preExecute':function(){const _0x3adb2c=_0x1676ce,_0x185c5b=_0x46b733['particlesTextures']['currentParticlesSpeed'];_0x46b733['particlesTextures']['currentParticlesSpeed']=_0x46b733['particlesTextures']['postProcessingSpeed'],_0x46b733['particlesTextures']['postProcessingSpeed']=_0x185c5b,_0x46b733['primitives']['updateSpeed']['commandToExecute']['outputTexture']=_0x46b733[_0x3adb2c(0x10d)]['nextParticlesSpeed'];}}),'updatePosition':new CustomPrimitive({'commandType':'Compute','uniformMap':{'currentParticlesPosition':function(){const _0x5c0487=_0x1676ce;return _0x46b733['particlesTextures'][_0x5c0487(0x181)];},'currentParticlesSpeed':function(){return _0x46b733['particlesTextures']['currentParticlesSpeed'];}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[updatePosition_frag]}),'outputTexture':this['particlesTextures']['nextParticlesPosition'],'preExecute':function(){const _0x2f1be8=_0x1676ce,_0x5a55fb=_0x46b733['particlesTextures']['currentParticlesPosition'];_0x46b733['particlesTextures'][_0x2f1be8(0x181)]=_0x46b733['particlesTextures']['postProcessingPosition'],_0x46b733['particlesTextures']['postProcessingPosition']=_0x5a55fb,_0x46b733['primitives'][_0x2f1be8(0x17c)]['commandToExecute']['outputTexture']=_0x46b733[_0x2f1be8(0x10d)]['nextParticlesPosition'];}}),'postProcessingPosition':new CustomPrimitive({'commandType':'Compute','uniformMap':{'nextParticlesPosition':function(){return _0x46b733['particlesTextures']['nextParticlesPosition'];},'nextParticlesSpeed':function(){return _0x46b733['particlesTextures']['nextParticlesSpeed'];},'lonRange':function(){return _0x37a3a2['lonRange'];},'latRange':function(){return _0x37a3a2['latRange'];},'randomCoefficient':function(){const _0x46c050=_0x1676ce,_0x2f7dba=Math[_0x46c050(0xd1)]();return _0x2f7dba;},'dropRate':function(){const _0x5950d9=_0x1676ce;return _0xa47db2[_0x5950d9(0xe3)];},'dropRateBump':function(){return _0xa47db2['dropRateBump'];}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[postProcessingPosition_frag]}),'outputTexture':this['particlesTextures']['postProcessingPosition'],'preExecute':function(){const _0xf3ca08=_0x1676ce;_0x46b733[_0xf3ca08(0x12a)][_0xf3ca08(0xb5)]['commandToExecute']['outputTexture']=_0x46b733['particlesTextures'][_0xf3ca08(0xb5)];}}),'postProcessingSpeed':new CustomPrimitive({'commandType':_0x1676ce(0x146),'uniformMap':{'postProcessingPosition':function(){return _0x46b733['particlesTextures']['postProcessingPosition'];},'nextParticlesSpeed':function(){const _0x5ecbb0=_0x1676ce;return _0x46b733['particlesTextures'][_0x5ecbb0(0x18e)];}},'fragmentShaderSource':new Cesium$3[(_0x1676ce(0xec))]({'sources':[postProcessingSpeed_frag]}),'outputTexture':this['particlesTextures']['postProcessingSpeed'],'preExecute':function(){const _0x1a5498=_0x1676ce;_0x46b733['primitives'][_0x1a5498(0x134)]['commandToExecute']['outputTexture']=_0x46b733[_0x1a5498(0x10d)][_0x1a5498(0x134)];}})};}}const Cesium$2=mars3d__namespace['Cesium'];class ParticleSystem{constructor(_0x189835,_0x5d56a5,_0x4fb856,_0x2caa97){const _0x5e2f72=_0x5be5a1;this[_0x5e2f72(0x123)]=_0x189835,_0x5d56a5={..._0x5d56a5},_0x5d56a5['udata']&&_0x5d56a5['vdata']&&(_0x5d56a5['dimensions']={},_0x5d56a5['dimensions']['lon']=_0x5d56a5[_0x5e2f72(0x129)],_0x5d56a5[_0x5e2f72(0x14b)]['lat']=_0x5d56a5['rows'],_0x5d56a5['dimensions']['lev']=_0x5d56a5[_0x5e2f72(0x143)]||0x1,_0x5d56a5['lon']={},_0x5d56a5['lon']['min']=_0x5d56a5[_0x5e2f72(0xbd)],_0x5d56a5['lon']['max']=_0x5d56a5['xmax'],_0x5d56a5[_0x5e2f72(0x137)]={},_0x5d56a5['lat']['min']=_0x5d56a5['ymin'],_0x5d56a5['lat'][_0x5e2f72(0x151)]=_0x5d56a5['ymax'],_0x5d56a5['lev']={},_0x5d56a5[_0x5e2f72(0x143)]['min']=_0x5d56a5[_0x5e2f72(0x165)]??0x1,_0x5d56a5['lev']['max']=_0x5d56a5[_0x5e2f72(0xc4)]??0x1,_0x5d56a5['U']={},_0x5d56a5['U'][_0x5e2f72(0xa8)]=new Float32Array(_0x5d56a5[_0x5e2f72(0x152)]),_0x5d56a5['U'][_0x5e2f72(0x186)]=_0x5d56a5[_0x5e2f72(0x121)]??Math['min'](..._0x5d56a5['udata']),_0x5d56a5['U']['max']=_0x5d56a5['umax']??Math['max'](..._0x5d56a5['udata']),_0x5d56a5['V']={},_0x5d56a5['V'][_0x5e2f72(0xa8)]=new Float32Array(_0x5d56a5['vdata']),_0x5d56a5['V'][_0x5e2f72(0x186)]=_0x5d56a5[_0x5e2f72(0x18a)]??Math['min'](..._0x5d56a5[_0x5e2f72(0x185)]),_0x5d56a5['V']['max']=_0x5d56a5['vmax']??Math[_0x5e2f72(0x151)](..._0x5d56a5[_0x5e2f72(0x185)])),this['data']=_0x5d56a5,this['options']=_0x4fb856,this['viewerParameters']=_0x2caa97,this['particlesComputing']=new ParticlesComputing(this['context'],this['data'],this[_0x5e2f72(0x170)],this['viewerParameters']),this['particlesRendering']=new ParticlesRendering(this['context'],this['data'],this[_0x5e2f72(0x170)],this[_0x5e2f72(0x13f)],this['particlesComputing']);}['canvasResize'](_0x234eaa){const _0x486220=_0x5be5a1;this[_0x486220(0x14e)]['destroyParticlesTextures'](),Object['keys'](this[_0x486220(0x14e)]['windTextures'])['forEach'](_0x571533=>{this['particlesComputing']['windTextures'][_0x571533]['destroy']();}),this['particlesRendering']['textures']['colorTable'][_0x486220(0xba)](),Object['keys'](this['particlesRendering']['framebuffers'])['forEach'](_0x1cad85=>{this['particlesRendering']['framebuffers'][_0x1cad85]['destroy']();}),this['context']=_0x234eaa,this[_0x486220(0x14e)]=new ParticlesComputing(this[_0x486220(0x123)],this[_0x486220(0x13d)],this[_0x486220(0x170)],this['viewerParameters']),this[_0x486220(0x15d)]=new ParticlesRendering(this['context'],this['data'],this['options'],this['viewerParameters'],this['particlesComputing']);}[_0x5be5a1(0xe6)](){const _0x32dc6d=_0x5be5a1,_0x168560=new Cesium$2['ClearCommand']({'color':new Cesium$2['Color'](0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':undefined,'pass':Cesium$2[_0x32dc6d(0x117)][_0x32dc6d(0x113)]});Object['keys'](this[_0x32dc6d(0x15d)]['framebuffers'])['forEach'](_0x20e70a=>{_0x168560['framebuffer']=this['particlesRendering']['framebuffers'][_0x20e70a],_0x168560['execute'](this['context']);});}[_0x5be5a1(0x17b)](_0x4cc537){const _0x20cf6a=_0x5be5a1;this[_0x20cf6a(0xe6)](),this['particlesComputing']['destroyParticlesTextures'](),this['particlesComputing']['createParticlesTextures'](this[_0x20cf6a(0x123)],this['options'],this[_0x20cf6a(0x13f)]);if(_0x4cc537){const _0x50beb0=this['particlesRendering']['createSegmentsGeometry'](this['options']);this['particlesRendering'][_0x20cf6a(0x12a)]['segments'][_0x20cf6a(0x149)]=_0x50beb0;const _0x34f5b3=Cesium$2['VertexArray']['fromGeometry']({'context':this[_0x20cf6a(0x123)],'geometry':_0x50beb0,'attributeLocations':this['particlesRendering']['primitives']['segments']['attributeLocations'],'bufferUsage':Cesium$2['BufferUsage'][_0x20cf6a(0x15b)]});this['particlesRendering']['primitives']['segments']['commandToExecute']['vertexArray']=_0x34f5b3;}}[_0x5be5a1(0xfc)](_0x9f9e71){const _0x3134ba=_0x5be5a1;let _0x4d6690=![];this[_0x3134ba(0x170)]['maxParticles']!==_0x9f9e71['maxParticles']&&(_0x4d6690=!![]),Object['keys'](_0x9f9e71)[_0x3134ba(0xab)](_0x1ca576=>{this['options'][_0x1ca576]=_0x9f9e71[_0x1ca576];}),this[_0x3134ba(0x17b)](_0x4d6690);}['applyViewerParameters'](_0x362d21){const _0x348af2=_0x5be5a1;Object[_0x348af2(0xfb)](_0x362d21)['forEach'](_0x1ad15e=>{this['viewerParameters'][_0x1ad15e]=_0x362d21[_0x1ad15e];}),this['refreshParticles'](![]);}[_0x5be5a1(0xba)](){const _0x16fe41=_0x5be5a1;clearTimeout(this[_0x16fe41(0x10c)]),this[_0x16fe41(0x14e)][_0x16fe41(0xf5)](),Object[_0x16fe41(0xfb)](this['particlesComputing'][_0x16fe41(0x184)])['forEach'](_0x341d06=>{const _0x5d2e8f=_0x16fe41;this['particlesComputing']['windTextures'][_0x341d06][_0x5d2e8f(0xba)]();}),this['particlesRendering'][_0x16fe41(0xe2)]['colorTable']['destroy'](),Object[_0x16fe41(0xfb)](this['particlesRendering']['framebuffers'])[_0x16fe41(0xab)](_0x1483a7=>{this['particlesRendering']['framebuffers'][_0x1483a7]['destroy']();});for(const _0x38c630 in this){delete this[_0x38c630];}}}const Cesium$1=mars3d__namespace['Cesium'],BaseLayer$1=mars3d__namespace[_0x5be5a1(0x15e)][_0x5be5a1(0xc3)],DEF_OPTIONS={'particlesNumber':0x1000,'fixedHeight':0x0,'fadeOpacity':0.996,'dropRate':0.003,'dropRateBump':0.01,'speedFactor':0.5,'lineWidth':0x2,'colors':['rgb(206,255,255)']};function _0x3f55(_0x522572,_0x574180){const _0x50576e=_0x5057();return _0x3f55=function(_0x3f55b8,_0x5438e8){_0x3f55b8=_0x3f55b8-0xa5;let _0x171b63=_0x50576e[_0x3f55b8];return _0x171b63;},_0x3f55(_0x522572,_0x574180);}class WindLayer extends BaseLayer$1{constructor(_0x8ecbd7={}){const _0x4f27b6=_0x5be5a1;_0x8ecbd7={...DEF_OPTIONS,..._0x8ecbd7},super(_0x8ecbd7),this[_0x4f27b6(0x10e)](_0x8ecbd7);}get['layer'](){return this['primitives'];}get['data'](){return this['_data'];}set['data'](_0x2b84b3){const _0x59b116=_0x5be5a1;this[_0x59b116(0x101)](_0x2b84b3);}get['colors'](){return this['options']['colors'];}set['colors'](_0x1c9370){const _0x35125a=_0x5be5a1;this['options'][_0x35125a(0x169)]=_0x1c9370,this[_0x35125a(0x107)]&&this['particleSystem'][_0x35125a(0xfc)]({'colors':_0x1c9370}),this['resize']();}[_0x5be5a1(0x167)](){}['_addedHook'](){const _0x3bb198=_0x5be5a1;this['scene']=this['_map'][_0x3bb198(0xf1)],this[_0x3bb198(0xc8)]=this['_map']['camera'],this[_0x3bb198(0x12a)]=new Cesium$1['PrimitiveCollection'](),this['_map'][_0x3bb198(0xf1)]['primitives'][_0x3bb198(0x173)](this['primitives']),this['viewerParameters']={'lonRange':new Cesium$1[(_0x3bb198(0x183))](),'latRange':new Cesium$1['Cartesian2'](),'pixelSize':0x0},this['globeBoundingSphere']=new Cesium$1['BoundingSphere'](Cesium$1[_0x3bb198(0xb8)]['ZERO'],0.99*0x615299),this['updateViewerParameters'](),window['addEventListener']('resize',this['resize'][_0x3bb198(0xac)](this),![]),this[_0x3bb198(0x13b)]=![],this['mouse_move']=![],this['_map']['on'](mars3d__namespace['EventType']['wheel'],this['_onMapWhellEvent'],this),this[_0x3bb198(0xb3)]['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseUp'],this[_0x3bb198(0x106)],this),this[_0x3bb198(0xb3)]['on'](mars3d__namespace['EventType']['mouseMove'],this['_onMouseMoveEvent'],this),this['_data']&&this[_0x3bb198(0x101)](this[_0x3bb198(0x14a)]);}[_0x5be5a1(0x164)](){const _0x555e5a=_0x5be5a1;window['removeEventListener']('resize',this['resize']),this['_map']['off'](mars3d__namespace[_0x555e5a(0xc6)]['preRender'],this['_onMap_preRenderEvent'],this),this[_0x555e5a(0xb3)]['off'](mars3d__namespace['EventType']['wheel'],this[_0x555e5a(0xd2)],this),this['_map']['off'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this['_map'][_0x555e5a(0xda)](mars3d__namespace['EventType']['mouseUp'],this[_0x555e5a(0x106)],this),this['_map']['off'](mars3d__namespace['EventType']['mouseMove'],this['_onMouseMoveEvent'],this),this[_0x555e5a(0x12a)][_0x555e5a(0x197)](),this['_map']['scene']['primitives']['remove'](this['primitives']);}[_0x5be5a1(0xbc)](){const _0x2f690f=_0x5be5a1;if(!this['show']||!this['particleSystem'])return;this['primitives']['show']=![],this['primitives']['removeAll'](),this['_map']['once'](mars3d__namespace['EventType']['preRender'],this[_0x2f690f(0xe7)],this);}['_onMap_preRenderEvent'](_0x36ba92){const _0x41f364=_0x5be5a1;this[_0x41f364(0x107)]['canvasResize'](this['scene']['context']),this[_0x41f364(0x176)](),this['primitives']['show']=!![];}[_0x5be5a1(0xd2)](_0x5c9761){const _0x33ee57=_0x5be5a1;clearTimeout(this['refreshTimer']);if(!this['show']||!this['particleSystem'])return;this[_0x33ee57(0x12a)][_0x33ee57(0x182)]=![],this[_0x33ee57(0x19b)]=setTimeout(()=>{if(!this['show'])return;this['redraw']();},0xc8);}[_0x5be5a1(0x14c)](_0x53c306){const _0x24aabd=_0x5be5a1;this[_0x24aabd(0x13b)]=!![];}['_onMouseMoveEvent'](_0x211b84){const _0xc9e9e3=_0x5be5a1;if(!this['show']||!this['particleSystem'])return;this[_0xc9e9e3(0x13b)]&&(this['primitives']['show']=![],this[_0xc9e9e3(0x19a)]=!![]);}['_onMouseUpEvent'](_0x3df520){const _0x55008b=_0x5be5a1;if(!this['show']||!this['particleSystem'])return;this[_0x55008b(0x13b)]&&this[_0x55008b(0x19a)]&&this[_0x55008b(0xea)](),this['primitives']['show']=!![],this['mouse_down']=![],this['mouse_move']=![];}['redraw'](){const _0x38a838=_0x5be5a1;if(!this['_map']||!this['show'])return;this[_0x38a838(0xb6)](),this['particleSystem']['applyViewerParameters'](this[_0x38a838(0x13f)]),this[_0x38a838(0x12a)]['show']=!![];}['setData'](_0x36f0cf){const _0x21001f=_0x5be5a1;this['_data']=_0x36f0cf,this['particleSystem']&&this['particleSystem'][_0x21001f(0xba)](),this['particleSystem']=new ParticleSystem(this['scene'][_0x21001f(0x123)],_0x36f0cf,this[_0x21001f(0x192)](),this[_0x21001f(0x13f)]),this['addPrimitives']();}['_setOptionsHook'](_0x2a9e1a,_0x5d17b0){if(_0x2a9e1a)for(const _0x229133 in _0x2a9e1a){this[_0x229133]=_0x2a9e1a[_0x229133];}this['particleSystem']&&this['particleSystem']['setOptions'](this['getOptions']());}[_0x5be5a1(0x192)](){const _0x524258=_0x5be5a1,_0x3c0dd9=Math['ceil'](Math[_0x524258(0x13a)](this['particlesNumber']));return this[_0x524258(0xc7)]=_0x3c0dd9*_0x3c0dd9,{'particlesTextureSize':_0x3c0dd9,'maxParticles':this[_0x524258(0xc7)],'particleHeight':this[_0x524258(0x120)],'fadeOpacity':this['fadeOpacity'],'dropRate':this['dropRate'],'dropRateBump':this[_0x524258(0xa6)],'speedFactor':this['speedFactor'],'lineWidth':this['lineWidth'],'colors':this[_0x524258(0x169)]};}['addPrimitives'](){const _0x4d9490=_0x5be5a1;this['primitives']['add'](this['particleSystem'][_0x4d9490(0x14e)][_0x4d9490(0x12a)]['getWind']),this['primitives']['add'](this['particleSystem']['particlesComputing']['primitives'][_0x4d9490(0xf6)]),this['primitives']['add'](this['particleSystem']['particlesComputing'][_0x4d9490(0x12a)]['updatePosition']),this['primitives'][_0x4d9490(0x173)](this['particleSystem']['particlesComputing']['primitives'][_0x4d9490(0xb5)]),this['primitives'][_0x4d9490(0x173)](this[_0x4d9490(0x107)][_0x4d9490(0x14e)]['primitives'][_0x4d9490(0x134)]),this[_0x4d9490(0x12a)]['add'](this[_0x4d9490(0x107)]['particlesRendering']['primitives'][_0x4d9490(0xd0)]),this['primitives'][_0x4d9490(0x173)](this['particleSystem']['particlesRendering'][_0x4d9490(0x12a)][_0x4d9490(0x133)]),this[_0x4d9490(0x12a)][_0x4d9490(0x173)](this[_0x4d9490(0x107)][_0x4d9490(0x15d)]['primitives']['screen']);}['updateViewerParameters'](){const _0x24cda9=_0x5be5a1;let _0x4f8378=this['camera']['computeViewRectangle'](this['scene']['globe'][_0x24cda9(0x128)]);if(!_0x4f8378){const _0x44c7a1=this[_0x24cda9(0xb3)]['getExtent']();_0x4f8378=Cesium$1[_0x24cda9(0x16f)]['fromDegrees'](_0x44c7a1['xmin'],_0x44c7a1[_0x24cda9(0xcc)],_0x44c7a1['xmax'],_0x44c7a1['ymax']);}const _0x4fd130=Util['viewRectangleToLonLatRange'](_0x4f8378);this['viewerParameters']['lonRange']['x']=_0x4fd130['lon']['min'],this['viewerParameters']['lonRange']['y']=_0x4fd130['lon']['max'],this['viewerParameters']['latRange']['x']=_0x4fd130['lat'][_0x24cda9(0x186)],this['viewerParameters'][_0x24cda9(0x174)]['y']=_0x4fd130['lat']['max'];const _0x2f929a=this['camera']['getPixelSize'](this['globeBoundingSphere'],this['scene']['drawingBufferWidth'],this['scene']['drawingBufferHeight']);_0x2f929a>0x0&&(this['viewerParameters'][_0x24cda9(0x132)]=_0x2f929a);}}mars3d__namespace['LayerUtil']['register'](_0x5be5a1(0x171),WindLayer),mars3d__namespace['layer'][_0x5be5a1(0xcf)]=WindLayer;function _0x5057(){const _0x4d4c49=['Rectangle','options','wind','width','add','latRange','lon','addPrimitives','particleHeight','lng','lineWidth','depthTest','refreshParticles','updatePosition','DomUtil','Math','236818nooJJZ','grid','currentParticlesPosition','show','Cartesian2','windTextures','vdata','min','16cXLKSO','positionWC','42HSCTxk','vmin','clientHeight','TextureMagnificationFilter','_tomap','nextParticlesSpeed','_speedRate','segmentsDepth','setDate','getOptions','_canrefresh','toRadians','BufferUsage','maxAge','removeAll','pointerEvents','requestAnimationFrame','mouse_move','refreshTimer','particlesTextureSize','createTexture','rawRenderState','dropRateBump','length','array','style','mars3d-canvasWind','forEach','bind','_updateIng2','_updateIng','RGBA','3782352RdsxXm','_pointerEvents','round','_map','Draw','postProcessingPosition','updateViewerParameters','getContext','Cartesian3','pointer-events','destroy','PrimitiveType','resize','xmin','commandList','reverseY','fromCssColorString','worker','DISABLE_LOG_DEPTH_FRAGMENT_WRITE','BaseLayer','levmax','beginPath','EventType','particlesNumber','camera','1040140wEkySh','speedRate','canvas','ymin','framebuffer','clear','WindLayer','segments','random','_onMapWhellEvent','primitiveType','zIndex','Appearance','getUVByXY','setGeometry','autoClear','PixelDatatype','off','UNSIGNED_BYTE','mouseMove','RGB','0px','init','uniform\x20sampler2D\x20postProcessingPosition;\x0auniform\x20sampler2D\x20nextParticlesSpeed;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20randomParticle\x20=\x20texture(postProcessingPosition,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20vec4\x20particleSpeed\x20=\x20texture(nextParticlesSpeed,\x20v_textureCoordinates);\x0a\x0a\x20\x20\x20\x20if\x20(randomParticle.a\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20particleSpeed;\x0a\x20\x20\x20\x20}\x0a}\x0a','_drawLines','textures','dropRate','attributeLocations','CanvasWindField','clearFramebuffers','_onMap_preRenderEvent','uniform\x20sampler2D\x20segmentsColorTexture;\x0auniform\x20sampler2D\x20segmentsDepthTexture;\x0a\x0auniform\x20sampler2D\x20currentTrailsColor;\x0auniform\x20sampler2D\x20trailsDepthTexture;\x0a\x0auniform\x20float\x20fadeOpacity;\x0a\x0ain\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20pointsColor\x20=\x20texture(segmentsColorTexture,\x20textureCoordinate);\x0a\x20\x20\x20\x20vec4\x20trailsColor\x20=\x20texture(currentTrailsColor,\x20textureCoordinate);\x0a\x0a\x20\x20\x20\x20trailsColor\x20=\x20floor(fadeOpacity\x20*\x20255.0\x20*\x20trailsColor)\x20/\x20255.0;\x20//\x20make\x20sure\x20the\x20trailsColor\x20will\x20be\x20strictly\x20decreased\x0a\x0a\x20\x20\x20\x20float\x20pointsDepth\x20=\x20texture(segmentsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20trailsDepth\x20=\x20texture(trailsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20globeDepth\x20=\x20czm_unpackDepth(texture(czm_globeDepthTexture,\x20textureCoordinate));\x0a\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20if\x20(pointsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20out_FragColor\x20+\x20pointsColor;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(trailsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20out_FragColor\x20+\x20trailsColor;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20gl_FragDepth\x20=\x20min(pointsDepth,\x20trailsDepth);\x0a}\x0a','strokeStyle','redraw','wgs84ToWindowCoordinates','ShaderSource','createRenderingPrimitives','clearCommand','isInExtent','push','scene','color','unbindEvent','hidden','destroyParticlesTextures','updateSpeed','green','DepthFunction','__esModule','FLOAT','keys','setOptions','ymax','currentTrailsDepth','_calc_speedRate','uniform\x20sampler2D\x20colorTable;\x0a\x0ain\x20float\x20speedNormalization;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20texture(colorTable,\x20vec2(speedNormalization,\x200.0));\x0a}\x0a','setData','none','particles','ComponentDatatype','default','_onMouseUpEvent','particleSystem','defineProperty','cancelAnimationFrame','framebuffers','lighter','canrefresh','particlesTextures','_setOptionsHook','18246250rrgXDQ','PixelFormat','rows','postMessage','OPAQUE','pow','toDegrees','Geometry','Pass','frameRate','_createCanvas','vertexArray','_onMouseMoveEvent','uniformMap','clientWidth','4KVqzxA','globalAlpha','fixedHeight','umin','Cesium','context','canvasContext','getFullscreenQuad','getUVByPoint','viewport','ellipsoid','cols','primitives','8035134pzAbFK','SCENE3D','_bilinearInterpolation','5309973kIUPPd','tlat','getParticles','windField','pixelSize','trails','postProcessingSpeed','commandType','41045qcRKJM','lat','fromGeometry','currentTrails','sqrt','mouse_down','createRawRenderState','data','tlng','viewerParameters','maxParticles','xmax','globalCompositeOperation','lev','now','east','Compute','commandToExecute','lonRange','geometry','_data','dimensions','_onMouseDownEvent','outputTexture','particlesComputing','height','TWO_PI','max','udata','randomBetween','wheel','fragmentShaderSource','getColorTexture','visible','nextTrails','TRIANGLES','IDENTITY','STATIC_DRAW','TextureMinificationFilter','particlesRendering','layer','fromCache','GeometryAttributes','visibility','age','initWorker','_removedHook','levmin','WindUtil','_mountedHook','SceneMode','colors','_maxAge','windData','defined','canvasHeight','drawingBufferHeight'];_0x5057=function(){return _0x4d4c49;};return _0x5057();}class CanvasParticle{constructor(){const _0x1d8536=_0x5be5a1;this['lng']=null,this['lat']=null,this['tlng']=null,this[_0x1d8536(0x12f)]=null,this['age']=null;}[_0x5be5a1(0xba)](){for(const _0x3abd29 in this){delete this[_0x3abd29];}}}class CanvasWindField{constructor(_0x4debf2){this['setOptions'](_0x4debf2);}get['speedRate'](){return this['_speedRate'];}set['speedRate'](_0x12768a){const _0x1ea608=_0x5be5a1;this['_speedRate']=(0x64-(_0x12768a>0x63?0x63:_0x12768a))*0x64,this[_0x1ea608(0xff)]=[(this[_0x1ea608(0x141)]-this[_0x1ea608(0xbd)])/this[_0x1ea608(0x18f)],(this['ymax']-this[_0x1ea608(0xcc)])/this['_speedRate']];}get['maxAge'](){return this['_maxAge'];}set['maxAge'](_0x29f9cf){const _0x1e023b=_0x5be5a1;this[_0x1e023b(0x16a)]=_0x29f9cf;}[_0x5be5a1(0xfc)](_0x2649c8){const _0x20a240=_0x5be5a1;this['options']=_0x2649c8,this[_0x20a240(0x196)]=_0x2649c8[_0x20a240(0x196)]||0x78,this[_0x20a240(0xca)]=_0x2649c8['speedRate']||0x32,this['particles']=[];const _0x352326=_0x2649c8[_0x20a240(0xc7)]||0x1000;for(let _0x32276a=0x0;_0x32276a<_0x352326;_0x32276a++){const _0x4471e1=this['_randomParticle'](new CanvasParticle());this['particles']['push'](_0x4471e1);}}['setDate'](_0x5152b9){const _0x3089bb=_0x5be5a1;this[_0x3089bb(0x111)]=_0x5152b9['rows'],this[_0x3089bb(0x129)]=_0x5152b9['cols'],this['xmin']=_0x5152b9['xmin'],this[_0x3089bb(0x141)]=_0x5152b9['xmax'],this[_0x3089bb(0xcc)]=_0x5152b9['ymin'],this['ymax']=_0x5152b9[_0x3089bb(0xfd)],this['grid']=[];const _0x2152cc=_0x5152b9['udata'],_0x2cbf8d=_0x5152b9['vdata'];let _0x2df60d=![];_0x2152cc[_0x3089bb(0xa7)]===this[_0x3089bb(0x111)]&&_0x2152cc[0x0][_0x3089bb(0xa7)]===this['cols']&&(_0x2df60d=!![]);let _0xaee819=0x0,_0x597b15=null,_0x40bab0=null;for(let _0x33bb9c=0x0;_0x33bb9c=this['cols']||_0x2eb6c9>=this['rows'])return[0x0,0x0,0x0];const _0x20cdf8=Math['floor'](_0x4dbfbc),_0x243716=Math['floor'](_0x2eb6c9);if(_0x20cdf8===_0x4dbfbc&&_0x243716===_0x2eb6c9)return this[_0x1bbc8e(0x180)][_0x2eb6c9][_0x4dbfbc];const _0x2fe5fe=_0x20cdf8+0x1,_0x1785a7=_0x243716+0x1,_0x58afe9=this['getUVByXY'](_0x20cdf8,_0x243716),_0x1b9784=this['getUVByXY'](_0x2fe5fe,_0x243716),_0x45c655=this[_0x1bbc8e(0xd6)](_0x20cdf8,_0x1785a7),_0x328de1=this[_0x1bbc8e(0xd6)](_0x2fe5fe,_0x1785a7);let _0x4b3abf=null;try{_0x4b3abf=this['_bilinearInterpolation'](_0x4dbfbc-_0x20cdf8,_0x2eb6c9-_0x243716,_0x58afe9,_0x1b9784,_0x45c655,_0x328de1);}catch(_0x3c0b09){console['log'](_0x4dbfbc,_0x2eb6c9);}return _0x4b3abf;}[_0x5be5a1(0x12d)](_0x51ad76,_0x33169f,_0xdb8b1a,_0x2f2710,_0x358978,_0x334feb){const _0x68bf1d=0x1-_0x51ad76,_0x5a2790=0x1-_0x33169f,_0x1667a2=_0x68bf1d*_0x5a2790,_0x3d2a35=_0x51ad76*_0x5a2790,_0x299e31=_0x68bf1d*_0x33169f,_0xb2494a=_0x51ad76*_0x33169f,_0x1cacb4=_0xdb8b1a[0x0]*_0x1667a2+_0x2f2710[0x0]*_0x3d2a35+_0x358978[0x0]*_0x299e31+_0x334feb[0x0]*_0xb2494a,_0x16bc0c=_0xdb8b1a[0x1]*_0x1667a2+_0x2f2710[0x1]*_0x3d2a35+_0x358978[0x1]*_0x299e31+_0x334feb[0x1]*_0xb2494a;return this['_calcUV'](_0x1cacb4,_0x16bc0c);}['_calcUV'](_0x2c882a,_0x255ea8){return[+_0x2c882a,+_0x255ea8,Math['sqrt'](_0x2c882a*_0x2c882a+_0x255ea8*_0x255ea8)];}[_0x5be5a1(0x126)](_0x3eda2f,_0x4fe837){if(!this['isInExtent'](_0x3eda2f,_0x4fe837))return null;const _0x154921=this['toGridXY'](_0x3eda2f,_0x4fe837),_0x10c39a=this['getUVByXY'](_0x154921[0x0],_0x154921[0x1]);return _0x10c39a;}[_0x5be5a1(0xef)](_0x5aedbc,_0x379efe){const _0x36245a=_0x5be5a1;return _0x5aedbc>=this[_0x36245a(0xbd)]&&_0x5aedbc<=this[_0x36245a(0x141)]&&_0x379efe>=this['ymin']&&_0x379efe<=this['ymax']?!![]:![];}['getRandomLatLng'](){const _0x39a240=fRandomByfloat(this['xmin'],this['xmax']),_0x3db0fa=fRandomByfloat(this['ymin'],this['ymax']);return{'lat':_0x3db0fa,'lng':_0x39a240};}['getParticles'](){const _0x37278b=_0x5be5a1;let _0xd66bd9,_0x543369,_0x2ffe63;for(let _0xf6cb39=0x0,_0x38a309=this['particles'][_0x37278b(0xa7)];_0xf6cb39<_0x38a309;_0xf6cb39++){let _0x5fee28=this[_0x37278b(0x103)][_0xf6cb39];_0x5fee28['age']<=0x0&&(_0x5fee28=this['_randomParticle'](_0x5fee28));if(_0x5fee28['age']>0x0){const _0x405551=_0x5fee28['tlng'],_0x575ae1=_0x5fee28['tlat'];_0x2ffe63=this[_0x37278b(0x126)](_0x405551,_0x575ae1),_0x2ffe63?(_0xd66bd9=_0x405551+this['_calc_speedRate'][0x0]*_0x2ffe63[0x0],_0x543369=_0x575ae1+this['_calc_speedRate'][0x1]*_0x2ffe63[0x1],_0x5fee28[_0x37278b(0x178)]=_0x405551,_0x5fee28['lat']=_0x575ae1,_0x5fee28['tlng']=_0xd66bd9,_0x5fee28['tlat']=_0x543369,_0x5fee28['age']--):_0x5fee28[_0x37278b(0x162)]=0x0;}}return this['particles'];}['_randomParticle'](_0xd1fc47){const _0x3ee112=_0x5be5a1;let _0x13c7e2,_0x2ca7f5;for(let _0x541773=0x0;_0x541773<0x1e;_0x541773++){_0x13c7e2=this['getRandomLatLng'](),_0x2ca7f5=this['getUVByPoint'](_0x13c7e2['lng'],_0x13c7e2['lat']);if(_0x2ca7f5&&_0x2ca7f5[0x2]>0x0)break;}if(!_0x2ca7f5)return _0xd1fc47;const _0x5561a4=_0x13c7e2['lng']+this['_calc_speedRate'][0x0]*_0x2ca7f5[0x0],_0x2f2287=_0x13c7e2['lat']+this[_0x3ee112(0xff)][0x1]*_0x2ca7f5[0x1];return _0xd1fc47['lng']=_0x13c7e2['lng'],_0xd1fc47[_0x3ee112(0x137)]=_0x13c7e2['lat'],_0xd1fc47['tlng']=_0x5561a4,_0xd1fc47['tlat']=_0x2f2287,_0xd1fc47['age']=Math[_0x3ee112(0xb2)](Math['random']()*this['maxAge']),_0xd1fc47;}['destroy'](){for(const _0x21c2a4 in this){delete this[_0x21c2a4];}}}function fRandomByfloat(_0x4c9c8c,_0x566a6c){const _0x122681=_0x5be5a1;return _0x4c9c8c+Math[_0x122681(0xd1)]()*(_0x566a6c-_0x4c9c8c);}const Cesium=mars3d__namespace[_0x5be5a1(0x122)],BaseLayer=mars3d__namespace[_0x5be5a1(0x15e)][_0x5be5a1(0xc3)];class CanvasWindLayer extends BaseLayer{constructor(_0x29c52f={}){const _0x491640=_0x5be5a1;super(_0x29c52f),this['_setOptionsHook'](_0x29c52f),this[_0x491640(0xcb)]=null;}['_setOptionsHook'](_0x3cfd0a,_0x52fb9d){const _0x2caa2b=_0x5be5a1;this['frameTime']=0x3e8/(_0x3cfd0a[_0x2caa2b(0x118)]||0xa),this[_0x2caa2b(0xb1)]=this['options']['pointerEvents']??![],this[_0x2caa2b(0xf2)]=_0x3cfd0a['color']||'#ffffff',this['lineWidth']=_0x3cfd0a['lineWidth']||0x1,this['fixedHeight']=_0x3cfd0a['fixedHeight']??0x0,this['reverseY']=_0x3cfd0a['reverseY']??![],this['windField']&&this['windField'][_0x2caa2b(0xfc)](_0x3cfd0a);}get['layer'](){const _0x53c5bf=_0x5be5a1;return this[_0x53c5bf(0xcb)];}get['canvasWidth'](){const _0x3e5e70=_0x5be5a1;return this['_map'][_0x3e5e70(0xf1)][_0x3e5e70(0xcb)]['clientWidth'];}get['canvasHeight'](){const _0x44c3c7=_0x5be5a1;return this[_0x44c3c7(0xb3)]['scene'][_0x44c3c7(0xcb)][_0x44c3c7(0x18b)];}get['pointerEvents'](){return this['_pointerEvents'];}set['pointerEvents'](_0x5ae7cf){const _0x29765f=_0x5be5a1;this['_pointerEvents']=_0x5ae7cf;if(!this['canvas'])return;_0x5ae7cf?this[_0x29765f(0xcb)][_0x29765f(0xa9)][_0x29765f(0xb9)]='all':this[_0x29765f(0xcb)]['style']['pointer-events']='none';}get['particlesNumber'](){return this['options']['particlesNumber'];}set[_0x5be5a1(0xc7)](_0x2f14cc){const _0xd14c9f=_0x5be5a1;this['options'][_0xd14c9f(0xc7)]=_0x2f14cc,clearTimeout(this[_0xd14c9f(0x193)]),this['_canrefresh']=setTimeout(()=>{this['redraw']();},0x1f4);}get[_0x5be5a1(0xca)](){const _0x5f2cbc=_0x5be5a1;return this[_0x5f2cbc(0x170)]['speedRate'];}set['speedRate'](_0x1cf1cf){this['options']['speedRate']=_0x1cf1cf,this['windField']&&(this['windField']['speedRate']=_0x1cf1cf);}get['maxAge'](){const _0x58638c=_0x5be5a1;return this['options'][_0x58638c(0x196)];}set[_0x5be5a1(0x196)](_0xe23cc1){this['options']['maxAge']=_0xe23cc1,this['windField']&&(this['windField']['maxAge']=_0xe23cc1);}get['data'](){return this['windData'];}set['data'](_0xc5769d){this['setData'](_0xc5769d);}['_showHook'](_0x57f4f9){const _0x557c9c=_0x5be5a1;_0x57f4f9?this['_addedHook']():(this['windData']&&(this['options'][_0x557c9c(0x13d)]=this[_0x557c9c(0x16b)]),this[_0x557c9c(0x164)]());}['_mountedHook'](){const _0x1aaab1=_0x5be5a1;this['options']['worker']?this['initWorker']():this['windField']=new CanvasWindField(this[_0x1aaab1(0x170)]);}['_addedHook'](){const _0x5f540f=_0x5be5a1;this['canvas']=this[_0x5f540f(0x119)](),this[_0x5f540f(0x124)]=this[_0x5f540f(0xcb)][_0x5f540f(0xb7)]('2d',{'willReadFrequently':!![]}),this['bindEvent'](),this[_0x5f540f(0x170)]['data']&&this[_0x5f540f(0x101)](this['options']['data']);}[_0x5be5a1(0x164)](){const _0x376e53=_0x5be5a1;this[_0x376e53(0xce)](),this[_0x376e53(0xf3)](),this[_0x376e53(0xcb)]&&(this['_map']['container']['removeChild'](this[_0x376e53(0xcb)]),delete this['canvas']);}['_createCanvas'](){const _0x2e263b=_0x5be5a1,_0x5a8644=mars3d__namespace[_0x2e263b(0x17d)]['create']('canvas',_0x2e263b(0xaa),this['_map']['container']);return _0x5a8644[_0x2e263b(0xa9)]['position']='absolute',_0x5a8644[_0x2e263b(0xa9)]['top']='0px',_0x5a8644['style']['left']=_0x2e263b(0xde),_0x5a8644[_0x2e263b(0xa9)]['width']=this[_0x2e263b(0xb3)]['scene']['canvas']['clientWidth']+'px',_0x5a8644['style'][_0x2e263b(0x14f)]=this['_map']['scene']['canvas']['clientHeight']+'px',_0x5a8644[_0x2e263b(0xa9)][_0x2e263b(0x198)]=this['_pointerEvents']?'auto':_0x2e263b(0x102),_0x5a8644[_0x2e263b(0xa9)][_0x2e263b(0xd4)]=this['options']['zIndex']??0x9,_0x5a8644[_0x2e263b(0x172)]=this['_map']['scene']['canvas']['clientWidth'],_0x5a8644['height']=this[_0x2e263b(0xb3)]['scene']['canvas']['clientHeight'],_0x5a8644;}['resize'](){const _0x364191=_0x5be5a1;this['canvas']&&(this['canvas']['style'][_0x364191(0x172)]=this['_map']['scene']['canvas'][_0x364191(0x11d)]+'px',this['canvas']['style'][_0x364191(0x14f)]=this['_map'][_0x364191(0xf1)]['canvas']['clientHeight']+'px',this[_0x364191(0xcb)]['width']=this['_map'][_0x364191(0xf1)]['canvas']['clientWidth'],this['canvas']['height']=this['_map']['scene']['canvas']['clientHeight']);}['bindEvent'](){const _0x2fbc6b=_0x5be5a1,_0x41cba0=this;let _0x4ae8b8=Date[_0x2fbc6b(0x144)]();(function _0x5e2c69(){const _0x4f695e=_0x2fbc6b;_0x41cba0['animateFrame']=window[_0x4f695e(0x199)](_0x5e2c69);if(_0x41cba0[_0x4f695e(0x182)]&&_0x41cba0['windField']){const _0x395ec1=Date['now'](),_0x3cb7c4=_0x395ec1-_0x4ae8b8;_0x3cb7c4>_0x41cba0['frameTime']&&(_0x4ae8b8=_0x395ec1-_0x3cb7c4%_0x41cba0['frameTime'],_0x41cba0['update']());}}(),window['addEventListener']('resize',this['resize']['bind'](this),![]),this['mouse_down']=![],this[_0x2fbc6b(0x19a)]=![],this['options']['mouseHidden']&&(this['_map']['on'](mars3d__namespace['EventType'][_0x2fbc6b(0x154)],this['_onMapWhellEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this[_0x2fbc6b(0x14c)],this),this[_0x2fbc6b(0xb3)]['on'](mars3d__namespace['EventType']['mouseUp'],this[_0x2fbc6b(0x106)],this)));}['unbindEvent'](){const _0x35525c=_0x5be5a1;window[_0x35525c(0x109)](this['animateFrame']),delete this['animateFrame'],window['removeEventListener']('resize',this['resize']),this[_0x35525c(0x170)]['mouseHidden']&&(this[_0x35525c(0xb3)]['off'](mars3d__namespace['EventType'][_0x35525c(0x154)],this['_onMapWhellEvent'],this),this['_map']['off'](mars3d__namespace[_0x35525c(0xc6)]['mouseDown'],this['_onMouseDownEvent'],this),this['_map'][_0x35525c(0xda)](mars3d__namespace['EventType']['mouseUp'],this['_onMouseUpEvent'],this),this[_0x35525c(0xb3)]['off'](mars3d__namespace['EventType'][_0x35525c(0xdc)],this['_onMouseMoveEvent'],this));}['_onMapWhellEvent'](_0x235472){const _0x52891c=_0x5be5a1;clearTimeout(this['refreshTimer']);if(!this['show']||!this[_0x52891c(0xcb)])return;this['canvas']['style'][_0x52891c(0x161)]=_0x52891c(0xf4),this['refreshTimer']=setTimeout(()=>{const _0x2cfb73=_0x52891c;if(!this[_0x2cfb73(0x182)])return;this[_0x2cfb73(0xea)](),this['canvas']['style']['visibility']=_0x2cfb73(0x157);},0xc8);}['_onMouseDownEvent'](_0x478826){const _0x349217=_0x5be5a1;this[_0x349217(0x13b)]=!![],this['_map']['off'](mars3d__namespace['EventType'][_0x349217(0xdc)],this[_0x349217(0x11b)],this),this['_map']['on'](mars3d__namespace['EventType']['mouseMove'],this['_onMouseMoveEvent'],this);}['_onMouseMoveEvent'](_0x1e84ed){const _0x36791f=_0x5be5a1;if(!this['show']||!this['canvas'])return;this['mouse_down']&&(this['canvas'][_0x36791f(0xa9)]['visibility']='hidden',this[_0x36791f(0x19a)]=!![]);}[_0x5be5a1(0x106)](_0x2a0b99){const _0x2945f2=_0x5be5a1;if(!this[_0x2945f2(0x182)]||!this[_0x2945f2(0xcb)])return;this['_map']['off'](mars3d__namespace[_0x2945f2(0xc6)]['mouseMove'],this[_0x2945f2(0x11b)],this),this['mouse_down']&&this['mouse_move']&&this['redraw'](),this[_0x2945f2(0xcb)][_0x2945f2(0xa9)]['visibility']='visible',this[_0x2945f2(0x13b)]=![],this[_0x2945f2(0x19a)]=![];}['setData'](_0x542009){const _0x4ef2cf=_0x5be5a1;this['clear'](),this['windData']=_0x542009,this[_0x4ef2cf(0x131)]['setDate'](_0x542009),this['redraw']();}['redraw'](){if(!this['show'])return;this['windField']['setOptions'](this['options']),this['update']();}['update'](){const _0x19dd71=_0x5be5a1;if(this['_updateIng'])return;this['_updateIng']=!![];if(this['worker'])this[_0x19dd71(0x131)]['update']();else{const _0x58a4f4=this['windField'][_0x19dd71(0x130)]();this[_0x19dd71(0xe1)](_0x58a4f4);}this[_0x19dd71(0xae)]=![];}['_drawLines'](_0x178229){const _0x11c217=_0x5be5a1;this[_0x11c217(0x124)]['globalCompositeOperation']='destination-in',this['canvasContext']['fillRect'](0x0,0x0,this['canvasWidth'],this[_0x11c217(0x16d)]),this[_0x11c217(0x124)][_0x11c217(0x142)]=_0x11c217(0x10b),this[_0x11c217(0x124)][_0x11c217(0x11f)]=0.9,this[_0x11c217(0x124)][_0x11c217(0xc5)](),this['canvasContext']['lineWidth']=this[_0x11c217(0x179)],this['canvasContext'][_0x11c217(0xe9)]=this[_0x11c217(0xf2)];const _0x755394=this[_0x11c217(0xb3)]['scene']['mode']!==Cesium['SceneMode'][_0x11c217(0x12c)],_0x4c7be3=this['canvasWidth']*0.25;for(let _0x462cc5=0x0,_0x30504e=_0x178229[_0x11c217(0xa7)];_0x462cc5<_0x30504e;_0x462cc5++){const _0x2d4e3c=_0x178229[_0x462cc5],_0x512f8d=this[_0x11c217(0x18d)](_0x2d4e3c[_0x11c217(0x178)],_0x2d4e3c['lat'],_0x2d4e3c),_0x382054=this['_tomap'](_0x2d4e3c[_0x11c217(0x13e)],_0x2d4e3c['tlat'],_0x2d4e3c);if(!_0x512f8d||!_0x382054)continue;if(_0x755394&&Math['abs'](_0x512f8d[0x0]-_0x382054[0x0])>=_0x4c7be3)continue;this['canvasContext']['moveTo'](_0x512f8d[0x0],_0x512f8d[0x1]),this['canvasContext']['lineTo'](_0x382054[0x0],_0x382054[0x1]);}this[_0x11c217(0x124)]['stroke']();}[_0x5be5a1(0x18d)](_0x2d5a7a,_0x4c8ef4,_0x51a09f){const _0x2f6dee=_0x5be5a1,_0xc7d2e5=Cesium['Cartesian3']['fromDegrees'](_0x2d5a7a,_0x4c8ef4,this['fixedHeight']),_0x185c87=this['_map'][_0x2f6dee(0xf1)];if(_0x185c87['mode']===Cesium[_0x2f6dee(0x168)]['SCENE3D']){const _0x59228f=new Cesium['EllipsoidalOccluder'](_0x185c87['globe'][_0x2f6dee(0x128)],_0x185c87['camera'][_0x2f6dee(0x188)]),_0x4b74a1=_0x59228f['isPointVisible'](_0xc7d2e5);if(!_0x4b74a1)return _0x51a09f['age']=0x0,null;}const _0x1d9770=Cesium['SceneTransforms'][_0x2f6dee(0xeb)](this[_0x2f6dee(0xb3)][_0x2f6dee(0xf1)],_0xc7d2e5);return _0x1d9770?[_0x1d9770['x'],_0x1d9770['y']]:null;}['clear'](){const _0x4e365a=_0x5be5a1;this['windField'][_0x4e365a(0xce)](),delete this[_0x4e365a(0x16b)];}[_0x5be5a1(0x163)](){const _0x347a6f=_0x5be5a1;this['worker']=new Worker(this['options']['worker']),this['worker']['onmessage']=_0x3d07d6=>{const _0x96fb5c=_0x3f55;this['_drawLines'](_0x3d07d6['data'][_0x96fb5c(0x103)]),this[_0x96fb5c(0xad)]=![];},this['windField']={'init':_0x276ede=>{const _0x179db6=_0x3f55;this['worker'][_0x179db6(0x112)]({'type':_0x179db6(0xdf),'options':_0x276ede});},'setOptions':_0x2a7456=>{this['worker']['postMessage']({'type':'setOptions','options':_0x2a7456});},'setDate':_0xffede6=>{const _0x1a709b=_0x3f55;this['worker']['postMessage']({'type':_0x1a709b(0x191),'data':_0xffede6});},'update':()=>{const _0x43e483=_0x3f55;if(this['_updateIng2'])return;this[_0x43e483(0xad)]=!![],this['worker']['postMessage']({'type':'update'});},'clear':()=>{const _0x1daab6=_0x3f55;this[_0x1daab6(0xc1)][_0x1daab6(0x112)]({'type':'clear'});}},this['windField'][_0x347a6f(0xdf)](this[_0x347a6f(0x170)]);}}mars3d__namespace['LayerUtil']['register']('canvasWind',CanvasWindLayer),mars3d__namespace[_0x5be5a1(0x15e)]['CanvasWindLayer']=CanvasWindLayer,mars3d__namespace[_0x5be5a1(0xe5)]=CanvasWindField,mars3d__namespace[_0x5be5a1(0x166)]=WindUtil,exports['CanvasWindField']=CanvasWindField,exports['CanvasWindLayer']=CanvasWindLayer,exports['WindLayer']=WindLayer,exports[_0x5be5a1(0x166)]=WindUtil,Object['defineProperty'](exports,_0x5be5a1(0xf9),{'value':!![]}); +'use strict';const _0x1cfd68=_0x3da3;(function(_0xe24e0d,_0x2f3790){const _0xb66528=_0x3da3,_0x40e176=_0xe24e0d();while(!![]){try{const _0x56d327=-parseInt(_0xb66528(0x264))/0x1*(-parseInt(_0xb66528(0x1f1))/0x2)+-parseInt(_0xb66528(0x1fb))/0x3*(parseInt(_0xb66528(0x25b))/0x4)+-parseInt(_0xb66528(0x2a0))/0x5*(parseInt(_0xb66528(0x1ec))/0x6)+parseInt(_0xb66528(0x23d))/0x7+-parseInt(_0xb66528(0x2ae))/0x8*(-parseInt(_0xb66528(0x27e))/0x9)+parseInt(_0xb66528(0x1ff))/0xa+-parseInt(_0xb66528(0x29c))/0xb*(parseInt(_0xb66528(0x283))/0xc);if(_0x56d327===_0x2f3790)break;else _0x40e176['push'](_0x40e176['shift']());}catch(_0x217038){_0x40e176['push'](_0x40e176['shift']());}}}(_0x4ab3,0x1da03));function _interopNamespace(_0x404de7){const _0xf5d895=_0x3da3;if(_0x404de7&&_0x404de7[_0xf5d895(0x1fc)])return _0x404de7;var _0x37e12f=Object['create'](null);return _0x404de7&&Object['keys'](_0x404de7)['forEach'](function(_0x4d5f2f){const _0x3aaa08=_0xf5d895;if(_0x4d5f2f!==_0x3aaa08(0x265)){var _0x263df3=Object[_0x3aaa08(0x1de)](_0x404de7,_0x4d5f2f);Object['defineProperty'](_0x37e12f,_0x4d5f2f,_0x263df3['get']?_0x263df3:{'enumerable':!![],'get':function(){return _0x404de7[_0x4d5f2f];}});}}),_0x37e12f['default']=_0x404de7,_0x37e12f;}var mars3d__namespace=_interopNamespace(mars3d);const Cesium$7=mars3d__namespace['Cesium'];function getU(_0x2d242d,_0x52d1b6){const _0xa677df=_0x3da3,_0x32234c=_0x2d242d*Math[_0xa677df(0x1e0)](Cesium$7['Math']['toRadians'](_0x52d1b6));return _0x32234c;}function getV(_0xd75c3,_0x134030){const _0x564907=_0x3da3,_0x5e14c5=_0xd75c3*Math['sin'](Cesium$7[_0x564907(0x21a)]['toRadians'](_0x134030));return _0x5e14c5;}function getSpeed(_0x4c654d,_0x3ee03b){const _0x37d316=_0x3da3,_0x293ed5=Math['sqrt'](Math[_0x37d316(0x2b6)](_0x4c654d,0x2)+Math[_0x37d316(0x2b6)](_0x3ee03b,0x2));return _0x293ed5;}function getDirection(_0x3c9385,_0x1a6d9b){const _0x386a36=_0x3da3;let _0x591033=Cesium$7['Math'][_0x386a36(0x2ad)](Math['atan2'](_0x1a6d9b,_0x3c9385));return _0x591033+=_0x591033<0x0?0x168:0x0,_0x591033;}var WindUtil={'__proto__':null,'getU':getU,'getV':getV,'getSpeed':getSpeed,'getDirection':getDirection};const Cesium$6=mars3d__namespace['Cesium'];class CustomPrimitive{constructor(_0x5adce5){const _0x13a4d9=_0x3da3;this['commandType']=_0x5adce5['commandType'],this[_0x13a4d9(0x274)]=_0x5adce5['geometry'],this['attributeLocations']=_0x5adce5[_0x13a4d9(0x23b)],this[_0x13a4d9(0x2a2)]=_0x5adce5['primitiveType'],this['uniformMap']=_0x5adce5[_0x13a4d9(0x28d)],this['vertexShaderSource']=_0x5adce5['vertexShaderSource'],this['fragmentShaderSource']=_0x5adce5['fragmentShaderSource'],this['rawRenderState']=_0x5adce5[_0x13a4d9(0x1c6)],this['framebuffer']=_0x5adce5['framebuffer'],this[_0x13a4d9(0x1f7)]=_0x5adce5['outputTexture'],this['autoClear']=_0x5adce5['autoClear']??![],this['preExecute']=_0x5adce5[_0x13a4d9(0x25a)],this['show']=!![],this['commandToExecute']=undefined,this[_0x13a4d9(0x207)]=undefined,this['autoClear']&&(this[_0x13a4d9(0x207)]=new Cesium$6['ClearCommand']({'color':new Cesium$6['Color'](0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':this['framebuffer'],'pass':Cesium$6['Pass'][_0x13a4d9(0x2ac)]}));}[_0x1cfd68(0x1fd)](_0x1ecc0e){const _0x3ca278=_0x1cfd68;switch(this['commandType']){case'Draw':{const _0x523f54=Cesium$6[_0x3ca278(0x22a)]['fromGeometry']({'context':_0x1ecc0e,'geometry':this['geometry'],'attributeLocations':this[_0x3ca278(0x23b)],'bufferUsage':Cesium$6['BufferUsage']['STATIC_DRAW']}),_0x2ac47f=Cesium$6[_0x3ca278(0x26c)]['fromCache']({'context':_0x1ecc0e,'attributeLocations':this['attributeLocations'],'vertexShaderSource':this[_0x3ca278(0x289)],'fragmentShaderSource':this[_0x3ca278(0x29d)]}),_0x1d5519=Cesium$6['RenderState'][_0x3ca278(0x29b)](this['rawRenderState']);return new Cesium$6['DrawCommand']({'primitiveType':this['primitiveType'],'shaderProgram':_0x2ac47f,'vertexArray':_0x523f54,'modelMatrix':Cesium$6['Matrix4'][_0x3ca278(0x1d5)],'renderState':_0x1d5519,'uniformMap':this[_0x3ca278(0x28d)],'castShadows':![],'receiveShadows':![],'framebuffer':this['framebuffer'],'pass':Cesium$6['Pass']['OPAQUE'],'pickOnly':!![],'owner':this});}case'Compute':{return new Cesium$6['ComputeCommand']({'owner':this,'fragmentShaderSource':this['fragmentShaderSource'],'uniformMap':this['uniformMap'],'outputTexture':this['outputTexture'],'persists':!![]});}}}['setGeometry'](_0x2a2a19,_0x1bc3fa){const _0x5ca90b=_0x1cfd68;this['geometry']=_0x1bc3fa;const _0x1aeaab=Cesium$6['VertexArray'][_0x5ca90b(0x26d)]({'context':_0x2a2a19,'geometry':this['geometry'],'attributeLocations':this[_0x5ca90b(0x23b)],'bufferUsage':Cesium$6[_0x5ca90b(0x1ea)]['STATIC_DRAW']});this['commandToExecute']['vertexArray']=_0x1aeaab;}[_0x1cfd68(0x21b)](_0x1b3ec6){const _0x3e0219=_0x1cfd68;if(!this[_0x3e0219(0x26f)])return;if(_0x1b3ec6[_0x3e0219(0x26e)]!==Cesium$6[_0x3e0219(0x2b3)]['SCENE3D'])return;!Cesium$6[_0x3e0219(0x25e)](this[_0x3e0219(0x1f0)])&&(this[_0x3e0219(0x1f0)]=this['createCommand'](_0x1b3ec6[_0x3e0219(0x1eb)])),Cesium$6[_0x3e0219(0x25e)](this['preExecute'])&&this['preExecute'](),Cesium$6['defined'](this['clearCommand'])&&_0x1b3ec6['commandList']['push'](this[_0x3e0219(0x207)]),_0x1b3ec6[_0x3e0219(0x220)][_0x3e0219(0x29a)](this['commandToExecute']);}['isDestroyed'](){return![];}[_0x1cfd68(0x262)](){const _0x55c7b9=_0x1cfd68;if(this['clearCommand']){var _0x456309,_0x15d4bb;(_0x456309=this['clearCommand'])!==null&&_0x456309!==void 0x0&&_0x456309[_0x55c7b9(0x1d9)]&&this['clearCommand']['vertexArray'][_0x55c7b9(0x262)](),(_0x15d4bb=this['clearCommand'])!==null&&_0x15d4bb!==void 0x0&&_0x15d4bb['shaderProgram']&&this['clearCommand']['shaderProgram']['destroy'](),delete this['clearCommand'];}return this[_0x55c7b9(0x1f0)]&&(this['commandToExecute']['vertexArray']&&this[_0x55c7b9(0x1f0)]['vertexArray'][_0x55c7b9(0x262)](),this['commandToExecute']['shaderProgram']&&this['commandToExecute']['shaderProgram']['destroy'](),delete this['commandToExecute']),Cesium$6['destroyObject'](this);}}const Cesium$5=mars3d__namespace[_0x1cfd68(0x233)],Util=(function(){const _0x2b347a=function(){const _0x1a2c6a=_0x3da3,_0x2ebd35=new Cesium$5['Geometry']({'attributes':new Cesium$5['GeometryAttributes']({'position':new Cesium$5[(_0x1a2c6a(0x1fa))]({'componentDatatype':Cesium$5[_0x1a2c6a(0x20b)]['FLOAT'],'componentsPerAttribute':0x3,'values':new Float32Array([-0x1,-0x1,0x0,0x1,-0x1,0x0,0x1,0x1,0x0,-0x1,0x1,0x0])}),'st':new Cesium$5[(_0x1a2c6a(0x1fa))]({'componentDatatype':Cesium$5[_0x1a2c6a(0x20b)]['FLOAT'],'componentsPerAttribute':0x2,'values':new Float32Array([0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x1])})}),'indices':new Uint32Array([0x3,0x2,0x0,0x0,0x2,0x1])});return _0x2ebd35;},_0x18dc23=function(_0x29971b,_0x828fa7){const _0x37e1a2=_0x3da3;if(Cesium$5['defined'](_0x828fa7)){const _0x2e3e70={};_0x2e3e70['arrayBufferView']=_0x828fa7,_0x29971b['source']=_0x2e3e70;}const _0x18b767=new Cesium$5[(_0x37e1a2(0x273))](_0x29971b);return _0x18b767;},_0x3b18d7=function(_0x498fde,_0x1b4f4f,_0x564375){const _0x24a224=_0x3da3,_0x400eea=new Cesium$5[(_0x24a224(0x2a1))]({'context':_0x498fde,'colorTextures':[_0x1b4f4f],'depthTexture':_0x564375});return _0x400eea;},_0x19b903=function(_0x419e1c){const _0x150e43=_0x3da3,_0x11d414=!![],_0x59b1ae=![],_0x300d5e={'viewport':_0x419e1c['viewport'],'depthTest':_0x419e1c['depthTest'],'depthMask':_0x419e1c['depthMask'],'blending':_0x419e1c[_0x150e43(0x29e)]},_0x2d89e1=Cesium$5['Appearance'][_0x150e43(0x2a4)](_0x11d414,_0x59b1ae,_0x300d5e);return _0x2d89e1;},_0x3eff2d=function(_0x3cb83d){const _0x1ae4e6=_0x3da3,_0x175c80={},_0x4e84ad=Cesium$5['Math']['mod'](_0x3cb83d['west'],Cesium$5['Math']['TWO_PI']),_0x5790da=Cesium$5[_0x1ae4e6(0x21a)]['mod'](_0x3cb83d['east'],Cesium$5[_0x1ae4e6(0x21a)][_0x1ae4e6(0x1d7)]),_0x4b34c8=_0x3cb83d['width'];let _0x4e9806,_0x16364b;_0x4b34c8>Cesium$5[_0x1ae4e6(0x21a)]['THREE_PI_OVER_TWO']?(_0x4e9806=0x0,_0x16364b=Cesium$5['Math']['TWO_PI']):_0x5790da-_0x4e84ad<_0x4b34c8?(_0x4e9806=_0x4e84ad,_0x16364b=_0x4e84ad+_0x4b34c8):(_0x4e9806=_0x4e84ad,_0x16364b=_0x5790da);_0x175c80[_0x1ae4e6(0x234)]={'min':Cesium$5['Math']['toDegrees'](_0x4e9806),'max':Cesium$5['Math'][_0x1ae4e6(0x2ad)](_0x16364b)};const _0x26d018=_0x3cb83d[_0x1ae4e6(0x22f)],_0x229213=_0x3cb83d['north'],_0x5253e5=_0x3cb83d['height'],_0x334e98=_0x5253e5>Cesium$5[_0x1ae4e6(0x21a)]['PI']/0xc?_0x5253e5/0x2:0x0;let _0x195f52=Cesium$5['Math']['clampToLatitudeRange'](_0x26d018-_0x334e98),_0x47de21=Cesium$5['Math']['clampToLatitudeRange'](_0x229213+_0x334e98);return _0x195f52<-Cesium$5[_0x1ae4e6(0x21a)]['PI_OVER_THREE']&&(_0x195f52=-Cesium$5['Math']['PI_OVER_TWO']),_0x47de21>Cesium$5[_0x1ae4e6(0x21a)]['PI_OVER_THREE']&&(_0x47de21=Cesium$5['Math'][_0x1ae4e6(0x1cc)]),_0x175c80['lat']={'min':Cesium$5['Math']['toDegrees'](_0x195f52),'max':Cesium$5['Math']['toDegrees'](_0x47de21)},_0x175c80;};return{'getFullscreenQuad':_0x2b347a,'createTexture':_0x18dc23,'createFramebuffer':_0x3b18d7,'createRawRenderState':_0x19b903,'viewRectangleToLonLatRange':_0x3eff2d};}());var segmentDraw_vert=_0x1cfd68(0x209),segmentDraw_frag='uniform\x20sampler2D\x20colorTable;\x0a\x0ain\x20float\x20speedNormalization;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20out_FragColor\x20=\x20texture(colorTable,\x20vec2(speedNormalization,\x200.0));\x0a}\x0a',fullscreen_vert=_0x1cfd68(0x1fe),trailDraw_frag='uniform\x20sampler2D\x20segmentsColorTexture;\x0auniform\x20sampler2D\x20segmentsDepthTexture;\x0a\x0auniform\x20sampler2D\x20currentTrailsColor;\x0auniform\x20sampler2D\x20trailsDepthTexture;\x0a\x0auniform\x20float\x20fadeOpacity;\x0a\x0ain\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20pointsColor\x20=\x20texture(segmentsColorTexture,\x20textureCoordinate);\x0a\x20\x20\x20\x20vec4\x20trailsColor\x20=\x20texture(currentTrailsColor,\x20textureCoordinate);\x0a\x0a\x20\x20\x20\x20trailsColor\x20=\x20floor(fadeOpacity\x20*\x20255.0\x20*\x20trailsColor)\x20/\x20255.0;\x20//\x20make\x20sure\x20the\x20trailsColor\x20will\x20be\x20strictly\x20decreased\x0a\x0a\x20\x20\x20\x20float\x20pointsDepth\x20=\x20texture(segmentsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20trailsDepth\x20=\x20texture(trailsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20globeDepth\x20=\x20czm_unpackDepth(texture(czm_globeDepthTexture,\x20textureCoordinate));\x0a\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20if\x20(pointsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20out_FragColor\x20+\x20pointsColor;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20if\x20(trailsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20out_FragColor\x20+\x20trailsColor;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20gl_FragDepth\x20=\x20min(pointsDepth,\x20trailsDepth);\x0a}\x0a',screenDraw_frag='uniform\x20sampler2D\x20trailsColorTexture;\x0auniform\x20sampler2D\x20trailsDepthTexture;\x0a\x0ain\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20trailsColor\x20=\x20texture(trailsColorTexture,\x20textureCoordinate);\x0a\x20\x20\x20\x20float\x20trailsDepth\x20=\x20texture(trailsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20\x20\x20float\x20globeDepth\x20=\x20czm_unpackDepth(texture(czm_globeDepthTexture,\x20textureCoordinate));\x0a\x0a\x20\x20\x20\x20if\x20(trailsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20trailsColor;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20}\x0a}\x0a';const Cesium$4=mars3d__namespace[_0x1cfd68(0x233)];function _0x3da3(_0x16d191,_0x1410b6){const _0x4ab39b=_0x4ab3();return _0x3da3=function(_0x3da327,_0x2da054){_0x3da327=_0x3da327-0x1c5;let _0x5740a9=_0x4ab39b[_0x3da327];return _0x5740a9;},_0x3da3(_0x16d191,_0x1410b6);}class ParticlesRendering{constructor(_0x2c8474,_0x2a0d44,_0x282e4d,_0x525fa2,_0x278074){const _0x4a26a9=_0x1cfd68;this['createRenderingTextures'](_0x2c8474,_0x2a0d44,_0x282e4d['colors']),this[_0x4a26a9(0x1f2)](_0x2c8474),this['createRenderingPrimitives'](_0x2c8474,_0x282e4d,_0x525fa2,_0x278074);}[_0x1cfd68(0x222)](_0x403cf7,_0x2696c1,_0x166e29){const _0x574cfc=_0x1cfd68,_0x19735a={'context':_0x403cf7,'width':_0x403cf7['drawingBufferWidth'],'height':_0x403cf7['drawingBufferHeight'],'pixelFormat':Cesium$4['PixelFormat'][_0x574cfc(0x1db)],'pixelDatatype':Cesium$4['PixelDatatype']['UNSIGNED_BYTE']},_0x4bb860={'context':_0x403cf7,'width':_0x403cf7[_0x574cfc(0x270)],'height':_0x403cf7['drawingBufferHeight'],'pixelFormat':Cesium$4['PixelFormat'][_0x574cfc(0x22b)],'pixelDatatype':Cesium$4['PixelDatatype']['UNSIGNED_INT']},_0x3828bd=_0x166e29['length'],_0x4125c8=new Float32Array(_0x3828bd*0x3);for(let _0x7efd67=0x0;_0x7efd67<_0x3828bd;_0x7efd67++){const _0x1150bc=Cesium$4[_0x574cfc(0x24f)]['fromCssColorString'](_0x166e29[_0x7efd67]);_0x4125c8[0x3*_0x7efd67]=_0x1150bc['red'],_0x4125c8[0x3*_0x7efd67+0x1]=_0x1150bc['green'],_0x4125c8[0x3*_0x7efd67+0x2]=_0x1150bc['blue'];}const _0x47e546={'context':_0x403cf7,'width':_0x3828bd,'height':0x1,'pixelFormat':Cesium$4[_0x574cfc(0x1f6)][_0x574cfc(0x281)],'pixelDatatype':Cesium$4['PixelDatatype'][_0x574cfc(0x224)],'sampler':new Cesium$4[(_0x574cfc(0x266))]({'minificationFilter':Cesium$4['TextureMinificationFilter']['LINEAR'],'magnificationFilter':Cesium$4['TextureMagnificationFilter']['LINEAR']})};this[_0x574cfc(0x23a)]={'segmentsColor':Util[_0x574cfc(0x286)](_0x19735a),'segmentsDepth':Util['createTexture'](_0x4bb860),'currentTrailsColor':Util['createTexture'](_0x19735a),'currentTrailsDepth':Util[_0x574cfc(0x286)](_0x4bb860),'nextTrailsColor':Util['createTexture'](_0x19735a),'nextTrailsDepth':Util['createTexture'](_0x4bb860),'colorTable':Util['createTexture'](_0x47e546,_0x4125c8)};}['createRenderingFramebuffers'](_0x5554ff){const _0x1a3c7a=_0x1cfd68;this['framebuffers']={'segments':Util['createFramebuffer'](_0x5554ff,this['textures']['segmentsColor'],this['textures']['segmentsDepth']),'currentTrails':Util['createFramebuffer'](_0x5554ff,this['textures']['currentTrailsColor'],this[_0x1a3c7a(0x23a)][_0x1a3c7a(0x23c)]),'nextTrails':Util[_0x1a3c7a(0x2b9)](_0x5554ff,this['textures']['nextTrailsColor'],this['textures'][_0x1a3c7a(0x1d8)])};}['createSegmentsGeometry'](_0x538060){const _0x32e72f=_0x1cfd68,_0x4d0d04=0x4;let _0x21c218=[];for(let _0x360192=0x0;_0x360192<_0x538060['particlesTextureSize'];_0x360192++){for(let _0x59af0a=0x0;_0x59af0a<_0x538060['particlesTextureSize'];_0x59af0a++){for(let _0x1354d0=0x0;_0x1354d0<_0x4d0d04;_0x1354d0++){_0x21c218['push'](_0x360192/_0x538060['particlesTextureSize']),_0x21c218[_0x32e72f(0x29a)](_0x59af0a/_0x538060['particlesTextureSize']);}}}_0x21c218=new Float32Array(_0x21c218);let _0x20a9e6=[];const _0x2d9097=[-0x1,0x1],_0x4a3b89=[-0x1,0x1];for(let _0x38b1a5=0x0;_0x38b1a5<_0x538060['maxParticles'];_0x38b1a5++){for(let _0x47c674=0x0;_0x47c674<_0x4d0d04/0x2;_0x47c674++){for(let _0x18b735=0x0;_0x18b735<_0x4d0d04/0x2;_0x18b735++){_0x20a9e6[_0x32e72f(0x29a)](_0x2d9097[_0x47c674]),_0x20a9e6['push'](_0x4a3b89[_0x18b735]),_0x20a9e6['push'](0x0);}}}_0x20a9e6=new Float32Array(_0x20a9e6);const _0x420d86=0x6*_0x538060['maxParticles'],_0x499c99=new Uint32Array(_0x420d86);for(let _0x428e0e=0x0,_0x6ee2e2=0x0,_0x81e82c=0x0;_0x428e0e<_0x538060['maxParticles'];_0x428e0e++){_0x499c99[_0x6ee2e2++]=_0x81e82c+0x0,_0x499c99[_0x6ee2e2++]=_0x81e82c+0x1,_0x499c99[_0x6ee2e2++]=_0x81e82c+0x2,_0x499c99[_0x6ee2e2++]=_0x81e82c+0x2,_0x499c99[_0x6ee2e2++]=_0x81e82c+0x1,_0x499c99[_0x6ee2e2++]=_0x81e82c+0x3,_0x81e82c+=0x4;}const _0x2ed03a=new Cesium$4[(_0x32e72f(0x2b7))]({'attributes':new Cesium$4['GeometryAttributes']({'st':new Cesium$4[(_0x32e72f(0x1fa))]({'componentDatatype':Cesium$4['ComponentDatatype']['FLOAT'],'componentsPerAttribute':0x2,'values':_0x21c218}),'normal':new Cesium$4['GeometryAttribute']({'componentDatatype':Cesium$4['ComponentDatatype'][_0x32e72f(0x224)],'componentsPerAttribute':0x3,'values':_0x20a9e6})}),'indices':_0x499c99});return _0x2ed03a;}['createRenderingPrimitives'](_0x4742ce,_0x16df77,_0x6e7851,_0x41dc98){const _0x27340a=_0x1cfd68,_0x1b48a0=this;this['primitives']={'segments':new CustomPrimitive({'commandType':'Draw','attributeLocations':{'st':0x0,'normal':0x1},'geometry':this[_0x27340a(0x260)](_0x16df77),'primitiveType':Cesium$4[_0x27340a(0x1e7)]['TRIANGLES'],'uniformMap':{'currentParticlesPosition':function(){const _0x456a94=_0x27340a;return _0x41dc98[_0x456a94(0x1e5)]['currentParticlesPosition'];},'postProcessingPosition':function(){return _0x41dc98['particlesTextures']['postProcessingPosition'];},'postProcessingSpeed':function(){const _0x4c578c=_0x27340a;return _0x41dc98['particlesTextures'][_0x4c578c(0x25d)];},'colorTable':function(){const _0x265c30=_0x27340a;return _0x1b48a0[_0x265c30(0x23a)][_0x265c30(0x1f3)];},'aspect':function(){return _0x4742ce['drawingBufferWidth']/_0x4742ce['drawingBufferHeight'];},'pixelSize':function(){return _0x6e7851['pixelSize'];},'lineWidth':function(){const _0x2fd851=_0x27340a;return _0x16df77[_0x2fd851(0x294)];},'particleHeight':function(){return _0x16df77['particleHeight'];}},'vertexShaderSource':new Cesium$4[(_0x27340a(0x27f))]({'sources':[segmentDraw_vert]}),'fragmentShaderSource':new Cesium$4['ShaderSource']({'sources':[segmentDraw_frag]}),'rawRenderState':Util['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':!![]},'depthMask':!![]}),'framebuffer':this['framebuffers']['segments'],'autoClear':!![]}),'trails':new CustomPrimitive({'commandType':_0x27340a(0x261),'attributeLocations':{'position':0x0,'st':0x1},'geometry':Util['getFullscreenQuad'](),'primitiveType':Cesium$4['PrimitiveType']['TRIANGLES'],'uniformMap':{'segmentsColorTexture':function(){const _0x464c58=_0x27340a;return _0x1b48a0[_0x464c58(0x23a)][_0x464c58(0x201)];},'segmentsDepthTexture':function(){return _0x1b48a0['textures']['segmentsDepth'];},'currentTrailsColor':function(){const _0x525d61=_0x27340a;return _0x1b48a0[_0x525d61(0x268)][_0x525d61(0x1ed)]['getColorTexture'](0x0);},'trailsDepthTexture':function(){const _0x11cb85=_0x27340a;return _0x1b48a0['framebuffers'][_0x11cb85(0x1ed)][_0x11cb85(0x1ce)];},'fadeOpacity':function(){return _0x16df77['fadeOpacity'];}},'vertexShaderSource':new Cesium$4[(_0x27340a(0x27f))]({'defines':['DISABLE_GL_POSITION_LOG_DEPTH'],'sources':[fullscreen_vert]}),'fragmentShaderSource':new Cesium$4[(_0x27340a(0x27f))]({'defines':['DISABLE_LOG_DEPTH_FRAGMENT_WRITE'],'sources':[trailDraw_frag]}),'rawRenderState':Util['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':!![],'func':Cesium$4['DepthFunction']['ALWAYS']},'depthMask':!![]}),'framebuffer':this['framebuffers']['nextTrails'],'autoClear':!![],'preExecute':function(){const _0x3c4d79=_0x27340a,_0x58f027=_0x1b48a0[_0x3c4d79(0x268)]['currentTrails'];_0x1b48a0[_0x3c4d79(0x268)][_0x3c4d79(0x1ed)]=_0x1b48a0['framebuffers']['nextTrails'],_0x1b48a0['framebuffers']['nextTrails']=_0x58f027,_0x1b48a0['primitives']['trails']['commandToExecute']['framebuffer']=_0x1b48a0['framebuffers']['nextTrails'],_0x1b48a0['primitives'][_0x3c4d79(0x1e8)]['clearCommand'][_0x3c4d79(0x244)]=_0x1b48a0['framebuffers']['nextTrails'];}}),'screen':new CustomPrimitive({'commandType':'Draw','attributeLocations':{'position':0x0,'st':0x1},'geometry':Util['getFullscreenQuad'](),'primitiveType':Cesium$4['PrimitiveType']['TRIANGLES'],'uniformMap':{'trailsColorTexture':function(){const _0x5ba8da=_0x27340a;return _0x1b48a0[_0x5ba8da(0x268)][_0x5ba8da(0x213)]['getColorTexture'](0x0);},'trailsDepthTexture':function(){const _0x12db96=_0x27340a;return _0x1b48a0['framebuffers'][_0x12db96(0x213)]['depthTexture'];}},'vertexShaderSource':new Cesium$4[(_0x27340a(0x27f))]({'defines':['DISABLE_GL_POSITION_LOG_DEPTH'],'sources':[fullscreen_vert]}),'fragmentShaderSource':new Cesium$4['ShaderSource']({'defines':['DISABLE_LOG_DEPTH_FRAGMENT_WRITE'],'sources':[screenDraw_frag]}),'rawRenderState':Util[_0x27340a(0x21c)]({'viewport':undefined,'depthTest':{'enabled':![]},'depthMask':!![],'blending':{'enabled':!![]}}),'framebuffer':undefined})};}}var getWind_frag=_0x1cfd68(0x2a7),updateSpeed_frag='uniform\x20sampler2D\x20currentParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0auniform\x20sampler2D\x20particlesWind;\x0a\x0a//\x20used\x20to\x20calculate\x20the\x20wind\x20norm\x0auniform\x20vec2\x20uSpeedRange;\x20//\x20(min,\x20max);\x0auniform\x20vec2\x20vSpeedRange;\x0auniform\x20float\x20pixelSize;\x0auniform\x20float\x20speedFactor;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0afloat\x20calculateWindNorm(vec3\x20speed)\x20{\x0a\x20\x20\x20\x20vec3\x20percent\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20percent.x\x20=\x20(speed.x\x20-\x20uSpeedRange.x)\x20/\x20(uSpeedRange.y\x20-\x20uSpeedRange.x);\x0a\x20\x20\x20\x20percent.y\x20=\x20(speed.y\x20-\x20vSpeedRange.x)\x20/\x20(vSpeedRange.y\x20-\x20vSpeedRange.x);\x0a\x20\x20\x20\x20float\x20normalization\x20=\x20length(percent);\x0a\x0a\x20\x20\x20\x20return\x20normalization;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20//\x20vec3\x20currentSpeed\x20=\x20texture(currentParticlesSpeed,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20windVector\x20=\x20texture(particlesWind,\x20v_textureCoordinates).rgb;\x0a\x0a\x20\x20\x20\x20vec4\x20nextSpeed\x20=\x20vec4(speedFactor\x20*\x20pixelSize\x20*\x20windVector,\x20calculateWindNorm(windVector));\x0a\x20\x20\x20\x20out_FragColor\x20=\x20nextSpeed;\x0a}\x0a',updatePosition_frag='uniform\x20sampler2D\x20currentParticlesPosition;\x20//\x20(lon,\x20lat,\x20lev)\x0auniform\x20sampler2D\x20currentParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec2\x20lengthOfLonLat(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20unit\x20conversion:\x20meters\x20->\x20longitude\x20latitude\x20degrees\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Geographic_coordinate_system#Length_of_a_degree\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20the\x20length\x20of\x20a\x20degree\x20of\x20latitude\x20and\x20longitude\x20in\x20meters\x0a\x20\x20\x20\x20float\x20latitude\x20=\x20radians(lonLatLev.y);\x0a\x0a\x20\x20\x20\x20float\x20term1\x20=\x20111132.92;\x0a\x20\x20\x20\x20float\x20term2\x20=\x20559.82\x20*\x20cos(2.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term3\x20=\x201.175\x20*\x20cos(4.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term4\x20=\x200.0023\x20*\x20cos(6.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20latLength\x20=\x20term1\x20-\x20term2\x20+\x20term3\x20-\x20term4;\x0a\x0a\x20\x20\x20\x20float\x20term5\x20=\x20111412.84\x20*\x20cos(latitude);\x0a\x20\x20\x20\x20float\x20term6\x20=\x2093.5\x20*\x20cos(3.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20term7\x20=\x200.118\x20*\x20cos(5.0\x20*\x20latitude);\x0a\x20\x20\x20\x20float\x20longLength\x20=\x20term5\x20-\x20term6\x20+\x20term7;\x0a\x0a\x20\x20\x20\x20return\x20vec2(longLength,\x20latLength);\x0a}\x0a\x0avoid\x20updatePosition(vec3\x20lonLatLev,\x20vec3\x20speed)\x20{\x0a\x20\x20\x20\x20vec2\x20lonLatLength\x20=\x20lengthOfLonLat(lonLatLev);\x0a\x20\x20\x20\x20float\x20u\x20=\x20speed.x\x20/\x20lonLatLength.x;\x0a\x20\x20\x20\x20float\x20v\x20=\x20speed.y\x20/\x20lonLatLength.y;\x0a\x20\x20\x20\x20float\x20w\x20=\x200.0;\x0a\x20\x20\x20\x20vec3\x20windVectorInLonLatLev\x20=\x20vec3(u,\x20v,\x20w);\x0a\x0a\x20\x20\x20\x20vec3\x20nextParticle\x20=\x20lonLatLev\x20+\x20windVectorInLonLatLev;\x0a\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(nextParticle,\x200.0);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20vec3\x20lonLatLev\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20speed\x20=\x20texture(currentParticlesSpeed,\x20v_textureCoordinates).rgb;\x0a\x0a\x20\x20\x20\x20updatePosition(lonLatLev,\x20speed);\x0a}\x0a',postProcessingPosition_frag=_0x1cfd68(0x227),postProcessingSpeed_frag='uniform\x20sampler2D\x20postProcessingPosition;\x0auniform\x20sampler2D\x20nextParticlesSpeed;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec4\x20randomParticle\x20=\x20texture(postProcessingPosition,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20vec4\x20particleSpeed\x20=\x20texture(nextParticlesSpeed,\x20v_textureCoordinates);\x0a\x0a\x20\x20\x20\x20if\x20(randomParticle.a\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20particleSpeed;\x0a\x20\x20\x20\x20}\x0a}\x0a';const Cesium$3=mars3d__namespace['Cesium'];class ParticlesComputing{constructor(_0x1d1dd7,_0x3c79f9,_0x453f35,_0x5626c1){const _0x2036b8=_0x1cfd68;this['data']=_0x3c79f9,this['createWindTextures'](_0x1d1dd7,_0x3c79f9),this['createParticlesTextures'](_0x1d1dd7,_0x453f35,_0x5626c1),this[_0x2036b8(0x254)](_0x3c79f9,_0x453f35,_0x5626c1);}[_0x1cfd68(0x1c5)](_0x7bfc92,_0x52ecf1){const _0x490aba=_0x1cfd68,_0x43b97b={'context':_0x7bfc92,'width':_0x52ecf1['dimensions']['lon'],'height':_0x52ecf1['dimensions']['lat']*(_0x52ecf1['dimensions'][_0x490aba(0x26b)]||0x1),'pixelFormat':Cesium$3[_0x490aba(0x1f6)]['LUMINANCE'],'pixelDatatype':Cesium$3['PixelDatatype'][_0x490aba(0x224)],'flipY':![],'sampler':new Cesium$3[(_0x490aba(0x266))]({'minificationFilter':Cesium$3[_0x490aba(0x1da)]['NEAREST'],'magnificationFilter':Cesium$3[_0x490aba(0x257)]['NEAREST']})};this[_0x490aba(0x267)]={'U':Util['createTexture'](_0x43b97b,_0x52ecf1['U']['array']),'V':Util['createTexture'](_0x43b97b,_0x52ecf1['V']['array'])};}['createParticlesTextures'](_0x258839,_0x3a99ab,_0x4fb652){const _0x394ae5=_0x1cfd68,_0x1306f3={'context':_0x258839,'width':_0x3a99ab['particlesTextureSize'],'height':_0x3a99ab['particlesTextureSize'],'pixelFormat':Cesium$3['PixelFormat']['RGBA'],'pixelDatatype':Cesium$3['PixelDatatype']['FLOAT'],'flipY':![],'sampler':new Cesium$3[(_0x394ae5(0x266))]({'minificationFilter':Cesium$3['TextureMinificationFilter'][_0x394ae5(0x245)],'magnificationFilter':Cesium$3[_0x394ae5(0x257)][_0x394ae5(0x245)]})},_0xad5122=this[_0x394ae5(0x231)](_0x3a99ab['maxParticles'],_0x4fb652),_0x3a66d4=new Float32Array(0x4*_0x3a99ab['maxParticles'])['fill'](0x0);this[_0x394ae5(0x1e5)]={'particlesWind':Util['createTexture'](_0x1306f3),'currentParticlesPosition':Util['createTexture'](_0x1306f3,_0xad5122),'nextParticlesPosition':Util['createTexture'](_0x1306f3,_0xad5122),'currentParticlesSpeed':Util['createTexture'](_0x1306f3,_0x3a66d4),'nextParticlesSpeed':Util['createTexture'](_0x1306f3,_0x3a66d4),'postProcessingPosition':Util['createTexture'](_0x1306f3,_0xad5122),'postProcessingSpeed':Util['createTexture'](_0x1306f3,_0x3a66d4)};}[_0x1cfd68(0x231)](_0xe3560f,_0x180aa9){const _0x197211=_0x1cfd68,_0x4fddd7=new Float32Array(0x4*_0xe3560f);for(let _0x9a1291=0x0;_0x9a1291<_0xe3560f;_0x9a1291++){_0x4fddd7[0x4*_0x9a1291]=Cesium$3['Math']['randomBetween'](_0x180aa9['lonRange']['x'],_0x180aa9['lonRange']['y']),_0x4fddd7[0x4*_0x9a1291+0x1]=Cesium$3['Math']['randomBetween'](_0x180aa9[_0x197211(0x214)]['x'],_0x180aa9['latRange']['y']),_0x4fddd7[0x4*_0x9a1291+0x2]=Cesium$3['Math']['randomBetween'](this['data']['lev']['min'],this[_0x197211(0x1e4)]['lev']['max']),_0x4fddd7[0x4*_0x9a1291+0x3]=0x0;}return _0x4fddd7;}[_0x1cfd68(0x24e)](){Object['keys'](this['particlesTextures'])['forEach'](_0x26c034=>{this['particlesTextures'][_0x26c034]['destroy']();});}['createComputingPrimitives'](_0x45b4c7,_0x593e4b,_0x3d4054){const _0x443067=_0x1cfd68,_0x54c0d8=new Cesium$3[(_0x443067(0x246))](_0x45b4c7[_0x443067(0x2a8)]['lon'],_0x45b4c7['dimensions'][_0x443067(0x2bb)],_0x45b4c7['dimensions']['lev']),_0x2a12ce=new Cesium$3['Cartesian3'](_0x45b4c7['lon']['min'],_0x45b4c7['lat']['min'],_0x45b4c7[_0x443067(0x26b)]['min']),_0x3ea7a8=new Cesium$3['Cartesian3'](_0x45b4c7['lon']['max'],_0x45b4c7['lat']['max'],_0x45b4c7['lev'][_0x443067(0x275)]),_0x1b3045=new Cesium$3[(_0x443067(0x246))]((_0x3ea7a8['x']-_0x2a12ce['x'])/(_0x54c0d8['x']-0x1),(_0x3ea7a8['y']-_0x2a12ce['y'])/(_0x54c0d8['y']-0x1),_0x54c0d8['z']>0x1?(_0x3ea7a8['z']-_0x2a12ce['z'])/(_0x54c0d8['z']-0x1):0x1),_0x53f73d=new Cesium$3[(_0x443067(0x26a))](_0x45b4c7['U']['min'],_0x45b4c7['U']['max']),_0x201b57=new Cesium$3['Cartesian2'](_0x45b4c7['V']['min'],_0x45b4c7['V']['max']),_0x2ca1d5=this;this['primitives']={'getWind':new CustomPrimitive({'commandType':'Compute','uniformMap':{'U':function(){const _0x3fcd02=_0x443067;return _0x2ca1d5[_0x3fcd02(0x267)]['U'];},'V':function(){return _0x2ca1d5['windTextures']['V'];},'currentParticlesPosition':function(){const _0x453626=_0x443067;return _0x2ca1d5['particlesTextures'][_0x453626(0x22e)];},'dimension':function(){return _0x54c0d8;},'minimum':function(){return _0x2a12ce;},'maximum':function(){return _0x3ea7a8;},'interval':function(){return _0x1b3045;}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[getWind_frag]}),'outputTexture':this['particlesTextures']['particlesWind'],'preExecute':function(){const _0x2acfd3=_0x443067;_0x2ca1d5['primitives'][_0x2acfd3(0x236)]['commandToExecute'][_0x2acfd3(0x1f7)]=_0x2ca1d5['particlesTextures']['particlesWind'];}}),'updateSpeed':new CustomPrimitive({'commandType':_0x443067(0x238),'uniformMap':{'currentParticlesSpeed':function(){const _0x530242=_0x443067;return _0x2ca1d5['particlesTextures'][_0x530242(0x28e)];},'particlesWind':function(){const _0x4be478=_0x443067;return _0x2ca1d5[_0x4be478(0x1e5)][_0x4be478(0x27d)];},'uSpeedRange':function(){return _0x53f73d;},'vSpeedRange':function(){return _0x201b57;},'pixelSize':function(){return _0x3d4054['pixelSize'];},'speedFactor':function(){return _0x593e4b['speedFactor'];}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[updateSpeed_frag]}),'outputTexture':this[_0x443067(0x1e5)][_0x443067(0x221)],'preExecute':function(){const _0x53f2d3=_0x443067,_0x3b087d=_0x2ca1d5['particlesTextures'][_0x53f2d3(0x28e)];_0x2ca1d5[_0x53f2d3(0x1e5)]['currentParticlesSpeed']=_0x2ca1d5[_0x53f2d3(0x1e5)]['postProcessingSpeed'],_0x2ca1d5[_0x53f2d3(0x1e5)][_0x53f2d3(0x25d)]=_0x3b087d,_0x2ca1d5['primitives'][_0x53f2d3(0x28b)]['commandToExecute']['outputTexture']=_0x2ca1d5[_0x53f2d3(0x1e5)]['nextParticlesSpeed'];}}),'updatePosition':new CustomPrimitive({'commandType':'Compute','uniformMap':{'currentParticlesPosition':function(){const _0x570726=_0x443067;return _0x2ca1d5['particlesTextures'][_0x570726(0x22e)];},'currentParticlesSpeed':function(){const _0x3ee10d=_0x443067;return _0x2ca1d5['particlesTextures'][_0x3ee10d(0x28e)];}},'fragmentShaderSource':new Cesium$3[(_0x443067(0x27f))]({'sources':[updatePosition_frag]}),'outputTexture':this[_0x443067(0x1e5)][_0x443067(0x293)],'preExecute':function(){const _0x3a4e29=_0x443067,_0x325a7f=_0x2ca1d5[_0x3a4e29(0x1e5)][_0x3a4e29(0x22e)];_0x2ca1d5['particlesTextures']['currentParticlesPosition']=_0x2ca1d5['particlesTextures']['postProcessingPosition'],_0x2ca1d5['particlesTextures']['postProcessingPosition']=_0x325a7f,_0x2ca1d5['primitives']['updatePosition']['commandToExecute']['outputTexture']=_0x2ca1d5['particlesTextures']['nextParticlesPosition'];}}),'postProcessingPosition':new CustomPrimitive({'commandType':_0x443067(0x238),'uniformMap':{'nextParticlesPosition':function(){const _0x34e360=_0x443067;return _0x2ca1d5['particlesTextures'][_0x34e360(0x293)];},'nextParticlesSpeed':function(){return _0x2ca1d5['particlesTextures']['nextParticlesSpeed'];},'lonRange':function(){return _0x3d4054['lonRange'];},'latRange':function(){return _0x3d4054['latRange'];},'randomCoefficient':function(){const _0x553344=Math['random']();return _0x553344;},'dropRate':function(){const _0x24f7c7=_0x443067;return _0x593e4b[_0x24f7c7(0x23e)];},'dropRateBump':function(){return _0x593e4b['dropRateBump'];}},'fragmentShaderSource':new Cesium$3[(_0x443067(0x27f))]({'sources':[postProcessingPosition_frag]}),'outputTexture':this['particlesTextures'][_0x443067(0x1f5)],'preExecute':function(){const _0x5a16a8=_0x443067;_0x2ca1d5[_0x5a16a8(0x1d2)]['postProcessingPosition']['commandToExecute']['outputTexture']=_0x2ca1d5[_0x5a16a8(0x1e5)][_0x5a16a8(0x1f5)];}}),'postProcessingSpeed':new CustomPrimitive({'commandType':_0x443067(0x238),'uniformMap':{'postProcessingPosition':function(){return _0x2ca1d5['particlesTextures']['postProcessingPosition'];},'nextParticlesSpeed':function(){const _0xc10fe7=_0x443067;return _0x2ca1d5[_0xc10fe7(0x1e5)]['nextParticlesSpeed'];}},'fragmentShaderSource':new Cesium$3['ShaderSource']({'sources':[postProcessingSpeed_frag]}),'outputTexture':this['particlesTextures']['postProcessingSpeed'],'preExecute':function(){_0x2ca1d5['primitives']['postProcessingSpeed']['commandToExecute']['outputTexture']=_0x2ca1d5['particlesTextures']['postProcessingSpeed'];}})};}}const Cesium$2=mars3d__namespace[_0x1cfd68(0x233)];class ParticleSystem{constructor(_0x1bea3a,_0x232d6f,_0x2d4353,_0x47f052){const _0x493def=_0x1cfd68;this['context']=_0x1bea3a,_0x232d6f={..._0x232d6f},_0x232d6f['udata']&&_0x232d6f[_0x493def(0x229)]&&(_0x232d6f['dimensions']={},_0x232d6f['dimensions'][_0x493def(0x234)]=_0x232d6f['cols'],_0x232d6f[_0x493def(0x2a8)][_0x493def(0x2bb)]=_0x232d6f['rows'],_0x232d6f['dimensions']['lev']=_0x232d6f['lev']||0x1,_0x232d6f[_0x493def(0x234)]={},_0x232d6f['lon'][_0x493def(0x263)]=_0x232d6f['xmin'],_0x232d6f['lon']['max']=_0x232d6f['xmax'],_0x232d6f[_0x493def(0x2bb)]={},_0x232d6f['lat']['min']=_0x232d6f['ymin'],_0x232d6f['lat'][_0x493def(0x275)]=_0x232d6f['ymax'],_0x232d6f[_0x493def(0x26b)]={},_0x232d6f['lev']['min']=_0x232d6f[_0x493def(0x240)]??0x1,_0x232d6f['lev'][_0x493def(0x275)]=_0x232d6f['levmax']??0x1,_0x232d6f['U']={},_0x232d6f['U']['array']=new Float32Array(_0x232d6f['udata']),_0x232d6f['U'][_0x493def(0x263)]=_0x232d6f['umin']??Math['min'](..._0x232d6f['udata']),_0x232d6f['U'][_0x493def(0x275)]=_0x232d6f['umax']??Math['max'](..._0x232d6f[_0x493def(0x2ba)]),_0x232d6f['V']={},_0x232d6f['V']['array']=new Float32Array(_0x232d6f['vdata']),_0x232d6f['V'][_0x493def(0x263)]=_0x232d6f[_0x493def(0x208)]??Math[_0x493def(0x263)](..._0x232d6f['vdata']),_0x232d6f['V'][_0x493def(0x275)]=_0x232d6f['vmax']??Math['max'](..._0x232d6f[_0x493def(0x229)])),this['data']=_0x232d6f,this[_0x493def(0x285)]=_0x2d4353,this['viewerParameters']=_0x47f052,this['particlesComputing']=new ParticlesComputing(this[_0x493def(0x1eb)],this[_0x493def(0x1e4)],this['options'],this['viewerParameters']),this['particlesRendering']=new ParticlesRendering(this['context'],this['data'],this[_0x493def(0x285)],this['viewerParameters'],this['particlesComputing']);}['canvasResize'](_0x2a0bf8){const _0x3df7e4=_0x1cfd68;this['particlesComputing']['destroyParticlesTextures'](),Object['keys'](this[_0x3df7e4(0x237)][_0x3df7e4(0x267)])['forEach'](_0x107f8e=>{const _0x1b31e8=_0x3df7e4;this[_0x1b31e8(0x237)]['windTextures'][_0x107f8e][_0x1b31e8(0x262)]();}),this[_0x3df7e4(0x249)]['textures']['colorTable']['destroy'](),Object[_0x3df7e4(0x24b)](this['particlesRendering'][_0x3df7e4(0x268)])['forEach'](_0x5c8d1d=>{this['particlesRendering']['framebuffers'][_0x5c8d1d]['destroy']();}),this['context']=_0x2a0bf8,this['particlesComputing']=new ParticlesComputing(this['context'],this[_0x3df7e4(0x1e4)],this['options'],this[_0x3df7e4(0x1cf)]),this['particlesRendering']=new ParticlesRendering(this['context'],this['data'],this['options'],this[_0x3df7e4(0x1cf)],this['particlesComputing']);}['clearFramebuffers'](){const _0x16addf=_0x1cfd68,_0xb98465=new Cesium$2['ClearCommand']({'color':new Cesium$2['Color'](0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':undefined,'pass':Cesium$2['Pass']['OPAQUE']});Object['keys'](this['particlesRendering'][_0x16addf(0x268)])[_0x16addf(0x1dc)](_0x2a45d1=>{const _0x5100e1=_0x16addf;_0xb98465[_0x5100e1(0x244)]=this['particlesRendering']['framebuffers'][_0x2a45d1],_0xb98465[_0x5100e1(0x1c8)](this['context']);});}[_0x1cfd68(0x228)](_0x331775){const _0x435f6d=_0x1cfd68;this['clearFramebuffers'](),this[_0x435f6d(0x237)]['destroyParticlesTextures'](),this[_0x435f6d(0x237)][_0x435f6d(0x202)](this['context'],this['options'],this['viewerParameters']);if(_0x331775){const _0x2e2073=this['particlesRendering']['createSegmentsGeometry'](this[_0x435f6d(0x285)]);this['particlesRendering']['primitives'][_0x435f6d(0x1ef)]['geometry']=_0x2e2073;const _0x293cf1=Cesium$2['VertexArray']['fromGeometry']({'context':this['context'],'geometry':_0x2e2073,'attributeLocations':this[_0x435f6d(0x249)]['primitives']['segments'][_0x435f6d(0x23b)],'bufferUsage':Cesium$2[_0x435f6d(0x1ea)]['STATIC_DRAW']});this['particlesRendering']['primitives'][_0x435f6d(0x1ef)][_0x435f6d(0x1f0)]['vertexArray']=_0x293cf1;}}['setOptions'](_0x15d271){const _0x2b8a3a=_0x1cfd68;let _0x50ba50=![];this['options']['maxParticles']!==_0x15d271['maxParticles']&&(_0x50ba50=!![]),Object[_0x2b8a3a(0x24b)](_0x15d271)['forEach'](_0x5c6a71=>{this['options'][_0x5c6a71]=_0x15d271[_0x5c6a71];}),this[_0x2b8a3a(0x228)](_0x50ba50);}['applyViewerParameters'](_0x42c61d){Object['keys'](_0x42c61d)['forEach'](_0x4cbaba=>{const _0x5dfa7f=_0x3da3;this[_0x5dfa7f(0x1cf)][_0x4cbaba]=_0x42c61d[_0x4cbaba];}),this['refreshParticles'](![]);}['destroy'](){const _0x5c53d8=_0x1cfd68;clearTimeout(this[_0x5c53d8(0x280)]),this['particlesComputing']['destroyParticlesTextures'](),Object['keys'](this['particlesComputing'][_0x5c53d8(0x267)])['forEach'](_0x12d69f=>{const _0x4a5694=_0x5c53d8;this['particlesComputing'][_0x4a5694(0x267)][_0x12d69f]['destroy']();}),this[_0x5c53d8(0x249)]['textures']['colorTable']['destroy'](),Object['keys'](this['particlesRendering']['framebuffers'])['forEach'](_0x35748a=>{const _0x50075d=_0x5c53d8;this[_0x50075d(0x249)][_0x50075d(0x268)][_0x35748a]['destroy']();});for(const _0x584c23 in this){delete this[_0x584c23];}}}const Cesium$1=mars3d__namespace[_0x1cfd68(0x233)],BaseLayer$1=mars3d__namespace[_0x1cfd68(0x27a)]['BaseLayer'],DEF_OPTIONS={'particlesNumber':0x1000,'fixedHeight':0x0,'fadeOpacity':0.996,'dropRate':0.003,'dropRateBump':0.01,'speedFactor':0.5,'lineWidth':0x2,'colors':['rgb(206,255,255)']};class WindLayer extends BaseLayer$1{constructor(_0x10280c={}){_0x10280c={...DEF_OPTIONS,..._0x10280c},super(_0x10280c),this['_setOptionsHook'](_0x10280c);}get['layer'](){const _0x1aa379=_0x1cfd68;return this[_0x1aa379(0x1d2)];}get['data'](){return this['_data'];}set['data'](_0x292123){this['setData'](_0x292123);}get['colors'](){return this['options']['colors'];}set['colors'](_0x64b6ab){const _0x5baee3=_0x1cfd68;this['options'][_0x5baee3(0x1d1)]=_0x64b6ab,this['particleSystem']&&this['particleSystem']['setOptions']({'colors':_0x64b6ab}),this['resize']();}['_mountedHook'](){}[_0x1cfd68(0x215)](){const _0x5ef30a=_0x1cfd68;this[_0x5ef30a(0x2ab)]=this[_0x5ef30a(0x20f)][_0x5ef30a(0x2ab)],this['camera']=this['_map'][_0x5ef30a(0x211)],this[_0x5ef30a(0x1d2)]=new Cesium$1[(_0x5ef30a(0x1ee))](),this[_0x5ef30a(0x20f)][_0x5ef30a(0x2ab)]['primitives']['add'](this['primitives']),this['viewerParameters']={'lonRange':new Cesium$1['Cartesian2'](),'latRange':new Cesium$1['Cartesian2'](),'pixelSize':0x0},this[_0x5ef30a(0x1d0)]=new Cesium$1['BoundingSphere'](Cesium$1[_0x5ef30a(0x246)]['ZERO'],0.99*0x615299),this[_0x5ef30a(0x1d4)](),window['addEventListener']('resize',this[_0x5ef30a(0x20d)]['bind'](this),![]),this['mouse_down']=![],this['mouse_move']=![],this[_0x5ef30a(0x20f)]['on'](mars3d__namespace['EventType']['wheel'],this[_0x5ef30a(0x1cb)],this),this[_0x5ef30a(0x20f)]['on'](mars3d__namespace[_0x5ef30a(0x205)]['mouseDown'],this['_onMouseDownEvent'],this),this['_map']['on'](mars3d__namespace[_0x5ef30a(0x205)]['mouseUp'],this['_onMouseUpEvent'],this),this[_0x5ef30a(0x20f)]['on'](mars3d__namespace[_0x5ef30a(0x205)][_0x5ef30a(0x2a9)],this['_onMouseMoveEvent'],this),this[_0x5ef30a(0x277)]&&this[_0x5ef30a(0x1df)](this['_data']);}['_removedHook'](){const _0x1973ae=_0x1cfd68;window[_0x1973ae(0x284)]('resize',this['resize']),this['_map']['off'](mars3d__namespace['EventType']['preRender'],this[_0x1973ae(0x282)],this),this['_map']['off'](mars3d__namespace['EventType'][_0x1973ae(0x23f)],this['_onMapWhellEvent'],this),this['_map']['off'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this[_0x1973ae(0x20f)]['off'](mars3d__namespace['EventType']['mouseUp'],this['_onMouseUpEvent'],this),this['_map']['off'](mars3d__namespace['EventType']['mouseMove'],this[_0x1973ae(0x1d3)],this),this[_0x1973ae(0x1d2)][_0x1973ae(0x2a6)](),this['_map']['scene']['primitives']['remove'](this['primitives']);}['resize'](){const _0x3e55fb=_0x1cfd68;if(!this['show']||!this[_0x3e55fb(0x2a3)])return;this['primitives']['show']=![],this[_0x3e55fb(0x1d2)]['removeAll'](),this[_0x3e55fb(0x20f)]['once'](mars3d__namespace['EventType']['preRender'],this['_onMap_preRenderEvent'],this);}['_onMap_preRenderEvent'](_0x22cf67){const _0x179bf2=_0x1cfd68;this['particleSystem']['canvasResize'](this[_0x179bf2(0x2ab)]['context']),this['addPrimitives'](),this['primitives'][_0x179bf2(0x26f)]=!![];}['_onMapWhellEvent'](_0x3e8180){const _0x1c547e=_0x1cfd68;clearTimeout(this['refreshTimer']);if(!this['show']||!this['particleSystem'])return;this['primitives']['show']=![],this[_0x1c547e(0x210)]=setTimeout(()=>{if(!this['show'])return;this['redraw']();},0xc8);}['_onMouseDownEvent'](_0x142821){this['mouse_down']=!![];}[_0x1cfd68(0x1d3)](_0x480494){const _0x16c46f=_0x1cfd68;if(!this['show']||!this[_0x16c46f(0x2a3)])return;this['mouse_down']&&(this['primitives']['show']=![],this[_0x16c46f(0x242)]=!![]);}['_onMouseUpEvent'](_0x244cd6){const _0xa52282=_0x1cfd68;if(!this['show']||!this['particleSystem'])return;this['mouse_down']&&this['mouse_move']&&this['redraw'](),this['primitives'][_0xa52282(0x26f)]=!![],this['mouse_down']=![],this['mouse_move']=![];}['redraw'](){const _0x17fed5=_0x1cfd68;if(!this['_map']||!this[_0x17fed5(0x26f)])return;this['updateViewerParameters'](),this['particleSystem']['applyViewerParameters'](this['viewerParameters']),this[_0x17fed5(0x1d2)][_0x17fed5(0x26f)]=!![];}[_0x1cfd68(0x1df)](_0x395743){const _0x12f4e3=_0x1cfd68;this['_data']=_0x395743,this[_0x12f4e3(0x2a3)]&&this[_0x12f4e3(0x2a3)][_0x12f4e3(0x262)](),this[_0x12f4e3(0x2a3)]=new ParticleSystem(this['scene']['context'],_0x395743,this['getOptions'](),this['viewerParameters']),this['addPrimitives']();}['_setOptionsHook'](_0x2f9af4,_0x10362d){const _0x1f0a8e=_0x1cfd68;if(_0x2f9af4)for(const _0x88f948 in _0x2f9af4){this[_0x88f948]=_0x2f9af4[_0x88f948];}this['particleSystem']&&this['particleSystem']['setOptions'](this[_0x1f0a8e(0x1e9)]());}[_0x1cfd68(0x1e9)](){const _0x45866b=_0x1cfd68,_0x32ea51=Math[_0x45866b(0x22c)](Math['sqrt'](this[_0x45866b(0x20e)]));return this[_0x45866b(0x20e)]=_0x32ea51*_0x32ea51,{'particlesTextureSize':_0x32ea51,'maxParticles':this[_0x45866b(0x20e)],'particleHeight':this['fixedHeight'],'fadeOpacity':this['fadeOpacity'],'dropRate':this['dropRate'],'dropRateBump':this['dropRateBump'],'speedFactor':this['speedFactor'],'lineWidth':this['lineWidth'],'colors':this[_0x45866b(0x1d1)]};}['addPrimitives'](){const _0x449c00=_0x1cfd68;this['primitives'][_0x449c00(0x1e3)](this['particleSystem']['particlesComputing']['primitives']['getWind']),this['primitives']['add'](this['particleSystem']['particlesComputing']['primitives']['updateSpeed']),this[_0x449c00(0x1d2)][_0x449c00(0x1e3)](this[_0x449c00(0x2a3)]['particlesComputing'][_0x449c00(0x1d2)][_0x449c00(0x226)]),this[_0x449c00(0x1d2)]['add'](this[_0x449c00(0x2a3)]['particlesComputing']['primitives']['postProcessingPosition']),this['primitives'][_0x449c00(0x1e3)](this[_0x449c00(0x2a3)][_0x449c00(0x237)]['primitives']['postProcessingSpeed']),this['primitives']['add'](this[_0x449c00(0x2a3)][_0x449c00(0x249)]['primitives']['segments']),this['primitives'][_0x449c00(0x1e3)](this['particleSystem']['particlesRendering']['primitives']['trails']),this[_0x449c00(0x1d2)][_0x449c00(0x1e3)](this['particleSystem'][_0x449c00(0x249)]['primitives']['screen']);}['updateViewerParameters'](){const _0x29aa97=_0x1cfd68;let _0x3b8e5=this['camera']['computeViewRectangle'](this[_0x29aa97(0x2ab)][_0x29aa97(0x287)][_0x29aa97(0x1cd)]);if(!_0x3b8e5){const _0x347a48=this[_0x29aa97(0x20f)][_0x29aa97(0x21f)]();_0x3b8e5=Cesium$1[_0x29aa97(0x20a)]['fromDegrees'](_0x347a48['xmin'],_0x347a48[_0x29aa97(0x241)],_0x347a48[_0x29aa97(0x230)],_0x347a48[_0x29aa97(0x1e1)]);}const _0x525c8f=Util['viewRectangleToLonLatRange'](_0x3b8e5);this['viewerParameters']['lonRange']['x']=_0x525c8f['lon']['min'],this[_0x29aa97(0x1cf)]['lonRange']['y']=_0x525c8f['lon'][_0x29aa97(0x275)],this['viewerParameters']['latRange']['x']=_0x525c8f['lat']['min'],this[_0x29aa97(0x1cf)]['latRange']['y']=_0x525c8f['lat']['max'];const _0x1e24af=this['camera']['getPixelSize'](this['globeBoundingSphere'],this['scene']['drawingBufferWidth'],this['scene'][_0x29aa97(0x2b8)]);_0x1e24af>0x0&&(this[_0x29aa97(0x1cf)]['pixelSize']=_0x1e24af);}}mars3d__namespace['LayerUtil'][_0x1cfd68(0x256)]('wind',WindLayer),mars3d__namespace['layer']['WindLayer']=WindLayer;class CanvasParticle{constructor(){const _0x5b88bb=_0x1cfd68;this['lng']=null,this['lat']=null,this['tlng']=null,this['tlat']=null,this[_0x5b88bb(0x243)]=null;}['destroy'](){for(const _0x288cad in this){delete this[_0x288cad];}}}class CanvasWindField{constructor(_0x58e5fa){this['setOptions'](_0x58e5fa);}get['speedRate'](){return this['_speedRate'];}set[_0x1cfd68(0x258)](_0x1422c2){const _0x3c46de=_0x1cfd68;this[_0x3c46de(0x200)]=(0x64-(_0x1422c2>0x63?0x63:_0x1422c2))*0x64,this['_calc_speedRate']=[(this[_0x3c46de(0x230)]-this['xmin'])/this['_speedRate'],(this['ymax']-this[_0x3c46de(0x241)])/this['_speedRate']];}get['maxAge'](){const _0x21d4fb=_0x1cfd68;return this[_0x21d4fb(0x276)];}set['maxAge'](_0x3304a8){const _0x3264b9=_0x1cfd68;this[_0x3264b9(0x276)]=_0x3304a8;}['setOptions'](_0x1569e5){const _0x2385ca=_0x1cfd68;this['options']=_0x1569e5,this['maxAge']=_0x1569e5['maxAge']||0x78,this[_0x2385ca(0x258)]=_0x1569e5['speedRate']||0x32,this['particles']=[];const _0x3fea80=_0x1569e5['particlesNumber']||0x1000;for(let _0x17b10e=0x0;_0x17b10e<_0x3fea80;_0x17b10e++){const _0x5d3aa7=this['_randomParticle'](new CanvasParticle());this['particles'][_0x2385ca(0x29a)](_0x5d3aa7);}}['setDate'](_0x4ef9ff){const _0x14a59b=_0x1cfd68;this[_0x14a59b(0x2aa)]=_0x4ef9ff['rows'],this[_0x14a59b(0x24a)]=_0x4ef9ff[_0x14a59b(0x24a)],this[_0x14a59b(0x2a5)]=_0x4ef9ff['xmin'],this[_0x14a59b(0x230)]=_0x4ef9ff['xmax'],this['ymin']=_0x4ef9ff['ymin'],this[_0x14a59b(0x1e1)]=_0x4ef9ff['ymax'],this[_0x14a59b(0x28a)]=[];const _0x5b6f48=_0x4ef9ff['udata'],_0x58a136=_0x4ef9ff[_0x14a59b(0x229)];let _0x6ec77a=![];_0x5b6f48[_0x14a59b(0x29f)]===this['rows']&&_0x5b6f48[0x0]['length']===this['cols']&&(_0x6ec77a=!![]);let _0x96c225=0x0,_0xa4e51d=null,_0x328502=null;for(let _0x505dd6=0x0;_0x505dd6=this[_0x3eb208(0x24a)]||_0x3a4ff2>=this['rows'])return[0x0,0x0,0x0];const _0x304fc7=Math['floor'](_0x153be8),_0x523fc4=Math[_0x3eb208(0x288)](_0x3a4ff2);if(_0x304fc7===_0x153be8&&_0x523fc4===_0x3a4ff2)return this['grid'][_0x3a4ff2][_0x153be8];const _0x478407=_0x304fc7+0x1,_0x25b688=_0x523fc4+0x1,_0x215c0e=this['getUVByXY'](_0x304fc7,_0x523fc4),_0x1d85b5=this[_0x3eb208(0x232)](_0x478407,_0x523fc4),_0x15e495=this['getUVByXY'](_0x304fc7,_0x25b688),_0x2d12f7=this[_0x3eb208(0x232)](_0x478407,_0x25b688);let _0x144758=null;try{_0x144758=this['_bilinearInterpolation'](_0x153be8-_0x304fc7,_0x3a4ff2-_0x523fc4,_0x215c0e,_0x1d85b5,_0x15e495,_0x2d12f7);}catch(_0x5100fd){console[_0x3eb208(0x218)](_0x153be8,_0x3a4ff2);}return _0x144758;}['_bilinearInterpolation'](_0x1bf4ff,_0x5ec473,_0x3e69d9,_0x41cd80,_0x3d1aab,_0x25d92a){const _0x5e9815=0x1-_0x1bf4ff,_0x18a7ec=0x1-_0x5ec473,_0x2ed75e=_0x5e9815*_0x18a7ec,_0xf87211=_0x1bf4ff*_0x18a7ec,_0x38cc76=_0x5e9815*_0x5ec473,_0x532ef4=_0x1bf4ff*_0x5ec473,_0xf59e23=_0x3e69d9[0x0]*_0x2ed75e+_0x41cd80[0x0]*_0xf87211+_0x3d1aab[0x0]*_0x38cc76+_0x25d92a[0x0]*_0x532ef4,_0x2d2781=_0x3e69d9[0x1]*_0x2ed75e+_0x41cd80[0x1]*_0xf87211+_0x3d1aab[0x1]*_0x38cc76+_0x25d92a[0x1]*_0x532ef4;return this['_calcUV'](_0xf59e23,_0x2d2781);}[_0x1cfd68(0x225)](_0x438c0f,_0x4cf77e){return[+_0x438c0f,+_0x4cf77e,Math['sqrt'](_0x438c0f*_0x438c0f+_0x4cf77e*_0x4cf77e)];}[_0x1cfd68(0x28c)](_0x12f019,_0x44d5bd){const _0x47c8cc=_0x1cfd68;if(!this['isInExtent'](_0x12f019,_0x44d5bd))return null;const _0x29ae96=this[_0x47c8cc(0x2af)](_0x12f019,_0x44d5bd),_0x4a5e03=this['getUVByXY'](_0x29ae96[0x0],_0x29ae96[0x1]);return _0x4a5e03;}[_0x1cfd68(0x2b5)](_0x243e70,_0x17b3a8){const _0x3a4b01=_0x1cfd68;return _0x243e70>=this['xmin']&&_0x243e70<=this['xmax']&&_0x17b3a8>=this['ymin']&&_0x17b3a8<=this[_0x3a4b01(0x1e1)]?!![]:![];}['getRandomLatLng'](){const _0x30dd04=_0x1cfd68,_0x1d639e=fRandomByfloat(this[_0x30dd04(0x2a5)],this[_0x30dd04(0x230)]),_0x53373e=fRandomByfloat(this['ymin'],this[_0x30dd04(0x1e1)]);return{'lat':_0x53373e,'lng':_0x1d639e};}[_0x1cfd68(0x24c)](){const _0x27c132=_0x1cfd68;let _0x151aa3,_0x19a86b,_0x182b83;for(let _0x5cbc5f=0x0,_0x3b16c6=this['particles']['length'];_0x5cbc5f<_0x3b16c6;_0x5cbc5f++){let _0x532957=this[_0x27c132(0x297)][_0x5cbc5f];_0x532957[_0x27c132(0x243)]<=0x0&&(_0x532957=this['_randomParticle'](_0x532957));if(_0x532957[_0x27c132(0x243)]>0x0){const _0x3944f5=_0x532957['tlng'],_0x34afe7=_0x532957[_0x27c132(0x252)];_0x182b83=this['getUVByPoint'](_0x3944f5,_0x34afe7),_0x182b83?(_0x151aa3=_0x3944f5+this[_0x27c132(0x204)][0x0]*_0x182b83[0x0],_0x19a86b=_0x34afe7+this['_calc_speedRate'][0x1]*_0x182b83[0x1],_0x532957['lng']=_0x3944f5,_0x532957['lat']=_0x34afe7,_0x532957['tlng']=_0x151aa3,_0x532957[_0x27c132(0x252)]=_0x19a86b,_0x532957['age']--):_0x532957['age']=0x0;}}return this[_0x27c132(0x297)];}['_randomParticle'](_0x3bcb9e){const _0x627ec7=_0x1cfd68;let _0x2a80ba,_0xb129b0;for(let _0x55ef9e=0x0;_0x55ef9e<0x1e;_0x55ef9e++){_0x2a80ba=this['getRandomLatLng'](),_0xb129b0=this[_0x627ec7(0x28c)](_0x2a80ba[_0x627ec7(0x278)],_0x2a80ba['lat']);if(_0xb129b0&&_0xb129b0[0x2]>0x0)break;}if(!_0xb129b0)return _0x3bcb9e;const _0x982af=_0x2a80ba['lng']+this['_calc_speedRate'][0x0]*_0xb129b0[0x0],_0x483541=_0x2a80ba['lat']+this[_0x627ec7(0x204)][0x1]*_0xb129b0[0x1];return _0x3bcb9e['lng']=_0x2a80ba['lng'],_0x3bcb9e['lat']=_0x2a80ba['lat'],_0x3bcb9e[_0x627ec7(0x299)]=_0x982af,_0x3bcb9e['tlat']=_0x483541,_0x3bcb9e['age']=Math[_0x627ec7(0x206)](Math[_0x627ec7(0x1f8)]()*this[_0x627ec7(0x271)]),_0x3bcb9e;}[_0x1cfd68(0x262)](){for(const _0x849360 in this){delete this[_0x849360];}}}function fRandomByfloat(_0x487b8b,_0x45d812){return _0x487b8b+Math['random']()*(_0x45d812-_0x487b8b);}const Cesium=mars3d__namespace[_0x1cfd68(0x233)],BaseLayer=mars3d__namespace['layer'][_0x1cfd68(0x1f9)];class CanvasWindLayer extends BaseLayer{constructor(_0x2c6900={}){const _0x228612=_0x1cfd68;super(_0x2c6900),this['_setOptionsHook'](_0x2c6900),this[_0x228612(0x255)]=null;}['_setOptionsHook'](_0x509af6,_0x2ee9b6){const _0xa4405f=_0x1cfd68;this[_0xa4405f(0x2bc)]=0x3e8/(_0x509af6[_0xa4405f(0x1c7)]||0xa),this[_0xa4405f(0x1e6)]=this[_0xa4405f(0x285)]['pointerEvents']??![],this['color']=_0x509af6['color']||_0xa4405f(0x2bd),this['lineWidth']=_0x509af6['lineWidth']||0x1,this[_0xa4405f(0x290)]=_0x509af6['fixedHeight']??0x0,this['reverseY']=_0x509af6[_0xa4405f(0x1ca)]??![],this[_0xa4405f(0x295)]&&this[_0xa4405f(0x295)]['setOptions'](_0x509af6);}get['layer'](){return this['canvas'];}get['canvasWidth'](){return this['_map']['scene']['canvas']['clientWidth'];}get['canvasHeight'](){const _0x2f3487=_0x1cfd68;return this[_0x2f3487(0x20f)]['scene']['canvas']['clientHeight'];}get['pointerEvents'](){return this['_pointerEvents'];}set['pointerEvents'](_0xc7562f){const _0x4a5f56=_0x1cfd68;this['_pointerEvents']=_0xc7562f;if(!this[_0x4a5f56(0x255)])return;_0xc7562f?this['canvas']['style']['pointer-events']=_0x4a5f56(0x292):this['canvas'][_0x4a5f56(0x259)]['pointer-events']='none';}get['particlesNumber'](){return this['options']['particlesNumber'];}set['particlesNumber'](_0x564cf7){this['options']['particlesNumber']=_0x564cf7,clearTimeout(this['_canrefresh']),this['_canrefresh']=setTimeout(()=>{this['redraw']();},0x1f4);}get['speedRate'](){return this['options']['speedRate'];}set['speedRate'](_0x4f9ddb){this['options']['speedRate']=_0x4f9ddb,this['windField']&&(this['windField']['speedRate']=_0x4f9ddb);}get[_0x1cfd68(0x271)](){const _0x42a2f9=_0x1cfd68;return this[_0x42a2f9(0x285)]['maxAge'];}set['maxAge'](_0x5ad36e){const _0x49fda4=_0x1cfd68;this['options']['maxAge']=_0x5ad36e,this[_0x49fda4(0x295)]&&(this['windField']['maxAge']=_0x5ad36e);}get['data'](){return this['windData'];}set['data'](_0x27bf2f){this['setData'](_0x27bf2f);}['_showHook'](_0x1fd1fc){const _0x392242=_0x1cfd68;_0x1fd1fc?this['_addedHook']():(this[_0x392242(0x24d)]&&(this['options'][_0x392242(0x1e4)]=this['windData']),this['_removedHook']());}[_0x1cfd68(0x2b0)](){this['options']['worker']?this['initWorker']():this['windField']=new CanvasWindField(this['options']);}[_0x1cfd68(0x215)](){const _0x47d9a6=_0x1cfd68;this['canvas']=this['_createCanvas'](),this[_0x47d9a6(0x21d)]=this['canvas']['getContext']('2d',{'willReadFrequently':!![]}),this['bindEvent'](),this['options']['data']&&this[_0x47d9a6(0x1df)](this['options']['data']);}['_removedHook'](){const _0x2c856a=_0x1cfd68;this['clear'](),this['unbindEvent'](),this['canvas']&&(this['_map']['container']['removeChild'](this[_0x2c856a(0x255)]),delete this['canvas']);}['_createCanvas'](){const _0x956f4b=_0x1cfd68,_0x5e0ccc=mars3d__namespace[_0x956f4b(0x223)]['create'](_0x956f4b(0x255),'mars3d-canvasWind',this['_map']['container']);return _0x5e0ccc['style'][_0x956f4b(0x219)]='absolute',_0x5e0ccc[_0x956f4b(0x259)][_0x956f4b(0x25c)]='0px',_0x5e0ccc['style']['left']=_0x956f4b(0x212),_0x5e0ccc['style']['width']=this['_map']['scene']['canvas']['clientWidth']+'px',_0x5e0ccc['style'][_0x956f4b(0x216)]=this['_map'][_0x956f4b(0x2ab)]['canvas']['clientHeight']+'px',_0x5e0ccc[_0x956f4b(0x259)]['pointerEvents']=this[_0x956f4b(0x1e6)]?'auto':_0x956f4b(0x25f),_0x5e0ccc['style']['zIndex']=this['options']['zIndex']??0x9,_0x5e0ccc['width']=this['_map'][_0x956f4b(0x2ab)]['canvas']['clientWidth'],_0x5e0ccc['height']=this['_map'][_0x956f4b(0x2ab)]['canvas'][_0x956f4b(0x2b1)],_0x5e0ccc;}[_0x1cfd68(0x20d)](){const _0x3bc310=_0x1cfd68;this[_0x3bc310(0x255)]&&(this['canvas']['style']['width']=this['_map'][_0x3bc310(0x2ab)][_0x3bc310(0x255)][_0x3bc310(0x1e2)]+'px',this['canvas'][_0x3bc310(0x259)]['height']=this[_0x3bc310(0x20f)]['scene']['canvas'][_0x3bc310(0x2b1)]+'px',this['canvas'][_0x3bc310(0x1dd)]=this['_map'][_0x3bc310(0x2ab)][_0x3bc310(0x255)]['clientWidth'],this['canvas'][_0x3bc310(0x216)]=this[_0x3bc310(0x20f)]['scene'][_0x3bc310(0x255)]['clientHeight']);}['bindEvent'](){const _0x669afe=_0x1cfd68,_0x254091=this;let _0x4527a3=Date['now']();(function _0x8119e1(){const _0x2c29be=_0x3da3;_0x254091['animateFrame']=window['requestAnimationFrame'](_0x8119e1);if(_0x254091['show']&&_0x254091['windField']){const _0x220027=Date['now'](),_0x58e460=_0x220027-_0x4527a3;_0x58e460>_0x254091['frameTime']&&(_0x4527a3=_0x220027-_0x58e460%_0x254091['frameTime'],_0x254091[_0x2c29be(0x21b)]());}}(),window[_0x669afe(0x296)]('resize',this['resize']['bind'](this),![]),this['mouse_down']=![],this['mouse_move']=![],this[_0x669afe(0x285)]['mouseHidden']&&(this[_0x669afe(0x20f)]['on'](mars3d__namespace[_0x669afe(0x205)]['wheel'],this['_onMapWhellEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseUp'],this['_onMouseUpEvent'],this)));}['unbindEvent'](){const _0x53b27d=_0x1cfd68;window['cancelAnimationFrame'](this['animateFrame']),delete this[_0x53b27d(0x1f4)],window['removeEventListener'](_0x53b27d(0x20d),this['resize']),this[_0x53b27d(0x285)][_0x53b27d(0x1c9)]&&(this['_map']['off'](mars3d__namespace['EventType']['wheel'],this['_onMapWhellEvent'],this),this[_0x53b27d(0x20f)]['off'](mars3d__namespace['EventType']['mouseDown'],this[_0x53b27d(0x248)],this),this[_0x53b27d(0x20f)]['off'](mars3d__namespace['EventType'][_0x53b27d(0x203)],this['_onMouseUpEvent'],this),this[_0x53b27d(0x20f)][_0x53b27d(0x20c)](mars3d__namespace['EventType'][_0x53b27d(0x2a9)],this['_onMouseMoveEvent'],this));}['_onMapWhellEvent'](_0x14b507){const _0x4bb1f8=_0x1cfd68;clearTimeout(this[_0x4bb1f8(0x210)]);if(!this[_0x4bb1f8(0x26f)]||!this['canvas'])return;this['canvas']['style'][_0x4bb1f8(0x272)]='hidden',this['refreshTimer']=setTimeout(()=>{const _0x19557b=_0x4bb1f8;if(!this['show'])return;this['redraw'](),this['canvas'][_0x19557b(0x259)][_0x19557b(0x272)]='visible';},0xc8);}[_0x1cfd68(0x248)](_0x27f00b){const _0x24912b=_0x1cfd68;this[_0x24912b(0x291)]=!![],this['_map']['off'](mars3d__namespace[_0x24912b(0x205)]['mouseMove'],this['_onMouseMoveEvent'],this),this[_0x24912b(0x20f)]['on'](mars3d__namespace['EventType'][_0x24912b(0x2a9)],this['_onMouseMoveEvent'],this);}['_onMouseMoveEvent'](_0x1718e1){const _0x2b999b=_0x1cfd68;if(!this[_0x2b999b(0x26f)]||!this[_0x2b999b(0x255)])return;this['mouse_down']&&(this[_0x2b999b(0x255)]['style']['visibility']='hidden',this[_0x2b999b(0x242)]=!![]);}[_0x1cfd68(0x21e)](_0x34fef7){const _0x2df0c9=_0x1cfd68;if(!this['show']||!this['canvas'])return;this['_map']['off'](mars3d__namespace['EventType']['mouseMove'],this[_0x2df0c9(0x1d3)],this),this['mouse_down']&&this[_0x2df0c9(0x242)]&&this['redraw'](),this['canvas']['style']['visibility']='visible',this[_0x2df0c9(0x291)]=![],this[_0x2df0c9(0x242)]=![];}['setData'](_0x495710){const _0x2feb79=_0x1cfd68;this[_0x2feb79(0x22d)](),this['windData']=_0x495710,this[_0x2feb79(0x295)]['setDate'](_0x495710),this['redraw']();}['redraw'](){const _0x2d68e3=_0x1cfd68;if(!this['show'])return;this[_0x2d68e3(0x295)][_0x2d68e3(0x239)](this['options']),this['update']();}['update'](){const _0xfebca8=_0x1cfd68;if(this['_updateIng'])return;this['_updateIng']=!![];if(this['worker'])this['windField']['update']();else{const _0x12173f=this['windField']['getParticles']();this[_0xfebca8(0x247)](_0x12173f);}this['_updateIng']=![];}['_drawLines'](_0x8fd8bd){const _0x38c0df=_0x1cfd68;this['canvasContext']['globalCompositeOperation']=_0x38c0df(0x298),this[_0x38c0df(0x21d)]['fillRect'](0x0,0x0,this[_0x38c0df(0x235)],this['canvasHeight']),this['canvasContext']['globalCompositeOperation']='lighter',this['canvasContext'][_0x38c0df(0x27c)]=0.9,this['canvasContext']['beginPath'](),this['canvasContext']['lineWidth']=this['lineWidth'],this['canvasContext']['strokeStyle']=this['color'];const _0x1047cd=this['_map'][_0x38c0df(0x2ab)]['mode']!==Cesium['SceneMode']['SCENE3D'],_0x3475ca=this[_0x38c0df(0x235)]*0.25;for(let _0x5c477d=0x0,_0x1a92f0=_0x8fd8bd['length'];_0x5c477d<_0x1a92f0;_0x5c477d++){const _0x4bbed7=_0x8fd8bd[_0x5c477d],_0x4d802f=this['_tomap'](_0x4bbed7['lng'],_0x4bbed7['lat'],_0x4bbed7),_0x305c45=this[_0x38c0df(0x279)](_0x4bbed7[_0x38c0df(0x299)],_0x4bbed7['tlat'],_0x4bbed7);if(!_0x4d802f||!_0x305c45)continue;if(_0x1047cd&&Math['abs'](_0x4d802f[0x0]-_0x305c45[0x0])>=_0x3475ca)continue;this[_0x38c0df(0x21d)][_0x38c0df(0x2b2)](_0x4d802f[0x0],_0x4d802f[0x1]),this[_0x38c0df(0x21d)]['lineTo'](_0x305c45[0x0],_0x305c45[0x1]);}this[_0x38c0df(0x21d)]['stroke']();}[_0x1cfd68(0x279)](_0x13c2bf,_0x3877f9,_0x28cd3d){const _0x492181=_0x1cfd68,_0x526717=Cesium['Cartesian3'][_0x492181(0x250)](_0x13c2bf,_0x3877f9,this['fixedHeight']),_0x5804af=this[_0x492181(0x20f)][_0x492181(0x2ab)];if(_0x5804af[_0x492181(0x26e)]===Cesium[_0x492181(0x2b3)][_0x492181(0x2b4)]){const _0x327302=new Cesium['EllipsoidalOccluder'](_0x5804af['globe']['ellipsoid'],_0x5804af['camera']['positionWC']),_0x3b9581=_0x327302[_0x492181(0x253)](_0x526717);if(!_0x3b9581)return _0x28cd3d[_0x492181(0x243)]=0x0,null;}const _0x14c458=Cesium['SceneTransforms']['wgs84ToWindowCoordinates'](this[_0x492181(0x20f)]['scene'],_0x526717);return _0x14c458?[_0x14c458['x'],_0x14c458['y']]:null;}['clear'](){const _0x21cc9b=_0x1cfd68;this[_0x21cc9b(0x295)]['clear'](),delete this['windData'];}[_0x1cfd68(0x27b)](){const _0x431c15=_0x1cfd68;this['worker']=new Worker(this['options'][_0x431c15(0x251)]),this['worker']['onmessage']=_0x211e9b=>{const _0x110335=_0x431c15;this[_0x110335(0x247)](_0x211e9b['data']['particles']),this['_updateIng2']=![];},this[_0x431c15(0x295)]={'init':_0x1f748c=>{const _0x2d1772=_0x431c15;this[_0x2d1772(0x251)]['postMessage']({'type':'init','options':_0x1f748c});},'setOptions':_0x1d767a=>{this['worker']['postMessage']({'type':'setOptions','options':_0x1d767a});},'setDate':_0x539517=>{this['worker']['postMessage']({'type':'setDate','data':_0x539517});},'update':()=>{const _0x205ea4=_0x431c15;if(this['_updateIng2'])return;this['_updateIng2']=!![],this['worker'][_0x205ea4(0x217)]({'type':'update'});},'clear':()=>{const _0x494477=_0x431c15;this[_0x494477(0x251)][_0x494477(0x217)]({'type':'clear'});}},this['windField'][_0x431c15(0x269)](this['options']);}}function _0x4ab3(){const _0x519098=['mouseMove','rows','scene','OPAQUE','toDegrees','8nPMxve','toGridXY','_mountedHook','clientHeight','moveTo','SceneMode','SCENE3D','isInExtent','pow','Geometry','drawingBufferHeight','createFramebuffer','udata','lat','frameTime','#ffffff','createWindTextures','rawRenderState','frameRate','execute','mouseHidden','reverseY','_onMapWhellEvent','PI_OVER_TWO','ellipsoid','depthTexture','viewerParameters','globeBoundingSphere','colors','primitives','_onMouseMoveEvent','updateViewerParameters','IDENTITY','WindUtil','TWO_PI','nextTrailsDepth','vertexArray','TextureMinificationFilter','RGBA','forEach','width','getOwnPropertyDescriptor','setData','cos','ymax','clientWidth','add','data','particlesTextures','_pointerEvents','PrimitiveType','trails','getOptions','BufferUsage','context','6lHWNZL','currentTrails','PrimitiveCollection','segments','commandToExecute','214442IycGym','createRenderingFramebuffers','colorTable','animateFrame','postProcessingPosition','PixelFormat','outputTexture','random','BaseLayer','GeometryAttribute','3gyDNNK','__esModule','createCommand','in\x20vec3\x20position;\x0ain\x20vec2\x20st;\x0a\x0aout\x20vec2\x20textureCoordinate;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20textureCoordinate\x20=\x20st;\x0a\x20\x20\x20\x20gl_Position\x20=\x20vec4(position,\x201.0);\x0a}\x0a','1767370oYyTbx','_speedRate','segmentsColor','createParticlesTextures','mouseUp','_calc_speedRate','EventType','round','clearCommand','vmin','in\x20vec2\x20st;\x0a//\x20it\x20is\x20not\x20normal\x20itself,\x20but\x20used\x20to\x20control\x20normal\x0ain\x20vec3\x20normal;\x20//\x20(point\x20to\x20use,\x20offset\x20sign,\x20not\x20used\x20component)\x0a\x0auniform\x20sampler2D\x20currentParticlesPosition;\x0auniform\x20sampler2D\x20postProcessingPosition;\x0auniform\x20sampler2D\x20postProcessingSpeed;\x0a\x0auniform\x20float\x20particleHeight;\x0a\x0auniform\x20float\x20aspect;\x0auniform\x20float\x20pixelSize;\x0auniform\x20float\x20lineWidth;\x0a\x0aout\x20float\x20speedNormalization;\x0a\x0avec3\x20convertCoordinate(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20WGS84\x20(lon,\x20lat,\x20lev)\x20->\x20ECEF\x20(x,\x20y,\x20z)\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20WGS\x2084\x20geometric\x20constants\x0a\x20\x20\x20\x20float\x20a\x20=\x206378137.0;\x20//\x20Semi-major\x20axis\x0a\x20\x20\x20\x20float\x20b\x20=\x206356752.3142;\x20//\x20Semi-minor\x20axis\x0a\x20\x20\x20\x20float\x20e2\x20=\x206.69437999014e-3;\x20//\x20First\x20eccentricity\x20squared\x0a\x0a\x20\x20\x20\x20float\x20latitude\x20=\x20radians(lonLatLev.y);\x0a\x20\x20\x20\x20float\x20longitude\x20=\x20radians(lonLatLev.x);\x0a\x0a\x20\x20\x20\x20float\x20cosLat\x20=\x20cos(latitude);\x0a\x20\x20\x20\x20float\x20sinLat\x20=\x20sin(latitude);\x0a\x20\x20\x20\x20float\x20cosLon\x20=\x20cos(longitude);\x0a\x20\x20\x20\x20float\x20sinLon\x20=\x20sin(longitude);\x0a\x0a\x20\x20\x20\x20float\x20N_Phi\x20=\x20a\x20/\x20sqrt(1.0\x20-\x20e2\x20*\x20sinLat\x20*\x20sinLat);\x0a\x20\x20\x20\x20float\x20h\x20=\x20particleHeight;\x20//\x20it\x20should\x20be\x20high\x20enough\x20otherwise\x20the\x20particle\x20may\x20not\x20pass\x20the\x20terrain\x20depth\x20test\x0a\x0a\x20\x20\x20\x20vec3\x20cartesian\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20cartesian.x\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20cosLon;\x0a\x20\x20\x20\x20cartesian.y\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20sinLon;\x0a\x20\x20\x20\x20cartesian.z\x20=\x20((b\x20*\x20b)\x20/\x20(a\x20*\x20a)\x20*\x20N_Phi\x20+\x20h)\x20*\x20sinLat;\x0a\x20\x20\x20\x20return\x20cartesian;\x0a}\x0a\x0avec4\x20calcProjectedCoordinate(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20the\x20range\x20of\x20longitude\x20in\x20Cesium\x20is\x20[-180,\x20180]\x20but\x20the\x20range\x20of\x20longitude\x20in\x20the\x20NetCDF\x20file\x20is\x20[0,\x20360]\x0a\x20\x20\x20\x20//\x20[0,\x20180]\x20is\x20corresponding\x20to\x20[0,\x20180]\x20and\x20[180,\x20360]\x20is\x20corresponding\x20to\x20[-180,\x200]\x0a\x20\x20\x20\x20lonLatLev.x\x20=\x20mod(lonLatLev.x\x20+\x20180.0,\x20360.0)\x20-\x20180.0;\x0a\x20\x20\x20\x20vec3\x20particlePosition\x20=\x20convertCoordinate(lonLatLev);\x0a\x20\x20\x20\x20vec4\x20projectedCoordinate\x20=\x20czm_modelViewProjection\x20*\x20vec4(particlePosition,\x201.0);\x0a\x20\x20\x20\x20return\x20projectedCoordinate;\x0a}\x0a\x0avec4\x20calcOffset(vec4\x20currentProjectedCoordinate,\x20vec4\x20nextProjectedCoordinate,\x20float\x20offsetSign)\x20{\x0a\x20\x20\x20\x20vec2\x20aspectVec2\x20=\x20vec2(aspect,\x201.0);\x0a\x20\x20\x20\x20vec2\x20currentXY\x20=\x20(currentProjectedCoordinate.xy\x20/\x20currentProjectedCoordinate.w)\x20*\x20aspectVec2;\x0a\x20\x20\x20\x20vec2\x20nextXY\x20=\x20(nextProjectedCoordinate.xy\x20/\x20nextProjectedCoordinate.w)\x20*\x20aspectVec2;\x0a\x0a\x20\x20\x20\x20float\x20offsetLength\x20=\x20lineWidth\x20/\x202.0;\x0a\x20\x20\x20\x20vec2\x20direction\x20=\x20normalize(nextXY\x20-\x20currentXY);\x0a\x20\x20\x20\x20vec2\x20normalVector\x20=\x20vec2(-direction.y,\x20direction.x);\x0a\x20\x20\x20\x20normalVector.x\x20=\x20normalVector.x\x20/\x20aspect;\x0a\x20\x20\x20\x20normalVector\x20=\x20offsetLength\x20*\x20normalVector;\x0a\x0a\x20\x20\x20\x20vec4\x20offset\x20=\x20vec4(offsetSign\x20*\x20normalVector,\x200.0,\x200.0);\x0a\x20\x20\x20\x20return\x20offset;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec2\x20particleIndex\x20=\x20st;\x0a\x0a\x20\x20\x20\x20vec3\x20currentPosition\x20=\x20texture(currentParticlesPosition,\x20particleIndex).rgb;\x0a\x20\x20\x20\x20vec4\x20nextPosition\x20=\x20texture(postProcessingPosition,\x20particleIndex);\x0a\x0a\x20\x20\x20\x20vec4\x20currentProjectedCoordinate\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20vec4\x20nextProjectedCoordinate\x20=\x20vec4(0.0);\x0a\x20\x20\x20\x20if\x20(nextPosition.w\x20>\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20currentProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20\x20\x20\x20\x20nextProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20currentProjectedCoordinate\x20=\x20calcProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20\x20\x20\x20\x20nextProjectedCoordinate\x20=\x20calcProjectedCoordinate(nextPosition.xyz);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20pointToUse\x20=\x20normal.x;\x20//\x20-1\x20is\x20currentProjectedCoordinate\x20and\x20+1\x20is\x20nextProjectedCoordinate\x0a\x20\x20\x20\x20float\x20offsetSign\x20=\x20normal.y;\x0a\x0a\x20\x20\x20\x20vec4\x20offset\x20=\x20pixelSize\x20*\x20calcOffset(currentProjectedCoordinate,\x20nextProjectedCoordinate,\x20offsetSign);\x0a\x20\x20\x20\x20if\x20(pointToUse\x20<\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20currentProjectedCoordinate\x20+\x20offset;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20gl_Position\x20=\x20nextProjectedCoordinate\x20+\x20offset;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20speedNormalization\x20=\x20texture(postProcessingSpeed,\x20particleIndex).a;\x0a}\x0a','Rectangle','ComponentDatatype','off','resize','particlesNumber','_map','refreshTimer','camera','0px','nextTrails','latRange','_addedHook','height','postMessage','log','position','Math','update','createRawRenderState','canvasContext','_onMouseUpEvent','getExtent','commandList','nextParticlesSpeed','createRenderingTextures','DomUtil','FLOAT','_calcUV','updatePosition','uniform\x20sampler2D\x20nextParticlesPosition;\x0auniform\x20sampler2D\x20nextParticlesSpeed;\x20//\x20(u,\x20v,\x20w,\x20normalization)\x0a\x0a//\x20range\x20(min,\x20max)\x0auniform\x20vec2\x20lonRange;\x0auniform\x20vec2\x20latRange;\x0a\x0auniform\x20float\x20randomCoefficient;\x20//\x20use\x20to\x20improve\x20the\x20pseudo-random\x20generator\x0auniform\x20float\x20dropRate;\x20//\x20drop\x20rate\x20is\x20a\x20chance\x20a\x20particle\x20will\x20restart\x20at\x20random\x20position\x20to\x20avoid\x20degeneration\x0auniform\x20float\x20dropRateBump;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0a//\x20pseudo-random\x20generator\x0aconst\x20vec3\x20randomConstants\x20=\x20vec3(12.9898,\x2078.233,\x204375.85453);\x0aconst\x20vec2\x20normalRange\x20=\x20vec2(0.0,\x201.0);\x0afloat\x20rand(vec2\x20seed,\x20vec2\x20range)\x20{\x0a\x20\x20\x20\x20vec2\x20randomSeed\x20=\x20randomCoefficient\x20*\x20seed;\x0a\x20\x20\x20\x20float\x20temp\x20=\x20dot(randomConstants.xy,\x20randomSeed);\x0a\x20\x20\x20\x20temp\x20=\x20fract(sin(temp)\x20*\x20(randomConstants.z\x20+\x20temp));\x0a\x20\x20\x20\x20return\x20temp\x20*\x20(range.y\x20-\x20range.x)\x20+\x20range.x;\x0a}\x0a\x0avec3\x20generateRandomParticle(vec2\x20seed,\x20float\x20lev)\x20{\x0a\x20\x20\x20\x20//\x20ensure\x20the\x20longitude\x20is\x20in\x20[0,\x20360]\x0a\x20\x20\x20\x20float\x20randomLon\x20=\x20mod(rand(seed,\x20lonRange),\x20360.0);\x0a\x20\x20\x20\x20float\x20randomLat\x20=\x20rand(-seed,\x20latRange);\x0a\x0a\x20\x20\x20\x20return\x20vec3(randomLon,\x20randomLat,\x20lev);\x0a}\x0a\x0abool\x20particleOutbound(vec3\x20particle)\x20{\x0a\x20\x20\x20\x20return\x20particle.y\x20<\x20-90.0\x20||\x20particle.y\x20>\x2090.0;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec3\x20nextParticle\x20=\x20texture(nextParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec4\x20nextSpeed\x20=\x20texture(nextParticlesSpeed,\x20v_textureCoordinates);\x0a\x20\x20\x20\x20float\x20particleDropRate\x20=\x20dropRate\x20+\x20dropRateBump\x20*\x20nextSpeed.a;\x0a\x0a\x20\x20\x20\x20vec2\x20seed1\x20=\x20nextParticle.xy\x20+\x20v_textureCoordinates;\x0a\x20\x20\x20\x20vec2\x20seed2\x20=\x20nextSpeed.xy\x20+\x20v_textureCoordinates;\x0a\x20\x20\x20\x20vec3\x20randomParticle\x20=\x20generateRandomParticle(seed1,\x20nextParticle.z);\x0a\x20\x20\x20\x20float\x20randomNumber\x20=\x20rand(seed2,\x20normalRange);\x0a\x0a\x20\x20\x20\x20if\x20(randomNumber\x20<\x20particleDropRate\x20||\x20particleOutbound(nextParticle))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(randomParticle,\x201.0);\x20//\x201.0\x20means\x20this\x20is\x20a\x20random\x20particle\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20out_FragColor\x20=\x20vec4(nextParticle,\x200.0);\x0a\x20\x20\x20\x20}\x0a}\x0a','refreshParticles','vdata','VertexArray','DEPTH_COMPONENT','ceil','clear','currentParticlesPosition','south','xmax','randomizeParticles','getUVByXY','Cesium','lon','canvasWidth','getWind','particlesComputing','Compute','setOptions','textures','attributeLocations','currentTrailsDepth','800254cGognA','dropRate','wheel','levmin','ymin','mouse_move','age','framebuffer','NEAREST','Cartesian3','_drawLines','_onMouseDownEvent','particlesRendering','cols','keys','getParticles','windData','destroyParticlesTextures','Color','fromDegrees','worker','tlat','isPointVisible','createComputingPrimitives','canvas','register','TextureMagnificationFilter','speedRate','style','preExecute','898344iqcBEW','top','postProcessingSpeed','defined','none','createSegmentsGeometry','Draw','destroy','min','2UFvPHY','default','Sampler','windTextures','framebuffers','init','Cartesian2','lev','ShaderProgram','fromGeometry','mode','show','drawingBufferWidth','maxAge','visibility','Texture','geometry','max','_maxAge','_data','lng','_tomap','layer','initWorker','globalAlpha','particlesWind','395037VfhXdd','ShaderSource','canrefresh','RGB','_onMap_preRenderEvent','384ncOVjr','removeEventListener','options','createTexture','globe','floor','vertexShaderSource','grid','updateSpeed','getUVByPoint','uniformMap','currentParticlesSpeed','LayerUtil','fixedHeight','mouse_down','all','nextParticlesPosition','lineWidth','windField','addEventListener','particles','destination-in','tlng','push','fromCache','58102UdjMCv','fragmentShaderSource','blending','length','172185DAMSfY','Framebuffer','primitiveType','particleSystem','getDefaultRenderState','xmin','removeAll','//\x20the\x20size\x20of\x20UV\x20textures:\x20width\x20=\x20lon,\x20height\x20=\x20lat*lev\x0auniform\x20sampler2D\x20U;\x20//\x20eastward\x20wind\x0auniform\x20sampler2D\x20V;\x20//\x20northward\x20wind\x0a\x0auniform\x20sampler2D\x20currentParticlesPosition;\x20//\x20(lon,\x20lat,\x20lev)\x0a\x0auniform\x20vec3\x20dimension;\x20//\x20(lon,\x20lat,\x20lev)\x0auniform\x20vec3\x20minimum;\x20//\x20minimum\x20of\x20each\x20dimension\x0auniform\x20vec3\x20maximum;\x20//\x20maximum\x20of\x20each\x20dimension\x0auniform\x20vec3\x20interval;\x20//\x20interval\x20of\x20each\x20dimension\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec2\x20mapPositionToNormalizedIndex2D(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20ensure\x20the\x20range\x20of\x20longitude\x20and\x20latitude\x0a\x20\x20\x20\x20lonLatLev.x\x20=\x20mod(lonLatLev.x,\x20360.0);\x0a\x20\x20\x20\x20lonLatLev.y\x20=\x20clamp(lonLatLev.y,\x20-90.0,\x2090.0);\x0a\x0a\x20\x20\x20\x20vec3\x20index3D\x20=\x20vec3(0.0);\x0a\x20\x20\x20\x20index3D.x\x20=\x20(lonLatLev.x\x20-\x20minimum.x)\x20/\x20interval.x;\x0a\x20\x20\x20\x20index3D.y\x20=\x20(lonLatLev.y\x20-\x20minimum.y)\x20/\x20interval.y;\x0a\x20\x20\x20\x20index3D.z\x20=\x20(lonLatLev.z\x20-\x20minimum.z)\x20/\x20interval.z;\x0a\x0a\x20\x20\x20\x20//\x20the\x20st\x20texture\x20coordinate\x20corresponding\x20to\x20(col,\x20row)\x20index\x0a\x20\x20\x20\x20//\x20example\x0a\x20\x20\x20\x20//\x20data\x20array\x20is\x20[0,\x201,\x202,\x203,\x204,\x205],\x20width\x20=\x203,\x20height\x20=\x202\x0a\x20\x20\x20\x20//\x20the\x20content\x20of\x20texture\x20will\x20be\x0a\x20\x20\x20\x20//\x20t\x201.0\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x20\x203\x204\x205\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x0a\x20\x20\x20\x20//\x20\x20\x20\x20|\x20\x200\x201\x202\x0a\x20\x20\x20\x20//\x20\x20\x200.0------1.0\x20s\x0a\x0a\x20\x20\x20\x20vec2\x20index2D\x20=\x20vec2(index3D.x,\x20index3D.z\x20*\x20dimension.y\x20+\x20index3D.y);\x0a\x20\x20\x20\x20vec2\x20normalizedIndex2D\x20=\x20vec2(index2D.x\x20/\x20dimension.x,\x20index2D.y\x20/\x20(dimension.y\x20*\x20dimension.z));\x0a\x20\x20\x20\x20return\x20normalizedIndex2D;\x0a}\x0a\x0afloat\x20getWind(sampler2D\x20windTexture,\x20vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20vec2\x20normalizedIndex2D\x20=\x20mapPositionToNormalizedIndex2D(lonLatLev);\x0a\x20\x20\x20\x20float\x20result\x20=\x20texture(windTexture,\x20normalizedIndex2D).r;\x0a\x20\x20\x20\x20return\x20result;\x0a}\x0a\x0aconst\x20mat4\x20kernelMatrix\x20=\x20mat4(\x0a\x20\x20\x20\x200.0,\x20-1.0,\x202.0,\x20-1.0,\x20//\x20first\x20column\x0a\x20\x20\x20\x202.0,\x200.0,\x20-5.0,\x203.0,\x20//\x20second\x20column\x0a\x20\x20\x20\x200.0,\x201.0,\x204.0,\x20-3.0,\x20//\x20third\x20column\x0a\x20\x20\x20\x200.0,\x200.0,\x20-1.0,\x201.0\x20//\x20fourth\x20column\x0a);\x0afloat\x20oneDimensionInterpolation(float\x20t,\x20float\x20p0,\x20float\x20p1,\x20float\x20p2,\x20float\x20p3)\x20{\x0a\x20\x20\x20\x20vec4\x20tVec4\x20=\x20vec4(1.0,\x20t,\x20t\x20*\x20t,\x20t\x20*\x20t\x20*\x20t);\x0a\x20\x20\x20\x20tVec4\x20=\x20tVec4\x20/\x202.0;\x0a\x20\x20\x20\x20vec4\x20pVec4\x20=\x20vec4(p0,\x20p1,\x20p2,\x20p3);\x0a\x20\x20\x20\x20return\x20dot((tVec4\x20*\x20kernelMatrix),\x20pVec4);\x0a}\x0a\x0afloat\x20calculateB(sampler2D\x20windTexture,\x20float\x20t,\x20float\x20lon,\x20float\x20lat,\x20float\x20lev)\x20{\x0a\x20\x20\x20\x20float\x20lon0\x20=\x20floor(lon)\x20-\x201.0\x20*\x20interval.x;\x0a\x20\x20\x20\x20float\x20lon1\x20=\x20floor(lon);\x0a\x20\x20\x20\x20float\x20lon2\x20=\x20floor(lon)\x20+\x201.0\x20*\x20interval.x;\x0a\x20\x20\x20\x20float\x20lon3\x20=\x20floor(lon)\x20+\x202.0\x20*\x20interval.x;\x0a\x0a\x20\x20\x20\x20float\x20p0\x20=\x20getWind(windTexture,\x20vec3(lon0,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p1\x20=\x20getWind(windTexture,\x20vec3(lon1,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p2\x20=\x20getWind(windTexture,\x20vec3(lon2,\x20lat,\x20lev));\x0a\x20\x20\x20\x20float\x20p3\x20=\x20getWind(windTexture,\x20vec3(lon3,\x20lat,\x20lev));\x0a\x0a\x20\x20\x20\x20return\x20oneDimensionInterpolation(t,\x20p0,\x20p1,\x20p2,\x20p3);\x0a}\x0a\x0afloat\x20interpolateOneTexture(sampler2D\x20windTexture,\x20vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20float\x20lon\x20=\x20lonLatLev.x;\x0a\x20\x20\x20\x20float\x20lat\x20=\x20lonLatLev.y;\x0a\x20\x20\x20\x20float\x20lev\x20=\x20lonLatLev.z;\x0a\x0a\x20\x20\x20\x20float\x20lat0\x20=\x20floor(lat)\x20-\x201.0\x20*\x20interval.y;\x0a\x20\x20\x20\x20float\x20lat1\x20=\x20floor(lat);\x0a\x20\x20\x20\x20float\x20lat2\x20=\x20floor(lat)\x20+\x201.0\x20*\x20interval.y;\x0a\x20\x20\x20\x20float\x20lat3\x20=\x20floor(lat)\x20+\x202.0\x20*\x20interval.y;\x0a\x0a\x20\x20\x20\x20vec2\x20coefficient\x20=\x20lonLatLev.xy\x20-\x20floor(lonLatLev.xy);\x0a\x20\x20\x20\x20float\x20b0\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat0,\x20lev);\x0a\x20\x20\x20\x20float\x20b1\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat1,\x20lev);\x0a\x20\x20\x20\x20float\x20b2\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat2,\x20lev);\x0a\x20\x20\x20\x20float\x20b3\x20=\x20calculateB(windTexture,\x20coefficient.x,\x20lon,\x20lat3,\x20lev);\x0a\x0a\x20\x20\x20\x20return\x20oneDimensionInterpolation(coefficient.y,\x20b0,\x20b1,\x20b2,\x20b3);\x0a}\x0a\x0avec3\x20bicubic(vec3\x20lonLatLev)\x20{\x0a\x20\x20\x20\x20//\x20https://en.wikipedia.org/wiki/Bicubic_interpolation#Bicubic_convolution_algorithm\x0a\x20\x20\x20\x20float\x20u\x20=\x20interpolateOneTexture(U,\x20lonLatLev);\x0a\x20\x20\x20\x20float\x20v\x20=\x20interpolateOneTexture(V,\x20lonLatLev);\x0a\x20\x20\x20\x20float\x20w\x20=\x200.0;\x0a\x20\x20\x20\x20return\x20vec3(u,\x20v,\x20w);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20\x20\x20vec3\x20lonLatLev\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rgb;\x0a\x20\x20\x20\x20vec3\x20windVector\x20=\x20bicubic(lonLatLev);\x0a\x20\x20\x20\x20out_FragColor\x20=\x20vec4(windVector,\x200.0);\x0a}\x0a','dimensions'];_0x4ab3=function(){return _0x519098;};return _0x4ab3();}mars3d__namespace[_0x1cfd68(0x28f)]['register']('canvasWind',CanvasWindLayer),mars3d__namespace[_0x1cfd68(0x27a)]['CanvasWindLayer']=CanvasWindLayer,mars3d__namespace['CanvasWindField']=CanvasWindField,mars3d__namespace[_0x1cfd68(0x1d6)]=WindUtil,exports['CanvasWindField']=CanvasWindField,exports['CanvasWindLayer']=CanvasWindLayer,exports['WindLayer']=WindLayer,exports['WindUtil']=WindUtil,Object['defineProperty'](exports,'__esModule',{'value':!![]}); })); diff --git a/public/lib/mars3d/thirdParty/meshVisualizer/CesiumMeshVisualizer.js b/public/lib/mars3d/thirdParty/meshVisualizer/CesiumMeshVisualizer.js index d67e8472..b65d91ee 100644 --- a/public/lib/mars3d/thirdParty/meshVisualizer/CesiumMeshVisualizer.js +++ b/public/lib/mars3d/thirdParty/meshVisualizer/CesiumMeshVisualizer.js @@ -2210,7 +2210,7 @@ define('Core/GeometryUtils',[ *@return {Boolean} */ GeometryUtils.isGeometry3js = function (geometry) { - return (typeof THREE !== 'undefined' && (geometry instanceof THREE.Geometry || geometry instanceof THREE.BufferGeometry)) + return (typeof THREE !== 'undefined' && (geometry instanceof THREE.BufferGeometry || geometry instanceof THREE.BufferGeometry)) || (geometry.attributes && geometry.attributes.position && geometry.index) || (geometry.vertices && geometry.faces); } @@ -2266,7 +2266,7 @@ define('Core/GeometryUtils',[ /** * - *@param {THREE.Geometry}geometry3js + *@param {THREE.BufferGeometry}geometry3js *@return {Cesium.Geometry} */ GeometryUtils.fromGeometry3js = function (geometry3js) { @@ -2313,7 +2313,7 @@ define('Core/GeometryUtils',[ /** * *@param {Cesium.Geometry}geometry - *@return {THREE.Geometry} + *@return {THREE.BufferGeometry} */ GeometryUtils.toGeometry3js = function (geometry) { if (typeof THREE === 'undefined') { @@ -2323,7 +2323,7 @@ define('Core/GeometryUtils',[ var positions = geometry.attributes.position.values; var positionIdx = 0; - var geometry3js = new THREE.Geometry(); + var geometry3js = new THREE.BufferGeometry(); for (var i = 0; i < positions.length ; i += 3) { positionIdx = i * 3; @@ -2343,13 +2343,13 @@ define('Core/GeometryUtils',[ } /** - *@param {Cesium.Geometry|THREE.Geometry} + *@param {Cesium.Geometry|THREE.BufferGeometry} *@param {Cesium.Cartesian3}[offset] *@return {CSG} */ GeometryUtils.toCSG = function (geometry, offset) { if (!(typeof THREE === 'undefined')) { - if (geometry instanceof THREE.Geometry) { + if (geometry instanceof THREE.BufferGeometry) { return GeometryUtils._toCSG3js(geometry, offset); } } @@ -2406,11 +2406,11 @@ define('Core/GeometryUtils',[ /** *@param {CSG}csg_model *@param {Boolean}[toGeometry3js=false] - *@return {Cesium.Geometry|THREE.Geometry} + *@return {Cesium.Geometry|THREE.BufferGeometry} */ GeometryUtils.fromCSG = function (csg_model, toGeometry3js) { if (!(typeof THREE === 'undefined')) { - if (geometry instanceof THREE.Geometry) { + if (geometry instanceof THREE.BufferGeometry) { return GeometryUtils._fromCSG3js(geometry, offset); } } @@ -2481,7 +2481,7 @@ define('Core/GeometryUtils',[ geometry = three_model.geometry; offset = offset || three_model.position; rotation = rotation || three_model.rotation; - } else if (three_model instanceof THREE.Geometry) { + } else if (three_model instanceof THREE.BufferGeometry) { geometry = three_model; offset = offset || new THREE.Vector3(0, 0, 0); rotation = rotation || new THREE.Euler(0, 0, 0); @@ -2527,7 +2527,7 @@ define('Core/GeometryUtils',[ throw new Error("THREE 未加载"); } var i, j, vertices, face, - three_geometry = new THREE.Geometry(), + three_geometry = new THREE.BufferGeometry(), polygons = csg_model.toPolygons(); if (!CSG) { @@ -2678,7 +2678,7 @@ define('Core/Mesh',[ /** * *@param {Object|geometry}options - *@param {Cesium.Geometry|Cesium.CSG|THREE.Geometry|THREE.BufferGeometry}options.geometry + *@param {Cesium.Geometry|Cesium.CSG|THREE.BufferGeometry|THREE.BufferGeometry}options.geometry *@param {Cesium.MeshMaterial}options.material *@param {Boolean}[options.show=true] *@param {Cesium.Cartesian3}[options.position] diff --git a/public/lib/mars3d/thirdParty/meshVisualizer/README.md b/public/lib/mars3d/thirdParty/meshVisualizer/README.md index ea9bb264..35cd8e27 100644 --- a/public/lib/mars3d/thirdParty/meshVisualizer/README.md +++ b/public/lib/mars3d/thirdParty/meshVisualizer/README.md @@ -1,16 +1,16 @@ -#Cesium 功能扩展插件 - -说明: 对Threejs 和 于ammo.js物理引擎相关整合 - - -github地址:https://github.com/MikesWei/CesiumMeshVisualizer - - -主要功能: -1、不直接支持threejs的mesh,但是支持Threejs的Geometry和BufferGeometry来构建几何体。内置了Threejs Geometry、BufferGeometry到Cesium.Geometry的转换接口,同时提供Cesium.Geometry到Threejs BufferGeometry的转换接口。这些接口由GeometryUtils类提供。 -2、定义Mesh,支持Cesium.Geometry、THREE.Geometry、THREE.BufferGeometry以及CSG运算结果模型。 -3、更方便的动态渲染和管理。同一个mesh,可以单独修改mesh的位置(position)、缩放(scale)、旋转角度(rotation/Quaternion)等属性;也可以单独修改 geometry和material;同一个geometry可以单独修改各个属性和索引。方便管理,且减少对象的局部变化带来的整个drawCommand重新构建次数,以期在更多动态渲染 对象同时改变的情况下(比如结合物理引擎做模拟),仍然保持较高的帧率,当然也牺牲了一定的内存。 -4、定义MeshMaterial,目的是更方便的引用Threejs圈的那些炫酷特效Shader,减少整合所需的代码量。尤其是Cesium的Appearance从fragmentShader中分离出Material部分的Shader,并且作用域不一样之后,带来好多不便,引入网上那些炫酷特效Shader的时候真是头疼死了,谁做过谁才解其中味~ MeshMaterial区别于Cesium的Material,更像Threejs的Material,但不完全是。。。好像有点四不像~ -5、定义FramebufferTexture,启发于Threejs的RenderTarget,暂且叫帧缓存纹理类吧,反正名字不重要~ MeshVisualizer和MeshMaterial一起支持此类纹 理,就当是普通的一张图片纹理就好了。它的用处就是,把Mesh渲染到帧缓存中,作为纹理参与其他Mesh的渲染。可以参考VolumeRendering示例。另外RendererUtils 提供了一个单次执行渲染到纹理的接口RendererUtils.renderToTexture。在不使用MeshVisualizer的时候,也就是自己基于drawCommand自定义一个Primitive的时 候也可以用得上。 -6、整合CSG.js,支持使用Cesium.Geometry、THREE.Geometry、THREE.BufferGeometry做交、并、补等运算,并提供将运算结果CSG对象转成Cesium.Geometry、THREE.Geometry的接口。参考CSG示例。 -7、提供基于ammo.js物理引擎的示例,示例源码源于Threejs,使用MeshVisualizer,可以在更少的代码修改情况下完成迁移整合,甚合我意。 \ No newline at end of file +#Cesium 功能扩展插件 + +说明: 对Threejs 和 于ammo.js物理引擎相关整合 + + +github地址:https://github.com/MikesWei/CesiumMeshVisualizer + + +主要功能: +1、不直接支持threejs的mesh,但是支持Threejs的Geometry和BufferGeometry来构建几何体。内置了Threejs Geometry、BufferGeometry到Cesium.Geometry的转换接口,同时提供Cesium.Geometry到Threejs BufferGeometry的转换接口。这些接口由GeometryUtils类提供。 +2、定义Mesh,支持Cesium.Geometry、THREE.BufferGeometry、THREE.BufferGeometry以及CSG运算结果模型。 +3、更方便的动态渲染和管理。同一个mesh,可以单独修改mesh的位置(position)、缩放(scale)、旋转角度(rotation/Quaternion)等属性;也可以单独修改 geometry和material;同一个geometry可以单独修改各个属性和索引。方便管理,且减少对象的局部变化带来的整个drawCommand重新构建次数,以期在更多动态渲染 对象同时改变的情况下(比如结合物理引擎做模拟),仍然保持较高的帧率,当然也牺牲了一定的内存。 +4、定义MeshMaterial,目的是更方便的引用Threejs圈的那些炫酷特效Shader,减少整合所需的代码量。尤其是Cesium的Appearance从fragmentShader中分离出Material部分的Shader,并且作用域不一样之后,带来好多不便,引入网上那些炫酷特效Shader的时候真是头疼死了,谁做过谁才解其中味~ MeshMaterial区别于Cesium的Material,更像Threejs的Material,但不完全是。。。好像有点四不像~ +5、定义FramebufferTexture,启发于Threejs的RenderTarget,暂且叫帧缓存纹理类吧,反正名字不重要~ MeshVisualizer和MeshMaterial一起支持此类纹 理,就当是普通的一张图片纹理就好了。它的用处就是,把Mesh渲染到帧缓存中,作为纹理参与其他Mesh的渲染。可以参考VolumeRendering示例。另外RendererUtils 提供了一个单次执行渲染到纹理的接口RendererUtils.renderToTexture。在不使用MeshVisualizer的时候,也就是自己基于drawCommand自定义一个Primitive的时 候也可以用得上。 +6、整合CSG.js,支持使用Cesium.Geometry、THREE.BufferGeometry、THREE.BufferGeometry做交、并、补等运算,并提供将运算结果CSG对象转成Cesium.Geometry、THREE.Geometry的接口。参考CSG示例。 +7、提供基于ammo.js物理引擎的示例,示例源码源于Threejs,使用MeshVisualizer,可以在更少的代码修改情况下完成迁移整合,甚合我意。 diff --git a/public/lib/three/README.md b/public/lib/three/README.md new file mode 100644 index 00000000..e85c41a0 --- /dev/null +++ b/public/lib/three/README.md @@ -0,0 +1,6 @@ +# threejs 三维场景渲染 + +版本号:r 153 npm可用 "three": "0.153.0", + + +搜 REVISION diff --git a/public/lib/three/three.js b/public/lib/three/three.js index aa81ee53..c17e94bd 100644 --- a/public/lib/three/three.js +++ b/public/lib/three/three.js @@ -1,573 +1,708 @@ +console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/Installation' ); +/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.THREE = global.THREE || {}))); -}(this, (function (exports) { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {})); +})(this, (function (exports) { 'use strict'; + + const REVISION = '153'; + + const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; + const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; + const CullFaceNone = 0; + const CullFaceBack = 1; + const CullFaceFront = 2; + const CullFaceFrontBack = 3; + const BasicShadowMap = 0; + const PCFShadowMap = 1; + const PCFSoftShadowMap = 2; + const VSMShadowMap = 3; + const FrontSide = 0; + const BackSide = 1; + const DoubleSide = 2; + const TwoPassDoubleSide = 2; // r149 + const NoBlending = 0; + const NormalBlending = 1; + const AdditiveBlending = 2; + const SubtractiveBlending = 3; + const MultiplyBlending = 4; + const CustomBlending = 5; + const AddEquation = 100; + const SubtractEquation = 101; + const ReverseSubtractEquation = 102; + const MinEquation = 103; + const MaxEquation = 104; + const ZeroFactor = 200; + const OneFactor = 201; + const SrcColorFactor = 202; + const OneMinusSrcColorFactor = 203; + const SrcAlphaFactor = 204; + const OneMinusSrcAlphaFactor = 205; + const DstAlphaFactor = 206; + const OneMinusDstAlphaFactor = 207; + const DstColorFactor = 208; + const OneMinusDstColorFactor = 209; + const SrcAlphaSaturateFactor = 210; + const NeverDepth = 0; + const AlwaysDepth = 1; + const LessDepth = 2; + const LessEqualDepth = 3; + const EqualDepth = 4; + const GreaterEqualDepth = 5; + const GreaterDepth = 6; + const NotEqualDepth = 7; + const MultiplyOperation = 0; + const MixOperation = 1; + const AddOperation = 2; + const NoToneMapping = 0; + const LinearToneMapping = 1; + const ReinhardToneMapping = 2; + const CineonToneMapping = 3; + const ACESFilmicToneMapping = 4; + const CustomToneMapping = 5; + + const UVMapping = 300; + const CubeReflectionMapping = 301; + const CubeRefractionMapping = 302; + const EquirectangularReflectionMapping = 303; + const EquirectangularRefractionMapping = 304; + const CubeUVReflectionMapping = 306; + const RepeatWrapping = 1000; + const ClampToEdgeWrapping = 1001; + const MirroredRepeatWrapping = 1002; + const NearestFilter = 1003; + const NearestMipmapNearestFilter = 1004; + const NearestMipMapNearestFilter = 1004; + const NearestMipmapLinearFilter = 1005; + const NearestMipMapLinearFilter = 1005; + const LinearFilter = 1006; + const LinearMipmapNearestFilter = 1007; + const LinearMipMapNearestFilter = 1007; + const LinearMipmapLinearFilter = 1008; + const LinearMipMapLinearFilter = 1008; + const UnsignedByteType = 1009; + const ByteType = 1010; + const ShortType = 1011; + const UnsignedShortType = 1012; + const IntType = 1013; + const UnsignedIntType = 1014; + const FloatType = 1015; + const HalfFloatType = 1016; + const UnsignedShort4444Type = 1017; + const UnsignedShort5551Type = 1018; + const UnsignedInt248Type = 1020; + const AlphaFormat = 1021; + const RGBAFormat = 1023; + const LuminanceFormat = 1024; + const LuminanceAlphaFormat = 1025; + const DepthFormat = 1026; + const DepthStencilFormat = 1027; + const RedFormat = 1028; + const RedIntegerFormat = 1029; + const RGFormat = 1030; + const RGIntegerFormat = 1031; + const RGBAIntegerFormat = 1033; + + const RGB_S3TC_DXT1_Format = 33776; + const RGBA_S3TC_DXT1_Format = 33777; + const RGBA_S3TC_DXT3_Format = 33778; + const RGBA_S3TC_DXT5_Format = 33779; + const RGB_PVRTC_4BPPV1_Format = 35840; + const RGB_PVRTC_2BPPV1_Format = 35841; + const RGBA_PVRTC_4BPPV1_Format = 35842; + const RGBA_PVRTC_2BPPV1_Format = 35843; + const RGB_ETC1_Format = 36196; + const RGB_ETC2_Format = 37492; + const RGBA_ETC2_EAC_Format = 37496; + const RGBA_ASTC_4x4_Format = 37808; + const RGBA_ASTC_5x4_Format = 37809; + const RGBA_ASTC_5x5_Format = 37810; + const RGBA_ASTC_6x5_Format = 37811; + const RGBA_ASTC_6x6_Format = 37812; + const RGBA_ASTC_8x5_Format = 37813; + const RGBA_ASTC_8x6_Format = 37814; + const RGBA_ASTC_8x8_Format = 37815; + const RGBA_ASTC_10x5_Format = 37816; + const RGBA_ASTC_10x6_Format = 37817; + const RGBA_ASTC_10x8_Format = 37818; + const RGBA_ASTC_10x10_Format = 37819; + const RGBA_ASTC_12x10_Format = 37820; + const RGBA_ASTC_12x12_Format = 37821; + const RGBA_BPTC_Format = 36492; + const RED_RGTC1_Format = 36283; + const SIGNED_RED_RGTC1_Format = 36284; + const RED_GREEN_RGTC2_Format = 36285; + const SIGNED_RED_GREEN_RGTC2_Format = 36286; + const LoopOnce = 2200; + const LoopRepeat = 2201; + const LoopPingPong = 2202; + const InterpolateDiscrete = 2300; + const InterpolateLinear = 2301; + const InterpolateSmooth = 2302; + const ZeroCurvatureEnding = 2400; + const ZeroSlopeEnding = 2401; + const WrapAroundEnding = 2402; + const NormalAnimationBlendMode = 2500; + const AdditiveAnimationBlendMode = 2501; + const TrianglesDrawMode = 0; + const TriangleStripDrawMode = 1; + const TriangleFanDrawMode = 2; + /** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */ + const LinearEncoding = 3000; + /** @deprecated Use SRGBColorSpace in three.js r152+. */ + const sRGBEncoding = 3001; + const BasicDepthPacking = 3200; + const RGBADepthPacking = 3201; + const TangentSpaceNormalMap = 0; + const ObjectSpaceNormalMap = 1; + + // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available. + const NoColorSpace = ''; + const SRGBColorSpace = 'srgb'; + const LinearSRGBColorSpace = 'srgb-linear'; + const DisplayP3ColorSpace = 'display-p3'; + + const ZeroStencilOp = 0; + const KeepStencilOp = 7680; + const ReplaceStencilOp = 7681; + const IncrementStencilOp = 7682; + const DecrementStencilOp = 7683; + const IncrementWrapStencilOp = 34055; + const DecrementWrapStencilOp = 34056; + const InvertStencilOp = 5386; + + const NeverStencilFunc = 512; + const LessStencilFunc = 513; + const EqualStencilFunc = 514; + const LessEqualStencilFunc = 515; + const GreaterStencilFunc = 516; + const NotEqualStencilFunc = 517; + const GreaterEqualStencilFunc = 518; + const AlwaysStencilFunc = 519; + + const NeverCompare = 512; + const LessCompare = 513; + const EqualCompare = 514; + const LessEqualCompare = 515; + const GreaterCompare = 516; + const NotEqualCompare = 517; + const GreaterEqualCompare = 518; + const AlwaysCompare = 519; + + const StaticDrawUsage = 35044; + const DynamicDrawUsage = 35048; + const StreamDrawUsage = 35040; + const StaticReadUsage = 35045; + const DynamicReadUsage = 35049; + const StreamReadUsage = 35041; + const StaticCopyUsage = 35046; + const DynamicCopyUsage = 35050; + const StreamCopyUsage = 35042; + + const GLSL1 = '100'; + const GLSL3 = '300 es'; + + const _SRGBAFormat = 1035; // fallback for WebGL 1 + + const WebGLCoordinateSystem = 2000; + const WebGPUCoordinateSystem = 2001; - // Polyfills + /** + * https://github.com/mrdoob/eventdispatcher.js/ + */ - if ( Number.EPSILON === undefined ) { + class EventDispatcher { - Number.EPSILON = Math.pow( 2, - 52 ); + addEventListener( type, listener ) { - } + if ( this._listeners === undefined ) this._listeners = {}; + + const listeners = this._listeners; - if ( Number.isInteger === undefined ) { + if ( listeners[ type ] === undefined ) { - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger + listeners[ type ] = []; - Number.isInteger = function ( value ) { + } - return typeof value === 'number' && isFinite( value ) && Math.floor( value ) === value; + if ( listeners[ type ].indexOf( listener ) === - 1 ) { - }; + listeners[ type ].push( listener ); - } + } - // + } - if ( Math.sign === undefined ) { + hasEventListener( type, listener ) { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign + if ( this._listeners === undefined ) return false; - Math.sign = function ( x ) { + const listeners = this._listeners; - return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x; + return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; - }; + } - } + removeEventListener( type, listener ) { + + if ( this._listeners === undefined ) return; + + const listeners = this._listeners; + const listenerArray = listeners[ type ]; - if ( Function.prototype.name === undefined ) { + if ( listenerArray !== undefined ) { - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name + const index = listenerArray.indexOf( listener ); - Object.defineProperty( Function.prototype, 'name', { + if ( index !== - 1 ) { - get: function () { + listenerArray.splice( index, 1 ); - return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ]; + } } - } ); + } - } + dispatchEvent( event ) { - if ( Object.assign === undefined ) { + if ( this._listeners === undefined ) return; - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign + const listeners = this._listeners; + const listenerArray = listeners[ event.type ]; - ( function () { + if ( listenerArray !== undefined ) { - Object.assign = function ( target ) { + event.target = this; - 'use strict'; + // Make a copy, in case listeners are removed while iterating. + const array = listenerArray.slice( 0 ); - if ( target === undefined || target === null ) { + for ( let i = 0, l = array.length; i < l; i ++ ) { - throw new TypeError( 'Cannot convert undefined or null to object' ); + array[ i ].call( this, event ); } - var output = Object( target ); + event.target = null; - for ( var index = 1; index < arguments.length; index ++ ) { + } - var source = arguments[ index ]; + } - if ( source !== undefined && source !== null ) { + } - for ( var nextKey in source ) { + const _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' ]; - if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) { + let _seed = 1234567; - output[ nextKey ] = source[ nextKey ]; - } + const DEG2RAD = Math.PI / 180; + const RAD2DEG = 180 / Math.PI; - } + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136 + function generateUUID() { - } + const d0 = Math.random() * 0xffffffff | 0; + const d1 = Math.random() * 0xffffffff | 0; + const d2 = Math.random() * 0xffffffff | 0; + const d3 = Math.random() * 0xffffffff | 0; + const uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' + + _lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' + + _lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] + + _lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ]; - } + // .toLowerCase() here flattens concatenated strings to save heap memory space. + return uuid.toLowerCase(); - return output; + } - }; + function clamp( value, min, max ) { - } )(); + return Math.max( min, Math.min( max, value ) ); } - /** - * https://github.com/mrdoob/eventdispatcher.js/ - */ - - function EventDispatcher() {} + // compute euclidean modulo of m % n + // https://en.wikipedia.org/wiki/Modulo_operation + function euclideanModulo( n, m ) { - Object.assign( EventDispatcher.prototype, { + return ( ( n % m ) + m ) % m; - addEventListener: function ( type, listener ) { + } - if ( this._listeners === undefined ) this._listeners = {}; + // Linear mapping from range to range + function mapLinear( x, a1, a2, b1, b2 ) { - var listeners = this._listeners; + return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); - if ( listeners[ type ] === undefined ) { + } - listeners[ type ] = []; + // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/ + function inverseLerp( x, y, value ) { - } + if ( x !== y ) { - if ( listeners[ type ].indexOf( listener ) === - 1 ) { + return ( value - x ) / ( y - x ); - listeners[ type ].push( listener ); + } else { - } + return 0; - }, + } - hasEventListener: function ( type, listener ) { + } - if ( this._listeners === undefined ) return false; + // https://en.wikipedia.org/wiki/Linear_interpolation + function lerp( x, y, t ) { - var listeners = this._listeners; + return ( 1 - t ) * x + t * y; - return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; + } - }, + // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/ + function damp( x, y, lambda, dt ) { - removeEventListener: function ( type, listener ) { + return lerp( x, y, 1 - Math.exp( - lambda * dt ) ); - if ( this._listeners === undefined ) return; + } - var listeners = this._listeners; - var listenerArray = listeners[ type ]; + // https://www.desmos.com/calculator/vcsjnyz7x4 + function pingpong( x, length = 1 ) { - if ( listenerArray !== undefined ) { + return length - Math.abs( euclideanModulo( x, length * 2 ) - length ); - var index = listenerArray.indexOf( listener ); + } - if ( index !== - 1 ) { + // http://en.wikipedia.org/wiki/Smoothstep + function smoothstep( x, min, max ) { - listenerArray.splice( index, 1 ); + if ( x <= min ) return 0; + if ( x >= max ) return 1; - } + x = ( x - min ) / ( max - min ); - } + return x * x * ( 3 - 2 * x ); - }, + } - dispatchEvent: function ( event ) { + function smootherstep( x, min, max ) { - if ( this._listeners === undefined ) return; + if ( x <= min ) return 0; + if ( x >= max ) return 1; - var listeners = this._listeners; - var listenerArray = listeners[ event.type ]; + x = ( x - min ) / ( max - min ); - if ( listenerArray !== undefined ) { + return x * x * x * ( x * ( x * 6 - 15 ) + 10 ); - event.target = this; + } - var array = listenerArray.slice( 0 ); + // Random integer from interval + function randInt( low, high ) { - for ( var i = 0, l = array.length; i < l; i ++ ) { + return low + Math.floor( Math.random() * ( high - low + 1 ) ); - array[ i ].call( this, event ); + } - } + // Random float from interval + function randFloat( low, high ) { - } + return low + Math.random() * ( high - low ); - } + } - } ); - - var REVISION = '86'; - var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; - var CullFaceNone = 0; - var CullFaceBack = 1; - var CullFaceFront = 2; - var CullFaceFrontBack = 3; - var FrontFaceDirectionCW = 0; - var FrontFaceDirectionCCW = 1; - var BasicShadowMap = 0; - var PCFShadowMap = 1; - var PCFSoftShadowMap = 2; - var FrontSide = 0; - var BackSide = 1; - var DoubleSide = 2; - var FlatShading = 1; - var SmoothShading = 2; - var NoColors = 0; - var FaceColors = 1; - var VertexColors = 2; - var NoBlending = 0; - var NormalBlending = 1; - var AdditiveBlending = 2; - var SubtractiveBlending = 3; - var MultiplyBlending = 4; - var CustomBlending = 5; - var AddEquation = 100; - var SubtractEquation = 101; - var ReverseSubtractEquation = 102; - var MinEquation = 103; - var MaxEquation = 104; - var ZeroFactor = 200; - var OneFactor = 201; - var SrcColorFactor = 202; - var OneMinusSrcColorFactor = 203; - var SrcAlphaFactor = 204; - var OneMinusSrcAlphaFactor = 205; - var DstAlphaFactor = 206; - var OneMinusDstAlphaFactor = 207; - var DstColorFactor = 208; - var OneMinusDstColorFactor = 209; - var SrcAlphaSaturateFactor = 210; - var NeverDepth = 0; - var AlwaysDepth = 1; - var LessDepth = 2; - var LessEqualDepth = 3; - var EqualDepth = 4; - var GreaterEqualDepth = 5; - var GreaterDepth = 6; - var NotEqualDepth = 7; - var MultiplyOperation = 0; - var MixOperation = 1; - var AddOperation = 2; - var NoToneMapping = 0; - var LinearToneMapping = 1; - var ReinhardToneMapping = 2; - var Uncharted2ToneMapping = 3; - var CineonToneMapping = 4; - var UVMapping = 300; - var CubeReflectionMapping = 301; - var CubeRefractionMapping = 302; - var EquirectangularReflectionMapping = 303; - var EquirectangularRefractionMapping = 304; - var SphericalReflectionMapping = 305; - var CubeUVReflectionMapping = 306; - var CubeUVRefractionMapping = 307; - var RepeatWrapping = 1000; - var ClampToEdgeWrapping = 1001; - var MirroredRepeatWrapping = 1002; - var NearestFilter = 1003; - var NearestMipMapNearestFilter = 1004; - var NearestMipMapLinearFilter = 1005; - var LinearFilter = 1006; - var LinearMipMapNearestFilter = 1007; - var LinearMipMapLinearFilter = 1008; - var UnsignedByteType = 1009; - var ByteType = 1010; - var ShortType = 1011; - var UnsignedShortType = 1012; - var IntType = 1013; - var UnsignedIntType = 1014; - var FloatType = 1015; - var HalfFloatType = 1016; - var UnsignedShort4444Type = 1017; - var UnsignedShort5551Type = 1018; - var UnsignedShort565Type = 1019; - var UnsignedInt248Type = 1020; - var AlphaFormat = 1021; - var RGBFormat = 1022; - var RGBAFormat = 1023; - var LuminanceFormat = 1024; - var LuminanceAlphaFormat = 1025; - var RGBEFormat = RGBAFormat; - var DepthFormat = 1026; - var DepthStencilFormat = 1027; - var RGB_S3TC_DXT1_Format = 2001; - var RGBA_S3TC_DXT1_Format = 2002; - var RGBA_S3TC_DXT3_Format = 2003; - var RGBA_S3TC_DXT5_Format = 2004; - var RGB_PVRTC_4BPPV1_Format = 2100; - var RGB_PVRTC_2BPPV1_Format = 2101; - var RGBA_PVRTC_4BPPV1_Format = 2102; - var RGBA_PVRTC_2BPPV1_Format = 2103; - var RGB_ETC1_Format = 2151; - var LoopOnce = 2200; - var LoopRepeat = 2201; - var LoopPingPong = 2202; - var InterpolateDiscrete = 2300; - var InterpolateLinear = 2301; - var InterpolateSmooth = 2302; - var ZeroCurvatureEnding = 2400; - var ZeroSlopeEnding = 2401; - var WrapAroundEnding = 2402; - var TrianglesDrawMode = 0; - var TriangleStripDrawMode = 1; - var TriangleFanDrawMode = 2; - var LinearEncoding = 3000; - var sRGBEncoding = 3001; - var GammaEncoding = 3007; - var RGBEEncoding = 3002; - var LogLuvEncoding = 3003; - var RGBM7Encoding = 3004; - var RGBM16Encoding = 3005; - var RGBDEncoding = 3006; - var BasicDepthPacking = 3200; - var RGBADepthPacking = 3201; + // Random float from <-range/2, range/2> interval + function randFloatSpread( range ) { - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ + return range * ( 0.5 - Math.random() ); - var _Math = { + } - DEG2RAD: Math.PI / 180, - RAD2DEG: 180 / Math.PI, + // Deterministic pseudo-random float in the interval [ 0, 1 ] + function seededRandom( s ) { - generateUUID: function () { + if ( s !== undefined ) _seed = s; - // http://www.broofa.com/Tools/Math.uuid.htm + // Mulberry32 generator - var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' ); - var uuid = new Array( 36 ); - var rnd = 0, r; + let t = _seed += 0x6D2B79F5; - return function generateUUID() { + t = Math.imul( t ^ t >>> 15, t | 1 ); - for ( var i = 0; i < 36; i ++ ) { + t ^= t + Math.imul( t ^ t >>> 7, t | 61 ); - if ( i === 8 || i === 13 || i === 18 || i === 23 ) { + return ( ( t ^ t >>> 14 ) >>> 0 ) / 4294967296; - uuid[ i ] = '-'; + } - } else if ( i === 14 ) { + function degToRad( degrees ) { - uuid[ i ] = '4'; + return degrees * DEG2RAD; - } else { + } - if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0; - r = rnd & 0xf; - rnd = rnd >> 4; - uuid[ i ] = chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ]; + function radToDeg( radians ) { - } + return radians * RAD2DEG; - } + } - return uuid.join( '' ); + function isPowerOfTwo( value ) { - }; + return ( value & ( value - 1 ) ) === 0 && value !== 0; - }(), + } - clamp: function ( value, min, max ) { + function ceilPowerOfTwo( value ) { - return Math.max( min, Math.min( max, value ) ); + return Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) ); - }, + } - // compute euclidian modulo of m % n - // https://en.wikipedia.org/wiki/Modulo_operation + function floorPowerOfTwo( value ) { - euclideanModulo: function ( n, m ) { + return Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) ); - return ( ( n % m ) + m ) % m; + } - }, + function setQuaternionFromProperEuler( q, a, b, c, order ) { - // Linear mapping from range to range + // Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles - mapLinear: function ( x, a1, a2, b1, b2 ) { + // rotations are applied to the axes in the order specified by 'order' + // rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c' + // angles are in radians - return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); + const cos = Math.cos; + const sin = Math.sin; - }, + const c2 = cos( b / 2 ); + const s2 = sin( b / 2 ); - // https://en.wikipedia.org/wiki/Linear_interpolation + const c13 = cos( ( a + c ) / 2 ); + const s13 = sin( ( a + c ) / 2 ); - lerp: function ( x, y, t ) { + const c1_3 = cos( ( a - c ) / 2 ); + const s1_3 = sin( ( a - c ) / 2 ); - return ( 1 - t ) * x + t * y; + const c3_1 = cos( ( c - a ) / 2 ); + const s3_1 = sin( ( c - a ) / 2 ); - }, + switch ( order ) { - // http://en.wikipedia.org/wiki/Smoothstep + case 'XYX': + q.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 ); + break; - smoothstep: function ( x, min, max ) { + case 'YZY': + q.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 ); + break; - if ( x <= min ) return 0; - if ( x >= max ) return 1; + case 'ZXZ': + q.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 ); + break; - x = ( x - min ) / ( max - min ); + case 'XZX': + q.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 ); + break; - return x * x * ( 3 - 2 * x ); + case 'YXY': + q.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 ); + break; - }, + case 'ZYZ': + q.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 ); + break; - smootherstep: function ( x, min, max ) { + default: + console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order ); - if ( x <= min ) return 0; - if ( x >= max ) return 1; + } - x = ( x - min ) / ( max - min ); + } - return x * x * x * ( x * ( x * 6 - 15 ) + 10 ); + function denormalize( value, array ) { - }, + switch ( array.constructor ) { - // Random integer from interval + case Float32Array: - randInt: function ( low, high ) { + return value; - return low + Math.floor( Math.random() * ( high - low + 1 ) ); + case Uint32Array: - }, + return value / 4294967295.0; - // Random float from interval + case Uint16Array: - randFloat: function ( low, high ) { + return value / 65535.0; - return low + Math.random() * ( high - low ); + case Uint8Array: - }, + return value / 255.0; - // Random float from <-range/2, range/2> interval + case Int32Array: - randFloatSpread: function ( range ) { + return Math.max( value / 2147483647.0, - 1.0 ); - return range * ( 0.5 - Math.random() ); + case Int16Array: - }, + return Math.max( value / 32767.0, - 1.0 ); - degToRad: function ( degrees ) { + case Int8Array: - return degrees * _Math.DEG2RAD; + return Math.max( value / 127.0, - 1.0 ); - }, + default: - radToDeg: function ( radians ) { + throw new Error( 'Invalid component type.' ); - return radians * _Math.RAD2DEG; + } - }, + } - isPowerOfTwo: function ( value ) { + function normalize( value, array ) { - return ( value & ( value - 1 ) ) === 0 && value !== 0; + switch ( array.constructor ) { - }, + case Float32Array: - nearestPowerOfTwo: function ( value ) { + return value; - return Math.pow( 2, Math.round( Math.log( value ) / Math.LN2 ) ); + case Uint32Array: - }, + return Math.round( value * 4294967295.0 ); - nextPowerOfTwo: function ( value ) { + case Uint16Array: - value --; - value |= value >> 1; - value |= value >> 2; - value |= value >> 4; - value |= value >> 8; - value |= value >> 16; - value ++; + return Math.round( value * 65535.0 ); - return value; + case Uint8Array: - } + return Math.round( value * 255.0 ); - }; + case Int32Array: - /** - * @author mrdoob / http://mrdoob.com/ - * @author philogb / http://blog.thejit.org/ - * @author egraether / http://egraether.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - */ + return Math.round( value * 2147483647.0 ); - function Vector2( x, y ) { + case Int16Array: - this.x = x || 0; - this.y = y || 0; + return Math.round( value * 32767.0 ); - } + case Int8Array: - Object.defineProperties( Vector2.prototype, { + return Math.round( value * 127.0 ); - "width" : { + default: - get: function () { + throw new Error( 'Invalid component type.' ); + + } + + } + + const MathUtils = { + DEG2RAD: DEG2RAD, + RAD2DEG: RAD2DEG, + generateUUID: generateUUID, + clamp: clamp, + euclideanModulo: euclideanModulo, + mapLinear: mapLinear, + inverseLerp: inverseLerp, + lerp: lerp, + damp: damp, + pingpong: pingpong, + smoothstep: smoothstep, + smootherstep: smootherstep, + randInt: randInt, + randFloat: randFloat, + randFloatSpread: randFloatSpread, + seededRandom: seededRandom, + degToRad: degToRad, + radToDeg: radToDeg, + isPowerOfTwo: isPowerOfTwo, + ceilPowerOfTwo: ceilPowerOfTwo, + floorPowerOfTwo: floorPowerOfTwo, + setQuaternionFromProperEuler: setQuaternionFromProperEuler, + normalize: normalize, + denormalize: denormalize + }; - return this.x; + class Vector2 { - }, + constructor( x = 0, y = 0 ) { - set: function ( value ) { + Vector2.prototype.isVector2 = true; - this.x = value; + this.x = x; + this.y = y; - } + } - }, + get width() { - "height" : { + return this.x; - get: function () { + } - return this.y; + set width( value ) { - }, + this.x = value; - set: function ( value ) { + } - this.y = value; + get height() { - } + return this.y; } - } ); + set height( value ) { - Object.assign( Vector2.prototype, { + this.y = value; - isVector2: true, + } - set: function ( x, y ) { + set( x, y ) { this.x = x; this.y = y; return this; - }, + } - setScalar: function ( scalar ) { + setScalar( scalar ) { this.x = scalar; this.y = scalar; return this; - }, + } - setX: function ( x ) { + setX( x ) { this.x = x; return this; - }, + } - setY: function ( y ) { + setY( y ) { this.y = y; return this; - }, + } - setComponent: function ( index, value ) { + setComponent( index, value ) { switch ( index ) { @@ -579,9 +714,9 @@ return this; - }, + } - getComponent: function ( index ) { + getComponent( index ) { switch ( index ) { @@ -591,152 +726,150 @@ } - }, + } - clone: function () { + clone() { return new this.constructor( this.x, this.y ); - }, + } - copy: function ( v ) { + copy( v ) { this.x = v.x; this.y = v.y; return this; - }, - - add: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + } - } + add( v ) { this.x += v.x; this.y += v.y; return this; - }, + } - addScalar: function ( s ) { + addScalar( s ) { this.x += s; this.y += s; return this; - }, + } - addVectors: function ( a, b ) { + addVectors( a, b ) { this.x = a.x + b.x; this.y = a.y + b.y; return this; - }, + } - addScaledVector: function ( v, s ) { + addScaledVector( v, s ) { this.x += v.x * s; this.y += v.y * s; return this; - }, - - sub: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + } - } + sub( v ) { this.x -= v.x; this.y -= v.y; return this; - }, + } - subScalar: function ( s ) { + subScalar( s ) { this.x -= s; this.y -= s; return this; - }, + } - subVectors: function ( a, b ) { + subVectors( a, b ) { this.x = a.x - b.x; this.y = a.y - b.y; return this; - }, + } - multiply: function ( v ) { + multiply( v ) { this.x *= v.x; this.y *= v.y; return this; - }, + } - multiplyScalar: function ( scalar ) { + multiplyScalar( scalar ) { this.x *= scalar; this.y *= scalar; return this; - }, + } - divide: function ( v ) { + divide( v ) { this.x /= v.x; this.y /= v.y; return this; - }, + } - divideScalar: function ( scalar ) { + divideScalar( scalar ) { return this.multiplyScalar( 1 / scalar ); - }, + } + + applyMatrix3( m ) { + + const x = this.x, y = this.y; + const e = m.elements; + + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ]; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ]; + + return this; + + } - min: function ( v ) { + min( v ) { this.x = Math.min( this.x, v.x ); this.y = Math.min( this.y, v.y ); return this; - }, + } - max: function ( v ) { + max( v ) { this.x = Math.max( this.x, v.x ); this.y = Math.max( this.y, v.y ); return this; - }, + } - clamp: function ( min, max ) { + clamp( min, max ) { // assumes min < max, componentwise @@ -745,209 +878,212 @@ return this; - }, - - clampScalar: function () { - - var min = new Vector2(); - var max = new Vector2(); - - return function clampScalar( minVal, maxVal ) { + } - min.set( minVal, minVal ); - max.set( maxVal, maxVal ); + clampScalar( minVal, maxVal ) { - return this.clamp( min, max ); + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - }; + return this; - }(), + } - clampLength: function ( min, max ) { + clampLength( min, max ) { - var length = this.length(); + const length = this.length(); return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - }, + } - floor: function () { + floor() { this.x = Math.floor( this.x ); this.y = Math.floor( this.y ); return this; - }, + } - ceil: function () { + ceil() { this.x = Math.ceil( this.x ); this.y = Math.ceil( this.y ); return this; - }, + } - round: function () { + round() { this.x = Math.round( this.x ); this.y = Math.round( this.y ); return this; - }, + } - roundToZero: function () { + roundToZero() { this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); return this; - }, + } - negate: function () { + negate() { this.x = - this.x; this.y = - this.y; return this; - }, + } - dot: function ( v ) { + dot( v ) { return this.x * v.x + this.y * v.y; - }, + } + + cross( v ) { + + return this.x * v.y - this.y * v.x; + + } - lengthSq: function () { + lengthSq() { return this.x * this.x + this.y * this.y; - }, + } - length: function () { + length() { return Math.sqrt( this.x * this.x + this.y * this.y ); - }, + } - lengthManhattan: function() { + manhattanLength() { return Math.abs( this.x ) + Math.abs( this.y ); - }, + } - normalize: function () { + normalize() { return this.divideScalar( this.length() || 1 ); - }, + } - angle: function () { + angle() { // computes the angle in radians with respect to the positive x-axis - var angle = Math.atan2( this.y, this.x ); - - if ( angle < 0 ) angle += 2 * Math.PI; + const angle = Math.atan2( - this.y, - this.x ) + Math.PI; return angle; - }, + } + + angleTo( v ) { + + const denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); + + if ( denominator === 0 ) return Math.PI / 2; + + const theta = this.dot( v ) / denominator; - distanceTo: function ( v ) { + // clamp, to handle numerical problems + + return Math.acos( clamp( theta, - 1, 1 ) ); + + } + + distanceTo( v ) { return Math.sqrt( this.distanceToSquared( v ) ); - }, + } - distanceToSquared: function ( v ) { + distanceToSquared( v ) { - var dx = this.x - v.x, dy = this.y - v.y; + const dx = this.x - v.x, dy = this.y - v.y; return dx * dx + dy * dy; - }, + } - distanceToManhattan: function ( v ) { + manhattanDistanceTo( v ) { return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); - }, + } - setLength: function ( length ) { + setLength( length ) { return this.normalize().multiplyScalar( length ); - }, + } - lerp: function ( v, alpha ) { + lerp( v, alpha ) { this.x += ( v.x - this.x ) * alpha; this.y += ( v.y - this.y ) * alpha; return this; - }, + } - lerpVectors: function ( v1, v2, alpha ) { + lerpVectors( v1, v2, alpha ) { - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; - }, + return this; - equals: function ( v ) { + } - return ( ( v.x === this.x ) && ( v.y === this.y ) ); + equals( v ) { - }, + return ( ( v.x === this.x ) && ( v.y === this.y ) ); - fromArray: function ( array, offset ) { + } - if ( offset === undefined ) offset = 0; + fromArray( array, offset = 0 ) { this.x = array[ offset ]; this.y = array[ offset + 1 ]; return this; - }, - - toArray: function ( array, offset ) { + } - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + toArray( array = [], offset = 0 ) { array[ offset ] = this.x; array[ offset + 1 ] = this.y; return array; - }, - - fromBufferAttribute: function ( attribute, index, offset ) { - - if ( offset !== undefined ) { - - console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' ); + } - } + fromBufferAttribute( attribute, index ) { this.x = attribute.getX( index ); this.y = attribute.getY( index ); return this; - }, + } - rotateAround: function ( center, angle ) { + rotateAround( center, angle ) { - var c = Math.cos( angle ), s = Math.sin( angle ); + const c = Math.cos( angle ), s = Math.sin( angle ); - var x = this.x - center.x; - var y = this.y - center.y; + const x = this.x - center.x; + const y = this.y - center.y; this.x = x * c - y * s + center.x; this.y = x * s + y * c + center.y; @@ -956,43155 +1092,50819 @@ } - } ); + random() { - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - */ + this.x = Math.random(); + this.y = Math.random(); - var textureId = 0; + return this; - function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { + } - Object.defineProperty( this, 'id', { value: textureId ++ } ); + *[ Symbol.iterator ]() { - this.uuid = _Math.generateUUID(); + yield this.x; + yield this.y; - this.name = ''; + } - this.image = image !== undefined ? image : Texture.DEFAULT_IMAGE; - this.mipmaps = []; + } - this.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING; + class Matrix3 { - this.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping; - this.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping; + constructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { - this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; - this.minFilter = minFilter !== undefined ? minFilter : LinearMipMapLinearFilter; + Matrix3.prototype.isMatrix3 = true; - this.anisotropy = anisotropy !== undefined ? anisotropy : 1; + this.elements = [ - this.format = format !== undefined ? format : RGBAFormat; - this.type = type !== undefined ? type : UnsignedByteType; + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 - this.offset = new Vector2( 0, 0 ); - this.repeat = new Vector2( 1, 1 ); + ]; - this.generateMipmaps = true; - this.premultiplyAlpha = false; - this.flipY = true; - this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) + if ( n11 !== undefined ) { - // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap. - // - // Also changing the encoding after already used by a Material will not automatically make the Material - // update. You need to explicitly call Material.needsUpdate to trigger it to recompile. - this.encoding = encoding !== undefined ? encoding : LinearEncoding; + this.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ); - this.version = 0; - this.onUpdate = null; + } - } + } - Texture.DEFAULT_IMAGE = undefined; - Texture.DEFAULT_MAPPING = UVMapping; + set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { - Object.defineProperty( Texture.prototype, "needsUpdate", { + const te = this.elements; - set: function ( value ) { + te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; + te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; + te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; - if ( value === true ) this.version ++; + return this; } - } ); - - Object.assign( Texture.prototype, EventDispatcher.prototype, { - - constructor: Texture, - - isTexture: true, + identity() { - clone: function () { - - return new this.constructor().copy( this ); + this.set( - }, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 - copy: function ( source ) { + ); - this.name = source.name; + return this; - this.image = source.image; - this.mipmaps = source.mipmaps.slice( 0 ); + } - this.mapping = source.mapping; + copy( m ) { - this.wrapS = source.wrapS; - this.wrapT = source.wrapT; + const te = this.elements; + const me = m.elements; - this.magFilter = source.magFilter; - this.minFilter = source.minFilter; + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; + te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; + te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; - this.anisotropy = source.anisotropy; + return this; - this.format = source.format; - this.type = source.type; + } - this.offset.copy( source.offset ); - this.repeat.copy( source.repeat ); + extractBasis( xAxis, yAxis, zAxis ) { - this.generateMipmaps = source.generateMipmaps; - this.premultiplyAlpha = source.premultiplyAlpha; - this.flipY = source.flipY; - this.unpackAlignment = source.unpackAlignment; - this.encoding = source.encoding; + xAxis.setFromMatrix3Column( this, 0 ); + yAxis.setFromMatrix3Column( this, 1 ); + zAxis.setFromMatrix3Column( this, 2 ); return this; - }, - - toJSON: function ( meta ) { + } - if ( meta.textures[ this.uuid ] !== undefined ) { + setFromMatrix4( m ) { - return meta.textures[ this.uuid ]; + const me = m.elements; - } + this.set( - function getDataURL( image ) { + me[ 0 ], me[ 4 ], me[ 8 ], + me[ 1 ], me[ 5 ], me[ 9 ], + me[ 2 ], me[ 6 ], me[ 10 ] - var canvas; + ); - if ( image.toDataURL !== undefined ) { + return this; - canvas = image; + } - } else { + multiply( m ) { - canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - canvas.width = image.width; - canvas.height = image.height; + return this.multiplyMatrices( this, m ); - canvas.getContext( '2d' ).drawImage( image, 0, 0, image.width, image.height ); + } - } + premultiply( m ) { - if ( canvas.width > 2048 || canvas.height > 2048 ) { + return this.multiplyMatrices( m, this ); - return canvas.toDataURL( 'image/jpeg', 0.6 ); + } - } else { + multiplyMatrices( a, b ) { - return canvas.toDataURL( 'image/png' ); + const ae = a.elements; + const be = b.elements; + const te = this.elements; - } + const a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; + const a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; + const a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; - } + const b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; + const b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; + const b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; - var output = { - metadata: { - version: 4.5, - type: 'Texture', - generator: 'Texture.toJSON' - }, + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; + te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; + te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; - uuid: this.uuid, - name: this.name, + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; + te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; + te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; - mapping: this.mapping, + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; + te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; + te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; - repeat: [ this.repeat.x, this.repeat.y ], - offset: [ this.offset.x, this.offset.y ], - wrap: [ this.wrapS, this.wrapT ], + return this; - minFilter: this.minFilter, - magFilter: this.magFilter, - anisotropy: this.anisotropy, + } - flipY: this.flipY - }; + multiplyScalar( s ) { - if ( this.image !== undefined ) { + const te = this.elements; - // TODO: Move to THREE.Image + te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; + te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; + te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; - var image = this.image; + return this; - if ( image.uuid === undefined ) { + } - image.uuid = _Math.generateUUID(); // UGH + determinant() { - } + const te = this.elements; - if ( meta.images[ image.uuid ] === undefined ) { + const a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], + d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], + g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; - meta.images[ image.uuid ] = { - uuid: image.uuid, - url: getDataURL( image ) - }; + return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; - } + } - output.image = image.uuid; + invert() { - } + const te = this.elements, - meta.textures[ this.uuid ] = output; + n11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], + n12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ], + n13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ], - return output; + t11 = n33 * n22 - n32 * n23, + t12 = n32 * n13 - n33 * n12, + t13 = n23 * n12 - n22 * n13, - }, + det = n11 * t11 + n21 * t12 + n31 * t13; - dispose: function () { + if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); - this.dispatchEvent( { type: 'dispose' } ); + const detInv = 1 / det; - }, + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; + te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; - transformUv: function ( uv ) { + te[ 3 ] = t12 * detInv; + te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; + te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; - if ( this.mapping !== UVMapping ) return; + te[ 6 ] = t13 * detInv; + te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; + te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; - uv.multiply( this.repeat ); - uv.add( this.offset ); + return this; - if ( uv.x < 0 || uv.x > 1 ) { + } - switch ( this.wrapS ) { + transpose() { - case RepeatWrapping: + let tmp; + const m = this.elements; - uv.x = uv.x - Math.floor( uv.x ); - break; + tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; + tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; + tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; - case ClampToEdgeWrapping: + return this; - uv.x = uv.x < 0 ? 0 : 1; - break; + } - case MirroredRepeatWrapping: + getNormalMatrix( matrix4 ) { - if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) { + return this.setFromMatrix4( matrix4 ).invert().transpose(); - uv.x = Math.ceil( uv.x ) - uv.x; + } - } else { + transposeIntoArray( r ) { - uv.x = uv.x - Math.floor( uv.x ); + const m = this.elements; - } - break; + r[ 0 ] = m[ 0 ]; + r[ 1 ] = m[ 3 ]; + r[ 2 ] = m[ 6 ]; + r[ 3 ] = m[ 1 ]; + r[ 4 ] = m[ 4 ]; + r[ 5 ] = m[ 7 ]; + r[ 6 ] = m[ 2 ]; + r[ 7 ] = m[ 5 ]; + r[ 8 ] = m[ 8 ]; - } + return this; - } + } - if ( uv.y < 0 || uv.y > 1 ) { + setUvTransform( tx, ty, sx, sy, rotation, cx, cy ) { - switch ( this.wrapT ) { + const c = Math.cos( rotation ); + const s = Math.sin( rotation ); - case RepeatWrapping: + this.set( + sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx, + - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty, + 0, 0, 1 + ); - uv.y = uv.y - Math.floor( uv.y ); - break; + return this; - case ClampToEdgeWrapping: + } - uv.y = uv.y < 0 ? 0 : 1; - break; + // - case MirroredRepeatWrapping: + scale( sx, sy ) { - if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) { + this.premultiply( _m3.makeScale( sx, sy ) ); - uv.y = Math.ceil( uv.y ) - uv.y; + return this; - } else { + } - uv.y = uv.y - Math.floor( uv.y ); + rotate( theta ) { - } - break; + this.premultiply( _m3.makeRotation( - theta ) ); - } + return this; - } + } - if ( this.flipY ) { + translate( tx, ty ) { - uv.y = 1 - uv.y; + this.premultiply( _m3.makeTranslation( tx, ty ) ); - } + return this; } - } ); + // for 2D Transforms - /** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - * @author WestLangley / http://github.com/WestLangley - */ + makeTranslation( x, y ) { - function Vector4( x, y, z, w ) { + if ( x.isVector2 ) { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = ( w !== undefined ) ? w : 1; + this.set( - } + 1, 0, x.x, + 0, 1, x.y, + 0, 0, 1 + + ); - Object.assign( Vector4.prototype, { + } else { - isVector4: true, + this.set( - set: function ( x, y, z, w ) { + 1, 0, x, + 0, 1, y, + 0, 0, 1 - this.x = x; - this.y = y; - this.z = z; - this.w = w; + ); + + } return this; - }, + } - setScalar: function ( scalar ) { + makeRotation( theta ) { - this.x = scalar; - this.y = scalar; - this.z = scalar; - this.w = scalar; + // counterclockwise - return this; + const c = Math.cos( theta ); + const s = Math.sin( theta ); - }, + this.set( - setX: function ( x ) { + c, - s, 0, + s, c, 0, + 0, 0, 1 - this.x = x; + ); return this; - }, + } - setY: function ( y ) { + makeScale( x, y ) { - this.y = y; + this.set( + + x, 0, 0, + 0, y, 0, + 0, 0, 1 + + ); return this; - }, + } - setZ: function ( z ) { + // - this.z = z; + equals( matrix ) { - return this; + const te = this.elements; + const me = matrix.elements; - }, + for ( let i = 0; i < 9; i ++ ) { - setW: function ( w ) { + if ( te[ i ] !== me[ i ] ) return false; - this.w = w; + } - return this; + return true; - }, + } - setComponent: function ( index, value ) { + fromArray( array, offset = 0 ) { - switch ( index ) { + for ( let i = 0; i < 9; i ++ ) { - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - case 3: this.w = value; break; - default: throw new Error( 'index is out of range: ' + index ); + this.elements[ i ] = array[ i + offset ]; } return this; - }, + } - getComponent: function ( index ) { + toArray( array = [], offset = 0 ) { - switch ( index ) { + const te = this.elements; - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - case 3: return this.w; - default: throw new Error( 'index is out of range: ' + index ); + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; - } + array[ offset + 3 ] = te[ 3 ]; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; - }, + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + array[ offset + 8 ] = te[ 8 ]; - clone: function () { + return array; - return new this.constructor( this.x, this.y, this.z, this.w ); + } - }, + clone() { - copy: function ( v ) { + return new this.constructor().fromArray( this.elements ); - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = ( v.w !== undefined ) ? v.w : 1; + } - return this; + } - }, + const _m3 = /*@__PURE__*/ new Matrix3(); - add: function ( v, w ) { + function arrayNeedsUint32( array ) { - if ( w !== undefined ) { + // assumes larger values usually on last - console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + for ( let i = array.length - 1; i >= 0; -- i ) { - } + if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565 - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + } - return this; + return false; - }, + } - addScalar: function ( s ) { + const TYPED_ARRAYS = { + Int8Array: Int8Array, + Uint8Array: Uint8Array, + Uint8ClampedArray: Uint8ClampedArray, + Int16Array: Int16Array, + Uint16Array: Uint16Array, + Int32Array: Int32Array, + Uint32Array: Uint32Array, + Float32Array: Float32Array, + Float64Array: Float64Array + }; - this.x += s; - this.y += s; - this.z += s; - this.w += s; + function getTypedArray( type, buffer ) { - return this; + return new TYPED_ARRAYS[ type ]( buffer ); - }, + } - addVectors: function ( a, b ) { + function createElementNS( name ) { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - this.w = a.w + b.w; + return document.createElementNS( 'http://www.w3.org/1999/xhtml', name ); - return this; + } - }, + const _cache = {}; - addScaledVector: function ( v, s ) { + function warnOnce( message ) { - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - this.w += v.w * s; + if ( message in _cache ) return; - return this; + _cache[ message ] = true; - }, + console.warn( message ); - sub: function ( v, w ) { + } - if ( w !== undefined ) { + function SRGBToLinear( c ) { - console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + return ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 ); - } + } - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + function LinearToSRGB( c ) { - return this; + return ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055; - }, + } - subScalar: function ( s ) { + /** + * Matrices converting P3 <-> Rec. 709 primaries, without gamut mapping + * or clipping. Based on W3C specifications for sRGB and Display P3, + * and ICC specifications for the D50 connection space. Values in/out + * are _linear_ sRGB and _linear_ Display P3. + * + * Note that both sRGB and Display P3 use the sRGB transfer functions. + * + * Reference: + * - http://www.russellcottrell.com/photo/matrixCalculator.htm + */ - this.x -= s; - this.y -= s; - this.z -= s; - this.w -= s; + const LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = /*@__PURE__*/ new Matrix3().fromArray( [ + 0.8224621, 0.0331941, 0.0170827, + 0.1775380, 0.9668058, 0.0723974, + - 0.0000001, 0.0000001, 0.9105199 + ] ); - return this; + const LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = /*@__PURE__*/ new Matrix3().fromArray( [ + 1.2249401, - 0.0420569, - 0.0196376, + - 0.2249404, 1.0420571, - 0.0786361, + 0.0000001, 0.0000000, 1.0982735 + ] ); - }, + function DisplayP3ToLinearSRGB( color ) { - subVectors: function ( a, b ) { + // Display P3 uses the sRGB transfer functions + return color.convertSRGBToLinear().applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ); - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - this.w = a.w - b.w; + } - return this; + function LinearSRGBToDisplayP3( color ) { - }, + // Display P3 uses the sRGB transfer functions + return color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ).convertLinearToSRGB(); - multiplyScalar: function ( scalar ) { + } - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - this.w *= scalar; + // Conversions from to Linear-sRGB reference space. + const TO_LINEAR = { + [ LinearSRGBColorSpace ]: ( color ) => color, + [ SRGBColorSpace ]: ( color ) => color.convertSRGBToLinear(), + [ DisplayP3ColorSpace ]: DisplayP3ToLinearSRGB, + }; - return this; + // Conversions to from Linear-sRGB reference space. + const FROM_LINEAR = { + [ LinearSRGBColorSpace ]: ( color ) => color, + [ SRGBColorSpace ]: ( color ) => color.convertLinearToSRGB(), + [ DisplayP3ColorSpace ]: LinearSRGBToDisplayP3, + }; - }, + const ColorManagement = { - applyMatrix4: function ( m ) { + enabled: true, - var x = this.x, y = this.y, z = this.z, w = this.w; - var e = m.elements; + get legacyMode() { - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; - this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; + console.warn( 'THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.' ); - return this; + return ! this.enabled; }, - divideScalar: function ( scalar ) { + set legacyMode( legacyMode ) { - return this.multiplyScalar( 1 / scalar ); + console.warn( 'THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.' ); + + this.enabled = ! legacyMode; }, - setAxisAngleFromQuaternion: function ( q ) { + get workingColorSpace() { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm + return LinearSRGBColorSpace; - // q is assumed to be normalized + }, - this.w = 2 * Math.acos( q.w ); + set workingColorSpace( colorSpace ) { - var s = Math.sqrt( 1 - q.w * q.w ); + console.warn( 'THREE.ColorManagement: .workingColorSpace is readonly.' ); - if ( s < 0.0001 ) { + }, - this.x = 1; - this.y = 0; - this.z = 0; + convert: function ( color, sourceColorSpace, targetColorSpace ) { - } else { + if ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) { - this.x = q.x / s; - this.y = q.y / s; - this.z = q.z / s; + return color; } - return this; - - }, + const sourceToLinear = TO_LINEAR[ sourceColorSpace ]; + const targetFromLinear = FROM_LINEAR[ targetColorSpace ]; - setAxisAngleFromRotationMatrix: function ( m ) { + if ( sourceToLinear === undefined || targetFromLinear === undefined ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm + throw new Error( `Unsupported color space conversion, "${ sourceColorSpace }" to "${ targetColorSpace }".` ); - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + } - var angle, x, y, z, // variables for result - epsilon = 0.01, // margin to allow for rounding errors - epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees + return targetFromLinear( sourceToLinear( color ) ); - te = m.elements, + }, - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + fromWorkingColorSpace: function ( color, targetColorSpace ) { - if ( ( Math.abs( m12 - m21 ) < epsilon ) && - ( Math.abs( m13 - m31 ) < epsilon ) && - ( Math.abs( m23 - m32 ) < epsilon ) ) { + return this.convert( color, this.workingColorSpace, targetColorSpace ); - // singularity found - // first check for identity matrix which must have +1 for all terms - // in leading diagonal and zero in other terms + }, - if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && - ( Math.abs( m13 + m31 ) < epsilon2 ) && - ( Math.abs( m23 + m32 ) < epsilon2 ) && - ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { + toWorkingColorSpace: function ( color, sourceColorSpace ) { - // this singularity is identity matrix so angle = 0 + return this.convert( color, sourceColorSpace, this.workingColorSpace ); - this.set( 1, 0, 0, 0 ); + }, - return this; // zero angle, arbitrary axis + }; - } + let _canvas; - // otherwise this singularity is angle = 180 + class ImageUtils { - angle = Math.PI; + static getDataURL( image ) { - var xx = ( m11 + 1 ) / 2; - var yy = ( m22 + 1 ) / 2; - var zz = ( m33 + 1 ) / 2; - var xy = ( m12 + m21 ) / 4; - var xz = ( m13 + m31 ) / 4; - var yz = ( m23 + m32 ) / 4; + if ( /^data:/i.test( image.src ) ) { - if ( ( xx > yy ) && ( xx > zz ) ) { + return image.src; - // m11 is the largest diagonal term + } - if ( xx < epsilon ) { + if ( typeof HTMLCanvasElement === 'undefined' ) { - x = 0; - y = 0.707106781; - z = 0.707106781; + return image.src; - } else { + } - x = Math.sqrt( xx ); - y = xy / x; - z = xz / x; + let canvas; - } + if ( image instanceof HTMLCanvasElement ) { - } else if ( yy > zz ) { + canvas = image; - // m22 is the largest diagonal term + } else { - if ( yy < epsilon ) { + if ( _canvas === undefined ) _canvas = createElementNS( 'canvas' ); - x = 0.707106781; - y = 0; - z = 0.707106781; + _canvas.width = image.width; + _canvas.height = image.height; - } else { + const context = _canvas.getContext( '2d' ); - y = Math.sqrt( yy ); - x = xy / y; - z = yz / y; + if ( image instanceof ImageData ) { - } + context.putImageData( image, 0, 0 ); } else { - // m33 is the largest diagonal term so base result on this + context.drawImage( image, 0, 0, image.width, image.height ); - if ( zz < epsilon ) { + } - x = 0.707106781; - y = 0.707106781; - z = 0; + canvas = _canvas; - } else { + } - z = Math.sqrt( zz ); - x = xz / z; - y = yz / z; + if ( canvas.width > 2048 || canvas.height > 2048 ) { - } + console.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image ); - } + return canvas.toDataURL( 'image/jpeg', 0.6 ); - this.set( x, y, z, angle ); + } else { - return this; // return 180 deg rotation + return canvas.toDataURL( 'image/png' ); } - // as we have reached here there are no singularities so we can handle normally + } - var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + - ( m13 - m31 ) * ( m13 - m31 ) + - ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize + static sRGBToLinear( image ) { - if ( Math.abs( s ) < 0.001 ) s = 1; + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { - // prevent divide by zero, should not happen if matrix is orthogonal and should be - // caught by singularity test above, but I've left it in just in case + const canvas = createElementNS( 'canvas' ); - this.x = ( m32 - m23 ) / s; - this.y = ( m13 - m31 ) / s; - this.z = ( m21 - m12 ) / s; - this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); + canvas.width = image.width; + canvas.height = image.height; - return this; + const context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, image.width, image.height ); - }, + const imageData = context.getImageData( 0, 0, image.width, image.height ); + const data = imageData.data; - min: function ( v ) { + for ( let i = 0; i < data.length; i ++ ) { - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); - this.w = Math.min( this.w, v.w ); + data[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255; - return this; + } - }, + context.putImageData( imageData, 0, 0 ); - max: function ( v ) { + return canvas; - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); - this.w = Math.max( this.w, v.w ); + } else if ( image.data ) { - return this; + const data = image.data.slice( 0 ); - }, + for ( let i = 0; i < data.length; i ++ ) { - clamp: function ( min, max ) { + if ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) { - // assumes min < max, componentwise + data[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 ); - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - this.w = Math.max( min.w, Math.min( max.w, this.w ) ); + } else { - return this; + // assuming float - }, + data[ i ] = SRGBToLinear( data[ i ] ); - clampScalar: function () { + } - var min, max; + } - return function clampScalar( minVal, maxVal ) { + return { + data: data, + width: image.width, + height: image.height + }; - if ( min === undefined ) { + } else { - min = new Vector4(); - max = new Vector4(); + console.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' ); + return image; - } + } - min.set( minVal, minVal, minVal, minVal ); - max.set( maxVal, maxVal, maxVal, maxVal ); + } - return this.clamp( min, max ); + } - }; + let sourceId = 0; - }(), + class Source { - clampLength: function ( min, max ) { + constructor( data = null ) { - var length = this.length(); + this.isSource = true; - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + Object.defineProperty( this, 'id', { value: sourceId ++ } ); - }, + this.uuid = generateUUID(); - floor: function () { + this.data = data; - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); - this.w = Math.floor( this.w ); + this.version = 0; - return this; + } - }, + set needsUpdate( value ) { - ceil: function () { + if ( value === true ) this.version ++; - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); - this.w = Math.ceil( this.w ); + } - return this; + toJSON( meta ) { - }, + const isRootObject = ( meta === undefined || typeof meta === 'string' ); - round: function () { + if ( ! isRootObject && meta.images[ this.uuid ] !== undefined ) { - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); - this.w = Math.round( this.w ); + return meta.images[ this.uuid ]; - return this; + } - }, + const output = { + uuid: this.uuid, + url: '' + }; - roundToZero: function () { + const data = this.data; - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + if ( data !== null ) { - return this; + let url; - }, + if ( Array.isArray( data ) ) { - negate: function () { + // cube texture - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; - this.w = - this.w; + url = []; - return this; + for ( let i = 0, l = data.length; i < l; i ++ ) { - }, + if ( data[ i ].isDataTexture ) { - dot: function ( v ) { + url.push( serializeImage( data[ i ].image ) ); - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + } else { - }, + url.push( serializeImage( data[ i ] ) ); - lengthSq: function () { + } - return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; + } - }, + } else { - length: function () { + // texture - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); + url = serializeImage( data ); - }, + } - lengthManhattan: function () { + output.url = url; - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); + } - }, + if ( ! isRootObject ) { - normalize: function () { + meta.images[ this.uuid ] = output; - return this.divideScalar( this.length() || 1 ); + } - }, + return output; - setLength: function ( length ) { + } - return this.normalize().multiplyScalar( length ); + } - }, + function serializeImage( image ) { - lerp: function ( v, alpha ) { + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; - this.w += ( v.w - this.w ) * alpha; + // default images - return this; + return ImageUtils.getDataURL( image ); - }, + } else { - lerpVectors: function ( v1, v2, alpha ) { + if ( image.data ) { - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + // images of DataTexture - }, + return { + data: Array.from( image.data ), + width: image.width, + height: image.height, + type: image.data.constructor.name + }; - equals: function ( v ) { + } else { - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); + console.warn( 'THREE.Texture: Unable to serialize Texture.' ); + return {}; - }, + } - fromArray: function ( array, offset ) { + } - if ( offset === undefined ) offset = 0; + } - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; - this.w = array[ offset + 3 ]; + let textureId = 0; - return this; + class Texture extends EventDispatcher { - }, + constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace ) { - toArray: function ( array, offset ) { + super(); - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + this.isTexture = true; - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; - array[ offset + 3 ] = this.w; + Object.defineProperty( this, 'id', { value: textureId ++ } ); - return array; + this.uuid = generateUUID(); - }, + this.name = ''; - fromBufferAttribute: function ( attribute, index, offset ) { + this.source = new Source( image ); + this.mipmaps = []; - if ( offset !== undefined ) { + this.mapping = mapping; + this.channel = 0; - console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' ); + this.wrapS = wrapS; + this.wrapT = wrapT; - } + this.magFilter = magFilter; + this.minFilter = minFilter; - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); - this.w = attribute.getW( index ); + this.anisotropy = anisotropy; - return this; + this.format = format; + this.internalFormat = null; + this.type = type; - } + this.offset = new Vector2( 0, 0 ); + this.repeat = new Vector2( 1, 1 ); + this.center = new Vector2( 0, 0 ); + this.rotation = 0; - } ); + this.matrixAutoUpdate = true; + this.matrix = new Matrix3(); - /** - * @author szimek / https://github.com/szimek/ - * @author alteredq / http://alteredqualia.com/ - * @author Marius Kintel / https://github.com/kintel - */ + this.generateMipmaps = true; + this.premultiplyAlpha = false; + this.flipY = true; + this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) - /* - In options, we can specify: - * Texture parameters for an auto-generated target texture - * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers - */ - function WebGLRenderTarget( width, height, options ) { + if ( typeof colorSpace === 'string' ) { - this.uuid = _Math.generateUUID(); + this.colorSpace = colorSpace; - this.width = width; - this.height = height; + } else { // @deprecated, r152 - this.scissor = new Vector4( 0, 0, width, height ); - this.scissorTest = false; + warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' ); + this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace; - this.viewport = new Vector4( 0, 0, width, height ); + } - options = options || {}; - if ( options.minFilter === undefined ) options.minFilter = LinearFilter; + this.userData = {}; - this.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding ); + this.version = 0; + this.onUpdate = null; - this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; - this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; - this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; + this.isRenderTargetTexture = false; // indicates whether a texture belongs to a render target or not + this.needsPMREMUpdate = false; // indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures) - } + } - Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, { + get image() { - isWebGLRenderTarget: true, + return this.source.data; - setSize: function ( width, height ) { + } - if ( this.width !== width || this.height !== height ) { + set image( value = null ) { - this.width = width; - this.height = height; + this.source.data = value; - this.dispose(); + } - } + updateMatrix() { - this.viewport.set( 0, 0, width, height ); - this.scissor.set( 0, 0, width, height ); + this.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y ); - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( source ) { + copy( source ) { - this.width = source.width; - this.height = source.height; + this.name = source.name; - this.viewport.copy( source.viewport ); + this.source = source.source; + this.mipmaps = source.mipmaps.slice( 0 ); - this.texture = source.texture.clone(); + this.mapping = source.mapping; + this.channel = source.channel; - this.depthBuffer = source.depthBuffer; - this.stencilBuffer = source.stencilBuffer; - this.depthTexture = source.depthTexture; + this.wrapS = source.wrapS; + this.wrapT = source.wrapT; - return this; + this.magFilter = source.magFilter; + this.minFilter = source.minFilter; - }, + this.anisotropy = source.anisotropy; + + this.format = source.format; + this.internalFormat = source.internalFormat; + this.type = source.type; - dispose: function () { + this.offset.copy( source.offset ); + this.repeat.copy( source.repeat ); + this.center.copy( source.center ); + this.rotation = source.rotation; - this.dispatchEvent( { type: 'dispose' } ); + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrix.copy( source.matrix ); - } + this.generateMipmaps = source.generateMipmaps; + this.premultiplyAlpha = source.premultiplyAlpha; + this.flipY = source.flipY; + this.unpackAlignment = source.unpackAlignment; + this.colorSpace = source.colorSpace; - } ); + this.userData = JSON.parse( JSON.stringify( source.userData ) ); - /** - * @author alteredq / http://alteredqualia.com - */ + this.needsUpdate = true; - function WebGLRenderTargetCube( width, height, options ) { + return this; - WebGLRenderTarget.call( this, width, height, options ); + } - this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 - this.activeMipMapLevel = 0; + toJSON( meta ) { - } + const isRootObject = ( meta === undefined || typeof meta === 'string' ); - WebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype ); - WebGLRenderTargetCube.prototype.constructor = WebGLRenderTargetCube; + if ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) { - WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube = true; + return meta.textures[ this.uuid ]; - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - */ + } - function Quaternion( x, y, z, w ) { + const output = { - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._w = ( w !== undefined ) ? w : 1; + metadata: { + version: 4.6, + type: 'Texture', + generator: 'Texture.toJSON' + }, - } + uuid: this.uuid, + name: this.name, - Object.assign( Quaternion, { + image: this.source.toJSON( meta ).uuid, - slerp: function ( qa, qb, qm, t ) { + mapping: this.mapping, + channel: this.channel, - return qm.copy( qa ).slerp( qb, t ); + repeat: [ this.repeat.x, this.repeat.y ], + offset: [ this.offset.x, this.offset.y ], + center: [ this.center.x, this.center.y ], + rotation: this.rotation, - }, + wrap: [ this.wrapS, this.wrapT ], - slerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { + format: this.format, + internalFormat: this.internalFormat, + type: this.type, + colorSpace: this.colorSpace, - // fuzz-free, array-based Quaternion SLERP operation + minFilter: this.minFilter, + magFilter: this.magFilter, + anisotropy: this.anisotropy, - var x0 = src0[ srcOffset0 + 0 ], - y0 = src0[ srcOffset0 + 1 ], - z0 = src0[ srcOffset0 + 2 ], - w0 = src0[ srcOffset0 + 3 ], + flipY: this.flipY, - x1 = src1[ srcOffset1 + 0 ], - y1 = src1[ srcOffset1 + 1 ], - z1 = src1[ srcOffset1 + 2 ], - w1 = src1[ srcOffset1 + 3 ]; + generateMipmaps: this.generateMipmaps, + premultiplyAlpha: this.premultiplyAlpha, + unpackAlignment: this.unpackAlignment - if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { + }; - var s = 1 - t, + if ( Object.keys( this.userData ).length > 0 ) output.userData = this.userData; - cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, + if ( ! isRootObject ) { - dir = ( cos >= 0 ? 1 : - 1 ), - sqrSin = 1 - cos * cos; + meta.textures[ this.uuid ] = output; - // Skip the Slerp for tiny steps to avoid numeric problems: - if ( sqrSin > Number.EPSILON ) { + } - var sin = Math.sqrt( sqrSin ), - len = Math.atan2( sin, cos * dir ); + return output; - s = Math.sin( s * len ) / sin; - t = Math.sin( t * len ) / sin; + } - } + dispose() { - var tDir = t * dir; + this.dispatchEvent( { type: 'dispose' } ); - x0 = x0 * s + x1 * tDir; - y0 = y0 * s + y1 * tDir; - z0 = z0 * s + z1 * tDir; - w0 = w0 * s + w1 * tDir; + } - // Normalize in case we just did a lerp: - if ( s === 1 - t ) { + transformUv( uv ) { - var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); + if ( this.mapping !== UVMapping ) return uv; - x0 *= f; - y0 *= f; - z0 *= f; - w0 *= f; + uv.applyMatrix3( this.matrix ); - } + if ( uv.x < 0 || uv.x > 1 ) { - } + switch ( this.wrapS ) { - dst[ dstOffset ] = x0; - dst[ dstOffset + 1 ] = y0; - dst[ dstOffset + 2 ] = z0; - dst[ dstOffset + 3 ] = w0; + case RepeatWrapping: - } + uv.x = uv.x - Math.floor( uv.x ); + break; - } ); + case ClampToEdgeWrapping: - Object.defineProperties( Quaternion.prototype, { + uv.x = uv.x < 0 ? 0 : 1; + break; - x: { + case MirroredRepeatWrapping: - get: function () { + if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) { - return this._x; + uv.x = Math.ceil( uv.x ) - uv.x; - }, + } else { - set: function ( value ) { + uv.x = uv.x - Math.floor( uv.x ); - this._x = value; - this.onChangeCallback(); + } - } + break; - }, + } - y: { + } - get: function () { + if ( uv.y < 0 || uv.y > 1 ) { - return this._y; + switch ( this.wrapT ) { - }, + case RepeatWrapping: - set: function ( value ) { + uv.y = uv.y - Math.floor( uv.y ); + break; - this._y = value; - this.onChangeCallback(); + case ClampToEdgeWrapping: - } + uv.y = uv.y < 0 ? 0 : 1; + break; - }, + case MirroredRepeatWrapping: - z: { + if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) { - get: function () { + uv.y = Math.ceil( uv.y ) - uv.y; - return this._z; + } else { - }, + uv.y = uv.y - Math.floor( uv.y ); + + } - set: function ( value ) { + break; - this._z = value; - this.onChangeCallback(); + } } - }, + if ( this.flipY ) { + + uv.y = 1 - uv.y; - w: { + } - get: function () { + return uv; - return this._w; + } - }, + set needsUpdate( value ) { - set: function ( value ) { + if ( value === true ) { - this._w = value; - this.onChangeCallback(); + this.version ++; + this.source.needsUpdate = true; } } - } ); + get encoding() { // @deprecated, r152 - Object.assign( Quaternion.prototype, { + warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' ); + return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding; - set: function ( x, y, z, w ) { + } - this._x = x; - this._y = y; - this._z = z; - this._w = w; + set encoding( encoding ) { // @deprecated, r152 - this.onChangeCallback(); + warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' ); + this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace; - return this; + } - }, + } - clone: function () { + Texture.DEFAULT_IMAGE = null; + Texture.DEFAULT_MAPPING = UVMapping; + Texture.DEFAULT_ANISOTROPY = 1; - return new this.constructor( this._x, this._y, this._z, this._w ); + class Vector4 { - }, + constructor( x = 0, y = 0, z = 0, w = 1 ) { - copy: function ( quaternion ) { + Vector4.prototype.isVector4 = true; - this._x = quaternion.x; - this._y = quaternion.y; - this._z = quaternion.z; - this._w = quaternion.w; + this.x = x; + this.y = y; + this.z = z; + this.w = w; - this.onChangeCallback(); + } - return this; + get width() { - }, + return this.z; - setFromEuler: function ( euler, update ) { + } - if ( ! ( euler && euler.isEuler ) ) { + set width( value ) { - throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + this.z = value; - } + } - var x = euler._x, y = euler._y, z = euler._z, order = euler.order; + get height() { - // http://www.mathworks.com/matlabcentral/fileexchange/ - // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ - // content/SpinCalc.m + return this.w; + + } - var cos = Math.cos; - var sin = Math.sin; + set height( value ) { - var c1 = cos( x / 2 ); - var c2 = cos( y / 2 ); - var c3 = cos( z / 2 ); + this.w = value; - var s1 = sin( x / 2 ); - var s2 = sin( y / 2 ); - var s3 = sin( z / 2 ); + } - if ( order === 'XYZ' ) { + set( x, y, z, w ) { - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; + this.x = x; + this.y = y; + this.z = z; + this.w = w; - } else if ( order === 'YXZ' ) { + return this; - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; + } - } else if ( order === 'ZXY' ) { + setScalar( scalar ) { - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; + this.x = scalar; + this.y = scalar; + this.z = scalar; + this.w = scalar; - } else if ( order === 'ZYX' ) { + return this; - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; + } - } else if ( order === 'YZX' ) { + setX( x ) { - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; + this.x = x; - } else if ( order === 'XZY' ) { + return this; - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; + } - } + setY( y ) { - if ( update !== false ) this.onChangeCallback(); + this.y = y; return this; - }, + } - setFromAxisAngle: function ( axis, angle ) { + setZ( z ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm + this.z = z; - // assumes axis is normalized + return this; - var halfAngle = angle / 2, s = Math.sin( halfAngle ); + } - this._x = axis.x * s; - this._y = axis.y * s; - this._z = axis.z * s; - this._w = Math.cos( halfAngle ); + setW( w ) { - this.onChangeCallback(); + this.w = w; return this; - }, + } - setFromRotationMatrix: function ( m ) { + setComponent( index, value ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + switch ( index ) { - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + case 3: this.w = value; break; + default: throw new Error( 'index is out of range: ' + index ); - var te = m.elements, + } - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], + return this; - trace = m11 + m22 + m33, - s; + } - if ( trace > 0 ) { + getComponent( index ) { - s = 0.5 / Math.sqrt( trace + 1.0 ); + switch ( index ) { - this._w = 0.25 / s; - this._x = ( m32 - m23 ) * s; - this._y = ( m13 - m31 ) * s; - this._z = ( m21 - m12 ) * s; + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + case 3: return this.w; + default: throw new Error( 'index is out of range: ' + index ); - } else if ( m11 > m22 && m11 > m33 ) { + } - s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); + } - this._w = ( m32 - m23 ) / s; - this._x = 0.25 * s; - this._y = ( m12 + m21 ) / s; - this._z = ( m13 + m31 ) / s; + clone() { - } else if ( m22 > m33 ) { + return new this.constructor( this.x, this.y, this.z, this.w ); - s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); + } - this._w = ( m13 - m31 ) / s; - this._x = ( m12 + m21 ) / s; - this._y = 0.25 * s; - this._z = ( m23 + m32 ) / s; + copy( v ) { - } else { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = ( v.w !== undefined ) ? v.w : 1; - s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); + return this; - this._w = ( m21 - m12 ) / s; - this._x = ( m13 + m31 ) / s; - this._y = ( m23 + m32 ) / s; - this._z = 0.25 * s; + } - } + add( v ) { - this.onChangeCallback(); + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; return this; - }, - - setFromUnitVectors: function () { + } - // assumes direction vectors vFrom and vTo are normalized + addScalar( s ) { - var v1 = new Vector3(); - var r; + this.x += s; + this.y += s; + this.z += s; + this.w += s; - var EPS = 0.000001; + return this; - return function setFromUnitVectors( vFrom, vTo ) { + } - if ( v1 === undefined ) v1 = new Vector3(); + addVectors( a, b ) { - r = vFrom.dot( vTo ) + 1; + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + this.w = a.w + b.w; - if ( r < EPS ) { + return this; - r = 0; + } - if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { + addScaledVector( v, s ) { - v1.set( - vFrom.y, vFrom.x, 0 ); + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + this.w += v.w * s; - } else { + return this; - v1.set( 0, - vFrom.z, vFrom.y ); + } - } + sub( v ) { - } else { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; - v1.crossVectors( vFrom, vTo ); + return this; - } + } - this._x = v1.x; - this._y = v1.y; - this._z = v1.z; - this._w = r; + subScalar( s ) { - return this.normalize(); + this.x -= s; + this.y -= s; + this.z -= s; + this.w -= s; - }; + return this; - }(), + } - inverse: function () { + subVectors( a, b ) { - return this.conjugate().normalize(); + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + this.w = a.w - b.w; - }, + return this; - conjugate: function () { + } - this._x *= - 1; - this._y *= - 1; - this._z *= - 1; + multiply( v ) { - this.onChangeCallback(); + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + this.w *= v.w; return this; - }, - - dot: function ( v ) { - - return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; + } - }, + multiplyScalar( scalar ) { - lengthSq: function () { + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + this.w *= scalar; - return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; + return this; - }, + } - length: function () { + applyMatrix4( m ) { - return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); + const x = this.x, y = this.y, z = this.z, w = this.w; + const e = m.elements; - }, + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; + this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; - normalize: function () { + return this; - var l = this.length(); + } - if ( l === 0 ) { + divideScalar( scalar ) { - this._x = 0; - this._y = 0; - this._z = 0; - this._w = 1; + return this.multiplyScalar( 1 / scalar ); - } else { + } - l = 1 / l; + setAxisAngleFromQuaternion( q ) { - this._x = this._x * l; - this._y = this._y * l; - this._z = this._z * l; - this._w = this._w * l; + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm - } + // q is assumed to be normalized - this.onChangeCallback(); + this.w = 2 * Math.acos( q.w ); - return this; + const s = Math.sqrt( 1 - q.w * q.w ); - }, + if ( s < 0.0001 ) { - multiply: function ( q, p ) { + this.x = 1; + this.y = 0; + this.z = 0; - if ( p !== undefined ) { + } else { - console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); - return this.multiplyQuaternions( q, p ); + this.x = q.x / s; + this.y = q.y / s; + this.z = q.z / s; } - return this.multiplyQuaternions( this, q ); + return this; - }, + } - premultiply: function ( q ) { + setAxisAngleFromRotationMatrix( m ) { - return this.multiplyQuaternions( q, this ); + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm - }, + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - multiplyQuaternions: function ( a, b ) { + let angle, x, y, z; // variables for result + const epsilon = 0.01, // margin to allow for rounding errors + epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees - // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm + te = m.elements, - var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; - var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; + if ( ( Math.abs( m12 - m21 ) < epsilon ) && + ( Math.abs( m13 - m31 ) < epsilon ) && + ( Math.abs( m23 - m32 ) < epsilon ) ) { - this.onChangeCallback(); + // singularity found + // first check for identity matrix which must have +1 for all terms + // in leading diagonal and zero in other terms - return this; + if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && + ( Math.abs( m13 + m31 ) < epsilon2 ) && + ( Math.abs( m23 + m32 ) < epsilon2 ) && + ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { - }, + // this singularity is identity matrix so angle = 0 - slerp: function ( qb, t ) { + this.set( 1, 0, 0, 0 ); - if ( t === 0 ) return this; - if ( t === 1 ) return this.copy( qb ); + return this; // zero angle, arbitrary axis - var x = this._x, y = this._y, z = this._z, w = this._w; + } - // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ + // otherwise this singularity is angle = 180 - var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; + angle = Math.PI; - if ( cosHalfTheta < 0 ) { + const xx = ( m11 + 1 ) / 2; + const yy = ( m22 + 1 ) / 2; + const zz = ( m33 + 1 ) / 2; + const xy = ( m12 + m21 ) / 4; + const xz = ( m13 + m31 ) / 4; + const yz = ( m23 + m32 ) / 4; - this._w = - qb._w; - this._x = - qb._x; - this._y = - qb._y; - this._z = - qb._z; + if ( ( xx > yy ) && ( xx > zz ) ) { - cosHalfTheta = - cosHalfTheta; + // m11 is the largest diagonal term - } else { + if ( xx < epsilon ) { - this.copy( qb ); + x = 0; + y = 0.707106781; + z = 0.707106781; - } - - if ( cosHalfTheta >= 1.0 ) { + } else { - this._w = w; - this._x = x; - this._y = y; - this._z = z; + x = Math.sqrt( xx ); + y = xy / x; + z = xz / x; - return this; + } - } + } else if ( yy > zz ) { - var sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta ); + // m22 is the largest diagonal term - if ( Math.abs( sinHalfTheta ) < 0.001 ) { + if ( yy < epsilon ) { - this._w = 0.5 * ( w + this._w ); - this._x = 0.5 * ( x + this._x ); - this._y = 0.5 * ( y + this._y ); - this._z = 0.5 * ( z + this._z ); + x = 0.707106781; + y = 0; + z = 0.707106781; - return this; + } else { - } + y = Math.sqrt( yy ); + x = xy / y; + z = yz / y; - var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); - var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, - ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; + } - this._w = ( w * ratioA + this._w * ratioB ); - this._x = ( x * ratioA + this._x * ratioB ); - this._y = ( y * ratioA + this._y * ratioB ); - this._z = ( z * ratioA + this._z * ratioB ); + } else { - this.onChangeCallback(); + // m33 is the largest diagonal term so base result on this - return this; + if ( zz < epsilon ) { - }, + x = 0.707106781; + y = 0.707106781; + z = 0; - equals: function ( quaternion ) { + } else { - return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); + z = Math.sqrt( zz ); + x = xz / z; + y = yz / z; - }, + } - fromArray: function ( array, offset ) { + } - if ( offset === undefined ) offset = 0; + this.set( x, y, z, angle ); - this._x = array[ offset ]; - this._y = array[ offset + 1 ]; - this._z = array[ offset + 2 ]; - this._w = array[ offset + 3 ]; + return this; // return 180 deg rotation - this.onChangeCallback(); + } - return this; + // as we have reached here there are no singularities so we can handle normally - }, + let s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + + ( m13 - m31 ) * ( m13 - m31 ) + + ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize - toArray: function ( array, offset ) { + if ( Math.abs( s ) < 0.001 ) s = 1; - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + // prevent divide by zero, should not happen if matrix is orthogonal and should be + // caught by singularity test above, but I've left it in just in case - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._w; + this.x = ( m32 - m23 ) / s; + this.y = ( m13 - m31 ) / s; + this.z = ( m21 - m12 ) / s; + this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); - return array; + return this; - }, + } - onChange: function ( callback ) { + min( v ) { - this.onChangeCallback = callback; + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + this.w = Math.min( this.w, v.w ); return this; - }, + } - onChangeCallback: function () {} + max( v ) { - } ); + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + this.w = Math.max( this.w, v.w ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - * @author WestLangley / http://github.com/WestLangley - */ + return this; - function Vector3( x, y, z ) { + } - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; + clamp( min, max ) { - } + // assumes min < max, componentwise - Object.assign( Vector3.prototype, { + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + this.w = Math.max( min.w, Math.min( max.w, this.w ) ); - isVector3: true, + return this; - set: function ( x, y, z ) { + } - this.x = x; - this.y = y; - this.z = z; + clampScalar( minVal, maxVal ) { + + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); + this.w = Math.max( minVal, Math.min( maxVal, this.w ) ); return this; - }, + } - setScalar: function ( scalar ) { + clampLength( min, max ) { - this.x = scalar; - this.y = scalar; - this.z = scalar; + const length = this.length(); - return this; + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - }, + } - setX: function ( x ) { + floor() { - this.x = x; + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + this.w = Math.floor( this.w ); return this; - }, + } - setY: function ( y ) { + ceil() { - this.y = y; + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + this.w = Math.ceil( this.w ); return this; - }, + } - setZ: function ( z ) { + round() { - this.z = z; + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + this.w = Math.round( this.w ); return this; - }, + } - setComponent: function ( index, value ) { + roundToZero() { - switch ( index ) { + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - default: throw new Error( 'index is out of range: ' + index ); + return this; - } + } - return this; + negate() { - }, + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + this.w = - this.w; - getComponent: function ( index ) { + return this; - switch ( index ) { + } - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - default: throw new Error( 'index is out of range: ' + index ); + dot( v ) { - } + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, + } - clone: function () { + lengthSq() { - return new this.constructor( this.x, this.y, this.z ); + return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; - }, + } - copy: function ( v ) { + length() { - this.x = v.x; - this.y = v.y; - this.z = v.z; + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - return this; + } - }, + manhattanLength() { - add: function ( v, w ) { + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); - if ( w !== undefined ) { + } - console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + normalize() { - } + return this.divideScalar( this.length() || 1 ); - this.x += v.x; - this.y += v.y; - this.z += v.z; + } - return this; + setLength( length ) { - }, + return this.normalize().multiplyScalar( length ); + + } - addScalar: function ( s ) { + lerp( v, alpha ) { - this.x += s; - this.y += s; - this.z += s; + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + this.w += ( v.w - this.w ) * alpha; return this; - }, + } - addVectors: function ( a, b ) { + lerpVectors( v1, v2, alpha ) { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; + this.w = v1.w + ( v2.w - v1.w ) * alpha; return this; - }, + } - addScaledVector: function ( v, s ) { + equals( v ) { - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); - return this; + } - }, + fromArray( array, offset = 0 ) { - sub: function ( v, w ) { + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + this.w = array[ offset + 3 ]; - if ( w !== undefined ) { + return this; - console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + } - } + toArray( array = [], offset = 0 ) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + array[ offset + 3 ] = this.w; - return this; + return array; - }, + } - subScalar: function ( s ) { + fromBufferAttribute( attribute, index ) { - this.x -= s; - this.y -= s; - this.z -= s; + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); + this.w = attribute.getW( index ); return this; - }, + } - subVectors: function ( a, b ) { + random() { - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + this.w = Math.random(); return this; - }, + } - multiply: function ( v, w ) { + *[ Symbol.iterator ]() { - if ( w !== undefined ) { + yield this.x; + yield this.y; + yield this.z; + yield this.w; - console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); - return this.multiplyVectors( v, w ); + } - } + } - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; + /* + In options, we can specify: + * Texture parameters for an auto-generated target texture + * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers + */ + class WebGLRenderTarget extends EventDispatcher { - return this; + constructor( width = 1, height = 1, options = {} ) { - }, + super(); - multiplyScalar: function ( scalar ) { + this.isWebGLRenderTarget = true; - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; + this.width = width; + this.height = height; + this.depth = 1; - return this; + this.scissor = new Vector4( 0, 0, width, height ); + this.scissorTest = false; - }, + this.viewport = new Vector4( 0, 0, width, height ); - multiplyVectors: function ( a, b ) { + const image = { width: width, height: height, depth: 1 }; - this.x = a.x * b.x; - this.y = a.y * b.y; - this.z = a.z * b.z; + if ( options.encoding !== undefined ) { - return this; + // @deprecated, r152 + warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' ); + options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace; - }, + } - applyEuler: function () { + this.texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace ); + this.texture.isRenderTargetTexture = true; - var quaternion = new Quaternion(); + this.texture.flipY = false; + this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; + this.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null; + this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; - return function applyEuler( euler ) { + this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; + this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false; - if ( ! ( euler && euler.isEuler ) ) { + this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; - console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + this.samples = options.samples !== undefined ? options.samples : 0; - } + } - return this.applyQuaternion( quaternion.setFromEuler( euler ) ); + setSize( width, height, depth = 1 ) { - }; + if ( this.width !== width || this.height !== height || this.depth !== depth ) { - }(), + this.width = width; + this.height = height; + this.depth = depth; - applyAxisAngle: function () { + this.texture.image.width = width; + this.texture.image.height = height; + this.texture.image.depth = depth; - var quaternion = new Quaternion(); + this.dispose(); - return function applyAxisAngle( axis, angle ) { + } - return this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) ); + this.viewport.set( 0, 0, width, height ); + this.scissor.set( 0, 0, width, height ); - }; + } - }(), + clone() { - applyMatrix3: function ( m ) { + return new this.constructor().copy( this ); - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + } - this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; - this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; - this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; + copy( source ) { - return this; + this.width = source.width; + this.height = source.height; + this.depth = source.depth; - }, + this.scissor.copy( source.scissor ); + this.scissorTest = source.scissorTest; - applyMatrix4: function ( m ) { + this.viewport.copy( source.viewport ); - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + this.texture = source.texture.clone(); + this.texture.isRenderTargetTexture = true; - var w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); + // ensure image object is not shared, see #20328 - this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; - this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; - this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; + const image = Object.assign( {}, source.texture.image ); + this.texture.source = new Source( image ); - return this; + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; - }, + if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone(); - applyQuaternion: function ( q ) { + this.samples = source.samples; - var x = this.x, y = this.y, z = this.z; - var qx = q.x, qy = q.y, qz = q.z, qw = q.w; + return this; - // calculate quat * vector + } - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = - qx * x - qy * y - qz * z; + dispose() { - // calculate result * inverse quat + this.dispatchEvent( { type: 'dispose' } ); - this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; - this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; - this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; + } - return this; + } - }, + class DataArrayTexture extends Texture { - project: function () { + constructor( data = null, width = 1, height = 1, depth = 1 ) { - var matrix = new Matrix4(); + super( null ); - return function project( camera ) { + this.isDataArrayTexture = true; - matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) ); - return this.applyMatrix4( matrix ); + this.image = { data, width, height, depth }; - }; + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; - }(), + this.wrapR = ClampToEdgeWrapping; - unproject: function () { + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; - var matrix = new Matrix4(); + } - return function unproject( camera ) { + } - matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) ); - return this.applyMatrix4( matrix ); + class WebGLArrayRenderTarget extends WebGLRenderTarget { - }; + constructor( width = 1, height = 1, depth = 1 ) { - }(), + super( width, height ); - transformDirection: function ( m ) { + this.isWebGLArrayRenderTarget = true; - // input: THREE.Matrix4 affine matrix - // vector interpreted as a direction + this.depth = depth; - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + this.texture = new DataArrayTexture( null, width, height, depth ); - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; + this.texture.isRenderTargetTexture = true; - return this.normalize(); + } - }, + } - divide: function ( v ) { + class Data3DTexture extends Texture { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; + constructor( data = null, width = 1, height = 1, depth = 1 ) { - return this; + // We're going to add .setXXX() methods for setting properties later. + // Users can still set in DataTexture3D directly. + // + // const texture = new THREE.DataTexture3D( data, width, height, depth ); + // texture.anisotropy = 16; + // + // See #14839 - }, + super( null ); - divideScalar: function ( scalar ) { + this.isData3DTexture = true; - return this.multiplyScalar( 1 / scalar ); + this.image = { data, width, height, depth }; - }, + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; - min: function ( v ) { + this.wrapR = ClampToEdgeWrapping; - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; - return this; + } - }, + } - max: function ( v ) { + class WebGL3DRenderTarget extends WebGLRenderTarget { - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); + constructor( width = 1, height = 1, depth = 1 ) { - return this; + super( width, height ); - }, + this.isWebGL3DRenderTarget = true; - clamp: function ( min, max ) { + this.depth = depth; - // assumes min < max, componentwise + this.texture = new Data3DTexture( null, width, height, depth ); - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + this.texture.isRenderTargetTexture = true; - return this; + } - }, + } - clampScalar: function () { + class WebGLMultipleRenderTargets extends WebGLRenderTarget { - var min = new Vector3(); - var max = new Vector3(); + constructor( width = 1, height = 1, count = 1, options = {} ) { - return function clampScalar( minVal, maxVal ) { + super( width, height, options ); - min.set( minVal, minVal, minVal ); - max.set( maxVal, maxVal, maxVal ); + this.isWebGLMultipleRenderTargets = true; - return this.clamp( min, max ); + const texture = this.texture; - }; + this.texture = []; - }(), + for ( let i = 0; i < count; i ++ ) { - clampLength: function ( min, max ) { + this.texture[ i ] = texture.clone(); + this.texture[ i ].isRenderTargetTexture = true; - var length = this.length(); + } - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + } - }, + setSize( width, height, depth = 1 ) { - floor: function () { + if ( this.width !== width || this.height !== height || this.depth !== depth ) { - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); + this.width = width; + this.height = height; + this.depth = depth; - return this; + for ( let i = 0, il = this.texture.length; i < il; i ++ ) { - }, + this.texture[ i ].image.width = width; + this.texture[ i ].image.height = height; + this.texture[ i ].image.depth = depth; - ceil: function () { + } - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); + this.dispose(); - return this; + } - }, + this.viewport.set( 0, 0, width, height ); + this.scissor.set( 0, 0, width, height ); - round: function () { + return this; - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); + } - return this; + copy( source ) { - }, + this.dispose(); - roundToZero: function () { + this.width = source.width; + this.height = source.height; + this.depth = source.depth; - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.scissor.copy( source.scissor ); + this.scissorTest = source.scissorTest; - return this; + this.viewport.copy( source.viewport ); - }, + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; - negate: function () { + if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone(); - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; + this.texture.length = 0; - return this; + for ( let i = 0, il = source.texture.length; i < il; i ++ ) { - }, + this.texture[ i ] = source.texture[ i ].clone(); + this.texture[ i ].isRenderTargetTexture = true; - dot: function ( v ) { + } - return this.x * v.x + this.y * v.y + this.z * v.z; + return this; - }, + } - // TODO lengthSquared? + } - lengthSq: function () { + class Quaternion { - return this.x * this.x + this.y * this.y + this.z * this.z; + constructor( x = 0, y = 0, z = 0, w = 1 ) { - }, + this.isQuaternion = true; - length: function () { + this._x = x; + this._y = y; + this._z = z; + this._w = w; - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); + } - }, + static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { - lengthManhattan: function () { + // fuzz-free, array-based Quaternion SLERP operation - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); + let x0 = src0[ srcOffset0 + 0 ], + y0 = src0[ srcOffset0 + 1 ], + z0 = src0[ srcOffset0 + 2 ], + w0 = src0[ srcOffset0 + 3 ]; - }, + const x1 = src1[ srcOffset1 + 0 ], + y1 = src1[ srcOffset1 + 1 ], + z1 = src1[ srcOffset1 + 2 ], + w1 = src1[ srcOffset1 + 3 ]; - normalize: function () { + if ( t === 0 ) { - return this.divideScalar( this.length() || 1 ); + dst[ dstOffset + 0 ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; + return; - }, + } - setLength: function ( length ) { + if ( t === 1 ) { - return this.normalize().multiplyScalar( length ); + dst[ dstOffset + 0 ] = x1; + dst[ dstOffset + 1 ] = y1; + dst[ dstOffset + 2 ] = z1; + dst[ dstOffset + 3 ] = w1; + return; - }, + } - lerp: function ( v, alpha ) { + if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; + let s = 1 - t; + const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, + dir = ( cos >= 0 ? 1 : - 1 ), + sqrSin = 1 - cos * cos; - return this; + // Skip the Slerp for tiny steps to avoid numeric problems: + if ( sqrSin > Number.EPSILON ) { - }, + const sin = Math.sqrt( sqrSin ), + len = Math.atan2( sin, cos * dir ); - lerpVectors: function ( v1, v2, alpha ) { + s = Math.sin( s * len ) / sin; + t = Math.sin( t * len ) / sin; - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + } - }, + const tDir = t * dir; - cross: function ( v, w ) { + x0 = x0 * s + x1 * tDir; + y0 = y0 * s + y1 * tDir; + z0 = z0 * s + z1 * tDir; + w0 = w0 * s + w1 * tDir; - if ( w !== undefined ) { + // Normalize in case we just did a lerp: + if ( s === 1 - t ) { - console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); - return this.crossVectors( v, w ); + const f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); - } + x0 *= f; + y0 *= f; + z0 *= f; + w0 *= f; - var x = this.x, y = this.y, z = this.z; + } - this.x = y * v.z - z * v.y; - this.y = z * v.x - x * v.z; - this.z = x * v.y - y * v.x; + } - return this; + dst[ dstOffset ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; - }, + } - crossVectors: function ( a, b ) { + static multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { - var ax = a.x, ay = a.y, az = a.z; - var bx = b.x, by = b.y, bz = b.z; + const x0 = src0[ srcOffset0 ]; + const y0 = src0[ srcOffset0 + 1 ]; + const z0 = src0[ srcOffset0 + 2 ]; + const w0 = src0[ srcOffset0 + 3 ]; - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; + const x1 = src1[ srcOffset1 ]; + const y1 = src1[ srcOffset1 + 1 ]; + const z1 = src1[ srcOffset1 + 2 ]; + const w1 = src1[ srcOffset1 + 3 ]; - return this; + dst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; + dst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; + dst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; + dst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; - }, + return dst; - projectOnVector: function ( vector ) { + } - var scalar = vector.dot( this ) / vector.lengthSq(); + get x() { - return this.copy( vector ).multiplyScalar( scalar ); + return this._x; - }, + } - projectOnPlane: function () { + set x( value ) { - var v1 = new Vector3(); + this._x = value; + this._onChangeCallback(); - return function projectOnPlane( planeNormal ) { + } - v1.copy( this ).projectOnVector( planeNormal ); + get y() { - return this.sub( v1 ); + return this._y; - }; + } - }(), + set y( value ) { - reflect: function () { + this._y = value; + this._onChangeCallback(); - // reflect incident vector off plane orthogonal to normal - // normal is assumed to have unit length + } - var v1 = new Vector3(); + get z() { - return function reflect( normal ) { + return this._z; - return this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); + } - }; + set z( value ) { - }(), + this._z = value; + this._onChangeCallback(); - angleTo: function ( v ) { + } - var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) ); + get w() { - // clamp, to handle numerical problems + return this._w; - return Math.acos( _Math.clamp( theta, - 1, 1 ) ); + } - }, + set w( value ) { - distanceTo: function ( v ) { + this._w = value; + this._onChangeCallback(); - return Math.sqrt( this.distanceToSquared( v ) ); + } - }, + set( x, y, z, w ) { - distanceToSquared: function ( v ) { + this._x = x; + this._y = y; + this._z = z; + this._w = w; - var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; + this._onChangeCallback(); - return dx * dx + dy * dy + dz * dz; + return this; - }, + } - distanceToManhattan: function ( v ) { + clone() { - return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); + return new this.constructor( this._x, this._y, this._z, this._w ); - }, + } - setFromSpherical: function ( s ) { + copy( quaternion ) { - var sinPhiRadius = Math.sin( s.phi ) * s.radius; + this._x = quaternion.x; + this._y = quaternion.y; + this._z = quaternion.z; + this._w = quaternion.w; - this.x = sinPhiRadius * Math.sin( s.theta ); - this.y = Math.cos( s.phi ) * s.radius; - this.z = sinPhiRadius * Math.cos( s.theta ); + this._onChangeCallback(); return this; - }, + } - setFromCylindrical: function ( c ) { + setFromEuler( euler, update ) { - this.x = c.radius * Math.sin( c.theta ); - this.y = c.y; - this.z = c.radius * Math.cos( c.theta ); + const x = euler._x, y = euler._y, z = euler._z, order = euler._order; - return this; + // http://www.mathworks.com/matlabcentral/fileexchange/ + // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ + // content/SpinCalc.m - }, + const cos = Math.cos; + const sin = Math.sin; - setFromMatrixPosition: function ( m ) { + const c1 = cos( x / 2 ); + const c2 = cos( y / 2 ); + const c3 = cos( z / 2 ); - var e = m.elements; + const s1 = sin( x / 2 ); + const s2 = sin( y / 2 ); + const s3 = sin( z / 2 ); - this.x = e[ 12 ]; - this.y = e[ 13 ]; - this.z = e[ 14 ]; + switch ( order ) { - return this; + case 'XYZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - }, + case 'YXZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - setFromMatrixScale: function ( m ) { + case 'ZXY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - var sx = this.setFromMatrixColumn( m, 0 ).length(); - var sy = this.setFromMatrixColumn( m, 1 ).length(); - var sz = this.setFromMatrixColumn( m, 2 ).length(); + case 'ZYX': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - this.x = sx; - this.y = sy; - this.z = sz; + case 'YZX': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - return this; + case 'XZY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - }, + default: + console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order ); - setFromMatrixColumn: function ( m, index ) { + } - return this.fromArray( m.elements, index * 4 ); + if ( update !== false ) this._onChangeCallback(); - }, + return this; - equals: function ( v ) { + } - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); + setFromAxisAngle( axis, angle ) { - }, + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm - fromArray: function ( array, offset ) { + // assumes axis is normalized - if ( offset === undefined ) offset = 0; + const halfAngle = angle / 2, s = Math.sin( halfAngle ); - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; + this._x = axis.x * s; + this._y = axis.y * s; + this._z = axis.z * s; + this._w = Math.cos( halfAngle ); + + this._onChangeCallback(); return this; - }, + } - toArray: function ( array, offset ) { + setFromRotationMatrix( m ) { - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - return array; + const te = m.elements, - }, + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], - fromBufferAttribute: function ( attribute, index, offset ) { + trace = m11 + m22 + m33; - if ( offset !== undefined ) { + if ( trace > 0 ) { - console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' ); + const s = 0.5 / Math.sqrt( trace + 1.0 ); - } + this._w = 0.25 / s; + this._x = ( m32 - m23 ) * s; + this._y = ( m13 - m31 ) * s; + this._z = ( m21 - m12 ) * s; - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); + } else if ( m11 > m22 && m11 > m33 ) { - return this; + const s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); - } + this._w = ( m32 - m23 ) / s; + this._x = 0.25 * s; + this._y = ( m12 + m21 ) / s; + this._z = ( m13 + m31 ) / s; + + } else if ( m22 > m33 ) { - } ); + const s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author jordi_ros / http://plattsoft.com - * @author D1plo1d / http://github.com/D1plo1d - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author timknip / http://www.floorplanner.com/ - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - */ + this._w = ( m13 - m31 ) / s; + this._x = ( m12 + m21 ) / s; + this._y = 0.25 * s; + this._z = ( m23 + m32 ) / s; - function Matrix4() { + } else { - this.elements = [ + const s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + this._w = ( m21 - m12 ) / s; + this._x = ( m13 + m31 ) / s; + this._y = ( m23 + m32 ) / s; + this._z = 0.25 * s; - ]; + } - if ( arguments.length > 0 ) { + this._onChangeCallback(); - console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + return this; } - } + setFromUnitVectors( vFrom, vTo ) { - Object.assign( Matrix4.prototype, { + // assumes direction vectors vFrom and vTo are normalized - isMatrix4: true, + let r = vFrom.dot( vTo ) + 1; - set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + if ( r < Number.EPSILON ) { - var te = this.elements; + // vFrom and vTo point in opposite directions - te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; - te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; - te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; - te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; + r = 0; - return this; + if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { - }, + this._x = - vFrom.y; + this._y = vFrom.x; + this._z = 0; + this._w = r; - identity: function () { + } else { - this.set( + this._x = 0; + this._y = - vFrom.z; + this._z = vFrom.y; + this._w = r; - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + } - ); + } else { - return this; + // crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3 - }, + this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; + this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; + this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; + this._w = r; - clone: function () { + } - return new Matrix4().fromArray( this.elements ); + return this.normalize(); - }, + } - copy: function ( m ) { + angleTo( q ) { - var te = this.elements; - var me = m.elements; + return 2 * Math.acos( Math.abs( clamp( this.dot( q ), - 1, 1 ) ) ); - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; - te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; - te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; - te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; + } - return this; + rotateTowards( q, step ) { - }, + const angle = this.angleTo( q ); - copyPosition: function ( m ) { + if ( angle === 0 ) return this; - var te = this.elements, me = m.elements; + const t = Math.min( 1, step / angle ); - te[ 12 ] = me[ 12 ]; - te[ 13 ] = me[ 13 ]; - te[ 14 ] = me[ 14 ]; + this.slerp( q, t ); return this; - }, + } - extractBasis: function ( xAxis, yAxis, zAxis ) { + identity() { - xAxis.setFromMatrixColumn( this, 0 ); - yAxis.setFromMatrixColumn( this, 1 ); - zAxis.setFromMatrixColumn( this, 2 ); + return this.set( 0, 0, 0, 1 ); - return this; + } - }, + invert() { - makeBasis: function ( xAxis, yAxis, zAxis ) { + // quaternion is assumed to have unit length - this.set( - xAxis.x, yAxis.x, zAxis.x, 0, - xAxis.y, yAxis.y, zAxis.y, 0, - xAxis.z, yAxis.z, zAxis.z, 0, - 0, 0, 0, 1 - ); + return this.conjugate(); + + } + + conjugate() { + + this._x *= - 1; + this._y *= - 1; + this._z *= - 1; + + this._onChangeCallback(); return this; - }, + } + + dot( v ) { - extractRotation: function () { + return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; - var v1 = new Vector3(); + } - return function extractRotation( m ) { + lengthSq() { - var te = this.elements; - var me = m.elements; + return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; - var scaleX = 1 / v1.setFromMatrixColumn( m, 0 ).length(); - var scaleY = 1 / v1.setFromMatrixColumn( m, 1 ).length(); - var scaleZ = 1 / v1.setFromMatrixColumn( m, 2 ).length(); + } - te[ 0 ] = me[ 0 ] * scaleX; - te[ 1 ] = me[ 1 ] * scaleX; - te[ 2 ] = me[ 2 ] * scaleX; + length() { - te[ 4 ] = me[ 4 ] * scaleY; - te[ 5 ] = me[ 5 ] * scaleY; - te[ 6 ] = me[ 6 ] * scaleY; + return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); - te[ 8 ] = me[ 8 ] * scaleZ; - te[ 9 ] = me[ 9 ] * scaleZ; - te[ 10 ] = me[ 10 ] * scaleZ; + } - return this; + normalize() { - }; + let l = this.length(); - }(), + if ( l === 0 ) { + + this._x = 0; + this._y = 0; + this._z = 0; + this._w = 1; - makeRotationFromEuler: function ( euler ) { + } else { - if ( ! ( euler && euler.isEuler ) ) { + l = 1 / l; - console.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); + this._x = this._x * l; + this._y = this._y * l; + this._z = this._z * l; + this._w = this._w * l; } - var te = this.elements; + this._onChangeCallback(); - var x = euler.x, y = euler.y, z = euler.z; - var a = Math.cos( x ), b = Math.sin( x ); - var c = Math.cos( y ), d = Math.sin( y ); - var e = Math.cos( z ), f = Math.sin( z ); + return this; - if ( euler.order === 'XYZ' ) { + } - var ae = a * e, af = a * f, be = b * e, bf = b * f; + multiply( q ) { - te[ 0 ] = c * e; - te[ 4 ] = - c * f; - te[ 8 ] = d; + return this.multiplyQuaternions( this, q ); - te[ 1 ] = af + be * d; - te[ 5 ] = ae - bf * d; - te[ 9 ] = - b * c; + } - te[ 2 ] = bf - ae * d; - te[ 6 ] = be + af * d; - te[ 10 ] = a * c; + premultiply( q ) { - } else if ( euler.order === 'YXZ' ) { + return this.multiplyQuaternions( q, this ); - var ce = c * e, cf = c * f, de = d * e, df = d * f; + } - te[ 0 ] = ce + df * b; - te[ 4 ] = de * b - cf; - te[ 8 ] = a * d; + multiplyQuaternions( a, b ) { - te[ 1 ] = a * f; - te[ 5 ] = a * e; - te[ 9 ] = - b; + // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm - te[ 2 ] = cf * b - de; - te[ 6 ] = df + ce * b; - te[ 10 ] = a * c; + const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; + const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; - } else if ( euler.order === 'ZXY' ) { + this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - var ce = c * e, cf = c * f, de = d * e, df = d * f; + this._onChangeCallback(); - te[ 0 ] = ce - df * b; - te[ 4 ] = - a * f; - te[ 8 ] = de + cf * b; + return this; - te[ 1 ] = cf + de * b; - te[ 5 ] = a * e; - te[ 9 ] = df - ce * b; + } - te[ 2 ] = - a * d; - te[ 6 ] = b; - te[ 10 ] = a * c; + slerp( qb, t ) { - } else if ( euler.order === 'ZYX' ) { + if ( t === 0 ) return this; + if ( t === 1 ) return this.copy( qb ); - var ae = a * e, af = a * f, be = b * e, bf = b * f; + const x = this._x, y = this._y, z = this._z, w = this._w; - te[ 0 ] = c * e; - te[ 4 ] = be * d - af; - te[ 8 ] = ae * d + bf; + // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ - te[ 1 ] = c * f; - te[ 5 ] = bf * d + ae; - te[ 9 ] = af * d - be; + let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; - te[ 2 ] = - d; - te[ 6 ] = b * c; - te[ 10 ] = a * c; + if ( cosHalfTheta < 0 ) { - } else if ( euler.order === 'YZX' ) { + this._w = - qb._w; + this._x = - qb._x; + this._y = - qb._y; + this._z = - qb._z; - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; + cosHalfTheta = - cosHalfTheta; - te[ 0 ] = c * e; - te[ 4 ] = bd - ac * f; - te[ 8 ] = bc * f + ad; + } else { - te[ 1 ] = f; - te[ 5 ] = a * e; - te[ 9 ] = - b * e; + this.copy( qb ); - te[ 2 ] = - d * e; - te[ 6 ] = ad * f + bc; - te[ 10 ] = ac - bd * f; + } - } else if ( euler.order === 'XZY' ) { + if ( cosHalfTheta >= 1.0 ) { - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; + this._w = w; + this._x = x; + this._y = y; + this._z = z; - te[ 0 ] = c * e; - te[ 4 ] = - f; - te[ 8 ] = d * e; + return this; - te[ 1 ] = ac * f + bd; - te[ 5 ] = a * e; - te[ 9 ] = ad * f - bc; + } - te[ 2 ] = bc * f - ad; - te[ 6 ] = b * e; - te[ 10 ] = bd * f + ac; + const sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; + + if ( sqrSinHalfTheta <= Number.EPSILON ) { + + const s = 1 - t; + this._w = s * w + t * this._w; + this._x = s * x + t * this._x; + this._y = s * y + t * this._y; + this._z = s * z + t * this._z; + + this.normalize(); + this._onChangeCallback(); + + return this; } - // last column - te[ 3 ] = 0; - te[ 7 ] = 0; - te[ 11 ] = 0; + const sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); + const halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); + const ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, + ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; - // bottom row - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + this._w = ( w * ratioA + this._w * ratioB ); + this._x = ( x * ratioA + this._x * ratioB ); + this._y = ( y * ratioA + this._y * ratioB ); + this._z = ( z * ratioA + this._z * ratioB ); + + this._onChangeCallback(); return this; - }, + } - makeRotationFromQuaternion: function ( q ) { + slerpQuaternions( qa, qb, t ) { - var te = this.elements; + return this.copy( qa ).slerp( qb, t ); - var x = q._x, y = q._y, z = q._z, w = q._w; - var x2 = x + x, y2 = y + y, z2 = z + z; - var xx = x * x2, xy = x * y2, xz = x * z2; - var yy = y * y2, yz = y * z2, zz = z * z2; - var wx = w * x2, wy = w * y2, wz = w * z2; + } - te[ 0 ] = 1 - ( yy + zz ); - te[ 4 ] = xy - wz; - te[ 8 ] = xz + wy; + random() { - te[ 1 ] = xy + wz; - te[ 5 ] = 1 - ( xx + zz ); - te[ 9 ] = yz - wx; + // Derived from http://planning.cs.uiuc.edu/node198.html + // Note, this source uses w, x, y, z ordering, + // so we swap the order below. - te[ 2 ] = xz - wy; - te[ 6 ] = yz + wx; - te[ 10 ] = 1 - ( xx + yy ); + const u1 = Math.random(); + const sqrt1u1 = Math.sqrt( 1 - u1 ); + const sqrtu1 = Math.sqrt( u1 ); - // last column - te[ 3 ] = 0; - te[ 7 ] = 0; - te[ 11 ] = 0; - - // bottom row - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + const u2 = 2 * Math.PI * Math.random(); - return this; + const u3 = 2 * Math.PI * Math.random(); - }, + return this.set( + sqrt1u1 * Math.cos( u2 ), + sqrtu1 * Math.sin( u3 ), + sqrtu1 * Math.cos( u3 ), + sqrt1u1 * Math.sin( u2 ), + ); - lookAt: function () { + } - var x = new Vector3(); - var y = new Vector3(); - var z = new Vector3(); + equals( quaternion ) { - return function lookAt( eye, target, up ) { + return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); - var te = this.elements; + } - z.subVectors( eye, target ); + fromArray( array, offset = 0 ) { - if ( z.lengthSq() === 0 ) { + this._x = array[ offset ]; + this._y = array[ offset + 1 ]; + this._z = array[ offset + 2 ]; + this._w = array[ offset + 3 ]; - // eye and target are in the same position + this._onChangeCallback(); - z.z = 1; + return this; - } + } - z.normalize(); - x.crossVectors( up, z ); + toArray( array = [], offset = 0 ) { - if ( x.lengthSq() === 0 ) { + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._w; - // up and z are parallel + return array; - if ( Math.abs( up.z ) === 1 ) { + } - z.x += 0.0001; + fromBufferAttribute( attribute, index ) { - } else { + this._x = attribute.getX( index ); + this._y = attribute.getY( index ); + this._z = attribute.getZ( index ); + this._w = attribute.getW( index ); - z.z += 0.0001; + return this; - } + } - z.normalize(); - x.crossVectors( up, z ); + toJSON() { - } + return this.toArray(); - x.normalize(); - y.crossVectors( z, x ); + } - te[ 0 ] = x.x; te[ 4 ] = y.x; te[ 8 ] = z.x; - te[ 1 ] = x.y; te[ 5 ] = y.y; te[ 9 ] = z.y; - te[ 2 ] = x.z; te[ 6 ] = y.z; te[ 10 ] = z.z; + _onChange( callback ) { - return this; + this._onChangeCallback = callback; - }; + return this; - }(), + } - multiply: function ( m, n ) { + _onChangeCallback() {} - if ( n !== undefined ) { + *[ Symbol.iterator ]() { - console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); - return this.multiplyMatrices( m, n ); + yield this._x; + yield this._y; + yield this._z; + yield this._w; - } + } - return this.multiplyMatrices( this, m ); + } - }, + class Vector3 { - premultiply: function ( m ) { + constructor( x = 0, y = 0, z = 0 ) { - return this.multiplyMatrices( m, this ); + Vector3.prototype.isVector3 = true; - }, + this.x = x; + this.y = y; + this.z = z; - multiplyMatrices: function ( a, b ) { + } - var ae = a.elements; - var be = b.elements; - var te = this.elements; + set( x, y, z ) { - var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; - var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; - var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; - var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; + if ( z === undefined ) z = this.z; // sprite.scale.set(x,y) - var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; - var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; - var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; - var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; + this.x = x; + this.y = y; + this.z = z; - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + return this; - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + } - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + setScalar( scalar ) { - te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + this.x = scalar; + this.y = scalar; + this.z = scalar; return this; - }, - - multiplyScalar: function ( s ) { + } - var te = this.elements; + setX( x ) { - te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; - te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; - te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; - te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; + this.x = x; return this; - }, + } - applyToBufferAttribute: function () { + setY( y ) { - var v1 = new Vector3(); + this.y = y; - return function applyToBufferAttribute( attribute ) { + return this; - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + } - v1.x = attribute.getX( i ); - v1.y = attribute.getY( i ); - v1.z = attribute.getZ( i ); + setZ( z ) { - v1.applyMatrix4( this ); + this.z = z; - attribute.setXYZ( i, v1.x, v1.y, v1.z ); + return this; - } + } - return attribute; + setComponent( index, value ) { - }; + switch ( index ) { - }(), + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + default: throw new Error( 'index is out of range: ' + index ); - determinant: function () { + } - var te = this.elements; + return this; - var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; - var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; - var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; - var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; + } - //TODO: make this more efficient - //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) + getComponent( index ) { - return ( - n41 * ( - + n14 * n23 * n32 - - n13 * n24 * n32 - - n14 * n22 * n33 - + n12 * n24 * n33 - + n13 * n22 * n34 - - n12 * n23 * n34 - ) + - n42 * ( - + n11 * n23 * n34 - - n11 * n24 * n33 - + n14 * n21 * n33 - - n13 * n21 * n34 - + n13 * n24 * n31 - - n14 * n23 * n31 - ) + - n43 * ( - + n11 * n24 * n32 - - n11 * n22 * n34 - - n14 * n21 * n32 - + n12 * n21 * n34 - + n14 * n22 * n31 - - n12 * n24 * n31 - ) + - n44 * ( - - n13 * n22 * n31 - - n11 * n23 * n32 - + n11 * n22 * n33 - + n13 * n21 * n32 - - n12 * n21 * n33 - + n12 * n23 * n31 - ) + switch ( index ) { - ); + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + default: throw new Error( 'index is out of range: ' + index ); - }, + } - transpose: function () { + } - var te = this.elements; - var tmp; + clone() { - tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; - tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; - tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; + return new this.constructor( this.x, this.y, this.z ); - tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; - tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; - tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; + } - return this; + copy( v ) { - }, + this.x = v.x; + this.y = v.y; + this.z = v.z; - setPosition: function ( v ) { + return this; - var te = this.elements; + } - te[ 12 ] = v.x; - te[ 13 ] = v.y; - te[ 14 ] = v.z; + add( v ) { - return this; + this.x += v.x; + this.y += v.y; + this.z += v.z; - }, + return this; - getInverse: function ( m, throwOnDegenerate ) { + } - // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - var te = this.elements, - me = m.elements, + addScalar( s ) { - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], - n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], - n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], - n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], + this.x += s; + this.y += s; + this.z += s; - t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, - t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, - t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, - t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + return this; - var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + } - if ( det === 0 ) { + addVectors( a, b ) { - var msg = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"; + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; - if ( throwOnDegenerate === true ) { + return this; - throw new Error( msg ); + } - } else { + addScaledVector( v, s ) { - console.warn( msg ); + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; - } + return this; - return this.identity(); + } - } + sub( v ) { - var detInv = 1 / det; + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; - te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; - te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; + return this; - te[ 4 ] = t12 * detInv; - te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; - te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; - te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; + } - te[ 8 ] = t13 * detInv; - te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; - te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; - te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; + subScalar( s ) { - te[ 12 ] = t14 * detInv; - te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; - te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; - te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; + this.x -= s; + this.y -= s; + this.z -= s; return this; - }, - - scale: function ( v ) { + } - var te = this.elements; - var x = v.x, y = v.y, z = v.z; + subVectors( a, b ) { - te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; - te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; - te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; - te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; return this; - }, + } - getMaxScaleOnAxis: function () { + multiply( v ) { - var te = this.elements; + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + + return this; - var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; - var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; - var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; + } - return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); + multiplyScalar( scalar ) { - }, + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; - makeTranslation: function ( x, y, z ) { + return this; - this.set( + } - 1, 0, 0, x, - 0, 1, 0, y, - 0, 0, 1, z, - 0, 0, 0, 1 + multiplyVectors( a, b ) { - ); + this.x = a.x * b.x; + this.y = a.y * b.y; + this.z = a.z * b.z; return this; - }, + } - makeRotationX: function ( theta ) { + applyEuler( euler ) { - var c = Math.cos( theta ), s = Math.sin( theta ); + return this.applyQuaternion( _quaternion$4.setFromEuler( euler ) ); - this.set( + } - 1, 0, 0, 0, - 0, c, - s, 0, - 0, s, c, 0, - 0, 0, 0, 1 + applyAxisAngle( axis, angle ) { - ); + return this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) ); - return this; + } - }, + applyMatrix3( m ) { - makeRotationY: function ( theta ) { + const x = this.x, y = this.y, z = this.z; + const e = m.elements; - var c = Math.cos( theta ), s = Math.sin( theta ); + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; + this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; - this.set( - - c, 0, s, 0, - 0, 1, 0, 0, - - s, 0, c, 0, - 0, 0, 0, 1 + return this; - ); + } - return this; + applyNormalMatrix( m ) { - }, + return this.applyMatrix3( m ).normalize(); - makeRotationZ: function ( theta ) { + } - var c = Math.cos( theta ), s = Math.sin( theta ); + applyMatrix4( m ) { - this.set( + const x = this.x, y = this.y, z = this.z; + const e = m.elements; - c, - s, 0, 0, - s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + const w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); - ); + this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; + this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; + this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; return this; - }, + } - makeRotationAxis: function ( axis, angle ) { + applyQuaternion( q ) { - // Based on http://www.gamedev.net/reference/articles/article1199.asp + const x = this.x, y = this.y, z = this.z; + const qx = q.x, qy = q.y, qz = q.z, qw = q.w; - var c = Math.cos( angle ); - var s = Math.sin( angle ); - var t = 1 - c; - var x = axis.x, y = axis.y, z = axis.z; - var tx = t * x, ty = t * y; + // calculate quat * vector - this.set( + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = - qx * x - qy * y - qz * z; - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 + // calculate result * inverse quat - ); + this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; + this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; + this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; - return this; + return this; - }, + } - makeScale: function ( x, y, z ) { + project( camera ) { - this.set( + return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); - x, 0, 0, 0, - 0, y, 0, 0, - 0, 0, z, 0, - 0, 0, 0, 1 + } - ); + unproject( camera ) { - return this; + return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); - }, + } - makeShear: function ( x, y, z ) { + transformDirection( m ) { - this.set( + // input: THREE.Matrix4 affine matrix + // vector interpreted as a direction - 1, y, z, 0, - x, 1, z, 0, - x, y, 1, 0, - 0, 0, 0, 1 + const x = this.x, y = this.y, z = this.z; + const e = m.elements; - ); + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; - return this; + return this.normalize(); - }, + } - compose: function ( position, quaternion, scale ) { + divide( v ) { - this.makeRotationFromQuaternion( quaternion ); - this.scale( scale ); - this.setPosition( position ); + this.x /= v.x; + this.y /= v.y; + this.z /= v.z; return this; - }, + } - decompose: function () { + divideScalar( scalar ) { - var vector = new Vector3(); - var matrix = new Matrix4(); + return this.multiplyScalar( 1 / scalar ); - return function decompose( position, quaternion, scale ) { + } - var te = this.elements; + min( v ) { - var sx = vector.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); - var sy = vector.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); - var sz = vector.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); - // if determine is negative, we need to invert one scale - var det = this.determinant(); - if ( det < 0 ) sx = - sx; + return this; - position.x = te[ 12 ]; - position.y = te[ 13 ]; - position.z = te[ 14 ]; + } - // scale the rotation part - matrix.copy( this ); + max( v ) { - var invSX = 1 / sx; - var invSY = 1 / sy; - var invSZ = 1 / sz; + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); - matrix.elements[ 0 ] *= invSX; - matrix.elements[ 1 ] *= invSX; - matrix.elements[ 2 ] *= invSX; + return this; - matrix.elements[ 4 ] *= invSY; - matrix.elements[ 5 ] *= invSY; - matrix.elements[ 6 ] *= invSY; + } - matrix.elements[ 8 ] *= invSZ; - matrix.elements[ 9 ] *= invSZ; - matrix.elements[ 10 ] *= invSZ; + clamp( min, max ) { - quaternion.setFromRotationMatrix( matrix ); + // assumes min < max, componentwise - scale.x = sx; - scale.y = sy; - scale.z = sz; + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - return this; + return this; - }; + } - }(), + clampScalar( minVal, maxVal ) { - makePerspective: function ( left, right, top, bottom, near, far ) { + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); - if ( far === undefined ) { + return this; - console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); + } - } + clampLength( min, max ) { - var te = this.elements; - var x = 2 * near / ( right - left ); - var y = 2 * near / ( top - bottom ); + const length = this.length(); - var a = ( right + left ) / ( right - left ); - var b = ( top + bottom ) / ( top - bottom ); - var c = - ( far + near ) / ( far - near ); - var d = - 2 * far * near / ( far - near ); + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; + } - return this; + floor() { - }, + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); - makeOrthographic: function ( left, right, top, bottom, near, far ) { + return this; - var te = this.elements; - var w = 1.0 / ( right - left ); - var h = 1.0 / ( top - bottom ); - var p = 1.0 / ( far - near ); + } - var x = ( right + left ) * w; - var y = ( top + bottom ) * h; - var z = ( far + near ) * p; + ceil() { - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); return this; - }, - - equals: function ( matrix ) { - - var te = this.elements; - var me = matrix.elements; + } - for ( var i = 0; i < 16; i ++ ) { + round() { - if ( te[ i ] !== me[ i ] ) return false; + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); - } + return this; - return true; + } - }, + roundToZero() { - fromArray: function ( array, offset ) { + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - if ( offset === undefined ) offset = 0; + return this; - for ( var i = 0; i < 16; i ++ ) { + } - this.elements[ i ] = array[ i + offset ]; + negate() { - } + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; return this; - }, + } - toArray: function ( array, offset ) { + dot( v ) { - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + return this.x * v.x + this.y * v.y + this.z * v.z; - var te = this.elements; + } - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; - array[ offset + 3 ] = te[ 3 ]; + // TODO lengthSquared? - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; + lengthSq() { - array[ offset + 8 ] = te[ 8 ]; - array[ offset + 9 ] = te[ 9 ]; - array[ offset + 10 ] = te[ 10 ]; - array[ offset + 11 ] = te[ 11 ]; + return this.x * this.x + this.y * this.y + this.z * this.z; - array[ offset + 12 ] = te[ 12 ]; - array[ offset + 13 ] = te[ 13 ]; - array[ offset + 14 ] = te[ 14 ]; - array[ offset + 15 ] = te[ 15 ]; + } - return array; + length() { + + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); } - } ); + manhattanLength() { - /** - * @author alteredq / http://alteredqualia.com/ - */ + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); - function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { + } - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + normalize() { - this.image = { data: data, width: width, height: height }; + return this.divideScalar( this.length() || 1 ); - this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; - this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; + } - this.generateMipmaps = false; - this.flipY = false; - this.unpackAlignment = 1; + setLength( length ) { - } + return this.normalize().multiplyScalar( length ); - DataTexture.prototype = Object.create( Texture.prototype ); - DataTexture.prototype.constructor = DataTexture; + } - DataTexture.prototype.isDataTexture = true; + lerp( v, alpha ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; - function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { + return this; - images = images !== undefined ? images : []; - mapping = mapping !== undefined ? mapping : CubeReflectionMapping; + } - Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + lerpVectors( v1, v2, alpha ) { - this.flipY = false; + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; - } + return this; - CubeTexture.prototype = Object.create( Texture.prototype ); - CubeTexture.prototype.constructor = CubeTexture; + } - CubeTexture.prototype.isCubeTexture = true; + cross( v ) { - Object.defineProperty( CubeTexture.prototype, 'images', { + return this.crossVectors( this, v ); - get: function () { + } - return this.image; + crossVectors( a, b ) { - }, + const ax = a.x, ay = a.y, az = a.z; + const bx = b.x, by = b.y, bz = b.z; - set: function ( value ) { + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; - this.image = value; + return this; } - } ); + projectOnVector( v ) { - /** - * @author tschw - * - * Uniforms of a program. - * Those form a tree structure with a special top-level container for the root, - * which you get by calling 'new WebGLUniforms( gl, program, renderer )'. - * - * - * Properties of inner nodes including the top-level container: - * - * .seq - array of nested uniforms - * .map - nested uniforms by name - * - * - * Methods of all nodes except the top-level container: - * - * .setValue( gl, value, [renderer] ) - * - * uploads a uniform value(s) - * the 'renderer' parameter is needed for sampler uniforms - * - * - * Static methods of the top-level container (renderer factorizations): - * - * .upload( gl, seq, values, renderer ) - * - * sets uniforms in 'seq' to 'values[id].value' - * - * .seqWithValue( seq, values ) : filteredSeq - * - * filters 'seq' entries with corresponding entry in values - * - * - * Methods of the top-level container (renderer factorizations): - * - * .setValue( gl, name, value ) - * - * sets uniform with name 'name' to 'value' - * - * .set( gl, obj, prop ) - * - * sets uniform from object and property with same name than uniform - * - * .setOptional( gl, obj, prop ) - * - * like .set for an optional property of the object - * - */ + const denominator = v.lengthSq(); - var emptyTexture = new Texture(); - var emptyCubeTexture = new CubeTexture(); + if ( denominator === 0 ) return this.set( 0, 0, 0 ); - // --- Base for inner nodes (including the root) --- + const scalar = v.dot( this ) / denominator; - function UniformContainer() { + return this.copy( v ).multiplyScalar( scalar ); - this.seq = []; - this.map = {}; + } - } + projectOnPlane( planeNormal ) { - // --- Utilities --- + _vector$b.copy( this ).projectOnVector( planeNormal ); - // Array Caches (provide typed arrays for temporary by size) + return this.sub( _vector$b ); - var arrayCacheF32 = []; - var arrayCacheI32 = []; + } - // Float32Array caches used for uploading Matrix uniforms + reflect( normal ) { - var mat4array = new Float32Array( 16 ); - var mat3array = new Float32Array( 9 ); + // reflect incident vector off plane orthogonal to normal + // normal is assumed to have unit length - // Flattening for arrays of vectors and matrices + return this.sub( _vector$b.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); - function flatten( array, nBlocks, blockSize ) { + } - var firstElem = array[ 0 ]; + angleTo( v ) { - if ( firstElem <= 0 || firstElem > 0 ) return array; - // unoptimized: ! isNaN( firstElem ) - // see http://jacksondunstan.com/articles/983 + const denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); - var n = nBlocks * blockSize, - r = arrayCacheF32[ n ]; + if ( denominator === 0 ) return Math.PI / 2; - if ( r === undefined ) { + const theta = this.dot( v ) / denominator; - r = new Float32Array( n ); - arrayCacheF32[ n ] = r; + // clamp, to handle numerical problems - } + return Math.acos( clamp( theta, - 1, 1 ) ); - if ( nBlocks !== 0 ) { + } - firstElem.toArray( r, 0 ); + distanceTo( v ) { - for ( var i = 1, offset = 0; i !== nBlocks; ++ i ) { + return Math.sqrt( this.distanceToSquared( v ) ); - offset += blockSize; - array[ i ].toArray( r, offset ); + } - } + distanceToSquared( v ) { - } + const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; - return r; + return dx * dx + dy * dy + dz * dz; - } + } - // Texture unit allocation + manhattanDistanceTo( v ) { - function allocTexUnits( renderer, n ) { + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); - var r = arrayCacheI32[ n ]; + } - if ( r === undefined ) { + setFromSpherical( s ) { - r = new Int32Array( n ); - arrayCacheI32[ n ] = r; + return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); } - for ( var i = 0; i !== n; ++ i ) - r[ i ] = renderer.allocTextureUnit(); + setFromSphericalCoords( radius, phi, theta ) { - return r; + const sinPhiRadius = Math.sin( phi ) * radius; - } + this.x = sinPhiRadius * Math.sin( theta ); + this.y = Math.cos( phi ) * radius; + this.z = sinPhiRadius * Math.cos( theta ); - // --- Setters --- + return this; - // Note: Defining these methods externally, because they come in a bunch - // and this way their names minify. + } - // Single scalar + setFromCylindrical( c ) { - function setValue1f( gl, v ) { gl.uniform1f( this.addr, v ); } - function setValue1i( gl, v ) { gl.uniform1i( this.addr, v ); } + return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); - // Single float vector (from flat array or THREE.VectorN) + } - function setValue2fv( gl, v ) { + setFromCylindricalCoords( radius, theta, y ) { - if ( v.x === undefined ) gl.uniform2fv( this.addr, v ); - else gl.uniform2f( this.addr, v.x, v.y ); + this.x = radius * Math.sin( theta ); + this.y = y; + this.z = radius * Math.cos( theta ); - } - - function setValue3fv( gl, v ) { - - if ( v.x !== undefined ) - gl.uniform3f( this.addr, v.x, v.y, v.z ); - else if ( v.r !== undefined ) - gl.uniform3f( this.addr, v.r, v.g, v.b ); - else - gl.uniform3fv( this.addr, v ); + return this; - } + } - function setValue4fv( gl, v ) { + setFromMatrixPosition( m ) { - if ( v.x === undefined ) gl.uniform4fv( this.addr, v ); - else gl.uniform4f( this.addr, v.x, v.y, v.z, v.w ); + const e = m.elements; - } + this.x = e[ 12 ]; + this.y = e[ 13 ]; + this.z = e[ 14 ]; - // Single matrix (from flat array or MatrixN) + return this; - function setValue2fm( gl, v ) { + } - gl.uniformMatrix2fv( this.addr, false, v.elements || v ); + setFromMatrixScale( m ) { - } + const sx = this.setFromMatrixColumn( m, 0 ).length(); + const sy = this.setFromMatrixColumn( m, 1 ).length(); + const sz = this.setFromMatrixColumn( m, 2 ).length(); - function setValue3fm( gl, v ) { + this.x = sx; + this.y = sy; + this.z = sz; - if ( v.elements === undefined ) { + return this; - gl.uniformMatrix3fv( this.addr, false, v ); + } - } else { + setFromMatrixColumn( m, index ) { - mat3array.set( v.elements ); - gl.uniformMatrix3fv( this.addr, false, mat3array ); + return this.fromArray( m.elements, index * 4 ); } - } + setFromMatrix3Column( m, index ) { - function setValue4fm( gl, v ) { + return this.fromArray( m.elements, index * 3 ); - if ( v.elements === undefined ) { + } - gl.uniformMatrix4fv( this.addr, false, v ); + setFromEuler( e ) { - } else { + this.x = e._x; + this.y = e._y; + this.z = e._z; - mat4array.set( v.elements ); - gl.uniformMatrix4fv( this.addr, false, mat4array ); + return this; } - } + setFromColor( c ) { - // Single texture (2D / Cube) + this.x = c.r; + this.y = c.g; + this.z = c.b; + + return this; - function setValueT1( gl, v, renderer ) { + } - var unit = renderer.allocTextureUnit(); - gl.uniform1i( this.addr, unit ); - renderer.setTexture2D( v || emptyTexture, unit ); + equals( v ) { - } + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); - function setValueT6( gl, v, renderer ) { + } - var unit = renderer.allocTextureUnit(); - gl.uniform1i( this.addr, unit ); - renderer.setTextureCube( v || emptyCubeTexture, unit ); + fromArray( array, offset = 0 ) { - } + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; - // Integer / Boolean vectors or arrays thereof (always flat arrays) + return this; - function setValue2iv( gl, v ) { gl.uniform2iv( this.addr, v ); } - function setValue3iv( gl, v ) { gl.uniform3iv( this.addr, v ); } - function setValue4iv( gl, v ) { gl.uniform4iv( this.addr, v ); } + } - // Helper to pick the right setter for the singular case + toArray( array = [], offset = 0 ) { - function getSingularSetter( type ) { + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; - switch ( type ) { + return array; - case 0x1406: return setValue1f; // FLOAT - case 0x8b50: return setValue2fv; // _VEC2 - case 0x8b51: return setValue3fv; // _VEC3 - case 0x8b52: return setValue4fv; // _VEC4 + } - case 0x8b5a: return setValue2fm; // _MAT2 - case 0x8b5b: return setValue3fm; // _MAT3 - case 0x8b5c: return setValue4fm; // _MAT4 + fromBufferAttribute( attribute, index ) { - case 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES - case 0x8b60: return setValueT6; // SAMPLER_CUBE + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); - case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL - case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2 - case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3 - case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4 + return this; } - } + random() { - // Array of scalars + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); - function setValue1fv( gl, v ) { gl.uniform1fv( this.addr, v ); } - function setValue1iv( gl, v ) { gl.uniform1iv( this.addr, v ); } + return this; - // Array of vectors (flat or from THREE classes) + } - function setValueV2a( gl, v ) { + randomDirection() { - gl.uniform2fv( this.addr, flatten( v, this.size, 2 ) ); + // Derived from https://mathworld.wolfram.com/SpherePointPicking.html - } + const u = ( Math.random() - 0.5 ) * 2; + const t = Math.random() * Math.PI * 2; + const f = Math.sqrt( 1 - u ** 2 ); - function setValueV3a( gl, v ) { + this.x = f * Math.cos( t ); + this.y = f * Math.sin( t ); + this.z = u; - gl.uniform3fv( this.addr, flatten( v, this.size, 3 ) ); + return this; - } + } + + *[ Symbol.iterator ]() { - function setValueV4a( gl, v ) { + yield this.x; + yield this.y; + yield this.z; - gl.uniform4fv( this.addr, flatten( v, this.size, 4 ) ); + } } - // Array of matrices (flat or from THREE clases) + const _vector$b = /*@__PURE__*/ new Vector3(); + const _quaternion$4 = /*@__PURE__*/ new Quaternion(); - function setValueM2a( gl, v ) { + class Box3 { - gl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) ); + constructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) { - } + this.isBox3 = true; - function setValueM3a( gl, v ) { + this.min = min; + this.max = max; - gl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) ); + } - } + set( min, max ) { - function setValueM4a( gl, v ) { + this.min.copy( min ); + this.max.copy( max ); - gl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) ); + return this; - } + } - // Array of textures (2D / Cube) + setFromArray( array ) { - function setValueT1a( gl, v, renderer ) { + this.makeEmpty(); - var n = v.length, - units = allocTexUnits( renderer, n ); + for ( let i = 0, il = array.length; i < il; i += 3 ) { - gl.uniform1iv( this.addr, units ); + this.expandByPoint( _vector$a.fromArray( array, i ) ); - for ( var i = 0; i !== n; ++ i ) { + } - renderer.setTexture2D( v[ i ] || emptyTexture, units[ i ] ); + return this; } - } + setFromBufferAttribute( attribute ) { - function setValueT6a( gl, v, renderer ) { + this.makeEmpty(); - var n = v.length, - units = allocTexUnits( renderer, n ); + for ( let i = 0, il = attribute.count; i < il; i ++ ) { - gl.uniform1iv( this.addr, units ); + this.expandByPoint( _vector$a.fromBufferAttribute( attribute, i ) ); - for ( var i = 0; i !== n; ++ i ) { + } - renderer.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); + return this; } - } - - // Helper to pick the right setter for a pure (bottom-level) array - - function getPureArraySetter( type ) { + setFromPoints( points ) { - switch ( type ) { + this.makeEmpty(); - case 0x1406: return setValue1fv; // FLOAT - case 0x8b50: return setValueV2a; // _VEC2 - case 0x8b51: return setValueV3a; // _VEC3 - case 0x8b52: return setValueV4a; // _VEC4 + for ( let i = 0, il = points.length; i < il; i ++ ) { - case 0x8b5a: return setValueM2a; // _MAT2 - case 0x8b5b: return setValueM3a; // _MAT3 - case 0x8b5c: return setValueM4a; // _MAT4 + this.expandByPoint( points[ i ] ); - case 0x8b5e: return setValueT1a; // SAMPLER_2D - case 0x8b60: return setValueT6a; // SAMPLER_CUBE + } - case 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL - case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2 - case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3 - case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4 + return this; } - } + setFromCenterAndSize( center, size ) { - // --- Uniform Classes --- + const halfSize = _vector$a.copy( size ).multiplyScalar( 0.5 ); - function SingleUniform( id, activeInfo, addr ) { + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); - this.id = id; - this.addr = addr; - this.setValue = getSingularSetter( activeInfo.type ); + return this; - // this.path = activeInfo.name; // DEBUG + } - } + setFromObject( object, precise = false ) { - function PureArrayUniform( id, activeInfo, addr ) { + this.makeEmpty(); - this.id = id; - this.addr = addr; - this.size = activeInfo.size; - this.setValue = getPureArraySetter( activeInfo.type ); + return this.expandByObject( object, precise ); - // this.path = activeInfo.name; // DEBUG + } - } + clone() { - function StructuredUniform( id ) { + return new this.constructor().copy( this ); - this.id = id; + } - UniformContainer.call( this ); // mix-in + copy( box ) { - } + this.min.copy( box.min ); + this.max.copy( box.max ); - StructuredUniform.prototype.setValue = function ( gl, value ) { + return this; - // Note: Don't need an extra 'renderer' parameter, since samplers - // are not allowed in structured uniforms. + } - var seq = this.seq; + makeEmpty() { - for ( var i = 0, n = seq.length; i !== n; ++ i ) { + this.min.x = this.min.y = this.min.z = + Infinity; + this.max.x = this.max.y = this.max.z = - Infinity; - var u = seq[ i ]; - u.setValue( gl, value[ u.id ] ); + return this; } - }; + isEmpty() { - // --- Top-level --- + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - // Parser - builds up the property tree from the path strings + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); - var RePathPart = /([\w\d_]+)(\])?(\[|\.)?/g; + } - // extracts - // - the identifier (member name or array index) - // - followed by an optional right bracket (found when array index) - // - followed by an optional left bracket or dot (type of subscript) - // - // Note: These portions can be read in a non-overlapping fashion and - // allow straightforward parsing of the hierarchy that WebGL encodes - // in the uniform names. + getCenter( target ) { - function addUniform( container, uniformObject ) { + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - container.seq.push( uniformObject ); - container.map[ uniformObject.id ] = uniformObject; + } - } + getSize( target ) { - function parseUniform( activeInfo, addr, container ) { + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); - var path = activeInfo.name, - pathLength = path.length; + } - // reset RegExp object, because of the early exit of a previous run - RePathPart.lastIndex = 0; + expandByPoint( point ) { - for ( ; ; ) { + this.min.min( point ); + this.max.max( point ); - var match = RePathPart.exec( path ), - matchEnd = RePathPart.lastIndex, + return this; - id = match[ 1 ], - idIsIndex = match[ 2 ] === ']', - subscript = match[ 3 ]; + } - if ( idIsIndex ) id = id | 0; // convert to integer + expandByVector( vector ) { - if ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) { + this.min.sub( vector ); + this.max.add( vector ); - // bare name or "pure" bottom-level array "[0]" suffix + return this; - addUniform( container, subscript === undefined ? - new SingleUniform( id, activeInfo, addr ) : - new PureArrayUniform( id, activeInfo, addr ) ); + } - break; + expandByScalar( scalar ) { - } else { + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); - // step into inner node / create it in case it doesn't exist + return this; - var map = container.map, next = map[ id ]; + } - if ( next === undefined ) { + expandByObject( object, precise = false ) { - next = new StructuredUniform( id ); - addUniform( container, next ); + // Computes the world-axis-aligned bounding box of an object (including its children), + // accounting for both the object's, and children's, world transforms - } + object.updateWorldMatrix( false, false ); - container = next; + if ( object.boundingBox !== undefined ) { - } + if ( object.boundingBox === null ) { - } + object.computeBoundingBox(); - } + } - // Root Container + _box$3.copy( object.boundingBox ); + _box$3.applyMatrix4( object.matrixWorld ); - function WebGLUniforms( gl, program, renderer ) { + this.union( _box$3 ); - UniformContainer.call( this ); + } else { - this.renderer = renderer; + const geometry = object.geometry; - var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS ); + if ( geometry !== undefined ) { - for ( var i = 0; i < n; ++ i ) { + if ( precise && geometry.attributes !== undefined && geometry.attributes.position !== undefined ) { - var info = gl.getActiveUniform( program, i ), - path = info.name, - addr = gl.getUniformLocation( program, path ); + const position = geometry.attributes.position; + for ( let i = 0, l = position.count; i < l; i ++ ) { - parseUniform( info, addr, this ); + _vector$a.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld ); + this.expandByPoint( _vector$a ); - } + } - } + } else { - WebGLUniforms.prototype.setValue = function ( gl, name, value ) { + if ( geometry.boundingBox === null ) { - var u = this.map[ name ]; + geometry.computeBoundingBox(); - if ( u !== undefined ) u.setValue( gl, value, this.renderer ); + } - }; + _box$3.copy( geometry.boundingBox ); + _box$3.applyMatrix4( object.matrixWorld ); - WebGLUniforms.prototype.setOptional = function ( gl, object, name ) { + this.union( _box$3 ); - var v = object[ name ]; + } - if ( v !== undefined ) this.setValue( gl, name, v ); + } - }; + } + const children = object.children; - // Static interface + for ( let i = 0, l = children.length; i < l; i ++ ) { - WebGLUniforms.upload = function ( gl, seq, values, renderer ) { + this.expandByObject( children[ i ], precise ); - for ( var i = 0, n = seq.length; i !== n; ++ i ) { + } - var u = seq[ i ], - v = values[ u.id ]; + return this; - if ( v.needsUpdate !== false ) { + } - // note: always updating when .needsUpdate is undefined - u.setValue( gl, v.value, renderer ); + containsPoint( point ) { - } + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y || + point.z < this.min.z || point.z > this.max.z ? false : true; } - }; + containsBox( box ) { - WebGLUniforms.seqWithValue = function ( seq, values ) { + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y && + this.min.z <= box.min.z && box.max.z <= this.max.z; - var r = []; + } - for ( var i = 0, n = seq.length; i !== n; ++ i ) { + getParameter( point, target ) { - var u = seq[ i ]; - if ( u.id in values ) r.push( u ); + // This can potentially have a divide by zero if the box + // has a size dimension of 0. - } + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ), + ( point.z - this.min.z ) / ( this.max.z - this.min.z ) + ); - return r; + } - }; + intersectsBox( box ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + // using 6 splitting planes to rule out intersections. + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y || + box.max.z < this.min.z || box.min.z > this.max.z ? false : true; - var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, - 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, - 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50, - 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B, - 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B, - 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F, - 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3, - 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222, - 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700, - 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4, - 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00, - 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3, - 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA, - 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32, - 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3, - 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC, - 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD, - 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6, - 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9, - 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F, - 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE, - 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA, - 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0, - 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 }; + } - function Color( r, g, b ) { + intersectsSphere( sphere ) { - if ( g === undefined && b === undefined ) { + // Find the point on the AABB closest to the sphere center. + this.clampPoint( sphere.center, _vector$a ); - // r is THREE.Color, hex or string - return this.set( r ); + // If that point is inside the sphere, the AABB and sphere intersect. + return _vector$a.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); } - return this.setRGB( r, g, b ); + intersectsPlane( plane ) { - } + // We compute the minimum and maximum dot product values. If those values + // are on the same side (back or front) of the plane, then there is no intersection. - Object.assign( Color.prototype, { + let min, max; - isColor: true, + if ( plane.normal.x > 0 ) { - r: 1, g: 1, b: 1, + min = plane.normal.x * this.min.x; + max = plane.normal.x * this.max.x; - set: function ( value ) { + } else { - if ( value && value.isColor ) { + min = plane.normal.x * this.max.x; + max = plane.normal.x * this.min.x; - this.copy( value ); + } - } else if ( typeof value === 'number' ) { + if ( plane.normal.y > 0 ) { - this.setHex( value ); + min += plane.normal.y * this.min.y; + max += plane.normal.y * this.max.y; - } else if ( typeof value === 'string' ) { + } else { - this.setStyle( value ); + min += plane.normal.y * this.max.y; + max += plane.normal.y * this.min.y; } - return this; + if ( plane.normal.z > 0 ) { - }, + min += plane.normal.z * this.min.z; + max += plane.normal.z * this.max.z; - setScalar: function ( scalar ) { + } else { - this.r = scalar; - this.g = scalar; - this.b = scalar; + min += plane.normal.z * this.max.z; + max += plane.normal.z * this.min.z; - return this; + } - }, + return ( min <= - plane.constant && max >= - plane.constant ); - setHex: function ( hex ) { - - hex = Math.floor( hex ); - - this.r = ( hex >> 16 & 255 ) / 255; - this.g = ( hex >> 8 & 255 ) / 255; - this.b = ( hex & 255 ) / 255; + } - return this; + intersectsTriangle( triangle ) { - }, + if ( this.isEmpty() ) { - setRGB: function ( r, g, b ) { + return false; - this.r = r; - this.g = g; - this.b = b; + } - return this; + // compute box center and extents + this.getCenter( _center ); + _extents.subVectors( this.max, _center ); - }, + // translate triangle to aabb origin + _v0$2.subVectors( triangle.a, _center ); + _v1$7.subVectors( triangle.b, _center ); + _v2$4.subVectors( triangle.c, _center ); - setHSL: function () { + // compute edge vectors for triangle + _f0.subVectors( _v1$7, _v0$2 ); + _f1.subVectors( _v2$4, _v1$7 ); + _f2.subVectors( _v0$2, _v2$4 ); - function hue2rgb( p, q, t ) { + // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb + // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation + // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) + let axes = [ + 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, + _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, + - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 + ]; + if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) { - if ( t < 0 ) t += 1; - if ( t > 1 ) t -= 1; - if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t; - if ( t < 1 / 2 ) return q; - if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t ); - return p; + return false; } - return function setHSL( h, s, l ) { + // test 3 face normals from the aabb + axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) { - // h,s,l ranges are in 0.0 - 1.0 - h = _Math.euclideanModulo( h, 1 ); - s = _Math.clamp( s, 0, 1 ); - l = _Math.clamp( l, 0, 1 ); + return false; - if ( s === 0 ) { + } - this.r = this.g = this.b = l; + // finally testing the face normal of the triangle + // use already existing triangle edge vectors here + _triangleNormal.crossVectors( _f0, _f1 ); + axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; - } else { + return satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ); - var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); - var q = ( 2 * l ) - p; + } - this.r = hue2rgb( q, p, h + 1 / 3 ); - this.g = hue2rgb( q, p, h ); - this.b = hue2rgb( q, p, h - 1 / 3 ); + clampPoint( point, target ) { - } + return target.copy( point ).clamp( this.min, this.max ); - return this; + } - }; + distanceToPoint( point ) { - }(), + return this.clampPoint( point, _vector$a ).distanceTo( point ); - setStyle: function ( style ) { + } - function handleAlpha( string ) { + getBoundingSphere( target ) { - if ( string === undefined ) return; + if ( this.isEmpty() ) { - if ( parseFloat( string ) < 1 ) { + target.makeEmpty(); - console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); + } else { - } + this.getCenter( target.center ); + + target.radius = this.getSize( _vector$a ).length() * 0.5; } + return target; - var m; + } - if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) { + intersect( box ) { - // rgb / hsl + this.min.max( box.min ); + this.max.min( box.max ); - var color; - var name = m[ 1 ]; - var components = m[ 2 ]; + // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. + if ( this.isEmpty() ) this.makeEmpty(); - switch ( name ) { + return this; - case 'rgb': - case 'rgba': + } - if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + union( box ) { - // rgb(255,0,0) rgba(255,0,0,0.5) - this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; - this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; - this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; + this.min.min( box.min ); + this.max.max( box.max ); - handleAlpha( color[ 5 ] ); + return this; - return this; + } - } + applyMatrix4( matrix ) { - if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + // transform of empty box is an empty box. + if ( this.isEmpty() ) return this; - // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) - this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; - this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; - this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; + // NOTE: I am using a binary pattern to specify all 2^3 combinations below + _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 + _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 + _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 + _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 + _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 + _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 + _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 + _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 - handleAlpha( color[ 5 ] ); + this.setFromPoints( _points ); - return this; + return this; - } + } - break; + translate( offset ) { - case 'hsl': - case 'hsla': + this.min.add( offset ); + this.max.add( offset ); - if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + return this; - // hsl(120,50%,50%) hsla(120,50%,50%,0.5) - var h = parseFloat( color[ 1 ] ) / 360; - var s = parseInt( color[ 2 ], 10 ) / 100; - var l = parseInt( color[ 3 ], 10 ) / 100; + } - handleAlpha( color[ 5 ] ); + equals( box ) { - return this.setHSL( h, s, l ); + return box.min.equals( this.min ) && box.max.equals( this.max ); - } + } - break; + } - } + const _points = [ + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3(), + /*@__PURE__*/ new Vector3() + ]; - } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) { + const _vector$a = /*@__PURE__*/ new Vector3(); - // hex color + const _box$3 = /*@__PURE__*/ new Box3(); - var hex = m[ 1 ]; - var size = hex.length; + // triangle centered vertices - if ( size === 3 ) { + const _v0$2 = /*@__PURE__*/ new Vector3(); + const _v1$7 = /*@__PURE__*/ new Vector3(); + const _v2$4 = /*@__PURE__*/ new Vector3(); - // #ff0 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; + // triangle edge vectors - return this; + const _f0 = /*@__PURE__*/ new Vector3(); + const _f1 = /*@__PURE__*/ new Vector3(); + const _f2 = /*@__PURE__*/ new Vector3(); - } else if ( size === 6 ) { + const _center = /*@__PURE__*/ new Vector3(); + const _extents = /*@__PURE__*/ new Vector3(); + const _triangleNormal = /*@__PURE__*/ new Vector3(); + const _testAxis = /*@__PURE__*/ new Vector3(); - // #ff0000 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; + function satForAxes( axes, v0, v1, v2, extents ) { - return this; + for ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) { - } + _testAxis.fromArray( axes, i ); + // project the aabb onto the separating axis + const r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); + // project all 3 vertices of the triangle onto the separating axis + const p0 = v0.dot( _testAxis ); + const p1 = v1.dot( _testAxis ); + const p2 = v2.dot( _testAxis ); + // actual test, basically see if either of the most extreme of the triangle points intersects r + if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { + + // points of the projected triangle are outside the projected half-length of the aabb + // the axis is separating and we can exit + return false; } - if ( style && style.length > 0 ) { + } - // color keywords - var hex = ColorKeywords[ style ]; + return true; - if ( hex !== undefined ) { + } - // red - this.setHex( hex ); + const _box$2 = /*@__PURE__*/ new Box3(); + const _v1$6 = /*@__PURE__*/ new Vector3(); + const _v2$3 = /*@__PURE__*/ new Vector3(); - } else { + class Sphere { - // unknown color - console.warn( 'THREE.Color: Unknown color ' + style ); + constructor( center = new Vector3(), radius = - 1 ) { - } + this.center = center; + this.radius = radius; - } + } - return this; + set( center, radius ) { - }, + this.center.copy( center ); + this.radius = radius; - clone: function () { + return this; - return new this.constructor( this.r, this.g, this.b ); + } - }, + setFromPoints( points, optionalCenter ) { - copy: function ( color ) { + const center = this.center; - this.r = color.r; - this.g = color.g; - this.b = color.b; + if ( optionalCenter !== undefined ) { - return this; + center.copy( optionalCenter ); - }, + } else { - copyGammaToLinear: function ( color, gammaFactor ) { + _box$2.setFromPoints( points ).getCenter( center ); - if ( gammaFactor === undefined ) gammaFactor = 2.0; + } - this.r = Math.pow( color.r, gammaFactor ); - this.g = Math.pow( color.g, gammaFactor ); - this.b = Math.pow( color.b, gammaFactor ); + let maxRadiusSq = 0; - return this; + for ( let i = 0, il = points.length; i < il; i ++ ) { - }, + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - copyLinearToGamma: function ( color, gammaFactor ) { + } - if ( gammaFactor === undefined ) gammaFactor = 2.0; + this.radius = Math.sqrt( maxRadiusSq ); - var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0; + return this; - this.r = Math.pow( color.r, safeInverse ); - this.g = Math.pow( color.g, safeInverse ); - this.b = Math.pow( color.b, safeInverse ); + } - return this; + copy( sphere ) { - }, + this.center.copy( sphere.center ); + this.radius = sphere.radius; - convertGammaToLinear: function () { + return this; - var r = this.r, g = this.g, b = this.b; + } - this.r = r * r; - this.g = g * g; - this.b = b * b; + isEmpty() { - return this; + return ( this.radius < 0 ); - }, + } - convertLinearToGamma: function () { + makeEmpty() { - this.r = Math.sqrt( this.r ); - this.g = Math.sqrt( this.g ); - this.b = Math.sqrt( this.b ); + this.center.set( 0, 0, 0 ); + this.radius = - 1; return this; - }, + } - getHex: function () { + containsPoint( point ) { - return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; + return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); - }, + } - getHexString: function () { + distanceToPoint( point ) { - return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); + return ( point.distanceTo( this.center ) - this.radius ); - }, + } - getHSL: function ( optionalTarget ) { + intersectsSphere( sphere ) { - // h,s,l ranges are in 0.0 - 1.0 + const radiusSum = this.radius + sphere.radius; - var hsl = optionalTarget || { h: 0, s: 0, l: 0 }; + return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); - var r = this.r, g = this.g, b = this.b; + } - var max = Math.max( r, g, b ); - var min = Math.min( r, g, b ); + intersectsBox( box ) { - var hue, saturation; - var lightness = ( min + max ) / 2.0; + return box.intersectsSphere( this ); - if ( min === max ) { + } - hue = 0; - saturation = 0; + intersectsPlane( plane ) { - } else { + return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; - var delta = max - min; + } - saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); + clampPoint( point, target ) { - switch ( max ) { + const deltaLengthSq = this.center.distanceToSquared( point ); - case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; - case g: hue = ( b - r ) / delta + 2; break; - case b: hue = ( r - g ) / delta + 4; break; + target.copy( point ); - } + if ( deltaLengthSq > ( this.radius * this.radius ) ) { - hue /= 6; + target.sub( this.center ).normalize(); + target.multiplyScalar( this.radius ).add( this.center ); } - hsl.h = hue; - hsl.s = saturation; - hsl.l = lightness; + return target; - return hsl; + } - }, + getBoundingBox( target ) { - getStyle: function () { + if ( this.isEmpty() ) { - return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; + // Empty sphere produces empty bounding box + target.makeEmpty(); + return target; - }, + } - offsetHSL: function ( h, s, l ) { + target.set( this.center, this.center ); + target.expandByScalar( this.radius ); - var hsl = this.getHSL(); + return target; + + } - hsl.h += h; hsl.s += s; hsl.l += l; + applyMatrix4( matrix ) { - this.setHSL( hsl.h, hsl.s, hsl.l ); + this.center.applyMatrix4( matrix ); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); return this; - }, + } - add: function ( color ) { + translate( offset ) { - this.r += color.r; - this.g += color.g; - this.b += color.b; + this.center.add( offset ); return this; - }, + } - addColors: function ( color1, color2 ) { + expandByPoint( point ) { - this.r = color1.r + color2.r; - this.g = color1.g + color2.g; - this.b = color1.b + color2.b; + if ( this.isEmpty() ) { - return this; + this.center.copy( point ); - }, + this.radius = 0; + + return this; - addScalar: function ( s ) { + } - this.r += s; - this.g += s; - this.b += s; + _v1$6.subVectors( point, this.center ); - return this; + const lengthSq = _v1$6.lengthSq(); - }, + if ( lengthSq > ( this.radius * this.radius ) ) { - sub: function( color ) { + // calculate the minimal sphere - this.r = Math.max( 0, this.r - color.r ); - this.g = Math.max( 0, this.g - color.g ); - this.b = Math.max( 0, this.b - color.b ); + const length = Math.sqrt( lengthSq ); - return this; + const delta = ( length - this.radius ) * 0.5; - }, + this.center.addScaledVector( _v1$6, delta / length ); - multiply: function ( color ) { + this.radius += delta; - this.r *= color.r; - this.g *= color.g; - this.b *= color.b; + } return this; - }, + } - multiplyScalar: function ( s ) { + union( sphere ) { - this.r *= s; - this.g *= s; - this.b *= s; + if ( sphere.isEmpty() ) { - return this; + return this; - }, + } - lerp: function ( color, alpha ) { + if ( this.isEmpty() ) { - this.r += ( color.r - this.r ) * alpha; - this.g += ( color.g - this.g ) * alpha; - this.b += ( color.b - this.b ) * alpha; + this.copy( sphere ); - return this; + return this; - }, + } - equals: function ( c ) { + if ( this.center.equals( sphere.center ) === true ) { - return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); + this.radius = Math.max( this.radius, sphere.radius ); - }, + } else { - fromArray: function ( array, offset ) { + _v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius ); - if ( offset === undefined ) offset = 0; + this.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) ); - this.r = array[ offset ]; - this.g = array[ offset + 1 ]; - this.b = array[ offset + 2 ]; + this.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) ); + + } return this; - }, + } - toArray: function ( array, offset ) { + equals( sphere ) { - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); - array[ offset ] = this.r; - array[ offset + 1 ] = this.g; - array[ offset + 2 ] = this.b; + } - return array; + clone() { - }, + return new this.constructor().copy( this ); - toJSON: function () { + } - return this.getHex(); + } - } + const _vector$9 = /*@__PURE__*/ new Vector3(); + const _segCenter = /*@__PURE__*/ new Vector3(); + const _segDir = /*@__PURE__*/ new Vector3(); + const _diff = /*@__PURE__*/ new Vector3(); - } ); + const _edge1 = /*@__PURE__*/ new Vector3(); + const _edge2 = /*@__PURE__*/ new Vector3(); + const _normal$1 = /*@__PURE__*/ new Vector3(); - /** - * Uniforms library for shared webgl shaders - */ + class Ray { - var UniformsLib = { + constructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) { - common: { + this.origin = origin; + this.direction = direction; - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, + } - map: { value: null }, - offsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) }, + set( origin, direction ) { - specularMap: { value: null }, - alphaMap: { value: null }, + this.origin.copy( origin ); + this.direction.copy( direction ); - envMap: { value: null }, - flipEnvMap: { value: - 1 }, - reflectivity: { value: 1.0 }, - refractionRatio: { value: 0.98 } + return this; - }, + } - aomap: { + copy( ray ) { - aoMap: { value: null }, - aoMapIntensity: { value: 1 } + this.origin.copy( ray.origin ); + this.direction.copy( ray.direction ); - }, + return this; - lightmap: { + } - lightMap: { value: null }, - lightMapIntensity: { value: 1 } + at( t, target ) { - }, + return target.copy( this.origin ).addScaledVector( this.direction, t ); - emissivemap: { + } - emissiveMap: { value: null } + lookAt( v ) { - }, + this.direction.copy( v ).sub( this.origin ).normalize(); - bumpmap: { + return this; - bumpMap: { value: null }, - bumpScale: { value: 1 } + } - }, + recast( t ) { - normalmap: { + this.origin.copy( this.at( t, _vector$9 ) ); - normalMap: { value: null }, - normalScale: { value: new Vector2( 1, 1 ) } + return this; - }, + } - displacementmap: { + closestPointToPoint( point, target ) { - displacementMap: { value: null }, - displacementScale: { value: 1 }, - displacementBias: { value: 0 } + target.subVectors( point, this.origin ); - }, + const directionDistance = target.dot( this.direction ); - roughnessmap: { + if ( directionDistance < 0 ) { - roughnessMap: { value: null } + return target.copy( this.origin ); - }, + } - metalnessmap: { + return target.copy( this.origin ).addScaledVector( this.direction, directionDistance ); - metalnessMap: { value: null } + } - }, + distanceToPoint( point ) { - gradientmap: { + return Math.sqrt( this.distanceSqToPoint( point ) ); - gradientMap: { value: null } + } - }, + distanceSqToPoint( point ) { - fog: { + const directionDistance = _vector$9.subVectors( point, this.origin ).dot( this.direction ); - fogDensity: { value: 0.00025 }, - fogNear: { value: 1 }, - fogFar: { value: 2000 }, - fogColor: { value: new Color( 0xffffff ) } + // point behind the ray - }, + if ( directionDistance < 0 ) { - lights: { + return this.origin.distanceToSquared( point ); - ambientLightColor: { value: [] }, + } - directionalLights: { value: [], properties: { - direction: {}, - color: {}, + _vector$9.copy( this.origin ).addScaledVector( this.direction, directionDistance ); - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, + return _vector$9.distanceToSquared( point ); - directionalShadowMap: { value: [] }, - directionalShadowMatrix: { value: [] }, + } - spotLights: { value: [], properties: { - color: {}, - position: {}, - direction: {}, - distance: {}, - coneCos: {}, - penumbraCos: {}, - decay: {}, + distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, + // from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h + // It returns the min distance between the ray and the segment + // defined by v0 and v1 + // It can also set two optional targets : + // - The closest point on the ray + // - The closest point on the segment - spotShadowMap: { value: [] }, - spotShadowMatrix: { value: [] }, + _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); + _segDir.copy( v1 ).sub( v0 ).normalize(); + _diff.copy( this.origin ).sub( _segCenter ); - pointLights: { value: [], properties: { - color: {}, - position: {}, - decay: {}, - distance: {}, + const segExtent = v0.distanceTo( v1 ) * 0.5; + const a01 = - this.direction.dot( _segDir ); + const b0 = _diff.dot( this.direction ); + const b1 = - _diff.dot( _segDir ); + const c = _diff.lengthSq(); + const det = Math.abs( 1 - a01 * a01 ); + let s0, s1, sqrDist, extDet; - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, + if ( det > 0 ) { - pointShadowMap: { value: [] }, - pointShadowMatrix: { value: [] }, + // The ray and segment are not parallel. - hemisphereLights: { value: [], properties: { - direction: {}, - skyColor: {}, - groundColor: {} - } }, + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; - // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src - rectAreaLights: { value: [], properties: { - color: {}, - position: {}, - width: {}, - height: {} - } } + if ( s0 >= 0 ) { - }, + if ( s1 >= - extDet ) { - points: { + if ( s1 <= extDet ) { - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - size: { value: 1.0 }, - scale: { value: 1.0 }, - map: { value: null }, - offsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) } + // region 0 + // Minimum at interior points of ray and segment. - } + const invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; - }; + } else { - /** - * Uniform Utilities - */ + // region 1 + + s1 = segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + // region 5 + + s1 = - segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + if ( s1 <= - extDet ) { - var UniformsUtils = { + // region 4 - merge: function ( uniforms ) { + s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - var merged = {}; + } else if ( s1 <= extDet ) { - for ( var u = 0; u < uniforms.length; u ++ ) { + // region 3 - var tmp = this.clone( uniforms[ u ] ); + s0 = 0; + s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = s1 * ( s1 + 2 * b1 ) + c; - for ( var p in tmp ) { + } else { + + // region 2 - merged[ p ] = tmp[ p ]; + s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } } + } else { + + // Ray and segment are parallel. + + s1 = ( a01 > 0 ) ? - segExtent : segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + } - return merged; + if ( optionalPointOnRay ) { - }, + optionalPointOnRay.copy( this.origin ).addScaledVector( this.direction, s0 ); + + } + + if ( optionalPointOnSegment ) { - clone: function ( uniforms_src ) { + optionalPointOnSegment.copy( _segCenter ).addScaledVector( _segDir, s1 ); - var uniforms_dst = {}; + } - for ( var u in uniforms_src ) { + return sqrDist; - uniforms_dst[ u ] = {}; + } - for ( var p in uniforms_src[ u ] ) { + intersectSphere( sphere, target ) { - var parameter_src = uniforms_src[ u ][ p ]; + _vector$9.subVectors( sphere.center, this.origin ); + const tca = _vector$9.dot( this.direction ); + const d2 = _vector$9.dot( _vector$9 ) - tca * tca; + const radius2 = sphere.radius * sphere.radius; - if ( parameter_src && ( parameter_src.isColor || - parameter_src.isMatrix3 || parameter_src.isMatrix4 || - parameter_src.isVector2 || parameter_src.isVector3 || parameter_src.isVector4 || - parameter_src.isTexture ) ) { + if ( d2 > radius2 ) return null; - uniforms_dst[ u ][ p ] = parameter_src.clone(); + const thc = Math.sqrt( radius2 - d2 ); - } else if ( Array.isArray( parameter_src ) ) { + // t0 = first intersect point - entrance on front of sphere + const t0 = tca - thc; - uniforms_dst[ u ][ p ] = parameter_src.slice(); + // t1 = second intersect point - exit point on back of sphere + const t1 = tca + thc; - } else { + // test to see if t1 is behind the ray - if so, return null + if ( t1 < 0 ) return null; - uniforms_dst[ u ][ p ] = parameter_src; + // test to see if t0 is behind the ray: + // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, + // in order to always return an intersect point that is in front of the ray. + if ( t0 < 0 ) return this.at( t1, target ); - } + // else t0 is in front of the ray, so return the first collision point scaled by t0 + return this.at( t0, target ); + + } + + intersectsSphere( sphere ) { + + return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); + + } + + distanceToPlane( plane ) { + + const denominator = plane.normal.dot( this.direction ); + + if ( denominator === 0 ) { + + // line is coplanar, return origin + if ( plane.distanceToPoint( this.origin ) === 0 ) { + + return 0; } + // Null is preferable to undefined since undefined means.... it is undefined + + return null; + } - return uniforms_dst; + const t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; + + // Return if the ray never intersects the plane + + return t >= 0 ? t : null; } - }; + intersectPlane( plane, target ) { - var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n"; + const t = this.distanceToPlane( plane ); - var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n"; + if ( t === null ) { - var alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n"; + return null; - var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n"; + } - var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; + return this.at( t, target ); - var begin_vertex = "\nvec3 transformed = vec3( position );\n"; + } - var beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n"; + intersectsPlane( plane ) { - var bsdfs = "float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n"; + // check if the ray lies on the plane first - var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n"; + const distToPoint = plane.distanceToPoint( this.origin ); - var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n"; + if ( distToPoint === 0 ) { - var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n"; + return true; - var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n"; + } - var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n"; + const denominator = plane.normal.dot( this.direction ); - var color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif"; + if ( denominator * distToPoint < 0 ) { - var color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n"; + return true; - var color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif"; + } - var color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif"; + // ray origin is behind the plane (and is pointing behind it) - var common = "#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n"; + return false; - var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n"; + } - var defaultnormal_vertex = "vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n"; + intersectBox( box, target ) { - var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n"; + let tmin, tmax, tymin, tymax, tzmin, tzmax; - var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n"; + const invdirx = 1 / this.direction.x, + invdiry = 1 / this.direction.y, + invdirz = 1 / this.direction.z; - var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n"; + const origin = this.origin; - var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n"; + if ( invdirx >= 0 ) { - var encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n"; + tmin = ( box.min.x - origin.x ) * invdirx; + tmax = ( box.max.x - origin.x ) * invdirx; - var encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n"; + } else { - var envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = asin( flipNormal * reflectVec.y ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n"; + tmin = ( box.max.x - origin.x ) * invdirx; + tmax = ( box.min.x - origin.x ) * invdirx; - var envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n"; + } - var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n"; + if ( invdiry >= 0 ) { - var envmap_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n"; + tymin = ( box.min.y - origin.y ) * invdiry; + tymax = ( box.max.y - origin.y ) * invdiry; - var fog_vertex = "\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif"; + } else { - var fog_pars_vertex = "#ifdef USE_FOG\n varying float fogDepth;\n#endif\n"; + tymin = ( box.max.y - origin.y ) * invdiry; + tymax = ( box.min.y - origin.y ) * invdiry; - var fog_fragment = "#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n"; + } - var fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n"; + if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; - var gradientmap_pars_fragment = "#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n"; + if ( tymin > tmin || isNaN( tmin ) ) tmin = tymin; - var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n"; + if ( tymax < tmax || isNaN( tmax ) ) tmax = tymax; - var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"; + if ( invdirz >= 0 ) { - var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n"; + tzmin = ( box.min.z - origin.z ) * invdirz; + tzmax = ( box.max.z - origin.z ) * invdirz; - var lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n"; + } else { - var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n"; + tzmin = ( box.max.z - origin.z ) * invdirz; + tzmax = ( box.min.z - origin.z ) * invdirz; - var lights_phong_pars_fragment = "varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n"; + } - var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n"; + if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; - var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n"; + if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; - var lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n"; + if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; - var logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif"; + //return point closest to the ray (positive side) - var logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n"; + if ( tmax < 0 ) return null; - var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif"; + return this.at( tmin >= 0 ? tmin : tmax, target ); - var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n"; + } - var map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n"; + intersectsBox( box ) { - var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n"; + return this.intersectBox( box, _vector$9 ) !== null; - var map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n"; + } - var map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n"; + intersectTriangle( a, b, c, backfaceCulling, target ) { - var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n"; + // Compute the offset origin, edges, and normal. - var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"; + // from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h - var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n"; + _edge1.subVectors( b, a ); + _edge2.subVectors( c, a ); + _normal$1.crossVectors( _edge1, _edge2 ); - var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif"; + // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, + // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by + // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) + // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) + // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) + let DdN = this.direction.dot( _normal$1 ); + let sign; - var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n"; + if ( DdN > 0 ) { - var normal_flip = "#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n"; + if ( backfaceCulling ) return null; + sign = 1; - var normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n"; + } else if ( DdN < 0 ) { - var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n"; + sign = - 1; + DdN = - DdN; - var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n"; + } else { - var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n"; + return null; - var project_vertex = "vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n"; + } - var dithering_fragment = "#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n"; + _diff.subVectors( this.origin, a ); + const DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); - var dithering_pars_fragment = "#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n"; + // b1 < 0, no intersection + if ( DdQxE2 < 0 ) { - var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n"; + return null; - var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"; + } - var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n"; + const DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); - var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n"; + // b2 < 0, no intersection + if ( DdE1xQ < 0 ) { - var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n"; + return null; - var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n"; + } - var skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"; + // b1+b2 > 1, no intersection + if ( DdQxE2 + DdE1xQ > DdN ) { - var skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n"; + return null; - var skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n"; + } - var skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n"; + // Line intersects triangle, check if ray does. + const QdN = - sign * _diff.dot( _normal$1 ); - var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"; + // t < 0, no intersection + if ( QdN < 0 ) { - var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"; + return null; - var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n"; + } - var tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n"; + // Ray intersects triangle. + return this.at( QdN / DdN, target ); - var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif"; + } - var uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n"; + applyMatrix4( matrix4 ) { - var uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif"; + this.origin.applyMatrix4( matrix4 ); + this.direction.transformDirection( matrix4 ); - var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"; + return this; - var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif"; + } - var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif"; + equals( ray ) { - var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n"; + return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); - var cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n"; + } - var cube_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n"; + clone() { - var depth_frag = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n"; + return new this.constructor().copy( this ); - var depth_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + } - var distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n"; + } - var distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n"; + class Matrix4 { - var equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n"; + constructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - var equirect_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n"; + Matrix4.prototype.isMatrix4 = true; - var linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + this.elements = [ - var linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n"; + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - var meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + ]; - var meshbasic_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + if ( n11 !== undefined ) { - var meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + this.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ); - var meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + } - var meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + } - var meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + const te = this.elements; - var meshphysical_vert = "#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n"; + te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; + te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; + te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; + te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; - var normal_frag = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n"; + return this; - var normal_vert = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n"; + } - var points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + identity() { - var points_vert = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + this.set( - var shadow_frag = "uniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n"; + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - var shadow_vert = "#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + ); - var ShaderChunk = { - alphamap_fragment: alphamap_fragment, - alphamap_pars_fragment: alphamap_pars_fragment, - alphatest_fragment: alphatest_fragment, - aomap_fragment: aomap_fragment, - aomap_pars_fragment: aomap_pars_fragment, - begin_vertex: begin_vertex, - beginnormal_vertex: beginnormal_vertex, - bsdfs: bsdfs, - bumpmap_pars_fragment: bumpmap_pars_fragment, - clipping_planes_fragment: clipping_planes_fragment, - clipping_planes_pars_fragment: clipping_planes_pars_fragment, - clipping_planes_pars_vertex: clipping_planes_pars_vertex, - clipping_planes_vertex: clipping_planes_vertex, - color_fragment: color_fragment, - color_pars_fragment: color_pars_fragment, - color_pars_vertex: color_pars_vertex, - color_vertex: color_vertex, - common: common, - cube_uv_reflection_fragment: cube_uv_reflection_fragment, - defaultnormal_vertex: defaultnormal_vertex, - displacementmap_pars_vertex: displacementmap_pars_vertex, - displacementmap_vertex: displacementmap_vertex, - emissivemap_fragment: emissivemap_fragment, - emissivemap_pars_fragment: emissivemap_pars_fragment, - encodings_fragment: encodings_fragment, - encodings_pars_fragment: encodings_pars_fragment, - envmap_fragment: envmap_fragment, - envmap_pars_fragment: envmap_pars_fragment, - envmap_pars_vertex: envmap_pars_vertex, - envmap_vertex: envmap_vertex, - fog_vertex: fog_vertex, - fog_pars_vertex: fog_pars_vertex, - fog_fragment: fog_fragment, - fog_pars_fragment: fog_pars_fragment, - gradientmap_pars_fragment: gradientmap_pars_fragment, - lightmap_fragment: lightmap_fragment, - lightmap_pars_fragment: lightmap_pars_fragment, - lights_lambert_vertex: lights_lambert_vertex, - lights_pars: lights_pars, - lights_phong_fragment: lights_phong_fragment, - lights_phong_pars_fragment: lights_phong_pars_fragment, - lights_physical_fragment: lights_physical_fragment, - lights_physical_pars_fragment: lights_physical_pars_fragment, - lights_template: lights_template, - logdepthbuf_fragment: logdepthbuf_fragment, - logdepthbuf_pars_fragment: logdepthbuf_pars_fragment, - logdepthbuf_pars_vertex: logdepthbuf_pars_vertex, - logdepthbuf_vertex: logdepthbuf_vertex, - map_fragment: map_fragment, - map_pars_fragment: map_pars_fragment, - map_particle_fragment: map_particle_fragment, - map_particle_pars_fragment: map_particle_pars_fragment, - metalnessmap_fragment: metalnessmap_fragment, - metalnessmap_pars_fragment: metalnessmap_pars_fragment, - morphnormal_vertex: morphnormal_vertex, - morphtarget_pars_vertex: morphtarget_pars_vertex, - morphtarget_vertex: morphtarget_vertex, - normal_flip: normal_flip, - normal_fragment: normal_fragment, - normalmap_pars_fragment: normalmap_pars_fragment, - packing: packing, - premultiplied_alpha_fragment: premultiplied_alpha_fragment, - project_vertex: project_vertex, - dithering_fragment: dithering_fragment, - dithering_pars_fragment: dithering_pars_fragment, - roughnessmap_fragment: roughnessmap_fragment, - roughnessmap_pars_fragment: roughnessmap_pars_fragment, - shadowmap_pars_fragment: shadowmap_pars_fragment, - shadowmap_pars_vertex: shadowmap_pars_vertex, - shadowmap_vertex: shadowmap_vertex, - shadowmask_pars_fragment: shadowmask_pars_fragment, - skinbase_vertex: skinbase_vertex, - skinning_pars_vertex: skinning_pars_vertex, - skinning_vertex: skinning_vertex, - skinnormal_vertex: skinnormal_vertex, - specularmap_fragment: specularmap_fragment, - specularmap_pars_fragment: specularmap_pars_fragment, - tonemapping_fragment: tonemapping_fragment, - tonemapping_pars_fragment: tonemapping_pars_fragment, - uv_pars_fragment: uv_pars_fragment, - uv_pars_vertex: uv_pars_vertex, - uv_vertex: uv_vertex, - uv2_pars_fragment: uv2_pars_fragment, - uv2_pars_vertex: uv2_pars_vertex, - uv2_vertex: uv2_vertex, - worldpos_vertex: worldpos_vertex, - - cube_frag: cube_frag, - cube_vert: cube_vert, - depth_frag: depth_frag, - depth_vert: depth_vert, - distanceRGBA_frag: distanceRGBA_frag, - distanceRGBA_vert: distanceRGBA_vert, - equirect_frag: equirect_frag, - equirect_vert: equirect_vert, - linedashed_frag: linedashed_frag, - linedashed_vert: linedashed_vert, - meshbasic_frag: meshbasic_frag, - meshbasic_vert: meshbasic_vert, - meshlambert_frag: meshlambert_frag, - meshlambert_vert: meshlambert_vert, - meshphong_frag: meshphong_frag, - meshphong_vert: meshphong_vert, - meshphysical_frag: meshphysical_frag, - meshphysical_vert: meshphysical_vert, - normal_frag: normal_frag, - normal_vert: normal_vert, - points_frag: points_frag, - points_vert: points_vert, - shadow_frag: shadow_frag, - shadow_vert: shadow_vert - }; + return this; - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - */ + } - var ShaderLib = { + clone() { - basic: { + return new Matrix4().fromArray( this.elements ); - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.fog - ] ), + } - vertexShader: ShaderChunk.meshbasic_vert, - fragmentShader: ShaderChunk.meshbasic_frag + copy( m ) { - }, + const te = this.elements; + const me = m.elements; - lambert: { + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; + te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; + te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; + te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) } - } - ] ), + return this; - vertexShader: ShaderChunk.meshlambert_vert, - fragmentShader: ShaderChunk.meshlambert_frag + } - }, + copyPosition( m ) { - phong: { + const te = this.elements, me = m.elements; - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.gradientmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) }, - specular: { value: new Color( 0x111111 ) }, - shininess: { value: 30 } - } - ] ), + te[ 12 ] = me[ 12 ]; + te[ 13 ] = me[ 13 ]; + te[ 14 ] = me[ 14 ]; - vertexShader: ShaderChunk.meshphong_vert, - fragmentShader: ShaderChunk.meshphong_frag + return this; - }, + } - standard: { + setFromMatrix3( m ) { - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.roughnessmap, - UniformsLib.metalnessmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) }, - roughness: { value: 0.5 }, - metalness: { value: 0.5 }, - envMapIntensity: { value: 1 } // temporary - } - ] ), + const me = m.elements; - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag + this.set( - }, + me[ 0 ], me[ 3 ], me[ 6 ], 0, + me[ 1 ], me[ 4 ], me[ 7 ], 0, + me[ 2 ], me[ 5 ], me[ 8 ], 0, + 0, 0, 0, 1 - points: { + ); - uniforms: UniformsUtils.merge( [ - UniformsLib.points, - UniformsLib.fog - ] ), + return this; - vertexShader: ShaderChunk.points_vert, - fragmentShader: ShaderChunk.points_frag + } - }, + extractBasis( xAxis, yAxis, zAxis ) { - dashed: { + xAxis.setFromMatrixColumn( this, 0 ); + yAxis.setFromMatrixColumn( this, 1 ); + zAxis.setFromMatrixColumn( this, 2 ); - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.fog, - { - scale: { value: 1 }, - dashSize: { value: 1 }, - totalSize: { value: 2 } - } - ] ), + return this; - vertexShader: ShaderChunk.linedashed_vert, - fragmentShader: ShaderChunk.linedashed_frag + } - }, + makeBasis( xAxis, yAxis, zAxis ) { - depth: { + this.set( + xAxis.x, yAxis.x, zAxis.x, 0, + xAxis.y, yAxis.y, zAxis.y, 0, + xAxis.z, yAxis.z, zAxis.z, 0, + 0, 0, 0, 1 + ); - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.displacementmap - ] ), + return this; - vertexShader: ShaderChunk.depth_vert, - fragmentShader: ShaderChunk.depth_frag + } - }, + extractRotation( m ) { - normal: { + // this method does not support reflection matrices - uniforms: UniformsUtils.merge( [ - UniformsLib.common, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - { - opacity: { value: 1.0 } - } - ] ), + const te = this.elements; + const me = m.elements; - vertexShader: ShaderChunk.normal_vert, - fragmentShader: ShaderChunk.normal_frag + const scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length(); + const scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length(); + const scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length(); - }, + te[ 0 ] = me[ 0 ] * scaleX; + te[ 1 ] = me[ 1 ] * scaleX; + te[ 2 ] = me[ 2 ] * scaleX; + te[ 3 ] = 0; - /* ------------------------------------------------------------------------- - // Cube map shader - ------------------------------------------------------------------------- */ + te[ 4 ] = me[ 4 ] * scaleY; + te[ 5 ] = me[ 5 ] * scaleY; + te[ 6 ] = me[ 6 ] * scaleY; + te[ 7 ] = 0; - cube: { + te[ 8 ] = me[ 8 ] * scaleZ; + te[ 9 ] = me[ 9 ] * scaleZ; + te[ 10 ] = me[ 10 ] * scaleZ; + te[ 11 ] = 0; - uniforms: { - tCube: { value: null }, - tFlip: { value: - 1 }, - opacity: { value: 1.0 } - }, + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - vertexShader: ShaderChunk.cube_vert, - fragmentShader: ShaderChunk.cube_frag + return this; - }, + } - /* ------------------------------------------------------------------------- - // Cube map shader - ------------------------------------------------------------------------- */ + makeRotationFromEuler( euler ) { - equirect: { + const te = this.elements; - uniforms: { - tEquirect: { value: null }, - tFlip: { value: - 1 } - }, + const x = euler.x, y = euler.y, z = euler.z; + const a = Math.cos( x ), b = Math.sin( x ); + const c = Math.cos( y ), d = Math.sin( y ); + const e = Math.cos( z ), f = Math.sin( z ); - vertexShader: ShaderChunk.equirect_vert, - fragmentShader: ShaderChunk.equirect_frag + if ( euler.order === 'XYZ' ) { - }, + const ae = a * e, af = a * f, be = b * e, bf = b * f; - distanceRGBA: { + te[ 0 ] = c * e; + te[ 4 ] = - c * f; + te[ 8 ] = d; - uniforms: { - lightPos: { value: new Vector3() } - }, + te[ 1 ] = af + be * d; + te[ 5 ] = ae - bf * d; + te[ 9 ] = - b * c; - vertexShader: ShaderChunk.distanceRGBA_vert, - fragmentShader: ShaderChunk.distanceRGBA_frag + te[ 2 ] = bf - ae * d; + te[ 6 ] = be + af * d; + te[ 10 ] = a * c; - } + } else if ( euler.order === 'YXZ' ) { - }; + const ce = c * e, cf = c * f, de = d * e, df = d * f; - ShaderLib.physical = { + te[ 0 ] = ce + df * b; + te[ 4 ] = de * b - cf; + te[ 8 ] = a * d; - uniforms: UniformsUtils.merge( [ - ShaderLib.standard.uniforms, - { - clearCoat: { value: 0 }, - clearCoatRoughness: { value: 0 } - } - ] ), + te[ 1 ] = a * f; + te[ 5 ] = a * e; + te[ 9 ] = - b; - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag + te[ 2 ] = cf * b - de; + te[ 6 ] = df + ce * b; + te[ 10 ] = a * c; - }; + } else if ( euler.order === 'ZXY' ) { - /** - * @author bhouston / http://clara.io - */ + const ce = c * e, cf = c * f, de = d * e, df = d * f; - function Box2( min, max ) { + te[ 0 ] = ce - df * b; + te[ 4 ] = - a * f; + te[ 8 ] = de + cf * b; - this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); + te[ 1 ] = cf + de * b; + te[ 5 ] = a * e; + te[ 9 ] = df - ce * b; - } + te[ 2 ] = - a * d; + te[ 6 ] = b; + te[ 10 ] = a * c; - Object.assign( Box2.prototype, { + } else if ( euler.order === 'ZYX' ) { - set: function ( min, max ) { + const ae = a * e, af = a * f, be = b * e, bf = b * f; - this.min.copy( min ); - this.max.copy( max ); + te[ 0 ] = c * e; + te[ 4 ] = be * d - af; + te[ 8 ] = ae * d + bf; - return this; + te[ 1 ] = c * f; + te[ 5 ] = bf * d + ae; + te[ 9 ] = af * d - be; - }, + te[ 2 ] = - d; + te[ 6 ] = b * c; + te[ 10 ] = a * c; - setFromPoints: function ( points ) { + } else if ( euler.order === 'YZX' ) { - this.makeEmpty(); + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - for ( var i = 0, il = points.length; i < il; i ++ ) { + te[ 0 ] = c * e; + te[ 4 ] = bd - ac * f; + te[ 8 ] = bc * f + ad; - this.expandByPoint( points[ i ] ); + te[ 1 ] = f; + te[ 5 ] = a * e; + te[ 9 ] = - b * e; - } + te[ 2 ] = - d * e; + te[ 6 ] = ad * f + bc; + te[ 10 ] = ac - bd * f; - return this; + } else if ( euler.order === 'XZY' ) { - }, + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - setFromCenterAndSize: function () { + te[ 0 ] = c * e; + te[ 4 ] = - f; + te[ 8 ] = d * e; - var v1 = new Vector2(); + te[ 1 ] = ac * f + bd; + te[ 5 ] = a * e; + te[ 9 ] = ad * f - bc; - return function setFromCenterAndSize( center, size ) { + te[ 2 ] = bc * f - ad; + te[ 6 ] = b * e; + te[ 10 ] = bd * f + ac; - var halfSize = v1.copy( size ).multiplyScalar( 0.5 ); - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); + } - return this; + // bottom row + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; - }; + // last column + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - }(), + return this; - clone: function () { + } - return new this.constructor().copy( this ); + makeRotationFromQuaternion( q ) { - }, + return this.compose( _zero, q, _one ); - copy: function ( box ) { + } - this.min.copy( box.min ); - this.max.copy( box.max ); + lookAt( eye, target, up ) { - return this; + const te = this.elements; - }, + _z.subVectors( eye, target ); - makeEmpty: function () { + if ( _z.lengthSq() === 0 ) { - this.min.x = this.min.y = + Infinity; - this.max.x = this.max.y = - Infinity; + // eye and target are in the same position - return this; + _z.z = 1; - }, + } - isEmpty: function () { + _z.normalize(); + _x.crossVectors( up, _z ); - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + if ( _x.lengthSq() === 0 ) { - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); + // up and z are parallel - }, + if ( Math.abs( up.z ) === 1 ) { - getCenter: function ( optionalTarget ) { + _z.x += 0.0001; - var result = optionalTarget || new Vector2(); - return this.isEmpty() ? result.set( 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + } else { - }, + _z.z += 0.0001; - getSize: function ( optionalTarget ) { + } - var result = optionalTarget || new Vector2(); - return this.isEmpty() ? result.set( 0, 0 ) : result.subVectors( this.max, this.min ); + _z.normalize(); + _x.crossVectors( up, _z ); - }, + } - expandByPoint: function ( point ) { + _x.normalize(); + _y.crossVectors( _z, _x ); - this.min.min( point ); - this.max.max( point ); + te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; + te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; + te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; return this; - }, - - expandByVector: function ( vector ) { - - this.min.sub( vector ); - this.max.add( vector ); + } - return this; + multiply( m ) { - }, + return this.multiplyMatrices( this, m ); - expandByScalar: function ( scalar ) { + } - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); + premultiply( m ) { - return this; + return this.multiplyMatrices( m, this ); - }, + } - containsPoint: function ( point ) { + multiplyMatrices( a, b ) { - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y ? false : true; + const ae = a.elements; + const be = b.elements; + const te = this.elements; - }, + const a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; + const a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; + const a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; + const a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; - containsBox: function ( box ) { + const b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; + const b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; + const b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; + const b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y; + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - }, + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - getParameter: function ( point, optionalTarget ) { + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - // This can potentially have a divide by zero if the box - // has a size dimension of 0. + te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - var result = optionalTarget || new Vector2(); + return this; - return result.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ) - ); + } - }, + multiplyScalar( s ) { - intersectsBox: function ( box ) { + const te = this.elements; - // using 4 splitting planes to rule out intersections + te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; + te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; + te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; + te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y ? false : true; + return this; - }, + } - clampPoint: function ( point, optionalTarget ) { + determinant() { - var result = optionalTarget || new Vector2(); - return result.copy( point ).clamp( this.min, this.max ); + const te = this.elements; - }, + const n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; + const n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; + const n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; + const n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; - distanceToPoint: function () { + //TODO: make this more efficient + //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) - var v1 = new Vector2(); + return ( + n41 * ( + + n14 * n23 * n32 + - n13 * n24 * n32 + - n14 * n22 * n33 + + n12 * n24 * n33 + + n13 * n22 * n34 + - n12 * n23 * n34 + ) + + n42 * ( + + n11 * n23 * n34 + - n11 * n24 * n33 + + n14 * n21 * n33 + - n13 * n21 * n34 + + n13 * n24 * n31 + - n14 * n23 * n31 + ) + + n43 * ( + + n11 * n24 * n32 + - n11 * n22 * n34 + - n14 * n21 * n32 + + n12 * n21 * n34 + + n14 * n22 * n31 + - n12 * n24 * n31 + ) + + n44 * ( + - n13 * n22 * n31 + - n11 * n23 * n32 + + n11 * n22 * n33 + + n13 * n21 * n32 + - n12 * n21 * n33 + + n12 * n23 * n31 + ) - return function distanceToPoint( point ) { + ); - var clampedPoint = v1.copy( point ).clamp( this.min, this.max ); - return clampedPoint.sub( point ).length(); + } - }; + transpose() { - }(), + const te = this.elements; + let tmp; - intersect: function ( box ) { + tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; + tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; + tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; - this.min.max( box.min ); - this.max.min( box.max ); + tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; + tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; + tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; return this; - }, + } - union: function ( box ) { + setPosition( x, y, z ) { - this.min.min( box.min ); - this.max.max( box.max ); + const te = this.elements; - return this; + if ( x.isVector3 ) { - }, + te[ 12 ] = x.x; + te[ 13 ] = x.y; + te[ 14 ] = x.z; - translate: function ( offset ) { + } else { - this.min.add( offset ); - this.max.add( offset ); + te[ 12 ] = x; + te[ 13 ] = y; + te[ 14 ] = z; + + } return this; - }, + } - equals: function ( box ) { + invert() { - return box.min.equals( this.min ) && box.max.equals( this.max ); + // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm + const te = this.elements, - } + n11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ], + n12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ], + n13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ], + n14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ], - } ); + t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, + t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, + t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, + t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ + const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; - function LensFlarePlugin( renderer, flares ) { + if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); - var gl = renderer.context; - var state = renderer.state; + const detInv = 1 / det; - var vertexBuffer, elementBuffer; - var shader, program, attributes, uniforms; + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; + te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; + te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; - var tempTexture, occlusionTexture; + te[ 4 ] = t12 * detInv; + te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; + te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; + te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; - function init() { + te[ 8 ] = t13 * detInv; + te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; + te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; + te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; - var vertices = new Float32Array( [ - - 1, - 1, 0, 0, - 1, - 1, 1, 0, - 1, 1, 1, 1, - - 1, 1, 0, 1 - ] ); + te[ 12 ] = t14 * detInv; + te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; + te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; + te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; - var faces = new Uint16Array( [ - 0, 1, 2, - 0, 2, 3 - ] ); + return this; - // buffers + } - vertexBuffer = gl.createBuffer(); - elementBuffer = gl.createBuffer(); + scale( v ) { - gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); - gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); + const te = this.elements; + const x = v.x, y = v.y, z = v.z; - gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); - gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); + te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; + te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; + te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; + te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; - // textures + return this; - tempTexture = gl.createTexture(); - occlusionTexture = gl.createTexture(); + } - state.bindTexture( gl.TEXTURE_2D, tempTexture ); - gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + getMaxScaleOnAxis() { - state.bindTexture( gl.TEXTURE_2D, occlusionTexture ); - gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); - gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + const te = this.elements; - shader = { + const scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; + const scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; + const scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; - vertexShader: [ + return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); - "uniform lowp int renderType;", + } - "uniform vec3 screenPosition;", - "uniform vec2 scale;", - "uniform float rotation;", + makeTranslation( x, y, z ) { - "uniform sampler2D occlusionMap;", + if ( x.isVector3 ) { - "attribute vec2 position;", - "attribute vec2 uv;", + this.set( - "varying vec2 vUV;", - "varying float vVisibility;", + 1, 0, 0, x.x, + 0, 1, 0, x.y, + 0, 0, 1, x.z, + 0, 0, 0, 1 - "void main() {", + ); - "vUV = uv;", + } else { - "vec2 pos = position;", + this.set( - "if ( renderType == 2 ) {", + 1, 0, 0, x, + 0, 1, 0, y, + 0, 0, 1, z, + 0, 0, 0, 1 - "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", - "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", + ); - "vVisibility = visibility.r / 9.0;", - "vVisibility *= 1.0 - visibility.g / 9.0;", - "vVisibility *= visibility.b / 9.0;", - "vVisibility *= 1.0 - visibility.a / 9.0;", + } - "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", - "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", + return this; - "}", + } - "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", + makeRotationX( theta ) { - "}" + const c = Math.cos( theta ), s = Math.sin( theta ); - ].join( "\n" ), + this.set( - fragmentShader: [ + 1, 0, 0, 0, + 0, c, - s, 0, + 0, s, c, 0, + 0, 0, 0, 1 - "uniform lowp int renderType;", + ); - "uniform sampler2D map;", - "uniform float opacity;", - "uniform vec3 color;", + return this; - "varying vec2 vUV;", - "varying float vVisibility;", + } - "void main() {", + makeRotationY( theta ) { - // pink square + const c = Math.cos( theta ), s = Math.sin( theta ); - "if ( renderType == 0 ) {", + this.set( - "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", + c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1 - // restore + ); - "} else if ( renderType == 1 ) {", + return this; - "gl_FragColor = texture2D( map, vUV );", + } - // flare + makeRotationZ( theta ) { - "} else {", + const c = Math.cos( theta ), s = Math.sin( theta ); - "vec4 texture = texture2D( map, vUV );", - "texture.a *= opacity * vVisibility;", - "gl_FragColor = texture;", - "gl_FragColor.rgb *= color;", + this.set( - "}", + c, - s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - "}" + ); - ].join( "\n" ) + return this; - }; + } - program = createProgram( shader ); + makeRotationAxis( axis, angle ) { - attributes = { - vertex: gl.getAttribLocation ( program, "position" ), - uv: gl.getAttribLocation ( program, "uv" ) - }; + // Based on http://www.gamedev.net/reference/articles/article1199.asp - uniforms = { - renderType: gl.getUniformLocation( program, "renderType" ), - map: gl.getUniformLocation( program, "map" ), - occlusionMap: gl.getUniformLocation( program, "occlusionMap" ), - opacity: gl.getUniformLocation( program, "opacity" ), - color: gl.getUniformLocation( program, "color" ), - scale: gl.getUniformLocation( program, "scale" ), - rotation: gl.getUniformLocation( program, "rotation" ), - screenPosition: gl.getUniformLocation( program, "screenPosition" ) - }; + const c = Math.cos( angle ); + const s = Math.sin( angle ); + const t = 1 - c; + const x = axis.x, y = axis.y, z = axis.z; + const tx = t * x, ty = t * y; + + this.set( + + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + + ); + + return this; } - /* - * Render lens flares - * Method: renders 16x16 0xff00ff-colored points scattered over the light source area, - * reads these back and calculates occlusion. - */ + makeScale( x, y, z ) { - this.render = function ( scene, camera, viewport ) { + this.set( - if ( flares.length === 0 ) return; + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 - var tempPosition = new Vector3(); + ); - var invAspect = viewport.w / viewport.z, - halfViewportWidth = viewport.z * 0.5, - halfViewportHeight = viewport.w * 0.5; + return this; - var size = 16 / viewport.w, - scale = new Vector2( size * invAspect, size ); + } - var screenPosition = new Vector3( 1, 1, 0 ), - screenPositionPixels = new Vector2( 1, 1 ); + makeShear( xy, xz, yx, yz, zx, zy ) { - var validArea = new Box2(); + this.set( - validArea.min.set( viewport.x, viewport.y ); - validArea.max.set( viewport.x + ( viewport.z - 16 ), viewport.y + ( viewport.w - 16 ) ); + 1, yx, zx, 0, + xy, 1, zy, 0, + xz, yz, 1, 0, + 0, 0, 0, 1 - if ( program === undefined ) { + ); - init(); + return this; - } + } - gl.useProgram( program ); + compose( position, quaternion, scale ) { - state.initAttributes(); - state.enableAttribute( attributes.vertex ); - state.enableAttribute( attributes.uv ); - state.disableUnusedAttributes(); + const te = this.elements; - // loop through all lens flares to update their occlusion and positions - // setup gl and common used attribs/uniforms + const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; + const x2 = x + x, y2 = y + y, z2 = z + z; + const xx = x * x2, xy = x * y2, xz = x * z2; + const yy = y * y2, yz = y * z2, zz = z * z2; + const wx = w * x2, wy = w * y2, wz = w * z2; - gl.uniform1i( uniforms.occlusionMap, 0 ); - gl.uniform1i( uniforms.map, 1 ); + const sx = scale.x, sy = scale.y, sz = scale.z; - gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); - gl.vertexAttribPointer( attributes.vertex, 2, gl.FLOAT, false, 2 * 8, 0 ); - gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; + te[ 1 ] = ( xy + wz ) * sx; + te[ 2 ] = ( xz - wy ) * sx; + te[ 3 ] = 0; - gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + te[ 4 ] = ( xy - wz ) * sy; + te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; + te[ 6 ] = ( yz + wx ) * sy; + te[ 7 ] = 0; - state.disable( gl.CULL_FACE ); - state.buffers.depth.setMask( false ); + te[ 8 ] = ( xz + wy ) * sz; + te[ 9 ] = ( yz - wx ) * sz; + te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; + te[ 11 ] = 0; - for ( var i = 0, l = flares.length; i < l; i ++ ) { + te[ 12 ] = position.x; + te[ 13 ] = position.y; + te[ 14 ] = position.z; + te[ 15 ] = 1; - size = 16 / viewport.w; - scale.set( size * invAspect, size ); + return this; - // calc object screen position + } - var flare = flares[ i ]; + decompose( position, quaternion, scale ) { - tempPosition.set( flare.matrixWorld.elements[ 12 ], flare.matrixWorld.elements[ 13 ], flare.matrixWorld.elements[ 14 ] ); + const te = this.elements; - tempPosition.applyMatrix4( camera.matrixWorldInverse ); - tempPosition.applyMatrix4( camera.projectionMatrix ); + let sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); + const sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); + const sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); - // setup arrays for gl programs + // if determine is negative, we need to invert one scale + const det = this.determinant(); + if ( det < 0 ) sx = - sx; - screenPosition.copy( tempPosition ); + position.x = te[ 12 ]; + position.y = te[ 13 ]; + position.z = te[ 14 ]; - // horizontal and vertical coordinate of the lower left corner of the pixels to copy + // scale the rotation part + _m1$2.copy( this ); - screenPositionPixels.x = viewport.x + ( screenPosition.x * halfViewportWidth ) + halfViewportWidth - 8; - screenPositionPixels.y = viewport.y + ( screenPosition.y * halfViewportHeight ) + halfViewportHeight - 8; + const invSX = 1 / sx; + const invSY = 1 / sy; + const invSZ = 1 / sz; - // screen cull + _m1$2.elements[ 0 ] *= invSX; + _m1$2.elements[ 1 ] *= invSX; + _m1$2.elements[ 2 ] *= invSX; - if ( validArea.containsPoint( screenPositionPixels ) === true ) { + _m1$2.elements[ 4 ] *= invSY; + _m1$2.elements[ 5 ] *= invSY; + _m1$2.elements[ 6 ] *= invSY; - // save current RGB to temp texture + _m1$2.elements[ 8 ] *= invSZ; + _m1$2.elements[ 9 ] *= invSZ; + _m1$2.elements[ 10 ] *= invSZ; - state.activeTexture( gl.TEXTURE0 ); - state.bindTexture( gl.TEXTURE_2D, null ); - state.activeTexture( gl.TEXTURE1 ); - state.bindTexture( gl.TEXTURE_2D, tempTexture ); - gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 ); + quaternion.setFromRotationMatrix( _m1$2 ); + scale.x = sx; + scale.y = sy; + scale.z = sz; - // render pink quad + return this; - gl.uniform1i( uniforms.renderType, 0 ); - gl.uniform2f( uniforms.scale, scale.x, scale.y ); - gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); + } - state.disable( gl.BLEND ); - state.enable( gl.DEPTH_TEST ); + makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { - gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + const te = this.elements; + const x = 2 * near / ( right - left ); + const y = 2 * near / ( top - bottom ); + const a = ( right + left ) / ( right - left ); + const b = ( top + bottom ) / ( top - bottom ); - // copy result to occlusionMap + let c, d; - state.activeTexture( gl.TEXTURE0 ); - state.bindTexture( gl.TEXTURE_2D, occlusionTexture ); - gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 ); + if ( coordinateSystem === WebGLCoordinateSystem ) { + c = - ( far + near ) / ( far - near ); + d = ( - 2 * far * near ) / ( far - near ); - // restore graphics + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { - gl.uniform1i( uniforms.renderType, 1 ); - state.disable( gl.DEPTH_TEST ); + c = - far / ( far - near ); + d = ( - far * near ) / ( far - near ); - state.activeTexture( gl.TEXTURE1 ); - state.bindTexture( gl.TEXTURE_2D, tempTexture ); - gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + } else { + throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem ); - // update object positions + } - flare.positionScreen.copy( screenPosition ); + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; - if ( flare.customUpdateCallback ) { + return this; - flare.customUpdateCallback( flare ); + } - } else { + makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { - flare.updateLensFlares(); + const te = this.elements; + const w = 1.0 / ( right - left ); + const h = 1.0 / ( top - bottom ); + const p = 1.0 / ( far - near ); - } + const x = ( right + left ) * w; + const y = ( top + bottom ) * h; - // render flares + let z, zInv; - gl.uniform1i( uniforms.renderType, 2 ); - state.enable( gl.BLEND ); + if ( coordinateSystem === WebGLCoordinateSystem ) { - for ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) { + z = ( far + near ) * p; + zInv = - 2 * p; - var sprite = flare.lensFlares[ j ]; + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { - if ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) { + z = near * p; + zInv = - 1 * p; - screenPosition.x = sprite.x; - screenPosition.y = sprite.y; - screenPosition.z = sprite.z; + } else { - size = sprite.size * sprite.scale / viewport.w; + throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem ); - scale.x = size * invAspect; - scale.y = size; + } - gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); - gl.uniform2f( uniforms.scale, scale.x, scale.y ); - gl.uniform1f( uniforms.rotation, sprite.rotation ); + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; - gl.uniform1f( uniforms.opacity, sprite.opacity ); - gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); + return this; - state.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst ); - renderer.setTexture2D( sprite.texture, 1 ); + } - gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + equals( matrix ) { - } + const te = this.elements; + const me = matrix.elements; - } + for ( let i = 0; i < 16; i ++ ) { - } + if ( te[ i ] !== me[ i ] ) return false; } - // restore gl - - state.enable( gl.CULL_FACE ); - state.enable( gl.DEPTH_TEST ); - state.buffers.depth.setMask( true ); + return true; - renderer.resetGLState(); + } - }; + fromArray( array, offset = 0 ) { - function createProgram( shader ) { + for ( let i = 0; i < 16; i ++ ) { - var program = gl.createProgram(); + this.elements[ i ] = array[ i + offset ]; - var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); - var vertexShader = gl.createShader( gl.VERTEX_SHADER ); + } - var prefix = "precision " + renderer.getPrecision() + " float;\n"; + return this; - gl.shaderSource( fragmentShader, prefix + shader.fragmentShader ); - gl.shaderSource( vertexShader, prefix + shader.vertexShader ); + } - gl.compileShader( fragmentShader ); - gl.compileShader( vertexShader ); + toArray( array = [], offset = 0 ) { - gl.attachShader( program, fragmentShader ); - gl.attachShader( program, vertexShader ); + const te = this.elements; - gl.linkProgram( program ); + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + array[ offset + 3 ] = te[ 3 ]; - return program; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; - } + array[ offset + 8 ] = te[ 8 ]; + array[ offset + 9 ] = te[ 9 ]; + array[ offset + 10 ] = te[ 10 ]; + array[ offset + 11 ] = te[ 11 ]; - } + array[ offset + 12 ] = te[ 12 ]; + array[ offset + 13 ] = te[ 13 ]; + array[ offset + 14 ] = te[ 14 ]; + array[ offset + 15 ] = te[ 15 ]; - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ + return array; - function SpritePlugin( renderer, sprites ) { + } - var gl = renderer.context; - var state = renderer.state; + } - var vertexBuffer, elementBuffer; - var program, attributes, uniforms; + const _v1$5 = /*@__PURE__*/ new Vector3(); + const _m1$2 = /*@__PURE__*/ new Matrix4(); + const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 ); + const _one = /*@__PURE__*/ new Vector3( 1, 1, 1 ); + const _x = /*@__PURE__*/ new Vector3(); + const _y = /*@__PURE__*/ new Vector3(); + const _z = /*@__PURE__*/ new Vector3(); - var texture; + const _matrix = /*@__PURE__*/ new Matrix4(); + const _quaternion$3 = /*@__PURE__*/ new Quaternion(); - // decompose matrixWorld + class Euler { - var spritePosition = new Vector3(); - var spriteRotation = new Quaternion(); - var spriteScale = new Vector3(); + constructor( x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER ) { - function init() { + this.isEuler = true; - var vertices = new Float32Array( [ - - 0.5, - 0.5, 0, 0, - 0.5, - 0.5, 1, 0, - 0.5, 0.5, 1, 1, - - 0.5, 0.5, 0, 1 - ] ); + this._x = x; + this._y = y; + this._z = z; + this._order = order; - var faces = new Uint16Array( [ - 0, 1, 2, - 0, 2, 3 - ] ); + } - vertexBuffer = gl.createBuffer(); - elementBuffer = gl.createBuffer(); + get x() { - gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); - gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); + return this._x; - gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); - gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); + } - program = createProgram(); + set x( value ) { - attributes = { - position: gl.getAttribLocation ( program, 'position' ), - uv: gl.getAttribLocation ( program, 'uv' ) - }; + this._x = value; + this._onChangeCallback(); - uniforms = { - uvOffset: gl.getUniformLocation( program, 'uvOffset' ), - uvScale: gl.getUniformLocation( program, 'uvScale' ), + } - rotation: gl.getUniformLocation( program, 'rotation' ), - scale: gl.getUniformLocation( program, 'scale' ), + get y() { - color: gl.getUniformLocation( program, 'color' ), - map: gl.getUniformLocation( program, 'map' ), - opacity: gl.getUniformLocation( program, 'opacity' ), + return this._y; - modelViewMatrix: gl.getUniformLocation( program, 'modelViewMatrix' ), - projectionMatrix: gl.getUniformLocation( program, 'projectionMatrix' ), + } - fogType: gl.getUniformLocation( program, 'fogType' ), - fogDensity: gl.getUniformLocation( program, 'fogDensity' ), - fogNear: gl.getUniformLocation( program, 'fogNear' ), - fogFar: gl.getUniformLocation( program, 'fogFar' ), - fogColor: gl.getUniformLocation( program, 'fogColor' ), + set y( value ) { - alphaTest: gl.getUniformLocation( program, 'alphaTest' ) - }; + this._y = value; + this._onChangeCallback(); - var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - canvas.width = 8; - canvas.height = 8; + } - var context = canvas.getContext( '2d' ); - context.fillStyle = 'white'; - context.fillRect( 0, 0, 8, 8 ); + get z() { - texture = new Texture( canvas ); - texture.needsUpdate = true; + return this._z; } - this.render = function ( scene, camera ) { + set z( value ) { - if ( sprites.length === 0 ) return; + this._z = value; + this._onChangeCallback(); - // setup gl + } - if ( program === undefined ) { + get order() { - init(); + return this._order; - } + } - gl.useProgram( program ); + set order( value ) { - state.initAttributes(); - state.enableAttribute( attributes.position ); - state.enableAttribute( attributes.uv ); - state.disableUnusedAttributes(); + this._order = value; + this._onChangeCallback(); - state.disable( gl.CULL_FACE ); - state.enable( gl.BLEND ); + } - gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); - gl.vertexAttribPointer( attributes.position, 2, gl.FLOAT, false, 2 * 8, 0 ); - gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + set( x, y, z, order = this._order ) { - gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + this._x = x; + this._y = y; + this._z = z; + this._order = order; - gl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera.projectionMatrix.elements ); + this._onChangeCallback(); - state.activeTexture( gl.TEXTURE0 ); - gl.uniform1i( uniforms.map, 0 ); + return this; - var oldFogType = 0; - var sceneFogType = 0; - var fog = scene.fog; + } - if ( fog ) { + clone() { - gl.uniform3f( uniforms.fogColor, fog.color.r, fog.color.g, fog.color.b ); + return new this.constructor( this._x, this._y, this._z, this._order ); - if ( fog.isFog ) { + } - gl.uniform1f( uniforms.fogNear, fog.near ); - gl.uniform1f( uniforms.fogFar, fog.far ); + copy( euler ) { - gl.uniform1i( uniforms.fogType, 1 ); - oldFogType = 1; - sceneFogType = 1; + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; - } else if ( fog.isFogExp2 ) { + this._onChangeCallback(); - gl.uniform1f( uniforms.fogDensity, fog.density ); + return this; - gl.uniform1i( uniforms.fogType, 2 ); - oldFogType = 2; - sceneFogType = 2; + } - } + setFromRotationMatrix( m, order = this._order, update = true ) { - } else { + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - gl.uniform1i( uniforms.fogType, 0 ); - oldFogType = 0; - sceneFogType = 0; + const te = m.elements; + const m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; + const m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; + const m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - } + switch ( order ) { + case 'XYZ': - // update positions and sort + this._y = Math.asin( clamp( m13, - 1, 1 ) ); - for ( var i = 0, l = sprites.length; i < l; i ++ ) { + if ( Math.abs( m13 ) < 0.9999999 ) { - var sprite = sprites[ i ]; + this._x = Math.atan2( - m23, m33 ); + this._z = Math.atan2( - m12, m11 ); - sprite.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld ); - sprite.z = - sprite.modelViewMatrix.elements[ 14 ]; + } else { - } + this._x = Math.atan2( m32, m22 ); + this._z = 0; - sprites.sort( painterSortStable ); + } - // render all sprites + break; - var scale = []; + case 'YXZ': - for ( var i = 0, l = sprites.length; i < l; i ++ ) { + this._x = Math.asin( - clamp( m23, - 1, 1 ) ); - var sprite = sprites[ i ]; - var material = sprite.material; + if ( Math.abs( m23 ) < 0.9999999 ) { - if ( material.visible === false ) continue; + this._y = Math.atan2( m13, m33 ); + this._z = Math.atan2( m21, m22 ); - sprite.onBeforeRender( renderer, scene, camera, undefined, material, undefined ); + } else { - gl.uniform1f( uniforms.alphaTest, material.alphaTest ); - gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements ); + this._y = Math.atan2( - m31, m11 ); + this._z = 0; - sprite.matrixWorld.decompose( spritePosition, spriteRotation, spriteScale ); + } - scale[ 0 ] = spriteScale.x; - scale[ 1 ] = spriteScale.y; + break; - var fogType = 0; + case 'ZXY': - if ( scene.fog && material.fog ) { + this._x = Math.asin( clamp( m32, - 1, 1 ) ); - fogType = sceneFogType; + if ( Math.abs( m32 ) < 0.9999999 ) { - } + this._y = Math.atan2( - m31, m33 ); + this._z = Math.atan2( - m12, m22 ); - if ( oldFogType !== fogType ) { + } else { - gl.uniform1i( uniforms.fogType, fogType ); - oldFogType = fogType; + this._y = 0; + this._z = Math.atan2( m21, m11 ); - } + } - if ( material.map !== null ) { + break; - gl.uniform2f( uniforms.uvOffset, material.map.offset.x, material.map.offset.y ); - gl.uniform2f( uniforms.uvScale, material.map.repeat.x, material.map.repeat.y ); + case 'ZYX': - } else { + this._y = Math.asin( - clamp( m31, - 1, 1 ) ); - gl.uniform2f( uniforms.uvOffset, 0, 0 ); - gl.uniform2f( uniforms.uvScale, 1, 1 ); + if ( Math.abs( m31 ) < 0.9999999 ) { - } + this._x = Math.atan2( m32, m33 ); + this._z = Math.atan2( m21, m11 ); - gl.uniform1f( uniforms.opacity, material.opacity ); - gl.uniform3f( uniforms.color, material.color.r, material.color.g, material.color.b ); + } else { - gl.uniform1f( uniforms.rotation, material.rotation ); - gl.uniform2fv( uniforms.scale, scale ); + this._x = 0; + this._z = Math.atan2( - m12, m22 ); - state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ); - state.buffers.depth.setTest( material.depthTest ); - state.buffers.depth.setMask( material.depthWrite ); + } - if ( material.map ) { + break; - renderer.setTexture2D( material.map, 0 ); + case 'YZX': - } else { + this._z = Math.asin( clamp( m21, - 1, 1 ) ); - renderer.setTexture2D( texture, 0 ); + if ( Math.abs( m21 ) < 0.9999999 ) { - } + this._x = Math.atan2( - m23, m22 ); + this._y = Math.atan2( - m31, m11 ); - gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + } else { - sprite.onAfterRender( renderer, scene, camera, undefined, material, undefined ); + this._x = 0; + this._y = Math.atan2( m13, m33 ); - } + } - // restore gl + break; - state.enable( gl.CULL_FACE ); + case 'XZY': - renderer.resetGLState(); + this._z = Math.asin( - clamp( m12, - 1, 1 ) ); - }; + if ( Math.abs( m12 ) < 0.9999999 ) { - function createProgram() { + this._x = Math.atan2( m32, m22 ); + this._y = Math.atan2( m13, m11 ); - var program = gl.createProgram(); + } else { - var vertexShader = gl.createShader( gl.VERTEX_SHADER ); - var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); + this._x = Math.atan2( - m23, m33 ); + this._y = 0; - gl.shaderSource( vertexShader, [ + } - 'precision ' + renderer.getPrecision() + ' float;', + break; - '#define SHADER_NAME ' + 'SpriteMaterial', + default: - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform float rotation;', - 'uniform vec2 scale;', - 'uniform vec2 uvOffset;', - 'uniform vec2 uvScale;', + console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); - 'attribute vec2 position;', - 'attribute vec2 uv;', + } - 'varying vec2 vUV;', + this._order = order; - 'void main() {', + if ( update === true ) this._onChangeCallback(); - 'vUV = uvOffset + uv * uvScale;', + return this; - 'vec2 alignedPosition = position * scale;', + } - 'vec2 rotatedPosition;', - 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;', - 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;', + setFromQuaternion( q, order, update ) { - 'vec4 finalPosition;', + _matrix.makeRotationFromQuaternion( q ); - 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );', - 'finalPosition.xy += rotatedPosition;', - 'finalPosition = projectionMatrix * finalPosition;', + return this.setFromRotationMatrix( _matrix, order, update ); - 'gl_Position = finalPosition;', + } - '}' + setFromVector3( v, order = this._order ) { - ].join( '\n' ) ); + return this.set( v.x, v.y, v.z, order ); - gl.shaderSource( fragmentShader, [ + } - 'precision ' + renderer.getPrecision() + ' float;', + reorder( newOrder ) { - '#define SHADER_NAME ' + 'SpriteMaterial', + // WARNING: this discards revolution information -bhouston - 'uniform vec3 color;', - 'uniform sampler2D map;', - 'uniform float opacity;', + _quaternion$3.setFromEuler( this ); - 'uniform int fogType;', - 'uniform vec3 fogColor;', - 'uniform float fogDensity;', - 'uniform float fogNear;', - 'uniform float fogFar;', - 'uniform float alphaTest;', + return this.setFromQuaternion( _quaternion$3, newOrder ); - 'varying vec2 vUV;', + } - 'void main() {', + equals( euler ) { - 'vec4 texture = texture2D( map, vUV );', + return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); - 'if ( texture.a < alphaTest ) discard;', + } - 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );', + fromArray( array ) { - 'if ( fogType > 0 ) {', + this._x = array[ 0 ]; + this._y = array[ 1 ]; + this._z = array[ 2 ]; + if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; - 'float depth = gl_FragCoord.z / gl_FragCoord.w;', - 'float fogFactor = 0.0;', + this._onChangeCallback(); - 'if ( fogType == 1 ) {', + return this; - 'fogFactor = smoothstep( fogNear, fogFar, depth );', + } - '} else {', + toArray( array = [], offset = 0 ) { - 'const float LOG2 = 1.442695;', - 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );', - 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );', + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._order; - '}', + return array; - 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );', + } - '}', + _onChange( callback ) { - '}' + this._onChangeCallback = callback; - ].join( '\n' ) ); + return this; - gl.compileShader( vertexShader ); - gl.compileShader( fragmentShader ); + } - gl.attachShader( program, vertexShader ); - gl.attachShader( program, fragmentShader ); + _onChangeCallback() {} - gl.linkProgram( program ); + *[ Symbol.iterator ]() { - return program; + yield this._x; + yield this._y; + yield this._z; + yield this._order; } - function painterSortStable( a, b ) { + } - if ( a.renderOrder !== b.renderOrder ) { + Euler.DEFAULT_ORDER = 'XYZ'; - return a.renderOrder - b.renderOrder; + class Layers { - } else if ( a.z !== b.z ) { + constructor() { - return b.z - a.z; + this.mask = 1 | 0; - } else { + } - return b.id - a.id; + set( channel ) { - } + this.mask = ( 1 << channel | 0 ) >>> 0; } - } + enable( channel ) { - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + this.mask |= 1 << channel | 0; - var materialId = 0; + } - function Material() { + enableAll() { - Object.defineProperty( this, 'id', { value: materialId ++ } ); + this.mask = 0xffffffff | 0; - this.uuid = _Math.generateUUID(); + } - this.name = ''; - this.type = 'Material'; + toggle( channel ) { - this.fog = true; - this.lights = true; + this.mask ^= 1 << channel | 0; - this.blending = NormalBlending; - this.side = FrontSide; - this.shading = SmoothShading; // THREE.FlatShading, THREE.SmoothShading - this.vertexColors = NoColors; // THREE.NoColors, THREE.VertexColors, THREE.FaceColors + } - this.opacity = 1; - this.transparent = false; + disable( channel ) { - this.blendSrc = SrcAlphaFactor; - this.blendDst = OneMinusSrcAlphaFactor; - this.blendEquation = AddEquation; - this.blendSrcAlpha = null; - this.blendDstAlpha = null; - this.blendEquationAlpha = null; + this.mask &= ~ ( 1 << channel | 0 ); - this.depthFunc = LessEqualDepth; - this.depthTest = true; - this.depthWrite = true; + } - this.clippingPlanes = null; - this.clipIntersection = false; - this.clipShadows = false; + disableAll() { - this.colorWrite = true; + this.mask = 0; - this.precision = null; // override the renderer's default precision for this material + } - this.polygonOffset = false; - this.polygonOffsetFactor = 0; - this.polygonOffsetUnits = 0; + test( layers ) { - this.dithering = false; + return ( this.mask & layers.mask ) !== 0; - this.alphaTest = 0; - this.premultipliedAlpha = false; + } - this.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer + isEnabled( channel ) { - this.visible = true; + return ( this.mask & ( 1 << channel | 0 ) ) !== 0; - this.needsUpdate = true; + } } - Object.assign( Material.prototype, EventDispatcher.prototype, { + let _object3DId = 0; - isMaterial: true, + const _v1$4 = /*@__PURE__*/ new Vector3(); + const _q1 = /*@__PURE__*/ new Quaternion(); + const _m1$1 = /*@__PURE__*/ new Matrix4(); + const _target = /*@__PURE__*/ new Vector3(); - onBeforeCompile: function () {}, + const _position$3 = /*@__PURE__*/ new Vector3(); + const _scale$2 = /*@__PURE__*/ new Vector3(); + const _quaternion$2 = /*@__PURE__*/ new Quaternion(); - setValues: function ( values ) { + const _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 ); + const _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 ); + const _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 ); - if ( values === undefined ) return; + const _addedEvent = { type: 'added' }; + const _removedEvent = { type: 'removed' }; - for ( var key in values ) { + class Object3D extends EventDispatcher { - var newValue = values[ key ]; + constructor() { - if ( newValue === undefined ) { + super(); - console.warn( "THREE.Material: '" + key + "' parameter is undefined." ); - continue; + this.isObject3D = true; - } + Object.defineProperty( this, 'id', { value: _object3DId ++ } ); - var currentValue = this[ key ]; + this.uuid = generateUUID(); - if ( currentValue === undefined ) { + this.name = ''; + this.type = 'Object3D'; - console.warn( "THREE." + this.type + ": '" + key + "' is not a property of this material." ); - continue; + this.parent = null; + this.children = []; - } + this.up = Object3D.DEFAULT_UP.clone(); - if ( currentValue && currentValue.isColor ) { + const position = new Vector3(); + const rotation = new Euler(); + const quaternion = new Quaternion(); + const scale = new Vector3( 1, 1, 1 ); - currentValue.set( newValue ); + function onRotationChange() { - } else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) { + quaternion.setFromEuler( rotation, false ); - currentValue.copy( newValue ); + } - } else if ( key === 'overdraw' ) { + function onQuaternionChange() { - // ensure overdraw is backwards-compatible with legacy boolean type - this[ key ] = Number( newValue ); + rotation.setFromQuaternion( quaternion, undefined, false ); - } else { + } - this[ key ] = newValue; + rotation._onChange( onRotationChange ); + quaternion._onChange( onQuaternionChange ); + Object.defineProperties( this, { + position: { + configurable: true, + enumerable: true, + value: position + }, + rotation: { + configurable: true, + enumerable: true, + value: rotation + }, + quaternion: { + configurable: true, + enumerable: true, + value: quaternion + }, + scale: { + configurable: true, + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() } + } ); - } + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); - }, + this.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE; + this.matrixWorldNeedsUpdate = false; - toJSON: function ( meta ) { + this.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; // checked by the renderer - var isRoot = meta === undefined; + this.layers = new Layers(); + this.visible = true; - if ( isRoot ) { + this.castShadow = false; + this.receiveShadow = false; - meta = { - textures: {}, - images: {} - }; + this.frustumCulled = true; + this.renderOrder = 0; - } + this.animations = []; - var data = { - metadata: { - version: 4.5, - type: 'Material', - generator: 'Material.toJSON' - } - }; + this.userData = {}; - // standard Material serialization - data.uuid = this.uuid; - data.type = this.type; + } - if ( this.name !== '' ) data.name = this.name; + onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {} - if ( this.color && this.color.isColor ) data.color = this.color.getHex(); + onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {} - if ( this.roughness !== undefined ) data.roughness = this.roughness; - if ( this.metalness !== undefined ) data.metalness = this.metalness; + applyMatrix4( matrix ) { - if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex(); - if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex(); - if ( this.shininess !== undefined ) data.shininess = this.shininess; - if ( this.clearCoat !== undefined ) data.clearCoat = this.clearCoat; - if ( this.clearCoatRoughness !== undefined ) data.clearCoatRoughness = this.clearCoatRoughness; + if ( this.matrixAutoUpdate ) this.updateMatrix(); - if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid; - if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid; - if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid; - if ( this.bumpMap && this.bumpMap.isTexture ) { + this.matrix.premultiply( matrix ); - data.bumpMap = this.bumpMap.toJSON( meta ).uuid; - data.bumpScale = this.bumpScale; + this.matrix.decompose( this.position, this.quaternion, this.scale ); - } - if ( this.normalMap && this.normalMap.isTexture ) { + } - data.normalMap = this.normalMap.toJSON( meta ).uuid; - data.normalScale = this.normalScale.toArray(); + applyQuaternion( q ) { - } - if ( this.displacementMap && this.displacementMap.isTexture ) { + this.quaternion.premultiply( q ); - data.displacementMap = this.displacementMap.toJSON( meta ).uuid; - data.displacementScale = this.displacementScale; - data.displacementBias = this.displacementBias; + return this; - } - if ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid; - if ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid; - - if ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid; - if ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid; - - if ( this.envMap && this.envMap.isTexture ) { + } - data.envMap = this.envMap.toJSON( meta ).uuid; - data.reflectivity = this.reflectivity; // Scale behind envMap + setRotationFromAxisAngle( axis, angle ) { - } + // assumes axis is normalized - if ( this.gradientMap && this.gradientMap.isTexture ) { + this.quaternion.setFromAxisAngle( axis, angle ); - data.gradientMap = this.gradientMap.toJSON( meta ).uuid; + } - } + setRotationFromEuler( euler ) { - if ( this.size !== undefined ) data.size = this.size; - if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation; + this.quaternion.setFromEuler( euler, true ); - if ( this.blending !== NormalBlending ) data.blending = this.blending; - if ( this.shading !== SmoothShading ) data.shading = this.shading; - if ( this.side !== FrontSide ) data.side = this.side; - if ( this.vertexColors !== NoColors ) data.vertexColors = this.vertexColors; + } - if ( this.opacity < 1 ) data.opacity = this.opacity; - if ( this.transparent === true ) data.transparent = this.transparent; + setRotationFromMatrix( m ) { - data.depthFunc = this.depthFunc; - data.depthTest = this.depthTest; - data.depthWrite = this.depthWrite; + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; - if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; - if ( this.wireframe === true ) data.wireframe = this.wireframe; - if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth; - if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap; - if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; + this.quaternion.setFromRotationMatrix( m ); - data.skinning = this.skinning; - data.morphTargets = this.morphTargets; + } - data.dithering = this.dithering; + setRotationFromQuaternion( q ) { - // TODO: Copied from Object3D.toJSON + // assumes q is normalized - function extractFromCache( cache ) { + this.quaternion.copy( q ); - var values = []; + } - for ( var key in cache ) { + rotateOnAxis( axis, angle ) { - var data = cache[ key ]; - delete data.metadata; - values.push( data ); + // rotate object on axis in object space + // axis is assumed to be normalized - } + _q1.setFromAxisAngle( axis, angle ); - return values; + this.quaternion.multiply( _q1 ); - } + return this; - if ( isRoot ) { + } - var textures = extractFromCache( meta.textures ); - var images = extractFromCache( meta.images ); + rotateOnWorldAxis( axis, angle ) { - if ( textures.length > 0 ) data.textures = textures; - if ( images.length > 0 ) data.images = images; + // rotate object on axis in world space + // axis is assumed to be normalized + // method assumes no rotated parent - } + _q1.setFromAxisAngle( axis, angle ); - return data; + this.quaternion.premultiply( _q1 ); - }, + return this; - clone: function () { + } - return new this.constructor().copy( this ); + rotateX( angle ) { - }, + return this.rotateOnAxis( _xAxis, angle ); - copy: function ( source ) { + } - this.name = source.name; + rotateY( angle ) { - this.fog = source.fog; - this.lights = source.lights; + return this.rotateOnAxis( _yAxis, angle ); - this.blending = source.blending; - this.side = source.side; - this.shading = source.shading; - this.vertexColors = source.vertexColors; + } - this.opacity = source.opacity; - this.transparent = source.transparent; + rotateZ( angle ) { - this.blendSrc = source.blendSrc; - this.blendDst = source.blendDst; - this.blendEquation = source.blendEquation; - this.blendSrcAlpha = source.blendSrcAlpha; - this.blendDstAlpha = source.blendDstAlpha; - this.blendEquationAlpha = source.blendEquationAlpha; + return this.rotateOnAxis( _zAxis, angle ); - this.depthFunc = source.depthFunc; - this.depthTest = source.depthTest; - this.depthWrite = source.depthWrite; + } - this.colorWrite = source.colorWrite; + translateOnAxis( axis, distance ) { - this.precision = source.precision; + // translate object by distance along axis in object space + // axis is assumed to be normalized - this.polygonOffset = source.polygonOffset; - this.polygonOffsetFactor = source.polygonOffsetFactor; - this.polygonOffsetUnits = source.polygonOffsetUnits; + _v1$4.copy( axis ).applyQuaternion( this.quaternion ); - this.dithering = source.dithering; + this.position.add( _v1$4.multiplyScalar( distance ) ); - this.alphaTest = source.alphaTest; + return this; - this.premultipliedAlpha = source.premultipliedAlpha; + } - this.overdraw = source.overdraw; + translateX( distance ) { - this.visible = source.visible; - this.clipShadows = source.clipShadows; - this.clipIntersection = source.clipIntersection; + return this.translateOnAxis( _xAxis, distance ); - var srcPlanes = source.clippingPlanes, - dstPlanes = null; + } - if ( srcPlanes !== null ) { + translateY( distance ) { - var n = srcPlanes.length; - dstPlanes = new Array( n ); + return this.translateOnAxis( _yAxis, distance ); - for ( var i = 0; i !== n; ++ i ) - dstPlanes[ i ] = srcPlanes[ i ].clone(); + } - } + translateZ( distance ) { - this.clippingPlanes = dstPlanes; + return this.translateOnAxis( _zAxis, distance ); - return this; + } - }, + localToWorld( vector ) { - dispose: function () { + this.updateWorldMatrix( true, false ); - this.dispatchEvent( { type: 'dispose' } ); + return vector.applyMatrix4( this.matrixWorld ); } - } ); + worldToLocal( vector ) { - /** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * defines: { "label" : "value" }, - * uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } }, - * - * fragmentShader: , - * vertexShader: , - * - * wireframe: , - * wireframeLinewidth: , - * - * lights: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ + this.updateWorldMatrix( true, false ); - function ShaderMaterial( parameters ) { + return vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() ); - Material.call( this ); + } - this.type = 'ShaderMaterial'; + lookAt( x, y, z ) { - this.defines = {}; - this.uniforms = {}; + // This method does not support objects having non-uniformly-scaled parent(s) - this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'; - this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'; + if ( x.isVector3 ) { - this.linewidth = 1; + _target.copy( x ); - this.wireframe = false; - this.wireframeLinewidth = 1; + } else { - this.fog = false; // set to use scene fog - this.lights = false; // set to use scene lights - this.clipping = false; // set to use user-defined clipping planes + _target.set( x, y, z ); - this.skinning = false; // set to use skinning attribute streams - this.morphTargets = false; // set to use morph targets - this.morphNormals = false; // set to use morph normals + } - this.extensions = { - derivatives: false, // set to use derivatives - fragDepth: false, // set to use fragment depth values - drawBuffers: false, // set to use draw buffers - shaderTextureLOD: false // set to use shader texture LOD - }; + const parent = this.parent; - // When rendered geometry doesn't include these attributes but the material does, - // use these default values in WebGL. This avoids errors when buffer data is missing. - this.defaultAttributeValues = { - 'color': [ 1, 1, 1 ], - 'uv': [ 0, 0 ], - 'uv2': [ 0, 0 ] - }; + this.updateWorldMatrix( true, false ); - this.index0AttributeName = undefined; + _position$3.setFromMatrixPosition( this.matrixWorld ); - if ( parameters !== undefined ) { + if ( this.isCamera || this.isLight ) { - if ( parameters.attributes !== undefined ) { + _m1$1.lookAt( _position$3, _target, this.up ); - console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' ); + } else { - } + _m1$1.lookAt( _target, _position$3, this.up ); - this.setValues( parameters ); + } - } + this.quaternion.setFromRotationMatrix( _m1$1 ); - } + if ( parent ) { - ShaderMaterial.prototype = Object.create( Material.prototype ); - ShaderMaterial.prototype.constructor = ShaderMaterial; + _m1$1.extractRotation( parent.matrixWorld ); + _q1.setFromRotationMatrix( _m1$1 ); + this.quaternion.premultiply( _q1.invert() ); - ShaderMaterial.prototype.isShaderMaterial = true; + } - ShaderMaterial.prototype.copy = function ( source ) { + } - Material.prototype.copy.call( this, source ); + add( object ) { - this.fragmentShader = source.fragmentShader; - this.vertexShader = source.vertexShader; + if ( arguments.length > 1 ) { - this.uniforms = UniformsUtils.clone( source.uniforms ); + for ( let i = 0; i < arguments.length; i ++ ) { - this.defines = source.defines; + this.add( arguments[ i ] ); - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; + } - this.lights = source.lights; - this.clipping = source.clipping; + return this; - this.skinning = source.skinning; + } - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; + if ( object === this ) { - this.extensions = source.extensions; + console.error( 'THREE.Object3D.add: object can\'t be added as a child of itself.', object ); + return this; - return this; + } - }; + if ( object && object.isObject3D ) { - ShaderMaterial.prototype.toJSON = function ( meta ) { + if ( object.parent !== null ) { - var data = Material.prototype.toJSON.call( this, meta ); + object.parent.remove( object ); - data.uniforms = this.uniforms; - data.vertexShader = this.vertexShader; - data.fragmentShader = this.fragmentShader; + } - return data; + object.parent = this; + this.children.push( object ); - }; + object.dispatchEvent( _addedEvent ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author bhouston / https://clara.io - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * - * opacity: , - * - * map: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * wireframe: , - * wireframeLinewidth: - * } - */ + } else { - function MeshDepthMaterial( parameters ) { + console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object ); - Material.call( this ); + } - this.type = 'MeshDepthMaterial'; + return this; - this.depthPacking = BasicDepthPacking; + } - this.skinning = false; - this.morphTargets = false; + remove( object ) { - this.map = null; + if ( arguments.length > 1 ) { - this.alphaMap = null; + for ( let i = 0; i < arguments.length; i ++ ) { - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; + this.remove( arguments[ i ] ); - this.wireframe = false; - this.wireframeLinewidth = 1; + } - this.fog = false; - this.lights = false; + return this; - this.setValues( parameters ); + } - } + const index = this.children.indexOf( object ); - MeshDepthMaterial.prototype = Object.create( Material.prototype ); - MeshDepthMaterial.prototype.constructor = MeshDepthMaterial; + if ( index !== - 1 ) { - MeshDepthMaterial.prototype.isMeshDepthMaterial = true; + object.parent = null; + this.children.splice( index, 1 ); - MeshDepthMaterial.prototype.copy = function ( source ) { + object.dispatchEvent( _removedEvent ); - Material.prototype.copy.call( this, source ); + } - this.depthPacking = source.depthPacking; + return this; - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; + } - this.map = source.map; + removeFromParent() { - this.alphaMap = source.alphaMap; + const parent = this.parent; - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; + if ( parent !== null ) { - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; + parent.remove( this ); - return this; + } - }; + return this; - /** - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - */ + } - function Box3( min, max ) { + clear() { - this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); + for ( let i = 0; i < this.children.length; i ++ ) { - } + const object = this.children[ i ]; - Object.assign( Box3.prototype, { + object.parent = null; - isBox3: true, + object.dispatchEvent( _removedEvent ); - set: function ( min, max ) { + } - this.min.copy( min ); - this.max.copy( max ); + this.children.length = 0; return this; - }, - setFromArray: function ( array ) { + } + + attach( object ) { + + // adds object as a child of this, while maintaining the object's world transform - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; + // Note: This method does not support scene graphs having non-uniformly-scaled nodes(s) - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; + this.updateWorldMatrix( true, false ); - for ( var i = 0, l = array.length; i < l; i += 3 ) { + _m1$1.copy( this.matrixWorld ).invert(); - var x = array[ i ]; - var y = array[ i + 1 ]; - var z = array[ i + 2 ]; + if ( object.parent !== null ) { - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; + object.parent.updateWorldMatrix( true, false ); - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; + _m1$1.multiply( object.parent.matrixWorld ); } - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + object.applyMatrix4( _m1$1 ); - return this; + this.add( object ); - }, + object.updateWorldMatrix( false, true ); - setFromBufferAttribute: function ( attribute ) { + return this; - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; + } - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; + getObjectById( id ) { - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + return this.getObjectByProperty( 'id', id ); - var x = attribute.getX( i ); - var y = attribute.getY( i ); - var z = attribute.getZ( i ); + } - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; + getObjectByName( name ) { - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; + return this.getObjectByProperty( 'name', name ); - } + } - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + getObjectByProperty( name, value ) { - return this; + if ( this[ name ] === value ) return this; - }, + for ( let i = 0, l = this.children.length; i < l; i ++ ) { - setFromPoints: function ( points ) { + const child = this.children[ i ]; + const object = child.getObjectByProperty( name, value ); - this.makeEmpty(); + if ( object !== undefined ) { - for ( var i = 0, il = points.length; i < il; i ++ ) { + return object; - this.expandByPoint( points[ i ] ); + } } - return this; + return undefined; - }, + } - setFromCenterAndSize: function () { + getObjectsByProperty( name, value ) { - var v1 = new Vector3(); + let result = []; - return function setFromCenterAndSize( center, size ) { + if ( this[ name ] === value ) result.push( this ); - var halfSize = v1.copy( size ).multiplyScalar( 0.5 ); + for ( let i = 0, l = this.children.length; i < l; i ++ ) { - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); + const childResult = this.children[ i ].getObjectsByProperty( name, value ); - return this; + if ( childResult.length > 0 ) { - }; + result = result.concat( childResult ); - }(), + } - setFromObject: function ( object ) { + } - this.makeEmpty(); + return result; - return this.expandByObject( object ); + } - }, + getWorldPosition( target ) { - clone: function () { + this.updateWorldMatrix( true, false ); - return new this.constructor().copy( this ); + return target.setFromMatrixPosition( this.matrixWorld ); - }, + } - copy: function ( box ) { + getWorldQuaternion( target ) { - this.min.copy( box.min ); - this.max.copy( box.max ); + this.updateWorldMatrix( true, false ); - return this; + this.matrixWorld.decompose( _position$3, target, _scale$2 ); - }, + return target; - makeEmpty: function () { + } - this.min.x = this.min.y = this.min.z = + Infinity; - this.max.x = this.max.y = this.max.z = - Infinity; + getWorldScale( target ) { - return this; + this.updateWorldMatrix( true, false ); - }, + this.matrixWorld.decompose( _position$3, _quaternion$2, target ); - isEmpty: function () { + return target; - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + } - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); + getWorldDirection( target ) { - }, + this.updateWorldMatrix( true, false ); - getCenter: function ( optionalTarget ) { + const e = this.matrixWorld.elements; - var result = optionalTarget || new Vector3(); - return this.isEmpty() ? result.set( 0, 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); - }, + } - getSize: function ( optionalTarget ) { + raycast( /* raycaster, intersects */ ) {} - var result = optionalTarget || new Vector3(); - return this.isEmpty() ? result.set( 0, 0, 0 ) : result.subVectors( this.max, this.min ); + traverse( callback ) { - }, + callback( this ); - expandByPoint: function ( point ) { + const children = this.children; - this.min.min( point ); - this.max.max( point ); + for ( let i = 0, l = children.length; i < l; i ++ ) { - return this; + children[ i ].traverse( callback ); - }, + } - expandByVector: function ( vector ) { + } - this.min.sub( vector ); - this.max.add( vector ); + traverseVisible( callback ) { - return this; + if ( this.visible === false ) return; - }, + callback( this ); - expandByScalar: function ( scalar ) { + const children = this.children; - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); + for ( let i = 0, l = children.length; i < l; i ++ ) { - return this; + children[ i ].traverseVisible( callback ); - }, - - expandByObject: function () { - - // Computes the world-axis-aligned bounding box of an object (including its children), - // accounting for both the object's, and children's, world transforms - - var v1 = new Vector3(); + } - return function expandByObject( object ) { + } - var scope = this; + traverseAncestors( callback ) { - object.updateMatrixWorld( true ); + const parent = this.parent; - object.traverse( function ( node ) { + if ( parent !== null ) { - var i, l; + callback( parent ); - var geometry = node.geometry; + parent.traverseAncestors( callback ); - if ( geometry !== undefined ) { + } - if ( geometry.isGeometry ) { + } - var vertices = geometry.vertices; + updateMatrix() { - for ( i = 0, l = vertices.length; i < l; i ++ ) { + this.matrix.compose( this.position, this.quaternion, this.scale ); - v1.copy( vertices[ i ] ); - v1.applyMatrix4( node.matrixWorld ); + this.matrixWorldNeedsUpdate = true; - scope.expandByPoint( v1 ); + } - } + updateMatrixWorld( force ) { - } else if ( geometry.isBufferGeometry ) { + if ( this.matrixAutoUpdate ) this.updateMatrix(); - var attribute = geometry.attributes.position; + if ( this.matrixWorldNeedsUpdate || force ) { - if ( attribute !== undefined ) { + if ( this.parent === null ) { - for ( i = 0, l = attribute.count; i < l; i ++ ) { + this.matrixWorld.copy( this.matrix ); - v1.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld ); + } else { - scope.expandByPoint( v1 ); + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - } + } - } + this.matrixWorldNeedsUpdate = false; - } + force = true; - } + } - } ); + // update children - return this; + const children = this.children; - }; + for ( let i = 0, l = children.length; i < l; i ++ ) { - }(), + const child = children[ i ]; - containsPoint: function ( point ) { + if ( child.matrixWorldAutoUpdate === true || force === true ) { - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y || - point.z < this.min.z || point.z > this.max.z ? false : true; + child.updateMatrixWorld( force ); - }, + } - containsBox: function ( box ) { + } - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y && - this.min.z <= box.min.z && box.max.z <= this.max.z; + } - }, + updateWorldMatrix( updateParents, updateChildren ) { - getParameter: function ( point, optionalTarget ) { + const parent = this.parent; - // This can potentially have a divide by zero if the box - // has a size dimension of 0. + if ( updateParents === true && parent !== null && parent.matrixWorldAutoUpdate === true ) { - var result = optionalTarget || new Vector3(); + parent.updateWorldMatrix( true, false ); - return result.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ), - ( point.z - this.min.z ) / ( this.max.z - this.min.z ) - ); + } - }, + if ( this.matrixAutoUpdate ) this.updateMatrix(); - intersectsBox: function ( box ) { + if ( this.parent === null ) { - // using 6 splitting planes to rule out intersections. - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y || - box.max.z < this.min.z || box.min.z > this.max.z ? false : true; + this.matrixWorld.copy( this.matrix ); - }, + } else { - intersectsSphere: ( function () { + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - var closestPoint = new Vector3(); + } - return function intersectsSphere( sphere ) { + // update children - // Find the point on the AABB closest to the sphere center. - this.clampPoint( sphere.center, closestPoint ); + if ( updateChildren === true ) { - // If that point is inside the sphere, the AABB and sphere intersect. - return closestPoint.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); + const children = this.children; - }; + for ( let i = 0, l = children.length; i < l; i ++ ) { - } )(), + const child = children[ i ]; - intersectsPlane: function ( plane ) { + if ( child.matrixWorldAutoUpdate === true ) { - // We compute the minimum and maximum dot product values. If those values - // are on the same side (back or front) of the plane, then there is no intersection. + child.updateWorldMatrix( false, true ); - var min, max; + } - if ( plane.normal.x > 0 ) { + } - min = plane.normal.x * this.min.x; - max = plane.normal.x * this.max.x; + } - } else { + } - min = plane.normal.x * this.max.x; - max = plane.normal.x * this.min.x; + toJSON( meta ) { - } + // meta is a string when called from JSON.stringify + const isRootObject = ( meta === undefined || typeof meta === 'string' ); - if ( plane.normal.y > 0 ) { + const output = {}; - min += plane.normal.y * this.min.y; - max += plane.normal.y * this.max.y; + // meta is a hash used to collect geometries, materials. + // not providing it implies that this is the root object + // being serialized. + if ( isRootObject ) { - } else { + // initialize meta obj + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {}, + shapes: {}, + skeletons: {}, + animations: {}, + nodes: {} + }; - min += plane.normal.y * this.max.y; - max += plane.normal.y * this.min.y; + output.metadata = { + version: 4.6, + type: 'Object', + generator: 'Object3D.toJSON' + }; } - if ( plane.normal.z > 0 ) { - - min += plane.normal.z * this.min.z; - max += plane.normal.z * this.max.z; + // standard Object3D serialization - } else { + const object = {}; - min += plane.normal.z * this.max.z; - max += plane.normal.z * this.min.z; + object.uuid = this.uuid; + object.type = this.type; - } + if ( this.name !== '' ) object.name = this.name; + if ( this.castShadow === true ) object.castShadow = true; + if ( this.receiveShadow === true ) object.receiveShadow = true; + if ( this.visible === false ) object.visible = false; + if ( this.frustumCulled === false ) object.frustumCulled = false; + if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder; + if ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData; - return ( min <= plane.constant && max >= plane.constant ); + object.layers = this.layers.mask; + object.matrix = this.matrix.toArray(); + object.up = this.up.toArray(); - }, + if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false; - clampPoint: function ( point, optionalTarget ) { + // object specific properties - var result = optionalTarget || new Vector3(); - return result.copy( point ).clamp( this.min, this.max ); + if ( this.isInstancedMesh ) { - }, + object.type = 'InstancedMesh'; + object.count = this.count; + object.instanceMatrix = this.instanceMatrix.toJSON(); + if ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON(); - distanceToPoint: function () { + } - var v1 = new Vector3(); + // - return function distanceToPoint( point ) { + function serialize( library, element ) { - var clampedPoint = v1.copy( point ).clamp( this.min, this.max ); - return clampedPoint.sub( point ).length(); + if ( library[ element.uuid ] === undefined ) { - }; + library[ element.uuid ] = element.toJSON( meta ); - }(), + } - getBoundingSphere: function () { + return element.uuid; - var v1 = new Vector3(); + } - return function getBoundingSphere( optionalTarget ) { + if ( this.isScene ) { - var result = optionalTarget || new Sphere(); + if ( this.background ) { - this.getCenter( result.center ); + if ( this.background.isColor ) { - result.radius = this.getSize( v1 ).length() * 0.5; + object.background = this.background.toJSON(); - return result; + } else if ( this.background.isTexture ) { - }; + object.background = this.background.toJSON( meta ).uuid; - }(), + } - intersect: function ( box ) { + } - this.min.max( box.min ); - this.max.min( box.max ); + if ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) { - // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. - if( this.isEmpty() ) this.makeEmpty(); + object.environment = this.environment.toJSON( meta ).uuid; - return this; + } - }, + } else if ( this.isMesh || this.isLine || this.isPoints ) { - union: function ( box ) { + object.geometry = serialize( meta.geometries, this.geometry ); - this.min.min( box.min ); - this.max.max( box.max ); + const parameters = this.geometry.parameters; - return this; + if ( parameters !== undefined && parameters.shapes !== undefined ) { - }, + const shapes = parameters.shapes; - applyMatrix4: function () { - - var points = [ - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3() - ]; + if ( Array.isArray( shapes ) ) { - return function applyMatrix4( matrix ) { + for ( let i = 0, l = shapes.length; i < l; i ++ ) { - // transform of empty box is an empty box. - if( this.isEmpty() ) return this; + const shape = shapes[ i ]; - // NOTE: I am using a binary pattern to specify all 2^3 combinations below - points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 - points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 - points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 - points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 - points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 - points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 - points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 - points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 + serialize( meta.shapes, shape ); - this.setFromPoints( points ); + } - return this; + } else { - }; + serialize( meta.shapes, shapes ); - }(), + } - translate: function ( offset ) { + } - this.min.add( offset ); - this.max.add( offset ); + } - return this; + if ( this.isSkinnedMesh ) { - }, + object.bindMode = this.bindMode; + object.bindMatrix = this.bindMatrix.toArray(); - equals: function ( box ) { + if ( this.skeleton !== undefined ) { - return box.min.equals( this.min ) && box.max.equals( this.max ); + serialize( meta.skeletons, this.skeleton ); - } + object.skeleton = this.skeleton.uuid; - } ); + } - /** - * @author bhouston / http://clara.io - * @author mrdoob / http://mrdoob.com/ - */ + } - function Sphere( center, radius ) { + if ( this.material !== undefined ) { - this.center = ( center !== undefined ) ? center : new Vector3(); - this.radius = ( radius !== undefined ) ? radius : 0; + if ( Array.isArray( this.material ) ) { - } + const uuids = []; - Object.assign( Sphere.prototype, { + for ( let i = 0, l = this.material.length; i < l; i ++ ) { - set: function ( center, radius ) { + uuids.push( serialize( meta.materials, this.material[ i ] ) ); - this.center.copy( center ); - this.radius = radius; + } - return this; + object.material = uuids; - }, + } else { - setFromPoints: function () { + object.material = serialize( meta.materials, this.material ); - var box = new Box3(); + } - return function setFromPoints( points, optionalCenter ) { + } - var center = this.center; + // - if ( optionalCenter !== undefined ) { + if ( this.children.length > 0 ) { - center.copy( optionalCenter ); + object.children = []; - } else { + for ( let i = 0; i < this.children.length; i ++ ) { - box.setFromPoints( points ).getCenter( center ); + object.children.push( this.children[ i ].toJSON( meta ).object ); } - var maxRadiusSq = 0; + } - for ( var i = 0, il = points.length; i < il; i ++ ) { + // - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + if ( this.animations.length > 0 ) { - } + object.animations = []; - this.radius = Math.sqrt( maxRadiusSq ); + for ( let i = 0; i < this.animations.length; i ++ ) { - return this; + const animation = this.animations[ i ]; - }; + object.animations.push( serialize( meta.animations, animation ) ); - }(), + } - clone: function () { + } - return new this.constructor().copy( this ); + if ( isRootObject ) { - }, + const geometries = extractFromCache( meta.geometries ); + const materials = extractFromCache( meta.materials ); + const textures = extractFromCache( meta.textures ); + const images = extractFromCache( meta.images ); + const shapes = extractFromCache( meta.shapes ); + const skeletons = extractFromCache( meta.skeletons ); + const animations = extractFromCache( meta.animations ); + const nodes = extractFromCache( meta.nodes ); - copy: function ( sphere ) { + if ( geometries.length > 0 ) output.geometries = geometries; + if ( materials.length > 0 ) output.materials = materials; + if ( textures.length > 0 ) output.textures = textures; + if ( images.length > 0 ) output.images = images; + if ( shapes.length > 0 ) output.shapes = shapes; + if ( skeletons.length > 0 ) output.skeletons = skeletons; + if ( animations.length > 0 ) output.animations = animations; + if ( nodes.length > 0 ) output.nodes = nodes; - this.center.copy( sphere.center ); - this.radius = sphere.radius; + } - return this; + output.object = object; - }, + return output; - empty: function () { + // extract data from the cache hash + // remove metadata on each item + // and return as array + function extractFromCache( cache ) { - return ( this.radius <= 0 ); + const values = []; + for ( const key in cache ) { - }, + const data = cache[ key ]; + delete data.metadata; + values.push( data ); - containsPoint: function ( point ) { + } - return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); + return values; - }, + } - distanceToPoint: function ( point ) { + } - return ( point.distanceTo( this.center ) - this.radius ); + clone( recursive ) { - }, + return new this.constructor().copy( this, recursive ); - intersectsSphere: function ( sphere ) { + } - var radiusSum = this.radius + sphere.radius; + copy( source, recursive = true ) { - return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); + this.name = source.name; - }, + this.up.copy( source.up ); - intersectsBox: function ( box ) { + this.position.copy( source.position ); + this.rotation.order = source.rotation.order; + this.quaternion.copy( source.quaternion ); + this.scale.copy( source.scale ); - return box.intersectsSphere( this ); + this.matrix.copy( source.matrix ); + this.matrixWorld.copy( source.matrixWorld ); - }, + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - intersectsPlane: function ( plane ) { + this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate; - // We use the following equation to compute the signed distance from - // the center of the sphere to the plane. - // - // distance = q * n - d - // - // If this distance is greater than the radius of the sphere, - // then there is no intersection. + this.layers.mask = source.layers.mask; + this.visible = source.visible; - return Math.abs( this.center.dot( plane.normal ) - plane.constant ) <= this.radius; + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; - }, + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; - clampPoint: function ( point, optionalTarget ) { + this.animations = source.animations; - var deltaLengthSq = this.center.distanceToSquared( point ); + this.userData = JSON.parse( JSON.stringify( source.userData ) ); - var result = optionalTarget || new Vector3(); + if ( recursive === true ) { - result.copy( point ); + for ( let i = 0; i < source.children.length; i ++ ) { - if ( deltaLengthSq > ( this.radius * this.radius ) ) { + const child = source.children[ i ]; + this.add( child.clone() ); - result.sub( this.center ).normalize(); - result.multiplyScalar( this.radius ).add( this.center ); + } } - return result; + return this; - }, + } - getBoundingBox: function ( optionalTarget ) { + } - var box = optionalTarget || new Box3(); + Object3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 ); + Object3D.DEFAULT_MATRIX_AUTO_UPDATE = true; + Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true; - box.set( this.center, this.center ); - box.expandByScalar( this.radius ); + const _v0$1 = /*@__PURE__*/ new Vector3(); + const _v1$3 = /*@__PURE__*/ new Vector3(); + const _v2$2 = /*@__PURE__*/ new Vector3(); + const _v3$1 = /*@__PURE__*/ new Vector3(); - return box; + const _vab = /*@__PURE__*/ new Vector3(); + const _vac = /*@__PURE__*/ new Vector3(); + const _vbc = /*@__PURE__*/ new Vector3(); + const _vap = /*@__PURE__*/ new Vector3(); + const _vbp = /*@__PURE__*/ new Vector3(); + const _vcp = /*@__PURE__*/ new Vector3(); - }, + let warnedGetUV = false; - applyMatrix4: function ( matrix ) { + class Triangle { - this.center.applyMatrix4( matrix ); - this.radius = this.radius * matrix.getMaxScaleOnAxis(); + constructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) { - return this; + this.a = a; + this.b = b; + this.c = c; - }, + } - translate: function ( offset ) { + static getNormal( a, b, c, target ) { - this.center.add( offset ); + target.subVectors( c, b ); + _v0$1.subVectors( a, b ); + target.cross( _v0$1 ); - return this; + const targetLengthSq = target.lengthSq(); + if ( targetLengthSq > 0 ) { - }, + return target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) ); - equals: function ( sphere ) { + } - return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); + return target.set( 0, 0, 0 ); } - } ); + // static/instance method to calculate barycentric coordinates + // based on: http://www.blackpawn.com/texts/pointinpoly/default.html + static getBarycoord( point, a, b, c, target ) { - /** - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - * @author tschw - */ + _v0$1.subVectors( c, a ); + _v1$3.subVectors( b, a ); + _v2$2.subVectors( point, a ); - function Matrix3() { + const dot00 = _v0$1.dot( _v0$1 ); + const dot01 = _v0$1.dot( _v1$3 ); + const dot02 = _v0$1.dot( _v2$2 ); + const dot11 = _v1$3.dot( _v1$3 ); + const dot12 = _v1$3.dot( _v2$2 ); - this.elements = [ + const denom = ( dot00 * dot11 - dot01 * dot01 ); - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 + // collinear or singular triangle + if ( denom === 0 ) { - ]; + // arbitrary location outside of triangle? + // not sure if this is the best idea, maybe should be returning undefined + return target.set( - 2, - 1, - 1 ); - if ( arguments.length > 0 ) { + } - console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); + const invDenom = 1 / denom; + const u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; + const v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; - } + // barycentric coordinates must always sum to 1 + return target.set( 1 - u - v, v, u ); - } + } - Object.assign( Matrix3.prototype, { + static containsPoint( point, a, b, c ) { - isMatrix3: true, + this.getBarycoord( point, a, b, c, _v3$1 ); - set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { + return ( _v3$1.x >= 0 ) && ( _v3$1.y >= 0 ) && ( ( _v3$1.x + _v3$1.y ) <= 1 ); - var te = this.elements; + } - te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; - te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; - te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; + static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) { // @deprecated, r151 - return this; + if ( warnedGetUV === false ) { - }, + console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); - identity: function () { + warnedGetUV = true; - this.set( + } - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 + return this.getInterpolation( point, p1, p2, p3, uv1, uv2, uv3, target ); - ); + } - return this; + static getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) { - }, + this.getBarycoord( point, p1, p2, p3, _v3$1 ); - clone: function () { + target.setScalar( 0 ); + target.addScaledVector( v1, _v3$1.x ); + target.addScaledVector( v2, _v3$1.y ); + target.addScaledVector( v3, _v3$1.z ); - return new this.constructor().fromArray( this.elements ); + return target; - }, + } - copy: function ( m ) { + static isFrontFacing( a, b, c, direction ) { - var te = this.elements; - var me = m.elements; + _v0$1.subVectors( c, b ); + _v1$3.subVectors( a, b ); - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; - te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; - te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; + // strictly front facing + return ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false; - return this; + } - }, + set( a, b, c ) { - setFromMatrix4: function ( m ) { + this.a.copy( a ); + this.b.copy( b ); + this.c.copy( c ); - var me = m.elements; + return this; - this.set( + } - me[ 0 ], me[ 4 ], me[ 8 ], - me[ 1 ], me[ 5 ], me[ 9 ], - me[ 2 ], me[ 6 ], me[ 10 ] + setFromPointsAndIndices( points, i0, i1, i2 ) { - ); + this.a.copy( points[ i0 ] ); + this.b.copy( points[ i1 ] ); + this.c.copy( points[ i2 ] ); return this; - }, - - applyToBufferAttribute: function () { + } - var v1 = new Vector3(); + setFromAttributeAndIndices( attribute, i0, i1, i2 ) { - return function applyToBufferAttribute( attribute ) { + this.a.fromBufferAttribute( attribute, i0 ); + this.b.fromBufferAttribute( attribute, i1 ); + this.c.fromBufferAttribute( attribute, i2 ); - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + return this; - v1.x = attribute.getX( i ); - v1.y = attribute.getY( i ); - v1.z = attribute.getZ( i ); + } - v1.applyMatrix3( this ); + clone() { - attribute.setXYZ( i, v1.x, v1.y, v1.z ); + return new this.constructor().copy( this ); - } + } - return attribute; + copy( triangle ) { - }; + this.a.copy( triangle.a ); + this.b.copy( triangle.b ); + this.c.copy( triangle.c ); - }(), + return this; - multiply: function ( m ) { + } - return this.multiplyMatrices( this, m ); + getArea() { - }, + _v0$1.subVectors( this.c, this.b ); + _v1$3.subVectors( this.a, this.b ); - premultiply: function ( m ) { + return _v0$1.cross( _v1$3 ).length() * 0.5; - return this.multiplyMatrices( m, this ); + } - }, + getMidpoint( target ) { - multiplyMatrices: function ( a, b ) { + return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); - var ae = a.elements; - var be = b.elements; - var te = this.elements; + } - var a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; - var a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; - var a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; + getNormal( target ) { - var b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; - var b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; - var b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; + return Triangle.getNormal( this.a, this.b, this.c, target ); - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; - te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; - te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; + } - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; - te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; - te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; + getPlane( target ) { - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; - te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; - te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; + return target.setFromCoplanarPoints( this.a, this.b, this.c ); - return this; + } - }, + getBarycoord( point, target ) { - multiplyScalar: function ( s ) { + return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); - var te = this.elements; + } - te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; - te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; - te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; + getUV( point, uv1, uv2, uv3, target ) { // @deprecated, r151 - return this; + if ( warnedGetUV === false ) { - }, + console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); - determinant: function () { + warnedGetUV = true; - var te = this.elements; + } - var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], - d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], - g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; + return Triangle.getInterpolation( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); - return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; + } - }, + getInterpolation( point, v1, v2, v3, target ) { - getInverse: function ( matrix, throwOnDegenerate ) { + return Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target ); - if ( matrix && matrix.isMatrix4 ) { + } - console.error( "THREE.Matrix3.getInverse no longer takes a Matrix4 argument." ); + containsPoint( point ) { - } + return Triangle.containsPoint( point, this.a, this.b, this.c ); - var me = matrix.elements, - te = this.elements, + } - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], - n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ], - n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ], + isFrontFacing( direction ) { - t11 = n33 * n22 - n32 * n23, - t12 = n32 * n13 - n33 * n12, - t13 = n23 * n12 - n22 * n13, + return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); - det = n11 * t11 + n21 * t12 + n31 * t13; + } - if ( det === 0 ) { + intersectsBox( box ) { - var msg = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"; + return box.intersectsTriangle( this ); - if ( throwOnDegenerate === true ) { + } - throw new Error( msg ); + closestPointToPoint( p, target ) { - } else { + const a = this.a, b = this.b, c = this.c; + let v, w; - console.warn( msg ); + // algorithm thanks to Real-Time Collision Detection by Christer Ericson, + // published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc., + // under the accompanying license; see chapter 5.1.5 for detailed explanation. + // basically, we're distinguishing which of the voronoi regions of the triangle + // the point lies in with the minimum amount of redundant computation. - } + _vab.subVectors( b, a ); + _vac.subVectors( c, a ); + _vap.subVectors( p, a ); + const d1 = _vab.dot( _vap ); + const d2 = _vac.dot( _vap ); + if ( d1 <= 0 && d2 <= 0 ) { - return this.identity(); + // vertex region of A; barycentric coords (1, 0, 0) + return target.copy( a ); } - var detInv = 1 / det; + _vbp.subVectors( p, b ); + const d3 = _vab.dot( _vbp ); + const d4 = _vac.dot( _vbp ); + if ( d3 >= 0 && d4 <= d3 ) { - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; - te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; + // vertex region of B; barycentric coords (0, 1, 0) + return target.copy( b ); - te[ 3 ] = t12 * detInv; - te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; - te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; + } - te[ 6 ] = t13 * detInv; - te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; - te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; + const vc = d1 * d4 - d3 * d2; + if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) { - return this; + v = d1 / ( d1 - d3 ); + // edge region of AB; barycentric coords (1-v, v, 0) + return target.copy( a ).addScaledVector( _vab, v ); - }, + } - transpose: function () { + _vcp.subVectors( p, c ); + const d5 = _vab.dot( _vcp ); + const d6 = _vac.dot( _vcp ); + if ( d6 >= 0 && d5 <= d6 ) { - var tmp, m = this.elements; + // vertex region of C; barycentric coords (0, 0, 1) + return target.copy( c ); - tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; - tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; - tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; + } - return this; + const vb = d5 * d2 - d1 * d6; + if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) { - }, + w = d2 / ( d2 - d6 ); + // edge region of AC; barycentric coords (1-w, 0, w) + return target.copy( a ).addScaledVector( _vac, w ); - getNormalMatrix: function ( matrix4 ) { + } - return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); + const va = d3 * d6 - d5 * d4; + if ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) { - }, + _vbc.subVectors( c, b ); + w = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) ); + // edge region of BC; barycentric coords (0, 1-w, w) + return target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC - transposeIntoArray: function ( r ) { + } - var m = this.elements; + // face region + const denom = 1 / ( va + vb + vc ); + // u = va * denom + v = vb * denom; + w = vc * denom; - r[ 0 ] = m[ 0 ]; - r[ 1 ] = m[ 3 ]; - r[ 2 ] = m[ 6 ]; - r[ 3 ] = m[ 1 ]; - r[ 4 ] = m[ 4 ]; - r[ 5 ] = m[ 7 ]; - r[ 6 ] = m[ 2 ]; - r[ 7 ] = m[ 5 ]; - r[ 8 ] = m[ 8 ]; + return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); - return this; + } - }, + equals( triangle ) { - equals: function ( matrix ) { + return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); - var te = this.elements; - var me = matrix.elements; + } - for ( var i = 0; i < 9; i ++ ) { + } - if ( te[ i ] !== me[ i ] ) return false; + let materialId = 0; - } + class Material extends EventDispatcher { - return true; + constructor() { - }, + super(); - fromArray: function ( array, offset ) { + this.isMaterial = true; - if ( offset === undefined ) offset = 0; + Object.defineProperty( this, 'id', { value: materialId ++ } ); - for ( var i = 0; i < 9; i ++ ) { + this.uuid = generateUUID(); - this.elements[ i ] = array[ i + offset ]; + this.name = ''; + this.type = 'Material'; - } + this.blending = NormalBlending; + this.side = FrontSide; + this.vertexColors = false; - return this; + this.opacity = 1; + this.transparent = false; - }, + this.blendSrc = SrcAlphaFactor; + this.blendDst = OneMinusSrcAlphaFactor; + this.blendEquation = AddEquation; + this.blendSrcAlpha = null; + this.blendDstAlpha = null; + this.blendEquationAlpha = null; - toArray: function ( array, offset ) { + this.depthFunc = LessEqualDepth; + this.depthTest = true; + this.depthWrite = true; - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + this.stencilWriteMask = 0xff; + this.stencilFunc = AlwaysStencilFunc; + this.stencilRef = 0; + this.stencilFuncMask = 0xff; + this.stencilFail = KeepStencilOp; + this.stencilZFail = KeepStencilOp; + this.stencilZPass = KeepStencilOp; + this.stencilWrite = false; - var te = this.elements; + this.clippingPlanes = null; + this.clipIntersection = false; + this.clipShadows = false; - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; + this.shadowSide = null; - array[ offset + 3 ] = te[ 3 ]; - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; + this.colorWrite = true; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; - array[ offset + 8 ] = te[ 8 ]; + this.precision = null; // override the renderer's default precision for this material - return array; + this.polygonOffset = false; + this.polygonOffsetFactor = 0; + this.polygonOffsetUnits = 0; - } + this.dithering = false; - } ); + this.alphaToCoverage = false; + this.premultipliedAlpha = false; + this.forceSinglePass = false; - /** - * @author bhouston / http://clara.io - */ + this.visible = true; - function Plane( normal, constant ) { + this.toneMapped = true; - this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); - this.constant = ( constant !== undefined ) ? constant : 0; + this.userData = {}; - } + this.version = 0; - Object.assign( Plane.prototype, { + this._alphaTest = 0; - set: function ( normal, constant ) { + } - this.normal.copy( normal ); - this.constant = constant; + get alphaTest() { - return this; + return this._alphaTest; - }, + } - setComponents: function ( x, y, z, w ) { + set alphaTest( value ) { - this.normal.set( x, y, z ); - this.constant = w; + if ( this._alphaTest > 0 !== value > 0 ) { - return this; + this.version ++; - }, + } - setFromNormalAndCoplanarPoint: function ( normal, point ) { + this._alphaTest = value; - this.normal.copy( normal ); - this.constant = - point.dot( this.normal ); // must be this.normal, not normal, as this.normal is normalized + } - return this; + onBuild( /* shaderobject, renderer */ ) {} - }, + onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {} - setFromCoplanarPoints: function () { + onBeforeCompile( /* shaderobject, renderer */ ) {} - var v1 = new Vector3(); - var v2 = new Vector3(); + customProgramCacheKey() { - return function setFromCoplanarPoints( a, b, c ) { + return this.onBeforeCompile.toString(); - var normal = v1.subVectors( c, b ).cross( v2.subVectors( a, b ) ).normalize(); + } - // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? + setValues( values ) { - this.setFromNormalAndCoplanarPoint( normal, a ); + if ( values === undefined ) return; - return this; + for ( const key in values ) { - }; + const newValue = values[ key ]; - }(), + if ( newValue === undefined ) { - clone: function () { + console.warn( `THREE.Material: parameter '${ key }' has value of undefined.` ); + continue; - return new this.constructor().copy( this ); + } - }, + const currentValue = this[ key ]; - copy: function ( plane ) { + if ( currentValue === undefined ) { - this.normal.copy( plane.normal ); - this.constant = plane.constant; + console.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` ); + continue; - return this; + } - }, + if ( currentValue && currentValue.isColor ) { - normalize: function () { + currentValue.set( newValue ); - // Note: will lead to a divide by zero if the plane is invalid. + } else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) { - var inverseNormalLength = 1.0 / this.normal.length(); - this.normal.multiplyScalar( inverseNormalLength ); - this.constant *= inverseNormalLength; + currentValue.copy( newValue ); - return this; + } else { - }, + this[ key ] = newValue; - negate: function () { + } - this.constant *= - 1; - this.normal.negate(); + } - return this; + } - }, + toJSON( meta ) { - distanceToPoint: function ( point ) { + const isRootObject = ( meta === undefined || typeof meta === 'string' ); - return this.normal.dot( point ) + this.constant; + if ( isRootObject ) { - }, + meta = { + textures: {}, + images: {} + }; - distanceToSphere: function ( sphere ) { + } - return this.distanceToPoint( sphere.center ) - sphere.radius; + const data = { + metadata: { + version: 4.6, + type: 'Material', + generator: 'Material.toJSON' + } + }; - }, + // standard Material serialization + data.uuid = this.uuid; + data.type = this.type; - projectPoint: function ( point, optionalTarget ) { + if ( this.name !== '' ) data.name = this.name; - return this.orthoPoint( point, optionalTarget ).sub( point ).negate(); + if ( this.color && this.color.isColor ) data.color = this.color.getHex(); - }, + if ( this.roughness !== undefined ) data.roughness = this.roughness; + if ( this.metalness !== undefined ) data.metalness = this.metalness; - orthoPoint: function ( point, optionalTarget ) { + if ( this.sheen !== undefined ) data.sheen = this.sheen; + if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex(); + if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness; + if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex(); + if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity; - var perpendicularMagnitude = this.distanceToPoint( point ); + if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex(); + if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity; + if ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex(); + if ( this.shininess !== undefined ) data.shininess = this.shininess; + if ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat; + if ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness; - var result = optionalTarget || new Vector3(); - return result.copy( this.normal ).multiplyScalar( perpendicularMagnitude ); + if ( this.clearcoatMap && this.clearcoatMap.isTexture ) { - }, + data.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid; - intersectLine: function () { + } - var v1 = new Vector3(); + if ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) { - return function intersectLine( line, optionalTarget ) { + data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid; - var result = optionalTarget || new Vector3(); + } - var direction = line.delta( v1 ); + if ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) { - var denominator = this.normal.dot( direction ); + data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid; + data.clearcoatNormalScale = this.clearcoatNormalScale.toArray(); - if ( denominator === 0 ) { + } - // line is coplanar, return origin - if ( this.distanceToPoint( line.start ) === 0 ) { + if ( this.iridescence !== undefined ) data.iridescence = this.iridescence; + if ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR; + if ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange; - return result.copy( line.start ); + if ( this.iridescenceMap && this.iridescenceMap.isTexture ) { - } + data.iridescenceMap = this.iridescenceMap.toJSON( meta ).uuid; - // Unsure if this is the correct method to handle this case. - return undefined; + } - } + if ( this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture ) { - var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; + data.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON( meta ).uuid; - if ( t < 0 || t > 1 ) { + } - return undefined; + if ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy; + if ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation; - } + if ( this.anisotropyMap && this.anisotropyMap.isTexture ) { - return result.copy( direction ).multiplyScalar( t ).add( line.start ); + data.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid; - }; + } - }(), + if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid; + if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid; + if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid; - intersectsLine: function ( line ) { + if ( this.lightMap && this.lightMap.isTexture ) { - // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. + data.lightMap = this.lightMap.toJSON( meta ).uuid; + data.lightMapIntensity = this.lightMapIntensity; - var startSign = this.distanceToPoint( line.start ); - var endSign = this.distanceToPoint( line.end ); + } - return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); + if ( this.aoMap && this.aoMap.isTexture ) { - }, + data.aoMap = this.aoMap.toJSON( meta ).uuid; + data.aoMapIntensity = this.aoMapIntensity; - intersectsBox: function ( box ) { + } - return box.intersectsPlane( this ); - - }, + if ( this.bumpMap && this.bumpMap.isTexture ) { - intersectsSphere: function ( sphere ) { + data.bumpMap = this.bumpMap.toJSON( meta ).uuid; + data.bumpScale = this.bumpScale; - return sphere.intersectsPlane( this ); + } - }, + if ( this.normalMap && this.normalMap.isTexture ) { - coplanarPoint: function ( optionalTarget ) { + data.normalMap = this.normalMap.toJSON( meta ).uuid; + data.normalMapType = this.normalMapType; + data.normalScale = this.normalScale.toArray(); - var result = optionalTarget || new Vector3(); - return result.copy( this.normal ).multiplyScalar( - this.constant ); + } - }, + if ( this.displacementMap && this.displacementMap.isTexture ) { - applyMatrix4: function () { + data.displacementMap = this.displacementMap.toJSON( meta ).uuid; + data.displacementScale = this.displacementScale; + data.displacementBias = this.displacementBias; - var v1 = new Vector3(); - var m1 = new Matrix3(); + } - return function applyMatrix4( matrix, optionalNormalMatrix ) { + if ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid; + if ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid; - var referencePoint = this.coplanarPoint( v1 ).applyMatrix4( matrix ); + if ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid; + if ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid; + if ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid; + if ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid; - // transform normal based on theory here: - // http://www.songho.ca/opengl/gl_normaltransform.html - var normalMatrix = optionalNormalMatrix || m1.getNormalMatrix( matrix ); - var normal = this.normal.applyMatrix3( normalMatrix ).normalize(); + if ( this.envMap && this.envMap.isTexture ) { - // recalculate constant (like in setFromNormalAndCoplanarPoint) - this.constant = - referencePoint.dot( normal ); + data.envMap = this.envMap.toJSON( meta ).uuid; - return this; + if ( this.combine !== undefined ) data.combine = this.combine; - }; + } - }(), + if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity; + if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity; + if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio; - translate: function ( offset ) { + if ( this.gradientMap && this.gradientMap.isTexture ) { - this.constant = this.constant - offset.dot( this.normal ); + data.gradientMap = this.gradientMap.toJSON( meta ).uuid; - return this; + } - }, + if ( this.transmission !== undefined ) data.transmission = this.transmission; + if ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid; + if ( this.thickness !== undefined ) data.thickness = this.thickness; + if ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid; + if ( this.attenuationDistance !== undefined && this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance; + if ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex(); - equals: function ( plane ) { + if ( this.size !== undefined ) data.size = this.size; + if ( this.shadowSide !== null ) data.shadowSide = this.shadowSide; + if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation; - return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); + if ( this.blending !== NormalBlending ) data.blending = this.blending; + if ( this.side !== FrontSide ) data.side = this.side; + if ( this.vertexColors ) data.vertexColors = true; - } + if ( this.opacity < 1 ) data.opacity = this.opacity; + if ( this.transparent === true ) data.transparent = this.transparent; - } ); + data.depthFunc = this.depthFunc; + data.depthTest = this.depthTest; + data.depthWrite = this.depthWrite; + data.colorWrite = this.colorWrite; - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author bhouston / http://clara.io - */ + data.stencilWrite = this.stencilWrite; + data.stencilWriteMask = this.stencilWriteMask; + data.stencilFunc = this.stencilFunc; + data.stencilRef = this.stencilRef; + data.stencilFuncMask = this.stencilFuncMask; + data.stencilFail = this.stencilFail; + data.stencilZFail = this.stencilZFail; + data.stencilZPass = this.stencilZPass; - function Frustum( p0, p1, p2, p3, p4, p5 ) { + // rotation (SpriteMaterial) + if ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation; - this.planes = [ + if ( this.polygonOffset === true ) data.polygonOffset = true; + if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor; + if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits; - ( p0 !== undefined ) ? p0 : new Plane(), - ( p1 !== undefined ) ? p1 : new Plane(), - ( p2 !== undefined ) ? p2 : new Plane(), - ( p3 !== undefined ) ? p3 : new Plane(), - ( p4 !== undefined ) ? p4 : new Plane(), - ( p5 !== undefined ) ? p5 : new Plane() + if ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth; + if ( this.dashSize !== undefined ) data.dashSize = this.dashSize; + if ( this.gapSize !== undefined ) data.gapSize = this.gapSize; + if ( this.scale !== undefined ) data.scale = this.scale; - ]; + if ( this.dithering === true ) data.dithering = true; - } + if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; + if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage; + if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; + if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass; - Object.assign( Frustum.prototype, { + if ( this.wireframe === true ) data.wireframe = this.wireframe; + if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth; + if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap; + if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; - set: function ( p0, p1, p2, p3, p4, p5 ) { + if ( this.flatShading === true ) data.flatShading = this.flatShading; - var planes = this.planes; + if ( this.visible === false ) data.visible = false; - planes[ 0 ].copy( p0 ); - planes[ 1 ].copy( p1 ); - planes[ 2 ].copy( p2 ); - planes[ 3 ].copy( p3 ); - planes[ 4 ].copy( p4 ); - planes[ 5 ].copy( p5 ); + if ( this.toneMapped === false ) data.toneMapped = false; - return this; + if ( this.fog === false ) data.fog = false; - }, + if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData; - clone: function () { + // TODO: Copied from Object3D.toJSON - return new this.constructor().copy( this ); + function extractFromCache( cache ) { - }, + const values = []; - copy: function ( frustum ) { + for ( const key in cache ) { - var planes = this.planes; + const data = cache[ key ]; + delete data.metadata; + values.push( data ); - for ( var i = 0; i < 6; i ++ ) { + } - planes[ i ].copy( frustum.planes[ i ] ); + return values; } - return this; + if ( isRootObject ) { - }, + const textures = extractFromCache( meta.textures ); + const images = extractFromCache( meta.images ); - setFromMatrix: function ( m ) { + if ( textures.length > 0 ) data.textures = textures; + if ( images.length > 0 ) data.images = images; - var planes = this.planes; - var me = m.elements; - var me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; - var me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; - var me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; - var me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; + } - planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); - planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); - planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); - planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); - planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + return data; - return this; + } - }, + clone() { - intersectsObject: function () { + return new this.constructor().copy( this ); - var sphere = new Sphere(); + } - return function intersectsObject( object ) { + copy( source ) { - var geometry = object.geometry; + this.name = source.name; - if ( geometry.boundingSphere === null ) - geometry.computeBoundingSphere(); + this.blending = source.blending; + this.side = source.side; + this.vertexColors = source.vertexColors; - sphere.copy( geometry.boundingSphere ) - .applyMatrix4( object.matrixWorld ); + this.opacity = source.opacity; + this.transparent = source.transparent; - return this.intersectsSphere( sphere ); + this.blendSrc = source.blendSrc; + this.blendDst = source.blendDst; + this.blendEquation = source.blendEquation; + this.blendSrcAlpha = source.blendSrcAlpha; + this.blendDstAlpha = source.blendDstAlpha; + this.blendEquationAlpha = source.blendEquationAlpha; - }; + this.depthFunc = source.depthFunc; + this.depthTest = source.depthTest; + this.depthWrite = source.depthWrite; - }(), + this.stencilWriteMask = source.stencilWriteMask; + this.stencilFunc = source.stencilFunc; + this.stencilRef = source.stencilRef; + this.stencilFuncMask = source.stencilFuncMask; + this.stencilFail = source.stencilFail; + this.stencilZFail = source.stencilZFail; + this.stencilZPass = source.stencilZPass; + this.stencilWrite = source.stencilWrite; - intersectsSprite: function () { + const srcPlanes = source.clippingPlanes; + let dstPlanes = null; - var sphere = new Sphere(); + if ( srcPlanes !== null ) { - return function intersectsSprite( sprite ) { + const n = srcPlanes.length; + dstPlanes = new Array( n ); - sphere.center.set( 0, 0, 0 ); - sphere.radius = 0.7071067811865476; - sphere.applyMatrix4( sprite.matrixWorld ); + for ( let i = 0; i !== n; ++ i ) { - return this.intersectsSphere( sphere ); + dstPlanes[ i ] = srcPlanes[ i ].clone(); - }; + } - }(), + } - intersectsSphere: function ( sphere ) { + this.clippingPlanes = dstPlanes; + this.clipIntersection = source.clipIntersection; + this.clipShadows = source.clipShadows; - var planes = this.planes; - var center = sphere.center; - var negRadius = - sphere.radius; + this.shadowSide = source.shadowSide; - for ( var i = 0; i < 6; i ++ ) { + this.colorWrite = source.colorWrite; - var distance = planes[ i ].distanceToPoint( center ); + this.precision = source.precision; - if ( distance < negRadius ) { + this.polygonOffset = source.polygonOffset; + this.polygonOffsetFactor = source.polygonOffsetFactor; + this.polygonOffsetUnits = source.polygonOffsetUnits; - return false; + this.dithering = source.dithering; - } + this.alphaTest = source.alphaTest; + this.alphaToCoverage = source.alphaToCoverage; + this.premultipliedAlpha = source.premultipliedAlpha; + this.forceSinglePass = source.forceSinglePass; - } + this.visible = source.visible; - return true; + this.toneMapped = source.toneMapped; - }, + this.userData = JSON.parse( JSON.stringify( source.userData ) ); - intersectsBox: function () { + return this; - var p1 = new Vector3(), - p2 = new Vector3(); + } - return function intersectsBox( box ) { + dispose() { - var planes = this.planes; + this.dispatchEvent( { type: 'dispose' } ); - for ( var i = 0; i < 6; i ++ ) { + } - var plane = planes[ i ]; + set needsUpdate( value ) { - p1.x = plane.normal.x > 0 ? box.min.x : box.max.x; - p2.x = plane.normal.x > 0 ? box.max.x : box.min.x; - p1.y = plane.normal.y > 0 ? box.min.y : box.max.y; - p2.y = plane.normal.y > 0 ? box.max.y : box.min.y; - p1.z = plane.normal.z > 0 ? box.min.z : box.max.z; - p2.z = plane.normal.z > 0 ? box.max.z : box.min.z; + if ( value === true ) this.version ++; - var d1 = plane.distanceToPoint( p1 ); - var d2 = plane.distanceToPoint( p2 ); + } - // if both outside plane, no intersection + } - if ( d1 < 0 && d2 < 0 ) { + const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, + 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, + 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50, + 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B, + 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B, + 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F, + 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3, + 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222, + 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700, + 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4, + 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00, + 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3, + 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA, + 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32, + 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3, + 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC, + 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD, + 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6, + 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9, + 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F, + 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE, + 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA, + 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0, + 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 }; - return false; + const _hslA = { h: 0, s: 0, l: 0 }; + const _hslB = { h: 0, s: 0, l: 0 }; - } + function hue2rgb( p, q, t ) { - } + if ( t < 0 ) t += 1; + if ( t > 1 ) t -= 1; + if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t; + if ( t < 1 / 2 ) return q; + if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t ); + return p; - return true; + } - }; + class Color { - }(), + constructor( r, g, b ) { - containsPoint: function ( point ) { + this.isColor = true; - var planes = this.planes; + this.r = 1; + this.g = 1; + this.b = 1; - for ( var i = 0; i < 6; i ++ ) { + return this.set( r, g, b ); - if ( planes[ i ].distanceToPoint( point ) < 0 ) { + } - return false; + set( r, g, b ) { - } + if ( g === undefined && b === undefined ) { - } + // r is THREE.Color, hex or string - return true; + const value = r; - } + if ( value && value.isColor ) { - } ); + this.copy( value ); - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ + } else if ( typeof value === 'number' ) { - function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) { + this.setHex( value ); - var _gl = _renderer.context, - _state = _renderer.state, - _frustum = new Frustum(), - _projScreenMatrix = new Matrix4(), + } else if ( typeof value === 'string' ) { - _lightShadows = _lights.shadows, + this.setStyle( value ); + + } + + } else { - _shadowMapSize = new Vector2(), - _maxShadowMapSize = new Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ), + this.setRGB( r, g, b ); - _lookTarget = new Vector3(), - _lightPositionWorld = new Vector3(), + } - _MorphingFlag = 1, - _SkinningFlag = 2, + return this; - _NumberOfMaterialVariants = ( _MorphingFlag | _SkinningFlag ) + 1, + } - _depthMaterials = new Array( _NumberOfMaterialVariants ), - _distanceMaterials = new Array( _NumberOfMaterialVariants ), + setScalar( scalar ) { - _materialCache = {}; + this.r = scalar; + this.g = scalar; + this.b = scalar; - var cubeDirections = [ - new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ), - new Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 ) - ]; + return this; - var cubeUps = [ - new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), - new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ), new Vector3( 0, 0, - 1 ) - ]; + } - var cube2DViewPorts = [ - new Vector4(), new Vector4(), new Vector4(), - new Vector4(), new Vector4(), new Vector4() - ]; + setHex( hex, colorSpace = SRGBColorSpace ) { - // init + hex = Math.floor( hex ); - var depthMaterialTemplate = new MeshDepthMaterial(); - depthMaterialTemplate.depthPacking = RGBADepthPacking; - depthMaterialTemplate.clipping = true; + this.r = ( hex >> 16 & 255 ) / 255; + this.g = ( hex >> 8 & 255 ) / 255; + this.b = ( hex & 255 ) / 255; - var distanceShader = ShaderLib[ "distanceRGBA" ]; - var distanceUniforms = UniformsUtils.clone( distanceShader.uniforms ); + ColorManagement.toWorkingColorSpace( this, colorSpace ); - for ( var i = 0; i !== _NumberOfMaterialVariants; ++ i ) { + return this; - var useMorphing = ( i & _MorphingFlag ) !== 0; - var useSkinning = ( i & _SkinningFlag ) !== 0; + } - var depthMaterial = depthMaterialTemplate.clone(); - depthMaterial.morphTargets = useMorphing; - depthMaterial.skinning = useSkinning; + setRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) { - _depthMaterials[ i ] = depthMaterial; + this.r = r; + this.g = g; + this.b = b; - var distanceMaterial = new ShaderMaterial( { - defines: { - 'USE_SHADOWMAP': '' - }, - uniforms: distanceUniforms, - vertexShader: distanceShader.vertexShader, - fragmentShader: distanceShader.fragmentShader, - morphTargets: useMorphing, - skinning: useSkinning, - clipping: true - } ); + ColorManagement.toWorkingColorSpace( this, colorSpace ); - _distanceMaterials[ i ] = distanceMaterial; + return this; } - // + setHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) { - var scope = this; + // h,s,l ranges are in 0.0 - 1.0 + h = euclideanModulo( h, 1 ); + s = clamp( s, 0, 1 ); + l = clamp( l, 0, 1 ); - this.enabled = false; + if ( s === 0 ) { - this.autoUpdate = true; - this.needsUpdate = false; + this.r = this.g = this.b = l; - this.type = PCFShadowMap; + } else { - this.renderReverseSided = true; - this.renderSingleSided = true; + const p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); + const q = ( 2 * l ) - p; - this.render = function ( scene, camera ) { + this.r = hue2rgb( q, p, h + 1 / 3 ); + this.g = hue2rgb( q, p, h ); + this.b = hue2rgb( q, p, h - 1 / 3 ); - if ( scope.enabled === false ) return; - if ( scope.autoUpdate === false && scope.needsUpdate === false ) return; + } - if ( _lightShadows.length === 0 ) return; + ColorManagement.toWorkingColorSpace( this, colorSpace ); - // Set GL state for depth map. - _state.disable( _gl.BLEND ); - _state.buffers.color.setClear( 1, 1, 1, 1 ); - _state.buffers.depth.setTest( true ); - _state.setScissorTest( false ); + return this; - // render depth map + } - var faceCount; + setStyle( style, colorSpace = SRGBColorSpace ) { - for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) { + function handleAlpha( string ) { - var light = _lightShadows[ i ]; - var shadow = light.shadow; - var isPointLight = light && light.isPointLight; + if ( string === undefined ) return; - if ( shadow === undefined ) { + if ( parseFloat( string ) < 1 ) { - console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' ); - continue; + console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); } - var shadowCamera = shadow.camera; + } - _shadowMapSize.copy( shadow.mapSize ); - _shadowMapSize.min( _maxShadowMapSize ); - if ( isPointLight ) { + let m; - var vpWidth = _shadowMapSize.x; - var vpHeight = _shadowMapSize.y; + if ( m = /^(\w+)\(([^\)]*)\)/.exec( style ) ) { - // These viewports map a cube-map onto a 2D texture with the - // following orientation: - // - // xzXZ - // y Y - // - // X - Positive x direction - // x - Negative x direction - // Y - Positive y direction - // y - Negative y direction - // Z - Positive z direction - // z - Negative z direction + // rgb / hsl - // positive X - cube2DViewPorts[ 0 ].set( vpWidth * 2, vpHeight, vpWidth, vpHeight ); - // negative X - cube2DViewPorts[ 1 ].set( 0, vpHeight, vpWidth, vpHeight ); - // positive Z - cube2DViewPorts[ 2 ].set( vpWidth * 3, vpHeight, vpWidth, vpHeight ); - // negative Z - cube2DViewPorts[ 3 ].set( vpWidth, vpHeight, vpWidth, vpHeight ); - // positive Y - cube2DViewPorts[ 4 ].set( vpWidth * 3, 0, vpWidth, vpHeight ); - // negative Y - cube2DViewPorts[ 5 ].set( vpWidth, 0, vpWidth, vpHeight ); + let color; + const name = m[ 1 ]; + const components = m[ 2 ]; - _shadowMapSize.x *= 4.0; - _shadowMapSize.y *= 2.0; + switch ( name ) { - } + case 'rgb': + case 'rgba': - if ( shadow.map === null ) { + if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { - var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat }; + // rgb(255,0,0) rgba(255,0,0,0.5) - shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); - shadow.map.texture.name = light.name + ".shadowMap"; + handleAlpha( color[ 4 ] ); - shadowCamera.updateProjectionMatrix(); + return this.setRGB( + Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255, + Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255, + Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255, + colorSpace + ); - } + } - if ( shadow.isSpotLightShadow ) { + if ( color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { - shadow.update( light ); + // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) - } + handleAlpha( color[ 4 ] ); - var shadowMap = shadow.map; - var shadowMatrix = shadow.matrix; + return this.setRGB( + Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100, + Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100, + Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100, + colorSpace + ); - _lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); - shadowCamera.position.copy( _lightPositionWorld ); + } - if ( isPointLight ) { + break; - faceCount = 6; + case 'hsl': + case 'hsla': - // for point lights we set the shadow matrix to be a translation-only matrix - // equal to inverse of the light's position + if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { - shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z ); + // hsl(120,50%,50%) hsla(120,50%,50%,0.5) - } else { + handleAlpha( color[ 4 ] ); - faceCount = 1; + return this.setHSL( + parseFloat( color[ 1 ] ) / 360, + parseFloat( color[ 2 ] ) / 100, + parseFloat( color[ 3 ] ) / 100, + colorSpace + ); - _lookTarget.setFromMatrixPosition( light.target.matrixWorld ); - shadowCamera.lookAt( _lookTarget ); - shadowCamera.updateMatrixWorld(); + } - // compute shadow matrix + break; - shadowMatrix.set( - 0.5, 0.0, 0.0, 0.5, - 0.0, 0.5, 0.0, 0.5, - 0.0, 0.0, 0.5, 0.5, - 0.0, 0.0, 0.0, 1.0 - ); + default: - shadowMatrix.multiply( shadowCamera.projectionMatrix ); - shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); + console.warn( 'THREE.Color: Unknown color model ' + style ); } - _renderer.setRenderTarget( shadowMap ); - _renderer.clear(); - - // render shadow map for each cube face (if omni-directional) or - // run a single pass if not + } else if ( m = /^\#([A-Fa-f\d]+)$/.exec( style ) ) { - for ( var face = 0; face < faceCount; face ++ ) { + // hex color - if ( isPointLight ) { + const hex = m[ 1 ]; + const size = hex.length; - _lookTarget.copy( shadowCamera.position ); - _lookTarget.add( cubeDirections[ face ] ); - shadowCamera.up.copy( cubeUps[ face ] ); - shadowCamera.lookAt( _lookTarget ); - shadowCamera.updateMatrixWorld(); + if ( size === 3 ) { - var vpDimensions = cube2DViewPorts[ face ]; - _state.viewport( vpDimensions ); - - } + // #ff0 + return this.setRGB( + parseInt( hex.charAt( 0 ), 16 ) / 15, + parseInt( hex.charAt( 1 ), 16 ) / 15, + parseInt( hex.charAt( 2 ), 16 ) / 15, + colorSpace + ); - // update camera matrices and frustum + } else if ( size === 6 ) { - _projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); + // #ff0000 + return this.setHex( parseInt( hex, 16 ), colorSpace ); - // set object matrices & frustum culling + } else { - renderObject( scene, camera, shadowCamera, isPointLight ); + console.warn( 'THREE.Color: Invalid hex color ' + style ); } - } - - // Restore GL state. - var clearColor = _renderer.getClearColor(); - var clearAlpha = _renderer.getClearAlpha(); - _renderer.setClearColor( clearColor, clearAlpha ); - - scope.needsUpdate = false; + } else if ( style && style.length > 0 ) { - }; + return this.setColorName( style, colorSpace ); - function getDepthMaterial( object, material, isPointLight, lightPositionWorld ) { + } - var geometry = object.geometry; + return this; - var result = null; + } - var materialVariants = _depthMaterials; - var customMaterial = object.customDepthMaterial; + setColorName( style, colorSpace = SRGBColorSpace ) { - if ( isPointLight ) { + // color keywords + const hex = _colorKeywords[ style.toLowerCase() ]; - materialVariants = _distanceMaterials; - customMaterial = object.customDistanceMaterial; + if ( hex !== undefined ) { - } + // red + this.setHex( hex, colorSpace ); - if ( ! customMaterial ) { + } else { - var useMorphing = false; + // unknown color + console.warn( 'THREE.Color: Unknown color ' + style ); - if ( material.morphTargets ) { + } - if ( geometry && geometry.isBufferGeometry ) { + return this; - useMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0; + } - } else if ( geometry && geometry.isGeometry ) { + clone() { - useMorphing = geometry.morphTargets && geometry.morphTargets.length > 0; + return new this.constructor( this.r, this.g, this.b ); - } + } - } + copy( color ) { - if ( object.isSkinnedMesh && material.skinning === false ) { + this.r = color.r; + this.g = color.g; + this.b = color.b; - console.warn( 'THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:', object ); + return this; - } + } - var useSkinning = object.isSkinnedMesh && material.skinning; + copySRGBToLinear( color ) { - var variantIndex = 0; + this.r = SRGBToLinear( color.r ); + this.g = SRGBToLinear( color.g ); + this.b = SRGBToLinear( color.b ); - if ( useMorphing ) variantIndex |= _MorphingFlag; - if ( useSkinning ) variantIndex |= _SkinningFlag; + return this; - result = materialVariants[ variantIndex ]; + } - } else { + copyLinearToSRGB( color ) { - result = customMaterial; + this.r = LinearToSRGB( color.r ); + this.g = LinearToSRGB( color.g ); + this.b = LinearToSRGB( color.b ); - } + return this; - if ( _renderer.localClippingEnabled && - material.clipShadows === true && - material.clippingPlanes.length !== 0 ) { + } - // in this case we need a unique material instance reflecting the - // appropriate state + convertSRGBToLinear() { - var keyA = result.uuid, keyB = material.uuid; + this.copySRGBToLinear( this ); - var materialsForVariant = _materialCache[ keyA ]; + return this; - if ( materialsForVariant === undefined ) { + } - materialsForVariant = {}; - _materialCache[ keyA ] = materialsForVariant; + convertLinearToSRGB() { - } + this.copyLinearToSRGB( this ); - var cachedMaterial = materialsForVariant[ keyB ]; + return this; - if ( cachedMaterial === undefined ) { + } - cachedMaterial = result.clone(); - materialsForVariant[ keyB ] = cachedMaterial; + getHex( colorSpace = SRGBColorSpace ) { - } + ColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace ); - result = cachedMaterial; + return Math.round( clamp( _color.r * 255, 0, 255 ) ) * 65536 + Math.round( clamp( _color.g * 255, 0, 255 ) ) * 256 + Math.round( clamp( _color.b * 255, 0, 255 ) ); - } + } - result.visible = material.visible; - result.wireframe = material.wireframe; + getHexString( colorSpace = SRGBColorSpace ) { - var side = material.side; + return ( '000000' + this.getHex( colorSpace ).toString( 16 ) ).slice( - 6 ); - if ( scope.renderSingleSided && side == DoubleSide ) { + } - side = FrontSide; + getHSL( target, colorSpace = ColorManagement.workingColorSpace ) { - } + // h,s,l ranges are in 0.0 - 1.0 - if ( scope.renderReverseSided ) { + ColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace ); - if ( side === FrontSide ) side = BackSide; - else if ( side === BackSide ) side = FrontSide; + const r = _color.r, g = _color.g, b = _color.b; - } + const max = Math.max( r, g, b ); + const min = Math.min( r, g, b ); - result.side = side; + let hue, saturation; + const lightness = ( min + max ) / 2.0; - result.clipShadows = material.clipShadows; - result.clippingPlanes = material.clippingPlanes; + if ( min === max ) { - result.wireframeLinewidth = material.wireframeLinewidth; - result.linewidth = material.linewidth; + hue = 0; + saturation = 0; - if ( isPointLight && result.uniforms.lightPos !== undefined ) { + } else { - result.uniforms.lightPos.value.copy( lightPositionWorld ); + const delta = max - min; - } + saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); - return result; + switch ( max ) { - } + case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; + case g: hue = ( b - r ) / delta + 2; break; + case b: hue = ( r - g ) / delta + 4; break; - function renderObject( object, camera, shadowCamera, isPointLight ) { + } - if ( object.visible === false ) return; + hue /= 6; - var visible = object.layers.test( camera.layers ); + } - if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) { + target.h = hue; + target.s = saturation; + target.l = lightness; - if ( object.castShadow && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) { + return target; - object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); + } - var geometry = _objects.update( object ); - var material = object.material; + getRGB( target, colorSpace = ColorManagement.workingColorSpace ) { - if ( Array.isArray( material ) ) { + ColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace ); - var groups = geometry.groups; + target.r = _color.r; + target.g = _color.g; + target.b = _color.b; - for ( var k = 0, kl = groups.length; k < kl; k ++ ) { + return target; - var group = groups[ k ]; - var groupMaterial = material[ group.materialIndex ]; + } - if ( groupMaterial && groupMaterial.visible ) { + getStyle( colorSpace = SRGBColorSpace ) { - var depthMaterial = getDepthMaterial( object, groupMaterial, isPointLight, _lightPositionWorld ); - _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group ); + ColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace ); - } + const r = _color.r, g = _color.g, b = _color.b; - } + if ( colorSpace !== SRGBColorSpace ) { - } else if ( material.visible ) { + // Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/). + return `color(${ colorSpace } ${ r.toFixed( 3 ) } ${ g.toFixed( 3 ) } ${ b.toFixed( 3 ) })`; - var depthMaterial = getDepthMaterial( object, material, isPointLight, _lightPositionWorld ); - _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null ); + } - } + return `rgb(${ Math.round( r * 255 ) },${ Math.round( g * 255 ) },${ Math.round( b * 255 ) })`; - } + } - } + offsetHSL( h, s, l ) { - var children = object.children; + this.getHSL( _hslA ); - for ( var i = 0, l = children.length; i < l; i ++ ) { + _hslA.h += h; _hslA.s += s; _hslA.l += l; - renderObject( children[ i ], camera, shadowCamera, isPointLight ); + this.setHSL( _hslA.h, _hslA.s, _hslA.l ); - } + return this; } - } - - /** - * @author mrdoob / http://mrdoob.com/ - */ + add( color ) { - function WebGLAttributes( gl ) { + this.r += color.r; + this.g += color.g; + this.b += color.b; - var buffers = {}; + return this; - function createBuffer( attribute, bufferType ) { + } - var array = attribute.array; - var usage = attribute.dynamic ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW; + addColors( color1, color2 ) { - var buffer = gl.createBuffer(); + this.r = color1.r + color2.r; + this.g = color1.g + color2.g; + this.b = color1.b + color2.b; - gl.bindBuffer( bufferType, buffer ); - gl.bufferData( bufferType, array, usage ); + return this; - attribute.onUploadCallback(); + } - var type = gl.FLOAT; + addScalar( s ) { - if ( array instanceof Float32Array ) { + this.r += s; + this.g += s; + this.b += s; - type = gl.FLOAT; + return this; - } else if ( array instanceof Float64Array ) { + } - console.warn( 'THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.' ); + sub( color ) { - } else if ( array instanceof Uint16Array ) { + this.r = Math.max( 0, this.r - color.r ); + this.g = Math.max( 0, this.g - color.g ); + this.b = Math.max( 0, this.b - color.b ); - type = gl.UNSIGNED_SHORT; + return this; - } else if ( array instanceof Int16Array ) { + } - type = gl.SHORT; + multiply( color ) { - } else if ( array instanceof Uint32Array ) { + this.r *= color.r; + this.g *= color.g; + this.b *= color.b; - type = gl.UNSIGNED_INT; + return this; - } else if ( array instanceof Int32Array ) { + } - type = gl.INT; + multiplyScalar( s ) { - } else if ( array instanceof Int8Array ) { + this.r *= s; + this.g *= s; + this.b *= s; - type = gl.BYTE; + return this; - } else if ( array instanceof Uint8Array ) { + } - type = gl.UNSIGNED_BYTE; + lerp( color, alpha ) { - } + this.r += ( color.r - this.r ) * alpha; + this.g += ( color.g - this.g ) * alpha; + this.b += ( color.b - this.b ) * alpha; - return { - buffer: buffer, - type: type, - bytesPerElement: array.BYTES_PER_ELEMENT, - version: attribute.version - }; + return this; } - function updateBuffer( buffer, attribute, bufferType ) { - - var array = attribute.array; - var updateRange = attribute.updateRange; + lerpColors( color1, color2, alpha ) { - gl.bindBuffer( bufferType, buffer ); + this.r = color1.r + ( color2.r - color1.r ) * alpha; + this.g = color1.g + ( color2.g - color1.g ) * alpha; + this.b = color1.b + ( color2.b - color1.b ) * alpha; - if ( attribute.dynamic === false ) { + return this; - gl.bufferData( bufferType, array, gl.STATIC_DRAW ); + } - } else if ( updateRange.count === - 1 ) { + lerpHSL( color, alpha ) { - // Not using update ranges + this.getHSL( _hslA ); + color.getHSL( _hslB ); - gl.bufferSubData( bufferType, 0, array ); + const h = lerp( _hslA.h, _hslB.h, alpha ); + const s = lerp( _hslA.s, _hslB.s, alpha ); + const l = lerp( _hslA.l, _hslB.l, alpha ); - } else if ( updateRange.count === 0 ) { + this.setHSL( h, s, l ); - console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' ); + return this; - } else { + } - gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, - array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); + setFromVector3( v ) { - updateRange.count = -1; // reset range + this.r = v.x; + this.g = v.y; + this.b = v.z; - } + return this; } - // + applyMatrix3( m ) { - function get( attribute ) { + const r = this.r, g = this.g, b = this.b; + const e = m.elements; - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; + this.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b; + this.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b; + this.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b; - return buffers[ attribute.uuid ]; + return this; } - function remove( attribute ) { + equals( c ) { - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - - var data = buffers[ attribute.uuid ]; + return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); - if ( data ) { + } - gl.deleteBuffer( data.buffer ); + fromArray( array, offset = 0 ) { - delete buffers[ attribute.uuid ]; + this.r = array[ offset ]; + this.g = array[ offset + 1 ]; + this.b = array[ offset + 2 ]; - } + return this; } - function update( attribute, bufferType ) { + toArray( array = [], offset = 0 ) { - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; + array[ offset ] = this.r; + array[ offset + 1 ] = this.g; + array[ offset + 2 ] = this.b; - var data = buffers[ attribute.uuid ]; + return array; - if ( data === undefined ) { + } - buffers[ attribute.uuid ] = createBuffer( attribute, bufferType ); + fromBufferAttribute( attribute, index ) { - } else if ( data.version < attribute.version ) { + this.r = attribute.getX( index ); + this.g = attribute.getY( index ); + this.b = attribute.getZ( index ); - updateBuffer( data.buffer, attribute, bufferType ); + return this; - data.version = attribute.version; + } - } + toJSON() { + + return this.getHex(); } - return { + *[ Symbol.iterator ]() { - get: get, - remove: remove, - update: update + yield this.r; + yield this.g; + yield this.b; - }; + } } - /** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - */ + const _color = /*@__PURE__*/ new Color(); - function Euler( x, y, z, order ) { + Color.NAMES = _colorKeywords; - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._order = order || Euler.DefaultOrder; + class MeshBasicMaterial extends Material { - } + constructor( parameters ) { - Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; + super(); - Euler.DefaultOrder = 'XYZ'; + this.isMeshBasicMaterial = true; - Object.defineProperties( Euler.prototype, { + this.type = 'MeshBasicMaterial'; - x: { + this.color = new Color( 0xffffff ); // emissive - get: function () { + this.map = null; - return this._x; + this.lightMap = null; + this.lightMapIntensity = 1.0; - }, + this.aoMap = null; + this.aoMapIntensity = 1.0; - set: function ( value ) { + this.specularMap = null; - this._x = value; - this.onChangeCallback(); + this.alphaMap = null; - } + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; - }, + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; - y: { + this.fog = true; - get: function () { + this.setValues( parameters ); - return this._y; + } - }, + copy( source ) { - set: function ( value ) { + super.copy( source ); - this._y = value; - this.onChangeCallback(); + this.color.copy( source.color ); - } + this.map = source.map; - }, + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; - z: { + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; - get: function () { + this.specularMap = source.specularMap; - return this._z; + this.alphaMap = source.alphaMap; - }, + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; - set: function ( value ) { + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; - this._z = value; - this.onChangeCallback(); + this.fog = source.fog; - } + return this; - }, + } - order: { + } - get: function () { + // Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf - return this._order; + const _tables = /*@__PURE__*/ _generateTables(); - }, + function _generateTables() { - set: function ( value ) { + // float32 to float16 helpers - this._order = value; - this.onChangeCallback(); + const buffer = new ArrayBuffer( 4 ); + const floatView = new Float32Array( buffer ); + const uint32View = new Uint32Array( buffer ); - } + const baseTable = new Uint32Array( 512 ); + const shiftTable = new Uint32Array( 512 ); - } + for ( let i = 0; i < 256; ++ i ) { - } ); + const e = i - 127; - Object.assign( Euler.prototype, { + // very small number (0, -0) - isEuler: true, + if ( e < - 27 ) { - set: function ( x, y, z, order ) { + baseTable[ i ] = 0x0000; + baseTable[ i | 0x100 ] = 0x8000; + shiftTable[ i ] = 24; + shiftTable[ i | 0x100 ] = 24; - this._x = x; - this._y = y; - this._z = z; - this._order = order || this._order; + // small number (denorm) - this.onChangeCallback(); + } else if ( e < - 14 ) { - return this; + baseTable[ i ] = 0x0400 >> ( - e - 14 ); + baseTable[ i | 0x100 ] = ( 0x0400 >> ( - e - 14 ) ) | 0x8000; + shiftTable[ i ] = - e - 1; + shiftTable[ i | 0x100 ] = - e - 1; - }, + // normal number - clone: function () { + } else if ( e <= 15 ) { - return new this.constructor( this._x, this._y, this._z, this._order ); + baseTable[ i ] = ( e + 15 ) << 10; + baseTable[ i | 0x100 ] = ( ( e + 15 ) << 10 ) | 0x8000; + shiftTable[ i ] = 13; + shiftTable[ i | 0x100 ] = 13; - }, + // large number (Infinity, -Infinity) - copy: function ( euler ) { + } else if ( e < 128 ) { - this._x = euler._x; - this._y = euler._y; - this._z = euler._z; - this._order = euler._order; + baseTable[ i ] = 0x7c00; + baseTable[ i | 0x100 ] = 0xfc00; + shiftTable[ i ] = 24; + shiftTable[ i | 0x100 ] = 24; - this.onChangeCallback(); + // stay (NaN, Infinity, -Infinity) - return this; + } else { - }, + baseTable[ i ] = 0x7c00; + baseTable[ i | 0x100 ] = 0xfc00; + shiftTable[ i ] = 13; + shiftTable[ i | 0x100 ] = 13; - setFromRotationMatrix: function ( m, order, update ) { + } - var clamp = _Math.clamp; + } - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + // float16 to float32 helpers - var te = m.elements; - var m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; - var m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; - var m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + const mantissaTable = new Uint32Array( 2048 ); + const exponentTable = new Uint32Array( 64 ); + const offsetTable = new Uint32Array( 64 ); - order = order || this._order; + for ( let i = 1; i < 1024; ++ i ) { - if ( order === 'XYZ' ) { + let m = i << 13; // zero pad mantissa bits + let e = 0; // zero exponent - this._y = Math.asin( clamp( m13, - 1, 1 ) ); + // normalized + while ( ( m & 0x00800000 ) === 0 ) { - if ( Math.abs( m13 ) < 0.99999 ) { + m <<= 1; + e -= 0x00800000; // decrement exponent - this._x = Math.atan2( - m23, m33 ); - this._z = Math.atan2( - m12, m11 ); + } - } else { + m &= ~ 0x00800000; // clear leading 1 bit + e += 0x38800000; // adjust bias - this._x = Math.atan2( m32, m22 ); - this._z = 0; + mantissaTable[ i ] = m | e; - } + } - } else if ( order === 'YXZ' ) { + for ( let i = 1024; i < 2048; ++ i ) { - this._x = Math.asin( - clamp( m23, - 1, 1 ) ); + mantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) << 13 ); - if ( Math.abs( m23 ) < 0.99999 ) { + } - this._y = Math.atan2( m13, m33 ); - this._z = Math.atan2( m21, m22 ); + for ( let i = 1; i < 31; ++ i ) { - } else { + exponentTable[ i ] = i << 23; - this._y = Math.atan2( - m31, m11 ); - this._z = 0; + } - } + exponentTable[ 31 ] = 0x47800000; + exponentTable[ 32 ] = 0x80000000; - } else if ( order === 'ZXY' ) { + for ( let i = 33; i < 63; ++ i ) { - this._x = Math.asin( clamp( m32, - 1, 1 ) ); + exponentTable[ i ] = 0x80000000 + ( ( i - 32 ) << 23 ); - if ( Math.abs( m32 ) < 0.99999 ) { + } - this._y = Math.atan2( - m31, m33 ); - this._z = Math.atan2( - m12, m22 ); + exponentTable[ 63 ] = 0xc7800000; - } else { + for ( let i = 1; i < 64; ++ i ) { - this._y = 0; - this._z = Math.atan2( m21, m11 ); + if ( i !== 32 ) { - } + offsetTable[ i ] = 1024; - } else if ( order === 'ZYX' ) { + } - this._y = Math.asin( - clamp( m31, - 1, 1 ) ); + } - if ( Math.abs( m31 ) < 0.99999 ) { + return { + floatView: floatView, + uint32View: uint32View, + baseTable: baseTable, + shiftTable: shiftTable, + mantissaTable: mantissaTable, + exponentTable: exponentTable, + offsetTable: offsetTable + }; - this._x = Math.atan2( m32, m33 ); - this._z = Math.atan2( m21, m11 ); - - } else { - - this._x = 0; - this._z = Math.atan2( - m12, m22 ); - - } + } - } else if ( order === 'YZX' ) { + // float32 to float16 - this._z = Math.asin( clamp( m21, - 1, 1 ) ); + function toHalfFloat( val ) { - if ( Math.abs( m21 ) < 0.99999 ) { + if ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' ); - this._x = Math.atan2( - m23, m22 ); - this._y = Math.atan2( - m31, m11 ); + val = clamp( val, - 65504, 65504 ); - } else { + _tables.floatView[ 0 ] = val; + const f = _tables.uint32View[ 0 ]; + const e = ( f >> 23 ) & 0x1ff; + return _tables.baseTable[ e ] + ( ( f & 0x007fffff ) >> _tables.shiftTable[ e ] ); - this._x = 0; - this._y = Math.atan2( m13, m33 ); + } - } + // float16 to float32 - } else if ( order === 'XZY' ) { + function fromHalfFloat( val ) { - this._z = Math.asin( - clamp( m12, - 1, 1 ) ); + const m = val >> 10; + _tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val & 0x3ff ) ] + _tables.exponentTable[ m ]; + return _tables.floatView[ 0 ]; - if ( Math.abs( m12 ) < 0.99999 ) { + } - this._x = Math.atan2( m32, m22 ); - this._y = Math.atan2( m13, m11 ); + const DataUtils = { + toHalfFloat: toHalfFloat, + fromHalfFloat: fromHalfFloat, + }; - } else { + const _vector$8 = /*@__PURE__*/ new Vector3(); + const _vector2$1 = /*@__PURE__*/ new Vector2(); - this._x = Math.atan2( - m23, m33 ); - this._y = 0; + class BufferAttribute { - } + constructor( array, itemSize, normalized = false ) { - } else { + if ( Array.isArray( array ) ) { - console.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order ); + throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); } - this._order = order; + this.isBufferAttribute = true; - if ( update !== false ) this.onChangeCallback(); + this.name = ''; - return this; + this.array = array; + this.itemSize = itemSize; + this.count = array !== undefined ? array.length / itemSize : 0; + this.normalized = normalized; - }, + this.usage = StaticDrawUsage; + this.updateRange = { offset: 0, count: - 1 }; + this.gpuType = FloatType; - setFromQuaternion: function () { + this.version = 0; - var matrix = new Matrix4(); + } - return function setFromQuaternion( q, order, update ) { + onUploadCallback() {} - matrix.makeRotationFromQuaternion( q ); + set needsUpdate( value ) { - return this.setFromRotationMatrix( matrix, order, update ); + if ( value === true ) this.version ++; - }; + } - }(), + setUsage( value ) { - setFromVector3: function ( v, order ) { + this.usage = value; - return this.set( v.x, v.y, v.z, order || this._order ); + return this; - }, + } - reorder: function () { + copy( source ) { - // WARNING: this discards revolution information -bhouston + this.name = source.name; + this.array = new source.array.constructor( source.array ); + this.itemSize = source.itemSize; + this.count = source.count; + this.normalized = source.normalized; - var q = new Quaternion(); + this.usage = source.usage; + this.gpuType = source.gpuType; - return function reorder( newOrder ) { + return this; - q.setFromEuler( this ); + } - return this.setFromQuaternion( q, newOrder ); + copyAt( index1, attribute, index2 ) { - }; + index1 *= this.itemSize; + index2 *= attribute.itemSize; - }(), + for ( let i = 0, l = this.itemSize; i < l; i ++ ) { - equals: function ( euler ) { + this.array[ index1 + i ] = attribute.array[ index2 + i ]; - return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); + } - }, + return this; - fromArray: function ( array ) { + } - this._x = array[ 0 ]; - this._y = array[ 1 ]; - this._z = array[ 2 ]; - if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; + copyArray( array ) { - this.onChangeCallback(); + this.array.set( array ); return this; - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + } - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._order; + applyMatrix3( m ) { - return array; + if ( this.itemSize === 2 ) { - }, + for ( let i = 0, l = this.count; i < l; i ++ ) { - toVector3: function ( optionalResult ) { + _vector2$1.fromBufferAttribute( this, i ); + _vector2$1.applyMatrix3( m ); - if ( optionalResult ) { + this.setXY( i, _vector2$1.x, _vector2$1.y ); - return optionalResult.set( this._x, this._y, this._z ); + } - } else { + } else if ( this.itemSize === 3 ) { - return new Vector3( this._x, this._y, this._z ); + for ( let i = 0, l = this.count; i < l; i ++ ) { - } + _vector$8.fromBufferAttribute( this, i ); + _vector$8.applyMatrix3( m ); - }, + this.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z ); - onChange: function ( callback ) { + } - this.onChangeCallback = callback; + } return this; - }, + } - onChangeCallback: function () {} + applyMatrix4( m ) { - } ); + for ( let i = 0, l = this.count; i < l; i ++ ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + _vector$8.fromBufferAttribute( this, i ); - function Layers() { + _vector$8.applyMatrix4( m ); - this.mask = 1 | 0; + this.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z ); - } + } - Object.assign( Layers.prototype, { + return this; - set: function ( channel ) { + } - this.mask = 1 << channel | 0; + applyNormalMatrix( m ) { - }, + for ( let i = 0, l = this.count; i < l; i ++ ) { - enable: function ( channel ) { + _vector$8.fromBufferAttribute( this, i ); - this.mask |= 1 << channel | 0; + _vector$8.applyNormalMatrix( m ); - }, + this.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z ); - toggle: function ( channel ) { + } - this.mask ^= 1 << channel | 0; + return this; - }, + } - disable: function ( channel ) { + transformDirection( m ) { - this.mask &= ~ ( 1 << channel | 0 ); + for ( let i = 0, l = this.count; i < l; i ++ ) { - }, + _vector$8.fromBufferAttribute( this, i ); - test: function ( layers ) { + _vector$8.transformDirection( m ); - return ( this.mask & layers.mask ) !== 0; + this.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z ); - } + } - } ); + return this; - /** - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author elephantatwork / www.elephantatwork.ch - */ + } - var object3DId = 0; + set( value, offset = 0 ) { - function Object3D() { + // Matching BufferAttribute constructor, do not normalize the array. + this.array.set( value, offset ); - Object.defineProperty( this, 'id', { value: object3DId ++ } ); + return this; - this.uuid = _Math.generateUUID(); + } - this.name = ''; - this.type = 'Object3D'; + getX( index ) { - this.parent = null; - this.children = []; + let x = this.array[ index * this.itemSize ]; - this.up = Object3D.DefaultUp.clone(); + if ( this.normalized ) x = denormalize( x, this.array ); - var position = new Vector3(); - var rotation = new Euler(); - var quaternion = new Quaternion(); - var scale = new Vector3( 1, 1, 1 ); + return x; - function onRotationChange() { + } - quaternion.setFromEuler( rotation, false ); + setX( index, x ) { - } + if ( this.normalized ) x = normalize( x, this.array ); - function onQuaternionChange() { + this.array[ index * this.itemSize ] = x; - rotation.setFromQuaternion( quaternion, undefined, false ); + return this; } - rotation.onChange( onRotationChange ); - quaternion.onChange( onQuaternionChange ); + getY( index ) { - Object.defineProperties( this, { - position: { - enumerable: true, - value: position - }, - rotation: { - enumerable: true, - value: rotation - }, - quaternion: { - enumerable: true, - value: quaternion - }, - scale: { - enumerable: true, - value: scale - }, - modelViewMatrix: { - value: new Matrix4() - }, - normalMatrix: { - value: new Matrix3() - } - } ); + let y = this.array[ index * this.itemSize + 1 ]; - this.matrix = new Matrix4(); - this.matrixWorld = new Matrix4(); + if ( this.normalized ) y = denormalize( y, this.array ); - this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; - this.matrixWorldNeedsUpdate = false; + return y; - this.layers = new Layers(); - this.visible = true; + } - this.castShadow = false; - this.receiveShadow = false; + setY( index, y ) { - this.frustumCulled = true; - this.renderOrder = 0; + if ( this.normalized ) y = normalize( y, this.array ); - this.userData = {}; - } + this.array[ index * this.itemSize + 1 ] = y; - Object3D.DefaultUp = new Vector3( 0, 1, 0 ); - Object3D.DefaultMatrixAutoUpdate = true; + return this; - Object.assign( Object3D.prototype, EventDispatcher.prototype, { + } - isObject3D: true, + getZ( index ) { - onBeforeRender: function () {}, - onAfterRender: function () {}, + let z = this.array[ index * this.itemSize + 2 ]; - applyMatrix: function ( matrix ) { + if ( this.normalized ) z = denormalize( z, this.array ); - this.matrix.multiplyMatrices( matrix, this.matrix ); + return z; - this.matrix.decompose( this.position, this.quaternion, this.scale ); + } - }, + setZ( index, z ) { - applyQuaternion: function ( q ) { + if ( this.normalized ) z = normalize( z, this.array ); - this.quaternion.premultiply( q ); + this.array[ index * this.itemSize + 2 ] = z; return this; - }, - - setRotationFromAxisAngle: function ( axis, angle ) { + } - // assumes axis is normalized + getW( index ) { - this.quaternion.setFromAxisAngle( axis, angle ); + let w = this.array[ index * this.itemSize + 3 ]; - }, + if ( this.normalized ) w = denormalize( w, this.array ); - setRotationFromEuler: function ( euler ) { + return w; - this.quaternion.setFromEuler( euler, true ); + } - }, + setW( index, w ) { - setRotationFromMatrix: function ( m ) { + if ( this.normalized ) w = normalize( w, this.array ); - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + this.array[ index * this.itemSize + 3 ] = w; - this.quaternion.setFromRotationMatrix( m ); + return this; - }, + } - setRotationFromQuaternion: function ( q ) { + setXY( index, x, y ) { - // assumes q is normalized + index *= this.itemSize; - this.quaternion.copy( q ); + if ( this.normalized ) { - }, + x = normalize( x, this.array ); + y = normalize( y, this.array ); - rotateOnAxis: function () { + } - // rotate object on axis in object space - // axis is assumed to be normalized + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; - var q1 = new Quaternion(); + return this; - return function rotateOnAxis( axis, angle ) { + } - q1.setFromAxisAngle( axis, angle ); + setXYZ( index, x, y, z ) { - this.quaternion.multiply( q1 ); + index *= this.itemSize; - return this; + if ( this.normalized ) { - }; + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); - }(), + } - rotateX: function () { + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; - var v1 = new Vector3( 1, 0, 0 ); + return this; - return function rotateX( angle ) { + } - return this.rotateOnAxis( v1, angle ); + setXYZW( index, x, y, z, w ) { - }; + index *= this.itemSize; - }(), + if ( this.normalized ) { - rotateY: function () { + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); + w = normalize( w, this.array ); - var v1 = new Vector3( 0, 1, 0 ); + } - return function rotateY( angle ) { + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; + this.array[ index + 3 ] = w; - return this.rotateOnAxis( v1, angle ); + return this; - }; + } - }(), + onUpload( callback ) { - rotateZ: function () { + this.onUploadCallback = callback; - var v1 = new Vector3( 0, 0, 1 ); + return this; - return function rotateZ( angle ) { + } - return this.rotateOnAxis( v1, angle ); + clone() { - }; + return new this.constructor( this.array, this.itemSize ).copy( this ); - }(), + } - translateOnAxis: function () { + toJSON() { - // translate object by distance along axis in object space - // axis is assumed to be normalized + const data = { + itemSize: this.itemSize, + type: this.array.constructor.name, + array: Array.from( this.array ), + normalized: this.normalized + }; - var v1 = new Vector3(); + if ( this.name !== '' ) data.name = this.name; + if ( this.usage !== StaticDrawUsage ) data.usage = this.usage; + if ( this.updateRange.offset !== 0 || this.updateRange.count !== - 1 ) data.updateRange = this.updateRange; - return function translateOnAxis( axis, distance ) { + return data; - v1.copy( axis ).applyQuaternion( this.quaternion ); + } - this.position.add( v1.multiplyScalar( distance ) ); + copyColorsArray() { // @deprecated, r144 - return this; + console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' ); - }; + } - }(), + copyVector2sArray() { // @deprecated, r144 - translateX: function () { + console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' ); - var v1 = new Vector3( 1, 0, 0 ); + } - return function translateX( distance ) { + copyVector3sArray() { // @deprecated, r144 - return this.translateOnAxis( v1, distance ); + console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' ); - }; + } - }(), + copyVector4sArray() { // @deprecated, r144 - translateY: function () { + console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' ); - var v1 = new Vector3( 0, 1, 0 ); + } - return function translateY( distance ) { + } - return this.translateOnAxis( v1, distance ); + // - }; + class Int8BufferAttribute extends BufferAttribute { - }(), + constructor( array, itemSize, normalized ) { - translateZ: function () { + super( new Int8Array( array ), itemSize, normalized ); - var v1 = new Vector3( 0, 0, 1 ); + } - return function translateZ( distance ) { + } - return this.translateOnAxis( v1, distance ); + class Uint8BufferAttribute extends BufferAttribute { - }; + constructor( array, itemSize, normalized ) { - }(), + super( new Uint8Array( array ), itemSize, normalized ); - localToWorld: function ( vector ) { + } - return vector.applyMatrix4( this.matrixWorld ); + } - }, + class Uint8ClampedBufferAttribute extends BufferAttribute { - worldToLocal: function () { + constructor( array, itemSize, normalized ) { - var m1 = new Matrix4(); + super( new Uint8ClampedArray( array ), itemSize, normalized ); - return function worldToLocal( vector ) { + } - return vector.applyMatrix4( m1.getInverse( this.matrixWorld ) ); + } - }; + class Int16BufferAttribute extends BufferAttribute { - }(), + constructor( array, itemSize, normalized ) { - lookAt: function () { + super( new Int16Array( array ), itemSize, normalized ); - // This method does not support objects with rotated and/or translated parent(s) + } - var m1 = new Matrix4(); + } - return function lookAt( vector ) { + class Uint16BufferAttribute extends BufferAttribute { - if ( this.isCamera ) { + constructor( array, itemSize, normalized ) { - m1.lookAt( this.position, vector, this.up ); + super( new Uint16Array( array ), itemSize, normalized ); - } else { + } - m1.lookAt( vector, this.position, this.up ); + } - } + class Int32BufferAttribute extends BufferAttribute { - this.quaternion.setFromRotationMatrix( m1 ); + constructor( array, itemSize, normalized ) { - }; + super( new Int32Array( array ), itemSize, normalized ); - }(), + } - add: function ( object ) { + } - if ( arguments.length > 1 ) { + class Uint32BufferAttribute extends BufferAttribute { - for ( var i = 0; i < arguments.length; i ++ ) { + constructor( array, itemSize, normalized ) { - this.add( arguments[ i ] ); + super( new Uint32Array( array ), itemSize, normalized ); - } + } - return this; + } - } + class Float16BufferAttribute extends BufferAttribute { - if ( object === this ) { + constructor( array, itemSize, normalized ) { - console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); - return this; + super( new Uint16Array( array ), itemSize, normalized ); - } + this.isFloat16BufferAttribute = true; - if ( ( object && object.isObject3D ) ) { + } - if ( object.parent !== null ) { + getX( index ) { - object.parent.remove( object ); + let x = fromHalfFloat( this.array[ index * this.itemSize ] ); - } + if ( this.normalized ) x = denormalize( x, this.array ); - object.parent = this; - object.dispatchEvent( { type: 'added' } ); + return x; - this.children.push( object ); + } - } else { + setX( index, x ) { - console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); + if ( this.normalized ) x = normalize( x, this.array ); - } + this.array[ index * this.itemSize ] = toHalfFloat( x ); return this; - }, + } - remove: function ( object ) { + getY( index ) { - if ( arguments.length > 1 ) { + let y = fromHalfFloat( this.array[ index * this.itemSize + 1 ] ); - for ( var i = 0; i < arguments.length; i ++ ) { + if ( this.normalized ) y = denormalize( y, this.array ); - this.remove( arguments[ i ] ); + return y; - } + } - return this; + setY( index, y ) { - } + if ( this.normalized ) y = normalize( y, this.array ); - var index = this.children.indexOf( object ); + this.array[ index * this.itemSize + 1 ] = toHalfFloat( y ); - if ( index !== - 1 ) { + return this; - object.parent = null; + } - object.dispatchEvent( { type: 'removed' } ); + getZ( index ) { - this.children.splice( index, 1 ); + let z = fromHalfFloat( this.array[ index * this.itemSize + 2 ] ); - } + if ( this.normalized ) z = denormalize( z, this.array ); - return this; - - }, + return z; - getObjectById: function ( id ) { + } - return this.getObjectByProperty( 'id', id ); + setZ( index, z ) { - }, + if ( this.normalized ) z = normalize( z, this.array ); - getObjectByName: function ( name ) { + this.array[ index * this.itemSize + 2 ] = toHalfFloat( z ); - return this.getObjectByProperty( 'name', name ); + return this; - }, + } - getObjectByProperty: function ( name, value ) { + getW( index ) { - if ( this[ name ] === value ) return this; + let w = fromHalfFloat( this.array[ index * this.itemSize + 3 ] ); - for ( var i = 0, l = this.children.length; i < l; i ++ ) { + if ( this.normalized ) w = denormalize( w, this.array ); - var child = this.children[ i ]; - var object = child.getObjectByProperty( name, value ); + return w; - if ( object !== undefined ) { + } - return object; + setW( index, w ) { - } + if ( this.normalized ) w = normalize( w, this.array ); - } + this.array[ index * this.itemSize + 3 ] = toHalfFloat( w ); - return undefined; + return this; - }, + } - getWorldPosition: function ( optionalTarget ) { + setXY( index, x, y ) { - var result = optionalTarget || new Vector3(); + index *= this.itemSize; - this.updateMatrixWorld( true ); + if ( this.normalized ) { - return result.setFromMatrixPosition( this.matrixWorld ); + x = normalize( x, this.array ); + y = normalize( y, this.array ); - }, + } - getWorldQuaternion: function () { + this.array[ index + 0 ] = toHalfFloat( x ); + this.array[ index + 1 ] = toHalfFloat( y ); - var position = new Vector3(); - var scale = new Vector3(); + return this; - return function getWorldQuaternion( optionalTarget ) { + } - var result = optionalTarget || new Quaternion(); + setXYZ( index, x, y, z ) { - this.updateMatrixWorld( true ); + index *= this.itemSize; - this.matrixWorld.decompose( position, result, scale ); + if ( this.normalized ) { - return result; + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); - }; + } - }(), + this.array[ index + 0 ] = toHalfFloat( x ); + this.array[ index + 1 ] = toHalfFloat( y ); + this.array[ index + 2 ] = toHalfFloat( z ); - getWorldRotation: function () { + return this; - var quaternion = new Quaternion(); + } - return function getWorldRotation( optionalTarget ) { + setXYZW( index, x, y, z, w ) { - var result = optionalTarget || new Euler(); + index *= this.itemSize; - this.getWorldQuaternion( quaternion ); + if ( this.normalized ) { - return result.setFromQuaternion( quaternion, this.rotation.order, false ); + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); + w = normalize( w, this.array ); - }; + } - }(), + this.array[ index + 0 ] = toHalfFloat( x ); + this.array[ index + 1 ] = toHalfFloat( y ); + this.array[ index + 2 ] = toHalfFloat( z ); + this.array[ index + 3 ] = toHalfFloat( w ); - getWorldScale: function () { + return this; - var position = new Vector3(); - var quaternion = new Quaternion(); + } - return function getWorldScale( optionalTarget ) { + } - var result = optionalTarget || new Vector3(); - this.updateMatrixWorld( true ); + class Float32BufferAttribute extends BufferAttribute { - this.matrixWorld.decompose( position, quaternion, result ); + constructor( array, itemSize, normalized ) { - return result; + super( new Float32Array( array ), itemSize, normalized ); - }; + } - }(), + } - getWorldDirection: function () { + class Float64BufferAttribute extends BufferAttribute { - var quaternion = new Quaternion(); + constructor( array, itemSize, normalized ) { - return function getWorldDirection( optionalTarget ) { + super( new Float64Array( array ), itemSize, normalized ); - var result = optionalTarget || new Vector3(); + } - this.getWorldQuaternion( quaternion ); + } - return result.set( 0, 0, 1 ).applyQuaternion( quaternion ); + let _id$1 = 0; - }; + const _m1 = /*@__PURE__*/ new Matrix4(); + const _obj = /*@__PURE__*/ new Object3D(); + const _offset = /*@__PURE__*/ new Vector3(); + const _box$1 = /*@__PURE__*/ new Box3(); + const _boxMorphTargets = /*@__PURE__*/ new Box3(); + const _vector$7 = /*@__PURE__*/ new Vector3(); - }(), + class BufferGeometry extends EventDispatcher { - raycast: function () {}, + constructor() { - traverse: function ( callback ) { + super(); - callback( this ); + this.isBufferGeometry = true; - var children = this.children; + Object.defineProperty( this, 'id', { value: _id$1 ++ } ); - for ( var i = 0, l = children.length; i < l; i ++ ) { + this.uuid = generateUUID(); - children[ i ].traverse( callback ); + this.name = ''; + this.type = 'BufferGeometry'; - } + this.index = null; + this.attributes = {}; - }, + this.morphAttributes = {}; + this.morphTargetsRelative = false; - traverseVisible: function ( callback ) { + this.groups = []; - if ( this.visible === false ) return; + this.boundingBox = null; + this.boundingSphere = null; - callback( this ); + this.drawRange = { start: 0, count: Infinity }; - var children = this.children; + this.userData = {}; - for ( var i = 0, l = children.length; i < l; i ++ ) { + } - children[ i ].traverseVisible( callback ); + getIndex() { - } + return this.index; - }, + } - traverseAncestors: function ( callback ) { + setIndex( index ) { - var parent = this.parent; + if ( Array.isArray( index ) ) { - if ( parent !== null ) { + this.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 ); - callback( parent ); + } else { - parent.traverseAncestors( callback ); + this.index = index; } - }, + return this; - updateMatrix: function () { + } - this.matrix.compose( this.position, this.quaternion, this.scale ); + getAttribute( name ) { - this.matrixWorldNeedsUpdate = true; + return this.attributes[ name ]; - }, + } - updateMatrixWorld: function ( force ) { + setAttribute( name, attribute ) { - if ( this.matrixAutoUpdate ) this.updateMatrix(); + this.attributes[ name ] = attribute; - if ( this.matrixWorldNeedsUpdate || force ) { + return this; - if ( this.parent === null ) { + } - this.matrixWorld.copy( this.matrix ); + deleteAttribute( name ) { - } else { + delete this.attributes[ name ]; - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + return this; - } + } - this.matrixWorldNeedsUpdate = false; + hasAttribute( name ) { - force = true; + return this.attributes[ name ] !== undefined; - } + } - // update children + addGroup( start, count, materialIndex = 0 ) { - var children = this.children; + this.groups.push( { - for ( var i = 0, l = children.length; i < l; i ++ ) { + start: start, + count: count, + materialIndex: materialIndex - children[ i ].updateMatrixWorld( force ); + } ); - } + } - }, + clearGroups() { - toJSON: function ( meta ) { + this.groups = []; - // meta is '' when called from JSON.stringify - var isRootObject = ( meta === undefined || meta === '' ); + } - var output = {}; + setDrawRange( start, count ) { - // meta is a hash used to collect geometries, materials. - // not providing it implies that this is the root object - // being serialized. - if ( isRootObject ) { + this.drawRange.start = start; + this.drawRange.count = count; - // initialize meta obj - meta = { - geometries: {}, - materials: {}, - textures: {}, - images: {} - }; + } - output.metadata = { - version: 4.5, - type: 'Object', - generator: 'Object3D.toJSON' - }; + applyMatrix4( matrix ) { + + const position = this.attributes.position; + + if ( position !== undefined ) { + + position.applyMatrix4( matrix ); + + position.needsUpdate = true; } - // standard Object3D serialization + const normal = this.attributes.normal; - var object = {}; + if ( normal !== undefined ) { - object.uuid = this.uuid; - object.type = this.type; + const normalMatrix = new Matrix3().getNormalMatrix( matrix ); - if ( this.name !== '' ) object.name = this.name; - if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; - if ( this.castShadow === true ) object.castShadow = true; - if ( this.receiveShadow === true ) object.receiveShadow = true; - if ( this.visible === false ) object.visible = false; + normal.applyNormalMatrix( normalMatrix ); - object.matrix = this.matrix.toArray(); + normal.needsUpdate = true; - // + } - function serialize( library, element ) { + const tangent = this.attributes.tangent; - if ( library[ element.uuid ] === undefined ) { + if ( tangent !== undefined ) { - library[ element.uuid ] = element.toJSON( meta ); + tangent.transformDirection( matrix ); - } + tangent.needsUpdate = true; - return element.uuid; + } + + if ( this.boundingBox !== null ) { + + this.computeBoundingBox(); } - if ( this.geometry !== undefined ) { + if ( this.boundingSphere !== null ) { - object.geometry = serialize( meta.geometries, this.geometry ); + this.computeBoundingSphere(); } - if ( this.material !== undefined ) { + return this; - if ( Array.isArray( this.material ) ) { + } - var uuids = []; + applyQuaternion( q ) { - for ( var i = 0, l = this.material.length; i < l; i ++ ) { + _m1.makeRotationFromQuaternion( q ); - uuids.push( serialize( meta.materials, this.material[ i ] ) ); + this.applyMatrix4( _m1 ); - } + return this; - object.material = uuids; + } - } else { + rotateX( angle ) { - object.material = serialize( meta.materials, this.material ); + // rotate geometry around world x-axis - } + _m1.makeRotationX( angle ); - } + this.applyMatrix4( _m1 ); - // + return this; - if ( this.children.length > 0 ) { + } - object.children = []; + rotateY( angle ) { - for ( var i = 0; i < this.children.length; i ++ ) { + // rotate geometry around world y-axis - object.children.push( this.children[ i ].toJSON( meta ).object ); + _m1.makeRotationY( angle ); - } + this.applyMatrix4( _m1 ); - } + return this; - if ( isRootObject ) { + } - var geometries = extractFromCache( meta.geometries ); - var materials = extractFromCache( meta.materials ); - var textures = extractFromCache( meta.textures ); - var images = extractFromCache( meta.images ); + rotateZ( angle ) { - if ( geometries.length > 0 ) output.geometries = geometries; - if ( materials.length > 0 ) output.materials = materials; - if ( textures.length > 0 ) output.textures = textures; - if ( images.length > 0 ) output.images = images; + // rotate geometry around world z-axis - } + _m1.makeRotationZ( angle ); - output.object = object; + this.applyMatrix4( _m1 ); - return output; + return this; - // extract data from the cache hash - // remove metadata on each item - // and return as array - function extractFromCache( cache ) { + } - var values = []; - for ( var key in cache ) { + translate( x, y, z ) { - var data = cache[ key ]; - delete data.metadata; - values.push( data ); + // translate geometry - } - return values; + _m1.makeTranslation( x, y, z ); - } + this.applyMatrix4( _m1 ); - }, + return this; - clone: function ( recursive ) { + } - return new this.constructor().copy( this, recursive ); + scale( x, y, z ) { - }, + // scale geometry - copy: function ( source, recursive ) { + _m1.makeScale( x, y, z ); - if ( recursive === undefined ) recursive = true; + this.applyMatrix4( _m1 ); - this.name = source.name; + return this; - this.up.copy( source.up ); + } - this.position.copy( source.position ); - this.quaternion.copy( source.quaternion ); - this.scale.copy( source.scale ); + lookAt( vector ) { - this.matrix.copy( source.matrix ); - this.matrixWorld.copy( source.matrixWorld ); + _obj.lookAt( vector ); - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; + _obj.updateMatrix(); - this.layers.mask = source.layers.mask; - this.visible = source.visible; + this.applyMatrix4( _obj.matrix ); - this.castShadow = source.castShadow; - this.receiveShadow = source.receiveShadow; + return this; - this.frustumCulled = source.frustumCulled; - this.renderOrder = source.renderOrder; + } - this.userData = JSON.parse( JSON.stringify( source.userData ) ); + center() { - if ( recursive === true ) { + this.computeBoundingBox(); - for ( var i = 0; i < source.children.length; i ++ ) { + this.boundingBox.getCenter( _offset ).negate(); - var child = source.children[ i ]; - this.add( child.clone() ); + this.translate( _offset.x, _offset.y, _offset.z ); - } + return this; + + } + + setFromPoints( points ) { + + const position = []; + + for ( let i = 0, l = points.length; i < l; i ++ ) { + + const point = points[ i ]; + position.push( point.x, point.y, point.z || 0 ); } + this.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) ); + return this; } - } ); + computeBoundingBox() { - /** - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - * @author WestLangley / http://github.com/WestLangley - */ + if ( this.boundingBox === null ) { + + this.boundingBox = new Box3(); - function Camera() { + } - Object3D.call( this ); + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; - this.type = 'Camera'; + if ( position && position.isGLBufferAttribute ) { - this.matrixWorldInverse = new Matrix4(); - this.projectionMatrix = new Matrix4(); + console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this ); - } + this.boundingBox.set( + new Vector3( - Infinity, - Infinity, - Infinity ), + new Vector3( + Infinity, + Infinity, + Infinity ) + ); - Camera.prototype = Object.assign( Object.create( Object3D.prototype ), { + return; - constructor: Camera, + } - isCamera: true, + if ( position !== undefined ) { - copy: function ( source, recursive ) { + this.boundingBox.setFromBufferAttribute( position ); - Object3D.prototype.copy.call( this, source, recursive ); + // process morph attributes if present - this.matrixWorldInverse.copy( source.matrixWorldInverse ); - this.projectionMatrix.copy( source.projectionMatrix ); + if ( morphAttributesPosition ) { - return this; + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - }, + const morphAttribute = morphAttributesPosition[ i ]; + _box$1.setFromBufferAttribute( morphAttribute ); - getWorldDirection: function () { + if ( this.morphTargetsRelative ) { - var quaternion = new Quaternion(); + _vector$7.addVectors( this.boundingBox.min, _box$1.min ); + this.boundingBox.expandByPoint( _vector$7 ); - return function getWorldDirection( optionalTarget ) { + _vector$7.addVectors( this.boundingBox.max, _box$1.max ); + this.boundingBox.expandByPoint( _vector$7 ); - var result = optionalTarget || new Vector3(); + } else { - this.getWorldQuaternion( quaternion ); + this.boundingBox.expandByPoint( _box$1.min ); + this.boundingBox.expandByPoint( _box$1.max ); - return result.set( 0, 0, - 1 ).applyQuaternion( quaternion ); + } - }; + } - }(), + } - updateMatrixWorld: function ( force ) { + } else { - Object3D.prototype.updateMatrixWorld.call( this, force ); + this.boundingBox.makeEmpty(); - this.matrixWorldInverse.getInverse( this.matrixWorld ); + } - }, + if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - clone: function () { + console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); - return new this.constructor().copy( this ); + } } - } ); + computeBoundingSphere() { - /** - * @author alteredq / http://alteredqualia.com/ - * @author arose / http://github.com/arose - */ + if ( this.boundingSphere === null ) { - function OrthographicCamera( left, right, top, bottom, near, far ) { + this.boundingSphere = new Sphere(); - Camera.call( this ); + } - this.type = 'OrthographicCamera'; + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; - this.zoom = 1; - this.view = null; + if ( position && position.isGLBufferAttribute ) { - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this ); - this.near = ( near !== undefined ) ? near : 0.1; - this.far = ( far !== undefined ) ? far : 2000; + this.boundingSphere.set( new Vector3(), Infinity ); - this.updateProjectionMatrix(); + return; - } + } - OrthographicCamera.prototype = Object.assign( Object.create( Camera.prototype ), { + if ( position ) { - constructor: OrthographicCamera, + // first, find the center of the bounding sphere - isOrthographicCamera: true, + const center = this.boundingSphere.center; - copy: function ( source, recursive ) { + _box$1.setFromBufferAttribute( position ); - Camera.prototype.copy.call( this, source, recursive ); + // process morph attributes if present - this.left = source.left; - this.right = source.right; - this.top = source.top; - this.bottom = source.bottom; - this.near = source.near; - this.far = source.far; + if ( morphAttributesPosition ) { - this.zoom = source.zoom; - this.view = source.view === null ? null : Object.assign( {}, source.view ); + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - return this; + const morphAttribute = morphAttributesPosition[ i ]; + _boxMorphTargets.setFromBufferAttribute( morphAttribute ); - }, + if ( this.morphTargetsRelative ) { - setViewOffset: function( fullWidth, fullHeight, x, y, width, height ) { + _vector$7.addVectors( _box$1.min, _boxMorphTargets.min ); + _box$1.expandByPoint( _vector$7 ); - this.view = { - fullWidth: fullWidth, - fullHeight: fullHeight, - offsetX: x, - offsetY: y, - width: width, - height: height - }; + _vector$7.addVectors( _box$1.max, _boxMorphTargets.max ); + _box$1.expandByPoint( _vector$7 ); - this.updateProjectionMatrix(); + } else { - }, + _box$1.expandByPoint( _boxMorphTargets.min ); + _box$1.expandByPoint( _boxMorphTargets.max ); - clearViewOffset: function() { + } - this.view = null; - this.updateProjectionMatrix(); + } - }, + } - updateProjectionMatrix: function () { + _box$1.getCenter( center ); - var dx = ( this.right - this.left ) / ( 2 * this.zoom ); - var dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); - var cx = ( this.right + this.left ) / 2; - var cy = ( this.top + this.bottom ) / 2; + // second, try to find a boundingSphere with a radius smaller than the + // boundingSphere of the boundingBox: sqrt(3) smaller in the best case - var left = cx - dx; - var right = cx + dx; - var top = cy + dy; - var bottom = cy - dy; + let maxRadiusSq = 0; - if ( this.view !== null ) { + for ( let i = 0, il = position.count; i < il; i ++ ) { - var zoomW = this.zoom / ( this.view.width / this.view.fullWidth ); - var zoomH = this.zoom / ( this.view.height / this.view.fullHeight ); - var scaleW = ( this.right - this.left ) / this.view.width; - var scaleH = ( this.top - this.bottom ) / this.view.height; + _vector$7.fromBufferAttribute( position, i ); - left += scaleW * ( this.view.offsetX / zoomW ); - right = left + scaleW * ( this.view.width / zoomW ); - top -= scaleH * ( this.view.offsetY / zoomH ); - bottom = top - scaleH * ( this.view.height / zoomH ); + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$7 ) ); - } + } - this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + // process morph attributes if present - }, + if ( morphAttributesPosition ) { - toJSON: function ( meta ) { + for ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - var data = Object3D.prototype.toJSON.call( this, meta ); + const morphAttribute = morphAttributesPosition[ i ]; + const morphTargetsRelative = this.morphTargetsRelative; - data.object.zoom = this.zoom; - data.object.left = this.left; - data.object.right = this.right; - data.object.top = this.top; - data.object.bottom = this.bottom; - data.object.near = this.near; - data.object.far = this.far; + for ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) { - if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + _vector$7.fromBufferAttribute( morphAttribute, j ); - return data; + if ( morphTargetsRelative ) { - } + _offset.fromBufferAttribute( position, j ); + _vector$7.add( _offset ); - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author greggman / http://games.greggman.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author tschw - */ + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$7 ) ); - function PerspectiveCamera( fov, aspect, near, far ) { + } - Camera.call( this ); + } - this.type = 'PerspectiveCamera'; + } - this.fov = fov !== undefined ? fov : 50; - this.zoom = 1; + this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); - this.near = near !== undefined ? near : 0.1; - this.far = far !== undefined ? far : 2000; - this.focus = 10; + if ( isNaN( this.boundingSphere.radius ) ) { - this.aspect = aspect !== undefined ? aspect : 1; - this.view = null; + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); - this.filmGauge = 35; // width of the film (default in millimeters) - this.filmOffset = 0; // horizontal film offset (same unit as gauge) + } - this.updateProjectionMatrix(); + } - } + } - PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ), { + computeTangents() { - constructor: PerspectiveCamera, + const index = this.index; + const attributes = this.attributes; - isPerspectiveCamera: true, + // based on http://www.terathon.com/code/tangent.html + // (per vertex tangents) - copy: function ( source, recursive ) { + if ( index === null || + attributes.position === undefined || + attributes.normal === undefined || + attributes.uv === undefined ) { - Camera.prototype.copy.call( this, source, recursive ); + console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' ); + return; - this.fov = source.fov; - this.zoom = source.zoom; + } - this.near = source.near; - this.far = source.far; - this.focus = source.focus; + const indices = index.array; + const positions = attributes.position.array; + const normals = attributes.normal.array; + const uvs = attributes.uv.array; - this.aspect = source.aspect; - this.view = source.view === null ? null : Object.assign( {}, source.view ); + const nVertices = positions.length / 3; - this.filmGauge = source.filmGauge; - this.filmOffset = source.filmOffset; + if ( this.hasAttribute( 'tangent' ) === false ) { - return this; + this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) ); - }, + } - /** - * Sets the FOV by focal length in respect to the current .filmGauge. - * - * The default film gauge is 35, so that the focal length can be specified for - * a 35mm (full frame) camera. - * - * Values for focal length and film gauge must have the same unit. - */ - setFocalLength: function ( focalLength ) { + const tangents = this.getAttribute( 'tangent' ).array; - // see http://www.bobatkins.com/photography/technical/field_of_view.html - var vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; + const tan1 = [], tan2 = []; - this.fov = _Math.RAD2DEG * 2 * Math.atan( vExtentSlope ); - this.updateProjectionMatrix(); + for ( let i = 0; i < nVertices; i ++ ) { - }, + tan1[ i ] = new Vector3(); + tan2[ i ] = new Vector3(); - /** - * Calculates the focal length from the current .fov and .filmGauge. - */ - getFocalLength: function () { + } - var vExtentSlope = Math.tan( _Math.DEG2RAD * 0.5 * this.fov ); + const vA = new Vector3(), + vB = new Vector3(), + vC = new Vector3(), - return 0.5 * this.getFilmHeight() / vExtentSlope; + uvA = new Vector2(), + uvB = new Vector2(), + uvC = new Vector2(), - }, + sdir = new Vector3(), + tdir = new Vector3(); - getEffectiveFOV: function () { + function handleTriangle( a, b, c ) { - return _Math.RAD2DEG * 2 * Math.atan( - Math.tan( _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom ); + vA.fromArray( positions, a * 3 ); + vB.fromArray( positions, b * 3 ); + vC.fromArray( positions, c * 3 ); - }, + uvA.fromArray( uvs, a * 2 ); + uvB.fromArray( uvs, b * 2 ); + uvC.fromArray( uvs, c * 2 ); - getFilmWidth: function () { + vB.sub( vA ); + vC.sub( vA ); - // film not completely covered in portrait format (aspect < 1) - return this.filmGauge * Math.min( this.aspect, 1 ); + uvB.sub( uvA ); + uvC.sub( uvA ); - }, + const r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y ); - getFilmHeight: function () { + // silently ignore degenerate uv triangles having coincident or colinear vertices - // film not completely covered in landscape format (aspect > 1) - return this.filmGauge / Math.max( this.aspect, 1 ); + if ( ! isFinite( r ) ) return; - }, + sdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r ); + tdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r ); - /** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and - * the monitors are in grid like this - * - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - * - * then for each monitor you would call it like this - * - * var w = 1920; - * var h = 1080; - * var fullWidth = w * 3; - * var fullHeight = h * 2; - * - * --A-- - * camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * --B-- - * camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * --C-- - * camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * --D-- - * camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * --E-- - * camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * --F-- - * camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); - * - * Note there is no reason monitors have to be the same size or in a grid. - */ - setViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) { + tan1[ a ].add( sdir ); + tan1[ b ].add( sdir ); + tan1[ c ].add( sdir ); - this.aspect = fullWidth / fullHeight; + tan2[ a ].add( tdir ); + tan2[ b ].add( tdir ); + tan2[ c ].add( tdir ); - this.view = { - fullWidth: fullWidth, - fullHeight: fullHeight, - offsetX: x, - offsetY: y, - width: width, - height: height - }; + } - this.updateProjectionMatrix(); + let groups = this.groups; - }, + if ( groups.length === 0 ) { - clearViewOffset: function () { + groups = [ { + start: 0, + count: indices.length + } ]; - this.view = null; - this.updateProjectionMatrix(); + } - }, + for ( let i = 0, il = groups.length; i < il; ++ i ) { - updateProjectionMatrix: function () { + const group = groups[ i ]; - var near = this.near, - top = near * Math.tan( - _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom, - height = 2 * top, - width = this.aspect * height, - left = - 0.5 * width, - view = this.view; + const start = group.start; + const count = group.count; - if ( view !== null ) { + for ( let j = start, jl = start + count; j < jl; j += 3 ) { - var fullWidth = view.fullWidth, - fullHeight = view.fullHeight; + handleTriangle( + indices[ j + 0 ], + indices[ j + 1 ], + indices[ j + 2 ] + ); - left += view.offsetX * width / fullWidth; - top -= view.offsetY * height / fullHeight; - width *= view.width / fullWidth; - height *= view.height / fullHeight; + } } - var skew = this.filmOffset; - if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - - this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); + const tmp = new Vector3(), tmp2 = new Vector3(); + const n = new Vector3(), n2 = new Vector3(); - }, + function handleVertex( v ) { - toJSON: function ( meta ) { + n.fromArray( normals, v * 3 ); + n2.copy( n ); - var data = Object3D.prototype.toJSON.call( this, meta ); + const t = tan1[ v ]; - data.object.fov = this.fov; - data.object.zoom = this.zoom; + // Gram-Schmidt orthogonalize - data.object.near = this.near; - data.object.far = this.far; - data.object.focus = this.focus; + tmp.copy( t ); + tmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize(); - data.object.aspect = this.aspect; + // Calculate handedness - if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + tmp2.crossVectors( n2, t ); + const test = tmp2.dot( tan2[ v ] ); + const w = ( test < 0.0 ) ? - 1.0 : 1.0; - data.object.filmGauge = this.filmGauge; - data.object.filmOffset = this.filmOffset; + tangents[ v * 4 ] = tmp.x; + tangents[ v * 4 + 1 ] = tmp.y; + tangents[ v * 4 + 2 ] = tmp.z; + tangents[ v * 4 + 3 ] = w; - return data; + } - } + for ( let i = 0, il = groups.length; i < il; ++ i ) { - } ); + const group = groups[ i ]; - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + const start = group.start; + const count = group.count; - function Face3( a, b, c, normal, color, materialIndex ) { + for ( let j = start, jl = start + count; j < jl; j += 3 ) { - this.a = a; - this.b = b; - this.c = c; + handleVertex( indices[ j + 0 ] ); + handleVertex( indices[ j + 1 ] ); + handleVertex( indices[ j + 2 ] ); - this.normal = ( normal && normal.isVector3 ) ? normal : new Vector3(); - this.vertexNormals = Array.isArray( normal ) ? normal : []; + } - this.color = ( color && color.isColor ) ? color : new Color(); - this.vertexColors = Array.isArray( color ) ? color : []; + } - this.materialIndex = materialIndex !== undefined ? materialIndex : 0; + } - } + computeVertexNormals() { - Object.assign( Face3.prototype, { + const index = this.index; + const positionAttribute = this.getAttribute( 'position' ); - clone: function () { + if ( positionAttribute !== undefined ) { - return new this.constructor().copy( this ); + let normalAttribute = this.getAttribute( 'normal' ); - }, + if ( normalAttribute === undefined ) { - copy: function ( source ) { + normalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 ); + this.setAttribute( 'normal', normalAttribute ); - this.a = source.a; - this.b = source.b; - this.c = source.c; + } else { - this.normal.copy( source.normal ); - this.color.copy( source.color ); + // reset existing normals to zero - this.materialIndex = source.materialIndex; + for ( let i = 0, il = normalAttribute.count; i < il; i ++ ) { - for ( var i = 0, il = source.vertexNormals.length; i < il; i ++ ) { + normalAttribute.setXYZ( i, 0, 0, 0 ); - this.vertexNormals[ i ] = source.vertexNormals[ i ].clone(); + } - } + } - for ( var i = 0, il = source.vertexColors.length; i < il; i ++ ) { + const pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); + const nA = new Vector3(), nB = new Vector3(), nC = new Vector3(); + const cb = new Vector3(), ab = new Vector3(); - this.vertexColors[ i ] = source.vertexColors[ i ].clone(); + // indexed elements - } + if ( index ) { - return this; + for ( let i = 0, il = index.count; i < il; i += 3 ) { - } + const vA = index.getX( i + 0 ); + const vB = index.getX( i + 1 ); + const vC = index.getX( i + 2 ); - } ); + pA.fromBufferAttribute( positionAttribute, vA ); + pB.fromBufferAttribute( positionAttribute, vB ); + pC.fromBufferAttribute( positionAttribute, vC ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author bhouston / http://clara.io - */ + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); - var count = 0; - function GeometryIdCount() { return count++; } + nA.fromBufferAttribute( normalAttribute, vA ); + nB.fromBufferAttribute( normalAttribute, vB ); + nC.fromBufferAttribute( normalAttribute, vC ); - function Geometry() { + nA.add( cb ); + nB.add( cb ); + nC.add( cb ); - Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + normalAttribute.setXYZ( vA, nA.x, nA.y, nA.z ); + normalAttribute.setXYZ( vB, nB.x, nB.y, nB.z ); + normalAttribute.setXYZ( vC, nC.x, nC.y, nC.z ); - this.uuid = _Math.generateUUID(); + } - this.name = ''; - this.type = 'Geometry'; + } else { - this.vertices = []; - this.colors = []; - this.faces = []; - this.faceVertexUvs = [[]]; + // non-indexed elements (unconnected triangle soup) - this.morphTargets = []; - this.morphNormals = []; + for ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) { - this.skinWeights = []; - this.skinIndices = []; + pA.fromBufferAttribute( positionAttribute, i + 0 ); + pB.fromBufferAttribute( positionAttribute, i + 1 ); + pC.fromBufferAttribute( positionAttribute, i + 2 ); - this.lineDistances = []; + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); - this.boundingBox = null; - this.boundingSphere = null; + normalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z ); + normalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z ); + normalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z ); - // update flags + } - this.elementsNeedUpdate = false; - this.verticesNeedUpdate = false; - this.uvsNeedUpdate = false; - this.normalsNeedUpdate = false; - this.colorsNeedUpdate = false; - this.lineDistancesNeedUpdate = false; - this.groupsNeedUpdate = false; + } - } + this.normalizeNormals(); - Object.assign( Geometry.prototype, EventDispatcher.prototype, { + normalAttribute.needsUpdate = true; - isGeometry: true, + } - applyMatrix: function ( matrix ) { + } - var normalMatrix = new Matrix3().getNormalMatrix( matrix ); + merge() { // @deprecated, r144 - for ( var i = 0, il = this.vertices.length; i < il; i ++ ) { + console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' ); + return this; - var vertex = this.vertices[ i ]; - vertex.applyMatrix4( matrix ); + } - } + normalizeNormals() { - for ( var i = 0, il = this.faces.length; i < il; i ++ ) { + const normals = this.attributes.normal; - var face = this.faces[ i ]; - face.normal.applyMatrix3( normalMatrix ).normalize(); + for ( let i = 0, il = normals.count; i < il; i ++ ) { - for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { + _vector$7.fromBufferAttribute( normals, i ); - face.vertexNormals[ j ].applyMatrix3( normalMatrix ).normalize(); + _vector$7.normalize(); - } + normals.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z ); } - if ( this.boundingBox !== null ) { + } - this.computeBoundingBox(); + toNonIndexed() { - } + function convertBufferAttribute( attribute, indices ) { - if ( this.boundingSphere !== null ) { + const array = attribute.array; + const itemSize = attribute.itemSize; + const normalized = attribute.normalized; - this.computeBoundingSphere(); + const array2 = new array.constructor( indices.length * itemSize ); - } + let index = 0, index2 = 0; - this.verticesNeedUpdate = true; - this.normalsNeedUpdate = true; + for ( let i = 0, l = indices.length; i < l; i ++ ) { - return this; + if ( attribute.isInterleavedBufferAttribute ) { - }, + index = indices[ i ] * attribute.data.stride + attribute.offset; - rotateX: function () { + } else { - // rotate geometry around world x-axis + index = indices[ i ] * itemSize; - var m1 = new Matrix4(); + } - return function rotateX( angle ) { + for ( let j = 0; j < itemSize; j ++ ) { - m1.makeRotationX( angle ); + array2[ index2 ++ ] = array[ index ++ ]; - this.applyMatrix( m1 ); + } - return this; + } - }; + return new BufferAttribute( array2, itemSize, normalized ); - }(), + } - rotateY: function () { + // - // rotate geometry around world y-axis + if ( this.index === null ) { - var m1 = new Matrix4(); + console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' ); + return this; - return function rotateY( angle ) { + } - m1.makeRotationY( angle ); + const geometry2 = new BufferGeometry(); - this.applyMatrix( m1 ); + const indices = this.index.array; + const attributes = this.attributes; - return this; + // attributes - }; + for ( const name in attributes ) { - }(), + const attribute = attributes[ name ]; - rotateZ: function () { + const newAttribute = convertBufferAttribute( attribute, indices ); - // rotate geometry around world z-axis + geometry2.setAttribute( name, newAttribute ); - var m1 = new Matrix4(); + } - return function rotateZ( angle ) { + // morph attributes - m1.makeRotationZ( angle ); + const morphAttributes = this.morphAttributes; - this.applyMatrix( m1 ); + for ( const name in morphAttributes ) { - return this; + const morphArray = []; + const morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes - }; + for ( let i = 0, il = morphAttribute.length; i < il; i ++ ) { - }(), + const attribute = morphAttribute[ i ]; - translate: function () { + const newAttribute = convertBufferAttribute( attribute, indices ); - // translate geometry + morphArray.push( newAttribute ); - var m1 = new Matrix4(); + } - return function translate( x, y, z ) { + geometry2.morphAttributes[ name ] = morphArray; - m1.makeTranslation( x, y, z ); + } - this.applyMatrix( m1 ); + geometry2.morphTargetsRelative = this.morphTargetsRelative; - return this; + // groups - }; + const groups = this.groups; - }(), + for ( let i = 0, l = groups.length; i < l; i ++ ) { - scale: function () { + const group = groups[ i ]; + geometry2.addGroup( group.start, group.count, group.materialIndex ); - // scale geometry + } - var m1 = new Matrix4(); + return geometry2; - return function scale( x, y, z ) { + } - m1.makeScale( x, y, z ); + toJSON() { - this.applyMatrix( m1 ); + const data = { + metadata: { + version: 4.6, + type: 'BufferGeometry', + generator: 'BufferGeometry.toJSON' + } + }; - return this; + // standard BufferGeometry serialization - }; + data.uuid = this.uuid; + data.type = this.type; + if ( this.name !== '' ) data.name = this.name; + if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData; - }(), + if ( this.parameters !== undefined ) { - lookAt: function () { + const parameters = this.parameters; - var obj = new Object3D(); + for ( const key in parameters ) { - return function lookAt( vector ) { + if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; - obj.lookAt( vector ); + } - obj.updateMatrix(); + return data; - this.applyMatrix( obj.matrix ); + } - }; + // for simplicity the code assumes attributes are not shared across geometries, see #15811 - }(), + data.data = { attributes: {} }; - fromBufferGeometry: function ( geometry ) { + const index = this.index; - var scope = this; + if ( index !== null ) { - var indices = geometry.index !== null ? geometry.index.array : undefined; - var attributes = geometry.attributes; + data.data.index = { + type: index.array.constructor.name, + array: Array.prototype.slice.call( index.array ) + }; - var positions = attributes.position.array; - var normals = attributes.normal !== undefined ? attributes.normal.array : undefined; - var colors = attributes.color !== undefined ? attributes.color.array : undefined; - var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined; - var uvs2 = attributes.uv2 !== undefined ? attributes.uv2.array : undefined; + } - if ( uvs2 !== undefined ) this.faceVertexUvs[ 1 ] = []; + const attributes = this.attributes; - var tempNormals = []; - var tempUVs = []; - var tempUVs2 = []; + for ( const key in attributes ) { - for ( var i = 0, j = 0; i < positions.length; i += 3, j += 2 ) { + const attribute = attributes[ key ]; - scope.vertices.push( new Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ) ); + data.data.attributes[ key ] = attribute.toJSON( data.data ); - if ( normals !== undefined ) { + } - tempNormals.push( new Vector3( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] ) ); + const morphAttributes = {}; + let hasMorphAttributes = false; - } + for ( const key in this.morphAttributes ) { - if ( colors !== undefined ) { + const attributeArray = this.morphAttributes[ key ]; - scope.colors.push( new Color( colors[ i ], colors[ i + 1 ], colors[ i + 2 ] ) ); + const array = []; - } + for ( let i = 0, il = attributeArray.length; i < il; i ++ ) { - if ( uvs !== undefined ) { + const attribute = attributeArray[ i ]; - tempUVs.push( new Vector2( uvs[ j ], uvs[ j + 1 ] ) ); + array.push( attribute.toJSON( data.data ) ); } - if ( uvs2 !== undefined ) { + if ( array.length > 0 ) { - tempUVs2.push( new Vector2( uvs2[ j ], uvs2[ j + 1 ] ) ); + morphAttributes[ key ] = array; + + hasMorphAttributes = true; } } - function addFace( a, b, c, materialIndex ) { + if ( hasMorphAttributes ) { - var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : []; - var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : []; + data.data.morphAttributes = morphAttributes; + data.data.morphTargetsRelative = this.morphTargetsRelative; - var face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex ); + } - scope.faces.push( face ); + const groups = this.groups; - if ( uvs !== undefined ) { + if ( groups.length > 0 ) { - scope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ].clone(), tempUVs[ b ].clone(), tempUVs[ c ].clone() ] ); + data.data.groups = JSON.parse( JSON.stringify( groups ) ); - } + } - if ( uvs2 !== undefined ) { + const boundingSphere = this.boundingSphere; - scope.faceVertexUvs[ 1 ].push( [ tempUVs2[ a ].clone(), tempUVs2[ b ].clone(), tempUVs2[ c ].clone() ] ); + if ( boundingSphere !== null ) { - } + data.data.boundingSphere = { + center: boundingSphere.center.toArray(), + radius: boundingSphere.radius + }; } - var groups = geometry.groups; + return data; - if ( groups.length > 0 ) { + } - for ( var i = 0; i < groups.length; i ++ ) { + clone() { - var group = groups[ i ]; + return new this.constructor().copy( this ); - var start = group.start; - var count = group.count; + } - for ( var j = start, jl = start + count; j < jl; j += 3 ) { + copy( source ) { - if ( indices !== undefined ) { + // reset - addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex ); + this.index = null; + this.attributes = {}; + this.morphAttributes = {}; + this.groups = []; + this.boundingBox = null; + this.boundingSphere = null; - } else { + // used for storing cloned, shared data - addFace( j, j + 1, j + 2, group.materialIndex ); + const data = {}; - } + // name - } + this.name = source.name; - } + // index - } else { + const index = source.index; - if ( indices !== undefined ) { + if ( index !== null ) { - for ( var i = 0; i < indices.length; i += 3 ) { + this.setIndex( index.clone( data ) ); - addFace( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] ); + } - } + // attributes - } else { + const attributes = source.attributes; - for ( var i = 0; i < positions.length / 3; i += 3 ) { + for ( const name in attributes ) { - addFace( i, i + 1, i + 2 ); + const attribute = attributes[ name ]; + this.setAttribute( name, attribute.clone( data ) ); - } + } + + // morph attributes + + const morphAttributes = source.morphAttributes; + + for ( const name in morphAttributes ) { + + const array = []; + const morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes + + for ( let i = 0, l = morphAttribute.length; i < l; i ++ ) { + + array.push( morphAttribute[ i ].clone( data ) ); } + this.morphAttributes[ name ] = array; + } - this.computeFaceNormals(); + this.morphTargetsRelative = source.morphTargetsRelative; - if ( geometry.boundingBox !== null ) { + // groups + + const groups = source.groups; + + for ( let i = 0, l = groups.length; i < l; i ++ ) { - this.boundingBox = geometry.boundingBox.clone(); + const group = groups[ i ]; + this.addGroup( group.start, group.count, group.materialIndex ); } - if ( geometry.boundingSphere !== null ) { + // bounding box + + const boundingBox = source.boundingBox; + + if ( boundingBox !== null ) { - this.boundingSphere = geometry.boundingSphere.clone(); + this.boundingBox = boundingBox.clone(); } - return this; + // bounding sphere - }, + const boundingSphere = source.boundingSphere; - center: function () { + if ( boundingSphere !== null ) { - this.computeBoundingBox(); + this.boundingSphere = boundingSphere.clone(); - var offset = this.boundingBox.getCenter().negate(); + } - this.translate( offset.x, offset.y, offset.z ); + // draw range - return offset; + this.drawRange.start = source.drawRange.start; + this.drawRange.count = source.drawRange.count; - }, + // user data - normalize: function () { + this.userData = source.userData; - this.computeBoundingSphere(); + return this; - var center = this.boundingSphere.center; - var radius = this.boundingSphere.radius; + } - var s = radius === 0 ? 1 : 1.0 / radius; + dispose() { - var matrix = new Matrix4(); - matrix.set( - s, 0, 0, - s * center.x, - 0, s, 0, - s * center.y, - 0, 0, s, - s * center.z, - 0, 0, 0, 1 - ); + this.dispatchEvent( { type: 'dispose' } ); - this.applyMatrix( matrix ); + } - return this; + } - }, + const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4(); + const _ray$3 = /*@__PURE__*/ new Ray(); + const _sphere$5 = /*@__PURE__*/ new Sphere(); + const _sphereHitAt = /*@__PURE__*/ new Vector3(); - computeFaceNormals: function () { + const _vA$1 = /*@__PURE__*/ new Vector3(); + const _vB$1 = /*@__PURE__*/ new Vector3(); + const _vC$1 = /*@__PURE__*/ new Vector3(); - var cb = new Vector3(), ab = new Vector3(); + const _tempA = /*@__PURE__*/ new Vector3(); + const _morphA = /*@__PURE__*/ new Vector3(); - for ( var f = 0, fl = this.faces.length; f < fl; f ++ ) { + const _uvA$1 = /*@__PURE__*/ new Vector2(); + const _uvB$1 = /*@__PURE__*/ new Vector2(); + const _uvC$1 = /*@__PURE__*/ new Vector2(); - var face = this.faces[ f ]; + const _normalA = /*@__PURE__*/ new Vector3(); + const _normalB = /*@__PURE__*/ new Vector3(); + const _normalC = /*@__PURE__*/ new Vector3(); - var vA = this.vertices[ face.a ]; - var vB = this.vertices[ face.b ]; - var vC = this.vertices[ face.c ]; + const _intersectionPoint = /*@__PURE__*/ new Vector3(); + const _intersectionPointWorld = /*@__PURE__*/ new Vector3(); - cb.subVectors( vC, vB ); - ab.subVectors( vA, vB ); - cb.cross( ab ); + class Mesh extends Object3D { - cb.normalize(); + constructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) { - face.normal.copy( cb ); + super(); - } + this.isMesh = true; - }, + this.type = 'Mesh'; - computeVertexNormals: function ( areaWeighted ) { + this.geometry = geometry; + this.material = material; - if ( areaWeighted === undefined ) areaWeighted = true; + this.updateMorphTargets(); - var v, vl, f, fl, face, vertices; + } + + copy( source, recursive ) { - vertices = new Array( this.vertices.length ); + super.copy( source, recursive ); - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { + if ( source.morphTargetInfluences !== undefined ) { - vertices[ v ] = new Vector3(); + this.morphTargetInfluences = source.morphTargetInfluences.slice(); } - if ( areaWeighted ) { + if ( source.morphTargetDictionary !== undefined ) { - // vertex normals weighted by triangle areas - // http://www.iquilezles.org/www/articles/normals/normals.htm + this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary ); - var vA, vB, vC; - var cb = new Vector3(), ab = new Vector3(); + } - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + this.material = source.material; + this.geometry = source.geometry; - face = this.faces[ f ]; + return this; - vA = this.vertices[ face.a ]; - vB = this.vertices[ face.b ]; - vC = this.vertices[ face.c ]; + } - cb.subVectors( vC, vB ); - ab.subVectors( vA, vB ); - cb.cross( ab ); + updateMorphTargets() { - vertices[ face.a ].add( cb ); - vertices[ face.b ].add( cb ); - vertices[ face.c ].add( cb ); + const geometry = this.geometry; - } + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); - } else { + if ( keys.length > 0 ) { - this.computeFaceNormals(); + const morphAttribute = morphAttributes[ keys[ 0 ] ]; - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + if ( morphAttribute !== undefined ) { - face = this.faces[ f ]; + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; - vertices[ face.a ].add( face.normal ); - vertices[ face.b ].add( face.normal ); - vertices[ face.c ].add( face.normal ); + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - } + const name = morphAttribute[ m ].name || String( m ); - } + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { + } - vertices[ v ].normalize(); + } } - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + } - face = this.faces[ f ]; + getVertexPosition( index, target ) { - var vertexNormals = face.vertexNormals; + const geometry = this.geometry; + const position = geometry.attributes.position; + const morphPosition = geometry.morphAttributes.position; + const morphTargetsRelative = geometry.morphTargetsRelative; - if ( vertexNormals.length === 3 ) { + target.fromBufferAttribute( position, index ); - vertexNormals[ 0 ].copy( vertices[ face.a ] ); - vertexNormals[ 1 ].copy( vertices[ face.b ] ); - vertexNormals[ 2 ].copy( vertices[ face.c ] ); + const morphInfluences = this.morphTargetInfluences; - } else { + if ( morphPosition && morphInfluences ) { - vertexNormals[ 0 ] = vertices[ face.a ].clone(); - vertexNormals[ 1 ] = vertices[ face.b ].clone(); - vertexNormals[ 2 ] = vertices[ face.c ].clone(); + _morphA.set( 0, 0, 0 ); - } + for ( let i = 0, il = morphPosition.length; i < il; i ++ ) { - } + const influence = morphInfluences[ i ]; + const morphAttribute = morphPosition[ i ]; - if ( this.faces.length > 0 ) { + if ( influence === 0 ) continue; - this.normalsNeedUpdate = true; + _tempA.fromBufferAttribute( morphAttribute, index ); - } + if ( morphTargetsRelative ) { - }, + _morphA.addScaledVector( _tempA, influence ); - computeFlatVertexNormals: function () { + } else { - var f, fl, face; + _morphA.addScaledVector( _tempA.sub( target ), influence ); - this.computeFaceNormals(); + } - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + } - face = this.faces[ f ]; + target.add( _morphA ); - var vertexNormals = face.vertexNormals; + } - if ( vertexNormals.length === 3 ) { + return target; - vertexNormals[ 0 ].copy( face.normal ); - vertexNormals[ 1 ].copy( face.normal ); - vertexNormals[ 2 ].copy( face.normal ); + } - } else { + raycast( raycaster, intersects ) { - vertexNormals[ 0 ] = face.normal.clone(); - vertexNormals[ 1 ] = face.normal.clone(); - vertexNormals[ 2 ] = face.normal.clone(); + const geometry = this.geometry; + const material = this.material; + const matrixWorld = this.matrixWorld; - } + if ( material === undefined ) return; - } + // test with bounding sphere in world space - if ( this.faces.length > 0 ) { + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - this.normalsNeedUpdate = true; + _sphere$5.copy( geometry.boundingSphere ); + _sphere$5.applyMatrix4( matrixWorld ); - } + // check distance from ray origin to bounding sphere - }, + _ray$3.copy( raycaster.ray ).recast( raycaster.near ); - computeMorphNormals: function () { + if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) { - var i, il, f, fl, face; + if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return; - // save original normals - // - create temp variables on first access - // otherwise just copy (for faster repeated calls) + if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return; - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + } - face = this.faces[ f ]; + // convert ray to local space of mesh - if ( ! face.__originalFaceNormal ) { + _inverseMatrix$3.copy( matrixWorld ).invert(); + _ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 ); - face.__originalFaceNormal = face.normal.clone(); + // test with bounding box in local space - } else { + if ( geometry.boundingBox !== null ) { - face.__originalFaceNormal.copy( face.normal ); + if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return; - } + } - if ( ! face.__originalVertexNormals ) face.__originalVertexNormals = []; + // test for intersections with geometry - for ( i = 0, il = face.vertexNormals.length; i < il; i ++ ) { + this._computeIntersections( raycaster, intersects, _ray$3 ); - if ( ! face.__originalVertexNormals[ i ] ) { + } - face.__originalVertexNormals[ i ] = face.vertexNormals[ i ].clone(); + _computeIntersections( raycaster, intersects, rayLocalSpace ) { - } else { + let intersection; - face.__originalVertexNormals[ i ].copy( face.vertexNormals[ i ] ); + const geometry = this.geometry; + const material = this.material; - } + const index = geometry.index; + const position = geometry.attributes.position; + const uv = geometry.attributes.uv; + const uv1 = geometry.attributes.uv1; + const normal = geometry.attributes.normal; + const groups = geometry.groups; + const drawRange = geometry.drawRange; - } + if ( index !== null ) { - } + // indexed buffer geometry - // use temp geometry to compute face and vertex normals for each morph + if ( Array.isArray( material ) ) { - var tmpGeo = new Geometry(); - tmpGeo.faces = this.faces; + for ( let i = 0, il = groups.length; i < il; i ++ ) { - for ( i = 0, il = this.morphTargets.length; i < il; i ++ ) { + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; - // create on first access + const start = Math.max( group.start, drawRange.start ); + const end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) ); - if ( ! this.morphNormals[ i ] ) { + for ( let j = start, jl = end; j < jl; j += 3 ) { - this.morphNormals[ i ] = {}; - this.morphNormals[ i ].faceNormals = []; - this.morphNormals[ i ].vertexNormals = []; + const a = index.getX( j ); + const b = index.getX( j + 1 ); + const c = index.getX( j + 2 ); - var dstNormalsFace = this.morphNormals[ i ].faceNormals; - var dstNormalsVertex = this.morphNormals[ i ].vertexNormals; + intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c ); - var faceNormal, vertexNormals; + if ( intersection ) { - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + intersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics + intersection.face.materialIndex = group.materialIndex; + intersects.push( intersection ); - faceNormal = new Vector3(); - vertexNormals = { a: new Vector3(), b: new Vector3(), c: new Vector3() }; + } - dstNormalsFace.push( faceNormal ); - dstNormalsVertex.push( vertexNormals ); + } } - } + } else { - var morphNormals = this.morphNormals[ i ]; + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); - // set vertices to morph target + for ( let i = start, il = end; i < il; i += 3 ) { - tmpGeo.vertices = this.morphTargets[ i ].vertices; + const a = index.getX( i ); + const b = index.getX( i + 1 ); + const c = index.getX( i + 2 ); - // compute morph normals + intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c ); - tmpGeo.computeFaceNormals(); - tmpGeo.computeVertexNormals(); + if ( intersection ) { - // store morph normals + intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics + intersects.push( intersection ); - var faceNormal, vertexNormals; + } - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + } - face = this.faces[ f ]; + } - faceNormal = morphNormals.faceNormals[ f ]; - vertexNormals = morphNormals.vertexNormals[ f ]; + } else if ( position !== undefined ) { - faceNormal.copy( face.normal ); + // non-indexed buffer geometry - vertexNormals.a.copy( face.vertexNormals[ 0 ] ); - vertexNormals.b.copy( face.vertexNormals[ 1 ] ); - vertexNormals.c.copy( face.vertexNormals[ 2 ] ); + if ( Array.isArray( material ) ) { - } + for ( let i = 0, il = groups.length; i < il; i ++ ) { - } + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; - // restore original normals + const start = Math.max( group.start, drawRange.start ); + const end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) ); - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + for ( let j = start, jl = end; j < jl; j += 3 ) { - face = this.faces[ f ]; + const a = j; + const b = j + 1; + const c = j + 2; - face.normal = face.__originalFaceNormal; - face.vertexNormals = face.__originalVertexNormals; + intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c ); - } + if ( intersection ) { - }, + intersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics + intersection.face.materialIndex = group.materialIndex; + intersects.push( intersection ); - computeLineDistances: function () { + } - var d = 0; - var vertices = this.vertices; + } - for ( var i = 0, il = vertices.length; i < il; i ++ ) { + } - if ( i > 0 ) { + } else { - d += vertices[ i ].distanceTo( vertices[ i - 1 ] ); + const start = Math.max( 0, drawRange.start ); + const end = Math.min( position.count, ( drawRange.start + drawRange.count ) ); - } + for ( let i = start, il = end; i < il; i += 3 ) { - this.lineDistances[ i ] = d; + const a = i; + const b = i + 1; + const c = i + 2; - } + intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c ); - }, + if ( intersection ) { - computeBoundingBox: function () { + intersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics + intersects.push( intersection ); - if ( this.boundingBox === null ) { + } - this.boundingBox = new Box3(); + } - } + } - this.boundingBox.setFromPoints( this.vertices ); + } - }, + } - computeBoundingSphere: function () { + } - if ( this.boundingSphere === null ) { + function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) { - this.boundingSphere = new Sphere(); + let intersect; - } + if ( material.side === BackSide ) { - this.boundingSphere.setFromPoints( this.vertices ); + intersect = ray.intersectTriangle( pC, pB, pA, true, point ); - }, + } else { - merge: function ( geometry, matrix, materialIndexOffset ) { + intersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point ); - if ( ! ( geometry && geometry.isGeometry ) ) { + } - console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry ); - return; + if ( intersect === null ) return null; - } + _intersectionPointWorld.copy( point ); + _intersectionPointWorld.applyMatrix4( object.matrixWorld ); - var normalMatrix, - vertexOffset = this.vertices.length, - vertices1 = this.vertices, - vertices2 = geometry.vertices, - faces1 = this.faces, - faces2 = geometry.faces, - uvs1 = this.faceVertexUvs[ 0 ], - uvs2 = geometry.faceVertexUvs[ 0 ], - colors1 = this.colors, - colors2 = geometry.colors; + const distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld ); - if ( materialIndexOffset === undefined ) materialIndexOffset = 0; + if ( distance < raycaster.near || distance > raycaster.far ) return null; - if ( matrix !== undefined ) { + return { + distance: distance, + point: _intersectionPointWorld.clone(), + object: object + }; - normalMatrix = new Matrix3().getNormalMatrix( matrix ); + } - } + function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) { - // vertices + object.getVertexPosition( a, _vA$1 ); + object.getVertexPosition( b, _vB$1 ); + object.getVertexPosition( c, _vC$1 ); - for ( var i = 0, il = vertices2.length; i < il; i ++ ) { + const intersection = checkIntersection( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint ); - var vertex = vertices2[ i ]; + if ( intersection ) { - var vertexCopy = vertex.clone(); + if ( uv ) { - if ( matrix !== undefined ) vertexCopy.applyMatrix4( matrix ); + _uvA$1.fromBufferAttribute( uv, a ); + _uvB$1.fromBufferAttribute( uv, b ); + _uvC$1.fromBufferAttribute( uv, c ); - vertices1.push( vertexCopy ); + intersection.uv = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() ); } - // colors + if ( uv1 ) { - for ( var i = 0, il = colors2.length; i < il; i ++ ) { + _uvA$1.fromBufferAttribute( uv1, a ); + _uvB$1.fromBufferAttribute( uv1, b ); + _uvC$1.fromBufferAttribute( uv1, c ); - colors1.push( colors2[ i ].clone() ); + intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() ); + intersection.uv2 = intersection.uv1; // @deprecated, r152 } - // faces - - for ( i = 0, il = faces2.length; i < il; i ++ ) { + if ( normal ) { - var face = faces2[ i ], faceCopy, normal, color, - faceVertexNormals = face.vertexNormals, - faceVertexColors = face.vertexColors; + _normalA.fromBufferAttribute( normal, a ); + _normalB.fromBufferAttribute( normal, b ); + _normalC.fromBufferAttribute( normal, c ); - faceCopy = new Face3( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset ); - faceCopy.normal.copy( face.normal ); + intersection.normal = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _normalA, _normalB, _normalC, new Vector3() ); - if ( normalMatrix !== undefined ) { + if ( intersection.normal.dot( ray.direction ) > 0 ) { - faceCopy.normal.applyMatrix3( normalMatrix ).normalize(); + intersection.normal.multiplyScalar( - 1 ); } - for ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) { + } + + const face = { + a: a, + b: b, + c: c, + normal: new Vector3(), + materialIndex: 0 + }; - normal = faceVertexNormals[ j ].clone(); + Triangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal ); - if ( normalMatrix !== undefined ) { + intersection.face = face; - normal.applyMatrix3( normalMatrix ).normalize(); + } - } + return intersection; - faceCopy.vertexNormals.push( normal ); + } - } + class BoxGeometry extends BufferGeometry { - faceCopy.color.copy( face.color ); + constructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) { - for ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) { + super(); - color = faceVertexColors[ j ]; - faceCopy.vertexColors.push( color.clone() ); + this.type = 'BoxGeometry'; - } + this.parameters = { + width: width, + height: height, + depth: depth, + widthSegments: widthSegments, + heightSegments: heightSegments, + depthSegments: depthSegments + }; - faceCopy.materialIndex = face.materialIndex + materialIndexOffset; + const scope = this; - faces1.push( faceCopy ); + // segments - } + widthSegments = Math.floor( widthSegments ); + heightSegments = Math.floor( heightSegments ); + depthSegments = Math.floor( depthSegments ); - // uvs + // buffers - for ( i = 0, il = uvs2.length; i < il; i ++ ) { + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - var uv = uvs2[ i ], uvCopy = []; + // helper variables - if ( uv === undefined ) { + let numberOfVertices = 0; + let groupStart = 0; - continue; + // build each side of the box geometry - } + buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px + buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx + buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py + buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny + buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz + buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz - for ( var j = 0, jl = uv.length; j < jl; j ++ ) { + // build geometry - uvCopy.push( uv[ j ].clone() ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) { - uvs1.push( uvCopy ); + const segmentWidth = width / gridX; + const segmentHeight = height / gridY; - } + const widthHalf = width / 2; + const heightHalf = height / 2; + const depthHalf = depth / 2; - }, + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; - mergeMesh: function ( mesh ) { + let vertexCounter = 0; + let groupCount = 0; - if ( ! ( mesh && mesh.isMesh ) ) { + const vector = new Vector3(); - console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh ); - return; + // generate vertices, normals and uvs - } + for ( let iy = 0; iy < gridY1; iy ++ ) { - mesh.matrixAutoUpdate && mesh.updateMatrix(); + const y = iy * segmentHeight - heightHalf; - this.merge( mesh.geometry, mesh.matrix ); + for ( let ix = 0; ix < gridX1; ix ++ ) { - }, + const x = ix * segmentWidth - widthHalf; - /* - * Checks for duplicate vertices with hashmap. - * Duplicated vertices are removed - * and faces' vertices are updated. - */ + // set values to correct vector component - mergeVertices: function () { + vector[ u ] = x * udir; + vector[ v ] = y * vdir; + vector[ w ] = depthHalf; - var verticesMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique) - var unique = [], changes = []; + // now apply vector to vertex buffer - var v, key; - var precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 - var precision = Math.pow( 10, precisionPoints ); - var i, il, face; - var indices, j, jl; + vertices.push( vector.x, vector.y, vector.z ); - for ( i = 0, il = this.vertices.length; i < il; i ++ ) { + // set values to correct vector component - v = this.vertices[ i ]; - key = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision ); + vector[ u ] = 0; + vector[ v ] = 0; + vector[ w ] = depth > 0 ? 1 : - 1; - if ( verticesMap[ key ] === undefined ) { + // now apply vector to normal buffer - verticesMap[ key ] = i; - unique.push( this.vertices[ i ] ); - changes[ i ] = unique.length - 1; + normals.push( vector.x, vector.y, vector.z ); - } else { + // uvs - //console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]); - changes[ i ] = changes[ verticesMap[ key ] ]; + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); - } + // counters - } + vertexCounter += 1; + + } + } - // if faces are completely degenerate after merging vertices, we - // have to remove them from the geometry. - var faceIndicesToRemove = []; + // indices - for ( i = 0, il = this.faces.length; i < il; i ++ ) { + // 1. you need three indices to draw a single face + // 2. a single segment consists of two faces + // 3. so we need to generate six (2*3) indices per segment - face = this.faces[ i ]; + for ( let iy = 0; iy < gridY; iy ++ ) { - face.a = changes[ face.a ]; - face.b = changes[ face.b ]; - face.c = changes[ face.c ]; + for ( let ix = 0; ix < gridX; ix ++ ) { - indices = [ face.a, face.b, face.c ]; + const a = numberOfVertices + ix + gridX1 * iy; + const b = numberOfVertices + ix + gridX1 * ( iy + 1 ); + const c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); + const d = numberOfVertices + ( ix + 1 ) + gridX1 * iy; - // if any duplicate vertices are found in a Face3 - // we have to remove the face as nothing can be saved - for ( var n = 0; n < 3; n ++ ) { + // faces - if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) { + indices.push( a, b, d ); + indices.push( b, c, d ); - faceIndicesToRemove.push( i ); - break; + // increase counter + + groupCount += 6; } } - } - - for ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) { + // add a group to the geometry. this will ensure multi material support - var idx = faceIndicesToRemove[ i ]; + scope.addGroup( groupStart, groupCount, materialIndex ); - this.faces.splice( idx, 1 ); + // calculate new start value for groups - for ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) { + groupStart += groupCount; - this.faceVertexUvs[ j ].splice( idx, 1 ); + // update total number of vertices - } + numberOfVertices += vertexCounter; } - // Use unique set of vertices + } - var diff = this.vertices.length - unique.length; - this.vertices = unique; - return diff; + copy( source ) { - }, + super.copy( source ); - sortFacesByMaterialIndex: function () { + this.parameters = Object.assign( {}, source.parameters ); - var faces = this.faces; - var length = faces.length; + return this; - // tag faces + } - for ( var i = 0; i < length; i ++ ) { + static fromJSON( data ) { - faces[ i ]._id = i; + return new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments ); - } + } - // sort faces + } - function materialIndexSort( a, b ) { + /** + * Uniform Utilities + */ - return a.materialIndex - b.materialIndex; + function cloneUniforms( src ) { - } + const dst = {}; - faces.sort( materialIndexSort ); + for ( const u in src ) { - // sort uvs + dst[ u ] = {}; - var uvs1 = this.faceVertexUvs[ 0 ]; - var uvs2 = this.faceVertexUvs[ 1 ]; + for ( const p in src[ u ] ) { - var newUvs1, newUvs2; + const property = src[ u ][ p ]; - if ( uvs1 && uvs1.length === length ) newUvs1 = []; - if ( uvs2 && uvs2.length === length ) newUvs2 = []; + if ( property && ( property.isColor || + property.isMatrix3 || property.isMatrix4 || + property.isVector2 || property.isVector3 || property.isVector4 || + property.isTexture || property.isQuaternion ) ) { - for ( var i = 0; i < length; i ++ ) { + if ( property.isRenderTargetTexture ) { - var id = faces[ i ]._id; + console.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' ); + dst[ u ][ p ] = null; - if ( newUvs1 ) newUvs1.push( uvs1[ id ] ); - if ( newUvs2 ) newUvs2.push( uvs2[ id ] ); + } else { - } + dst[ u ][ p ] = property.clone(); - if ( newUvs1 ) this.faceVertexUvs[ 0 ] = newUvs1; - if ( newUvs2 ) this.faceVertexUvs[ 1 ] = newUvs2; + } - }, + } else if ( Array.isArray( property ) ) { - toJSON: function () { + dst[ u ][ p ] = property.slice(); - var data = { - metadata: { - version: 4.5, - type: 'Geometry', - generator: 'Geometry.toJSON' - } - }; + } else { - // standard Geometry serialization + dst[ u ][ p ] = property; - data.uuid = this.uuid; - data.type = this.type; - if ( this.name !== '' ) data.name = this.name; + } - if ( this.parameters !== undefined ) { + } - var parameters = this.parameters; + } - for ( var key in parameters ) { + return dst; - if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; + } - } + function mergeUniforms( uniforms ) { - return data; + const merged = {}; - } + for ( let u = 0; u < uniforms.length; u ++ ) { - var vertices = []; + const tmp = cloneUniforms( uniforms[ u ] ); - for ( var i = 0; i < this.vertices.length; i ++ ) { + for ( const p in tmp ) { - var vertex = this.vertices[ i ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + merged[ p ] = tmp[ p ]; } - var faces = []; - var normals = []; - var normalsHash = {}; - var colors = []; - var colorsHash = {}; - var uvs = []; - var uvsHash = {}; + } - for ( var i = 0; i < this.faces.length; i ++ ) { + return merged; - var face = this.faces[ i ]; + } - var hasMaterial = true; - var hasFaceUv = false; // deprecated - var hasFaceVertexUv = this.faceVertexUvs[ 0 ][ i ] !== undefined; - var hasFaceNormal = face.normal.length() > 0; - var hasFaceVertexNormal = face.vertexNormals.length > 0; - var hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1; - var hasFaceVertexColor = face.vertexColors.length > 0; + function cloneUniformsGroups( src ) { - var faceType = 0; + const dst = []; - faceType = setBit( faceType, 0, 0 ); // isQuad - faceType = setBit( faceType, 1, hasMaterial ); - faceType = setBit( faceType, 2, hasFaceUv ); - faceType = setBit( faceType, 3, hasFaceVertexUv ); - faceType = setBit( faceType, 4, hasFaceNormal ); - faceType = setBit( faceType, 5, hasFaceVertexNormal ); - faceType = setBit( faceType, 6, hasFaceColor ); - faceType = setBit( faceType, 7, hasFaceVertexColor ); + for ( let u = 0; u < src.length; u ++ ) { - faces.push( faceType ); - faces.push( face.a, face.b, face.c ); - faces.push( face.materialIndex ); + dst.push( src[ u ].clone() ); - if ( hasFaceVertexUv ) { + } - var faceVertexUvs = this.faceVertexUvs[ 0 ][ i ]; + return dst; - faces.push( - getUvIndex( faceVertexUvs[ 0 ] ), - getUvIndex( faceVertexUvs[ 1 ] ), - getUvIndex( faceVertexUvs[ 2 ] ) - ); + } - } + function getUnlitUniformColorSpace( renderer ) { - if ( hasFaceNormal ) { + if ( renderer.getRenderTarget() === null ) { - faces.push( getNormalIndex( face.normal ) ); + // https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398 + return renderer.outputColorSpace; - } + } - if ( hasFaceVertexNormal ) { + return LinearSRGBColorSpace; - var vertexNormals = face.vertexNormals; + } - faces.push( - getNormalIndex( vertexNormals[ 0 ] ), - getNormalIndex( vertexNormals[ 1 ] ), - getNormalIndex( vertexNormals[ 2 ] ) - ); + // Legacy - } + const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms }; - if ( hasFaceColor ) { + var default_vertex = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"; - faces.push( getColorIndex( face.color ) ); + var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; - } + class ShaderMaterial extends Material { - if ( hasFaceVertexColor ) { + constructor( parameters ) { - var vertexColors = face.vertexColors; + super(); - faces.push( - getColorIndex( vertexColors[ 0 ] ), - getColorIndex( vertexColors[ 1 ] ), - getColorIndex( vertexColors[ 2 ] ) - ); + this.isShaderMaterial = true; - } + this.type = 'ShaderMaterial'; - } + this.defines = {}; + this.uniforms = {}; + this.uniformsGroups = []; - function setBit( value, position, enabled ) { + this.vertexShader = default_vertex; + this.fragmentShader = default_fragment; - return enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position ) ); + this.linewidth = 1; - } + this.wireframe = false; + this.wireframeLinewidth = 1; - function getNormalIndex( normal ) { + this.fog = false; // set to use scene fog + this.lights = false; // set to use scene lights + this.clipping = false; // set to use user-defined clipping planes - var hash = normal.x.toString() + normal.y.toString() + normal.z.toString(); + this.forceSinglePass = true; + + this.extensions = { + derivatives: false, // set to use derivatives + fragDepth: false, // set to use fragment depth values + drawBuffers: false, // set to use draw buffers + shaderTextureLOD: false // set to use shader texture LOD + }; - if ( normalsHash[ hash ] !== undefined ) { + // When rendered geometry doesn't include these attributes but the material does, + // use these default values in WebGL. This avoids errors when buffer data is missing. + this.defaultAttributeValues = { + 'color': [ 1, 1, 1 ], + 'uv': [ 0, 0 ], + 'uv1': [ 0, 0 ] + }; - return normalsHash[ hash ]; + this.index0AttributeName = undefined; + this.uniformsNeedUpdate = false; - } + this.glslVersion = null; - normalsHash[ hash ] = normals.length / 3; - normals.push( normal.x, normal.y, normal.z ); + if ( parameters !== undefined ) { - return normalsHash[ hash ]; + this.setValues( parameters ); } - function getColorIndex( color ) { + } - var hash = color.r.toString() + color.g.toString() + color.b.toString(); + copy( source ) { - if ( colorsHash[ hash ] !== undefined ) { + super.copy( source ); - return colorsHash[ hash ]; + this.fragmentShader = source.fragmentShader; + this.vertexShader = source.vertexShader; - } + this.uniforms = cloneUniforms( source.uniforms ); + this.uniformsGroups = cloneUniformsGroups( source.uniformsGroups ); - colorsHash[ hash ] = colors.length; - colors.push( color.getHex() ); + this.defines = Object.assign( {}, source.defines ); - return colorsHash[ hash ]; + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; - } + this.fog = source.fog; + this.lights = source.lights; + this.clipping = source.clipping; - function getUvIndex( uv ) { + this.extensions = Object.assign( {}, source.extensions ); - var hash = uv.x.toString() + uv.y.toString(); + this.glslVersion = source.glslVersion; - if ( uvsHash[ hash ] !== undefined ) { + return this; - return uvsHash[ hash ]; + } - } + toJSON( meta ) { - uvsHash[ hash ] = uvs.length / 2; - uvs.push( uv.x, uv.y ); + const data = super.toJSON( meta ); - return uvsHash[ hash ]; + data.glslVersion = this.glslVersion; + data.uniforms = {}; - } + for ( const name in this.uniforms ) { - data.data = {}; + const uniform = this.uniforms[ name ]; + const value = uniform.value; - data.data.vertices = vertices; - data.data.normals = normals; - if ( colors.length > 0 ) data.data.colors = colors; - if ( uvs.length > 0 ) data.data.uvs = [ uvs ]; // temporal backward compatibility - data.data.faces = faces; + if ( value && value.isTexture ) { - return data; - - }, + data.uniforms[ name ] = { + type: 't', + value: value.toJSON( meta ).uuid + }; - clone: function () { + } else if ( value && value.isColor ) { - /* - // Handle primitives + data.uniforms[ name ] = { + type: 'c', + value: value.getHex() + }; - var parameters = this.parameters; + } else if ( value && value.isVector2 ) { - if ( parameters !== undefined ) { + data.uniforms[ name ] = { + type: 'v2', + value: value.toArray() + }; - var values = []; + } else if ( value && value.isVector3 ) { - for ( var key in parameters ) { + data.uniforms[ name ] = { + type: 'v3', + value: value.toArray() + }; - values.push( parameters[ key ] ); + } else if ( value && value.isVector4 ) { - } + data.uniforms[ name ] = { + type: 'v4', + value: value.toArray() + }; - var geometry = Object.create( this.constructor.prototype ); - this.constructor.apply( geometry, values ); - return geometry; + } else if ( value && value.isMatrix3 ) { - } + data.uniforms[ name ] = { + type: 'm3', + value: value.toArray() + }; - return new this.constructor().copy( this ); - */ + } else if ( value && value.isMatrix4 ) { - return new Geometry().copy( this ); + data.uniforms[ name ] = { + type: 'm4', + value: value.toArray() + }; - }, + } else { - copy: function ( source ) { + data.uniforms[ name ] = { + value: value + }; - var i, il, j, jl, k, kl; + // note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far - // reset + } - this.vertices = []; - this.colors = []; - this.faces = []; - this.faceVertexUvs = [[]]; - this.morphTargets = []; - this.morphNormals = []; - this.skinWeights = []; - this.skinIndices = []; - this.lineDistances = []; - this.boundingBox = null; - this.boundingSphere = null; + } - // name + if ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines; - this.name = source.name; + data.vertexShader = this.vertexShader; + data.fragmentShader = this.fragmentShader; - // vertices + data.lights = this.lights; + data.clipping = this.clipping; - var vertices = source.vertices; + const extensions = {}; - for ( i = 0, il = vertices.length; i < il; i ++ ) { + for ( const key in this.extensions ) { - this.vertices.push( vertices[ i ].clone() ); + if ( this.extensions[ key ] === true ) extensions[ key ] = true; } - // colors + if ( Object.keys( extensions ).length > 0 ) data.extensions = extensions; - var colors = source.colors; + return data; - for ( i = 0, il = colors.length; i < il; i ++ ) { + } - this.colors.push( colors[ i ].clone() ); + } - } + class Camera extends Object3D { - // faces + constructor() { - var faces = source.faces; + super(); - for ( i = 0, il = faces.length; i < il; i ++ ) { + this.isCamera = true; - this.faces.push( faces[ i ].clone() ); + this.type = 'Camera'; - } + this.matrixWorldInverse = new Matrix4(); - // face vertex uvs + this.projectionMatrix = new Matrix4(); + this.projectionMatrixInverse = new Matrix4(); - for ( i = 0, il = source.faceVertexUvs.length; i < il; i ++ ) { + this.coordinateSystem = WebGLCoordinateSystem; - var faceVertexUvs = source.faceVertexUvs[ i ]; + } - if ( this.faceVertexUvs[ i ] === undefined ) { + copy( source, recursive ) { - this.faceVertexUvs[ i ] = []; + super.copy( source, recursive ); - } + this.matrixWorldInverse.copy( source.matrixWorldInverse ); - for ( j = 0, jl = faceVertexUvs.length; j < jl; j ++ ) { + this.projectionMatrix.copy( source.projectionMatrix ); + this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); - var uvs = faceVertexUvs[ j ], uvsCopy = []; + this.coordinateSystem = source.coordinateSystem; - for ( k = 0, kl = uvs.length; k < kl; k ++ ) { + return this; - var uv = uvs[ k ]; + } - uvsCopy.push( uv.clone() ); + getWorldDirection( target ) { - } + this.updateWorldMatrix( true, false ); - this.faceVertexUvs[ i ].push( uvsCopy ); + const e = this.matrixWorld.elements; - } + return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize(); - } + } - // morph targets + updateMatrixWorld( force ) { - var morphTargets = source.morphTargets; + super.updateMatrixWorld( force ); - for ( i = 0, il = morphTargets.length; i < il; i ++ ) { + this.matrixWorldInverse.copy( this.matrixWorld ).invert(); - var morphTarget = {}; - morphTarget.name = morphTargets[ i ].name; + } - // vertices + updateWorldMatrix( updateParents, updateChildren ) { - if ( morphTargets[ i ].vertices !== undefined ) { + super.updateWorldMatrix( updateParents, updateChildren ); - morphTarget.vertices = []; + this.matrixWorldInverse.copy( this.matrixWorld ).invert(); - for ( j = 0, jl = morphTargets[ i ].vertices.length; j < jl; j ++ ) { + } - morphTarget.vertices.push( morphTargets[ i ].vertices[ j ].clone() ); + clone() { - } + return new this.constructor().copy( this ); - } + } - // normals + } - if ( morphTargets[ i ].normals !== undefined ) { + class PerspectiveCamera extends Camera { - morphTarget.normals = []; + constructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) { - for ( j = 0, jl = morphTargets[ i ].normals.length; j < jl; j ++ ) { + super(); - morphTarget.normals.push( morphTargets[ i ].normals[ j ].clone() ); + this.isPerspectiveCamera = true; - } + this.type = 'PerspectiveCamera'; - } + this.fov = fov; + this.zoom = 1; - this.morphTargets.push( morphTarget ); + this.near = near; + this.far = far; + this.focus = 10; - } + this.aspect = aspect; + this.view = null; - // morph normals + this.filmGauge = 35; // width of the film (default in millimeters) + this.filmOffset = 0; // horizontal film offset (same unit as gauge) - var morphNormals = source.morphNormals; + this.updateProjectionMatrix(); - for ( i = 0, il = morphNormals.length; i < il; i ++ ) { + } - var morphNormal = {}; + copy( source, recursive ) { - // vertex normals + super.copy( source, recursive ); - if ( morphNormals[ i ].vertexNormals !== undefined ) { + this.fov = source.fov; + this.zoom = source.zoom; - morphNormal.vertexNormals = []; + this.near = source.near; + this.far = source.far; + this.focus = source.focus; - for ( j = 0, jl = morphNormals[ i ].vertexNormals.length; j < jl; j ++ ) { + this.aspect = source.aspect; + this.view = source.view === null ? null : Object.assign( {}, source.view ); - var srcVertexNormal = morphNormals[ i ].vertexNormals[ j ]; - var destVertexNormal = {}; + this.filmGauge = source.filmGauge; + this.filmOffset = source.filmOffset; - destVertexNormal.a = srcVertexNormal.a.clone(); - destVertexNormal.b = srcVertexNormal.b.clone(); - destVertexNormal.c = srcVertexNormal.c.clone(); + return this; - morphNormal.vertexNormals.push( destVertexNormal ); + } - } + /** + * Sets the FOV by focal length in respect to the current .filmGauge. + * + * The default film gauge is 35, so that the focal length can be specified for + * a 35mm (full frame) camera. + * + * Values for focal length and film gauge must have the same unit. + */ + setFocalLength( focalLength ) { - } + /** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */ + const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; - // face normals + this.fov = RAD2DEG * 2 * Math.atan( vExtentSlope ); + this.updateProjectionMatrix(); - if ( morphNormals[ i ].faceNormals !== undefined ) { + } - morphNormal.faceNormals = []; + /** + * Calculates the focal length from the current .fov and .filmGauge. + */ + getFocalLength() { - for ( j = 0, jl = morphNormals[ i ].faceNormals.length; j < jl; j ++ ) { + const vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov ); - morphNormal.faceNormals.push( morphNormals[ i ].faceNormals[ j ].clone() ); + return 0.5 * this.getFilmHeight() / vExtentSlope; - } + } - } + getEffectiveFOV() { - this.morphNormals.push( morphNormal ); + return RAD2DEG * 2 * Math.atan( + Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom ); - } + } - // skin weights + getFilmWidth() { - var skinWeights = source.skinWeights; + // film not completely covered in portrait format (aspect < 1) + return this.filmGauge * Math.min( this.aspect, 1 ); - for ( i = 0, il = skinWeights.length; i < il; i ++ ) { + } - this.skinWeights.push( skinWeights[ i ].clone() ); + getFilmHeight() { - } + // film not completely covered in landscape format (aspect > 1) + return this.filmGauge / Math.max( this.aspect, 1 ); + + } - // skin indices + /** + * Sets an offset in a larger frustum. This is useful for multi-window or + * multi-monitor/multi-machine setups. + * + * For example, if you have 3x2 monitors and each monitor is 1920x1080 and + * the monitors are in grid like this + * + * +---+---+---+ + * | A | B | C | + * +---+---+---+ + * | D | E | F | + * +---+---+---+ + * + * then for each monitor you would call it like this + * + * const w = 1920; + * const h = 1080; + * const fullWidth = w * 3; + * const fullHeight = h * 2; + * + * --A-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); + * --B-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); + * --C-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); + * --D-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); + * --E-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); + * --F-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); + * + * Note there is no reason monitors have to be the same size or in a grid. + */ + setViewOffset( fullWidth, fullHeight, x, y, width, height ) { - var skinIndices = source.skinIndices; + this.aspect = fullWidth / fullHeight; - for ( i = 0, il = skinIndices.length; i < il; i ++ ) { + if ( this.view === null ) { - this.skinIndices.push( skinIndices[ i ].clone() ); + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; } - // line distances + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x; + this.view.offsetY = y; + this.view.width = width; + this.view.height = height; - var lineDistances = source.lineDistances; + this.updateProjectionMatrix(); - for ( i = 0, il = lineDistances.length; i < il; i ++ ) { + } - this.lineDistances.push( lineDistances[ i ] ); + clearViewOffset() { - } + if ( this.view !== null ) { - // bounding box + this.view.enabled = false; - var boundingBox = source.boundingBox; + } - if ( boundingBox !== null ) { + this.updateProjectionMatrix(); - this.boundingBox = boundingBox.clone(); + } - } + updateProjectionMatrix() { - // bounding sphere + const near = this.near; + let top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom; + let height = 2 * top; + let width = this.aspect * height; + let left = - 0.5 * width; + const view = this.view; - var boundingSphere = source.boundingSphere; + if ( this.view !== null && this.view.enabled ) { - if ( boundingSphere !== null ) { + const fullWidth = view.fullWidth, + fullHeight = view.fullHeight; - this.boundingSphere = boundingSphere.clone(); + left += view.offsetX * width / fullWidth; + top -= view.offsetY * height / fullHeight; + width *= view.width / fullWidth; + height *= view.height / fullHeight; } - // update flags + const skew = this.filmOffset; + if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - this.elementsNeedUpdate = source.elementsNeedUpdate; - this.verticesNeedUpdate = source.verticesNeedUpdate; - this.uvsNeedUpdate = source.uvsNeedUpdate; - this.normalsNeedUpdate = source.normalsNeedUpdate; - this.colorsNeedUpdate = source.colorsNeedUpdate; - this.lineDistancesNeedUpdate = source.lineDistancesNeedUpdate; - this.groupsNeedUpdate = source.groupsNeedUpdate; + this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem ); - return this; + this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); - }, + } - dispose: function () { + toJSON( meta ) { - this.dispatchEvent( { type: 'dispose' } ); + const data = super.toJSON( meta ); - } + data.object.fov = this.fov; + data.object.zoom = this.zoom; - } ); + data.object.near = this.near; + data.object.far = this.far; + data.object.focus = this.focus; - /** - * @author mrdoob / http://mrdoob.com/ - */ + data.object.aspect = this.aspect; - function BufferAttribute( array, itemSize, normalized ) { + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); - if ( Array.isArray( array ) ) { + data.object.filmGauge = this.filmGauge; + data.object.filmOffset = this.filmOffset; - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + return data; } - this.uuid = _Math.generateUUID(); - this.name = ''; + } - this.array = array; - this.itemSize = itemSize; - this.count = array !== undefined ? array.length / itemSize : 0; - this.normalized = normalized === true; + const fov = - 90; // negative fov is not an error + const aspect = 1; - this.dynamic = false; - this.updateRange = { offset: 0, count: - 1 }; + class CubeCamera extends Object3D { - this.onUploadCallback = function () {}; + constructor( near, far, renderTarget ) { - this.version = 0; + super(); - } + this.type = 'CubeCamera'; - Object.defineProperty( BufferAttribute.prototype, 'needsUpdate', { + this.renderTarget = renderTarget; + this.coordinateSystem = null; - set: function ( value ) { + const cameraPX = new PerspectiveCamera( fov, aspect, near, far ); + cameraPX.layers = this.layers; + this.add( cameraPX ); - if ( value === true ) this.version ++; + const cameraNX = new PerspectiveCamera( fov, aspect, near, far ); + cameraNX.layers = this.layers; + this.add( cameraNX ); - } + const cameraPY = new PerspectiveCamera( fov, aspect, near, far ); + cameraPY.layers = this.layers; + this.add( cameraPY ); - } ); + const cameraNY = new PerspectiveCamera( fov, aspect, near, far ); + cameraNY.layers = this.layers; + this.add( cameraNY ); - Object.assign( BufferAttribute.prototype, { + const cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraPZ.layers = this.layers; + this.add( cameraPZ ); - isBufferAttribute: true, + const cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraNZ.layers = this.layers; + this.add( cameraNZ ); - setArray: function ( array ) { + } - if ( Array.isArray( array ) ) { + updateCoordinateSystem() { - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + const coordinateSystem = this.coordinateSystem; - } + const cameras = this.children.concat(); - this.count = array !== undefined ? array.length / this.itemSize : 0; - this.array = array; + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras; - }, + for ( const camera of cameras ) this.remove( camera ); - setDynamic: function ( value ) { + if ( coordinateSystem === WebGLCoordinateSystem ) { - this.dynamic = value; + cameraPX.up.set( 0, 1, 0 ); + cameraPX.lookAt( 1, 0, 0 ); - return this; + cameraNX.up.set( 0, 1, 0 ); + cameraNX.lookAt( - 1, 0, 0 ); - }, + cameraPY.up.set( 0, 0, - 1 ); + cameraPY.lookAt( 0, 1, 0 ); - copy: function ( source ) { + cameraNY.up.set( 0, 0, 1 ); + cameraNY.lookAt( 0, - 1, 0 ); - this.array = new source.array.constructor( source.array ); - this.itemSize = source.itemSize; - this.count = source.count; - this.normalized = source.normalized; + cameraPZ.up.set( 0, 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); - this.dynamic = source.dynamic; + cameraNZ.up.set( 0, 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); - return this; + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { - }, + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( - 1, 0, 0 ); - copyAt: function ( index1, attribute, index2 ) { + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( 1, 0, 0 ); - index1 *= this.itemSize; - index2 *= attribute.itemSize; + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( 0, 1, 0 ); - for ( var i = 0, l = this.itemSize; i < l; i ++ ) { + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( 0, - 1, 0 ); - this.array[ index1 + i ] = attribute.array[ index2 + i ]; + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); - } + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); - return this; + } else { - }, + throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem ); - copyArray: function ( array ) { + } - this.array.set( array ); + for ( const camera of cameras ) { - return this; + this.add( camera ); - }, + camera.updateMatrixWorld(); - copyColorsArray: function ( colors ) { + } - var array = this.array, offset = 0; + } - for ( var i = 0, l = colors.length; i < l; i ++ ) { + update( renderer, scene ) { - var color = colors[ i ]; + if ( this.parent === null ) this.updateMatrixWorld(); - if ( color === undefined ) { + const renderTarget = this.renderTarget; - console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i ); - color = new Color(); + if ( this.coordinateSystem !== renderer.coordinateSystem ) { - } + this.coordinateSystem = renderer.coordinateSystem; - array[ offset ++ ] = color.r; - array[ offset ++ ] = color.g; - array[ offset ++ ] = color.b; + this.updateCoordinateSystem(); } - return this; - - }, + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children; - copyIndicesArray: function ( indices ) { + const currentRenderTarget = renderer.getRenderTarget(); - var array = this.array, offset = 0; + const currentToneMapping = renderer.toneMapping; + const currentXrEnabled = renderer.xr.enabled; - for ( var i = 0, l = indices.length; i < l; i ++ ) { + renderer.toneMapping = NoToneMapping; + renderer.xr.enabled = false; - var index = indices[ i ]; + const generateMipmaps = renderTarget.texture.generateMipmaps; - array[ offset ++ ] = index.a; - array[ offset ++ ] = index.b; - array[ offset ++ ] = index.c; + renderTarget.texture.generateMipmaps = false; - } + renderer.setRenderTarget( renderTarget, 0 ); + renderer.render( scene, cameraPX ); - return this; + renderer.setRenderTarget( renderTarget, 1 ); + renderer.render( scene, cameraNX ); - }, + renderer.setRenderTarget( renderTarget, 2 ); + renderer.render( scene, cameraPY ); - copyVector2sArray: function ( vectors ) { + renderer.setRenderTarget( renderTarget, 3 ); + renderer.render( scene, cameraNY ); - var array = this.array, offset = 0; + renderer.setRenderTarget( renderTarget, 4 ); + renderer.render( scene, cameraPZ ); - for ( var i = 0, l = vectors.length; i < l; i ++ ) { + renderTarget.texture.generateMipmaps = generateMipmaps; - var vector = vectors[ i ]; + renderer.setRenderTarget( renderTarget, 5 ); + renderer.render( scene, cameraNZ ); - if ( vector === undefined ) { + renderer.setRenderTarget( currentRenderTarget ); - console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i ); - vector = new Vector2(); + renderer.toneMapping = currentToneMapping; + renderer.xr.enabled = currentXrEnabled; - } + renderTarget.texture.needsPMREMUpdate = true; - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; + } - } + } - return this; + class CubeTexture extends Texture { - }, + constructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ) { - copyVector3sArray: function ( vectors ) { + images = images !== undefined ? images : []; + mapping = mapping !== undefined ? mapping : CubeReflectionMapping; - var array = this.array, offset = 0; + super( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ); - for ( var i = 0, l = vectors.length; i < l; i ++ ) { + this.isCubeTexture = true; - var vector = vectors[ i ]; + this.flipY = false; - if ( vector === undefined ) { + } - console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i ); - vector = new Vector3(); + get images() { - } + return this.image; - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; - array[ offset ++ ] = vector.z; + } - } + set images( value ) { - return this; + this.image = value; - }, + } - copyVector4sArray: function ( vectors ) { + } - var array = this.array, offset = 0; + class WebGLCubeRenderTarget extends WebGLRenderTarget { - for ( var i = 0, l = vectors.length; i < l; i ++ ) { + constructor( size = 1, options = {} ) { - var vector = vectors[ i ]; + super( size, size, options ); - if ( vector === undefined ) { + this.isWebGLCubeRenderTarget = true; - console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i ); - vector = new Vector4(); + const image = { width: size, height: size, depth: 1 }; + const images = [ image, image, image, image, image, image ]; - } + if ( options.encoding !== undefined ) { - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; - array[ offset ++ ] = vector.z; - array[ offset ++ ] = vector.w; + // @deprecated, r152 + warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' ); + options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace; } - return this; + this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace ); - }, + // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js) + // in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words, + // in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly. - set: function ( value, offset ) { + // three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped + // and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture + // as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures). - if ( offset === undefined ) offset = 0; + this.texture.isRenderTargetTexture = true; - this.array.set( value, offset ); + this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; + this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; - return this; + } - }, + fromEquirectangularTexture( renderer, texture ) { - getX: function ( index ) { + this.texture.type = texture.type; + this.texture.colorSpace = texture.colorSpace; - return this.array[ index * this.itemSize ]; + this.texture.generateMipmaps = texture.generateMipmaps; + this.texture.minFilter = texture.minFilter; + this.texture.magFilter = texture.magFilter; - }, + const shader = { - setX: function ( index, x ) { + uniforms: { + tEquirect: { value: null }, + }, - this.array[ index * this.itemSize ] = x; + vertexShader: /* glsl */` - return this; + varying vec3 vWorldDirection; - }, + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - getY: function ( index ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - return this.array[ index * this.itemSize + 1 ]; + } - }, + void main() { - setY: function ( index, y ) { + vWorldDirection = transformDirection( position, modelMatrix ); - this.array[ index * this.itemSize + 1 ] = y; + #include + #include - return this; + } + `, - }, + fragmentShader: /* glsl */` - getZ: function ( index ) { + uniform sampler2D tEquirect; - return this.array[ index * this.itemSize + 2 ]; + varying vec3 vWorldDirection; - }, + #include - setZ: function ( index, z ) { + void main() { - this.array[ index * this.itemSize + 2 ] = z; + vec3 direction = normalize( vWorldDirection ); - return this; + vec2 sampleUV = equirectUv( direction ); - }, + gl_FragColor = texture2D( tEquirect, sampleUV ); - getW: function ( index ) { + } + ` + }; - return this.array[ index * this.itemSize + 3 ]; + const geometry = new BoxGeometry( 5, 5, 5 ); - }, + const material = new ShaderMaterial( { - setW: function ( index, w ) { + name: 'CubemapFromEquirect', - this.array[ index * this.itemSize + 3 ] = w; + uniforms: cloneUniforms( shader.uniforms ), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader, + side: BackSide, + blending: NoBlending - return this; + } ); - }, + material.uniforms.tEquirect.value = texture; - setXY: function ( index, x, y ) { + const mesh = new Mesh( geometry, material ); - index *= this.itemSize; + const currentMinFilter = texture.minFilter; - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; + // Avoid blurred poles + if ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter; - return this; + const camera = new CubeCamera( 1, 10, this ); + camera.update( renderer, mesh ); - }, + texture.minFilter = currentMinFilter; - setXYZ: function ( index, x, y, z ) { + mesh.geometry.dispose(); + mesh.material.dispose(); - index *= this.itemSize; + return this; - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; - this.array[ index + 2 ] = z; + } - return this; + clear( renderer, color, depth, stencil ) { - }, + const currentRenderTarget = renderer.getRenderTarget(); - setXYZW: function ( index, x, y, z, w ) { + for ( let i = 0; i < 6; i ++ ) { - index *= this.itemSize; + renderer.setRenderTarget( this, i ); - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; - this.array[ index + 2 ] = z; - this.array[ index + 3 ] = w; + renderer.clear( color, depth, stencil ); - return this; + } - }, + renderer.setRenderTarget( currentRenderTarget ); + + } - onUpload: function ( callback ) { + } - this.onUploadCallback = callback; + const _vector1 = /*@__PURE__*/ new Vector3(); + const _vector2 = /*@__PURE__*/ new Vector3(); + const _normalMatrix = /*@__PURE__*/ new Matrix3(); - return this; + class Plane { - }, + constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) { - clone: function () { + this.isPlane = true; - return new this.constructor( this.array, this.itemSize ).copy( this ); + // normal is assumed to be normalized + + this.normal = normal; + this.constant = constant; } - } ); + set( normal, constant ) { - // + this.normal.copy( normal ); + this.constant = constant; - function Int8BufferAttribute( array, itemSize ) { + return this; - BufferAttribute.call( this, new Int8Array( array ), itemSize ); + } - } + setComponents( x, y, z, w ) { - Int8BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Int8BufferAttribute.prototype.constructor = Int8BufferAttribute; + this.normal.set( x, y, z ); + this.constant = w; + return this; - function Uint8BufferAttribute( array, itemSize ) { + } - BufferAttribute.call( this, new Uint8Array( array ), itemSize ); + setFromNormalAndCoplanarPoint( normal, point ) { - } + this.normal.copy( normal ); + this.constant = - point.dot( this.normal ); - Uint8BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Uint8BufferAttribute.prototype.constructor = Uint8BufferAttribute; + return this; + } - function Uint8ClampedBufferAttribute( array, itemSize ) { + setFromCoplanarPoints( a, b, c ) { - BufferAttribute.call( this, new Uint8ClampedArray( array ), itemSize ); + const normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); - } + // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? - Uint8ClampedBufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Uint8ClampedBufferAttribute.prototype.constructor = Uint8ClampedBufferAttribute; + this.setFromNormalAndCoplanarPoint( normal, a ); + return this; - function Int16BufferAttribute( array, itemSize ) { + } - BufferAttribute.call( this, new Int16Array( array ), itemSize ); + copy( plane ) { - } + this.normal.copy( plane.normal ); + this.constant = plane.constant; - Int16BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Int16BufferAttribute.prototype.constructor = Int16BufferAttribute; + return this; + } - function Uint16BufferAttribute( array, itemSize ) { + normalize() { - BufferAttribute.call( this, new Uint16Array( array ), itemSize ); + // Note: will lead to a divide by zero if the plane is invalid. - } + const inverseNormalLength = 1.0 / this.normal.length(); + this.normal.multiplyScalar( inverseNormalLength ); + this.constant *= inverseNormalLength; - Uint16BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Uint16BufferAttribute.prototype.constructor = Uint16BufferAttribute; + return this; + } - function Int32BufferAttribute( array, itemSize ) { + negate() { - BufferAttribute.call( this, new Int32Array( array ), itemSize ); + this.constant *= - 1; + this.normal.negate(); - } + return this; - Int32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Int32BufferAttribute.prototype.constructor = Int32BufferAttribute; + } + distanceToPoint( point ) { - function Uint32BufferAttribute( array, itemSize ) { + return this.normal.dot( point ) + this.constant; - BufferAttribute.call( this, new Uint32Array( array ), itemSize ); + } - } + distanceToSphere( sphere ) { - Uint32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Uint32BufferAttribute.prototype.constructor = Uint32BufferAttribute; + return this.distanceToPoint( sphere.center ) - sphere.radius; + } - function Float32BufferAttribute( array, itemSize ) { + projectPoint( point, target ) { - BufferAttribute.call( this, new Float32Array( array ), itemSize ); + return target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) ); - } + } - Float32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Float32BufferAttribute.prototype.constructor = Float32BufferAttribute; + intersectLine( line, target ) { + const direction = line.delta( _vector1 ); - function Float64BufferAttribute( array, itemSize ) { + const denominator = this.normal.dot( direction ); - BufferAttribute.call( this, new Float64Array( array ), itemSize ); + if ( denominator === 0 ) { - } + // line is coplanar, return origin + if ( this.distanceToPoint( line.start ) === 0 ) { - Float64BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); - Float64BufferAttribute.prototype.constructor = Float64BufferAttribute; + return target.copy( line.start ); - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function DirectGeometry() { + // Unsure if this is the correct method to handle this case. + return null; - this.indices = []; - this.vertices = []; - this.normals = []; - this.colors = []; - this.uvs = []; - this.uvs2 = []; + } - this.groups = []; + const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; - this.morphTargets = {}; + if ( t < 0 || t > 1 ) { - this.skinWeights = []; - this.skinIndices = []; + return null; - // this.lineDistances = []; + } - this.boundingBox = null; - this.boundingSphere = null; + return target.copy( line.start ).addScaledVector( direction, t ); - // update flags + } - this.verticesNeedUpdate = false; - this.normalsNeedUpdate = false; - this.colorsNeedUpdate = false; - this.uvsNeedUpdate = false; - this.groupsNeedUpdate = false; + intersectsLine( line ) { - } + // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. - Object.assign( DirectGeometry.prototype, { + const startSign = this.distanceToPoint( line.start ); + const endSign = this.distanceToPoint( line.end ); - computeGroups: function ( geometry ) { + return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); - var group; - var groups = []; - var materialIndex = undefined; + } - var faces = geometry.faces; + intersectsBox( box ) { - for ( var i = 0; i < faces.length; i ++ ) { + return box.intersectsPlane( this ); - var face = faces[ i ]; + } - // materials + intersectsSphere( sphere ) { - if ( face.materialIndex !== materialIndex ) { + return sphere.intersectsPlane( this ); - materialIndex = face.materialIndex; + } - if ( group !== undefined ) { + coplanarPoint( target ) { - group.count = ( i * 3 ) - group.start; - groups.push( group ); + return target.copy( this.normal ).multiplyScalar( - this.constant ); - } + } - group = { - start: i * 3, - materialIndex: materialIndex - }; + applyMatrix4( matrix, optionalNormalMatrix ) { - } + const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); - } + const referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix ); - if ( group !== undefined ) { + const normal = this.normal.applyMatrix3( normalMatrix ).normalize(); - group.count = ( i * 3 ) - group.start; - groups.push( group ); + this.constant = - referencePoint.dot( normal ); - } + return this; - this.groups = groups; + } - }, + translate( offset ) { - fromGeometry: function ( geometry ) { + this.constant -= offset.dot( this.normal ); - var faces = geometry.faces; - var vertices = geometry.vertices; - var faceVertexUvs = geometry.faceVertexUvs; + return this; - var hasFaceVertexUv = faceVertexUvs[ 0 ] && faceVertexUvs[ 0 ].length > 0; - var hasFaceVertexUv2 = faceVertexUvs[ 1 ] && faceVertexUvs[ 1 ].length > 0; + } - // morphs + equals( plane ) { - var morphTargets = geometry.morphTargets; - var morphTargetsLength = morphTargets.length; + return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); - var morphTargetsPosition; + } - if ( morphTargetsLength > 0 ) { + clone() { - morphTargetsPosition = []; + return new this.constructor().copy( this ); - for ( var i = 0; i < morphTargetsLength; i ++ ) { + } - morphTargetsPosition[ i ] = []; + } - } + const _sphere$4 = /*@__PURE__*/ new Sphere(); + const _vector$6 = /*@__PURE__*/ new Vector3(); - this.morphTargets.position = morphTargetsPosition; + class Frustum { - } + constructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) { - var morphNormals = geometry.morphNormals; - var morphNormalsLength = morphNormals.length; + this.planes = [ p0, p1, p2, p3, p4, p5 ]; - var morphTargetsNormal; + } - if ( morphNormalsLength > 0 ) { + set( p0, p1, p2, p3, p4, p5 ) { - morphTargetsNormal = []; + const planes = this.planes; - for ( var i = 0; i < morphNormalsLength; i ++ ) { + planes[ 0 ].copy( p0 ); + planes[ 1 ].copy( p1 ); + planes[ 2 ].copy( p2 ); + planes[ 3 ].copy( p3 ); + planes[ 4 ].copy( p4 ); + planes[ 5 ].copy( p5 ); - morphTargetsNormal[ i ] = []; + return this; - } + } - this.morphTargets.normal = morphTargetsNormal; + copy( frustum ) { - } + const planes = this.planes; - // skins + for ( let i = 0; i < 6; i ++ ) { - var skinIndices = geometry.skinIndices; - var skinWeights = geometry.skinWeights; + planes[ i ].copy( frustum.planes[ i ] ); - var hasSkinIndices = skinIndices.length === vertices.length; - var hasSkinWeights = skinWeights.length === vertices.length; + } - // + return this; - for ( var i = 0; i < faces.length; i ++ ) { + } - var face = faces[ i ]; + setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) { - this.vertices.push( vertices[ face.a ], vertices[ face.b ], vertices[ face.c ] ); + const planes = this.planes; + const me = m.elements; + const me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; + const me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; + const me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; + const me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; - var vertexNormals = face.vertexNormals; + planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); + planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); + planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); + planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); + planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - if ( vertexNormals.length === 3 ) { + if ( coordinateSystem === WebGLCoordinateSystem ) { - this.normals.push( vertexNormals[ 0 ], vertexNormals[ 1 ], vertexNormals[ 2 ] ); + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); - } else { + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { - var normal = face.normal; + planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); - this.normals.push( normal, normal, normal ); + } else { - } + throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem ); - var vertexColors = face.vertexColors; + } - if ( vertexColors.length === 3 ) { + return this; - this.colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] ); + } - } else { + intersectsObject( object ) { - var color = face.color; + if ( object.boundingSphere !== undefined ) { - this.colors.push( color, color, color ); + if ( object.boundingSphere === null ) object.computeBoundingSphere(); - } + _sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld ); - if ( hasFaceVertexUv === true ) { + } else { - var vertexUvs = faceVertexUvs[ 0 ][ i ]; + const geometry = object.geometry; - if ( vertexUvs !== undefined ) { + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - this.uvs.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); + _sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld ); - } else { + } - console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', i ); + return this.intersectsSphere( _sphere$4 ); - this.uvs.push( new Vector2(), new Vector2(), new Vector2() ); + } - } + intersectsSprite( sprite ) { - } + _sphere$4.center.set( 0, 0, 0 ); + _sphere$4.radius = 0.7071067811865476; + _sphere$4.applyMatrix4( sprite.matrixWorld ); - if ( hasFaceVertexUv2 === true ) { + return this.intersectsSphere( _sphere$4 ); - var vertexUvs = faceVertexUvs[ 1 ][ i ]; + } - if ( vertexUvs !== undefined ) { + intersectsSphere( sphere ) { - this.uvs2.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); + const planes = this.planes; + const center = sphere.center; + const negRadius = - sphere.radius; - } else { + for ( let i = 0; i < 6; i ++ ) { - console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', i ); + const distance = planes[ i ].distanceToPoint( center ); - this.uvs2.push( new Vector2(), new Vector2(), new Vector2() ); + if ( distance < negRadius ) { - } + return false; } - // morphs - - for ( var j = 0; j < morphTargetsLength; j ++ ) { + } - var morphTarget = morphTargets[ j ].vertices; + return true; - morphTargetsPosition[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] ); + } - } + intersectsBox( box ) { - for ( var j = 0; j < morphNormalsLength; j ++ ) { + const planes = this.planes; - var morphNormal = morphNormals[ j ].vertexNormals[ i ]; + for ( let i = 0; i < 6; i ++ ) { - morphTargetsNormal[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c ); + const plane = planes[ i ]; - } + // corner at max distance - // skins + _vector$6.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$6.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$6.z = plane.normal.z > 0 ? box.max.z : box.min.z; - if ( hasSkinIndices ) { + if ( plane.distanceToPoint( _vector$6 ) < 0 ) { - this.skinIndices.push( skinIndices[ face.a ], skinIndices[ face.b ], skinIndices[ face.c ] ); + return false; } - if ( hasSkinWeights ) { + } - this.skinWeights.push( skinWeights[ face.a ], skinWeights[ face.b ], skinWeights[ face.c ] ); + return true; - } + } - } + containsPoint( point ) { - this.computeGroups( geometry ); + const planes = this.planes; - this.verticesNeedUpdate = geometry.verticesNeedUpdate; - this.normalsNeedUpdate = geometry.normalsNeedUpdate; - this.colorsNeedUpdate = geometry.colorsNeedUpdate; - this.uvsNeedUpdate = geometry.uvsNeedUpdate; - this.groupsNeedUpdate = geometry.groupsNeedUpdate; + for ( let i = 0; i < 6; i ++ ) { - return this; + if ( planes[ i ].distanceToPoint( point ) < 0 ) { - } + return false; - } ); + } - function arrayMax( array ) { + } - if ( array.length === 0 ) return - Infinity; + return true; - var max = array[ 0 ]; + } - for ( var i = 1, l = array.length; i < l; ++ i ) { + clone() { - if ( array[ i ] > max ) max = array[ i ]; + return new this.constructor().copy( this ); } - return max; - } - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ + function WebGLAnimation() { - function BufferGeometry() { + let context = null; + let isAnimating = false; + let animationLoop = null; + let requestId = null; - Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + function onAnimationFrame( time, frame ) { - this.uuid = _Math.generateUUID(); + animationLoop( time, frame ); - this.name = ''; - this.type = 'BufferGeometry'; + requestId = context.requestAnimationFrame( onAnimationFrame ); - this.index = null; - this.attributes = {}; - - this.morphAttributes = {}; + } - this.groups = []; + return { - this.boundingBox = null; - this.boundingSphere = null; + start: function () { - this.drawRange = { start: 0, count: Infinity }; + if ( isAnimating === true ) return; + if ( animationLoop === null ) return; - } + requestId = context.requestAnimationFrame( onAnimationFrame ); - BufferGeometry.MaxIndex = 65535; + isAnimating = true; - Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, { + }, - isBufferGeometry: true, + stop: function () { - getIndex: function () { + context.cancelAnimationFrame( requestId ); - return this.index; + isAnimating = false; - }, + }, - setIndex: function ( index ) { + setAnimationLoop: function ( callback ) { - if ( Array.isArray( index ) ) { + animationLoop = callback; - this.index = new ( arrayMax( index ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 ); + }, - } else { + setContext: function ( value ) { - this.index = index; + context = value; } - }, + }; - addAttribute: function ( name, attribute ) { + } - if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) { + function WebGLAttributes( gl, capabilities ) { - console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' ); + const isWebGL2 = capabilities.isWebGL2; - this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) ); + const buffers = new WeakMap(); - return; + function createBuffer( attribute, bufferType ) { - } + const array = attribute.array; + const usage = attribute.usage; - if ( name === 'index' ) { + const buffer = gl.createBuffer(); - console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' ); - this.setIndex( attribute ); + gl.bindBuffer( bufferType, buffer ); + gl.bufferData( bufferType, array, usage ); - return; + attribute.onUploadCallback(); - } + let type; - this.attributes[ name ] = attribute; + if ( array instanceof Float32Array ) { - return this; + type = gl.FLOAT; - }, + } else if ( array instanceof Uint16Array ) { - getAttribute: function ( name ) { + if ( attribute.isFloat16BufferAttribute ) { - return this.attributes[ name ]; + if ( isWebGL2 ) { - }, + type = gl.HALF_FLOAT; - removeAttribute: function ( name ) { + } else { - delete this.attributes[ name ]; + throw new Error( 'THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.' ); - return this; + } - }, + } else { - addGroup: function ( start, count, materialIndex ) { + type = gl.UNSIGNED_SHORT; - this.groups.push( { + } - start: start, - count: count, - materialIndex: materialIndex !== undefined ? materialIndex : 0 + } else if ( array instanceof Int16Array ) { - } ); + type = gl.SHORT; - }, + } else if ( array instanceof Uint32Array ) { - clearGroups: function () { + type = gl.UNSIGNED_INT; - this.groups = []; + } else if ( array instanceof Int32Array ) { - }, + type = gl.INT; - setDrawRange: function ( start, count ) { + } else if ( array instanceof Int8Array ) { - this.drawRange.start = start; - this.drawRange.count = count; + type = gl.BYTE; - }, + } else if ( array instanceof Uint8Array ) { + + type = gl.UNSIGNED_BYTE; - applyMatrix: function ( matrix ) { + } else if ( array instanceof Uint8ClampedArray ) { - var position = this.attributes.position; + type = gl.UNSIGNED_BYTE; - if ( position !== undefined ) { + } else { - matrix.applyToBufferAttribute( position ); - position.needsUpdate = true; + throw new Error( 'THREE.WebGLAttributes: Unsupported buffer data format: ' + array ); } - var normal = this.attributes.normal; + return { + buffer: buffer, + type: type, + bytesPerElement: array.BYTES_PER_ELEMENT, + version: attribute.version + }; - if ( normal !== undefined ) { + } - var normalMatrix = new Matrix3().getNormalMatrix( matrix ); + function updateBuffer( buffer, attribute, bufferType ) { - normalMatrix.applyToBufferAttribute( normal ); - normal.needsUpdate = true; + const array = attribute.array; + const updateRange = attribute.updateRange; - } + gl.bindBuffer( bufferType, buffer ); - if ( this.boundingBox !== null ) { + if ( updateRange.count === - 1 ) { - this.computeBoundingBox(); + // Not using update ranges - } + gl.bufferSubData( bufferType, 0, array ); - if ( this.boundingSphere !== null ) { + } else { - this.computeBoundingSphere(); + if ( isWebGL2 ) { - } + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, + array, updateRange.offset, updateRange.count ); - return this; + } else { - }, + gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, + array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); - rotateX: function () { + } - // rotate geometry around world x-axis + updateRange.count = - 1; // reset range - var m1 = new Matrix4(); + } - return function rotateX( angle ) { + attribute.onUploadCallback(); - m1.makeRotationX( angle ); + } - this.applyMatrix( m1 ); + // - return this; + function get( attribute ) { - }; + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - }(), + return buffers.get( attribute ); - rotateY: function () { + } - // rotate geometry around world y-axis + function remove( attribute ) { - var m1 = new Matrix4(); + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - return function rotateY( angle ) { + const data = buffers.get( attribute ); - m1.makeRotationY( angle ); + if ( data ) { - this.applyMatrix( m1 ); + gl.deleteBuffer( data.buffer ); - return this; + buffers.delete( attribute ); - }; + } - }(), + } - rotateZ: function () { + function update( attribute, bufferType ) { - // rotate geometry around world z-axis + if ( attribute.isGLBufferAttribute ) { - var m1 = new Matrix4(); + const cached = buffers.get( attribute ); - return function rotateZ( angle ) { + if ( ! cached || cached.version < attribute.version ) { - m1.makeRotationZ( angle ); + buffers.set( attribute, { + buffer: attribute.buffer, + type: attribute.type, + bytesPerElement: attribute.elementSize, + version: attribute.version + } ); - this.applyMatrix( m1 ); + } - return this; + return; - }; + } - }(), + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - translate: function () { + const data = buffers.get( attribute ); - // translate geometry + if ( data === undefined ) { - var m1 = new Matrix4(); + buffers.set( attribute, createBuffer( attribute, bufferType ) ); - return function translate( x, y, z ) { + } else if ( data.version < attribute.version ) { - m1.makeTranslation( x, y, z ); + updateBuffer( data.buffer, attribute, bufferType ); - this.applyMatrix( m1 ); + data.version = attribute.version; - return this; + } - }; + } - }(), + return { - scale: function () { + get: get, + remove: remove, + update: update - // scale geometry + }; - var m1 = new Matrix4(); + } - return function scale( x, y, z ) { + class PlaneGeometry extends BufferGeometry { - m1.makeScale( x, y, z ); + constructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) { - this.applyMatrix( m1 ); + super(); - return this; + this.type = 'PlaneGeometry'; + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments }; - }(), + const width_half = width / 2; + const height_half = height / 2; - lookAt: function () { + const gridX = Math.floor( widthSegments ); + const gridY = Math.floor( heightSegments ); - var obj = new Object3D(); + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; - return function lookAt( vector ) { + const segment_width = width / gridX; + const segment_height = height / gridY; - obj.lookAt( vector ); + // - obj.updateMatrix(); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - this.applyMatrix( obj.matrix ); + for ( let iy = 0; iy < gridY1; iy ++ ) { - }; + const y = iy * segment_height - height_half; - }(), + for ( let ix = 0; ix < gridX1; ix ++ ) { - center: function () { + const x = ix * segment_width - width_half; - this.computeBoundingBox(); + vertices.push( x, - y, 0 ); - var offset = this.boundingBox.getCenter().negate(); + normals.push( 0, 0, 1 ); - this.translate( offset.x, offset.y, offset.z ); + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); - return offset; + } - }, + } - setFromObject: function ( object ) { + for ( let iy = 0; iy < gridY; iy ++ ) { - // console.log( 'THREE.BufferGeometry.setFromObject(). Converting', object, this ); + for ( let ix = 0; ix < gridX; ix ++ ) { - var geometry = object.geometry; + const a = ix + gridX1 * iy; + const b = ix + gridX1 * ( iy + 1 ); + const c = ( ix + 1 ) + gridX1 * ( iy + 1 ); + const d = ( ix + 1 ) + gridX1 * iy; - if ( object.isPoints || object.isLine ) { + indices.push( a, b, d ); + indices.push( b, c, d ); - var positions = new Float32BufferAttribute( geometry.vertices.length * 3, 3 ); - var colors = new Float32BufferAttribute( geometry.colors.length * 3, 3 ); + } - this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) ); - this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) ); + } - if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) { + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - var lineDistances = new Float32BufferAttribute( geometry.lineDistances.length, 1 ); + } - this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) ); + copy( source ) { - } + super.copy( source ); - if ( geometry.boundingSphere !== null ) { + this.parameters = Object.assign( {}, source.parameters ); - this.boundingSphere = geometry.boundingSphere.clone(); + return this; - } + } - if ( geometry.boundingBox !== null ) { + static fromJSON( data ) { - this.boundingBox = geometry.boundingBox.clone(); + return new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments ); - } + } - } else if ( object.isMesh ) { + } - if ( geometry && geometry.isGeometry ) { + var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif"; - this.fromGeometry( geometry ); + var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; - } + var alphatest_fragment = "#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif"; - } + var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif"; - return this; + var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif"; - }, + var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; - updateFromObject: function ( object ) { + var begin_vertex = "vec3 transformed = vec3( position );"; - var geometry = object.geometry; + var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif"; - if ( object.isMesh ) { + var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated"; - var direct = geometry.__directGeometry; + var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; - if ( geometry.elementsNeedUpdate === true ) { + var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif"; - direct = undefined; - geometry.elementsNeedUpdate = false; + var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif"; - } + var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif"; - if ( direct === undefined ) { + var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif"; - return this.fromGeometry( geometry ); + var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif"; - } + var color_fragment = "#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif"; - direct.verticesNeedUpdate = geometry.verticesNeedUpdate; - direct.normalsNeedUpdate = geometry.normalsNeedUpdate; - direct.colorsNeedUpdate = geometry.colorsNeedUpdate; - direct.uvsNeedUpdate = geometry.uvsNeedUpdate; - direct.groupsNeedUpdate = geometry.groupsNeedUpdate; + var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif"; - geometry.verticesNeedUpdate = false; - geometry.normalsNeedUpdate = false; - geometry.colorsNeedUpdate = false; - geometry.uvsNeedUpdate = false; - geometry.groupsNeedUpdate = false; + var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif"; - geometry = direct; + var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif"; - } + var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; - var attribute; + var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif"; - if ( geometry.verticesNeedUpdate === true ) { + var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif"; - attribute = this.attributes.position; + var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif"; - if ( attribute !== undefined ) { + var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif"; - attribute.copyVector3sArray( geometry.vertices ); - attribute.needsUpdate = true; + var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif"; - } + var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif"; - geometry.verticesNeedUpdate = false; + var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; - } + var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; - if ( geometry.normalsNeedUpdate === true ) { + var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; - attribute = this.attributes.normal; + var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif"; - if ( attribute !== undefined ) { + var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif"; - attribute.copyVector3sArray( geometry.normals ); - attribute.needsUpdate = true; + var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif"; - } + var envmap_vertex = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif"; - geometry.normalsNeedUpdate = false; + var fog_vertex = "#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif"; - } + var fog_pars_vertex = "#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif"; - if ( geometry.colorsNeedUpdate === true ) { + var fog_fragment = "#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"; - attribute = this.attributes.color; + var fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif"; - if ( attribute !== undefined ) { + var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}"; - attribute.copyColorsArray( geometry.colors ); - attribute.needsUpdate = true; + var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif"; - } + var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"; - geometry.colorsNeedUpdate = false; + var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;"; - } + var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert"; - if ( geometry.uvsNeedUpdate ) { + var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif"; - attribute = this.attributes.uv; + var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif"; - if ( attribute !== undefined ) { + var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; - attribute.copyVector2sArray( geometry.uvs ); - attribute.needsUpdate = true; + var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon"; - } + var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;"; - geometry.uvsNeedUpdate = false; + var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong"; - } + var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif"; - if ( geometry.lineDistancesNeedUpdate ) { + var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}"; - attribute = this.attributes.lineDistance; + var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif"; - if ( attribute !== undefined ) { + var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif"; - attribute.copyArray( geometry.lineDistances ); - attribute.needsUpdate = true; + var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif"; - } + var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif"; - geometry.lineDistancesNeedUpdate = false; + var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif"; - } + var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif"; - if ( geometry.groupsNeedUpdate ) { + var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif"; - geometry.computeGroups( object.geometry ); - this.groups = geometry.groups; + var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif"; - geometry.groupsNeedUpdate = false; + var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif"; - } + var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif"; - return this; + var map_particle_pars_fragment = "#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; - }, + var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif"; - fromGeometry: function ( geometry ) { + var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"; - geometry.__directGeometry = new DirectGeometry().fromGeometry( geometry ); + var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif"; - return this.fromDirectGeometry( geometry.__directGeometry ); + var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif"; - }, + var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif"; - fromDirectGeometry: function ( geometry ) { + var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif"; - var positions = new Float32Array( geometry.vertices.length * 3 ); - this.addAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) ); + var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; - if ( geometry.normals.length > 0 ) { + var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; - var normals = new Float32Array( geometry.normals.length * 3 ); - this.addAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) ); + var normal_pars_fragment = "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif"; - } + var normal_pars_vertex = "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif"; - if ( geometry.colors.length > 0 ) { + var normal_vertex = "#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif"; - var colors = new Float32Array( geometry.colors.length * 3 ); - this.addAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) ); + var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif"; - } + var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif"; - if ( geometry.uvs.length > 0 ) { + var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif"; - var uvs = new Float32Array( geometry.uvs.length * 2 ); - this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) ); + var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif"; - } + var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif"; - if ( geometry.uvs2.length > 0 ) { + var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; - var uvs2 = new Float32Array( geometry.uvs2.length * 2 ); - this.addAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) ); + var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}"; - } + var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif"; - if ( geometry.indices.length > 0 ) { + var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;"; - var TypeArray = arrayMax( geometry.indices ) > 65535 ? Uint32Array : Uint16Array; - var indices = new TypeArray( geometry.indices.length * 3 ); - this.setIndex( new BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) ); + var dithering_fragment = "#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; - } + var dithering_pars_fragment = "#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif"; - // groups + var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif"; - this.groups = geometry.groups; + var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"; - // morphs + var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif"; - for ( var name in geometry.morphTargets ) { + var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif"; - var array = []; - var morphTargets = geometry.morphTargets[ name ]; + var shadowmap_vertex = "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif"; - for ( var i = 0, l = morphTargets.length; i < l; i ++ ) { + var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}"; - var morphTarget = morphTargets[ i ]; + var skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"; - var attribute = new Float32BufferAttribute( morphTarget.length * 3, 3 ); + var skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif"; - array.push( attribute.copyVector3sArray( morphTarget ) ); + var skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif"; - } + var skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif"; - this.morphAttributes[ name ] = array; + var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"; - } + var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"; - // skinning + var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif"; - if ( geometry.skinIndices.length > 0 ) { + var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }"; - var skinIndices = new Float32BufferAttribute( geometry.skinIndices.length * 4, 4 ); - this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) ); + var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif"; - } + var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif"; - if ( geometry.skinWeights.length > 0 ) { + var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; - var skinWeights = new Float32BufferAttribute( geometry.skinWeights.length * 4, 4 ); - this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) ); + var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; - } + var uv_vertex = "#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; - // + var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif"; - if ( geometry.boundingSphere !== null ) { + const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; - this.boundingSphere = geometry.boundingSphere.clone(); + const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; - } + const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; - if ( geometry.boundingBox !== null ) { + const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; - this.boundingBox = geometry.boundingBox.clone(); + const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; - } + const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; - return this; + const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}"; - }, + const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; - computeBoundingBox: function () { + const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}"; - if ( this.boundingBox === null ) { + const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; - this.boundingBox = new Box3(); + const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}"; - } + const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; - var position = this.attributes.position; + const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - if ( position !== undefined ) { + const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - this.boundingBox.setFromBufferAttribute( position ); + const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - } else { + const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - this.boundingBox.makeEmpty(); + const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - } + const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { + const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}"; - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); + const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - } + const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}"; - }, + const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}"; - computeBoundingSphere: function () { + const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - var box = new Box3(); - var vector = new Vector3(); + const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - return function computeBoundingSphere() { + const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}"; - if ( this.boundingSphere === null ) { + const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - this.boundingSphere = new Sphere(); + const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; - } + const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - var position = this.attributes.position; + const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - if ( position ) { + const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - var center = this.boundingSphere.center; + const vertex$2 = "#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - box.setFromBufferAttribute( position ); - box.getCenter( center ); + const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; - // hoping to find a boundingSphere with a radius smaller than the - // boundingSphere of the boundingBox: sqrt(3) smaller in the best case + const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"; - var maxRadiusSq = 0; + const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - for ( var i = 0, il = position.count; i < il; i ++ ) { + const ShaderChunk = { + alphamap_fragment: alphamap_fragment, + alphamap_pars_fragment: alphamap_pars_fragment, + alphatest_fragment: alphatest_fragment, + alphatest_pars_fragment: alphatest_pars_fragment, + aomap_fragment: aomap_fragment, + aomap_pars_fragment: aomap_pars_fragment, + begin_vertex: begin_vertex, + beginnormal_vertex: beginnormal_vertex, + bsdfs: bsdfs, + iridescence_fragment: iridescence_fragment, + bumpmap_pars_fragment: bumpmap_pars_fragment, + clipping_planes_fragment: clipping_planes_fragment, + clipping_planes_pars_fragment: clipping_planes_pars_fragment, + clipping_planes_pars_vertex: clipping_planes_pars_vertex, + clipping_planes_vertex: clipping_planes_vertex, + color_fragment: color_fragment, + color_pars_fragment: color_pars_fragment, + color_pars_vertex: color_pars_vertex, + color_vertex: color_vertex, + common: common, + cube_uv_reflection_fragment: cube_uv_reflection_fragment, + defaultnormal_vertex: defaultnormal_vertex, + displacementmap_pars_vertex: displacementmap_pars_vertex, + displacementmap_vertex: displacementmap_vertex, + emissivemap_fragment: emissivemap_fragment, + emissivemap_pars_fragment: emissivemap_pars_fragment, + encodings_fragment: encodings_fragment, + encodings_pars_fragment: encodings_pars_fragment, + envmap_fragment: envmap_fragment, + envmap_common_pars_fragment: envmap_common_pars_fragment, + envmap_pars_fragment: envmap_pars_fragment, + envmap_pars_vertex: envmap_pars_vertex, + envmap_physical_pars_fragment: envmap_physical_pars_fragment, + envmap_vertex: envmap_vertex, + fog_vertex: fog_vertex, + fog_pars_vertex: fog_pars_vertex, + fog_fragment: fog_fragment, + fog_pars_fragment: fog_pars_fragment, + gradientmap_pars_fragment: gradientmap_pars_fragment, + lightmap_fragment: lightmap_fragment, + lightmap_pars_fragment: lightmap_pars_fragment, + lights_lambert_fragment: lights_lambert_fragment, + lights_lambert_pars_fragment: lights_lambert_pars_fragment, + lights_pars_begin: lights_pars_begin, + lights_toon_fragment: lights_toon_fragment, + lights_toon_pars_fragment: lights_toon_pars_fragment, + lights_phong_fragment: lights_phong_fragment, + lights_phong_pars_fragment: lights_phong_pars_fragment, + lights_physical_fragment: lights_physical_fragment, + lights_physical_pars_fragment: lights_physical_pars_fragment, + lights_fragment_begin: lights_fragment_begin, + lights_fragment_maps: lights_fragment_maps, + lights_fragment_end: lights_fragment_end, + logdepthbuf_fragment: logdepthbuf_fragment, + logdepthbuf_pars_fragment: logdepthbuf_pars_fragment, + logdepthbuf_pars_vertex: logdepthbuf_pars_vertex, + logdepthbuf_vertex: logdepthbuf_vertex, + map_fragment: map_fragment, + map_pars_fragment: map_pars_fragment, + map_particle_fragment: map_particle_fragment, + map_particle_pars_fragment: map_particle_pars_fragment, + metalnessmap_fragment: metalnessmap_fragment, + metalnessmap_pars_fragment: metalnessmap_pars_fragment, + morphcolor_vertex: morphcolor_vertex, + morphnormal_vertex: morphnormal_vertex, + morphtarget_pars_vertex: morphtarget_pars_vertex, + morphtarget_vertex: morphtarget_vertex, + normal_fragment_begin: normal_fragment_begin, + normal_fragment_maps: normal_fragment_maps, + normal_pars_fragment: normal_pars_fragment, + normal_pars_vertex: normal_pars_vertex, + normal_vertex: normal_vertex, + normalmap_pars_fragment: normalmap_pars_fragment, + clearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin, + clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, + clearcoat_pars_fragment: clearcoat_pars_fragment, + iridescence_pars_fragment: iridescence_pars_fragment, + output_fragment: output_fragment, + packing: packing, + premultiplied_alpha_fragment: premultiplied_alpha_fragment, + project_vertex: project_vertex, + dithering_fragment: dithering_fragment, + dithering_pars_fragment: dithering_pars_fragment, + roughnessmap_fragment: roughnessmap_fragment, + roughnessmap_pars_fragment: roughnessmap_pars_fragment, + shadowmap_pars_fragment: shadowmap_pars_fragment, + shadowmap_pars_vertex: shadowmap_pars_vertex, + shadowmap_vertex: shadowmap_vertex, + shadowmask_pars_fragment: shadowmask_pars_fragment, + skinbase_vertex: skinbase_vertex, + skinning_pars_vertex: skinning_pars_vertex, + skinning_vertex: skinning_vertex, + skinnormal_vertex: skinnormal_vertex, + specularmap_fragment: specularmap_fragment, + specularmap_pars_fragment: specularmap_pars_fragment, + tonemapping_fragment: tonemapping_fragment, + tonemapping_pars_fragment: tonemapping_pars_fragment, + transmission_fragment: transmission_fragment, + transmission_pars_fragment: transmission_pars_fragment, + uv_pars_fragment: uv_pars_fragment, + uv_pars_vertex: uv_pars_vertex, + uv_vertex: uv_vertex, + worldpos_vertex: worldpos_vertex, - vector.x = position.getX( i ); - vector.y = position.getY( i ); - vector.z = position.getZ( i ); - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + background_vert: vertex$h, + background_frag: fragment$h, + backgroundCube_vert: vertex$g, + backgroundCube_frag: fragment$g, + cube_vert: vertex$f, + cube_frag: fragment$f, + depth_vert: vertex$e, + depth_frag: fragment$e, + distanceRGBA_vert: vertex$d, + distanceRGBA_frag: fragment$d, + equirect_vert: vertex$c, + equirect_frag: fragment$c, + linedashed_vert: vertex$b, + linedashed_frag: fragment$b, + meshbasic_vert: vertex$a, + meshbasic_frag: fragment$a, + meshlambert_vert: vertex$9, + meshlambert_frag: fragment$9, + meshmatcap_vert: vertex$8, + meshmatcap_frag: fragment$8, + meshnormal_vert: vertex$7, + meshnormal_frag: fragment$7, + meshphong_vert: vertex$6, + meshphong_frag: fragment$6, + meshphysical_vert: vertex$5, + meshphysical_frag: fragment$5, + meshtoon_vert: vertex$4, + meshtoon_frag: fragment$4, + points_vert: vertex$3, + points_frag: fragment$3, + shadow_vert: vertex$2, + shadow_frag: fragment$2, + sprite_vert: vertex$1, + sprite_frag: fragment$1 + }; - } + /** + * Uniforms library for shared webgl shaders + */ - this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); + const UniformsLib = { - if ( isNaN( this.boundingSphere.radius ) ) { + common: { - console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); + diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) }, + opacity: { value: 1.0 }, - } + map: { value: null }, + mapTransform: { value: /*@__PURE__*/ new Matrix3() }, - } + alphaMap: { value: null }, + alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() }, - }; + alphaTest: { value: 0 } - }(), + }, - computeFaceNormals: function () { + specularmap: { - // backwards compatibility + specularMap: { value: null }, + specularMapTransform: { value: /*@__PURE__*/ new Matrix3() } }, - computeVertexNormals: function () { + envmap: { - var index = this.index; - var attributes = this.attributes; - var groups = this.groups; + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + reflectivity: { value: 1.0 }, // basic, lambert, phong + ior: { value: 1.5 }, // physical + refractionRatio: { value: 0.98 }, // basic, lambert, phong - if ( attributes.position ) { + }, - var positions = attributes.position.array; + aomap: { - if ( attributes.normal === undefined ) { + aoMap: { value: null }, + aoMapIntensity: { value: 1 }, + aoMapTransform: { value: /*@__PURE__*/ new Matrix3() } - this.addAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) ); + }, - } else { + lightmap: { - // reset existing normals to zero + lightMap: { value: null }, + lightMapIntensity: { value: 1 }, + lightMapTransform: { value: /*@__PURE__*/ new Matrix3() } - var array = attributes.normal.array; + }, - for ( var i = 0, il = array.length; i < il; i ++ ) { + bumpmap: { - array[ i ] = 0; + bumpMap: { value: null }, + bumpMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + bumpScale: { value: 1 } - } + }, - } + normalmap: { - var normals = attributes.normal.array; + normalMap: { value: null }, + normalMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + normalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) } - var vA, vB, vC; - var pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); - var cb = new Vector3(), ab = new Vector3(); + }, - // indexed elements + displacementmap: { - if ( index ) { + displacementMap: { value: null }, + displacementMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } - var indices = index.array; + }, - if ( groups.length === 0 ) { + emissivemap: { - this.addGroup( 0, indices.length ); + emissiveMap: { value: null }, + emissiveMapTransform: { value: /*@__PURE__*/ new Matrix3() } - } + }, - for ( var j = 0, jl = groups.length; j < jl; ++ j ) { + metalnessmap: { - var group = groups[ j ]; + metalnessMap: { value: null }, + metalnessMapTransform: { value: /*@__PURE__*/ new Matrix3() } - var start = group.start; - var count = group.count; + }, - for ( var i = start, il = start + count; i < il; i += 3 ) { + roughnessmap: { - vA = indices[ i + 0 ] * 3; - vB = indices[ i + 1 ] * 3; - vC = indices[ i + 2 ] * 3; + roughnessMap: { value: null }, + roughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() } - pA.fromArray( positions, vA ); - pB.fromArray( positions, vB ); - pC.fromArray( positions, vC ); + }, - cb.subVectors( pC, pB ); - ab.subVectors( pA, pB ); - cb.cross( ab ); + gradientmap: { - normals[ vA ] += cb.x; - normals[ vA + 1 ] += cb.y; - normals[ vA + 2 ] += cb.z; + gradientMap: { value: null } - normals[ vB ] += cb.x; - normals[ vB + 1 ] += cb.y; - normals[ vB + 2 ] += cb.z; + }, - normals[ vC ] += cb.x; - normals[ vC + 1 ] += cb.y; - normals[ vC + 2 ] += cb.z; + fog: { - } + fogDensity: { value: 0.00025 }, + fogNear: { value: 1 }, + fogFar: { value: 2000 }, + fogColor: { value: /*@__PURE__*/ new Color( 0xffffff ) } - } + }, - } else { + lights: { - // non-indexed elements (unconnected triangle soup) + ambientLightColor: { value: [] }, - for ( var i = 0, il = positions.length; i < il; i += 9 ) { + lightProbe: { value: [] }, - pA.fromArray( positions, i ); - pB.fromArray( positions, i + 3 ); - pC.fromArray( positions, i + 6 ); + directionalLights: { value: [], properties: { + direction: {}, + color: {} + } }, - cb.subVectors( pC, pB ); - ab.subVectors( pA, pB ); - cb.cross( ab ); + directionalLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, - normals[ i ] = cb.x; - normals[ i + 1 ] = cb.y; - normals[ i + 2 ] = cb.z; + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, - normals[ i + 3 ] = cb.x; - normals[ i + 4 ] = cb.y; - normals[ i + 5 ] = cb.z; + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {} + } }, - normals[ i + 6 ] = cb.x; - normals[ i + 7 ] = cb.y; - normals[ i + 8 ] = cb.z; + spotLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, - } + spotLightMap: { value: [] }, + spotShadowMap: { value: [] }, + spotLightMatrix: { value: [] }, - } + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {} + } }, - this.normalizeNormals(); + pointLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {}, + shadowCameraNear: {}, + shadowCameraFar: {} + } }, - attributes.normal.needsUpdate = true; + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, - } + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } }, + + // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src + rectAreaLights: { value: [], properties: { + color: {}, + position: {}, + width: {}, + height: {} + } }, + + ltc_1: { value: null }, + ltc_2: { value: null } }, - merge: function ( geometry, offset ) { + points: { - if ( ! ( geometry && geometry.isBufferGeometry ) ) { + diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) }, + opacity: { value: 1.0 }, + size: { value: 1.0 }, + scale: { value: 1.0 }, + map: { value: null }, + alphaMap: { value: null }, + alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + alphaTest: { value: 0 }, + uvTransform: { value: /*@__PURE__*/ new Matrix3() } - console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry ); - return; + }, - } + sprite: { - if ( offset === undefined ) offset = 0; + diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) }, + opacity: { value: 1.0 }, + center: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) }, + rotation: { value: 0.0 }, + map: { value: null }, + mapTransform: { value: /*@__PURE__*/ new Matrix3() }, + alphaMap: { value: null }, + alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + alphaTest: { value: 0 } - var attributes = this.attributes; + } - for ( var key in attributes ) { + }; - if ( geometry.attributes[ key ] === undefined ) continue; + const ShaderLib = { - var attribute1 = attributes[ key ]; - var attributeArray1 = attribute1.array; + basic: { - var attribute2 = geometry.attributes[ key ]; - var attributeArray2 = attribute2.array; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.fog + ] ), - var attributeSize = attribute2.itemSize; + vertexShader: ShaderChunk.meshbasic_vert, + fragmentShader: ShaderChunk.meshbasic_frag - for ( var i = 0, j = attributeSize * offset; i < attributeArray2.length; i ++, j ++ ) { + }, - attributeArray1[ j ] = attributeArray2[ i ]; + lambert: { + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) } } + ] ), - } - - return this; + vertexShader: ShaderChunk.meshlambert_vert, + fragmentShader: ShaderChunk.meshlambert_frag }, - normalizeNormals: function () { - - var normals = this.attributes.normal; + phong: { - var x, y, z, n; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }, + specular: { value: /*@__PURE__*/ new Color( 0x111111 ) }, + shininess: { value: 30 } + } + ] ), - for ( var i = 0, il = normals.count; i < il; i ++ ) { + vertexShader: ShaderChunk.meshphong_vert, + fragmentShader: ShaderChunk.meshphong_frag - x = normals.getX( i ); - y = normals.getY( i ); - z = normals.getZ( i ); + }, - n = 1.0 / Math.sqrt( x * x + y * y + z * z ); + standard: { - normals.setXYZ( i, x * n, y * n, z * n ); + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.roughnessmap, + UniformsLib.metalnessmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }, + roughness: { value: 1.0 }, + metalness: { value: 0.0 }, + envMapIntensity: { value: 1 } // temporary + } + ] ), - } + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag }, - toNonIndexed: function () { - - if ( this.index === null ) { + toon: { - console.warn( 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.' ); - return this; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.gradientmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) } + } + ] ), - } + vertexShader: ShaderChunk.meshtoon_vert, + fragmentShader: ShaderChunk.meshtoon_frag - var geometry2 = new BufferGeometry(); + }, - var indices = this.index.array; - var attributes = this.attributes; + matcap: { - for ( var name in attributes ) { + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + { + matcap: { value: null } + } + ] ), - var attribute = attributes[ name ]; + vertexShader: ShaderChunk.meshmatcap_vert, + fragmentShader: ShaderChunk.meshmatcap_frag - var array = attribute.array; - var itemSize = attribute.itemSize; + }, - var array2 = new array.constructor( indices.length * itemSize ); + points: { - var index = 0, index2 = 0; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.points, + UniformsLib.fog + ] ), - for ( var i = 0, l = indices.length; i < l; i ++ ) { + vertexShader: ShaderChunk.points_vert, + fragmentShader: ShaderChunk.points_frag - index = indices[ i ] * itemSize; + }, - for ( var j = 0; j < itemSize; j ++ ) { + dashed: { - array2[ index2 ++ ] = array[ index ++ ]; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.fog, + { + scale: { value: 1 }, + dashSize: { value: 1 }, + totalSize: { value: 2 } + } + ] ), - } + vertexShader: ShaderChunk.linedashed_vert, + fragmentShader: ShaderChunk.linedashed_frag - } + }, - geometry2.addAttribute( name, new BufferAttribute( array2, itemSize ) ); + depth: { - } + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.displacementmap + ] ), - return geometry2; + vertexShader: ShaderChunk.depth_vert, + fragmentShader: ShaderChunk.depth_frag }, - toJSON: function () { + normal: { - var data = { - metadata: { - version: 4.5, - type: 'BufferGeometry', - generator: 'BufferGeometry.toJSON' + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + { + opacity: { value: 1.0 } } - }; + ] ), - // standard BufferGeometry serialization + vertexShader: ShaderChunk.meshnormal_vert, + fragmentShader: ShaderChunk.meshnormal_frag - data.uuid = this.uuid; - data.type = this.type; - if ( this.name !== '' ) data.name = this.name; + }, - if ( this.parameters !== undefined ) { + sprite: { - var parameters = this.parameters; + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.sprite, + UniformsLib.fog + ] ), - for ( var key in parameters ) { + vertexShader: ShaderChunk.sprite_vert, + fragmentShader: ShaderChunk.sprite_frag - if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; + }, - } + background: { - return data; + uniforms: { + uvTransform: { value: /*@__PURE__*/ new Matrix3() }, + t2D: { value: null }, + backgroundIntensity: { value: 1 } + }, - } + vertexShader: ShaderChunk.background_vert, + fragmentShader: ShaderChunk.background_frag - data.data = { attributes: {} }; + }, - var index = this.index; + backgroundCube: { - if ( index !== null ) { + uniforms: { + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + backgroundBlurriness: { value: 0 }, + backgroundIntensity: { value: 1 } + }, - var array = Array.prototype.slice.call( index.array ); + vertexShader: ShaderChunk.backgroundCube_vert, + fragmentShader: ShaderChunk.backgroundCube_frag - data.data.index = { - type: index.array.constructor.name, - array: array - }; + }, - } + cube: { - var attributes = this.attributes; + uniforms: { + tCube: { value: null }, + tFlip: { value: - 1 }, + opacity: { value: 1.0 } + }, - for ( var key in attributes ) { + vertexShader: ShaderChunk.cube_vert, + fragmentShader: ShaderChunk.cube_frag - var attribute = attributes[ key ]; + }, - var array = Array.prototype.slice.call( attribute.array ); + equirect: { - data.data.attributes[ key ] = { - itemSize: attribute.itemSize, - type: attribute.array.constructor.name, - array: array, - normalized: attribute.normalized - }; + uniforms: { + tEquirect: { value: null }, + }, - } + vertexShader: ShaderChunk.equirect_vert, + fragmentShader: ShaderChunk.equirect_frag - var groups = this.groups; + }, - if ( groups.length > 0 ) { + distanceRGBA: { - data.data.groups = JSON.parse( JSON.stringify( groups ) ); + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.common, + UniformsLib.displacementmap, + { + referencePosition: { value: /*@__PURE__*/ new Vector3() }, + nearDistance: { value: 1 }, + farDistance: { value: 1000 } + } + ] ), - } + vertexShader: ShaderChunk.distanceRGBA_vert, + fragmentShader: ShaderChunk.distanceRGBA_frag - var boundingSphere = this.boundingSphere; + }, - if ( boundingSphere !== null ) { + shadow: { - data.data.boundingSphere = { - center: boundingSphere.center.toArray(), - radius: boundingSphere.radius - }; - - } + uniforms: /*@__PURE__*/ mergeUniforms( [ + UniformsLib.lights, + UniformsLib.fog, + { + color: { value: /*@__PURE__*/ new Color( 0x00000 ) }, + opacity: { value: 1.0 } + }, + ] ), - return data; + vertexShader: ShaderChunk.shadow_vert, + fragmentShader: ShaderChunk.shadow_frag - }, + } - clone: function () { + }; - /* - // Handle primitives + ShaderLib.physical = { - var parameters = this.parameters; + uniforms: /*@__PURE__*/ mergeUniforms( [ + ShaderLib.standard.uniforms, + { + clearcoat: { value: 0 }, + clearcoatMap: { value: null }, + clearcoatMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + clearcoatNormalMap: { value: null }, + clearcoatNormalMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + clearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }, + clearcoatRoughness: { value: 0 }, + clearcoatRoughnessMap: { value: null }, + clearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + iridescence: { value: 0 }, + iridescenceMap: { value: null }, + iridescenceMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + iridescenceIOR: { value: 1.3 }, + iridescenceThicknessMinimum: { value: 100 }, + iridescenceThicknessMaximum: { value: 400 }, + iridescenceThicknessMap: { value: null }, + iridescenceThicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + sheen: { value: 0 }, + sheenColor: { value: /*@__PURE__*/ new Color( 0x000000 ) }, + sheenColorMap: { value: null }, + sheenColorMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + sheenRoughness: { value: 1 }, + sheenRoughnessMap: { value: null }, + sheenRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + transmission: { value: 0 }, + transmissionMap: { value: null }, + transmissionMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + transmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() }, + transmissionSamplerMap: { value: null }, + thickness: { value: 0 }, + thicknessMap: { value: null }, + thicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + attenuationDistance: { value: 0 }, + attenuationColor: { value: /*@__PURE__*/ new Color( 0x000000 ) }, + specularColor: { value: /*@__PURE__*/ new Color( 1, 1, 1 ) }, + specularColorMap: { value: null }, + specularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + specularIntensity: { value: 1 }, + specularIntensityMap: { value: null }, + specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + anisotropyVector: { value: /*@__PURE__*/ new Vector2() }, + anisotropyMap: { value: null }, + anisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() }, + } + ] ), - if ( parameters !== undefined ) { + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag - var values = []; + }; - for ( var key in parameters ) { + const _rgb = { r: 0, b: 0, g: 0 }; - values.push( parameters[ key ] ); + function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) { - } + const clearColor = new Color( 0x000000 ); + let clearAlpha = alpha === true ? 0 : 1; - var geometry = Object.create( this.constructor.prototype ); - this.constructor.apply( geometry, values ); - return geometry; + let planeMesh; + let boxMesh; - } + let currentBackground = null; + let currentBackgroundVersion = 0; + let currentTonemapping = null; - return new this.constructor().copy( this ); - */ + function render( renderList, scene ) { - return new BufferGeometry().copy( this ); + let forceClear = false; + let background = scene.isScene === true ? scene.background : null; - }, + if ( background && background.isTexture ) { - copy: function ( source ) { + const usePMREM = scene.backgroundBlurriness > 0; // use PMREM if the user wants to blur the background + background = ( usePMREM ? cubeuvmaps : cubemaps ).get( background ); - var name, i, l; + } - // reset + if ( background === null ) { - this.index = null; - this.attributes = {}; - this.morphAttributes = {}; - this.groups = []; - this.boundingBox = null; - this.boundingSphere = null; + setClear( clearColor, clearAlpha ); - // name + } else if ( background && background.isColor ) { - this.name = source.name; + setClear( background, 1 ); + forceClear = true; - // index + } - var index = source.index; + const xr = renderer.xr; + const environmentBlendMode = xr.getEnvironmentBlendMode(); - if ( index !== null ) { + switch ( environmentBlendMode ) { - this.setIndex( index.clone() ); + case 'opaque': + forceClear = true; + break; - } + case 'additive': + state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); + forceClear = true; + break; - // attributes + case 'alpha-blend': + state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); + forceClear = true; + break; - var attributes = source.attributes; + } - for ( name in attributes ) { + if ( renderer.autoClear || forceClear ) { - var attribute = attributes[ name ]; - this.addAttribute( name, attribute.clone() ); + renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); } - // morph attributes - - var morphAttributes = source.morphAttributes; + if ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) { - for ( name in morphAttributes ) { + if ( boxMesh === undefined ) { - var array = []; - var morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes + boxMesh = new Mesh( + new BoxGeometry( 1, 1, 1 ), + new ShaderMaterial( { + name: 'BackgroundCubeMaterial', + uniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ), + vertexShader: ShaderLib.backgroundCube.vertexShader, + fragmentShader: ShaderLib.backgroundCube.fragmentShader, + side: BackSide, + depthTest: false, + depthWrite: false, + fog: false + } ) + ); - for ( i = 0, l = morphAttribute.length; i < l; i ++ ) { + boxMesh.geometry.deleteAttribute( 'normal' ); + boxMesh.geometry.deleteAttribute( 'uv' ); - array.push( morphAttribute[ i ].clone() ); + boxMesh.onBeforeRender = function ( renderer, scene, camera ) { - } + this.matrixWorld.copyPosition( camera.matrixWorld ); - this.morphAttributes[ name ] = array; + }; - } + // add "envMap" material property so the renderer can evaluate it like for built-in materials + Object.defineProperty( boxMesh.material, 'envMap', { - // groups + get: function () { - var groups = source.groups; + return this.uniforms.envMap.value; - for ( i = 0, l = groups.length; i < l; i ++ ) { + } - var group = groups[ i ]; - this.addGroup( group.start, group.count, group.materialIndex ); + } ); - } + objects.update( boxMesh ); - // bounding box + } - var boundingBox = source.boundingBox; + boxMesh.material.uniforms.envMap.value = background; + boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1; + boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness; + boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity; + boxMesh.material.toneMapped = ( background.colorSpace === SRGBColorSpace ) ? false : true; - if ( boundingBox !== null ) { + if ( currentBackground !== background || + currentBackgroundVersion !== background.version || + currentTonemapping !== renderer.toneMapping ) { - this.boundingBox = boundingBox.clone(); + boxMesh.material.needsUpdate = true; - } + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer.toneMapping; - // bounding sphere + } - var boundingSphere = source.boundingSphere; + boxMesh.layers.enableAll(); - if ( boundingSphere !== null ) { + // push to the pre-sorted opaque render list + renderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null ); - this.boundingSphere = boundingSphere.clone(); + } else if ( background && background.isTexture ) { - } + if ( planeMesh === undefined ) { - // draw range + planeMesh = new Mesh( + new PlaneGeometry( 2, 2 ), + new ShaderMaterial( { + name: 'BackgroundMaterial', + uniforms: cloneUniforms( ShaderLib.background.uniforms ), + vertexShader: ShaderLib.background.vertexShader, + fragmentShader: ShaderLib.background.fragmentShader, + side: FrontSide, + depthTest: false, + depthWrite: false, + fog: false + } ) + ); - this.drawRange.start = source.drawRange.start; - this.drawRange.count = source.drawRange.count; + planeMesh.geometry.deleteAttribute( 'normal' ); - return this; + // add "map" material property so the renderer can evaluate it like for built-in materials + Object.defineProperty( planeMesh.material, 'map', { - }, + get: function () { - dispose: function () { + return this.uniforms.t2D.value; - this.dispatchEvent( { type: 'dispose' } ); + } - } + } ); - } ); + objects.update( planeMesh ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + } - // BoxGeometry + planeMesh.material.uniforms.t2D.value = background; + planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity; + planeMesh.material.toneMapped = ( background.colorSpace === SRGBColorSpace ) ? false : true; - function BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { + if ( background.matrixAutoUpdate === true ) { - Geometry.call( this ); + background.updateMatrix(); - this.type = 'BoxGeometry'; + } - this.parameters = { - width: width, - height: height, - depth: depth, - widthSegments: widthSegments, - heightSegments: heightSegments, - depthSegments: depthSegments - }; + planeMesh.material.uniforms.uvTransform.value.copy( background.matrix ); - this.fromBufferGeometry( new BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) ); - this.mergeVertices(); + if ( currentBackground !== background || + currentBackgroundVersion !== background.version || + currentTonemapping !== renderer.toneMapping ) { - } + planeMesh.material.needsUpdate = true; - BoxGeometry.prototype = Object.create( Geometry.prototype ); - BoxGeometry.prototype.constructor = BoxGeometry; + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer.toneMapping; - // BoxBufferGeometry + } - function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { + planeMesh.layers.enableAll(); - BufferGeometry.call( this ); + // push to the pre-sorted opaque render list + renderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null ); - this.type = 'BoxBufferGeometry'; + } - this.parameters = { - width: width, - height: height, - depth: depth, - widthSegments: widthSegments, - heightSegments: heightSegments, - depthSegments: depthSegments - }; + } - var scope = this; + function setClear( color, alpha ) { - // segments + color.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) ); - widthSegments = Math.floor( widthSegments ) || 1; - heightSegments = Math.floor( heightSegments ) || 1; - depthSegments = Math.floor( depthSegments ) || 1; + state.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha ); - // buffers + } - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + return { - // helper variables + getClearColor: function () { - var numberOfVertices = 0; - var groupStart = 0; + return clearColor; - // build each side of the box geometry + }, + setClearColor: function ( color, alpha = 1 ) { - buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px - buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx - buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py - buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny - buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz - buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz + clearColor.set( color ); + clearAlpha = alpha; + setClear( clearColor, clearAlpha ); - // build geometry + }, + getClearAlpha: function () { - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + return clearAlpha; - function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) { + }, + setClearAlpha: function ( alpha ) { - var segmentWidth = width / gridX; - var segmentHeight = height / gridY; + clearAlpha = alpha; + setClear( clearColor, clearAlpha ); - var widthHalf = width / 2; - var heightHalf = height / 2; - var depthHalf = depth / 2; + }, + render: render - var gridX1 = gridX + 1; - var gridY1 = gridY + 1; + }; - var vertexCounter = 0; - var groupCount = 0; + } - var ix, iy; + function WebGLBindingStates( gl, extensions, attributes, capabilities ) { - var vector = new Vector3(); + const maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); - // generate vertices, normals and uvs + const extension = capabilities.isWebGL2 ? null : extensions.get( 'OES_vertex_array_object' ); + const vaoAvailable = capabilities.isWebGL2 || extension !== null; - for ( iy = 0; iy < gridY1; iy ++ ) { + const bindingStates = {}; - var y = iy * segmentHeight - heightHalf; + const defaultState = createBindingState( null ); + let currentState = defaultState; + let forceUpdate = false; - for ( ix = 0; ix < gridX1; ix ++ ) { + function setup( object, material, program, geometry, index ) { - var x = ix * segmentWidth - widthHalf; + let updateBuffers = false; - // set values to correct vector component + if ( vaoAvailable ) { - vector[ u ] = x * udir; - vector[ v ] = y * vdir; - vector[ w ] = depthHalf; + const state = getBindingState( geometry, program, material ); - // now apply vector to vertex buffer + if ( currentState !== state ) { - vertices.push( vector.x, vector.y, vector.z ); + currentState = state; + bindVertexArrayObject( currentState.object ); - // set values to correct vector component + } - vector[ u ] = 0; - vector[ v ] = 0; - vector[ w ] = depth > 0 ? 1 : - 1; + updateBuffers = needsUpdate( object, geometry, program, index ); - // now apply vector to normal buffer + if ( updateBuffers ) saveCache( object, geometry, program, index ); - normals.push( vector.x, vector.y, vector.z ); + } else { - // uvs + const wireframe = ( material.wireframe === true ); - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); + if ( currentState.geometry !== geometry.id || + currentState.program !== program.id || + currentState.wireframe !== wireframe ) { - // counters + currentState.geometry = geometry.id; + currentState.program = program.id; + currentState.wireframe = wireframe; - vertexCounter += 1; + updateBuffers = true; } } - // indices - - // 1. you need three indices to draw a single face - // 2. a single segment consists of two faces - // 3. so we need to generate six (2*3) indices per segment + if ( index !== null ) { - for ( iy = 0; iy < gridY; iy ++ ) { + attributes.update( index, gl.ELEMENT_ARRAY_BUFFER ); - for ( ix = 0; ix < gridX; ix ++ ) { + } - var a = numberOfVertices + ix + gridX1 * iy; - var b = numberOfVertices + ix + gridX1 * ( iy + 1 ); - var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = numberOfVertices + ( ix + 1 ) + gridX1 * iy; + if ( updateBuffers || forceUpdate ) { - // faces + forceUpdate = false; - indices.push( a, b, d ); - indices.push( b, c, d ); + setupVertexAttributes( object, material, program, geometry ); - // increase counter + if ( index !== null ) { - groupCount += 6; + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, attributes.get( index ).buffer ); } } - // add a group to the geometry. this will ensure multi material support - - scope.addGroup( groupStart, groupCount, materialIndex ); - - // calculate new start value for groups + } - groupStart += groupCount; + function createVertexArrayObject() { - // update total number of vertices + if ( capabilities.isWebGL2 ) return gl.createVertexArray(); - numberOfVertices += vertexCounter; + return extension.createVertexArrayOES(); } - } + function bindVertexArrayObject( vao ) { - BoxBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - BoxBufferGeometry.prototype.constructor = BoxBufferGeometry; + if ( capabilities.isWebGL2 ) return gl.bindVertexArray( vao ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + return extension.bindVertexArrayOES( vao ); - // PlaneGeometry + } - function PlaneGeometry( width, height, widthSegments, heightSegments ) { + function deleteVertexArrayObject( vao ) { - Geometry.call( this ); + if ( capabilities.isWebGL2 ) return gl.deleteVertexArray( vao ); - this.type = 'PlaneGeometry'; + return extension.deleteVertexArrayOES( vao ); - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + } - this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); - this.mergeVertices(); + function getBindingState( geometry, program, material ) { - } + const wireframe = ( material.wireframe === true ); - PlaneGeometry.prototype = Object.create( Geometry.prototype ); - PlaneGeometry.prototype.constructor = PlaneGeometry; + let programMap = bindingStates[ geometry.id ]; - // PlaneBufferGeometry + if ( programMap === undefined ) { - function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { + programMap = {}; + bindingStates[ geometry.id ] = programMap; - BufferGeometry.call( this ); + } - this.type = 'PlaneBufferGeometry'; + let stateMap = programMap[ program.id ]; - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + if ( stateMap === undefined ) { - var width_half = width / 2; - var height_half = height / 2; + stateMap = {}; + programMap[ program.id ] = stateMap; - var gridX = Math.floor( widthSegments ) || 1; - var gridY = Math.floor( heightSegments ) || 1; + } - var gridX1 = gridX + 1; - var gridY1 = gridY + 1; + let state = stateMap[ wireframe ]; - var segment_width = width / gridX; - var segment_height = height / gridY; + if ( state === undefined ) { - var ix, iy; + state = createBindingState( createVertexArrayObject() ); + stateMap[ wireframe ] = state; - // buffers + } - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + return state; - // generate vertices, normals and uvs + } - for ( iy = 0; iy < gridY1; iy ++ ) { + function createBindingState( vao ) { - var y = iy * segment_height - height_half; + const newAttributes = []; + const enabledAttributes = []; + const attributeDivisors = []; - for ( ix = 0; ix < gridX1; ix ++ ) { + for ( let i = 0; i < maxVertexAttributes; i ++ ) { - var x = ix * segment_width - width_half; + newAttributes[ i ] = 0; + enabledAttributes[ i ] = 0; + attributeDivisors[ i ] = 0; - vertices.push( x, - y, 0 ); + } - normals.push( 0, 0, 1 ); + return { - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); + // for backward compatibility on non-VAO support browser + geometry: null, + program: null, + wireframe: false, - } + newAttributes: newAttributes, + enabledAttributes: enabledAttributes, + attributeDivisors: attributeDivisors, + object: vao, + attributes: {}, + index: null - } + }; - // indices + } - for ( iy = 0; iy < gridY; iy ++ ) { + function needsUpdate( object, geometry, program, index ) { - for ( ix = 0; ix < gridX; ix ++ ) { + const cachedAttributes = currentState.attributes; + const geometryAttributes = geometry.attributes; - var a = ix + gridX1 * iy; - var b = ix + gridX1 * ( iy + 1 ); - var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = ( ix + 1 ) + gridX1 * iy; + let attributesNum = 0; - // faces + const programAttributes = program.getAttributes(); - indices.push( a, b, d ); - indices.push( b, c, d ); + for ( const name in programAttributes ) { - } + const programAttribute = programAttributes[ name ]; - } + if ( programAttribute.location >= 0 ) { - // build geometry + const cachedAttribute = cachedAttributes[ name ]; + let geometryAttribute = geometryAttributes[ name ]; - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + if ( geometryAttribute === undefined ) { - } + if ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix; + if ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor; - PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * shading: THREE.SmoothShading, - * depthTest: , - * depthWrite: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: - * } - */ + if ( cachedAttribute === undefined ) return true; - function MeshBasicMaterial( parameters ) { + if ( cachedAttribute.attribute !== geometryAttribute ) return true; - Material.call( this ); + if ( geometryAttribute && cachedAttribute.data !== geometryAttribute.data ) return true; - this.type = 'MeshBasicMaterial'; + attributesNum ++; - this.color = new Color( 0xffffff ); // emissive + } - this.map = null; + } - this.lightMap = null; - this.lightMapIntensity = 1.0; + if ( currentState.attributesNum !== attributesNum ) return true; - this.aoMap = null; - this.aoMapIntensity = 1.0; + if ( currentState.index !== index ) return true; - this.specularMap = null; + return false; - this.alphaMap = null; + } - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; + function saveCache( object, geometry, program, index ) { - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; + const cache = {}; + const attributes = geometry.attributes; + let attributesNum = 0; - this.skinning = false; - this.morphTargets = false; + const programAttributes = program.getAttributes(); - this.lights = false; + for ( const name in programAttributes ) { - this.setValues( parameters ); + const programAttribute = programAttributes[ name ]; - } + if ( programAttribute.location >= 0 ) { - MeshBasicMaterial.prototype = Object.create( Material.prototype ); - MeshBasicMaterial.prototype.constructor = MeshBasicMaterial; + let attribute = attributes[ name ]; - MeshBasicMaterial.prototype.isMeshBasicMaterial = true; + if ( attribute === undefined ) { - MeshBasicMaterial.prototype.copy = function ( source ) { + if ( name === 'instanceMatrix' && object.instanceMatrix ) attribute = object.instanceMatrix; + if ( name === 'instanceColor' && object.instanceColor ) attribute = object.instanceColor; - Material.prototype.copy.call( this, source ); + } - this.color.copy( source.color ); + const data = {}; + data.attribute = attribute; - this.map = source.map; + if ( attribute && attribute.data ) { - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; + data.data = attribute.data; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; + } - this.specularMap = source.specularMap; + cache[ name ] = data; - this.alphaMap = source.alphaMap; + attributesNum ++; - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; + } - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; + } - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; + currentState.attributes = cache; + currentState.attributesNum = attributesNum; - return this; + currentState.index = index; - }; + } - /** - * @author bhouston / http://clara.io - */ + function initAttributes() { - function Ray( origin, direction ) { + const newAttributes = currentState.newAttributes; - this.origin = ( origin !== undefined ) ? origin : new Vector3(); - this.direction = ( direction !== undefined ) ? direction : new Vector3(); + for ( let i = 0, il = newAttributes.length; i < il; i ++ ) { - } + newAttributes[ i ] = 0; - Object.assign( Ray.prototype, { + } - set: function ( origin, direction ) { + } - this.origin.copy( origin ); - this.direction.copy( direction ); + function enableAttribute( attribute ) { - return this; + enableAttributeAndDivisor( attribute, 0 ); - }, + } - clone: function () { + function enableAttributeAndDivisor( attribute, meshPerAttribute ) { - return new this.constructor().copy( this ); + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; + const attributeDivisors = currentState.attributeDivisors; - }, + newAttributes[ attribute ] = 1; - copy: function ( ray ) { + if ( enabledAttributes[ attribute ] === 0 ) { - this.origin.copy( ray.origin ); - this.direction.copy( ray.direction ); + gl.enableVertexAttribArray( attribute ); + enabledAttributes[ attribute ] = 1; - return this; + } - }, + if ( attributeDivisors[ attribute ] !== meshPerAttribute ) { - at: function ( t, optionalTarget ) { + const extension = capabilities.isWebGL2 ? gl : extensions.get( 'ANGLE_instanced_arrays' ); - var result = optionalTarget || new Vector3(); + extension[ capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ]( attribute, meshPerAttribute ); + attributeDivisors[ attribute ] = meshPerAttribute; - return result.copy( this.direction ).multiplyScalar( t ).add( this.origin ); + } - }, + } - lookAt: function ( v ) { + function disableUnusedAttributes() { - this.direction.copy( v ).sub( this.origin ).normalize(); + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; - return this; + for ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) { - }, + if ( enabledAttributes[ i ] !== newAttributes[ i ] ) { - recast: function () { + gl.disableVertexAttribArray( i ); + enabledAttributes[ i ] = 0; - var v1 = new Vector3(); + } - return function recast( t ) { + } - this.origin.copy( this.at( t, v1 ) ); + } - return this; + function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) { - }; + if ( integer === true ) { - }(), + gl.vertexAttribIPointer( index, size, type, stride, offset ); - closestPointToPoint: function ( point, optionalTarget ) { + } else { - var result = optionalTarget || new Vector3(); - result.subVectors( point, this.origin ); - var directionDistance = result.dot( this.direction ); + gl.vertexAttribPointer( index, size, type, normalized, stride, offset ); - if ( directionDistance < 0 ) { + } - return result.copy( this.origin ); + } - } + function setupVertexAttributes( object, material, program, geometry ) { - return result.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + if ( capabilities.isWebGL2 === false && ( object.isInstancedMesh || geometry.isInstancedBufferGeometry ) ) { - }, + if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) return; - distanceToPoint: function ( point ) { + } - return Math.sqrt( this.distanceSqToPoint( point ) ); + initAttributes(); - }, + const geometryAttributes = geometry.attributes; - distanceSqToPoint: function () { + const programAttributes = program.getAttributes(); - var v1 = new Vector3(); + const materialDefaultAttributeValues = material.defaultAttributeValues; - return function distanceSqToPoint( point ) { + for ( const name in programAttributes ) { - var directionDistance = v1.subVectors( point, this.origin ).dot( this.direction ); + const programAttribute = programAttributes[ name ]; - // point behind the ray + if ( programAttribute.location >= 0 ) { - if ( directionDistance < 0 ) { + let geometryAttribute = geometryAttributes[ name ]; - return this.origin.distanceToSquared( point ); + if ( geometryAttribute === undefined ) { - } + if ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix; + if ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor; - v1.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + } - return v1.distanceToSquared( point ); + if ( geometryAttribute !== undefined ) { - }; + const normalized = geometryAttribute.normalized; + const size = geometryAttribute.itemSize; - }(), + const attribute = attributes.get( geometryAttribute ); - distanceSqToSegment: function () { + // TODO Attribute may not be available on context restore - var segCenter = new Vector3(); - var segDir = new Vector3(); - var diff = new Vector3(); + if ( attribute === undefined ) continue; - return function distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { + const buffer = attribute.buffer; + const type = attribute.type; + const bytesPerElement = attribute.bytesPerElement; - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h - // It returns the min distance between the ray and the segment - // defined by v0 and v1 - // It can also set two optional targets : - // - The closest point on the ray - // - The closest point on the segment + // check for integer attributes (WebGL 2 only) - segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); - segDir.copy( v1 ).sub( v0 ).normalize(); - diff.copy( this.origin ).sub( segCenter ); + const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) ); - var segExtent = v0.distanceTo( v1 ) * 0.5; - var a01 = - this.direction.dot( segDir ); - var b0 = diff.dot( this.direction ); - var b1 = - diff.dot( segDir ); - var c = diff.lengthSq(); - var det = Math.abs( 1 - a01 * a01 ); - var s0, s1, sqrDist, extDet; + if ( geometryAttribute.isInterleavedBufferAttribute ) { - if ( det > 0 ) { + const data = geometryAttribute.data; + const stride = data.stride; + const offset = geometryAttribute.offset; - // The ray and segment are not parallel. + if ( data.isInstancedInterleavedBuffer ) { - s0 = a01 * b1 - b0; - s1 = a01 * b0 - b1; - extDet = segExtent * det; + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - if ( s0 >= 0 ) { + enableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute ); - if ( s1 >= - extDet ) { + } - if ( s1 <= extDet ) { + if ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) { - // region 0 - // Minimum at interior points of ray and segment. + geometry._maxInstanceCount = data.meshPerAttribute * data.count; - var invDet = 1 / det; - s0 *= invDet; - s1 *= invDet; - sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; + } } else { - // region 1 + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - s1 = segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + enableAttribute( programAttribute.location + i ); + + } } - } else { + gl.bindBuffer( gl.ARRAY_BUFFER, buffer ); - // region 5 + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - s1 = - segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + vertexAttribPointer( + programAttribute.location + i, + size / programAttribute.locationSize, + type, + normalized, + stride * bytesPerElement, + ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement, + integer + ); - } - - } else { - - if ( s1 <= - extDet ) { + } - // region 4 + } else { - s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + if ( geometryAttribute.isInstancedBufferAttribute ) { - } else if ( s1 <= extDet ) { + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - // region 3 + enableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute ); - s0 = 0; - s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = s1 * ( s1 + 2 * b1 ) + c; + } - } else { + if ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) { - // region 2 + geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; - s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + } - } + } else { - } + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - } else { + enableAttribute( programAttribute.location + i ); - // Ray and segment are parallel. + } - s1 = ( a01 > 0 ) ? - segExtent : segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + } - } + gl.bindBuffer( gl.ARRAY_BUFFER, buffer ); - if ( optionalPointOnRay ) { + for ( let i = 0; i < programAttribute.locationSize; i ++ ) { - optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); + vertexAttribPointer( + programAttribute.location + i, + size / programAttribute.locationSize, + type, + normalized, + size * bytesPerElement, + ( size / programAttribute.locationSize ) * i * bytesPerElement, + integer + ); - } + } - if ( optionalPointOnSegment ) { + } - optionalPointOnSegment.copy( segDir ).multiplyScalar( s1 ).add( segCenter ); + } else if ( materialDefaultAttributeValues !== undefined ) { - } + const value = materialDefaultAttributeValues[ name ]; - return sqrDist; + if ( value !== undefined ) { - }; + switch ( value.length ) { - }(), + case 2: + gl.vertexAttrib2fv( programAttribute.location, value ); + break; - intersectSphere: function () { + case 3: + gl.vertexAttrib3fv( programAttribute.location, value ); + break; - var v1 = new Vector3(); + case 4: + gl.vertexAttrib4fv( programAttribute.location, value ); + break; - return function intersectSphere( sphere, optionalTarget ) { + default: + gl.vertexAttrib1fv( programAttribute.location, value ); - v1.subVectors( sphere.center, this.origin ); - var tca = v1.dot( this.direction ); - var d2 = v1.dot( v1 ) - tca * tca; - var radius2 = sphere.radius * sphere.radius; + } - if ( d2 > radius2 ) return null; + } - var thc = Math.sqrt( radius2 - d2 ); + } - // t0 = first intersect point - entrance on front of sphere - var t0 = tca - thc; + } - // t1 = second intersect point - exit point on back of sphere - var t1 = tca + thc; + } - // test to see if both t0 and t1 are behind the ray - if so, return null - if ( t0 < 0 && t1 < 0 ) return null; + disableUnusedAttributes(); - // test to see if t0 is behind the ray: - // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, - // in order to always return an intersect point that is in front of the ray. - if ( t0 < 0 ) return this.at( t1, optionalTarget ); + } - // else t0 is in front of the ray, so return the first collision point scaled by t0 - return this.at( t0, optionalTarget ); + function dispose() { - }; + reset(); - }(), + for ( const geometryId in bindingStates ) { - intersectsSphere: function ( sphere ) { + const programMap = bindingStates[ geometryId ]; - return this.distanceToPoint( sphere.center ) <= sphere.radius; + for ( const programId in programMap ) { - }, + const stateMap = programMap[ programId ]; - distanceToPlane: function ( plane ) { + for ( const wireframe in stateMap ) { - var denominator = plane.normal.dot( this.direction ); + deleteVertexArrayObject( stateMap[ wireframe ].object ); - if ( denominator === 0 ) { + delete stateMap[ wireframe ]; - // line is coplanar, return origin - if ( plane.distanceToPoint( this.origin ) === 0 ) { + } - return 0; + delete programMap[ programId ]; } - // Null is preferable to undefined since undefined means.... it is undefined - - return null; + delete bindingStates[ geometryId ]; } - var t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; + } - // Return if the ray never intersects the plane + function releaseStatesOfGeometry( geometry ) { - return t >= 0 ? t : null; + if ( bindingStates[ geometry.id ] === undefined ) return; - }, + const programMap = bindingStates[ geometry.id ]; - intersectPlane: function ( plane, optionalTarget ) { + for ( const programId in programMap ) { - var t = this.distanceToPlane( plane ); + const stateMap = programMap[ programId ]; - if ( t === null ) { + for ( const wireframe in stateMap ) { - return null; + deleteVertexArrayObject( stateMap[ wireframe ].object ); - } + delete stateMap[ wireframe ]; - return this.at( t, optionalTarget ); + } - }, + delete programMap[ programId ]; - intersectsPlane: function ( plane ) { + } - // check if the ray lies on the plane first + delete bindingStates[ geometry.id ]; - var distToPoint = plane.distanceToPoint( this.origin ); + } - if ( distToPoint === 0 ) { + function releaseStatesOfProgram( program ) { - return true; + for ( const geometryId in bindingStates ) { - } + const programMap = bindingStates[ geometryId ]; - var denominator = plane.normal.dot( this.direction ); + if ( programMap[ program.id ] === undefined ) continue; - if ( denominator * distToPoint < 0 ) { + const stateMap = programMap[ program.id ]; - return true; + for ( const wireframe in stateMap ) { - } + deleteVertexArrayObject( stateMap[ wireframe ].object ); - // ray origin is behind the plane (and is pointing behind it) + delete stateMap[ wireframe ]; - return false; + } - }, + delete programMap[ program.id ]; - intersectBox: function ( box, optionalTarget ) { + } - var tmin, tmax, tymin, tymax, tzmin, tzmax; + } - var invdirx = 1 / this.direction.x, - invdiry = 1 / this.direction.y, - invdirz = 1 / this.direction.z; + function reset() { - var origin = this.origin; + resetDefaultState(); + forceUpdate = true; - if ( invdirx >= 0 ) { + if ( currentState === defaultState ) return; - tmin = ( box.min.x - origin.x ) * invdirx; - tmax = ( box.max.x - origin.x ) * invdirx; + currentState = defaultState; + bindVertexArrayObject( currentState.object ); - } else { + } - tmin = ( box.max.x - origin.x ) * invdirx; - tmax = ( box.min.x - origin.x ) * invdirx; + // for backward-compatibility - } + function resetDefaultState() { - if ( invdiry >= 0 ) { + defaultState.geometry = null; + defaultState.program = null; + defaultState.wireframe = false; - tymin = ( box.min.y - origin.y ) * invdiry; - tymax = ( box.max.y - origin.y ) * invdiry; + } - } else { + return { - tymin = ( box.max.y - origin.y ) * invdiry; - tymax = ( box.min.y - origin.y ) * invdiry; + setup: setup, + reset: reset, + resetDefaultState: resetDefaultState, + dispose: dispose, + releaseStatesOfGeometry: releaseStatesOfGeometry, + releaseStatesOfProgram: releaseStatesOfProgram, - } + initAttributes: initAttributes, + enableAttribute: enableAttribute, + disableUnusedAttributes: disableUnusedAttributes - if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; + }; - // These lines also handle the case where tmin or tmax is NaN - // (result of 0 * Infinity). x !== x returns true if x is NaN + } - if ( tymin > tmin || tmin !== tmin ) tmin = tymin; + function WebGLBufferRenderer( gl, extensions, info, capabilities ) { - if ( tymax < tmax || tmax !== tmax ) tmax = tymax; + const isWebGL2 = capabilities.isWebGL2; - if ( invdirz >= 0 ) { + let mode; - tzmin = ( box.min.z - origin.z ) * invdirz; - tzmax = ( box.max.z - origin.z ) * invdirz; + function setMode( value ) { - } else { + mode = value; - tzmin = ( box.max.z - origin.z ) * invdirz; - tzmax = ( box.min.z - origin.z ) * invdirz; + } - } + function render( start, count ) { - if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; + gl.drawArrays( mode, start, count ); - if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; + info.update( count, mode, 1 ); - if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; + } - //return point closest to the ray (positive side) + function renderInstances( start, count, primcount ) { - if ( tmax < 0 ) return null; + if ( primcount === 0 ) return; - return this.at( tmin >= 0 ? tmin : tmax, optionalTarget ); + let extension, methodName; - }, + if ( isWebGL2 ) { - intersectsBox: ( function () { + extension = gl; + methodName = 'drawArraysInstanced'; - var v = new Vector3(); + } else { - return function intersectsBox( box ) { + extension = extensions.get( 'ANGLE_instanced_arrays' ); + methodName = 'drawArraysInstancedANGLE'; - return this.intersectBox( box, v ) !== null; + if ( extension === null ) { - }; + console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; - } )(), + } - intersectTriangle: function () { + } - // Compute the offset origin, edges, and normal. - var diff = new Vector3(); - var edge1 = new Vector3(); - var edge2 = new Vector3(); - var normal = new Vector3(); + extension[ methodName ]( mode, start, count, primcount ); - return function intersectTriangle( a, b, c, backfaceCulling, optionalTarget ) { + info.update( count, mode, primcount ); - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h + } - edge1.subVectors( b, a ); - edge2.subVectors( c, a ); - normal.crossVectors( edge1, edge2 ); + // - // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, - // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by - // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) - // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) - // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) - var DdN = this.direction.dot( normal ); - var sign; + this.setMode = setMode; + this.render = render; + this.renderInstances = renderInstances; - if ( DdN > 0 ) { + } - if ( backfaceCulling ) return null; - sign = 1; + function WebGLCapabilities( gl, extensions, parameters ) { - } else if ( DdN < 0 ) { + let maxAnisotropy; - sign = - 1; - DdN = - DdN; + function getMaxAnisotropy() { - } else { + if ( maxAnisotropy !== undefined ) return maxAnisotropy; - return null; + if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) { - } + const extension = extensions.get( 'EXT_texture_filter_anisotropic' ); - diff.subVectors( this.origin, a ); - var DdQxE2 = sign * this.direction.dot( edge2.crossVectors( diff, edge2 ) ); + maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ); - // b1 < 0, no intersection - if ( DdQxE2 < 0 ) { + } else { - return null; + maxAnisotropy = 0; - } + } - var DdE1xQ = sign * this.direction.dot( edge1.cross( diff ) ); + return maxAnisotropy; - // b2 < 0, no intersection - if ( DdE1xQ < 0 ) { + } - return null; + function getMaxPrecision( precision ) { - } + if ( precision === 'highp' ) { - // b1+b2 > 1, no intersection - if ( DdQxE2 + DdE1xQ > DdN ) { + if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 && + gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) { - return null; + return 'highp'; } - // Line intersects triangle, check if ray does. - var QdN = - sign * diff.dot( normal ); + precision = 'mediump'; - // t < 0, no intersection - if ( QdN < 0 ) { + } - return null; + if ( precision === 'mediump' ) { - } + if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 && + gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) { - // Ray intersects triangle. - return this.at( QdN / DdN, optionalTarget ); + return 'mediump'; - }; + } - }(), + } - applyMatrix4: function ( matrix4 ) { + return 'lowp'; - this.origin.applyMatrix4( matrix4 ); - this.direction.transformDirection( matrix4 ); + } - return this; + const isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl.constructor.name === 'WebGL2RenderingContext'; - }, + let precision = parameters.precision !== undefined ? parameters.precision : 'highp'; + const maxPrecision = getMaxPrecision( precision ); - equals: function ( ray ) { + if ( maxPrecision !== precision ) { - return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); + console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' ); + precision = maxPrecision; } - } ); - - /** - * @author bhouston / http://clara.io - */ + const drawBuffers = isWebGL2 || extensions.has( 'WEBGL_draw_buffers' ); - function Line3( start, end ) { + const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true; - this.start = ( start !== undefined ) ? start : new Vector3(); - this.end = ( end !== undefined ) ? end : new Vector3(); + const maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); + const maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ); + const maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE ); + const maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE ); - } + const maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); + const maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS ); + const maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS ); + const maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS ); - Object.assign( Line3.prototype, { + const vertexTextures = maxVertexTextures > 0; + const floatFragmentTextures = isWebGL2 || extensions.has( 'OES_texture_float' ); + const floatVertexTextures = vertexTextures && floatFragmentTextures; - set: function ( start, end ) { + const maxSamples = isWebGL2 ? gl.getParameter( gl.MAX_SAMPLES ) : 0; - this.start.copy( start ); - this.end.copy( end ); + return { - return this; + isWebGL2: isWebGL2, - }, + drawBuffers: drawBuffers, - clone: function () { + getMaxAnisotropy: getMaxAnisotropy, + getMaxPrecision: getMaxPrecision, - return new this.constructor().copy( this ); + precision: precision, + logarithmicDepthBuffer: logarithmicDepthBuffer, - }, + maxTextures: maxTextures, + maxVertexTextures: maxVertexTextures, + maxTextureSize: maxTextureSize, + maxCubemapSize: maxCubemapSize, - copy: function ( line ) { + maxAttributes: maxAttributes, + maxVertexUniforms: maxVertexUniforms, + maxVaryings: maxVaryings, + maxFragmentUniforms: maxFragmentUniforms, - this.start.copy( line.start ); - this.end.copy( line.end ); + vertexTextures: vertexTextures, + floatFragmentTextures: floatFragmentTextures, + floatVertexTextures: floatVertexTextures, - return this; + maxSamples: maxSamples - }, + }; - getCenter: function ( optionalTarget ) { + } - var result = optionalTarget || new Vector3(); - return result.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); + function WebGLClipping( properties ) { - }, + const scope = this; - delta: function ( optionalTarget ) { + let globalState = null, + numGlobalPlanes = 0, + localClippingEnabled = false, + renderingShadows = false; - var result = optionalTarget || new Vector3(); - return result.subVectors( this.end, this.start ); + const plane = new Plane(), + viewNormalMatrix = new Matrix3(), - }, + uniform = { value: null, needsUpdate: false }; - distanceSq: function () { + this.uniform = uniform; + this.numPlanes = 0; + this.numIntersection = 0; - return this.start.distanceToSquared( this.end ); + this.init = function ( planes, enableLocalClipping ) { - }, + const enabled = + planes.length !== 0 || + enableLocalClipping || + // enable state of previous frame - the clipping code has to + // run another frame in order to reset the state: + numGlobalPlanes !== 0 || + localClippingEnabled; - distance: function () { + localClippingEnabled = enableLocalClipping; - return this.start.distanceTo( this.end ); + numGlobalPlanes = planes.length; - }, + return enabled; - at: function ( t, optionalTarget ) { + }; - var result = optionalTarget || new Vector3(); + this.beginShadows = function () { - return this.delta( result ).multiplyScalar( t ).add( this.start ); + renderingShadows = true; + projectPlanes( null ); - }, + }; - closestPointToPointParameter: function () { + this.endShadows = function () { - var startP = new Vector3(); - var startEnd = new Vector3(); + renderingShadows = false; - return function closestPointToPointParameter( point, clampToLine ) { + }; - startP.subVectors( point, this.start ); - startEnd.subVectors( this.end, this.start ); + this.setGlobalState = function ( planes, camera ) { - var startEnd2 = startEnd.dot( startEnd ); - var startEnd_startP = startEnd.dot( startP ); + globalState = projectPlanes( planes, camera, 0 ); - var t = startEnd_startP / startEnd2; + }; - if ( clampToLine ) { + this.setState = function ( material, camera, useCache ) { - t = _Math.clamp( t, 0, 1 ); + const planes = material.clippingPlanes, + clipIntersection = material.clipIntersection, + clipShadows = material.clipShadows; - } + const materialProperties = properties.get( material ); - return t; + if ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) { - }; + // there's no local clipping - }(), + if ( renderingShadows ) { - closestPointToPoint: function ( point, clampToLine, optionalTarget ) { + // there's no global clipping - var t = this.closestPointToPointParameter( point, clampToLine ); + projectPlanes( null ); - var result = optionalTarget || new Vector3(); + } else { - return this.delta( result ).multiplyScalar( t ).add( this.start ); + resetGlobalState(); - }, + } - applyMatrix4: function ( matrix ) { + } else { - this.start.applyMatrix4( matrix ); - this.end.applyMatrix4( matrix ); + const nGlobal = renderingShadows ? 0 : numGlobalPlanes, + lGlobal = nGlobal * 4; - return this; + let dstArray = materialProperties.clippingState || null; - }, + uniform.value = dstArray; // ensure unique state - equals: function ( line ) { + dstArray = projectPlanes( planes, camera, lGlobal, useCache ); - return line.start.equals( this.start ) && line.end.equals( this.end ); + for ( let i = 0; i !== lGlobal; ++ i ) { - } + dstArray[ i ] = globalState[ i ]; - } ); + } - /** - * @author bhouston / http://clara.io - * @author mrdoob / http://mrdoob.com/ - */ - - function Triangle( a, b, c ) { + materialProperties.clippingState = dstArray; + this.numIntersection = clipIntersection ? this.numPlanes : 0; + this.numPlanes += nGlobal; - this.a = ( a !== undefined ) ? a : new Vector3(); - this.b = ( b !== undefined ) ? b : new Vector3(); - this.c = ( c !== undefined ) ? c : new Vector3(); + } - } - Object.assign( Triangle, { + }; - normal: function () { + function resetGlobalState() { - var v0 = new Vector3(); + if ( uniform.value !== globalState ) { - return function normal( a, b, c, optionalTarget ) { + uniform.value = globalState; + uniform.needsUpdate = numGlobalPlanes > 0; - var result = optionalTarget || new Vector3(); + } - result.subVectors( c, b ); - v0.subVectors( a, b ); - result.cross( v0 ); + scope.numPlanes = numGlobalPlanes; + scope.numIntersection = 0; - var resultLengthSq = result.lengthSq(); - if ( resultLengthSq > 0 ) { + } - return result.multiplyScalar( 1 / Math.sqrt( resultLengthSq ) ); + function projectPlanes( planes, camera, dstOffset, skipTransform ) { - } + const nPlanes = planes !== null ? planes.length : 0; + let dstArray = null; - return result.set( 0, 0, 0 ); + if ( nPlanes !== 0 ) { - }; + dstArray = uniform.value; - }(), + if ( skipTransform !== true || dstArray === null ) { - // static/instance method to calculate barycentric coordinates - // based on: http://www.blackpawn.com/texts/pointinpoly/default.html - barycoordFromPoint: function () { + const flatSize = dstOffset + nPlanes * 4, + viewMatrix = camera.matrixWorldInverse; - var v0 = new Vector3(); - var v1 = new Vector3(); - var v2 = new Vector3(); + viewNormalMatrix.getNormalMatrix( viewMatrix ); - return function barycoordFromPoint( point, a, b, c, optionalTarget ) { + if ( dstArray === null || dstArray.length < flatSize ) { - v0.subVectors( c, a ); - v1.subVectors( b, a ); - v2.subVectors( point, a ); + dstArray = new Float32Array( flatSize ); - var dot00 = v0.dot( v0 ); - var dot01 = v0.dot( v1 ); - var dot02 = v0.dot( v2 ); - var dot11 = v1.dot( v1 ); - var dot12 = v1.dot( v2 ); + } - var denom = ( dot00 * dot11 - dot01 * dot01 ); + for ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) { - var result = optionalTarget || new Vector3(); + plane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix ); - // collinear or singular triangle - if ( denom === 0 ) { + plane.normal.toArray( dstArray, i4 ); + dstArray[ i4 + 3 ] = plane.constant; - // arbitrary location outside of triangle? - // not sure if this is the best idea, maybe should be returning undefined - return result.set( - 2, - 1, - 1 ); + } } - var invDenom = 1 / denom; - var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; - var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; + uniform.value = dstArray; + uniform.needsUpdate = true; - // barycentric coordinates must always sum to 1 - return result.set( 1 - u - v, v, u ); + } - }; + scope.numPlanes = nPlanes; + scope.numIntersection = 0; - }(), + return dstArray; - containsPoint: function () { + } - var v1 = new Vector3(); + } - return function containsPoint( point, a, b, c ) { + function WebGLCubeMaps( renderer ) { - var result = Triangle.barycoordFromPoint( point, a, b, c, v1 ); + let cubemaps = new WeakMap(); - return ( result.x >= 0 ) && ( result.y >= 0 ) && ( ( result.x + result.y ) <= 1 ); + function mapTextureMapping( texture, mapping ) { - }; + if ( mapping === EquirectangularReflectionMapping ) { - }() + texture.mapping = CubeReflectionMapping; - } ); + } else if ( mapping === EquirectangularRefractionMapping ) { - Object.assign( Triangle.prototype, { + texture.mapping = CubeRefractionMapping; - set: function ( a, b, c ) { + } - this.a.copy( a ); - this.b.copy( b ); - this.c.copy( c ); + return texture; - return this; + } - }, + function get( texture ) { - setFromPointsAndIndices: function ( points, i0, i1, i2 ) { + if ( texture && texture.isTexture && texture.isRenderTargetTexture === false ) { - this.a.copy( points[ i0 ] ); - this.b.copy( points[ i1 ] ); - this.c.copy( points[ i2 ] ); + const mapping = texture.mapping; - return this; + if ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) { - }, + if ( cubemaps.has( texture ) ) { - clone: function () { + const cubemap = cubemaps.get( texture ).texture; + return mapTextureMapping( cubemap, texture.mapping ); - return new this.constructor().copy( this ); + } else { - }, + const image = texture.image; - copy: function ( triangle ) { + if ( image && image.height > 0 ) { - this.a.copy( triangle.a ); - this.b.copy( triangle.b ); - this.c.copy( triangle.c ); + const renderTarget = new WebGLCubeRenderTarget( image.height / 2 ); + renderTarget.fromEquirectangularTexture( renderer, texture ); + cubemaps.set( texture, renderTarget ); - return this; + texture.addEventListener( 'dispose', onTextureDispose ); - }, + return mapTextureMapping( renderTarget.texture, texture.mapping ); - area: function () { + } else { - var v0 = new Vector3(); - var v1 = new Vector3(); + // image not yet ready. try the conversion next frame - return function area() { + return null; - v0.subVectors( this.c, this.b ); - v1.subVectors( this.a, this.b ); + } - return v0.cross( v1 ).length() * 0.5; + } - }; + } - }(), + } - midpoint: function ( optionalTarget ) { + return texture; - var result = optionalTarget || new Vector3(); - return result.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); + } - }, + function onTextureDispose( event ) { - normal: function ( optionalTarget ) { + const texture = event.target; - return Triangle.normal( this.a, this.b, this.c, optionalTarget ); + texture.removeEventListener( 'dispose', onTextureDispose ); - }, + const cubemap = cubemaps.get( texture ); - plane: function ( optionalTarget ) { + if ( cubemap !== undefined ) { - var result = optionalTarget || new Plane(); + cubemaps.delete( texture ); + cubemap.dispose(); - return result.setFromCoplanarPoints( this.a, this.b, this.c ); + } - }, + } - barycoordFromPoint: function ( point, optionalTarget ) { + function dispose() { - return Triangle.barycoordFromPoint( point, this.a, this.b, this.c, optionalTarget ); + cubemaps = new WeakMap(); - }, + } - containsPoint: function ( point ) { + return { + get: get, + dispose: dispose + }; - return Triangle.containsPoint( point, this.a, this.b, this.c ); + } - }, + class OrthographicCamera extends Camera { - closestPointToPoint: function () { + constructor( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) { - var plane = new Plane(); - var edgeList = [ new Line3(), new Line3(), new Line3() ]; - var projectedPoint = new Vector3(); - var closestPoint = new Vector3(); + super(); - return function closestPointToPoint( point, optionalTarget ) { + this.isOrthographicCamera = true; - var result = optionalTarget || new Vector3(); - var minDistance = Infinity; + this.type = 'OrthographicCamera'; - // project the point onto the plane of the triangle + this.zoom = 1; + this.view = null; - plane.setFromCoplanarPoints( this.a, this.b, this.c ); - plane.projectPoint( point, projectedPoint ); + this.left = left; + this.right = right; + this.top = top; + this.bottom = bottom; - // check if the projection lies within the triangle + this.near = near; + this.far = far; - if( this.containsPoint( projectedPoint ) === true ) { + this.updateProjectionMatrix(); - // if so, this is the closest point + } - result.copy( projectedPoint ); + copy( source, recursive ) { - } else { + super.copy( source, recursive ); - // if not, the point falls outside the triangle. the result is the closest point to the triangle's edges or vertices + this.left = source.left; + this.right = source.right; + this.top = source.top; + this.bottom = source.bottom; + this.near = source.near; + this.far = source.far; - edgeList[ 0 ].set( this.a, this.b ); - edgeList[ 1 ].set( this.b, this.c ); - edgeList[ 2 ].set( this.c, this.a ); + this.zoom = source.zoom; + this.view = source.view === null ? null : Object.assign( {}, source.view ); - for( var i = 0; i < edgeList.length; i ++ ) { + return this; - edgeList[ i ].closestPointToPoint( projectedPoint, true, closestPoint ); + } - var distance = projectedPoint.distanceToSquared( closestPoint ); + setViewOffset( fullWidth, fullHeight, x, y, width, height ) { - if( distance < minDistance ) { + if ( this.view === null ) { - minDistance = distance; + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; - result.copy( closestPoint ); + } - } + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x; + this.view.offsetY = y; + this.view.width = width; + this.view.height = height; - } + this.updateProjectionMatrix(); - } + } - return result; + clearViewOffset() { - }; + if ( this.view !== null ) { - }(), + this.view.enabled = false; - equals: function ( triangle ) { + } - return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); + this.updateProjectionMatrix(); } - } ); - - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author jonobr1 / http://jonobr1.com/ - */ + updateProjectionMatrix() { - function Mesh( geometry, material ) { + const dx = ( this.right - this.left ) / ( 2 * this.zoom ); + const dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); + const cx = ( this.right + this.left ) / 2; + const cy = ( this.top + this.bottom ) / 2; - Object3D.call( this ); + let left = cx - dx; + let right = cx + dx; + let top = cy + dy; + let bottom = cy - dy; - this.type = 'Mesh'; + if ( this.view !== null && this.view.enabled ) { - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new MeshBasicMaterial( { color: Math.random() * 0xffffff } ); + const scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom; + const scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom; - this.drawMode = TrianglesDrawMode; + left += scaleW * this.view.offsetX; + right = left + scaleW * this.view.width; + top -= scaleH * this.view.offsetY; + bottom = top - scaleH * this.view.height; - this.updateMorphTargets(); + } - } + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem ); - Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), { + this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); - constructor: Mesh, + } - isMesh: true, + toJSON( meta ) { - setDrawMode: function ( value ) { + const data = super.toJSON( meta ); - this.drawMode = value; + data.object.zoom = this.zoom; + data.object.left = this.left; + data.object.right = this.right; + data.object.top = this.top; + data.object.bottom = this.bottom; + data.object.near = this.near; + data.object.far = this.far; - }, + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); - copy: function ( source ) { + return data; - Object3D.prototype.copy.call( this, source ); + } - this.drawMode = source.drawMode; + } - return this; + const LOD_MIN = 4; - }, + // The standard deviations (radians) associated with the extra mips. These are + // chosen to approximate a Trowbridge-Reitz distribution function times the + // geometric shadowing function. These sigma values squared must match the + // variance #defines in cube_uv_reflection_fragment.glsl.js. + const EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ]; - updateMorphTargets: function () { + // The maximum length of the blur for loop. Smaller sigmas will use fewer + // samples and exit early, but not recompile the shader. + const MAX_SAMPLES = 20; - var geometry = this.geometry; - var m, ml, name; + const _flatCamera = /*@__PURE__*/ new OrthographicCamera(); + const _clearColor = /*@__PURE__*/ new Color(); + let _oldTarget = null; - if ( geometry.isBufferGeometry ) { + // Golden Ratio + const PHI = ( 1 + Math.sqrt( 5 ) ) / 2; + const INV_PHI = 1 / PHI; - var morphAttributes = geometry.morphAttributes; - var keys = Object.keys( morphAttributes ); + // Vertices of a dodecahedron (except the opposites, which represent the + // same axis), used as axis directions evenly spread on a sphere. + const _axisDirections = [ + /*@__PURE__*/ new Vector3( 1, 1, 1 ), + /*@__PURE__*/ new Vector3( - 1, 1, 1 ), + /*@__PURE__*/ new Vector3( 1, 1, - 1 ), + /*@__PURE__*/ new Vector3( - 1, 1, - 1 ), + /*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ), + /*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ), + /*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ), + /*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ), + /*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ), + /*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ) ]; - if ( keys.length > 0 ) { + /** + * This class generates a Prefiltered, Mipmapped Radiance Environment Map + * (PMREM) from a cubeMap environment texture. This allows different levels of + * blur to be quickly accessed based on material roughness. It is packed into a + * special CubeUV format that allows us to perform custom interpolation so that + * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap + * chain, it only goes down to the LOD_MIN level (above), and then creates extra + * even more filtered 'mips' at the same LOD_MIN resolution, associated with + * higher roughness levels. In this way we maintain resolution to smoothly + * interpolate diffuse lighting while limiting sampling computation. + * + * Paper: Fast, Accurate Image-Based Lighting + * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view + */ - var morphAttribute = morphAttributes[ keys[ 0 ] ]; + class PMREMGenerator { - if ( morphAttribute !== undefined ) { + constructor( renderer ) { - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; + this._renderer = renderer; + this._pingPongRenderTarget = null; - for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) { + this._lodMax = 0; + this._cubeSize = 0; + this._lodPlanes = []; + this._sizeLods = []; + this._sigmas = []; - name = morphAttribute[ m ].name || String( m ); + this._blurMaterial = null; + this._cubemapMaterial = null; + this._equirectMaterial = null; - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ name ] = m; + this._compileMaterial( this._blurMaterial ); - } + } - } + /** + * Generates a PMREM from a supplied Scene, which can be faster than using an + * image if networking bandwidth is low. Optional sigma specifies a blur radius + * in radians to be applied to the scene before PMREM generation. Optional near + * and far planes ensure the scene is rendered in its entirety (the cubeCamera + * is placed at the origin). + */ + fromScene( scene, sigma = 0, near = 0.1, far = 100 ) { - } + _oldTarget = this._renderer.getRenderTarget(); - } else { + this._setSize( 256 ); - var morphTargets = geometry.morphTargets; + const cubeUVRenderTarget = this._allocateTargets(); + cubeUVRenderTarget.depthBuffer = true; - if ( morphTargets !== undefined && morphTargets.length > 0 ) { + this._sceneToCubeUV( scene, near, far, cubeUVRenderTarget ); - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; + if ( sigma > 0 ) { - for ( m = 0, ml = morphTargets.length; m < ml; m ++ ) { + this._blur( cubeUVRenderTarget, 0, 0, sigma ); - name = morphTargets[ m ].name || String( m ); + } - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ name ] = m; + this._applyPMREM( cubeUVRenderTarget ); + this._cleanup( cubeUVRenderTarget ); - } + return cubeUVRenderTarget; - } + } - } + /** + * Generates a PMREM from an equirectangular texture, which can be either LDR + * or HDR. The ideal input image size is 1k (1024 x 512), + * as this matches best with the 256 x 256 cubemap output. + */ + fromEquirectangular( equirectangular, renderTarget = null ) { - }, + return this._fromTexture( equirectangular, renderTarget ); - raycast: ( function () { + } - var inverseMatrix = new Matrix4(); - var ray = new Ray(); - var sphere = new Sphere(); + /** + * Generates a PMREM from an cubemap texture, which can be either LDR + * or HDR. The ideal input cube size is 256 x 256, + * as this matches best with the 256 x 256 cubemap output. + */ + fromCubemap( cubemap, renderTarget = null ) { - var vA = new Vector3(); - var vB = new Vector3(); - var vC = new Vector3(); + return this._fromTexture( cubemap, renderTarget ); - var tempA = new Vector3(); - var tempB = new Vector3(); - var tempC = new Vector3(); + } - var uvA = new Vector2(); - var uvB = new Vector2(); - var uvC = new Vector2(); + /** + * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + */ + compileCubemapShader() { - var barycoord = new Vector3(); + if ( this._cubemapMaterial === null ) { - var intersectionPoint = new Vector3(); - var intersectionPointWorld = new Vector3(); + this._cubemapMaterial = _getCubemapMaterial(); + this._compileMaterial( this._cubemapMaterial ); - function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) { + } - Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord ); + } - uv1.multiplyScalar( barycoord.x ); - uv2.multiplyScalar( barycoord.y ); - uv3.multiplyScalar( barycoord.z ); + /** + * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + */ + compileEquirectangularShader() { - uv1.add( uv2 ).add( uv3 ); + if ( this._equirectMaterial === null ) { - return uv1.clone(); + this._equirectMaterial = _getEquirectMaterial(); + this._compileMaterial( this._equirectMaterial ); } - function checkIntersection( object, raycaster, ray, pA, pB, pC, point ) { + } - var intersect; - var material = object.material; + /** + * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, + * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on + * one of them will cause any others to also become unusable. + */ + dispose() { - if ( material.side === BackSide ) { + this._dispose(); - intersect = ray.intersectTriangle( pC, pB, pA, true, point ); + if ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose(); + if ( this._equirectMaterial !== null ) this._equirectMaterial.dispose(); - } else { + } - intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point ); + // private interface - } + _setSize( cubeSize ) { - if ( intersect === null ) return null; + this._lodMax = Math.floor( Math.log2( cubeSize ) ); + this._cubeSize = Math.pow( 2, this._lodMax ); - intersectionPointWorld.copy( point ); - intersectionPointWorld.applyMatrix4( object.matrixWorld ); + } - var distance = raycaster.ray.origin.distanceTo( intersectionPointWorld ); + _dispose() { - if ( distance < raycaster.near || distance > raycaster.far ) return null; + if ( this._blurMaterial !== null ) this._blurMaterial.dispose(); - return { - distance: distance, - point: intersectionPointWorld.clone(), - object: object - }; + if ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose(); - } + for ( let i = 0; i < this._lodPlanes.length; i ++ ) { - function checkBufferGeometryIntersection( object, raycaster, ray, position, uv, a, b, c ) { + this._lodPlanes[ i ].dispose(); - vA.fromBufferAttribute( position, a ); - vB.fromBufferAttribute( position, b ); - vC.fromBufferAttribute( position, c ); + } - var intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint ); + } - if ( intersection ) { + _cleanup( outputTarget ) { - if ( uv ) { + this._renderer.setRenderTarget( _oldTarget ); + outputTarget.scissorTest = false; + _setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height ); - uvA.fromBufferAttribute( uv, a ); - uvB.fromBufferAttribute( uv, b ); - uvC.fromBufferAttribute( uv, c ); + } - intersection.uv = uvIntersection( intersectionPoint, vA, vB, vC, uvA, uvB, uvC ); + _fromTexture( texture, renderTarget ) { - } + if ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ) { - intersection.face = new Face3( a, b, c, Triangle.normal( vA, vB, vC ) ); - intersection.faceIndex = a; + this._setSize( texture.image.length === 0 ? 16 : ( texture.image[ 0 ].width || texture.image[ 0 ].image.width ) ); - } + } else { // Equirectangular - return intersection; + this._setSize( texture.image.width / 4 ); } - return function raycast( raycaster, intersects ) { + _oldTarget = this._renderer.getRenderTarget(); - var geometry = this.geometry; - var material = this.material; - var matrixWorld = this.matrixWorld; + const cubeUVRenderTarget = renderTarget || this._allocateTargets(); + this._textureToCubeUV( texture, cubeUVRenderTarget ); + this._applyPMREM( cubeUVRenderTarget ); + this._cleanup( cubeUVRenderTarget ); - if ( material === undefined ) return; + return cubeUVRenderTarget; - // Checking boundingSphere distance to ray - - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + } - sphere.copy( geometry.boundingSphere ); - sphere.applyMatrix4( matrixWorld ); + _allocateTargets() { - if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + const width = 3 * Math.max( this._cubeSize, 16 * 7 ); + const height = 4 * this._cubeSize; - // + const params = { + magFilter: LinearFilter, + minFilter: LinearFilter, + generateMipmaps: false, + type: HalfFloatType, + format: RGBAFormat, + colorSpace: LinearSRGBColorSpace, + depthBuffer: false + }; - inverseMatrix.getInverse( matrixWorld ); - ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + const cubeUVRenderTarget = _createRenderTarget( width, height, params ); - // Check boundingBox before continuing + if ( this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width || this._pingPongRenderTarget.height !== height ) { - if ( geometry.boundingBox !== null ) { + if ( this._pingPongRenderTarget !== null ) { - if ( ray.intersectsBox( geometry.boundingBox ) === false ) return; + this._dispose(); } - var intersection; - - if ( geometry.isBufferGeometry ) { + this._pingPongRenderTarget = _createRenderTarget( width, height, params ); - var a, b, c; - var index = geometry.index; - var position = geometry.attributes.position; - var uv = geometry.attributes.uv; - var i, l; + const { _lodMax } = this; + ( { sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes( _lodMax ) ); - if ( index !== null ) { + this._blurMaterial = _getBlurShader( _lodMax, width, height ); - // indexed buffer geometry - - for ( i = 0, l = index.count; i < l; i += 3 ) { + } - a = index.getX( i ); - b = index.getX( i + 1 ); - c = index.getX( i + 2 ); + return cubeUVRenderTarget; - intersection = checkBufferGeometryIntersection( this, raycaster, ray, position, uv, a, b, c ); + } - if ( intersection ) { + _compileMaterial( material ) { - intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics - intersects.push( intersection ); + const tmpMesh = new Mesh( this._lodPlanes[ 0 ], material ); + this._renderer.compile( tmpMesh, _flatCamera ); - } + } - } + _sceneToCubeUV( scene, near, far, cubeUVRenderTarget ) { - } else { + const fov = 90; + const aspect = 1; + const cubeCamera = new PerspectiveCamera( fov, aspect, near, far ); + const upSign = [ 1, - 1, 1, 1, 1, 1 ]; + const forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ]; + const renderer = this._renderer; - // non-indexed buffer geometry + const originalAutoClear = renderer.autoClear; + const toneMapping = renderer.toneMapping; + renderer.getClearColor( _clearColor ); - for ( i = 0, l = position.count; i < l; i += 3 ) { + renderer.toneMapping = NoToneMapping; + renderer.autoClear = false; - a = i; - b = i + 1; - c = i + 2; + const backgroundMaterial = new MeshBasicMaterial( { + name: 'PMREM.Background', + side: BackSide, + depthWrite: false, + depthTest: false, + } ); - intersection = checkBufferGeometryIntersection( this, raycaster, ray, position, uv, a, b, c ); + const backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial ); - if ( intersection ) { + let useSolidColor = false; + const background = scene.background; - intersection.index = a; // triangle number in positions buffer semantics - intersects.push( intersection ); + if ( background ) { - } + if ( background.isColor ) { - } + backgroundMaterial.color.copy( background ); + scene.background = null; + useSolidColor = true; - } + } - } else if ( geometry.isGeometry ) { + } else { - var fvA, fvB, fvC; - var isMultiMaterial = Array.isArray( material ); + backgroundMaterial.color.copy( _clearColor ); + useSolidColor = true; - var vertices = geometry.vertices; - var faces = geometry.faces; - var uvs; + } - var faceVertexUvs = geometry.faceVertexUvs[ 0 ]; - if ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs; + for ( let i = 0; i < 6; i ++ ) { - for ( var f = 0, fl = faces.length; f < fl; f ++ ) { + const col = i % 3; - var face = faces[ f ]; - var faceMaterial = isMultiMaterial ? material[ face.materialIndex ] : material; + if ( col === 0 ) { - if ( faceMaterial === undefined ) continue; + cubeCamera.up.set( 0, upSign[ i ], 0 ); + cubeCamera.lookAt( forwardSign[ i ], 0, 0 ); - fvA = vertices[ face.a ]; - fvB = vertices[ face.b ]; - fvC = vertices[ face.c ]; + } else if ( col === 1 ) { - if ( faceMaterial.morphTargets === true ) { + cubeCamera.up.set( 0, 0, upSign[ i ] ); + cubeCamera.lookAt( 0, forwardSign[ i ], 0 ); - var morphTargets = geometry.morphTargets; - var morphInfluences = this.morphTargetInfluences; + } else { - vA.set( 0, 0, 0 ); - vB.set( 0, 0, 0 ); - vC.set( 0, 0, 0 ); + cubeCamera.up.set( 0, upSign[ i ], 0 ); + cubeCamera.lookAt( 0, 0, forwardSign[ i ] ); - for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) { + } - var influence = morphInfluences[ t ]; + const size = this._cubeSize; - if ( influence === 0 ) continue; + _setViewport( cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size ); - var targets = morphTargets[ t ].vertices; + renderer.setRenderTarget( cubeUVRenderTarget ); - vA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence ); - vB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence ); - vC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence ); + if ( useSolidColor ) { - } + renderer.render( backgroundBox, cubeCamera ); - vA.add( fvA ); - vB.add( fvB ); - vC.add( fvC ); + } - fvA = vA; - fvB = vB; - fvC = vC; + renderer.render( scene, cubeCamera ); - } + } - intersection = checkIntersection( this, raycaster, ray, fvA, fvB, fvC, intersectionPoint ); + backgroundBox.geometry.dispose(); + backgroundBox.material.dispose(); - if ( intersection ) { + renderer.toneMapping = toneMapping; + renderer.autoClear = originalAutoClear; + scene.background = background; - if ( uvs && uvs[ f ] ) { + } - var uvs_f = uvs[ f ]; - uvA.copy( uvs_f[ 0 ] ); - uvB.copy( uvs_f[ 1 ] ); - uvC.copy( uvs_f[ 2 ] ); + _textureToCubeUV( texture, cubeUVRenderTarget ) { - intersection.uv = uvIntersection( intersectionPoint, fvA, fvB, fvC, uvA, uvB, uvC ); + const renderer = this._renderer; - } + const isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ); - intersection.face = face; - intersection.faceIndex = f; - intersects.push( intersection ); + if ( isCubeTexture ) { - } + if ( this._cubemapMaterial === null ) { - } + this._cubemapMaterial = _getCubemapMaterial(); } - }; + this._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? - 1 : 1; - }() ), + } else { - clone: function () { + if ( this._equirectMaterial === null ) { - return new this.constructor( this.geometry, this.material ).copy( this ); + this._equirectMaterial = _getEquirectMaterial(); - } + } - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + const material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial; + const mesh = new Mesh( this._lodPlanes[ 0 ], material ); - function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { + const uniforms = material.uniforms; - var clearColor = new Color( 0x000000 ); - var clearAlpha = 0; + uniforms[ 'envMap' ].value = texture; - var planeCamera, planeMesh; - var boxCamera, boxMesh; + const size = this._cubeSize; - function render( scene, camera, forceClear ) { + _setViewport( cubeUVRenderTarget, 0, 0, 3 * size, 2 * size ); - var background = scene.background; + renderer.setRenderTarget( cubeUVRenderTarget ); + renderer.render( mesh, _flatCamera ); - if ( background === null ) { + } - setClear( clearColor, clearAlpha ); + _applyPMREM( cubeUVRenderTarget ) { - } else if ( background && background.isColor ) { + const renderer = this._renderer; + const autoClear = renderer.autoClear; + renderer.autoClear = false; - setClear( background, 1 ); - forceClear = true; + for ( let i = 1; i < this._lodPlanes.length; i ++ ) { - } + const sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] ); - if ( renderer.autoClear || forceClear ) { + const poleAxis = _axisDirections[ ( i - 1 ) % _axisDirections.length ]; - renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); + this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis ); } - if ( background && background.isCubeTexture ) { + renderer.autoClear = autoClear; - if ( boxCamera === undefined ) { - - boxCamera = new PerspectiveCamera(); + } - boxMesh = new Mesh( - new BoxBufferGeometry( 5, 5, 5 ), - new ShaderMaterial( { - uniforms: ShaderLib.cube.uniforms, - vertexShader: ShaderLib.cube.vertexShader, - fragmentShader: ShaderLib.cube.fragmentShader, - side: BackSide, - depthTest: false, - depthWrite: false, - fog: false - } ) - ); + /** + * This is a two-pass Gaussian blur for a cubemap. Normally this is done + * vertically and horizontally, but this breaks down on a cube. Here we apply + * the blur latitudinally (around the poles), and then longitudinally (towards + * the poles) to approximate the orthogonally-separable blur. It is least + * accurate at the poles, but still does a decent job. + */ + _blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) { - } + const pingPongRenderTarget = this._pingPongRenderTarget; - boxCamera.projectionMatrix.copy( camera.projectionMatrix ); + this._halfBlur( + cubeUVRenderTarget, + pingPongRenderTarget, + lodIn, + lodOut, + sigma, + 'latitudinal', + poleAxis ); - boxCamera.matrixWorld.extractRotation( camera.matrixWorld ); - boxCamera.matrixWorldInverse.getInverse( boxCamera.matrixWorld ); + this._halfBlur( + pingPongRenderTarget, + cubeUVRenderTarget, + lodOut, + lodOut, + sigma, + 'longitudinal', + poleAxis ); - boxMesh.material.uniforms[ "tCube" ].value = background; - boxMesh.modelViewMatrix.multiplyMatrices( boxCamera.matrixWorldInverse, boxMesh.matrixWorld ); + } - objects.update( boxMesh ); + _halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) { - renderer.renderBufferDirect( boxCamera, null, boxMesh.geometry, boxMesh.material, boxMesh, null ); + const renderer = this._renderer; + const blurMaterial = this._blurMaterial; - } else if ( background && background.isTexture ) { + if ( direction !== 'latitudinal' && direction !== 'longitudinal' ) { - if ( planeCamera === undefined ) { + console.error( + 'blur direction must be either latitudinal or longitudinal!' ); - planeCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 ); + } - planeMesh = new Mesh( - new PlaneBufferGeometry( 2, 2 ), - new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } ) - ); + // Number of standard deviations at which to cut off the discrete approximation. + const STANDARD_DEVIATIONS = 3; - } + const blurMesh = new Mesh( this._lodPlanes[ lodOut ], blurMaterial ); + const blurUniforms = blurMaterial.uniforms; - planeMesh.material.map = background; + const pixels = this._sizeLods[ lodIn ] - 1; + const radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 ); + const sigmaPixels = sigmaRadians / radiansPerPixel; + const samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES; - objects.update( planeMesh ); + if ( samples > MAX_SAMPLES ) { - renderer.renderBufferDirect( planeCamera, null, planeMesh.geometry, planeMesh.material, planeMesh, null ); + console.warn( `sigmaRadians, ${ + sigmaRadians}, is too large and will clip, as it requested ${ + samples} samples when the maximum is set to ${MAX_SAMPLES}` ); } - } + const weights = []; + let sum = 0; - function setClear( color, alpha ) { + for ( let i = 0; i < MAX_SAMPLES; ++ i ) { - state.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha ); + const x = i / sigmaPixels; + const weight = Math.exp( - x * x / 2 ); + weights.push( weight ); - } + if ( i === 0 ) { - return { + sum += weight; - getClearColor: function () { + } else if ( i < samples ) { - return clearColor; + sum += 2 * weight; - }, - setClearColor: function ( color, alpha ) { + } - clearColor.set( color ); - clearAlpha = alpha !== undefined ? alpha : 1; - setClear( clearColor, clearAlpha ); + } - }, - getClearAlpha: function () { + for ( let i = 0; i < weights.length; i ++ ) { - return clearAlpha; + weights[ i ] = weights[ i ] / sum; - }, - setClearAlpha: function ( alpha ) { + } - clearAlpha = alpha; - setClear( clearColor, clearAlpha ); + blurUniforms[ 'envMap' ].value = targetIn.texture; + blurUniforms[ 'samples' ].value = samples; + blurUniforms[ 'weights' ].value = weights; + blurUniforms[ 'latitudinal' ].value = direction === 'latitudinal'; - }, - render: render + if ( poleAxis ) { - }; + blurUniforms[ 'poleAxis' ].value = poleAxis; - } + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + const { _lodMax } = this; + blurUniforms[ 'dTheta' ].value = radiansPerPixel; + blurUniforms[ 'mipInt' ].value = _lodMax - lodIn; - function painterSortStable( a, b ) { + const outputSize = this._sizeLods[ lodOut ]; + const x = 3 * outputSize * ( lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0 ); + const y = 4 * ( this._cubeSize - outputSize ); - if ( a.renderOrder !== b.renderOrder ) { + _setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize ); + renderer.setRenderTarget( targetOut ); + renderer.render( blurMesh, _flatCamera ); - return a.renderOrder - b.renderOrder; + } - } else if ( a.program && b.program && a.program !== b.program ) { + } - return a.program.id - b.program.id; - } else if ( a.material.id !== b.material.id ) { - return a.material.id - b.material.id; + function _createPlanes( lodMax ) { - } else if ( a.z !== b.z ) { + const lodPlanes = []; + const sizeLods = []; + const sigmas = []; - return a.z - b.z; + let lod = lodMax; - } else { + const totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; - return a.id - b.id; + for ( let i = 0; i < totalLods; i ++ ) { - } + const sizeLod = Math.pow( 2, lod ); + sizeLods.push( sizeLod ); + let sigma = 1.0 / sizeLod; - } + if ( i > lodMax - LOD_MIN ) { - function reversePainterSortStable( a, b ) { + sigma = EXTRA_LOD_SIGMA[ i - lodMax + LOD_MIN - 1 ]; - if ( a.renderOrder !== b.renderOrder ) { + } else if ( i === 0 ) { - return a.renderOrder - b.renderOrder; + sigma = 0; - } if ( a.z !== b.z ) { + } - return b.z - a.z; + sigmas.push( sigma ); - } else { + const texelSize = 1.0 / ( sizeLod - 2 ); + const min = - texelSize; + const max = 1 + texelSize; + const uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ]; - return a.id - b.id; + const cubeFaces = 6; + const vertices = 6; + const positionSize = 3; + const uvSize = 2; + const faceIndexSize = 1; - } + const position = new Float32Array( positionSize * vertices * cubeFaces ); + const uv = new Float32Array( uvSize * vertices * cubeFaces ); + const faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces ); - } + for ( let face = 0; face < cubeFaces; face ++ ) { - function WebGLRenderList() { + const x = ( face % 3 ) * 2 / 3 - 1; + const y = face > 2 ? 0 : - 1; + const coordinates = [ + x, y, 0, + x + 2 / 3, y, 0, + x + 2 / 3, y + 1, 0, + x, y, 0, + x + 2 / 3, y + 1, 0, + x, y + 1, 0 + ]; + position.set( coordinates, positionSize * vertices * face ); + uv.set( uv1, uvSize * vertices * face ); + const fill = [ face, face, face, face, face, face ]; + faceIndex.set( fill, faceIndexSize * vertices * face ); - var opaque = []; - var opaqueLastIndex = - 1; + } - var transparent = []; - var transparentLastIndex = - 1; + const planes = new BufferGeometry(); + planes.setAttribute( 'position', new BufferAttribute( position, positionSize ) ); + planes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) ); + planes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) ); + lodPlanes.push( planes ); - function init() { + if ( lod > LOD_MIN ) { - opaqueLastIndex = - 1; - transparentLastIndex = - 1; + lod --; - } + } - function push( object, geometry, material, z, group ) { + } - var array, index; + return { lodPlanes, sizeLods, sigmas }; - // allocate the next position in the appropriate array + } - if ( material.transparent ) { + function _createRenderTarget( width, height, params ) { - array = transparent; - index = ++ transparentLastIndex; + const cubeUVRenderTarget = new WebGLRenderTarget( width, height, params ); + cubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping; + cubeUVRenderTarget.texture.name = 'PMREM.cubeUv'; + cubeUVRenderTarget.scissorTest = true; + return cubeUVRenderTarget; - } else { + } - array = opaque; - index = ++ opaqueLastIndex; + function _setViewport( target, x, y, width, height ) { - } + target.viewport.set( x, y, width, height ); + target.scissor.set( x, y, width, height ); - // recycle existing render item or grow the array + } - var renderItem = array[ index ]; + function _getBlurShader( lodMax, width, height ) { - if ( renderItem ) { + const weights = new Float32Array( MAX_SAMPLES ); + const poleAxis = new Vector3( 0, 1, 0 ); + const shaderMaterial = new ShaderMaterial( { - renderItem.id = object.id; - renderItem.object = object; - renderItem.geometry = geometry; - renderItem.material = material; - renderItem.program = material.program; - renderItem.renderOrder = object.renderOrder; - renderItem.z = z; - renderItem.group = group; + name: 'SphericalGaussianBlur', - } else { + defines: { + 'n': MAX_SAMPLES, + 'CUBEUV_TEXEL_WIDTH': 1.0 / width, + 'CUBEUV_TEXEL_HEIGHT': 1.0 / height, + 'CUBEUV_MAX_MIP': `${lodMax}.0`, + }, - renderItem = { - id: object.id, - object: object, - geometry: geometry, - material: material, - program: material.program, - renderOrder: object.renderOrder, - z: z, - group: group - }; + uniforms: { + 'envMap': { value: null }, + 'samples': { value: 1 }, + 'weights': { value: weights }, + 'latitudinal': { value: false }, + 'dTheta': { value: 0 }, + 'mipInt': { value: 0 }, + 'poleAxis': { value: poleAxis } + }, - // assert( index === array.length ); - array.push( renderItem ); + vertexShader: _getCommonVertexShader(), - } + fragmentShader: /* glsl */` - } + precision mediump float; + precision mediump int; - function finish() { + varying vec3 vOutputDirection; - opaque.length = opaqueLastIndex + 1; - transparent.length = transparentLastIndex + 1; + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; - } + #define ENVMAP_TYPE_CUBE_UV + #include - function sort() { + vec3 getSample( float theta, vec3 axis ) { - opaque.sort( painterSortStable ); - transparent.sort( reversePainterSortStable ); + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - } + return bilinearCubeUV( envMap, sampleDirection, mipInt ); - return { - opaque: opaque, - transparent: transparent, + } - init: init, - push: push, - finish: finish, + void main() { - sort: sort - }; + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - } + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - function WebGLRenderLists() { + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - var lists = {}; + } - function get( scene, camera ) { + axis = normalize( axis ); - var hash = scene.id + ',' + camera.id; - var list = lists[ hash ]; + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - if ( list === undefined ) { + for ( int i = 1; i < n; i++ ) { - // console.log( 'THREE.WebGLRenderLists:', hash ); + if ( i >= samples ) { - list = new WebGLRenderList(); - lists[ hash ] = list; + break; - } + } - return list; + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - } + } - function dispose() { + } + `, - lists = {}; + blending: NoBlending, + depthTest: false, + depthWrite: false - } + } ); - return { - get: get, - dispose: dispose - }; + return shaderMaterial; } - /** - * @author mrdoob / http://mrdoob.com/ - */ + function _getEquirectMaterial() { - function WebGLIndexedBufferRenderer( gl, extensions, infoRender ) { + return new ShaderMaterial( { - var mode; + name: 'EquirectangularToCubeUV', - function setMode( value ) { + uniforms: { + 'envMap': { value: null } + }, - mode = value; + vertexShader: _getCommonVertexShader(), - } + fragmentShader: /* glsl */` - var type, bytesPerElement; + precision mediump float; + precision mediump int; - function setIndex( value ) { + varying vec3 vOutputDirection; - type = value.type; - bytesPerElement = value.bytesPerElement; + uniform sampler2D envMap; - } + #include - function render( start, count ) { + void main() { - gl.drawElements( mode, count, type, start * bytesPerElement ); + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); - infoRender.calls ++; - infoRender.vertices += count; + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - if ( mode === gl.TRIANGLES ) infoRender.faces += count / 3; + } + `, - } + blending: NoBlending, + depthTest: false, + depthWrite: false + + } ); - function renderInstances( geometry, start, count ) { + } - var extension = extensions.get( 'ANGLE_instanced_arrays' ); + function _getCubemapMaterial() { - if ( extension === null ) { + return new ShaderMaterial( { - console.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; + name: 'CubemapToCubeUV', - } + uniforms: { + 'envMap': { value: null }, + 'flipEnvMap': { value: - 1 } + }, - extension.drawElementsInstancedANGLE( mode, count, type, start * bytesPerElement, geometry.maxInstancedCount ); + vertexShader: _getCommonVertexShader(), - infoRender.calls ++; - infoRender.vertices += count * geometry.maxInstancedCount; + fragmentShader: /* glsl */` - if ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3; + precision mediump float; + precision mediump int; - } + uniform float flipEnvMap; - // + varying vec3 vOutputDirection; - this.setMode = setMode; - this.setIndex = setIndex; - this.render = render; - this.renderInstances = renderInstances; + uniform samplerCube envMap; - } + void main() { - /** - * @author mrdoob / http://mrdoob.com/ - */ + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - function WebGLBufferRenderer( gl, extensions, infoRender ) { + } + `, - var mode; + blending: NoBlending, + depthTest: false, + depthWrite: false - function setMode( value ) { + } ); - mode = value; + } - } + function _getCommonVertexShader() { - function render( start, count ) { + return /* glsl */` - gl.drawArrays( mode, start, count ); + precision mediump float; + precision mediump int; - infoRender.calls ++; - infoRender.vertices += count; + attribute float faceIndex; - if ( mode === gl.TRIANGLES ) infoRender.faces += count / 3; + varying vec3 vOutputDirection; - } + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { - function renderInstances( geometry, start, count ) { + uv = 2.0 * uv - 1.0; - var extension = extensions.get( 'ANGLE_instanced_arrays' ); + vec3 direction = vec3( uv, 1.0 ); - if ( extension === null ) { + if ( face == 0.0 ) { - console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; + direction = direction.zyx; // ( 1, v, u ) pos x - } + } else if ( face == 1.0 ) { - var position = geometry.attributes.position; + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y - if ( position.isInterleavedBufferAttribute ) { + } else if ( face == 2.0 ) { - count = position.data.count; + direction.x *= -1.0; // ( -u, v, 1 ) pos z - extension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount ); + } else if ( face == 3.0 ) { - } else { + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x - extension.drawArraysInstancedANGLE( mode, start, count, geometry.maxInstancedCount ); + } else if ( face == 4.0 ) { - } + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y - infoRender.calls ++; - infoRender.vertices += count * geometry.maxInstancedCount; + } else if ( face == 5.0 ) { - if ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3; + direction.z *= -1.0; // ( u, v, -1 ) neg z - } + } - // + return direction; - this.setMode = setMode; - this.render = render; - this.renderInstances = renderInstances; + } - } + void main() { - /** - * @author mrdoob / http://mrdoob.com/ - */ + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); - function WebGLGeometries( gl, attributes, infoMemory ) { + } + `; - var geometries = {}; - var wireframeAttributes = {}; + } - function onGeometryDispose( event ) { + function WebGLCubeUVMaps( renderer ) { - var geometry = event.target; - var buffergeometry = geometries[ geometry.id ]; + let cubeUVmaps = new WeakMap(); - if ( buffergeometry.index !== null ) { + let pmremGenerator = null; - attributes.remove( buffergeometry.index ); + function get( texture ) { - } + if ( texture && texture.isTexture ) { - for ( var name in buffergeometry.attributes ) { + const mapping = texture.mapping; - attributes.remove( buffergeometry.attributes[ name ] ); + const isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ); + const isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping ); - } + // equirect/cube map to cubeUV conversion - geometry.removeEventListener( 'dispose', onGeometryDispose ); + if ( isEquirectMap || isCubeMap ) { - delete geometries[ geometry.id ]; + if ( texture.isRenderTargetTexture && texture.needsPMREMUpdate === true ) { - // TODO Remove duplicate code + texture.needsPMREMUpdate = false; - var attribute = wireframeAttributes[ geometry.id ]; + let renderTarget = cubeUVmaps.get( texture ); - if ( attribute ) { + if ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer ); - attributes.remove( attribute ); - delete wireframeAttributes[ geometry.id ]; + renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget ); + cubeUVmaps.set( texture, renderTarget ); - } + return renderTarget.texture; - attribute = wireframeAttributes[ buffergeometry.id ]; + } else { - if ( attribute ) { + if ( cubeUVmaps.has( texture ) ) { - attributes.remove( attribute ); - delete wireframeAttributes[ buffergeometry.id ]; + return cubeUVmaps.get( texture ).texture; - } + } else { - // + const image = texture.image; - infoMemory.geometries --; + if ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) { - } + if ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer ); - function get( object, geometry ) { + const renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture ); + cubeUVmaps.set( texture, renderTarget ); - var buffergeometry = geometries[ geometry.id ]; + texture.addEventListener( 'dispose', onTextureDispose ); - if ( buffergeometry ) return buffergeometry; + return renderTarget.texture; - geometry.addEventListener( 'dispose', onGeometryDispose ); + } else { - if ( geometry.isBufferGeometry ) { + // image not yet ready. try the conversion next frame - buffergeometry = geometry; + return null; - } else if ( geometry.isGeometry ) { + } - if ( geometry._bufferGeometry === undefined ) { + } - geometry._bufferGeometry = new BufferGeometry().setFromObject( object ); + } } - buffergeometry = geometry._bufferGeometry; - } - geometries[ geometry.id ] = buffergeometry; - - infoMemory.geometries ++; - - return buffergeometry; + return texture; } - function update( geometry ) { + function isCubeTextureComplete( image ) { - var index = geometry.index; - var geometryAttributes = geometry.attributes; + let count = 0; + const length = 6; - if ( index !== null ) { + for ( let i = 0; i < length; i ++ ) { - attributes.update( index, gl.ELEMENT_ARRAY_BUFFER ); + if ( image[ i ] !== undefined ) count ++; } - for ( var name in geometryAttributes ) { + return count === length; - attributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER ); - - } - // morph targets + } - var morphAttributes = geometry.morphAttributes; + function onTextureDispose( event ) { - for ( var name in morphAttributes ) { + const texture = event.target; - var array = morphAttributes[ name ]; + texture.removeEventListener( 'dispose', onTextureDispose ); - for ( var i = 0, l = array.length; i < l; i ++ ) { + const cubemapUV = cubeUVmaps.get( texture ); - attributes.update( array[ i ], gl.ARRAY_BUFFER ); + if ( cubemapUV !== undefined ) { - } + cubeUVmaps.delete( texture ); + cubemapUV.dispose(); } } - function getWireframeAttribute( geometry ) { + function dispose() { - var attribute = wireframeAttributes[ geometry.id ]; + cubeUVmaps = new WeakMap(); - if ( attribute ) return attribute; + if ( pmremGenerator !== null ) { - var indices = []; + pmremGenerator.dispose(); + pmremGenerator = null; - var geometryIndex = geometry.index; - var geometryAttributes = geometry.attributes; + } - // console.time( 'wireframe' ); + } - if ( geometryIndex !== null ) { + return { + get: get, + dispose: dispose + }; - var array = geometryIndex.array; + } - for ( var i = 0, l = array.length; i < l; i += 3 ) { + function WebGLExtensions( gl ) { - var a = array[ i + 0 ]; - var b = array[ i + 1 ]; - var c = array[ i + 2 ]; + const extensions = {}; - indices.push( a, b, b, c, c, a ); + function getExtension( name ) { - } + if ( extensions[ name ] !== undefined ) { - } else { + return extensions[ name ]; - var array = geometryAttributes.position.array; + } - for ( var i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) { + let extension; - var a = i + 0; - var b = i + 1; - var c = i + 2; + switch ( name ) { - indices.push( a, b, b, c, c, a ); + case 'WEBGL_depth_texture': + extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' ); + break; - } + case 'EXT_texture_filter_anisotropic': + extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); + break; - } + case 'WEBGL_compressed_texture_s3tc': + extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); + break; - // console.timeEnd( 'wireframe' ); + case 'WEBGL_compressed_texture_pvrtc': + extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); + break; - attribute = new ( arrayMax( indices ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); + default: + extension = gl.getExtension( name ); - attributes.update( attribute, gl.ELEMENT_ARRAY_BUFFER ); + } - wireframeAttributes[ geometry.id ] = attribute; + extensions[ name ] = extension; - return attribute; + return extension; } return { - get: get, - update: update, + has: function ( name ) { - getWireframeAttribute: getWireframeAttribute + return getExtension( name ) !== null; - }; + }, - } + init: function ( capabilities ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( capabilities.isWebGL2 ) { - function WebGLLights() { + getExtension( 'EXT_color_buffer_float' ); - var lights = {}; + } else { - return { + getExtension( 'WEBGL_depth_texture' ); + getExtension( 'OES_texture_float' ); + getExtension( 'OES_texture_half_float' ); + getExtension( 'OES_texture_half_float_linear' ); + getExtension( 'OES_standard_derivatives' ); + getExtension( 'OES_element_index_uint' ); + getExtension( 'OES_vertex_array_object' ); + getExtension( 'ANGLE_instanced_arrays' ); - get: function ( light ) { + } - if ( lights[ light.id ] !== undefined ) { + getExtension( 'OES_texture_float_linear' ); + getExtension( 'EXT_color_buffer_half_float' ); + getExtension( 'WEBGL_multisampled_render_to_texture' ); - return lights[ light.id ]; + }, - } + get: function ( name ) { - var uniforms; + const extension = getExtension( name ); - switch ( light.type ) { + if ( extension === null ) { - case 'DirectionalLight': - uniforms = { - direction: new Vector3(), - color: new Color(), + console.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; + } - case 'SpotLight': - uniforms = { - position: new Vector3(), - direction: new Vector3(), - color: new Color(), - distance: 0, - coneCos: 0, - penumbraCos: 0, - decay: 0, + return extension; - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; + } - case 'PointLight': - uniforms = { - position: new Vector3(), - color: new Color(), - distance: 0, - decay: 0, + }; - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; + } - case 'HemisphereLight': - uniforms = { - direction: new Vector3(), - skyColor: new Color(), - groundColor: new Color() - }; - break; + function WebGLGeometries( gl, attributes, info, bindingStates ) { - case 'RectAreaLight': - uniforms = { - color: new Color(), - position: new Vector3(), - halfWidth: new Vector3(), - halfHeight: new Vector3() - // TODO (abelnation): set RectAreaLight shadow uniforms - }; - break; + const geometries = {}; + const wireframeAttributes = new WeakMap(); - } + function onGeometryDispose( event ) { - lights[ light.id ] = uniforms; + const geometry = event.target; - return uniforms; + if ( geometry.index !== null ) { - } + attributes.remove( geometry.index ); - }; + } - } + for ( const name in geometry.attributes ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + attributes.remove( geometry.attributes[ name ] ); - function WebGLObjects( gl, geometries, infoRender ) { + } - var updateList = {}; + for ( const name in geometry.morphAttributes ) { - function update( object ) { + const array = geometry.morphAttributes[ name ]; - var frame = infoRender.frame; + for ( let i = 0, l = array.length; i < l; i ++ ) { - var geometry = object.geometry; - var buffergeometry = geometries.get( object, geometry ); + attributes.remove( array[ i ] ); - // Update once per frame + } - if ( updateList[ buffergeometry.id ] !== frame ) { + } - if ( geometry.isGeometry ) { + geometry.removeEventListener( 'dispose', onGeometryDispose ); - buffergeometry.updateFromObject( object ); + delete geometries[ geometry.id ]; - } + const attribute = wireframeAttributes.get( geometry ); - geometries.update( buffergeometry ); + if ( attribute ) { - updateList[ buffergeometry.id ] = frame; + attributes.remove( attribute ); + wireframeAttributes.delete( geometry ); } - return buffergeometry; + bindingStates.releaseStatesOfGeometry( geometry ); - } + if ( geometry.isInstancedBufferGeometry === true ) { - function clear() { + delete geometry._maxInstanceCount; - updateList = {}; + } + + // + + info.memory.geometries --; } - return { + function get( object, geometry ) { - update: update, - clear: clear + if ( geometries[ geometry.id ] === true ) return geometry; - }; + geometry.addEventListener( 'dispose', onGeometryDispose ); - } + geometries[ geometry.id ] = true; - /** - * @author mrdoob / http://mrdoob.com/ - */ + info.memory.geometries ++; + + return geometry; - function addLineNumbers( string ) { + } - var lines = string.split( '\n' ); + function update( geometry ) { - for ( var i = 0; i < lines.length; i ++ ) { + const geometryAttributes = geometry.attributes; - lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; + // Updating index buffer in VAO now. See WebGLBindingStates. - } + for ( const name in geometryAttributes ) { - return lines.join( '\n' ); + attributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER ); - } + } - function WebGLShader( gl, type, string ) { + // morph targets - var shader = gl.createShader( type ); + const morphAttributes = geometry.morphAttributes; - gl.shaderSource( shader, string ); - gl.compileShader( shader ); + for ( const name in morphAttributes ) { - if ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) { + const array = morphAttributes[ name ]; - console.error( 'THREE.WebGLShader: Shader couldn\'t compile.' ); + for ( let i = 0, l = array.length; i < l; i ++ ) { - } + attributes.update( array[ i ], gl.ARRAY_BUFFER ); - if ( gl.getShaderInfoLog( shader ) !== '' ) { + } - console.warn( 'THREE.WebGLShader: gl.getShaderInfoLog()', type === gl.VERTEX_SHADER ? 'vertex' : 'fragment', gl.getShaderInfoLog( shader ), addLineNumbers( string ) ); + } } - // --enable-privileged-webgl-extension - // console.log( type, gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); + function updateWireframeAttribute( geometry ) { - return shader; + const indices = []; - } + const geometryIndex = geometry.index; + const geometryPosition = geometry.attributes.position; + let version = 0; - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( geometryIndex !== null ) { - var programIdCount = 0; - - function getEncodingComponents( encoding ) { - - switch ( encoding ) { - - case LinearEncoding: - return [ 'Linear','( value )' ]; - case sRGBEncoding: - return [ 'sRGB','( value )' ]; - case RGBEEncoding: - return [ 'RGBE','( value )' ]; - case RGBM7Encoding: - return [ 'RGBM','( value, 7.0 )' ]; - case RGBM16Encoding: - return [ 'RGBM','( value, 16.0 )' ]; - case RGBDEncoding: - return [ 'RGBD','( value, 256.0 )' ]; - case GammaEncoding: - return [ 'Gamma','( value, float( GAMMA_FACTOR ) )' ]; - default: - throw new Error( 'unsupported encoding: ' + encoding ); + const array = geometryIndex.array; + version = geometryIndex.version; - } + for ( let i = 0, l = array.length; i < l; i += 3 ) { - } + const a = array[ i + 0 ]; + const b = array[ i + 1 ]; + const c = array[ i + 2 ]; - function getTexelDecodingFunction( functionName, encoding ) { + indices.push( a, b, b, c, c, a ); - var components = getEncodingComponents( encoding ); - return "vec4 " + functionName + "( vec4 value ) { return " + components[ 0 ] + "ToLinear" + components[ 1 ] + "; }"; + } - } + } else { - function getTexelEncodingFunction( functionName, encoding ) { + const array = geometryPosition.array; + version = geometryPosition.version; - var components = getEncodingComponents( encoding ); - return "vec4 " + functionName + "( vec4 value ) { return LinearTo" + components[ 0 ] + components[ 1 ] + "; }"; + for ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) { - } + const a = i + 0; + const b = i + 1; + const c = i + 2; - function getToneMappingFunction( functionName, toneMapping ) { + indices.push( a, b, b, c, c, a ); - var toneMappingName; + } - switch ( toneMapping ) { + } - case LinearToneMapping: - toneMappingName = "Linear"; - break; + const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); + attribute.version = version; - case ReinhardToneMapping: - toneMappingName = "Reinhard"; - break; + // Updating index buffer in VAO now. See WebGLBindingStates - case Uncharted2ToneMapping: - toneMappingName = "Uncharted2"; - break; + // - case CineonToneMapping: - toneMappingName = "OptimizedCineon"; - break; + const previousAttribute = wireframeAttributes.get( geometry ); - default: - throw new Error( 'unsupported toneMapping: ' + toneMapping ); + if ( previousAttribute ) attributes.remove( previousAttribute ); + + // + + wireframeAttributes.set( geometry, attribute ); } - return "vec3 " + functionName + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }"; + function getWireframeAttribute( geometry ) { - } + const currentAttribute = wireframeAttributes.get( geometry ); - function generateExtensions( extensions, parameters, rendererExtensions ) { + if ( currentAttribute ) { - extensions = extensions || {}; + const geometryIndex = geometry.index; - var chunks = [ - ( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '', - ( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '', - ( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '', - ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : '' - ]; + if ( geometryIndex !== null ) { - return chunks.filter( filterEmptyLine ).join( '\n' ); + // if the attribute is obsolete, create a new one - } + if ( currentAttribute.version < geometryIndex.version ) { - function generateDefines( defines ) { + updateWireframeAttribute( geometry ); + + } - var chunks = []; + } - for ( var name in defines ) { + } else { - var value = defines[ name ]; + updateWireframeAttribute( geometry ); - if ( value === false ) continue; + } - chunks.push( '#define ' + name + ' ' + value ); + return wireframeAttributes.get( geometry ); } - return chunks.join( '\n' ); + return { + + get: get, + update: update, + + getWireframeAttribute: getWireframeAttribute + + }; } - function fetchAttributeLocations( gl, program, identifiers ) { + function WebGLIndexedBufferRenderer( gl, extensions, info, capabilities ) { + + const isWebGL2 = capabilities.isWebGL2; - var attributes = {}; + let mode; + + function setMode( value ) { - var n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES ); + mode = value; - for ( var i = 0; i < n; i ++ ) { + } - var info = gl.getActiveAttrib( program, i ); - var name = info.name; + let type, bytesPerElement; - // console.log("THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:", name, i ); + function setIndex( value ) { - attributes[ name ] = gl.getAttribLocation( program, name ); + type = value.type; + bytesPerElement = value.bytesPerElement; } - return attributes; + function render( start, count ) { - } + gl.drawElements( mode, count, type, start * bytesPerElement ); - function filterEmptyLine( string ) { + info.update( count, mode, 1 ); - return string !== ''; + } - } + function renderInstances( start, count, primcount ) { - function replaceLightNums( string, parameters ) { + if ( primcount === 0 ) return; - return string - .replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights ) - .replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights ) - .replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights ) - .replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights ) - .replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights ); + let extension, methodName; - } + if ( isWebGL2 ) { - function parseIncludes( string ) { + extension = gl; + methodName = 'drawElementsInstanced'; - var pattern = /^[ \t]*#include +<([\w\d.]+)>/gm; + } else { - function replace( match, include ) { + extension = extensions.get( 'ANGLE_instanced_arrays' ); + methodName = 'drawElementsInstancedANGLE'; - var replace = ShaderChunk[ include ]; + if ( extension === null ) { - if ( replace === undefined ) { + console.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; - throw new Error( 'Can not resolve #include <' + include + '>' ); + } } - return parseIncludes( replace ); + extension[ methodName ]( mode, count, type, start * bytesPerElement, primcount ); + + info.update( count, mode, primcount ); } - return string.replace( pattern, replace ); + // + + this.setMode = setMode; + this.setIndex = setIndex; + this.render = render; + this.renderInstances = renderInstances; } - function unrollLoops( string ) { + function WebGLInfo( gl ) { + + const memory = { + geometries: 0, + textures: 0 + }; + + const render = { + frame: 0, + calls: 0, + triangles: 0, + points: 0, + lines: 0 + }; - var pattern = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; + function update( count, mode, instanceCount ) { - function replace( match, start, end, snippet ) { + render.calls ++; - var unroll = ''; + switch ( mode ) { + + case gl.TRIANGLES: + render.triangles += instanceCount * ( count / 3 ); + break; + + case gl.LINES: + render.lines += instanceCount * ( count / 2 ); + break; + + case gl.LINE_STRIP: + render.lines += instanceCount * ( count - 1 ); + break; + + case gl.LINE_LOOP: + render.lines += instanceCount * count; + break; - for ( var i = parseInt( start ); i < parseInt( end ); i ++ ) { + case gl.POINTS: + render.points += instanceCount * count; + break; - unroll += snippet.replace( /\[ i \]/g, '[ ' + i + ' ]' ); + default: + console.error( 'THREE.WebGLInfo: Unknown draw mode:', mode ); + break; } - return unroll; + } + + function reset() { + + render.calls = 0; + render.triangles = 0; + render.points = 0; + render.lines = 0; } - return string.replace( pattern, replace ); + return { + memory: memory, + render: render, + programs: null, + autoReset: true, + reset: reset, + update: update + }; } - function WebGLProgram( renderer, code, material, shader, parameters ) { + function numericalSort( a, b ) { - var gl = renderer.context; + return a[ 0 ] - b[ 0 ]; - var extensions = material.extensions; - var defines = material.defines; + } - var vertexShader = shader.vertexShader; - var fragmentShader = shader.fragmentShader; + function absNumericalSort( a, b ) { - var shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC'; + return Math.abs( b[ 1 ] ) - Math.abs( a[ 1 ] ); - if ( parameters.shadowMapType === PCFShadowMap ) { + } - shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF'; + function WebGLMorphtargets( gl, capabilities, textures ) { - } else if ( parameters.shadowMapType === PCFSoftShadowMap ) { + const influencesList = {}; + const morphInfluences = new Float32Array( 8 ); + const morphTextures = new WeakMap(); + const morph = new Vector4(); - shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT'; + const workInfluences = []; - } + for ( let i = 0; i < 8; i ++ ) { - var envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; - var envMapModeDefine = 'ENVMAP_MODE_REFLECTION'; - var envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; + workInfluences[ i ] = [ i, 0 ]; - if ( parameters.envMap ) { + } - switch ( material.envMap.mapping ) { + function update( object, geometry, program ) { - case CubeReflectionMapping: - case CubeRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; - break; + const objectInfluences = object.morphTargetInfluences; - case CubeUVReflectionMapping: - case CubeUVRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; - break; + if ( capabilities.isWebGL2 === true ) { - case EquirectangularReflectionMapping: - case EquirectangularRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_EQUIREC'; - break; + // instead of using attributes, the WebGL 2 code path encodes morph targets + // into an array of data textures. Each layer represents a single morph target. - case SphericalReflectionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_SPHERE'; - break; + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; - } + let entry = morphTextures.get( geometry ); - switch ( material.envMap.mapping ) { + if ( entry === undefined || entry.count !== morphTargetsCount ) { - case CubeRefractionMapping: - case EquirectangularRefractionMapping: - envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; - break; + if ( entry !== undefined ) entry.texture.dispose(); - } + const hasMorphPosition = geometry.morphAttributes.position !== undefined; + const hasMorphNormals = geometry.morphAttributes.normal !== undefined; + const hasMorphColors = geometry.morphAttributes.color !== undefined; - switch ( material.combine ) { + const morphTargets = geometry.morphAttributes.position || []; + const morphNormals = geometry.morphAttributes.normal || []; + const morphColors = geometry.morphAttributes.color || []; - case MultiplyOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; - break; + let vertexDataCount = 0; - case MixOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_MIX'; - break; + if ( hasMorphPosition === true ) vertexDataCount = 1; + if ( hasMorphNormals === true ) vertexDataCount = 2; + if ( hasMorphColors === true ) vertexDataCount = 3; - case AddOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_ADD'; - break; + let width = geometry.attributes.position.count * vertexDataCount; + let height = 1; - } + if ( width > capabilities.maxTextureSize ) { - } + height = Math.ceil( width / capabilities.maxTextureSize ); + width = capabilities.maxTextureSize; - var gammaFactorDefine = ( renderer.gammaFactor > 0 ) ? renderer.gammaFactor : 1.0; + } - // console.log( 'building new program ' ); + const buffer = new Float32Array( width * height * 4 * morphTargetsCount ); - // + const texture = new DataArrayTexture( buffer, width, height, morphTargetsCount ); + texture.type = FloatType; + texture.needsUpdate = true; - var customExtensions = generateExtensions( extensions, parameters, renderer.extensions ); + // fill buffer - var customDefines = generateDefines( defines ); + const vertexDataStride = vertexDataCount * 4; - // + for ( let i = 0; i < morphTargetsCount; i ++ ) { - var program = gl.createProgram(); + const morphTarget = morphTargets[ i ]; + const morphNormal = morphNormals[ i ]; + const morphColor = morphColors[ i ]; - var prefixVertex, prefixFragment; + const offset = width * height * 4 * i; - if ( material.isRawShaderMaterial ) { + for ( let j = 0; j < morphTarget.count; j ++ ) { - prefixVertex = [ + const stride = j * vertexDataStride; - customDefines, + if ( hasMorphPosition === true ) { - '\n' + morph.fromBufferAttribute( morphTarget, j ); - ].filter( filterEmptyLine ).join( '\n' ); + buffer[ offset + stride + 0 ] = morph.x; + buffer[ offset + stride + 1 ] = morph.y; + buffer[ offset + stride + 2 ] = morph.z; + buffer[ offset + stride + 3 ] = 0; - prefixFragment = [ + } - customExtensions, - customDefines, + if ( hasMorphNormals === true ) { - '\n' + morph.fromBufferAttribute( morphNormal, j ); - ].filter( filterEmptyLine ).join( '\n' ); + buffer[ offset + stride + 4 ] = morph.x; + buffer[ offset + stride + 5 ] = morph.y; + buffer[ offset + stride + 6 ] = morph.z; + buffer[ offset + stride + 7 ] = 0; - } else { + } - prefixVertex = [ + if ( hasMorphColors === true ) { - 'precision ' + parameters.precision + ' float;', - 'precision ' + parameters.precision + ' int;', + morph.fromBufferAttribute( morphColor, j ); - '#define SHADER_NAME ' + shader.name, + buffer[ offset + stride + 8 ] = morph.x; + buffer[ offset + stride + 9 ] = morph.y; + buffer[ offset + stride + 10 ] = morph.z; + buffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morph.w : 1; - customDefines, + } - parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', + } - '#define GAMMA_FACTOR ' + gammaFactorDefine, + } - '#define MAX_BONES ' + parameters.maxBones, - ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', - ( parameters.useFog && parameters.fogExp ) ? '#define FOG_EXP2' : '', + entry = { + count: morphTargetsCount, + texture: texture, + size: new Vector2( width, height ) + }; - parameters.map ? '#define USE_MAP' : '', - parameters.envMap ? '#define USE_ENVMAP' : '', - parameters.envMap ? '#define ' + envMapModeDefine : '', - parameters.lightMap ? '#define USE_LIGHTMAP' : '', - parameters.aoMap ? '#define USE_AOMAP' : '', - parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - parameters.bumpMap ? '#define USE_BUMPMAP' : '', - parameters.normalMap ? '#define USE_NORMALMAP' : '', - parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', - parameters.specularMap ? '#define USE_SPECULARMAP' : '', - parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', - parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', - parameters.alphaMap ? '#define USE_ALPHAMAP' : '', - parameters.vertexColors ? '#define USE_COLOR' : '', + morphTextures.set( geometry, entry ); - parameters.flatShading ? '#define FLAT_SHADED' : '', + function disposeTexture() { - parameters.skinning ? '#define USE_SKINNING' : '', - parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', + texture.dispose(); - parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', - parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', - parameters.doubleSided ? '#define DOUBLE_SIDED' : '', - parameters.flipSided ? '#define FLIP_SIDED' : '', + morphTextures.delete( geometry ); - '#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes, + geometry.removeEventListener( 'dispose', disposeTexture ); - parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', - parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + } - parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', + geometry.addEventListener( 'dispose', disposeTexture ); - parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', - parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + } - 'uniform mat4 modelMatrix;', - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform mat4 viewMatrix;', - 'uniform mat3 normalMatrix;', - 'uniform vec3 cameraPosition;', + // - 'attribute vec3 position;', - 'attribute vec3 normal;', - 'attribute vec2 uv;', + let morphInfluencesSum = 0; - '#ifdef USE_COLOR', + for ( let i = 0; i < objectInfluences.length; i ++ ) { - ' attribute vec3 color;', + morphInfluencesSum += objectInfluences[ i ]; - '#endif', + } - '#ifdef USE_MORPHTARGETS', + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; - ' attribute vec3 morphTarget0;', - ' attribute vec3 morphTarget1;', - ' attribute vec3 morphTarget2;', - ' attribute vec3 morphTarget3;', + program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence ); + program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences ); - ' #ifdef USE_MORPHNORMALS', + program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures ); + program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size ); - ' attribute vec3 morphNormal0;', - ' attribute vec3 morphNormal1;', - ' attribute vec3 morphNormal2;', - ' attribute vec3 morphNormal3;', - ' #else', + } else { - ' attribute vec3 morphTarget4;', - ' attribute vec3 morphTarget5;', - ' attribute vec3 morphTarget6;', - ' attribute vec3 morphTarget7;', + // When object doesn't have morph target influences defined, we treat it as a 0-length array + // This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences - ' #endif', + const length = objectInfluences === undefined ? 0 : objectInfluences.length; - '#endif', + let influences = influencesList[ geometry.id ]; - '#ifdef USE_SKINNING', + if ( influences === undefined || influences.length !== length ) { - ' attribute vec4 skinIndex;', - ' attribute vec4 skinWeight;', + // initialise list - '#endif', + influences = []; - '\n' + for ( let i = 0; i < length; i ++ ) { - ].filter( filterEmptyLine ).join( '\n' ); + influences[ i ] = [ i, 0 ]; - prefixFragment = [ + } - customExtensions, + influencesList[ geometry.id ] = influences; - 'precision ' + parameters.precision + ' float;', - 'precision ' + parameters.precision + ' int;', + } - '#define SHADER_NAME ' + shader.name, + // Collect influences - customDefines, + for ( let i = 0; i < length; i ++ ) { - parameters.alphaTest ? '#define ALPHATEST ' + parameters.alphaTest : '', + const influence = influences[ i ]; - '#define GAMMA_FACTOR ' + gammaFactorDefine, + influence[ 0 ] = i; + influence[ 1 ] = objectInfluences[ i ]; - ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', - ( parameters.useFog && parameters.fogExp ) ? '#define FOG_EXP2' : '', + } - parameters.map ? '#define USE_MAP' : '', - parameters.envMap ? '#define USE_ENVMAP' : '', - parameters.envMap ? '#define ' + envMapTypeDefine : '', - parameters.envMap ? '#define ' + envMapModeDefine : '', - parameters.envMap ? '#define ' + envMapBlendingDefine : '', - parameters.lightMap ? '#define USE_LIGHTMAP' : '', - parameters.aoMap ? '#define USE_AOMAP' : '', - parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - parameters.bumpMap ? '#define USE_BUMPMAP' : '', - parameters.normalMap ? '#define USE_NORMALMAP' : '', - parameters.specularMap ? '#define USE_SPECULARMAP' : '', - parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', - parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', - parameters.alphaMap ? '#define USE_ALPHAMAP' : '', - parameters.vertexColors ? '#define USE_COLOR' : '', + influences.sort( absNumericalSort ); - parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', + for ( let i = 0; i < 8; i ++ ) { - parameters.flatShading ? '#define FLAT_SHADED' : '', + if ( i < length && influences[ i ][ 1 ] ) { - parameters.doubleSided ? '#define DOUBLE_SIDED' : '', - parameters.flipSided ? '#define FLIP_SIDED' : '', + workInfluences[ i ][ 0 ] = influences[ i ][ 0 ]; + workInfluences[ i ][ 1 ] = influences[ i ][ 1 ]; - '#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes, - '#define UNION_CLIPPING_PLANES ' + (parameters.numClippingPlanes - parameters.numClipIntersection), + } else { - parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', - parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + workInfluences[ i ][ 0 ] = Number.MAX_SAFE_INTEGER; + workInfluences[ i ][ 1 ] = 0; - parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : '', + } - parameters.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : '', + } - parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', - parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + workInfluences.sort( numericalSort ); - parameters.envMap && renderer.extensions.get( 'EXT_shader_texture_lod' ) ? '#define TEXTURE_LOD_EXT' : '', + const morphTargets = geometry.morphAttributes.position; + const morphNormals = geometry.morphAttributes.normal; - 'uniform mat4 viewMatrix;', - 'uniform vec3 cameraPosition;', + let morphInfluencesSum = 0; - ( parameters.toneMapping !== NoToneMapping ) ? "#define TONE_MAPPING" : '', - ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below - ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( "toneMapping", parameters.toneMapping ) : '', + for ( let i = 0; i < 8; i ++ ) { - parameters.dithering ? '#define DITHERING' : '', + const influence = workInfluences[ i ]; + const index = influence[ 0 ]; + const value = influence[ 1 ]; - ( parameters.outputEncoding || parameters.mapEncoding || parameters.envMapEncoding || parameters.emissiveMapEncoding ) ? ShaderChunk[ 'encodings_pars_fragment' ] : '', // this code is required here because it is used by the various encoding/decoding function defined below - parameters.mapEncoding ? getTexelDecodingFunction( 'mapTexelToLinear', parameters.mapEncoding ) : '', - parameters.envMapEncoding ? getTexelDecodingFunction( 'envMapTexelToLinear', parameters.envMapEncoding ) : '', - parameters.emissiveMapEncoding ? getTexelDecodingFunction( 'emissiveMapTexelToLinear', parameters.emissiveMapEncoding ) : '', - parameters.outputEncoding ? getTexelEncodingFunction( "linearToOutputTexel", parameters.outputEncoding ) : '', + if ( index !== Number.MAX_SAFE_INTEGER && value ) { - parameters.depthPacking ? "#define DEPTH_PACKING " + material.depthPacking : '', + if ( morphTargets && geometry.getAttribute( 'morphTarget' + i ) !== morphTargets[ index ] ) { - '\n' + geometry.setAttribute( 'morphTarget' + i, morphTargets[ index ] ); - ].filter( filterEmptyLine ).join( '\n' ); + } - } + if ( morphNormals && geometry.getAttribute( 'morphNormal' + i ) !== morphNormals[ index ] ) { - vertexShader = parseIncludes( vertexShader ); - vertexShader = replaceLightNums( vertexShader, parameters ); + geometry.setAttribute( 'morphNormal' + i, morphNormals[ index ] ); - fragmentShader = parseIncludes( fragmentShader ); - fragmentShader = replaceLightNums( fragmentShader, parameters ); + } - if ( ! material.isShaderMaterial ) { + morphInfluences[ i ] = value; + morphInfluencesSum += value; - vertexShader = unrollLoops( vertexShader ); - fragmentShader = unrollLoops( fragmentShader ); + } else { - } + if ( morphTargets && geometry.hasAttribute( 'morphTarget' + i ) === true ) { - var vertexGlsl = prefixVertex + vertexShader; - var fragmentGlsl = prefixFragment + fragmentShader; + geometry.deleteAttribute( 'morphTarget' + i ); - // console.log( '*VERTEX*', vertexGlsl ); - // console.log( '*FRAGMENT*', fragmentGlsl ); + } - var glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl ); - var glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl ); + if ( morphNormals && geometry.hasAttribute( 'morphNormal' + i ) === true ) { - gl.attachShader( program, glVertexShader ); - gl.attachShader( program, glFragmentShader ); + geometry.deleteAttribute( 'morphNormal' + i ); - // Force a particular attribute to index 0. + } - if ( material.index0AttributeName !== undefined ) { + morphInfluences[ i ] = 0; - gl.bindAttribLocation( program, 0, material.index0AttributeName ); + } - } else if ( parameters.morphTargets === true ) { + } - // programs with morphTargets displace position out of attribute 0 - gl.bindAttribLocation( program, 0, 'position' ); + // GLSL shader uses formula baseinfluence * base + sum(target * influence) + // This allows us to switch between absolute morphs and relative morphs without changing shader code + // When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence) + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; + + program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence ); + program.getUniforms().setValue( gl, 'morphTargetInfluences', morphInfluences ); + + } } - gl.linkProgram( program ); + return { - var programLog = gl.getProgramInfoLog( program ); - var vertexLog = gl.getShaderInfoLog( glVertexShader ); - var fragmentLog = gl.getShaderInfoLog( glFragmentShader ); + update: update - var runnable = true; - var haveDiagnostics = true; + }; - // console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) ); - // console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) ); + } - if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) { + function WebGLObjects( gl, geometries, attributes, info ) { - runnable = false; + let updateMap = new WeakMap(); - console.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexLog, fragmentLog ); + function update( object ) { - } else if ( programLog !== '' ) { + const frame = info.render.frame; - console.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', programLog ); + const geometry = object.geometry; + const buffergeometry = geometries.get( object, geometry ); - } else if ( vertexLog === '' || fragmentLog === '' ) { + // Update once per frame - haveDiagnostics = false; + if ( updateMap.get( buffergeometry ) !== frame ) { - } + geometries.update( buffergeometry ); - if ( haveDiagnostics ) { + updateMap.set( buffergeometry, frame ); - this.diagnostics = { + } - runnable: runnable, - material: material, + if ( object.isInstancedMesh ) { - programLog: programLog, + if ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) { - vertexShader: { + object.addEventListener( 'dispose', onInstancedMeshDispose ); - log: vertexLog, - prefix: prefixVertex + } - }, + attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); - fragmentShader: { + if ( object.instanceColor !== null ) { - log: fragmentLog, - prefix: prefixFragment + attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); } - }; + } + + return buffergeometry; } - // clean up + function dispose() { - gl.deleteShader( glVertexShader ); - gl.deleteShader( glFragmentShader ); + updateMap = new WeakMap(); - // set up caching for uniform locations + } - var cachedUniforms; + function onInstancedMeshDispose( event ) { - this.getUniforms = function() { + const instancedMesh = event.target; - if ( cachedUniforms === undefined ) { + instancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose ); - cachedUniforms = - new WebGLUniforms( gl, program, renderer ); + attributes.remove( instancedMesh.instanceMatrix ); - } + if ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor ); - return cachedUniforms; + } - }; + return { - // set up caching for attribute locations + update: update, + dispose: dispose - var cachedAttributes; + }; - this.getAttributes = function() { + } - if ( cachedAttributes === undefined ) { + /** + * Uniforms of a program. + * Those form a tree structure with a special top-level container for the root, + * which you get by calling 'new WebGLUniforms( gl, program )'. + * + * + * Properties of inner nodes including the top-level container: + * + * .seq - array of nested uniforms + * .map - nested uniforms by name + * + * + * Methods of all nodes except the top-level container: + * + * .setValue( gl, value, [textures] ) + * + * uploads a uniform value(s) + * the 'textures' parameter is needed for sampler uniforms + * + * + * Static methods of the top-level container (textures factorizations): + * + * .upload( gl, seq, values, textures ) + * + * sets uniforms in 'seq' to 'values[id].value' + * + * .seqWithValue( seq, values ) : filteredSeq + * + * filters 'seq' entries with corresponding entry in values + * + * + * Methods of the top-level container (textures factorizations): + * + * .setValue( gl, name, value, textures ) + * + * sets uniform with name 'name' to 'value' + * + * .setOptional( gl, obj, prop ) + * + * like .set for an optional property of the object + * + */ - cachedAttributes = fetchAttributeLocations( gl, program ); - } + const emptyTexture = /*@__PURE__*/ new Texture(); + const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture(); + const empty3dTexture = /*@__PURE__*/ new Data3DTexture(); + const emptyCubeTexture = /*@__PURE__*/ new CubeTexture(); - return cachedAttributes; + // --- Utilities --- - }; + // Array Caches (provide typed arrays for temporary by size) - // free resource + const arrayCacheF32 = []; + const arrayCacheI32 = []; - this.destroy = function() { + // Float32Array caches used for uploading Matrix uniforms - gl.deleteProgram( program ); - this.program = undefined; + const mat4array = new Float32Array( 16 ); + const mat3array = new Float32Array( 9 ); + const mat2array = new Float32Array( 4 ); - }; + // Flattening for arrays of vectors and matrices - // DEPRECATED + function flatten( array, nBlocks, blockSize ) { - Object.defineProperties( this, { + const firstElem = array[ 0 ]; - uniforms: { - get: function() { + if ( firstElem <= 0 || firstElem > 0 ) return array; + // unoptimized: ! isNaN( firstElem ) + // see http://jacksondunstan.com/articles/983 - console.warn( 'THREE.WebGLProgram: .uniforms is now .getUniforms().' ); - return this.getUniforms(); + const n = nBlocks * blockSize; + let r = arrayCacheF32[ n ]; - } - }, + if ( r === undefined ) { - attributes: { - get: function() { + r = new Float32Array( n ); + arrayCacheF32[ n ] = r; - console.warn( 'THREE.WebGLProgram: .attributes is now .getAttributes().' ); - return this.getAttributes(); + } - } - } + if ( nBlocks !== 0 ) { - } ); + firstElem.toArray( r, 0 ); + for ( let i = 1, offset = 0; i !== nBlocks; ++ i ) { - // + offset += blockSize; + array[ i ].toArray( r, offset ); - this.id = programIdCount ++; - this.code = code; - this.usedTimes = 1; - this.program = program; - this.vertexShader = glVertexShader; - this.fragmentShader = glFragmentShader; + } - return this; + } + + return r; } - /** - * @author mrdoob / http://mrdoob.com/ - */ + function arraysEqual( a, b ) { - function WebGLPrograms( renderer, capabilities ) { + if ( a.length !== b.length ) return false; - var programs = []; + for ( let i = 0, l = a.length; i < l; i ++ ) { - var shaderIDs = { - MeshDepthMaterial: 'depth', - MeshNormalMaterial: 'normal', - MeshBasicMaterial: 'basic', - MeshLambertMaterial: 'lambert', - MeshPhongMaterial: 'phong', - MeshToonMaterial: 'phong', - MeshStandardMaterial: 'physical', - MeshPhysicalMaterial: 'physical', - LineBasicMaterial: 'basic', - LineDashedMaterial: 'dashed', - PointsMaterial: 'points' - }; + if ( a[ i ] !== b[ i ] ) return false; - var parameterNames = [ - "precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", - "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", - "roughnessMap", "metalnessMap", "gradientMap", - "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", - "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", - "maxBones", "useVertexTexture", "morphTargets", "morphNormals", - "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", - "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "numRectAreaLights", - "shadowMapEnabled", "shadowMapType", "toneMapping", 'physicallyCorrectLights', - "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering" - ]; + } + return true; - function allocateBones( object ) { + } - var skeleton = object.skeleton; - var bones = skeleton.bones; + function copyArray( a, b ) { - if ( capabilities.floatVertexTextures ) { + for ( let i = 0, l = b.length; i < l; i ++ ) { - return 1024; + a[ i ] = b[ i ]; - } else { + } - // default for when object is not specified - // ( for example when prebuilding shader to be used with multiple objects ) - // - // - leave some extra space for other uniforms - // - limit here is ANGLE's 254 max uniform vectors - // (up to 54 should be safe) + } - var nVertexUniforms = capabilities.maxVertexUniforms; - var nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 ); + // Texture unit allocation - var maxBones = Math.min( nVertexMatrices, bones.length ); + function allocTexUnits( textures, n ) { - if ( maxBones < bones.length ) { + let r = arrayCacheI32[ n ]; - console.warn( 'THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.' ); - return 0; + if ( r === undefined ) { - } + r = new Int32Array( n ); + arrayCacheI32[ n ] = r; - return maxBones; + } - } + for ( let i = 0; i !== n; ++ i ) { - } + r[ i ] = textures.allocateTextureUnit(); - function getTextureEncodingFromMap( map, gammaOverrideLinear ) { + } - var encoding; + return r; - if ( ! map ) { + } - encoding = LinearEncoding; + // --- Setters --- - } else if ( map.isTexture ) { + // Note: Defining these methods externally, because they come in a bunch + // and this way their names minify. - encoding = map.encoding; + // Single scalar - } else if ( map.isWebGLRenderTarget ) { + function setValueV1f( gl, v ) { - console.warn( "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead." ); - encoding = map.texture.encoding; + const cache = this.cache; - } + if ( cache[ 0 ] === v ) return; - // add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point. - if ( encoding === LinearEncoding && gammaOverrideLinear ) { + gl.uniform1f( this.addr, v ); - encoding = GammaEncoding; + cache[ 0 ] = v; - } + } - return encoding; + // Single float vector (from flat array or THREE.VectorN) - } + function setValueV2f( gl, v ) { - this.getParameters = function ( material, lights, fog, nClipPlanes, nClipIntersection, object ) { + const cache = this.cache; - var shaderID = shaderIDs[ material.type ]; + if ( v.x !== undefined ) { - // heuristics to create shader parameters according to lights in the scene - // (not to blow over maxLights budget) + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) { - var maxBones = object.isSkinnedMesh ? allocateBones( object ) : 0; - var precision = renderer.getPrecision(); + gl.uniform2f( this.addr, v.x, v.y ); - if ( material.precision !== null ) { + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; - precision = capabilities.getMaxPrecision( material.precision ); + } - if ( precision !== material.precision ) { + } else { - console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' ); + if ( arraysEqual( cache, v ) ) return; - } + gl.uniform2fv( this.addr, v ); - } + copyArray( cache, v ); - var currentRenderTarget = renderer.getRenderTarget(); + } - var parameters = { + } - shaderID: shaderID, + function setValueV3f( gl, v ) { - precision: precision, - supportsVertexTextures: capabilities.vertexTextures, - outputEncoding: getTextureEncodingFromMap( ( ! currentRenderTarget ) ? null : currentRenderTarget.texture, renderer.gammaOutput ), - map: !! material.map, - mapEncoding: getTextureEncodingFromMap( material.map, renderer.gammaInput ), - envMap: !! material.envMap, - envMapMode: material.envMap && material.envMap.mapping, - envMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ), - envMapCubeUV: ( !! material.envMap ) && ( ( material.envMap.mapping === CubeUVReflectionMapping ) || ( material.envMap.mapping === CubeUVRefractionMapping ) ), - lightMap: !! material.lightMap, - aoMap: !! material.aoMap, - emissiveMap: !! material.emissiveMap, - emissiveMapEncoding: getTextureEncodingFromMap( material.emissiveMap, renderer.gammaInput ), - bumpMap: !! material.bumpMap, - normalMap: !! material.normalMap, - displacementMap: !! material.displacementMap, - roughnessMap: !! material.roughnessMap, - metalnessMap: !! material.metalnessMap, - specularMap: !! material.specularMap, - alphaMap: !! material.alphaMap, - - gradientMap: !! material.gradientMap, + const cache = this.cache; - combine: material.combine, + if ( v.x !== undefined ) { - vertexColors: material.vertexColors, + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) { - fog: !! fog, - useFog: material.fog, - fogExp: ( fog && fog.isFogExp2 ), + gl.uniform3f( this.addr, v.x, v.y, v.z ); - flatShading: material.shading === FlatShading, + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; - sizeAttenuation: material.sizeAttenuation, - logarithmicDepthBuffer: capabilities.logarithmicDepthBuffer, + } - skinning: material.skinning && maxBones > 0, - maxBones: maxBones, - useVertexTexture: capabilities.floatVertexTextures, + } else if ( v.r !== undefined ) { - morphTargets: material.morphTargets, - morphNormals: material.morphNormals, - maxMorphTargets: renderer.maxMorphTargets, - maxMorphNormals: renderer.maxMorphNormals, + if ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) { - numDirLights: lights.directional.length, - numPointLights: lights.point.length, - numSpotLights: lights.spot.length, - numRectAreaLights: lights.rectArea.length, - numHemiLights: lights.hemi.length, + gl.uniform3f( this.addr, v.r, v.g, v.b ); - numClippingPlanes: nClipPlanes, - numClipIntersection: nClipIntersection, + cache[ 0 ] = v.r; + cache[ 1 ] = v.g; + cache[ 2 ] = v.b; - dithering: material.dithering, + } - shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0, - shadowMapType: renderer.shadowMap.type, + } else { - toneMapping: renderer.toneMapping, - physicallyCorrectLights: renderer.physicallyCorrectLights, + if ( arraysEqual( cache, v ) ) return; - premultipliedAlpha: material.premultipliedAlpha, + gl.uniform3fv( this.addr, v ); - alphaTest: material.alphaTest, - doubleSided: material.side === DoubleSide, - flipSided: material.side === BackSide, + copyArray( cache, v ); - depthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false + } - }; + } - return parameters; + function setValueV4f( gl, v ) { - }; + const cache = this.cache; - this.getProgramCode = function ( material, parameters ) { + if ( v.x !== undefined ) { - var array = []; + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) { - if ( parameters.shaderID ) { + gl.uniform4f( this.addr, v.x, v.y, v.z, v.w ); - array.push( parameters.shaderID ); + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; + cache[ 3 ] = v.w; - } else { + } - array.push( material.fragmentShader ); - array.push( material.vertexShader ); + } else { - } + if ( arraysEqual( cache, v ) ) return; - if ( material.defines !== undefined ) { + gl.uniform4fv( this.addr, v ); - for ( var name in material.defines ) { + copyArray( cache, v ); - array.push( name ); - array.push( material.defines[ name ] ); + } - } + } - } + // Single matrix (from flat array or THREE.MatrixN) - for ( var i = 0; i < parameterNames.length; i ++ ) { + function setValueM2( gl, v ) { - array.push( parameters[ parameterNames[ i ] ] ); + const cache = this.cache; + const elements = v.elements; - } + if ( elements === undefined ) { - array.push( material.onBeforeCompile.toString() ); + if ( arraysEqual( cache, v ) ) return; - array.push( renderer.gammaOutput ); + gl.uniformMatrix2fv( this.addr, false, v ); - return array.join(); + copyArray( cache, v ); - }; + } else { - this.acquireProgram = function ( material, shader, parameters, code ) { + if ( arraysEqual( cache, elements ) ) return; - var program; + mat2array.set( elements ); - // Check if code has been already compiled - for ( var p = 0, pl = programs.length; p < pl; p ++ ) { + gl.uniformMatrix2fv( this.addr, false, mat2array ); - var programInfo = programs[ p ]; + copyArray( cache, elements ); - if ( programInfo.code === code ) { + } - program = programInfo; - ++ program.usedTimes; + } - break; + function setValueM3( gl, v ) { - } + const cache = this.cache; + const elements = v.elements; - } + if ( elements === undefined ) { - if ( program === undefined ) { + if ( arraysEqual( cache, v ) ) return; - program = new WebGLProgram( renderer, code, material, shader, parameters ); - programs.push( program ); + gl.uniformMatrix3fv( this.addr, false, v ); - } + copyArray( cache, v ); - return program; + } else { - }; + if ( arraysEqual( cache, elements ) ) return; - this.releaseProgram = function ( program ) { + mat3array.set( elements ); - if ( -- program.usedTimes === 0 ) { + gl.uniformMatrix3fv( this.addr, false, mat3array ); - // Remove from unordered set - var i = programs.indexOf( program ); - programs[ i ] = programs[ programs.length - 1 ]; - programs.pop(); + copyArray( cache, elements ); - // Free WebGL resources - program.destroy(); + } - } + } - }; + function setValueM4( gl, v ) { - // Exposed for resource monitoring & error feedback via renderer.info: - this.programs = programs; + const cache = this.cache; + const elements = v.elements; - } + if ( elements === undefined ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( arraysEqual( cache, v ) ) return; - function WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, infoMemory ) { + gl.uniformMatrix4fv( this.addr, false, v ); - var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext ); + copyArray( cache, v ); - // + } else { - function clampToMaxSize( image, maxSize ) { + if ( arraysEqual( cache, elements ) ) return; - if ( image.width > maxSize || image.height > maxSize ) { + mat4array.set( elements ); - // Warning: Scaling through the canvas will only work with images that use - // premultiplied alpha. + gl.uniformMatrix4fv( this.addr, false, mat4array ); - var scale = maxSize / Math.max( image.width, image.height ); + copyArray( cache, elements ); - var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - canvas.width = Math.floor( image.width * scale ); - canvas.height = Math.floor( image.height * scale ); + } - var context = canvas.getContext( '2d' ); - context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height ); + } - console.warn( 'THREE.WebGLRenderer: image is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image ); + // Single integer / boolean - return canvas; + function setValueV1i( gl, v ) { - } + const cache = this.cache; - return image; + if ( cache[ 0 ] === v ) return; - } + gl.uniform1i( this.addr, v ); - function isPowerOfTwo( image ) { + cache[ 0 ] = v; - return _Math.isPowerOfTwo( image.width ) && _Math.isPowerOfTwo( image.height ); + } - } + // Single integer / boolean vector (from flat array or THREE.VectorN) - function makePowerOfTwo( image ) { + function setValueV2i( gl, v ) { - if ( image instanceof HTMLImageElement || image instanceof HTMLCanvasElement ) { + const cache = this.cache; - var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - canvas.width = _Math.nearestPowerOfTwo( image.width ); - canvas.height = _Math.nearestPowerOfTwo( image.height ); + if ( v.x !== undefined ) { - var context = canvas.getContext( '2d' ); - context.drawImage( image, 0, 0, canvas.width, canvas.height ); + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) { - console.warn( 'THREE.WebGLRenderer: image is not power of two (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image ); + gl.uniform2i( this.addr, v.x, v.y ); - return canvas; + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; } - return image; + } else { - } + if ( arraysEqual( cache, v ) ) return; - function textureNeedsPowerOfTwo( texture ) { + gl.uniform2iv( this.addr, v ); - return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) || - ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ); + copyArray( cache, v ); } - function textureNeedsGenerateMipmaps( texture, isPowerOfTwo ) { + } - return texture.generateMipmaps && isPowerOfTwo && - texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; + function setValueV3i( gl, v ) { - } + const cache = this.cache; - // Fallback filters for non-power-of-2 textures + if ( v.x !== undefined ) { - function filterFallback( f ) { + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) { - if ( f === NearestFilter || f === NearestMipMapNearestFilter || f === NearestMipMapLinearFilter ) { + gl.uniform3i( this.addr, v.x, v.y, v.z ); - return _gl.NEAREST; + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; } - return _gl.LINEAR; + } else { - } + if ( arraysEqual( cache, v ) ) return; - // + gl.uniform3iv( this.addr, v ); - function onTextureDispose( event ) { + copyArray( cache, v ); - var texture = event.target; + } - texture.removeEventListener( 'dispose', onTextureDispose ); + } - deallocateTexture( texture ); + function setValueV4i( gl, v ) { - infoMemory.textures --; + const cache = this.cache; + if ( v.x !== undefined ) { - } + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) { - function onRenderTargetDispose( event ) { + gl.uniform4i( this.addr, v.x, v.y, v.z, v.w ); - var renderTarget = event.target; + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; + cache[ 3 ] = v.w; - renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); + } - deallocateRenderTarget( renderTarget ); + } else { + + if ( arraysEqual( cache, v ) ) return; - infoMemory.textures --; + gl.uniform4iv( this.addr, v ); + + copyArray( cache, v ); } - // + } - function deallocateTexture( texture ) { + // Single unsigned integer - var textureProperties = properties.get( texture ); + function setValueV1ui( gl, v ) { - if ( texture.image && textureProperties.__image__webglTextureCube ) { + const cache = this.cache; - // cube texture + if ( cache[ 0 ] === v ) return; - _gl.deleteTexture( textureProperties.__image__webglTextureCube ); + gl.uniform1ui( this.addr, v ); - } else { + cache[ 0 ] = v; - // 2D texture + } - if ( textureProperties.__webglInit === undefined ) return; + // Single unsigned integer vector (from flat array or THREE.VectorN) - _gl.deleteTexture( textureProperties.__webglTexture ); + function setValueV2ui( gl, v ) { - } + const cache = this.cache; - // remove all webgl properties - properties.remove( texture ); + if ( v.x !== undefined ) { - } + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) { - function deallocateRenderTarget( renderTarget ) { + gl.uniform2ui( this.addr, v.x, v.y ); - var renderTargetProperties = properties.get( renderTarget ); - var textureProperties = properties.get( renderTarget.texture ); + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; - if ( ! renderTarget ) return; + } - if ( textureProperties.__webglTexture !== undefined ) { + } else { - _gl.deleteTexture( textureProperties.__webglTexture ); + if ( arraysEqual( cache, v ) ) return; - } + gl.uniform2uiv( this.addr, v ); - if ( renderTarget.depthTexture ) { + copyArray( cache, v ); - renderTarget.depthTexture.dispose(); + } - } + } - if ( renderTarget.isWebGLRenderTargetCube ) { + function setValueV3ui( gl, v ) { - for ( var i = 0; i < 6; i ++ ) { + const cache = this.cache; - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); - if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); + if ( v.x !== undefined ) { - } + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) { - } else { + gl.uniform3ui( this.addr, v.x, v.y, v.z ); - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); - if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; } - properties.remove( renderTarget.texture ); - properties.remove( renderTarget ); - - } + } else { - // + if ( arraysEqual( cache, v ) ) return; + gl.uniform3uiv( this.addr, v ); + copyArray( cache, v ); - function setTexture2D( texture, slot ) { + } - var textureProperties = properties.get( texture ); + } - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + function setValueV4ui( gl, v ) { - var image = texture.image; + const cache = this.cache; - if ( image === undefined ) { + if ( v.x !== undefined ) { - console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined', texture ); + if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) { - } else if ( image.complete === false ) { + gl.uniform4ui( this.addr, v.x, v.y, v.z, v.w ); - console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete', texture ); + cache[ 0 ] = v.x; + cache[ 1 ] = v.y; + cache[ 2 ] = v.z; + cache[ 3 ] = v.w; - } else { + } - uploadTexture( textureProperties, texture, slot ); - return; + } else { - } + if ( arraysEqual( cache, v ) ) return; - } + gl.uniform4uiv( this.addr, v ); - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + copyArray( cache, v ); } - function setTextureCube( texture, slot ) { + } - var textureProperties = properties.get( texture ); - if ( texture.image.length === 6 ) { + // Single texture (2D / Cube) - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + function setValueT1( gl, v, textures ) { - if ( ! textureProperties.__image__webglTextureCube ) { + const cache = this.cache; + const unit = textures.allocateTextureUnit(); - texture.addEventListener( 'dispose', onTextureDispose ); + if ( cache[ 0 ] !== unit ) { - textureProperties.__image__webglTextureCube = _gl.createTexture(); + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; - infoMemory.textures ++; + } - } + textures.setTexture2D( v || emptyTexture, unit ); - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube ); + } - _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + function setValueT3D1( gl, v, textures ) { - var isCompressed = ( texture && texture.isCompressedTexture ); - var isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture ); + const cache = this.cache; + const unit = textures.allocateTextureUnit(); - var cubeImage = []; + if ( cache[ 0 ] !== unit ) { - for ( var i = 0; i < 6; i ++ ) { + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; - if ( ! isCompressed && ! isDataTexture ) { + } - cubeImage[ i ] = clampToMaxSize( texture.image[ i ], capabilities.maxCubemapSize ); + textures.setTexture3D( v || empty3dTexture, unit ); - } else { + } - cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; + function setValueT6( gl, v, textures ) { - } + const cache = this.cache; + const unit = textures.allocateTextureUnit(); - } + if ( cache[ 0 ] !== unit ) { - var image = cubeImage[ 0 ], - isPowerOfTwoImage = isPowerOfTwo( image ), - glFormat = paramThreeToGL( texture.format ), - glType = paramThreeToGL( texture.type ); + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; - setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isPowerOfTwoImage ); + } - for ( var i = 0; i < 6; i ++ ) { + textures.setTextureCube( v || emptyCubeTexture, unit ); - if ( ! isCompressed ) { + } - if ( isDataTexture ) { + function setValueT2DArray1( gl, v, textures ) { - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); + const cache = this.cache; + const unit = textures.allocateTextureUnit(); - } else { + if ( cache[ 0 ] !== unit ) { - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); + gl.uniform1i( this.addr, unit ); + cache[ 0 ] = unit; - } + } - } else { + textures.setTexture2DArray( v || emptyArrayTexture, unit ); - var mipmap, mipmaps = cubeImage[ i ].mipmaps; + } - for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) { + // Helper to pick the right setter for the singular case - mipmap = mipmaps[ j ]; + function getSingularSetter( type ) { - if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { + switch ( type ) { - if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { + case 0x1406: return setValueV1f; // FLOAT + case 0x8b50: return setValueV2f; // _VEC2 + case 0x8b51: return setValueV3f; // _VEC3 + case 0x8b52: return setValueV4f; // _VEC4 - state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + case 0x8b5a: return setValueM2; // _MAT2 + case 0x8b5b: return setValueM3; // _MAT3 + case 0x8b5c: return setValueM4; // _MAT4 - } else { + case 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL + case 0x8b53: case 0x8b57: return setValueV2i; // _VEC2 + case 0x8b54: case 0x8b58: return setValueV3i; // _VEC3 + case 0x8b55: case 0x8b59: return setValueV4i; // _VEC4 - console.warn( "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()" ); + case 0x1405: return setValueV1ui; // UINT + case 0x8dc6: return setValueV2ui; // _VEC2 + case 0x8dc7: return setValueV3ui; // _VEC3 + case 0x8dc8: return setValueV4ui; // _VEC4 - } + case 0x8b5e: // SAMPLER_2D + case 0x8d66: // SAMPLER_EXTERNAL_OES + case 0x8dca: // INT_SAMPLER_2D + case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D + case 0x8b62: // SAMPLER_2D_SHADOW + return setValueT1; - } else { + case 0x8b5f: // SAMPLER_3D + case 0x8dcb: // INT_SAMPLER_3D + case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D + return setValueT3D1; - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + case 0x8b60: // SAMPLER_CUBE + case 0x8dcc: // INT_SAMPLER_CUBE + case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE + case 0x8dc5: // SAMPLER_CUBE_SHADOW + return setValueT6; - } + case 0x8dc1: // SAMPLER_2D_ARRAY + case 0x8dcf: // INT_SAMPLER_2D_ARRAY + case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY + case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW + return setValueT2DArray1; - } + } - } + } - } - if ( textureNeedsGenerateMipmaps( texture, isPowerOfTwoImage ) ) { + // Array of scalars - _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); + function setValueV1fArray( gl, v ) { - } + gl.uniform1fv( this.addr, v ); - textureProperties.__version = texture.version; + } - if ( texture.onUpdate ) texture.onUpdate( texture ); + // Array of vectors (from flat array or array of THREE.VectorN) - } else { + function setValueV2fArray( gl, v ) { - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube ); + const data = flatten( v, this.size, 2 ); - } + gl.uniform2fv( this.addr, data ); - } + } - } + function setValueV3fArray( gl, v ) { - function setTextureCubeDynamic( texture, slot ) { + const data = flatten( v, this.size, 3 ); - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, properties.get( texture ).__webglTexture ); + gl.uniform3fv( this.addr, data ); - } + } - function setTextureParameters( textureType, texture, isPowerOfTwoImage ) { + function setValueV4fArray( gl, v ) { - var extension; + const data = flatten( v, this.size, 4 ); - if ( isPowerOfTwoImage ) { + gl.uniform4fv( this.addr, data ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, paramThreeToGL( texture.wrapT ) ); + } - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, paramThreeToGL( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, paramThreeToGL( texture.minFilter ) ); + // Array of matrices (from flat array or array of THREE.MatrixN) - } else { + function setValueM2Array( gl, v ) { - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); + const data = flatten( v, this.size, 4 ); - if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) { + gl.uniformMatrix2fv( this.addr, false, data ); - console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', texture ); + } - } + function setValueM3Array( gl, v ) { - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) ); + const data = flatten( v, this.size, 9 ); - if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) { + gl.uniformMatrix3fv( this.addr, false, data ); - console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', texture ); + } - } + function setValueM4Array( gl, v ) { - } + const data = flatten( v, this.size, 16 ); - extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + gl.uniformMatrix4fv( this.addr, false, data ); - if ( extension ) { + } - if ( texture.type === FloatType && extensions.get( 'OES_texture_float_linear' ) === null ) return; - if ( texture.type === HalfFloatType && extensions.get( 'OES_texture_half_float_linear' ) === null ) return; + // Array of integer / boolean - if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) { + function setValueV1iArray( gl, v ) { - _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) ); - properties.get( texture ).__currentAnisotropy = texture.anisotropy; + gl.uniform1iv( this.addr, v ); - } + } - } + // Array of integer / boolean vectors (from flat array) - } + function setValueV2iArray( gl, v ) { - function uploadTexture( textureProperties, texture, slot ) { + gl.uniform2iv( this.addr, v ); - if ( textureProperties.__webglInit === undefined ) { + } - textureProperties.__webglInit = true; + function setValueV3iArray( gl, v ) { - texture.addEventListener( 'dispose', onTextureDispose ); + gl.uniform3iv( this.addr, v ); - textureProperties.__webglTexture = _gl.createTexture(); + } - infoMemory.textures ++; + function setValueV4iArray( gl, v ) { - } + gl.uniform4iv( this.addr, v ); - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + } - _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); - _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); - _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); + // Array of unsigned integer - var image = clampToMaxSize( texture.image, capabilities.maxTextureSize ); + function setValueV1uiArray( gl, v ) { - if ( textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( image ) === false ) { + gl.uniform1uiv( this.addr, v ); - image = makePowerOfTwo( image ); + } - } + // Array of unsigned integer vectors (from flat array) - var isPowerOfTwoImage = isPowerOfTwo( image ), - glFormat = paramThreeToGL( texture.format ), - glType = paramThreeToGL( texture.type ); + function setValueV2uiArray( gl, v ) { - setTextureParameters( _gl.TEXTURE_2D, texture, isPowerOfTwoImage ); + gl.uniform2uiv( this.addr, v ); - var mipmap, mipmaps = texture.mipmaps; + } - if ( texture.isDepthTexture ) { + function setValueV3uiArray( gl, v ) { - // populate depth texture with dummy data + gl.uniform3uiv( this.addr, v ); - var internalFormat = _gl.DEPTH_COMPONENT; + } - if ( texture.type === FloatType ) { + function setValueV4uiArray( gl, v ) { - if ( !_isWebGL2 ) throw new Error('Float Depth Texture only supported in WebGL2.0'); - internalFormat = _gl.DEPTH_COMPONENT32F; + gl.uniform4uiv( this.addr, v ); - } else if ( _isWebGL2 ) { + } - // WebGL 2.0 requires signed internalformat for glTexImage2D - internalFormat = _gl.DEPTH_COMPONENT16; - } + // Array of textures (2D / 3D / Cube / 2DArray) - if ( texture.format === DepthFormat && internalFormat === _gl.DEPTH_COMPONENT ) { + function setValueT1Array( gl, v, textures ) { - // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are - // DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.type !== UnsignedShortType && texture.type !== UnsignedIntType ) { + const cache = this.cache; - console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ); + const n = v.length; - texture.type = UnsignedShortType; - glType = paramThreeToGL( texture.type ); + const units = allocTexUnits( textures, n ); - } + if ( ! arraysEqual( cache, units ) ) { - } + gl.uniform1iv( this.addr, units ); - // Depth stencil textures need the DEPTH_STENCIL internal format - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.format === DepthStencilFormat ) { + copyArray( cache, units ); - internalFormat = _gl.DEPTH_STENCIL; + } - // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are - // DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL. - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.type !== UnsignedInt248Type ) { + for ( let i = 0; i !== n; ++ i ) { - console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ); + textures.setTexture2D( v[ i ] || emptyTexture, units[ i ] ); - texture.type = UnsignedInt248Type; - glType = paramThreeToGL( texture.type ); + } - } + } - } + function setValueT3DArray( gl, v, textures ) { - state.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, image.width, image.height, 0, glFormat, glType, null ); + const cache = this.cache; - } else if ( texture.isDataTexture ) { + const n = v.length; - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels + const units = allocTexUnits( textures, n ); - if ( mipmaps.length > 0 && isPowerOfTwoImage ) { + if ( ! arraysEqual( cache, units ) ) { - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + gl.uniform1iv( this.addr, units ); - mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + copyArray( cache, units ); - } + } - texture.generateMipmaps = false; + for ( let i = 0; i !== n; ++ i ) { - } else { + textures.setTexture3D( v[ i ] || empty3dTexture, units[ i ] ); - state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data ); + } - } + } - } else if ( texture.isCompressedTexture ) { + function setValueT6Array( gl, v, textures ) { - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + const cache = this.cache; - mipmap = mipmaps[ i ]; + const n = v.length; - if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { + const units = allocTexUnits( textures, n ); - if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { + if ( ! arraysEqual( cache, units ) ) { - state.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + gl.uniform1iv( this.addr, units ); - } else { + copyArray( cache, units ); - console.warn( "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()" ); + } - } + for ( let i = 0; i !== n; ++ i ) { - } else { + textures.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); - state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + } - } + } - } + function setValueT2DArrayArray( gl, v, textures ) { - } else { + const cache = this.cache; - // regular Texture (image, video, canvas) + const n = v.length; - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels + const units = allocTexUnits( textures, n ); - if ( mipmaps.length > 0 && isPowerOfTwoImage ) { + if ( ! arraysEqual( cache, units ) ) { - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + gl.uniform1iv( this.addr, units ); - mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap ); + copyArray( cache, units ); - } + } - texture.generateMipmaps = false; + for ( let i = 0; i !== n; ++ i ) { - } else { + textures.setTexture2DArray( v[ i ] || emptyArrayTexture, units[ i ] ); - state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, image ); + } - } + } - } - if ( textureNeedsGenerateMipmaps( texture, isPowerOfTwoImage ) ) _gl.generateMipmap( _gl.TEXTURE_2D ); + // Helper to pick the right setter for a pure (bottom-level) array - textureProperties.__version = texture.version; + function getPureArraySetter( type ) { - if ( texture.onUpdate ) texture.onUpdate( texture ); + switch ( type ) { - } + case 0x1406: return setValueV1fArray; // FLOAT + case 0x8b50: return setValueV2fArray; // _VEC2 + case 0x8b51: return setValueV3fArray; // _VEC3 + case 0x8b52: return setValueV4fArray; // _VEC4 - // Render targets + case 0x8b5a: return setValueM2Array; // _MAT2 + case 0x8b5b: return setValueM3Array; // _MAT3 + case 0x8b5c: return setValueM4Array; // _MAT4 - // Setup storage for target texture and bind it to correct framebuffer - function setupFrameBufferTexture( framebuffer, renderTarget, attachment, textureTarget ) { + case 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL + case 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2 + case 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3 + case 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4 - var glFormat = paramThreeToGL( renderTarget.texture.format ); - var glType = paramThreeToGL( renderTarget.texture.type ); - state.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 ); - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); + case 0x1405: return setValueV1uiArray; // UINT + case 0x8dc6: return setValueV2uiArray; // _VEC2 + case 0x8dc7: return setValueV3uiArray; // _VEC3 + case 0x8dc8: return setValueV4uiArray; // _VEC4 - } + case 0x8b5e: // SAMPLER_2D + case 0x8d66: // SAMPLER_EXTERNAL_OES + case 0x8dca: // INT_SAMPLER_2D + case 0x8dd2: // UNSIGNED_INT_SAMPLER_2D + case 0x8b62: // SAMPLER_2D_SHADOW + return setValueT1Array; - // Setup storage for internal depth/stencil buffers and bind to correct framebuffer - function setupRenderBufferStorage( renderbuffer, renderTarget ) { + case 0x8b5f: // SAMPLER_3D + case 0x8dcb: // INT_SAMPLER_3D + case 0x8dd3: // UNSIGNED_INT_SAMPLER_3D + return setValueT3DArray; - _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer ); + case 0x8b60: // SAMPLER_CUBE + case 0x8dcc: // INT_SAMPLER_CUBE + case 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE + case 0x8dc5: // SAMPLER_CUBE_SHADOW + return setValueT6Array; - if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { + case 0x8dc1: // SAMPLER_2D_ARRAY + case 0x8dcf: // INT_SAMPLER_2D_ARRAY + case 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY + case 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW + return setValueT2DArrayArray; - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); + } - } else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { + } - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); + // --- Uniform Classes --- - } else { + class SingleUniform { - // FIXME: We don't support !depth !stencil - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height ); + constructor( id, activeInfo, addr ) { - } + this.id = id; + this.addr = addr; + this.cache = []; + this.setValue = getSingularSetter( activeInfo.type ); - _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); + // this.path = activeInfo.name; // DEBUG } - // Setup resources for a Depth Texture for a FBO (needs an extension) - function setupDepthTexture( framebuffer, renderTarget ) { + } - var isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube ); - if ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!'); + class PureArrayUniform { - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + constructor( id, activeInfo, addr ) { - if ( !( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) { + this.id = id; + this.addr = addr; + this.cache = []; + this.size = activeInfo.size; + this.setValue = getPureArraySetter( activeInfo.type ); - throw new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture'); + // this.path = activeInfo.name; // DEBUG - } + } - // upload an empty depth texture with framebuffer size - if ( !properties.get( renderTarget.depthTexture ).__webglTexture || - renderTarget.depthTexture.image.width !== renderTarget.width || - renderTarget.depthTexture.image.height !== renderTarget.height ) { - renderTarget.depthTexture.image.width = renderTarget.width; - renderTarget.depthTexture.image.height = renderTarget.height; - renderTarget.depthTexture.needsUpdate = true; - } + } - setTexture2D( renderTarget.depthTexture, 0 ); + class StructuredUniform { - var webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture; + constructor( id ) { - if ( renderTarget.depthTexture.format === DepthFormat ) { + this.id = id; - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); + this.seq = []; + this.map = {}; - } else if ( renderTarget.depthTexture.format === DepthStencilFormat ) { + } - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); + setValue( gl, value, textures ) { - } else { + const seq = this.seq; - throw new Error('Unknown depthTexture format') + for ( let i = 0, n = seq.length; i !== n; ++ i ) { + + const u = seq[ i ]; + u.setValue( gl, value[ u.id ], textures ); } } - // Setup GL resources for a non-texture depth buffer - function setupDepthRenderbuffer( renderTarget ) { - - var renderTargetProperties = properties.get( renderTarget ); - - var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); - - if ( renderTarget.depthTexture ) { - - if ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets'); - - setupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget ); + } - } else { + // --- Top-level --- - if ( isCube ) { + // Parser - builds up the property tree from the path strings - renderTargetProperties.__webglDepthbuffer = []; + const RePathPart = /(\w+)(\])?(\[|\.)?/g; - for ( var i = 0; i < 6; i ++ ) { + // extracts + // - the identifier (member name or array index) + // - followed by an optional right bracket (found when array index) + // - followed by an optional left bracket or dot (type of subscript) + // + // Note: These portions can be read in a non-overlapping fashion and + // allow straightforward parsing of the hierarchy that WebGL encodes + // in the uniform names. - _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] ); - renderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer(); - setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget ); + function addUniform( container, uniformObject ) { - } + container.seq.push( uniformObject ); + container.map[ uniformObject.id ] = uniformObject; - } else { + } - _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); - renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); - setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget ); + function parseUniform( activeInfo, addr, container ) { - } + const path = activeInfo.name, + pathLength = path.length; - } + // reset RegExp object, because of the early exit of a previous run + RePathPart.lastIndex = 0; - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); + while ( true ) { - } + const match = RePathPart.exec( path ), + matchEnd = RePathPart.lastIndex; - // Set up GL resources for the render target - function setupRenderTarget( renderTarget ) { + let id = match[ 1 ]; + const idIsIndex = match[ 2 ] === ']', + subscript = match[ 3 ]; - var renderTargetProperties = properties.get( renderTarget ); - var textureProperties = properties.get( renderTarget.texture ); + if ( idIsIndex ) id = id | 0; // convert to integer - renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); + if ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) { - textureProperties.__webglTexture = _gl.createTexture(); + // bare name or "pure" bottom-level array "[0]" suffix - infoMemory.textures ++; + addUniform( container, subscript === undefined ? + new SingleUniform( id, activeInfo, addr ) : + new PureArrayUniform( id, activeInfo, addr ) ); - var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); - var isTargetPowerOfTwo = isPowerOfTwo( renderTarget ); + break; - // Setup framebuffer + } else { - if ( isCube ) { + // step into inner node / create it in case it doesn't exist - renderTargetProperties.__webglFramebuffer = []; + const map = container.map; + let next = map[ id ]; - for ( var i = 0; i < 6; i ++ ) { + if ( next === undefined ) { - renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + next = new StructuredUniform( id ); + addUniform( container, next ); } - } else { - - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + container = next; } - // Setup color buffer + } - if ( isCube ) { + } - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo ); + // Root Container - for ( var i = 0; i < 6; i ++ ) { + class WebGLUniforms { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); + constructor( gl, program ) { - } + this.seq = []; + this.map = {}; - if ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); + const n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS ); - } else { + for ( let i = 0; i < n; ++ i ) { - state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); + const info = gl.getActiveUniform( program, i ), + addr = gl.getUniformLocation( program, info.name ); - if ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) _gl.generateMipmap( _gl.TEXTURE_2D ); - state.bindTexture( _gl.TEXTURE_2D, null ); + parseUniform( info, addr, this ); } - // Setup depth and stencil buffers + } - if ( renderTarget.depthBuffer ) { + setValue( gl, name, value, textures ) { - setupDepthRenderbuffer( renderTarget ); + const u = this.map[ name ]; - } + if ( u !== undefined ) u.setValue( gl, value, textures ); } - function updateRenderTargetMipmap( renderTarget ) { + setOptional( gl, object, name ) { - var texture = renderTarget.texture; - var isTargetPowerOfTwo = isPowerOfTwo( renderTarget ); + const v = object[ name ]; - if ( textureNeedsGenerateMipmaps( texture, isTargetPowerOfTwo ) ) { + if ( v !== undefined ) this.setValue( gl, name, v ); - var target = renderTarget.isWebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D; - var webglTexture = properties.get( texture ).__webglTexture; + } - state.bindTexture( target, webglTexture ); - _gl.generateMipmap( target ); - state.bindTexture( target, null ); + static upload( gl, seq, values, textures ) { - } + for ( let i = 0, n = seq.length; i !== n; ++ i ) { - } + const u = seq[ i ], + v = values[ u.id ]; - this.setTexture2D = setTexture2D; - this.setTextureCube = setTextureCube; - this.setTextureCubeDynamic = setTextureCubeDynamic; - this.setupRenderTarget = setupRenderTarget; - this.updateRenderTargetMipmap = updateRenderTargetMipmap; + if ( v.needsUpdate !== false ) { - } + // note: always updating when .needsUpdate is undefined + u.setValue( gl, v.value, textures ); - /** - * @author fordacious / fordacious.github.io - */ + } - function WebGLProperties() { + } - var properties = {}; + } - function get( object ) { + static seqWithValue( seq, values ) { - var uuid = object.uuid; - var map = properties[ uuid ]; + const r = []; - if ( map === undefined ) { + for ( let i = 0, n = seq.length; i !== n; ++ i ) { - map = {}; - properties[ uuid ] = map; + const u = seq[ i ]; + if ( u.id in values ) r.push( u ); } - return map; + return r; } - function remove( object ) { - - delete properties[ object.uuid ]; - - } + } - function clear() { + function WebGLShader( gl, type, string ) { - properties = {}; + const shader = gl.createShader( type ); - } + gl.shaderSource( shader, string ); + gl.compileShader( shader ); - return { - get: get, - remove: remove, - clear: clear - }; + return shader; } - /** - * @author mrdoob / http://mrdoob.com/ - */ + let programIdCount = 0; - function WebGLState( gl, extensions, paramThreeToGL ) { + function handleSource( string, errorLine ) { - function ColorBuffer() { + const lines = string.split( '\n' ); + const lines2 = []; - var locked = false; + const from = Math.max( errorLine - 6, 0 ); + const to = Math.min( errorLine + 6, lines.length ); - var color = new Vector4(); - var currentColorMask = null; - var currentColorClear = new Vector4(); + for ( let i = from; i < to; i ++ ) { - return { + const line = i + 1; + lines2.push( `${line === errorLine ? '>' : ' '} ${line}: ${lines[ i ]}` ); - setMask: function ( colorMask ) { + } - if ( currentColorMask !== colorMask && ! locked ) { + return lines2.join( '\n' ); - gl.colorMask( colorMask, colorMask, colorMask, colorMask ); - currentColorMask = colorMask; + } - } + function getEncodingComponents( colorSpace ) { - }, + switch ( colorSpace ) { - setLocked: function ( lock ) { + case LinearSRGBColorSpace: + return [ 'Linear', '( value )' ]; + case SRGBColorSpace: + return [ 'sRGB', '( value )' ]; + default: + console.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace ); + return [ 'Linear', '( value )' ]; - locked = lock; + } - }, + } - setClear: function ( r, g, b, a, premultipliedAlpha ) { + function getShaderErrors( gl, shader, type ) { - if ( premultipliedAlpha === true ) { + const status = gl.getShaderParameter( shader, gl.COMPILE_STATUS ); + const errors = gl.getShaderInfoLog( shader ).trim(); - r *= a; g *= a; b *= a; + if ( status && errors === '' ) return ''; - } + const errorMatches = /ERROR: 0:(\d+)/.exec( errors ); + if ( errorMatches ) { - color.set( r, g, b, a ); + // --enable-privileged-webgl-extension + // console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); - if ( currentColorClear.equals( color ) === false ) { + const errorLine = parseInt( errorMatches[ 1 ] ); + return type.toUpperCase() + '\n\n' + errors + '\n\n' + handleSource( gl.getShaderSource( shader ), errorLine ); - gl.clearColor( r, g, b, a ); - currentColorClear.copy( color ); + } else { - } + return errors; - }, + } - reset: function () { + } - locked = false; + function getTexelEncodingFunction( functionName, colorSpace ) { - currentColorMask = null; - currentColorClear.set( 0, 0, 0, 1 ); + const components = getEncodingComponents( colorSpace ); + return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }'; - } + } - }; + function getToneMappingFunction( functionName, toneMapping ) { - } + let toneMappingName; - function DepthBuffer() { + switch ( toneMapping ) { - var locked = false; + case LinearToneMapping: + toneMappingName = 'Linear'; + break; - var currentDepthMask = null; - var currentDepthFunc = null; - var currentDepthClear = null; + case ReinhardToneMapping: + toneMappingName = 'Reinhard'; + break; - return { + case CineonToneMapping: + toneMappingName = 'OptimizedCineon'; + break; - setTest: function ( depthTest ) { + case ACESFilmicToneMapping: + toneMappingName = 'ACESFilmic'; + break; - if ( depthTest ) { + case CustomToneMapping: + toneMappingName = 'Custom'; + break; - enable( gl.DEPTH_TEST ); + default: + console.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping ); + toneMappingName = 'Linear'; - } else { + } - disable( gl.DEPTH_TEST ); + return 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }'; - } + } - }, + function generateExtensions( parameters ) { - setMask: function ( depthMask ) { + const chunks = [ + ( parameters.extensionDerivatives || !! parameters.envMapCubeUVHeight || parameters.bumpMap || parameters.normalMapTangentSpace || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ) ? '#extension GL_OES_standard_derivatives : enable' : '', + ( parameters.extensionFragDepth || parameters.logarithmicDepthBuffer ) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '', + ( parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ) ? '#extension GL_EXT_draw_buffers : require' : '', + ( parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission ) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : '' + ]; - if ( currentDepthMask !== depthMask && ! locked ) { + return chunks.filter( filterEmptyLine ).join( '\n' ); - gl.depthMask( depthMask ); - currentDepthMask = depthMask; + } - } + function generateDefines( defines ) { - }, + const chunks = []; - setFunc: function ( depthFunc ) { + for ( const name in defines ) { - if ( currentDepthFunc !== depthFunc ) { + const value = defines[ name ]; - if ( depthFunc ) { + if ( value === false ) continue; - switch ( depthFunc ) { + chunks.push( '#define ' + name + ' ' + value ); - case NeverDepth: + } - gl.depthFunc( gl.NEVER ); - break; + return chunks.join( '\n' ); - case AlwaysDepth: + } - gl.depthFunc( gl.ALWAYS ); - break; + function fetchAttributeLocations( gl, program ) { - case LessDepth: + const attributes = {}; - gl.depthFunc( gl.LESS ); - break; + const n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES ); - case LessEqualDepth: + for ( let i = 0; i < n; i ++ ) { - gl.depthFunc( gl.LEQUAL ); - break; + const info = gl.getActiveAttrib( program, i ); + const name = info.name; - case EqualDepth: + let locationSize = 1; + if ( info.type === gl.FLOAT_MAT2 ) locationSize = 2; + if ( info.type === gl.FLOAT_MAT3 ) locationSize = 3; + if ( info.type === gl.FLOAT_MAT4 ) locationSize = 4; - gl.depthFunc( gl.EQUAL ); - break; + // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i ); - case GreaterEqualDepth: + attributes[ name ] = { + type: info.type, + location: gl.getAttribLocation( program, name ), + locationSize: locationSize + }; - gl.depthFunc( gl.GEQUAL ); - break; + } - case GreaterDepth: - - gl.depthFunc( gl.GREATER ); - break; - - case NotEqualDepth: + return attributes; - gl.depthFunc( gl.NOTEQUAL ); - break; + } - default: + function filterEmptyLine( string ) { - gl.depthFunc( gl.LEQUAL ); + return string !== ''; - } + } - } else { + function replaceLightNums( string, parameters ) { - gl.depthFunc( gl.LEQUAL ); + const numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps; - } + return string + .replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights ) + .replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights ) + .replace( /NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps ) + .replace( /NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords ) + .replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights ) + .replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights ) + .replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights ) + .replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows ) + .replace( /NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps ) + .replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows ) + .replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows ); - currentDepthFunc = depthFunc; + } - } + function replaceClippingPlaneNums( string, parameters ) { - }, + return string + .replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes ) + .replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) ); - setLocked: function ( lock ) { + } - locked = lock; + // Resolve Includes - }, + const includePattern = /^[ \t]*#include +<([\w\d./]+)>/gm; - setClear: function ( depth ) { + function resolveIncludes( string ) { - if ( currentDepthClear !== depth ) { + return string.replace( includePattern, includeReplacer ); - gl.clearDepth( depth ); - currentDepthClear = depth; + } - } + function includeReplacer( match, include ) { - }, + const string = ShaderChunk[ include ]; - reset: function () { + if ( string === undefined ) { - locked = false; + throw new Error( 'Can not resolve #include <' + include + '>' ); - currentDepthMask = null; - currentDepthFunc = null; - currentDepthClear = null; + } - } + return resolveIncludes( string ); - }; + } - } + // Unroll Loops - function StencilBuffer() { + const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; - var locked = false; + function unrollLoops( string ) { - var currentStencilMask = null; - var currentStencilFunc = null; - var currentStencilRef = null; - var currentStencilFuncMask = null; - var currentStencilFail = null; - var currentStencilZFail = null; - var currentStencilZPass = null; - var currentStencilClear = null; + return string.replace( unrollLoopPattern, loopReplacer ); - return { + } - setTest: function ( stencilTest ) { + function loopReplacer( match, start, end, snippet ) { - if ( stencilTest ) { + let string = ''; - enable( gl.STENCIL_TEST ); + for ( let i = parseInt( start ); i < parseInt( end ); i ++ ) { - } else { + string += snippet + .replace( /\[\s*i\s*\]/g, '[ ' + i + ' ]' ) + .replace( /UNROLLED_LOOP_INDEX/g, i ); - disable( gl.STENCIL_TEST ); + } - } + return string; - }, + } - setMask: function ( stencilMask ) { + // - if ( currentStencilMask !== stencilMask && ! locked ) { + function generatePrecision( parameters ) { - gl.stencilMask( stencilMask ); - currentStencilMask = stencilMask; + let precisionstring = 'precision ' + parameters.precision + ' float;\nprecision ' + parameters.precision + ' int;'; - } + if ( parameters.precision === 'highp' ) { - }, + precisionstring += '\n#define HIGH_PRECISION'; - setFunc: function ( stencilFunc, stencilRef, stencilMask ) { + } else if ( parameters.precision === 'mediump' ) { - if ( currentStencilFunc !== stencilFunc || - currentStencilRef !== stencilRef || - currentStencilFuncMask !== stencilMask ) { + precisionstring += '\n#define MEDIUM_PRECISION'; - gl.stencilFunc( stencilFunc, stencilRef, stencilMask ); + } else if ( parameters.precision === 'lowp' ) { - currentStencilFunc = stencilFunc; - currentStencilRef = stencilRef; - currentStencilFuncMask = stencilMask; + precisionstring += '\n#define LOW_PRECISION'; - } + } - }, + return precisionstring; - setOp: function ( stencilFail, stencilZFail, stencilZPass ) { + } - if ( currentStencilFail !== stencilFail || - currentStencilZFail !== stencilZFail || - currentStencilZPass !== stencilZPass ) { + function generateShadowMapTypeDefine( parameters ) { - gl.stencilOp( stencilFail, stencilZFail, stencilZPass ); + let shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC'; - currentStencilFail = stencilFail; - currentStencilZFail = stencilZFail; - currentStencilZPass = stencilZPass; + if ( parameters.shadowMapType === PCFShadowMap ) { - } + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF'; - }, + } else if ( parameters.shadowMapType === PCFSoftShadowMap ) { - setLocked: function ( lock ) { + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT'; - locked = lock; + } else if ( parameters.shadowMapType === VSMShadowMap ) { - }, + shadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM'; - setClear: function ( stencil ) { + } - if ( currentStencilClear !== stencil ) { + return shadowMapTypeDefine; - gl.clearStencil( stencil ); - currentStencilClear = stencil; + } - } + function generateEnvMapTypeDefine( parameters ) { - }, + let envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; - reset: function () { + if ( parameters.envMap ) { - locked = false; + switch ( parameters.envMapMode ) { - currentStencilMask = null; - currentStencilFunc = null; - currentStencilRef = null; - currentStencilFuncMask = null; - currentStencilFail = null; - currentStencilZFail = null; - currentStencilZPass = null; - currentStencilClear = null; + case CubeReflectionMapping: + case CubeRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; + break; - } + case CubeUVReflectionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; + break; - }; + } } - // + return envMapTypeDefine; - var colorBuffer = new ColorBuffer(); - var depthBuffer = new DepthBuffer(); - var stencilBuffer = new StencilBuffer(); + } - var maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); - var newAttributes = new Uint8Array( maxVertexAttributes ); - var enabledAttributes = new Uint8Array( maxVertexAttributes ); - var attributeDivisors = new Uint8Array( maxVertexAttributes ); + function generateEnvMapModeDefine( parameters ) { - var capabilities = {}; + let envMapModeDefine = 'ENVMAP_MODE_REFLECTION'; - var compressedTextureFormats = null; + if ( parameters.envMap ) { - var currentBlending = null; - var currentBlendEquation = null; - var currentBlendSrc = null; - var currentBlendDst = null; - var currentBlendEquationAlpha = null; - var currentBlendSrcAlpha = null; - var currentBlendDstAlpha = null; - var currentPremultipledAlpha = false; + switch ( parameters.envMapMode ) { - var currentFlipSided = null; - var currentCullFace = null; + case CubeRefractionMapping: - var currentLineWidth = null; + envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; + break; - var currentPolygonOffsetFactor = null; - var currentPolygonOffsetUnits = null; + } - var currentScissorTest = null; + } - var maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS ); + return envMapModeDefine; - var version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] ); - var lineWidthAvailable = parseFloat( version ) >= 1.0; + } - var currentTextureSlot = null; - var currentBoundTextures = {}; + function generateEnvMapBlendingDefine( parameters ) { - var currentScissor = new Vector4(); - var currentViewport = new Vector4(); + let envMapBlendingDefine = 'ENVMAP_BLENDING_NONE'; - function createTexture( type, target, count ) { + if ( parameters.envMap ) { - var data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4. - var texture = gl.createTexture(); + switch ( parameters.combine ) { - gl.bindTexture( type, texture ); - gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); - gl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + case MultiplyOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; + break; - for ( var i = 0; i < count; i ++ ) { + case MixOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MIX'; + break; - gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data ); + case AddOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_ADD'; + break; } - return texture; - } - var emptyTextures = {}; - emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 ); - emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 ); + return envMapBlendingDefine; - // + } - function init() { + function generateCubeUVSize( parameters ) { - colorBuffer.setClear( 0, 0, 0, 1 ); - depthBuffer.setClear( 1 ); - stencilBuffer.setClear( 0 ); + const imageHeight = parameters.envMapCubeUVHeight; - enable( gl.DEPTH_TEST ); - depthBuffer.setFunc( LessEqualDepth ); + if ( imageHeight === null ) return null; - setFlipSided( false ); - setCullFace( CullFaceBack ); - enable( gl.CULL_FACE ); + const maxMip = Math.log2( imageHeight ) - 2; - enable( gl.BLEND ); - setBlending( NormalBlending ); + const texelHeight = 1.0 / imageHeight; - } + const texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) ); - function initAttributes() { + return { texelWidth, texelHeight, maxMip }; - for ( var i = 0, l = newAttributes.length; i < l; i ++ ) { + } - newAttributes[ i ] = 0; + function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { - } + // TODO Send this event to Three.js DevTools + // console.log( 'WebGLProgram', cacheKey ); - } + const gl = renderer.getContext(); - function enableAttribute( attribute ) { + const defines = parameters.defines; - newAttributes[ attribute ] = 1; + let vertexShader = parameters.vertexShader; + let fragmentShader = parameters.fragmentShader; - if ( enabledAttributes[ attribute ] === 0 ) { + const shadowMapTypeDefine = generateShadowMapTypeDefine( parameters ); + const envMapTypeDefine = generateEnvMapTypeDefine( parameters ); + const envMapModeDefine = generateEnvMapModeDefine( parameters ); + const envMapBlendingDefine = generateEnvMapBlendingDefine( parameters ); + const envMapCubeUVSize = generateCubeUVSize( parameters ); - gl.enableVertexAttribArray( attribute ); - enabledAttributes[ attribute ] = 1; + const customExtensions = parameters.isWebGL2 ? '' : generateExtensions( parameters ); - } + const customDefines = generateDefines( defines ); - if ( attributeDivisors[ attribute ] !== 0 ) { + const program = gl.createProgram(); - var extension = extensions.get( 'ANGLE_instanced_arrays' ); + let prefixVertex, prefixFragment; + let versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\n' : ''; - extension.vertexAttribDivisorANGLE( attribute, 0 ); - attributeDivisors[ attribute ] = 0; + if ( parameters.isRawShaderMaterial ) { - } + prefixVertex = [ - } + '#define SHADER_TYPE ' + parameters.shaderType, + '#define SHADER_NAME ' + parameters.shaderName, - function enableAttributeAndDivisor( attribute, meshPerAttribute ) { + customDefines - newAttributes[ attribute ] = 1; + ].filter( filterEmptyLine ).join( '\n' ); - if ( enabledAttributes[ attribute ] === 0 ) { + if ( prefixVertex.length > 0 ) { - gl.enableVertexAttribArray( attribute ); - enabledAttributes[ attribute ] = 1; + prefixVertex += '\n'; } - if ( attributeDivisors[ attribute ] !== meshPerAttribute ) { + prefixFragment = [ - var extension = extensions.get( 'ANGLE_instanced_arrays' ); + customExtensions, - extension.vertexAttribDivisorANGLE( attribute, meshPerAttribute ); - attributeDivisors[ attribute ] = meshPerAttribute; + '#define SHADER_TYPE ' + parameters.shaderType, + '#define SHADER_NAME ' + parameters.shaderName, - } + customDefines - } + ].filter( filterEmptyLine ).join( '\n' ); - function disableUnusedAttributes() { + if ( prefixFragment.length > 0 ) { - for ( var i = 0, l = enabledAttributes.length; i !== l; ++ i ) { + prefixFragment += '\n'; - if ( enabledAttributes[ i ] !== newAttributes[ i ] ) { + } - gl.disableVertexAttribArray( i ); - enabledAttributes[ i ] = 0; + } else { - } + prefixVertex = [ - } + generatePrecision( parameters ), - } + '#define SHADER_TYPE ' + parameters.shaderType, + '#define SHADER_NAME ' + parameters.shaderName, - function enable( id ) { + customDefines, - if ( capabilities[ id ] !== true ) { + parameters.instancing ? '#define USE_INSTANCING' : '', + parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '', - gl.enable( id ); - capabilities[ id ] = true; + parameters.useFog && parameters.fog ? '#define USE_FOG' : '', + parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', - } + parameters.map ? '#define USE_MAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + parameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '', + parameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '', + parameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - } + parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '', - function disable( id ) { + parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', + parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', + parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', - if ( capabilities[ id ] !== false ) { + parameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '', + parameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '', - gl.disable( id ); - capabilities[ id ] = false; + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '', + parameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '', - } + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', - } + parameters.transmission ? '#define USE_TRANSMISSION' : '', + parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', + parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', - function getCompressedTextureFormats() { + parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', + parameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '', - if ( compressedTextureFormats === null ) { + // - compressedTextureFormats = []; + parameters.mapUv ? '#define MAP_UV ' + parameters.mapUv : '', + parameters.alphaMapUv ? '#define ALPHAMAP_UV ' + parameters.alphaMapUv : '', + parameters.lightMapUv ? '#define LIGHTMAP_UV ' + parameters.lightMapUv : '', + parameters.aoMapUv ? '#define AOMAP_UV ' + parameters.aoMapUv : '', + parameters.emissiveMapUv ? '#define EMISSIVEMAP_UV ' + parameters.emissiveMapUv : '', + parameters.bumpMapUv ? '#define BUMPMAP_UV ' + parameters.bumpMapUv : '', + parameters.normalMapUv ? '#define NORMALMAP_UV ' + parameters.normalMapUv : '', + parameters.displacementMapUv ? '#define DISPLACEMENTMAP_UV ' + parameters.displacementMapUv : '', - if ( extensions.get( 'WEBGL_compressed_texture_pvrtc' ) || - extensions.get( 'WEBGL_compressed_texture_s3tc' ) || - extensions.get( 'WEBGL_compressed_texture_etc1' ) ) { + parameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '', + parameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '', - var formats = gl.getParameter( gl.COMPRESSED_TEXTURE_FORMATS ); + parameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '', - for ( var i = 0; i < formats.length; i ++ ) { + parameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '', + parameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '', + parameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '', - compressedTextureFormats.push( formats[ i ] ); + parameters.iridescenceMapUv ? '#define IRIDESCENCEMAP_UV ' + parameters.iridescenceMapUv : '', + parameters.iridescenceThicknessMapUv ? '#define IRIDESCENCE_THICKNESSMAP_UV ' + parameters.iridescenceThicknessMapUv : '', - } + parameters.sheenColorMapUv ? '#define SHEEN_COLORMAP_UV ' + parameters.sheenColorMapUv : '', + parameters.sheenRoughnessMapUv ? '#define SHEEN_ROUGHNESSMAP_UV ' + parameters.sheenRoughnessMapUv : '', - } + parameters.specularMapUv ? '#define SPECULARMAP_UV ' + parameters.specularMapUv : '', + parameters.specularColorMapUv ? '#define SPECULAR_COLORMAP_UV ' + parameters.specularColorMapUv : '', + parameters.specularIntensityMapUv ? '#define SPECULAR_INTENSITYMAP_UV ' + parameters.specularIntensityMapUv : '', - } + parameters.transmissionMapUv ? '#define TRANSMISSIONMAP_UV ' + parameters.transmissionMapUv : '', + parameters.thicknessMapUv ? '#define THICKNESSMAP_UV ' + parameters.thicknessMapUv : '', - return compressedTextureFormats; + // - } + parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', + parameters.vertexUv1s ? '#define USE_UV1' : '', + parameters.vertexUv2s ? '#define USE_UV2' : '', + parameters.vertexUv3s ? '#define USE_UV3' : '', - function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) { + parameters.pointsUvs ? '#define USE_POINTS_UV' : '', - if ( blending !== NoBlending ) { + parameters.flatShading ? '#define FLAT_SHADED' : '', - enable( gl.BLEND ); + parameters.skinning ? '#define USE_SKINNING' : '', - } else { + parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', + parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', + ( parameters.morphColors && parameters.isWebGL2 ) ? '#define USE_MORPHCOLORS' : '', + ( parameters.morphTargetsCount > 0 && parameters.isWebGL2 ) ? '#define MORPHTARGETS_TEXTURE' : '', + ( parameters.morphTargetsCount > 0 && parameters.isWebGL2 ) ? '#define MORPHTARGETS_TEXTURE_STRIDE ' + parameters.morphTextureStride : '', + ( parameters.morphTargetsCount > 0 && parameters.isWebGL2 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '', + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', - disable( gl.BLEND ); + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', - } + parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', - if ( ( blending !== CustomBlending ) && ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) ) { + parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '', - if ( blending === AdditiveBlending ) { + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', - if ( premultipliedAlpha ) { + 'uniform mat4 modelMatrix;', + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;', + 'uniform vec3 cameraPosition;', + 'uniform bool isOrthographic;', - gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); - gl.blendFuncSeparate( gl.ONE, gl.ONE, gl.ONE, gl.ONE ); + '#ifdef USE_INSTANCING', - } else { + ' attribute mat4 instanceMatrix;', - gl.blendEquation( gl.FUNC_ADD ); - gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); + '#endif', - } + '#ifdef USE_INSTANCING_COLOR', - } else if ( blending === SubtractiveBlending ) { + ' attribute vec3 instanceColor;', - if ( premultipliedAlpha ) { + '#endif', - gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); - gl.blendFuncSeparate( gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA ); + 'attribute vec3 position;', + 'attribute vec3 normal;', + 'attribute vec2 uv;', - } else { + '#ifdef USE_UV1', - gl.blendEquation( gl.FUNC_ADD ); - gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR ); + ' attribute vec2 uv1;', - } + '#endif', - } else if ( blending === MultiplyBlending ) { + '#ifdef USE_UV2', - if ( premultipliedAlpha ) { + ' attribute vec2 uv2;', - gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); - gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); + '#endif', - } else { + '#ifdef USE_UV3', - gl.blendEquation( gl.FUNC_ADD ); - gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); + ' attribute vec2 uv3;', - } + '#endif', - } else { + '#ifdef USE_TANGENT', - if ( premultipliedAlpha ) { + ' attribute vec4 tangent;', - gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); - gl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + '#endif', - } else { + '#if defined( USE_COLOR_ALPHA )', - gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); - gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + ' attribute vec4 color;', - } + '#elif defined( USE_COLOR )', - } + ' attribute vec3 color;', - currentBlending = blending; - currentPremultipledAlpha = premultipliedAlpha; + '#endif', - } + '#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )', - if ( blending === CustomBlending ) { + ' attribute vec3 morphTarget0;', + ' attribute vec3 morphTarget1;', + ' attribute vec3 morphTarget2;', + ' attribute vec3 morphTarget3;', - blendEquationAlpha = blendEquationAlpha || blendEquation; - blendSrcAlpha = blendSrcAlpha || blendSrc; - blendDstAlpha = blendDstAlpha || blendDst; + ' #ifdef USE_MORPHNORMALS', - if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) { + ' attribute vec3 morphNormal0;', + ' attribute vec3 morphNormal1;', + ' attribute vec3 morphNormal2;', + ' attribute vec3 morphNormal3;', - gl.blendEquationSeparate( paramThreeToGL( blendEquation ), paramThreeToGL( blendEquationAlpha ) ); + ' #else', - currentBlendEquation = blendEquation; - currentBlendEquationAlpha = blendEquationAlpha; + ' attribute vec3 morphTarget4;', + ' attribute vec3 morphTarget5;', + ' attribute vec3 morphTarget6;', + ' attribute vec3 morphTarget7;', - } + ' #endif', - if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) { + '#endif', - gl.blendFuncSeparate( paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL( blendDstAlpha ) ); + '#ifdef USE_SKINNING', - currentBlendSrc = blendSrc; - currentBlendDst = blendDst; - currentBlendSrcAlpha = blendSrcAlpha; - currentBlendDstAlpha = blendDstAlpha; + ' attribute vec4 skinIndex;', + ' attribute vec4 skinWeight;', - } + '#endif', - } else { + '\n' - currentBlendEquation = null; - currentBlendSrc = null; - currentBlendDst = null; - currentBlendEquationAlpha = null; - currentBlendSrcAlpha = null; - currentBlendDstAlpha = null; + ].filter( filterEmptyLine ).join( '\n' ); - } + prefixFragment = [ - } + customExtensions, - function setMaterial( material ) { + generatePrecision( parameters ), - material.side === DoubleSide - ? disable( gl.CULL_FACE ) - : enable( gl.CULL_FACE ); + '#define SHADER_TYPE ' + parameters.shaderType, + '#define SHADER_NAME ' + parameters.shaderName, - setFlipSided( material.side === BackSide ); + customDefines, - material.transparent === true - ? setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ) - : setBlending( NoBlending ); + parameters.useFog && parameters.fog ? '#define USE_FOG' : '', + parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', - depthBuffer.setFunc( material.depthFunc ); - depthBuffer.setTest( material.depthTest ); - depthBuffer.setMask( material.depthWrite ); - colorBuffer.setMask( material.colorWrite ); + parameters.map ? '#define USE_MAP' : '', + parameters.matcap ? '#define USE_MATCAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapTypeDefine : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.envMap ? '#define ' + envMapBlendingDefine : '', + envMapCubeUVSize ? '#define CUBEUV_TEXEL_WIDTH ' + envMapCubeUVSize.texelWidth : '', + envMapCubeUVSize ? '#define CUBEUV_TEXEL_HEIGHT ' + envMapCubeUVSize.texelHeight : '', + envMapCubeUVSize ? '#define CUBEUV_MAX_MIP ' + envMapCubeUVSize.maxMip + '.0' : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + parameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '', + parameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + parameters.anisotropy ? '#define USE_ANISOTROPY' : '', + parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '', - } + parameters.clearcoat ? '#define USE_CLEARCOAT' : '', + parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', + parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', + parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', - // + parameters.iridescence ? '#define USE_IRIDESCENCE' : '', + parameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '', + parameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '', - function setFlipSided( flipSided ) { + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '', + parameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '', - if ( currentFlipSided !== flipSided ) { + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', - if ( flipSided ) { + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.alphaTest ? '#define USE_ALPHATEST' : '', - gl.frontFace( gl.CW ); + parameters.sheen ? '#define USE_SHEEN' : '', + parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', + parameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '', - } else { + parameters.transmission ? '#define USE_TRANSMISSION' : '', + parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', + parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', - gl.frontFace( gl.CCW ); + parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', + parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', + parameters.vertexUv1s ? '#define USE_UV1' : '', + parameters.vertexUv2s ? '#define USE_UV2' : '', + parameters.vertexUv3s ? '#define USE_UV3' : '', - } + parameters.pointsUvs ? '#define USE_POINTS_UV' : '', - currentFlipSided = flipSided; + parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', - } + parameters.flatShading ? '#define FLAT_SHADED' : '', + + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', + + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + + parameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', + + parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '', + + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + + 'uniform mat4 viewMatrix;', + 'uniform vec3 cameraPosition;', + 'uniform bool isOrthographic;', + + ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', + ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below + ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', + + parameters.dithering ? '#define DITHERING' : '', + parameters.opaque ? '#define OPAQUE' : '', + + ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below + getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ), + + parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); } - function setCullFace( cullFace ) { + vertexShader = resolveIncludes( vertexShader ); + vertexShader = replaceLightNums( vertexShader, parameters ); + vertexShader = replaceClippingPlaneNums( vertexShader, parameters ); - if ( cullFace !== CullFaceNone ) { + fragmentShader = resolveIncludes( fragmentShader ); + fragmentShader = replaceLightNums( fragmentShader, parameters ); + fragmentShader = replaceClippingPlaneNums( fragmentShader, parameters ); - enable( gl.CULL_FACE ); + vertexShader = unrollLoops( vertexShader ); + fragmentShader = unrollLoops( fragmentShader ); - if ( cullFace !== currentCullFace ) { + if ( parameters.isWebGL2 && parameters.isRawShaderMaterial !== true ) { - if ( cullFace === CullFaceBack ) { + // GLSL 3.0 conversion for built-in materials and ShaderMaterial - gl.cullFace( gl.BACK ); + versionString = '#version 300 es\n'; - } else if ( cullFace === CullFaceFront ) { + prefixVertex = [ + 'precision mediump sampler2DArray;', + '#define attribute in', + '#define varying out', + '#define texture2D texture' + ].join( '\n' ) + '\n' + prefixVertex; - gl.cullFace( gl.FRONT ); + prefixFragment = [ + '#define varying in', + ( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;', + ( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor', + '#define gl_FragDepthEXT gl_FragDepth', + '#define texture2D texture', + '#define textureCube texture', + '#define texture2DProj textureProj', + '#define texture2DLodEXT textureLod', + '#define texture2DProjLodEXT textureProjLod', + '#define textureCubeLodEXT textureLod', + '#define texture2DGradEXT textureGrad', + '#define texture2DProjGradEXT textureProjGrad', + '#define textureCubeGradEXT textureGrad' + ].join( '\n' ) + '\n' + prefixFragment; + + } + + const vertexGlsl = versionString + prefixVertex + vertexShader; + const fragmentGlsl = versionString + prefixFragment + fragmentShader; - } else { + // console.log( '*VERTEX*', vertexGlsl ); + // console.log( '*FRAGMENT*', fragmentGlsl ); - gl.cullFace( gl.FRONT_AND_BACK ); + const glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl ); + const glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl ); - } + gl.attachShader( program, glVertexShader ); + gl.attachShader( program, glFragmentShader ); - } + // Force a particular attribute to index 0. - } else { + if ( parameters.index0AttributeName !== undefined ) { - disable( gl.CULL_FACE ); + gl.bindAttribLocation( program, 0, parameters.index0AttributeName ); - } + } else if ( parameters.morphTargets === true ) { - currentCullFace = cullFace; + // programs with morphTargets displace position out of attribute 0 + gl.bindAttribLocation( program, 0, 'position' ); } - function setLineWidth( width ) { + gl.linkProgram( program ); - if ( width !== currentLineWidth ) { + // check for link errors + if ( renderer.debug.checkShaderErrors ) { - if ( lineWidthAvailable ) gl.lineWidth( width ); + const programLog = gl.getProgramInfoLog( program ).trim(); + const vertexLog = gl.getShaderInfoLog( glVertexShader ).trim(); + const fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim(); - currentLineWidth = width; + let runnable = true; + let haveDiagnostics = true; - } + if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) { - } + runnable = false; - function setPolygonOffset( polygonOffset, factor, units ) { + if ( typeof renderer.debug.onShaderError === 'function' ) { - if ( polygonOffset ) { + renderer.debug.onShaderError( gl, program, glVertexShader, glFragmentShader ); - enable( gl.POLYGON_OFFSET_FILL ); + } else { - if ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) { + // default error reporting - gl.polygonOffset( factor, units ); + const vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' ); + const fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' ); - currentPolygonOffsetFactor = factor; - currentPolygonOffsetUnits = units; + console.error( + 'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' + + 'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\n\n' + + 'Program Info Log: ' + programLog + '\n' + + vertexErrors + '\n' + + fragmentErrors + ); } - } else { + } else if ( programLog !== '' ) { - disable( gl.POLYGON_OFFSET_FILL ); + console.warn( 'THREE.WebGLProgram: Program Info Log:', programLog ); + + } else if ( vertexLog === '' || fragmentLog === '' ) { + + haveDiagnostics = false; } - } + if ( haveDiagnostics ) { - function getScissorTest() { + this.diagnostics = { - return currentScissorTest; + runnable: runnable, - } + programLog: programLog, - function setScissorTest( scissorTest ) { + vertexShader: { - currentScissorTest = scissorTest; + log: vertexLog, + prefix: prefixVertex - if ( scissorTest ) { + }, - enable( gl.SCISSOR_TEST ); + fragmentShader: { - } else { + log: fragmentLog, + prefix: prefixFragment - disable( gl.SCISSOR_TEST ); + } + + }; } } - // texture + // Clean up - function activeTexture( webglSlot ) { + // Crashes in iOS9 and iOS10. #18402 + // gl.detachShader( program, glVertexShader ); + // gl.detachShader( program, glFragmentShader ); - if ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1; + gl.deleteShader( glVertexShader ); + gl.deleteShader( glFragmentShader ); - if ( currentTextureSlot !== webglSlot ) { + // set up caching for uniform locations - gl.activeTexture( webglSlot ); - currentTextureSlot = webglSlot; + let cachedUniforms; + + this.getUniforms = function () { + + if ( cachedUniforms === undefined ) { + + cachedUniforms = new WebGLUniforms( gl, program ); } - } + return cachedUniforms; + + }; - function bindTexture( webglType, webglTexture ) { + // set up caching for attribute locations + + let cachedAttributes; - if ( currentTextureSlot === null ) { + this.getAttributes = function () { + + if ( cachedAttributes === undefined ) { - activeTexture(); + cachedAttributes = fetchAttributeLocations( gl, program ); } - var boundTexture = currentBoundTextures[ currentTextureSlot ]; + return cachedAttributes; - if ( boundTexture === undefined ) { + }; - boundTexture = { type: undefined, texture: undefined }; - currentBoundTextures[ currentTextureSlot ] = boundTexture; + // free resource - } + this.destroy = function () { - if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) { + bindingStates.releaseStatesOfProgram( this ); - gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] ); + gl.deleteProgram( program ); + this.program = undefined; - boundTexture.type = webglType; - boundTexture.texture = webglTexture; + }; - } + // - } + this.type = parameters.shaderType; + this.name = parameters.shaderName; + this.id = programIdCount ++; + this.cacheKey = cacheKey; + this.usedTimes = 1; + this.program = program; + this.vertexShader = glVertexShader; + this.fragmentShader = glFragmentShader; - function compressedTexImage2D() { + return this; - try { + } - gl.compressedTexImage2D.apply( gl, arguments ); + let _id = 0; - } catch ( error ) { + class WebGLShaderCache { - console.error( 'THREE.WebGLState:', error ); + constructor() { - } + this.shaderCache = new Map(); + this.materialCache = new Map(); } - function texImage2D() { + update( material ) { - try { + const vertexShader = material.vertexShader; + const fragmentShader = material.fragmentShader; - gl.texImage2D.apply( gl, arguments ); + const vertexShaderStage = this._getShaderStage( vertexShader ); + const fragmentShaderStage = this._getShaderStage( fragmentShader ); - } catch ( error ) { + const materialShaders = this._getShaderCacheForMaterial( material ); - console.error( 'THREE.WebGLState:', error ); + if ( materialShaders.has( vertexShaderStage ) === false ) { + + materialShaders.add( vertexShaderStage ); + vertexShaderStage.usedTimes ++; } + if ( materialShaders.has( fragmentShaderStage ) === false ) { + + materialShaders.add( fragmentShaderStage ); + fragmentShaderStage.usedTimes ++; + + } + + return this; + } - // + remove( material ) { - function scissor( scissor ) { + const materialShaders = this.materialCache.get( material ); - if ( currentScissor.equals( scissor ) === false ) { + for ( const shaderStage of materialShaders ) { - gl.scissor( scissor.x, scissor.y, scissor.z, scissor.w ); - currentScissor.copy( scissor ); + shaderStage.usedTimes --; + + if ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage.code ); } + this.materialCache.delete( material ); + + return this; + } - function viewport( viewport ) { + getVertexShaderID( material ) { - if ( currentViewport.equals( viewport ) === false ) { + return this._getShaderStage( material.vertexShader ).id; - gl.viewport( viewport.x, viewport.y, viewport.z, viewport.w ); - currentViewport.copy( viewport ); + } - } + getFragmentShaderID( material ) { + + return this._getShaderStage( material.fragmentShader ).id; } - // + dispose() { - function reset() { + this.shaderCache.clear(); + this.materialCache.clear(); - for ( var i = 0; i < enabledAttributes.length; i ++ ) { + } - if ( enabledAttributes[ i ] === 1 ) { + _getShaderCacheForMaterial( material ) { - gl.disableVertexAttribArray( i ); - enabledAttributes[ i ] = 0; + const cache = this.materialCache; + let set = cache.get( material ); - } + if ( set === undefined ) { + + set = new Set(); + cache.set( material, set ); } - capabilities = {}; + return set; - compressedTextureFormats = null; + } - currentTextureSlot = null; - currentBoundTextures = {}; + _getShaderStage( code ) { - currentBlending = null; + const cache = this.shaderCache; + let stage = cache.get( code ); - currentFlipSided = null; - currentCullFace = null; + if ( stage === undefined ) { - colorBuffer.reset(); - depthBuffer.reset(); - stencilBuffer.reset(); + stage = new WebGLShaderStage( code ); + cache.set( code, stage ); + + } + + return stage; } - return { + } - buffers: { - color: colorBuffer, - depth: depthBuffer, - stencil: stencilBuffer - }, + class WebGLShaderStage { - init: init, - initAttributes: initAttributes, - enableAttribute: enableAttribute, - enableAttributeAndDivisor: enableAttributeAndDivisor, - disableUnusedAttributes: disableUnusedAttributes, - enable: enable, - disable: disable, - getCompressedTextureFormats: getCompressedTextureFormats, + constructor( code ) { - setBlending: setBlending, - setMaterial: setMaterial, + this.id = _id ++; - setFlipSided: setFlipSided, - setCullFace: setCullFace, + this.code = code; + this.usedTimes = 0; - setLineWidth: setLineWidth, - setPolygonOffset: setPolygonOffset, + } - getScissorTest: getScissorTest, - setScissorTest: setScissorTest, + } - activeTexture: activeTexture, - bindTexture: bindTexture, - compressedTexImage2D: compressedTexImage2D, - texImage2D: texImage2D, + function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) { - scissor: scissor, - viewport: viewport, + const _programLayers = new Layers(); + const _customShaders = new WebGLShaderCache(); + const programs = []; - reset: reset + const IS_WEBGL2 = capabilities.isWebGL2; + const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer; + const SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures; + + let precision = capabilities.precision; + const shaderIDs = { + MeshDepthMaterial: 'depth', + MeshDistanceMaterial: 'distanceRGBA', + MeshNormalMaterial: 'normal', + MeshBasicMaterial: 'basic', + MeshLambertMaterial: 'lambert', + MeshPhongMaterial: 'phong', + MeshToonMaterial: 'toon', + MeshStandardMaterial: 'physical', + MeshPhysicalMaterial: 'physical', + MeshMatcapMaterial: 'matcap', + LineBasicMaterial: 'basic', + LineDashedMaterial: 'dashed', + PointsMaterial: 'points', + ShadowMaterial: 'shadow', + SpriteMaterial: 'sprite' }; - } + function getChannel( value ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( value === 0 ) return 'uv'; - function WebGLCapabilities( gl, extensions, parameters ) { + return `uv${ value }`; - var maxAnisotropy; + } - function getMaxAnisotropy() { + function getParameters( material, lights, shadows, scene, object ) { - if ( maxAnisotropy !== undefined ) return maxAnisotropy; + const fog = scene.fog; + const geometry = object.geometry; + const environment = material.isMeshStandardMaterial ? scene.environment : null; - var extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment ); + const envMapCubeUVHeight = ( !! envMap ) && ( envMap.mapping === CubeUVReflectionMapping ) ? envMap.image.height : null; - if ( extension !== null ) { + const shaderID = shaderIDs[ material.type ]; - maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ); + // heuristics to create shader parameters according to lights in the scene + // (not to blow over maxLights budget) - } else { + if ( material.precision !== null ) { - maxAnisotropy = 0; + precision = capabilities.getMaxPrecision( material.precision ); + + if ( precision !== material.precision ) { + + console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' ); + + } } - return maxAnisotropy; + // - } + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; - function getMaxPrecision( precision ) { + let morphTextureStride = 0; - if ( precision === 'highp' ) { + if ( geometry.morphAttributes.position !== undefined ) morphTextureStride = 1; + if ( geometry.morphAttributes.normal !== undefined ) morphTextureStride = 2; + if ( geometry.morphAttributes.color !== undefined ) morphTextureStride = 3; - if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 && - gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) { + // - return 'highp'; + let vertexShader, fragmentShader; + let customVertexShaderID, customFragmentShaderID; - } + if ( shaderID ) { - precision = 'mediump'; + const shader = ShaderLib[ shaderID ]; - } + vertexShader = shader.vertexShader; + fragmentShader = shader.fragmentShader; - if ( precision === 'mediump' ) { + } else { - if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 && - gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) { + vertexShader = material.vertexShader; + fragmentShader = material.fragmentShader; - return 'mediump'; + _customShaders.update( material ); - } + customVertexShaderID = _customShaders.getVertexShaderID( material ); + customFragmentShaderID = _customShaders.getFragmentShaderID( material ); } - return 'lowp'; + const currentRenderTarget = renderer.getRenderTarget(); - } + const IS_INSTANCEDMESH = object.isInstancedMesh === true; - var precision = parameters.precision !== undefined ? parameters.precision : 'highp'; - var maxPrecision = getMaxPrecision( precision ); + const HAS_MAP = !! material.map; + const HAS_MATCAP = !! material.matcap; + const HAS_ENVMAP = !! envMap; + const HAS_AOMAP = !! material.aoMap; + const HAS_LIGHTMAP = !! material.lightMap; + const HAS_BUMPMAP = !! material.bumpMap; + const HAS_NORMALMAP = !! material.normalMap; + const HAS_DISPLACEMENTMAP = !! material.displacementMap; + const HAS_EMISSIVEMAP = !! material.emissiveMap; - if ( maxPrecision !== precision ) { + const HAS_METALNESSMAP = !! material.metalnessMap; + const HAS_ROUGHNESSMAP = !! material.roughnessMap; - console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' ); - precision = maxPrecision; + const HAS_ANISOTROPY = material.anisotropy > 0; + const HAS_CLEARCOAT = material.clearcoat > 0; + const HAS_IRIDESCENCE = material.iridescence > 0; + const HAS_SHEEN = material.sheen > 0; + const HAS_TRANSMISSION = material.transmission > 0; - } + const HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap; - var logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true && !! extensions.get( 'EXT_frag_depth' ); + const HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap; + const HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap; + const HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap; - var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); - var maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ); - var maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE ); - var maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE ); + const HAS_IRIDESCENCEMAP = HAS_IRIDESCENCE && !! material.iridescenceMap; + const HAS_IRIDESCENCE_THICKNESSMAP = HAS_IRIDESCENCE && !! material.iridescenceThicknessMap; - var maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); - var maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS ); - var maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS ); - var maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS ); + const HAS_SHEEN_COLORMAP = HAS_SHEEN && !! material.sheenColorMap; + const HAS_SHEEN_ROUGHNESSMAP = HAS_SHEEN && !! material.sheenRoughnessMap; - var vertexTextures = maxVertexTextures > 0; - var floatFragmentTextures = !! extensions.get( 'OES_texture_float' ); - var floatVertexTextures = vertexTextures && floatFragmentTextures; + const HAS_SPECULARMAP = !! material.specularMap; + const HAS_SPECULAR_COLORMAP = !! material.specularColorMap; + const HAS_SPECULAR_INTENSITYMAP = !! material.specularIntensityMap; - return { + const HAS_TRANSMISSIONMAP = HAS_TRANSMISSION && !! material.transmissionMap; + const HAS_THICKNESSMAP = HAS_TRANSMISSION && !! material.thicknessMap; - getMaxAnisotropy: getMaxAnisotropy, - getMaxPrecision: getMaxPrecision, + const HAS_GRADIENTMAP = !! material.gradientMap; - precision: precision, - logarithmicDepthBuffer: logarithmicDepthBuffer, + const HAS_ALPHAMAP = !! material.alphaMap; - maxTextures: maxTextures, - maxVertexTextures: maxVertexTextures, - maxTextureSize: maxTextureSize, - maxCubemapSize: maxCubemapSize, + const HAS_ALPHATEST = material.alphaTest > 0; - maxAttributes: maxAttributes, - maxVertexUniforms: maxVertexUniforms, - maxVaryings: maxVaryings, - maxFragmentUniforms: maxFragmentUniforms, + const HAS_EXTENSIONS = !! material.extensions; - vertexTextures: vertexTextures, - floatFragmentTextures: floatFragmentTextures, - floatVertexTextures: floatVertexTextures + const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1; + const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2; + const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3; - }; + const parameters = { - } + isWebGL2: IS_WEBGL2, - /** - * @author mrdoob / http://mrdoob.com/ - */ + shaderID: shaderID, + shaderType: material.type, + shaderName: material.name, - function ArrayCamera( array ) { + vertexShader: vertexShader, + fragmentShader: fragmentShader, + defines: material.defines, - PerspectiveCamera.call( this ); + customVertexShaderID: customVertexShaderID, + customFragmentShaderID: customFragmentShaderID, - this.cameras = array || []; + isRawShaderMaterial: material.isRawShaderMaterial === true, + glslVersion: material.glslVersion, - } + precision: precision, - ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototype ), { + instancing: IS_INSTANCEDMESH, + instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null, - constructor: ArrayCamera, + supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES, + outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ), - isArrayCamera: true + map: HAS_MAP, + matcap: HAS_MATCAP, + envMap: HAS_ENVMAP, + envMapMode: HAS_ENVMAP && envMap.mapping, + envMapCubeUVHeight: envMapCubeUVHeight, + aoMap: HAS_AOMAP, + lightMap: HAS_LIGHTMAP, + bumpMap: HAS_BUMPMAP, + normalMap: HAS_NORMALMAP, + displacementMap: SUPPORTS_VERTEX_TEXTURES && HAS_DISPLACEMENTMAP, + emissiveMap: HAS_EMISSIVEMAP, - } ); + normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap, + normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap, - /** - * @author mrdoob / http://mrdoob.com/ - */ + metalnessMap: HAS_METALNESSMAP, + roughnessMap: HAS_ROUGHNESSMAP, - function WebVRManager( renderer ) { + anisotropy: HAS_ANISOTROPY, + anisotropyMap: HAS_ANISOTROPYMAP, - var scope = this; + clearcoat: HAS_CLEARCOAT, + clearcoatMap: HAS_CLEARCOATMAP, + clearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP, + clearcoatRoughnessMap: HAS_CLEARCOAT_ROUGHNESSMAP, - var device = null; - var frameData = null; + iridescence: HAS_IRIDESCENCE, + iridescenceMap: HAS_IRIDESCENCEMAP, + iridescenceThicknessMap: HAS_IRIDESCENCE_THICKNESSMAP, - if ( 'VRFrameData' in window ) { + sheen: HAS_SHEEN, + sheenColorMap: HAS_SHEEN_COLORMAP, + sheenRoughnessMap: HAS_SHEEN_ROUGHNESSMAP, - frameData = new window.VRFrameData(); + specularMap: HAS_SPECULARMAP, + specularColorMap: HAS_SPECULAR_COLORMAP, + specularIntensityMap: HAS_SPECULAR_INTENSITYMAP, - } + transmission: HAS_TRANSMISSION, + transmissionMap: HAS_TRANSMISSIONMAP, + thicknessMap: HAS_THICKNESSMAP, - var matrixWorldInverse = new Matrix4(); + gradientMap: HAS_GRADIENTMAP, - var standingMatrix = new Matrix4(); - var standingMatrixInverse = new Matrix4(); + opaque: material.transparent === false && material.blending === NormalBlending, - var cameraL = new PerspectiveCamera(); - cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 ); - cameraL.layers.enable( 1 ); + alphaMap: HAS_ALPHAMAP, + alphaTest: HAS_ALPHATEST, - var cameraR = new PerspectiveCamera(); - cameraR.bounds = new Vector4( 0.5, 0.0, 0.5, 1.0 ); - cameraR.layers.enable( 2 ); + combine: material.combine, - var cameraVR = new ArrayCamera( [ cameraL, cameraR ] ); - cameraVR.layers.enable( 1 ); - cameraVR.layers.enable( 2 ); + // - // + mapUv: HAS_MAP && getChannel( material.map.channel ), + aoMapUv: HAS_AOMAP && getChannel( material.aoMap.channel ), + lightMapUv: HAS_LIGHTMAP && getChannel( material.lightMap.channel ), + bumpMapUv: HAS_BUMPMAP && getChannel( material.bumpMap.channel ), + normalMapUv: HAS_NORMALMAP && getChannel( material.normalMap.channel ), + displacementMapUv: HAS_DISPLACEMENTMAP && getChannel( material.displacementMap.channel ), + emissiveMapUv: HAS_EMISSIVEMAP && getChannel( material.emissiveMap.channel ), - var currentSize, currentPixelRatio; + metalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ), + roughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ), - function onVRDisplayPresentChange() { + anisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ), - if ( device.isPresenting ) { + clearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ), + clearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ), + clearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ), - var eyeParameters = device.getEyeParameters( 'left' ); - var renderWidth = eyeParameters.renderWidth; - var renderHeight = eyeParameters.renderHeight; + iridescenceMapUv: HAS_IRIDESCENCEMAP && getChannel( material.iridescenceMap.channel ), + iridescenceThicknessMapUv: HAS_IRIDESCENCE_THICKNESSMAP && getChannel( material.iridescenceThicknessMap.channel ), - currentPixelRatio = renderer.getPixelRatio(); - currentSize = renderer.getSize(); + sheenColorMapUv: HAS_SHEEN_COLORMAP && getChannel( material.sheenColorMap.channel ), + sheenRoughnessMapUv: HAS_SHEEN_ROUGHNESSMAP && getChannel( material.sheenRoughnessMap.channel ), - renderer.setDrawingBufferSize( renderWidth * 2, renderHeight, 1 ); + specularMapUv: HAS_SPECULARMAP && getChannel( material.specularMap.channel ), + specularColorMapUv: HAS_SPECULAR_COLORMAP && getChannel( material.specularColorMap.channel ), + specularIntensityMapUv: HAS_SPECULAR_INTENSITYMAP && getChannel( material.specularIntensityMap.channel ), - } else if ( scope.enabled ) { + transmissionMapUv: HAS_TRANSMISSIONMAP && getChannel( material.transmissionMap.channel ), + thicknessMapUv: HAS_THICKNESSMAP && getChannel( material.thicknessMap.channel ), - renderer.setDrawingBufferSize( currentSize.width, currentSize.height, currentPixelRatio ); + alphaMapUv: HAS_ALPHAMAP && getChannel( material.alphaMap.channel ), - } + // - } + vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ), + vertexColors: material.vertexColors, + vertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4, + vertexUv1s: HAS_ATTRIBUTE_UV1, + vertexUv2s: HAS_ATTRIBUTE_UV2, + vertexUv3s: HAS_ATTRIBUTE_UV3, - window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false ); + pointsUvs: object.isPoints === true && !! geometry.attributes.uv && ( HAS_MAP || HAS_ALPHAMAP ), - // + fog: !! fog, + useFog: material.fog === true, + fogExp2: ( fog && fog.isFogExp2 ), - this.enabled = false; - this.standing = false; + flatShading: material.flatShading === true, - this.getDevice = function () { + sizeAttenuation: material.sizeAttenuation === true, + logarithmicDepthBuffer: logarithmicDepthBuffer, - return device; + skinning: object.isSkinnedMesh === true, - }; + morphTargets: geometry.morphAttributes.position !== undefined, + morphNormals: geometry.morphAttributes.normal !== undefined, + morphColors: geometry.morphAttributes.color !== undefined, + morphTargetsCount: morphTargetsCount, + morphTextureStride: morphTextureStride, - this.setDevice = function ( value ) { + numDirLights: lights.directional.length, + numPointLights: lights.point.length, + numSpotLights: lights.spot.length, + numSpotLightMaps: lights.spotLightMap.length, + numRectAreaLights: lights.rectArea.length, + numHemiLights: lights.hemi.length, - if ( value !== undefined ) device = value; + numDirLightShadows: lights.directionalShadowMap.length, + numPointLightShadows: lights.pointShadowMap.length, + numSpotLightShadows: lights.spotShadowMap.length, + numSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps, - }; + numClippingPlanes: clipping.numPlanes, + numClipIntersection: clipping.numIntersection, - this.getCamera = function ( camera ) { + dithering: material.dithering, - if ( device === null ) return camera; + shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, + shadowMapType: renderer.shadowMap.type, - device.depthNear = camera.near; - device.depthFar = camera.far; + toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, + useLegacyLights: renderer.useLegacyLights, - device.getFrameData( frameData ); + premultipliedAlpha: material.premultipliedAlpha, - // + doubleSided: material.side === DoubleSide, + flipSided: material.side === BackSide, - var pose = frameData.pose; + useDepthPacking: material.depthPacking >= 0, + depthPacking: material.depthPacking || 0, - if ( pose.position !== null ) { + index0AttributeName: material.index0AttributeName, - camera.position.fromArray( pose.position ); + extensionDerivatives: HAS_EXTENSIONS && material.extensions.derivatives === true, + extensionFragDepth: HAS_EXTENSIONS && material.extensions.fragDepth === true, + extensionDrawBuffers: HAS_EXTENSIONS && material.extensions.drawBuffers === true, + extensionShaderTextureLOD: HAS_EXTENSIONS && material.extensions.shaderTextureLOD === true, - } else { + rendererExtensionFragDepth: IS_WEBGL2 || extensions.has( 'EXT_frag_depth' ), + rendererExtensionDrawBuffers: IS_WEBGL2 || extensions.has( 'WEBGL_draw_buffers' ), + rendererExtensionShaderTextureLod: IS_WEBGL2 || extensions.has( 'EXT_shader_texture_lod' ), - camera.position.set( 0, 0, 0 ); + customProgramCacheKey: material.customProgramCacheKey() - } + }; - if ( pose.orientation !== null ) { + return parameters; - camera.quaternion.fromArray( pose.orientation ); + } - } + function getProgramCacheKey( parameters ) { - camera.updateMatrixWorld(); + const array = []; - var stageParameters = device.stageParameters; + if ( parameters.shaderID ) { - if ( this.standing && stageParameters ) { + array.push( parameters.shaderID ); - standingMatrix.fromArray( stageParameters.sittingToStandingTransform ); - standingMatrixInverse.getInverse( standingMatrix ); + } else { - camera.matrixWorld.multiply( standingMatrix ); - camera.matrixWorldInverse.multiply( standingMatrixInverse ); + array.push( parameters.customVertexShaderID ); + array.push( parameters.customFragmentShaderID ); } - if ( device.isPresenting === false ) return camera; + if ( parameters.defines !== undefined ) { - // + for ( const name in parameters.defines ) { + + array.push( name ); + array.push( parameters.defines[ name ] ); - cameraVR.matrixWorld.copy( camera.matrixWorld ); - cameraVR.matrixWorldInverse.copy( camera.matrixWorldInverse ); + } - cameraL.matrixWorldInverse.fromArray( frameData.leftViewMatrix ); - cameraR.matrixWorldInverse.fromArray( frameData.rightViewMatrix ); + } - if ( this.standing && stageParameters ) { + if ( parameters.isRawShaderMaterial === false ) { - cameraL.matrixWorldInverse.multiply( standingMatrixInverse ); - cameraR.matrixWorldInverse.multiply( standingMatrixInverse ); + getProgramCacheKeyParameters( array, parameters ); + getProgramCacheKeyBooleans( array, parameters ); + array.push( renderer.outputColorSpace ); } - var parent = camera.parent; + array.push( parameters.customProgramCacheKey ); - if ( parent !== null ) { + return array.join(); - matrixWorldInverse.getInverse( parent.matrixWorld ); + } - cameraL.matrixWorldInverse.multiply( matrixWorldInverse ); - cameraR.matrixWorldInverse.multiply( matrixWorldInverse ); + function getProgramCacheKeyParameters( array, parameters ) { + + array.push( parameters.precision ); + array.push( parameters.outputColorSpace ); + array.push( parameters.envMapMode ); + array.push( parameters.envMapCubeUVHeight ); + array.push( parameters.mapUv ); + array.push( parameters.alphaMapUv ); + array.push( parameters.lightMapUv ); + array.push( parameters.aoMapUv ); + array.push( parameters.bumpMapUv ); + array.push( parameters.normalMapUv ); + array.push( parameters.displacementMapUv ); + array.push( parameters.emissiveMapUv ); + array.push( parameters.metalnessMapUv ); + array.push( parameters.roughnessMapUv ); + array.push( parameters.anisotropyMapUv ); + array.push( parameters.clearcoatMapUv ); + array.push( parameters.clearcoatNormalMapUv ); + array.push( parameters.clearcoatRoughnessMapUv ); + array.push( parameters.iridescenceMapUv ); + array.push( parameters.iridescenceThicknessMapUv ); + array.push( parameters.sheenColorMapUv ); + array.push( parameters.sheenRoughnessMapUv ); + array.push( parameters.specularMapUv ); + array.push( parameters.specularColorMapUv ); + array.push( parameters.specularIntensityMapUv ); + array.push( parameters.transmissionMapUv ); + array.push( parameters.thicknessMapUv ); + array.push( parameters.combine ); + array.push( parameters.fogExp2 ); + array.push( parameters.sizeAttenuation ); + array.push( parameters.morphTargetsCount ); + array.push( parameters.morphAttributeCount ); + array.push( parameters.numDirLights ); + array.push( parameters.numPointLights ); + array.push( parameters.numSpotLights ); + array.push( parameters.numSpotLightMaps ); + array.push( parameters.numHemiLights ); + array.push( parameters.numRectAreaLights ); + array.push( parameters.numDirLightShadows ); + array.push( parameters.numPointLightShadows ); + array.push( parameters.numSpotLightShadows ); + array.push( parameters.numSpotLightShadowsWithMaps ); + array.push( parameters.shadowMapType ); + array.push( parameters.toneMapping ); + array.push( parameters.numClippingPlanes ); + array.push( parameters.numClipIntersection ); + array.push( parameters.depthPacking ); + + } + + function getProgramCacheKeyBooleans( array, parameters ) { + + _programLayers.disableAll(); + + if ( parameters.isWebGL2 ) + _programLayers.enable( 0 ); + if ( parameters.supportsVertexTextures ) + _programLayers.enable( 1 ); + if ( parameters.instancing ) + _programLayers.enable( 2 ); + if ( parameters.instancingColor ) + _programLayers.enable( 3 ); + if ( parameters.matcap ) + _programLayers.enable( 4 ); + if ( parameters.envMap ) + _programLayers.enable( 5 ); + if ( parameters.normalMapObjectSpace ) + _programLayers.enable( 6 ); + if ( parameters.normalMapTangentSpace ) + _programLayers.enable( 7 ); + if ( parameters.clearcoat ) + _programLayers.enable( 8 ); + if ( parameters.iridescence ) + _programLayers.enable( 9 ); + if ( parameters.alphaTest ) + _programLayers.enable( 10 ); + if ( parameters.vertexColors ) + _programLayers.enable( 11 ); + if ( parameters.vertexAlphas ) + _programLayers.enable( 12 ); + if ( parameters.vertexUv1s ) + _programLayers.enable( 13 ); + if ( parameters.vertexUv2s ) + _programLayers.enable( 14 ); + if ( parameters.vertexUv3s ) + _programLayers.enable( 15 ); + if ( parameters.vertexTangents ) + _programLayers.enable( 16 ); + if ( parameters.anisotropy ) + _programLayers.enable( 17 ); + + array.push( _programLayers.mask ); + _programLayers.disableAll(); + + if ( parameters.fog ) + _programLayers.enable( 0 ); + if ( parameters.useFog ) + _programLayers.enable( 1 ); + if ( parameters.flatShading ) + _programLayers.enable( 2 ); + if ( parameters.logarithmicDepthBuffer ) + _programLayers.enable( 3 ); + if ( parameters.skinning ) + _programLayers.enable( 4 ); + if ( parameters.morphTargets ) + _programLayers.enable( 5 ); + if ( parameters.morphNormals ) + _programLayers.enable( 6 ); + if ( parameters.morphColors ) + _programLayers.enable( 7 ); + if ( parameters.premultipliedAlpha ) + _programLayers.enable( 8 ); + if ( parameters.shadowMapEnabled ) + _programLayers.enable( 9 ); + if ( parameters.useLegacyLights ) + _programLayers.enable( 10 ); + if ( parameters.doubleSided ) + _programLayers.enable( 11 ); + if ( parameters.flipSided ) + _programLayers.enable( 12 ); + if ( parameters.useDepthPacking ) + _programLayers.enable( 13 ); + if ( parameters.dithering ) + _programLayers.enable( 14 ); + if ( parameters.transmission ) + _programLayers.enable( 15 ); + if ( parameters.sheen ) + _programLayers.enable( 16 ); + if ( parameters.opaque ) + _programLayers.enable( 17 ); + if ( parameters.pointsUvs ) + _programLayers.enable( 18 ); + + array.push( _programLayers.mask ); + + } + + function getUniforms( material ) { + + const shaderID = shaderIDs[ material.type ]; + let uniforms; + + if ( shaderID ) { + + const shader = ShaderLib[ shaderID ]; + uniforms = UniformsUtils.clone( shader.uniforms ); - } + } else { - // envMap and Mirror needs camera.matrixWorld + uniforms = material.uniforms; - cameraL.matrixWorld.getInverse( cameraL.matrixWorldInverse ); - cameraR.matrixWorld.getInverse( cameraR.matrixWorldInverse ); + } - cameraL.projectionMatrix.fromArray( frameData.leftProjectionMatrix ); - cameraR.projectionMatrix.fromArray( frameData.rightProjectionMatrix ); + return uniforms; - // HACK @mrdoob - // https://github.com/w3c/webvr/issues/203 + } - cameraVR.projectionMatrix.copy( cameraL.projectionMatrix ); + function acquireProgram( parameters, cacheKey ) { - // + let program; - var layers = device.getLayers(); + // Check if code has been already compiled + for ( let p = 0, pl = programs.length; p < pl; p ++ ) { - if ( layers.length ) { + const preexistingProgram = programs[ p ]; - var layer = layers[ 0 ]; + if ( preexistingProgram.cacheKey === cacheKey ) { - if ( layer.leftBounds !== null && layer.leftBounds.length === 4 ) { + program = preexistingProgram; + ++ program.usedTimes; - cameraL.bounds.fromArray( layer.leftBounds ); + break; } - if ( layer.rightBounds !== null && layer.rightBounds.length === 4 ) { + } - cameraR.bounds.fromArray( layer.rightBounds ); + if ( program === undefined ) { - } + program = new WebGLProgram( renderer, cacheKey, parameters, bindingStates ); + programs.push( program ); } - return cameraVR; + return program; - }; + } - this.getStandingMatrix = function () { + function releaseProgram( program ) { - return standingMatrix; + if ( -- program.usedTimes === 0 ) { - }; + // Remove from unordered set + const i = programs.indexOf( program ); + programs[ i ] = programs[ programs.length - 1 ]; + programs.pop(); - this.submitFrame = function () { + // Free WebGL resources + program.destroy(); - if ( device && device.isPresenting ) device.submitFrame(); + } - }; + } - } + function releaseShaderCache( material ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + _customShaders.remove( material ); - function WebGLExtensions( gl ) { + } + + function dispose() { - var extensions = {}; + _customShaders.dispose(); + + } return { + getParameters: getParameters, + getProgramCacheKey: getProgramCacheKey, + getUniforms: getUniforms, + acquireProgram: acquireProgram, + releaseProgram: releaseProgram, + releaseShaderCache: releaseShaderCache, + // Exposed for resource monitoring & error feedback via renderer.info: + programs: programs, + dispose: dispose + }; - get: function ( name ) { + } - if ( extensions[ name ] !== undefined ) { + function WebGLProperties() { - return extensions[ name ]; + let properties = new WeakMap(); - } + function get( object ) { - var extension; + let map = properties.get( object ); - switch ( name ) { + if ( map === undefined ) { - case 'WEBGL_depth_texture': - extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' ); - break; + map = {}; + properties.set( object, map ); - case 'EXT_texture_filter_anisotropic': - extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); - break; + } - case 'WEBGL_compressed_texture_s3tc': - extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); - break; + return map; - case 'WEBGL_compressed_texture_pvrtc': - extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); - break; + } - case 'WEBGL_compressed_texture_etc1': - extension = gl.getExtension( 'WEBGL_compressed_texture_etc1' ); - break; + function remove( object ) { - default: - extension = gl.getExtension( name ); + properties.delete( object ); - } + } - if ( extension === null ) { + function update( object, key, value ) { - console.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); + properties.get( object )[ key ] = value; - } + } - extensions[ name ] = extension; + function dispose() { - return extension; + properties = new WeakMap(); - } + } + return { + get: get, + remove: remove, + update: update, + dispose: dispose }; } - /** - * @author tschw - */ + function painterSortStable( a, b ) { - function WebGLClipping() { + if ( a.groupOrder !== b.groupOrder ) { - var scope = this, + return a.groupOrder - b.groupOrder; - globalState = null, - numGlobalPlanes = 0, - localClippingEnabled = false, - renderingShadows = false, + } else if ( a.renderOrder !== b.renderOrder ) { - plane = new Plane(), - viewNormalMatrix = new Matrix3(), + return a.renderOrder - b.renderOrder; - uniform = { value: null, needsUpdate: false }; + } else if ( a.material.id !== b.material.id ) { - this.uniform = uniform; - this.numPlanes = 0; - this.numIntersection = 0; + return a.material.id - b.material.id; - this.init = function( planes, enableLocalClipping, camera ) { + } else if ( a.z !== b.z ) { - var enabled = - planes.length !== 0 || - enableLocalClipping || - // enable state of previous frame - the clipping code has to - // run another frame in order to reset the state: - numGlobalPlanes !== 0 || - localClippingEnabled; + return a.z - b.z; - localClippingEnabled = enableLocalClipping; + } else { - globalState = projectPlanes( planes, camera, 0 ); - numGlobalPlanes = planes.length; + return a.id - b.id; - return enabled; + } - }; + } - this.beginShadows = function() { + function reversePainterSortStable( a, b ) { - renderingShadows = true; - projectPlanes( null ); + if ( a.groupOrder !== b.groupOrder ) { - }; + return a.groupOrder - b.groupOrder; - this.endShadows = function() { + } else if ( a.renderOrder !== b.renderOrder ) { - renderingShadows = false; - resetGlobalState(); + return a.renderOrder - b.renderOrder; - }; + } else if ( a.z !== b.z ) { - this.setState = function( planes, clipIntersection, clipShadows, camera, cache, fromCache ) { + return b.z - a.z; - if ( ! localClippingEnabled || - planes === null || planes.length === 0 || - renderingShadows && ! clipShadows ) { - // there's no local clipping + } else { - if ( renderingShadows ) { - // there's no global clipping + return a.id - b.id; - projectPlanes( null ); + } - } else { - - resetGlobalState(); - } + } - } else { - var nGlobal = renderingShadows ? 0 : numGlobalPlanes, - lGlobal = nGlobal * 4, + function WebGLRenderList() { - dstArray = cache.clippingState || null; + const renderItems = []; + let renderItemsIndex = 0; - uniform.value = dstArray; // ensure unique state + const opaque = []; + const transmissive = []; + const transparent = []; - dstArray = projectPlanes( planes, camera, lGlobal, fromCache ); + function init() { - for ( var i = 0; i !== lGlobal; ++ i ) { + renderItemsIndex = 0; - dstArray[ i ] = globalState[ i ]; + opaque.length = 0; + transmissive.length = 0; + transparent.length = 0; - } + } - cache.clippingState = dstArray; - this.numIntersection = clipIntersection ? this.numPlanes : 0; - this.numPlanes += nGlobal; + function getNextRenderItem( object, geometry, material, groupOrder, z, group ) { - } + let renderItem = renderItems[ renderItemsIndex ]; + if ( renderItem === undefined ) { - }; + renderItem = { + id: object.id, + object: object, + geometry: geometry, + material: material, + groupOrder: groupOrder, + renderOrder: object.renderOrder, + z: z, + group: group + }; - function resetGlobalState() { + renderItems[ renderItemsIndex ] = renderItem; - if ( uniform.value !== globalState ) { + } else { - uniform.value = globalState; - uniform.needsUpdate = numGlobalPlanes > 0; + renderItem.id = object.id; + renderItem.object = object; + renderItem.geometry = geometry; + renderItem.material = material; + renderItem.groupOrder = groupOrder; + renderItem.renderOrder = object.renderOrder; + renderItem.z = z; + renderItem.group = group; } - scope.numPlanes = numGlobalPlanes; - scope.numIntersection = 0; + renderItemsIndex ++; + + return renderItem; } - function projectPlanes( planes, camera, dstOffset, skipTransform ) { + function push( object, geometry, material, groupOrder, z, group ) { - var nPlanes = planes !== null ? planes.length : 0, - dstArray = null; + const renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); - if ( nPlanes !== 0 ) { + if ( material.transmission > 0.0 ) { - dstArray = uniform.value; + transmissive.push( renderItem ); - if ( skipTransform !== true || dstArray === null ) { + } else if ( material.transparent === true ) { - var flatSize = dstOffset + nPlanes * 4, - viewMatrix = camera.matrixWorldInverse; + transparent.push( renderItem ); - viewNormalMatrix.getNormalMatrix( viewMatrix ); + } else { - if ( dstArray === null || dstArray.length < flatSize ) { + opaque.push( renderItem ); - dstArray = new Float32Array( flatSize ); + } - } + } - for ( var i = 0, i4 = dstOffset; - i !== nPlanes; ++ i, i4 += 4 ) { + function unshift( object, geometry, material, groupOrder, z, group ) { - plane.copy( planes[ i ] ). - applyMatrix4( viewMatrix, viewNormalMatrix ); + const renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); - plane.normal.toArray( dstArray, i4 ); - dstArray[ i4 + 3 ] = plane.constant; + if ( material.transmission > 0.0 ) { - } + transmissive.unshift( renderItem ); - } + } else if ( material.transparent === true ) { - uniform.value = dstArray; - uniform.needsUpdate = true; + transparent.unshift( renderItem ); - } + } else { - scope.numPlanes = nPlanes; - - return dstArray; + opaque.unshift( renderItem ); + + } } - } + function sort( customOpaqueSort, customTransparentSort ) { - // import { Sphere } from '../math/Sphere'; - /** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - * @author tschw - */ + if ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable ); + if ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable ); + if ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable ); - function WebGLRenderer( parameters ) { + } - console.log( 'THREE.WebGLRenderer', REVISION ); + function finish() { - parameters = parameters || {}; + // Clear references from inactive renderItems in the list - var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ), - _context = parameters.context !== undefined ? parameters.context : null, + for ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) { - _alpha = parameters.alpha !== undefined ? parameters.alpha : false, - _depth = parameters.depth !== undefined ? parameters.depth : true, - _stencil = parameters.stencil !== undefined ? parameters.stencil : true, - _antialias = parameters.antialias !== undefined ? parameters.antialias : false, - _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, - _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false; + const renderItem = renderItems[ i ]; - var lights = []; + if ( renderItem.id === null ) break; - var currentRenderList = null; + renderItem.id = null; + renderItem.object = null; + renderItem.geometry = null; + renderItem.material = null; + renderItem.group = null; - var morphInfluences = new Float32Array( 8 ); + } - var sprites = []; - var lensFlares = []; + } - // public properties + return { - this.domElement = _canvas; - this.context = null; + opaque: opaque, + transmissive: transmissive, + transparent: transparent, - // clearing + init: init, + push: push, + unshift: unshift, + finish: finish, - this.autoClear = true; - this.autoClearColor = true; - this.autoClearDepth = true; - this.autoClearStencil = true; + sort: sort + }; - // scene graph + } - this.sortObjects = true; + function WebGLRenderLists() { - // user-defined clipping + let lists = new WeakMap(); - this.clippingPlanes = []; - this.localClippingEnabled = false; + function get( scene, renderCallDepth ) { - // physically based shading + const listArray = lists.get( scene ); + let list; - this.gammaFactor = 2.0; // for backwards compatibility - this.gammaInput = false; - this.gammaOutput = false; + if ( listArray === undefined ) { - // physical lights + list = new WebGLRenderList(); + lists.set( scene, [ list ] ); - this.physicallyCorrectLights = false; + } else { - // tone mapping + if ( renderCallDepth >= listArray.length ) { - this.toneMapping = LinearToneMapping; - this.toneMappingExposure = 1.0; - this.toneMappingWhitePoint = 1.0; + list = new WebGLRenderList(); + listArray.push( list ); - // morphs + } else { - this.maxMorphTargets = 8; - this.maxMorphNormals = 4; + list = listArray[ renderCallDepth ]; - // internal properties + } - var _this = this, + } - // internal state cache + return list; - _currentProgram = null, - _currentRenderTarget = null, - _currentFramebuffer = null, - _currentMaterialId = - 1, - _currentGeometryProgram = '', + } - _currentCamera = null, - _currentArrayCamera = null, + function dispose() { - _currentScissor = new Vector4(), - _currentScissorTest = null, + lists = new WeakMap(); - _currentViewport = new Vector4(), + } - // + return { + get: get, + dispose: dispose + }; - _usedTextureUnits = 0, + } - // + function UniformsCache() { - _width = _canvas.width, - _height = _canvas.height, + const lights = {}; - _pixelRatio = 1, + return { - _scissor = new Vector4( 0, 0, _width, _height ), - _scissorTest = false, + get: function ( light ) { - _viewport = new Vector4( 0, 0, _width, _height ), + if ( lights[ light.id ] !== undefined ) { - // frustum + return lights[ light.id ]; - _frustum = new Frustum(), + } - // clipping + let uniforms; - _clipping = new WebGLClipping(), - _clippingEnabled = false, - _localClippingEnabled = false, + switch ( light.type ) { - // camera matrices cache + case 'DirectionalLight': + uniforms = { + direction: new Vector3(), + color: new Color() + }; + break; - _projScreenMatrix = new Matrix4(), + case 'SpotLight': + uniforms = { + position: new Vector3(), + direction: new Vector3(), + color: new Color(), + distance: 0, + coneCos: 0, + penumbraCos: 0, + decay: 0 + }; + break; - _vector3 = new Vector3(), - _matrix4 = new Matrix4(), - _matrix42 = new Matrix4(), + case 'PointLight': + uniforms = { + position: new Vector3(), + color: new Color(), + distance: 0, + decay: 0 + }; + break; - // light arrays cache + case 'HemisphereLight': + uniforms = { + direction: new Vector3(), + skyColor: new Color(), + groundColor: new Color() + }; + break; - _lights = { + case 'RectAreaLight': + uniforms = { + color: new Color(), + position: new Vector3(), + halfWidth: new Vector3(), + halfHeight: new Vector3() + }; + break; - hash: '', + } - ambient: [ 0, 0, 0 ], - directional: [], - directionalShadowMap: [], - directionalShadowMatrix: [], - spot: [], - spotShadowMap: [], - spotShadowMatrix: [], - rectArea: [], - point: [], - pointShadowMap: [], - pointShadowMatrix: [], - hemi: [], + lights[ light.id ] = uniforms; - shadows: [] + return uniforms; - }, + } - // info + }; - _infoMemory = { - geometries: 0, - textures: 0 - }, + } - _infoRender = { + function ShadowUniformsCache() { - frame: 0, - calls: 0, - vertices: 0, - faces: 0, - points: 0 + const lights = {}; - }; + return { - this.info = { + get: function ( light ) { - render: _infoRender, - memory: _infoMemory, - programs: null + if ( lights[ light.id ] !== undefined ) { - }; + return lights[ light.id ]; + } - // initialize + let uniforms; - var _gl; + switch ( light.type ) { - try { + case 'DirectionalLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; - var contextAttributes = { - alpha: _alpha, - depth: _depth, - stencil: _stencil, - antialias: _antialias, - premultipliedAlpha: _premultipliedAlpha, - preserveDrawingBuffer: _preserveDrawingBuffer - }; + case 'SpotLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; - _gl = _context || _canvas.getContext( 'webgl', contextAttributes ) || _canvas.getContext( 'experimental-webgl', contextAttributes ); + case 'PointLight': + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2(), + shadowCameraNear: 1, + shadowCameraFar: 1000 + }; + break; - if ( _gl === null ) { + // TODO (abelnation): set RectAreaLight shadow uniforms - if ( _canvas.getContext( 'webgl' ) !== null ) { + } - throw 'Error creating WebGL context with your selected attributes.'; + lights[ light.id ] = uniforms; - } else { + return uniforms; - throw 'Error creating WebGL context.'; + } - } + }; - } + } - // Some experimental-webgl implementations do not have getShaderPrecisionFormat - if ( _gl.getShaderPrecisionFormat === undefined ) { - _gl.getShaderPrecisionFormat = function () { + let nextVersion = 0; - return { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 }; + function shadowCastingAndTexturingLightsFirst( lightA, lightB ) { - }; + return ( lightB.castShadow ? 2 : 0 ) - ( lightA.castShadow ? 2 : 0 ) + ( lightB.map ? 1 : 0 ) - ( lightA.map ? 1 : 0 ); - } + } - _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); + function WebGLLights( extensions, capabilities ) { - } catch ( error ) { + const cache = new UniformsCache(); - console.error( 'THREE.WebGLRenderer: ' + error ); + const shadowCache = ShadowUniformsCache(); - } + const state = { - var extensions = new WebGLExtensions( _gl ); + version: 0, - extensions.get( 'WEBGL_depth_texture' ); - extensions.get( 'OES_texture_float' ); - extensions.get( 'OES_texture_float_linear' ); - extensions.get( 'OES_texture_half_float' ); - extensions.get( 'OES_texture_half_float_linear' ); - extensions.get( 'OES_standard_derivatives' ); - extensions.get( 'ANGLE_instanced_arrays' ); + hash: { + directionalLength: - 1, + pointLength: - 1, + spotLength: - 1, + rectAreaLength: - 1, + hemiLength: - 1, - if ( extensions.get( 'OES_element_index_uint' ) ) { + numDirectionalShadows: - 1, + numPointShadows: - 1, + numSpotShadows: - 1, + numSpotMaps: - 1 + }, - BufferGeometry.MaxIndex = 4294967296; + ambient: [ 0, 0, 0 ], + probe: [], + directional: [], + directionalShadow: [], + directionalShadowMap: [], + directionalShadowMatrix: [], + spot: [], + spotLightMap: [], + spotShadow: [], + spotShadowMap: [], + spotLightMatrix: [], + rectArea: [], + rectAreaLTC1: null, + rectAreaLTC2: null, + point: [], + pointShadow: [], + pointShadowMap: [], + pointShadowMatrix: [], + hemi: [], + numSpotLightShadowsWithMaps: 0 - } + }; - var capabilities = new WebGLCapabilities( _gl, extensions, parameters ); + for ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() ); - var state = new WebGLState( _gl, extensions, paramThreeToGL ); + const vector3 = new Vector3(); + const matrix4 = new Matrix4(); + const matrix42 = new Matrix4(); - var properties = new WebGLProperties(); - var textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, _infoMemory ); - var attributes = new WebGLAttributes( _gl ); - var geometries = new WebGLGeometries( _gl, attributes, _infoMemory ); - var objects = new WebGLObjects( _gl, geometries, _infoRender ); - var programCache = new WebGLPrograms( this, capabilities ); - var lightCache = new WebGLLights(); - var renderLists = new WebGLRenderLists(); + function setup( lights, useLegacyLights ) { - var background = new WebGLBackground( this, state, objects, _premultipliedAlpha ); - var vr = new WebVRManager( this ); + let r = 0, g = 0, b = 0; - this.info.programs = programCache.programs; + for ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 ); - var bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender ); - var indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender ); + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; - // + let numDirectionalShadows = 0; + let numPointShadows = 0; + let numSpotShadows = 0; + let numSpotMaps = 0; + let numSpotShadowsWithMaps = 0; - function getTargetPixelRatio() { + // ordering : [shadow casting + map texturing, map texturing, shadow casting, none ] + lights.sort( shadowCastingAndTexturingLightsFirst ); - return _currentRenderTarget === null ? _pixelRatio : 1; + // artist-friendly light intensity scaling factor + const scaleFactor = ( useLegacyLights === true ) ? Math.PI : 1; - } + for ( let i = 0, l = lights.length; i < l; i ++ ) { - function setDefaultGLState() { + const light = lights[ i ]; - state.init(); + const color = light.color; + const intensity = light.intensity; + const distance = light.distance; - state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) ); - state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) ); + const shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null; - } + if ( light.isAmbientLight ) { - function resetGLState() { + r += color.r * intensity * scaleFactor; + g += color.g * intensity * scaleFactor; + b += color.b * intensity * scaleFactor; - _currentProgram = null; - _currentCamera = null; + } else if ( light.isLightProbe ) { - _currentGeometryProgram = ''; - _currentMaterialId = - 1; + for ( let j = 0; j < 9; j ++ ) { - state.reset(); + state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity ); - } + } - setDefaultGLState(); + } else if ( light.isDirectionalLight ) { - this.context = _gl; - this.capabilities = capabilities; - this.extensions = extensions; - this.properties = properties; - this.renderLists = renderLists; - this.state = state; - this.vr = vr; + const uniforms = cache.get( light ); - // shadow map + uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor ); - var shadowMap = new WebGLShadowMap( this, _lights, objects, capabilities ); + if ( light.castShadow ) { - this.shadowMap = shadowMap; + const shadow = light.shadow; + const shadowUniforms = shadowCache.get( light ); - // Plugins + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; - var spritePlugin = new SpritePlugin( this, sprites ); - var lensFlarePlugin = new LensFlarePlugin( this, lensFlares ); + state.directionalShadow[ directionalLength ] = shadowUniforms; + state.directionalShadowMap[ directionalLength ] = shadowMap; + state.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix; - // API + numDirectionalShadows ++; - this.getContext = function () { + } - return _gl; + state.directional[ directionalLength ] = uniforms; - }; + directionalLength ++; - this.getContextAttributes = function () { + } else if ( light.isSpotLight ) { - return _gl.getContextAttributes(); + const uniforms = cache.get( light ); - }; + uniforms.position.setFromMatrixPosition( light.matrixWorld ); - this.forceContextLoss = function () { + uniforms.color.copy( color ).multiplyScalar( intensity * scaleFactor ); + uniforms.distance = distance; - var extension = extensions.get( 'WEBGL_lose_context' ); - if ( extension ) extension.loseContext(); + uniforms.coneCos = Math.cos( light.angle ); + uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) ); + uniforms.decay = light.decay; - }; + state.spot[ spotLength ] = uniforms; - this.getMaxAnisotropy = function () { + const shadow = light.shadow; - return capabilities.getMaxAnisotropy(); + if ( light.map ) { - }; + state.spotLightMap[ numSpotMaps ] = light.map; + numSpotMaps ++; - this.getPrecision = function () { + // make sure the lightMatrix is up to date + // TODO : do it if required only + shadow.updateMatrices( light ); - return capabilities.precision; + if ( light.castShadow ) numSpotShadowsWithMaps ++; - }; + } - this.getPixelRatio = function () { + state.spotLightMatrix[ spotLength ] = shadow.matrix; - return _pixelRatio; + if ( light.castShadow ) { - }; + const shadowUniforms = shadowCache.get( light ); - this.setPixelRatio = function ( value ) { + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; - if ( value === undefined ) return; + state.spotShadow[ spotLength ] = shadowUniforms; + state.spotShadowMap[ spotLength ] = shadowMap; - _pixelRatio = value; + numSpotShadows ++; - this.setSize( _width, _height, false ); + } - }; + spotLength ++; - this.getSize = function () { + } else if ( light.isRectAreaLight ) { - return { - width: _width, - height: _height - }; + const uniforms = cache.get( light ); - }; + uniforms.color.copy( color ).multiplyScalar( intensity ); - this.setSize = function ( width, height, updateStyle ) { + uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); + uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); - var device = vr.getDevice(); + state.rectArea[ rectAreaLength ] = uniforms; - if ( device && device.isPresenting ) { + rectAreaLength ++; - console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' ); - return; + } else if ( light.isPointLight ) { - } + const uniforms = cache.get( light ); - _width = width; - _height = height; + uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor ); + uniforms.distance = light.distance; + uniforms.decay = light.decay; - _canvas.width = width * _pixelRatio; - _canvas.height = height * _pixelRatio; + if ( light.castShadow ) { - if ( updateStyle !== false ) { + const shadow = light.shadow; - _canvas.style.width = width + 'px'; - _canvas.style.height = height + 'px'; + const shadowUniforms = shadowCache.get( light ); - } + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + shadowUniforms.shadowCameraNear = shadow.camera.near; + shadowUniforms.shadowCameraFar = shadow.camera.far; - this.setViewport( 0, 0, width, height ); + state.pointShadow[ pointLength ] = shadowUniforms; + state.pointShadowMap[ pointLength ] = shadowMap; + state.pointShadowMatrix[ pointLength ] = light.shadow.matrix; - }; + numPointShadows ++; - this.getDrawingBufferSize = function () { + } - return { - width: _width * _pixelRatio, - height: _height * _pixelRatio - }; + state.point[ pointLength ] = uniforms; - }; + pointLength ++; - this.setDrawingBufferSize = function ( width, height, pixelRatio ) { + } else if ( light.isHemisphereLight ) { - _width = width; - _height = height; + const uniforms = cache.get( light ); - _pixelRatio = pixelRatio; + uniforms.skyColor.copy( light.color ).multiplyScalar( intensity * scaleFactor ); + uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity * scaleFactor ); - _canvas.width = width * pixelRatio; - _canvas.height = height * pixelRatio; + state.hemi[ hemiLength ] = uniforms; - this.setViewport( 0, 0, width, height ); + hemiLength ++; - }; + } - this.setViewport = function ( x, y, width, height ) { + } - _viewport.set( x, _height - y - height, width, height ); - state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) ); + if ( rectAreaLength > 0 ) { - }; + if ( capabilities.isWebGL2 ) { - this.setScissor = function ( x, y, width, height ) { + // WebGL 2 - _scissor.set( x, _height - y - height, width, height ); - state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) ); + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; - }; + } else { - this.setScissorTest = function ( boolean ) { + // WebGL 1 - state.setScissorTest( _scissorTest = boolean ); + if ( extensions.has( 'OES_texture_float_linear' ) === true ) { - }; + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; - // Clearing + } else if ( extensions.has( 'OES_texture_half_float_linear' ) === true ) { - this.getClearColor = background.getClearColor; - this.setClearColor = background.setClearColor; - this.getClearAlpha = background.getClearAlpha; - this.setClearAlpha = background.setClearAlpha; + state.rectAreaLTC1 = UniformsLib.LTC_HALF_1; + state.rectAreaLTC2 = UniformsLib.LTC_HALF_2; - this.clear = function ( color, depth, stencil ) { + } else { - var bits = 0; + console.error( 'THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.' ); - if ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT; - if ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT; - if ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT; + } - _gl.clear( bits ); + } - }; + } - this.clearColor = function () { + state.ambient[ 0 ] = r; + state.ambient[ 1 ] = g; + state.ambient[ 2 ] = b; - this.clear( true, false, false ); + const hash = state.hash; - }; + if ( hash.directionalLength !== directionalLength || + hash.pointLength !== pointLength || + hash.spotLength !== spotLength || + hash.rectAreaLength !== rectAreaLength || + hash.hemiLength !== hemiLength || + hash.numDirectionalShadows !== numDirectionalShadows || + hash.numPointShadows !== numPointShadows || + hash.numSpotShadows !== numSpotShadows || + hash.numSpotMaps !== numSpotMaps ) { - this.clearDepth = function () { + state.directional.length = directionalLength; + state.spot.length = spotLength; + state.rectArea.length = rectAreaLength; + state.point.length = pointLength; + state.hemi.length = hemiLength; - this.clear( false, true, false ); + state.directionalShadow.length = numDirectionalShadows; + state.directionalShadowMap.length = numDirectionalShadows; + state.pointShadow.length = numPointShadows; + state.pointShadowMap.length = numPointShadows; + state.spotShadow.length = numSpotShadows; + state.spotShadowMap.length = numSpotShadows; + state.directionalShadowMatrix.length = numDirectionalShadows; + state.pointShadowMatrix.length = numPointShadows; + state.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps; + state.spotLightMap.length = numSpotMaps; + state.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps; - }; + hash.directionalLength = directionalLength; + hash.pointLength = pointLength; + hash.spotLength = spotLength; + hash.rectAreaLength = rectAreaLength; + hash.hemiLength = hemiLength; - this.clearStencil = function () { + hash.numDirectionalShadows = numDirectionalShadows; + hash.numPointShadows = numPointShadows; + hash.numSpotShadows = numSpotShadows; + hash.numSpotMaps = numSpotMaps; - this.clear( false, false, true ); + state.version = nextVersion ++; - }; + } - this.clearTarget = function ( renderTarget, color, depth, stencil ) { + } - this.setRenderTarget( renderTarget ); - this.clear( color, depth, stencil ); + function setupView( lights, camera ) { - }; + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; - // Reset + const viewMatrix = camera.matrixWorldInverse; - this.resetGLState = resetGLState; + for ( let i = 0, l = lights.length; i < l; i ++ ) { - this.dispose = function () { + const light = lights[ i ]; - _canvas.removeEventListener( 'webglcontextlost', onContextLost, false ); + if ( light.isDirectionalLight ) { - renderLists.dispose(); + const uniforms = state.directional[ directionalLength ]; - }; + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( vector3 ); + uniforms.direction.transformDirection( viewMatrix ); - // Events + directionalLength ++; - function onContextLost( event ) { + } else if ( light.isSpotLight ) { - event.preventDefault(); + const uniforms = state.spot[ spotLength ]; - resetGLState(); - setDefaultGLState(); + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); - properties.clear(); - objects.clear(); + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( vector3 ); + uniforms.direction.transformDirection( viewMatrix ); - } + spotLength ++; - function onMaterialDispose( event ) { + } else if ( light.isRectAreaLight ) { - var material = event.target; + const uniforms = state.rectArea[ rectAreaLength ]; - material.removeEventListener( 'dispose', onMaterialDispose ); + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); - deallocateMaterial( material ); + // extract local rotation of light to derive width/height half vectors + matrix42.identity(); + matrix4.copy( light.matrixWorld ); + matrix4.premultiply( viewMatrix ); + matrix42.extractRotation( matrix4 ); - } + uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); + uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); - // Buffer deallocation + uniforms.halfWidth.applyMatrix4( matrix42 ); + uniforms.halfHeight.applyMatrix4( matrix42 ); - function deallocateMaterial( material ) { + rectAreaLength ++; - releaseMaterialProgramReference( material ); + } else if ( light.isPointLight ) { - properties.remove( material ); + const uniforms = state.point[ pointLength ]; - } + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + pointLength ++; - function releaseMaterialProgramReference( material ) { + } else if ( light.isHemisphereLight ) { - var programInfo = properties.get( material ).program; + const uniforms = state.hemi[ hemiLength ]; - material.program = undefined; + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + uniforms.direction.transformDirection( viewMatrix ); - if ( programInfo !== undefined ) { + hemiLength ++; - programCache.releaseProgram( programInfo ); + } } } - // Buffer rendering - - function renderObjectImmediate( object, program, material ) { - - object.render( function ( object ) { + return { + setup: setup, + setupView: setupView, + state: state + }; - _this.renderBufferImmediate( object, program, material ); + } - } ); + function WebGLRenderState( extensions, capabilities ) { - } + const lights = new WebGLLights( extensions, capabilities ); - this.renderBufferImmediate = function ( object, program, material ) { + const lightsArray = []; + const shadowsArray = []; - state.initAttributes(); + function init() { - var buffers = properties.get( object ); + lightsArray.length = 0; + shadowsArray.length = 0; - if ( object.hasPositions && ! buffers.position ) buffers.position = _gl.createBuffer(); - if ( object.hasNormals && ! buffers.normal ) buffers.normal = _gl.createBuffer(); - if ( object.hasUvs && ! buffers.uv ) buffers.uv = _gl.createBuffer(); - if ( object.hasColors && ! buffers.color ) buffers.color = _gl.createBuffer(); + } - var programAttributes = program.getAttributes(); + function pushLight( light ) { - if ( object.hasPositions ) { + lightsArray.push( light ); - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.position ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW ); + } - state.enableAttribute( programAttributes.position ); - _gl.vertexAttribPointer( programAttributes.position, 3, _gl.FLOAT, false, 0, 0 ); + function pushShadow( shadowLight ) { - } + shadowsArray.push( shadowLight ); - if ( object.hasNormals ) { + } - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal ); + function setupLights( useLegacyLights ) { - if ( ! material.isMeshPhongMaterial && - ! material.isMeshStandardMaterial && - ! material.isMeshNormalMaterial && - material.shading === FlatShading ) { + lights.setup( lightsArray, useLegacyLights ); - for ( var i = 0, l = object.count * 3; i < l; i += 9 ) { + } - var array = object.normalArray; + function setupLightsView( camera ) { - var nx = ( array[ i + 0 ] + array[ i + 3 ] + array[ i + 6 ] ) / 3; - var ny = ( array[ i + 1 ] + array[ i + 4 ] + array[ i + 7 ] ) / 3; - var nz = ( array[ i + 2 ] + array[ i + 5 ] + array[ i + 8 ] ) / 3; + lights.setupView( lightsArray, camera ); - array[ i + 0 ] = nx; - array[ i + 1 ] = ny; - array[ i + 2 ] = nz; + } - array[ i + 3 ] = nx; - array[ i + 4 ] = ny; - array[ i + 5 ] = nz; + const state = { + lightsArray: lightsArray, + shadowsArray: shadowsArray, - array[ i + 6 ] = nx; - array[ i + 7 ] = ny; - array[ i + 8 ] = nz; + lights: lights + }; - } + return { + init: init, + state: state, + setupLights: setupLights, + setupLightsView: setupLightsView, - } + pushLight: pushLight, + pushShadow: pushShadow + }; - _gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW ); + } - state.enableAttribute( programAttributes.normal ); + function WebGLRenderStates( extensions, capabilities ) { - _gl.vertexAttribPointer( programAttributes.normal, 3, _gl.FLOAT, false, 0, 0 ); + let renderStates = new WeakMap(); - } + function get( scene, renderCallDepth = 0 ) { - if ( object.hasUvs && material.map ) { + const renderStateArray = renderStates.get( scene ); + let renderState; - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW ); + if ( renderStateArray === undefined ) { - state.enableAttribute( programAttributes.uv ); + renderState = new WebGLRenderState( extensions, capabilities ); + renderStates.set( scene, [ renderState ] ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 ); + } else { - } + if ( renderCallDepth >= renderStateArray.length ) { - if ( object.hasColors && material.vertexColors !== NoColors ) { + renderState = new WebGLRenderState( extensions, capabilities ); + renderStateArray.push( renderState ); - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW ); + } else { - state.enableAttribute( programAttributes.color ); + renderState = renderStateArray[ renderCallDepth ]; - _gl.vertexAttribPointer( programAttributes.color, 3, _gl.FLOAT, false, 0, 0 ); + } } - state.disableUnusedAttributes(); + return renderState; - _gl.drawArrays( _gl.TRIANGLES, 0, object.count ); + } - object.count = 0; + function dispose() { - }; + renderStates = new WeakMap(); - function absNumericalSort( a, b ) { + } - return Math.abs( b[ 0 ] ) - Math.abs( a[ 0 ] ); + return { + get: get, + dispose: dispose + }; - } + } - this.renderBufferDirect = function ( camera, fog, geometry, material, object, group ) { + class MeshDepthMaterial extends Material { - state.setMaterial( material ); + constructor( parameters ) { - var program = setProgram( camera, fog, material, object ); - var geometryProgram = geometry.id + '_' + program.id + '_' + ( material.wireframe === true ); + super(); - var updateBuffers = false; + this.isMeshDepthMaterial = true; - if ( geometryProgram !== _currentGeometryProgram ) { + this.type = 'MeshDepthMaterial'; - _currentGeometryProgram = geometryProgram; - updateBuffers = true; + this.depthPacking = BasicDepthPacking; - } + this.map = null; - // morph targets + this.alphaMap = null; - var morphTargetInfluences = object.morphTargetInfluences; + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - if ( morphTargetInfluences !== undefined ) { + this.wireframe = false; + this.wireframeLinewidth = 1; - // TODO Remove allocations + this.setValues( parameters ); - var activeInfluences = []; + } - for ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) { + copy( source ) { - var influence = morphTargetInfluences[ i ]; - activeInfluences.push( [ influence, i ] ); + super.copy( source ); - } + this.depthPacking = source.depthPacking; - activeInfluences.sort( absNumericalSort ); + this.map = source.map; - if ( activeInfluences.length > 8 ) { + this.alphaMap = source.alphaMap; - activeInfluences.length = 8; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - } + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; - var morphAttributes = geometry.morphAttributes; + return this; - for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) { + } - var influence = activeInfluences[ i ]; - morphInfluences[ i ] = influence[ 0 ]; + } - if ( influence[ 0 ] !== 0 ) { + class MeshDistanceMaterial extends Material { - var index = influence[ 1 ]; + constructor( parameters ) { - if ( material.morphTargets === true && morphAttributes.position ) geometry.addAttribute( 'morphTarget' + i, morphAttributes.position[ index ] ); - if ( material.morphNormals === true && morphAttributes.normal ) geometry.addAttribute( 'morphNormal' + i, morphAttributes.normal[ index ] ); + super(); - } else { + this.isMeshDistanceMaterial = true; - if ( material.morphTargets === true ) geometry.removeAttribute( 'morphTarget' + i ); - if ( material.morphNormals === true ) geometry.removeAttribute( 'morphNormal' + i ); + this.type = 'MeshDistanceMaterial'; - } + this.map = null; - } + this.alphaMap = null; - for ( var i = activeInfluences.length, il = morphInfluences.length; i < il; i ++ ) { + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - morphInfluences[ i ] = 0.0; + this.setValues( parameters ); - } + } - program.getUniforms().setValue( _gl, 'morphTargetInfluences', morphInfluences ); + copy( source ) { - updateBuffers = true; + super.copy( source ); - } + this.map = source.map; - // + this.alphaMap = source.alphaMap; - var index = geometry.index; - var position = geometry.attributes.position; - var rangeFactor = 1; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - if ( material.wireframe === true ) { + return this; - index = geometries.getWireframeAttribute( geometry ); - rangeFactor = 2; + } - } + } - var attribute; - var renderer = bufferRenderer; + const vertex = "void main() {\n\tgl_Position = vec4( position, 1.0 );\n}"; - if ( index !== null ) { + const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"; - attribute = attributes.get( index ); + function WebGLShadowMap( _renderer, _objects, _capabilities ) { - renderer = indexedBufferRenderer; - renderer.setIndex( attribute ); + let _frustum = new Frustum(); - } + const _shadowMapSize = new Vector2(), + _viewportSize = new Vector2(), - if ( updateBuffers ) { + _viewport = new Vector4(), - setupVertexAttributes( material, program, geometry ); + _depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ), + _distanceMaterial = new MeshDistanceMaterial(), - if ( index !== null ) { + _materialCache = {}, - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, attribute.buffer ); + _maxTextureSize = _capabilities.maxTextureSize; - } + const shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide }; - } + const shadowMaterialVertical = new ShaderMaterial( { + defines: { + VSM_SAMPLES: 8 + }, + uniforms: { + shadow_pass: { value: null }, + resolution: { value: new Vector2() }, + radius: { value: 4.0 } + }, - // + vertexShader: vertex, + fragmentShader: fragment - var dataCount = 0; + } ); - if ( index !== null ) { + const shadowMaterialHorizontal = shadowMaterialVertical.clone(); + shadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1; - dataCount = index.count; + const fullScreenTri = new BufferGeometry(); + fullScreenTri.setAttribute( + 'position', + new BufferAttribute( + new Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ), + 3 + ) + ); - } else if ( position !== undefined ) { + const fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical ); - dataCount = position.count; + const scope = this; - } + this.enabled = false; - var rangeStart = geometry.drawRange.start * rangeFactor; - var rangeCount = geometry.drawRange.count * rangeFactor; + this.autoUpdate = true; + this.needsUpdate = false; - var groupStart = group !== null ? group.start * rangeFactor : 0; - var groupCount = group !== null ? group.count * rangeFactor : Infinity; + this.type = PCFShadowMap; + let _previousType = this.type; - var drawStart = Math.max( rangeStart, groupStart ); - var drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1; + this.render = function ( lights, scene, camera ) { - var drawCount = Math.max( 0, drawEnd - drawStart + 1 ); + if ( scope.enabled === false ) return; + if ( scope.autoUpdate === false && scope.needsUpdate === false ) return; - if ( drawCount === 0 ) return; + if ( lights.length === 0 ) return; - // + const currentRenderTarget = _renderer.getRenderTarget(); + const activeCubeFace = _renderer.getActiveCubeFace(); + const activeMipmapLevel = _renderer.getActiveMipmapLevel(); - if ( object.isMesh ) { + const _state = _renderer.state; - if ( material.wireframe === true ) { + // Set GL state for depth map. + _state.setBlending( NoBlending ); + _state.buffers.color.setClear( 1, 1, 1, 1 ); + _state.buffers.depth.setTest( true ); + _state.setScissorTest( false ); - state.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() ); - renderer.setMode( _gl.LINES ); + // check for shadow map type changes - } else { + const toVSM = ( _previousType !== VSMShadowMap && this.type === VSMShadowMap ); + const fromVSM = ( _previousType === VSMShadowMap && this.type !== VSMShadowMap ); - switch ( object.drawMode ) { + // render depth map - case TrianglesDrawMode: - renderer.setMode( _gl.TRIANGLES ); - break; + for ( let i = 0, il = lights.length; i < il; i ++ ) { - case TriangleStripDrawMode: - renderer.setMode( _gl.TRIANGLE_STRIP ); - break; + const light = lights[ i ]; + const shadow = light.shadow; - case TriangleFanDrawMode: - renderer.setMode( _gl.TRIANGLE_FAN ); - break; + if ( shadow === undefined ) { - } + console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' ); + continue; } + if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue; - } else if ( object.isLine ) { + _shadowMapSize.copy( shadow.mapSize ); + + const shadowFrameExtents = shadow.getFrameExtents(); - var lineWidth = material.linewidth; + _shadowMapSize.multiply( shadowFrameExtents ); - if ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material + _viewportSize.copy( shadow.mapSize ); - state.setLineWidth( lineWidth * getTargetPixelRatio() ); + if ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) { - if ( object.isLineSegments ) { + if ( _shadowMapSize.x > _maxTextureSize ) { - renderer.setMode( _gl.LINES ); + _viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x ); + _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x; + shadow.mapSize.x = _viewportSize.x; - } else if ( object.isLineLoop ) { + } - renderer.setMode( _gl.LINE_LOOP ); + if ( _shadowMapSize.y > _maxTextureSize ) { - } else { + _viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y ); + _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y; + shadow.mapSize.y = _viewportSize.y; - renderer.setMode( _gl.LINE_STRIP ); + } } - } else if ( object.isPoints ) { + if ( shadow.map === null || toVSM === true || fromVSM === true ) { - renderer.setMode( _gl.POINTS ); + const pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {}; - } + if ( shadow.map !== null ) { - if ( geometry && geometry.isInstancedBufferGeometry ) { + shadow.map.dispose(); + + } - if ( geometry.maxInstancedCount > 0 ) { + shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); + shadow.map.texture.name = light.name + '.shadowMap'; - renderer.renderInstances( geometry, drawStart, drawCount ); + shadow.camera.updateProjectionMatrix(); } - } else { + _renderer.setRenderTarget( shadow.map ); + _renderer.clear(); - renderer.render( drawStart, drawCount ); + const viewportCount = shadow.getViewportCount(); - } + for ( let vp = 0; vp < viewportCount; vp ++ ) { - }; + const viewport = shadow.getViewport( vp ); + + _viewport.set( + _viewportSize.x * viewport.x, + _viewportSize.y * viewport.y, + _viewportSize.x * viewport.z, + _viewportSize.y * viewport.w + ); - function setupVertexAttributes( material, program, geometry, startIndex ) { + _state.viewport( _viewport ); - if ( geometry && geometry.isInstancedBufferGeometry ) { + shadow.updateMatrices( light, vp ); - if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) { + _frustum = shadow.getFrustum(); - console.error( 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; + renderObject( scene, camera, shadow.camera, light, this.type ); } - } + // do blur pass for VSM - if ( startIndex === undefined ) startIndex = 0; + if ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) { - state.initAttributes(); + VSMPass( shadow, camera ); - var geometryAttributes = geometry.attributes; + } - var programAttributes = program.getAttributes(); + shadow.needsUpdate = false; - var materialDefaultAttributeValues = material.defaultAttributeValues; + } - for ( var name in programAttributes ) { + _previousType = this.type; - var programAttribute = programAttributes[ name ]; + scope.needsUpdate = false; - if ( programAttribute >= 0 ) { + _renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel ); - var geometryAttribute = geometryAttributes[ name ]; + }; - if ( geometryAttribute !== undefined ) { + function VSMPass( shadow, camera ) { - var normalized = geometryAttribute.normalized; - var size = geometryAttribute.itemSize; + const geometry = _objects.update( fullScreenMesh ); - var attribute = attributes.get( geometryAttribute ); + if ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) { - var buffer = attribute.buffer; - var type = attribute.type; - var bytesPerElement = attribute.bytesPerElement; + shadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples; + shadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples; - if ( geometryAttribute.isInterleavedBufferAttribute ) { + shadowMaterialVertical.needsUpdate = true; + shadowMaterialHorizontal.needsUpdate = true; - var data = geometryAttribute.data; - var stride = data.stride; - var offset = geometryAttribute.offset; + } - if ( data && data.isInstancedInterleavedBuffer ) { + if ( shadow.mapPass === null ) { - state.enableAttributeAndDivisor( programAttribute, data.meshPerAttribute ); + shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y ); - if ( geometry.maxInstancedCount === undefined ) { + } - geometry.maxInstancedCount = data.meshPerAttribute * data.count; + // vertical pass - } + shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture; + shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize; + shadowMaterialVertical.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget( shadow.mapPass ); + _renderer.clear(); + _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null ); - } else { + // horizontal pass - state.enableAttribute( programAttribute ); + shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture; + shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize; + shadowMaterialHorizontal.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget( shadow.map ); + _renderer.clear(); + _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null ); - } + } - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); - _gl.vertexAttribPointer( programAttribute, size, type, normalized, stride * bytesPerElement, ( startIndex * stride + offset ) * bytesPerElement ); + function getDepthMaterial( object, material, light, type ) { - } else { + let result = null; - if ( geometryAttribute.isInstancedBufferAttribute ) { + const customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial; - state.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute ); + if ( customMaterial !== undefined ) { - if ( geometry.maxInstancedCount === undefined ) { + result = customMaterial; - geometry.maxInstancedCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; + } else { - } + result = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial; - } else { + if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) || + ( material.displacementMap && material.displacementScale !== 0 ) || + ( material.alphaMap && material.alphaTest > 0 ) || + ( material.map && material.alphaTest > 0 ) ) { - state.enableAttribute( programAttribute ); + // in this case we need a unique material instance reflecting the + // appropriate state - } + const keyA = result.uuid, keyB = material.uuid; - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); - _gl.vertexAttribPointer( programAttribute, size, type, normalized, 0, startIndex * size * bytesPerElement ); + let materialsForVariant = _materialCache[ keyA ]; - } + if ( materialsForVariant === undefined ) { - } else if ( materialDefaultAttributeValues !== undefined ) { + materialsForVariant = {}; + _materialCache[ keyA ] = materialsForVariant; - var value = materialDefaultAttributeValues[ name ]; + } - if ( value !== undefined ) { + let cachedMaterial = materialsForVariant[ keyB ]; - switch ( value.length ) { + if ( cachedMaterial === undefined ) { - case 2: - _gl.vertexAttrib2fv( programAttribute, value ); - break; + cachedMaterial = result.clone(); + materialsForVariant[ keyB ] = cachedMaterial; - case 3: - _gl.vertexAttrib3fv( programAttribute, value ); - break; + } - case 4: - _gl.vertexAttrib4fv( programAttribute, value ); - break; + result = cachedMaterial; - default: - _gl.vertexAttrib1fv( programAttribute, value ); + } - } + } - } + result.visible = material.visible; + result.wireframe = material.wireframe; - } + if ( type === VSMShadowMap ) { - } + result.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side; + + } else { + + result.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ]; } - state.disableUnusedAttributes(); + result.alphaMap = material.alphaMap; + result.alphaTest = material.alphaTest; + result.map = material.map; - } + result.clipShadows = material.clipShadows; + result.clippingPlanes = material.clippingPlanes; + result.clipIntersection = material.clipIntersection; - // Compile + result.displacementMap = material.displacementMap; + result.displacementScale = material.displacementScale; + result.displacementBias = material.displacementBias; - this.compile = function ( scene, camera ) { + result.wireframeLinewidth = material.wireframeLinewidth; + result.linewidth = material.linewidth; - lights = []; + if ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) { - scene.traverse( function ( object ) { + const materialProperties = _renderer.properties.get( result ); + materialProperties.light = light; - if ( object.isLight ) { + } - lights.push( object ); + return result; - } + } - } ); + function renderObject( object, camera, shadowCamera, light, type ) { - setupLights( lights, camera ); + if ( object.visible === false ) return; - scene.traverse( function ( object ) { + const visible = object.layers.test( camera.layers ); - if ( object.material ) { + if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) { - if ( Array.isArray( object.material ) ) { + if ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) { - for ( var i = 0; i < object.material.length; i ++ ) { + object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); - initMaterial( object.material[ i ], scene.fog, object ); + const geometry = _objects.update( object ); + const material = object.material; - } + if ( Array.isArray( material ) ) { - } else { + const groups = geometry.groups; - initMaterial( object.material, scene.fog, object ); + for ( let k = 0, kl = groups.length; k < kl; k ++ ) { - } + const group = groups[ k ]; + const groupMaterial = material[ group.materialIndex ]; - } + if ( groupMaterial && groupMaterial.visible ) { - } ); + const depthMaterial = getDepthMaterial( object, groupMaterial, light, type ); - }; + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group ); - // Rendering + } - this.animate = function ( callback ) { + } - function onFrame() { + } else if ( material.visible ) { - callback(); + const depthMaterial = getDepthMaterial( object, material, light, type ); - ( vr.getDevice() || window ).requestAnimationFrame( onFrame ); + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null ); - } + } - ( vr.getDevice() || window ).requestAnimationFrame( onFrame ); + } - }; + } - this.render = function ( scene, camera, renderTarget, forceClear ) { + const children = object.children; - if ( ! ( camera && camera.isCamera ) ) { + for ( let i = 0, l = children.length; i < l; i ++ ) { - console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); - return; + renderObject( children[ i ], camera, shadowCamera, light, type ); } - // reset caching for this frame + } - _currentGeometryProgram = ''; - _currentMaterialId = - 1; - _currentCamera = null; + } - // update scene graph + function WebGLState( gl, extensions, capabilities ) { - if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); + const isWebGL2 = capabilities.isWebGL2; - // update camera matrices and frustum + function ColorBuffer() { - if ( camera.parent === null ) camera.updateMatrixWorld(); + let locked = false; - if ( vr.enabled ) { + const color = new Vector4(); + let currentColorMask = null; + const currentColorClear = new Vector4( 0, 0, 0, 0 ); - camera = vr.getCamera( camera ); + return { - } + setMask: function ( colorMask ) { - _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); + if ( currentColorMask !== colorMask && ! locked ) { - lights.length = 0; - sprites.length = 0; - lensFlares.length = 0; + gl.colorMask( colorMask, colorMask, colorMask, colorMask ); + currentColorMask = colorMask; - _localClippingEnabled = this.localClippingEnabled; - _clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); + } - currentRenderList = renderLists.get( scene, camera ); - currentRenderList.init(); + }, - projectObject( scene, camera, _this.sortObjects ); + setLocked: function ( lock ) { - currentRenderList.finish(); + locked = lock; - if ( _this.sortObjects === true ) { + }, - currentRenderList.sort(); + setClear: function ( r, g, b, a, premultipliedAlpha ) { - } + if ( premultipliedAlpha === true ) { - // + r *= a; g *= a; b *= a; - if ( _clippingEnabled ) _clipping.beginShadows(); + } - setupShadows( lights ); + color.set( r, g, b, a ); - shadowMap.render( scene, camera ); + if ( currentColorClear.equals( color ) === false ) { - setupLights( lights, camera ); + gl.clearColor( r, g, b, a ); + currentColorClear.copy( color ); - if ( _clippingEnabled ) _clipping.endShadows(); + } - // + }, - _infoRender.frame ++; - _infoRender.calls = 0; - _infoRender.vertices = 0; - _infoRender.faces = 0; - _infoRender.points = 0; + reset: function () { - if ( renderTarget === undefined ) { + locked = false; - renderTarget = null; + currentColorMask = null; + currentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state - } + } - this.setRenderTarget( renderTarget ); + }; - // + } - background.render( scene, camera, forceClear ); + function DepthBuffer() { - // render scene + let locked = false; - var opaqueObjects = currentRenderList.opaque; - var transparentObjects = currentRenderList.transparent; + let currentDepthMask = null; + let currentDepthFunc = null; + let currentDepthClear = null; - if ( scene.overrideMaterial ) { + return { - var overrideMaterial = scene.overrideMaterial; + setTest: function ( depthTest ) { - if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera, overrideMaterial ); - if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera, overrideMaterial ); + if ( depthTest ) { - } else { + enable( gl.DEPTH_TEST ); - // opaque pass (front-to-back order) + } else { - if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera ); + disable( gl.DEPTH_TEST ); - // transparent pass (back-to-front order) + } - if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera ); + }, - } + setMask: function ( depthMask ) { - // custom render plugins (post pass) + if ( currentDepthMask !== depthMask && ! locked ) { - spritePlugin.render( scene, camera ); - lensFlarePlugin.render( scene, camera, _currentViewport ); + gl.depthMask( depthMask ); + currentDepthMask = depthMask; - // Generate mipmap if we're using any kind of mipmap filtering + } - if ( renderTarget ) { + }, - textures.updateRenderTargetMipmap( renderTarget ); + setFunc: function ( depthFunc ) { - } + if ( currentDepthFunc !== depthFunc ) { - // Ensure depth buffer writing is enabled so it can be cleared on next render + switch ( depthFunc ) { - state.buffers.depth.setTest( true ); - state.buffers.depth.setMask( true ); - state.buffers.color.setMask( true ); + case NeverDepth: - if ( camera.isArrayCamera ) { + gl.depthFunc( gl.NEVER ); + break; - _this.setScissorTest( false ); + case AlwaysDepth: - } + gl.depthFunc( gl.ALWAYS ); + break; - if ( vr.enabled ) { + case LessDepth: - vr.submitFrame(); + gl.depthFunc( gl.LESS ); + break; - } + case LessEqualDepth: - // _gl.finish(); + gl.depthFunc( gl.LEQUAL ); + break; - }; + case EqualDepth: - /* - // TODO Duplicated code (Frustum) + gl.depthFunc( gl.EQUAL ); + break; - var _sphere = new Sphere(); + case GreaterEqualDepth: - function isObjectViewable( object ) { + gl.depthFunc( gl.GEQUAL ); + break; - var geometry = object.geometry; + case GreaterDepth: - if ( geometry.boundingSphere === null ) - geometry.computeBoundingSphere(); + gl.depthFunc( gl.GREATER ); + break; - _sphere.copy( geometry.boundingSphere ). - applyMatrix4( object.matrixWorld ); + case NotEqualDepth: - return isSphereViewable( _sphere ); + gl.depthFunc( gl.NOTEQUAL ); + break; - } + default: - function isSpriteViewable( sprite ) { + gl.depthFunc( gl.LEQUAL ); - _sphere.center.set( 0, 0, 0 ); - _sphere.radius = 0.7071067811865476; - _sphere.applyMatrix4( sprite.matrixWorld ); + } - return isSphereViewable( _sphere ); + currentDepthFunc = depthFunc; - } + } - function isSphereViewable( sphere ) { + }, - if ( ! _frustum.intersectsSphere( sphere ) ) return false; + setLocked: function ( lock ) { - var numPlanes = _clipping.numPlanes; + locked = lock; - if ( numPlanes === 0 ) return true; + }, - var planes = _this.clippingPlanes, + setClear: function ( depth ) { - center = sphere.center, - negRad = - sphere.radius, - i = 0; + if ( currentDepthClear !== depth ) { - do { + gl.clearDepth( depth ); + currentDepthClear = depth; - // out when deeper than radius in the negative halfspace - if ( planes[ i ].distanceToPoint( center ) < negRad ) return false; + } - } while ( ++ i !== numPlanes ); + }, - return true; + reset: function () { - } - */ + locked = false; - function projectObject( object, camera, sortObjects ) { + currentDepthMask = null; + currentDepthFunc = null; + currentDepthClear = null; - if ( ! object.visible ) return; + } - var visible = object.layers.test( camera.layers ); + }; - if ( visible ) { + } - if ( object.isLight ) { + function StencilBuffer() { - lights.push( object ); + let locked = false; - } else if ( object.isSprite ) { + let currentStencilMask = null; + let currentStencilFunc = null; + let currentStencilRef = null; + let currentStencilFuncMask = null; + let currentStencilFail = null; + let currentStencilZFail = null; + let currentStencilZPass = null; + let currentStencilClear = null; - if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) { + return { - sprites.push( object ); + setTest: function ( stencilTest ) { - } + if ( ! locked ) { - } else if ( object.isLensFlare ) { + if ( stencilTest ) { - lensFlares.push( object ); + enable( gl.STENCIL_TEST ); - } else if ( object.isImmediateRenderObject ) { + } else { - if ( sortObjects ) { + disable( gl.STENCIL_TEST ); - _vector3.setFromMatrixPosition( object.matrixWorld ) - .applyMatrix4( _projScreenMatrix ); + } } - currentRenderList.push( object, null, object.material, _vector3.z, null ); + }, - } else if ( object.isMesh || object.isLine || object.isPoints ) { + setMask: function ( stencilMask ) { - if ( object.isSkinnedMesh ) { + if ( currentStencilMask !== stencilMask && ! locked ) { - object.skeleton.update(); + gl.stencilMask( stencilMask ); + currentStencilMask = stencilMask; } - if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { + }, - if ( sortObjects ) { + setFunc: function ( stencilFunc, stencilRef, stencilMask ) { - _vector3.setFromMatrixPosition( object.matrixWorld ) - .applyMatrix4( _projScreenMatrix ); + if ( currentStencilFunc !== stencilFunc || + currentStencilRef !== stencilRef || + currentStencilFuncMask !== stencilMask ) { - } + gl.stencilFunc( stencilFunc, stencilRef, stencilMask ); - var geometry = objects.update( object ); - var material = object.material; + currentStencilFunc = stencilFunc; + currentStencilRef = stencilRef; + currentStencilFuncMask = stencilMask; - if ( Array.isArray( material ) ) { + } - var groups = geometry.groups; + }, - for ( var i = 0, l = groups.length; i < l; i ++ ) { + setOp: function ( stencilFail, stencilZFail, stencilZPass ) { - var group = groups[ i ]; - var groupMaterial = material[ group.materialIndex ]; + if ( currentStencilFail !== stencilFail || + currentStencilZFail !== stencilZFail || + currentStencilZPass !== stencilZPass ) { - if ( groupMaterial && groupMaterial.visible ) { + gl.stencilOp( stencilFail, stencilZFail, stencilZPass ); - currentRenderList.push( object, geometry, groupMaterial, _vector3.z, group ); + currentStencilFail = stencilFail; + currentStencilZFail = stencilZFail; + currentStencilZPass = stencilZPass; - } + } - } + }, - } else if ( material.visible ) { + setLocked: function ( lock ) { - currentRenderList.push( object, geometry, material, _vector3.z, null ); + locked = lock; - } + }, - } + setClear: function ( stencil ) { - } + if ( currentStencilClear !== stencil ) { - } + gl.clearStencil( stencil ); + currentStencilClear = stencil; - var children = object.children; + } - for ( var i = 0, l = children.length; i < l; i ++ ) { + }, - projectObject( children[ i ], camera, sortObjects ); + reset: function () { - } + locked = false; - } + currentStencilMask = null; + currentStencilFunc = null; + currentStencilRef = null; + currentStencilFuncMask = null; + currentStencilFail = null; + currentStencilZFail = null; + currentStencilZPass = null; + currentStencilClear = null; - function renderObjects( renderList, scene, camera, overrideMaterial ) { + } - for ( var i = 0, l = renderList.length; i < l; i ++ ) { + }; - var renderItem = renderList[ i ]; + } - var object = renderItem.object; - var geometry = renderItem.geometry; - var material = overrideMaterial === undefined ? renderItem.material : overrideMaterial; - var group = renderItem.group; + // - if ( camera.isArrayCamera ) { + const colorBuffer = new ColorBuffer(); + const depthBuffer = new DepthBuffer(); + const stencilBuffer = new StencilBuffer(); - _currentArrayCamera = camera; + const uboBindings = new WeakMap(); + const uboProgramMap = new WeakMap(); - var cameras = camera.cameras; + let enabledCapabilities = {}; - for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { + let currentBoundFramebuffers = {}; + let currentDrawbuffers = new WeakMap(); + let defaultDrawbuffers = []; - var camera2 = cameras[ j ]; + let currentProgram = null; - if ( object.layers.test( camera2.layers ) ) { + let currentBlendingEnabled = false; + let currentBlending = null; + let currentBlendEquation = null; + let currentBlendSrc = null; + let currentBlendDst = null; + let currentBlendEquationAlpha = null; + let currentBlendSrcAlpha = null; + let currentBlendDstAlpha = null; + let currentPremultipledAlpha = false; - var bounds = camera2.bounds; + let currentFlipSided = null; + let currentCullFace = null; - var x = bounds.x * _width; - var y = bounds.y * _height; - var width = bounds.z * _width; - var height = bounds.w * _height; + let currentLineWidth = null; - _this.setViewport( x, y, width, height ); - _this.setScissor( x, y, width, height ); - _this.setScissorTest( true ); + let currentPolygonOffsetFactor = null; + let currentPolygonOffsetUnits = null; - renderObject( object, scene, camera2, geometry, material, group ); + const maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS ); - } + let lineWidthAvailable = false; + let version = 0; + const glVersion = gl.getParameter( gl.VERSION ); - } + if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) { - } else { + version = parseFloat( /^WebGL (\d)/.exec( glVersion )[ 1 ] ); + lineWidthAvailable = ( version >= 1.0 ); - _currentArrayCamera = null; + } else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) { - renderObject( object, scene, camera, geometry, material, group ); + version = parseFloat( /^OpenGL ES (\d)/.exec( glVersion )[ 1 ] ); + lineWidthAvailable = ( version >= 2.0 ); - } + } - } + let currentTextureSlot = null; + let currentBoundTextures = {}; - } + const scissorParam = gl.getParameter( gl.SCISSOR_BOX ); + const viewportParam = gl.getParameter( gl.VIEWPORT ); - function renderObject( object, scene, camera, geometry, material, group ) { + const currentScissor = new Vector4().fromArray( scissorParam ); + const currentViewport = new Vector4().fromArray( viewportParam ); - object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); - object.normalMatrix.getNormalMatrix( object.modelViewMatrix ); + function createTexture( type, target, count, dimensions ) { - object.onBeforeRender( _this, scene, camera, geometry, material, group ); + const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4. + const texture = gl.createTexture(); - if ( object.isImmediateRenderObject ) { + gl.bindTexture( type, texture ); + gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + gl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); - state.setMaterial( material ); + for ( let i = 0; i < count; i ++ ) { - var program = setProgram( camera, scene.fog, material, object ); + if ( isWebGL2 && ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) ) { - _currentGeometryProgram = ''; + gl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data ); - renderObjectImmediate( object, program, material ); + } else { - } else { + gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data ); - _this.renderBufferDirect( camera, scene.fog, geometry, material, object, group ); + } } - object.onAfterRender( _this, scene, camera, geometry, material, group ); + return texture; } - function initMaterial( material, fog, object ) { + const emptyTextures = {}; + emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 ); + emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 ); - var materialProperties = properties.get( material ); + if ( isWebGL2 ) { - var parameters = programCache.getParameters( - material, _lights, fog, _clipping.numPlanes, _clipping.numIntersection, object ); + emptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 ); + emptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 ); - var code = programCache.getProgramCode( material, parameters ); + } - var program = materialProperties.program; - var programChange = true; + // init - if ( program === undefined ) { + colorBuffer.setClear( 0, 0, 0, 1 ); + depthBuffer.setClear( 1 ); + stencilBuffer.setClear( 0 ); - // new material - material.addEventListener( 'dispose', onMaterialDispose ); + enable( gl.DEPTH_TEST ); + depthBuffer.setFunc( LessEqualDepth ); - } else if ( program.code !== code ) { + setFlipSided( false ); + setCullFace( CullFaceBack ); + enable( gl.CULL_FACE ); - // changed glsl or parameters - releaseMaterialProgramReference( material ); + setBlending( NoBlending ); - } else if ( parameters.shaderID !== undefined ) { + // - // same glsl and uniform list - return; + function enable( id ) { - } else { + if ( enabledCapabilities[ id ] !== true ) { - // only rebuild uniform list - programChange = false; + gl.enable( id ); + enabledCapabilities[ id ] = true; } - if ( programChange ) { + } - if ( parameters.shaderID ) { + function disable( id ) { - var shader = ShaderLib[ parameters.shaderID ]; + if ( enabledCapabilities[ id ] !== false ) { - materialProperties.shader = { - name: material.type, - uniforms: UniformsUtils.clone( shader.uniforms ), - vertexShader: shader.vertexShader, - fragmentShader: shader.fragmentShader - }; + gl.disable( id ); + enabledCapabilities[ id ] = false; - } else { + } - materialProperties.shader = { - name: material.type, - uniforms: material.uniforms, - vertexShader: material.vertexShader, - fragmentShader: material.fragmentShader - }; + } - } + function bindFramebuffer( target, framebuffer ) { - material.onBeforeCompile( materialProperties.shader ); + if ( currentBoundFramebuffers[ target ] !== framebuffer ) { - program = programCache.acquireProgram( material, materialProperties.shader, parameters, code ); + gl.bindFramebuffer( target, framebuffer ); - materialProperties.program = program; - material.program = program; + currentBoundFramebuffers[ target ] = framebuffer; - } + if ( isWebGL2 ) { - var programAttributes = program.getAttributes(); + // gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER - if ( material.morphTargets ) { + if ( target === gl.DRAW_FRAMEBUFFER ) { - material.numSupportedMorphTargets = 0; + currentBoundFramebuffers[ gl.FRAMEBUFFER ] = framebuffer; - for ( var i = 0; i < _this.maxMorphTargets; i ++ ) { + } - if ( programAttributes[ 'morphTarget' + i ] >= 0 ) { + if ( target === gl.FRAMEBUFFER ) { - material.numSupportedMorphTargets ++; + currentBoundFramebuffers[ gl.DRAW_FRAMEBUFFER ] = framebuffer; } } - } + return true; - if ( material.morphNormals ) { + } - material.numSupportedMorphNormals = 0; + return false; - for ( var i = 0; i < _this.maxMorphNormals; i ++ ) { + } - if ( programAttributes[ 'morphNormal' + i ] >= 0 ) { + function drawBuffers( renderTarget, framebuffer ) { - material.numSupportedMorphNormals ++; + let drawBuffers = defaultDrawbuffers; - } + let needsUpdate = false; - } + if ( renderTarget ) { - } + drawBuffers = currentDrawbuffers.get( framebuffer ); - var uniforms = materialProperties.shader.uniforms; + if ( drawBuffers === undefined ) { - if ( ! material.isShaderMaterial && - ! material.isRawShaderMaterial || - material.clipping === true ) { + drawBuffers = []; + currentDrawbuffers.set( framebuffer, drawBuffers ); - materialProperties.numClippingPlanes = _clipping.numPlanes; - materialProperties.numIntersection = _clipping.numIntersection; - uniforms.clippingPlanes = _clipping.uniform; + } - } + if ( renderTarget.isWebGLMultipleRenderTargets ) { - materialProperties.fog = fog; + const textures = renderTarget.texture; - // store the light setup it was created for + if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) { - materialProperties.lightsHash = _lights.hash; + for ( let i = 0, il = textures.length; i < il; i ++ ) { - if ( material.lights ) { + drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i; - // wire up the material to this renderer's lighting state + } - uniforms.ambientLightColor.value = _lights.ambient; - uniforms.directionalLights.value = _lights.directional; - uniforms.spotLights.value = _lights.spot; - uniforms.rectAreaLights.value = _lights.rectArea; - uniforms.pointLights.value = _lights.point; - uniforms.hemisphereLights.value = _lights.hemi; + drawBuffers.length = textures.length; - uniforms.directionalShadowMap.value = _lights.directionalShadowMap; - uniforms.directionalShadowMatrix.value = _lights.directionalShadowMatrix; - uniforms.spotShadowMap.value = _lights.spotShadowMap; - uniforms.spotShadowMatrix.value = _lights.spotShadowMatrix; - uniforms.pointShadowMap.value = _lights.pointShadowMap; - uniforms.pointShadowMatrix.value = _lights.pointShadowMatrix; - // TODO (abelnation): add area lights shadow info to uniforms + needsUpdate = true; - } + } - var progUniforms = materialProperties.program.getUniforms(), - uniformsList = - WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); + } else { - materialProperties.uniformsList = uniformsList; + if ( drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) { - } + drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0; - function setProgram( camera, fog, material, object ) { + needsUpdate = true; - _usedTextureUnits = 0; + } - var materialProperties = properties.get( material ); + } - if ( _clippingEnabled ) { + } else { - if ( _localClippingEnabled || camera !== _currentCamera ) { + if ( drawBuffers[ 0 ] !== gl.BACK ) { - var useCache = - camera === _currentCamera && - material.id === _currentMaterialId; + drawBuffers[ 0 ] = gl.BACK; - // we might want to call this function with some ClippingGroup - // object instead of the material, once it becomes feasible - // (#8465, #8379) - _clipping.setState( - material.clippingPlanes, material.clipIntersection, material.clipShadows, - camera, materialProperties, useCache ); + needsUpdate = true; } } - if ( material.needsUpdate === false ) { - - if ( materialProperties.program === undefined ) { - - material.needsUpdate = true; - - } else if ( material.fog && materialProperties.fog !== fog ) { - - material.needsUpdate = true; + if ( needsUpdate ) { - } else if ( material.lights && materialProperties.lightsHash !== _lights.hash ) { + if ( capabilities.isWebGL2 ) { - material.needsUpdate = true; + gl.drawBuffers( drawBuffers ); - } else if ( materialProperties.numClippingPlanes !== undefined && - ( materialProperties.numClippingPlanes !== _clipping.numPlanes || - materialProperties.numIntersection !== _clipping.numIntersection ) ) { + } else { - material.needsUpdate = true; + extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers ); } } - if ( material.needsUpdate ) { - - initMaterial( material, fog, object ); - material.needsUpdate = false; - - } - - var refreshProgram = false; - var refreshMaterial = false; - var refreshLights = false; - - var program = materialProperties.program, - p_uniforms = program.getUniforms(), - m_uniforms = materialProperties.shader.uniforms; - - if ( program.id !== _currentProgram ) { - _gl.useProgram( program.program ); - _currentProgram = program.id; + } - refreshProgram = true; - refreshMaterial = true; - refreshLights = true; + function useProgram( program ) { - } + if ( currentProgram !== program ) { - if ( material.id !== _currentMaterialId ) { + gl.useProgram( program ); - _currentMaterialId = material.id; + currentProgram = program; - refreshMaterial = true; + return true; } - if ( refreshProgram || camera !== _currentCamera ) { - - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + return false; - if ( capabilities.logarithmicDepthBuffer ) { + } - p_uniforms.setValue( _gl, 'logDepthBufFC', - 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); + const equationToGL = { + [ AddEquation ]: gl.FUNC_ADD, + [ SubtractEquation ]: gl.FUNC_SUBTRACT, + [ ReverseSubtractEquation ]: gl.FUNC_REVERSE_SUBTRACT + }; - } + if ( isWebGL2 ) { - // Avoid unneeded uniform updates per ArrayCamera's sub-camera + equationToGL[ MinEquation ] = gl.MIN; + equationToGL[ MaxEquation ] = gl.MAX; - if ( _currentCamera !== ( _currentArrayCamera || camera ) ) { + } else { - _currentCamera = ( _currentArrayCamera || camera ); + const extension = extensions.get( 'EXT_blend_minmax' ); - // lighting uniforms depend on the camera so enforce an update - // now, in case this material supports lights - or later, when - // the next material that does gets activated: + if ( extension !== null ) { - refreshMaterial = true; // set to true on material change - refreshLights = true; // remains set until update done + equationToGL[ MinEquation ] = extension.MIN_EXT; + equationToGL[ MaxEquation ] = extension.MAX_EXT; - } + } - // load material specific uniforms - // (shader material also gets them for the sake of genericity) + } - if ( material.isShaderMaterial || - material.isMeshPhongMaterial || - material.isMeshStandardMaterial || - material.envMap ) { + const factorToGL = { + [ ZeroFactor ]: gl.ZERO, + [ OneFactor ]: gl.ONE, + [ SrcColorFactor ]: gl.SRC_COLOR, + [ SrcAlphaFactor ]: gl.SRC_ALPHA, + [ SrcAlphaSaturateFactor ]: gl.SRC_ALPHA_SATURATE, + [ DstColorFactor ]: gl.DST_COLOR, + [ DstAlphaFactor ]: gl.DST_ALPHA, + [ OneMinusSrcColorFactor ]: gl.ONE_MINUS_SRC_COLOR, + [ OneMinusSrcAlphaFactor ]: gl.ONE_MINUS_SRC_ALPHA, + [ OneMinusDstColorFactor ]: gl.ONE_MINUS_DST_COLOR, + [ OneMinusDstAlphaFactor ]: gl.ONE_MINUS_DST_ALPHA + }; - var uCamPos = p_uniforms.map.cameraPosition; + function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) { - if ( uCamPos !== undefined ) { + if ( blending === NoBlending ) { - uCamPos.setValue( _gl, - _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + if ( currentBlendingEnabled === true ) { - } + disable( gl.BLEND ); + currentBlendingEnabled = false; } - if ( material.isMeshPhongMaterial || - material.isMeshLambertMaterial || - material.isMeshBasicMaterial || - material.isMeshStandardMaterial || - material.isShaderMaterial || - material.skinning ) { + return; - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + } - } + if ( currentBlendingEnabled === false ) { - } + enable( gl.BLEND ); + currentBlendingEnabled = true; - // skinning uniforms must be set even if material didn't change - // auto-setting of texture unit for bone texture must go before other textures - // not sure why, but otherwise weird things happen + } - if ( material.skinning ) { + if ( blending !== CustomBlending ) { - p_uniforms.setOptional( _gl, object, 'bindMatrix' ); - p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' ); + if ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) { - var skeleton = object.skeleton; + if ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) { - if ( skeleton ) { + gl.blendEquation( gl.FUNC_ADD ); - var bones = skeleton.bones; + currentBlendEquation = AddEquation; + currentBlendEquationAlpha = AddEquation; - if ( capabilities.floatVertexTextures ) { + } - if ( skeleton.boneTexture === undefined ) { + if ( premultipliedAlpha ) { - // layout (1 matrix = 4 pixels) - // RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4) - // with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8) - // 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16) - // 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32) - // 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64) + switch ( blending ) { + case NormalBlending: + gl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + break; - var size = Math.sqrt( bones.length * 4 ); // 4 pixels needed for 1 matrix - size = _Math.nextPowerOfTwo( Math.ceil( size ) ); - size = Math.max( size, 4 ); + case AdditiveBlending: + gl.blendFunc( gl.ONE, gl.ONE ); + break; - var boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel - boneMatrices.set( skeleton.boneMatrices ); // copy current values + case SubtractiveBlending: + gl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE ); + break; - var boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType ); + case MultiplyBlending: + gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); + break; - skeleton.boneMatrices = boneMatrices; - skeleton.boneTexture = boneTexture; - skeleton.boneTextureSize = size; + default: + console.error( 'THREE.WebGLState: Invalid blending: ', blending ); + break; } - p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture ); - p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); - } else { - p_uniforms.setOptional( _gl, skeleton, 'boneMatrices' ); + switch ( blending ) { - } + case NormalBlending: + gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + break; - } + case AdditiveBlending: + gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); + break; - } + case SubtractiveBlending: + gl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE ); + break; - if ( refreshMaterial ) { + case MultiplyBlending: + gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); + break; - p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure ); - p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint ); + default: + console.error( 'THREE.WebGLState: Invalid blending: ', blending ); + break; - if ( material.lights ) { + } - // the current material requires lighting info + } - // note: all lighting uniforms are always set correctly - // they simply reference the renderer's state for their - // values - // - // use the current material's .needsUpdate flags to set - // the GL state when required + currentBlendSrc = null; + currentBlendDst = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; - markUniformsLightsNeedsUpdate( m_uniforms, refreshLights ); + currentBlending = blending; + currentPremultipledAlpha = premultipliedAlpha; } - // refresh uniforms common to several materials + return; - if ( fog && material.fog ) { + } - refreshUniformsFog( m_uniforms, fog ); + // custom blending - } + blendEquationAlpha = blendEquationAlpha || blendEquation; + blendSrcAlpha = blendSrcAlpha || blendSrc; + blendDstAlpha = blendDstAlpha || blendDst; - if ( material.isMeshBasicMaterial || - material.isMeshLambertMaterial || - material.isMeshPhongMaterial || - material.isMeshStandardMaterial || - material.isMeshNormalMaterial || - material.isMeshDepthMaterial ) { + if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) { - refreshUniformsCommon( m_uniforms, material ); + gl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] ); - } + currentBlendEquation = blendEquation; + currentBlendEquationAlpha = blendEquationAlpha; - // refresh single material specific uniforms + } - if ( material.isLineBasicMaterial ) { + if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) { - refreshUniformsLine( m_uniforms, material ); + gl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] ); - } else if ( material.isLineDashedMaterial ) { + currentBlendSrc = blendSrc; + currentBlendDst = blendDst; + currentBlendSrcAlpha = blendSrcAlpha; + currentBlendDstAlpha = blendDstAlpha; - refreshUniformsLine( m_uniforms, material ); - refreshUniformsDash( m_uniforms, material ); + } - } else if ( material.isPointsMaterial ) { + currentBlending = blending; + currentPremultipledAlpha = false; - refreshUniformsPoints( m_uniforms, material ); + } - } else if ( material.isMeshLambertMaterial ) { + function setMaterial( material, frontFaceCW ) { - refreshUniformsLambert( m_uniforms, material ); + material.side === DoubleSide + ? disable( gl.CULL_FACE ) + : enable( gl.CULL_FACE ); - } else if ( material.isMeshToonMaterial ) { + let flipSided = ( material.side === BackSide ); + if ( frontFaceCW ) flipSided = ! flipSided; - refreshUniformsToon( m_uniforms, material ); + setFlipSided( flipSided ); - } else if ( material.isMeshPhongMaterial ) { + ( material.blending === NormalBlending && material.transparent === false ) + ? setBlending( NoBlending ) + : setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ); - refreshUniformsPhong( m_uniforms, material ); + depthBuffer.setFunc( material.depthFunc ); + depthBuffer.setTest( material.depthTest ); + depthBuffer.setMask( material.depthWrite ); + colorBuffer.setMask( material.colorWrite ); - } else if ( material.isMeshPhysicalMaterial ) { + const stencilWrite = material.stencilWrite; + stencilBuffer.setTest( stencilWrite ); + if ( stencilWrite ) { - refreshUniformsPhysical( m_uniforms, material ); + stencilBuffer.setMask( material.stencilWriteMask ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask ); + stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); - } else if ( material.isMeshStandardMaterial ) { + } - refreshUniformsStandard( m_uniforms, material ); + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - } else if ( material.isMeshDepthMaterial ) { + material.alphaToCoverage === true + ? enable( gl.SAMPLE_ALPHA_TO_COVERAGE ) + : disable( gl.SAMPLE_ALPHA_TO_COVERAGE ); - if ( material.displacementMap ) { + } - m_uniforms.displacementMap.value = material.displacementMap; - m_uniforms.displacementScale.value = material.displacementScale; - m_uniforms.displacementBias.value = material.displacementBias; + // - } + function setFlipSided( flipSided ) { - } else if ( material.isMeshNormalMaterial ) { + if ( currentFlipSided !== flipSided ) { - refreshUniformsNormal( m_uniforms, material ); + if ( flipSided ) { - } + gl.frontFace( gl.CW ); + + } else { - // RectAreaLight Texture - // TODO (mrdoob): Find a nicer implementation + gl.frontFace( gl.CCW ); - if ( m_uniforms.ltcMat !== undefined ) m_uniforms.ltcMat.value = UniformsLib.LTC_MAT_TEXTURE; - if ( m_uniforms.ltcMag !== undefined ) m_uniforms.ltcMag.value = UniformsLib.LTC_MAG_TEXTURE; + } - WebGLUniforms.upload( - _gl, materialProperties.uniformsList, m_uniforms, _this ); + currentFlipSided = flipSided; } + } - // common matrices + function setCullFace( cullFace ) { - p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); - p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); - p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); + if ( cullFace !== CullFaceNone ) { - return program; + enable( gl.CULL_FACE ); - } + if ( cullFace !== currentCullFace ) { - // Uniforms (refresh uniforms objects) + if ( cullFace === CullFaceBack ) { - function refreshUniformsCommon( uniforms, material ) { + gl.cullFace( gl.BACK ); - uniforms.opacity.value = material.opacity; + } else if ( cullFace === CullFaceFront ) { - uniforms.diffuse.value = material.color; + gl.cullFace( gl.FRONT ); - if ( material.emissive ) { + } else { - uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); + gl.cullFace( gl.FRONT_AND_BACK ); - } + } - uniforms.map.value = material.map; - uniforms.specularMap.value = material.specularMap; - uniforms.alphaMap.value = material.alphaMap; + } - if ( material.lightMap ) { + } else { - uniforms.lightMap.value = material.lightMap; - uniforms.lightMapIntensity.value = material.lightMapIntensity; + disable( gl.CULL_FACE ); } - if ( material.aoMap ) { + currentCullFace = cullFace; - uniforms.aoMap.value = material.aoMap; - uniforms.aoMapIntensity.value = material.aoMapIntensity; + } - } + function setLineWidth( width ) { + + if ( width !== currentLineWidth ) { - // uv repeat and offset setting priorities - // 1. color map - // 2. specular map - // 3. normal map - // 4. bump map - // 5. alpha map - // 6. emissive map + if ( lineWidthAvailable ) gl.lineWidth( width ); - var uvScaleMap; + currentLineWidth = width; - if ( material.map ) { + } - uvScaleMap = material.map; + } - } else if ( material.specularMap ) { + function setPolygonOffset( polygonOffset, factor, units ) { - uvScaleMap = material.specularMap; + if ( polygonOffset ) { - } else if ( material.displacementMap ) { + enable( gl.POLYGON_OFFSET_FILL ); - uvScaleMap = material.displacementMap; + if ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) { - } else if ( material.normalMap ) { + gl.polygonOffset( factor, units ); - uvScaleMap = material.normalMap; + currentPolygonOffsetFactor = factor; + currentPolygonOffsetUnits = units; - } else if ( material.bumpMap ) { + } - uvScaleMap = material.bumpMap; + } else { - } else if ( material.roughnessMap ) { + disable( gl.POLYGON_OFFSET_FILL ); - uvScaleMap = material.roughnessMap; + } - } else if ( material.metalnessMap ) { + } - uvScaleMap = material.metalnessMap; + function setScissorTest( scissorTest ) { - } else if ( material.alphaMap ) { + if ( scissorTest ) { - uvScaleMap = material.alphaMap; + enable( gl.SCISSOR_TEST ); - } else if ( material.emissiveMap ) { + } else { - uvScaleMap = material.emissiveMap; + disable( gl.SCISSOR_TEST ); } - if ( uvScaleMap !== undefined ) { + } - // backwards compatibility - if ( uvScaleMap.isWebGLRenderTarget ) { + // texture - uvScaleMap = uvScaleMap.texture; + function activeTexture( webglSlot ) { - } + if ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1; - var offset = uvScaleMap.offset; - var repeat = uvScaleMap.repeat; + if ( currentTextureSlot !== webglSlot ) { - uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y ); + gl.activeTexture( webglSlot ); + currentTextureSlot = webglSlot; } - uniforms.envMap.value = material.envMap; + } - // don't flip CubeTexture envMaps, flip everything else: - // WebGLRenderTargetCube will be flipped for backwards compatibility - // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture - // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future - uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1; + function bindTexture( webglType, webglTexture, webglSlot ) { - uniforms.reflectivity.value = material.reflectivity; - uniforms.refractionRatio.value = material.refractionRatio; + if ( webglSlot === undefined ) { - } + if ( currentTextureSlot === null ) { - function refreshUniformsLine( uniforms, material ) { + webglSlot = gl.TEXTURE0 + maxTextures - 1; - uniforms.diffuse.value = material.color; - uniforms.opacity.value = material.opacity; + } else { - } + webglSlot = currentTextureSlot; - function refreshUniformsDash( uniforms, material ) { + } - uniforms.dashSize.value = material.dashSize; - uniforms.totalSize.value = material.dashSize + material.gapSize; - uniforms.scale.value = material.scale; + } - } + let boundTexture = currentBoundTextures[ webglSlot ]; + + if ( boundTexture === undefined ) { - function refreshUniformsPoints( uniforms, material ) { + boundTexture = { type: undefined, texture: undefined }; + currentBoundTextures[ webglSlot ] = boundTexture; - uniforms.diffuse.value = material.color; - uniforms.opacity.value = material.opacity; - uniforms.size.value = material.size * _pixelRatio; - uniforms.scale.value = _height * 0.5; + } - uniforms.map.value = material.map; + if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) { + + if ( currentTextureSlot !== webglSlot ) { - if ( material.map !== null ) { + gl.activeTexture( webglSlot ); + currentTextureSlot = webglSlot; + + } - var offset = material.map.offset; - var repeat = material.map.repeat; + gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] ); - uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y ); + boundTexture.type = webglType; + boundTexture.texture = webglTexture; } } - function refreshUniformsFog( uniforms, fog ) { - - uniforms.fogColor.value = fog.color; + function unbindTexture() { - if ( fog.isFog ) { + const boundTexture = currentBoundTextures[ currentTextureSlot ]; - uniforms.fogNear.value = fog.near; - uniforms.fogFar.value = fog.far; + if ( boundTexture !== undefined && boundTexture.type !== undefined ) { - } else if ( fog.isFogExp2 ) { + gl.bindTexture( boundTexture.type, null ); - uniforms.fogDensity.value = fog.density; + boundTexture.type = undefined; + boundTexture.texture = undefined; } } - function refreshUniformsLambert( uniforms, material ) { + function compressedTexImage2D() { - if ( material.emissiveMap ) { + try { - uniforms.emissiveMap.value = material.emissiveMap; + gl.compressedTexImage2D.apply( gl, arguments ); - } + } catch ( error ) { - } + console.error( 'THREE.WebGLState:', error ); - function refreshUniformsPhong( uniforms, material ) { + } - uniforms.specular.value = material.specular; - uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 ) + } - if ( material.emissiveMap ) { + function compressedTexImage3D() { - uniforms.emissiveMap.value = material.emissiveMap; + try { - } + gl.compressedTexImage3D.apply( gl, arguments ); - if ( material.bumpMap ) { + } catch ( error ) { - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; + console.error( 'THREE.WebGLState:', error ); } - if ( material.normalMap ) { + } - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); + function texSubImage2D() { - } + try { - if ( material.displacementMap ) { + gl.texSubImage2D.apply( gl, arguments ); - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } } - function refreshUniformsToon( uniforms, material ) { + function texSubImage3D() { - refreshUniformsPhong( uniforms, material ); + try { - if ( material.gradientMap ) { + gl.texSubImage3D.apply( gl, arguments ); - uniforms.gradientMap.value = material.gradientMap; + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } } - function refreshUniformsStandard( uniforms, material ) { + function compressedTexSubImage2D() { - uniforms.roughness.value = material.roughness; - uniforms.metalness.value = material.metalness; + try { - if ( material.roughnessMap ) { + gl.compressedTexSubImage2D.apply( gl, arguments ); - uniforms.roughnessMap.value = material.roughnessMap; + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } - if ( material.metalnessMap ) { + } - uniforms.metalnessMap.value = material.metalnessMap; + function compressedTexSubImage3D() { - } + try { - if ( material.emissiveMap ) { + gl.compressedTexSubImage3D.apply( gl, arguments ); - uniforms.emissiveMap.value = material.emissiveMap; + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } - if ( material.bumpMap ) { + } - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; + function texStorage2D() { - } + try { - if ( material.normalMap ) { + gl.texStorage2D.apply( gl, arguments ); - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } - if ( material.displacementMap ) { + } - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; + function texStorage3D() { - } + try { - if ( material.envMap ) { + gl.texStorage3D.apply( gl, arguments ); - //uniforms.envMap.value = material.envMap; // part of uniforms common - uniforms.envMapIntensity.value = material.envMapIntensity; + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } } - function refreshUniformsPhysical( uniforms, material ) { + function texImage2D() { + + try { + + gl.texImage2D.apply( gl, arguments ); + + } catch ( error ) { - uniforms.clearCoat.value = material.clearCoat; - uniforms.clearCoatRoughness.value = material.clearCoatRoughness; + console.error( 'THREE.WebGLState:', error ); - refreshUniformsStandard( uniforms, material ); + } } - function refreshUniformsNormal( uniforms, material ) { + function texImage3D() { - if ( material.bumpMap ) { + try { - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; + gl.texImage3D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( 'THREE.WebGLState:', error ); } - if ( material.normalMap ) { + } - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); + // - } + function scissor( scissor ) { - if ( material.displacementMap ) { + if ( currentScissor.equals( scissor ) === false ) { - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; + gl.scissor( scissor.x, scissor.y, scissor.z, scissor.w ); + currentScissor.copy( scissor ); } } - // If uniforms are marked as clean, they don't need to be loaded to the GPU. + function viewport( viewport ) { - function markUniformsLightsNeedsUpdate( uniforms, value ) { + if ( currentViewport.equals( viewport ) === false ) { - uniforms.ambientLightColor.needsUpdate = value; + gl.viewport( viewport.x, viewport.y, viewport.z, viewport.w ); + currentViewport.copy( viewport ); - uniforms.directionalLights.needsUpdate = value; - uniforms.pointLights.needsUpdate = value; - uniforms.spotLights.needsUpdate = value; - uniforms.rectAreaLights.needsUpdate = value; - uniforms.hemisphereLights.needsUpdate = value; + } } - // Lighting + function updateUBOMapping( uniformsGroup, program ) { - function setupShadows( lights ) { + let mapping = uboProgramMap.get( program ); - var lightShadowsLength = 0; + if ( mapping === undefined ) { - for ( var i = 0, l = lights.length; i < l; i ++ ) { + mapping = new WeakMap(); - var light = lights[ i ]; + uboProgramMap.set( program, mapping ); - if ( light.castShadow ) { + } - _lights.shadows[ lightShadowsLength ] = light; - lightShadowsLength ++; + let blockIndex = mapping.get( uniformsGroup ); - } + if ( blockIndex === undefined ) { - } + blockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name ); + + mapping.set( uniformsGroup, blockIndex ); - _lights.shadows.length = lightShadowsLength; + } } - function setupLights( lights, camera ) { + function uniformBlockBinding( uniformsGroup, program ) { - var l, ll, light, shadow, - r = 0, g = 0, b = 0, - color, - intensity, - distance, - shadowMap, + const mapping = uboProgramMap.get( program ); + const blockIndex = mapping.get( uniformsGroup ); - viewMatrix = camera.matrixWorldInverse, + if ( uboBindings.get( program ) !== blockIndex ) { - directionalLength = 0, - pointLength = 0, - spotLength = 0, - rectAreaLength = 0, - hemiLength = 0; + // bind shader specific block index to global block point + gl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex ); - for ( l = 0, ll = lights.length; l < ll; l ++ ) { + uboBindings.set( program, blockIndex ); - light = lights[ l ]; + } - color = light.color; - intensity = light.intensity; - distance = light.distance; + } - shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null; + // - if ( light.isAmbientLight ) { + function reset() { - r += color.r * intensity; - g += color.g * intensity; - b += color.b * intensity; + // reset state - } else if ( light.isDirectionalLight ) { + gl.disable( gl.BLEND ); + gl.disable( gl.CULL_FACE ); + gl.disable( gl.DEPTH_TEST ); + gl.disable( gl.POLYGON_OFFSET_FILL ); + gl.disable( gl.SCISSOR_TEST ); + gl.disable( gl.STENCIL_TEST ); + gl.disable( gl.SAMPLE_ALPHA_TO_COVERAGE ); - var uniforms = lightCache.get( light ); + gl.blendEquation( gl.FUNC_ADD ); + gl.blendFunc( gl.ONE, gl.ZERO ); + gl.blendFuncSeparate( gl.ONE, gl.ZERO, gl.ONE, gl.ZERO ); - uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - _vector3.setFromMatrixPosition( light.target.matrixWorld ); - uniforms.direction.sub( _vector3 ); - uniforms.direction.transformDirection( viewMatrix ); + gl.colorMask( true, true, true, true ); + gl.clearColor( 0, 0, 0, 0 ); - uniforms.shadow = light.castShadow; + gl.depthMask( true ); + gl.depthFunc( gl.LESS ); + gl.clearDepth( 1 ); - if ( light.castShadow ) { + gl.stencilMask( 0xffffffff ); + gl.stencilFunc( gl.ALWAYS, 0, 0xffffffff ); + gl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP ); + gl.clearStencil( 0 ); - shadow = light.shadow; + gl.cullFace( gl.BACK ); + gl.frontFace( gl.CCW ); - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; + gl.polygonOffset( 0, 0 ); - } + gl.activeTexture( gl.TEXTURE0 ); - _lights.directionalShadowMap[ directionalLength ] = shadowMap; - _lights.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix; - _lights.directional[ directionalLength ] = uniforms; + gl.bindFramebuffer( gl.FRAMEBUFFER, null ); - directionalLength ++; + if ( isWebGL2 === true ) { - } else if ( light.isSpotLight ) { + gl.bindFramebuffer( gl.DRAW_FRAMEBUFFER, null ); + gl.bindFramebuffer( gl.READ_FRAMEBUFFER, null ); - var uniforms = lightCache.get( light ); + } - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); + gl.useProgram( null ); - uniforms.color.copy( color ).multiplyScalar( intensity ); - uniforms.distance = distance; + gl.lineWidth( 1 ); - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - _vector3.setFromMatrixPosition( light.target.matrixWorld ); - uniforms.direction.sub( _vector3 ); - uniforms.direction.transformDirection( viewMatrix ); + gl.scissor( 0, 0, gl.canvas.width, gl.canvas.height ); + gl.viewport( 0, 0, gl.canvas.width, gl.canvas.height ); - uniforms.coneCos = Math.cos( light.angle ); - uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) ); - uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay; + // reset internals - uniforms.shadow = light.castShadow; + enabledCapabilities = {}; - if ( light.castShadow ) { + currentTextureSlot = null; + currentBoundTextures = {}; - shadow = light.shadow; + currentBoundFramebuffers = {}; + currentDrawbuffers = new WeakMap(); + defaultDrawbuffers = []; - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; + currentProgram = null; - } + currentBlendingEnabled = false; + currentBlending = null; + currentBlendEquation = null; + currentBlendSrc = null; + currentBlendDst = null; + currentBlendEquationAlpha = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + currentPremultipledAlpha = false; - _lights.spotShadowMap[ spotLength ] = shadowMap; - _lights.spotShadowMatrix[ spotLength ] = light.shadow.matrix; - _lights.spot[ spotLength ] = uniforms; + currentFlipSided = null; + currentCullFace = null; - spotLength ++; + currentLineWidth = null; - } else if ( light.isRectAreaLight ) { - - var uniforms = lightCache.get( light ); - - // (a) intensity controls irradiance of entire light - uniforms.color - .copy( color ) - .multiplyScalar( intensity / ( light.width * light.height ) ); - - // (b) intensity controls the radiance per light area - // uniforms.color.copy( color ).multiplyScalar( intensity ); + currentPolygonOffsetFactor = null; + currentPolygonOffsetUnits = null; - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); + currentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height ); + currentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height ); - // extract local rotation of light to derive width/height half vectors - _matrix42.identity(); - _matrix4.copy( light.matrixWorld ); - _matrix4.premultiply( viewMatrix ); - _matrix42.extractRotation( _matrix4 ); + colorBuffer.reset(); + depthBuffer.reset(); + stencilBuffer.reset(); - uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); - uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); + } - uniforms.halfWidth.applyMatrix4( _matrix42 ); - uniforms.halfHeight.applyMatrix4( _matrix42 ); + return { - // TODO (abelnation): RectAreaLight distance? - // uniforms.distance = distance; + buffers: { + color: colorBuffer, + depth: depthBuffer, + stencil: stencilBuffer + }, - _lights.rectArea[ rectAreaLength ] = uniforms; + enable: enable, + disable: disable, - rectAreaLength ++; + bindFramebuffer: bindFramebuffer, + drawBuffers: drawBuffers, - } else if ( light.isPointLight ) { + useProgram: useProgram, - var uniforms = lightCache.get( light ); + setBlending: setBlending, + setMaterial: setMaterial, - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); + setFlipSided: setFlipSided, + setCullFace: setCullFace, - uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); - uniforms.distance = light.distance; - uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay; + setLineWidth: setLineWidth, + setPolygonOffset: setPolygonOffset, - uniforms.shadow = light.castShadow; + setScissorTest: setScissorTest, - if ( light.castShadow ) { + activeTexture: activeTexture, + bindTexture: bindTexture, + unbindTexture: unbindTexture, + compressedTexImage2D: compressedTexImage2D, + compressedTexImage3D: compressedTexImage3D, + texImage2D: texImage2D, + texImage3D: texImage3D, - shadow = light.shadow; + updateUBOMapping: updateUBOMapping, + uniformBlockBinding: uniformBlockBinding, - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; + texStorage2D: texStorage2D, + texStorage3D: texStorage3D, + texSubImage2D: texSubImage2D, + texSubImage3D: texSubImage3D, + compressedTexSubImage2D: compressedTexSubImage2D, + compressedTexSubImage3D: compressedTexSubImage3D, - } + scissor: scissor, + viewport: viewport, - _lights.pointShadowMap[ pointLength ] = shadowMap; - _lights.pointShadowMatrix[ pointLength ] = light.shadow.matrix; - _lights.point[ pointLength ] = uniforms; + reset: reset - pointLength ++; + }; - } else if ( light.isHemisphereLight ) { + } - var uniforms = lightCache.get( light ); + function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) { - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - uniforms.direction.transformDirection( viewMatrix ); - uniforms.direction.normalize(); + const isWebGL2 = capabilities.isWebGL2; + const maxTextures = capabilities.maxTextures; + const maxCubemapSize = capabilities.maxCubemapSize; + const maxTextureSize = capabilities.maxTextureSize; + const maxSamples = capabilities.maxSamples; + const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null; + const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent ); - uniforms.skyColor.copy( light.color ).multiplyScalar( intensity ); - uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity ); + const _videoTextures = new WeakMap(); + let _canvas; - _lights.hemi[ hemiLength ] = uniforms; + const _sources = new WeakMap(); // maps WebglTexture objects to instances of Source - hemiLength ++; + // cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas, + // also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")! + // Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d). - } + let useOffscreenCanvas = false; - } + try { - _lights.ambient[ 0 ] = r; - _lights.ambient[ 1 ] = g; - _lights.ambient[ 2 ] = b; + useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' + // eslint-disable-next-line compat/compat + && ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null; - _lights.directional.length = directionalLength; - _lights.spot.length = spotLength; - _lights.rectArea.length = rectAreaLength; - _lights.point.length = pointLength; - _lights.hemi.length = hemiLength; + } catch ( err ) { - // TODO (sam-g-steel) why aren't we using join - _lights.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + rectAreaLength + ',' + hemiLength + ',' + _lights.shadows.length; + // Ignore any errors } - // GL state setting + function createCanvas( width, height ) { - this.setFaceCulling = function ( cullFace, frontFaceDirection ) { + // Use OffscreenCanvas when available. Specially needed in web workers - state.setCullFace( cullFace ); - state.setFlipSided( frontFaceDirection === FrontFaceDirectionCW ); + return useOffscreenCanvas ? + // eslint-disable-next-line compat/compat + new OffscreenCanvas( width, height ) : createElementNS( 'canvas' ); - }; + } - // Textures + function resizeImage( image, needsPowerOfTwo, needsNewCanvas, maxSize ) { - function allocTextureUnit() { + let scale = 1; - var textureUnit = _usedTextureUnits; + // handle case if texture exceeds max size - if ( textureUnit >= capabilities.maxTextures ) { + if ( image.width > maxSize || image.height > maxSize ) { - console.warn( 'THREE.WebGLRenderer: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); + scale = maxSize / Math.max( image.width, image.height ); } - _usedTextureUnits += 1; + // only perform resize if necessary - return textureUnit; + if ( scale < 1 || needsPowerOfTwo === true ) { - } + // only perform resize for certain image types - this.allocTextureUnit = allocTextureUnit; + if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || + ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || + ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { - // this.setTexture2D = setTexture2D; - this.setTexture2D = ( function () { + const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor; - var warned = false; + const width = floor( scale * image.width ); + const height = floor( scale * image.height ); - // backwards compatibility: peel texture.texture - return function setTexture2D( texture, slot ) { + if ( _canvas === undefined ) _canvas = createCanvas( width, height ); - if ( texture && texture.isWebGLRenderTarget ) { + // cube textures can't reuse the same canvas - if ( ! warned ) { + const canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas; - console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." ); - warned = true; + canvas.width = width; + canvas.height = height; - } + const context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, width, height ); - texture = texture.texture; + console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' ); - } + return canvas; - textures.setTexture2D( texture, slot ); + } else { - }; + if ( 'data' in image ) { - }() ); + console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' ); - this.setTexture = ( function () { + } - var warned = false; + return image; - return function setTexture( texture, slot ) { + } - if ( ! warned ) { + } - console.warn( "THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead." ); - warned = true; + return image; - } + } - textures.setTexture2D( texture, slot ); + function isPowerOfTwo$1( image ) { - }; + return isPowerOfTwo( image.width ) && isPowerOfTwo( image.height ); - }() ); + } - this.setTextureCube = ( function () { + function textureNeedsPowerOfTwo( texture ) { - var warned = false; + if ( isWebGL2 ) return false; - return function setTextureCube( texture, slot ) { + return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) || + ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ); - // backwards compatibility: peel texture.texture - if ( texture && texture.isWebGLRenderTargetCube ) { + } - if ( ! warned ) { + function textureNeedsGenerateMipmaps( texture, supportsMips ) { - console.warn( "THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); - warned = true; + return texture.generateMipmaps && supportsMips && + texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; - } + } - texture = texture.texture; + function generateMipmap( target ) { - } + _gl.generateMipmap( target ); - // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture - // TODO: unify these code paths - if ( ( texture && texture.isCubeTexture ) || - ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { + } - // CompressedTexture can have Array in image :/ + function getInternalFormat( internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false ) { - // this function alone should take care of cube textures - textures.setTextureCube( texture, slot ); + if ( isWebGL2 === false ) return glFormat; - } else { + if ( internalFormatName !== null ) { - // assumed: texture property of THREE.WebGLRenderTargetCube + if ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ]; - textures.setTextureCubeDynamic( texture, slot ); + console.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'' + internalFormatName + '\'' ); - } + } - }; + let internalFormat = glFormat; - }() ); + if ( glFormat === _gl.RED ) { - this.getRenderTarget = function () { + if ( glType === _gl.FLOAT ) internalFormat = _gl.R32F; + if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.R16F; + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8; - return _currentRenderTarget; + } - }; + if ( glFormat === _gl.RG ) { - this.setRenderTarget = function ( renderTarget ) { + if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F; + if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RG16F; + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8; - _currentRenderTarget = renderTarget; + } - if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) { + if ( glFormat === _gl.RGBA ) { - textures.setupRenderTarget( renderTarget ); + if ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F; + if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F; + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( colorSpace === SRGBColorSpace && forceLinearTransfer === false ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8; + if ( glType === _gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = _gl.RGBA4; + if ( glType === _gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = _gl.RGB5_A1; } - var isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube ); - var framebuffer; - - if ( renderTarget ) { + if ( internalFormat === _gl.R16F || internalFormat === _gl.R32F || + internalFormat === _gl.RG16F || internalFormat === _gl.RG32F || + internalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F ) { - var renderTargetProperties = properties.get( renderTarget ); + extensions.get( 'EXT_color_buffer_float' ); - if ( isCube ) { + } - framebuffer = renderTargetProperties.__webglFramebuffer[ renderTarget.activeCubeFace ]; + return internalFormat; - } else { + } - framebuffer = renderTargetProperties.__webglFramebuffer; + function getMipLevels( texture, image, supportsMips ) { - } + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) { - _currentScissor.copy( renderTarget.scissor ); - _currentScissorTest = renderTarget.scissorTest; + return Math.log2( Math.max( image.width, image.height ) ) + 1; - _currentViewport.copy( renderTarget.viewport ); + } else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) { - } else { + // user-defined mipmaps - framebuffer = null; + return texture.mipmaps.length; - _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ); - _currentScissorTest = _scissorTest; + } else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) { - _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ); + return image.mipmaps.length; - } + } else { - if ( _currentFramebuffer !== framebuffer ) { + // texture without mipmaps (only base level) - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _currentFramebuffer = framebuffer; + return 1; } - state.scissor( _currentScissor ); - state.setScissorTest( _currentScissorTest ); + } - state.viewport( _currentViewport ); + // Fallback filters for non-power-of-2 textures - if ( isCube ) { + function filterFallback( f ) { - var textureProperties = properties.get( renderTarget.texture ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, renderTarget.activeMipMapLevel ); + if ( f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter ) { - } + return _gl.NEAREST; - }; + } - this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer ) { + return _gl.LINEAR; - if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) { + } - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ); - return; + // - } + function onTextureDispose( event ) { - var framebuffer = properties.get( renderTarget ).__webglFramebuffer; + const texture = event.target; - if ( framebuffer ) { + texture.removeEventListener( 'dispose', onTextureDispose ); - var restore = false; + deallocateTexture( texture ); - if ( framebuffer !== _currentFramebuffer ) { + if ( texture.isVideoTexture ) { - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + _videoTextures.delete( texture ); - restore = true; + } - } + } - try { + function onRenderTargetDispose( event ) { - var texture = renderTarget.texture; - var textureFormat = texture.format; - var textureType = texture.type; + const renderTarget = event.target; - if ( textureFormat !== RGBAFormat && paramThreeToGL( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { + renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); - return; + deallocateRenderTarget( renderTarget ); - } + } - if ( textureType !== UnsignedByteType && paramThreeToGL( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513) - ! ( textureType === FloatType && ( extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox - ! ( textureType === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) { + // - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); - return; + function deallocateTexture( texture ) { - } + const textureProperties = properties.get( texture ); - if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) { + if ( textureProperties.__webglInit === undefined ) return; - // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604) + // check if it's necessary to remove the WebGLTexture object - if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) { + const source = texture.source; + const webglTextures = _sources.get( source ); - _gl.readPixels( x, y, width, height, paramThreeToGL( textureFormat ), paramThreeToGL( textureType ), buffer ); + if ( webglTextures ) { - } + const webglTexture = webglTextures[ textureProperties.__cacheKey ]; + webglTexture.usedTimes --; - } else { + // the WebGLTexture object is not used anymore, remove it - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' ); + if ( webglTexture.usedTimes === 0 ) { - } + deleteTexture( texture ); - } finally { + } - if ( restore ) { + // remove the weak map entry if no WebGLTexture uses the source anymore - _gl.bindFramebuffer( _gl.FRAMEBUFFER, _currentFramebuffer ); + if ( Object.keys( webglTextures ).length === 0 ) { - } + _sources.delete( source ); } } - }; - - // Map three.js constants to WebGL constants + properties.remove( texture ); - function paramThreeToGL( p ) { + } - var extension; + function deleteTexture( texture ) { - if ( p === RepeatWrapping ) return _gl.REPEAT; - if ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE; - if ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT; + const textureProperties = properties.get( texture ); + _gl.deleteTexture( textureProperties.__webglTexture ); - if ( p === NearestFilter ) return _gl.NEAREST; - if ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST; - if ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR; + const source = texture.source; + const webglTextures = _sources.get( source ); + delete webglTextures[ textureProperties.__cacheKey ]; - if ( p === LinearFilter ) return _gl.LINEAR; - if ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST; - if ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR; + info.memory.textures --; - if ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE; - if ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4; - if ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1; - if ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5; + } - if ( p === ByteType ) return _gl.BYTE; - if ( p === ShortType ) return _gl.SHORT; - if ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT; - if ( p === IntType ) return _gl.INT; - if ( p === UnsignedIntType ) return _gl.UNSIGNED_INT; - if ( p === FloatType ) return _gl.FLOAT; + function deallocateRenderTarget( renderTarget ) { - if ( p === HalfFloatType ) { + const texture = renderTarget.texture; - extension = extensions.get( 'OES_texture_half_float' ); + const renderTargetProperties = properties.get( renderTarget ); + const textureProperties = properties.get( texture ); - if ( extension !== null ) return extension.HALF_FLOAT_OES; + if ( textureProperties.__webglTexture !== undefined ) { - } + _gl.deleteTexture( textureProperties.__webglTexture ); - if ( p === AlphaFormat ) return _gl.ALPHA; - if ( p === RGBFormat ) return _gl.RGB; - if ( p === RGBAFormat ) return _gl.RGBA; - if ( p === LuminanceFormat ) return _gl.LUMINANCE; - if ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA; - if ( p === DepthFormat ) return _gl.DEPTH_COMPONENT; - if ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL; + info.memory.textures --; - if ( p === AddEquation ) return _gl.FUNC_ADD; - if ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT; - if ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT; + } - if ( p === ZeroFactor ) return _gl.ZERO; - if ( p === OneFactor ) return _gl.ONE; - if ( p === SrcColorFactor ) return _gl.SRC_COLOR; - if ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR; - if ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA; - if ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA; - if ( p === DstAlphaFactor ) return _gl.DST_ALPHA; - if ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA; + if ( renderTarget.depthTexture ) { - if ( p === DstColorFactor ) return _gl.DST_COLOR; - if ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR; - if ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE; + renderTarget.depthTexture.dispose(); - if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || - p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { + } - extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); + if ( renderTarget.isWebGLCubeRenderTarget ) { - if ( extension !== null ) { + for ( let i = 0; i < 6; i ++ ) { - if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; - if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; - if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; - if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); } - } + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); + if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer ); - if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || - p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) { + if ( renderTargetProperties.__webglColorRenderbuffer ) { - extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + for ( let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i ++ ) { - if ( extension !== null ) { + if ( renderTargetProperties.__webglColorRenderbuffer[ i ] ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer[ i ] ); - if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + } } + if ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer ); + } - if ( p === RGB_ETC1_Format ) { + if ( renderTarget.isWebGLMultipleRenderTargets ) { - extension = extensions.get( 'WEBGL_compressed_texture_etc1' ); + for ( let i = 0, il = texture.length; i < il; i ++ ) { - if ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL; + const attachmentProperties = properties.get( texture[ i ] ); - } + if ( attachmentProperties.__webglTexture ) { - if ( p === MinEquation || p === MaxEquation ) { + _gl.deleteTexture( attachmentProperties.__webglTexture ); - extension = extensions.get( 'EXT_blend_minmax' ); + info.memory.textures --; - if ( extension !== null ) { + } - if ( p === MinEquation ) return extension.MIN_EXT; - if ( p === MaxEquation ) return extension.MAX_EXT; + properties.remove( texture[ i ] ); } } - if ( p === UnsignedInt248Type ) { + properties.remove( texture ); + properties.remove( renderTarget ); - extension = extensions.get( 'WEBGL_depth_texture' ); + } + + // - if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL; + let textureUnits = 0; - } + function resetTextureUnits() { - return 0; + textureUnits = 0; } - } + function allocateTextureUnit() { - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + const textureUnit = textureUnits; - function FogExp2 ( color, density ) { + if ( textureUnit >= maxTextures ) { - this.name = ''; + console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + maxTextures ); - this.color = new Color( color ); - this.density = ( density !== undefined ) ? density : 0.00025; + } - } + textureUnits += 1; - FogExp2.prototype.isFogExp2 = true; + return textureUnit; - FogExp2.prototype.clone = function () { + } - return new FogExp2( this.color.getHex(), this.density ); + function getTextureCacheKey( texture ) { - }; + const array = []; - FogExp2.prototype.toJSON = function ( meta ) { + array.push( texture.wrapS ); + array.push( texture.wrapT ); + array.push( texture.wrapR || 0 ); + array.push( texture.magFilter ); + array.push( texture.minFilter ); + array.push( texture.anisotropy ); + array.push( texture.internalFormat ); + array.push( texture.format ); + array.push( texture.type ); + array.push( texture.generateMipmaps ); + array.push( texture.premultiplyAlpha ); + array.push( texture.flipY ); + array.push( texture.unpackAlignment ); + array.push( texture.colorSpace ); - return { - type: 'FogExp2', - color: this.color.getHex(), - density: this.density - }; + return array.join(); - }; + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + // - function Fog ( color, near, far ) { + function setTexture2D( texture, slot ) { - this.name = ''; + const textureProperties = properties.get( texture ); - this.color = new Color( color ); + if ( texture.isVideoTexture ) updateVideoTexture( texture ); - this.near = ( near !== undefined ) ? near : 1; - this.far = ( far !== undefined ) ? far : 1000; + if ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) { - } + const image = texture.image; - Fog.prototype.isFog = true; + if ( image === null ) { - Fog.prototype.clone = function () { + console.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' ); - return new Fog( this.color.getHex(), this.near, this.far ); + } else if ( image.complete === false ) { - }; + console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' ); - Fog.prototype.toJSON = function ( meta ) { + } else { - return { - type: 'Fog', - color: this.color.getHex(), - near: this.near, - far: this.far - }; + uploadTexture( textureProperties, texture, slot ); + return; - }; + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function Scene () { + state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - Object3D.call( this ); + } - this.type = 'Scene'; + function setTexture2DArray( texture, slot ) { - this.background = null; - this.fog = null; - this.overrideMaterial = null; + const textureProperties = properties.get( texture ); - this.autoUpdate = true; // checked by the renderer + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - } + uploadTexture( textureProperties, texture, slot ); + return; - Scene.prototype = Object.assign( Object.create( Object3D.prototype ), { + } - constructor: Scene, + state.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - copy: function ( source, recursive ) { + } - Object3D.prototype.copy.call( this, source, recursive ); + function setTexture3D( texture, slot ) { - if ( source.background !== null ) this.background = source.background.clone(); - if ( source.fog !== null ) this.fog = source.fog.clone(); - if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); + const textureProperties = properties.get( texture ); - this.autoUpdate = source.autoUpdate; - this.matrixAutoUpdate = source.matrixAutoUpdate; + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - return this; + uploadTexture( textureProperties, texture, slot ); + return; - }, + } - toJSON: function ( meta ) { + state.bindTexture( _gl.TEXTURE_3D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - var data = Object3D.prototype.toJSON.call( this, meta ); + } - if ( this.background !== null ) data.object.background = this.background.toJSON( meta ); - if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + function setTextureCube( texture, slot ) { - return data; + const textureProperties = properties.get( texture ); - } + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - } ); + uploadCubeTexture( textureProperties, texture, slot ); + return; - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ + } - function LensFlare( texture, size, distance, blending, color ) { + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - Object3D.call( this ); + } - this.lensFlares = []; + const wrappingToGL = { + [ RepeatWrapping ]: _gl.REPEAT, + [ ClampToEdgeWrapping ]: _gl.CLAMP_TO_EDGE, + [ MirroredRepeatWrapping ]: _gl.MIRRORED_REPEAT + }; - this.positionScreen = new Vector3(); - this.customUpdateCallback = undefined; + const filterToGL = { + [ NearestFilter ]: _gl.NEAREST, + [ NearestMipmapNearestFilter ]: _gl.NEAREST_MIPMAP_NEAREST, + [ NearestMipmapLinearFilter ]: _gl.NEAREST_MIPMAP_LINEAR, - if ( texture !== undefined ) { + [ LinearFilter ]: _gl.LINEAR, + [ LinearMipmapNearestFilter ]: _gl.LINEAR_MIPMAP_NEAREST, + [ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR + }; - this.add( texture, size, distance, blending, color ); + const compareToGL = { + [ NeverCompare ]: _gl.NEVER, + [ AlwaysCompare ]: _gl.ALWAYS, + [ LessCompare ]: _gl.LESS, + [ LessEqualCompare ]: _gl.LEQUAL, + [ EqualCompare ]: _gl.EQUAL, + [ GreaterEqualCompare ]: _gl.GEQUAL, + [ GreaterCompare ]: _gl.GREATER, + [ NotEqualCompare ]: _gl.NOTEQUAL + }; - } + function setTextureParameters( textureType, texture, supportsMips ) { - } + if ( supportsMips ) { - LensFlare.prototype = Object.assign( Object.create( Object3D.prototype ), { + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[ texture.wrapS ] ); + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[ texture.wrapT ] ); - constructor: LensFlare, + if ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) { - isLensFlare: true, + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[ texture.wrapR ] ); - copy: function ( source ) { + } - Object3D.prototype.copy.call( this, source ); + _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] ); + _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] ); - this.positionScreen.copy( source.positionScreen ); - this.customUpdateCallback = source.customUpdateCallback; + } else { - for ( var i = 0, l = source.lensFlares.length; i < l; i ++ ) { + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - this.lensFlares.push( source.lensFlares[ i ] ); + if ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) { - } + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, _gl.CLAMP_TO_EDGE ); - return this; + } - }, + if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) { - add: function ( texture, size, distance, blending, color, opacity ) { - - if ( size === undefined ) size = - 1; - if ( distance === undefined ) distance = 0; - if ( opacity === undefined ) opacity = 1; - if ( color === undefined ) color = new Color( 0xffffff ); - if ( blending === undefined ) blending = NormalBlending; - - distance = Math.min( distance, Math.max( 0, distance ) ); - - this.lensFlares.push( { - texture: texture, // THREE.Texture - size: size, // size in pixels (-1 = use texture.width) - distance: distance, // distance (0-1) from light source (0=at light source) - x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is in front z = 1 is back - scale: 1, // scale - rotation: 0, // rotation - opacity: opacity, // opacity - color: color, // color - blending: blending // blending - } ); + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' ); - }, + } - /* - * Update lens flares update positions on all flares based on the screen position - * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way. - */ + _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) ); + _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) ); - updateLensFlares: function () { + if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) { - var f, fl = this.lensFlares.length; - var flare; - var vecX = - this.positionScreen.x * 2; - var vecY = - this.positionScreen.y * 2; + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.' ); - for ( f = 0; f < fl; f ++ ) { + } - flare = this.lensFlares[ f ]; + } - flare.x = this.positionScreen.x + vecX * flare.distance; - flare.y = this.positionScreen.y + vecY * flare.distance; + if ( texture.compareFunction ) { - flare.wantedRotation = flare.x * Math.PI * 0.25; - flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25; + _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE ); + _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] ); } - } - - } ); - - /** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * uvOffset: new THREE.Vector2(), - * uvScale: new THREE.Vector2() - * } - */ - - function SpriteMaterial( parameters ) { - - Material.call( this ); - - this.type = 'SpriteMaterial'; + if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) { - this.color = new Color( 0xffffff ); - this.map = null; + const extension = extensions.get( 'EXT_texture_filter_anisotropic' ); - this.rotation = 0; + if ( texture.magFilter === NearestFilter ) return; + if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return; + if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2 + if ( isWebGL2 === false && ( texture.type === HalfFloatType && extensions.has( 'OES_texture_half_float_linear' ) === false ) ) return; // verify extension for WebGL 1 only - this.fog = false; - this.lights = false; - - this.setValues( parameters ); - - } + if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) { - SpriteMaterial.prototype = Object.create( Material.prototype ); - SpriteMaterial.prototype.constructor = SpriteMaterial; - SpriteMaterial.prototype.isSpriteMaterial = true; + _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) ); + properties.get( texture ).__currentAnisotropy = texture.anisotropy; - SpriteMaterial.prototype.copy = function ( source ) { + } - Material.prototype.copy.call( this, source ); + } - this.color.copy( source.color ); - this.map = source.map; + } - this.rotation = source.rotation; + function initTexture( textureProperties, texture ) { - return this; + let forceUpload = false; - }; + if ( textureProperties.__webglInit === undefined ) { - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ + textureProperties.__webglInit = true; - function Sprite( material ) { + texture.addEventListener( 'dispose', onTextureDispose ); - Object3D.call( this ); + } - this.type = 'Sprite'; + // create Source <-> WebGLTextures mapping if necessary - this.material = ( material !== undefined ) ? material : new SpriteMaterial(); + const source = texture.source; + let webglTextures = _sources.get( source ); - } + if ( webglTextures === undefined ) { - Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), { + webglTextures = {}; + _sources.set( source, webglTextures ); - constructor: Sprite, + } - isSprite: true, + // check if there is already a WebGLTexture object for the given texture parameters - raycast: ( function () { + const textureCacheKey = getTextureCacheKey( texture ); - var intersectPoint = new Vector3(); - var worldPosition = new Vector3(); - var worldScale = new Vector3(); + if ( textureCacheKey !== textureProperties.__cacheKey ) { - return function raycast( raycaster, intersects ) { + // if not, create a new instance of WebGLTexture - worldPosition.setFromMatrixPosition( this.matrixWorld ); - raycaster.ray.closestPointToPoint( worldPosition, intersectPoint ); + if ( webglTextures[ textureCacheKey ] === undefined ) { - worldScale.setFromMatrixScale( this.matrixWorld ); - var guessSizeSq = worldScale.x * worldScale.y / 4; + // create new entry - if ( worldPosition.distanceToSquared( intersectPoint ) > guessSizeSq ) return; + webglTextures[ textureCacheKey ] = { + texture: _gl.createTexture(), + usedTimes: 0 + }; - var distance = raycaster.ray.origin.distanceTo( intersectPoint ); + info.memory.textures ++; - if ( distance < raycaster.near || distance > raycaster.far ) return; + // when a new instance of WebGLTexture was created, a texture upload is required + // even if the image contents are identical - intersects.push( { + forceUpload = true; - distance: distance, - point: intersectPoint.clone(), - face: null, - object: this + } - } ); + webglTextures[ textureCacheKey ].usedTimes ++; - }; + // every time the texture cache key changes, it's necessary to check if an instance of + // WebGLTexture can be deleted in order to avoid a memory leak. - }() ), + const webglTexture = webglTextures[ textureProperties.__cacheKey ]; - clone: function () { + if ( webglTexture !== undefined ) { - return new this.constructor( this.material ).copy( this ); + webglTextures[ textureProperties.__cacheKey ].usedTimes --; - } + if ( webglTexture.usedTimes === 0 ) { - } ); + deleteTexture( texture ); - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ + } - function LOD() { + } - Object3D.call( this ); + // store references to cache key and WebGLTexture object - this.type = 'LOD'; + textureProperties.__cacheKey = textureCacheKey; + textureProperties.__webglTexture = webglTextures[ textureCacheKey ].texture; - Object.defineProperties( this, { - levels: { - enumerable: true, - value: [] } - } ); - } + return forceUpload; - LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { + } - constructor: LOD, + function uploadTexture( textureProperties, texture, slot ) { - copy: function ( source ) { + let textureType = _gl.TEXTURE_2D; - Object3D.prototype.copy.call( this, source, false ); + if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY; + if ( texture.isData3DTexture ) textureType = _gl.TEXTURE_3D; - var levels = source.levels; + const forceUpload = initTexture( textureProperties, texture ); + const source = texture.source; - for ( var i = 0, l = levels.length; i < l; i ++ ) { + state.bindTexture( textureType, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - var level = levels[ i ]; + const sourceProperties = properties.get( source ); - this.addLevel( level.object.clone(), level.distance ); + if ( source.version !== sourceProperties.__version || forceUpload === true ) { - } + state.activeTexture( _gl.TEXTURE0 + slot ); - return this; + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); + _gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE ); - }, + const needsPowerOfTwo = textureNeedsPowerOfTwo( texture ) && isPowerOfTwo$1( texture.image ) === false; + let image = resizeImage( texture.image, needsPowerOfTwo, false, maxTextureSize ); + image = verifyColorSpace( texture, image ); - addLevel: function ( object, distance ) { + const supportsMips = isPowerOfTwo$1( image ) || isWebGL2, + glFormat = utils.convert( texture.format, texture.colorSpace ); - if ( distance === undefined ) distance = 0; + let glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); - distance = Math.abs( distance ); + setTextureParameters( textureType, texture, supportsMips ); - var levels = this.levels; + let mipmap; + const mipmaps = texture.mipmaps; - for ( var l = 0; l < levels.length; l ++ ) { + const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true ); + const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true ); + const levels = getMipLevels( texture, image, supportsMips ); - if ( distance < levels[ l ].distance ) { + if ( texture.isDepthTexture ) { - break; + // populate depth texture with dummy data - } + glInternalFormat = _gl.DEPTH_COMPONENT; - } + if ( isWebGL2 ) { - levels.splice( l, 0, { distance: distance, object: object } ); + if ( texture.type === FloatType ) { - this.add( object ); + glInternalFormat = _gl.DEPTH_COMPONENT32F; - }, + } else if ( texture.type === UnsignedIntType ) { - getObjectForDistance: function ( distance ) { + glInternalFormat = _gl.DEPTH_COMPONENT24; - var levels = this.levels; + } else if ( texture.type === UnsignedInt248Type ) { - for ( var i = 1, l = levels.length; i < l; i ++ ) { + glInternalFormat = _gl.DEPTH24_STENCIL8; - if ( distance < levels[ i ].distance ) { + } else { - break; + glInternalFormat = _gl.DEPTH_COMPONENT16; // WebGL2 requires sized internalformat for glTexImage2D - } + } - } + } else { - return levels[ i - 1 ].object; + if ( texture.type === FloatType ) { - }, + console.error( 'WebGLRenderer: Floating point depth texture requires WebGL2.' ); - raycast: ( function () { + } - var matrixPosition = new Vector3(); + } - return function raycast( raycaster, intersects ) { + // validation checks for WebGL 1 - matrixPosition.setFromMatrixPosition( this.matrixWorld ); + if ( texture.format === DepthFormat && glInternalFormat === _gl.DEPTH_COMPONENT ) { - var distance = raycaster.ray.origin.distanceTo( matrixPosition ); + // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are + // DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + if ( texture.type !== UnsignedShortType && texture.type !== UnsignedIntType ) { - this.getObjectForDistance( distance ).raycast( raycaster, intersects ); + console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ); - }; + texture.type = UnsignedIntType; + glType = utils.convert( texture.type ); + + } - }() ), + } - update: function () { + if ( texture.format === DepthStencilFormat && glInternalFormat === _gl.DEPTH_COMPONENT ) { - var v1 = new Vector3(); - var v2 = new Vector3(); + // Depth stencil textures need the DEPTH_STENCIL internal format + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + glInternalFormat = _gl.DEPTH_STENCIL; - return function update( camera ) { + // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are + // DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL. + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + if ( texture.type !== UnsignedInt248Type ) { - var levels = this.levels; + console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ); - if ( levels.length > 1 ) { + texture.type = UnsignedInt248Type; + glType = utils.convert( texture.type ); - v1.setFromMatrixPosition( camera.matrixWorld ); - v2.setFromMatrixPosition( this.matrixWorld ); + } - var distance = v1.distanceTo( v2 ); + } - levels[ 0 ].object.visible = true; + // - for ( var i = 1, l = levels.length; i < l; i ++ ) { + if ( allocateMemory ) { - if ( distance >= levels[ i ].distance ) { + if ( useTexStorage ) { - levels[ i - 1 ].object.visible = false; - levels[ i ].object.visible = true; + state.texStorage2D( _gl.TEXTURE_2D, 1, glInternalFormat, image.width, image.height ); } else { - break; + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null ); } } - for ( ; i < l; i ++ ) { + } else if ( texture.isDataTexture ) { - levels[ i ].object.visible = false; + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels - } + if ( mipmaps.length > 0 && supportsMips ) { - } + if ( useTexStorage && allocateMemory ) { - }; + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); - }(), + } - toJSON: function ( meta ) { + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { - var data = Object3D.prototype.toJSON.call( this, meta ); + mipmap = mipmaps[ i ]; - data.object.levels = []; + if ( useTexStorage ) { - var levels = this.levels; + state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); - for ( var i = 0, l = levels.length; i < l; i ++ ) { + } else { - var level = levels[ i ]; + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - data.object.levels.push( { - object: level.object.uuid, - distance: level.distance - } ); + } - } + } - return data; + texture.generateMipmaps = false; - } + } else { - } ); + if ( useTexStorage ) { - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author michael guerrero / http://realitymeltdown.com - * @author ikerr / http://verold.com - */ + if ( allocateMemory ) { - function Skeleton( bones, boneInverses ) { + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height ); - // copy the bone array + } - bones = bones || []; + state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data ); - this.bones = bones.slice( 0 ); - this.boneMatrices = new Float32Array( this.bones.length * 16 ); + } else { - // use the supplied bone inverses or calculate the inverses + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data ); - if ( boneInverses === undefined ) { + } - this.calculateInverses(); + } - } else { + } else if ( texture.isCompressedTexture ) { - if ( this.bones.length === boneInverses.length ) { + if ( texture.isCompressedArrayTexture ) { - this.boneInverses = boneInverses.slice( 0 ); + if ( useTexStorage && allocateMemory ) { - } else { + state.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height, image.depth ); - console.warn( 'THREE.Skeleton boneInverses is the wrong length.' ); + } - this.boneInverses = []; + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { - for ( var i = 0, il = this.bones.length; i < il; i ++ ) { + mipmap = mipmaps[ i ]; - this.boneInverses.push( new Matrix4() ); + if ( texture.format !== RGBAFormat ) { - } + if ( glFormat !== null ) { - } + if ( useTexStorage ) { - } + state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data, 0, 0 ); - } + } else { - Object.assign( Skeleton.prototype, { + state.compressedTexImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0 ); - calculateInverses: function () { + } - this.boneInverses = []; + } else { - for ( var i = 0, il = this.bones.length; i < il; i ++ ) { + console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ); - var inverse = new Matrix4(); + } - if ( this.bones[ i ] ) { + } else { - inverse.getInverse( this.bones[ i ].matrixWorld ); + if ( useTexStorage ) { - } + state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data ); - this.boneInverses.push( inverse ); + } else { - } + state.texImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data ); - }, + } - pose: function () { + } - var bone, i, il; + } - // recover the bind-time world matrices + } else { - for ( i = 0, il = this.bones.length; i < il; i ++ ) { + if ( useTexStorage && allocateMemory ) { - bone = this.bones[ i ]; + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); - if ( bone ) { + } - bone.matrixWorld.getInverse( this.boneInverses[ i ] ); + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { - } + mipmap = mipmaps[ i ]; - } + if ( texture.format !== RGBAFormat ) { - // compute the local matrices, positions, rotations and scales + if ( glFormat !== null ) { - for ( i = 0, il = this.bones.length; i < il; i ++ ) { + if ( useTexStorage ) { - bone = this.bones[ i ]; + state.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data ); - if ( bone ) { + } else { - if ( bone.parent && bone.parent.isBone ) { + state.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); - bone.matrix.getInverse( bone.parent.matrixWorld ); - bone.matrix.multiply( bone.matrixWorld ); + } - } else { + } else { - bone.matrix.copy( bone.matrixWorld ); + console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ); - } + } - bone.matrix.decompose( bone.position, bone.quaternion, bone.scale ); + } else { - } + if ( useTexStorage ) { - } + state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); - }, + } else { - update: ( function () { + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - var offsetMatrix = new Matrix4(); - var identityMatrix = new Matrix4(); + } - return function update() { + } - var bones = this.bones; - var boneInverses = this.boneInverses; - var boneMatrices = this.boneMatrices; - var boneTexture = this.boneTexture; + } - // flatten bone matrices to array + } - for ( var i = 0, il = bones.length; i < il; i ++ ) { + } else if ( texture.isDataArrayTexture ) { - // compute the offset between the current and the original transform + if ( useTexStorage ) { - var matrix = bones[ i ] ? bones[ i ].matrixWorld : identityMatrix; + if ( allocateMemory ) { - offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] ); - offsetMatrix.toArray( boneMatrices, i * 16 ); + state.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth ); - } + } - if ( boneTexture !== undefined ) { + state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data ); - boneTexture.needsUpdate = true; + } else { - } + state.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); - }; + } - } )(), + } else if ( texture.isData3DTexture ) { - clone: function () { + if ( useTexStorage ) { - return new Skeleton( this.bones, this.boneInverses ); + if ( allocateMemory ) { - } + state.texStorage3D( _gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth ); - } ); + } - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author ikerr / http://verold.com - */ + state.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data ); - function Bone() { + } else { - Object3D.call( this ); + state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); - this.type = 'Bone'; + } - } + } else if ( texture.isFramebufferTexture ) { - Bone.prototype = Object.assign( Object.create( Object3D.prototype ), { + if ( allocateMemory ) { - constructor: Bone, + if ( useTexStorage ) { - isBone: true + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height ); - } ); + } else { - /** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author ikerr / http://verold.com - */ + let width = image.width, height = image.height; - function SkinnedMesh( geometry, material ) { + for ( let i = 0; i < levels; i ++ ) { - Mesh.call( this, geometry, material ); + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null ); - this.type = 'SkinnedMesh'; + width >>= 1; + height >>= 1; - this.bindMode = 'attached'; - this.bindMatrix = new Matrix4(); - this.bindMatrixInverse = new Matrix4(); + } - var bones = this.initBones(); - var skeleton = new Skeleton( bones ); + } - this.bind( skeleton, this.matrixWorld ); + } - this.normalizeSkinWeights(); + } else { - } + // regular Texture (image, video, canvas) - SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), { + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels - constructor: SkinnedMesh, + if ( mipmaps.length > 0 && supportsMips ) { - isSkinnedMesh: true, + if ( useTexStorage && allocateMemory ) { - initBones: function () { + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height ); - var bones = [], bone, gbone; - var i, il; + } - if ( this.geometry && this.geometry.bones !== undefined ) { + for ( let i = 0, il = mipmaps.length; i < il; i ++ ) { - // first, create array of 'Bone' objects from geometry data + mipmap = mipmaps[ i ]; - for ( i = 0, il = this.geometry.bones.length; i < il; i ++ ) { + if ( useTexStorage ) { - gbone = this.geometry.bones[ i ]; + state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap ); - // create new 'Bone' object + } else { - bone = new Bone(); - bones.push( bone ); + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap ); - // apply values + } - bone.name = gbone.name; - bone.position.fromArray( gbone.pos ); - bone.quaternion.fromArray( gbone.rotq ); - if ( gbone.scl !== undefined ) bone.scale.fromArray( gbone.scl ); + } - } + texture.generateMipmaps = false; - // second, create bone hierarchy + } else { - for ( i = 0, il = this.geometry.bones.length; i < il; i ++ ) { + if ( useTexStorage ) { - gbone = this.geometry.bones[ i ]; + if ( allocateMemory ) { - if ( ( gbone.parent !== - 1 ) && ( gbone.parent !== null ) && ( bones[ gbone.parent ] !== undefined ) ) { + state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height ); - // subsequent bones in the hierarchy + } - bones[ gbone.parent ].add( bones[ i ] ); + state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image ); - } else { + } else { - // topmost bone, immediate child of the skinned mesh + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image ); - this.add( bones[ i ] ); + } } } - } - - // now the bones are part of the scene graph and children of the skinned mesh. - // let's update the corresponding matrices + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - this.updateMatrixWorld( true ); + generateMipmap( textureType ); - return bones; - - }, - - bind: function ( skeleton, bindMatrix ) { - - this.skeleton = skeleton; + } - if ( bindMatrix === undefined ) { + sourceProperties.__version = source.version; - this.updateMatrixWorld( true ); + if ( texture.onUpdate ) texture.onUpdate( texture ); - this.skeleton.calculateInverses(); + } - bindMatrix = this.matrixWorld; + textureProperties.__version = texture.version; - } + } - this.bindMatrix.copy( bindMatrix ); - this.bindMatrixInverse.getInverse( bindMatrix ); + function uploadCubeTexture( textureProperties, texture, slot ) { - }, + if ( texture.image.length !== 6 ) return; - pose: function () { + const forceUpload = initTexture( textureProperties, texture ); + const source = texture.source; - this.skeleton.pose(); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot ); - }, + const sourceProperties = properties.get( source ); - normalizeSkinWeights: function () { + if ( source.version !== sourceProperties.__version || forceUpload === true ) { - var scale, i; + state.activeTexture( _gl.TEXTURE0 + slot ); - if ( this.geometry && this.geometry.isGeometry ) { + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); + _gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE ); - for ( i = 0; i < this.geometry.skinWeights.length; i ++ ) { + const isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ); + const isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture ); - var sw = this.geometry.skinWeights[ i ]; + const cubeImage = []; - scale = 1.0 / sw.lengthManhattan(); + for ( let i = 0; i < 6; i ++ ) { - if ( scale !== Infinity ) { + if ( ! isCompressed && ! isDataTexture ) { - sw.multiplyScalar( scale ); + cubeImage[ i ] = resizeImage( texture.image[ i ], false, true, maxCubemapSize ); } else { - sw.set( 1, 0, 0, 0 ); // do something reasonable + cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; } + cubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] ); + } - } else if ( this.geometry && this.geometry.isBufferGeometry ) { + const image = cubeImage[ 0 ], + supportsMips = isPowerOfTwo$1( image ) || isWebGL2, + glFormat = utils.convert( texture.format, texture.colorSpace ), + glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); - var vec = new Vector4(); + const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true ); + const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true ); + let levels = getMipLevels( texture, image, supportsMips ); - var skinWeight = this.geometry.attributes.skinWeight; + setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips ); - for ( i = 0; i < skinWeight.count; i ++ ) { + let mipmaps; - vec.x = skinWeight.getX( i ); - vec.y = skinWeight.getY( i ); - vec.z = skinWeight.getZ( i ); - vec.w = skinWeight.getW( i ); + if ( isCompressed ) { - scale = 1.0 / vec.lengthManhattan(); + if ( useTexStorage && allocateMemory ) { - if ( scale !== Infinity ) { + state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, image.width, image.height ); - vec.multiplyScalar( scale ); + } - } else { + for ( let i = 0; i < 6; i ++ ) { - vec.set( 1, 0, 0, 0 ); // do something reasonable + mipmaps = cubeImage[ i ].mipmaps; - } + for ( let j = 0; j < mipmaps.length; j ++ ) { - skinWeight.setXYZW( i, vec.x, vec.y, vec.z, vec.w ); + const mipmap = mipmaps[ j ]; - } + if ( texture.format !== RGBAFormat ) { - } + if ( glFormat !== null ) { - }, + if ( useTexStorage ) { - updateMatrixWorld: function ( force ) { + state.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data ); - Mesh.prototype.updateMatrixWorld.call( this, force ); + } else { - if ( this.bindMode === 'attached' ) { + state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); - this.bindMatrixInverse.getInverse( this.matrixWorld ); + } - } else if ( this.bindMode === 'detached' ) { + } else { - this.bindMatrixInverse.getInverse( this.bindMatrix ); + console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' ); - } else { + } - console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode ); + } else { - } + if ( useTexStorage ) { - }, + state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data ); - clone: function () { + } else { - return new this.constructor( this.geometry, this.material ).copy( this ); + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - } + } - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * linewidth: , - * linecap: "round", - * linejoin: "round" - * } - */ + } - function LineBasicMaterial( parameters ) { + } - Material.call( this ); + } else { - this.type = 'LineBasicMaterial'; + mipmaps = texture.mipmaps; - this.color = new Color( 0xffffff ); + if ( useTexStorage && allocateMemory ) { - this.linewidth = 1; - this.linecap = 'round'; - this.linejoin = 'round'; + // TODO: Uniformly handle mipmap definitions + // Normal textures and compressed cube textures define base level + mips with their mipmap array + // Uncompressed cube textures use their mipmap array only for mips (no base level) - this.lights = false; + if ( mipmaps.length > 0 ) levels ++; - this.setValues( parameters ); + state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, cubeImage[ 0 ].width, cubeImage[ 0 ].height ); - } + } - LineBasicMaterial.prototype = Object.create( Material.prototype ); - LineBasicMaterial.prototype.constructor = LineBasicMaterial; + for ( let i = 0; i < 6; i ++ ) { - LineBasicMaterial.prototype.isLineBasicMaterial = true; + if ( isDataTexture ) { - LineBasicMaterial.prototype.copy = function ( source ) { + if ( useTexStorage ) { - Material.prototype.copy.call( this, source ); + state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data ); - this.color.copy( source.color ); + } else { - this.linewidth = source.linewidth; - this.linecap = source.linecap; - this.linejoin = source.linejoin; + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); - return this; + } - }; + for ( let j = 0; j < mipmaps.length; j ++ ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + const mipmap = mipmaps[ j ]; + const mipmapImage = mipmap.image[ i ].image; - function Line( geometry, material, mode ) { + if ( useTexStorage ) { - if ( mode === 1 ) { + state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data ); - console.warn( 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.' ); - return new LineSegments( geometry, material ); + } else { - } + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data ); - Object3D.call( this ); + } - this.type = 'Line'; + } - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new LineBasicMaterial( { color: Math.random() * 0xffffff } ); + } else { - } + if ( useTexStorage ) { - Line.prototype = Object.assign( Object.create( Object3D.prototype ), { + state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] ); - constructor: Line, + } else { - isLine: true, + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] ); - raycast: ( function () { + } - var inverseMatrix = new Matrix4(); - var ray = new Ray(); - var sphere = new Sphere(); + for ( let j = 0; j < mipmaps.length; j ++ ) { - return function raycast( raycaster, intersects ) { + const mipmap = mipmaps[ j ]; - var precision = raycaster.linePrecision; - var precisionSq = precision * precision; + if ( useTexStorage ) { - var geometry = this.geometry; - var matrixWorld = this.matrixWorld; + state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] ); - // Checking boundingSphere distance to ray + } else { - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] ); - sphere.copy( geometry.boundingSphere ); - sphere.applyMatrix4( matrixWorld ); + } - if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + } - // + } - inverseMatrix.getInverse( matrixWorld ); - ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + } - var vStart = new Vector3(); - var vEnd = new Vector3(); - var interSegment = new Vector3(); - var interRay = new Vector3(); - var step = (this && this.isLineSegments) ? 2 : 1; + } - if ( geometry.isBufferGeometry ) { + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - var index = geometry.index; - var attributes = geometry.attributes; - var positions = attributes.position.array; + // We assume images for cube map have the same size. + generateMipmap( _gl.TEXTURE_CUBE_MAP ); - if ( index !== null ) { + } - var indices = index.array; + sourceProperties.__version = source.version; - for ( var i = 0, l = indices.length - 1; i < l; i += step ) { + if ( texture.onUpdate ) texture.onUpdate( texture ); - var a = indices[ i ]; - var b = indices[ i + 1 ]; + } - vStart.fromArray( positions, a * 3 ); - vEnd.fromArray( positions, b * 3 ); + textureProperties.__version = texture.version; - var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + } - if ( distSq > precisionSq ) continue; + // Render targets - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + // Setup storage for target texture and bind it to correct framebuffer + function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) { - var distance = raycaster.ray.origin.distanceTo( interRay ); + const glFormat = utils.convert( texture.format, texture.colorSpace ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); + const renderTargetProperties = properties.get( renderTarget ); - if ( distance < raycaster.near || distance > raycaster.far ) continue; + if ( ! renderTargetProperties.__hasExternalTextures ) { - intersects.push( { + if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) { - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this + state.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null ); - } ); - - } + } else { - } else { + state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); - for ( var i = 0, l = positions.length / 3 - 1; i < l; i += step ) { + } - vStart.fromArray( positions, 3 * i ); - vEnd.fromArray( positions, 3 * i + 3 ); + } - var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - if ( distSq > precisionSq ) continue; + if ( useMultisampledRTT( renderTarget ) ) { - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0, getRenderTargetSamples( renderTarget ) ); - var distance = raycaster.ray.origin.distanceTo( interRay ); + } else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753 - if ( distance < raycaster.near || distance > raycaster.far ) continue; + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 ); - intersects.push( { + } - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this + state.bindFramebuffer( _gl.FRAMEBUFFER, null ); - } ); + } - } - } + // Setup storage for internal depth/stencil buffers and bind to correct framebuffer + function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) { - } else if ( geometry.isGeometry ) { + _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer ); - var vertices = geometry.vertices; - var nbVertices = vertices.length; + if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { - for ( var i = 0; i < nbVertices - 1; i += step ) { + let glInternalFormat = _gl.DEPTH_COMPONENT16; - var distSq = ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment ); + if ( isMultisample || useMultisampledRTT( renderTarget ) ) { - if ( distSq > precisionSq ) continue; + const depthTexture = renderTarget.depthTexture; - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + if ( depthTexture && depthTexture.isDepthTexture ) { - var distance = raycaster.ray.origin.distanceTo( interRay ); + if ( depthTexture.type === FloatType ) { - if ( distance < raycaster.near || distance > raycaster.far ) continue; + glInternalFormat = _gl.DEPTH_COMPONENT32F; - intersects.push( { + } else if ( depthTexture.type === UnsignedIntType ) { - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this + glInternalFormat = _gl.DEPTH_COMPONENT24; - } ); + } } - } - - }; - - }() ), + const samples = getRenderTargetSamples( renderTarget ); - clone: function () { + if ( useMultisampledRTT( renderTarget ) ) { - return new this.constructor( this.geometry, this.material ).copy( this ); + multisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - } + } else { - } ); + _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function LineSegments( geometry, material ) { + } else { - Line.call( this, geometry, material ); + _gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height ); - this.type = 'LineSegments'; + } - } + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - LineSegments.prototype = Object.assign( Object.create( Line.prototype ), { + } else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { - constructor: LineSegments, + const samples = getRenderTargetSamples( renderTarget ); - isLineSegments: true + if ( isMultisample && useMultisampledRTT( renderTarget ) === false ) { - } ); + _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height ); - /** - * @author mgreter / http://github.com/mgreter - */ + } else if ( useMultisampledRTT( renderTarget ) ) { - function LineLoop( geometry, material ) { + multisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height ); - Line.call( this, geometry, material ); + } else { - this.type = 'LineLoop'; + _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height ); - } + } - LineLoop.prototype = Object.assign( Object.create( Line.prototype ), { - constructor: LineLoop, + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - isLineLoop: true, + } else { - } ); + const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ]; - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * size: , - * sizeAttenuation: - * } - */ + for ( let i = 0; i < textures.length; i ++ ) { - function PointsMaterial( parameters ) { + const texture = textures[ i ]; - Material.call( this ); + const glFormat = utils.convert( texture.format, texture.colorSpace ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); + const samples = getRenderTargetSamples( renderTarget ); - this.type = 'PointsMaterial'; + if ( isMultisample && useMultisampledRTT( renderTarget ) === false ) { - this.color = new Color( 0xffffff ); + _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - this.map = null; + } else if ( useMultisampledRTT( renderTarget ) ) { - this.size = 1; - this.sizeAttenuation = true; + multisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - this.lights = false; + } else { - this.setValues( parameters ); + _gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height ); - } + } - PointsMaterial.prototype = Object.create( Material.prototype ); - PointsMaterial.prototype.constructor = PointsMaterial; + } - PointsMaterial.prototype.isPointsMaterial = true; + } - PointsMaterial.prototype.copy = function ( source ) { + _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); - Material.prototype.copy.call( this, source ); + } - this.color.copy( source.color ); + // Setup resources for a Depth Texture for a FBO (needs an extension) + function setupDepthTexture( framebuffer, renderTarget ) { - this.map = source.map; + const isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget ); + if ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' ); - this.size = source.size; - this.sizeAttenuation = source.sizeAttenuation; + state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - return this; + if ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) { - }; + throw new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' ); - /** - * @author alteredq / http://alteredqualia.com/ - */ + } - function Points( geometry, material ) { + // upload an empty depth texture with framebuffer size + if ( ! properties.get( renderTarget.depthTexture ).__webglTexture || + renderTarget.depthTexture.image.width !== renderTarget.width || + renderTarget.depthTexture.image.height !== renderTarget.height ) { - Object3D.call( this ); + renderTarget.depthTexture.image.width = renderTarget.width; + renderTarget.depthTexture.image.height = renderTarget.height; + renderTarget.depthTexture.needsUpdate = true; - this.type = 'Points'; + } - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } ); + setTexture2D( renderTarget.depthTexture, 0 ); - } + const webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture; + const samples = getRenderTargetSamples( renderTarget ); - Points.prototype = Object.assign( Object.create( Object3D.prototype ), { + if ( renderTarget.depthTexture.format === DepthFormat ) { - constructor: Points, + if ( useMultisampledRTT( renderTarget ) ) { - isPoints: true, + multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples ); - raycast: ( function () { + } else { - var inverseMatrix = new Matrix4(); - var ray = new Ray(); - var sphere = new Sphere(); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); - return function raycast( raycaster, intersects ) { + } - var object = this; - var geometry = this.geometry; - var matrixWorld = this.matrixWorld; - var threshold = raycaster.params.Points.threshold; + } else if ( renderTarget.depthTexture.format === DepthStencilFormat ) { - // Checking boundingSphere distance to ray + if ( useMultisampledRTT( renderTarget ) ) { - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples ); - sphere.copy( geometry.boundingSphere ); - sphere.applyMatrix4( matrixWorld ); - sphere.radius += threshold; + } else { - if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); - // + } - inverseMatrix.getInverse( matrixWorld ); - ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + } else { - var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); - var localThresholdSq = localThreshold * localThreshold; - var position = new Vector3(); + throw new Error( 'Unknown depthTexture format' ); - function testPoint( point, index ) { + } - var rayPointDistanceSq = ray.distanceSqToPoint( point ); + } - if ( rayPointDistanceSq < localThresholdSq ) { + // Setup GL resources for a non-texture depth buffer + function setupDepthRenderbuffer( renderTarget ) { - var intersectPoint = ray.closestPointToPoint( point ); - intersectPoint.applyMatrix4( matrixWorld ); + const renderTargetProperties = properties.get( renderTarget ); + const isCube = ( renderTarget.isWebGLCubeRenderTarget === true ); - var distance = raycaster.ray.origin.distanceTo( intersectPoint ); + if ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) { - if ( distance < raycaster.near || distance > raycaster.far ) return; + if ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' ); - intersects.push( { + setupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget ); - distance: distance, - distanceToRay: Math.sqrt( rayPointDistanceSq ), - point: intersectPoint.clone(), - index: index, - face: null, - object: object + } else { - } ); + if ( isCube ) { - } + renderTargetProperties.__webglDepthbuffer = []; - } + for ( let i = 0; i < 6; i ++ ) { - if ( geometry.isBufferGeometry ) { + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] ); + renderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false ); - var index = geometry.index; - var attributes = geometry.attributes; - var positions = attributes.position.array; + } - if ( index !== null ) { + } else { - var indices = index.array; + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); + renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false ); - for ( var i = 0, il = indices.length; i < il; i ++ ) { + } - var a = indices[ i ]; + } - position.fromArray( positions, a * 3 ); + state.bindFramebuffer( _gl.FRAMEBUFFER, null ); - testPoint( position, a ); + } - } + // rebind framebuffer with external textures + function rebindTextures( renderTarget, colorTexture, depthTexture ) { - } else { + const renderTargetProperties = properties.get( renderTarget ); - for ( var i = 0, l = positions.length / 3; i < l; i ++ ) { + if ( colorTexture !== undefined ) { - position.fromArray( positions, i * 3 ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); - testPoint( position, i ); + } - } + if ( depthTexture !== undefined ) { - } + setupDepthRenderbuffer( renderTarget ); - } else { + } - var vertices = geometry.vertices; + } - for ( var i = 0, l = vertices.length; i < l; i ++ ) { + // Set up GL resources for the render target + function setupRenderTarget( renderTarget ) { - testPoint( vertices[ i ], i ); + const texture = renderTarget.texture; - } + const renderTargetProperties = properties.get( renderTarget ); + const textureProperties = properties.get( texture ); - } + renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); - }; + if ( renderTarget.isWebGLMultipleRenderTargets !== true ) { - }() ), + if ( textureProperties.__webglTexture === undefined ) { - clone: function () { + textureProperties.__webglTexture = _gl.createTexture(); - return new this.constructor( this.geometry, this.material ).copy( this ); + } - } + textureProperties.__version = texture.version; + info.memory.textures ++; - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + const isCube = ( renderTarget.isWebGLCubeRenderTarget === true ); + const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true ); + const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2; - function Group() { + // Setup framebuffer - Object3D.call( this ); + if ( isCube ) { - this.type = 'Group'; + renderTargetProperties.__webglFramebuffer = []; - } + for ( let i = 0; i < 6; i ++ ) { - Group.prototype = Object.assign( Object.create( Object3D.prototype ), { + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); - constructor: Group + } - } ); + } else { - /** - * @author mrdoob / http://mrdoob.com/ - */ + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); - function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + if ( isMultipleRenderTargets ) { - Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + if ( capabilities.drawBuffers ) { - this.generateMipmaps = false; + const textures = renderTarget.texture; - var scope = this; + for ( let i = 0, il = textures.length; i < il; i ++ ) { - function update() { + const attachmentProperties = properties.get( textures[ i ] ); - requestAnimationFrame( update ); + if ( attachmentProperties.__webglTexture === undefined ) { - if ( video.readyState >= video.HAVE_CURRENT_DATA ) { + attachmentProperties.__webglTexture = _gl.createTexture(); - scope.needsUpdate = true; + info.memory.textures ++; - } + } - } + } - update(); + } else { - } + console.warn( 'THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.' ); - VideoTexture.prototype = Object.create( Texture.prototype ); - VideoTexture.prototype.constructor = VideoTexture; + } - /** - * @author alteredq / http://alteredqualia.com/ - */ + } - function CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { + if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) { - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + const textures = isMultipleRenderTargets ? texture : [ texture ]; - this.image = { width: width, height: height }; - this.mipmaps = mipmaps; + renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer(); + renderTargetProperties.__webglColorRenderbuffer = []; - // no flipping for cube textures - // (also flipping doesn't work for compressed textures ) + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); - this.flipY = false; + for ( let i = 0; i < textures.length; i ++ ) { - // can't generate mipmaps for compressed textures - // mips must be embedded in DDS files + const texture = textures[ i ]; + renderTargetProperties.__webglColorRenderbuffer[ i ] = _gl.createRenderbuffer(); - this.generateMipmaps = false; + _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] ); - } + const glFormat = utils.convert( texture.format, texture.colorSpace ); + const glType = utils.convert( texture.type ); + const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, renderTarget.isXRRenderTarget === true ); + const samples = getRenderTargetSamples( renderTarget ); + _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - CompressedTexture.prototype = Object.create( Texture.prototype ); - CompressedTexture.prototype.constructor = CompressedTexture; + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] ); - CompressedTexture.prototype.isCompressedTexture = true; + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); - function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + if ( renderTarget.depthBuffer ) { - Texture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true ); - this.needsUpdate = true; + } - } + state.bindFramebuffer( _gl.FRAMEBUFFER, null ); - CanvasTexture.prototype = Object.create( Texture.prototype ); - CanvasTexture.prototype.constructor = CanvasTexture; + } - /** - * @author Matt DesLauriers / @mattdesl - * @author atix / arthursilber.de - */ + } - function DepthTexture( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) { + // Setup color buffer - format = format !== undefined ? format : DepthFormat; + if ( isCube ) { - if ( format !== DepthFormat && format !== DepthStencilFormat ) { + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); + setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips ); - throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ) + for ( let i = 0; i < 6; i ++ ) { - } + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); - if ( type === undefined && format === DepthFormat ) type = UnsignedShortType; - if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type; + } - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - this.image = { width: width, height: height }; + generateMipmap( _gl.TEXTURE_CUBE_MAP ); - this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; - this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; + } - this.flipY = false; - this.generateMipmaps = false; + state.unbindTexture(); - } + } else if ( isMultipleRenderTargets ) { - DepthTexture.prototype = Object.create( Texture.prototype ); - DepthTexture.prototype.constructor = DepthTexture; - DepthTexture.prototype.isDepthTexture = true; + const textures = renderTarget.texture; - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + for ( let i = 0, il = textures.length; i < il; i ++ ) { - function WireframeGeometry( geometry ) { + const attachment = textures[ i ]; + const attachmentProperties = properties.get( attachment ); - BufferGeometry.call( this ); + state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture ); + setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D ); - this.type = 'WireframeGeometry'; + if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) { - // buffer + generateMipmap( _gl.TEXTURE_2D ); - var vertices = []; + } - // helper variables + } - var i, j, l, o, ol; - var edge = [ 0, 0 ], edges = {}, e, edge1, edge2; - var key, keys = [ 'a', 'b', 'c' ]; - var vertex; + state.unbindTexture(); - // different logic for Geometry and BufferGeometry + } else { - if ( geometry && geometry.isGeometry ) { + let glTextureType = _gl.TEXTURE_2D; - // create a data structure that contains all edges without duplicates + if ( renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) { - var faces = geometry.faces; + if ( isWebGL2 ) { - for ( i = 0, l = faces.length; i < l; i ++ ) { + glTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY; - var face = faces[ i ]; + } else { - for ( j = 0; j < 3; j ++ ) { + console.error( 'THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.' ); - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); + } - key = edge[ 0 ] + ',' + edge[ 1 ]; + } - if ( edges[ key ] === undefined ) { + state.bindTexture( glTextureType, textureProperties.__webglTexture ); + setTextureParameters( glTextureType, texture, supportsMips ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType ); - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - } + generateMipmap( glTextureType ); } - } - - // generate vertices + state.unbindTexture(); - for ( key in edges ) { + } - e = edges[ key ]; + // Setup depth and stencil buffers - vertex = geometry.vertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + if ( renderTarget.depthBuffer ) { - vertex = geometry.vertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + setupDepthRenderbuffer( renderTarget ); } - } else if ( geometry && geometry.isBufferGeometry ) { - - var position, indices, groups; - var group, start, count; - var index1, index2; - - vertex = new Vector3(); + } - if ( geometry.index !== null ) { + function updateRenderTargetMipmap( renderTarget ) { - // indexed BufferGeometry + const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2; - position = geometry.attributes.position; - indices = geometry.index; - groups = geometry.groups; + const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ]; - if ( groups.length === 0 ) { + for ( let i = 0, il = textures.length; i < il; i ++ ) { - groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; + const texture = textures[ i ]; - } + if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - // create a data structure that contains all eges without duplicates + const target = renderTarget.isWebGLCubeRenderTarget ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D; + const webglTexture = properties.get( texture ).__webglTexture; - for ( o = 0, ol = groups.length; o < ol; ++ o ) { + state.bindTexture( target, webglTexture ); + generateMipmap( target ); + state.unbindTexture(); - group = groups[ o ]; + } - start = group.start; - count = group.count; + } - for ( i = start, l = ( start + count ); i < l; i += 3 ) { + } - for ( j = 0; j < 3; j ++ ) { + function updateMultisampleRenderTarget( renderTarget ) { - edge1 = indices.getX( i + j ); - edge2 = indices.getX( i + ( j + 1 ) % 3 ); - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); + if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) { - key = edge[ 0 ] + ',' + edge[ 1 ]; + const textures = renderTarget.isWebGLMultipleRenderTargets ? renderTarget.texture : [ renderTarget.texture ]; + const width = renderTarget.width; + const height = renderTarget.height; + let mask = _gl.COLOR_BUFFER_BIT; + const invalidationArray = []; + const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; + const renderTargetProperties = properties.get( renderTarget ); + const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true ); - if ( edges[ key ] === undefined ) { + // If MRT we need to remove FBO attachments + if ( isMultipleRenderTargets ) { - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + for ( let i = 0; i < textures.length; i ++ ) { - } + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, null ); - } + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); + _gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, null, 0 ); } } - // generate vertices + state.bindFramebuffer( _gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); + state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); - for ( key in edges ) { + for ( let i = 0; i < textures.length; i ++ ) { - e = edges[ key ]; + invalidationArray.push( _gl.COLOR_ATTACHMENT0 + i ); - vertex.fromBufferAttribute( position, e.index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + if ( renderTarget.depthBuffer ) { - vertex.fromBufferAttribute( position, e.index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + invalidationArray.push( depthStyle ); - } + } - } else { + const ignoreDepthValues = ( renderTargetProperties.__ignoreDepthValues !== undefined ) ? renderTargetProperties.__ignoreDepthValues : false; - // non-indexed BufferGeometry + if ( ignoreDepthValues === false ) { - position = geometry.attributes.position; + if ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT; + if ( renderTarget.stencilBuffer ) mask |= _gl.STENCIL_BUFFER_BIT; - for ( i = 0, l = ( position.count / 3 ); i < l; i ++ ) { + } - for ( j = 0; j < 3; j ++ ) { + if ( isMultipleRenderTargets ) { - // three edges per triangle, an edge is represented as (index1, index2) - // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) + _gl.framebufferRenderbuffer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] ); - index1 = 3 * i + j; - vertex.fromBufferAttribute( position, index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + } - index2 = 3 * i + ( ( j + 1 ) % 3 ); - vertex.fromBufferAttribute( position, index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + if ( ignoreDepthValues === true ) { + + _gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, [ depthStyle ] ); + _gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, [ depthStyle ] ); } - } + if ( isMultipleRenderTargets ) { - } + const webglTexture = properties.get( textures[ i ] ).__webglTexture; + _gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, webglTexture, 0 ); - } + } - // build geometry + _gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + if ( supportsInvalidateFramebuffer ) { - } + _gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArray ); - WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); - WireframeGeometry.prototype.constructor = WireframeGeometry; + } - /** - * @author zz85 / https://github.com/zz85 - * @author Mugen87 / https://github.com/Mugen87 - * - * Parametric Surfaces Geometry - * based on the brilliant article by @prideout http://prideout.net/blog/?p=44 - */ - // ParametricGeometry + } - function ParametricGeometry( func, slices, stacks ) { + state.bindFramebuffer( _gl.READ_FRAMEBUFFER, null ); + state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null ); - Geometry.call( this ); + // If MRT since pre-blit we removed the FBO we need to reconstruct the attachments + if ( isMultipleRenderTargets ) { - this.type = 'ParametricGeometry'; + for ( let i = 0; i < textures.length; i ++ ) { - this.parameters = { - func: func, - slices: slices, - stacks: stacks - }; + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] ); - this.fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) ); - this.mergeVertices(); + const webglTexture = properties.get( textures[ i ] ).__webglTexture; - } + state.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); + _gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, webglTexture, 0 ); - ParametricGeometry.prototype = Object.create( Geometry.prototype ); - ParametricGeometry.prototype.constructor = ParametricGeometry; + } - // ParametricBufferGeometry + } - function ParametricBufferGeometry( func, slices, stacks ) { + state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); - BufferGeometry.call( this ); + } - this.type = 'ParametricBufferGeometry'; + } - this.parameters = { - func: func, - slices: slices, - stacks: stacks - }; + function getRenderTargetSamples( renderTarget ) { - // buffers + return Math.min( maxSamples, renderTarget.samples ); - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + } - var EPS = 0.00001; + function useMultisampledRTT( renderTarget ) { - var normal = new Vector3(); + const renderTargetProperties = properties.get( renderTarget ); - var p0 = new Vector3(), p1 = new Vector3(); - var pu = new Vector3(), pv = new Vector3(); + return isWebGL2 && renderTarget.samples > 0 && extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTargetProperties.__useRenderToTexture !== false; - var i, j; + } - // generate vertices, normals and uvs + function updateVideoTexture( texture ) { - var sliceCount = slices + 1; + const frame = info.render.frame; - for ( i = 0; i <= stacks; i ++ ) { + // Check the last frame we updated the VideoTexture - var v = i / stacks; + if ( _videoTextures.get( texture ) !== frame ) { - for ( j = 0; j <= slices; j ++ ) { + _videoTextures.set( texture, frame ); + texture.update(); - var u = j / slices; + } - // vertex + } - p0 = func( u, v, p0 ); - vertices.push( p0.x, p0.y, p0.z ); + function verifyColorSpace( texture, image ) { - // normal + const colorSpace = texture.colorSpace; + const format = texture.format; + const type = texture.type; - // approximate tangent vectors via finite differences + if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image; - if ( u - EPS >= 0 ) { + if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) { - p1 = func( u - EPS, v, p1 ); - pu.subVectors( p0, p1 ); + // sRGB - } else { + if ( colorSpace === SRGBColorSpace ) { - p1 = func( u + EPS, v, p1 ); - pu.subVectors( p1, p0 ); + if ( isWebGL2 === false ) { - } + // in WebGL 1, try to use EXT_sRGB extension and unsized formats - if ( v - EPS >= 0 ) { + if ( extensions.has( 'EXT_sRGB' ) === true && format === RGBAFormat ) { - p1 = func( u, v - EPS, p1 ); - pv.subVectors( p0, p1 ); + texture.format = _SRGBAFormat; - } else { + // it's not possible to generate mips in WebGL 1 with this extension - p1 = func( u, v + EPS, p1 ); - pv.subVectors( p1, p0 ); + texture.minFilter = LinearFilter; + texture.generateMipmaps = false; - } + } else { - // cross product of tangent vectors returns surface normal + // slow fallback (CPU decode) - normal.crossVectors( pu, pv ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + image = ImageUtils.sRGBToLinear( image ); - // uv + } - uvs.push( u, v ); + } else { - } + // in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format - } + if ( format !== RGBAFormat || type !== UnsignedByteType ) { - // generate indices + console.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' ); - for ( i = 0; i < stacks; i ++ ) { + } - for ( j = 0; j < slices; j ++ ) { + } - var a = i * sliceCount + j; - var b = i * sliceCount + j + 1; - var c = ( i + 1 ) * sliceCount + j + 1; - var d = ( i + 1 ) * sliceCount + j; + } else { - // faces one and two + console.error( 'THREE.WebGLTextures: Unsupported texture color space:', colorSpace ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } + return image; + } - // build geometry + // + + this.allocateTextureUnit = allocateTextureUnit; + this.resetTextureUnits = resetTextureUnits; - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setTexture2D = setTexture2D; + this.setTexture2DArray = setTexture2DArray; + this.setTexture3D = setTexture3D; + this.setTextureCube = setTextureCube; + this.rebindTextures = rebindTextures; + this.setupRenderTarget = setupRenderTarget; + this.updateRenderTargetMipmap = updateRenderTargetMipmap; + this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; + this.setupDepthRenderbuffer = setupDepthRenderbuffer; + this.setupFrameBufferTexture = setupFrameBufferTexture; + this.useMultisampledRTT = useMultisampledRTT; } - ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry; + function WebGLUtils( gl, extensions, capabilities ) { - /** - * @author clockworkgeek / https://github.com/clockworkgeek - * @author timothypratley / https://github.com/timothypratley - * @author WestLangley / http://github.com/WestLangley - * @author Mugen87 / https://github.com/Mugen87 - */ + const isWebGL2 = capabilities.isWebGL2; - // PolyhedronGeometry + function convert( p, colorSpace = NoColorSpace ) { - function PolyhedronGeometry( vertices, indices, radius, detail ) { + let extension; - Geometry.call( this ); + if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE; + if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4; + if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1; - this.type = 'PolyhedronGeometry'; + if ( p === ByteType ) return gl.BYTE; + if ( p === ShortType ) return gl.SHORT; + if ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT; + if ( p === IntType ) return gl.INT; + if ( p === UnsignedIntType ) return gl.UNSIGNED_INT; + if ( p === FloatType ) return gl.FLOAT; - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + if ( p === HalfFloatType ) { - this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); - this.mergeVertices(); + if ( isWebGL2 ) return gl.HALF_FLOAT; - } + extension = extensions.get( 'OES_texture_half_float' ); - PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); - PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; + if ( extension !== null ) { - // PolyhedronBufferGeometry + return extension.HALF_FLOAT_OES; - function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { + } else { - BufferGeometry.call( this ); + return null; - this.type = 'PolyhedronBufferGeometry'; + } - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + } - radius = radius || 1; - detail = detail || 0; + if ( p === AlphaFormat ) return gl.ALPHA; + if ( p === RGBAFormat ) return gl.RGBA; + if ( p === LuminanceFormat ) return gl.LUMINANCE; + if ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA; + if ( p === DepthFormat ) return gl.DEPTH_COMPONENT; + if ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL; - // default buffer data + // WebGL 1 sRGB fallback - var vertexBuffer = []; - var uvBuffer = []; + if ( p === _SRGBAFormat ) { - // the subdivision creates the vertex buffer data + extension = extensions.get( 'EXT_sRGB' ); - subdivide( detail ); + if ( extension !== null ) { - // all vertices should lie on a conceptual sphere with a given radius + return extension.SRGB_ALPHA_EXT; - appplyRadius( radius ); + } else { - // finally, create the uv data + return null; - generateUVs(); + } - // build non-indexed geometry + } - this.addAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); + // WebGL2 formats. - if ( detail === 0 ) { + if ( p === RedFormat ) return gl.RED; + if ( p === RedIntegerFormat ) return gl.RED_INTEGER; + if ( p === RGFormat ) return gl.RG; + if ( p === RGIntegerFormat ) return gl.RG_INTEGER; + if ( p === RGBAIntegerFormat ) return gl.RGBA_INTEGER; - this.computeVertexNormals(); // flat normals + // S3TC - } else { + if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { - this.normalizeNormals(); // smooth normals + if ( colorSpace === SRGBColorSpace ) { - } + extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' ); - // helper functions + if ( extension !== null ) { - function subdivide( detail ) { + if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); + } else { - // iterate over all faces and apply a subdivison with the given detail value + return null; - for ( var i = 0; i < indices.length; i += 3 ) { + } - // get the vertices of the face + } else { - getVertexByIndex( indices[ i + 0 ], a ); - getVertexByIndex( indices[ i + 1 ], b ); - getVertexByIndex( indices[ i + 2 ], c ); + extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); - // perform subdivision + if ( extension !== null ) { - subdivideFace( a, b, c, detail ); + if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; - } + } else { - } + return null; + + } + + } + + } - function subdivideFace( a, b, c, detail ) { + // PVRTC - var cols = Math.pow( 2, detail ); + if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) { - // we use this multidimensional array as a data structure for creating the subdivision + extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); - var v = []; + if ( extension !== null ) { - var i, j; + if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - // construct all of the vertices for this subdivision + } else { - for ( i = 0; i <= cols; i ++ ) { + return null; - v[ i ] = []; + } - var aj = a.clone().lerp( c, i / cols ); - var bj = b.clone().lerp( c, i / cols ); + } - var rows = cols - i; + // ETC1 - for ( j = 0; j <= rows; j ++ ) { + if ( p === RGB_ETC1_Format ) { - if ( j === 0 && i === cols ) { + extension = extensions.get( 'WEBGL_compressed_texture_etc1' ); - v[ i ][ j ] = aj; + if ( extension !== null ) { - } else { + return extension.COMPRESSED_RGB_ETC1_WEBGL; - v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); + } else { - } + return null; } } - // construct all of the faces - - for ( i = 0; i < cols; i ++ ) { - - for ( j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { + // ETC2 - var k = Math.floor( j / 2 ); + if ( p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) { - if ( j % 2 === 0 ) { + extension = extensions.get( 'WEBGL_compressed_texture_etc' ); - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); - pushVertex( v[ i ][ k ] ); + if ( extension !== null ) { - } else { + if ( p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if ( p === RGBA_ETC2_EAC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); + } else { - } + return null; } } - } + // ASTC - function appplyRadius( radius ) { + if ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || + p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || + p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || + p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || + p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) { - var vertex = new Vector3(); + extension = extensions.get( 'WEBGL_compressed_texture_astc' ); - // iterate over the entire buffer and apply the radius to each vertex + if ( extension !== null ) { - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + if ( p === RGBA_ASTC_4x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if ( p === RGBA_ASTC_5x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if ( p === RGBA_ASTC_5x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if ( p === RGBA_ASTC_6x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if ( p === RGBA_ASTC_6x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if ( p === RGBA_ASTC_8x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if ( p === RGBA_ASTC_8x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if ( p === RGBA_ASTC_8x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if ( p === RGBA_ASTC_10x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if ( p === RGBA_ASTC_10x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if ( p === RGBA_ASTC_10x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if ( p === RGBA_ASTC_10x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if ( p === RGBA_ASTC_12x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if ( p === RGBA_ASTC_12x12_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; + } else { - vertex.normalize().multiplyScalar( radius ); + return null; - vertexBuffer[ i + 0 ] = vertex.x; - vertexBuffer[ i + 1 ] = vertex.y; - vertexBuffer[ i + 2 ] = vertex.z; + } } - } - - function generateUVs() { + // BPTC - var vertex = new Vector3(); + if ( p === RGBA_BPTC_Format ) { - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + extension = extensions.get( 'EXT_texture_compression_bptc' ); - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; - - var u = azimuth( vertex ) / 2 / Math.PI + 0.5; - var v = inclination( vertex ) / Math.PI + 0.5; - uvBuffer.push( u, 1 - v ); - - } + if ( extension !== null ) { - correctUVs(); + if ( p === RGBA_BPTC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; - correctSeam(); + } else { - } + return null; - function correctSeam() { + } - // handle case when face straddles the seam, see #3269 + } - for ( var i = 0; i < uvBuffer.length; i += 6 ) { + // RGTC - // uv data of a single face + if ( p === RED_RGTC1_Format || p === SIGNED_RED_RGTC1_Format || p === RED_GREEN_RGTC2_Format || p === SIGNED_RED_GREEN_RGTC2_Format ) { - var x0 = uvBuffer[ i + 0 ]; - var x1 = uvBuffer[ i + 2 ]; - var x2 = uvBuffer[ i + 4 ]; + extension = extensions.get( 'EXT_texture_compression_rgtc' ); - var max = Math.max( x0, x1, x2 ); - var min = Math.min( x0, x1, x2 ); + if ( extension !== null ) { - // 0.9 is somewhat arbitrary + if ( p === RGBA_BPTC_Format ) return extension.COMPRESSED_RED_RGTC1_EXT; + if ( p === SIGNED_RED_RGTC1_Format ) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT; + if ( p === RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT; + if ( p === SIGNED_RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT; - if ( max > 0.9 && min < 0.1 ) { + } else { - if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; - if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; - if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; + return null; } } - } + // - function pushVertex( vertex ) { + if ( p === UnsignedInt248Type ) { - vertexBuffer.push( vertex.x, vertex.y, vertex.z ); + if ( isWebGL2 ) return gl.UNSIGNED_INT_24_8; - } + extension = extensions.get( 'WEBGL_depth_texture' ); - function getVertexByIndex( index, vertex ) { + if ( extension !== null ) { - var stride = index * 3; + return extension.UNSIGNED_INT_24_8_WEBGL; - vertex.x = vertices[ stride + 0 ]; - vertex.y = vertices[ stride + 1 ]; - vertex.z = vertices[ stride + 2 ]; + } else { - } + return null; + + } - function correctUVs() { + } - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); + // if "p" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats) - var centroid = new Vector3(); + return ( gl[ p ] !== undefined ) ? gl[ p ] : null; - var uvA = new Vector2(); - var uvB = new Vector2(); - var uvC = new Vector2(); + } - for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { + return { convert: convert }; - a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); - b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); - c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); + } - uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); - uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); - uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); + class ArrayCamera extends PerspectiveCamera { - centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); + constructor( array = [] ) { - var azi = azimuth( centroid ); + super(); - correctUV( uvA, j + 0, a, azi ); - correctUV( uvB, j + 2, b, azi ); - correctUV( uvC, j + 4, c, azi ); + this.isArrayCamera = true; - } + this.cameras = array; } - function correctUV( uv, stride, vector, azimuth ) { - - if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { + } - uvBuffer[ stride ] = uv.x - 1; + class Group extends Object3D { - } + constructor() { - if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { + super(); - uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; + this.isGroup = true; - } + this.type = 'Group'; } - // Angle around the Y axis, counter-clockwise when looking from above. + } - function azimuth( vector ) { + const _moveEvent = { type: 'move' }; - return Math.atan2( vector.z, - vector.x ); + class WebXRController { - } + constructor() { + this._targetRay = null; + this._grip = null; + this._hand = null; - // Angle above the XZ plane. + } - function inclination( vector ) { + getHandSpace() { - return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); + if ( this._hand === null ) { - } + this._hand = new Group(); + this._hand.matrixAutoUpdate = false; + this._hand.visible = false; - } + this._hand.joints = {}; + this._hand.inputState = { pinching: false }; - PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; + } - /** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ + return this._hand; - // TetrahedronGeometry + } - function TetrahedronGeometry( radius, detail ) { + getTargetRaySpace() { - Geometry.call( this ); + if ( this._targetRay === null ) { - this.type = 'TetrahedronGeometry'; + this._targetRay = new Group(); + this._targetRay.matrixAutoUpdate = false; + this._targetRay.visible = false; + this._targetRay.hasLinearVelocity = false; + this._targetRay.linearVelocity = new Vector3(); + this._targetRay.hasAngularVelocity = false; + this._targetRay.angularVelocity = new Vector3(); - this.parameters = { - radius: radius, - detail: detail - }; + } - this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + return this._targetRay; - } + } - TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); - TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; + getGripSpace() { - // TetrahedronBufferGeometry + if ( this._grip === null ) { - function TetrahedronBufferGeometry( radius, detail ) { + this._grip = new Group(); + this._grip.matrixAutoUpdate = false; + this._grip.visible = false; + this._grip.hasLinearVelocity = false; + this._grip.linearVelocity = new Vector3(); + this._grip.hasAngularVelocity = false; + this._grip.angularVelocity = new Vector3(); - var vertices = [ - 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 - ]; + } - var indices = [ - 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 - ]; + return this._grip; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + } - this.type = 'TetrahedronBufferGeometry'; + dispatchEvent( event ) { - this.parameters = { - radius: radius, - detail: detail - }; + if ( this._targetRay !== null ) { - } + this._targetRay.dispatchEvent( event ); - TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; + } - /** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ + if ( this._grip !== null ) { - // OctahedronGeometry + this._grip.dispatchEvent( event ); - function OctahedronGeometry( radius, detail ) { + } - Geometry.call( this ); + if ( this._hand !== null ) { - this.type = 'OctahedronGeometry'; + this._hand.dispatchEvent( event ); - this.parameters = { - radius: radius, - detail: detail - }; + } - this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + return this; - } + } - OctahedronGeometry.prototype = Object.create( Geometry.prototype ); - OctahedronGeometry.prototype.constructor = OctahedronGeometry; + connect( inputSource ) { - // OctahedronBufferGeometry + if ( inputSource && inputSource.hand ) { - function OctahedronBufferGeometry( radius, detail ) { + const hand = this._hand; - var vertices = [ - 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1 - ]; + if ( hand ) { - var indices = [ - 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2 - ]; + for ( const inputjoint of inputSource.hand.values() ) { - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + // Initialize hand with joints when connected + this._getHandJoint( hand, inputjoint ); - this.type = 'OctahedronBufferGeometry'; + } - this.parameters = { - radius: radius, - detail: detail - }; + } - } + } - OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; + this.dispatchEvent( { type: 'connected', data: inputSource } ); - /** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ + return this; + + } - // IcosahedronGeometry + disconnect( inputSource ) { - function IcosahedronGeometry( radius, detail ) { + this.dispatchEvent( { type: 'disconnected', data: inputSource } ); - Geometry.call( this ); + if ( this._targetRay !== null ) { - this.type = 'IcosahedronGeometry'; + this._targetRay.visible = false; - this.parameters = { - radius: radius, - detail: detail - }; + } - this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + if ( this._grip !== null ) { - } + this._grip.visible = false; - IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); - IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; + } - // IcosahedronBufferGeometry + if ( this._hand !== null ) { - function IcosahedronBufferGeometry( radius, detail ) { + this._hand.visible = false; - var t = ( 1 + Math.sqrt( 5 ) ) / 2; + } - var vertices = [ - - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, - 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, - t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 - ]; + return this; - var indices = [ - 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, - 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, - 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, - 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 - ]; + } - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + update( inputSource, frame, referenceSpace ) { - this.type = 'IcosahedronBufferGeometry'; + let inputPose = null; + let gripPose = null; + let handPose = null; - this.parameters = { - radius: radius, - detail: detail - }; + const targetRay = this._targetRay; + const grip = this._grip; + const hand = this._hand; - } + if ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) { - IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; + if ( hand && inputSource.hand ) { - /** - * @author Abe Pazos / https://hamoid.com - * @author Mugen87 / https://github.com/Mugen87 - */ + handPose = true; - // DodecahedronGeometry + for ( const inputjoint of inputSource.hand.values() ) { - function DodecahedronGeometry( radius, detail ) { + // Update the joints groups with the XRJoint poses + const jointPose = frame.getJointPose( inputjoint, referenceSpace ); - Geometry.call( this ); + // The transform of this joint will be updated with the joint pose on each frame + const joint = this._getHandJoint( hand, inputjoint ); - this.type = 'DodecahedronGeometry'; + if ( jointPose !== null ) { - this.parameters = { - radius: radius, - detail: detail - }; + joint.matrix.fromArray( jointPose.transform.matrix ); + joint.matrix.decompose( joint.position, joint.rotation, joint.scale ); + joint.matrixWorldNeedsUpdate = true; + joint.jointRadius = jointPose.radius; - this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + } - } + joint.visible = jointPose !== null; - DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); - DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; + } - // DodecahedronBufferGeometry + // Custom events - function DodecahedronBufferGeometry( radius, detail ) { + // Check pinchz + const indexTip = hand.joints[ 'index-finger-tip' ]; + const thumbTip = hand.joints[ 'thumb-tip' ]; + const distance = indexTip.position.distanceTo( thumbTip.position ); - var t = ( 1 + Math.sqrt( 5 ) ) / 2; - var r = 1 / t; + const distanceToPinch = 0.02; + const threshold = 0.005; - var vertices = [ + if ( hand.inputState.pinching && distance > distanceToPinch + threshold ) { - // (±1, ±1, ±1) - - 1, - 1, - 1, - 1, - 1, 1, - - 1, 1, - 1, - 1, 1, 1, - 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, 1, 1, 1, + hand.inputState.pinching = false; + this.dispatchEvent( { + type: 'pinchend', + handedness: inputSource.handedness, + target: this + } ); - // (0, ±1/φ, ±φ) - 0, - r, - t, 0, - r, t, - 0, r, - t, 0, r, t, + } else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) { - // (±1/φ, ±φ, 0) - - r, - t, 0, - r, t, 0, - r, - t, 0, r, t, 0, + hand.inputState.pinching = true; + this.dispatchEvent( { + type: 'pinchstart', + handedness: inputSource.handedness, + target: this + } ); - // (±φ, 0, ±1/φ) - - t, 0, - r, t, 0, - r, - - t, 0, r, t, 0, r - ]; + } - var indices = [ - 3, 11, 7, 3, 7, 15, 3, 15, 13, - 7, 19, 17, 7, 17, 6, 7, 6, 15, - 17, 4, 8, 17, 8, 10, 17, 10, 6, - 8, 0, 16, 8, 16, 2, 8, 2, 10, - 0, 12, 1, 0, 1, 18, 0, 18, 16, - 6, 10, 2, 6, 2, 13, 6, 13, 15, - 2, 16, 18, 2, 18, 3, 2, 3, 13, - 18, 1, 9, 18, 9, 11, 18, 11, 3, - 4, 14, 12, 4, 12, 0, 4, 0, 8, - 11, 9, 5, 11, 5, 19, 11, 19, 7, - 19, 5, 14, 19, 14, 4, 19, 4, 17, - 1, 12, 14, 1, 14, 5, 1, 5, 9 - ]; + } else { - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + if ( grip !== null && inputSource.gripSpace ) { - this.type = 'DodecahedronBufferGeometry'; + gripPose = frame.getPose( inputSource.gripSpace, referenceSpace ); - this.parameters = { - radius: radius, - detail: detail - }; + if ( gripPose !== null ) { - } + grip.matrix.fromArray( gripPose.transform.matrix ); + grip.matrix.decompose( grip.position, grip.rotation, grip.scale ); + grip.matrixWorldNeedsUpdate = true; - DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; + if ( gripPose.linearVelocity ) { - /** - * @author oosmoxiecode / https://github.com/oosmoxiecode - * @author WestLangley / https://github.com/WestLangley - * @author zz85 / https://github.com/zz85 - * @author miningold / https://github.com/miningold - * @author jonobr1 / https://github.com/jonobr1 - * @author Mugen87 / https://github.com/Mugen87 - * - */ + grip.hasLinearVelocity = true; + grip.linearVelocity.copy( gripPose.linearVelocity ); - // TubeGeometry + } else { - function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { + grip.hasLinearVelocity = false; - Geometry.call( this ); + } - this.type = 'TubeGeometry'; + if ( gripPose.angularVelocity ) { - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + grip.hasAngularVelocity = true; + grip.angularVelocity.copy( gripPose.angularVelocity ); - if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' ); + } else { - var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); + grip.hasAngularVelocity = false; - // expose internals + } - this.tangents = bufferGeometry.tangents; - this.normals = bufferGeometry.normals; - this.binormals = bufferGeometry.binormals; + } - // create geometry + } - this.fromBufferGeometry( bufferGeometry ); - this.mergeVertices(); + } - } + if ( targetRay !== null ) { - TubeGeometry.prototype = Object.create( Geometry.prototype ); - TubeGeometry.prototype.constructor = TubeGeometry; + inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace ); - // TubeBufferGeometry + // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it + if ( inputPose === null && gripPose !== null ) { - function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { + inputPose = gripPose; - BufferGeometry.call( this ); + } - this.type = 'TubeBufferGeometry'; + if ( inputPose !== null ) { - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + targetRay.matrix.fromArray( inputPose.transform.matrix ); + targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale ); + targetRay.matrixWorldNeedsUpdate = true; - tubularSegments = tubularSegments || 64; - radius = radius || 1; - radialSegments = radialSegments || 8; - closed = closed || false; + if ( inputPose.linearVelocity ) { - var frames = path.computeFrenetFrames( tubularSegments, closed ); + targetRay.hasLinearVelocity = true; + targetRay.linearVelocity.copy( inputPose.linearVelocity ); - // expose internals + } else { - this.tangents = frames.tangents; - this.normals = frames.normals; - this.binormals = frames.binormals; + targetRay.hasLinearVelocity = false; - // helper variables + } - var vertex = new Vector3(); - var normal = new Vector3(); - var uv = new Vector2(); + if ( inputPose.angularVelocity ) { - var i, j; + targetRay.hasAngularVelocity = true; + targetRay.angularVelocity.copy( inputPose.angularVelocity ); - // buffer + } else { - var vertices = []; - var normals = []; - var uvs = []; - var indices = []; + targetRay.hasAngularVelocity = false; - // create buffer data + } - generateBufferData(); + this.dispatchEvent( _moveEvent ); - // build geometry + } - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } - // functions - function generateBufferData() { + } - for ( i = 0; i < tubularSegments; i ++ ) { + if ( targetRay !== null ) { - generateSegment( i ); + targetRay.visible = ( inputPose !== null ); } - // if the geometry is not closed, generate the last row of vertices and normals - // at the regular position on the given path - // - // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) + if ( grip !== null ) { - generateSegment( ( closed === false ) ? tubularSegments : 0 ); + grip.visible = ( gripPose !== null ); - // uvs are generated in a separate function. - // this makes it easy compute correct values for closed geometries + } - generateUVs(); + if ( hand !== null ) { - // finally create faces + hand.visible = ( handPose !== null ); - generateIndices(); + } - } + return this; - function generateSegment( i ) { + } - // we use getPointAt to sample evenly distributed points from the given path + // private method - var P = path.getPointAt( i / tubularSegments ); + _getHandJoint( hand, inputjoint ) { - // retrieve corresponding normal and binormal + if ( hand.joints[ inputjoint.jointName ] === undefined ) { - var N = frames.normals[ i ]; - var B = frames.binormals[ i ]; + const joint = new Group(); + joint.matrixAutoUpdate = false; + joint.visible = false; + hand.joints[ inputjoint.jointName ] = joint; - // generate normals and vertices for the current segment + hand.add( joint ); - for ( j = 0; j <= radialSegments; j ++ ) { + } - var v = j / radialSegments * Math.PI * 2; + return hand.joints[ inputjoint.jointName ]; - var sin = Math.sin( v ); - var cos = - Math.cos( v ); + } - // normal + } - normal.x = ( cos * N.x + sin * B.x ); - normal.y = ( cos * N.y + sin * B.y ); - normal.z = ( cos * N.z + sin * B.z ); - normal.normalize(); + class DepthTexture extends Texture { - normals.push( normal.x, normal.y, normal.z ); + constructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) { - // vertex + format = format !== undefined ? format : DepthFormat; - vertex.x = P.x + radius * normal.x; - vertex.y = P.y + radius * normal.y; - vertex.z = P.z + radius * normal.z; + if ( format !== DepthFormat && format !== DepthStencilFormat ) { - vertices.push( vertex.x, vertex.y, vertex.z ); + throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ); } - } + if ( type === undefined && format === DepthFormat ) type = UnsignedIntType; + if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type; - function generateIndices() { + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - for ( j = 1; j <= tubularSegments; j ++ ) { + this.isDepthTexture = true; - for ( i = 1; i <= radialSegments; i ++ ) { + this.image = { width: width, height: height }; - var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - var b = ( radialSegments + 1 ) * j + ( i - 1 ); - var c = ( radialSegments + 1 ) * j + i; - var d = ( radialSegments + 1 ) * ( j - 1 ) + i; + this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; + this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; - // faces + this.flipY = false; + this.generateMipmaps = false; - indices.push( a, b, d ); - indices.push( b, c, d ); + this.compareFunction = null; - } + } - } - } + copy( source ) { - function generateUVs() { + super.copy( source ); - for ( i = 0; i <= tubularSegments; i ++ ) { + this.compareFunction = source.compareFunction; + + return this; - for ( j = 0; j <= radialSegments; j ++ ) { + } - uv.x = i / tubularSegments; - uv.y = j / radialSegments; + toJSON( meta ) { - uvs.push( uv.x, uv.y ); + const data = super.toJSON( meta ); - } + if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction; - } + return data; } } - TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; + class WebXRManager extends EventDispatcher { - /** - * @author oosmoxiecode - * @author Mugen87 / https://github.com/Mugen87 - * - * based on http://www.blackpawn.com/texts/pqtorus/ - */ + constructor( renderer, gl ) { - // TorusKnotGeometry + super(); - function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { + const scope = this; - Geometry.call( this ); + let session = null; - this.type = 'TorusKnotGeometry'; + let framebufferScaleFactor = 1.0; - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + let referenceSpace = null; + let referenceSpaceType = 'local-floor'; + // Set default foveation to maximum. + let foveation = 1.0; + let customReferenceSpace = null; - if ( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); + let pose = null; + let glBinding = null; + let glProjLayer = null; + let glBaseLayer = null; + let xrFrame = null; + const attributes = gl.getContextAttributes(); + let initialRenderTarget = null; + let newRenderTarget = null; - this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); - this.mergeVertices(); + const controllers = []; + const controllerInputSources = []; - } + // - TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); - TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; + let userCamera = null; - // TorusKnotBufferGeometry + const cameraL = new PerspectiveCamera(); + cameraL.layers.enable( 1 ); + cameraL.viewport = new Vector4(); - function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { + const cameraR = new PerspectiveCamera(); + cameraR.layers.enable( 2 ); + cameraR.viewport = new Vector4(); - BufferGeometry.call( this ); + const cameras = [ cameraL, cameraR ]; - this.type = 'TorusKnotBufferGeometry'; + const cameraXR = new ArrayCamera(); + cameraXR.layers.enable( 1 ); + cameraXR.layers.enable( 2 ); - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + let _currentDepthNear = null; + let _currentDepthFar = null; - radius = radius || 100; - tube = tube || 40; - tubularSegments = Math.floor( tubularSegments ) || 64; - radialSegments = Math.floor( radialSegments ) || 8; - p = p || 2; - q = q || 3; + // - // buffers + this.cameraAutoUpdate = true; // @deprecated, r153 + this.enabled = false; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + this.isPresenting = false; - // helper variables + this.getCamera = function () {}; // @deprecated, r153 - var i, j; + this.setUserCamera = function ( value ) { - var vertex = new Vector3(); - var normal = new Vector3(); + userCamera = value; - var P1 = new Vector3(); - var P2 = new Vector3(); + }; - var B = new Vector3(); - var T = new Vector3(); - var N = new Vector3(); + this.getController = function ( index ) { - // generate vertices, normals and uvs + let controller = controllers[ index ]; - for ( i = 0; i <= tubularSegments; ++ i ) { + if ( controller === undefined ) { - // the radian "u" is used to calculate the position on the torus curve of the current tubular segement + controller = new WebXRController(); + controllers[ index ] = controller; - var u = i / tubularSegments * p * Math.PI * 2; + } - // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. - // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions + return controller.getTargetRaySpace(); - calculatePositionOnCurve( u, p, q, radius, P1 ); - calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); + }; - // calculate orthonormal basis + this.getControllerGrip = function ( index ) { - T.subVectors( P2, P1 ); - N.addVectors( P2, P1 ); - B.crossVectors( T, N ); - N.crossVectors( B, T ); + let controller = controllers[ index ]; - // normalize B, N. T can be ignored, we don't use it + if ( controller === undefined ) { - B.normalize(); - N.normalize(); + controller = new WebXRController(); + controllers[ index ] = controller; - for ( j = 0; j <= radialSegments; ++ j ) { + } - // now calculate the vertices. they are nothing more than an extrusion of the torus curve. - // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. + return controller.getGripSpace(); - var v = j / radialSegments * Math.PI * 2; - var cx = - tube * Math.cos( v ); - var cy = tube * Math.sin( v ); + }; - // now calculate the final vertex position. - // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve + this.getHand = function ( index ) { - vertex.x = P1.x + ( cx * N.x + cy * B.x ); - vertex.y = P1.y + ( cx * N.y + cy * B.y ); - vertex.z = P1.z + ( cx * N.z + cy * B.z ); + let controller = controllers[ index ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + if ( controller === undefined ) { - // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) + controller = new WebXRController(); + controllers[ index ] = controller; - normal.subVectors( vertex, P1 ).normalize(); + } - normals.push( normal.x, normal.y, normal.z ); + return controller.getHandSpace(); - // uv + }; - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + // - } + function onSessionEvent( event ) { - } + const controllerIndex = controllerInputSources.indexOf( event.inputSource ); - // generate indices + if ( controllerIndex === - 1 ) { - for ( j = 1; j <= tubularSegments; j ++ ) { + return; - for ( i = 1; i <= radialSegments; i ++ ) { + } - // indices + const controller = controllers[ controllerIndex ]; - var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - var b = ( radialSegments + 1 ) * j + ( i - 1 ); - var c = ( radialSegments + 1 ) * j + i; - var d = ( radialSegments + 1 ) * ( j - 1 ) + i; + if ( controller !== undefined ) { - // faces + controller.update( event.inputSource, event.frame, customReferenceSpace || referenceSpace ); + controller.dispatchEvent( { type: event.type, data: event.inputSource } ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + function onSessionEnd() { - // build geometry + session.removeEventListener( 'select', onSessionEvent ); + session.removeEventListener( 'selectstart', onSessionEvent ); + session.removeEventListener( 'selectend', onSessionEvent ); + session.removeEventListener( 'squeeze', onSessionEvent ); + session.removeEventListener( 'squeezestart', onSessionEvent ); + session.removeEventListener( 'squeezeend', onSessionEvent ); + session.removeEventListener( 'end', onSessionEnd ); + session.removeEventListener( 'inputsourceschange', onInputSourcesChange ); - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + for ( let i = 0; i < controllers.length; i ++ ) { - // this function calculates the current position on the torus curve + const inputSource = controllerInputSources[ i ]; - function calculatePositionOnCurve( u, p, q, radius, position ) { + if ( inputSource === null ) continue; - var cu = Math.cos( u ); - var su = Math.sin( u ); - var quOverP = q / p * u; - var cs = Math.cos( quOverP ); + controllerInputSources[ i ] = null; - position.x = radius * ( 2 + cs ) * 0.5 * cu; - position.y = radius * ( 2 + cs ) * su * 0.5; - position.z = radius * Math.sin( quOverP ) * 0.5; + controllers[ i ].disconnect( inputSource ); - } + } - } + _currentDepthNear = null; + _currentDepthFar = null; - TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; + // restore framebuffer/rendering state - /** - * @author oosmoxiecode - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + renderer.setRenderTarget( initialRenderTarget ); - // TorusGeometry + glBaseLayer = null; + glProjLayer = null; + glBinding = null; + session = null; + newRenderTarget = null; - function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + // - Geometry.call( this ); + animation.stop(); - this.type = 'TorusGeometry'; + scope.isPresenting = false; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + scope.dispatchEvent( { type: 'sessionend' } ); - this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); - this.mergeVertices(); + } - } + this.setFramebufferScaleFactor = function ( value ) { - TorusGeometry.prototype = Object.create( Geometry.prototype ); - TorusGeometry.prototype.constructor = TorusGeometry; + framebufferScaleFactor = value; - // TorusBufferGeometry + if ( scope.isPresenting === true ) { - function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + console.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' ); - BufferGeometry.call( this ); + } - this.type = 'TorusBufferGeometry'; + }; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + this.setReferenceSpaceType = function ( value ) { - radius = radius || 100; - tube = tube || 40; - radialSegments = Math.floor( radialSegments ) || 8; - tubularSegments = Math.floor( tubularSegments ) || 6; - arc = arc || Math.PI * 2; + referenceSpaceType = value; - // buffers + if ( scope.isPresenting === true ) { - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + console.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' ); - // helper variables + } - var center = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); + }; - var j, i; + this.getReferenceSpace = function () { - // generate vertices, normals and uvs + return customReferenceSpace || referenceSpace; - for ( j = 0; j <= radialSegments; j ++ ) { + }; - for ( i = 0; i <= tubularSegments; i ++ ) { + this.setReferenceSpace = function ( space ) { - var u = i / tubularSegments * arc; - var v = j / radialSegments * Math.PI * 2; + customReferenceSpace = space; - // vertex + }; - vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); - vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); - vertex.z = tube * Math.sin( v ); + this.getBaseLayer = function () { - vertices.push( vertex.x, vertex.y, vertex.z ); + return glProjLayer !== null ? glProjLayer : glBaseLayer; - // normal + }; - center.x = radius * Math.cos( u ); - center.y = radius * Math.sin( u ); - normal.subVectors( vertex, center ).normalize(); + this.getBinding = function () { - normals.push( normal.x, normal.y, normal.z ); + return glBinding; - // uv + }; - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + this.getFrame = function () { - } + return xrFrame; - } + }; - // generate indices + this.getSession = function () { - for ( j = 1; j <= radialSegments; j ++ ) { + return session; - for ( i = 1; i <= tubularSegments; i ++ ) { + }; - // indices + this.setSession = async function ( value ) { - var a = ( tubularSegments + 1 ) * j + i - 1; - var b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; - var c = ( tubularSegments + 1 ) * ( j - 1 ) + i; - var d = ( tubularSegments + 1 ) * j + i; + session = value; - // faces + if ( session !== null ) { - indices.push( a, b, d ); - indices.push( b, c, d ); + initialRenderTarget = renderer.getRenderTarget(); - } + session.addEventListener( 'select', onSessionEvent ); + session.addEventListener( 'selectstart', onSessionEvent ); + session.addEventListener( 'selectend', onSessionEvent ); + session.addEventListener( 'squeeze', onSessionEvent ); + session.addEventListener( 'squeezestart', onSessionEvent ); + session.addEventListener( 'squeezeend', onSessionEvent ); + session.addEventListener( 'end', onSessionEnd ); + session.addEventListener( 'inputsourceschange', onInputSourcesChange ); - } + if ( attributes.xrCompatible !== true ) { - // build geometry + await gl.makeXRCompatible(); - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } - } + if ( ( session.renderState.layers === undefined ) || ( renderer.capabilities.isWebGL2 === false ) ) { - TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; + const layerInit = { + antialias: ( session.renderState.layers === undefined ) ? attributes.antialias : true, + alpha: true, + depth: attributes.depth, + stencil: attributes.stencil, + framebufferScaleFactor: framebufferScaleFactor + }; - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - */ + glBaseLayer = new XRWebGLLayer( session, gl, layerInit ); - var ShapeUtils = { + session.updateRenderState( { baseLayer: glBaseLayer } ); - // calculate area of the contour polygon + newRenderTarget = new WebGLRenderTarget( + glBaseLayer.framebufferWidth, + glBaseLayer.framebufferHeight, + { + format: RGBAFormat, + type: UnsignedByteType, + colorSpace: renderer.outputColorSpace, + stencilBuffer: attributes.stencil + } + ); - area: function ( contour ) { + } else { - var n = contour.length; - var a = 0.0; + let depthFormat = null; + let depthType = null; + let glDepthFormat = null; - for ( var p = n - 1, q = 0; q < n; p = q ++ ) { + if ( attributes.depth ) { - a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; + glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24; + depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat; + depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType; - } + } - return a * 0.5; + const projectionlayerInit = { + colorFormat: gl.RGBA8, + depthFormat: glDepthFormat, + scaleFactor: framebufferScaleFactor + }; - }, + glBinding = new XRWebGLBinding( session, gl ); - triangulate: ( function () { + glProjLayer = glBinding.createProjectionLayer( projectionlayerInit ); - /** - * This code is a quick port of code written in C++ which was submitted to - * flipcode.com by John W. Ratcliff // July 22, 2000 - * See original code and more information here: - * http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml - * - * ported to actionscript by Zevan Rosser - * www.actionsnippet.com - * - * ported to javascript by Joshua Koo - * http://www.lab4games.net/zz85/blog - * - */ + session.updateRenderState( { layers: [ glProjLayer ] } ); - function snip( contour, u, v, w, n, verts ) { + newRenderTarget = new WebGLRenderTarget( + glProjLayer.textureWidth, + glProjLayer.textureHeight, + { + format: RGBAFormat, + type: UnsignedByteType, + depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ), + stencilBuffer: attributes.stencil, + colorSpace: renderer.outputColorSpace, + samples: attributes.antialias ? 4 : 0 + } ); - var p; - var ax, ay, bx, by; - var cx, cy, px, py; + const renderTargetProperties = renderer.properties.get( newRenderTarget ); + renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues; - ax = contour[ verts[ u ] ].x; - ay = contour[ verts[ u ] ].y; + } - bx = contour[ verts[ v ] ].x; - by = contour[ verts[ v ] ].y; + newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278 - cx = contour[ verts[ w ] ].x; - cy = contour[ verts[ w ] ].y; + this.setFoveation( foveation ); - if ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false; + customReferenceSpace = null; + referenceSpace = await session.requestReferenceSpace( referenceSpaceType ); - var aX, aY, bX, bY, cX, cY; - var apx, apy, bpx, bpy, cpx, cpy; - var cCROSSap, bCROSScp, aCROSSbp; + animation.setContext( session ); + animation.start(); - aX = cx - bx; aY = cy - by; - bX = ax - cx; bY = ay - cy; - cX = bx - ax; cY = by - ay; + scope.isPresenting = true; - for ( p = 0; p < n; p ++ ) { + scope.dispatchEvent( { type: 'sessionstart' } ); - px = contour[ verts[ p ] ].x; - py = contour[ verts[ p ] ].y; + } - if ( ( ( px === ax ) && ( py === ay ) ) || - ( ( px === bx ) && ( py === by ) ) || - ( ( px === cx ) && ( py === cy ) ) ) continue; - - apx = px - ax; apy = py - ay; - bpx = px - bx; bpy = py - by; - cpx = px - cx; cpy = py - cy; + }; - // see if p is inside triangle abc + this.getEnvironmentBlendMode = function () { - aCROSSbp = aX * bpy - aY * bpx; - cCROSSap = cX * apy - cY * apx; - bCROSScp = bX * cpy - bY * cpx; + if ( session !== null ) { - if ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false; + return session.environmentBlendMode; } - return true; - - } + }; - // takes in an contour array and returns + function onInputSourcesChange( event ) { - return function triangulate( contour, indices ) { + // Notify disconnected - var n = contour.length; + for ( let i = 0; i < event.removed.length; i ++ ) { - if ( n < 3 ) return null; + const inputSource = event.removed[ i ]; + const index = controllerInputSources.indexOf( inputSource ); - var result = [], - verts = [], - vertIndices = []; + if ( index >= 0 ) { - /* we want a counter-clockwise polygon in verts */ + controllerInputSources[ index ] = null; + controllers[ index ].disconnect( inputSource ); - var u, v, w; + } - if ( ShapeUtils.area( contour ) > 0.0 ) { + } - for ( v = 0; v < n; v ++ ) verts[ v ] = v; + // Notify connected - } else { + for ( let i = 0; i < event.added.length; i ++ ) { - for ( v = 0; v < n; v ++ ) verts[ v ] = ( n - 1 ) - v; + const inputSource = event.added[ i ]; - } + let controllerIndex = controllerInputSources.indexOf( inputSource ); - var nv = n; + if ( controllerIndex === - 1 ) { - /* remove nv - 2 vertices, creating 1 triangle every time */ + // Assign input source a controller that currently has no input source - var count = 2 * nv; /* error detection */ + for ( let i = 0; i < controllers.length; i ++ ) { - for ( v = nv - 1; nv > 2; ) { + if ( i >= controllerInputSources.length ) { - /* if we loop, it is probably a non-simple polygon */ + controllerInputSources.push( inputSource ); + controllerIndex = i; + break; - if ( ( count -- ) <= 0 ) { + } else if ( controllerInputSources[ i ] === null ) { - //** Triangulate: ERROR - probable bad polygon! + controllerInputSources[ i ] = inputSource; + controllerIndex = i; + break; - //throw ( "Warning, unable to triangulate polygon!" ); - //return null; - // Sometimes warning is fine, especially polygons are triangulated in reverse. - console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' ); + } - if ( indices ) return vertIndices; - return result; + } - } + // If all controllers do currently receive input we ignore new ones - /* three consecutive vertices in current polygon, */ + if ( controllerIndex === - 1 ) break; - u = v; if ( nv <= u ) u = 0; /* previous */ - v = u + 1; if ( nv <= v ) v = 0; /* new v */ - w = v + 1; if ( nv <= w ) w = 0; /* next */ + } - if ( snip( contour, u, v, w, nv, verts ) ) { + const controller = controllers[ controllerIndex ]; - var a, b, c, s, t; + if ( controller ) { - /* true names of the vertices */ + controller.connect( inputSource ); - a = verts[ u ]; - b = verts[ v ]; - c = verts[ w ]; + } - /* output Triangle */ + } - result.push( [ contour[ a ], - contour[ b ], - contour[ c ] ] ); + } + // - vertIndices.push( [ verts[ u ], verts[ v ], verts[ w ] ] ); + const cameraLPos = new Vector3(); + const cameraRPos = new Vector3(); - /* remove v from the remaining polygon */ + /** + * Assumes 2 cameras that are parallel and share an X-axis, and that + * the cameras' projection and world matrices have already been set. + * And that near and far planes are identical for both cameras. + * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765 + */ + function setProjectionFromUnion( camera, cameraL, cameraR ) { - for ( s = v, t = v + 1; t < nv; s ++, t ++ ) { + cameraLPos.setFromMatrixPosition( cameraL.matrixWorld ); + cameraRPos.setFromMatrixPosition( cameraR.matrixWorld ); - verts[ s ] = verts[ t ]; + const ipd = cameraLPos.distanceTo( cameraRPos ); - } + const projL = cameraL.projectionMatrix.elements; + const projR = cameraR.projectionMatrix.elements; - nv --; + // VR systems will have identical far and near planes, and + // most likely identical top and bottom frustum extents. + // Use the left camera for these values. + const near = projL[ 14 ] / ( projL[ 10 ] - 1 ); + const far = projL[ 14 ] / ( projL[ 10 ] + 1 ); + const topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ]; + const bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ]; - /* reset error detection counter */ + const leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ]; + const rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ]; + const left = near * leftFov; + const right = near * rightFov; - count = 2 * nv; + // Calculate the new camera's position offset from the + // left camera. xOffset should be roughly half `ipd`. + const zOffset = ipd / ( - leftFov + rightFov ); + const xOffset = zOffset * - leftFov; - } + // TODO: Better way to apply this offset? + cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale ); + camera.translateX( xOffset ); + camera.translateZ( zOffset ); + camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale ); + camera.matrixWorldInverse.copy( camera.matrixWorld ).invert(); - } + // Find the union of the frustum values of the cameras and scale + // the values so that the near plane's position does not change in world space, + // although must now be relative to the new union camera. + const near2 = near + zOffset; + const far2 = far + zOffset; + const left2 = left - xOffset; + const right2 = right + ( ipd - xOffset ); + const top2 = topFov * far / far2 * near2; + const bottom2 = bottomFov * far / far2 * near2; - if ( indices ) return vertIndices; - return result; + camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 ); + camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert(); } - } )(), - - triangulateShape: function ( contour, holes ) { + function updateCamera( camera, parent ) { - function removeDupEndPts(points) { + if ( parent === null ) { - var l = points.length; + camera.matrixWorld.copy( camera.matrix ); - if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { + } else { - points.pop(); + camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix ); } + camera.matrixWorldInverse.copy( camera.matrixWorld ).invert(); + } - removeDupEndPts( contour ); - holes.forEach( removeDupEndPts ); + this.updateCameraXR = function ( camera ) { - function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) { + if ( session === null ) return camera; - // inOtherPt needs to be collinear to the inSegment - if ( inSegPt1.x !== inSegPt2.x ) { + if ( userCamera ) { - if ( inSegPt1.x < inSegPt2.x ) { + camera = userCamera; - return ( ( inSegPt1.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt2.x ) ); + } - } else { + cameraXR.near = cameraR.near = cameraL.near = camera.near; + cameraXR.far = cameraR.far = cameraL.far = camera.far; - return ( ( inSegPt2.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt1.x ) ); + if ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) { - } + // Note that the new renderState won't apply until the next frame. See #18320 - } else { + session.updateRenderState( { + depthNear: cameraXR.near, + depthFar: cameraXR.far + } ); - if ( inSegPt1.y < inSegPt2.y ) { + _currentDepthNear = cameraXR.near; + _currentDepthFar = cameraXR.far; - return ( ( inSegPt1.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt2.y ) ); + } - } else { + const parent = camera.parent; + const cameras = cameraXR.cameras; - return ( ( inSegPt2.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt1.y ) ); + updateCamera( cameraXR, parent ); - } + for ( let i = 0; i < cameras.length; i ++ ) { - } + updateCamera( cameras[ i ], parent ); - } + } - function intersect_segments_2D( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1, inSeg2Pt2, inExcludeAdjacentSegs ) { + // update projection matrix for proper view frustum culling - var seg1dx = inSeg1Pt2.x - inSeg1Pt1.x, seg1dy = inSeg1Pt2.y - inSeg1Pt1.y; - var seg2dx = inSeg2Pt2.x - inSeg2Pt1.x, seg2dy = inSeg2Pt2.y - inSeg2Pt1.y; + if ( cameras.length === 2 ) { - var seg1seg2dx = inSeg1Pt1.x - inSeg2Pt1.x; - var seg1seg2dy = inSeg1Pt1.y - inSeg2Pt1.y; + setProjectionFromUnion( cameraXR, cameraL, cameraR ); - var limit = seg1dy * seg2dx - seg1dx * seg2dy; - var perpSeg1 = seg1dy * seg1seg2dx - seg1dx * seg1seg2dy; + } else { - if ( Math.abs( limit ) > Number.EPSILON ) { + // assume single camera setup (AR) - // not parallel + cameraXR.projectionMatrix.copy( cameraL.projectionMatrix ); - var perpSeg2; - if ( limit > 0 ) { + } - if ( ( perpSeg1 < 0 ) || ( perpSeg1 > limit ) ) return []; - perpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy; - if ( ( perpSeg2 < 0 ) || ( perpSeg2 > limit ) ) return []; + // update user camera and its children - } else { + if ( userCamera ) { - if ( ( perpSeg1 > 0 ) || ( perpSeg1 < limit ) ) return []; - perpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy; - if ( ( perpSeg2 > 0 ) || ( perpSeg2 < limit ) ) return []; + updateUserCamera( cameraXR, parent ); - } + } - // i.e. to reduce rounding errors - // intersection at endpoint of segment#1? - if ( perpSeg2 === 0 ) { + return cameraXR; - if ( ( inExcludeAdjacentSegs ) && - ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) ) return []; - return [ inSeg1Pt1 ]; + }; - } - if ( perpSeg2 === limit ) { + function updateUserCamera( cameraXR, parent ) { - if ( ( inExcludeAdjacentSegs ) && - ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) ) return []; - return [ inSeg1Pt2 ]; + const camera = userCamera; - } - // intersection at endpoint of segment#2? - if ( perpSeg1 === 0 ) return [ inSeg2Pt1 ]; - if ( perpSeg1 === limit ) return [ inSeg2Pt2 ]; + if ( parent === null ) { - // return real intersection point - var factorSeg1 = perpSeg2 / limit; - return [ { x: inSeg1Pt1.x + factorSeg1 * seg1dx, - y: inSeg1Pt1.y + factorSeg1 * seg1dy } ]; + camera.matrix.copy( cameraXR.matrixWorld ); } else { - // parallel or collinear - if ( ( perpSeg1 !== 0 ) || - ( seg2dy * seg1seg2dx !== seg2dx * seg1seg2dy ) ) return []; + camera.matrix.copy( parent.matrixWorld ); + camera.matrix.invert(); + camera.matrix.multiply( cameraXR.matrixWorld ); - // they are collinear or degenerate - var seg1Pt = ( ( seg1dx === 0 ) && ( seg1dy === 0 ) ); // segment1 is just a point? - var seg2Pt = ( ( seg2dx === 0 ) && ( seg2dy === 0 ) ); // segment2 is just a point? - // both segments are points - if ( seg1Pt && seg2Pt ) { + } - if ( ( inSeg1Pt1.x !== inSeg2Pt1.x ) || - ( inSeg1Pt1.y !== inSeg2Pt1.y ) ) return []; // they are distinct points - return [ inSeg1Pt1 ]; // they are the same point + camera.matrix.decompose( camera.position, camera.quaternion, camera.scale ); + camera.updateMatrixWorld( true ); - } - // segment#1 is a single point - if ( seg1Pt ) { + const children = camera.children; - if ( ! point_in_segment_2D_colin( inSeg2Pt1, inSeg2Pt2, inSeg1Pt1 ) ) return []; // but not in segment#2 - return [ inSeg1Pt1 ]; + for ( let i = 0, l = children.length; i < l; i ++ ) { - } - // segment#2 is a single point - if ( seg2Pt ) { + children[ i ].updateMatrixWorld( true ); - if ( ! point_in_segment_2D_colin( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1 ) ) return []; // but not in segment#1 - return [ inSeg2Pt1 ]; + } - } + camera.projectionMatrix.copy( cameraXR.projectionMatrix ); + camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse ); - // they are collinear segments, which might overlap - var seg1min, seg1max, seg1minVal, seg1maxVal; - var seg2min, seg2max, seg2minVal, seg2maxVal; - if ( seg1dx !== 0 ) { + if ( camera.isPerspectiveCamera ) { - // the segments are NOT on a vertical line - if ( inSeg1Pt1.x < inSeg1Pt2.x ) { + camera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] ); + camera.zoom = 1; - seg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.x; - seg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.x; + } - } else { + } - seg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.x; - seg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.x; + this.getFoveation = function () { - } - if ( inSeg2Pt1.x < inSeg2Pt2.x ) { + if ( glProjLayer === null && glBaseLayer === null ) { - seg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.x; - seg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.x; + return undefined; - } else { + } - seg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.x; - seg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.x; + return foveation; - } + }; - } else { + this.setFoveation = function ( value ) { - // the segments are on a vertical line - if ( inSeg1Pt1.y < inSeg1Pt2.y ) { + // 0 = no foveation = full resolution + // 1 = maximum foveation = the edges render at lower resolution - seg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.y; - seg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.y; + foveation = value; - } else { + if ( glProjLayer !== null ) { - seg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.y; - seg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.y; + glProjLayer.fixedFoveation = value; - } - if ( inSeg2Pt1.y < inSeg2Pt2.y ) { + } - seg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.y; - seg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.y; + if ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) { - } else { + glBaseLayer.fixedFoveation = value; - seg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.y; - seg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.y; + } - } + }; - } - if ( seg1minVal <= seg2minVal ) { + // Animation Loop - if ( seg1maxVal < seg2minVal ) return []; - if ( seg1maxVal === seg2minVal ) { + let onAnimationFrameCallback = null; - if ( inExcludeAdjacentSegs ) return []; - return [ seg2min ]; + function onAnimationFrame( time, frame ) { - } - if ( seg1maxVal <= seg2maxVal ) return [ seg2min, seg1max ]; - return [ seg2min, seg2max ]; + pose = frame.getViewerPose( customReferenceSpace || referenceSpace ); + xrFrame = frame; - } else { + if ( pose !== null ) { - if ( seg1minVal > seg2maxVal ) return []; - if ( seg1minVal === seg2maxVal ) { + const views = pose.views; - if ( inExcludeAdjacentSegs ) return []; - return [ seg1min ]; + if ( glBaseLayer !== null ) { - } - if ( seg1maxVal <= seg2maxVal ) return [ seg1min, seg1max ]; - return [ seg1min, seg2max ]; + renderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer ); + renderer.setRenderTarget( newRenderTarget ); } - } + let cameraXRNeedsUpdate = false; - } + // check if it's necessary to rebuild cameraXR's camera list - function isPointInsideAngle( inVertex, inLegFromPt, inLegToPt, inOtherPt ) { + if ( views.length !== cameraXR.cameras.length ) { - // The order of legs is important + cameraXR.cameras.length = 0; + cameraXRNeedsUpdate = true; - // translation of all points, so that Vertex is at (0,0) - var legFromPtX = inLegFromPt.x - inVertex.x, legFromPtY = inLegFromPt.y - inVertex.y; - var legToPtX = inLegToPt.x - inVertex.x, legToPtY = inLegToPt.y - inVertex.y; - var otherPtX = inOtherPt.x - inVertex.x, otherPtY = inOtherPt.y - inVertex.y; + } - // main angle >0: < 180 deg.; 0: 180 deg.; <0: > 180 deg. - var from2toAngle = legFromPtX * legToPtY - legFromPtY * legToPtX; - var from2otherAngle = legFromPtX * otherPtY - legFromPtY * otherPtX; + for ( let i = 0; i < views.length; i ++ ) { - if ( Math.abs( from2toAngle ) > Number.EPSILON ) { + const view = views[ i ]; - // angle != 180 deg. + let viewport = null; - var other2toAngle = otherPtX * legToPtY - otherPtY * legToPtX; - // console.log( "from2to: " + from2toAngle + ", from2other: " + from2otherAngle + ", other2to: " + other2toAngle ); + if ( glBaseLayer !== null ) { - if ( from2toAngle > 0 ) { + viewport = glBaseLayer.getViewport( view ); - // main angle < 180 deg. - return ( ( from2otherAngle >= 0 ) && ( other2toAngle >= 0 ) ); + } else { - } else { + const glSubImage = glBinding.getViewSubImage( glProjLayer, view ); + viewport = glSubImage.viewport; - // main angle > 180 deg. - return ( ( from2otherAngle >= 0 ) || ( other2toAngle >= 0 ) ); + // For side-by-side projection, we only produce a single texture for both eyes. + if ( i === 0 ) { - } + renderer.setRenderTargetTextures( + newRenderTarget, + glSubImage.colorTexture, + glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture ); - } else { + renderer.setRenderTarget( newRenderTarget ); - // angle == 180 deg. - // console.log( "from2to: 180 deg., from2other: " + from2otherAngle ); - return ( from2otherAngle > 0 ); + } - } + } - } + let camera = cameras[ i ]; + if ( camera === undefined ) { - function removeHoles( contour, holes ) { + camera = new PerspectiveCamera(); + camera.layers.enable( i ); + camera.viewport = new Vector4(); + cameras[ i ] = camera; + + } - var shape = contour.concat(); // work on this shape - var hole; + camera.matrix.fromArray( view.transform.matrix ); + camera.matrix.decompose( camera.position, camera.quaternion, camera.scale ); + camera.projectionMatrix.fromArray( view.projectionMatrix ); + camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert(); + camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height ); - function isCutLineInsideAngles( inShapeIdx, inHoleIdx ) { + if ( i === 0 ) { - // Check if hole point lies within angle around shape point - var lastShapeIdx = shape.length - 1; + cameraXR.matrix.copy( camera.matrix ); + cameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale ); - var prevShapeIdx = inShapeIdx - 1; - if ( prevShapeIdx < 0 ) prevShapeIdx = lastShapeIdx; + } - var nextShapeIdx = inShapeIdx + 1; - if ( nextShapeIdx > lastShapeIdx ) nextShapeIdx = 0; + if ( cameraXRNeedsUpdate === true ) { - var insideAngle = isPointInsideAngle( shape[ inShapeIdx ], shape[ prevShapeIdx ], shape[ nextShapeIdx ], hole[ inHoleIdx ] ); - if ( ! insideAngle ) { + cameraXR.cameras.push( camera ); - // console.log( "Vertex (Shape): " + inShapeIdx + ", Point: " + hole[inHoleIdx].x + "/" + hole[inHoleIdx].y ); - return false; + } } - // Check if shape point lies within angle around hole point - var lastHoleIdx = hole.length - 1; + } + + // - var prevHoleIdx = inHoleIdx - 1; - if ( prevHoleIdx < 0 ) prevHoleIdx = lastHoleIdx; + for ( let i = 0; i < controllers.length; i ++ ) { - var nextHoleIdx = inHoleIdx + 1; - if ( nextHoleIdx > lastHoleIdx ) nextHoleIdx = 0; + const inputSource = controllerInputSources[ i ]; + const controller = controllers[ i ]; - insideAngle = isPointInsideAngle( hole[ inHoleIdx ], hole[ prevHoleIdx ], hole[ nextHoleIdx ], shape[ inShapeIdx ] ); - if ( ! insideAngle ) { + if ( inputSource !== null && controller !== undefined ) { - // console.log( "Vertex (Hole): " + inHoleIdx + ", Point: " + shape[inShapeIdx].x + "/" + shape[inShapeIdx].y ); - return false; + controller.update( inputSource, frame, customReferenceSpace || referenceSpace ); } - return true; - } - function intersectsShapeEdge( inShapePt, inHolePt ) { + if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame ); - // checks for intersections with shape edges - var sIdx, nextIdx, intersection; - for ( sIdx = 0; sIdx < shape.length; sIdx ++ ) { + if ( frame.detectedPlanes ) { - nextIdx = sIdx + 1; nextIdx %= shape.length; - intersection = intersect_segments_2D( inShapePt, inHolePt, shape[ sIdx ], shape[ nextIdx ], true ); - if ( intersection.length > 0 ) return true; + scope.dispatchEvent( { type: 'planesdetected', data: frame } ); - } + } - return false; + xrFrame = null; - } + } - var indepHoles = []; + const animation = new WebGLAnimation(); - function intersectsHoleEdge( inShapePt, inHolePt ) { + animation.setAnimationLoop( onAnimationFrame ); - // checks for intersections with hole edges - var ihIdx, chkHole, - hIdx, nextIdx, intersection; - for ( ihIdx = 0; ihIdx < indepHoles.length; ihIdx ++ ) { + this.setAnimationLoop = function ( callback ) { - chkHole = holes[ indepHoles[ ihIdx ]]; - for ( hIdx = 0; hIdx < chkHole.length; hIdx ++ ) { + onAnimationFrameCallback = callback; - nextIdx = hIdx + 1; nextIdx %= chkHole.length; - intersection = intersect_segments_2D( inShapePt, inHolePt, chkHole[ hIdx ], chkHole[ nextIdx ], true ); - if ( intersection.length > 0 ) return true; + }; - } + this.dispose = function () {}; - } - return false; + } - } + } - var holeIndex, shapeIndex, - shapePt, holePt, - holeIdx, cutKey, failedCuts = [], - tmpShape1, tmpShape2, - tmpHole1, tmpHole2; + function WebGLMaterials( renderer, properties ) { - for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + function refreshTransformUniform( map, uniform ) { - indepHoles.push( h ); + if ( map.matrixAutoUpdate === true ) { - } + map.updateMatrix(); - var minShapeIndex = 0; - var counter = indepHoles.length * 2; - while ( indepHoles.length > 0 ) { + } - counter --; - if ( counter < 0 ) { + uniform.value.copy( map.matrix ); - console.log( "Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!" ); - break; + } - } + function refreshFogUniforms( uniforms, fog ) { - // search for shape-vertex and hole-vertex, - // which can be connected without intersections - for ( shapeIndex = minShapeIndex; shapeIndex < shape.length; shapeIndex ++ ) { + fog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) ); - shapePt = shape[ shapeIndex ]; - holeIndex = - 1; + if ( fog.isFog ) { - // search for hole which can be reached without intersections - for ( var h = 0; h < indepHoles.length; h ++ ) { + uniforms.fogNear.value = fog.near; + uniforms.fogFar.value = fog.far; - holeIdx = indepHoles[ h ]; + } else if ( fog.isFogExp2 ) { - // prevent multiple checks - cutKey = shapePt.x + ":" + shapePt.y + ":" + holeIdx; - if ( failedCuts[ cutKey ] !== undefined ) continue; + uniforms.fogDensity.value = fog.density; - hole = holes[ holeIdx ]; - for ( var h2 = 0; h2 < hole.length; h2 ++ ) { + } - holePt = hole[ h2 ]; - if ( ! isCutLineInsideAngles( shapeIndex, h2 ) ) continue; - if ( intersectsShapeEdge( shapePt, holePt ) ) continue; - if ( intersectsHoleEdge( shapePt, holePt ) ) continue; + } - holeIndex = h2; - indepHoles.splice( h, 1 ); + function refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) { - tmpShape1 = shape.slice( 0, shapeIndex + 1 ); - tmpShape2 = shape.slice( shapeIndex ); - tmpHole1 = hole.slice( holeIndex ); - tmpHole2 = hole.slice( 0, holeIndex + 1 ); + if ( material.isMeshBasicMaterial ) { - shape = tmpShape1.concat( tmpHole1 ).concat( tmpHole2 ).concat( tmpShape2 ); + refreshUniformsCommon( uniforms, material ); - minShapeIndex = shapeIndex; + } else if ( material.isMeshLambertMaterial ) { - // Debug only, to show the selected cuts - // glob_CutLines.push( [ shapePt, holePt ] ); + refreshUniformsCommon( uniforms, material ); - break; + } else if ( material.isMeshToonMaterial ) { - } - if ( holeIndex >= 0 ) break; // hole-vertex found + refreshUniformsCommon( uniforms, material ); + refreshUniformsToon( uniforms, material ); - failedCuts[ cutKey ] = true; // remember failure + } else if ( material.isMeshPhongMaterial ) { - } - if ( holeIndex >= 0 ) break; // hole-vertex found + refreshUniformsCommon( uniforms, material ); + refreshUniformsPhong( uniforms, material ); - } + } else if ( material.isMeshStandardMaterial ) { - } + refreshUniformsCommon( uniforms, material ); + refreshUniformsStandard( uniforms, material ); - return shape; /* shape with no holes */ + if ( material.isMeshPhysicalMaterial ) { - } + refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ); + } - var i, il, f, face, - key, index, - allPointsMap = {}; + } else if ( material.isMeshMatcapMaterial ) { - // To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first. + refreshUniformsCommon( uniforms, material ); + refreshUniformsMatcap( uniforms, material ); - var allpoints = contour.concat(); + } else if ( material.isMeshDepthMaterial ) { - for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + refreshUniformsCommon( uniforms, material ); - Array.prototype.push.apply( allpoints, holes[ h ] ); + } else if ( material.isMeshDistanceMaterial ) { - } + refreshUniformsCommon( uniforms, material ); + refreshUniformsDistance( uniforms, material ); - //console.log( "allpoints",allpoints, allpoints.length ); + } else if ( material.isMeshNormalMaterial ) { - // prepare all points map + refreshUniformsCommon( uniforms, material ); - for ( i = 0, il = allpoints.length; i < il; i ++ ) { + } else if ( material.isLineBasicMaterial ) { - key = allpoints[ i ].x + ":" + allpoints[ i ].y; + refreshUniformsLine( uniforms, material ); - if ( allPointsMap[ key ] !== undefined ) { + if ( material.isLineDashedMaterial ) { - console.warn( "THREE.ShapeUtils: Duplicate point", key, i ); + refreshUniformsDash( uniforms, material ); } - allPointsMap[ key ] = i; + } else if ( material.isPointsMaterial ) { - } + refreshUniformsPoints( uniforms, material, pixelRatio, height ); - // remove holes by cutting paths to holes and adding them to the shape - var shapeWithoutHoles = removeHoles( contour, holes ); + } else if ( material.isSpriteMaterial ) { - var triangles = ShapeUtils.triangulate( shapeWithoutHoles, false ); // True returns indices for points of spooled shape - //console.log( "triangles",triangles, triangles.length ); + refreshUniformsSprites( uniforms, material ); - // check all face vertices against all points map + } else if ( material.isShadowMaterial ) { - for ( i = 0, il = triangles.length; i < il; i ++ ) { + uniforms.color.value.copy( material.color ); + uniforms.opacity.value = material.opacity; - face = triangles[ i ]; + } else if ( material.isShaderMaterial ) { - for ( f = 0; f < 3; f ++ ) { + material.uniformsNeedUpdate = false; // #15581 - key = face[ f ].x + ":" + face[ f ].y; + } - index = allPointsMap[ key ]; + } - if ( index !== undefined ) { + function refreshUniformsCommon( uniforms, material ) { - face[ f ] = index; + uniforms.opacity.value = material.opacity; - } + if ( material.color ) { - } + uniforms.diffuse.value.copy( material.color ); } - return triangles.concat(); + if ( material.emissive ) { - }, + uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); - isClockWise: function ( pts ) { + } - return ShapeUtils.area( pts ) < 0; + if ( material.map ) { - } + uniforms.map.value = material.map; - }; + refreshTransformUniform( material.map, uniforms.mapTransform ); - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * Creates extruded geometry from a path shape. - * - * parameters = { - * - * curveSegments: , // number of points on the curves - * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too - * amount: , // Depth to extrude the shape - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into the original shape bevel goes - * bevelSize: , // how far from shape outline is bevel - * bevelSegments: , // number of bevel layers - * - * extrudePath: // curve to extrude shape along - * frames: // containing arrays of tangents, normals, binormals - * - * UVGenerator: // object that provides UV generator functions - * - * } - */ + } - // ExtrudeGeometry + if ( material.alphaMap ) { - function ExtrudeGeometry( shapes, options ) { + uniforms.alphaMap.value = material.alphaMap; - Geometry.call( this ); + refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform ); - this.type = 'ExtrudeGeometry'; + } - this.parameters = { - shapes: shapes, - options: options - }; + if ( material.bumpMap ) { - this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); - this.mergeVertices(); + uniforms.bumpMap.value = material.bumpMap; - } + refreshTransformUniform( material.bumpMap, uniforms.bumpMapTransform ); - ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); - ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; + uniforms.bumpScale.value = material.bumpScale; - // ExtrudeBufferGeometry + if ( material.side === BackSide ) { - function ExtrudeBufferGeometry( shapes, options ) { + uniforms.bumpScale.value *= - 1; - if ( typeof ( shapes ) === "undefined" ) { + } - return; + } - } + if ( material.normalMap ) { - BufferGeometry.call( this ); + uniforms.normalMap.value = material.normalMap; - this.type = 'ExtrudeBufferGeometry'; + refreshTransformUniform( material.normalMap, uniforms.normalMapTransform ); - shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + uniforms.normalScale.value.copy( material.normalScale ); - this.addShapeList( shapes, options ); + if ( material.side === BackSide ) { - this.computeVertexNormals(); + uniforms.normalScale.value.negate(); - // can't really use automatic vertex normals - // as then front and back sides get smoothed too - // should do separate smoothing just for sides + } - //this.computeVertexNormals(); + } - //console.log( "took", ( Date.now() - startTime ) ); + if ( material.displacementMap ) { - } + uniforms.displacementMap.value = material.displacementMap; - ExtrudeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - ExtrudeBufferGeometry.prototype.constructor = ExtrudeBufferGeometry; + refreshTransformUniform( material.displacementMap, uniforms.displacementMapTransform ); - ExtrudeBufferGeometry.prototype.getArrays = function () { + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; - var positionAttribute = this.getAttribute( "position" ); - var verticesArray = positionAttribute ? Array.prototype.slice.call( positionAttribute.array ) : []; + } - var uvAttribute = this.getAttribute( "uv" ); - var uvArray = uvAttribute ? Array.prototype.slice.call( uvAttribute.array ) : []; + if ( material.emissiveMap ) { - var IndexAttribute = this.index; - var indicesArray = IndexAttribute ? Array.prototype.slice.call( IndexAttribute.array ) : []; + uniforms.emissiveMap.value = material.emissiveMap; - return { - position: verticesArray, - uv: uvArray, - index: indicesArray - }; + refreshTransformUniform( material.emissiveMap, uniforms.emissiveMapTransform ); - }; + } - ExtrudeBufferGeometry.prototype.addShapeList = function ( shapes, options ) { + if ( material.specularMap ) { - var sl = shapes.length; - options.arrays = this.getArrays(); + uniforms.specularMap.value = material.specularMap; - for ( var s = 0; s < sl; s ++ ) { + refreshTransformUniform( material.specularMap, uniforms.specularMapTransform ); - var shape = shapes[ s ]; - this.addShape( shape, options ); + } - } + if ( material.alphaTest > 0 ) { - this.setIndex( options.arrays.index ); - this.addAttribute( 'position', new Float32BufferAttribute( options.arrays.position, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( options.arrays.uv, 2 ) ); + uniforms.alphaTest.value = material.alphaTest; - }; + } - ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) { + const envMap = properties.get( material ).envMap; - var arrays = options.arrays ? options.arrays : this.getArrays(); - var verticesArray = arrays.position; - var indicesArray = arrays.index; - var uvArray = arrays.uv; + if ( envMap ) { - var placeholder = []; + uniforms.envMap.value = envMap; + uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1; - var amount = options.amount !== undefined ? options.amount : 100; + uniforms.reflectivity.value = material.reflectivity; + uniforms.ior.value = material.ior; + uniforms.refractionRatio.value = material.refractionRatio; - var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; // 10 - var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; // 8 - var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; + } - var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; // false + if ( material.lightMap ) { - var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + uniforms.lightMap.value = material.lightMap; - var steps = options.steps !== undefined ? options.steps : 1; + // artist-friendly light intensity scaling factor + const scaleFactor = ( renderer.useLegacyLights === true ) ? Math.PI : 1; - var extrudePath = options.extrudePath; - var extrudePts, extrudeByPath = false; + uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor; - // Use default WorldUVGenerator if no UV generators are specified. - var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : ExtrudeGeometry.WorldUVGenerator; + refreshTransformUniform( material.lightMap, uniforms.lightMapTransform ); - var splineTube, binormal, normal, position2; - if ( extrudePath ) { + } - extrudePts = extrudePath.getSpacedPoints( steps ); + if ( material.aoMap ) { - extrudeByPath = true; - bevelEnabled = false; // bevels not supported for path extrusion + uniforms.aoMap.value = material.aoMap; + uniforms.aoMapIntensity.value = material.aoMapIntensity; - // SETUP TNB variables + refreshTransformUniform( material.aoMap, uniforms.aoMapTransform ); - // TODO1 - have a .isClosed in spline? + } - splineTube = options.frames !== undefined ? options.frames : extrudePath.computeFrenetFrames( steps, false ); + } - // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); + function refreshUniformsLine( uniforms, material ) { - binormal = new Vector3(); - normal = new Vector3(); - position2 = new Vector3(); + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; - } + if ( material.map ) { - // Safeguards if bevels are not enabled + uniforms.map.value = material.map; - if ( ! bevelEnabled ) { + refreshTransformUniform( material.map, uniforms.mapTransform ); - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; + } } - // Variables initialization + function refreshUniformsDash( uniforms, material ) { + + uniforms.dashSize.value = material.dashSize; + uniforms.totalSize.value = material.dashSize + material.gapSize; + uniforms.scale.value = material.scale; + + } - var ahole, h, hl; // looping of holes - var scope = this; + function refreshUniformsPoints( uniforms, material, pixelRatio, height ) { - var shapePoints = shape.extractPoints( curveSegments ); + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + uniforms.size.value = material.size * pixelRatio; + uniforms.scale.value = height * 0.5; - var vertices = shapePoints.shape; - var holes = shapePoints.holes; + if ( material.map ) { - var reverse = ! ShapeUtils.isClockWise( vertices ); + uniforms.map.value = material.map; - if ( reverse ) { + refreshTransformUniform( material.map, uniforms.uvTransform ); - vertices = vertices.reverse(); + } - // Maybe we should also check if holes are in the opposite direction, just to be safe ... + if ( material.alphaMap ) { - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + uniforms.alphaMap.value = material.alphaMap; - ahole = holes[ h ]; + refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform ); - if ( ShapeUtils.isClockWise( ahole ) ) { + } - holes[ h ] = ahole.reverse(); + if ( material.alphaTest > 0 ) { - } + uniforms.alphaTest.value = material.alphaTest; } } + function refreshUniformsSprites( uniforms, material ) { + + uniforms.diffuse.value.copy( material.color ); + uniforms.opacity.value = material.opacity; + uniforms.rotation.value = material.rotation; - var faces = ShapeUtils.triangulateShape( vertices, holes ); + if ( material.map ) { - /* Vertices */ + uniforms.map.value = material.map; - var contour = vertices; // vertices has all points but contour has only points of circumference + refreshTransformUniform( material.map, uniforms.mapTransform ); - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + } - ahole = holes[ h ]; + if ( material.alphaMap ) { - vertices = vertices.concat( ahole ); + uniforms.alphaMap.value = material.alphaMap; - } + refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform ); + } - function scalePt2( pt, vec, size ) { + if ( material.alphaTest > 0 ) { - if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" ); + uniforms.alphaTest.value = material.alphaTest; - return vec.clone().multiplyScalar( size ).add( pt ); + } } - var b, bs, t, z, - vert, vlen = vertices.length, - face, flen = faces.length; + function refreshUniformsPhong( uniforms, material ) { + uniforms.specular.value.copy( material.specular ); + uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 ) - // Find directions for point movement + } + function refreshUniformsToon( uniforms, material ) { - function getBevelVec( inPt, inPrev, inNext ) { + if ( material.gradientMap ) { - // computes for inPt the corresponding point inPt' on a new contour - // shifted by 1 unit (length of normalized vector) to the left - // if we walk along contour clockwise, this new contour is outside the old one - // - // inPt' is the intersection of the two lines parallel to the two - // adjacent edges of inPt at a distance of 1 unit on the left side. + uniforms.gradientMap.value = material.gradientMap; - var v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt + } - // good reading for geometry algorithms (here: line-line intersection) - // http://geomalgorithms.com/a05-_intersect-1.html + } - var v_prev_x = inPt.x - inPrev.x, - v_prev_y = inPt.y - inPrev.y; - var v_next_x = inNext.x - inPt.x, - v_next_y = inNext.y - inPt.y; + function refreshUniformsStandard( uniforms, material ) { - var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); + uniforms.metalness.value = material.metalness; - // check for collinear edges - var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + if ( material.metalnessMap ) { - if ( Math.abs( collinear0 ) > Number.EPSILON ) { + uniforms.metalnessMap.value = material.metalnessMap; - // not collinear + refreshTransformUniform( material.metalnessMap, uniforms.metalnessMapTransform ); - // length of vectors for normalizing + } - var v_prev_len = Math.sqrt( v_prev_lensq ); - var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); + uniforms.roughness.value = material.roughness; - // shift adjacent points by unit vectors to the left + if ( material.roughnessMap ) { - var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); - var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); + uniforms.roughnessMap.value = material.roughnessMap; - var ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); - var ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); + refreshTransformUniform( material.roughnessMap, uniforms.roughnessMapTransform ); - // scaling factor for v_prev to intersection point + } - var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - - ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / - ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + const envMap = properties.get( material ).envMap; - // vector from inPt to intersection point + if ( envMap ) { - v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); - v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); + //uniforms.envMap.value = material.envMap; // part of uniforms common + uniforms.envMapIntensity.value = material.envMapIntensity; - // Don't normalize!, otherwise sharp corners become ugly - // but prevent crazy spikes - var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); - if ( v_trans_lensq <= 2 ) { + } - return new Vector2( v_trans_x, v_trans_y ); + } - } else { + function refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) { - shrink_by = Math.sqrt( v_trans_lensq / 2 ); + uniforms.ior.value = material.ior; // also part of uniforms common - } + if ( material.sheen > 0 ) { - } else { + uniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen ); - // handle special case of collinear edges + uniforms.sheenRoughness.value = material.sheenRoughness; - var direction_eq = false; // assumes: opposite - if ( v_prev_x > Number.EPSILON ) { + if ( material.sheenColorMap ) { - if ( v_next_x > Number.EPSILON ) { + uniforms.sheenColorMap.value = material.sheenColorMap; - direction_eq = true; + refreshTransformUniform( material.sheenColorMap, uniforms.sheenColorMapTransform ); - } + } - } else { + if ( material.sheenRoughnessMap ) { - if ( v_prev_x < - Number.EPSILON ) { + uniforms.sheenRoughnessMap.value = material.sheenRoughnessMap; - if ( v_next_x < - Number.EPSILON ) { + refreshTransformUniform( material.sheenRoughnessMap, uniforms.sheenRoughnessMapTransform ); - direction_eq = true; + } - } + } - } else { + if ( material.clearcoat > 0 ) { - if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { + uniforms.clearcoat.value = material.clearcoat; + uniforms.clearcoatRoughness.value = material.clearcoatRoughness; - direction_eq = true; + if ( material.clearcoatMap ) { - } + uniforms.clearcoatMap.value = material.clearcoatMap; - } + refreshTransformUniform( material.clearcoatMap, uniforms.clearcoatMapTransform ); } - if ( direction_eq ) { + if ( material.clearcoatRoughnessMap ) { - // console.log("Warning: lines are a straight sequence"); - v_trans_x = - v_prev_y; - v_trans_y = v_prev_x; - shrink_by = Math.sqrt( v_prev_lensq ); - - } else { + uniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap; - // console.log("Warning: lines are a straight spike"); - v_trans_x = v_prev_x; - v_trans_y = v_prev_y; - shrink_by = Math.sqrt( v_prev_lensq / 2 ); + refreshTransformUniform( material.clearcoatRoughnessMap, uniforms.clearcoatRoughnessMapTransform ); } - } + if ( material.clearcoatNormalMap ) { - return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); + uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap; - } + refreshTransformUniform( material.clearcoatNormalMap, uniforms.clearcoatNormalMapTransform ); + + uniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale ); + + if ( material.side === BackSide ) { + uniforms.clearcoatNormalScale.value.negate(); - var contourMovements = []; + } - for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + } - if ( j === il ) j = 0; - if ( k === il ) k = 0; + } - // (j)---(i)---(k) - // console.log('i,j,k', i, j , k) + if ( material.iridescence > 0 ) { - contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); + uniforms.iridescence.value = material.iridescence; + uniforms.iridescenceIOR.value = material.iridescenceIOR; + uniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[ 0 ]; + uniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[ 1 ]; - } + if ( material.iridescenceMap ) { - var holesMovements = [], - oneHoleMovements, verticesMovements = contourMovements.concat(); + uniforms.iridescenceMap.value = material.iridescenceMap; - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + refreshTransformUniform( material.iridescenceMap, uniforms.iridescenceMapTransform ); - ahole = holes[ h ]; + } - oneHoleMovements = []; + if ( material.iridescenceThicknessMap ) { - for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + uniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap; - if ( j === il ) j = 0; - if ( k === il ) k = 0; + refreshTransformUniform( material.iridescenceThicknessMap, uniforms.iridescenceThicknessMapTransform ); - // (j)---(i)---(k) - oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); + } } - holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); + if ( material.transmission > 0 ) { - } + uniforms.transmission.value = material.transmission; + uniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture; + uniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height ); + + if ( material.transmissionMap ) { + uniforms.transmissionMap.value = material.transmissionMap; - // Loop bevelSegments, 1 for the front, 1 for the back + refreshTransformUniform( material.transmissionMap, uniforms.transmissionMapTransform ); - for ( b = 0; b < bevelSegments; b ++ ) { + } - //for ( b = bevelSegments; b > 0; b -- ) { + uniforms.thickness.value = material.thickness; - t = b / bevelSegments; - z = bevelThickness * Math.cos( t * Math.PI / 2 ); - bs = bevelSize * Math.sin( t * Math.PI / 2 ); + if ( material.thicknessMap ) { - // contract shape + uniforms.thicknessMap.value = material.thicknessMap; - for ( i = 0, il = contour.length; i < il; i ++ ) { + refreshTransformUniform( material.thicknessMap, uniforms.thicknessMapTransform ); - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + } - v( vert.x, vert.y, - z ); + uniforms.attenuationDistance.value = material.attenuationDistance; + uniforms.attenuationColor.value.copy( material.attenuationColor ); } - // expand holes + if ( material.anisotropy > 0 ) { - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + uniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) ); - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; + if ( material.anisotropyMap ) { - for ( i = 0, il = ahole.length; i < il; i ++ ) { + uniforms.anisotropyMap.value = material.anisotropyMap; - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - - v( vert.x, vert.y, - z ); + refreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform ); } } - } + uniforms.specularIntensity.value = material.specularIntensity; + uniforms.specularColor.value.copy( material.specularColor ); - bs = bevelSize; + if ( material.specularColorMap ) { - // Back facing vertices + uniforms.specularColorMap.value = material.specularColorMap; - for ( i = 0; i < vlen; i ++ ) { + refreshTransformUniform( material.specularColorMap, uniforms.specularColorMapTransform ); - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + } - if ( ! extrudeByPath ) { + if ( material.specularIntensityMap ) { - v( vert.x, vert.y, 0 ); + uniforms.specularIntensityMap.value = material.specularIntensityMap; - } else { + refreshTransformUniform( material.specularIntensityMap, uniforms.specularIntensityMapTransform ); + + } - // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); + } - normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); + function refreshUniformsMatcap( uniforms, material ) { - position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); + if ( material.matcap ) { - v( position2.x, position2.y, position2.z ); + uniforms.matcap.value = material.matcap; } } - // Add stepped vertices... - // Including front facing vertices + function refreshUniformsDistance( uniforms, material ) { - var s; + const light = properties.get( material ).light; - for ( s = 1; s <= steps; s ++ ) { + uniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld ); + uniforms.nearDistance.value = light.shadow.camera.near; + uniforms.farDistance.value = light.shadow.camera.far; - for ( i = 0; i < vlen; i ++ ) { + } - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + return { + refreshFogUniforms: refreshFogUniforms, + refreshMaterialUniforms: refreshMaterialUniforms + }; - if ( ! extrudeByPath ) { + } - v( vert.x, vert.y, amount / steps * s ); + function WebGLUniformsGroups( gl, info, capabilities, state ) { - } else { + let buffers = {}; + let updateList = {}; + let allocatedBindingPoints = []; - // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); + const maxBindingPoints = ( capabilities.isWebGL2 ) ? gl.getParameter( gl.MAX_UNIFORM_BUFFER_BINDINGS ) : 0; // binding points are global whereas block indices are per shader program - normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); + function bind( uniformsGroup, program ) { - position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); + const webglProgram = program.program; + state.uniformBlockBinding( uniformsGroup, webglProgram ); - v( position2.x, position2.y, position2.z ); + } - } + function update( uniformsGroup, program ) { - } + let buffer = buffers[ uniformsGroup.id ]; - } + if ( buffer === undefined ) { + + prepareUniformsGroup( uniformsGroup ); + + buffer = createBuffer( uniformsGroup ); + buffers[ uniformsGroup.id ] = buffer; + uniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose ); - // Add bevel segments planes + } + + // ensure to update the binding points/block indices mapping for this program - //for ( b = 1; b <= bevelSegments; b ++ ) { - for ( b = bevelSegments - 1; b >= 0; b -- ) { + const webglProgram = program.program; + state.updateUBOMapping( uniformsGroup, webglProgram ); - t = b / bevelSegments; - z = bevelThickness * Math.cos( t * Math.PI / 2 ); - bs = bevelSize * Math.sin( t * Math.PI / 2 ); + // update UBO once per frame - // contract shape + const frame = info.render.frame; - for ( i = 0, il = contour.length; i < il; i ++ ) { + if ( updateList[ uniformsGroup.id ] !== frame ) { - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - v( vert.x, vert.y, amount + z ); + updateBufferData( uniformsGroup ); + + updateList[ uniformsGroup.id ] = frame; } - // expand holes + } - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + function createBuffer( uniformsGroup ) { - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; + // the setup of an UBO is independent of a particular shader program but global - for ( i = 0, il = ahole.length; i < il; i ++ ) { + const bindingPointIndex = allocateBindingPointIndex(); + uniformsGroup.__bindingPointIndex = bindingPointIndex; - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + const buffer = gl.createBuffer(); + const size = uniformsGroup.__size; + const usage = uniformsGroup.usage; - if ( ! extrudeByPath ) { + gl.bindBuffer( gl.UNIFORM_BUFFER, buffer ); + gl.bufferData( gl.UNIFORM_BUFFER, size, usage ); + gl.bindBuffer( gl.UNIFORM_BUFFER, null ); + gl.bindBufferBase( gl.UNIFORM_BUFFER, bindingPointIndex, buffer ); - v( vert.x, vert.y, amount + z ); + return buffer; - } else { + } - v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); + function allocateBindingPointIndex() { - } + for ( let i = 0; i < maxBindingPoints; i ++ ) { - } + if ( allocatedBindingPoints.indexOf( i ) === - 1 ) { - } + allocatedBindingPoints.push( i ); + return i; - } + } - /* Faces */ + } - // Top and bottom faces + console.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' ); - buildLidFaces(); + return 0; - // Sides faces + } - buildSideFaces(); + function updateBufferData( uniformsGroup ) { + const buffer = buffers[ uniformsGroup.id ]; + const uniforms = uniformsGroup.uniforms; + const cache = uniformsGroup.__cache; - ///// Internal functions + gl.bindBuffer( gl.UNIFORM_BUFFER, buffer ); - function buildLidFaces() { + for ( let i = 0, il = uniforms.length; i < il; i ++ ) { - var start = verticesArray.length/3; + const uniform = uniforms[ i ]; - if ( bevelEnabled ) { + // partly update the buffer if necessary - var layer = 0; // steps + 1 - var offset = vlen * layer; + if ( hasUniformChanged( uniform, i, cache ) === true ) { - // Bottom faces + const offset = uniform.__offset; - for ( i = 0; i < flen; i ++ ) { + const values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ]; - face = faces[ i ]; - f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); + let arrayOffset = 0; - } + for ( let i = 0; i < values.length; i ++ ) { - layer = steps + bevelSegments * 2; - offset = vlen * layer; + const value = values[ i ]; - // Top faces + const info = getUniformSize( value ); - for ( i = 0; i < flen; i ++ ) { + if ( typeof value === 'number' ) { - face = faces[ i ]; - f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); + uniform.__data[ 0 ] = value; + gl.bufferSubData( gl.UNIFORM_BUFFER, offset + arrayOffset, uniform.__data ); - } + } else if ( value.isMatrix3 ) { - } else { + // manually converting 3x3 to 3x4 - // Bottom faces + uniform.__data[ 0 ] = value.elements[ 0 ]; + uniform.__data[ 1 ] = value.elements[ 1 ]; + uniform.__data[ 2 ] = value.elements[ 2 ]; + uniform.__data[ 3 ] = value.elements[ 0 ]; + uniform.__data[ 4 ] = value.elements[ 3 ]; + uniform.__data[ 5 ] = value.elements[ 4 ]; + uniform.__data[ 6 ] = value.elements[ 5 ]; + uniform.__data[ 7 ] = value.elements[ 0 ]; + uniform.__data[ 8 ] = value.elements[ 6 ]; + uniform.__data[ 9 ] = value.elements[ 7 ]; + uniform.__data[ 10 ] = value.elements[ 8 ]; + uniform.__data[ 11 ] = value.elements[ 0 ]; - for ( i = 0; i < flen; i ++ ) { + } else { - face = faces[ i ]; - f3( face[ 2 ], face[ 1 ], face[ 0 ] ); + value.toArray( uniform.__data, arrayOffset ); - } + arrayOffset += info.storage / Float32Array.BYTES_PER_ELEMENT; - // Top faces + } - for ( i = 0; i < flen; i ++ ) { + } - face = faces[ i ]; - f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); + gl.bufferSubData( gl.UNIFORM_BUFFER, offset, uniform.__data ); } } - scope.addGroup( start, verticesArray.length/3 -start, options.material !== undefined ? options.material : 0); + gl.bindBuffer( gl.UNIFORM_BUFFER, null ); } - // Create faces for the z-sides of the shape + function hasUniformChanged( uniform, index, cache ) { - function buildSideFaces() { + const value = uniform.value; - var start = verticesArray.length/3; - var layeroffset = 0; - sidewalls( contour, layeroffset ); - layeroffset += contour.length; + if ( cache[ index ] === undefined ) { - for ( h = 0, hl = holes.length; h < hl; h ++ ) { + // cache entry does not exist so far - ahole = holes[ h ]; - sidewalls( ahole, layeroffset ); + if ( typeof value === 'number' ) { - //, true - layeroffset += ahole.length; + cache[ index ] = value; - } + } else { + const values = Array.isArray( value ) ? value : [ value ]; - scope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1); + const tempValues = []; + for ( let i = 0; i < values.length; i ++ ) { - } + tempValues.push( values[ i ].clone() ); - function sidewalls( contour, layeroffset ) { + } - var j, k; - i = contour.length; + cache[ index ] = tempValues; - while ( -- i >= 0 ) { + } - j = i; - k = i - 1; - if ( k < 0 ) k = contour.length - 1; + return true; - //console.log('b', i,j, i-1, k,vertices.length); + } else { - var s = 0, - sl = steps + bevelSegments * 2; + // compare current value with cached entry - for ( s = 0; s < sl; s ++ ) { + if ( typeof value === 'number' ) { - var slen1 = vlen * s; - var slen2 = vlen * ( s + 1 ); + if ( cache[ index ] !== value ) { - var a = layeroffset + j + slen1, - b = layeroffset + k + slen1, - c = layeroffset + k + slen2, - d = layeroffset + j + slen2; + cache[ index ] = value; + return true; - f4( a, b, c, d, contour, s, sl, j, k ); + } - } + } else { - } + const cachedObjects = Array.isArray( cache[ index ] ) ? cache[ index ] : [ cache[ index ] ]; + const values = Array.isArray( value ) ? value : [ value ]; - } + for ( let i = 0; i < cachedObjects.length; i ++ ) { - function v( x, y, z ) { + const cachedObject = cachedObjects[ i ]; - placeholder.push( x ); - placeholder.push( y ); - placeholder.push( z ); + if ( cachedObject.equals( values[ i ] ) === false ) { - } + cachedObject.copy( values[ i ] ); + return true; + } - function f3( a, b, c ) { + } - addVertex( a ); - addVertex( b ); - addVertex( c ); + } - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + } - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); + return false; } - function f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourIndex1, contourIndex2 ) { + function prepareUniformsGroup( uniformsGroup ) { - addVertex( a ); - addVertex( b ); - addVertex( d ); + // determine total buffer size according to the STD140 layout + // Hint: STD140 is the only supported layout in WebGL 2 - addVertex( b ); - addVertex( c ); - addVertex( d ); + const uniforms = uniformsGroup.uniforms; + let offset = 0; // global buffer offset in bytes + const chunkSize = 16; // size of a chunk in bytes + let chunkOffset = 0; // offset within a single chunk in bytes - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 3 ] ); - - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); - addUV( uvs[ 3 ] ); - - } + for ( let i = 0, l = uniforms.length; i < l; i ++ ) { - function addVertex( index ) { + const uniform = uniforms[ i ]; - indicesArray.push( verticesArray.length / 3 ); - verticesArray.push( placeholder[ index * 3 + 0 ] ); - verticesArray.push( placeholder[ index * 3 + 1 ] ); - verticesArray.push( placeholder[ index * 3 + 2 ] ); + const infos = { + boundary: 0, // bytes + storage: 0 // bytes + }; - } + const values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ]; + for ( let j = 0, jl = values.length; j < jl; j ++ ) { - function addUV( vector2 ) { + const value = values[ j ]; - uvArray.push( vector2.x ); - uvArray.push( vector2.y ); + const info = getUniformSize( value ); - } + infos.boundary += info.boundary; + infos.storage += info.storage; - if ( ! options.arrays ) { + } - this.setIndex( indicesArray ); - this.addAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( options.arrays.uv, 2 ) ); + // the following two properties will be used for partial buffer updates - } + uniform.__data = new Float32Array( infos.storage / Float32Array.BYTES_PER_ELEMENT ); + uniform.__offset = offset; - }; + // - ExtrudeGeometry.WorldUVGenerator = { + if ( i > 0 ) { - generateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) { + chunkOffset = offset % chunkSize; - var a_x = vertices[ indexA * 3 ]; - var a_y = vertices[ indexA * 3 + 1 ]; - var b_x = vertices[ indexB * 3 ]; - var b_y = vertices[ indexB * 3 + 1 ]; - var c_x = vertices[ indexC * 3 ]; - var c_y = vertices[ indexC * 3 + 1 ]; + const remainingSizeInChunk = chunkSize - chunkOffset; - return [ - new Vector2( a_x, a_y ), - new Vector2( b_x, b_y ), - new Vector2( c_x, c_y ) - ]; + // check for chunk overflow - }, + if ( chunkOffset !== 0 && ( remainingSizeInChunk - infos.boundary ) < 0 ) { - generateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) { + // add padding and adjust offset - var a_x = vertices[ indexA * 3 ]; - var a_y = vertices[ indexA * 3 + 1 ]; - var a_z = vertices[ indexA * 3 + 2 ]; - var b_x = vertices[ indexB * 3 ]; - var b_y = vertices[ indexB * 3 + 1 ]; - var b_z = vertices[ indexB * 3 + 2 ]; - var c_x = vertices[ indexC * 3 ]; - var c_y = vertices[ indexC * 3 + 1 ]; - var c_z = vertices[ indexC * 3 + 2 ]; - var d_x = vertices[ indexD * 3 ]; - var d_y = vertices[ indexD * 3 + 1 ]; - var d_z = vertices[ indexD * 3 + 2 ]; - - if ( Math.abs( a_y - b_y ) < 0.01 ) { + offset += ( chunkSize - chunkOffset ); + uniform.__offset = offset; - return [ - new Vector2( a_x, 1 - a_z ), - new Vector2( b_x, 1 - b_z ), - new Vector2( c_x, 1 - c_z ), - new Vector2( d_x, 1 - d_z ) - ]; + } - } else { + } - return [ - new Vector2( a_y, 1 - a_z ), - new Vector2( b_y, 1 - b_z ), - new Vector2( c_y, 1 - c_z ), - new Vector2( d_y, 1 - d_z ) - ]; + offset += infos.storage; } - } - }; - - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author alteredq / http://alteredqualia.com/ - * - * Text = 3D Text - * - * parameters = { - * font: , // font - * - * size: , // size of the text - * height: , // thickness to extrude text - * curveSegments: , // number of points on the curves - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into text bevel goes - * bevelSize: // how far from text outline is bevel - * } - */ - - // TextGeometry + // ensure correct final padding - function TextGeometry( text, parameters ) { + chunkOffset = offset % chunkSize; - Geometry.call( this ); + if ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset ); - this.type = 'TextGeometry'; + // - this.parameters = { - text: text, - parameters: parameters - }; + uniformsGroup.__size = offset; + uniformsGroup.__cache = {}; - this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); - this.mergeVertices(); + return this; - } + } - TextGeometry.prototype = Object.create( Geometry.prototype ); - TextGeometry.prototype.constructor = TextGeometry; + function getUniformSize( value ) { - // TextBufferGeometry + const info = { + boundary: 0, // bytes + storage: 0 // bytes + }; - function TextBufferGeometry( text, parameters ) { + // determine sizes according to STD140 - parameters = parameters || {}; + if ( typeof value === 'number' ) { - var font = parameters.font; + // float/int - if ( ! ( font && font.isFont ) ) { + info.boundary = 4; + info.storage = 4; - console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); - return new Geometry(); + } else if ( value.isVector2 ) { - } + // vec2 - var shapes = font.generateShapes( text, parameters.size, parameters.curveSegments ); + info.boundary = 8; + info.storage = 8; - // translate parameters to ExtrudeGeometry API + } else if ( value.isVector3 || value.isColor ) { - parameters.amount = parameters.height !== undefined ? parameters.height : 50; + // vec3 - // defaults + info.boundary = 16; + info.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes - if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; - if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; - if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; + } else if ( value.isVector4 ) { - ExtrudeBufferGeometry.call( this, shapes, parameters ); + // vec4 - this.type = 'TextBufferGeometry'; + info.boundary = 16; + info.storage = 16; - } + } else if ( value.isMatrix3 ) { - TextBufferGeometry.prototype = Object.create( ExtrudeBufferGeometry.prototype ); - TextBufferGeometry.prototype.constructor = TextBufferGeometry; + // mat3 (in STD140 a 3x3 matrix is represented as 3x4) - /** - * @author mrdoob / http://mrdoob.com/ - * @author benaadams / https://twitter.com/ben_a_adams - * @author Mugen87 / https://github.com/Mugen87 - */ + info.boundary = 48; + info.storage = 48; - // SphereGeometry + } else if ( value.isMatrix4 ) { - function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + // mat4 - Geometry.call( this ); + info.boundary = 64; + info.storage = 64; - this.type = 'SphereGeometry'; + } else if ( value.isTexture ) { - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + console.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' ); - this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); - this.mergeVertices(); + } else { - } + console.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value ); - SphereGeometry.prototype = Object.create( Geometry.prototype ); - SphereGeometry.prototype.constructor = SphereGeometry; + } - // SphereBufferGeometry + return info; - function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + } - BufferGeometry.call( this ); + function onUniformsGroupsDispose( event ) { - this.type = 'SphereBufferGeometry'; + const uniformsGroup = event.target; - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + uniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose ); - radius = radius || 50; + const index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex ); + allocatedBindingPoints.splice( index, 1 ); - widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); - heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); + gl.deleteBuffer( buffers[ uniformsGroup.id ] ); - phiStart = phiStart !== undefined ? phiStart : 0; - phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; + delete buffers[ uniformsGroup.id ]; + delete updateList[ uniformsGroup.id ]; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; + } - var thetaEnd = thetaStart + thetaLength; + function dispose() { - var ix, iy; + for ( const id in buffers ) { - var index = 0; - var grid = []; + gl.deleteBuffer( buffers[ id ] ); - var vertex = new Vector3(); - var normal = new Vector3(); + } - // buffers + allocatedBindingPoints = []; + buffers = {}; + updateList = {}; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + } - // generate vertices, normals and uvs + return { - for ( iy = 0; iy <= heightSegments; iy ++ ) { + bind: bind, + update: update, - var verticesRow = []; + dispose: dispose - var v = iy / heightSegments; + }; - for ( ix = 0; ix <= widthSegments; ix ++ ) { + } - var u = ix / widthSegments; + function createCanvasElement() { - // vertex + const canvas = createElementNS( 'canvas' ); + canvas.style.display = 'block'; + return canvas; - vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); - vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + } - vertices.push( vertex.x, vertex.y, vertex.z ); + class WebGLRenderer { - // normal + constructor( parameters = {} ) { - normal.set( vertex.x, vertex.y, vertex.z ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + const { + canvas = createCanvasElement(), + context = null, + depth = true, + stencil = true, + alpha = false, + antialias = false, + premultipliedAlpha = true, + preserveDrawingBuffer = false, + powerPreference = 'default', + failIfMajorPerformanceCaveat = false, + } = parameters; - // uv + this.isWebGLRenderer = true; - uvs.push( u, 1 - v ); + let _alpha; - verticesRow.push( index ++ ); + if ( context !== null ) { - } + _alpha = context.getContextAttributes().alpha; - grid.push( verticesRow ); + } else { - } + _alpha = alpha; - // indices + } - for ( iy = 0; iy < heightSegments; iy ++ ) { + const uintClearColor = new Uint32Array( 4 ); + const intClearColor = new Int32Array( 4 ); - for ( ix = 0; ix < widthSegments; ix ++ ) { + let currentRenderList = null; + let currentRenderState = null; - var a = grid[ iy ][ ix + 1 ]; - var b = grid[ iy ][ ix ]; - var c = grid[ iy + 1 ][ ix ]; - var d = grid[ iy + 1 ][ ix + 1 ]; + // render() can be called from within a callback triggered by another render. + // We track this so that the nested render call gets its list and state isolated from the parent render call. - if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); - if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); + const renderListStack = []; + const renderStateStack = []; - } + // public properties - } + this.domElement = canvas; - // build geometry + // Debug configuration container + this.debug = { - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + /** + * Enables error checking and reporting when shader programs are being compiled + * @type {boolean} + */ + checkShaderErrors: true, + /** + * Callback for custom error reporting. + * @type {?Function} + */ + onShaderError: null + }; - } + // clearing - SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; + this.autoClear = true; + this.autoClearColor = true; + this.autoClearDepth = true; + this.autoClearStencil = true; - /** - * @author Kaleb Murphy - * @author Mugen87 / https://github.com/Mugen87 - */ + // scene graph - // RingGeometry + this.sortObjects = true; - function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + // user-defined clipping - Geometry.call( this ); + this.clippingPlanes = []; + this.localClippingEnabled = false; - this.type = 'RingGeometry'; + // physically based shading - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.outputColorSpace = SRGBColorSpace; - this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); - this.mergeVertices(); + // physical lights - } + this.useLegacyLights = true; - RingGeometry.prototype = Object.create( Geometry.prototype ); - RingGeometry.prototype.constructor = RingGeometry; + // tone mapping - // RingBufferGeometry + this.toneMapping = NoToneMapping; + this.toneMappingExposure = 1.0; - function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + // internal properties - BufferGeometry.call( this ); + const _this = this; - this.type = 'RingBufferGeometry'; + let _isContextLost = false; - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + // internal state cache - innerRadius = innerRadius || 20; - outerRadius = outerRadius || 50; + let _currentActiveCubeFace = 0; + let _currentActiveMipmapLevel = 0; + let _currentRenderTarget = null; + let _currentMaterialId = - 1; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + let _currentCamera = null; - thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; - phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; + const _currentViewport = new Vector4(); + const _currentScissor = new Vector4(); + let _currentScissorTest = null; - // buffers + const _currentClearColor = new Color( 0x000000 ); + let _currentClearAlpha = 0; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // - // some helper variables + let _width = canvas.width; + let _height = canvas.height; - var segment; - var radius = innerRadius; - var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); - var vertex = new Vector3(); - var uv = new Vector2(); - var j, i; + let _pixelRatio = 1; + let _opaqueSort = null; + let _transparentSort = null; - // generate vertices, normals and uvs + const _viewport = new Vector4( 0, 0, _width, _height ); + const _scissor = new Vector4( 0, 0, _width, _height ); + let _scissorTest = false; - for ( j = 0; j <= phiSegments; j ++ ) { + // frustum - for ( i = 0; i <= thetaSegments; i ++ ) { + const _frustum = new Frustum(); - // values are generate from the inside of the ring to the outside + // clipping - segment = thetaStart + i / thetaSegments * thetaLength; + let _clippingEnabled = false; + let _localClippingEnabled = false; - // vertex + // transmission - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + let _transmissionRenderTarget = null; - vertices.push( vertex.x, vertex.y, vertex.z ); + // camera matrices cache - // normal + const _projScreenMatrix = new Matrix4(); - normals.push( 0, 0, 1 ); + const _vector2 = new Vector2(); + const _vector3 = new Vector3(); - // uv + const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; - uv.x = ( vertex.x / outerRadius + 1 ) / 2; - uv.y = ( vertex.y / outerRadius + 1 ) / 2; + function getTargetPixelRatio() { - uvs.push( uv.x, uv.y ); + return _currentRenderTarget === null ? _pixelRatio : 1; } - // increase the radius for next row of vertices + // initialize - radius += radiusStep; + let _gl = context; - } + function getContext( contextNames, contextAttributes ) { - // indices + for ( let i = 0; i < contextNames.length; i ++ ) { - for ( j = 0; j < phiSegments; j ++ ) { + const contextName = contextNames[ i ]; + const context = canvas.getContext( contextName, contextAttributes ); + if ( context !== null ) return context; - var thetaSegmentLevel = j * ( thetaSegments + 1 ); + } - for ( i = 0; i < thetaSegments; i ++ ) { + return null; - segment = i + thetaSegmentLevel; + } - var a = segment; - var b = segment + thetaSegments + 1; - var c = segment + thetaSegments + 2; - var d = segment + 1; + try { - // faces + const contextAttributes = { + alpha: true, + depth, + stencil, + antialias, + premultipliedAlpha, + preserveDrawingBuffer, + powerPreference, + failIfMajorPerformanceCaveat, + }; - indices.push( a, b, d ); - indices.push( b, c, d ); + // OffscreenCanvas does not have setAttribute, see #22811 + if ( 'setAttribute' in canvas ) canvas.setAttribute( 'data-engine', `three.js r${REVISION}` ); - } + // event listeners must be registered before WebGL context is created, see #12753 + canvas.addEventListener( 'webglcontextlost', onContextLost, false ); + canvas.addEventListener( 'webglcontextrestored', onContextRestore, false ); + canvas.addEventListener( 'webglcontextcreationerror', onContextCreationError, false ); - } + if ( _gl === null ) { - // build geometry + const contextNames = [ 'webgl2', 'webgl', 'experimental-webgl' ]; - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + if ( _this.isWebGL1Renderer === true ) { - } + contextNames.shift(); - RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - RingBufferGeometry.prototype.constructor = RingBufferGeometry; + } - /** - * @author astrodud / http://astrodud.isgreat.org/ - * @author zz85 / https://github.com/zz85 - * @author bhouston / http://clara.io - * @author Mugen87 / https://github.com/Mugen87 - */ + _gl = getContext( contextNames, contextAttributes ); - // LatheGeometry + if ( _gl === null ) { - function LatheGeometry( points, segments, phiStart, phiLength ) { + if ( getContext( contextNames ) ) { - Geometry.call( this ); + throw new Error( 'Error creating WebGL context with your selected attributes.' ); - this.type = 'LatheGeometry'; + } else { - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + throw new Error( 'Error creating WebGL context.' ); - this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); - this.mergeVertices(); + } - } + } - LatheGeometry.prototype = Object.create( Geometry.prototype ); - LatheGeometry.prototype.constructor = LatheGeometry; + } - // LatheBufferGeometry + if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 - function LatheBufferGeometry( points, segments, phiStart, phiLength ) { + console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' ); - BufferGeometry.call( this ); + } - this.type = 'LatheBufferGeometry'; + // Some experimental-webgl implementations do not have getShaderPrecisionFormat - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + if ( _gl.getShaderPrecisionFormat === undefined ) { - segments = Math.floor( segments ) || 12; - phiStart = phiStart || 0; - phiLength = phiLength || Math.PI * 2; + _gl.getShaderPrecisionFormat = function () { - // clamp phiLength so it's in range of [ 0, 2PI ] + return { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 }; - phiLength = _Math.clamp( phiLength, 0, Math.PI * 2 ); + }; + } - // buffers + } catch ( error ) { - var indices = []; - var vertices = []; - var uvs = []; + console.error( 'THREE.WebGLRenderer: ' + error.message ); + throw error; - // helper variables + } - var base; - var inverseSegments = 1.0 / segments; - var vertex = new Vector3(); - var uv = new Vector2(); - var i, j; + let extensions, capabilities, state, info; + let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects; + let programCache, materials, renderLists, renderStates, clipping, shadowMap; - // generate vertices and uvs + let background, morphtargets, bufferRenderer, indexedBufferRenderer; - for ( i = 0; i <= segments; i ++ ) { + let utils, bindingStates, uniformsGroups; - var phi = phiStart + i * inverseSegments * phiLength; + function initGLContext() { - var sin = Math.sin( phi ); - var cos = Math.cos( phi ); + extensions = new WebGLExtensions( _gl ); - for ( j = 0; j <= ( points.length - 1 ); j ++ ) { + capabilities = new WebGLCapabilities( _gl, extensions, parameters ); - // vertex + extensions.init( capabilities ); - vertex.x = points[ j ].x * sin; - vertex.y = points[ j ].y; - vertex.z = points[ j ].x * cos; + utils = new WebGLUtils( _gl, extensions, capabilities ); - vertices.push( vertex.x, vertex.y, vertex.z ); + state = new WebGLState( _gl, extensions, capabilities ); - // uv + info = new WebGLInfo( _gl ); + properties = new WebGLProperties(); + textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ); + cubemaps = new WebGLCubeMaps( _this ); + cubeuvmaps = new WebGLCubeUVMaps( _this ); + attributes = new WebGLAttributes( _gl, capabilities ); + bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities ); + geometries = new WebGLGeometries( _gl, attributes, info, bindingStates ); + objects = new WebGLObjects( _gl, geometries, attributes, info ); + morphtargets = new WebGLMorphtargets( _gl, capabilities, textures ); + clipping = new WebGLClipping( properties ); + programCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ); + materials = new WebGLMaterials( _this, properties ); + renderLists = new WebGLRenderLists(); + renderStates = new WebGLRenderStates( extensions, capabilities ); + background = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha ); + shadowMap = new WebGLShadowMap( _this, objects, capabilities ); + uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state ); - uv.x = i / segments; - uv.y = j / ( points.length - 1 ); + bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities ); + indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities ); - uvs.push( uv.x, uv.y ); + info.programs = programCache.programs; + _this.capabilities = capabilities; + _this.extensions = extensions; + _this.properties = properties; + _this.renderLists = renderLists; + _this.shadowMap = shadowMap; + _this.state = state; + _this.info = info; } - } + initGLContext(); - // indices + // xr - for ( i = 0; i < segments; i ++ ) { + const xr = new WebXRManager( _this, _gl ); - for ( j = 0; j < ( points.length - 1 ); j ++ ) { + this.xr = xr; - base = j + i * points.length; + // API - var a = base; - var b = base + points.length; - var c = base + points.length + 1; - var d = base + 1; + this.getContext = function () { - // faces + return _gl; - indices.push( a, b, d ); - indices.push( b, c, d ); + }; - } + this.getContextAttributes = function () { - } + return _gl.getContextAttributes(); - // build geometry + }; - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.forceContextLoss = function () { - // generate normals + const extension = extensions.get( 'WEBGL_lose_context' ); + if ( extension ) extension.loseContext(); - this.computeVertexNormals(); + }; - // if the geometry is closed, we need to average the normals along the seam. - // because the corresponding vertices are identical (but still have different UVs). + this.forceContextRestore = function () { - if ( phiLength === Math.PI * 2 ) { + const extension = extensions.get( 'WEBGL_lose_context' ); + if ( extension ) extension.restoreContext(); - var normals = this.attributes.normal.array; - var n1 = new Vector3(); - var n2 = new Vector3(); - var n = new Vector3(); + }; - // this is the buffer offset for the last line of vertices + this.getPixelRatio = function () { - base = segments * points.length * 3; + return _pixelRatio; - for ( i = 0, j = 0; i < points.length; i ++, j += 3 ) { + }; - // select the normal of the vertex in the first line + this.setPixelRatio = function ( value ) { - n1.x = normals[ j + 0 ]; - n1.y = normals[ j + 1 ]; - n1.z = normals[ j + 2 ]; + if ( value === undefined ) return; - // select the normal of the vertex in the last line + _pixelRatio = value; - n2.x = normals[ base + j + 0 ]; - n2.y = normals[ base + j + 1 ]; - n2.z = normals[ base + j + 2 ]; + this.setSize( _width, _height, false ); - // average normals + }; - n.addVectors( n1, n2 ).normalize(); + this.getSize = function ( target ) { - // assign the new values to both normals + return target.set( _width, _height ); - normals[ j + 0 ] = normals[ base + j + 0 ] = n.x; - normals[ j + 1 ] = normals[ base + j + 1 ] = n.y; - normals[ j + 2 ] = normals[ base + j + 2 ] = n.z; + }; - } + this.setSize = function ( width, height, updateStyle = true ) { - } + if ( xr.isPresenting ) { - } + console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' ); + return; - LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; + } - /** - * @author jonobr1 / http://jonobr1.com - * @author Mugen87 / https://github.com/Mugen87 - */ + _width = width; + _height = height; - // ShapeGeometry + canvas.width = Math.floor( width * _pixelRatio ); + canvas.height = Math.floor( height * _pixelRatio ); - function ShapeGeometry( shapes, curveSegments ) { + if ( updateStyle === true ) { - Geometry.call( this ); + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; - this.type = 'ShapeGeometry'; + } - if ( typeof curveSegments === 'object' ) { + this.setViewport( 0, 0, width, height ); - console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); + }; - curveSegments = curveSegments.curveSegments; + this.getDrawingBufferSize = function ( target ) { - } + return target.set( _width * _pixelRatio, _height * _pixelRatio ).floor(); - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + }; - this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); - this.mergeVertices(); + this.setDrawingBufferSize = function ( width, height, pixelRatio ) { - } + _width = width; + _height = height; - ShapeGeometry.prototype = Object.create( Geometry.prototype ); - ShapeGeometry.prototype.constructor = ShapeGeometry; + _pixelRatio = pixelRatio; - // ShapeBufferGeometry + canvas.width = Math.floor( width * pixelRatio ); + canvas.height = Math.floor( height * pixelRatio ); - function ShapeBufferGeometry( shapes, curveSegments ) { + this.setViewport( 0, 0, width, height ); - BufferGeometry.call( this ); + }; - this.type = 'ShapeBufferGeometry'; + this.getCurrentViewport = function ( target ) { - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + return target.copy( _currentViewport ); - curveSegments = curveSegments || 12; + }; - // buffers + this.getViewport = function ( target ) { - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + return target.copy( _viewport ); - // helper variables + }; - var groupStart = 0; - var groupCount = 0; + this.setViewport = function ( x, y, width, height ) { - // allow single and array values for "shapes" parameter + if ( x.isVector4 ) { - if ( Array.isArray( shapes ) === false ) { + _viewport.set( x.x, x.y, x.z, x.w ); - addShape( shapes ); + } else { - } else { + _viewport.set( x, y, width, height ); - for ( var i = 0; i < shapes.length; i ++ ) { + } - addShape( shapes[ i ] ); + state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() ); - this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support + }; - groupStart += groupCount; - groupCount = 0; + this.getScissor = function ( target ) { - } + return target.copy( _scissor ); - } + }; - // build geometry + this.setScissor = function ( x, y, width, height ) { - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + if ( x.isVector4 ) { + _scissor.set( x.x, x.y, x.z, x.w ); - // helper functions + } else { - function addShape( shape ) { + _scissor.set( x, y, width, height ); - var i, l, shapeHole; + } - var indexOffset = vertices.length / 3; - var points = shape.extractPoints( curveSegments ); + state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() ); - var shapeVertices = points.shape; - var shapeHoles = points.holes; + }; - // check direction of vertices + this.getScissorTest = function () { - if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { + return _scissorTest; - shapeVertices = shapeVertices.reverse(); + }; - // also check if holes are in the opposite direction + this.setScissorTest = function ( boolean ) { - for ( i = 0, l = shapeHoles.length; i < l; i ++ ) { + state.setScissorTest( _scissorTest = boolean ); - shapeHole = shapeHoles[ i ]; + }; - if ( ShapeUtils.isClockWise( shapeHole ) === true ) { + this.setOpaqueSort = function ( method ) { - shapeHoles[ i ] = shapeHole.reverse(); + _opaqueSort = method; - } + }; - } + this.setTransparentSort = function ( method ) { - } + _transparentSort = method; - var faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); + }; - // join vertices of inner and outer paths to a single array + // Clearing - for ( i = 0, l = shapeHoles.length; i < l; i ++ ) { + this.getClearColor = function ( target ) { - shapeHole = shapeHoles[ i ]; - shapeVertices = shapeVertices.concat( shapeHole ); + return target.copy( background.getClearColor() ); - } + }; - // vertices, normals, uvs + this.setClearColor = function () { - for ( i = 0, l = shapeVertices.length; i < l; i ++ ) { + background.setClearColor.apply( background, arguments ); - var vertex = shapeVertices[ i ]; + }; - vertices.push( vertex.x, vertex.y, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( vertex.x, vertex.y ); // world uvs + this.getClearAlpha = function () { - } + return background.getClearAlpha(); - // incides + }; - for ( i = 0, l = faces.length; i < l; i ++ ) { + this.setClearAlpha = function () { - var face = faces[ i ]; + background.setClearAlpha.apply( background, arguments ); - var a = face[ 0 ] + indexOffset; - var b = face[ 1 ] + indexOffset; - var c = face[ 2 ] + indexOffset; + }; - indices.push( a, b, c ); - groupCount += 3; + this.clear = function ( color = true, depth = true, stencil = true ) { - } + let bits = 0; - } + if ( color ) { - } + // check if we're trying to clear an integer target + let isIntegerFormat = false; + if ( _currentRenderTarget !== null ) { - ShapeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - ShapeBufferGeometry.prototype.constructor = ShapeBufferGeometry; + const targetFormat = _currentRenderTarget.texture.format; + isIntegerFormat = targetFormat === RGBAIntegerFormat || + targetFormat === RGIntegerFormat || + targetFormat === RedIntegerFormat; - /** - * @author WestLangley / http://github.com/WestLangley - * @author Mugen87 / https://github.com/Mugen87 - */ + } - function EdgesGeometry( geometry, thresholdAngle ) { + // use the appropriate clear functions to clear the target if it's a signed + // or unsigned integer target + if ( isIntegerFormat ) { - BufferGeometry.call( this ); + const targetType = _currentRenderTarget.texture.type; + const isUnsignedType = targetType === UnsignedByteType || + targetType === UnsignedIntType || + targetType === UnsignedShortType || + targetType === UnsignedInt248Type || + targetType === UnsignedShort4444Type || + targetType === UnsignedShort5551Type; - this.type = 'EdgesGeometry'; + const clearColor = background.getClearColor(); + const a = background.getClearAlpha(); + const r = clearColor.r; + const g = clearColor.g; + const b = clearColor.b; - this.parameters = { - thresholdAngle: thresholdAngle - }; + const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer; - thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; + if ( isUnsignedType ) { - // buffer + uintClearColor[ 0 ] = r; + uintClearColor[ 1 ] = g; + uintClearColor[ 2 ] = b; + uintClearColor[ 3 ] = a; + _gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor ); - var vertices = []; + } else { - // helper variables + intClearColor[ 0 ] = r; + intClearColor[ 1 ] = g; + intClearColor[ 2 ] = b; + intClearColor[ 3 ] = a; + _gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor ); - var thresholdDot = Math.cos( _Math.DEG2RAD * thresholdAngle ); - var edge = [ 0, 0 ], edges = {}, edge1, edge2; - var key, keys = [ 'a', 'b', 'c' ]; + } - // prepare source geometry + } else { - var geometry2; + bits |= _gl.COLOR_BUFFER_BIT; - if ( geometry.isBufferGeometry ) { + } - geometry2 = new Geometry(); - geometry2.fromBufferGeometry( geometry ); + } - } else { + if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT; + if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT; - geometry2 = geometry.clone(); + _gl.clear( bits ); - } + }; - geometry2.mergeVertices(); - geometry2.computeFaceNormals(); + this.clearColor = function () { - var sourceVertices = geometry2.vertices; - var faces = geometry2.faces; + this.clear( true, false, false ); - // now create a data structure where each entry represents an edge with its adjoining faces + }; - for ( var i = 0, l = faces.length; i < l; i ++ ) { + this.clearDepth = function () { - var face = faces[ i ]; + this.clear( false, true, false ); - for ( var j = 0; j < 3; j ++ ) { + }; - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); - edge[ 1 ] = Math.max( edge1, edge2 ); + this.clearStencil = function () { - key = edge[ 0 ] + ',' + edge[ 1 ]; + this.clear( false, false, true ); - if ( edges[ key ] === undefined ) { + }; - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; + // - } else { + this.dispose = function () { - edges[ key ].face2 = i; + canvas.removeEventListener( 'webglcontextlost', onContextLost, false ); + canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false ); + canvas.removeEventListener( 'webglcontextcreationerror', onContextCreationError, false ); - } + renderLists.dispose(); + renderStates.dispose(); + properties.dispose(); + cubemaps.dispose(); + cubeuvmaps.dispose(); + objects.dispose(); + bindingStates.dispose(); + uniformsGroups.dispose(); + programCache.dispose(); - } + xr.dispose(); - } + xr.removeEventListener( 'sessionstart', onXRSessionStart ); + xr.removeEventListener( 'sessionend', onXRSessionEnd ); - // generate vertices + if ( _transmissionRenderTarget ) { - for ( key in edges ) { + _transmissionRenderTarget.dispose(); + _transmissionRenderTarget = null; - var e = edges[ key ]; + } - // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. + animation.stop(); - if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { + }; - var vertex = sourceVertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + // Events - vertex = sourceVertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + function onContextLost( event ) { - } + event.preventDefault(); - } + console.log( 'THREE.WebGLRenderer: Context Lost.' ); - // build geometry + _isContextLost = true; - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + } - } + function onContextRestore( /* event */ ) { - EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); - EdgesGeometry.prototype.constructor = EdgesGeometry; + console.log( 'THREE.WebGLRenderer: Context Restored.' ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + _isContextLost = false; - // CylinderGeometry + const infoAutoReset = info.autoReset; + const shadowMapEnabled = shadowMap.enabled; + const shadowMapAutoUpdate = shadowMap.autoUpdate; + const shadowMapNeedsUpdate = shadowMap.needsUpdate; + const shadowMapType = shadowMap.type; - function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + initGLContext(); - Geometry.call( this ); + info.autoReset = infoAutoReset; + shadowMap.enabled = shadowMapEnabled; + shadowMap.autoUpdate = shadowMapAutoUpdate; + shadowMap.needsUpdate = shadowMapNeedsUpdate; + shadowMap.type = shadowMapType; - this.type = 'CylinderGeometry'; + } - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + function onContextCreationError( event ) { - this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); - this.mergeVertices(); + console.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage ); - } + } - CylinderGeometry.prototype = Object.create( Geometry.prototype ); - CylinderGeometry.prototype.constructor = CylinderGeometry; + function onMaterialDispose( event ) { - // CylinderBufferGeometry + const material = event.target; - function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + material.removeEventListener( 'dispose', onMaterialDispose ); - BufferGeometry.call( this ); + deallocateMaterial( material ); - this.type = 'CylinderBufferGeometry'; + } - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + // Buffer deallocation - var scope = this; + function deallocateMaterial( material ) { - radiusTop = radiusTop !== undefined ? radiusTop : 20; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 20; - height = height !== undefined ? height : 100; + releaseMaterialProgramReferences( material ); - radialSegments = Math.floor( radialSegments ) || 8; - heightSegments = Math.floor( heightSegments ) || 1; + properties.remove( material ); - openEnded = openEnded !== undefined ? openEnded : false; - thetaStart = thetaStart !== undefined ? thetaStart : 0.0; - thetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI; + } - // buffers - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + function releaseMaterialProgramReferences( material ) { - // helper variables + const programs = properties.get( material ).programs; - var index = 0; - var indexArray = []; - var halfHeight = height / 2; - var groupStart = 0; + if ( programs !== undefined ) { - // generate geometry + programs.forEach( function ( program ) { - generateTorso(); + programCache.releaseProgram( program ); - if ( openEnded === false ) { + } ); - if ( radiusTop > 0 ) generateCap( true ); - if ( radiusBottom > 0 ) generateCap( false ); + if ( material.isShaderMaterial ) { - } + programCache.releaseShaderCache( material ); - // build geometry + } - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } - function generateTorso() { + } - var x, y; - var normal = new Vector3(); - var vertex = new Vector3(); + // Buffer rendering - var groupCount = 0; + this.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) { - // this will be used to calculate the normal - var slope = ( radiusBottom - radiusTop ) / height; + if ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null) - // generate vertices, normals and uvs + const frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 ); - for ( y = 0; y <= heightSegments; y ++ ) { + const program = setProgram( camera, scene, geometry, material, object ); - var indexRow = []; + state.setMaterial( material, frontFaceCW ); - var v = y / heightSegments; + // - // calculate the radius of the current row + let index = geometry.index; + let rangeFactor = 1; - var radius = v * ( radiusBottom - radiusTop ) + radiusTop; + if ( material.wireframe === true ) { - for ( x = 0; x <= radialSegments; x ++ ) { + index = geometries.getWireframeAttribute( geometry ); + rangeFactor = 2; - var u = x / radialSegments; + } - var theta = u * thetaLength + thetaStart; + // - var sinTheta = Math.sin( theta ); - var cosTheta = Math.cos( theta ); + const drawRange = geometry.drawRange; + const position = geometry.attributes.position; - // vertex + let drawStart = drawRange.start * rangeFactor; + let drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor; - vertex.x = radius * sinTheta; - vertex.y = - v * height + halfHeight; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + if ( group !== null ) { - // normal + drawStart = Math.max( drawStart, group.start * rangeFactor ); + drawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor ); - normal.set( sinTheta, slope, cosTheta ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + } - // uv + if ( index !== null ) { - uvs.push( u, 1 - v ); + drawStart = Math.max( drawStart, 0 ); + drawEnd = Math.min( drawEnd, index.count ); - // save index of vertex in respective row + } else if ( position !== undefined && position !== null ) { - indexRow.push( index ++ ); + drawStart = Math.max( drawStart, 0 ); + drawEnd = Math.min( drawEnd, position.count ); } - // now save vertices of the row in our index array + const drawCount = drawEnd - drawStart; - indexArray.push( indexRow ); + if ( drawCount < 0 || drawCount === Infinity ) return; - } + // - // generate indices + bindingStates.setup( object, material, program, geometry, index ); - for ( x = 0; x < radialSegments; x ++ ) { + let attribute; + let renderer = bufferRenderer; - for ( y = 0; y < heightSegments; y ++ ) { + if ( index !== null ) { - // we use the index array to access the correct indices + attribute = attributes.get( index ); - var a = indexArray[ y ][ x ]; - var b = indexArray[ y + 1 ][ x ]; - var c = indexArray[ y + 1 ][ x + 1 ]; - var d = indexArray[ y ][ x + 1 ]; + renderer = indexedBufferRenderer; + renderer.setIndex( attribute ); - // faces + } - indices.push( a, b, d ); - indices.push( b, c, d ); + // - // update group counter + if ( object.isMesh ) { - groupCount += 6; + if ( material.wireframe === true ) { - } + state.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() ); + renderer.setMode( _gl.LINES ); - } + } else { - // add a group to the geometry. this will ensure multi material support + renderer.setMode( _gl.TRIANGLES ); - scope.addGroup( groupStart, groupCount, 0 ); + } - // calculate new start value for groups + } else if ( object.isLine ) { - groupStart += groupCount; + let lineWidth = material.linewidth; - } + if ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material - function generateCap( top ) { + state.setLineWidth( lineWidth * getTargetPixelRatio() ); - var x, centerIndexStart, centerIndexEnd; + if ( object.isLineSegments ) { - var uv = new Vector2(); - var vertex = new Vector3(); + renderer.setMode( _gl.LINES ); - var groupCount = 0; + } else if ( object.isLineLoop ) { - var radius = ( top === true ) ? radiusTop : radiusBottom; - var sign = ( top === true ) ? 1 : - 1; + renderer.setMode( _gl.LINE_LOOP ); - // save the index of the first center vertex - centerIndexStart = index; + } else { - // first we generate the center vertex data of the cap. - // because the geometry needs one set of uvs per face, - // we must generate a center vertex per face/segment + renderer.setMode( _gl.LINE_STRIP ); - for ( x = 1; x <= radialSegments; x ++ ) { + } - // vertex + } else if ( object.isPoints ) { - vertices.push( 0, halfHeight * sign, 0 ); + renderer.setMode( _gl.POINTS ); - // normal + } else if ( object.isSprite ) { - normals.push( 0, sign, 0 ); + renderer.setMode( _gl.TRIANGLES ); - // uv + } - uvs.push( 0.5, 0.5 ); + if ( object.isInstancedMesh ) { - // increase index + renderer.renderInstances( drawStart, drawCount, object.count ); - index ++; + } else if ( geometry.isInstancedBufferGeometry ) { - } + const maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity; + const instanceCount = Math.min( geometry.instanceCount, maxInstanceCount ); - // save the index of the last center vertex + renderer.renderInstances( drawStart, drawCount, instanceCount ); - centerIndexEnd = index; + } else { - // now we generate the surrounding vertices, normals and uvs + renderer.render( drawStart, drawCount ); - for ( x = 0; x <= radialSegments; x ++ ) { + } - var u = x / radialSegments; - var theta = u * thetaLength + thetaStart; + }; - var cosTheta = Math.cos( theta ); - var sinTheta = Math.sin( theta ); + // Compile - // vertex + this.compile = function ( scene, camera ) { - vertex.x = radius * sinTheta; - vertex.y = halfHeight * sign; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + function prepare( material, scene, object ) { - // normal + if ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) { - normals.push( 0, sign, 0 ); + material.side = BackSide; + material.needsUpdate = true; + getProgram( material, scene, object ); - // uv + material.side = FrontSide; + material.needsUpdate = true; + getProgram( material, scene, object ); - uv.x = ( cosTheta * 0.5 ) + 0.5; - uv.y = ( sinTheta * 0.5 * sign ) + 0.5; - uvs.push( uv.x, uv.y ); + material.side = DoubleSide; - // increase index + } else { - index ++; + getProgram( material, scene, object ); - } + } - // generate indices + } - for ( x = 0; x < radialSegments; x ++ ) { + currentRenderState = renderStates.get( scene ); + currentRenderState.init(); - var c = centerIndexStart + x; - var i = centerIndexEnd + x; + renderStateStack.push( currentRenderState ); - if ( top === true ) { + scene.traverseVisible( function ( object ) { - // face top + if ( object.isLight && object.layers.test( camera.layers ) ) { - indices.push( i, i + 1, c ); + currentRenderState.pushLight( object ); - } else { + if ( object.castShadow ) { - // face bottom + currentRenderState.pushShadow( object ); - indices.push( i + 1, i, c ); + } - } + } - groupCount += 3; + } ); - } + currentRenderState.setupLights( _this.useLegacyLights ); - // add a group to the geometry. this will ensure multi material support + scene.traverse( function ( object ) { - scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + const material = object.material; - // calculate new start value for groups + if ( material ) { - groupStart += groupCount; + if ( Array.isArray( material ) ) { - } + for ( let i = 0; i < material.length; i ++ ) { - } + const material2 = material[ i ]; - CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; + prepare( material2, scene, object ); - /** - * @author abelnation / http://github.com/abelnation - */ + } - // ConeGeometry + } else { - function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + prepare( material, scene, object ); - CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + } - this.type = 'ConeGeometry'; + } - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + } ); - } + renderStateStack.pop(); + currentRenderState = null; - ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); - ConeGeometry.prototype.constructor = ConeGeometry; + }; - // ConeBufferGeometry + // Animation Loop - function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + let onAnimationFrameCallback = null; - CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + function onAnimationFrame( time ) { - this.type = 'ConeBufferGeometry'; + if ( onAnimationFrameCallback ) onAnimationFrameCallback( time ); - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + } - } + function onXRSessionStart() { - ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); - ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; + animation.stop(); - /** - * @author benaadams / https://twitter.com/ben_a_adams - * @author Mugen87 / https://github.com/Mugen87 - * @author hughes - */ + } - // CircleGeometry + function onXRSessionEnd() { - function CircleGeometry( radius, segments, thetaStart, thetaLength ) { + animation.start(); - Geometry.call( this ); + } - this.type = 'CircleGeometry'; + const animation = new WebGLAnimation(); + animation.setAnimationLoop( onAnimationFrame ); - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + if ( typeof self !== 'undefined' ) animation.setContext( self ); - this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.setAnimationLoop = function ( callback ) { - } + onAnimationFrameCallback = callback; + xr.setAnimationLoop( callback ); - CircleGeometry.prototype = Object.create( Geometry.prototype ); - CircleGeometry.prototype.constructor = CircleGeometry; + ( callback === null ) ? animation.stop() : animation.start(); - // CircleBufferGeometry + }; - function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { + xr.addEventListener( 'sessionstart', onXRSessionStart ); + xr.addEventListener( 'sessionend', onXRSessionEnd ); - BufferGeometry.call( this ); + // Rendering - this.type = 'CircleBufferGeometry'; + this.render = function ( scene, camera ) { - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + if ( camera !== undefined && camera.isCamera !== true ) { - radius = radius || 50; - segments = segments !== undefined ? Math.max( 3, segments ) : 8; + console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); + return; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + } - // buffers + if ( _isContextLost === true ) return; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // update scene graph - // helper variables + if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld(); - var i, s; - var vertex = new Vector3(); - var uv = new Vector2(); + // update camera matrices and frustum - // center point + if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld(); - vertices.push( 0, 0, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( 0.5, 0.5 ); + if ( xr.enabled === true && xr.isPresenting === true ) { - for ( s = 0, i = 3; s <= segments; s ++, i += 3 ) { + camera = xr.updateCameraXR( camera ); // use XR camera for rendering - var segment = thetaStart + s / segments * thetaLength; + } - // vertex + // + if ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget ); - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + currentRenderState = renderStates.get( scene, renderStateStack.length ); + currentRenderState.init(); - vertices.push( vertex.x, vertex.y, vertex.z ); + renderStateStack.push( currentRenderState ); - // normal + _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); + _frustum.setFromProjectionMatrix( _projScreenMatrix ); - normals.push( 0, 0, 1 ); + _localClippingEnabled = this.localClippingEnabled; + _clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled ); - // uvs + currentRenderList = renderLists.get( scene, renderListStack.length ); + currentRenderList.init(); - uv.x = ( vertices[ i ] / radius + 1 ) / 2; - uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; + renderListStack.push( currentRenderList ); - uvs.push( uv.x, uv.y ); + projectObject( scene, camera, 0, _this.sortObjects ); - } + currentRenderList.finish(); - // indices + if ( _this.sortObjects === true ) { - for ( i = 1; i <= segments; i ++ ) { + currentRenderList.sort( _opaqueSort, _transparentSort ); - indices.push( i, i + 1, 0 ); + } - } + // - // build geometry + if ( _clippingEnabled === true ) clipping.beginShadows(); - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + const shadowsArray = currentRenderState.state.shadowsArray; - } + shadowMap.render( shadowsArray, scene, camera ); - CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; + if ( _clippingEnabled === true ) clipping.endShadows(); + // + if ( this.info.autoReset === true ) this.info.reset(); - var Geometries = Object.freeze({ - WireframeGeometry: WireframeGeometry, - ParametricGeometry: ParametricGeometry, - ParametricBufferGeometry: ParametricBufferGeometry, - TetrahedronGeometry: TetrahedronGeometry, - TetrahedronBufferGeometry: TetrahedronBufferGeometry, - OctahedronGeometry: OctahedronGeometry, - OctahedronBufferGeometry: OctahedronBufferGeometry, - IcosahedronGeometry: IcosahedronGeometry, - IcosahedronBufferGeometry: IcosahedronBufferGeometry, - DodecahedronGeometry: DodecahedronGeometry, - DodecahedronBufferGeometry: DodecahedronBufferGeometry, - PolyhedronGeometry: PolyhedronGeometry, - PolyhedronBufferGeometry: PolyhedronBufferGeometry, - TubeGeometry: TubeGeometry, - TubeBufferGeometry: TubeBufferGeometry, - TorusKnotGeometry: TorusKnotGeometry, - TorusKnotBufferGeometry: TorusKnotBufferGeometry, - TorusGeometry: TorusGeometry, - TorusBufferGeometry: TorusBufferGeometry, - TextGeometry: TextGeometry, - TextBufferGeometry: TextBufferGeometry, - SphereGeometry: SphereGeometry, - SphereBufferGeometry: SphereBufferGeometry, - RingGeometry: RingGeometry, - RingBufferGeometry: RingBufferGeometry, - PlaneGeometry: PlaneGeometry, - PlaneBufferGeometry: PlaneBufferGeometry, - LatheGeometry: LatheGeometry, - LatheBufferGeometry: LatheBufferGeometry, - ShapeGeometry: ShapeGeometry, - ShapeBufferGeometry: ShapeBufferGeometry, - ExtrudeGeometry: ExtrudeGeometry, - ExtrudeBufferGeometry: ExtrudeBufferGeometry, - EdgesGeometry: EdgesGeometry, - ConeGeometry: ConeGeometry, - ConeBufferGeometry: ConeBufferGeometry, - CylinderGeometry: CylinderGeometry, - CylinderBufferGeometry: CylinderBufferGeometry, - CircleGeometry: CircleGeometry, - CircleBufferGeometry: CircleBufferGeometry, - BoxGeometry: BoxGeometry, - BoxBufferGeometry: BoxBufferGeometry - }); + this.info.render.frame ++; - /** - * @author mrdoob / http://mrdoob.com/ - * - * parameters = { - * opacity: - * } - */ + // - function ShadowMaterial( parameters ) { + background.render( currentRenderList, scene ); - ShaderMaterial.call( this, { - uniforms: UniformsUtils.merge( [ - UniformsLib.lights, - { - opacity: { value: 1.0 } - } - ] ), - vertexShader: ShaderChunk[ 'shadow_vert' ], - fragmentShader: ShaderChunk[ 'shadow_frag' ] - } ); + // render scene - this.lights = true; - this.transparent = true; + currentRenderState.setupLights( _this.useLegacyLights ); - Object.defineProperties( this, { - opacity: { - enumerable: true, - get: function () { - return this.uniforms.opacity.value; - }, - set: function ( value ) { - this.uniforms.opacity.value = value; - } - } - } ); + if ( camera.isArrayCamera ) { - this.setValues( parameters ); + const cameras = camera.cameras; - } + for ( let i = 0, l = cameras.length; i < l; i ++ ) { - ShadowMaterial.prototype = Object.create( ShaderMaterial.prototype ); - ShadowMaterial.prototype.constructor = ShadowMaterial; + const camera2 = cameras[ i ]; - ShadowMaterial.prototype.isShadowMaterial = true; + renderScene( currentRenderList, scene, camera2, camera2.viewport ); - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function RawShaderMaterial( parameters ) { + } else { - ShaderMaterial.call( this, parameters ); + renderScene( currentRenderList, scene, camera ); - this.type = 'RawShaderMaterial'; + } - } + // - RawShaderMaterial.prototype = Object.create( ShaderMaterial.prototype ); - RawShaderMaterial.prototype.constructor = RawShaderMaterial; + if ( _currentRenderTarget !== null ) { - RawShaderMaterial.prototype.isRawShaderMaterial = true; + // resolve multisample renderbuffers to a single-sample texture if necessary - /** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * color: , - * roughness: , - * metalness: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * roughnessMap: new THREE.Texture( ), - * - * metalnessMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), - * envMapIntensity: - * - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ + textures.updateMultisampleRenderTarget( _currentRenderTarget ); - function MeshStandardMaterial( parameters ) { + // Generate mipmap if we're using any kind of mipmap filtering - Material.call( this ); + textures.updateRenderTargetMipmap( _currentRenderTarget ); - this.defines = { 'STANDARD': '' }; + } - this.type = 'MeshStandardMaterial'; + // - this.color = new Color( 0xffffff ); // diffuse - this.roughness = 0.5; - this.metalness = 0.5; + if ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera ); - this.map = null; + // _gl.finish(); - this.lightMap = null; - this.lightMapIntensity = 1.0; + bindingStates.resetDefaultState(); + _currentMaterialId = - 1; + _currentCamera = null; - this.aoMap = null; - this.aoMapIntensity = 1.0; + renderStateStack.pop(); - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; + if ( renderStateStack.length > 0 ) { - this.bumpMap = null; - this.bumpScale = 1; + currentRenderState = renderStateStack[ renderStateStack.length - 1 ]; - this.normalMap = null; - this.normalScale = new Vector2( 1, 1 ); + } else { - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; + currentRenderState = null; - this.roughnessMap = null; + } - this.metalnessMap = null; + renderListStack.pop(); - this.alphaMap = null; + if ( renderListStack.length > 0 ) { - this.envMap = null; - this.envMapIntensity = 1.0; + currentRenderList = renderListStack[ renderListStack.length - 1 ]; - this.refractionRatio = 0.98; + } else { - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; + currentRenderList = null; - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; + } - this.setValues( parameters ); + }; - } + function projectObject( object, camera, groupOrder, sortObjects ) { - MeshStandardMaterial.prototype = Object.create( Material.prototype ); - MeshStandardMaterial.prototype.constructor = MeshStandardMaterial; + if ( object.visible === false ) return; - MeshStandardMaterial.prototype.isMeshStandardMaterial = true; + const visible = object.layers.test( camera.layers ); - MeshStandardMaterial.prototype.copy = function ( source ) { + if ( visible ) { - Material.prototype.copy.call( this, source ); + if ( object.isGroup ) { - this.defines = { 'STANDARD': '' }; + groupOrder = object.renderOrder; - this.color.copy( source.color ); - this.roughness = source.roughness; - this.metalness = source.metalness; + } else if ( object.isLOD ) { - this.map = source.map; + if ( object.autoUpdate === true ) object.update( camera ); - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; + } else if ( object.isLight ) { - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; + currentRenderState.pushLight( object ); - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; + if ( object.castShadow ) { - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; + currentRenderState.pushShadow( object ); - this.normalMap = source.normalMap; - this.normalScale.copy( source.normalScale ); + } - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; + } else if ( object.isSprite ) { - this.roughnessMap = source.roughnessMap; + if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) { - this.metalnessMap = source.metalnessMap; + if ( sortObjects ) { - this.alphaMap = source.alphaMap; + _vector3.setFromMatrixPosition( object.matrixWorld ) + .applyMatrix4( _projScreenMatrix ); - this.envMap = source.envMap; - this.envMapIntensity = source.envMapIntensity; + } - this.refractionRatio = source.refractionRatio; + const geometry = objects.update( object ); + const material = object.material; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; + if ( material.visible ) { - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; + currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); - return this; + } - }; + } - /** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * reflectivity: - * } - */ + } else if ( object.isMesh || object.isLine || object.isPoints ) { - function MeshPhysicalMaterial( parameters ) { + if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { - MeshStandardMaterial.call( this ); + if ( object.isSkinnedMesh ) { - this.defines = { 'PHYSICAL': '' }; + // update skeleton only once in a frame - this.type = 'MeshPhysicalMaterial'; + if ( object.skeleton.frame !== info.render.frame ) { - this.reflectivity = 0.5; // maps to F0 = 0.04 + object.skeleton.update(); + object.skeleton.frame = info.render.frame; - this.clearCoat = 0.0; - this.clearCoatRoughness = 0.0; + } - this.setValues( parameters ); + } - } + const geometry = objects.update( object ); + const material = object.material; - MeshPhysicalMaterial.prototype = Object.create( MeshStandardMaterial.prototype ); - MeshPhysicalMaterial.prototype.constructor = MeshPhysicalMaterial; + if ( sortObjects ) { - MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true; + if ( object.boundingSphere !== undefined ) { - MeshPhysicalMaterial.prototype.copy = function ( source ) { + if ( object.boundingSphere === null ) object.computeBoundingSphere(); + _vector3.copy( object.boundingSphere.center ); - MeshStandardMaterial.prototype.copy.call( this, source ); + } else { - this.defines = { 'PHYSICAL': '' }; + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + _vector3.copy( geometry.boundingSphere.center ); - this.reflectivity = source.reflectivity; + } - this.clearCoat = source.clearCoat; - this.clearCoatRoughness = source.clearCoatRoughness; + _vector3 + .applyMatrix4( object.matrixWorld ) + .applyMatrix4( _projScreenMatrix ); - return this; + } - }; + if ( Array.isArray( material ) ) { - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * specular: , - * shininess: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ + const groups = geometry.groups; - function MeshPhongMaterial( parameters ) { + for ( let i = 0, l = groups.length; i < l; i ++ ) { - Material.call( this ); + const group = groups[ i ]; + const groupMaterial = material[ group.materialIndex ]; - this.type = 'MeshPhongMaterial'; + if ( groupMaterial && groupMaterial.visible ) { - this.color = new Color( 0xffffff ); // diffuse - this.specular = new Color( 0x111111 ); - this.shininess = 30; + currentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group ); - this.map = null; + } - this.lightMap = null; - this.lightMapIntensity = 1.0; + } - this.aoMap = null; - this.aoMapIntensity = 1.0; + } else if ( material.visible ) { - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; + currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); - this.bumpMap = null; - this.bumpScale = 1; + } - this.normalMap = null; - this.normalScale = new Vector2( 1, 1 ); + } - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; + } - this.specularMap = null; + } - this.alphaMap = null; + const children = object.children; - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; + for ( let i = 0, l = children.length; i < l; i ++ ) { - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; + projectObject( children[ i ], camera, groupOrder, sortObjects ); - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; + } - this.setValues( parameters ); + } - } + function renderScene( currentRenderList, scene, camera, viewport ) { - MeshPhongMaterial.prototype = Object.create( Material.prototype ); - MeshPhongMaterial.prototype.constructor = MeshPhongMaterial; + const opaqueObjects = currentRenderList.opaque; + const transmissiveObjects = currentRenderList.transmissive; + const transparentObjects = currentRenderList.transparent; - MeshPhongMaterial.prototype.isMeshPhongMaterial = true; + currentRenderState.setupLightsView( camera ); - MeshPhongMaterial.prototype.copy = function ( source ) { + if ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera ); - Material.prototype.copy.call( this, source ); + if ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ); - this.color.copy( source.color ); - this.specular.copy( source.specular ); - this.shininess = source.shininess; + if ( viewport ) state.viewport( _currentViewport.copy( viewport ) ); - this.map = source.map; + if ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera ); + if ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera ); + if ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera ); - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; + // Ensure depth buffer writing is enabled so it can be cleared on next render - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; + state.buffers.depth.setTest( true ); + state.buffers.depth.setMask( true ); + state.buffers.color.setMask( true ); - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; + state.setPolygonOffset( false ); - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; + } - this.normalMap = source.normalMap; - this.normalScale.copy( source.normalScale ); + function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) { - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; + const isWebGL2 = capabilities.isWebGL2; - this.specularMap = source.specularMap; + if ( _transmissionRenderTarget === null ) { - this.alphaMap = source.alphaMap; + _transmissionRenderTarget = new WebGLRenderTarget( 1, 1, { + generateMipmaps: true, + type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType, + minFilter: LinearMipmapLinearFilter, + samples: ( isWebGL2 && antialias === true ) ? 4 : 0 + } ); - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; + // debug - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; + /* + const geometry = new PlaneGeometry(); + const material = new MeshBasicMaterial( { map: _transmissionRenderTarget.texture } ); - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; + const mesh = new Mesh( geometry, material ); + scene.add( mesh ); + */ - return this; + } - }; + _this.getDrawingBufferSize( _vector2 ); - /** - * @author takahirox / http://github.com/takahirox - * - * parameters = { - * gradientMap: new THREE.Texture( ) - * } - */ + if ( isWebGL2 ) { - function MeshToonMaterial( parameters ) { + _transmissionRenderTarget.setSize( _vector2.x, _vector2.y ); - MeshPhongMaterial.call( this ); + } else { - this.defines = { 'TOON': '' }; + _transmissionRenderTarget.setSize( floorPowerOfTwo( _vector2.x ), floorPowerOfTwo( _vector2.y ) ); - this.type = 'MeshToonMaterial'; + } - this.gradientMap = null; + // - this.setValues( parameters ); + const currentRenderTarget = _this.getRenderTarget(); + _this.setRenderTarget( _transmissionRenderTarget ); - } + _this.getClearColor( _currentClearColor ); + _currentClearAlpha = _this.getClearAlpha(); + if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 ); - MeshToonMaterial.prototype = Object.create( MeshPhongMaterial.prototype ); - MeshToonMaterial.prototype.constructor = MeshToonMaterial; + _this.clear(); - MeshToonMaterial.prototype.isMeshToonMaterial = true; + // Turn off the features which can affect the frag color for opaque objects pass. + // Otherwise they are applied twice in opaque objects pass and transmission objects pass. + const currentToneMapping = _this.toneMapping; + _this.toneMapping = NoToneMapping; - MeshToonMaterial.prototype.copy = function ( source ) { + renderObjects( opaqueObjects, scene, camera ); - MeshPhongMaterial.prototype.copy.call( this, source ); + textures.updateMultisampleRenderTarget( _transmissionRenderTarget ); + textures.updateRenderTargetMipmap( _transmissionRenderTarget ); - this.gradientMap = source.gradientMap; + let renderTargetNeedsUpdate = false; - return this; + for ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) { - }; + const renderItem = transmissiveObjects[ i ]; - /** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * opacity: , - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * wireframe: , - * wireframeLinewidth: - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ + const object = renderItem.object; + const geometry = renderItem.geometry; + const material = renderItem.material; + const group = renderItem.group; - function MeshNormalMaterial( parameters ) { + if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) { - Material.call( this ); + const currentSide = material.side; - this.type = 'MeshNormalMaterial'; + material.side = BackSide; + material.needsUpdate = true; - this.bumpMap = null; - this.bumpScale = 1; + renderObject( object, scene, camera, geometry, material, group ); - this.normalMap = null; - this.normalScale = new Vector2( 1, 1 ); + material.side = currentSide; + material.needsUpdate = true; - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; + renderTargetNeedsUpdate = true; - this.wireframe = false; - this.wireframeLinewidth = 1; + } - this.fog = false; - this.lights = false; + } - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; + if ( renderTargetNeedsUpdate === true ) { - this.setValues( parameters ); + textures.updateMultisampleRenderTarget( _transmissionRenderTarget ); + textures.updateRenderTargetMipmap( _transmissionRenderTarget ); - } + } - MeshNormalMaterial.prototype = Object.create( Material.prototype ); - MeshNormalMaterial.prototype.constructor = MeshNormalMaterial; + _this.setRenderTarget( currentRenderTarget ); - MeshNormalMaterial.prototype.isMeshNormalMaterial = true; + _this.setClearColor( _currentClearColor, _currentClearAlpha ); - MeshNormalMaterial.prototype.copy = function ( source ) { + _this.toneMapping = currentToneMapping; - Material.prototype.copy.call( this, source ); + } - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; + function renderObjects( renderList, scene, camera ) { - this.normalMap = source.normalMap; - this.normalScale.copy( source.normalScale ); + const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null; - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; + for ( let i = 0, l = renderList.length; i < l; i ++ ) { - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; + const renderItem = renderList[ i ]; - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; + const object = renderItem.object; + const geometry = renderItem.geometry; + const material = overrideMaterial === null ? renderItem.material : overrideMaterial; + const group = renderItem.group; - return this; + if ( object.layers.test( camera.layers ) ) { - }; + renderObject( object, scene, camera, geometry, material, group ); - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ + } - function MeshLambertMaterial( parameters ) { + } - Material.call( this ); + } - this.type = 'MeshLambertMaterial'; + function renderObject( object, scene, camera, geometry, material, group ) { - this.color = new Color( 0xffffff ); // diffuse + object.onBeforeRender( _this, scene, camera, geometry, material, group ); - this.map = null; + object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); + object.normalMatrix.getNormalMatrix( object.modelViewMatrix ); - this.lightMap = null; - this.lightMapIntensity = 1.0; + material.onBeforeRender( _this, scene, camera, geometry, object, group ); - this.aoMap = null; - this.aoMapIntensity = 1.0; + if ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) { - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; + material.side = BackSide; + material.needsUpdate = true; + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); - this.specularMap = null; + material.side = FrontSide; + material.needsUpdate = true; + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); - this.alphaMap = null; + material.side = DoubleSide; - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; + } else { - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; + _this.renderBufferDirect( camera, scene, geometry, material, object, group ); - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; + } - this.setValues( parameters ); + object.onAfterRender( _this, scene, camera, geometry, material, group ); - } + } - MeshLambertMaterial.prototype = Object.create( Material.prototype ); - MeshLambertMaterial.prototype.constructor = MeshLambertMaterial; + function getProgram( material, scene, object ) { - MeshLambertMaterial.prototype.isMeshLambertMaterial = true; + if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ... - MeshLambertMaterial.prototype.copy = function ( source ) { + const materialProperties = properties.get( material ); - Material.prototype.copy.call( this, source ); + const lights = currentRenderState.state.lights; + const shadowsArray = currentRenderState.state.shadowsArray; - this.color.copy( source.color ); + const lightsStateVersion = lights.state.version; - this.map = source.map; + const parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object ); + const programCacheKey = programCache.getProgramCacheKey( parameters ); - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; + let programs = materialProperties.programs; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; + // always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; + materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; + materialProperties.fog = scene.fog; + materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment ); - this.specularMap = source.specularMap; + if ( programs === undefined ) { - this.alphaMap = source.alphaMap; + // new material - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; + material.addEventListener( 'dispose', onMaterialDispose ); - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; + programs = new Map(); + materialProperties.programs = programs; - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; + } - return this; + let program = programs.get( programCacheKey ); - }; + if ( program !== undefined ) { - /** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * linewidth: , - * - * scale: , - * dashSize: , - * gapSize: - * } - */ + // early out if program and light state is identical - function LineDashedMaterial( parameters ) { + if ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) { - Material.call( this ); + updateCommonMaterialProperties( material, parameters ); - this.type = 'LineDashedMaterial'; + return program; - this.color = new Color( 0xffffff ); + } - this.linewidth = 1; + } else { - this.scale = 1; - this.dashSize = 3; - this.gapSize = 1; + parameters.uniforms = programCache.getUniforms( material ); - this.lights = false; + material.onBuild( object, parameters, _this ); - this.setValues( parameters ); + material.onBeforeCompile( parameters, _this ); - } + program = programCache.acquireProgram( parameters, programCacheKey ); + programs.set( programCacheKey, program ); - LineDashedMaterial.prototype = Object.create( Material.prototype ); - LineDashedMaterial.prototype.constructor = LineDashedMaterial; + materialProperties.uniforms = parameters.uniforms; - LineDashedMaterial.prototype.isLineDashedMaterial = true; + } - LineDashedMaterial.prototype.copy = function ( source ) { + const uniforms = materialProperties.uniforms; - Material.prototype.copy.call( this, source ); + if ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) { - this.color.copy( source.color ); + uniforms.clippingPlanes = clipping.uniform; - this.linewidth = source.linewidth; + } - this.scale = source.scale; - this.dashSize = source.dashSize; - this.gapSize = source.gapSize; + updateCommonMaterialProperties( material, parameters ); - return this; + // store the light setup it was created for - }; + materialProperties.needsLights = materialNeedsLights( material ); + materialProperties.lightsStateVersion = lightsStateVersion; + if ( materialProperties.needsLights ) { + // wire up the material to this renderer's lighting state - var Materials = Object.freeze({ - ShadowMaterial: ShadowMaterial, - SpriteMaterial: SpriteMaterial, - RawShaderMaterial: RawShaderMaterial, - ShaderMaterial: ShaderMaterial, - PointsMaterial: PointsMaterial, - MeshPhysicalMaterial: MeshPhysicalMaterial, - MeshStandardMaterial: MeshStandardMaterial, - MeshPhongMaterial: MeshPhongMaterial, - MeshToonMaterial: MeshToonMaterial, - MeshNormalMaterial: MeshNormalMaterial, - MeshLambertMaterial: MeshLambertMaterial, - MeshDepthMaterial: MeshDepthMaterial, - MeshBasicMaterial: MeshBasicMaterial, - LineDashedMaterial: LineDashedMaterial, - LineBasicMaterial: LineBasicMaterial, - Material: Material - }); + uniforms.ambientLightColor.value = lights.state.ambient; + uniforms.lightProbe.value = lights.state.probe; + uniforms.directionalLights.value = lights.state.directional; + uniforms.directionalLightShadows.value = lights.state.directionalShadow; + uniforms.spotLights.value = lights.state.spot; + uniforms.spotLightShadows.value = lights.state.spotShadow; + uniforms.rectAreaLights.value = lights.state.rectArea; + uniforms.ltc_1.value = lights.state.rectAreaLTC1; + uniforms.ltc_2.value = lights.state.rectAreaLTC2; + uniforms.pointLights.value = lights.state.point; + uniforms.pointLightShadows.value = lights.state.pointShadow; + uniforms.hemisphereLights.value = lights.state.hemi; - /** - * @author mrdoob / http://mrdoob.com/ - */ + uniforms.directionalShadowMap.value = lights.state.directionalShadowMap; + uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix; + uniforms.spotShadowMap.value = lights.state.spotShadowMap; + uniforms.spotLightMatrix.value = lights.state.spotLightMatrix; + uniforms.spotLightMap.value = lights.state.spotLightMap; + uniforms.pointShadowMap.value = lights.state.pointShadowMap; + uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; + // TODO (abelnation): add area lights shadow info to uniforms - var Cache = { + } - enabled: false, + const progUniforms = program.getUniforms(); + const uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); - files: {}, + materialProperties.currentProgram = program; + materialProperties.uniformsList = uniformsList; - add: function ( key, file ) { + return program; - if ( this.enabled === false ) return; + } - // console.log( 'THREE.Cache', 'Adding key:', key ); + function updateCommonMaterialProperties( material, parameters ) { - this.files[ key ] = file; + const materialProperties = properties.get( material ); - }, + materialProperties.outputColorSpace = parameters.outputColorSpace; + materialProperties.instancing = parameters.instancing; + materialProperties.skinning = parameters.skinning; + materialProperties.morphTargets = parameters.morphTargets; + materialProperties.morphNormals = parameters.morphNormals; + materialProperties.morphColors = parameters.morphColors; + materialProperties.morphTargetsCount = parameters.morphTargetsCount; + materialProperties.numClippingPlanes = parameters.numClippingPlanes; + materialProperties.numIntersection = parameters.numClipIntersection; + materialProperties.vertexAlphas = parameters.vertexAlphas; + materialProperties.vertexTangents = parameters.vertexTangents; + materialProperties.toneMapping = parameters.toneMapping; - get: function ( key ) { + } - if ( this.enabled === false ) return; + function setProgram( camera, scene, geometry, material, object ) { - // console.log( 'THREE.Cache', 'Checking key:', key ); + if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ... - return this.files[ key ]; + textures.resetTextureUnits(); - }, + const fog = scene.fog; + const environment = material.isMeshStandardMaterial ? scene.environment : null; + const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ); + const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment ); + const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4; + const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 ); + const morphTargets = !! geometry.morphAttributes.position; + const morphNormals = !! geometry.morphAttributes.normal; + const morphColors = !! geometry.morphAttributes.color; + const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; - remove: function ( key ) { + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; - delete this.files[ key ]; + const materialProperties = properties.get( material ); + const lights = currentRenderState.state.lights; - }, + if ( _clippingEnabled === true ) { - clear: function () { + if ( _localClippingEnabled === true || camera !== _currentCamera ) { - this.files = {}; + const useCache = + camera === _currentCamera && + material.id === _currentMaterialId; - } + // we might want to call this function with some ClippingGroup + // object instead of the material, once it becomes feasible + // (#8465, #8379) + clipping.setState( material, camera, useCache ); - }; + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function LoadingManager( onLoad, onProgress, onError ) { + // - var scope = this; + let needsProgramChange = false; - var isLoading = false, itemsLoaded = 0, itemsTotal = 0; + if ( material.version === materialProperties.__version ) { - this.onStart = undefined; - this.onLoad = onLoad; - this.onProgress = onProgress; - this.onError = onError; + if ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) { - this.itemStart = function ( url ) { + needsProgramChange = true; - itemsTotal ++; + } else if ( materialProperties.outputColorSpace !== colorSpace ) { - if ( isLoading === false ) { + needsProgramChange = true; - if ( scope.onStart !== undefined ) { + } else if ( object.isInstancedMesh && materialProperties.instancing === false ) { - scope.onStart( url, itemsLoaded, itemsTotal ); + needsProgramChange = true; - } + } else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) { - } + needsProgramChange = true; - isLoading = true; + } else if ( object.isSkinnedMesh && materialProperties.skinning === false ) { - }; + needsProgramChange = true; - this.itemEnd = function ( url ) { + } else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) { - itemsLoaded ++; + needsProgramChange = true; - if ( scope.onProgress !== undefined ) { + } else if ( materialProperties.envMap !== envMap ) { - scope.onProgress( url, itemsLoaded, itemsTotal ); + needsProgramChange = true; - } + } else if ( material.fog === true && materialProperties.fog !== fog ) { - if ( itemsLoaded === itemsTotal ) { + needsProgramChange = true; - isLoading = false; + } else if ( materialProperties.numClippingPlanes !== undefined && + ( materialProperties.numClippingPlanes !== clipping.numPlanes || + materialProperties.numIntersection !== clipping.numIntersection ) ) { - if ( scope.onLoad !== undefined ) { + needsProgramChange = true; - scope.onLoad(); + } else if ( materialProperties.vertexAlphas !== vertexAlphas ) { - } + needsProgramChange = true; - } + } else if ( materialProperties.vertexTangents !== vertexTangents ) { - }; + needsProgramChange = true; - this.itemError = function ( url ) { + } else if ( materialProperties.morphTargets !== morphTargets ) { - if ( scope.onError !== undefined ) { + needsProgramChange = true; - scope.onError( url ); + } else if ( materialProperties.morphNormals !== morphNormals ) { - } + needsProgramChange = true; - }; + } else if ( materialProperties.morphColors !== morphColors ) { - } + needsProgramChange = true; - var DefaultLoadingManager = new LoadingManager(); + } else if ( materialProperties.toneMapping !== toneMapping ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + needsProgramChange = true; - function FileLoader( manager ) { + } else if ( capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount ) { - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + needsProgramChange = true; - } + } - Object.assign( FileLoader.prototype, { + } else { - load: function ( url, onLoad, onProgress, onError ) { + needsProgramChange = true; + materialProperties.__version = material.version; - if ( url === undefined ) url = ''; + } - if ( this.path !== undefined ) url = this.path + url; + // - var scope = this; + let program = materialProperties.currentProgram; - var cached = Cache.get( url ); + if ( needsProgramChange === true ) { - if ( cached !== undefined ) { + program = getProgram( material, scene, object ); - scope.manager.itemStart( url ); + } - setTimeout( function () { + let refreshProgram = false; + let refreshMaterial = false; + let refreshLights = false; - if ( onLoad ) onLoad( cached ); + const p_uniforms = program.getUniforms(), + m_uniforms = materialProperties.uniforms; - scope.manager.itemEnd( url ); + if ( state.useProgram( program.program ) ) { - }, 0 ); + refreshProgram = true; + refreshMaterial = true; + refreshLights = true; - return cached; + } - } + if ( material.id !== _currentMaterialId ) { - // Check for data: URI - var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; - var dataUriRegexResult = url.match( dataUriRegex ); + _currentMaterialId = material.id; - // Safari can not handle Data URIs through XMLHttpRequest so process manually - if ( dataUriRegexResult ) { + refreshMaterial = true; - var mimeType = dataUriRegexResult[ 1 ]; - var isBase64 = !! dataUriRegexResult[ 2 ]; - var data = dataUriRegexResult[ 3 ]; + } - data = window.decodeURIComponent( data ); + if ( refreshProgram || _currentCamera !== camera ) { - if ( isBase64 ) data = window.atob( data ); + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); - try { + if ( capabilities.logarithmicDepthBuffer ) { - var response; - var responseType = ( this.responseType || '' ).toLowerCase(); + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); - switch ( responseType ) { + } - case 'arraybuffer': - case 'blob': + if ( _currentCamera !== camera ) { - response = new ArrayBuffer( data.length ); + _currentCamera = camera; - var view = new Uint8Array( response ); + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: - for ( var i = 0; i < data.length; i ++ ) { + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done - view[ i ] = data.charCodeAt( i ); + } - } + // load material specific uniforms + // (shader material also gets them for the sake of genericity) - if ( responseType === 'blob' ) { + if ( material.isShaderMaterial || + material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshStandardMaterial || + material.envMap ) { - response = new Blob( [ response ], { type: mimeType } ); + const uCamPos = p_uniforms.map.cameraPosition; - } + if ( uCamPos !== undefined ) { - break; + uCamPos.setValue( _gl, + _vector3.setFromMatrixPosition( camera.matrixWorld ) ); - case 'document': + } - var parser = new DOMParser(); - response = parser.parseFromString( data, mimeType ); + } - break; + if ( material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshLambertMaterial || + material.isMeshBasicMaterial || + material.isMeshStandardMaterial || + material.isShaderMaterial ) { - case 'json': + p_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true ); - response = JSON.parse( data ); + } - break; + if ( material.isMeshPhongMaterial || + material.isMeshToonMaterial || + material.isMeshLambertMaterial || + material.isMeshBasicMaterial || + material.isMeshStandardMaterial || + material.isShaderMaterial || + material.isShadowMaterial || + object.isSkinnedMesh ) { - default: // 'text' or other + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); - response = data; + } - break; + } - } + // skinning and morph target uniforms must be set even if material didn't change + // auto-setting of texture unit for bone and morph texture must go before other textures + // otherwise textures used for skinning and morphing can take over texture units reserved for other material textures - // Wait for next browser tick - window.setTimeout( function () { + if ( object.isSkinnedMesh ) { - if ( onLoad ) onLoad( response ); + p_uniforms.setOptional( _gl, object, 'bindMatrix' ); + p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' ); - scope.manager.itemEnd( url ); + const skeleton = object.skeleton; - }, 0 ); + if ( skeleton ) { - } catch ( error ) { + if ( capabilities.floatVertexTextures ) { + + if ( skeleton.boneTexture === null ) skeleton.computeBoneTexture(); + + p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures ); + p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); - // Wait for next browser tick - window.setTimeout( function () { + } else { - if ( onError ) onError( error ); + console.warn( 'THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required.' ); - scope.manager.itemEnd( url ); - scope.manager.itemError( url ); + } - }, 0 ); + } } - } else { + const morphAttributes = geometry.morphAttributes; - var request = new XMLHttpRequest(); - request.open( 'GET', url, true ); + if ( morphAttributes.position !== undefined || morphAttributes.normal !== undefined || ( morphAttributes.color !== undefined && capabilities.isWebGL2 === true ) ) { - request.addEventListener( 'load', function ( event ) { + morphtargets.update( object, geometry, program ); - var response = event.target.response; + } - Cache.add( url, response ); + if ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) { - if ( this.status === 200 ) { + materialProperties.receiveShadow = object.receiveShadow; + p_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow ); - if ( onLoad ) onLoad( response ); + } - scope.manager.itemEnd( url ); + // https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512 - } else if ( this.status === 0 ) { + if ( material.isMeshGouraudMaterial && material.envMap !== null ) { - // Some browsers return HTTP Status 0 when using non-http protocol - // e.g. 'file://' or 'data://'. Handle as success. + m_uniforms.envMap.value = envMap; - console.warn( 'THREE.FileLoader: HTTP Status 0 received.' ); + m_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1; - if ( onLoad ) onLoad( response ); + } - scope.manager.itemEnd( url ); + if ( refreshMaterial ) { - } else { + p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure ); - if ( onError ) onError( event ); + if ( materialProperties.needsLights ) { - scope.manager.itemEnd( url ); - scope.manager.itemError( url ); + // the current material requires lighting info - } + // note: all lighting uniforms are always set correctly + // they simply reference the renderer's state for their + // values + // + // use the current material's .needsUpdate flags to set + // the GL state when required - }, false ); + markUniformsLightsNeedsUpdate( m_uniforms, refreshLights ); - if ( onProgress !== undefined ) { + } - request.addEventListener( 'progress', function ( event ) { + // refresh uniforms common to several materials - onProgress( event ); + if ( fog && material.fog === true ) { - }, false ); + materials.refreshFogUniforms( m_uniforms, fog ); - } + } - request.addEventListener( 'error', function ( event ) { + materials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget ); - if ( onError ) onError( event ); + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); - scope.manager.itemEnd( url ); - scope.manager.itemError( url ); + } - }, false ); + if ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) { - if ( this.responseType !== undefined ) request.responseType = this.responseType; - if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials; + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); + material.uniformsNeedUpdate = false; - if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' ); + } - for ( var header in this.requestHeader ) { + if ( material.isSpriteMaterial ) { - request.setRequestHeader( header, this.requestHeader[ header ] ); + p_uniforms.setValue( _gl, 'center', object.center ); } - request.send( null ); + // common matrices - } + p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); + p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); - scope.manager.itemStart( url ); + // UBOs - return request; + if ( material.isShaderMaterial || material.isRawShaderMaterial ) { - }, + const groups = material.uniformsGroups; - setPath: function ( value ) { + for ( let i = 0, l = groups.length; i < l; i ++ ) { - this.path = value; - return this; + if ( capabilities.isWebGL2 ) { - }, + const group = groups[ i ]; - setResponseType: function ( value ) { + uniformsGroups.update( group, program ); + uniformsGroups.bind( group, program ); - this.responseType = value; - return this; + } else { - }, + console.warn( 'THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.' ); - setWithCredentials: function ( value ) { + } - this.withCredentials = value; - return this; + } - }, + } - setMimeType: function ( value ) { + return program; - this.mimeType = value; - return this; + } - }, + // If uniforms are marked as clean, they don't need to be loaded to the GPU. - setRequestHeader: function ( value ) { + function markUniformsLightsNeedsUpdate( uniforms, value ) { - this.requestHeader = value; - return this; + uniforms.ambientLightColor.needsUpdate = value; + uniforms.lightProbe.needsUpdate = value; - } + uniforms.directionalLights.needsUpdate = value; + uniforms.directionalLightShadows.needsUpdate = value; + uniforms.pointLights.needsUpdate = value; + uniforms.pointLightShadows.needsUpdate = value; + uniforms.spotLights.needsUpdate = value; + uniforms.spotLightShadows.needsUpdate = value; + uniforms.rectAreaLights.needsUpdate = value; + uniforms.hemisphereLights.needsUpdate = value; - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - * - * Abstract Base class to block based textures loader (dds, pvr, ...) - */ + function materialNeedsLights( material ) { - function CompressedTextureLoader( manager ) { + return material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || + material.isMeshStandardMaterial || material.isShadowMaterial || + ( material.isShaderMaterial && material.lights === true ); - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + } - // override in sub classes - this._parser = null; + this.getActiveCubeFace = function () { - } + return _currentActiveCubeFace; - Object.assign( CompressedTextureLoader.prototype, { + }; - load: function ( url, onLoad, onProgress, onError ) { + this.getActiveMipmapLevel = function () { - var scope = this; + return _currentActiveMipmapLevel; - var images = []; + }; - var texture = new CompressedTexture(); - texture.image = images; + this.getRenderTarget = function () { - var loader = new FileLoader( this.manager ); - loader.setPath( this.path ); - loader.setResponseType( 'arraybuffer' ); + return _currentRenderTarget; - function loadTexture( i ) { + }; - loader.load( url[ i ], function ( buffer ) { + this.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) { - var texDatas = scope._parser( buffer, true ); + properties.get( renderTarget.texture ).__webglTexture = colorTexture; + properties.get( renderTarget.depthTexture ).__webglTexture = depthTexture; - images[ i ] = { - width: texDatas.width, - height: texDatas.height, - format: texDatas.format, - mipmaps: texDatas.mipmaps - }; + const renderTargetProperties = properties.get( renderTarget ); + renderTargetProperties.__hasExternalTextures = true; - loaded += 1; + if ( renderTargetProperties.__hasExternalTextures ) { - if ( loaded === 6 ) { + renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined; - if ( texDatas.mipmapCount === 1 ) - texture.minFilter = LinearFilter; + if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) { - texture.format = texDatas.format; - texture.needsUpdate = true; + // The multisample_render_to_texture extension doesn't work properly if there + // are midframe flushes and an external depth buffer. Disable use of the extension. + if ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) { - if ( onLoad ) onLoad( texture ); + console.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' ); + renderTargetProperties.__useRenderToTexture = false; - } + } - }, onProgress, onError ); + } - } + } - if ( Array.isArray( url ) ) { + }; - var loaded = 0; + this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) { - for ( var i = 0, il = url.length; i < il; ++ i ) { + const renderTargetProperties = properties.get( renderTarget ); + renderTargetProperties.__webglFramebuffer = defaultFramebuffer; + renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined; - loadTexture( i ); + }; - } + this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) { - } else { + _currentRenderTarget = renderTarget; + _currentActiveCubeFace = activeCubeFace; + _currentActiveMipmapLevel = activeMipmapLevel; - // compressed cubemap texture stored in a single DDS file + let useDefaultFramebuffer = true; + let framebuffer = null; + let isCube = false; + let isRenderTarget3D = false; - loader.load( url, function ( buffer ) { + if ( renderTarget ) { - var texDatas = scope._parser( buffer, true ); + const renderTargetProperties = properties.get( renderTarget ); - if ( texDatas.isCubemap ) { + if ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) { - var faces = texDatas.mipmaps.length / texDatas.mipmapCount; + // We need to make sure to rebind the framebuffer. + state.bindFramebuffer( _gl.FRAMEBUFFER, null ); + useDefaultFramebuffer = false; - for ( var f = 0; f < faces; f ++ ) { + } else if ( renderTargetProperties.__webglFramebuffer === undefined ) { - images[ f ] = { mipmaps : [] }; + textures.setupRenderTarget( renderTarget ); - for ( var i = 0; i < texDatas.mipmapCount; i ++ ) { + } else if ( renderTargetProperties.__hasExternalTextures ) { - images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); - images[ f ].format = texDatas.format; - images[ f ].width = texDatas.width; - images[ f ].height = texDatas.height; + // Color and depth texture must be rebound in order for the swapchain to update. + textures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture ); - } + } - } + const texture = renderTarget.texture; - } else { + if ( texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture ) { - texture.image.width = texDatas.width; - texture.image.height = texDatas.height; - texture.mipmaps = texDatas.mipmaps; + isRenderTarget3D = true; } - if ( texDatas.mipmapCount === 1 ) { + const __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer; - texture.minFilter = LinearFilter; + if ( renderTarget.isWebGLCubeRenderTarget ) { - } + framebuffer = __webglFramebuffer[ activeCubeFace ]; + isCube = true; - texture.format = texDatas.format; - texture.needsUpdate = true; + } else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) { - if ( onLoad ) onLoad( texture ); + framebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer; - }, onProgress, onError ); + } else { - } + framebuffer = __webglFramebuffer; - return texture; - - }, - - setPath: function ( value ) { - - this.path = value; - return this; + } - } + _currentViewport.copy( renderTarget.viewport ); + _currentScissor.copy( renderTarget.scissor ); + _currentScissorTest = renderTarget.scissorTest; - } ); + } else { - /** - * @author Nikos M. / https://github.com/foo123/ - * - * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) - */ + _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor(); + _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor(); + _currentScissorTest = _scissorTest; - function DataTextureLoader( manager ) { + } - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + const framebufferBound = state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - // override in sub classes - this._parser = null; + if ( framebufferBound && capabilities.drawBuffers && useDefaultFramebuffer ) { - } + state.drawBuffers( renderTarget, framebuffer ); - Object.assign( DataTextureLoader.prototype, { + } - load: function ( url, onLoad, onProgress, onError ) { + state.viewport( _currentViewport ); + state.scissor( _currentScissor ); + state.setScissorTest( _currentScissorTest ); - var scope = this; + if ( isCube ) { - var texture = new DataTexture(); + const textureProperties = properties.get( renderTarget.texture ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel ); - var loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); + } else if ( isRenderTarget3D ) { - loader.load( url, function ( buffer ) { + const textureProperties = properties.get( renderTarget.texture ); + const layer = activeCubeFace || 0; + _gl.framebufferTextureLayer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer ); - var texData = scope._parser( buffer ); + } - if ( ! texData ) return; + _currentMaterialId = - 1; // reset current material to ensure correct uniform bindings - if ( undefined !== texData.image ) { + }; - texture.image = texData.image; + this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) { - } else if ( undefined !== texData.data ) { + if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) { - texture.image.width = texData.width; - texture.image.height = texData.height; - texture.image.data = texData.data; + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ); + return; } - texture.wrapS = undefined !== texData.wrapS ? texData.wrapS : ClampToEdgeWrapping; - texture.wrapT = undefined !== texData.wrapT ? texData.wrapT : ClampToEdgeWrapping; + let framebuffer = properties.get( renderTarget ).__webglFramebuffer; - texture.magFilter = undefined !== texData.magFilter ? texData.magFilter : LinearFilter; - texture.minFilter = undefined !== texData.minFilter ? texData.minFilter : LinearMipMapLinearFilter; + if ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) { - texture.anisotropy = undefined !== texData.anisotropy ? texData.anisotropy : 1; + framebuffer = framebuffer[ activeCubeFaceIndex ]; - if ( undefined !== texData.format ) { + } - texture.format = texData.format; + if ( framebuffer ) { - } - if ( undefined !== texData.type ) { + state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - texture.type = texData.type; + try { - } + const texture = renderTarget.texture; + const textureFormat = texture.format; + const textureType = texture.type; - if ( undefined !== texData.mipmaps ) { + if ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { - texture.mipmaps = texData.mipmaps; + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); + return; - } + } - if ( 1 === texData.mipmapCount ) { + const halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || ( capabilities.isWebGL2 && extensions.has( 'EXT_color_buffer_float' ) ) ); - texture.minFilter = LinearFilter; + if ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // Edge and Chrome Mac < 52 (#9513) + ! ( textureType === FloatType && ( capabilities.isWebGL2 || extensions.has( 'OES_texture_float' ) || extensions.has( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox + ! halfFloatSupportedByExt ) { - } + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); + return; - texture.needsUpdate = true; + } - if ( onLoad ) onLoad( texture, texData ); + // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604) - }, onProgress, onError ); + if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) { + _gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer ); - return texture; + } - } + } finally { - } ); + // restore framebuffer of current render target if necessary - /** - * @author mrdoob / http://mrdoob.com/ - */ + const framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null; + state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - function ImageLoader( manager ) { + } - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + } - } + }; - Object.assign( ImageLoader.prototype, { + this.copyFramebufferToTexture = function ( position, texture, level = 0 ) { - load: function ( url, onLoad, onProgress, onError ) { + const levelScale = Math.pow( 2, - level ); + const width = Math.floor( texture.image.width * levelScale ); + const height = Math.floor( texture.image.height * levelScale ); - if ( url === undefined ) url = ''; + textures.setTexture2D( texture, 0 ); - if ( this.path !== undefined ) url = this.path + url; + _gl.copyTexSubImage2D( _gl.TEXTURE_2D, level, 0, 0, position.x, position.y, width, height ); - var scope = this; + state.unbindTexture(); - var cached = Cache.get( url ); + }; - if ( cached !== undefined ) { + this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) { - scope.manager.itemStart( url ); + const width = srcTexture.image.width; + const height = srcTexture.image.height; + const glFormat = utils.convert( dstTexture.format ); + const glType = utils.convert( dstTexture.type ); - setTimeout( function () { + textures.setTexture2D( dstTexture, 0 ); - if ( onLoad ) onLoad( cached ); + // As another texture upload may have changed pixelStorei + // parameters, make sure they are correct for the dstTexture + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment ); - scope.manager.itemEnd( url ); + if ( srcTexture.isDataTexture ) { - }, 0 ); + _gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data ); - return cached; + } else { - } + if ( srcTexture.isCompressedTexture ) { - var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' ); + _gl.compressedTexSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, srcTexture.mipmaps[ 0 ].width, srcTexture.mipmaps[ 0 ].height, glFormat, srcTexture.mipmaps[ 0 ].data ); - image.addEventListener( 'load', function () { + } else { - Cache.add( url, this ); + _gl.texSubImage2D( _gl.TEXTURE_2D, level, position.x, position.y, glFormat, glType, srcTexture.image ); - if ( onLoad ) onLoad( this ); + } - scope.manager.itemEnd( url ); + } - }, false ); + // Generate mipmaps only when copying level 0 + if ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( _gl.TEXTURE_2D ); - /* - image.addEventListener( 'progress', function ( event ) { + state.unbindTexture(); - if ( onProgress ) onProgress( event ); + }; - }, false ); - */ + this.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) { - image.addEventListener( 'error', function ( event ) { + if ( _this.isWebGL1Renderer ) { - if ( onError ) onError( event ); + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.' ); + return; - scope.manager.itemEnd( url ); - scope.manager.itemError( url ); + } - }, false ); + const width = sourceBox.max.x - sourceBox.min.x + 1; + const height = sourceBox.max.y - sourceBox.min.y + 1; + const depth = sourceBox.max.z - sourceBox.min.z + 1; + const glFormat = utils.convert( dstTexture.format ); + const glType = utils.convert( dstTexture.type ); + let glTarget; - if ( url.substr( 0, 5 ) !== 'data:' ) { + if ( dstTexture.isData3DTexture ) { - if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin; + textures.setTexture3D( dstTexture, 0 ); + glTarget = _gl.TEXTURE_3D; - } + } else if ( dstTexture.isDataArrayTexture ) { - scope.manager.itemStart( url ); + textures.setTexture2DArray( dstTexture, 0 ); + glTarget = _gl.TEXTURE_2D_ARRAY; - image.src = url; + } else { - return image; + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.' ); + return; - }, + } - setCrossOrigin: function ( value ) { + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment ); - this.crossOrigin = value; - return this; + const unpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH ); + const unpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT ); + const unpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS ); + const unpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS ); + const unpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES ); - }, + const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ 0 ] : srcTexture.image; - setPath: function ( value ) { + _gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width ); + _gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height ); + _gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, sourceBox.min.x ); + _gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, sourceBox.min.y ); + _gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, sourceBox.min.z ); - this.path = value; - return this; + if ( srcTexture.isDataTexture || srcTexture.isData3DTexture ) { - } + _gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data ); - } ); + } else { - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( srcTexture.isCompressedArrayTexture ) { - function CubeTextureLoader( manager ) { + console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' ); + _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data ); - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + } else { - } + _gl.texSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image ); - Object.assign( CubeTextureLoader.prototype, { + } - load: function ( urls, onLoad, onProgress, onError ) { + } - var texture = new CubeTexture(); + _gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, unpackRowLen ); + _gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight ); + _gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, unpackSkipPixels ); + _gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, unpackSkipRows ); + _gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, unpackSkipImages ); - var loader = new ImageLoader( this.manager ); - loader.setCrossOrigin( this.crossOrigin ); - loader.setPath( this.path ); + // Generate mipmaps only when copying level 0 + if ( level === 0 && dstTexture.generateMipmaps ) _gl.generateMipmap( glTarget ); - var loaded = 0; + state.unbindTexture(); - function loadTexture( i ) { + }; - loader.load( urls[ i ], function ( image ) { + this.initTexture = function ( texture ) { - texture.images[ i ] = image; + if ( texture.isCubeTexture ) { - loaded ++; + textures.setTextureCube( texture, 0 ); - if ( loaded === 6 ) { + } else if ( texture.isData3DTexture ) { - texture.needsUpdate = true; + textures.setTexture3D( texture, 0 ); - if ( onLoad ) onLoad( texture ); + } else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) { - } + textures.setTexture2DArray( texture, 0 ); - }, undefined, onError ); + } else { - } + textures.setTexture2D( texture, 0 ); - for ( var i = 0; i < urls.length; ++ i ) { + } - loadTexture( i ); + state.unbindTexture(); - } + }; - return texture; + this.resetState = function () { - }, + _currentActiveCubeFace = 0; + _currentActiveMipmapLevel = 0; + _currentRenderTarget = null; - setCrossOrigin: function ( value ) { + state.reset(); + bindingStates.reset(); - this.crossOrigin = value; - return this; + }; - }, + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { - setPath: function ( value ) { + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); - this.path = value; - return this; + } } - } ); + get coordinateSystem() { - /** - * @author mrdoob / http://mrdoob.com/ - */ + return WebGLCoordinateSystem; + + } - function TextureLoader( manager ) { + get physicallyCorrectLights() { // @deprecated, r150 - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + return ! this.useLegacyLights; - } + } - Object.assign( TextureLoader.prototype, { + set physicallyCorrectLights( value ) { // @deprecated, r150 - load: function ( url, onLoad, onProgress, onError ) { + console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + this.useLegacyLights = ! value; - var loader = new ImageLoader( this.manager ); - loader.setCrossOrigin( this.crossOrigin ); - loader.setPath( this.path ); + } - var texture = new Texture(); - texture.image = loader.load( url, function () { + get outputEncoding() { // @deprecated, r152 - // JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB. - var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0; + console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' ); + return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding; - texture.format = isJPEG ? RGBFormat : RGBAFormat; - texture.needsUpdate = true; + } - if ( onLoad !== undefined ) { + set outputEncoding( encoding ) { // @deprecated, r152 - onLoad( texture ); + console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' ); + this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace; - } + } - }, onProgress, onError ); + } - return texture; + class WebGL1Renderer extends WebGLRenderer {} - }, + WebGL1Renderer.prototype.isWebGL1Renderer = true; - setCrossOrigin: function ( value ) { + class FogExp2 { - this.crossOrigin = value; - return this; + constructor( color, density = 0.00025 ) { - }, + this.isFogExp2 = true; - setPath: function ( value ) { + this.name = ''; - this.path = value; - return this; + this.color = new Color( color ); + this.density = density; } - } ); - - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + clone() { - function Light( color, intensity ) { + return new FogExp2( this.color, this.density ); - Object3D.call( this ); + } - this.type = 'Light'; + toJSON( /* meta */ ) { - this.color = new Color( color ); - this.intensity = intensity !== undefined ? intensity : 1; + return { + type: 'FogExp2', + color: this.color.getHex(), + density: this.density + }; - this.receiveShadow = undefined; + } } - Light.prototype = Object.assign( Object.create( Object3D.prototype ), { + class Fog { - constructor: Light, + constructor( color, near = 1, far = 1000 ) { - isLight: true, + this.isFog = true; - copy: function ( source ) { + this.name = ''; - Object3D.prototype.copy.call( this, source ); + this.color = new Color( color ); - this.color.copy( source.color ); - this.intensity = source.intensity; + this.near = near; + this.far = far; - return this; + } - }, + clone() { + + return new Fog( this.color, this.near, this.far ); - toJSON: function ( meta ) { + } - var data = Object3D.prototype.toJSON.call( this, meta ); + toJSON( /* meta */ ) { - data.object.color = this.color.getHex(); - data.object.intensity = this.intensity; + return { + type: 'Fog', + color: this.color.getHex(), + near: this.near, + far: this.far + }; - if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); + } - if ( this.distance !== undefined ) data.object.distance = this.distance; - if ( this.angle !== undefined ) data.object.angle = this.angle; - if ( this.decay !== undefined ) data.object.decay = this.decay; - if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; + } - if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); + class Scene extends Object3D { - return data; + constructor() { - } + super(); - } ); + this.isScene = true; - /** - * @author alteredq / http://alteredqualia.com/ - */ + this.type = 'Scene'; - function HemisphereLight( skyColor, groundColor, intensity ) { + this.background = null; + this.environment = null; + this.fog = null; - Light.call( this, skyColor, intensity ); + this.backgroundBlurriness = 0; + this.backgroundIntensity = 1; - this.type = 'HemisphereLight'; + this.overrideMaterial = null; - this.castShadow = undefined; + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); - this.groundColor = new Color( groundColor ); + } - } + } - HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), { + copy( source, recursive ) { - constructor: HemisphereLight, + super.copy( source, recursive ); - isHemisphereLight: true, + if ( source.background !== null ) this.background = source.background.clone(); + if ( source.environment !== null ) this.environment = source.environment.clone(); + if ( source.fog !== null ) this.fog = source.fog.clone(); - copy: function ( source ) { + this.backgroundBlurriness = source.backgroundBlurriness; + this.backgroundIntensity = source.backgroundIntensity; - Light.prototype.copy.call( this, source ); + if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); - this.groundColor.copy( source.groundColor ); + this.matrixAutoUpdate = source.matrixAutoUpdate; return this; } - } ); + toJSON( meta ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + const data = super.toJSON( meta ); - function LightShadow( camera ) { + if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness; + if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity; - this.camera = camera; + return data; - this.bias = 0; - this.radius = 1; + } - this.mapSize = new Vector2( 512, 512 ); + get autoUpdate() { // @deprecated, r144 - this.map = null; - this.matrix = new Matrix4(); + console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); + return this.matrixWorldAutoUpdate; - } + } - Object.assign( LightShadow.prototype, { + set autoUpdate( value ) { // @deprecated, r144 - copy: function ( source ) { + console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); + this.matrixWorldAutoUpdate = value; - this.camera = source.camera.clone(); + } - this.bias = source.bias; - this.radius = source.radius; + } - this.mapSize.copy( source.mapSize ); + class InterleavedBuffer { - return this; + constructor( array, stride ) { - }, + this.isInterleavedBuffer = true; - clone: function () { + this.array = array; + this.stride = stride; + this.count = array !== undefined ? array.length / stride : 0; - return new this.constructor().copy( this ); + this.usage = StaticDrawUsage; + this.updateRange = { offset: 0, count: - 1 }; - }, + this.version = 0; - toJSON: function () { + this.uuid = generateUUID(); - var object = {}; + } - if ( this.bias !== 0 ) object.bias = this.bias; - if ( this.radius !== 1 ) object.radius = this.radius; - if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray(); + onUploadCallback() {} - object.camera = this.camera.toJSON( false ).object; - delete object.camera.matrix; + set needsUpdate( value ) { - return object; + if ( value === true ) this.version ++; } - } ); - - /** - * @author mrdoob / http://mrdoob.com/ - */ + setUsage( value ) { - function SpotLightShadow() { + this.usage = value; - LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) ); + return this; - } + } - SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { + copy( source ) { - constructor: SpotLightShadow, + this.array = new source.array.constructor( source.array ); + this.count = source.count; + this.stride = source.stride; + this.usage = source.usage; - isSpotLightShadow: true, + return this; - update: function ( light ) { + } - var camera = this.camera; + copyAt( index1, attribute, index2 ) { - var fov = _Math.RAD2DEG * 2 * light.angle; - var aspect = this.mapSize.width / this.mapSize.height; - var far = light.distance || camera.far; + index1 *= this.stride; + index2 *= attribute.stride; - if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) { + for ( let i = 0, l = this.stride; i < l; i ++ ) { - camera.fov = fov; - camera.aspect = aspect; - camera.far = far; - camera.updateProjectionMatrix(); + this.array[ index1 + i ] = attribute.array[ index2 + i ]; } + return this; + } - } ); + set( value, offset = 0 ) { - /** - * @author alteredq / http://alteredqualia.com/ - */ + this.array.set( value, offset ); - function SpotLight( color, intensity, distance, angle, penumbra, decay ) { + return this; - Light.call( this, color, intensity ); + } - this.type = 'SpotLight'; + clone( data ) { - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); + if ( data.arrayBuffers === undefined ) { - this.target = new Object3D(); + data.arrayBuffers = {}; - Object.defineProperty( this, 'power', { - get: function () { - // intensity = power per solid angle. - // ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf - return this.intensity * Math.PI; - }, - set: function ( power ) { - // intensity = power per solid angle. - // ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf - this.intensity = power / Math.PI; } - } ); - this.distance = ( distance !== undefined ) ? distance : 0; - this.angle = ( angle !== undefined ) ? angle : Math.PI / 3; - this.penumbra = ( penumbra !== undefined ) ? penumbra : 0; - this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. + if ( this.array.buffer._uuid === undefined ) { - this.shadow = new SpotLightShadow(); + this.array.buffer._uuid = generateUUID(); - } + } - SpotLight.prototype = Object.assign( Object.create( Light.prototype ), { + if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) { - constructor: SpotLight, + data.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer; - isSpotLight: true, + } - copy: function ( source ) { + const array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] ); - Light.prototype.copy.call( this, source ); + const ib = new this.constructor( array, this.stride ); + ib.setUsage( this.usage ); - this.distance = source.distance; - this.angle = source.angle; - this.penumbra = source.penumbra; - this.decay = source.decay; + return ib; - this.target = source.target.clone(); + } - this.shadow = source.shadow.clone(); + onUpload( callback ) { + + this.onUploadCallback = callback; return this; } - } ); + toJSON( data ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + if ( data.arrayBuffers === undefined ) { + data.arrayBuffers = {}; - function PointLight( color, intensity, distance, decay ) { + } - Light.call( this, color, intensity ); + // generate UUID for array buffer if necessary - this.type = 'PointLight'; + if ( this.array.buffer._uuid === undefined ) { - Object.defineProperty( this, 'power', { - get: function () { - // intensity = power per solid angle. - // ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf - return this.intensity * 4 * Math.PI; + this.array.buffer._uuid = generateUUID(); - }, - set: function ( power ) { - // intensity = power per solid angle. - // ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf - this.intensity = power / ( 4 * Math.PI ); } - } ); - this.distance = ( distance !== undefined ) ? distance : 0; - this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. + if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) { - this.shadow = new LightShadow( new PerspectiveCamera( 90, 1, 0.5, 500 ) ); + data.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) ); - } + } + + // + + return { + uuid: this.uuid, + buffer: this.array.buffer._uuid, + type: this.array.constructor.name, + stride: this.stride + }; - PointLight.prototype = Object.assign( Object.create( Light.prototype ), { + } - constructor: PointLight, + } - isPointLight: true, + const _vector$5 = /*@__PURE__*/ new Vector3(); - copy: function ( source ) { + class InterleavedBufferAttribute { - Light.prototype.copy.call( this, source ); + constructor( interleavedBuffer, itemSize, offset, normalized = false ) { - this.distance = source.distance; - this.decay = source.decay; + this.isInterleavedBufferAttribute = true; - this.shadow = source.shadow.clone(); + this.name = ''; - return this; + this.data = interleavedBuffer; + this.itemSize = itemSize; + this.offset = offset; + + this.normalized = normalized; } - } ); + get count() { - /** - * @author mrdoob / http://mrdoob.com/ - */ + return this.data.count; - function DirectionalLightShadow( ) { + } - LightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) ); + get array() { - } + return this.data.array; - DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { + } - constructor: DirectionalLightShadow + set needsUpdate( value ) { - } ); + this.data.needsUpdate = value; - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + } - function DirectionalLight( color, intensity ) { + applyMatrix4( m ) { - Light.call( this, color, intensity ); + for ( let i = 0, l = this.data.count; i < l; i ++ ) { - this.type = 'DirectionalLight'; + _vector$5.fromBufferAttribute( this, i ); - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); + _vector$5.applyMatrix4( m ); - this.target = new Object3D(); + this.setXYZ( i, _vector$5.x, _vector$5.y, _vector$5.z ); - this.shadow = new DirectionalLightShadow(); + } - } + return this; - DirectionalLight.prototype = Object.assign( Object.create( Light.prototype ), { + } - constructor: DirectionalLight, + applyNormalMatrix( m ) { - isDirectionalLight: true, + for ( let i = 0, l = this.count; i < l; i ++ ) { - copy: function ( source ) { + _vector$5.fromBufferAttribute( this, i ); - Light.prototype.copy.call( this, source ); + _vector$5.applyNormalMatrix( m ); - this.target = source.target.clone(); + this.setXYZ( i, _vector$5.x, _vector$5.y, _vector$5.z ); - this.shadow = source.shadow.clone(); + } return this; } - } ); - - /** - * @author mrdoob / http://mrdoob.com/ - */ + transformDirection( m ) { - function AmbientLight( color, intensity ) { + for ( let i = 0, l = this.count; i < l; i ++ ) { - Light.call( this, color, intensity ); + _vector$5.fromBufferAttribute( this, i ); - this.type = 'AmbientLight'; + _vector$5.transformDirection( m ); - this.castShadow = undefined; + this.setXYZ( i, _vector$5.x, _vector$5.y, _vector$5.z ); - } + } - AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), { + return this; - constructor: AmbientLight, + } - isAmbientLight: true + setX( index, x ) { - } ); + if ( this.normalized ) x = normalize( x, this.array ); - /** - * @author abelnation / http://github.com/abelnation - */ + this.data.array[ index * this.data.stride + this.offset ] = x; - function RectAreaLight( color, intensity, width, height ) { + return this; - Light.call( this, color, intensity ); + } - this.type = 'RectAreaLight'; + setY( index, y ) { - this.position.set( 0, 1, 0 ); - this.updateMatrix(); + if ( this.normalized ) y = normalize( y, this.array ); - this.width = ( width !== undefined ) ? width : 10; - this.height = ( height !== undefined ) ? height : 10; + this.data.array[ index * this.data.stride + this.offset + 1 ] = y; - // TODO (abelnation): distance/decay + return this; - // TODO (abelnation): update method for RectAreaLight to update transform to lookat target + } - // TODO (abelnation): shadows + setZ( index, z ) { - } + if ( this.normalized ) z = normalize( z, this.array ); - // TODO (abelnation): RectAreaLight update when light shape is changed - RectAreaLight.prototype = Object.assign( Object.create( Light.prototype ), { + this.data.array[ index * this.data.stride + this.offset + 2 ] = z; - constructor: RectAreaLight, + return this; - isRectAreaLight: true, + } - copy: function ( source ) { + setW( index, w ) { - Light.prototype.copy.call( this, source ); + if ( this.normalized ) w = normalize( w, this.array ); - this.width = source.width; - this.height = source.height; + this.data.array[ index * this.data.stride + this.offset + 3 ] = w; return this; - }, + } - toJSON: function ( meta ) { + getX( index ) { - var data = Light.prototype.toJSON.call( this, meta ); + let x = this.data.array[ index * this.data.stride + this.offset ]; - data.object.width = this.width; - data.object.height = this.height; + if ( this.normalized ) x = denormalize( x, this.array ); - return data; + return x; } - } ); + getY( index ) { - /** - * @author tschw - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - */ + let y = this.data.array[ index * this.data.stride + this.offset + 1 ]; - var AnimationUtils = { + if ( this.normalized ) y = denormalize( y, this.array ); - // same as Array.prototype.slice, but also works on typed arrays - arraySlice: function ( array, from, to ) { + return y; - if ( AnimationUtils.isTypedArray( array ) ) { + } - // in ios9 array.subarray(from, undefined) will return empty array - // but array.subarray(from) or array.subarray(from, len) is correct - return new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) ); + getZ( index ) { - } + let z = this.data.array[ index * this.data.stride + this.offset + 2 ]; - return array.slice( from, to ); + if ( this.normalized ) z = denormalize( z, this.array ); - }, + return z; - // converts an array to a specific type - convertArray: function ( array, type, forceClone ) { + } - if ( ! array || // let 'undefined' and 'null' pass - ! forceClone && array.constructor === type ) return array; + getW( index ) { - if ( typeof type.BYTES_PER_ELEMENT === 'number' ) { + let w = this.data.array[ index * this.data.stride + this.offset + 3 ]; - return new type( array ); // create typed array + if ( this.normalized ) w = denormalize( w, this.array ); - } + return w; - return Array.prototype.slice.call( array ); // create Array + } - }, + setXY( index, x, y ) { - isTypedArray: function ( object ) { + index = index * this.data.stride + this.offset; - return ArrayBuffer.isView( object ) && - ! ( object instanceof DataView ); + if ( this.normalized ) { - }, + x = normalize( x, this.array ); + y = normalize( y, this.array ); - // returns an array by which times and values can be sorted - getKeyframeOrder: function ( times ) { + } + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; - function compareTime( i, j ) { + return this; - return times[ i ] - times[ j ]; + } - } + setXYZ( index, x, y, z ) { - var n = times.length; - var result = new Array( n ); - for ( var i = 0; i !== n; ++ i ) result[ i ] = i; + index = index * this.data.stride + this.offset; - result.sort( compareTime ); + if ( this.normalized ) { - return result; + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); - }, + } - // uses the array previously returned by 'getKeyframeOrder' to sort data - sortedArray: function ( values, stride, order ) { + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; - var nValues = values.length; - var result = new values.constructor( nValues ); + return this; - for ( var i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) { + } - var srcOffset = order[ i ] * stride; + setXYZW( index, x, y, z, w ) { - for ( var j = 0; j !== stride; ++ j ) { + index = index * this.data.stride + this.offset; - result[ dstOffset ++ ] = values[ srcOffset + j ]; + if ( this.normalized ) { - } + x = normalize( x, this.array ); + y = normalize( y, this.array ); + z = normalize( z, this.array ); + w = normalize( w, this.array ); } - return result; + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; + this.data.array[ index + 3 ] = w; - }, + return this; - // function for parsing AOS keyframe formats - flattenJSON: function ( jsonKeys, times, values, valuePropertyName ) { + } - var i = 1, key = jsonKeys[ 0 ]; + clone( data ) { - while ( key !== undefined && key[ valuePropertyName ] === undefined ) { + if ( data === undefined ) { - key = jsonKeys[ i ++ ]; + console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' ); - } + const array = []; - if ( key === undefined ) return; // no data + for ( let i = 0; i < this.count; i ++ ) { - var value = key[ valuePropertyName ]; - if ( value === undefined ) return; // no data + const index = i * this.data.stride + this.offset; - if ( Array.isArray( value ) ) { + for ( let j = 0; j < this.itemSize; j ++ ) { - do { + array.push( this.data.array[ index + j ] ); - value = key[ valuePropertyName ]; + } - if ( value !== undefined ) { + } - times.push( key.time ); - values.push.apply( values, value ); // push all elements + return new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized ); - } + } else { - key = jsonKeys[ i ++ ]; + if ( data.interleavedBuffers === undefined ) { - } while ( key !== undefined ); + data.interleavedBuffers = {}; - } else if ( value.toArray !== undefined ) { + } - // ...assume THREE.Math-ish + if ( data.interleavedBuffers[ this.data.uuid ] === undefined ) { - do { + data.interleavedBuffers[ this.data.uuid ] = this.data.clone( data ); - value = key[ valuePropertyName ]; + } - if ( value !== undefined ) { + return new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized ); - times.push( key.time ); - value.toArray( values, values.length ); + } - } + } - key = jsonKeys[ i ++ ]; + toJSON( data ) { - } while ( key !== undefined ); + if ( data === undefined ) { - } else { + console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' ); - // otherwise push as-is + const array = []; - do { + for ( let i = 0; i < this.count; i ++ ) { - value = key[ valuePropertyName ]; + const index = i * this.data.stride + this.offset; - if ( value !== undefined ) { + for ( let j = 0; j < this.itemSize; j ++ ) { - times.push( key.time ); - values.push( value ); + array.push( this.data.array[ index + j ] ); } - key = jsonKeys[ i ++ ]; + } - } while ( key !== undefined ); + // de-interleave data and save it as an ordinary buffer attribute for now - } + return { + itemSize: this.itemSize, + type: this.array.constructor.name, + array: array, + normalized: this.normalized + }; - } + } else { - }; + // save as true interleaved attribute - /** - * Abstract base class of interpolants over parametric samples. - * - * The parameter domain is one dimensional, typically the time or a path - * along a curve defined by the data. - * - * The sample values can have any dimensionality and derived classes may - * apply special interpretations to the data. - * - * This class provides the interval seek in a Template Method, deferring - * the actual interpolation to derived classes. - * - * Time complexity is O(1) for linear access crossing at most two points - * and O(log N) for random access, where N is the number of positions. - * - * References: - * - * http://www.oodesign.com/template-method-pattern.html - * - * @author tschw - */ + if ( data.interleavedBuffers === undefined ) { - function Interpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + data.interleavedBuffers = {}; - this.parameterPositions = parameterPositions; - this._cachedIndex = 0; + } - this.resultBuffer = resultBuffer !== undefined ? - resultBuffer : new sampleValues.constructor( sampleSize ); - this.sampleValues = sampleValues; - this.valueSize = sampleSize; + if ( data.interleavedBuffers[ this.data.uuid ] === undefined ) { - } + data.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data ); - Object.assign( Interpolant.prototype, { + } - evaluate: function( t ) { + return { + isInterleavedBufferAttribute: true, + itemSize: this.itemSize, + data: this.data.uuid, + offset: this.offset, + normalized: this.normalized + }; - var pp = this.parameterPositions, - i1 = this._cachedIndex, + } - t1 = pp[ i1 ], - t0 = pp[ i1 - 1 ]; + } - validate_interval: { + } - seek: { + class SpriteMaterial extends Material { - var right; + constructor( parameters ) { - linear_scan: { - //- See http://jsperf.com/comparison-to-undefined/3 - //- slower code: - //- - //- if ( t >= t1 || t1 === undefined ) { - forward_scan: if ( ! ( t < t1 ) ) { + super(); - for ( var giveUpAt = i1 + 2; ;) { + this.isSpriteMaterial = true; - if ( t1 === undefined ) { + this.type = 'SpriteMaterial'; - if ( t < t0 ) break forward_scan; + this.color = new Color( 0xffffff ); - // after end + this.map = null; - i1 = pp.length; - this._cachedIndex = i1; - return this.afterEnd_( i1 - 1, t, t0 ); + this.alphaMap = null; - } + this.rotation = 0; - if ( i1 === giveUpAt ) break; // this loop + this.sizeAttenuation = true; - t0 = t1; - t1 = pp[ ++ i1 ]; + this.transparent = true; - if ( t < t1 ) { + this.fog = true; - // we have arrived at the sought interval - break seek; + this.setValues( parameters ); - } + } - } + copy( source ) { - // prepare binary search on the right side of the index - right = pp.length; - break linear_scan; + super.copy( source ); - } + this.color.copy( source.color ); - //- slower code: - //- if ( t < t0 || t0 === undefined ) { - if ( ! ( t >= t0 ) ) { + this.map = source.map; - // looping? + this.alphaMap = source.alphaMap; - var t1global = pp[ 1 ]; + this.rotation = source.rotation; - if ( t < t1global ) { + this.sizeAttenuation = source.sizeAttenuation; - i1 = 2; // + 1, using the scan for the details - t0 = t1global; + this.fog = source.fog; - } + return this; - // linear reverse scan + } - for ( var giveUpAt = i1 - 2; ;) { + } - if ( t0 === undefined ) { + let _geometry; - // before start + const _intersectPoint = /*@__PURE__*/ new Vector3(); + const _worldScale = /*@__PURE__*/ new Vector3(); + const _mvPosition = /*@__PURE__*/ new Vector3(); - this._cachedIndex = 0; - return this.beforeStart_( 0, t, t1 ); + const _alignedPosition = /*@__PURE__*/ new Vector2(); + const _rotatedPosition = /*@__PURE__*/ new Vector2(); + const _viewWorldMatrix = /*@__PURE__*/ new Matrix4(); - } + const _vA = /*@__PURE__*/ new Vector3(); + const _vB = /*@__PURE__*/ new Vector3(); + const _vC = /*@__PURE__*/ new Vector3(); - if ( i1 === giveUpAt ) break; // this loop + const _uvA = /*@__PURE__*/ new Vector2(); + const _uvB = /*@__PURE__*/ new Vector2(); + const _uvC = /*@__PURE__*/ new Vector2(); - t1 = t0; - t0 = pp[ -- i1 - 1 ]; + class Sprite extends Object3D { - if ( t >= t0 ) { + constructor( material ) { - // we have arrived at the sought interval - break seek; + super(); - } + this.isSprite = true; - } + this.type = 'Sprite'; - // prepare binary search on the left side of the index - right = i1; - i1 = 0; - break linear_scan; + if ( _geometry === undefined ) { - } + _geometry = new BufferGeometry(); - // the interval is valid + const float32Array = new Float32Array( [ + - 0.5, - 0.5, 0, 0, 0, + 0.5, - 0.5, 0, 1, 0, + 0.5, 0.5, 0, 1, 1, + - 0.5, 0.5, 0, 0, 1 + ] ); - break validate_interval; + const interleavedBuffer = new InterleavedBuffer( float32Array, 5 ); - } // linear scan + _geometry.setIndex( [ 0, 1, 2, 0, 2, 3 ] ); + _geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) ); + _geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) ); - // binary search + } - while ( i1 < right ) { + this.geometry = _geometry; + this.material = ( material !== undefined ) ? material : new SpriteMaterial(); - var mid = ( i1 + right ) >>> 1; + this.center = new Vector2( 0.5, 0.5 ); - if ( t < pp[ mid ] ) { + } - right = mid; + raycast( raycaster, intersects ) { - } else { + if ( raycaster.camera === null ) { - i1 = mid + 1; + console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' ); - } + } - } + _worldScale.setFromMatrixScale( this.matrixWorld ); - t1 = pp[ i1 ]; - t0 = pp[ i1 - 1 ]; + _viewWorldMatrix.copy( raycaster.camera.matrixWorld ); + this.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld ); - // check boundary cases, again + _mvPosition.setFromMatrixPosition( this.modelViewMatrix ); - if ( t0 === undefined ) { + if ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) { - this._cachedIndex = 0; - return this.beforeStart_( 0, t, t1 ); + _worldScale.multiplyScalar( - _mvPosition.z ); - } + } - if ( t1 === undefined ) { + const rotation = this.material.rotation; + let sin, cos; - i1 = pp.length; - this._cachedIndex = i1; - return this.afterEnd_( i1 - 1, t0, t ); + if ( rotation !== 0 ) { - } + cos = Math.cos( rotation ); + sin = Math.sin( rotation ); - } // seek + } - this._cachedIndex = i1; + const center = this.center; - this.intervalChanged_( i1, t0, t1 ); + transformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + transformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + transformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); - } // validate_interval + _uvA.set( 0, 0 ); + _uvB.set( 1, 0 ); + _uvC.set( 1, 1 ); - return this.interpolate_( i1, t0, t, t1 ); + // check first triangle + let intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint ); - }, + if ( intersect === null ) { - settings: null, // optional, subclass-specific settings structure - // Note: The indirection allows central control of many interpolants. + // check second triangle + transformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); + _uvB.set( 0, 1 ); - // --- Protected interface + intersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint ); + if ( intersect === null ) { - DefaultSettings_: {}, + return; - getSettings_: function() { + } - return this.settings || this.DefaultSettings_; + } - }, + const distance = raycaster.ray.origin.distanceTo( _intersectPoint ); - copySampleValue_: function( index ) { + if ( distance < raycaster.near || distance > raycaster.far ) return; - // copies a sample value to the result buffer + intersects.push( { - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, - offset = index * stride; + distance: distance, + point: _intersectPoint.clone(), + uv: Triangle.getInterpolation( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ), + face: null, + object: this - for ( var i = 0; i !== stride; ++ i ) { + } ); - result[ i ] = values[ offset + i ]; + } - } + copy( source, recursive ) { - return result; + super.copy( source, recursive ); - }, + if ( source.center !== undefined ) this.center.copy( source.center ); - // Template methods for derived classes: + this.material = source.material; - interpolate_: function( i1, t0, t, t1 ) { + return this; - throw new Error( "call to abstract method" ); - // implementations shall return this.resultBuffer + } - }, + } - intervalChanged_: function( i1, t0, t1 ) { + function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) { - // empty + // compute position in camera space + _alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale ); + + // to check if rotation is not zero + if ( sin !== undefined ) { + + _rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y ); + _rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y ); + + } else { + + _rotatedPosition.copy( _alignedPosition ); } - } ); - //!\ DECLARE ALIAS AFTER assign prototype ! - Object.assign( Interpolant.prototype, { + vertexPosition.copy( mvPosition ); + vertexPosition.x += _rotatedPosition.x; + vertexPosition.y += _rotatedPosition.y; - //( 0, t, t0 ), returns this.resultBuffer - beforeStart_: Interpolant.prototype.copySampleValue_, + // transform to world space + vertexPosition.applyMatrix4( _viewWorldMatrix ); - //( N-1, tN-1, t ), returns this.resultBuffer - afterEnd_: Interpolant.prototype.copySampleValue_, + } - } ); + const _v1$2 = /*@__PURE__*/ new Vector3(); + const _v2$1 = /*@__PURE__*/ new Vector3(); - /** - * Fast and simple cubic spline interpolant. - * - * It was derived from a Hermitian construction setting the first derivative - * at each sample position to the linear slope between neighboring positions - * over their parameter interval. - * - * @author tschw - */ + class LOD extends Object3D { - function CubicInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + constructor() { - Interpolant.call( - this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + super(); - this._weightPrev = -0; - this._offsetPrev = -0; - this._weightNext = -0; - this._offsetNext = -0; + this._currentLevel = 0; - } + this.type = 'LOD'; - CubicInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { + Object.defineProperties( this, { + levels: { + enumerable: true, + value: [] + }, + isLOD: { + value: true, + } + } ); - constructor: CubicInterpolant, + this.autoUpdate = true; - DefaultSettings_: { + } - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding + copy( source ) { - }, + super.copy( source, false ); - intervalChanged_: function( i1, t0, t1 ) { + const levels = source.levels; - var pp = this.parameterPositions, - iPrev = i1 - 2, - iNext = i1 + 1, + for ( let i = 0, l = levels.length; i < l; i ++ ) { - tPrev = pp[ iPrev ], - tNext = pp[ iNext ]; + const level = levels[ i ]; - if ( tPrev === undefined ) { + this.addLevel( level.object.clone(), level.distance, level.hysteresis ); - switch ( this.getSettings_().endingStart ) { + } - case ZeroSlopeEnding: + this.autoUpdate = source.autoUpdate; - // f'(t0) = 0 - iPrev = i1; - tPrev = 2 * t0 - t1; + return this; - break; + } - case WrapAroundEnding: + addLevel( object, distance = 0, hysteresis = 0 ) { - // use the other end of the curve - iPrev = pp.length - 2; - tPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ]; + distance = Math.abs( distance ); - break; + const levels = this.levels; - default: // ZeroCurvatureEnding + let l; - // f''(t0) = 0 a.k.a. Natural Spline - iPrev = i1; - tPrev = t1; + for ( l = 0; l < levels.length; l ++ ) { + + if ( distance < levels[ l ].distance ) { + + break; } } - if ( tNext === undefined ) { - - switch ( this.getSettings_().endingEnd ) { + levels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } ); - case ZeroSlopeEnding: + this.add( object ); - // f'(tN) = 0 - iNext = i1; - tNext = 2 * t1 - t0; + return this; - break; + } - case WrapAroundEnding: + getCurrentLevel() { - // use the other end of the curve - iNext = 1; - tNext = t1 + pp[ 1 ] - pp[ 0 ]; + return this._currentLevel; - break; + } - default: // ZeroCurvatureEnding - // f''(tN) = 0, a.k.a. Natural Spline - iNext = i1 - 1; - tNext = t0; - } + getObjectForDistance( distance ) { - } + const levels = this.levels; - var halfDt = ( t1 - t0 ) * 0.5, - stride = this.valueSize; + if ( levels.length > 0 ) { - this._weightPrev = halfDt / ( t0 - tPrev ); - this._weightNext = halfDt / ( tNext - t1 ); - this._offsetPrev = iPrev * stride; - this._offsetNext = iNext * stride; + let i, l; - }, + for ( i = 1, l = levels.length; i < l; i ++ ) { - interpolate_: function( i1, t0, t, t1 ) { + let levelDistance = levels[ i ].distance; - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, + if ( levels[ i ].object.visible ) { - o1 = i1 * stride, o0 = o1 - stride, - oP = this._offsetPrev, oN = this._offsetNext, - wP = this._weightPrev, wN = this._weightNext, + levelDistance -= levelDistance * levels[ i ].hysteresis; - p = ( t - t0 ) / ( t1 - t0 ), - pp = p * p, - ppp = pp * p; + } - // evaluate polynomials + if ( distance < levelDistance ) { - var sP = - wP * ppp + 2 * wP * pp - wP * p; - var s0 = ( 1 + wP ) * ppp + (-1.5 - 2 * wP ) * pp + ( -0.5 + wP ) * p + 1; - var s1 = (-1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p; - var sN = wN * ppp - wN * pp; + break; - // combine data linearly + } - for ( var i = 0; i !== stride; ++ i ) { + } - result[ i ] = - sP * values[ oP + i ] + - s0 * values[ o0 + i ] + - s1 * values[ o1 + i ] + - sN * values[ oN + i ]; + return levels[ i - 1 ].object; } - return result; + return null; } - } ); + raycast( raycaster, intersects ) { - /** - * @author tschw - */ + const levels = this.levels; - function LinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + if ( levels.length > 0 ) { - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + _v1$2.setFromMatrixPosition( this.matrixWorld ); - } + const distance = raycaster.ray.origin.distanceTo( _v1$2 ); - LinearInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { + this.getObjectForDistance( distance ).raycast( raycaster, intersects ); - constructor: LinearInterpolant, + } - interpolate_: function( i1, t0, t, t1 ) { + } - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, + update( camera ) { - offset1 = i1 * stride, - offset0 = offset1 - stride, + const levels = this.levels; - weight1 = ( t - t0 ) / ( t1 - t0 ), - weight0 = 1 - weight1; + if ( levels.length > 1 ) { - for ( var i = 0; i !== stride; ++ i ) { + _v1$2.setFromMatrixPosition( camera.matrixWorld ); + _v2$1.setFromMatrixPosition( this.matrixWorld ); - result[ i ] = - values[ offset0 + i ] * weight0 + - values[ offset1 + i ] * weight1; + const distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom; - } + levels[ 0 ].object.visible = true; - return result; + let i, l; - } + for ( i = 1, l = levels.length; i < l; i ++ ) { - } ); + let levelDistance = levels[ i ].distance; - /** - * - * Interpolant that evaluates to the sample value at the position preceeding - * the parameter. - * - * @author tschw - */ + if ( levels[ i ].object.visible ) { - function DiscreteInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + levelDistance -= levelDistance * levels[ i ].hysteresis; - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + } - } + if ( distance >= levelDistance ) { - DiscreteInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { + levels[ i - 1 ].object.visible = false; + levels[ i ].object.visible = true; - constructor: DiscreteInterpolant, + } else { - interpolate_: function( i1, t0, t, t1 ) { + break; - return this.copySampleValue_( i1 - 1 ); + } - } + } - } ); + this._currentLevel = i - 1; - var KeyframeTrackPrototype; + for ( ; i < l; i ++ ) { - KeyframeTrackPrototype = { + levels[ i ].object.visible = false; - TimeBufferType: Float32Array, - ValueBufferType: Float32Array, + } - DefaultInterpolation: InterpolateLinear, + } - InterpolantFactoryMethodDiscrete: function ( result ) { + } - return new DiscreteInterpolant( - this.times, this.values, this.getValueSize(), result ); + toJSON( meta ) { - }, + const data = super.toJSON( meta ); - InterpolantFactoryMethodLinear: function ( result ) { + if ( this.autoUpdate === false ) data.object.autoUpdate = false; - return new LinearInterpolant( - this.times, this.values, this.getValueSize(), result ); + data.object.levels = []; - }, + const levels = this.levels; - InterpolantFactoryMethodSmooth: function ( result ) { + for ( let i = 0, l = levels.length; i < l; i ++ ) { - return new CubicInterpolant( - this.times, this.values, this.getValueSize(), result ); + const level = levels[ i ]; - }, + data.object.levels.push( { + object: level.object.uuid, + distance: level.distance, + hysteresis: level.hysteresis + } ); - setInterpolation: function ( interpolation ) { + } - var factoryMethod; + return data; - switch ( interpolation ) { + } - case InterpolateDiscrete: + } - factoryMethod = this.InterpolantFactoryMethodDiscrete; + const _basePosition = /*@__PURE__*/ new Vector3(); - break; + const _skinIndex = /*@__PURE__*/ new Vector4(); + const _skinWeight = /*@__PURE__*/ new Vector4(); - case InterpolateLinear: + const _vector3 = /*@__PURE__*/ new Vector3(); + const _matrix4 = /*@__PURE__*/ new Matrix4(); + const _vertex = /*@__PURE__*/ new Vector3(); - factoryMethod = this.InterpolantFactoryMethodLinear; + const _sphere$3 = /*@__PURE__*/ new Sphere(); + const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4(); + const _ray$2 = /*@__PURE__*/ new Ray(); - break; + class SkinnedMesh extends Mesh { - case InterpolateSmooth: + constructor( geometry, material ) { - factoryMethod = this.InterpolantFactoryMethodSmooth; + super( geometry, material ); - break; + this.isSkinnedMesh = true; - } + this.type = 'SkinnedMesh'; - if ( factoryMethod === undefined ) { + this.bindMode = 'attached'; + this.bindMatrix = new Matrix4(); + this.bindMatrixInverse = new Matrix4(); - var message = "unsupported interpolation for " + - this.ValueTypeName + " keyframe track named " + this.name; + this.boundingBox = null; + this.boundingSphere = null; - if ( this.createInterpolant === undefined ) { + } - // fall back to default, unless the default itself is messed up - if ( interpolation !== this.DefaultInterpolation ) { + computeBoundingBox() { - this.setInterpolation( this.DefaultInterpolation ); + const geometry = this.geometry; - } else { + if ( this.boundingBox === null ) { - throw new Error( message ); // fatal, in this case + this.boundingBox = new Box3(); - } + } - } + this.boundingBox.makeEmpty(); - console.warn( 'THREE.KeyframeTrackPrototype:', message ); - return; + const positionAttribute = geometry.getAttribute( 'position' ); + + for ( let i = 0; i < positionAttribute.count; i ++ ) { + + _vertex.fromBufferAttribute( positionAttribute, i ); + this.applyBoneTransform( i, _vertex ); + this.boundingBox.expandByPoint( _vertex ); } - this.createInterpolant = factoryMethod; + } - }, + computeBoundingSphere() { - getInterpolation: function () { + const geometry = this.geometry; - switch ( this.createInterpolant ) { + if ( this.boundingSphere === null ) { - case this.InterpolantFactoryMethodDiscrete: + this.boundingSphere = new Sphere(); - return InterpolateDiscrete; + } - case this.InterpolantFactoryMethodLinear: + this.boundingSphere.makeEmpty(); - return InterpolateLinear; + const positionAttribute = geometry.getAttribute( 'position' ); - case this.InterpolantFactoryMethodSmooth: + for ( let i = 0; i < positionAttribute.count; i ++ ) { - return InterpolateSmooth; + _vertex.fromBufferAttribute( positionAttribute, i ); + this.applyBoneTransform( i, _vertex ); + this.boundingSphere.expandByPoint( _vertex ); } - }, + } - getValueSize: function () { + copy( source, recursive ) { - return this.values.length / this.times.length; + super.copy( source, recursive ); - }, + this.bindMode = source.bindMode; + this.bindMatrix.copy( source.bindMatrix ); + this.bindMatrixInverse.copy( source.bindMatrixInverse ); - // move all keyframes either forwards or backwards in time - shift: function ( timeOffset ) { + this.skeleton = source.skeleton; - if ( timeOffset !== 0.0 ) { + if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone(); + if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone(); - var times = this.times; + return this; - for ( var i = 0, n = times.length; i !== n; ++ i ) { + } - times[ i ] += timeOffset; + raycast( raycaster, intersects ) { - } + const material = this.material; + const matrixWorld = this.matrixWorld; - } + if ( material === undefined ) return; - return this; + // test with bounding sphere in world space - }, + if ( this.boundingSphere === null ) this.computeBoundingSphere(); - // scale all keyframe times by a factor (useful for frame <-> seconds conversions) - scale: function ( timeScale ) { + _sphere$3.copy( this.boundingSphere ); + _sphere$3.applyMatrix4( matrixWorld ); - if ( timeScale !== 1.0 ) { + if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return; - var times = this.times; + // convert ray to local space of skinned mesh - for ( var i = 0, n = times.length; i !== n; ++ i ) { + _inverseMatrix$2.copy( matrixWorld ).invert(); + _ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 ); - times[ i ] *= timeScale; + // test with bounding box in local space - } + if ( this.boundingBox !== null ) { + + if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return; } - return this; + // test for intersections with geometry - }, + this._computeIntersections( raycaster, intersects, _ray$2 ); - // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. - // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values - trim: function ( startTime, endTime ) { + } - var times = this.times, - nKeys = times.length, - from = 0, - to = nKeys - 1; + getVertexPosition( index, target ) { - while ( from !== nKeys && times[ from ] < startTime ) ++ from; - while ( to !== - 1 && times[ to ] > endTime ) -- to; + super.getVertexPosition( index, target ); - ++ to; // inclusive -> exclusive bound + this.applyBoneTransform( index, target ); - if ( from !== 0 || to !== nKeys ) { + return target; - // empty tracks are forbidden, so keep at least one keyframe - if ( from >= to ) to = Math.max( to, 1 ), from = to - 1; + } - var stride = this.getValueSize(); - this.times = AnimationUtils.arraySlice( times, from, to ); - this.values = AnimationUtils. - arraySlice( this.values, from * stride, to * stride ); + bind( skeleton, bindMatrix ) { - } + this.skeleton = skeleton; - return this; + if ( bindMatrix === undefined ) { - }, + this.updateMatrixWorld( true ); - // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable - validate: function () { + this.skeleton.calculateInverses(); - var valid = true; + bindMatrix = this.matrixWorld; - var valueSize = this.getValueSize(); - if ( valueSize - Math.floor( valueSize ) !== 0 ) { + } - console.error( 'THREE.KeyframeTrackPrototype: Invalid value size in track.', this ); - valid = false; + this.bindMatrix.copy( bindMatrix ); + this.bindMatrixInverse.copy( bindMatrix ).invert(); - } + } - var times = this.times, - values = this.values, + pose() { - nKeys = times.length; + this.skeleton.pose(); - if ( nKeys === 0 ) { + } - console.error( 'THREE.KeyframeTrackPrototype: Track is empty.', this ); - valid = false; + normalizeSkinWeights() { - } + const vector = new Vector4(); - var prevTime = null; + const skinWeight = this.geometry.attributes.skinWeight; - for ( var i = 0; i !== nKeys; i ++ ) { + for ( let i = 0, l = skinWeight.count; i < l; i ++ ) { - var currTime = times[ i ]; + vector.fromBufferAttribute( skinWeight, i ); - if ( typeof currTime === 'number' && isNaN( currTime ) ) { + const scale = 1.0 / vector.manhattanLength(); - console.error( 'THREE.KeyframeTrackPrototype: Time is not a valid number.', this, i, currTime ); - valid = false; - break; + if ( scale !== Infinity ) { - } + vector.multiplyScalar( scale ); - if ( prevTime !== null && prevTime > currTime ) { + } else { - console.error( 'THREE.KeyframeTrackPrototype: Out of order keys.', this, i, currTime, prevTime ); - valid = false; - break; + vector.set( 1, 0, 0, 0 ); // do something reasonable } - prevTime = currTime; + skinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w ); } - if ( values !== undefined ) { + } - if ( AnimationUtils.isTypedArray( values ) ) { + updateMatrixWorld( force ) { - for ( var i = 0, n = values.length; i !== n; ++ i ) { + super.updateMatrixWorld( force ); - var value = values[ i ]; + if ( this.bindMode === 'attached' ) { - if ( isNaN( value ) ) { + this.bindMatrixInverse.copy( this.matrixWorld ).invert(); - console.error( 'THREE.KeyframeTrackPrototype: Value is not a valid number.', this, i, value ); - valid = false; - break; + } else if ( this.bindMode === 'detached' ) { - } + this.bindMatrixInverse.copy( this.bindMatrix ).invert(); - } + } else { - } + console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode ); } - return valid; + } - }, + applyBoneTransform( index, vector ) { - // removes equivalent sequential keys as common in morph target sequences - // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) - optimize: function () { + const skeleton = this.skeleton; + const geometry = this.geometry; - var times = this.times, - values = this.values, - stride = this.getValueSize(), + _skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index ); + _skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index ); - smoothInterpolation = this.getInterpolation() === InterpolateSmooth, + _basePosition.copy( vector ).applyMatrix4( this.bindMatrix ); - writeIndex = 1, - lastIndex = times.length - 1; + vector.set( 0, 0, 0 ); - for ( var i = 1; i < lastIndex; ++ i ) { + for ( let i = 0; i < 4; i ++ ) { - var keep = false; + const weight = _skinWeight.getComponent( i ); - var time = times[ i ]; - var timeNext = times[ i + 1 ]; + if ( weight !== 0 ) { - // remove adjacent keyframes scheduled at the same time + const boneIndex = _skinIndex.getComponent( i ); - if ( time !== timeNext && ( i !== 1 || time !== time[ 0 ] ) ) { + _matrix4.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] ); - if ( ! smoothInterpolation ) { + vector.addScaledVector( _vector3.copy( _basePosition ).applyMatrix4( _matrix4 ), weight ); - // remove unnecessary keyframes same as their neighbors + } - var offset = i * stride, - offsetP = offset - stride, - offsetN = offset + stride; + } - for ( var j = 0; j !== stride; ++ j ) { + return vector.applyMatrix4( this.bindMatrixInverse ); - var value = values[ offset + j ]; + } - if ( value !== values[ offsetP + j ] || - value !== values[ offsetN + j ] ) { + boneTransform( index, vector ) { // @deprecated, r151 - keep = true; - break; + console.warn( 'THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151.' ); + return this.applyBoneTransform( index, vector ); - } + } - } - } else keep = true; + } - } + class Bone extends Object3D { - // in-place compaction + constructor() { - if ( keep ) { + super(); - if ( i !== writeIndex ) { + this.isBone = true; - times[ writeIndex ] = times[ i ]; + this.type = 'Bone'; - var readOffset = i * stride, - writeOffset = writeIndex * stride; + } - for ( var j = 0; j !== stride; ++ j ) + } - values[ writeOffset + j ] = values[ readOffset + j ]; + class DataTexture extends Texture { - } + constructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace ) { - ++ writeIndex; + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ); - } + this.isDataTexture = true; - } + this.image = { data: data, width: width, height: height }; - // flush last keyframe (compaction looks ahead) + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; - if ( lastIndex > 0 ) { + } - times[ writeIndex ] = times[ lastIndex ]; + } - for ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) + const _offsetMatrix = /*@__PURE__*/ new Matrix4(); + const _identityMatrix = /*@__PURE__*/ new Matrix4(); - values[ writeOffset + j ] = values[ readOffset + j ]; + class Skeleton { - ++ writeIndex; + constructor( bones = [], boneInverses = [] ) { - } + this.uuid = generateUUID(); - if ( writeIndex !== times.length ) { + this.bones = bones.slice( 0 ); + this.boneInverses = boneInverses; + this.boneMatrices = null; - this.times = AnimationUtils.arraySlice( times, 0, writeIndex ); - this.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride ); + this.boneTexture = null; + this.boneTextureSize = 0; - } + this.frame = - 1; - return this; + this.init(); } - }; + init() { - function KeyframeTrackConstructor( name, times, values, interpolation ) { + const bones = this.bones; + const boneInverses = this.boneInverses; - if ( name === undefined ) throw new Error( "track name is undefined" ); + this.boneMatrices = new Float32Array( bones.length * 16 ); - if ( times === undefined || times.length === 0 ) { + // calculate inverse bone matrices if necessary - throw new Error( "no keyframes in track named " + name ); + if ( boneInverses.length === 0 ) { - } + this.calculateInverses(); - this.name = name; + } else { - this.times = AnimationUtils.convertArray( times, this.TimeBufferType ); - this.values = AnimationUtils.convertArray( values, this.ValueBufferType ); + // handle special case - this.setInterpolation( interpolation || this.DefaultInterpolation ); + if ( bones.length !== boneInverses.length ) { - this.validate(); - this.optimize(); + console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' ); - } + this.boneInverses = []; - /** - * - * A Track of vectored keyframe values. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { - function VectorKeyframeTrack( name, times, values, interpolation ) { + this.boneInverses.push( new Matrix4() ); - KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + } - } + } - VectorKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + } - constructor: VectorKeyframeTrack, + } - ValueTypeName: 'vector' + calculateInverses() { - // ValueBufferType is inherited + this.boneInverses.length = 0; - // DefaultInterpolation is inherited + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { - } ); + const inverse = new Matrix4(); - /** - * Spherical linear unit quaternion interpolant. - * - * @author tschw - */ + if ( this.bones[ i ] ) { - function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + inverse.copy( this.bones[ i ].matrixWorld ).invert(); - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + } - } + this.boneInverses.push( inverse ); - QuaternionLinearInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { + } - constructor: QuaternionLinearInterpolant, + } - interpolate_: function( i1, t0, t, t1 ) { + pose() { - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, + // recover the bind-time world matrices - offset = i1 * stride, + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { - alpha = ( t - t0 ) / ( t1 - t0 ); + const bone = this.bones[ i ]; - for ( var end = offset + stride; offset !== end; offset += 4 ) { + if ( bone ) { + + bone.matrixWorld.copy( this.boneInverses[ i ] ).invert(); - Quaternion.slerpFlat( result, 0, - values, offset - stride, values, offset, alpha ); + } } - return result; + // compute the local matrices, positions, rotations and scales - } + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { - } ); + const bone = this.bones[ i ]; - /** - * - * A Track of quaternion keyframe values. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + if ( bone ) { - function QuaternionKeyframeTrack( name, times, values, interpolation ) { + if ( bone.parent && bone.parent.isBone ) { - KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + bone.matrix.copy( bone.parent.matrixWorld ).invert(); + bone.matrix.multiply( bone.matrixWorld ); - } + } else { - QuaternionKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + bone.matrix.copy( bone.matrixWorld ); - constructor: QuaternionKeyframeTrack, + } - ValueTypeName: 'quaternion', + bone.matrix.decompose( bone.position, bone.quaternion, bone.scale ); - // ValueBufferType is inherited + } - DefaultInterpolation: InterpolateLinear, + } - InterpolantFactoryMethodLinear: function( result ) { + } - return new QuaternionLinearInterpolant( - this.times, this.values, this.getValueSize(), result ); + update() { - }, + const bones = this.bones; + const boneInverses = this.boneInverses; + const boneMatrices = this.boneMatrices; + const boneTexture = this.boneTexture; - InterpolantFactoryMethodSmooth: undefined // not yet implemented + // flatten bone matrices to array - } ); + for ( let i = 0, il = bones.length; i < il; i ++ ) { - /** - * - * A Track of numeric keyframe values. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + // compute the offset between the current and the original transform - function NumberKeyframeTrack( name, times, values, interpolation ) { + const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix; - KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + _offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] ); + _offsetMatrix.toArray( boneMatrices, i * 16 ); - } + } - NumberKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + if ( boneTexture !== null ) { - constructor: NumberKeyframeTrack, + boneTexture.needsUpdate = true; - ValueTypeName: 'number' + } - // ValueBufferType is inherited + } - // DefaultInterpolation is inherited + clone() { - } ); + return new Skeleton( this.bones, this.boneInverses ); - /** - * - * A Track that interpolates Strings - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + } - function StringKeyframeTrack( name, times, values, interpolation ) { + computeBoneTexture() { - KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + // layout (1 matrix = 4 pixels) + // RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4) + // with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8) + // 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16) + // 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32) + // 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64) - } + let size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix + size = ceilPowerOfTwo( size ); + size = Math.max( size, 4 ); - StringKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + const boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel + boneMatrices.set( this.boneMatrices ); // copy current values - constructor: StringKeyframeTrack, + const boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType ); + boneTexture.needsUpdate = true; - ValueTypeName: 'string', - ValueBufferType: Array, + this.boneMatrices = boneMatrices; + this.boneTexture = boneTexture; + this.boneTextureSize = size; - DefaultInterpolation: InterpolateDiscrete, + return this; - InterpolantFactoryMethodLinear: undefined, + } - InterpolantFactoryMethodSmooth: undefined + getBoneByName( name ) { - } ); + for ( let i = 0, il = this.bones.length; i < il; i ++ ) { - /** - * - * A Track of Boolean keyframe values. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + const bone = this.bones[ i ]; - function BooleanKeyframeTrack( name, times, values ) { + if ( bone.name === name ) { - KeyframeTrackConstructor.call( this, name, times, values ); + return bone; - } + } - BooleanKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + } - constructor: BooleanKeyframeTrack, + return undefined; - ValueTypeName: 'bool', - ValueBufferType: Array, + } - DefaultInterpolation: InterpolateDiscrete, + dispose( ) { - InterpolantFactoryMethodLinear: undefined, - InterpolantFactoryMethodSmooth: undefined + if ( this.boneTexture !== null ) { - // Note: Actually this track could have a optimized / compressed - // representation of a single value and a custom interpolant that - // computes "firstValue ^ isOdd( index )". + this.boneTexture.dispose(); - } ); + this.boneTexture = null; - /** - * - * A Track of keyframe values that represent color. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + } - function ColorKeyframeTrack( name, times, values, interpolation ) { + } - KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + fromJSON( json, bones ) { - } + this.uuid = json.uuid; - ColorKeyframeTrack.prototype = - Object.assign( Object.create( KeyframeTrackPrototype ), { + for ( let i = 0, l = json.bones.length; i < l; i ++ ) { - constructor: ColorKeyframeTrack, + const uuid = json.bones[ i ]; + let bone = bones[ uuid ]; - ValueTypeName: 'color' + if ( bone === undefined ) { - // ValueBufferType is inherited + console.warn( 'THREE.Skeleton: No bone found with UUID:', uuid ); + bone = new Bone(); - // DefaultInterpolation is inherited + } + this.bones.push( bone ); + this.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) ); - // Note: Very basic implementation and nothing special yet. - // However, this is the place for color space parameterization. + } - } ); + this.init(); - /** - * - * A timed sequence of keyframes for a specific property. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + return this; - function KeyframeTrack( name, times, values, interpolation ) { + } - KeyframeTrackConstructor.apply( this, arguments ); + toJSON() { - } + const data = { + metadata: { + version: 4.6, + type: 'Skeleton', + generator: 'Skeleton.toJSON' + }, + bones: [], + boneInverses: [] + }; - KeyframeTrack.prototype = KeyframeTrackPrototype; - KeyframeTrackPrototype.constructor = KeyframeTrack; + data.uuid = this.uuid; - // Static methods: + const bones = this.bones; + const boneInverses = this.boneInverses; - Object.assign( KeyframeTrack, { + for ( let i = 0, l = bones.length; i < l; i ++ ) { - // Serialization (in static context, because of constructor invocation - // and automatic invocation of .toJSON): + const bone = bones[ i ]; + data.bones.push( bone.uuid ); - parse: function( json ) { + const boneInverse = boneInverses[ i ]; + data.boneInverses.push( boneInverse.toArray() ); - if( json.type === undefined ) { + } - throw new Error( "track type undefined, can not parse" ); + return data; - } + } - var trackType = KeyframeTrack._getTrackTypeForValueTypeName( json.type ); + } - if ( json.times === undefined ) { + class InstancedBufferAttribute extends BufferAttribute { - var times = [], values = []; + constructor( array, itemSize, normalized, meshPerAttribute = 1 ) { - AnimationUtils.flattenJSON( json.keys, times, values, 'value' ); + super( array, itemSize, normalized ); - json.times = times; - json.values = values; + this.isInstancedBufferAttribute = true; - } + this.meshPerAttribute = meshPerAttribute; - // derived classes can define a static parse method - if ( trackType.parse !== undefined ) { + } - return trackType.parse( json ); + copy( source ) { - } else { + super.copy( source ); - // by default, we asssume a constructor compatible with the base - return new trackType( - json.name, json.times, json.values, json.interpolation ); + this.meshPerAttribute = source.meshPerAttribute; - } + return this; - }, + } - toJSON: function( track ) { + toJSON() { - var trackType = track.constructor; + const data = super.toJSON(); - var json; + data.meshPerAttribute = this.meshPerAttribute; - // derived classes can define a static toJSON method - if ( trackType.toJSON !== undefined ) { + data.isInstancedBufferAttribute = true; - json = trackType.toJSON( track ); + return data; - } else { + } - // by default, we assume the data can be serialized as-is - json = { + } - 'name': track.name, - 'times': AnimationUtils.convertArray( track.times, Array ), - 'values': AnimationUtils.convertArray( track.values, Array ) + const _instanceLocalMatrix = /*@__PURE__*/ new Matrix4(); + const _instanceWorldMatrix = /*@__PURE__*/ new Matrix4(); - }; + const _instanceIntersects = []; - var interpolation = track.getInterpolation(); + const _box3 = /*@__PURE__*/ new Box3(); + const _identity = /*@__PURE__*/ new Matrix4(); + const _mesh = /*@__PURE__*/ new Mesh(); + const _sphere$2 = /*@__PURE__*/ new Sphere(); - if ( interpolation !== track.DefaultInterpolation ) { + class InstancedMesh extends Mesh { - json.interpolation = interpolation; + constructor( geometry, material, count ) { - } + super( geometry, material ); - } + this.isInstancedMesh = true; - json.type = track.ValueTypeName; // mandatory + this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 ); + this.instanceColor = null; - return json; + this.count = count; - }, + this.boundingBox = null; + this.boundingSphere = null; - _getTrackTypeForValueTypeName: function( typeName ) { + for ( let i = 0; i < count; i ++ ) { - switch( typeName.toLowerCase() ) { + this.setMatrixAt( i, _identity ); - case "scalar": - case "double": - case "float": - case "number": - case "integer": + } - return NumberKeyframeTrack; + } - case "vector": - case "vector2": - case "vector3": - case "vector4": + computeBoundingBox() { - return VectorKeyframeTrack; + const geometry = this.geometry; + const count = this.count; - case "color": + if ( this.boundingBox === null ) { - return ColorKeyframeTrack; + this.boundingBox = new Box3(); - case "quaternion": + } - return QuaternionKeyframeTrack; + if ( geometry.boundingBox === null ) { - case "bool": - case "boolean": + geometry.computeBoundingBox(); - return BooleanKeyframeTrack; + } - case "string": + this.boundingBox.makeEmpty(); - return StringKeyframeTrack; + for ( let i = 0; i < count; i ++ ) { - } + this.getMatrixAt( i, _instanceLocalMatrix ); - throw new Error( "Unsupported typeName: " + typeName ); + _box3.copy( geometry.boundingBox ).applyMatrix4( _instanceLocalMatrix ); - } + this.boundingBox.union( _box3 ); - } ); + } - /** - * - * Reusable set of Tracks that represent an animation. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - */ + } - function AnimationClip( name, duration, tracks ) { + computeBoundingSphere() { - this.name = name; - this.tracks = tracks; - this.duration = ( duration !== undefined ) ? duration : - 1; + const geometry = this.geometry; + const count = this.count; - this.uuid = _Math.generateUUID(); + if ( this.boundingSphere === null ) { - // this means it should figure out its duration by scanning the tracks - if ( this.duration < 0 ) { + this.boundingSphere = new Sphere(); - this.resetDuration(); + } - } + if ( geometry.boundingSphere === null ) { - this.optimize(); + geometry.computeBoundingSphere(); - } + } - Object.assign( AnimationClip, { + this.boundingSphere.makeEmpty(); - parse: function ( json ) { + for ( let i = 0; i < count; i ++ ) { - var tracks = [], - jsonTracks = json.tracks, - frameTime = 1.0 / ( json.fps || 1.0 ); + this.getMatrixAt( i, _instanceLocalMatrix ); - for ( var i = 0, n = jsonTracks.length; i !== n; ++ i ) { + _sphere$2.copy( geometry.boundingSphere ).applyMatrix4( _instanceLocalMatrix ); - tracks.push( KeyframeTrack.parse( jsonTracks[ i ] ).scale( frameTime ) ); + this.boundingSphere.union( _sphere$2 ); } - return new AnimationClip( json.name, json.duration, tracks ); + } - }, + copy( source, recursive ) { - toJSON: function ( clip ) { + super.copy( source, recursive ); - var tracks = [], - clipTracks = clip.tracks; + this.instanceMatrix.copy( source.instanceMatrix ); - var json = { + if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone(); - 'name': clip.name, - 'duration': clip.duration, - 'tracks': tracks + this.count = source.count; - }; + if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone(); + if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone(); - for ( var i = 0, n = clipTracks.length; i !== n; ++ i ) { + return this; - tracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) ); + } - } + getColorAt( index, color ) { - return json; + color.fromArray( this.instanceColor.array, index * 3 ); - }, + } - CreateFromMorphTargetSequence: function ( name, morphTargetSequence, fps, noLoop ) { + getMatrixAt( index, matrix ) { - var numMorphTargets = morphTargetSequence.length; - var tracks = []; + matrix.fromArray( this.instanceMatrix.array, index * 16 ); - for ( var i = 0; i < numMorphTargets; i ++ ) { + } - var times = []; - var values = []; + raycast( raycaster, intersects ) { - times.push( - ( i + numMorphTargets - 1 ) % numMorphTargets, - i, - ( i + 1 ) % numMorphTargets ); + const matrixWorld = this.matrixWorld; + const raycastTimes = this.count; - values.push( 0, 1, 0 ); + _mesh.geometry = this.geometry; + _mesh.material = this.material; - var order = AnimationUtils.getKeyframeOrder( times ); - times = AnimationUtils.sortedArray( times, 1, order ); - values = AnimationUtils.sortedArray( values, 1, order ); + if ( _mesh.material === undefined ) return; - // if there is a key at the first frame, duplicate it as the - // last frame as well for perfect loop. - if ( ! noLoop && times[ 0 ] === 0 ) { + // test with bounding sphere first - times.push( numMorphTargets ); - values.push( values[ 0 ] ); + if ( this.boundingSphere === null ) this.computeBoundingSphere(); - } + _sphere$2.copy( this.boundingSphere ); + _sphere$2.applyMatrix4( matrixWorld ); - tracks.push( - new NumberKeyframeTrack( - '.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']', - times, values - ).scale( 1.0 / fps ) ); + if ( raycaster.ray.intersectsSphere( _sphere$2 ) === false ) return; - } + // now test each instance - return new AnimationClip( name, - 1, tracks ); + for ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) { - }, + // calculate the world matrix for each instance - findByName: function ( objectOrClipArray, name ) { + this.getMatrixAt( instanceId, _instanceLocalMatrix ); - var clipArray = objectOrClipArray; + _instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix ); - if ( ! Array.isArray( objectOrClipArray ) ) { + // the mesh represents this single instance - var o = objectOrClipArray; - clipArray = o.geometry && o.geometry.animations || o.animations; + _mesh.matrixWorld = _instanceWorldMatrix; - } + _mesh.raycast( raycaster, _instanceIntersects ); - for ( var i = 0; i < clipArray.length; i ++ ) { + // process the result of raycast - if ( clipArray[ i ].name === name ) { + for ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) { - return clipArray[ i ]; + const intersect = _instanceIntersects[ i ]; + intersect.instanceId = instanceId; + intersect.object = this; + intersects.push( intersect ); } + _instanceIntersects.length = 0; + } - return null; + } - }, + setColorAt( index, color ) { - CreateClipsFromMorphTargetSequences: function ( morphTargets, fps, noLoop ) { + if ( this.instanceColor === null ) { - var animationToMorphTargets = {}; + this.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ), 3 ); - // tested with https://regex101.com/ on trick sequences - // such flamingo_flyA_003, flamingo_run1_003, crdeath0059 - var pattern = /^([\w-]*?)([\d]+)$/; + } - // sort morph target names into animation groups based - // patterns like Walk_001, Walk_002, Run_001, Run_002 - for ( var i = 0, il = morphTargets.length; i < il; i ++ ) { + color.toArray( this.instanceColor.array, index * 3 ); - var morphTarget = morphTargets[ i ]; - var parts = morphTarget.name.match( pattern ); + } - if ( parts && parts.length > 1 ) { + setMatrixAt( index, matrix ) { - var name = parts[ 1 ]; + matrix.toArray( this.instanceMatrix.array, index * 16 ); - var animationMorphTargets = animationToMorphTargets[ name ]; - if ( ! animationMorphTargets ) { + } - animationToMorphTargets[ name ] = animationMorphTargets = []; + updateMorphTargets() { - } + } - animationMorphTargets.push( morphTarget ); + dispose() { - } + this.dispatchEvent( { type: 'dispose' } ); - } + } - var clips = []; + } - for ( var name in animationToMorphTargets ) { + class LineBasicMaterial extends Material { - clips.push( AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) ); + constructor( parameters ) { - } + super(); - return clips; + this.isLineBasicMaterial = true; - }, + this.type = 'LineBasicMaterial'; - // parse the animation.hierarchy format - parseAnimation: function ( animation, bones ) { + this.color = new Color( 0xffffff ); - if ( ! animation ) { + this.map = null; - console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' ); - return null; + this.linewidth = 1; + this.linecap = 'round'; + this.linejoin = 'round'; - } + this.fog = true; - var addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) { + this.setValues( parameters ); - // only return track if there are actually keys. - if ( animationKeys.length !== 0 ) { + } - var times = []; - var values = []; - AnimationUtils.flattenJSON( animationKeys, times, values, propertyName ); + copy( source ) { - // empty keys are filtered out, so check again - if ( times.length !== 0 ) { + super.copy( source ); - destTracks.push( new trackType( trackName, times, values ) ); + this.color.copy( source.color ); - } + this.map = source.map; - } + this.linewidth = source.linewidth; + this.linecap = source.linecap; + this.linejoin = source.linejoin; - }; + this.fog = source.fog; - var tracks = []; + return this; - var clipName = animation.name || 'default'; - // automatic length determination in AnimationClip. - var duration = animation.length || - 1; - var fps = animation.fps || 30; + } - var hierarchyTracks = animation.hierarchy || []; + } - for ( var h = 0; h < hierarchyTracks.length; h ++ ) { + const _start$1 = /*@__PURE__*/ new Vector3(); + const _end$1 = /*@__PURE__*/ new Vector3(); + const _inverseMatrix$1 = /*@__PURE__*/ new Matrix4(); + const _ray$1 = /*@__PURE__*/ new Ray(); + const _sphere$1 = /*@__PURE__*/ new Sphere(); - var animationKeys = hierarchyTracks[ h ].keys; + class Line extends Object3D { - // skip empty tracks - if ( ! animationKeys || animationKeys.length === 0 ) continue; + constructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) { - // process morph targets - if ( animationKeys[ 0 ].morphTargets ) { + super(); - // figure out all morph targets used in this track - var morphTargetNames = {}; + this.isLine = true; - for ( var k = 0; k < animationKeys.length; k ++ ) { + this.type = 'Line'; - if ( animationKeys[ k ].morphTargets ) { + this.geometry = geometry; + this.material = material; - for ( var m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) { + this.updateMorphTargets(); - morphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1; + } - } + copy( source, recursive ) { - } + super.copy( source, recursive ); - } + this.material = source.material; + this.geometry = source.geometry; - // create a track for each morph target with all zero - // morphTargetInfluences except for the keys in which - // the morphTarget is named. - for ( var morphTargetName in morphTargetNames ) { + return this; - var times = []; - var values = []; + } - for ( var m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) { + computeLineDistances() { - var animationKey = animationKeys[ k ]; + const geometry = this.geometry; - times.push( animationKey.time ); - values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 ); + // we assume non-indexed geometry - } + if ( geometry.index === null ) { - tracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) ); + const positionAttribute = geometry.attributes.position; + const lineDistances = [ 0 ]; - } + for ( let i = 1, l = positionAttribute.count; i < l; i ++ ) { - duration = morphTargetNames.length * ( fps || 1.0 ); + _start$1.fromBufferAttribute( positionAttribute, i - 1 ); + _end$1.fromBufferAttribute( positionAttribute, i ); - } else { + lineDistances[ i ] = lineDistances[ i - 1 ]; + lineDistances[ i ] += _start$1.distanceTo( _end$1 ); - // ...assume skeletal animation + } - var boneName = '.bones[' + bones[ h ].name + ']'; + geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); - addNonemptyTrack( - VectorKeyframeTrack, boneName + '.position', - animationKeys, 'pos', tracks ); + } else { - addNonemptyTrack( - QuaternionKeyframeTrack, boneName + '.quaternion', - animationKeys, 'rot', tracks ); + console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); - addNonemptyTrack( - VectorKeyframeTrack, boneName + '.scale', - animationKeys, 'scl', tracks ); + } - } + return this; - } + } - if ( tracks.length === 0 ) { + raycast( raycaster, intersects ) { - return null; + const geometry = this.geometry; + const matrixWorld = this.matrixWorld; + const threshold = raycaster.params.Line.threshold; + const drawRange = geometry.drawRange; - } + // Checking boundingSphere distance to ray - var clip = new AnimationClip( clipName, duration, tracks ); + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - return clip; + _sphere$1.copy( geometry.boundingSphere ); + _sphere$1.applyMatrix4( matrixWorld ); + _sphere$1.radius += threshold; - } + if ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return; - } ); + // - Object.assign( AnimationClip.prototype, { + _inverseMatrix$1.copy( matrixWorld ).invert(); + _ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 ); - resetDuration: function () { + const localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); + const localThresholdSq = localThreshold * localThreshold; - var tracks = this.tracks, duration = 0; + const vStart = new Vector3(); + const vEnd = new Vector3(); + const interSegment = new Vector3(); + const interRay = new Vector3(); + const step = this.isLineSegments ? 2 : 1; - for ( var i = 0, n = tracks.length; i !== n; ++ i ) { + const index = geometry.index; + const attributes = geometry.attributes; + const positionAttribute = attributes.position; - var track = this.tracks[ i ]; + if ( index !== null ) { - duration = Math.max( duration, track.times[ track.times.length - 1 ] ); + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); - } + for ( let i = start, l = end - 1; i < l; i += step ) { - this.duration = duration; + const a = index.getX( i ); + const b = index.getX( i + 1 ); - }, + vStart.fromBufferAttribute( positionAttribute, a ); + vEnd.fromBufferAttribute( positionAttribute, b ); - trim: function () { + const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); - for ( var i = 0; i < this.tracks.length; i ++ ) { + if ( distSq > localThresholdSq ) continue; - this.tracks[ i ].trim( 0, this.duration ); + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation - } + const distance = raycaster.ray.origin.distanceTo( interRay ); - return this; + if ( distance < raycaster.near || distance > raycaster.far ) continue; - }, + intersects.push( { - optimize: function () { + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this - for ( var i = 0; i < this.tracks.length; i ++ ) { + } ); - this.tracks[ i ].optimize(); + } - } + } else { - return this; + const start = Math.max( 0, drawRange.start ); + const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) ); - } + for ( let i = start, l = end - 1; i < l; i += step ) { - } ); + vStart.fromBufferAttribute( positionAttribute, i ); + vEnd.fromBufferAttribute( positionAttribute, i + 1 ); - /** - * @author mrdoob / http://mrdoob.com/ - */ + const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); - function MaterialLoader( manager ) { + if ( distSq > localThresholdSq ) continue; - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; - this.textures = {}; + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation - } + const distance = raycaster.ray.origin.distanceTo( interRay ); - Object.assign( MaterialLoader.prototype, { + if ( distance < raycaster.near || distance > raycaster.far ) continue; - load: function ( url, onLoad, onProgress, onError ) { + intersects.push( { - var scope = this; + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this - var loader = new FileLoader( scope.manager ); - loader.load( url, function ( text ) { + } ); - onLoad( scope.parse( JSON.parse( text ) ) ); + } - }, onProgress, onError ); + } - }, + } - setTextures: function ( value ) { + updateMorphTargets() { - this.textures = value; + const geometry = this.geometry; - }, + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); - parse: function ( json ) { + if ( keys.length > 0 ) { - var textures = this.textures; + const morphAttribute = morphAttributes[ keys[ 0 ] ]; - function getTexture( name ) { + if ( morphAttribute !== undefined ) { - if ( textures[ name ] === undefined ) { + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; - console.warn( 'THREE.MaterialLoader: Undefined texture', name ); + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - } + const name = morphAttribute[ m ].name || String( m ); - return textures[ name ]; + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; + + } + + } } - var material = new Materials[ json.type ](); + } - if ( json.uuid !== undefined ) material.uuid = json.uuid; - if ( json.name !== undefined ) material.name = json.name; - if ( json.color !== undefined ) material.color.setHex( json.color ); - if ( json.roughness !== undefined ) material.roughness = json.roughness; - if ( json.metalness !== undefined ) material.metalness = json.metalness; - if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive ); - if ( json.specular !== undefined ) material.specular.setHex( json.specular ); - if ( json.shininess !== undefined ) material.shininess = json.shininess; - if ( json.clearCoat !== undefined ) material.clearCoat = json.clearCoat; - if ( json.clearCoatRoughness !== undefined ) material.clearCoatRoughness = json.clearCoatRoughness; - if ( json.uniforms !== undefined ) material.uniforms = json.uniforms; - if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; - if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; - if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors; - if ( json.fog !== undefined ) material.fog = json.fog; - if ( json.shading !== undefined ) material.shading = json.shading; - if ( json.blending !== undefined ) material.blending = json.blending; - if ( json.side !== undefined ) material.side = json.side; - if ( json.opacity !== undefined ) material.opacity = json.opacity; - if ( json.transparent !== undefined ) material.transparent = json.transparent; - if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; - if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; - if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; - if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; - if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; - if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; - if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; - if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin; - if ( json.skinning !== undefined ) material.skinning = json.skinning; - if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets; + } - // for PointsMaterial + const _start = /*@__PURE__*/ new Vector3(); + const _end = /*@__PURE__*/ new Vector3(); - if ( json.size !== undefined ) material.size = json.size; - if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation; + class LineSegments extends Line { - // maps + constructor( geometry, material ) { - if ( json.map !== undefined ) material.map = getTexture( json.map ); + super( geometry, material ); - if ( json.alphaMap !== undefined ) { + this.isLineSegments = true; - material.alphaMap = getTexture( json.alphaMap ); - material.transparent = true; + this.type = 'LineSegments'; - } + } - if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap ); - if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; + computeLineDistances() { - if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap ); - if ( json.normalScale !== undefined ) { + const geometry = this.geometry; - var normalScale = json.normalScale; + // we assume non-indexed geometry - if ( Array.isArray( normalScale ) === false ) { + if ( geometry.index === null ) { - // Blender exporter used to export a scalar. See #7459 + const positionAttribute = geometry.attributes.position; + const lineDistances = []; - normalScale = [ normalScale, normalScale ]; + for ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) { + + _start.fromBufferAttribute( positionAttribute, i ); + _end.fromBufferAttribute( positionAttribute, i + 1 ); + + lineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ]; + lineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end ); } - material.normalScale = new Vector2().fromArray( normalScale ); + geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); - } + } else { - if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap ); - if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale; - if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias; + console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); - if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap ); - if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap ); + } - if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap ); - if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; + return this; - if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap ); + } - if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap ); + } - if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; + class LineLoop extends Line { - if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); - if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; + constructor( geometry, material ) { - if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); - if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; + super( geometry, material ); - if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap ); + this.isLineLoop = true; - return material; + this.type = 'LineLoop'; } - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + class PointsMaterial extends Material { - function BufferGeometryLoader( manager ) { + constructor( parameters ) { - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + super(); - } + this.isPointsMaterial = true; - Object.assign( BufferGeometryLoader.prototype, { + this.type = 'PointsMaterial'; - load: function ( url, onLoad, onProgress, onError ) { + this.color = new Color( 0xffffff ); - var scope = this; + this.map = null; - var loader = new FileLoader( scope.manager ); - loader.load( url, function ( text ) { + this.alphaMap = null; - onLoad( scope.parse( JSON.parse( text ) ) ); + this.size = 1; + this.sizeAttenuation = true; - }, onProgress, onError ); + this.fog = true; - }, + this.setValues( parameters ); - parse: function ( json ) { + } - var geometry = new BufferGeometry(); + copy( source ) { - var index = json.data.index; + super.copy( source ); - if ( index !== undefined ) { + this.color.copy( source.color ); - var typedArray = new TYPED_ARRAYS[ index.type ]( index.array ); - geometry.setIndex( new BufferAttribute( typedArray, 1 ) ); + this.map = source.map; - } + this.alphaMap = source.alphaMap; + + this.size = source.size; + this.sizeAttenuation = source.sizeAttenuation; - var attributes = json.data.attributes; + this.fog = source.fog; - for ( var key in attributes ) { + return this; - var attribute = attributes[ key ]; - var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array ); + } - geometry.addAttribute( key, new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ) ); + } - } + const _inverseMatrix = /*@__PURE__*/ new Matrix4(); + const _ray = /*@__PURE__*/ new Ray(); + const _sphere = /*@__PURE__*/ new Sphere(); + const _position$2 = /*@__PURE__*/ new Vector3(); - var groups = json.data.groups || json.data.drawcalls || json.data.offsets; + class Points extends Object3D { - if ( groups !== undefined ) { + constructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) { - for ( var i = 0, n = groups.length; i !== n; ++ i ) { + super(); - var group = groups[ i ]; + this.isPoints = true; - geometry.addGroup( group.start, group.count, group.materialIndex ); + this.type = 'Points'; - } + this.geometry = geometry; + this.material = material; - } + this.updateMorphTargets(); - var boundingSphere = json.data.boundingSphere; + } - if ( boundingSphere !== undefined ) { + copy( source, recursive ) { - var center = new Vector3(); + super.copy( source, recursive ); - if ( boundingSphere.center !== undefined ) { + this.material = source.material; + this.geometry = source.geometry; - center.fromArray( boundingSphere.center ); + return this; - } + } - geometry.boundingSphere = new Sphere( center, boundingSphere.radius ); + raycast( raycaster, intersects ) { - } + const geometry = this.geometry; + const matrixWorld = this.matrixWorld; + const threshold = raycaster.params.Points.threshold; + const drawRange = geometry.drawRange; - return geometry; + // Checking boundingSphere distance to ray - } + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - } ); + _sphere.copy( geometry.boundingSphere ); + _sphere.applyMatrix4( matrixWorld ); + _sphere.radius += threshold; - var TYPED_ARRAYS = { - Int8Array: Int8Array, - Uint8Array: Uint8Array, - // Workaround for IE11 pre KB2929437. See #11440 - Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array, - Int16Array: Int16Array, - Uint16Array: Uint16Array, - Int32Array: Int32Array, - Uint32Array: Uint32Array, - Float32Array: Float32Array, - Float64Array: Float64Array - }; + if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return; - /** - * @author alteredq / http://alteredqualia.com/ - */ + // - function Loader() { + _inverseMatrix.copy( matrixWorld ).invert(); + _ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix ); - this.onLoadStart = function () {}; - this.onLoadProgress = function () {}; - this.onLoadComplete = function () {}; + const localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); + const localThresholdSq = localThreshold * localThreshold; - } + const index = geometry.index; + const attributes = geometry.attributes; + const positionAttribute = attributes.position; + + if ( index !== null ) { - Loader.Handlers = { + const start = Math.max( 0, drawRange.start ); + const end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); - handlers: [], + for ( let i = start, il = end; i < il; i ++ ) { - add: function ( regex, loader ) { + const a = index.getX( i ); - this.handlers.push( regex, loader ); + _position$2.fromBufferAttribute( positionAttribute, a ); - }, + testPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this ); - get: function ( file ) { + } - var handlers = this.handlers; + } else { - for ( var i = 0, l = handlers.length; i < l; i += 2 ) { + const start = Math.max( 0, drawRange.start ); + const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) ); - var regex = handlers[ i ]; - var loader = handlers[ i + 1 ]; + for ( let i = start, l = end; i < l; i ++ ) { - if ( regex.test( file ) ) { + _position$2.fromBufferAttribute( positionAttribute, i ); - return loader; + testPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this ); } } - return null; - } - }; - - Object.assign( Loader.prototype, { + updateMorphTargets() { - crossOrigin: undefined, + const geometry = this.geometry; - extractUrlBase: function ( url ) { + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys( morphAttributes ); - var parts = url.split( '/' ); + if ( keys.length > 0 ) { - if ( parts.length === 1 ) return './'; + const morphAttribute = morphAttributes[ keys[ 0 ] ]; - parts.pop(); + if ( morphAttribute !== undefined ) { - return parts.join( '/' ) + '/'; + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; - }, + for ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - initMaterials: function ( materials, texturePath, crossOrigin ) { + const name = morphAttribute[ m ].name || String( m ); - var array = []; + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ name ] = m; - for ( var i = 0; i < materials.length; ++ i ) { + } - array[ i ] = this.createMaterial( materials[ i ], texturePath, crossOrigin ); + } } - return array; + } - }, + } - createMaterial: ( function () { + function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) { - var BlendingMode = { - NoBlending: NoBlending, - NormalBlending: NormalBlending, - AdditiveBlending: AdditiveBlending, - SubtractiveBlending: SubtractiveBlending, - MultiplyBlending: MultiplyBlending, - CustomBlending: CustomBlending - }; + const rayPointDistanceSq = _ray.distanceSqToPoint( point ); - var color = new Color(); - var textureLoader = new TextureLoader(); - var materialLoader = new MaterialLoader(); + if ( rayPointDistanceSq < localThresholdSq ) { - return function createMaterial( m, texturePath, crossOrigin ) { + const intersectPoint = new Vector3(); - // convert from old material format + _ray.closestPointToPoint( point, intersectPoint ); + intersectPoint.applyMatrix4( matrixWorld ); - var textures = {}; + const distance = raycaster.ray.origin.distanceTo( intersectPoint ); - function loadTexture( path, repeat, offset, wrap, anisotropy ) { + if ( distance < raycaster.near || distance > raycaster.far ) return; - var fullPath = texturePath + path; - var loader = Loader.Handlers.get( fullPath ); + intersects.push( { - var texture; + distance: distance, + distanceToRay: Math.sqrt( rayPointDistanceSq ), + point: intersectPoint, + index: index, + face: null, + object: object - if ( loader !== null ) { + } ); - texture = loader.load( fullPath ); + } - } else { + } - textureLoader.setCrossOrigin( crossOrigin ); - texture = textureLoader.load( fullPath ); + class VideoTexture extends Texture { - } + constructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { - if ( repeat !== undefined ) { + super( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - texture.repeat.fromArray( repeat ); + this.isVideoTexture = true; - if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; - if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; + this.minFilter = minFilter !== undefined ? minFilter : LinearFilter; + this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; - } + this.generateMipmaps = false; - if ( offset !== undefined ) { + const scope = this; - texture.offset.fromArray( offset ); + function updateVideo() { - } + scope.needsUpdate = true; + video.requestVideoFrameCallback( updateVideo ); - if ( wrap !== undefined ) { + } - if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; - if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; + if ( 'requestVideoFrameCallback' in video ) { - if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; - if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; + video.requestVideoFrameCallback( updateVideo ); - } + } - if ( anisotropy !== undefined ) { + } - texture.anisotropy = anisotropy; + clone() { - } + return new this.constructor( this.image ).copy( this ); - var uuid = _Math.generateUUID(); + } - textures[ uuid ] = texture; + update() { - return uuid; + const video = this.image; + const hasVideoFrameCallback = 'requestVideoFrameCallback' in video; - } + if ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) { - // + this.needsUpdate = true; - var json = { - uuid: _Math.generateUUID(), - type: 'MeshLambertMaterial' - }; + } - for ( var name in m ) { + } - var value = m[ name ]; + } - switch ( name ) { + class FramebufferTexture extends Texture { - case 'DbgColor': - case 'DbgIndex': - case 'opticalDensity': - case 'illumination': - break; - case 'DbgName': - json.name = value; - break; - case 'blending': - json.blending = BlendingMode[ value ]; - break; - case 'colorAmbient': - case 'mapAmbient': - console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); - break; - case 'colorDiffuse': - json.color = color.fromArray( value ).getHex(); - break; - case 'colorSpecular': - json.specular = color.fromArray( value ).getHex(); - break; - case 'colorEmissive': - json.emissive = color.fromArray( value ).getHex(); - break; - case 'specularCoef': - json.shininess = value; - break; - case 'shading': - if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; - if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; - if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; - break; - case 'mapDiffuse': - json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy ); - break; - case 'mapDiffuseRepeat': - case 'mapDiffuseOffset': - case 'mapDiffuseWrap': - case 'mapDiffuseAnisotropy': - break; - case 'mapEmissive': - json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy ); - break; - case 'mapEmissiveRepeat': - case 'mapEmissiveOffset': - case 'mapEmissiveWrap': - case 'mapEmissiveAnisotropy': - break; - case 'mapLight': - json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy ); - break; - case 'mapLightRepeat': - case 'mapLightOffset': - case 'mapLightWrap': - case 'mapLightAnisotropy': - break; - case 'mapAO': - json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy ); - break; - case 'mapAORepeat': - case 'mapAOOffset': - case 'mapAOWrap': - case 'mapAOAnisotropy': - break; - case 'mapBump': - json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy ); - break; - case 'mapBumpScale': - json.bumpScale = value; - break; - case 'mapBumpRepeat': - case 'mapBumpOffset': - case 'mapBumpWrap': - case 'mapBumpAnisotropy': - break; - case 'mapNormal': - json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy ); - break; - case 'mapNormalFactor': - json.normalScale = [ value, value ]; - break; - case 'mapNormalRepeat': - case 'mapNormalOffset': - case 'mapNormalWrap': - case 'mapNormalAnisotropy': - break; - case 'mapSpecular': - json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy ); - break; - case 'mapSpecularRepeat': - case 'mapSpecularOffset': - case 'mapSpecularWrap': - case 'mapSpecularAnisotropy': - break; - case 'mapMetalness': - json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy ); - break; - case 'mapMetalnessRepeat': - case 'mapMetalnessOffset': - case 'mapMetalnessWrap': - case 'mapMetalnessAnisotropy': - break; - case 'mapRoughness': - json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy ); - break; - case 'mapRoughnessRepeat': - case 'mapRoughnessOffset': - case 'mapRoughnessWrap': - case 'mapRoughnessAnisotropy': - break; - case 'mapAlpha': - json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy ); - break; - case 'mapAlphaRepeat': - case 'mapAlphaOffset': - case 'mapAlphaWrap': - case 'mapAlphaAnisotropy': - break; - case 'flipSided': - json.side = BackSide; - break; - case 'doubleSided': - json.side = DoubleSide; - break; - case 'transparency': - console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); - json.opacity = value; - break; - case 'depthTest': - case 'depthWrite': - case 'colorWrite': - case 'opacity': - case 'reflectivity': - case 'transparent': - case 'visible': - case 'wireframe': - json[ name ] = value; - break; - case 'vertexColors': - if ( value === true ) json.vertexColors = VertexColors; - if ( value === 'face' ) json.vertexColors = FaceColors; - break; - default: - console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); - break; + constructor( width, height ) { - } + super( { width, height } ); - } + this.isFramebufferTexture = true; - if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; - if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; - if ( json.opacity < 1 ) json.transparent = true; + this.generateMipmaps = false; - materialLoader.setTextures( textures ); + this.needsUpdate = true; - return materialLoader.parse( json ); + } - }; + } - } )() + class CompressedTexture extends Texture { - } ); + constructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) { - /** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ + super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ); - function JSONLoader( manager ) { + this.isCompressedTexture = true; - if ( typeof manager === 'boolean' ) { + this.image = { width: width, height: height }; + this.mipmaps = mipmaps; - console.warn( 'THREE.JSONLoader: showStatus parameter has been removed from constructor.' ); - manager = undefined; + // no flipping for cube textures + // (also flipping doesn't work for compressed textures ) - } + this.flipY = false; + + // can't generate mipmaps for compressed textures + // mips must be embedded in DDS files - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + this.generateMipmaps = false; - this.withCredentials = false; + } } - Object.assign( JSONLoader.prototype, { + class CompressedArrayTexture extends CompressedTexture { - load: function ( url, onLoad, onProgress, onError ) { + constructor( mipmaps, width, height, depth, format, type ) { - var scope = this; + super( mipmaps, width, height, format, type ); - var texturePath = this.texturePath && ( typeof this.texturePath === "string" ) ? this.texturePath : Loader.prototype.extractUrlBase( url ); + this.isCompressedArrayTexture = true; + this.image.depth = depth; + this.wrapR = ClampToEdgeWrapping; - var loader = new FileLoader( this.manager ); - loader.setWithCredentials( this.withCredentials ); - loader.load( url, function ( text ) { + } - var json = JSON.parse( text ); - var metadata = json.metadata; + } - if ( metadata !== undefined ) { + class CanvasTexture extends Texture { - var type = metadata.type; + constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { - if ( type !== undefined ) { + super( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - if ( type.toLowerCase() === 'object' ) { + this.isCanvasTexture = true; - console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' ); - return; + this.needsUpdate = true; - } + } - if ( type.toLowerCase() === 'scene' ) { + } - console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.SceneLoader instead.' ); - return; + /** + * Extensible curve object. + * + * Some common of curve methods: + * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget ) + * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget ) + * .getPoints(), .getSpacedPoints() + * .getLength() + * .updateArcLengths() + * + * This following curves inherit from THREE.Curve: + * + * -- 2D curves -- + * THREE.ArcCurve + * THREE.CubicBezierCurve + * THREE.EllipseCurve + * THREE.LineCurve + * THREE.QuadraticBezierCurve + * THREE.SplineCurve + * + * -- 3D curves -- + * THREE.CatmullRomCurve3 + * THREE.CubicBezierCurve3 + * THREE.LineCurve3 + * THREE.QuadraticBezierCurve3 + * + * A series of curves can be represented as a THREE.CurvePath. + * + **/ - } + class Curve { - } + constructor() { - } + this.type = 'Curve'; - var object = scope.parse( json, texturePath ); - onLoad( object.geometry, object.materials ); + this.arcLengthDivisions = 200; - }, onProgress, onError ); + } - }, + // Virtual base class method to overwrite and implement in subclasses + // - t [0 .. 1] - setTexturePath: function ( value ) { + getPoint( /* t, optionalTarget */ ) { - this.texturePath = value; + console.warn( 'THREE.Curve: .getPoint() not implemented.' ); + return null; - }, + } - parse: ( function () { + // Get point at relative position in curve according to arc length + // - u [0 .. 1] - function parseModel( json, geometry ) { + getPointAt( u, optionalTarget ) { - function isBitSet( value, position ) { + const t = this.getUtoTmapping( u ); + return this.getPoint( t, optionalTarget ); - return value & ( 1 << position ); + } - } + // Get sequence of points using getPoint( t ) - var i, j, fi, + getPoints( divisions = 5 ) { - offset, zLength, + const points = []; - colorIndex, normalIndex, uvIndex, materialIndex, + for ( let d = 0; d <= divisions; d ++ ) { - type, - isQuad, - hasMaterial, - hasFaceVertexUv, - hasFaceNormal, hasFaceVertexNormal, - hasFaceColor, hasFaceVertexColor, + points.push( this.getPoint( d / divisions ) ); - vertex, face, faceA, faceB, hex, normal, + } - uvLayer, uv, u, v, + return points; - faces = json.faces, - vertices = json.vertices, - normals = json.normals, - colors = json.colors, + } - scale = json.scale, + // Get sequence of points using getPointAt( u ) - nUvLayers = 0; + getSpacedPoints( divisions = 5 ) { + const points = []; - if ( json.uvs !== undefined ) { + for ( let d = 0; d <= divisions; d ++ ) { - // disregard empty arrays + points.push( this.getPointAt( d / divisions ) ); - for ( i = 0; i < json.uvs.length; i ++ ) { + } - if ( json.uvs[ i ].length ) nUvLayers ++; + return points; - } + } - for ( i = 0; i < nUvLayers; i ++ ) { + // Get total curve arc length - geometry.faceVertexUvs[ i ] = []; + getLength() { - } + const lengths = this.getLengths(); + return lengths[ lengths.length - 1 ]; - } + } - offset = 0; - zLength = vertices.length; + // Get list of cumulative segment lengths - while ( offset < zLength ) { + getLengths( divisions = this.arcLengthDivisions ) { - vertex = new Vector3(); + if ( this.cacheArcLengths && + ( this.cacheArcLengths.length === divisions + 1 ) && + ! this.needsUpdate ) { - vertex.x = vertices[ offset ++ ] * scale; - vertex.y = vertices[ offset ++ ] * scale; - vertex.z = vertices[ offset ++ ] * scale; + return this.cacheArcLengths; - geometry.vertices.push( vertex ); + } - } + this.needsUpdate = false; - offset = 0; - zLength = faces.length; + const cache = []; + let current, last = this.getPoint( 0 ); + let sum = 0; - while ( offset < zLength ) { + cache.push( 0 ); - type = faces[ offset ++ ]; + for ( let p = 1; p <= divisions; p ++ ) { - isQuad = isBitSet( type, 0 ); - hasMaterial = isBitSet( type, 1 ); - hasFaceVertexUv = isBitSet( type, 3 ); - hasFaceNormal = isBitSet( type, 4 ); - hasFaceVertexNormal = isBitSet( type, 5 ); - hasFaceColor = isBitSet( type, 6 ); - hasFaceVertexColor = isBitSet( type, 7 ); + current = this.getPoint( p / divisions ); + sum += current.distanceTo( last ); + cache.push( sum ); + last = current; - // console.log("type", type, "bits", isQuad, hasMaterial, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor); + } - if ( isQuad ) { + this.cacheArcLengths = cache; - faceA = new Face3(); - faceA.a = faces[ offset ]; - faceA.b = faces[ offset + 1 ]; - faceA.c = faces[ offset + 3 ]; + return cache; // { sums: cache, sum: sum }; Sum is in the last element. - faceB = new Face3(); - faceB.a = faces[ offset + 1 ]; - faceB.b = faces[ offset + 2 ]; - faceB.c = faces[ offset + 3 ]; + } - offset += 4; + updateArcLengths() { - if ( hasMaterial ) { + this.needsUpdate = true; + this.getLengths(); - materialIndex = faces[ offset ++ ]; - faceA.materialIndex = materialIndex; - faceB.materialIndex = materialIndex; + } - } + // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant - // to get face <=> uv index correspondence + getUtoTmapping( u, distance ) { - fi = geometry.faces.length; + const arcLengths = this.getLengths(); - if ( hasFaceVertexUv ) { + let i = 0; + const il = arcLengths.length; - for ( i = 0; i < nUvLayers; i ++ ) { + let targetArcLength; // The targeted u distance value to get - uvLayer = json.uvs[ i ]; + if ( distance ) { - geometry.faceVertexUvs[ i ][ fi ] = []; - geometry.faceVertexUvs[ i ][ fi + 1 ] = []; + targetArcLength = distance; - for ( j = 0; j < 4; j ++ ) { + } else { - uvIndex = faces[ offset ++ ]; + targetArcLength = u * arcLengths[ il - 1 ]; - u = uvLayer[ uvIndex * 2 ]; - v = uvLayer[ uvIndex * 2 + 1 ]; + } - uv = new Vector2( u, v ); + // binary search for the index with largest value smaller than target u distance - if ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv ); - if ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv ); + let low = 0, high = il - 1, comparison; - } + while ( low <= high ) { - } + i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats - } + comparison = arcLengths[ i ] - targetArcLength; - if ( hasFaceNormal ) { + if ( comparison < 0 ) { - normalIndex = faces[ offset ++ ] * 3; + low = i + 1; - faceA.normal.set( - normals[ normalIndex ++ ], - normals[ normalIndex ++ ], - normals[ normalIndex ] - ); + } else if ( comparison > 0 ) { - faceB.normal.copy( faceA.normal ); + high = i - 1; - } + } else { - if ( hasFaceVertexNormal ) { + high = i; + break; - for ( i = 0; i < 4; i ++ ) { + // DONE - normalIndex = faces[ offset ++ ] * 3; + } - normal = new Vector3( - normals[ normalIndex ++ ], - normals[ normalIndex ++ ], - normals[ normalIndex ] - ); + } + i = high; - if ( i !== 2 ) faceA.vertexNormals.push( normal ); - if ( i !== 0 ) faceB.vertexNormals.push( normal ); + if ( arcLengths[ i ] === targetArcLength ) { - } + return i / ( il - 1 ); - } + } + // we could get finer grain at lengths, or use simple interpolation between two points - if ( hasFaceColor ) { + const lengthBefore = arcLengths[ i ]; + const lengthAfter = arcLengths[ i + 1 ]; - colorIndex = faces[ offset ++ ]; - hex = colors[ colorIndex ]; + const segmentLength = lengthAfter - lengthBefore; - faceA.color.setHex( hex ); - faceB.color.setHex( hex ); + // determine where we are between the 'before' and 'after' points - } + const segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength; + // add that fractional amount to t - if ( hasFaceVertexColor ) { + const t = ( i + segmentFraction ) / ( il - 1 ); - for ( i = 0; i < 4; i ++ ) { + return t; - colorIndex = faces[ offset ++ ]; - hex = colors[ colorIndex ]; + } - if ( i !== 2 ) faceA.vertexColors.push( new Color( hex ) ); - if ( i !== 0 ) faceB.vertexColors.push( new Color( hex ) ); + // Returns a unit vector tangent at t + // In case any sub curve does not implement its tangent derivation, + // 2 points a small delta apart will be used to find its gradient + // which seems to give a reasonable approximation - } + getTangent( t, optionalTarget ) { - } + const delta = 0.0001; + let t1 = t - delta; + let t2 = t + delta; - geometry.faces.push( faceA ); - geometry.faces.push( faceB ); + // Capping in case of danger - } else { + if ( t1 < 0 ) t1 = 0; + if ( t2 > 1 ) t2 = 1; - face = new Face3(); - face.a = faces[ offset ++ ]; - face.b = faces[ offset ++ ]; - face.c = faces[ offset ++ ]; + const pt1 = this.getPoint( t1 ); + const pt2 = this.getPoint( t2 ); - if ( hasMaterial ) { + const tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() ); - materialIndex = faces[ offset ++ ]; - face.materialIndex = materialIndex; + tangent.copy( pt2 ).sub( pt1 ).normalize(); - } + return tangent; - // to get face <=> uv index correspondence + } - fi = geometry.faces.length; + getTangentAt( u, optionalTarget ) { - if ( hasFaceVertexUv ) { + const t = this.getUtoTmapping( u ); + return this.getTangent( t, optionalTarget ); - for ( i = 0; i < nUvLayers; i ++ ) { + } - uvLayer = json.uvs[ i ]; + computeFrenetFrames( segments, closed ) { - geometry.faceVertexUvs[ i ][ fi ] = []; + // see http://www.cs.indiana.edu/pub/techreports/TR425.pdf - for ( j = 0; j < 3; j ++ ) { + const normal = new Vector3(); - uvIndex = faces[ offset ++ ]; + const tangents = []; + const normals = []; + const binormals = []; - u = uvLayer[ uvIndex * 2 ]; - v = uvLayer[ uvIndex * 2 + 1 ]; + const vec = new Vector3(); + const mat = new Matrix4(); - uv = new Vector2( u, v ); + // compute the tangent vectors for each segment on the curve - geometry.faceVertexUvs[ i ][ fi ].push( uv ); + for ( let i = 0; i <= segments; i ++ ) { - } + const u = i / segments; - } + tangents[ i ] = this.getTangentAt( u, new Vector3() ); - } + } - if ( hasFaceNormal ) { + // select an initial normal vector perpendicular to the first tangent vector, + // and in the direction of the minimum tangent xyz component - normalIndex = faces[ offset ++ ] * 3; + normals[ 0 ] = new Vector3(); + binormals[ 0 ] = new Vector3(); + let min = Number.MAX_VALUE; + const tx = Math.abs( tangents[ 0 ].x ); + const ty = Math.abs( tangents[ 0 ].y ); + const tz = Math.abs( tangents[ 0 ].z ); - face.normal.set( - normals[ normalIndex ++ ], - normals[ normalIndex ++ ], - normals[ normalIndex ] - ); + if ( tx <= min ) { - } + min = tx; + normal.set( 1, 0, 0 ); - if ( hasFaceVertexNormal ) { + } - for ( i = 0; i < 3; i ++ ) { + if ( ty <= min ) { - normalIndex = faces[ offset ++ ] * 3; + min = ty; + normal.set( 0, 1, 0 ); - normal = new Vector3( - normals[ normalIndex ++ ], - normals[ normalIndex ++ ], - normals[ normalIndex ] - ); + } - face.vertexNormals.push( normal ); + if ( tz <= min ) { - } + normal.set( 0, 0, 1 ); - } + } + vec.crossVectors( tangents[ 0 ], normal ).normalize(); - if ( hasFaceColor ) { + normals[ 0 ].crossVectors( tangents[ 0 ], vec ); + binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ); - colorIndex = faces[ offset ++ ]; - face.color.setHex( colors[ colorIndex ] ); - } + // compute the slowly-varying normal and binormal vectors for each segment on the curve + for ( let i = 1; i <= segments; i ++ ) { - if ( hasFaceVertexColor ) { + normals[ i ] = normals[ i - 1 ].clone(); - for ( i = 0; i < 3; i ++ ) { + binormals[ i ] = binormals[ i - 1 ].clone(); - colorIndex = faces[ offset ++ ]; - face.vertexColors.push( new Color( colors[ colorIndex ] ) ); + vec.crossVectors( tangents[ i - 1 ], tangents[ i ] ); - } + if ( vec.length() > Number.EPSILON ) { - } + vec.normalize(); - geometry.faces.push( face ); + const theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors - } + normals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) ); } - } - - function parseSkin( json, geometry ) { + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); - var influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2; + } - if ( json.skinWeights ) { + // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same - for ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) { + if ( closed === true ) { - var x = json.skinWeights[ i ]; - var y = ( influencesPerVertex > 1 ) ? json.skinWeights[ i + 1 ] : 0; - var z = ( influencesPerVertex > 2 ) ? json.skinWeights[ i + 2 ] : 0; - var w = ( influencesPerVertex > 3 ) ? json.skinWeights[ i + 3 ] : 0; + let theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) ); + theta /= segments; - geometry.skinWeights.push( new Vector4( x, y, z, w ) ); + if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) { - } + theta = - theta; } - if ( json.skinIndices ) { - - for ( var i = 0, l = json.skinIndices.length; i < l; i += influencesPerVertex ) { - - var a = json.skinIndices[ i ]; - var b = ( influencesPerVertex > 1 ) ? json.skinIndices[ i + 1 ] : 0; - var c = ( influencesPerVertex > 2 ) ? json.skinIndices[ i + 2 ] : 0; - var d = ( influencesPerVertex > 3 ) ? json.skinIndices[ i + 3 ] : 0; - - geometry.skinIndices.push( new Vector4( a, b, c, d ) ); + for ( let i = 1; i <= segments; i ++ ) { - } + // twist a little... + normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) ); + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); } - geometry.bones = json.bones; + } - if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) { + return { + tangents: tangents, + normals: normals, + binormals: binormals + }; - console.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' + - geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' ); + } - } + clone() { - } + return new this.constructor().copy( this ); - function parseMorphing( json, geometry ) { + } - var scale = json.scale; + copy( source ) { - if ( json.morphTargets !== undefined ) { + this.arcLengthDivisions = source.arcLengthDivisions; - for ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) { + return this; - geometry.morphTargets[ i ] = {}; - geometry.morphTargets[ i ].name = json.morphTargets[ i ].name; - geometry.morphTargets[ i ].vertices = []; + } - var dstVertices = geometry.morphTargets[ i ].vertices; - var srcVertices = json.morphTargets[ i ].vertices; + toJSON() { - for ( var v = 0, vl = srcVertices.length; v < vl; v += 3 ) { + const data = { + metadata: { + version: 4.6, + type: 'Curve', + generator: 'Curve.toJSON' + } + }; - var vertex = new Vector3(); - vertex.x = srcVertices[ v ] * scale; - vertex.y = srcVertices[ v + 1 ] * scale; - vertex.z = srcVertices[ v + 2 ] * scale; + data.arcLengthDivisions = this.arcLengthDivisions; + data.type = this.type; - dstVertices.push( vertex ); + return data; - } + } - } + fromJSON( json ) { - } + this.arcLengthDivisions = json.arcLengthDivisions; - if ( json.morphColors !== undefined && json.morphColors.length > 0 ) { + return this; - console.warn( 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.' ); + } - var faces = geometry.faces; - var morphColors = json.morphColors[ 0 ].colors; + } - for ( var i = 0, l = faces.length; i < l; i ++ ) { + class EllipseCurve extends Curve { - faces[ i ].color.fromArray( morphColors, i * 3 ); + constructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) { - } + super(); - } + this.isEllipseCurve = true; - } + this.type = 'EllipseCurve'; - function parseAnimations( json, geometry ) { + this.aX = aX; + this.aY = aY; - var outputAnimations = []; + this.xRadius = xRadius; + this.yRadius = yRadius; - // parse old style Bone/Hierarchy animations - var animations = []; + this.aStartAngle = aStartAngle; + this.aEndAngle = aEndAngle; - if ( json.animation !== undefined ) { + this.aClockwise = aClockwise; - animations.push( json.animation ); + this.aRotation = aRotation; - } + } - if ( json.animations !== undefined ) { + getPoint( t, optionalTarget ) { - if ( json.animations.length ) { + const point = optionalTarget || new Vector2(); - animations = animations.concat( json.animations ); + const twoPi = Math.PI * 2; + let deltaAngle = this.aEndAngle - this.aStartAngle; + const samePoints = Math.abs( deltaAngle ) < Number.EPSILON; - } else { + // ensures that deltaAngle is 0 .. 2 PI + while ( deltaAngle < 0 ) deltaAngle += twoPi; + while ( deltaAngle > twoPi ) deltaAngle -= twoPi; - animations.push( json.animations ); + if ( deltaAngle < Number.EPSILON ) { - } + if ( samePoints ) { - } + deltaAngle = 0; - for ( var i = 0; i < animations.length; i ++ ) { + } else { - var clip = AnimationClip.parseAnimation( animations[ i ], geometry.bones ); - if ( clip ) outputAnimations.push( clip ); + deltaAngle = twoPi; } - // parse implicit morph animations - if ( geometry.morphTargets ) { + } - // TODO: Figure out what an appropraite FPS is for morph target animations -- defaulting to 10, but really it is completely arbitrary. - var morphAnimationClips = AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 ); - outputAnimations = outputAnimations.concat( morphAnimationClips ); + if ( this.aClockwise === true && ! samePoints ) { - } + if ( deltaAngle === twoPi ) { - if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations; + deltaAngle = - twoPi; - } + } else { - return function ( json, texturePath ) { + deltaAngle = deltaAngle - twoPi; - if ( json.data !== undefined ) { + } - // Geometry 4.0 spec - json = json.data; + } - } + const angle = this.aStartAngle + t * deltaAngle; + let x = this.aX + this.xRadius * Math.cos( angle ); + let y = this.aY + this.yRadius * Math.sin( angle ); - if ( json.scale !== undefined ) { + if ( this.aRotation !== 0 ) { - json.scale = 1.0 / json.scale; + const cos = Math.cos( this.aRotation ); + const sin = Math.sin( this.aRotation ); - } else { + const tx = x - this.aX; + const ty = y - this.aY; - json.scale = 1.0; + // Rotate the point about the center of the ellipse. + x = tx * cos - ty * sin + this.aX; + y = tx * sin + ty * cos + this.aY; - } + } - var geometry = new Geometry(); + return point.set( x, y ); - parseModel( json, geometry ); - parseSkin( json, geometry ); - parseMorphing( json, geometry ); - parseAnimations( json, geometry ); + } - geometry.computeFaceNormals(); - geometry.computeBoundingSphere(); + copy( source ) { - if ( json.materials === undefined || json.materials.length === 0 ) { + super.copy( source ); - return { geometry: geometry }; + this.aX = source.aX; + this.aY = source.aY; - } else { + this.xRadius = source.xRadius; + this.yRadius = source.yRadius; - var materials = Loader.prototype.initMaterials( json.materials, texturePath, this.crossOrigin ); + this.aStartAngle = source.aStartAngle; + this.aEndAngle = source.aEndAngle; - return { geometry: geometry, materials: materials }; + this.aClockwise = source.aClockwise; - } + this.aRotation = source.aRotation; - }; + return this; - } )() + } - } ); + toJSON() { - /** - * @author mrdoob / http://mrdoob.com/ - */ + const data = super.toJSON(); - function ObjectLoader( manager ) { + data.aX = this.aX; + data.aY = this.aY; - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; - this.texturePath = ''; + data.xRadius = this.xRadius; + data.yRadius = this.yRadius; - } + data.aStartAngle = this.aStartAngle; + data.aEndAngle = this.aEndAngle; - Object.assign( ObjectLoader.prototype, { + data.aClockwise = this.aClockwise; - load: function ( url, onLoad, onProgress, onError ) { + data.aRotation = this.aRotation; - if ( this.texturePath === '' ) { + return data; - this.texturePath = url.substring( 0, url.lastIndexOf( '/' ) + 1 ); + } - } + fromJSON( json ) { - var scope = this; + super.fromJSON( json ); - var loader = new FileLoader( scope.manager ); - loader.load( url, function ( text ) { + this.aX = json.aX; + this.aY = json.aY; - var json = null; + this.xRadius = json.xRadius; + this.yRadius = json.yRadius; - try { + this.aStartAngle = json.aStartAngle; + this.aEndAngle = json.aEndAngle; - json = JSON.parse( text ); + this.aClockwise = json.aClockwise; - } catch ( error ) { + this.aRotation = json.aRotation; - if ( onError !== undefined ) onError( error ); + return this; - console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message ); + } - return; + } - } + class ArcCurve extends EllipseCurve { - var metadata = json.metadata; + constructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { + super( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); - console.error( 'THREE.ObjectLoader: Can\'t load ' + url + '. Use THREE.JSONLoader instead.' ); - return; + this.isArcCurve = true; - } + this.type = 'ArcCurve'; - scope.parse( json, onLoad ); + } - }, onProgress, onError ); + } - }, + /** + * Centripetal CatmullRom Curve - which is useful for avoiding + * cusps and self-intersections in non-uniform catmull rom curves. + * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf + * + * curve.type accepts centripetal(default), chordal and catmullrom + * curve.tension is used for catmullrom which defaults to 0.5 + */ - setTexturePath: function ( value ) { - this.texturePath = value; + /* + Based on an optimized c++ solution in + - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/ + - http://ideone.com/NoEbVM - }, + This CubicPoly class could be used for reusing some variables and calculations, + but for three.js curve use, it could be possible inlined and flatten into a single function call + which can be placed in CurveUtils. + */ - setCrossOrigin: function ( value ) { + function CubicPoly() { - this.crossOrigin = value; + let c0 = 0, c1 = 0, c2 = 0, c3 = 0; - }, + /* + * Compute coefficients for a cubic polynomial + * p(s) = c0 + c1*s + c2*s^2 + c3*s^3 + * such that + * p(0) = x0, p(1) = x1 + * and + * p'(0) = t0, p'(1) = t1. + */ + function init( x0, x1, t0, t1 ) { - parse: function ( json, onLoad ) { + c0 = x0; + c1 = t0; + c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1; + c3 = 2 * x0 - 2 * x1 + t0 + t1; - var geometries = this.parseGeometries( json.geometries ); + } - var images = this.parseImages( json.images, function () { + return { - if ( onLoad !== undefined ) onLoad( object ); + initCatmullRom: function ( x0, x1, x2, x3, tension ) { - } ); + init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) ); + + }, - var textures = this.parseTextures( json.textures, images ); - var materials = this.parseMaterials( json.materials, textures ); + initNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) { - var object = this.parseObject( json.object, geometries, materials ); + // compute tangents when parameterized in [t1,t2] + let t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1; + let t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2; - if ( json.animations ) { + // rescale tangents for parametrization in [0,1] + t1 *= dt1; + t2 *= dt1; - object.animations = this.parseAnimations( json.animations ); + init( x1, x2, t1, t2 ); - } + }, - if ( json.images === undefined || json.images.length === 0 ) { + calc: function ( t ) { - if ( onLoad !== undefined ) onLoad( object ); + const t2 = t * t; + const t3 = t2 * t; + return c0 + c1 * t + c2 * t2 + c3 * t3; } - return object; + }; - }, + } - parseGeometries: function ( json ) { + // - var geometries = {}; + const tmp = /*@__PURE__*/ new Vector3(); + const px = /*@__PURE__*/ new CubicPoly(); + const py = /*@__PURE__*/ new CubicPoly(); + const pz = /*@__PURE__*/ new CubicPoly(); - if ( json !== undefined ) { + class CatmullRomCurve3 extends Curve { - var geometryLoader = new JSONLoader(); - var bufferGeometryLoader = new BufferGeometryLoader(); + constructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) { - for ( var i = 0, l = json.length; i < l; i ++ ) { + super(); - var geometry; - var data = json[ i ]; + this.isCatmullRomCurve3 = true; - switch ( data.type ) { + this.type = 'CatmullRomCurve3'; - case 'PlaneGeometry': - case 'PlaneBufferGeometry': + this.points = points; + this.closed = closed; + this.curveType = curveType; + this.tension = tension; - geometry = new Geometries[ data.type ]( - data.width, - data.height, - data.widthSegments, - data.heightSegments - ); + } - break; + getPoint( t, optionalTarget = new Vector3() ) { - case 'BoxGeometry': - case 'BoxBufferGeometry': - case 'CubeGeometry': // backwards compatible - - geometry = new Geometries[ data.type ]( - data.width, - data.height, - data.depth, - data.widthSegments, - data.heightSegments, - data.depthSegments - ); + const point = optionalTarget; - break; + const points = this.points; + const l = points.length; - case 'CircleGeometry': - case 'CircleBufferGeometry': + const p = ( l - ( this.closed ? 0 : 1 ) ) * t; + let intPoint = Math.floor( p ); + let weight = p - intPoint; - geometry = new Geometries[ data.type ]( - data.radius, - data.segments, - data.thetaStart, - data.thetaLength - ); + if ( this.closed ) { - break; + intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l; - case 'CylinderGeometry': - case 'CylinderBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radiusTop, - data.radiusBottom, - data.height, - data.radialSegments, - data.heightSegments, - data.openEnded, - data.thetaStart, - data.thetaLength - ); + } else if ( weight === 0 && intPoint === l - 1 ) { - break; + intPoint = l - 2; + weight = 1; - case 'ConeGeometry': - case 'ConeBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.height, - data.radialSegments, - data.heightSegments, - data.openEnded, - data.thetaStart, - data.thetaLength - ); + } - break; + let p0, p3; // 4 points (p1 & p2 defined below) - case 'SphereGeometry': - case 'SphereBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.widthSegments, - data.heightSegments, - data.phiStart, - data.phiLength, - data.thetaStart, - data.thetaLength - ); + if ( this.closed || intPoint > 0 ) { - break; + p0 = points[ ( intPoint - 1 ) % l ]; - case 'DodecahedronGeometry': - case 'IcosahedronGeometry': - case 'OctahedronGeometry': - case 'TetrahedronGeometry': + } else { - geometry = new Geometries[ data.type ]( - data.radius, - data.detail - ); + // extrapolate first point + tmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] ); + p0 = tmp; - break; + } - case 'RingGeometry': - case 'RingBufferGeometry': + const p1 = points[ intPoint % l ]; + const p2 = points[ ( intPoint + 1 ) % l ]; - geometry = new Geometries[ data.type ]( - data.innerRadius, - data.outerRadius, - data.thetaSegments, - data.phiSegments, - data.thetaStart, - data.thetaLength - ); + if ( this.closed || intPoint + 2 < l ) { - break; + p3 = points[ ( intPoint + 2 ) % l ]; - case 'TorusGeometry': - case 'TorusBufferGeometry': + } else { - geometry = new Geometries[ data.type ]( - data.radius, - data.tube, - data.radialSegments, - data.tubularSegments, - data.arc - ); + // extrapolate last point + tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] ); + p3 = tmp; - break; + } - case 'TorusKnotGeometry': - case 'TorusKnotBufferGeometry': + if ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) { - geometry = new Geometries[ data.type ]( - data.radius, - data.tube, - data.tubularSegments, - data.radialSegments, - data.p, - data.q - ); + // init Centripetal / Chordal Catmull-Rom + const pow = this.curveType === 'chordal' ? 0.5 : 0.25; + let dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); + let dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); + let dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); - break; + // safety check for repeated points + if ( dt1 < 1e-4 ) dt1 = 1.0; + if ( dt0 < 1e-4 ) dt0 = dt1; + if ( dt2 < 1e-4 ) dt2 = dt1; - case 'LatheGeometry': - case 'LatheBufferGeometry': + px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 ); + py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); + pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); - geometry = new Geometries[ data.type ]( - data.points, - data.segments, - data.phiStart, - data.phiLength - ); + } else if ( this.curveType === 'catmullrom' ) { - break; + px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension ); + py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension ); + pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension ); - case 'BufferGeometry': + } - geometry = bufferGeometryLoader.parse( data ); + point.set( + px.calc( weight ), + py.calc( weight ), + pz.calc( weight ) + ); - break; + return point; - case 'Geometry': + } - geometry = geometryLoader.parse( data, this.texturePath ).geometry; + copy( source ) { - break; + super.copy( source ); - default: + this.points = []; - console.warn( 'THREE.ObjectLoader: Unsupported geometry type "' + data.type + '"' ); + for ( let i = 0, l = source.points.length; i < l; i ++ ) { - continue; + const point = source.points[ i ]; - } + this.points.push( point.clone() ); - geometry.uuid = data.uuid; + } - if ( data.name !== undefined ) geometry.name = data.name; + this.closed = source.closed; + this.curveType = source.curveType; + this.tension = source.tension; - geometries[ data.uuid ] = geometry; + return this; - } + } - } + toJSON() { - return geometries; + const data = super.toJSON(); - }, + data.points = []; - parseMaterials: function ( json, textures ) { + for ( let i = 0, l = this.points.length; i < l; i ++ ) { - var materials = {}; + const point = this.points[ i ]; + data.points.push( point.toArray() ); - if ( json !== undefined ) { + } - var loader = new MaterialLoader(); - loader.setTextures( textures ); + data.closed = this.closed; + data.curveType = this.curveType; + data.tension = this.tension; - for ( var i = 0, l = json.length; i < l; i ++ ) { + return data; - var data = json[ i ]; + } - if ( data.type === 'MultiMaterial' ) { + fromJSON( json ) { - // Deprecated + super.fromJSON( json ); - var array = []; + this.points = []; - for ( var j = 0; j < data.materials.length; j ++ ) { + for ( let i = 0, l = json.points.length; i < l; i ++ ) { - array.push( loader.parse( data.materials[ j ] ) ); + const point = json.points[ i ]; + this.points.push( new Vector3().fromArray( point ) ); - } + } - materials[ data.uuid ] = array; + this.closed = json.closed; + this.curveType = json.curveType; + this.tension = json.tension; - } else { + return this; - materials[ data.uuid ] = loader.parse( data ); + } - } + } - } + /** + * Bezier Curves formulas obtained from + * https://en.wikipedia.org/wiki/B%C3%A9zier_curve + */ - } + function CatmullRom( t, p0, p1, p2, p3 ) { - return materials; + const v0 = ( p2 - p0 ) * 0.5; + const v1 = ( p3 - p1 ) * 0.5; + const t2 = t * t; + const t3 = t * t2; + return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; - }, + } - parseAnimations: function ( json ) { + // - var animations = []; + function QuadraticBezierP0( t, p ) { - for ( var i = 0; i < json.length; i ++ ) { + const k = 1 - t; + return k * k * p; - var clip = AnimationClip.parse( json[ i ] ); + } - animations.push( clip ); + function QuadraticBezierP1( t, p ) { - } + return 2 * ( 1 - t ) * t * p; - return animations; + } - }, + function QuadraticBezierP2( t, p ) { - parseImages: function ( json, onLoad ) { + return t * t * p; - var scope = this; - var images = {}; + } - function loadImage( url ) { + function QuadraticBezier( t, p0, p1, p2 ) { - scope.manager.itemStart( url ); + return QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) + + QuadraticBezierP2( t, p2 ); - return loader.load( url, function () { + } - scope.manager.itemEnd( url ); + // - }, undefined, function () { + function CubicBezierP0( t, p ) { - scope.manager.itemEnd( url ); - scope.manager.itemError( url ); + const k = 1 - t; + return k * k * k * p; - } ); + } - } + function CubicBezierP1( t, p ) { - if ( json !== undefined && json.length > 0 ) { + const k = 1 - t; + return 3 * k * k * t * p; - var manager = new LoadingManager( onLoad ); + } - var loader = new ImageLoader( manager ); - loader.setCrossOrigin( this.crossOrigin ); + function CubicBezierP2( t, p ) { - for ( var i = 0, l = json.length; i < l; i ++ ) { + return 3 * ( 1 - t ) * t * t * p; - var image = json[ i ]; - var path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( image.url ) ? image.url : scope.texturePath + image.url; + } - images[ image.uuid ] = loadImage( path ); + function CubicBezierP3( t, p ) { - } + return t * t * t * p; - } + } - return images; + function CubicBezier( t, p0, p1, p2, p3 ) { - }, + return CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) + + CubicBezierP3( t, p3 ); - parseTextures: function ( json, images ) { + } - function parseConstant( value, type ) { + class CubicBezierCurve extends Curve { - if ( typeof( value ) === 'number' ) return value; + constructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) { - console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value ); + super(); - return type[ value ]; + this.isCubicBezierCurve = true; - } - - var textures = {}; - - if ( json !== undefined ) { + this.type = 'CubicBezierCurve'; - for ( var i = 0, l = json.length; i < l; i ++ ) { + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; - var data = json[ i ]; - - if ( data.image === undefined ) { + } - console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid ); + getPoint( t, optionalTarget = new Vector2() ) { - } + const point = optionalTarget; - if ( images[ data.image ] === undefined ) { + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - console.warn( 'THREE.ObjectLoader: Undefined image', data.image ); + point.set( + CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), + CubicBezier( t, v0.y, v1.y, v2.y, v3.y ) + ); - } + return point; - var texture = new Texture( images[ data.image ] ); - texture.needsUpdate = true; + } - texture.uuid = data.uuid; + copy( source ) { - if ( data.name !== undefined ) texture.name = data.name; + super.copy( source ); - if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING ); + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); - if ( data.offset !== undefined ) texture.offset.fromArray( data.offset ); - if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat ); - if ( data.wrap !== undefined ) { + return this; - texture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING ); - texture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING ); + } - } + toJSON() { - if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER ); - if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER ); - if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy; + const data = super.toJSON(); - if ( data.flipY !== undefined ) texture.flipY = data.flipY; + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); - textures[ data.uuid ] = texture; + return data; - } + } - } + fromJSON( json ) { - return textures; + super.fromJSON( json ); - }, + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + this.v3.fromArray( json.v3 ); - parseObject: function () { + return this; - var matrix = new Matrix4(); + } - return function parseObject( data, geometries, materials ) { + } - var object; + class CubicBezierCurve3 extends Curve { - function getGeometry( name ) { + constructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) { - if ( geometries[ name ] === undefined ) { + super(); - console.warn( 'THREE.ObjectLoader: Undefined geometry', name ); + this.isCubicBezierCurve3 = true; - } + this.type = 'CubicBezierCurve3'; - return geometries[ name ]; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; - } + } - function getMaterial( name ) { + getPoint( t, optionalTarget = new Vector3() ) { - if ( name === undefined ) return undefined; + const point = optionalTarget; - if ( Array.isArray( name ) ) { + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - var array = []; + point.set( + CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), + CubicBezier( t, v0.y, v1.y, v2.y, v3.y ), + CubicBezier( t, v0.z, v1.z, v2.z, v3.z ) + ); - for ( var i = 0, l = name.length; i < l; i ++ ) { + return point; - var uuid = name[ i ]; + } - if ( materials[ uuid ] === undefined ) { + copy( source ) { - console.warn( 'THREE.ObjectLoader: Undefined material', uuid ); + super.copy( source ); - } + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); - array.push( materials[ uuid ] ); + return this; - } + } - return array; + toJSON() { - } + const data = super.toJSON(); - if ( materials[ name ] === undefined ) { + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); - console.warn( 'THREE.ObjectLoader: Undefined material', name ); + return data; - } + } - return materials[ name ]; + fromJSON( json ) { - } + super.fromJSON( json ); - switch ( data.type ) { + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); + this.v3.fromArray( json.v3 ); - case 'Scene': + return this; - object = new Scene(); + } - if ( data.background !== undefined ) { + } - if ( Number.isInteger( data.background ) ) { + class LineCurve extends Curve { - object.background = new Color( data.background ); + constructor( v1 = new Vector2(), v2 = new Vector2() ) { - } + super(); - } + this.isLineCurve = true; - if ( data.fog !== undefined ) { + this.type = 'LineCurve'; - if ( data.fog.type === 'Fog' ) { + this.v1 = v1; + this.v2 = v2; - object.fog = new Fog( data.fog.color, data.fog.near, data.fog.far ); + } - } else if ( data.fog.type === 'FogExp2' ) { + getPoint( t, optionalTarget = new Vector2() ) { - object.fog = new FogExp2( data.fog.color, data.fog.density ); + const point = optionalTarget; - } + if ( t === 1 ) { - } + point.copy( this.v2 ); - break; + } else { - case 'PerspectiveCamera': + point.copy( this.v2 ).sub( this.v1 ); + point.multiplyScalar( t ).add( this.v1 ); - object = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far ); + } - if ( data.focus !== undefined ) object.focus = data.focus; - if ( data.zoom !== undefined ) object.zoom = data.zoom; - if ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge; - if ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset; - if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + return point; - break; + } - case 'OrthographicCamera': + // Line curve is linear, so we can overwrite default getPointAt + getPointAt( u, optionalTarget ) { - object = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far ); + return this.getPoint( u, optionalTarget ); - break; + } - case 'AmbientLight': + getTangent( t, optionalTarget = new Vector2() ) { - object = new AmbientLight( data.color, data.intensity ); + return optionalTarget.subVectors( this.v2, this.v1 ).normalize(); - break; + } - case 'DirectionalLight': + getTangentAt( u, optionalTarget ) { - object = new DirectionalLight( data.color, data.intensity ); + return this.getTangent( u, optionalTarget ); - break; + } - case 'PointLight': + copy( source ) { - object = new PointLight( data.color, data.intensity, data.distance, data.decay ); + super.copy( source ); - break; + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); - case 'RectAreaLight': + return this; - object = new RectAreaLight( data.color, data.intensity, data.width, data.height ); + } - break; + toJSON() { - case 'SpotLight': + const data = super.toJSON(); - object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay ); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); - break; + return data; - case 'HemisphereLight': + } - object = new HemisphereLight( data.color, data.groundColor, data.intensity ); + fromJSON( json ) { - break; + super.fromJSON( json ); - case 'SkinnedMesh': + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); - console.warn( 'THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.' ); + return this; - case 'Mesh': + } - var geometry = getGeometry( data.geometry ); - var material = getMaterial( data.material ); + } - if ( geometry.bones && geometry.bones.length > 0 ) { + class LineCurve3 extends Curve { - object = new SkinnedMesh( geometry, material ); + constructor( v1 = new Vector3(), v2 = new Vector3() ) { - } else { + super(); - object = new Mesh( geometry, material ); + this.isLineCurve3 = true; - } + this.type = 'LineCurve3'; - break; + this.v1 = v1; + this.v2 = v2; - case 'LOD': + } + getPoint( t, optionalTarget = new Vector3() ) { - object = new LOD(); + const point = optionalTarget; - break; + if ( t === 1 ) { - case 'Line': + point.copy( this.v2 ); - object = new Line( getGeometry( data.geometry ), getMaterial( data.material ), data.mode ); + } else { - break; + point.copy( this.v2 ).sub( this.v1 ); + point.multiplyScalar( t ).add( this.v1 ); - case 'LineLoop': + } - object = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) ); + return point; - break; + } + // Line curve is linear, so we can overwrite default getPointAt + getPointAt( u, optionalTarget ) { - case 'LineSegments': + return this.getPoint( u, optionalTarget ); - object = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) ); + } - break; + getTangent( t, optionalTarget = new Vector3() ) { - case 'PointCloud': - case 'Points': + return optionalTarget.subVectors( this.v2, this.v1 ).normalize(); - object = new Points( getGeometry( data.geometry ), getMaterial( data.material ) ); + } - break; + getTangentAt( u, optionalTarget ) { - case 'Sprite': + return this.getTangent( u, optionalTarget ); - object = new Sprite( getMaterial( data.material ) ); + } - break; + copy( source ) { - case 'Group': + super.copy( source ); - object = new Group(); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); - break; + return this; - default: + } + toJSON() { - object = new Object3D(); + const data = super.toJSON(); - } + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); - object.uuid = data.uuid; + return data; - if ( data.name !== undefined ) object.name = data.name; - if ( data.matrix !== undefined ) { + } + fromJSON( json ) { - matrix.fromArray( data.matrix ); - matrix.decompose( object.position, object.quaternion, object.scale ); + super.fromJSON( json ); - } else { + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); - if ( data.position !== undefined ) object.position.fromArray( data.position ); - if ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation ); - if ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion ); - if ( data.scale !== undefined ) object.scale.fromArray( data.scale ); + return this; - } + } - if ( data.castShadow !== undefined ) object.castShadow = data.castShadow; - if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow; + } - if ( data.shadow ) { + class QuadraticBezierCurve extends Curve { - if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias; - if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius; - if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize ); - if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera ); + constructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) { - } + super(); - if ( data.visible !== undefined ) object.visible = data.visible; - if ( data.userData !== undefined ) object.userData = data.userData; + this.isQuadraticBezierCurve = true; - if ( data.children !== undefined ) { + this.type = 'QuadraticBezierCurve'; - for ( var child in data.children ) { + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; - object.add( this.parseObject( data.children[ child ], geometries, materials ) ); + } - } + getPoint( t, optionalTarget = new Vector2() ) { - } + const point = optionalTarget; - if ( data.type === 'LOD' ) { + const v0 = this.v0, v1 = this.v1, v2 = this.v2; - var levels = data.levels; + point.set( + QuadraticBezier( t, v0.x, v1.x, v2.x ), + QuadraticBezier( t, v0.y, v1.y, v2.y ) + ); - for ( var l = 0; l < levels.length; l ++ ) { + return point; - var level = levels[ l ]; - var child = object.getObjectByProperty( 'uuid', level.object ); + } - if ( child !== undefined ) { + copy( source ) { - object.addLevel( child, level.distance ); + super.copy( source ); - } + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); - } + return this; - } + } - return object; + toJSON() { - }; + const data = super.toJSON(); - }() + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); - } ); + return data; - var TEXTURE_MAPPING = { - UVMapping: UVMapping, - CubeReflectionMapping: CubeReflectionMapping, - CubeRefractionMapping: CubeRefractionMapping, - EquirectangularReflectionMapping: EquirectangularReflectionMapping, - EquirectangularRefractionMapping: EquirectangularRefractionMapping, - SphericalReflectionMapping: SphericalReflectionMapping, - CubeUVReflectionMapping: CubeUVReflectionMapping, - CubeUVRefractionMapping: CubeUVRefractionMapping - }; + } - var TEXTURE_WRAPPING = { - RepeatWrapping: RepeatWrapping, - ClampToEdgeWrapping: ClampToEdgeWrapping, - MirroredRepeatWrapping: MirroredRepeatWrapping - }; + fromJSON( json ) { - var TEXTURE_FILTER = { - NearestFilter: NearestFilter, - NearestMipMapNearestFilter: NearestMipMapNearestFilter, - NearestMipMapLinearFilter: NearestMipMapLinearFilter, - LinearFilter: LinearFilter, - LinearMipMapNearestFilter: LinearMipMapNearestFilter, - LinearMipMapLinearFilter: LinearMipMapLinearFilter - }; + super.fromJSON( json ); - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * Bezier Curves formulas obtained from - * http://en.wikipedia.org/wiki/Bézier_curve - */ + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); - function CatmullRom( t, p0, p1, p2, p3 ) { + return this; - var v0 = ( p2 - p0 ) * 0.5; - var v1 = ( p3 - p1 ) * 0.5; - var t2 = t * t; - var t3 = t * t2; - return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; + } } - // + class QuadraticBezierCurve3 extends Curve { - function QuadraticBezierP0( t, p ) { + constructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) { - var k = 1 - t; - return k * k * p; + super(); - } + this.isQuadraticBezierCurve3 = true; - function QuadraticBezierP1( t, p ) { + this.type = 'QuadraticBezierCurve3'; - return 2 * ( 1 - t ) * t * p; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; - } + } - function QuadraticBezierP2( t, p ) { + getPoint( t, optionalTarget = new Vector3() ) { - return t * t * p; + const point = optionalTarget; - } + const v0 = this.v0, v1 = this.v1, v2 = this.v2; - function QuadraticBezier( t, p0, p1, p2 ) { + point.set( + QuadraticBezier( t, v0.x, v1.x, v2.x ), + QuadraticBezier( t, v0.y, v1.y, v2.y ), + QuadraticBezier( t, v0.z, v1.z, v2.z ) + ); - return QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) + - QuadraticBezierP2( t, p2 ); + return point; - } + } - // + copy( source ) { - function CubicBezierP0( t, p ) { + super.copy( source ); - var k = 1 - t; - return k * k * k * p; + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); - } + return this; - function CubicBezierP1( t, p ) { + } - var k = 1 - t; - return 3 * k * k * t * p; + toJSON() { - } + const data = super.toJSON(); - function CubicBezierP2( t, p ) { + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); - return 3 * ( 1 - t ) * t * t * p; + return data; - } + } - function CubicBezierP3( t, p ) { + fromJSON( json ) { - return t * t * t * p; + super.fromJSON( json ); - } + this.v0.fromArray( json.v0 ); + this.v1.fromArray( json.v1 ); + this.v2.fromArray( json.v2 ); - function CubicBezier( t, p0, p1, p2, p3 ) { + return this; - return CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) + - CubicBezierP3( t, p3 ); + } } - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Extensible curve object - * - * Some common of curve methods: - * .getPoint(t), getTangent(t) - * .getPointAt(u), getTangentAt(u) - * .getPoints(), .getSpacedPoints() - * .getLength() - * .updateArcLengths() - * - * This following curves inherit from THREE.Curve: - * - * -- 2D curves -- - * THREE.ArcCurve - * THREE.CubicBezierCurve - * THREE.EllipseCurve - * THREE.LineCurve - * THREE.QuadraticBezierCurve - * THREE.SplineCurve - * - * -- 3D curves -- - * THREE.CatmullRomCurve3 - * THREE.CubicBezierCurve3 - * THREE.LineCurve3 - * THREE.QuadraticBezierCurve3 - * - * A series of curves can be represented as a THREE.CurvePath. - * - **/ + class SplineCurve extends Curve { - /************************************************************** - * Abstract Curve base class - **************************************************************/ + constructor( points = [] ) { - function Curve() { + super(); - this.arcLengthDivisions = 200; + this.isSplineCurve = true; - } + this.type = 'SplineCurve'; - Object.assign( Curve.prototype, { + this.points = points; - // Virtual base class method to overwrite and implement in subclasses - // - t [0 .. 1] + } - getPoint: function () { + getPoint( t, optionalTarget = new Vector2() ) { - console.warn( 'THREE.Curve: .getPoint() not implemented.' ); - return null; + const point = optionalTarget; - }, + const points = this.points; + const p = ( points.length - 1 ) * t; - // Get point at relative position in curve according to arc length - // - u [0 .. 1] + const intPoint = Math.floor( p ); + const weight = p - intPoint; - getPointAt: function ( u ) { + const p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ]; + const p1 = points[ intPoint ]; + const p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + const p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; - var t = this.getUtoTmapping( u ); - return this.getPoint( t ); + point.set( + CatmullRom( weight, p0.x, p1.x, p2.x, p3.x ), + CatmullRom( weight, p0.y, p1.y, p2.y, p3.y ) + ); - }, + return point; - // Get sequence of points using getPoint( t ) + } - getPoints: function ( divisions ) { + copy( source ) { - if ( divisions === undefined ) divisions = 5; + super.copy( source ); - var points = []; + this.points = []; - for ( var d = 0; d <= divisions; d ++ ) { + for ( let i = 0, l = source.points.length; i < l; i ++ ) { - points.push( this.getPoint( d / divisions ) ); + const point = source.points[ i ]; - } + this.points.push( point.clone() ); - return points; + } - }, + return this; - // Get sequence of points using getPointAt( u ) + } - getSpacedPoints: function ( divisions ) { + toJSON() { - if ( divisions === undefined ) divisions = 5; + const data = super.toJSON(); - var points = []; + data.points = []; - for ( var d = 0; d <= divisions; d ++ ) { + for ( let i = 0, l = this.points.length; i < l; i ++ ) { - points.push( this.getPointAt( d / divisions ) ); + const point = this.points[ i ]; + data.points.push( point.toArray() ); } - return points; + return data; - }, + } - // Get total curve arc length + fromJSON( json ) { - getLength: function () { + super.fromJSON( json ); - var lengths = this.getLengths(); - return lengths[ lengths.length - 1 ]; + this.points = []; - }, + for ( let i = 0, l = json.points.length; i < l; i ++ ) { - // Get list of cumulative segment lengths + const point = json.points[ i ]; + this.points.push( new Vector2().fromArray( point ) ); - getLengths: function ( divisions ) { + } - if ( divisions === undefined ) divisions = this.arcLengthDivisions; + return this; - if ( this.cacheArcLengths && - ( this.cacheArcLengths.length === divisions + 1 ) && - ! this.needsUpdate ) { + } - return this.cacheArcLengths; - - } - - this.needsUpdate = false; + } - var cache = []; - var current, last = this.getPoint( 0 ); - var p, sum = 0; + var Curves = /*#__PURE__*/Object.freeze({ + __proto__: null, + ArcCurve: ArcCurve, + CatmullRomCurve3: CatmullRomCurve3, + CubicBezierCurve: CubicBezierCurve, + CubicBezierCurve3: CubicBezierCurve3, + EllipseCurve: EllipseCurve, + LineCurve: LineCurve, + LineCurve3: LineCurve3, + QuadraticBezierCurve: QuadraticBezierCurve, + QuadraticBezierCurve3: QuadraticBezierCurve3, + SplineCurve: SplineCurve + }); - cache.push( 0 ); + /************************************************************** + * Curved Path - a curve path is simply a array of connected + * curves, but retains the api of a curve + **************************************************************/ - for ( p = 1; p <= divisions; p ++ ) { + class CurvePath extends Curve { - current = this.getPoint( p / divisions ); - sum += current.distanceTo( last ); - cache.push( sum ); - last = current; + constructor() { - } + super(); - this.cacheArcLengths = cache; + this.type = 'CurvePath'; - return cache; // { sums: cache, sum: sum }; Sum is in the last element. + this.curves = []; + this.autoClose = false; // Automatically closes the path - }, + } - updateArcLengths: function () { + add( curve ) { - this.needsUpdate = true; - this.getLengths(); + this.curves.push( curve ); - }, + } - // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant + closePath() { - getUtoTmapping: function ( u, distance ) { + // Add a line curve if start and end of lines are not connected + const startPoint = this.curves[ 0 ].getPoint( 0 ); + const endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 ); - var arcLengths = this.getLengths(); + if ( ! startPoint.equals( endPoint ) ) { - var i = 0, il = arcLengths.length; + this.curves.push( new LineCurve( endPoint, startPoint ) ); - var targetArcLength; // The targeted u distance value to get + } - if ( distance ) { + } - targetArcLength = distance; + // To get accurate point with reference to + // entire path distance at time t, + // following has to be done: - } else { + // 1. Length of each sub path have to be known + // 2. Locate and identify type of curve + // 3. Get t for the curve + // 4. Return curve.getPointAt(t') - targetArcLength = u * arcLengths[ il - 1 ]; + getPoint( t, optionalTarget ) { - } + const d = t * this.getLength(); + const curveLengths = this.getCurveLengths(); + let i = 0; - // binary search for the index with largest value smaller than target u distance + // To think about boundaries points. - var low = 0, high = il - 1, comparison; + while ( i < curveLengths.length ) { - while ( low <= high ) { + if ( curveLengths[ i ] >= d ) { - i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats + const diff = curveLengths[ i ] - d; + const curve = this.curves[ i ]; - comparison = arcLengths[ i ] - targetArcLength; + const segmentLength = curve.getLength(); + const u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; - if ( comparison < 0 ) { + return curve.getPointAt( u, optionalTarget ); - low = i + 1; + } - } else if ( comparison > 0 ) { + i ++; - high = i - 1; + } - } else { + return null; - high = i; - break; + // loop where sum != 0, sum > d , sum+1 1 ) t2 = 1; + return lengths; - var pt1 = this.getPoint( t1 ); - var pt2 = this.getPoint( t2 ); + } - var vec = pt2.clone().sub( pt1 ); - return vec.normalize(); + getSpacedPoints( divisions = 40 ) { - }, + const points = []; - getTangentAt: function ( u ) { + for ( let i = 0; i <= divisions; i ++ ) { - var t = this.getUtoTmapping( u ); - return this.getTangent( t ); + points.push( this.getPoint( i / divisions ) ); - }, + } - computeFrenetFrames: function ( segments, closed ) { + if ( this.autoClose ) { - // see http://www.cs.indiana.edu/pub/techreports/TR425.pdf + points.push( points[ 0 ] ); - var normal = new Vector3(); + } - var tangents = []; - var normals = []; - var binormals = []; + return points; - var vec = new Vector3(); - var mat = new Matrix4(); + } - var i, u, theta; + getPoints( divisions = 12 ) { - // compute the tangent vectors for each segment on the curve + const points = []; + let last; - for ( i = 0; i <= segments; i ++ ) { + for ( let i = 0, curves = this.curves; i < curves.length; i ++ ) { - u = i / segments; + const curve = curves[ i ]; + const resolution = curve.isEllipseCurve ? divisions * 2 + : ( curve.isLineCurve || curve.isLineCurve3 ) ? 1 + : curve.isSplineCurve ? divisions * curve.points.length + : divisions; - tangents[ i ] = this.getTangentAt( u ); - tangents[ i ].normalize(); + const pts = curve.getPoints( resolution ); - } + for ( let j = 0; j < pts.length; j ++ ) { - // select an initial normal vector perpendicular to the first tangent vector, - // and in the direction of the minimum tangent xyz component + const point = pts[ j ]; - normals[ 0 ] = new Vector3(); - binormals[ 0 ] = new Vector3(); - var min = Number.MAX_VALUE; - var tx = Math.abs( tangents[ 0 ].x ); - var ty = Math.abs( tangents[ 0 ].y ); - var tz = Math.abs( tangents[ 0 ].z ); + if ( last && last.equals( point ) ) continue; // ensures no consecutive points are duplicates - if ( tx <= min ) { + points.push( point ); + last = point; - min = tx; - normal.set( 1, 0, 0 ); + } } - if ( ty <= min ) { + if ( this.autoClose && points.length > 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) { - min = ty; - normal.set( 0, 1, 0 ); + points.push( points[ 0 ] ); } - if ( tz <= min ) { + return points; - normal.set( 0, 0, 1 ); + } - } + copy( source ) { - vec.crossVectors( tangents[ 0 ], normal ).normalize(); + super.copy( source ); - normals[ 0 ].crossVectors( tangents[ 0 ], vec ); - binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ); + this.curves = []; + for ( let i = 0, l = source.curves.length; i < l; i ++ ) { - // compute the slowly-varying normal and binormal vectors for each segment on the curve + const curve = source.curves[ i ]; - for ( i = 1; i <= segments; i ++ ) { + this.curves.push( curve.clone() ); - normals[ i ] = normals[ i - 1 ].clone(); + } - binormals[ i ] = binormals[ i - 1 ].clone(); + this.autoClose = source.autoClose; - vec.crossVectors( tangents[ i - 1 ], tangents[ i ] ); + return this; - if ( vec.length() > Number.EPSILON ) { + } - vec.normalize(); + toJSON() { - theta = Math.acos( _Math.clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors + const data = super.toJSON(); - normals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) ); + data.autoClose = this.autoClose; + data.curves = []; - } + for ( let i = 0, l = this.curves.length; i < l; i ++ ) { - binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + const curve = this.curves[ i ]; + data.curves.push( curve.toJSON() ); } - // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same - - if ( closed === true ) { - - theta = Math.acos( _Math.clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) ); - theta /= segments; + return data; - if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) { + } - theta = - theta; + fromJSON( json ) { - } + super.fromJSON( json ); - for ( i = 1; i <= segments; i ++ ) { + this.autoClose = json.autoClose; + this.curves = []; - // twist a little... - normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) ); - binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + for ( let i = 0, l = json.curves.length; i < l; i ++ ) { - } + const curve = json.curves[ i ]; + this.curves.push( new Curves[ curve.type ]().fromJSON( curve ) ); } - return { - tangents: tangents, - normals: normals, - binormals: binormals - }; + return this; } - } ); - - function LineCurve( v1, v2 ) { + } - Curve.call( this ); + class Path extends CurvePath { - this.v1 = v1; - this.v2 = v2; + constructor( points ) { - } + super(); - LineCurve.prototype = Object.create( Curve.prototype ); - LineCurve.prototype.constructor = LineCurve; + this.type = 'Path'; - LineCurve.prototype.isLineCurve = true; + this.currentPoint = new Vector2(); - LineCurve.prototype.getPoint = function ( t ) { + if ( points ) { - if ( t === 1 ) { + this.setFromPoints( points ); - return this.v2.clone(); + } } - var point = this.v2.clone().sub( this.v1 ); - point.multiplyScalar( t ).add( this.v1 ); + setFromPoints( points ) { - return point; + this.moveTo( points[ 0 ].x, points[ 0 ].y ); - }; + for ( let i = 1, l = points.length; i < l; i ++ ) { - // Line curve is linear, so we can overwrite default getPointAt + this.lineTo( points[ i ].x, points[ i ].y ); - LineCurve.prototype.getPointAt = function ( u ) { + } - return this.getPoint( u ); + return this; - }; + } - LineCurve.prototype.getTangent = function ( t ) { + moveTo( x, y ) { - var tangent = this.v2.clone().sub( this.v1 ); + this.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying? - return tangent.normalize(); + return this; - }; + } - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - **/ + lineTo( x, y ) { - /************************************************************** - * Curved Path - a curve path is simply a array of connected - * curves, but retains the api of a curve - **************************************************************/ + const curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) ); + this.curves.push( curve ); - function CurvePath() { + this.currentPoint.set( x, y ); - Curve.call( this ); + return this; - this.curves = []; + } - this.autoClose = false; // Automatically closes the path + quadraticCurveTo( aCPx, aCPy, aX, aY ) { - } + const curve = new QuadraticBezierCurve( + this.currentPoint.clone(), + new Vector2( aCPx, aCPy ), + new Vector2( aX, aY ) + ); - CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), { + this.curves.push( curve ); - constructor: CurvePath, + this.currentPoint.set( aX, aY ); - add: function ( curve ) { + return this; - this.curves.push( curve ); + } - }, + bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { - closePath: function () { + const curve = new CubicBezierCurve( + this.currentPoint.clone(), + new Vector2( aCP1x, aCP1y ), + new Vector2( aCP2x, aCP2y ), + new Vector2( aX, aY ) + ); - // Add a line curve if start and end of lines are not connected - var startPoint = this.curves[ 0 ].getPoint( 0 ); - var endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 ); + this.curves.push( curve ); - if ( ! startPoint.equals( endPoint ) ) { + this.currentPoint.set( aX, aY ); - this.curves.push( new LineCurve( endPoint, startPoint ) ); + return this; - } + } - }, + splineThru( pts /*Array of Vector*/ ) { - // To get accurate point with reference to - // entire path distance at time t, - // following has to be done: + const npts = [ this.currentPoint.clone() ].concat( pts ); - // 1. Length of each sub path have to be known - // 2. Locate and identify type of curve - // 3. Get t for the curve - // 4. Return curve.getPointAt(t') + const curve = new SplineCurve( npts ); + this.curves.push( curve ); - getPoint: function ( t ) { + this.currentPoint.copy( pts[ pts.length - 1 ] ); - var d = t * this.getLength(); - var curveLengths = this.getCurveLengths(); - var i = 0; + return this; - // To think about boundaries points. + } - while ( i < curveLengths.length ) { + arc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - if ( curveLengths[ i ] >= d ) { + const x0 = this.currentPoint.x; + const y0 = this.currentPoint.y; - var diff = curveLengths[ i ] - d; - var curve = this.curves[ i ]; + this.absarc( aX + x0, aY + y0, aRadius, + aStartAngle, aEndAngle, aClockwise ); - var segmentLength = curve.getLength(); - var u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; + return this; - return curve.getPointAt( u ); + } - } + absarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - i ++; + this.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); - } + return this; - return null; + } - // loop where sum != 0, sum > d , sum+1 0 ) { - }, + // if a previous curve is present, attempt to join + const firstPoint = curve.getPoint( 0 ); - // Compute lengths and cache them - // We cannot overwrite getLengths() because UtoT mapping uses it. + if ( ! firstPoint.equals( this.currentPoint ) ) { - getCurveLengths: function () { + this.lineTo( firstPoint.x, firstPoint.y ); - // We use cache values if curves and cache array are same length + } - if ( this.cacheLengths && this.cacheLengths.length === this.curves.length ) { + } - return this.cacheLengths; + this.curves.push( curve ); - } + const lastPoint = curve.getPoint( 1 ); + this.currentPoint.copy( lastPoint ); - // Get length of sub-curve - // Push sums into cached array + return this; - var lengths = [], sums = 0; + } - for ( var i = 0, l = this.curves.length; i < l; i ++ ) { + copy( source ) { - sums += this.curves[ i ].getLength(); - lengths.push( sums ); + super.copy( source ); - } + this.currentPoint.copy( source.currentPoint ); - this.cacheLengths = lengths; + return this; - return lengths; + } - }, + toJSON() { - getSpacedPoints: function ( divisions ) { + const data = super.toJSON(); - if ( divisions === undefined ) divisions = 40; + data.currentPoint = this.currentPoint.toArray(); - var points = []; + return data; - for ( var i = 0; i <= divisions; i ++ ) { + } - points.push( this.getPoint( i / divisions ) ); + fromJSON( json ) { - } + super.fromJSON( json ); - if ( this.autoClose ) { + this.currentPoint.fromArray( json.currentPoint ); - points.push( points[ 0 ] ); + return this; - } + } - return points; + } - }, + class LatheGeometry extends BufferGeometry { - getPoints: function ( divisions ) { + constructor( points = [ new Vector2( 0, - 0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) { - divisions = divisions || 12; + super(); - var points = [], last; + this.type = 'LatheGeometry'; - for ( var i = 0, curves = this.curves; i < curves.length; i ++ ) { + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; - var curve = curves[ i ]; - var resolution = (curve && curve.isEllipseCurve) ? divisions * 2 - : (curve && curve.isLineCurve) ? 1 - : (curve && curve.isSplineCurve) ? divisions * curve.points.length - : divisions; + segments = Math.floor( segments ); - var pts = curve.getPoints( resolution ); + // clamp phiLength so it's in range of [ 0, 2PI ] - for ( var j = 0; j < pts.length; j++ ) { + phiLength = clamp( phiLength, 0, Math.PI * 2 ); - var point = pts[ j ]; + // buffers - if ( last && last.equals( point ) ) continue; // ensures no consecutive points are duplicates + const indices = []; + const vertices = []; + const uvs = []; + const initNormals = []; + const normals = []; - points.push( point ); - last = point; + // helper variables - } + const inverseSegments = 1.0 / segments; + const vertex = new Vector3(); + const uv = new Vector2(); + const normal = new Vector3(); + const curNormal = new Vector3(); + const prevNormal = new Vector3(); + let dx = 0; + let dy = 0; - } + // pre-compute normals for initial "meridian" - if ( this.autoClose && points.length > 1 && !points[ points.length - 1 ].equals( points[ 0 ] ) ) { + for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { - points.push( points[ 0 ] ); + switch ( j ) { - } + case 0: // special handling for 1st vertex on path - return points; + dx = points[ j + 1 ].x - points[ j ].x; + dy = points[ j + 1 ].y - points[ j ].y; - }, + normal.x = dy * 1.0; + normal.y = - dx; + normal.z = dy * 0.0; - /************************************************************** - * Create Geometries Helpers - **************************************************************/ + prevNormal.copy( normal ); - /// Generate geometry from path points (for Line or Points objects) + normal.normalize(); - createPointsGeometry: function ( divisions ) { + initNormals.push( normal.x, normal.y, normal.z ); - var pts = this.getPoints( divisions ); - return this.createGeometry( pts ); + break; - }, + case ( points.length - 1 ): // special handling for last Vertex on path - // Generate geometry from equidistant sampling along the path + initNormals.push( prevNormal.x, prevNormal.y, prevNormal.z ); - createSpacedPointsGeometry: function ( divisions ) { + break; - var pts = this.getSpacedPoints( divisions ); - return this.createGeometry( pts ); + default: // default handling for all vertices in between - }, + dx = points[ j + 1 ].x - points[ j ].x; + dy = points[ j + 1 ].y - points[ j ].y; - createGeometry: function ( points ) { + normal.x = dy * 1.0; + normal.y = - dx; + normal.z = dy * 0.0; - var geometry = new Geometry(); + curNormal.copy( normal ); - for ( var i = 0, l = points.length; i < l; i ++ ) { + normal.x += prevNormal.x; + normal.y += prevNormal.y; + normal.z += prevNormal.z; - var point = points[ i ]; - geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); + normal.normalize(); + + initNormals.push( normal.x, normal.y, normal.z ); + + prevNormal.copy( curNormal ); + + } } - return geometry; + // generate vertices, uvs and normals - } + for ( let i = 0; i <= segments; i ++ ) { - } ); + const phi = phiStart + i * inverseSegments * phiLength; - function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + const sin = Math.sin( phi ); + const cos = Math.cos( phi ); - Curve.call( this ); + for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { + + // vertex - this.aX = aX; - this.aY = aY; + vertex.x = points[ j ].x * sin; + vertex.y = points[ j ].y; + vertex.z = points[ j ].x * cos; - this.xRadius = xRadius; - this.yRadius = yRadius; + vertices.push( vertex.x, vertex.y, vertex.z ); - this.aStartAngle = aStartAngle; - this.aEndAngle = aEndAngle; + // uv - this.aClockwise = aClockwise; + uv.x = i / segments; + uv.y = j / ( points.length - 1 ); - this.aRotation = aRotation || 0; + uvs.push( uv.x, uv.y ); - } + // normal + + const x = initNormals[ 3 * j + 0 ] * sin; + const y = initNormals[ 3 * j + 1 ]; + const z = initNormals[ 3 * j + 0 ] * cos; - EllipseCurve.prototype = Object.create( Curve.prototype ); - EllipseCurve.prototype.constructor = EllipseCurve; + normals.push( x, y, z ); + + } - EllipseCurve.prototype.isEllipseCurve = true; + } - EllipseCurve.prototype.getPoint = function ( t ) { + // indices - var twoPi = Math.PI * 2; - var deltaAngle = this.aEndAngle - this.aStartAngle; - var samePoints = Math.abs( deltaAngle ) < Number.EPSILON; + for ( let i = 0; i < segments; i ++ ) { - // ensures that deltaAngle is 0 .. 2 PI - while ( deltaAngle < 0 ) deltaAngle += twoPi; - while ( deltaAngle > twoPi ) deltaAngle -= twoPi; + for ( let j = 0; j < ( points.length - 1 ); j ++ ) { - if ( deltaAngle < Number.EPSILON ) { + const base = j + i * points.length; - if ( samePoints ) { + const a = base; + const b = base + points.length; + const c = base + points.length + 1; + const d = base + 1; - deltaAngle = 0; + // faces - } else { + indices.push( a, b, d ); + indices.push( c, d, b ); - deltaAngle = twoPi; + } } + // build geometry + + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + } - if ( this.aClockwise === true && ! samePoints ) { + copy( source ) { - if ( deltaAngle === twoPi ) { + super.copy( source ); - deltaAngle = - twoPi; + this.parameters = Object.assign( {}, source.parameters ); - } else { + return this; - deltaAngle = deltaAngle - twoPi; + } - } + static fromJSON( data ) { + + return new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength ); } - var angle = this.aStartAngle + t * deltaAngle; - var x = this.aX + this.xRadius * Math.cos( angle ); - var y = this.aY + this.yRadius * Math.sin( angle ); + } - if ( this.aRotation !== 0 ) { + class CapsuleGeometry extends LatheGeometry { - var cos = Math.cos( this.aRotation ); - var sin = Math.sin( this.aRotation ); + constructor( radius = 1, length = 1, capSegments = 4, radialSegments = 8 ) { - var tx = x - this.aX; - var ty = y - this.aY; + const path = new Path(); + path.absarc( 0, - length / 2, radius, Math.PI * 1.5, 0 ); + path.absarc( 0, length / 2, radius, 0, Math.PI * 0.5 ); - // Rotate the point about the center of the ellipse. - x = tx * cos - ty * sin + this.aX; - y = tx * sin + ty * cos + this.aY; + super( path.getPoints( capSegments ), radialSegments ); - } + this.type = 'CapsuleGeometry'; - return new Vector2( x, y ); + this.parameters = { + radius: radius, + height: length, + capSegments: capSegments, + radialSegments: radialSegments, + }; - }; + } - function SplineCurve( points /* array of Vector2 */ ) { + static fromJSON( data ) { - Curve.call( this ); + return new CapsuleGeometry( data.radius, data.length, data.capSegments, data.radialSegments ); - this.points = ( points === undefined ) ? [] : points; + } } - SplineCurve.prototype = Object.create( Curve.prototype ); - SplineCurve.prototype.constructor = SplineCurve; + class CircleGeometry extends BufferGeometry { - SplineCurve.prototype.isSplineCurve = true; + constructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) { - SplineCurve.prototype.getPoint = function ( t ) { + super(); - var points = this.points; - var point = ( points.length - 1 ) * t; + this.type = 'CircleGeometry'; - var intPoint = Math.floor( point ); - var weight = point - intPoint; + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - var point0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ]; - var point1 = points[ intPoint ]; - var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; - var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; + segments = Math.max( 3, segments ); - return new Vector2( - CatmullRom( weight, point0.x, point1.x, point2.x, point3.x ), - CatmullRom( weight, point0.y, point1.y, point2.y, point3.y ) - ); + // buffers - }; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - function CubicBezierCurve( v0, v1, v2, v3 ) { + // helper variables - Curve.call( this ); + const vertex = new Vector3(); + const uv = new Vector2(); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; + // center point - } + vertices.push( 0, 0, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( 0.5, 0.5 ); - CubicBezierCurve.prototype = Object.create( Curve.prototype ); - CubicBezierCurve.prototype.constructor = CubicBezierCurve; + for ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) { - CubicBezierCurve.prototype.getPoint = function ( t ) { + const segment = thetaStart + s / segments * thetaLength; - var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + // vertex - return new Vector2( - CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), - CubicBezier( t, v0.y, v1.y, v2.y, v3.y ) - ); + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - }; + vertices.push( vertex.x, vertex.y, vertex.z ); - function QuadraticBezierCurve( v0, v1, v2 ) { + // normal - Curve.call( this ); + normals.push( 0, 0, 1 ); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; + // uvs - } + uv.x = ( vertices[ i ] / radius + 1 ) / 2; + uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; - QuadraticBezierCurve.prototype = Object.create( Curve.prototype ); - QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve; + uvs.push( uv.x, uv.y ); - QuadraticBezierCurve.prototype.getPoint = function ( t ) { + } - var v0 = this.v0, v1 = this.v1, v2 = this.v2; + // indices - return new Vector2( - QuadraticBezier( t, v0.x, v1.x, v2.x ), - QuadraticBezier( t, v0.y, v1.y, v2.y ) - ); + for ( let i = 1; i <= segments; i ++ ) { - }; + indices.push( i, i + 1, 0 ); - var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), { + } - fromPoints: function ( vectors ) { + // build geometry - this.moveTo( vectors[ 0 ].x, vectors[ 0 ].y ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - for ( var i = 1, l = vectors.length; i < l; i ++ ) { + } - this.lineTo( vectors[ i ].x, vectors[ i ].y ); + copy( source ) { - } + super.copy( source ); - }, + this.parameters = Object.assign( {}, source.parameters ); - moveTo: function ( x, y ) { + return this; - this.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying? + } - }, + static fromJSON( data ) { - lineTo: function ( x, y ) { + return new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength ); - var curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) ); - this.curves.push( curve ); + } - this.currentPoint.set( x, y ); + } - }, + class CylinderGeometry extends BufferGeometry { - quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { + constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) { - var curve = new QuadraticBezierCurve( - this.currentPoint.clone(), - new Vector2( aCPx, aCPy ), - new Vector2( aX, aY ) - ); + super(); - this.curves.push( curve ); + this.type = 'CylinderGeometry'; - this.currentPoint.set( aX, aY ); + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - }, + const scope = this; - bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + radialSegments = Math.floor( radialSegments ); + heightSegments = Math.floor( heightSegments ); - var curve = new CubicBezierCurve( - this.currentPoint.clone(), - new Vector2( aCP1x, aCP1y ), - new Vector2( aCP2x, aCP2y ), - new Vector2( aX, aY ) - ); + // buffers - this.curves.push( curve ); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - this.currentPoint.set( aX, aY ); + // helper variables - }, + let index = 0; + const indexArray = []; + const halfHeight = height / 2; + let groupStart = 0; - splineThru: function ( pts /*Array of Vector*/ ) { + // generate geometry - var npts = [ this.currentPoint.clone() ].concat( pts ); + generateTorso(); - var curve = new SplineCurve( npts ); - this.curves.push( curve ); + if ( openEnded === false ) { - this.currentPoint.copy( pts[ pts.length - 1 ] ); + if ( radiusTop > 0 ) generateCap( true ); + if ( radiusBottom > 0 ) generateCap( false ); - }, + } - arc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + // build geometry - var x0 = this.currentPoint.x; - var y0 = this.currentPoint.y; + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.absarc( aX + x0, aY + y0, aRadius, - aStartAngle, aEndAngle, aClockwise ); + function generateTorso() { - }, + const normal = new Vector3(); + const vertex = new Vector3(); - absarc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + let groupCount = 0; - this.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + // this will be used to calculate the normal + const slope = ( radiusBottom - radiusTop ) / height; - }, + // generate vertices, normals and uvs - ellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + for ( let y = 0; y <= heightSegments; y ++ ) { - var x0 = this.currentPoint.x; - var y0 = this.currentPoint.y; + const indexRow = []; - this.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + const v = y / heightSegments; - }, + // calculate the radius of the current row - absellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + const radius = v * ( radiusBottom - radiusTop ) + radiusTop; - var curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + for ( let x = 0; x <= radialSegments; x ++ ) { - if ( this.curves.length > 0 ) { + const u = x / radialSegments; - // if a previous curve is present, attempt to join - var firstPoint = curve.getPoint( 0 ); + const theta = u * thetaLength + thetaStart; - if ( ! firstPoint.equals( this.currentPoint ) ) { + const sinTheta = Math.sin( theta ); + const cosTheta = Math.cos( theta ); - this.lineTo( firstPoint.x, firstPoint.y ); + // vertex - } + vertex.x = radius * sinTheta; + vertex.y = - v * height + halfHeight; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - } + // normal - this.curves.push( curve ); + normal.set( sinTheta, slope, cosTheta ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - var lastPoint = curve.getPoint( 1 ); - this.currentPoint.copy( lastPoint ); + // uv - } + uvs.push( u, 1 - v ); - } ); + // save index of vertex in respective row - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Creates free form 2d path using series of points, lines or curves. - **/ + indexRow.push( index ++ ); - function Path( points ) { + } - CurvePath.call( this ); - this.currentPoint = new Vector2(); + // now save vertices of the row in our index array - if ( points ) { + indexArray.push( indexRow ); - this.fromPoints( points ); + } - } + // generate indices - } + for ( let x = 0; x < radialSegments; x ++ ) { - Path.prototype = PathPrototype; - PathPrototype.constructor = Path; + for ( let y = 0; y < heightSegments; y ++ ) { - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Defines a 2d shape plane using paths. - **/ + // we use the index array to access the correct indices - // STEP 1 Create a path. - // STEP 2 Turn path into shape. - // STEP 3 ExtrudeGeometry takes in Shape/Shapes - // STEP 3a - Extract points from each shape, turn to vertices - // STEP 3b - Triangulate each shape, add faces. + const a = indexArray[ y ][ x ]; + const b = indexArray[ y + 1 ][ x ]; + const c = indexArray[ y + 1 ][ x + 1 ]; + const d = indexArray[ y ][ x + 1 ]; - function Shape() { + // faces - Path.apply( this, arguments ); + indices.push( a, b, d ); + indices.push( b, c, d ); - this.holes = []; + // update group counter - } + groupCount += 6; - Shape.prototype = Object.assign( Object.create( PathPrototype ), { + } - constructor: Shape, + } - getPointsHoles: function ( divisions ) { + // add a group to the geometry. this will ensure multi material support - var holesPts = []; + scope.addGroup( groupStart, groupCount, 0 ); - for ( var i = 0, l = this.holes.length; i < l; i ++ ) { + // calculate new start value for groups - holesPts[ i ] = this.holes[ i ].getPoints( divisions ); + groupStart += groupCount; } - return holesPts; + function generateCap( top ) { - }, + // save the index of the first center vertex + const centerIndexStart = index; - // Get points of shape and holes (keypoints based on segments parameter) + const uv = new Vector2(); + const vertex = new Vector3(); - extractAllPoints: function ( divisions ) { + let groupCount = 0; - return { + const radius = ( top === true ) ? radiusTop : radiusBottom; + const sign = ( top === true ) ? 1 : - 1; - shape: this.getPoints( divisions ), - holes: this.getPointsHoles( divisions ) + // first we generate the center vertex data of the cap. + // because the geometry needs one set of uvs per face, + // we must generate a center vertex per face/segment - }; + for ( let x = 1; x <= radialSegments; x ++ ) { - }, + // vertex - extractPoints: function ( divisions ) { + vertices.push( 0, halfHeight * sign, 0 ); - return this.extractAllPoints( divisions ); + // normal - } + normals.push( 0, sign, 0 ); - } ); + // uv - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * minimal class for proxing functions to Path. Replaces old "extractSubpaths()" - **/ + uvs.push( 0.5, 0.5 ); - function ShapePath() { + // increase index - this.subPaths = []; - this.currentPath = null; + index ++; - } + } - Object.assign( ShapePath.prototype, { + // save the index of the last center vertex + const centerIndexEnd = index; - moveTo: function ( x, y ) { + // now we generate the surrounding vertices, normals and uvs - this.currentPath = new Path(); - this.subPaths.push( this.currentPath ); - this.currentPath.moveTo( x, y ); + for ( let x = 0; x <= radialSegments; x ++ ) { - }, + const u = x / radialSegments; + const theta = u * thetaLength + thetaStart; - lineTo: function ( x, y ) { + const cosTheta = Math.cos( theta ); + const sinTheta = Math.sin( theta ); - this.currentPath.lineTo( x, y ); + // vertex - }, + vertex.x = radius * sinTheta; + vertex.y = halfHeight * sign; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { + // normal - this.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY ); + normals.push( 0, sign, 0 ); - }, + // uv - bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + uv.x = ( cosTheta * 0.5 ) + 0.5; + uv.y = ( sinTheta * 0.5 * sign ) + 0.5; + uvs.push( uv.x, uv.y ); - this.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ); + // increase index - }, + index ++; - splineThru: function ( pts ) { + } - this.currentPath.splineThru( pts ); + // generate indices - }, + for ( let x = 0; x < radialSegments; x ++ ) { - toShapes: function ( isCCW, noHoles ) { + const c = centerIndexStart + x; + const i = centerIndexEnd + x; - function toShapesNoHoles( inSubpaths ) { + if ( top === true ) { - var shapes = []; + // face top - for ( var i = 0, l = inSubpaths.length; i < l; i ++ ) { + indices.push( i, i + 1, c ); - var tmpPath = inSubpaths[ i ]; + } else { - var tmpShape = new Shape(); - tmpShape.curves = tmpPath.curves; + // face bottom - shapes.push( tmpShape ); + indices.push( i + 1, i, c ); + + } + + groupCount += 3; } - return shapes; + // add a group to the geometry. this will ensure multi material support + + scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + + // calculate new start value for groups + + groupStart += groupCount; } - function isPointInsidePolygon( inPt, inPolygon ) { + } - var polyLen = inPolygon.length; + copy( source ) { - // inPt on polygon contour => immediate success or - // toggling of inside/outside at every single! intersection point of an edge - // with the horizontal line through inPt, left of inPt - // not counting lowerY endpoints of edges and whole edges on that line - var inside = false; - for ( var p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) { + super.copy( source ); - var edgeLowPt = inPolygon[ p ]; - var edgeHighPt = inPolygon[ q ]; + this.parameters = Object.assign( {}, source.parameters ); - var edgeDx = edgeHighPt.x - edgeLowPt.x; - var edgeDy = edgeHighPt.y - edgeLowPt.y; + return this; - if ( Math.abs( edgeDy ) > Number.EPSILON ) { + } - // not parallel - if ( edgeDy < 0 ) { + static fromJSON( data ) { - edgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx; - edgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy; + return new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength ); - } - if ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) continue; + } - if ( inPt.y === edgeLowPt.y ) { + } - if ( inPt.x === edgeLowPt.x ) return true; // inPt is on contour ? - // continue; // no intersection or edgeLowPt => doesn't count !!! + class ConeGeometry extends CylinderGeometry { - } else { + constructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) { - var perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y ); - if ( perpEdge === 0 ) return true; // inPt is on contour ? - if ( perpEdge < 0 ) continue; - inside = ! inside; // true intersection left of inPt + super( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - } + this.type = 'ConeGeometry'; - } else { + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - // parallel or collinear - if ( inPt.y !== edgeLowPt.y ) continue; // parallel - // edge lies on the same horizontal line as inPt - if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) || - ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour ! - // continue; - - } + } - } + static fromJSON( data ) { - return inside; + return new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength ); - } + } - var isClockWise = ShapeUtils.isClockWise; + } - var subPaths = this.subPaths; - if ( subPaths.length === 0 ) return []; + class PolyhedronGeometry extends BufferGeometry { - if ( noHoles === true ) return toShapesNoHoles( subPaths ); + constructor( vertices = [], indices = [], radius = 1, detail = 0 ) { + super(); - var solid, tmpPath, tmpShape, shapes = []; + this.type = 'PolyhedronGeometry'; - if ( subPaths.length === 1 ) { + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; - tmpPath = subPaths[ 0 ]; - tmpShape = new Shape(); - tmpShape.curves = tmpPath.curves; - shapes.push( tmpShape ); - return shapes; + // default buffer data - } + const vertexBuffer = []; + const uvBuffer = []; - var holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() ); - holesFirst = isCCW ? ! holesFirst : holesFirst; + // the subdivision creates the vertex buffer data - // console.log("Holes first", holesFirst); + subdivide( detail ); - var betterShapeHoles = []; - var newShapes = []; - var newShapeHoles = []; - var mainIdx = 0; - var tmpPoints; + // all vertices should lie on a conceptual sphere with a given radius - newShapes[ mainIdx ] = undefined; - newShapeHoles[ mainIdx ] = []; + applyRadius( radius ); - for ( var i = 0, l = subPaths.length; i < l; i ++ ) { + // finally, create the uv data - tmpPath = subPaths[ i ]; - tmpPoints = tmpPath.getPoints(); - solid = isClockWise( tmpPoints ); - solid = isCCW ? ! solid : solid; + generateUVs(); - if ( solid ) { + // build non-indexed geometry - if ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) ) mainIdx ++; + this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); - newShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints }; - newShapes[ mainIdx ].s.curves = tmpPath.curves; + if ( detail === 0 ) { - if ( holesFirst ) mainIdx ++; - newShapeHoles[ mainIdx ] = []; + this.computeVertexNormals(); // flat normals - //console.log('cw', i); + } else { - } else { + this.normalizeNormals(); // smooth normals - newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } ); + } - //console.log('ccw', i); + // helper functions - } + function subdivide( detail ) { - } + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); - // only Holes? -> probably all Shapes with wrong orientation - if ( ! newShapes[ 0 ] ) return toShapesNoHoles( subPaths ); + // iterate over all faces and apply a subdivision with the given detail value + for ( let i = 0; i < indices.length; i += 3 ) { - if ( newShapes.length > 1 ) { + // get the vertices of the face - var ambiguous = false; - var toChange = []; + getVertexByIndex( indices[ i + 0 ], a ); + getVertexByIndex( indices[ i + 1 ], b ); + getVertexByIndex( indices[ i + 2 ], c ); - for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + // perform subdivision - betterShapeHoles[ sIdx ] = []; + subdivideFace( a, b, c, detail ); } - for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + } + + function subdivideFace( a, b, c, detail ) { - var sho = newShapeHoles[ sIdx ]; + const cols = detail + 1; - for ( var hIdx = 0; hIdx < sho.length; hIdx ++ ) { + // we use this multidimensional array as a data structure for creating the subdivision - var ho = sho[ hIdx ]; - var hole_unassigned = true; + const v = []; - for ( var s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) { + // construct all of the vertices for this subdivision - if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) { + for ( let i = 0; i <= cols; i ++ ) { - if ( sIdx !== s2Idx ) toChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } ); - if ( hole_unassigned ) { + v[ i ] = []; - hole_unassigned = false; - betterShapeHoles[ s2Idx ].push( ho ); + const aj = a.clone().lerp( c, i / cols ); + const bj = b.clone().lerp( c, i / cols ); - } else { + const rows = cols - i; - ambiguous = true; + for ( let j = 0; j <= rows; j ++ ) { - } + if ( j === 0 && i === cols ) { - } + v[ i ][ j ] = aj; - } - if ( hole_unassigned ) { + } else { - betterShapeHoles[ sIdx ].push( ho ); + v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); } } } - // console.log("ambiguous: ", ambiguous); - if ( toChange.length > 0 ) { - // console.log("to change: ", toChange); - if ( ! ambiguous ) newShapeHoles = betterShapeHoles; + // construct all of the faces - } + for ( let i = 0; i < cols; i ++ ) { - } + for ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { - var tmpHoles; + const k = Math.floor( j / 2 ); - for ( var i = 0, il = newShapes.length; i < il; i ++ ) { + if ( j % 2 === 0 ) { - tmpShape = newShapes[ i ].s; - shapes.push( tmpShape ); - tmpHoles = newShapeHoles[ i ]; + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + pushVertex( v[ i ][ k ] ); - for ( var j = 0, jl = tmpHoles.length; j < jl; j ++ ) { + } else { - tmpShape.holes.push( tmpHoles[ j ].h ); + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + + } + + } } } - //console.log("shape", shapes); + function applyRadius( radius ) { - return shapes; + const vertex = new Vector3(); - } + // iterate over the entire buffer and apply the radius to each vertex - } ); + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { - /** - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author mrdoob / http://mrdoob.com/ - */ + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - function Font( data ) { + vertex.normalize().multiplyScalar( radius ); - this.data = data; + vertexBuffer[ i + 0 ] = vertex.x; + vertexBuffer[ i + 1 ] = vertex.y; + vertexBuffer[ i + 2 ] = vertex.z; - } + } + + } - Object.assign( Font.prototype, { + function generateUVs() { - isFont: true, + const vertex = new Vector3(); - generateShapes: function ( text, size, divisions ) { + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { - function createPaths( text ) { + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - var chars = String( text ).split( '' ); - var scale = size / data.resolution; - var line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale; + const u = azimuth( vertex ) / 2 / Math.PI + 0.5; + const v = inclination( vertex ) / Math.PI + 0.5; + uvBuffer.push( u, 1 - v ); - var offsetX = 0, offsetY = 0; + } - var paths = []; + correctUVs(); - for ( var i = 0; i < chars.length; i ++ ) { + correctSeam(); - var char = chars[ i ]; + } - if ( char === '\n' ) { + function correctSeam() { - offsetX = 0; - offsetY -= line_height; + // handle case when face straddles the seam, see #3269 - } else { + for ( let i = 0; i < uvBuffer.length; i += 6 ) { + + // uv data of a single face + + const x0 = uvBuffer[ i + 0 ]; + const x1 = uvBuffer[ i + 2 ]; + const x2 = uvBuffer[ i + 4 ]; + + const max = Math.max( x0, x1, x2 ); + const min = Math.min( x0, x1, x2 ); + + // 0.9 is somewhat arbitrary - var ret = createPath( char, scale, offsetX, offsetY ); - offsetX += ret.offsetX; - paths.push( ret.path ); + if ( max > 0.9 && min < 0.1 ) { + + if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; + if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; + if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; } } - return paths; + } + + function pushVertex( vertex ) { + + vertexBuffer.push( vertex.x, vertex.y, vertex.z ); } - function createPath( c, scale, offsetX, offsetY ) { + function getVertexByIndex( index, vertex ) { - var glyph = data.glyphs[ c ] || data.glyphs[ '?' ]; + const stride = index * 3; - if ( ! glyph ) return; + vertex.x = vertices[ stride + 0 ]; + vertex.y = vertices[ stride + 1 ]; + vertex.z = vertices[ stride + 2 ]; - var path = new ShapePath(); + } - var pts = []; - var x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2, laste; + function correctUVs() { - if ( glyph.o ) { + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); - var outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) ); + const centroid = new Vector3(); - for ( var i = 0, l = outline.length; i < l; ) { + const uvA = new Vector2(); + const uvB = new Vector2(); + const uvC = new Vector2(); - var action = outline[ i ++ ]; + for ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { - switch ( action ) { + a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); + b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); + c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); - case 'm': // moveTo + uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); + uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); + uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); - x = outline[ i ++ ] * scale + offsetX; - y = outline[ i ++ ] * scale + offsetY; + centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); - path.moveTo( x, y ); + const azi = azimuth( centroid ); - break; + correctUV( uvA, j + 0, a, azi ); + correctUV( uvB, j + 2, b, azi ); + correctUV( uvC, j + 4, c, azi ); + + } - case 'l': // lineTo + } - x = outline[ i ++ ] * scale + offsetX; - y = outline[ i ++ ] * scale + offsetY; + function correctUV( uv, stride, vector, azimuth ) { - path.lineTo( x, y ); + if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { - break; + uvBuffer[ stride ] = uv.x - 1; - case 'q': // quadraticCurveTo + } - cpx = outline[ i ++ ] * scale + offsetX; - cpy = outline[ i ++ ] * scale + offsetY; - cpx1 = outline[ i ++ ] * scale + offsetX; - cpy1 = outline[ i ++ ] * scale + offsetY; + if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { - path.quadraticCurveTo( cpx1, cpy1, cpx, cpy ); + uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; - laste = pts[ pts.length - 1 ]; + } - if ( laste ) { + } - cpx0 = laste.x; - cpy0 = laste.y; + // Angle around the Y axis, counter-clockwise when looking from above. - for ( var i2 = 1; i2 <= divisions; i2 ++ ) { + function azimuth( vector ) { - var t = i2 / divisions; - QuadraticBezier( t, cpx0, cpx1, cpx ); - QuadraticBezier( t, cpy0, cpy1, cpy ); + return Math.atan2( vector.z, - vector.x ); - } + } - } - break; + // Angle above the XZ plane. - case 'b': // bezierCurveTo + function inclination( vector ) { - cpx = outline[ i ++ ] * scale + offsetX; - cpy = outline[ i ++ ] * scale + offsetY; - cpx1 = outline[ i ++ ] * scale + offsetX; - cpy1 = outline[ i ++ ] * scale + offsetY; - cpx2 = outline[ i ++ ] * scale + offsetX; - cpy2 = outline[ i ++ ] * scale + offsetY; + return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); - path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy ); + } - laste = pts[ pts.length - 1 ]; + } - if ( laste ) { + copy( source ) { - cpx0 = laste.x; - cpy0 = laste.y; + super.copy( source ); - for ( var i2 = 1; i2 <= divisions; i2 ++ ) { + this.parameters = Object.assign( {}, source.parameters ); - var t = i2 / divisions; - CubicBezier( t, cpx0, cpx1, cpx2, cpx ); - CubicBezier( t, cpy0, cpy1, cpy2, cpy ); + return this; - } + } - } + static fromJSON( data ) { - break; + return new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details ); - } + } - } + } - } + class DodecahedronGeometry extends PolyhedronGeometry { - return { offsetX: glyph.ha * scale, path: path }; + constructor( radius = 1, detail = 0 ) { - } + const t = ( 1 + Math.sqrt( 5 ) ) / 2; + const r = 1 / t; - // + const vertices = [ + + // (±1, ±1, ±1) + - 1, - 1, - 1, - 1, - 1, 1, + - 1, 1, - 1, - 1, 1, 1, + 1, - 1, - 1, 1, - 1, 1, + 1, 1, - 1, 1, 1, 1, - if ( size === undefined ) size = 100; - if ( divisions === undefined ) divisions = 4; + // (0, ±1/φ, ±φ) + 0, - r, - t, 0, - r, t, + 0, r, - t, 0, r, t, - var data = this.data; + // (±1/φ, ±φ, 0) + - r, - t, 0, - r, t, 0, + r, - t, 0, r, t, 0, - var paths = createPaths( text ); - var shapes = []; + // (±φ, 0, ±1/φ) + - t, 0, - r, t, 0, - r, + - t, 0, r, t, 0, r + ]; - for ( var p = 0, pl = paths.length; p < pl; p ++ ) { + const indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; - Array.prototype.push.apply( shapes, paths[ p ].toShapes() ); + super( vertices, indices, radius, detail ); - } + this.type = 'DodecahedronGeometry'; - return shapes; + this.parameters = { + radius: radius, + detail: detail + }; } - } ); - - /** - * @author mrdoob / http://mrdoob.com/ - */ + static fromJSON( data ) { - function FontLoader( manager ) { + return new DodecahedronGeometry( data.radius, data.detail ); - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + } } - Object.assign( FontLoader.prototype, { + const _v0 = /*@__PURE__*/ new Vector3(); + const _v1$1 = /*@__PURE__*/ new Vector3(); + const _normal = /*@__PURE__*/ new Vector3(); + const _triangle = /*@__PURE__*/ new Triangle(); - load: function ( url, onLoad, onProgress, onError ) { + class EdgesGeometry extends BufferGeometry { - var scope = this; + constructor( geometry = null, thresholdAngle = 1 ) { - var loader = new FileLoader( this.manager ); - loader.load( url, function ( text ) { + super(); - var json; + this.type = 'EdgesGeometry'; - try { + this.parameters = { + geometry: geometry, + thresholdAngle: thresholdAngle + }; - json = JSON.parse( text ); + if ( geometry !== null ) { - } catch ( e ) { + const precisionPoints = 4; + const precision = Math.pow( 10, precisionPoints ); + const thresholdDot = Math.cos( DEG2RAD * thresholdAngle ); - console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' ); - json = JSON.parse( text.substring( 65, text.length - 2 ) ); + const indexAttr = geometry.getIndex(); + const positionAttr = geometry.getAttribute( 'position' ); + const indexCount = indexAttr ? indexAttr.count : positionAttr.count; - } + const indexArr = [ 0, 0, 0 ]; + const vertKeys = [ 'a', 'b', 'c' ]; + const hashes = new Array( 3 ); - var font = scope.parse( json ); + const edgeData = {}; + const vertices = []; + for ( let i = 0; i < indexCount; i += 3 ) { - if ( onLoad ) onLoad( font ); + if ( indexAttr ) { - }, onProgress, onError ); + indexArr[ 0 ] = indexAttr.getX( i ); + indexArr[ 1 ] = indexAttr.getX( i + 1 ); + indexArr[ 2 ] = indexAttr.getX( i + 2 ); - }, + } else { - parse: function ( json ) { + indexArr[ 0 ] = i; + indexArr[ 1 ] = i + 1; + indexArr[ 2 ] = i + 2; - return new Font( json ); + } - } + const { a, b, c } = _triangle; + a.fromBufferAttribute( positionAttr, indexArr[ 0 ] ); + b.fromBufferAttribute( positionAttr, indexArr[ 1 ] ); + c.fromBufferAttribute( positionAttr, indexArr[ 2 ] ); + _triangle.getNormal( _normal ); - } ); + // create hashes for the edge from the vertices + hashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`; + hashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`; + hashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`; - var context; + // skip degenerate triangles + if ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) { - var AudioContext = { + continue; - getContext: function () { + } - if ( context === undefined ) { + // iterate over every edge + for ( let j = 0; j < 3; j ++ ) { - context = new ( window.AudioContext || window.webkitAudioContext )(); + // get the first and next vertex making up the edge + const jNext = ( j + 1 ) % 3; + const vecHash0 = hashes[ j ]; + const vecHash1 = hashes[ jNext ]; + const v0 = _triangle[ vertKeys[ j ] ]; + const v1 = _triangle[ vertKeys[ jNext ] ]; - } + const hash = `${ vecHash0 }_${ vecHash1 }`; + const reverseHash = `${ vecHash1 }_${ vecHash0 }`; - return context; + if ( reverseHash in edgeData && edgeData[ reverseHash ] ) { - }, + // if we found a sibling edge add it into the vertex array if + // it meets the angle threshold and delete the edge from the map. + if ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) { - setContext: function ( value ) { + vertices.push( v0.x, v0.y, v0.z ); + vertices.push( v1.x, v1.y, v1.z ); - context = value; + } - } + edgeData[ reverseHash ] = null; - }; + } else if ( ! ( hash in edgeData ) ) { - /** - * @author Reece Aaron Lecrivain / http://reecenotes.com/ - */ + // if we've already got an edge here then skip adding a new one + edgeData[ hash ] = { - function AudioLoader( manager ) { + index0: indexArr[ j ], + index1: indexArr[ jNext ], + normal: _normal.clone(), - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + }; - } + } + + } - Object.assign( AudioLoader.prototype, { + } - load: function ( url, onLoad, onProgress, onError ) { + // iterate over all remaining, unmatched edges and add them to the vertex array + for ( const key in edgeData ) { - var loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); - loader.load( url, function ( buffer ) { + if ( edgeData[ key ] ) { - var context = AudioContext.getContext(); + const { index0, index1 } = edgeData[ key ]; + _v0.fromBufferAttribute( positionAttr, index0 ); + _v1$1.fromBufferAttribute( positionAttr, index1 ); - context.decodeAudioData( buffer, function ( audioBuffer ) { + vertices.push( _v0.x, _v0.y, _v0.z ); + vertices.push( _v1$1.x, _v1$1.y, _v1$1.z ); - onLoad( audioBuffer ); + } - } ); + } - }, onProgress, onError ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + + } } - } ); + copy( source ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + super.copy( source ); - function StereoCamera() { + this.parameters = Object.assign( {}, source.parameters ); - this.type = 'StereoCamera'; + return this; - this.aspect = 1; + } - this.eyeSep = 0.064; + } - this.cameraL = new PerspectiveCamera(); - this.cameraL.layers.enable( 1 ); - this.cameraL.matrixAutoUpdate = false; + class Shape extends Path { - this.cameraR = new PerspectiveCamera(); - this.cameraR.layers.enable( 2 ); - this.cameraR.matrixAutoUpdate = false; + constructor( points ) { - } + super( points ); - Object.assign( StereoCamera.prototype, { + this.uuid = generateUUID(); - update: ( function () { + this.type = 'Shape'; - var instance, focus, fov, aspect, near, far, zoom, eyeSep; + this.holes = []; - var eyeRight = new Matrix4(); - var eyeLeft = new Matrix4(); + } - return function update( camera ) { + getPointsHoles( divisions ) { - var needsUpdate = instance !== this || focus !== camera.focus || fov !== camera.fov || - aspect !== camera.aspect * this.aspect || near !== camera.near || - far !== camera.far || zoom !== camera.zoom || eyeSep !== this.eyeSep; + const holesPts = []; - if ( needsUpdate ) { + for ( let i = 0, l = this.holes.length; i < l; i ++ ) { - instance = this; - focus = camera.focus; - fov = camera.fov; - aspect = camera.aspect * this.aspect; - near = camera.near; - far = camera.far; - zoom = camera.zoom; + holesPts[ i ] = this.holes[ i ].getPoints( divisions ); - // Off-axis stereoscopic effect based on - // http://paulbourke.net/stereographics/stereorender/ + } - var projectionMatrix = camera.projectionMatrix.clone(); - eyeSep = this.eyeSep / 2; - var eyeSepOnProjection = eyeSep * near / focus; - var ymax = ( near * Math.tan( _Math.DEG2RAD * fov * 0.5 ) ) / zoom; - var xmin, xmax; + return holesPts; - // translate xOffset + } - eyeLeft.elements[ 12 ] = - eyeSep; - eyeRight.elements[ 12 ] = eyeSep; + // get points of shape and holes (keypoints based on segments parameter) - // for left eye + extractPoints( divisions ) { - xmin = - ymax * aspect + eyeSepOnProjection; - xmax = ymax * aspect + eyeSepOnProjection; + return { - projectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin ); - projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + shape: this.getPoints( divisions ), + holes: this.getPointsHoles( divisions ) - this.cameraL.projectionMatrix.copy( projectionMatrix ); + }; - // for right eye + } - xmin = - ymax * aspect - eyeSepOnProjection; - xmax = ymax * aspect - eyeSepOnProjection; + copy( source ) { - projectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin ); - projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + super.copy( source ); - this.cameraR.projectionMatrix.copy( projectionMatrix ); + this.holes = []; - } + for ( let i = 0, l = source.holes.length; i < l; i ++ ) { - this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft ); - this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight ); + const hole = source.holes[ i ]; - }; + this.holes.push( hole.clone() ); - } )() + } - } ); + return this; - /** - * Camera for rendering cube maps - * - renders scene into axis-aligned cube - * - * @author alteredq / http://alteredqualia.com/ - */ + } - function CubeCamera( near, far, cubeResolution ) { + toJSON() { - Object3D.call( this ); + const data = super.toJSON(); - this.type = 'CubeCamera'; + data.uuid = this.uuid; + data.holes = []; - var fov = 90, aspect = 1; + for ( let i = 0, l = this.holes.length; i < l; i ++ ) { - var cameraPX = new PerspectiveCamera( fov, aspect, near, far ); - cameraPX.up.set( 0, - 1, 0 ); - cameraPX.lookAt( new Vector3( 1, 0, 0 ) ); - this.add( cameraPX ); + const hole = this.holes[ i ]; + data.holes.push( hole.toJSON() ); - var cameraNX = new PerspectiveCamera( fov, aspect, near, far ); - cameraNX.up.set( 0, - 1, 0 ); - cameraNX.lookAt( new Vector3( - 1, 0, 0 ) ); - this.add( cameraNX ); + } - var cameraPY = new PerspectiveCamera( fov, aspect, near, far ); - cameraPY.up.set( 0, 0, 1 ); - cameraPY.lookAt( new Vector3( 0, 1, 0 ) ); - this.add( cameraPY ); + return data; - var cameraNY = new PerspectiveCamera( fov, aspect, near, far ); - cameraNY.up.set( 0, 0, - 1 ); - cameraNY.lookAt( new Vector3( 0, - 1, 0 ) ); - this.add( cameraNY ); + } - var cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); - cameraPZ.up.set( 0, - 1, 0 ); - cameraPZ.lookAt( new Vector3( 0, 0, 1 ) ); - this.add( cameraPZ ); + fromJSON( json ) { - var cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); - cameraNZ.up.set( 0, - 1, 0 ); - cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) ); - this.add( cameraNZ ); + super.fromJSON( json ); - var options = { format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter }; + this.uuid = json.uuid; + this.holes = []; - this.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options ); - this.renderTarget.texture.name = "CubeCamera"; + for ( let i = 0, l = json.holes.length; i < l; i ++ ) { - this.updateCubeMap = function ( renderer, scene ) { + const hole = json.holes[ i ]; + this.holes.push( new Path().fromJSON( hole ) ); - if ( this.parent === null ) this.updateMatrixWorld(); + } - var renderTarget = this.renderTarget; - var generateMipmaps = renderTarget.texture.generateMipmaps; + return this; - renderTarget.texture.generateMipmaps = false; + } - renderTarget.activeCubeFace = 0; - renderer.render( scene, cameraPX, renderTarget ); + } - renderTarget.activeCubeFace = 1; - renderer.render( scene, cameraNX, renderTarget ); + /** + * Port from https://github.com/mapbox/earcut (v2.2.4) + */ - renderTarget.activeCubeFace = 2; - renderer.render( scene, cameraPY, renderTarget ); + const Earcut = { - renderTarget.activeCubeFace = 3; - renderer.render( scene, cameraNY, renderTarget ); + triangulate: function ( data, holeIndices, dim = 2 ) { - renderTarget.activeCubeFace = 4; - renderer.render( scene, cameraPZ, renderTarget ); + const hasHoles = holeIndices && holeIndices.length; + const outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length; + let outerNode = linkedList( data, 0, outerLen, dim, true ); + const triangles = []; - renderTarget.texture.generateMipmaps = generateMipmaps; + if ( ! outerNode || outerNode.next === outerNode.prev ) return triangles; - renderTarget.activeCubeFace = 5; - renderer.render( scene, cameraNZ, renderTarget ); + let minX, minY, maxX, maxY, x, y, invSize; - renderer.setRenderTarget( null ); + if ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim ); - }; + // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox + if ( data.length > 80 * dim ) { - } + minX = maxX = data[ 0 ]; + minY = maxY = data[ 1 ]; - CubeCamera.prototype = Object.create( Object3D.prototype ); - CubeCamera.prototype.constructor = CubeCamera; + for ( let i = dim; i < outerLen; i += dim ) { - /** - * @author mrdoob / http://mrdoob.com/ - */ + x = data[ i ]; + y = data[ i + 1 ]; + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; - function AudioListener() { + } - Object3D.call( this ); + // minX, minY and invSize are later used to transform coords into integers for z-order calculation + invSize = Math.max( maxX - minX, maxY - minY ); + invSize = invSize !== 0 ? 32767 / invSize : 0; - this.type = 'AudioListener'; + } - this.context = AudioContext.getContext(); + earcutLinked( outerNode, triangles, dim, minX, minY, invSize, 0 ); - this.gain = this.context.createGain(); - this.gain.connect( this.context.destination ); + return triangles; - this.filter = null; + } - } + }; - AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { + // create a circular doubly linked list from polygon points in the specified winding order + function linkedList( data, start, end, dim, clockwise ) { - constructor: AudioListener, + let i, last; - getInput: function () { + if ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) { - return this.gain; + for ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); - }, + } else { - removeFilter: function ( ) { + for ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); - if ( this.filter !== null ) { + } - this.gain.disconnect( this.filter ); - this.filter.disconnect( this.context.destination ); - this.gain.connect( this.context.destination ); - this.filter = null; + if ( last && equals( last, last.next ) ) { - } + removeNode( last ); + last = last.next; - }, + } - getFilter: function () { + return last; - return this.filter; + } - }, + // eliminate colinear or duplicate points + function filterPoints( start, end ) { - setFilter: function ( value ) { + if ( ! start ) return start; + if ( ! end ) end = start; - if ( this.filter !== null ) { + let p = start, + again; + do { - this.gain.disconnect( this.filter ); - this.filter.disconnect( this.context.destination ); + again = false; + + if ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) { + + removeNode( p ); + p = end = p.prev; + if ( p === p.next ) break; + again = true; } else { - this.gain.disconnect( this.context.destination ); + p = p.next; } - this.filter = value; - this.gain.connect( this.filter ); - this.filter.connect( this.context.destination ); + } while ( again || p !== end ); - }, + return end; - getMasterVolume: function () { + } - return this.gain.gain.value; + // main ear slicing loop which triangulates a polygon (given as a linked list) + function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) { - }, + if ( ! ear ) return; - setMasterVolume: function ( value ) { + // interlink polygon nodes in z-order + if ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize ); - this.gain.gain.value = value; + let stop = ear, + prev, next; - }, + // iterate through ears, slicing them one by one + while ( ear.prev !== ear.next ) { + + prev = ear.prev; + next = ear.next; - updateMatrixWorld: ( function () { + if ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) { - var position = new Vector3(); - var quaternion = new Quaternion(); - var scale = new Vector3(); + // cut off the triangle + triangles.push( prev.i / dim | 0 ); + triangles.push( ear.i / dim | 0 ); + triangles.push( next.i / dim | 0 ); - var orientation = new Vector3(); + removeNode( ear ); - return function updateMatrixWorld( force ) { + // skipping the next vertex leads to less sliver triangles + ear = next.next; + stop = next.next; - Object3D.prototype.updateMatrixWorld.call( this, force ); + continue; - var listener = this.context.listener; - var up = this.up; + } - this.matrixWorld.decompose( position, quaternion, scale ); + ear = next; - orientation.set( 0, 0, - 1 ).applyQuaternion( quaternion ); + // if we looped through the whole remaining polygon and can't find any more ears + if ( ear === stop ) { - if ( listener.positionX ) { + // try filtering points and slicing again + if ( ! pass ) { - listener.positionX.setValueAtTime( position.x, this.context.currentTime ); - listener.positionY.setValueAtTime( position.y, this.context.currentTime ); - listener.positionZ.setValueAtTime( position.z, this.context.currentTime ); - listener.forwardX.setValueAtTime( orientation.x, this.context.currentTime ); - listener.forwardY.setValueAtTime( orientation.y, this.context.currentTime ); - listener.forwardZ.setValueAtTime( orientation.z, this.context.currentTime ); - listener.upX.setValueAtTime( up.x, this.context.currentTime ); - listener.upY.setValueAtTime( up.y, this.context.currentTime ); - listener.upZ.setValueAtTime( up.z, this.context.currentTime ); + earcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 ); - } else { + // if this didn't work, try curing all small self-intersections locally - listener.setPosition( position.x, position.y, position.z ); - listener.setOrientation( orientation.x, orientation.y, orientation.z, up.x, up.y, up.z ); + } else if ( pass === 1 ) { + + ear = cureLocalIntersections( filterPoints( ear ), triangles, dim ); + earcutLinked( ear, triangles, dim, minX, minY, invSize, 2 ); + + // as a last resort, try splitting the remaining polygon into two + + } else if ( pass === 2 ) { + + splitEarcut( ear, triangles, dim, minX, minY, invSize ); } - }; + break; + + } - } )() + } - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author Reece Aaron Lecrivain / http://reecenotes.com/ - */ + // check whether a polygon node forms a valid ear with adjacent nodes + function isEar( ear ) { - function Audio( listener ) { + const a = ear.prev, + b = ear, + c = ear.next; - Object3D.call( this ); + if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear - this.type = 'Audio'; + // now make sure we don't have other points inside the potential ear + const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; - this.context = listener.context; + // triangle bbox; min & max are calculated like this for speed + const x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ), + y0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ), + x1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ), + y1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy ); - this.gain = this.context.createGain(); - this.gain.connect( listener.getInput() ); + let p = c.next; + while ( p !== a ) { - this.autoplay = false; + if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && + pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && + area( p.prev, p, p.next ) >= 0 ) return false; + p = p.next; - this.buffer = null; - this.loop = false; - this.startTime = 0; - this.playbackRate = 1; - this.isPlaying = false; - this.hasPlaybackControl = true; - this.sourceType = 'empty'; + } - this.filters = []; + return true; } - Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { + function isEarHashed( ear, minX, minY, invSize ) { - constructor: Audio, + const a = ear.prev, + b = ear, + c = ear.next; - getOutput: function () { + if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear - return this.gain; + const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; - }, + // triangle bbox; min & max are calculated like this for speed + const x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ), + y0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ), + x1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ), + y1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy ); - setNodeSource: function ( audioNode ) { + // z-order range for the current triangle bbox; + const minZ = zOrder( x0, y0, minX, minY, invSize ), + maxZ = zOrder( x1, y1, minX, minY, invSize ); - this.hasPlaybackControl = false; - this.sourceType = 'audioNode'; - this.source = audioNode; - this.connect(); - - return this; + let p = ear.prevZ, + n = ear.nextZ; - }, + // look for points inside the triangle in both directions + while ( p && p.z >= minZ && n && n.z <= maxZ ) { - setBuffer: function ( audioBuffer ) { + if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && + pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false; + p = p.prevZ; - this.buffer = audioBuffer; - this.sourceType = 'buffer'; + if ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && + pointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false; + n = n.nextZ; - if ( this.autoplay ) this.play(); + } - return this; + // look for remaining points in decreasing z-order + while ( p && p.z >= minZ ) { - }, + if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && + pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false; + p = p.prevZ; - play: function () { + } - if ( this.isPlaying === true ) { + // look for remaining points in increasing z-order + while ( n && n.z <= maxZ ) { - console.warn( 'THREE.Audio: Audio is already playing.' ); - return; + if ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && + pointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false; + n = n.nextZ; - } + } - if ( this.hasPlaybackControl === false ) { + return true; - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; + } - } + // go through all polygon nodes and cure small local self-intersections + function cureLocalIntersections( start, triangles, dim ) { - var source = this.context.createBufferSource(); + let p = start; + do { - source.buffer = this.buffer; - source.loop = this.loop; - source.onended = this.onEnded.bind( this ); - source.playbackRate.setValueAtTime( this.playbackRate, this.startTime ); - source.start( 0, this.startTime ); + const a = p.prev, + b = p.next.next; - this.isPlaying = true; + if ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) { - this.source = source; + triangles.push( a.i / dim | 0 ); + triangles.push( p.i / dim | 0 ); + triangles.push( b.i / dim | 0 ); - return this.connect(); + // remove two nodes involved + removeNode( p ); + removeNode( p.next ); - }, + p = start = b; - pause: function () { + } - if ( this.hasPlaybackControl === false ) { + p = p.next; - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; + } while ( p !== start ); - } + return filterPoints( p ); - this.source.stop(); - this.startTime = this.context.currentTime; - this.isPlaying = false; + } - return this; + // try splitting polygon into two and triangulate them independently + function splitEarcut( start, triangles, dim, minX, minY, invSize ) { - }, + // look for a valid diagonal that divides the polygon into two + let a = start; + do { - stop: function () { + let b = a.next.next; + while ( b !== a.prev ) { - if ( this.hasPlaybackControl === false ) { + if ( a.i !== b.i && isValidDiagonal( a, b ) ) { - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; + // split the polygon in two by the diagonal + let c = splitPolygon( a, b ); - } + // filter colinear points around the cuts + a = filterPoints( a, a.next ); + c = filterPoints( c, c.next ); - this.source.stop(); - this.startTime = 0; - this.isPlaying = false; + // run earcut on each half + earcutLinked( a, triangles, dim, minX, minY, invSize, 0 ); + earcutLinked( c, triangles, dim, minX, minY, invSize, 0 ); + return; - return this; + } - }, + b = b.next; - connect: function () { + } - if ( this.filters.length > 0 ) { + a = a.next; - this.source.connect( this.filters[ 0 ] ); + } while ( a !== start ); - for ( var i = 1, l = this.filters.length; i < l; i ++ ) { + } - this.filters[ i - 1 ].connect( this.filters[ i ] ); + // link every hole into the outer loop, producing a single-ring polygon without holes + function eliminateHoles( data, holeIndices, outerNode, dim ) { - } + const queue = []; + let i, len, start, end, list; - this.filters[ this.filters.length - 1 ].connect( this.getOutput() ); + for ( i = 0, len = holeIndices.length; i < len; i ++ ) { - } else { + start = holeIndices[ i ] * dim; + end = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length; + list = linkedList( data, start, end, dim, false ); + if ( list === list.next ) list.steiner = true; + queue.push( getLeftmost( list ) ); - this.source.connect( this.getOutput() ); + } - } + queue.sort( compareX ); - return this; + // process holes from left to right + for ( i = 0; i < queue.length; i ++ ) { - }, + outerNode = eliminateHole( queue[ i ], outerNode ); - disconnect: function () { + } - if ( this.filters.length > 0 ) { + return outerNode; - this.source.disconnect( this.filters[ 0 ] ); + } - for ( var i = 1, l = this.filters.length; i < l; i ++ ) { + function compareX( a, b ) { - this.filters[ i - 1 ].disconnect( this.filters[ i ] ); + return a.x - b.x; - } + } - this.filters[ this.filters.length - 1 ].disconnect( this.getOutput() ); + // find a bridge between vertices that connects hole with an outer ring and link it + function eliminateHole( hole, outerNode ) { - } else { + const bridge = findHoleBridge( hole, outerNode ); + if ( ! bridge ) { - this.source.disconnect( this.getOutput() ); + return outerNode; - } + } - return this; + const bridgeReverse = splitPolygon( bridge, hole ); - }, + // filter collinear points around the cuts + filterPoints( bridgeReverse, bridgeReverse.next ); + return filterPoints( bridge, bridge.next ); - getFilters: function () { + } - return this.filters; + // David Eberly's algorithm for finding a bridge between hole and outer polygon + function findHoleBridge( hole, outerNode ) { - }, + let p = outerNode, + qx = - Infinity, + m; - setFilters: function ( value ) { + const hx = hole.x, hy = hole.y; - if ( ! value ) value = []; + // find a segment intersected by a ray from the hole's leftmost point to the left; + // segment's endpoint with lesser x will be potential connection point + do { - if ( this.isPlaying === true ) { + if ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) { - this.disconnect(); - this.filters = value; - this.connect(); + const x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y ); + if ( x <= hx && x > qx ) { - } else { + qx = x; + m = p.x < p.next.x ? p : p.next; + if ( x === hx ) return m; // hole touches outer segment; pick leftmost endpoint - this.filters = value; + } } - return this; + p = p.next; - }, + } while ( p !== outerNode ); - getFilter: function () { + if ( ! m ) return null; - return this.getFilters()[ 0 ]; + // look for points inside the triangle of hole point, segment intersection and endpoint; + // if there are no points found, we have a valid connection; + // otherwise choose the point of the minimum angle with the ray as connection point - }, + const stop = m, + mx = m.x, + my = m.y; + let tanMin = Infinity, tan; - setFilter: function ( filter ) { + p = m; - return this.setFilters( filter ? [ filter ] : [] ); + do { - }, + if ( hx >= p.x && p.x >= mx && hx !== p.x && + pointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) { - setPlaybackRate: function ( value ) { + tan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential - if ( this.hasPlaybackControl === false ) { + if ( locallyInside( p, hole ) && ( tan < tanMin || ( tan === tanMin && ( p.x > m.x || ( p.x === m.x && sectorContainsSector( m, p ) ) ) ) ) ) { - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; + m = p; + tanMin = tan; + + } } - this.playbackRate = value; + p = p.next; - if ( this.isPlaying === true ) { + } while ( p !== stop ); - this.source.playbackRate.setValueAtTime( this.playbackRate, this.context.currentTime ); + return m; - } + } - return this; + // whether sector in vertex m contains sector in vertex p in the same coordinates + function sectorContainsSector( m, p ) { - }, + return area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0; - getPlaybackRate: function () { + } - return this.playbackRate; + // interlink polygon nodes in z-order + function indexCurve( start, minX, minY, invSize ) { - }, + let p = start; + do { - onEnded: function () { + if ( p.z === 0 ) p.z = zOrder( p.x, p.y, minX, minY, invSize ); + p.prevZ = p.prev; + p.nextZ = p.next; + p = p.next; - this.isPlaying = false; + } while ( p !== start ); - }, + p.prevZ.nextZ = null; + p.prevZ = null; - getLoop: function () { + sortLinked( p ); - if ( this.hasPlaybackControl === false ) { + } - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return false; + // Simon Tatham's linked list merge sort algorithm + // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html + function sortLinked( list ) { - } + let i, p, q, e, tail, numMerges, pSize, qSize, + inSize = 1; - return this.loop; + do { - }, + p = list; + list = null; + tail = null; + numMerges = 0; - setLoop: function ( value ) { + while ( p ) { - if ( this.hasPlaybackControl === false ) { + numMerges ++; + q = p; + pSize = 0; + for ( i = 0; i < inSize; i ++ ) { - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; + pSize ++; + q = q.nextZ; + if ( ! q ) break; - } + } - this.loop = value; + qSize = inSize; - if ( this.isPlaying === true ) { + while ( pSize > 0 || ( qSize > 0 && q ) ) { - this.source.loop = this.loop; + if ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) { - } + e = p; + p = p.nextZ; + pSize --; - return this; + } else { - }, + e = q; + q = q.nextZ; + qSize --; - getVolume: function () { + } - return this.gain.gain.value; + if ( tail ) tail.nextZ = e; + else list = e; - }, - - setVolume: function ( value ) { + e.prevZ = tail; + tail = e; - this.gain.gain.value = value; + } - return this; + p = q; - } + } - } ); + tail.nextZ = null; + inSize *= 2; - /** - * @author mrdoob / http://mrdoob.com/ - */ + } while ( numMerges > 1 ); + + return list; - function PositionalAudio( listener ) { + } + + // z-order of a point given coords and inverse of the longer side of data bbox + function zOrder( x, y, minX, minY, invSize ) { + + // coords are transformed into non-negative 15-bit integer range + x = ( x - minX ) * invSize | 0; + y = ( y - minY ) * invSize | 0; + + x = ( x | ( x << 8 ) ) & 0x00FF00FF; + x = ( x | ( x << 4 ) ) & 0x0F0F0F0F; + x = ( x | ( x << 2 ) ) & 0x33333333; + x = ( x | ( x << 1 ) ) & 0x55555555; - Audio.call( this, listener ); + y = ( y | ( y << 8 ) ) & 0x00FF00FF; + y = ( y | ( y << 4 ) ) & 0x0F0F0F0F; + y = ( y | ( y << 2 ) ) & 0x33333333; + y = ( y | ( y << 1 ) ) & 0x55555555; - this.panner = this.context.createPanner(); - this.panner.connect( this.gain ); + return x | ( y << 1 ); } - PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { + // find the leftmost node of a polygon ring + function getLeftmost( start ) { - constructor: PositionalAudio, + let p = start, + leftmost = start; + do { - getOutput: function () { + if ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p; + p = p.next; - return this.panner; + } while ( p !== start ); - }, + return leftmost; - getRefDistance: function () { + } - return this.panner.refDistance; + // check if a point lies within a convex triangle + function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) { - }, + return ( cx - px ) * ( ay - py ) >= ( ax - px ) * ( cy - py ) && + ( ax - px ) * ( by - py ) >= ( bx - px ) * ( ay - py ) && + ( bx - px ) * ( cy - py ) >= ( cx - px ) * ( by - py ); - setRefDistance: function ( value ) { + } - this.panner.refDistance = value; + // check if a diagonal between two polygon nodes is valid (lies in polygon interior) + function isValidDiagonal( a, b ) { - }, + return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges + ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible + ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors + equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case - getRolloffFactor: function () { + } - return this.panner.rolloffFactor; + // signed area of a triangle + function area( p, q, r ) { - }, + return ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y ); - setRolloffFactor: function ( value ) { + } - this.panner.rolloffFactor = value; + // check if two points are equal + function equals( p1, p2 ) { - }, + return p1.x === p2.x && p1.y === p2.y; - getDistanceModel: function () { + } - return this.panner.distanceModel; + // check if two segments intersect + function intersects( p1, q1, p2, q2 ) { - }, + const o1 = sign( area( p1, q1, p2 ) ); + const o2 = sign( area( p1, q1, q2 ) ); + const o3 = sign( area( p2, q2, p1 ) ); + const o4 = sign( area( p2, q2, q1 ) ); - setDistanceModel: function ( value ) { + if ( o1 !== o2 && o3 !== o4 ) return true; // general case - this.panner.distanceModel = value; + if ( o1 === 0 && onSegment( p1, p2, q1 ) ) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1 + if ( o2 === 0 && onSegment( p1, q2, q1 ) ) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1 + if ( o3 === 0 && onSegment( p2, p1, q2 ) ) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2 + if ( o4 === 0 && onSegment( p2, q1, q2 ) ) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2 - }, + return false; - getMaxDistance: function () { + } - return this.panner.maxDistance; + // for collinear points p, q, r, check if point q lies on segment pr + function onSegment( p, q, r ) { - }, + return q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y ); - setMaxDistance: function ( value ) { + } - this.panner.maxDistance = value; + function sign( num ) { - }, + return num > 0 ? 1 : num < 0 ? - 1 : 0; - updateMatrixWorld: ( function () { + } - var position = new Vector3(); + // check if a polygon diagonal intersects any polygon segments + function intersectsPolygon( a, b ) { - return function updateMatrixWorld( force ) { + let p = a; + do { - Object3D.prototype.updateMatrixWorld.call( this, force ); + if ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && + intersects( p, p.next, a, b ) ) return true; + p = p.next; - position.setFromMatrixPosition( this.matrixWorld ); + } while ( p !== a ); - this.panner.setPosition( position.x, position.y, position.z ); + return false; - }; + } - } )() + // check if a polygon diagonal is locally inside the polygon + function locallyInside( a, b ) { + return area( a.prev, a, a.next ) < 0 ? + area( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 : + area( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0; - } ); + } - /** - * @author mrdoob / http://mrdoob.com/ - */ + // check if the middle point of a polygon diagonal is inside the polygon + function middleInside( a, b ) { - function AudioAnalyser( audio, fftSize ) { + let p = a, + inside = false; + const px = ( a.x + b.x ) / 2, + py = ( a.y + b.y ) / 2; + do { - this.analyser = audio.context.createAnalyser(); - this.analyser.fftSize = fftSize !== undefined ? fftSize : 2048; + if ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y && + ( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) + inside = ! inside; + p = p.next; - this.data = new Uint8Array( this.analyser.frequencyBinCount ); + } while ( p !== a ); - audio.getOutput().connect( this.analyser ); + return inside; } - Object.assign( AudioAnalyser.prototype, { + // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; + // if one belongs to the outer ring and another to a hole, it merges it into a single ring + function splitPolygon( a, b ) { - getFrequencyData: function () { + const a2 = new Node( a.i, a.x, a.y ), + b2 = new Node( b.i, b.x, b.y ), + an = a.next, + bp = b.prev; - this.analyser.getByteFrequencyData( this.data ); + a.next = b; + b.prev = a; - return this.data; + a2.next = an; + an.prev = a2; - }, + b2.next = a2; + a2.prev = b2; - getAverageFrequency: function () { + bp.next = b2; + b2.prev = bp; - var value = 0, data = this.getFrequencyData(); + return b2; - for ( var i = 0; i < data.length; i ++ ) { + } - value += data[ i ]; + // create a node and optionally link it with previous one (in a circular doubly linked list) + function insertNode( i, x, y, last ) { - } + const p = new Node( i, x, y ); - return value / data.length; + if ( ! last ) { - } + p.prev = p; + p.next = p; - } ); + } else { - /** - * - * Buffered scene graph property that allows weighted accumulation. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + p.next = last.next; + p.prev = last; + last.next.prev = p; + last.next = p; - function PropertyMixer( binding, typeName, valueSize ) { + } - this.binding = binding; - this.valueSize = valueSize; + return p; - var bufferType = Float64Array, - mixFunction; + } - switch ( typeName ) { + function removeNode( p ) { - case 'quaternion': - mixFunction = this._slerp; - break; + p.next.prev = p.prev; + p.prev.next = p.next; - case 'string': - case 'bool': - bufferType = Array; - mixFunction = this._select; - break; + if ( p.prevZ ) p.prevZ.nextZ = p.nextZ; + if ( p.nextZ ) p.nextZ.prevZ = p.prevZ; - default: - mixFunction = this._lerp; + } - } + function Node( i, x, y ) { - this.buffer = new bufferType( valueSize * 4 ); - // layout: [ incoming | accu0 | accu1 | orig ] - // - // interpolators can use .buffer as their .result - // the data then goes to 'incoming' - // - // 'accu0' and 'accu1' are used frame-interleaved for - // the cumulative result and are compared to detect - // changes - // - // 'orig' stores the original state of the property + // vertex index in coordinates array + this.i = i; - this._mixBufferRegion = mixFunction; + // vertex coordinates + this.x = x; + this.y = y; - this.cumulativeWeight = 0; + // previous and next vertex nodes in a polygon ring + this.prev = null; + this.next = null; - this.useCount = 0; - this.referenceCount = 0; + // z-order curve value + this.z = 0; - } + // previous and next nodes in z-order + this.prevZ = null; + this.nextZ = null; - Object.assign( PropertyMixer.prototype, { + // indicates whether this is a steiner point + this.steiner = false; - // accumulate data in the 'incoming' region into 'accu' - accumulate: function ( accuIndex, weight ) { + } - // note: happily accumulating nothing when weight = 0, the caller knows - // the weight and shouldn't have made the call in the first place + function signedArea( data, start, end, dim ) { - var buffer = this.buffer, - stride = this.valueSize, - offset = accuIndex * stride + stride, + let sum = 0; + for ( let i = start, j = end - dim; i < end; i += dim ) { - currentWeight = this.cumulativeWeight; + sum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] ); + j = i; - if ( currentWeight === 0 ) { + } - // accuN := incoming * weight + return sum; - for ( var i = 0; i !== stride; ++ i ) { + } - buffer[ offset + i ] = buffer[ i ]; + class ShapeUtils { - } + // calculate area of the contour polygon - currentWeight = weight; + static area( contour ) { - } else { + const n = contour.length; + let a = 0.0; - // accuN := accuN + incoming * weight + for ( let p = n - 1, q = 0; q < n; p = q ++ ) { - currentWeight += weight; - var mix = weight / currentWeight; - this._mixBufferRegion( buffer, offset, 0, mix, stride ); + a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; } - this.cumulativeWeight = currentWeight; + return a * 0.5; - }, + } - // apply the state of 'accu' to the binding when accus differ - apply: function ( accuIndex ) { + static isClockWise( pts ) { - var stride = this.valueSize, - buffer = this.buffer, - offset = accuIndex * stride + stride, + return ShapeUtils.area( pts ) < 0; - weight = this.cumulativeWeight, + } - binding = this.binding; + static triangulateShape( contour, holes ) { - this.cumulativeWeight = 0; + const vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ] + const holeIndices = []; // array of hole indices + const faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ] - if ( weight < 1 ) { + removeDupEndPts( contour ); + addContour( vertices, contour ); - // accuN := accuN + original * ( 1 - cumulativeWeight ) + // - var originalValueOffset = stride * 3; + let holeIndex = contour.length; - this._mixBufferRegion( - buffer, offset, originalValueOffset, 1 - weight, stride ); + holes.forEach( removeDupEndPts ); + + for ( let i = 0; i < holes.length; i ++ ) { + + holeIndices.push( holeIndex ); + holeIndex += holes[ i ].length; + addContour( vertices, holes[ i ] ); } - for ( var i = stride, e = stride + stride; i !== e; ++ i ) { + // - if ( buffer[ i ] !== buffer[ i + stride ] ) { + const triangles = Earcut.triangulate( vertices, holeIndices ); - // value has changed -> update scene graph + // - binding.setValue( buffer, offset ); - break; + for ( let i = 0; i < triangles.length; i += 3 ) { - } + faces.push( triangles.slice( i, i + 3 ) ); } - }, + return faces; - // remember the state of the bound property and copy it to both accus - saveOriginalState: function () { + } - var binding = this.binding; + } - var buffer = this.buffer, - stride = this.valueSize, + function removeDupEndPts( points ) { - originalValueOffset = stride * 3; + const l = points.length; - binding.getValue( buffer, originalValueOffset ); + if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { - // accu[0..1] := orig -- initially detect changes against the original - for ( var i = stride, e = originalValueOffset; i !== e; ++ i ) { + points.pop(); - buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ]; + } - } + } - this.cumulativeWeight = 0; + function addContour( vertices, contour ) { - }, + for ( let i = 0; i < contour.length; i ++ ) { - // apply the state previously taken via 'saveOriginalState' to the binding - restoreOriginalState: function () { + vertices.push( contour[ i ].x ); + vertices.push( contour[ i ].y ); - var originalValueOffset = this.valueSize * 3; - this.binding.setValue( this.buffer, originalValueOffset ); + } - }, + } + + /** + * Creates extruded geometry from a path shape. + * + * parameters = { + * + * curveSegments: , // number of points on the curves + * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too + * depth: , // Depth to extrude the shape + * + * bevelEnabled: , // turn on bevel + * bevelThickness: , // how deep into the original shape bevel goes + * bevelSize: , // how far from shape outline (including bevelOffset) is bevel + * bevelOffset: , // how far from shape outline does bevel start + * bevelSegments: , // number of bevel layers + * + * extrudePath: // curve to extrude shape along + * + * UVGenerator: // object that provides UV generator functions + * + * } + */ - // mix functions + class ExtrudeGeometry extends BufferGeometry { - _select: function ( buffer, dstOffset, srcOffset, t, stride ) { + constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) { - if ( t >= 0.5 ) { + super(); - for ( var i = 0; i !== stride; ++ i ) { + this.type = 'ExtrudeGeometry'; - buffer[ dstOffset + i ] = buffer[ srcOffset + i ]; + this.parameters = { + shapes: shapes, + options: options + }; - } + shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + + const scope = this; + + const verticesArray = []; + const uvArray = []; + + for ( let i = 0, l = shapes.length; i < l; i ++ ) { + + const shape = shapes[ i ]; + addShape( shape ); } - }, + // build geometry - _slerp: function ( buffer, dstOffset, srcOffset, t ) { + this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); - Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t ); + this.computeVertexNormals(); - }, + // functions - _lerp: function ( buffer, dstOffset, srcOffset, t, stride ) { + function addShape( shape ) { - var s = 1 - t; + const placeholder = []; - for ( var i = 0; i !== stride; ++ i ) { + // options - var j = dstOffset + i; + const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + const steps = options.steps !== undefined ? options.steps : 1; + const depth = options.depth !== undefined ? options.depth : 1; - buffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t; + let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; + let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2; + let bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1; + let bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; + let bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; - } + const extrudePath = options.extrudePath; - } + const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; - } ); + // - /** - * - * A reference to a real property in the scene graph. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + let extrudePts, extrudeByPath = false; + let splineTube, binormal, normal, position2; - function Composite( targetGroup, path, optionalParsedPath ) { + if ( extrudePath ) { - var parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path ); + extrudePts = extrudePath.getSpacedPoints( steps ); - this._targetGroup = targetGroup; - this._bindings = targetGroup.subscribe_( path, parsedPath ); + extrudeByPath = true; + bevelEnabled = false; // bevels not supported for path extrusion - } + // SETUP TNB variables - Object.assign( Composite.prototype, { + // TODO1 - have a .isClosed in spline? - getValue: function ( array, offset ) { + splineTube = extrudePath.computeFrenetFrames( steps, false ); - this.bind(); // bind all binding + // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); - var firstValidIndex = this._targetGroup.nCachedObjects_, - binding = this._bindings[ firstValidIndex ]; + binormal = new Vector3(); + normal = new Vector3(); + position2 = new Vector3(); - // and only call .getValue on the first - if ( binding !== undefined ) binding.getValue( array, offset ); + } - }, + // Safeguards if bevels are not enabled - setValue: function ( array, offset ) { + if ( ! bevelEnabled ) { - var bindings = this._bindings; + bevelSegments = 0; + bevelThickness = 0; + bevelSize = 0; + bevelOffset = 0; - for ( var i = this._targetGroup.nCachedObjects_, - n = bindings.length; i !== n; ++ i ) { + } - bindings[ i ].setValue( array, offset ); + // Variables initialization - } + const shapePoints = shape.extractPoints( curveSegments ); - }, + let vertices = shapePoints.shape; + const holes = shapePoints.holes; - bind: function () { + const reverse = ! ShapeUtils.isClockWise( vertices ); - var bindings = this._bindings; + if ( reverse ) { - for ( var i = this._targetGroup.nCachedObjects_, - n = bindings.length; i !== n; ++ i ) { + vertices = vertices.reverse(); - bindings[ i ].bind(); + // Maybe we should also check if holes are in the opposite direction, just to be safe ... - } + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - }, + const ahole = holes[ h ]; - unbind: function () { + if ( ShapeUtils.isClockWise( ahole ) ) { - var bindings = this._bindings; + holes[ h ] = ahole.reverse(); - for ( var i = this._targetGroup.nCachedObjects_, - n = bindings.length; i !== n; ++ i ) { + } - bindings[ i ].unbind(); + } - } + } - } - } ); + const faces = ShapeUtils.triangulateShape( vertices, holes ); + /* Vertices */ - function PropertyBinding( rootNode, path, parsedPath ) { + const contour = vertices; // vertices has all points but contour has only points of circumference - this.path = path; - this.parsedPath = parsedPath || PropertyBinding.parseTrackName( path ); + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName ) || rootNode; + const ahole = holes[ h ]; - this.rootNode = rootNode; + vertices = vertices.concat( ahole ); - } + } - Object.assign( PropertyBinding, { - Composite: Composite, + function scalePt2( pt, vec, size ) { - create: function ( root, path, parsedPath ) { + if ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' ); - if ( ! ( root && root.isAnimationObjectGroup ) ) { + return pt.clone().addScaledVector( vec, size ); - return new PropertyBinding( root, path, parsedPath ); + } - } else { + const vlen = vertices.length, flen = faces.length; - return new PropertyBinding.Composite( root, path, parsedPath ); - } + // Find directions for point movement - }, - /** - * Replaces spaces with underscores and removes unsupported characters from - * node names, to ensure compatibility with parseTrackName(). - * - * @param {string} name Node name to be sanitized. - * @return {string} - */ - sanitizeNodeName: function ( name ) { + function getBevelVec( inPt, inPrev, inNext ) { - return name.replace( /\s/g, '_' ).replace( /[^\w-]/g, '' ); + // computes for inPt the corresponding point inPt' on a new contour + // shifted by 1 unit (length of normalized vector) to the left + // if we walk along contour clockwise, this new contour is outside the old one + // + // inPt' is the intersection of the two lines parallel to the two + // adjacent edges of inPt at a distance of 1 unit on the left side. - }, + let v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt - parseTrackName: function () { + // good reading for geometry algorithms (here: line-line intersection) + // http://geomalgorithms.com/a05-_intersect-1.html - // Parent directories, delimited by '/' or ':'. Currently unused, but must - // be matched to parse the rest of the track name. - var directoryRe = /((?:[\w-]+[\/:])*)/; + const v_prev_x = inPt.x - inPrev.x, + v_prev_y = inPt.y - inPrev.y; + const v_next_x = inNext.x - inPt.x, + v_next_y = inNext.y - inPt.y; - // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. - var nodeRe = /([\w-\.]+)?/; + const v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); - // Object on target node, and accessor. Name may contain only word - // characters. Accessor may contain any character except closing bracket. - var objectRe = /(?:\.([\w-]+)(?:\[(.+)\])?)?/; + // check for collinear edges + const collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - // Property and accessor. May contain only word characters. Accessor may - // contain any non-bracket characters. - var propertyRe = /\.([\w-]+)(?:\[(.+)\])?/; + if ( Math.abs( collinear0 ) > Number.EPSILON ) { - var trackRe = new RegExp('' - + '^' - + directoryRe.source - + nodeRe.source - + objectRe.source - + propertyRe.source - + '$' - ); + // not collinear - var supportedObjectNames = [ 'material', 'materials', 'bones' ]; + // length of vectors for normalizing - return function ( trackName ) { + const v_prev_len = Math.sqrt( v_prev_lensq ); + const v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); - var matches = trackRe.exec( trackName ); + // shift adjacent points by unit vectors to the left - if ( ! matches ) { + const ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); + const ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); - throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); + const ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); + const ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); - } + // scaling factor for v_prev to intersection point - var results = { - // directoryName: matches[ 1 ], // (tschw) currently unused - nodeName: matches[ 2 ], - objectName: matches[ 3 ], - objectIndex: matches[ 4 ], - propertyName: matches[ 5 ], // required - propertyIndex: matches[ 6 ] - }; + const sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - + ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / + ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); + // vector from inPt to intersection point - if ( lastDot !== undefined && lastDot !== -1 ) { + v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); + v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); - var objectName = results.nodeName.substring( lastDot + 1 ); + // Don't normalize!, otherwise sharp corners become ugly + // but prevent crazy spikes + const v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); + if ( v_trans_lensq <= 2 ) { - // Object names must be checked against a whitelist. Otherwise, there - // is no way to parse 'foo.bar.baz': 'baz' must be a property, but - // 'bar' could be the objectName, or part of a nodeName (which can - // include '.' characters). - if ( supportedObjectNames.indexOf( objectName ) !== -1 ) { + return new Vector2( v_trans_x, v_trans_y ); - results.nodeName = results.nodeName.substring( 0, lastDot ); - results.objectName = objectName; + } else { + + shrink_by = Math.sqrt( v_trans_lensq / 2 ); } - } + } else { - if ( results.propertyName === null || results.propertyName.length === 0 ) { + // handle special case of collinear edges - throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); + let direction_eq = false; // assumes: opposite - } + if ( v_prev_x > Number.EPSILON ) { - return results; + if ( v_next_x > Number.EPSILON ) { - }; + direction_eq = true; - }(), + } - findNode: function ( root, nodeName ) { + } else { - if ( ! nodeName || nodeName === "" || nodeName === "root" || nodeName === "." || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) { + if ( v_prev_x < - Number.EPSILON ) { - return root; + if ( v_next_x < - Number.EPSILON ) { - } + direction_eq = true; - // search into skeleton bones. - if ( root.skeleton ) { + } - var searchSkeleton = function ( skeleton ) { + } else { - for ( var i = 0; i < skeleton.bones.length; i ++ ) { + if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { - var bone = skeleton.bones[ i ]; + direction_eq = true; - if ( bone.name === nodeName ) { + } - return bone; + } } - } + if ( direction_eq ) { - return null; + // console.log("Warning: lines are a straight sequence"); + v_trans_x = - v_prev_y; + v_trans_y = v_prev_x; + shrink_by = Math.sqrt( v_prev_lensq ); - }; + } else { - var bone = searchSkeleton( root.skeleton ); + // console.log("Warning: lines are a straight spike"); + v_trans_x = v_prev_x; + v_trans_y = v_prev_y; + shrink_by = Math.sqrt( v_prev_lensq / 2 ); - if ( bone ) { + } - return bone; + } + + return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); } - } - // search into node subtree. - if ( root.children ) { + const contourMovements = []; - var searchNodeSubtree = function ( children ) { + for ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - for ( var i = 0; i < children.length; i ++ ) { + if ( j === il ) j = 0; + if ( k === il ) k = 0; - var childNode = children[ i ]; + // (j)---(i)---(k) + // console.log('i,j,k', i, j , k) - if ( childNode.name === nodeName || childNode.uuid === nodeName ) { + contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); - return childNode; + } - } + const holesMovements = []; + let oneHoleMovements, verticesMovements = contourMovements.concat(); - var result = searchNodeSubtree( childNode.children ); + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - if ( result ) return result; + const ahole = holes[ h ]; - } + oneHoleMovements = []; - return null; + for ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - }; + if ( j === il ) j = 0; + if ( k === il ) k = 0; - var subTreeNode = searchNodeSubtree( root.children ); + // (j)---(i)---(k) + oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); - if ( subTreeNode ) { + } - return subTreeNode; + holesMovements.push( oneHoleMovements ); + verticesMovements = verticesMovements.concat( oneHoleMovements ); } - } - return null; + // Loop bevelSegments, 1 for the front, 1 for the back - } + for ( let b = 0; b < bevelSegments; b ++ ) { - } ); + //for ( b = bevelSegments; b > 0; b -- ) { - Object.assign( PropertyBinding.prototype, { // prototype, continued + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - // these are used to "bind" a nonexistent property - _getValue_unavailable: function () {}, - _setValue_unavailable: function () {}, - - BindingType: { - Direct: 0, - EntireArray: 1, - ArrayElement: 2, - HasFromToArray: 3 - }, + // contract shape - Versioning: { - None: 0, - NeedsUpdate: 1, - MatrixWorldNeedsUpdate: 2 - }, + for ( let i = 0, il = contour.length; i < il; i ++ ) { + + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - GetterByBindingType: [ + v( vert.x, vert.y, - z ); - function getValue_direct( buffer, offset ) { + } - buffer[ offset ] = this.node[ this.propertyName ]; + // expand holes - }, + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - function getValue_array( buffer, offset ) { + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; - var source = this.resolvedProperty; + for ( let i = 0, il = ahole.length; i < il; i ++ ) { - for ( var i = 0, n = source.length; i !== n; ++ i ) { + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - buffer[ offset ++ ] = source[ i ]; + v( vert.x, vert.y, - z ); + + } + + } } - }, + const bs = bevelSize + bevelOffset; - function getValue_arrayElement( buffer, offset ) { + // Back facing vertices - buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ]; + for ( let i = 0; i < vlen; i ++ ) { - }, + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - function getValue_toArray( buffer, offset ) { + if ( ! extrudeByPath ) { - this.resolvedProperty.toArray( buffer, offset ); + v( vert.x, vert.y, 0 ); - } + } else { - ], + // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); - SetterByBindingTypeAndVersioning: [ + normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); - [ - // Direct + position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); - function setValue_direct( buffer, offset ) { + v( position2.x, position2.y, position2.z ); - this.node[ this.propertyName ] = buffer[ offset ]; + } - }, + } - function setValue_direct_setNeedsUpdate( buffer, offset ) { + // Add stepped vertices... + // Including front facing vertices - this.node[ this.propertyName ] = buffer[ offset ]; - this.targetObject.needsUpdate = true; + for ( let s = 1; s <= steps; s ++ ) { - }, + for ( let i = 0; i < vlen; i ++ ) { - function setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) { + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - this.node[ this.propertyName ] = buffer[ offset ]; - this.targetObject.matrixWorldNeedsUpdate = true; + if ( ! extrudeByPath ) { - } + v( vert.x, vert.y, depth / steps * s ); - ], [ + } else { - // EntireArray + // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); - function setValue_array( buffer, offset ) { + normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); - var dest = this.resolvedProperty; + position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); - for ( var i = 0, n = dest.length; i !== n; ++ i ) { + v( position2.x, position2.y, position2.z ); - dest[ i ] = buffer[ offset ++ ]; + } } - }, + } + + + // Add bevel segments planes - function setValue_array_setNeedsUpdate( buffer, offset ) { + //for ( b = 1; b <= bevelSegments; b ++ ) { + for ( let b = bevelSegments - 1; b >= 0; b -- ) { - var dest = this.resolvedProperty; + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - for ( var i = 0, n = dest.length; i !== n; ++ i ) { + // contract shape - dest[ i ] = buffer[ offset ++ ]; + for ( let i = 0, il = contour.length; i < il; i ++ ) { + + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + v( vert.x, vert.y, depth + z ); } - this.targetObject.needsUpdate = true; + // expand holes - }, + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - function setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) { + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; - var dest = this.resolvedProperty; + for ( let i = 0, il = ahole.length; i < il; i ++ ) { - for ( var i = 0, n = dest.length; i !== n; ++ i ) { + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - dest[ i ] = buffer[ offset ++ ]; + if ( ! extrudeByPath ) { - } + v( vert.x, vert.y, depth + z ); + + } else { + + v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); + + } - this.targetObject.matrixWorldNeedsUpdate = true; + } + + } } - ], [ + /* Faces */ - // ArrayElement + // Top and bottom faces - function setValue_arrayElement( buffer, offset ) { + buildLidFaces(); - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + // Sides faces - }, + buildSideFaces(); - function setValue_arrayElement_setNeedsUpdate( buffer, offset ) { - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; - this.targetObject.needsUpdate = true; + ///// Internal functions - }, + function buildLidFaces() { - function setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) { + const start = verticesArray.length / 3; - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; - this.targetObject.matrixWorldNeedsUpdate = true; + if ( bevelEnabled ) { - } + let layer = 0; // steps + 1 + let offset = vlen * layer; - ], [ + // Bottom faces - // HasToFromArray + for ( let i = 0; i < flen; i ++ ) { - function setValue_fromArray( buffer, offset ) { + const face = faces[ i ]; + f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); - this.resolvedProperty.fromArray( buffer, offset ); + } - }, + layer = steps + bevelSegments * 2; + offset = vlen * layer; - function setValue_fromArray_setNeedsUpdate( buffer, offset ) { + // Top faces - this.resolvedProperty.fromArray( buffer, offset ); - this.targetObject.needsUpdate = true; + for ( let i = 0; i < flen; i ++ ) { - }, + const face = faces[ i ]; + f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); - function setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) { + } - this.resolvedProperty.fromArray( buffer, offset ); - this.targetObject.matrixWorldNeedsUpdate = true; + } else { - } + // Bottom faces - ] + for ( let i = 0; i < flen; i ++ ) { - ], + const face = faces[ i ]; + f3( face[ 2 ], face[ 1 ], face[ 0 ] ); - getValue: function getValue_unbound( targetArray, offset ) { + } - this.bind(); - this.getValue( targetArray, offset ); + // Top faces - // Note: This class uses a State pattern on a per-method basis: - // 'bind' sets 'this.getValue' / 'setValue' and shadows the - // prototype version of these methods with one that represents - // the bound state. When the property is not found, the methods - // become no-ops. + for ( let i = 0; i < flen; i ++ ) { - }, + const face = faces[ i ]; + f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); - setValue: function getValue_unbound( sourceArray, offset ) { + } - this.bind(); - this.setValue( sourceArray, offset ); + } - }, + scope.addGroup( start, verticesArray.length / 3 - start, 0 ); - // create getter / setter pair for a property in the scene graph - bind: function () { + } - var targetObject = this.node, - parsedPath = this.parsedPath, + // Create faces for the z-sides of the shape - objectName = parsedPath.objectName, - propertyName = parsedPath.propertyName, - propertyIndex = parsedPath.propertyIndex; + function buildSideFaces() { - if ( ! targetObject ) { + const start = verticesArray.length / 3; + let layeroffset = 0; + sidewalls( contour, layeroffset ); + layeroffset += contour.length; - targetObject = PropertyBinding.findNode( - this.rootNode, parsedPath.nodeName ) || this.rootNode; + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - this.node = targetObject; + const ahole = holes[ h ]; + sidewalls( ahole, layeroffset ); - } + //, true + layeroffset += ahole.length; - // set fail state so we can just 'return' on error - this.getValue = this._getValue_unavailable; - this.setValue = this._setValue_unavailable; + } - // ensure there is a value node - if ( ! targetObject ) { - console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); - return; + scope.addGroup( start, verticesArray.length / 3 - start, 1 ); - } - if ( objectName ) { + } - var objectIndex = parsedPath.objectIndex; + function sidewalls( contour, layeroffset ) { - // special cases were we need to reach deeper into the hierarchy to get the face materials.... - switch ( objectName ) { + let i = contour.length; - case 'materials': + while ( -- i >= 0 ) { - if ( ! targetObject.material ) { + const j = i; + let k = i - 1; + if ( k < 0 ) k = contour.length - 1; - console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ); - return; + //console.log('b', i,j, i-1, k,vertices.length); - } + for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { - if ( ! targetObject.material.materials ) { + const slen1 = vlen * s; + const slen2 = vlen * ( s + 1 ); - console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this ); - return; + const a = layeroffset + j + slen1, + b = layeroffset + k + slen1, + c = layeroffset + k + slen2, + d = layeroffset + j + slen2; - } + f4( a, b, c, d ); - targetObject = targetObject.material.materials; + } - break; + } - case 'bones': + } - if ( ! targetObject.skeleton ) { + function v( x, y, z ) { - console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this ); - return; + placeholder.push( x ); + placeholder.push( y ); + placeholder.push( z ); - } + } - // potential future optimization: skip this if propertyIndex is already an integer - // and convert the integer string to a true integer. - targetObject = targetObject.skeleton.bones; + function f3( a, b, c ) { - // support resolving morphTarget names into indices. - for ( var i = 0; i < targetObject.length; i ++ ) { + addVertex( a ); + addVertex( b ); + addVertex( c ); - if ( targetObject[ i ].name === objectIndex ) { + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - objectIndex = i; - break; + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); - } + } - } + function f4( a, b, c, d ) { - break; + addVertex( a ); + addVertex( b ); + addVertex( d ); - default: + addVertex( b ); + addVertex( c ); + addVertex( d ); - if ( targetObject[ objectName ] === undefined ) { - console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this ); - return; + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - } + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 3 ] ); - targetObject = targetObject[ objectName ]; + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); + addUV( uvs[ 3 ] ); } + function addVertex( index ) { - if ( objectIndex !== undefined ) { + verticesArray.push( placeholder[ index * 3 + 0 ] ); + verticesArray.push( placeholder[ index * 3 + 1 ] ); + verticesArray.push( placeholder[ index * 3 + 2 ] ); - if ( targetObject[ objectIndex ] === undefined ) { + } - console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject ); - return; - } + function addUV( vector2 ) { - targetObject = targetObject[ objectIndex ]; + uvArray.push( vector2.x ); + uvArray.push( vector2.y ); } } - // resolve property - var nodeProperty = targetObject[ propertyName ]; + } - if ( nodeProperty === undefined ) { + copy( source ) { - var nodeName = parsedPath.nodeName; + super.copy( source ); - console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName + - '.' + propertyName + ' but it wasn\'t found.', targetObject ); - return; + this.parameters = Object.assign( {}, source.parameters ); - } + return this; - // determine versioning scheme - var versioning = this.Versioning.None; + } - if ( targetObject.needsUpdate !== undefined ) { // material + toJSON() { - versioning = this.Versioning.NeedsUpdate; - this.targetObject = targetObject; + const data = super.toJSON(); - } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform + const shapes = this.parameters.shapes; + const options = this.parameters.options; - versioning = this.Versioning.MatrixWorldNeedsUpdate; - this.targetObject = targetObject; + return toJSON$1( shapes, options, data ); - } + } - // determine how the property gets bound - var bindingType = this.BindingType.Direct; + static fromJSON( data, shapes ) { - if ( propertyIndex !== undefined ) { + const geometryShapes = []; - // access a sub element of the property array (only primitives are supported right now) + for ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) { - if ( propertyName === "morphTargetInfluences" ) { + const shape = shapes[ data.shapes[ j ] ]; - // potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer. + geometryShapes.push( shape ); - // support resolving morphTarget names into indices. - if ( ! targetObject.geometry ) { + } - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this ); - return; + const extrudePath = data.options.extrudePath; - } + if ( extrudePath !== undefined ) { - if ( targetObject.geometry.isBufferGeometry ) { + data.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath ); - if ( ! targetObject.geometry.morphAttributes ) { + } - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this ); - return; + return new ExtrudeGeometry( geometryShapes, data.options ); - } + } - for ( var i = 0; i < this.node.geometry.morphAttributes.position.length; i ++ ) { + } - if ( targetObject.geometry.morphAttributes.position[ i ].name === propertyIndex ) { + const WorldUVGenerator = { - propertyIndex = i; - break; + generateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) { - } + const a_x = vertices[ indexA * 3 ]; + const a_y = vertices[ indexA * 3 + 1 ]; + const b_x = vertices[ indexB * 3 ]; + const b_y = vertices[ indexB * 3 + 1 ]; + const c_x = vertices[ indexC * 3 ]; + const c_y = vertices[ indexC * 3 + 1 ]; - } + return [ + new Vector2( a_x, a_y ), + new Vector2( b_x, b_y ), + new Vector2( c_x, c_y ) + ]; + }, - } else { + generateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) { - if ( ! targetObject.geometry.morphTargets ) { + const a_x = vertices[ indexA * 3 ]; + const a_y = vertices[ indexA * 3 + 1 ]; + const a_z = vertices[ indexA * 3 + 2 ]; + const b_x = vertices[ indexB * 3 ]; + const b_y = vertices[ indexB * 3 + 1 ]; + const b_z = vertices[ indexB * 3 + 2 ]; + const c_x = vertices[ indexC * 3 ]; + const c_y = vertices[ indexC * 3 + 1 ]; + const c_z = vertices[ indexC * 3 + 2 ]; + const d_x = vertices[ indexD * 3 ]; + const d_y = vertices[ indexD * 3 + 1 ]; + const d_z = vertices[ indexD * 3 + 2 ]; + + if ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) { - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.', this ); - return; + return [ + new Vector2( a_x, 1 - a_z ), + new Vector2( b_x, 1 - b_z ), + new Vector2( c_x, 1 - c_z ), + new Vector2( d_x, 1 - d_z ) + ]; - } + } else { - for ( var i = 0; i < this.node.geometry.morphTargets.length; i ++ ) { + return [ + new Vector2( a_y, 1 - a_z ), + new Vector2( b_y, 1 - b_z ), + new Vector2( c_y, 1 - c_z ), + new Vector2( d_y, 1 - d_z ) + ]; - if ( targetObject.geometry.morphTargets[ i ].name === propertyIndex ) { + } - propertyIndex = i; - break; + } - } + }; - } + function toJSON$1( shapes, options, data ) { - } + data.shapes = []; - } + if ( Array.isArray( shapes ) ) { - bindingType = this.BindingType.ArrayElement; + for ( let i = 0, l = shapes.length; i < l; i ++ ) { - this.resolvedProperty = nodeProperty; - this.propertyIndex = propertyIndex; + const shape = shapes[ i ]; - } else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) { + data.shapes.push( shape.uuid ); - // must use copy for Object3D.Euler/Quaternion + } - bindingType = this.BindingType.HasFromToArray; + } else { - this.resolvedProperty = nodeProperty; + data.shapes.push( shapes.uuid ); - } else if ( Array.isArray( nodeProperty ) ) { + } - bindingType = this.BindingType.EntireArray; + data.options = Object.assign( {}, options ); - this.resolvedProperty = nodeProperty; + if ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON(); - } else { + return data; - this.propertyName = propertyName; + } - } + class IcosahedronGeometry extends PolyhedronGeometry { - // select getter / setter - this.getValue = this.GetterByBindingType[ bindingType ]; - this.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ]; + constructor( radius = 1, detail = 0 ) { - }, + const t = ( 1 + Math.sqrt( 5 ) ) / 2; - unbind: function () { + const vertices = [ + - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, + 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, + t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 + ]; - this.node = null; + const indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, + 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, + 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, + 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 + ]; - // back to the prototype version of getValue / setValue - // note: avoiding to mutate the shape of 'this' via 'delete' - this.getValue = this._getValue_unbound; - this.setValue = this._setValue_unbound; + super( vertices, indices, radius, detail ); - } + this.type = 'IcosahedronGeometry'; - } ); + this.parameters = { + radius: radius, + detail: detail + }; - //!\ DECLARE ALIAS AFTER assign prototype ! - Object.assign( PropertyBinding.prototype, { + } - // initial state of these methods that calls 'bind' - _getValue_unbound: PropertyBinding.prototype.getValue, - _setValue_unbound: PropertyBinding.prototype.setValue, + static fromJSON( data ) { - } ); + return new IcosahedronGeometry( data.radius, data.detail ); - /** - * - * A group of objects that receives a shared animation state. - * - * Usage: - * - * - Add objects you would otherwise pass as 'root' to the - * constructor or the .clipAction method of AnimationMixer. - * - * - Instead pass this object as 'root'. - * - * - You can also add and remove objects later when the mixer - * is running. - * - * Note: - * - * Objects of this class appear as one object to the mixer, - * so cache control of the individual objects must be done - * on the group. - * - * Limitation: - * - * - The animated properties must be compatible among the - * all objects in the group. - * - * - A single property can either be controlled through a - * target group or directly, but not both. - * - * @author tschw - */ + } + + } - function AnimationObjectGroup( var_args ) { + class OctahedronGeometry extends PolyhedronGeometry { - this.uuid = _Math.generateUUID(); + constructor( radius = 1, detail = 0 ) { - // cached objects followed by the active ones - this._objects = Array.prototype.slice.call( arguments ); + const vertices = [ + 1, 0, 0, - 1, 0, 0, 0, 1, 0, + 0, - 1, 0, 0, 0, 1, 0, 0, - 1 + ]; - this.nCachedObjects_ = 0; // threshold - // note: read by PropertyBinding.Composite + const indices = [ + 0, 2, 4, 0, 4, 3, 0, 3, 5, + 0, 5, 2, 1, 2, 5, 1, 5, 3, + 1, 3, 4, 1, 4, 2 + ]; - var indices = {}; - this._indicesByUUID = indices; // for bookkeeping + super( vertices, indices, radius, detail ); - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + this.type = 'OctahedronGeometry'; - indices[ arguments[ i ].uuid ] = i; + this.parameters = { + radius: radius, + detail: detail + }; } - this._paths = []; // inside: string - this._parsedPaths = []; // inside: { we don't care, here } - this._bindings = []; // inside: Array< PropertyBinding > - this._bindingsIndicesByPath = {}; // inside: indices in these arrays + static fromJSON( data ) { - var scope = this; + return new OctahedronGeometry( data.radius, data.detail ); - this.stats = { + } - objects: { - get total() { return scope._objects.length; }, - get inUse() { return this.total - scope.nCachedObjects_; } - }, + } - get bindingsPerObject() { return scope._bindings.length; } + class RingGeometry extends BufferGeometry { - }; + constructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) { - } + super(); - Object.assign( AnimationObjectGroup.prototype, { + this.type = 'RingGeometry'; - isAnimationObjectGroup: true, + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - add: function( var_args ) { + thetaSegments = Math.max( 3, thetaSegments ); + phiSegments = Math.max( 1, phiSegments ); - var objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - paths = this._paths, - parsedPaths = this._parsedPaths, - bindings = this._bindings, - nBindings = bindings.length; + // buffers - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ], - knownObject = undefined; + // some helper variables - if ( index === undefined ) { + let radius = innerRadius; + const radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); + const vertex = new Vector3(); + const uv = new Vector2(); - // unknown object -> add it to the ACTIVE region + // generate vertices, normals and uvs - index = nObjects ++; - indicesByUUID[ uuid ] = index; - objects.push( object ); + for ( let j = 0; j <= phiSegments; j ++ ) { - // accounting is done, now do the same for all bindings + for ( let i = 0; i <= thetaSegments; i ++ ) { - for ( var j = 0, m = nBindings; j !== m; ++ j ) { + // values are generate from the inside of the ring to the outside - bindings[ j ].push( - new PropertyBinding( - object, paths[ j ], parsedPaths[ j ] ) ); + const segment = thetaStart + i / thetaSegments * thetaLength; - } + // vertex - } else if ( index < nCachedObjects ) { + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - knownObject = objects[ index ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - // move existing object to the ACTIVE region + // normal - var firstActiveIndex = -- nCachedObjects, - lastCachedObject = objects[ firstActiveIndex ]; + normals.push( 0, 0, 1 ); - indicesByUUID[ lastCachedObject.uuid ] = index; - objects[ index ] = lastCachedObject; + // uv - indicesByUUID[ uuid ] = firstActiveIndex; - objects[ firstActiveIndex ] = object; + uv.x = ( vertex.x / outerRadius + 1 ) / 2; + uv.y = ( vertex.y / outerRadius + 1 ) / 2; - // accounting is done, now do the same for all bindings + uvs.push( uv.x, uv.y ); - for ( var j = 0, m = nBindings; j !== m; ++ j ) { + } - var bindingsForPath = bindings[ j ], - lastCached = bindingsForPath[ firstActiveIndex ], - binding = bindingsForPath[ index ]; + // increase the radius for next row of vertices - bindingsForPath[ index ] = lastCached; + radius += radiusStep; - if ( binding === undefined ) { + } - // since we do not bother to create new bindings - // for objects that are cached, the binding may - // or may not exist + // indices - binding = new PropertyBinding( - object, paths[ j ], parsedPaths[ j ] ); + for ( let j = 0; j < phiSegments; j ++ ) { - } + const thetaSegmentLevel = j * ( thetaSegments + 1 ); - bindingsForPath[ firstActiveIndex ] = binding; + for ( let i = 0; i < thetaSegments; i ++ ) { - } + const segment = i + thetaSegmentLevel; - } else if ( objects[ index ] !== knownObject ) { + const a = segment; + const b = segment + thetaSegments + 1; + const c = segment + thetaSegments + 2; + const d = segment + 1; - console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' + - 'detected. Clean the caches or recreate your infrastructure when reloading scenes.' ); + // faces - } // else the object is already where we want it to be + indices.push( a, b, d ); + indices.push( b, c, d ); - } // for arguments + } - this.nCachedObjects_ = nCachedObjects; + } - }, + // build geometry - remove: function( var_args ) { + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - var objects = this._objects, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - bindings = this._bindings, - nBindings = bindings.length; + } - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + copy( source ) { - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ]; + super.copy( source ); - if ( index !== undefined && index >= nCachedObjects ) { + this.parameters = Object.assign( {}, source.parameters ); - // move existing object into the CACHED region + return this; - var lastCachedIndex = nCachedObjects ++, - firstActiveObject = objects[ lastCachedIndex ]; + } - indicesByUUID[ firstActiveObject.uuid ] = index; - objects[ index ] = firstActiveObject; + static fromJSON( data ) { - indicesByUUID[ uuid ] = lastCachedIndex; - objects[ lastCachedIndex ] = object; + return new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength ); - // accounting is done, now do the same for all bindings + } - for ( var j = 0, m = nBindings; j !== m; ++ j ) { + } - var bindingsForPath = bindings[ j ], - firstActive = bindingsForPath[ lastCachedIndex ], - binding = bindingsForPath[ index ]; + class ShapeGeometry extends BufferGeometry { - bindingsForPath[ index ] = firstActive; - bindingsForPath[ lastCachedIndex ] = binding; + constructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) { - } + super(); - } + this.type = 'ShapeGeometry'; - } // for arguments + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; - this.nCachedObjects_ = nCachedObjects; + // buffers - }, + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // remove & forget - uncache: function( var_args ) { + // helper variables - var objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - bindings = this._bindings, - nBindings = bindings.length; + let groupStart = 0; + let groupCount = 0; - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + // allow single and array values for "shapes" parameter - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ]; + if ( Array.isArray( shapes ) === false ) { - if ( index !== undefined ) { + addShape( shapes ); - delete indicesByUUID[ uuid ]; + } else { - if ( index < nCachedObjects ) { + for ( let i = 0; i < shapes.length; i ++ ) { - // object is cached, shrink the CACHED region + addShape( shapes[ i ] ); - var firstActiveIndex = -- nCachedObjects, - lastCachedObject = objects[ firstActiveIndex ], - lastIndex = -- nObjects, - lastObject = objects[ lastIndex ]; + this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support - // last cached object takes this object's place - indicesByUUID[ lastCachedObject.uuid ] = index; - objects[ index ] = lastCachedObject; + groupStart += groupCount; + groupCount = 0; - // last object goes to the activated slot and pop - indicesByUUID[ lastObject.uuid ] = firstActiveIndex; - objects[ firstActiveIndex ] = lastObject; - objects.pop(); + } - // accounting is done, now do the same for all bindings + } - for ( var j = 0, m = nBindings; j !== m; ++ j ) { + // build geometry - var bindingsForPath = bindings[ j ], - lastCached = bindingsForPath[ firstActiveIndex ], - last = bindingsForPath[ lastIndex ]; + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - bindingsForPath[ index ] = lastCached; - bindingsForPath[ firstActiveIndex ] = last; - bindingsForPath.pop(); - } + // helper functions - } else { + function addShape( shape ) { - // object is active, just swap with the last and pop + const indexOffset = vertices.length / 3; + const points = shape.extractPoints( curveSegments ); - var lastIndex = -- nObjects, - lastObject = objects[ lastIndex ]; + let shapeVertices = points.shape; + const shapeHoles = points.holes; - indicesByUUID[ lastObject.uuid ] = index; - objects[ index ] = lastObject; - objects.pop(); + // check direction of vertices - // accounting is done, now do the same for all bindings + if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { - for ( var j = 0, m = nBindings; j !== m; ++ j ) { + shapeVertices = shapeVertices.reverse(); - var bindingsForPath = bindings[ j ]; + } - bindingsForPath[ index ] = bindingsForPath[ lastIndex ]; - bindingsForPath.pop(); + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { - } + const shapeHole = shapeHoles[ i ]; - } // cached or active + if ( ShapeUtils.isClockWise( shapeHole ) === true ) { - } // if object is known + shapeHoles[ i ] = shapeHole.reverse(); - } // for arguments + } - this.nCachedObjects_ = nCachedObjects; + } - }, + const faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); - // Internal interface used by befriended PropertyBinding.Composite: + // join vertices of inner and outer paths to a single array - subscribe_: function ( path, parsedPath ) { + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { - // returns an array of bindings for the given path that is changed - // according to the contained objects in the group + const shapeHole = shapeHoles[ i ]; + shapeVertices = shapeVertices.concat( shapeHole ); - var indicesByPath = this._bindingsIndicesByPath, - index = indicesByPath[ path ], - bindings = this._bindings; + } - if ( index !== undefined ) return bindings[ index ]; + // vertices, normals, uvs - var paths = this._paths, - parsedPaths = this._parsedPaths, - objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - bindingsForPath = new Array( nObjects ); + for ( let i = 0, l = shapeVertices.length; i < l; i ++ ) { - index = bindings.length; + const vertex = shapeVertices[ i ]; - indicesByPath[ path ] = index; + vertices.push( vertex.x, vertex.y, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( vertex.x, vertex.y ); // world uvs - paths.push( path ); - parsedPaths.push( parsedPath ); - bindings.push( bindingsForPath ); + } - for ( var i = nCachedObjects, n = objects.length; i !== n; ++ i ) { + // indices - var object = objects[ i ]; - bindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath ); + for ( let i = 0, l = faces.length; i < l; i ++ ) { - } + const face = faces[ i ]; - return bindingsForPath; + const a = face[ 0 ] + indexOffset; + const b = face[ 1 ] + indexOffset; + const c = face[ 2 ] + indexOffset; - }, + indices.push( a, b, c ); + groupCount += 3; - unsubscribe_: function ( path ) { + } - // tells the group to forget about a property path and no longer - // update the array previously obtained with 'subscribe_' + } - var indicesByPath = this._bindingsIndicesByPath, - index = indicesByPath[ path ]; + } - if ( index !== undefined ) { + copy( source ) { - var paths = this._paths, - parsedPaths = this._parsedPaths, - bindings = this._bindings, - lastBindingsIndex = bindings.length - 1, - lastBindings = bindings[ lastBindingsIndex ], - lastBindingsPath = path[ lastBindingsIndex ]; + super.copy( source ); - indicesByPath[ lastBindingsPath ] = index; + this.parameters = Object.assign( {}, source.parameters ); - bindings[ index ] = lastBindings; - bindings.pop(); + return this; - parsedPaths[ index ] = parsedPaths[ lastBindingsIndex ]; - parsedPaths.pop(); + } - paths[ index ] = paths[ lastBindingsIndex ]; - paths.pop(); + toJSON() { - } + const data = super.toJSON(); - } + const shapes = this.parameters.shapes; - } ); + return toJSON( shapes, data ); - /** - * - * Action provided by AnimationMixer for scheduling clip playback on specific - * objects. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - * - */ + } - function AnimationAction( mixer, clip, localRoot ) { + static fromJSON( data, shapes ) { - this._mixer = mixer; - this._clip = clip; - this._localRoot = localRoot || null; + const geometryShapes = []; - var tracks = clip.tracks, - nTracks = tracks.length, - interpolants = new Array( nTracks ); + for ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) { - var interpolantSettings = { - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding - }; + const shape = shapes[ data.shapes[ j ] ]; + + geometryShapes.push( shape ); - for ( var i = 0; i !== nTracks; ++ i ) { + } - var interpolant = tracks[ i ].createInterpolant( null ); - interpolants[ i ] = interpolant; - interpolant.settings = interpolantSettings; + return new ShapeGeometry( geometryShapes, data.curveSegments ); } - this._interpolantSettings = interpolantSettings; + } - this._interpolants = interpolants; // bound by the mixer + function toJSON( shapes, data ) { - // inside: PropertyMixer (managed by the mixer) - this._propertyBindings = new Array( nTracks ); + data.shapes = []; - this._cacheIndex = null; // for the memory manager - this._byClipCacheIndex = null; // for the memory manager + if ( Array.isArray( shapes ) ) { - this._timeScaleInterpolant = null; - this._weightInterpolant = null; + for ( let i = 0, l = shapes.length; i < l; i ++ ) { - this.loop = LoopRepeat; - this._loopCount = -1; + const shape = shapes[ i ]; - // global mixer time when the action is to be started - // it's set back to 'null' upon start of the action - this._startTime = null; + data.shapes.push( shape.uuid ); - // scaled local time of the action - // gets clamped or wrapped to 0..clip.duration according to loop - this.time = 0; + } - this.timeScale = 1; - this._effectiveTimeScale = 1; + } else { - this.weight = 1; - this._effectiveWeight = 1; + data.shapes.push( shapes.uuid ); - this.repetitions = Infinity; // no. of repetitions when looping + } - this.paused = false; // true -> zero effective time scale - this.enabled = true; // false -> zero effective weight + return data; - this.clampWhenFinished = false; // keep feeding the last frame? + } - this.zeroSlopeAtStart = true; // for smooth interpolation w/o separate - this.zeroSlopeAtEnd = true; // clips for start, loop and end + class SphereGeometry extends BufferGeometry { - } + constructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) { - Object.assign( AnimationAction.prototype, { + super(); - // State & Scheduling + this.type = 'SphereGeometry'; - play: function() { + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this._mixer._activateAction( this ); + widthSegments = Math.max( 3, Math.floor( widthSegments ) ); + heightSegments = Math.max( 2, Math.floor( heightSegments ) ); - return this; + const thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); - }, + let index = 0; + const grid = []; - stop: function() { + const vertex = new Vector3(); + const normal = new Vector3(); - this._mixer._deactivateAction( this ); + // buffers - return this.reset(); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - }, + // generate vertices, normals and uvs - reset: function() { + for ( let iy = 0; iy <= heightSegments; iy ++ ) { - this.paused = false; - this.enabled = true; + const verticesRow = []; - this.time = 0; // restart clip - this._loopCount = -1; // forget previous loops - this._startTime = null; // forget scheduling + const v = iy / heightSegments; - return this.stopFading().stopWarping(); + // special case for the poles - }, + let uOffset = 0; - isRunning: function() { + if ( iy === 0 && thetaStart === 0 ) { - return this.enabled && ! this.paused && this.timeScale !== 0 && - this._startTime === null && this._mixer._isActiveAction( this ); + uOffset = 0.5 / widthSegments; - }, + } else if ( iy === heightSegments && thetaEnd === Math.PI ) { - // return true when play has been called - isScheduled: function() { + uOffset = - 0.5 / widthSegments; - return this._mixer._isActiveAction( this ); + } - }, + for ( let ix = 0; ix <= widthSegments; ix ++ ) { - startAt: function( time ) { + const u = ix / widthSegments; - this._startTime = time; + // vertex - return this; + vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); + vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - }, + vertices.push( vertex.x, vertex.y, vertex.z ); - setLoop: function( mode, repetitions ) { + // normal - this.loop = mode; - this.repetitions = repetitions; + normal.copy( vertex ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - return this; + // uv - }, + uvs.push( u + uOffset, 1 - v ); - // Weight + verticesRow.push( index ++ ); - // set the weight stopping any scheduled fading - // although .enabled = false yields an effective weight of zero, this - // method does *not* change .enabled, because it would be confusing - setEffectiveWeight: function( weight ) { + } - this.weight = weight; + grid.push( verticesRow ); - // note: same logic as when updated at runtime - this._effectiveWeight = this.enabled ? weight : 0; + } - return this.stopFading(); + // indices - }, + for ( let iy = 0; iy < heightSegments; iy ++ ) { - // return the weight considering fading and .enabled - getEffectiveWeight: function() { + for ( let ix = 0; ix < widthSegments; ix ++ ) { - return this._effectiveWeight; + const a = grid[ iy ][ ix + 1 ]; + const b = grid[ iy ][ ix ]; + const c = grid[ iy + 1 ][ ix ]; + const d = grid[ iy + 1 ][ ix + 1 ]; - }, + if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); + if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); - fadeIn: function( duration ) { + } - return this._scheduleFading( duration, 0, 1 ); + } - }, + // build geometry - fadeOut: function( duration ) { + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - return this._scheduleFading( duration, 1, 0 ); + } - }, + copy( source ) { - crossFadeFrom: function( fadeOutAction, duration, warp ) { + super.copy( source ); - fadeOutAction.fadeOut( duration ); - this.fadeIn( duration ); + this.parameters = Object.assign( {}, source.parameters ); - if( warp ) { + return this; - var fadeInDuration = this._clip.duration, - fadeOutDuration = fadeOutAction._clip.duration, + } - startEndRatio = fadeOutDuration / fadeInDuration, - endStartRatio = fadeInDuration / fadeOutDuration; + static fromJSON( data ) { - fadeOutAction.warp( 1.0, startEndRatio, duration ); - this.warp( endStartRatio, 1.0, duration ); + return new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength ); - } + } - return this; + } - }, + class TetrahedronGeometry extends PolyhedronGeometry { - crossFadeTo: function( fadeInAction, duration, warp ) { + constructor( radius = 1, detail = 0 ) { - return fadeInAction.crossFadeFrom( this, duration, warp ); + const vertices = [ + 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 + ]; - }, + const indices = [ + 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 + ]; - stopFading: function() { + super( vertices, indices, radius, detail ); - var weightInterpolant = this._weightInterpolant; + this.type = 'TetrahedronGeometry'; - if ( weightInterpolant !== null ) { + this.parameters = { + radius: radius, + detail: detail + }; - this._weightInterpolant = null; - this._mixer._takeBackControlInterpolant( weightInterpolant ); + } - } + static fromJSON( data ) { - return this; + return new TetrahedronGeometry( data.radius, data.detail ); - }, + } - // Time Scale Control + } - // set the time scale stopping any scheduled warping - // although .paused = true yields an effective time scale of zero, this - // method does *not* change .paused, because it would be confusing - setEffectiveTimeScale: function( timeScale ) { + class TorusGeometry extends BufferGeometry { - this.timeScale = timeScale; - this._effectiveTimeScale = this.paused ? 0 :timeScale; + constructor( radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2 ) { - return this.stopWarping(); + super(); - }, + this.type = 'TorusGeometry'; - // return the time scale considering warping and .paused - getEffectiveTimeScale: function() { + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; - return this._effectiveTimeScale; + radialSegments = Math.floor( radialSegments ); + tubularSegments = Math.floor( tubularSegments ); - }, + // buffers - setDuration: function( duration ) { + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - this.timeScale = this._clip.duration / duration; + // helper variables - return this.stopWarping(); + const center = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); - }, + // generate vertices, normals and uvs - syncWith: function( action ) { + for ( let j = 0; j <= radialSegments; j ++ ) { - this.time = action.time; - this.timeScale = action.timeScale; + for ( let i = 0; i <= tubularSegments; i ++ ) { - return this.stopWarping(); + const u = i / tubularSegments * arc; + const v = j / radialSegments * Math.PI * 2; - }, + // vertex - halt: function( duration ) { + vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + vertex.z = tube * Math.sin( v ); - return this.warp( this._effectiveTimeScale, 0, duration ); + vertices.push( vertex.x, vertex.y, vertex.z ); - }, + // normal - warp: function( startTimeScale, endTimeScale, duration ) { + center.x = radius * Math.cos( u ); + center.y = radius * Math.sin( u ); + normal.subVectors( vertex, center ).normalize(); - var mixer = this._mixer, now = mixer.time, - interpolant = this._timeScaleInterpolant, + normals.push( normal.x, normal.y, normal.z ); - timeScale = this.timeScale; + // uv - if ( interpolant === null ) { + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); - interpolant = mixer._lendControlInterpolant(); - this._timeScaleInterpolant = interpolant; + } } - var times = interpolant.parameterPositions, - values = interpolant.sampleValues; - - times[ 0 ] = now; - times[ 1 ] = now + duration; + // generate indices - values[ 0 ] = startTimeScale / timeScale; - values[ 1 ] = endTimeScale / timeScale; + for ( let j = 1; j <= radialSegments; j ++ ) { - return this; + for ( let i = 1; i <= tubularSegments; i ++ ) { - }, + // indices - stopWarping: function() { + const a = ( tubularSegments + 1 ) * j + i - 1; + const b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; + const c = ( tubularSegments + 1 ) * ( j - 1 ) + i; + const d = ( tubularSegments + 1 ) * j + i; - var timeScaleInterpolant = this._timeScaleInterpolant; + // faces - if ( timeScaleInterpolant !== null ) { + indices.push( a, b, d ); + indices.push( b, c, d ); - this._timeScaleInterpolant = null; - this._mixer._takeBackControlInterpolant( timeScaleInterpolant ); + } } - return this; + // build geometry - }, + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - // Object Accessors + } - getMixer: function() { + copy( source ) { - return this._mixer; + super.copy( source ); - }, + this.parameters = Object.assign( {}, source.parameters ); - getClip: function() { + return this; - return this._clip; + } - }, + static fromJSON( data ) { - getRoot: function() { + return new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc ); - return this._localRoot || this._mixer._root; + } - }, + } - // Interna + class TorusKnotGeometry extends BufferGeometry { - _update: function( time, deltaTime, timeDirection, accuIndex ) { + constructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) { - // called by the mixer + super(); - if ( ! this.enabled ) { + this.type = 'TorusKnotGeometry'; - // call ._updateWeight() to update ._effectiveWeight + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; - this._updateWeight( time ); - return; + tubularSegments = Math.floor( tubularSegments ); + radialSegments = Math.floor( radialSegments ); - } + // buffers - var startTime = this._startTime; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - if ( startTime !== null ) { + // helper variables - // check for scheduled start of action + const vertex = new Vector3(); + const normal = new Vector3(); - var timeRunning = ( time - startTime ) * timeDirection; - if ( timeRunning < 0 || timeDirection === 0 ) { + const P1 = new Vector3(); + const P2 = new Vector3(); - return; // yet to come / don't decide when delta = 0 + const B = new Vector3(); + const T = new Vector3(); + const N = new Vector3(); - } + // generate vertices, normals and uvs - // start + for ( let i = 0; i <= tubularSegments; ++ i ) { - this._startTime = null; // unschedule - deltaTime = timeDirection * timeRunning; + // the radian "u" is used to calculate the position on the torus curve of the current tubular segment - } + const u = i / tubularSegments * p * Math.PI * 2; - // apply time scale and advance time + // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. + // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions - deltaTime *= this._updateTimeScale( time ); - var clipTime = this._updateTime( deltaTime ); + calculatePositionOnCurve( u, p, q, radius, P1 ); + calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); - // note: _updateTime may disable the action resulting in - // an effective weight of 0 + // calculate orthonormal basis - var weight = this._updateWeight( time ); + T.subVectors( P2, P1 ); + N.addVectors( P2, P1 ); + B.crossVectors( T, N ); + N.crossVectors( B, T ); - if ( weight > 0 ) { + // normalize B, N. T can be ignored, we don't use it - var interpolants = this._interpolants; - var propertyMixers = this._propertyBindings; + B.normalize(); + N.normalize(); - for ( var j = 0, m = interpolants.length; j !== m; ++ j ) { + for ( let j = 0; j <= radialSegments; ++ j ) { - interpolants[ j ].evaluate( clipTime ); - propertyMixers[ j ].accumulate( accuIndex, weight ); + // now calculate the vertices. they are nothing more than an extrusion of the torus curve. + // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. - } + const v = j / radialSegments * Math.PI * 2; + const cx = - tube * Math.cos( v ); + const cy = tube * Math.sin( v ); - } + // now calculate the final vertex position. + // first we orient the extrusion with our basis vectors, then we add it to the current position on the curve - }, + vertex.x = P1.x + ( cx * N.x + cy * B.x ); + vertex.y = P1.y + ( cx * N.y + cy * B.y ); + vertex.z = P1.z + ( cx * N.z + cy * B.z ); - _updateWeight: function( time ) { + vertices.push( vertex.x, vertex.y, vertex.z ); - var weight = 0; + // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) - if ( this.enabled ) { + normal.subVectors( vertex, P1 ).normalize(); - weight = this.weight; - var interpolant = this._weightInterpolant; + normals.push( normal.x, normal.y, normal.z ); - if ( interpolant !== null ) { + // uv - var interpolantValue = interpolant.evaluate( time )[ 0 ]; + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); - weight *= interpolantValue; + } - if ( time > interpolant.parameterPositions[ 1 ] ) { + } - this.stopFading(); + // generate indices - if ( interpolantValue === 0 ) { + for ( let j = 1; j <= tubularSegments; j ++ ) { - // faded out, disable - this.enabled = false; + for ( let i = 1; i <= radialSegments; i ++ ) { - } + // indices - } + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); } } - this._effectiveWeight = weight; - return weight; + // build geometry - }, + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - _updateTimeScale: function( time ) { + // this function calculates the current position on the torus curve - var timeScale = 0; + function calculatePositionOnCurve( u, p, q, radius, position ) { - if ( ! this.paused ) { + const cu = Math.cos( u ); + const su = Math.sin( u ); + const quOverP = q / p * u; + const cs = Math.cos( quOverP ); - timeScale = this.timeScale; + position.x = radius * ( 2 + cs ) * 0.5 * cu; + position.y = radius * ( 2 + cs ) * su * 0.5; + position.z = radius * Math.sin( quOverP ) * 0.5; - var interpolant = this._timeScaleInterpolant; + } - if ( interpolant !== null ) { + } - var interpolantValue = interpolant.evaluate( time )[ 0 ]; + copy( source ) { - timeScale *= interpolantValue; + super.copy( source ); - if ( time > interpolant.parameterPositions[ 1 ] ) { + this.parameters = Object.assign( {}, source.parameters ); - this.stopWarping(); + return this; - if ( timeScale === 0 ) { + } - // motion has halted, pause - this.paused = true; + static fromJSON( data ) { - } else { + return new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q ); - // warp done - apply final time scale - this.timeScale = timeScale; + } - } + } - } + class TubeGeometry extends BufferGeometry { - } + constructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) { - } + super(); - this._effectiveTimeScale = timeScale; - return timeScale; + this.type = 'TubeGeometry'; - }, + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; - _updateTime: function( deltaTime ) { + const frames = path.computeFrenetFrames( tubularSegments, closed ); - var time = this.time + deltaTime; + // expose internals - if ( deltaTime === 0 ) return time; + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; - var duration = this._clip.duration, + // helper variables - loop = this.loop, - loopCount = this._loopCount; + const vertex = new Vector3(); + const normal = new Vector3(); + const uv = new Vector2(); + let P = new Vector3(); - if ( loop === LoopOnce ) { + // buffer - if ( loopCount === -1 ) { - // just started + const vertices = []; + const normals = []; + const uvs = []; + const indices = []; - this._loopCount = 0; - this._setEndings( true, true, false ); + // create buffer data - } + generateBufferData(); - handle_stop: { + // build geometry - if ( time >= duration ) { + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - time = duration; + // functions - } else if ( time < 0 ) { + function generateBufferData() { - time = 0; + for ( let i = 0; i < tubularSegments; i ++ ) { - } else break handle_stop; + generateSegment( i ); - if ( this.clampWhenFinished ) this.paused = true; - else this.enabled = false; + } - this._mixer.dispatchEvent( { - type: 'finished', action: this, - direction: deltaTime < 0 ? -1 : 1 - } ); + // if the geometry is not closed, generate the last row of vertices and normals + // at the regular position on the given path + // + // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) - } + generateSegment( ( closed === false ) ? tubularSegments : 0 ); - } else { // repetitive Repeat or PingPong + // uvs are generated in a separate function. + // this makes it easy compute correct values for closed geometries - var pingPong = ( loop === LoopPingPong ); + generateUVs(); - if ( loopCount === -1 ) { - // just started + // finally create faces - if ( deltaTime >= 0 ) { + generateIndices(); - loopCount = 0; + } - this._setEndings( - true, this.repetitions === 0, pingPong ); + function generateSegment( i ) { - } else { + // we use getPointAt to sample evenly distributed points from the given path - // when looping in reverse direction, the initial - // transition through zero counts as a repetition, - // so leave loopCount at -1 + P = path.getPointAt( i / tubularSegments, P ); - this._setEndings( - this.repetitions === 0, true, pingPong ); + // retrieve corresponding normal and binormal - } + const N = frames.normals[ i ]; + const B = frames.binormals[ i ]; - } + // generate normals and vertices for the current segment - if ( time >= duration || time < 0 ) { - // wrap around + for ( let j = 0; j <= radialSegments; j ++ ) { - var loopDelta = Math.floor( time / duration ); // signed - time -= duration * loopDelta; + const v = j / radialSegments * Math.PI * 2; - loopCount += Math.abs( loopDelta ); + const sin = Math.sin( v ); + const cos = - Math.cos( v ); - var pending = this.repetitions - loopCount; + // normal - if ( pending < 0 ) { - // have to stop (switch state, clamp time, fire event) + normal.x = ( cos * N.x + sin * B.x ); + normal.y = ( cos * N.y + sin * B.y ); + normal.z = ( cos * N.z + sin * B.z ); + normal.normalize(); - if ( this.clampWhenFinished ) this.paused = true; - else this.enabled = false; + normals.push( normal.x, normal.y, normal.z ); - time = deltaTime > 0 ? duration : 0; + // vertex - this._mixer.dispatchEvent( { - type: 'finished', action: this, - direction: deltaTime > 0 ? 1 : -1 - } ); + vertex.x = P.x + radius * normal.x; + vertex.y = P.y + radius * normal.y; + vertex.z = P.z + radius * normal.z; - } else { - // keep running + vertices.push( vertex.x, vertex.y, vertex.z ); - if ( pending === 0 ) { - // entering the last round + } - var atStart = deltaTime < 0; - this._setEndings( atStart, ! atStart, pingPong ); + } - } else { + function generateIndices() { - this._setEndings( false, false, pingPong ); + for ( let j = 1; j <= tubularSegments; j ++ ) { - } + for ( let i = 1; i <= radialSegments; i ++ ) { - this._loopCount = loopCount; + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; - this._mixer.dispatchEvent( { - type: 'loop', action: this, loopDelta: loopDelta - } ); + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); } } - if ( pingPong && ( loopCount & 1 ) === 1 ) { - // invert time for the "pong round" + } - this.time = time; - return duration - time; + function generateUVs() { + + for ( let i = 0; i <= tubularSegments; i ++ ) { + + for ( let j = 0; j <= radialSegments; j ++ ) { + + uv.x = i / tubularSegments; + uv.y = j / radialSegments; + + uvs.push( uv.x, uv.y ); + + } } } - this.time = time; - return time; - - }, + } - _setEndings: function( atStart, atEnd, pingPong ) { + copy( source ) { - var settings = this._interpolantSettings; + super.copy( source ); - if ( pingPong ) { + this.parameters = Object.assign( {}, source.parameters ); - settings.endingStart = ZeroSlopeEnding; - settings.endingEnd = ZeroSlopeEnding; + return this; - } else { + } - // assuming for LoopOnce atStart == atEnd == true + toJSON() { - if ( atStart ) { + const data = super.toJSON(); - settings.endingStart = this.zeroSlopeAtStart ? - ZeroSlopeEnding : ZeroCurvatureEnding; + data.path = this.parameters.path.toJSON(); - } else { + return data; - settings.endingStart = WrapAroundEnding; + } - } + static fromJSON( data ) { - if ( atEnd ) { + // This only works for built-in curves (e.g. CatmullRomCurve3). + // User defined curves or instances of CurvePath will not be deserialized. + return new TubeGeometry( + new Curves[ data.path.type ]().fromJSON( data.path ), + data.tubularSegments, + data.radius, + data.radialSegments, + data.closed + ); - settings.endingEnd = this.zeroSlopeAtEnd ? - ZeroSlopeEnding : ZeroCurvatureEnding; + } - } else { + } - settings.endingEnd = WrapAroundEnding; + class WireframeGeometry extends BufferGeometry { - } + constructor( geometry = null ) { - } + super(); - }, + this.type = 'WireframeGeometry'; - _scheduleFading: function( duration, weightNow, weightThen ) { + this.parameters = { + geometry: geometry + }; - var mixer = this._mixer, now = mixer.time, - interpolant = this._weightInterpolant; + if ( geometry !== null ) { - if ( interpolant === null ) { + // buffer - interpolant = mixer._lendControlInterpolant(); - this._weightInterpolant = interpolant; + const vertices = []; + const edges = new Set(); - } + // helper variables - var times = interpolant.parameterPositions, - values = interpolant.sampleValues; + const start = new Vector3(); + const end = new Vector3(); - times[ 0 ] = now; values[ 0 ] = weightNow; - times[ 1 ] = now + duration; values[ 1 ] = weightThen; + if ( geometry.index !== null ) { - return this; + // indexed BufferGeometry - } + const position = geometry.attributes.position; + const indices = geometry.index; + let groups = geometry.groups; - } ); + if ( groups.length === 0 ) { - /** - * - * Player for AnimationClips. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ + groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; - function AnimationMixer( root ) { + } - this._root = root; - this._initMemoryManager(); - this._accuIndex = 0; + // create a data structure that contains all edges without duplicates - this.time = 0; + for ( let o = 0, ol = groups.length; o < ol; ++ o ) { - this.timeScale = 1.0; + const group = groups[ o ]; - } + const groupStart = group.start; + const groupCount = group.count; - Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, { + for ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) { - _bindAction: function ( action, prototypeAction ) { + for ( let j = 0; j < 3; j ++ ) { - var root = action._localRoot || this._root, - tracks = action._clip.tracks, - nTracks = tracks.length, - bindings = action._propertyBindings, - interpolants = action._interpolants, - rootUuid = root.uuid, - bindingsByRoot = this._bindingsByRootAndName, - bindingsByName = bindingsByRoot[ rootUuid ]; + const index1 = indices.getX( i + j ); + const index2 = indices.getX( i + ( j + 1 ) % 3 ); - if ( bindingsByName === undefined ) { + start.fromBufferAttribute( position, index1 ); + end.fromBufferAttribute( position, index2 ); - bindingsByName = {}; - bindingsByRoot[ rootUuid ] = bindingsByName; + if ( isUniqueEdge( start, end, edges ) === true ) { - } + vertices.push( start.x, start.y, start.z ); + vertices.push( end.x, end.y, end.z ); - for ( var i = 0; i !== nTracks; ++ i ) { + } - var track = tracks[ i ], - trackName = track.name, - binding = bindingsByName[ trackName ]; + } - if ( binding !== undefined ) { + } - bindings[ i ] = binding; + } } else { - binding = bindings[ i ]; + // non-indexed BufferGeometry - if ( binding !== undefined ) { + const position = geometry.attributes.position; - // existing binding, make sure the cache knows + for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) { - if ( binding._cacheIndex === null ) { + for ( let j = 0; j < 3; j ++ ) { - ++ binding.referenceCount; - this._addInactiveBinding( binding, rootUuid, trackName ); + // three edges per triangle, an edge is represented as (index1, index2) + // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) - } + const index1 = 3 * i + j; + const index2 = 3 * i + ( ( j + 1 ) % 3 ); - continue; + start.fromBufferAttribute( position, index1 ); + end.fromBufferAttribute( position, index2 ); - } + if ( isUniqueEdge( start, end, edges ) === true ) { - var path = prototypeAction && prototypeAction. - _propertyBindings[ i ].binding.parsedPath; + vertices.push( start.x, start.y, start.z ); + vertices.push( end.x, end.y, end.z ); - binding = new PropertyMixer( - PropertyBinding.create( root, trackName, path ), - track.ValueTypeName, track.getValueSize() ); + } - ++ binding.referenceCount; - this._addInactiveBinding( binding, rootUuid, trackName ); + } - bindings[ i ] = binding; + } } - interpolants[ i ].resultBuffer = binding.buffer; + // build geometry + + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); } - }, + } - _activateAction: function ( action ) { + copy( source ) { - if ( ! this._isActiveAction( action ) ) { + super.copy( source ); - if ( action._cacheIndex === null ) { + this.parameters = Object.assign( {}, source.parameters ); - // this action has been forgotten by the cache, but the user - // appears to be still using it -> rebind + return this; - var rootUuid = ( action._localRoot || this._root ).uuid, - clipUuid = action._clip.uuid, - actionsForClip = this._actionsByClip[ clipUuid ]; + } - this._bindAction( action, - actionsForClip && actionsForClip.knownActions[ 0 ] ); + } - this._addInactiveAction( action, clipUuid, rootUuid ); + function isUniqueEdge( start, end, edges ) { - } + const hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`; + const hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge - var bindings = action._propertyBindings; + if ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) { - // increment reference counts / sort out state - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + return false; - var binding = bindings[ i ]; + } else { - if ( binding.useCount ++ === 0 ) { + edges.add( hash1 ); + edges.add( hash2 ); + return true; - this._lendBinding( binding ); - binding.saveOriginalState(); + } - } + } - } + var Geometries = /*#__PURE__*/Object.freeze({ + __proto__: null, + BoxGeometry: BoxGeometry, + CapsuleGeometry: CapsuleGeometry, + CircleGeometry: CircleGeometry, + ConeGeometry: ConeGeometry, + CylinderGeometry: CylinderGeometry, + DodecahedronGeometry: DodecahedronGeometry, + EdgesGeometry: EdgesGeometry, + ExtrudeGeometry: ExtrudeGeometry, + IcosahedronGeometry: IcosahedronGeometry, + LatheGeometry: LatheGeometry, + OctahedronGeometry: OctahedronGeometry, + PlaneGeometry: PlaneGeometry, + PolyhedronGeometry: PolyhedronGeometry, + RingGeometry: RingGeometry, + ShapeGeometry: ShapeGeometry, + SphereGeometry: SphereGeometry, + TetrahedronGeometry: TetrahedronGeometry, + TorusGeometry: TorusGeometry, + TorusKnotGeometry: TorusKnotGeometry, + TubeGeometry: TubeGeometry, + WireframeGeometry: WireframeGeometry + }); - this._lendAction( action ); + class ShadowMaterial extends Material { - } + constructor( parameters ) { - }, + super(); - _deactivateAction: function ( action ) { + this.isShadowMaterial = true; - if ( this._isActiveAction( action ) ) { + this.type = 'ShadowMaterial'; - var bindings = action._propertyBindings; + this.color = new Color( 0x000000 ); + this.transparent = true; - // decrement reference counts / sort out state - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + this.fog = true; - var binding = bindings[ i ]; + this.setValues( parameters ); - if ( -- binding.useCount === 0 ) { + } - binding.restoreOriginalState(); - this._takeBackBinding( binding ); + copy( source ) { - } + super.copy( source ); - } + this.color.copy( source.color ); - this._takeBackAction( action ); + this.fog = source.fog; - } + return this; - }, + } - // Memory manager + } - _initMemoryManager: function () { + class RawShaderMaterial extends ShaderMaterial { - this._actions = []; // 'nActiveActions' followed by inactive ones - this._nActiveActions = 0; + constructor( parameters ) { - this._actionsByClip = {}; - // inside: - // { - // knownActions: Array< AnimationAction > - used as prototypes - // actionByRoot: AnimationAction - lookup - // } + super( parameters ); + this.isRawShaderMaterial = true; - this._bindings = []; // 'nActiveBindings' followed by inactive ones - this._nActiveBindings = 0; + this.type = 'RawShaderMaterial'; - this._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer > + } + } - this._controlInterpolants = []; // same game as above - this._nActiveControlInterpolants = 0; + class MeshStandardMaterial extends Material { - var scope = this; + constructor( parameters ) { - this.stats = { + super(); - actions: { - get total() { return scope._actions.length; }, - get inUse() { return scope._nActiveActions; } - }, - bindings: { - get total() { return scope._bindings.length; }, - get inUse() { return scope._nActiveBindings; } - }, - controlInterpolants: { - get total() { return scope._controlInterpolants.length; }, - get inUse() { return scope._nActiveControlInterpolants; } - } + this.isMeshStandardMaterial = true; - }; + this.defines = { 'STANDARD': '' }; - }, + this.type = 'MeshStandardMaterial'; - // Memory management for AnimationAction objects + this.color = new Color( 0xffffff ); // diffuse + this.roughness = 1.0; + this.metalness = 0.0; - _isActiveAction: function ( action ) { + this.map = null; - var index = action._cacheIndex; - return index !== null && index < this._nActiveActions; + this.lightMap = null; + this.lightMapIntensity = 1.0; - }, + this.aoMap = null; + this.aoMapIntensity = 1.0; - _addInactiveAction: function ( action, clipUuid, rootUuid ) { + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; - var actions = this._actions, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ]; + this.bumpMap = null; + this.bumpScale = 1; - if ( actionsForClip === undefined ) { + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - actionsForClip = { + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - knownActions: [ action ], - actionByRoot: {} + this.roughnessMap = null; - }; + this.metalnessMap = null; - action._byClipCacheIndex = 0; + this.alphaMap = null; - actionsByClip[ clipUuid ] = actionsForClip; + this.envMap = null; + this.envMapIntensity = 1.0; - } else { + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; - var knownActions = actionsForClip.knownActions; + this.flatShading = false; - action._byClipCacheIndex = knownActions.length; - knownActions.push( action ); + this.fog = true; - } + this.setValues( parameters ); - action._cacheIndex = actions.length; - actions.push( action ); + } - actionsForClip.actionByRoot[ rootUuid ] = action; + copy( source ) { - }, + super.copy( source ); - _removeInactiveAction: function ( action ) { + this.defines = { 'STANDARD': '' }; - var actions = this._actions, - lastInactiveAction = actions[ actions.length - 1 ], - cacheIndex = action._cacheIndex; + this.color.copy( source.color ); + this.roughness = source.roughness; + this.metalness = source.metalness; - lastInactiveAction._cacheIndex = cacheIndex; - actions[ cacheIndex ] = lastInactiveAction; - actions.pop(); + this.map = source.map; - action._cacheIndex = null; + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; - var clipUuid = action._clip.uuid, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ], - knownActionsForClip = actionsForClip.knownActions, + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; - lastKnownAction = - knownActionsForClip[ knownActionsForClip.length - 1 ], + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - byClipCacheIndex = action._byClipCacheIndex; + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - lastKnownAction._byClipCacheIndex = byClipCacheIndex; - knownActionsForClip[ byClipCacheIndex ] = lastKnownAction; - knownActionsForClip.pop(); + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - action._byClipCacheIndex = null; + this.roughnessMap = source.roughnessMap; + this.metalnessMap = source.metalnessMap; - var actionByRoot = actionsForClip.actionByRoot, - rootUuid = ( action._localRoot || this._root ).uuid; + this.alphaMap = source.alphaMap; - delete actionByRoot[ rootUuid ]; + this.envMap = source.envMap; + this.envMapIntensity = source.envMapIntensity; - if ( knownActionsForClip.length === 0 ) { + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; - delete actionsByClip[ clipUuid ]; + this.flatShading = source.flatShading; - } + this.fog = source.fog; - this._removeInactiveBindingsForAction( action ); + return this; - }, + } - _removeInactiveBindingsForAction: function ( action ) { + } - var bindings = action._propertyBindings; - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + class MeshPhysicalMaterial extends MeshStandardMaterial { - var binding = bindings[ i ]; + constructor( parameters ) { - if ( -- binding.referenceCount === 0 ) { + super(); - this._removeInactiveBinding( binding ); + this.isMeshPhysicalMaterial = true; - } + this.defines = { - } + 'STANDARD': '', + 'PHYSICAL': '' - }, + }; - _lendAction: function ( action ) { + this.type = 'MeshPhysicalMaterial'; - // [ active actions | inactive actions ] - // [ active actions >| inactive actions ] - // s a - // <-swap-> - // a s + this.anisotropyRotation = 0; + this.anisotropyMap = null; - var actions = this._actions, - prevIndex = action._cacheIndex, + this.clearcoatMap = null; + this.clearcoatRoughness = 0.0; + this.clearcoatRoughnessMap = null; + this.clearcoatNormalScale = new Vector2( 1, 1 ); + this.clearcoatNormalMap = null; - lastActiveIndex = this._nActiveActions ++, + this.ior = 1.5; - firstInactiveAction = actions[ lastActiveIndex ]; + Object.defineProperty( this, 'reflectivity', { + get: function () { - action._cacheIndex = lastActiveIndex; - actions[ lastActiveIndex ] = action; + return ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) ); - firstInactiveAction._cacheIndex = prevIndex; - actions[ prevIndex ] = firstInactiveAction; + }, + set: function ( reflectivity ) { - }, + this.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity ); - _takeBackAction: function ( action ) { + } + } ); - // [ active actions | inactive actions ] - // [ active actions |< inactive actions ] - // a s - // <-swap-> - // s a + this.iridescenceMap = null; + this.iridescenceIOR = 1.3; + this.iridescenceThicknessRange = [ 100, 400 ]; + this.iridescenceThicknessMap = null; - var actions = this._actions, - prevIndex = action._cacheIndex, + this.sheenColor = new Color( 0x000000 ); + this.sheenColorMap = null; + this.sheenRoughness = 1.0; + this.sheenRoughnessMap = null; - firstInactiveIndex = -- this._nActiveActions, + this.transmissionMap = null; - lastActiveAction = actions[ firstInactiveIndex ]; + this.thickness = 0; + this.thicknessMap = null; + this.attenuationDistance = Infinity; + this.attenuationColor = new Color( 1, 1, 1 ); - action._cacheIndex = firstInactiveIndex; - actions[ firstInactiveIndex ] = action; + this.specularIntensity = 1.0; + this.specularIntensityMap = null; + this.specularColor = new Color( 1, 1, 1 ); + this.specularColorMap = null; - lastActiveAction._cacheIndex = prevIndex; - actions[ prevIndex ] = lastActiveAction; + this._anisotropy = 0; + this._clearcoat = 0; + this._iridescence = 0; + this._sheen = 0.0; + this._transmission = 0; - }, + this.setValues( parameters ); - // Memory management for PropertyMixer objects + } - _addInactiveBinding: function ( binding, rootUuid, trackName ) { + get anisotropy() { - var bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ], + return this._anisotropy; - bindings = this._bindings; + } - if ( bindingByName === undefined ) { + set anisotropy( value ) { - bindingByName = {}; - bindingsByRoot[ rootUuid ] = bindingByName; + if ( this._anisotropy > 0 !== value > 0 ) { + + this.version ++; } - bindingByName[ trackName ] = binding; + this._anisotropy = value; - binding._cacheIndex = bindings.length; - bindings.push( binding ); + } - }, + get clearcoat() { - _removeInactiveBinding: function ( binding ) { + return this._clearcoat; - var bindings = this._bindings, - propBinding = binding.binding, - rootUuid = propBinding.rootNode.uuid, - trackName = propBinding.path, - bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ], + } - lastInactiveBinding = bindings[ bindings.length - 1 ], - cacheIndex = binding._cacheIndex; + set clearcoat( value ) { - lastInactiveBinding._cacheIndex = cacheIndex; - bindings[ cacheIndex ] = lastInactiveBinding; - bindings.pop(); + if ( this._clearcoat > 0 !== value > 0 ) { - delete bindingByName[ trackName ]; + this.version ++; - remove_empty_map: { + } - for ( var _ in bindingByName ) break remove_empty_map; + this._clearcoat = value; - delete bindingsByRoot[ rootUuid ]; + } - } + get iridescence() { - }, + return this._iridescence; - _lendBinding: function ( binding ) { + } - var bindings = this._bindings, - prevIndex = binding._cacheIndex, + set iridescence( value ) { - lastActiveIndex = this._nActiveBindings ++, + if ( this._iridescence > 0 !== value > 0 ) { - firstInactiveBinding = bindings[ lastActiveIndex ]; + this.version ++; - binding._cacheIndex = lastActiveIndex; - bindings[ lastActiveIndex ] = binding; + } - firstInactiveBinding._cacheIndex = prevIndex; - bindings[ prevIndex ] = firstInactiveBinding; + this._iridescence = value; - }, + } - _takeBackBinding: function ( binding ) { + get sheen() { - var bindings = this._bindings, - prevIndex = binding._cacheIndex, + return this._sheen; - firstInactiveIndex = -- this._nActiveBindings, + } - lastActiveBinding = bindings[ firstInactiveIndex ]; + set sheen( value ) { - binding._cacheIndex = firstInactiveIndex; - bindings[ firstInactiveIndex ] = binding; + if ( this._sheen > 0 !== value > 0 ) { - lastActiveBinding._cacheIndex = prevIndex; - bindings[ prevIndex ] = lastActiveBinding; + this.version ++; - }, + } + this._sheen = value; - // Memory management of Interpolants for weight and time scale + } - _lendControlInterpolant: function () { + get transmission() { - var interpolants = this._controlInterpolants, - lastActiveIndex = this._nActiveControlInterpolants ++, - interpolant = interpolants[ lastActiveIndex ]; + return this._transmission; - if ( interpolant === undefined ) { + } - interpolant = new LinearInterpolant( - new Float32Array( 2 ), new Float32Array( 2 ), - 1, this._controlInterpolantsResultBuffer ); + set transmission( value ) { - interpolant.__cacheIndex = lastActiveIndex; - interpolants[ lastActiveIndex ] = interpolant; + if ( this._transmission > 0 !== value > 0 ) { + + this.version ++; } - return interpolant; + this._transmission = value; - }, + } - _takeBackControlInterpolant: function ( interpolant ) { + copy( source ) { - var interpolants = this._controlInterpolants, - prevIndex = interpolant.__cacheIndex, + super.copy( source ); - firstInactiveIndex = -- this._nActiveControlInterpolants, + this.defines = { - lastActiveInterpolant = interpolants[ firstInactiveIndex ]; + 'STANDARD': '', + 'PHYSICAL': '' - interpolant.__cacheIndex = firstInactiveIndex; - interpolants[ firstInactiveIndex ] = interpolant; + }; - lastActiveInterpolant.__cacheIndex = prevIndex; - interpolants[ prevIndex ] = lastActiveInterpolant; + this.anisotropy = source.anisotropy; + this.anisotropyRotation = source.anisotropyRotation; + this.anisotropyMap = source.anisotropyMap; - }, + this.clearcoat = source.clearcoat; + this.clearcoatMap = source.clearcoatMap; + this.clearcoatRoughness = source.clearcoatRoughness; + this.clearcoatRoughnessMap = source.clearcoatRoughnessMap; + this.clearcoatNormalMap = source.clearcoatNormalMap; + this.clearcoatNormalScale.copy( source.clearcoatNormalScale ); - _controlInterpolantsResultBuffer: new Float32Array( 1 ), + this.ior = source.ior; - // return an action for a clip optionally using a custom root target - // object (this method allocates a lot of dynamic memory in case a - // previously unknown clip/root combination is specified) - clipAction: function ( clip, optionalRoot ) { + this.iridescence = source.iridescence; + this.iridescenceMap = source.iridescenceMap; + this.iridescenceIOR = source.iridescenceIOR; + this.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ]; + this.iridescenceThicknessMap = source.iridescenceThicknessMap; - var root = optionalRoot || this._root, - rootUuid = root.uuid, + this.sheen = source.sheen; + this.sheenColor.copy( source.sheenColor ); + this.sheenColorMap = source.sheenColorMap; + this.sheenRoughness = source.sheenRoughness; + this.sheenRoughnessMap = source.sheenRoughnessMap; - clipObject = typeof clip === 'string' ? - AnimationClip.findByName( root, clip ) : clip, + this.transmission = source.transmission; + this.transmissionMap = source.transmissionMap; - clipUuid = clipObject !== null ? clipObject.uuid : clip, + this.thickness = source.thickness; + this.thicknessMap = source.thicknessMap; + this.attenuationDistance = source.attenuationDistance; + this.attenuationColor.copy( source.attenuationColor ); - actionsForClip = this._actionsByClip[ clipUuid ], - prototypeAction = null; + this.specularIntensity = source.specularIntensity; + this.specularIntensityMap = source.specularIntensityMap; + this.specularColor.copy( source.specularColor ); + this.specularColorMap = source.specularColorMap; - if ( actionsForClip !== undefined ) { + return this; - var existingAction = - actionsForClip.actionByRoot[ rootUuid ]; + } - if ( existingAction !== undefined ) { + } - return existingAction; + class MeshPhongMaterial extends Material { - } + constructor( parameters ) { - // we know the clip, so we don't have to parse all - // the bindings again but can just copy - prototypeAction = actionsForClip.knownActions[ 0 ]; + super(); - // also, take the clip from the prototype action - if ( clipObject === null ) - clipObject = prototypeAction._clip; + this.isMeshPhongMaterial = true; - } + this.type = 'MeshPhongMaterial'; - // clip must be known when specified via string - if ( clipObject === null ) return null; + this.color = new Color( 0xffffff ); // diffuse + this.specular = new Color( 0x111111 ); + this.shininess = 30; - // allocate all resources required to run it - var newAction = new AnimationAction( this, clipObject, optionalRoot ); + this.map = null; - this._bindAction( newAction, prototypeAction ); + this.lightMap = null; + this.lightMapIntensity = 1.0; - // and make the action known to the memory manager - this._addInactiveAction( newAction, clipUuid, rootUuid ); + this.aoMap = null; + this.aoMapIntensity = 1.0; - return newAction; + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; - }, + this.bumpMap = null; + this.bumpScale = 1; - // get an existing action - existingAction: function ( clip, optionalRoot ) { + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - var root = optionalRoot || this._root, - rootUuid = root.uuid, + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - clipObject = typeof clip === 'string' ? - AnimationClip.findByName( root, clip ) : clip, + this.specularMap = null; - clipUuid = clipObject ? clipObject.uuid : clip, + this.alphaMap = null; - actionsForClip = this._actionsByClip[ clipUuid ]; + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; - if ( actionsForClip !== undefined ) { + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; - return actionsForClip.actionByRoot[ rootUuid ] || null; + this.flatShading = false; - } + this.fog = true; - return null; + this.setValues( parameters ); - }, + } - // deactivates all previously scheduled actions - stopAllAction: function () { + copy( source ) { - var actions = this._actions, - nActions = this._nActiveActions, - bindings = this._bindings, - nBindings = this._nActiveBindings; + super.copy( source ); - this._nActiveActions = 0; - this._nActiveBindings = 0; + this.color.copy( source.color ); + this.specular.copy( source.specular ); + this.shininess = source.shininess; - for ( var i = 0; i !== nActions; ++ i ) { + this.map = source.map; - actions[ i ].reset(); + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; - } + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; - for ( var i = 0; i !== nBindings; ++ i ) { + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; - bindings[ i ].useCount = 0; + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - } + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - return this; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - }, + this.specularMap = source.specularMap; - // advance the time and update apply the animation - update: function ( deltaTime ) { + this.alphaMap = source.alphaMap; - deltaTime *= this.timeScale; + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; - var actions = this._actions, - nActions = this._nActiveActions, + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; - time = this.time += deltaTime, - timeDirection = Math.sign( deltaTime ), + this.flatShading = source.flatShading; - accuIndex = this._accuIndex ^= 1; + this.fog = source.fog; - // run active actions + return this; - for ( var i = 0; i !== nActions; ++ i ) { + } - var action = actions[ i ]; + } - action._update( time, deltaTime, timeDirection, accuIndex ); + class MeshToonMaterial extends Material { - } + constructor( parameters ) { - // update scene graph + super(); - var bindings = this._bindings, - nBindings = this._nActiveBindings; + this.isMeshToonMaterial = true; - for ( var i = 0; i !== nBindings; ++ i ) { + this.defines = { 'TOON': '' }; - bindings[ i ].apply( accuIndex ); + this.type = 'MeshToonMaterial'; - } + this.color = new Color( 0xffffff ); - return this; + this.map = null; + this.gradientMap = null; - }, + this.lightMap = null; + this.lightMapIntensity = 1.0; - // return this mixer's root target object - getRoot: function () { + this.aoMap = null; + this.aoMapIntensity = 1.0; - return this._root; + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; - }, + this.bumpMap = null; + this.bumpScale = 1; - // free all resources specific to a particular clip - uncacheClip: function ( clip ) { + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - var actions = this._actions, - clipUuid = clip.uuid, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ]; + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - if ( actionsForClip !== undefined ) { + this.alphaMap = null; - // note: just calling _removeInactiveAction would mess up the - // iteration state and also require updating the state we can - // just throw away + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; - var actionsToRemove = actionsForClip.knownActions; + this.fog = true; - for ( var i = 0, n = actionsToRemove.length; i !== n; ++ i ) { + this.setValues( parameters ); - var action = actionsToRemove[ i ]; + } - this._deactivateAction( action ); + copy( source ) { - var cacheIndex = action._cacheIndex, - lastInactiveAction = actions[ actions.length - 1 ]; + super.copy( source ); - action._cacheIndex = null; - action._byClipCacheIndex = null; + this.color.copy( source.color ); - lastInactiveAction._cacheIndex = cacheIndex; - actions[ cacheIndex ] = lastInactiveAction; - actions.pop(); + this.map = source.map; + this.gradientMap = source.gradientMap; - this._removeInactiveBindingsForAction( action ); + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; - } + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; - delete actionsByClip[ clipUuid ]; + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; - } + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - }, + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - // free all resources specific to a particular root target object - uncacheRoot: function ( root ) { + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - var rootUuid = root.uuid, - actionsByClip = this._actionsByClip; + this.alphaMap = source.alphaMap; - for ( var clipUuid in actionsByClip ) { + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; - var actionByRoot = actionsByClip[ clipUuid ].actionByRoot, - action = actionByRoot[ rootUuid ]; + this.fog = source.fog; - if ( action !== undefined ) { + return this; - this._deactivateAction( action ); - this._removeInactiveAction( action ); + } - } + } - } + class MeshNormalMaterial extends Material { - var bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ]; + constructor( parameters ) { - if ( bindingByName !== undefined ) { + super(); - for ( var trackName in bindingByName ) { + this.isMeshNormalMaterial = true; - var binding = bindingByName[ trackName ]; - binding.restoreOriginalState(); - this._removeInactiveBinding( binding ); + this.type = 'MeshNormalMaterial'; - } + this.bumpMap = null; + this.bumpScale = 1; - } + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - }, + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - // remove a targeted clip from the cache - uncacheAction: function ( clip, optionalRoot ) { + this.wireframe = false; + this.wireframeLinewidth = 1; - var action = this.existingAction( clip, optionalRoot ); + this.flatShading = false; - if ( action !== null ) { + this.setValues( parameters ); - this._deactivateAction( action ); - this._removeInactiveAction( action ); + } - } + copy( source ) { - } + super.copy( source ); - } ); + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - /** - * @author mrdoob / http://mrdoob.com/ - */ + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - function Uniform( value ) { + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - if ( typeof value === 'string' ) { + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; - console.warn( 'THREE.Uniform: Type parameter is no longer needed.' ); - value = arguments[ 1 ]; + this.flatShading = source.flatShading; - } + return this; - this.value = value; + } } - Uniform.prototype.clone = function () { + class MeshLambertMaterial extends Material { - return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() ); + constructor( parameters ) { - }; + super(); - /** - * @author benaadams / https://twitter.com/ben_a_adams - */ + this.isMeshLambertMaterial = true; - function InstancedBufferGeometry() { + this.type = 'MeshLambertMaterial'; - BufferGeometry.call( this ); + this.color = new Color( 0xffffff ); // diffuse - this.type = 'InstancedBufferGeometry'; - this.maxInstancedCount = undefined; + this.map = null; - } + this.lightMap = null; + this.lightMapIntensity = 1.0; - InstancedBufferGeometry.prototype = Object.assign( Object.create( BufferGeometry.prototype ), { + this.aoMap = null; + this.aoMapIntensity = 1.0; - constructor: InstancedBufferGeometry, + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; - isInstancedBufferGeometry: true, + this.bumpMap = null; + this.bumpScale = 1; - addGroup: function ( start, count, materialIndex ) { + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - this.groups.push( { + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - start: start, - count: count, - materialIndex: materialIndex + this.specularMap = null; - } ); + this.alphaMap = null; - }, + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; - copy: function ( source ) { + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; - var index = source.index; + this.flatShading = false; - if ( index !== null ) { + this.fog = true; - this.setIndex( index.clone() ); + this.setValues( parameters ); - } + } - var attributes = source.attributes; + copy( source ) { - for ( var name in attributes ) { + super.copy( source ); - var attribute = attributes[ name ]; - this.addAttribute( name, attribute.clone() ); + this.color.copy( source.color ); - } + this.map = source.map; - var groups = source.groups; + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; - for ( var i = 0, l = groups.length; i < l; i ++ ) { + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; - var group = groups[ i ]; - this.addGroup( group.start, group.count, group.materialIndex ); + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; - } + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - return this; + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - } + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - } ); + this.specularMap = source.specularMap; - /** - * @author benaadams / https://twitter.com/ben_a_adams - */ + this.alphaMap = source.alphaMap; - function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) { + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; - this.uuid = _Math.generateUUID(); + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; - this.data = interleavedBuffer; - this.itemSize = itemSize; - this.offset = offset; + this.flatShading = source.flatShading; - this.normalized = normalized === true; + this.fog = source.fog; - } + return this; - Object.defineProperties( InterleavedBufferAttribute.prototype, { + } - count: { + } - get: function () { + class MeshMatcapMaterial extends Material { - return this.data.count; + constructor( parameters ) { - } + super(); - }, + this.isMeshMatcapMaterial = true; - array: { + this.defines = { 'MATCAP': '' }; - get: function () { + this.type = 'MeshMatcapMaterial'; - return this.data.array; + this.color = new Color( 0xffffff ); // diffuse - } + this.matcap = null; - } + this.map = null; - } ); + this.bumpMap = null; + this.bumpScale = 1; - Object.assign( InterleavedBufferAttribute.prototype, { + this.normalMap = null; + this.normalMapType = TangentSpaceNormalMap; + this.normalScale = new Vector2( 1, 1 ); - isInterleavedBufferAttribute: true, + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; - setX: function ( index, x ) { + this.alphaMap = null; - this.data.array[ index * this.data.stride + this.offset ] = x; + this.flatShading = false; - return this; + this.fog = true; - }, + this.setValues( parameters ); - setY: function ( index, y ) { + } - this.data.array[ index * this.data.stride + this.offset + 1 ] = y; - return this; + copy( source ) { - }, + super.copy( source ); - setZ: function ( index, z ) { + this.defines = { 'MATCAP': '' }; - this.data.array[ index * this.data.stride + this.offset + 2 ] = z; + this.color.copy( source.color ); - return this; + this.matcap = source.matcap; - }, + this.map = source.map; - setW: function ( index, w ) { + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; - this.data.array[ index * this.data.stride + this.offset + 3 ] = w; + this.normalMap = source.normalMap; + this.normalMapType = source.normalMapType; + this.normalScale.copy( source.normalScale ); - return this; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; - }, + this.alphaMap = source.alphaMap; - getX: function ( index ) { + this.flatShading = source.flatShading; - return this.data.array[ index * this.data.stride + this.offset ]; + this.fog = source.fog; - }, + return this; - getY: function ( index ) { + } - return this.data.array[ index * this.data.stride + this.offset + 1 ]; + } - }, + class LineDashedMaterial extends LineBasicMaterial { - getZ: function ( index ) { + constructor( parameters ) { - return this.data.array[ index * this.data.stride + this.offset + 2 ]; + super(); - }, + this.isLineDashedMaterial = true; - getW: function ( index ) { + this.type = 'LineDashedMaterial'; - return this.data.array[ index * this.data.stride + this.offset + 3 ]; + this.scale = 1; + this.dashSize = 3; + this.gapSize = 1; - }, + this.setValues( parameters ); - setXY: function ( index, x, y ) { + } - index = index * this.data.stride + this.offset; + copy( source ) { - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; + super.copy( source ); + + this.scale = source.scale; + this.dashSize = source.dashSize; + this.gapSize = source.gapSize; return this; - }, + } - setXYZ: function ( index, x, y, z ) { + } - index = index * this.data.stride + this.offset; + // same as Array.prototype.slice, but also works on typed arrays + function arraySlice( array, from, to ) { - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; - this.data.array[ index + 2 ] = z; + if ( isTypedArray( array ) ) { - return this; + // in ios9 array.subarray(from, undefined) will return empty array + // but array.subarray(from) or array.subarray(from, len) is correct + return new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) ); - }, + } - setXYZW: function ( index, x, y, z, w ) { + return array.slice( from, to ); - index = index * this.data.stride + this.offset; + } - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; - this.data.array[ index + 2 ] = z; - this.data.array[ index + 3 ] = w; + // converts an array to a specific type + function convertArray( array, type, forceClone ) { - return this; + if ( ! array || // let 'undefined' and 'null' pass + ! forceClone && array.constructor === type ) return array; + + if ( typeof type.BYTES_PER_ELEMENT === 'number' ) { + + return new type( array ); // create typed array } - } ); + return Array.prototype.slice.call( array ); // create Array - /** - * @author benaadams / https://twitter.com/ben_a_adams - */ + } - function InterleavedBuffer( array, stride ) { + function isTypedArray( object ) { - this.uuid = _Math.generateUUID(); + return ArrayBuffer.isView( object ) && + ! ( object instanceof DataView ); - this.array = array; - this.stride = stride; - this.count = array !== undefined ? array.length / stride : 0; + } - this.dynamic = false; - this.updateRange = { offset: 0, count: - 1 }; + // returns an array by which times and values can be sorted + function getKeyframeOrder( times ) { - this.onUploadCallback = function () {}; + function compareTime( i, j ) { - this.version = 0; + return times[ i ] - times[ j ]; - } + } - Object.defineProperty( InterleavedBuffer.prototype, 'needsUpdate', { + const n = times.length; + const result = new Array( n ); + for ( let i = 0; i !== n; ++ i ) result[ i ] = i; - set: function ( value ) { + result.sort( compareTime ); - if ( value === true ) this.version ++; + return result; - } + } - } ); + // uses the array previously returned by 'getKeyframeOrder' to sort data + function sortedArray( values, stride, order ) { - Object.assign( InterleavedBuffer.prototype, { + const nValues = values.length; + const result = new values.constructor( nValues ); - isInterleavedBuffer: true, + for ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) { - setArray: function ( array ) { + const srcOffset = order[ i ] * stride; - if ( Array.isArray( array ) ) { + for ( let j = 0; j !== stride; ++ j ) { - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + result[ dstOffset ++ ] = values[ srcOffset + j ]; } - this.count = array !== undefined ? array.length / this.stride : 0; - this.array = array; + } - }, + return result; - setDynamic: function ( value ) { + } - this.dynamic = value; + // function for parsing AOS keyframe formats + function flattenJSON( jsonKeys, times, values, valuePropertyName ) { - return this; + let i = 1, key = jsonKeys[ 0 ]; - }, + while ( key !== undefined && key[ valuePropertyName ] === undefined ) { - copy: function ( source ) { + key = jsonKeys[ i ++ ]; - this.array = new source.array.constructor( source.array ); - this.count = source.count; - this.stride = source.stride; - this.dynamic = source.dynamic; + } - return this; + if ( key === undefined ) return; // no data - }, + let value = key[ valuePropertyName ]; + if ( value === undefined ) return; // no data - copyAt: function ( index1, attribute, index2 ) { + if ( Array.isArray( value ) ) { - index1 *= this.stride; - index2 *= attribute.stride; + do { - for ( var i = 0, l = this.stride; i < l; i ++ ) { + value = key[ valuePropertyName ]; - this.array[ index1 + i ] = attribute.array[ index2 + i ]; + if ( value !== undefined ) { - } + times.push( key.time ); + values.push.apply( values, value ); // push all elements - return this; + } - }, + key = jsonKeys[ i ++ ]; - set: function ( value, offset ) { + } while ( key !== undefined ); - if ( offset === undefined ) offset = 0; + } else if ( value.toArray !== undefined ) { - this.array.set( value, offset ); + // ...assume THREE.Math-ish - return this; + do { - }, + value = key[ valuePropertyName ]; - clone: function () { + if ( value !== undefined ) { - return new this.constructor().copy( this ); + times.push( key.time ); + value.toArray( values, values.length ); - }, + } - onUpload: function ( callback ) { + key = jsonKeys[ i ++ ]; - this.onUploadCallback = callback; + } while ( key !== undefined ); - return this; + } else { - } + // otherwise push as-is - } ); + do { - /** - * @author benaadams / https://twitter.com/ben_a_adams - */ + value = key[ valuePropertyName ]; - function InstancedInterleavedBuffer( array, stride, meshPerAttribute ) { + if ( value !== undefined ) { - InterleavedBuffer.call( this, array, stride ); + times.push( key.time ); + values.push( value ); - this.meshPerAttribute = meshPerAttribute || 1; + } - } + key = jsonKeys[ i ++ ]; - InstancedInterleavedBuffer.prototype = Object.assign( Object.create( InterleavedBuffer.prototype ), { + } while ( key !== undefined ); - constructor: InstancedInterleavedBuffer, + } - isInstancedInterleavedBuffer: true, + } - copy: function ( source ) { + function subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) { - InterleavedBuffer.prototype.copy.call( this, source ); + const clip = sourceClip.clone(); - this.meshPerAttribute = source.meshPerAttribute; + clip.name = name; - return this; + const tracks = []; - } + for ( let i = 0; i < clip.tracks.length; ++ i ) { - } ); + const track = clip.tracks[ i ]; + const valueSize = track.getValueSize(); - /** - * @author benaadams / https://twitter.com/ben_a_adams - */ + const times = []; + const values = []; - function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) { + for ( let j = 0; j < track.times.length; ++ j ) { - BufferAttribute.call( this, array, itemSize ); + const frame = track.times[ j ] * fps; - this.meshPerAttribute = meshPerAttribute || 1; + if ( frame < startFrame || frame >= endFrame ) continue; - } + times.push( track.times[ j ] ); - InstancedBufferAttribute.prototype = Object.assign( Object.create( BufferAttribute.prototype ), { + for ( let k = 0; k < valueSize; ++ k ) { - constructor: InstancedBufferAttribute, + values.push( track.values[ j * valueSize + k ] ); - isInstancedBufferAttribute: true, + } - copy: function ( source ) { + } - BufferAttribute.prototype.copy.call( this, source ); + if ( times.length === 0 ) continue; - this.meshPerAttribute = source.meshPerAttribute; + track.times = convertArray( times, track.times.constructor ); + track.values = convertArray( values, track.values.constructor ); - return this; + tracks.push( track ); } - } ); + clip.tracks = tracks; - /** - * @author mrdoob / http://mrdoob.com/ - * @author bhouston / http://clara.io/ - * @author stephomi / http://stephaneginier.com/ - */ + // find minimum .times value across all tracks in the trimmed clip - function Raycaster( origin, direction, near, far ) { + let minStartTime = Infinity; - this.ray = new Ray( origin, direction ); - // direction is assumed to be normalized (for accurate distance calculations) + for ( let i = 0; i < clip.tracks.length; ++ i ) { - this.near = near || 0; - this.far = far || Infinity; + if ( minStartTime > clip.tracks[ i ].times[ 0 ] ) { - this.params = { - Mesh: {}, - Line: {}, - LOD: {}, - Points: { threshold: 1 }, - Sprite: {} - }; + minStartTime = clip.tracks[ i ].times[ 0 ]; - Object.defineProperties( this.params, { - PointCloud: { - get: function () { - console.warn( 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.' ); - return this.Points; - } } - } ); - } + } - function ascSort( a, b ) { + // shift all tracks such that clip begins at t=0 - return a.distance - b.distance; + for ( let i = 0; i < clip.tracks.length; ++ i ) { + + clip.tracks[ i ].shift( - 1 * minStartTime ); + + } + + clip.resetDuration(); + + return clip; } - function intersectObject( object, raycaster, intersects, recursive ) { + function makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) { - if ( object.visible === false ) return; + if ( fps <= 0 ) fps = 30; - object.raycast( raycaster, intersects ); + const numTracks = referenceClip.tracks.length; + const referenceTime = referenceFrame / fps; - if ( recursive === true ) { + // Make each track's values relative to the values at the reference frame + for ( let i = 0; i < numTracks; ++ i ) { - var children = object.children; + const referenceTrack = referenceClip.tracks[ i ]; + const referenceTrackType = referenceTrack.ValueTypeName; - for ( var i = 0, l = children.length; i < l; i ++ ) { + // Skip this track if it's non-numeric + if ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue; - intersectObject( children[ i ], raycaster, intersects, true ); + // Find the track in the target clip whose name and type matches the reference track + const targetTrack = targetClip.tracks.find( function ( track ) { - } + return track.name === referenceTrack.name + && track.ValueTypeName === referenceTrackType; - } + } ); - } + if ( targetTrack === undefined ) continue; - Object.assign( Raycaster.prototype, { + let referenceOffset = 0; + const referenceValueSize = referenceTrack.getValueSize(); - linePrecision: 1, + if ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { - set: function ( origin, direction ) { + referenceOffset = referenceValueSize / 3; - // direction is assumed to be normalized (for accurate distance calculations) + } - this.ray.set( origin, direction ); + let targetOffset = 0; + const targetValueSize = targetTrack.getValueSize(); - }, + if ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { - setFromCamera: function ( coords, camera ) { + targetOffset = targetValueSize / 3; - if ( ( camera && camera.isPerspectiveCamera ) ) { + } - this.ray.origin.setFromMatrixPosition( camera.matrixWorld ); - this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize(); + const lastIndex = referenceTrack.times.length - 1; + let referenceValue; - } else if ( ( camera && camera.isOrthographicCamera ) ) { + // Find the value to subtract out of the track + if ( referenceTime <= referenceTrack.times[ 0 ] ) { - this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera - this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); + // Reference frame is earlier than the first keyframe, so just use the first keyframe + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; + referenceValue = arraySlice( referenceTrack.values, startIndex, endIndex ); + + } else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) { + + // Reference frame is after the last keyframe, so just use the last keyframe + const startIndex = lastIndex * referenceValueSize + referenceOffset; + const endIndex = startIndex + referenceValueSize - referenceOffset; + referenceValue = arraySlice( referenceTrack.values, startIndex, endIndex ); } else { - console.error( 'THREE.Raycaster: Unsupported camera type.' ); + // Interpolate to the reference value + const interpolant = referenceTrack.createInterpolant(); + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; + interpolant.evaluate( referenceTime ); + referenceValue = arraySlice( interpolant.resultBuffer, startIndex, endIndex ); } - }, + // Conjugate the quaternion + if ( referenceTrackType === 'quaternion' ) { - intersectObject: function ( object, recursive ) { + const referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate(); + referenceQuat.toArray( referenceValue ); - var intersects = []; + } - intersectObject( object, this, intersects, recursive ); + // Subtract the reference value from all of the track values - intersects.sort( ascSort ); + const numTimes = targetTrack.times.length; + for ( let j = 0; j < numTimes; ++ j ) { - return intersects; + const valueStart = j * targetValueSize + targetOffset; - }, + if ( referenceTrackType === 'quaternion' ) { - intersectObjects: function ( objects, recursive ) { + // Multiply the conjugate for quaternion track types + Quaternion.multiplyQuaternionsFlat( + targetTrack.values, + valueStart, + referenceValue, + 0, + targetTrack.values, + valueStart + ); - var intersects = []; + } else { - if ( Array.isArray( objects ) === false ) { + const valueEnd = targetValueSize - targetOffset * 2; - console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' ); - return intersects; + // Subtract each value for all other numeric track types + for ( let k = 0; k < valueEnd; ++ k ) { - } + targetTrack.values[ valueStart + k ] -= referenceValue[ k ]; - for ( var i = 0, l = objects.length; i < l; i ++ ) { + } - intersectObject( objects[ i ], this, intersects, recursive ); + } } - intersects.sort( ascSort ); + } - return intersects; + targetClip.blendMode = AdditiveAnimationBlendMode; - } + return targetClip; + + } - } ); + const AnimationUtils = { + arraySlice: arraySlice, + convertArray: convertArray, + isTypedArray: isTypedArray, + getKeyframeOrder: getKeyframeOrder, + sortedArray: sortedArray, + flattenJSON: flattenJSON, + subclip: subclip, + makeClipAdditive: makeClipAdditive + }; /** - * @author alteredq / http://alteredqualia.com/ + * Abstract base class of interpolants over parametric samples. + * + * The parameter domain is one dimensional, typically the time or a path + * along a curve defined by the data. + * + * The sample values can have any dimensionality and derived classes may + * apply special interpretations to the data. + * + * This class provides the interval seek in a Template Method, deferring + * the actual interpolation to derived classes. + * + * Time complexity is O(1) for linear access crossing at most two points + * and O(log N) for random access, where N is the number of positions. + * + * References: + * + * http://www.oodesign.com/template-method-pattern.html + * */ - function Clock( autoStart ) { + class Interpolant { - this.autoStart = ( autoStart !== undefined ) ? autoStart : true; + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - this.startTime = 0; - this.oldTime = 0; - this.elapsedTime = 0; + this.parameterPositions = parameterPositions; + this._cachedIndex = 0; - this.running = false; + this.resultBuffer = resultBuffer !== undefined ? + resultBuffer : new sampleValues.constructor( sampleSize ); + this.sampleValues = sampleValues; + this.valueSize = sampleSize; - } + this.settings = null; + this.DefaultSettings_ = {}; - Object.assign( Clock.prototype, { + } - start: function () { + evaluate( t ) { - this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732 + const pp = this.parameterPositions; + let i1 = this._cachedIndex, + t1 = pp[ i1 ], + t0 = pp[ i1 - 1 ]; - this.oldTime = this.startTime; - this.elapsedTime = 0; - this.running = true; + validate_interval: { - }, + seek: { - stop: function () { + let right; - this.getElapsedTime(); - this.running = false; - this.autoStart = false; + linear_scan: { - }, - - getElapsedTime: function () { + //- See http://jsperf.com/comparison-to-undefined/3 + //- slower code: + //- + //- if ( t >= t1 || t1 === undefined ) { + forward_scan: if ( ! ( t < t1 ) ) { - this.getDelta(); - return this.elapsedTime; + for ( let giveUpAt = i1 + 2; ; ) { - }, + if ( t1 === undefined ) { - getDelta: function () { + if ( t < t0 ) break forward_scan; - var diff = 0; + // after end - if ( this.autoStart && ! this.running ) { + i1 = pp.length; + this._cachedIndex = i1; + return this.copySampleValue_( i1 - 1 ); - this.start(); - return 0; + } - } + if ( i1 === giveUpAt ) break; // this loop - if ( this.running ) { + t0 = t1; + t1 = pp[ ++ i1 ]; - var newTime = ( typeof performance === 'undefined' ? Date : performance ).now(); + if ( t < t1 ) { - diff = ( newTime - this.oldTime ) / 1000; - this.oldTime = newTime; + // we have arrived at the sought interval + break seek; - this.elapsedTime += diff; + } - } + } - return diff; + // prepare binary search on the right side of the index + right = pp.length; + break linear_scan; - } + } - } ); + //- slower code: + //- if ( t < t0 || t0 === undefined ) { + if ( ! ( t >= t0 ) ) { - /** - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - * - * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system - * - * The poles (phi) are at the positive and negative y axis. - * The equator starts at positive z. - */ + // looping? - function Spherical( radius, phi, theta ) { + const t1global = pp[ 1 ]; - this.radius = ( radius !== undefined ) ? radius : 1.0; - this.phi = ( phi !== undefined ) ? phi : 0; // up / down towards top and bottom pole - this.theta = ( theta !== undefined ) ? theta : 0; // around the equator of the sphere + if ( t < t1global ) { - return this; + i1 = 2; // + 1, using the scan for the details + t0 = t1global; - } + } - Object.assign( Spherical.prototype, { + // linear reverse scan - set: function ( radius, phi, theta ) { + for ( let giveUpAt = i1 - 2; ; ) { - this.radius = radius; - this.phi = phi; - this.theta = theta; + if ( t0 === undefined ) { - return this; + // before start - }, + this._cachedIndex = 0; + return this.copySampleValue_( 0 ); - clone: function () { + } - return new this.constructor().copy( this ); + if ( i1 === giveUpAt ) break; // this loop - }, + t1 = t0; + t0 = pp[ -- i1 - 1 ]; - copy: function ( other ) { + if ( t >= t0 ) { - this.radius = other.radius; - this.phi = other.phi; - this.theta = other.theta; + // we have arrived at the sought interval + break seek; - return this; + } - }, + } - // restrict phi to be betwee EPS and PI-EPS - makeSafe: function() { + // prepare binary search on the left side of the index + right = i1; + i1 = 0; + break linear_scan; - var EPS = 0.000001; - this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) ); + } - return this; + // the interval is valid - }, + break validate_interval; - setFromVector3: function( vec3 ) { + } // linear scan - this.radius = vec3.length(); + // binary search - if ( this.radius === 0 ) { + while ( i1 < right ) { - this.theta = 0; - this.phi = 0; + const mid = ( i1 + right ) >>> 1; - } else { + if ( t < pp[ mid ] ) { - this.theta = Math.atan2( vec3.x, vec3.z ); // equator angle around y-up axis - this.phi = Math.acos( _Math.clamp( vec3.y / this.radius, - 1, 1 ) ); // polar angle + right = mid; - } + } else { - return this; + i1 = mid + 1; - } + } - } ); + } - /** - * @author Mugen87 / https://github.com/Mugen87 - * - * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system - * - */ + t1 = pp[ i1 ]; + t0 = pp[ i1 - 1 ]; - function Cylindrical( radius, theta, y ) { + // check boundary cases, again - this.radius = ( radius !== undefined ) ? radius : 1.0; // distance from the origin to a point in the x-z plane - this.theta = ( theta !== undefined ) ? theta : 0; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis - this.y = ( y !== undefined ) ? y : 0; // height above the x-z plane + if ( t0 === undefined ) { - return this; + this._cachedIndex = 0; + return this.copySampleValue_( 0 ); - } + } - Object.assign( Cylindrical.prototype, { + if ( t1 === undefined ) { - set: function ( radius, theta, y ) { + i1 = pp.length; + this._cachedIndex = i1; + return this.copySampleValue_( i1 - 1 ); - this.radius = radius; - this.theta = theta; - this.y = y; + } - return this; + } // seek - }, + this._cachedIndex = i1; - clone: function () { + this.intervalChanged_( i1, t0, t1 ); - return new this.constructor().copy( this ); + } // validate_interval - }, + return this.interpolate_( i1, t0, t, t1 ); - copy: function ( other ) { + } - this.radius = other.radius; - this.theta = other.theta; - this.y = other.y; + getSettings_() { - return this; + return this.settings || this.DefaultSettings_; - }, + } - setFromVector3: function( vec3 ) { + copySampleValue_( index ) { - this.radius = Math.sqrt( vec3.x * vec3.x + vec3.z * vec3.z ); - this.theta = Math.atan2( vec3.x, vec3.z ); - this.y = vec3.y; + // copies a sample value to the result buffer - return this; + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + offset = index * stride; - } + for ( let i = 0; i !== stride; ++ i ) { - } ); + result[ i ] = values[ offset + i ]; - /** - * @author alteredq / http://alteredqualia.com/ - */ + } - function MorphBlendMesh( geometry, material ) { + return result; - Mesh.call( this, geometry, material ); + } - this.animationsMap = {}; - this.animationsList = []; + // Template methods for derived classes: - // prepare default animation - // (all frames played together in 1 second) + interpolate_( /* i1, t0, t, t1 */ ) { - var numFrames = this.geometry.morphTargets.length; + throw new Error( 'call to abstract method' ); + // implementations shall return this.resultBuffer - var name = "__default"; + } - var startFrame = 0; - var endFrame = numFrames - 1; + intervalChanged_( /* i1, t0, t1 */ ) { - var fps = numFrames / 1; + // empty - this.createAnimation( name, startFrame, endFrame, fps ); - this.setAnimationWeight( name, 1 ); + } } - MorphBlendMesh.prototype = Object.create( Mesh.prototype ); - MorphBlendMesh.prototype.constructor = MorphBlendMesh; - - MorphBlendMesh.prototype.createAnimation = function ( name, start, end, fps ) { - - var animation = { + /** + * Fast and simple cubic spline interpolant. + * + * It was derived from a Hermitian construction setting the first derivative + * at each sample position to the linear slope between neighboring positions + * over their parameter interval. + */ - start: start, - end: end, + class CubicInterpolant extends Interpolant { - length: end - start + 1, + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - fps: fps, - duration: ( end - start ) / fps, + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); - lastFrame: 0, - currentFrame: 0, + this._weightPrev = - 0; + this._offsetPrev = - 0; + this._weightNext = - 0; + this._offsetNext = - 0; - active: false, + this.DefaultSettings_ = { - time: 0, - direction: 1, - weight: 1, + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding - directionBackwards: false, - mirroredLoop: false + }; - }; + } - this.animationsMap[ name ] = animation; - this.animationsList.push( animation ); + intervalChanged_( i1, t0, t1 ) { - }; + const pp = this.parameterPositions; + let iPrev = i1 - 2, + iNext = i1 + 1, - MorphBlendMesh.prototype.autoCreateAnimations = function ( fps ) { + tPrev = pp[ iPrev ], + tNext = pp[ iNext ]; - var pattern = /([a-z]+)_?(\d+)/i; + if ( tPrev === undefined ) { - var firstAnimation, frameRanges = {}; + switch ( this.getSettings_().endingStart ) { - var geometry = this.geometry; + case ZeroSlopeEnding: - for ( var i = 0, il = geometry.morphTargets.length; i < il; i ++ ) { + // f'(t0) = 0 + iPrev = i1; + tPrev = 2 * t0 - t1; - var morph = geometry.morphTargets[ i ]; - var chunks = morph.name.match( pattern ); + break; - if ( chunks && chunks.length > 1 ) { + case WrapAroundEnding: - var name = chunks[ 1 ]; + // use the other end of the curve + iPrev = pp.length - 2; + tPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ]; - if ( ! frameRanges[ name ] ) frameRanges[ name ] = { start: Infinity, end: - Infinity }; + break; - var range = frameRanges[ name ]; + default: // ZeroCurvatureEnding - if ( i < range.start ) range.start = i; - if ( i > range.end ) range.end = i; + // f''(t0) = 0 a.k.a. Natural Spline + iPrev = i1; + tPrev = t1; - if ( ! firstAnimation ) firstAnimation = name; + } } - } - - for ( var name in frameRanges ) { - - var range = frameRanges[ name ]; - this.createAnimation( name, range.start, range.end, fps ); + if ( tNext === undefined ) { - } + switch ( this.getSettings_().endingEnd ) { - this.firstAnimation = firstAnimation; + case ZeroSlopeEnding: - }; + // f'(tN) = 0 + iNext = i1; + tNext = 2 * t1 - t0; - MorphBlendMesh.prototype.setAnimationDirectionForward = function ( name ) { + break; - var animation = this.animationsMap[ name ]; + case WrapAroundEnding: - if ( animation ) { + // use the other end of the curve + iNext = 1; + tNext = t1 + pp[ 1 ] - pp[ 0 ]; - animation.direction = 1; - animation.directionBackwards = false; + break; - } + default: // ZeroCurvatureEnding - }; + // f''(tN) = 0, a.k.a. Natural Spline + iNext = i1 - 1; + tNext = t0; - MorphBlendMesh.prototype.setAnimationDirectionBackward = function ( name ) { + } - var animation = this.animationsMap[ name ]; + } - if ( animation ) { + const halfDt = ( t1 - t0 ) * 0.5, + stride = this.valueSize; - animation.direction = - 1; - animation.directionBackwards = true; + this._weightPrev = halfDt / ( t0 - tPrev ); + this._weightNext = halfDt / ( tNext - t1 ); + this._offsetPrev = iPrev * stride; + this._offsetNext = iNext * stride; } - }; + interpolate_( i1, t0, t, t1 ) { - MorphBlendMesh.prototype.setAnimationFPS = function ( name, fps ) { + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, - var animation = this.animationsMap[ name ]; + o1 = i1 * stride, o0 = o1 - stride, + oP = this._offsetPrev, oN = this._offsetNext, + wP = this._weightPrev, wN = this._weightNext, - if ( animation ) { + p = ( t - t0 ) / ( t1 - t0 ), + pp = p * p, + ppp = pp * p; - animation.fps = fps; - animation.duration = ( animation.end - animation.start ) / animation.fps; + // evaluate polynomials - } + const sP = - wP * ppp + 2 * wP * pp - wP * p; + const s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1; + const s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p; + const sN = wN * ppp - wN * pp; - }; + // combine data linearly - MorphBlendMesh.prototype.setAnimationDuration = function ( name, duration ) { + for ( let i = 0; i !== stride; ++ i ) { - var animation = this.animationsMap[ name ]; + result[ i ] = + sP * values[ oP + i ] + + s0 * values[ o0 + i ] + + s1 * values[ o1 + i ] + + sN * values[ oN + i ]; - if ( animation ) { + } - animation.duration = duration; - animation.fps = ( animation.end - animation.start ) / animation.duration; + return result; } - }; - - MorphBlendMesh.prototype.setAnimationWeight = function ( name, weight ) { + } - var animation = this.animationsMap[ name ]; + class LinearInterpolant extends Interpolant { - if ( animation ) { + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - animation.weight = weight; + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); } - }; + interpolate_( i1, t0, t, t1 ) { - MorphBlendMesh.prototype.setAnimationTime = function ( name, time ) { + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, - var animation = this.animationsMap[ name ]; + offset1 = i1 * stride, + offset0 = offset1 - stride, - if ( animation ) { + weight1 = ( t - t0 ) / ( t1 - t0 ), + weight0 = 1 - weight1; - animation.time = time; + for ( let i = 0; i !== stride; ++ i ) { - } + result[ i ] = + values[ offset0 + i ] * weight0 + + values[ offset1 + i ] * weight1; - }; - - MorphBlendMesh.prototype.getAnimationTime = function ( name ) { - - var time = 0; - - var animation = this.animationsMap[ name ]; - - if ( animation ) { + } - time = animation.time; + return result; } - return time; + } - }; + /** + * + * Interpolant that evaluates to the sample value at the position preceding + * the parameter. + */ - MorphBlendMesh.prototype.getAnimationDuration = function ( name ) { + class DiscreteInterpolant extends Interpolant { - var duration = - 1; + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - var animation = this.animationsMap[ name ]; + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); - if ( animation ) { + } - duration = animation.duration; + interpolate_( i1 /*, t0, t, t1 */ ) { - } + return this.copySampleValue_( i1 - 1 ); - return duration; + } - }; + } - MorphBlendMesh.prototype.playAnimation = function ( name ) { + class KeyframeTrack { - var animation = this.animationsMap[ name ]; + constructor( name, times, values, interpolation ) { - if ( animation ) { + if ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' ); + if ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name ); - animation.time = 0; - animation.active = true; + this.name = name; - } else { + this.times = convertArray( times, this.TimeBufferType ); + this.values = convertArray( values, this.ValueBufferType ); - console.warn( "THREE.MorphBlendMesh: animation[" + name + "] undefined in .playAnimation()" ); + this.setInterpolation( interpolation || this.DefaultInterpolation ); } - }; + // Serialization (in static context, because of constructor invocation + // and automatic invocation of .toJSON): - MorphBlendMesh.prototype.stopAnimation = function ( name ) { + static toJSON( track ) { - var animation = this.animationsMap[ name ]; + const trackType = track.constructor; - if ( animation ) { + let json; - animation.active = false; + // derived classes can define a static toJSON method + if ( trackType.toJSON !== this.toJSON ) { - } + json = trackType.toJSON( track ); - }; + } else { - MorphBlendMesh.prototype.update = function ( delta ) { + // by default, we assume the data can be serialized as-is + json = { - for ( var i = 0, il = this.animationsList.length; i < il; i ++ ) { + 'name': track.name, + 'times': convertArray( track.times, Array ), + 'values': convertArray( track.values, Array ) - var animation = this.animationsList[ i ]; + }; - if ( ! animation.active ) continue; + const interpolation = track.getInterpolation(); - var frameTime = animation.duration / animation.length; + if ( interpolation !== track.DefaultInterpolation ) { - animation.time += animation.direction * delta; + json.interpolation = interpolation; - if ( animation.mirroredLoop ) { + } - if ( animation.time > animation.duration || animation.time < 0 ) { + } - animation.direction *= - 1; + json.type = track.ValueTypeName; // mandatory - if ( animation.time > animation.duration ) { + return json; - animation.time = animation.duration; - animation.directionBackwards = true; + } - } + InterpolantFactoryMethodDiscrete( result ) { - if ( animation.time < 0 ) { + return new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result ); - animation.time = 0; - animation.directionBackwards = false; + } - } + InterpolantFactoryMethodLinear( result ) { - } + return new LinearInterpolant( this.times, this.values, this.getValueSize(), result ); - } else { + } - animation.time = animation.time % animation.duration; + InterpolantFactoryMethodSmooth( result ) { - if ( animation.time < 0 ) animation.time += animation.duration; + return new CubicInterpolant( this.times, this.values, this.getValueSize(), result ); - } + } - var keyframe = animation.start + _Math.clamp( Math.floor( animation.time / frameTime ), 0, animation.length - 1 ); - var weight = animation.weight; + setInterpolation( interpolation ) { - if ( keyframe !== animation.currentFrame ) { + let factoryMethod; - this.morphTargetInfluences[ animation.lastFrame ] = 0; - this.morphTargetInfluences[ animation.currentFrame ] = 1 * weight; + switch ( interpolation ) { - this.morphTargetInfluences[ keyframe ] = 0; + case InterpolateDiscrete: - animation.lastFrame = animation.currentFrame; - animation.currentFrame = keyframe; + factoryMethod = this.InterpolantFactoryMethodDiscrete; - } + break; - var mix = ( animation.time % frameTime ) / frameTime; + case InterpolateLinear: - if ( animation.directionBackwards ) mix = 1 - mix; + factoryMethod = this.InterpolantFactoryMethodLinear; - if ( animation.currentFrame !== animation.lastFrame ) { + break; - this.morphTargetInfluences[ animation.currentFrame ] = mix * weight; - this.morphTargetInfluences[ animation.lastFrame ] = ( 1 - mix ) * weight; + case InterpolateSmooth: - } else { + factoryMethod = this.InterpolantFactoryMethodSmooth; - this.morphTargetInfluences[ animation.currentFrame ] = weight; + break; } - } + if ( factoryMethod === undefined ) { - }; + const message = 'unsupported interpolation for ' + + this.ValueTypeName + ' keyframe track named ' + this.name; - /** - * @author alteredq / http://alteredqualia.com/ - */ + if ( this.createInterpolant === undefined ) { - function ImmediateRenderObject( material ) { + // fall back to default, unless the default itself is messed up + if ( interpolation !== this.DefaultInterpolation ) { - Object3D.call( this ); + this.setInterpolation( this.DefaultInterpolation ); - this.material = material; - this.render = function ( renderCallback ) {}; + } else { - } + throw new Error( message ); // fatal, in this case - ImmediateRenderObject.prototype = Object.create( Object3D.prototype ); - ImmediateRenderObject.prototype.constructor = ImmediateRenderObject; + } - ImmediateRenderObject.prototype.isImmediateRenderObject = true; + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ + console.warn( 'THREE.KeyframeTrack:', message ); + return this; - function VertexNormalsHelper( object, size, hex, linewidth ) { + } - this.object = object; + this.createInterpolant = factoryMethod; - this.size = ( size !== undefined ) ? size : 1; + return this; - var color = ( hex !== undefined ) ? hex : 0xff0000; + } - var width = ( linewidth !== undefined ) ? linewidth : 1; + getInterpolation() { - // + switch ( this.createInterpolant ) { + + case this.InterpolantFactoryMethodDiscrete: - var nNormals = 0; + return InterpolateDiscrete; - var objGeometry = this.object.geometry; + case this.InterpolantFactoryMethodLinear: - if ( objGeometry && objGeometry.isGeometry ) { + return InterpolateLinear; - nNormals = objGeometry.faces.length * 3; + case this.InterpolantFactoryMethodSmooth: - } else if ( objGeometry && objGeometry.isBufferGeometry ) { + return InterpolateSmooth; - nNormals = objGeometry.attributes.normal.count; + } } - // + getValueSize() { - var geometry = new BufferGeometry(); + return this.values.length / this.times.length; - var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 ); + } - geometry.addAttribute( 'position', positions ); + // move all keyframes either forwards or backwards in time + shift( timeOffset ) { - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); + if ( timeOffset !== 0.0 ) { - // + const times = this.times; - this.matrixAutoUpdate = false; + for ( let i = 0, n = times.length; i !== n; ++ i ) { - this.update(); + times[ i ] += timeOffset; - } + } - VertexNormalsHelper.prototype = Object.create( LineSegments.prototype ); - VertexNormalsHelper.prototype.constructor = VertexNormalsHelper; + } - VertexNormalsHelper.prototype.update = ( function () { + return this; - var v1 = new Vector3(); - var v2 = new Vector3(); - var normalMatrix = new Matrix3(); + } - return function update() { + // scale all keyframe times by a factor (useful for frame <-> seconds conversions) + scale( timeScale ) { - var keys = [ 'a', 'b', 'c' ]; + if ( timeScale !== 1.0 ) { - this.object.updateMatrixWorld( true ); + const times = this.times; - normalMatrix.getNormalMatrix( this.object.matrixWorld ); + for ( let i = 0, n = times.length; i !== n; ++ i ) { - var matrixWorld = this.object.matrixWorld; + times[ i ] *= timeScale; - var position = this.geometry.attributes.position; + } - // + } - var objGeometry = this.object.geometry; + return this; - if ( objGeometry && objGeometry.isGeometry ) { + } - var vertices = objGeometry.vertices; + // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. + // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values + trim( startTime, endTime ) { - var faces = objGeometry.faces; + const times = this.times, + nKeys = times.length; - var idx = 0; + let from = 0, + to = nKeys - 1; - for ( var i = 0, l = faces.length; i < l; i ++ ) { + while ( from !== nKeys && times[ from ] < startTime ) { - var face = faces[ i ]; + ++ from; - for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { + } - var vertex = vertices[ face[ keys[ j ] ] ]; + while ( to !== - 1 && times[ to ] > endTime ) { - var normal = face.vertexNormals[ j ]; + -- to; - v1.copy( vertex ).applyMatrix4( matrixWorld ); + } - v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + ++ to; // inclusive -> exclusive bound - position.setXYZ( idx, v1.x, v1.y, v1.z ); + if ( from !== 0 || to !== nKeys ) { - idx = idx + 1; + // empty tracks are forbidden, so keep at least one keyframe + if ( from >= to ) { - position.setXYZ( idx, v2.x, v2.y, v2.z ); + to = Math.max( to, 1 ); + from = to - 1; - idx = idx + 1; + } - } + const stride = this.getValueSize(); + this.times = arraySlice( times, from, to ); + this.values = arraySlice( this.values, from * stride, to * stride ); - } + } - } else if ( objGeometry && objGeometry.isBufferGeometry ) { + return this; - var objPos = objGeometry.attributes.position; + } - var objNorm = objGeometry.attributes.normal; + // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable + validate() { - var idx = 0; + let valid = true; - // for simplicity, ignore index and drawcalls, and render every normal + const valueSize = this.getValueSize(); + if ( valueSize - Math.floor( valueSize ) !== 0 ) { - for ( var j = 0, jl = objPos.count; j < jl; j ++ ) { + console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this ); + valid = false; - v1.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); + } - v2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) ); + const times = this.times, + values = this.values, - v2.applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + nKeys = times.length; - position.setXYZ( idx, v1.x, v1.y, v1.z ); + if ( nKeys === 0 ) { - idx = idx + 1; + console.error( 'THREE.KeyframeTrack: Track is empty.', this ); + valid = false; - position.setXYZ( idx, v2.x, v2.y, v2.z ); + } - idx = idx + 1; + let prevTime = null; - } + for ( let i = 0; i !== nKeys; i ++ ) { - } + const currTime = times[ i ]; - position.needsUpdate = true; + if ( typeof currTime === 'number' && isNaN( currTime ) ) { - }; + console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime ); + valid = false; + break; - }() ); + } - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ + if ( prevTime !== null && prevTime > currTime ) { - function SpotLightHelper( light ) { + console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime ); + valid = false; + break; - Object3D.call( this ); + } - this.light = light; - this.light.updateMatrixWorld(); + prevTime = currTime; - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + } - var geometry = new BufferGeometry(); + if ( values !== undefined ) { - var positions = [ - 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 1, - 0, 0, 0, - 1, 0, 1, - 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, - 1, 1 - ]; + if ( isTypedArray( values ) ) { - for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + for ( let i = 0, n = values.length; i !== n; ++ i ) { - var p1 = ( i / l ) * Math.PI * 2; - var p2 = ( j / l ) * Math.PI * 2; + const value = values[ i ]; - positions.push( - Math.cos( p1 ), Math.sin( p1 ), 1, - Math.cos( p2 ), Math.sin( p2 ), 1 - ); + if ( isNaN( value ) ) { - } + console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value ); + valid = false; + break; - geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + } - var material = new LineBasicMaterial( { fog: false } ); + } - this.cone = new LineSegments( geometry, material ); - this.add( this.cone ); + } - this.update(); + } - } + return valid; - SpotLightHelper.prototype = Object.create( Object3D.prototype ); - SpotLightHelper.prototype.constructor = SpotLightHelper; + } - SpotLightHelper.prototype.dispose = function () { + // removes equivalent sequential keys as common in morph target sequences + // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) + optimize() { - this.cone.geometry.dispose(); - this.cone.material.dispose(); + // times or values may be shared with other tracks, so overwriting is unsafe + const times = arraySlice( this.times ), + values = arraySlice( this.values ), + stride = this.getValueSize(), - }; + smoothInterpolation = this.getInterpolation() === InterpolateSmooth, - SpotLightHelper.prototype.update = function () { + lastIndex = times.length - 1; - var vector = new Vector3(); - var vector2 = new Vector3(); + let writeIndex = 1; - return function update() { + for ( let i = 1; i < lastIndex; ++ i ) { - this.light.updateMatrixWorld(); + let keep = false; - var coneLength = this.light.distance ? this.light.distance : 1000; - var coneWidth = coneLength * Math.tan( this.light.angle ); + const time = times[ i ]; + const timeNext = times[ i + 1 ]; - this.cone.scale.set( coneWidth, coneWidth, coneLength ); + // remove adjacent keyframes scheduled at the same time - vector.setFromMatrixPosition( this.light.matrixWorld ); - vector2.setFromMatrixPosition( this.light.target.matrixWorld ); + if ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) { - this.cone.lookAt( vector2.sub( vector ) ); + if ( ! smoothInterpolation ) { - this.cone.material.color.copy( this.light.color ); + // remove unnecessary keyframes same as their neighbors - }; + const offset = i * stride, + offsetP = offset - stride, + offsetN = offset + stride; - }(); + for ( let j = 0; j !== stride; ++ j ) { - /** - * @author Sean Griffin / http://twitter.com/sgrif - * @author Michael Guerrero / http://realitymeltdown.com - * @author mrdoob / http://mrdoob.com/ - * @author ikerr / http://verold.com - * @author Mugen87 / https://github.com/Mugen87 - */ + const value = values[ offset + j ]; - function getBoneList( object ) { + if ( value !== values[ offsetP + j ] || + value !== values[ offsetN + j ] ) { - var boneList = []; + keep = true; + break; - if ( object && object.isBone ) { + } - boneList.push( object ); + } - } + } else { - for ( var i = 0; i < object.children.length; i ++ ) { + keep = true; - boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); + } - } + } - return boneList; + // in-place compaction - } + if ( keep ) { - function SkeletonHelper( object ) { + if ( i !== writeIndex ) { - var bones = getBoneList( object ); + times[ writeIndex ] = times[ i ]; - var geometry = new BufferGeometry(); + const readOffset = i * stride, + writeOffset = writeIndex * stride; - var vertices = []; - var colors = []; + for ( let j = 0; j !== stride; ++ j ) { - var color1 = new Color( 0, 0, 1 ); - var color2 = new Color( 0, 1, 0 ); + values[ writeOffset + j ] = values[ readOffset + j ]; - for ( var i = 0; i < bones.length; i ++ ) { + } - var bone = bones[ i ]; + } - if ( bone.parent && bone.parent.isBone ) { + ++ writeIndex; - vertices.push( 0, 0, 0 ); - vertices.push( 0, 0, 0 ); - colors.push( color1.r, color1.g, color1.b ); - colors.push( color2.r, color2.g, color2.b ); + } } - } + // flush last keyframe (compaction looks ahead) - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + if ( lastIndex > 0 ) { - var material = new LineBasicMaterial( { vertexColors: VertexColors, depthTest: false, depthWrite: false, transparent: true } ); + times[ writeIndex ] = times[ lastIndex ]; - LineSegments.call( this, geometry, material ); + for ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) { - this.root = object; - this.bones = bones; + values[ writeOffset + j ] = values[ readOffset + j ]; - this.matrix = object.matrixWorld; - this.matrixAutoUpdate = false; + } - this.onBeforeRender(); + ++ writeIndex; - } + } - SkeletonHelper.prototype = Object.create( LineSegments.prototype ); - SkeletonHelper.prototype.constructor = SkeletonHelper; + if ( writeIndex !== times.length ) { - SkeletonHelper.prototype.onBeforeRender = function () { + this.times = arraySlice( times, 0, writeIndex ); + this.values = arraySlice( values, 0, writeIndex * stride ); - var vector = new Vector3(); + } else { - var boneMatrix = new Matrix4(); - var matrixWorldInv = new Matrix4(); + this.times = times; + this.values = values; - return function onBeforeRender() { + } - var bones = this.bones; + return this; - var geometry = this.geometry; - var position = geometry.getAttribute( 'position' ); + } - matrixWorldInv.getInverse( this.root.matrixWorld ); + clone() { - for ( var i = 0, j = 0; i < bones.length; i ++ ) { + const times = arraySlice( this.times, 0 ); + const values = arraySlice( this.values, 0 ); - var bone = bones[ i ]; + const TypedKeyframeTrack = this.constructor; + const track = new TypedKeyframeTrack( this.name, times, values ); - if ( bone.parent && bone.parent.isBone ) { + // Interpolant argument to constructor is not saved, so copy the factory method directly. + track.createInterpolant = this.createInterpolant; - boneMatrix.multiplyMatrices( matrixWorldInv, bone.matrixWorld ); - vector.setFromMatrixPosition( boneMatrix ); - position.setXYZ( j, vector.x, vector.y, vector.z ); + return track; - boneMatrix.multiplyMatrices( matrixWorldInv, bone.parent.matrixWorld ); - vector.setFromMatrixPosition( boneMatrix ); - position.setXYZ( j + 1, vector.x, vector.y, vector.z ); + } - j += 2; + } - } + KeyframeTrack.prototype.TimeBufferType = Float32Array; + KeyframeTrack.prototype.ValueBufferType = Float32Array; + KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; - } + /** + * A Track of Boolean keyframe values. + */ + class BooleanKeyframeTrack extends KeyframeTrack {} - geometry.getAttribute( 'position' ).needsUpdate = true; + BooleanKeyframeTrack.prototype.ValueTypeName = 'bool'; + BooleanKeyframeTrack.prototype.ValueBufferType = Array; + BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; + BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined; + BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; - }; + /** + * A Track of keyframe values that represent color. + */ + class ColorKeyframeTrack extends KeyframeTrack {} - }(); + ColorKeyframeTrack.prototype.ValueTypeName = 'color'; /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ + * A Track of numeric keyframe values. */ + class NumberKeyframeTrack extends KeyframeTrack {} - function PointLightHelper( light, sphereSize ) { + NumberKeyframeTrack.prototype.ValueTypeName = 'number'; - this.light = light; - this.light.updateMatrixWorld(); + /** + * Spherical linear unit quaternion interpolant. + */ - var geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); - var material = new MeshBasicMaterial( { wireframe: true, fog: false } ); - material.color.copy( this.light.color ); + class QuaternionLinearInterpolant extends Interpolant { - Mesh.call( this, geometry, material ); + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - this.matrix = this.light.matrixWorld; - this.matrixAutoUpdate = false; + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); - /* - var distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 ); - var distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); + } - this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); - this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial ); + interpolate_( i1, t0, t, t1 ) { - var d = light.distance; + const result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, - if ( d === 0.0 ) { + alpha = ( t - t0 ) / ( t1 - t0 ); - this.lightDistance.visible = false; + let offset = i1 * stride; - } else { + for ( let end = offset + stride; offset !== end; offset += 4 ) { - this.lightDistance.scale.set( d, d, d ); + Quaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha ); - } + } - this.add( this.lightDistance ); - */ + return result; - } + } - PointLightHelper.prototype = Object.create( Mesh.prototype ); - PointLightHelper.prototype.constructor = PointLightHelper; + } - PointLightHelper.prototype.dispose = function () { + /** + * A Track of quaternion keyframe values. + */ + class QuaternionKeyframeTrack extends KeyframeTrack { - this.geometry.dispose(); - this.material.dispose(); + InterpolantFactoryMethodLinear( result ) { - }; + return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result ); - PointLightHelper.prototype.update = function () { + } - this.material.color.copy( this.light.color ); + } - /* - var d = this.light.distance; + QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion'; + // ValueBufferType is inherited + QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; + QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; - if ( d === 0.0 ) { + /** + * A Track that interpolates Strings + */ + class StringKeyframeTrack extends KeyframeTrack {} - this.lightDistance.visible = false; + StringKeyframeTrack.prototype.ValueTypeName = 'string'; + StringKeyframeTrack.prototype.ValueBufferType = Array; + StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; + StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined; + StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; - } else { + /** + * A Track of vectored keyframe values. + */ + class VectorKeyframeTrack extends KeyframeTrack {} - this.lightDistance.visible = true; - this.lightDistance.scale.set( d, d, d ); + VectorKeyframeTrack.prototype.ValueTypeName = 'vector'; - } - */ + class AnimationClip { - }; + constructor( name, duration = - 1, tracks, blendMode = NormalAnimationBlendMode ) { - /** - * @author abelnation / http://github.com/abelnation - * @author Mugen87 / http://github.com/Mugen87 - * @author WestLangley / http://github.com/WestLangley - */ + this.name = name; + this.tracks = tracks; + this.duration = duration; + this.blendMode = blendMode; - function RectAreaLightHelper( light ) { + this.uuid = generateUUID(); - Object3D.call( this ); + // this means it should figure out its duration by scanning the tracks + if ( this.duration < 0 ) { - this.light = light; - this.light.updateMatrixWorld(); + this.resetDuration(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + } - var material = new LineBasicMaterial( { color: light.color } ); + } - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new BufferAttribute( new Float32Array( 5 * 3 ), 3 ) ); + static parse( json ) { - this.add( new Line( geometry, material ) ); + const tracks = [], + jsonTracks = json.tracks, + frameTime = 1.0 / ( json.fps || 1.0 ); - this.update(); + for ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) { - } + tracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) ); - RectAreaLightHelper.prototype = Object.create( Object3D.prototype ); - RectAreaLightHelper.prototype.constructor = RectAreaLightHelper; + } - RectAreaLightHelper.prototype.dispose = function () { + const clip = new this( json.name, json.duration, tracks, json.blendMode ); + clip.uuid = json.uuid; - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); + return clip; - }; + } - RectAreaLightHelper.prototype.update = function () { + static toJSON( clip ) { - var line = this.children[ 0 ]; + const tracks = [], + clipTracks = clip.tracks; + + const json = { + + 'name': clip.name, + 'duration': clip.duration, + 'tracks': tracks, + 'uuid': clip.uuid, + 'blendMode': clip.blendMode + + }; + + for ( let i = 0, n = clipTracks.length; i !== n; ++ i ) { - // update material + tracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) ); - line.material.color.copy( this.light.color ); + } - // calculate new dimensions of the helper + return json; - var hx = this.light.width * 0.5; - var hy = this.light.height * 0.5; + } - var position = line.geometry.attributes.position; - var array = position.array; + static CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) { - // update vertices + const numMorphTargets = morphTargetSequence.length; + const tracks = []; - array[ 0 ] = hx; array[ 1 ] = - hy; array[ 2 ] = 0; - array[ 3 ] = hx; array[ 4 ] = hy; array[ 5 ] = 0; - array[ 6 ] = - hx; array[ 7 ] = hy; array[ 8 ] = 0; - array[ 9 ] = - hx; array[ 10 ] = - hy; array[ 11 ] = 0; - array[ 12 ] = hx; array[ 13 ] = - hy; array[ 14 ] = 0; + for ( let i = 0; i < numMorphTargets; i ++ ) { - position.needsUpdate = true; + let times = []; + let values = []; - }; + times.push( + ( i + numMorphTargets - 1 ) % numMorphTargets, + i, + ( i + 1 ) % numMorphTargets ); - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ + values.push( 0, 1, 0 ); - function HemisphereLightHelper( light, size ) { + const order = getKeyframeOrder( times ); + times = sortedArray( times, 1, order ); + values = sortedArray( values, 1, order ); - Object3D.call( this ); + // if there is a key at the first frame, duplicate it as the + // last frame as well for perfect loop. + if ( ! noLoop && times[ 0 ] === 0 ) { - this.light = light; - this.light.updateMatrixWorld(); + times.push( numMorphTargets ); + values.push( values[ 0 ] ); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + } - var geometry = new OctahedronBufferGeometry( size ); - geometry.rotateY( Math.PI * 0.5 ); + tracks.push( + new NumberKeyframeTrack( + '.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']', + times, values + ).scale( 1.0 / fps ) ); - var material = new MeshBasicMaterial( { vertexColors: VertexColors, wireframe: true } ); + } - var position = geometry.getAttribute( 'position' ); - var colors = new Float32Array( position.count * 3 ); + return new this( name, - 1, tracks ); - geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) ); + } - this.add( new Mesh( geometry, material ) ); + static findByName( objectOrClipArray, name ) { - this.update(); + let clipArray = objectOrClipArray; - } + if ( ! Array.isArray( objectOrClipArray ) ) { - HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); - HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; + const o = objectOrClipArray; + clipArray = o.geometry && o.geometry.animations || o.animations; - HemisphereLightHelper.prototype.dispose = function () { + } - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); + for ( let i = 0; i < clipArray.length; i ++ ) { - }; + if ( clipArray[ i ].name === name ) { - HemisphereLightHelper.prototype.update = function () { + return clipArray[ i ]; - var vector = new Vector3(); + } - var color1 = new Color(); - var color2 = new Color(); + } - return function update() { + return null; - var mesh = this.children[ 0 ]; + } - var colors = mesh.geometry.getAttribute( 'color' ); + static CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) { - color1.copy( this.light.color ); - color2.copy( this.light.groundColor ); + const animationToMorphTargets = {}; - for ( var i = 0, l = colors.count; i < l; i ++ ) { + // tested with https://regex101.com/ on trick sequences + // such flamingo_flyA_003, flamingo_run1_003, crdeath0059 + const pattern = /^([\w-]*?)([\d]+)$/; - var color = ( i < ( l / 2 ) ) ? color1 : color2; + // sort morph target names into animation groups based + // patterns like Walk_001, Walk_002, Run_001, Run_002 + for ( let i = 0, il = morphTargets.length; i < il; i ++ ) { - colors.setXYZ( i, color.r, color.g, color.b ); + const morphTarget = morphTargets[ i ]; + const parts = morphTarget.name.match( pattern ); - } + if ( parts && parts.length > 1 ) { - mesh.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + const name = parts[ 1 ]; - colors.needsUpdate = true; + let animationMorphTargets = animationToMorphTargets[ name ]; - }; + if ( ! animationMorphTargets ) { - }(); + animationToMorphTargets[ name ] = animationMorphTargets = []; - /** - * @author mrdoob / http://mrdoob.com/ - */ + } - function GridHelper( size, divisions, color1, color2 ) { + animationMorphTargets.push( morphTarget ); - size = size || 10; - divisions = divisions || 10; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + } - var center = divisions / 2; - var step = size / divisions; - var halfSize = size / 2; + } - var vertices = [], colors = []; + const clips = []; - for ( var i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { + for ( const name in animationToMorphTargets ) { - vertices.push( - halfSize, 0, k, halfSize, 0, k ); - vertices.push( k, 0, - halfSize, k, 0, halfSize ); + clips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) ); - var color = i === center ? color1 : color2; + } - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; + return clips; } - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + // parse the animation.hierarchy format + static parseAnimation( animation, bones ) { - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); + if ( ! animation ) { - LineSegments.call( this, geometry, material ); + console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' ); + return null; - } + } - GridHelper.prototype = Object.create( LineSegments.prototype ); - GridHelper.prototype.constructor = GridHelper; + const addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) { - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / http://github.com/Mugen87 - * @author Hectate / http://www.github.com/Hectate - */ + // only return track if there are actually keys. + if ( animationKeys.length !== 0 ) { - function PolarGridHelper( radius, radials, circles, divisions, color1, color2 ) { + const times = []; + const values = []; - radius = radius || 10; - radials = radials || 16; - circles = circles || 8; - divisions = divisions || 64; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + flattenJSON( animationKeys, times, values, propertyName ); - var vertices = []; - var colors = []; + // empty keys are filtered out, so check again + if ( times.length !== 0 ) { - var x, z; - var v, i, j, r, color; + destTracks.push( new trackType( trackName, times, values ) ); - // create the radials + } - for ( i = 0; i <= radials; i ++ ) { + } - v = ( i / radials ) * ( Math.PI * 2 ); + }; - x = Math.sin( v ) * radius; - z = Math.cos( v ) * radius; + const tracks = []; - vertices.push( 0, 0, 0 ); - vertices.push( x, 0, z ); + const clipName = animation.name || 'default'; + const fps = animation.fps || 30; + const blendMode = animation.blendMode; - color = ( i & 1 ) ? color1 : color2; + // automatic length determination in AnimationClip. + let duration = animation.length || - 1; - colors.push( color.r, color.g, color.b ); - colors.push( color.r, color.g, color.b ); + const hierarchyTracks = animation.hierarchy || []; - } + for ( let h = 0; h < hierarchyTracks.length; h ++ ) { - // create the circles + const animationKeys = hierarchyTracks[ h ].keys; - for ( i = 0; i <= circles; i ++ ) { + // skip empty tracks + if ( ! animationKeys || animationKeys.length === 0 ) continue; - color = ( i & 1 ) ? color1 : color2; + // process morph targets + if ( animationKeys[ 0 ].morphTargets ) { - r = radius - ( radius / circles * i ); + // figure out all morph targets used in this track + const morphTargetNames = {}; - for ( j = 0; j < divisions; j ++ ) { + let k; - // first vertex + for ( k = 0; k < animationKeys.length; k ++ ) { - v = ( j / divisions ) * ( Math.PI * 2 ); + if ( animationKeys[ k ].morphTargets ) { - x = Math.sin( v ) * r; - z = Math.cos( v ) * r; + for ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) { - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); + morphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1; - // second vertex + } - v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); + } - x = Math.sin( v ) * r; - z = Math.cos( v ) * r; + } - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); + // create a track for each morph target with all zero + // morphTargetInfluences except for the keys in which + // the morphTarget is named. + for ( const morphTargetName in morphTargetNames ) { - } + const times = []; + const values = []; - } + for ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) { - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + const animationKey = animationKeys[ k ]; - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); + times.push( animationKey.time ); + values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 ); - LineSegments.call( this, geometry, material ); + } - } + tracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) ); - PolarGridHelper.prototype = Object.create( LineSegments.prototype ); - PolarGridHelper.prototype.constructor = PolarGridHelper; + } - /** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ + duration = morphTargetNames.length * fps; - function FaceNormalsHelper( object, size, hex, linewidth ) { + } else { - // FaceNormalsHelper only supports THREE.Geometry + // ...assume skeletal animation - this.object = object; + const boneName = '.bones[' + bones[ h ].name + ']'; - this.size = ( size !== undefined ) ? size : 1; + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.position', + animationKeys, 'pos', tracks ); - var color = ( hex !== undefined ) ? hex : 0xffff00; + addNonemptyTrack( + QuaternionKeyframeTrack, boneName + '.quaternion', + animationKeys, 'rot', tracks ); - var width = ( linewidth !== undefined ) ? linewidth : 1; + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.scale', + animationKeys, 'scl', tracks ); - // + } - var nNormals = 0; + } - var objGeometry = this.object.geometry; + if ( tracks.length === 0 ) { - if ( objGeometry && objGeometry.isGeometry ) { + return null; - nNormals = objGeometry.faces.length; + } - } else { + const clip = new this( clipName, duration, tracks, blendMode ); - console.warn( 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.' ); + return clip; } - // + resetDuration() { - var geometry = new BufferGeometry(); + const tracks = this.tracks; + let duration = 0; - var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 ); + for ( let i = 0, n = tracks.length; i !== n; ++ i ) { - geometry.addAttribute( 'position', positions ); + const track = this.tracks[ i ]; - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); + duration = Math.max( duration, track.times[ track.times.length - 1 ] ); - // + } - this.matrixAutoUpdate = false; - this.update(); + this.duration = duration; - } + return this; - FaceNormalsHelper.prototype = Object.create( LineSegments.prototype ); - FaceNormalsHelper.prototype.constructor = FaceNormalsHelper; + } - FaceNormalsHelper.prototype.update = ( function () { + trim() { - var v1 = new Vector3(); - var v2 = new Vector3(); - var normalMatrix = new Matrix3(); + for ( let i = 0; i < this.tracks.length; i ++ ) { - return function update() { + this.tracks[ i ].trim( 0, this.duration ); - this.object.updateMatrixWorld( true ); + } - normalMatrix.getNormalMatrix( this.object.matrixWorld ); + return this; - var matrixWorld = this.object.matrixWorld; + } - var position = this.geometry.attributes.position; + validate() { - // + let valid = true; - var objGeometry = this.object.geometry; + for ( let i = 0; i < this.tracks.length; i ++ ) { - var vertices = objGeometry.vertices; + valid = valid && this.tracks[ i ].validate(); - var faces = objGeometry.faces; + } - var idx = 0; + return valid; - for ( var i = 0, l = faces.length; i < l; i ++ ) { + } - var face = faces[ i ]; + optimize() { - var normal = face.normal; + for ( let i = 0; i < this.tracks.length; i ++ ) { - v1.copy( vertices[ face.a ] ) - .add( vertices[ face.b ] ) - .add( vertices[ face.c ] ) - .divideScalar( 3 ) - .applyMatrix4( matrixWorld ); + this.tracks[ i ].optimize(); - v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + } - position.setXYZ( idx, v1.x, v1.y, v1.z ); + return this; - idx = idx + 1; + } - position.setXYZ( idx, v2.x, v2.y, v2.z ); + clone() { - idx = idx + 1; + const tracks = []; - } + for ( let i = 0; i < this.tracks.length; i ++ ) { - position.needsUpdate = true; + tracks.push( this.tracks[ i ].clone() ); - }; + } - }() ); + return new this.constructor( this.name, this.duration, tracks, this.blendMode ); - /** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ + } - function DirectionalLightHelper( light, size ) { + toJSON() { - Object3D.call( this ); + return this.constructor.toJSON( this ); - this.light = light; - this.light.updateMatrixWorld(); + } - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + } - if ( size === undefined ) size = 1; + function getTrackTypeForValueTypeName( typeName ) { - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( [ - - size, size, 0, - size, size, 0, - size, - size, 0, - - size, - size, 0, - - size, size, 0 - ], 3 ) ); + switch ( typeName.toLowerCase() ) { - var material = new LineBasicMaterial( { fog: false } ); + case 'scalar': + case 'double': + case 'float': + case 'number': + case 'integer': - this.add( new Line( geometry, material ) ); + return NumberKeyframeTrack; - geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + case 'vector': + case 'vector2': + case 'vector3': + case 'vector4': - this.add( new Line( geometry, material )); + return VectorKeyframeTrack; - this.update(); + case 'color': - } + return ColorKeyframeTrack; - DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); - DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; + case 'quaternion': - DirectionalLightHelper.prototype.dispose = function () { + return QuaternionKeyframeTrack; - var lightPlane = this.children[ 0 ]; - var targetLine = this.children[ 1 ]; + case 'bool': + case 'boolean': - lightPlane.geometry.dispose(); - lightPlane.material.dispose(); - targetLine.geometry.dispose(); - targetLine.material.dispose(); + return BooleanKeyframeTrack; - }; + case 'string': - DirectionalLightHelper.prototype.update = function () { + return StringKeyframeTrack; - var v1 = new Vector3(); - var v2 = new Vector3(); - var v3 = new Vector3(); + } - return function update() { + throw new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName ); - v1.setFromMatrixPosition( this.light.matrixWorld ); - v2.setFromMatrixPosition( this.light.target.matrixWorld ); - v3.subVectors( v2, v1 ); + } - var lightPlane = this.children[ 0 ]; - var targetLine = this.children[ 1 ]; + function parseKeyframeTrack( json ) { - lightPlane.lookAt( v3 ); - lightPlane.material.color.copy( this.light.color ); + if ( json.type === undefined ) { - targetLine.lookAt( v3 ); - targetLine.scale.z = v3.length(); + throw new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' ); - }; + } - }(); + const trackType = getTrackTypeForValueTypeName( json.type ); - /** - * @author alteredq / http://alteredqualia.com/ - * @author Mugen87 / https://github.com/Mugen87 - * - * - shows frustum, line of sight and up of the camera - * - suitable for fast updates - * - based on frustum visualization in lightgl.js shadowmap example - * http://evanw.github.com/lightgl.js/tests/shadowmap.html - */ + if ( json.times === undefined ) { - function CameraHelper( camera ) { + const times = [], values = []; - var geometry = new BufferGeometry(); - var material = new LineBasicMaterial( { color: 0xffffff, vertexColors: FaceColors } ); + flattenJSON( json.keys, times, values, 'value' ); - var vertices = []; - var colors = []; + json.times = times; + json.values = values; - var pointMap = {}; + } - // colors + // derived classes can define a static parse method + if ( trackType.parse !== undefined ) { - var colorFrustum = new Color( 0xffaa00 ); - var colorCone = new Color( 0xff0000 ); - var colorUp = new Color( 0x00aaff ); - var colorTarget = new Color( 0xffffff ); - var colorCross = new Color( 0x333333 ); + return trackType.parse( json ); - // near + } else { - addLine( "n1", "n2", colorFrustum ); - addLine( "n2", "n4", colorFrustum ); - addLine( "n4", "n3", colorFrustum ); - addLine( "n3", "n1", colorFrustum ); + // by default, we assume a constructor compatible with the base + return new trackType( json.name, json.times, json.values, json.interpolation ); - // far + } - addLine( "f1", "f2", colorFrustum ); - addLine( "f2", "f4", colorFrustum ); - addLine( "f4", "f3", colorFrustum ); - addLine( "f3", "f1", colorFrustum ); + } - // sides + const Cache = { - addLine( "n1", "f1", colorFrustum ); - addLine( "n2", "f2", colorFrustum ); - addLine( "n3", "f3", colorFrustum ); - addLine( "n4", "f4", colorFrustum ); + enabled: false, - // cone + files: {}, - addLine( "p", "n1", colorCone ); - addLine( "p", "n2", colorCone ); - addLine( "p", "n3", colorCone ); - addLine( "p", "n4", colorCone ); + add: function ( key, file ) { - // up + if ( this.enabled === false ) return; - addLine( "u1", "u2", colorUp ); - addLine( "u2", "u3", colorUp ); - addLine( "u3", "u1", colorUp ); + // console.log( 'THREE.Cache', 'Adding key:', key ); - // target + this.files[ key ] = file; - addLine( "c", "t", colorTarget ); - addLine( "p", "c", colorCross ); + }, - // cross + get: function ( key ) { - addLine( "cn1", "cn2", colorCross ); - addLine( "cn3", "cn4", colorCross ); + if ( this.enabled === false ) return; - addLine( "cf1", "cf2", colorCross ); - addLine( "cf3", "cf4", colorCross ); + // console.log( 'THREE.Cache', 'Checking key:', key ); - function addLine( a, b, color ) { + return this.files[ key ]; - addPoint( a, color ); - addPoint( b, color ); + }, - } + remove: function ( key ) { - function addPoint( id, color ) { + delete this.files[ key ]; - vertices.push( 0, 0, 0 ); - colors.push( color.r, color.g, color.b ); + }, - if ( pointMap[ id ] === undefined ) { + clear: function () { - pointMap[ id ] = []; + this.files = {}; - } + } - pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); + }; - } + class LoadingManager { - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + constructor( onLoad, onProgress, onError ) { - LineSegments.call( this, geometry, material ); + const scope = this; - this.camera = camera; - if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); + let isLoading = false; + let itemsLoaded = 0; + let itemsTotal = 0; + let urlModifier = undefined; + const handlers = []; - this.matrix = camera.matrixWorld; - this.matrixAutoUpdate = false; + // Refer to #5689 for the reason why we don't set .onStart + // in the constructor - this.pointMap = pointMap; + this.onStart = undefined; + this.onLoad = onLoad; + this.onProgress = onProgress; + this.onError = onError; - this.update(); + this.itemStart = function ( url ) { - } + itemsTotal ++; - CameraHelper.prototype = Object.create( LineSegments.prototype ); - CameraHelper.prototype.constructor = CameraHelper; + if ( isLoading === false ) { - CameraHelper.prototype.update = function () { + if ( scope.onStart !== undefined ) { - var geometry, pointMap; + scope.onStart( url, itemsLoaded, itemsTotal ); - var vector = new Vector3(); - var camera = new Camera(); + } - function setPoint( point, x, y, z ) { + } - vector.set( x, y, z ).unproject( camera ); + isLoading = true; - var points = pointMap[ point ]; + }; - if ( points !== undefined ) { + this.itemEnd = function ( url ) { - var position = geometry.getAttribute( 'position' ); + itemsLoaded ++; - for ( var i = 0, l = points.length; i < l; i ++ ) { + if ( scope.onProgress !== undefined ) { - position.setXYZ( points[ i ], vector.x, vector.y, vector.z ); + scope.onProgress( url, itemsLoaded, itemsTotal ); } - } + if ( itemsLoaded === itemsTotal ) { - } + isLoading = false; - return function update() { + if ( scope.onLoad !== undefined ) { - geometry = this.geometry; - pointMap = this.pointMap; + scope.onLoad(); - var w = 1, h = 1; + } - // we need just camera projection matrix - // world matrix must be identity + } - camera.projectionMatrix.copy( this.camera.projectionMatrix ); + }; - // center / target + this.itemError = function ( url ) { - setPoint( "c", 0, 0, - 1 ); - setPoint( "t", 0, 0, 1 ); + if ( scope.onError !== undefined ) { - // near + scope.onError( url ); - setPoint( "n1", - w, - h, - 1 ); - setPoint( "n2", w, - h, - 1 ); - setPoint( "n3", - w, h, - 1 ); - setPoint( "n4", w, h, - 1 ); + } - // far + }; - setPoint( "f1", - w, - h, 1 ); - setPoint( "f2", w, - h, 1 ); - setPoint( "f3", - w, h, 1 ); - setPoint( "f4", w, h, 1 ); + this.resolveURL = function ( url ) { - // up + if ( urlModifier ) { - setPoint( "u1", w * 0.7, h * 1.1, - 1 ); - setPoint( "u2", - w * 0.7, h * 1.1, - 1 ); - setPoint( "u3", 0, h * 2, - 1 ); + return urlModifier( url ); - // cross + } - setPoint( "cf1", - w, 0, 1 ); - setPoint( "cf2", w, 0, 1 ); - setPoint( "cf3", 0, - h, 1 ); - setPoint( "cf4", 0, h, 1 ); + return url; - setPoint( "cn1", - w, 0, - 1 ); - setPoint( "cn2", w, 0, - 1 ); - setPoint( "cn3", 0, - h, - 1 ); - setPoint( "cn4", 0, h, - 1 ); + }; - geometry.getAttribute( 'position' ).needsUpdate = true; + this.setURLModifier = function ( transform ) { - }; + urlModifier = transform; - }(); + return this; - /** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / http://github.com/Mugen87 - */ + }; - function BoxHelper( object, color ) { + this.addHandler = function ( regex, loader ) { - this.object = object; + handlers.push( regex, loader ); - if ( color === undefined ) color = 0xffff00; + return this; - var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - var positions = new Float32Array( 8 * 3 ); + }; - var geometry = new BufferGeometry(); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) ); + this.removeHandler = function ( regex ) { - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) ); + const index = handlers.indexOf( regex ); - this.matrixAutoUpdate = false; + if ( index !== - 1 ) { - this.update(); + handlers.splice( index, 2 ); - } + } - BoxHelper.prototype = Object.create( LineSegments.prototype ); - BoxHelper.prototype.constructor = BoxHelper; + return this; - BoxHelper.prototype.update = ( function () { + }; - var box = new Box3(); + this.getHandler = function ( file ) { - return function update( object ) { + for ( let i = 0, l = handlers.length; i < l; i += 2 ) { - if ( object !== undefined ) { + const regex = handlers[ i ]; + const loader = handlers[ i + 1 ]; - console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); + if ( regex.global ) regex.lastIndex = 0; // see #17920 - } + if ( regex.test( file ) ) { - if ( this.object !== undefined ) { + return loader; - box.setFromObject( this.object ); + } - } + } - if ( box.isEmpty() ) return; + return null; - var min = box.min; - var max = box.max; + }; - /* - 5____4 - 1/___0/| - | 6__|_7 - 2/___3/ + } - 0: max.x, max.y, max.z - 1: min.x, max.y, max.z - 2: min.x, min.y, max.z - 3: max.x, min.y, max.z - 4: max.x, max.y, min.z - 5: min.x, max.y, min.z - 6: min.x, min.y, min.z - 7: max.x, min.y, min.z - */ + } - var position = this.geometry.attributes.position; - var array = position.array; + const DefaultLoadingManager = /*@__PURE__*/ new LoadingManager(); - array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; - array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; - array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; - array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; - array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; - array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; - array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; - array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + class Loader { - position.needsUpdate = true; + constructor( manager ) { - this.geometry.computeBoundingSphere(); + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; - }; + this.crossOrigin = 'anonymous'; + this.withCredentials = false; + this.path = ''; + this.resourcePath = ''; + this.requestHeader = {}; - } )(); + } - BoxHelper.prototype.setFromObject = function ( object ) { + load( /* url, onLoad, onProgress, onError */ ) {} - this.object = object; - this.update(); + loadAsync( url, onProgress ) { - return this; + const scope = this; - }; + return new Promise( function ( resolve, reject ) { - /** - * @author WestLangley / http://github.com/WestLangley - * @author zz85 / http://github.com/zz85 - * @author bhouston / http://clara.io - * - * Creates an arrow for visualizing directions - * - * Parameters: - * dir - Vector3 - * origin - Vector3 - * length - Number - * color - color in hex value - * headLength - Number - * headWidth - Number - */ + scope.load( url, resolve, onProgress, reject ); - var lineGeometry; - var coneGeometry; + } ); - function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { + } - // dir is assumed to be normalized + parse( /* data */ ) {} - Object3D.call( this ); + setCrossOrigin( crossOrigin ) { - if ( color === undefined ) color = 0xffff00; - if ( length === undefined ) length = 1; - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; + this.crossOrigin = crossOrigin; + return this; - if ( lineGeometry === undefined ) { + } - lineGeometry = new BufferGeometry(); - lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + setWithCredentials( value ) { - coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); - coneGeometry.translate( 0, - 0.5, 0 ); + this.withCredentials = value; + return this; } - this.position.copy( origin ); + setPath( path ) { - this.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) ); - this.line.matrixAutoUpdate = false; - this.add( this.line ); + this.path = path; + return this; - this.cone = new Mesh( coneGeometry, new MeshBasicMaterial( { color: color } ) ); - this.cone.matrixAutoUpdate = false; - this.add( this.cone ); + } - this.setDirection( dir ); - this.setLength( length, headLength, headWidth ); + setResourcePath( resourcePath ) { - } + this.resourcePath = resourcePath; + return this; - ArrowHelper.prototype = Object.create( Object3D.prototype ); - ArrowHelper.prototype.constructor = ArrowHelper; + } - ArrowHelper.prototype.setDirection = ( function () { + setRequestHeader( requestHeader ) { - var axis = new Vector3(); - var radians; + this.requestHeader = requestHeader; + return this; - return function setDirection( dir ) { + } - // dir is assumed to be normalized + } - if ( dir.y > 0.99999 ) { + const loading = {}; - this.quaternion.set( 0, 0, 0, 1 ); + class HttpError extends Error { - } else if ( dir.y < - 0.99999 ) { + constructor( message, response ) { - this.quaternion.set( 1, 0, 0, 0 ); + super( message ); + this.response = response; - } else { + } - axis.set( dir.z, 0, - dir.x ).normalize(); + } - radians = Math.acos( dir.y ); + class FileLoader extends Loader { - this.quaternion.setFromAxisAngle( axis, radians ); + constructor( manager ) { - } + super( manager ); - }; + } - }() ); + load( url, onLoad, onProgress, onError ) { - ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { + if ( url === undefined ) url = ''; - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; + if ( this.path !== undefined ) url = this.path + url; - this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); - this.line.updateMatrix(); + url = this.manager.resolveURL( url ); - this.cone.scale.set( headWidth, headLength, headWidth ); - this.cone.position.y = length; - this.cone.updateMatrix(); + const cached = Cache.get( url ); - }; + if ( cached !== undefined ) { - ArrowHelper.prototype.setColor = function ( color ) { + this.manager.itemStart( url ); - this.line.material.color.copy( color ); - this.cone.material.color.copy( color ); + setTimeout( () => { - }; + if ( onLoad ) onLoad( cached ); - /** - * @author sroucheray / http://sroucheray.org/ - * @author mrdoob / http://mrdoob.com/ - */ + this.manager.itemEnd( url ); - function AxisHelper( size ) { + }, 0 ); - size = size || 1; + return cached; - var vertices = [ - 0, 0, 0, size, 0, 0, - 0, 0, 0, 0, size, 0, - 0, 0, 0, 0, 0, size - ]; + } - var colors = [ - 1, 0, 0, 1, 0.6, 0, - 0, 1, 0, 0.6, 1, 0, - 0, 0, 1, 0, 0.6, 1 - ]; + // Check if request is duplicate - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + if ( loading[ url ] !== undefined ) { - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); + loading[ url ].push( { - LineSegments.call( this, geometry, material ); + onLoad: onLoad, + onProgress: onProgress, + onError: onError - } + } ); - AxisHelper.prototype = Object.create( LineSegments.prototype ); - AxisHelper.prototype.constructor = AxisHelper; + return; - /** - * @author zz85 https://github.com/zz85 - * - * Centripetal CatmullRom Curve - which is useful for avoiding - * cusps and self-intersections in non-uniform catmull rom curves. - * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf - * - * curve.type accepts centripetal(default), chordal and catmullrom - * curve.tension is used for catmullrom which defaults to 0.5 - */ + } + // Initialise array for duplicate requests + loading[ url ] = []; - /* - Based on an optimized c++ solution in - - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/ - - http://ideone.com/NoEbVM + loading[ url ].push( { + onLoad: onLoad, + onProgress: onProgress, + onError: onError, + } ); - This CubicPoly class could be used for reusing some variables and calculations, - but for three.js curve use, it could be possible inlined and flatten into a single function call - which can be placed in CurveUtils. - */ + // create request + const req = new Request( url, { + headers: new Headers( this.requestHeader ), + credentials: this.withCredentials ? 'include' : 'same-origin', + // An abort controller could be added within a future PR + } ); - function CubicPoly() { + // record states ( avoid data race ) + const mimeType = this.mimeType; + const responseType = this.responseType; - var c0 = 0, c1 = 0, c2 = 0, c3 = 0; + // start the fetch + fetch( req ) + .then( response => { - /* - * Compute coefficients for a cubic polynomial - * p(s) = c0 + c1*s + c2*s^2 + c3*s^3 - * such that - * p(0) = x0, p(1) = x1 - * and - * p'(0) = t0, p'(1) = t1. - */ - function init( x0, x1, t0, t1 ) { + if ( response.status === 200 || response.status === 0 ) { - c0 = x0; - c1 = t0; - c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1; - c3 = 2 * x0 - 2 * x1 + t0 + t1; + // Some browsers return HTTP Status 0 when using non-http protocol + // e.g. 'file://' or 'data://'. Handle as success. - } + if ( response.status === 0 ) { - return { + console.warn( 'THREE.FileLoader: HTTP Status 0 received.' ); - initCatmullRom: function ( x0, x1, x2, x3, tension ) { + } - init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) ); + // Workaround: Checking if response.body === undefined for Alipay browser #23548 - }, + if ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) { - initNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) { + return response; - // compute tangents when parameterized in [t1,t2] - var t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1; - var t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2; + } - // rescale tangents for parametrization in [0,1] - t1 *= dt1; - t2 *= dt1; + const callbacks = loading[ url ]; + const reader = response.body.getReader(); - init( x1, x2, t1, t2 ); + // Nginx needs X-File-Size check + // https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content + const contentLength = response.headers.get( 'Content-Length' ) || response.headers.get( 'X-File-Size' ); + const total = contentLength ? parseInt( contentLength ) : 0; + const lengthComputable = total !== 0; + let loaded = 0; - }, + // periodically read data into the new stream tracking while download progress + const stream = new ReadableStream( { + start( controller ) { - calc: function ( t ) { + readData(); - var t2 = t * t; - var t3 = t2 * t; - return c0 + c1 * t + c2 * t2 + c3 * t3; + function readData() { - } + reader.read().then( ( { done, value } ) => { - }; + if ( done ) { - } + controller.close(); - // + } else { - var tmp = new Vector3(); - var px = new CubicPoly(); - var py = new CubicPoly(); - var pz = new CubicPoly(); + loaded += value.byteLength; - function CatmullRomCurve3( points ) { + const event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } ); + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { - Curve.call( this ); + const callback = callbacks[ i ]; + if ( callback.onProgress ) callback.onProgress( event ); - if ( points.length < 2 ) console.warn( 'THREE.CatmullRomCurve3: Points array needs at least two entries.' ); + } - this.points = points || []; - this.closed = false; + controller.enqueue( value ); + readData(); - } + } + + } ); + + } - CatmullRomCurve3.prototype = Object.create( Curve.prototype ); - CatmullRomCurve3.prototype.constructor = CatmullRomCurve3; + } - CatmullRomCurve3.prototype.getPoint = function ( t ) { + } ); - var points = this.points; - var l = points.length; + return new Response( stream ); - var point = ( l - ( this.closed ? 0 : 1 ) ) * t; - var intPoint = Math.floor( point ); - var weight = point - intPoint; + } else { - if ( this.closed ) { + throw new HttpError( `fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`, response ); - intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / points.length ) + 1 ) * points.length; + } - } else if ( weight === 0 && intPoint === l - 1 ) { + } ) + .then( response => { - intPoint = l - 2; - weight = 1; + switch ( responseType ) { - } + case 'arraybuffer': - var p0, p1, p2, p3; // 4 points + return response.arrayBuffer(); - if ( this.closed || intPoint > 0 ) { + case 'blob': - p0 = points[ ( intPoint - 1 ) % l ]; + return response.blob(); - } else { + case 'document': - // extrapolate first point - tmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] ); - p0 = tmp; + return response.text() + .then( text => { - } + const parser = new DOMParser(); + return parser.parseFromString( text, mimeType ); - p1 = points[ intPoint % l ]; - p2 = points[ ( intPoint + 1 ) % l ]; + } ); - if ( this.closed || intPoint + 2 < l ) { + case 'json': - p3 = points[ ( intPoint + 2 ) % l ]; + return response.json(); - } else { + default: - // extrapolate last point - tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] ); - p3 = tmp; + if ( mimeType === undefined ) { - } + return response.text(); - if ( this.type === undefined || this.type === 'centripetal' || this.type === 'chordal' ) { + } else { - // init Centripetal / Chordal Catmull-Rom - var pow = this.type === 'chordal' ? 0.5 : 0.25; - var dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); - var dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); - var dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); + // sniff encoding + const re = /charset="?([^;"\s]*)"?/i; + const exec = re.exec( mimeType ); + const label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined; + const decoder = new TextDecoder( label ); + return response.arrayBuffer().then( ab => decoder.decode( ab ) ); - // safety check for repeated points - if ( dt1 < 1e-4 ) dt1 = 1.0; - if ( dt0 < 1e-4 ) dt0 = dt1; - if ( dt2 < 1e-4 ) dt2 = dt1; + } - px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 ); - py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); - pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); + } - } else if ( this.type === 'catmullrom' ) { + } ) + .then( data => { - var tension = this.tension !== undefined ? this.tension : 0.5; - px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension ); - py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension ); - pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension ); + // Add to cache only on HTTP success, so that we do not cache + // error response bodies as proper responses to requests. + Cache.add( url, data ); - } + const callbacks = loading[ url ]; + delete loading[ url ]; - return new Vector3( px.calc( weight ), py.calc( weight ), pz.calc( weight ) ); + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { - }; + const callback = callbacks[ i ]; + if ( callback.onLoad ) callback.onLoad( data ); - function CubicBezierCurve3( v0, v1, v2, v3 ) { + } - Curve.call( this ); + } ) + .catch( err => { - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; + // Abort errors and other errors are handled the same - } + const callbacks = loading[ url ]; - CubicBezierCurve3.prototype = Object.create( Curve.prototype ); - CubicBezierCurve3.prototype.constructor = CubicBezierCurve3; + if ( callbacks === undefined ) { - CubicBezierCurve3.prototype.getPoint = function ( t ) { + // When onLoad was called and url was deleted in `loading` + this.manager.itemError( url ); + throw err; - var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + } - return new Vector3( - CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), - CubicBezier( t, v0.y, v1.y, v2.y, v3.y ), - CubicBezier( t, v0.z, v1.z, v2.z, v3.z ) - ); + delete loading[ url ]; - }; + for ( let i = 0, il = callbacks.length; i < il; i ++ ) { - function QuadraticBezierCurve3( v0, v1, v2 ) { + const callback = callbacks[ i ]; + if ( callback.onError ) callback.onError( err ); - Curve.call( this ); + } - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; + this.manager.itemError( url ); - } + } ) + .finally( () => { - QuadraticBezierCurve3.prototype = Object.create( Curve.prototype ); - QuadraticBezierCurve3.prototype.constructor = QuadraticBezierCurve3; + this.manager.itemEnd( url ); - QuadraticBezierCurve3.prototype.getPoint = function ( t ) { + } ); - var v0 = this.v0, v1 = this.v1, v2 = this.v2; + this.manager.itemStart( url ); - return new Vector3( - QuadraticBezier( t, v0.x, v1.x, v2.x ), - QuadraticBezier( t, v0.y, v1.y, v2.y ), - QuadraticBezier( t, v0.z, v1.z, v2.z ) - ); + } - }; + setResponseType( value ) { - function LineCurve3( v1, v2 ) { + this.responseType = value; + return this; - Curve.call( this ); + } - this.v1 = v1; - this.v2 = v2; + setMimeType( value ) { - } + this.mimeType = value; + return this; + + } - LineCurve3.prototype = Object.create( Curve.prototype ); - LineCurve3.prototype.constructor = LineCurve3; + } - LineCurve3.prototype.getPoint = function ( t ) { + class AnimationLoader extends Loader { - if ( t === 1 ) { + constructor( manager ) { - return this.v2.clone(); + super( manager ); } - var vector = new Vector3(); - - vector.subVectors( this.v2, this.v1 ); // diff - vector.multiplyScalar( t ); - vector.add( this.v1 ); + load( url, onLoad, onProgress, onError ) { - return vector; + const scope = this; - }; + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { - function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + try { - EllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + onLoad( scope.parse( JSON.parse( text ) ) ); - } + } catch ( e ) { - ArcCurve.prototype = Object.create( EllipseCurve.prototype ); - ArcCurve.prototype.constructor = ArcCurve; + if ( onError ) { - /** - * @author alteredq / http://alteredqualia.com/ - */ + onError( e ); - var SceneUtils = { + } else { - createMultiMaterialObject: function ( geometry, materials ) { + console.error( e ); - var group = new Group(); + } - for ( var i = 0, l = materials.length; i < l; i ++ ) { + scope.manager.itemError( url ); - group.add( new Mesh( geometry, materials[ i ] ) ); + } - } + }, onProgress, onError ); - return group; + } - }, + parse( json ) { - detach: function ( child, parent, scene ) { + const animations = []; - child.applyMatrix( parent.matrixWorld ); - parent.remove( child ); - scene.add( child ); + for ( let i = 0; i < json.length; i ++ ) { - }, + const clip = AnimationClip.parse( json[ i ] ); - attach: function ( child, scene, parent ) { + animations.push( clip ); - child.applyMatrix( new Matrix4().getInverse( parent.matrixWorld ) ); + } - scene.remove( child ); - parent.add( child ); + return animations; } - }; + } /** - * @author mrdoob / http://mrdoob.com/ + * Abstract Base class to block based textures loader (dds, pvr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). */ - function Face4( a, b, c, d, normal, color, materialIndex ) { + class CompressedTextureLoader extends Loader { - console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ); - return new Face3( a, b, c, normal, color, materialIndex ); + constructor( manager ) { - } + super( manager ); - var LineStrip = 0; + } - var LinePieces = 1; + load( url, onLoad, onProgress, onError ) { - function MeshFaceMaterial( materials ) { + const scope = this; - console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' ); - return materials; + const images = []; - } + const texture = new CompressedTexture(); - function MultiMaterial( materials ) { + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); - if ( materials === undefined ) materials = []; + let loaded = 0; - console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' ); - materials.isMultiMaterial = true; - materials.materials = materials; - materials.clone = function () { + function loadTexture( i ) { - return materials.slice(); + loader.load( url[ i ], function ( buffer ) { - }; - return materials; + const texDatas = scope.parse( buffer, true ); - } + images[ i ] = { + width: texDatas.width, + height: texDatas.height, + format: texDatas.format, + mipmaps: texDatas.mipmaps + }; - function PointCloud( geometry, material ) { + loaded += 1; - console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' ); - return new Points( geometry, material ); + if ( loaded === 6 ) { - } + if ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter; - function Particle( material ) { + texture.image = images; + texture.format = texDatas.format; + texture.needsUpdate = true; - console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' ); - return new Sprite( material ); + if ( onLoad ) onLoad( texture ); - } + } - function ParticleSystem( geometry, material ) { + }, onProgress, onError ); - console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' ); - return new Points( geometry, material ); + } - } + if ( Array.isArray( url ) ) { - function PointCloudMaterial( parameters ) { + for ( let i = 0, il = url.length; i < il; ++ i ) { - console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); + loadTexture( i ); - } + } - function ParticleBasicMaterial( parameters ) { + } else { - console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); + // compressed cubemap texture stored in a single DDS file - } + loader.load( url, function ( buffer ) { - function ParticleSystemMaterial( parameters ) { + const texDatas = scope.parse( buffer, true ); - console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); + if ( texDatas.isCubemap ) { - } + const faces = texDatas.mipmaps.length / texDatas.mipmapCount; - function Vertex( x, y, z ) { + for ( let f = 0; f < faces; f ++ ) { - console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' ); - return new Vector3( x, y, z ); + images[ f ] = { mipmaps: [] }; - } + for ( let i = 0; i < texDatas.mipmapCount; i ++ ) { - // + images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); + images[ f ].format = texDatas.format; + images[ f ].width = texDatas.width; + images[ f ].height = texDatas.height; - function DynamicBufferAttribute( array, itemSize ) { + } - console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' ); - return new BufferAttribute( array, itemSize ).setDynamic( true ); + } - } + texture.image = images; - function Int8Attribute( array, itemSize ) { + } else { - console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' ); - return new Int8BufferAttribute( array, itemSize ); + texture.image.width = texDatas.width; + texture.image.height = texDatas.height; + texture.mipmaps = texDatas.mipmaps; - } + } - function Uint8Attribute( array, itemSize ) { + if ( texDatas.mipmapCount === 1 ) { - console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' ); - return new Uint8BufferAttribute( array, itemSize ); + texture.minFilter = LinearFilter; - } + } - function Uint8ClampedAttribute( array, itemSize ) { + texture.format = texDatas.format; + texture.needsUpdate = true; - console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' ); - return new Uint8ClampedBufferAttribute( array, itemSize ); + if ( onLoad ) onLoad( texture ); - } + }, onProgress, onError ); - function Int16Attribute( array, itemSize ) { + } - console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' ); - return new Int16BufferAttribute( array, itemSize ); + return texture; + + } } - function Uint16Attribute( array, itemSize ) { + class ImageLoader extends Loader { - console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' ); - return new Uint16BufferAttribute( array, itemSize ); + constructor( manager ) { - } + super( manager ); - function Int32Attribute( array, itemSize ) { + } - console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' ); - return new Int32BufferAttribute( array, itemSize ); + load( url, onLoad, onProgress, onError ) { - } + if ( this.path !== undefined ) url = this.path + url; - function Uint32Attribute( array, itemSize ) { + url = this.manager.resolveURL( url ); - console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' ); - return new Uint32BufferAttribute( array, itemSize ); + const scope = this; - } + const cached = Cache.get( url ); - function Float32Attribute( array, itemSize ) { + if ( cached !== undefined ) { - console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' ); - return new Float32BufferAttribute( array, itemSize ); + scope.manager.itemStart( url ); - } + setTimeout( function () { - function Float64Attribute( array, itemSize ) { + if ( onLoad ) onLoad( cached ); - console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' ); - return new Float64BufferAttribute( array, itemSize ); + scope.manager.itemEnd( url ); - } + }, 0 ); - // + return cached; - Curve.create = function ( construct, getPoint ) { + } - console.log( 'THREE.Curve.create() has been deprecated' ); + const image = createElementNS( 'img' ); - construct.prototype = Object.create( Curve.prototype ); - construct.prototype.constructor = construct; - construct.prototype.getPoint = getPoint; + function onImageLoad() { - return construct; + removeEventListeners(); - }; + Cache.add( url, this ); - // + if ( onLoad ) onLoad( this ); - function ClosedSplineCurve3( points ) { + scope.manager.itemEnd( url ); - console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' ); + } - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; - this.closed = true; + function onImageError( event ) { - } + removeEventListeners(); - ClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype ); + if ( onError ) onError( event ); - // + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); - function SplineCurve3( points ) { + } - console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' ); + function removeEventListeners() { - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; + image.removeEventListener( 'load', onImageLoad, false ); + image.removeEventListener( 'error', onImageError, false ); - } + } - SplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype ); + image.addEventListener( 'load', onImageLoad, false ); + image.addEventListener( 'error', onImageError, false ); - // + if ( url.slice( 0, 5 ) !== 'data:' ) { + + if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin; + + } + + scope.manager.itemStart( url ); - function Spline( points ) { + image.src = url; - console.warn( 'THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.' ); + return image; - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; + } } - Spline.prototype = Object.create( CatmullRomCurve3.prototype ); + class CubeTextureLoader extends Loader { - Object.assign( Spline.prototype, { + constructor( manager ) { - initFromArray: function ( a ) { + super( manager ); - console.error( 'THREE.Spline: .initFromArray() has been removed.' ); + } - }, - getControlPointsArray: function ( optionalTarget ) { + load( urls, onLoad, onProgress, onError ) { - console.error( 'THREE.Spline: .getControlPointsArray() has been removed.' ); + const texture = new CubeTexture(); + texture.colorSpace = SRGBColorSpace; - }, - reparametrizeByArcLength: function ( samplingCoef ) { + const loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setPath( this.path ); - console.error( 'THREE.Spline: .reparametrizeByArcLength() has been removed.' ); + let loaded = 0; - } + function loadTexture( i ) { - } ); + loader.load( urls[ i ], function ( image ) { - // - function BoundingBoxHelper( object, color ) { + texture.images[ i ] = image; - console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' ); - return new BoxHelper( object, color ); + loaded ++; - } + if ( loaded === 6 ) { - function EdgesHelper( object, hex ) { + texture.needsUpdate = true; - console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' ); - return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + if ( onLoad ) onLoad( texture ); - } + } - GridHelper.prototype.setColors = function () { + }, undefined, onError ); - console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' ); + } - }; + for ( let i = 0; i < urls.length; ++ i ) { - SkeletonHelper.prototype.update = function () { + loadTexture( i ); - console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' ); - - }; + } - function WireframeHelper( object, hex ) { + return texture; - console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' ); - return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + } } - // + /** + * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). + */ - function XHRLoader( manager ) { + class DataTextureLoader extends Loader { - console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' ); - return new FileLoader( manager ); + constructor( manager ) { - } + super( manager ); - function BinaryTextureLoader( manager ) { + } - console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' ); - return new DataTextureLoader( manager ); + load( url, onLoad, onProgress, onError ) { - } + const scope = this; - // + const texture = new DataTexture(); - Object.assign( Box2.prototype, { + const loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setPath( this.path ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( buffer ) { - center: function ( optionalTarget ) { + const texData = scope.parse( buffer ); - console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); + if ( ! texData ) return; - }, - empty: function () { + if ( texData.image !== undefined ) { - console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' ); - return this.isEmpty(); + texture.image = texData.image; - }, - isIntersectionBox: function ( box ) { + } else if ( texData.data !== undefined ) { - console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); + texture.image.width = texData.width; + texture.image.height = texData.height; + texture.image.data = texData.data; - }, - size: function ( optionalTarget ) { + } - console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' ); - return this.getSize( optionalTarget ); + texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; + texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; - } - } ); + texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; + texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; - Object.assign( Box3.prototype, { + texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; - center: function ( optionalTarget ) { + if ( texData.colorSpace !== undefined ) { - console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); + texture.colorSpace = texData.colorSpace; - }, - empty: function () { + } else if ( texData.encoding !== undefined ) { // @deprecated, r152 - console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' ); - return this.isEmpty(); + texture.encoding = texData.encoding; - }, - isIntersectionBox: function ( box ) { + } - console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); + if ( texData.flipY !== undefined ) { - }, - isIntersectionSphere: function ( sphere ) { + texture.flipY = texData.flipY; - console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); - return this.intersectsSphere( sphere ); + } - }, - size: function ( optionalTarget ) { + if ( texData.format !== undefined ) { - console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' ); - return this.getSize( optionalTarget ); + texture.format = texData.format; - } - } ); + } - Line3.prototype.center = function ( optionalTarget ) { + if ( texData.type !== undefined ) { - console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); + texture.type = texData.type; - }; + } - _Math.random16 = function () { + if ( texData.mipmaps !== undefined ) { - console.warn( 'THREE.Math.random16() has been deprecated. Use Math.random() instead.' ); - return Math.random(); + texture.mipmaps = texData.mipmaps; + texture.minFilter = LinearMipmapLinearFilter; // presumably... - }; + } - Object.assign( Matrix3.prototype, { + if ( texData.mipmapCount === 1 ) { - flattenToArrayOffset: function ( array, offset ) { + texture.minFilter = LinearFilter; - console.warn( "THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." ); - return this.toArray( array, offset ); + } - }, - multiplyVector3: function ( vector ) { + if ( texData.generateMipmaps !== undefined ) { - console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' ); - return vector.applyMatrix3( this ); + texture.generateMipmaps = texData.generateMipmaps; - }, - multiplyVector3Array: function ( a ) { + } - console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' ); + texture.needsUpdate = true; - }, - applyToBuffer: function( buffer, offset, length ) { + if ( onLoad ) onLoad( texture, texData ); - console.warn( 'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); + }, onProgress, onError ); - }, - applyToVector3Array: function( array, offset, length ) { - console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' ); + return texture; } - } ); - - Object.assign( Matrix4.prototype, { - - extractPosition: function ( m ) { + } - console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); - return this.copyPosition( m ); + class TextureLoader extends Loader { - }, - flattenToArrayOffset: function ( array, offset ) { + constructor( manager ) { - console.warn( "THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." ); - return this.toArray( array, offset ); + super( manager ); - }, - getPosition: function () { + } - var v1; + load( url, onLoad, onProgress, onError ) { - return function getPosition() { + const texture = new Texture(); - if ( v1 === undefined ) v1 = new Vector3(); - console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); - return v1.setFromMatrixColumn( this, 3 ); + const loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setPath( this.path ); - }; + loader.load( url, function ( image ) { - }(), - setRotationFromQuaternion: function ( q ) { + texture.image = image; + texture.needsUpdate = true; - console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); - return this.makeRotationFromQuaternion( q ); + if ( onLoad !== undefined ) { - }, - multiplyToArray: function () { + onLoad( texture ); - console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' ); + } - }, - multiplyVector3: function ( vector ) { + }, onProgress, onError ); - console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); + return texture; - }, - multiplyVector4: function ( vector ) { + } - console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); + } - }, - multiplyVector3Array: function ( a ) { + class Light extends Object3D { - console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' ); + constructor( color, intensity = 1 ) { - }, - rotateAxis: function ( v ) { + super(); - console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' ); - v.transformDirection( this ); + this.isLight = true; - }, - crossVector: function ( vector ) { + this.type = 'Light'; - console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); + this.color = new Color( color ); + this.intensity = intensity; - }, - translate: function () { + } - console.error( 'THREE.Matrix4: .translate() has been removed.' ); + dispose() { - }, - rotateX: function () { + // Empty here in base class; some subclasses override. - console.error( 'THREE.Matrix4: .rotateX() has been removed.' ); + } - }, - rotateY: function () { + copy( source, recursive ) { - console.error( 'THREE.Matrix4: .rotateY() has been removed.' ); + super.copy( source, recursive ); - }, - rotateZ: function () { + this.color.copy( source.color ); + this.intensity = source.intensity; - console.error( 'THREE.Matrix4: .rotateZ() has been removed.' ); + return this; - }, - rotateByAxis: function () { + } - console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); + toJSON( meta ) { - }, - applyToBuffer: function( buffer, offset, length ) { + const data = super.toJSON( meta ); - console.warn( 'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); + data.object.color = this.color.getHex(); + data.object.intensity = this.intensity; - }, - applyToVector3Array: function( array, offset, length ) { + if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); - console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' ); + if ( this.distance !== undefined ) data.object.distance = this.distance; + if ( this.angle !== undefined ) data.object.angle = this.angle; + if ( this.decay !== undefined ) data.object.decay = this.decay; + if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; - }, - makeFrustum: function( left, right, bottom, top, near, far ) { + if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); - console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' ); - return this.makePerspective( left, right, top, bottom, near, far ); + return data; } - } ); - - Plane.prototype.isIntersectionLine = function ( line ) { + } - console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' ); - return this.intersectsLine( line ); + class HemisphereLight extends Light { - }; + constructor( skyColor, groundColor, intensity ) { - Quaternion.prototype.multiplyVector3 = function ( vector ) { + super( skyColor, intensity ); - console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' ); - return vector.applyQuaternion( this ); + this.isHemisphereLight = true; - }; + this.type = 'HemisphereLight'; - Object.assign( Ray.prototype, { + this.position.copy( Object3D.DEFAULT_UP ); + this.updateMatrix(); - isIntersectionBox: function ( box ) { + this.groundColor = new Color( groundColor ); - console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); + } - }, - isIntersectionPlane: function ( plane ) { + copy( source, recursive ) { - console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' ); - return this.intersectsPlane( plane ); + super.copy( source, recursive ); - }, - isIntersectionSphere: function ( sphere ) { + this.groundColor.copy( source.groundColor ); - console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); - return this.intersectsSphere( sphere ); + return this; } - } ); + } - Object.assign( Shape.prototype, { + const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4(); + const _lightPositionWorld$1 = /*@__PURE__*/ new Vector3(); + const _lookTarget$1 = /*@__PURE__*/ new Vector3(); - extrude: function ( options ) { + class LightShadow { - console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' ); - return new ExtrudeGeometry( this, options ); + constructor( camera ) { - }, - makeGeometry: function ( options ) { + this.camera = camera; - console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' ); - return new ShapeGeometry( this, options ); + this.bias = 0; + this.normalBias = 0; + this.radius = 1; + this.blurSamples = 8; - } + this.mapSize = new Vector2( 512, 512 ); - } ); + this.map = null; + this.mapPass = null; + this.matrix = new Matrix4(); - Object.assign( Vector2.prototype, { + this.autoUpdate = true; + this.needsUpdate = false; - fromAttribute: function ( attribute, index, offset ) { + this._frustum = new Frustum(); + this._frameExtents = new Vector2( 1, 1 ); - console.error( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); + this._viewportCount = 1; - } + this._viewports = [ - } ); + new Vector4( 0, 0, 1, 1 ) - Object.assign( Vector3.prototype, { + ]; - setEulerFromRotationMatrix: function () { + } - console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' ); + getViewportCount() { - }, - setEulerFromQuaternion: function () { + return this._viewportCount; - console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' ); + } - }, - getPositionFromMatrix: function ( m ) { + getFrustum() { - console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' ); - return this.setFromMatrixPosition( m ); + return this._frustum; - }, - getScaleFromMatrix: function ( m ) { + } - console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' ); - return this.setFromMatrixScale( m ); + updateMatrices( light ) { - }, - getColumnFromMatrix: function ( index, matrix ) { + const shadowCamera = this.camera; + const shadowMatrix = this.matrix; - console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' ); - return this.setFromMatrixColumn( matrix, index ); + _lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld ); + shadowCamera.position.copy( _lightPositionWorld$1 ); - }, - applyProjection: function ( m ) { + _lookTarget$1.setFromMatrixPosition( light.target.matrixWorld ); + shadowCamera.lookAt( _lookTarget$1 ); + shadowCamera.updateMatrixWorld(); - console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' ); - return this.applyMatrix4( m ); + _projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); + this._frustum.setFromProjectionMatrix( _projScreenMatrix$1 ); - }, - fromAttribute: function ( attribute, index, offset ) { + shadowMatrix.set( + 0.5, 0.0, 0.0, 0.5, + 0.0, 0.5, 0.0, 0.5, + 0.0, 0.0, 0.5, 0.5, + 0.0, 0.0, 0.0, 1.0 + ); - console.error( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); + shadowMatrix.multiply( _projScreenMatrix$1 ); } - } ); + getViewport( viewportIndex ) { + + return this._viewports[ viewportIndex ]; - Object.assign( Vector4.prototype, { + } - fromAttribute: function ( attribute, index, offset ) { + getFrameExtents() { - console.error( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); + return this._frameExtents; } - } ); + dispose() { - // + if ( this.map ) { - Geometry.prototype.computeTangents = function () { + this.map.dispose(); - console.warn( 'THREE.Geometry: .computeTangents() has been removed.' ); + } - }; + if ( this.mapPass ) { - Object.assign( Object3D.prototype, { + this.mapPass.dispose(); - getChildByName: function ( name ) { + } + + } - console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); - return this.getObjectByName( name ); + copy( source ) { - }, - renderDepth: function () { + this.camera = source.camera.clone(); - console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' ); + this.bias = source.bias; + this.radius = source.radius; - }, - translate: function ( distance, axis ) { + this.mapSize.copy( source.mapSize ); - console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' ); - return this.translateOnAxis( axis, distance ); + return this; } - } ); + clone() { - Object.defineProperties( Object3D.prototype, { + return new this.constructor().copy( this ); - eulerOrder: { - get: function () { + } - console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); - return this.rotation.order; + toJSON() { - }, - set: function ( value ) { + const object = {}; - console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); - this.rotation.order = value; + if ( this.bias !== 0 ) object.bias = this.bias; + if ( this.normalBias !== 0 ) object.normalBias = this.normalBias; + if ( this.radius !== 1 ) object.radius = this.radius; + if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray(); - } - }, - useQuaternion: { - get: function () { + object.camera = this.camera.toJSON( false ).object; + delete object.camera.matrix; - console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + return object; - }, - set: function () { + } - console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + } - } - } + class SpotLightShadow extends LightShadow { - } ); + constructor() { - Object.defineProperties( LOD.prototype, { + super( new PerspectiveCamera( 50, 1, 0.5, 500 ) ); - objects: { - get: function () { + this.isSpotLightShadow = true; - console.warn( 'THREE.LOD: .objects has been renamed to .levels.' ); - return this.levels; + this.focus = 1; - } } - } ); - - Object.defineProperty( Skeleton.prototype, 'useVertexTexture', { + updateMatrices( light ) { - get: function () { + const camera = this.camera; - console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' ); + const fov = RAD2DEG * 2 * light.angle * this.focus; + const aspect = this.mapSize.width / this.mapSize.height; + const far = light.distance || camera.far; - }, - set: function () { + if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) { - console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' ); + camera.fov = fov; + camera.aspect = aspect; + camera.far = far; + camera.updateProjectionMatrix(); - } + } - } ); + super.updateMatrices( light ); - Object.defineProperty( Curve.prototype, '__arcLengthDivisions', { + } - get: function () { + copy( source ) { - console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' ); - return this.arcLengthDivisions; + super.copy( source ); - }, - set: function ( value ) { + this.focus = source.focus; - console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' ); - this.arcLengthDivisions = value; + return this; } - } ); + } - // + class SpotLight extends Light { - PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) { + constructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) { - console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " + - "Use .setFocalLength and .filmGauge for a photographic setup." ); + super( color, intensity ); - if ( filmGauge !== undefined ) this.filmGauge = filmGauge; - this.setFocalLength( focalLength ); + this.isSpotLight = true; - }; + this.type = 'SpotLight'; - // + this.position.copy( Object3D.DEFAULT_UP ); + this.updateMatrix(); - Object.defineProperties( Light.prototype, { - onlyShadow: { - set: function () { + this.target = new Object3D(); - console.warn( 'THREE.Light: .onlyShadow has been removed.' ); + this.distance = distance; + this.angle = angle; + this.penumbra = penumbra; + this.decay = decay; - } - }, - shadowCameraFov: { - set: function ( value ) { + this.map = null; - console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' ); - this.shadow.camera.fov = value; + this.shadow = new SpotLightShadow(); - } - }, - shadowCameraLeft: { - set: function ( value ) { + } - console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' ); - this.shadow.camera.left = value; + get power() { - } - }, - shadowCameraRight: { - set: function ( value ) { + // compute the light's luminous power (in lumens) from its intensity (in candela) + // by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd) + return this.intensity * Math.PI; - console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' ); - this.shadow.camera.right = value; + } - } - }, - shadowCameraTop: { - set: function ( value ) { + set power( power ) { - console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' ); - this.shadow.camera.top = value; + // set the light's intensity (in candela) from the desired luminous power (in lumens) + this.intensity = power / Math.PI; - } - }, - shadowCameraBottom: { - set: function ( value ) { + } - console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' ); - this.shadow.camera.bottom = value; + dispose() { - } - }, - shadowCameraNear: { - set: function ( value ) { + this.shadow.dispose(); - console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' ); - this.shadow.camera.near = value; + } - } - }, - shadowCameraFar: { - set: function ( value ) { + copy( source, recursive ) { - console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' ); - this.shadow.camera.far = value; + super.copy( source, recursive ); - } - }, - shadowCameraVisible: { - set: function () { - - console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' ); + this.distance = source.distance; + this.angle = source.angle; + this.penumbra = source.penumbra; + this.decay = source.decay; - } - }, - shadowBias: { - set: function ( value ) { + this.target = source.target.clone(); - console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' ); - this.shadow.bias = value; + this.shadow = source.shadow.clone(); - } - }, - shadowDarkness: { - set: function () { + return this; - console.warn( 'THREE.Light: .shadowDarkness has been removed.' ); + } - } - }, - shadowMapWidth: { - set: function ( value ) { + } - console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' ); - this.shadow.mapSize.width = value; + const _projScreenMatrix = /*@__PURE__*/ new Matrix4(); + const _lightPositionWorld = /*@__PURE__*/ new Vector3(); + const _lookTarget = /*@__PURE__*/ new Vector3(); - } - }, - shadowMapHeight: { - set: function ( value ) { + class PointLightShadow extends LightShadow { - console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' ); - this.shadow.mapSize.height = value; + constructor() { - } - } - } ); + super( new PerspectiveCamera( 90, 1, 0.5, 500 ) ); - // + this.isPointLightShadow = true; - Object.defineProperties( BufferAttribute.prototype, { + this._frameExtents = new Vector2( 4, 2 ); - length: { - get: function () { + this._viewportCount = 6; - console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' ); - return this.array.length; + this._viewports = [ + // These viewports map a cube-map onto a 2D texture with the + // following orientation: + // + // xzXZ + // y Y + // + // X - Positive x direction + // x - Negative x direction + // Y - Positive y direction + // y - Negative y direction + // Z - Positive z direction + // z - Negative z direction + + // positive X + new Vector4( 2, 1, 1, 1 ), + // negative X + new Vector4( 0, 1, 1, 1 ), + // positive Z + new Vector4( 3, 1, 1, 1 ), + // negative Z + new Vector4( 1, 1, 1, 1 ), + // positive Y + new Vector4( 3, 0, 1, 1 ), + // negative Y + new Vector4( 1, 0, 1, 1 ) + ]; - } - } + this._cubeDirections = [ + new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ), + new Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 ) + ]; - } ); + this._cubeUps = [ + new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), + new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ), new Vector3( 0, 0, - 1 ) + ]; - Object.assign( BufferGeometry.prototype, { + } - addIndex: function ( index ) { + updateMatrices( light, viewportIndex = 0 ) { - console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' ); - this.setIndex( index ); + const camera = this.camera; + const shadowMatrix = this.matrix; - }, - addDrawCall: function ( start, count, indexOffset ) { + const far = light.distance || camera.far; - if ( indexOffset !== undefined ) { + if ( far !== camera.far ) { - console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' ); + camera.far = far; + camera.updateProjectionMatrix(); } - console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' ); - this.addGroup( start, count ); - }, - clearDrawCalls: function () { + _lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); + camera.position.copy( _lightPositionWorld ); - console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' ); - this.clearGroups(); + _lookTarget.copy( camera.position ); + _lookTarget.add( this._cubeDirections[ viewportIndex ] ); + camera.up.copy( this._cubeUps[ viewportIndex ] ); + camera.lookAt( _lookTarget ); + camera.updateMatrixWorld(); - }, - computeTangents: function () { + shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z ); - console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' ); + _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); + this._frustum.setFromProjectionMatrix( _projScreenMatrix ); - }, - computeOffsets: function () { + } - console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' ); + } - } + class PointLight extends Light { - } ); + constructor( color, intensity, distance = 0, decay = 2 ) { - Object.defineProperties( BufferGeometry.prototype, { + super( color, intensity ); - drawcalls: { - get: function () { + this.isPointLight = true; - console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' ); - return this.groups; + this.type = 'PointLight'; - } - }, - offsets: { - get: function () { + this.distance = distance; + this.decay = decay; - console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' ); - return this.groups; + this.shadow = new PointLightShadow(); - } } - } ); + get power() { - // + // compute the light's luminous power (in lumens) from its intensity (in candela) + // for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd) + return this.intensity * 4 * Math.PI; - Object.defineProperties( Uniform.prototype, { + } - dynamic: { - set: function () { + set power( power ) { - console.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' ); + // set the light's intensity (in candela) from the desired luminous power (in lumens) + this.intensity = power / ( 4 * Math.PI ); - } - }, - onUpdate: { - value: function () { + } - console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' ); - return this; + dispose() { + + this.shadow.dispose(); - } } - } ); + copy( source, recursive ) { - // + super.copy( source, recursive ); + + this.distance = source.distance; + this.decay = source.decay; + + this.shadow = source.shadow.clone(); - Object.defineProperties( Material.prototype, { + return this; - wrapAround: { - get: function () { + } - console.warn( 'THREE.Material: .wrapAround has been removed.' ); + } - }, - set: function () { + class DirectionalLightShadow extends LightShadow { - console.warn( 'THREE.Material: .wrapAround has been removed.' ); + constructor() { - } - }, - wrapRGB: { - get: function () { + super( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) ); - console.warn( 'THREE.Material: .wrapRGB has been removed.' ); - return new Color(); + this.isDirectionalLightShadow = true; - } } - } ); + } - Object.defineProperties( MeshPhongMaterial.prototype, { + class DirectionalLight extends Light { - metal: { - get: function () { + constructor( color, intensity ) { - console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' ); - return false; + super( color, intensity ); - }, - set: function () { + this.isDirectionalLight = true; - console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' ); + this.type = 'DirectionalLight'; + + this.position.copy( Object3D.DEFAULT_UP ); + this.updateMatrix(); + + this.target = new Object3D(); + + this.shadow = new DirectionalLightShadow(); - } } - } ); + dispose() { + + this.shadow.dispose(); - Object.defineProperties( ShaderMaterial.prototype, { + } - derivatives: { - get: function () { + copy( source ) { - console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); - return this.extensions.derivatives; + super.copy( source ); - }, - set: function ( value ) { + this.target = source.target.clone(); + this.shadow = source.shadow.clone(); - console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); - this.extensions.derivatives = value; + return this; - } } - } ); + } - // + class AmbientLight extends Light { - Object.assign( WebGLRenderer.prototype, { + constructor( color, intensity ) { - getCurrentRenderTarget: function () { + super( color, intensity ); - console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' ); - return this.getRenderTarget(); + this.isAmbientLight = true; - }, + this.type = 'AmbientLight'; - supportsFloatTextures: function () { + } - console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' ); - return this.extensions.get( 'OES_texture_float' ); + } - }, - supportsHalfFloatTextures: function () { + class RectAreaLight extends Light { - console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' ); - return this.extensions.get( 'OES_texture_half_float' ); + constructor( color, intensity, width = 10, height = 10 ) { - }, - supportsStandardDerivatives: function () { + super( color, intensity ); - console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' ); - return this.extensions.get( 'OES_standard_derivatives' ); + this.isRectAreaLight = true; - }, - supportsCompressedTextureS3TC: function () { + this.type = 'RectAreaLight'; - console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' ); - return this.extensions.get( 'WEBGL_compressed_texture_s3tc' ); + this.width = width; + this.height = height; - }, - supportsCompressedTexturePVRTC: function () { + } - console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' ); - return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + get power() { - }, - supportsBlendMinMax: function () { + // compute the light's luminous power (in lumens) from its intensity (in nits) + return this.intensity * this.width * this.height * Math.PI; - console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' ); - return this.extensions.get( 'EXT_blend_minmax' ); + } - }, - supportsVertexTextures: function () { + set power( power ) { - console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' ); - return this.capabilities.vertexTextures; + // set the light's intensity (in nits) from the desired luminous power (in lumens) + this.intensity = power / ( this.width * this.height * Math.PI ); - }, - supportsInstancedArrays: function () { + } - console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' ); - return this.extensions.get( 'ANGLE_instanced_arrays' ); + copy( source ) { - }, - enableScissorTest: function ( boolean ) { + super.copy( source ); + + this.width = source.width; + this.height = source.height; - console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' ); - this.setScissorTest( boolean ); + return this; - }, - initMaterial: function () { + } - console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' ); + toJSON( meta ) { - }, - addPrePlugin: function () { + const data = super.toJSON( meta ); - console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); + data.object.width = this.width; + data.object.height = this.height; - }, - addPostPlugin: function () { + return data; - console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); + } - }, - updateShadowMap: function () { + } - console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); + /** + * Primary reference: + * https://graphics.stanford.edu/papers/envmap/envmap.pdf + * + * Secondary reference: + * https://www.ppsloan.org/publications/StupidSH36.pdf + */ - } + // 3-band SH defined by 9 coefficients - } ); + class SphericalHarmonics3 { - Object.defineProperties( WebGLRenderer.prototype, { + constructor() { - shadowMapEnabled: { - get: function () { + this.isSphericalHarmonics3 = true; - return this.shadowMap.enabled; + this.coefficients = []; - }, - set: function ( value ) { + for ( let i = 0; i < 9; i ++ ) { - console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' ); - this.shadowMap.enabled = value; + this.coefficients.push( new Vector3() ); } - }, - shadowMapType: { - get: function () { - return this.shadowMap.type; + } - }, - set: function ( value ) { + set( coefficients ) { - console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' ); - this.shadowMap.type = value; + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].copy( coefficients[ i ] ); } - }, - shadowMapCullFace: { - get: function () { - return this.shadowMap.cullFace; + return this; - }, - set: function ( value ) { + } + + zero() { - console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' ); - this.shadowMap.cullFace = value; + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].set( 0, 0, 0 ); } + + return this; + } - } ); - Object.defineProperties( WebGLShadowMap.prototype, { + // get the radiance in the direction of the normal + // target is a Vector3 + getAt( normal, target ) { - cullFace: { - get: function () { + // normal is assumed to be unit length - return this.renderReverseSided ? CullFaceFront : CullFaceBack; + const x = normal.x, y = normal.y, z = normal.z; - }, - set: function ( cullFace ) { + const coeff = this.coefficients; - var value = ( cullFace !== CullFaceBack ); - console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." ); - this.renderReverseSided = value; + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 ); + + // band 1 + target.addScaledVector( coeff[ 1 ], 0.488603 * y ); + target.addScaledVector( coeff[ 2 ], 0.488603 * z ); + target.addScaledVector( coeff[ 3 ], 0.488603 * x ); + + // band 2 + target.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) ); + target.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) ); + target.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) ); + target.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) ); + target.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) ); + + return target; - } } - } ); + // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal + // target is a Vector3 + // https://graphics.stanford.edu/papers/envmap/envmap.pdf + getIrradianceAt( normal, target ) { - // + // normal is assumed to be unit length - Object.defineProperties( WebGLRenderTarget.prototype, { + const x = normal.x, y = normal.y, z = normal.z; - wrapS: { - get: function () { + const coeff = this.coefficients; - console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); - return this.texture.wrapS; + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095 - }, - set: function ( value ) { + // band 1 + target.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603 + target.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z ); + target.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x ); - console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); - this.texture.wrapS = value; + // band 2 + target.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548 + target.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z ); + target.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3 + target.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z ); + target.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274 - } - }, - wrapT: { - get: function () { + return target; + + } - console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); - return this.texture.wrapT; + add( sh ) { - }, - set: function ( value ) { + for ( let i = 0; i < 9; i ++ ) { - console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); - this.texture.wrapT = value; + this.coefficients[ i ].add( sh.coefficients[ i ] ); } - }, - magFilter: { - get: function () { - console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); - return this.texture.magFilter; + return this; + + } + + addScaledSH( sh, s ) { - }, - set: function ( value ) { + for ( let i = 0; i < 9; i ++ ) { - console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); - this.texture.magFilter = value; + this.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s ); } - }, - minFilter: { - get: function () { - console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); - return this.texture.minFilter; + return this; - }, - set: function ( value ) { + } - console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); - this.texture.minFilter = value; + scale( s ) { + + for ( let i = 0; i < 9; i ++ ) { + + this.coefficients[ i ].multiplyScalar( s ); } - }, - anisotropy: { - get: function () { - console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); - return this.texture.anisotropy; + return this; + + } + + lerp( sh, alpha ) { - }, - set: function ( value ) { + for ( let i = 0; i < 9; i ++ ) { - console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); - this.texture.anisotropy = value; + this.coefficients[ i ].lerp( sh.coefficients[ i ], alpha ); } - }, - offset: { - get: function () { - console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); - return this.texture.offset; + return this; - }, - set: function ( value ) { + } - console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); - this.texture.offset = value; + equals( sh ) { - } - }, - repeat: { - get: function () { + for ( let i = 0; i < 9; i ++ ) { - console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); - return this.texture.repeat; + if ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) { - }, - set: function ( value ) { + return false; - console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); - this.texture.repeat = value; + } } - }, - format: { - get: function () { - console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); - return this.texture.format; + return true; - }, - set: function ( value ) { + } - console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); - this.texture.format = value; + copy( sh ) { - } - }, - type: { - get: function () { + return this.set( sh.coefficients ); - console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); - return this.texture.type; + } - }, - set: function ( value ) { + clone() { - console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); - this.texture.type = value; + return new this.constructor().copy( this ); - } - }, - generateMipmaps: { - get: function () { + } - console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); - return this.texture.generateMipmaps; + fromArray( array, offset = 0 ) { - }, - set: function ( value ) { + const coefficients = this.coefficients; - console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); - this.texture.generateMipmaps = value; + for ( let i = 0; i < 9; i ++ ) { + + coefficients[ i ].fromArray( array, offset + ( i * 3 ) ); } + + return this; + } - } ); + toArray( array = [], offset = 0 ) { - // + const coefficients = this.coefficients; + + for ( let i = 0; i < 9; i ++ ) { - Audio.prototype.load = function ( file ) { + coefficients[ i ].toArray( array, offset + ( i * 3 ) ); - console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' ); - var scope = this; - var audioLoader = new AudioLoader(); - audioLoader.load( file, function ( buffer ) { + } - scope.setBuffer( buffer ); + return array; - } ); - return this; + } - }; + // evaluate the basis functions + // shBasis is an Array[ 9 ] + static getBasisAt( normal, shBasis ) { - AudioAnalyser.prototype.getData = function () { + // normal is assumed to be unit length - console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' ); - return this.getFrequencyData(); + const x = normal.x, y = normal.y, z = normal.z; - }; + // band 0 + shBasis[ 0 ] = 0.282095; - // + // band 1 + shBasis[ 1 ] = 0.488603 * y; + shBasis[ 2 ] = 0.488603 * z; + shBasis[ 3 ] = 0.488603 * x; - var GeometryUtils = { + // band 2 + shBasis[ 4 ] = 1.092548 * x * y; + shBasis[ 5 ] = 1.092548 * y * z; + shBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 ); + shBasis[ 7 ] = 1.092548 * x * z; + shBasis[ 8 ] = 0.546274 * ( x * x - y * y ); - merge: function ( geometry1, geometry2, materialIndexOffset ) { + } - console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' ); - var matrix; + } - if ( geometry2.isMesh ) { + class LightProbe extends Light { - geometry2.matrixAutoUpdate && geometry2.updateMatrix(); + constructor( sh = new SphericalHarmonics3(), intensity = 1 ) { - matrix = geometry2.matrix; - geometry2 = geometry2.geometry; + super( undefined, intensity ); - } + this.isLightProbe = true; - geometry1.merge( geometry2, matrix, materialIndexOffset ); + this.sh = sh; - }, + } + + copy( source ) { - center: function ( geometry ) { + super.copy( source ); - console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' ); - return geometry.center(); + this.sh.copy( source.sh ); + + return this; } - }; + fromJSON( json ) { - var ImageUtils = { + this.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON(); + this.sh.fromArray( json.sh ); - crossOrigin: undefined, + return this; - loadTexture: function ( url, mapping, onLoad, onError ) { + } - console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' ); + toJSON( meta ) { - var loader = new TextureLoader(); - loader.setCrossOrigin( this.crossOrigin ); + const data = super.toJSON( meta ); - var texture = loader.load( url, onLoad, undefined, onError ); + data.object.sh = this.sh.toArray(); - if ( mapping ) texture.mapping = mapping; + return data; - return texture; + } - }, + } - loadTextureCube: function ( urls, mapping, onLoad, onError ) { + class MaterialLoader extends Loader { - console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' ); + constructor( manager ) { - var loader = new CubeTextureLoader(); - loader.setCrossOrigin( this.crossOrigin ); + super( manager ); + this.textures = {}; - var texture = loader.load( urls, onLoad, undefined, onError ); + } - if ( mapping ) texture.mapping = mapping; + load( url, onLoad, onProgress, onError ) { - return texture; + const scope = this; - }, + const loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); + loader.setRequestHeader( scope.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( text ) { - loadCompressedTexture: function () { + try { - console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' ); + onLoad( scope.parse( JSON.parse( text ) ) ); - }, + } catch ( e ) { - loadCompressedTextureCube: function () { + if ( onError ) { - console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' ); + onError( e ); - } + } else { - }; + console.error( e ); - // + } - function Projector() { + scope.manager.itemError( url ); - console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' ); + } - this.projectVector = function ( vector, camera ) { + }, onProgress, onError ); - console.warn( 'THREE.Projector: .projectVector() is now vector.project().' ); - vector.project( camera ); + } - }; + parse( json ) { - this.unprojectVector = function ( vector, camera ) { + const textures = this.textures; - console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' ); - vector.unproject( camera ); + function getTexture( name ) { - }; + if ( textures[ name ] === undefined ) { - this.pickingRay = function () { + console.warn( 'THREE.MaterialLoader: Undefined texture', name ); - console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' ); + } - }; + return textures[ name ]; - } + } - // + const material = MaterialLoader.createMaterialFromType( json.type ); - function CanvasRenderer() { + if ( json.uuid !== undefined ) material.uuid = json.uuid; + if ( json.name !== undefined ) material.name = json.name; + if ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color ); + if ( json.roughness !== undefined ) material.roughness = json.roughness; + if ( json.metalness !== undefined ) material.metalness = json.metalness; + if ( json.sheen !== undefined ) material.sheen = json.sheen; + if ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor ); + if ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness; + if ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive ); + if ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular ); + if ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity; + if ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor ); + if ( json.shininess !== undefined ) material.shininess = json.shininess; + if ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat; + if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness; + if ( json.iridescence !== undefined ) material.iridescence = json.iridescence; + if ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR; + if ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange; + if ( json.transmission !== undefined ) material.transmission = json.transmission; + if ( json.thickness !== undefined ) material.thickness = json.thickness; + if ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance; + if ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor ); + if ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy; + if ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation; + if ( json.fog !== undefined ) material.fog = json.fog; + if ( json.flatShading !== undefined ) material.flatShading = json.flatShading; + if ( json.blending !== undefined ) material.blending = json.blending; + if ( json.combine !== undefined ) material.combine = json.combine; + if ( json.side !== undefined ) material.side = json.side; + if ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide; + if ( json.opacity !== undefined ) material.opacity = json.opacity; + if ( json.transparent !== undefined ) material.transparent = json.transparent; + if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; + if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; + if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; - console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' ); + if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite; + if ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask; + if ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc; + if ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef; + if ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask; + if ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail; + if ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail; + if ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass; - this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - this.clear = function () {}; - this.render = function () {}; - this.setClearColor = function () {}; - this.setSize = function () {}; + if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; + if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; + if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; + if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin; - } + if ( json.rotation !== undefined ) material.rotation = json.rotation; - exports.WebGLRenderTargetCube = WebGLRenderTargetCube; - exports.WebGLRenderTarget = WebGLRenderTarget; - exports.WebGLRenderer = WebGLRenderer; - exports.ShaderLib = ShaderLib; - exports.UniformsLib = UniformsLib; - exports.UniformsUtils = UniformsUtils; - exports.ShaderChunk = ShaderChunk; - exports.FogExp2 = FogExp2; - exports.Fog = Fog; - exports.Scene = Scene; - exports.LensFlare = LensFlare; - exports.Sprite = Sprite; - exports.LOD = LOD; - exports.SkinnedMesh = SkinnedMesh; - exports.Skeleton = Skeleton; - exports.Bone = Bone; - exports.Mesh = Mesh; - exports.LineSegments = LineSegments; - exports.LineLoop = LineLoop; - exports.Line = Line; - exports.Points = Points; - exports.Group = Group; - exports.VideoTexture = VideoTexture; - exports.DataTexture = DataTexture; - exports.CompressedTexture = CompressedTexture; - exports.CubeTexture = CubeTexture; - exports.CanvasTexture = CanvasTexture; - exports.DepthTexture = DepthTexture; - exports.Texture = Texture; - exports.CompressedTextureLoader = CompressedTextureLoader; - exports.DataTextureLoader = DataTextureLoader; - exports.CubeTextureLoader = CubeTextureLoader; - exports.TextureLoader = TextureLoader; - exports.ObjectLoader = ObjectLoader; - exports.MaterialLoader = MaterialLoader; - exports.BufferGeometryLoader = BufferGeometryLoader; - exports.DefaultLoadingManager = DefaultLoadingManager; - exports.LoadingManager = LoadingManager; - exports.JSONLoader = JSONLoader; - exports.ImageLoader = ImageLoader; - exports.FontLoader = FontLoader; - exports.FileLoader = FileLoader; - exports.Loader = Loader; - exports.Cache = Cache; - exports.AudioLoader = AudioLoader; - exports.SpotLightShadow = SpotLightShadow; - exports.SpotLight = SpotLight; - exports.PointLight = PointLight; - exports.RectAreaLight = RectAreaLight; - exports.HemisphereLight = HemisphereLight; - exports.DirectionalLightShadow = DirectionalLightShadow; - exports.DirectionalLight = DirectionalLight; + if ( json.linewidth !== 1 ) material.linewidth = json.linewidth; + if ( json.dashSize !== undefined ) material.dashSize = json.dashSize; + if ( json.gapSize !== undefined ) material.gapSize = json.gapSize; + if ( json.scale !== undefined ) material.scale = json.scale; + + if ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset; + if ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor; + if ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits; + + if ( json.dithering !== undefined ) material.dithering = json.dithering; + + if ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage; + if ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha; + if ( json.forceSinglePass !== undefined ) material.forceSinglePass = json.forceSinglePass; + + if ( json.visible !== undefined ) material.visible = json.visible; + + if ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped; + + if ( json.userData !== undefined ) material.userData = json.userData; + + if ( json.vertexColors !== undefined ) { + + if ( typeof json.vertexColors === 'number' ) { + + material.vertexColors = ( json.vertexColors > 0 ) ? true : false; + + } else { + + material.vertexColors = json.vertexColors; + + } + + } + + // Shader Material + + if ( json.uniforms !== undefined ) { + + for ( const name in json.uniforms ) { + + const uniform = json.uniforms[ name ]; + + material.uniforms[ name ] = {}; + + switch ( uniform.type ) { + + case 't': + material.uniforms[ name ].value = getTexture( uniform.value ); + break; + + case 'c': + material.uniforms[ name ].value = new Color().setHex( uniform.value ); + break; + + case 'v2': + material.uniforms[ name ].value = new Vector2().fromArray( uniform.value ); + break; + + case 'v3': + material.uniforms[ name ].value = new Vector3().fromArray( uniform.value ); + break; + + case 'v4': + material.uniforms[ name ].value = new Vector4().fromArray( uniform.value ); + break; + + case 'm3': + material.uniforms[ name ].value = new Matrix3().fromArray( uniform.value ); + break; + + case 'm4': + material.uniforms[ name ].value = new Matrix4().fromArray( uniform.value ); + break; + + default: + material.uniforms[ name ].value = uniform.value; + + } + + } + + } + + if ( json.defines !== undefined ) material.defines = json.defines; + if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; + if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; + if ( json.glslVersion !== undefined ) material.glslVersion = json.glslVersion; + + if ( json.extensions !== undefined ) { + + for ( const key in json.extensions ) { + + material.extensions[ key ] = json.extensions[ key ]; + + } + + } + + if ( json.lights !== undefined ) material.lights = json.lights; + if ( json.clipping !== undefined ) material.clipping = json.clipping; + + // for PointsMaterial + + if ( json.size !== undefined ) material.size = json.size; + if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation; + + // maps + + if ( json.map !== undefined ) material.map = getTexture( json.map ); + if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap ); + + if ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap ); + + if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap ); + if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; + + if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap ); + if ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType; + if ( json.normalScale !== undefined ) { + + let normalScale = json.normalScale; + + if ( Array.isArray( normalScale ) === false ) { + + // Blender exporter used to export a scalar. See #7459 + + normalScale = [ normalScale, normalScale ]; + + } + + material.normalScale = new Vector2().fromArray( normalScale ); + + } + + if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap ); + if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale; + if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias; + + if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap ); + if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap ); + + if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap ); + if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; + + if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap ); + if ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap ); + if ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap ); + + if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap ); + if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity; + + if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; + if ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio; + + if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); + if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; + + if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); + if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; + + if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap ); + + if ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap ); + if ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap ); + if ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap ); + if ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale ); + + if ( json.iridescenceMap !== undefined ) material.iridescenceMap = getTexture( json.iridescenceMap ); + if ( json.iridescenceThicknessMap !== undefined ) material.iridescenceThicknessMap = getTexture( json.iridescenceThicknessMap ); + + if ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap ); + if ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap ); + + if ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap ); + + if ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap ); + if ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap ); + + return material; + + } + + setTextures( value ) { + + this.textures = value; + return this; + + } + + static createMaterialFromType( type ) { + + const materialLib = { + ShadowMaterial, + SpriteMaterial, + RawShaderMaterial, + ShaderMaterial, + PointsMaterial, + MeshPhysicalMaterial, + MeshStandardMaterial, + MeshPhongMaterial, + MeshToonMaterial, + MeshNormalMaterial, + MeshLambertMaterial, + MeshDepthMaterial, + MeshDistanceMaterial, + MeshBasicMaterial, + MeshMatcapMaterial, + LineDashedMaterial, + LineBasicMaterial, + Material + }; + + return new materialLib[ type ](); + + } + + } + + class LoaderUtils { + + static decodeText( array ) { + + if ( typeof TextDecoder !== 'undefined' ) { + + return new TextDecoder().decode( array ); + + } + + // Avoid the String.fromCharCode.apply(null, array) shortcut, which + // throws a "maximum call stack size exceeded" error for large arrays. + + let s = ''; + + for ( let i = 0, il = array.length; i < il; i ++ ) { + + // Implicitly assumes little-endian. + s += String.fromCharCode( array[ i ] ); + + } + + try { + + // merges multi-byte utf-8 characters. + + return decodeURIComponent( escape( s ) ); + + } catch ( e ) { // see #16358 + + return s; + + } + + } + + static extractUrlBase( url ) { + + const index = url.lastIndexOf( '/' ); + + if ( index === - 1 ) return './'; + + return url.slice( 0, index + 1 ); + + } + + static resolveURL( url, path ) { + + // Invalid URL + if ( typeof url !== 'string' || url === '' ) return ''; + + // Host Relative URL + if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) { + + path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' ); + + } + + // Absolute URL http://,https://,// + if ( /^(https?:)?\/\//i.test( url ) ) return url; + + // Data URI + if ( /^data:.*,.*$/i.test( url ) ) return url; + + // Blob URL + if ( /^blob:.*$/i.test( url ) ) return url; + + // Relative URL + return path + url; + + } + + } + + class InstancedBufferGeometry extends BufferGeometry { + + constructor() { + + super(); + + this.isInstancedBufferGeometry = true; + + this.type = 'InstancedBufferGeometry'; + this.instanceCount = Infinity; + + } + + copy( source ) { + + super.copy( source ); + + this.instanceCount = source.instanceCount; + + return this; + + } + + toJSON() { + + const data = super.toJSON(); + + data.instanceCount = this.instanceCount; + + data.isInstancedBufferGeometry = true; + + return data; + + } + + } + + class BufferGeometryLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); + loader.setRequestHeader( scope.requestHeader ); + loader.setWithCredentials( scope.withCredentials ); + loader.load( url, function ( text ) { + + try { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + + parse( json ) { + + const interleavedBufferMap = {}; + const arrayBufferMap = {}; + + function getInterleavedBuffer( json, uuid ) { + + if ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ]; + + const interleavedBuffers = json.interleavedBuffers; + const interleavedBuffer = interleavedBuffers[ uuid ]; + + const buffer = getArrayBuffer( json, interleavedBuffer.buffer ); + + const array = getTypedArray( interleavedBuffer.type, buffer ); + const ib = new InterleavedBuffer( array, interleavedBuffer.stride ); + ib.uuid = interleavedBuffer.uuid; + + interleavedBufferMap[ uuid ] = ib; + + return ib; + + } + + function getArrayBuffer( json, uuid ) { + + if ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ]; + + const arrayBuffers = json.arrayBuffers; + const arrayBuffer = arrayBuffers[ uuid ]; + + const ab = new Uint32Array( arrayBuffer ).buffer; + + arrayBufferMap[ uuid ] = ab; + + return ab; + + } + + const geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry(); + + const index = json.data.index; + + if ( index !== undefined ) { + + const typedArray = getTypedArray( index.type, index.array ); + geometry.setIndex( new BufferAttribute( typedArray, 1 ) ); + + } + + const attributes = json.data.attributes; + + for ( const key in attributes ) { + + const attribute = attributes[ key ]; + let bufferAttribute; + + if ( attribute.isInterleavedBufferAttribute ) { + + const interleavedBuffer = getInterleavedBuffer( json.data, attribute.data ); + bufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized ); + + } else { + + const typedArray = getTypedArray( attribute.type, attribute.array ); + const bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute; + bufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized ); + + } + + if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; + if ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage ); + + if ( attribute.updateRange !== undefined ) { + + bufferAttribute.updateRange.offset = attribute.updateRange.offset; + bufferAttribute.updateRange.count = attribute.updateRange.count; + + } + + geometry.setAttribute( key, bufferAttribute ); + + } + + const morphAttributes = json.data.morphAttributes; + + if ( morphAttributes ) { + + for ( const key in morphAttributes ) { + + const attributeArray = morphAttributes[ key ]; + + const array = []; + + for ( let i = 0, il = attributeArray.length; i < il; i ++ ) { + + const attribute = attributeArray[ i ]; + let bufferAttribute; + + if ( attribute.isInterleavedBufferAttribute ) { + + const interleavedBuffer = getInterleavedBuffer( json.data, attribute.data ); + bufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized ); + + } else { + + const typedArray = getTypedArray( attribute.type, attribute.array ); + bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ); + + } + + if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; + array.push( bufferAttribute ); + + } + + geometry.morphAttributes[ key ] = array; + + } + + } + + const morphTargetsRelative = json.data.morphTargetsRelative; + + if ( morphTargetsRelative ) { + + geometry.morphTargetsRelative = true; + + } + + const groups = json.data.groups || json.data.drawcalls || json.data.offsets; + + if ( groups !== undefined ) { + + for ( let i = 0, n = groups.length; i !== n; ++ i ) { + + const group = groups[ i ]; + + geometry.addGroup( group.start, group.count, group.materialIndex ); + + } + + } + + const boundingSphere = json.data.boundingSphere; + + if ( boundingSphere !== undefined ) { + + const center = new Vector3(); + + if ( boundingSphere.center !== undefined ) { + + center.fromArray( boundingSphere.center ); + + } + + geometry.boundingSphere = new Sphere( center, boundingSphere.radius ); + + } + + if ( json.name ) geometry.name = json.name; + if ( json.userData ) geometry.userData = json.userData; + + return geometry; + + } + + } + + class ObjectLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path; + this.resourcePath = this.resourcePath || path; + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { + + let json = null; + + try { + + json = JSON.parse( text ); + + } catch ( error ) { + + if ( onError !== undefined ) onError( error ); + + console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message ); + + return; + + } + + const metadata = json.metadata; + + if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { + + if ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\'t load ' + url ) ); + + console.error( 'THREE.ObjectLoader: Can\'t load ' + url ); + return; + + } + + scope.parse( json, onLoad ); + + }, onProgress, onError ); + + } + + async loadAsync( url, onProgress ) { + + const scope = this; + + const path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path; + this.resourcePath = this.resourcePath || path; + + const loader = new FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + + const text = await loader.loadAsync( url, onProgress ); + + const json = JSON.parse( text ); + + const metadata = json.metadata; + + if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { + + throw new Error( 'THREE.ObjectLoader: Can\'t load ' + url ); + + } + + return await scope.parseAsync( json ); + + } + + parse( json, onLoad ) { + + const animations = this.parseAnimations( json.animations ); + const shapes = this.parseShapes( json.shapes ); + const geometries = this.parseGeometries( json.geometries, shapes ); + + const images = this.parseImages( json.images, function () { + + if ( onLoad !== undefined ) onLoad( object ); + + } ); + + const textures = this.parseTextures( json.textures, images ); + const materials = this.parseMaterials( json.materials, textures ); + + const object = this.parseObject( json.object, geometries, materials, textures, animations ); + const skeletons = this.parseSkeletons( json.skeletons, object ); + + this.bindSkeletons( object, skeletons ); + + // + + if ( onLoad !== undefined ) { + + let hasImages = false; + + for ( const uuid in images ) { + + if ( images[ uuid ].data instanceof HTMLImageElement ) { + + hasImages = true; + break; + + } + + } + + if ( hasImages === false ) onLoad( object ); + + } + + return object; + + } + + async parseAsync( json ) { + + const animations = this.parseAnimations( json.animations ); + const shapes = this.parseShapes( json.shapes ); + const geometries = this.parseGeometries( json.geometries, shapes ); + + const images = await this.parseImagesAsync( json.images ); + + const textures = this.parseTextures( json.textures, images ); + const materials = this.parseMaterials( json.materials, textures ); + + const object = this.parseObject( json.object, geometries, materials, textures, animations ); + const skeletons = this.parseSkeletons( json.skeletons, object ); + + this.bindSkeletons( object, skeletons ); + + return object; + + } + + parseShapes( json ) { + + const shapes = {}; + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const shape = new Shape().fromJSON( json[ i ] ); + + shapes[ shape.uuid ] = shape; + + } + + } + + return shapes; + + } + + parseSkeletons( json, object ) { + + const skeletons = {}; + const bones = {}; + + // generate bone lookup table + + object.traverse( function ( child ) { + + if ( child.isBone ) bones[ child.uuid ] = child; + + } ); + + // create skeletons + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const skeleton = new Skeleton().fromJSON( json[ i ], bones ); + + skeletons[ skeleton.uuid ] = skeleton; + + } + + } + + return skeletons; + + } + + parseGeometries( json, shapes ) { + + const geometries = {}; + + if ( json !== undefined ) { + + const bufferGeometryLoader = new BufferGeometryLoader(); + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + let geometry; + const data = json[ i ]; + + switch ( data.type ) { + + case 'BufferGeometry': + case 'InstancedBufferGeometry': + + geometry = bufferGeometryLoader.parse( data ); + break; + + default: + + if ( data.type in Geometries ) { + + geometry = Geometries[ data.type ].fromJSON( data, shapes ); + + } else { + + console.warn( `THREE.ObjectLoader: Unsupported geometry type "${ data.type }"` ); + + } + + } + + geometry.uuid = data.uuid; + + if ( data.name !== undefined ) geometry.name = data.name; + if ( data.userData !== undefined ) geometry.userData = data.userData; + + geometries[ data.uuid ] = geometry; + + } + + } + + return geometries; + + } + + parseMaterials( json, textures ) { + + const cache = {}; // MultiMaterial + const materials = {}; + + if ( json !== undefined ) { + + const loader = new MaterialLoader(); + loader.setTextures( textures ); + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const data = json[ i ]; + + if ( cache[ data.uuid ] === undefined ) { + + cache[ data.uuid ] = loader.parse( data ); + + } + + materials[ data.uuid ] = cache[ data.uuid ]; + + } + + } + + return materials; + + } + + parseAnimations( json ) { + + const animations = {}; + + if ( json !== undefined ) { + + for ( let i = 0; i < json.length; i ++ ) { + + const data = json[ i ]; + + const clip = AnimationClip.parse( data ); + + animations[ clip.uuid ] = clip; + + } + + } + + return animations; + + } + + parseImages( json, onLoad ) { + + const scope = this; + const images = {}; + + let loader; + + function loadImage( url ) { + + scope.manager.itemStart( url ); + + return loader.load( url, function () { + + scope.manager.itemEnd( url ); + + }, undefined, function () { + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + } ); + + } + + function deserializeImage( image ) { + + if ( typeof image === 'string' ) { + + const url = image; + + const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( url ) ? url : scope.resourcePath + url; + + return loadImage( path ); + + } else { + + if ( image.data ) { + + return { + data: getTypedArray( image.type, image.data ), + width: image.width, + height: image.height + }; + + } else { + + return null; + + } + + } + + } + + if ( json !== undefined && json.length > 0 ) { + + const manager = new LoadingManager( onLoad ); + + loader = new ImageLoader( manager ); + loader.setCrossOrigin( this.crossOrigin ); + + for ( let i = 0, il = json.length; i < il; i ++ ) { + + const image = json[ i ]; + const url = image.url; + + if ( Array.isArray( url ) ) { + + // load array of images e.g CubeTexture + + const imageArray = []; + + for ( let j = 0, jl = url.length; j < jl; j ++ ) { + + const currentUrl = url[ j ]; + + const deserializedImage = deserializeImage( currentUrl ); + + if ( deserializedImage !== null ) { + + if ( deserializedImage instanceof HTMLImageElement ) { + + imageArray.push( deserializedImage ); + + } else { + + // special case: handle array of data textures for cube textures + + imageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) ); + + } + + } + + } + + images[ image.uuid ] = new Source( imageArray ); + + } else { + + // load single image + + const deserializedImage = deserializeImage( image.url ); + images[ image.uuid ] = new Source( deserializedImage ); + + + } + + } + + } + + return images; + + } + + async parseImagesAsync( json ) { + + const scope = this; + const images = {}; + + let loader; + + async function deserializeImage( image ) { + + if ( typeof image === 'string' ) { + + const url = image; + + const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( url ) ? url : scope.resourcePath + url; + + return await loader.loadAsync( path ); + + } else { + + if ( image.data ) { + + return { + data: getTypedArray( image.type, image.data ), + width: image.width, + height: image.height + }; + + } else { + + return null; + + } + + } + + } + + if ( json !== undefined && json.length > 0 ) { + + loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + + for ( let i = 0, il = json.length; i < il; i ++ ) { + + const image = json[ i ]; + const url = image.url; + + if ( Array.isArray( url ) ) { + + // load array of images e.g CubeTexture + + const imageArray = []; + + for ( let j = 0, jl = url.length; j < jl; j ++ ) { + + const currentUrl = url[ j ]; + + const deserializedImage = await deserializeImage( currentUrl ); + + if ( deserializedImage !== null ) { + + if ( deserializedImage instanceof HTMLImageElement ) { + + imageArray.push( deserializedImage ); + + } else { + + // special case: handle array of data textures for cube textures + + imageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) ); + + } + + } + + } + + images[ image.uuid ] = new Source( imageArray ); + + } else { + + // load single image + + const deserializedImage = await deserializeImage( image.url ); + images[ image.uuid ] = new Source( deserializedImage ); + + } + + } + + } + + return images; + + } + + parseTextures( json, images ) { + + function parseConstant( value, type ) { + + if ( typeof value === 'number' ) return value; + + console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value ); + + return type[ value ]; + + } + + const textures = {}; + + if ( json !== undefined ) { + + for ( let i = 0, l = json.length; i < l; i ++ ) { + + const data = json[ i ]; + + if ( data.image === undefined ) { + + console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid ); + + } + + if ( images[ data.image ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined image', data.image ); + + } + + const source = images[ data.image ]; + const image = source.data; + + let texture; + + if ( Array.isArray( image ) ) { + + texture = new CubeTexture(); + + if ( image.length === 6 ) texture.needsUpdate = true; + + } else { + + if ( image && image.data ) { + + texture = new DataTexture(); + + } else { + + texture = new Texture(); + + } + + if ( image ) texture.needsUpdate = true; // textures can have undefined image data + + } + + texture.source = source; + + texture.uuid = data.uuid; + + if ( data.name !== undefined ) texture.name = data.name; + + if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING ); + if ( data.channel !== undefined ) texture.channel = data.channel; + + if ( data.offset !== undefined ) texture.offset.fromArray( data.offset ); + if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat ); + if ( data.center !== undefined ) texture.center.fromArray( data.center ); + if ( data.rotation !== undefined ) texture.rotation = data.rotation; + + if ( data.wrap !== undefined ) { + + texture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING ); + texture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING ); + + } + + if ( data.format !== undefined ) texture.format = data.format; + if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat; + if ( data.type !== undefined ) texture.type = data.type; + if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace; + if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152 + + if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER ); + if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER ); + if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy; + + if ( data.flipY !== undefined ) texture.flipY = data.flipY; + + if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps; + if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha; + if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment; + if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction; + + if ( data.userData !== undefined ) texture.userData = data.userData; + + textures[ data.uuid ] = texture; + + } + + } + + return textures; + + } + + parseObject( data, geometries, materials, textures, animations ) { + + let object; + + function getGeometry( name ) { + + if ( geometries[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined geometry', name ); + + } + + return geometries[ name ]; + + } + + function getMaterial( name ) { + + if ( name === undefined ) return undefined; + + if ( Array.isArray( name ) ) { + + const array = []; + + for ( let i = 0, l = name.length; i < l; i ++ ) { + + const uuid = name[ i ]; + + if ( materials[ uuid ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', uuid ); + + } + + array.push( materials[ uuid ] ); + + } + + return array; + + } + + if ( materials[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', name ); + + } + + return materials[ name ]; + + } + + function getTexture( uuid ) { + + if ( textures[ uuid ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined texture', uuid ); + + } + + return textures[ uuid ]; + + } + + let geometry, material; + + switch ( data.type ) { + + case 'Scene': + + object = new Scene(); + + if ( data.background !== undefined ) { + + if ( Number.isInteger( data.background ) ) { + + object.background = new Color( data.background ); + + } else { + + object.background = getTexture( data.background ); + + } + + } + + if ( data.environment !== undefined ) { + + object.environment = getTexture( data.environment ); + + } + + if ( data.fog !== undefined ) { + + if ( data.fog.type === 'Fog' ) { + + object.fog = new Fog( data.fog.color, data.fog.near, data.fog.far ); + + } else if ( data.fog.type === 'FogExp2' ) { + + object.fog = new FogExp2( data.fog.color, data.fog.density ); + + } + + } + + if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness; + if ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity; + + break; + + case 'PerspectiveCamera': + + object = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far ); + + if ( data.focus !== undefined ) object.focus = data.focus; + if ( data.zoom !== undefined ) object.zoom = data.zoom; + if ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge; + if ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset; + if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + + break; + + case 'OrthographicCamera': + + object = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far ); + + if ( data.zoom !== undefined ) object.zoom = data.zoom; + if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + + break; + + case 'AmbientLight': + + object = new AmbientLight( data.color, data.intensity ); + + break; + + case 'DirectionalLight': + + object = new DirectionalLight( data.color, data.intensity ); + + break; + + case 'PointLight': + + object = new PointLight( data.color, data.intensity, data.distance, data.decay ); + + break; + + case 'RectAreaLight': + + object = new RectAreaLight( data.color, data.intensity, data.width, data.height ); + + break; + + case 'SpotLight': + + object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay ); + + break; + + case 'HemisphereLight': + + object = new HemisphereLight( data.color, data.groundColor, data.intensity ); + + break; + + case 'LightProbe': + + object = new LightProbe().fromJSON( data ); + + break; + + case 'SkinnedMesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + + object = new SkinnedMesh( geometry, material ); + + if ( data.bindMode !== undefined ) object.bindMode = data.bindMode; + if ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix ); + if ( data.skeleton !== undefined ) object.skeleton = data.skeleton; + + break; + + case 'Mesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + + object = new Mesh( geometry, material ); + + break; + + case 'InstancedMesh': + + geometry = getGeometry( data.geometry ); + material = getMaterial( data.material ); + const count = data.count; + const instanceMatrix = data.instanceMatrix; + const instanceColor = data.instanceColor; + + object = new InstancedMesh( geometry, material, count ); + object.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 ); + if ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize ); + + break; + + case 'LOD': + + object = new LOD(); + + break; + + case 'Line': + + object = new Line( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'LineLoop': + + object = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'LineSegments': + + object = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'PointCloud': + case 'Points': + + object = new Points( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'Sprite': + + object = new Sprite( getMaterial( data.material ) ); + + break; + + case 'Group': + + object = new Group(); + + break; + + case 'Bone': + + object = new Bone(); + + break; + + default: + + object = new Object3D(); + + } + + object.uuid = data.uuid; + + if ( data.name !== undefined ) object.name = data.name; + + if ( data.matrix !== undefined ) { + + object.matrix.fromArray( data.matrix ); + + if ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate; + if ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale ); + + } else { + + if ( data.position !== undefined ) object.position.fromArray( data.position ); + if ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation ); + if ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion ); + if ( data.scale !== undefined ) object.scale.fromArray( data.scale ); + + } + + if ( data.up !== undefined ) object.up.fromArray( data.up ); + + if ( data.castShadow !== undefined ) object.castShadow = data.castShadow; + if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow; + + if ( data.shadow ) { + + if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias; + if ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias; + if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius; + if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize ); + if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera ); + + } + + if ( data.visible !== undefined ) object.visible = data.visible; + if ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled; + if ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder; + if ( data.userData !== undefined ) object.userData = data.userData; + if ( data.layers !== undefined ) object.layers.mask = data.layers; + + if ( data.children !== undefined ) { + + const children = data.children; + + for ( let i = 0; i < children.length; i ++ ) { + + object.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) ); + + } + + } + + if ( data.animations !== undefined ) { + + const objectAnimations = data.animations; + + for ( let i = 0; i < objectAnimations.length; i ++ ) { + + const uuid = objectAnimations[ i ]; + + object.animations.push( animations[ uuid ] ); + + } + + } + + if ( data.type === 'LOD' ) { + + if ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate; + + const levels = data.levels; + + for ( let l = 0; l < levels.length; l ++ ) { + + const level = levels[ l ]; + const child = object.getObjectByProperty( 'uuid', level.object ); + + if ( child !== undefined ) { + + object.addLevel( child, level.distance, level.hysteresis ); + + } + + } + + } + + return object; + + } + + bindSkeletons( object, skeletons ) { + + if ( Object.keys( skeletons ).length === 0 ) return; + + object.traverse( function ( child ) { + + if ( child.isSkinnedMesh === true && child.skeleton !== undefined ) { + + const skeleton = skeletons[ child.skeleton ]; + + if ( skeleton === undefined ) { + + console.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton ); + + } else { + + child.bind( skeleton, child.bindMatrix ); + + } + + } + + } ); + + } + + } + + const TEXTURE_MAPPING = { + UVMapping: UVMapping, + CubeReflectionMapping: CubeReflectionMapping, + CubeRefractionMapping: CubeRefractionMapping, + EquirectangularReflectionMapping: EquirectangularReflectionMapping, + EquirectangularRefractionMapping: EquirectangularRefractionMapping, + CubeUVReflectionMapping: CubeUVReflectionMapping + }; + + const TEXTURE_WRAPPING = { + RepeatWrapping: RepeatWrapping, + ClampToEdgeWrapping: ClampToEdgeWrapping, + MirroredRepeatWrapping: MirroredRepeatWrapping + }; + + const TEXTURE_FILTER = { + NearestFilter: NearestFilter, + NearestMipmapNearestFilter: NearestMipmapNearestFilter, + NearestMipmapLinearFilter: NearestMipmapLinearFilter, + LinearFilter: LinearFilter, + LinearMipmapNearestFilter: LinearMipmapNearestFilter, + LinearMipmapLinearFilter: LinearMipmapLinearFilter + }; + + class ImageBitmapLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + this.isImageBitmapLoader = true; + + if ( typeof createImageBitmap === 'undefined' ) { + + console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' ); + + } + + if ( typeof fetch === 'undefined' ) { + + console.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' ); + + } + + this.options = { premultiplyAlpha: 'none' }; + + } + + setOptions( options ) { + + this.options = options; + + return this; + + } + + load( url, onLoad, onProgress, onError ) { + + if ( url === undefined ) url = ''; + + if ( this.path !== undefined ) url = this.path + url; + + url = this.manager.resolveURL( url ); + + const scope = this; + + const cached = Cache.get( url ); + + if ( cached !== undefined ) { + + scope.manager.itemStart( url ); + + setTimeout( function () { + + if ( onLoad ) onLoad( cached ); + + scope.manager.itemEnd( url ); + + }, 0 ); + + return cached; + + } + + const fetchOptions = {}; + fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include'; + fetchOptions.headers = this.requestHeader; + + fetch( url, fetchOptions ).then( function ( res ) { + + return res.blob(); + + } ).then( function ( blob ) { + + return createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) ); + + } ).then( function ( imageBitmap ) { + + Cache.add( url, imageBitmap ); + + if ( onLoad ) onLoad( imageBitmap ); + + scope.manager.itemEnd( url ); + + } ).catch( function ( e ) { + + if ( onError ) onError( e ); + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + } ); + + scope.manager.itemStart( url ); + + } + + } + + let _context; + + class AudioContext { + + static getContext() { + + if ( _context === undefined ) { + + _context = new ( window.AudioContext || window.webkitAudioContext )(); + + } + + return _context; + + } + + static setContext( value ) { + + _context = value; + + } + + } + + class AudioLoader extends Loader { + + constructor( manager ) { + + super( manager ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + const loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( buffer ) { + + try { + + // Create a copy of the buffer. The `decodeAudioData` method + // detaches the buffer when complete, preventing reuse. + const bufferCopy = buffer.slice( 0 ); + + const context = AudioContext.getContext(); + context.decodeAudioData( bufferCopy, function ( audioBuffer ) { + + onLoad( audioBuffer ); + + }, handleError ); + + } catch ( e ) { + + handleError( e ); + + } + + }, onProgress, onError ); + + function handleError( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + } + + } + + class HemisphereLightProbe extends LightProbe { + + constructor( skyColor, groundColor, intensity = 1 ) { + + super( undefined, intensity ); + + this.isHemisphereLightProbe = true; + + const color1 = new Color().set( skyColor ); + const color2 = new Color().set( groundColor ); + + const sky = new Vector3( color1.r, color1.g, color1.b ); + const ground = new Vector3( color2.r, color2.g, color2.b ); + + // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI ); + const c0 = Math.sqrt( Math.PI ); + const c1 = c0 * Math.sqrt( 0.75 ); + + this.sh.coefficients[ 0 ].copy( sky ).add( ground ).multiplyScalar( c0 ); + this.sh.coefficients[ 1 ].copy( sky ).sub( ground ).multiplyScalar( c1 ); + + } + + } + + class AmbientLightProbe extends LightProbe { + + constructor( color, intensity = 1 ) { + + super( undefined, intensity ); + + this.isAmbientLightProbe = true; + + const color1 = new Color().set( color ); + + // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI ); + this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) ); + + } + + } + + const _eyeRight = /*@__PURE__*/ new Matrix4(); + const _eyeLeft = /*@__PURE__*/ new Matrix4(); + const _projectionMatrix = /*@__PURE__*/ new Matrix4(); + + class StereoCamera { + + constructor() { + + this.type = 'StereoCamera'; + + this.aspect = 1; + + this.eyeSep = 0.064; + + this.cameraL = new PerspectiveCamera(); + this.cameraL.layers.enable( 1 ); + this.cameraL.matrixAutoUpdate = false; + + this.cameraR = new PerspectiveCamera(); + this.cameraR.layers.enable( 2 ); + this.cameraR.matrixAutoUpdate = false; + + this._cache = { + focus: null, + fov: null, + aspect: null, + near: null, + far: null, + zoom: null, + eyeSep: null + }; + + } + + update( camera ) { + + const cache = this._cache; + + const needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || + cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || + cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep; + + if ( needsUpdate ) { + + cache.focus = camera.focus; + cache.fov = camera.fov; + cache.aspect = camera.aspect * this.aspect; + cache.near = camera.near; + cache.far = camera.far; + cache.zoom = camera.zoom; + cache.eyeSep = this.eyeSep; + + // Off-axis stereoscopic effect based on + // http://paulbourke.net/stereographics/stereorender/ + + _projectionMatrix.copy( camera.projectionMatrix ); + const eyeSepHalf = cache.eyeSep / 2; + const eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus; + const ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom; + let xmin, xmax; + + // translate xOffset + + _eyeLeft.elements[ 12 ] = - eyeSepHalf; + _eyeRight.elements[ 12 ] = eyeSepHalf; + + // for left eye + + xmin = - ymax * cache.aspect + eyeSepOnProjection; + xmax = ymax * cache.aspect + eyeSepOnProjection; + + _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); + _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraL.projectionMatrix.copy( _projectionMatrix ); + + // for right eye + + xmin = - ymax * cache.aspect - eyeSepOnProjection; + xmax = ymax * cache.aspect - eyeSepOnProjection; + + _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); + _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraR.projectionMatrix.copy( _projectionMatrix ); + + } + + this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft ); + this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight ); + + } + + } + + class Clock { + + constructor( autoStart = true ) { + + this.autoStart = autoStart; + + this.startTime = 0; + this.oldTime = 0; + this.elapsedTime = 0; + + this.running = false; + + } + + start() { + + this.startTime = now(); + + this.oldTime = this.startTime; + this.elapsedTime = 0; + this.running = true; + + } + + stop() { + + this.getElapsedTime(); + this.running = false; + this.autoStart = false; + + } + + getElapsedTime() { + + this.getDelta(); + return this.elapsedTime; + + } + + getDelta() { + + let diff = 0; + + if ( this.autoStart && ! this.running ) { + + this.start(); + return 0; + + } + + if ( this.running ) { + + const newTime = now(); + + diff = ( newTime - this.oldTime ) / 1000; + this.oldTime = newTime; + + this.elapsedTime += diff; + + } + + return diff; + + } + + } + + function now() { + + return ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732 + + } + + const _position$1 = /*@__PURE__*/ new Vector3(); + const _quaternion$1 = /*@__PURE__*/ new Quaternion(); + const _scale$1 = /*@__PURE__*/ new Vector3(); + const _orientation$1 = /*@__PURE__*/ new Vector3(); + + class AudioListener extends Object3D { + + constructor() { + + super(); + + this.type = 'AudioListener'; + + this.context = AudioContext.getContext(); + + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); + + this.filter = null; + + this.timeDelta = 0; + + // private + + this._clock = new Clock(); + + } + + getInput() { + + return this.gain; + + } + + removeFilter() { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + this.gain.connect( this.context.destination ); + this.filter = null; + + } + + return this; + + } + + getFilter() { + + return this.filter; + + } + + setFilter( value ) { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + + } else { + + this.gain.disconnect( this.context.destination ); + + } + + this.filter = value; + this.gain.connect( this.filter ); + this.filter.connect( this.context.destination ); + + return this; + + } + + getMasterVolume() { + + return this.gain.gain.value; + + } + + setMasterVolume( value ) { + + this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); + + return this; + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + const listener = this.context.listener; + const up = this.up; + + this.timeDelta = this._clock.getDelta(); + + this.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 ); + + _orientation$1.set( 0, 0, - 1 ).applyQuaternion( _quaternion$1 ); + + if ( listener.positionX ) { + + // code path for Chrome (see #14393) + + const endTime = this.context.currentTime + this.timeDelta; + + listener.positionX.linearRampToValueAtTime( _position$1.x, endTime ); + listener.positionY.linearRampToValueAtTime( _position$1.y, endTime ); + listener.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); + listener.forwardX.linearRampToValueAtTime( _orientation$1.x, endTime ); + listener.forwardY.linearRampToValueAtTime( _orientation$1.y, endTime ); + listener.forwardZ.linearRampToValueAtTime( _orientation$1.z, endTime ); + listener.upX.linearRampToValueAtTime( up.x, endTime ); + listener.upY.linearRampToValueAtTime( up.y, endTime ); + listener.upZ.linearRampToValueAtTime( up.z, endTime ); + + } else { + + listener.setPosition( _position$1.x, _position$1.y, _position$1.z ); + listener.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z ); + + } + + } + + } + + class Audio extends Object3D { + + constructor( listener ) { + + super(); + + this.type = 'Audio'; + + this.listener = listener; + this.context = listener.context; + + this.gain = this.context.createGain(); + this.gain.connect( listener.getInput() ); + + this.autoplay = false; + + this.buffer = null; + this.detune = 0; + this.loop = false; + this.loopStart = 0; + this.loopEnd = 0; + this.offset = 0; + this.duration = undefined; + this.playbackRate = 1; + this.isPlaying = false; + this.hasPlaybackControl = true; + this.source = null; + this.sourceType = 'empty'; + + this._startedAt = 0; + this._progress = 0; + this._connected = false; + + this.filters = []; + + } + + getOutput() { + + return this.gain; + + } + + setNodeSource( audioNode ) { + + this.hasPlaybackControl = false; + this.sourceType = 'audioNode'; + this.source = audioNode; + this.connect(); + + return this; + + } + + setMediaElementSource( mediaElement ) { + + this.hasPlaybackControl = false; + this.sourceType = 'mediaNode'; + this.source = this.context.createMediaElementSource( mediaElement ); + this.connect(); + + return this; + + } + + setMediaStreamSource( mediaStream ) { + + this.hasPlaybackControl = false; + this.sourceType = 'mediaStreamNode'; + this.source = this.context.createMediaStreamSource( mediaStream ); + this.connect(); + + return this; + + } + + setBuffer( audioBuffer ) { + + this.buffer = audioBuffer; + this.sourceType = 'buffer'; + + if ( this.autoplay ) this.play(); + + return this; + + } + + play( delay = 0 ) { + + if ( this.isPlaying === true ) { + + console.warn( 'THREE.Audio: Audio is already playing.' ); + return; + + } + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this._startedAt = this.context.currentTime + delay; + + const source = this.context.createBufferSource(); + source.buffer = this.buffer; + source.loop = this.loop; + source.loopStart = this.loopStart; + source.loopEnd = this.loopEnd; + source.onended = this.onEnded.bind( this ); + source.start( this._startedAt, this._progress + this.offset, this.duration ); + + this.isPlaying = true; + + this.source = source; + + this.setDetune( this.detune ); + this.setPlaybackRate( this.playbackRate ); + + return this.connect(); + + } + + pause() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + if ( this.isPlaying === true ) { + + // update current progress + + this._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate; + + if ( this.loop === true ) { + + // ensure _progress does not exceed duration with looped audios + + this._progress = this._progress % ( this.duration || this.buffer.duration ); + + } + + this.source.stop(); + this.source.onended = null; + + this.isPlaying = false; + + } + + return this; + + } + + stop() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this._progress = 0; + + if ( this.source !== null ) { + + this.source.stop(); + this.source.onended = null; + + } + + this.isPlaying = false; + + return this; + + } + + connect() { + + if ( this.filters.length > 0 ) { + + this.source.connect( this.filters[ 0 ] ); + + for ( let i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].connect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].connect( this.getOutput() ); + + } else { + + this.source.connect( this.getOutput() ); + + } + + this._connected = true; + + return this; + + } + + disconnect() { + + if ( this.filters.length > 0 ) { + + this.source.disconnect( this.filters[ 0 ] ); + + for ( let i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].disconnect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].disconnect( this.getOutput() ); + + } else { + + this.source.disconnect( this.getOutput() ); + + } + + this._connected = false; + + return this; + + } + + getFilters() { + + return this.filters; + + } + + setFilters( value ) { + + if ( ! value ) value = []; + + if ( this._connected === true ) { + + this.disconnect(); + this.filters = value.slice(); + this.connect(); + + } else { + + this.filters = value.slice(); + + } + + return this; + + } + + setDetune( value ) { + + this.detune = value; + + if ( this.source.detune === undefined ) return; // only set detune when available + + if ( this.isPlaying === true ) { + + this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 ); + + } + + return this; + + } + + getDetune() { + + return this.detune; + + } + + getFilter() { + + return this.getFilters()[ 0 ]; + + } + + setFilter( filter ) { + + return this.setFilters( filter ? [ filter ] : [] ); + + } + + setPlaybackRate( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.playbackRate = value; + + if ( this.isPlaying === true ) { + + this.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 ); + + } + + return this; + + } + + getPlaybackRate() { + + return this.playbackRate; + + } + + onEnded() { + + this.isPlaying = false; + + } + + getLoop() { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return false; + + } + + return this.loop; + + } + + setLoop( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.loop = value; + + if ( this.isPlaying === true ) { + + this.source.loop = this.loop; + + } + + return this; + + } + + setLoopStart( value ) { + + this.loopStart = value; + + return this; + + } + + setLoopEnd( value ) { + + this.loopEnd = value; + + return this; + + } + + getVolume() { + + return this.gain.gain.value; + + } + + setVolume( value ) { + + this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); + + return this; + + } + + } + + const _position = /*@__PURE__*/ new Vector3(); + const _quaternion = /*@__PURE__*/ new Quaternion(); + const _scale = /*@__PURE__*/ new Vector3(); + const _orientation = /*@__PURE__*/ new Vector3(); + + class PositionalAudio extends Audio { + + constructor( listener ) { + + super( listener ); + + this.panner = this.context.createPanner(); + this.panner.panningModel = 'HRTF'; + this.panner.connect( this.gain ); + + } + + connect() { + + super.connect(); + + this.panner.connect( this.gain ); + + } + + disconnect() { + + super.disconnect(); + + this.panner.disconnect( this.gain ); + + } + + getOutput() { + + return this.panner; + + } + + getRefDistance() { + + return this.panner.refDistance; + + } + + setRefDistance( value ) { + + this.panner.refDistance = value; + + return this; + + } + + getRolloffFactor() { + + return this.panner.rolloffFactor; + + } + + setRolloffFactor( value ) { + + this.panner.rolloffFactor = value; + + return this; + + } + + getDistanceModel() { + + return this.panner.distanceModel; + + } + + setDistanceModel( value ) { + + this.panner.distanceModel = value; + + return this; + + } + + getMaxDistance() { + + return this.panner.maxDistance; + + } + + setMaxDistance( value ) { + + this.panner.maxDistance = value; + + return this; + + } + + setDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) { + + this.panner.coneInnerAngle = coneInnerAngle; + this.panner.coneOuterAngle = coneOuterAngle; + this.panner.coneOuterGain = coneOuterGain; + + return this; + + } + + updateMatrixWorld( force ) { + + super.updateMatrixWorld( force ); + + if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; + + this.matrixWorld.decompose( _position, _quaternion, _scale ); + + _orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion ); + + const panner = this.panner; + + if ( panner.positionX ) { + + // code path for Chrome and Firefox (see #14393) + + const endTime = this.context.currentTime + this.listener.timeDelta; + + panner.positionX.linearRampToValueAtTime( _position.x, endTime ); + panner.positionY.linearRampToValueAtTime( _position.y, endTime ); + panner.positionZ.linearRampToValueAtTime( _position.z, endTime ); + panner.orientationX.linearRampToValueAtTime( _orientation.x, endTime ); + panner.orientationY.linearRampToValueAtTime( _orientation.y, endTime ); + panner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime ); + + } else { + + panner.setPosition( _position.x, _position.y, _position.z ); + panner.setOrientation( _orientation.x, _orientation.y, _orientation.z ); + + } + + } + + } + + class AudioAnalyser { + + constructor( audio, fftSize = 2048 ) { + + this.analyser = audio.context.createAnalyser(); + this.analyser.fftSize = fftSize; + + this.data = new Uint8Array( this.analyser.frequencyBinCount ); + + audio.getOutput().connect( this.analyser ); + + } + + + getFrequencyData() { + + this.analyser.getByteFrequencyData( this.data ); + + return this.data; + + } + + getAverageFrequency() { + + let value = 0; + const data = this.getFrequencyData(); + + for ( let i = 0; i < data.length; i ++ ) { + + value += data[ i ]; + + } + + return value / data.length; + + } + + } + + class PropertyMixer { + + constructor( binding, typeName, valueSize ) { + + this.binding = binding; + this.valueSize = valueSize; + + let mixFunction, + mixFunctionAdditive, + setIdentity; + + // buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ] + // + // interpolators can use .buffer as their .result + // the data then goes to 'incoming' + // + // 'accu0' and 'accu1' are used frame-interleaved for + // the cumulative result and are compared to detect + // changes + // + // 'orig' stores the original state of the property + // + // 'add' is used for additive cumulative results + // + // 'work' is optional and is only present for quaternion types. It is used + // to store intermediate quaternion multiplication results + + switch ( typeName ) { + + case 'quaternion': + mixFunction = this._slerp; + mixFunctionAdditive = this._slerpAdditive; + setIdentity = this._setAdditiveIdentityQuaternion; + + this.buffer = new Float64Array( valueSize * 6 ); + this._workIndex = 5; + break; + + case 'string': + case 'bool': + mixFunction = this._select; + + // Use the regular mix function and for additive on these types, + // additive is not relevant for non-numeric types + mixFunctionAdditive = this._select; + + setIdentity = this._setAdditiveIdentityOther; + + this.buffer = new Array( valueSize * 5 ); + break; + + default: + mixFunction = this._lerp; + mixFunctionAdditive = this._lerpAdditive; + setIdentity = this._setAdditiveIdentityNumeric; + + this.buffer = new Float64Array( valueSize * 5 ); + + } + + this._mixBufferRegion = mixFunction; + this._mixBufferRegionAdditive = mixFunctionAdditive; + this._setIdentity = setIdentity; + this._origIndex = 3; + this._addIndex = 4; + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + this.useCount = 0; + this.referenceCount = 0; + + } + + // accumulate data in the 'incoming' region into 'accu' + accumulate( accuIndex, weight ) { + + // note: happily accumulating nothing when weight = 0, the caller knows + // the weight and shouldn't have made the call in the first place + + const buffer = this.buffer, + stride = this.valueSize, + offset = accuIndex * stride + stride; + + let currentWeight = this.cumulativeWeight; + + if ( currentWeight === 0 ) { + + // accuN := incoming * weight + + for ( let i = 0; i !== stride; ++ i ) { + + buffer[ offset + i ] = buffer[ i ]; + + } + + currentWeight = weight; + + } else { + + // accuN := accuN + incoming * weight + + currentWeight += weight; + const mix = weight / currentWeight; + this._mixBufferRegion( buffer, offset, 0, mix, stride ); + + } + + this.cumulativeWeight = currentWeight; + + } + + // accumulate data in the 'incoming' region into 'add' + accumulateAdditive( weight ) { + + const buffer = this.buffer, + stride = this.valueSize, + offset = stride * this._addIndex; + + if ( this.cumulativeWeightAdditive === 0 ) { + + // add = identity + + this._setIdentity(); + + } + + // add := add + incoming * weight + + this._mixBufferRegionAdditive( buffer, offset, 0, weight, stride ); + this.cumulativeWeightAdditive += weight; + + } + + // apply the state of 'accu' to the binding when accus differ + apply( accuIndex ) { + + const stride = this.valueSize, + buffer = this.buffer, + offset = accuIndex * stride + stride, + + weight = this.cumulativeWeight, + weightAdditive = this.cumulativeWeightAdditive, + + binding = this.binding; + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + if ( weight < 1 ) { + + // accuN := accuN + original * ( 1 - cumulativeWeight ) + + const originalValueOffset = stride * this._origIndex; + + this._mixBufferRegion( + buffer, offset, originalValueOffset, 1 - weight, stride ); + + } + + if ( weightAdditive > 0 ) { + + // accuN := accuN + additive accuN + + this._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride ); + + } + + for ( let i = stride, e = stride + stride; i !== e; ++ i ) { + + if ( buffer[ i ] !== buffer[ i + stride ] ) { + + // value has changed -> update scene graph + + binding.setValue( buffer, offset ); + break; + + } + + } + + } + + // remember the state of the bound property and copy it to both accus + saveOriginalState() { + + const binding = this.binding; + + const buffer = this.buffer, + stride = this.valueSize, + + originalValueOffset = stride * this._origIndex; + + binding.getValue( buffer, originalValueOffset ); + + // accu[0..1] := orig -- initially detect changes against the original + for ( let i = stride, e = originalValueOffset; i !== e; ++ i ) { + + buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ]; + + } + + // Add to identity for additive + this._setIdentity(); + + this.cumulativeWeight = 0; + this.cumulativeWeightAdditive = 0; + + } + + // apply the state previously taken via 'saveOriginalState' to the binding + restoreOriginalState() { + + const originalValueOffset = this.valueSize * 3; + this.binding.setValue( this.buffer, originalValueOffset ); + + } + + _setAdditiveIdentityNumeric() { + + const startIndex = this._addIndex * this.valueSize; + const endIndex = startIndex + this.valueSize; + + for ( let i = startIndex; i < endIndex; i ++ ) { + + this.buffer[ i ] = 0; + + } + + } + + _setAdditiveIdentityQuaternion() { + + this._setAdditiveIdentityNumeric(); + this.buffer[ this._addIndex * this.valueSize + 3 ] = 1; + + } + + _setAdditiveIdentityOther() { + + const startIndex = this._origIndex * this.valueSize; + const targetIndex = this._addIndex * this.valueSize; + + for ( let i = 0; i < this.valueSize; i ++ ) { + + this.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ]; + + } + + } + + + // mix functions + + _select( buffer, dstOffset, srcOffset, t, stride ) { + + if ( t >= 0.5 ) { + + for ( let i = 0; i !== stride; ++ i ) { + + buffer[ dstOffset + i ] = buffer[ srcOffset + i ]; + + } + + } + + } + + _slerp( buffer, dstOffset, srcOffset, t ) { + + Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t ); + + } + + _slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) { + + const workOffset = this._workIndex * stride; + + // Store result in intermediate buffer offset + Quaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset ); + + // Slerp to the intermediate result + Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t ); + + } + + _lerp( buffer, dstOffset, srcOffset, t, stride ) { + + const s = 1 - t; + + for ( let i = 0; i !== stride; ++ i ) { + + const j = dstOffset + i; + + buffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t; + + } + + } + + _lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) { + + for ( let i = 0; i !== stride; ++ i ) { + + const j = dstOffset + i; + + buffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t; + + } + + } + + } + + // Characters [].:/ are reserved for track binding syntax. + const _RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; + const _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' ); + + // Attempts to allow node names from any language. ES5's `\w` regexp matches + // only latin characters, and the unicode \p{L} is not yet supported. So + // instead, we exclude reserved characters and match everything else. + const _wordChar = '[^' + _RESERVED_CHARS_RE + ']'; + const _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; + + // Parent directories, delimited by '/' or ':'. Currently unused, but must + // be matched to parse the rest of the track name. + const _directoryRe = /*@__PURE__*/ /((?:WC+[\/:])*)/.source.replace( 'WC', _wordChar ); + + // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. + const _nodeRe = /*@__PURE__*/ /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot ); + + // Object on target node, and accessor. May not contain reserved + // characters. Accessor may contain any character except closing bracket. + const _objectRe = /*@__PURE__*/ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', _wordChar ); + + // Property and accessor. May not contain reserved characters. Accessor may + // contain any non-bracket characters. + const _propertyRe = /*@__PURE__*/ /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', _wordChar ); + + const _trackRe = new RegExp( '' + + '^' + + _directoryRe + + _nodeRe + + _objectRe + + _propertyRe + + '$' + ); + + const _supportedObjectNames = [ 'material', 'materials', 'bones', 'map' ]; + + class Composite { + + constructor( targetGroup, path, optionalParsedPath ) { + + const parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path ); + + this._targetGroup = targetGroup; + this._bindings = targetGroup.subscribe_( path, parsedPath ); + + } + + getValue( array, offset ) { + + this.bind(); // bind all binding + + const firstValidIndex = this._targetGroup.nCachedObjects_, + binding = this._bindings[ firstValidIndex ]; + + // and only call .getValue on the first + if ( binding !== undefined ) binding.getValue( array, offset ); + + } + + setValue( array, offset ) { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].setValue( array, offset ); + + } + + } + + bind() { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].bind(); + + } + + } + + unbind() { + + const bindings = this._bindings; + + for ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].unbind(); + + } + + } + + } + + // Note: This class uses a State pattern on a per-method basis: + // 'bind' sets 'this.getValue' / 'setValue' and shadows the + // prototype version of these methods with one that represents + // the bound state. When the property is not found, the methods + // become no-ops. + class PropertyBinding { + + constructor( rootNode, path, parsedPath ) { + + this.path = path; + this.parsedPath = parsedPath || PropertyBinding.parseTrackName( path ); + + this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName ); + + this.rootNode = rootNode; + + // initial state of these methods that calls 'bind' + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + + } + + + static create( root, path, parsedPath ) { + + if ( ! ( root && root.isAnimationObjectGroup ) ) { + + return new PropertyBinding( root, path, parsedPath ); + + } else { + + return new PropertyBinding.Composite( root, path, parsedPath ); + + } + + } + + /** + * Replaces spaces with underscores and removes unsupported characters from + * node names, to ensure compatibility with parseTrackName(). + * + * @param {string} name Node name to be sanitized. + * @return {string} + */ + static sanitizeNodeName( name ) { + + return name.replace( /\s/g, '_' ).replace( _reservedRe, '' ); + + } + + static parseTrackName( trackName ) { + + const matches = _trackRe.exec( trackName ); + + if ( matches === null ) { + + throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); + + } + + const results = { + // directoryName: matches[ 1 ], // (tschw) currently unused + nodeName: matches[ 2 ], + objectName: matches[ 3 ], + objectIndex: matches[ 4 ], + propertyName: matches[ 5 ], // required + propertyIndex: matches[ 6 ] + }; + + const lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); + + if ( lastDot !== undefined && lastDot !== - 1 ) { + + const objectName = results.nodeName.substring( lastDot + 1 ); + + // Object names must be checked against an allowlist. Otherwise, there + // is no way to parse 'foo.bar.baz': 'baz' must be a property, but + // 'bar' could be the objectName, or part of a nodeName (which can + // include '.' characters). + if ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) { + + results.nodeName = results.nodeName.substring( 0, lastDot ); + results.objectName = objectName; + + } + + } + + if ( results.propertyName === null || results.propertyName.length === 0 ) { + + throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); + + } + + return results; + + } + + static findNode( root, nodeName ) { + + if ( nodeName === undefined || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) { + + return root; + + } + + // search into skeleton bones. + if ( root.skeleton ) { + + const bone = root.skeleton.getBoneByName( nodeName ); + + if ( bone !== undefined ) { + + return bone; + + } + + } + + // search into node subtree. + if ( root.children ) { + + const searchNodeSubtree = function ( children ) { + + for ( let i = 0; i < children.length; i ++ ) { + + const childNode = children[ i ]; + + if ( childNode.name === nodeName || childNode.uuid === nodeName ) { + + return childNode; + + } + + const result = searchNodeSubtree( childNode.children ); + + if ( result ) return result; + + } + + return null; + + }; + + const subTreeNode = searchNodeSubtree( root.children ); + + if ( subTreeNode ) { + + return subTreeNode; + + } + + } + + return null; + + } + + // these are used to "bind" a nonexistent property + _getValue_unavailable() {} + _setValue_unavailable() {} + + // Getters + + _getValue_direct( buffer, offset ) { + + buffer[ offset ] = this.targetObject[ this.propertyName ]; + + } + + _getValue_array( buffer, offset ) { + + const source = this.resolvedProperty; + + for ( let i = 0, n = source.length; i !== n; ++ i ) { + + buffer[ offset ++ ] = source[ i ]; + + } + + } + + _getValue_arrayElement( buffer, offset ) { + + buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ]; + + } + + _getValue_toArray( buffer, offset ) { + + this.resolvedProperty.toArray( buffer, offset ); + + } + + // Direct + + _setValue_direct( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + + } + + _setValue_direct_setNeedsUpdate( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + } + + _setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.targetObject[ this.propertyName ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // EntireArray + + _setValue_array( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + } + + _setValue_array_setNeedsUpdate( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.needsUpdate = true; + + } + + _setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) { + + const dest = this.resolvedProperty; + + for ( let i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // ArrayElement + + _setValue_arrayElement( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + + } + + _setValue_arrayElement_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + } + + _setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + // HasToFromArray + + _setValue_fromArray( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + + } + + _setValue_fromArray_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.needsUpdate = true; + + } + + _setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + _getValue_unbound( targetArray, offset ) { + + this.bind(); + this.getValue( targetArray, offset ); + + } + + _setValue_unbound( sourceArray, offset ) { + + this.bind(); + this.setValue( sourceArray, offset ); + + } + + // create getter / setter pair for a property in the scene graph + bind() { + + let targetObject = this.node; + const parsedPath = this.parsedPath; + + const objectName = parsedPath.objectName; + const propertyName = parsedPath.propertyName; + let propertyIndex = parsedPath.propertyIndex; + + if ( ! targetObject ) { + + targetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName ); + + this.node = targetObject; + + } + + // set fail state so we can just 'return' on error + this.getValue = this._getValue_unavailable; + this.setValue = this._setValue_unavailable; + + // ensure there is a value node + if ( ! targetObject ) { + + console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); + return; + + } + + if ( objectName ) { + + let objectIndex = parsedPath.objectIndex; + + // special cases were we need to reach deeper into the hierarchy to get the face materials.... + switch ( objectName ) { + + case 'materials': + + if ( ! targetObject.material ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ); + return; + + } + + if ( ! targetObject.material.materials ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this ); + return; + + } + + targetObject = targetObject.material.materials; + + break; + + case 'bones': + + if ( ! targetObject.skeleton ) { + + console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this ); + return; + + } + + // potential future optimization: skip this if propertyIndex is already an integer + // and convert the integer string to a true integer. + + targetObject = targetObject.skeleton.bones; + + // support resolving morphTarget names into indices. + for ( let i = 0; i < targetObject.length; i ++ ) { + + if ( targetObject[ i ].name === objectIndex ) { + + objectIndex = i; + break; + + } + + } + + break; + + case 'map': + + if ( 'map' in targetObject ) { + + targetObject = targetObject.map; + break; + + } + + if ( ! targetObject.material ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ); + return; + + } + + if ( ! targetObject.material.map ) { + + console.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this ); + return; + + } + + targetObject = targetObject.material.map; + break; + + default: + + if ( targetObject[ objectName ] === undefined ) { + + console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this ); + return; + + } + + targetObject = targetObject[ objectName ]; + + } + + + if ( objectIndex !== undefined ) { + + if ( targetObject[ objectIndex ] === undefined ) { + + console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject ); + return; + + } + + targetObject = targetObject[ objectIndex ]; + + } + + } + + // resolve property + const nodeProperty = targetObject[ propertyName ]; + + if ( nodeProperty === undefined ) { + + const nodeName = parsedPath.nodeName; + + console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName + + '.' + propertyName + ' but it wasn\'t found.', targetObject ); + return; + + } + + // determine versioning scheme + let versioning = this.Versioning.None; + + this.targetObject = targetObject; + + if ( targetObject.needsUpdate !== undefined ) { // material + + versioning = this.Versioning.NeedsUpdate; + + } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform + + versioning = this.Versioning.MatrixWorldNeedsUpdate; + + } + + // determine how the property gets bound + let bindingType = this.BindingType.Direct; + + if ( propertyIndex !== undefined ) { + + // access a sub element of the property array (only primitives are supported right now) + + if ( propertyName === 'morphTargetInfluences' ) { + + // potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer. + + // support resolving morphTarget names into indices. + if ( ! targetObject.geometry ) { + + console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this ); + return; + + } + + if ( ! targetObject.geometry.morphAttributes ) { + + console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this ); + return; + + } + + if ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) { + + propertyIndex = targetObject.morphTargetDictionary[ propertyIndex ]; + + } + + } + + bindingType = this.BindingType.ArrayElement; + + this.resolvedProperty = nodeProperty; + this.propertyIndex = propertyIndex; + + } else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) { + + // must use copy for Object3D.Euler/Quaternion + + bindingType = this.BindingType.HasFromToArray; + + this.resolvedProperty = nodeProperty; + + } else if ( Array.isArray( nodeProperty ) ) { + + bindingType = this.BindingType.EntireArray; + + this.resolvedProperty = nodeProperty; + + } else { + + this.propertyName = propertyName; + + } + + // select getter / setter + this.getValue = this.GetterByBindingType[ bindingType ]; + this.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ]; + + } + + unbind() { + + this.node = null; + + // back to the prototype version of getValue / setValue + // note: avoiding to mutate the shape of 'this' via 'delete' + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + + } + + } + + PropertyBinding.Composite = Composite; + + PropertyBinding.prototype.BindingType = { + Direct: 0, + EntireArray: 1, + ArrayElement: 2, + HasFromToArray: 3 + }; + + PropertyBinding.prototype.Versioning = { + None: 0, + NeedsUpdate: 1, + MatrixWorldNeedsUpdate: 2 + }; + + PropertyBinding.prototype.GetterByBindingType = [ + + PropertyBinding.prototype._getValue_direct, + PropertyBinding.prototype._getValue_array, + PropertyBinding.prototype._getValue_arrayElement, + PropertyBinding.prototype._getValue_toArray, + + ]; + + PropertyBinding.prototype.SetterByBindingTypeAndVersioning = [ + + [ + // Direct + PropertyBinding.prototype._setValue_direct, + PropertyBinding.prototype._setValue_direct_setNeedsUpdate, + PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate, + + ], [ + + // EntireArray + + PropertyBinding.prototype._setValue_array, + PropertyBinding.prototype._setValue_array_setNeedsUpdate, + PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate, + + ], [ + + // ArrayElement + PropertyBinding.prototype._setValue_arrayElement, + PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, + PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate, + + ], [ + + // HasToFromArray + PropertyBinding.prototype._setValue_fromArray, + PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, + PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate, + + ] + + ]; + + /** + * + * A group of objects that receives a shared animation state. + * + * Usage: + * + * - Add objects you would otherwise pass as 'root' to the + * constructor or the .clipAction method of AnimationMixer. + * + * - Instead pass this object as 'root'. + * + * - You can also add and remove objects later when the mixer + * is running. + * + * Note: + * + * Objects of this class appear as one object to the mixer, + * so cache control of the individual objects must be done + * on the group. + * + * Limitation: + * + * - The animated properties must be compatible among the + * all objects in the group. + * + * - A single property can either be controlled through a + * target group or directly, but not both. + */ + + class AnimationObjectGroup { + + constructor() { + + this.isAnimationObjectGroup = true; + + this.uuid = generateUUID(); + + // cached objects followed by the active ones + this._objects = Array.prototype.slice.call( arguments ); + + this.nCachedObjects_ = 0; // threshold + // note: read by PropertyBinding.Composite + + const indices = {}; + this._indicesByUUID = indices; // for bookkeeping + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + indices[ arguments[ i ].uuid ] = i; + + } + + this._paths = []; // inside: string + this._parsedPaths = []; // inside: { we don't care, here } + this._bindings = []; // inside: Array< PropertyBinding > + this._bindingsIndicesByPath = {}; // inside: indices in these arrays + + const scope = this; + + this.stats = { + + objects: { + get total() { + + return scope._objects.length; + + }, + get inUse() { + + return this.total - scope.nCachedObjects_; + + } + }, + get bindingsPerObject() { + + return scope._bindings.length; + + } + + }; + + } + + add() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + nBindings = bindings.length; + + let knownObject = undefined, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid; + let index = indicesByUUID[ uuid ]; + + if ( index === undefined ) { + + // unknown object -> add it to the ACTIVE region + + index = nObjects ++; + indicesByUUID[ uuid ] = index; + objects.push( object ); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + bindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) ); + + } + + } else if ( index < nCachedObjects ) { + + knownObject = objects[ index ]; + + // move existing object to the ACTIVE region + + const firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ]; + + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + indicesByUUID[ uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ]; + + let binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = lastCached; + + if ( binding === undefined ) { + + // since we do not bother to create new bindings + // for objects that are cached, the binding may + // or may not exist + + binding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ); + + } + + bindingsForPath[ firstActiveIndex ] = binding; + + } + + } else if ( objects[ index ] !== knownObject ) { + + console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' + + 'detected. Clean the caches or recreate your infrastructure when reloading scenes.' ); + + } // else the object is already where we want it to be + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + remove() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + let nCachedObjects = this.nCachedObjects_; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined && index >= nCachedObjects ) { + + // move existing object into the CACHED region + + const lastCachedIndex = nCachedObjects ++, + firstActiveObject = objects[ lastCachedIndex ]; + + indicesByUUID[ firstActiveObject.uuid ] = index; + objects[ index ] = firstActiveObject; + + indicesByUUID[ uuid ] = lastCachedIndex; + objects[ lastCachedIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + firstActive = bindingsForPath[ lastCachedIndex ], + binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = firstActive; + bindingsForPath[ lastCachedIndex ] = binding; + + } + + } + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + // remove & forget + uncache() { + + const objects = this._objects, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + let nCachedObjects = this.nCachedObjects_, + nObjects = objects.length; + + for ( let i = 0, n = arguments.length; i !== n; ++ i ) { + + const object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined ) { + + delete indicesByUUID[ uuid ]; + + if ( index < nCachedObjects ) { + + // object is cached, shrink the CACHED region + + const firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ], + lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + // last cached object takes this object's place + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + // last object goes to the activated slot and pop + indicesByUUID[ lastObject.uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ], + last = bindingsForPath[ lastIndex ]; + + bindingsForPath[ index ] = lastCached; + bindingsForPath[ firstActiveIndex ] = last; + bindingsForPath.pop(); + + } + + } else { + + // object is active, just swap with the last and pop + + const lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + if ( lastIndex > 0 ) { + + indicesByUUID[ lastObject.uuid ] = index; + + } + + objects[ index ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( let j = 0, m = nBindings; j !== m; ++ j ) { + + const bindingsForPath = bindings[ j ]; + + bindingsForPath[ index ] = bindingsForPath[ lastIndex ]; + bindingsForPath.pop(); + + } + + } // cached or active + + } // if object is known + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + } + + // Internal interface used by befriended PropertyBinding.Composite: + + subscribe_( path, parsedPath ) { + + // returns an array of bindings for the given path that is changed + // according to the contained objects in the group + + const indicesByPath = this._bindingsIndicesByPath; + let index = indicesByPath[ path ]; + const bindings = this._bindings; + + if ( index !== undefined ) return bindings[ index ]; + + const paths = this._paths, + parsedPaths = this._parsedPaths, + objects = this._objects, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_, + bindingsForPath = new Array( nObjects ); + + index = bindings.length; + + indicesByPath[ path ] = index; + + paths.push( path ); + parsedPaths.push( parsedPath ); + bindings.push( bindingsForPath ); + + for ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) { + + const object = objects[ i ]; + bindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath ); + + } + + return bindingsForPath; + + } + + unsubscribe_( path ) { + + // tells the group to forget about a property path and no longer + // update the array previously obtained with 'subscribe_' + + const indicesByPath = this._bindingsIndicesByPath, + index = indicesByPath[ path ]; + + if ( index !== undefined ) { + + const paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + lastBindingsIndex = bindings.length - 1, + lastBindings = bindings[ lastBindingsIndex ], + lastBindingsPath = path[ lastBindingsIndex ]; + + indicesByPath[ lastBindingsPath ] = index; + + bindings[ index ] = lastBindings; + bindings.pop(); + + parsedPaths[ index ] = parsedPaths[ lastBindingsIndex ]; + parsedPaths.pop(); + + paths[ index ] = paths[ lastBindingsIndex ]; + paths.pop(); + + } + + } + + } + + class AnimationAction { + + constructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) { + + this._mixer = mixer; + this._clip = clip; + this._localRoot = localRoot; + this.blendMode = blendMode; + + const tracks = clip.tracks, + nTracks = tracks.length, + interpolants = new Array( nTracks ); + + const interpolantSettings = { + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + }; + + for ( let i = 0; i !== nTracks; ++ i ) { + + const interpolant = tracks[ i ].createInterpolant( null ); + interpolants[ i ] = interpolant; + interpolant.settings = interpolantSettings; + + } + + this._interpolantSettings = interpolantSettings; + + this._interpolants = interpolants; // bound by the mixer + + // inside: PropertyMixer (managed by the mixer) + this._propertyBindings = new Array( nTracks ); + + this._cacheIndex = null; // for the memory manager + this._byClipCacheIndex = null; // for the memory manager + + this._timeScaleInterpolant = null; + this._weightInterpolant = null; + + this.loop = LoopRepeat; + this._loopCount = - 1; + + // global mixer time when the action is to be started + // it's set back to 'null' upon start of the action + this._startTime = null; + + // scaled local time of the action + // gets clamped or wrapped to 0..clip.duration according to loop + this.time = 0; + + this.timeScale = 1; + this._effectiveTimeScale = 1; + + this.weight = 1; + this._effectiveWeight = 1; + + this.repetitions = Infinity; // no. of repetitions when looping + + this.paused = false; // true -> zero effective time scale + this.enabled = true; // false -> zero effective weight + + this.clampWhenFinished = false;// keep feeding the last frame? + + this.zeroSlopeAtStart = true;// for smooth interpolation w/o separate + this.zeroSlopeAtEnd = true;// clips for start, loop and end + + } + + // State & Scheduling + + play() { + + this._mixer._activateAction( this ); + + return this; + + } + + stop() { + + this._mixer._deactivateAction( this ); + + return this.reset(); + + } + + reset() { + + this.paused = false; + this.enabled = true; + + this.time = 0; // restart clip + this._loopCount = - 1;// forget previous loops + this._startTime = null;// forget scheduling + + return this.stopFading().stopWarping(); + + } + + isRunning() { + + return this.enabled && ! this.paused && this.timeScale !== 0 && + this._startTime === null && this._mixer._isActiveAction( this ); + + } + + // return true when play has been called + isScheduled() { + + return this._mixer._isActiveAction( this ); + + } + + startAt( time ) { + + this._startTime = time; + + return this; + + } + + setLoop( mode, repetitions ) { + + this.loop = mode; + this.repetitions = repetitions; + + return this; + + } + + // Weight + + // set the weight stopping any scheduled fading + // although .enabled = false yields an effective weight of zero, this + // method does *not* change .enabled, because it would be confusing + setEffectiveWeight( weight ) { + + this.weight = weight; + + // note: same logic as when updated at runtime + this._effectiveWeight = this.enabled ? weight : 0; + + return this.stopFading(); + + } + + // return the weight considering fading and .enabled + getEffectiveWeight() { + + return this._effectiveWeight; + + } + + fadeIn( duration ) { + + return this._scheduleFading( duration, 0, 1 ); + + } + + fadeOut( duration ) { + + return this._scheduleFading( duration, 1, 0 ); + + } + + crossFadeFrom( fadeOutAction, duration, warp ) { + + fadeOutAction.fadeOut( duration ); + this.fadeIn( duration ); + + if ( warp ) { + + const fadeInDuration = this._clip.duration, + fadeOutDuration = fadeOutAction._clip.duration, + + startEndRatio = fadeOutDuration / fadeInDuration, + endStartRatio = fadeInDuration / fadeOutDuration; + + fadeOutAction.warp( 1.0, startEndRatio, duration ); + this.warp( endStartRatio, 1.0, duration ); + + } + + return this; + + } + + crossFadeTo( fadeInAction, duration, warp ) { + + return fadeInAction.crossFadeFrom( this, duration, warp ); + + } + + stopFading() { + + const weightInterpolant = this._weightInterpolant; + + if ( weightInterpolant !== null ) { + + this._weightInterpolant = null; + this._mixer._takeBackControlInterpolant( weightInterpolant ); + + } + + return this; + + } + + // Time Scale Control + + // set the time scale stopping any scheduled warping + // although .paused = true yields an effective time scale of zero, this + // method does *not* change .paused, because it would be confusing + setEffectiveTimeScale( timeScale ) { + + this.timeScale = timeScale; + this._effectiveTimeScale = this.paused ? 0 : timeScale; + + return this.stopWarping(); + + } + + // return the time scale considering warping and .paused + getEffectiveTimeScale() { + + return this._effectiveTimeScale; + + } + + setDuration( duration ) { + + this.timeScale = this._clip.duration / duration; + + return this.stopWarping(); + + } + + syncWith( action ) { + + this.time = action.time; + this.timeScale = action.timeScale; + + return this.stopWarping(); + + } + + halt( duration ) { + + return this.warp( this._effectiveTimeScale, 0, duration ); + + } + + warp( startTimeScale, endTimeScale, duration ) { + + const mixer = this._mixer, + now = mixer.time, + timeScale = this.timeScale; + + let interpolant = this._timeScaleInterpolant; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(); + this._timeScaleInterpolant = interpolant; + + } + + const times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; + times[ 1 ] = now + duration; + + values[ 0 ] = startTimeScale / timeScale; + values[ 1 ] = endTimeScale / timeScale; + + return this; + + } + + stopWarping() { + + const timeScaleInterpolant = this._timeScaleInterpolant; + + if ( timeScaleInterpolant !== null ) { + + this._timeScaleInterpolant = null; + this._mixer._takeBackControlInterpolant( timeScaleInterpolant ); + + } + + return this; + + } + + // Object Accessors + + getMixer() { + + return this._mixer; + + } + + getClip() { + + return this._clip; + + } + + getRoot() { + + return this._localRoot || this._mixer._root; + + } + + // Interna + + _update( time, deltaTime, timeDirection, accuIndex ) { + + // called by the mixer + + if ( ! this.enabled ) { + + // call ._updateWeight() to update ._effectiveWeight + + this._updateWeight( time ); + return; + + } + + const startTime = this._startTime; + + if ( startTime !== null ) { + + // check for scheduled start of action + + const timeRunning = ( time - startTime ) * timeDirection; + if ( timeRunning < 0 || timeDirection === 0 ) { + + deltaTime = 0; + + } else { + + + this._startTime = null; // unschedule + deltaTime = timeDirection * timeRunning; + + } + + } + + // apply time scale and advance time + + deltaTime *= this._updateTimeScale( time ); + const clipTime = this._updateTime( deltaTime ); + + // note: _updateTime may disable the action resulting in + // an effective weight of 0 + + const weight = this._updateWeight( time ); + + if ( weight > 0 ) { + + const interpolants = this._interpolants; + const propertyMixers = this._propertyBindings; + + switch ( this.blendMode ) { + + case AdditiveAnimationBlendMode: + + for ( let j = 0, m = interpolants.length; j !== m; ++ j ) { + + interpolants[ j ].evaluate( clipTime ); + propertyMixers[ j ].accumulateAdditive( weight ); + + } + + break; + + case NormalAnimationBlendMode: + default: + + for ( let j = 0, m = interpolants.length; j !== m; ++ j ) { + + interpolants[ j ].evaluate( clipTime ); + propertyMixers[ j ].accumulate( accuIndex, weight ); + + } + + } + + } + + } + + _updateWeight( time ) { + + let weight = 0; + + if ( this.enabled ) { + + weight = this.weight; + const interpolant = this._weightInterpolant; + + if ( interpolant !== null ) { + + const interpolantValue = interpolant.evaluate( time )[ 0 ]; + + weight *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopFading(); + + if ( interpolantValue === 0 ) { + + // faded out, disable + this.enabled = false; + + } + + } + + } + + } + + this._effectiveWeight = weight; + return weight; + + } + + _updateTimeScale( time ) { + + let timeScale = 0; + + if ( ! this.paused ) { + + timeScale = this.timeScale; + + const interpolant = this._timeScaleInterpolant; + + if ( interpolant !== null ) { + + const interpolantValue = interpolant.evaluate( time )[ 0 ]; + + timeScale *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopWarping(); + + if ( timeScale === 0 ) { + + // motion has halted, pause + this.paused = true; + + } else { + + // warp done - apply final time scale + this.timeScale = timeScale; + + } + + } + + } + + } + + this._effectiveTimeScale = timeScale; + return timeScale; + + } + + _updateTime( deltaTime ) { + + const duration = this._clip.duration; + const loop = this.loop; + + let time = this.time + deltaTime; + let loopCount = this._loopCount; + + const pingPong = ( loop === LoopPingPong ); + + if ( deltaTime === 0 ) { + + if ( loopCount === - 1 ) return time; + + return ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time; + + } + + if ( loop === LoopOnce ) { + + if ( loopCount === - 1 ) { + + // just started + + this._loopCount = 0; + this._setEndings( true, true, false ); + + } + + handle_stop: { + + if ( time >= duration ) { + + time = duration; + + } else if ( time < 0 ) { + + time = 0; + + } else { + + this.time = time; + + break handle_stop; + + } + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime < 0 ? - 1 : 1 + } ); + + } + + } else { // repetitive Repeat or PingPong + + if ( loopCount === - 1 ) { + + // just started + + if ( deltaTime >= 0 ) { + + loopCount = 0; + + this._setEndings( true, this.repetitions === 0, pingPong ); + + } else { + + // when looping in reverse direction, the initial + // transition through zero counts as a repetition, + // so leave loopCount at -1 + + this._setEndings( this.repetitions === 0, true, pingPong ); + + } + + } + + if ( time >= duration || time < 0 ) { + + // wrap around + + const loopDelta = Math.floor( time / duration ); // signed + time -= duration * loopDelta; + + loopCount += Math.abs( loopDelta ); + + const pending = this.repetitions - loopCount; + + if ( pending <= 0 ) { + + // have to stop (switch state, clamp time, fire event) + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + time = deltaTime > 0 ? duration : 0; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime > 0 ? 1 : - 1 + } ); + + } else { + + // keep running + + if ( pending === 1 ) { + + // entering the last round + + const atStart = deltaTime < 0; + this._setEndings( atStart, ! atStart, pingPong ); + + } else { + + this._setEndings( false, false, pingPong ); + + } + + this._loopCount = loopCount; + + this.time = time; + + this._mixer.dispatchEvent( { + type: 'loop', action: this, loopDelta: loopDelta + } ); + + } + + } else { + + this.time = time; + + } + + if ( pingPong && ( loopCount & 1 ) === 1 ) { + + // invert time for the "pong round" + + return duration - time; + + } + + } + + return time; + + } + + _setEndings( atStart, atEnd, pingPong ) { + + const settings = this._interpolantSettings; + + if ( pingPong ) { + + settings.endingStart = ZeroSlopeEnding; + settings.endingEnd = ZeroSlopeEnding; + + } else { + + // assuming for LoopOnce atStart == atEnd == true + + if ( atStart ) { + + settings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingStart = WrapAroundEnding; + + } + + if ( atEnd ) { + + settings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingEnd = WrapAroundEnding; + + } + + } + + } + + _scheduleFading( duration, weightNow, weightThen ) { + + const mixer = this._mixer, now = mixer.time; + let interpolant = this._weightInterpolant; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(); + this._weightInterpolant = interpolant; + + } + + const times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; + values[ 0 ] = weightNow; + times[ 1 ] = now + duration; + values[ 1 ] = weightThen; + + return this; + + } + + } + + const _controlInterpolantsResultBuffer = new Float32Array( 1 ); + + + class AnimationMixer extends EventDispatcher { + + constructor( root ) { + + super(); + + this._root = root; + this._initMemoryManager(); + this._accuIndex = 0; + this.time = 0; + this.timeScale = 1.0; + + } + + _bindAction( action, prototypeAction ) { + + const root = action._localRoot || this._root, + tracks = action._clip.tracks, + nTracks = tracks.length, + bindings = action._propertyBindings, + interpolants = action._interpolants, + rootUuid = root.uuid, + bindingsByRoot = this._bindingsByRootAndName; + + let bindingsByName = bindingsByRoot[ rootUuid ]; + + if ( bindingsByName === undefined ) { + + bindingsByName = {}; + bindingsByRoot[ rootUuid ] = bindingsByName; + + } + + for ( let i = 0; i !== nTracks; ++ i ) { + + const track = tracks[ i ], + trackName = track.name; + + let binding = bindingsByName[ trackName ]; + + if ( binding !== undefined ) { + + ++ binding.referenceCount; + bindings[ i ] = binding; + + } else { + + binding = bindings[ i ]; + + if ( binding !== undefined ) { + + // existing binding, make sure the cache knows + + if ( binding._cacheIndex === null ) { + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + } + + continue; + + } + + const path = prototypeAction && prototypeAction. + _propertyBindings[ i ].binding.parsedPath; + + binding = new PropertyMixer( + PropertyBinding.create( root, trackName, path ), + track.ValueTypeName, track.getValueSize() ); + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + bindings[ i ] = binding; + + } + + interpolants[ i ].resultBuffer = binding.buffer; + + } + + } + + _activateAction( action ) { + + if ( ! this._isActiveAction( action ) ) { + + if ( action._cacheIndex === null ) { + + // this action has been forgotten by the cache, but the user + // appears to be still using it -> rebind + + const rootUuid = ( action._localRoot || this._root ).uuid, + clipUuid = action._clip.uuid, + actionsForClip = this._actionsByClip[ clipUuid ]; + + this._bindAction( action, + actionsForClip && actionsForClip.knownActions[ 0 ] ); + + this._addInactiveAction( action, clipUuid, rootUuid ); + + } + + const bindings = action._propertyBindings; + + // increment reference counts / sort out state + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( binding.useCount ++ === 0 ) { + + this._lendBinding( binding ); + binding.saveOriginalState(); + + } + + } + + this._lendAction( action ); + + } + + } + + _deactivateAction( action ) { + + if ( this._isActiveAction( action ) ) { + + const bindings = action._propertyBindings; + + // decrement reference counts / sort out state + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( -- binding.useCount === 0 ) { + + binding.restoreOriginalState(); + this._takeBackBinding( binding ); + + } + + } + + this._takeBackAction( action ); + + } + + } + + // Memory manager + + _initMemoryManager() { + + this._actions = []; // 'nActiveActions' followed by inactive ones + this._nActiveActions = 0; + + this._actionsByClip = {}; + // inside: + // { + // knownActions: Array< AnimationAction > - used as prototypes + // actionByRoot: AnimationAction - lookup + // } + + + this._bindings = []; // 'nActiveBindings' followed by inactive ones + this._nActiveBindings = 0; + + this._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer > + + + this._controlInterpolants = []; // same game as above + this._nActiveControlInterpolants = 0; + + const scope = this; + + this.stats = { + + actions: { + get total() { + + return scope._actions.length; + + }, + get inUse() { + + return scope._nActiveActions; + + } + }, + bindings: { + get total() { + + return scope._bindings.length; + + }, + get inUse() { + + return scope._nActiveBindings; + + } + }, + controlInterpolants: { + get total() { + + return scope._controlInterpolants.length; + + }, + get inUse() { + + return scope._nActiveControlInterpolants; + + } + } + + }; + + } + + // Memory management for AnimationAction objects + + _isActiveAction( action ) { + + const index = action._cacheIndex; + return index !== null && index < this._nActiveActions; + + } + + _addInactiveAction( action, clipUuid, rootUuid ) { + + const actions = this._actions, + actionsByClip = this._actionsByClip; + + let actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip === undefined ) { + + actionsForClip = { + + knownActions: [ action ], + actionByRoot: {} + + }; + + action._byClipCacheIndex = 0; + + actionsByClip[ clipUuid ] = actionsForClip; + + } else { + + const knownActions = actionsForClip.knownActions; + + action._byClipCacheIndex = knownActions.length; + knownActions.push( action ); + + } + + action._cacheIndex = actions.length; + actions.push( action ); + + actionsForClip.actionByRoot[ rootUuid ] = action; + + } + + _removeInactiveAction( action ) { + + const actions = this._actions, + lastInactiveAction = actions[ actions.length - 1 ], + cacheIndex = action._cacheIndex; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + action._cacheIndex = null; + + + const clipUuid = action._clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ], + knownActionsForClip = actionsForClip.knownActions, + + lastKnownAction = + knownActionsForClip[ knownActionsForClip.length - 1 ], + + byClipCacheIndex = action._byClipCacheIndex; + + lastKnownAction._byClipCacheIndex = byClipCacheIndex; + knownActionsForClip[ byClipCacheIndex ] = lastKnownAction; + knownActionsForClip.pop(); + + action._byClipCacheIndex = null; + + + const actionByRoot = actionsForClip.actionByRoot, + rootUuid = ( action._localRoot || this._root ).uuid; + + delete actionByRoot[ rootUuid ]; + + if ( knownActionsForClip.length === 0 ) { + + delete actionsByClip[ clipUuid ]; + + } + + this._removeInactiveBindingsForAction( action ); + + } + + _removeInactiveBindingsForAction( action ) { + + const bindings = action._propertyBindings; + + for ( let i = 0, n = bindings.length; i !== n; ++ i ) { + + const binding = bindings[ i ]; + + if ( -- binding.referenceCount === 0 ) { + + this._removeInactiveBinding( binding ); + + } + + } + + } + + _lendAction( action ) { + + // [ active actions | inactive actions ] + // [ active actions >| inactive actions ] + // s a + // <-swap-> + // a s + + const actions = this._actions, + prevIndex = action._cacheIndex, + + lastActiveIndex = this._nActiveActions ++, + + firstInactiveAction = actions[ lastActiveIndex ]; + + action._cacheIndex = lastActiveIndex; + actions[ lastActiveIndex ] = action; + + firstInactiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = firstInactiveAction; + + } + + _takeBackAction( action ) { + + // [ active actions | inactive actions ] + // [ active actions |< inactive actions ] + // a s + // <-swap-> + // s a + + const actions = this._actions, + prevIndex = action._cacheIndex, + + firstInactiveIndex = -- this._nActiveActions, + + lastActiveAction = actions[ firstInactiveIndex ]; + + action._cacheIndex = firstInactiveIndex; + actions[ firstInactiveIndex ] = action; + + lastActiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = lastActiveAction; + + } + + // Memory management for PropertyMixer objects + + _addInactiveBinding( binding, rootUuid, trackName ) { + + const bindingsByRoot = this._bindingsByRootAndName, + bindings = this._bindings; + + let bindingByName = bindingsByRoot[ rootUuid ]; + + if ( bindingByName === undefined ) { + + bindingByName = {}; + bindingsByRoot[ rootUuid ] = bindingByName; + + } + + bindingByName[ trackName ] = binding; + + binding._cacheIndex = bindings.length; + bindings.push( binding ); + + } + + _removeInactiveBinding( binding ) { + + const bindings = this._bindings, + propBinding = binding.binding, + rootUuid = propBinding.rootNode.uuid, + trackName = propBinding.path, + bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ], + + lastInactiveBinding = bindings[ bindings.length - 1 ], + cacheIndex = binding._cacheIndex; + + lastInactiveBinding._cacheIndex = cacheIndex; + bindings[ cacheIndex ] = lastInactiveBinding; + bindings.pop(); + + delete bindingByName[ trackName ]; + + if ( Object.keys( bindingByName ).length === 0 ) { + + delete bindingsByRoot[ rootUuid ]; + + } + + } + + _lendBinding( binding ) { + + const bindings = this._bindings, + prevIndex = binding._cacheIndex, + + lastActiveIndex = this._nActiveBindings ++, + + firstInactiveBinding = bindings[ lastActiveIndex ]; + + binding._cacheIndex = lastActiveIndex; + bindings[ lastActiveIndex ] = binding; + + firstInactiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = firstInactiveBinding; + + } + + _takeBackBinding( binding ) { + + const bindings = this._bindings, + prevIndex = binding._cacheIndex, + + firstInactiveIndex = -- this._nActiveBindings, + + lastActiveBinding = bindings[ firstInactiveIndex ]; + + binding._cacheIndex = firstInactiveIndex; + bindings[ firstInactiveIndex ] = binding; + + lastActiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = lastActiveBinding; + + } + + + // Memory management of Interpolants for weight and time scale + + _lendControlInterpolant() { + + const interpolants = this._controlInterpolants, + lastActiveIndex = this._nActiveControlInterpolants ++; + + let interpolant = interpolants[ lastActiveIndex ]; + + if ( interpolant === undefined ) { + + interpolant = new LinearInterpolant( + new Float32Array( 2 ), new Float32Array( 2 ), + 1, _controlInterpolantsResultBuffer ); + + interpolant.__cacheIndex = lastActiveIndex; + interpolants[ lastActiveIndex ] = interpolant; + + } + + return interpolant; + + } + + _takeBackControlInterpolant( interpolant ) { + + const interpolants = this._controlInterpolants, + prevIndex = interpolant.__cacheIndex, + + firstInactiveIndex = -- this._nActiveControlInterpolants, + + lastActiveInterpolant = interpolants[ firstInactiveIndex ]; + + interpolant.__cacheIndex = firstInactiveIndex; + interpolants[ firstInactiveIndex ] = interpolant; + + lastActiveInterpolant.__cacheIndex = prevIndex; + interpolants[ prevIndex ] = lastActiveInterpolant; + + } + + // return an action for a clip optionally using a custom root target + // object (this method allocates a lot of dynamic memory in case a + // previously unknown clip/root combination is specified) + clipAction( clip, optionalRoot, blendMode ) { + + const root = optionalRoot || this._root, + rootUuid = root.uuid; + + let clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip; + + const clipUuid = clipObject !== null ? clipObject.uuid : clip; + + const actionsForClip = this._actionsByClip[ clipUuid ]; + let prototypeAction = null; + + if ( blendMode === undefined ) { + + if ( clipObject !== null ) { + + blendMode = clipObject.blendMode; + + } else { + + blendMode = NormalAnimationBlendMode; + + } + + } + + if ( actionsForClip !== undefined ) { + + const existingAction = actionsForClip.actionByRoot[ rootUuid ]; + + if ( existingAction !== undefined && existingAction.blendMode === blendMode ) { + + return existingAction; + + } + + // we know the clip, so we don't have to parse all + // the bindings again but can just copy + prototypeAction = actionsForClip.knownActions[ 0 ]; + + // also, take the clip from the prototype action + if ( clipObject === null ) + clipObject = prototypeAction._clip; + + } + + // clip must be known when specified via string + if ( clipObject === null ) return null; + + // allocate all resources required to run it + const newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode ); + + this._bindAction( newAction, prototypeAction ); + + // and make the action known to the memory manager + this._addInactiveAction( newAction, clipUuid, rootUuid ); + + return newAction; + + } + + // get an existing action + existingAction( clip, optionalRoot ) { + + const root = optionalRoot || this._root, + rootUuid = root.uuid, + + clipObject = typeof clip === 'string' ? + AnimationClip.findByName( root, clip ) : clip, + + clipUuid = clipObject ? clipObject.uuid : clip, + + actionsForClip = this._actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + return actionsForClip.actionByRoot[ rootUuid ] || null; + + } + + return null; + + } + + // deactivates all previously scheduled actions + stopAllAction() { + + const actions = this._actions, + nActions = this._nActiveActions; + + for ( let i = nActions - 1; i >= 0; -- i ) { + + actions[ i ].stop(); + + } + + return this; + + } + + // advance the time and update apply the animation + update( deltaTime ) { + + deltaTime *= this.timeScale; + + const actions = this._actions, + nActions = this._nActiveActions, + + time = this.time += deltaTime, + timeDirection = Math.sign( deltaTime ), + + accuIndex = this._accuIndex ^= 1; + + // run active actions + + for ( let i = 0; i !== nActions; ++ i ) { + + const action = actions[ i ]; + + action._update( time, deltaTime, timeDirection, accuIndex ); + + } + + // update scene graph + + const bindings = this._bindings, + nBindings = this._nActiveBindings; + + for ( let i = 0; i !== nBindings; ++ i ) { + + bindings[ i ].apply( accuIndex ); + + } + + return this; + + } + + // Allows you to seek to a specific time in an animation. + setTime( timeInSeconds ) { + + this.time = 0; // Zero out time attribute for AnimationMixer object; + for ( let i = 0; i < this._actions.length; i ++ ) { + + this._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects. + + } + + return this.update( timeInSeconds ); // Update used to set exact time. Returns "this" AnimationMixer object. + + } + + // return this mixer's root target object + getRoot() { + + return this._root; + + } + + // free all resources specific to a particular clip + uncacheClip( clip ) { + + const actions = this._actions, + clipUuid = clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + // note: just calling _removeInactiveAction would mess up the + // iteration state and also require updating the state we can + // just throw away + + const actionsToRemove = actionsForClip.knownActions; + + for ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) { + + const action = actionsToRemove[ i ]; + + this._deactivateAction( action ); + + const cacheIndex = action._cacheIndex, + lastInactiveAction = actions[ actions.length - 1 ]; + + action._cacheIndex = null; + action._byClipCacheIndex = null; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + this._removeInactiveBindingsForAction( action ); + + } + + delete actionsByClip[ clipUuid ]; + + } + + } + + // free all resources specific to a particular root target object + uncacheRoot( root ) { + + const rootUuid = root.uuid, + actionsByClip = this._actionsByClip; + + for ( const clipUuid in actionsByClip ) { + + const actionByRoot = actionsByClip[ clipUuid ].actionByRoot, + action = actionByRoot[ rootUuid ]; + + if ( action !== undefined ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + + const bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ]; + + if ( bindingByName !== undefined ) { + + for ( const trackName in bindingByName ) { + + const binding = bindingByName[ trackName ]; + binding.restoreOriginalState(); + this._removeInactiveBinding( binding ); + + } + + } + + } + + // remove a targeted clip from the cache + uncacheAction( clip, optionalRoot ) { + + const action = this.existingAction( clip, optionalRoot ); + + if ( action !== null ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + + } + + class Uniform { + + constructor( value ) { + + this.value = value; + + } + + clone() { + + return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() ); + + } + + } + + let id = 0; + + class UniformsGroup extends EventDispatcher { + + constructor() { + + super(); + + this.isUniformsGroup = true; + + Object.defineProperty( this, 'id', { value: id ++ } ); + + this.name = ''; + + this.usage = StaticDrawUsage; + this.uniforms = []; + + } + + add( uniform ) { + + this.uniforms.push( uniform ); + + return this; + + } + + remove( uniform ) { + + const index = this.uniforms.indexOf( uniform ); + + if ( index !== - 1 ) this.uniforms.splice( index, 1 ); + + return this; + + } + + setName( name ) { + + this.name = name; + + return this; + + } + + setUsage( value ) { + + this.usage = value; + + return this; + + } + + dispose() { + + this.dispatchEvent( { type: 'dispose' } ); + + return this; + + } + + copy( source ) { + + this.name = source.name; + this.usage = source.usage; + + const uniformsSource = source.uniforms; + + this.uniforms.length = 0; + + for ( let i = 0, l = uniformsSource.length; i < l; i ++ ) { + + this.uniforms.push( uniformsSource[ i ].clone() ); + + } + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + } + + class InstancedInterleavedBuffer extends InterleavedBuffer { + + constructor( array, stride, meshPerAttribute = 1 ) { + + super( array, stride ); + + this.isInstancedInterleavedBuffer = true; + + this.meshPerAttribute = meshPerAttribute; + + } + + copy( source ) { + + super.copy( source ); + + this.meshPerAttribute = source.meshPerAttribute; + + return this; + + } + + clone( data ) { + + const ib = super.clone( data ); + + ib.meshPerAttribute = this.meshPerAttribute; + + return ib; + + } + + toJSON( data ) { + + const json = super.toJSON( data ); + + json.isInstancedInterleavedBuffer = true; + json.meshPerAttribute = this.meshPerAttribute; + + return json; + + } + + } + + class GLBufferAttribute { + + constructor( buffer, type, itemSize, elementSize, count ) { + + this.isGLBufferAttribute = true; + + this.name = ''; + + this.buffer = buffer; + this.type = type; + this.itemSize = itemSize; + this.elementSize = elementSize; + this.count = count; + + this.version = 0; + + } + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + } + + setBuffer( buffer ) { + + this.buffer = buffer; + + return this; + + } + + setType( type, elementSize ) { + + this.type = type; + this.elementSize = elementSize; + + return this; + + } + + setItemSize( itemSize ) { + + this.itemSize = itemSize; + + return this; + + } + + setCount( count ) { + + this.count = count; + + return this; + + } + + } + + class Raycaster { + + constructor( origin, direction, near = 0, far = Infinity ) { + + this.ray = new Ray( origin, direction ); + // direction is assumed to be normalized (for accurate distance calculations) + + this.near = near; + this.far = far; + this.camera = null; + this.layers = new Layers(); + + this.params = { + Mesh: {}, + Line: { threshold: 1 }, + LOD: {}, + Points: { threshold: 1 }, + Sprite: {} + }; + + } + + set( origin, direction ) { + + // direction is assumed to be normalized (for accurate distance calculations) + + this.ray.set( origin, direction ); + + } + + setFromCamera( coords, camera ) { + + if ( camera.isPerspectiveCamera ) { + + this.ray.origin.setFromMatrixPosition( camera.matrixWorld ); + this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize(); + this.camera = camera; + + } else if ( camera.isOrthographicCamera ) { + + this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera + this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); + this.camera = camera; + + } else { + + console.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type ); + + } + + } + + intersectObject( object, recursive = true, intersects = [] ) { + + intersectObject( object, this, intersects, recursive ); + + intersects.sort( ascSort ); + + return intersects; + + } + + intersectObjects( objects, recursive = true, intersects = [] ) { + + for ( let i = 0, l = objects.length; i < l; i ++ ) { + + intersectObject( objects[ i ], this, intersects, recursive ); + + } + + intersects.sort( ascSort ); + + return intersects; + + } + + } + + function ascSort( a, b ) { + + return a.distance - b.distance; + + } + + function intersectObject( object, raycaster, intersects, recursive ) { + + if ( object.layers.test( raycaster.layers ) ) { + + object.raycast( raycaster, intersects ); + + } + + if ( recursive === true ) { + + const children = object.children; + + for ( let i = 0, l = children.length; i < l; i ++ ) { + + intersectObject( children[ i ], raycaster, intersects, true ); + + } + + } + + } + + /** + * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system + * + * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up. + * The azimuthal angle (theta) is measured from the positive z-axis. + */ + + + class Spherical { + + constructor( radius = 1, phi = 0, theta = 0 ) { + + this.radius = radius; + this.phi = phi; // polar angle + this.theta = theta; // azimuthal angle + + return this; + + } + + set( radius, phi, theta ) { + + this.radius = radius; + this.phi = phi; + this.theta = theta; + + return this; + + } + + copy( other ) { + + this.radius = other.radius; + this.phi = other.phi; + this.theta = other.theta; + + return this; + + } + + // restrict phi to be between EPS and PI-EPS + makeSafe() { + + const EPS = 0.000001; + this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) ); + + return this; + + } + + setFromVector3( v ) { + + return this.setFromCartesianCoords( v.x, v.y, v.z ); + + } + + setFromCartesianCoords( x, y, z ) { + + this.radius = Math.sqrt( x * x + y * y + z * z ); + + if ( this.radius === 0 ) { + + this.theta = 0; + this.phi = 0; + + } else { + + this.theta = Math.atan2( x, z ); + this.phi = Math.acos( clamp( y / this.radius, - 1, 1 ) ); + + } + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + } + + /** + * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system + */ + + class Cylindrical { + + constructor( radius = 1, theta = 0, y = 0 ) { + + this.radius = radius; // distance from the origin to a point in the x-z plane + this.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis + this.y = y; // height above the x-z plane + + return this; + + } + + set( radius, theta, y ) { + + this.radius = radius; + this.theta = theta; + this.y = y; + + return this; + + } + + copy( other ) { + + this.radius = other.radius; + this.theta = other.theta; + this.y = other.y; + + return this; + + } + + setFromVector3( v ) { + + return this.setFromCartesianCoords( v.x, v.y, v.z ); + + } + + setFromCartesianCoords( x, y, z ) { + + this.radius = Math.sqrt( x * x + z * z ); + this.theta = Math.atan2( x, z ); + this.y = y; + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + } + + const _vector$4 = /*@__PURE__*/ new Vector2(); + + class Box2 { + + constructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) { + + this.isBox2 = true; + + this.min = min; + this.max = max; + + } + + set( min, max ) { + + this.min.copy( min ); + this.max.copy( max ); + + return this; + + } + + setFromPoints( points ) { + + this.makeEmpty(); + + for ( let i = 0, il = points.length; i < il; i ++ ) { + + this.expandByPoint( points[ i ] ); + + } + + return this; + + } + + setFromCenterAndSize( center, size ) { + + const halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 ); + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); + + return this; + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + copy( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); + + return this; + + } + + makeEmpty() { + + this.min.x = this.min.y = + Infinity; + this.max.x = this.max.y = - Infinity; + + return this; + + } + + isEmpty() { + + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); + + } + + getCenter( target ) { + + return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + + } + + getSize( target ) { + + return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); + + } + + expandByPoint( point ) { + + this.min.min( point ); + this.max.max( point ); + + return this; + + } + + expandByVector( vector ) { + + this.min.sub( vector ); + this.max.add( vector ); + + return this; + + } + + expandByScalar( scalar ) { + + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); + + return this; + + } + + containsPoint( point ) { + + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y ? false : true; + + } + + containsBox( box ) { + + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y; + + } + + getParameter( point, target ) { + + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ) + ); + + } + + intersectsBox( box ) { + + // using 4 splitting planes to rule out intersections + + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y ? false : true; + + } + + clampPoint( point, target ) { + + return target.copy( point ).clamp( this.min, this.max ); + + } + + distanceToPoint( point ) { + + return this.clampPoint( point, _vector$4 ).distanceTo( point ); + + } + + intersect( box ) { + + this.min.max( box.min ); + this.max.min( box.max ); + + if ( this.isEmpty() ) this.makeEmpty(); + + return this; + + } + + union( box ) { + + this.min.min( box.min ); + this.max.max( box.max ); + + return this; + + } + + translate( offset ) { + + this.min.add( offset ); + this.max.add( offset ); + + return this; + + } + + equals( box ) { + + return box.min.equals( this.min ) && box.max.equals( this.max ); + + } + + } + + const _startP = /*@__PURE__*/ new Vector3(); + const _startEnd = /*@__PURE__*/ new Vector3(); + + class Line3 { + + constructor( start = new Vector3(), end = new Vector3() ) { + + this.start = start; + this.end = end; + + } + + set( start, end ) { + + this.start.copy( start ); + this.end.copy( end ); + + return this; + + } + + copy( line ) { + + this.start.copy( line.start ); + this.end.copy( line.end ); + + return this; + + } + + getCenter( target ) { + + return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); + + } + + delta( target ) { + + return target.subVectors( this.end, this.start ); + + } + + distanceSq() { + + return this.start.distanceToSquared( this.end ); + + } + + distance() { + + return this.start.distanceTo( this.end ); + + } + + at( t, target ) { + + return this.delta( target ).multiplyScalar( t ).add( this.start ); + + } + + closestPointToPointParameter( point, clampToLine ) { + + _startP.subVectors( point, this.start ); + _startEnd.subVectors( this.end, this.start ); + + const startEnd2 = _startEnd.dot( _startEnd ); + const startEnd_startP = _startEnd.dot( _startP ); + + let t = startEnd_startP / startEnd2; + + if ( clampToLine ) { + + t = clamp( t, 0, 1 ); + + } + + return t; + + } + + closestPointToPoint( point, clampToLine, target ) { + + const t = this.closestPointToPointParameter( point, clampToLine ); + + return this.delta( target ).multiplyScalar( t ).add( this.start ); + + } + + applyMatrix4( matrix ) { + + this.start.applyMatrix4( matrix ); + this.end.applyMatrix4( matrix ); + + return this; + + } + + equals( line ) { + + return line.start.equals( this.start ) && line.end.equals( this.end ); + + } + + clone() { + + return new this.constructor().copy( this ); + + } + + } + + const _vector$3 = /*@__PURE__*/ new Vector3(); + + class SpotLightHelper extends Object3D { + + constructor( light, color ) { + + super(); + + this.light = light; + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + this.type = 'SpotLightHelper'; + + const geometry = new BufferGeometry(); + + const positions = [ + 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, - 1, 0, 1, + 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, - 1, 1 + ]; + + for ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + + const p1 = ( i / l ) * Math.PI * 2; + const p2 = ( j / l ) * Math.PI * 2; + + positions.push( + Math.cos( p1 ), Math.sin( p1 ), 1, + Math.cos( p2 ), Math.sin( p2 ), 1 + ); + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + + this.cone = new LineSegments( geometry, material ); + this.add( this.cone ); + + this.update(); + + } + + dispose() { + + this.cone.geometry.dispose(); + this.cone.material.dispose(); + + } + + update() { + + this.light.updateWorldMatrix( true, false ); + this.light.target.updateWorldMatrix( true, false ); + + const coneLength = this.light.distance ? this.light.distance : 1000; + const coneWidth = coneLength * Math.tan( this.light.angle ); + + this.cone.scale.set( coneWidth, coneWidth, coneLength ); + + _vector$3.setFromMatrixPosition( this.light.target.matrixWorld ); + + this.cone.lookAt( _vector$3 ); + + if ( this.color !== undefined ) { + + this.cone.material.color.set( this.color ); + + } else { + + this.cone.material.color.copy( this.light.color ); + + } + + } + + } + + const _vector$2 = /*@__PURE__*/ new Vector3(); + const _boneMatrix = /*@__PURE__*/ new Matrix4(); + const _matrixWorldInv = /*@__PURE__*/ new Matrix4(); + + + class SkeletonHelper extends LineSegments { + + constructor( object ) { + + const bones = getBoneList( object ); + + const geometry = new BufferGeometry(); + + const vertices = []; + const colors = []; + + const color1 = new Color( 0, 0, 1 ); + const color2 = new Color( 0, 1, 0 ); + + for ( let i = 0; i < bones.length; i ++ ) { + + const bone = bones[ i ]; + + if ( bone.parent && bone.parent.isBone ) { + + vertices.push( 0, 0, 0 ); + vertices.push( 0, 0, 0 ); + colors.push( color1.r, color1.g, color1.b ); + colors.push( color2.r, color2.g, color2.b ); + + } + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); + + super( geometry, material ); + + this.isSkeletonHelper = true; + + this.type = 'SkeletonHelper'; + + this.root = object; + this.bones = bones; + + this.matrix = object.matrixWorld; + this.matrixAutoUpdate = false; + + } + + updateMatrixWorld( force ) { + + const bones = this.bones; + + const geometry = this.geometry; + const position = geometry.getAttribute( 'position' ); + + _matrixWorldInv.copy( this.root.matrixWorld ).invert(); + + for ( let i = 0, j = 0; i < bones.length; i ++ ) { + + const bone = bones[ i ]; + + if ( bone.parent && bone.parent.isBone ) { + + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); + _vector$2.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z ); + + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); + _vector$2.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z ); + + j += 2; + + } + + } + + geometry.getAttribute( 'position' ).needsUpdate = true; + + super.updateMatrixWorld( force ); + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + + function getBoneList( object ) { + + const boneList = []; + + if ( object.isBone === true ) { + + boneList.push( object ); + + } + + for ( let i = 0; i < object.children.length; i ++ ) { + + boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); + + } + + return boneList; + + } + + class PointLightHelper extends Mesh { + + constructor( light, sphereSize, color ) { + + const geometry = new SphereGeometry( sphereSize, 4, 2 ); + const material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + + super( geometry, material ); + + this.light = light; + + this.color = color; + + this.type = 'PointLightHelper'; + + this.matrix = this.light.matrixWorld; + this.matrixAutoUpdate = false; + + this.update(); + + + /* + // TODO: delete this comment? + const distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 ); + const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); + + this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); + this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial ); + + const d = light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.scale.set( d, d, d ); + + } + + this.add( this.lightDistance ); + */ + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + update() { + + this.light.updateWorldMatrix( true, false ); + + if ( this.color !== undefined ) { + + this.material.color.set( this.color ); + + } else { + + this.material.color.copy( this.light.color ); + + } + + /* + const d = this.light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.visible = true; + this.lightDistance.scale.set( d, d, d ); + + } + */ + + } + + } + + const _vector$1 = /*@__PURE__*/ new Vector3(); + const _color1 = /*@__PURE__*/ new Color(); + const _color2 = /*@__PURE__*/ new Color(); + + class HemisphereLightHelper extends Object3D { + + constructor( light, size, color ) { + + super(); + + this.light = light; + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + this.type = 'HemisphereLightHelper'; + + const geometry = new OctahedronGeometry( size ); + geometry.rotateY( Math.PI * 0.5 ); + + this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + if ( this.color === undefined ) this.material.vertexColors = true; + + const position = geometry.getAttribute( 'position' ); + const colors = new Float32Array( position.count * 3 ); + + geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); + + this.add( new Mesh( geometry, this.material ) ); + + this.update(); + + } + + dispose() { + + this.children[ 0 ].geometry.dispose(); + this.children[ 0 ].material.dispose(); + + } + + update() { + + const mesh = this.children[ 0 ]; + + if ( this.color !== undefined ) { + + this.material.color.set( this.color ); + + } else { + + const colors = mesh.geometry.getAttribute( 'color' ); + + _color1.copy( this.light.color ); + _color2.copy( this.light.groundColor ); + + for ( let i = 0, l = colors.count; i < l; i ++ ) { + + const color = ( i < ( l / 2 ) ) ? _color1 : _color2; + + colors.setXYZ( i, color.r, color.g, color.b ); + + } + + colors.needsUpdate = true; + + } + + this.light.updateWorldMatrix( true, false ); + + mesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + + } + + } + + class GridHelper extends LineSegments { + + constructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) { + + color1 = new Color( color1 ); + color2 = new Color( color2 ); + + const center = divisions / 2; + const step = size / divisions; + const halfSize = size / 2; + + const vertices = [], colors = []; + + for ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { + + vertices.push( - halfSize, 0, k, halfSize, 0, k ); + vertices.push( k, 0, - halfSize, k, 0, halfSize ); + + const color = i === center ? color1 : color2; + + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + + } + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'GridHelper'; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + class PolarGridHelper extends LineSegments { + + constructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) { + + color1 = new Color( color1 ); + color2 = new Color( color2 ); + + const vertices = []; + const colors = []; + + // create the sectors + + if ( sectors > 1 ) { + + for ( let i = 0; i < sectors; i ++ ) { + + const v = ( i / sectors ) * ( Math.PI * 2 ); + + const x = Math.sin( v ) * radius; + const z = Math.cos( v ) * radius; + + vertices.push( 0, 0, 0 ); + vertices.push( x, 0, z ); + + const color = ( i & 1 ) ? color1 : color2; + + colors.push( color.r, color.g, color.b ); + colors.push( color.r, color.g, color.b ); + + } + + } + + // create the rings + + for ( let i = 0; i < rings; i ++ ) { + + const color = ( i & 1 ) ? color1 : color2; + + const r = radius - ( radius / rings * i ); + + for ( let j = 0; j < divisions; j ++ ) { + + // first vertex + + let v = ( j / divisions ) * ( Math.PI * 2 ); + + let x = Math.sin( v ) * r; + let z = Math.cos( v ) * r; + + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); + + // second vertex + + v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); + + x = Math.sin( v ) * r; + z = Math.cos( v ) * r; + + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); + + } + + } + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'PolarGridHelper'; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + const _v1 = /*@__PURE__*/ new Vector3(); + const _v2 = /*@__PURE__*/ new Vector3(); + const _v3 = /*@__PURE__*/ new Vector3(); + + class DirectionalLightHelper extends Object3D { + + constructor( light, size, color ) { + + super(); + + this.light = light; + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.color = color; + + this.type = 'DirectionalLightHelper'; + + if ( size === undefined ) size = 1; + + let geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ + - size, size, 0, + size, size, 0, + size, - size, 0, + - size, - size, 0, + - size, size, 0 + ], 3 ) ); + + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + + this.lightPlane = new Line( geometry, material ); + this.add( this.lightPlane ); + + geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + + this.targetLine = new Line( geometry, material ); + this.add( this.targetLine ); + + this.update(); + + } + + dispose() { + + this.lightPlane.geometry.dispose(); + this.lightPlane.material.dispose(); + this.targetLine.geometry.dispose(); + this.targetLine.material.dispose(); + + } + + update() { + + this.light.updateWorldMatrix( true, false ); + this.light.target.updateWorldMatrix( true, false ); + + _v1.setFromMatrixPosition( this.light.matrixWorld ); + _v2.setFromMatrixPosition( this.light.target.matrixWorld ); + _v3.subVectors( _v2, _v1 ); + + this.lightPlane.lookAt( _v2 ); + + if ( this.color !== undefined ) { + + this.lightPlane.material.color.set( this.color ); + this.targetLine.material.color.set( this.color ); + + } else { + + this.lightPlane.material.color.copy( this.light.color ); + this.targetLine.material.color.copy( this.light.color ); + + } + + this.targetLine.lookAt( _v2 ); + this.targetLine.scale.z = _v3.length(); + + } + + } + + const _vector = /*@__PURE__*/ new Vector3(); + const _camera = /*@__PURE__*/ new Camera(); + + /** + * - shows frustum, line of sight and up of the camera + * - suitable for fast updates + * - based on frustum visualization in lightgl.js shadowmap example + * https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html + */ + + class CameraHelper extends LineSegments { + + constructor( camera ) { + + const geometry = new BufferGeometry(); + const material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); + + const vertices = []; + const colors = []; + + const pointMap = {}; + + // near + + addLine( 'n1', 'n2' ); + addLine( 'n2', 'n4' ); + addLine( 'n4', 'n3' ); + addLine( 'n3', 'n1' ); + + // far + + addLine( 'f1', 'f2' ); + addLine( 'f2', 'f4' ); + addLine( 'f4', 'f3' ); + addLine( 'f3', 'f1' ); + + // sides + + addLine( 'n1', 'f1' ); + addLine( 'n2', 'f2' ); + addLine( 'n3', 'f3' ); + addLine( 'n4', 'f4' ); + + // cone + + addLine( 'p', 'n1' ); + addLine( 'p', 'n2' ); + addLine( 'p', 'n3' ); + addLine( 'p', 'n4' ); + + // up + + addLine( 'u1', 'u2' ); + addLine( 'u2', 'u3' ); + addLine( 'u3', 'u1' ); + + // target + + addLine( 'c', 't' ); + addLine( 'p', 'c' ); + + // cross + + addLine( 'cn1', 'cn2' ); + addLine( 'cn3', 'cn4' ); + + addLine( 'cf1', 'cf2' ); + addLine( 'cf3', 'cf4' ); + + function addLine( a, b ) { + + addPoint( a ); + addPoint( b ); + + } + + function addPoint( id ) { + + vertices.push( 0, 0, 0 ); + colors.push( 0, 0, 0 ); + + if ( pointMap[ id ] === undefined ) { + + pointMap[ id ] = []; + + } + + pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); + + } + + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + super( geometry, material ); + + this.type = 'CameraHelper'; + + this.camera = camera; + if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); + + this.matrix = camera.matrixWorld; + this.matrixAutoUpdate = false; + + this.pointMap = pointMap; + + this.update(); + + // colors + + const colorFrustum = new Color( 0xffaa00 ); + const colorCone = new Color( 0xff0000 ); + const colorUp = new Color( 0x00aaff ); + const colorTarget = new Color( 0xffffff ); + const colorCross = new Color( 0x333333 ); + + this.setColors( colorFrustum, colorCone, colorUp, colorTarget, colorCross ); + + } + + setColors( frustum, cone, up, target, cross ) { + + const geometry = this.geometry; + + const colorAttribute = geometry.getAttribute( 'color' ); + + // near + + colorAttribute.setXYZ( 0, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 1, frustum.r, frustum.g, frustum.b ); // n1, n2 + colorAttribute.setXYZ( 2, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 3, frustum.r, frustum.g, frustum.b ); // n2, n4 + colorAttribute.setXYZ( 4, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 5, frustum.r, frustum.g, frustum.b ); // n4, n3 + colorAttribute.setXYZ( 6, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 7, frustum.r, frustum.g, frustum.b ); // n3, n1 + + // far + + colorAttribute.setXYZ( 8, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 9, frustum.r, frustum.g, frustum.b ); // f1, f2 + colorAttribute.setXYZ( 10, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 11, frustum.r, frustum.g, frustum.b ); // f2, f4 + colorAttribute.setXYZ( 12, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 13, frustum.r, frustum.g, frustum.b ); // f4, f3 + colorAttribute.setXYZ( 14, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 15, frustum.r, frustum.g, frustum.b ); // f3, f1 + + // sides + + colorAttribute.setXYZ( 16, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 17, frustum.r, frustum.g, frustum.b ); // n1, f1 + colorAttribute.setXYZ( 18, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 19, frustum.r, frustum.g, frustum.b ); // n2, f2 + colorAttribute.setXYZ( 20, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 21, frustum.r, frustum.g, frustum.b ); // n3, f3 + colorAttribute.setXYZ( 22, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 23, frustum.r, frustum.g, frustum.b ); // n4, f4 + + // cone + + colorAttribute.setXYZ( 24, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 25, cone.r, cone.g, cone.b ); // p, n1 + colorAttribute.setXYZ( 26, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 27, cone.r, cone.g, cone.b ); // p, n2 + colorAttribute.setXYZ( 28, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 29, cone.r, cone.g, cone.b ); // p, n3 + colorAttribute.setXYZ( 30, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 31, cone.r, cone.g, cone.b ); // p, n4 + + // up + + colorAttribute.setXYZ( 32, up.r, up.g, up.b ); colorAttribute.setXYZ( 33, up.r, up.g, up.b ); // u1, u2 + colorAttribute.setXYZ( 34, up.r, up.g, up.b ); colorAttribute.setXYZ( 35, up.r, up.g, up.b ); // u2, u3 + colorAttribute.setXYZ( 36, up.r, up.g, up.b ); colorAttribute.setXYZ( 37, up.r, up.g, up.b ); // u3, u1 + + // target + + colorAttribute.setXYZ( 38, target.r, target.g, target.b ); colorAttribute.setXYZ( 39, target.r, target.g, target.b ); // c, t + colorAttribute.setXYZ( 40, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 41, cross.r, cross.g, cross.b ); // p, c + + // cross + + colorAttribute.setXYZ( 42, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 43, cross.r, cross.g, cross.b ); // cn1, cn2 + colorAttribute.setXYZ( 44, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 45, cross.r, cross.g, cross.b ); // cn3, cn4 + + colorAttribute.setXYZ( 46, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 47, cross.r, cross.g, cross.b ); // cf1, cf2 + colorAttribute.setXYZ( 48, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 49, cross.r, cross.g, cross.b ); // cf3, cf4 + + colorAttribute.needsUpdate = true; + + } + + update() { + + const geometry = this.geometry; + const pointMap = this.pointMap; + + const w = 1, h = 1; + + // we need just camera projection matrix inverse + // world matrix must be identity + + _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); + + // center / target + + setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); + setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); + + // near + + setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); + setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); + setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); + setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); + + // far + + setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); + setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); + setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); + setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); + + // up + + setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); + setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); + setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); + + // cross + + setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); + setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); + setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); + setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); + + setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); + setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); + setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); + setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); + + geometry.getAttribute( 'position' ).needsUpdate = true; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + + function setPoint( point, pointMap, geometry, camera, x, y, z ) { + + _vector.set( x, y, z ).unproject( camera ); + + const points = pointMap[ point ]; + + if ( points !== undefined ) { + + const position = geometry.getAttribute( 'position' ); + + for ( let i = 0, l = points.length; i < l; i ++ ) { + + position.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z ); + + } + + } + + } + + const _box = /*@__PURE__*/ new Box3(); + + class BoxHelper extends LineSegments { + + constructor( object, color = 0xffff00 ) { + + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + const positions = new Float32Array( 8 * 3 ); + + const geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.object = object; + this.type = 'BoxHelper'; + + this.matrixAutoUpdate = false; + + this.update(); + + } + + update( object ) { + + if ( object !== undefined ) { + + console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); + + } + + if ( this.object !== undefined ) { + + _box.setFromObject( this.object ); + + } + + if ( _box.isEmpty() ) return; + + const min = _box.min; + const max = _box.max; + + /* + 5____4 + 1/___0/| + | 6__|_7 + 2/___3/ + + 0: max.x, max.y, max.z + 1: min.x, max.y, max.z + 2: min.x, min.y, max.z + 3: max.x, min.y, max.z + 4: max.x, max.y, min.z + 5: min.x, max.y, min.z + 6: min.x, min.y, min.z + 7: max.x, min.y, min.z + */ + + const position = this.geometry.attributes.position; + const array = position.array; + + array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; + array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; + array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; + array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; + array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; + array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; + array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; + array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + + position.needsUpdate = true; + + this.geometry.computeBoundingSphere(); + + } + + setFromObject( object ) { + + this.object = object; + this.update(); + + return this; + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + this.object = source.object; + + return this; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + class Box3Helper extends LineSegments { + + constructor( box, color = 0xffff00 ) { + + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + + const positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; + + const geometry = new BufferGeometry(); + + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.box = box; + + this.type = 'Box3Helper'; + + this.geometry.computeBoundingSphere(); + + } + + updateMatrixWorld( force ) { + + const box = this.box; + + if ( box.isEmpty() ) return; + + box.getCenter( this.position ); + + box.getSize( this.scale ); + + this.scale.multiplyScalar( 0.5 ); + + super.updateMatrixWorld( force ); + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + class PlaneHelper extends Line { + + constructor( plane, size = 1, hex = 0xffff00 ) { + + const color = hex; + + const positions = [ 1, - 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ]; + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.computeBoundingSphere(); + + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + + this.type = 'PlaneHelper'; + + this.plane = plane; + + this.size = size; + + const positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ]; + + const geometry2 = new BufferGeometry(); + geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); + geometry2.computeBoundingSphere(); + + this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); + + } + + updateMatrixWorld( force ) { + + this.position.set( 0, 0, 0 ); + + this.scale.set( 0.5 * this.size, 0.5 * this.size, 1 ); + + this.lookAt( this.plane.normal ); + + this.translateZ( - this.plane.constant ); + + super.updateMatrixWorld( force ); + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + this.children[ 0 ].geometry.dispose(); + this.children[ 0 ].material.dispose(); + + } + + } + + const _axis = /*@__PURE__*/ new Vector3(); + let _lineGeometry, _coneGeometry; + + class ArrowHelper extends Object3D { + + // dir is assumed to be normalized + + constructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) { + + super(); + + this.type = 'ArrowHelper'; + + if ( _lineGeometry === undefined ) { + + _lineGeometry = new BufferGeometry(); + _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + + _coneGeometry = new CylinderGeometry( 0, 0.5, 1, 5, 1 ); + _coneGeometry.translate( 0, - 0.5, 0 ); + + } + + this.position.copy( origin ); + + this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.line.matrixAutoUpdate = false; + this.add( this.line ); + + this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); + this.cone.matrixAutoUpdate = false; + this.add( this.cone ); + + this.setDirection( dir ); + this.setLength( length, headLength, headWidth ); + + } + + setDirection( dir ) { + + // dir is assumed to be normalized + + if ( dir.y > 0.99999 ) { + + this.quaternion.set( 0, 0, 0, 1 ); + + } else if ( dir.y < - 0.99999 ) { + + this.quaternion.set( 1, 0, 0, 0 ); + + } else { + + _axis.set( dir.z, 0, - dir.x ).normalize(); + + const radians = Math.acos( dir.y ); + + this.quaternion.setFromAxisAngle( _axis, radians ); + + } + + } + + setLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) { + + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 + this.line.updateMatrix(); + + this.cone.scale.set( headWidth, headLength, headWidth ); + this.cone.position.y = length; + this.cone.updateMatrix(); + + } + + setColor( color ) { + + this.line.material.color.set( color ); + this.cone.material.color.set( color ); + + } + + copy( source ) { + + super.copy( source, false ); + + this.line.copy( source.line ); + this.cone.copy( source.cone ); + + return this; + + } + + dispose() { + + this.line.geometry.dispose(); + this.line.material.dispose(); + this.cone.geometry.dispose(); + this.cone.material.dispose(); + + } + + } + + class AxesHelper extends LineSegments { + + constructor( size = 1 ) { + + const vertices = [ + 0, 0, 0, size, 0, 0, + 0, 0, 0, 0, size, 0, + 0, 0, 0, 0, 0, size + ]; + + const colors = [ + 1, 0, 0, 1, 0.6, 0, + 0, 1, 0, 0.6, 1, 0, + 0, 0, 1, 0, 0.6, 1 + ]; + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + + super( geometry, material ); + + this.type = 'AxesHelper'; + + } + + setColors( xAxisColor, yAxisColor, zAxisColor ) { + + const color = new Color(); + const array = this.geometry.attributes.color.array; + + color.set( xAxisColor ); + color.toArray( array, 0 ); + color.toArray( array, 3 ); + + color.set( yAxisColor ); + color.toArray( array, 6 ); + color.toArray( array, 9 ); + + color.set( zAxisColor ); + color.toArray( array, 12 ); + color.toArray( array, 15 ); + + this.geometry.attributes.color.needsUpdate = true; + + return this; + + } + + dispose() { + + this.geometry.dispose(); + this.material.dispose(); + + } + + } + + class ShapePath { + + constructor() { + + this.type = 'ShapePath'; + + this.color = new Color(); + + this.subPaths = []; + this.currentPath = null; + + } + + moveTo( x, y ) { + + this.currentPath = new Path(); + this.subPaths.push( this.currentPath ); + this.currentPath.moveTo( x, y ); + + return this; + + } + + lineTo( x, y ) { + + this.currentPath.lineTo( x, y ); + + return this; + + } + + quadraticCurveTo( aCPx, aCPy, aX, aY ) { + + this.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY ); + + return this; + + } + + bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + + this.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ); + + return this; + + } + + splineThru( pts ) { + + this.currentPath.splineThru( pts ); + + return this; + + } + + toShapes( isCCW ) { + + function toShapesNoHoles( inSubpaths ) { + + const shapes = []; + + for ( let i = 0, l = inSubpaths.length; i < l; i ++ ) { + + const tmpPath = inSubpaths[ i ]; + + const tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + + shapes.push( tmpShape ); + + } + + return shapes; + + } + + function isPointInsidePolygon( inPt, inPolygon ) { + + const polyLen = inPolygon.length; + + // inPt on polygon contour => immediate success or + // toggling of inside/outside at every single! intersection point of an edge + // with the horizontal line through inPt, left of inPt + // not counting lowerY endpoints of edges and whole edges on that line + let inside = false; + for ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) { + + let edgeLowPt = inPolygon[ p ]; + let edgeHighPt = inPolygon[ q ]; + + let edgeDx = edgeHighPt.x - edgeLowPt.x; + let edgeDy = edgeHighPt.y - edgeLowPt.y; + + if ( Math.abs( edgeDy ) > Number.EPSILON ) { + + // not parallel + if ( edgeDy < 0 ) { + + edgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx; + edgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy; + + } + + if ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) continue; + + if ( inPt.y === edgeLowPt.y ) { + + if ( inPt.x === edgeLowPt.x ) return true; // inPt is on contour ? + // continue; // no intersection or edgeLowPt => doesn't count !!! + + } else { + + const perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y ); + if ( perpEdge === 0 ) return true; // inPt is on contour ? + if ( perpEdge < 0 ) continue; + inside = ! inside; // true intersection left of inPt + + } + + } else { + + // parallel or collinear + if ( inPt.y !== edgeLowPt.y ) continue; // parallel + // edge lies on the same horizontal line as inPt + if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) || + ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour ! + // continue; + + } + + } + + return inside; + + } + + const isClockWise = ShapeUtils.isClockWise; + + const subPaths = this.subPaths; + if ( subPaths.length === 0 ) return []; + + let solid, tmpPath, tmpShape; + const shapes = []; + + if ( subPaths.length === 1 ) { + + tmpPath = subPaths[ 0 ]; + tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + shapes.push( tmpShape ); + return shapes; + + } + + let holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() ); + holesFirst = isCCW ? ! holesFirst : holesFirst; + + // console.log("Holes first", holesFirst); + + const betterShapeHoles = []; + const newShapes = []; + let newShapeHoles = []; + let mainIdx = 0; + let tmpPoints; + + newShapes[ mainIdx ] = undefined; + newShapeHoles[ mainIdx ] = []; + + for ( let i = 0, l = subPaths.length; i < l; i ++ ) { + + tmpPath = subPaths[ i ]; + tmpPoints = tmpPath.getPoints(); + solid = isClockWise( tmpPoints ); + solid = isCCW ? ! solid : solid; + + if ( solid ) { + + if ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) ) mainIdx ++; + + newShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints }; + newShapes[ mainIdx ].s.curves = tmpPath.curves; + + if ( holesFirst ) mainIdx ++; + newShapeHoles[ mainIdx ] = []; + + //console.log('cw', i); + + } else { + + newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } ); + + //console.log('ccw', i); + + } + + } + + // only Holes? -> probably all Shapes with wrong orientation + if ( ! newShapes[ 0 ] ) return toShapesNoHoles( subPaths ); + + + if ( newShapes.length > 1 ) { + + let ambiguous = false; + let toChange = 0; + + for ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + betterShapeHoles[ sIdx ] = []; + + } + + for ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + const sho = newShapeHoles[ sIdx ]; + + for ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) { + + const ho = sho[ hIdx ]; + let hole_unassigned = true; + + for ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) { + + if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) { + + if ( sIdx !== s2Idx ) toChange ++; + + if ( hole_unassigned ) { + + hole_unassigned = false; + betterShapeHoles[ s2Idx ].push( ho ); + + } else { + + ambiguous = true; + + } + + } + + } + + if ( hole_unassigned ) { + + betterShapeHoles[ sIdx ].push( ho ); + + } + + } + + } + + if ( toChange > 0 && ambiguous === false ) { + + newShapeHoles = betterShapeHoles; + + } + + } + + let tmpHoles; + + for ( let i = 0, il = newShapes.length; i < il; i ++ ) { + + tmpShape = newShapes[ i ].s; + shapes.push( tmpShape ); + tmpHoles = newShapeHoles[ i ]; + + for ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) { + + tmpShape.holes.push( tmpHoles[ j ].h ); + + } + + } + + //console.log("shape", shapes); + + return shapes; + + } + + } + + class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144 + + constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) { + + console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' ); + super( width, height, depth, widthSegments, heightSegments, depthSegments ); + + + } + + } + + class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144 + + constructor( radius, length, capSegments, radialSegments ) { + + console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' ); + super( radius, length, capSegments, radialSegments ); + + } + + } + + class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144 + + constructor( radius, segments, thetaStart, thetaLength ) { + + console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' ); + super( radius, segments, thetaStart, thetaLength ); + + } + + } + + class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144 + + constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' ); + super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + + } + + } + + class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144 + + constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' ); + super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + + } + + } + + class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144 + + constructor( radius, detail ) { + + console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' ); + super( radius, detail ); + + } + + } + + class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144 + + constructor( shapes, options ) { + + console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' ); + super( shapes, options ); + + } + + } + + class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144 + + constructor( radius, detail ) { + + console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' ); + super( radius, detail ); + + } + + } + + class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144 + + constructor( points, segments, phiStart, phiLength ) { + + console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' ); + super( points, segments, phiStart, phiLength ); + + } + + } + + class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144 + + constructor( radius, detail ) { + + console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' ); + super( radius, detail ); + + } + + } + + class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144 + + constructor( width, height, widthSegments, heightSegments ) { + + console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' ); + super( width, height, widthSegments, heightSegments ); + + } + + } + + class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144 + + constructor( vertices, indices, radius, detail ) { + + console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' ); + super( vertices, indices, radius, detail ); + + } + + } + + class RingBufferGeometry extends RingGeometry { // @deprecated, r144 + + constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + + console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' ); + super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ); + + } + + } + + class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144 + + constructor( shapes, curveSegments ) { + + console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' ); + super( shapes, curveSegments ); + + } + + } + + class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144 + + constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + + console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' ); + super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ); + + } + + } + + class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144 + + constructor( radius, detail ) { + + console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' ); + super( radius, detail ); + + } + + } + + class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144 + + constructor( radius, tube, radialSegments, tubularSegments, arc ) { + + console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' ); + super( radius, tube, radialSegments, tubularSegments, arc ); + + } + + } + + class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144 + + constructor( radius, tube, tubularSegments, radialSegments, p, q ) { + + console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' ); + super( radius, tube, tubularSegments, radialSegments, p, q ); + + } + + } + + class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144 + + constructor( path, tubularSegments, radius, radialSegments, closed ) { + + console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' ); + super( path, tubularSegments, radius, radialSegments, closed ); + + } + + } + + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { + revision: REVISION, + } } ) ); + + } + + if ( typeof window !== 'undefined' ) { + + if ( window.__THREE__ ) { + + console.warn( 'WARNING: Multiple instances of Three.js being imported.' ); + + } else { + + window.__THREE__ = REVISION; + + } + + } + + exports.ACESFilmicToneMapping = ACESFilmicToneMapping; + exports.AddEquation = AddEquation; + exports.AddOperation = AddOperation; + exports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode; + exports.AdditiveBlending = AdditiveBlending; + exports.AlphaFormat = AlphaFormat; + exports.AlwaysCompare = AlwaysCompare; + exports.AlwaysDepth = AlwaysDepth; + exports.AlwaysStencilFunc = AlwaysStencilFunc; exports.AmbientLight = AmbientLight; - exports.LightShadow = LightShadow; - exports.Light = Light; - exports.StereoCamera = StereoCamera; - exports.PerspectiveCamera = PerspectiveCamera; - exports.OrthographicCamera = OrthographicCamera; - exports.CubeCamera = CubeCamera; + exports.AmbientLightProbe = AmbientLightProbe; + exports.AnimationAction = AnimationAction; + exports.AnimationClip = AnimationClip; + exports.AnimationLoader = AnimationLoader; + exports.AnimationMixer = AnimationMixer; + exports.AnimationObjectGroup = AnimationObjectGroup; + exports.AnimationUtils = AnimationUtils; + exports.ArcCurve = ArcCurve; exports.ArrayCamera = ArrayCamera; - exports.Camera = Camera; - exports.AudioListener = AudioListener; - exports.PositionalAudio = PositionalAudio; - exports.AudioContext = AudioContext; - exports.AudioAnalyser = AudioAnalyser; + exports.ArrowHelper = ArrowHelper; exports.Audio = Audio; - exports.VectorKeyframeTrack = VectorKeyframeTrack; - exports.StringKeyframeTrack = StringKeyframeTrack; - exports.QuaternionKeyframeTrack = QuaternionKeyframeTrack; - exports.NumberKeyframeTrack = NumberKeyframeTrack; - exports.ColorKeyframeTrack = ColorKeyframeTrack; + exports.AudioAnalyser = AudioAnalyser; + exports.AudioContext = AudioContext; + exports.AudioListener = AudioListener; + exports.AudioLoader = AudioLoader; + exports.AxesHelper = AxesHelper; + exports.BackSide = BackSide; + exports.BasicDepthPacking = BasicDepthPacking; + exports.BasicShadowMap = BasicShadowMap; + exports.Bone = Bone; exports.BooleanKeyframeTrack = BooleanKeyframeTrack; - exports.PropertyMixer = PropertyMixer; - exports.PropertyBinding = PropertyBinding; - exports.KeyframeTrack = KeyframeTrack; - exports.AnimationUtils = AnimationUtils; - exports.AnimationObjectGroup = AnimationObjectGroup; - exports.AnimationMixer = AnimationMixer; - exports.AnimationClip = AnimationClip; - exports.Uniform = Uniform; - exports.InstancedBufferGeometry = InstancedBufferGeometry; + exports.Box2 = Box2; + exports.Box3 = Box3; + exports.Box3Helper = Box3Helper; + exports.BoxBufferGeometry = BoxBufferGeometry; + exports.BoxGeometry = BoxGeometry; + exports.BoxHelper = BoxHelper; + exports.BufferAttribute = BufferAttribute; exports.BufferGeometry = BufferGeometry; - exports.GeometryIdCount = GeometryIdCount; - exports.Geometry = Geometry; - exports.InterleavedBufferAttribute = InterleavedBufferAttribute; - exports.InstancedInterleavedBuffer = InstancedInterleavedBuffer; - exports.InterleavedBuffer = InterleavedBuffer; - exports.InstancedBufferAttribute = InstancedBufferAttribute; - exports.Face3 = Face3; - exports.Object3D = Object3D; - exports.Raycaster = Raycaster; - exports.Layers = Layers; - exports.EventDispatcher = EventDispatcher; + exports.BufferGeometryLoader = BufferGeometryLoader; + exports.ByteType = ByteType; + exports.Cache = Cache; + exports.Camera = Camera; + exports.CameraHelper = CameraHelper; + exports.CanvasTexture = CanvasTexture; + exports.CapsuleBufferGeometry = CapsuleBufferGeometry; + exports.CapsuleGeometry = CapsuleGeometry; + exports.CatmullRomCurve3 = CatmullRomCurve3; + exports.CineonToneMapping = CineonToneMapping; + exports.CircleBufferGeometry = CircleBufferGeometry; + exports.CircleGeometry = CircleGeometry; + exports.ClampToEdgeWrapping = ClampToEdgeWrapping; exports.Clock = Clock; - exports.QuaternionLinearInterpolant = QuaternionLinearInterpolant; - exports.LinearInterpolant = LinearInterpolant; - exports.DiscreteInterpolant = DiscreteInterpolant; + exports.Color = Color; + exports.ColorKeyframeTrack = ColorKeyframeTrack; + exports.ColorManagement = ColorManagement; + exports.CompressedArrayTexture = CompressedArrayTexture; + exports.CompressedTexture = CompressedTexture; + exports.CompressedTextureLoader = CompressedTextureLoader; + exports.ConeBufferGeometry = ConeBufferGeometry; + exports.ConeGeometry = ConeGeometry; + exports.CubeCamera = CubeCamera; + exports.CubeReflectionMapping = CubeReflectionMapping; + exports.CubeRefractionMapping = CubeRefractionMapping; + exports.CubeTexture = CubeTexture; + exports.CubeTextureLoader = CubeTextureLoader; + exports.CubeUVReflectionMapping = CubeUVReflectionMapping; + exports.CubicBezierCurve = CubicBezierCurve; + exports.CubicBezierCurve3 = CubicBezierCurve3; exports.CubicInterpolant = CubicInterpolant; - exports.Interpolant = Interpolant; - exports.Triangle = Triangle; - exports.Math = _Math; - exports.Spherical = Spherical; + exports.CullFaceBack = CullFaceBack; + exports.CullFaceFront = CullFaceFront; + exports.CullFaceFrontBack = CullFaceFrontBack; + exports.CullFaceNone = CullFaceNone; + exports.Curve = Curve; + exports.CurvePath = CurvePath; + exports.CustomBlending = CustomBlending; + exports.CustomToneMapping = CustomToneMapping; + exports.CylinderBufferGeometry = CylinderBufferGeometry; + exports.CylinderGeometry = CylinderGeometry; exports.Cylindrical = Cylindrical; - exports.Plane = Plane; - exports.Frustum = Frustum; - exports.Sphere = Sphere; - exports.Ray = Ray; - exports.Matrix4 = Matrix4; - exports.Matrix3 = Matrix3; - exports.Box3 = Box3; - exports.Box2 = Box2; - exports.Line3 = Line3; - exports.Euler = Euler; - exports.Vector4 = Vector4; - exports.Vector3 = Vector3; - exports.Vector2 = Vector2; - exports.Quaternion = Quaternion; - exports.Color = Color; - exports.MorphBlendMesh = MorphBlendMesh; - exports.ImmediateRenderObject = ImmediateRenderObject; - exports.VertexNormalsHelper = VertexNormalsHelper; - exports.SpotLightHelper = SpotLightHelper; - exports.SkeletonHelper = SkeletonHelper; - exports.PointLightHelper = PointLightHelper; - exports.RectAreaLightHelper = RectAreaLightHelper; - exports.HemisphereLightHelper = HemisphereLightHelper; - exports.GridHelper = GridHelper; - exports.PolarGridHelper = PolarGridHelper; - exports.FaceNormalsHelper = FaceNormalsHelper; + exports.Data3DTexture = Data3DTexture; + exports.DataArrayTexture = DataArrayTexture; + exports.DataTexture = DataTexture; + exports.DataTextureLoader = DataTextureLoader; + exports.DataUtils = DataUtils; + exports.DecrementStencilOp = DecrementStencilOp; + exports.DecrementWrapStencilOp = DecrementWrapStencilOp; + exports.DefaultLoadingManager = DefaultLoadingManager; + exports.DepthFormat = DepthFormat; + exports.DepthStencilFormat = DepthStencilFormat; + exports.DepthTexture = DepthTexture; + exports.DirectionalLight = DirectionalLight; exports.DirectionalLightHelper = DirectionalLightHelper; - exports.CameraHelper = CameraHelper; - exports.BoxHelper = BoxHelper; - exports.ArrowHelper = ArrowHelper; - exports.AxisHelper = AxisHelper; - exports.CatmullRomCurve3 = CatmullRomCurve3; - exports.CubicBezierCurve3 = CubicBezierCurve3; - exports.QuadraticBezierCurve3 = QuadraticBezierCurve3; - exports.LineCurve3 = LineCurve3; - exports.ArcCurve = ArcCurve; + exports.DiscreteInterpolant = DiscreteInterpolant; + exports.DisplayP3ColorSpace = DisplayP3ColorSpace; + exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry; + exports.DodecahedronGeometry = DodecahedronGeometry; + exports.DoubleSide = DoubleSide; + exports.DstAlphaFactor = DstAlphaFactor; + exports.DstColorFactor = DstColorFactor; + exports.DynamicCopyUsage = DynamicCopyUsage; + exports.DynamicDrawUsage = DynamicDrawUsage; + exports.DynamicReadUsage = DynamicReadUsage; + exports.EdgesGeometry = EdgesGeometry; exports.EllipseCurve = EllipseCurve; - exports.SplineCurve = SplineCurve; - exports.CubicBezierCurve = CubicBezierCurve; - exports.QuadraticBezierCurve = QuadraticBezierCurve; - exports.LineCurve = LineCurve; - exports.Shape = Shape; - exports.Path = Path; - exports.ShapePath = ShapePath; - exports.Font = Font; - exports.CurvePath = CurvePath; - exports.Curve = Curve; - exports.ShapeUtils = ShapeUtils; - exports.SceneUtils = SceneUtils; - exports.WireframeGeometry = WireframeGeometry; - exports.ParametricGeometry = ParametricGeometry; - exports.ParametricBufferGeometry = ParametricBufferGeometry; - exports.TetrahedronGeometry = TetrahedronGeometry; - exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry; - exports.OctahedronGeometry = OctahedronGeometry; - exports.OctahedronBufferGeometry = OctahedronBufferGeometry; - exports.IcosahedronGeometry = IcosahedronGeometry; + exports.EqualCompare = EqualCompare; + exports.EqualDepth = EqualDepth; + exports.EqualStencilFunc = EqualStencilFunc; + exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping; + exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping; + exports.Euler = Euler; + exports.EventDispatcher = EventDispatcher; + exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry; + exports.ExtrudeGeometry = ExtrudeGeometry; + exports.FileLoader = FileLoader; + exports.Float16BufferAttribute = Float16BufferAttribute; + exports.Float32BufferAttribute = Float32BufferAttribute; + exports.Float64BufferAttribute = Float64BufferAttribute; + exports.FloatType = FloatType; + exports.Fog = Fog; + exports.FogExp2 = FogExp2; + exports.FramebufferTexture = FramebufferTexture; + exports.FrontSide = FrontSide; + exports.Frustum = Frustum; + exports.GLBufferAttribute = GLBufferAttribute; + exports.GLSL1 = GLSL1; + exports.GLSL3 = GLSL3; + exports.GreaterCompare = GreaterCompare; + exports.GreaterDepth = GreaterDepth; + exports.GreaterEqualCompare = GreaterEqualCompare; + exports.GreaterEqualDepth = GreaterEqualDepth; + exports.GreaterEqualStencilFunc = GreaterEqualStencilFunc; + exports.GreaterStencilFunc = GreaterStencilFunc; + exports.GridHelper = GridHelper; + exports.Group = Group; + exports.HalfFloatType = HalfFloatType; + exports.HemisphereLight = HemisphereLight; + exports.HemisphereLightHelper = HemisphereLightHelper; + exports.HemisphereLightProbe = HemisphereLightProbe; exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry; - exports.DodecahedronGeometry = DodecahedronGeometry; - exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry; - exports.PolyhedronGeometry = PolyhedronGeometry; - exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry; - exports.TubeGeometry = TubeGeometry; - exports.TubeBufferGeometry = TubeBufferGeometry; - exports.TorusKnotGeometry = TorusKnotGeometry; - exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry; - exports.TorusGeometry = TorusGeometry; - exports.TorusBufferGeometry = TorusBufferGeometry; - exports.TextGeometry = TextGeometry; - exports.TextBufferGeometry = TextBufferGeometry; - exports.SphereGeometry = SphereGeometry; - exports.SphereBufferGeometry = SphereBufferGeometry; - exports.RingGeometry = RingGeometry; - exports.RingBufferGeometry = RingBufferGeometry; - exports.PlaneGeometry = PlaneGeometry; - exports.PlaneBufferGeometry = PlaneBufferGeometry; - exports.LatheGeometry = LatheGeometry; + exports.IcosahedronGeometry = IcosahedronGeometry; + exports.ImageBitmapLoader = ImageBitmapLoader; + exports.ImageLoader = ImageLoader; + exports.ImageUtils = ImageUtils; + exports.IncrementStencilOp = IncrementStencilOp; + exports.IncrementWrapStencilOp = IncrementWrapStencilOp; + exports.InstancedBufferAttribute = InstancedBufferAttribute; + exports.InstancedBufferGeometry = InstancedBufferGeometry; + exports.InstancedInterleavedBuffer = InstancedInterleavedBuffer; + exports.InstancedMesh = InstancedMesh; + exports.Int16BufferAttribute = Int16BufferAttribute; + exports.Int32BufferAttribute = Int32BufferAttribute; + exports.Int8BufferAttribute = Int8BufferAttribute; + exports.IntType = IntType; + exports.InterleavedBuffer = InterleavedBuffer; + exports.InterleavedBufferAttribute = InterleavedBufferAttribute; + exports.Interpolant = Interpolant; + exports.InterpolateDiscrete = InterpolateDiscrete; + exports.InterpolateLinear = InterpolateLinear; + exports.InterpolateSmooth = InterpolateSmooth; + exports.InvertStencilOp = InvertStencilOp; + exports.KeepStencilOp = KeepStencilOp; + exports.KeyframeTrack = KeyframeTrack; + exports.LOD = LOD; exports.LatheBufferGeometry = LatheBufferGeometry; - exports.ShapeGeometry = ShapeGeometry; - exports.ShapeBufferGeometry = ShapeBufferGeometry; - exports.ExtrudeGeometry = ExtrudeGeometry; - exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry; - exports.EdgesGeometry = EdgesGeometry; - exports.ConeGeometry = ConeGeometry; - exports.ConeBufferGeometry = ConeBufferGeometry; - exports.CylinderGeometry = CylinderGeometry; - exports.CylinderBufferGeometry = CylinderBufferGeometry; - exports.CircleGeometry = CircleGeometry; - exports.CircleBufferGeometry = CircleBufferGeometry; - exports.BoxGeometry = BoxGeometry; - exports.BoxBufferGeometry = BoxBufferGeometry; - exports.ShadowMaterial = ShadowMaterial; - exports.SpriteMaterial = SpriteMaterial; - exports.RawShaderMaterial = RawShaderMaterial; - exports.ShaderMaterial = ShaderMaterial; - exports.PointsMaterial = PointsMaterial; + exports.LatheGeometry = LatheGeometry; + exports.Layers = Layers; + exports.LessCompare = LessCompare; + exports.LessDepth = LessDepth; + exports.LessEqualCompare = LessEqualCompare; + exports.LessEqualDepth = LessEqualDepth; + exports.LessEqualStencilFunc = LessEqualStencilFunc; + exports.LessStencilFunc = LessStencilFunc; + exports.Light = Light; + exports.LightProbe = LightProbe; + exports.Line = Line; + exports.Line3 = Line3; + exports.LineBasicMaterial = LineBasicMaterial; + exports.LineCurve = LineCurve; + exports.LineCurve3 = LineCurve3; + exports.LineDashedMaterial = LineDashedMaterial; + exports.LineLoop = LineLoop; + exports.LineSegments = LineSegments; + exports.LinearEncoding = LinearEncoding; + exports.LinearFilter = LinearFilter; + exports.LinearInterpolant = LinearInterpolant; + exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter; + exports.LinearMipMapNearestFilter = LinearMipMapNearestFilter; + exports.LinearMipmapLinearFilter = LinearMipmapLinearFilter; + exports.LinearMipmapNearestFilter = LinearMipmapNearestFilter; + exports.LinearSRGBColorSpace = LinearSRGBColorSpace; + exports.LinearToneMapping = LinearToneMapping; + exports.Loader = Loader; + exports.LoaderUtils = LoaderUtils; + exports.LoadingManager = LoadingManager; + exports.LoopOnce = LoopOnce; + exports.LoopPingPong = LoopPingPong; + exports.LoopRepeat = LoopRepeat; + exports.LuminanceAlphaFormat = LuminanceAlphaFormat; + exports.LuminanceFormat = LuminanceFormat; + exports.MOUSE = MOUSE; + exports.Material = Material; + exports.MaterialLoader = MaterialLoader; + exports.MathUtils = MathUtils; + exports.Matrix3 = Matrix3; + exports.Matrix4 = Matrix4; + exports.MaxEquation = MaxEquation; + exports.Mesh = Mesh; + exports.MeshBasicMaterial = MeshBasicMaterial; + exports.MeshDepthMaterial = MeshDepthMaterial; + exports.MeshDistanceMaterial = MeshDistanceMaterial; + exports.MeshLambertMaterial = MeshLambertMaterial; + exports.MeshMatcapMaterial = MeshMatcapMaterial; + exports.MeshNormalMaterial = MeshNormalMaterial; + exports.MeshPhongMaterial = MeshPhongMaterial; exports.MeshPhysicalMaterial = MeshPhysicalMaterial; exports.MeshStandardMaterial = MeshStandardMaterial; - exports.MeshPhongMaterial = MeshPhongMaterial; exports.MeshToonMaterial = MeshToonMaterial; - exports.MeshNormalMaterial = MeshNormalMaterial; - exports.MeshLambertMaterial = MeshLambertMaterial; - exports.MeshDepthMaterial = MeshDepthMaterial; - exports.MeshBasicMaterial = MeshBasicMaterial; - exports.LineDashedMaterial = LineDashedMaterial; - exports.LineBasicMaterial = LineBasicMaterial; - exports.Material = Material; - exports.Float64BufferAttribute = Float64BufferAttribute; - exports.Float32BufferAttribute = Float32BufferAttribute; - exports.Uint32BufferAttribute = Uint32BufferAttribute; - exports.Int32BufferAttribute = Int32BufferAttribute; - exports.Uint16BufferAttribute = Uint16BufferAttribute; - exports.Int16BufferAttribute = Int16BufferAttribute; - exports.Uint8ClampedBufferAttribute = Uint8ClampedBufferAttribute; - exports.Uint8BufferAttribute = Uint8BufferAttribute; - exports.Int8BufferAttribute = Int8BufferAttribute; - exports.BufferAttribute = BufferAttribute; - exports.REVISION = REVISION; - exports.MOUSE = MOUSE; - exports.CullFaceNone = CullFaceNone; - exports.CullFaceBack = CullFaceBack; - exports.CullFaceFront = CullFaceFront; - exports.CullFaceFrontBack = CullFaceFrontBack; - exports.FrontFaceDirectionCW = FrontFaceDirectionCW; - exports.FrontFaceDirectionCCW = FrontFaceDirectionCCW; - exports.BasicShadowMap = BasicShadowMap; - exports.PCFShadowMap = PCFShadowMap; - exports.PCFSoftShadowMap = PCFSoftShadowMap; - exports.FrontSide = FrontSide; - exports.BackSide = BackSide; - exports.DoubleSide = DoubleSide; - exports.FlatShading = FlatShading; - exports.SmoothShading = SmoothShading; - exports.NoColors = NoColors; - exports.FaceColors = FaceColors; - exports.VertexColors = VertexColors; + exports.MinEquation = MinEquation; + exports.MirroredRepeatWrapping = MirroredRepeatWrapping; + exports.MixOperation = MixOperation; + exports.MultiplyBlending = MultiplyBlending; + exports.MultiplyOperation = MultiplyOperation; + exports.NearestFilter = NearestFilter; + exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter; + exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter; + exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter; + exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter; + exports.NeverCompare = NeverCompare; + exports.NeverDepth = NeverDepth; + exports.NeverStencilFunc = NeverStencilFunc; exports.NoBlending = NoBlending; + exports.NoColorSpace = NoColorSpace; + exports.NoToneMapping = NoToneMapping; + exports.NormalAnimationBlendMode = NormalAnimationBlendMode; exports.NormalBlending = NormalBlending; - exports.AdditiveBlending = AdditiveBlending; - exports.SubtractiveBlending = SubtractiveBlending; - exports.MultiplyBlending = MultiplyBlending; - exports.CustomBlending = CustomBlending; - exports.AddEquation = AddEquation; - exports.SubtractEquation = SubtractEquation; - exports.ReverseSubtractEquation = ReverseSubtractEquation; - exports.MinEquation = MinEquation; - exports.MaxEquation = MaxEquation; - exports.ZeroFactor = ZeroFactor; + exports.NotEqualCompare = NotEqualCompare; + exports.NotEqualDepth = NotEqualDepth; + exports.NotEqualStencilFunc = NotEqualStencilFunc; + exports.NumberKeyframeTrack = NumberKeyframeTrack; + exports.Object3D = Object3D; + exports.ObjectLoader = ObjectLoader; + exports.ObjectSpaceNormalMap = ObjectSpaceNormalMap; + exports.OctahedronBufferGeometry = OctahedronBufferGeometry; + exports.OctahedronGeometry = OctahedronGeometry; exports.OneFactor = OneFactor; - exports.SrcColorFactor = SrcColorFactor; - exports.OneMinusSrcColorFactor = OneMinusSrcColorFactor; - exports.SrcAlphaFactor = SrcAlphaFactor; - exports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor; - exports.DstAlphaFactor = DstAlphaFactor; exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor; - exports.DstColorFactor = DstColorFactor; exports.OneMinusDstColorFactor = OneMinusDstColorFactor; - exports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor; - exports.NeverDepth = NeverDepth; - exports.AlwaysDepth = AlwaysDepth; - exports.LessDepth = LessDepth; - exports.LessEqualDepth = LessEqualDepth; - exports.EqualDepth = EqualDepth; - exports.GreaterEqualDepth = GreaterEqualDepth; - exports.GreaterDepth = GreaterDepth; - exports.NotEqualDepth = NotEqualDepth; - exports.MultiplyOperation = MultiplyOperation; - exports.MixOperation = MixOperation; - exports.AddOperation = AddOperation; - exports.NoToneMapping = NoToneMapping; - exports.LinearToneMapping = LinearToneMapping; + exports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor; + exports.OneMinusSrcColorFactor = OneMinusSrcColorFactor; + exports.OrthographicCamera = OrthographicCamera; + exports.PCFShadowMap = PCFShadowMap; + exports.PCFSoftShadowMap = PCFSoftShadowMap; + exports.PMREMGenerator = PMREMGenerator; + exports.Path = Path; + exports.PerspectiveCamera = PerspectiveCamera; + exports.Plane = Plane; + exports.PlaneBufferGeometry = PlaneBufferGeometry; + exports.PlaneGeometry = PlaneGeometry; + exports.PlaneHelper = PlaneHelper; + exports.PointLight = PointLight; + exports.PointLightHelper = PointLightHelper; + exports.Points = Points; + exports.PointsMaterial = PointsMaterial; + exports.PolarGridHelper = PolarGridHelper; + exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry; + exports.PolyhedronGeometry = PolyhedronGeometry; + exports.PositionalAudio = PositionalAudio; + exports.PropertyBinding = PropertyBinding; + exports.PropertyMixer = PropertyMixer; + exports.QuadraticBezierCurve = QuadraticBezierCurve; + exports.QuadraticBezierCurve3 = QuadraticBezierCurve3; + exports.Quaternion = Quaternion; + exports.QuaternionKeyframeTrack = QuaternionKeyframeTrack; + exports.QuaternionLinearInterpolant = QuaternionLinearInterpolant; + exports.RED_GREEN_RGTC2_Format = RED_GREEN_RGTC2_Format; + exports.RED_RGTC1_Format = RED_RGTC1_Format; + exports.REVISION = REVISION; + exports.RGBADepthPacking = RGBADepthPacking; + exports.RGBAFormat = RGBAFormat; + exports.RGBAIntegerFormat = RGBAIntegerFormat; + exports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format; + exports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format; + exports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format; + exports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format; + exports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format; + exports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format; + exports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format; + exports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format; + exports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format; + exports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format; + exports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format; + exports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format; + exports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format; + exports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format; + exports.RGBA_BPTC_Format = RGBA_BPTC_Format; + exports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format; + exports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format; + exports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format; + exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format; + exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format; + exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format; + exports.RGB_ETC1_Format = RGB_ETC1_Format; + exports.RGB_ETC2_Format = RGB_ETC2_Format; + exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format; + exports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format; + exports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format; + exports.RGFormat = RGFormat; + exports.RGIntegerFormat = RGIntegerFormat; + exports.RawShaderMaterial = RawShaderMaterial; + exports.Ray = Ray; + exports.Raycaster = Raycaster; + exports.RectAreaLight = RectAreaLight; + exports.RedFormat = RedFormat; + exports.RedIntegerFormat = RedIntegerFormat; exports.ReinhardToneMapping = ReinhardToneMapping; - exports.Uncharted2ToneMapping = Uncharted2ToneMapping; - exports.CineonToneMapping = CineonToneMapping; - exports.UVMapping = UVMapping; - exports.CubeReflectionMapping = CubeReflectionMapping; - exports.CubeRefractionMapping = CubeRefractionMapping; - exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping; - exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping; - exports.SphericalReflectionMapping = SphericalReflectionMapping; - exports.CubeUVReflectionMapping = CubeUVReflectionMapping; - exports.CubeUVRefractionMapping = CubeUVRefractionMapping; exports.RepeatWrapping = RepeatWrapping; - exports.ClampToEdgeWrapping = ClampToEdgeWrapping; - exports.MirroredRepeatWrapping = MirroredRepeatWrapping; - exports.NearestFilter = NearestFilter; - exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter; - exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter; - exports.LinearFilter = LinearFilter; - exports.LinearMipMapNearestFilter = LinearMipMapNearestFilter; - exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter; - exports.UnsignedByteType = UnsignedByteType; - exports.ByteType = ByteType; + exports.ReplaceStencilOp = ReplaceStencilOp; + exports.ReverseSubtractEquation = ReverseSubtractEquation; + exports.RingBufferGeometry = RingBufferGeometry; + exports.RingGeometry = RingGeometry; + exports.SIGNED_RED_GREEN_RGTC2_Format = SIGNED_RED_GREEN_RGTC2_Format; + exports.SIGNED_RED_RGTC1_Format = SIGNED_RED_RGTC1_Format; + exports.SRGBColorSpace = SRGBColorSpace; + exports.Scene = Scene; + exports.ShaderChunk = ShaderChunk; + exports.ShaderLib = ShaderLib; + exports.ShaderMaterial = ShaderMaterial; + exports.ShadowMaterial = ShadowMaterial; + exports.Shape = Shape; + exports.ShapeBufferGeometry = ShapeBufferGeometry; + exports.ShapeGeometry = ShapeGeometry; + exports.ShapePath = ShapePath; + exports.ShapeUtils = ShapeUtils; exports.ShortType = ShortType; - exports.UnsignedShortType = UnsignedShortType; - exports.IntType = IntType; + exports.Skeleton = Skeleton; + exports.SkeletonHelper = SkeletonHelper; + exports.SkinnedMesh = SkinnedMesh; + exports.Source = Source; + exports.Sphere = Sphere; + exports.SphereBufferGeometry = SphereBufferGeometry; + exports.SphereGeometry = SphereGeometry; + exports.Spherical = Spherical; + exports.SphericalHarmonics3 = SphericalHarmonics3; + exports.SplineCurve = SplineCurve; + exports.SpotLight = SpotLight; + exports.SpotLightHelper = SpotLightHelper; + exports.Sprite = Sprite; + exports.SpriteMaterial = SpriteMaterial; + exports.SrcAlphaFactor = SrcAlphaFactor; + exports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor; + exports.SrcColorFactor = SrcColorFactor; + exports.StaticCopyUsage = StaticCopyUsage; + exports.StaticDrawUsage = StaticDrawUsage; + exports.StaticReadUsage = StaticReadUsage; + exports.StereoCamera = StereoCamera; + exports.StreamCopyUsage = StreamCopyUsage; + exports.StreamDrawUsage = StreamDrawUsage; + exports.StreamReadUsage = StreamReadUsage; + exports.StringKeyframeTrack = StringKeyframeTrack; + exports.SubtractEquation = SubtractEquation; + exports.SubtractiveBlending = SubtractiveBlending; + exports.TOUCH = TOUCH; + exports.TangentSpaceNormalMap = TangentSpaceNormalMap; + exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry; + exports.TetrahedronGeometry = TetrahedronGeometry; + exports.Texture = Texture; + exports.TextureLoader = TextureLoader; + exports.TorusBufferGeometry = TorusBufferGeometry; + exports.TorusGeometry = TorusGeometry; + exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry; + exports.TorusKnotGeometry = TorusKnotGeometry; + exports.Triangle = Triangle; + exports.TriangleFanDrawMode = TriangleFanDrawMode; + exports.TriangleStripDrawMode = TriangleStripDrawMode; + exports.TrianglesDrawMode = TrianglesDrawMode; + exports.TubeBufferGeometry = TubeBufferGeometry; + exports.TubeGeometry = TubeGeometry; + exports.TwoPassDoubleSide = TwoPassDoubleSide; + exports.UVMapping = UVMapping; + exports.Uint16BufferAttribute = Uint16BufferAttribute; + exports.Uint32BufferAttribute = Uint32BufferAttribute; + exports.Uint8BufferAttribute = Uint8BufferAttribute; + exports.Uint8ClampedBufferAttribute = Uint8ClampedBufferAttribute; + exports.Uniform = Uniform; + exports.UniformsGroup = UniformsGroup; + exports.UniformsLib = UniformsLib; + exports.UniformsUtils = UniformsUtils; + exports.UnsignedByteType = UnsignedByteType; + exports.UnsignedInt248Type = UnsignedInt248Type; exports.UnsignedIntType = UnsignedIntType; - exports.FloatType = FloatType; - exports.HalfFloatType = HalfFloatType; exports.UnsignedShort4444Type = UnsignedShort4444Type; exports.UnsignedShort5551Type = UnsignedShort5551Type; - exports.UnsignedShort565Type = UnsignedShort565Type; - exports.UnsignedInt248Type = UnsignedInt248Type; - exports.AlphaFormat = AlphaFormat; - exports.RGBFormat = RGBFormat; - exports.RGBAFormat = RGBAFormat; - exports.LuminanceFormat = LuminanceFormat; - exports.LuminanceAlphaFormat = LuminanceAlphaFormat; - exports.RGBEFormat = RGBEFormat; - exports.DepthFormat = DepthFormat; - exports.DepthStencilFormat = DepthStencilFormat; - exports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format; - exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format; - exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format; - exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format; - exports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format; - exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format; - exports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format; - exports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format; - exports.RGB_ETC1_Format = RGB_ETC1_Format; - exports.LoopOnce = LoopOnce; - exports.LoopRepeat = LoopRepeat; - exports.LoopPingPong = LoopPingPong; - exports.InterpolateDiscrete = InterpolateDiscrete; - exports.InterpolateLinear = InterpolateLinear; - exports.InterpolateSmooth = InterpolateSmooth; + exports.UnsignedShortType = UnsignedShortType; + exports.VSMShadowMap = VSMShadowMap; + exports.Vector2 = Vector2; + exports.Vector3 = Vector3; + exports.Vector4 = Vector4; + exports.VectorKeyframeTrack = VectorKeyframeTrack; + exports.VideoTexture = VideoTexture; + exports.WebGL1Renderer = WebGL1Renderer; + exports.WebGL3DRenderTarget = WebGL3DRenderTarget; + exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget; + exports.WebGLCoordinateSystem = WebGLCoordinateSystem; + exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget; + exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets; + exports.WebGLRenderTarget = WebGLRenderTarget; + exports.WebGLRenderer = WebGLRenderer; + exports.WebGLUtils = WebGLUtils; + exports.WebGPUCoordinateSystem = WebGPUCoordinateSystem; + exports.WireframeGeometry = WireframeGeometry; + exports.WrapAroundEnding = WrapAroundEnding; exports.ZeroCurvatureEnding = ZeroCurvatureEnding; + exports.ZeroFactor = ZeroFactor; exports.ZeroSlopeEnding = ZeroSlopeEnding; - exports.WrapAroundEnding = WrapAroundEnding; - exports.TrianglesDrawMode = TrianglesDrawMode; - exports.TriangleStripDrawMode = TriangleStripDrawMode; - exports.TriangleFanDrawMode = TriangleFanDrawMode; - exports.LinearEncoding = LinearEncoding; + exports.ZeroStencilOp = ZeroStencilOp; + exports._SRGBAFormat = _SRGBAFormat; exports.sRGBEncoding = sRGBEncoding; - exports.GammaEncoding = GammaEncoding; - exports.RGBEEncoding = RGBEEncoding; - exports.LogLuvEncoding = LogLuvEncoding; - exports.RGBM7Encoding = RGBM7Encoding; - exports.RGBM16Encoding = RGBM16Encoding; - exports.RGBDEncoding = RGBDEncoding; - exports.BasicDepthPacking = BasicDepthPacking; - exports.RGBADepthPacking = RGBADepthPacking; - exports.CubeGeometry = BoxGeometry; - exports.Face4 = Face4; - exports.LineStrip = LineStrip; - exports.LinePieces = LinePieces; - exports.MeshFaceMaterial = MeshFaceMaterial; - exports.MultiMaterial = MultiMaterial; - exports.PointCloud = PointCloud; - exports.Particle = Particle; - exports.ParticleSystem = ParticleSystem; - exports.PointCloudMaterial = PointCloudMaterial; - exports.ParticleBasicMaterial = ParticleBasicMaterial; - exports.ParticleSystemMaterial = ParticleSystemMaterial; - exports.Vertex = Vertex; - exports.DynamicBufferAttribute = DynamicBufferAttribute; - exports.Int8Attribute = Int8Attribute; - exports.Uint8Attribute = Uint8Attribute; - exports.Uint8ClampedAttribute = Uint8ClampedAttribute; - exports.Int16Attribute = Int16Attribute; - exports.Uint16Attribute = Uint16Attribute; - exports.Int32Attribute = Int32Attribute; - exports.Uint32Attribute = Uint32Attribute; - exports.Float32Attribute = Float32Attribute; - exports.Float64Attribute = Float64Attribute; - exports.ClosedSplineCurve3 = ClosedSplineCurve3; - exports.SplineCurve3 = SplineCurve3; - exports.Spline = Spline; - exports.BoundingBoxHelper = BoundingBoxHelper; - exports.EdgesHelper = EdgesHelper; - exports.WireframeHelper = WireframeHelper; - exports.XHRLoader = XHRLoader; - exports.BinaryTextureLoader = BinaryTextureLoader; - exports.GeometryUtils = GeometryUtils; - exports.ImageUtils = ImageUtils; - exports.Projector = Projector; - exports.CanvasRenderer = CanvasRenderer; - - Object.defineProperty(exports, '__esModule', { value: true }); -}))); +})); diff --git a/public/lib/three/three.min.js b/public/lib/three/three.min.js index 53918b9f..0ed6ce98 100644 --- a/public/lib/three/three.min.js +++ b/public/lib/three/three.min.js @@ -1,871 +1,7 @@ - -// threejs.org/license -'use strict';var THREE={REVISION:"73"};"function"===typeof define&&define.amd?define("three",THREE):"undefined"!==typeof exports&&"undefined"!==typeof module&&(module.exports=THREE); -void 0!==self.requestAnimationFrame&&void 0!==self.cancelAnimationFrame||function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;ca?-1:0>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b, -c,d){b=THREE.Math.euclideanModulo(b,1);c=THREE.Math.clamp(c,0,1);d=THREE.Math.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r= -Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){var d=parseFloat(c[1])/ -360,e=parseInt(c[2],10)/100,g=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,g)}}}else if(c=/^\#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}a&&0=h?l/(e+g): -l/(2-e-g);switch(e){case b:f=(c-d)/l+(cg&&c>b?(c=2*Math.sqrt(1+c-g-b),this._w=(l-f)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):g>b?(c=2*Math.sqrt(1+g-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= -.25*c,this._z=(f+l)/c):(c=2*Math.sqrt(1+b-c-g),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(f+l)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= --1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, -multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,g=a._w,f=b._x,h=b._y,l=b._z,k=b._w;this._x=c*k+g*f+d*l-e*h;this._y=d*k+g*h+e*f-c*l;this._z=e*k+g*l+c*h-d*f;this._w=g*k-c*f-d*h-e*l;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); -return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,g=this._w,f=g*a._w+c*a._x+d*a._y+e*a._z;0>f?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,f=-f):this.copy(a);if(1<=f)return this._w=g,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(f),l=Math.sqrt(1-f*f);if(.001>Math.abs(l))return this._w=.5*(g+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;f=Math.sin((1-b)*h)/l;h= -Math.sin(b*h)/l;this._w=g*f+this._w*h;this._x=c*f+this._x*h;this._y=d*f+this._y*h;this._z=e*f+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback= -a;return this},onChangeCallback:function(){}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x},set width(a){this.x=a},get height(){return this.y},set height(a){this.y=a},set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+ -a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this}, -sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a):this.y=this.x=0;return this},divide:function(a){this.x/=a.x; -this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a, -b)}}(),clampLength:function(a,b){var c=this.length();this.multiplyScalar(Math.max(a,Math.min(b,c))/c);return this},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x= --this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.multiplyScalar(a/ -this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){this.subVectors(b,a).multiplyScalar(c).add(a);return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y= -a.array[b+1];return this},rotateAround:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=this.x-a.x,g=this.y-a.y;this.x=e*c-g*d+a.x;this.y=e*d+g*c+a.y;return this}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ -a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a, -b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), -this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b)); -return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14]; -return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,g=a.y,f=a.z;a=a.w;var h=a*b+g*d-f*c,l=a*c+f*b-e*d,k=a*d+e*c-g*b,b=-e*b-g*c-f*d;this.x=h*a+b*-e+l*-f-k*-g;this.y=l*a+b*-g+k*-e-h*-f;this.z=k*a+b*-f+h*-g-l*-e;return this},project:function(){var a; -return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize(); -return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z, -this.z));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();this.multiplyScalar(Math.max(a,Math.min(b,c))/c);return this},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}, -round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z}, -length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.multiplyScalar(a/this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){this.subVectors(b,a).multiplyScalar(c).add(a);return this},cross:function(a,b){if(void 0!== -b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,g=b.x,f=b.y,h=b.z;this.x=d*h-e*f;this.y=e*g-c*h;this.z=c*f-d*g;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(), -projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c= -this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)}, -getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0], -a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0=== -a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];return this}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; -case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this}, -addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-= -a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a,this.z*=a,this.w*=a):this.w=this.z=this.y=this.x=0;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this}, -divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var g=a[8],f=a[1],h=a[5],l=a[9];c=a[2];b=a[6];var k=a[10];if(.01>Math.abs(d-f)&&.01>Math.abs(g-c)&&.01>Math.abs(l-b)){if(.1>Math.abs(d+f)&&.1>Math.abs(g+c)&&.1>Math.abs(l+b)&&.1>Math.abs(e+ -h+k-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;k=(k+1)/2;d=(d+f)/4;g=(g+c)/4;l=(l+b)/4;e>h&&e>k?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=g/b):h>k?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),b=d/c,d=l/c):.01>k?(c=b=.707106781,d=0):(d=Math.sqrt(k),b=g/d,c=l/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-l)*(b-l)+(g-c)*(g-c)+(f-d)*(f-d));.001>Math.abs(a)&&(a=1);this.x=(b-l)/a;this.y=(g-c)/a;this.z=(f-d)/a;this.w=Math.acos((e+h+k-1)/2);return this},min:function(a){this.x= -Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w,this.w));return this},clampScalar:function(){var a,b;return function(c, -d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this}, -roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.multiplyScalar(a/this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){this.subVectors(b,a).multiplyScalar(c).add(a);return this},equals:function(a){return a.x=== -this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this}}; -THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; -THREE.Euler.prototype={constructor:THREE.Euler,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x, -this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var g=e[4],f=e[8],h=e[1],l=e[5],k=e[9],m=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(-k,e),this._z=Math.atan2(-g,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)? -(this._y=Math.atan2(f,e),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-m,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-m,e),this._z=Math.atan2(-g,l)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-g,l))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-k,l),this._y=Math.atan2(-m,a)):(this._x= -0,this._y=Math.atan2(f,e))):"XZY"===b?(this._z=Math.asin(-d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(p,l),this._y=Math.atan2(f,a)):(this._x=Math.atan2(-k,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a, -b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+ -3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; -THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)}, -at:function(a,b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); -this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; -THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y -this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& -a.max.equals(this.max)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; -THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x- -this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a= -new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y, -this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a); -this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0this.determinant()&&(f=-f);c.x=g[12];c.y=g[13];c.z=g[14];b.elements.set(this.elements);c=1/f;var g=1/h,k=1/l;b.elements[0]*=c;b.elements[1]*= -c;b.elements[2]*=c;b.elements[4]*=g;b.elements[5]*=g;b.elements[6]*=g;b.elements[8]*=k;b.elements[9]*=k;b.elements[10]*=k;d.setFromRotationMatrix(b);e.x=f;e.y=h;e.z=l;return this}}(),makeFrustum:function(a,b,c,d,e,g){var f=this.elements;f[0]=2*e/(b-a);f[4]=0;f[8]=(b+a)/(b-a);f[12]=0;f[1]=0;f[5]=2*e/(d-c);f[9]=(d+c)/(d-c);f[13]=0;f[2]=0;f[6]=0;f[10]=-(g+e)/(g-e);f[14]=-2*g*e/(g-e);f[3]=0;f[7]=0;f[11]=-1;f[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a)); -var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,g){var f=this.elements,h=b-a,l=c-d,k=g-e;f[0]=2/h;f[4]=0;f[8]=0;f[12]=-((b+a)/h);f[1]=0;f[5]=2/l;f[9]=0;f[13]=-((c+d)/l);f[2]=0;f[6]=0;f[10]=-2/k;f[14]=-((g+e)/k);f[3]=0;f[7]=0;f[11]=0;f[15]=1;return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0], -a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; -THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a, -b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(), -distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),l=-this.direction.dot(b),k=c.dot(this.direction),m=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-l*l),q;0=-q?e<=q?(h=1/n,d*=h,e*=h,l=d*(d+l*e+2*k)+e*(l*d+e+2*m)+p):(e=h,d=Math.max(0,-(l*e+k)),l=-d*d+e*(e+2*m)+p):(e=-h,d=Math.max(0,-(l*e+k)), -l=-d*d+e*(e+2*m)+p):e<=-q?(d=Math.max(0,-(-l*h+k)),e=0g)return null;g=Math.sqrt(g-e);e=d-g;d+=g;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+ -a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,g,f;d=1/this.direction.x;g=1/this.direction.y;f=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=g?(e=(a.min.y-h.y)*g,g*=a.max.y-h.y):(e=(a.max.y-h.y)*g,g*=a.min.y- -h.y);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(gf||e>d)return null;if(e>c||c!==c)c=e;if(fd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,g,f,h,l){b.subVectors(g,e);c.subVectors(f,e);d.crossVectors(b,c);g=this.direction.dot(d);if(0g)h=-1, -g=-g;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;f=h*this.direction.dot(b.cross(a));if(0>f||e+f>g)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/g,l)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}}; -THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; -THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,g=0,f=b.length;g=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center)); -return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}}; -THREE.Frustum=function(a,b,c,d,e,g){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==g?g:new THREE.Plane]}; -THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],g=c[3],f=c[4],h=c[5],l=c[6],k=c[7],m=c[8],p=c[9],n=c[10],q=c[11],s=c[12],t=c[13],v=c[14], -c=c[15];b[0].setComponents(g-a,k-f,q-m,c-s).normalize();b[1].setComponents(g+a,k+f,q+m,c+s).normalize();b[2].setComponents(g+d,k+h,q+p,c+t).normalize();b[3].setComponents(g-d,k-h,q-p,c-t).normalize();b[4].setComponents(g-e,k-l,q-n,c-v).normalize();b[5].setComponents(g+e,k+l,q+n,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld); -return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var g=d[e];a.x=0f&&0>g)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; -THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, -c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a, -b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0g||1e;e++)8===e||13===e||18===e||23===e?b[e]="-":14===e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19===e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a, -b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(), -radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nearestPowerOfTwo:function(a){return Math.pow(2,Math.round(Math.log(a)/Math.LN2))},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}}; -THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,l,k,m,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+ -2;k=this.points[c[0]];m=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=f*f;l=f*h;d.x=b(k.x,m.x,p.x,n.x,f,h,l);d.y=b(k.y,m.y,p.y,n.y,f,h,l);d.z=b(k.z,m.z,p.z,n.z,f,h,l);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); -THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a, -this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)}, -equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}};THREE.Channels=function(){this.mask=1};THREE.Channels.prototype={constructor:THREE.Channels,set:function(a){this.mask=1<d;d++)if(e[d]===e[(d+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e, -1),c=0,f=this.faceVertexUvs.length;cthis.duration)for(a=0;a=e.referenceCount&&(e.unbind(),delete this.propertyBindingMap[d])}return this},findActionByName:function(a){for(var b=0;b=c.weight)&&c.enabled)for(var g=0;gc?a:b},lerp_boolean_immediate:function(a,b,c){return a},lerp_string:function(a,b,c){return.5>c?a:b},lerp_string_immediate:function(a,b,c){return a},getLerpFunc:function(a,b){if(void 0===a||null===a)throw Error("examplarValue is null");switch(typeof a){case "object":if(a.lerp)return THREE.AnimationUtils.lerp_object;if(a.slerp)return THREE.AnimationUtils.slerp_object;break;case "number":return THREE.AnimationUtils.lerp_number;case "boolean":return b?THREE.AnimationUtils.lerp_boolean:THREE.AnimationUtils.lerp_boolean_immediate; -case "string":return b?THREE.AnimationUtils.lerp_string:THREE.AnimationUtils.lerp_string_immediate}}};THREE.KeyframeTrack=function(a,b){if(void 0===a)throw Error("track name is undefined");if(void 0===b||0===b.length)throw Error("no keys in track named "+a);this.name=a;this.keys=b;this.lastIndex=0;this.validate();this.optimize()}; -THREE.KeyframeTrack.prototype={constructor:THREE.KeyframeTrack,getAt:function(a){for(;this.lastIndex=this.keys[this.lastIndex].time;)this.lastIndex++;for(;0=this.keys.length)return this.setResult(this.keys[this.keys.length-1].value),this.result;if(0===this.lastIndex)return this.setResult(this.keys[0].value),this.result;var b=this.keys[this.lastIndex-1];this.setResult(b.value);if(b.constantToNext)return this.result; -var c=this.keys[this.lastIndex];return this.result=this.lerpValues(this.result,c.value,(a-b.time)/(c.time-b.time))},shift:function(a){if(0!==a)for(var b=0;b=b)e++;else break;0c.time){console.error(" key.time is less than previous key time, out of order keys", -this,b,c,a);return}a=c}return this}},optimize:function(){var a=[],b=this.keys[0];a.push(b);THREE.AnimationUtils.getEqualsFunc(b.value);for(var c=1;cthis.cumulativeWeight){var a= -1-this.cumulativeWeight;this.cumulativeValue=this.lerpValue(this.cumulativeValue,this.originalValue,a/(this.cumulativeWeight+a))}this.setValue(this.cumulativeValue)&&this.triggerDirty&&this.triggerDirty();this.cumulativeValue=null;this.cumulativeWeight=0}}}; -THREE.PropertyBinding.parseTrackName=function(a){var b=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,c=b.exec(a);if(!c)throw Error("cannot parse trackName at all: "+a);c.index===b.lastIndex&&b.lastIndex++;b={directoryName:c[1],nodeName:c[3],objectName:c[5],objectIndex:c[7],propertyName:c[9],propertyIndex:c[11]};if(null===b.propertyName||0===b.propertyName.length)throw Error("can not parse propertyName from trackName: "+a);return b}; -THREE.PropertyBinding.findNode=function(a,b){function c(a){for(var c=0;cc?a:b};THREE.StringKeyframeTrack.prototype.compareValues=function(a,b){return a===b};THREE.StringKeyframeTrack.prototype.clone=function(){for(var a=[],b=0;bc?a:b};THREE.BooleanKeyframeTrack.prototype.compareValues=function(a,b){return a===b};THREE.BooleanKeyframeTrack.prototype.clone=function(){for(var a=[],b=0;bl.opacity&&(l.transparent=!0);c.setTextures(h);return c.parse(l)}}()};THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;cf;f++)n=w[l++],u=v[2*n],n=v[2*n+1],u=new THREE.Vector2(u,n),2!==f&&c.faceVertexUvs[d][h].push(u),0!==f&&c.faceVertexUvs[d][h+1].push(u);p&&(p=3*w[l++],q.normal.set(D[p++],D[p++],D[p]),t.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*w[l++],s=new THREE.Vector3(D[p++],D[p++],D[p]),2!==d&&q.vertexNormals.push(s),0!==d&&t.vertexNormals.push(s); -m&&(m=w[l++],m=x[m],q.color.setHex(m),t.color.setHex(m));if(b)for(d=0;4>d;d++)m=w[l++],m=x[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&t.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(t)}else{q=new THREE.Face3;q.a=w[l++];q.b=w[l++];q.c=w[l++];h&&(h=w[l++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;df;f++)n=w[l++],u=v[2*n],n=v[2*n+1],u=new THREE.Vector2(u,n),c.faceVertexUvs[d][h].push(u);p&&(p=3*w[l++],q.normal.set(D[p++], -D[p++],D[p]));if(s)for(d=0;3>d;d++)p=3*w[l++],s=new THREE.Vector3(D[p++],D[p++],D[p]),q.vertexNormals.push(s);m&&(m=w[l++],q.color.setHex(x[m]));if(b)for(d=0;3>d;d++)m=w[l++],q.vertexColors.push(new THREE.Color(x[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;dthis.opacity&&(b.opacity=this.opacity);!0===this.transparent&&(b.transparent=this.transparent);0a.x||1a.x?0:1;break;case THREE.MirroredRepeatWrapping:1===Math.abs(Math.floor(a.x)%2)?a.x=Math.ceil(a.x)-a.x:a.x-=Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case THREE.MirroredRepeatWrapping:1===Math.abs(Math.floor(a.y)% -2)?a.y=Math.ceil(a.y)-a.y:a.y-=Math.floor(a.y)}this.flipY&&(a.y=1-a.y)}}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CanvasTexture=function(a,b,c,d,e,g,f,h,l){THREE.Texture.call(this,a,b,c,d,e,g,f,h,l);this.needsUpdate=!0};THREE.CanvasTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CanvasTexture.prototype.constructor=THREE.CanvasTexture; -THREE.CubeTexture=function(a,b,c,d,e,g,f,h,l){b=void 0!==b?b:THREE.CubeReflectionMapping;THREE.Texture.call(this,a,b,c,d,e,g,f,h,l);this.images=a;this.flipY=!1};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.prototype.copy=function(a){THREE.Texture.prototype.copy.call(this,a);this.images=a.images;return this}; -THREE.CompressedTexture=function(a,b,c,d,e,g,f,h,l,k,m){THREE.Texture.call(this,null,g,f,h,l,k,d,e,m);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture; -THREE.DataTexture=function(a,b,c,d,e,g,f,h,l,k,m){THREE.Texture.call(this,null,g,f,h,l,k,d,e,m);this.image={data:a,width:b,height:c};this.magFilter=void 0!==l?l:THREE.NearestFilter;this.minFilter=void 0!==k?k:THREE.NearestFilter;this.generateMipmaps=this.flipY=!1};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture; -THREE.VideoTexture=function(a,b,c,d,e,g,f,h,l){function k(){requestAnimationFrame(k);a.readyState===a.HAVE_ENOUGH_DATA&&(m.needsUpdate=!0)}THREE.Texture.call(this,a,b,c,d,e,g,f,h,l);this.generateMipmaps=!1;var m=this;k()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype); -THREE.Group.prototype.constructor=THREE.Group;THREE.Points=function(a,b){THREE.Object3D.call(this);this.type="Points";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointsMaterial({color:16777215*Math.random()})};THREE.Points.prototype=Object.create(THREE.Object3D.prototype);THREE.Points.prototype.constructor=THREE.Points; -THREE.Points.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){function e(a,e){var f=b.distanceSqToPoint(a);if(fc.far||d.push({distance:k,distanceToRay:Math.sqrt(f),point:h.clone(),index:e,face:null,object:g})}}var g=this,f=g.geometry,h=c.params.Points.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!== -b.isIntersectionBox(f.boundingBox)){var h=h/((this.scale.x+this.scale.y+this.scale.z)/3),l=h*h,h=new THREE.Vector3;if(f instanceof THREE.BufferGeometry){var k=f.index,f=f.attributes.position.array;if(null!==k)for(var m=k.array,k=0,p=m.length;kg||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),td.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else for(q=q.position.array,n=0,s=q.length/3-1;ng||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),td.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,l=h.length,n=0;ng||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),td.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld), -index:n,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments; -THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh; -THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0b.far?null:{distance:c,point:u.clone(), -object:a}}function c(c,d,e,g,k,m,p,u){f.fromArray(g,3*m);h.fromArray(g,3*p);l.fromArray(g,3*u);if(c=b(c,d,e,f,h,l,v))k&&(n.fromArray(k,2*m),q.fromArray(k,2*p),s.fromArray(k,2*u),c.uv=a(v,f,h,l,n,q,s)),c.face=new THREE.Face3(m,p,u,THREE.Triangle.normal(f,h,l)),c.faceIndex=m;return c}var d=new THREE.Matrix4,e=new THREE.Ray,g=new THREE.Sphere,f=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector2,q=new THREE.Vector2, -s=new THREE.Vector2,t=new THREE.Vector3,v=new THREE.Vector3,u=new THREE.Vector3;return function(u,t){var x=this.geometry,B=this.material;if(void 0!==B){null===x.boundingSphere&&x.computeBoundingSphere();var y=this.matrixWorld;g.copy(x.boundingSphere);g.applyMatrix4(y);if(!1!==u.ray.isIntersectionSphere(g)&&(d.getInverse(y),e.copy(u.ray).applyMatrix4(d),null===x.boundingBox||!1!==e.isIntersectionBox(x.boundingBox))){var z,A;if(x instanceof THREE.BufferGeometry){var J,F,B=x.index,y=x.attributes,x=y.position.array; -void 0!==y.uv&&(z=y.uv.array);if(null!==B)for(var y=B.array,C=0,N=y.length;C=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;ethis.scale.x*this.scale.y||c.push({distance:Math.sqrt(d),point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(){return(new this.constructor(this.material)).copy(this)};THREE.Particle=THREE.Sprite; -THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.constructor=THREE.LensFlare; -THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:0,opacity:g,color:e,blending:d})}; -THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );", -THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex, -THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")}, -normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common, -THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", -THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;", -THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );", -THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common, -THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}, -distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;", -THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n depth /= 1000.0;\n const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = fract( depth * bitSh );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}}; -THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===G&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){I.init();r.viewport(na,oa,pa,qa);b(U.r,U.g,U.b,X)}function d(){ra=Aa=null;sa="";ta=-1;wa=!0;I.reset()}function e(a){a.preventDefault();d();c();W.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=W.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}W.delete(a)}la.textures--} -function f(a){a=a.target;a.removeEventListener("dispose",f);var b=W.get(a),c=W.get(a.texture);if(a&&void 0!==c.__webglTexture){r.deleteTexture(c.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);W.delete(a.texture);W.delete(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose", -h);l(a);W.delete(a)}function l(a){var b=W.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function m(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b,c,d,e){var f;c.transparent? -(d=Z,f=++fa):(d=ca,f=++ga);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=V.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:V.z,group:e},d.push(f))}function q(a,b){if(!1!==a.visible){if(0!==(a.channels.mask&b.channels.mask))if(a instanceof THREE.Light)da.push(a);else if(a instanceof THREE.Sprite)ea.push(a);else if(a instanceof THREE.LensFlare)ja.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===aa.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(xa)), -n(a,null,a.material,V.z,null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===Ba.intersectsObject(a)){var c=a.material;if(!0===c.visible){!0===aa.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(xa));var d=va.update(a);if(c instanceof THREE.MeshFaceMaterial)for(var e=d.groups,f=c.materials,c=0,g=e.length;c=ha.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ha.maxTextures);ya+=1;return a}function D(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function x(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,N(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,N(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER, -N(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,N(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",b),r.texParameteri(a,r.TEXTURE_MAG_FILTER,C(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,C(b.minFilter)), -b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",b));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===S.get("OES_texture_half_float_linear")||!(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function y(a){return THREE.Math.isPowerOfTwo(a.width)&& -THREE.Math.isPowerOfTwo(a.height)}function z(a,b){var c=W.get(a);if(6===a.image.length)if(0h;h++)f[h]=!aa.autoScaleCubemaps|| -d||e?e?a.image[h].image:a.image[h]:B(a.image[h],ha.maxCubemapSize);var k=y(f[0]),l=N(a.format),n=N(a.type);x(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,q=f[h].mipmaps,p=0,s=q.length;pd;d++)c.__webglFramebuffer[d]=r.createFramebuffer(),c.__webglRenderbuffer[d]=r.createRenderbuffer(),I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,g,a.width,a.height,0,g,h,null),J(c.__webglFramebuffer[d],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+d),F(c.__webglRenderbuffer[d],a);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer: -r.createRenderbuffer(),I.bindTexture(r.TEXTURE_2D,d.__webglTexture),x(r.TEXTURE_2D,a.texture,e),I.texImage2D(r.TEXTURE_2D,0,g,a.width,a.height,0,g,h,null),J(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):F(c.__webglRenderbuffer, -a),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D);b?I.bindTexture(r.TEXTURE_CUBE_MAP,null):I.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=W.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=g=0):(d=null,c=pa,e=qa,g=na,h=oa);d!==za&&(r.bindFramebuffer(r.FRAMEBUFFER,d),r.viewport(g,h,c,e),za=d);b&&(d=W.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0, -r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));Da=c;Ea=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=W.get(a).__webglFramebuffer;if(g){var h=!1;g!==za&&(r.bindFramebuffer(r.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&N(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."): -k.type===THREE.UnsignedByteType||N(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&S.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&S.get("EXT_color_buffer_half_float")?r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,N(k.format),N(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&& -r.bindFramebuffer(r.FRAMEBUFFER,za)}}}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."); -return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return S.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return S.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax= -function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return S.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return ha.vertexTextures};this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return S.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}; -this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return $.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");$.enabled=a}}, -shadowMapType:{get:function(){return $.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");$.type=a}},shadowMapCullFace:{get:function(){return $.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");$.cullFace=a}},shadowMapDebug:{get:function(){return $.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");$.debug=a}}})}; -THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};void 0===c.minFilter&&(c.minFilter=THREE.LinearFilter);this.texture=new THREE.Texture(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null}; -THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,get wrapS(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set wrapS(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=a},get wrapT(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set wrapT(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a}, -get magFilter(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter},set magFilter(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=a},get minFilter(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set minFilter(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a},get anisotropy(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."); -return this.texture.anisotropy},set anisotropy(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=a},get offset(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set offset(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a},get repeat(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set repeat(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."); -this.texture.repeat=a},get format(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set format(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a},get type(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set type(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=a},get generateMipmaps(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."); -return this.texture.generateMipmaps},set generateMipmaps(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a},setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.shareDepthFrom= -a.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube; -THREE.WebGLBufferRenderer=function(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,g){a.drawArrays(d,b,g);c.calls++;c.vertices+=g;d===a.TRIANGLES&&(c.faces+=g/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");if(null===c)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var f=a.attributes.position;f instanceof THREE.InterleavedBufferAttribute?c.drawArraysInstancedANGLE(d, -0,f.data.count,a.maxInstancedCount):c.drawArraysInstancedANGLE(d,0,f.count,a.maxInstancedCount)}}}; -THREE.WebGLIndexedBufferRenderer=function(a,b,c){var d,e,g;this.setMode=function(a){d=a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,g=4):(e=a.UNSIGNED_SHORT,g=2)};this.render=function(b,h){a.drawElements(d,h,e,b*g);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."): -c.drawElementsInstancedANGLE(d,a.index.array.length,e,0,a.maxInstancedCount)}}; -THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); -break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}; -THREE.WebGLCapabilities=function(a,b,c){function d(b){if("highp"===b){if(0c){var d=b;b=c;c=d}d=a[b];return void 0===d?(a[b]=[c],!0):-1===d.indexOf(c)?(d.push(c),!0):!1}var g=new THREE.WebGLGeometries(a,b,c);this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute= -function(c){var g=b.get(c);if(void 0!==g.wireframe)return g.wireframe;var l=[],k=c.index,m=c.attributes;c=m.position;if(null!==k)for(var m={},k=k.array,p=0,n=k.length;p 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); -x.compileShader(K);x.compileShader(E);x.attachShader(M,K);x.attachShader(M,E);x.linkProgram(M);A=M;u=x.getAttribLocation(A,"position");w=x.getAttribLocation(A,"uv");c=x.getUniformLocation(A,"uvOffset");d=x.getUniformLocation(A,"uvScale");e=x.getUniformLocation(A,"rotation");g=x.getUniformLocation(A,"scale");f=x.getUniformLocation(A,"color");h=x.getUniformLocation(A,"map");l=x.getUniformLocation(A,"opacity");k=x.getUniformLocation(A,"modelViewMatrix");m=x.getUniformLocation(A,"projectionMatrix");p= -x.getUniformLocation(A,"fogType");n=x.getUniformLocation(A,"fogDensity");q=x.getUniformLocation(A,"fogNear");s=x.getUniformLocation(A,"fogFar");t=x.getUniformLocation(A,"fogColor");v=x.getUniformLocation(A,"alphaTest");M=document.createElement("canvas");M.width=8;M.height=8;K=M.getContext("2d");K.fillStyle="white";K.fillRect(0,0,8,8);J=new THREE.Texture(M);J.needsUpdate=!0}x.useProgram(A);B.initAttributes();B.enableAttribute(u);B.enableAttribute(w);B.disableUnusedAttributes();B.disable(x.CULL_FACE); -B.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,y);x.vertexAttribPointer(u,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(m,!1,Q.projectionMatrix.elements);B.activeTexture(x.TEXTURE0);x.uniform1i(h,0);K=M=0;(E=L.fog)?(x.uniform3f(t,E.color.r,E.color.g,E.color.b),E instanceof THREE.Fog?(x.uniform1f(q,E.near),x.uniform1f(s,E.far),x.uniform1i(p,1),K=M=1):E instanceof THREE.FogExp2&&(x.uniform1f(n,E.density),x.uniform1i(p,2),K=M=2)): -(x.uniform1i(p,0),K=M=0);for(var E=0,O=b.length;Ec)return null;var d=[],e=[],g=[],f,h,l;if(0=k--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}f=h;c<=f&&(f=0);h=f+1;c<=h&&(h=0);l=h+1;c<=l&&(l=0);var m;a:{var p= -m=void 0,n=void 0,q=void 0,s=void 0,t=void 0,v=void 0,u=void 0,w=void 0,p=a[e[f]].x,n=a[e[f]].y,q=a[e[h]].x,s=a[e[h]].y,t=a[e[l]].x,v=a[e[l]].y;if(Number.EPSILON>(q-p)*(v-n)-(s-n)*(t-p))m=!1;else{var D=void 0,x=void 0,B=void 0,y=void 0,z=void 0,A=void 0,J=void 0,F=void 0,C=void 0,N=void 0,C=F=J=w=u=void 0,D=t-q,x=v-s,B=p-t,y=n-v,z=q-p,A=s-n;for(m=0;m=-Number.EPSILON&& -F>=-Number.EPSILON&&J>=-Number.EPSILON)){m=!1;break a}m=!0}}if(m){d.push([a[e[f]],a[e[h]],a[e[l]]]);g.push([e[f],e[h],e[l]]);f=h;for(l=h+1;lNumber.EPSILON){if(0A||A> -z)return[];k=l*m-k*p;if(0>k||k>z)return[]}else{if(0d?[]:k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return Math.abs(a)>Number.EPSILON?(b=g*c-d*b,0f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cQ){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=F;ph;h++)k=l[h].x+":"+l[h].y,k=m[k],void 0!==k&&(l[h]=k);return p.concat()},isClockWise:function(a){return 0>THREE.ShapeUtils.area(a)},b2:function(){return function(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}}(),b3:function(){return function(a,b,c,d,e){var g= -1-a,f=1-a;return g*g*g*b+3*f*f*a*c+3*(1-a)*a*a*d+a*a*a*e}}()};THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype); -THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this}; -THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer;a.loop=this.source.loop;a.onended=this.source.onended;a.start(0,this.startTime);a.playbackRate.value=this.playbackRate;this.isPlaying=!0;this.source=a;this.connect()}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime}; -THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};THREE.Audio.prototype.connect=function(){void 0!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.panner)):this.source.connect(this.panner)};THREE.Audio.prototype.disconnect=function(){void 0!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.panner)):this.source.disconnect(this.panner)}; -THREE.Audio.prototype.setFilter=function(a){!0===this.isPlaying?(this.disconnect(),this.filter=a,this.connect()):this.filter=a};THREE.Audio.prototype.getFilter=function(){return this.filter};THREE.Audio.prototype.setPlaybackRate=function(a){this.playbackRate=a;!0===this.isPlaying&&(this.source.playbackRate.value=this.playbackRate)};THREE.Audio.prototype.getPlaybackRate=function(){return this.playbackRate};THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1}; -THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.getLoop=function(){return this.source.loop};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.getRefDistance=function(){return this.panner.refDistance};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};THREE.Audio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor}; -THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a};THREE.Audio.prototype.getVolume=function(){return this.gain.gain.value};THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new (window.AudioContext||window.webkitAudioContext)}; -THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);THREE.AudioListener.prototype.constructor=THREE.AudioListener; -THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3;return function(e){THREE.Object3D.prototype.updateMatrixWorld.call(this,e);e=this.context.listener;var g=this.up;this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);e.setPosition(a.x,a.y,a.z);e.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z)}}();THREE.Curve=function(){}; -THREE.Curve.prototype={constructor:THREE.Curve,getPoint:function(a){console.warn("THREE.Curve: Warning, getPoint() not implemented!");return null},getPointAt:function(a){a=this.getUtoTmapping(a);return this.getPoint(a)},getPoints:function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c},getSpacedPoints:function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c},getLength:function(){var a=this.getLengths();return a[a.length-1]},getLengths:function(a){a|| -(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,g=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),g+=c.distanceTo(d),b.push(g),d=c;return this.cacheArcLengths=b},updateArcLengths:function(){this.needsUpdate=!0;this.getLengths()},getUtoTmapping:function(a,b){var c=this.getLengths(),d=0,e=c.length,g;g=b?b:a*c[e-1];for(var f=0,h=e- -1,l;f<=h;)if(d=Math.floor(f+(h-f)/2),l=c[d]-g,0>l)f=d+1;else if(0b&&(b=0);1=b)return a=this.curves[d],b=1-(c[d]-b)/a.getLength(),a.getPointAt(b);d++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; -THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cNumber.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x|| -g.x<=a.x&&a.x<=h.x))return!0}return d}var e=THREE.ShapeUtils.isClockWise,g=function(a){for(var b=[],c=new THREE.Path,d=0,e=a.length;db.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=THREE.CurveUtils.interpolate;return new THREE.Vector2(c(d.x,e.x,g.x,b.x,a),c(d.y,e.y,g.y,b.y,a))};THREE.EllipseCurve=function(a,b,c,d,e,g,f,h){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=g;this.aClockwise=f;this.aRotation=h||0};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype); -THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve; -THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);var c=this.aY+this.yRadius*Math.sin(b);if(0!==this.aRotation){var b=Math.cos(this.aRotation),d=Math.sin(this.aRotation),e=a;a=(e-this.aX)*b-(c-this.aY)*d+this.aX;c=(e-this.aX)*d+(c-this.aY)*b+this.aY}return new THREE.Vector2(a,c)}; -THREE.ArcCurve=function(a,b,c,d,e,g){THREE.EllipseCurve.call(this,a,b,c,c,d,e,g)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b}); -THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b=THREE.ShapeUtils.b2;return new THREE.Vector3(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y),b(a,this.v0.z,this.v1.z,this.v2.z))}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=THREE.ShapeUtils.b3;return new THREE.Vector3(b(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}); -THREE.SplineCurve3=THREE.Curve.create(function(a){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],g=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=THREE.CurveUtils.interpolate;return new THREE.Vector3(c(d.x,e.x,g.x,b.x,a),c(d.y,e.y,g.y,b.y,a),c(d.z,e.z,g.z,b.z,a))}); -THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,m,p){a=((b-a)/e-(c-a)/(e+m)+(c-b)/m)*m;d=((c-b)/m-(d-b)/(m+p)+(d-c)/p)*m;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3* -b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var f=this.points,h,l;l=f.length;2>l&&console.log("duh, you need at least 2 points");a*=l-1;h=Math.floor(a);a-=h;0===a&&h===l-1&&(h=l-2,a=1);var k,m,p;0===h?(b.subVectors(f[0],f[1]).add(f[0]),k=b):k=f[h-1];m=f[h];p=f[h+1];h+2h&&(h=1);1E-4>l&&(l=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(k.x,m.x,p.x,f.x,l,h,n);d.initNonuniformCatmullRom(k.y,m.y,p.y,f.y,l,h,n);e.initNonuniformCatmullRom(k.z,m.z,p.z,f.z,l,h,n)}else"catmullrom"===this.type&&(l=void 0!==this.tension?this.tension:.5,c.initCatmullRom(k.x,m.x,p.x,f.x,l),d.initCatmullRom(k.y,m.y,p.y,f.y,l),e.initCatmullRom(k.z,m.z,p.z,f.z,l));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}(); -THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0n;n++){e[0]=p[f[n]];e[1]=p[f[(n+1)%3]];e.sort(c);var q=e.toString();void 0===g[q]?g[q]={vert1:e[0],vert2:e[1],face1:k, -face2:void 0}:g[q].face2=k}e=[];for(q in g)if(f=g[q],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=d)k=l[f.vert1],e.push(k.x),e.push(k.y),e.push(k.z),k=l[f.vert2],e.push(k.x),e.push(k.y),e.push(k.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry; -THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;dNumber.EPSILON){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>Number.EPSILON? -f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(G=a.length;0<=--G;){c=G;d=G-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;eMath.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y, -1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cNumber.EPSILON&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),g[k].applyMatrix4(l.makeRotationAxis(h,d))),f[k].crossVectors(e[k],g[k]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/ -2/Math.PI+.5,a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var l=this,k=0,m=a.length;kq&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));k=0;for(m=this.vertices.length;kp;p++){c[0]=m[e[p]];c[1]=m[e[(p+1)%3]];c.sort(b);var n=c.toString();void 0===d[n]&&(l[2*h]=c[0],l[2*h+1]=c[1],d[n]=!0,h++)}c=new Float32Array(6*h);a=0;for(k=h;ap;p++)d=g[l[2*a+p]],h=6*a+3*p,c[h+0]=d.x,c[h+1]=d.y, -c[h+2]=d.z;this.addAttribute("position",new THREE.BufferAttribute(c,3))}else if(a instanceof THREE.BufferGeometry){if(null!==a.index){k=a.index.array;g=a.attributes.position;e=a.drawcalls;h=0;0===e.length&&a.addGroup(0,k.length);l=new Uint32Array(2*k.length);f=0;for(m=e.length;fp;p++)c[0]=k[a+p],c[1]=k[a+(p+1)%3],c.sort(b),n=c.toString(),void 0===d[n]&&(l[2*h]=c[0],l[2*h+1]=c[1],d[n]=!0,h++)}c=new Float32Array(6*h);a=0;for(k= -h;ap;p++)h=6*a+3*p,d=l[2*a+p],c[h+0]=g.getX(d),c[h+1]=g.getY(d),c[h+2]=g.getZ(d)}else for(g=a.attributes.position.array,h=g.length/3,l=h/3,c=new Float32Array(6*h),a=0,k=l;ap;p++)h=18*a+6*p,l=9*a+3*p,c[h+0]=g[l],c[h+1]=g[l+1],c[h+2]=g[l+2],d=9*a+(p+1)%3*3,c[h+3]=g[d],c[h+4]=g[d+1],c[h+5]=g[d+2];this.addAttribute("position",new THREE.BufferAttribute(c,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype); -THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.LineSegments.call(this,a,b)};THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype); -THREE.AxisHelper.prototype.constructor=THREE.AxisHelper; -THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.translate(0,-.5,0);return function(c,d,e,g,f,h){THREE.Object3D.call(this);void 0===g&&(g=16776960);void 0===e&&(e=1);void 0===f&&(f=.2*e);void 0===h&&(h=.2*f);this.position.copy(d);fc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}(); -THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);bd;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);this.update()}; -THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper;THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; -THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); -THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper; -THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; -THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;ch.end&&(h.end=g);c||(c=l)}}for(l in d)h=d[l],this.createAnimation(l,h.start,h.end,a);this.firstAnimation=c}; -THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; -THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; -THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; -THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var g=d.start+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),f=d.weight;g!==d.currentFrame&& -(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*f,this.morphTargetInfluences[g]=0,d.lastFrame=d.currentFrame,d.currentFrame=g);e=d.time%e/e;d.directionBackwards&&(e=1-e);d.currentFrame!==d.lastFrame?(this.morphTargetInfluences[d.currentFrame]=e*f,this.morphTargetInfluences[d.lastFrame]=(1-e)*f):this.morphTargetInfluences[d.currentFrame]=f}}}; +console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/Installation' ); +/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THREE={})}(this,(function(t){"use strict";const e="153",n=0,i=1,r=2,s=1,a=2,o=3,l=0,c=1,h=2,u=0,d=1,p=2,m=3,f=4,g=5,v=100,_=101,y=102,x=103,M=104,S=200,b=201,E=202,T=203,w=204,A=205,R=206,C=207,L=208,P=209,I=210,U=0,D=1,N=2,O=3,F=4,B=5,z=6,G=7,H=0,k=1,V=2,W=0,X=1,j=2,q=3,Y=4,Z=5,J=300,K=301,$=302,Q=303,tt=304,et=306,nt=1e3,it=1001,rt=1002,st=1003,at=1004,ot=1005,lt=1006,ct=1007,ht=1008,ut=1009,dt=1010,pt=1011,mt=1012,ft=1013,gt=1014,vt=1015,_t=1016,yt=1017,xt=1018,Mt=1020,St=1021,bt=1023,Et=1024,Tt=1025,wt=1026,At=1027,Rt=1028,Ct=1029,Lt=1030,Pt=1031,It=1033,Ut=33776,Dt=33777,Nt=33778,Ot=33779,Ft=35840,Bt=35841,zt=35842,Gt=35843,Ht=36196,kt=37492,Vt=37496,Wt=37808,Xt=37809,jt=37810,qt=37811,Yt=37812,Zt=37813,Jt=37814,Kt=37815,$t=37816,Qt=37817,te=37818,ee=37819,ne=37820,ie=37821,re=36492,se=36283,ae=36284,oe=36285,le=36286,ce=2300,he=2301,ue=2302,de=2400,pe=2401,me=2402,fe=2500,ge=2501,ve=3e3,_e=3001,ye=3201,xe=0,Me=1,Se="",be="srgb",Ee="srgb-linear",Te="display-p3",we=7680,Ae=512,Re=513,Ce=514,Le=515,Pe=516,Ie=517,Ue=518,De=519,Ne=35044,Oe="300 es",Fe=1035,Be=2e3,ze=2001;class Ge{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e>8&255]+He[t>>16&255]+He[t>>24&255]+"-"+He[255&e]+He[e>>8&255]+"-"+He[e>>16&15|64]+He[e>>24&255]+"-"+He[63&n|128]+He[n>>8&255]+"-"+He[n>>16&255]+He[n>>24&255]+He[255&i]+He[i>>8&255]+He[i>>16&255]+He[i>>24&255]).toLowerCase()}function je(t,e,n){return Math.max(e,Math.min(n,t))}function qe(t,e){return(t%e+e)%e}function Ye(t,e,n){return(1-n)*t+n*e}function Ze(t){return 0==(t&t-1)&&0!==t}function Je(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Ke(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function $e(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Qe(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const tn={DEG2RAD:Ve,RAD2DEG:We,generateUUID:Xe,clamp:je,euclideanModulo:qe,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Ye,damp:function(t,e,n,i){return Ye(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(qe(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(ke=t);let e=ke+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Ve},radToDeg:function(t){return t*We},isPowerOfTwo:Ze,ceilPowerOfTwo:Je,floorPowerOfTwo:Ke,setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*m,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*m,o*c);break;case"ZYZ":t.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Qe,denormalize:$e};class en{constructor(t=0,e=0){en.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(je(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(t,e,n,i,r,s,a,o,l){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],m=i[0],f=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],M=i[5],S=i[8];return r[0]=s*m+a*v+o*x,r[3]=s*f+a*_+o*M,r[6]=s*g+a*y+o*S,r[1]=l*m+c*v+h*x,r[4]=l*f+c*_+h*M,r[7]=l*g+c*y+h*S,r[2]=u*m+d*v+p*x,r[5]=u*f+d*_+p*M,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=h*m,t[1]=(i*l-c*n)*m,t[2]=(a*n-i*s)*m,t[3]=u*m,t[4]=(c*e-i*o)*m,t[5]=(i*r-a*e)*m,t[6]=d*m,t[7]=(n*o-l*e)*m,t[8]=(s*e-n*r)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(rn.makeScale(t,e)),this}rotate(t){return this.premultiply(rn.makeRotation(-t)),this}translate(t,e){return this.premultiply(rn.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const rn=new nn;function sn(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const an={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function on(t,e){return new an[t](e)}function ln(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const cn={};function hn(t){t in cn||(cn[t]=!0,console.warn(t))}function un(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function dn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const pn=(new nn).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),mn=(new nn).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const fn={[Ee]:t=>t,[be]:t=>t.convertSRGBToLinear(),[Te]:function(t){return t.convertSRGBToLinear().applyMatrix3(mn)}},gn={[Ee]:t=>t,[be]:t=>t.convertLinearToSRGB(),[Te]:function(t){return t.applyMatrix3(pn).convertLinearToSRGB()}},vn={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return Ee},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=fn[e],r=gn[n];if(void 0===i||void 0===r)throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`);return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let _n;class yn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===_n&&(_n=ln("canvas")),_n.width=t.width,_n.height=t.height;const n=_n.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=_n}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=ln("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==J)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case nt:t.x=t.x-Math.floor(t.x);break;case it:t.x=t.x<0?0:1;break;case rt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case nt:t.y=t.y-Math.floor(t.y);break;case it:t.y=t.y<0?0:1;break;case rt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return hn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===be?_e:ve}set encoding(t){hn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===_e?be:Se}}En.DEFAULT_IMAGE=null,En.DEFAULT_MAPPING=J,En.DEFAULT_ANISOTROPY=1;class Tn{constructor(t=0,e=0,n=0,i=1){Tn.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+m*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(je(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ln{constructor(t=0,e=0,n=0){Ln.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(In.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(In.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Pn.copy(this).projectOnVector(t),this.sub(Pn)}reflect(t){return this.sub(Pn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(je(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Pn=new Ln,In=new Cn;class Un{constructor(t=new Ln(1/0,1/0,1/0),e=new Ln(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Nn),Nn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Vn),Wn.subVectors(this.max,Vn),Fn.subVectors(t.a,Vn),Bn.subVectors(t.b,Vn),zn.subVectors(t.c,Vn),Gn.subVectors(Bn,Fn),Hn.subVectors(zn,Bn),kn.subVectors(Fn,zn);let e=[0,-Gn.z,Gn.y,0,-Hn.z,Hn.y,0,-kn.z,kn.y,Gn.z,0,-Gn.x,Hn.z,0,-Hn.x,kn.z,0,-kn.x,-Gn.y,Gn.x,0,-Hn.y,Hn.x,0,-kn.y,kn.x,0];return!!qn(e,Fn,Bn,zn,Wn)&&(e=[1,0,0,0,1,0,0,0,1],!!qn(e,Fn,Bn,zn,Wn)&&(Xn.crossVectors(Gn,Hn),e=[Xn.x,Xn.y,Xn.z],qn(e,Fn,Bn,zn,Wn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Nn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Nn).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Dn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Dn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Dn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Dn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Dn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Dn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Dn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Dn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Dn)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Dn=[new Ln,new Ln,new Ln,new Ln,new Ln,new Ln,new Ln,new Ln],Nn=new Ln,On=new Un,Fn=new Ln,Bn=new Ln,zn=new Ln,Gn=new Ln,Hn=new Ln,kn=new Ln,Vn=new Ln,Wn=new Ln,Xn=new Ln,jn=new Ln;function qn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){jn.fromArray(t,s);const a=r.x*Math.abs(jn.x)+r.y*Math.abs(jn.y)+r.z*Math.abs(jn.z),o=e.dot(jn),l=n.dot(jn),c=i.dot(jn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Yn=new Un,Zn=new Ln,Jn=new Ln;class Kn{constructor(t=new Ln,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Yn.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Zn.subVectors(t,this.center);const e=Zn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Zn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Jn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Zn.copy(t.center).add(Jn)),this.expandByPoint(Zn.copy(t.center).sub(Jn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const $n=new Ln,Qn=new Ln,ti=new Ln,ei=new Ln,ni=new Ln,ii=new Ln,ri=new Ln;class si{constructor(t=new Ln,e=new Ln(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,$n)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=$n.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):($n.copy(this.origin).addScaledVector(this.direction,e),$n.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Qn.copy(t).add(e).multiplyScalar(.5),ti.copy(e).sub(t).normalize(),ei.copy(this.origin).sub(Qn);const r=.5*t.distanceTo(e),s=-this.direction.dot(ti),a=ei.dot(this.direction),o=-ei.dot(ti),l=ei.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Qn).addScaledVector(ti,u),d}intersectSphere(t,e){$n.subVectors(t.center,this.origin);const n=$n.dot(this.direction),i=$n.dot($n)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,$n)}intersectTriangle(t,e,n,i,r){ni.subVectors(e,t),ii.subVectors(n,t),ri.crossVectors(ni,ii);let s,a=this.direction.dot(ri);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}ei.subVectors(this.origin,t);const o=s*this.direction.dot(ii.crossVectors(ei,ii));if(o<0)return null;const l=s*this.direction.dot(ni.cross(ei));if(l<0)return null;if(o+l>a)return null;const c=-s*ei.dot(ri);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ai{constructor(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){ai.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f)}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ai).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/oi.setFromMatrixColumn(t,0).length(),r=1/oi.setFromMatrixColumn(t,1).length(),s=1/oi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ci,t,hi)}lookAt(t,e,n){const i=this.elements;return pi.subVectors(t,e),0===pi.lengthSq()&&(pi.z=1),pi.normalize(),ui.crossVectors(n,pi),0===ui.lengthSq()&&(1===Math.abs(n.z)?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ui.crossVectors(n,pi)),ui.normalize(),di.crossVectors(pi,ui),i[0]=ui.x,i[4]=di.x,i[8]=pi.x,i[1]=ui.y,i[5]=di.y,i[9]=pi.y,i[2]=ui.z,i[6]=di.z,i[10]=pi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],m=n[6],f=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],M=i[0],S=i[4],b=i[8],E=i[12],T=i[1],w=i[5],A=i[9],R=i[13],C=i[2],L=i[6],P=i[10],I=i[14],U=i[3],D=i[7],N=i[11],O=i[15];return r[0]=s*M+a*T+o*C+l*U,r[4]=s*S+a*w+o*L+l*D,r[8]=s*b+a*A+o*P+l*N,r[12]=s*E+a*R+o*I+l*O,r[1]=c*M+h*T+u*C+d*U,r[5]=c*S+h*w+u*L+d*D,r[9]=c*b+h*A+u*P+d*N,r[13]=c*E+h*R+u*I+d*O,r[2]=p*M+m*T+f*C+g*U,r[6]=p*S+m*w+f*L+g*D,r[10]=p*b+m*A+f*P+g*N,r[14]=p*E+m*R+f*I+g*O,r[3]=v*M+_*T+y*C+x*U,r[7]=v*S+_*w+y*L+x*D,r[11]=v*b+_*A+y*P+x*N,r[15]=v*E+_*R+y*I+x*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],v=h*f*l-m*u*l+m*o*d-a*f*d-h*o*g+a*u*g,_=p*u*l-c*f*l-p*o*d+s*f*d+c*o*g-s*u*g,y=c*m*l-p*h*l+p*a*d-s*m*d-c*a*g+s*h*g,x=p*h*o-c*m*o-p*a*u+s*m*u+c*a*f-s*h*f,M=e*v+n*_+i*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return t[0]=v*S,t[1]=(m*u*r-h*f*r-m*i*d+n*f*d+h*i*g-n*u*g)*S,t[2]=(a*f*r-m*o*r+m*i*l-n*f*l-a*i*g+n*o*g)*S,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*S,t[4]=_*S,t[5]=(c*f*r-p*u*r+p*i*d-e*f*d-c*i*g+e*u*g)*S,t[6]=(p*o*r-s*f*r-p*i*l+e*f*l+s*i*g-e*o*g)*S,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*S,t[8]=y*S,t[9]=(p*h*r-c*m*r-p*n*d+e*m*d+c*n*g-e*h*g)*S,t[10]=(s*m*r-p*a*r+p*n*l-e*m*l-s*n*g+e*a*g)*S,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*S,t[12]=x*S,t[13]=(c*m*i-p*h*i+p*n*u-e*m*u-c*n*f+e*h*f)*S,t[14]=(p*a*i-s*m*i-p*n*o+e*m*o+s*n*f-e*a*f)*S,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,m=s*c,f=s*h,g=a*h,v=o*l,_=o*c,y=o*h,x=n.x,M=n.y,S=n.z;return i[0]=(1-(m+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+g))*M,i[6]=(f+v)*M,i[7]=0,i[8]=(p+_)*S,i[9]=(f-v)*S,i[10]=(1-(u+m))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=oi.set(i[0],i[1],i[2]).length();const s=oi.set(i[4],i[5],i[6]).length(),a=oi.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],li.copy(this);const o=1/r,l=1/s,c=1/a;return li.elements[0]*=o,li.elements[1]*=o,li.elements[2]*=o,li.elements[4]*=l,li.elements[5]*=l,li.elements[6]*=l,li.elements[8]*=c,li.elements[9]*=c,li.elements[10]*=c,e.setFromRotationMatrix(li),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),c=2*r/(n-i),h=(e+t)/(e-t),u=(n+i)/(n-i);let d,p;if(a===Be)d=-(s+r)/(s-r),p=-2*s*r/(s-r);else{if(a!==ze)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);d=-s/(s-r),p=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),c=1/(n-i),h=1/(s-r),u=(e+t)*l,d=(n+i)*c;let p,m;if(a===Be)p=(s+r)*h,m=-2*h;else{if(a!==ze)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);p=r*h,m=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=m,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const oi=new Ln,li=new ai,ci=new Ln(0,0,0),hi=new Ln(1,1,1),ui=new Ln,di=new Ln,pi=new Ln,mi=new ai,fi=new Cn;class gi{constructor(t=0,e=0,n=0,i=gi.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(je(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-je(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(je(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-je(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(je(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-je(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return mi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(mi,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return fi.setFromEuler(this),this.setFromQuaternion(fi,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}gi.DEFAULT_ORDER="XYZ";class vi{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bi,t,Ei),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bi,Ti,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Ii.subVectors(i,e),Ui.subVectors(n,e),Di.subVectors(t,e);const s=Ii.dot(Ii),a=Ii.dot(Ui),o=Ii.dot(Di),l=Ui.dot(Ui),c=Ui.dot(Di),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ni),Ni.x>=0&&Ni.y>=0&&Ni.x+Ni.y<=1}static getUV(t,e,n,i,r,s,a,o){return!1===ki&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ki=!0),this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Ni),o.setScalar(0),o.addScaledVector(r,Ni.x),o.addScaledVector(s,Ni.y),o.addScaledVector(a,Ni.z),o}static isFrontFacing(t,e,n,i){return Ii.subVectors(n,e),Ui.subVectors(t,e),Ii.cross(Ui).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Ii.subVectors(this.c,this.b),Ui.subVectors(this.a,this.b),.5*Ii.cross(Ui).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Vi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Vi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return!1===ki&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ki=!0),Vi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return Vi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Vi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Vi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;Oi.subVectors(i,n),Fi.subVectors(r,n),zi.subVectors(t,n);const o=Oi.dot(zi),l=Fi.dot(zi);if(o<=0&&l<=0)return e.copy(n);Gi.subVectors(t,i);const c=Oi.dot(Gi),h=Fi.dot(Gi);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Oi,s);Hi.subVectors(t,r);const d=Oi.dot(Hi),p=Fi.dot(Hi);if(p>=0&&d<=p)return e.copy(r);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Fi,a);const f=c*p-d*h;if(f<=0&&h-c>=0&&d-p>=0)return Bi.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Bi,a);const g=1/(f+m+u);return s=m*g,a=u*g,e.copy(n).addScaledVector(Oi,s).addScaledVector(Fi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Wi=0;class Xi extends Ge{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Wi++}),this.uuid=Xe(),this.name="",this.type="Material",this.blending=d,this.side=l,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=w,this.blendDst=A,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=O,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=we,this.stencilZFail=we,this.stencilZPass=we,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==d&&(n.blending=this.blending),this.side!==l&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}const ji={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},qi={h:0,s:0,l:0},Yi={h:0,s:0,l:0};function Zi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Ji{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=be){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,vn.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=vn.workingColorSpace){return this.r=t,this.g=e,this.b=n,vn.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=vn.workingColorSpace){if(t=qe(t,1),e=je(e,0,1),n=je(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Zi(r,i,t+1/3),this.g=Zi(r,i,t),this.b=Zi(r,i,t-1/3)}return vn.toWorkingColorSpace(this,i),this}setStyle(t,e=be){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=be){const n=ji[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=un(t.r),this.g=un(t.g),this.b=un(t.b),this}copyLinearToSRGB(t){return this.r=dn(t.r),this.g=dn(t.g),this.b=dn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=be){return vn.fromWorkingColorSpace(Ki.copy(this),t),65536*Math.round(je(255*Ki.r,0,255))+256*Math.round(je(255*Ki.g,0,255))+Math.round(je(255*Ki.b,0,255))}getHexString(t=be){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=vn.workingColorSpace){vn.fromWorkingColorSpace(Ki.copy(this),e);const n=Ki.r,i=Ki.g,r=Ki.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function er(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=je(t,-65504,65504),Qi.floatView[0]=t;const e=Qi.uint32View[0],n=e>>23&511;return Qi.baseTable[n]+((8388607&e)>>Qi.shiftTable[n])}function nr(t){const e=t>>10;return Qi.uint32View[0]=Qi.mantissaTable[Qi.offsetTable[e]+(1023&t)]+Qi.exponentTable[e],Qi.floatView[0]}const ir={toHalfFloat:er,fromHalfFloat:nr},rr=new Ln,sr=new en;class ar{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Ne,this.updateRange={offset:0,count:-1},this.gpuType=vt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t(t.far-t.near)**2)return}_r.copy(r).invert(),yr.copy(t.ray).applyMatrix4(_r),null!==n.boundingBox&&!1===yr.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,yr)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;rn.far?null:{distance:u,point:Dr.clone(),object:t}}(t,e,n,i,Sr,br,Er,Ur);if(d){r&&(Ar.fromBufferAttribute(r,o),Rr.fromBufferAttribute(r,h),Cr.fromBufferAttribute(r,u),d.uv=Vi.getInterpolation(Ur,Sr,br,Er,Ar,Rr,Cr,new en)),s&&(Ar.fromBufferAttribute(s,o),Rr.fromBufferAttribute(s,h),Cr.fromBufferAttribute(s,u),d.uv1=Vi.getInterpolation(Ur,Sr,br,Er,Ar,Rr,Cr,new en),d.uv2=d.uv1),a&&(Lr.fromBufferAttribute(a,o),Pr.fromBufferAttribute(a,h),Ir.fromBufferAttribute(a,u),d.normal=Vi.getInterpolation(Ur,Sr,br,Er,Lr,Pr,Ir,new Ln),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const t={a:o,b:h,c:u,normal:new Ln,materialIndex:0};Vi.getNormal(Sr,br,Er,t.normal),d.face=t}return d}class Fr extends vr{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,s,p,m,f,g,v){const _=s/f,y=p/g,x=s/2,M=p/2,S=m/2,b=f+1,E=g+1;let T=0,w=0;const A=new Ln;for(let s=0;s0?1:-1,c.push(A.x,A.y,A.z),h.push(o/f),h.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Vr extends Pi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ai,this.projectionMatrix=new ai,this.projectionMatrixInverse=new ai,this.coordinateSystem=Be}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Wr extends Vr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*We*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Ve*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*We*Math.atan(Math.tan(.5*Ve*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Ve*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Xr=-90;class jr extends Pi{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null;const i=new Wr(Xr,1,t,e);i.layers=this.layers,this.add(i);const r=new Wr(Xr,1,t,e);r.layers=this.layers,this.add(r);const s=new Wr(Xr,1,t,e);s.layers=this.layers,this.add(s);const a=new Wr(Xr,1,t,e);a.layers=this.layers,this.add(a);const o=new Wr(Xr,1,t,e);o.layers=this.layers,this.add(o);const l=new Wr(Xr,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===Be)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==ze)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.toneMapping,u=t.xr.enabled;t.toneMapping=W,t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=h,t.xr.enabled=u,n.texture.needsPMREMUpdate=!0}}class qr extends En{constructor(t,e,n,i,r,s,a,o,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:K,n,i,r,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Yr extends wn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];void 0!==e.encoding&&(hn("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===_e?be:Se),this.texture=new qr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:lt}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Fr(5,5,5),r=new kr({name:"CubemapFromEquirect",uniforms:Br(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:c,blending:u});r.uniforms.tEquirect.value=e;const s=new Nr(i,r),a=e.minFilter;e.minFilter===ht&&(e.minFilter=lt);return new jr(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const Zr=new Ln,Jr=new Ln,Kr=new nn;class $r{constructor(t=new Ln(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Zr.subVectors(n,e).cross(Jr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Zr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Kr.getNormalMatrix(t),i=this.coplanarPoint(Zr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Qr=new Kn,ts=new Ln;class es{constructor(t=new $r,e=new $r,n=new $r,i=new $r,r=new $r,s=new $r){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],m=i[10],f=i[11],g=i[12],v=i[13],_=i[14],y=i[15];if(n[0].setComponents(o-r,u-l,f-d,y-g).normalize(),n[1].setComponents(o+r,u+l,f+d,y+g).normalize(),n[2].setComponents(o+s,u+c,f+p,y+v).normalize(),n[3].setComponents(o-s,u-c,f-p,y-v).normalize(),n[4].setComponents(o-a,u-h,f-m,y-_).normalize(),e===Be)n[5].setComponents(o+a,u+h,f+m,y+_).normalize();else{if(e!==ze)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,m,_).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Qr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Qr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Qr)}intersectsSprite(t){return Qr.center.set(0,0,0),Qr.radius=.7071067811865476,Qr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Qr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,ts.y=i.normal.y>0?t.max.y:t.min.y,ts.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(ts)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function ns(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function is(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},as={common:{diffuse:{value:new Ji(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new en(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ji(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ji(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new Ji(16777215)},opacity:{value:1},center:{value:new en(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},os={basic:{uniforms:zr([as.common,as.specularmap,as.envmap,as.aomap,as.lightmap,as.fog]),vertexShader:ss.meshbasic_vert,fragmentShader:ss.meshbasic_frag},lambert:{uniforms:zr([as.common,as.specularmap,as.envmap,as.aomap,as.lightmap,as.emissivemap,as.bumpmap,as.normalmap,as.displacementmap,as.fog,as.lights,{emissive:{value:new Ji(0)}}]),vertexShader:ss.meshlambert_vert,fragmentShader:ss.meshlambert_frag},phong:{uniforms:zr([as.common,as.specularmap,as.envmap,as.aomap,as.lightmap,as.emissivemap,as.bumpmap,as.normalmap,as.displacementmap,as.fog,as.lights,{emissive:{value:new Ji(0)},specular:{value:new Ji(1118481)},shininess:{value:30}}]),vertexShader:ss.meshphong_vert,fragmentShader:ss.meshphong_frag},standard:{uniforms:zr([as.common,as.envmap,as.aomap,as.lightmap,as.emissivemap,as.bumpmap,as.normalmap,as.displacementmap,as.roughnessmap,as.metalnessmap,as.fog,as.lights,{emissive:{value:new Ji(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag},toon:{uniforms:zr([as.common,as.aomap,as.lightmap,as.emissivemap,as.bumpmap,as.normalmap,as.displacementmap,as.gradientmap,as.fog,as.lights,{emissive:{value:new Ji(0)}}]),vertexShader:ss.meshtoon_vert,fragmentShader:ss.meshtoon_frag},matcap:{uniforms:zr([as.common,as.bumpmap,as.normalmap,as.displacementmap,as.fog,{matcap:{value:null}}]),vertexShader:ss.meshmatcap_vert,fragmentShader:ss.meshmatcap_frag},points:{uniforms:zr([as.points,as.fog]),vertexShader:ss.points_vert,fragmentShader:ss.points_frag},dashed:{uniforms:zr([as.common,as.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ss.linedashed_vert,fragmentShader:ss.linedashed_frag},depth:{uniforms:zr([as.common,as.displacementmap]),vertexShader:ss.depth_vert,fragmentShader:ss.depth_frag},normal:{uniforms:zr([as.common,as.bumpmap,as.normalmap,as.displacementmap,{opacity:{value:1}}]),vertexShader:ss.meshnormal_vert,fragmentShader:ss.meshnormal_frag},sprite:{uniforms:zr([as.sprite,as.fog]),vertexShader:ss.sprite_vert,fragmentShader:ss.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ss.background_vert,fragmentShader:ss.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ss.backgroundCube_vert,fragmentShader:ss.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ss.cube_vert,fragmentShader:ss.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ss.equirect_vert,fragmentShader:ss.equirect_frag},distanceRGBA:{uniforms:zr([as.common,as.displacementmap,{referencePosition:{value:new Ln},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ss.distanceRGBA_vert,fragmentShader:ss.distanceRGBA_frag},shadow:{uniforms:zr([as.lights,as.fog,{color:{value:new Ji(0)},opacity:{value:1}}]),vertexShader:ss.shadow_vert,fragmentShader:ss.shadow_frag}};os.physical={uniforms:zr([os.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new en(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new Ji(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new en},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new Ji(0)},specularColor:{value:new Ji(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new en},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag};const ls={r:0,b:0,g:0};function cs(t,e,n,i,r,s,a){const o=new Ji(0);let h,u,d=!0===s?0:1,p=null,m=0,f=null;function g(e,n){e.getRGB(ls,Gr(t)),i.buffers.color.setClear(ls.r,ls.g,ls.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),d=e,g(o,d)},getClearAlpha:function(){return d},setClearAlpha:function(t){d=t,g(o,d)},render:function(s,v){let _=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?n:e).get(y)}switch(null===y?g(o,d):y&&y.isColor&&(g(y,1),_=!0),t.xr.getEnvironmentBlendMode()){case"opaque":_=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,a),_=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,a),_=!0}(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===et)?(void 0===u&&(u=new Nr(new Fr(1,1,1),new kr({name:"BackgroundCubeMaterial",uniforms:Br(os.backgroundCube.uniforms),vertexShader:os.backgroundCube.vertexShader,fragmentShader:os.backgroundCube.fragmentShader,side:c,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=y.colorSpace!==be,p===y&&m===y.version&&f===t.toneMapping||(u.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),u.layers.enableAll(),s.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(void 0===h&&(h=new Nr(new rs(2,2),new kr({name:"BackgroundMaterial",uniforms:Br(os.background.uniforms),vertexShader:os.background.vertexShader,fragmentShader:os.background.fragmentShader,side:l,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=y.colorSpace!==be,!0===y.matrixAutoUpdate&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&m===y.version&&f===t.toneMapping||(h.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),h.layers.enableAll(),s.unshift(h,h.geometry,h.material,0,0,null))}}}function hs(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(r,y,d,x),M&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){if(o[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}c.attributes=r,c.attributesNum=a,c.index=i}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&n.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,a,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,l=a.itemSize,c=n.get(a);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||a.gpuType===ft);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,c=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function ps(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new $r,o=new nn,l={value:null,needsUpdate:!1};function c(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=m.clippingState||null;l.value=r,r=c(u,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function ms(t){let e=new WeakMap;function n(t,e){return e===Q?t.mapping=K:e===tt&&(t.mapping=$),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===Q||s===tt){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new Yr(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class fs extends Vr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const gs=4,vs=[.125,.215,.35,.446,.526,.582],_s=20,ys=new fs,xs=new Ji;let Ms=null;const Ss=(1+Math.sqrt(5))/2,bs=1/Ss,Es=[new Ln(1,1,1),new Ln(-1,1,1),new Ln(1,1,-1),new Ln(-1,1,-1),new Ln(0,Ss,bs),new Ln(0,Ss,-bs),new Ln(bs,0,Ss),new Ln(-bs,0,Ss),new Ln(Ss,bs,0),new Ln(-Ss,bs,0)];class Ts{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Ms=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Cs(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Rs(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-gs?o=vs[a-t+gs-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,m=3,f=2,g=1,v=new Float32Array(m*p*d),_=new Float32Array(f*p*d),y=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,m*p*t),_.set(u,f*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new vr;x.setAttribute("position",new ar(v,m)),x.setAttribute("uv",new ar(_,f)),x.setAttribute("faceIndex",new ar(y,g)),e.push(x),r>gs&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(_s),r=new Ln(0,1,0),s=new kr({name:"SphericalGaussianBlur",defines:{n:_s,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ls(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new Nr(this._lodPlanes[0],t);this._renderer.compile(e,ys)}_sceneToCubeUV(t,e,n,i){const r=new Wr(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,h=o.toneMapping;o.getClearColor(xs),o.toneMapping=W,o.autoClear=!1;const u=new $i({name:"PMREM.Background",side:c,depthWrite:!1,depthTest:!1}),d=new Nr(new Fr,u);let p=!1;const m=t.background;m?m.isColor&&(u.color.copy(m),t.background=null,p=!0):(u.color.copy(xs),p=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;As(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),p&&o.render(d,r),o.render(t,r)}d.geometry.dispose(),d.material.dispose(),o.toneMapping=h,o.autoClear=l,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===K||t.mapping===$;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Cs()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Rs());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new Nr(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;As(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,ys)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e_s&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${_s}`);const f=[];let g=0;for(let t=0;t<_s;++t){const e=t/p,n=Math.exp(-e*e/2);f.push(n),0===t?g+=n:tv-gs?i-v+gs:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(e),o.render(c,ys)}}function ws(t,e,n){const i=new wn(t,e,n);return i.texture.mapping=et,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function As(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Rs(){return new kr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ls(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1})}function Cs(){return new kr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ls(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1})}function Ls(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Ps(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=s===Q||s===tt,o=s===K||s===$;if(a||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new Ts(t)),i=a?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(a&&s&&s.height>0||o&&s&&function(t){let e=0;const n=6;for(let i=0;ie.maxTextureSize&&(T=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const w=new Float32Array(E*T*4*p),A=new An(w,E,T,p);A.type=vt,A.needsUpdate=!0;const R=4*b;for(let L=0;L0)return t;const r=e*n;let s=Ws[r];if(void 0===s&&(s=new Float32Array(r),Ws[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function Js(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function qa(t,e){const n=function(t){switch(t){case Ee:return["Linear","( value )"];case be:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Ya(t,e){let n;switch(e){case X:n="Linear";break;case j:n="Reinhard";break;case q:n="OptimizedCineon";break;case Y:n="ACESFilmic";break;case Z:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Za(t){return""!==t}function Ja(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Ka(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const $a=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qa(t){return t.replace($a,to)}function to(t,e){const n=ss[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Qa(n)}const eo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function no(t){return t.replace(eo,io)}function io(t,e,n,i){let r="";for(let t=parseInt(e);t0&&(y+="\n"),x=[g,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Za).join("\n"),x.length>0&&(x+="\n")):(y=[ro(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Za).join("\n"),x=[g,ro(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",n.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==W?"#define TONE_MAPPING":"",n.toneMapping!==W?ss.tonemapping_pars_fragment:"",n.toneMapping!==W?Ya("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ss.encodings_pars_fragment,qa("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Za).join("\n")),c=Qa(c),c=Ja(c,n),c=Ka(c,n),h=Qa(h),h=Ja(h,n),h=Ka(h,n),c=no(c),h=no(h),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(M="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",n.glslVersion===Oe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Oe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const S=M+y+c,b=M+x+h,E=Wa(r,r.VERTEX_SHADER,S),T=Wa(r,r.FRAGMENT_SHADER,b);if(r.attachShader(_,E),r.attachShader(_,T),void 0!==n.index0AttributeName?r.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),t.debug.checkShaderErrors){const e=r.getProgramInfoLog(_).trim(),n=r.getShaderInfoLog(E).trim(),i=r.getShaderInfoLog(T).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(_,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,_,E,T);else{const t=ja(r,E,"vertex"),n=ja(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==n&&""!==i||(a=!1);a&&(this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:y},fragmentShader:{log:i,prefix:x}})}let w,A;return r.deleteShader(E),r.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new Va(r,_)),w},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r0,Z=s.clearcoat>0,J=s.iridescence>0,K=s.sheen>0,$=s.transmission>0,Q=Y&&!!s.anisotropyMap,tt=Z&&!!s.clearcoatMap,nt=Z&&!!s.clearcoatNormalMap,it=Z&&!!s.clearcoatRoughnessMap,rt=J&&!!s.iridescenceMap,st=J&&!!s.iridescenceThicknessMap,at=K&&!!s.sheenColorMap,ot=K&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=$&&!!s.transmissionMap,dt=$&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,ft=s.alphaTest>0,gt=!!s.extensions,vt=!!S.attributes.uv1,_t=!!S.attributes.uv2,yt=!!S.attributes.uv3;return{isWebGL2:p,shaderID:w,shaderType:s.type,shaderName:s.name,vertexShader:C,fragmentShader:L,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:I,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:g,instancing:N,instancingColor:N&&null!==x.instanceColor,supportsVertexTextures:f,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Ee,map:O,matcap:F,envMap:B,envMapMode:B&&E.mapping,envMapCubeUVHeight:T,aoMap:z,lightMap:G,bumpMap:H,normalMap:k,displacementMap:f&&V,emissiveMap:X,normalMapObjectSpace:k&&s.normalMapType===Me,normalMapTangentSpace:k&&s.normalMapType===xe,metalnessMap:j,roughnessMap:q,anisotropy:Y,anisotropyMap:Q,clearcoat:Z,clearcoatMap:tt,clearcoatNormalMap:nt,clearcoatRoughnessMap:it,iridescence:J,iridescenceMap:rt,iridescenceThicknessMap:st,sheen:K,sheenColorMap:at,sheenRoughnessMap:ot,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:$,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===d,alphaMap:mt,alphaTest:ft,combine:s.combine,mapUv:O&&_(s.map.channel),aoMapUv:z&&_(s.aoMap.channel),lightMapUv:G&&_(s.lightMap.channel),bumpMapUv:H&&_(s.bumpMap.channel),normalMapUv:k&&_(s.normalMap.channel),displacementMapUv:V&&_(s.displacementMap.channel),emissiveMapUv:X&&_(s.emissiveMap.channel),metalnessMapUv:j&&_(s.metalnessMap.channel),roughnessMapUv:q&&_(s.roughnessMap.channel),anisotropyMapUv:Q&&_(s.anisotropyMap.channel),clearcoatMapUv:tt&&_(s.clearcoatMap.channel),clearcoatNormalMapUv:nt&&_(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&_(s.clearcoatRoughnessMap.channel),iridescenceMapUv:rt&&_(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&_(s.iridescenceThicknessMap.channel),sheenColorMapUv:at&&_(s.sheenColorMap.channel),sheenRoughnessMapUv:ot&&_(s.sheenRoughnessMap.channel),specularMapUv:lt&&_(s.specularMap.channel),specularColorMapUv:ct&&_(s.specularColorMap.channel),specularIntensityMapUv:ht&&_(s.specularIntensityMap.channel),transmissionMapUv:ut&&_(s.transmissionMap.channel),thicknessMapUv:dt&&_(s.thicknessMap.channel),alphaMapUv:mt&&_(s.alphaMap.channel),vertexTangents:!!S.attributes.tangent&&(k||Y),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:_t,vertexUv3s:yt,pointsUvs:!0===x.isPoints&&!!S.attributes.uv&&(O||mt),fog:!!M,useFog:!0===s.fog,fogExp2:M&&M.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:m,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:R,morphTextureStride:U,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:W,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===h,flipSided:s.side===c,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:gt&&!0===s.extensions.derivatives,extensionFragDepth:gt&&!0===s.extensions.fragDepth,extensionDrawBuffers:gt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:gt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:p||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:p||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.isWebGL2&&o.enable(0);e.supportsVertexTextures&&o.enable(1);e.instancing&&o.enable(2);e.instancingColor&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.skinning&&o.enable(4);e.morphTargets&&o.enable(5);e.morphNormals&&o.enable(6);e.morphColors&&o.enable(7);e.premultipliedAlpha&&o.enable(8);e.shadowMapEnabled&&o.enable(9);e.useLegacyLights&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=v[t.type];let n;if(e){const t=os[e];n=Hr.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=u.length;t0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n1&&n.sort(t||uo),i.length>1&&i.sort(e||po),r.length>1&&r.sort(e||po)}}}function fo(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new mo,t.set(e,[r])):n>=i.length?(r=new mo,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function go(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Ln,color:new Ji};break;case"SpotLight":n={position:new Ln,direction:new Ln,color:new Ji,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ln,color:new Ji,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ln,skyColor:new Ji,groundColor:new Ji};break;case"RectAreaLight":n={color:new Ji,position:new Ln,halfWidth:new Ln,halfHeight:new Ln}}return t[e.id]=n,n}}}let vo=0;function _o(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function yo(t,e){const n=new go,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new en};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new en,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new Ln);const s=new Ln,a=new ai,o=new ai;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,m=0,f=0,g=0,v=0,_=0,y=0;s.sort(_o);const x=!0===a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=as.LTC_FLOAT_1,r.rectAreaLTC2=as.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=as.LTC_HALF_1,r.rectAreaLTC2=as.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===m&&M.numDirectionalShadows===f&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===_||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=m,M.numDirectionalShadows=f,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=_,r.version=vo++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new xo(t,e),s.push(a)):a=s[r],a},dispose:function(){n=new WeakMap}}}class So extends Xi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class bo extends Xi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Eo(t,e,n){let i=new es;const r=new en,a=new en,d=new Tn,p=new So({depthPacking:ye}),m=new bo,f={},g=n.maxTextureSize,v={[l]:c,[c]:l,[h]:h},_=new kr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new en},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=_.clone();y.defines.HORIZONTAL_PASS=1;const x=new vr;x.setAttribute("position",new ar(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Nr(x,_),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=s;let b=this.type;function E(n,i){const s=e.update(M);_.defines.VSM_SAMPLES!==n.blurSamples&&(_.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,_.needsUpdate=!0,y.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new wn(r.x,r.y)),_.uniforms.shadow_pass.value=n.map.texture,_.uniforms.resolution.value=n.mapSize,_.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,_,M,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,y,M,null)}function T(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?m:p,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=f[t];void 0===i&&(i={},f[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=r===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:v[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function w(n,r,s,a,l){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let o=0,c=e.length;og||r.y>g)&&(r.x>g&&(a.x=Math.floor(g/u.x),r.x=a.x*u.x,h.mapSize.x=a.x),r.y>g&&(a.y=Math.floor(g/u.y),r.y=a.y*u.y,h.mapSize.y=a.y)),null===h.map||!0===m||!0===f){const t=this.type!==o?{minFilter:st,magFilter:st}:{};null!==h.map&&h.map.dispose(),h.map=new wn(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const v=h.getViewportCount();for(let t=0;t=1):-1!==dt.indexOf("OpenGL ES")&&(ut=parseFloat(/^OpenGL ES (\d)/.exec(dt)[1]),ht=ut>=2);let pt=null,mt={};const ft=t.getParameter(t.SCISSOR_BOX),gt=t.getParameter(t.VIEWPORT),vt=(new Tn).fromArray(ft),_t=(new Tn).fromArray(gt);function yt(e,n,i,r){const s=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Ke:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===f&&(f=_(s,a));const o=n?_(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Ze(t.width)&&Ze(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==st&&t.minFilter!==lt}function S(e){t.generateMipmap(e)}function b(n,i,r,s,a=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===be&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==st&&t.minFilter!==lt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function T(e){return e===st||e===at||e===ot?t.NEAREST:t.LINEAR}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&R(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}(e),e.isVideoTexture&&m.delete(e)}function A(e){const n=e.target;n.removeEventListener("dispose",A),function(e){const n=e.texture,r=i.get(e),s=i.get(n);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void O(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const P={[nt]:t.REPEAT,[it]:t.CLAMP_TO_EDGE,[rt]:t.MIRRORED_REPEAT},I={[st]:t.NEAREST,[at]:t.NEAREST_MIPMAP_NEAREST,[ot]:t.NEAREST_MIPMAP_LINEAR,[lt]:t.LINEAR,[ct]:t.LINEAR_MIPMAP_NEAREST,[ht]:t.LINEAR_MIPMAP_LINEAR},U={[Ae]:t.NEVER,[De]:t.ALWAYS,[Re]:t.LESS,[Le]:t.LEQUAL,[Ce]:t.EQUAL,[Ue]:t.GEQUAL,[Pe]:t.GREATER,[Ie]:t.NOTEQUAL};function D(n,s,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,P[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,P[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,P[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,I[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,I[s.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===it&&s.wrapT===it||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,T(s.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,T(s.minFilter)),s.minFilter!==st&&s.minFilter!==lt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,U[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===st)return;if(s.minFilter!==ot&&s.minFilter!==ht)return;if(s.type===vt&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===_t&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function N(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&R(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function O(e,r,a){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=N(e,r),u=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!o&&(t.wrapS!==it||t.wrapT!==it||t.minFilter!==st&&t.minFilter!==lt)}(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=k(r,i);const p=x(i)||o,m=s.convert(r.format,r.colorSpace);let f,g=s.convert(r.type),v=b(r.internalFormat,m,g,r.colorSpace);D(l,r,p);const _=r.mipmaps,T=o&&!0!==r.isVideoTexture,w=void 0===d.__version||!0===c,A=E(r,i,p);if(r.isDepthTexture)v=t.DEPTH_COMPONENT,o?v=r.type===vt?t.DEPTH_COMPONENT32F:r.type===gt?t.DEPTH_COMPONENT24:r.type===Mt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===vt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===wt&&v===t.DEPTH_COMPONENT&&r.type!==mt&&r.type!==gt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=gt,g=s.convert(r.type)),r.format===At&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,r.type!==Mt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Mt,g=s.convert(r.type))),w&&(T?n.texStorage2D(t.TEXTURE_2D,1,v,i.width,i.height):n.texImage2D(t.TEXTURE_2D,0,v,i.width,i.height,0,m,g,null));else if(r.isDataTexture)if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e>=1,r>>=1}}else if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0),n.bindFramebuffer(t.FRAMEBUFFER,null)}function B(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||H(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===vt?r=t.DEPTH_COMPONENT32F:e.type===gt&&(r=t.DEPTH_COMPONENT24));const i=G(n);H(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=G(n);i&&!1===H(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):H(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function k(t,n){const i=t.colorSpace,r=t.format,s=t.type;return!0===t.isCompressedTexture||t.format===Fe||i!==Ee&&i!==Se&&(i===be?!1===o?!0===e.has("EXT_sRGB")&&r===bt?(t.format=Fe,t.minFilter=lt,t.generateMipmaps=!1):n=yn.sRGBToLinear(n):r===bt&&s===ut||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}this.allocateTextureUnit=function(){const t=C;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=L,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=N(e,r),h=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=k(r,d[t]);const p=d[0],m=x(p)||o,f=s.convert(r.format,r.colorSpace),g=s.convert(r.type),v=b(r.internalFormat,f,g,r.colorSpace),_=o&&!0!==r.isVideoTexture,T=void 0===u.__version||!0===l;let w,A=E(r,p,m);if(D(t.TEXTURE_CUBE_MAP,r,m),e){_&&T&&n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,p.width,p.height);for(let e=0;e<6;e++){w=d[e].mipmaps;for(let i=0;i0&&A++,n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(i){_?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,f,g,d[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,f,g,d[e].data);for(let i=0;i0&&!1===H(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n0&&!1===H(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Lo)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Co;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Io extends En{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:wt)!==wt&&c!==At)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===wt&&(n=gt),void 0===n&&c===At&&(n=Mt),super(null,i,r,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:st,this.minFilter=void 0!==o?o:st,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class Uo extends Ge{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const m=e.getContextAttributes();let f=null,g=null;const v=[],_=[];let y=null;const x=new Wr;x.layers.enable(1),x.viewport=new Tn;const M=new Wr;M.layers.enable(2),M.viewport=new Tn;const S=[x,M],b=new Ro;b.layers.enable(1),b.layers.enable(2);let E=null,T=null;function w(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function A(){i.removeEventListener("select",w),i.removeEventListener("selectstart",w),i.removeEventListener("selectend",w),i.removeEventListener("squeeze",w),i.removeEventListener("squeezestart",w),i.removeEventListener("squeezeend",w),i.removeEventListener("end",A),i.removeEventListener("inputsourceschange",R);for(let t=0;t=0&&(_[i]=null,v[i].disconnect(n))}for(let e=0;e=_.length){_.push(n),i=t;break}if(null===_[t]){_[t]=n,i=t;break}}if(-1===i)break}const r=v[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getCamera=function(){},this.setUserCamera=function(t){y=t},this.getController=function(t){let e=v[t];return void 0===e&&(e=new Po,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new Po,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new Po,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(f=t.getRenderTarget(),i.addEventListener("select",w),i.addEventListener("selectstart",w),i.addEventListener("selectend",w),i.addEventListener("squeeze",w),i.addEventListener("squeezestart",w),i.addEventListener("squeezeend",w),i.addEventListener("end",A),i.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new wn(d.framebufferWidth,d.framebufferHeight,{format:bt,type:ut,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,s=null,a=null;m.depth&&(a=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?At:wt,s=m.stencil?Mt:gt);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(o),i.updateRenderState({layers:[u]}),g=new wn(u.textureWidth,u.textureHeight,{format:bt,type:ut,depthTexture:new Io(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),U.setContext(i),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const C=new Ln,L=new Ln;function P(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCameraXR=function(t){if(null===i)return t;y&&(t=y),b.near=M.near=x.near=t.near,b.far=M.far=x.far=t.far,E===b.near&&T===b.far||(i.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,T=b.far);const e=t.parent,n=b.cameras;P(b,e);for(let t=0;t0&&(i.alphaTest.value=r.alphaTest);const s=e.get(r).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t.useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Gr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===c&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function No(t,e,n,i){let r={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n){const i=t.value;if(void 0===n[e]){if("number"==typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e0){r=n%i;0!==r&&i-r-a.boundary<0&&(n+=i-r,s.__offset=n)}n+=a.storage}r=n%i,r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=i.toneMapped?S.toneMapping:W,f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,v=nt.get(i),_=y.state.lights;if(!0===V&&(!0===X||t!==R)){const e=t===R&&i.id===A;St.setState(i,t,e)}let x=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==_.state.version||v.outputColorSpace!==o||r.isInstancedMesh&&!1===v.instancing?x=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?x=!0:r.isSkinnedMesh||!0!==v.skinning?v.envMap!==l||!0===i.fog&&v.fog!==s?x=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===St.numPlanes&&v.numIntersection===St.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==m||!0===Q.isWebGL2&&v.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:(x=!0,v.__version=i.version);let M=v.currentProgram;!0===x&&(M=Kt(i,e,r));let b=!1,E=!1,T=!1;const C=M.getUniforms(),L=v.uniforms;tt.useProgram(M.program)&&(b=!0,E=!0,T=!0);i.id!==A&&(A=i.id,E=!0);if(b||R!==t){if(C.setValue(Nt,"projectionMatrix",t.projectionMatrix),Q.logarithmicDepthBuffer&&C.setValue(Nt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),R!==t&&(R=t,E=!0,T=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=C.map.cameraPosition;void 0!==e&&e.setValue(Nt,Z.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&C.setValue(Nt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&C.setValue(Nt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){C.setOptional(Nt,r,"bindMatrix"),C.setOptional(Nt,r,"bindMatrixInverse");const t=r.skeleton;t&&(Q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),C.setValue(Nt,"boneTexture",t.boneTexture,it),C.setValue(Nt,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const P=n.morphAttributes;(void 0!==P.position||void 0!==P.normal||void 0!==P.color&&!0===Q.isWebGL2)&&wt.update(r,n,M);(E||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,C.setValue(Nt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(L.envMap.value=l,L.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);E&&(C.setValue(Nt,"toneMappingExposure",S.toneMappingExposure),v.needsLights&&(U=T,(I=L).ambientLightColor.needsUpdate=U,I.lightProbe.needsUpdate=U,I.directionalLights.needsUpdate=U,I.directionalLightShadows.needsUpdate=U,I.pointLights.needsUpdate=U,I.pointLightShadows.needsUpdate=U,I.spotLights.needsUpdate=U,I.spotLightShadows.needsUpdate=U,I.rectAreaLights.needsUpdate=U,I.hemisphereLights.needsUpdate=U),s&&!0===i.fog&&dt.refreshFogUniforms(L,s),dt.refreshMaterialUniforms(L,i,O,N,j),Va.upload(Nt,v.uniformsList,L,it));var I,U;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Va.upload(Nt,v.uniformsList,L,it),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&C.setValue(Nt,"center",r.center);if(C.setValue(Nt,"modelViewMatrix",r.modelViewMatrix),C.setValue(Nt,"normalMatrix",r.normalMatrix),C.setValue(Nt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e0&&function(t,e,n,i){const r=Q.isWebGL2;null===j&&(j=new wn(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?_t:ut,minFilter:ht,samples:r&&!0===o?4:0}));S.getDrawingBufferSize(Y),r?j.setSize(Y.x,Y.y):j.setSize(Ke(Y.x),Ke(Y.y));const s=S.getRenderTarget();S.setRenderTarget(j),S.getClearColor(I),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5);S.clear();const a=S.toneMapping;S.toneMapping=W,Zt(t,n,i),it.updateMultisampleRenderTarget(j),it.updateRenderTargetMipmap(j);let l=!1;for(let t=0,r=e.length;t0&&Zt(r,e,n),s.length>0&&Zt(s,e,n),a.length>0&&Zt(a,e,n),tt.buffers.depth.setTest(!0),tt.buffers.depth.setMask(!0),tt.buffers.color.setMask(!0),tt.setPolygonOffset(!1)}function Zt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?M[M.length-1]:null,x.pop(),_=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){nt.get(t.texture).__webglTexture=e,nt.get(t.depthTexture).__webglTexture=n;const i=nt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=nt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,E=e,T=n;let i=!0,r=null,s=!1,a=!1;if(t){const n=nt.get(t);void 0!==n.__useDefaultFramebuffer?(tt.bindFramebuffer(Nt.FRAMEBUFFER,null),i=!1):void 0===n.__webglFramebuffer?it.setupRenderTarget(t):n.__hasExternalTextures&&it.rebindTextures(t,nt.get(t.texture).__webglTexture,nt.get(t.depthTexture).__webglTexture);const o=t.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=nt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],s=!0):r=Q.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?nt.get(t).__webglMultisampledFramebuffer:l,C.copy(t.viewport),L.copy(t.scissor),P=t.scissorTest}else C.copy(z).multiplyScalar(O).floor(),L.copy(G).multiplyScalar(O).floor(),P=H;if(tt.bindFramebuffer(Nt.FRAMEBUFFER,r)&&Q.drawBuffers&&i&&tt.drawBuffers(t,r),tt.viewport(C),tt.scissor(L),tt.setScissorTest(P),s){const i=nt.get(t.texture);Nt.framebufferTexture2D(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,Nt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=nt.get(t.texture),r=e||0;Nt.framebufferTextureLayer(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}A=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){tt.bindFramebuffer(Nt.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==bt&&Lt.convert(o)!==Nt.getParameter(Nt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===_t&&($.has("EXT_color_buffer_half_float")||Q.isWebGL2&&$.has("EXT_color_buffer_float"));if(!(l===ut||Lt.convert(l)===Nt.getParameter(Nt.IMPLEMENTATION_COLOR_READ_TYPE)||l===vt&&(Q.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Nt.readPixels(e,n,i,r,Lt.convert(o),Lt.convert(l),s)}finally{const t=null!==w?nt.get(w).__webglFramebuffer:null;tt.bindFramebuffer(Nt.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),Nt.copyTexSubImage2D(Nt.TEXTURE_2D,n,0,0,t.x,t.y,r,s),tt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=Lt.convert(n.format),o=Lt.convert(n.type);it.setTexture2D(n,0),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,n.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Nt.texSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?Nt.compressedTexSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):Nt.texSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&Nt.generateMipmap(Nt.TEXTURE_2D),tt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(S.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=Lt.convert(i.format),c=Lt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=Nt.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=Nt.TEXTURE_2D_ARRAY}Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,i.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,i.unpackAlignment);const u=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),d=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),p=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),m=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),f=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,g.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,g.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,t.min.x),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,t.min.y),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Nt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Nt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,g.data)):Nt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,u),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,d),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,p),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,m),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,f),0===r&&i.generateMipmaps&&Nt.generateMipmap(h),tt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),tt.unbindTexture()},this.resetState=function(){E=0,T=0,w=null,tt.reset(),Ut.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Be}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===be?_e:ve}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===_e?be:Ee}}class Bo extends Fo{}Bo.prototype.isWebGL1Renderer=!0;class zo{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ji(t),this.density=e}clone(){return new zo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Go{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ji(t),this.near=e,this.far=n}clone(){return new Go(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Ho extends Pi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class ko{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ne,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Xe()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:qo.clone(),uv:Vi.getInterpolation(qo,Qo,tl,el,nl,il,rl,new en),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function al(t,e,n,i,r,s){Jo.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Ko.x=s*Jo.x-r*Jo.y,Ko.y=r*Jo.x+s*Jo.y):Ko.copy(Jo),t.copy(e),t.x+=Ko.x,t.y+=Ko.y,t.applyMatrix4($o)}const ol=new Ln,ll=new Ln;class cl extends Pi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){ol.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(ol);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){ol.setFromMatrixPosition(t.matrixWorld),ll.setFromMatrixPosition(this.matrixWorld);const n=ol.distanceTo(ll)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(m.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class $l extends En{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Ql{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new en:new Ln);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new Ln,i=[],r=[],s=[],a=new Ln,o=new ai;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new Ln)}r[0]=new Ln,s[0]=new Ln;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(je(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(je(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class tc extends Ql{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new en,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(ic.subVectors(i[0],i[1]).add(i[0]),a=ic);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(lc(a,o.x,l.x,c.x,h.x),lc(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Mc extends vr{constructor(t=[new en(0,-.5),new en(.5,0),new en(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=je(i,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new Ln,u=new en,d=new Ln,p=new Ln,m=new Ln;let f=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,m.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),o.push(d.x,d.y,d.z),m.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),m=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*m,s.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),a.push(u.x,u.y);const i=o[3*n+0]*p,c=o[3*n+1],d=o[3*n+0]*m;l.push(i,c,d)}}for(let n=0;n0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new cr(h,3)),this.setAttribute("normal",new cr(u,3)),this.setAttribute("uv",new cr(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ec(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Tc extends Ec{constructor(t=1,e=1,n=32,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Tc(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class wc extends vr{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new cr(r,3)),this.setAttribute("normal",new cr(r.slice(),3)),this.setAttribute("uv",new cr(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new wc(t.vertices,t.indices,t.radius,t.details)}}class Ac extends wc{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ac(t.radius,t.detail)}}const Rc=new Ln,Cc=new Ln,Lc=new Ln,Pc=new Vi;class Ic extends vr{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(Ve*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Fc(s,a,n,o,l,p,0),a};function Nc(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=nh(s,t[s],t[s+1],a);return a&&Jc(a,a.next)&&(ih(a),a=a.next),a}function Oc(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!Jc(i,i.next)&&0!==Zc(i.prev,i,i.next))i=i.next;else{if(ih(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Fc(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=Xc(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?zc(t,i,r,s):Bc(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),ih(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Fc(t=Gc(Oc(t),e,n),e,n,i,r,s,2):2===a&&Hc(t,e,n,i,r,s):Fc(Oc(t),e,n,i,r,s,1);break}}function Bc(t){const e=t.prev,n=t,i=t.next;if(Zc(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&qc(r,o,s,l,a,c,m.x,m.y)&&Zc(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function zc(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Zc(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=Xc(p,m,e,n,i),_=Xc(f,g,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&qc(o,h,l,u,c,d,y.x,y.y)&&Zc(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&qc(o,h,l,u,c,d,x.x,x.y)&&Zc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&qc(o,h,l,u,c,d,y.x,y.y)&&Zc(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&qc(o,h,l,u,c,d,x.x,x.y)&&Zc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Gc(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!Jc(r,s)&&Kc(r,i,i.next,s)&&th(r,s)&&th(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),ih(i),ih(i.next),i=t=s),i=i.next}while(i!==t);return Oc(i)}function Hc(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Yc(a,t)){let o=eh(a,t);return a=Oc(a,a.next),o=Oc(o,o.next),Fc(a,e,n,i,r,s,0),void Fc(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function kc(t,e){return t.x-e.x}function Vc(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x=i.x&&i.x>=l&&s!==i.x&&qc(an.x||i.x===n.x&&Wc(n,i)))&&(n=i,u=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=eh(n,t);return Oc(i,i.next),Oc(n,n.next)}function Wc(t,e){return Zc(t.prev,t,e.prev)<0&&Zc(e.next,t,t.next)<0}function Xc(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function jc(t){let e=t,n=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function Yc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Kc(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(th(t,e)&&th(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Zc(t.prev,t,e.prev)||Zc(t,e.prev,e))||Jc(t,e)&&Zc(t.prev,t,t.next)>0&&Zc(e.prev,e,e.next)>0)}function Zc(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Jc(t,e){return t.x===e.x&&t.y===e.y}function Kc(t,e,n,i){const r=Qc(Zc(t,e,n)),s=Qc(Zc(t,e,i)),a=Qc(Zc(n,i,t)),o=Qc(Zc(n,i,e));return r!==s&&a!==o||(!(0!==r||!$c(t,n,e))||(!(0!==s||!$c(t,i,e))||(!(0!==a||!$c(n,t,i))||!(0!==o||!$c(n,e,i)))))}function $c(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Qc(t){return t>0?1:t<0?-1:0}function th(t,e){return Zc(t.prev,t,t.next)<0?Zc(t,e,t.next)>=0&&Zc(t,t.prev,e)>=0:Zc(t,e,t.prev)<0||Zc(t,t.next,e)<0}function eh(t,e){const n=new rh(t.i,t.x,t.y),i=new rh(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function nh(t,e,n,i){const r=new rh(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ih(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function rh(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class sh{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function oh(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,m=e.y+a/u,f=((n.x-c/d-p)*c-(n.y+l/d-m)*l)/(a*c-o*l);i=p+a*f-t.x,r=m+o*f-t.y;const g=i*i+r*r;if(g<=2)return new en(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new en(i/s,r/s)}const P=[];for(let t=0,e=w.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=w.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t0)&&d.push(e,r,l),(t!==n-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class wh extends Xi{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ji(16777215),this.specular=new Ji(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ji(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new en(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=H,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Ah extends Xi{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ji(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ji(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new en(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Rh extends Xi{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new en(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Ch extends Xi{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ji(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ji(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new en(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=H,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Lh extends Xi{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ji(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new en(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Ph extends Dl{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Ih(t,e,n){return Dh(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Uh(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Dh(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Nh(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n}function Oh(t,e,n){const i=t.length,r=new t.constructor(i);for(let s=0,a=0;a!==i;++s){const i=n[s]*e;for(let n=0;n!==e;++n)r[a++]=t[i+n]}return r}function Fh(t,e,n,i){let r=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[r++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),n.push.apply(n,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(n,n.length)),s=t[r++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),n.push(a)),s=t[r++]}while(void 0!==s)}const Bh={arraySlice:Ih,convertArray:Uh,isTypedArray:Dh,getKeyframeOrder:Nh,sortedArray:Oh,flattenJSON:Fh,subclip:function(t,e,n,i,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Ih(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Ih(t.resultBuffer,e,n)}if("quaternion"===r){(new Cn).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Ih(n,r,s),this.values=Ih(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&Dh(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Ih(this.times),e=Ih(this.values),n=this.getValueSize(),i=this.getInterpolation()===ue,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Ih(t,0,s),this.values=Ih(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Ih(this.times,0),e=Ih(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Vh.prototype.TimeBufferType=Float32Array,Vh.prototype.ValueBufferType=Float32Array,Vh.prototype.DefaultInterpolation=he;class Wh extends Vh{}Wh.prototype.ValueTypeName="bool",Wh.prototype.ValueBufferType=Array,Wh.prototype.DefaultInterpolation=ce,Wh.prototype.InterpolantFactoryMethodLinear=void 0,Wh.prototype.InterpolantFactoryMethodSmooth=void 0;class Xh extends Vh{}Xh.prototype.ValueTypeName="color";class jh extends Vh{}jh.prototype.ValueTypeName="number";class qh extends zh{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)Cn.slerpFlat(r,0,s,l-a,s,l,o);return r}}class Yh extends Vh{InterpolantFactoryMethodLinear(t){return new qh(this.times,this.values,this.getValueSize(),t)}}Yh.prototype.ValueTypeName="quaternion",Yh.prototype.DefaultInterpolation=he,Yh.prototype.InterpolantFactoryMethodSmooth=void 0;class Zh extends Vh{}Zh.prototype.ValueTypeName="string",Zh.prototype.ValueBufferType=Array,Zh.prototype.DefaultInterpolation=ce,Zh.prototype.InterpolantFactoryMethodLinear=void 0,Zh.prototype.InterpolantFactoryMethodSmooth=void 0;class Jh extends Vh{}Jh.prototype.ValueTypeName="vector";class Kh{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Xe(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push($h(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(Vh.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];Fh(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==iu[t])return void iu[t].push({onLoad:e,onProgress:n,onError:i});iu[t]=[],iu[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=iu[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Qh.add(t,e);const n=iu[t];delete iu[t];for(let t=0,i=n.length;t{const n=iu[t];if(void 0===n)throw this.manager.itemError(t),e;delete iu[t];for(let t=0,i=n.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class au extends nu{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=Qh.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=ln("img");function o(){c(),Qh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class ou extends Pi{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Ji(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class lu extends ou{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ji(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const cu=new ai,hu=new Ln,uu=new Ln;class du{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new en(512,512),this.map=null,this.mapPass=null,this.matrix=new ai,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new es,this._frameExtents=new en(1,1),this._viewportCount=1,this._viewports=[new Tn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;hu.setFromMatrixPosition(t.matrixWorld),e.position.copy(hu),uu.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(uu),e.updateMatrixWorld(),cu.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(cu),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(cu)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class pu extends du{constructor(){super(new Wr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*We*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class mu extends ou{constructor(t,e,n=0,i=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.distance=n,this.angle=i,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new pu}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const fu=new ai,gu=new Ln,vu=new Ln;class _u extends du{constructor(){super(new Wr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new en(4,2),this._viewportCount=6,this._viewports=[new Tn(2,1,1,1),new Tn(0,1,1,1),new Tn(3,1,1,1),new Tn(1,1,1,1),new Tn(3,0,1,1),new Tn(1,0,1,1)],this._cubeDirections=[new Ln(1,0,0),new Ln(-1,0,0),new Ln(0,0,1),new Ln(0,0,-1),new Ln(0,1,0),new Ln(0,-1,0)],this._cubeUps=[new Ln(0,1,0),new Ln(0,1,0),new Ln(0,1,0),new Ln(0,1,0),new Ln(0,0,1),new Ln(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),gu.setFromMatrixPosition(t.matrixWorld),n.position.copy(gu),vu.copy(n.position),vu.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(vu),n.updateMatrixWorld(),i.makeTranslation(-gu.x,-gu.y,-gu.z),fu.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fu)}}class yu extends ou{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new _u}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class xu extends du{constructor(){super(new fs(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Mu extends ou{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.shadow=new xu}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class Su extends ou{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class bu extends ou{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Eu{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Ln)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*i*1.092548),e.addScaledVector(s[5],i*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],n*r*1.092548),e.addScaledVector(s[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*i),e.addScaledVector(s[5],.858086*i*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*n*r),e.addScaledVector(s[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class Tu extends ou{constructor(t=new Eu,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class wu extends nu{constructor(t){super(t),this.textures={}}load(t,e,n,i){const r=this,s=new su(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=wu.createMaterialFromType(t.type);if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&void 0!==i.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=t.sheen),void 0!==t.sheenColor&&(i.sheenColor=(new Ji).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(i.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==i.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==i.specular&&i.specular.setHex(t.specular),void 0!==t.specularIntensity&&(i.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(i.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(i.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(i.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.thickness&&(i.thickness=t.thickness),void 0!==t.attenuationDistance&&(i.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(i.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(i.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.shadowSide&&(i.shadowSide=t.shadowSide),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.alphaToCoverage&&(i.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(i.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(i.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Ji).setHex(r.value);break;case"v2":i.uniforms[e].value=(new en).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new Ln).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new Tn).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new nn).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new ai).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new en).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new en).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:Sh,SpriteMaterial:Xo,RawShaderMaterial:bh,ShaderMaterial:kr,PointsMaterial:Xl,MeshPhysicalMaterial:Th,MeshStandardMaterial:Eh,MeshPhongMaterial:wh,MeshToonMaterial:Ah,MeshNormalMaterial:Rh,MeshLambertMaterial:Ch,MeshDepthMaterial:So,MeshDistanceMaterial:bo,MeshBasicMaterial:$i,MeshMatcapMaterial:Lh,LineDashedMaterial:Ph,LineBasicMaterial:Dl,Material:Xi}[t]}}class Au{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){Cn.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;Cn.multiplyQuaternionsFlat(t,s,t,e,t,n),Cn.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const Ju="\\[\\]\\.:\\/",Ku=new RegExp("["+Ju+"]","g"),$u="[^"+Ju+"]",Qu="[^"+Ju.replace("\\.","")+"]",td=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",$u)+/(WCOD+)?/.source.replace("WCOD",Qu)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",$u)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",$u)+"$"),ed=["material","materials","bones","map"];class nd{constructor(t,e,n){this.path=e,this.parsedPath=n||nd.parseTrackName(e),this.node=nd.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new nd.Composite(t,e,n):new nd(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Ku,"")}static parseTrackName(t){const e=td.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==ed.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===ge)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=pe,i.endingEnd=pe):(i.endingStart=t?this.zeroSlopeAtStart?pe:de:me,i.endingEnd=e?this.zeroSlopeAtEnd?pe:de:me)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}const rd=new Float32Array(1);class sd{constructor(t){this.value=t}clone(){return new sd(void 0===this.value.clone?this.value:this.value.clone())}}let ad=0;function od(t,e){return t.distance-e.distance}function ld(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new nd(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}},t.AnimationUtils=Bh,t.ArcCurve=ec,t.ArrayCamera=Ro,t.ArrowHelper=class extends Pi{constructor(t=new Ln(0,0,1),e=new Ln(0,0,0),n=1,i=16776960,r=.2*n,s=.2*r){super(),this.type="ArrowHelper",void 0===Rd&&(Rd=new vr,Rd.setAttribute("position",new cr([0,0,0,0,1,0],3)),Cd=new Ec(0,.5,1,5,1),Cd.translate(0,-.5,0)),this.position.copy(e),this.line=new Gl(Rd,new Dl({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Nr(Cd,new $i({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Ad.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Ad,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},t.Audio=Wu,t.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;nthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,cd).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},t.Box3=Un,t.Box3Helper=class extends Vl{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vr;i.setIndex(new ar(n,1)),i.setAttribute("position",new cr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new Dl({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BoxBufferGeometry=class extends Fr{constructor(t,e,n,i,r,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(t,e,n,i,r,s)}},t.BoxGeometry=Fr,t.BoxHelper=class extends Vl{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new vr;r.setIndex(new ar(n,1)),r.setAttribute("position",new ar(i,3)),super(r,new Dl({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&wd.setFromObject(this.object),wd.isEmpty())return;const e=wd.min,n=wd.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BufferAttribute=ar,t.BufferGeometry=vr,t.BufferGeometryLoader=Cu,t.ByteType=dt,t.Cache=Qh,t.Camera=Vr,t.CameraHelper=class extends Vl{constructor(t){const e=new vr,n=new Dl({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],s={};function a(t,e){o(t),o(e)}function o(t){i.push(0,0,0),r.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(i.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new cr(i,3)),e.setAttribute("color",new cr(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new Ji(16755200),c=new Ji(16711680),h=new Ji(43775),u=new Ji(16777215),d=new Ji(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,n,i,r){const s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,n.r,n.g,n.b),s.setXYZ(33,n.r,n.g,n.b),s.setXYZ(34,n.r,n.g,n.b),s.setXYZ(35,n.r,n.g,n.b),s.setXYZ(36,n.r,n.g,n.b),s.setXYZ(37,n.r,n.g,n.b),s.setXYZ(38,i.r,i.g,i.b),s.setXYZ(39,i.r,i.g,i.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Ed.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Td("c",e,t,Ed,0,0,-1),Td("t",e,t,Ed,0,0,1),Td("n1",e,t,Ed,-1,-1,-1),Td("n2",e,t,Ed,1,-1,-1),Td("n3",e,t,Ed,-1,1,-1),Td("n4",e,t,Ed,1,1,-1),Td("f1",e,t,Ed,-1,-1,1),Td("f2",e,t,Ed,1,-1,1),Td("f3",e,t,Ed,-1,1,1),Td("f4",e,t,Ed,1,1,1),Td("u1",e,t,Ed,.7,1.1,-1),Td("u2",e,t,Ed,-.7,1.1,-1),Td("u3",e,t,Ed,0,2,-1),Td("cf1",e,t,Ed,-1,0,1),Td("cf2",e,t,Ed,1,0,1),Td("cf3",e,t,Ed,0,-1,1),Td("cf4",e,t,Ed,0,1,1),Td("cn1",e,t,Ed,-1,0,-1),Td("cn2",e,t,Ed,1,0,-1),Td("cn3",e,t,Ed,0,-1,-1),Td("cn4",e,t,Ed,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasTexture=class extends En{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},t.CapsuleBufferGeometry=class extends Sc{constructor(t,e,n,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(t,e,n,i)}},t.CapsuleGeometry=Sc,t.CatmullRomCurve3=oc,t.CineonToneMapping=q,t.CircleBufferGeometry=class extends bc{constructor(t,e,n,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(t,e,n,i)}},t.CircleGeometry=bc,t.ClampToEdgeWrapping=it,t.Clock=Bu,t.Color=Ji,t.ColorKeyframeTrack=Xh,t.ColorManagement=vn,t.CompressedArrayTexture=class extends $l{constructor(t,e,n,i,r,s){super(t,e,n,r,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=it}},t.CompressedTexture=$l,t.CompressedTextureLoader=class extends nu{constructor(t){super(t)}load(t,e,n,i){const r=this,s=[],a=new $l,o=new su(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;function c(c){o.load(t[c],(function(t){const n=r.parse(t,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=lt),a.image=s,a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,i)}if(Array.isArray(t))for(let e=0,n=t.length;e0){const n=new tu(e);r=new au(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e0){i=new au(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e1)for(let n=0;nNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=sh.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Uc,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let e=0,a=i.length;e1){let t=!1,n=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},t.WebGL1Renderer=Bo,t.WebGL3DRenderTarget=class extends wn{constructor(t=1,e=1,n=1){super(t,e),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Rn(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLArrayRenderTarget=class extends wn{constructor(t=1,e=1,n=1){super(t,e),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new An(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLCoordinateSystem=Be,t.WebGLCubeRenderTarget=Yr,t.WebGLMultipleRenderTargets=class extends wn{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let t=0;t是否编辑 - 显示列表 + 显示列表 @@ -86,7 +86,7 @@
diff --git a/src/example/control/inside/popup/map.js b/src/example/control/inside/popup/map.js index 1f79b512..3c81c183 100644 --- a/src/example/control/inside/popup/map.js +++ b/src/example/control/inside/popup/map.js @@ -282,3 +282,27 @@ function showXQ() { const showHistoryLayer = true eventTarget.fire("showWebsite", { showHistoryLayer }) } + +// 在原始ceisum对象绑定popup +export function bindCesiumEntityDemo() { + const blueBox = map.viewer.entities.add({ + name: "Blue box", + position: Cesium.Cartesian3.fromDegrees(116.316945, 30.893873, 1000), + box: { + dimensions: new Cesium.Cartesian3(4000.0, 3000.0, 5000.0), + material: Cesium.Color.BLUE + } + }) + + const innerHtml = ` + + + + +
在原始ceisum对象绑定popup
说明:在原始ceisum对象绑定popup
方式:可以绑定任意html
备注:我是在原始ceisum对象绑定popup
` + + blueBox._popupConfig = { + content: innerHtml, // 支持回调方法,同bindPopup的第1个参数 + options: { offsetY: -30, closeOnClick: false, autoClose: false } // 同bindPopup的第2个参数 + } +} diff --git a/src/example/graphic/combine/flatBillboard/index.vue b/src/example/graphic/combine/flatBillboard/index.vue index 846b54d8..cf5f3def 100644 --- a/src/example/graphic/combine/flatBillboard/index.vue +++ b/src/example/graphic/combine/flatBillboard/index.vue @@ -1,6 +1,6 @@ -